From: Andrea Bianco Date: Sun, 26 Sep 2021 14:38:17 +0000 (+0200) Subject: Built motion from commit 5248409e.|2.5.36 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=1e0989f52f5a9c6cf7df76b28bd8e4c784c73889;p=motion2.git Built motion from commit 5248409e.|2.5.36 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4374b04..3c11400 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-09-26T13:12:57.862Z", + "time": "2021-09-26T14:20:19.594Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a95558f..51810bf 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-26T13:12:57.862Z", + "time": "2021-09-26T14:20:19.594Z", "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 e4e6f8c..c2d3f03 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 _0x668b=['integration','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','STRING','contactManager'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x668b,0x1b5));var _0xb668=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0x668b[_0x45ce08];return _0x23dff2;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xe2fd15){return this[_0xb668('0x2')]('action');}},'action':{'type':Sequelize[_0xb668('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb668('0x4'),_0xb668('0x5'),'motionbar',_0xb668('0x6'),_0xb668('0x7'),'browser','bot',_0xb668('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb668('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xb668('0xa')},'data2':{'type':Sequelize[_0xb668('0x3')](0x1000),'comment':_0xb668('0xb')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb668('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xb668('0x3')](0x1000),'comments':_0xb668('0xd')},'data6':{'type':Sequelize[_0xb668('0x3')],'comments':_0xb668('0xe')},'data7':{'type':Sequelize[_0xb668('0xf')],'comments':_0xb668('0x10')}}; \ No newline at end of file +var _0x8a54=['jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','STRING','contactManager','integration'];(function(_0x25b33e,_0x591343){var _0x3f9855=function(_0x3a77a0){while(--_0x3a77a0){_0x25b33e['push'](_0x25b33e['shift']());}};_0x3f9855(++_0x591343);}(_0x8a54,0xca));var _0x48a5=function(_0x599629,_0x352681){_0x599629=_0x599629-0x0;var _0xaa16e9=_0x8a54[_0x599629];return _0xaa16e9;};'use strict';var Sequelize=require(_0x48a5('0x0'));module[_0x48a5('0x1')]={'name':{'type':Sequelize[_0x48a5('0x2')],'get':function(_0x1a488e){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x48a5('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x48a5('0x4'),_0x48a5('0x5'),'motionbar',_0x48a5('0x6'),_0x48a5('0x7'),'browser','bot',_0x48a5('0x8')]],'msg':_0x48a5('0x9')}},'comment':_0x48a5('0x9')},'data1':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comment':_0x48a5('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comment':_0x48a5('0xb')},'data4':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x48a5('0x3')](0x1000),'comments':_0x48a5('0xc')},'data6':{'type':Sequelize['STRING'],'comments':_0x48a5('0xd')},'data7':{'type':Sequelize[_0x48a5('0xe')],'comments':_0x48a5('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 3bf3752..bcf0ac5 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 _0x343e=['error','stack','send','body','Action','params','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end'];(function(_0x25d542,_0x462ad9){var _0x377a7e=function(_0x5bd8ee){while(--_0x5bd8ee){_0x25d542['push'](_0x25d542['shift']());}};_0x377a7e(++_0x462ad9);}(_0x343e,0xd9));var _0xe343=function(_0x434848,_0x26e2bb){_0x434848=_0x434848-0x0;var _0x448e06=_0x343e[_0x434848];return _0x448e06;};'use strict';var emlformat=require(_0xe343('0x0'));var rimraf=require(_0xe343('0x1'));var zipdir=require(_0xe343('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe343('0x3'));var moment=require('moment');var BPromise=require(_0xe343('0x4'));var Mustache=require('mustache');var util=require(_0xe343('0x5'));var path=require(_0xe343('0x6'));var sox=require('sox');var csv=require(_0xe343('0x7'));var ejs=require(_0xe343('0x8'));var fs=require('fs');var fs_extra=require(_0xe343('0x9'));var _=require(_0xe343('0xa'));var squel=require('squel');var crypto=require(_0xe343('0xb'));var jsforce=require(_0xe343('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe343('0x7'));var querystring=require(_0xe343('0xd'));var Papa=require('papaparse');var Redis=require(_0xe343('0xe'));var authService=require(_0xe343('0xf'));var qs=require(_0xe343('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe343('0x11'));var logger=require(_0xe343('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xe343('0x13'));var licenseUtil=require(_0xe343('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x260246,_0x4d0138){_0x4d0138=_0x4d0138||0xcc;return function(_0x1f473d){if(_0x1f473d){return _0x260246[_0xe343('0x15')](_0x4d0138);}return _0x260246[_0xe343('0x16')](_0x4d0138)['end']();};}function respondWithResult(_0x4f8c97,_0x13208b){_0x13208b=_0x13208b||0xc8;return function(_0x308144){if(_0x308144){return _0x4f8c97[_0xe343('0x16')](_0x13208b)[_0xe343('0x17')](_0x308144);}};}function respondWithFilteredResult(_0x390dbc,_0x54c531){return function(_0x10d775){if(_0x10d775){var _0x31632b=typeof _0x54c531[_0xe343('0x18')]==='undefined'&&typeof _0x54c531[_0xe343('0x19')]==='undefined';var _0x583e61=_0x10d775[_0xe343('0x1a')];var _0x429bbe=_0x31632b?0x0:_0x54c531[_0xe343('0x18')];var _0x3d5116=_0x31632b?_0x10d775['count']:_0x54c531[_0xe343('0x18')]+_0x54c531[_0xe343('0x19')];var _0x5bc48b;if(_0x3d5116>=_0x583e61){_0x3d5116=_0x583e61;_0x5bc48b=0xc8;}else{_0x5bc48b=0xce;}_0x390dbc['status'](_0x5bc48b);return _0x390dbc[_0xe343('0x1b')]('Content-Range',_0x429bbe+'-'+_0x3d5116+'/'+_0x583e61)['json'](_0x10d775);}return null;};}function patchUpdates(_0x154215){return function(_0x5d6ded){try{jsonpatch[_0xe343('0x1c')](_0x5d6ded,_0x154215,!![]);}catch(_0xc913fa){return BPromise[_0xe343('0x1d')](_0xc913fa);}return _0x5d6ded[_0xe343('0x1e')]();};}function saveUpdates(_0xc8b6d5,_0x44c597){return function(_0x3ea569){if(_0x3ea569){return _0x3ea569[_0xe343('0x1f')](_0xc8b6d5)[_0xe343('0x20')](function(_0x30f72f){return _0x30f72f;});}return null;};}function removeEntity(_0x4b6b71,_0x25d25a){return function(_0x2ad457){if(_0x2ad457){return _0x2ad457[_0xe343('0x21')]()[_0xe343('0x20')](function(){_0x4b6b71[_0xe343('0x16')](0xcc)[_0xe343('0x22')]();});}};}function handleEntityNotFound(_0x3ae003,_0x15bf1a){return function(_0x55b390){if(!_0x55b390){_0x3ae003[_0xe343('0x15')](0x194);}return _0x55b390;};}function handleError(_0x183426,_0x5b662c){_0x5b662c=_0x5b662c||0x1f4;return function(_0x213f61){logger[_0xe343('0x23')](_0x213f61[_0xe343('0x24')]);if(_0x213f61['name']){delete _0x213f61['name'];}_0x183426[_0xe343('0x16')](_0x5b662c)[_0xe343('0x25')](_0x213f61);};}exports['update']=function(_0x220746,_0x16cc39){if(_0x220746[_0xe343('0x26')]['id']){delete _0x220746['body']['id'];}return db[_0xe343('0x27')]['find']({'where':{'id':_0x220746[_0xe343('0x28')]['id']}})[_0xe343('0x20')](handleEntityNotFound(_0x16cc39,null))[_0xe343('0x20')](saveUpdates(_0x220746[_0xe343('0x26')],null))[_0xe343('0x20')](respondWithResult(_0x16cc39,null))['catch'](handleError(_0x16cc39,null));};exports[_0xe343('0x21')]=function(_0xfd7ff9,_0x23361c){return db[_0xe343('0x27')][_0xe343('0x29')]({'where':{'id':_0xfd7ff9[_0xe343('0x28')]['id']}})[_0xe343('0x20')](handleEntityNotFound(_0x23361c,null))[_0xe343('0x20')](removeEntity(_0x23361c,null))['catch'](handleError(_0x23361c,null));}; \ No newline at end of file +var _0x4523=['../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','body','Action','find','destroy','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1d899c,_0x269675){var _0x52ea1f=function(_0x541867){while(--_0x541867){_0x1d899c['push'](_0x1d899c['shift']());}};_0x52ea1f(++_0x269675);}(_0x4523,0x7f));var _0x3452=function(_0x262e4e,_0x16d198){_0x262e4e=_0x262e4e-0x0;var _0x34c5e8=_0x4523[_0x262e4e];return _0x34c5e8;};'use strict';var emlformat=require(_0x3452('0x0'));var rimraf=require(_0x3452('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3452('0x2'));var rp=require(_0x3452('0x3'));var moment=require(_0x3452('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3452('0x5'));var util=require(_0x3452('0x6'));var path=require(_0x3452('0x7'));var sox=require(_0x3452('0x8'));var csv=require('to-csv');var ejs=require(_0x3452('0x9'));var fs=require('fs');var fs_extra=require(_0x3452('0xa'));var _=require(_0x3452('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3452('0xc'));var deskjs=require(_0x3452('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3452('0xe'));var Papa=require(_0x3452('0xf'));var Redis=require(_0x3452('0x10'));var authService=require(_0x3452('0x11'));var qs=require(_0x3452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3452('0x13'))(_0x3452('0x14'));var utils=require(_0x3452('0x15'));var config=require(_0x3452('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3452('0x17'))['db'];function respondWithStatusCode(_0x421679,_0x176e44){_0x176e44=_0x176e44||0xcc;return function(_0x34be74){if(_0x34be74){return _0x421679['sendStatus'](_0x176e44);}return _0x421679[_0x3452('0x18')](_0x176e44)['end']();};}function respondWithResult(_0x43102b,_0x50c32a){_0x50c32a=_0x50c32a||0xc8;return function(_0x54d06f){if(_0x54d06f){return _0x43102b[_0x3452('0x18')](_0x50c32a)[_0x3452('0x19')](_0x54d06f);}};}function respondWithFilteredResult(_0x119c6a,_0x436d41){return function(_0x494168){if(_0x494168){var _0x22748c=typeof _0x436d41['offset']===_0x3452('0x1a')&&typeof _0x436d41[_0x3452('0x1b')]===_0x3452('0x1a');var _0x3e6f84=_0x494168[_0x3452('0x1c')];var _0x1ddcb3=_0x22748c?0x0:_0x436d41[_0x3452('0x1d')];var _0x1812a6=_0x22748c?_0x494168['count']:_0x436d41[_0x3452('0x1d')]+_0x436d41[_0x3452('0x1b')];var _0x1a1af5;if(_0x1812a6>=_0x3e6f84){_0x1812a6=_0x3e6f84;_0x1a1af5=0xc8;}else{_0x1a1af5=0xce;}_0x119c6a['status'](_0x1a1af5);return _0x119c6a[_0x3452('0x1e')](_0x3452('0x1f'),_0x1ddcb3+'-'+_0x1812a6+'/'+_0x3e6f84)[_0x3452('0x19')](_0x494168);}return null;};}function patchUpdates(_0x52f9a9){return function(_0x5aa601){try{jsonpatch[_0x3452('0x20')](_0x5aa601,_0x52f9a9,!![]);}catch(_0x659014){return BPromise[_0x3452('0x21')](_0x659014);}return _0x5aa601[_0x3452('0x22')]();};}function saveUpdates(_0x4bbb2c,_0x33d963){return function(_0x350ffe){if(_0x350ffe){return _0x350ffe[_0x3452('0x23')](_0x4bbb2c)[_0x3452('0x24')](function(_0x4401a2){return _0x4401a2;});}return null;};}function removeEntity(_0xa05a48,_0x45fd8b){return function(_0x1173ec){if(_0x1173ec){return _0x1173ec['destroy']()['then'](function(){_0xa05a48[_0x3452('0x18')](0xcc)[_0x3452('0x25')]();});}};}function handleEntityNotFound(_0x1fd6a0,_0x94738a){return function(_0xd5e970){if(!_0xd5e970){_0x1fd6a0[_0x3452('0x26')](0x194);}return _0xd5e970;};}function handleError(_0xaf30f,_0x429d2a){_0x429d2a=_0x429d2a||0x1f4;return function(_0x21f593){logger[_0x3452('0x27')](_0x21f593[_0x3452('0x28')]);if(_0x21f593['name']){delete _0x21f593[_0x3452('0x29')];}_0xaf30f['status'](_0x429d2a)[_0x3452('0x2a')](_0x21f593);};}exports[_0x3452('0x23')]=function(_0x3476d6,_0x14c603){if(_0x3476d6[_0x3452('0x2b')]['id']){delete _0x3476d6[_0x3452('0x2b')]['id'];}return db[_0x3452('0x2c')][_0x3452('0x2d')]({'where':{'id':_0x3476d6['params']['id']}})[_0x3452('0x24')](handleEntityNotFound(_0x14c603,null))[_0x3452('0x24')](saveUpdates(_0x3476d6[_0x3452('0x2b')],null))[_0x3452('0x24')](respondWithResult(_0x14c603,null))['catch'](handleError(_0x14c603,null));};exports[_0x3452('0x2e')]=function(_0x3f3736,_0x8e25f9){return db[_0x3452('0x2c')]['find']({'where':{'id':_0x3f3736['params']['id']}})[_0x3452('0x24')](handleEntityNotFound(_0x8e25f9,null))['then'](removeEntity(_0x8e25f9,null))[_0x3452('0x2f')](handleError(_0x8e25f9,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 907021c..26ad41d 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 _0x728e=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x728e,0x153));var _0xe728=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x728e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe728('0x0'));var util=require(_0xe728('0x1'));var logger=require(_0xe728('0x2'))(_0xe728('0x3'));var moment=require(_0xe728('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe728('0x5'));var rimraf=require(_0xe728('0x6'));var config=require(_0xe728('0x7'));var attributes=require(_0xe728('0x8'));module['exports']=function(_0x57c328,_0x4c8f92){return _0x57c328[_0xe728('0x9')](_0xe728('0xa'),attributes,{'tableName':_0xe728('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fbe=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash','util'];(function(_0x52572f,_0x117f95){var _0x2e9a29=function(_0x10d002){while(--_0x10d002){_0x52572f['push'](_0x52572f['shift']());}};_0x2e9a29(++_0x117f95);}(_0x8fbe,0x1c6));var _0xe8fb=function(_0x3439fd,_0x42a898){_0x3439fd=_0x3439fd-0x0;var _0xe01bdf=_0x8fbe[_0x3439fd];return _0xe01bdf;};'use strict';var _=require(_0xe8fb('0x0'));var util=require(_0xe8fb('0x1'));var logger=require(_0xe8fb('0x2'))(_0xe8fb('0x3'));var moment=require(_0xe8fb('0x4'));var BPromise=require(_0xe8fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8fb('0x6'));var config=require(_0xe8fb('0x7'));var attributes=require(_0xe8fb('0x8'));module[_0xe8fb('0x9')]=function(_0x138073,_0x24dff1){return _0x138073[_0xe8fb('0xa')](_0xe8fb('0xb'),attributes,{'tableName':'tools_actions','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 8bae6b9..6790724 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x814b,0x1a2));var _0xb814=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x814b[_0x295143];return _0x7982e4;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x7217,0x19e));var _0x7721=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x7217[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d66a101..9383300 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 _0x3cff=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0x28db4a,_0x6d6d5a){var _0x3bf87e=function(_0x3e0f75){while(--_0x3e0f75){_0x28db4a['push'](_0x28db4a['shift']());}};_0x3bf87e(++_0x6d6d5a);}(_0x3cff,0x198));var _0xf3cf=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x3cff[_0x281e5e];return _0x5a22d2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf3cf('0x0'));var timeout=require(_0xf3cf('0x1'));var express=require(_0xf3cf('0x2'));var router=express[_0xf3cf('0x3')]();var fs_extra=require(_0xf3cf('0x4'));var auth=require(_0xf3cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf3cf('0x6'));var controller=require(_0xf3cf('0x7'));router[_0xf3cf('0x8')](_0xf3cf('0x9'),auth[_0xf3cf('0xa')](),controller[_0xf3cf('0xb')]);router[_0xf3cf('0xc')](_0xf3cf('0x9'),auth[_0xf3cf('0xa')](),controller[_0xf3cf('0xd')]);module[_0xf3cf('0xe')]=router; \ No newline at end of file +var _0xf439=['put','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./action.controller'];(function(_0x588f0b,_0x5baaae){var _0x31cff1=function(_0x20eccc){while(--_0x20eccc){_0x588f0b['push'](_0x588f0b['shift']());}};_0x31cff1(++_0x5baaae);}(_0xf439,0x163));var _0x9f43=function(_0x1ac5a3,_0x20e1ae){_0x1ac5a3=_0x1ac5a3-0x0;var _0x47035d=_0xf439[_0x1ac5a3];return _0x47035d;};'use strict';var multer=require(_0x9f43('0x0'));var util=require(_0x9f43('0x1'));var path=require(_0x9f43('0x2'));var timeout=require(_0x9f43('0x3'));var express=require(_0x9f43('0x4'));var router=express[_0x9f43('0x5')]();var fs_extra=require(_0x9f43('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9f43('0x7'));var config=require('../../config/environment');var controller=require(_0x9f43('0x8'));router[_0x9f43('0x9')](_0x9f43('0xa'),auth[_0x9f43('0xb')](),controller['update']);router[_0x9f43('0xc')](_0x9f43('0xa'),auth[_0x9f43('0xb')](),controller['destroy']);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 a057960..a8a7a8c 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 _0x5fd1=['STRING','TEXT','sequelize'];(function(_0x32e649,_0x228649){var _0x14d386=function(_0x3fb3ed){while(--_0x3fb3ed){_0x32e649['push'](_0x32e649['shift']());}};_0x14d386(++_0x228649);}(_0x5fd1,0x155));var _0x15fd=function(_0x52b80b,_0x14ccde){_0x52b80b=_0x52b80b-0x0;var _0x44e670=_0x5fd1[_0x52b80b];return _0x44e670;};'use strict';var Sequelize=require(_0x15fd('0x0'));module['exports']={'name':{'type':Sequelize[_0x15fd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x15fd('0x1')]},'parent':{'type':Sequelize[_0x15fd('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x15fd('0x2')]}}; \ No newline at end of file +var _0x326f=['STRING','TEXT','sequelize'];(function(_0xa2c90b,_0x993a19){var _0x18b9c3=function(_0x301949){while(--_0x301949){_0xa2c90b['push'](_0xa2c90b['shift']());}};_0x18b9c3(++_0x993a19);}(_0x326f,0xd1));var _0xf326=function(_0x67fcd4,_0x76752){_0x67fcd4=_0x67fcd4-0x0;var _0x3efaea=_0x326f[_0x67fcd4];return _0x3efaea;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 2a6dc89..3cbc98f 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 _0xcd30=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','get','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','IS\x20NULL','ValidationErrorItem','select','from','output','web','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','SEC_TO_TIME(%s)','value','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto'];(function(_0x46e5a4,_0x236467){var _0x592eaa=function(_0x1bb855){while(--_0x1bb855){_0x46e5a4['push'](_0x46e5a4['shift']());}};_0x592eaa(++_0x236467);}(_0xcd30,0x1e8));var _0x0cd3=function(_0x14ee59,_0x236373){_0x14ee59=_0x14ee59-0x0;var _0x46dcd3=_0xcd30[_0x14ee59];return _0x46dcd3;};'use strict';var emlformat=require(_0x0cd3('0x0'));var rimraf=require(_0x0cd3('0x1'));var zipdir=require(_0x0cd3('0x2'));var jsonpatch=require(_0x0cd3('0x3'));var rp=require(_0x0cd3('0x4'));var moment=require(_0x0cd3('0x5'));var BPromise=require(_0x0cd3('0x6'));var Mustache=require('mustache');var util=require(_0x0cd3('0x7'));var path=require(_0x0cd3('0x8'));var sox=require(_0x0cd3('0x9'));var csv=require('to-csv');var ejs=require(_0x0cd3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd3('0xb'));var squel=require('squel');var crypto=require(_0x0cd3('0xc'));var jsforce=require(_0x0cd3('0xd'));var deskjs=require(_0x0cd3('0xe'));var toCsv=require(_0x0cd3('0xf'));var querystring=require('querystring');var Papa=require(_0x0cd3('0x10'));var Redis=require(_0x0cd3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0cd3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0cd3('0x13'));var logger=require(_0x0cd3('0x14'))(_0x0cd3('0x15'));var utils=require(_0x0cd3('0x16'));var config=require(_0x0cd3('0x17'));var licenseUtil=require(_0x0cd3('0x18'));var db=require(_0x0cd3('0x19'))['db'];var dbH=require(_0x0cd3('0x19'))[_0x0cd3('0x1a')];function respondWithStatusCode(_0x30bc8d,_0x3b450c){_0x3b450c=_0x3b450c||0xcc;return function(_0x250c55){if(_0x250c55){return _0x30bc8d[_0x0cd3('0x1b')](_0x3b450c);}return _0x30bc8d[_0x0cd3('0x1c')](_0x3b450c)[_0x0cd3('0x1d')]();};}function respondWithResult(_0x3e2ec0,_0x5e93c7){_0x5e93c7=_0x5e93c7||0xc8;return function(_0x16e713){if(_0x16e713){return _0x3e2ec0[_0x0cd3('0x1c')](_0x5e93c7)['json'](_0x16e713);}};}function respondWithFilteredResult(_0x1d778a,_0x1e0153){return function(_0x12c0d8){if(_0x12c0d8){var _0x12944d=typeof _0x1e0153[_0x0cd3('0x1e')]===_0x0cd3('0x1f')&&typeof _0x1e0153[_0x0cd3('0x20')]==='undefined';var _0xb95aa1=_0x12c0d8[_0x0cd3('0x21')];var _0x16aae0=_0x12944d?0x0:_0x1e0153[_0x0cd3('0x1e')];var _0x415b4f=_0x12944d?_0x12c0d8[_0x0cd3('0x21')]:_0x1e0153[_0x0cd3('0x1e')]+_0x1e0153[_0x0cd3('0x20')];var _0x59e6b8;if(_0x415b4f>=_0xb95aa1){_0x415b4f=_0xb95aa1;_0x59e6b8=0xc8;}else{_0x59e6b8=0xce;}_0x1d778a['status'](_0x59e6b8);return _0x1d778a[_0x0cd3('0x22')](_0x0cd3('0x23'),_0x16aae0+'-'+_0x415b4f+'/'+_0xb95aa1)[_0x0cd3('0x24')](_0x12c0d8);}return null;};}function patchUpdates(_0x3ddb12){return function(_0x5a7306){try{jsonpatch['apply'](_0x5a7306,_0x3ddb12,!![]);}catch(_0x2e2971){return BPromise[_0x0cd3('0x25')](_0x2e2971);}return _0x5a7306[_0x0cd3('0x26')]();};}function saveUpdates(_0x3e3073,_0x175ff9){return function(_0x2a41d4){if(_0x2a41d4){return _0x2a41d4['update'](_0x3e3073)['then'](function(_0x127bb1){return _0x127bb1;});}return null;};}function removeEntity(_0x1ebc70,_0x24db04){return function(_0x525979){if(_0x525979){return _0x525979[_0x0cd3('0x27')]()[_0x0cd3('0x28')](function(){var _0x59e759=_0x525979[_0x0cd3('0x29')]({'plain':!![]});var _0x83686='CustomReports';return db[_0x0cd3('0x2a')][_0x0cd3('0x27')]({'where':{'type':_0x83686,'resourceId':_0x59e759['id']}})[_0x0cd3('0x28')](function(){return _0x525979;});})[_0x0cd3('0x28')](function(){_0x1ebc70[_0x0cd3('0x1c')](0xcc)[_0x0cd3('0x1d')]();});}};}function handleEntityNotFound(_0x468a13,_0x56e28d){return function(_0x51eab0){if(!_0x51eab0){_0x468a13[_0x0cd3('0x1b')](0x194);}return _0x51eab0;};}function handleError(_0x5f04c1,_0x226c97){_0x226c97=_0x226c97||0x1f4;return function(_0x54d886){logger['error'](_0x54d886[_0x0cd3('0x2b')]);if(_0x54d886['name']){delete _0x54d886[_0x0cd3('0x2c')];}_0x5f04c1[_0x0cd3('0x1c')](_0x226c97)[_0x0cd3('0x2d')](_0x54d886);};}exports[_0x0cd3('0x2e')]=function(_0x2b697e,_0x385193){var _0x88808b={},_0x46e3e5={},_0x5baef2={'count':0x0,'rows':[]};var _0x41c83a=_[_0x0cd3('0x2f')](db[_0x0cd3('0x30')][_0x0cd3('0x31')],function(_0x64a7aa){return{'name':_0x64a7aa[_0x0cd3('0x32')],'type':_0x64a7aa[_0x0cd3('0x33')][_0x0cd3('0x34')]};});_0x46e3e5[_0x0cd3('0x35')]=_[_0x0cd3('0x2f')](_0x41c83a,'name');_0x46e3e5['query']=_[_0x0cd3('0x36')](_0x2b697e[_0x0cd3('0x37')]);_0x46e3e5[_0x0cd3('0x38')]=_[_0x0cd3('0x39')](_0x46e3e5[_0x0cd3('0x35')],_0x46e3e5[_0x0cd3('0x37')]);_0x88808b[_0x0cd3('0x3a')]=_[_0x0cd3('0x39')](_0x46e3e5[_0x0cd3('0x35')],qs['fields'](_0x2b697e['query'][_0x0cd3('0x3b')]));_0x88808b[_0x0cd3('0x3a')]=_0x88808b['attributes'][_0x0cd3('0x3c')]?_0x88808b[_0x0cd3('0x3a')]:_0x46e3e5[_0x0cd3('0x35')];if(!_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x3d')](_0x0cd3('0x3e'))){_0x88808b[_0x0cd3('0x20')]=qs['limit'](_0x2b697e[_0x0cd3('0x37')]['limit']);_0x88808b[_0x0cd3('0x1e')]=qs[_0x0cd3('0x1e')](_0x2b697e[_0x0cd3('0x37')]['offset']);}_0x88808b['order']=qs[_0x0cd3('0x3f')](_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x3f')]);_0x88808b[_0x0cd3('0x40')]=qs[_0x0cd3('0x38')](_[_0x0cd3('0x41')](_0x2b697e['query'],_0x46e3e5[_0x0cd3('0x38')]),_0x41c83a);if(_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x42')]){_0x88808b[_0x0cd3('0x40')]=_[_0x0cd3('0x43')](_0x88808b[_0x0cd3('0x40')],{'$or':_[_0x0cd3('0x2f')](_0x41c83a,function(_0x3d5e35){if(_0x3d5e35[_0x0cd3('0x33')]!==_0x0cd3('0x44')){var _0x4b90fc={};_0x4b90fc[_0x3d5e35[_0x0cd3('0x2c')]]={'$like':'%'+_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x42')]+'%'};return _0x4b90fc;}})});}_0x88808b=_[_0x0cd3('0x43')]({},_0x88808b,_0x2b697e[_0x0cd3('0x45')]);var _0x20726d={'where':_0x88808b['where']};return db[_0x0cd3('0x30')]['count'](_0x20726d)['then'](function(_0x47f8c9){_0x5baef2[_0x0cd3('0x21')]=_0x47f8c9;if(_0x2b697e[_0x0cd3('0x37')][_0x0cd3('0x46')]){_0x88808b['include']=[{'all':!![]}];}return db[_0x0cd3('0x30')][_0x0cd3('0x47')](_0x88808b);})['then'](function(_0x1e7a1a){_0x5baef2['rows']=_0x1e7a1a;return _0x5baef2;})[_0x0cd3('0x28')](respondWithFilteredResult(_0x385193,_0x88808b))[_0x0cd3('0x48')](handleError(_0x385193,null));};exports[_0x0cd3('0x49')]=function(_0xc94b,_0x20d6a3){var _0x5c3197={'raw':![],'where':{'id':_0xc94b['params']['id']}},_0x2f8676={};_0x2f8676[_0x0cd3('0x35')]=_[_0x0cd3('0x36')](db['AnalyticCustomReport'][_0x0cd3('0x31')]);_0x2f8676[_0x0cd3('0x37')]=_[_0x0cd3('0x36')](_0xc94b[_0x0cd3('0x37')]);_0x2f8676[_0x0cd3('0x38')]=_['intersection'](_0x2f8676[_0x0cd3('0x35')],_0x2f8676[_0x0cd3('0x37')]);_0x5c3197[_0x0cd3('0x3a')]=_[_0x0cd3('0x39')](_0x2f8676['model'],qs[_0x0cd3('0x3b')](_0xc94b[_0x0cd3('0x37')]['fields']));_0x5c3197[_0x0cd3('0x3a')]=_0x5c3197[_0x0cd3('0x3a')][_0x0cd3('0x3c')]?_0x5c3197[_0x0cd3('0x3a')]:_0x2f8676[_0x0cd3('0x35')];if(_0xc94b[_0x0cd3('0x37')][_0x0cd3('0x46')]){_0x5c3197[_0x0cd3('0x4a')]=[{'all':!![]}];}_0x5c3197=_[_0x0cd3('0x43')]({},_0x5c3197,_0xc94b[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x5c3197)['then'](handleEntityNotFound(_0x20d6a3,null))[_0x0cd3('0x28')](respondWithResult(_0x20d6a3,null))[_0x0cd3('0x48')](handleError(_0x20d6a3,null));};exports[_0x0cd3('0x4c')]=function(_0x33dbd2,_0x4164ab){return db['AnalyticCustomReport']['create'](_0x33dbd2[_0x0cd3('0x4d')],{})[_0x0cd3('0x28')](function(_0x5b1e20){var _0x1f721c=_0x33dbd2[_0x0cd3('0x4e')][_0x0cd3('0x29')]({'plain':!![]});if(!_0x1f721c)throw new Error(_0x0cd3('0x4f'));if(_0x1f721c[_0x0cd3('0x50')]===_0x0cd3('0x4e')){var _0x339d06=_0x5b1e20['get']({'plain':!![]});var _0x4f48f2='Reports';return db[_0x0cd3('0x51')][_0x0cd3('0x4b')]({'where':{'name':_0x4f48f2,'userProfileId':_0x1f721c['userProfileId']},'raw':!![]})[_0x0cd3('0x28')](function(_0x53219b){if(_0x53219b&&_0x53219b[_0x0cd3('0x52')]===0x0){return db[_0x0cd3('0x2a')][_0x0cd3('0x4c')]({'name':_0x339d06[_0x0cd3('0x2c')],'resourceId':_0x339d06['id'],'type':'CustomReports','sectionId':_0x53219b['id']},{})[_0x0cd3('0x28')](function(){return _0x5b1e20;});}else{return _0x5b1e20;}})[_0x0cd3('0x48')](function(_0x3a31f1){logger[_0x0cd3('0x53')](_0x0cd3('0x54'),_0x3a31f1);throw _0x3a31f1;});}return _0x5b1e20;})['then'](respondWithResult(_0x4164ab,0xc9))['catch'](handleError(_0x4164ab,null));};exports[_0x0cd3('0x55')]=function(_0x394c16,_0x55a7c0){if(_0x394c16[_0x0cd3('0x4d')]['id']){delete _0x394c16[_0x0cd3('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x0cd3('0x4b')]({'where':{'id':_0x394c16[_0x0cd3('0x56')]['id']}})[_0x0cd3('0x28')](handleEntityNotFound(_0x55a7c0,null))[_0x0cd3('0x28')](saveUpdates(_0x394c16[_0x0cd3('0x4d')],null))[_0x0cd3('0x28')](respondWithResult(_0x55a7c0,null))[_0x0cd3('0x48')](handleError(_0x55a7c0,null));};exports['destroy']=function(_0x405fdc,_0x3ca002){return db['AnalyticCustomReport'][_0x0cd3('0x4b')]({'where':{'id':_0x405fdc['params']['id']}})[_0x0cd3('0x28')](handleEntityNotFound(_0x3ca002,null))['then'](removeEntity(_0x3ca002,null))['catch'](handleError(_0x3ca002,null));};exports[_0x0cd3('0x57')]=function(_0x1f30e6,_0x270604){var _0x349602=0xa;var _0x3a782f=[_0x0cd3('0x58'),_0x0cd3('0x59'),_0x0cd3('0x5a'),_0x0cd3('0x5b')];var _0x298197={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':_0x0cd3('0x5e'),'MAX':'MAX(%s)','MIN':_0x0cd3('0x5f'),'AVG':_0x0cd3('0x60'),'GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':_0x0cd3('0x62'),'GROUP_CONCAT DESC':_0x0cd3('0x63')};var _0x1178bd={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x40e338=function(_0x453944){return!_[_0x0cd3('0x68')](['IS\x20NULL',_0x0cd3('0x69'),_0x0cd3('0x6a'),_0x0cd3('0x6b')],_0x453944);};var _0xe6c6c9=function(_0x3cd2ba){if(!_0x3cd2ba||!_0x3cd2ba[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0xad79f4='(',_0x2761d5=0x0;_0x2761d5<_0x3cd2ba[_0x0cd3('0x6c')][_0x0cd3('0x3c')];_0x2761d5+=0x1){_0x2761d5>0x0&&(_0xad79f4+='\x20'+_0x3cd2ba[_0x0cd3('0x6d')]+'\x20');_0xad79f4+=_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x6e')]?_0xe6c6c9(_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x6e')]):_0x3cd2ba[_0x0cd3('0x6c')][_0x2761d5][_0x0cd3('0x6f')]+'\x20'+_0x3cd2ba['rules'][_0x2761d5]['condition']+(_0x40e338(_0x3cd2ba['rules'][_0x2761d5][_0x0cd3('0x70')])?'\x20'+_0x3cd2ba[_0x0cd3('0x6c')][_0x2761d5]['value']:'');}return _0xad79f4+')';};var _0x619299={'where':{'id':_0x1f30e6[_0x0cd3('0x56')]['id']}},_0x456049,_0x496c55,_0x49cceb,_0xdba078,_0x2265c3;_0x619299=_[_0x0cd3('0x43')]({},_0x619299,_0x1f30e6[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')]['find'](_0x619299)[_0x0cd3('0x28')](function(_0x1a337e){if(_0x1a337e){_0x456049=_0x1a337e;return _0x1a337e[_0x0cd3('0x71')]();}return null;})[_0x0cd3('0x28')](function(_0x477964){if(_0x477964){if(!_0x477964['length']){throw new db[(_0x0cd3('0x72'))]['ValidationErrorItem'](_0x0cd3('0x73'),0x193);}_0x496c55=_0x477964;return db[_0x0cd3('0x74')]['findAll']({'raw':!![]});}return null;})[_0x0cd3('0x28')](function(_0x275a85){if(_0x275a85){_0x49cceb=_[_0x0cd3('0x75')](_0x275a85,'id');var _0x55cfaa;var _0x53c6af=squel['select']();_0x53c6af['from'](_0x456049[_0x0cd3('0x76')]);for(var _0xdf50af=0x0;_0xdf50af<_0x496c55['length'];_0xdf50af+=0x1){_0x55cfaa=_0x496c55[_0xdf50af]['MetricId']?_0x49cceb[_0x496c55[_0xdf50af][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x496c55[_0xdf50af]['field'];_0x55cfaa=_0x496c55[_0xdf50af][_0x0cd3('0x79')]?_[_0x0cd3('0x7a')](_0x298197[_0x496c55[_0xdf50af][_0x0cd3('0x79')]],'%s',_0x55cfaa):_0x55cfaa;_0x55cfaa=_0x496c55[_0xdf50af][_0x0cd3('0x7b')]?_[_0x0cd3('0x7a')](_0x1178bd[_0x496c55[_0xdf50af]['format']],'%s',_0x55cfaa):_0x55cfaa;if(_0x496c55[_0xdf50af][_0x0cd3('0x7c')]){_0x53c6af[_0x0cd3('0x6e')](_0x55cfaa);}_0x496c55[_0xdf50af][_0x0cd3('0x7d')]&&_0x53c6af['order'](_0x55cfaa,_0x496c55[_0xdf50af][_0x0cd3('0x7d')]===_0x0cd3('0x7e')?![]:!![]);_0x53c6af['field'](_0x55cfaa,_0x496c55[_0xdf50af][_0x0cd3('0x7f')]||_0x55cfaa);}if(_0x456049['joins']){_0x456049[_0x0cd3('0x80')]=JSON['parse'](_0x456049['joins']);for(var _0x51eef2=0x0;_0x51eef2<_0x456049[_0x0cd3('0x80')][_0x0cd3('0x3c')];_0x51eef2+=0x1){if(_0x456049[_0x0cd3('0x80')][_0x51eef2]['type']&&_[_0x0cd3('0x68')](_0x3a782f,_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x33')])&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x81')]&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x82')]&&_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x83')]){_0x53c6af[_0x456049['joins'][_0x51eef2][_0x0cd3('0x33')]](_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x82')],null,util[_0x0cd3('0x7b')](_0x0cd3('0x84'),_0x456049[_0x0cd3('0x76')],_0x456049[_0x0cd3('0x80')][_0x51eef2]['parentKey'],_0x456049['joins'][_0x51eef2][_0x0cd3('0x82')],_0x456049[_0x0cd3('0x80')][_0x51eef2][_0x0cd3('0x83')]));}}}if(_0x456049[_0x0cd3('0x85')]){_0x456049['conditions']=JSON[_0x0cd3('0x86')](_0x456049[_0x0cd3('0x85')]);_0x53c6af[_0x0cd3('0x40')](_0xe6c6c9(_0x456049['conditions'][_0x0cd3('0x6e')]));}_0x2265c3=_0x53c6af[_0x0cd3('0x87')]();_0x53c6af[_0x0cd3('0x20')](_0x349602);_0x53c6af[_0x0cd3('0x1e')](0x0);logger[_0x0cd3('0x88')](_0x0cd3('0x89'),_0x53c6af[_0x0cd3('0x8a')]());return dbH[_0x0cd3('0x8b')]['query'](_0x53c6af[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]});}})[_0x0cd3('0x28')](respondWithResult(_0x270604,null))[_0x0cd3('0x48')](handleError(_0x270604,null));};function runReport(_0x22fc24,_0x1dee21,_0x2c8984){var _0x16874f=_0x1dee21[_0x0cd3('0x2c')];var _0x4ab7c4=0xa;var _0x258aa7=[_0x0cd3('0x58'),_0x0cd3('0x59'),_0x0cd3('0x5a'),_0x0cd3('0x5b')];var _0x129444={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x0cd3('0x8e'),'MIN':_0x0cd3('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ff4ce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x4531d4=function(_0x1a0839){return!_[_0x0cd3('0x68')]([_0x0cd3('0x8f'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1a0839);};var _0x4d25ee=function(_0x262be9){if(!_0x262be9||!_0x262be9[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0x12390b='(',_0x409354=0x0;_0x409354<_0x262be9['rules']['length'];_0x409354+=0x1){_0x409354>0x0&&(_0x12390b+='\x20'+_0x262be9['operator']+'\x20');_0x12390b+=_0x262be9['rules'][_0x409354][_0x0cd3('0x6e')]?_0x4d25ee(_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x6e')]):_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x6f')]+'\x20'+_0x262be9['rules'][_0x409354]['condition']+(_0x4531d4(_0x262be9[_0x0cd3('0x6c')][_0x409354][_0x0cd3('0x70')])?'\x20'+_0x262be9[_0x0cd3('0x6c')][_0x409354]['value']:'');}return _0x12390b+')';};var _0x1cabbd={'where':{'id':_0x22fc24['id']}},_0x2fde5a,_0x1a1543,_0x20619a,_0x2234d0,_0x5d59e1;_0x1cabbd=_['merge']({},_0x1cabbd,_0x2c8984);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x1cabbd)[_0x0cd3('0x28')](function(_0x3a2709){if(_0x3a2709){_0x2fde5a=_0x3a2709;return _0x3a2709['getFields']();}return null;})[_0x0cd3('0x28')](function(_0x57d564){if(_0x57d564){if(!_0x57d564[_0x0cd3('0x3c')]){throw new db[(_0x0cd3('0x72'))][(_0x0cd3('0x90'))](_0x0cd3('0x73'),0x193);}_0x1a1543=_0x57d564;return db[_0x0cd3('0x74')][_0x0cd3('0x47')]({'raw':!![]});}return null;})[_0x0cd3('0x28')](function(_0x5791d8){if(_0x5791d8){_0x20619a=_[_0x0cd3('0x75')](_0x5791d8,'id');var _0x632595;var _0x73528d=squel[_0x0cd3('0x91')]();_0x73528d[_0x0cd3('0x92')](_0x2fde5a[_0x0cd3('0x76')]);for(var _0x556af0=0x0;_0x556af0<_0x1a1543[_0x0cd3('0x3c')];_0x556af0+=0x1){_0x632595=_0x1a1543[_0x556af0][_0x0cd3('0x77')]?_0x20619a[_0x1a1543[_0x556af0][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x1a1543[_0x556af0][_0x0cd3('0x6f')];_0x632595=_0x1a1543[_0x556af0]['function']?_[_0x0cd3('0x7a')](_0x129444[_0x1a1543[_0x556af0][_0x0cd3('0x79')]],'%s',_0x632595):_0x632595;_0x632595=_0x1a1543[_0x556af0]['format']?_[_0x0cd3('0x7a')](_0x2ff4ce[_0x1a1543[_0x556af0][_0x0cd3('0x7b')]],'%s',_0x632595):_0x632595;if(_0x1a1543[_0x556af0][_0x0cd3('0x7c')]){_0x73528d[_0x0cd3('0x6e')](_0x632595);}_0x1a1543[_0x556af0][_0x0cd3('0x7d')]&&_0x73528d['order'](_0x632595,_0x1a1543[_0x556af0][_0x0cd3('0x7d')]===_0x0cd3('0x7e')?![]:!![]);_0x73528d[_0x0cd3('0x6f')](_0x632595,_0x1a1543[_0x556af0][_0x0cd3('0x7f')]||_0x632595);}if(_0x2fde5a[_0x0cd3('0x80')]){_0x2fde5a[_0x0cd3('0x80')]=JSON[_0x0cd3('0x86')](_0x2fde5a[_0x0cd3('0x80')]);for(var _0xcd113f=0x0;_0xcd113f<_0x2fde5a[_0x0cd3('0x80')]['length'];_0xcd113f+=0x1){if(_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x33')]&&_['includes'](_0x258aa7,_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x33')])&&_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x81')]&&_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x82')]&&_0x2fde5a['joins'][_0xcd113f]['foreignKey']){_0x73528d[_0x2fde5a[_0x0cd3('0x80')][_0xcd113f]['type']](_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x82')],null,util['format'](_0x0cd3('0x84'),_0x2fde5a[_0x0cd3('0x76')],_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x81')],_0x2fde5a[_0x0cd3('0x80')][_0xcd113f][_0x0cd3('0x82')],_0x2fde5a['joins'][_0xcd113f][_0x0cd3('0x83')]));}}}if(_0x2fde5a[_0x0cd3('0x85')]){_0x2fde5a[_0x0cd3('0x85')]=JSON['parse'](_0x2fde5a[_0x0cd3('0x85')]);_0x73528d[_0x0cd3('0x40')](_0x4d25ee(_0x2fde5a[_0x0cd3('0x85')]['group']));}_0x5d59e1=_0x73528d[_0x0cd3('0x87')]();_0x73528d['limit'](_0x4ab7c4);_0x73528d[_0x0cd3('0x1e')](0x0);return;}})['then'](function(){if(_0x1dee21[_0x0cd3('0x93')]===_0x0cd3('0x94')){return null;}var _0x39cfa4=_['merge'](_0x1dee21,{'name':_0x1dee21['fullPath']||_0x1dee21['name']||_0x2fde5a[_0x0cd3('0x2c')],'basename':_0x16874f,'savename':util[_0x0cd3('0x7b')]('%s-%s.%s',_0x1dee21[_0x0cd3('0x2c')]||_0x2fde5a[_0x0cd3('0x2c')],require('randomstring')[_0x0cd3('0x95')](0x4),_0x1dee21[_0x0cd3('0x93')]||'csv'),'reportId':_0x2fde5a['id'],'reportType':_0x0cd3('0x96')});return db[_0x0cd3('0x97')][_0x0cd3('0x4c')](_0x39cfa4,{'raw':!![]});})[_0x0cd3('0x28')](function(_0x2aab61){if(_0x2fde5a['table']===_0x0cd3('0x98')){_0x5d59e1['where'](_0x2fde5a[_0x0cd3('0x76')]+_0x0cd3('0x99'),_0x1dee21[_0x0cd3('0x9a')],_0x1dee21['endDate']);}else{_0x5d59e1[_0x0cd3('0x40')](_0x2fde5a[_0x0cd3('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1dee21[_0x0cd3('0x9a')],_0x1dee21['endDate']);}if(_0x2aab61){logger[_0x0cd3('0x9b')](_0x0cd3('0x9c'),_0x5d59e1['toString']());require(_0x0cd3('0x9d'))['fork'](path[_0x0cd3('0x58')](__dirname,_0x0cd3('0x9e'),_0x2aab61[_0x0cd3('0x93')]),[_0x2aab61['id'],_0x5d59e1[_0x0cd3('0x8a')](),path[_0x0cd3('0x58')](__dirname,_0x0cd3('0x9f'),_0x2aab61[_0x0cd3('0xa0')]),_0x16874f]);return _0x2aab61;}else{var _0x333c41=squel['select']();_0x333c41['from']('('+_0x5d59e1[_0x0cd3('0x8a')]()+')',_0x0cd3('0xa1'));_0x333c41[_0x0cd3('0x6f')](_0x0cd3('0xa2'),_0x0cd3('0x21'));_0x5d59e1[_0x0cd3('0x20')](_0x1dee21[_0x0cd3('0x20')]||_0x4ab7c4);_0x5d59e1['offset'](_0x1dee21['offset']||0x0);return dbH[_0x0cd3('0x8b')][_0x0cd3('0x37')](_0x333c41[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]})[_0x0cd3('0x28')](function(_0x502de9){if(!_0x502de9[_0x0cd3('0x3c')]){_0x2234d0=0x0;}else{_0x2234d0=_0x502de9[0x0]['count']||0x0;}return dbH[_0x0cd3('0x8b')][_0x0cd3('0x37')](_0x5d59e1['toString'](),{'type':dbH[_0x0cd3('0x8b')]['QueryTypes'][_0x0cd3('0x8d')]});})[_0x0cd3('0x28')](function(_0x1bc34a){return{'rows':_0x1bc34a||[],'count':_0x2234d0};});}});}exports['run']=function(_0x38a163,_0x1cf57c){return runReport(_0x38a163['params'],_0x38a163[_0x0cd3('0x37')],_0x38a163[_0x0cd3('0x45')])['then'](respondWithResult(_0x1cf57c,null))[_0x0cd3('0x48')](handleError(_0x1cf57c,null));};exports[_0x0cd3('0xa3')]=runReport;exports['query']=function(_0x407c4f,_0x503598){var _0x5bb574=0xa;var _0x589df5=[_0x0cd3('0x58'),'left_join',_0x0cd3('0x5a'),'cross_join'];var _0x5cfafa={'SUM':_0x0cd3('0x5c'),'COUNT':_0x0cd3('0x5d'),'COUNT DISTINCT':_0x0cd3('0x5e'),'MAX':_0x0cd3('0x8e'),'MIN':_0x0cd3('0x5f'),'AVG':_0x0cd3('0x60'),'GROUP_CONCAT':_0x0cd3('0x61'),'GROUP_CONCAT ASC':_0x0cd3('0x62'),'GROUP_CONCAT DESC':_0x0cd3('0x63')};var _0x5c83db={'SEC_TO_TIME':_0x0cd3('0xa4'),'DATE':_0x0cd3('0x64'),'HOUR':_0x0cd3('0x65'),'ROUND':_0x0cd3('0x66'),'UNIX_TIMESTAMP':_0x0cd3('0x67')};var _0x1e1ac1=function(_0x25aa30){return!_[_0x0cd3('0x68')]([_0x0cd3('0x8f'),'IS\x20NOT\x20NULL',_0x0cd3('0x6a'),_0x0cd3('0x6b')],_0x25aa30);};var _0x2f3083=function(_0x227867){if(!_0x227867||!_0x227867[_0x0cd3('0x6c')][_0x0cd3('0x3c')]){return'';}for(var _0x5ed122='(',_0x993966=0x0;_0x993966<_0x227867[_0x0cd3('0x6c')][_0x0cd3('0x3c')];_0x993966+=0x1){_0x993966>0x0&&(_0x5ed122+='\x20'+_0x227867[_0x0cd3('0x6d')]+'\x20');_0x5ed122+=_0x227867[_0x0cd3('0x6c')][_0x993966][_0x0cd3('0x6e')]?_0x2f3083(_0x227867[_0x0cd3('0x6c')][_0x993966][_0x0cd3('0x6e')]):_0x227867[_0x0cd3('0x6c')][_0x993966]['field']+'\x20'+_0x227867[_0x0cd3('0x6c')][_0x993966]['condition']+(_0x1e1ac1(_0x227867['rules'][_0x993966][_0x0cd3('0x70')])?'\x20'+_0x227867['rules'][_0x993966][_0x0cd3('0xa5')]:'');}return _0x5ed122+')';};var _0x47c455={'where':{'id':_0x407c4f[_0x0cd3('0x56')]['id']}},_0x43ecbc,_0x58b72b,_0xb51e09,_0x16f259,_0x301fca;_0x47c455=_[_0x0cd3('0x43')]({},_0x47c455,_0x407c4f[_0x0cd3('0x45')]);return db[_0x0cd3('0x30')][_0x0cd3('0x4b')](_0x47c455)[_0x0cd3('0x28')](function(_0x5b8b79){if(_0x5b8b79){_0x43ecbc=_0x5b8b79;return _0x5b8b79['getFields']();}return null;})[_0x0cd3('0x28')](function(_0x5e761a){if(_0x5e761a){if(!_0x5e761a[_0x0cd3('0x3c')]){throw new db[(_0x0cd3('0x72'))][(_0x0cd3('0x90'))](_0x0cd3('0x73'),0x193);}_0x58b72b=_0x5e761a;return db[_0x0cd3('0x74')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4a980d){if(_0x4a980d){_0xb51e09=_['keyBy'](_0x4a980d,'id');var _0x26c51b;var _0x6b5679=squel[_0x0cd3('0x91')]();_0x6b5679['from'](_0x43ecbc['table']);for(var _0x5ec839=0x0;_0x5ec839<_0x58b72b[_0x0cd3('0x3c')];_0x5ec839+=0x1){_0x26c51b=_0x58b72b[_0x5ec839][_0x0cd3('0x77')]?_0xb51e09[_0x58b72b[_0x5ec839][_0x0cd3('0x77')]][_0x0cd3('0x78')]:_0x58b72b[_0x5ec839]['field'];_0x26c51b=_0x58b72b[_0x5ec839]['function']?_[_0x0cd3('0x7a')](_0x5cfafa[_0x58b72b[_0x5ec839][_0x0cd3('0x79')]],'%s',_0x26c51b):_0x26c51b;_0x26c51b=_0x58b72b[_0x5ec839][_0x0cd3('0x7b')]?_[_0x0cd3('0x7a')](_0x5c83db[_0x58b72b[_0x5ec839]['format']],'%s',_0x26c51b):_0x26c51b;if(_0x58b72b[_0x5ec839]['groupBy']){_0x6b5679[_0x0cd3('0x6e')](_0x26c51b);}_0x58b72b[_0x5ec839][_0x0cd3('0x7d')]&&_0x6b5679[_0x0cd3('0xa6')](_0x26c51b,_0x58b72b[_0x5ec839]['orderBy']===_0x0cd3('0x7e')?![]:!![]);_0x6b5679[_0x0cd3('0x6f')](_0x26c51b,_0x58b72b[_0x5ec839][_0x0cd3('0x7f')]||_0x26c51b);}if(_0x43ecbc[_0x0cd3('0x80')]){_0x43ecbc['joins']=JSON['parse'](_0x43ecbc['joins']);for(var _0x3ecb33=0x0;_0x3ecb33<_0x43ecbc[_0x0cd3('0x80')][_0x0cd3('0x3c')];_0x3ecb33+=0x1){if(_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['type']&&_[_0x0cd3('0x68')](_0x589df5,_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['type'])&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x81')]&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')]&&_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['foreignKey']){_0x6b5679[_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x33')]](_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')],null,util[_0x0cd3('0x7b')](_0x0cd3('0x84'),_0x43ecbc[_0x0cd3('0x76')],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33]['parentKey'],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x82')],_0x43ecbc[_0x0cd3('0x80')][_0x3ecb33][_0x0cd3('0x83')]));}}}if(_0x43ecbc['conditions']){_0x43ecbc['conditions']=JSON[_0x0cd3('0x86')](_0x43ecbc['conditions']);_0x6b5679[_0x0cd3('0x40')](_0x2f3083(_0x43ecbc[_0x0cd3('0x85')][_0x0cd3('0x6e')]));}_0x301fca=_0x6b5679['clone']();_0x6b5679[_0x0cd3('0x20')](_0x5bb574);_0x6b5679['offset'](0x0);logger[_0x0cd3('0x88')](_0x0cd3('0x89'),_0x6b5679[_0x0cd3('0x8a')]());return dbH['sequelize']['query'](_0x6b5679[_0x0cd3('0x8a')](),{'type':dbH[_0x0cd3('0x8b')][_0x0cd3('0x8c')][_0x0cd3('0x8d')]});}})[_0x0cd3('0x28')](function(){return{'sql':_0x301fca[_0x0cd3('0x8a')]()};})[_0x0cd3('0x28')](respondWithResult(_0x503598,null))[_0x0cd3('0x48')](handleError(_0x503598,null));}; \ No newline at end of file +var _0xe1d1=['api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','update','then','destroy','CustomReports','name','index','map','AnalyticCustomReport','fieldName','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','get','user','Reports','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignKey','foreignTable','conditions','clone','debug','toString','sequelize','SELECT','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','operator','Please\x20insert\x20at\x20least\x20one\x20field','from','metric','%s.%s\x20=\x20%s.%s','output','web','randomstring','generate','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x2e0286,_0x46fa17){var _0x5b374b=function(_0xaa54ea){while(--_0xaa54ea){_0x2e0286['push'](_0x2e0286['shift']());}};_0x5b374b(++_0x46fa17);}(_0xe1d1,0x131));var _0x1e1d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe1d1[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x1e1d('0x0'));var rimraf=require(_0x1e1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e1d('0x2'));var rp=require(_0x1e1d('0x3'));var moment=require(_0x1e1d('0x4'));var BPromise=require(_0x1e1d('0x5'));var Mustache=require('mustache');var util=require(_0x1e1d('0x6'));var path=require(_0x1e1d('0x7'));var sox=require(_0x1e1d('0x8'));var csv=require(_0x1e1d('0x9'));var ejs=require(_0x1e1d('0xa'));var fs=require('fs');var fs_extra=require(_0x1e1d('0xb'));var _=require('lodash');var squel=require(_0x1e1d('0xc'));var crypto=require(_0x1e1d('0xd'));var jsforce=require(_0x1e1d('0xe'));var deskjs=require(_0x1e1d('0xf'));var toCsv=require(_0x1e1d('0x9'));var querystring=require(_0x1e1d('0x10'));var Papa=require('papaparse');var Redis=require(_0x1e1d('0x11'));var authService=require(_0x1e1d('0x12'));var qs=require(_0x1e1d('0x13'));var as=require(_0x1e1d('0x14'));var hardwareService=require(_0x1e1d('0x15'));var logger=require(_0x1e1d('0x16'))(_0x1e1d('0x17'));var utils=require('../../config/utils');var config=require(_0x1e1d('0x18'));var licenseUtil=require(_0x1e1d('0x19'));var db=require(_0x1e1d('0x1a'))['db'];var dbH=require(_0x1e1d('0x1a'))[_0x1e1d('0x1b')];function respondWithStatusCode(_0x5b5449,_0x16e635){_0x16e635=_0x16e635||0xcc;return function(_0x1ee02c){if(_0x1ee02c){return _0x5b5449[_0x1e1d('0x1c')](_0x16e635);}return _0x5b5449['status'](_0x16e635)[_0x1e1d('0x1d')]();};}function respondWithResult(_0xc77de4,_0x173620){_0x173620=_0x173620||0xc8;return function(_0x119a87){if(_0x119a87){return _0xc77de4[_0x1e1d('0x1e')](_0x173620)['json'](_0x119a87);}};}function respondWithFilteredResult(_0x16cdf5,_0x466bdb){return function(_0x2bc2cf){if(_0x2bc2cf){var _0x274b76=typeof _0x466bdb[_0x1e1d('0x1f')]===_0x1e1d('0x20')&&typeof _0x466bdb[_0x1e1d('0x21')]===_0x1e1d('0x20');var _0x48d79f=_0x2bc2cf[_0x1e1d('0x22')];var _0x5dc4fa=_0x274b76?0x0:_0x466bdb[_0x1e1d('0x1f')];var _0x5eae62=_0x274b76?_0x2bc2cf[_0x1e1d('0x22')]:_0x466bdb[_0x1e1d('0x1f')]+_0x466bdb[_0x1e1d('0x21')];var _0x309589;if(_0x5eae62>=_0x48d79f){_0x5eae62=_0x48d79f;_0x309589=0xc8;}else{_0x309589=0xce;}_0x16cdf5[_0x1e1d('0x1e')](_0x309589);return _0x16cdf5['set'](_0x1e1d('0x23'),_0x5dc4fa+'-'+_0x5eae62+'/'+_0x48d79f)[_0x1e1d('0x24')](_0x2bc2cf);}return null;};}function patchUpdates(_0x152f33){return function(_0x48719c){try{jsonpatch['apply'](_0x48719c,_0x152f33,!![]);}catch(_0x747fc7){return BPromise[_0x1e1d('0x25')](_0x747fc7);}return _0x48719c['save']();};}function saveUpdates(_0xe5ada6,_0x3c1ab6){return function(_0x3b9e6e){if(_0x3b9e6e){return _0x3b9e6e[_0x1e1d('0x26')](_0xe5ada6)[_0x1e1d('0x27')](function(_0x59124f){return _0x59124f;});}return null;};}function removeEntity(_0x1a11dc,_0x559ba5){return function(_0x5f05f1){if(_0x5f05f1){return _0x5f05f1[_0x1e1d('0x28')]()[_0x1e1d('0x27')](function(){var _0x513371=_0x5f05f1['get']({'plain':!![]});var _0x1ff918=_0x1e1d('0x29');return db['UserProfileResource'][_0x1e1d('0x28')]({'where':{'type':_0x1ff918,'resourceId':_0x513371['id']}})[_0x1e1d('0x27')](function(){return _0x5f05f1;});})[_0x1e1d('0x27')](function(){_0x1a11dc[_0x1e1d('0x1e')](0xcc)[_0x1e1d('0x1d')]();});}};}function handleEntityNotFound(_0x15f703,_0x3c1181){return function(_0x47cb5f){if(!_0x47cb5f){_0x15f703[_0x1e1d('0x1c')](0x194);}return _0x47cb5f;};}function handleError(_0x136dc1,_0x3f93b8){_0x3f93b8=_0x3f93b8||0x1f4;return function(_0xb1388b){logger['error'](_0xb1388b['stack']);if(_0xb1388b[_0x1e1d('0x2a')]){delete _0xb1388b[_0x1e1d('0x2a')];}_0x136dc1[_0x1e1d('0x1e')](_0x3f93b8)['send'](_0xb1388b);};}exports[_0x1e1d('0x2b')]=function(_0x5959d7,_0x16ca2e){var _0x45a41f={},_0x28d48f={},_0x3b2e0e={'count':0x0,'rows':[]};var _0x434ee4=_[_0x1e1d('0x2c')](db[_0x1e1d('0x2d')]['rawAttributes'],function(_0x5eaf97){return{'name':_0x5eaf97[_0x1e1d('0x2e')],'type':_0x5eaf97['type']['key']};});_0x28d48f[_0x1e1d('0x2f')]=_[_0x1e1d('0x2c')](_0x434ee4,_0x1e1d('0x2a'));_0x28d48f['query']=_[_0x1e1d('0x30')](_0x5959d7[_0x1e1d('0x31')]);_0x28d48f[_0x1e1d('0x32')]=_['intersection'](_0x28d48f['model'],_0x28d48f[_0x1e1d('0x31')]);_0x45a41f[_0x1e1d('0x33')]=_[_0x1e1d('0x34')](_0x28d48f['model'],qs['fields'](_0x5959d7[_0x1e1d('0x31')][_0x1e1d('0x35')]));_0x45a41f[_0x1e1d('0x33')]=_0x45a41f[_0x1e1d('0x33')]['length']?_0x45a41f[_0x1e1d('0x33')]:_0x28d48f['model'];if(!_0x5959d7[_0x1e1d('0x31')]['hasOwnProperty'](_0x1e1d('0x36'))){_0x45a41f[_0x1e1d('0x21')]=qs[_0x1e1d('0x21')](_0x5959d7[_0x1e1d('0x31')]['limit']);_0x45a41f[_0x1e1d('0x1f')]=qs['offset'](_0x5959d7[_0x1e1d('0x31')]['offset']);}_0x45a41f[_0x1e1d('0x37')]=qs[_0x1e1d('0x38')](_0x5959d7[_0x1e1d('0x31')][_0x1e1d('0x38')]);_0x45a41f['where']=qs['filters'](_['pick'](_0x5959d7[_0x1e1d('0x31')],_0x28d48f[_0x1e1d('0x32')]),_0x434ee4);if(_0x5959d7['query'][_0x1e1d('0x39')]){_0x45a41f[_0x1e1d('0x3a')]=_[_0x1e1d('0x3b')](_0x45a41f[_0x1e1d('0x3a')],{'$or':_['map'](_0x434ee4,function(_0x1b83b8){if(_0x1b83b8[_0x1e1d('0x3c')]!==_0x1e1d('0x3d')){var _0x4812ca={};_0x4812ca[_0x1b83b8[_0x1e1d('0x2a')]]={'$like':'%'+_0x5959d7['query'][_0x1e1d('0x39')]+'%'};return _0x4812ca;}})});}_0x45a41f=_[_0x1e1d('0x3b')]({},_0x45a41f,_0x5959d7['options']);var _0x398f4d={'where':_0x45a41f[_0x1e1d('0x3a')]};return db[_0x1e1d('0x2d')][_0x1e1d('0x22')](_0x398f4d)[_0x1e1d('0x27')](function(_0x53a8e0){_0x3b2e0e[_0x1e1d('0x22')]=_0x53a8e0;if(_0x5959d7['query'][_0x1e1d('0x3e')]){_0x45a41f[_0x1e1d('0x3f')]=[{'all':!![]}];}return db[_0x1e1d('0x2d')][_0x1e1d('0x40')](_0x45a41f);})['then'](function(_0x5724bc){_0x3b2e0e[_0x1e1d('0x41')]=_0x5724bc;return _0x3b2e0e;})[_0x1e1d('0x27')](respondWithFilteredResult(_0x16ca2e,_0x45a41f))[_0x1e1d('0x42')](handleError(_0x16ca2e,null));};exports[_0x1e1d('0x43')]=function(_0xb9ad40,_0x568dc2){var _0x253448={'raw':![],'where':{'id':_0xb9ad40[_0x1e1d('0x44')]['id']}},_0x4c6657={};_0x4c6657[_0x1e1d('0x2f')]=_[_0x1e1d('0x30')](db[_0x1e1d('0x2d')][_0x1e1d('0x45')]);_0x4c6657[_0x1e1d('0x31')]=_[_0x1e1d('0x30')](_0xb9ad40[_0x1e1d('0x31')]);_0x4c6657[_0x1e1d('0x32')]=_[_0x1e1d('0x34')](_0x4c6657[_0x1e1d('0x2f')],_0x4c6657[_0x1e1d('0x31')]);_0x253448[_0x1e1d('0x33')]=_[_0x1e1d('0x34')](_0x4c6657[_0x1e1d('0x2f')],qs['fields'](_0xb9ad40['query']['fields']));_0x253448[_0x1e1d('0x33')]=_0x253448[_0x1e1d('0x33')][_0x1e1d('0x46')]?_0x253448['attributes']:_0x4c6657['model'];if(_0xb9ad40[_0x1e1d('0x31')]['includeAll']){_0x253448[_0x1e1d('0x3f')]=[{'all':!![]}];}_0x253448=_[_0x1e1d('0x3b')]({},_0x253448,_0xb9ad40[_0x1e1d('0x47')]);return db['AnalyticCustomReport'][_0x1e1d('0x48')](_0x253448)[_0x1e1d('0x27')](handleEntityNotFound(_0x568dc2,null))[_0x1e1d('0x27')](respondWithResult(_0x568dc2,null))[_0x1e1d('0x42')](handleError(_0x568dc2,null));};exports[_0x1e1d('0x49')]=function(_0x3e8ee2,_0x189f9b){return db[_0x1e1d('0x2d')][_0x1e1d('0x49')](_0x3e8ee2[_0x1e1d('0x4a')],{})[_0x1e1d('0x27')](function(_0x146650){var _0x126923=_0x3e8ee2['user'][_0x1e1d('0x4b')]({'plain':!![]});if(!_0x126923)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x126923['role']===_0x1e1d('0x4c')){var _0x5fd2e1=_0x146650[_0x1e1d('0x4b')]({'plain':!![]});var _0x258576=_0x1e1d('0x4d');return db['UserProfileSection'][_0x1e1d('0x48')]({'where':{'name':_0x258576,'userProfileId':_0x126923[_0x1e1d('0x4e')]},'raw':!![]})[_0x1e1d('0x27')](function(_0x42327b){if(_0x42327b&&_0x42327b[_0x1e1d('0x4f')]===0x0){return db[_0x1e1d('0x50')][_0x1e1d('0x49')]({'name':_0x5fd2e1[_0x1e1d('0x2a')],'resourceId':_0x5fd2e1['id'],'type':_0x1e1d('0x29'),'sectionId':_0x42327b['id']},{})['then'](function(){return _0x146650;});}else{return _0x146650;}})[_0x1e1d('0x42')](function(_0x342360){logger[_0x1e1d('0x51')](_0x1e1d('0x52'),_0x342360);throw _0x342360;});}return _0x146650;})['then'](respondWithResult(_0x189f9b,0xc9))[_0x1e1d('0x42')](handleError(_0x189f9b,null));};exports['update']=function(_0x163950,_0x4edf43){if(_0x163950[_0x1e1d('0x4a')]['id']){delete _0x163950['body']['id'];}return db[_0x1e1d('0x2d')][_0x1e1d('0x48')]({'where':{'id':_0x163950[_0x1e1d('0x44')]['id']}})[_0x1e1d('0x27')](handleEntityNotFound(_0x4edf43,null))[_0x1e1d('0x27')](saveUpdates(_0x163950[_0x1e1d('0x4a')],null))[_0x1e1d('0x27')](respondWithResult(_0x4edf43,null))['catch'](handleError(_0x4edf43,null));};exports[_0x1e1d('0x28')]=function(_0x266b75,_0x311425){return db['AnalyticCustomReport'][_0x1e1d('0x48')]({'where':{'id':_0x266b75[_0x1e1d('0x44')]['id']}})[_0x1e1d('0x27')](handleEntityNotFound(_0x311425,null))[_0x1e1d('0x27')](removeEntity(_0x311425,null))[_0x1e1d('0x42')](handleError(_0x311425,null));};exports[_0x1e1d('0x53')]=function(_0x33017c,_0x29cf69){var _0x5aba5c=0xa;var _0x312e95=[_0x1e1d('0x54'),_0x1e1d('0x55'),_0x1e1d('0x56'),_0x1e1d('0x57')];var _0x43070b={'SUM':'SUM(%s)','COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':_0x1e1d('0x59'),'MAX':'MAX(%s)','MIN':_0x1e1d('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x250cb9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':_0x1e1d('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2c2bff=function(_0x355070){return!_['includes'](['IS\x20NULL',_0x1e1d('0x5f'),_0x1e1d('0x60'),_0x1e1d('0x61')],_0x355070);};var _0x236cb6=function(_0x378ed6){if(!_0x378ed6||!_0x378ed6['rules'][_0x1e1d('0x46')]){return'';}for(var _0x585955='(',_0x83f831=0x0;_0x83f831<_0x378ed6[_0x1e1d('0x62')]['length'];_0x83f831+=0x1){_0x83f831>0x0&&(_0x585955+='\x20'+_0x378ed6['operator']+'\x20');_0x585955+=_0x378ed6[_0x1e1d('0x62')][_0x83f831]['group']?_0x236cb6(_0x378ed6[_0x1e1d('0x62')][_0x83f831]['group']):_0x378ed6['rules'][_0x83f831][_0x1e1d('0x63')]+'\x20'+_0x378ed6[_0x1e1d('0x62')][_0x83f831][_0x1e1d('0x64')]+(_0x2c2bff(_0x378ed6[_0x1e1d('0x62')][_0x83f831][_0x1e1d('0x64')])?'\x20'+_0x378ed6['rules'][_0x83f831][_0x1e1d('0x65')]:'');}return _0x585955+')';};var _0x270af8={'where':{'id':_0x33017c['params']['id']}},_0x4d0748,_0xc53ad9,_0x4c64ae,_0x3fc4de,_0x592061;_0x270af8=_[_0x1e1d('0x3b')]({},_0x270af8,_0x33017c[_0x1e1d('0x47')]);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x270af8)['then'](function(_0x408628){if(_0x408628){_0x4d0748=_0x408628;return _0x408628[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x252041){if(_0x252041){if(!_0x252041[_0x1e1d('0x46')]){throw new db[(_0x1e1d('0x67'))][(_0x1e1d('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc53ad9=_0x252041;return db[_0x1e1d('0x69')][_0x1e1d('0x40')]({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x5776b6){if(_0x5776b6){_0x4c64ae=_[_0x1e1d('0x6a')](_0x5776b6,'id');var _0x1cc924;var _0x5efcbc=squel[_0x1e1d('0x6b')]();_0x5efcbc['from'](_0x4d0748[_0x1e1d('0x6c')]);for(var _0x2bfc70=0x0;_0x2bfc70<_0xc53ad9['length'];_0x2bfc70+=0x1){_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x6d')]?_0x4c64ae[_0xc53ad9[_0x2bfc70][_0x1e1d('0x6d')]]['metric']:_0xc53ad9[_0x2bfc70]['field'];_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x6e')]?_[_0x1e1d('0x6f')](_0x43070b[_0xc53ad9[_0x2bfc70][_0x1e1d('0x6e')]],'%s',_0x1cc924):_0x1cc924;_0x1cc924=_0xc53ad9[_0x2bfc70][_0x1e1d('0x70')]?_[_0x1e1d('0x6f')](_0x250cb9[_0xc53ad9[_0x2bfc70][_0x1e1d('0x70')]],'%s',_0x1cc924):_0x1cc924;if(_0xc53ad9[_0x2bfc70][_0x1e1d('0x71')]){_0x5efcbc[_0x1e1d('0x72')](_0x1cc924);}_0xc53ad9[_0x2bfc70][_0x1e1d('0x73')]&&_0x5efcbc[_0x1e1d('0x37')](_0x1cc924,_0xc53ad9[_0x2bfc70][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x5efcbc['field'](_0x1cc924,_0xc53ad9[_0x2bfc70][_0x1e1d('0x75')]||_0x1cc924);}if(_0x4d0748[_0x1e1d('0x76')]){_0x4d0748[_0x1e1d('0x76')]=JSON[_0x1e1d('0x77')](_0x4d0748[_0x1e1d('0x76')]);for(var _0x36361e=0x0;_0x36361e<_0x4d0748[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x36361e+=0x1){if(_0x4d0748['joins'][_0x36361e]['type']&&_[_0x1e1d('0x78')](_0x312e95,_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x3c')])&&_0x4d0748['joins'][_0x36361e][_0x1e1d('0x79')]&&_0x4d0748['joins'][_0x36361e]['foreignTable']&&_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7a')]){_0x5efcbc[_0x4d0748['joins'][_0x36361e]['type']](_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4d0748[_0x1e1d('0x6c')],_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x79')],_0x4d0748['joins'][_0x36361e][_0x1e1d('0x7b')],_0x4d0748[_0x1e1d('0x76')][_0x36361e][_0x1e1d('0x7a')]));}}}if(_0x4d0748[_0x1e1d('0x7c')]){_0x4d0748[_0x1e1d('0x7c')]=JSON['parse'](_0x4d0748['conditions']);_0x5efcbc[_0x1e1d('0x3a')](_0x236cb6(_0x4d0748[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0x592061=_0x5efcbc[_0x1e1d('0x7d')]();_0x5efcbc[_0x1e1d('0x21')](_0x5aba5c);_0x5efcbc[_0x1e1d('0x1f')](0x0);logger[_0x1e1d('0x7e')]('Limited\x20Query:',_0x5efcbc[_0x1e1d('0x7f')]());return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x5efcbc[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')]['QueryTypes'][_0x1e1d('0x81')]});}})[_0x1e1d('0x27')](respondWithResult(_0x29cf69,null))[_0x1e1d('0x42')](handleError(_0x29cf69,null));};function runReport(_0x26ba67,_0x467af0,_0x128d0e){var _0x31f3e7=_0x467af0[_0x1e1d('0x2a')];var _0x1c1c39=0xa;var _0x1e6ec6=['join',_0x1e1d('0x55'),_0x1e1d('0x56'),_0x1e1d('0x57')];var _0xded4fa={'SUM':'SUM(%s)','COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e1d('0x82'),'MIN':'MIN(%s)','AVG':_0x1e1d('0x83'),'GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4822f1={'SEC_TO_TIME':_0x1e1d('0x84'),'DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x1e1d('0x85')};var _0x40d924=function(_0x5deacd){return!_['includes']([_0x1e1d('0x86'),_0x1e1d('0x5f'),_0x1e1d('0x60'),_0x1e1d('0x61')],_0x5deacd);};var _0x60d32d=function(_0x110bd7){if(!_0x110bd7||!_0x110bd7['rules'][_0x1e1d('0x46')]){return'';}for(var _0x47dbb7='(',_0x26906d=0x0;_0x26906d<_0x110bd7[_0x1e1d('0x62')]['length'];_0x26906d+=0x1){_0x26906d>0x0&&(_0x47dbb7+='\x20'+_0x110bd7[_0x1e1d('0x87')]+'\x20');_0x47dbb7+=_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x72')]?_0x60d32d(_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x72')]):_0x110bd7[_0x1e1d('0x62')][_0x26906d][_0x1e1d('0x63')]+'\x20'+_0x110bd7['rules'][_0x26906d][_0x1e1d('0x64')]+(_0x40d924(_0x110bd7[_0x1e1d('0x62')][_0x26906d]['condition'])?'\x20'+_0x110bd7[_0x1e1d('0x62')][_0x26906d]['value']:'');}return _0x47dbb7+')';};var _0x486720={'where':{'id':_0x26ba67['id']}},_0x583382,_0x58dc9c,_0x5c4369,_0x22f5ca,_0x434793;_0x486720=_[_0x1e1d('0x3b')]({},_0x486720,_0x128d0e);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x486720)[_0x1e1d('0x27')](function(_0x539603){if(_0x539603){_0x583382=_0x539603;return _0x539603[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x424436){if(_0x424436){if(!_0x424436['length']){throw new db[(_0x1e1d('0x67'))]['ValidationErrorItem'](_0x1e1d('0x88'),0x193);}_0x58dc9c=_0x424436;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x2825fe){if(_0x2825fe){_0x5c4369=_[_0x1e1d('0x6a')](_0x2825fe,'id');var _0xa0cc56;var _0x131af9=squel['select']();_0x131af9[_0x1e1d('0x89')](_0x583382[_0x1e1d('0x6c')]);for(var _0xfc326c=0x0;_0xfc326c<_0x58dc9c[_0x1e1d('0x46')];_0xfc326c+=0x1){_0xa0cc56=_0x58dc9c[_0xfc326c][_0x1e1d('0x6d')]?_0x5c4369[_0x58dc9c[_0xfc326c]['MetricId']][_0x1e1d('0x8a')]:_0x58dc9c[_0xfc326c][_0x1e1d('0x63')];_0xa0cc56=_0x58dc9c[_0xfc326c][_0x1e1d('0x6e')]?_[_0x1e1d('0x6f')](_0xded4fa[_0x58dc9c[_0xfc326c][_0x1e1d('0x6e')]],'%s',_0xa0cc56):_0xa0cc56;_0xa0cc56=_0x58dc9c[_0xfc326c]['format']?_['replace'](_0x4822f1[_0x58dc9c[_0xfc326c][_0x1e1d('0x70')]],'%s',_0xa0cc56):_0xa0cc56;if(_0x58dc9c[_0xfc326c][_0x1e1d('0x71')]){_0x131af9[_0x1e1d('0x72')](_0xa0cc56);}_0x58dc9c[_0xfc326c][_0x1e1d('0x73')]&&_0x131af9[_0x1e1d('0x37')](_0xa0cc56,_0x58dc9c[_0xfc326c][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x131af9[_0x1e1d('0x63')](_0xa0cc56,_0x58dc9c[_0xfc326c][_0x1e1d('0x75')]||_0xa0cc56);}if(_0x583382[_0x1e1d('0x76')]){_0x583382[_0x1e1d('0x76')]=JSON['parse'](_0x583382['joins']);for(var _0x3befdd=0x0;_0x3befdd<_0x583382[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x3befdd+=0x1){if(_0x583382[_0x1e1d('0x76')][_0x3befdd]['type']&&_[_0x1e1d('0x78')](_0x1e6ec6,_0x583382[_0x1e1d('0x76')][_0x3befdd]['type'])&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x79')]&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7b')]&&_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7a')]){_0x131af9[_0x583382['joins'][_0x3befdd]['type']](_0x583382[_0x1e1d('0x76')][_0x3befdd]['foreignTable'],null,util[_0x1e1d('0x70')](_0x1e1d('0x8b'),_0x583382[_0x1e1d('0x6c')],_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x79')],_0x583382[_0x1e1d('0x76')][_0x3befdd][_0x1e1d('0x7b')],_0x583382['joins'][_0x3befdd][_0x1e1d('0x7a')]));}}}if(_0x583382['conditions']){_0x583382[_0x1e1d('0x7c')]=JSON['parse'](_0x583382[_0x1e1d('0x7c')]);_0x131af9['where'](_0x60d32d(_0x583382[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0x434793=_0x131af9[_0x1e1d('0x7d')]();_0x131af9[_0x1e1d('0x21')](_0x1c1c39);_0x131af9['offset'](0x0);return;}})[_0x1e1d('0x27')](function(){if(_0x467af0[_0x1e1d('0x8c')]===_0x1e1d('0x8d')){return null;}var _0x2af1c6=_['merge'](_0x467af0,{'name':_0x467af0['fullPath']||_0x467af0[_0x1e1d('0x2a')]||_0x583382['name'],'basename':_0x31f3e7,'savename':util['format']('%s-%s.%s',_0x467af0[_0x1e1d('0x2a')]||_0x583382[_0x1e1d('0x2a')],require(_0x1e1d('0x8e'))[_0x1e1d('0x8f')](0x4),_0x467af0[_0x1e1d('0x8c')]||'csv'),'reportId':_0x583382['id'],'reportType':_0x1e1d('0x90')});return db[_0x1e1d('0x91')][_0x1e1d('0x49')](_0x2af1c6,{'raw':!![]});})['then'](function(_0x2dbce3){if(_0x583382['table']===_0x1e1d('0x92')){_0x434793[_0x1e1d('0x3a')](_0x583382['table']+_0x1e1d('0x93'),_0x467af0[_0x1e1d('0x94')],_0x467af0[_0x1e1d('0x95')]);}else{_0x434793[_0x1e1d('0x3a')](_0x583382[_0x1e1d('0x6c')]+_0x1e1d('0x96'),_0x467af0[_0x1e1d('0x94')],_0x467af0['endDate']);}if(_0x2dbce3){logger[_0x1e1d('0x97')](_0x1e1d('0x98'),_0x434793[_0x1e1d('0x7f')]());require(_0x1e1d('0x99'))[_0x1e1d('0x9a')](path[_0x1e1d('0x54')](__dirname,'../../components/export/',_0x2dbce3[_0x1e1d('0x8c')]),[_0x2dbce3['id'],_0x434793[_0x1e1d('0x7f')](),path[_0x1e1d('0x54')](__dirname,_0x1e1d('0x9b'),_0x2dbce3['savename']),_0x31f3e7]);return _0x2dbce3;}else{var _0x17fb2f=squel[_0x1e1d('0x6b')]();_0x17fb2f['from']('('+_0x434793[_0x1e1d('0x7f')]()+')',_0x1e1d('0x9c'));_0x17fb2f['field'](_0x1e1d('0x9d'),'count');_0x434793[_0x1e1d('0x21')](_0x467af0['limit']||_0x1c1c39);_0x434793[_0x1e1d('0x1f')](_0x467af0[_0x1e1d('0x1f')]||0x0);return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x17fb2f[_0x1e1d('0x7f')](),{'type':dbH['sequelize'][_0x1e1d('0x9e')]['SELECT']})[_0x1e1d('0x27')](function(_0x7f4f33){if(!_0x7f4f33['length']){_0x22f5ca=0x0;}else{_0x22f5ca=_0x7f4f33[0x0][_0x1e1d('0x22')]||0x0;}return dbH[_0x1e1d('0x80')][_0x1e1d('0x31')](_0x434793[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')][_0x1e1d('0x9e')][_0x1e1d('0x81')]});})[_0x1e1d('0x27')](function(_0xc4e95b){return{'rows':_0xc4e95b||[],'count':_0x22f5ca};});}});}exports[_0x1e1d('0x9f')]=function(_0x318404,_0x118929){return runReport(_0x318404[_0x1e1d('0x44')],_0x318404[_0x1e1d('0x31')],_0x318404[_0x1e1d('0x47')])[_0x1e1d('0x27')](respondWithResult(_0x118929,null))[_0x1e1d('0x42')](handleError(_0x118929,null));};exports[_0x1e1d('0xa0')]=runReport;exports[_0x1e1d('0x31')]=function(_0x328e6f,_0x5a6c49){var _0x268ccf=0xa;var _0x159205=[_0x1e1d('0x54'),'left_join',_0x1e1d('0x56'),_0x1e1d('0x57')];var _0x24b9e2={'SUM':_0x1e1d('0xa1'),'COUNT':_0x1e1d('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x1e1d('0x82'),'MIN':_0x1e1d('0x5a'),'AVG':_0x1e1d('0x83'),'GROUP_CONCAT':_0x1e1d('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x1e1d('0xa2')};var _0x504faf={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x1e1d('0x5c'),'HOUR':_0x1e1d('0x5d'),'ROUND':_0x1e1d('0x5e'),'UNIX_TIMESTAMP':_0x1e1d('0x85')};var _0xbe6fba=function(_0x1b01af){return!_[_0x1e1d('0x78')]([_0x1e1d('0x86'),_0x1e1d('0x5f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1b01af);};var _0x2d89a3=function(_0x42a395){if(!_0x42a395||!_0x42a395[_0x1e1d('0x62')][_0x1e1d('0x46')]){return'';}for(var _0x3980c4='(',_0x28ef8f=0x0;_0x28ef8f<_0x42a395['rules'][_0x1e1d('0x46')];_0x28ef8f+=0x1){_0x28ef8f>0x0&&(_0x3980c4+='\x20'+_0x42a395[_0x1e1d('0x87')]+'\x20');_0x3980c4+=_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x72')]?_0x2d89a3(_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x72')]):_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x63')]+'\x20'+_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x64')]+(_0xbe6fba(_0x42a395[_0x1e1d('0x62')][_0x28ef8f][_0x1e1d('0x64')])?'\x20'+_0x42a395['rules'][_0x28ef8f][_0x1e1d('0x65')]:'');}return _0x3980c4+')';};var _0x50fe8d={'where':{'id':_0x328e6f[_0x1e1d('0x44')]['id']}},_0x22158f,_0x7c7aa0,_0x376991,_0x1cc2db,_0xb43c67;_0x50fe8d=_[_0x1e1d('0x3b')]({},_0x50fe8d,_0x328e6f[_0x1e1d('0x47')]);return db[_0x1e1d('0x2d')][_0x1e1d('0x48')](_0x50fe8d)[_0x1e1d('0x27')](function(_0x4fbc2c){if(_0x4fbc2c){_0x22158f=_0x4fbc2c;return _0x4fbc2c[_0x1e1d('0x66')]();}return null;})[_0x1e1d('0x27')](function(_0x54fdeb){if(_0x54fdeb){if(!_0x54fdeb[_0x1e1d('0x46')]){throw new db[(_0x1e1d('0x67'))]['ValidationErrorItem'](_0x1e1d('0x88'),0x193);}_0x7c7aa0=_0x54fdeb;return db[_0x1e1d('0x69')][_0x1e1d('0x40')]({'raw':!![]});}return null;})[_0x1e1d('0x27')](function(_0x3f485d){if(_0x3f485d){_0x376991=_[_0x1e1d('0x6a')](_0x3f485d,'id');var _0xcc99c8;var _0x1c59d2=squel[_0x1e1d('0x6b')]();_0x1c59d2[_0x1e1d('0x89')](_0x22158f[_0x1e1d('0x6c')]);for(var _0x2d3120=0x0;_0x2d3120<_0x7c7aa0[_0x1e1d('0x46')];_0x2d3120+=0x1){_0xcc99c8=_0x7c7aa0[_0x2d3120]['MetricId']?_0x376991[_0x7c7aa0[_0x2d3120][_0x1e1d('0x6d')]]['metric']:_0x7c7aa0[_0x2d3120][_0x1e1d('0x63')];_0xcc99c8=_0x7c7aa0[_0x2d3120][_0x1e1d('0x6e')]?_['replace'](_0x24b9e2[_0x7c7aa0[_0x2d3120][_0x1e1d('0x6e')]],'%s',_0xcc99c8):_0xcc99c8;_0xcc99c8=_0x7c7aa0[_0x2d3120]['format']?_[_0x1e1d('0x6f')](_0x504faf[_0x7c7aa0[_0x2d3120][_0x1e1d('0x70')]],'%s',_0xcc99c8):_0xcc99c8;if(_0x7c7aa0[_0x2d3120][_0x1e1d('0x71')]){_0x1c59d2['group'](_0xcc99c8);}_0x7c7aa0[_0x2d3120][_0x1e1d('0x73')]&&_0x1c59d2['order'](_0xcc99c8,_0x7c7aa0[_0x2d3120][_0x1e1d('0x73')]===_0x1e1d('0x74')?![]:!![]);_0x1c59d2['field'](_0xcc99c8,_0x7c7aa0[_0x2d3120][_0x1e1d('0x75')]||_0xcc99c8);}if(_0x22158f[_0x1e1d('0x76')]){_0x22158f[_0x1e1d('0x76')]=JSON[_0x1e1d('0x77')](_0x22158f[_0x1e1d('0x76')]);for(var _0x16c61d=0x0;_0x16c61d<_0x22158f[_0x1e1d('0x76')][_0x1e1d('0x46')];_0x16c61d+=0x1){if(_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x3c')]&&_[_0x1e1d('0x78')](_0x159205,_0x22158f['joins'][_0x16c61d][_0x1e1d('0x3c')])&&_0x22158f[_0x1e1d('0x76')][_0x16c61d]['parentKey']&&_0x22158f['joins'][_0x16c61d]['foreignTable']&&_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x7a')]){_0x1c59d2[_0x22158f['joins'][_0x16c61d]['type']](_0x22158f['joins'][_0x16c61d][_0x1e1d('0x7b')],null,util[_0x1e1d('0x70')](_0x1e1d('0x8b'),_0x22158f[_0x1e1d('0x6c')],_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x79')],_0x22158f['joins'][_0x16c61d]['foreignTable'],_0x22158f[_0x1e1d('0x76')][_0x16c61d][_0x1e1d('0x7a')]));}}}if(_0x22158f['conditions']){_0x22158f[_0x1e1d('0x7c')]=JSON[_0x1e1d('0x77')](_0x22158f[_0x1e1d('0x7c')]);_0x1c59d2['where'](_0x2d89a3(_0x22158f[_0x1e1d('0x7c')][_0x1e1d('0x72')]));}_0xb43c67=_0x1c59d2[_0x1e1d('0x7d')]();_0x1c59d2[_0x1e1d('0x21')](_0x268ccf);_0x1c59d2[_0x1e1d('0x1f')](0x0);logger[_0x1e1d('0x7e')](_0x1e1d('0xa3'),_0x1c59d2[_0x1e1d('0x7f')]());return dbH[_0x1e1d('0x80')]['query'](_0x1c59d2[_0x1e1d('0x7f')](),{'type':dbH[_0x1e1d('0x80')][_0x1e1d('0x9e')][_0x1e1d('0x81')]});}})['then'](function(){return{'sql':_0xb43c67['toString']()};})[_0x1e1d('0x27')](respondWithResult(_0x5a6c49,null))[_0x1e1d('0x42')](handleError(_0x5a6c49,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index fd1dc43..66a848d 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 _0x72bd=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x72bd,0xcf));var _0xd72b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x72bd[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xd72b('0x0'));var util=require('util');var logger=require(_0xd72b('0x1'))(_0xd72b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd72b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd72b('0x4'));var config=require(_0xd72b('0x5'));var attributes=require(_0xd72b('0x6'));module['exports']=function(_0x3f3b04,_0x1668d8){return _0x3f3b04[_0xd72b('0x7')](_0xd72b('0x8'),attributes,{'tableName':_0xd72b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf59c=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird'];(function(_0x53930c,_0x407eb1){var _0x3d5db2=function(_0x2d247c){while(--_0x2d247c){_0x53930c['push'](_0x53930c['shift']());}};_0x3d5db2(++_0x407eb1);}(_0xf59c,0x127));var _0xcf59=function(_0xa4405e,_0x4b5af1){_0xa4405e=_0xa4405e-0x0;var _0x29e6a5=_0xf59c[_0xa4405e];return _0x29e6a5;};'use strict';var _=require(_0xcf59('0x0'));var util=require(_0xcf59('0x1'));var logger=require('../../config/logger')(_0xcf59('0x2'));var moment=require(_0xcf59('0x3'));var BPromise=require(_0xcf59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf59('0x5'));var rimraf=require(_0xcf59('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf59('0x7'));module[_0xcf59('0x8')]=function(_0x110816,_0x18f214){return _0x110816[_0xcf59('0x9')](_0xcf59('0xa'),attributes,{'tableName':_0xcf59('0xb'),'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 7723650..3cf8770 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 _0x5433=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x292f4a,_0x556180){var _0x4dcf71=function(_0x3bb767){while(--_0x3bb767){_0x292f4a['push'](_0x292f4a['shift']());}};_0x4dcf71(++_0x556180);}(_0x5433,0x167));var _0x3543=function(_0x25d6c5,_0x262eb0){_0x25d6c5=_0x25d6c5-0x0;var _0x78eb4b=_0x5433[_0x25d6c5];return _0x78eb4b;};'use strict';var _=require('lodash');var util=require(_0x3543('0x0'));var moment=require(_0x3543('0x1'));var BPromise=require(_0x3543('0x2'));var rs=require(_0x3543('0x3'));var fs=require('fs');var Redis=require(_0x3543('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3543('0x5'))(_0x3543('0x6'));var config=require(_0x3543('0x7'));var jayson=require(_0x3543('0x8'));var client=jayson[_0x3543('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5729,_0xf1f114,_0x46630f){return new BPromise(function(_0x4d6567,_0x1e37ab){return client[_0x3543('0xa')](_0x3a5729,_0x46630f)[_0x3543('0xb')](function(_0x3e6620){logger[_0x3543('0xc')](_0x3543('0xd'),_0xf1f114,_0x3543('0xe'));logger[_0x3543('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xf1f114,_0x3543('0xe'),JSON[_0x3543('0x10')](_0x3e6620));if(_0x3e6620[_0x3543('0x11')]){if(_0x3e6620[_0x3543('0x11')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xf1f114,_0x3e6620['error'][_0x3543('0x12')]);return _0x1e37ab(_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);}logger['error'](_0x3543('0xd'),_0xf1f114,_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);return _0x4d6567(_0x3e6620[_0x3543('0x11')][_0x3543('0x12')]);}else{logger[_0x3543('0xc')](_0x3543('0xd'),_0xf1f114,_0x3543('0xe'));_0x4d6567(_0x3e6620[_0x3543('0x13')][_0x3543('0x12')]);}})[_0x3543('0x14')](function(_0x1c5354){logger[_0x3543('0x11')](_0x3543('0xd'),_0xf1f114,_0x1c5354);_0x1e37ab(_0x1c5354);});});} \ No newline at end of file +var _0x974a=['stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x51c976,_0x10016f){var _0x4d1da8=function(_0x1783f5){while(--_0x1783f5){_0x51c976['push'](_0x51c976['shift']());}};_0x4d1da8(++_0x10016f);}(_0x974a,0x10e));var _0xa974=function(_0x506bc5,_0x5ab7c7){_0x506bc5=_0x506bc5-0x0;var _0x3ce96b=_0x974a[_0x506bc5];return _0x3ce96b;};'use strict';var _=require(_0xa974('0x0'));var util=require('util');var moment=require(_0xa974('0x1'));var BPromise=require('bluebird');var rs=require(_0xa974('0x2'));var fs=require('fs');var Redis=require(_0xa974('0x3'));var db=require(_0xa974('0x4'))['db'];var utils=require(_0xa974('0x5'));var logger=require(_0xa974('0x6'))(_0xa974('0x7'));var config=require(_0xa974('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa974('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac3f4,_0x1ef05c,_0x4ad1b9){return new BPromise(function(_0x1814f3,_0x49cda7){return client[_0xa974('0xa')](_0x5ac3f4,_0x4ad1b9)[_0xa974('0xb')](function(_0x406cf3){logger[_0xa974('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0xa974('0xd'));logger[_0xa974('0xe')](_0xa974('0xf'),_0x1ef05c,'request\x20sent',JSON[_0xa974('0x10')](_0x406cf3));if(_0x406cf3[_0xa974('0x11')]){if(_0x406cf3[_0xa974('0x11')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0x406cf3['error'][_0xa974('0x12')]);return _0x49cda7(_0x406cf3[_0xa974('0x11')][_0xa974('0x12')]);}logger[_0xa974('0x11')](_0xa974('0x13'),_0x1ef05c,_0x406cf3[_0xa974('0x11')][_0xa974('0x12')]);return _0x1814f3(_0x406cf3[_0xa974('0x11')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ef05c,_0xa974('0xd'));_0x1814f3(_0x406cf3[_0xa974('0x14')]['message']);}})[_0xa974('0x15')](function(_0x3059bf){logger[_0xa974('0x11')](_0xa974('0x13'),_0x1ef05c,_0x3059bf);_0x49cda7(_0x3059bf);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b66d8fb..3897bf7 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 _0xa2ec=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','/:id','isAuthenticated','/:id/preview','preview','/:id/run','query','post','create','put'];(function(_0x4838d5,_0x5e0bd8){var _0x34c70f=function(_0x44d011){while(--_0x44d011){_0x4838d5['push'](_0x4838d5['shift']());}};_0x34c70f(++_0x5e0bd8);}(_0xa2ec,0x1e2));var _0xca2e=function(_0x22d655,_0x3941dd){_0x22d655=_0x22d655-0x0;var _0x257739=_0xa2ec[_0x22d655];return _0x257739;};'use strict';var multer=require(_0xca2e('0x0'));var util=require(_0xca2e('0x1'));var path=require('path');var timeout=require(_0xca2e('0x2'));var express=require(_0xca2e('0x3'));var router=express[_0xca2e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xca2e('0x5'));var interaction=require(_0xca2e('0x6'));var config=require('../../config/environment');var controller=require(_0xca2e('0x7'));router[_0xca2e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca2e('0x8')](_0xca2e('0x9'),auth[_0xca2e('0xa')](),controller['show']);router[_0xca2e('0x8')](_0xca2e('0xb'),auth['isAuthenticated'](),controller[_0xca2e('0xc')]);router['get'](_0xca2e('0xd'),auth['isAuthenticated'](),controller['run']);router[_0xca2e('0x8')]('/:id/query',auth[_0xca2e('0xa')](),controller[_0xca2e('0xe')]);router[_0xca2e('0xf')]('/',auth[_0xca2e('0xa')](),controller[_0xca2e('0x10')]);router[_0xca2e('0x11')](_0xca2e('0x9'),auth[_0xca2e('0xa')](),controller['update']);router['delete'](_0xca2e('0x9'),auth['isAuthenticated'](),controller[_0xca2e('0x12')]);module[_0xca2e('0x13')]=router; \ No newline at end of file +var _0x7109=['fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','delete','destroy','multer','util','path','express','Router'];(function(_0x1b26ac,_0x5ea577){var _0x2d88ec=function(_0x4d6110){while(--_0x4d6110){_0x1b26ac['push'](_0x1b26ac['shift']());}};_0x2d88ec(++_0x5ea577);}(_0x7109,0x73));var _0x9710=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0x7109[_0x70fd53];return _0x4b71c5;};'use strict';var multer=require(_0x9710('0x0'));var util=require(_0x9710('0x1'));var path=require(_0x9710('0x2'));var timeout=require('connect-timeout');var express=require(_0x9710('0x3'));var router=express[_0x9710('0x4')]();var fs_extra=require(_0x9710('0x5'));var auth=require(_0x9710('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9710('0x7'));var controller=require(_0x9710('0x8'));router[_0x9710('0x9')]('/',auth['isAuthenticated'](),controller[_0x9710('0xa')]);router['get'](_0x9710('0xb'),auth[_0x9710('0xc')](),controller[_0x9710('0xd')]);router[_0x9710('0x9')](_0x9710('0xe'),auth[_0x9710('0xc')](),controller[_0x9710('0xf')]);router['get'](_0x9710('0x10'),auth[_0x9710('0xc')](),controller[_0x9710('0x11')]);router['get'](_0x9710('0x12'),auth[_0x9710('0xc')](),controller[_0x9710('0x13')]);router[_0x9710('0x14')]('/',auth[_0x9710('0xc')](),controller[_0x9710('0x15')]);router['put'](_0x9710('0xb'),auth[_0x9710('0xc')](),controller['update']);router[_0x9710('0x16')](_0x9710('0xb'),auth[_0x9710('0xc')](),controller[_0x9710('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1622248..3358daa 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x296187,_0x66707b){var _0x4565d2=function(_0xb3f7cb){while(--_0xb3f7cb){_0x296187['push'](_0x296187['shift']());}};_0x4565d2(++_0x66707b);}(_0x5fab,0x177));var _0xb5fa=function(_0x4706a6,_0x5a1c63){_0x4706a6=_0x4706a6-0x0;var _0x1bb705=_0x5fab[_0x4706a6];return _0x1bb705;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x1c5835,_0x20431a){var _0x558ebf=function(_0x2bc9da){while(--_0x2bc9da){_0x1c5835['push'](_0x1c5835['shift']());}};_0x558ebf(++_0x20431a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x53b133,_0x176261){_0x53b133=_0x53b133-0x0;var _0x5647e0=_0x24ca[_0x53b133];return _0x5647e0;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 9f333cc..fd62ccc 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 _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(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'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 +var _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x1a9ed0,_0x1085fc){var _0x47bbd6=function(_0x27bd1c){while(--_0x27bd1c){_0x1a9ed0['push'](_0x1a9ed0['shift']());}};_0x47bbd6(++_0x1085fc);}(_0xba34,0x119));var _0x4ba3=function(_0x492e80,_0xd87aba){_0x492e80=_0x492e80-0x0;var _0x413d79=_0xba34[_0x492e80];return _0x413d79;};'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'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 767b8f9..cd7d135 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 _0x27d8=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1f6994,_0x2b4985){var _0x592e20=function(_0x3457e0){while(--_0x3457e0){_0x1f6994['push'](_0x1f6994['shift']());}};_0x592e20(++_0x2b4985);}(_0x27d8,0x138));var _0x827d=function(_0x3b632f,_0x453380){_0x3b632f=_0x3b632f-0x0;var _0x10e788=_0x27d8[_0x3b632f];return _0x10e788;};'use strict';var _=require(_0x827d('0x0'));var util=require(_0x827d('0x1'));var logger=require(_0x827d('0x2'))(_0x827d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x827d('0x4'));var fs=require('fs');var path=require(_0x827d('0x5'));var rimraf=require(_0x827d('0x6'));var config=require(_0x827d('0x7'));var attributes=require(_0x827d('0x8'));module[_0x827d('0x9')]=function(_0x5c9d71,_0x3f9756){return _0x5c9d71[_0x827d('0xa')](_0x827d('0xb'),attributes,{'tableName':_0x827d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3df9=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4b99b2,_0x4f3b64){var _0x21b2ab=function(_0x5baf59){while(--_0x5baf59){_0x4b99b2['push'](_0x4b99b2['shift']());}};_0x21b2ab(++_0x4f3b64);}(_0x3df9,0x1cf));var _0x93df=function(_0x11df98,_0x55313e){_0x11df98=_0x11df98-0x0;var _0x3d313a=_0x3df9[_0x11df98];return _0x3d313a;};'use strict';var _=require(_0x93df('0x0'));var util=require('util');var logger=require(_0x93df('0x1'))(_0x93df('0x2'));var moment=require(_0x93df('0x3'));var BPromise=require(_0x93df('0x4'));var rp=require(_0x93df('0x5'));var fs=require('fs');var path=require(_0x93df('0x6'));var rimraf=require(_0x93df('0x7'));var config=require(_0x93df('0x8'));var attributes=require(_0x93df('0x9'));module[_0x93df('0xa')]=function(_0xf0ea9d,_0x86dda4){return _0xf0ea9d[_0x93df('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x93df('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 0aafc8e..0220dd1 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 _0xacbe=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x570fff,_0x145cff){var _0x4b1a44=function(_0x48c874){while(--_0x48c874){_0x570fff['push'](_0x570fff['shift']());}};_0x4b1a44(++_0x145cff);}(_0xacbe,0x128));var _0xeacb=function(_0x3f17b5,_0x429d58){_0x3f17b5=_0x3f17b5-0x0;var _0x5685bc=_0xacbe[_0x3f17b5];return _0x5685bc;};'use strict';var _=require(_0xeacb('0x0'));var util=require(_0xeacb('0x1'));var moment=require(_0xeacb('0x2'));var BPromise=require('bluebird');var rs=require(_0xeacb('0x3'));var fs=require('fs');var Redis=require(_0xeacb('0x4'));var db=require(_0xeacb('0x5'))['db'];var utils=require(_0xeacb('0x6'));var logger=require(_0xeacb('0x7'))(_0xeacb('0x8'));var config=require('../../config/environment');var jayson=require(_0xeacb('0x9'));var client=jayson['client'][_0xeacb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189e1c,_0x5be16e,_0x136272){return new BPromise(function(_0x3e41b0,_0x5348fe){return client[_0xeacb('0xb')](_0x189e1c,_0x136272)['then'](function(_0x2309ae){logger[_0xeacb('0xc')](_0xeacb('0xd'),_0x5be16e,_0xeacb('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x5be16e,_0xeacb('0xe'),JSON[_0xeacb('0xf')](_0x2309ae));if(_0x2309ae[_0xeacb('0x10')]){if(_0x2309ae[_0xeacb('0x10')]['code']===0x1f4){logger[_0xeacb('0x10')](_0xeacb('0xd'),_0x5be16e,_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);return _0x5348fe(_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5be16e,_0x2309ae['error'][_0xeacb('0x11')]);return _0x3e41b0(_0x2309ae[_0xeacb('0x10')][_0xeacb('0x11')]);}else{logger['info'](_0xeacb('0xd'),_0x5be16e,_0xeacb('0xe'));_0x3e41b0(_0x2309ae[_0xeacb('0x12')]['message']);}})[_0xeacb('0x13')](function(_0x3b0464){logger[_0xeacb('0x10')](_0xeacb('0xd'),_0x5be16e,_0x3b0464);_0x5348fe(_0x3b0464);});});} \ No newline at end of file +var _0xaa05=['http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26b313,_0x271a5d){var _0x5f2ab1=function(_0x573c30){while(--_0x573c30){_0x26b313['push'](_0x26b313['shift']());}};_0x5f2ab1(++_0x271a5d);}(_0xaa05,0xc3));var _0x5aa0=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0xaa05[_0xbc4659];return _0x5831f9;};'use strict';var _=require(_0x5aa0('0x0'));var util=require(_0x5aa0('0x1'));var moment=require(_0x5aa0('0x2'));var BPromise=require(_0x5aa0('0x3'));var rs=require(_0x5aa0('0x4'));var fs=require('fs');var Redis=require(_0x5aa0('0x5'));var db=require(_0x5aa0('0x6'))['db'];var utils=require(_0x5aa0('0x7'));var logger=require(_0x5aa0('0x8'))(_0x5aa0('0x9'));var config=require(_0x5aa0('0xa'));var jayson=require(_0x5aa0('0xb'));var client=jayson['client'][_0x5aa0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x728510,_0x3a62d9,_0x397c4c){return new BPromise(function(_0x52c49a,_0x1da94c){return client[_0x5aa0('0xd')](_0x728510,_0x397c4c)[_0x5aa0('0xe')](function(_0x45fcce){logger['info'](_0x5aa0('0xf'),_0x3a62d9,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3a62d9,_0x5aa0('0x10'),JSON[_0x5aa0('0x11')](_0x45fcce));if(_0x45fcce[_0x5aa0('0x12')]){if(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x13')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a62d9,_0x45fcce['error']['message']);return _0x1da94c(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);}logger[_0x5aa0('0x12')](_0x5aa0('0xf'),_0x3a62d9,_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);return _0x52c49a(_0x45fcce[_0x5aa0('0x12')][_0x5aa0('0x14')]);}else{logger['info'](_0x5aa0('0xf'),_0x3a62d9,_0x5aa0('0x10'));_0x52c49a(_0x45fcce[_0x5aa0('0x15')][_0x5aa0('0x14')]);}})[_0x5aa0('0x16')](function(_0x4844f8){logger[_0x5aa0('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3a62d9,_0x4844f8);_0x1da94c(_0x4844f8);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index fdf62d1..927c1cc 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 _0x2a14=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x2d8d69,_0x8e47ff){var _0x39ae22=function(_0xd7935e){while(--_0xd7935e){_0x2d8d69['push'](_0x2d8d69['shift']());}};_0x39ae22(++_0x8e47ff);}(_0x2a14,0x123));var _0x42a1=function(_0x4bba58,_0x50859e){_0x4bba58=_0x4bba58-0x0;var _0x2f43f0=_0x2a14[_0x4bba58];return _0x2f43f0;};'use strict';var multer=require(_0x42a1('0x0'));var util=require(_0x42a1('0x1'));var path=require('path');var timeout=require(_0x42a1('0x2'));var express=require(_0x42a1('0x3'));var router=express[_0x42a1('0x4')]();var fs_extra=require(_0x42a1('0x5'));var auth=require(_0x42a1('0x6'));var interaction=require(_0x42a1('0x7'));var config=require(_0x42a1('0x8'));var controller=require(_0x42a1('0x9'));router[_0x42a1('0xa')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0xc')]);router[_0x42a1('0xa')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0xd')]);router['get'](_0x42a1('0xe'),auth[_0x42a1('0xb')](),controller[_0x42a1('0xf')]);router['get'](_0x42a1('0x10'),auth[_0x42a1('0xb')](),controller['run']);router['get'](_0x42a1('0x11'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x12')]);router[_0x42a1('0x13')]('/',auth[_0x42a1('0xb')](),controller[_0x42a1('0x14')]);router[_0x42a1('0x15')](_0x42a1('0x16'),auth[_0x42a1('0xb')](),controller[_0x42a1('0x17')]);router[_0x42a1('0x18')]('/:id',auth[_0x42a1('0xb')](),controller[_0x42a1('0x19')]);module[_0x42a1('0x1a')]=router; \ No newline at end of file +var _0xd488=['post','put','/:id','delete','destroy','util','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','run'];(function(_0x6b44d2,_0x7b7c2e){var _0x52f6f2=function(_0x5cd6ed){while(--_0x5cd6ed){_0x6b44d2['push'](_0x6b44d2['shift']());}};_0x52f6f2(++_0x7b7c2e);}(_0xd488,0x104));var _0x8d48=function(_0xab8668,_0x5204ac){_0xab8668=_0xab8668-0x0;var _0x571c10=_0xd488[_0xab8668];return _0x571c10;};'use strict';var multer=require('multer');var util=require(_0x8d48('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d48('0x1')]();var fs_extra=require(_0x8d48('0x2'));var auth=require(_0x8d48('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8d48('0x4'));var controller=require(_0x8d48('0x5'));router[_0x8d48('0x6')]('/',auth[_0x8d48('0x7')](),controller['index']);router['get']('/:id',auth[_0x8d48('0x7')](),controller['show']);router[_0x8d48('0x6')](_0x8d48('0x8'),auth[_0x8d48('0x7')](),controller[_0x8d48('0x9')]);router[_0x8d48('0x6')](_0x8d48('0xa'),auth[_0x8d48('0x7')](),controller[_0x8d48('0xb')]);router[_0x8d48('0x6')]('/:id/query',auth[_0x8d48('0x7')](),controller['query']);router[_0x8d48('0xc')]('/',auth[_0x8d48('0x7')](),controller['create']);router[_0x8d48('0xd')](_0x8d48('0xe'),auth[_0x8d48('0x7')](),controller['update']);router[_0x8d48('0xf')](_0x8d48('0xe'),auth['isAuthenticated'](),controller[_0x8d48('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index cb47389..5f8aedf 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 _0x0b69=['sequelize','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','UNSIGNED'];(function(_0x30eb02,_0x269f7c){var _0x288ac1=function(_0x21a7ac){while(--_0x21a7ac){_0x30eb02['push'](_0x30eb02['shift']());}};_0x288ac1(++_0x269f7c);}(_0x0b69,0x19a));var _0x90b6=function(_0x3ae429,_0x1ec8a4){_0x3ae429=_0x3ae429-0x0;var _0xf22047=_0x0b69[_0x3ae429];return _0xf22047;};'use strict';var Sequelize=require(_0x90b6('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x90b6('0x2')](_0x90b6('0x3'),_0x90b6('0x4'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x90b6('0x1')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x90b6('0x5')]},'status':{'type':Sequelize[_0x90b6('0x1')],'defaultValue':_0x90b6('0x6')},'type':{'type':Sequelize[_0x90b6('0x2')](_0x90b6('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x90b6('0x7')},'reportId':{'type':Sequelize[_0x90b6('0x8')](0xb)[_0x90b6('0x9')]},'reportType':{'type':Sequelize[_0x90b6('0x1')]}}; \ No newline at end of file +var _0x4ef6=['manual','scheduled','sequelize','moment','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0xf2bfa7,_0x1e326f){var _0x3254ec=function(_0x42abd5){while(--_0x42abd5){_0xf2bfa7['push'](_0xf2bfa7['shift']());}};_0x3254ec(++_0x1e326f);}(_0x4ef6,0x7a));var _0x64ef=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x4ef6[_0xe1a3a5];return _0x362646;};'use strict';var Sequelize=require(_0x64ef('0x0'));var moment=require(_0x64ef('0x1'));module['exports']={'name':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x64ef('0x3')](_0x64ef('0x4'),_0x64ef('0x5'),_0x64ef('0x6')),'allowNull':![],'defaultValue':_0x64ef('0x4')},'savename':{'type':Sequelize[_0x64ef('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x64ef('0x7')]},'endDate':{'type':Sequelize[_0x64ef('0x7')]},'status':{'type':Sequelize[_0x64ef('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x64ef('0x3')](_0x64ef('0x8'),_0x64ef('0x9')),'allowNull':![],'defaultValue':_0x64ef('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x64ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 73402ef..af81744 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 _0x3fa3=['jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','download','basename','savename','join','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','root','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x5c3194,_0x2ebfec){var _0x402748=function(_0x52a8b4){while(--_0x52a8b4){_0x5c3194['push'](_0x5c3194['shift']());}};_0x402748(++_0x2ebfec);}(_0x3fa3,0x1c5));var _0x33fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fa3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x33fa('0x0'));var rimraf=require(_0x33fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33fa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33fa('0x3'));var Mustache=require(_0x33fa('0x4'));var util=require(_0x33fa('0x5'));var path=require(_0x33fa('0x6'));var sox=require(_0x33fa('0x7'));var csv=require('to-csv');var ejs=require(_0x33fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33fa('0x9'));var squel=require(_0x33fa('0xa'));var crypto=require(_0x33fa('0xb'));var jsforce=require(_0x33fa('0xc'));var deskjs=require(_0x33fa('0xd'));var toCsv=require(_0x33fa('0xe'));var querystring=require(_0x33fa('0xf'));var Papa=require(_0x33fa('0x10'));var Redis=require('ioredis');var authService=require(_0x33fa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x33fa('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33fa('0x13'))('api');var utils=require(_0x33fa('0x14'));var config=require(_0x33fa('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x33fa('0x16'))['db'];function respondWithStatusCode(_0x4f5db8,_0x57a3c8){_0x57a3c8=_0x57a3c8||0xcc;return function(_0x3c016a){if(_0x3c016a){return _0x4f5db8['sendStatus'](_0x57a3c8);}return _0x4f5db8[_0x33fa('0x17')](_0x57a3c8)[_0x33fa('0x18')]();};}function respondWithResult(_0x3f28f5,_0x5cdd1e){_0x5cdd1e=_0x5cdd1e||0xc8;return function(_0x3599ae){if(_0x3599ae){return _0x3f28f5['status'](_0x5cdd1e)[_0x33fa('0x19')](_0x3599ae);}};}function respondWithFilteredResult(_0x316481,_0x4c0e53){return function(_0xfdd9a7){if(_0xfdd9a7){var _0x322d06=typeof _0x4c0e53[_0x33fa('0x1a')]===_0x33fa('0x1b')&&typeof _0x4c0e53[_0x33fa('0x1c')]===_0x33fa('0x1b');var _0x25fbba=_0xfdd9a7[_0x33fa('0x1d')];var _0x29db92=_0x322d06?0x0:_0x4c0e53[_0x33fa('0x1a')];var _0x47ac74=_0x322d06?_0xfdd9a7[_0x33fa('0x1d')]:_0x4c0e53[_0x33fa('0x1a')]+_0x4c0e53[_0x33fa('0x1c')];var _0x12992a;if(_0x47ac74>=_0x25fbba){_0x47ac74=_0x25fbba;_0x12992a=0xc8;}else{_0x12992a=0xce;}_0x316481[_0x33fa('0x17')](_0x12992a);return _0x316481[_0x33fa('0x1e')]('Content-Range',_0x29db92+'-'+_0x47ac74+'/'+_0x25fbba)[_0x33fa('0x19')](_0xfdd9a7);}return null;};}function patchUpdates(_0x1c4f94){return function(_0x3e0f99){try{jsonpatch[_0x33fa('0x1f')](_0x3e0f99,_0x1c4f94,!![]);}catch(_0x24f30e){return BPromise[_0x33fa('0x20')](_0x24f30e);}return _0x3e0f99['save']();};}function saveUpdates(_0x5a87da,_0x314a78){return function(_0x1e0044){if(_0x1e0044){return _0x1e0044[_0x33fa('0x21')](_0x5a87da)[_0x33fa('0x22')](function(_0x58d064){return _0x58d064;});}return null;};}function removeEntity(_0x49ee2b,_0xea152c){return function(_0x9f67ea){if(_0x9f67ea){return _0x9f67ea[_0x33fa('0x23')]()[_0x33fa('0x22')](function(){var _0x17d235=_0x9f67ea['get']({'plain':!![]});var _0x3ead5a='ExtractedReports';return db['UserProfileResource'][_0x33fa('0x23')]({'where':{'type':_0x3ead5a,'resourceId':_0x17d235['id']}})['then'](function(){return _0x9f67ea;});})[_0x33fa('0x22')](function(){_0x49ee2b[_0x33fa('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1682,_0x195bc4){return function(_0x18a8d2){if(!_0x18a8d2){_0x2f1682['sendStatus'](0x194);}return _0x18a8d2;};}function handleError(_0x2216cd,_0x28ef5e){_0x28ef5e=_0x28ef5e||0x1f4;return function(_0x589482){logger[_0x33fa('0x24')](_0x589482[_0x33fa('0x25')]);if(_0x589482[_0x33fa('0x26')]){delete _0x589482[_0x33fa('0x26')];}_0x2216cd[_0x33fa('0x17')](_0x28ef5e)[_0x33fa('0x27')](_0x589482);};}exports[_0x33fa('0x28')]=function(_0x3a642d,_0x12ffeb){var _0x5cb39f={},_0xdd056={},_0x156ed3={'count':0x0,'rows':[]};var _0x1535e3=_[_0x33fa('0x29')](db['AnalyticExtractedReport'][_0x33fa('0x2a')],function(_0x1642d7){return{'name':_0x1642d7[_0x33fa('0x2b')],'type':_0x1642d7[_0x33fa('0x2c')]['key']};});_0xdd056[_0x33fa('0x2d')]=_[_0x33fa('0x29')](_0x1535e3,'name');_0xdd056[_0x33fa('0x2e')]=_[_0x33fa('0x2f')](_0x3a642d['query']);_0xdd056[_0x33fa('0x30')]=_[_0x33fa('0x31')](_0xdd056[_0x33fa('0x2d')],_0xdd056[_0x33fa('0x2e')]);_0x5cb39f[_0x33fa('0x32')]=_[_0x33fa('0x31')](_0xdd056[_0x33fa('0x2d')],qs[_0x33fa('0x33')](_0x3a642d['query'][_0x33fa('0x33')]));_0x5cb39f['attributes']=_0x5cb39f['attributes'][_0x33fa('0x34')]?_0x5cb39f[_0x33fa('0x32')]:_0xdd056[_0x33fa('0x2d')];if(!_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x35')](_0x33fa('0x36'))){_0x5cb39f[_0x33fa('0x1c')]=qs['limit'](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x1c')]);_0x5cb39f[_0x33fa('0x1a')]=qs[_0x33fa('0x1a')](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x1a')]);}_0x5cb39f[_0x33fa('0x37')]=qs['sort'](_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x38')]);_0x5cb39f[_0x33fa('0x39')]=qs[_0x33fa('0x30')](_[_0x33fa('0x3a')](_0x3a642d[_0x33fa('0x2e')],_0xdd056[_0x33fa('0x30')]),_0x1535e3);if(_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x3b')]){_0x5cb39f[_0x33fa('0x39')]=_[_0x33fa('0x3c')](_0x5cb39f[_0x33fa('0x39')],{'$or':_['map'](_0x1535e3,function(_0x4bb511){if(_0x4bb511[_0x33fa('0x2c')]!=='VIRTUAL'){var _0x421b2c={};_0x421b2c[_0x4bb511['name']]={'$like':'%'+_0x3a642d['query']['filter']+'%'};return _0x421b2c;}})});}_0x5cb39f=_[_0x33fa('0x3c')]({},_0x5cb39f,_0x3a642d[_0x33fa('0x3d')]);var _0x30d397={'where':_0x5cb39f[_0x33fa('0x39')]};return db[_0x33fa('0x3e')][_0x33fa('0x1d')](_0x30d397)[_0x33fa('0x22')](function(_0x984cea){_0x156ed3['count']=_0x984cea;if(_0x3a642d[_0x33fa('0x2e')][_0x33fa('0x3f')]){_0x5cb39f[_0x33fa('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x33fa('0x41')](_0x5cb39f);})['then'](function(_0x4fb893){_0x156ed3['rows']=_0x4fb893;return _0x156ed3;})[_0x33fa('0x22')](respondWithFilteredResult(_0x12ffeb,_0x5cb39f))[_0x33fa('0x42')](handleError(_0x12ffeb,null));};exports[_0x33fa('0x43')]=function(_0x306be6,_0x5e8776){var _0x42e522={'raw':!![],'where':{'id':_0x306be6[_0x33fa('0x44')]['id']}},_0x43bf0a={};_0x43bf0a[_0x33fa('0x2d')]=_['keys'](db[_0x33fa('0x3e')][_0x33fa('0x2a')]);_0x43bf0a[_0x33fa('0x2e')]=_[_0x33fa('0x2f')](_0x306be6[_0x33fa('0x2e')]);_0x43bf0a[_0x33fa('0x30')]=_[_0x33fa('0x31')](_0x43bf0a[_0x33fa('0x2d')],_0x43bf0a['query']);_0x42e522[_0x33fa('0x32')]=_[_0x33fa('0x31')](_0x43bf0a['model'],qs[_0x33fa('0x33')](_0x306be6['query'][_0x33fa('0x33')]));_0x42e522[_0x33fa('0x32')]=_0x42e522[_0x33fa('0x32')][_0x33fa('0x34')]?_0x42e522['attributes']:_0x43bf0a[_0x33fa('0x2d')];if(_0x306be6[_0x33fa('0x2e')][_0x33fa('0x3f')]){_0x42e522[_0x33fa('0x40')]=[{'all':!![]}];}_0x42e522=_['merge']({},_0x42e522,_0x306be6[_0x33fa('0x3d')]);return db[_0x33fa('0x3e')][_0x33fa('0x45')](_0x42e522)[_0x33fa('0x22')](handleEntityNotFound(_0x5e8776,null))[_0x33fa('0x22')](respondWithResult(_0x5e8776,null))[_0x33fa('0x42')](handleError(_0x5e8776,null));};exports[_0x33fa('0x46')]=function(_0x94fa82,_0x115e23){return db[_0x33fa('0x3e')][_0x33fa('0x46')](_0x94fa82[_0x33fa('0x47')],{})[_0x33fa('0x22')](function(_0x338e02){var _0xdaa64f=_0x94fa82['user']['get']({'plain':!![]});if(!_0xdaa64f)throw new Error(_0x33fa('0x48'));if(_0xdaa64f[_0x33fa('0x49')]===_0x33fa('0x4a')){var _0x2a147b=_0x338e02[_0x33fa('0x4b')]({'plain':!![]});var _0x4ba331='ExtractedReports';return db[_0x33fa('0x4c')][_0x33fa('0x45')]({'where':{'name':_0x4ba331,'userProfileId':_0xdaa64f[_0x33fa('0x4d')]},'raw':!![]})[_0x33fa('0x22')](function(_0x4b47b4){if(_0x4b47b4&&_0x4b47b4[_0x33fa('0x4e')]===0x0){return db['UserProfileResource'][_0x33fa('0x46')]({'name':_0x2a147b['name'],'resourceId':_0x2a147b['id'],'type':_0x4b47b4[_0x33fa('0x26')],'sectionId':_0x4b47b4['id']},{})['then'](function(){return _0x338e02;});}else{return _0x338e02;}})[_0x33fa('0x42')](function(_0x40fd33){logger[_0x33fa('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40fd33);throw _0x40fd33;});}return _0x338e02;})[_0x33fa('0x22')](respondWithResult(_0x115e23,0xc9))[_0x33fa('0x42')](handleError(_0x115e23,null));};exports[_0x33fa('0x21')]=function(_0x2336c7,_0x303e3e){if(_0x2336c7[_0x33fa('0x47')]['id']){delete _0x2336c7[_0x33fa('0x47')]['id'];}return db[_0x33fa('0x3e')][_0x33fa('0x45')]({'where':{'id':_0x2336c7['params']['id']}})[_0x33fa('0x22')](handleEntityNotFound(_0x303e3e,null))[_0x33fa('0x22')](saveUpdates(_0x2336c7[_0x33fa('0x47')],null))[_0x33fa('0x22')](respondWithResult(_0x303e3e,null))['catch'](handleError(_0x303e3e,null));};exports[_0x33fa('0x23')]=function(_0x53e2fd,_0x3da217){return db['AnalyticExtractedReport'][_0x33fa('0x45')]({'where':{'id':_0x53e2fd[_0x33fa('0x44')]['id']}})[_0x33fa('0x22')](handleEntityNotFound(_0x3da217,null))[_0x33fa('0x22')](removeEntity(_0x3da217,null))[_0x33fa('0x42')](handleError(_0x3da217,null));};exports[_0x33fa('0x4f')]=function(_0x3d697d,_0x2fedbf,_0x1697a1){return db[_0x33fa('0x3e')]['find']({'where':{'id':_0x3d697d['params']['id']},'attributes':['name',_0x33fa('0x50'),_0x33fa('0x51'),'output'],'raw':!![]})[_0x33fa('0x22')](handleEntityNotFound(_0x2fedbf,null))[_0x33fa('0x22')](function(_0x438ac1){if(_0x438ac1){if(!fs['existsSync'](path[_0x33fa('0x52')](config['root'],'server/files/reports',_0x438ac1['savename']))){throw new db[(_0x33fa('0x53'))][(_0x33fa('0x54'))](_0x33fa('0x55'));}if(_0x3d697d[_0x33fa('0x2e')][_0x33fa('0x56')]){return _0x2fedbf[_0x33fa('0x57')](0xc8);}return _0x2fedbf[_0x33fa('0x4f')](path[_0x33fa('0x52')](config[_0x33fa('0x58')],'server/files/reports',_0x438ac1[_0x33fa('0x51')]),util[_0x33fa('0x59')](_0x33fa('0x5a'),_0x438ac1[_0x33fa('0x50')]||_0x438ac1[_0x33fa('0x26')],_0x438ac1[_0x33fa('0x5b')][_0x33fa('0x5c')]()));}})['catch'](handleError(_0x2fedbf,null));}; \ No newline at end of file +var _0xbb51=['include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','existsSync','join','root','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll'];(function(_0xea6c7f,_0x18302f){var _0x3ae97e=function(_0x5dc40b){while(--_0x5dc40b){_0xea6c7f['push'](_0xea6c7f['shift']());}};_0x3ae97e(++_0x18302f);}(_0xbb51,0x1b7));var _0x1bb5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb51[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1bb5('0x0'));var rimraf=require(_0x1bb5('0x1'));var zipdir=require(_0x1bb5('0x2'));var jsonpatch=require(_0x1bb5('0x3'));var rp=require(_0x1bb5('0x4'));var moment=require(_0x1bb5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bb5('0x6'));var util=require(_0x1bb5('0x7'));var path=require(_0x1bb5('0x8'));var sox=require(_0x1bb5('0x9'));var csv=require('to-csv');var ejs=require(_0x1bb5('0xa'));var fs=require('fs');var fs_extra=require(_0x1bb5('0xb'));var _=require('lodash');var squel=require(_0x1bb5('0xc'));var crypto=require(_0x1bb5('0xd'));var jsforce=require(_0x1bb5('0xe'));var deskjs=require(_0x1bb5('0xf'));var toCsv=require(_0x1bb5('0x10'));var querystring=require(_0x1bb5('0x11'));var Papa=require(_0x1bb5('0x12'));var Redis=require(_0x1bb5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1bb5('0x14'));var as=require(_0x1bb5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bb5('0x16'))(_0x1bb5('0x17'));var utils=require('../../config/utils');var config=require(_0x1bb5('0x18'));var licenseUtil=require(_0x1bb5('0x19'));var db=require(_0x1bb5('0x1a'))['db'];function respondWithStatusCode(_0x2b7c3f,_0x5911c2){_0x5911c2=_0x5911c2||0xcc;return function(_0x487d23){if(_0x487d23){return _0x2b7c3f[_0x1bb5('0x1b')](_0x5911c2);}return _0x2b7c3f[_0x1bb5('0x1c')](_0x5911c2)[_0x1bb5('0x1d')]();};}function respondWithResult(_0x17b298,_0x2c5b40){_0x2c5b40=_0x2c5b40||0xc8;return function(_0x43a4b8){if(_0x43a4b8){return _0x17b298[_0x1bb5('0x1c')](_0x2c5b40)[_0x1bb5('0x1e')](_0x43a4b8);}};}function respondWithFilteredResult(_0x14420a,_0x3c4bb2){return function(_0x2e6042){if(_0x2e6042){var _0x1b6746=typeof _0x3c4bb2[_0x1bb5('0x1f')]===_0x1bb5('0x20')&&typeof _0x3c4bb2[_0x1bb5('0x21')]===_0x1bb5('0x20');var _0x4e0f77=_0x2e6042['count'];var _0xbfbf70=_0x1b6746?0x0:_0x3c4bb2[_0x1bb5('0x1f')];var _0x116eb2=_0x1b6746?_0x2e6042[_0x1bb5('0x22')]:_0x3c4bb2['offset']+_0x3c4bb2[_0x1bb5('0x21')];var _0x178ad6;if(_0x116eb2>=_0x4e0f77){_0x116eb2=_0x4e0f77;_0x178ad6=0xc8;}else{_0x178ad6=0xce;}_0x14420a[_0x1bb5('0x1c')](_0x178ad6);return _0x14420a[_0x1bb5('0x23')](_0x1bb5('0x24'),_0xbfbf70+'-'+_0x116eb2+'/'+_0x4e0f77)[_0x1bb5('0x1e')](_0x2e6042);}return null;};}function patchUpdates(_0x42c8b4){return function(_0x5d1f1a){try{jsonpatch['apply'](_0x5d1f1a,_0x42c8b4,!![]);}catch(_0x4544be){return BPromise[_0x1bb5('0x25')](_0x4544be);}return _0x5d1f1a[_0x1bb5('0x26')]();};}function saveUpdates(_0x3ca782,_0xd2e139){return function(_0x57294f){if(_0x57294f){return _0x57294f[_0x1bb5('0x27')](_0x3ca782)[_0x1bb5('0x28')](function(_0x5e11a7){return _0x5e11a7;});}return null;};}function removeEntity(_0x265d2b,_0x5e90ef){return function(_0x57abfb){if(_0x57abfb){return _0x57abfb[_0x1bb5('0x29')]()[_0x1bb5('0x28')](function(){var _0x2a179e=_0x57abfb[_0x1bb5('0x2a')]({'plain':!![]});var _0x224c87='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x224c87,'resourceId':_0x2a179e['id']}})['then'](function(){return _0x57abfb;});})[_0x1bb5('0x28')](function(){_0x265d2b[_0x1bb5('0x1c')](0xcc)[_0x1bb5('0x1d')]();});}};}function handleEntityNotFound(_0xdc7653,_0x5c6479){return function(_0x48d7ab){if(!_0x48d7ab){_0xdc7653[_0x1bb5('0x1b')](0x194);}return _0x48d7ab;};}function handleError(_0x25f8cb,_0x258305){_0x258305=_0x258305||0x1f4;return function(_0x119956){logger[_0x1bb5('0x2b')](_0x119956[_0x1bb5('0x2c')]);if(_0x119956[_0x1bb5('0x2d')]){delete _0x119956[_0x1bb5('0x2d')];}_0x25f8cb[_0x1bb5('0x1c')](_0x258305)[_0x1bb5('0x2e')](_0x119956);};}exports[_0x1bb5('0x2f')]=function(_0x122bf1,_0x37c6a3){var _0x5be849={},_0x206952={},_0x2b16f8={'count':0x0,'rows':[]};var _0x1b345e=_[_0x1bb5('0x30')](db[_0x1bb5('0x31')][_0x1bb5('0x32')],function(_0x355aa3){return{'name':_0x355aa3['fieldName'],'type':_0x355aa3[_0x1bb5('0x33')]['key']};});_0x206952[_0x1bb5('0x34')]=_['map'](_0x1b345e,_0x1bb5('0x2d'));_0x206952[_0x1bb5('0x35')]=_[_0x1bb5('0x36')](_0x122bf1[_0x1bb5('0x35')]);_0x206952['filters']=_[_0x1bb5('0x37')](_0x206952[_0x1bb5('0x34')],_0x206952[_0x1bb5('0x35')]);_0x5be849[_0x1bb5('0x38')]=_[_0x1bb5('0x37')](_0x206952['model'],qs[_0x1bb5('0x39')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x39')]));_0x5be849[_0x1bb5('0x38')]=_0x5be849[_0x1bb5('0x38')][_0x1bb5('0x3a')]?_0x5be849[_0x1bb5('0x38')]:_0x206952[_0x1bb5('0x34')];if(!_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x3b')](_0x1bb5('0x3c'))){_0x5be849['limit']=qs[_0x1bb5('0x21')](_0x122bf1['query'][_0x1bb5('0x21')]);_0x5be849[_0x1bb5('0x1f')]=qs[_0x1bb5('0x1f')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x1f')]);}_0x5be849[_0x1bb5('0x3d')]=qs[_0x1bb5('0x3e')](_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x3e')]);_0x5be849[_0x1bb5('0x3f')]=qs['filters'](_[_0x1bb5('0x40')](_0x122bf1[_0x1bb5('0x35')],_0x206952[_0x1bb5('0x41')]),_0x1b345e);if(_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x42')]){_0x5be849[_0x1bb5('0x3f')]=_[_0x1bb5('0x43')](_0x5be849[_0x1bb5('0x3f')],{'$or':_[_0x1bb5('0x30')](_0x1b345e,function(_0x8af2e0){if(_0x8af2e0[_0x1bb5('0x33')]!==_0x1bb5('0x44')){var _0x1e0024={};_0x1e0024[_0x8af2e0[_0x1bb5('0x2d')]]={'$like':'%'+_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x42')]+'%'};return _0x1e0024;}})});}_0x5be849=_[_0x1bb5('0x43')]({},_0x5be849,_0x122bf1[_0x1bb5('0x45')]);var _0x3918aa={'where':_0x5be849[_0x1bb5('0x3f')]};return db['AnalyticExtractedReport'][_0x1bb5('0x22')](_0x3918aa)[_0x1bb5('0x28')](function(_0x2f14e5){_0x2b16f8[_0x1bb5('0x22')]=_0x2f14e5;if(_0x122bf1[_0x1bb5('0x35')][_0x1bb5('0x46')]){_0x5be849[_0x1bb5('0x47')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x5be849);})[_0x1bb5('0x28')](function(_0x1df9d1){_0x2b16f8[_0x1bb5('0x48')]=_0x1df9d1;return _0x2b16f8;})[_0x1bb5('0x28')](respondWithFilteredResult(_0x37c6a3,_0x5be849))[_0x1bb5('0x49')](handleError(_0x37c6a3,null));};exports[_0x1bb5('0x4a')]=function(_0x2eff57,_0x66f710){var _0x2905d8={'raw':!![],'where':{'id':_0x2eff57[_0x1bb5('0x4b')]['id']}},_0x4d82eb={};_0x4d82eb[_0x1bb5('0x34')]=_[_0x1bb5('0x36')](db[_0x1bb5('0x31')][_0x1bb5('0x32')]);_0x4d82eb[_0x1bb5('0x35')]=_[_0x1bb5('0x36')](_0x2eff57['query']);_0x4d82eb[_0x1bb5('0x41')]=_['intersection'](_0x4d82eb[_0x1bb5('0x34')],_0x4d82eb['query']);_0x2905d8[_0x1bb5('0x38')]=_['intersection'](_0x4d82eb[_0x1bb5('0x34')],qs['fields'](_0x2eff57[_0x1bb5('0x35')][_0x1bb5('0x39')]));_0x2905d8[_0x1bb5('0x38')]=_0x2905d8[_0x1bb5('0x38')][_0x1bb5('0x3a')]?_0x2905d8[_0x1bb5('0x38')]:_0x4d82eb[_0x1bb5('0x34')];if(_0x2eff57[_0x1bb5('0x35')][_0x1bb5('0x46')]){_0x2905d8[_0x1bb5('0x47')]=[{'all':!![]}];}_0x2905d8=_['merge']({},_0x2905d8,_0x2eff57[_0x1bb5('0x45')]);return db[_0x1bb5('0x31')][_0x1bb5('0x4c')](_0x2905d8)[_0x1bb5('0x28')](handleEntityNotFound(_0x66f710,null))[_0x1bb5('0x28')](respondWithResult(_0x66f710,null))[_0x1bb5('0x49')](handleError(_0x66f710,null));};exports[_0x1bb5('0x4d')]=function(_0x3040b0,_0x84b50e){return db[_0x1bb5('0x31')]['create'](_0x3040b0[_0x1bb5('0x4e')],{})[_0x1bb5('0x28')](function(_0x2a39ab){var _0x138f06=_0x3040b0['user'][_0x1bb5('0x2a')]({'plain':!![]});if(!_0x138f06)throw new Error(_0x1bb5('0x4f'));if(_0x138f06[_0x1bb5('0x50')]===_0x1bb5('0x51')){var _0x20cdf6=_0x2a39ab[_0x1bb5('0x2a')]({'plain':!![]});var _0x234ab2=_0x1bb5('0x52');return db[_0x1bb5('0x53')][_0x1bb5('0x4c')]({'where':{'name':_0x234ab2,'userProfileId':_0x138f06[_0x1bb5('0x54')]},'raw':!![]})[_0x1bb5('0x28')](function(_0x2dc896){if(_0x2dc896&&_0x2dc896[_0x1bb5('0x55')]===0x0){return db[_0x1bb5('0x56')][_0x1bb5('0x4d')]({'name':_0x20cdf6['name'],'resourceId':_0x20cdf6['id'],'type':_0x2dc896['name'],'sectionId':_0x2dc896['id']},{})[_0x1bb5('0x28')](function(){return _0x2a39ab;});}else{return _0x2a39ab;}})[_0x1bb5('0x49')](function(_0x35bd16){logger[_0x1bb5('0x2b')](_0x1bb5('0x57'),_0x35bd16);throw _0x35bd16;});}return _0x2a39ab;})[_0x1bb5('0x28')](respondWithResult(_0x84b50e,0xc9))[_0x1bb5('0x49')](handleError(_0x84b50e,null));};exports[_0x1bb5('0x27')]=function(_0x165229,_0x9d6e1d){if(_0x165229[_0x1bb5('0x4e')]['id']){delete _0x165229['body']['id'];}return db[_0x1bb5('0x31')]['find']({'where':{'id':_0x165229[_0x1bb5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9d6e1d,null))[_0x1bb5('0x28')](saveUpdates(_0x165229[_0x1bb5('0x4e')],null))[_0x1bb5('0x28')](respondWithResult(_0x9d6e1d,null))[_0x1bb5('0x49')](handleError(_0x9d6e1d,null));};exports['destroy']=function(_0x3d02ac,_0x56fef5){return db[_0x1bb5('0x31')][_0x1bb5('0x4c')]({'where':{'id':_0x3d02ac[_0x1bb5('0x4b')]['id']}})[_0x1bb5('0x28')](handleEntityNotFound(_0x56fef5,null))[_0x1bb5('0x28')](removeEntity(_0x56fef5,null))[_0x1bb5('0x49')](handleError(_0x56fef5,null));};exports[_0x1bb5('0x58')]=function(_0x491d9b,_0x4b5d52,_0x4e4a2d){return db[_0x1bb5('0x31')][_0x1bb5('0x4c')]({'where':{'id':_0x491d9b[_0x1bb5('0x4b')]['id']},'attributes':[_0x1bb5('0x2d'),'basename',_0x1bb5('0x59'),_0x1bb5('0x5a')],'raw':!![]})[_0x1bb5('0x28')](handleEntityNotFound(_0x4b5d52,null))[_0x1bb5('0x28')](function(_0x26ba73){if(_0x26ba73){if(!fs[_0x1bb5('0x5b')](path[_0x1bb5('0x5c')](config[_0x1bb5('0x5d')],'server/files/reports',_0x26ba73[_0x1bb5('0x59')]))){throw new db['Sequelize'][(_0x1bb5('0x5e'))](_0x1bb5('0x5f'));}if(_0x491d9b['query'][_0x1bb5('0x60')]){return _0x4b5d52['sendStatus'](0xc8);}return _0x4b5d52[_0x1bb5('0x58')](path[_0x1bb5('0x5c')](config[_0x1bb5('0x5d')],_0x1bb5('0x61'),_0x26ba73[_0x1bb5('0x59')]),util[_0x1bb5('0x62')](_0x1bb5('0x63'),_0x26ba73[_0x1bb5('0x64')]||_0x26ba73[_0x1bb5('0x2d')],_0x26ba73[_0x1bb5('0x5a')][_0x1bb5('0x65')]()));}})['catch'](handleError(_0x4b5d52,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index b7ad941..408ae7c 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 _0x8a4a=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','request-promise','path'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x8a4a,0x14f));var _0xa8a4=function(_0x20118a,_0x3dbdf3){_0x20118a=_0x20118a-0x0;var _0x538b5f=_0x8a4a[_0x20118a];return _0x538b5f;};'use strict';var _=require('lodash');var util=require(_0xa8a4('0x0'));var logger=require(_0xa8a4('0x1'))(_0xa8a4('0x2'));var moment=require(_0xa8a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa8a4('0x4'));var fs=require('fs');var path=require(_0xa8a4('0x5'));var rimraf=require('rimraf');var config=require(_0xa8a4('0x6'));var attributes=require(_0xa8a4('0x7'));module[_0xa8a4('0x8')]=function(_0x116470,_0x22f208){return _0x116470[_0xa8a4('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xa8a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x213a=['exports','define','AnalyticExtractedReport','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2f7af4,_0x27308a){var _0x59b7eb=function(_0x543240){while(--_0x543240){_0x2f7af4['push'](_0x2f7af4['shift']());}};_0x59b7eb(++_0x27308a);}(_0x213a,0x107));var _0xa213=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x213a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xa213('0x0'));var logger=require(_0xa213('0x1'))(_0xa213('0x2'));var moment=require(_0xa213('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa213('0x4'));var rimraf=require(_0xa213('0x5'));var config=require(_0xa213('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xa213('0x7')]=function(_0x5025ed,_0x2ad619){return _0x5025ed[_0xa213('0x8')](_0xa213('0x9'),attributes,{'tableName':'analytics_extracted_reports','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 f3a827f..4baed53 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 _0x3b45=['client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3b45,0x68));var _0x53b4=function(_0x58604d,_0xf3c833){_0x58604d=_0x58604d-0x0;var _0x4c27a8=_0x3b45[_0x58604d];return _0x4c27a8;};'use strict';var _=require(_0x53b4('0x0'));var util=require(_0x53b4('0x1'));var moment=require(_0x53b4('0x2'));var BPromise=require(_0x53b4('0x3'));var rs=require(_0x53b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b4('0x5'))['db'];var utils=require(_0x53b4('0x6'));var logger=require(_0x53b4('0x7'))(_0x53b4('0x8'));var config=require(_0x53b4('0x9'));var jayson=require(_0x53b4('0xa'));var client=jayson[_0x53b4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6a7d,_0x4d5846,_0x1eca46){return new BPromise(function(_0x14c4d0,_0x127cbf){return client[_0x53b4('0xc')](_0x5e6a7d,_0x1eca46)['then'](function(_0x54b39d){logger[_0x53b4('0xd')](_0x53b4('0xe'),_0x4d5846,'request\x20sent');logger[_0x53b4('0xf')](_0x53b4('0x10'),_0x4d5846,_0x53b4('0x11'),JSON[_0x53b4('0x12')](_0x54b39d));if(_0x54b39d['error']){if(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x14')]===0x1f4){logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);return _0x127cbf(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);}logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x54b39d[_0x53b4('0x13')]['message']);return _0x14c4d0(_0x54b39d[_0x53b4('0x13')][_0x53b4('0x15')]);}else{logger['info'](_0x53b4('0xe'),_0x4d5846,_0x53b4('0x11'));_0x14c4d0(_0x54b39d[_0x53b4('0x16')][_0x53b4('0x15')]);}})['catch'](function(_0x91dfc2){logger[_0x53b4('0x13')](_0x53b4('0xe'),_0x4d5846,_0x91dfc2);_0x127cbf(_0x91dfc2);});});} \ No newline at end of file +var _0xaed4=['../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0xaed4,0xf4));var _0x4aed=function(_0x15e478,_0x1e5a1a){_0x15e478=_0x15e478-0x0;var _0x4158c4=_0xaed4[_0x15e478];return _0x4158c4;};'use strict';var _=require(_0x4aed('0x0'));var util=require('util');var moment=require(_0x4aed('0x1'));var BPromise=require(_0x4aed('0x2'));var rs=require(_0x4aed('0x3'));var fs=require('fs');var Redis=require(_0x4aed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4aed('0x5'));var logger=require(_0x4aed('0x6'))(_0x4aed('0x7'));var config=require(_0x4aed('0x8'));var jayson=require(_0x4aed('0x9'));var client=jayson['client'][_0x4aed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44dd26,_0x1a1edf,_0x404afa){return new BPromise(function(_0x176cd1,_0x5585e2){return client[_0x4aed('0xb')](_0x44dd26,_0x404afa)['then'](function(_0x41df96){logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x1a1edf,_0x4aed('0xe'));logger[_0x4aed('0xf')](_0x4aed('0x10'),_0x1a1edf,'request\x20sent',JSON['stringify'](_0x41df96));if(_0x41df96[_0x4aed('0x11')]){if(_0x41df96[_0x4aed('0x11')][_0x4aed('0x12')]===0x1f4){logger[_0x4aed('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a1edf,_0x41df96[_0x4aed('0x11')]['message']);return _0x5585e2(_0x41df96[_0x4aed('0x11')][_0x4aed('0x13')]);}logger[_0x4aed('0x11')](_0x4aed('0xd'),_0x1a1edf,_0x41df96[_0x4aed('0x11')]['message']);return _0x176cd1(_0x41df96[_0x4aed('0x11')][_0x4aed('0x13')]);}else{logger[_0x4aed('0xc')](_0x4aed('0xd'),_0x1a1edf,'request\x20sent');_0x176cd1(_0x41df96['result'][_0x4aed('0x13')]);}})[_0x4aed('0x14')](function(_0x208ba7){logger[_0x4aed('0x11')](_0x4aed('0xd'),_0x1a1edf,_0x208ba7);_0x5585e2(_0x208ba7);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index b70bfb7..10e4784 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 _0x1a60=['get','/:id/download','download','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','/:id','isAuthenticated','show'];(function(_0x225354,_0x5023a4){var _0x473b0e=function(_0x2adc2a){while(--_0x2adc2a){_0x225354['push'](_0x225354['shift']());}};_0x473b0e(++_0x5023a4);}(_0x1a60,0xa1));var _0x01a6=function(_0x3f3ac3,_0x150461){_0x3f3ac3=_0x3f3ac3-0x0;var _0x49fb00=_0x1a60[_0x3f3ac3];return _0x49fb00;};'use strict';var multer=require('multer');var util=require(_0x01a6('0x0'));var path=require(_0x01a6('0x1'));var timeout=require(_0x01a6('0x2'));var express=require('express');var router=express[_0x01a6('0x3')]();var fs_extra=require(_0x01a6('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x01a6('0x5'));var controller=require(_0x01a6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x01a6('0x7'),auth[_0x01a6('0x8')](),controller[_0x01a6('0x9')]);router[_0x01a6('0xa')](_0x01a6('0xb'),auth[_0x01a6('0x8')](),controller[_0x01a6('0xc')]);router[_0x01a6('0xd')]('/',auth[_0x01a6('0x8')](),controller[_0x01a6('0xe')]);router[_0x01a6('0xf')](_0x01a6('0x7'),auth['isAuthenticated'](),controller[_0x01a6('0x10')]);router[_0x01a6('0x11')]('/:id',auth[_0x01a6('0x8')](),controller['destroy']);module[_0x01a6('0x12')]=router; \ No newline at end of file +var _0x1400=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','download','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x3fd0b3,_0x5ae2ec){var _0x5d4b4a=function(_0x3fb189){while(--_0x3fb189){_0x3fd0b3['push'](_0x3fd0b3['shift']());}};_0x5d4b4a(++_0x5ae2ec);}(_0x1400,0xbd));var _0x0140=function(_0x4ec448,_0x2ef4c5){_0x4ec448=_0x4ec448-0x0;var _0x273ea9=_0x1400[_0x4ec448];return _0x273ea9;};'use strict';var multer=require(_0x0140('0x0'));var util=require(_0x0140('0x1'));var path=require(_0x0140('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0140('0x3'));var auth=require(_0x0140('0x4'));var interaction=require(_0x0140('0x5'));var config=require(_0x0140('0x6'));var controller=require(_0x0140('0x7'));router[_0x0140('0x8')]('/',auth[_0x0140('0x9')](),controller[_0x0140('0xa')]);router['get']('/:id',auth[_0x0140('0x9')](),controller['show']);router[_0x0140('0x8')]('/:id/download',auth[_0x0140('0x9')](),controller[_0x0140('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0140('0xc')]);router[_0x0140('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0140('0xe')]);router[_0x0140('0xf')](_0x0140('0x10'),auth[_0x0140('0x9')](),controller[_0x0140('0x11')]);module[_0x0140('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 5687e92..60c7776 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 _0xc880=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x316473,_0x35bdc2){var _0x29156e=function(_0x509017){while(--_0x509017){_0x316473['push'](_0x316473['shift']());}};_0x29156e(++_0x35bdc2);}(_0xc880,0x12e));var _0x0c88=function(_0x1bf043,_0x255f61){_0x1bf043=_0x1bf043-0x0;var _0x44181f=_0xc880[_0x1bf043];return _0x44181f;};'use strict';var Sequelize=require(_0x0c88('0x0'));module['exports']={'field':{'type':Sequelize[_0x0c88('0x1')]},'alias':{'type':Sequelize[_0x0c88('0x2')]},'function':{'type':Sequelize[_0x0c88('0x2')]},'format':{'type':Sequelize[_0x0c88('0x2')]},'groupBy':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0c88('0x2')]},'custom':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x480e=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x482115,_0x5550f5){var _0x40afb4=function(_0x44ce30){while(--_0x44ce30){_0x482115['push'](_0x482115['shift']());}};_0x40afb4(++_0x5550f5);}(_0x480e,0x192));var _0xe480=function(_0x5ece6f,_0x124b6e){_0x5ece6f=_0x5ece6f-0x0;var _0x4e41ee=_0x480e[_0x5ece6f];return _0x4e41ee;};'use strict';var Sequelize=require(_0xe480('0x0'));module[_0xe480('0x1')]={'field':{'type':Sequelize[_0xe480('0x2')]},'alias':{'type':Sequelize[_0xe480('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xe480('0x3')]},'groupBy':{'type':Sequelize[_0xe480('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xe480('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index ca92804..ab8cbfb 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 _0xf2ac=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring'];(function(_0x1cc808,_0xee2ba){var _0x5ddfc7=function(_0x104960){while(--_0x104960){_0x1cc808['push'](_0x1cc808['shift']());}};_0x5ddfc7(++_0xee2ba);}(_0xf2ac,0xe9));var _0xcf2a=function(_0x3a1955,_0x37a17e){_0x3a1955=_0x3a1955-0x0;var _0x483c1b=_0xf2ac[_0x3a1955];return _0x483c1b;};'use strict';var emlformat=require(_0xcf2a('0x0'));var rimraf=require(_0xcf2a('0x1'));var zipdir=require(_0xcf2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf2a('0x3'));var moment=require(_0xcf2a('0x4'));var BPromise=require(_0xcf2a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcf2a('0x6'));var sox=require(_0xcf2a('0x7'));var csv=require(_0xcf2a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf2a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf2a('0xa'));var deskjs=require(_0xcf2a('0xb'));var toCsv=require(_0xcf2a('0x8'));var querystring=require(_0xcf2a('0xc'));var Papa=require(_0xcf2a('0xd'));var Redis=require(_0xcf2a('0xe'));var authService=require(_0xcf2a('0xf'));var qs=require(_0xcf2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf2a('0x11'));var logger=require(_0xcf2a('0x12'))(_0xcf2a('0x13'));var utils=require(_0xcf2a('0x14'));var config=require(_0xcf2a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf2a('0x16'))['db'];function respondWithStatusCode(_0x572c85,_0x185702){_0x185702=_0x185702||0xcc;return function(_0x3a7882){if(_0x3a7882){return _0x572c85['sendStatus'](_0x185702);}return _0x572c85[_0xcf2a('0x17')](_0x185702)[_0xcf2a('0x18')]();};}function respondWithResult(_0x672dd6,_0xc19418){_0xc19418=_0xc19418||0xc8;return function(_0x35e08d){if(_0x35e08d){return _0x672dd6['status'](_0xc19418)[_0xcf2a('0x19')](_0x35e08d);}};}function respondWithFilteredResult(_0x3f1080,_0x3fce97){return function(_0xb0f79f){if(_0xb0f79f){var _0x3378af=typeof _0x3fce97[_0xcf2a('0x1a')]===_0xcf2a('0x1b')&&typeof _0x3fce97[_0xcf2a('0x1c')]===_0xcf2a('0x1b');var _0x22baa4=_0xb0f79f[_0xcf2a('0x1d')];var _0x3e2419=_0x3378af?0x0:_0x3fce97[_0xcf2a('0x1a')];var _0x543824=_0x3378af?_0xb0f79f['count']:_0x3fce97[_0xcf2a('0x1a')]+_0x3fce97[_0xcf2a('0x1c')];var _0x4d8378;if(_0x543824>=_0x22baa4){_0x543824=_0x22baa4;_0x4d8378=0xc8;}else{_0x4d8378=0xce;}_0x3f1080['status'](_0x4d8378);return _0x3f1080[_0xcf2a('0x1e')](_0xcf2a('0x1f'),_0x3e2419+'-'+_0x543824+'/'+_0x22baa4)[_0xcf2a('0x19')](_0xb0f79f);}return null;};}function patchUpdates(_0x2ee52b){return function(_0x4beb69){try{jsonpatch[_0xcf2a('0x20')](_0x4beb69,_0x2ee52b,!![]);}catch(_0x40cd9f){return BPromise[_0xcf2a('0x21')](_0x40cd9f);}return _0x4beb69[_0xcf2a('0x22')]();};}function saveUpdates(_0x1f11ad,_0x5b81f5){return function(_0x5c1520){if(_0x5c1520){return _0x5c1520[_0xcf2a('0x23')](_0x1f11ad)[_0xcf2a('0x24')](function(_0x5bf0c0){return _0x5bf0c0;});}return null;};}function removeEntity(_0x935d3c,_0x5269a5){return function(_0x1133b5){if(_0x1133b5){return _0x1133b5[_0xcf2a('0x25')]()['then'](function(){_0x935d3c['status'](0xcc)[_0xcf2a('0x18')]();});}};}function handleEntityNotFound(_0x1c43eb,_0x3c11c6){return function(_0x1f9212){if(!_0x1f9212){_0x1c43eb[_0xcf2a('0x26')](0x194);}return _0x1f9212;};}function handleError(_0x2ecd1f,_0x1cf5dc){_0x1cf5dc=_0x1cf5dc||0x1f4;return function(_0x2a48cb){logger[_0xcf2a('0x27')](_0x2a48cb[_0xcf2a('0x28')]);if(_0x2a48cb[_0xcf2a('0x29')]){delete _0x2a48cb[_0xcf2a('0x29')];}_0x2ecd1f[_0xcf2a('0x17')](_0x1cf5dc)[_0xcf2a('0x2a')](_0x2a48cb);};}exports[_0xcf2a('0x2b')]=function(_0x2965ae,_0x467660){var _0x4040f1={},_0x5291e5={},_0x5491d4={'count':0x0,'rows':[]};var _0x12d072=_[_0xcf2a('0x2c')](db[_0xcf2a('0x2d')][_0xcf2a('0x2e')],function(_0x229efa){return{'name':_0x229efa['fieldName'],'type':_0x229efa['type'][_0xcf2a('0x2f')]};});_0x5291e5[_0xcf2a('0x30')]=_[_0xcf2a('0x2c')](_0x12d072,_0xcf2a('0x29'));_0x5291e5[_0xcf2a('0x31')]=_[_0xcf2a('0x32')](_0x2965ae[_0xcf2a('0x31')]);_0x5291e5['filters']=_[_0xcf2a('0x33')](_0x5291e5[_0xcf2a('0x30')],_0x5291e5[_0xcf2a('0x31')]);_0x4040f1[_0xcf2a('0x34')]=_[_0xcf2a('0x33')](_0x5291e5[_0xcf2a('0x30')],qs['fields'](_0x2965ae[_0xcf2a('0x31')]['fields']));_0x4040f1[_0xcf2a('0x34')]=_0x4040f1[_0xcf2a('0x34')]['length']?_0x4040f1['attributes']:_0x5291e5[_0xcf2a('0x30')];if(!_0x2965ae['query'][_0xcf2a('0x35')](_0xcf2a('0x36'))){_0x4040f1[_0xcf2a('0x1c')]=qs[_0xcf2a('0x1c')](_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x1c')]);_0x4040f1[_0xcf2a('0x1a')]=qs[_0xcf2a('0x1a')](_0x2965ae['query'][_0xcf2a('0x1a')]);}_0x4040f1[_0xcf2a('0x37')]=qs['sort'](_0x2965ae[_0xcf2a('0x31')]['sort']);_0x4040f1['where']=qs[_0xcf2a('0x38')](_['pick'](_0x2965ae['query'],_0x5291e5[_0xcf2a('0x38')]),_0x12d072);if(_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x39')]){_0x4040f1[_0xcf2a('0x3a')]=_[_0xcf2a('0x3b')](_0x4040f1['where'],{'$or':_[_0xcf2a('0x2c')](_0x12d072,function(_0x151169){if(_0x151169['type']!==_0xcf2a('0x3c')){var _0x411234={};_0x411234[_0x151169[_0xcf2a('0x29')]]={'$like':'%'+_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x39')]+'%'};return _0x411234;}})});}_0x4040f1=_['merge']({},_0x4040f1,_0x2965ae[_0xcf2a('0x3d')]);var _0x214534={'where':_0x4040f1[_0xcf2a('0x3a')]};return db[_0xcf2a('0x2d')][_0xcf2a('0x1d')](_0x214534)[_0xcf2a('0x24')](function(_0x23daf1){_0x5491d4[_0xcf2a('0x1d')]=_0x23daf1;if(_0x2965ae[_0xcf2a('0x31')][_0xcf2a('0x3e')]){_0x4040f1[_0xcf2a('0x3f')]=[{'all':!![]}];}return db[_0xcf2a('0x2d')]['findAll'](_0x4040f1);})['then'](function(_0x5cdde8){_0x5491d4[_0xcf2a('0x40')]=_0x5cdde8;return _0x5491d4;})['then'](respondWithFilteredResult(_0x467660,_0x4040f1))[_0xcf2a('0x41')](handleError(_0x467660,null));};exports[_0xcf2a('0x42')]=function(_0x43bdb3,_0x353758){var _0x2aee20={'raw':![],'where':{'id':_0x43bdb3[_0xcf2a('0x43')]['id']}},_0x247783={};_0x247783[_0xcf2a('0x30')]=_[_0xcf2a('0x32')](db[_0xcf2a('0x2d')][_0xcf2a('0x2e')]);_0x247783[_0xcf2a('0x31')]=_['keys'](_0x43bdb3['query']);_0x247783['filters']=_[_0xcf2a('0x33')](_0x247783['model'],_0x247783['query']);_0x2aee20[_0xcf2a('0x34')]=_['intersection'](_0x247783[_0xcf2a('0x30')],qs['fields'](_0x43bdb3[_0xcf2a('0x31')][_0xcf2a('0x44')]));_0x2aee20[_0xcf2a('0x34')]=_0x2aee20[_0xcf2a('0x34')]['length']?_0x2aee20[_0xcf2a('0x34')]:_0x247783[_0xcf2a('0x30')];if(_0x43bdb3[_0xcf2a('0x31')][_0xcf2a('0x3e')]){_0x2aee20[_0xcf2a('0x3f')]=[{'all':!![]}];}_0x2aee20=_[_0xcf2a('0x3b')]({},_0x2aee20,_0x43bdb3['options']);return db['AnalyticFieldReport']['find'](_0x2aee20)['then'](handleEntityNotFound(_0x353758,null))['then'](respondWithResult(_0x353758,null))['catch'](handleError(_0x353758,null));};exports['create']=function(_0x3c9222,_0x3918b1){return db[_0xcf2a('0x2d')][_0xcf2a('0x45')](_0x3c9222[_0xcf2a('0x46')],{})[_0xcf2a('0x24')](respondWithResult(_0x3918b1,0xc9))['catch'](handleError(_0x3918b1,null));};exports[_0xcf2a('0x47')]=function(_0x24d9e5,_0x402a4a){return db['AnalyticFieldReport'][_0xcf2a('0x47')](_0x24d9e5['body'],{'raw':![],'individualHooks':!![]})[_0xcf2a('0x24')](respondWithResult(_0x402a4a,0xc9))['catch'](handleError(_0x402a4a,null));};exports[_0xcf2a('0x23')]=function(_0x1f5602,_0x547ab0){if(_0x1f5602[_0xcf2a('0x46')]['id']){delete _0x1f5602[_0xcf2a('0x46')]['id'];}return db[_0xcf2a('0x2d')]['find']({'where':{'id':_0x1f5602[_0xcf2a('0x43')]['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x547ab0,null))['then'](saveUpdates(_0x1f5602[_0xcf2a('0x46')],null))[_0xcf2a('0x24')](respondWithResult(_0x547ab0,null))[_0xcf2a('0x41')](handleError(_0x547ab0,null));};exports[_0xcf2a('0x25')]=function(_0x4e16f2,_0x3a398a){return db[_0xcf2a('0x2d')][_0xcf2a('0x48')]({'where':{'id':_0x4e16f2[_0xcf2a('0x43')]['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x3a398a,null))[_0xcf2a('0x24')](removeEntity(_0x3a398a,null))[_0xcf2a('0x41')](handleError(_0x3a398a,null));};exports[_0xcf2a('0x49')]=function(_0x3d4570,_0x6a6b5){return db['AnalyticFieldReport'][_0xcf2a('0x25')]({'where':{'id':_0x3d4570[_0xcf2a('0x31')][_0xcf2a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xcf2a('0x24')](respondWithResult(_0x6a6b5,0xcc))[_0xcf2a('0x41')](handleError(_0x6a6b5,null));};exports[_0xcf2a('0x4b')]=function(_0x178505,_0x2cfe17,_0x1b0055){return db[_0xcf2a('0x4c')][_0xcf2a('0x4d')]({'where':{'id':_0x178505['params']['id']}})[_0xcf2a('0x24')](handleEntityNotFound(_0x2cfe17,null))[_0xcf2a('0x24')](function(_0x13abfb){if(_0x13abfb){return db[_0xcf2a('0x4e')][_0xcf2a('0x4f')](function(_0x33a074){return db[_0xcf2a('0x2d')][_0xcf2a('0x25')]({'where':{'CustomReportId':_0x178505[_0xcf2a('0x43')]['id']},'transaction':_0x33a074})[_0xcf2a('0x24')](function(_0x35d602){var _0x2b2f01=_[_0xcf2a('0x2c')](_0x178505['body'],function(_0x298687){delete _0x298687['id'];_0x298687[_0xcf2a('0x50')]=_0x178505[_0xcf2a('0x43')]['id'];return _0x298687;});return db[_0xcf2a('0x2d')][_0xcf2a('0x47')](_0x2b2f01,{'transaction':_0x33a074});});})['then'](function(){return db[_0xcf2a('0x2d')][_0xcf2a('0x51')]({'where':{'CustomReportId':_0x178505['params']['id']}});});}})['then'](respondWithResult(_0x2cfe17,null))[_0xcf2a('0x41')](handleError(_0x2cfe17,null));}; \ No newline at end of file +var _0x5273=['map','AnalyticFieldReport','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x37f8aa,_0x5b66dc){var _0x289b3e=function(_0x2160df){while(--_0x2160df){_0x37f8aa['push'](_0x37f8aa['shift']());}};_0x289b3e(++_0x5b66dc);}(_0x5273,0x11c));var _0x3527=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5273[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3527('0x0'));var zipdir=require(_0x3527('0x1'));var jsonpatch=require(_0x3527('0x2'));var rp=require(_0x3527('0x3'));var moment=require('moment');var BPromise=require(_0x3527('0x4'));var Mustache=require(_0x3527('0x5'));var util=require(_0x3527('0x6'));var path=require(_0x3527('0x7'));var sox=require(_0x3527('0x8'));var csv=require(_0x3527('0x9'));var ejs=require(_0x3527('0xa'));var fs=require('fs');var fs_extra=require(_0x3527('0xb'));var _=require('lodash');var squel=require(_0x3527('0xc'));var crypto=require(_0x3527('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3527('0x9'));var querystring=require(_0x3527('0xe'));var Papa=require(_0x3527('0xf'));var Redis=require(_0x3527('0x10'));var authService=require(_0x3527('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3527('0x12'));var hardwareService=require(_0x3527('0x13'));var logger=require(_0x3527('0x14'))(_0x3527('0x15'));var utils=require('../../config/utils');var config=require(_0x3527('0x16'));var licenseUtil=require(_0x3527('0x17'));var db=require(_0x3527('0x18'))['db'];function respondWithStatusCode(_0x4ef4b1,_0x422acb){_0x422acb=_0x422acb||0xcc;return function(_0x6be3af){if(_0x6be3af){return _0x4ef4b1['sendStatus'](_0x422acb);}return _0x4ef4b1[_0x3527('0x19')](_0x422acb)[_0x3527('0x1a')]();};}function respondWithResult(_0x1b294d,_0x5b61ba){_0x5b61ba=_0x5b61ba||0xc8;return function(_0x4e155f){if(_0x4e155f){return _0x1b294d['status'](_0x5b61ba)[_0x3527('0x1b')](_0x4e155f);}};}function respondWithFilteredResult(_0x45f58a,_0xa51c76){return function(_0x33cb98){if(_0x33cb98){var _0x2d539c=typeof _0xa51c76[_0x3527('0x1c')]===_0x3527('0x1d')&&typeof _0xa51c76[_0x3527('0x1e')]===_0x3527('0x1d');var _0x371ebc=_0x33cb98['count'];var _0x4e68d4=_0x2d539c?0x0:_0xa51c76['offset'];var _0x2d7eae=_0x2d539c?_0x33cb98[_0x3527('0x1f')]:_0xa51c76['offset']+_0xa51c76[_0x3527('0x1e')];var _0x5dd2e5;if(_0x2d7eae>=_0x371ebc){_0x2d7eae=_0x371ebc;_0x5dd2e5=0xc8;}else{_0x5dd2e5=0xce;}_0x45f58a[_0x3527('0x19')](_0x5dd2e5);return _0x45f58a[_0x3527('0x20')](_0x3527('0x21'),_0x4e68d4+'-'+_0x2d7eae+'/'+_0x371ebc)[_0x3527('0x1b')](_0x33cb98);}return null;};}function patchUpdates(_0x3b9e25){return function(_0x4442b1){try{jsonpatch[_0x3527('0x22')](_0x4442b1,_0x3b9e25,!![]);}catch(_0x25b093){return BPromise[_0x3527('0x23')](_0x25b093);}return _0x4442b1['save']();};}function saveUpdates(_0x3f9f1d,_0xc8fb1e){return function(_0x61a5c4){if(_0x61a5c4){return _0x61a5c4[_0x3527('0x24')](_0x3f9f1d)[_0x3527('0x25')](function(_0x431547){return _0x431547;});}return null;};}function removeEntity(_0x4e5254,_0x5c3e97){return function(_0xff2463){if(_0xff2463){return _0xff2463[_0x3527('0x26')]()[_0x3527('0x25')](function(){_0x4e5254['status'](0xcc)[_0x3527('0x1a')]();});}};}function handleEntityNotFound(_0x301757,_0x567656){return function(_0x473fd2){if(!_0x473fd2){_0x301757['sendStatus'](0x194);}return _0x473fd2;};}function handleError(_0x28a32f,_0x3c3ec5){_0x3c3ec5=_0x3c3ec5||0x1f4;return function(_0x5ef188){logger[_0x3527('0x27')](_0x5ef188[_0x3527('0x28')]);if(_0x5ef188[_0x3527('0x29')]){delete _0x5ef188['name'];}_0x28a32f[_0x3527('0x19')](_0x3c3ec5)[_0x3527('0x2a')](_0x5ef188);};}exports[_0x3527('0x2b')]=function(_0x38e158,_0x5db42b){var _0x3f76ed={},_0x58d50d={},_0xfff4b8={'count':0x0,'rows':[]};var _0x335872=_[_0x3527('0x2c')](db[_0x3527('0x2d')]['rawAttributes'],function(_0x23ae11){return{'name':_0x23ae11['fieldName'],'type':_0x23ae11['type'][_0x3527('0x2e')]};});_0x58d50d['model']=_[_0x3527('0x2c')](_0x335872,_0x3527('0x29'));_0x58d50d['query']=_[_0x3527('0x2f')](_0x38e158[_0x3527('0x30')]);_0x58d50d[_0x3527('0x31')]=_[_0x3527('0x32')](_0x58d50d[_0x3527('0x33')],_0x58d50d[_0x3527('0x30')]);_0x3f76ed[_0x3527('0x34')]=_[_0x3527('0x32')](_0x58d50d[_0x3527('0x33')],qs['fields'](_0x38e158[_0x3527('0x30')][_0x3527('0x35')]));_0x3f76ed[_0x3527('0x34')]=_0x3f76ed[_0x3527('0x34')]['length']?_0x3f76ed[_0x3527('0x34')]:_0x58d50d[_0x3527('0x33')];if(!_0x38e158[_0x3527('0x30')][_0x3527('0x36')](_0x3527('0x37'))){_0x3f76ed['limit']=qs[_0x3527('0x1e')](_0x38e158[_0x3527('0x30')][_0x3527('0x1e')]);_0x3f76ed[_0x3527('0x1c')]=qs[_0x3527('0x1c')](_0x38e158[_0x3527('0x30')][_0x3527('0x1c')]);}_0x3f76ed[_0x3527('0x38')]=qs['sort'](_0x38e158['query'][_0x3527('0x39')]);_0x3f76ed[_0x3527('0x3a')]=qs[_0x3527('0x31')](_['pick'](_0x38e158[_0x3527('0x30')],_0x58d50d['filters']),_0x335872);if(_0x38e158[_0x3527('0x30')][_0x3527('0x3b')]){_0x3f76ed[_0x3527('0x3a')]=_[_0x3527('0x3c')](_0x3f76ed['where'],{'$or':_['map'](_0x335872,function(_0x56386a){if(_0x56386a[_0x3527('0x3d')]!==_0x3527('0x3e')){var _0x15ceca={};_0x15ceca[_0x56386a[_0x3527('0x29')]]={'$like':'%'+_0x38e158[_0x3527('0x30')][_0x3527('0x3b')]+'%'};return _0x15ceca;}})});}_0x3f76ed=_[_0x3527('0x3c')]({},_0x3f76ed,_0x38e158[_0x3527('0x3f')]);var _0x2c5c6b={'where':_0x3f76ed[_0x3527('0x3a')]};return db[_0x3527('0x2d')][_0x3527('0x1f')](_0x2c5c6b)[_0x3527('0x25')](function(_0x20ae1a){_0xfff4b8[_0x3527('0x1f')]=_0x20ae1a;if(_0x38e158['query'][_0x3527('0x40')]){_0x3f76ed[_0x3527('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3527('0x42')](_0x3f76ed);})[_0x3527('0x25')](function(_0x24b0bf){_0xfff4b8[_0x3527('0x43')]=_0x24b0bf;return _0xfff4b8;})['then'](respondWithFilteredResult(_0x5db42b,_0x3f76ed))[_0x3527('0x44')](handleError(_0x5db42b,null));};exports['show']=function(_0x9279f1,_0x556686){var _0x466d0f={'raw':![],'where':{'id':_0x9279f1[_0x3527('0x45')]['id']}},_0x125f29={};_0x125f29[_0x3527('0x33')]=_[_0x3527('0x2f')](db[_0x3527('0x2d')][_0x3527('0x46')]);_0x125f29['query']=_[_0x3527('0x2f')](_0x9279f1['query']);_0x125f29[_0x3527('0x31')]=_[_0x3527('0x32')](_0x125f29[_0x3527('0x33')],_0x125f29[_0x3527('0x30')]);_0x466d0f[_0x3527('0x34')]=_[_0x3527('0x32')](_0x125f29[_0x3527('0x33')],qs[_0x3527('0x35')](_0x9279f1[_0x3527('0x30')]['fields']));_0x466d0f[_0x3527('0x34')]=_0x466d0f[_0x3527('0x34')]['length']?_0x466d0f[_0x3527('0x34')]:_0x125f29[_0x3527('0x33')];if(_0x9279f1[_0x3527('0x30')][_0x3527('0x40')]){_0x466d0f[_0x3527('0x41')]=[{'all':!![]}];}_0x466d0f=_[_0x3527('0x3c')]({},_0x466d0f,_0x9279f1['options']);return db['AnalyticFieldReport'][_0x3527('0x47')](_0x466d0f)[_0x3527('0x25')](handleEntityNotFound(_0x556686,null))['then'](respondWithResult(_0x556686,null))['catch'](handleError(_0x556686,null));};exports['create']=function(_0x542dd6,_0x47a1ff){return db[_0x3527('0x2d')][_0x3527('0x48')](_0x542dd6[_0x3527('0x49')],{})[_0x3527('0x25')](respondWithResult(_0x47a1ff,0xc9))[_0x3527('0x44')](handleError(_0x47a1ff,null));};exports['bulkCreate']=function(_0x3c74c0,_0x3b30b4){return db[_0x3527('0x2d')][_0x3527('0x4a')](_0x3c74c0[_0x3527('0x49')],{'raw':![],'individualHooks':!![]})[_0x3527('0x25')](respondWithResult(_0x3b30b4,0xc9))[_0x3527('0x44')](handleError(_0x3b30b4,null));};exports[_0x3527('0x24')]=function(_0x30ca73,_0x3a9333){if(_0x30ca73[_0x3527('0x49')]['id']){delete _0x30ca73[_0x3527('0x49')]['id'];}return db[_0x3527('0x2d')]['find']({'where':{'id':_0x30ca73[_0x3527('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a9333,null))[_0x3527('0x25')](saveUpdates(_0x30ca73[_0x3527('0x49')],null))[_0x3527('0x25')](respondWithResult(_0x3a9333,null))[_0x3527('0x44')](handleError(_0x3a9333,null));};exports[_0x3527('0x26')]=function(_0x2e01b8,_0x21e8ab){return db[_0x3527('0x2d')]['find']({'where':{'id':_0x2e01b8['params']['id']}})[_0x3527('0x25')](handleEntityNotFound(_0x21e8ab,null))[_0x3527('0x25')](removeEntity(_0x21e8ab,null))[_0x3527('0x44')](handleError(_0x21e8ab,null));};exports['bulkDestroy']=function(_0x1e54d1,_0x134a8f){return db[_0x3527('0x2d')]['destroy']({'where':{'id':_0x1e54d1[_0x3527('0x30')][_0x3527('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3527('0x25')](respondWithResult(_0x134a8f,0xcc))[_0x3527('0x44')](handleError(_0x134a8f,null));};exports[_0x3527('0x4c')]=function(_0x35ba80,_0x999281,_0x5e3c15){return db[_0x3527('0x4d')][_0x3527('0x4e')]({'where':{'id':_0x35ba80['params']['id']}})[_0x3527('0x25')](handleEntityNotFound(_0x999281,null))[_0x3527('0x25')](function(_0x333483){if(_0x333483){return db[_0x3527('0x4f')][_0x3527('0x50')](function(_0x4f9d0c){return db[_0x3527('0x2d')][_0x3527('0x26')]({'where':{'CustomReportId':_0x35ba80[_0x3527('0x45')]['id']},'transaction':_0x4f9d0c})[_0x3527('0x25')](function(_0x141bad){var _0x19524c=_[_0x3527('0x2c')](_0x35ba80[_0x3527('0x49')],function(_0x1e44fb){delete _0x1e44fb['id'];_0x1e44fb[_0x3527('0x51')]=_0x35ba80[_0x3527('0x45')]['id'];return _0x1e44fb;});return db['AnalyticFieldReport'][_0x3527('0x4a')](_0x19524c,{'transaction':_0x4f9d0c});});})[_0x3527('0x25')](function(){return db[_0x3527('0x2d')][_0x3527('0x42')]({'where':{'CustomReportId':_0x35ba80[_0x3527('0x45')]['id']}});});}})[_0x3527('0x25')](respondWithResult(_0x999281,null))[_0x3527('0x44')](handleError(_0x999281,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 05dc7f6..e1a6190 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 _0x713a=['./analyticFieldReport.attributes','exports','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x77b5b6,_0x4e2d14){var _0x5b0639=function(_0x511228){while(--_0x511228){_0x77b5b6['push'](_0x77b5b6['shift']());}};_0x5b0639(++_0x4e2d14);}(_0x713a,0x16a));var _0xa713=function(_0x292e5e,_0x3cdb3f){_0x292e5e=_0x292e5e-0x0;var _0x41789d=_0x713a[_0x292e5e];return _0x41789d;};'use strict';var _=require(_0xa713('0x0'));var util=require(_0xa713('0x1'));var logger=require(_0xa713('0x2'))('api');var moment=require(_0xa713('0x3'));var BPromise=require('bluebird');var rp=require(_0xa713('0x4'));var fs=require('fs');var path=require(_0xa713('0x5'));var rimraf=require('rimraf');var config=require(_0xa713('0x6'));var attributes=require(_0xa713('0x7'));module[_0xa713('0x8')]=function(_0x50388d,_0x1d2dc1){return _0x50388d['define']('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10d6=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x10d6,0x169));var _0x610d=function(_0x11044b,_0x163ae9){_0x11044b=_0x11044b-0x0;var _0x5ee5b9=_0x10d6[_0x11044b];return _0x5ee5b9;};'use strict';var _=require(_0x610d('0x0'));var util=require(_0x610d('0x1'));var logger=require(_0x610d('0x2'))(_0x610d('0x3'));var moment=require(_0x610d('0x4'));var BPromise=require('bluebird');var rp=require(_0x610d('0x5'));var fs=require('fs');var path=require(_0x610d('0x6'));var rimraf=require(_0x610d('0x7'));var config=require(_0x610d('0x8'));var attributes=require(_0x610d('0x9'));module[_0x610d('0xa')]=function(_0x1946d2,_0x3cae49){return _0x1946d2[_0x610d('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x610d('0xc'),'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 fe87228..5522b1b 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 _0x3a38=['client','then','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3813c7,_0xfe27fc){var _0x2f2e9b=function(_0x1cd726){while(--_0x1cd726){_0x3813c7['push'](_0x3813c7['shift']());}};_0x2f2e9b(++_0xfe27fc);}(_0x3a38,0x70));var _0x83a3=function(_0x2938e1,_0xe8ecce){_0x2938e1=_0x2938e1-0x0;var _0x43f689=_0x3a38[_0x2938e1];return _0x43f689;};'use strict';var _=require(_0x83a3('0x0'));var util=require(_0x83a3('0x1'));var moment=require(_0x83a3('0x2'));var BPromise=require('bluebird');var rs=require(_0x83a3('0x3'));var fs=require('fs');var Redis=require(_0x83a3('0x4'));var db=require(_0x83a3('0x5'))['db'];var utils=require(_0x83a3('0x6'));var logger=require('../../config/logger')(_0x83a3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x83a3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20228d,_0x3f38eb,_0x1da84a){return new BPromise(function(_0x48c51d,_0x38ede9){return client['request'](_0x20228d,_0x1da84a)[_0x83a3('0x9')](function(_0x480fcb){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x83a3('0xa'));logger['debug'](_0x83a3('0xb'),_0x3f38eb,_0x83a3('0xa'),JSON[_0x83a3('0xc')](_0x480fcb));if(_0x480fcb[_0x83a3('0xd')]){if(_0x480fcb[_0x83a3('0xd')][_0x83a3('0xe')]===0x1f4){logger[_0x83a3('0xd')](_0x83a3('0xf'),_0x3f38eb,_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);return _0x38ede9(_0x480fcb[_0x83a3('0xd')]['message']);}logger[_0x83a3('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);return _0x48c51d(_0x480fcb[_0x83a3('0xd')][_0x83a3('0x10')]);}else{logger[_0x83a3('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x83a3('0xa'));_0x48c51d(_0x480fcb[_0x83a3('0x12')][_0x83a3('0x10')]);}})[_0x83a3('0x13')](function(_0x105c61){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x3f38eb,_0x105c61);_0x38ede9(_0x105c61);});});} \ No newline at end of file +var _0x77e0=['request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x522d87,_0x2fc2d8){var _0x562d3e=function(_0xc0d4b9){while(--_0xc0d4b9){_0x522d87['push'](_0x522d87['shift']());}};_0x562d3e(++_0x2fc2d8);}(_0x77e0,0x90));var _0x077e=function(_0x31165e,_0x1cdcc7){_0x31165e=_0x31165e-0x0;var _0x94538f=_0x77e0[_0x31165e];return _0x94538f;};'use strict';var _=require(_0x077e('0x0'));var util=require('util');var moment=require(_0x077e('0x1'));var BPromise=require(_0x077e('0x2'));var rs=require(_0x077e('0x3'));var fs=require('fs');var Redis=require(_0x077e('0x4'));var db=require(_0x077e('0x5'))['db'];var utils=require(_0x077e('0x6'));var logger=require('../../config/logger')(_0x077e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x077e('0x8')][_0x077e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e156e,_0x3cc5a3,_0x4087a7){return new BPromise(function(_0x5e6937,_0x2798a8){return client[_0x077e('0xa')](_0x3e156e,_0x4087a7)[_0x077e('0xb')](function(_0x464129){logger[_0x077e('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3cc5a3,_0x077e('0xd'));logger[_0x077e('0xe')](_0x077e('0xf'),_0x3cc5a3,_0x077e('0xd'),JSON[_0x077e('0x10')](_0x464129));if(_0x464129[_0x077e('0x11')]){if(_0x464129[_0x077e('0x11')][_0x077e('0x12')]===0x1f4){logger[_0x077e('0x11')](_0x077e('0x13'),_0x3cc5a3,_0x464129['error']['message']);return _0x2798a8(_0x464129[_0x077e('0x11')][_0x077e('0x14')]);}logger['error'](_0x077e('0x13'),_0x3cc5a3,_0x464129[_0x077e('0x11')][_0x077e('0x14')]);return _0x5e6937(_0x464129[_0x077e('0x11')]['message']);}else{logger[_0x077e('0xc')](_0x077e('0x13'),_0x3cc5a3,_0x077e('0xd'));_0x5e6937(_0x464129[_0x077e('0x15')][_0x077e('0x14')]);}})['catch'](function(_0x13b6a5){logger[_0x077e('0x11')](_0x077e('0x13'),_0x3cc5a3,_0x13b6a5);_0x2798a8(_0x13b6a5);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 22749c4..0ef1564 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(_0x21d9e4,_0x469a1a){var _0x4e2e02=function(_0x3a5404){while(--_0x3a5404){_0x21d9e4['push'](_0x21d9e4['shift']());}};_0x4e2e02(++_0x469a1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x3834c3,_0x36d467){var _0x2601fc=function(_0x232026){while(--_0x232026){_0x3834c3['push'](_0x3834c3['shift']());}};_0x2601fc(++_0x36d467);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 dd7d99f..fe36b04 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 _0xddb8=['STRING','name','TEXT','exports'];(function(_0x705343,_0x31631d){var _0x7296f0=function(_0x546dec){while(--_0x546dec){_0x705343['push'](_0x705343['shift']());}};_0x7296f0(++_0x31631d);}(_0xddb8,0xd7));var _0x8ddb=function(_0x3bbb0a,_0x30e275){_0x3bbb0a=_0x3bbb0a-0x0;var _0x17811e=_0xddb8[_0x3bbb0a];return _0x17811e;};'use strict';var Sequelize=require('sequelize');module[_0x8ddb('0x0')]={'name':{'type':Sequelize[_0x8ddb('0x1')],'allowNull':![],'unique':_0x8ddb('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x8ddb('0x3')]},'description':{'type':Sequelize[_0x8ddb('0x1')]}}; \ No newline at end of file +var _0x0caf=['name','STRING','TEXT'];(function(_0x16fa96,_0x191e9f){var _0x4e52d3=function(_0x4200a8){while(--_0x4200a8){_0x16fa96['push'](_0x16fa96['shift']());}};_0x4e52d3(++_0x191e9f);}(_0x0caf,0x9f));var _0xf0ca=function(_0x5dd622,_0x125c1a){_0x5dd622=_0x5dd622-0x0;var _0x4f78b0=_0x0caf[_0x5dd622];return _0x4f78b0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf0ca('0x0')},'table':{'type':Sequelize[_0xf0ca('0x1')]},'metric':{'type':Sequelize[_0xf0ca('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b0be429..715bac6 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7da7,0x10d));var _0x77da=function(_0x58ae8a,_0x3c619e){_0x58ae8a=_0x58ae8a-0x0;var _0x2f0b6b=_0x7da7[_0x58ae8a];return _0x2f0b6b;};'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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x25dc73,_0x18185f){var _0x46145c=function(_0x47722d){while(--_0x47722d){_0x25dc73['push'](_0x25dc73['shift']());}};_0x46145c(++_0x18185f);}(_0xa41a,0x6b));var _0xaa41=function(_0x1b414e,_0x251964){_0x1b414e=_0x1b414e-0x0;var _0x362973=_0xa41a[_0x1b414e];return _0x362973;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 12bb246..22dcb22 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 _0x13f5=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0x13f5,0xc3));var _0x513f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x13f5[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var logger=require(_0x513f('0x2'))(_0x513f('0x3'));var moment=require('moment');var BPromise=require(_0x513f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x513f('0x5'));var config=require(_0x513f('0x6'));var attributes=require(_0x513f('0x7'));module[_0x513f('0x8')]=function(_0x8d019b,_0x579681){return _0x8d019b[_0x513f('0x9')](_0x513f('0xa'),attributes,{'tableName':_0x513f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4453=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x24210f,_0x3510de){var _0x37b6db=function(_0x53a3ba){while(--_0x53a3ba){_0x24210f['push'](_0x24210f['shift']());}};_0x37b6db(++_0x3510de);}(_0x4453,0x9c));var _0x3445=function(_0x39e376,_0x433bb4){_0x39e376=_0x39e376-0x0;var _0x580e9f=_0x4453[_0x39e376];return _0x580e9f;};'use strict';var _=require(_0x3445('0x0'));var util=require(_0x3445('0x1'));var logger=require('../../config/logger')(_0x3445('0x2'));var moment=require(_0x3445('0x3'));var BPromise=require('bluebird');var rp=require(_0x3445('0x4'));var fs=require('fs');var path=require(_0x3445('0x5'));var rimraf=require(_0x3445('0x6'));var config=require(_0x3445('0x7'));var attributes=require(_0x3445('0x8'));module[_0x3445('0x9')]=function(_0x43214d,_0x1bd1dc){return _0x43214d[_0x3445('0xa')](_0x3445('0xb'),attributes,{'tableName':'analytics_metrics','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 49ef3aa..f23b65f 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 _0x0d72=['then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5be7b4,_0x8a0eb4){var _0x2e9c49=function(_0x615552){while(--_0x615552){_0x5be7b4['push'](_0x5be7b4['shift']());}};_0x2e9c49(++_0x8a0eb4);}(_0x0d72,0xc3));var _0x20d7=function(_0x41d5b4,_0x449f98){_0x41d5b4=_0x41d5b4-0x0;var _0x56a933=_0x0d72[_0x41d5b4];return _0x56a933;};'use strict';var _=require(_0x20d7('0x0'));var util=require(_0x20d7('0x1'));var moment=require(_0x20d7('0x2'));var BPromise=require(_0x20d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20d7('0x4'));var db=require(_0x20d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20d7('0x6'))(_0x20d7('0x7'));var config=require(_0x20d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x20d7('0x9')][_0x20d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x436807,_0x3e71a7,_0x20034d){return new BPromise(function(_0x43b36a,_0x2f571c){return client[_0x20d7('0xb')](_0x436807,_0x20034d)[_0x20d7('0xc')](function(_0x241b64){logger[_0x20d7('0xd')](_0x20d7('0xe'),_0x3e71a7,'request\x20sent');logger[_0x20d7('0xf')](_0x20d7('0x10'),_0x3e71a7,_0x20d7('0x11'),JSON[_0x20d7('0x12')](_0x241b64));if(_0x241b64['error']){if(_0x241b64[_0x20d7('0x13')][_0x20d7('0x14')]===0x1f4){logger[_0x20d7('0x13')](_0x20d7('0xe'),_0x3e71a7,_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);return _0x2f571c(_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);}logger[_0x20d7('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x3e71a7,_0x241b64[_0x20d7('0x13')][_0x20d7('0x15')]);return _0x43b36a(_0x241b64['error'][_0x20d7('0x15')]);}else{logger[_0x20d7('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3e71a7,_0x20d7('0x11'));_0x43b36a(_0x241b64[_0x20d7('0x16')][_0x20d7('0x15')]);}})['catch'](function(_0x4ff67c){logger[_0x20d7('0x13')](_0x20d7('0xe'),_0x3e71a7,_0x4ff67c);_0x2f571c(_0x4ff67c);});});} \ No newline at end of file +var _0xb579=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f5888,_0x4a602b){var _0x5c908e=function(_0x2c5e8b){while(--_0x2c5e8b){_0x1f5888['push'](_0x1f5888['shift']());}};_0x5c908e(++_0x4a602b);}(_0xb579,0xd7));var _0x9b57=function(_0x566ff4,_0x35b691){_0x566ff4=_0x566ff4-0x0;var _0x124c1c=_0xb579[_0x566ff4];return _0x124c1c;};'use strict';var _=require(_0x9b57('0x0'));var util=require(_0x9b57('0x1'));var moment=require(_0x9b57('0x2'));var BPromise=require(_0x9b57('0x3'));var rs=require(_0x9b57('0x4'));var fs=require('fs');var Redis=require(_0x9b57('0x5'));var db=require(_0x9b57('0x6'))['db'];var utils=require(_0x9b57('0x7'));var logger=require(_0x9b57('0x8'))(_0x9b57('0x9'));var config=require(_0x9b57('0xa'));var jayson=require(_0x9b57('0xb'));var client=jayson[_0x9b57('0xc')][_0x9b57('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x58ecee,_0x5758ca,_0x1f4ca7){return new BPromise(function(_0x3be94c,_0x4f6c06){return client[_0x9b57('0xe')](_0x58ecee,_0x1f4ca7)[_0x9b57('0xf')](function(_0x13312a){logger[_0x9b57('0x10')](_0x9b57('0x11'),_0x5758ca,'request\x20sent');logger['debug'](_0x9b57('0x12'),_0x5758ca,'request\x20sent',JSON[_0x9b57('0x13')](_0x13312a));if(_0x13312a['error']){if(_0x13312a[_0x9b57('0x14')]['code']===0x1f4){logger['error'](_0x9b57('0x11'),_0x5758ca,_0x13312a[_0x9b57('0x14')]['message']);return _0x4f6c06(_0x13312a[_0x9b57('0x14')][_0x9b57('0x15')]);}logger['error'](_0x9b57('0x11'),_0x5758ca,_0x13312a[_0x9b57('0x14')][_0x9b57('0x15')]);return _0x3be94c(_0x13312a['error'][_0x9b57('0x15')]);}else{logger[_0x9b57('0x10')](_0x9b57('0x11'),_0x5758ca,_0x9b57('0x16'));_0x3be94c(_0x13312a[_0x9b57('0x17')][_0x9b57('0x15')]);}})[_0x9b57('0x18')](function(_0x364d37){logger[_0x9b57('0x14')](_0x9b57('0x11'),_0x5758ca,_0x364d37);_0x4f6c06(_0x364d37);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d874389..191e488 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 _0x8781=['fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3ddbc4,_0xe5be24){var _0x4f51ff=function(_0xc9119b){while(--_0xc9119b){_0x3ddbc4['push'](_0x3ddbc4['shift']());}};_0x4f51ff(++_0xe5be24);}(_0x8781,0x1c8));var _0x1878=function(_0x473d89,_0x3ca583){_0x473d89=_0x473d89-0x0;var _0x580097=_0x8781[_0x473d89];return _0x580097;};'use strict';var multer=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var path=require(_0x1878('0x2'));var timeout=require(_0x1878('0x3'));var express=require(_0x1878('0x4'));var router=express[_0x1878('0x5')]();var fs_extra=require(_0x1878('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var controller=require(_0x1878('0x9'));router[_0x1878('0xa')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0xc')]);router['get'](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0xe')]);router[_0x1878('0xf')]('/',auth[_0x1878('0xb')](),controller[_0x1878('0x10')]);router[_0x1878('0x11')](_0x1878('0xd'),auth[_0x1878('0xb')](),controller[_0x1878('0x12')]);router[_0x1878('0x13')]('/:id',auth[_0x1878('0xb')](),controller[_0x1878('0x14')]);module[_0x1878('0x15')]=router; \ No newline at end of file +var _0x8ce1=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eb93b,_0x37a094){var _0x5ebda2=function(_0x1a1f74){while(--_0x1a1f74){_0x2eb93b['push'](_0x2eb93b['shift']());}};_0x5ebda2(++_0x37a094);}(_0x8ce1,0x183));var _0x18ce=function(_0x4df2a0,_0x3c3945){_0x4df2a0=_0x4df2a0-0x0;var _0xaadb19=_0x8ce1[_0x4df2a0];return _0xaadb19;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0x10')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x11')]);router['put'](_0x18ce('0xe'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);module[_0x18ce('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 4f07add..0269485 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 _0x3a71=['sequelize','TEXT'];(function(_0x2bbe6a,_0x9120f){var _0x49021d=function(_0x170514){while(--_0x170514){_0x2bbe6a['push'](_0x2bbe6a['shift']());}};_0x49021d(++_0x9120f);}(_0x3a71,0xea));var _0x13a7=function(_0x46ba1c,_0x53697a){_0x46ba1c=_0x46ba1c-0x0;var _0x5c1b25=_0x3a71[_0x46ba1c];return _0x5c1b25;};'use strict';var Sequelize=require(_0x13a7('0x0'));module['exports']={'tree':{'type':Sequelize[_0x13a7('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xa5ff=['TEXT'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa5ff,0x1b6));var _0xfa5f=function(_0x2f6779,_0x1456ea){_0x2f6779=_0x2f6779-0x0;var _0x21200c=_0xa5ff[_0x2f6779];return _0x21200c;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xfa5f('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 56b38bd..a429f47 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 _0x70b9=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','sendStatus','stack','name','index','map','AnalyticTreeReport','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service'];(function(_0x43cdc3,_0x9ccb13){var _0x2936bd=function(_0x3a6b1b){while(--_0x3a6b1b){_0x43cdc3['push'](_0x43cdc3['shift']());}};_0x2936bd(++_0x9ccb13);}(_0x70b9,0x188));var _0x970b=function(_0x325bb8,_0xd2eb2c){_0x325bb8=_0x325bb8-0x0;var _0x4cf52f=_0x70b9[_0x325bb8];return _0x4cf52f;};'use strict';var emlformat=require(_0x970b('0x0'));var rimraf=require(_0x970b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x970b('0x2'));var rp=require(_0x970b('0x3'));var moment=require('moment');var BPromise=require(_0x970b('0x4'));var Mustache=require(_0x970b('0x5'));var util=require('util');var path=require(_0x970b('0x6'));var sox=require(_0x970b('0x7'));var csv=require(_0x970b('0x8'));var ejs=require(_0x970b('0x9'));var fs=require('fs');var fs_extra=require(_0x970b('0xa'));var _=require('lodash');var squel=require(_0x970b('0xb'));var crypto=require(_0x970b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x970b('0xd'));var toCsv=require(_0x970b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x970b('0xe'));var authService=require(_0x970b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x970b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x970b('0x11'))('api');var utils=require(_0x970b('0x12'));var config=require(_0x970b('0x13'));var licenseUtil=require(_0x970b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45a8a8,_0xa4a5b9){_0xa4a5b9=_0xa4a5b9||0xcc;return function(_0x21d96d){if(_0x21d96d){return _0x45a8a8['sendStatus'](_0xa4a5b9);}return _0x45a8a8[_0x970b('0x15')](_0xa4a5b9)[_0x970b('0x16')]();};}function respondWithResult(_0x2ba66a,_0x184ce4){_0x184ce4=_0x184ce4||0xc8;return function(_0x52a26b){if(_0x52a26b){return _0x2ba66a[_0x970b('0x15')](_0x184ce4)[_0x970b('0x17')](_0x52a26b);}};}function respondWithFilteredResult(_0x2dd1b5,_0xad5954){return function(_0x31dc69){if(_0x31dc69){var _0x3eee8e=typeof _0xad5954[_0x970b('0x18')]===_0x970b('0x19')&&typeof _0xad5954[_0x970b('0x1a')]===_0x970b('0x19');var _0x1b5592=_0x31dc69[_0x970b('0x1b')];var _0x377f28=_0x3eee8e?0x0:_0xad5954['offset'];var _0x3dcf99=_0x3eee8e?_0x31dc69['count']:_0xad5954[_0x970b('0x18')]+_0xad5954['limit'];var _0x9b550;if(_0x3dcf99>=_0x1b5592){_0x3dcf99=_0x1b5592;_0x9b550=0xc8;}else{_0x9b550=0xce;}_0x2dd1b5[_0x970b('0x15')](_0x9b550);return _0x2dd1b5['set'](_0x970b('0x1c'),_0x377f28+'-'+_0x3dcf99+'/'+_0x1b5592)[_0x970b('0x17')](_0x31dc69);}return null;};}function patchUpdates(_0x35cc68){return function(_0x1aa220){try{jsonpatch['apply'](_0x1aa220,_0x35cc68,!![]);}catch(_0x454f98){return BPromise[_0x970b('0x1d')](_0x454f98);}return _0x1aa220['save']();};}function saveUpdates(_0x4fbfb1,_0x36f536){return function(_0x418b2b){if(_0x418b2b){return _0x418b2b[_0x970b('0x1e')](_0x4fbfb1)[_0x970b('0x1f')](function(_0x658dd0){return _0x658dd0;});}return null;};}function removeEntity(_0x1e52af,_0x1fde4c){return function(_0x3dd664){if(_0x3dd664){return _0x3dd664['destroy']()[_0x970b('0x1f')](function(){_0x1e52af[_0x970b('0x15')](0xcc)[_0x970b('0x16')]();});}};}function handleEntityNotFound(_0x4bbf94,_0xcd8757){return function(_0xb136b5){if(!_0xb136b5){_0x4bbf94[_0x970b('0x20')](0x194);}return _0xb136b5;};}function handleError(_0x288643,_0x407e9a){_0x407e9a=_0x407e9a||0x1f4;return function(_0x1f0144){logger['error'](_0x1f0144[_0x970b('0x21')]);if(_0x1f0144[_0x970b('0x22')]){delete _0x1f0144['name'];}_0x288643[_0x970b('0x15')](_0x407e9a)['send'](_0x1f0144);};}exports[_0x970b('0x23')]=function(_0x379cf3,_0x1500dd){var _0xf50bf2={},_0x3a608f={},_0x25c4f8={'count':0x0,'rows':[]};var _0x1c6668=_[_0x970b('0x24')](db[_0x970b('0x25')]['rawAttributes'],function(_0x28a4c8){return{'name':_0x28a4c8['fieldName'],'type':_0x28a4c8['type'][_0x970b('0x26')]};});_0x3a608f[_0x970b('0x27')]=_['map'](_0x1c6668,_0x970b('0x22'));_0x3a608f['query']=_['keys'](_0x379cf3[_0x970b('0x28')]);_0x3a608f[_0x970b('0x29')]=_[_0x970b('0x2a')](_0x3a608f[_0x970b('0x27')],_0x3a608f['query']);_0xf50bf2[_0x970b('0x2b')]=_[_0x970b('0x2a')](_0x3a608f['model'],qs[_0x970b('0x2c')](_0x379cf3[_0x970b('0x28')]['fields']));_0xf50bf2[_0x970b('0x2b')]=_0xf50bf2[_0x970b('0x2b')]['length']?_0xf50bf2[_0x970b('0x2b')]:_0x3a608f['model'];if(!_0x379cf3[_0x970b('0x28')][_0x970b('0x2d')](_0x970b('0x2e'))){_0xf50bf2[_0x970b('0x1a')]=qs[_0x970b('0x1a')](_0x379cf3['query'][_0x970b('0x1a')]);_0xf50bf2[_0x970b('0x18')]=qs[_0x970b('0x18')](_0x379cf3[_0x970b('0x28')][_0x970b('0x18')]);}_0xf50bf2[_0x970b('0x2f')]=qs[_0x970b('0x30')](_0x379cf3[_0x970b('0x28')]['sort']);_0xf50bf2[_0x970b('0x31')]=qs[_0x970b('0x29')](_['pick'](_0x379cf3[_0x970b('0x28')],_0x3a608f[_0x970b('0x29')]),_0x1c6668);if(_0x379cf3[_0x970b('0x28')][_0x970b('0x32')]){_0xf50bf2[_0x970b('0x31')]=_[_0x970b('0x33')](_0xf50bf2[_0x970b('0x31')],{'$or':_[_0x970b('0x24')](_0x1c6668,function(_0x20ffd2){if(_0x20ffd2[_0x970b('0x34')]!==_0x970b('0x35')){var _0x3d3bcd={};_0x3d3bcd[_0x20ffd2[_0x970b('0x22')]]={'$like':'%'+_0x379cf3['query'][_0x970b('0x32')]+'%'};return _0x3d3bcd;}})});}_0xf50bf2=_['merge']({},_0xf50bf2,_0x379cf3[_0x970b('0x36')]);var _0x246480={'where':_0xf50bf2[_0x970b('0x31')]};return db['AnalyticTreeReport'][_0x970b('0x1b')](_0x246480)[_0x970b('0x1f')](function(_0x2e04ac){_0x25c4f8['count']=_0x2e04ac;if(_0x379cf3[_0x970b('0x28')]['includeAll']){_0xf50bf2[_0x970b('0x37')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x970b('0x38')](_0xf50bf2);})[_0x970b('0x1f')](function(_0x1e89ab){_0x25c4f8[_0x970b('0x39')]=_0x1e89ab;return _0x25c4f8;})[_0x970b('0x1f')](respondWithFilteredResult(_0x1500dd,_0xf50bf2))['catch'](handleError(_0x1500dd,null));};exports[_0x970b('0x3a')]=function(_0x1afffb,_0x219e6c){var _0x8e631b={'raw':!![],'where':{'id':_0x1afffb['params']['id']}},_0x17ebc9={};_0x17ebc9['model']=_[_0x970b('0x3b')](db[_0x970b('0x25')][_0x970b('0x3c')]);_0x17ebc9[_0x970b('0x28')]=_[_0x970b('0x3b')](_0x1afffb[_0x970b('0x28')]);_0x17ebc9['filters']=_[_0x970b('0x2a')](_0x17ebc9['model'],_0x17ebc9['query']);_0x8e631b['attributes']=_[_0x970b('0x2a')](_0x17ebc9['model'],qs[_0x970b('0x2c')](_0x1afffb[_0x970b('0x28')][_0x970b('0x2c')]));_0x8e631b[_0x970b('0x2b')]=_0x8e631b['attributes']['length']?_0x8e631b[_0x970b('0x2b')]:_0x17ebc9[_0x970b('0x27')];if(_0x1afffb[_0x970b('0x28')][_0x970b('0x3d')]){_0x8e631b[_0x970b('0x37')]=[{'all':!![]}];}_0x8e631b=_[_0x970b('0x33')]({},_0x8e631b,_0x1afffb[_0x970b('0x36')]);return db['AnalyticTreeReport'][_0x970b('0x3e')](_0x8e631b)[_0x970b('0x1f')](handleEntityNotFound(_0x219e6c,null))[_0x970b('0x1f')](respondWithResult(_0x219e6c,null))[_0x970b('0x3f')](handleError(_0x219e6c,null));};exports[_0x970b('0x40')]=function(_0x4fd25b,_0x4a2600){return db[_0x970b('0x25')]['create'](_0x4fd25b[_0x970b('0x41')],{})[_0x970b('0x1f')](respondWithResult(_0x4a2600,0xc9))['catch'](handleError(_0x4a2600,null));};exports[_0x970b('0x1e')]=function(_0x1c25ff,_0x5337ba){if(_0x1c25ff[_0x970b('0x41')]['id']){delete _0x1c25ff[_0x970b('0x41')]['id'];}return db[_0x970b('0x25')][_0x970b('0x3e')]({'where':{'id':_0x1c25ff[_0x970b('0x42')]['id']}})[_0x970b('0x1f')](handleEntityNotFound(_0x5337ba,null))['then'](saveUpdates(_0x1c25ff[_0x970b('0x41')],null))[_0x970b('0x1f')](respondWithResult(_0x5337ba,null))[_0x970b('0x3f')](handleError(_0x5337ba,null));};exports[_0x970b('0x43')]=function(_0x4b00d9,_0x5306ef){return db[_0x970b('0x25')]['find']({'where':{'id':_0x4b00d9[_0x970b('0x42')]['id']}})[_0x970b('0x1f')](handleEntityNotFound(_0x5306ef,null))['then'](removeEntity(_0x5306ef,null))[_0x970b('0x3f')](handleError(_0x5306ef,null));}; \ No newline at end of file +var _0x2fd3=['json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','eml-format','fast-json-patch','moment','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','sendStatus','status','end'];(function(_0x412d1f,_0x383cb1){var _0x516a61=function(_0x6f7543){while(--_0x6f7543){_0x412d1f['push'](_0x412d1f['shift']());}};_0x516a61(++_0x383cb1);}(_0x2fd3,0x1f1));var _0x32fd=function(_0x1e1f1c,_0x1f2328){_0x1e1f1c=_0x1e1f1c-0x0;var _0x5ab249=_0x2fd3[_0x1e1f1c];return _0x5ab249;};'use strict';var emlformat=require(_0x32fd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x32fd('0x1'));var rp=require('request-promise');var moment=require(_0x32fd('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x32fd('0x3'));var sox=require(_0x32fd('0x4'));var csv=require(_0x32fd('0x5'));var ejs=require(_0x32fd('0x6'));var fs=require('fs');var fs_extra=require(_0x32fd('0x7'));var _=require(_0x32fd('0x8'));var squel=require(_0x32fd('0x9'));var crypto=require(_0x32fd('0xa'));var jsforce=require(_0x32fd('0xb'));var deskjs=require(_0x32fd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x32fd('0xd'));var Papa=require(_0x32fd('0xe'));var Redis=require(_0x32fd('0xf'));var authService=require(_0x32fd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x32fd('0x11'));var hardwareService=require(_0x32fd('0x12'));var logger=require(_0x32fd('0x13'))(_0x32fd('0x14'));var utils=require(_0x32fd('0x15'));var config=require(_0x32fd('0x16'));var licenseUtil=require(_0x32fd('0x17'));var db=require(_0x32fd('0x18'))['db'];function respondWithStatusCode(_0xc15858,_0x3f89e6){_0x3f89e6=_0x3f89e6||0xcc;return function(_0x57aadc){if(_0x57aadc){return _0xc15858[_0x32fd('0x19')](_0x3f89e6);}return _0xc15858[_0x32fd('0x1a')](_0x3f89e6)[_0x32fd('0x1b')]();};}function respondWithResult(_0x2a6098,_0x122d6c){_0x122d6c=_0x122d6c||0xc8;return function(_0x363c3c){if(_0x363c3c){return _0x2a6098['status'](_0x122d6c)[_0x32fd('0x1c')](_0x363c3c);}};}function respondWithFilteredResult(_0xa984fd,_0xc73f3f){return function(_0x44510f){if(_0x44510f){var _0x21abaf=typeof _0xc73f3f[_0x32fd('0x1d')]===_0x32fd('0x1e')&&typeof _0xc73f3f['limit']==='undefined';var _0x3fc0ad=_0x44510f[_0x32fd('0x1f')];var _0x238346=_0x21abaf?0x0:_0xc73f3f[_0x32fd('0x1d')];var _0x18af0f=_0x21abaf?_0x44510f[_0x32fd('0x1f')]:_0xc73f3f[_0x32fd('0x1d')]+_0xc73f3f[_0x32fd('0x20')];var _0x5085aa;if(_0x18af0f>=_0x3fc0ad){_0x18af0f=_0x3fc0ad;_0x5085aa=0xc8;}else{_0x5085aa=0xce;}_0xa984fd[_0x32fd('0x1a')](_0x5085aa);return _0xa984fd['set'](_0x32fd('0x21'),_0x238346+'-'+_0x18af0f+'/'+_0x3fc0ad)[_0x32fd('0x1c')](_0x44510f);}return null;};}function patchUpdates(_0x44f3d9){return function(_0x3cda90){try{jsonpatch[_0x32fd('0x22')](_0x3cda90,_0x44f3d9,!![]);}catch(_0x54f666){return BPromise[_0x32fd('0x23')](_0x54f666);}return _0x3cda90['save']();};}function saveUpdates(_0x3480ea,_0x28e871){return function(_0x32543a){if(_0x32543a){return _0x32543a[_0x32fd('0x24')](_0x3480ea)[_0x32fd('0x25')](function(_0x2edcc8){return _0x2edcc8;});}return null;};}function removeEntity(_0xd0bd91,_0x3032e9){return function(_0x4c5016){if(_0x4c5016){return _0x4c5016[_0x32fd('0x26')]()['then'](function(){_0xd0bd91[_0x32fd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20b8e9,_0x3a572f){return function(_0x243f97){if(!_0x243f97){_0x20b8e9[_0x32fd('0x19')](0x194);}return _0x243f97;};}function handleError(_0x39cebd,_0x5178ca){_0x5178ca=_0x5178ca||0x1f4;return function(_0x4839a5){logger[_0x32fd('0x27')](_0x4839a5[_0x32fd('0x28')]);if(_0x4839a5[_0x32fd('0x29')]){delete _0x4839a5['name'];}_0x39cebd[_0x32fd('0x1a')](_0x5178ca)[_0x32fd('0x2a')](_0x4839a5);};}exports[_0x32fd('0x2b')]=function(_0x24e912,_0x4cf4da){var _0x189bf2={},_0x2a1b3b={},_0x20afb0={'count':0x0,'rows':[]};var _0x42f160=_[_0x32fd('0x2c')](db[_0x32fd('0x2d')][_0x32fd('0x2e')],function(_0x1881eb){return{'name':_0x1881eb[_0x32fd('0x2f')],'type':_0x1881eb['type']['key']};});_0x2a1b3b[_0x32fd('0x30')]=_[_0x32fd('0x2c')](_0x42f160,_0x32fd('0x29'));_0x2a1b3b[_0x32fd('0x31')]=_[_0x32fd('0x32')](_0x24e912[_0x32fd('0x31')]);_0x2a1b3b['filters']=_[_0x32fd('0x33')](_0x2a1b3b[_0x32fd('0x30')],_0x2a1b3b[_0x32fd('0x31')]);_0x189bf2[_0x32fd('0x34')]=_[_0x32fd('0x33')](_0x2a1b3b[_0x32fd('0x30')],qs['fields'](_0x24e912[_0x32fd('0x31')][_0x32fd('0x35')]));_0x189bf2['attributes']=_0x189bf2['attributes']['length']?_0x189bf2[_0x32fd('0x34')]:_0x2a1b3b[_0x32fd('0x30')];if(!_0x24e912[_0x32fd('0x31')][_0x32fd('0x36')](_0x32fd('0x37'))){_0x189bf2[_0x32fd('0x20')]=qs[_0x32fd('0x20')](_0x24e912[_0x32fd('0x31')][_0x32fd('0x20')]);_0x189bf2[_0x32fd('0x1d')]=qs[_0x32fd('0x1d')](_0x24e912['query'][_0x32fd('0x1d')]);}_0x189bf2[_0x32fd('0x38')]=qs[_0x32fd('0x39')](_0x24e912[_0x32fd('0x31')]['sort']);_0x189bf2[_0x32fd('0x3a')]=qs[_0x32fd('0x3b')](_['pick'](_0x24e912[_0x32fd('0x31')],_0x2a1b3b['filters']),_0x42f160);if(_0x24e912[_0x32fd('0x31')][_0x32fd('0x3c')]){_0x189bf2[_0x32fd('0x3a')]=_['merge'](_0x189bf2[_0x32fd('0x3a')],{'$or':_[_0x32fd('0x2c')](_0x42f160,function(_0x541511){if(_0x541511[_0x32fd('0x3d')]!=='VIRTUAL'){var _0x1a1eb0={};_0x1a1eb0[_0x541511[_0x32fd('0x29')]]={'$like':'%'+_0x24e912[_0x32fd('0x31')][_0x32fd('0x3c')]+'%'};return _0x1a1eb0;}})});}_0x189bf2=_[_0x32fd('0x3e')]({},_0x189bf2,_0x24e912[_0x32fd('0x3f')]);var _0x20dbed={'where':_0x189bf2[_0x32fd('0x3a')]};return db['AnalyticTreeReport'][_0x32fd('0x1f')](_0x20dbed)[_0x32fd('0x25')](function(_0x1c985c){_0x20afb0[_0x32fd('0x1f')]=_0x1c985c;if(_0x24e912[_0x32fd('0x31')][_0x32fd('0x40')]){_0x189bf2[_0x32fd('0x41')]=[{'all':!![]}];}return db[_0x32fd('0x2d')][_0x32fd('0x42')](_0x189bf2);})[_0x32fd('0x25')](function(_0x1cf00c){_0x20afb0[_0x32fd('0x43')]=_0x1cf00c;return _0x20afb0;})[_0x32fd('0x25')](respondWithFilteredResult(_0x4cf4da,_0x189bf2))[_0x32fd('0x44')](handleError(_0x4cf4da,null));};exports[_0x32fd('0x45')]=function(_0x2987f6,_0x53de3c){var _0x24a4c2={'raw':!![],'where':{'id':_0x2987f6[_0x32fd('0x46')]['id']}},_0x20d8aa={};_0x20d8aa['model']=_[_0x32fd('0x32')](db[_0x32fd('0x2d')]['rawAttributes']);_0x20d8aa[_0x32fd('0x31')]=_[_0x32fd('0x32')](_0x2987f6[_0x32fd('0x31')]);_0x20d8aa[_0x32fd('0x3b')]=_[_0x32fd('0x33')](_0x20d8aa[_0x32fd('0x30')],_0x20d8aa[_0x32fd('0x31')]);_0x24a4c2[_0x32fd('0x34')]=_[_0x32fd('0x33')](_0x20d8aa[_0x32fd('0x30')],qs[_0x32fd('0x35')](_0x2987f6[_0x32fd('0x31')][_0x32fd('0x35')]));_0x24a4c2[_0x32fd('0x34')]=_0x24a4c2['attributes'][_0x32fd('0x47')]?_0x24a4c2['attributes']:_0x20d8aa[_0x32fd('0x30')];if(_0x2987f6[_0x32fd('0x31')][_0x32fd('0x40')]){_0x24a4c2[_0x32fd('0x41')]=[{'all':!![]}];}_0x24a4c2=_[_0x32fd('0x3e')]({},_0x24a4c2,_0x2987f6[_0x32fd('0x3f')]);return db[_0x32fd('0x2d')]['find'](_0x24a4c2)['then'](handleEntityNotFound(_0x53de3c,null))[_0x32fd('0x25')](respondWithResult(_0x53de3c,null))[_0x32fd('0x44')](handleError(_0x53de3c,null));};exports[_0x32fd('0x48')]=function(_0x5647bf,_0x8e617f){return db['AnalyticTreeReport'][_0x32fd('0x48')](_0x5647bf[_0x32fd('0x49')],{})[_0x32fd('0x25')](respondWithResult(_0x8e617f,0xc9))[_0x32fd('0x44')](handleError(_0x8e617f,null));};exports[_0x32fd('0x24')]=function(_0xbc673,_0xcfe285){if(_0xbc673['body']['id']){delete _0xbc673[_0x32fd('0x49')]['id'];}return db[_0x32fd('0x2d')][_0x32fd('0x4a')]({'where':{'id':_0xbc673[_0x32fd('0x46')]['id']}})['then'](handleEntityNotFound(_0xcfe285,null))['then'](saveUpdates(_0xbc673[_0x32fd('0x49')],null))[_0x32fd('0x25')](respondWithResult(_0xcfe285,null))[_0x32fd('0x44')](handleError(_0xcfe285,null));};exports[_0x32fd('0x26')]=function(_0x3d821a,_0x1cafc3){return db[_0x32fd('0x2d')][_0x32fd('0x4a')]({'where':{'id':_0x3d821a[_0x32fd('0x46')]['id']}})[_0x32fd('0x25')](handleEntityNotFound(_0x1cafc3,null))[_0x32fd('0x25')](removeEntity(_0x1cafc3,null))[_0x32fd('0x44')](handleError(_0x1cafc3,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 2fde0c8..b854fe4 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 _0x202f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','util'];(function(_0x5b62df,_0xee401){var _0x5e247b=function(_0x4b96c0){while(--_0x4b96c0){_0x5b62df['push'](_0x5b62df['shift']());}};_0x5e247b(++_0xee401);}(_0x202f,0x128));var _0xf202=function(_0x50c2fe,_0x8b89b0){_0x50c2fe=_0x50c2fe-0x0;var _0x230459=_0x202f[_0x50c2fe];return _0x230459;};'use strict';var _=require('lodash');var util=require(_0xf202('0x0'));var logger=require('../../config/logger')(_0xf202('0x1'));var moment=require(_0xf202('0x2'));var BPromise=require(_0xf202('0x3'));var rp=require(_0xf202('0x4'));var fs=require('fs');var path=require(_0xf202('0x5'));var rimraf=require(_0xf202('0x6'));var config=require(_0xf202('0x7'));var attributes=require(_0xf202('0x8'));module['exports']=function(_0x102e6d,_0xa98c2f){return _0x102e6d[_0xf202('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xf202('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c4b=['analytics_report_trees','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x5e03dd,_0x3a3eac){var _0xb9c575=function(_0xe59ef5){while(--_0xe59ef5){_0x5e03dd['push'](_0x5e03dd['shift']());}};_0xb9c575(++_0x3a3eac);}(_0x9c4b,0x19b));var _0xb9c4=function(_0x4e3f26,_0xd30c27){_0x4e3f26=_0x4e3f26-0x0;var _0x19daba=_0x9c4b[_0x4e3f26];return _0x19daba;};'use strict';var _=require('lodash');var util=require(_0xb9c4('0x0'));var logger=require('../../config/logger')(_0xb9c4('0x1'));var moment=require(_0xb9c4('0x2'));var BPromise=require(_0xb9c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c4('0x4'));var rimraf=require(_0xb9c4('0x5'));var config=require(_0xb9c4('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xb9c4('0x7')]=function(_0x4c68a0,_0xd4419c){return _0x4c68a0[_0xb9c4('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xb9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 595e7af..5f0419f 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33d615,_0x1a5af7){var _0x254611=function(_0x23c410){while(--_0x23c410){_0x33d615['push'](_0x33d615['shift']());}};_0x254611(++_0x1a5af7);}(_0xadb5,0xad));var _0x5adb=function(_0x4314a1,_0x51e0d6){_0x4314a1=_0x4314a1-0x0;var _0x16c400=_0xadb5[_0x4314a1];return _0x16c400;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0xadb5,0xad));var _0x5adb=function(_0x52e024,_0x3f3815){_0x52e024=_0x52e024-0x0;var _0x5b077f=_0xadb5[_0x52e024];return _0x5b077f;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 10ae2cf..e20f34e 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 _0xb63d=['index','post','create','put','update','/:id','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3f0b8a,_0x578b56){var _0x3fceba=function(_0x488007){while(--_0x488007){_0x3f0b8a['push'](_0x3f0b8a['shift']());}};_0x3fceba(++_0x578b56);}(_0xb63d,0x127));var _0xdb63=function(_0x111406,_0x4461dd){_0x111406=_0x111406-0x0;var _0x41e5e5=_0xb63d[_0x111406];return _0x41e5e5;};'use strict';var multer=require(_0xdb63('0x0'));var util=require(_0xdb63('0x1'));var path=require('path');var timeout=require(_0xdb63('0x2'));var express=require('express');var router=express[_0xdb63('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdb63('0x4'));var interaction=require(_0xdb63('0x5'));var config=require(_0xdb63('0x6'));var controller=require('./analyticTreeReport.controller');router[_0xdb63('0x7')]('/',auth[_0xdb63('0x8')](),controller[_0xdb63('0x9')]);router[_0xdb63('0x7')]('/:id',auth[_0xdb63('0x8')](),controller['show']);router[_0xdb63('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb63('0xb')]);router[_0xdb63('0xc')]('/:id',auth[_0xdb63('0x8')](),controller[_0xdb63('0xd')]);router['delete'](_0xdb63('0xe'),auth[_0xdb63('0x8')](),controller['destroy']);module[_0xdb63('0xf')]=router; \ No newline at end of file +var _0xc943=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','delete','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xc943,0x144));var _0x3c94=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0xc943[_0x179e11];return _0x549f04;};'use strict';var multer=require(_0x3c94('0x0'));var util=require(_0x3c94('0x1'));var path=require(_0x3c94('0x2'));var timeout=require(_0x3c94('0x3'));var express=require('express');var router=express[_0x3c94('0x4')]();var fs_extra=require(_0x3c94('0x5'));var auth=require(_0x3c94('0x6'));var interaction=require(_0x3c94('0x7'));var config=require(_0x3c94('0x8'));var controller=require(_0x3c94('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3c94('0xa')]);router[_0x3c94('0xb')](_0x3c94('0xc'),auth[_0x3c94('0xd')](),controller['show']);router['post']('/',auth[_0x3c94('0xd')](),controller['create']);router['put'](_0x3c94('0xc'),auth[_0x3c94('0xd')](),controller['update']);router[_0x3c94('0xe')](_0x3c94('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index d3f3290..3bc49ee 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 _0x0c02=['exports','STRING'];(function(_0x511757,_0x3662a1){var _0x38f7aa=function(_0x29a402){while(--_0x29a402){_0x511757['push'](_0x511757['shift']());}};_0x38f7aa(++_0x3662a1);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x20c0('0x0')]={'name':{'type':Sequelize[_0x20c0('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x20c0('0x1')]}}; \ No newline at end of file +var _0x0962=['sequelize','exports','STRING'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x0962,0x198));var _0x2096=function(_0x30c9d9,_0x2d65b8){_0x30c9d9=_0x30c9d9-0x0;var _0x2cd215=_0x0962[_0x30c9d9];return _0x2cd215;};'use strict';var Sequelize=require(_0x2096('0x0'));module[_0x2096('0x1')]={'name':{'type':Sequelize[_0x2096('0x2')]},'basename':{'type':Sequelize[_0x2096('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 8bc8cb4..ababfc1 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 _0x0425=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','map','Attachment','type','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','root','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x4c05e6,_0x5f0d4a){var _0x2a8f22=function(_0x2d11a4){while(--_0x2d11a4){_0x4c05e6['push'](_0x4c05e6['shift']());}};_0x2a8f22(++_0x5f0d4a);}(_0x0425,0x1ef));var _0x5042=function(_0x4174b0,_0x27c9f7){_0x4174b0=_0x4174b0-0x0;var _0x45c7c7=_0x0425[_0x4174b0];return _0x45c7c7;};'use strict';var emlformat=require(_0x5042('0x0'));var rimraf=require(_0x5042('0x1'));var zipdir=require(_0x5042('0x2'));var jsonpatch=require(_0x5042('0x3'));var rp=require(_0x5042('0x4'));var moment=require('moment');var BPromise=require(_0x5042('0x5'));var Mustache=require('mustache');var util=require(_0x5042('0x6'));var path=require(_0x5042('0x7'));var sox=require('sox');var csv=require(_0x5042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5042('0x9'));var _=require('lodash');var squel=require(_0x5042('0xa'));var crypto=require(_0x5042('0xb'));var jsforce=require(_0x5042('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5042('0x8'));var querystring=require(_0x5042('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5042('0xe'));var hardwareService=require(_0x5042('0xf'));var logger=require(_0x5042('0x10'))(_0x5042('0x11'));var utils=require(_0x5042('0x12'));var config=require(_0x5042('0x13'));var licenseUtil=require(_0x5042('0x14'));var db=require(_0x5042('0x15'))['db'];function respondWithStatusCode(_0x5e4aa5,_0x4a7d9c){_0x4a7d9c=_0x4a7d9c||0xcc;return function(_0xcee97e){if(_0xcee97e){return _0x5e4aa5[_0x5042('0x16')](_0x4a7d9c);}return _0x5e4aa5['status'](_0x4a7d9c)[_0x5042('0x17')]();};}function respondWithResult(_0x33619c,_0x2e2afd){_0x2e2afd=_0x2e2afd||0xc8;return function(_0x544b73){if(_0x544b73){return _0x33619c[_0x5042('0x18')](_0x2e2afd)[_0x5042('0x19')](_0x544b73);}};}function respondWithFilteredResult(_0x32c8f9,_0x1e12da){return function(_0x43886f){if(_0x43886f){var _0x3dc5a9=typeof _0x1e12da[_0x5042('0x1a')]===_0x5042('0x1b')&&typeof _0x1e12da[_0x5042('0x1c')]===_0x5042('0x1b');var _0x21ec95=_0x43886f[_0x5042('0x1d')];var _0x539559=_0x3dc5a9?0x0:_0x1e12da[_0x5042('0x1a')];var _0xe9fb6c=_0x3dc5a9?_0x43886f[_0x5042('0x1d')]:_0x1e12da[_0x5042('0x1a')]+_0x1e12da[_0x5042('0x1c')];var _0x471bfd;if(_0xe9fb6c>=_0x21ec95){_0xe9fb6c=_0x21ec95;_0x471bfd=0xc8;}else{_0x471bfd=0xce;}_0x32c8f9['status'](_0x471bfd);return _0x32c8f9[_0x5042('0x1e')](_0x5042('0x1f'),_0x539559+'-'+_0xe9fb6c+'/'+_0x21ec95)[_0x5042('0x19')](_0x43886f);}return null;};}function patchUpdates(_0x307390){return function(_0x30c803){try{jsonpatch['apply'](_0x30c803,_0x307390,!![]);}catch(_0x5c8342){return BPromise[_0x5042('0x20')](_0x5c8342);}return _0x30c803['save']();};}function saveUpdates(_0x2ced62,_0x3fb248){return function(_0x1618fc){if(_0x1618fc){return _0x1618fc[_0x5042('0x21')](_0x2ced62)[_0x5042('0x22')](function(_0x26841e){return _0x26841e;});}return null;};}function removeEntity(_0x312eea,_0x39594c){return function(_0x375962){if(_0x375962){return _0x375962[_0x5042('0x23')]()['then'](function(){_0x312eea[_0x5042('0x18')](0xcc)[_0x5042('0x17')]();});}};}function handleEntityNotFound(_0x71b64f,_0x21ec06){return function(_0x47aa1f){if(!_0x47aa1f){_0x71b64f[_0x5042('0x16')](0x194);}return _0x47aa1f;};}function handleError(_0x52e905,_0x299d70){_0x299d70=_0x299d70||0x1f4;return function(_0x478c0e){logger[_0x5042('0x24')](_0x478c0e[_0x5042('0x25')]);if(_0x478c0e['name']){delete _0x478c0e[_0x5042('0x26')];}_0x52e905[_0x5042('0x18')](_0x299d70)[_0x5042('0x27')](_0x478c0e);};}exports['index']=function(_0x496940,_0x13575e){var _0xfffcfe={},_0x1f90f8={},_0x2a5070={'count':0x0,'rows':[]};var _0x3e525e=_[_0x5042('0x28')](db[_0x5042('0x29')]['rawAttributes'],function(_0x3df45c){return{'name':_0x3df45c['fieldName'],'type':_0x3df45c[_0x5042('0x2a')][_0x5042('0x2b')]};});_0x1f90f8[_0x5042('0x2c')]=_[_0x5042('0x28')](_0x3e525e,_0x5042('0x26'));_0x1f90f8['query']=_['keys'](_0x496940[_0x5042('0x2d')]);_0x1f90f8[_0x5042('0x2e')]=_[_0x5042('0x2f')](_0x1f90f8[_0x5042('0x2c')],_0x1f90f8[_0x5042('0x2d')]);_0xfffcfe[_0x5042('0x30')]=_['intersection'](_0x1f90f8[_0x5042('0x2c')],qs['fields'](_0x496940[_0x5042('0x2d')]['fields']));_0xfffcfe[_0x5042('0x30')]=_0xfffcfe[_0x5042('0x30')][_0x5042('0x31')]?_0xfffcfe[_0x5042('0x30')]:_0x1f90f8[_0x5042('0x2c')];if(!_0x496940[_0x5042('0x2d')]['hasOwnProperty'](_0x5042('0x32'))){_0xfffcfe[_0x5042('0x1c')]=qs[_0x5042('0x1c')](_0x496940[_0x5042('0x2d')][_0x5042('0x1c')]);_0xfffcfe[_0x5042('0x1a')]=qs[_0x5042('0x1a')](_0x496940[_0x5042('0x2d')][_0x5042('0x1a')]);}_0xfffcfe[_0x5042('0x33')]=qs[_0x5042('0x34')](_0x496940[_0x5042('0x2d')][_0x5042('0x34')]);_0xfffcfe[_0x5042('0x35')]=qs[_0x5042('0x2e')](_[_0x5042('0x36')](_0x496940[_0x5042('0x2d')],_0x1f90f8[_0x5042('0x2e')]),_0x3e525e);if(_0x496940[_0x5042('0x2d')][_0x5042('0x37')]){_0xfffcfe['where']=_[_0x5042('0x38')](_0xfffcfe['where'],{'$or':_[_0x5042('0x28')](_0x3e525e,function(_0x2ee141){if(_0x2ee141[_0x5042('0x2a')]!==_0x5042('0x39')){var _0x34af56={};_0x34af56[_0x2ee141[_0x5042('0x26')]]={'$like':'%'+_0x496940[_0x5042('0x2d')][_0x5042('0x37')]+'%'};return _0x34af56;}})});}_0xfffcfe=_[_0x5042('0x38')]({},_0xfffcfe,_0x496940[_0x5042('0x3a')]);var _0x1ac045={'where':_0xfffcfe['where']};return db[_0x5042('0x29')][_0x5042('0x1d')](_0x1ac045)['then'](function(_0x428d65){_0x2a5070[_0x5042('0x1d')]=_0x428d65;if(_0x496940[_0x5042('0x2d')][_0x5042('0x3b')]){_0xfffcfe[_0x5042('0x3c')]=[{'all':!![]}];}return db['Attachment'][_0x5042('0x3d')](_0xfffcfe);})[_0x5042('0x22')](function(_0x7581c7){_0x2a5070[_0x5042('0x3e')]=_0x7581c7;return _0x2a5070;})[_0x5042('0x22')](respondWithFilteredResult(_0x13575e,_0xfffcfe))[_0x5042('0x3f')](handleError(_0x13575e,null));};exports[_0x5042('0x40')]=function(_0x2ae5ac,_0x12ffd4){var _0x3fd18b={'raw':!![],'where':{'id':_0x2ae5ac[_0x5042('0x41')]['id']}},_0x2c34d4={};_0x2c34d4[_0x5042('0x2c')]=_[_0x5042('0x42')](db[_0x5042('0x29')][_0x5042('0x43')]);_0x2c34d4[_0x5042('0x2d')]=_['keys'](_0x2ae5ac['query']);_0x2c34d4[_0x5042('0x2e')]=_['intersection'](_0x2c34d4[_0x5042('0x2c')],_0x2c34d4[_0x5042('0x2d')]);_0x3fd18b[_0x5042('0x30')]=_['intersection'](_0x2c34d4[_0x5042('0x2c')],qs[_0x5042('0x44')](_0x2ae5ac[_0x5042('0x2d')][_0x5042('0x44')]));_0x3fd18b[_0x5042('0x30')]=_0x3fd18b[_0x5042('0x30')][_0x5042('0x31')]?_0x3fd18b[_0x5042('0x30')]:_0x2c34d4[_0x5042('0x2c')];if(_0x2ae5ac[_0x5042('0x2d')][_0x5042('0x3b')]){_0x3fd18b[_0x5042('0x3c')]=[{'all':!![]}];}_0x3fd18b=_[_0x5042('0x38')]({},_0x3fd18b,_0x2ae5ac[_0x5042('0x3a')]);return db[_0x5042('0x29')][_0x5042('0x45')](_0x3fd18b)[_0x5042('0x22')](handleEntityNotFound(_0x12ffd4,null))['then'](respondWithResult(_0x12ffd4,null))['catch'](handleError(_0x12ffd4,null));};exports[_0x5042('0x46')]=function(_0x450e4b,_0x5edd7d){var _0x2835b7={'where':{'id':_0x450e4b['params']['id']}},_0x349555={};_0x349555[_0x5042('0x2c')]=_[_0x5042('0x42')](db['Attachment'][_0x5042('0x43')]);_0x2835b7[_0x5042('0x30')]=_[_0x5042('0x2f')](_0x349555['model'],qs['fields'](_0x450e4b[_0x5042('0x2d')][_0x5042('0x44')]));_0x2835b7[_0x5042('0x30')]=_0x2835b7[_0x5042('0x30')][_0x5042('0x31')]?_0x2835b7[_0x5042('0x30')]:_0x349555[_0x5042('0x2c')];if(_0x450e4b['query'][_0x5042('0x3b')]){_0x2835b7[_0x5042('0x3c')]=[{'all':!![]}];}_0x2835b7=_[_0x5042('0x38')]({},_0x2835b7,_0x450e4b[_0x5042('0x3a')]);return db['Attachment'][_0x5042('0x45')](_0x2835b7)[_0x5042('0x22')](handleEntityNotFound(_0x5edd7d,null))['then'](function(_0x7f135){if(_0x7f135){var _0x1018dd=_0x7f135[_0x5042('0x47')]({'plain':!![]});_0x1018dd=qs[_0x5042('0x48')](_0x1018dd,['id',_0x5042('0x49'),_0x5042('0x4a')]);_0x450e4b[_0x5042('0x4b')]=_[_0x5042('0x48')](_0x450e4b[_0x5042('0x4b')],['id','createdAt','updatedAt']);return db['Attachment']['create'](_[_0x5042('0x38')](_0x1018dd,_0x450e4b[_0x5042('0x4b')]),{'include':_0x450e4b[_0x5042('0x2d')][_0x5042('0x3b')]?[{'all':!![]}]:undefined});}})[_0x5042('0x22')](respondWithResult(_0x5edd7d,0xc9))['catch'](handleError(_0x5edd7d,null));};exports['update']=function(_0x5c7509,_0x27caf5){if(_0x5c7509[_0x5042('0x4b')]['id']){delete _0x5c7509['body']['id'];}return db[_0x5042('0x29')][_0x5042('0x45')]({'where':{'id':_0x5c7509[_0x5042('0x41')]['id']}})['then'](handleEntityNotFound(_0x27caf5,null))[_0x5042('0x22')](saveUpdates(_0x5c7509['body'],null))[_0x5042('0x22')](respondWithResult(_0x27caf5,null))[_0x5042('0x3f')](handleError(_0x27caf5,null));};exports[_0x5042('0x23')]=function(_0x2d93b1,_0x31fd64){return db['Attachment']['find']({'where':{'id':_0x2d93b1[_0x5042('0x41')]['id']}})[_0x5042('0x22')](handleEntityNotFound(_0x31fd64,null))['then'](removeEntity(_0x31fd64,null))['catch'](handleError(_0x31fd64,null));};exports[_0x5042('0x4c')]=function(_0x163080,_0x2fe287,_0x52de86){_0x163080['body'][_0x5042('0x26')]=_0x163080[_0x5042('0x4d')][_0x5042('0x4e')];_0x163080[_0x5042('0x4b')][_0x5042('0x4f')]=_0x163080['file'][_0x5042('0x50')];_0x163080['body'][_0x5042('0x2a')]=_0x163080[_0x5042('0x4d')][_0x5042('0x51')];return db[_0x5042('0x29')][_0x5042('0x4c')](_0x163080['body'])[_0x5042('0x22')](respondWithResult(_0x2fe287,0xc9))[_0x5042('0x3f')](handleError(_0x2fe287,null));};exports[_0x5042('0x52')]=function(_0x4abbd9,_0x1ceea1,_0xfe9d33){return db[_0x5042('0x29')]['findOne']({'where':{'id':_0x4abbd9[_0x5042('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1ceea1,null))[_0x5042('0x22')](function(_0x2536dd){if(_0x2536dd){var _0x500eb9=_0x2536dd[_0x5042('0x53')]!==null;var _0xdaf0f9=path['join'](config[_0x5042('0x54')],'server/files/attachments/');if(_0x500eb9){_0xdaf0f9=path[_0x5042('0x55')](_0xdaf0f9,_0x5042('0x56'));}var _0x469ad2=path[_0x5042('0x55')](_0xdaf0f9,_0x2536dd[_0x5042('0x4f')]);return _0x1ceea1[_0x5042('0x52')](_0x469ad2);}})[_0x5042('0x3f')](handleError(_0x1ceea1,null));}; \ No newline at end of file +var _0x3d8c=['filter','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','options','find','catch','clone','get','omit','createdAt','updatedAt','create','body','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0x3d8c,0x79));var _0xc3d8=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x3d8c[_0x337537];return _0x4fdd67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3d8('0x0'));var zipdir=require(_0xc3d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3d8('0x2'));var moment=require('moment');var BPromise=require(_0xc3d8('0x3'));var Mustache=require('mustache');var util=require(_0xc3d8('0x4'));var path=require(_0xc3d8('0x5'));var sox=require(_0xc3d8('0x6'));var csv=require('to-csv');var ejs=require(_0xc3d8('0x7'));var fs=require('fs');var fs_extra=require(_0xc3d8('0x8'));var _=require(_0xc3d8('0x9'));var squel=require(_0xc3d8('0xa'));var crypto=require(_0xc3d8('0xb'));var jsforce=require(_0xc3d8('0xc'));var deskjs=require(_0xc3d8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc3d8('0xe'));var Redis=require(_0xc3d8('0xf'));var authService=require(_0xc3d8('0x10'));var qs=require(_0xc3d8('0x11'));var as=require(_0xc3d8('0x12'));var hardwareService=require(_0xc3d8('0x13'));var logger=require(_0xc3d8('0x14'))(_0xc3d8('0x15'));var utils=require(_0xc3d8('0x16'));var config=require(_0xc3d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc3d8('0x18'))['db'];function respondWithStatusCode(_0x5cf50f,_0x471097){_0x471097=_0x471097||0xcc;return function(_0x2ee5b0){if(_0x2ee5b0){return _0x5cf50f[_0xc3d8('0x19')](_0x471097);}return _0x5cf50f[_0xc3d8('0x1a')](_0x471097)[_0xc3d8('0x1b')]();};}function respondWithResult(_0x4efa79,_0x911315){_0x911315=_0x911315||0xc8;return function(_0x1651ff){if(_0x1651ff){return _0x4efa79[_0xc3d8('0x1a')](_0x911315)[_0xc3d8('0x1c')](_0x1651ff);}};}function respondWithFilteredResult(_0xc58041,_0x3d6aa0){return function(_0x1a8212){if(_0x1a8212){var _0x44a9f7=typeof _0x3d6aa0[_0xc3d8('0x1d')]===_0xc3d8('0x1e')&&typeof _0x3d6aa0['limit']===_0xc3d8('0x1e');var _0x35ea5d=_0x1a8212[_0xc3d8('0x1f')];var _0x1f5468=_0x44a9f7?0x0:_0x3d6aa0[_0xc3d8('0x1d')];var _0x20b87a=_0x44a9f7?_0x1a8212[_0xc3d8('0x1f')]:_0x3d6aa0['offset']+_0x3d6aa0[_0xc3d8('0x20')];var _0x287b1f;if(_0x20b87a>=_0x35ea5d){_0x20b87a=_0x35ea5d;_0x287b1f=0xc8;}else{_0x287b1f=0xce;}_0xc58041[_0xc3d8('0x1a')](_0x287b1f);return _0xc58041[_0xc3d8('0x21')](_0xc3d8('0x22'),_0x1f5468+'-'+_0x20b87a+'/'+_0x35ea5d)['json'](_0x1a8212);}return null;};}function patchUpdates(_0x52fc88){return function(_0x1fd6f8){try{jsonpatch[_0xc3d8('0x23')](_0x1fd6f8,_0x52fc88,!![]);}catch(_0x509cc7){return BPromise[_0xc3d8('0x24')](_0x509cc7);}return _0x1fd6f8[_0xc3d8('0x25')]();};}function saveUpdates(_0x4fe0fe,_0x3f660c){return function(_0x49dec7){if(_0x49dec7){return _0x49dec7[_0xc3d8('0x26')](_0x4fe0fe)['then'](function(_0x3d0c22){return _0x3d0c22;});}return null;};}function removeEntity(_0x37df48,_0x15391a){return function(_0x147865){if(_0x147865){return _0x147865[_0xc3d8('0x27')]()[_0xc3d8('0x28')](function(){_0x37df48[_0xc3d8('0x1a')](0xcc)[_0xc3d8('0x1b')]();});}};}function handleEntityNotFound(_0x23362a,_0x8fb448){return function(_0x332ec0){if(!_0x332ec0){_0x23362a[_0xc3d8('0x19')](0x194);}return _0x332ec0;};}function handleError(_0x3f67b2,_0x4bfad9){_0x4bfad9=_0x4bfad9||0x1f4;return function(_0xc8d68d){logger[_0xc3d8('0x29')](_0xc8d68d[_0xc3d8('0x2a')]);if(_0xc8d68d[_0xc3d8('0x2b')]){delete _0xc8d68d[_0xc3d8('0x2b')];}_0x3f67b2[_0xc3d8('0x1a')](_0x4bfad9)[_0xc3d8('0x2c')](_0xc8d68d);};}exports[_0xc3d8('0x2d')]=function(_0x1382e6,_0x185579){var _0x4b9aa4={},_0x4dd233={},_0x5ac9a7={'count':0x0,'rows':[]};var _0xff0bd0=_[_0xc3d8('0x2e')](db[_0xc3d8('0x2f')][_0xc3d8('0x30')],function(_0x5186b8){return{'name':_0x5186b8['fieldName'],'type':_0x5186b8[_0xc3d8('0x31')][_0xc3d8('0x32')]};});_0x4dd233[_0xc3d8('0x33')]=_[_0xc3d8('0x2e')](_0xff0bd0,_0xc3d8('0x2b'));_0x4dd233[_0xc3d8('0x34')]=_[_0xc3d8('0x35')](_0x1382e6[_0xc3d8('0x34')]);_0x4dd233['filters']=_[_0xc3d8('0x36')](_0x4dd233[_0xc3d8('0x33')],_0x4dd233[_0xc3d8('0x34')]);_0x4b9aa4[_0xc3d8('0x37')]=_['intersection'](_0x4dd233['model'],qs['fields'](_0x1382e6[_0xc3d8('0x34')]['fields']));_0x4b9aa4['attributes']=_0x4b9aa4[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x4b9aa4[_0xc3d8('0x37')]:_0x4dd233[_0xc3d8('0x33')];if(!_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x39')](_0xc3d8('0x3a'))){_0x4b9aa4[_0xc3d8('0x20')]=qs[_0xc3d8('0x20')](_0x1382e6['query'][_0xc3d8('0x20')]);_0x4b9aa4[_0xc3d8('0x1d')]=qs[_0xc3d8('0x1d')](_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x1d')]);}_0x4b9aa4[_0xc3d8('0x3b')]=qs['sort'](_0x1382e6['query']['sort']);_0x4b9aa4[_0xc3d8('0x3c')]=qs[_0xc3d8('0x3d')](_[_0xc3d8('0x3e')](_0x1382e6['query'],_0x4dd233['filters']),_0xff0bd0);if(_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x3f')]){_0x4b9aa4['where']=_[_0xc3d8('0x40')](_0x4b9aa4['where'],{'$or':_['map'](_0xff0bd0,function(_0x13f287){if(_0x13f287[_0xc3d8('0x31')]!==_0xc3d8('0x41')){var _0x1a6c71={};_0x1a6c71[_0x13f287[_0xc3d8('0x2b')]]={'$like':'%'+_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x3f')]+'%'};return _0x1a6c71;}})});}_0x4b9aa4=_['merge']({},_0x4b9aa4,_0x1382e6['options']);var _0x78af76={'where':_0x4b9aa4['where']};return db[_0xc3d8('0x2f')][_0xc3d8('0x1f')](_0x78af76)['then'](function(_0x4b636d){_0x5ac9a7[_0xc3d8('0x1f')]=_0x4b636d;if(_0x1382e6[_0xc3d8('0x34')][_0xc3d8('0x42')]){_0x4b9aa4[_0xc3d8('0x43')]=[{'all':!![]}];}return db[_0xc3d8('0x2f')][_0xc3d8('0x44')](_0x4b9aa4);})[_0xc3d8('0x28')](function(_0x18ec33){_0x5ac9a7['rows']=_0x18ec33;return _0x5ac9a7;})[_0xc3d8('0x28')](respondWithFilteredResult(_0x185579,_0x4b9aa4))['catch'](handleError(_0x185579,null));};exports[_0xc3d8('0x45')]=function(_0x454317,_0x52fdcd){var _0x24c6b0={'raw':!![],'where':{'id':_0x454317[_0xc3d8('0x46')]['id']}},_0x5904bd={};_0x5904bd['model']=_[_0xc3d8('0x35')](db[_0xc3d8('0x2f')][_0xc3d8('0x30')]);_0x5904bd[_0xc3d8('0x34')]=_[_0xc3d8('0x35')](_0x454317['query']);_0x5904bd[_0xc3d8('0x3d')]=_[_0xc3d8('0x36')](_0x5904bd[_0xc3d8('0x33')],_0x5904bd['query']);_0x24c6b0[_0xc3d8('0x37')]=_[_0xc3d8('0x36')](_0x5904bd[_0xc3d8('0x33')],qs[_0xc3d8('0x47')](_0x454317[_0xc3d8('0x34')][_0xc3d8('0x47')]));_0x24c6b0[_0xc3d8('0x37')]=_0x24c6b0[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x24c6b0[_0xc3d8('0x37')]:_0x5904bd[_0xc3d8('0x33')];if(_0x454317[_0xc3d8('0x34')][_0xc3d8('0x42')]){_0x24c6b0['include']=[{'all':!![]}];}_0x24c6b0=_[_0xc3d8('0x40')]({},_0x24c6b0,_0x454317[_0xc3d8('0x48')]);return db[_0xc3d8('0x2f')][_0xc3d8('0x49')](_0x24c6b0)['then'](handleEntityNotFound(_0x52fdcd,null))[_0xc3d8('0x28')](respondWithResult(_0x52fdcd,null))[_0xc3d8('0x4a')](handleError(_0x52fdcd,null));};exports[_0xc3d8('0x4b')]=function(_0x3fb58c,_0x593d94){var _0x4cc34b={'where':{'id':_0x3fb58c[_0xc3d8('0x46')]['id']}},_0x41e27e={};_0x41e27e[_0xc3d8('0x33')]=_['keys'](db[_0xc3d8('0x2f')]['rawAttributes']);_0x4cc34b[_0xc3d8('0x37')]=_[_0xc3d8('0x36')](_0x41e27e['model'],qs[_0xc3d8('0x47')](_0x3fb58c[_0xc3d8('0x34')]['fields']));_0x4cc34b[_0xc3d8('0x37')]=_0x4cc34b[_0xc3d8('0x37')][_0xc3d8('0x38')]?_0x4cc34b[_0xc3d8('0x37')]:_0x41e27e[_0xc3d8('0x33')];if(_0x3fb58c[_0xc3d8('0x34')]['includeAll']){_0x4cc34b[_0xc3d8('0x43')]=[{'all':!![]}];}_0x4cc34b=_['merge']({},_0x4cc34b,_0x3fb58c[_0xc3d8('0x48')]);return db[_0xc3d8('0x2f')][_0xc3d8('0x49')](_0x4cc34b)['then'](handleEntityNotFound(_0x593d94,null))[_0xc3d8('0x28')](function(_0x8252d6){if(_0x8252d6){var _0x1d4301=_0x8252d6[_0xc3d8('0x4c')]({'plain':!![]});_0x1d4301=qs[_0xc3d8('0x4d')](_0x1d4301,['id',_0xc3d8('0x4e'),'updatedAt']);_0x3fb58c['body']=_[_0xc3d8('0x4d')](_0x3fb58c['body'],['id',_0xc3d8('0x4e'),_0xc3d8('0x4f')]);return db['Attachment'][_0xc3d8('0x50')](_[_0xc3d8('0x40')](_0x1d4301,_0x3fb58c[_0xc3d8('0x51')]),{'include':_0x3fb58c['query'][_0xc3d8('0x42')]?[{'all':!![]}]:undefined});}})[_0xc3d8('0x28')](respondWithResult(_0x593d94,0xc9))[_0xc3d8('0x4a')](handleError(_0x593d94,null));};exports[_0xc3d8('0x26')]=function(_0x58348b,_0x26cd95){if(_0x58348b[_0xc3d8('0x51')]['id']){delete _0x58348b[_0xc3d8('0x51')]['id'];}return db[_0xc3d8('0x2f')]['find']({'where':{'id':_0x58348b[_0xc3d8('0x46')]['id']}})[_0xc3d8('0x28')](handleEntityNotFound(_0x26cd95,null))[_0xc3d8('0x28')](saveUpdates(_0x58348b[_0xc3d8('0x51')],null))['then'](respondWithResult(_0x26cd95,null))[_0xc3d8('0x4a')](handleError(_0x26cd95,null));};exports[_0xc3d8('0x27')]=function(_0x12ef6c,_0x2f0799){return db[_0xc3d8('0x2f')][_0xc3d8('0x49')]({'where':{'id':_0x12ef6c[_0xc3d8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f0799,null))[_0xc3d8('0x28')](removeEntity(_0x2f0799,null))['catch'](handleError(_0x2f0799,null));};exports[_0xc3d8('0x50')]=function(_0x59591a,_0x3e13b9,_0x589319){_0x59591a[_0xc3d8('0x51')][_0xc3d8('0x2b')]=_0x59591a['file']['originalname'];_0x59591a[_0xc3d8('0x51')][_0xc3d8('0x52')]=_0x59591a[_0xc3d8('0x53')][_0xc3d8('0x54')];_0x59591a[_0xc3d8('0x51')]['type']=_0x59591a[_0xc3d8('0x53')][_0xc3d8('0x55')];return db[_0xc3d8('0x2f')]['create'](_0x59591a[_0xc3d8('0x51')])[_0xc3d8('0x28')](respondWithResult(_0x3e13b9,0xc9))[_0xc3d8('0x4a')](handleError(_0x3e13b9,null));};exports[_0xc3d8('0x56')]=function(_0x556cc1,_0x290631,_0x1ab27f){return db[_0xc3d8('0x2f')][_0xc3d8('0x57')]({'where':{'id':_0x556cc1[_0xc3d8('0x46')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x290631,null))[_0xc3d8('0x28')](function(_0x25218c){if(_0x25218c){var _0x2cd04e=_0x25218c[_0xc3d8('0x58')]!==null;var _0x36cd8e=path[_0xc3d8('0x59')](config[_0xc3d8('0x5a')],'server/files/attachments/');if(_0x2cd04e){_0x36cd8e=path[_0xc3d8('0x59')](_0x36cd8e,_0xc3d8('0x5b'));}var _0x3ace0c=path[_0xc3d8('0x59')](_0x36cd8e,_0x25218c['basename']);return _0x290631[_0xc3d8('0x56')](_0x3ace0c);}})[_0xc3d8('0x4a')](handleError(_0x290631,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9c7b868..f663534 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 _0x67b9=['util','../../config/logger','api','bluebird','request-promise','rimraf','./attachment.attributes','define','Attachment','attachments'];(function(_0x5f4dfb,_0x12f774){var _0x1b2688=function(_0x481d0e){while(--_0x481d0e){_0x5f4dfb['push'](_0x5f4dfb['shift']());}};_0x1b2688(++_0x12f774);}(_0x67b9,0x1c2));var _0x967b=function(_0x1714ae,_0x4ff761){_0x1714ae=_0x1714ae-0x0;var _0x5d6aba=_0x67b9[_0x1714ae];return _0x5d6aba;};'use strict';var _=require('lodash');var util=require(_0x967b('0x0'));var logger=require(_0x967b('0x1'))(_0x967b('0x2'));var moment=require('moment');var BPromise=require(_0x967b('0x3'));var rp=require(_0x967b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x967b('0x5'));var config=require('../../config/environment');var attributes=require(_0x967b('0x6'));module['exports']=function(_0xe4f367,_0x426073){return _0xe4f367[_0x967b('0x7')](_0x967b('0x8'),attributes,{'tableName':_0x967b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83ab=['lodash','moment','request-promise','../../config/environment','./attachment.attributes','exports','define','Attachment'];(function(_0x3d40a6,_0x5bfc03){var _0x2a1f81=function(_0x1a5232){while(--_0x1a5232){_0x3d40a6['push'](_0x3d40a6['shift']());}};_0x2a1f81(++_0x5bfc03);}(_0x83ab,0x170));var _0xb83a=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x83ab[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xb83a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb83a('0x1'));var BPromise=require('bluebird');var rp=require(_0xb83a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb83a('0x3'));var attributes=require(_0xb83a('0x4'));module[_0xb83a('0x5')]=function(_0x59490f,_0x3a2ad0){return _0x59490f[_0xb83a('0x6')](_0xb83a('0x7'),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 a56e1ee..570d7af 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 _0xf6fb=['Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateAttachment','Attachment','create','body','options','debug','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf6fb,0x111));var _0xbf6f=function(_0x417ed5,_0x4a9a0e){_0x417ed5=_0x417ed5-0x0;var _0x3539d8=_0xf6fb[_0x417ed5];return _0x3539d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf6f('0x0'));var BPromise=require(_0xbf6f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf6f('0x2'));var db=require(_0xbf6f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf6f('0x4'))('rpc');var config=require(_0xbf6f('0x5'));var jayson=require(_0xbf6f('0x6'));var client=jayson[_0xbf6f('0x7')][_0xbf6f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d8ecf,_0x26bc7b,_0x9d0c63){return new BPromise(function(_0x43d56b,_0x5948cf){return client[_0xbf6f('0x9')](_0x3d8ecf,_0x9d0c63)[_0xbf6f('0xa')](function(_0x2ac2f8){logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,'request\x20sent');logger['debug'](_0xbf6f('0xd'),_0x26bc7b,_0xbf6f('0xe'),JSON[_0xbf6f('0xf')](_0x2ac2f8));if(_0x2ac2f8['error']){if(_0x2ac2f8[_0xbf6f('0x10')]['code']===0x1f4){logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')]['message']);return _0x5948cf(_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);}logger[_0xbf6f('0x10')](_0xbf6f('0xc'),_0x26bc7b,_0x2ac2f8[_0xbf6f('0x10')][_0xbf6f('0x11')]);return _0x43d56b(_0x2ac2f8['error'][_0xbf6f('0x11')]);}else{logger[_0xbf6f('0xb')](_0xbf6f('0xc'),_0x26bc7b,_0xbf6f('0xe'));_0x43d56b(_0x2ac2f8[_0xbf6f('0x12')][_0xbf6f('0x11')]);}})[_0xbf6f('0x13')](function(_0x586f33){logger['error'](_0xbf6f('0xc'),_0x26bc7b,_0x586f33);_0x5948cf(_0x586f33);});});}exports[_0xbf6f('0x14')]=function(_0x21b485){var _0x4b3c33=this;return new Promise(function(_0x56b4da,_0x2a0537){return db[_0xbf6f('0x15')][_0xbf6f('0x16')](_0x21b485[_0xbf6f('0x17')],{'raw':_0x21b485[_0xbf6f('0x18')]?_0x21b485['options']['raw']===undefined?!![]:![]:!![]})[_0xbf6f('0xa')](function(_0x5985ac){logger[_0xbf6f('0xb')](_0xbf6f('0x14'),_0x21b485);logger[_0xbf6f('0x19')]('CreateAttachment',_0x21b485,JSON[_0xbf6f('0xf')](_0x5985ac));_0x56b4da(_0x5985ac);})[_0xbf6f('0x13')](function(_0x3a0087){logger['error'](_0xbf6f('0x14'),_0x3a0087['message'],_0x21b485);_0x2a0537(_0x4b3c33[_0xbf6f('0x10')](0x1f4,_0x3a0087[_0xbf6f('0x11')]));});});}; \ No newline at end of file +var _0x630e=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1c37a5,_0x59ee51){var _0x389d03=function(_0x51b4f4){while(--_0x51b4f4){_0x1c37a5['push'](_0x1c37a5['shift']());}};_0x389d03(++_0x59ee51);}(_0x630e,0x1af));var _0xe630=function(_0x5641f2,_0x3682d4){_0x5641f2=_0x5641f2-0x0;var _0x3384c7=_0x630e[_0x5641f2];return _0x3384c7;};'use strict';var _=require(_0xe630('0x0'));var util=require('util');var moment=require(_0xe630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe630('0x2'));var db=require(_0xe630('0x3'))['db'];var utils=require(_0xe630('0x4'));var logger=require('../../config/logger')(_0xe630('0x5'));var config=require(_0xe630('0x6'));var jayson=require(_0xe630('0x7'));var client=jayson[_0xe630('0x8')][_0xe630('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x481b21,_0x20193d,_0x34bad4){return new BPromise(function(_0x5a73ad,_0x267926){return client['request'](_0x481b21,_0x34bad4)[_0xe630('0xa')](function(_0x3da641){logger[_0xe630('0xb')]('Attachment,\x20%s,\x20%s',_0x20193d,'request\x20sent');logger[_0xe630('0xc')](_0xe630('0xd'),_0x20193d,_0xe630('0xe'),JSON[_0xe630('0xf')](_0x3da641));if(_0x3da641['error']){if(_0x3da641[_0xe630('0x10')][_0xe630('0x11')]===0x1f4){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x267926(_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);}logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x3da641[_0xe630('0x10')][_0xe630('0x13')]);return _0x5a73ad(_0x3da641[_0xe630('0x10')]['message']);}else{logger[_0xe630('0xb')](_0xe630('0x12'),_0x20193d,_0xe630('0xe'));_0x5a73ad(_0x3da641[_0xe630('0x14')][_0xe630('0x13')]);}})[_0xe630('0x15')](function(_0x26a2b7){logger[_0xe630('0x10')](_0xe630('0x12'),_0x20193d,_0x26a2b7);_0x267926(_0x26a2b7);});});}exports[_0xe630('0x16')]=function(_0x3dbcf6){var _0x9721fa=this;return new Promise(function(_0xafcf13,_0x79213e){return db[_0xe630('0x17')][_0xe630('0x18')](_0x3dbcf6[_0xe630('0x19')],{'raw':_0x3dbcf6[_0xe630('0x1a')]?_0x3dbcf6[_0xe630('0x1a')][_0xe630('0x1b')]===undefined?!![]:![]:!![]})[_0xe630('0xa')](function(_0x22fa75){logger[_0xe630('0xb')](_0xe630('0x16'),_0x3dbcf6);logger[_0xe630('0xc')](_0xe630('0x16'),_0x3dbcf6,JSON['stringify'](_0x22fa75));_0xafcf13(_0x22fa75);})[_0xe630('0x15')](function(_0x35e869){logger[_0xe630('0x10')]('CreateAttachment',_0x35e869[_0xe630('0x13')],_0x3dbcf6);_0x79213e(_0x9721fa[_0xe630('0x10')](0x1f4,_0x35e869[_0xe630('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index dd59057..bf9b101 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(_0x1f7c3d,_0x9bb771){var _0x294b3d=function(_0x4f2f7c){while(--_0x4f2f7c){_0x1f7c3d['push'](_0x1f7c3d['shift']());}};_0x294b3d(++_0x9bb771);}(_0x5f2f,0x73));var _0xf5f2=function(_0x368b5e,_0x308adf){_0x368b5e=_0x368b5e-0x0;var _0x17e983=_0x5f2f[_0x368b5e];return _0x17e983;};'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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x4db1c8,_0x2d142e){var _0x3ab9bc=function(_0x5acfc9){while(--_0x5acfc9){_0x4db1c8['push'](_0x4db1c8['shift']());}};_0x3ab9bc(++_0x2d142e);}(_0x757a,0xde));var _0xa757=function(_0x31e5e2,_0x1b5d16){_0x31e5e2=_0x31e5e2-0x0;var _0xabcd3d=_0x757a[_0x31e5e2];return _0xabcd3d;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index cf9bffd..ee2804f 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ca4=['../../config/environment','../../config/logger','api','activedirectory','username','baseDN','url','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','salt','disabled','blockedAt','admin','user','name','domain','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','error','ActiveDirectory\x20Not\x20Configured','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','passport','passport-local','Strategy','../../mysqldb','../../components/auth/service','../../config/utils'];(function(_0x26e924,_0x2561e4){var _0x5eec3d=function(_0x11aea5){while(--_0x11aea5){_0x26e924['push'](_0x26e924['shift']());}};_0x5eec3d(++_0x2561e4);}(_0x3ca4,0x17d));var _0x43ca=function(_0x32b422,_0x15a565){_0x32b422=_0x32b422-0x0;var _0x58e399=_0x3ca4[_0x32b422];return _0x58e399;};'use strict';var passport=require(_0x43ca('0x0'));var LocalStrategy=require(_0x43ca('0x1'))[_0x43ca('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var db=require(_0x43ca('0x3'))['db'];var authService=require(_0x43ca('0x4'));var utils=require(_0x43ca('0x5'));var config=require(_0x43ca('0x6'));var logger=require(_0x43ca('0x7'))(_0x43ca('0x8'));function ActiveDirectoryAuthenticate(_0x404034,_0x4f017e,_0x14c38c,_0x1ba987){var _0x2e6edf,_0x609e75;if(config[_0x43ca('0x9')]&&config[_0x43ca('0x9')][_0x43ca('0xa')]&&config[_0x43ca('0x9')]['password']&&config['activedirectory'][_0x43ca('0xb')]&&config[_0x43ca('0x9')][_0x43ca('0xc')]&&config[_0x43ca('0x9')]['domain']){var _0x41518b=new ActiveDirectory(config[_0x43ca('0x9')]);return db[_0x43ca('0xd')][_0x43ca('0xe')]({'where':{'id':0x1},'attributes':[_0x43ca('0xf'),_0x43ca('0x10')],'raw':!![]})[_0x43ca('0x11')](function(_0x2ede07){_0x2e6edf=_0x2ede07;return _0x404034[_0x43ca('0xe')]({'attributes':['id','name',_0x43ca('0x12'),_0x43ca('0x13'),'role',_0x43ca('0x14'),'blocked',_0x43ca('0x15'),'loginAttempts'],'where':{'name':_0x4f017e,'role':{'$or':[_0x43ca('0x16'),_0x43ca('0x17'),'agent']},'adSsoEnabled':!![]}});})[_0x43ca('0x11')](function(_0x366180){if(!_0x366180||_0x366180&&_0x366180[_0x43ca('0x18')]!==_0x4f017e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x609e75=_0x366180;return _0x609e75;}})['then'](function(){var _0x48a75c=_0x609e75['name']+'@'+config[_0x43ca('0x9')][_0x43ca('0x19')];_0x41518b[_0x43ca('0x1a')](_0x48a75c,_0x14c38c,function(_0x5296b9,_0x3f5258){if(_0x5296b9){return _0x1ba987(_0x5296b9);}else if(!_0x3f5258){if(_0x609e75){if(_0x609e75[_0x43ca('0x14')]){return _0x1ba987(_0x43ca('0x1b'));}else if(_0x2e6edf['blockDuration']>0x0){if(_0x609e75[_0x43ca('0x1c')]){if(moment(_0x609e75['blockedAt'])[_0x43ca('0x1d')](_0x2e6edf[_0x43ca('0x10')],_0x43ca('0x1e'))>moment()){return _0x1ba987('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x43ca('0x1f')](_0x609e75,0x0,![],null)[_0x43ca('0x11')](function(){return utils[_0x43ca('0x20')](_0x609e75);})[_0x43ca('0x11')](function(){return _0x1ba987(null,_0x609e75);});}}else{return utils[_0x43ca('0x20')](_0x609e75)['then'](function(){return _0x1ba987(null,_0x609e75);});}}else{return utils[_0x43ca('0x20')](_0x609e75)[_0x43ca('0x11')](function(){return _0x1ba987(null,_0x609e75);});}}}});})['catch'](function(_0x379902){return _0x1ba987(null,![],_0x379902);});}else{logger[_0x43ca('0x21')](_0x43ca('0x22'));}}function handleError(_0x3bc9ae,_0x450897,_0x544130){return _0x3bc9ae[_0x43ca('0x23')](_0x450897||0x1f4)[_0x43ca('0x24')]({'message':_0x544130?_0x544130[_0x43ca('0x25')]||_0x544130:''});}exports[_0x43ca('0x26')]=function(_0x14287e,_0x1de54b,_0x3b2078){passport[_0x43ca('0x1a')]('ad-local',function(_0x4c6b44,_0x4a75af,_0x137877){var _0x3a2e47=_0x4c6b44||_0x137877;if(_0x3a2e47){return handleError(_0x1de54b,0x191,_0x3a2e47);}if(!_0x4a75af){return handleError(_0x1de54b,0x194,{'message':_0x43ca('0x27')});}else{var _0x9d09b9={'payload':{'id':_0x4a75af['id'],'role':_0x4a75af[_0x43ca('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0x43ca('0x29')](_0x9d09b9)[_0x43ca('0x11')](function(_0x3f0b2b){_0x1de54b['json']({'id':_0x4a75af['id'],'token':_0x3f0b2b,'statusCall':'','isAlreadyLogged':_0x4a75af[_0x43ca('0x2a')]});});}})(_0x14287e,_0x1de54b,_0x3b2078);};passport['use']('ad-login',new LocalStrategy({'usernameField':_0x43ca('0x18'),'passwordField':_0x43ca('0x12')},function(_0x313518,_0x359b7c,_0x248ec3){return ActiveDirectoryAuthenticate(db['User'],_0x313518,_0x359b7c,_0x248ec3);})); \ No newline at end of file +var _0x2caf=['authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','add','minutes','clearBlockUser','getLicense','catch','error','ActiveDirectory\x20Not\x20Configured','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','ad-login','moment','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','username','password','url','domain','findOne','allowedLoginAttempts','then','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name'];(function(_0x321d5e,_0x1ae4a9){var _0x3458cd=function(_0x120f19){while(--_0x120f19){_0x321d5e['push'](_0x321d5e['shift']());}};_0x3458cd(++_0x1ae4a9);}(_0x2caf,0x6a));var _0xf2ca=function(_0x49d184,_0x3159af){_0x49d184=_0x49d184-0x0;var _0x5b4378=_0x2caf[_0x49d184];return _0x5b4378;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require(_0xf2ca('0x0'));var ActiveDirectory=require('activedirectory2');var db=require(_0xf2ca('0x1'))['db'];var authService=require(_0xf2ca('0x2'));var utils=require(_0xf2ca('0x3'));var config=require(_0xf2ca('0x4'));var logger=require(_0xf2ca('0x5'))(_0xf2ca('0x6'));function ActiveDirectoryAuthenticate(_0x1a56cd,_0x51372a,_0x8ce770,_0x4292b4){var _0x16cabd,_0x57e3e8;if(config['activedirectory']&&config[_0xf2ca('0x7')][_0xf2ca('0x8')]&&config[_0xf2ca('0x7')][_0xf2ca('0x9')]&&config[_0xf2ca('0x7')]['baseDN']&&config[_0xf2ca('0x7')][_0xf2ca('0xa')]&&config[_0xf2ca('0x7')][_0xf2ca('0xb')]){var _0x1ff621=new ActiveDirectory(config[_0xf2ca('0x7')]);return db['Setting'][_0xf2ca('0xc')]({'where':{'id':0x1},'attributes':[_0xf2ca('0xd'),'blockDuration'],'raw':!![]})[_0xf2ca('0xe')](function(_0x383112){_0x16cabd=_0x383112;return _0x1a56cd['findOne']({'attributes':['id','name',_0xf2ca('0x9'),'salt',_0xf2ca('0xf'),_0xf2ca('0x10'),_0xf2ca('0x11'),_0xf2ca('0x12'),_0xf2ca('0x13')],'where':{'name':_0x51372a,'role':{'$or':[_0xf2ca('0x14'),_0xf2ca('0x15'),'agent']},'adSsoEnabled':!![]}});})[_0xf2ca('0xe')](function(_0x4ea298){if(!_0x4ea298||_0x4ea298&&_0x4ea298[_0xf2ca('0x16')]!==_0x51372a){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x57e3e8=_0x4ea298;return _0x57e3e8;}})[_0xf2ca('0xe')](function(){var _0x6a2b25=_0x57e3e8['name']+'@'+config[_0xf2ca('0x7')][_0xf2ca('0xb')];_0x1ff621[_0xf2ca('0x17')](_0x6a2b25,_0x8ce770,function(_0x310504,_0x4581e4){if(_0x310504){return _0x4292b4(_0x310504);}else if(!_0x4581e4){if(_0x57e3e8){if(_0x57e3e8[_0xf2ca('0x10')]){return _0x4292b4(_0xf2ca('0x18'));}else if(_0x16cabd[_0xf2ca('0x19')]>0x0){if(_0x57e3e8[_0xf2ca('0x11')]){if(moment(_0x57e3e8[_0xf2ca('0x12')])[_0xf2ca('0x1a')](_0x16cabd['blockDuration'],_0xf2ca('0x1b'))>moment()){return _0x4292b4(_0xf2ca('0x18'));}else{return utils[_0xf2ca('0x1c')](_0x57e3e8,0x0,![],null)[_0xf2ca('0xe')](function(){return utils[_0xf2ca('0x1d')](_0x57e3e8);})[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}else{return utils[_0xf2ca('0x1d')](_0x57e3e8)[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}else{return utils['getLicense'](_0x57e3e8)[_0xf2ca('0xe')](function(){return _0x4292b4(null,_0x57e3e8);});}}}});})[_0xf2ca('0x1e')](function(_0x56ebed){return _0x4292b4(null,![],_0x56ebed);});}else{logger[_0xf2ca('0x1f')](_0xf2ca('0x20'));}}function handleError(_0x106e6f,_0x509e33,_0x5a5a73){return _0x106e6f[_0xf2ca('0x21')](_0x509e33||0x1f4)[_0xf2ca('0x22')]({'message':_0x5a5a73?_0x5a5a73[_0xf2ca('0x23')]||_0x5a5a73:''});}exports[_0xf2ca('0x24')]=function(_0x1255ba,_0x427a17,_0x339e10){passport[_0xf2ca('0x17')]('ad-local',function(_0x18bca4,_0x2b09a3,_0x3b5597){var _0x1b36e0=_0x18bca4||_0x3b5597;if(_0x1b36e0){return handleError(_0x427a17,0x191,_0x1b36e0);}if(!_0x2b09a3){return handleError(_0x427a17,0x194,{'message':_0xf2ca('0x25')});}else{var _0x41fc04={'payload':{'id':_0x2b09a3['id'],'role':_0x2b09a3[_0xf2ca('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xf2ca('0x26')](_0x41fc04)[_0xf2ca('0xe')](function(_0x20a523){_0x427a17[_0xf2ca('0x27')]({'id':_0x2b09a3['id'],'token':_0x20a523,'statusCall':'','isAlreadyLogged':_0x2b09a3[_0xf2ca('0x28')]});});}})(_0x1255ba,_0x427a17,_0x339e10);};passport[_0xf2ca('0x29')](_0xf2ca('0x2a'),new LocalStrategy({'usernameField':_0xf2ca('0x16'),'passwordField':_0xf2ca('0x9')},function(_0x2a9a1f,_0x440888,_0x270a5d){return ActiveDirectoryAuthenticate(db['User'],_0x2a9a1f,_0x440888,_0x270a5d);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 5b93631..0f5856f 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e57=['login','./authActiveDirectory.controller','post'];(function(_0x66dc52,_0x3a9361){var _0x710479=function(_0x2d0c50){while(--_0x2d0c50){_0x66dc52['push'](_0x66dc52['shift']());}};_0x710479(++_0x3a9361);}(_0x2e57,0xca));var _0x72e5=function(_0x73ced5,_0x58d7a5){_0x73ced5=_0x73ced5-0x0;var _0x3009b7=_0x2e57[_0x73ced5];return _0x3009b7;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x72e5('0x0'));router[_0x72e5('0x1')]('/',controller[_0x72e5('0x2')]);module['exports']=router; \ No newline at end of file +var _0x0aba=['Router','./authActiveDirectory.controller','post','login'];(function(_0x34efea,_0x3a160e){var _0x2fa720=function(_0x28d71b){while(--_0x28d71b){_0x34efea['push'](_0x34efea['shift']());}};_0x2fa720(++_0x3a160e);}(_0x0aba,0x1dc));var _0xa0ab=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0aba[_0x2641f9];return _0x585741;};'use strict';var express=require('express');var router=express[_0xa0ab('0x0')]();var controller=require(_0xa0ab('0x1'));router[_0xa0ab('0x2')]('/',controller[_0xa0ab('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5a38109..6447456 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x145c38,_0x28d21d){var _0x124a0a=function(_0x2a71b6){while(--_0x2a71b6){_0x145c38['push'](_0x145c38['shift']());}};_0x124a0a(++_0x28d21d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x23a731,_0x30326f){var _0xa4fd72=function(_0x586239){while(--_0x586239){_0x23a731['push'](_0x23a731['shift']());}};_0xa4fd72(++_0x30326f);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index c1cd9c1..c52cd02 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 _0x67c2=['get','/callback','callback','isMiddleware','login','exports','express','Router','../user/user.controller.js'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0x67c2,0xc3));var _0x267c=function(_0x1f89ee,_0x413506){_0x1f89ee=_0x1f89ee-0x0;var _0x541e81=_0x67c2[_0x1f89ee];return _0x541e81;};'use strict';var express=require(_0x267c('0x0'));var passport=require('passport');var router=express[_0x267c('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x267c('0x2'));var authService=require('../../components/auth/service');router[_0x267c('0x3')]('/',controller['login']);router[_0x267c('0x3')](_0x267c('0x4'),controller[_0x267c('0x5')],authService[_0x267c('0x6')],userController[_0x267c('0x7')],authService['setTokenCookie']);module[_0x267c('0x8')]=router; \ No newline at end of file +var _0xbb97=['exports','express','Router','../user/user.controller.js','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x510053,_0x39166f){var _0x25007c=function(_0x23ccdc){while(--_0x23ccdc){_0x510053['push'](_0x510053['shift']());}};_0x25007c(++_0x39166f);}(_0xbb97,0x10f));var _0x7bb9=function(_0x1fb0b3,_0x416803){_0x1fb0b3=_0x1fb0b3-0x0;var _0xbc4652=_0xbb97[_0x1fb0b3];return _0xbc4652;};'use strict';var express=require(_0x7bb9('0x0'));var passport=require('passport');var router=express[_0x7bb9('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x7bb9('0x2'));var authService=require(_0x7bb9('0x3'));router[_0x7bb9('0x4')]('/',controller[_0x7bb9('0x5')]);router[_0x7bb9('0x4')]('/callback',controller[_0x7bb9('0x6')],authService[_0x7bb9('0x7')],userController['login'],authService[_0x7bb9('0x8')]);module[_0x7bb9('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 771193a..ce232dd 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 _0x09a6=['use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','\x22%s\x22\x20<%s>','email','request','format','message','error','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!'];(function(_0x3f3125,_0x3f49d2){var _0x28bf12=function(_0xb9d9cb){while(--_0xb9d9cb){_0x3f3125['push'](_0x3f3125['shift']());}};_0x28bf12(++_0x3f49d2);}(_0x09a6,0x112));var _0x609a=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0x09a6[_0x10df18];return _0x1f9a1d;};'use strict';var util=require(_0x609a('0x0'));var passport=require(_0x609a('0x1'));var LocalStrategy=require(_0x609a('0x2'))[_0x609a('0x3')];var jayson=require(_0x609a('0x4'));var _=require(_0x609a('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x609a('0x6'))['db'];var authService=require(_0x609a('0x7'));var utils=require(_0x609a('0x8'));var client=jayson[_0x609a('0x9')][_0x609a('0xa')]({'port':0x232b});function localAuthenticate(_0x5b093f,_0x265f0e,_0x4ecc9f,_0x208ba1){var _0x21df7e,_0x63ca20;return db[_0x609a('0xb')][_0x609a('0xc')]({'where':{'id':0x1},'attributes':[_0x609a('0xd'),_0x609a('0xe')],'raw':!![]})[_0x609a('0xf')](function(_0x3bf6ec){_0x21df7e=_0x3bf6ec;return _0x5b093f[_0x609a('0xc')]({'attributes':['id',_0x609a('0x10'),_0x609a('0x11'),_0x609a('0x12'),_0x609a('0x13'),_0x609a('0x14'),_0x609a('0x15'),_0x609a('0x16'),_0x609a('0x17')],'where':{'name':_0x265f0e,'role':{'$or':[_0x609a('0x18'),_0x609a('0x19'),_0x609a('0x1a')]}}});})[_0x609a('0xf')](function(_0x557d1a){if(!_0x557d1a||_0x557d1a&&_0x557d1a[_0x609a('0x10')]!==_0x265f0e){throw new Error(_0x609a('0x1b'));}else{_0x63ca20=_0x557d1a;return _0x63ca20;}})[_0x609a('0xf')](function(){_0x63ca20[_0x609a('0x1c')](_0x4ecc9f,function(_0x11276d,_0x54c4be){var _0xa750dd=_0x63ca20[_0x609a('0x17')]+0x1;if(_0x11276d){return _0x208ba1(_0x11276d);}else if(!_0x54c4be){if(_0x63ca20[_0x609a('0x14')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else if(_0x21df7e['allowedLoginAttempts']>0x0){if(_0x63ca20['blocked']){if(_0x21df7e[_0x609a('0xe')]>0x0){if(moment(_0x63ca20[_0x609a('0x16')])['add'](_0x21df7e[_0x609a('0xe')],_0x609a('0x1d'))>moment()){return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x609a('0x1e')](_0x63ca20,_0xa750dd,![],null)['then'](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}}else{return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xa750dd>=_0x21df7e['allowedLoginAttempts']){return utils[_0x609a('0x1e')](_0x63ca20,0x0,!![],moment())[_0x609a('0xf')](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}else{return utils[_0x609a('0x1e')](_0x63ca20,_0xa750dd,![],null)[_0x609a('0xf')](function(){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});});}}}else{return _0x208ba1(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x63ca20[_0x609a('0x14')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else if(_0x21df7e[_0x609a('0xd')]>0x0){if(_0x63ca20['blocked']){if(_0x21df7e[_0x609a('0xe')]>0x0){if(moment(_0x63ca20['blockedAt'])[_0x609a('0x1f')](_0x21df7e[_0x609a('0xe')],_0x609a('0x1d'))>moment()){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else{return utils['clearBlockUser'](_0x63ca20,0x0,![],null)[_0x609a('0xf')](function(){return utils[_0x609a('0x20')](_0x63ca20);})[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);});}}else{return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}}else{return utils['clearBlockUser'](_0x63ca20,0x0,![],null)[_0x609a('0xf')](function(){return utils['getLicense'](_0x63ca20);})[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);})[_0x609a('0x21')](function(_0x4a6789){return _0x208ba1(null,![],_0x4a6789);});}}else{if(_0x63ca20[_0x609a('0x15')]){return _0x208ba1(null,![],{'message':_0x609a('0x1b')});}else{return utils[_0x609a('0x20')](_0x63ca20)[_0x609a('0xf')](function(){return _0x208ba1(null,_0x63ca20);});}}}});})[_0x609a('0x21')](function(_0x4004a4){return _0x208ba1(null,![],_0x4004a4);});}function sendServiceMail(_0x3ba872){return db[_0x609a('0x22')][_0x609a('0x23')]({'where':{'service':!![]},'attributes':['id',_0x609a('0x10'),'email'],'include':[{'model':db[_0x609a('0x24')],'as':_0x609a('0x25')}]})[_0x609a('0xf')](function(_0x503cf4){if(!_0x503cf4){throw new Error(_0x609a('0x26'));}var _0x3e8411={'tls':{'rejectUnauthorized':![]}};if(_0x503cf4[_0x609a('0x25')][_0x609a('0x27')]){_0x3e8411[_0x609a('0x27')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x27')];}else{_0x3e8411[_0x609a('0x28')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x28')];_0x3e8411[_0x609a('0x29')]=_0x503cf4[_0x609a('0x25')][_0x609a('0x29')];_0x3e8411['secure']=_0x503cf4[_0x609a('0x25')][_0x609a('0x2a')];}if(_0x503cf4[_0x609a('0x25')][_0x609a('0x2b')]){_0x3e8411[_0x609a('0x2c')]={'user':_0x503cf4[_0x609a('0x25')][_0x609a('0x19')],'pass':_0x503cf4[_0x609a('0x25')]['pass']};}var _0x14888b={'account':_0x3e8411,'message':_['merge']({'from':util['format'](_0x609a('0x2d'),_0x503cf4[_0x609a('0x10')],_0x503cf4[_0x609a('0x2e')]||_0x503cf4[_0x609a('0x25')][_0x609a('0x19')])},_0x3ba872)};return client[_0x609a('0x2f')]('SendMail',_0x14888b);})[_0x609a('0xf')](function(_0x58ad97){if(_0x58ad97['error']){throw new Error(util[_0x609a('0x30')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x58ad97['error'][_0x609a('0x31')]||JSON['stringify'](_0x58ad97[_0x609a('0x32')])));}return!![];});}function handleError(_0xff2f33,_0x3564ba,_0xef9c20){return _0xff2f33['status'](_0x3564ba||0x1f4)['send']({'message':_0xef9c20?_0xef9c20[_0x609a('0x31')]||_0xef9c20:''});}exports[_0x609a('0x33')]=function(_0x44b911,_0x12c2f8,_0x3c5d6d){passport[_0x609a('0x1c')](_0x609a('0x34'),function(_0x195682,_0x2ff336,_0x18dcb5){var _0x27d489=_0x195682||_0x18dcb5;if(_0x27d489){return handleError(_0x12c2f8,0x191,_0x27d489);}if(!_0x2ff336){return handleError(_0x12c2f8,0x194,{'message':_0x609a('0x35')});}else{var _0x13effe={'payload':{'id':_0x2ff336['id'],'role':_0x2ff336[_0x609a('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x609a('0x36')](_0x13effe)['then'](function(_0x1b2c3f){_0x12c2f8[_0x609a('0x37')]({'id':_0x2ff336['id'],'token':_0x1b2c3f,'statusCall':'','isAlreadyLogged':_0x2ff336[_0x609a('0x38')]});});}})(_0x44b911,_0x12c2f8,_0x3c5d6d);};exports[_0x609a('0x39')]=function(_0x1664bb,_0x53af89,_0x2ef226){if(!_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')]){return handleError(_0x53af89,0x1f4,{'message':_0x609a('0x3b')});}var _0x1d9d34=rs[_0x609a('0x3c')]();_0x1664bb[_0x609a('0x3a')]['email']=_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')][_0x609a('0x3d')]()[_0x609a('0x3e')]();var _0x33949d;return db[_0x609a('0xb')][_0x609a('0xc')]({'where':{'id':0x1},'attributes':[_0x609a('0xd'),_0x609a('0xe')],'raw':!![]})[_0x609a('0xf')](function(_0x197b49){_0x33949d=_0x197b49;return db['User'][_0x609a('0x23')]({'where':{'email':_0x1664bb[_0x609a('0x3a')][_0x609a('0x2e')]}});})['then'](function(_0x211870){if(!_0x211870){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x211870['disabled']){throw new Error(_0x609a('0x3f'));}if(_0x211870[_0x609a('0x15')]){if(moment(_0x211870['blockedAt'])[_0x609a('0x1f')](_0x33949d[_0x609a('0xe')],'minutes')>moment()){throw new Error(_0x609a('0x40'));}else{_0x211870[_0x609a('0x15')]=![];_0x211870[_0x609a('0x16')]=null;}}_0x211870[_0x609a('0x41')]=_0x1d9d34;_0x211870[_0x609a('0x42')]=Date[_0x609a('0x43')]()+0x36ee80;return _0x211870[_0x609a('0x44')]();})[_0x609a('0xf')](function(){return sendServiceMail({'to':_0x1664bb[_0x609a('0x3a')]['email'],'subject':_0x609a('0x45'),'text':_0x609a('0x46')+_0x609a('0x47')+'https://'+_0x1664bb[_0x609a('0x48')][_0x609a('0x28')]+_0x609a('0x49')+_0x1d9d34+'\x0a\x0a'+_0x609a('0x4a')});})[_0x609a('0xf')](function(){_0x53af89[_0x609a('0x4b')](0xc8)[_0x609a('0x4c')]({'message':_0x609a('0x4d')});})['catch'](function(_0x4c18e6){return handleError(_0x53af89,0x1f4,_0x4c18e6);});};exports[_0x609a('0x4e')]=function(_0x177f46,_0x281e40,_0x41ddab){return db[_0x609a('0x4f')][_0x609a('0x23')]({'where':{'resetPasswordToken':_0x177f46[_0x609a('0x50')][_0x609a('0x51')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x609a('0xf')](function(_0x10891f){if(!_0x10891f){throw new Error(_0x609a('0x52'));}return db['Setting'][_0x609a('0xc')]({'attributes':['id',_0x609a('0x53'),_0x609a('0x54'),'passwordHistoryLimit']})[_0x609a('0xf')](function(_0x504faf){if(_0x504faf[_0x609a('0x53')])authService[_0x609a('0x55')](_0x177f46[_0x609a('0x3a')][_0x609a('0x11')]);if(!_0x504faf[_0x609a('0x54')]||!_0x10891f[_0x609a('0x56')])return _0x10891f;authService[_0x609a('0x57')](_0x177f46[_0x609a('0x3a')][_0x609a('0x11')],_0x10891f[_0x609a('0x56')],_0x504faf[_0x609a('0x58')]);return _0x10891f;})['then'](function(){_0x10891f[_0x609a('0x11')]=_0x177f46['body']['password'];_0x10891f[_0x609a('0x41')]=null;_0x10891f[_0x609a('0x42')]=null;return _0x10891f[_0x609a('0x44')]();});})['then'](function(){_0x281e40[_0x609a('0x4b')](0xc8)[_0x609a('0x4c')]({'message':_0x609a('0x59')});})[_0x609a('0x21')](function(_0x3ea0d8){return handleError(_0x281e40,0x1f4,_0x3ea0d8);});};passport[_0x609a('0x5a')](_0x609a('0x34'),new LocalStrategy({'usernameField':'name','passwordField':_0x609a('0x11')},function(_0x1da257,_0xcdfccc,_0x4b64de){return localAuthenticate(db[_0x609a('0x4f')],_0x1da257,_0xcdfccc,_0x4b64de);})); \ No newline at end of file +var _0xedf4=['minutes','disabled','clearBlockUser','getLicense','catch','MailAccount','find','name','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','authentication','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/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','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','save','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','add'];(function(_0x5a2d95,_0xb362e5){var _0x2c3986=function(_0x5cce7c){while(--_0x5cce7c){_0x5a2d95['push'](_0x5a2d95['shift']());}};_0x2c3986(++_0xb362e5);}(_0xedf4,0x146));var _0x4edf=function(_0x39e6aa,_0x1d8d4c){_0x39e6aa=_0x39e6aa-0x0;var _0x148da0=_0xedf4[_0x39e6aa];return _0x148da0;};'use strict';var util=require(_0x4edf('0x0'));var passport=require('passport');var LocalStrategy=require(_0x4edf('0x1'))[_0x4edf('0x2')];var jayson=require(_0x4edf('0x3'));var _=require(_0x4edf('0x4'));var rs=require(_0x4edf('0x5'));var moment=require(_0x4edf('0x6'));var db=require(_0x4edf('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x4edf('0x8')][_0x4edf('0x9')]({'port':0x232b});function localAuthenticate(_0xe8c969,_0x2ac9aa,_0x1a8423,_0x3d954a){var _0x37ea62,_0x71b00c;return db[_0x4edf('0xa')][_0x4edf('0xb')]({'where':{'id':0x1},'attributes':[_0x4edf('0xc'),'blockDuration'],'raw':!![]})[_0x4edf('0xd')](function(_0x381157){_0x37ea62=_0x381157;return _0xe8c969[_0x4edf('0xb')]({'attributes':['id','name',_0x4edf('0xe'),_0x4edf('0xf'),_0x4edf('0x10'),'disabled',_0x4edf('0x11'),'blockedAt',_0x4edf('0x12')],'where':{'name':_0x2ac9aa,'role':{'$or':['admin',_0x4edf('0x13'),_0x4edf('0x14')]}}});})[_0x4edf('0xd')](function(_0x1a4a56){if(!_0x1a4a56||_0x1a4a56&&_0x1a4a56['name']!==_0x2ac9aa){throw new Error(_0x4edf('0x15'));}else{_0x71b00c=_0x1a4a56;return _0x71b00c;}})['then'](function(){_0x71b00c[_0x4edf('0x16')](_0x1a8423,function(_0x564797,_0x5124c8){var _0x342241=_0x71b00c[_0x4edf('0x12')]+0x1;if(_0x564797){return _0x3d954a(_0x564797);}else if(!_0x5124c8){if(_0x71b00c['disabled']){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else if(_0x37ea62[_0x4edf('0xc')]>0x0){if(_0x71b00c[_0x4edf('0x11')]){if(_0x37ea62[_0x4edf('0x17')]>0x0){if(moment(_0x71b00c[_0x4edf('0x18')])[_0x4edf('0x19')](_0x37ea62['blockDuration'],_0x4edf('0x1a'))>moment()){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils['clearBlockUser'](_0x71b00c,_0x342241,![],null)['then'](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}}else{return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x342241>=_0x37ea62[_0x4edf('0xc')]){return utils['clearBlockUser'](_0x71b00c,0x0,!![],moment())[_0x4edf('0xd')](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}else{return utils['clearBlockUser'](_0x71b00c,_0x342241,![],null)[_0x4edf('0xd')](function(){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});});}}}else{return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}}else{if(_0x71b00c[_0x4edf('0x1b')]){return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x37ea62['allowedLoginAttempts']>0x0){if(_0x71b00c[_0x4edf('0x11')]){if(_0x37ea62[_0x4edf('0x17')]>0x0){if(moment(_0x71b00c[_0x4edf('0x18')])[_0x4edf('0x19')](_0x37ea62[_0x4edf('0x17')],_0x4edf('0x1a'))>moment()){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils[_0x4edf('0x1c')](_0x71b00c,0x0,![],null)[_0x4edf('0xd')](function(){return utils['getLicense'](_0x71b00c);})[_0x4edf('0xd')](function(){return _0x3d954a(null,_0x71b00c);});}}else{return _0x3d954a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x4edf('0x1c')](_0x71b00c,0x0,![],null)[_0x4edf('0xd')](function(){return utils['getLicense'](_0x71b00c);})[_0x4edf('0xd')](function(){return _0x3d954a(null,_0x71b00c);})['catch'](function(_0x55f752){return _0x3d954a(null,![],_0x55f752);});}}else{if(_0x71b00c[_0x4edf('0x11')]){return _0x3d954a(null,![],{'message':_0x4edf('0x15')});}else{return utils[_0x4edf('0x1d')](_0x71b00c)['then'](function(){return _0x3d954a(null,_0x71b00c);});}}}});})[_0x4edf('0x1e')](function(_0xbf80eb){return _0x3d954a(null,![],_0xbf80eb);});}function sendServiceMail(_0x4e3d71){return db[_0x4edf('0x1f')][_0x4edf('0x20')]({'where':{'service':!![]},'attributes':['id',_0x4edf('0x21'),'email'],'include':[{'model':db[_0x4edf('0x22')],'as':_0x4edf('0x23')}]})[_0x4edf('0xd')](function(_0x13d61e){if(!_0x13d61e){throw new Error(_0x4edf('0x24'));}var _0x44ef42={'tls':{'rejectUnauthorized':![]}};if(_0x13d61e[_0x4edf('0x23')][_0x4edf('0x25')]){_0x44ef42['service']=_0x13d61e[_0x4edf('0x23')]['service'];}else{_0x44ef42[_0x4edf('0x26')]=_0x13d61e['Smtp'][_0x4edf('0x26')];_0x44ef42['port']=_0x13d61e[_0x4edf('0x23')]['port'];_0x44ef42[_0x4edf('0x27')]=_0x13d61e[_0x4edf('0x23')]['secure'];}if(_0x13d61e[_0x4edf('0x23')][_0x4edf('0x28')]){_0x44ef42['auth']={'user':_0x13d61e[_0x4edf('0x23')][_0x4edf('0x13')],'pass':_0x13d61e['Smtp']['pass']};}var _0xe6d1ba={'account':_0x44ef42,'message':_[_0x4edf('0x29')]({'from':util['format'](_0x4edf('0x2a'),_0x13d61e[_0x4edf('0x21')],_0x13d61e['email']||_0x13d61e[_0x4edf('0x23')][_0x4edf('0x13')])},_0x4e3d71)};return client[_0x4edf('0x2b')](_0x4edf('0x2c'),_0xe6d1ba);})[_0x4edf('0xd')](function(_0x547a1c){if(_0x547a1c[_0x4edf('0x2d')]){throw new Error(util[_0x4edf('0x2e')](_0x4edf('0x2f'),_0x547a1c[_0x4edf('0x2d')][_0x4edf('0x30')]||JSON[_0x4edf('0x31')](_0x547a1c[_0x4edf('0x2d')])));}return!![];});}function handleError(_0x227c1b,_0x65b002,_0x467f9f){return _0x227c1b[_0x4edf('0x32')](_0x65b002||0x1f4)[_0x4edf('0x33')]({'message':_0x467f9f?_0x467f9f[_0x4edf('0x30')]||_0x467f9f:''});}exports[_0x4edf('0x34')]=function(_0x1b7559,_0x2f44c3,_0x5b2c99){passport[_0x4edf('0x16')](_0x4edf('0x35'),function(_0x1807ad,_0x5e0bcb,_0x40b987){var _0x172ee1=_0x1807ad||_0x40b987;if(_0x172ee1){return handleError(_0x2f44c3,0x191,_0x172ee1);}if(!_0x5e0bcb){return handleError(_0x2f44c3,0x194,{'message':_0x4edf('0x36')});}else{var _0xc2186c={'payload':{'id':_0x5e0bcb['id'],'role':_0x5e0bcb['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0xc2186c)[_0x4edf('0xd')](function(_0x3f9d09){_0x2f44c3[_0x4edf('0x37')]({'id':_0x5e0bcb['id'],'token':_0x3f9d09,'statusCall':'','isAlreadyLogged':_0x5e0bcb[_0x4edf('0x38')]});});}})(_0x1b7559,_0x2f44c3,_0x5b2c99);};exports[_0x4edf('0x39')]=function(_0x2a7a6b,_0x539728,_0x2fed77){if(!_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')]){return handleError(_0x539728,0x1f4,{'message':_0x4edf('0x3c')});}var _0x251f10=rs['generate']();_0x2a7a6b['body']['email']=_0x2a7a6b[_0x4edf('0x3a')]['email'][_0x4edf('0x3d')]()[_0x4edf('0x3e')]();var _0x29f050;return db[_0x4edf('0xa')][_0x4edf('0xb')]({'where':{'id':0x1},'attributes':[_0x4edf('0xc'),'blockDuration'],'raw':!![]})[_0x4edf('0xd')](function(_0x59adb4){_0x29f050=_0x59adb4;return db[_0x4edf('0x3f')][_0x4edf('0x20')]({'where':{'email':_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')]}});})[_0x4edf('0xd')](function(_0x398a2e){if(!_0x398a2e){throw new Error(_0x4edf('0x40'));}if(_0x398a2e['disabled']){throw new Error(_0x4edf('0x41'));}if(_0x398a2e[_0x4edf('0x11')]){if(moment(_0x398a2e[_0x4edf('0x18')])[_0x4edf('0x19')](_0x29f050['blockDuration'],_0x4edf('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x398a2e[_0x4edf('0x11')]=![];_0x398a2e[_0x4edf('0x18')]=null;}}_0x398a2e[_0x4edf('0x42')]=_0x251f10;_0x398a2e[_0x4edf('0x43')]=Date[_0x4edf('0x44')]()+0x36ee80;return _0x398a2e['save']();})[_0x4edf('0xd')](function(){return sendServiceMail({'to':_0x2a7a6b[_0x4edf('0x3a')][_0x4edf('0x3b')],'subject':_0x4edf('0x45'),'text':_0x4edf('0x46')+_0x4edf('0x47')+_0x4edf('0x48')+_0x2a7a6b['headers'][_0x4edf('0x26')]+_0x4edf('0x49')+_0x251f10+'\x0a\x0a'+_0x4edf('0x4a')});})[_0x4edf('0xd')](function(){_0x539728['status'](0xc8)['send']({'message':_0x4edf('0x4b')});})[_0x4edf('0x1e')](function(_0x22ebbb){return handleError(_0x539728,0x1f4,_0x22ebbb);});};exports[_0x4edf('0x4c')]=function(_0x58383c,_0x57171a,_0x581f25){return db[_0x4edf('0x3f')][_0x4edf('0x20')]({'where':{'resetPasswordToken':_0x58383c[_0x4edf('0x4d')][_0x4edf('0x4e')],'resetPasswordExpires':{'$gt':Date[_0x4edf('0x44')]()}}})[_0x4edf('0xd')](function(_0x2c12e9){if(!_0x2c12e9){throw new Error(_0x4edf('0x4f'));}return db['Setting'][_0x4edf('0xb')]({'attributes':['id',_0x4edf('0x50'),'enforcePasswordHistory',_0x4edf('0x51')]})[_0x4edf('0xd')](function(_0x1eb3b4){if(_0x1eb3b4[_0x4edf('0x50')])authService[_0x4edf('0x52')](_0x58383c[_0x4edf('0x3a')][_0x4edf('0xe')]);if(!_0x1eb3b4[_0x4edf('0x53')]||!_0x2c12e9['previousPasswords'])return _0x2c12e9;authService[_0x4edf('0x54')](_0x58383c[_0x4edf('0x3a')][_0x4edf('0xe')],_0x2c12e9['previousPasswords'],_0x1eb3b4[_0x4edf('0x51')]);return _0x2c12e9;})['then'](function(){_0x2c12e9[_0x4edf('0xe')]=_0x58383c[_0x4edf('0x3a')]['password'];_0x2c12e9[_0x4edf('0x42')]=null;_0x2c12e9[_0x4edf('0x43')]=null;return _0x2c12e9[_0x4edf('0x55')]();});})[_0x4edf('0xd')](function(){_0x57171a[_0x4edf('0x32')](0xc8)[_0x4edf('0x33')]({'message':_0x4edf('0x56')});})[_0x4edf('0x1e')](function(_0x36c402){return handleError(_0x57171a,0x1f4,_0x36c402);});};passport[_0x4edf('0x57')](_0x4edf('0x35'),new LocalStrategy({'usernameField':_0x4edf('0x21'),'passwordField':_0x4edf('0xe')},function(_0x36059b,_0xe9b4f2,_0x445044){return localAuthenticate(db['User'],_0x36059b,_0xe9b4f2,_0x445044);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8541f41..4ffbccb 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 _0xce5a=['reset','exports','Router','./authLocal.controller','post','login','forgot','/reset/:token'];(function(_0x17809c,_0xa6ceb9){var _0x144a29=function(_0x44b044){while(--_0x44b044){_0x17809c['push'](_0x17809c['shift']());}};_0x144a29(++_0xa6ceb9);}(_0xce5a,0x17a));var _0xace5=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0xce5a[_0x1fd9e7];return _0x1781f2;};'use strict';var express=require('express');var router=express[_0xace5('0x0')]();var controller=require(_0xace5('0x1'));router[_0xace5('0x2')]('/',controller[_0xace5('0x3')]);router[_0xace5('0x2')]('/forgot',controller[_0xace5('0x4')]);router['post'](_0xace5('0x5'),controller[_0xace5('0x6')]);module[_0xace5('0x7')]=router; \ No newline at end of file +var _0x6ac8=['login','/forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x10534e,_0x1665c7){var _0x1a1268=function(_0x4cf7b7){while(--_0x4cf7b7){_0x10534e['push'](_0x10534e['shift']());}};_0x1a1268(++_0x1665c7);}(_0x6ac8,0xce));var _0x86ac=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x6ac8[_0x9aada2];return _0x196dff;};'use strict';var express=require(_0x86ac('0x0'));var router=express[_0x86ac('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0x86ac('0x2')]);router['post'](_0x86ac('0x3'),controller['forgot']);router[_0x86ac('0x4')](_0x86ac('0x5'),controller[_0x86ac('0x6')]);module[_0x86ac('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 6b12a34..153d8c2 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 _0xb9fb=['STRING','BOOLEAN','INTEGER'];(function(_0x1711a3,_0x4c5d79){var _0x338ba5=function(_0x408fff){while(--_0x408fff){_0x1711a3['push'](_0x1711a3['shift']());}};_0x338ba5(++_0x4c5d79);}(_0xb9fb,0x198));var _0xbb9f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb9fb[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbb9f('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0xbb9f('0x0')]},'description':{'type':Sequelize[_0xbb9f('0x0')]},'status':{'type':Sequelize[_0xbb9f('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbb9f('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb5f5=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3ff9bc,_0x51778d){var _0x4017d6=function(_0x57bb0a){while(--_0x57bb0a){_0x3ff9bc['push'](_0x3ff9bc['shift']());}};_0x4017d6(++_0x51778d);}(_0xb5f5,0x195));var _0x5b5f=function(_0x273df0,_0x184213){_0x273df0=_0x273df0-0x0;var _0x29d6fd=_0xb5f5[_0x273df0];return _0x29d6fd;};'use strict';var Sequelize=require(_0x5b5f('0x0'));module[_0x5b5f('0x1')]={'name':{'type':Sequelize[_0x5b5f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5b5f('0x2')]},'description':{'type':Sequelize[_0x5b5f('0x2')]},'status':{'type':Sequelize[_0x5b5f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5b5f('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 1cc118d..74598b8 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 _0x916b=['options','includeAll','include','findAll','catch','keys','create','body','update','params','destroy','find','Condition','omit','ids','getConditions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','sendStatus','error','stack','Automation','rawAttributes','fieldName','type','key','map','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2d2bd4,_0x5e73ed){var _0x1d11f0=function(_0x59a371){while(--_0x59a371){_0x2d2bd4['push'](_0x2d2bd4['shift']());}};_0x1d11f0(++_0x5e73ed);}(_0x916b,0x103));var _0xb916=function(_0xf420f6,_0x4d298e){_0xf420f6=_0xf420f6-0x0;var _0xd2d0f=_0x916b[_0xf420f6];return _0xd2d0f;};'use strict';var emlformat=require(_0xb916('0x0'));var rimraf=require(_0xb916('0x1'));var zipdir=require(_0xb916('0x2'));var jsonpatch=require(_0xb916('0x3'));var rp=require(_0xb916('0x4'));var moment=require(_0xb916('0x5'));var BPromise=require(_0xb916('0x6'));var Mustache=require(_0xb916('0x7'));var util=require(_0xb916('0x8'));var path=require(_0xb916('0x9'));var sox=require(_0xb916('0xa'));var csv=require(_0xb916('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb916('0xc'));var crypto=require('crypto');var jsforce=require(_0xb916('0xd'));var deskjs=require(_0xb916('0xe'));var toCsv=require(_0xb916('0xb'));var querystring=require(_0xb916('0xf'));var Papa=require(_0xb916('0x10'));var Redis=require(_0xb916('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb916('0x12'));var as=require(_0xb916('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb916('0x14'))(_0xb916('0x15'));var utils=require('../../config/utils');var config=require(_0xb916('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb916('0x17'))['db'];function respondWithStatusCode(_0x3e75e5,_0x337f84){_0x337f84=_0x337f84||0xcc;return function(_0x92bb73){if(_0x92bb73){return _0x3e75e5['sendStatus'](_0x337f84);}return _0x3e75e5[_0xb916('0x18')](_0x337f84)[_0xb916('0x19')]();};}function respondWithResult(_0x176a42,_0x5b90f8){_0x5b90f8=_0x5b90f8||0xc8;return function(_0x48e7f7){if(_0x48e7f7){return _0x176a42['status'](_0x5b90f8)[_0xb916('0x1a')](_0x48e7f7);}};}function respondWithFilteredResult(_0x533f84,_0x25bf90){return function(_0x1cb418){if(_0x1cb418){var _0x4f6d29=typeof _0x25bf90[_0xb916('0x1b')]==='undefined'&&typeof _0x25bf90[_0xb916('0x1c')]===_0xb916('0x1d');var _0x22815e=_0x1cb418[_0xb916('0x1e')];var _0x381065=_0x4f6d29?0x0:_0x25bf90[_0xb916('0x1b')];var _0x36d336=_0x4f6d29?_0x1cb418['count']:_0x25bf90[_0xb916('0x1b')]+_0x25bf90[_0xb916('0x1c')];var _0x356620;if(_0x36d336>=_0x22815e){_0x36d336=_0x22815e;_0x356620=0xc8;}else{_0x356620=0xce;}_0x533f84[_0xb916('0x18')](_0x356620);return _0x533f84['set'](_0xb916('0x1f'),_0x381065+'-'+_0x36d336+'/'+_0x22815e)[_0xb916('0x1a')](_0x1cb418);}return null;};}function patchUpdates(_0x5eef43){return function(_0x654857){try{jsonpatch[_0xb916('0x20')](_0x654857,_0x5eef43,!![]);}catch(_0x3bc924){return BPromise[_0xb916('0x21')](_0x3bc924);}return _0x654857['save']();};}function saveUpdates(_0x5be03f,_0x272003){return function(_0x1cc07a){if(_0x1cc07a){return _0x1cc07a['update'](_0x5be03f)[_0xb916('0x22')](function(_0x47d86a){return _0x47d86a;});}return null;};}function removeEntity(_0x228589,_0x5fc629){return function(_0x38940f){if(_0x38940f){return _0x38940f['destroy']()[_0xb916('0x22')](function(){_0x228589[_0xb916('0x18')](0xcc)[_0xb916('0x19')]();});}};}function handleEntityNotFound(_0x906739,_0x2d8a9e){return function(_0x50ec01){if(!_0x50ec01){_0x906739[_0xb916('0x23')](0x194);}return _0x50ec01;};}function handleError(_0xfc26ff,_0x7711db){_0x7711db=_0x7711db||0x1f4;return function(_0x190c6e){logger[_0xb916('0x24')](_0x190c6e[_0xb916('0x25')]);if(_0x190c6e['name']){delete _0x190c6e['name'];}_0xfc26ff['status'](_0x7711db)['send'](_0x190c6e);};}exports['index']=function(_0x1b531f,_0xaf06ba){var _0x324607={},_0x38fa83={},_0xddef50={'count':0x0,'rows':[]};var _0x5ba2a3=_['map'](db[_0xb916('0x26')][_0xb916('0x27')],function(_0x2f3a6f){return{'name':_0x2f3a6f[_0xb916('0x28')],'type':_0x2f3a6f[_0xb916('0x29')][_0xb916('0x2a')]};});_0x38fa83['model']=_[_0xb916('0x2b')](_0x5ba2a3,_0xb916('0x2c'));_0x38fa83[_0xb916('0x2d')]=_['keys'](_0x1b531f[_0xb916('0x2d')]);_0x38fa83[_0xb916('0x2e')]=_[_0xb916('0x2f')](_0x38fa83[_0xb916('0x30')],_0x38fa83[_0xb916('0x2d')]);_0x324607['attributes']=_[_0xb916('0x2f')](_0x38fa83[_0xb916('0x30')],qs[_0xb916('0x31')](_0x1b531f['query']['fields']));_0x324607[_0xb916('0x32')]=_0x324607[_0xb916('0x32')][_0xb916('0x33')]?_0x324607[_0xb916('0x32')]:_0x38fa83['model'];if(!_0x1b531f[_0xb916('0x2d')][_0xb916('0x34')](_0xb916('0x35'))){_0x324607[_0xb916('0x1c')]=qs[_0xb916('0x1c')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x1c')]);_0x324607[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x1b')]);}_0x324607[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x1b531f[_0xb916('0x2d')][_0xb916('0x37')]);_0x324607[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x1b531f[_0xb916('0x2d')],_0x38fa83[_0xb916('0x2e')]),_0x5ba2a3);if(_0x1b531f[_0xb916('0x2d')][_0xb916('0x3a')]){_0x324607['where']=_[_0xb916('0x3b')](_0x324607['where'],{'$or':_[_0xb916('0x2b')](_0x5ba2a3,function(_0x4c5951){if(_0x4c5951[_0xb916('0x29')]!==_0xb916('0x3c')){var _0x2eb692={};_0x2eb692[_0x4c5951[_0xb916('0x2c')]]={'$like':'%'+_0x1b531f['query'][_0xb916('0x3a')]+'%'};return _0x2eb692;}})});}_0x324607=_[_0xb916('0x3b')]({},_0x324607,_0x1b531f[_0xb916('0x3d')]);var _0xdfa597={'where':_0x324607[_0xb916('0x38')]};return db[_0xb916('0x26')][_0xb916('0x1e')](_0xdfa597)[_0xb916('0x22')](function(_0xfd00ab){_0xddef50[_0xb916('0x1e')]=_0xfd00ab;if(_0x1b531f[_0xb916('0x2d')][_0xb916('0x3e')]){_0x324607[_0xb916('0x3f')]=[{'all':!![]}];}return db[_0xb916('0x26')][_0xb916('0x40')](_0x324607);})['then'](function(_0x3bda57){_0xddef50['rows']=_0x3bda57;return _0xddef50;})[_0xb916('0x22')](respondWithFilteredResult(_0xaf06ba,_0x324607))[_0xb916('0x41')](handleError(_0xaf06ba,null));};exports['show']=function(_0x31fe5e,_0x5966ea){var _0x297ff0={'raw':![],'where':{'id':_0x31fe5e['params']['id']}},_0x7ef7ef={};_0x7ef7ef[_0xb916('0x30')]=_[_0xb916('0x42')](db[_0xb916('0x26')][_0xb916('0x27')]);_0x7ef7ef[_0xb916('0x2d')]=_['keys'](_0x31fe5e[_0xb916('0x2d')]);_0x7ef7ef[_0xb916('0x2e')]=_[_0xb916('0x2f')](_0x7ef7ef[_0xb916('0x30')],_0x7ef7ef[_0xb916('0x2d')]);_0x297ff0[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x7ef7ef[_0xb916('0x30')],qs['fields'](_0x31fe5e[_0xb916('0x2d')]['fields']));_0x297ff0[_0xb916('0x32')]=_0x297ff0['attributes'][_0xb916('0x33')]?_0x297ff0['attributes']:_0x7ef7ef[_0xb916('0x30')];if(_0x31fe5e[_0xb916('0x2d')][_0xb916('0x3e')]){_0x297ff0[_0xb916('0x3f')]=[{'all':!![]}];}_0x297ff0=_[_0xb916('0x3b')]({},_0x297ff0,_0x31fe5e[_0xb916('0x3d')]);return db[_0xb916('0x26')]['find'](_0x297ff0)['then'](handleEntityNotFound(_0x5966ea,null))[_0xb916('0x22')](respondWithResult(_0x5966ea,null))['catch'](handleError(_0x5966ea,null));};exports[_0xb916('0x43')]=function(_0x32ced0,_0x18a691){return db['Automation'][_0xb916('0x43')](_0x32ced0[_0xb916('0x44')],{})[_0xb916('0x22')](respondWithResult(_0x18a691,0xc9))[_0xb916('0x41')](handleError(_0x18a691,null));};exports[_0xb916('0x45')]=function(_0x313e0c,_0x35c619){if(_0x313e0c[_0xb916('0x44')]['id']){delete _0x313e0c[_0xb916('0x44')]['id'];}return db['Automation']['find']({'where':{'id':_0x313e0c[_0xb916('0x46')]['id']}})['then'](handleEntityNotFound(_0x35c619,null))['then'](saveUpdates(_0x313e0c[_0xb916('0x44')],null))[_0xb916('0x22')](respondWithResult(_0x35c619,null))[_0xb916('0x41')](handleError(_0x35c619,null));};exports[_0xb916('0x47')]=function(_0x33aed4,_0x8efedc){return db[_0xb916('0x26')][_0xb916('0x48')]({'where':{'id':_0x33aed4[_0xb916('0x46')]['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x8efedc,null))[_0xb916('0x22')](removeEntity(_0x8efedc,null))['catch'](handleError(_0x8efedc,null));};exports['addConditions']=function(_0x264a9d,_0x8d7623,_0x426cc8){return db[_0xb916('0x49')][_0xb916('0x48')]({'where':{'id':_0x264a9d['params']['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x8d7623,null))[_0xb916('0x22')](function(_0x4ae600){if(_0x4ae600){return _0x4ae600['addConditions'](_0x264a9d['body']['ids'],_[_0xb916('0x4a')](_0x264a9d[_0xb916('0x44')],[_0xb916('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x8d7623,null))[_0xb916('0x41')](handleError(_0x8d7623,null));};exports[_0xb916('0x4c')]=function(_0x571123,_0x508d66,_0x51b1de){var _0x469374={};var _0x24dd82={};var _0x5d739f;var _0x148a34;return db[_0xb916('0x26')][_0xb916('0x4d')]({'where':{'id':_0x571123[_0xb916('0x46')]['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x508d66,null))[_0xb916('0x22')](function(_0x505bf8){if(_0x505bf8){_0x5d739f=_0x505bf8;_0x24dd82[_0xb916('0x30')]=_[_0xb916('0x42')](db['Condition'][_0xb916('0x27')]);_0x24dd82[_0xb916('0x2d')]=_[_0xb916('0x42')](_0x571123[_0xb916('0x2d')]);_0x24dd82['filters']=_[_0xb916('0x2f')](_0x24dd82[_0xb916('0x30')],_0x24dd82['query']);_0x469374[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x24dd82['model'],qs[_0xb916('0x31')](_0x571123[_0xb916('0x2d')][_0xb916('0x31')]));_0x469374['attributes']=_0x469374[_0xb916('0x32')]['length']?_0x469374[_0xb916('0x32')]:_0x24dd82['model'];_0x469374[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x571123[_0xb916('0x2d')][_0xb916('0x37')]);_0x469374[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x571123[_0xb916('0x2d')],_0x24dd82[_0xb916('0x2e')]));if(_0x571123['query'][_0xb916('0x3a')]){_0x469374[_0xb916('0x38')]=_[_0xb916('0x3b')](_0x469374[_0xb916('0x38')],{'$or':_[_0xb916('0x2b')](_0x469374[_0xb916('0x32')],function(_0xef6081){var _0x371591={};_0x371591[_0xef6081]={'$like':'%'+_0x571123[_0xb916('0x2d')][_0xb916('0x3a')]+'%'};return _0x371591;})});}_0x469374=_[_0xb916('0x3b')]({},_0x469374,_0x571123[_0xb916('0x3d')]);return _0x5d739f['getConditions'](_0x469374);}})[_0xb916('0x22')](function(_0x51f0df){if(_0x51f0df){_0x148a34=_0x51f0df[_0xb916('0x33')];if(!_0x571123[_0xb916('0x2d')][_0xb916('0x34')](_0xb916('0x35'))){_0x469374[_0xb916('0x1c')]=qs['limit'](_0x571123['query'][_0xb916('0x1c')]);_0x469374[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x571123[_0xb916('0x2d')][_0xb916('0x1b')]);}return _0x5d739f[_0xb916('0x4c')](_0x469374);}})[_0xb916('0x22')](function(_0x22bda0){if(_0x22bda0){return _0x22bda0?{'count':_0x148a34,'rows':_0x22bda0}:null;}})[_0xb916('0x22')](respondWithResult(_0x508d66,null))['catch'](handleError(_0x508d66,null));};exports['addActions']=function(_0x49df87,_0x253858,_0x4714f2){return db['Action']['find']({'where':{'id':_0x49df87[_0xb916('0x46')]['id']}})['then'](handleEntityNotFound(_0x253858,null))[_0xb916('0x22')](function(_0x8c1e36){if(_0x8c1e36){return _0x8c1e36['addActions'](_0x49df87['body'][_0xb916('0x4b')],_[_0xb916('0x4a')](_0x49df87['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x253858,null))[_0xb916('0x41')](handleError(_0x253858,null));};exports['getActions']=function(_0x571afb,_0x5a8f1a,_0x309b6a){var _0xaf0f21={};var _0x4fbbc6={};var _0x528ec2;var _0x2d195e;return db[_0xb916('0x26')]['findOne']({'where':{'id':_0x571afb['params']['id']}})[_0xb916('0x22')](handleEntityNotFound(_0x5a8f1a,null))[_0xb916('0x22')](function(_0x258857){if(_0x258857){_0x528ec2=_0x258857;_0x4fbbc6[_0xb916('0x30')]=_['keys'](db[_0xb916('0x4e')][_0xb916('0x27')]);_0x4fbbc6[_0xb916('0x2d')]=_[_0xb916('0x42')](_0x571afb[_0xb916('0x2d')]);_0x4fbbc6['filters']=_[_0xb916('0x2f')](_0x4fbbc6[_0xb916('0x30')],_0x4fbbc6[_0xb916('0x2d')]);_0xaf0f21[_0xb916('0x32')]=_[_0xb916('0x2f')](_0x4fbbc6[_0xb916('0x30')],qs['fields'](_0x571afb[_0xb916('0x2d')]['fields']));_0xaf0f21[_0xb916('0x32')]=_0xaf0f21[_0xb916('0x32')][_0xb916('0x33')]?_0xaf0f21[_0xb916('0x32')]:_0x4fbbc6[_0xb916('0x30')];_0xaf0f21[_0xb916('0x36')]=qs[_0xb916('0x37')](_0x571afb[_0xb916('0x2d')][_0xb916('0x37')]);_0xaf0f21[_0xb916('0x38')]=qs[_0xb916('0x2e')](_[_0xb916('0x39')](_0x571afb[_0xb916('0x2d')],_0x4fbbc6['filters']));if(_0x571afb[_0xb916('0x2d')][_0xb916('0x3a')]){_0xaf0f21[_0xb916('0x38')]=_[_0xb916('0x3b')](_0xaf0f21[_0xb916('0x38')],{'$or':_[_0xb916('0x2b')](_0xaf0f21[_0xb916('0x32')],function(_0x57f120){var _0x547f5b={};_0x547f5b[_0x57f120]={'$like':'%'+_0x571afb[_0xb916('0x2d')][_0xb916('0x3a')]+'%'};return _0x547f5b;})});}_0xaf0f21=_['merge']({},_0xaf0f21,_0x571afb[_0xb916('0x3d')]);return _0x528ec2[_0xb916('0x4f')](_0xaf0f21);}})[_0xb916('0x22')](function(_0x263d78){if(_0x263d78){_0x2d195e=_0x263d78[_0xb916('0x33')];if(!_0x571afb['query'][_0xb916('0x34')]('nolimit')){_0xaf0f21[_0xb916('0x1c')]=qs[_0xb916('0x1c')](_0x571afb[_0xb916('0x2d')]['limit']);_0xaf0f21[_0xb916('0x1b')]=qs[_0xb916('0x1b')](_0x571afb[_0xb916('0x2d')][_0xb916('0x1b')]);}return _0x528ec2[_0xb916('0x4f')](_0xaf0f21);}})[_0xb916('0x22')](function(_0x5234d2){if(_0x5234d2){return _0x5234d2?{'count':_0x2d195e,'rows':_0x5234d2}:null;}})[_0xb916('0x22')](respondWithResult(_0x5a8f1a,null))[_0xb916('0x41')](handleError(_0x5a8f1a,null));}; \ No newline at end of file +var _0x5589=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Condition','addConditions','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Automation','fieldName','type','key','model','query','keys','filters'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5589,0x130));var _0x9558=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x5589[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x9558('0x0'));var rimraf=require(_0x9558('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9558('0x2'));var rp=require(_0x9558('0x3'));var moment=require(_0x9558('0x4'));var BPromise=require(_0x9558('0x5'));var Mustache=require(_0x9558('0x6'));var util=require(_0x9558('0x7'));var path=require(_0x9558('0x8'));var sox=require(_0x9558('0x9'));var csv=require(_0x9558('0xa'));var ejs=require(_0x9558('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9558('0xc'));var squel=require(_0x9558('0xd'));var crypto=require(_0x9558('0xe'));var jsforce=require(_0x9558('0xf'));var deskjs=require(_0x9558('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9558('0x11'));var Papa=require(_0x9558('0x12'));var Redis=require(_0x9558('0x13'));var authService=require(_0x9558('0x14'));var qs=require(_0x9558('0x15'));var as=require(_0x9558('0x16'));var hardwareService=require(_0x9558('0x17'));var logger=require(_0x9558('0x18'))(_0x9558('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9558('0x1a'));var db=require(_0x9558('0x1b'))['db'];function respondWithStatusCode(_0x5abca3,_0x27c502){_0x27c502=_0x27c502||0xcc;return function(_0x1baccc){if(_0x1baccc){return _0x5abca3[_0x9558('0x1c')](_0x27c502);}return _0x5abca3[_0x9558('0x1d')](_0x27c502)['end']();};}function respondWithResult(_0x167f4f,_0x232b32){_0x232b32=_0x232b32||0xc8;return function(_0x1ef702){if(_0x1ef702){return _0x167f4f[_0x9558('0x1d')](_0x232b32)[_0x9558('0x1e')](_0x1ef702);}};}function respondWithFilteredResult(_0x32b4c8,_0x2abaa8){return function(_0x2da178){if(_0x2da178){var _0x22f0e5=typeof _0x2abaa8['offset']===_0x9558('0x1f')&&typeof _0x2abaa8[_0x9558('0x20')]===_0x9558('0x1f');var _0x4a5398=_0x2da178[_0x9558('0x21')];var _0x141e1f=_0x22f0e5?0x0:_0x2abaa8[_0x9558('0x22')];var _0x2caab5=_0x22f0e5?_0x2da178[_0x9558('0x21')]:_0x2abaa8['offset']+_0x2abaa8[_0x9558('0x20')];var _0x12645e;if(_0x2caab5>=_0x4a5398){_0x2caab5=_0x4a5398;_0x12645e=0xc8;}else{_0x12645e=0xce;}_0x32b4c8[_0x9558('0x1d')](_0x12645e);return _0x32b4c8[_0x9558('0x23')](_0x9558('0x24'),_0x141e1f+'-'+_0x2caab5+'/'+_0x4a5398)[_0x9558('0x1e')](_0x2da178);}return null;};}function patchUpdates(_0xb4ef4){return function(_0x313168){try{jsonpatch[_0x9558('0x25')](_0x313168,_0xb4ef4,!![]);}catch(_0x1efe44){return BPromise[_0x9558('0x26')](_0x1efe44);}return _0x313168[_0x9558('0x27')]();};}function saveUpdates(_0x357099,_0x2832a1){return function(_0x128d80){if(_0x128d80){return _0x128d80[_0x9558('0x28')](_0x357099)[_0x9558('0x29')](function(_0x4a91ac){return _0x4a91ac;});}return null;};}function removeEntity(_0x51e9e9,_0x166563){return function(_0x4c575c){if(_0x4c575c){return _0x4c575c[_0x9558('0x2a')]()[_0x9558('0x29')](function(){_0x51e9e9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47c174,_0x2b484d){return function(_0x137d28){if(!_0x137d28){_0x47c174[_0x9558('0x1c')](0x194);}return _0x137d28;};}function handleError(_0x5e4bef,_0x17f39c){_0x17f39c=_0x17f39c||0x1f4;return function(_0x414869){logger[_0x9558('0x2b')](_0x414869[_0x9558('0x2c')]);if(_0x414869[_0x9558('0x2d')]){delete _0x414869[_0x9558('0x2d')];}_0x5e4bef[_0x9558('0x1d')](_0x17f39c)[_0x9558('0x2e')](_0x414869);};}exports['index']=function(_0x106490,_0x40118d){var _0x395748={},_0x501dfc={},_0xf1ed0d={'count':0x0,'rows':[]};var _0x2fcfba=_[_0x9558('0x2f')](db[_0x9558('0x30')]['rawAttributes'],function(_0x1e7450){return{'name':_0x1e7450[_0x9558('0x31')],'type':_0x1e7450[_0x9558('0x32')][_0x9558('0x33')]};});_0x501dfc[_0x9558('0x34')]=_['map'](_0x2fcfba,_0x9558('0x2d'));_0x501dfc[_0x9558('0x35')]=_[_0x9558('0x36')](_0x106490[_0x9558('0x35')]);_0x501dfc[_0x9558('0x37')]=_['intersection'](_0x501dfc[_0x9558('0x34')],_0x501dfc[_0x9558('0x35')]);_0x395748[_0x9558('0x38')]=_[_0x9558('0x39')](_0x501dfc[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x106490[_0x9558('0x35')][_0x9558('0x3a')]));_0x395748[_0x9558('0x38')]=_0x395748[_0x9558('0x38')][_0x9558('0x3b')]?_0x395748[_0x9558('0x38')]:_0x501dfc[_0x9558('0x34')];if(!_0x106490[_0x9558('0x35')][_0x9558('0x3c')]('nolimit')){_0x395748[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x106490[_0x9558('0x35')][_0x9558('0x20')]);_0x395748['offset']=qs[_0x9558('0x22')](_0x106490['query']['offset']);}_0x395748[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x106490[_0x9558('0x35')][_0x9558('0x3e')]);_0x395748[_0x9558('0x3f')]=qs[_0x9558('0x37')](_[_0x9558('0x40')](_0x106490[_0x9558('0x35')],_0x501dfc[_0x9558('0x37')]),_0x2fcfba);if(_0x106490[_0x9558('0x35')][_0x9558('0x41')]){_0x395748[_0x9558('0x3f')]=_[_0x9558('0x42')](_0x395748['where'],{'$or':_[_0x9558('0x2f')](_0x2fcfba,function(_0x1754b9){if(_0x1754b9['type']!==_0x9558('0x43')){var _0x50db2a={};_0x50db2a[_0x1754b9['name']]={'$like':'%'+_0x106490[_0x9558('0x35')]['filter']+'%'};return _0x50db2a;}})});}_0x395748=_[_0x9558('0x42')]({},_0x395748,_0x106490[_0x9558('0x44')]);var _0x42822f={'where':_0x395748['where']};return db[_0x9558('0x30')][_0x9558('0x21')](_0x42822f)[_0x9558('0x29')](function(_0x5db34){_0xf1ed0d[_0x9558('0x21')]=_0x5db34;if(_0x106490[_0x9558('0x35')][_0x9558('0x45')]){_0x395748[_0x9558('0x46')]=[{'all':!![]}];}return db['Automation'][_0x9558('0x47')](_0x395748);})[_0x9558('0x29')](function(_0x160f13){_0xf1ed0d[_0x9558('0x48')]=_0x160f13;return _0xf1ed0d;})[_0x9558('0x29')](respondWithFilteredResult(_0x40118d,_0x395748))[_0x9558('0x49')](handleError(_0x40118d,null));};exports[_0x9558('0x4a')]=function(_0x5ab162,_0xe3779c){var _0x3dc825={'raw':![],'where':{'id':_0x5ab162[_0x9558('0x4b')]['id']}},_0x1f5e34={};_0x1f5e34[_0x9558('0x34')]=_['keys'](db['Automation'][_0x9558('0x4c')]);_0x1f5e34['query']=_[_0x9558('0x36')](_0x5ab162['query']);_0x1f5e34[_0x9558('0x37')]=_[_0x9558('0x39')](_0x1f5e34['model'],_0x1f5e34['query']);_0x3dc825[_0x9558('0x38')]=_[_0x9558('0x39')](_0x1f5e34[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x5ab162[_0x9558('0x35')]['fields']));_0x3dc825[_0x9558('0x38')]=_0x3dc825['attributes'][_0x9558('0x3b')]?_0x3dc825['attributes']:_0x1f5e34[_0x9558('0x34')];if(_0x5ab162[_0x9558('0x35')][_0x9558('0x45')]){_0x3dc825[_0x9558('0x46')]=[{'all':!![]}];}_0x3dc825=_[_0x9558('0x42')]({},_0x3dc825,_0x5ab162[_0x9558('0x44')]);return db['Automation'][_0x9558('0x4d')](_0x3dc825)['then'](handleEntityNotFound(_0xe3779c,null))[_0x9558('0x29')](respondWithResult(_0xe3779c,null))['catch'](handleError(_0xe3779c,null));};exports[_0x9558('0x4e')]=function(_0x175394,_0x3cb5a9){return db[_0x9558('0x30')][_0x9558('0x4e')](_0x175394[_0x9558('0x4f')],{})[_0x9558('0x29')](respondWithResult(_0x3cb5a9,0xc9))[_0x9558('0x49')](handleError(_0x3cb5a9,null));};exports[_0x9558('0x28')]=function(_0x2cefc2,_0x51272a){if(_0x2cefc2[_0x9558('0x4f')]['id']){delete _0x2cefc2[_0x9558('0x4f')]['id'];}return db[_0x9558('0x30')]['find']({'where':{'id':_0x2cefc2[_0x9558('0x4b')]['id']}})['then'](handleEntityNotFound(_0x51272a,null))[_0x9558('0x29')](saveUpdates(_0x2cefc2[_0x9558('0x4f')],null))[_0x9558('0x29')](respondWithResult(_0x51272a,null))[_0x9558('0x49')](handleError(_0x51272a,null));};exports['destroy']=function(_0xe58c20,_0x79936e){return db['Automation'][_0x9558('0x4d')]({'where':{'id':_0xe58c20['params']['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x79936e,null))[_0x9558('0x29')](removeEntity(_0x79936e,null))['catch'](handleError(_0x79936e,null));};exports['addConditions']=function(_0xb9b210,_0x3207d7,_0x3fbf63){return db[_0x9558('0x50')][_0x9558('0x4d')]({'where':{'id':_0xb9b210[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x3207d7,null))['then'](function(_0x1f364c){if(_0x1f364c){return _0x1f364c[_0x9558('0x51')](_0xb9b210['body'][_0x9558('0x52')],_[_0x9558('0x53')](_0xb9b210[_0x9558('0x4f')],[_0x9558('0x52'),'id'])||{});}})[_0x9558('0x29')](respondWithResult(_0x3207d7,null))[_0x9558('0x49')](handleError(_0x3207d7,null));};exports[_0x9558('0x54')]=function(_0x20cc9b,_0x44653d,_0x369228){var _0x340548={};var _0xe70a89={};var _0x4b4516;var _0x75451e;return db[_0x9558('0x30')][_0x9558('0x55')]({'where':{'id':_0x20cc9b[_0x9558('0x4b')]['id']}})['then'](handleEntityNotFound(_0x44653d,null))[_0x9558('0x29')](function(_0x48ee7f){if(_0x48ee7f){_0x4b4516=_0x48ee7f;_0xe70a89[_0x9558('0x34')]=_[_0x9558('0x36')](db[_0x9558('0x50')][_0x9558('0x4c')]);_0xe70a89[_0x9558('0x35')]=_[_0x9558('0x36')](_0x20cc9b[_0x9558('0x35')]);_0xe70a89[_0x9558('0x37')]=_[_0x9558('0x39')](_0xe70a89[_0x9558('0x34')],_0xe70a89['query']);_0x340548[_0x9558('0x38')]=_[_0x9558('0x39')](_0xe70a89[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x20cc9b['query']['fields']));_0x340548[_0x9558('0x38')]=_0x340548[_0x9558('0x38')][_0x9558('0x3b')]?_0x340548[_0x9558('0x38')]:_0xe70a89[_0x9558('0x34')];_0x340548[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x20cc9b['query'][_0x9558('0x3e')]);_0x340548[_0x9558('0x3f')]=qs['filters'](_['pick'](_0x20cc9b[_0x9558('0x35')],_0xe70a89['filters']));if(_0x20cc9b['query'][_0x9558('0x41')]){_0x340548['where']=_[_0x9558('0x42')](_0x340548[_0x9558('0x3f')],{'$or':_['map'](_0x340548[_0x9558('0x38')],function(_0x256714){var _0x1dfb25={};_0x1dfb25[_0x256714]={'$like':'%'+_0x20cc9b[_0x9558('0x35')][_0x9558('0x41')]+'%'};return _0x1dfb25;})});}_0x340548=_['merge']({},_0x340548,_0x20cc9b['options']);return _0x4b4516[_0x9558('0x54')](_0x340548);}})['then'](function(_0x34487e){if(_0x34487e){_0x75451e=_0x34487e[_0x9558('0x3b')];if(!_0x20cc9b['query'][_0x9558('0x3c')](_0x9558('0x56'))){_0x340548[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x20cc9b[_0x9558('0x35')]['limit']);_0x340548['offset']=qs['offset'](_0x20cc9b['query'][_0x9558('0x22')]);}return _0x4b4516[_0x9558('0x54')](_0x340548);}})[_0x9558('0x29')](function(_0xbed4f7){if(_0xbed4f7){return _0xbed4f7?{'count':_0x75451e,'rows':_0xbed4f7}:null;}})['then'](respondWithResult(_0x44653d,null))['catch'](handleError(_0x44653d,null));};exports[_0x9558('0x57')]=function(_0x2bce9e,_0x1399d0,_0x3fedaf){return db[_0x9558('0x58')][_0x9558('0x4d')]({'where':{'id':_0x2bce9e[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x1399d0,null))[_0x9558('0x29')](function(_0x296b69){if(_0x296b69){return _0x296b69[_0x9558('0x57')](_0x2bce9e['body'][_0x9558('0x52')],_[_0x9558('0x53')](_0x2bce9e[_0x9558('0x4f')],[_0x9558('0x52'),'id'])||{});}})[_0x9558('0x29')](respondWithResult(_0x1399d0,null))[_0x9558('0x49')](handleError(_0x1399d0,null));};exports[_0x9558('0x59')]=function(_0x4be877,_0x2b142b,_0x2afdfe){var _0x1f6ae1={};var _0x3ad264={};var _0x51b3c9;var _0x197768;return db['Automation'][_0x9558('0x55')]({'where':{'id':_0x4be877[_0x9558('0x4b')]['id']}})[_0x9558('0x29')](handleEntityNotFound(_0x2b142b,null))[_0x9558('0x29')](function(_0x4a0ee5){if(_0x4a0ee5){_0x51b3c9=_0x4a0ee5;_0x3ad264[_0x9558('0x34')]=_['keys'](db[_0x9558('0x58')][_0x9558('0x4c')]);_0x3ad264['query']=_['keys'](_0x4be877['query']);_0x3ad264['filters']=_[_0x9558('0x39')](_0x3ad264[_0x9558('0x34')],_0x3ad264['query']);_0x1f6ae1[_0x9558('0x38')]=_[_0x9558('0x39')](_0x3ad264[_0x9558('0x34')],qs[_0x9558('0x3a')](_0x4be877['query'][_0x9558('0x3a')]));_0x1f6ae1[_0x9558('0x38')]=_0x1f6ae1[_0x9558('0x38')][_0x9558('0x3b')]?_0x1f6ae1[_0x9558('0x38')]:_0x3ad264['model'];_0x1f6ae1[_0x9558('0x3d')]=qs[_0x9558('0x3e')](_0x4be877[_0x9558('0x35')][_0x9558('0x3e')]);_0x1f6ae1[_0x9558('0x3f')]=qs[_0x9558('0x37')](_[_0x9558('0x40')](_0x4be877['query'],_0x3ad264['filters']));if(_0x4be877['query']['filter']){_0x1f6ae1['where']=_[_0x9558('0x42')](_0x1f6ae1[_0x9558('0x3f')],{'$or':_[_0x9558('0x2f')](_0x1f6ae1[_0x9558('0x38')],function(_0x1fb21b){var _0x56c11e={};_0x56c11e[_0x1fb21b]={'$like':'%'+_0x4be877['query'][_0x9558('0x41')]+'%'};return _0x56c11e;})});}_0x1f6ae1=_[_0x9558('0x42')]({},_0x1f6ae1,_0x4be877['options']);return _0x51b3c9[_0x9558('0x59')](_0x1f6ae1);}})[_0x9558('0x29')](function(_0x246ccf){if(_0x246ccf){_0x197768=_0x246ccf['length'];if(!_0x4be877[_0x9558('0x35')][_0x9558('0x3c')](_0x9558('0x56'))){_0x1f6ae1[_0x9558('0x20')]=qs[_0x9558('0x20')](_0x4be877['query'][_0x9558('0x20')]);_0x1f6ae1[_0x9558('0x22')]=qs['offset'](_0x4be877[_0x9558('0x35')][_0x9558('0x22')]);}return _0x51b3c9[_0x9558('0x59')](_0x1f6ae1);}})[_0x9558('0x29')](function(_0x310e39){if(_0x310e39){return _0x310e39?{'count':_0x197768,'rows':_0x310e39}:null;}})[_0x9558('0x29')](respondWithResult(_0x2b142b,null))[_0x9558('0x49')](handleError(_0x2b142b,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index ede957c..fd38c9f 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 _0x8b59=['tools_automations','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','Automation'];(function(_0x30d14d,_0x5b7cdc){var _0x47054e=function(_0x3535f2){while(--_0x3535f2){_0x30d14d['push'](_0x30d14d['shift']());}};_0x47054e(++_0x5b7cdc);}(_0x8b59,0x6f));var _0x98b5=function(_0x7514c5,_0x36dbdf){_0x7514c5=_0x7514c5-0x0;var _0x1d5a10=_0x8b59[_0x7514c5];return _0x1d5a10;};'use strict';var _=require('lodash');var util=require(_0x98b5('0x0'));var logger=require(_0x98b5('0x1'))('api');var moment=require(_0x98b5('0x2'));var BPromise=require(_0x98b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98b5('0x4'));var rimraf=require('rimraf');var config=require(_0x98b5('0x5'));var attributes=require('./automation.attributes');module[_0x98b5('0x6')]=function(_0x3ddfc9,_0x2e2135){return _0x3ddfc9[_0x98b5('0x7')](_0x98b5('0x8'),attributes,{'tableName':_0x98b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6c2=['tools_automations','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','Automation'];(function(_0x3addd2,_0x4a6744){var _0x61c0cf=function(_0xd91357){while(--_0xd91357){_0x3addd2['push'](_0x3addd2['shift']());}};_0x61c0cf(++_0x4a6744);}(_0xb6c2,0x18d));var _0x2b6c=function(_0x2bb15d,_0x40b064){_0x2bb15d=_0x2bb15d-0x0;var _0x38ba73=_0xb6c2[_0x2bb15d];return _0x38ba73;};'use strict';var _=require('lodash');var util=require(_0x2b6c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2b6c('0x1'));var BPromise=require(_0x2b6c('0x2'));var rp=require(_0x2b6c('0x3'));var fs=require('fs');var path=require(_0x2b6c('0x4'));var rimraf=require(_0x2b6c('0x5'));var config=require(_0x2b6c('0x6'));var attributes=require(_0x2b6c('0x7'));module['exports']=function(_0x18a9b1,_0x7d7efe){return _0x18a9b1[_0x2b6c('0x8')](_0x2b6c('0x9'),attributes,{'tableName':_0x2b6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d89c679..cf9200f 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 _0xbecf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0xbe0e5c,_0x7368f7){var _0x1c487f=function(_0xa42b1b){while(--_0xa42b1b){_0xbe0e5c['push'](_0xbe0e5c['shift']());}};_0x1c487f(++_0x7368f7);}(_0xbecf,0x15c));var _0xfbec=function(_0x4df79f,_0x5b93fe){_0x4df79f=_0x4df79f-0x0;var _0x80e7cd=_0xbecf[_0x4df79f];return _0x80e7cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbec('0x0'));var BPromise=require(_0xfbec('0x1'));var rs=require(_0xfbec('0x2'));var fs=require('fs');var Redis=require(_0xfbec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbec('0x4'));var logger=require(_0xfbec('0x5'))(_0xfbec('0x6'));var config=require(_0xfbec('0x7'));var jayson=require(_0xfbec('0x8'));var client=jayson['client'][_0xfbec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34a717,_0x33c701,_0x410cab){return new BPromise(function(_0x43bc5b,_0x312ad1){return client[_0xfbec('0xa')](_0x34a717,_0x410cab)[_0xfbec('0xb')](function(_0x21863f){logger['info']('Automation,\x20%s,\x20%s',_0x33c701,'request\x20sent');logger[_0xfbec('0xc')](_0xfbec('0xd'),_0x33c701,_0xfbec('0xe'),JSON[_0xfbec('0xf')](_0x21863f));if(_0x21863f[_0xfbec('0x10')]){if(_0x21863f['error'][_0xfbec('0x11')]===0x1f4){logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f[_0xfbec('0x10')]['message']);return _0x312ad1(_0x21863f[_0xfbec('0x10')][_0xfbec('0x13')]);}logger[_0xfbec('0x10')](_0xfbec('0x12'),_0x33c701,_0x21863f['error'][_0xfbec('0x13')]);return _0x43bc5b(_0x21863f['error'][_0xfbec('0x13')]);}else{logger['info'](_0xfbec('0x12'),_0x33c701,_0xfbec('0xe'));_0x43bc5b(_0x21863f[_0xfbec('0x14')]['message']);}})[_0xfbec('0x15')](function(_0x2a3329){logger[_0xfbec('0x10')]('Automation,\x20%s,\x20%s',_0x33c701,_0x2a3329);_0x312ad1(_0x2a3329);});});} \ No newline at end of file +var _0x7880=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment'];(function(_0x31707a,_0x38aa9f){var _0x107b75=function(_0xf342a8){while(--_0xf342a8){_0x31707a['push'](_0x31707a['shift']());}};_0x107b75(++_0x38aa9f);}(_0x7880,0x10f));var _0x0788=function(_0x12db40,_0x3ad64c){_0x12db40=_0x12db40-0x0;var _0x37cd1c=_0x7880[_0x12db40];return _0x37cd1c;};'use strict';var _=require(_0x0788('0x0'));var util=require('util');var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0788('0x6'));var config=require('../../config/environment');var jayson=require(_0x0788('0x7'));var client=jayson[_0x0788('0x8')][_0x0788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ece1c,_0x14cfa5,_0x450b71){return new BPromise(function(_0x5366c7,_0x1662a2){return client[_0x0788('0xa')](_0x5ece1c,_0x450b71)[_0x0788('0xb')](function(_0x95ebe3){logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x14cfa5,_0x0788('0xe'),JSON[_0x0788('0x11')](_0x95ebe3));if(_0x95ebe3['error']){if(_0x95ebe3[_0x0788('0x12')]['code']===0x1f4){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x95ebe3[_0x0788('0x12')][_0x0788('0x13')]);return _0x1662a2(_0x95ebe3[_0x0788('0x12')]['message']);}logger[_0x0788('0x12')]('Automation,\x20%s,\x20%s',_0x14cfa5,_0x95ebe3[_0x0788('0x12')]['message']);return _0x5366c7(_0x95ebe3['error'][_0x0788('0x13')]);}else{logger[_0x0788('0xc')](_0x0788('0xd'),_0x14cfa5,'request\x20sent');_0x5366c7(_0x95ebe3[_0x0788('0x14')][_0x0788('0x13')]);}})['catch'](function(_0x334f58){logger[_0x0788('0x12')](_0x0788('0xd'),_0x14cfa5,_0x334f58);_0x1662a2(_0x334f58);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6de4339..8f8410c 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 _0xbe6f=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4edf6e,_0x89532){var _0x245537=function(_0x228ccd){while(--_0x228ccd){_0x4edf6e['push'](_0x4edf6e['shift']());}};_0x245537(++_0x89532);}(_0xbe6f,0x105));var _0xfbe6=function(_0xf5c66c,_0x2b59be){_0xf5c66c=_0xf5c66c-0x0;var _0x4cf978=_0xbe6f[_0xf5c66c];return _0x4cf978;};'use strict';var multer=require(_0xfbe6('0x0'));var util=require(_0xfbe6('0x1'));var path=require('path');var timeout=require(_0xfbe6('0x2'));var express=require('express');var router=express[_0xfbe6('0x3')]();var fs_extra=require(_0xfbe6('0x4'));var auth=require(_0xfbe6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfbe6('0x6'));var controller=require('./automation.controller');router[_0xfbe6('0x7')]('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x9')]);router[_0xfbe6('0x7')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xb')]);router[_0xfbe6('0x7')](_0xfbe6('0xc'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0xd')]);router[_0xfbe6('0x7')](_0xfbe6('0xe'),auth['isAuthenticated'](),controller[_0xfbe6('0xf')]);router[_0xfbe6('0x10')]('/',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x11')]);router[_0xfbe6('0x10')](_0xfbe6('0xc'),auth['isAuthenticated'](),controller['addConditions']);router['post']('/:id/actions',auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x12')]);router[_0xfbe6('0x13')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x14')]);router[_0xfbe6('0x15')](_0xfbe6('0xa'),auth[_0xfbe6('0x8')](),controller[_0xfbe6('0x16')]);module[_0xfbe6('0x17')]=router; \ No newline at end of file +var _0xb332=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','/:id','update','destroy','multer','path','connect-timeout'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xb332,0xd9));var _0x2b33=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb332[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require(_0x2b33('0x2'));var express=require('express');var router=express[_0x2b33('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2b33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2b33('0x5'));var controller=require('./automation.controller');router[_0x2b33('0x6')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0x8')]);router[_0x2b33('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2b33('0x9')]);router['get'](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xb')]);router[_0x2b33('0x6')]('/:id/actions',auth[_0x2b33('0x7')](),controller[_0x2b33('0xc')]);router[_0x2b33('0xd')]('/',auth[_0x2b33('0x7')](),controller[_0x2b33('0xe')]);router[_0x2b33('0xd')](_0x2b33('0xa'),auth[_0x2b33('0x7')](),controller[_0x2b33('0xf')]);router[_0x2b33('0xd')](_0x2b33('0x10'),auth['isAuthenticated'](),controller[_0x2b33('0x11')]);router[_0x2b33('0x12')](_0x2b33('0x13'),auth['isAuthenticated'](),controller[_0x2b33('0x14')]);router['delete'](_0x2b33('0x13'),auth[_0x2b33('0x7')](),controller[_0x2b33('0x15')]);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 a67408d..f3eaa69 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 _0xd5bf=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#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)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC'];(function(_0x3fb041,_0x559f76){var _0x17b10e=function(_0x1c24a6){while(--_0x1c24a6){_0x3fb041['push'](_0x3fb041['shift']());}};_0x17b10e(++_0x559f76);}(_0xd5bf,0x1eb));var _0xfd5b=function(_0x41f047,_0x58bb9e){_0x41f047=_0x41f047-0x0;var _0x457b8b=_0xd5bf[_0x41f047];return _0x457b8b;};'use strict';var Sequelize=require(_0xfd5b('0x0'));module[_0xfd5b('0x1')]={'name':{'type':Sequelize[_0xfd5b('0x2')],'unique':_0xfd5b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x5')),'allowNull':![],'defaultValue':_0xfd5b('0x5')},'description':{'type':Sequelize[_0xfd5b('0x2')]},'active':{'type':Sequelize[_0xfd5b('0x6')],'defaultValue':0x0,'comment':_0xfd5b('0x7')},'limitCalls':{'type':Sequelize[_0xfd5b('0x8')](0x4)[_0xfd5b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xfd5b('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xfd5b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xfd5b('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':_0xfd5b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x10'),_0xfd5b('0x11'),'onlyIfOpen'),'defaultValue':_0xfd5b('0x10')},'dialAMDActive':{'type':Sequelize[_0xfd5b('0x6')],'defaultValue':0x0,'comment':_0xfd5b('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xfd5b('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xfd5b('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xfd5b('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xfd5b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd5b('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xfd5b('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xfd5b('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xfd5b('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xfd5b('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xfd5b('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xfd5b('0x8')](0x9)[_0xfd5b('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xfd5b('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xfd5b('0x4')](_0xfd5b('0x1b'),_0xfd5b('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xfd5b('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd5b('0x1d')},'dialCutDigit':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xfd5b('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xfd5b('0x8')](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xfd5b('0x8')](0x3)[_0xfd5b('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xfd5b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xfd5b('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xfd5b('0x27')}}; \ No newline at end of file +var _0xa7d0=['#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','#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,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x22f5dc,_0x2849f2){var _0x1d21d2=function(_0x1a4fce){while(--_0x1a4fce){_0x22f5dc['push'](_0x22f5dc['shift']());}};_0x1d21d2(++_0x2849f2);}(_0xa7d0,0xe2));var _0x0a7d=function(_0x13b0c9,_0x7b6a73){_0x13b0c9=_0x13b0c9-0x0;var _0x97e169=_0xa7d0[_0x13b0c9];return _0x97e169;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a7d('0x1')],'unique':_0x0a7d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0a7d('0x3')),'allowNull':![],'defaultValue':_0x0a7d('0x3')},'description':{'type':Sequelize[_0x0a7d('0x1')]},'active':{'type':Sequelize[_0x0a7d('0x4')],'defaultValue':0x0,'comment':_0x0a7d('0x5')},'limitCalls':{'type':Sequelize[_0x0a7d('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0a7d('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a7d('0xf')},'dialTimezone':{'type':Sequelize[_0x0a7d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0a7d('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x0a7d('0x11')),'defaultValue':_0x0a7d('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a7d('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a7d('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a7d('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a7d('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a7d('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a7d('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a7d('0x1b')](_0x0a7d('0x1c'),_0x0a7d('0x1d')),'defaultValue':_0x0a7d('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a7d('0x1e')},'dialCutDigit':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 9d81bfd..c33fc34 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 _0xff6e=['insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','scheduledAt','cm_contacts','ListId\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','push','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','CmHopper','hasOwnProperty','pick','CampaignId','CmHopperHistory','getHopperFinals','findOne','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','ids','spread','dialCheckDuplicateType'];(function(_0x191bb6,_0x1d71c4){var _0x4a6f30=function(_0x3255c6){while(--_0x3255c6){_0x191bb6['push'](_0x191bb6['shift']());}};_0x4a6f30(++_0x1d71c4);}(_0xff6e,0xa4));var _0xeff6=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0xff6e[_0x4f5108];return _0x2d56ca;};'use strict';var emlformat=require(_0xeff6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeff6('0x1'));var rp=require(_0xeff6('0x2'));var moment=require(_0xeff6('0x3'));var BPromise=require(_0xeff6('0x4'));var Mustache=require(_0xeff6('0x5'));var util=require(_0xeff6('0x6'));var path=require(_0xeff6('0x7'));var sox=require(_0xeff6('0x8'));var csv=require(_0xeff6('0x9'));var ejs=require(_0xeff6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeff6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeff6('0xc'));var toCsv=require(_0xeff6('0x9'));var querystring=require(_0xeff6('0xd'));var Papa=require('papaparse');var Redis=require(_0xeff6('0xe'));var authService=require(_0xeff6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xeff6('0x10'));var hardwareService=require(_0xeff6('0x11'));var logger=require(_0xeff6('0x12'))(_0xeff6('0x13'));var utils=require(_0xeff6('0x14'));var config=require(_0xeff6('0x15'));var licenseUtil=require(_0xeff6('0x16'));var db=require(_0xeff6('0x17'))['db'];function respondWithStatusCode(_0x5d2d1e,_0x2ff20d){_0x2ff20d=_0x2ff20d||0xcc;return function(_0x198d57){if(_0x198d57){return _0x5d2d1e[_0xeff6('0x18')](_0x2ff20d);}return _0x5d2d1e['status'](_0x2ff20d)[_0xeff6('0x19')]();};}function respondWithResult(_0x2406e1,_0x3d038a){_0x3d038a=_0x3d038a||0xc8;return function(_0x3d2f0c){if(_0x3d2f0c){return _0x2406e1[_0xeff6('0x1a')](_0x3d038a)[_0xeff6('0x1b')](_0x3d2f0c);}};}function respondWithFilteredResult(_0x8660e4,_0x50e07e){return function(_0x108662){if(_0x108662){var _0x44a15d=typeof _0x50e07e['offset']===_0xeff6('0x1c')&&typeof _0x50e07e[_0xeff6('0x1d')]===_0xeff6('0x1c');var _0x3d360f=_0x108662['count'];var _0x5946d4=_0x44a15d?0x0:_0x50e07e[_0xeff6('0x1e')];var _0x4cf91e=_0x44a15d?_0x108662[_0xeff6('0x1f')]:_0x50e07e[_0xeff6('0x1e')]+_0x50e07e[_0xeff6('0x1d')];var _0x2566d2;if(_0x4cf91e>=_0x3d360f){_0x4cf91e=_0x3d360f;_0x2566d2=0xc8;}else{_0x2566d2=0xce;}_0x8660e4[_0xeff6('0x1a')](_0x2566d2);return _0x8660e4[_0xeff6('0x20')]('Content-Range',_0x5946d4+'-'+_0x4cf91e+'/'+_0x3d360f)[_0xeff6('0x1b')](_0x108662);}return null;};}function patchUpdates(_0x557e42){return function(_0x1b98ff){try{jsonpatch[_0xeff6('0x21')](_0x1b98ff,_0x557e42,!![]);}catch(_0x24bb20){return BPromise[_0xeff6('0x22')](_0x24bb20);}return _0x1b98ff['save']();};}function saveUpdates(_0x32b2e5,_0x3a758d){return function(_0xc44145){if(_0xc44145){return _0xc44145['update'](_0x32b2e5)[_0xeff6('0x23')](function(_0x45d08b){return _0x45d08b;});}return null;};}function removeEntity(_0x5cb0fe,_0x106326){return function(_0x504fe8){if(_0x504fe8){return _0x504fe8[_0xeff6('0x24')]()[_0xeff6('0x23')](function(){var _0x382986=_0x504fe8[_0xeff6('0x25')]({'plain':!![]});var _0x2fd1f8='IvrCampaigns';return db[_0xeff6('0x26')][_0xeff6('0x24')]({'where':{'type':_0x2fd1f8,'resourceId':_0x382986['id']}})['then'](function(){return _0x504fe8;});})[_0xeff6('0x23')](function(){_0x5cb0fe[_0xeff6('0x1a')](0xcc)[_0xeff6('0x19')]();});}};}function handleEntityNotFound(_0x597a2d,_0x44c3e5){return function(_0x167c15){if(!_0x167c15){_0x597a2d[_0xeff6('0x18')](0x194);}return _0x167c15;};}function handleError(_0x29511d,_0x46cf22){_0x46cf22=_0x46cf22||0x1f4;return function(_0x11257d){logger[_0xeff6('0x27')](_0x11257d[_0xeff6('0x28')]);if(_0x11257d[_0xeff6('0x29')]){delete _0x11257d[_0xeff6('0x29')];}_0x29511d[_0xeff6('0x1a')](_0x46cf22)[_0xeff6('0x2a')](_0x11257d);};}exports[_0xeff6('0x2b')]=function(_0x5815db,_0x289e3b){var _0x35ee5b={},_0x33e717={},_0x2a1b41={'count':0x0,'rows':[]};var _0x1d8dab=_[_0xeff6('0x2c')](db[_0xeff6('0x2d')]['rawAttributes'],function(_0x10dd51){return{'name':_0x10dd51['fieldName'],'type':_0x10dd51[_0xeff6('0x2e')][_0xeff6('0x2f')]};});_0x33e717[_0xeff6('0x30')]=_['map'](_0x1d8dab,_0xeff6('0x29'));_0x33e717[_0xeff6('0x31')]=_['keys'](_0x5815db[_0xeff6('0x31')]);_0x33e717['filters']=_[_0xeff6('0x32')](_0x33e717[_0xeff6('0x30')],_0x33e717['query']);_0x35ee5b[_0xeff6('0x33')]=_['intersection'](_0x33e717['model'],qs[_0xeff6('0x34')](_0x5815db[_0xeff6('0x31')][_0xeff6('0x34')]));_0x35ee5b[_0xeff6('0x33')]=_0x35ee5b['attributes']['length']?_0x35ee5b['attributes']:_0x33e717[_0xeff6('0x30')];if(!_0x5815db[_0xeff6('0x31')]['hasOwnProperty'](_0xeff6('0x35'))){_0x35ee5b[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x5815db[_0xeff6('0x31')]['limit']);_0x35ee5b[_0xeff6('0x1e')]=qs['offset'](_0x5815db['query'][_0xeff6('0x1e')]);}_0x35ee5b[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x5815db[_0xeff6('0x31')][_0xeff6('0x37')]);_0x35ee5b[_0xeff6('0x38')]=qs[_0xeff6('0x39')](_['pick'](_0x5815db[_0xeff6('0x31')],_0x33e717[_0xeff6('0x39')]),_0x1d8dab);if(_0x5815db[_0xeff6('0x31')][_0xeff6('0x3a')]){_0x35ee5b[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x35ee5b[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x1d8dab,function(_0x4e254d){if(_0x4e254d[_0xeff6('0x2e')]!==_0xeff6('0x3c')){var _0x2bedd6={};_0x2bedd6[_0x4e254d[_0xeff6('0x29')]]={'$like':'%'+_0x5815db['query'][_0xeff6('0x3a')]+'%'};return _0x2bedd6;}})});}_0x35ee5b=_[_0xeff6('0x3b')]({},_0x35ee5b,_0x5815db['options']);var _0x24999a={'where':_0x35ee5b[_0xeff6('0x38')]};return db['Campaign'][_0xeff6('0x1f')](_0x24999a)['then'](function(_0x427592){_0x2a1b41[_0xeff6('0x1f')]=_0x427592;if(_0x5815db[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x35ee5b[_0xeff6('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0xeff6('0x3f')](_0x35ee5b);})[_0xeff6('0x23')](function(_0x430dbd){_0x2a1b41[_0xeff6('0x40')]=_0x430dbd;return _0x2a1b41;})[_0xeff6('0x23')](respondWithFilteredResult(_0x289e3b,_0x35ee5b))[_0xeff6('0x41')](handleError(_0x289e3b,null));};exports[_0xeff6('0x42')]=function(_0x4e1939,_0x2241b8){var _0x59d872={'raw':![],'where':{'id':_0x4e1939['params']['id']}},_0x3cd62b={};_0x3cd62b[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x2d')][_0xeff6('0x44')]);_0x3cd62b[_0xeff6('0x31')]=_['keys'](_0x4e1939[_0xeff6('0x31')]);_0x3cd62b['filters']=_[_0xeff6('0x32')](_0x3cd62b[_0xeff6('0x30')],_0x3cd62b['query']);_0x59d872[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x3cd62b[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x4e1939[_0xeff6('0x31')][_0xeff6('0x34')]));_0x59d872[_0xeff6('0x33')]=_0x59d872[_0xeff6('0x33')][_0xeff6('0x45')]?_0x59d872[_0xeff6('0x33')]:_0x3cd62b[_0xeff6('0x30')];if(_0x4e1939[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x59d872[_0xeff6('0x3e')]=[{'all':!![]}];}_0x59d872=_[_0xeff6('0x3b')]({},_0x59d872,_0x4e1939[_0xeff6('0x46')]);return db['Campaign'][_0xeff6('0x47')](_0x59d872)['then'](handleEntityNotFound(_0x2241b8,null))[_0xeff6('0x23')](respondWithResult(_0x2241b8,null))[_0xeff6('0x41')](handleError(_0x2241b8,null));};exports[_0xeff6('0x48')]=function(_0x2ca3fb,_0x43cb7b){return db[_0xeff6('0x2d')][_0xeff6('0x48')](_0x2ca3fb[_0xeff6('0x49')],{})[_0xeff6('0x23')](function(_0x289b12){var _0x5dcbf0=_0x2ca3fb[_0xeff6('0x4a')][_0xeff6('0x25')]({'plain':!![]});if(!_0x5dcbf0)throw new Error(_0xeff6('0x4b'));if(_0x5dcbf0[_0xeff6('0x4c')]===_0xeff6('0x4a')){var _0x13ea5c=_0x289b12['get']({'plain':!![]});var _0x365ba7=_0xeff6('0x4d');return db[_0xeff6('0x4e')][_0xeff6('0x47')]({'where':{'name':_0x365ba7,'userProfileId':_0x5dcbf0[_0xeff6('0x4f')]},'raw':!![]})[_0xeff6('0x23')](function(_0x4f7138){if(_0x4f7138&&_0x4f7138[_0xeff6('0x50')]===0x0){return db[_0xeff6('0x26')][_0xeff6('0x48')]({'name':_0x13ea5c[_0xeff6('0x29')],'resourceId':_0x13ea5c['id'],'type':_0x4f7138[_0xeff6('0x29')],'sectionId':_0x4f7138['id']},{})[_0xeff6('0x23')](function(){return _0x289b12;});}else{return _0x289b12;}})[_0xeff6('0x41')](function(_0x542eec){logger[_0xeff6('0x27')](_0xeff6('0x51'),_0x542eec);throw _0x542eec;});}return _0x289b12;})[_0xeff6('0x23')](respondWithResult(_0x43cb7b,0xc9))[_0xeff6('0x41')](handleError(_0x43cb7b,null));};exports[_0xeff6('0x52')]=function(_0x28e963,_0x5c5e95){var _0x2b5a8b={'where':{'id':_0x28e963[_0xeff6('0x53')]['id']}},_0x211ef0={};_0x211ef0[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x2d')]['rawAttributes']);_0x2b5a8b[_0xeff6('0x33')]=_['intersection'](_0x211ef0[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x28e963['query'][_0xeff6('0x34')]));_0x2b5a8b[_0xeff6('0x33')]=_0x2b5a8b['attributes'][_0xeff6('0x45')]?_0x2b5a8b['attributes']:_0x211ef0[_0xeff6('0x30')];if(_0x28e963[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x2b5a8b['include']=[{'all':!![]}];}_0x2b5a8b=_[_0xeff6('0x3b')]({},_0x2b5a8b,_0x28e963[_0xeff6('0x46')]);return db[_0xeff6('0x2d')][_0xeff6('0x47')](_0x2b5a8b)[_0xeff6('0x23')](handleEntityNotFound(_0x5c5e95,null))['then'](function(_0x1adb7c){if(_0x1adb7c){var _0x5f2bba=_0x1adb7c['get']({'plain':!![]});_0x5f2bba=qs[_0xeff6('0x54')](_0x5f2bba,['id',_0xeff6('0x55'),_0xeff6('0x56')]);_0x28e963[_0xeff6('0x49')]=_[_0xeff6('0x54')](_0x28e963[_0xeff6('0x49')],['id',_0xeff6('0x55'),_0xeff6('0x56')]);return db['Campaign']['create'](_[_0xeff6('0x3b')](_0x5f2bba,_0x28e963[_0xeff6('0x49')]),{'include':_0x28e963[_0xeff6('0x31')][_0xeff6('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x12d139){var _0x31e2ee=_0x28e963[_0xeff6('0x4a')][_0xeff6('0x25')]({'plain':!![]});if(!_0x31e2ee)throw new Error(_0xeff6('0x4b'));if(_0x31e2ee[_0xeff6('0x4c')]===_0xeff6('0x4a')){var _0x5015d4=_0x12d139['get']({'plain':!![]});var _0x30cd21=_0xeff6('0x4d');return db[_0xeff6('0x4e')][_0xeff6('0x47')]({'where':{'name':_0x30cd21,'userProfileId':_0x31e2ee['userProfileId']},'raw':!![]})[_0xeff6('0x23')](function(_0x155d5d){if(_0x155d5d&&_0x155d5d[_0xeff6('0x50')]===0x0){return db[_0xeff6('0x26')][_0xeff6('0x48')]({'name':_0x5015d4[_0xeff6('0x29')],'resourceId':_0x5015d4['id'],'type':_0x155d5d[_0xeff6('0x29')],'sectionId':_0x155d5d['id']},{})[_0xeff6('0x23')](function(){return _0x12d139;});}else{return _0x12d139;}})['catch'](function(_0x2c00a3){logger[_0xeff6('0x27')](_0xeff6('0x51'),_0x2c00a3);throw _0x2c00a3;});}return _0x12d139;});}})['then'](respondWithResult(_0x5c5e95,0xc9))[_0xeff6('0x41')](handleError(_0x5c5e95,null));};exports['update']=function(_0x2a5906,_0x53771b){if(_0x2a5906['body']['id']){delete _0x2a5906['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x2a5906[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x53771b,null))[_0xeff6('0x23')](saveUpdates(_0x2a5906[_0xeff6('0x49')],null))['then'](respondWithResult(_0x53771b,null))[_0xeff6('0x41')](handleError(_0x53771b,null));};exports['destroy']=function(_0x1ef630,_0x4e50bf){return db['Campaign'][_0xeff6('0x47')]({'where':{'id':_0x1ef630['params']['id']}})['then'](handleEntityNotFound(_0x4e50bf,null))['then'](removeEntity(_0x4e50bf,null))['catch'](handleError(_0x4e50bf,null));};exports['getHoppers']=function(_0x1b9d7d,_0x3b1f63,_0x476d99){var _0x426034={'raw':!![],'where':{}};var _0x231178={};var _0x4dbd08={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x1b9d7d[_0xeff6('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b1f63,null))['then'](function(_0x285f5c){if(_0x285f5c){_0x231178[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x57')]['rawAttributes']);_0x231178[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x1b9d7d[_0xeff6('0x31')]);_0x231178['filters']=_[_0xeff6('0x32')](_0x231178[_0xeff6('0x30')],_0x231178[_0xeff6('0x31')]);_0x426034[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x231178['model'],qs[_0xeff6('0x34')](_0x1b9d7d['query'][_0xeff6('0x34')]));_0x426034[_0xeff6('0x33')]=_0x426034[_0xeff6('0x33')][_0xeff6('0x45')]?_0x426034['attributes']:_0x231178[_0xeff6('0x30')];if(!_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x58')](_0xeff6('0x35'))){_0x426034[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x426034[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x426034['order']=qs[_0xeff6('0x37')](_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x37')]);_0x426034['where']=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x1b9d7d[_0xeff6('0x31')],_0x231178[_0xeff6('0x39')]));_0x426034[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x285f5c['id'];if(_0x1b9d7d['query'][_0xeff6('0x3a')]){_0x426034[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x426034['where'],{'$or':_[_0xeff6('0x2c')](_0x426034['attributes'],function(_0x1c757c){var _0x2edf79={};_0x2edf79[_0x1c757c]={'$like':'%'+_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x2edf79;})});}_0x426034=_['merge']({},_0x426034,_0x1b9d7d['options']);return db[_0xeff6('0x57')][_0xeff6('0x1f')]({'where':_0x426034['where']})[_0xeff6('0x23')](function(_0x267a9c){_0x4dbd08[_0xeff6('0x1f')]=_0x267a9c;if(_0x1b9d7d[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x426034[_0xeff6('0x3e')]=[{'all':!![]}];}return db[_0xeff6('0x57')]['findAll'](_0x426034);})[_0xeff6('0x23')](function(_0x2ca9d7){_0x4dbd08[_0xeff6('0x40')]=_0x2ca9d7;return _0x4dbd08;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x3b1f63,_0x426034))[_0xeff6('0x41')](handleError(_0x3b1f63,null));};exports['getHopperHistories']=function(_0x54d31e,_0x10865c,_0x4af4f7){var _0x5edbec={'raw':!![],'where':{}};var _0x4125c3={};var _0x237a1b={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x54d31e[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x10865c,null))[_0xeff6('0x23')](function(_0x189f9f){if(_0x189f9f){_0x4125c3[_0xeff6('0x30')]=_[_0xeff6('0x43')](db['CmHopperHistory'][_0xeff6('0x44')]);_0x4125c3['query']=_[_0xeff6('0x43')](_0x54d31e[_0xeff6('0x31')]);_0x4125c3[_0xeff6('0x39')]=_['intersection'](_0x4125c3[_0xeff6('0x30')],_0x4125c3[_0xeff6('0x31')]);_0x5edbec[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x4125c3[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x54d31e[_0xeff6('0x31')]['fields']));_0x5edbec[_0xeff6('0x33')]=_0x5edbec[_0xeff6('0x33')][_0xeff6('0x45')]?_0x5edbec[_0xeff6('0x33')]:_0x4125c3[_0xeff6('0x30')];if(!_0x54d31e['query'][_0xeff6('0x58')](_0xeff6('0x35'))){_0x5edbec[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x5edbec[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x5edbec[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x54d31e[_0xeff6('0x31')][_0xeff6('0x37')]);_0x5edbec['where']=qs['filters'](_[_0xeff6('0x59')](_0x54d31e[_0xeff6('0x31')],_0x4125c3[_0xeff6('0x39')]));_0x5edbec[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x189f9f['id'];if(_0x54d31e['query'][_0xeff6('0x3a')]){_0x5edbec[_0xeff6('0x38')]=_[_0xeff6('0x3b')](_0x5edbec[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x5edbec[_0xeff6('0x33')],function(_0x14236d){var _0xd818b3={};_0xd818b3[_0x14236d]={'$like':'%'+_0x54d31e[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0xd818b3;})});}_0x5edbec=_['merge']({},_0x5edbec,_0x54d31e[_0xeff6('0x46')]);return db[_0xeff6('0x5b')][_0xeff6('0x1f')]({'where':_0x5edbec[_0xeff6('0x38')]})[_0xeff6('0x23')](function(_0x561b74){_0x237a1b[_0xeff6('0x1f')]=_0x561b74;if(_0x54d31e[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x5edbec[_0xeff6('0x3e')]=[{'all':!![]}];}return db[_0xeff6('0x5b')][_0xeff6('0x3f')](_0x5edbec);})['then'](function(_0x196224){_0x237a1b[_0xeff6('0x40')]=_0x196224;return _0x237a1b;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x10865c,_0x5edbec))[_0xeff6('0x41')](handleError(_0x10865c,null));};exports[_0xeff6('0x5c')]=function(_0x55fd61,_0x1a5a76,_0x5ae44f){var _0x187a48={'raw':!![],'where':{}};var _0x3277c1={};var _0x365e90={'count':0x0,'rows':[]};return db['Campaign'][_0xeff6('0x5d')]({'where':{'id':_0x55fd61['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x1a5a76,null))[_0xeff6('0x23')](function(_0x3a6934){if(_0x3a6934){_0x3277c1[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x5e')][_0xeff6('0x44')]);_0x3277c1[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x55fd61[_0xeff6('0x31')]);_0x3277c1['filters']=_[_0xeff6('0x32')](_0x3277c1[_0xeff6('0x30')],_0x3277c1[_0xeff6('0x31')]);_0x187a48['attributes']=_[_0xeff6('0x32')](_0x3277c1[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x55fd61[_0xeff6('0x31')]['fields']));_0x187a48[_0xeff6('0x33')]=_0x187a48[_0xeff6('0x33')]['length']?_0x187a48['attributes']:_0x3277c1['model'];if(!_0x55fd61[_0xeff6('0x31')][_0xeff6('0x58')](_0xeff6('0x35'))){_0x187a48[_0xeff6('0x1d')]=qs['limit'](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x187a48[_0xeff6('0x1e')]=qs['offset'](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x187a48[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x55fd61[_0xeff6('0x31')][_0xeff6('0x37')]);_0x187a48[_0xeff6('0x38')]=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x55fd61['query'],_0x3277c1[_0xeff6('0x39')]));_0x187a48['where'][_0xeff6('0x5a')]=_0x3a6934['id'];if(_0x55fd61['query'][_0xeff6('0x3a')]){_0x187a48['where']=_[_0xeff6('0x3b')](_0x187a48[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x187a48[_0xeff6('0x33')],function(_0x2eb1a8){var _0x2b8360={};_0x2b8360[_0x2eb1a8]={'$like':'%'+_0x55fd61[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x2b8360;})});}_0x187a48=_['merge']({},_0x187a48,_0x55fd61[_0xeff6('0x46')]);return db[_0xeff6('0x5e')][_0xeff6('0x1f')]({'where':_0x187a48['where']})[_0xeff6('0x23')](function(_0x105075){_0x365e90['count']=_0x105075;if(_0x55fd61['query']['includeAll']){_0x187a48['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xeff6('0x3f')](_0x187a48);})['then'](function(_0x1a21f5){_0x365e90['rows']=_0x1a21f5;return _0x365e90;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x1a5a76,_0x187a48))['catch'](handleError(_0x1a5a76,null));};exports[_0xeff6('0x5f')]=function(_0x2b4c22,_0x9a1b45,_0x20f46a){var _0x2e5d5c={'raw':!![],'where':{}};var _0x959f29={};var _0x4603b4={'count':0x0,'rows':[]};return db[_0xeff6('0x2d')]['findOne']({'where':{'id':_0x2b4c22['params']['id']}})['then'](handleEntityNotFound(_0x9a1b45,null))[_0xeff6('0x23')](function(_0x5e7453){if(_0x5e7453){_0x959f29[_0xeff6('0x30')]=_[_0xeff6('0x43')](db['CmHopperBlack'][_0xeff6('0x44')]);_0x959f29[_0xeff6('0x31')]=_[_0xeff6('0x43')](_0x2b4c22[_0xeff6('0x31')]);_0x959f29[_0xeff6('0x39')]=_[_0xeff6('0x32')](_0x959f29['model'],_0x959f29[_0xeff6('0x31')]);_0x2e5d5c['attributes']=_['intersection'](_0x959f29[_0xeff6('0x30')],qs['fields'](_0x2b4c22[_0xeff6('0x31')]['fields']));_0x2e5d5c[_0xeff6('0x33')]=_0x2e5d5c[_0xeff6('0x33')][_0xeff6('0x45')]?_0x2e5d5c[_0xeff6('0x33')]:_0x959f29[_0xeff6('0x30')];if(!_0x2b4c22['query'][_0xeff6('0x58')](_0xeff6('0x35'))){_0x2e5d5c['limit']=qs[_0xeff6('0x1d')](_0x2b4c22[_0xeff6('0x31')]['limit']);_0x2e5d5c[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x2b4c22[_0xeff6('0x31')][_0xeff6('0x1e')]);}_0x2e5d5c['order']=qs[_0xeff6('0x37')](_0x2b4c22[_0xeff6('0x31')]['sort']);_0x2e5d5c['where']=qs['filters'](_[_0xeff6('0x59')](_0x2b4c22['query'],_0x959f29['filters']));_0x2e5d5c[_0xeff6('0x38')][_0xeff6('0x5a')]=_0x5e7453['id'];if(_0x2b4c22[_0xeff6('0x31')]['filter']){_0x2e5d5c[_0xeff6('0x38')]=_['merge'](_0x2e5d5c[_0xeff6('0x38')],{'$or':_['map'](_0x2e5d5c[_0xeff6('0x33')],function(_0x5b9c4d){var _0x1f71f7={};_0x1f71f7[_0x5b9c4d]={'$like':'%'+_0x2b4c22['query'][_0xeff6('0x3a')]+'%'};return _0x1f71f7;})});}_0x2e5d5c=_['merge']({},_0x2e5d5c,_0x2b4c22[_0xeff6('0x46')]);return db[_0xeff6('0x60')][_0xeff6('0x1f')]({'where':_0x2e5d5c[_0xeff6('0x38')]})[_0xeff6('0x23')](function(_0x1152fb){_0x4603b4[_0xeff6('0x1f')]=_0x1152fb;if(_0x2b4c22[_0xeff6('0x31')][_0xeff6('0x3d')]){_0x2e5d5c[_0xeff6('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xeff6('0x3f')](_0x2e5d5c);})[_0xeff6('0x23')](function(_0x431082){_0x4603b4[_0xeff6('0x40')]=_0x431082;return _0x4603b4;});}})[_0xeff6('0x23')](respondWithFilteredResult(_0x9a1b45,_0x2e5d5c))[_0xeff6('0x41')](handleError(_0x9a1b45,null));};exports['getLists']=function(_0x452798,_0xfd756b,_0x129df7){var _0x181b72={};var _0x17eba1={};var _0x19add8;var _0x5cdf1b;return db[_0xeff6('0x2d')][_0xeff6('0x5d')]({'where':{'id':_0x452798['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0xfd756b,null))['then'](function(_0x4fd956){if(_0x4fd956){_0x19add8=_0x4fd956;_0x17eba1[_0xeff6('0x30')]=_[_0xeff6('0x43')](db[_0xeff6('0x61')][_0xeff6('0x44')]);_0x17eba1['query']=_[_0xeff6('0x43')](_0x452798[_0xeff6('0x31')]);_0x17eba1['filters']=_[_0xeff6('0x32')](_0x17eba1[_0xeff6('0x30')],_0x17eba1[_0xeff6('0x31')]);_0x181b72[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x17eba1['model'],qs['fields'](_0x452798[_0xeff6('0x31')][_0xeff6('0x34')]));_0x181b72[_0xeff6('0x33')]=_0x181b72[_0xeff6('0x33')]['length']?_0x181b72[_0xeff6('0x33')]:_0x17eba1[_0xeff6('0x30')];_0x181b72[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x452798[_0xeff6('0x31')]['sort']);_0x181b72['where']=qs['filters'](_[_0xeff6('0x59')](_0x452798[_0xeff6('0x31')],_0x17eba1['filters']));if(_0x452798[_0xeff6('0x31')]['filter']){_0x181b72['where']=_[_0xeff6('0x3b')](_0x181b72[_0xeff6('0x38')],{'$or':_[_0xeff6('0x2c')](_0x181b72['attributes'],function(_0x25dad4){var _0x34441b={};_0x34441b[_0x25dad4]={'$like':'%'+_0x452798[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x34441b;})});}_0x181b72=_[_0xeff6('0x3b')]({},_0x181b72,_0x452798[_0xeff6('0x46')]);return _0x19add8['getLists'](_0x181b72);}})['then'](function(_0x2cc09b){if(_0x2cc09b){_0x5cdf1b=_0x2cc09b[_0xeff6('0x45')];if(!_0x452798[_0xeff6('0x31')]['hasOwnProperty'](_0xeff6('0x35'))){_0x181b72['limit']=qs['limit'](_0x452798['query']['limit']);_0x181b72['offset']=qs[_0xeff6('0x1e')](_0x452798[_0xeff6('0x31')][_0xeff6('0x1e')]);}return _0x19add8[_0xeff6('0x62')](_0x181b72);}})['then'](function(_0x5390cb){if(_0x5390cb){return _0x5390cb?{'count':_0x5cdf1b,'rows':_0x5390cb}:null;}})[_0xeff6('0x23')](respondWithResult(_0xfd756b,null))[_0xeff6('0x41')](handleError(_0xfd756b,null));};exports['addLists']=function(_0x2de078,_0x3f1d48,_0x42ca2d){var _0x167e90,_0xdf5a4b;return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x2de078['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x3f1d48,null))[_0xeff6('0x23')](function(_0x153ef7){if(_0x153ef7){_0xdf5a4b=_0x153ef7;return _0x153ef7['addLists'](_0x2de078[_0xeff6('0x49')][_0xeff6('0x63')],_[_0xeff6('0x54')](_0x2de078[_0xeff6('0x49')],['ids','id'])||{});}return null;})[_0xeff6('0x64')](function(_0x1db90e){var _0x54824c;_0x167e90=_0x1db90e||[];var _0x338aa1=[];if(_0x1db90e){for(var _0x5dfc81=0x0;_0x5dfc81<_0x1db90e[_0xeff6('0x45')];_0x5dfc81+=0x1){var _0x230415=_0x1db90e[_0x5dfc81][_0xeff6('0x25')]({'plain':!![]});_0xdf5a4b[_0xeff6('0x65')]=_0x2de078[_0xeff6('0x49')][_0xeff6('0x65')]?_0x2de078[_0xeff6('0x49')][_0xeff6('0x65')]:_0xdf5a4b[_0xeff6('0x65')];switch(_0xdf5a4b[_0xeff6('0x65')]){case'always':_0x54824c=squel[_0xeff6('0x66')]()[_0xeff6('0x67')](_0xeff6('0x68'))[_0xeff6('0x69')]([_0xeff6('0x6a'),'scheduledAt',_0xeff6('0x6b'),_0xeff6('0x6c'),'CampaignId',_0xeff6('0x55'),_0xeff6('0x56')],squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x6a'),'phone')[_0xeff6('0x6e')](_0xeff6('0x6f'),'scheduledAt')[_0xeff6('0x6e')]('id','ContactId')['field'](_0x230415[_0xeff6('0x70')][_0xeff6('0x71')](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078['params']['id']['toString'](),_0xeff6('0x5a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x55'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x56'))[_0xeff6('0x72')]('cm_contacts')[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')]('ListId\x20=\x20?',_0x230415['CmListId']['toString']())[_0xeff6('0x38')](_0xeff6('0x74'))[_0xeff6('0x38')](_0xeff6('0x75'),squel['select']()[_0xeff6('0x6e')](_0xeff6('0x76'))[_0xeff6('0x72')](_0xeff6('0x77'))[_0xeff6('0x38')]('CampaignId\x20=\x20?',_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')]()))[_0xeff6('0x38')](_0xeff6('0x75'),squel['select']()[_0xeff6('0x6e')](_0xeff6('0x78'))[_0xeff6('0x72')](_0xeff6('0x68'))[_0xeff6('0x38')](_0xeff6('0x79'),_0x2de078[_0xeff6('0x53')]['id']['toString']())))[_0xeff6('0x71')]();break;case _0xeff6('0x7a'):_0x54824c=squel['insert']()['into'](_0xeff6('0x68'))[_0xeff6('0x69')]([_0xeff6('0x6a'),_0xeff6('0x7b'),_0xeff6('0x6b'),'ListId','CampaignId',_0xeff6('0x55'),_0xeff6('0x56')],squel['select']()['field'](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),'scheduledAt')[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))['field'](_0x230415[_0xeff6('0x70')][_0xeff6('0x71')](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078['params']['id'][_0xeff6('0x71')](),'CampaignId')[_0xeff6('0x6e')]('NOW()',_0xeff6('0x55'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))['from'](_0xeff6('0x7c'))[_0xeff6('0x38')]('deletedAt\x20IS\x20NULL')[_0xeff6('0x38')](_0xeff6('0x7d'),_0x230415[_0xeff6('0x70')][_0xeff6('0x71')]())[_0xeff6('0x38')](_0xeff6('0x74'))[_0xeff6('0x38')](_0xeff6('0x75'),squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x78'))[_0xeff6('0x72')]('cm_hopper')[_0xeff6('0x38')](_0xeff6('0x79'),_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')]())))['toString']();break;default:_0x54824c=squel[_0xeff6('0x66')]()['into'](_0xeff6('0x68'))['fromQuery'](['phone',_0xeff6('0x7b'),_0xeff6('0x6b'),_0xeff6('0x6c'),_0xeff6('0x5a'),'createdAt',_0xeff6('0x56')],squel[_0xeff6('0x6d')]()[_0xeff6('0x6e')](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')](_0xeff6('0x6f'),_0xeff6('0x7b'))[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))[_0xeff6('0x6e')](_0x230415[_0xeff6('0x70')]['toString'](),_0xeff6('0x6c'))[_0xeff6('0x6e')](_0x2de078[_0xeff6('0x53')]['id'][_0xeff6('0x71')](),_0xeff6('0x5a'))[_0xeff6('0x6e')]('NOW()','createdAt')[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))['from'](_0xeff6('0x7c'))[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')](_0xeff6('0x7d'),_0x230415[_0xeff6('0x70')][_0xeff6('0x71')]())[_0xeff6('0x38')](_0xeff6('0x74')))[_0xeff6('0x71')]();}_0x338aa1['push'](db[_0xeff6('0x7e')][_0xeff6('0x31')](_0x54824c));}return BPromise[_0xeff6('0x7f')](_0x338aa1);}})[_0xeff6('0x23')](function(){return _0x167e90;})['then'](respondWithResult(_0x3f1d48,null))[_0xeff6('0x41')](handleError(_0x3f1d48,null));};exports[_0xeff6('0x80')]=function(_0x1a90a1,_0x42878d,_0xc10e37){return db['Campaign'][_0xeff6('0x47')]({'where':{'id':_0x1a90a1[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x42878d,null))[_0xeff6('0x23')](function(_0x5e62b1){if(_0x5e62b1){return _0x5e62b1['removeLists'](_0x1a90a1[_0xeff6('0x31')][_0xeff6('0x63')]);}})[_0xeff6('0x23')](function(_0x428380){if(_0x428380){return db['CmHopper'][_0xeff6('0x24')]({'where':{'ListId':_0x1a90a1[_0xeff6('0x31')][_0xeff6('0x63')],'CampaignId':_0x1a90a1[_0xeff6('0x53')]['id']}})['then'](function(){return _0x428380;});}})['then'](respondWithStatusCode(_0x42878d,null))[_0xeff6('0x41')](handleError(_0x42878d,null));};exports[_0xeff6('0x81')]=function(_0x49761a,_0xc1afce,_0x514062){var _0x9a2ff={};var _0x3728b6={};var _0x40cade;var _0x17b333;return db[_0xeff6('0x2d')][_0xeff6('0x5d')]({'where':{'id':_0x49761a[_0xeff6('0x53')]['id']}})['then'](handleEntityNotFound(_0xc1afce,null))['then'](function(_0x4a0f45){if(_0x4a0f45){_0x40cade=_0x4a0f45;_0x3728b6['model']=_[_0xeff6('0x43')](db[_0xeff6('0x61')][_0xeff6('0x44')]);_0x3728b6[_0xeff6('0x31')]=_['keys'](_0x49761a[_0xeff6('0x31')]);_0x3728b6[_0xeff6('0x39')]=_[_0xeff6('0x32')](_0x3728b6[_0xeff6('0x30')],_0x3728b6[_0xeff6('0x31')]);_0x9a2ff[_0xeff6('0x33')]=_[_0xeff6('0x32')](_0x3728b6[_0xeff6('0x30')],qs[_0xeff6('0x34')](_0x49761a[_0xeff6('0x31')]['fields']));_0x9a2ff[_0xeff6('0x33')]=_0x9a2ff[_0xeff6('0x33')][_0xeff6('0x45')]?_0x9a2ff[_0xeff6('0x33')]:_0x3728b6[_0xeff6('0x30')];_0x9a2ff[_0xeff6('0x36')]=qs[_0xeff6('0x37')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x37')]);_0x9a2ff['where']=qs[_0xeff6('0x39')](_[_0xeff6('0x59')](_0x49761a['query'],_0x3728b6[_0xeff6('0x39')]));if(_0x49761a[_0xeff6('0x31')][_0xeff6('0x3a')]){_0x9a2ff['where']=_[_0xeff6('0x3b')](_0x9a2ff['where'],{'$or':_['map'](_0x9a2ff['attributes'],function(_0x2bd11b){var _0x194406={};_0x194406[_0x2bd11b]={'$like':'%'+_0x49761a[_0xeff6('0x31')][_0xeff6('0x3a')]+'%'};return _0x194406;})});}_0x9a2ff=_[_0xeff6('0x3b')]({},_0x9a2ff,_0x49761a[_0xeff6('0x46')]);return _0x40cade[_0xeff6('0x81')](_0x9a2ff);}})[_0xeff6('0x23')](function(_0xf7f2ae){if(_0xf7f2ae){_0x17b333=_0xf7f2ae[_0xeff6('0x45')];if(!_0x49761a[_0xeff6('0x31')][_0xeff6('0x58')]('nolimit')){_0x9a2ff[_0xeff6('0x1d')]=qs[_0xeff6('0x1d')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x1d')]);_0x9a2ff[_0xeff6('0x1e')]=qs[_0xeff6('0x1e')](_0x49761a[_0xeff6('0x31')][_0xeff6('0x1e')]);}return _0x40cade[_0xeff6('0x81')](_0x9a2ff);}})[_0xeff6('0x23')](function(_0x20cf17){if(_0x20cf17){return _0x20cf17?{'count':_0x17b333,'rows':_0x20cf17}:null;}})[_0xeff6('0x23')](respondWithResult(_0xc1afce,null))[_0xeff6('0x41')](handleError(_0xc1afce,null));};exports[_0xeff6('0x82')]=function(_0x1be94e,_0x425382,_0x5293ec){var _0xaa89b6,_0x41321d;return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x1be94e[_0xeff6('0x53')]['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x425382,null))[_0xeff6('0x23')](function(_0x48d27c){if(_0x48d27c){_0x41321d=_0x48d27c;return _0x48d27c[_0xeff6('0x82')](_0x1be94e[_0xeff6('0x49')][_0xeff6('0x63')],_[_0xeff6('0x54')](_0x1be94e[_0xeff6('0x49')],[_0xeff6('0x63'),'id'])||{});}return null;})[_0xeff6('0x64')](function(_0x17c6c3){var _0x316f00;_0xaa89b6=_0x17c6c3||[];var _0x5561b5=[];if(_0x17c6c3){for(var _0x3653da=0x0;_0x3653da<_0x17c6c3[_0xeff6('0x45')];_0x3653da+=0x1){var _0xc963f4=_0x17c6c3[_0x3653da][_0xeff6('0x25')]({'plain':!![]});_0x316f00=squel[_0xeff6('0x66')]()[_0xeff6('0x67')]('cm_hopper_black')[_0xeff6('0x69')](['phone',_0xeff6('0x6b'),_0xeff6('0x6c'),_0xeff6('0x5a'),_0xeff6('0x55'),'updatedAt'],squel['select']()[_0xeff6('0x6e')](_0xeff6('0x6a'),_0xeff6('0x6a'))[_0xeff6('0x6e')]('id',_0xeff6('0x6b'))[_0xeff6('0x6e')](_0xc963f4[_0xeff6('0x70')]['toString'](),'ListId')[_0xeff6('0x6e')](_0x1be94e[_0xeff6('0x53')]['id']['toString'](),_0xeff6('0x5a'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x55'))[_0xeff6('0x6e')]('NOW()',_0xeff6('0x56'))[_0xeff6('0x72')](_0xeff6('0x7c'))[_0xeff6('0x38')](_0xeff6('0x73'))[_0xeff6('0x38')](_0xeff6('0x7d'),_0xc963f4[_0xeff6('0x70')][_0xeff6('0x71')]())['where'](_0xeff6('0x74')))[_0xeff6('0x71')]();_0x5561b5[_0xeff6('0x83')](db[_0xeff6('0x7e')][_0xeff6('0x31')](_0x316f00));}return BPromise[_0xeff6('0x7f')](_0x5561b5);}})[_0xeff6('0x23')](function(){return _0xaa89b6;})[_0xeff6('0x23')](respondWithResult(_0x425382,null))[_0xeff6('0x41')](handleError(_0x425382,null));};exports[_0xeff6('0x84')]=function(_0x218118,_0x474e11,_0x534827){return db[_0xeff6('0x2d')][_0xeff6('0x47')]({'where':{'id':_0x218118['params']['id']}})[_0xeff6('0x23')](handleEntityNotFound(_0x474e11,null))[_0xeff6('0x23')](function(_0x3b1ea3){if(_0x3b1ea3){return _0x3b1ea3[_0xeff6('0x84')](_0x218118[_0xeff6('0x31')][_0xeff6('0x63')]);}})[_0xeff6('0x23')](function(_0x4c4aa6){if(_0x4c4aa6){return db['CmHopperBlack'][_0xeff6('0x24')]({'where':{'ListId':_0x218118[_0xeff6('0x31')]['ids'],'CampaignId':_0x218118[_0xeff6('0x53')]['id']}})['then'](function(){return _0x4c4aa6;});}})[_0xeff6('0x23')](respondWithStatusCode(_0x474e11,null))[_0xeff6('0x41')](handleError(_0x474e11,null));}; \ No newline at end of file +var _0xa099=['save','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','filters','fields','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','user','userProfileId','autoAssociation','findOne','CmHopper','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','ContactId','field','phone','scheduledAt','CmListId','ListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','desk.js','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','apply','reject'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xa099,0xe6));var _0x9a09=function(_0x3d8b21,_0xfabe2e){_0x3d8b21=_0x3d8b21-0x0;var _0xd3148a=_0xa099[_0x3d8b21];return _0xd3148a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a09('0x1'));var rp=require(_0x9a09('0x2'));var moment=require(_0x9a09('0x3'));var BPromise=require(_0x9a09('0x4'));var Mustache=require(_0x9a09('0x5'));var util=require(_0x9a09('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9a09('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a09('0x8'));var _=require(_0x9a09('0x9'));var squel=require(_0x9a09('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9a09('0xb'));var toCsv=require(_0x9a09('0x7'));var querystring=require('querystring');var Papa=require(_0x9a09('0xc'));var Redis=require(_0x9a09('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9a09('0xe'));var as=require(_0x9a09('0xf'));var hardwareService=require(_0x9a09('0x10'));var logger=require('../../config/logger')(_0x9a09('0x11'));var utils=require(_0x9a09('0x12'));var config=require(_0x9a09('0x13'));var licenseUtil=require(_0x9a09('0x14'));var db=require(_0x9a09('0x15'))['db'];function respondWithStatusCode(_0xb1d6c3,_0x1c8892){_0x1c8892=_0x1c8892||0xcc;return function(_0x4ed109){if(_0x4ed109){return _0xb1d6c3[_0x9a09('0x16')](_0x1c8892);}return _0xb1d6c3[_0x9a09('0x17')](_0x1c8892)[_0x9a09('0x18')]();};}function respondWithResult(_0x100dc0,_0x4d1892){_0x4d1892=_0x4d1892||0xc8;return function(_0x1665c3){if(_0x1665c3){return _0x100dc0[_0x9a09('0x17')](_0x4d1892)[_0x9a09('0x19')](_0x1665c3);}};}function respondWithFilteredResult(_0x1e54d2,_0x520050){return function(_0x351f2f){if(_0x351f2f){var _0x16b80b=typeof _0x520050[_0x9a09('0x1a')]===_0x9a09('0x1b')&&typeof _0x520050[_0x9a09('0x1c')]==='undefined';var _0x58c009=_0x351f2f[_0x9a09('0x1d')];var _0x5538d7=_0x16b80b?0x0:_0x520050[_0x9a09('0x1a')];var _0x4ef36e=_0x16b80b?_0x351f2f[_0x9a09('0x1d')]:_0x520050[_0x9a09('0x1a')]+_0x520050[_0x9a09('0x1c')];var _0x25917f;if(_0x4ef36e>=_0x58c009){_0x4ef36e=_0x58c009;_0x25917f=0xc8;}else{_0x25917f=0xce;}_0x1e54d2['status'](_0x25917f);return _0x1e54d2['set']('Content-Range',_0x5538d7+'-'+_0x4ef36e+'/'+_0x58c009)[_0x9a09('0x19')](_0x351f2f);}return null;};}function patchUpdates(_0x1ff789){return function(_0x198385){try{jsonpatch[_0x9a09('0x1e')](_0x198385,_0x1ff789,!![]);}catch(_0x46d148){return BPromise[_0x9a09('0x1f')](_0x46d148);}return _0x198385[_0x9a09('0x20')]();};}function saveUpdates(_0x53942e,_0x50249c){return function(_0xb2868){if(_0xb2868){return _0xb2868['update'](_0x53942e)[_0x9a09('0x21')](function(_0x2adfe0){return _0x2adfe0;});}return null;};}function removeEntity(_0x32c3d5,_0x4492c7){return function(_0x2c4bf5){if(_0x2c4bf5){return _0x2c4bf5['destroy']()['then'](function(){var _0x3b77c9=_0x2c4bf5[_0x9a09('0x22')]({'plain':!![]});var _0x1ff5d9=_0x9a09('0x23');return db[_0x9a09('0x24')][_0x9a09('0x25')]({'where':{'type':_0x1ff5d9,'resourceId':_0x3b77c9['id']}})[_0x9a09('0x21')](function(){return _0x2c4bf5;});})[_0x9a09('0x21')](function(){_0x32c3d5['status'](0xcc)[_0x9a09('0x18')]();});}};}function handleEntityNotFound(_0x47b86b,_0x50e23a){return function(_0x39cd2d){if(!_0x39cd2d){_0x47b86b[_0x9a09('0x16')](0x194);}return _0x39cd2d;};}function handleError(_0x5d6ef3,_0x402f11){_0x402f11=_0x402f11||0x1f4;return function(_0x5573a9){logger[_0x9a09('0x26')](_0x5573a9[_0x9a09('0x27')]);if(_0x5573a9['name']){delete _0x5573a9[_0x9a09('0x28')];}_0x5d6ef3[_0x9a09('0x17')](_0x402f11)[_0x9a09('0x29')](_0x5573a9);};}exports[_0x9a09('0x2a')]=function(_0x1f2892,_0x4dc108){var _0x5fe3bc={},_0x36e522={},_0x276237={'count':0x0,'rows':[]};var _0x341f7d=_[_0x9a09('0x2b')](db[_0x9a09('0x2c')][_0x9a09('0x2d')],function(_0x31930d){return{'name':_0x31930d[_0x9a09('0x2e')],'type':_0x31930d[_0x9a09('0x2f')][_0x9a09('0x30')]};});_0x36e522[_0x9a09('0x31')]=_['map'](_0x341f7d,_0x9a09('0x28'));_0x36e522['query']=_[_0x9a09('0x32')](_0x1f2892[_0x9a09('0x33')]);_0x36e522['filters']=_[_0x9a09('0x34')](_0x36e522['model'],_0x36e522[_0x9a09('0x33')]);_0x5fe3bc[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x36e522[_0x9a09('0x31')],qs['fields'](_0x1f2892['query']['fields']));_0x5fe3bc[_0x9a09('0x35')]=_0x5fe3bc[_0x9a09('0x35')][_0x9a09('0x36')]?_0x5fe3bc[_0x9a09('0x35')]:_0x36e522[_0x9a09('0x31')];if(!_0x1f2892[_0x9a09('0x33')][_0x9a09('0x37')]('nolimit')){_0x5fe3bc[_0x9a09('0x1c')]=qs['limit'](_0x1f2892[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x5fe3bc[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0x1f2892['query'][_0x9a09('0x1a')]);}_0x5fe3bc[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x1f2892[_0x9a09('0x33')][_0x9a09('0x39')]);_0x5fe3bc[_0x9a09('0x3a')]=qs['filters'](_['pick'](_0x1f2892[_0x9a09('0x33')],_0x36e522['filters']),_0x341f7d);if(_0x1f2892[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x5fe3bc[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x5fe3bc[_0x9a09('0x3a')],{'$or':_[_0x9a09('0x2b')](_0x341f7d,function(_0x48b6e5){if(_0x48b6e5[_0x9a09('0x2f')]!==_0x9a09('0x3d')){var _0x3830b6={};_0x3830b6[_0x48b6e5[_0x9a09('0x28')]]={'$like':'%'+_0x1f2892['query']['filter']+'%'};return _0x3830b6;}})});}_0x5fe3bc=_[_0x9a09('0x3c')]({},_0x5fe3bc,_0x1f2892[_0x9a09('0x3e')]);var _0x551e5f={'where':_0x5fe3bc[_0x9a09('0x3a')]};return db[_0x9a09('0x2c')]['count'](_0x551e5f)['then'](function(_0x4f3dec){_0x276237[_0x9a09('0x1d')]=_0x4f3dec;if(_0x1f2892[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x5fe3bc[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x2c')][_0x9a09('0x41')](_0x5fe3bc);})[_0x9a09('0x21')](function(_0x2ff275){_0x276237[_0x9a09('0x42')]=_0x2ff275;return _0x276237;})[_0x9a09('0x21')](respondWithFilteredResult(_0x4dc108,_0x5fe3bc))[_0x9a09('0x43')](handleError(_0x4dc108,null));};exports['show']=function(_0x1d108e,_0x261450){var _0x49639b={'raw':![],'where':{'id':_0x1d108e[_0x9a09('0x44')]['id']}},_0x505b47={};_0x505b47[_0x9a09('0x31')]=_['keys'](db[_0x9a09('0x2c')][_0x9a09('0x2d')]);_0x505b47[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x1d108e[_0x9a09('0x33')]);_0x505b47[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x505b47[_0x9a09('0x31')],_0x505b47['query']);_0x49639b[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x505b47[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x1d108e[_0x9a09('0x33')][_0x9a09('0x46')]));_0x49639b[_0x9a09('0x35')]=_0x49639b[_0x9a09('0x35')]['length']?_0x49639b['attributes']:_0x505b47['model'];if(_0x1d108e['query'][_0x9a09('0x3f')]){_0x49639b['include']=[{'all':!![]}];}_0x49639b=_[_0x9a09('0x3c')]({},_0x49639b,_0x1d108e[_0x9a09('0x3e')]);return db[_0x9a09('0x2c')][_0x9a09('0x47')](_0x49639b)[_0x9a09('0x21')](handleEntityNotFound(_0x261450,null))['then'](respondWithResult(_0x261450,null))['catch'](handleError(_0x261450,null));};exports[_0x9a09('0x48')]=function(_0x1af6c3,_0x250946){return db[_0x9a09('0x2c')][_0x9a09('0x48')](_0x1af6c3['body'],{})[_0x9a09('0x21')](function(_0x3aebc4){var _0x2c145e=_0x1af6c3['user'][_0x9a09('0x22')]({'plain':!![]});if(!_0x2c145e)throw new Error(_0x9a09('0x49'));if(_0x2c145e[_0x9a09('0x4a')]==='user'){var _0x2fb867=_0x3aebc4[_0x9a09('0x22')]({'plain':!![]});var _0x29452b='IvrCampaigns';return db[_0x9a09('0x4b')]['find']({'where':{'name':_0x29452b,'userProfileId':_0x2c145e['userProfileId']},'raw':!![]})[_0x9a09('0x21')](function(_0x2e0125){if(_0x2e0125&&_0x2e0125['autoAssociation']===0x0){return db[_0x9a09('0x24')][_0x9a09('0x48')]({'name':_0x2fb867[_0x9a09('0x28')],'resourceId':_0x2fb867['id'],'type':_0x2e0125[_0x9a09('0x28')],'sectionId':_0x2e0125['id']},{})[_0x9a09('0x21')](function(){return _0x3aebc4;});}else{return _0x3aebc4;}})[_0x9a09('0x43')](function(_0x4499ce){logger[_0x9a09('0x26')](_0x9a09('0x4c'),_0x4499ce);throw _0x4499ce;});}return _0x3aebc4;})['then'](respondWithResult(_0x250946,0xc9))[_0x9a09('0x43')](handleError(_0x250946,null));};exports['clone']=function(_0x38c338,_0x7d18ee){var _0xc4f23={'where':{'id':_0x38c338[_0x9a09('0x44')]['id']}},_0x77e395={};_0x77e395['model']=_['keys'](db['Campaign'][_0x9a09('0x2d')]);_0xc4f23[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x77e395[_0x9a09('0x31')],qs['fields'](_0x38c338[_0x9a09('0x33')][_0x9a09('0x46')]));_0xc4f23[_0x9a09('0x35')]=_0xc4f23[_0x9a09('0x35')]['length']?_0xc4f23[_0x9a09('0x35')]:_0x77e395['model'];if(_0x38c338['query']['includeAll']){_0xc4f23['include']=[{'all':!![]}];}_0xc4f23=_[_0x9a09('0x3c')]({},_0xc4f23,_0x38c338[_0x9a09('0x3e')]);return db['Campaign'][_0x9a09('0x47')](_0xc4f23)[_0x9a09('0x21')](handleEntityNotFound(_0x7d18ee,null))[_0x9a09('0x21')](function(_0x20ff60){if(_0x20ff60){var _0x2cec8d=_0x20ff60[_0x9a09('0x22')]({'plain':!![]});_0x2cec8d=qs[_0x9a09('0x4d')](_0x2cec8d,['id',_0x9a09('0x4e'),_0x9a09('0x4f')]);_0x38c338[_0x9a09('0x50')]=_[_0x9a09('0x4d')](_0x38c338['body'],['id',_0x9a09('0x4e'),_0x9a09('0x4f')]);return db[_0x9a09('0x2c')][_0x9a09('0x48')](_[_0x9a09('0x3c')](_0x2cec8d,_0x38c338[_0x9a09('0x50')]),{'include':_0x38c338[_0x9a09('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0x9a09('0x21')](function(_0x58c69b){var _0x5d8f43=_0x38c338[_0x9a09('0x51')][_0x9a09('0x22')]({'plain':!![]});if(!_0x5d8f43)throw new Error(_0x9a09('0x49'));if(_0x5d8f43[_0x9a09('0x4a')]===_0x9a09('0x51')){var _0xe0edc=_0x58c69b[_0x9a09('0x22')]({'plain':!![]});var _0x2e04ce=_0x9a09('0x23');return db['UserProfileSection'][_0x9a09('0x47')]({'where':{'name':_0x2e04ce,'userProfileId':_0x5d8f43[_0x9a09('0x52')]},'raw':!![]})[_0x9a09('0x21')](function(_0x2db71a){if(_0x2db71a&&_0x2db71a[_0x9a09('0x53')]===0x0){return db[_0x9a09('0x24')][_0x9a09('0x48')]({'name':_0xe0edc[_0x9a09('0x28')],'resourceId':_0xe0edc['id'],'type':_0x2db71a[_0x9a09('0x28')],'sectionId':_0x2db71a['id']},{})['then'](function(){return _0x58c69b;});}else{return _0x58c69b;}})[_0x9a09('0x43')](function(_0x3474af){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3474af);throw _0x3474af;});}return _0x58c69b;});}})[_0x9a09('0x21')](respondWithResult(_0x7d18ee,0xc9))['catch'](handleError(_0x7d18ee,null));};exports['update']=function(_0x564a24,_0x356888){if(_0x564a24[_0x9a09('0x50')]['id']){delete _0x564a24[_0x9a09('0x50')]['id'];}return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x564a24[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x356888,null))[_0x9a09('0x21')](saveUpdates(_0x564a24[_0x9a09('0x50')],null))[_0x9a09('0x21')](respondWithResult(_0x356888,null))[_0x9a09('0x43')](handleError(_0x356888,null));};exports['destroy']=function(_0x281acf,_0x2a1b99){return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x281acf[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x2a1b99,null))[_0x9a09('0x21')](removeEntity(_0x2a1b99,null))['catch'](handleError(_0x2a1b99,null));};exports['getHoppers']=function(_0xd40d6d,_0x1e111e,_0x49e98c){var _0x140885={'raw':!![],'where':{}};var _0x298aae={};var _0x2e228d={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0xd40d6d[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e111e,null))[_0x9a09('0x21')](function(_0x5d9d6d){if(_0x5d9d6d){_0x298aae['model']=_[_0x9a09('0x32')](db[_0x9a09('0x55')][_0x9a09('0x2d')]);_0x298aae['query']=_[_0x9a09('0x32')](_0xd40d6d['query']);_0x298aae['filters']=_[_0x9a09('0x34')](_0x298aae['model'],_0x298aae[_0x9a09('0x33')]);_0x140885[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x298aae[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x46')]));_0x140885[_0x9a09('0x35')]=_0x140885[_0x9a09('0x35')]['length']?_0x140885[_0x9a09('0x35')]:_0x298aae['model'];if(!_0xd40d6d['query']['hasOwnProperty'](_0x9a09('0x56'))){_0x140885[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0xd40d6d[_0x9a09('0x33')]['limit']);_0x140885['offset']=qs[_0x9a09('0x1a')](_0xd40d6d[_0x9a09('0x33')]['offset']);}_0x140885[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0xd40d6d['query'][_0x9a09('0x39')]);_0x140885[_0x9a09('0x3a')]=qs['filters'](_[_0x9a09('0x57')](_0xd40d6d[_0x9a09('0x33')],_0x298aae[_0x9a09('0x45')]));_0x140885[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x5d9d6d['id'];if(_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x140885[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x140885['where'],{'$or':_[_0x9a09('0x2b')](_0x140885['attributes'],function(_0x3e7989){var _0x39db7b={};_0x39db7b[_0x3e7989]={'$like':'%'+_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x39db7b;})});}_0x140885=_[_0x9a09('0x3c')]({},_0x140885,_0xd40d6d[_0x9a09('0x3e')]);return db[_0x9a09('0x55')]['count']({'where':_0x140885[_0x9a09('0x3a')]})[_0x9a09('0x21')](function(_0x2b7ae4){_0x2e228d[_0x9a09('0x1d')]=_0x2b7ae4;if(_0xd40d6d[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x140885[_0x9a09('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x9a09('0x41')](_0x140885);})[_0x9a09('0x21')](function(_0x28e1cc){_0x2e228d['rows']=_0x28e1cc;return _0x2e228d;});}})['then'](respondWithFilteredResult(_0x1e111e,_0x140885))[_0x9a09('0x43')](handleError(_0x1e111e,null));};exports[_0x9a09('0x59')]=function(_0x1ab74b,_0x332f9d,_0x39765f){var _0x2fea84={'raw':!![],'where':{}};var _0x39371f={};var _0x3abed8={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')]['findOne']({'where':{'id':_0x1ab74b[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x332f9d,null))['then'](function(_0x318777){if(_0x318777){_0x39371f[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x5a')][_0x9a09('0x2d')]);_0x39371f['query']=_[_0x9a09('0x32')](_0x1ab74b[_0x9a09('0x33')]);_0x39371f[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x39371f[_0x9a09('0x31')],_0x39371f['query']);_0x2fea84['attributes']=_['intersection'](_0x39371f[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x46')]));_0x2fea84[_0x9a09('0x35')]=_0x2fea84[_0x9a09('0x35')][_0x9a09('0x36')]?_0x2fea84[_0x9a09('0x35')]:_0x39371f[_0x9a09('0x31')];if(!_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x37')](_0x9a09('0x56'))){_0x2fea84[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0x1ab74b[_0x9a09('0x33')]['limit']);_0x2fea84[_0x9a09('0x1a')]=qs['offset'](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x2fea84[_0x9a09('0x38')]=qs['sort'](_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x39')]);_0x2fea84[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_['pick'](_0x1ab74b[_0x9a09('0x33')],_0x39371f[_0x9a09('0x45')]));_0x2fea84[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x318777['id'];if(_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x2fea84[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x2fea84['where'],{'$or':_['map'](_0x2fea84[_0x9a09('0x35')],function(_0x2d0227){var _0xdcfe82={};_0xdcfe82[_0x2d0227]={'$like':'%'+_0x1ab74b[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0xdcfe82;})});}_0x2fea84=_['merge']({},_0x2fea84,_0x1ab74b['options']);return db['CmHopperHistory'][_0x9a09('0x1d')]({'where':_0x2fea84['where']})[_0x9a09('0x21')](function(_0x4882fa){_0x3abed8[_0x9a09('0x1d')]=_0x4882fa;if(_0x1ab74b['query'][_0x9a09('0x3f')]){_0x2fea84[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x5a')]['findAll'](_0x2fea84);})[_0x9a09('0x21')](function(_0x146bc4){_0x3abed8[_0x9a09('0x42')]=_0x146bc4;return _0x3abed8;});}})['then'](respondWithFilteredResult(_0x332f9d,_0x2fea84))['catch'](handleError(_0x332f9d,null));};exports['getHopperFinals']=function(_0xefd246,_0x25b2ca,_0x25b963){var _0x3ca9b8={'raw':!![],'where':{}};var _0x414ec3={};var _0x458988={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0xefd246[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x25b2ca,null))[_0x9a09('0x21')](function(_0x2d9a07){if(_0x2d9a07){_0x414ec3[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x5b')][_0x9a09('0x2d')]);_0x414ec3[_0x9a09('0x33')]=_['keys'](_0xefd246[_0x9a09('0x33')]);_0x414ec3[_0x9a09('0x45')]=_['intersection'](_0x414ec3['model'],_0x414ec3[_0x9a09('0x33')]);_0x3ca9b8['attributes']=_[_0x9a09('0x34')](_0x414ec3[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0xefd246['query'][_0x9a09('0x46')]));_0x3ca9b8['attributes']=_0x3ca9b8['attributes'][_0x9a09('0x36')]?_0x3ca9b8[_0x9a09('0x35')]:_0x414ec3[_0x9a09('0x31')];if(!_0xefd246[_0x9a09('0x33')]['hasOwnProperty']('nolimit')){_0x3ca9b8[_0x9a09('0x1c')]=qs[_0x9a09('0x1c')](_0xefd246['query'][_0x9a09('0x1c')]);_0x3ca9b8[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0xefd246[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x3ca9b8[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0xefd246[_0x9a09('0x33')]['sort']);_0x3ca9b8['where']=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0xefd246[_0x9a09('0x33')],_0x414ec3['filters']));_0x3ca9b8[_0x9a09('0x3a')][_0x9a09('0x58')]=_0x2d9a07['id'];if(_0xefd246[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x3ca9b8[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x3ca9b8[_0x9a09('0x3a')],{'$or':_[_0x9a09('0x2b')](_0x3ca9b8[_0x9a09('0x35')],function(_0x1bfca7){var _0x1be5bd={};_0x1be5bd[_0x1bfca7]={'$like':'%'+_0xefd246[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x1be5bd;})});}_0x3ca9b8=_[_0x9a09('0x3c')]({},_0x3ca9b8,_0xefd246[_0x9a09('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x3ca9b8[_0x9a09('0x3a')]})['then'](function(_0x2b0023){_0x458988[_0x9a09('0x1d')]=_0x2b0023;if(_0xefd246['query']['includeAll']){_0x3ca9b8[_0x9a09('0x40')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9a09('0x41')](_0x3ca9b8);})[_0x9a09('0x21')](function(_0x3de4f3){_0x458988[_0x9a09('0x42')]=_0x3de4f3;return _0x458988;});}})[_0x9a09('0x21')](respondWithFilteredResult(_0x25b2ca,_0x3ca9b8))[_0x9a09('0x43')](handleError(_0x25b2ca,null));};exports[_0x9a09('0x5c')]=function(_0x3fd43b,_0x42b7bf,_0x3b2822){var _0x2e8393={'raw':!![],'where':{}};var _0xead2ef={};var _0x4cc16c={'count':0x0,'rows':[]};return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0x3fd43b[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x42b7bf,null))[_0x9a09('0x21')](function(_0xd7ab39){if(_0xd7ab39){_0xead2ef[_0x9a09('0x31')]=_[_0x9a09('0x32')](db['CmHopperBlack'][_0x9a09('0x2d')]);_0xead2ef[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x3fd43b[_0x9a09('0x33')]);_0xead2ef[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0xead2ef[_0x9a09('0x31')],_0xead2ef[_0x9a09('0x33')]);_0x2e8393['attributes']=_['intersection'](_0xead2ef[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x3fd43b[_0x9a09('0x33')]['fields']));_0x2e8393['attributes']=_0x2e8393[_0x9a09('0x35')][_0x9a09('0x36')]?_0x2e8393[_0x9a09('0x35')]:_0xead2ef['model'];if(!_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x37')](_0x9a09('0x56'))){_0x2e8393['limit']=qs[_0x9a09('0x1c')](_0x3fd43b['query']['limit']);_0x2e8393[_0x9a09('0x1a')]=qs[_0x9a09('0x1a')](_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x1a')]);}_0x2e8393[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x3fd43b['query'][_0x9a09('0x39')]);_0x2e8393[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0x3fd43b[_0x9a09('0x33')],_0xead2ef[_0x9a09('0x45')]));_0x2e8393[_0x9a09('0x3a')]['CampaignId']=_0xd7ab39['id'];if(_0x3fd43b['query']['filter']){_0x2e8393['where']=_[_0x9a09('0x3c')](_0x2e8393[_0x9a09('0x3a')],{'$or':_['map'](_0x2e8393[_0x9a09('0x35')],function(_0x6f9fd2){var _0x43e9a3={};_0x43e9a3[_0x6f9fd2]={'$like':'%'+_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0x43e9a3;})});}_0x2e8393=_[_0x9a09('0x3c')]({},_0x2e8393,_0x3fd43b[_0x9a09('0x3e')]);return db[_0x9a09('0x5d')][_0x9a09('0x1d')]({'where':_0x2e8393[_0x9a09('0x3a')]})[_0x9a09('0x21')](function(_0x80134c){_0x4cc16c['count']=_0x80134c;if(_0x3fd43b[_0x9a09('0x33')][_0x9a09('0x3f')]){_0x2e8393[_0x9a09('0x40')]=[{'all':!![]}];}return db[_0x9a09('0x5d')][_0x9a09('0x41')](_0x2e8393);})[_0x9a09('0x21')](function(_0x4ea65c){_0x4cc16c[_0x9a09('0x42')]=_0x4ea65c;return _0x4cc16c;});}})[_0x9a09('0x21')](respondWithFilteredResult(_0x42b7bf,_0x2e8393))[_0x9a09('0x43')](handleError(_0x42b7bf,null));};exports[_0x9a09('0x5e')]=function(_0x50c663,_0x52e965,_0x253c0a){var _0x1a24e3={};var _0x3eb0cd={};var _0xbd0dee;var _0x2bf78d;return db['Campaign'][_0x9a09('0x54')]({'where':{'id':_0x50c663[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x52e965,null))[_0x9a09('0x21')](function(_0x3746fc){if(_0x3746fc){_0xbd0dee=_0x3746fc;_0x3eb0cd[_0x9a09('0x31')]=_[_0x9a09('0x32')](db['CmList'][_0x9a09('0x2d')]);_0x3eb0cd[_0x9a09('0x33')]=_[_0x9a09('0x32')](_0x50c663[_0x9a09('0x33')]);_0x3eb0cd[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x3eb0cd[_0x9a09('0x31')],_0x3eb0cd[_0x9a09('0x33')]);_0x1a24e3[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x3eb0cd[_0x9a09('0x31')],qs['fields'](_0x50c663[_0x9a09('0x33')][_0x9a09('0x46')]));_0x1a24e3[_0x9a09('0x35')]=_0x1a24e3[_0x9a09('0x35')][_0x9a09('0x36')]?_0x1a24e3[_0x9a09('0x35')]:_0x3eb0cd[_0x9a09('0x31')];_0x1a24e3[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x50c663[_0x9a09('0x33')]['sort']);_0x1a24e3['where']=qs[_0x9a09('0x45')](_['pick'](_0x50c663[_0x9a09('0x33')],_0x3eb0cd[_0x9a09('0x45')]));if(_0x50c663[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x1a24e3[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x1a24e3[_0x9a09('0x3a')],{'$or':_['map'](_0x1a24e3['attributes'],function(_0x2a7498){var _0xace0dd={};_0xace0dd[_0x2a7498]={'$like':'%'+_0x50c663[_0x9a09('0x33')][_0x9a09('0x3b')]+'%'};return _0xace0dd;})});}_0x1a24e3=_[_0x9a09('0x3c')]({},_0x1a24e3,_0x50c663[_0x9a09('0x3e')]);return _0xbd0dee[_0x9a09('0x5e')](_0x1a24e3);}})['then'](function(_0x2a77a7){if(_0x2a77a7){_0x2bf78d=_0x2a77a7['length'];if(!_0x50c663['query']['hasOwnProperty']('nolimit')){_0x1a24e3['limit']=qs[_0x9a09('0x1c')](_0x50c663[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x1a24e3[_0x9a09('0x1a')]=qs['offset'](_0x50c663[_0x9a09('0x33')][_0x9a09('0x1a')]);}return _0xbd0dee['getLists'](_0x1a24e3);}})[_0x9a09('0x21')](function(_0x4a3041){if(_0x4a3041){return _0x4a3041?{'count':_0x2bf78d,'rows':_0x4a3041}:null;}})['then'](respondWithResult(_0x52e965,null))[_0x9a09('0x43')](handleError(_0x52e965,null));};exports[_0x9a09('0x5f')]=function(_0x3b41aa,_0x2b3513,_0x71114d){var _0x347163,_0x58caac;return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x3b41aa['params']['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x2b3513,null))[_0x9a09('0x21')](function(_0x195430){if(_0x195430){_0x58caac=_0x195430;return _0x195430['addLists'](_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x60')],_[_0x9a09('0x4d')](_0x3b41aa[_0x9a09('0x50')],[_0x9a09('0x60'),'id'])||{});}return null;})[_0x9a09('0x61')](function(_0x10acfd){var _0x5101e4;_0x347163=_0x10acfd||[];var _0x1880bd=[];if(_0x10acfd){for(var _0x393538=0x0;_0x393538<_0x10acfd[_0x9a09('0x36')];_0x393538+=0x1){var _0x2a2203=_0x10acfd[_0x393538]['get']({'plain':!![]});_0x58caac[_0x9a09('0x62')]=_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x62')]?_0x3b41aa[_0x9a09('0x50')][_0x9a09('0x62')]:_0x58caac[_0x9a09('0x62')];switch(_0x58caac['dialCheckDuplicateType']){case _0x9a09('0x63'):_0x5101e4=squel['insert']()[_0x9a09('0x64')](_0x9a09('0x65'))[_0x9a09('0x66')](['phone','scheduledAt',_0x9a09('0x67'),'ListId',_0x9a09('0x58'),'createdAt',_0x9a09('0x4f')],squel['select']()[_0x9a09('0x68')]('phone',_0x9a09('0x69'))['field']('NOW()',_0x9a09('0x6a'))[_0x9a09('0x68')]('id','ContactId')[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')]['toString'](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')](),'CampaignId')[_0x9a09('0x68')](_0x9a09('0x6e'),'createdAt')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')]())[_0x9a09('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x9a09('0x3a')](_0x9a09('0x73'),squel[_0x9a09('0x74')]()[_0x9a09('0x68')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x9a09('0x75'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')]()))['where'](_0x9a09('0x73'),squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x77'))[_0x9a09('0x6f')](_0x9a09('0x65'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')]())))[_0x9a09('0x6d')]();break;case _0x9a09('0x78'):_0x5101e4=squel[_0x9a09('0x79')]()[_0x9a09('0x64')](_0x9a09('0x65'))[_0x9a09('0x66')]([_0x9a09('0x69'),_0x9a09('0x6a'),_0x9a09('0x67'),_0x9a09('0x6c'),'CampaignId',_0x9a09('0x4e'),'updatedAt'],squel[_0x9a09('0x74')]()['field'](_0x9a09('0x69'),'phone')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x6a'))[_0x9a09('0x68')]('id',_0x9a09('0x67'))[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')](),_0x9a09('0x6c'))['field'](_0x3b41aa[_0x9a09('0x44')]['id'][_0x9a09('0x6d')](),_0x9a09('0x58'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203['CmListId']['toString']())[_0x9a09('0x3a')](_0x9a09('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x77'))['from'](_0x9a09('0x65'))[_0x9a09('0x3a')](_0x9a09('0x76'),_0x3b41aa['params']['id']['toString']())))['toString']();break;default:_0x5101e4=squel['insert']()['into']('cm_hopper')[_0x9a09('0x66')]([_0x9a09('0x69'),'scheduledAt',_0x9a09('0x67'),_0x9a09('0x6c'),'CampaignId','createdAt',_0x9a09('0x4f')],squel['select']()[_0x9a09('0x68')](_0x9a09('0x69'),'phone')[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x6a'))['field']('id','ContactId')[_0x9a09('0x68')](_0x2a2203[_0x9a09('0x6b')][_0x9a09('0x6d')](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x3b41aa[_0x9a09('0x44')]['id']['toString'](),_0x9a09('0x58'))['field']('NOW()',_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')]('cm_contacts')[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')](_0x9a09('0x72'),_0x2a2203[_0x9a09('0x6b')]['toString']())[_0x9a09('0x3a')](_0x9a09('0x7a')))[_0x9a09('0x6d')]();}_0x1880bd[_0x9a09('0x7b')](db[_0x9a09('0x7c')][_0x9a09('0x33')](_0x5101e4));}return BPromise['all'](_0x1880bd);}})[_0x9a09('0x21')](function(){return _0x347163;})[_0x9a09('0x21')](respondWithResult(_0x2b3513,null))['catch'](handleError(_0x2b3513,null));};exports[_0x9a09('0x7d')]=function(_0x9078c4,_0x53a4b1,_0x2bb0e0){return db[_0x9a09('0x2c')]['find']({'where':{'id':_0x9078c4[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x53a4b1,null))['then'](function(_0x2ce74a){if(_0x2ce74a){return _0x2ce74a[_0x9a09('0x7d')](_0x9078c4[_0x9a09('0x33')][_0x9a09('0x60')]);}})[_0x9a09('0x21')](function(_0x19ccb9){if(_0x19ccb9){return db[_0x9a09('0x55')][_0x9a09('0x25')]({'where':{'ListId':_0x9078c4[_0x9a09('0x33')][_0x9a09('0x60')],'CampaignId':_0x9078c4[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](function(){return _0x19ccb9;});}})[_0x9a09('0x21')](respondWithStatusCode(_0x53a4b1,null))[_0x9a09('0x43')](handleError(_0x53a4b1,null));};exports[_0x9a09('0x7e')]=function(_0x466f75,_0x4f1396,_0x4395e0){var _0x227d9f={};var _0x5ba321={};var _0x492cf5;var _0x29cec6;return db[_0x9a09('0x2c')][_0x9a09('0x54')]({'where':{'id':_0x466f75[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0x4f1396,null))['then'](function(_0x115e05){if(_0x115e05){_0x492cf5=_0x115e05;_0x5ba321[_0x9a09('0x31')]=_[_0x9a09('0x32')](db[_0x9a09('0x7f')][_0x9a09('0x2d')]);_0x5ba321[_0x9a09('0x33')]=_['keys'](_0x466f75[_0x9a09('0x33')]);_0x5ba321[_0x9a09('0x45')]=_[_0x9a09('0x34')](_0x5ba321[_0x9a09('0x31')],_0x5ba321[_0x9a09('0x33')]);_0x227d9f[_0x9a09('0x35')]=_[_0x9a09('0x34')](_0x5ba321[_0x9a09('0x31')],qs[_0x9a09('0x46')](_0x466f75[_0x9a09('0x33')][_0x9a09('0x46')]));_0x227d9f[_0x9a09('0x35')]=_0x227d9f[_0x9a09('0x35')][_0x9a09('0x36')]?_0x227d9f[_0x9a09('0x35')]:_0x5ba321['model'];_0x227d9f[_0x9a09('0x38')]=qs[_0x9a09('0x39')](_0x466f75[_0x9a09('0x33')]['sort']);_0x227d9f[_0x9a09('0x3a')]=qs[_0x9a09('0x45')](_[_0x9a09('0x57')](_0x466f75[_0x9a09('0x33')],_0x5ba321[_0x9a09('0x45')]));if(_0x466f75[_0x9a09('0x33')][_0x9a09('0x3b')]){_0x227d9f[_0x9a09('0x3a')]=_[_0x9a09('0x3c')](_0x227d9f[_0x9a09('0x3a')],{'$or':_['map'](_0x227d9f['attributes'],function(_0x5b8ff0){var _0x3c389f={};_0x3c389f[_0x5b8ff0]={'$like':'%'+_0x466f75['query'][_0x9a09('0x3b')]+'%'};return _0x3c389f;})});}_0x227d9f=_[_0x9a09('0x3c')]({},_0x227d9f,_0x466f75['options']);return _0x492cf5[_0x9a09('0x7e')](_0x227d9f);}})[_0x9a09('0x21')](function(_0x31102d){if(_0x31102d){_0x29cec6=_0x31102d['length'];if(!_0x466f75[_0x9a09('0x33')][_0x9a09('0x37')]('nolimit')){_0x227d9f[_0x9a09('0x1c')]=qs['limit'](_0x466f75[_0x9a09('0x33')][_0x9a09('0x1c')]);_0x227d9f[_0x9a09('0x1a')]=qs['offset'](_0x466f75[_0x9a09('0x33')][_0x9a09('0x1a')]);}return _0x492cf5['getBlackLists'](_0x227d9f);}})[_0x9a09('0x21')](function(_0x279760){if(_0x279760){return _0x279760?{'count':_0x29cec6,'rows':_0x279760}:null;}})['then'](respondWithResult(_0x4f1396,null))['catch'](handleError(_0x4f1396,null));};exports[_0x9a09('0x80')]=function(_0x412396,_0xc12a38,_0x53816d){var _0x59a4cd,_0x40a85e;return db[_0x9a09('0x2c')][_0x9a09('0x47')]({'where':{'id':_0x412396[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](handleEntityNotFound(_0xc12a38,null))[_0x9a09('0x21')](function(_0x3df76d){if(_0x3df76d){_0x40a85e=_0x3df76d;return _0x3df76d['addBlackLists'](_0x412396[_0x9a09('0x50')][_0x9a09('0x60')],_['omit'](_0x412396['body'],[_0x9a09('0x60'),'id'])||{});}return null;})[_0x9a09('0x61')](function(_0x345a5a){var _0x3c25f4;_0x59a4cd=_0x345a5a||[];var _0x2c4b0e=[];if(_0x345a5a){for(var _0x447fef=0x0;_0x447fef<_0x345a5a[_0x9a09('0x36')];_0x447fef+=0x1){var _0x5e0084=_0x345a5a[_0x447fef][_0x9a09('0x22')]({'plain':!![]});_0x3c25f4=squel['insert']()[_0x9a09('0x64')](_0x9a09('0x81'))[_0x9a09('0x66')]([_0x9a09('0x69'),_0x9a09('0x67'),'ListId',_0x9a09('0x58'),_0x9a09('0x4e'),_0x9a09('0x4f')],squel[_0x9a09('0x74')]()[_0x9a09('0x68')](_0x9a09('0x69'),_0x9a09('0x69'))['field']('id','ContactId')[_0x9a09('0x68')](_0x5e0084['CmListId'][_0x9a09('0x6d')](),_0x9a09('0x6c'))[_0x9a09('0x68')](_0x412396[_0x9a09('0x44')]['id']['toString'](),_0x9a09('0x58'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4e'))[_0x9a09('0x68')](_0x9a09('0x6e'),_0x9a09('0x4f'))[_0x9a09('0x6f')](_0x9a09('0x70'))[_0x9a09('0x3a')](_0x9a09('0x71'))[_0x9a09('0x3a')]('ListId\x20=\x20?',_0x5e0084[_0x9a09('0x6b')]['toString']())[_0x9a09('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0x9a09('0x6d')]();_0x2c4b0e[_0x9a09('0x7b')](db['sequelize'][_0x9a09('0x33')](_0x3c25f4));}return BPromise['all'](_0x2c4b0e);}})[_0x9a09('0x21')](function(){return _0x59a4cd;})[_0x9a09('0x21')](respondWithResult(_0xc12a38,null))[_0x9a09('0x43')](handleError(_0xc12a38,null));};exports[_0x9a09('0x82')]=function(_0x7389c,_0x567e71,_0x19b83d){return db[_0x9a09('0x2c')]['find']({'where':{'id':_0x7389c[_0x9a09('0x44')]['id']}})['then'](handleEntityNotFound(_0x567e71,null))[_0x9a09('0x21')](function(_0x300e55){if(_0x300e55){return _0x300e55[_0x9a09('0x82')](_0x7389c[_0x9a09('0x33')][_0x9a09('0x60')]);}})[_0x9a09('0x21')](function(_0x528d43){if(_0x528d43){return db[_0x9a09('0x5d')]['destroy']({'where':{'ListId':_0x7389c[_0x9a09('0x33')]['ids'],'CampaignId':_0x7389c[_0x9a09('0x44')]['id']}})[_0x9a09('0x21')](function(){return _0x528d43;});}})[_0x9a09('0x21')](respondWithStatusCode(_0x567e71,null))[_0x9a09('0x43')](handleError(_0x567e71,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5fd12e6..1cb6efd 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x29b15e,_0xe9df5e){var _0x5c45c3=function(_0x5293a4){while(--_0x5293a4){_0x29b15e['push'](_0x29b15e['shift']());}};_0x5c45c3(++_0xe9df5e);}(_0x7a54,0x106));var _0x47a5=function(_0x13ad33,_0x7ae5c5){_0x13ad33=_0x13ad33-0x0;var _0x277ef9=_0x7a54[_0x13ad33];return _0x277ef9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4cca27,_0x18e06f){var _0x3d8219=function(_0x2ba31b){while(--_0x2ba31b){_0x4cca27['push'](_0x4cca27['shift']());}};_0x3d8219(++_0x18e06f);}(_0x7a54,0x106));var _0x47a5=function(_0x2ca4ea,_0x56b91b){_0x2ca4ea=_0x2ca4ea-0x0;var _0x3cde34=_0x7a54[_0x2ca4ea];return _0x3cde34;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 99c791b..b477f90 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 _0xd52a=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','model','then','util'];(function(_0x528182,_0x9a98e9){var _0x255df7=function(_0x292249){while(--_0x292249){_0x528182['push'](_0x528182['shift']());}};_0x255df7(++_0x9a98e9);}(_0xd52a,0xca));var _0xad52=function(_0x2556c8,_0x5aaa89){_0x2556c8=_0x2556c8-0x0;var _0x11fa2c=_0xd52a[_0x2556c8];return _0x11fa2c;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var moment=require('moment');var BPromise=require(_0xad52('0x1'));var rs=require(_0xad52('0x2'));var fs=require('fs');var Redis=require(_0xad52('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xad52('0x4'));var logger=require(_0xad52('0x5'))(_0xad52('0x6'));var config=require(_0xad52('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad70b,_0x55f7a7,_0x23fc23){return new BPromise(function(_0x4bbff0,_0x192ba5){return client[_0xad52('0x8')](_0x1ad70b,_0x23fc23)['then'](function(_0x39c078){logger['info'](_0xad52('0x9'),_0x55f7a7,'request\x20sent');logger[_0xad52('0xa')](_0xad52('0xb'),_0x55f7a7,_0xad52('0xc'),JSON[_0xad52('0xd')](_0x39c078));if(_0x39c078['error']){if(_0x39c078['error']['code']===0x1f4){logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);return _0x192ba5(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}logger[_0xad52('0xe')](_0xad52('0x9'),_0x55f7a7,_0x39c078[_0xad52('0xe')]['message']);return _0x4bbff0(_0x39c078[_0xad52('0xe')][_0xad52('0xf')]);}else{logger[_0xad52('0x10')](_0xad52('0x9'),_0x55f7a7,_0xad52('0xc'));_0x4bbff0(_0x39c078[_0xad52('0x11')][_0xad52('0xf')]);}})[_0xad52('0x12')](function(_0x450099){logger['error']('Campaign,\x20%s,\x20%s',_0x55f7a7,_0x450099);_0x192ba5(_0x450099);});});}exports[_0xad52('0x13')]=function(_0x39128c){var _0x351440=this;return new Promise(function(_0x1c19e9,_0x33da89){return db['Campaign'][_0xad52('0x14')]({'raw':_0x39128c['options']?_0x39128c[_0xad52('0x15')][_0xad52('0x16')]===undefined?!![]:![]:!![],'where':_0x39128c[_0xad52('0x15')]?_0x39128c['options'][_0xad52('0x17')]||null:null,'attributes':_0x39128c['options']?_0x39128c[_0xad52('0x15')][_0xad52('0x18')]||null:null,'limit':_0x39128c[_0xad52('0x15')]?_0x39128c[_0xad52('0x15')][_0xad52('0x19')]||null:null,'include':_0x39128c[_0xad52('0x15')]?_0x39128c['options'][_0xad52('0x1a')]?_['map'](_0x39128c[_0xad52('0x15')][_0xad52('0x1a')],function(_0x2fa90c){return{'model':db[_0x2fa90c[_0xad52('0x1b')]],'as':_0x2fa90c['as'],'attributes':_0x2fa90c[_0xad52('0x18')],'include':_0x2fa90c['include']?_['map'](_0x2fa90c[_0xad52('0x1a')],function(_0x583999){return{'model':db[_0x583999[_0xad52('0x1b')]],'as':_0x583999['as'],'attributes':_0x583999[_0xad52('0x18')],'include':_0x583999['include']?_['map'](_0x583999[_0xad52('0x1a')],function(_0x31b5e0){return{'model':db[_0x31b5e0[_0xad52('0x1b')]],'as':_0x31b5e0['as'],'attributes':_0x31b5e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xad52('0x1c')](function(_0x5771ce){logger[_0xad52('0x10')](_0xad52('0x13'),_0x39128c);logger[_0xad52('0xa')](_0xad52('0x13'),_0x39128c,JSON['stringify'](_0x5771ce));_0x1c19e9(_0x5771ce);})[_0xad52('0x12')](function(_0x2a604c){logger['error'](_0xad52('0x13'),_0x2a604c[_0xad52('0xf')],_0x39128c);_0x33da89(_0x351440[_0xad52('0xe')](0x1f4,_0x2a604c[_0xad52('0xf')]));});});}; \ No newline at end of file +var _0x1061=['model','attributes','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','include','map'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0x1061,0x1b5));var _0x1106=function(_0x70f83,_0x30c72d){_0x70f83=_0x70f83-0x0;var _0x315ec6=_0x1061[_0x70f83];return _0x315ec6;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1106('0x1'));var fs=require('fs');var Redis=require(_0x1106('0x2'));var db=require(_0x1106('0x3'))['db'];var utils=require(_0x1106('0x4'));var logger=require(_0x1106('0x5'))(_0x1106('0x6'));var config=require(_0x1106('0x7'));var jayson=require(_0x1106('0x8'));var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36bfb3,_0x54d2d5,_0x523f0f){return new BPromise(function(_0x287336,_0x3056e0){return client['request'](_0x36bfb3,_0x523f0f)['then'](function(_0x223c85){logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));logger[_0x1106('0xd')](_0x1106('0xe'),_0x54d2d5,_0x1106('0xc'),JSON[_0x1106('0xf')](_0x223c85));if(_0x223c85[_0x1106('0x10')]){if(_0x223c85[_0x1106('0x10')]['code']===0x1f4){logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x3056e0(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x287336(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}else{logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));_0x287336(_0x223c85[_0x1106('0x12')][_0x1106('0x11')]);}})[_0x1106('0x13')](function(_0x547ca3){logger['error'](_0x1106('0xb'),_0x54d2d5,_0x547ca3);_0x3056e0(_0x547ca3);});});}exports[_0x1106('0x14')]=function(_0x2c2905){var _0x465c13=this;return new Promise(function(_0x5be7fc,_0x2c8ff5){return db[_0x1106('0x15')][_0x1106('0x16')]({'raw':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x18')]===undefined?!![]:![]:!![],'where':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x2c2905['options']?_0x2c2905[_0x1106('0x17')]['attributes']||null:null,'limit':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options']['limit']||null:null,'include':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2c2905[_0x1106('0x17')][_0x1106('0x1a')],function(_0x2418c7){return{'model':db[_0x2418c7[_0x1106('0x1c')]],'as':_0x2418c7['as'],'attributes':_0x2418c7[_0x1106('0x1d')],'include':_0x2418c7[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2418c7[_0x1106('0x1a')],function(_0x1ff815){return{'model':db[_0x1ff815[_0x1106('0x1c')]],'as':_0x1ff815['as'],'attributes':_0x1ff815['attributes'],'include':_0x1ff815[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1ff815[_0x1106('0x1a')],function(_0x2285dd){return{'model':db[_0x2285dd['model']],'as':_0x2285dd['as'],'attributes':_0x2285dd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x465d83){logger[_0x1106('0xa')](_0x1106('0x14'),_0x2c2905);logger[_0x1106('0xd')](_0x1106('0x14'),_0x2c2905,JSON['stringify'](_0x465d83));_0x5be7fc(_0x465d83);})['catch'](function(_0x4b070d){logger[_0x1106('0x10')](_0x1106('0x14'),_0x4b070d[_0x1106('0x11')],_0x2c2905);_0x2c8ff5(_0x465c13[_0x1106('0x10')](0x1f4,_0x4b070d[_0x1106('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 9070515..1ed195a 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 _0x760b=['/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','removeBlackLists','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists'];(function(_0x461e4b,_0x52caee){var _0x362483=function(_0x4012b3){while(--_0x4012b3){_0x461e4b['push'](_0x461e4b['shift']());}};_0x362483(++_0x52caee);}(_0x760b,0x95));var _0xb760=function(_0x1f6688,_0x1f6e96){_0x1f6688=_0x1f6688-0x0;var _0x245d34=_0x760b[_0x1f6688];return _0x245d34;};'use strict';var multer=require('multer');var util=require(_0xb760('0x0'));var path=require(_0xb760('0x1'));var timeout=require(_0xb760('0x2'));var express=require(_0xb760('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb760('0x4'));var interaction=require(_0xb760('0x5'));var config=require(_0xb760('0x6'));var controller=require(_0xb760('0x7'));router[_0xb760('0x8')]('/',auth[_0xb760('0x9')](),controller['index']);router[_0xb760('0x8')](_0xb760('0xa'),auth[_0xb760('0x9')](),controller[_0xb760('0xb')]);router['get'](_0xb760('0xc'),auth[_0xb760('0x9')](),controller[_0xb760('0xd')]);router[_0xb760('0x8')](_0xb760('0xe'),auth[_0xb760('0x9')](),controller[_0xb760('0xf')]);router[_0xb760('0x8')](_0xb760('0x10'),auth[_0xb760('0x9')](),controller[_0xb760('0x11')]);router['get'](_0xb760('0x12'),auth['isAuthenticated'](),controller[_0xb760('0x13')]);router['get']('/:id/lists',auth[_0xb760('0x9')](),controller[_0xb760('0x14')]);router['get'](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x16')]);router[_0xb760('0x17')]('/',auth[_0xb760('0x9')](),controller[_0xb760('0x18')]);router[_0xb760('0x17')](_0xb760('0x19'),auth[_0xb760('0x9')](),controller[_0xb760('0x1a')]);router['post'](_0xb760('0x1b'),auth['isAuthenticated'](),controller[_0xb760('0x1c')]);router[_0xb760('0x17')](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x1d')]);router[_0xb760('0x1e')](_0xb760('0xa'),auth[_0xb760('0x9')](),controller[_0xb760('0x1f')]);router[_0xb760('0x20')](_0xb760('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xb760('0x20')](_0xb760('0x1b'),auth['isAuthenticated'](),controller['removeLists']);router[_0xb760('0x20')](_0xb760('0x15'),auth[_0xb760('0x9')](),controller[_0xb760('0x21')]);module['exports']=router; \ No newline at end of file +var _0x3773=['isAuthenticated','index','get','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','put','/:id','update','delete','removeLists','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller'];(function(_0x54e83b,_0x22bb2a){var _0x2ae161=function(_0x452451){while(--_0x452451){_0x54e83b['push'](_0x54e83b['shift']());}};_0x2ae161(++_0x22bb2a);}(_0x3773,0x1a9));var _0x3377=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3773[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x3377('0x0'));var path=require(_0x3377('0x1'));var timeout=require('connect-timeout');var express=require(_0x3377('0x2'));var router=express[_0x3377('0x3')]();var fs_extra=require(_0x3377('0x4'));var auth=require(_0x3377('0x5'));var interaction=require(_0x3377('0x6'));var config=require(_0x3377('0x7'));var controller=require(_0x3377('0x8'));router['get']('/',auth[_0x3377('0x9')](),controller[_0x3377('0xa')]);router[_0x3377('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x3377('0xc')]);router[_0x3377('0xb')](_0x3377('0xd'),auth[_0x3377('0x9')](),controller[_0x3377('0xe')]);router[_0x3377('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x3377('0xf')]);router[_0x3377('0xb')](_0x3377('0x10'),auth[_0x3377('0x9')](),controller['getHopperFinals']);router[_0x3377('0xb')](_0x3377('0x11'),auth[_0x3377('0x9')](),controller[_0x3377('0x12')]);router['get'](_0x3377('0x13'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x3377('0x14'),auth['isAuthenticated'](),controller[_0x3377('0x15')]);router[_0x3377('0x16')]('/',auth[_0x3377('0x9')](),controller['create']);router['post'](_0x3377('0x17'),auth['isAuthenticated'](),controller['clone']);router[_0x3377('0x16')](_0x3377('0x13'),auth['isAuthenticated'](),controller[_0x3377('0x18')]);router['post'](_0x3377('0x14'),auth[_0x3377('0x9')](),controller['addBlackLists']);router[_0x3377('0x19')](_0x3377('0x1a'),auth['isAuthenticated'](),controller[_0x3377('0x1b')]);router[_0x3377('0x1c')](_0x3377('0x1a'),auth[_0x3377('0x9')](),controller['destroy']);router[_0x3377('0x1c')](_0x3377('0x13'),auth[_0x3377('0x9')](),controller[_0x3377('0x1d')]);router[_0x3377('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x3377('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 7c41a1a..2f63e0b 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 _0xf92a=['exports','STRING','TEXT','VIRTUAL','key'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xf92a,0x127));var _0xaf92=function(_0x6bb9d,_0x37e070){_0x6bb9d=_0x6bb9d-0x0;var _0x5b865b=_0xf92a[_0x6bb9d];return _0x5b865b;};'use strict';var Sequelize=require('sequelize');module[_0xaf92('0x0')]={'key':{'type':Sequelize[_0xaf92('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xaf92('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xaf92('0x3')],'get':function(){return this['getDataValue'](_0xaf92('0x4'));}}}; \ No newline at end of file +var _0x61e8=['VIRTUAL','key','sequelize','exports','STRING'];(function(_0x29886d,_0x4fcdce){var _0x30fcca=function(_0x35687e){while(--_0x35687e){_0x29886d['push'](_0x29886d['shift']());}};_0x30fcca(++_0x4fcdce);}(_0x61e8,0xac));var _0x861e=function(_0x288549,_0x3b8598){_0x288549=_0x288549-0x0;var _0x4624c0=_0x61e8[_0x288549];return _0x4624c0;};'use strict';var Sequelize=require(_0x861e('0x0'));module[_0x861e('0x1')]={'key':{'type':Sequelize[_0x861e('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x861e('0x2')]},'name':{'type':Sequelize[_0x861e('0x3')],'get':function(){return this['getDataValue'](_0x861e('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f5e7fec..1929c68 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 _0xa413=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','undefined','limit','offset','count','set','Content-Range','json','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','filters','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x15c13a,_0xe7b53d){var _0x5cf531=function(_0x1324f2){while(--_0x1324f2){_0x15c13a['push'](_0x15c13a['shift']());}};_0x5cf531(++_0xe7b53d);}(_0xa413,0x155));var _0x3a41=function(_0x14ce2e,_0x366209){_0x14ce2e=_0x14ce2e-0x0;var _0xd4b636=_0xa413[_0x14ce2e];return _0xd4b636;};'use strict';var emlformat=require(_0x3a41('0x0'));var rimraf=require(_0x3a41('0x1'));var zipdir=require(_0x3a41('0x2'));var jsonpatch=require(_0x3a41('0x3'));var rp=require(_0x3a41('0x4'));var moment=require(_0x3a41('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3a41('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a41('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a41('0x8'));var squel=require(_0x3a41('0x9'));var crypto=require(_0x3a41('0xa'));var jsforce=require(_0x3a41('0xb'));var deskjs=require(_0x3a41('0xc'));var toCsv=require(_0x3a41('0xd'));var querystring=require(_0x3a41('0xe'));var Papa=require('papaparse');var Redis=require(_0x3a41('0xf'));var authService=require(_0x3a41('0x10'));var qs=require(_0x3a41('0x11'));var as=require(_0x3a41('0x12'));var hardwareService=require(_0x3a41('0x13'));var logger=require(_0x3a41('0x14'))(_0x3a41('0x15'));var utils=require(_0x3a41('0x16'));var config=require(_0x3a41('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb6f164,_0x2bd454){_0x2bd454=_0x2bd454||0xcc;return function(_0x441338){if(_0x441338){return _0xb6f164['sendStatus'](_0x2bd454);}return _0xb6f164[_0x3a41('0x18')](_0x2bd454)[_0x3a41('0x19')]();};}function respondWithResult(_0x2b5460,_0x7fa7aa){_0x7fa7aa=_0x7fa7aa||0xc8;return function(_0x54737f){if(_0x54737f){return _0x2b5460['status'](_0x7fa7aa)['json'](_0x54737f);}};}function respondWithFilteredResult(_0x17df6e,_0x342183){return function(_0x369d7b){if(_0x369d7b){var _0x1976da=typeof _0x342183['offset']===_0x3a41('0x1a')&&typeof _0x342183[_0x3a41('0x1b')]===_0x3a41('0x1a');var _0x255045=_0x369d7b['count'];var _0x1eedb6=_0x1976da?0x0:_0x342183[_0x3a41('0x1c')];var _0x3ad046=_0x1976da?_0x369d7b[_0x3a41('0x1d')]:_0x342183[_0x3a41('0x1c')]+_0x342183[_0x3a41('0x1b')];var _0x3e4111;if(_0x3ad046>=_0x255045){_0x3ad046=_0x255045;_0x3e4111=0xc8;}else{_0x3e4111=0xce;}_0x17df6e[_0x3a41('0x18')](_0x3e4111);return _0x17df6e[_0x3a41('0x1e')](_0x3a41('0x1f'),_0x1eedb6+'-'+_0x3ad046+'/'+_0x255045)[_0x3a41('0x20')](_0x369d7b);}return null;};}function patchUpdates(_0x2261e2){return function(_0x216a6e){try{jsonpatch['apply'](_0x216a6e,_0x2261e2,!![]);}catch(_0x580810){return BPromise[_0x3a41('0x21')](_0x580810);}return _0x216a6e[_0x3a41('0x22')]();};}function saveUpdates(_0x42e9a8,_0x39dd32){return function(_0x935c96){if(_0x935c96){return _0x935c96[_0x3a41('0x23')](_0x42e9a8)[_0x3a41('0x24')](function(_0x6c50e6){return _0x6c50e6;});}return null;};}function removeEntity(_0x248840,_0x1e8307){return function(_0x46b0d3){if(_0x46b0d3){return _0x46b0d3[_0x3a41('0x25')]()[_0x3a41('0x24')](function(){var _0x235060=_0x46b0d3[_0x3a41('0x26')]({'plain':!![]});var _0x3fe24b=_0x3a41('0x27');return db[_0x3a41('0x28')][_0x3a41('0x25')]({'where':{'type':_0x3fe24b,'resourceId':_0x235060['id']}})[_0x3a41('0x24')](function(){return _0x46b0d3;});})['then'](function(){_0x248840[_0x3a41('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x130fb8,_0xd6c9cb){return function(_0x5a44b7){if(!_0x5a44b7){_0x130fb8[_0x3a41('0x29')](0x194);}return _0x5a44b7;};}function handleError(_0x500341,_0x5b102f){_0x5b102f=_0x5b102f||0x1f4;return function(_0x3d9a5c){logger[_0x3a41('0x2a')](_0x3d9a5c[_0x3a41('0x2b')]);if(_0x3d9a5c[_0x3a41('0x2c')]){delete _0x3d9a5c['name'];}_0x500341[_0x3a41('0x18')](_0x5b102f)[_0x3a41('0x2d')](_0x3d9a5c);};}exports[_0x3a41('0x2e')]=function(_0x192e0e,_0x4da1e6){var _0x1e0014={},_0x39e0d9={},_0x2cb001={'count':0x0,'rows':[]};var _0xcc0432=_['map'](db[_0x3a41('0x2f')][_0x3a41('0x30')],function(_0x159d98){return{'name':_0x159d98[_0x3a41('0x31')],'type':_0x159d98[_0x3a41('0x32')][_0x3a41('0x33')]};});_0x39e0d9[_0x3a41('0x34')]=_[_0x3a41('0x35')](_0xcc0432,'name');_0x39e0d9[_0x3a41('0x36')]=_[_0x3a41('0x37')](_0x192e0e['query']);_0x39e0d9['filters']=_[_0x3a41('0x38')](_0x39e0d9[_0x3a41('0x34')],_0x39e0d9[_0x3a41('0x36')]);_0x1e0014[_0x3a41('0x39')]=_[_0x3a41('0x38')](_0x39e0d9[_0x3a41('0x34')],qs[_0x3a41('0x3a')](_0x192e0e['query'][_0x3a41('0x3a')]));_0x1e0014[_0x3a41('0x39')]=_0x1e0014['attributes'][_0x3a41('0x3b')]?_0x1e0014[_0x3a41('0x39')]:_0x39e0d9[_0x3a41('0x34')];if(!_0x192e0e['query'][_0x3a41('0x3c')](_0x3a41('0x3d'))){_0x1e0014[_0x3a41('0x1b')]=qs['limit'](_0x192e0e['query'][_0x3a41('0x1b')]);_0x1e0014[_0x3a41('0x1c')]=qs[_0x3a41('0x1c')](_0x192e0e[_0x3a41('0x36')][_0x3a41('0x1c')]);}_0x1e0014[_0x3a41('0x3e')]=qs[_0x3a41('0x3f')](_0x192e0e[_0x3a41('0x36')]['sort']);_0x1e0014[_0x3a41('0x40')]=qs['filters'](_['pick'](_0x192e0e[_0x3a41('0x36')],_0x39e0d9['filters']),_0xcc0432);if(_0x192e0e['query'][_0x3a41('0x41')]){_0x1e0014[_0x3a41('0x40')]=_[_0x3a41('0x42')](_0x1e0014['where'],{'$or':[{'key':{'$like':'%'+_0x192e0e[_0x3a41('0x36')][_0x3a41('0x41')]+'%'}},{'value':{'$like':'%'+_0x192e0e['query'][_0x3a41('0x41')]+'%'}}]});}_0x1e0014=_[_0x3a41('0x42')]({},_0x1e0014,_0x192e0e[_0x3a41('0x43')]);var _0x1dd7ce={'where':_0x1e0014[_0x3a41('0x40')]};return db[_0x3a41('0x2f')]['count'](_0x1dd7ce)[_0x3a41('0x24')](function(_0x36a576){_0x2cb001[_0x3a41('0x1d')]=_0x36a576;if(_0x192e0e[_0x3a41('0x36')]['includeAll']){_0x1e0014[_0x3a41('0x44')]=[{'all':!![]}];}return db[_0x3a41('0x2f')][_0x3a41('0x45')](_0x1e0014);})['then'](function(_0x27957f){_0x2cb001['rows']=_0x27957f;return _0x2cb001;})[_0x3a41('0x24')](respondWithFilteredResult(_0x4da1e6,_0x1e0014))[_0x3a41('0x46')](handleError(_0x4da1e6,null));};exports['show']=function(_0x1dabd0,_0x2523ea){var _0x10157a={'raw':!![],'where':{'id':_0x1dabd0['params']['id']}},_0x464fdc={};_0x464fdc[_0x3a41('0x34')]=_[_0x3a41('0x37')](db[_0x3a41('0x2f')][_0x3a41('0x30')]);_0x464fdc['query']=_[_0x3a41('0x37')](_0x1dabd0[_0x3a41('0x36')]);_0x464fdc[_0x3a41('0x47')]=_[_0x3a41('0x38')](_0x464fdc['model'],_0x464fdc[_0x3a41('0x36')]);_0x10157a[_0x3a41('0x39')]=_[_0x3a41('0x38')](_0x464fdc[_0x3a41('0x34')],qs[_0x3a41('0x3a')](_0x1dabd0[_0x3a41('0x36')][_0x3a41('0x3a')]));_0x10157a[_0x3a41('0x39')]=_0x10157a[_0x3a41('0x39')][_0x3a41('0x3b')]?_0x10157a[_0x3a41('0x39')]:_0x464fdc['model'];if(_0x1dabd0['query'][_0x3a41('0x48')]){_0x10157a[_0x3a41('0x44')]=[{'all':!![]}];}_0x10157a=_[_0x3a41('0x42')]({},_0x10157a,_0x1dabd0['options']);return db[_0x3a41('0x2f')][_0x3a41('0x49')](_0x10157a)['then'](handleEntityNotFound(_0x2523ea,null))[_0x3a41('0x24')](respondWithResult(_0x2523ea,null))[_0x3a41('0x46')](handleError(_0x2523ea,null));};exports[_0x3a41('0x23')]=function(_0x377e45,_0x3387c2){if(_0x377e45['body']['id']){delete _0x377e45[_0x3a41('0x4a')]['id'];}return db[_0x3a41('0x2f')][_0x3a41('0x49')]({'where':{'id':_0x377e45[_0x3a41('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3387c2,null))[_0x3a41('0x24')](saveUpdates(_0x377e45[_0x3a41('0x4a')],null))['then'](respondWithResult(_0x3387c2,null))[_0x3a41('0x46')](handleError(_0x3387c2,null));};exports['destroy']=function(_0x51fe36,_0x369289){return db[_0x3a41('0x2f')]['find']({'where':{'id':_0x51fe36[_0x3a41('0x4b')]['id']}})[_0x3a41('0x24')](handleEntityNotFound(_0x369289,null))['then'](removeEntity(_0x369289,null))[_0x3a41('0x46')](handleError(_0x369289,null));};exports['create']=function(_0x573ada,_0x5bc910){var _0x189059={'key':_0x573ada[_0x3a41('0x4a')]['key']};if(_0x573ada['body'][_0x3a41('0x4c')]){_0x189059['MailAccountId']=_0x573ada['body'][_0x3a41('0x4c')];}else if(_0x573ada[_0x3a41('0x4a')][_0x3a41('0x4d')]){_0x189059[_0x3a41('0x4d')]=_0x573ada[_0x3a41('0x4a')][_0x3a41('0x4d')];}else if(_0x573ada[_0x3a41('0x4a')]['OpenchannelAccountId']){_0x189059['OpenchannelAccountId']=_0x573ada['body'][_0x3a41('0x4e')];}else if(_0x573ada[_0x3a41('0x4a')]['ChatWebsiteId']){_0x189059[_0x3a41('0x4f')]=_0x573ada[_0x3a41('0x4a')]['ChatWebsiteId'];}return db[_0x3a41('0x2f')][_0x3a41('0x49')]({'where':_0x189059})[_0x3a41('0x24')](function(_0x599176){if(_0x599176){throw new db[(_0x3a41('0x50'))]['ValidationError'](_0x3a41('0x51'));}return db['CannedAnswer'][_0x3a41('0x52')](_0x573ada[_0x3a41('0x4a')]);})[_0x3a41('0x24')](function(_0x89460f){var _0x8ba566=_0x573ada[_0x3a41('0x53')][_0x3a41('0x26')]({'plain':!![]});if(!_0x8ba566)throw new Error(_0x3a41('0x54'));if(_0x8ba566[_0x3a41('0x55')]===_0x3a41('0x53')){var _0x3ae39f=_0x89460f[_0x3a41('0x26')]({'plain':!![]});return db[_0x3a41('0x56')][_0x3a41('0x49')]({'where':{'name':_0x3a41('0x27'),'userProfileId':_0x8ba566[_0x3a41('0x57')]},'raw':!![]})[_0x3a41('0x24')](function(_0x34bff4){if(_0x34bff4&&_0x34bff4[_0x3a41('0x58')]===0x0){return db[_0x3a41('0x28')][_0x3a41('0x52')]({'name':_0x3ae39f[_0x3a41('0x2c')],'resourceId':_0x3ae39f['id'],'type':_0x34bff4[_0x3a41('0x2c')],'sectionId':_0x34bff4['id']},{})['then'](function(){return _0x89460f;});}else{return _0x89460f;}})[_0x3a41('0x46')](function(_0xee6b63){logger[_0x3a41('0x2a')](_0x3a41('0x59'),_0xee6b63);throw _0xee6b63;});}return _0x89460f;})['then'](respondWithResult(_0x5bc910,0xc9))['catch'](handleError(_0x5bc910,null));}; \ No newline at end of file +var _0xf2eb=['save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','map','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','CannedAnswer','include','findAll','catch','show','params','keys','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x3b87f4,_0x112243){var _0x63d16e=function(_0x3e7323){while(--_0x3e7323){_0x3b87f4['push'](_0x3b87f4['shift']());}};_0x63d16e(++_0x112243);}(_0xf2eb,0x1d5));var _0xbf2e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xf2eb[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbf2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf2e('0x1'));var rp=require(_0xbf2e('0x2'));var moment=require('moment');var BPromise=require(_0xbf2e('0x3'));var Mustache=require('mustache');var util=require(_0xbf2e('0x4'));var path=require(_0xbf2e('0x5'));var sox=require(_0xbf2e('0x6'));var csv=require(_0xbf2e('0x7'));var ejs=require(_0xbf2e('0x8'));var fs=require('fs');var fs_extra=require(_0xbf2e('0x9'));var _=require(_0xbf2e('0xa'));var squel=require(_0xbf2e('0xb'));var crypto=require(_0xbf2e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf2e('0xd'));var toCsv=require(_0xbf2e('0x7'));var querystring=require('querystring');var Papa=require(_0xbf2e('0xe'));var Redis=require(_0xbf2e('0xf'));var authService=require(_0xbf2e('0x10'));var qs=require(_0xbf2e('0x11'));var as=require(_0xbf2e('0x12'));var hardwareService=require(_0xbf2e('0x13'));var logger=require('../../config/logger')(_0xbf2e('0x14'));var utils=require(_0xbf2e('0x15'));var config=require(_0xbf2e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf2e('0x17'))['db'];function respondWithStatusCode(_0x1f5b79,_0x34478d){_0x34478d=_0x34478d||0xcc;return function(_0x4b2724){if(_0x4b2724){return _0x1f5b79[_0xbf2e('0x18')](_0x34478d);}return _0x1f5b79[_0xbf2e('0x19')](_0x34478d)[_0xbf2e('0x1a')]();};}function respondWithResult(_0x28d488,_0x5df51e){_0x5df51e=_0x5df51e||0xc8;return function(_0x1fc70d){if(_0x1fc70d){return _0x28d488[_0xbf2e('0x19')](_0x5df51e)['json'](_0x1fc70d);}};}function respondWithFilteredResult(_0x2d7bb9,_0x258b77){return function(_0x672d66){if(_0x672d66){var _0xd18952=typeof _0x258b77['offset']==='undefined'&&typeof _0x258b77[_0xbf2e('0x1b')]==='undefined';var _0x71de48=_0x672d66[_0xbf2e('0x1c')];var _0x1ef1cd=_0xd18952?0x0:_0x258b77[_0xbf2e('0x1d')];var _0x2b9041=_0xd18952?_0x672d66[_0xbf2e('0x1c')]:_0x258b77[_0xbf2e('0x1d')]+_0x258b77[_0xbf2e('0x1b')];var _0x5d47d6;if(_0x2b9041>=_0x71de48){_0x2b9041=_0x71de48;_0x5d47d6=0xc8;}else{_0x5d47d6=0xce;}_0x2d7bb9[_0xbf2e('0x19')](_0x5d47d6);return _0x2d7bb9[_0xbf2e('0x1e')](_0xbf2e('0x1f'),_0x1ef1cd+'-'+_0x2b9041+'/'+_0x71de48)[_0xbf2e('0x20')](_0x672d66);}return null;};}function patchUpdates(_0x206588){return function(_0x2e9190){try{jsonpatch[_0xbf2e('0x21')](_0x2e9190,_0x206588,!![]);}catch(_0x16177f){return BPromise[_0xbf2e('0x22')](_0x16177f);}return _0x2e9190[_0xbf2e('0x23')]();};}function saveUpdates(_0x1d5120,_0x51d674){return function(_0x4cc0c2){if(_0x4cc0c2){return _0x4cc0c2[_0xbf2e('0x24')](_0x1d5120)[_0xbf2e('0x25')](function(_0x584886){return _0x584886;});}return null;};}function removeEntity(_0x2a0448,_0x25a65d){return function(_0x11ca41){if(_0x11ca41){return _0x11ca41[_0xbf2e('0x26')]()['then'](function(){var _0x525335=_0x11ca41[_0xbf2e('0x27')]({'plain':!![]});var _0xc56f7b=_0xbf2e('0x28');return db[_0xbf2e('0x29')][_0xbf2e('0x26')]({'where':{'type':_0xc56f7b,'resourceId':_0x525335['id']}})['then'](function(){return _0x11ca41;});})[_0xbf2e('0x25')](function(){_0x2a0448[_0xbf2e('0x19')](0xcc)[_0xbf2e('0x1a')]();});}};}function handleEntityNotFound(_0x434cce,_0x1cb878){return function(_0x2aff52){if(!_0x2aff52){_0x434cce[_0xbf2e('0x18')](0x194);}return _0x2aff52;};}function handleError(_0x364b94,_0x476044){_0x476044=_0x476044||0x1f4;return function(_0x268038){logger[_0xbf2e('0x2a')](_0x268038[_0xbf2e('0x2b')]);if(_0x268038[_0xbf2e('0x2c')]){delete _0x268038[_0xbf2e('0x2c')];}_0x364b94[_0xbf2e('0x19')](_0x476044)[_0xbf2e('0x2d')](_0x268038);};}exports['index']=function(_0x287cb5,_0x313d0a){var _0x29d8b9={},_0x53ba84={},_0x234e88={'count':0x0,'rows':[]};var _0x476f65=_[_0xbf2e('0x2e')](db['CannedAnswer']['rawAttributes'],function(_0x3e1bd1){return{'name':_0x3e1bd1['fieldName'],'type':_0x3e1bd1[_0xbf2e('0x2f')]['key']};});_0x53ba84[_0xbf2e('0x30')]=_[_0xbf2e('0x2e')](_0x476f65,_0xbf2e('0x2c'));_0x53ba84[_0xbf2e('0x31')]=_['keys'](_0x287cb5[_0xbf2e('0x31')]);_0x53ba84[_0xbf2e('0x32')]=_[_0xbf2e('0x33')](_0x53ba84[_0xbf2e('0x30')],_0x53ba84[_0xbf2e('0x31')]);_0x29d8b9[_0xbf2e('0x34')]=_[_0xbf2e('0x33')](_0x53ba84[_0xbf2e('0x30')],qs[_0xbf2e('0x35')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x35')]));_0x29d8b9['attributes']=_0x29d8b9['attributes'][_0xbf2e('0x36')]?_0x29d8b9[_0xbf2e('0x34')]:_0x53ba84[_0xbf2e('0x30')];if(!_0x287cb5['query']['hasOwnProperty'](_0xbf2e('0x37'))){_0x29d8b9['limit']=qs[_0xbf2e('0x1b')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x1b')]);_0x29d8b9[_0xbf2e('0x1d')]=qs[_0xbf2e('0x1d')](_0x287cb5[_0xbf2e('0x31')]['offset']);}_0x29d8b9[_0xbf2e('0x38')]=qs[_0xbf2e('0x39')](_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x39')]);_0x29d8b9[_0xbf2e('0x3a')]=qs[_0xbf2e('0x32')](_[_0xbf2e('0x3b')](_0x287cb5[_0xbf2e('0x31')],_0x53ba84[_0xbf2e('0x32')]),_0x476f65);if(_0x287cb5[_0xbf2e('0x31')][_0xbf2e('0x3c')]){_0x29d8b9['where']=_[_0xbf2e('0x3d')](_0x29d8b9[_0xbf2e('0x3a')],{'$or':[{'key':{'$like':'%'+_0x287cb5[_0xbf2e('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x287cb5[_0xbf2e('0x31')]['filter']+'%'}}]});}_0x29d8b9=_[_0xbf2e('0x3d')]({},_0x29d8b9,_0x287cb5[_0xbf2e('0x3e')]);var _0x16b6c8={'where':_0x29d8b9[_0xbf2e('0x3a')]};return db[_0xbf2e('0x3f')][_0xbf2e('0x1c')](_0x16b6c8)[_0xbf2e('0x25')](function(_0x13e5f9){_0x234e88[_0xbf2e('0x1c')]=_0x13e5f9;if(_0x287cb5[_0xbf2e('0x31')]['includeAll']){_0x29d8b9[_0xbf2e('0x40')]=[{'all':!![]}];}return db['CannedAnswer'][_0xbf2e('0x41')](_0x29d8b9);})[_0xbf2e('0x25')](function(_0x20dac3){_0x234e88['rows']=_0x20dac3;return _0x234e88;})[_0xbf2e('0x25')](respondWithFilteredResult(_0x313d0a,_0x29d8b9))[_0xbf2e('0x42')](handleError(_0x313d0a,null));};exports[_0xbf2e('0x43')]=function(_0x60b009,_0x4839dd){var _0x267c56={'raw':!![],'where':{'id':_0x60b009[_0xbf2e('0x44')]['id']}},_0x3ceaa8={};_0x3ceaa8[_0xbf2e('0x30')]=_['keys'](db[_0xbf2e('0x3f')]['rawAttributes']);_0x3ceaa8[_0xbf2e('0x31')]=_[_0xbf2e('0x45')](_0x60b009[_0xbf2e('0x31')]);_0x3ceaa8[_0xbf2e('0x32')]=_[_0xbf2e('0x33')](_0x3ceaa8[_0xbf2e('0x30')],_0x3ceaa8['query']);_0x267c56[_0xbf2e('0x34')]=_[_0xbf2e('0x33')](_0x3ceaa8[_0xbf2e('0x30')],qs[_0xbf2e('0x35')](_0x60b009[_0xbf2e('0x31')][_0xbf2e('0x35')]));_0x267c56[_0xbf2e('0x34')]=_0x267c56['attributes'][_0xbf2e('0x36')]?_0x267c56[_0xbf2e('0x34')]:_0x3ceaa8[_0xbf2e('0x30')];if(_0x60b009[_0xbf2e('0x31')]['includeAll']){_0x267c56[_0xbf2e('0x40')]=[{'all':!![]}];}_0x267c56=_[_0xbf2e('0x3d')]({},_0x267c56,_0x60b009[_0xbf2e('0x3e')]);return db[_0xbf2e('0x3f')]['find'](_0x267c56)[_0xbf2e('0x25')](handleEntityNotFound(_0x4839dd,null))['then'](respondWithResult(_0x4839dd,null))[_0xbf2e('0x42')](handleError(_0x4839dd,null));};exports[_0xbf2e('0x24')]=function(_0x5cbcf6,_0x1c770d){if(_0x5cbcf6[_0xbf2e('0x46')]['id']){delete _0x5cbcf6['body']['id'];}return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':{'id':_0x5cbcf6[_0xbf2e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c770d,null))[_0xbf2e('0x25')](saveUpdates(_0x5cbcf6['body'],null))[_0xbf2e('0x25')](respondWithResult(_0x1c770d,null))['catch'](handleError(_0x1c770d,null));};exports[_0xbf2e('0x26')]=function(_0x49e564,_0x50fa72){return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':{'id':_0x49e564[_0xbf2e('0x44')]['id']}})[_0xbf2e('0x25')](handleEntityNotFound(_0x50fa72,null))[_0xbf2e('0x25')](removeEntity(_0x50fa72,null))['catch'](handleError(_0x50fa72,null));};exports[_0xbf2e('0x48')]=function(_0x4ee0f2,_0x2c01c7){var _0x34569b={'key':_0x4ee0f2[_0xbf2e('0x46')]['key']};if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x49')]){_0x34569b[_0xbf2e('0x49')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x49')];}else if(_0x4ee0f2[_0xbf2e('0x46')]['SmsAccountId']){_0x34569b[_0xbf2e('0x4a')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4a')];}else if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4b')]){_0x34569b[_0xbf2e('0x4b')]=_0x4ee0f2['body'][_0xbf2e('0x4b')];}else if(_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4c')]){_0x34569b[_0xbf2e('0x4c')]=_0x4ee0f2[_0xbf2e('0x46')][_0xbf2e('0x4c')];}return db[_0xbf2e('0x3f')][_0xbf2e('0x47')]({'where':_0x34569b})[_0xbf2e('0x25')](function(_0x2960e3){if(_0x2960e3){throw new db[(_0xbf2e('0x4d'))][(_0xbf2e('0x4e'))](_0xbf2e('0x4f'));}return db[_0xbf2e('0x3f')][_0xbf2e('0x48')](_0x4ee0f2[_0xbf2e('0x46')]);})['then'](function(_0xc970fd){var _0x30f1b5=_0x4ee0f2[_0xbf2e('0x50')]['get']({'plain':!![]});if(!_0x30f1b5)throw new Error(_0xbf2e('0x51'));if(_0x30f1b5[_0xbf2e('0x52')]==='user'){var _0x13221a=_0xc970fd[_0xbf2e('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xbf2e('0x47')]({'where':{'name':_0xbf2e('0x28'),'userProfileId':_0x30f1b5['userProfileId']},'raw':!![]})[_0xbf2e('0x25')](function(_0x3cfadc){if(_0x3cfadc&&_0x3cfadc['autoAssociation']===0x0){return db[_0xbf2e('0x29')][_0xbf2e('0x48')]({'name':_0x13221a[_0xbf2e('0x2c')],'resourceId':_0x13221a['id'],'type':_0x3cfadc[_0xbf2e('0x2c')],'sectionId':_0x3cfadc['id']},{})['then'](function(){return _0xc970fd;});}else{return _0xc970fd;}})[_0xbf2e('0x42')](function(_0x1808ba){logger[_0xbf2e('0x2a')](_0xbf2e('0x53'),_0x1808ba);throw _0x1808ba;});}return _0xc970fd;})[_0xbf2e('0x25')](respondWithResult(_0x2c01c7,0xc9))[_0xbf2e('0x42')](handleError(_0x2c01c7,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8a06fc9..a677745 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 _0x09dd=['moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','define','lodash','util','../../config/logger','api'];(function(_0x251001,_0x41d6ee){var _0x1cce7e=function(_0x5ee1b3){while(--_0x5ee1b3){_0x251001['push'](_0x251001['shift']());}};_0x1cce7e(++_0x41d6ee);}(_0x09dd,0xb7));var _0xd09d=function(_0x493370,_0x4c7fac){_0x493370=_0x493370-0x0;var _0xac15d=_0x09dd[_0x493370];return _0xac15d;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require('../../config/environment');var attributes=require(_0xd09d('0x9'));module['exports']=function(_0x274db5,_0x535080){return _0x274db5[_0xd09d('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8f17=['moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1416a3,_0x2734d6){var _0x2124d9=function(_0x3e5c16){while(--_0x3e5c16){_0x1416a3['push'](_0x1416a3['shift']());}};_0x2124d9(++_0x2734d6);}(_0x8f17,0xfb));var _0x78f1=function(_0x1afc73,_0x1e3ecb){_0x1afc73=_0x1afc73-0x0;var _0x23f0d2=_0x8f17[_0x1afc73];return _0x23f0d2;};'use strict';var _=require(_0x78f1('0x0'));var util=require(_0x78f1('0x1'));var logger=require(_0x78f1('0x2'))(_0x78f1('0x3'));var moment=require(_0x78f1('0x4'));var BPromise=require('bluebird');var rp=require(_0x78f1('0x5'));var fs=require('fs');var path=require(_0x78f1('0x6'));var rimraf=require(_0x78f1('0x7'));var config=require(_0x78f1('0x8'));var attributes=require(_0x78f1('0x9'));module[_0x78f1('0xa')]=function(_0x3ed7fd,_0x3a089b){return _0x3ed7fd[_0x78f1('0xb')]('CannedAnswer',attributes,{'tableName':_0x78f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x78f1('0xd'),'collate':_0x78f1('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index fb2c03d..96729de 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(_0x470f5c,_0x1ed9bb){var _0x97f587=function(_0x209bd6){while(--_0x209bd6){_0x470f5c['push'](_0x470f5c['shift']());}};_0x97f587(++_0x1ed9bb);}(_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 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(_0x33c15c,_0x4db5dd){var _0x64cf71=function(_0x50262b){while(--_0x50262b){_0x33c15c['push'](_0x33c15c['shift']());}};_0x64cf71(++_0x4db5dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 afa499d..7144591 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 _0x5496=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','put','/:id'];(function(_0x5d55fb,_0x57ce20){var _0x337519=function(_0x49e41c){while(--_0x49e41c){_0x5d55fb['push'](_0x5d55fb['shift']());}};_0x337519(++_0x57ce20);}(_0x5496,0x134));var _0x6549=function(_0x243809,_0x12e002){_0x243809=_0x243809-0x0;var _0x3cd85e=_0x5496[_0x243809];return _0x3cd85e;};'use strict';var multer=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var path=require(_0x6549('0x2'));var timeout=require(_0x6549('0x3'));var express=require(_0x6549('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6549('0x5'));var config=require(_0x6549('0x6'));var controller=require('./cannedAnswer.controller');router[_0x6549('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6549('0x7')]('/:id',auth[_0x6549('0x8')](),controller['show']);router[_0x6549('0x9')]('/',auth[_0x6549('0x8')](),controller['create']);router[_0x6549('0xa')](_0x6549('0xb'),auth[_0x6549('0x8')](),controller[_0x6549('0xc')]);router[_0x6549('0xd')](_0x6549('0xb'),auth[_0x6549('0x8')](),controller[_0x6549('0xe')]);module[_0x6549('0xf')]=router; \ No newline at end of file +var _0x86bb=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','connect-timeout','express','fs-extra'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0x86bb,0x1ec));var _0xb86b=function(_0x374ea8,_0x444720){_0x374ea8=_0x374ea8-0x0;var _0x5bdf9f=_0x86bb[_0x374ea8];return _0x5bdf9f;};'use strict';var multer=require(_0xb86b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb86b('0x1'));var express=require(_0xb86b('0x2'));var router=express['Router']();var fs_extra=require(_0xb86b('0x3'));var auth=require(_0xb86b('0x4'));var interaction=require(_0xb86b('0x5'));var config=require(_0xb86b('0x6'));var controller=require('./cannedAnswer.controller');router[_0xb86b('0x7')]('/',auth[_0xb86b('0x8')](),controller[_0xb86b('0x9')]);router['get']('/:id',auth[_0xb86b('0x8')](),controller[_0xb86b('0xa')]);router[_0xb86b('0xb')]('/',auth[_0xb86b('0x8')](),controller['create']);router[_0xb86b('0xc')](_0xb86b('0xd'),auth[_0xb86b('0x8')](),controller['update']);router['delete'](_0xb86b('0xd'),auth[_0xb86b('0x8')](),controller[_0xb86b('0xe')]);module[_0xb86b('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 70c3cd3..0ac4235 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 _0xe773=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3ef7ec,_0x25a299){var _0xdc5789=function(_0x535ccb){while(--_0x535ccb){_0x3ef7ec['push'](_0x3ef7ec['shift']());}};_0xdc5789(++_0x25a299);}(_0xe773,0x19a));var _0x3e77=function(_0x472855,_0x547e32){_0x472855=_0x472855-0x0;var _0x5543da=_0xe773[_0x472855];return _0x5543da;};'use strict';var Sequelize=require('sequelize');module[_0x3e77('0x0')]={'calldate':{'type':Sequelize[_0x3e77('0x1')],'allowNull':![],'defaultValue':_0x3e77('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x3e77('0x3')]},'dst':{'type':Sequelize[_0x3e77('0x3')]},'dcontext':{'type':Sequelize[_0x3e77('0x3')]},'channel':{'type':Sequelize[_0x3e77('0x3')]},'dstchannel':{'type':Sequelize[_0x3e77('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x3e77('0x3')]},'duration':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3e77('0x3')]},'amaflags':{'type':Sequelize[_0x3e77('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3e77('0x3')]},'userfield':{'type':Sequelize[_0x3e77('0x3')]},'uniqueid':{'type':Sequelize[_0x3e77('0x3')]},'linkedid':{'type':Sequelize[_0x3e77('0x3')]},'sequence':{'type':Sequelize[_0x3e77('0x3')]},'peeraccount':{'type':Sequelize[_0x3e77('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1d5b=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x28659f,_0x16f80d){var _0x120c75=function(_0x29323a){while(--_0x29323a){_0x28659f['push'](_0x28659f['shift']());}};_0x120c75(++_0x16f80d);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x394fb1,_0x4072da){_0x394fb1=_0x394fb1-0x0;var _0x2ded0d=_0x1d5b[_0x394fb1];return _0x2ded0d;};'use strict';var Sequelize=require(_0xb1d5('0x0'));module[_0xb1d5('0x1')]={'calldate':{'type':Sequelize[_0xb1d5('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xb1d5('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xb1d5('0x3')]},'dcontext':{'type':Sequelize[_0xb1d5('0x3')]},'channel':{'type':Sequelize[_0xb1d5('0x3')]},'dstchannel':{'type':Sequelize[_0xb1d5('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb1d5('0x3')]},'amaflags':{'type':Sequelize[_0xb1d5('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb1d5('0x3')]},'userfield':{'type':Sequelize[_0xb1d5('0x3')]},'uniqueid':{'type':Sequelize[_0xb1d5('0x3')]},'linkedid':{'type':Sequelize[_0xb1d5('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xb1d5('0x3')]},'type':{'type':Sequelize[_0xb1d5('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 61817a6..8cc1004 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 _0x0618=['catch','show','intersection','options','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','then','rows'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x0618,0x1c6));var _0x8061=function(_0x244a18,_0x48c537){_0x244a18=_0x244a18-0x0;var _0x56975a=_0x0618[_0x244a18];return _0x56975a;};'use strict';var emlformat=require(_0x8061('0x0'));var rimraf=require(_0x8061('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8061('0x2'));var rp=require(_0x8061('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8061('0x4'));var util=require(_0x8061('0x5'));var path=require(_0x8061('0x6'));var sox=require(_0x8061('0x7'));var csv=require(_0x8061('0x8'));var ejs=require(_0x8061('0x9'));var fs=require('fs');var fs_extra=require(_0x8061('0xa'));var _=require(_0x8061('0xb'));var squel=require(_0x8061('0xc'));var crypto=require(_0x8061('0xd'));var jsforce=require(_0x8061('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8061('0x8'));var querystring=require('querystring');var Papa=require(_0x8061('0xf'));var Redis=require(_0x8061('0x10'));var authService=require(_0x8061('0x11'));var qs=require(_0x8061('0x12'));var as=require(_0x8061('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8061('0x14'));var utils=require(_0x8061('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8061('0x16'))['db'];function respondWithStatusCode(_0x141707,_0x724e64){_0x724e64=_0x724e64||0xcc;return function(_0x3537f0){if(_0x3537f0){return _0x141707[_0x8061('0x17')](_0x724e64);}return _0x141707[_0x8061('0x18')](_0x724e64)['end']();};}function respondWithResult(_0x4df59c,_0x19ea89){_0x19ea89=_0x19ea89||0xc8;return function(_0x4da339){if(_0x4da339){return _0x4df59c[_0x8061('0x18')](_0x19ea89)[_0x8061('0x19')](_0x4da339);}};}function respondWithFilteredResult(_0x567988,_0x483af8){return function(_0x460dfd){if(_0x460dfd){var _0x3264ff=typeof _0x483af8[_0x8061('0x1a')]===_0x8061('0x1b')&&typeof _0x483af8[_0x8061('0x1c')]===_0x8061('0x1b');var _0x280f9b=_0x460dfd[_0x8061('0x1d')];var _0x2b0eab=_0x3264ff?0x0:_0x483af8[_0x8061('0x1a')];var _0x14230e=_0x3264ff?_0x460dfd[_0x8061('0x1d')]:_0x483af8[_0x8061('0x1a')]+_0x483af8['limit'];var _0x4d254d;if(_0x14230e>=_0x280f9b){_0x14230e=_0x280f9b;_0x4d254d=0xc8;}else{_0x4d254d=0xce;}_0x567988[_0x8061('0x18')](_0x4d254d);return _0x567988[_0x8061('0x1e')](_0x8061('0x1f'),_0x2b0eab+'-'+_0x14230e+'/'+_0x280f9b)['json'](_0x460dfd);}return null;};}function patchUpdates(_0x53f869){return function(_0x36ccd5){try{jsonpatch[_0x8061('0x20')](_0x36ccd5,_0x53f869,!![]);}catch(_0x2bc509){return BPromise[_0x8061('0x21')](_0x2bc509);}return _0x36ccd5['save']();};}function saveUpdates(_0x49f708,_0x1cd5ed){return function(_0x12e73d){if(_0x12e73d){return _0x12e73d['update'](_0x49f708)['then'](function(_0x3dbaea){return _0x3dbaea;});}return null;};}function removeEntity(_0x554faa,_0x535cc9){return function(_0x37bff0){if(_0x37bff0){return _0x37bff0[_0x8061('0x22')]()['then'](function(){_0x554faa['status'](0xcc)[_0x8061('0x23')]();});}};}function handleEntityNotFound(_0x3f2765,_0x4e0860){return function(_0x1b0ec7){if(!_0x1b0ec7){_0x3f2765[_0x8061('0x17')](0x194);}return _0x1b0ec7;};}function handleError(_0x39fb5c,_0x2f7544){_0x2f7544=_0x2f7544||0x1f4;return function(_0x5f0822){logger['error'](_0x5f0822[_0x8061('0x24')]);if(_0x5f0822[_0x8061('0x25')]){delete _0x5f0822[_0x8061('0x25')];}_0x39fb5c[_0x8061('0x18')](_0x2f7544)[_0x8061('0x26')](_0x5f0822);};}exports['index']=function(_0x4c9202,_0x518700){var _0x59a65d={},_0xfb9138={},_0x38317c={'count':0x0,'rows':[]};var _0x36714f=_[_0x8061('0x27')](db[_0x8061('0x28')][_0x8061('0x29')],function(_0x2d1537){return{'name':_0x2d1537[_0x8061('0x2a')],'type':_0x2d1537[_0x8061('0x2b')][_0x8061('0x2c')]};});_0xfb9138['model']=_['map'](_0x36714f,_0x8061('0x25'));_0xfb9138[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x4c9202[_0x8061('0x2d')]);_0xfb9138[_0x8061('0x2f')]=_['intersection'](_0xfb9138[_0x8061('0x30')],_0xfb9138[_0x8061('0x2d')]);_0x59a65d['attributes']=_['intersection'](_0xfb9138[_0x8061('0x30')],qs[_0x8061('0x31')](_0x4c9202['query'][_0x8061('0x31')]));_0x59a65d[_0x8061('0x32')]=_0x59a65d[_0x8061('0x32')][_0x8061('0x33')]?_0x59a65d[_0x8061('0x32')]:_0xfb9138[_0x8061('0x30')];if(!_0x4c9202[_0x8061('0x2d')][_0x8061('0x34')](_0x8061('0x35'))){_0x59a65d['limit']=qs[_0x8061('0x1c')](_0x4c9202[_0x8061('0x2d')][_0x8061('0x1c')]);_0x59a65d[_0x8061('0x1a')]=qs['offset'](_0x4c9202['query']['offset']);}_0x59a65d['order']=qs['sort'](_0x4c9202[_0x8061('0x2d')]['sort']);_0x59a65d[_0x8061('0x36')]=qs[_0x8061('0x2f')](_[_0x8061('0x37')](_0x4c9202[_0x8061('0x2d')],_0xfb9138[_0x8061('0x2f')]),_0x36714f);if(_0x4c9202['query'][_0x8061('0x38')]){_0x59a65d[_0x8061('0x36')]=_[_0x8061('0x39')](_0x59a65d[_0x8061('0x36')],{'$or':_[_0x8061('0x27')](_0x36714f,function(_0x31ed9d){if(_0x31ed9d[_0x8061('0x2b')]!==_0x8061('0x3a')){var _0x714833={};_0x714833[_0x31ed9d[_0x8061('0x25')]]={'$like':'%'+_0x4c9202[_0x8061('0x2d')][_0x8061('0x38')]+'%'};return _0x714833;}})});}_0x59a65d=_['merge']({},_0x59a65d,_0x4c9202['options']);var _0xb72481={'where':_0x59a65d['where']};return db[_0x8061('0x28')]['count'](_0xb72481)['then'](function(_0x105747){_0x38317c[_0x8061('0x1d')]=_0x105747;if(_0x4c9202[_0x8061('0x2d')][_0x8061('0x3b')]){_0x59a65d[_0x8061('0x3c')]=[{'all':!![]}];}return db[_0x8061('0x28')][_0x8061('0x3d')](_0x59a65d);})[_0x8061('0x3e')](function(_0x1475b1){_0x38317c[_0x8061('0x3f')]=_0x1475b1;return _0x38317c;})['then'](respondWithFilteredResult(_0x518700,_0x59a65d))[_0x8061('0x40')](handleError(_0x518700,null));};exports[_0x8061('0x41')]=function(_0x177ab1,_0x2675e3){var _0x4435b8={'raw':!![],'where':{'id':_0x177ab1['params']['id']}},_0x4ea342={};_0x4ea342[_0x8061('0x30')]=_[_0x8061('0x2e')](db[_0x8061('0x28')][_0x8061('0x29')]);_0x4ea342[_0x8061('0x2d')]=_[_0x8061('0x2e')](_0x177ab1[_0x8061('0x2d')]);_0x4ea342['filters']=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],_0x4ea342[_0x8061('0x2d')]);_0x4435b8[_0x8061('0x32')]=_[_0x8061('0x42')](_0x4ea342[_0x8061('0x30')],qs[_0x8061('0x31')](_0x177ab1['query'][_0x8061('0x31')]));_0x4435b8['attributes']=_0x4435b8[_0x8061('0x32')][_0x8061('0x33')]?_0x4435b8[_0x8061('0x32')]:_0x4ea342['model'];if(_0x177ab1['query'][_0x8061('0x3b')]){_0x4435b8[_0x8061('0x3c')]=[{'all':!![]}];}_0x4435b8=_[_0x8061('0x39')]({},_0x4435b8,_0x177ab1[_0x8061('0x43')]);return db[_0x8061('0x28')]['find'](_0x4435b8)['then'](handleEntityNotFound(_0x2675e3,null))[_0x8061('0x3e')](respondWithResult(_0x2675e3,null))['catch'](handleError(_0x2675e3,null));};exports[_0x8061('0x44')]=function(_0x393bc9,_0x54546a){return db[_0x8061('0x28')][_0x8061('0x44')](_0x393bc9[_0x8061('0x45')],{})[_0x8061('0x3e')](respondWithResult(_0x54546a,0xc9))['catch'](handleError(_0x54546a,null));};exports[_0x8061('0x46')]=function(_0xb1cc9d,_0x2eaab6){if(_0xb1cc9d[_0x8061('0x45')]['id']){delete _0xb1cc9d[_0x8061('0x45')]['id'];}return db[_0x8061('0x28')][_0x8061('0x47')]({'where':{'id':_0xb1cc9d[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x2eaab6,null))[_0x8061('0x3e')](saveUpdates(_0xb1cc9d[_0x8061('0x45')],null))[_0x8061('0x3e')](respondWithResult(_0x2eaab6,null))[_0x8061('0x40')](handleError(_0x2eaab6,null));};exports[_0x8061('0x22')]=function(_0x291c8b,_0x30771f){return db[_0x8061('0x28')]['find']({'where':{'id':_0x291c8b[_0x8061('0x48')]['id']}})[_0x8061('0x3e')](handleEntityNotFound(_0x30771f,null))[_0x8061('0x3e')](removeEntity(_0x30771f,null))[_0x8061('0x40')](handleError(_0x30771f,null));};exports['describe']=function(_0x2be970,_0xd63f0e){return db[_0x8061('0x28')][_0x8061('0x49')]()[_0x8061('0x3e')](respondWithResult(_0xd63f0e,null))[_0x8061('0x40')](handleError(_0xd63f0e,null));}; \ No newline at end of file +var _0x2b83=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','keys','options','create','catch','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error'];(function(_0x42973b,_0x4b7905){var _0x56bb1e=function(_0x532359){while(--_0x532359){_0x42973b['push'](_0x42973b['shift']());}};_0x56bb1e(++_0x4b7905);}(_0x2b83,0x1d3));var _0x32b8=function(_0x5cad70,_0xa8e39){_0x5cad70=_0x5cad70-0x0;var _0x2ebbb3=_0x2b83[_0x5cad70];return _0x2ebbb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={},_0x3e0548={},_0x2bc3ce={'count':0x0,'rows':[]};var _0x1fcba2=_['map'](db[_0x32b8('0x29')][_0x32b8('0x2a')],function(_0x383b0e){return{'name':_0x383b0e[_0x32b8('0x2b')],'type':_0x383b0e[_0x32b8('0x2c')][_0x32b8('0x2d')]};});_0x3e0548[_0x32b8('0x2e')]=_[_0x32b8('0x2f')](_0x1fcba2,_0x32b8('0x26'));_0x3e0548[_0x32b8('0x30')]=_['keys'](_0x39ce15[_0x32b8('0x30')]);_0x3e0548[_0x32b8('0x31')]=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],_0x3e0548['query']);_0xa225ec['attributes']=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],qs[_0x32b8('0x33')](_0x39ce15[_0x32b8('0x30')]['fields']));_0xa225ec[_0x32b8('0x34')]=_0xa225ec[_0x32b8('0x34')][_0x32b8('0x35')]?_0xa225ec[_0x32b8('0x34')]:_0x3e0548[_0x32b8('0x2e')];if(!_0x39ce15[_0x32b8('0x30')][_0x32b8('0x36')](_0x32b8('0x37'))){_0xa225ec['limit']=qs[_0x32b8('0x1b')](_0x39ce15['query'][_0x32b8('0x1b')]);_0xa225ec[_0x32b8('0x1a')]=qs[_0x32b8('0x1a')](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x1a')]);}_0xa225ec[_0x32b8('0x38')]=qs['sort'](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x39')]);_0xa225ec[_0x32b8('0x3a')]=qs['filters'](_[_0x32b8('0x3b')](_0x39ce15['query'],_0x3e0548[_0x32b8('0x31')]),_0x1fcba2);if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3c')]){_0xa225ec[_0x32b8('0x3a')]=_['merge'](_0xa225ec[_0x32b8('0x3a')],{'$or':_[_0x32b8('0x2f')](_0x1fcba2,function(_0x2d586f){if(_0x2d586f['type']!=='VIRTUAL'){var _0xa8115e={};_0xa8115e[_0x2d586f[_0x32b8('0x26')]]={'$like':'%'+_0x39ce15[_0x32b8('0x30')]['filter']+'%'};return _0xa8115e;}})});}_0xa225ec=_['merge']({},_0xa225ec,_0x39ce15['options']);var _0x1aa6ef={'where':_0xa225ec[_0x32b8('0x3a')]};return db[_0x32b8('0x29')]['count'](_0x1aa6ef)[_0x32b8('0x23')](function(_0x14c109){_0x2bc3ce[_0x32b8('0x19')]=_0x14c109;if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3d')]){_0xa225ec[_0x32b8('0x3e')]=[{'all':!![]}];}return db[_0x32b8('0x29')][_0x32b8('0x3f')](_0xa225ec);})['then'](function(_0x39ec33){_0x2bc3ce['rows']=_0x39ec33;return _0x2bc3ce;})['then'](respondWithFilteredResult(_0x3fa029,_0xa225ec))['catch'](handleError(_0x3fa029,null));};exports['show']=function(_0x2d9003,_0x50e6e3){var _0x2a3968={'raw':!![],'where':{'id':_0x2d9003['params']['id']}},_0x52709b={};_0x52709b[_0x32b8('0x2e')]=_[_0x32b8('0x40')](db[_0x32b8('0x29')]['rawAttributes']);_0x52709b[_0x32b8('0x30')]=_[_0x32b8('0x40')](_0x2d9003[_0x32b8('0x30')]);_0x52709b['filters']=_['intersection'](_0x52709b[_0x32b8('0x2e')],_0x52709b['query']);_0x2a3968[_0x32b8('0x34')]=_['intersection'](_0x52709b[_0x32b8('0x2e')],qs['fields'](_0x2d9003[_0x32b8('0x30')][_0x32b8('0x33')]));_0x2a3968[_0x32b8('0x34')]=_0x2a3968[_0x32b8('0x34')]['length']?_0x2a3968['attributes']:_0x52709b[_0x32b8('0x2e')];if(_0x2d9003[_0x32b8('0x30')][_0x32b8('0x3d')]){_0x2a3968['include']=[{'all':!![]}];}_0x2a3968=_['merge']({},_0x2a3968,_0x2d9003[_0x32b8('0x41')]);return db[_0x32b8('0x29')]['find'](_0x2a3968)[_0x32b8('0x23')](handleEntityNotFound(_0x50e6e3,null))['then'](respondWithResult(_0x50e6e3,null))['catch'](handleError(_0x50e6e3,null));};exports['create']=function(_0x250ebf,_0x2d2624){return db[_0x32b8('0x29')][_0x32b8('0x42')](_0x250ebf['body'],{})[_0x32b8('0x23')](respondWithResult(_0x2d2624,0xc9))[_0x32b8('0x43')](handleError(_0x2d2624,null));};exports[_0x32b8('0x21')]=function(_0x29a413,_0x1a5bd4){if(_0x29a413[_0x32b8('0x44')]['id']){delete _0x29a413[_0x32b8('0x44')]['id'];}return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x29a413[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x1a5bd4,null))[_0x32b8('0x23')](saveUpdates(_0x29a413[_0x32b8('0x44')],null))[_0x32b8('0x23')](respondWithResult(_0x1a5bd4,null))[_0x32b8('0x43')](handleError(_0x1a5bd4,null));};exports[_0x32b8('0x22')]=function(_0x68210a,_0x5b8ca9){return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x68210a[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x5b8ca9,null))[_0x32b8('0x23')](removeEntity(_0x5b8ca9,null))[_0x32b8('0x43')](handleError(_0x5b8ca9,null));};exports[_0x32b8('0x47')]=function(_0x4f7c6f,_0xde4f61){return db[_0x32b8('0x29')][_0x32b8('0x47')]()[_0x32b8('0x23')](respondWithResult(_0xde4f61,null))['catch'](handleError(_0xde4f61,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7031c5f..15fc4cb 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(_0x27a95a,_0x4bae5d){var _0x292282=function(_0x29b04e){while(--_0x29b04e){_0x27a95a['push'](_0x27a95a['shift']());}};_0x292282(++_0x4bae5d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x4b4dce,_0x27b1de){var _0x97cab9=function(_0x3b4b8e){while(--_0x3b4b8e){_0x4b4dce['push'](_0x4b4dce['shift']());}};_0x97cab9(++_0x27b1de);}(_0x7a54,0x106));var _0x47a5=function(_0xfdcf6c,_0x1484c1){_0xfdcf6c=_0xfdcf6c-0x0;var _0x3580a2=_0x7a54[_0xfdcf6c];return _0x3580a2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 1b21d6c..89ba1eb 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 _0xa70b=['debug','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x52a7e1,_0x189bf3){var _0x4f4495=function(_0x5d1915){while(--_0x5d1915){_0x52a7e1['push'](_0x52a7e1['shift']());}};_0x4f4495(++_0x189bf3);}(_0xa70b,0x126));var _0xba70=function(_0x5b959e,_0x28debf){_0x5b959e=_0x5b959e-0x0;var _0x11df5a=_0xa70b[_0x5b959e];return _0x11df5a;};'use strict';var _=require(_0xba70('0x0'));var util=require(_0xba70('0x1'));var moment=require(_0xba70('0x2'));var BPromise=require(_0xba70('0x3'));var rs=require(_0xba70('0x4'));var fs=require('fs');var Redis=require(_0xba70('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba70('0x6'))(_0xba70('0x7'));var config=require(_0xba70('0x8'));var jayson=require(_0xba70('0x9'));var client=jayson[_0xba70('0xa')][_0xba70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ed505,_0x2ee216,_0x30e784){return new BPromise(function(_0xc989c8,_0x2ad227){return client['request'](_0x1ed505,_0x30e784)['then'](function(_0x1f4cb3){logger[_0xba70('0xc')]('Cdr,\x20%s,\x20%s',_0x2ee216,_0xba70('0xd'));logger[_0xba70('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x2ee216,_0xba70('0xd'),JSON[_0xba70('0xf')](_0x1f4cb3));if(_0x1f4cb3[_0xba70('0x10')]){if(_0x1f4cb3[_0xba70('0x10')][_0xba70('0x11')]===0x1f4){logger[_0xba70('0x10')]('Cdr,\x20%s,\x20%s',_0x2ee216,_0x1f4cb3[_0xba70('0x10')]['message']);return _0x2ad227(_0x1f4cb3['error'][_0xba70('0x12')]);}logger[_0xba70('0x10')](_0xba70('0x13'),_0x2ee216,_0x1f4cb3[_0xba70('0x10')][_0xba70('0x12')]);return _0xc989c8(_0x1f4cb3[_0xba70('0x10')][_0xba70('0x12')]);}else{logger[_0xba70('0xc')](_0xba70('0x13'),_0x2ee216,_0xba70('0xd'));_0xc989c8(_0x1f4cb3[_0xba70('0x14')][_0xba70('0x12')]);}})[_0xba70('0x15')](function(_0x3f3a02){logger[_0xba70('0x10')](_0xba70('0x13'),_0x2ee216,_0x3f3a02);_0x2ad227(_0x3f3a02);});});} \ No newline at end of file +var _0x68a4=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x194d89,_0x3cc65e){var _0x12e6bc=function(_0x34c3ca){while(--_0x34c3ca){_0x194d89['push'](_0x194d89['shift']());}};_0x12e6bc(++_0x3cc65e);}(_0x68a4,0xf0));var _0x468a=function(_0x12ee23,_0xacb61a){_0x12ee23=_0x12ee23-0x0;var _0x101a49=_0x68a4[_0x12ee23];return _0x101a49;};'use strict';var _=require(_0x468a('0x0'));var util=require(_0x468a('0x1'));var moment=require('moment');var BPromise=require(_0x468a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x468a('0x3'));var db=require(_0x468a('0x4'))['db'];var utils=require(_0x468a('0x5'));var logger=require(_0x468a('0x6'))(_0x468a('0x7'));var config=require(_0x468a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x468a('0x9')][_0x468a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3753e0,_0x331d0e,_0x3a0d99){return new BPromise(function(_0x933481,_0xc5f4e5){return client[_0x468a('0xb')](_0x3753e0,_0x3a0d99)[_0x468a('0xc')](function(_0xad2724){logger[_0x468a('0xd')](_0x468a('0xe'),_0x331d0e,_0x468a('0xf'));logger[_0x468a('0x10')](_0x468a('0x11'),_0x331d0e,_0x468a('0xf'),JSON[_0x468a('0x12')](_0xad2724));if(_0xad2724[_0x468a('0x13')]){if(_0xad2724[_0x468a('0x13')][_0x468a('0x14')]===0x1f4){logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0xad2724[_0x468a('0x13')]['message']);return _0xc5f4e5(_0xad2724[_0x468a('0x13')][_0x468a('0x15')]);}logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0xad2724[_0x468a('0x13')][_0x468a('0x15')]);return _0x933481(_0xad2724['error'][_0x468a('0x15')]);}else{logger['info'](_0x468a('0xe'),_0x331d0e,'request\x20sent');_0x933481(_0xad2724[_0x468a('0x16')][_0x468a('0x15')]);}})[_0x468a('0x17')](function(_0x18fa61){logger[_0x468a('0x13')](_0x468a('0xe'),_0x331d0e,_0x18fa61);_0xc5f4e5(_0x18fa61);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5dfaac5..1c56429 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_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'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x24c57b,_0x2ab0c0){var _0x1d0146=function(_0x420e86){while(--_0x420e86){_0x24c57b['push'](_0x24c57b['shift']());}};_0x1d0146(++_0x2ab0c0);}(_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 6274f79..f8d07dc 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 _0xd8fc=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x584cef,_0x352150){var _0x41d443=function(_0x14b843){while(--_0x14b843){_0x584cef['push'](_0x584cef['shift']());}};_0x41d443(++_0x352150);}(_0xd8fc,0x150));var _0xcd8f=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0xd8fc[_0x390733];return _0x33beb9;};'use strict';var Sequelize=require('sequelize');module[_0xcd8f('0x0')]={'priority':{'type':Sequelize[_0xcd8f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcd8f('0x2')],'allowNull':![],'defaultValue':_0xcd8f('0x3')},'appdata':{'type':Sequelize[_0xcd8f('0x4')]()},'description':{'type':Sequelize[_0xcd8f('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1844=['noop','TEXT','sequelize','exports','STRING'];(function(_0x3e4a3a,_0x655dce){var _0x33c212=function(_0x9ea73d){while(--_0x9ea73d){_0x3e4a3a['push'](_0x3e4a3a['shift']());}};_0x33c212(++_0x655dce);}(_0x1844,0x66));var _0x4184=function(_0x4e148a,_0x2784e3){_0x4e148a=_0x4e148a-0x0;var _0x494092=_0x1844[_0x4e148a];return _0x494092;};'use strict';var Sequelize=require(_0x4184('0x0'));module[_0x4184('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x4184('0x2')],'allowNull':![],'defaultValue':_0x4184('0x3')},'appdata':{'type':Sequelize[_0x4184('0x4')]()},'description':{'type':Sequelize[_0x4184('0x2')]},'interval':{'type':Sequelize[_0x4184('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index e09d546..f74cec0 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 _0x2e31=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','end','stack','name','send','show','params','model','ChatApplication','query','keys','filters','intersection','attributes','fields','include','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x4968a6,_0x22c750){var _0x54592b=function(_0x4190c8){while(--_0x4190c8){_0x4968a6['push'](_0x4968a6['shift']());}};_0x54592b(++_0x22c750);}(_0x2e31,0x145));var _0x12e3=function(_0x4947e3,_0x28b655){_0x4947e3=_0x4947e3-0x0;var _0x26dac7=_0x2e31[_0x4947e3];return _0x26dac7;};'use strict';var emlformat=require(_0x12e3('0x0'));var rimraf=require(_0x12e3('0x1'));var zipdir=require(_0x12e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x12e3('0x3'));var moment=require(_0x12e3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x12e3('0x5'));var path=require(_0x12e3('0x6'));var sox=require(_0x12e3('0x7'));var csv=require('to-csv');var ejs=require(_0x12e3('0x8'));var fs=require('fs');var fs_extra=require(_0x12e3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12e3('0xa'));var jsforce=require(_0x12e3('0xb'));var deskjs=require(_0x12e3('0xc'));var toCsv=require(_0x12e3('0xd'));var querystring=require('querystring');var Papa=require(_0x12e3('0xe'));var Redis=require(_0x12e3('0xf'));var authService=require(_0x12e3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12e3('0x11'));var logger=require(_0x12e3('0x12'))(_0x12e3('0x13'));var utils=require(_0x12e3('0x14'));var config=require(_0x12e3('0x15'));var licenseUtil=require(_0x12e3('0x16'));var db=require(_0x12e3('0x17'))['db'];function respondWithStatusCode(_0xc2c4c8,_0x2b5dc3){_0x2b5dc3=_0x2b5dc3||0xcc;return function(_0x464b63){if(_0x464b63){return _0xc2c4c8[_0x12e3('0x18')](_0x2b5dc3);}return _0xc2c4c8[_0x12e3('0x19')](_0x2b5dc3)['end']();};}function respondWithResult(_0x2b5352,_0x19de67){_0x19de67=_0x19de67||0xc8;return function(_0xd9f80f){if(_0xd9f80f){return _0x2b5352['status'](_0x19de67)[_0x12e3('0x1a')](_0xd9f80f);}};}function respondWithFilteredResult(_0x1f7b14,_0x4a29e8){return function(_0x5434fd){if(_0x5434fd){var _0x583ca3=typeof _0x4a29e8[_0x12e3('0x1b')]==='undefined'&&typeof _0x4a29e8[_0x12e3('0x1c')]===_0x12e3('0x1d');var _0x114a83=_0x5434fd[_0x12e3('0x1e')];var _0x211c6a=_0x583ca3?0x0:_0x4a29e8[_0x12e3('0x1b')];var _0x5a63c8=_0x583ca3?_0x5434fd[_0x12e3('0x1e')]:_0x4a29e8[_0x12e3('0x1b')]+_0x4a29e8['limit'];var _0x527dc6;if(_0x5a63c8>=_0x114a83){_0x5a63c8=_0x114a83;_0x527dc6=0xc8;}else{_0x527dc6=0xce;}_0x1f7b14['status'](_0x527dc6);return _0x1f7b14[_0x12e3('0x1f')]('Content-Range',_0x211c6a+'-'+_0x5a63c8+'/'+_0x114a83)[_0x12e3('0x1a')](_0x5434fd);}return null;};}function patchUpdates(_0x2ddfbf){return function(_0x5a1990){try{jsonpatch['apply'](_0x5a1990,_0x2ddfbf,!![]);}catch(_0x37151c){return BPromise[_0x12e3('0x20')](_0x37151c);}return _0x5a1990[_0x12e3('0x21')]();};}function saveUpdates(_0x1f1873,_0x4b8617){return function(_0x55380a){if(_0x55380a){return _0x55380a[_0x12e3('0x22')](_0x1f1873)[_0x12e3('0x23')](function(_0x607255){return _0x607255;});}return null;};}function removeEntity(_0x2705e8,_0x2cf78a){return function(_0x553982){if(_0x553982){return _0x553982[_0x12e3('0x24')]()[_0x12e3('0x23')](function(){_0x2705e8[_0x12e3('0x19')](0xcc)[_0x12e3('0x25')]();});}};}function handleEntityNotFound(_0x43a59f,_0x3361d2){return function(_0x578681){if(!_0x578681){_0x43a59f[_0x12e3('0x18')](0x194);}return _0x578681;};}function handleError(_0x1c5344,_0x4213db){_0x4213db=_0x4213db||0x1f4;return function(_0x42765f){logger['error'](_0x42765f[_0x12e3('0x26')]);if(_0x42765f[_0x12e3('0x27')]){delete _0x42765f[_0x12e3('0x27')];}_0x1c5344['status'](_0x4213db)[_0x12e3('0x28')](_0x42765f);};}exports[_0x12e3('0x29')]=function(_0x329d32,_0x337790){var _0x5a5dd1={'raw':!![],'where':{'id':_0x329d32[_0x12e3('0x2a')]['id']}},_0x342ad2={};_0x342ad2[_0x12e3('0x2b')]=_['keys'](db[_0x12e3('0x2c')]['rawAttributes']);_0x342ad2[_0x12e3('0x2d')]=_[_0x12e3('0x2e')](_0x329d32[_0x12e3('0x2d')]);_0x342ad2[_0x12e3('0x2f')]=_[_0x12e3('0x30')](_0x342ad2[_0x12e3('0x2b')],_0x342ad2['query']);_0x5a5dd1[_0x12e3('0x31')]=_[_0x12e3('0x30')](_0x342ad2['model'],qs[_0x12e3('0x32')](_0x329d32[_0x12e3('0x2d')]['fields']));_0x5a5dd1[_0x12e3('0x31')]=_0x5a5dd1[_0x12e3('0x31')]['length']?_0x5a5dd1[_0x12e3('0x31')]:_0x342ad2[_0x12e3('0x2b')];if(_0x329d32[_0x12e3('0x2d')]['includeAll']){_0x5a5dd1[_0x12e3('0x33')]=[{'all':!![]}];}_0x5a5dd1=_[_0x12e3('0x34')]({},_0x5a5dd1,_0x329d32[_0x12e3('0x35')]);return db[_0x12e3('0x2c')][_0x12e3('0x36')](_0x5a5dd1)[_0x12e3('0x23')](handleEntityNotFound(_0x337790,null))[_0x12e3('0x23')](respondWithResult(_0x337790,null))[_0x12e3('0x37')](handleError(_0x337790,null));};exports[_0x12e3('0x22')]=function(_0x273d2f,_0x19d331){if(_0x273d2f[_0x12e3('0x38')]['id']){delete _0x273d2f[_0x12e3('0x38')]['id'];}return db['ChatApplication'][_0x12e3('0x36')]({'where':{'id':_0x273d2f['params']['id']}})[_0x12e3('0x23')](handleEntityNotFound(_0x19d331,null))['then'](saveUpdates(_0x273d2f[_0x12e3('0x38')],null))[_0x12e3('0x23')](respondWithResult(_0x19d331,null))['catch'](handleError(_0x19d331,null));};exports[_0x12e3('0x24')]=function(_0x31910f,_0x5c7f42){return db[_0x12e3('0x2c')][_0x12e3('0x36')]({'where':{'id':_0x31910f[_0x12e3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5c7f42,null))[_0x12e3('0x23')](removeEntity(_0x5c7f42,null))[_0x12e3('0x37')](handleError(_0x5c7f42,null));}; \ No newline at end of file +var _0x0efe=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','show','keys','rawAttributes','query','filters','intersection','attributes','fields','length','model','include','merge','options','ChatApplication','catch','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','offset'];(function(_0xf389d7,_0x4ed315){var _0x914d09=function(_0x595e34){while(--_0x595e34){_0xf389d7['push'](_0xf389d7['shift']());}};_0x914d09(++_0x4ed315);}(_0x0efe,0x110));var _0xe0ef=function(_0xabdace,_0x1f5b40){_0xabdace=_0xabdace-0x0;var _0x37da12=_0x0efe[_0xabdace];return _0x37da12;};'use strict';var emlformat=require(_0xe0ef('0x0'));var rimraf=require(_0xe0ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0ef('0x2'));var rp=require(_0xe0ef('0x3'));var moment=require(_0xe0ef('0x4'));var BPromise=require(_0xe0ef('0x5'));var Mustache=require(_0xe0ef('0x6'));var util=require(_0xe0ef('0x7'));var path=require(_0xe0ef('0x8'));var sox=require(_0xe0ef('0x9'));var csv=require(_0xe0ef('0xa'));var ejs=require(_0xe0ef('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe0ef('0xc'));var crypto=require(_0xe0ef('0xd'));var jsforce=require(_0xe0ef('0xe'));var deskjs=require(_0xe0ef('0xf'));var toCsv=require(_0xe0ef('0xa'));var querystring=require(_0xe0ef('0x10'));var Papa=require(_0xe0ef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe0ef('0x12'));var as=require(_0xe0ef('0x13'));var hardwareService=require(_0xe0ef('0x14'));var logger=require('../../config/logger')(_0xe0ef('0x15'));var utils=require(_0xe0ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38c64f,_0x90c232){_0x90c232=_0x90c232||0xcc;return function(_0x3cce82){if(_0x3cce82){return _0x38c64f['sendStatus'](_0x90c232);}return _0x38c64f['status'](_0x90c232)[_0xe0ef('0x18')]();};}function respondWithResult(_0x196114,_0x1afbbc){_0x1afbbc=_0x1afbbc||0xc8;return function(_0x1fbfd0){if(_0x1fbfd0){return _0x196114[_0xe0ef('0x19')](_0x1afbbc)[_0xe0ef('0x1a')](_0x1fbfd0);}};}function respondWithFilteredResult(_0x2b7564,_0x1177d2){return function(_0x5d845d){if(_0x5d845d){var _0x401f4a=typeof _0x1177d2[_0xe0ef('0x1b')]===_0xe0ef('0x1c')&&typeof _0x1177d2[_0xe0ef('0x1d')]===_0xe0ef('0x1c');var _0x5618ad=_0x5d845d[_0xe0ef('0x1e')];var _0x25ae21=_0x401f4a?0x0:_0x1177d2[_0xe0ef('0x1b')];var _0xe9d60f=_0x401f4a?_0x5d845d[_0xe0ef('0x1e')]:_0x1177d2[_0xe0ef('0x1b')]+_0x1177d2[_0xe0ef('0x1d')];var _0x3a357c;if(_0xe9d60f>=_0x5618ad){_0xe9d60f=_0x5618ad;_0x3a357c=0xc8;}else{_0x3a357c=0xce;}_0x2b7564[_0xe0ef('0x19')](_0x3a357c);return _0x2b7564[_0xe0ef('0x1f')](_0xe0ef('0x20'),_0x25ae21+'-'+_0xe9d60f+'/'+_0x5618ad)[_0xe0ef('0x1a')](_0x5d845d);}return null;};}function patchUpdates(_0x450321){return function(_0x50c044){try{jsonpatch[_0xe0ef('0x21')](_0x50c044,_0x450321,!![]);}catch(_0xe789bc){return BPromise[_0xe0ef('0x22')](_0xe789bc);}return _0x50c044[_0xe0ef('0x23')]();};}function saveUpdates(_0x58810f,_0x140f42){return function(_0x115cb3){if(_0x115cb3){return _0x115cb3[_0xe0ef('0x24')](_0x58810f)[_0xe0ef('0x25')](function(_0x1c0fcb){return _0x1c0fcb;});}return null;};}function removeEntity(_0x1c8270,_0x255b55){return function(_0x59b64c){if(_0x59b64c){return _0x59b64c[_0xe0ef('0x26')]()[_0xe0ef('0x25')](function(){_0x1c8270['status'](0xcc)[_0xe0ef('0x18')]();});}};}function handleEntityNotFound(_0x1cd61a,_0x5bc53a){return function(_0x576082){if(!_0x576082){_0x1cd61a['sendStatus'](0x194);}return _0x576082;};}function handleError(_0x7295c0,_0x4ee2c1){_0x4ee2c1=_0x4ee2c1||0x1f4;return function(_0x3f4e80){logger[_0xe0ef('0x27')](_0x3f4e80[_0xe0ef('0x28')]);if(_0x3f4e80['name']){delete _0x3f4e80['name'];}_0x7295c0['status'](_0x4ee2c1)[_0xe0ef('0x29')](_0x3f4e80);};}exports[_0xe0ef('0x2a')]=function(_0x3dd451,_0x31e576){var _0x2d1674={'raw':!![],'where':{'id':_0x3dd451['params']['id']}},_0x2b0d3c={};_0x2b0d3c['model']=_[_0xe0ef('0x2b')](db['ChatApplication'][_0xe0ef('0x2c')]);_0x2b0d3c[_0xe0ef('0x2d')]=_['keys'](_0x3dd451['query']);_0x2b0d3c[_0xe0ef('0x2e')]=_[_0xe0ef('0x2f')](_0x2b0d3c['model'],_0x2b0d3c[_0xe0ef('0x2d')]);_0x2d1674[_0xe0ef('0x30')]=_[_0xe0ef('0x2f')](_0x2b0d3c['model'],qs['fields'](_0x3dd451['query'][_0xe0ef('0x31')]));_0x2d1674['attributes']=_0x2d1674[_0xe0ef('0x30')][_0xe0ef('0x32')]?_0x2d1674['attributes']:_0x2b0d3c[_0xe0ef('0x33')];if(_0x3dd451[_0xe0ef('0x2d')]['includeAll']){_0x2d1674[_0xe0ef('0x34')]=[{'all':!![]}];}_0x2d1674=_[_0xe0ef('0x35')]({},_0x2d1674,_0x3dd451[_0xe0ef('0x36')]);return db[_0xe0ef('0x37')]['find'](_0x2d1674)[_0xe0ef('0x25')](handleEntityNotFound(_0x31e576,null))[_0xe0ef('0x25')](respondWithResult(_0x31e576,null))[_0xe0ef('0x38')](handleError(_0x31e576,null));};exports[_0xe0ef('0x24')]=function(_0x4a1d24,_0x244f57){if(_0x4a1d24[_0xe0ef('0x39')]['id']){delete _0x4a1d24[_0xe0ef('0x39')]['id'];}return db[_0xe0ef('0x37')][_0xe0ef('0x3a')]({'where':{'id':_0x4a1d24[_0xe0ef('0x3b')]['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x244f57,null))[_0xe0ef('0x25')](saveUpdates(_0x4a1d24[_0xe0ef('0x39')],null))['then'](respondWithResult(_0x244f57,null))[_0xe0ef('0x38')](handleError(_0x244f57,null));};exports[_0xe0ef('0x26')]=function(_0x1f6a73,_0x1cb146){return db[_0xe0ef('0x37')][_0xe0ef('0x3a')]({'where':{'id':_0x1f6a73[_0xe0ef('0x3b')]['id']}})[_0xe0ef('0x25')](handleEntityNotFound(_0x1cb146,null))[_0xe0ef('0x25')](removeEntity(_0x1cb146,null))[_0xe0ef('0x38')](handleError(_0x1cb146,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b7589e3..4397ad3 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 _0x27c7=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x27c7,0x10d));var _0x727c=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x27c7[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x727c('0x0'));var util=require(_0x727c('0x1'));var logger=require(_0x727c('0x2'))('api');var moment=require(_0x727c('0x3'));var BPromise=require(_0x727c('0x4'));var rp=require(_0x727c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x727c('0x6'));var config=require(_0x727c('0x7'));var attributes=require(_0x727c('0x8'));module[_0x727c('0x9')]=function(_0x4db2fe,_0x1d6c6f){return _0x4db2fe[_0x727c('0xa')](_0x727c('0xb'),attributes,{'tableName':_0x727c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x727c('0xd')});}; \ No newline at end of file +var _0xd91d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0xcf95b4,_0x24baf1){var _0x20d28b=function(_0x3814e7){while(--_0x3814e7){_0xcf95b4['push'](_0xcf95b4['shift']());}};_0x20d28b(++_0x24baf1);}(_0xd91d,0x71));var _0xdd91=function(_0x29a50f,_0x1a6fb3){_0x29a50f=_0x29a50f-0x0;var _0x20ec94=_0xd91d[_0x29a50f];return _0x20ec94;};'use strict';var _=require(_0xdd91('0x0'));var util=require(_0xdd91('0x1'));var logger=require(_0xdd91('0x2'))(_0xdd91('0x3'));var moment=require(_0xdd91('0x4'));var BPromise=require(_0xdd91('0x5'));var rp=require(_0xdd91('0x6'));var fs=require('fs');var path=require(_0xdd91('0x7'));var rimraf=require(_0xdd91('0x8'));var config=require(_0xdd91('0x9'));var attributes=require('./chatApplication.attributes');module[_0xdd91('0xa')]=function(_0x1a50b0,_0x36b850){return _0x1a50b0[_0xdd91('0xb')](_0xdd91('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdd91('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 6e9c613..8b07c8d 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 _0x8bde=['request\x20sent','debug','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s'];(function(_0x2c0ad1,_0x42a5e0){var _0x22b9ad=function(_0x5e0fdd){while(--_0x5e0fdd){_0x2c0ad1['push'](_0x2c0ad1['shift']());}};_0x22b9ad(++_0x42a5e0);}(_0x8bde,0x15a));var _0xe8bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8bd('0x0'));var util=require(_0xe8bd('0x1'));var moment=require(_0xe8bd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8bd('0x3'));var db=require(_0xe8bd('0x4'))['db'];var utils=require(_0xe8bd('0x5'));var logger=require(_0xe8bd('0x6'))('rpc');var config=require(_0xe8bd('0x7'));var jayson=require(_0xe8bd('0x8'));var client=jayson[_0xe8bd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1573a7,_0x308029,_0x63aea7){return new BPromise(function(_0x3e0f7c,_0x3fa4c8){return client[_0xe8bd('0xa')](_0x1573a7,_0x63aea7)[_0xe8bd('0xb')](function(_0x3b5794){logger[_0xe8bd('0xc')](_0xe8bd('0xd'),_0x308029,_0xe8bd('0xe'));logger[_0xe8bd('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x308029,_0xe8bd('0xe'),JSON['stringify'](_0x3b5794));if(_0x3b5794[_0xe8bd('0x10')]){if(_0x3b5794['error'][_0xe8bd('0x11')]===0x1f4){logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);return _0x3fa4c8(_0x3b5794['error'][_0xe8bd('0x12')]);}logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);return _0x3e0f7c(_0x3b5794[_0xe8bd('0x10')][_0xe8bd('0x12')]);}else{logger[_0xe8bd('0xc')](_0xe8bd('0xd'),_0x308029,_0xe8bd('0xe'));_0x3e0f7c(_0x3b5794[_0xe8bd('0x13')]['message']);}})['catch'](function(_0x2ee31f){logger[_0xe8bd('0x10')](_0xe8bd('0xd'),_0x308029,_0x2ee31f);_0x3fa4c8(_0x2ee31f);});});} \ No newline at end of file +var _0x6b7d=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x346b32,_0x3109fd){var _0xa31991=function(_0x3b8b7f){while(--_0x3b8b7f){_0x346b32['push'](_0x346b32['shift']());}};_0xa31991(++_0x3109fd);}(_0x6b7d,0x7b));var _0xd6b7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6b7d[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xd6b7('0x0'));var util=require('util');var moment=require(_0xd6b7('0x1'));var BPromise=require(_0xd6b7('0x2'));var rs=require(_0xd6b7('0x3'));var fs=require('fs');var Redis=require(_0xd6b7('0x4'));var db=require(_0xd6b7('0x5'))['db'];var utils=require(_0xd6b7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd6b7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6b7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f3477,_0x52d56d,_0x33d39f){return new BPromise(function(_0x372377,_0x1050fa){return client['request'](_0x4f3477,_0x33d39f)[_0xd6b7('0x9')](function(_0x3e8622){logger['info'](_0xd6b7('0xa'),_0x52d56d,_0xd6b7('0xb'));logger[_0xd6b7('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x52d56d,'request\x20sent',JSON[_0xd6b7('0xd')](_0x3e8622));if(_0x3e8622[_0xd6b7('0xe')]){if(_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0xf')]===0x1f4){logger[_0xd6b7('0xe')](_0xd6b7('0xa'),_0x52d56d,_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);return _0x1050fa(_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x52d56d,_0x3e8622[_0xd6b7('0xe')][_0xd6b7('0x10')]);return _0x372377(_0x3e8622['error'][_0xd6b7('0x10')]);}else{logger[_0xd6b7('0x11')](_0xd6b7('0xa'),_0x52d56d,_0xd6b7('0xb'));_0x372377(_0x3e8622[_0xd6b7('0x12')][_0xd6b7('0x10')]);}})[_0xd6b7('0x13')](function(_0x26d4d3){logger[_0xd6b7('0xe')](_0xd6b7('0xa'),_0x52d56d,_0x26d4d3);_0x1050fa(_0x26d4d3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 0345c1e..9e998da 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 _0x53c3=['get','/:id','show','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0xb86097,_0x251ba4){var _0x12bfcf=function(_0x4743c7){while(--_0x4743c7){_0xb86097['push'](_0xb86097['shift']());}};_0x12bfcf(++_0x251ba4);}(_0x53c3,0x18c));var _0x353c=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x53c3[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x353c('0x0'));var util=require(_0x353c('0x1'));var path=require(_0x353c('0x2'));var timeout=require(_0x353c('0x3'));var express=require(_0x353c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x353c('0x5'));var interaction=require(_0x353c('0x6'));var config=require(_0x353c('0x7'));var controller=require(_0x353c('0x8'));router[_0x353c('0x9')](_0x353c('0xa'),auth['isAuthenticated'](),controller[_0x353c('0xb')]);router['put'](_0x353c('0xa'),auth[_0x353c('0xc')](),controller[_0x353c('0xd')]);router['delete'](_0x353c('0xa'),auth[_0x353c('0xc')](),controller['destroy']);module[_0x353c('0xe')]=router; \ No newline at end of file +var _0xa91f=['fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','delete','destroy','util','path','express','Router'];(function(_0x47e059,_0x2f0237){var _0x368caf=function(_0x16bc68){while(--_0x16bc68){_0x47e059['push'](_0x47e059['shift']());}};_0x368caf(++_0x2f0237);}(_0xa91f,0xbc));var _0xfa91=function(_0x502ebd,_0x470f8d){_0x502ebd=_0x502ebd-0x0;var _0x167b0a=_0xa91f[_0x502ebd];return _0x167b0a;};'use strict';var multer=require('multer');var util=require(_0xfa91('0x0'));var path=require(_0xfa91('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa91('0x2'));var router=express[_0xfa91('0x3')]();var fs_extra=require(_0xfa91('0x4'));var auth=require(_0xfa91('0x5'));var interaction=require(_0xfa91('0x6'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xfa91('0x7')](_0xfa91('0x8'),auth['isAuthenticated'](),controller['show']);router['put'](_0xfa91('0x8'),auth[_0xfa91('0x9')](),controller['update']);router[_0xfa91('0xa')](_0xfa91('0x8'),auth[_0xfa91('0x9')](),controller[_0xfa91('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index f46cd1c..2dcd6a4 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 _0xe170=['exports','sequelize'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xe170,0x1b3));var _0x0e17=function(_0x20d06a,_0x16b092){_0x20d06a=_0x20d06a-0x0;var _0x1c48ef=_0xe170[_0x20d06a];return _0x1c48ef;};'use strict';var Sequelize=require(_0x0e17('0x0'));module[_0x0e17('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x626d=['BOOLEAN','sequelize','STRING'];(function(_0x1532d2,_0x274183){var _0x2575bf=function(_0xc07284){while(--_0xc07284){_0x1532d2['push'](_0x1532d2['shift']());}};_0x2575bf(++_0x274183);}(_0x626d,0xa0));var _0xd626=function(_0x5607ea,_0x1ff0e1){_0x5607ea=_0x5607ea-0x0;var _0x2ac925=_0x626d[_0x5607ea];return _0x2ac925;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'name':{'type':Sequelize[_0xd626('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd626('0x1')]},'write':{'type':Sequelize[_0xd626('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index ffe98b8..7ec38f2 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 _0x0694=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','getMembers','User','order','pick','removeMembers','ids','addMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','./chatGroup.socket','register','status','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','sendStatus','stack','name','send','index','ChatGroup','fieldName','type','key','model','map','keys','query','filters'];(function(_0x1b1e94,_0x2b4af3){var _0x2de73c=function(_0x1d5ef4){while(--_0x1d5ef4){_0x1b1e94['push'](_0x1b1e94['shift']());}};_0x2de73c(++_0x2b4af3);}(_0x0694,0xee));var _0x4069=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x0694[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4069('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4069('0x1'));var rp=require('request-promise');var moment=require(_0x4069('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4069('0x3'));var util=require('util');var path=require(_0x4069('0x4'));var sox=require(_0x4069('0x5'));var csv=require(_0x4069('0x6'));var ejs=require(_0x4069('0x7'));var fs=require('fs');var fs_extra=require(_0x4069('0x8'));var _=require('lodash');var squel=require(_0x4069('0x9'));var crypto=require(_0x4069('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4069('0x6'));var querystring=require(_0x4069('0xb'));var Papa=require('papaparse');var Redis=require(_0x4069('0xc'));var authService=require(_0x4069('0xd'));var qs=require(_0x4069('0xe'));var as=require(_0x4069('0xf'));var hardwareService=require(_0x4069('0x10'));var logger=require(_0x4069('0x11'))(_0x4069('0x12'));var utils=require(_0x4069('0x13'));var config=require(_0x4069('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4069('0x15'))['db'];config[_0x4069('0x16')]=_[_0x4069('0x17')](config[_0x4069('0x16')],{'host':_0x4069('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4069('0x16')]));require(_0x4069('0x19'))[_0x4069('0x1a')](socket);function respondWithStatusCode(_0x54bf9f,_0x54c9d9){_0x54c9d9=_0x54c9d9||0xcc;return function(_0x446cca){if(_0x446cca){return _0x54bf9f['sendStatus'](_0x54c9d9);}return _0x54bf9f[_0x4069('0x1b')](_0x54c9d9)['end']();};}function respondWithResult(_0x5d8b41,_0x1d197d){_0x1d197d=_0x1d197d||0xc8;return function(_0x4c5296){if(_0x4c5296){return _0x5d8b41[_0x4069('0x1b')](_0x1d197d)['json'](_0x4c5296);}};}function respondWithFilteredResult(_0x5e8384,_0x5a6824){return function(_0x429500){if(_0x429500){var _0x27ea80=typeof _0x5a6824['offset']===_0x4069('0x1c')&&typeof _0x5a6824[_0x4069('0x1d')]===_0x4069('0x1c');var _0x17a64e=_0x429500[_0x4069('0x1e')];var _0x3efa4d=_0x27ea80?0x0:_0x5a6824[_0x4069('0x1f')];var _0xfb4e70=_0x27ea80?_0x429500[_0x4069('0x1e')]:_0x5a6824['offset']+_0x5a6824['limit'];var _0x3495b8;if(_0xfb4e70>=_0x17a64e){_0xfb4e70=_0x17a64e;_0x3495b8=0xc8;}else{_0x3495b8=0xce;}_0x5e8384['status'](_0x3495b8);return _0x5e8384[_0x4069('0x20')]('Content-Range',_0x3efa4d+'-'+_0xfb4e70+'/'+_0x17a64e)['json'](_0x429500);}return null;};}function patchUpdates(_0x460461){return function(_0x21dc18){try{jsonpatch[_0x4069('0x21')](_0x21dc18,_0x460461,!![]);}catch(_0x55cb37){return BPromise[_0x4069('0x22')](_0x55cb37);}return _0x21dc18[_0x4069('0x23')]();};}function saveUpdates(_0x1b9e2a,_0x3d429c){return function(_0x2fabc7){if(_0x2fabc7){return _0x2fabc7['update'](_0x1b9e2a)[_0x4069('0x24')](function(_0x32ee3c){return _0x32ee3c;});}return null;};}function removeEntity(_0x2ad9db,_0x45df6e){return function(_0x106062){if(_0x106062){return _0x106062[_0x4069('0x25')]()[_0x4069('0x24')](function(){_0x2ad9db['status'](0xcc)[_0x4069('0x26')]();});}};}function handleEntityNotFound(_0x5bee8a,_0x39d390){return function(_0x3b67ea){if(!_0x3b67ea){_0x5bee8a[_0x4069('0x27')](0x194);}return _0x3b67ea;};}function handleError(_0x3a4eed,_0x5a1d5f){_0x5a1d5f=_0x5a1d5f||0x1f4;return function(_0x128f8e){logger['error'](_0x128f8e[_0x4069('0x28')]);if(_0x128f8e[_0x4069('0x29')]){delete _0x128f8e['name'];}_0x3a4eed[_0x4069('0x1b')](_0x5a1d5f)[_0x4069('0x2a')](_0x128f8e);};}exports[_0x4069('0x2b')]=function(_0x2baef2,_0x4b66f3){var _0x8f6c38={},_0x36302c={},_0x276db6={'count':0x0,'rows':[]};var _0x915605=_['map'](db[_0x4069('0x2c')]['rawAttributes'],function(_0x4d465d){return{'name':_0x4d465d[_0x4069('0x2d')],'type':_0x4d465d[_0x4069('0x2e')][_0x4069('0x2f')]};});_0x36302c[_0x4069('0x30')]=_[_0x4069('0x31')](_0x915605,_0x4069('0x29'));_0x36302c['query']=_[_0x4069('0x32')](_0x2baef2[_0x4069('0x33')]);_0x36302c[_0x4069('0x34')]=_[_0x4069('0x35')](_0x36302c[_0x4069('0x30')],_0x36302c[_0x4069('0x33')]);_0x8f6c38[_0x4069('0x36')]=_[_0x4069('0x35')](_0x36302c[_0x4069('0x30')],qs[_0x4069('0x37')](_0x2baef2[_0x4069('0x33')][_0x4069('0x37')]));_0x8f6c38[_0x4069('0x36')]=_0x8f6c38['attributes'][_0x4069('0x38')]?_0x8f6c38['attributes']:_0x36302c[_0x4069('0x30')];if(!_0x2baef2[_0x4069('0x33')][_0x4069('0x39')](_0x4069('0x3a'))){_0x8f6c38['limit']=qs[_0x4069('0x1d')](_0x2baef2['query'][_0x4069('0x1d')]);_0x8f6c38[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x2baef2[_0x4069('0x33')]['offset']);}_0x8f6c38['order']=qs[_0x4069('0x3b')](_0x2baef2[_0x4069('0x33')]['sort']);_0x8f6c38[_0x4069('0x3c')]=qs['filters'](_['pick'](_0x2baef2[_0x4069('0x33')],_0x36302c['filters']),_0x915605);if(_0x2baef2[_0x4069('0x33')]['filter']){_0x8f6c38['where']=_[_0x4069('0x3d')](_0x8f6c38[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0x915605,function(_0x4b74f7){if(_0x4b74f7[_0x4069('0x2e')]!==_0x4069('0x3e')){var _0x173623={};_0x173623[_0x4b74f7[_0x4069('0x29')]]={'$like':'%'+_0x2baef2[_0x4069('0x33')][_0x4069('0x3f')]+'%'};return _0x173623;}})});}_0x8f6c38=_['merge']({},_0x8f6c38,_0x2baef2[_0x4069('0x40')]);var _0x5883d8={'where':_0x8f6c38['where']};return db[_0x4069('0x2c')][_0x4069('0x1e')](_0x5883d8)[_0x4069('0x24')](function(_0x1db309){_0x276db6[_0x4069('0x1e')]=_0x1db309;if(_0x2baef2['query'][_0x4069('0x41')]){_0x8f6c38[_0x4069('0x42')]=[{'all':!![]}];}return db[_0x4069('0x2c')][_0x4069('0x43')](_0x8f6c38);})[_0x4069('0x24')](function(_0x36d6db){_0x276db6[_0x4069('0x44')]=_0x36d6db;return _0x276db6;})[_0x4069('0x24')](respondWithFilteredResult(_0x4b66f3,_0x8f6c38))[_0x4069('0x45')](handleError(_0x4b66f3,null));};exports[_0x4069('0x46')]=function(_0x9fc5de,_0x2db11a){var _0x42f89d={'raw':!![],'where':{'id':_0x9fc5de[_0x4069('0x47')]['id']}},_0x89b9e5={};_0x89b9e5[_0x4069('0x30')]=_[_0x4069('0x32')](db['ChatGroup'][_0x4069('0x48')]);_0x89b9e5[_0x4069('0x33')]=_['keys'](_0x9fc5de[_0x4069('0x33')]);_0x89b9e5['filters']=_[_0x4069('0x35')](_0x89b9e5['model'],_0x89b9e5['query']);_0x42f89d['attributes']=_['intersection'](_0x89b9e5[_0x4069('0x30')],qs[_0x4069('0x37')](_0x9fc5de[_0x4069('0x33')][_0x4069('0x37')]));_0x42f89d[_0x4069('0x36')]=_0x42f89d[_0x4069('0x36')][_0x4069('0x38')]?_0x42f89d['attributes']:_0x89b9e5[_0x4069('0x30')];if(_0x9fc5de[_0x4069('0x33')][_0x4069('0x41')]){_0x42f89d[_0x4069('0x42')]=[{'all':!![]}];}_0x42f89d=_[_0x4069('0x3d')]({},_0x42f89d,_0x9fc5de['options']);return db[_0x4069('0x2c')][_0x4069('0x49')](_0x42f89d)[_0x4069('0x24')](handleEntityNotFound(_0x2db11a,null))[_0x4069('0x24')](respondWithResult(_0x2db11a,null))['catch'](handleError(_0x2db11a,null));};exports['create']=function(_0x5d8e83,_0x3d76d0){return db[_0x4069('0x2c')][_0x4069('0x4a')](_0x5d8e83[_0x4069('0x4b')],{})['then'](respondWithResult(_0x3d76d0,0xc9))['catch'](handleError(_0x3d76d0,null));};exports[_0x4069('0x4c')]=function(_0x56d011,_0x13e513){if(_0x56d011['body']['id']){delete _0x56d011[_0x4069('0x4b')]['id'];}return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x56d011[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x13e513,null))[_0x4069('0x24')](saveUpdates(_0x56d011[_0x4069('0x4b')],null))['then'](respondWithResult(_0x13e513,null))[_0x4069('0x45')](handleError(_0x13e513,null));};exports['destroy']=function(_0x545616,_0x132a5e){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x545616[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x132a5e,null))['then'](removeEntity(_0x132a5e,null))['catch'](handleError(_0x132a5e,null));};exports[_0x4069('0x4d')]=function(_0x1b2d3e,_0x3ec55f){return db[_0x4069('0x2c')][_0x4069('0x4d')]()[_0x4069('0x24')](respondWithResult(_0x3ec55f,null))['catch'](handleError(_0x3ec55f,null));};exports[_0x4069('0x4e')]=function(_0x56755a,_0x809cd3,_0x1a83ab){return db[_0x4069('0x4f')]['count']({'where':{'ChatGroupId':_0x56755a[_0x4069('0x47')]['id'],'ToId':_0x56755a[_0x4069('0x50')]['id'],'read':![]}})[_0x4069('0x24')](function(_0x12c4bb){return{'id':_[_0x4069('0x51')](_0x56755a[_0x4069('0x47')]['id']),'count':_0x12c4bb};})['then'](respondWithResult(_0x809cd3,null))[_0x4069('0x45')](handleError(_0x809cd3,null));};exports[_0x4069('0x52')]=function(_0x18bd57,_0x1f0de9,_0x37534e){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x18bd57[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x1f0de9,null))['then'](function(_0x5e4947){if(_0x5e4947){return _0x5e4947[_0x4069('0x52')](_0x18bd57['body']['ids'],_[_0x4069('0x53')](_0x18bd57[_0x4069('0x4b')],['ids','id'])||{});}})[_0x4069('0x24')](respondWithResult(_0x1f0de9,null))[_0x4069('0x45')](handleError(_0x1f0de9,null));};exports[_0x4069('0x54')]=function(_0x3016ec,_0x3144bc,_0x565e4e){var _0x560428={};var _0x5ef577={};var _0x527f35;var _0x3c0ab1;return db[_0x4069('0x2c')]['findOne']({'where':{'id':_0x3016ec[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x3144bc,null))[_0x4069('0x24')](function(_0x3742e3){if(_0x3742e3){_0x527f35=_0x3742e3;_0x5ef577['model']=_['keys'](db[_0x4069('0x55')][_0x4069('0x48')]);_0x5ef577[_0x4069('0x33')]=_[_0x4069('0x32')](_0x3016ec['query']);_0x5ef577[_0x4069('0x34')]=_['intersection'](_0x5ef577[_0x4069('0x30')],_0x5ef577['query']);_0x560428[_0x4069('0x36')]=_['intersection'](_0x5ef577[_0x4069('0x30')],qs[_0x4069('0x37')](_0x3016ec[_0x4069('0x33')][_0x4069('0x37')]));_0x560428['attributes']=_0x560428['attributes'][_0x4069('0x38')]?_0x560428['attributes']:_0x5ef577[_0x4069('0x30')];_0x560428[_0x4069('0x56')]=qs['sort'](_0x3016ec['query'][_0x4069('0x3b')]);_0x560428['where']=qs[_0x4069('0x34')](_[_0x4069('0x57')](_0x3016ec['query'],_0x5ef577['filters']));if(_0x3016ec[_0x4069('0x33')][_0x4069('0x3f')]){_0x560428['where']=_['merge'](_0x560428[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0x560428['attributes'],function(_0x4ff6f6){var _0xf4007a={};_0xf4007a[_0x4ff6f6]={'$like':'%'+_0x3016ec[_0x4069('0x33')][_0x4069('0x3f')]+'%'};return _0xf4007a;})});}_0x560428=_['merge']({},_0x560428,_0x3016ec[_0x4069('0x40')]);return _0x527f35[_0x4069('0x54')](_0x560428);}})[_0x4069('0x24')](function(_0x30623b){if(_0x30623b){_0x3c0ab1=_0x30623b[_0x4069('0x38')];if(!_0x3016ec[_0x4069('0x33')][_0x4069('0x39')](_0x4069('0x3a'))){_0x560428[_0x4069('0x1d')]=qs[_0x4069('0x1d')](_0x3016ec[_0x4069('0x33')][_0x4069('0x1d')]);_0x560428[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x3016ec[_0x4069('0x33')][_0x4069('0x1f')]);}return _0x527f35[_0x4069('0x54')](_0x560428);}})[_0x4069('0x24')](function(_0x39f7d7){if(_0x39f7d7){return _0x39f7d7?{'count':_0x3c0ab1,'rows':_0x39f7d7}:null;}})[_0x4069('0x24')](respondWithResult(_0x3144bc,null))[_0x4069('0x45')](handleError(_0x3144bc,null));};exports['removeMembers']=function(_0x4a74ba,_0x5d2e3e,_0x2cd726){return db[_0x4069('0x2c')][_0x4069('0x49')]({'where':{'id':_0x4a74ba[_0x4069('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d2e3e,null))[_0x4069('0x24')](function(_0x856e88){if(_0x856e88){return _0x856e88[_0x4069('0x58')](_0x4a74ba[_0x4069('0x33')][_0x4069('0x59')]);}})[_0x4069('0x24')](respondWithStatusCode(_0x5d2e3e,null))[_0x4069('0x45')](handleError(_0x5d2e3e,null));};exports[_0x4069('0x5a')]=function(_0x124c8a,_0xbc51cd,_0x3346d2){if(_0x124c8a[_0x4069('0x4b')]['id']){delete _0x124c8a['body']['id'];}return db['ChatGroup'][_0x4069('0x49')]({'where':{'id':_0x124c8a['params']['id']}})[_0x4069('0x24')](handleEntityNotFound(_0xbc51cd,null))[_0x4069('0x24')](function(_0x4b1eab){if(_0x4b1eab){_0x124c8a[_0x4069('0x4b')]['ChatGroupId']=_0x4b1eab['id'];return db[_0x4069('0x4f')]['create'](_0x124c8a['body']);}})[_0x4069('0x24')](respondWithResult(_0xbc51cd,null))[_0x4069('0x45')](handleError(_0xbc51cd,null));};exports[_0x4069('0x5b')]=function(_0x5536cf,_0x1b4080,_0x248a96){var _0xcfbce7={};var _0x18a81c={};var _0xbadf7a;var _0xdd50bc;return db[_0x4069('0x2c')][_0x4069('0x5c')]({'where':{'id':_0x5536cf[_0x4069('0x47')]['id']}})[_0x4069('0x24')](handleEntityNotFound(_0x1b4080,null))['then'](function(_0x3b3691){if(_0x3b3691){_0xbadf7a=_0x3b3691;_0x18a81c[_0x4069('0x30')]=_[_0x4069('0x32')](db['ChatInternalMessage'][_0x4069('0x48')]);_0x18a81c[_0x4069('0x33')]=_[_0x4069('0x32')](_0x5536cf[_0x4069('0x33')]);_0x18a81c['filters']=_[_0x4069('0x35')](_0x18a81c['model'],_0x18a81c['query']);_0xcfbce7[_0x4069('0x36')]=_['intersection'](_0x18a81c[_0x4069('0x30')],qs[_0x4069('0x37')](_0x5536cf[_0x4069('0x33')][_0x4069('0x37')]));_0xcfbce7[_0x4069('0x36')]=_0xcfbce7[_0x4069('0x36')][_0x4069('0x38')]?_0xcfbce7[_0x4069('0x36')]:_0x18a81c[_0x4069('0x30')];_0xcfbce7[_0x4069('0x56')]=qs['sort'](_0x5536cf['query'][_0x4069('0x3b')]);_0xcfbce7[_0x4069('0x3c')]=qs['filters'](_[_0x4069('0x57')](_0x5536cf[_0x4069('0x33')],_0x18a81c[_0x4069('0x34')]));if(_0x5536cf['query'][_0x4069('0x3f')]){_0xcfbce7[_0x4069('0x3c')]=_[_0x4069('0x3d')](_0xcfbce7[_0x4069('0x3c')],{'$or':_[_0x4069('0x31')](_0xcfbce7[_0x4069('0x36')],function(_0x2909c2){var _0x3c44a8={};_0x3c44a8[_0x2909c2]={'$like':'%'+_0x5536cf[_0x4069('0x33')]['filter']+'%'};return _0x3c44a8;})});}if(_0x5536cf[_0x4069('0x33')][_0x4069('0x5d')]){var _0x5fee22=_0x5536cf[_0x4069('0x33')][_0x4069('0x5d')][_0x4069('0x5e')](',');var _0x1fe612={};_0x1fe612[_0x5fee22[0x0]]={'$gte':moment(_0x5fee22[0x1])[_0x4069('0x5f')](_0x4069('0x60'))};_0xcfbce7[_0x4069('0x3c')]=_[_0x4069('0x3d')](_0xcfbce7[_0x4069('0x3c')],_0x1fe612);}_0xcfbce7=_[_0x4069('0x3d')]({},_0xcfbce7,_0x5536cf[_0x4069('0x40')]);return _0xbadf7a[_0x4069('0x5b')](_0xcfbce7);}})[_0x4069('0x24')](function(_0xfe06d0){if(_0xfe06d0){_0xdd50bc=_0xfe06d0['length'];if(!_0x5536cf[_0x4069('0x33')]['hasOwnProperty']('nolimit')){_0xcfbce7[_0x4069('0x1d')]=qs[_0x4069('0x1d')](_0x5536cf[_0x4069('0x33')]['limit']);_0xcfbce7[_0x4069('0x1f')]=qs[_0x4069('0x1f')](_0x5536cf['query'][_0x4069('0x1f')]);}return _0xbadf7a[_0x4069('0x5b')](_0xcfbce7);}})[_0x4069('0x24')](function(_0x190fed){if(_0x190fed){return _0x190fed?{'count':_0xdd50bc,'rows':_0x190fed}:null;}})[_0x4069('0x24')](respondWithResult(_0x1b4080,null))[_0x4069('0x45')](handleError(_0x1b4080,null));}; \ No newline at end of file +var _0x3c3b=['hasOwnProperty','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','order','pick','options'];(function(_0x3c856b,_0x18a43f){var _0x3b5e99=function(_0x48b5f4){while(--_0x48b5f4){_0x3c856b['push'](_0x3c856b['shift']());}};_0x3b5e99(++_0x18a43f);}(_0x3c3b,0x12a));var _0xb3c3=function(_0x46cb3b,_0x5728f0){_0x46cb3b=_0x46cb3b-0x0;var _0x377d8e=_0x3c3b[_0x46cb3b];return _0x377d8e;};'use strict';var emlformat=require(_0xb3c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3c3('0x1'));var jsonpatch=require(_0xb3c3('0x2'));var rp=require(_0xb3c3('0x3'));var moment=require(_0xb3c3('0x4'));var BPromise=require(_0xb3c3('0x5'));var Mustache=require(_0xb3c3('0x6'));var util=require(_0xb3c3('0x7'));var path=require(_0xb3c3('0x8'));var sox=require(_0xb3c3('0x9'));var csv=require(_0xb3c3('0xa'));var ejs=require(_0xb3c3('0xb'));var fs=require('fs');var fs_extra=require(_0xb3c3('0xc'));var _=require(_0xb3c3('0xd'));var squel=require(_0xb3c3('0xe'));var crypto=require(_0xb3c3('0xf'));var jsforce=require(_0xb3c3('0x10'));var deskjs=require(_0xb3c3('0x11'));var toCsv=require(_0xb3c3('0xa'));var querystring=require(_0xb3c3('0x12'));var Papa=require(_0xb3c3('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb3c3('0x14'));var as=require(_0xb3c3('0x15'));var hardwareService=require(_0xb3c3('0x16'));var logger=require(_0xb3c3('0x17'))(_0xb3c3('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb3c3('0x19')]=_[_0xb3c3('0x1a')](config[_0xb3c3('0x19')],{'host':_0xb3c3('0x1b'),'port':0x18eb});var socket=require(_0xb3c3('0x1c'))(new Redis(config[_0xb3c3('0x19')]));require(_0xb3c3('0x1d'))[_0xb3c3('0x1e')](socket);function respondWithStatusCode(_0x5e0552,_0x12bac4){_0x12bac4=_0x12bac4||0xcc;return function(_0x1471ca){if(_0x1471ca){return _0x5e0552[_0xb3c3('0x1f')](_0x12bac4);}return _0x5e0552[_0xb3c3('0x20')](_0x12bac4)[_0xb3c3('0x21')]();};}function respondWithResult(_0x2ab9fd,_0x1acca1){_0x1acca1=_0x1acca1||0xc8;return function(_0x5bc9df){if(_0x5bc9df){return _0x2ab9fd[_0xb3c3('0x20')](_0x1acca1)[_0xb3c3('0x22')](_0x5bc9df);}};}function respondWithFilteredResult(_0x4e03a5,_0x5acc3d){return function(_0x135cab){if(_0x135cab){var _0x303553=typeof _0x5acc3d['offset']==='undefined'&&typeof _0x5acc3d[_0xb3c3('0x23')]==='undefined';var _0x3760bf=_0x135cab[_0xb3c3('0x24')];var _0x53b6f9=_0x303553?0x0:_0x5acc3d[_0xb3c3('0x25')];var _0x253e54=_0x303553?_0x135cab[_0xb3c3('0x24')]:_0x5acc3d['offset']+_0x5acc3d[_0xb3c3('0x23')];var _0x141013;if(_0x253e54>=_0x3760bf){_0x253e54=_0x3760bf;_0x141013=0xc8;}else{_0x141013=0xce;}_0x4e03a5[_0xb3c3('0x20')](_0x141013);return _0x4e03a5[_0xb3c3('0x26')](_0xb3c3('0x27'),_0x53b6f9+'-'+_0x253e54+'/'+_0x3760bf)['json'](_0x135cab);}return null;};}function patchUpdates(_0x1cb3d5){return function(_0x2e914e){try{jsonpatch[_0xb3c3('0x28')](_0x2e914e,_0x1cb3d5,!![]);}catch(_0x4fddd8){return BPromise[_0xb3c3('0x29')](_0x4fddd8);}return _0x2e914e[_0xb3c3('0x2a')]();};}function saveUpdates(_0x6dafed,_0x2b9b86){return function(_0x5710dd){if(_0x5710dd){return _0x5710dd[_0xb3c3('0x2b')](_0x6dafed)[_0xb3c3('0x2c')](function(_0x29e016){return _0x29e016;});}return null;};}function removeEntity(_0x50458e,_0x2edc84){return function(_0x51b450){if(_0x51b450){return _0x51b450[_0xb3c3('0x2d')]()[_0xb3c3('0x2c')](function(){_0x50458e[_0xb3c3('0x20')](0xcc)[_0xb3c3('0x21')]();});}};}function handleEntityNotFound(_0xb8be09,_0x2677da){return function(_0x5a88e3){if(!_0x5a88e3){_0xb8be09[_0xb3c3('0x1f')](0x194);}return _0x5a88e3;};}function handleError(_0x24a9c6,_0x3fad1e){_0x3fad1e=_0x3fad1e||0x1f4;return function(_0x11a01b){logger['error'](_0x11a01b[_0xb3c3('0x2e')]);if(_0x11a01b[_0xb3c3('0x2f')]){delete _0x11a01b[_0xb3c3('0x2f')];}_0x24a9c6[_0xb3c3('0x20')](_0x3fad1e)[_0xb3c3('0x30')](_0x11a01b);};}exports[_0xb3c3('0x31')]=function(_0x5d3bb0,_0x1820d9){var _0x3f32fd={},_0x164197={},_0x3881e3={'count':0x0,'rows':[]};var _0x45a5e5=_[_0xb3c3('0x32')](db[_0xb3c3('0x33')][_0xb3c3('0x34')],function(_0x22af24){return{'name':_0x22af24[_0xb3c3('0x35')],'type':_0x22af24[_0xb3c3('0x36')][_0xb3c3('0x37')]};});_0x164197['model']=_[_0xb3c3('0x32')](_0x45a5e5,_0xb3c3('0x2f'));_0x164197[_0xb3c3('0x38')]=_['keys'](_0x5d3bb0[_0xb3c3('0x38')]);_0x164197['filters']=_[_0xb3c3('0x39')](_0x164197[_0xb3c3('0x3a')],_0x164197[_0xb3c3('0x38')]);_0x3f32fd[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0x164197['model'],qs[_0xb3c3('0x3c')](_0x5d3bb0['query'][_0xb3c3('0x3c')]));_0x3f32fd['attributes']=_0x3f32fd[_0xb3c3('0x3b')][_0xb3c3('0x3d')]?_0x3f32fd[_0xb3c3('0x3b')]:_0x164197[_0xb3c3('0x3a')];if(!_0x5d3bb0[_0xb3c3('0x38')]['hasOwnProperty'](_0xb3c3('0x3e'))){_0x3f32fd[_0xb3c3('0x23')]=qs[_0xb3c3('0x23')](_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x23')]);_0x3f32fd['offset']=qs[_0xb3c3('0x25')](_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x25')]);}_0x3f32fd['order']=qs[_0xb3c3('0x3f')](_0x5d3bb0[_0xb3c3('0x38')]['sort']);_0x3f32fd[_0xb3c3('0x40')]=qs[_0xb3c3('0x41')](_['pick'](_0x5d3bb0[_0xb3c3('0x38')],_0x164197[_0xb3c3('0x41')]),_0x45a5e5);if(_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x3f32fd[_0xb3c3('0x40')]=_['merge'](_0x3f32fd['where'],{'$or':_['map'](_0x45a5e5,function(_0x39c3d3){if(_0x39c3d3[_0xb3c3('0x36')]!==_0xb3c3('0x43')){var _0x34703f={};_0x34703f[_0x39c3d3[_0xb3c3('0x2f')]]={'$like':'%'+_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x34703f;}})});}_0x3f32fd=_[_0xb3c3('0x44')]({},_0x3f32fd,_0x5d3bb0['options']);var _0x37d18f={'where':_0x3f32fd[_0xb3c3('0x40')]};return db['ChatGroup'][_0xb3c3('0x24')](_0x37d18f)['then'](function(_0x589f55){_0x3881e3['count']=_0x589f55;if(_0x5d3bb0[_0xb3c3('0x38')][_0xb3c3('0x45')]){_0x3f32fd[_0xb3c3('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0xb3c3('0x47')](_0x3f32fd);})[_0xb3c3('0x2c')](function(_0x455ab2){_0x3881e3[_0xb3c3('0x48')]=_0x455ab2;return _0x3881e3;})['then'](respondWithFilteredResult(_0x1820d9,_0x3f32fd))[_0xb3c3('0x49')](handleError(_0x1820d9,null));};exports['show']=function(_0x5ed594,_0x21f2cb){var _0x28de02={'raw':!![],'where':{'id':_0x5ed594['params']['id']}},_0x93cf67={};_0x93cf67['model']=_[_0xb3c3('0x4a')](db[_0xb3c3('0x33')]['rawAttributes']);_0x93cf67[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x5ed594[_0xb3c3('0x38')]);_0x93cf67['filters']=_['intersection'](_0x93cf67['model'],_0x93cf67[_0xb3c3('0x38')]);_0x28de02[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0x93cf67['model'],qs[_0xb3c3('0x3c')](_0x5ed594[_0xb3c3('0x38')][_0xb3c3('0x3c')]));_0x28de02[_0xb3c3('0x3b')]=_0x28de02[_0xb3c3('0x3b')]['length']?_0x28de02['attributes']:_0x93cf67['model'];if(_0x5ed594[_0xb3c3('0x38')]['includeAll']){_0x28de02[_0xb3c3('0x46')]=[{'all':!![]}];}_0x28de02=_[_0xb3c3('0x44')]({},_0x28de02,_0x5ed594['options']);return db['ChatGroup'][_0xb3c3('0x4b')](_0x28de02)[_0xb3c3('0x2c')](handleEntityNotFound(_0x21f2cb,null))[_0xb3c3('0x2c')](respondWithResult(_0x21f2cb,null))[_0xb3c3('0x49')](handleError(_0x21f2cb,null));};exports[_0xb3c3('0x4c')]=function(_0xbaad85,_0x36d7ca){return db[_0xb3c3('0x33')][_0xb3c3('0x4c')](_0xbaad85['body'],{})['then'](respondWithResult(_0x36d7ca,0xc9))[_0xb3c3('0x49')](handleError(_0x36d7ca,null));};exports[_0xb3c3('0x2b')]=function(_0xd489c1,_0x5715b5){if(_0xd489c1[_0xb3c3('0x4d')]['id']){delete _0xd489c1[_0xb3c3('0x4d')]['id'];}return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0xd489c1[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5715b5,null))['then'](saveUpdates(_0xd489c1['body'],null))[_0xb3c3('0x2c')](respondWithResult(_0x5715b5,null))[_0xb3c3('0x49')](handleError(_0x5715b5,null));};exports[_0xb3c3('0x2d')]=function(_0x1144e6,_0x3325c5){return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0x1144e6[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3325c5,null))[_0xb3c3('0x2c')](removeEntity(_0x3325c5,null))['catch'](handleError(_0x3325c5,null));};exports[_0xb3c3('0x4f')]=function(_0x1a395e,_0x1acbab){return db[_0xb3c3('0x33')][_0xb3c3('0x4f')]()[_0xb3c3('0x2c')](respondWithResult(_0x1acbab,null))['catch'](handleError(_0x1acbab,null));};exports[_0xb3c3('0x50')]=function(_0x42ef77,_0x56729f,_0x3dda19){return db['ChatInternalMessage'][_0xb3c3('0x24')]({'where':{'ChatGroupId':_0x42ef77[_0xb3c3('0x4e')]['id'],'ToId':_0x42ef77[_0xb3c3('0x51')]['id'],'read':![]}})['then'](function(_0x39fa94){return{'id':_[_0xb3c3('0x52')](_0x42ef77[_0xb3c3('0x4e')]['id']),'count':_0x39fa94};})[_0xb3c3('0x2c')](respondWithResult(_0x56729f,null))['catch'](handleError(_0x56729f,null));};exports['addMembers']=function(_0x1f147b,_0x29f977,_0x1df38b){return db[_0xb3c3('0x33')][_0xb3c3('0x4b')]({'where':{'id':_0x1f147b[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29f977,null))[_0xb3c3('0x2c')](function(_0x2beb60){if(_0x2beb60){return _0x2beb60[_0xb3c3('0x53')](_0x1f147b[_0xb3c3('0x4d')][_0xb3c3('0x54')],_[_0xb3c3('0x55')](_0x1f147b[_0xb3c3('0x4d')],[_0xb3c3('0x54'),'id'])||{});}})[_0xb3c3('0x2c')](respondWithResult(_0x29f977,null))[_0xb3c3('0x49')](handleError(_0x29f977,null));};exports[_0xb3c3('0x56')]=function(_0x5440d4,_0x401bdb,_0x256a08){var _0x390c53={};var _0xd17261={};var _0x18fe9b;var _0x44395d;return db[_0xb3c3('0x33')]['findOne']({'where':{'id':_0x5440d4['params']['id']}})['then'](handleEntityNotFound(_0x401bdb,null))[_0xb3c3('0x2c')](function(_0x5c21de){if(_0x5c21de){_0x18fe9b=_0x5c21de;_0xd17261[_0xb3c3('0x3a')]=_[_0xb3c3('0x4a')](db['User']['rawAttributes']);_0xd17261[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x5440d4['query']);_0xd17261[_0xb3c3('0x41')]=_['intersection'](_0xd17261[_0xb3c3('0x3a')],_0xd17261[_0xb3c3('0x38')]);_0x390c53['attributes']=_[_0xb3c3('0x39')](_0xd17261['model'],qs[_0xb3c3('0x3c')](_0x5440d4['query'][_0xb3c3('0x3c')]));_0x390c53['attributes']=_0x390c53[_0xb3c3('0x3b')]['length']?_0x390c53[_0xb3c3('0x3b')]:_0xd17261['model'];_0x390c53[_0xb3c3('0x57')]=qs[_0xb3c3('0x3f')](_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x3f')]);_0x390c53[_0xb3c3('0x40')]=qs['filters'](_[_0xb3c3('0x58')](_0x5440d4[_0xb3c3('0x38')],_0xd17261['filters']));if(_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x390c53[_0xb3c3('0x40')]=_[_0xb3c3('0x44')](_0x390c53['where'],{'$or':_[_0xb3c3('0x32')](_0x390c53[_0xb3c3('0x3b')],function(_0x521ef2){var _0x1b5a2c={};_0x1b5a2c[_0x521ef2]={'$like':'%'+_0x5440d4[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x1b5a2c;})});}_0x390c53=_[_0xb3c3('0x44')]({},_0x390c53,_0x5440d4[_0xb3c3('0x59')]);return _0x18fe9b[_0xb3c3('0x56')](_0x390c53);}})[_0xb3c3('0x2c')](function(_0x2964cc){if(_0x2964cc){_0x44395d=_0x2964cc[_0xb3c3('0x3d')];if(!_0x5440d4['query'][_0xb3c3('0x5a')]('nolimit')){_0x390c53['limit']=qs[_0xb3c3('0x23')](_0x5440d4['query'][_0xb3c3('0x23')]);_0x390c53[_0xb3c3('0x25')]=qs['offset'](_0x5440d4['query'][_0xb3c3('0x25')]);}return _0x18fe9b[_0xb3c3('0x56')](_0x390c53);}})[_0xb3c3('0x2c')](function(_0x23c0c1){if(_0x23c0c1){return _0x23c0c1?{'count':_0x44395d,'rows':_0x23c0c1}:null;}})['then'](respondWithResult(_0x401bdb,null))[_0xb3c3('0x49')](handleError(_0x401bdb,null));};exports['removeMembers']=function(_0x3f3c99,_0x43d54a,_0x3058f0){return db[_0xb3c3('0x33')][_0xb3c3('0x4b')]({'where':{'id':_0x3f3c99[_0xb3c3('0x4e')]['id']}})[_0xb3c3('0x2c')](handleEntityNotFound(_0x43d54a,null))[_0xb3c3('0x2c')](function(_0x49fe28){if(_0x49fe28){return _0x49fe28[_0xb3c3('0x5b')](_0x3f3c99[_0xb3c3('0x38')]['ids']);}})[_0xb3c3('0x2c')](respondWithStatusCode(_0x43d54a,null))[_0xb3c3('0x49')](handleError(_0x43d54a,null));};exports['addMessage']=function(_0x3fecf6,_0x69545c,_0x5db664){if(_0x3fecf6[_0xb3c3('0x4d')]['id']){delete _0x3fecf6[_0xb3c3('0x4d')]['id'];}return db['ChatGroup'][_0xb3c3('0x4b')]({'where':{'id':_0x3fecf6[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x69545c,null))[_0xb3c3('0x2c')](function(_0x26994c){if(_0x26994c){_0x3fecf6[_0xb3c3('0x4d')][_0xb3c3('0x5c')]=_0x26994c['id'];return db[_0xb3c3('0x5d')][_0xb3c3('0x4c')](_0x3fecf6[_0xb3c3('0x4d')]);}})[_0xb3c3('0x2c')](respondWithResult(_0x69545c,null))[_0xb3c3('0x49')](handleError(_0x69545c,null));};exports[_0xb3c3('0x5e')]=function(_0x3ce1ab,_0x2159fe,_0x38cf0c){var _0x1165be={};var _0xcea62b={};var _0x26aa0d;var _0x191707;return db[_0xb3c3('0x33')]['findOne']({'where':{'id':_0x3ce1ab[_0xb3c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2159fe,null))[_0xb3c3('0x2c')](function(_0x4c7566){if(_0x4c7566){_0x26aa0d=_0x4c7566;_0xcea62b[_0xb3c3('0x3a')]=_[_0xb3c3('0x4a')](db[_0xb3c3('0x5d')][_0xb3c3('0x34')]);_0xcea62b[_0xb3c3('0x38')]=_[_0xb3c3('0x4a')](_0x3ce1ab['query']);_0xcea62b[_0xb3c3('0x41')]=_[_0xb3c3('0x39')](_0xcea62b[_0xb3c3('0x3a')],_0xcea62b[_0xb3c3('0x38')]);_0x1165be[_0xb3c3('0x3b')]=_[_0xb3c3('0x39')](_0xcea62b[_0xb3c3('0x3a')],qs[_0xb3c3('0x3c')](_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x3c')]));_0x1165be[_0xb3c3('0x3b')]=_0x1165be[_0xb3c3('0x3b')][_0xb3c3('0x3d')]?_0x1165be['attributes']:_0xcea62b[_0xb3c3('0x3a')];_0x1165be[_0xb3c3('0x57')]=qs[_0xb3c3('0x3f')](_0x3ce1ab[_0xb3c3('0x38')]['sort']);_0x1165be[_0xb3c3('0x40')]=qs['filters'](_['pick'](_0x3ce1ab['query'],_0xcea62b['filters']));if(_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x42')]){_0x1165be[_0xb3c3('0x40')]=_[_0xb3c3('0x44')](_0x1165be[_0xb3c3('0x40')],{'$or':_['map'](_0x1165be[_0xb3c3('0x3b')],function(_0x1b3888){var _0x421f9a={};_0x421f9a[_0x1b3888]={'$like':'%'+_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x42')]+'%'};return _0x421f9a;})});}if(_0x3ce1ab['query'][_0xb3c3('0x5f')]){var _0x1beabd=_0x3ce1ab['query']['$gte']['split'](',');var _0x33f223={};_0x33f223[_0x1beabd[0x0]]={'$gte':moment(_0x1beabd[0x1])['format'](_0xb3c3('0x60'))};_0x1165be['where']=_[_0xb3c3('0x44')](_0x1165be[_0xb3c3('0x40')],_0x33f223);}_0x1165be=_[_0xb3c3('0x44')]({},_0x1165be,_0x3ce1ab[_0xb3c3('0x59')]);return _0x26aa0d[_0xb3c3('0x5e')](_0x1165be);}})[_0xb3c3('0x2c')](function(_0x3bf978){if(_0x3bf978){_0x191707=_0x3bf978[_0xb3c3('0x3d')];if(!_0x3ce1ab[_0xb3c3('0x38')][_0xb3c3('0x5a')](_0xb3c3('0x3e'))){_0x1165be[_0xb3c3('0x23')]=qs['limit'](_0x3ce1ab['query'][_0xb3c3('0x23')]);_0x1165be['offset']=qs[_0xb3c3('0x25')](_0x3ce1ab['query']['offset']);}return _0x26aa0d[_0xb3c3('0x5e')](_0x1165be);}})[_0xb3c3('0x2c')](function(_0x35b141){if(_0x35b141){return _0x35b141?{'count':_0x191707,'rows':_0x35b141}:null;}})[_0xb3c3('0x2c')](respondWithResult(_0x2159fe,null))[_0xb3c3('0x49')](handleError(_0x2159fe,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 01fb05e..b4dc368 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 _0x4667=['../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x84012c,_0x4dbeab){var _0x2ee5cc=function(_0x4599ae){while(--_0x4599ae){_0x84012c['push'](_0x84012c['shift']());}};_0x2ee5cc(++_0x4dbeab);}(_0x4667,0x10f));var _0x7466=function(_0x449746,_0x16fda7){_0x449746=_0x449746-0x0;var _0x5be1de=_0x4667[_0x449746];return _0x5be1de;};'use strict';var EventEmitter=require(_0x7466('0x0'));var ChatGroup=require(_0x7466('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7466('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7466('0x3')};function emitEvent(_0x20c421){return function(_0x2206b3,_0x5e4ad4,_0x4155aa){ChatGroupEvents[_0x7466('0x4')](_0x20c421+':'+_0x2206b3['id'],_0x2206b3);ChatGroupEvents[_0x7466('0x4')](_0x20c421,_0x2206b3);_0x4155aa(null);};}for(var e in events){if(events[_0x7466('0x5')](e)){var event=events[e];ChatGroup[_0x7466('0x6')](e,emitEvent(event));}}module[_0x7466('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x1103=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup'];(function(_0x17b161,_0x11c665){var _0x2ffcc2=function(_0x179ebf){while(--_0x179ebf){_0x17b161['push'](_0x17b161['shift']());}};_0x2ffcc2(++_0x11c665);}(_0x1103,0x97));var _0x3110=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1103[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x3110('0x0'))['db'][_0x3110('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3110('0x2')](0x0);var events={'afterCreate':_0x3110('0x3'),'afterUpdate':_0x3110('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d3d87){return function(_0x74e52,_0x59dc44,_0x5eb55c){ChatGroupEvents[_0x3110('0x5')](_0x1d3d87+':'+_0x74e52['id'],_0x74e52);ChatGroupEvents[_0x3110('0x5')](_0x1d3d87,_0x74e52);_0x5eb55c(null);};}for(var e in events){if(events[_0x3110('0x6')](e)){var event=events[e];ChatGroup[_0x3110('0x7')](e,emitEvent(event));}}module[_0x3110('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 5a40d01..c72d1f1 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 _0xd278=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','chat_groups','util','../../config/logger'];(function(_0x573d7f,_0x594dfc){var _0xe64264=function(_0x9829f6){while(--_0x9829f6){_0x573d7f['push'](_0x573d7f['shift']());}};_0xe64264(++_0x594dfc);}(_0xd278,0x15c));var _0x8d27=function(_0x21ca99,_0x5be92f){_0x21ca99=_0x21ca99-0x0;var _0xe6360=_0xd278[_0x21ca99];return _0xe6360;};'use strict';var _=require('lodash');var util=require(_0x8d27('0x0'));var logger=require(_0x8d27('0x1'))(_0x8d27('0x2'));var moment=require(_0x8d27('0x3'));var BPromise=require(_0x8d27('0x4'));var rp=require(_0x8d27('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d27('0x6'));var config=require(_0x8d27('0x7'));var attributes=require(_0x8d27('0x8'));module['exports']=function(_0x3d300f,_0x41670a){return _0x3d300f['define']('ChatGroup',attributes,{'tableName':_0x8d27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe731=['path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','util','bluebird','request-promise'];(function(_0x50450d,_0x314c15){var _0x1c391b=function(_0x3d5c86){while(--_0x3d5c86){_0x50450d['push'](_0x50450d['shift']());}};_0x1c391b(++_0x314c15);}(_0xe731,0x147));var _0x1e73=function(_0x2dd6b7,_0x4ccce3){_0x2dd6b7=_0x2dd6b7-0x0;var _0x9c28c1=_0xe731[_0x2dd6b7];return _0x9c28c1;};'use strict';var _=require('lodash');var util=require(_0x1e73('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1e73('0x1'));var rp=require(_0x1e73('0x2'));var fs=require('fs');var path=require(_0x1e73('0x3'));var rimraf=require(_0x1e73('0x4'));var config=require(_0x1e73('0x5'));var attributes=require(_0x1e73('0x6'));module[_0x1e73('0x7')]=function(_0x3475fa,_0x2621b4){return _0x3475fa['define'](_0x1e73('0x8'),attributes,{'tableName':_0x1e73('0x9'),'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 9afc859..f6ccd9f 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 _0xa92e=['jayson/promise','client','http','redis','defaults','localhost','register','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x489c69,_0x3c196a){var _0x57d2d5=function(_0x1eb15c){while(--_0x1eb15c){_0x489c69['push'](_0x489c69['shift']());}};_0x57d2d5(++_0x3c196a);}(_0xa92e,0x1e5));var _0xea92=function(_0x20dddf,_0x45237a){_0x20dddf=_0x20dddf-0x0;var _0x30219a=_0xa92e[_0x20dddf];return _0x30219a;};'use strict';var _=require(_0xea92('0x0'));var util=require('util');var moment=require(_0xea92('0x1'));var BPromise=require(_0xea92('0x2'));var rs=require(_0xea92('0x3'));var fs=require('fs');var Redis=require(_0xea92('0x4'));var db=require(_0xea92('0x5'))['db'];var utils=require(_0xea92('0x6'));var logger=require(_0xea92('0x7'))(_0xea92('0x8'));var config=require('../../config/environment');var jayson=require(_0xea92('0x9'));var client=jayson[_0xea92('0xa')][_0xea92('0xb')]({'port':0x232a});config[_0xea92('0xc')]=_[_0xea92('0xd')](config[_0xea92('0xc')],{'host':_0xea92('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea92('0xc')]));require('./chatGroup.socket')[_0xea92('0xf')](socket);function respondWithRpcPromise(_0x5aae95,_0x281a0d,_0x2f1f04){return new BPromise(function(_0x5e48f9,_0x162e5a){return client['request'](_0x5aae95,_0x2f1f04)['then'](function(_0xe01d85){logger[_0xea92('0x10')]('ChatGroup,\x20%s,\x20%s',_0x281a0d,_0xea92('0x11'));logger[_0xea92('0x12')](_0xea92('0x13'),_0x281a0d,_0xea92('0x11'),JSON[_0xea92('0x14')](_0xe01d85));if(_0xe01d85[_0xea92('0x15')]){if(_0xe01d85[_0xea92('0x15')]['code']===0x1f4){logger[_0xea92('0x15')]('ChatGroup,\x20%s,\x20%s',_0x281a0d,_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);return _0x162e5a(_0xe01d85[_0xea92('0x15')]['message']);}logger[_0xea92('0x15')](_0xea92('0x17'),_0x281a0d,_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);return _0x5e48f9(_0xe01d85[_0xea92('0x15')][_0xea92('0x16')]);}else{logger['info'](_0xea92('0x17'),_0x281a0d,'request\x20sent');_0x5e48f9(_0xe01d85[_0xea92('0x18')][_0xea92('0x16')]);}})[_0xea92('0x19')](function(_0x207122){logger[_0xea92('0x15')](_0xea92('0x17'),_0x281a0d,_0x207122);_0x162e5a(_0x207122);});});} \ No newline at end of file +var _0x0f89=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','stringify','error','ChatGroup,\x20%s,\x20%s'];(function(_0xcb21b8,_0x57bc5c){var _0xf3cbc4=function(_0x15fd90){while(--_0x15fd90){_0xcb21b8['push'](_0xcb21b8['shift']());}};_0xf3cbc4(++_0x57bc5c);}(_0x0f89,0x111));var _0x90f8=function(_0x304abd,_0x1b7df8){_0x304abd=_0x304abd-0x0;var _0x1b061d=_0x0f89[_0x304abd];return _0x1b061d;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require(_0x90f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require('../../config/logger')(_0x90f8('0x7'));var config=require(_0x90f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});config[_0x90f8('0xb')]=_[_0x90f8('0xc')](config[_0x90f8('0xb')],{'host':_0x90f8('0xd'),'port':0x18eb});var socket=require(_0x90f8('0xe'))(new Redis(config[_0x90f8('0xb')]));require(_0x90f8('0xf'))[_0x90f8('0x10')](socket);function respondWithRpcPromise(_0x46b3ad,_0x55ed12,_0x4f8f90){return new BPromise(function(_0x99ae07,_0x2e2134){return client[_0x90f8('0x11')](_0x46b3ad,_0x4f8f90)[_0x90f8('0x12')](function(_0x3cdde3){logger[_0x90f8('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x55ed12,_0x90f8('0x14'),JSON[_0x90f8('0x15')](_0x3cdde3));if(_0x3cdde3['error']){if(_0x3cdde3[_0x90f8('0x16')]['code']===0x1f4){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);return _0x2e2134(_0x3cdde3['error'][_0x90f8('0x18')]);}logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x3cdde3[_0x90f8('0x16')]['message']);return _0x99ae07(_0x3cdde3[_0x90f8('0x16')][_0x90f8('0x18')]);}else{logger['info'](_0x90f8('0x17'),_0x55ed12,_0x90f8('0x14'));_0x99ae07(_0x3cdde3[_0x90f8('0x19')][_0x90f8('0x18')]);}})[_0x90f8('0x1a')](function(_0x38a493){logger[_0x90f8('0x16')](_0x90f8('0x17'),_0x55ed12,_0x38a493);_0x2e2134(_0x38a493);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index d0c7765..69c71da 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 _0x224b=['emit','removeListener','register','chatGroup:','update'];(function(_0x8a2e9d,_0xa7a01c){var _0xf64cdd=function(_0x491bd2){while(--_0x491bd2){_0x8a2e9d['push'](_0x8a2e9d['shift']());}};_0xf64cdd(++_0xa7a01c);}(_0x224b,0xa9));var _0xb224=function(_0x7a6c0e,_0x30242a){_0x7a6c0e=_0x7a6c0e-0x0;var _0x26eb5b=_0x224b[_0x7a6c0e];return _0x26eb5b;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0xb224('0x0')];function createListener(_0x4431d7,_0x1b67b2){return function(_0x540496){_0x1b67b2[_0xb224('0x1')](_0x4431d7,_0x540496);};}function removeListener(_0x3a71e5,_0xd3a68b){return function(){ChatGroupEvents[_0xb224('0x2')](_0x3a71e5,_0xd3a68b);};}exports[_0xb224('0x3')]=function(_0x31c7a1){for(var _0x551991=0x0,_0x32e3f7=events['length'];_0x551991<_0x32e3f7;_0x551991++){var _0x2e9444=events[_0x551991];var _0x1729a2=createListener(_0xb224('0x4')+_0x2e9444,_0x31c7a1);ChatGroupEvents['on'](_0x2e9444,_0x1729a2);}}; \ No newline at end of file +var _0x79fa=['save','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x102f24,_0x3e4e3f){var _0x223adb=function(_0x1b63b2){while(--_0x1b63b2){_0x102f24['push'](_0x102f24['shift']());}};_0x223adb(++_0x3e4e3f);}(_0x79fa,0x185));var _0xa79f=function(_0x108189,_0xeeabab){_0x108189=_0x108189-0x0;var _0x2e723c=_0x79fa[_0x108189];return _0x2e723c;};'use strict';var ChatGroupEvents=require(_0xa79f('0x0'));var events=[_0xa79f('0x1'),'remove','update'];function createListener(_0x1ce735,_0x299c67){return function(_0x5cb89c){_0x299c67['emit'](_0x1ce735,_0x5cb89c);};}function removeListener(_0x3e0071,_0x30fb40){return function(){ChatGroupEvents[_0xa79f('0x2')](_0x3e0071,_0x30fb40);};}exports[_0xa79f('0x3')]=function(_0x5efe58){for(var _0x3e3f4a=0x0,_0x39b9cd=events[_0xa79f('0x4')];_0x3e3f4a<_0x39b9cd;_0x3e3f4a++){var _0x5c2f8c=events[_0x3e3f4a];var _0x3919c3=createListener(_0xa79f('0x5')+_0x5c2f8c,_0x5efe58);ChatGroupEvents['on'](_0x5c2f8c,_0x3919c3);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d76aaad..9fbfc91 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 _0x35ee=['./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members','addMembers','put','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x6fa0ae,_0x1d8109){var _0x38884e=function(_0x30f74b){while(--_0x30f74b){_0x6fa0ae['push'](_0x6fa0ae['shift']());}};_0x38884e(++_0x1d8109);}(_0x35ee,0xd9));var _0xe35e=function(_0x43a3df,_0x5506d3){_0x43a3df=_0x43a3df-0x0;var _0x2c6683=_0x35ee[_0x43a3df];return _0x2c6683;};'use strict';var multer=require(_0xe35e('0x0'));var util=require(_0xe35e('0x1'));var path=require(_0xe35e('0x2'));var timeout=require(_0xe35e('0x3'));var express=require('express');var router=express[_0xe35e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe35e('0x5'));var interaction=require(_0xe35e('0x6'));var config=require('../../config/environment');var controller=require(_0xe35e('0x7'));router[_0xe35e('0x8')]('/',auth[_0xe35e('0x9')](),controller[_0xe35e('0xa')]);router[_0xe35e('0x8')](_0xe35e('0xb'),auth[_0xe35e('0x9')](),controller['describe']);router[_0xe35e('0x8')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller[_0xe35e('0xd')]);router[_0xe35e('0x8')](_0xe35e('0xe'),auth[_0xe35e('0x9')](),controller[_0xe35e('0xf')]);router[_0xe35e('0x8')]('/:id/members',auth[_0xe35e('0x9')](),controller[_0xe35e('0x10')]);router['get'](_0xe35e('0x11'),auth[_0xe35e('0x9')](),controller[_0xe35e('0x12')]);router[_0xe35e('0x13')]('/',auth[_0xe35e('0x9')](),controller[_0xe35e('0x14')]);router['post'](_0xe35e('0x15'),auth['isAuthenticated'](),controller[_0xe35e('0x16')]);router[_0xe35e('0x13')](_0xe35e('0x11'),auth['isAuthenticated'](),controller['addMessage']);router[_0xe35e('0x17')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller['update']);router[_0xe35e('0x18')](_0xe35e('0xc'),auth[_0xe35e('0x9')](),controller[_0xe35e('0x19')]);router[_0xe35e('0x18')]('/:id/members',auth[_0xe35e('0x9')](),controller[_0xe35e('0x1a')]);module[_0xe35e('0x1b')]=router; \ No newline at end of file +var _0x866f=['multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','addMembers','post','addMessage','put','update','delete','destroy','removeMembers'];(function(_0xa508ed,_0x1a761f){var _0x484a4b=function(_0x4ccf9b){while(--_0x4ccf9b){_0xa508ed['push'](_0xa508ed['shift']());}};_0x484a4b(++_0x1a761f);}(_0x866f,0x1ba));var _0xf866=function(_0x32acc8,_0x86644b){_0x32acc8=_0x32acc8-0x0;var _0x5e09cd=_0x866f[_0x32acc8];return _0x5e09cd;};'use strict';var multer=require(_0xf866('0x0'));var util=require(_0xf866('0x1'));var path=require('path');var timeout=require(_0xf866('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf866('0x3'));var auth=require(_0xf866('0x4'));var interaction=require(_0xf866('0x5'));var config=require(_0xf866('0x6'));var controller=require('./chatGroup.controller');router[_0xf866('0x7')]('/',auth[_0xf866('0x8')](),controller[_0xf866('0x9')]);router[_0xf866('0x7')]('/describe',auth[_0xf866('0x8')](),controller['describe']);router[_0xf866('0x7')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0xb')]);router[_0xf866('0x7')](_0xf866('0xc'),auth['isAuthenticated'](),controller[_0xf866('0xd')]);router[_0xf866('0x7')](_0xf866('0xe'),auth[_0xf866('0x8')](),controller['getMembers']);router['get'](_0xf866('0xf'),auth[_0xf866('0x8')](),controller[_0xf866('0x10')]);router['post']('/',auth[_0xf866('0x8')](),controller[_0xf866('0x11')]);router['post'](_0xf866('0xe'),auth[_0xf866('0x8')](),controller[_0xf866('0x12')]);router[_0xf866('0x13')]('/:id/messages',auth[_0xf866('0x8')](),controller[_0xf866('0x14')]);router[_0xf866('0x15')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0x16')]);router[_0xf866('0x17')](_0xf866('0xa'),auth[_0xf866('0x8')](),controller[_0xf866('0x18')]);router['delete'](_0xf866('0xe'),auth[_0xf866('0x8')](),controller[_0xf866('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 39e26b1..500b381 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 _0xb62e=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports'];(function(_0xf943c8,_0x24d100){var _0x48a401=function(_0x50431b){while(--_0x50431b){_0xf943c8['push'](_0xf943c8['shift']());}};_0x48a401(++_0x24d100);}(_0xb62e,0x1de));var _0xeb62=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xb62e[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'closed':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb62('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xeb62('0x4'),_0xeb62('0x5')),'defaultValue':_0xeb62('0x4')},'ratingMessage':{'type':Sequelize[_0xeb62('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb62('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb62('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb62('0x7')]},'secondDisposition':{'type':Sequelize[_0xeb62('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeb62('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xeb62('0x7')]},'browserVersion':{'type':Sequelize[_0xeb62('0x7')]},'osName':{'type':Sequelize[_0xeb62('0x7')]},'osVersion':{'type':Sequelize[_0xeb62('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xeb62('0x7')]},'referer':{'type':Sequelize[_0xeb62('0x6')]},'customerIp':{'type':Sequelize[_0xeb62('0x7')]},'formData':{'type':Sequelize[_0xeb62('0x6')](_0xeb62('0x8'))},'read1stAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xeb62('0xa')]('in',_0xeb62('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb62('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xeb62('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8e44=['BOOLEAN','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x565800,_0x3e8e7b){var _0x4e5c4b=function(_0x13ee56){while(--_0x13ee56){_0x565800['push'](_0x565800['shift']());}};_0x4e5c4b(++_0x3e8e7b);}(_0x8e44,0x1ac));var _0x48e4=function(_0x25655f,_0x44fcc0){_0x25655f=_0x25655f-0x0;var _0x40d1af=_0x8e44[_0x25655f];return _0x40d1af;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'closed':{'type':Sequelize[_0x48e4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize['ENUM'](_0x48e4('0x3'),_0x48e4('0x4')),'defaultValue':_0x48e4('0x3')},'ratingMessage':{'type':Sequelize[_0x48e4('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x48e4('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x48e4('0x7')]},'disposition':{'type':Sequelize[_0x48e4('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x48e4('0x6')]},'browserName':{'type':Sequelize[_0x48e4('0x6')]},'browserVersion':{'type':Sequelize[_0x48e4('0x6')]},'osName':{'type':Sequelize[_0x48e4('0x6')]},'osVersion':{'type':Sequelize[_0x48e4('0x6')]},'deviceModel':{'type':Sequelize[_0x48e4('0x6')]},'deviceVendor':{'type':Sequelize[_0x48e4('0x6')]},'deviceType':{'type':Sequelize[_0x48e4('0x6')]},'referer':{'type':Sequelize[_0x48e4('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x48e4('0x5')](_0x48e4('0x8'))},'read1stAt':{'type':Sequelize[_0x48e4('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x48e4('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x48e4('0x6')]},'customerPort':{'type':Sequelize[_0x48e4('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x48e4('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index aee47ff..cc8b9cb 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 _0xdd4f=['i.ChatWebsiteId\x20IN\x20?','toString','sequelize','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','nolimit','sort','ChatInteractionId','$gte','getMyMessages','filter','findAll','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','Account','get','mkdirSync','Chat','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','eml-format','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','stack','name','send','render','merge','body','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','pick','field','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','compact','isEmpty','ChatWebsiteId','where','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL'];(function(_0x19d838,_0x1a15f5){var _0x43632d=function(_0x1ffafe){while(--_0x1ffafe){_0x19d838['push'](_0x19d838['shift']());}};_0x43632d(++_0x1a15f5);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x209733,_0xbf3be7){_0x209733=_0x209733-0x0;var _0x8e192=_0xdd4f[_0x209733];return _0x8e192;};'use strict';var emlformat=require(_0xfdd4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfdd4('0x3'));var util=require(_0xfdd4('0x4'));var path=require(_0xfdd4('0x5'));var sox=require('sox');var csv=require(_0xfdd4('0x6'));var ejs=require(_0xfdd4('0x7'));var fs=require('fs');var fs_extra=require(_0xfdd4('0x8'));var _=require(_0xfdd4('0x9'));var squel=require(_0xfdd4('0xa'));var crypto=require('crypto');var jsforce=require(_0xfdd4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfdd4('0x6'));var querystring=require(_0xfdd4('0xc'));var Papa=require(_0xfdd4('0xd'));var Redis=require('ioredis');var authService=require(_0xfdd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfdd4('0xf'));var pdf=require(_0xfdd4('0x10'));var hardwareService=require(_0xfdd4('0x11'));var logger=require(_0xfdd4('0x12'))(_0xfdd4('0x13'));var utils=require(_0xfdd4('0x14'));var config=require(_0xfdd4('0x15'));var licenseUtil=require(_0xfdd4('0x16'));var db=require(_0xfdd4('0x17'))['db'];config[_0xfdd4('0x18')]=_[_0xfdd4('0x19')](config['redis'],{'host':_0xfdd4('0x1a'),'port':0x18eb});var socket=require(_0xfdd4('0x1b'))(new Redis(config[_0xfdd4('0x18')]));require('./chatInteraction.socket')[_0xfdd4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232b});var client9004=jayson[_0xfdd4('0x1d')][_0xfdd4('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x37b05f,_0x52cf2c,_0x47ed1d,_0x559c77){return new BPromise(function(_0x3a966d,_0x216c7e){var _0x2eb174=_0x559c77||client;return _0x2eb174[_0xfdd4('0x1f')](_0x37b05f,_0x47ed1d)[_0xfdd4('0x20')](function(_0x33d752){logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));logger['debug'](_0xfdd4('0x24'),_0x52cf2c,_0xfdd4('0x23'),JSON[_0xfdd4('0x25')](_0x33d752));if(_0x33d752[_0xfdd4('0x26')]){if(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x27')]===0x1f4){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752['error'][_0xfdd4('0x28')]);return _0x216c7e(_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);}logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0x33d752[_0xfdd4('0x26')][_0xfdd4('0x28')]);return _0x3a966d(_0x33d752[_0xfdd4('0x26')]['message']);}else{logger[_0xfdd4('0x21')](_0xfdd4('0x22'),_0x52cf2c,_0xfdd4('0x23'));_0x3a966d(_0x33d752['result'][_0xfdd4('0x28')]);}})[_0xfdd4('0x29')](function(_0xf9c346){logger[_0xfdd4('0x26')](_0xfdd4('0x22'),_0x52cf2c,_0xf9c346);_0x216c7e(_0xf9c346);});});}function respondWithStatusCode(_0x4a8790,_0x18bafb){_0x18bafb=_0x18bafb||0xcc;return function(_0x2c88ad){if(_0x2c88ad){return _0x4a8790[_0xfdd4('0x2a')](_0x18bafb);}return _0x4a8790[_0xfdd4('0x2b')](_0x18bafb)[_0xfdd4('0x2c')]();};}function respondWithResult(_0x192471,_0x453a48){_0x453a48=_0x453a48||0xc8;return function(_0x37b7a2){if(_0x37b7a2){return _0x192471['status'](_0x453a48)[_0xfdd4('0x2d')](_0x37b7a2);}};}function respondWithFilteredResult(_0x39981f,_0x385a68){return function(_0xef012e){if(_0xef012e){var _0x2207ae=typeof _0x385a68['offset']===_0xfdd4('0x2e')&&typeof _0x385a68[_0xfdd4('0x2f')]===_0xfdd4('0x2e');var _0x2bb793=_0xef012e[_0xfdd4('0x30')];var _0x4d64ce=_0x2207ae?0x0:_0x385a68[_0xfdd4('0x31')];var _0x315568=_0x2207ae?_0xef012e[_0xfdd4('0x30')]:_0x385a68['offset']+_0x385a68[_0xfdd4('0x2f')];var _0x502776;if(_0x315568>=_0x2bb793){_0x315568=_0x2bb793;_0x502776=0xc8;}else{_0x502776=0xce;}_0x39981f[_0xfdd4('0x2b')](_0x502776);return _0x39981f[_0xfdd4('0x32')]('Content-Range',_0x4d64ce+'-'+_0x315568+'/'+_0x2bb793)['json'](_0xef012e);}return null;};}function patchUpdates(_0x41dae6){return function(_0x289f16){try{jsonpatch['apply'](_0x289f16,_0x41dae6,!![]);}catch(_0x557d7b){return BPromise[_0xfdd4('0x33')](_0x557d7b);}return _0x289f16[_0xfdd4('0x34')]();};}function saveUpdates(_0x39eedb,_0x24b1fa){return function(_0x3247f4){if(_0x3247f4){return _0x3247f4[_0xfdd4('0x35')](_0x39eedb)[_0xfdd4('0x20')](function(_0x4734ed){return _0x4734ed;});}return null;};}function removeEntity(_0x3e6bc5,_0x457ab5){return function(_0x6ffe30){if(_0x6ffe30){return _0x6ffe30[_0xfdd4('0x36')]()[_0xfdd4('0x20')](function(){_0x3e6bc5[_0xfdd4('0x2b')](0xcc)[_0xfdd4('0x2c')]();});}};}function handleEntityNotFound(_0x3f5c5a,_0x261d87){return function(_0x3a0102){if(!_0x3a0102){_0x3f5c5a[_0xfdd4('0x2a')](0x194);}return _0x3a0102;};}function handleError(_0x4037c4,_0xc9549b){_0xc9549b=_0xc9549b||0x1f4;return function(_0x2e4c8c){logger[_0xfdd4('0x26')](_0x2e4c8c[_0xfdd4('0x37')]);if(_0x2e4c8c[_0xfdd4('0x38')]){delete _0x2e4c8c[_0xfdd4('0x38')];}_0x4037c4['status'](_0xc9549b)[_0xfdd4('0x39')](_0x2e4c8c);};}function getMustacheRender(_0x3716da,_0x42dc1a){return Mustache[_0xfdd4('0x3a')](_0x3716da,_[_0xfdd4('0x3b')](_0x42dc1a[_0xfdd4('0x3c')],{'contact':_0x42dc1a['contact'],'message':_0x42dc1a[_0xfdd4('0x28')],'agent':_0x42dc1a['agent'],'interaction':_0x42dc1a[_0xfdd4('0x3d')],'account':_0x42dc1a[_0xfdd4('0x3e')]}))||'';}function getInteractionUsers(_0x6a79eb,_0x13efe8){return new BPromise(function(_0x4cccab,_0x1c6f43){try{if(_0x13efe8[_0x6a79eb['id']]){_0x6a79eb[_0xfdd4('0x3f')]=_[_0xfdd4('0x40')](_0x13efe8[_0x6a79eb['id']],function(_0x2ee857){return{'id':_0x2ee857['id'],'fullname':_0x2ee857[_0xfdd4('0x41')]};});}}catch(_0x7e171){_0x1c6f43(_0x7e171);}_0x4cccab(_0x6a79eb);});}function getInteractionTags(_0x28e5e2,_0x55fcec){return new BPromise(function(_0xe65944,_0x83673d){try{if(_0x28e5e2['TagIds']){_0x28e5e2[_0xfdd4('0x42')]=[];_0x28e5e2[_0xfdd4('0x43')][_0xfdd4('0x44')](',')[_0xfdd4('0x45')](function(_0x5173db){_0x28e5e2[_0xfdd4('0x42')][_0xfdd4('0x46')](_0x55fcec[_0x5173db]);});}delete _0x28e5e2[_0xfdd4('0x43')];}catch(_0x2341e5){_0x83673d(_0x2341e5);}_0xe65944(_0x28e5e2);});}function updateChatInteraction(_0x362c4f,_0x496747,_0x1411e0){return new BPromise(function(_0x23af2a,_0xd3780d){return getInteractionUsers(_0x362c4f,_0x1411e0)[_0xfdd4('0x20')](function(_0x912520){return getInteractionTags(_0x912520,_0x496747);})[_0xfdd4('0x20')](function(_0x3d1051){_0x23af2a(_0x3d1051);})['catch'](function(_0x2dd3fa){_0xd3780d(_0x2dd3fa);});});}exports['index']=function(_0x3a0de9,_0x11f241){var _0x3f7273={},_0x137d41={},_0x5367aa={'count':0x0,'rows':[]};var _0x419578=_[_0xfdd4('0x40')](db['ChatInteraction'][_0xfdd4('0x47')],function(_0xbfaa53){return{'name':_0xbfaa53['fieldName'],'type':_0xbfaa53[_0xfdd4('0x48')]['key']};});_0x137d41['model']=_['map'](_0x419578,_0xfdd4('0x38'));_0x137d41[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x3a0de9['query']);_0x137d41[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x137d41['model'],_0x137d41[_0xfdd4('0x49')]);_0x3f7273[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x137d41[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x3f7273[_0xfdd4('0x4d')]=_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x3f7273[_0xfdd4('0x4d')]:_0x137d41[_0xfdd4('0x4e')];if(!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x3f7273['limit']=qs[_0xfdd4('0x2f')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x2f')]);_0x3f7273[_0xfdd4('0x31')]=qs['offset'](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x31')]);}_0x3f7273['order']=qs['sort'](_0x3a0de9['query']['sort']);_0x3f7273['where']=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x3a0de9[_0xfdd4('0x49')],_0x137d41[_0xfdd4('0x4b')]),_0x419578);var _0x35c032=[];var _0x49bc61=squel['select']()[_0xfdd4('0x53')]('id')[_0xfdd4('0x53')](_0xfdd4('0x38'))[_0xfdd4('0x53')]('color')[_0xfdd4('0x54')](_0xfdd4('0x55'));var _0x4addd6=squel[_0xfdd4('0x56')]()[_0xfdd4('0x53')]('u.id')['field'](_0xfdd4('0x57'))[_0xfdd4('0x53')](_0xfdd4('0x58'))[_0xfdd4('0x54')](_0xfdd4('0x59'),'ui')[_0xfdd4('0x5a')](_0xfdd4('0x5b'),'u',_0xfdd4('0x5c'));var _0x5848e1=squel[_0xfdd4('0x56')]()['from']('chat_interactions','i')[_0xfdd4('0x5a')](_0xfdd4('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xfdd4('0x5e'))[_0xfdd4('0x5a')]('chat_websites','a',_0xfdd4('0x5f'))[_0xfdd4('0x5a')](_0xfdd4('0x60'),'me',_0xfdd4('0x61'))[_0xfdd4('0x5a')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0xfdd4('0x62'));var _0x14d07e=squel['expr']();var _0x1eee3d=[];var _0x2abe50=squel['expr']();var _0x45dcc8;if(_0x3a0de9[_0xfdd4('0x49')]['search']){_0x45dcc8=as[_0xfdd4('0x63')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x64')]);var _0x4a5fe6=_0x45dcc8[_0xfdd4('0x65')];for(var _0x3417dd=0x0;_0x3417dd<_0x45dcc8[_0xfdd4('0x66')][_0xfdd4('0x50')];_0x3417dd++){var _0x5c7be=_0x45dcc8['conditions'][_0x3417dd];var _0x2cc3e2='i';var _0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0x5c7be[_0xfdd4('0x53')]]);if(!_0x2ee4b6){switch(_0x5c7be[_0xfdd4('0x53')]){case _0xfdd4('0x68'):if(_0x5c7be[_0xfdd4('0x69')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be['field']+_0xfdd4('0x6b'));}else{_0x5848e1[_0xfdd4('0x6a')]('`'+_0x5c7be[_0xfdd4('0x53')]+_0xfdd4('0x6c'));}break;case _0xfdd4('0x6d'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){if(_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')]('\x20')[_0xfdd4('0x50')]>0x1){_0x14d07e[_0x4a5fe6](_0xfdd4('0x6f'),qs[_0xfdd4('0x70')](_0x5c7be[_0xfdd4('0x69')]),null);}else{var _0x276e9='%'+_0x5c7be[_0xfdd4('0x69')]+'%';_0x14d07e[_0x4a5fe6](_0xfdd4('0x71'),_0x276e9,_0x276e9,_0x276e9);}}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),_0xfdd4('0x72')]);_0x5c7be['field']=_0xfdd4('0x72');_0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x75'):var _0xb0bb50=_0x5c7be[_0xfdd4('0x69')][_0xfdd4('0x44')](',')[_0xfdd4('0x40')](function(_0x207a4c){return Number(_0x207a4c);});_0xb0bb50['forEach'](function(_0x4bac59){_0x2abe50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4bac59+',%');});_0x1eee3d=_[_0xfdd4('0x76')](_0x1eee3d,_0xb0bb50);break;case _0xfdd4('0x77'):if(_0x5c7be['operator']===_0xfdd4('0x6e')){_0x14d07e[_0x4a5fe6](_0xfdd4('0x78'),'%'+_0x5c7be[_0xfdd4('0x69')]+'%',null);}else{_0x2ee4b6=_[_0xfdd4('0x67')](_0x419578,[_0xfdd4('0x38'),'UserId']);_0x5c7be[_0xfdd4('0x53')]=_0xfdd4('0x79');_0xa55e0f=as[_0xfdd4('0x7a')](_0x2cc3e2,_0x2ee4b6['type'],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f['value'][_0xfdd4('0x74')],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}break;case _0xfdd4('0x3c'):_0xa55e0f=as['buildExpression']('me',null,_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);break;}}else{var _0xa55e0f=as['buildExpression'](_0x2cc3e2,_0x2ee4b6[_0xfdd4('0x48')],_0x5c7be);_0x14d07e[_0x4a5fe6](_0xa55e0f[_0xfdd4('0x73')],_0xa55e0f[_0xfdd4('0x69')]['start'],_0xa55e0f[_0xfdd4('0x69')][_0xfdd4('0x2c')]);}}}else{var _0x427ded=_(_0x3a0de9[_0xfdd4('0x49')])[_0xfdd4('0x4a')]()[_0xfdd4('0x40')](function(_0x185226){return _['some'](_0x419578,[_0xfdd4('0x38'),_0x185226])?_0x185226:undefined;})[_0xfdd4('0x7b')]()[_0xfdd4('0x69')]();if(!_[_0xfdd4('0x7c')](_0x427ded)){_0x427ded[_0xfdd4('0x45')](function(_0x2cbd27){if(_0x2cbd27===_0xfdd4('0x7d')){_0x5848e1[_0xfdd4('0x7e')]('i.ChatWebsiteId\x20IN\x20?',[][_0xfdd4('0x7f')](_0x3a0de9['query'][_0x2cbd27]));}else if(_0x2cbd27==='createdAt'){var _0x40b2e8=JSON['parse'](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])['$gte'];var _0x4576ce=JSON[_0xfdd4('0x80')](_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27])[_0xfdd4('0x81')];_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x82'),_0x40b2e8,_0x4576ce);}else{if(_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]==='null'){_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x83'));}else{_0x5848e1['where']('i.'+_0x2cbd27+_0xfdd4('0x84'),_0x3a0de9[_0xfdd4('0x49')][_0x2cbd27]);}}});}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x85')]==0x1){_0x5848e1[_0xfdd4('0x6a')]('`unreadMessages`\x20=\x200');}else{_0x5848e1['having'](_0xfdd4('0x86'));}}if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]){_0x1eee3d=_[_0xfdd4('0x88')](_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')])?_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]:new Array(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x87')]);_0x1eee3d[_0xfdd4('0x45')](function(_0x32abf5){_0x2abe50['or'](_0xfdd4('0x89'),'%,'+_0x32abf5+',%');});}if(_0x3a0de9['query']['filter']){var _0x3761f2=_0x3a0de9[_0xfdd4('0x49')]['filter']['replace']('\x5c','\x5c\x5c')[_0xfdd4('0x8a')](/'/g,'\x27\x27');if(qs[_0xfdd4('0x8b')](_0x3761f2)){_0x14d07e['or']('i.id\x20LIKE\x20?',_0x3761f2+'%');}else{_0x14d07e['or'](_0xfdd4('0x8c'),qs[_0xfdd4('0x70')](_0x3761f2))['or'](_0xfdd4('0x8d'),_0x3761f2+'%');}}}_0x5848e1[_0xfdd4('0x7e')](_0x14d07e);_0x5848e1[_0xfdd4('0x8e')](_0xfdd4('0x8f'));var _0x5d356c={'type':db[_0xfdd4('0x90')][_0xfdd4('0x91')][_0xfdd4('0x92')],'raw':!![]};var _0x2f8001=_0x5848e1[_0xfdd4('0x93')]();_0x2f8001[_0xfdd4('0x53')](_0xfdd4('0x8f'));_0x2f8001[_0xfdd4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f7273[_0xfdd4('0x94')]){_0x3f7273['order'][_0xfdd4('0x45')](function(_0x1b4f61){var _0x298906=_0x1b4f61[0x0]===_0xfdd4('0x95')?_0x1b4f61[0x0]:'i.'+_0x1b4f61[0x0];_0x5848e1[_0xfdd4('0x94')](_0x298906,_0x1b4f61[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1eee3d)){_0x5848e1[_0xfdd4('0x6a')](_0x2abe50);_0x2f8001['where'](_0xfdd4('0x96'),_0x1eee3d);}BPromise['resolve']()[_0xfdd4('0x20')](function(){if(!_0x45dcc8){if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return;_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x97'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x97'));return;}if(_0x3a0de9[_0xfdd4('0x98')][_0xfdd4('0x99')]!==_0xfdd4('0x9a'))return;return _0x3a0de9[_0xfdd4('0x98')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xfdd4('0x20')](function(_0x1f9e08){if(_[_0xfdd4('0x7c')](_0x1f9e08)){_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9b'));_0x5848e1[_0xfdd4('0x7e')](_0xfdd4('0x9b'));}else{_0x2f8001[_0xfdd4('0x7e')](_0xfdd4('0x9c'),_['map'](_0x1f9e08,'id'));_0x5848e1['where'](_0xfdd4('0x9c'),_[_0xfdd4('0x40')](_0x1f9e08,'id'));}});})[_0xfdd4('0x20')](function(){if(_0x3a0de9['user'][_0xfdd4('0x99')]===_0xfdd4('0x9a')&&!_0x45dcc8&&!_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x7d')])return[];return db['sequelize']['query'](_0x2f8001[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x3b75bf){_0x5367aa['count']=_0x3b75bf[_0xfdd4('0x50')];if(_0x5367aa[_0xfdd4('0x30')]===0x0)return[];return db[_0xfdd4('0x9e')][_0xfdd4('0x49')](_0x49bc61[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x524a8f){_0x35c032=_['keyBy'](_0x524a8f,'id');_0x5d356c=_[_0xfdd4('0x3b')](_0x5d356c,{'model':db[_0xfdd4('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3a0de9[_0xfdd4('0x49')][_0xfdd4('0x4f')]){_0x3f7273[_0xfdd4('0x4d')][_0xfdd4('0x45')](function(_0x46edc9){_0x5848e1[_0xfdd4('0x53')]('i.'+_0x46edc9);});}else{_0x5848e1['field'](_0xfdd4('0xa0'),'unreadMessages');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa1'),'Account.key');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa2'),_0xfdd4('0xa3'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa4'),_0xfdd4('0x95'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xa5'));_0x5848e1[_0xfdd4('0x53')]('c.firstName',_0xfdd4('0xa6'));_0x5848e1['field'](_0xfdd4('0xa7'),'Contact.lastName');_0x5848e1['field'](_0xfdd4('0xa8'),_0xfdd4('0xa9'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xaa'),_0xfdd4('0xab'));_0x5848e1['field'](_0xfdd4('0xac'),_0xfdd4('0xad'));_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xae'),_0xfdd4('0xaf'));_0x5848e1[_0xfdd4('0x53')]('o.fullname',_0xfdd4('0xb0'));_0x5848e1[_0xfdd4('0x53')]('o.internal','Owner.internal');_0x5848e1[_0xfdd4('0x53')](_0xfdd4('0xb1'),_0xfdd4('0x43'));}if(_0x3f7273['limit'])_0x5848e1['limit'](_0x3f7273[_0xfdd4('0x2f')]);if(_0x3f7273[_0xfdd4('0x31')])_0x5848e1[_0xfdd4('0x31')](_0x3f7273['offset']);return db['sequelize'][_0xfdd4('0x49')](_0x5848e1[_0xfdd4('0x9d')](),_0x5d356c);})[_0xfdd4('0x20')](function(_0x4bfb31){if(_0x4bfb31[_0xfdd4('0x50')]>0x0)_0x4addd6['where'](_0xfdd4('0xb2'),_[_0xfdd4('0x40')](_0x4bfb31,'id'));return db[_0xfdd4('0x9e')]['query'](_0x4addd6[_0xfdd4('0x9d')](),_0x5d356c)[_0xfdd4('0x20')](function(_0x1efb08){var _0xe3296c=_[_0xfdd4('0xb3')](_0x1efb08,'ChatInteractionId');var _0x19de84=[];_0x4bfb31[_0xfdd4('0x45')](function(_0x133f56){_0x19de84['push'](updateChatInteraction(_0x133f56,_0x35c032,_0xe3296c));});return BPromise[_0xfdd4('0xb4')](_0x19de84);});});})[_0xfdd4('0x20')](function(_0xb9cb69){_0x5367aa[_0xfdd4('0xb5')]=_0xb9cb69;return _0x5367aa;})['then'](respondWithFilteredResult(_0x11f241,_0x3f7273))[_0xfdd4('0x29')](handleError(_0x11f241,null));};exports['show']=function(_0x4f5ca3,_0x528004){var _0x206a59={'raw':![],'where':{'id':_0x4f5ca3['params']['id']}},_0x545475={};_0x545475['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0x9f')][_0xfdd4('0x47')]);_0x545475[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x4f5ca3[_0xfdd4('0x49')]);_0x545475[_0xfdd4('0x4b')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],_0x545475[_0xfdd4('0x49')]);_0x206a59[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x545475[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x206a59[_0xfdd4('0x4d')]=_0x206a59[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x206a59[_0xfdd4('0x4d')]:_0x545475[_0xfdd4('0x4e')];if(_0x4f5ca3[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x206a59[_0xfdd4('0xb7')]=[{'all':!![]}];}_0x206a59=_[_0xfdd4('0x3b')]({},_0x206a59,_0x4f5ca3[_0xfdd4('0xb8')]);return db['ChatInteraction'][_0xfdd4('0x67')](_0x206a59)[_0xfdd4('0x20')](handleEntityNotFound(_0x528004,null))[_0xfdd4('0x20')](respondWithResult(_0x528004,null))[_0xfdd4('0x29')](handleError(_0x528004,null));};exports[_0xfdd4('0xb9')]=function(_0x577bef,_0x3616e3){return db[_0xfdd4('0x9f')][_0xfdd4('0xb9')](_0x577bef[_0xfdd4('0x3c')],{})[_0xfdd4('0x20')](respondWithResult(_0x3616e3,0xc9))[_0xfdd4('0x29')](handleError(_0x3616e3,null));};exports['update']=function(_0x186d86,_0x1a9e62){if(_0x186d86[_0xfdd4('0x3c')]['id']){delete _0x186d86[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x186d86['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x1a9e62,null))[_0xfdd4('0x20')](saveUpdates(_0x186d86[_0xfdd4('0x3c')],null))['then'](respondWithResult(_0x1a9e62,null))[_0xfdd4('0x29')](handleError(_0x1a9e62,null));};exports[_0xfdd4('0x36')]=function(_0x4de363,_0x5159a5){return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x4de363[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5159a5,null))['then'](removeEntity(_0x5159a5,null))[_0xfdd4('0x29')](handleError(_0x5159a5,null));};exports['describe']=function(_0xc9955e,_0x42204a){return db[_0xfdd4('0x9f')][_0xfdd4('0xbb')]()[_0xfdd4('0x20')](respondWithResult(_0x42204a,null))[_0xfdd4('0x29')](handleError(_0x42204a,null));};exports[_0xfdd4('0xbc')]=function(_0x46e3ad,_0x29fcd4){var _0xe32bfc=_0x46e3ad[_0xfdd4('0xba')]['id'];var _0x5015a1;var _0xca4f26;var _0x42a3dc;return db[_0xfdd4('0x9f')][_0xfdd4('0xbd')]({'where':{'id':_0xe32bfc}})[_0xfdd4('0x20')](function(_0x4512b0){_0x5015a1=_0x4512b0;return db['ChatWebsite'][_0xfdd4('0xbd')]({'where':{'id':_0x4512b0[_0xfdd4('0x7d')]},'attributes':['id',_0xfdd4('0xbe'),_0xfdd4('0xbf'),'vidaooTopic',_0xfdd4('0xc0'),_0xfdd4('0xc1')],'raw':!![]});})['then'](function(_0x2d506e){if(_0x2d506e&&_0x2d506e[_0xfdd4('0xbe')]&&_0x2d506e[_0xfdd4('0xbf')]){_0xca4f26=_0x2d506e;var _0x204975={'interaction':{'id':_0xe32bfc},'agent':{'id':_0x46e3ad[_0xfdd4('0x98')]['id'],'name':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x38')],'fullname':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0x41')],'email':_0x46e3ad[_0xfdd4('0x98')][_0xfdd4('0xc2')]},'contact':_0x46e3ad[_0xfdd4('0x3c')][_0xfdd4('0xc3')],'account':_0x46e3ad[_0xfdd4('0x3c')]['account']};var _0x42253b={'rejectUnauthorized':![],'method':_0xfdd4('0xc4'),'url':_0xfdd4('0xc5'),'headers':{'X-APIKEY':_0x2d506e[_0xfdd4('0xbe')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x46e3ad['user'][_0xfdd4('0xc2')]],'buttons':null,'topic':_0xca4f26[_0xfdd4('0xc6')],'note':_['isNull'](_0xca4f26[_0xfdd4('0xc0')])?null:getMustacheRender(_0xca4f26[_0xfdd4('0xc0')],_0x204975),'metadata':null},'redirect':_0xfdd4('0xc7'),'json':!![]};try{if(!_[_0xfdd4('0xc8')](_0xca4f26['vidaooMetadata'])){var _0x227fcf=getMustacheRender(_0xca4f26['vidaooMetadata'],_0x204975);var _0x2aa3d3=JSON[_0xfdd4('0x80')](_0x227fcf);_0x42253b['body'][_0xfdd4('0xc9')]=_0x2aa3d3;}}catch(_0x5e058b){throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcb'));}return rp(_0x42253b);}else{throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x28df36){_0x42a3dc=_0x28df36;if(_0x42a3dc['id']){var _0x1bb704={'body':_0x42a3dc['join_url'],'ChatWebsiteId':_0xca4f26['id'],'ChatInteractionId':_0x5015a1['id'],'direction':'out','UserId':_0x46e3ad[_0xfdd4('0x98')]['id']};return db[_0xfdd4('0xcc')][_0xfdd4('0xb9')](_0x1bb704,{});}else{throw new db['Sequelize'][(_0xfdd4('0xca'))](_0xfdd4('0xcd'));}})[_0xfdd4('0x20')](function(){return _0x5015a1[_0xfdd4('0xce')]({'vidaooSessionId':_0x42a3dc['id']});})['then'](respondWithResult(_0x29fcd4,null))[_0xfdd4('0x29')](handleError(_0x29fcd4,null));};exports[_0xfdd4('0xcf')]=function(_0x23dd10,_0x23746f){if(_0x23dd10[_0xfdd4('0x3c')]['id']){delete _0x23dd10['body']['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x23dd10['params']['id']},'include':[{'model':db[_0xfdd4('0xd0')],'as':_0xfdd4('0x6d')}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x23746f,null))[_0xfdd4('0x20')](saveUpdates(_0x23dd10[_0xfdd4('0x3c')],null))[_0xfdd4('0x20')](respondWithResult(_0x23746f,null))[_0xfdd4('0x29')](handleError(_0x23746f,null));};exports[_0xfdd4('0xd1')]=function(_0x3b6cfc,_0x20b6b1,_0x308201){if(_0x3b6cfc[_0xfdd4('0x3c')]['id']){delete _0x3b6cfc[_0xfdd4('0x3c')]['id'];}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x3b6cfc['params']['id']}})['then'](function(_0x44b024){if(!_0x44b024){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfdd4('0xd1'),0x194,_0xfdd4('0xd2'));_0x20b6b1[_0xfdd4('0x2a')](0x194);}else{if(_0x44b024[_0xfdd4('0x79')]){throw new db[(_0xfdd4('0x90'))][(_0xfdd4('0xca'))](_0xfdd4('0xd3'));}}return _0x44b024;})['then'](function(_0x24e4be){if(_0x24e4be){return _0x24e4be[_0xfdd4('0x35')]({'closed':_0x3b6cfc['body']['closed'],'disposition':_0x3b6cfc['body'][_0xfdd4('0xd4')]})['then'](function(_0x28d8d9){return _0x28d8d9;});}})['then'](function(_0x52ff15){return respondWithRpcPromise(_0xfdd4('0xd5'),_0xfdd4('0xd1'),_0x3b6cfc[_0xfdd4('0x3c')],client9004);})[_0xfdd4('0x20')](respondWithResult(_0x20b6b1,null))[_0xfdd4('0x29')](handleError(_0x20b6b1,null));};exports[_0xfdd4('0xd6')]=function(_0x461070,_0x17f504,_0x156173){_0x461070['body'][_0xfdd4('0x38')]=_0x461070[_0xfdd4('0xd7')]['originalname'];_0x461070[_0xfdd4('0x3c')][_0xfdd4('0xd8')]=_0x461070['file']['filename'];_0x461070['body']['type']=_0x461070[_0xfdd4('0xd7')][_0xfdd4('0xd9')];return db['Attachment'][_0xfdd4('0xb9')](_0x461070['body'])[_0xfdd4('0x20')](respondWithResult(_0x17f504,0xc9))[_0xfdd4('0x29')](handleError(_0x17f504,null));};exports[_0xfdd4('0xda')]=function(_0x2093a5,_0x2c36a3,_0x45fa09){return db[_0xfdd4('0x9f')]['findOne']({'where':{'id':_0x2093a5['params']['id']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null))[_0xfdd4('0x20')](function(_0x2b65d7){if(_0x2b65d7){if(_0x2b65d7[_0xfdd4('0xdb')]){return _0x2c36a3[_0xfdd4('0x2b')](0x193)['json']({'status':0x193,'message':_0xfdd4('0xdc')});}return db[_0xfdd4('0xdd')][_0xfdd4('0xbd')]({'where':{'id':_0x2093a5['query']['attachId']},'raw':!![]})[_0xfdd4('0x20')](handleEntityNotFound(_0x2c36a3,null));}})[_0xfdd4('0x20')](function(_0x2f6456){if(_0x2f6456){var _0x1ff8d6=_0x2f6456[_0xfdd4('0xde')]!==null;var _0xa64a3b=path['join'](config['root'],_0xfdd4('0xdf'));if(_0x1ff8d6){_0xa64a3b=path[_0xfdd4('0xe0')](_0xa64a3b,_0xfdd4('0xe1'));}var _0x5a4bd4=path[_0xfdd4('0xe0')](_0xa64a3b,_0x2f6456['basename']);return _0x2c36a3[_0xfdd4('0xe2')](_0x5a4bd4);}})['catch'](handleError(_0x2c36a3,null));};exports[_0xfdd4('0xe3')]=function(_0x12beac,_0x5a78bc){var _0x2d1810=null;var _0x308050=null;var _0x1f1ec8=null;var _0x2e3342=null;if(_0x12beac['body']['id']){delete _0x12beac[_0xfdd4('0x3c')]['id'];}if(_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]){_0x2e3342=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0xe6'),util['format'](_0xfdd4('0xe7'),Date['now']()));_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe8')]=_0x2e3342;}return db[_0xfdd4('0x9f')][_0xfdd4('0x67')]({'where':{'id':_0x12beac[_0xfdd4('0xba')]['id']},'include':[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'include':[{'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77')}]}]})[_0xfdd4('0x20')](handleEntityNotFound(_0x5a78bc,null))[_0xfdd4('0x20')](saveUpdates(_0x12beac[_0xfdd4('0x3c')],null))['then'](function(_0x13df51){if(_0x13df51){_0x2d1810=_0x13df51;return db['ChatWebsite'][_0xfdd4('0x67')]({'where':{'id':_0x2d1810['ChatWebsiteId']}});}})['then'](function(_0x17da2a){if(_0x17da2a){_0x1f1ec8=_0x17da2a;return db[_0xfdd4('0xd0')][_0xfdd4('0x67')]({'where':{'id':_0x2d1810[_0xfdd4('0x72')]}});}})[_0xfdd4('0x20')](function(_0x1cf955){if(_0x1cf955){_0x308050=_0x1cf955;if(_0x2e3342){var _0x2d74d1=null;for(var _0x5c70bf=0x1;_0x5c70bf<_0x2d1810[_0xfdd4('0xe9')][_0xfdd4('0x50')];++_0x5c70bf){_0x2d74d1=_0x2d1810[_0xfdd4('0xe9')][_0x5c70bf];var _0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')](_0xfdd4('0xeb'),_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):_0xfdd4('0xed');var _0x43c681=_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xee')]||util[_0xfdd4('0xea')](_0xfdd4('0xeb'),'Visitor',_0x2d74d1['ContactId']);switch(_0x1f1ec8[_0xfdd4('0xef')]){case _0xfdd4('0xf0'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1['UserId']):_0xfdd4('0xed');break;case _0xfdd4('0xf1'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1['User'][_0xfdd4('0xf2')]||_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;case _0xfdd4('0xf3'):_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?_0x2d74d1[_0xfdd4('0x77')][_0xfdd4('0x41')]:_0xfdd4('0xed');break;default:_0x5a7c66=_0x2d74d1[_0xfdd4('0x79')]?util[_0xfdd4('0xea')]('%s%d',_0x1f1ec8[_0xfdd4('0xec')],_0x2d74d1[_0xfdd4('0x79')]):'System';}var _0x3621f3=util[_0xfdd4('0xea')](_0xfdd4('0xf4'),moment(_0x2d74d1[_0xfdd4('0xf5')])['format'](_0xfdd4('0xf6')),_0x2d74d1[_0xfdd4('0xf7')]==='in'?_0x43c681:_0x5a7c66,_0x2d74d1[_0xfdd4('0x3c')]);if(!_0x2d74d1[_0xfdd4('0xf8')]){fs[_0xfdd4('0xf9')](_0x2e3342,_0x3621f3);}}return db[_0xfdd4('0xfa')][_0xfdd4('0xbd')]({'where':{'service':!![]},'include':[{'model':db[_0xfdd4('0xfb')],'as':'Smtp','raw':!![]}]});}}})[_0xfdd4('0x20')](function(_0x4c248e){if(_0x4c248e&&_0x4c248e[_0xfdd4('0xfc')]&&_0x12beac['body']){var _0x5e8af7={'tls':{'rejectUnauthorized':![]}};if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')]){_0x5e8af7[_0xfdd4('0xfd')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xfd')];}else{_0x5e8af7[_0xfdd4('0xfe')]=_0x4c248e[_0xfdd4('0xfc')]['host'];_0x5e8af7[_0xfdd4('0xff')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0xff')];_0x5e8af7[_0xfdd4('0x100')]=_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x100')];}if(_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x101')]){_0x5e8af7['auth']={'user':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')],'pass':_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x102')]};}return respondWithRpcPromise(_0xfdd4('0x103'),_0xfdd4('0x104'),{'account':_0x5e8af7,'message':{'from':util[_0xfdd4('0xea')]('\x22%s\x22\x20<%s>',_0x4c248e['name'],_0x4c248e[_0xfdd4('0xc2')]||_0x4c248e[_0xfdd4('0xfc')][_0xfdd4('0x98')]),'to':_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')],'subject':_0xfdd4('0x105'),'text':util[_0xfdd4('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12beac[_0xfdd4('0x3c')][_0xfdd4('0xe4')]),'attachments':[{'path':_0x2e3342}]}})['then'](function(){return _0x2d1810;})['catch'](function(_0x1336e1){console[_0xfdd4('0x26')](_0x1336e1);});}else{return _0x2d1810;}})[_0xfdd4('0x20')](respondWithStatusCode(_0x5a78bc,0xc8))[_0xfdd4('0x29')](handleError(_0x5a78bc,null));};exports[_0xfdd4('0x106')]=function(_0x25656c,_0x5f51e6,_0x4fbd83){return db[_0xfdd4('0xcc')][_0xfdd4('0x67')]({'where':{'id':_0x25656c['params']['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x5f51e6,null))['then'](function(_0x13cf75){if(_0x13cf75){return _0x13cf75[_0xfdd4('0x106')](_0x25656c[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x25656c['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x5f51e6,null))[_0xfdd4('0x29')](handleError(_0x5f51e6,null));};exports['getMessages']=function(_0x106064,_0x536c4b,_0x7101d2){var _0x317d77={'raw':![],'where':{}};var _0x599d63={};var _0x529474={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x106064[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x536c4b,null))[_0xfdd4('0x20')](function(_0x4c33bc){if(_0x4c33bc){_0x599d63['model']=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')][_0xfdd4('0x47')]);_0x599d63[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x106064[_0xfdd4('0x49')]);_0x599d63['filters']=_[_0xfdd4('0x4c')](_0x599d63[_0xfdd4('0x4e')],_0x599d63['query']);_0x317d77[_0xfdd4('0x4d')]=_['intersection'](_0x599d63[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x106064[_0xfdd4('0x49')][_0xfdd4('0x4f')]));_0x317d77[_0xfdd4('0x4d')]=_0x317d77[_0xfdd4('0x4d')][_0xfdd4('0x50')]?_0x317d77[_0xfdd4('0x4d')]:_0x599d63['model'];if(!_0x106064[_0xfdd4('0x49')][_0xfdd4('0x51')](_0xfdd4('0x109'))){_0x317d77[_0xfdd4('0x2f')]=qs['limit'](_0x106064[_0xfdd4('0x49')]['limit']);_0x317d77[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x106064[_0xfdd4('0x49')]['offset']);}_0x317d77['order']=qs[_0xfdd4('0x10a')](_0x106064[_0xfdd4('0x49')]['sort']);_0x317d77[_0xfdd4('0x7e')]=qs['filters'](_['pick'](_0x106064[_0xfdd4('0x49')],_0x599d63[_0xfdd4('0x4b')]));_0x317d77[_0xfdd4('0x7e')][_0xfdd4('0x10b')]=_0x4c33bc['id'];if(_0x106064['query']['filter']){_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],{'$or':_['map'](_0x317d77[_0xfdd4('0x4d')],function(_0x2b1f92){var _0x57c9bb={};_0x57c9bb[_0x2b1f92]={'$like':'%'+_0x106064[_0xfdd4('0x49')]['filter']+'%'};return _0x57c9bb;})});}if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0x10c')]){var _0x4b97fa=_0x106064['query']['$gte']['split'](',');var _0x54fec8={};_0x54fec8[_0x4b97fa[0x0]]={'$gte':moment(_0x4b97fa[0x1])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x317d77[_0xfdd4('0x7e')]=_[_0xfdd4('0x3b')](_0x317d77[_0xfdd4('0x7e')],_0x54fec8);}_0x317d77=_[_0xfdd4('0x3b')]({},_0x317d77,_0x106064[_0xfdd4('0xb8')]);return db['ChatMessage']['count']({'where':_0x317d77[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x22c2b9){_0x529474[_0xfdd4('0x30')]=_0x22c2b9;if(_0x106064[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x317d77[_0xfdd4('0xb7')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x317d77);})[_0xfdd4('0x20')](function(_0xa129e4){_0x529474[_0xfdd4('0xb5')]=_0xa129e4;return _0x529474;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x536c4b,_0x317d77))[_0xfdd4('0x29')](handleError(_0x536c4b,null));};exports[_0xfdd4('0x10d')]=function(_0x18ad0c,_0x5ba916,_0x2d3c9f){var _0x5de8d0={'where':{}},_0x4f2eea={},_0x3341ae={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfdd4('0xbd')]({'where':{'id':_0x18ad0c[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x5ba916,null))[_0xfdd4('0x20')](function(_0x20c9f6){if(_0x20c9f6){_0x4f2eea[_0xfdd4('0x4e')]=_[_0xfdd4('0x4a')](db[_0xfdd4('0xcc')]['rawAttributes']);_0x4f2eea[_0xfdd4('0x49')]=_[_0xfdd4('0x4a')](_0x18ad0c[_0xfdd4('0x49')]);_0x4f2eea['filters']=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],_0x4f2eea['query']);_0x5de8d0[_0xfdd4('0x4d')]=_[_0xfdd4('0x4c')](_0x4f2eea[_0xfdd4('0x4e')],qs[_0xfdd4('0x4f')](_0x18ad0c['query']['fields']));_0x5de8d0[_0xfdd4('0x4d')]=_0x5de8d0['attributes'][_0xfdd4('0x50')]?_0x5de8d0[_0xfdd4('0x4d')]:_0x4f2eea[_0xfdd4('0x4e')];if(!_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x51')]('nolimit')){_0x5de8d0[_0xfdd4('0x2f')]=qs[_0xfdd4('0x2f')](_0x18ad0c['query'][_0xfdd4('0x2f')]);_0x5de8d0[_0xfdd4('0x31')]=qs[_0xfdd4('0x31')](_0x18ad0c['query'][_0xfdd4('0x31')]);}_0x5de8d0['order']=qs[_0xfdd4('0x10a')](_0x18ad0c['query']['sort']);_0x5de8d0[_0xfdd4('0x7e')]=qs[_0xfdd4('0x4b')](_[_0xfdd4('0x52')](_0x18ad0c[_0xfdd4('0x49')],_0x4f2eea[_0xfdd4('0x4b')]));_0x5de8d0[_0xfdd4('0x7e')]['ChatInteractionId']=_0x20c9f6['id'];if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0x10e')]){_0x5de8d0[_0xfdd4('0x7e')]=_['merge'](_0x5de8d0['where'],{'$or':_[_0xfdd4('0x40')](_0x5de8d0['attributes'],function(_0xa03de8){var _0x141042={};_0x141042[_0xa03de8]={'$like':'%'+_0x18ad0c[_0xfdd4('0x49')]['filter']+'%'};return _0x141042;})});}_0x5de8d0['where'][_0xfdd4('0xf8')]=![];if(_0x18ad0c[_0xfdd4('0x49')]['id']){_0x5de8d0[_0xfdd4('0x7e')]['id']={'$gt':_0x18ad0c[_0xfdd4('0x49')]['id']};}_0x5de8d0=_[_0xfdd4('0x3b')]({},_0x5de8d0,_0x18ad0c[_0xfdd4('0xb8')]);return db[_0xfdd4('0xcc')][_0xfdd4('0x30')]({'where':_0x5de8d0[_0xfdd4('0x7e')]})[_0xfdd4('0x20')](function(_0x21e917){_0x3341ae['count']=_0x21e917;_0x5de8d0[_0xfdd4('0xb7')]=[];if(_0x18ad0c[_0xfdd4('0x49')]['includeAgent']){_0x5de8d0[_0xfdd4('0xb7')][_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41'),_0xfdd4('0xf2')]});}if(_0x18ad0c[_0xfdd4('0x49')][_0xfdd4('0xb6')]){_0x5de8d0[_0xfdd4('0xb7')]=[{'all':!![]}];}return db[_0xfdd4('0xcc')][_0xfdd4('0x10f')](_0x5de8d0);})[_0xfdd4('0x20')](function(_0x1c18f8){_0x3341ae['rows']=_0x1c18f8;return _0x3341ae;});}})[_0xfdd4('0x20')](respondWithFilteredResult(_0x5ba916,_0x5de8d0))[_0xfdd4('0x29')](handleError(_0x5ba916,null));};exports['addTags']=function(_0x31db99,_0x692aa1,_0x1003d4){return db['ChatInteraction'][_0xfdd4('0x67')]({'where':{'id':_0x31db99[_0xfdd4('0xba')]['id']}})[_0xfdd4('0x20')](handleEntityNotFound(_0x692aa1,null))['then'](function(_0x5b5edb){if(_0x5b5edb){return _0x5b5edb[_0xfdd4('0x110')](_0x31db99[_0xfdd4('0x3c')][_0xfdd4('0x107')],_[_0xfdd4('0x108')](_0x31db99[_0xfdd4('0x3c')],[_0xfdd4('0x107'),'id'])||{})[_0xfdd4('0x111')](function(){return db[_0xfdd4('0x75')][_0xfdd4('0x10f')]({'attributes':['id',_0xfdd4('0x38'),'color'],'where':{'id':_0x31db99['body']['ids']}});})[_0xfdd4('0x20')](function(_0x1a8c71){socket[_0xfdd4('0x112')](_0xfdd4('0x113'),{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]});return{'id':Number(_0x31db99[_0xfdd4('0xba')]['id']),'tags':_0x1a8c71||[]};});}})[_0xfdd4('0x20')](respondWithResult(_0x692aa1,null))['catch'](handleError(_0x692aa1,null));};exports[_0xfdd4('0x114')]=function(_0x456534,_0x1178b3,_0x272948){return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x456534[_0xfdd4('0xba')]['id']}})['then'](handleEntityNotFound(_0x1178b3,null))['then'](function(_0x360298){if(_0x360298){return _0x360298['removeTags'](_0x456534['query'][_0xfdd4('0x107')]);}})['then'](respondWithStatusCode(_0x1178b3,null))[_0xfdd4('0x29')](handleError(_0x1178b3,null));};exports[_0xfdd4('0xe2')]=function(_0x39f38f,_0x4a9e25){var _0x535d2b=moment()[_0xfdd4('0x115')]()[_0xfdd4('0x9d')]();var _0x24b726=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],'server','files',_0xfdd4('0x116'));var _0x260fe6=path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x118'),_0xfdd4('0x119'));var _0x4d52d3=path['join'](_0x24b726,_0x535d2b);var _0x31124f=util['format'](_0xfdd4('0x11a'),_0x39f38f['params']['id'],_0x535d2b);var _0x38e24c=path[_0xfdd4('0xe0')](_0x24b726,_0x31124f);var _0x25f9c9=[];_0x25f9c9[_0xfdd4('0x46')]({'model':db['User'],'as':_0xfdd4('0x77'),'attributes':['id',_0xfdd4('0x41')],'raw':!![]});_0x25f9c9['push']({'model':db[_0xfdd4('0xd0')],'as':'Contact','attributes':['id','firstName',_0xfdd4('0x11b')],'raw':!![]});if(_0x39f38f['query'][_0xfdd4('0x119')]){_0x25f9c9[_0xfdd4('0x46')]({'model':db[_0xfdd4('0xdd')],'as':_0xfdd4('0xdd'),'raw':!![]});}var _0x1a5c91=[{'model':db[_0xfdd4('0xcc')],'as':_0xfdd4('0xe9'),'attributes':['id','body',_0xfdd4('0xf5'),_0xfdd4('0xf7'),'secret','read'],'include':_0x25f9c9}];_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x11c')],'as':_0xfdd4('0x11d'),'attributes':['id','name']});_0x1a5c91[_0xfdd4('0x46')]({'model':db[_0xfdd4('0x77')],'as':'Owner','attributes':['id','fullname']});return db[_0xfdd4('0x9f')]['find']({'where':{'id':_0x39f38f['params']['id']},'include':_0x1a5c91})[_0xfdd4('0x20')](handleEntityNotFound(_0x4a9e25,null))[_0xfdd4('0x20')](function(_0xbde236){if(_0xbde236){var _0x2de8b3=_0xbde236[_0xfdd4('0x11e')]({'plain':!![]});fs[_0xfdd4('0x11f')](_0x4d52d3);var _0x1563a5={'channel':_0xfdd4('0x120'),'account':_0x2de8b3[_0xfdd4('0x11d')][_0xfdd4('0x38')],'agent':_0x2de8b3[_0xfdd4('0x121')]?_0x2de8b3[_0xfdd4('0x121')]['fullname']:_0xfdd4('0x122'),'createdAt':moment(_0x2de8b3[_0xfdd4('0xf5')])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'closedAt':_0x2de8b3['closed']?moment(_0x2de8b3[_0xfdd4('0x124')])[_0xfdd4('0xea')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfdd4('0x9d')]():'','disposition':_0x2de8b3['disposition'],'chatInfo':{'browser':_0x2de8b3[_0xfdd4('0x125')],'os':_0x2de8b3[_0xfdd4('0x126')],'referer':_0x2de8b3[_0xfdd4('0x127')],'customerIp':_0x2de8b3['customerIp'],'customerPort':_0x2de8b3[_0xfdd4('0x128')]?_0x2de8b3[_0xfdd4('0x128')]:_0xfdd4('0x122')},'messages':_(_0x2de8b3[_0xfdd4('0xe9')])['tail']()[_0xfdd4('0x10e')]({'secret':![]})[_0xfdd4('0x40')](function(_0x46e0e2){if(_0x46e0e2['Attachment']){var _0x306fc1=path[_0xfdd4('0xe0')](_0x260fe6,_0x46e0e2['Attachment'][_0xfdd4('0xd8')]);if(fs[_0xfdd4('0x129')](_0x306fc1)){fs[_0xfdd4('0x12a')](_0x306fc1)[_0xfdd4('0x12b')](fs[_0xfdd4('0x12c')](path['join'](_0x4d52d3,_0x46e0e2[_0xfdd4('0xdd')][_0xfdd4('0xd8')])));}}return{'date':moment(_0x46e0e2['createdAt'])[_0xfdd4('0xea')](_0xfdd4('0x123'))[_0xfdd4('0x9d')](),'sender':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?_0x46e0e2[_0xfdd4('0x77')]?_0x46e0e2[_0xfdd4('0x77')][_0xfdd4('0x41')]:'System':_0x46e0e2['Contact'][_0xfdd4('0x12e')]+(_0x46e0e2['Contact']['lastName']?'\x20'+_0x46e0e2[_0xfdd4('0x6d')]['lastName']:''),'body':_0x46e0e2[_0xfdd4('0xdd')]?_0x46e0e2[_0xfdd4('0xdd')]['basename']:_0x46e0e2[_0xfdd4('0x3c')],'direction':_0x46e0e2[_0xfdd4('0xf7')]===_0xfdd4('0x12d')?'A':'C','secret':_0x46e0e2[_0xfdd4('0xf8')],'read':_0x46e0e2[_0xfdd4('0x85')],'attachment':_0x46e0e2['Attachment']};})[_0xfdd4('0x69')]()};return ejs[_0xfdd4('0x12f')](path[_0xfdd4('0xe0')](config[_0xfdd4('0xe5')],_0xfdd4('0x117'),_0xfdd4('0x130'),_0xfdd4('0x131')),{'interaction':_0x1563a5})[_0xfdd4('0x20')](function(_0x5ac931){var _0x2b8e2b=path['join'](_0x4d52d3,_0xfdd4('0x132')+_0x2de8b3['id']+'-'+_0x535d2b+_0xfdd4('0x133'));var _0x4d5a93={'path':_0x2b8e2b,'channel':'Chat','interactionId':_0x2de8b3['id']};return pdf['createPdfFromHTML'](_0x5ac931,_0x4d5a93);})[_0xfdd4('0x20')](function(){return new BPromise(function(_0x4a323c,_0x384933){zipdir(_0x4d52d3,{'saveTo':_0x38e24c},function(_0x13a826,_0x4ce772){if(_0x13a826)return _0x384933(_0x13a826);return _0x4a323c(_0x4ce772);});})['then'](function(){return new BPromise(function(_0x199881,_0x1fa795){rimraf(_0x4d52d3,function(_0x453527){if(_0x453527)_0x1fa795(_0x453527);return _0x199881();});});})[_0xfdd4('0x20')](function(){return _0x4a9e25[_0xfdd4('0xe2')](_0x38e24c,_0x31124f,function(_0x4fa06b){if(_0x4fa06b){console['log'](_0xfdd4('0x134'),_0x4fa06b);}else{fs['unlinkSync'](_0x38e24c);}});});});}else{return _0x4a9e25[_0xfdd4('0x2a')](0xc8);}})[_0xfdd4('0x29')](handleError(_0x4a9e25,null));}; \ No newline at end of file +var _0x5f2f=['vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','pick','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','ids','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','status','end','limit','undefined','count','set','Content-Range','json','apply','save','update','name','merge','body','contact','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','union','User','UserId','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','contactName','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','include','options','create','destroy','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow'];(function(_0x70504d,_0x34e810){var _0x47e29b=function(_0x119dfe){while(--_0x119dfe){_0x70504d['push'](_0x70504d['shift']());}};_0x47e29b(++_0x34e810);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1409ee,_0x5b0325){_0x1409ee=_0x1409ee-0x0;var _0x1fc5ac=_0x5f2f[_0x1409ee];return _0x1fc5ac;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f2('0x14'))(_0xf5f2('0x15'));var utils=require('../../config/utils');var config=require(_0xf5f2('0x16'));var licenseUtil=require(_0xf5f2('0x17'));var db=require(_0xf5f2('0x18'))['db'];config[_0xf5f2('0x19')]=_[_0xf5f2('0x1a')](config[_0xf5f2('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf5f2('0x1b'))(new Redis(config[_0xf5f2('0x19')]));require(_0xf5f2('0x1c'))[_0xf5f2('0x1d')](socket);var jayson=require(_0xf5f2('0x1e'));var client=jayson['client'][_0xf5f2('0x1f')]({'port':0x232b});var client9004=jayson[_0xf5f2('0x20')][_0xf5f2('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1b6dd2,_0x23e23a,_0x3a9dbb,_0xdb61b3){return new BPromise(function(_0x395a5a,_0x11f702){var _0x228ace=_0xdb61b3||client;return _0x228ace[_0xf5f2('0x21')](_0x1b6dd2,_0x3a9dbb)[_0xf5f2('0x22')](function(_0x4ff59b){logger[_0xf5f2('0x23')](_0xf5f2('0x24'),_0x23e23a,_0xf5f2('0x25'));logger[_0xf5f2('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x23e23a,_0xf5f2('0x25'),JSON[_0xf5f2('0x27')](_0x4ff59b));if(_0x4ff59b['error']){if(_0x4ff59b['error'][_0xf5f2('0x28')]===0x1f4){logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x11f702(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}logger[_0xf5f2('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);return _0x395a5a(_0x4ff59b[_0xf5f2('0x29')][_0xf5f2('0x2a')]);}else{logger[_0xf5f2('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x23e23a,'request\x20sent');_0x395a5a(_0x4ff59b[_0xf5f2('0x2b')][_0xf5f2('0x2a')]);}})[_0xf5f2('0x2c')](function(_0x1a5bb3){logger[_0xf5f2('0x29')](_0xf5f2('0x24'),_0x23e23a,_0x1a5bb3);_0x11f702(_0x1a5bb3);});});}function respondWithStatusCode(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0xcc;return function(_0x294414){if(_0x294414){return _0x13a3be['sendStatus'](_0x281ec8);}return _0x13a3be[_0xf5f2('0x2d')](_0x281ec8)[_0xf5f2('0x2e')]();};}function respondWithResult(_0x375ca8,_0x31bfcb){_0x31bfcb=_0x31bfcb||0xc8;return function(_0x198c73){if(_0x198c73){return _0x375ca8[_0xf5f2('0x2d')](_0x31bfcb)['json'](_0x198c73);}};}function respondWithFilteredResult(_0x53cb96,_0x22c826){return function(_0x14c829){if(_0x14c829){var _0x11c771=typeof _0x22c826['offset']==='undefined'&&typeof _0x22c826[_0xf5f2('0x2f')]===_0xf5f2('0x30');var _0x17394a=_0x14c829[_0xf5f2('0x31')];var _0x1b381e=_0x11c771?0x0:_0x22c826['offset'];var _0x52e959=_0x11c771?_0x14c829[_0xf5f2('0x31')]:_0x22c826['offset']+_0x22c826[_0xf5f2('0x2f')];var _0x58a4df;if(_0x52e959>=_0x17394a){_0x52e959=_0x17394a;_0x58a4df=0xc8;}else{_0x58a4df=0xce;}_0x53cb96[_0xf5f2('0x2d')](_0x58a4df);return _0x53cb96[_0xf5f2('0x32')](_0xf5f2('0x33'),_0x1b381e+'-'+_0x52e959+'/'+_0x17394a)[_0xf5f2('0x34')](_0x14c829);}return null;};}function patchUpdates(_0x256bd9){return function(_0x277eee){try{jsonpatch[_0xf5f2('0x35')](_0x277eee,_0x256bd9,!![]);}catch(_0x2c0e05){return BPromise['reject'](_0x2c0e05);}return _0x277eee[_0xf5f2('0x36')]();};}function saveUpdates(_0x43e4ff,_0x4590ec){return function(_0x43c77d){if(_0x43c77d){return _0x43c77d[_0xf5f2('0x37')](_0x43e4ff)[_0xf5f2('0x22')](function(_0x297c0c){return _0x297c0c;});}return null;};}function removeEntity(_0x48d64d,_0x144646){return function(_0xf503e8){if(_0xf503e8){return _0xf503e8['destroy']()[_0xf5f2('0x22')](function(){_0x48d64d['status'](0xcc)[_0xf5f2('0x2e')]();});}};}function handleEntityNotFound(_0x3930fb,_0x2a2c31){return function(_0x2e3cca){if(!_0x2e3cca){_0x3930fb['sendStatus'](0x194);}return _0x2e3cca;};}function handleError(_0x5a98d7,_0x41088b){_0x41088b=_0x41088b||0x1f4;return function(_0x46ad4a){logger[_0xf5f2('0x29')](_0x46ad4a['stack']);if(_0x46ad4a[_0xf5f2('0x38')]){delete _0x46ad4a['name'];}_0x5a98d7[_0xf5f2('0x2d')](_0x41088b)['send'](_0x46ad4a);};}function getMustacheRender(_0x46f464,_0x456764){return Mustache['render'](_0x46f464,_[_0xf5f2('0x39')](_0x456764[_0xf5f2('0x3a')],{'contact':_0x456764[_0xf5f2('0x3b')],'message':_0x456764[_0xf5f2('0x2a')],'agent':_0x456764['agent'],'interaction':_0x456764['interaction'],'account':_0x456764[_0xf5f2('0x3c')]}))||'';}function getInteractionUsers(_0x140a11,_0x22b20c){return new BPromise(function(_0x2d4400,_0x2c7f65){try{if(_0x22b20c[_0x140a11['id']]){_0x140a11[_0xf5f2('0x3d')]=_[_0xf5f2('0x3e')](_0x22b20c[_0x140a11['id']],function(_0x4c0ac7){return{'id':_0x4c0ac7['id'],'fullname':_0x4c0ac7[_0xf5f2('0x3f')]};});}}catch(_0x3b4ea6){_0x2c7f65(_0x3b4ea6);}_0x2d4400(_0x140a11);});}function getInteractionTags(_0x536501,_0xc6a1ae){return new BPromise(function(_0x3f3895,_0x71b0e7){try{if(_0x536501[_0xf5f2('0x40')]){_0x536501[_0xf5f2('0x41')]=[];_0x536501[_0xf5f2('0x40')][_0xf5f2('0x42')](',')[_0xf5f2('0x43')](function(_0x574f24){_0x536501[_0xf5f2('0x41')][_0xf5f2('0x44')](_0xc6a1ae[_0x574f24]);});}delete _0x536501[_0xf5f2('0x40')];}catch(_0x4a8e39){_0x71b0e7(_0x4a8e39);}_0x3f3895(_0x536501);});}function updateChatInteraction(_0x509dbc,_0x59eb00,_0x76d21b){return new BPromise(function(_0x2ad13c,_0x4c8d8e){return getInteractionUsers(_0x509dbc,_0x76d21b)[_0xf5f2('0x22')](function(_0xeed03d){return getInteractionTags(_0xeed03d,_0x59eb00);})[_0xf5f2('0x22')](function(_0x31f86c){_0x2ad13c(_0x31f86c);})[_0xf5f2('0x2c')](function(_0x2b3b1c){_0x4c8d8e(_0x2b3b1c);});});}exports[_0xf5f2('0x45')]=function(_0x212e90,_0x40c322){var _0x106062={},_0x444317={},_0x4773cd={'count':0x0,'rows':[]};var _0x4252a3=_[_0xf5f2('0x3e')](db['ChatInteraction'][_0xf5f2('0x46')],function(_0x578c93){return{'name':_0x578c93[_0xf5f2('0x47')],'type':_0x578c93[_0xf5f2('0x48')][_0xf5f2('0x49')]};});_0x444317[_0xf5f2('0x4a')]=_[_0xf5f2('0x3e')](_0x4252a3,_0xf5f2('0x38'));_0x444317['query']=_[_0xf5f2('0x4b')](_0x212e90[_0xf5f2('0x4c')]);_0x444317[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x444317[_0xf5f2('0x4a')],_0x444317[_0xf5f2('0x4c')]);_0x106062[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x444317['model'],qs[_0xf5f2('0x50')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x106062['attributes']=_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x106062[_0xf5f2('0x4f')]:_0x444317['model'];if(!_0x212e90['query'][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x106062['limit']=qs[_0xf5f2('0x2f')](_0x212e90['query'][_0xf5f2('0x2f')]);_0x106062['offset']=qs[_0xf5f2('0x54')](_0x212e90['query'][_0xf5f2('0x54')]);}_0x106062[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x212e90[_0xf5f2('0x4c')]['sort']);_0x106062[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_['pick'](_0x212e90['query'],_0x444317[_0xf5f2('0x4d')]),_0x4252a3);var _0x3dc0c4=[];var _0x57782c=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')]('id')[_0xf5f2('0x59')](_0xf5f2('0x38'))['field']('color')[_0xf5f2('0x5a')](_0xf5f2('0x5b'));var _0x4b62fc=squel[_0xf5f2('0x58')]()[_0xf5f2('0x59')](_0xf5f2('0x5c'))[_0xf5f2('0x59')](_0xf5f2('0x5d'))[_0xf5f2('0x59')](_0xf5f2('0x5e'))['from']('user_has_chat_interactions','ui')[_0xf5f2('0x5f')](_0xf5f2('0x60'),'u',_0xf5f2('0x61'));var _0x46a905=squel[_0xf5f2('0x58')]()['from'](_0xf5f2('0x62'),'i')[_0xf5f2('0x5f')](_0xf5f2('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf5f2('0x5f')]('users','o',_0xf5f2('0x64'))[_0xf5f2('0x5f')](_0xf5f2('0x65'),'a',_0xf5f2('0x66'))['left_join']('chat_messages','me',_0xf5f2('0x67'))['left_join'](_0xf5f2('0x68'),'it',_0xf5f2('0x69'))['left_join'](_0xf5f2('0x5b'),'t',_0xf5f2('0x6a'));var _0x2a8f6d=squel['expr']();var _0x397b99=[];var _0xcf7a50=squel[_0xf5f2('0x6b')]();var _0x4579f4;if(_0x212e90['query'][_0xf5f2('0x6c')]){_0x4579f4=as['parseSearch'](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x6c')]);var _0x2e6f5d=_0x4579f4[_0xf5f2('0x6d')];for(var _0x9f210e=0x0;_0x9f210e<_0x4579f4['conditions'][_0xf5f2('0x51')];_0x9f210e++){var _0xacd80=_0x4579f4[_0xf5f2('0x6e')][_0x9f210e];var _0x212639='i';var _0x2c5733=_['find'](_0x4252a3,[_0xf5f2('0x38'),_0xacd80['field']]);if(!_0x2c5733){switch(_0xacd80['field']){case _0xf5f2('0x6f'):if(_0xacd80['value']==0x1){_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80[_0xf5f2('0x59')]+_0xf5f2('0x71'));}else{_0x46a905[_0xf5f2('0x70')]('`'+_0xacd80['field']+_0xf5f2('0x72'));}break;case _0xf5f2('0x73'):if(_0xacd80[_0xf5f2('0x74')]===_0xf5f2('0x75')){if(_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')]('\x20')[_0xf5f2('0x51')]>0x1){_0x2a8f6d[_0x2e6f5d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf5f2('0x77')](_0xacd80[_0xf5f2('0x76')]),null);}else{var _0xb39a6e='%'+_0xacd80[_0xf5f2('0x76')]+'%';_0x2a8f6d[_0x2e6f5d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xb39a6e,_0xb39a6e,_0xb39a6e);}}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,['name',_0xf5f2('0x79')]);_0xacd80[_0xf5f2('0x59')]='ContactId';_0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x7d'):var _0x3a0e75=_0xacd80[_0xf5f2('0x76')][_0xf5f2('0x42')](',')[_0xf5f2('0x3e')](function(_0x53284f){return Number(_0x53284f);});_0x3a0e75[_0xf5f2('0x43')](function(_0x3f475e){_0xcf7a50['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f475e+',%');});_0x397b99=_[_0xf5f2('0x7e')](_0x397b99,_0x3a0e75);break;case _0xf5f2('0x7f'):if(_0xacd80[_0xf5f2('0x74')]==='$substring'){_0x2a8f6d[_0x2e6f5d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xacd80['value']+'%',null);}else{_0x2c5733=_[_0xf5f2('0x78')](_0x4252a3,[_0xf5f2('0x38'),_0xf5f2('0x80')]);_0xacd80[_0xf5f2('0x59')]=_0xf5f2('0x80');_0x5a143f=as['buildExpression'](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x2e')]);}break;case _0xf5f2('0x3a'):_0x5a143f=as[_0xf5f2('0x7a')]('me',null,_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value']['end']);break;}}else{var _0x5a143f=as[_0xf5f2('0x7a')](_0x212639,_0x2c5733[_0xf5f2('0x48')],_0xacd80);_0x2a8f6d[_0x2e6f5d](_0x5a143f[_0xf5f2('0x7b')],_0x5a143f[_0xf5f2('0x76')][_0xf5f2('0x7c')],_0x5a143f['value'][_0xf5f2('0x2e')]);}}}else{var _0x43c732=_(_0x212e90[_0xf5f2('0x4c')])[_0xf5f2('0x4b')]()[_0xf5f2('0x3e')](function(_0x55748d){return _[_0xf5f2('0x81')](_0x4252a3,[_0xf5f2('0x38'),_0x55748d])?_0x55748d:undefined;})['compact']()[_0xf5f2('0x76')]();if(!_[_0xf5f2('0x82')](_0x43c732)){_0x43c732[_0xf5f2('0x43')](function(_0x30ac41){if(_0x30ac41==='ChatWebsiteId'){_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x83'),[][_0xf5f2('0x84')](_0x212e90[_0xf5f2('0x4c')][_0x30ac41]));}else if(_0x30ac41===_0xf5f2('0x85')){var _0x4f47e1=JSON['parse'](_0x212e90[_0xf5f2('0x4c')][_0x30ac41])[_0xf5f2('0x86')];var _0x17eb69=JSON[_0xf5f2('0x87')](_0x212e90['query'][_0x30ac41])['$lte'];_0x46a905[_0xf5f2('0x57')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f47e1,_0x17eb69);}else{if(_0x212e90['query'][_0x30ac41]==='null'){_0x46a905['where']('i.'+_0x30ac41+_0xf5f2('0x88'));}else{_0x46a905[_0xf5f2('0x57')]('i.'+_0x30ac41+_0xf5f2('0x89'),_0x212e90[_0xf5f2('0x4c')][_0x30ac41]);}}});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8a')]==0x1){_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8b'));}else{_0x46a905[_0xf5f2('0x70')](_0xf5f2('0x8c'));}}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]){_0x397b99=_[_0xf5f2('0x8e')](_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')])?_0x212e90[_0xf5f2('0x4c')]['tag']:new Array(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x8d')]);_0x397b99[_0xf5f2('0x43')](function(_0x2811ad){_0xcf7a50['or'](_0xf5f2('0x8f'),'%,'+_0x2811ad+',%');});}if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x90')]){var _0xcf48eb=_0x212e90['query'][_0xf5f2('0x90')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0xcf48eb)){_0x2a8f6d['or']('i.id\x20LIKE\x20?',_0xcf48eb+'%');}else{_0x2a8f6d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xcf48eb))['or'](_0xf5f2('0x91'),_0xcf48eb+'%');}}}_0x46a905[_0xf5f2('0x57')](_0x2a8f6d);_0x46a905[_0xf5f2('0x92')](_0xf5f2('0x93'));var _0x145d4d={'type':db[_0xf5f2('0x94')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2fb1a6=_0x46a905['clone']();_0x2fb1a6[_0xf5f2('0x59')](_0xf5f2('0x93'));_0x2fb1a6['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf5f2('0x6f'));if(_0x106062[_0xf5f2('0x55')]){_0x106062['order'][_0xf5f2('0x43')](function(_0x388b32){var _0x49e363=_0x388b32[0x0]===_0xf5f2('0x95')?_0x388b32[0x0]:'i.'+_0x388b32[0x0];_0x46a905[_0xf5f2('0x55')](_0x49e363,_0x388b32[0x1]===_0xf5f2('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x397b99)){_0x46a905[_0xf5f2('0x70')](_0xcf7a50);_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x97'),_0x397b99);}BPromise[_0xf5f2('0x98')]()[_0xf5f2('0x22')](function(){if(!_0x4579f4){if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return;_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9a'));_0x46a905[_0xf5f2('0x57')](_0xf5f2('0x9a'));return;}if(_0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9c')]!==_0xf5f2('0x9d'))return;return _0x212e90[_0xf5f2('0x9b')][_0xf5f2('0x9e')]({'attributes':['id'],'raw':!![]})[_0xf5f2('0x22')](function(_0x29a9d4){if(_[_0xf5f2('0x82')](_0x29a9d4)){_0x2fb1a6[_0xf5f2('0x57')](_0xf5f2('0x9f'));_0x46a905['where'](_0xf5f2('0x9f'));}else{_0x2fb1a6[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));_0x46a905[_0xf5f2('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf5f2('0x3e')](_0x29a9d4,'id'));}});})[_0xf5f2('0x22')](function(){if(_0x212e90[_0xf5f2('0x9b')]['role']==='agent'&&!_0x4579f4&&!_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x99')])return[];return db[_0xf5f2('0xa0')]['query'](_0x2fb1a6['toString'](),_0x145d4d);})[_0xf5f2('0x22')](function(_0xcdc6fd){_0x4773cd[_0xf5f2('0x31')]=_0xcdc6fd['length'];if(_0x4773cd['count']===0x0)return[];return db['sequelize']['query'](_0x57782c['toString'](),_0x145d4d)[_0xf5f2('0x22')](function(_0x561bab){_0x3dc0c4=_[_0xf5f2('0xa1')](_0x561bab,'id');_0x145d4d=_[_0xf5f2('0x39')](_0x145d4d,{'model':db[_0xf5f2('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x212e90[_0xf5f2('0x4c')][_0xf5f2('0x50')]){_0x106062[_0xf5f2('0x4f')][_0xf5f2('0x43')](function(_0x40e921){_0x46a905[_0xf5f2('0x59')]('i.'+_0x40e921);});}else{_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa3'),_0xf5f2('0x6f'));_0x46a905[_0xf5f2('0x59')]('a.key',_0xf5f2('0xa4'));_0x46a905[_0xf5f2('0x59')]('a.mandatoryDisposition',_0xf5f2('0xa5'));_0x46a905[_0xf5f2('0x59')]('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',_0xf5f2('0x95'));_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xa6'));_0x46a905['field'](_0xf5f2('0xa7'),_0xf5f2('0xa8'));_0x46a905['field'](_0xf5f2('0xa9'),_0xf5f2('0xaa'));_0x46a905[_0xf5f2('0x59')]('c.email',_0xf5f2('0xab'));_0x46a905['field'](_0xf5f2('0xac'),'Contact.phone');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xad'),_0xf5f2('0xae'));_0x46a905[_0xf5f2('0x59')]('c.fax',_0xf5f2('0xaf'));_0x46a905['field']('o.fullname','Owner.fullname');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb0'),'Owner.internal');_0x46a905[_0xf5f2('0x59')](_0xf5f2('0xb1'),_0xf5f2('0x40'));}if(_0x106062[_0xf5f2('0x2f')])_0x46a905[_0xf5f2('0x2f')](_0x106062[_0xf5f2('0x2f')]);if(_0x106062['offset'])_0x46a905[_0xf5f2('0x54')](_0x106062[_0xf5f2('0x54')]);return db['sequelize'][_0xf5f2('0x4c')](_0x46a905[_0xf5f2('0xb2')](),_0x145d4d);})['then'](function(_0x32301a){if(_0x32301a[_0xf5f2('0x51')]>0x0)_0x4b62fc[_0xf5f2('0x57')](_0xf5f2('0xb3'),_[_0xf5f2('0x3e')](_0x32301a,'id'));return db[_0xf5f2('0xa0')]['query'](_0x4b62fc[_0xf5f2('0xb2')](),_0x145d4d)[_0xf5f2('0x22')](function(_0x13fcb0){var _0x792c75=_[_0xf5f2('0xb4')](_0x13fcb0,_0xf5f2('0xb5'));var _0x162c13=[];_0x32301a[_0xf5f2('0x43')](function(_0x3e4e40){_0x162c13['push'](updateChatInteraction(_0x3e4e40,_0x3dc0c4,_0x792c75));});return BPromise[_0xf5f2('0xb6')](_0x162c13);});});})[_0xf5f2('0x22')](function(_0xdbb2cd){_0x4773cd[_0xf5f2('0xb7')]=_0xdbb2cd;return _0x4773cd;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x40c322,_0x106062))[_0xf5f2('0x2c')](handleError(_0x40c322,null));};exports[_0xf5f2('0xb8')]=function(_0x56f4b4,_0x33cfe7){var _0x40d0eb={'raw':![],'where':{'id':_0x56f4b4['params']['id']}},_0x4c138c={};_0x4c138c[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xa2')][_0xf5f2('0x46')]);_0x4c138c['query']=_[_0xf5f2('0x4b')](_0x56f4b4[_0xf5f2('0x4c')]);_0x4c138c[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x4c138c[_0xf5f2('0x4a')],_0x4c138c['query']);_0x40d0eb[_0xf5f2('0x4f')]=_[_0xf5f2('0x4e')](_0x4c138c['model'],qs[_0xf5f2('0x50')](_0x56f4b4[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x40d0eb[_0xf5f2('0x4f')]=_0x40d0eb['attributes'][_0xf5f2('0x51')]?_0x40d0eb[_0xf5f2('0x4f')]:_0x4c138c[_0xf5f2('0x4a')];if(_0x56f4b4['query']['includeAll']){_0x40d0eb[_0xf5f2('0xb9')]=[{'all':!![]}];}_0x40d0eb=_[_0xf5f2('0x39')]({},_0x40d0eb,_0x56f4b4[_0xf5f2('0xba')]);return db[_0xf5f2('0xa2')][_0xf5f2('0x78')](_0x40d0eb)[_0xf5f2('0x22')](handleEntityNotFound(_0x33cfe7,null))['then'](respondWithResult(_0x33cfe7,null))[_0xf5f2('0x2c')](handleError(_0x33cfe7,null));};exports['create']=function(_0x151f13,_0x1624a4){return db[_0xf5f2('0xa2')][_0xf5f2('0xbb')](_0x151f13[_0xf5f2('0x3a')],{})[_0xf5f2('0x22')](respondWithResult(_0x1624a4,0xc9))['catch'](handleError(_0x1624a4,null));};exports[_0xf5f2('0x37')]=function(_0x409ed1,_0x457b53){if(_0x409ed1[_0xf5f2('0x3a')]['id']){delete _0x409ed1[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x409ed1['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x457b53,null))['then'](saveUpdates(_0x409ed1['body'],null))['then'](respondWithResult(_0x457b53,null))[_0xf5f2('0x2c')](handleError(_0x457b53,null));};exports[_0xf5f2('0xbc')]=function(_0x568806,_0x3487df){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x568806[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3487df,null))[_0xf5f2('0x22')](removeEntity(_0x3487df,null))[_0xf5f2('0x2c')](handleError(_0x3487df,null));};exports[_0xf5f2('0xbe')]=function(_0x5d3ca7,_0x29f7bd){return db[_0xf5f2('0xa2')]['describe']()[_0xf5f2('0x22')](respondWithResult(_0x29f7bd,null))[_0xf5f2('0x2c')](handleError(_0x29f7bd,null));};exports[_0xf5f2('0xbf')]=function(_0x1583bb,_0x176974){var _0x8b591c=_0x1583bb[_0xf5f2('0xbd')]['id'];var _0x2c242b;var _0x155007;var _0x4782da;return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x8b591c}})[_0xf5f2('0x22')](function(_0x31dbfa){_0x2c242b=_0x31dbfa;return db['ChatWebsite'][_0xf5f2('0xc0')]({'where':{'id':_0x31dbfa['ChatWebsiteId']},'attributes':['id',_0xf5f2('0xc1'),_0xf5f2('0xc2'),_0xf5f2('0xc3'),_0xf5f2('0xc4'),'vidaooMetadata'],'raw':!![]});})[_0xf5f2('0x22')](function(_0x5a104b){if(_0x5a104b&&_0x5a104b[_0xf5f2('0xc1')]&&_0x5a104b['vidaooEscalation']){_0x155007=_0x5a104b;var _0x3310cb={'interaction':{'id':_0x8b591c},'agent':{'id':_0x1583bb[_0xf5f2('0x9b')]['id'],'name':_0x1583bb['user'][_0xf5f2('0x38')],'fullname':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0x3f')],'email':_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]},'contact':_0x1583bb[_0xf5f2('0x3a')]['contact'],'account':_0x1583bb['body'][_0xf5f2('0x3c')]};var _0x17e1eb={'rejectUnauthorized':![],'method':'POST','url':_0xf5f2('0xc6'),'headers':{'X-APIKEY':_0x5a104b[_0xf5f2('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1583bb[_0xf5f2('0x9b')][_0xf5f2('0xc5')]],'buttons':null,'topic':_0x155007[_0xf5f2('0xc3')],'note':_[_0xf5f2('0xc7')](_0x155007[_0xf5f2('0xc4')])?null:getMustacheRender(_0x155007['vidaooNote'],_0x3310cb),'metadata':null},'redirect':_0xf5f2('0xc8'),'json':!![]};try{if(!_['isNull'](_0x155007[_0xf5f2('0xc9')])){var _0x5ec0f3=getMustacheRender(_0x155007[_0xf5f2('0xc9')],_0x3310cb);var _0x4f2531=JSON[_0xf5f2('0x87')](_0x5ec0f3);_0x17e1eb['body']['metadata']=_0x4f2531;}}catch(_0x2c285c){throw new db[(_0xf5f2('0x94'))]['ValidationError'](_0xf5f2('0xca'));}return rp(_0x17e1eb);}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcc'));}})[_0xf5f2('0x22')](function(_0x25af1e){_0x4782da=_0x25af1e;if(_0x4782da['id']){var _0xd0b5d={'body':_0x4782da[_0xf5f2('0xcd')],'ChatWebsiteId':_0x155007['id'],'ChatInteractionId':_0x2c242b['id'],'direction':'out','UserId':_0x1583bb['user']['id']};return db[_0xf5f2('0xce')]['create'](_0xd0b5d,{});}else{throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xcf'));}})[_0xf5f2('0x22')](function(){return _0x2c242b[_0xf5f2('0xd0')]({'vidaooSessionId':_0x4782da['id']});})[_0xf5f2('0x22')](respondWithResult(_0x176974,null))[_0xf5f2('0x2c')](handleError(_0x176974,null));};exports[_0xf5f2('0xd1')]=function(_0x28f65b,_0x16cbd3){if(_0x28f65b[_0xf5f2('0x3a')]['id']){delete _0x28f65b[_0xf5f2('0x3a')]['id'];}return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x28f65b['params']['id']},'include':[{'model':db[_0xf5f2('0xd2')],'as':_0xf5f2('0x73')}]})[_0xf5f2('0x22')](handleEntityNotFound(_0x16cbd3,null))[_0xf5f2('0x22')](saveUpdates(_0x28f65b[_0xf5f2('0x3a')],null))[_0xf5f2('0x22')](respondWithResult(_0x16cbd3,null))[_0xf5f2('0x2c')](handleError(_0x16cbd3,null));};exports[_0xf5f2('0xd3')]=function(_0x29db4f,_0x377c68,_0xe0f288){if(_0x29db4f['body']['id']){delete _0x29db4f[_0xf5f2('0x3a')]['id'];}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x29db4f[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](function(_0x3f8794){if(!_0x3f8794){logger[_0xf5f2('0x29')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xf5f2('0xd3'),0x194,_0xf5f2('0xd4'));_0x377c68[_0xf5f2('0xd5')](0x194);}else{if(_0x3f8794[_0xf5f2('0x80')]){throw new db[(_0xf5f2('0x94'))][(_0xf5f2('0xcb'))](_0xf5f2('0xd6'));}}return _0x3f8794;})[_0xf5f2('0x22')](function(_0x356155){if(_0x356155){return _0x356155[_0xf5f2('0x37')]({'closed':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd7')],'disposition':_0x29db4f[_0xf5f2('0x3a')][_0xf5f2('0xd8')]})[_0xf5f2('0x22')](function(_0x654b1b){return _0x654b1b;});}})['then'](function(_0x25566a){return respondWithRpcPromise(_0xf5f2('0xd9'),'abandon',_0x29db4f['body'],client9004);})[_0xf5f2('0x22')](respondWithResult(_0x377c68,null))[_0xf5f2('0x2c')](handleError(_0x377c68,null));};exports[_0xf5f2('0xda')]=function(_0x2c8f4c,_0x529d6f,_0x28cc){_0x2c8f4c[_0xf5f2('0x3a')][_0xf5f2('0x38')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdc')];_0x2c8f4c[_0xf5f2('0x3a')]['basename']=_0x2c8f4c[_0xf5f2('0xdb')]['filename'];_0x2c8f4c['body'][_0xf5f2('0x48')]=_0x2c8f4c[_0xf5f2('0xdb')][_0xf5f2('0xdd')];return db[_0xf5f2('0xde')][_0xf5f2('0xbb')](_0x2c8f4c[_0xf5f2('0x3a')])[_0xf5f2('0x22')](respondWithResult(_0x529d6f,0xc9))['catch'](handleError(_0x529d6f,null));};exports[_0xf5f2('0xdf')]=function(_0x3a2862,_0x2c1160,_0x5e6c83){return db[_0xf5f2('0xa2')]['findOne']({'where':{'id':_0x3a2862['params']['id']},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null))['then'](function(_0x2389b7){if(_0x2389b7){if(_0x2389b7[_0xf5f2('0xd7')]){return _0x2c1160['status'](0x193)[_0xf5f2('0x34')]({'status':0x193,'message':_0xf5f2('0xe0')});}return db['Attachment'][_0xf5f2('0xc0')]({'where':{'id':_0x3a2862[_0xf5f2('0x4c')][_0xf5f2('0xe1')]},'raw':!![]})[_0xf5f2('0x22')](handleEntityNotFound(_0x2c1160,null));}})[_0xf5f2('0x22')](function(_0x47a28a){if(_0x47a28a){var _0x182fa7=_0x47a28a[_0xf5f2('0xe2')]!==null;var _0x4d9048=path['join'](config[_0xf5f2('0xe3')],_0xf5f2('0xe4'));if(_0x182fa7){_0x4d9048=path[_0xf5f2('0xe5')](_0x4d9048,_0xf5f2('0xe6'));}var _0x1f51d8=path[_0xf5f2('0xe5')](_0x4d9048,_0x47a28a[_0xf5f2('0xe7')]);return _0x2c1160[_0xf5f2('0xe8')](_0x1f51d8);}})['catch'](handleError(_0x2c1160,null));};exports['close']=function(_0xc86ed5,_0x5be398){var _0x34abb6=null;var _0x235c30=null;var _0x15b060=null;var _0x422e88=null;if(_0xc86ed5['body']['id']){delete _0xc86ed5[_0xf5f2('0x3a')]['id'];}if(_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]){_0x422e88=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],'server/files/chat/upload/',util[_0xf5f2('0xea')](_0xf5f2('0xeb'),Date[_0xf5f2('0xec')]()));_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xed')]=_0x422e88;}return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0xc86ed5[_0xf5f2('0xbd')]['id']},'include':[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'include':[{'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x7f')}]}]})['then'](handleEntityNotFound(_0x5be398,null))[_0xf5f2('0x22')](saveUpdates(_0xc86ed5['body'],null))[_0xf5f2('0x22')](function(_0x349efe){if(_0x349efe){_0x34abb6=_0x349efe;return db[_0xf5f2('0xef')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x99')]}});}})[_0xf5f2('0x22')](function(_0x2cd0b7){if(_0x2cd0b7){_0x15b060=_0x2cd0b7;return db[_0xf5f2('0xd2')][_0xf5f2('0x78')]({'where':{'id':_0x34abb6[_0xf5f2('0x79')]}});}})[_0xf5f2('0x22')](function(_0x2b6f46){if(_0x2b6f46){_0x235c30=_0x2b6f46;if(_0x422e88){var _0xf53f16=null;for(var _0xd45a63=0x1;_0xd45a63<_0x34abb6[_0xf5f2('0xee')][_0xf5f2('0x51')];++_0xd45a63){_0xf53f16=_0x34abb6[_0xf5f2('0xee')][_0xd45a63];var _0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')]('%s%d',_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');var _0x53e85c=_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xf1')]||util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0xf5f2('0xf3'),_0xf53f16[_0xf5f2('0x79')]);switch(_0x15b060[_0xf5f2('0xf4')]){case _0xf5f2('0xf5'):_0x33f987=_0xf53f16['UserId']?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060[_0xf5f2('0xf6')],_0xf53f16['UserId']):_0xf5f2('0xf0');break;case _0xf5f2('0xf7'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')]['alias']||_0xf53f16['User'][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;case _0xf5f2('0xf8'):_0x33f987=_0xf53f16[_0xf5f2('0x80')]?_0xf53f16[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:_0xf5f2('0xf0');break;default:_0x33f987=_0xf53f16[_0xf5f2('0x80')]?util[_0xf5f2('0xea')](_0xf5f2('0xf2'),_0x15b060['agentAlias'],_0xf53f16[_0xf5f2('0x80')]):_0xf5f2('0xf0');}var _0x3881cd=util['format'](_0xf5f2('0xf9'),moment(_0xf53f16[_0xf5f2('0x85')])['format'](_0xf5f2('0xfa')),_0xf53f16['direction']==='in'?_0x53e85c:_0x33f987,_0xf53f16[_0xf5f2('0x3a')]);if(!_0xf53f16[_0xf5f2('0xfb')]){fs['appendFileSync'](_0x422e88,_0x3881cd);}}return db[_0xf5f2('0xfc')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf5f2('0xfd')],'as':_0xf5f2('0xfe'),'raw':!![]}]});}}})['then'](function(_0x3971ee){if(_0x3971ee&&_0x3971ee[_0xf5f2('0xfe')]&&_0xc86ed5[_0xf5f2('0x3a')]){var _0xfeccdd={'tls':{'rejectUnauthorized':![]}};if(_0x3971ee[_0xf5f2('0xfe')]['service']){_0xfeccdd[_0xf5f2('0xff')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0xff')];}else{_0xfeccdd[_0xf5f2('0x100')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x100')];_0xfeccdd[_0xf5f2('0x101')]=_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x101')];_0xfeccdd['secure']=_0x3971ee[_0xf5f2('0xfe')]['secure'];}if(_0x3971ee['Smtp'][_0xf5f2('0x102')]){_0xfeccdd[_0xf5f2('0x103')]={'user':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x9b')],'pass':_0x3971ee[_0xf5f2('0xfe')][_0xf5f2('0x104')]};}return respondWithRpcPromise(_0xf5f2('0x105'),_0xf5f2('0x106'),{'account':_0xfeccdd,'message':{'from':util[_0xf5f2('0xea')](_0xf5f2('0x107'),_0x3971ee['name'],_0x3971ee['email']||_0x3971ee['Smtp'][_0xf5f2('0x9b')]),'to':_0xc86ed5['body'][_0xf5f2('0xe9')],'subject':_0xf5f2('0x108'),'text':util[_0xf5f2('0xea')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc86ed5[_0xf5f2('0x3a')][_0xf5f2('0xe9')]),'attachments':[{'path':_0x422e88}]}})['then'](function(){return _0x34abb6;})['catch'](function(_0x4d0709){console[_0xf5f2('0x29')](_0x4d0709);});}else{return _0x34abb6;}})[_0xf5f2('0x22')](respondWithStatusCode(_0x5be398,0xc8))[_0xf5f2('0x2c')](handleError(_0x5be398,null));};exports['addMessage']=function(_0x2cfa84,_0x4a22fb,_0x7cf1b6){return db[_0xf5f2('0xce')][_0xf5f2('0x78')]({'where':{'id':_0x2cfa84['params']['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4a22fb,null))['then'](function(_0x1b88b5){if(_0x1b88b5){return _0x1b88b5[_0xf5f2('0x109')](_0x2cfa84[_0xf5f2('0x3a')]['ids'],_[_0xf5f2('0x10a')](_0x2cfa84[_0xf5f2('0x3a')],['ids','id'])||{});}})[_0xf5f2('0x22')](respondWithResult(_0x4a22fb,null))[_0xf5f2('0x2c')](handleError(_0x4a22fb,null));};exports[_0xf5f2('0x10b')]=function(_0x29526c,_0x2a52e3,_0x439c9f){var _0x44adaa={'raw':![],'where':{}};var _0x3c7058={};var _0x3bcb44={'count':0x0,'rows':[]};return db[_0xf5f2('0xa2')][_0xf5f2('0xc0')]({'where':{'id':_0x29526c[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x2a52e3,null))[_0xf5f2('0x22')](function(_0x23675a){if(_0x23675a){_0x3c7058[_0xf5f2('0x4a')]=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x3c7058[_0xf5f2('0x4c')]=_[_0xf5f2('0x4b')](_0x29526c[_0xf5f2('0x4c')]);_0x3c7058['filters']=_[_0xf5f2('0x4e')](_0x3c7058[_0xf5f2('0x4a')],_0x3c7058[_0xf5f2('0x4c')]);_0x44adaa[_0xf5f2('0x4f')]=_['intersection'](_0x3c7058[_0xf5f2('0x4a')],qs['fields'](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x44adaa[_0xf5f2('0x4f')]=_0x44adaa[_0xf5f2('0x4f')][_0xf5f2('0x51')]?_0x44adaa[_0xf5f2('0x4f')]:_0x3c7058[_0xf5f2('0x4a')];if(!_0x29526c['query']['hasOwnProperty'](_0xf5f2('0x53'))){_0x44adaa[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x29526c[_0xf5f2('0x4c')]['limit']);_0x44adaa[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x44adaa[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x29526c['query']['sort']);_0x44adaa['where']=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x29526c[_0xf5f2('0x4c')],_0x3c7058['filters']));_0x44adaa[_0xf5f2('0x57')]['ChatInteractionId']=_0x23675a['id'];if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]){_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],{'$or':_[_0xf5f2('0x3e')](_0x44adaa[_0xf5f2('0x4f')],function(_0xece862){var _0x3b4121={};_0x3b4121[_0xece862]={'$like':'%'+_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x90')]+'%'};return _0x3b4121;})});}if(_0x29526c[_0xf5f2('0x4c')][_0xf5f2('0x86')]){var _0x2fa70d=_0x29526c['query'][_0xf5f2('0x86')][_0xf5f2('0x42')](',');var _0x31f018={};_0x31f018[_0x2fa70d[0x0]]={'$gte':moment(_0x2fa70d[0x1])[_0xf5f2('0xea')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44adaa[_0xf5f2('0x57')]=_[_0xf5f2('0x39')](_0x44adaa[_0xf5f2('0x57')],_0x31f018);}_0x44adaa=_[_0xf5f2('0x39')]({},_0x44adaa,_0x29526c['options']);return db[_0xf5f2('0xce')]['count']({'where':_0x44adaa[_0xf5f2('0x57')]})[_0xf5f2('0x22')](function(_0x20bb46){_0x3bcb44[_0xf5f2('0x31')]=_0x20bb46;if(_0x29526c['query'][_0xf5f2('0x10d')]){_0x44adaa[_0xf5f2('0xb9')]=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x44adaa);})[_0xf5f2('0x22')](function(_0x889f0e){_0x3bcb44['rows']=_0x889f0e;return _0x3bcb44;});}})[_0xf5f2('0x22')](respondWithFilteredResult(_0x2a52e3,_0x44adaa))[_0xf5f2('0x2c')](handleError(_0x2a52e3,null));};exports[_0xf5f2('0x10f')]=function(_0x3dcf4e,_0x4212d4,_0x2ebe4f){var _0x34fc35={'where':{}},_0x29c1ca={},_0x2cf93e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf5f2('0xc0')]({'where':{'id':_0x3dcf4e[_0xf5f2('0xbd')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x4212d4,null))[_0xf5f2('0x22')](function(_0x544db3){if(_0x544db3){_0x29c1ca['model']=_[_0xf5f2('0x4b')](db[_0xf5f2('0xce')][_0xf5f2('0x46')]);_0x29c1ca['query']=_['keys'](_0x3dcf4e[_0xf5f2('0x4c')]);_0x29c1ca[_0xf5f2('0x4d')]=_[_0xf5f2('0x4e')](_0x29c1ca[_0xf5f2('0x4a')],_0x29c1ca[_0xf5f2('0x4c')]);_0x34fc35[_0xf5f2('0x4f')]=_['intersection'](_0x29c1ca[_0xf5f2('0x4a')],qs[_0xf5f2('0x50')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x50')]));_0x34fc35['attributes']=_0x34fc35['attributes'][_0xf5f2('0x51')]?_0x34fc35['attributes']:_0x29c1ca[_0xf5f2('0x4a')];if(!_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x52')](_0xf5f2('0x53'))){_0x34fc35[_0xf5f2('0x2f')]=qs[_0xf5f2('0x2f')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x2f')]);_0x34fc35[_0xf5f2('0x54')]=qs[_0xf5f2('0x54')](_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x54')]);}_0x34fc35[_0xf5f2('0x55')]=qs[_0xf5f2('0x56')](_0x3dcf4e['query'][_0xf5f2('0x56')]);_0x34fc35[_0xf5f2('0x57')]=qs[_0xf5f2('0x4d')](_[_0xf5f2('0x10c')](_0x3dcf4e[_0xf5f2('0x4c')],_0x29c1ca['filters']));_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xb5')]=_0x544db3['id'];if(_0x3dcf4e['query'][_0xf5f2('0x90')]){_0x34fc35[_0xf5f2('0x57')]=_['merge'](_0x34fc35['where'],{'$or':_[_0xf5f2('0x3e')](_0x34fc35[_0xf5f2('0x4f')],function(_0x3e7f54){var _0x5e165c={};_0x5e165c[_0x3e7f54]={'$like':'%'+_0x3dcf4e['query'][_0xf5f2('0x90')]+'%'};return _0x5e165c;})});}_0x34fc35[_0xf5f2('0x57')][_0xf5f2('0xfb')]=![];if(_0x3dcf4e[_0xf5f2('0x4c')]['id']){_0x34fc35[_0xf5f2('0x57')]['id']={'$gt':_0x3dcf4e[_0xf5f2('0x4c')]['id']};}_0x34fc35=_[_0xf5f2('0x39')]({},_0x34fc35,_0x3dcf4e[_0xf5f2('0xba')]);return db[_0xf5f2('0xce')][_0xf5f2('0x31')]({'where':_0x34fc35['where']})[_0xf5f2('0x22')](function(_0x1c2842){_0x2cf93e['count']=_0x1c2842;_0x34fc35[_0xf5f2('0xb9')]=[];if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x110')]){_0x34fc35[_0xf5f2('0xb9')][_0xf5f2('0x44')]({'model':db['User'],'as':'User','attributes':['id',_0xf5f2('0x3f'),_0xf5f2('0x111')]});}if(_0x3dcf4e[_0xf5f2('0x4c')][_0xf5f2('0x10d')]){_0x34fc35['include']=[{'all':!![]}];}return db[_0xf5f2('0xce')][_0xf5f2('0x10e')](_0x34fc35);})[_0xf5f2('0x22')](function(_0x3518f9){_0x2cf93e['rows']=_0x3518f9;return _0x2cf93e;});}})['then'](respondWithFilteredResult(_0x4212d4,_0x34fc35))['catch'](handleError(_0x4212d4,null));};exports['addTags']=function(_0x2e9d3b,_0x496802,_0x5be074){return db['ChatInteraction']['find']({'where':{'id':_0x2e9d3b[_0xf5f2('0xbd')]['id']}})['then'](handleEntityNotFound(_0x496802,null))['then'](function(_0x43150f){if(_0x43150f){return _0x43150f[_0xf5f2('0x112')](_0x2e9d3b[_0xf5f2('0x3a')][_0xf5f2('0x113')],_['omit'](_0x2e9d3b[_0xf5f2('0x3a')],[_0xf5f2('0x113'),'id'])||{})[_0xf5f2('0x114')](function(){return db[_0xf5f2('0x7d')][_0xf5f2('0x10e')]({'attributes':['id',_0xf5f2('0x38'),_0xf5f2('0x115')],'where':{'id':_0x2e9d3b['body'][_0xf5f2('0x113')]}});})[_0xf5f2('0x22')](function(_0x4f4af9){socket[_0xf5f2('0x116')](_0xf5f2('0x117'),{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]});return{'id':Number(_0x2e9d3b[_0xf5f2('0xbd')]['id']),'tags':_0x4f4af9||[]};});}})[_0xf5f2('0x22')](respondWithResult(_0x496802,null))['catch'](handleError(_0x496802,null));};exports[_0xf5f2('0x118')]=function(_0x5f470f,_0x1f0a64,_0x2bbc23){return db[_0xf5f2('0xa2')][_0xf5f2('0x78')]({'where':{'id':_0x5f470f['params']['id']}})['then'](handleEntityNotFound(_0x1f0a64,null))[_0xf5f2('0x22')](function(_0x179901){if(_0x179901){return _0x179901[_0xf5f2('0x118')](_0x5f470f[_0xf5f2('0x4c')][_0xf5f2('0x113')]);}})[_0xf5f2('0x22')](respondWithStatusCode(_0x1f0a64,null))[_0xf5f2('0x2c')](handleError(_0x1f0a64,null));};exports[_0xf5f2('0xe8')]=function(_0x5d8c6a,_0x4f777b){var _0x26dc8c=moment()[_0xf5f2('0x119')]()['toString']();var _0xb8bcf3=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11c'));var _0x2bc493=path[_0xf5f2('0xe5')](config[_0xf5f2('0xe3')],_0xf5f2('0x11a'),_0xf5f2('0x11b'),_0xf5f2('0x11d'));var _0x212d97=path[_0xf5f2('0xe5')](_0xb8bcf3,_0x26dc8c);var _0x8ee5fd=util[_0xf5f2('0xea')](_0xf5f2('0x11e'),_0x5d8c6a['params']['id'],_0x26dc8c);var _0x3712e3=path['join'](_0xb8bcf3,_0x8ee5fd);var _0x56a1c3=[];_0x56a1c3['push']({'model':db['User'],'as':_0xf5f2('0x7f'),'attributes':['id',_0xf5f2('0x3f')],'raw':!![]});_0x56a1c3[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xd2')],'as':'Contact','attributes':['id',_0xf5f2('0x11f'),_0xf5f2('0x120')],'raw':!![]});if(_0x5d8c6a['query']['attachments']){_0x56a1c3['push']({'model':db[_0xf5f2('0xde')],'as':_0xf5f2('0xde'),'raw':!![]});}var _0x5a6da7=[{'model':db[_0xf5f2('0xce')],'as':_0xf5f2('0xee'),'attributes':['id',_0xf5f2('0x3a'),'createdAt',_0xf5f2('0x121'),_0xf5f2('0xfb'),_0xf5f2('0x8a')],'include':_0x56a1c3}];_0x5a6da7[_0xf5f2('0x44')]({'model':db[_0xf5f2('0xef')],'as':_0xf5f2('0x122'),'attributes':['id','name']});_0x5a6da7['push']({'model':db[_0xf5f2('0x7f')],'as':_0xf5f2('0x123'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf5f2('0x78')]({'where':{'id':_0x5d8c6a['params']['id']},'include':_0x5a6da7})[_0xf5f2('0x22')](handleEntityNotFound(_0x4f777b,null))[_0xf5f2('0x22')](function(_0x2ee55f){if(_0x2ee55f){var _0x43ca34=_0x2ee55f[_0xf5f2('0x124')]({'plain':!![]});fs[_0xf5f2('0x125')](_0x212d97);var _0x220300={'channel':_0xf5f2('0x126'),'account':_0x43ca34[_0xf5f2('0x122')][_0xf5f2('0x38')],'agent':_0x43ca34['Owner']?_0x43ca34[_0xf5f2('0x123')][_0xf5f2('0x3f')]:_0xf5f2('0x127'),'createdAt':moment(_0x43ca34[_0xf5f2('0x85')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'closedAt':_0x43ca34['closed']?moment(_0x43ca34[_0xf5f2('0x129')])['format'](_0xf5f2('0x128'))[_0xf5f2('0xb2')]():'','disposition':_0x43ca34['disposition'],'chatInfo':{'browser':_0x43ca34[_0xf5f2('0x12a')],'os':_0x43ca34[_0xf5f2('0x12b')],'referer':_0x43ca34[_0xf5f2('0x12c')],'customerIp':_0x43ca34[_0xf5f2('0x12d')],'customerPort':_0x43ca34['customerPort']?_0x43ca34[_0xf5f2('0x12e')]:_0xf5f2('0x127')},'messages':_(_0x43ca34[_0xf5f2('0xee')])['tail']()[_0xf5f2('0x90')]({'secret':![]})[_0xf5f2('0x3e')](function(_0x5981bb){if(_0x5981bb[_0xf5f2('0xde')]){var _0x4586b5=path[_0xf5f2('0xe5')](_0x2bc493,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]);if(fs[_0xf5f2('0x12f')](_0x4586b5)){fs[_0xf5f2('0x130')](_0x4586b5)[_0xf5f2('0x131')](fs[_0xf5f2('0x132')](path['join'](_0x212d97,_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')])));}}return{'date':moment(_0x5981bb[_0xf5f2('0x85')])[_0xf5f2('0xea')](_0xf5f2('0x128'))[_0xf5f2('0xb2')](),'sender':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?_0x5981bb[_0xf5f2('0x7f')]?_0x5981bb[_0xf5f2('0x7f')][_0xf5f2('0x3f')]:'System':_0x5981bb['Contact']['firstName']+(_0x5981bb[_0xf5f2('0x73')][_0xf5f2('0x120')]?'\x20'+_0x5981bb[_0xf5f2('0x73')]['lastName']:''),'body':_0x5981bb[_0xf5f2('0xde')]?_0x5981bb[_0xf5f2('0xde')][_0xf5f2('0xe7')]:_0x5981bb['body'],'direction':_0x5981bb[_0xf5f2('0x121')]===_0xf5f2('0x133')?'A':'C','secret':_0x5981bb[_0xf5f2('0xfb')],'read':_0x5981bb[_0xf5f2('0x8a')],'attachment':_0x5981bb[_0xf5f2('0xde')]};})[_0xf5f2('0x76')]()};return ejs[_0xf5f2('0x134')](path[_0xf5f2('0xe5')](config['root'],_0xf5f2('0x11a'),_0xf5f2('0x135'),_0xf5f2('0x136')),{'interaction':_0x220300})[_0xf5f2('0x22')](function(_0x510f56){var _0x319b39=path[_0xf5f2('0xe5')](_0x212d97,_0xf5f2('0x137')+_0x43ca34['id']+'-'+_0x26dc8c+'.pdf');var _0x346a95={'path':_0x319b39,'channel':_0xf5f2('0x126'),'interactionId':_0x43ca34['id']};return pdf[_0xf5f2('0x138')](_0x510f56,_0x346a95);})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x249e9b,_0x56ab93){zipdir(_0x212d97,{'saveTo':_0x3712e3},function(_0x21fce7,_0x38a5e3){if(_0x21fce7)return _0x56ab93(_0x21fce7);return _0x249e9b(_0x38a5e3);});})[_0xf5f2('0x22')](function(){return new BPromise(function(_0x4d8a71,_0x1ca92b){rimraf(_0x212d97,function(_0x486c5e){if(_0x486c5e)_0x1ca92b(_0x486c5e);return _0x4d8a71();});});})[_0xf5f2('0x22')](function(){return _0x4f777b[_0xf5f2('0xe8')](_0x3712e3,_0x8ee5fd,function(_0x5089c1){if(_0x5089c1){console[_0xf5f2('0x139')](_0xf5f2('0x13a'),_0x5089c1);}else{fs[_0xf5f2('0x13b')](_0x3712e3);}});});});}else{return _0x4f777b['sendStatus'](0xc8);}})[_0xf5f2('0x2c')](handleError(_0x4f777b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9d53f9e..30a4b4b 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 _0xe5fc=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x1ceb7b,_0x894d3d){var _0x57c016=function(_0x282306){while(--_0x282306){_0x1ceb7b['push'](_0x1ceb7b['shift']());}};_0x57c016(++_0x894d3d);}(_0xe5fc,0x144));var _0xce5f=function(_0x4bb7e4,_0x211d37){_0x4bb7e4=_0x4bb7e4-0x0;var _0x398622=_0xe5fc[_0x4bb7e4];return _0x398622;};'use strict';var EventEmitter=require(_0xce5f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0xce5f('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xce5f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce5f('0x3'),'afterDestroy':_0xce5f('0x4')};function emitEvent(_0x20023f){return function(_0x5495c3,_0x1db74a,_0x252741){_0x5495c3[_0xce5f('0x5')]({'attributes':['id'],'raw':!![]})[_0xce5f('0x6')](function(_0x16bd4d){_0x5495c3[_0xce5f('0x7')]('Users',_0x16bd4d['map'](function(_0x206386){return{'id':_0x206386['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5495c3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xce5f('0x6')](function(_0x2f0a36){_0x5495c3[_0xce5f('0x7')](_0xce5f('0x8'),_0x2f0a36[_0xce5f('0x9')]);ChatInteractionEvents[_0xce5f('0xa')](_0x20023f+':'+_0x5495c3['id'],_0x5495c3);ChatInteractionEvents[_0xce5f('0xa')](_0x20023f,_0x5495c3);_0x252741(null);})[_0xce5f('0xb')](_0x252741(null));};}for(var e in events){if(events[_0xce5f('0xc')](e)){var event=events[e];ChatInteraction[_0xce5f('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xc7b3=['map','then','setDataValue','unreadMessages','emit','catch','exports','events','ChatInteraction','../../mysqldb','ChatMessage','save','update','remove'];(function(_0x5bc18d,_0x4a1372){var _0x32a08e=function(_0x22d348){while(--_0x22d348){_0x5bc18d['push'](_0x5bc18d['shift']());}};_0x32a08e(++_0x4a1372);}(_0xc7b3,0x181));var _0x3c7b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc7b3[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x3c7b('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x3c7b('0x1')];var ChatMessage=require(_0x3c7b('0x2'))['db'][_0x3c7b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3c7b('0x4'),'afterUpdate':_0x3c7b('0x5'),'afterDestroy':_0x3c7b('0x6')};function emitEvent(_0x43e415){return function(_0x52e8fe,_0x236e5c,_0x153a10){_0x52e8fe['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x581477){_0x52e8fe['setDataValue']('Users',_0x581477[_0x3c7b('0x7')](function(_0x59fe97){return{'id':_0x59fe97['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x52e8fe['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3c7b('0x8')](function(_0x2a97c0){_0x52e8fe[_0x3c7b('0x9')](_0x3c7b('0xa'),_0x2a97c0['length']);ChatInteractionEvents[_0x3c7b('0xb')](_0x43e415+':'+_0x52e8fe['id'],_0x52e8fe);ChatInteractionEvents[_0x3c7b('0xb')](_0x43e415,_0x52e8fe);_0x153a10(null);})[_0x3c7b('0xc')](_0x153a10(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3c7b('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 9555f51..e4fe0c7 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 _0x338e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x338e,0x7e));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe338('0x0'));var logger=require(_0xe338('0x1'))(_0xe338('0x2'));var moment=require(_0xe338('0x3'));var BPromise=require(_0xe338('0x4'));var rp=require(_0xe338('0x5'));var fs=require('fs');var path=require(_0xe338('0x6'));var rimraf=require(_0xe338('0x7'));var config=require(_0xe338('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x2b8445,_0x1fd08a){return _0x2b8445['define'](_0xe338('0x9'),attributes,{'tableName':_0xe338('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51619e,_0x4ef9bc,_0x5d75a7){if(_0x51619e[_0xe338('0xb')](_0xe338('0xc'))){_0x51619e[_0xe338('0xd')]=moment()[_0xe338('0xe')](_0xe338('0xf'));}_0x5d75a7(null,_0x51619e);}},'charset':_0xe338('0x10'),'collate':_0xe338('0x11')});}; \ No newline at end of file +var _0x9c52=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatInteraction.attributes'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9c52,0x6a));var _0x29c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x29c5('0x0'));var util=require(_0x29c5('0x1'));var logger=require(_0x29c5('0x2'))(_0x29c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x29c5('0x4'));var fs=require('fs');var path=require(_0x29c5('0x5'));var rimraf=require('rimraf');var config=require(_0x29c5('0x6'));var attributes=require(_0x29c5('0x7'));module[_0x29c5('0x8')]=function(_0x51ab47,_0x5873a0){return _0x51ab47[_0x29c5('0x9')](_0x29c5('0xa'),attributes,{'tableName':_0x29c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x255868,_0x57bc5e,_0x5c74a4){if(_0x255868[_0x29c5('0xc')](_0x29c5('0xd'))){_0x255868[_0x29c5('0xe')]=moment()[_0x29c5('0xf')](_0x29c5('0x10'));}_0x5c74a4(null,_0x255868);}},'charset':_0x29c5('0x11'),'collate':_0x29c5('0x12')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6e73aba..be958fc 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 _0xf78c=['options','where','limit','then','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ChatInteraction','update'];(function(_0x3e2efa,_0x4d2cac){var _0x428c9a=function(_0x2c02b7){while(--_0x2c02b7){_0x3e2efa['push'](_0x3e2efa['shift']());}};_0x428c9a(++_0x4d2cac);}(_0xf78c,0x173));var _0xcf78=function(_0x5f1dec,_0x3caa8d){_0x5f1dec=_0x5f1dec-0x0;var _0x3de08c=_0xf78c[_0x5f1dec];return _0x3de08c;};'use strict';var _=require(_0xcf78('0x0'));var util=require(_0xcf78('0x1'));var moment=require(_0xcf78('0x2'));var BPromise=require(_0xcf78('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf78('0x4'));var db=require(_0xcf78('0x5'))['db'];var utils=require(_0xcf78('0x6'));var logger=require('../../config/logger')(_0xcf78('0x7'));var config=require(_0xcf78('0x8'));var jayson=require(_0xcf78('0x9'));var client=jayson[_0xcf78('0xa')][_0xcf78('0xb')]({'port':0x232a});config[_0xcf78('0xc')]=_[_0xcf78('0xd')](config['redis'],{'host':_0xcf78('0xe'),'port':0x18eb});var socket=require(_0xcf78('0xf'))(new Redis(config[_0xcf78('0xc')]));require(_0xcf78('0x10'))['register'](socket);function respondWithRpcPromise(_0x38c5b3,_0x5660d5,_0x1b15c0){return new BPromise(function(_0x3be5da,_0x1f819c){return client['request'](_0x38c5b3,_0x1b15c0)['then'](function(_0x38a57c){logger[_0xcf78('0x11')](_0xcf78('0x12'),_0x5660d5,_0xcf78('0x13'));logger[_0xcf78('0x14')](_0xcf78('0x15'),_0x5660d5,_0xcf78('0x13'),JSON[_0xcf78('0x16')](_0x38a57c));if(_0x38a57c[_0xcf78('0x17')]){if(_0x38a57c[_0xcf78('0x17')][_0xcf78('0x18')]===0x1f4){logger[_0xcf78('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x5660d5,_0x38a57c['error'][_0xcf78('0x19')]);return _0x1f819c(_0x38a57c['error'][_0xcf78('0x19')]);}logger[_0xcf78('0x17')](_0xcf78('0x12'),_0x5660d5,_0x38a57c[_0xcf78('0x17')]['message']);return _0x3be5da(_0x38a57c[_0xcf78('0x17')][_0xcf78('0x19')]);}else{logger['info'](_0xcf78('0x12'),_0x5660d5,_0xcf78('0x13'));_0x3be5da(_0x38a57c[_0xcf78('0x1a')][_0xcf78('0x19')]);}})['catch'](function(_0x55d5b5){logger[_0xcf78('0x17')](_0xcf78('0x12'),_0x5660d5,_0x55d5b5);_0x1f819c(_0x55d5b5);});});}exports['UpdateChatInteraction']=function(_0x258223){var _0x5831fe=this;return new Promise(function(_0xb40109,_0x3ac7cb){return db[_0xcf78('0x1b')][_0xcf78('0x1c')](_0x258223['body'],{'raw':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')][_0xcf78('0x1e')]||null:null,'attributes':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')]['attributes']||null:null,'limit':_0x258223[_0xcf78('0x1d')]?_0x258223[_0xcf78('0x1d')][_0xcf78('0x1f')]||null:null})[_0xcf78('0x20')](function(_0x1bcc25){logger[_0xcf78('0x11')](_0xcf78('0x21'),_0x258223);logger['debug'](_0xcf78('0x21'),_0x258223,JSON[_0xcf78('0x16')](_0x1bcc25));_0xb40109(_0x1bcc25);})[_0xcf78('0x22')](function(_0x4cbb43){logger['error'](_0xcf78('0x21'),_0x4cbb43[_0xcf78('0x19')],_0x258223);_0x3ac7cb(_0x5831fe[_0xcf78('0x17')](0x1f4,_0x4cbb43[_0xcf78('0x19')]));});});};exports[_0xcf78('0x23')]=function(_0x2aad6c){return new Promise(function(_0xff2ef0,_0x378f1b){return db[_0xcf78('0x1b')][_0xcf78('0x24')]({'where':_0x2aad6c['options']?_0x2aad6c[_0xcf78('0x1d')][_0xcf78('0x1e')]||null:null})['then'](function(_0x3e4108){if(_0x3e4108){return _0x3e4108['addTags'](_0x2aad6c['body'][_0xcf78('0x25')],_['omit'](_0x2aad6c['body'],[_0xcf78('0x25'),'id'])||{});}})[_0xcf78('0x26')](function(_0x509a52){logger[_0xcf78('0x11')](_0xcf78('0x27'),_0x2aad6c);logger[_0xcf78('0x14')](_0xcf78('0x27'),_0x2aad6c,JSON[_0xcf78('0x16')](_0x509a52));_0xff2ef0(_0x509a52);})[_0xcf78('0x22')](function(_0x52cbc1){logger[_0xcf78('0x17')](_0xcf78('0x27'),_0x52cbc1[_0xcf78('0x19')],_0x2aad6c);_0x378f1b(_this[_0xcf78('0x17')](0x1f4,_0x52cbc1[_0xcf78('0x19')]));});});}; \ No newline at end of file +var _0xced8=['debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','body','options','raw','where','attributes','limit','stringify','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x820d7b,_0xa5564c){var _0x249af0=function(_0x5ce8fb){while(--_0x5ce8fb){_0x820d7b['push'](_0x820d7b['shift']());}};_0x249af0(++_0xa5564c);}(_0xced8,0x173));var _0x8ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ced('0x0'));var util=require(_0x8ced('0x1'));var moment=require(_0x8ced('0x2'));var BPromise=require(_0x8ced('0x3'));var rs=require(_0x8ced('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ced('0x5'))['db'];var utils=require(_0x8ced('0x6'));var logger=require('../../config/logger')(_0x8ced('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ced('0x8'));var client=jayson['client'][_0x8ced('0x9')]({'port':0x232a});config[_0x8ced('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8ced('0xb'))(new Redis(config[_0x8ced('0xa')]));require(_0x8ced('0xc'))[_0x8ced('0xd')](socket);function respondWithRpcPromise(_0x6c7033,_0x26951a,_0x3c7aa4){return new BPromise(function(_0x58c13b,_0x2f184f){return client[_0x8ced('0xe')](_0x6c7033,_0x3c7aa4)[_0x8ced('0xf')](function(_0x3462d4){logger[_0x8ced('0x10')](_0x8ced('0x11'),_0x26951a,_0x8ced('0x12'));logger[_0x8ced('0x13')](_0x8ced('0x14'),_0x26951a,_0x8ced('0x12'),JSON['stringify'](_0x3462d4));if(_0x3462d4['error']){if(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x16')]===0x1f4){logger['error'](_0x8ced('0x11'),_0x26951a,_0x3462d4[_0x8ced('0x15')]['message']);return _0x2f184f(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x17')]);}logger['error'](_0x8ced('0x11'),_0x26951a,_0x3462d4['error']['message']);return _0x58c13b(_0x3462d4[_0x8ced('0x15')][_0x8ced('0x17')]);}else{logger['info'](_0x8ced('0x11'),_0x26951a,_0x8ced('0x12'));_0x58c13b(_0x3462d4[_0x8ced('0x18')]['message']);}})[_0x8ced('0x19')](function(_0x241c13){logger[_0x8ced('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x26951a,_0x241c13);_0x2f184f(_0x241c13);});});}exports['UpdateChatInteraction']=function(_0x62d24c){var _0x34f9ac=this;return new Promise(function(_0x2f4d4f,_0x538cf7){return db['ChatInteraction']['update'](_0x62d24c[_0x8ced('0x1a')],{'raw':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1d')]||null:null,'attributes':_0x62d24c[_0x8ced('0x1b')]?_0x62d24c['options'][_0x8ced('0x1e')]||null:null,'limit':_0x62d24c['options']?_0x62d24c[_0x8ced('0x1b')][_0x8ced('0x1f')]||null:null})[_0x8ced('0xf')](function(_0x4e5c6e){logger[_0x8ced('0x10')]('UpdateChatInteraction',_0x62d24c);logger[_0x8ced('0x13')]('UpdateChatInteraction',_0x62d24c,JSON[_0x8ced('0x20')](_0x4e5c6e));_0x2f4d4f(_0x4e5c6e);})[_0x8ced('0x19')](function(_0x16c79d){logger['error'](_0x8ced('0x21'),_0x16c79d[_0x8ced('0x17')],_0x62d24c);_0x538cf7(_0x34f9ac['error'](0x1f4,_0x16c79d[_0x8ced('0x17')]));});});};exports[_0x8ced('0x22')]=function(_0x56ffca){return new Promise(function(_0x328caa,_0x40ec69){return db['ChatInteraction'][_0x8ced('0x23')]({'where':_0x56ffca[_0x8ced('0x1b')]?_0x56ffca[_0x8ced('0x1b')][_0x8ced('0x1d')]||null:null})[_0x8ced('0xf')](function(_0x404407){if(_0x404407){return _0x404407[_0x8ced('0x24')](_0x56ffca[_0x8ced('0x1a')][_0x8ced('0x25')],_['omit'](_0x56ffca[_0x8ced('0x1a')],[_0x8ced('0x25'),'id'])||{});}})['spread'](function(_0x1a11eb){logger[_0x8ced('0x10')](_0x8ced('0x26'),_0x56ffca);logger['debug'](_0x8ced('0x26'),_0x56ffca,JSON['stringify'](_0x1a11eb));_0x328caa(_0x1a11eb);})[_0x8ced('0x19')](function(_0x35c1b4){logger['error'](_0x8ced('0x26'),_0x35c1b4['message'],_0x56ffca);_0x40ec69(_this[_0x8ced('0x15')](0x1f4,_0x35c1b4[_0x8ced('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 20a9b7b..bb06a19 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 _0x1862=['update','emit','removeListener','./chatInteraction.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1862,0x6c));var _0x2186=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1862[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x2186('0x0'));var events=['save',_0x2186('0x1'),_0x2186('0x2')];function createListener(_0x3a44b6,_0x3050ef){return function(_0x517f2c){_0x3050ef[_0x2186('0x3')](_0x3a44b6,_0x517f2c);};}function removeListener(_0x29154,_0x31ec11){return function(){ChatInteractionEvents[_0x2186('0x4')](_0x29154,_0x31ec11);};}exports['register']=function(_0x13515d){for(var _0x2ada49=0x0,_0x119175=events['length'];_0x2ada49<_0x119175;_0x2ada49++){var _0x21ce00=events[_0x2ada49];var _0x4b7e16=createListener('chatInteraction:'+_0x21ce00,_0x13515d);ChatInteractionEvents['on'](_0x21ce00,_0x4b7e16);}}; \ No newline at end of file +var _0xc0e6=['length','chatInteraction:','save','update','removeListener','register'];(function(_0xea34ca,_0x5eced4){var _0x10a4b2=function(_0x48d978){while(--_0x48d978){_0xea34ca['push'](_0xea34ca['shift']());}};_0x10a4b2(++_0x5eced4);}(_0xc0e6,0x1b8));var _0x6c0e=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xc0e6[_0x35da42];return _0x370035;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6c0e('0x0'),'remove',_0x6c0e('0x1')];function createListener(_0x33f34d,_0x343e16){return function(_0x50bbab){_0x343e16['emit'](_0x33f34d,_0x50bbab);};}function removeListener(_0x163f81,_0x35fe2f){return function(){ChatInteractionEvents[_0x6c0e('0x2')](_0x163f81,_0x35fe2f);};}exports[_0x6c0e('0x3')]=function(_0x28b74e){for(var _0x4c3847=0x0,_0x3534c6=events[_0x6c0e('0x4')];_0x4c3847<_0x3534c6;_0x4c3847++){var _0x3e6bdf=events[_0x4c3847];var _0x2d1e43=createListener(_0x6c0e('0x5')+_0x3e6bdf,_0x28b74e);ChatInteractionEvents['on'](_0x3e6bdf,_0x2d1e43);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 529c817..5d07a6c 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 _0x899e=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','now','replace','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x338224,_0x1fb425){var _0x1d5fc5=function(_0x27cc96){while(--_0x27cc96){_0x338224['push'](_0x338224['shift']());}};_0x1d5fc5(++_0x1fb425);}(_0x899e,0x1cf));var _0xe899=function(_0x4abedb,_0x90cb83){_0x4abedb=_0x4abedb-0x0;var _0x3b61c4=_0x899e[_0x4abedb];return _0x3b61c4;};'use strict';var multer=require(_0xe899('0x0'));var util=require(_0xe899('0x1'));var path=require(_0xe899('0x2'));var timeout=require(_0xe899('0x3'));var express=require(_0xe899('0x4'));var router=express[_0xe899('0x5')]();var fs_extra=require(_0xe899('0x6'));var auth=require(_0xe899('0x7'));var interaction=require(_0xe899('0x8'));var config=require(_0xe899('0x9'));var controller=require('./chatInteraction.controller');router[_0xe899('0xa')]('/',auth[_0xe899('0xb')](),controller['index']);router[_0xe899('0xa')](_0xe899('0xc'),auth[_0xe899('0xb')](),controller[_0xe899('0xd')]);router[_0xe899('0xa')](_0xe899('0xe'),auth[_0xe899('0xf')](),controller[_0xe899('0x10')]);router[_0xe899('0xa')](_0xe899('0x11'),auth[_0xe899('0xf')](),controller['attachmentDownload']);router[_0xe899('0xa')](_0xe899('0x12'),auth['isAuthenticated'](),controller[_0xe899('0x13')]);router['get'](_0xe899('0x14'),auth[_0xe899('0xf')](),controller[_0xe899('0x15')]);router[_0xe899('0xa')]('/:id/download',auth[_0xe899('0xb')](),controller['download']);router[_0xe899('0x16')]('/',auth['isAuthenticated'](),controller[_0xe899('0x17')]);router[_0xe899('0x16')](_0xe899('0x18'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xe899('0x19')]({'destination':function(_0x3fc776,_0x5294a2,_0x452314){_0x452314(null,path[_0xe899('0x1a')](config[_0xe899('0x1b')],_0xe899('0x1c')));},'filename':function(_0x279edb,_0x21979a,_0x1fd9cb){_0x1fd9cb(null,util['format'](_0xe899('0x1d'),Date[_0xe899('0x1e')](),_0x21979a['originalname'][_0xe899('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe899('0x16')]('/:id/attachment_upload',upload[_0xe899('0x20')](_0xe899('0x21')),controller[_0xe899('0x22')]);router[_0xe899('0x16')](_0xe899('0x12'),auth[_0xe899('0xf')](),controller[_0xe899('0x23')]);router[_0xe899('0x16')]('/:id/tags',auth[_0xe899('0xb')](),interaction[_0xe899('0x24')](_0xe899('0x25'),_0xe899('0x26')),controller['addTags']);router[_0xe899('0x27')](_0xe899('0xe'),auth[_0xe899('0xb')](),interaction[_0xe899('0x24')](_0xe899('0x25'),_0xe899('0x28')),controller[_0xe899('0x29')]);router[_0xe899('0x27')]('/:id/custom_update',controller[_0xe899('0x2a')]);router[_0xe899('0x27')](_0xe899('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xe899('0x2c')]);router[_0xe899('0x27')](_0xe899('0x2d'),controller[_0xe899('0x2e')]);router['delete'](_0xe899('0xe'),auth[_0xe899('0xb')](),interaction[_0xe899('0x24')]('chat',_0xe899('0x2f')),controller[_0xe899('0x30')]);router[_0xe899('0x31')](_0xe899('0x32'),auth['isAuthenticated'](),controller[_0xe899('0x33')]);module[_0xe899('0x34')]=router; \ No newline at end of file +var _0x0c08=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','create','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','replace','/:id/attachment_upload','file','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x0c08,0x8e));var _0x80c0=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x0c08[_0x5a6644];return _0x3a2a5d;};'use strict';var multer=require(_0x80c0('0x0'));var util=require(_0x80c0('0x1'));var path=require('path');var timeout=require(_0x80c0('0x2'));var express=require('express');var router=express[_0x80c0('0x3')]();var fs_extra=require(_0x80c0('0x4'));var auth=require(_0x80c0('0x5'));var interaction=require(_0x80c0('0x6'));var config=require(_0x80c0('0x7'));var controller=require('./chatInteraction.controller');router[_0x80c0('0x8')]('/',auth[_0x80c0('0x9')](),controller[_0x80c0('0xa')]);router[_0x80c0('0x8')](_0x80c0('0xb'),auth[_0x80c0('0x9')](),controller['describe']);router['get'](_0x80c0('0xc'),auth[_0x80c0('0xd')](),controller[_0x80c0('0xe')]);router['get'](_0x80c0('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x80c0('0x10')]);router[_0x80c0('0x8')]('/:id/messages',auth[_0x80c0('0x9')](),controller[_0x80c0('0x11')]);router[_0x80c0('0x8')](_0x80c0('0x12'),auth[_0x80c0('0xd')](),controller[_0x80c0('0x13')]);router[_0x80c0('0x8')]('/:id/download',auth[_0x80c0('0x9')](),controller['download']);router['post']('/',auth[_0x80c0('0x9')](),controller[_0x80c0('0x14')]);router[_0x80c0('0x15')]('/:id/vidaoo',auth[_0x80c0('0x9')](),controller[_0x80c0('0x16')]);var upload=multer({'storage':multer[_0x80c0('0x17')]({'destination':function(_0x3030e0,_0x42f5e2,_0x476942){_0x476942(null,path[_0x80c0('0x18')](config[_0x80c0('0x19')],_0x80c0('0x1a')));},'filename':function(_0x158dfd,_0x433b9b,_0x2e620e){_0x2e620e(null,util[_0x80c0('0x1b')]('%s-%s',Date['now'](),_0x433b9b['originalname'][_0x80c0('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x80c0('0x1d'),upload['single'](_0x80c0('0x1e')),controller['attachmentUpload']);router['post'](_0x80c0('0x1f'),auth['isChatInteractionAuthorized'](),controller[_0x80c0('0x20')]);router[_0x80c0('0x15')](_0x80c0('0x21'),auth[_0x80c0('0x9')](),interaction['tracked'](_0x80c0('0x22'),_0x80c0('0x23')),controller[_0x80c0('0x24')]);router[_0x80c0('0x25')](_0x80c0('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x80c0('0x22'),'chatinteraction:update'),controller['update']);router[_0x80c0('0x25')]('/:id/custom_update',controller[_0x80c0('0x26')]);router[_0x80c0('0x25')](_0x80c0('0x27'),auth[_0x80c0('0xd')](),controller[_0x80c0('0x28')]);router['put'](_0x80c0('0x29'),controller[_0x80c0('0x2a')]);router[_0x80c0('0x2b')](_0x80c0('0xc'),auth[_0x80c0('0x9')](),interaction[_0x80c0('0x2c')](_0x80c0('0x22'),_0x80c0('0x2d')),controller['destroy']);router['delete'](_0x80c0('0x21'),auth[_0x80c0('0x9')](),controller['removeTags']);module[_0x80c0('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index d56a447..4e206f2 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 _0x9a8b=['exports','TEXT','sequelize'];(function(_0x492d08,_0x309900){var _0x476f5a=function(_0x56ab56){while(--_0x56ab56){_0x492d08['push'](_0x492d08['shift']());}};_0x476f5a(++_0x309900);}(_0x9a8b,0x1f1));var _0xb9a8=function(_0x447743,_0x3bde2d){_0x447743=_0x447743-0x0;var _0x157364=_0x9a8b[_0x447743];return _0x157364;};'use strict';var Sequelize=require(_0xb9a8('0x0'));module[_0xb9a8('0x1')]={'body':{'type':Sequelize[_0xb9a8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x040d=['sequelize','exports','BOOLEAN'];(function(_0x31523e,_0x26f653){var _0x56aa74=function(_0x2bb423){while(--_0x2bb423){_0x31523e['push'](_0x31523e['shift']());}};_0x56aa74(++_0x26f653);}(_0x040d,0x13e));var _0xd040=function(_0x1e9992,_0x24a7db){_0x1e9992=_0x1e9992-0x0;var _0x4204e2=_0x040d[_0x1e9992];return _0x4204e2;};'use strict';var Sequelize=require(_0xd040('0x0'));module[_0xd040('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd040('0x2')],'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 63c66c8..2916c42 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 _0xdc06=['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','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','ToId','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdc06,0xd4));var _0x6dc0=function(_0x5bc779,_0x277212){_0x5bc779=_0x5bc779-0x0;var _0x3bfcac=_0xdc06[_0x5bc779];return _0x3bfcac;};'use strict';var emlformat=require(_0x6dc0('0x0'));var rimraf=require(_0x6dc0('0x1'));var zipdir=require(_0x6dc0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dc0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6dc0('0x4'));var util=require('util');var path=require(_0x6dc0('0x5'));var sox=require(_0x6dc0('0x6'));var csv=require(_0x6dc0('0x7'));var ejs=require(_0x6dc0('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc0('0x9'));var _=require('lodash');var squel=require(_0x6dc0('0xa'));var crypto=require(_0x6dc0('0xb'));var jsforce=require(_0x6dc0('0xc'));var deskjs=require(_0x6dc0('0xd'));var toCsv=require(_0x6dc0('0x7'));var querystring=require('querystring');var Papa=require(_0x6dc0('0xe'));var Redis=require(_0x6dc0('0xf'));var authService=require(_0x6dc0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6dc0('0x11'));var hardwareService=require(_0x6dc0('0x12'));var logger=require(_0x6dc0('0x13'))(_0x6dc0('0x14'));var utils=require(_0x6dc0('0x15'));var config=require(_0x6dc0('0x16'));var licenseUtil=require(_0x6dc0('0x17'));var db=require('../../mysqldb')['db'];config[_0x6dc0('0x18')]=_['defaults'](config['redis'],{'host':_0x6dc0('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dc0('0x18')]));require(_0x6dc0('0x1a'))[_0x6dc0('0x1b')](socket);function respondWithStatusCode(_0x13bbf3,_0x1d459a){_0x1d459a=_0x1d459a||0xcc;return function(_0x345652){if(_0x345652){return _0x13bbf3[_0x6dc0('0x1c')](_0x1d459a);}return _0x13bbf3['status'](_0x1d459a)[_0x6dc0('0x1d')]();};}function respondWithResult(_0x3f03b7,_0x2453b8){_0x2453b8=_0x2453b8||0xc8;return function(_0xf28292){if(_0xf28292){return _0x3f03b7[_0x6dc0('0x1e')](_0x2453b8)[_0x6dc0('0x1f')](_0xf28292);}};}function respondWithFilteredResult(_0x58eb1b,_0x4f38f1){return function(_0x589c52){if(_0x589c52){var _0x22bd0f=typeof _0x4f38f1[_0x6dc0('0x20')]===_0x6dc0('0x21')&&typeof _0x4f38f1['limit']===_0x6dc0('0x21');var _0x41a313=_0x589c52[_0x6dc0('0x22')];var _0x39494d=_0x22bd0f?0x0:_0x4f38f1['offset'];var _0x5832af=_0x22bd0f?_0x589c52[_0x6dc0('0x22')]:_0x4f38f1[_0x6dc0('0x20')]+_0x4f38f1[_0x6dc0('0x23')];var _0x3ebfa0;if(_0x5832af>=_0x41a313){_0x5832af=_0x41a313;_0x3ebfa0=0xc8;}else{_0x3ebfa0=0xce;}_0x58eb1b['status'](_0x3ebfa0);return _0x58eb1b[_0x6dc0('0x24')](_0x6dc0('0x25'),_0x39494d+'-'+_0x5832af+'/'+_0x41a313)['json'](_0x589c52);}return null;};}function patchUpdates(_0x309e0f){return function(_0x487598){try{jsonpatch[_0x6dc0('0x26')](_0x487598,_0x309e0f,!![]);}catch(_0x522a37){return BPromise[_0x6dc0('0x27')](_0x522a37);}return _0x487598[_0x6dc0('0x28')]();};}function saveUpdates(_0x263b27,_0x2fe6cd){return function(_0x130ac6){if(_0x130ac6){return _0x130ac6[_0x6dc0('0x29')](_0x263b27)[_0x6dc0('0x2a')](function(_0x2efb84){return _0x2efb84;});}return null;};}function removeEntity(_0x51600d,_0x4a207e){return function(_0x2824cb){if(_0x2824cb){return _0x2824cb[_0x6dc0('0x2b')]()['then'](function(){_0x51600d[_0x6dc0('0x1e')](0xcc)[_0x6dc0('0x1d')]();});}};}function handleEntityNotFound(_0x55203f,_0xe2deaa){return function(_0x328d7b){if(!_0x328d7b){_0x55203f[_0x6dc0('0x1c')](0x194);}return _0x328d7b;};}function handleError(_0x5ad41b,_0x5cd654){_0x5cd654=_0x5cd654||0x1f4;return function(_0x25766c){logger[_0x6dc0('0x2c')](_0x25766c[_0x6dc0('0x2d')]);if(_0x25766c[_0x6dc0('0x2e')]){delete _0x25766c[_0x6dc0('0x2e')];}_0x5ad41b[_0x6dc0('0x1e')](_0x5cd654)[_0x6dc0('0x2f')](_0x25766c);};}exports[_0x6dc0('0x30')]=function(_0x4ece20,_0x3f3abf){var _0x1ea184={},_0x2ebc37={},_0x1dc9d3={'count':0x0,'rows':[]};var _0x387ea6=_[_0x6dc0('0x31')](db[_0x6dc0('0x32')]['rawAttributes'],function(_0x4fb61b){return{'name':_0x4fb61b['fieldName'],'type':_0x4fb61b[_0x6dc0('0x33')][_0x6dc0('0x34')]};});_0x2ebc37[_0x6dc0('0x35')]=_[_0x6dc0('0x31')](_0x387ea6,_0x6dc0('0x2e'));_0x2ebc37[_0x6dc0('0x36')]=_[_0x6dc0('0x37')](_0x4ece20['query']);_0x2ebc37['filters']=_[_0x6dc0('0x38')](_0x2ebc37[_0x6dc0('0x35')],_0x2ebc37[_0x6dc0('0x36')]);_0x1ea184[_0x6dc0('0x39')]=_[_0x6dc0('0x38')](_0x2ebc37['model'],qs[_0x6dc0('0x3a')](_0x4ece20['query'][_0x6dc0('0x3a')]));_0x1ea184['attributes']=_0x1ea184[_0x6dc0('0x39')][_0x6dc0('0x3b')]?_0x1ea184[_0x6dc0('0x39')]:_0x2ebc37[_0x6dc0('0x35')];if(!_0x4ece20['query'][_0x6dc0('0x3c')](_0x6dc0('0x3d'))){_0x1ea184['limit']=qs[_0x6dc0('0x23')](_0x4ece20[_0x6dc0('0x36')]['limit']);_0x1ea184[_0x6dc0('0x20')]=qs[_0x6dc0('0x20')](_0x4ece20['query'][_0x6dc0('0x20')]);}_0x1ea184['order']=qs['sort'](_0x4ece20['query'][_0x6dc0('0x3e')]);_0x1ea184[_0x6dc0('0x3f')]=qs[_0x6dc0('0x40')](_[_0x6dc0('0x41')](_0x4ece20['query'],_0x2ebc37[_0x6dc0('0x40')]),_0x387ea6);if(_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x42')]){_0x1ea184['where']=_[_0x6dc0('0x43')](_0x1ea184[_0x6dc0('0x3f')],{'$or':_[_0x6dc0('0x31')](_0x387ea6,function(_0x31b62b){if(_0x31b62b[_0x6dc0('0x33')]!==_0x6dc0('0x44')){var _0x23f19e={};_0x23f19e[_0x31b62b[_0x6dc0('0x2e')]]={'$like':'%'+_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x42')]+'%'};return _0x23f19e;}})});}_0x1ea184=_['merge']({},_0x1ea184,_0x4ece20[_0x6dc0('0x45')]);var _0x1d816a={'where':_0x1ea184[_0x6dc0('0x3f')]};return db[_0x6dc0('0x32')][_0x6dc0('0x22')](_0x1d816a)[_0x6dc0('0x2a')](function(_0x2b7473){_0x1dc9d3[_0x6dc0('0x22')]=_0x2b7473;if(_0x4ece20[_0x6dc0('0x36')][_0x6dc0('0x46')]){_0x1ea184[_0x6dc0('0x47')]=[{'all':!![]}];}return db[_0x6dc0('0x32')][_0x6dc0('0x48')](_0x1ea184);})[_0x6dc0('0x2a')](function(_0x4426b2){_0x1dc9d3[_0x6dc0('0x49')]=_0x4426b2;return _0x1dc9d3;})['then'](respondWithFilteredResult(_0x3f3abf,_0x1ea184))[_0x6dc0('0x4a')](handleError(_0x3f3abf,null));};exports[_0x6dc0('0x4b')]=function(_0x716c1e,_0x533bac){var _0x7c69f7={'raw':!![],'where':{'id':_0x716c1e[_0x6dc0('0x4c')]['id']}},_0x230b3e={};_0x230b3e[_0x6dc0('0x35')]=_[_0x6dc0('0x37')](db[_0x6dc0('0x32')][_0x6dc0('0x4d')]);_0x230b3e['query']=_['keys'](_0x716c1e[_0x6dc0('0x36')]);_0x230b3e[_0x6dc0('0x40')]=_['intersection'](_0x230b3e[_0x6dc0('0x35')],_0x230b3e['query']);_0x7c69f7[_0x6dc0('0x39')]=_['intersection'](_0x230b3e[_0x6dc0('0x35')],qs[_0x6dc0('0x3a')](_0x716c1e['query']['fields']));_0x7c69f7[_0x6dc0('0x39')]=_0x7c69f7[_0x6dc0('0x39')][_0x6dc0('0x3b')]?_0x7c69f7[_0x6dc0('0x39')]:_0x230b3e[_0x6dc0('0x35')];if(_0x716c1e[_0x6dc0('0x36')]['includeAll']){_0x7c69f7[_0x6dc0('0x47')]=[{'all':!![]}];}_0x7c69f7=_[_0x6dc0('0x43')]({},_0x7c69f7,_0x716c1e[_0x6dc0('0x45')]);return db[_0x6dc0('0x32')]['find'](_0x7c69f7)[_0x6dc0('0x2a')](handleEntityNotFound(_0x533bac,null))['then'](respondWithResult(_0x533bac,null))[_0x6dc0('0x4a')](handleError(_0x533bac,null));};exports[_0x6dc0('0x4e')]=function(_0x166006,_0x3ea0ee){return db[_0x6dc0('0x32')][_0x6dc0('0x4e')](_0x166006['body'],{})['then'](respondWithResult(_0x3ea0ee,0xc9))[_0x6dc0('0x4a')](handleError(_0x3ea0ee,null));};exports[_0x6dc0('0x29')]=function(_0x3faaeb,_0x15adf7){if(_0x3faaeb[_0x6dc0('0x4f')]['id']){delete _0x3faaeb[_0x6dc0('0x4f')]['id'];}return db[_0x6dc0('0x32')][_0x6dc0('0x50')]({'where':{'id':_0x3faaeb[_0x6dc0('0x4c')]['id']}})[_0x6dc0('0x2a')](handleEntityNotFound(_0x15adf7,null))[_0x6dc0('0x2a')](saveUpdates(_0x3faaeb['body'],null))[_0x6dc0('0x2a')](respondWithResult(_0x15adf7,null))['catch'](handleError(_0x15adf7,null));};exports['destroy']=function(_0x2732ef,_0x34d7b9){return db[_0x6dc0('0x32')]['find']({'where':{'id':_0x2732ef['params']['id']}})[_0x6dc0('0x2a')](handleEntityNotFound(_0x34d7b9,null))[_0x6dc0('0x2a')](removeEntity(_0x34d7b9,null))[_0x6dc0('0x4a')](handleError(_0x34d7b9,null));};exports[_0x6dc0('0x51')]=function(_0x56e28b,_0x464ae0){return db[_0x6dc0('0x32')][_0x6dc0('0x51')]()[_0x6dc0('0x2a')](respondWithResult(_0x464ae0,null))[_0x6dc0('0x4a')](handleError(_0x464ae0,null));};function wrapUser(_0x5ef898){return function(_0x5594c3){var _0x2df2f8=_0x5ef898[_0x6dc0('0x52')]({'plain':!![]});_0x2df2f8[_0x6dc0('0x53')]=[];if(_0x5594c3){_0x2df2f8[_0x6dc0('0x54')]=_0x5594c3[_0x6dc0('0x55')];_0x2df2f8[_0x6dc0('0x56')]=_0x5594c3;}else{_0x2df2f8[_0x6dc0('0x54')]=moment(0x0)['format'](_0x6dc0('0x57'));_0x2df2f8['lastMessage']={};}return _0x2df2f8;};}exports[_0x6dc0('0x58')]=function(_0x55842d,_0x2c29ff,_0x5b3edd){var _0x211bdc=[];return db[_0x6dc0('0x59')][_0x6dc0('0x48')]({'where':{'role':[_0x6dc0('0x5a'),_0x6dc0('0x5b'),'user']},'attributes':['id','fullname',_0x6dc0('0x2e'),_0x6dc0('0x5c'),_0x6dc0('0x5d'),'internal',_0x6dc0('0x5e'),'lastLoginAt',_0x6dc0('0x5f'),_0x6dc0('0x60')],'order':qs[_0x6dc0('0x3e')](_0x6dc0('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x6dc0('0x62'),'attributes':['id',_0x6dc0('0x2e'),_0x6dc0('0x33')],'through':{'attributes':[]}}]})[_0x6dc0('0x2a')](function(_0x50222e){if(_0x50222e){var _0x274f1c=_0x55842d['user'][_0x6dc0('0x52')]({'plain':!![]});if(!_0x274f1c)throw new Error(_0x6dc0('0x63'));if(_0x274f1c[_0x6dc0('0x5c')]===_0x6dc0('0x64')){return db[_0x6dc0('0x65')][_0x6dc0('0x50')]({'where':{'name':_0x6dc0('0x66'),'userProfileId':_0x274f1c[_0x6dc0('0x67')]},'raw':!![]})[_0x6dc0('0x2a')](function(_0x5d994d){if(_0x5d994d){if(_0x5d994d[_0x6dc0('0x68')]===0x0){return db[_0x6dc0('0x69')][_0x6dc0('0x48')]({'where':{'sectionId':_0x5d994d['id']},'raw':!![]})[_0x6dc0('0x2a')](function(_0x53f2ff){var _0x4ea9ce=[];if(_['isEmpty'](_0x53f2ff)){_0x4ea9ce=_[_0x6dc0('0x42')](_0x50222e,function(_0x29c963){if(_0x29c963[_0x6dc0('0x5c')]!==_0x6dc0('0x5a')){return _0x29c963;}});return _0x4ea9ce;}else{for(var _0x1f47f8=0x0;_0x1f47f8<_0x50222e[_0x6dc0('0x3b')];_0x1f47f8++){var _0x273d40=_0x50222e[_0x1f47f8];if(_0x273d40[_0x6dc0('0x5c')]===_0x6dc0('0x5a')){var _0x1e3546=_[_0x6dc0('0x50')](_0x53f2ff,function(_0x1e8668){return _0x1e8668[_0x6dc0('0x6a')]===_0x273d40['id'];});if(_0x1e3546)_0x4ea9ce[_0x6dc0('0x6b')](_0x273d40);}else{_0x4ea9ce['push'](_0x273d40);}}return _0x4ea9ce;}});}else{return _0x50222e;}}else{var _0xd22163=_[_0x6dc0('0x42')](_0x50222e,function(_0x2610cc){if(_0x2610cc[_0x6dc0('0x5c')]!==_0x6dc0('0x5a')){return _0x2610cc;}});return _0xd22163;}});}else{return _0x50222e;}}})['then'](function(_0x25a484){var _0x195904=[];if(_0x25a484){_0x211bdc=_0x25a484;for(var _0x3a0e73=0x0;_0x3a0e73<_0x25a484[_0x6dc0('0x3b')];_0x3a0e73+=0x1){_0x211bdc[_0x3a0e73][_0x6dc0('0x53')]=[];_0x195904[_0x6dc0('0x6b')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x55842d[_0x6dc0('0x64')]['id'],_0x25a484[_0x3a0e73]['id']],'ToId':[_0x55842d['user']['id'],_0x25a484[_0x3a0e73]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x6dc0('0x6c'),'read','body'],'order':qs[_0x6dc0('0x3e')](_0x6dc0('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6dc0('0x2a')](wrapUser(_0x25a484[_0x3a0e73])));}return BPromise[_0x6dc0('0x6e')](_0x195904);}return[];})[_0x6dc0('0x2a')](function(_0x38b7f3){return{'rows':_0x38b7f3,'count':_0x38b7f3[_0x6dc0('0x3b')]};})[_0x6dc0('0x2a')](respondWithResult(_0x2c29ff,null))['catch'](handleError(_0x2c29ff,null));}; \ No newline at end of file +var _0x1139=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','stack','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','name','options','where','includeAll','findAll','catch','show','params','include','create','body','find','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','fullname','role','userpic','internal','allowmessenger','showWebBar','-online','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','messages','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b22a8,_0x2feff6){var _0x3d41b2=function(_0x587a87){while(--_0x587a87){_0x4b22a8['push'](_0x4b22a8['shift']());}};_0x3d41b2(++_0x2feff6);}(_0x1139,0x1ad));var _0x9113=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x1139[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9113('0x0'));var jsonpatch=require(_0x9113('0x1'));var rp=require(_0x9113('0x2'));var moment=require(_0x9113('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9113('0x4'));var path=require(_0x9113('0x5'));var sox=require(_0x9113('0x6'));var csv=require(_0x9113('0x7'));var ejs=require(_0x9113('0x8'));var fs=require('fs');var fs_extra=require(_0x9113('0x9'));var _=require(_0x9113('0xa'));var squel=require(_0x9113('0xb'));var crypto=require('crypto');var jsforce=require(_0x9113('0xc'));var deskjs=require(_0x9113('0xd'));var toCsv=require(_0x9113('0x7'));var querystring=require(_0x9113('0xe'));var Papa=require(_0x9113('0xf'));var Redis=require(_0x9113('0x10'));var authService=require(_0x9113('0x11'));var qs=require(_0x9113('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9113('0x13'));var logger=require(_0x9113('0x14'))(_0x9113('0x15'));var utils=require(_0x9113('0x16'));var config=require(_0x9113('0x17'));var licenseUtil=require(_0x9113('0x18'));var db=require('../../mysqldb')['db'];config[_0x9113('0x19')]=_['defaults'](config[_0x9113('0x19')],{'host':_0x9113('0x1a'),'port':0x18eb});var socket=require(_0x9113('0x1b'))(new Redis(config[_0x9113('0x19')]));require(_0x9113('0x1c'))[_0x9113('0x1d')](socket);function respondWithStatusCode(_0x21bf19,_0x53d8ac){_0x53d8ac=_0x53d8ac||0xcc;return function(_0x4a34be){if(_0x4a34be){return _0x21bf19['sendStatus'](_0x53d8ac);}return _0x21bf19[_0x9113('0x1e')](_0x53d8ac)['end']();};}function respondWithResult(_0x463e75,_0x120609){_0x120609=_0x120609||0xc8;return function(_0x3faa07){if(_0x3faa07){return _0x463e75['status'](_0x120609)[_0x9113('0x1f')](_0x3faa07);}};}function respondWithFilteredResult(_0x3ecbc8,_0x374225){return function(_0x1169f3){if(_0x1169f3){var _0x2e777c=typeof _0x374225[_0x9113('0x20')]===_0x9113('0x21')&&typeof _0x374225[_0x9113('0x22')]===_0x9113('0x21');var _0x877362=_0x1169f3['count'];var _0x2cb870=_0x2e777c?0x0:_0x374225[_0x9113('0x20')];var _0xd25738=_0x2e777c?_0x1169f3[_0x9113('0x23')]:_0x374225['offset']+_0x374225['limit'];var _0x3c6a48;if(_0xd25738>=_0x877362){_0xd25738=_0x877362;_0x3c6a48=0xc8;}else{_0x3c6a48=0xce;}_0x3ecbc8[_0x9113('0x1e')](_0x3c6a48);return _0x3ecbc8[_0x9113('0x24')](_0x9113('0x25'),_0x2cb870+'-'+_0xd25738+'/'+_0x877362)[_0x9113('0x1f')](_0x1169f3);}return null;};}function patchUpdates(_0x3ca603){return function(_0x34c92e){try{jsonpatch['apply'](_0x34c92e,_0x3ca603,!![]);}catch(_0x3f9295){return BPromise[_0x9113('0x26')](_0x3f9295);}return _0x34c92e[_0x9113('0x27')]();};}function saveUpdates(_0x4671de,_0x62b601){return function(_0x1cafbc){if(_0x1cafbc){return _0x1cafbc['update'](_0x4671de)[_0x9113('0x28')](function(_0x3741f0){return _0x3741f0;});}return null;};}function removeEntity(_0x487b3f,_0x56c16b){return function(_0x7571f0){if(_0x7571f0){return _0x7571f0[_0x9113('0x29')]()[_0x9113('0x28')](function(){_0x487b3f[_0x9113('0x1e')](0xcc)[_0x9113('0x2a')]();});}};}function handleEntityNotFound(_0x598859,_0x46e113){return function(_0x2dceeb){if(!_0x2dceeb){_0x598859['sendStatus'](0x194);}return _0x2dceeb;};}function handleError(_0x5f06e6,_0x5e71e4){_0x5e71e4=_0x5e71e4||0x1f4;return function(_0x3e5c28){logger['error'](_0x3e5c28[_0x9113('0x2b')]);if(_0x3e5c28['name']){delete _0x3e5c28['name'];}_0x5f06e6[_0x9113('0x1e')](_0x5e71e4)[_0x9113('0x2c')](_0x3e5c28);};}exports[_0x9113('0x2d')]=function(_0x2c9a55,_0x5bcd6a){var _0x4057fc={},_0x587475={},_0x285cf1={'count':0x0,'rows':[]};var _0xfbd8ee=_[_0x9113('0x2e')](db[_0x9113('0x2f')][_0x9113('0x30')],function(_0x1e5a3f){return{'name':_0x1e5a3f[_0x9113('0x31')],'type':_0x1e5a3f[_0x9113('0x32')][_0x9113('0x33')]};});_0x587475[_0x9113('0x34')]=_[_0x9113('0x2e')](_0xfbd8ee,'name');_0x587475['query']=_[_0x9113('0x35')](_0x2c9a55[_0x9113('0x36')]);_0x587475[_0x9113('0x37')]=_[_0x9113('0x38')](_0x587475[_0x9113('0x34')],_0x587475[_0x9113('0x36')]);_0x4057fc[_0x9113('0x39')]=_[_0x9113('0x38')](_0x587475[_0x9113('0x34')],qs[_0x9113('0x3a')](_0x2c9a55['query'][_0x9113('0x3a')]));_0x4057fc[_0x9113('0x39')]=_0x4057fc[_0x9113('0x39')][_0x9113('0x3b')]?_0x4057fc[_0x9113('0x39')]:_0x587475[_0x9113('0x34')];if(!_0x2c9a55['query']['hasOwnProperty'](_0x9113('0x3c'))){_0x4057fc[_0x9113('0x22')]=qs[_0x9113('0x22')](_0x2c9a55[_0x9113('0x36')][_0x9113('0x22')]);_0x4057fc[_0x9113('0x20')]=qs[_0x9113('0x20')](_0x2c9a55['query']['offset']);}_0x4057fc[_0x9113('0x3d')]=qs[_0x9113('0x3e')](_0x2c9a55[_0x9113('0x36')]['sort']);_0x4057fc['where']=qs[_0x9113('0x37')](_[_0x9113('0x3f')](_0x2c9a55[_0x9113('0x36')],_0x587475['filters']),_0xfbd8ee);if(_0x2c9a55[_0x9113('0x36')]['filter']){_0x4057fc['where']=_[_0x9113('0x40')](_0x4057fc['where'],{'$or':_[_0x9113('0x2e')](_0xfbd8ee,function(_0x5c6699){if(_0x5c6699[_0x9113('0x32')]!==_0x9113('0x41')){var _0x3ea587={};_0x3ea587[_0x5c6699[_0x9113('0x42')]]={'$like':'%'+_0x2c9a55[_0x9113('0x36')]['filter']+'%'};return _0x3ea587;}})});}_0x4057fc=_[_0x9113('0x40')]({},_0x4057fc,_0x2c9a55[_0x9113('0x43')]);var _0x27f99f={'where':_0x4057fc[_0x9113('0x44')]};return db[_0x9113('0x2f')][_0x9113('0x23')](_0x27f99f)[_0x9113('0x28')](function(_0x167669){_0x285cf1[_0x9113('0x23')]=_0x167669;if(_0x2c9a55[_0x9113('0x36')][_0x9113('0x45')]){_0x4057fc['include']=[{'all':!![]}];}return db[_0x9113('0x2f')][_0x9113('0x46')](_0x4057fc);})['then'](function(_0x29113e){_0x285cf1['rows']=_0x29113e;return _0x285cf1;})[_0x9113('0x28')](respondWithFilteredResult(_0x5bcd6a,_0x4057fc))[_0x9113('0x47')](handleError(_0x5bcd6a,null));};exports[_0x9113('0x48')]=function(_0x8e8eb5,_0x1161aa){var _0x3dbd3b={'raw':!![],'where':{'id':_0x8e8eb5[_0x9113('0x49')]['id']}},_0x2e4c69={};_0x2e4c69['model']=_[_0x9113('0x35')](db[_0x9113('0x2f')]['rawAttributes']);_0x2e4c69['query']=_[_0x9113('0x35')](_0x8e8eb5[_0x9113('0x36')]);_0x2e4c69[_0x9113('0x37')]=_[_0x9113('0x38')](_0x2e4c69[_0x9113('0x34')],_0x2e4c69[_0x9113('0x36')]);_0x3dbd3b['attributes']=_[_0x9113('0x38')](_0x2e4c69[_0x9113('0x34')],qs[_0x9113('0x3a')](_0x8e8eb5[_0x9113('0x36')]['fields']));_0x3dbd3b[_0x9113('0x39')]=_0x3dbd3b[_0x9113('0x39')][_0x9113('0x3b')]?_0x3dbd3b[_0x9113('0x39')]:_0x2e4c69[_0x9113('0x34')];if(_0x8e8eb5[_0x9113('0x36')]['includeAll']){_0x3dbd3b[_0x9113('0x4a')]=[{'all':!![]}];}_0x3dbd3b=_[_0x9113('0x40')]({},_0x3dbd3b,_0x8e8eb5[_0x9113('0x43')]);return db[_0x9113('0x2f')]['find'](_0x3dbd3b)[_0x9113('0x28')](handleEntityNotFound(_0x1161aa,null))[_0x9113('0x28')](respondWithResult(_0x1161aa,null))['catch'](handleError(_0x1161aa,null));};exports[_0x9113('0x4b')]=function(_0x587e0a,_0x5a8a74){return db[_0x9113('0x2f')][_0x9113('0x4b')](_0x587e0a[_0x9113('0x4c')],{})[_0x9113('0x28')](respondWithResult(_0x5a8a74,0xc9))[_0x9113('0x47')](handleError(_0x5a8a74,null));};exports['update']=function(_0x2b134a,_0x21c2b9){if(_0x2b134a['body']['id']){delete _0x2b134a[_0x9113('0x4c')]['id'];}return db['ChatInternalMessage'][_0x9113('0x4d')]({'where':{'id':_0x2b134a[_0x9113('0x49')]['id']}})['then'](handleEntityNotFound(_0x21c2b9,null))[_0x9113('0x28')](saveUpdates(_0x2b134a[_0x9113('0x4c')],null))['then'](respondWithResult(_0x21c2b9,null))[_0x9113('0x47')](handleError(_0x21c2b9,null));};exports['destroy']=function(_0x5aebb4,_0x57d96f){return db['ChatInternalMessage'][_0x9113('0x4d')]({'where':{'id':_0x5aebb4[_0x9113('0x49')]['id']}})[_0x9113('0x28')](handleEntityNotFound(_0x57d96f,null))['then'](removeEntity(_0x57d96f,null))[_0x9113('0x47')](handleError(_0x57d96f,null));};exports['describe']=function(_0x5c675d,_0x12b9c4){return db[_0x9113('0x2f')]['describe']()[_0x9113('0x28')](respondWithResult(_0x12b9c4,null))['catch'](handleError(_0x12b9c4,null));};function wrapUser(_0x37e254){return function(_0x395790){var _0xe9e947=_0x37e254['get']({'plain':!![]});_0xe9e947['messages']=[];if(_0x395790){_0xe9e947[_0x9113('0x4e')]=_0x395790[_0x9113('0x4f')];_0xe9e947['lastMessage']=_0x395790;}else{_0xe9e947[_0x9113('0x4e')]=moment(0x0)[_0x9113('0x50')](_0x9113('0x51'));_0xe9e947[_0x9113('0x52')]={};}return _0xe9e947;};}exports[_0x9113('0x53')]=function(_0x55add6,_0x4d72e3,_0x43e1fd){var _0x343aa2=[];return db[_0x9113('0x54')][_0x9113('0x46')]({'where':{'role':[_0x9113('0x55'),_0x9113('0x56'),'user']},'attributes':['id',_0x9113('0x57'),_0x9113('0x42'),_0x9113('0x58'),_0x9113('0x59'),_0x9113('0x5a'),'online','lastLoginAt',_0x9113('0x5b'),_0x9113('0x5c')],'order':qs[_0x9113('0x3e')](_0x9113('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x9113('0x5e'),'attributes':['id',_0x9113('0x42'),_0x9113('0x32')],'through':{'attributes':[]}}]})[_0x9113('0x28')](function(_0x92a55a){if(_0x92a55a){var _0x31ac7f=_0x55add6[_0x9113('0x5f')][_0x9113('0x60')]({'plain':!![]});if(!_0x31ac7f)throw new Error(_0x9113('0x61'));if(_0x31ac7f[_0x9113('0x58')]===_0x9113('0x5f')){return db[_0x9113('0x62')][_0x9113('0x4d')]({'where':{'name':_0x9113('0x63'),'userProfileId':_0x31ac7f['userProfileId']},'raw':!![]})[_0x9113('0x28')](function(_0x14c180){if(_0x14c180){if(_0x14c180[_0x9113('0x64')]===0x0){return db[_0x9113('0x65')][_0x9113('0x46')]({'where':{'sectionId':_0x14c180['id']},'raw':!![]})[_0x9113('0x28')](function(_0xd1f60c){var _0x16044d=[];if(_[_0x9113('0x66')](_0xd1f60c)){_0x16044d=_[_0x9113('0x67')](_0x92a55a,function(_0x39d1a1){if(_0x39d1a1['role']!=='agent'){return _0x39d1a1;}});return _0x16044d;}else{for(var _0x3e4cd3=0x0;_0x3e4cd3<_0x92a55a['length'];_0x3e4cd3++){var _0x17c4b1=_0x92a55a[_0x3e4cd3];if(_0x17c4b1[_0x9113('0x58')]===_0x9113('0x55')){var _0x47c95b=_[_0x9113('0x4d')](_0xd1f60c,function(_0x25a6c1){return _0x25a6c1[_0x9113('0x68')]===_0x17c4b1['id'];});if(_0x47c95b)_0x16044d['push'](_0x17c4b1);}else{_0x16044d[_0x9113('0x69')](_0x17c4b1);}}return _0x16044d;}});}else{return _0x92a55a;}}else{var _0x2c67c8=_[_0x9113('0x67')](_0x92a55a,function(_0x45967d){if(_0x45967d[_0x9113('0x58')]!==_0x9113('0x55')){return _0x45967d;}});return _0x2c67c8;}});}else{return _0x92a55a;}}})[_0x9113('0x28')](function(_0x16178d){var _0x3f68ce=[];if(_0x16178d){_0x343aa2=_0x16178d;for(var _0x3e4e0f=0x0;_0x3e4e0f<_0x16178d[_0x9113('0x3b')];_0x3e4e0f+=0x1){_0x343aa2[_0x3e4e0f][_0x9113('0x6a')]=[];_0x3f68ce[_0x9113('0x69')](db[_0x9113('0x2f')][_0x9113('0x4d')]({'where':{'FromId':[_0x55add6[_0x9113('0x5f')]['id'],_0x16178d[_0x3e4e0f]['id']],'ToId':[_0x55add6[_0x9113('0x5f')]['id'],_0x16178d[_0x3e4e0f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9113('0x6b'),_0x9113('0x6c'),_0x9113('0x6d'),'body'],'order':qs['sort'](_0x9113('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9113('0x28')](wrapUser(_0x16178d[_0x3e4e0f])));}return BPromise[_0x9113('0x6f')](_0x3f68ce);}return[];})[_0x9113('0x28')](function(_0x16c681){return{'rows':_0x16c681,'count':_0x16c681[_0x9113('0x3b')]};})[_0x9113('0x28')](respondWithResult(_0x4d72e3,null))['catch'](handleError(_0x4d72e3,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index abb0edb..5f157ec 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 _0x5af6=['exports','events','save','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5af6,0x15d));var _0x65af=function(_0x25b684,_0x6d754e){_0x25b684=_0x25b684-0x0;var _0x5da1d7=_0x5af6[_0x25b684];return _0x5da1d7;};'use strict';var EventEmitter=require(_0x65af('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x65af('0x1'),'afterUpdate':'update','afterDestroy':_0x65af('0x2')};function emitEvent(_0x7eb646){return function(_0x42b7dd,_0x59facd,_0x3e3afa){ChatInternalMessageEvents[_0x65af('0x3')](_0x7eb646+':'+_0x42b7dd['id'],_0x42b7dd);ChatInternalMessageEvents[_0x65af('0x3')](_0x7eb646,_0x42b7dd);_0x3e3afa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x65af('0x4')](e,emitEvent(event));}}module[_0x65af('0x5')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xca50=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','update','remove'];(function(_0x2aa978,_0x444a1f){var _0x1b4452=function(_0x28f952){while(--_0x28f952){_0x2aa978['push'](_0x2aa978['shift']());}};_0x1b4452(++_0x444a1f);}(_0xca50,0xaf));var _0x0ca5=function(_0x4cab10,_0x42411c){_0x4cab10=_0x4cab10-0x0;var _0x5af3cc=_0xca50[_0x4cab10];return _0x5af3cc;};'use strict';var EventEmitter=require(_0x0ca5('0x0'));var ChatInternalMessage=require(_0x0ca5('0x1'))['db'][_0x0ca5('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ca5('0x3'),'afterDestroy':_0x0ca5('0x4')};function emitEvent(_0x2271b3){return function(_0x2db617,_0x1fbcfb,_0x5ef6fc){ChatInternalMessageEvents['emit'](_0x2271b3+':'+_0x2db617['id'],_0x2db617);ChatInternalMessageEvents[_0x0ca5('0x5')](_0x2271b3,_0x2db617);_0x5ef6fc(null);};}for(var e in events){if(events[_0x0ca5('0x6')](e)){var event=events[e];ChatInternalMessage[_0x0ca5('0x7')](e,emitEvent(event));}}module[_0x0ca5('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 564e574..58c3536 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 _0x1f70=['../../config/environment','./chatInternalMessage.attributes','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x122068,_0x4e0ff4){var _0x1874d8=function(_0x30b267){while(--_0x30b267){_0x122068['push'](_0x122068['shift']());}};_0x1874d8(++_0x4e0ff4);}(_0x1f70,0x126));var _0x01f7=function(_0x1c5703,_0x5da707){_0x1c5703=_0x1c5703-0x0;var _0x20e6c2=_0x1f70[_0x1c5703];return _0x20e6c2;};'use strict';var _=require('lodash');var util=require(_0x01f7('0x0'));var logger=require(_0x01f7('0x1'))('api');var moment=require(_0x01f7('0x2'));var BPromise=require(_0x01f7('0x3'));var rp=require(_0x01f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x01f7('0x5'));var config=require(_0x01f7('0x6'));var attributes=require(_0x01f7('0x7'));module['exports']=function(_0x554fdf,_0x525745){return _0x554fdf[_0x01f7('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x01f7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01f7('0xa'),'collate':_0x01f7('0xb')});}; \ No newline at end of file +var _0x5aa5=['chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5aa5,0x154));var _0x55aa=function(_0x3878c5,_0x5021a2){_0x3878c5=_0x3878c5-0x0;var _0xa9a557=_0x5aa5[_0x3878c5];return _0xa9a557;};'use strict';var _=require(_0x55aa('0x0'));var util=require('util');var logger=require(_0x55aa('0x1'))(_0x55aa('0x2'));var moment=require(_0x55aa('0x3'));var BPromise=require('bluebird');var rp=require(_0x55aa('0x4'));var fs=require('fs');var path=require(_0x55aa('0x5'));var rimraf=require(_0x55aa('0x6'));var config=require(_0x55aa('0x7'));var attributes=require(_0x55aa('0x8'));module[_0x55aa('0x9')]=function(_0x435b8a,_0x116da1){return _0x435b8a['define'](_0x55aa('0xa'),attributes,{'tableName':_0x55aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x55aa('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index ad9b3a4..cf3f3ac 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 _0x6a5a=['result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','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','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25d3c5,_0x29cb4c){var _0x1f0982=function(_0x451322){while(--_0x451322){_0x25d3c5['push'](_0x25d3c5['shift']());}};_0x1f0982(++_0x29cb4c);}(_0x6a5a,0xaa));var _0xa6a5=function(_0x40b146,_0x20cbf8){_0x40b146=_0x40b146-0x0;var _0x388875=_0x6a5a[_0x40b146];return _0x388875;};'use strict';var _=require(_0xa6a5('0x0'));var util=require(_0xa6a5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6a5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6a5('0x3'));var logger=require(_0xa6a5('0x4'))(_0xa6a5('0x5'));var config=require(_0xa6a5('0x6'));var jayson=require(_0xa6a5('0x7'));var client=jayson['client'][_0xa6a5('0x8')]({'port':0x232a});config[_0xa6a5('0x9')]=_[_0xa6a5('0xa')](config[_0xa6a5('0x9')],{'host':_0xa6a5('0xb'),'port':0x18eb});var socket=require(_0xa6a5('0xc'))(new Redis(config[_0xa6a5('0x9')]));require(_0xa6a5('0xd'))[_0xa6a5('0xe')](socket);function respondWithRpcPromise(_0x245ddf,_0x5a23f1,_0x29d13b){return new BPromise(function(_0x39c405,_0x1cb70a){return client[_0xa6a5('0xf')](_0x245ddf,_0x29d13b)[_0xa6a5('0x10')](function(_0x59f8b9){logger[_0xa6a5('0x11')](_0xa6a5('0x12'),_0x5a23f1,_0xa6a5('0x13'));logger[_0xa6a5('0x14')](_0xa6a5('0x15'),_0x5a23f1,'request\x20sent',JSON[_0xa6a5('0x16')](_0x59f8b9));if(_0x59f8b9['error']){if(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x18')]===0x1f4){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x1cb70a(_0x59f8b9[_0xa6a5('0x17')]['message']);}logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);return _0x39c405(_0x59f8b9[_0xa6a5('0x17')][_0xa6a5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x5a23f1,_0xa6a5('0x13'));_0x39c405(_0x59f8b9[_0xa6a5('0x1a')]['message']);}})[_0xa6a5('0x1b')](function(_0x2cf455){logger[_0xa6a5('0x17')](_0xa6a5('0x12'),_0x5a23f1,_0x2cf455);_0x1cb70a(_0x2cf455);});});} \ No newline at end of file +var _0xe8a4=['debug','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x8576ee,_0x36862b){var _0x1c0943=function(_0xe181c6){while(--_0xe181c6){_0x8576ee['push'](_0x8576ee['shift']());}};_0x1c0943(++_0x36862b);}(_0xe8a4,0x158));var _0x4e8a=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xe8a4[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x4e8a('0x0'));var util=require('util');var moment=require(_0x4e8a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x2'));var fs=require('fs');var Redis=require(_0x4e8a('0x3'));var db=require(_0x4e8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e8a('0x5'))(_0x4e8a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4e8a('0x7'));var client=jayson[_0x4e8a('0x8')][_0x4e8a('0x9')]({'port':0x232a});config[_0x4e8a('0xa')]=_[_0x4e8a('0xb')](config[_0x4e8a('0xa')],{'host':_0x4e8a('0xc'),'port':0x18eb});var socket=require(_0x4e8a('0xd'))(new Redis(config[_0x4e8a('0xa')]));require(_0x4e8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cbdf3,_0x3904bd,_0x395889){return new BPromise(function(_0x3ebde6,_0x5beaee){return client[_0x4e8a('0xf')](_0x1cbdf3,_0x395889)[_0x4e8a('0x10')](function(_0x50469a){logger[_0x4e8a('0x11')](_0x4e8a('0x12'),_0x3904bd,_0x4e8a('0x13'));logger[_0x4e8a('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'),JSON['stringify'](_0x50469a));if(_0x50469a[_0x4e8a('0x15')]){if(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x16')]===0x1f4){logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a['error'][_0x4e8a('0x17')]);return _0x5beaee(_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);}logger['error'](_0x4e8a('0x12'),_0x3904bd,_0x50469a[_0x4e8a('0x15')][_0x4e8a('0x17')]);return _0x3ebde6(_0x50469a[_0x4e8a('0x15')]['message']);}else{logger[_0x4e8a('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x3904bd,_0x4e8a('0x13'));_0x3ebde6(_0x50469a[_0x4e8a('0x18')][_0x4e8a('0x17')]);}})[_0x4e8a('0x19')](function(_0x2b51d5){logger[_0x4e8a('0x15')](_0x4e8a('0x12'),_0x3904bd,_0x2b51d5);_0x5beaee(_0x2b51d5);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 308a9e8..23cc84b 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 _0x2c1b=['remove','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x2c1b,0x1e8));var _0xb2c1=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x2c1b[_0x2aecb2];return _0x3ebb80;};'use strict';var ChatInternalMessageEvents=require(_0xb2c1('0x0'));var events=[_0xb2c1('0x1'),_0xb2c1('0x2'),'update'];function createListener(_0x5f241b,_0x3f6fc8){return function(_0xda8223){_0x3f6fc8[_0xb2c1('0x3')](_0x5f241b,_0xda8223);};}function removeListener(_0x496d57,_0x4b2acc){return function(){ChatInternalMessageEvents['removeListener'](_0x496d57,_0x4b2acc);};}exports[_0xb2c1('0x4')]=function(_0x181d12){for(var _0x4f128e=0x0,_0x293552=events[_0xb2c1('0x5')];_0x4f128e<_0x293552;_0x4f128e++){var _0x444d67=events[_0x4f128e];var _0x52d0ee=createListener(_0xb2c1('0x6')+_0x444d67,_0x181d12);ChatInternalMessageEvents['on'](_0x444d67,_0x52d0ee);}}; \ No newline at end of file +var _0x16d8=['update','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x16d8,0xb8));var _0x816d=function(_0x4595cb,_0x21e43c){_0x4595cb=_0x4595cb-0x0;var _0x49438b=_0x16d8[_0x4595cb];return _0x49438b;};'use strict';var ChatInternalMessageEvents=require(_0x816d('0x0'));var events=['save','remove',_0x816d('0x1')];function createListener(_0x56f0ad,_0x52676a){return function(_0x5abfdb){_0x52676a['emit'](_0x56f0ad,_0x5abfdb);};}function removeListener(_0x1c3f8a,_0xf5bbf0){return function(){ChatInternalMessageEvents['removeListener'](_0x1c3f8a,_0xf5bbf0);};}exports[_0x816d('0x2')]=function(_0x4b63c7){for(var _0x247569=0x0,_0x3f0848=events[_0x816d('0x3')];_0x247569<_0x3f0848;_0x247569++){var _0x39fc46=events[_0x247569];var _0x5e3fde=createListener(_0x816d('0x4')+_0x39fc46,_0x4b63c7);ChatInternalMessageEvents['on'](_0x39fc46,_0x5e3fde);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e4218bf..d38f369 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 _0x9140=['describe','/users','getUsers','/:id','show','post','create','put','update','delete','util','path','express','fs-extra','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x49a77d,_0x5b9dc5){var _0x4f5b3a=function(_0x1aadce){while(--_0x1aadce){_0x49a77d['push'](_0x49a77d['shift']());}};_0x4f5b3a(++_0x5b9dc5);}(_0x9140,0x14e));var _0x0914=function(_0x5128a0,_0x52c284){_0x5128a0=_0x5128a0-0x0;var _0x56d6da=_0x9140[_0x5128a0];return _0x56d6da;};'use strict';var multer=require('multer');var util=require(_0x0914('0x0'));var path=require(_0x0914('0x1'));var timeout=require('connect-timeout');var express=require(_0x0914('0x2'));var router=express['Router']();var fs_extra=require(_0x0914('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0914('0x4'));var controller=require(_0x0914('0x5'));router[_0x0914('0x6')]('/',auth[_0x0914('0x7')](),controller['index']);router[_0x0914('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x0914('0x8')]);router[_0x0914('0x6')](_0x0914('0x9'),auth[_0x0914('0x7')](),controller[_0x0914('0xa')]);router[_0x0914('0x6')](_0x0914('0xb'),auth[_0x0914('0x7')](),controller[_0x0914('0xc')]);router[_0x0914('0xd')]('/',auth[_0x0914('0x7')](),controller[_0x0914('0xe')]);router[_0x0914('0xf')](_0x0914('0xb'),controller[_0x0914('0x10')]);router[_0x0914('0x11')]('/:id',auth[_0x0914('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfb79=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','destroy','exports','multer'];(function(_0x12cc63,_0x38bf22){var _0x48243f=function(_0x57a0d7){while(--_0x57a0d7){_0x12cc63['push'](_0x12cc63['shift']());}};_0x48243f(++_0x38bf22);}(_0xfb79,0x19d));var _0x9fb7=function(_0x304d1f,_0x41e22f){_0x304d1f=_0x304d1f-0x0;var _0x3e3583=_0xfb79[_0x304d1f];return _0x3e3583;};'use strict';var multer=require(_0x9fb7('0x0'));var util=require(_0x9fb7('0x1'));var path=require(_0x9fb7('0x2'));var timeout=require(_0x9fb7('0x3'));var express=require(_0x9fb7('0x4'));var router=express[_0x9fb7('0x5')]();var fs_extra=require(_0x9fb7('0x6'));var auth=require(_0x9fb7('0x7'));var interaction=require(_0x9fb7('0x8'));var config=require('../../config/environment');var controller=require(_0x9fb7('0x9'));router[_0x9fb7('0xa')]('/',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0xc')]);router[_0x9fb7('0xa')](_0x9fb7('0xd'),auth[_0x9fb7('0xb')](),controller[_0x9fb7('0xe')]);router[_0x9fb7('0xa')](_0x9fb7('0xf'),auth['isAuthenticated'](),controller[_0x9fb7('0x10')]);router[_0x9fb7('0xa')](_0x9fb7('0x11'),auth['isAuthenticated'](),controller[_0x9fb7('0x12')]);router[_0x9fb7('0x13')]('/',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0x14')]);router['put']('/:id',controller['update']);router['delete']('/:id',auth[_0x9fb7('0xb')](),controller[_0x9fb7('0x15')]);module[_0x9fb7('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a57dab2..5ab2a13 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 _0x236c=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','TEXT','medium'];(function(_0x5b4c88,_0xb82a52){var _0x5dcc4f=function(_0x16f135){while(--_0x16f135){_0x5b4c88['push'](_0x5b4c88['shift']());}};_0x5dcc4f(++_0xb82a52);}(_0x236c,0x155));var _0xc236=function(_0x155fa8,_0x2f7e65){_0x155fa8=_0x155fa8-0x0;var _0x58dc85=_0x236c[_0x155fa8];return _0x58dc85;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'body':{'type':Sequelize[_0xc236('0x1')](_0xc236('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc236('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc236('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc236('0x4')]('in','out'),'defaultValue':_0xc236('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc236('0x6')]},'providerName':{'type':Sequelize[_0xc236('0x7')]},'providerResponse':{'type':Sequelize[_0xc236('0x1')]}}; \ No newline at end of file +var _0xbaf0=['DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3931ec,_0x5e9a6c){var _0x2d15e6=function(_0x3f745b){while(--_0x3f745b){_0x3931ec['push'](_0x3931ec['shift']());}};_0x2d15e6(++_0x5e9a6c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'body':{'type':Sequelize[_0x0baf('0x1')](_0x0baf('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0baf('0x4')]('in','out'),'defaultValue':_0x0baf('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0baf('0x6')]},'providerName':{'type':Sequelize[_0x0baf('0x7')]},'providerResponse':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 0fbf305..dc9929e 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 _0x20b4=['socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','map','ChatMessage','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','keys','rawAttributes','fields','include','find','create','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','Sequelize','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat','ChatInteraction','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','User','internal','rejectmessage','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20b4,0xeb));var _0x420b=function(_0x109e1d,_0x4474f0){_0x109e1d=_0x109e1d-0x0;var _0x549e93=_0x20b4[_0x109e1d];return _0x549e93;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x420b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x420b('0x1'));var rp=require(_0x420b('0x2'));var moment=require(_0x420b('0x3'));var BPromise=require(_0x420b('0x4'));var Mustache=require(_0x420b('0x5'));var util=require('util');var path=require(_0x420b('0x6'));var sox=require(_0x420b('0x7'));var csv=require(_0x420b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x420b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x420b('0xa'));var jsforce=require(_0x420b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x420b('0xc'));var Papa=require(_0x420b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x420b('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x420b('0xf'));var logger=require(_0x420b('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x420b('0x11'));var licenseUtil=require(_0x420b('0x12'));var db=require(_0x420b('0x13'))['db'];config[_0x420b('0x14')]=_[_0x420b('0x15')](config[_0x420b('0x14')],{'host':_0x420b('0x16'),'port':0x18eb});var socket=require(_0x420b('0x17'))(new Redis(config['redis']));require(_0x420b('0x18'))[_0x420b('0x19')](socket);var jayson=require(_0x420b('0x1a'));var client=jayson[_0x420b('0x1b')][_0x420b('0x1c')]({'port':0x232c});var client9002=jayson[_0x420b('0x1b')][_0x420b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x25b2f6,_0x26cbda,_0x5e70b1,_0x341ad4){return new BPromise(function(_0x54b9f9,_0x308db6){var _0x59f7e0=_0x341ad4||client;return _0x59f7e0['request'](_0x25b2f6,_0x5e70b1)[_0x420b('0x1d')](function(_0x54add6){logger['info'](_0x420b('0x1e'),_0x26cbda,_0x420b('0x1f'));logger[_0x420b('0x20')](_0x420b('0x21'),_0x26cbda,_0x420b('0x1f'),JSON[_0x420b('0x22')](_0x54add6));if(_0x54add6[_0x420b('0x23')]){if(_0x54add6[_0x420b('0x23')][_0x420b('0x24')]===0x1f4){logger[_0x420b('0x23')]('ChatMessage,\x20%s,\x20%s',_0x26cbda,_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);return _0x308db6(_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);}logger[_0x420b('0x23')](_0x420b('0x1e'),_0x26cbda,_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);return _0x54b9f9(_0x54add6[_0x420b('0x23')][_0x420b('0x25')]);}else{logger[_0x420b('0x26')](_0x420b('0x1e'),_0x26cbda,_0x420b('0x1f'));_0x54b9f9(_0x54add6[_0x420b('0x27')]['message']);}})[_0x420b('0x28')](function(_0x2d8cda){logger[_0x420b('0x23')](_0x420b('0x1e'),_0x26cbda,_0x2d8cda);_0x308db6(_0x2d8cda);});});}function respondWithStatusCode(_0x4d96f8,_0x159e49){_0x159e49=_0x159e49||0xcc;return function(_0x2583d4){if(_0x2583d4){return _0x4d96f8[_0x420b('0x29')](_0x159e49);}return _0x4d96f8[_0x420b('0x2a')](_0x159e49)[_0x420b('0x2b')]();};}function respondWithResult(_0x5ee1d0,_0x1753e7){_0x1753e7=_0x1753e7||0xc8;return function(_0x8132e3){if(_0x8132e3){return _0x5ee1d0['status'](_0x1753e7)[_0x420b('0x2c')](_0x8132e3);}};}function respondWithFilteredResult(_0x336760,_0x5471de){return function(_0xa579bc){if(_0xa579bc){var _0x295429=typeof _0x5471de[_0x420b('0x2d')]===_0x420b('0x2e')&&typeof _0x5471de[_0x420b('0x2f')]===_0x420b('0x2e');var _0x3bf4c9=_0xa579bc[_0x420b('0x30')];var _0x5e00e4=_0x295429?0x0:_0x5471de[_0x420b('0x2d')];var _0x53fbf4=_0x295429?_0xa579bc[_0x420b('0x30')]:_0x5471de[_0x420b('0x2d')]+_0x5471de['limit'];var _0x4bbb1d;if(_0x53fbf4>=_0x3bf4c9){_0x53fbf4=_0x3bf4c9;_0x4bbb1d=0xc8;}else{_0x4bbb1d=0xce;}_0x336760[_0x420b('0x2a')](_0x4bbb1d);return _0x336760[_0x420b('0x31')]('Content-Range',_0x5e00e4+'-'+_0x53fbf4+'/'+_0x3bf4c9)['json'](_0xa579bc);}return null;};}function patchUpdates(_0x25a5ab){return function(_0x21a636){try{jsonpatch[_0x420b('0x32')](_0x21a636,_0x25a5ab,!![]);}catch(_0x5bcd15){return BPromise[_0x420b('0x33')](_0x5bcd15);}return _0x21a636[_0x420b('0x34')]();};}function saveUpdates(_0x57f63d,_0x5c3813){return function(_0xf0a330){if(_0xf0a330){return _0xf0a330[_0x420b('0x35')](_0x57f63d)[_0x420b('0x1d')](function(_0x502d40){return _0x502d40;});}return null;};}function removeEntity(_0x828a4d,_0x13e137){return function(_0x34341){if(_0x34341){return _0x34341[_0x420b('0x36')]()[_0x420b('0x1d')](function(){_0x828a4d['status'](0xcc)[_0x420b('0x2b')]();});}};}function handleEntityNotFound(_0x3c0a1d,_0x3e5ac0){return function(_0xbd6b32){if(!_0xbd6b32){_0x3c0a1d[_0x420b('0x29')](0x194);}return _0xbd6b32;};}function handleError(_0x595b,_0x2c626d){_0x2c626d=_0x2c626d||0x1f4;return function(_0x4a7a14){logger[_0x420b('0x23')](_0x4a7a14[_0x420b('0x37')]);if(_0x4a7a14[_0x420b('0x38')]){delete _0x4a7a14[_0x420b('0x38')];}_0x595b['status'](_0x2c626d)['send'](_0x4a7a14);};}exports['index']=function(_0xef61b4,_0xfafeec){var _0x5663ae={},_0x468f92={},_0xb09649={'count':0x0,'rows':[]};var _0x1b721b=_[_0x420b('0x39')](db[_0x420b('0x3a')]['rawAttributes'],function(_0x154077){return{'name':_0x154077[_0x420b('0x3b')],'type':_0x154077[_0x420b('0x3c')][_0x420b('0x3d')]};});_0x468f92[_0x420b('0x3e')]=_[_0x420b('0x39')](_0x1b721b,_0x420b('0x38'));_0x468f92[_0x420b('0x3f')]=_['keys'](_0xef61b4[_0x420b('0x3f')]);_0x468f92[_0x420b('0x40')]=_[_0x420b('0x41')](_0x468f92[_0x420b('0x3e')],_0x468f92[_0x420b('0x3f')]);_0x5663ae[_0x420b('0x42')]=_['intersection'](_0x468f92[_0x420b('0x3e')],qs['fields'](_0xef61b4[_0x420b('0x3f')]['fields']));_0x5663ae[_0x420b('0x42')]=_0x5663ae[_0x420b('0x42')][_0x420b('0x43')]?_0x5663ae['attributes']:_0x468f92[_0x420b('0x3e')];if(!_0xef61b4[_0x420b('0x3f')][_0x420b('0x44')](_0x420b('0x45'))){_0x5663ae[_0x420b('0x2f')]=qs[_0x420b('0x2f')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x2f')]);_0x5663ae[_0x420b('0x2d')]=qs[_0x420b('0x2d')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x2d')]);}_0x5663ae[_0x420b('0x46')]=qs[_0x420b('0x47')](_0xef61b4[_0x420b('0x3f')][_0x420b('0x47')]);_0x5663ae[_0x420b('0x48')]=qs[_0x420b('0x40')](_[_0x420b('0x49')](_0xef61b4[_0x420b('0x3f')],_0x468f92[_0x420b('0x40')]),_0x1b721b);if(_0xef61b4[_0x420b('0x3f')][_0x420b('0x4a')]){_0x5663ae[_0x420b('0x48')]=_[_0x420b('0x4b')](_0x5663ae['where'],{'$or':_[_0x420b('0x39')](_0x1b721b,function(_0x3b5ce1){if(_0x3b5ce1['type']!==_0x420b('0x4c')){var _0x40ae76={};_0x40ae76[_0x3b5ce1['name']]={'$like':'%'+_0xef61b4['query'][_0x420b('0x4a')]+'%'};return _0x40ae76;}})});}_0x5663ae=_[_0x420b('0x4b')]({},_0x5663ae,_0xef61b4[_0x420b('0x4d')]);var _0x26593d={'where':_0x5663ae['where']};return db[_0x420b('0x3a')]['count'](_0x26593d)[_0x420b('0x1d')](function(_0xdb0782){_0xb09649['count']=_0xdb0782;if(_0xef61b4['query']['includeAll']){_0x5663ae['include']=[{'all':!![]}];}return db[_0x420b('0x3a')][_0x420b('0x4e')](_0x5663ae);})[_0x420b('0x1d')](function(_0x1fea3e){_0xb09649[_0x420b('0x4f')]=_0x1fea3e;return _0xb09649;})[_0x420b('0x1d')](respondWithFilteredResult(_0xfafeec,_0x5663ae))[_0x420b('0x28')](handleError(_0xfafeec,null));};exports[_0x420b('0x50')]=function(_0xe59d62,_0x47262e){var _0x234f39={'raw':!![],'where':{'id':_0xe59d62[_0x420b('0x51')]['id']}},_0x37ab97={};_0x37ab97[_0x420b('0x3e')]=_[_0x420b('0x52')](db[_0x420b('0x3a')][_0x420b('0x53')]);_0x37ab97[_0x420b('0x3f')]=_[_0x420b('0x52')](_0xe59d62[_0x420b('0x3f')]);_0x37ab97[_0x420b('0x40')]=_[_0x420b('0x41')](_0x37ab97[_0x420b('0x3e')],_0x37ab97[_0x420b('0x3f')]);_0x234f39['attributes']=_[_0x420b('0x41')](_0x37ab97[_0x420b('0x3e')],qs[_0x420b('0x54')](_0xe59d62[_0x420b('0x3f')][_0x420b('0x54')]));_0x234f39['attributes']=_0x234f39['attributes'][_0x420b('0x43')]?_0x234f39[_0x420b('0x42')]:_0x37ab97[_0x420b('0x3e')];if(_0xe59d62['query']['includeAll']){_0x234f39[_0x420b('0x55')]=[{'all':!![]}];}_0x234f39=_[_0x420b('0x4b')]({},_0x234f39,_0xe59d62[_0x420b('0x4d')]);return db['ChatMessage'][_0x420b('0x56')](_0x234f39)[_0x420b('0x1d')](handleEntityNotFound(_0x47262e,null))[_0x420b('0x1d')](respondWithResult(_0x47262e,null))[_0x420b('0x28')](handleError(_0x47262e,null));};exports[_0x420b('0x57')]=function(_0x107079,_0x2aa418){return db[_0x420b('0x3a')][_0x420b('0x57')](_0x107079[_0x420b('0x58')],{})[_0x420b('0x1d')](respondWithResult(_0x2aa418,0xc9))[_0x420b('0x28')](handleError(_0x2aa418,null));};exports[_0x420b('0x35')]=function(_0x2d1801,_0x5dfee4){if(_0x2d1801[_0x420b('0x58')]['id']){delete _0x2d1801['body']['id'];}return db['ChatMessage'][_0x420b('0x56')]({'where':{'id':_0x2d1801[_0x420b('0x51')]['id']}})[_0x420b('0x1d')](handleEntityNotFound(_0x5dfee4,null))['then'](saveUpdates(_0x2d1801['body'],null))[_0x420b('0x1d')](respondWithResult(_0x5dfee4,null))[_0x420b('0x28')](handleError(_0x5dfee4,null));};exports['destroy']=function(_0x9a54ea,_0x2fce36){return db['ChatMessage'][_0x420b('0x56')]({'where':{'id':_0x9a54ea[_0x420b('0x51')]['id']}})['then'](handleEntityNotFound(_0x2fce36,null))[_0x420b('0x1d')](removeEntity(_0x2fce36,null))[_0x420b('0x28')](handleError(_0x2fce36,null));};exports[_0x420b('0x59')]=function(_0x2404a6,_0x5d1a24){return db[_0x420b('0x3a')][_0x420b('0x59')]()[_0x420b('0x1d')](respondWithResult(_0x5d1a24,null))[_0x420b('0x28')](handleError(_0x5d1a24,null));};var interaction_log=require(_0x420b('0x10'))('chat-interactions');exports[_0x420b('0x5a')]=function(_0x4943b5,_0x4dad0b,_0x4ca000){var _0x4120f2={'agent':{},'channel':'chat'};if(_0x4943b5[_0x420b('0x58')]['id']){delete _0x4943b5['body']['id'];}_0x4943b5[_0x420b('0x58')]['read']=!![];_0x4943b5[_0x420b('0x58')][_0x420b('0x5b')]=moment()[_0x420b('0x5c')](_0x420b('0x5d'));_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')]=_0x4943b5['body'][_0x420b('0x5e')]||_0x4943b5[_0x420b('0x5f')]['id'];_0x4120f2[_0x420b('0x60')]['id']=_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')];return db[_0x420b('0x3a')]['find']({'where':{'id':_0x4943b5['params']['id'],'UserId':null}})[_0x420b('0x1d')](handleEntityNotFound(_0x4dad0b,null))['then'](saveUpdates(_0x4943b5[_0x420b('0x58')],null))[_0x420b('0x1d')](function(_0x22f39a){if(_0x22f39a){_0x4120f2[_0x420b('0x25')]=_0x22f39a['get']({'plain':!![]});return db['ChatInteraction'][_0x420b('0x56')]({'where':{'id':_0x22f39a[_0x420b('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x4dad0b,null))[_0x420b('0x1d')](function(_0x138640){if(_0x138640){return _0x138640[_0x420b('0x35')]({'UserId':_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')],'read1stAt':_[_0x420b('0x62')](_0x138640[_0x420b('0x63')])?moment()[_0x420b('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x420b('0x1d')](function(_0x32bdce){if(_0x32bdce){_0x4120f2[_0x420b('0x64')]=_0x32bdce[_0x420b('0x65')]({'plain':!![]});interaction_log['info'](_0x420b('0x66'),_0x4943b5['user']['id'],_0x4943b5[_0x420b('0x5f')][_0x420b('0x38')],_0x4943b5[_0x420b('0x5f')][_0x420b('0x67')],_0x4120f2[_0x420b('0x64')]['id'],_0x4943b5[_0x420b('0x58')]?JSON['stringify'](_0x4943b5[_0x420b('0x58')]):_0x420b('0x68'));return respondWithRpcPromise('AcceptMessage',_0x420b('0x69'),_0x4120f2);}return null;})['then'](function(_0x2837ef){var _0x2303f4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2837ef[_0x420b('0x25')]['ContactId'];return db['sequelize'][_0x420b('0x3f')](_0x2303f4,{'type':db[_0x420b('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})[_0x420b('0x1d')](function(_0xe55c61){return _0xe55c61;});})[_0x420b('0x1d')](function(_0x3de63a){if(_0x3de63a){_0x4120f2[_0x420b('0x25')][_0x420b('0x6b')]=_0x3de63a[0x0];if(!_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')])return;return db['User'][_0x420b('0x56')]({'where':{'id':_0x4943b5[_0x420b('0x58')][_0x420b('0x5e')],'role':_0x420b('0x60')},'attributes':['id',_0x420b('0x38'),_0x420b('0x6c'),_0x420b('0x6d'),'internal'],'raw':!![]});}return null;})[_0x420b('0x1d')](function(_0x5e4644){if(!_0x5e4644)return null;_0x4120f2[_0x420b('0x25')]['agent']=_0x5e4644;return _0x4120f2;})[_0x420b('0x1d')](function(_0x45173c){if(_0x45173c){if(_0x4943b5[_0x420b('0x58')]['manual']){_0x4120f2[_0x420b('0x25')][_0x420b('0x6e')]=util[_0x420b('0x5c')](_0x420b('0x6f'),_0x4943b5[_0x420b('0x5f')][_0x420b('0x38')]);_0x4120f2[_0x420b('0x25')][_0x420b('0x70')]=_0x4120f2[_0x420b('0x70')];_0x4120f2['message'][_0x420b('0x71')]=_0x4120f2['channel'];_0x4120f2[_0x420b('0x25')][_0x420b('0x72')]=_0x420b('0x5a');return respondWithRpcPromise(_0x420b('0x73'),_0x420b('0x73'),{'event':_0x420b('0x74'),'message':_[_0x420b('0x4b')](_0x4120f2['message'],JSON[_0x420b('0x75')](_0x4120f2['interaction']['formData']))},client9002)['then'](function(){return _0x4120f2;});}return _0x4120f2;}return null;})[_0x420b('0x1d')](respondWithResult(_0x4dad0b,null))[_0x420b('0x28')](handleError(_0x4dad0b,null));};var interaction_log=require(_0x420b('0x10'))('chat-interactions');exports[_0x420b('0x33')]=function(_0x10da51,_0x18f363,_0x579538){var _0x142de2={'agent':{},'channel':_0x420b('0x76')};if(_0x10da51[_0x420b('0x58')]['id']){delete _0x10da51[_0x420b('0x58')]['id'];}_0x10da51[_0x420b('0x58')]['UserId']=_0x10da51[_0x420b('0x58')][_0x420b('0x5e')]||_0x10da51[_0x420b('0x5f')]['id'];_0x142de2[_0x420b('0x60')]['id']=_0x10da51[_0x420b('0x58')]['UserId'];return db[_0x420b('0x3a')]['find']({'where':{'id':_0x10da51[_0x420b('0x51')]['id'],'UserId':null}})[_0x420b('0x1d')](handleEntityNotFound(_0x18f363,null))[_0x420b('0x1d')](function(_0x19def9){if(_0x19def9){_0x142de2[_0x420b('0x25')]=_0x19def9['get']({'plain':!![]});return db[_0x420b('0x77')][_0x420b('0x56')]({'where':{'id':_0x19def9[_0x420b('0x61')]}});}return null;})[_0x420b('0x1d')](handleEntityNotFound(_0x18f363,null))['then'](function(_0x45ce79){if(_0x45ce79){_0x142de2['interaction']=_0x45ce79['get']({'plain':!![]});interaction_log[_0x420b('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10da51[_0x420b('0x5f')]['id'],_0x10da51[_0x420b('0x5f')][_0x420b('0x38')],_0x10da51[_0x420b('0x5f')][_0x420b('0x67')],_0x142de2['interaction']['id'],_0x10da51[_0x420b('0x58')]?JSON['stringify'](_0x10da51[_0x420b('0x58')]):_0x420b('0x68'));return respondWithRpcPromise(_0x420b('0x78'),_0x420b('0x79'),_0x142de2);}return null;})[_0x420b('0x1d')](function(_0xa48d13){var _0x5e5962=_0x420b('0x7a')+_0xa48d13[_0x420b('0x25')][_0x420b('0x7b')];return db['sequelize'][_0x420b('0x3f')](_0x5e5962,{'type':db[_0x420b('0x6a')][_0x420b('0x7c')][_0x420b('0x7d')],'raw':!![]})[_0x420b('0x1d')](function(_0x3c45a9){return _0x3c45a9;});})[_0x420b('0x1d')](function(_0x34866f){if(_0x34866f){_0x142de2[_0x420b('0x25')][_0x420b('0x6b')]=_0x34866f[0x0];if(!_0x10da51[_0x420b('0x58')]['UserId'])return;return db[_0x420b('0x7e')]['find']({'where':{'id':_0x10da51[_0x420b('0x58')][_0x420b('0x5e')],'role':'agent'},'attributes':['id','name',_0x420b('0x6c'),_0x420b('0x6d'),_0x420b('0x7f')],'raw':!![]});}return null;})[_0x420b('0x1d')](function(_0xf63603){if(!_0xf63603)return null;_0x142de2[_0x420b('0x25')][_0x420b('0x60')]=_0xf63603;return _0x142de2;})['then'](function(_0x59d289){if(_0x59d289){_0x59d289['message'][_0x420b('0x6e')]=util[_0x420b('0x5c')](_0x420b('0x6f'),_0x10da51[_0x420b('0x5f')][_0x420b('0x38')]);_0x59d289[_0x420b('0x25')]['channel']=_0x142de2['channel'];_0x59d289[_0x420b('0x25')]['motionChannel']=_0x142de2['channel'];_0x59d289[_0x420b('0x25')][_0x420b('0x72')]='reject';respondWithRpcPromise(_0x420b('0x73'),_0x420b('0x73'),{'event':_0x420b('0x80'),'message':_[_0x420b('0x4b')](_0x142de2['message'],JSON['parse'](_0x142de2[_0x420b('0x64')]['formData']))},client9002);return _0x142de2;}return null;})[_0x420b('0x1d')](respondWithResult(_0x18f363,null))[_0x420b('0x28')](handleError(_0x18f363,null));}; \ No newline at end of file +var _0x4dbf=['path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','destroy','then','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','describe','chat-interactions','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x1e8c87,_0x599379){var _0x2a80c8=function(_0x4c5690){while(--_0x4c5690){_0x1e8c87['push'](_0x1e8c87['shift']());}};_0x2a80c8(++_0x599379);}(_0x4dbf,0x7f));var _0xf4db=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x4dbf[_0x3c2166];return _0x30ccc3;};'use strict';var emlformat=require(_0xf4db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf4db('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4db('0x2'));var moment=require(_0xf4db('0x3'));var BPromise=require(_0xf4db('0x4'));var Mustache=require(_0xf4db('0x5'));var util=require(_0xf4db('0x6'));var path=require(_0xf4db('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4db('0x8'));var squel=require(_0xf4db('0x9'));var crypto=require(_0xf4db('0xa'));var jsforce=require(_0xf4db('0xb'));var deskjs=require(_0xf4db('0xc'));var toCsv=require(_0xf4db('0xd'));var querystring=require('querystring');var Papa=require(_0xf4db('0xe'));var Redis=require(_0xf4db('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf4db('0x10'));var as=require(_0xf4db('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4db('0x12'))(_0xf4db('0x13'));var utils=require(_0xf4db('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf4db('0x15'));var db=require(_0xf4db('0x16'))['db'];config[_0xf4db('0x17')]=_[_0xf4db('0x18')](config[_0xf4db('0x17')],{'host':_0xf4db('0x19'),'port':0x18eb});var socket=require(_0xf4db('0x1a'))(new Redis(config[_0xf4db('0x17')]));require(_0xf4db('0x1b'))[_0xf4db('0x1c')](socket);var jayson=require(_0xf4db('0x1d'));var client=jayson[_0xf4db('0x1e')][_0xf4db('0x1f')]({'port':0x232c});var client9002=jayson[_0xf4db('0x1e')][_0xf4db('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x171a95,_0x51121d,_0x5a16ba,_0x320006){return new BPromise(function(_0x38721a,_0x474e2c){var _0x2187a3=_0x320006||client;return _0x2187a3[_0xf4db('0x20')](_0x171a95,_0x5a16ba)['then'](function(_0x103e94){logger['info'](_0xf4db('0x21'),_0x51121d,_0xf4db('0x22'));logger[_0xf4db('0x23')](_0xf4db('0x24'),_0x51121d,'request\x20sent',JSON[_0xf4db('0x25')](_0x103e94));if(_0x103e94[_0xf4db('0x26')]){if(_0x103e94['error'][_0xf4db('0x27')]===0x1f4){logger[_0xf4db('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);return _0x474e2c(_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);}logger[_0xf4db('0x26')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0x103e94[_0xf4db('0x26')]['message']);return _0x38721a(_0x103e94[_0xf4db('0x26')][_0xf4db('0x28')]);}else{logger[_0xf4db('0x29')]('ChatMessage,\x20%s,\x20%s',_0x51121d,_0xf4db('0x22'));_0x38721a(_0x103e94[_0xf4db('0x2a')][_0xf4db('0x28')]);}})['catch'](function(_0x142ecf){logger[_0xf4db('0x26')](_0xf4db('0x21'),_0x51121d,_0x142ecf);_0x474e2c(_0x142ecf);});});}function respondWithStatusCode(_0x279468,_0xad2c96){_0xad2c96=_0xad2c96||0xcc;return function(_0x457e19){if(_0x457e19){return _0x279468['sendStatus'](_0xad2c96);}return _0x279468[_0xf4db('0x2b')](_0xad2c96)[_0xf4db('0x2c')]();};}function respondWithResult(_0x365779,_0x5aff8f){_0x5aff8f=_0x5aff8f||0xc8;return function(_0x27cb6c){if(_0x27cb6c){return _0x365779[_0xf4db('0x2b')](_0x5aff8f)[_0xf4db('0x2d')](_0x27cb6c);}};}function respondWithFilteredResult(_0x4547d6,_0x3d80a6){return function(_0x20b4de){if(_0x20b4de){var _0x20a5c6=typeof _0x3d80a6[_0xf4db('0x2e')]==='undefined'&&typeof _0x3d80a6[_0xf4db('0x2f')]===_0xf4db('0x30');var _0x32d71f=_0x20b4de[_0xf4db('0x31')];var _0x5b03a6=_0x20a5c6?0x0:_0x3d80a6[_0xf4db('0x2e')];var _0x496cf1=_0x20a5c6?_0x20b4de[_0xf4db('0x31')]:_0x3d80a6[_0xf4db('0x2e')]+_0x3d80a6[_0xf4db('0x2f')];var _0x397581;if(_0x496cf1>=_0x32d71f){_0x496cf1=_0x32d71f;_0x397581=0xc8;}else{_0x397581=0xce;}_0x4547d6['status'](_0x397581);return _0x4547d6['set'](_0xf4db('0x32'),_0x5b03a6+'-'+_0x496cf1+'/'+_0x32d71f)[_0xf4db('0x2d')](_0x20b4de);}return null;};}function patchUpdates(_0x9e8181){return function(_0x2b99d1){try{jsonpatch['apply'](_0x2b99d1,_0x9e8181,!![]);}catch(_0x41907c){return BPromise[_0xf4db('0x33')](_0x41907c);}return _0x2b99d1[_0xf4db('0x34')]();};}function saveUpdates(_0x3f4e24,_0x5a2668){return function(_0x481573){if(_0x481573){return _0x481573['update'](_0x3f4e24)['then'](function(_0x22d44f){return _0x22d44f;});}return null;};}function removeEntity(_0x305f98,_0x500be9){return function(_0x4e494b){if(_0x4e494b){return _0x4e494b[_0xf4db('0x35')]()[_0xf4db('0x36')](function(){_0x305f98['status'](0xcc)[_0xf4db('0x2c')]();});}};}function handleEntityNotFound(_0x5dff65,_0x2ba683){return function(_0x4f2ae8){if(!_0x4f2ae8){_0x5dff65['sendStatus'](0x194);}return _0x4f2ae8;};}function handleError(_0x307d76,_0x304a72){_0x304a72=_0x304a72||0x1f4;return function(_0x480432){logger[_0xf4db('0x26')](_0x480432[_0xf4db('0x37')]);if(_0x480432[_0xf4db('0x38')]){delete _0x480432['name'];}_0x307d76['status'](_0x304a72)[_0xf4db('0x39')](_0x480432);};}exports[_0xf4db('0x3a')]=function(_0x5a1d9f,_0x5784fd){var _0x331d2b={},_0x107ebd={},_0x13a45e={'count':0x0,'rows':[]};var _0x162831=_['map'](db[_0xf4db('0x3b')][_0xf4db('0x3c')],function(_0x81d3ca){return{'name':_0x81d3ca[_0xf4db('0x3d')],'type':_0x81d3ca[_0xf4db('0x3e')][_0xf4db('0x3f')]};});_0x107ebd['model']=_[_0xf4db('0x40')](_0x162831,_0xf4db('0x38'));_0x107ebd[_0xf4db('0x41')]=_['keys'](_0x5a1d9f[_0xf4db('0x41')]);_0x107ebd['filters']=_[_0xf4db('0x42')](_0x107ebd['model'],_0x107ebd[_0xf4db('0x41')]);_0x331d2b['attributes']=_['intersection'](_0x107ebd[_0xf4db('0x43')],qs[_0xf4db('0x44')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x44')]));_0x331d2b[_0xf4db('0x45')]=_0x331d2b[_0xf4db('0x45')][_0xf4db('0x46')]?_0x331d2b['attributes']:_0x107ebd[_0xf4db('0x43')];if(!_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x47')](_0xf4db('0x48'))){_0x331d2b[_0xf4db('0x2f')]=qs[_0xf4db('0x2f')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x2f')]);_0x331d2b['offset']=qs[_0xf4db('0x2e')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x2e')]);}_0x331d2b[_0xf4db('0x49')]=qs[_0xf4db('0x4a')](_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4a')]);_0x331d2b[_0xf4db('0x4b')]=qs[_0xf4db('0x4c')](_[_0xf4db('0x4d')](_0x5a1d9f[_0xf4db('0x41')],_0x107ebd[_0xf4db('0x4c')]),_0x162831);if(_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4e')]){_0x331d2b['where']=_[_0xf4db('0x4f')](_0x331d2b[_0xf4db('0x4b')],{'$or':_[_0xf4db('0x40')](_0x162831,function(_0x561ff8){if(_0x561ff8[_0xf4db('0x3e')]!==_0xf4db('0x50')){var _0x310e0c={};_0x310e0c[_0x561ff8[_0xf4db('0x38')]]={'$like':'%'+_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x4e')]+'%'};return _0x310e0c;}})});}_0x331d2b=_['merge']({},_0x331d2b,_0x5a1d9f[_0xf4db('0x51')]);var _0x29a5b9={'where':_0x331d2b[_0xf4db('0x4b')]};return db['ChatMessage'][_0xf4db('0x31')](_0x29a5b9)['then'](function(_0x2c8f6e){_0x13a45e['count']=_0x2c8f6e;if(_0x5a1d9f[_0xf4db('0x41')][_0xf4db('0x52')]){_0x331d2b[_0xf4db('0x53')]=[{'all':!![]}];}return db[_0xf4db('0x3b')]['findAll'](_0x331d2b);})[_0xf4db('0x36')](function(_0x25b9a8){_0x13a45e[_0xf4db('0x54')]=_0x25b9a8;return _0x13a45e;})[_0xf4db('0x36')](respondWithFilteredResult(_0x5784fd,_0x331d2b))[_0xf4db('0x55')](handleError(_0x5784fd,null));};exports[_0xf4db('0x56')]=function(_0x4ed5b7,_0x180150){var _0x160cb0={'raw':!![],'where':{'id':_0x4ed5b7[_0xf4db('0x57')]['id']}},_0x35ef2e={};_0x35ef2e[_0xf4db('0x43')]=_[_0xf4db('0x58')](db[_0xf4db('0x3b')][_0xf4db('0x3c')]);_0x35ef2e['query']=_[_0xf4db('0x58')](_0x4ed5b7[_0xf4db('0x41')]);_0x35ef2e['filters']=_[_0xf4db('0x42')](_0x35ef2e[_0xf4db('0x43')],_0x35ef2e['query']);_0x160cb0['attributes']=_['intersection'](_0x35ef2e['model'],qs[_0xf4db('0x44')](_0x4ed5b7['query']['fields']));_0x160cb0[_0xf4db('0x45')]=_0x160cb0['attributes'][_0xf4db('0x46')]?_0x160cb0[_0xf4db('0x45')]:_0x35ef2e['model'];if(_0x4ed5b7[_0xf4db('0x41')]['includeAll']){_0x160cb0[_0xf4db('0x53')]=[{'all':!![]}];}_0x160cb0=_[_0xf4db('0x4f')]({},_0x160cb0,_0x4ed5b7[_0xf4db('0x51')]);return db[_0xf4db('0x3b')][_0xf4db('0x59')](_0x160cb0)[_0xf4db('0x36')](handleEntityNotFound(_0x180150,null))[_0xf4db('0x36')](respondWithResult(_0x180150,null))[_0xf4db('0x55')](handleError(_0x180150,null));};exports[_0xf4db('0x5a')]=function(_0x38e009,_0x2206e0){return db[_0xf4db('0x3b')][_0xf4db('0x5a')](_0x38e009[_0xf4db('0x5b')],{})[_0xf4db('0x36')](respondWithResult(_0x2206e0,0xc9))[_0xf4db('0x55')](handleError(_0x2206e0,null));};exports[_0xf4db('0x5c')]=function(_0x4e41d5,_0x41a966){if(_0x4e41d5['body']['id']){delete _0x4e41d5[_0xf4db('0x5b')]['id'];}return db[_0xf4db('0x3b')][_0xf4db('0x59')]({'where':{'id':_0x4e41d5['params']['id']}})[_0xf4db('0x36')](handleEntityNotFound(_0x41a966,null))['then'](saveUpdates(_0x4e41d5[_0xf4db('0x5b')],null))[_0xf4db('0x36')](respondWithResult(_0x41a966,null))[_0xf4db('0x55')](handleError(_0x41a966,null));};exports[_0xf4db('0x35')]=function(_0x2601f5,_0x35790b){return db[_0xf4db('0x3b')]['find']({'where':{'id':_0x2601f5[_0xf4db('0x57')]['id']}})['then'](handleEntityNotFound(_0x35790b,null))['then'](removeEntity(_0x35790b,null))[_0xf4db('0x55')](handleError(_0x35790b,null));};exports[_0xf4db('0x5d')]=function(_0x42b504,_0x26a791){return db[_0xf4db('0x3b')][_0xf4db('0x5d')]()[_0xf4db('0x36')](respondWithResult(_0x26a791,null))['catch'](handleError(_0x26a791,null));};var interaction_log=require(_0xf4db('0x12'))(_0xf4db('0x5e'));exports['accept']=function(_0x59a122,_0xb081af,_0x589430){var _0x1f5482={'agent':{},'channel':_0xf4db('0x5f')};if(_0x59a122[_0xf4db('0x5b')]['id']){delete _0x59a122[_0xf4db('0x5b')]['id'];}_0x59a122[_0xf4db('0x5b')]['read']=!![];_0x59a122['body'][_0xf4db('0x60')]=moment()[_0xf4db('0x61')](_0xf4db('0x62'));_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')]=_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')]||_0x59a122['user']['id'];_0x1f5482[_0xf4db('0x64')]['id']=_0x59a122['body']['UserId'];return db[_0xf4db('0x3b')]['find']({'where':{'id':_0x59a122[_0xf4db('0x57')]['id'],'UserId':null}})[_0xf4db('0x36')](handleEntityNotFound(_0xb081af,null))[_0xf4db('0x36')](saveUpdates(_0x59a122['body'],null))[_0xf4db('0x36')](function(_0x4c519d){if(_0x4c519d){_0x1f5482[_0xf4db('0x28')]=_0x4c519d[_0xf4db('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xf4db('0x59')]({'where':{'id':_0x4c519d['ChatInteractionId']}});}return null;})[_0xf4db('0x36')](handleEntityNotFound(_0xb081af,null))[_0xf4db('0x36')](function(_0x379326){if(_0x379326){return _0x379326[_0xf4db('0x5c')]({'UserId':_0x59a122[_0xf4db('0x5b')]['UserId'],'read1stAt':_['isNil'](_0x379326[_0xf4db('0x66')])?moment()['format'](_0xf4db('0x62')):undefined});}return null;})[_0xf4db('0x36')](function(_0x1c5384){if(_0x1c5384){_0x1f5482[_0xf4db('0x67')]=_0x1c5384[_0xf4db('0x65')]({'plain':!![]});interaction_log[_0xf4db('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59a122[_0xf4db('0x68')]['id'],_0x59a122[_0xf4db('0x68')][_0xf4db('0x38')],_0x59a122['user'][_0xf4db('0x69')],_0x1f5482[_0xf4db('0x67')]['id'],_0x59a122['body']?JSON['stringify'](_0x59a122['body']):_0xf4db('0x6a'));return respondWithRpcPromise(_0xf4db('0x6b'),_0xf4db('0x6c'),_0x1f5482);}return null;})['then'](function(_0x32e80e){var _0xce865d=_0xf4db('0x6d')+_0x32e80e[_0xf4db('0x28')][_0xf4db('0x6e')];return db[_0xf4db('0x6f')]['query'](_0xce865d,{'type':db[_0xf4db('0x70')][_0xf4db('0x71')][_0xf4db('0x72')],'raw':!![]})[_0xf4db('0x36')](function(_0x4410ab){return _0x4410ab;});})[_0xf4db('0x36')](function(_0x292efa){if(_0x292efa){_0x1f5482[_0xf4db('0x28')][_0xf4db('0x73')]=_0x292efa[0x0];if(!_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')])return;return db[_0xf4db('0x74')][_0xf4db('0x59')]({'where':{'id':_0x59a122[_0xf4db('0x5b')][_0xf4db('0x63')],'role':'agent'},'attributes':['id',_0xf4db('0x38'),_0xf4db('0x75'),_0xf4db('0x76'),_0xf4db('0x77')],'raw':!![]});}return null;})[_0xf4db('0x36')](function(_0x5934fd){if(!_0x5934fd)return null;_0x1f5482[_0xf4db('0x28')][_0xf4db('0x64')]=_0x5934fd;return _0x1f5482;})['then'](function(_0x5a43ca){if(_0x5a43ca){if(_0x59a122[_0xf4db('0x5b')][_0xf4db('0x78')]){_0x1f5482[_0xf4db('0x28')][_0xf4db('0x79')]=util[_0xf4db('0x61')](_0xf4db('0x7a'),_0x59a122[_0xf4db('0x68')][_0xf4db('0x38')]);_0x1f5482[_0xf4db('0x28')][_0xf4db('0x7b')]=_0x1f5482['channel'];_0x1f5482['message'][_0xf4db('0x7c')]=_0x1f5482['channel'];_0x1f5482[_0xf4db('0x28')][_0xf4db('0x7d')]=_0xf4db('0x7e');return respondWithRpcPromise(_0xf4db('0x7f'),'EventManager',{'event':_0xf4db('0x80'),'message':_[_0xf4db('0x4f')](_0x1f5482[_0xf4db('0x28')],JSON[_0xf4db('0x81')](_0x1f5482['interaction'][_0xf4db('0x82')]))},client9002)[_0xf4db('0x36')](function(){return _0x1f5482;});}return _0x1f5482;}return null;})['then'](respondWithResult(_0xb081af,null))['catch'](handleError(_0xb081af,null));};var interaction_log=require(_0xf4db('0x12'))(_0xf4db('0x5e'));exports[_0xf4db('0x33')]=function(_0x493441,_0x258c10,_0x1453da){var _0x3eeaa6={'agent':{},'channel':'chat'};if(_0x493441[_0xf4db('0x5b')]['id']){delete _0x493441[_0xf4db('0x5b')]['id'];}_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')]=_0x493441['body'][_0xf4db('0x63')]||_0x493441[_0xf4db('0x68')]['id'];_0x3eeaa6[_0xf4db('0x64')]['id']=_0x493441[_0xf4db('0x5b')]['UserId'];return db[_0xf4db('0x3b')][_0xf4db('0x59')]({'where':{'id':_0x493441['params']['id'],'UserId':null}})[_0xf4db('0x36')](handleEntityNotFound(_0x258c10,null))[_0xf4db('0x36')](function(_0x4cc39c){if(_0x4cc39c){_0x3eeaa6['message']=_0x4cc39c[_0xf4db('0x65')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x4cc39c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x258c10,null))[_0xf4db('0x36')](function(_0x264adb){if(_0x264adb){_0x3eeaa6[_0xf4db('0x67')]=_0x264adb[_0xf4db('0x65')]({'plain':!![]});interaction_log[_0xf4db('0x29')](_0xf4db('0x83'),_0x493441[_0xf4db('0x68')]['id'],_0x493441[_0xf4db('0x68')]['name'],_0x493441[_0xf4db('0x68')]['role'],_0x3eeaa6[_0xf4db('0x67')]['id'],_0x493441['body']?JSON[_0xf4db('0x25')](_0x493441[_0xf4db('0x5b')]):'null');return respondWithRpcPromise('RejectMessage',_0xf4db('0x84'),_0x3eeaa6);}return null;})[_0xf4db('0x36')](function(_0x57c439){var _0x2be96b=_0xf4db('0x6d')+_0x57c439[_0xf4db('0x28')][_0xf4db('0x6e')];return db['sequelize']['query'](_0x2be96b,{'type':db[_0xf4db('0x70')][_0xf4db('0x71')][_0xf4db('0x72')],'raw':!![]})['then'](function(_0x21826d){return _0x21826d;});})[_0xf4db('0x36')](function(_0x225362){if(_0x225362){_0x3eeaa6[_0xf4db('0x28')][_0xf4db('0x73')]=_0x225362[0x0];if(!_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')])return;return db[_0xf4db('0x74')][_0xf4db('0x59')]({'where':{'id':_0x493441[_0xf4db('0x5b')][_0xf4db('0x63')],'role':_0xf4db('0x64')},'attributes':['id',_0xf4db('0x38'),'fullname',_0xf4db('0x76'),_0xf4db('0x77')],'raw':!![]});}return null;})['then'](function(_0x2e35fa){if(!_0x2e35fa)return null;_0x3eeaa6[_0xf4db('0x28')][_0xf4db('0x64')]=_0x2e35fa;return _0x3eeaa6;})['then'](function(_0x88f2ed){if(_0x88f2ed){_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x79')]=util[_0xf4db('0x61')](_0xf4db('0x7a'),_0x493441[_0xf4db('0x68')][_0xf4db('0x38')]);_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x7b')]=_0x3eeaa6[_0xf4db('0x7b')];_0x88f2ed[_0xf4db('0x28')][_0xf4db('0x7c')]=_0x3eeaa6['channel'];_0x88f2ed['message']['event']='reject';respondWithRpcPromise(_0xf4db('0x7f'),'EventManager',{'event':_0xf4db('0x85'),'message':_[_0xf4db('0x4f')](_0x3eeaa6[_0xf4db('0x28')],JSON[_0xf4db('0x81')](_0x3eeaa6[_0xf4db('0x67')][_0xf4db('0x82')]))},client9002);return _0x3eeaa6;}return null;})[_0xf4db('0x36')](respondWithResult(_0x258c10,null))['catch'](handleError(_0x258c10,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 34f527d..b304aef 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 _0xe760=['exports','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xe760,0xc9));var _0x0e76=function(_0x3f5547,_0x1a4fd2){_0x3f5547=_0x3f5547-0x0;var _0x23e025=_0xe760[_0x3f5547];return _0x23e025;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x0e76('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0e76('0x1')](0x0);var events={'afterCreate':_0x0e76('0x2'),'afterUpdate':_0x0e76('0x3'),'afterDestroy':'remove'};function emitEvent(_0x14daa4){return function(_0x3a88f8,_0x192e3d,_0x4472fc){ChatMessageEvents['emit'](_0x14daa4+':'+_0x3a88f8['id'],_0x3a88f8);ChatMessageEvents[_0x0e76('0x4')](_0x14daa4,_0x3a88f8);_0x4472fc(null);};}for(var e in events){if(events[_0x0e76('0x5')](e)){var event=events[e];ChatMessage[_0x0e76('0x6')](e,emitEvent(event));}}module[_0x0e76('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x7643=['exports','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0x7643,0x184));var _0x3764=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x7643[_0x510b98];return _0x45e775;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x3764('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3764('0x1')](0x0);var events={'afterCreate':_0x3764('0x2'),'afterUpdate':_0x3764('0x3'),'afterDestroy':_0x3764('0x4')};function emitEvent(_0xc361ed){return function(_0x358423,_0x1846ca,_0x555194){ChatMessageEvents['emit'](_0xc361ed+':'+_0x358423['id'],_0x358423);ChatMessageEvents[_0x3764('0x5')](_0xc361ed,_0x358423);_0x555194(null);};}for(var e in events){if(events[_0x3764('0x6')](e)){var event=events[e];ChatMessage[_0x3764('0x7')](e,emitEvent(event));}}module[_0x3764('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 bc02b98..0eabef3 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 _0x965d=['fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x965d,0x92));var _0xd965=function(_0x54e9d6,_0x3053f4){_0x54e9d6=_0x54e9d6-0x0;var _0x8dea10=_0x965d[_0x54e9d6];return _0x8dea10;};'use strict';var _=require(_0xd965('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd965('0x1'));var moment=require('moment');var BPromise=require(_0xd965('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd965('0x3'));var rimraf=require(_0xd965('0x4'));var config=require('../../config/environment');var attributes=require(_0xd965('0x5'));module[_0xd965('0x6')]=function(_0xf8ffa3,_0x1ffa0d){return _0xf8ffa3[_0xd965('0x7')](_0xd965('0x8'),attributes,{'tableName':_0xd965('0x9'),'paranoid':![],'indexes':[{'name':_0xd965('0xa'),'fields':[_0xd965('0xb')],'type':_0xd965('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bd7e5,_0x34fb2d,_0x14d0a2){var _0x5639b9=_0xf8ffa3[_0xd965('0xd')];var _0x36e39f=_0x5bd7e5['get']({'plain':!![]});if(_0x36e39f[_0xd965('0xe')]['toLowerCase']()==='in'||_0x36e39f[_0xd965('0xe')][_0xd965('0xf')]()===_0xd965('0x10')&&!_0x36e39f[_0xd965('0x11')]&&!_[_0xd965('0x12')](_0x36e39f['UserId'])){_0x5639b9[_0xd965('0x13')][_0xd965('0x14')]({'where':{'id':_0x36e39f['ChatInteractionId']}})['then'](function(_0x365ef2){if(_0x365ef2){_0x365ef2[_0xd965('0x15')]({'lastMsgAt':_0x36e39f[_0xd965('0x16')],'lastMsgDirection':_0x36e39f[_0xd965('0xe')][_0xd965('0xf')]()});}})[_0xd965('0x17')](function(_0x3ad5ec){console['error'](_0x3ad5ec);});}_0x14d0a2();}},'charset':_0xd965('0x18'),'collate':_0xd965('0x19')});}; \ No newline at end of file +var _0x0223=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','body','FULLTEXT','models','get','direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','error'];(function(_0x29a2cc,_0x2a88fe){var _0x145413=function(_0x4989a8){while(--_0x4989a8){_0x29a2cc['push'](_0x29a2cc['shift']());}};_0x145413(++_0x2a88fe);}(_0x0223,0xaf));var _0x3022=function(_0x5e5c7b,_0x2495a3){_0x5e5c7b=_0x5e5c7b-0x0;var _0x3f947f=_0x0223[_0x5e5c7b];return _0x3f947f;};'use strict';var _=require(_0x3022('0x0'));var util=require(_0x3022('0x1'));var logger=require(_0x3022('0x2'))(_0x3022('0x3'));var moment=require('moment');var BPromise=require(_0x3022('0x4'));var rp=require(_0x3022('0x5'));var fs=require('fs');var path=require(_0x3022('0x6'));var rimraf=require(_0x3022('0x7'));var config=require(_0x3022('0x8'));var attributes=require(_0x3022('0x9'));module[_0x3022('0xa')]=function(_0xc2cefe,_0x1c1aff){return _0xc2cefe[_0x3022('0xb')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3022('0xc')],'type':_0x3022('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c1e1d,_0x3ddf10,_0x16c444){var _0x4e9fc8=_0xc2cefe[_0x3022('0xe')];var _0x3de68a=_0x5c1e1d[_0x3022('0xf')]({'plain':!![]});if(_0x3de68a['direction']['toLowerCase']()==='in'||_0x3de68a[_0x3022('0x10')]['toLowerCase']()===_0x3022('0x11')&&!_0x3de68a['secret']&&!_[_0x3022('0x12')](_0x3de68a[_0x3022('0x13')])){_0x4e9fc8[_0x3022('0x14')][_0x3022('0x15')]({'where':{'id':_0x3de68a[_0x3022('0x16')]}})[_0x3022('0x17')](function(_0x510c3a){if(_0x510c3a){_0x510c3a[_0x3022('0x18')]({'lastMsgAt':_0x3de68a[_0x3022('0x19')],'lastMsgDirection':_0x3de68a['direction'][_0x3022('0x1a')]()});}})['catch'](function(_0x1d5fd9){console[_0x3022('0x1b')](_0x1d5fd9);});}_0x16c444();}},'charset':'utf8mb4','collate':_0x3022('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index eaa3efa..c496496 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 _0xa82a=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','options','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info'];(function(_0x406c5c,_0x169f24){var _0x3d7057=function(_0x454d70){while(--_0x454d70){_0x406c5c['push'](_0x406c5c['shift']());}};_0x3d7057(++_0x169f24);}(_0xa82a,0x8d));var _0xaa82=function(_0x407588,_0x211bf8){_0x407588=_0x407588-0x0;var _0x5789f6=_0xa82a[_0x407588];return _0x5789f6;};'use strict';var _=require(_0xaa82('0x0'));var util=require('util');var moment=require(_0xaa82('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa82('0x2'));var fs=require('fs');var Redis=require(_0xaa82('0x3'));var db=require(_0xaa82('0x4'))['db'];var utils=require(_0xaa82('0x5'));var logger=require(_0xaa82('0x6'))('rpc');var config=require(_0xaa82('0x7'));var jayson=require(_0xaa82('0x8'));var client=jayson[_0xaa82('0x9')]['http']({'port':0x232a});config[_0xaa82('0xa')]=_[_0xaa82('0xb')](config['redis'],{'host':_0xaa82('0xc'),'port':0x18eb});var socket=require(_0xaa82('0xd'))(new Redis(config['redis']));require(_0xaa82('0xe'))[_0xaa82('0xf')](socket);function respondWithRpcPromise(_0x447518,_0x22fd8c,_0x48c842){return new BPromise(function(_0x2cbaac,_0x4314b4){return client[_0xaa82('0x10')](_0x447518,_0x48c842)[_0xaa82('0x11')](function(_0x523799){logger[_0xaa82('0x12')](_0xaa82('0x13'),_0x22fd8c,_0xaa82('0x14'));logger[_0xaa82('0x15')](_0xaa82('0x16'),_0x22fd8c,'request\x20sent',JSON[_0xaa82('0x17')](_0x523799));if(_0x523799[_0xaa82('0x18')]){if(_0x523799[_0xaa82('0x18')][_0xaa82('0x19')]===0x1f4){logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x523799[_0xaa82('0x18')][_0xaa82('0x1a')]);return _0x4314b4(_0x523799[_0xaa82('0x18')]['message']);}logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x523799[_0xaa82('0x18')][_0xaa82('0x1a')]);return _0x2cbaac(_0x523799[_0xaa82('0x18')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x22fd8c,'request\x20sent');_0x2cbaac(_0x523799['result'][_0xaa82('0x1a')]);}})[_0xaa82('0x1b')](function(_0x5492d5){logger[_0xaa82('0x18')](_0xaa82('0x13'),_0x22fd8c,_0x5492d5);_0x4314b4(_0x5492d5);});});}exports[_0xaa82('0x1c')]=function(_0x102291){var _0x2144a8=this;return new Promise(function(_0x3b15f5,_0x465623){return db[_0xaa82('0x1d')]['create'](_0x102291['body'],{'raw':_0x102291[_0xaa82('0x1e')]?_0x102291[_0xaa82('0x1e')][_0xaa82('0x1f')]===undefined?!![]:![]:!![]})[_0xaa82('0x11')](function(_0x414c5e){logger[_0xaa82('0x12')]('CreateChatMessage',_0x102291);logger[_0xaa82('0x15')]('CreateChatMessage',_0x102291,JSON['stringify'](_0x414c5e));_0x3b15f5(_0x414c5e);})[_0xaa82('0x1b')](function(_0x3003b7){logger[_0xaa82('0x18')]('CreateChatMessage',_0x3003b7['message'],_0x102291);_0x465623(_0x2144a8['error'](0x1f4,_0x3003b7[_0xaa82('0x1a')]));});});}; \ No newline at end of file +var _0x1dfe=['stringify','error','code','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5cef2a,_0x34ef09){var _0x3bf10f=function(_0x4a354e){while(--_0x4a354e){_0x5cef2a['push'](_0x5cef2a['shift']());}};_0x3bf10f(++_0x34ef09);}(_0x1dfe,0x69));var _0xe1df=function(_0x305d9f,_0x4b5567){_0x305d9f=_0x305d9f-0x0;var _0x3c5ec0=_0x1dfe[_0x305d9f];return _0x3c5ec0;};'use strict';var _=require(_0xe1df('0x0'));var util=require(_0xe1df('0x1'));var moment=require(_0xe1df('0x2'));var BPromise=require(_0xe1df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1df('0x4'))['db'];var utils=require(_0xe1df('0x5'));var logger=require('../../config/logger')(_0xe1df('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe1df('0x7')]({'port':0x232a});config[_0xe1df('0x8')]=_[_0xe1df('0x9')](config[_0xe1df('0x8')],{'host':_0xe1df('0xa'),'port':0x18eb});var socket=require(_0xe1df('0xb'))(new Redis(config['redis']));require(_0xe1df('0xc'))[_0xe1df('0xd')](socket);function respondWithRpcPromise(_0x17fef2,_0x376ce0,_0x1c6f98){return new BPromise(function(_0x587086,_0x1612d2){return client[_0xe1df('0xe')](_0x17fef2,_0x1c6f98)['then'](function(_0x219483){logger[_0xe1df('0xf')]('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xe1df('0x10'));logger[_0xe1df('0x11')](_0xe1df('0x12'),_0x376ce0,_0xe1df('0x10'),JSON[_0xe1df('0x13')](_0x219483));if(_0x219483[_0xe1df('0x14')]){if(_0x219483[_0xe1df('0x14')][_0xe1df('0x15')]===0x1f4){logger['error'](_0xe1df('0x16'),_0x376ce0,_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);return _0x1612d2(_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);}logger[_0xe1df('0x14')](_0xe1df('0x16'),_0x376ce0,_0x219483[_0xe1df('0x14')][_0xe1df('0x17')]);return _0x587086(_0x219483[_0xe1df('0x14')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xe1df('0x10'));_0x587086(_0x219483['result'][_0xe1df('0x17')]);}})['catch'](function(_0xcf03d1){logger[_0xe1df('0x14')]('ChatMessage,\x20%s,\x20%s',_0x376ce0,_0xcf03d1);_0x1612d2(_0xcf03d1);});});}exports[_0xe1df('0x18')]=function(_0x2387c7){var _0x1da035=this;return new Promise(function(_0x38428b,_0x762c61){return db[_0xe1df('0x19')][_0xe1df('0x1a')](_0x2387c7[_0xe1df('0x1b')],{'raw':_0x2387c7[_0xe1df('0x1c')]?_0x2387c7['options'][_0xe1df('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1e5e93){logger[_0xe1df('0xf')]('CreateChatMessage',_0x2387c7);logger['debug'](_0xe1df('0x18'),_0x2387c7,JSON['stringify'](_0x1e5e93));_0x38428b(_0x1e5e93);})[_0xe1df('0x1e')](function(_0xea12bb){logger[_0xe1df('0x14')](_0xe1df('0x18'),_0xea12bb[_0xe1df('0x17')],_0x2387c7);_0x762c61(_0x1da035[_0xe1df('0x14')](0x1f4,_0xea12bb['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 059064c..01911d0 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 _0x8958=['removeListener','length','chatMessage:','save'];(function(_0x45a91c,_0x56541f){var _0x587932=function(_0x24efce){while(--_0x24efce){_0x45a91c['push'](_0x45a91c['shift']());}};_0x587932(++_0x56541f);}(_0x8958,0x93));var _0x8895=function(_0x8c1bf,_0x1d81dd){_0x8c1bf=_0x8c1bf-0x0;var _0x1551e4=_0x8958[_0x8c1bf];return _0x1551e4;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x8895('0x0'),'remove','update'];function createListener(_0x5baab1,_0x4cea64){return function(_0x418b66){_0x4cea64['emit'](_0x5baab1,_0x418b66);};}function removeListener(_0x38d5d7,_0xce4955){return function(){ChatMessageEvents[_0x8895('0x1')](_0x38d5d7,_0xce4955);};}exports['register']=function(_0x22fa52){for(var _0x2f03ad=0x0,_0x124e1e=events[_0x8895('0x2')];_0x2f03ad<_0x124e1e;_0x2f03ad++){var _0x33013a=events[_0x2f03ad];var _0x51376b=createListener(_0x8895('0x3')+_0x33013a,_0x22fa52);ChatMessageEvents['on'](_0x33013a,_0x51376b);}}; \ No newline at end of file +var _0xb91a=['remove','emit','removeListener','register','./chatMessage.events','save'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xb91a,0xf4));var _0xab91=function(_0x4a758,_0x4d3def){_0x4a758=_0x4a758-0x0;var _0x29b5de=_0xb91a[_0x4a758];return _0x29b5de;};'use strict';var ChatMessageEvents=require(_0xab91('0x0'));var events=[_0xab91('0x1'),_0xab91('0x2'),'update'];function createListener(_0x59b921,_0x36ffe5){return function(_0x37cd1e){_0x36ffe5[_0xab91('0x3')](_0x59b921,_0x37cd1e);};}function removeListener(_0x439eb2,_0x1afca9){return function(){ChatMessageEvents[_0xab91('0x4')](_0x439eb2,_0x1afca9);};}exports[_0xab91('0x5')]=function(_0x429933){for(var _0x290af9=0x0,_0x34932f=events['length'];_0x290af9<_0x34932f;_0x290af9++){var _0x1729f6=events[_0x290af9];var _0x1e8d52=createListener('chatMessage:'+_0x1729f6,_0x429933);ChatMessageEvents['on'](_0x1729f6,_0x1e8d52);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3f4febc..d2c4d87 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 _0xa81a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','tracked','chat','chatmessage:create'];(function(_0x76969f,_0x104327){var _0x1696b0=function(_0x3cc91b){while(--_0x3cc91b){_0x76969f['push'](_0x76969f['shift']());}};_0x1696b0(++_0x104327);}(_0xa81a,0x102));var _0xaa81=function(_0x15697e,_0x4be652){_0x15697e=_0x15697e-0x0;var _0xab45c7=_0xa81a[_0x15697e];return _0xab45c7;};'use strict';var multer=require(_0xaa81('0x0'));var util=require(_0xaa81('0x1'));var path=require(_0xaa81('0x2'));var timeout=require(_0xaa81('0x3'));var express=require(_0xaa81('0x4'));var router=express[_0xaa81('0x5')]();var fs_extra=require(_0xaa81('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaa81('0x7'));var config=require(_0xaa81('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xaa81('0x9')](),controller['index']);router[_0xaa81('0xa')](_0xaa81('0xb'),auth[_0xaa81('0x9')](),controller['describe']);router[_0xaa81('0xa')](_0xaa81('0xc'),auth['isAuthenticated'](),controller[_0xaa81('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa81('0xe')](_0xaa81('0xf'),_0xaa81('0x10')),controller['create']);router[_0xaa81('0x11')](_0xaa81('0xc'),controller[_0xaa81('0x12')]);router[_0xaa81('0x11')](_0xaa81('0x13'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x14')]);router[_0xaa81('0x11')](_0xaa81('0x15'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x16')]);router[_0xaa81('0x17')](_0xaa81('0xc'),auth[_0xaa81('0x9')](),controller[_0xaa81('0x18')]);module['exports']=router; \ No newline at end of file +var _0x4057=['isAuthenticated','index','describe','/:id','show','post','tracked','chatmessage:create','create','update','put','accept','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatMessage.controller'];(function(_0x12b4e7,_0x202d1d){var _0x563b9e=function(_0x1357dc){while(--_0x1357dc){_0x12b4e7['push'](_0x12b4e7['shift']());}};_0x563b9e(++_0x202d1d);}(_0x4057,0xe0));var _0x7405=function(_0x23de01,_0x4954da){_0x23de01=_0x23de01-0x0;var _0x126399=_0x4057[_0x23de01];return _0x126399;};'use strict';var multer=require(_0x7405('0x0'));var util=require(_0x7405('0x1'));var path=require('path');var timeout=require(_0x7405('0x2'));var express=require(_0x7405('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7405('0x4'));var interaction=require(_0x7405('0x5'));var config=require('../../config/environment');var controller=require(_0x7405('0x6'));router['get']('/',auth[_0x7405('0x7')](),controller[_0x7405('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7405('0x9')]);router['get'](_0x7405('0xa'),auth[_0x7405('0x7')](),controller[_0x7405('0xb')]);router[_0x7405('0xc')]('/',auth[_0x7405('0x7')](),interaction[_0x7405('0xd')]('chat',_0x7405('0xe')),controller[_0x7405('0xf')]);router['put'](_0x7405('0xa'),controller[_0x7405('0x10')]);router[_0x7405('0x11')]('/:id/accept',auth[_0x7405('0x7')](),controller[_0x7405('0x12')]);router[_0x7405('0x11')]('/:id/reject',auth[_0x7405('0x7')](),controller['reject']);router['delete'](_0x7405('0xa'),auth[_0x7405('0x7')](),controller[_0x7405('0x13')]);module[_0x7405('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index dde4216..58167fe 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 _0xf863=['medium','sequelize','exports'];(function(_0x3080da,_0x276068){var _0x10313e=function(_0x40051d){while(--_0x40051d){_0x3080da['push'](_0x3080da['shift']());}};_0x10313e(++_0x276068);}(_0xf863,0x1f3));var _0x3f86=function(_0x2251de,_0x2c1aea){_0x2251de=_0x2251de-0x0;var _0x4b8598=_0xf863[_0x2251de];return _0x4b8598;};'use strict';var Sequelize=require(_0x3f86('0x0'));module[_0x3f86('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3f86('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xd992=['sequelize','exports','TEXT','medium'];(function(_0x4ebf9,_0x139f08){var _0x3c32e8=function(_0x5e885a){while(--_0x5e885a){_0x4ebf9['push'](_0x4ebf9['shift']());}};_0x3c32e8(++_0x139f08);}(_0xd992,0xbc));var _0x2d99=function(_0x2e0f70,_0x18264a){_0x2e0f70=_0x2e0f70-0x0;var _0x403ba3=_0xd992[_0x2e0f70];return _0x403ba3;};'use strict';var Sequelize=require(_0x2d99('0x0'));module[_0x2d99('0x1')]={'body':{'type':Sequelize[_0x2d99('0x2')](_0x2d99('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 6dde673..bbf12a8 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x4ce7ea,_0x261414){_0x4ce7ea=_0x4ce7ea-0x0;var _0xdbb992=_0x7a54[_0x4ce7ea];return _0xdbb992;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7a54,0x106));var _0x47a5=function(_0x2f2713,_0x24679d){_0x2f2713=_0x2f2713-0x0;var _0x44a153=_0x7a54[_0x2f2713];return _0x44a153;};'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 4de5767..5ca3eaa 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 _0x760a=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x1966f3,_0x210ea3){var _0x17575f=function(_0x7b18fb){while(--_0x7b18fb){_0x1966f3['push'](_0x1966f3['shift']());}};_0x17575f(++_0x210ea3);}(_0x760a,0x7b));var _0xa760=function(_0x1eada7,_0x3a448e){_0x1eada7=_0x1eada7-0x0;var _0x142092=_0x760a[_0x1eada7];return _0x142092;};'use strict';var _=require(_0xa760('0x0'));var util=require(_0xa760('0x1'));var logger=require(_0xa760('0x2'))('api');var moment=require(_0xa760('0x3'));var BPromise=require(_0xa760('0x4'));var rp=require(_0xa760('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa760('0x6'));var config=require(_0xa760('0x7'));var attributes=require(_0xa760('0x8'));module[_0xa760('0x9')]=function(_0x4cce16,_0x55d48a){return _0x4cce16[_0xa760('0xa')](_0xa760('0xb'),attributes,{'tableName':_0xa760('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa760('0xd'),'collate':_0xa760('0xe')});}; \ No newline at end of file +var _0x4173=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4173,0x130));var _0x3417=function(_0x58dd0b,_0x39de95){_0x58dd0b=_0x58dd0b-0x0;var _0x30fd30=_0x4173[_0x58dd0b];return _0x30fd30;};'use strict';var _=require(_0x3417('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3417('0x1'));var BPromise=require(_0x3417('0x2'));var rp=require(_0x3417('0x3'));var fs=require('fs');var path=require(_0x3417('0x4'));var rimraf=require(_0x3417('0x5'));var config=require(_0x3417('0x6'));var attributes=require(_0x3417('0x7'));module[_0x3417('0x8')]=function(_0x55f414,_0x3317f8){return _0x55f414[_0x3417('0x9')](_0x3417('0xa'),attributes,{'tableName':_0x3417('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3417('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 6d791f8..6e03b4a 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 _0x3248=['ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x3248,0x1bc));var _0x8324=function(_0x1d791b,_0x37656e){_0x1d791b=_0x1d791b-0x0;var _0x5d292d=_0x3248[_0x1d791b];return _0x5d292d;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8324('0x1'));var fs=require('fs');var Redis=require(_0x8324('0x2'));var db=require(_0x8324('0x3'))['db'];var utils=require(_0x8324('0x4'));var logger=require(_0x8324('0x5'))(_0x8324('0x6'));var config=require('../../config/environment');var jayson=require(_0x8324('0x7'));var client=jayson[_0x8324('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25ee7a,_0x459a62,_0x4302c5){return new BPromise(function(_0x1514c0,_0x5a482d){return client[_0x8324('0x9')](_0x25ee7a,_0x4302c5)[_0x8324('0xa')](function(_0x3f00e6){logger[_0x8324('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'));logger[_0x8324('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x459a62,_0x8324('0xc'),JSON[_0x8324('0xe')](_0x3f00e6));if(_0x3f00e6['error']){if(_0x3f00e6['error']['code']===0x1f4){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x5a482d(_0x3f00e6['error'][_0x8324('0x11')]);}logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0x3f00e6[_0x8324('0xf')][_0x8324('0x11')]);return _0x1514c0(_0x3f00e6['error'][_0x8324('0x11')]);}else{logger[_0x8324('0xb')](_0x8324('0x10'),_0x459a62,_0x8324('0xc'));_0x1514c0(_0x3f00e6[_0x8324('0x12')]['message']);}})[_0x8324('0x13')](function(_0xaf20a5){logger[_0x8324('0xf')](_0x8324('0x10'),_0x459a62,_0xaf20a5);_0x5a482d(_0xaf20a5);});});} \ No newline at end of file +var _0xb2e8=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x125b80,_0x41db3b){var _0x414ba8=function(_0x1bef00){while(--_0x1bef00){_0x125b80['push'](_0x125b80['shift']());}};_0x414ba8(++_0x41db3b);}(_0xb2e8,0x1ef));var _0x8b2e=function(_0x441713,_0x13c238){_0x441713=_0x441713-0x0;var _0x4625c1=_0xb2e8[_0x441713];return _0x4625c1;};'use strict';var _=require(_0x8b2e('0x0'));var util=require(_0x8b2e('0x1'));var moment=require(_0x8b2e('0x2'));var BPromise=require(_0x8b2e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b2e('0x4'));var db=require(_0x8b2e('0x5'))['db'];var utils=require(_0x8b2e('0x6'));var logger=require(_0x8b2e('0x7'))(_0x8b2e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8b2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a7ebb,_0x1cd791,_0x5d798d){return new BPromise(function(_0x4d9dd7,_0x22507d){return client[_0x8b2e('0xa')](_0x1a7ebb,_0x5d798d)['then'](function(_0x321395){logger['info'](_0x8b2e('0xb'),_0x1cd791,_0x8b2e('0xc'));logger[_0x8b2e('0xd')](_0x8b2e('0xe'),_0x1cd791,'request\x20sent',JSON['stringify'](_0x321395));if(_0x321395[_0x8b2e('0xf')]){if(_0x321395['error']['code']===0x1f4){logger[_0x8b2e('0xf')](_0x8b2e('0xb'),_0x1cd791,_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);return _0x22507d(_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);}logger['error'](_0x8b2e('0xb'),_0x1cd791,_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);return _0x4d9dd7(_0x321395[_0x8b2e('0xf')][_0x8b2e('0x10')]);}else{logger[_0x8b2e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1cd791,_0x8b2e('0xc'));_0x4d9dd7(_0x321395[_0x8b2e('0x12')][_0x8b2e('0x10')]);}})['catch'](function(_0x52bfb6){logger['error'](_0x8b2e('0xb'),_0x1cd791,_0x52bfb6);_0x22507d(_0x52bfb6);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 6424eda..4623f37 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 _0xaa48=['get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index'];(function(_0x245934,_0x23d841){var _0x483ed8=function(_0x2ed177){while(--_0x2ed177){_0x245934['push'](_0x245934['shift']());}};_0x483ed8(++_0x23d841);}(_0xaa48,0x185));var _0x8aa4=function(_0x57c02d,_0x21ab95){_0x57c02d=_0x57c02d-0x0;var _0x45b484=_0xaa48[_0x57c02d];return _0x45b484;};'use strict';var multer=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var path=require(_0x8aa4('0x2'));var timeout=require(_0x8aa4('0x3'));var express=require('express');var router=express[_0x8aa4('0x4')]();var fs_extra=require(_0x8aa4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8aa4('0x6'));var config=require(_0x8aa4('0x7'));var controller=require(_0x8aa4('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa4('0x9')]);router[_0x8aa4('0xa')]('/describe',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xc')]);router[_0x8aa4('0xa')](_0x8aa4('0xd'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0xe')]);router[_0x8aa4('0xf')]('/',auth['isAuthenticated'](),controller[_0x8aa4('0x10')]);router['put'](_0x8aa4('0xd'),auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x11')]);router[_0x8aa4('0x12')]('/:id',auth[_0x8aa4('0xb')](),controller[_0x8aa4('0x13')]);module[_0x8aa4('0x14')]=router; \ No newline at end of file +var _0x4f54=['post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3ad1f2,_0x4b0ab4){var _0x872da1=function(_0x5b7493){while(--_0x5b7493){_0x3ad1f2['push'](_0x3ad1f2['shift']());}};_0x872da1(++_0x4b0ab4);}(_0x4f54,0x182));var _0x44f5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4f54[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x44f5('0x0'));var path=require(_0x44f5('0x1'));var timeout=require(_0x44f5('0x2'));var express=require('express');var router=express[_0x44f5('0x3')]();var fs_extra=require(_0x44f5('0x4'));var auth=require(_0x44f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x44f5('0x6'));var controller=require(_0x44f5('0x7'));router[_0x44f5('0x8')]('/',auth[_0x44f5('0x9')](),controller['index']);router[_0x44f5('0x8')](_0x44f5('0xa'),auth['isAuthenticated'](),controller[_0x44f5('0xb')]);router[_0x44f5('0x8')](_0x44f5('0xc'),auth[_0x44f5('0x9')](),controller[_0x44f5('0xd')]);router[_0x44f5('0xe')]('/',auth[_0x44f5('0x9')](),controller[_0x44f5('0xf')]);router['put'](_0x44f5('0xc'),auth['isAuthenticated'](),controller[_0x44f5('0x10')]);router[_0x44f5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x44f5('0x12')]);module[_0x44f5('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c46efcb..cee77d7 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 _0xc8ba=['ENUM','mouseOver','timeout','INTEGER','STRING'];(function(_0x80b8d3,_0x2d3b80){var _0x5cc9f4=function(_0x2e24a9){while(--_0x2e24a9){_0x80b8d3['push'](_0x80b8d3['shift']());}};_0x5cc9f4(++_0x2d3b80);}(_0xc8ba,0x135));var _0xac8b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xc8ba[_0x111e94];return _0x3de107;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xac8b('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xac8b('0x1')](_0xac8b('0x2'),_0xac8b('0x3')),'defaultValue':_0xac8b('0x2')},'selector':{'type':Sequelize[_0xac8b('0x0')]},'timeout':{'type':Sequelize[_0xac8b('0x4')]}}; \ No newline at end of file +var _0xd3d7=['mouseOver','sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd3d7,0x6d));var _0x7d3d=function(_0x4b5dca,_0xe22e){_0x4b5dca=_0x4b5dca-0x0;var _0x4708f6=_0xd3d7[_0x4b5dca];return _0x4708f6;};'use strict';var Sequelize=require(_0x7d3d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d3d('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7d3d('0x2'),'timeout'),'defaultValue':_0x7d3d('0x2')},'selector':{'type':Sequelize[_0x7d3d('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4a05af5..18d34c8 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 _0x8fed=['find','catch','create','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options'];(function(_0x1599b5,_0x28b24b){var _0x22b161=function(_0x3d936e){while(--_0x3d936e){_0x1599b5['push'](_0x1599b5['shift']());}};_0x22b161(++_0x28b24b);}(_0x8fed,0xf5));var _0xd8fe=function(_0x2fe042,_0x249340){_0x2fe042=_0x2fe042-0x0;var _0x56febe=_0x8fed[_0x2fe042];return _0x56febe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd8fe('0x0'));var jsonpatch=require(_0xd8fe('0x1'));var rp=require(_0xd8fe('0x2'));var moment=require(_0xd8fe('0x3'));var BPromise=require(_0xd8fe('0x4'));var Mustache=require('mustache');var util=require(_0xd8fe('0x5'));var path=require(_0xd8fe('0x6'));var sox=require(_0xd8fe('0x7'));var csv=require(_0xd8fe('0x8'));var ejs=require(_0xd8fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8fe('0xa'));var squel=require(_0xd8fe('0xb'));var crypto=require(_0xd8fe('0xc'));var jsforce=require(_0xd8fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd8fe('0x8'));var querystring=require('querystring');var Papa=require(_0xd8fe('0xe'));var Redis=require(_0xd8fe('0xf'));var authService=require(_0xd8fe('0x10'));var qs=require(_0xd8fe('0x11'));var as=require(_0xd8fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8fe('0x13'))(_0xd8fe('0x14'));var utils=require(_0xd8fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd8fe('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf58208,_0x44de03){_0x44de03=_0x44de03||0xcc;return function(_0x2a977d){if(_0x2a977d){return _0xf58208[_0xd8fe('0x17')](_0x44de03);}return _0xf58208[_0xd8fe('0x18')](_0x44de03)['end']();};}function respondWithResult(_0x1e7ea9,_0x21e1ea){_0x21e1ea=_0x21e1ea||0xc8;return function(_0x51bdf5){if(_0x51bdf5){return _0x1e7ea9[_0xd8fe('0x18')](_0x21e1ea)[_0xd8fe('0x19')](_0x51bdf5);}};}function respondWithFilteredResult(_0x2c7c27,_0x415609){return function(_0x237de6){if(_0x237de6){var _0xf5ca56=typeof _0x415609[_0xd8fe('0x1a')]==='undefined'&&typeof _0x415609[_0xd8fe('0x1b')]==='undefined';var _0x346ba9=_0x237de6[_0xd8fe('0x1c')];var _0x4cfb98=_0xf5ca56?0x0:_0x415609[_0xd8fe('0x1a')];var _0x4b7d9e=_0xf5ca56?_0x237de6['count']:_0x415609['offset']+_0x415609['limit'];var _0x4f21fb;if(_0x4b7d9e>=_0x346ba9){_0x4b7d9e=_0x346ba9;_0x4f21fb=0xc8;}else{_0x4f21fb=0xce;}_0x2c7c27[_0xd8fe('0x18')](_0x4f21fb);return _0x2c7c27['set'](_0xd8fe('0x1d'),_0x4cfb98+'-'+_0x4b7d9e+'/'+_0x346ba9)['json'](_0x237de6);}return null;};}function patchUpdates(_0x3b0cf0){return function(_0x58d2d2){try{jsonpatch[_0xd8fe('0x1e')](_0x58d2d2,_0x3b0cf0,!![]);}catch(_0x2f0dc3){return BPromise[_0xd8fe('0x1f')](_0x2f0dc3);}return _0x58d2d2[_0xd8fe('0x20')]();};}function saveUpdates(_0x2305a9,_0x37dab0){return function(_0x108b9c){if(_0x108b9c){return _0x108b9c[_0xd8fe('0x21')](_0x2305a9)['then'](function(_0xe3c91b){return _0xe3c91b;});}return null;};}function removeEntity(_0x189dfa,_0x19d4d1){return function(_0x2fc0be){if(_0x2fc0be){return _0x2fc0be['destroy']()[_0xd8fe('0x22')](function(){_0x189dfa[_0xd8fe('0x18')](0xcc)[_0xd8fe('0x23')]();});}};}function handleEntityNotFound(_0x130c16,_0x107d0c){return function(_0x76d22){if(!_0x76d22){_0x130c16['sendStatus'](0x194);}return _0x76d22;};}function handleError(_0x4e2b49,_0x43a02d){_0x43a02d=_0x43a02d||0x1f4;return function(_0x22ef87){logger[_0xd8fe('0x24')](_0x22ef87[_0xd8fe('0x25')]);if(_0x22ef87[_0xd8fe('0x26')]){delete _0x22ef87[_0xd8fe('0x26')];}_0x4e2b49[_0xd8fe('0x18')](_0x43a02d)[_0xd8fe('0x27')](_0x22ef87);};}exports[_0xd8fe('0x28')]=function(_0x42a46b,_0x398bc2){var _0x472507={'raw':!![],'where':{'id':_0x42a46b[_0xd8fe('0x29')]['id']}},_0x2c2767={};_0x2c2767['model']=_[_0xd8fe('0x2a')](db[_0xd8fe('0x2b')][_0xd8fe('0x2c')]);_0x2c2767['query']=_[_0xd8fe('0x2a')](_0x42a46b[_0xd8fe('0x2d')]);_0x2c2767[_0xd8fe('0x2e')]=_[_0xd8fe('0x2f')](_0x2c2767[_0xd8fe('0x30')],_0x2c2767[_0xd8fe('0x2d')]);_0x472507[_0xd8fe('0x31')]=_[_0xd8fe('0x2f')](_0x2c2767[_0xd8fe('0x30')],qs[_0xd8fe('0x32')](_0x42a46b['query'][_0xd8fe('0x32')]));_0x472507[_0xd8fe('0x31')]=_0x472507[_0xd8fe('0x31')][_0xd8fe('0x33')]?_0x472507[_0xd8fe('0x31')]:_0x2c2767[_0xd8fe('0x30')];if(_0x42a46b[_0xd8fe('0x2d')]['includeAll']){_0x472507[_0xd8fe('0x34')]=[{'all':!![]}];}_0x472507=_[_0xd8fe('0x35')]({},_0x472507,_0x42a46b[_0xd8fe('0x36')]);return db[_0xd8fe('0x2b')][_0xd8fe('0x37')](_0x472507)[_0xd8fe('0x22')](handleEntityNotFound(_0x398bc2,null))[_0xd8fe('0x22')](respondWithResult(_0x398bc2,null))[_0xd8fe('0x38')](handleError(_0x398bc2,null));};exports[_0xd8fe('0x39')]=function(_0x27879b,_0x14b7e9){return db['ChatProactiveAction'][_0xd8fe('0x39')](_0x27879b[_0xd8fe('0x3a')],{})[_0xd8fe('0x22')](respondWithResult(_0x14b7e9,0xc9))[_0xd8fe('0x38')](handleError(_0x14b7e9,null));};exports[_0xd8fe('0x21')]=function(_0x56d056,_0x4f2ef1){if(_0x56d056[_0xd8fe('0x3a')]['id']){delete _0x56d056[_0xd8fe('0x3a')]['id'];}return db[_0xd8fe('0x2b')]['find']({'where':{'id':_0x56d056[_0xd8fe('0x29')]['id']}})[_0xd8fe('0x22')](handleEntityNotFound(_0x4f2ef1,null))['then'](saveUpdates(_0x56d056[_0xd8fe('0x3a')],null))[_0xd8fe('0x22')](respondWithResult(_0x4f2ef1,null))['catch'](handleError(_0x4f2ef1,null));};exports[_0xd8fe('0x3b')]=function(_0x5c0d66,_0xa3d70){return db['ChatProactiveAction']['find']({'where':{'id':_0x5c0d66[_0xd8fe('0x29')]['id']}})[_0xd8fe('0x22')](handleEntityNotFound(_0xa3d70,null))[_0xd8fe('0x22')](removeEntity(_0xa3d70,null))['catch'](handleError(_0xa3d70,null));}; \ No newline at end of file +var _0x23f4=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','update','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x329165,_0x30a441){var _0x5b3948=function(_0x3071dc){while(--_0x3071dc){_0x329165['push'](_0x329165['shift']());}};_0x5b3948(++_0x30a441);}(_0x23f4,0x1ee));var _0x423f=function(_0x33cabe,_0xaad131){_0x33cabe=_0x33cabe-0x0;var _0xd9dd2f=_0x23f4[_0x33cabe];return _0xd9dd2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={'raw':!![],'where':{'id':_0x4c2f21['params']['id']}},_0xbb4bce={};_0xbb4bce[_0x423f('0x27')]=_[_0x423f('0x28')](db[_0x423f('0x29')][_0x423f('0x2a')]);_0xbb4bce['query']=_[_0x423f('0x28')](_0x4c2f21[_0x423f('0x2b')]);_0xbb4bce[_0x423f('0x2c')]=_[_0x423f('0x2d')](_0xbb4bce['model'],_0xbb4bce[_0x423f('0x2b')]);_0x3ca28d[_0x423f('0x2e')]=_[_0x423f('0x2d')](_0xbb4bce[_0x423f('0x27')],qs[_0x423f('0x2f')](_0x4c2f21[_0x423f('0x2b')][_0x423f('0x2f')]));_0x3ca28d[_0x423f('0x2e')]=_0x3ca28d[_0x423f('0x2e')][_0x423f('0x30')]?_0x3ca28d['attributes']:_0xbb4bce[_0x423f('0x27')];if(_0x4c2f21[_0x423f('0x2b')][_0x423f('0x31')]){_0x3ca28d['include']=[{'all':!![]}];}_0x3ca28d=_[_0x423f('0x32')]({},_0x3ca28d,_0x4c2f21['options']);return db[_0x423f('0x29')][_0x423f('0x33')](_0x3ca28d)[_0x423f('0x21')](handleEntityNotFound(_0x5882ed,null))[_0x423f('0x21')](respondWithResult(_0x5882ed,null))[_0x423f('0x34')](handleError(_0x5882ed,null));};exports['create']=function(_0x5ea12a,_0x880b50){return db[_0x423f('0x29')][_0x423f('0x35')](_0x5ea12a[_0x423f('0x36')],{})[_0x423f('0x21')](respondWithResult(_0x880b50,0xc9))[_0x423f('0x34')](handleError(_0x880b50,null));};exports[_0x423f('0x37')]=function(_0x183665,_0xd99eb0){if(_0x183665[_0x423f('0x36')]['id']){delete _0x183665[_0x423f('0x36')]['id'];}return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x183665['params']['id']}})['then'](handleEntityNotFound(_0xd99eb0,null))[_0x423f('0x21')](saveUpdates(_0x183665[_0x423f('0x36')],null))[_0x423f('0x21')](respondWithResult(_0xd99eb0,null))[_0x423f('0x34')](handleError(_0xd99eb0,null));};exports[_0x423f('0x22')]=function(_0x56a9f4,_0x38dcce){return db[_0x423f('0x29')][_0x423f('0x33')]({'where':{'id':_0x56a9f4[_0x423f('0x38')]['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x38dcce,null))[_0x423f('0x21')](removeEntity(_0x38dcce,null))[_0x423f('0x34')](handleError(_0x38dcce,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index fce6a86..663a0b9 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 _0xaa0c=['bluebird','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment'];(function(_0x5f078a,_0x45d330){var _0x291c01=function(_0x18554d){while(--_0x18554d){_0x5f078a['push'](_0x5f078a['shift']());}};_0x291c01(++_0x45d330);}(_0xaa0c,0xa4));var _0xcaa0=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xaa0c[_0x3c8e9a];return _0x2d4c57;};'use strict';var _=require(_0xcaa0('0x0'));var util=require(_0xcaa0('0x1'));var logger=require(_0xcaa0('0x2'))(_0xcaa0('0x3'));var moment=require(_0xcaa0('0x4'));var BPromise=require(_0xcaa0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaa0('0x6'));var rimraf=require(_0xcaa0('0x7'));var config=require('../../config/environment');var attributes=require(_0xcaa0('0x8'));module[_0xcaa0('0x9')]=function(_0x121c15,_0x17ceb1){return _0x121c15[_0xcaa0('0xa')](_0xcaa0('0xb'),attributes,{'tableName':_0xcaa0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf99e=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5cef48,_0x4f4b95){var _0x2486c6=function(_0x4acbe3){while(--_0x4acbe3){_0x5cef48['push'](_0x5cef48['shift']());}};_0x2486c6(++_0x4f4b95);}(_0xf99e,0xa7));var _0xef99=function(_0x2582af,_0x3409f7){_0x2582af=_0x2582af-0x0;var _0x38c9c6=_0xf99e[_0x2582af];return _0x38c9c6;};'use strict';var _=require(_0xef99('0x0'));var util=require(_0xef99('0x1'));var logger=require(_0xef99('0x2'))(_0xef99('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xef99('0x4'));var fs=require('fs');var path=require(_0xef99('0x5'));var rimraf=require(_0xef99('0x6'));var config=require(_0xef99('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xef99('0x8')]=function(_0x469585,_0x10bbf6){return _0x469585['define'](_0xef99('0x9'),attributes,{'tableName':_0xef99('0xa'),'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 6ede2cf..e926d68 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 _0x95ad=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x266c63,_0x135fb5){var _0x46232a=function(_0x4bb7c2){while(--_0x4bb7c2){_0x266c63['push'](_0x266c63['shift']());}};_0x46232a(++_0x135fb5);}(_0x95ad,0xfe));var _0xd95a=function(_0xf170fe,_0xac543c){_0xf170fe=_0xf170fe-0x0;var _0x2b9fe8=_0x95ad[_0xf170fe];return _0x2b9fe8;};'use strict';var _=require(_0xd95a('0x0'));var util=require('util');var moment=require(_0xd95a('0x1'));var BPromise=require(_0xd95a('0x2'));var rs=require(_0xd95a('0x3'));var fs=require('fs');var Redis=require(_0xd95a('0x4'));var db=require(_0xd95a('0x5'))['db'];var utils=require(_0xd95a('0x6'));var logger=require(_0xd95a('0x7'))('rpc');var config=require(_0xd95a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd95a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5936fd,_0x131d11,_0x46a72c){return new BPromise(function(_0x31731e,_0x2c7a36){return client[_0xd95a('0xa')](_0x5936fd,_0x46a72c)[_0xd95a('0xb')](function(_0x4aad19){logger[_0xd95a('0xc')](_0xd95a('0xd'),_0x131d11,_0xd95a('0xe'));logger[_0xd95a('0xf')](_0xd95a('0x10'),_0x131d11,_0xd95a('0xe'),JSON[_0xd95a('0x11')](_0x4aad19));if(_0x4aad19[_0xd95a('0x12')]){if(_0x4aad19['error'][_0xd95a('0x13')]===0x1f4){logger[_0xd95a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x131d11,_0x4aad19[_0xd95a('0x12')][_0xd95a('0x14')]);return _0x2c7a36(_0x4aad19[_0xd95a('0x12')][_0xd95a('0x14')]);}logger[_0xd95a('0x12')](_0xd95a('0xd'),_0x131d11,_0x4aad19['error'][_0xd95a('0x14')]);return _0x31731e(_0x4aad19['error'][_0xd95a('0x14')]);}else{logger['info'](_0xd95a('0xd'),_0x131d11,_0xd95a('0xe'));_0x31731e(_0x4aad19['result']['message']);}})[_0xd95a('0x15')](function(_0x5f59dc){logger[_0xd95a('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x131d11,_0x5f59dc);_0x2c7a36(_0x5f59dc);});});} \ No newline at end of file +var _0x06c6=['util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x06c6,0xd1));var _0x606c=function(_0x154f3d,_0x404c77){_0x154f3d=_0x154f3d-0x0;var _0x2e5e71=_0x06c6[_0x154f3d];return _0x2e5e71;};'use strict';var _=require(_0x606c('0x0'));var util=require(_0x606c('0x1'));var moment=require(_0x606c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x606c('0x3'))['db'];var utils=require(_0x606c('0x4'));var logger=require(_0x606c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x606c('0x6'));var client=jayson[_0x606c('0x7')][_0x606c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x461706,_0x331a16,_0x138dfd){return new BPromise(function(_0x5be5f1,_0x3c95bc){return client[_0x606c('0x9')](_0x461706,_0x138dfd)['then'](function(_0x212e15){logger[_0x606c('0xa')](_0x606c('0xb'),_0x331a16,_0x606c('0xc'));logger[_0x606c('0xd')](_0x606c('0xe'),_0x331a16,_0x606c('0xc'),JSON[_0x606c('0xf')](_0x212e15));if(_0x212e15[_0x606c('0x10')]){if(_0x212e15[_0x606c('0x10')][_0x606c('0x11')]===0x1f4){logger[_0x606c('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x331a16,_0x212e15[_0x606c('0x10')][_0x606c('0x12')]);return _0x3c95bc(_0x212e15[_0x606c('0x10')]['message']);}logger['error'](_0x606c('0xb'),_0x331a16,_0x212e15[_0x606c('0x10')][_0x606c('0x12')]);return _0x5be5f1(_0x212e15['error'][_0x606c('0x12')]);}else{logger[_0x606c('0xa')](_0x606c('0xb'),_0x331a16,_0x606c('0xc'));_0x5be5f1(_0x212e15[_0x606c('0x13')][_0x606c('0x12')]);}})[_0x606c('0x14')](function(_0x28efab){logger[_0x606c('0x10')](_0x606c('0xb'),_0x331a16,_0x28efab);_0x3c95bc(_0x28efab);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index eb98c60..db75af2 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x509256,_0x301fae){var _0x21b281=function(_0x43eabd){while(--_0x43eabd){_0x509256['push'](_0x509256['shift']());}};_0x21b281(++_0x301fae);}(_0x33c5,0xe6));var _0x533c=function(_0x448bab,_0x25517b){_0x448bab=_0x448bab-0x0;var _0x5dc534=_0x33c5[_0x448bab];return _0x5dc534;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7fbe=['show','post','create','put','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x86de05,_0x1f034a){var _0x43604d=function(_0x1eb36b){while(--_0x1eb36b){_0x86de05['push'](_0x86de05['shift']());}};_0x43604d(++_0x1f034a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x37bd46,_0x2cd9de){_0x37bd46=_0x37bd46-0x0;var _0x560101=_0x7fbe[_0x37bd46];return _0x560101;};'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')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0xc')]);router[_0xe7fb('0xd')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0xe')]);router[_0xe7fb('0xf')](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller['update']);router['delete'](_0xe7fb('0xa'),auth[_0xe7fb('0xb')](),controller[_0xe7fb('0x10')]);module[_0xe7fb('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 166afe0..b5970e6 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 _0xac4a=['STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xac4a,0x9c));var _0xaac4=function(_0x4c162c,_0x33acf1){_0x4c162c=_0x4c162c-0x0;var _0x5b1fe2=_0xac4a[_0x4c162c];return _0x5b1fe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaac4('0x0')],'unique':_0xaac4('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaac4('0x0')]},'timeout':{'type':Sequelize[_0xaac4('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaac4('0x3')]('rrmemory',_0xaac4('0x4'),_0xaac4('0x5'))}}; \ No newline at end of file +var _0x3c63=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x3c63,0x105));var _0x33c6=function(_0x1b1948,_0x49f451){_0x1b1948=_0x1b1948-0x0;var _0x3cbd38=_0x3c63[_0x1b1948];return _0x3cbd38;};'use strict';var Sequelize=require(_0x33c6('0x0'));module[_0x33c6('0x1')]={'name':{'type':Sequelize[_0x33c6('0x2')],'unique':_0x33c6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x33c6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x33c6('0x4')](_0x33c6('0x5'),_0x33c6('0x6'),_0x33c6('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f3a555a..9929609 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 _0xfc9f=['name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','fields','sort','pick','User','findAndCountAll','UserId','createdAt','format','%s/%s','chatPause','getTeams','Team','ids','voicePause','interface','flatMap','Agents','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatQueue.socket','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','ChatQueues','UserProfileResource','destroy','stack'];(function(_0x4b44d2,_0x297895){var _0x32e790=function(_0x1df9c7){while(--_0x1df9c7){_0x4b44d2['push'](_0x4b44d2['shift']());}};_0x32e790(++_0x297895);}(_0xfc9f,0xf0));var _0xffc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc9f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xffc9('0x0'));var rimraf=require(_0xffc9('0x1'));var zipdir=require(_0xffc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffc9('0x3'));var moment=require(_0xffc9('0x4'));var BPromise=require(_0xffc9('0x5'));var Mustache=require(_0xffc9('0x6'));var util=require('util');var path=require(_0xffc9('0x7'));var sox=require('sox');var csv=require(_0xffc9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffc9('0x9'));var squel=require(_0xffc9('0xa'));var crypto=require(_0xffc9('0xb'));var jsforce=require(_0xffc9('0xc'));var deskjs=require(_0xffc9('0xd'));var toCsv=require(_0xffc9('0x8'));var querystring=require(_0xffc9('0xe'));var Papa=require(_0xffc9('0xf'));var Redis=require(_0xffc9('0x10'));var authService=require(_0xffc9('0x11'));var qs=require(_0xffc9('0x12'));var as=require(_0xffc9('0x13'));var hardwareService=require(_0xffc9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xffc9('0x15'));var config=require(_0xffc9('0x16'));var licenseUtil=require(_0xffc9('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xffc9('0x18')](config[_0xffc9('0x19')],{'host':_0xffc9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xffc9('0x1b'))['register'](socket);var jayson=require(_0xffc9('0x1c'));var client=jayson['client'][_0xffc9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x161a62,_0x291e57,_0x53e7de,_0x4b77df){return new BPromise(function(_0x5e02d7,_0x3ea660){var _0x94da69=_0x4b77df||client;return _0x94da69[_0xffc9('0x1e')](_0x161a62,_0x53e7de)[_0xffc9('0x1f')](function(_0x4433e6){logger[_0xffc9('0x20')](_0xffc9('0x21'),_0x291e57,'request\x20sent');logger[_0xffc9('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x291e57,_0xffc9('0x23'),JSON[_0xffc9('0x24')](_0x4433e6));if(_0x4433e6[_0xffc9('0x25')]){if(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x26')]===0x1f4){logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x4433e6[_0xffc9('0x25')]['message']);return _0x3ea660(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);}logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);return _0x5e02d7(_0x4433e6[_0xffc9('0x25')][_0xffc9('0x27')]);}else{logger[_0xffc9('0x20')](_0xffc9('0x21'),_0x291e57,_0xffc9('0x23'));_0x5e02d7(_0x4433e6[_0xffc9('0x28')][_0xffc9('0x27')]);}})[_0xffc9('0x29')](function(_0x3c5b2c){logger[_0xffc9('0x25')](_0xffc9('0x21'),_0x291e57,_0x3c5b2c);_0x3ea660(_0x3c5b2c);});});}function respondWithStatusCode(_0x426a5f,_0x32051d){_0x32051d=_0x32051d||0xcc;return function(_0x4ec577){if(_0x4ec577){return _0x426a5f[_0xffc9('0x2a')](_0x32051d);}return _0x426a5f[_0xffc9('0x2b')](_0x32051d)[_0xffc9('0x2c')]();};}function respondWithResult(_0x497b63,_0x222aa2){_0x222aa2=_0x222aa2||0xc8;return function(_0x32aac9){if(_0x32aac9){return _0x497b63[_0xffc9('0x2b')](_0x222aa2)[_0xffc9('0x2d')](_0x32aac9);}};}function respondWithFilteredResult(_0x236c29,_0x20b003){return function(_0x55fbdc){if(_0x55fbdc){var _0x534824=typeof _0x20b003[_0xffc9('0x2e')]===_0xffc9('0x2f')&&typeof _0x20b003[_0xffc9('0x30')]===_0xffc9('0x2f');var _0x498fbc=_0x55fbdc[_0xffc9('0x31')];var _0x214be2=_0x534824?0x0:_0x20b003[_0xffc9('0x2e')];var _0x46c292=_0x534824?_0x55fbdc['count']:_0x20b003[_0xffc9('0x2e')]+_0x20b003[_0xffc9('0x30')];var _0x25b06a;if(_0x46c292>=_0x498fbc){_0x46c292=_0x498fbc;_0x25b06a=0xc8;}else{_0x25b06a=0xce;}_0x236c29['status'](_0x25b06a);return _0x236c29['set'](_0xffc9('0x32'),_0x214be2+'-'+_0x46c292+'/'+_0x498fbc)[_0xffc9('0x2d')](_0x55fbdc);}return null;};}function patchUpdates(_0x3bc55f){return function(_0x184990){try{jsonpatch[_0xffc9('0x33')](_0x184990,_0x3bc55f,!![]);}catch(_0x8c73a8){return BPromise[_0xffc9('0x34')](_0x8c73a8);}return _0x184990['save']();};}function saveUpdates(_0x1ac40c,_0x5ac558){return function(_0x409dad){if(_0x409dad){return _0x409dad[_0xffc9('0x35')](_0x1ac40c)[_0xffc9('0x1f')](function(_0x56818a){return _0x56818a;});}return null;};}function removeEntity(_0x115a11,_0x50a003){return function(_0x32c9ef){if(_0x32c9ef){return _0x32c9ef['destroy']()[_0xffc9('0x1f')](function(){var _0x581078=_0x32c9ef['get']({'plain':!![]});var _0x22bec9=_0xffc9('0x36');return db[_0xffc9('0x37')][_0xffc9('0x38')]({'where':{'type':_0x22bec9,'resourceId':_0x581078['id']}})[_0xffc9('0x1f')](function(){return _0x32c9ef;});})['then'](function(){_0x115a11[_0xffc9('0x2b')](0xcc)[_0xffc9('0x2c')]();});}};}function handleEntityNotFound(_0x2663ce,_0x45f582){return function(_0x20cf38){if(!_0x20cf38){_0x2663ce[_0xffc9('0x2a')](0x194);}return _0x20cf38;};}function handleError(_0x1c3425,_0x348164){_0x348164=_0x348164||0x1f4;return function(_0x298b55){logger[_0xffc9('0x25')](_0x298b55[_0xffc9('0x39')]);if(_0x298b55[_0xffc9('0x3a')]){delete _0x298b55[_0xffc9('0x3a')];}_0x1c3425[_0xffc9('0x2b')](_0x348164)[_0xffc9('0x3b')](_0x298b55);};}exports[_0xffc9('0x3c')]=function(_0x210035,_0x890139){var _0x58b2e5={},_0x337683={},_0x330b79={'count':0x0,'rows':[]};var _0xbad91e=_[_0xffc9('0x3d')](db[_0xffc9('0x3e')][_0xffc9('0x3f')],function(_0x143e57){return{'name':_0x143e57[_0xffc9('0x40')],'type':_0x143e57[_0xffc9('0x41')][_0xffc9('0x42')]};});_0x337683['model']=_[_0xffc9('0x3d')](_0xbad91e,_0xffc9('0x3a'));_0x337683['query']=_[_0xffc9('0x43')](_0x210035['query']);_0x337683[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x337683[_0xffc9('0x46')],_0x337683[_0xffc9('0x47')]);_0x58b2e5['attributes']=_[_0xffc9('0x45')](_0x337683['model'],qs['fields'](_0x210035['query']['fields']));_0x58b2e5['attributes']=_0x58b2e5[_0xffc9('0x48')]['length']?_0x58b2e5[_0xffc9('0x48')]:_0x337683[_0xffc9('0x46')];if(!_0x210035['query'][_0xffc9('0x49')](_0xffc9('0x4a'))){_0x58b2e5[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x210035[_0xffc9('0x47')][_0xffc9('0x30')]);_0x58b2e5['offset']=qs[_0xffc9('0x2e')](_0x210035[_0xffc9('0x47')][_0xffc9('0x2e')]);}_0x58b2e5[_0xffc9('0x4b')]=qs['sort'](_0x210035['query']['sort']);_0x58b2e5[_0xffc9('0x4c')]=qs[_0xffc9('0x44')](_['pick'](_0x210035[_0xffc9('0x47')],_0x337683[_0xffc9('0x44')]),_0xbad91e);if(_0x210035[_0xffc9('0x47')][_0xffc9('0x4d')]){_0x58b2e5[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x58b2e5[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0xbad91e,function(_0x5db879){if(_0x5db879[_0xffc9('0x41')]!=='VIRTUAL'){var _0x371e8f={};_0x371e8f[_0x5db879[_0xffc9('0x3a')]]={'$like':'%'+_0x210035[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x371e8f;}})});}_0x58b2e5=_[_0xffc9('0x4e')]({},_0x58b2e5,_0x210035[_0xffc9('0x4f')]);var _0x5c56ed={'where':_0x58b2e5[_0xffc9('0x4c')]};return db[_0xffc9('0x3e')][_0xffc9('0x31')](_0x5c56ed)['then'](function(_0x40b945){_0x330b79['count']=_0x40b945;if(_0x210035['query'][_0xffc9('0x50')]){_0x58b2e5[_0xffc9('0x51')]=[{'all':!![]}];}return db[_0xffc9('0x3e')][_0xffc9('0x52')](_0x58b2e5);})[_0xffc9('0x1f')](function(_0x2df004){_0x330b79[_0xffc9('0x53')]=_0x2df004;return _0x330b79;})[_0xffc9('0x1f')](respondWithFilteredResult(_0x890139,_0x58b2e5))[_0xffc9('0x29')](handleError(_0x890139,null));};exports[_0xffc9('0x54')]=function(_0x52cc5f,_0x355627){var _0x3d9c90={'raw':!![],'where':{'id':_0x52cc5f[_0xffc9('0x55')]['id']}},_0x2cb9a9={};_0x2cb9a9['model']=_['keys'](db[_0xffc9('0x3e')][_0xffc9('0x3f')]);_0x2cb9a9[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x52cc5f['query']);_0x2cb9a9[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x2cb9a9['model'],_0x2cb9a9['query']);_0x3d9c90[_0xffc9('0x48')]=_[_0xffc9('0x45')](_0x2cb9a9[_0xffc9('0x46')],qs['fields'](_0x52cc5f[_0xffc9('0x47')]['fields']));_0x3d9c90[_0xffc9('0x48')]=_0x3d9c90[_0xffc9('0x48')][_0xffc9('0x56')]?_0x3d9c90[_0xffc9('0x48')]:_0x2cb9a9[_0xffc9('0x46')];if(_0x52cc5f[_0xffc9('0x47')][_0xffc9('0x50')]){_0x3d9c90[_0xffc9('0x51')]=[{'all':!![]}];}_0x3d9c90=_[_0xffc9('0x4e')]({},_0x3d9c90,_0x52cc5f['options']);return db['ChatQueue'][_0xffc9('0x57')](_0x3d9c90)['then'](handleEntityNotFound(_0x355627,null))[_0xffc9('0x1f')](respondWithResult(_0x355627,null))[_0xffc9('0x29')](handleError(_0x355627,null));};exports['create']=function(_0x578c67,_0x1a3532){return db[_0xffc9('0x3e')]['create'](_0x578c67[_0xffc9('0x58')],{})[_0xffc9('0x1f')](function(_0x137d5b){var _0x3ab9e2=_0x578c67[_0xffc9('0x59')][_0xffc9('0x5a')]({'plain':!![]});if(!_0x3ab9e2)throw new Error(_0xffc9('0x5b'));if(_0x3ab9e2[_0xffc9('0x5c')]===_0xffc9('0x59')){var _0x476b92=_0x137d5b[_0xffc9('0x5a')]({'plain':!![]});var _0xdfe894='ChatQueues';return db[_0xffc9('0x5d')][_0xffc9('0x57')]({'where':{'name':_0xdfe894,'userProfileId':_0x3ab9e2[_0xffc9('0x5e')]},'raw':!![]})[_0xffc9('0x1f')](function(_0x5052d1){if(_0x5052d1&&_0x5052d1['autoAssociation']===0x0){return db[_0xffc9('0x37')]['create']({'name':_0x476b92[_0xffc9('0x3a')],'resourceId':_0x476b92['id'],'type':_0x5052d1[_0xffc9('0x3a')],'sectionId':_0x5052d1['id']},{})[_0xffc9('0x1f')](function(){return _0x137d5b;});}else{return _0x137d5b;}})['catch'](function(_0x2de9a5){logger['error'](_0xffc9('0x5f'),_0x2de9a5);throw _0x2de9a5;});}return _0x137d5b;})[_0xffc9('0x1f')](respondWithResult(_0x1a3532,0xc9))[_0xffc9('0x29')](handleError(_0x1a3532,null));};exports['update']=function(_0x20f730,_0x3f61ac){if(_0x20f730['body']['id']){delete _0x20f730['body']['id'];}return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x20f730[_0xffc9('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f61ac,null))[_0xffc9('0x1f')](saveUpdates(_0x20f730[_0xffc9('0x58')],null))[_0xffc9('0x1f')](respondWithResult(_0x3f61ac,null))[_0xffc9('0x29')](handleError(_0x3f61ac,null));};exports[_0xffc9('0x38')]=function(_0x94cf87,_0x3d28a9){return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x94cf87['params']['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3d28a9,null))[_0xffc9('0x1f')](removeEntity(_0x3d28a9,null))[_0xffc9('0x29')](handleError(_0x3d28a9,null));};exports[_0xffc9('0x60')]=function(_0x31f880,_0x779058){return db[_0xffc9('0x3e')]['describe']()['then'](respondWithResult(_0x779058,null))[_0xffc9('0x29')](handleError(_0x779058,null));};exports[_0xffc9('0x61')]=function(_0x3c4f8f,_0x3631f1,_0x2a687a){var _0x5df85b={'raw':!![],'where':{}},_0x1fe641={},_0xc6277b;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x3c4f8f['params']['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3631f1,null))['then'](function(_0x4d2986){if(_0x4d2986){_0xc6277b=_0x4d2986[_0xffc9('0x5a')]({'plain':!![]});_0x1fe641[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x63')][_0xffc9('0x3f')]);_0x1fe641[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x3c4f8f[_0xffc9('0x47')]);_0x1fe641[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x1fe641[_0xffc9('0x46')],_0x1fe641[_0xffc9('0x47')]);_0x5df85b['attributes']=_[_0xffc9('0x45')](_0x1fe641[_0xffc9('0x46')],qs[_0xffc9('0x64')](_0x3c4f8f['query'][_0xffc9('0x64')]));_0x5df85b[_0xffc9('0x48')]=_0x5df85b['attributes'][_0xffc9('0x56')]?_0x5df85b[_0xffc9('0x48')]:_0x1fe641['model'];if(!_0x3c4f8f['query'][_0xffc9('0x49')]('nolimit')){_0x5df85b[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x3c4f8f[_0xffc9('0x47')]['limit']);_0x5df85b[_0xffc9('0x2e')]=qs[_0xffc9('0x2e')](_0x3c4f8f[_0xffc9('0x47')][_0xffc9('0x2e')]);}_0x5df85b[_0xffc9('0x4b')]=qs['sort'](_0x3c4f8f[_0xffc9('0x47')][_0xffc9('0x65')]);_0x5df85b[_0xffc9('0x4c')]=qs['filters'](_[_0xffc9('0x66')](_0x3c4f8f['query'],_0x1fe641[_0xffc9('0x44')]));_0x5df85b[_0xffc9('0x4c')]['ChatQueueId']=_0x4d2986['id'];if(_0x3c4f8f['query'][_0xffc9('0x4d')]){_0x5df85b[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x5df85b['where'],{'$or':_[_0xffc9('0x3d')](_0x5df85b[_0xffc9('0x48')],function(_0x28c9a7){var _0x31a8a8={};_0x31a8a8[_0x28c9a7]={'$like':'%'+_0x3c4f8f['query']['filter']+'%'};return _0x31a8a8;})});}_0x5df85b=_[_0xffc9('0x4e')]({},_0x5df85b,_0x3c4f8f[_0xffc9('0x4f')]);return db[_0xffc9('0x63')][_0xffc9('0x52')](_0x5df85b);}})['then'](function(_0x347611){if(_0x347611){return db[_0xffc9('0x67')][_0xffc9('0x68')]({'where':{'id':_[_0xffc9('0x3d')](_0x347611,_0xffc9('0x69')),'role':'agent'},'attributes':['id',_0xffc9('0x3a'),'chatPause','updatedAt',_0xffc9('0x6a')]});}})[_0xffc9('0x1f')](function(_0x8d8fa4){if(_0x8d8fa4){return{'count':_0x8d8fa4[_0xffc9('0x31')],'rows':_['map'](_0x8d8fa4[_0xffc9('0x53')],function(_0x5566d8){return{'membername':_0x5566d8[_0xffc9('0x3a')],'UserId':_0x5566d8['id'],'queue_name':_0xc6277b[_0xffc9('0x3a')],'ChatQueueId':_0xc6277b['id'],'interface':util[_0xffc9('0x6b')](_0xffc9('0x6c'),'SIP',_0x5566d8[_0xffc9('0x3a')]),'penalty':0x0,'paused':_0x5566d8[_0xffc9('0x6d')],'createdAt':_0x5566d8[_0xffc9('0x6a')],'updatedAt':_0x5566d8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xffc9('0x1f')](respondWithFilteredResult(_0x3631f1,_0x5df85b))[_0xffc9('0x29')](handleError(_0x3631f1,null));};exports[_0xffc9('0x6e')]=function(_0x3bc838,_0x3086d8,_0xce020c){var _0x4133ec={};var _0x392623={};var _0x2d3ab0;var _0x8db8cf;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x3bc838[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x3086d8,null))[_0xffc9('0x1f')](function(_0x677796){if(_0x677796){_0x2d3ab0=_0x677796;_0x392623[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x6f')][_0xffc9('0x3f')]);_0x392623['query']=_['keys'](_0x3bc838[_0xffc9('0x47')]);_0x392623['filters']=_['intersection'](_0x392623[_0xffc9('0x46')],_0x392623[_0xffc9('0x47')]);_0x4133ec[_0xffc9('0x48')]=_[_0xffc9('0x45')](_0x392623['model'],qs['fields'](_0x3bc838['query'][_0xffc9('0x64')]));_0x4133ec['attributes']=_0x4133ec[_0xffc9('0x48')]['length']?_0x4133ec['attributes']:_0x392623['model'];_0x4133ec['order']=qs[_0xffc9('0x65')](_0x3bc838['query'][_0xffc9('0x65')]);_0x4133ec[_0xffc9('0x4c')]=qs[_0xffc9('0x44')](_['pick'](_0x3bc838[_0xffc9('0x47')],_0x392623[_0xffc9('0x44')]));if(_0x3bc838['query']['filter']){_0x4133ec[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x4133ec[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0x4133ec[_0xffc9('0x48')],function(_0x3b160a){var _0x52b590={};_0x52b590[_0x3b160a]={'$like':'%'+_0x3bc838[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x52b590;})});}_0x4133ec=_[_0xffc9('0x4e')]({},_0x4133ec,_0x3bc838[_0xffc9('0x4f')]);return _0x2d3ab0[_0xffc9('0x6e')](_0x4133ec);}})[_0xffc9('0x1f')](function(_0x11201d){if(_0x11201d){_0x8db8cf=_0x11201d['length'];if(!_0x3bc838[_0xffc9('0x47')]['hasOwnProperty'](_0xffc9('0x4a'))){_0x4133ec[_0xffc9('0x30')]=qs[_0xffc9('0x30')](_0x3bc838[_0xffc9('0x47')][_0xffc9('0x30')]);_0x4133ec['offset']=qs[_0xffc9('0x2e')](_0x3bc838['query']['offset']);}return _0x2d3ab0[_0xffc9('0x6e')](_0x4133ec);}})[_0xffc9('0x1f')](function(_0x278996){if(_0x278996){return _0x278996?{'count':_0x8db8cf,'rows':_0x278996}:null;}})[_0xffc9('0x1f')](respondWithResult(_0x3086d8,null))[_0xffc9('0x29')](handleError(_0x3086d8,null));};exports['addTeams']=function(_0x6872e7,_0x8f320f,_0x47feed){var _0x1fe8fb=_0x6872e7[_0xffc9('0x58')][_0xffc9('0x70')];return db[_0xffc9('0x6f')][_0xffc9('0x52')]({'where':{'id':_0x1fe8fb},'attributes':['id'],'include':[{'model':db[_0xffc9('0x67')],'as':'Agents','attributes':['id',_0xffc9('0x3a'),'online',_0xffc9('0x71'),_0xffc9('0x72')],'raw':!![]}]})['then'](function(_0x362f4c){if(_0x362f4c){var _0x59809a=_[_0xffc9('0x73')](_0x362f4c,function(_0x187e91){var _0x2d065f=_0x187e91[_0xffc9('0x5a')]({'plain':!![]});return _0x2d065f[_0xffc9('0x74')];});return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x6872e7[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](function(_0x29a42b){return db['sequelize']['transaction'](function(_0x3a9afa){return _0x29a42b[_0xffc9('0x75')](_0x1fe8fb,{'transaction':_0x3a9afa})[_0xffc9('0x1f')](function(){return BPromise['each'](_0x59809a,function(_0x1183f5){return db[_0xffc9('0x63')][_0xffc9('0x76')]({'where':{'UserId':_0x1183f5['id'],'ChatQueueId':_0x6872e7[_0xffc9('0x55')]['id']},'transaction':_0x3a9afa});});})[_0xffc9('0x1f')](function(){_0x59809a[_0xffc9('0x77')](function(_0x8e30ab){socket[_0xffc9('0x78')](_0xffc9('0x79'),{'UserId':_0x8e30ab['id'],'ChatQueueId':_0x29a42b['id']});});});});});}})[_0xffc9('0x1f')](respondWithStatusCode(_0x8f320f,null))[_0xffc9('0x29')](handleError(_0x8f320f,null));};exports[_0xffc9('0x7a')]=function(_0x155205,_0x5b2b5b,_0x335886){return db[_0xffc9('0x6f')][_0xffc9('0x52')]({'where':{'id':_0x155205[_0xffc9('0x47')][_0xffc9('0x70')]},'attributes':['id'],'include':[{'model':db[_0xffc9('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xffc9('0x1f')](handleEntityNotFound(_0x5b2b5b,null))[_0xffc9('0x1f')](function(_0x1d6729){var _0x2626e4=_[_0xffc9('0x3d')](_0x1d6729,'id');var _0x4849a2=[];var _0x3e146c=[];var _0x2b15b6=squel['select']();_0x2b15b6[_0xffc9('0x7b')]('tq.TeamId')['from'](_0xffc9('0x7c'),'tq')[_0xffc9('0x7d')](_0xffc9('0x7e'),'ut',_0xffc9('0x7f'))[_0xffc9('0x4c')](_0xffc9('0x80'),_0x155205[_0xffc9('0x55')]['id']);for(var _0x3a2a21=0x0;_0x3a2a21<_0x1d6729[_0xffc9('0x56')];_0x3a2a21+=0x1){let _0x51751a=_0x1d6729[_0x3a2a21];for(var _0x1a0d97=0x0;_0x1a0d97<_0x51751a['Agents'][_0xffc9('0x56')];_0x1a0d97+=0x1){let _0x5464c3=_0x51751a[_0xffc9('0x74')][_0x1a0d97];var _0x6579be=_0x2b15b6[_0xffc9('0x81')]();_0x6579be['where'](_0xffc9('0x82'),_0x5464c3['id']);_0x3e146c[_0xffc9('0x83')](db[_0xffc9('0x84')][_0xffc9('0x47')](_0x6579be[_0xffc9('0x85')](),{'type':db[_0xffc9('0x84')][_0xffc9('0x86')][_0xffc9('0x87')]})['then'](function(_0x155c38){if(_0x155c38[_0xffc9('0x56')]===0x1){return _0x5464c3['id'];}else{var _0xf34374=_[_0xffc9('0x88')](_[_0xffc9('0x3d')](_0x155c38,_0xffc9('0x89')),function(_0x4f78fb){return _[_0xffc9('0x8a')](_0x2626e4,_0x4f78fb);});if(_0xf34374){return _0x5464c3['id'];}}}));}}return BPromise[_0xffc9('0x8b')](_0x3e146c)[_0xffc9('0x1f')](function(_0x7aba4d){_0x4849a2=_(_0x4849a2)[_0xffc9('0x8c')](_0x7aba4d)[_0xffc9('0x8d')]()[_0xffc9('0x8e')]();return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x155205[_0xffc9('0x55')]['id']}})['then'](function(_0x13f945){return db['sequelize']['transaction'](function(_0x12c40d){return _0x13f945[_0xffc9('0x7a')](_0x155205[_0xffc9('0x47')][_0xffc9('0x70')],{'transaction':_0x12c40d})[_0xffc9('0x1f')](function(){if(!_[_0xffc9('0x8f')](_0x4849a2)){return _0x13f945[_0xffc9('0x90')](_0x4849a2,{'transaction':_0x12c40d});}})['then'](function(){_0x4849a2[_0xffc9('0x77')](function(_0x3d736e){socket[_0xffc9('0x78')](_0xffc9('0x91'),{'UserId':_0x3d736e,'ChatQueueId':_0x13f945['id']});});});});});});})[_0xffc9('0x1f')](respondWithStatusCode(_0x5b2b5b,null))[_0xffc9('0x29')](handleError(_0x5b2b5b,null));};exports['addAgents']=function(_0x21b1b4,_0x5cc66a,_0x24877e){return db[_0xffc9('0x3e')]['find']({'where':{'id':_0x21b1b4[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x5cc66a,null))['then'](function(_0x2e6f41){if(_0x2e6f41){return _0x2e6f41[_0xffc9('0x92')](_0x21b1b4['body'][_0xffc9('0x70')],_['omit'](_0x21b1b4['body'],[_0xffc9('0x70'),'id'])||{})[_0xffc9('0x93')](function(_0x7aa6a6){for(var _0x1c0b38=0x0;_0x1c0b38<_0x21b1b4[_0xffc9('0x58')]['ids']['length'];_0x1c0b38+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x21b1b4[_0xffc9('0x58')][_0xffc9('0x70')][_0x1c0b38]),'ChatQueueId':Number(_0x21b1b4[_0xffc9('0x55')]['id'])});}return _0x7aa6a6;});}})[_0xffc9('0x1f')](respondWithResult(_0x5cc66a,null))['catch'](handleError(_0x5cc66a,null));};exports[_0xffc9('0x90')]=function(_0x23791c,_0x483202,_0x489e41){return db[_0xffc9('0x3e')][_0xffc9('0x57')]({'where':{'id':_0x23791c[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x483202,null))[_0xffc9('0x1f')](function(_0x2a0e31){if(_0x2a0e31){return _0x2a0e31[_0xffc9('0x90')](_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')])[_0xffc9('0x1f')](function(){if(_['isArray'](_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')])){for(var _0x1ee8e9=0x0;_0x1ee8e9<_0x23791c[_0xffc9('0x47')]['ids'][_0xffc9('0x56')];_0x1ee8e9+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')][_0x1ee8e9]),'ChatQueueId':Number(_0x23791c[_0xffc9('0x55')]['id'])});}}else{socket['emit'](_0xffc9('0x91'),{'UserId':Number(_0x23791c[_0xffc9('0x47')][_0xffc9('0x70')]),'ChatQueueId':Number(_0x23791c['params']['id'])});}});}})[_0xffc9('0x1f')](respondWithStatusCode(_0x483202,null))[_0xffc9('0x29')](handleError(_0x483202,null));};exports['getAgents']=function(_0x4f1698,_0x5c02ae,_0x35b850){var _0x45f1a5={};var _0x317a1a={};var _0x23183f;var _0x5276e5;return db[_0xffc9('0x3e')][_0xffc9('0x62')]({'where':{'id':_0x4f1698[_0xffc9('0x55')]['id']}})[_0xffc9('0x1f')](handleEntityNotFound(_0x5c02ae,null))[_0xffc9('0x1f')](function(_0x2e264e){if(_0x2e264e){_0x23183f=_0x2e264e;_0x317a1a[_0xffc9('0x46')]=_[_0xffc9('0x43')](db[_0xffc9('0x67')][_0xffc9('0x3f')]);_0x317a1a[_0xffc9('0x47')]=_[_0xffc9('0x43')](_0x4f1698[_0xffc9('0x47')]);_0x317a1a[_0xffc9('0x44')]=_[_0xffc9('0x45')](_0x317a1a[_0xffc9('0x46')],_0x317a1a[_0xffc9('0x47')]);_0x45f1a5[_0xffc9('0x48')]=_['intersection'](_0x317a1a[_0xffc9('0x46')],qs[_0xffc9('0x64')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x64')]));_0x45f1a5[_0xffc9('0x48')]=_0x45f1a5['attributes'][_0xffc9('0x56')]?_0x45f1a5[_0xffc9('0x48')]:_0x317a1a[_0xffc9('0x46')];_0x45f1a5[_0xffc9('0x4b')]=qs[_0xffc9('0x65')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x65')]);_0x45f1a5['where']=qs[_0xffc9('0x44')](_[_0xffc9('0x66')](_0x4f1698[_0xffc9('0x47')],_0x317a1a['filters']));if(_0x4f1698[_0xffc9('0x47')][_0xffc9('0x4d')]){_0x45f1a5[_0xffc9('0x4c')]=_[_0xffc9('0x4e')](_0x45f1a5[_0xffc9('0x4c')],{'$or':_[_0xffc9('0x3d')](_0x45f1a5[_0xffc9('0x48')],function(_0xd56ea1){var _0x5300b1={};_0x5300b1[_0xd56ea1]={'$like':'%'+_0x4f1698[_0xffc9('0x47')][_0xffc9('0x4d')]+'%'};return _0x5300b1;})});}_0x45f1a5=_[_0xffc9('0x4e')]({},_0x45f1a5,_0x4f1698[_0xffc9('0x4f')]);return _0x23183f[_0xffc9('0x94')](_0x45f1a5);}})['then'](function(_0x1fbaf4){if(_0x1fbaf4){_0x5276e5=_0x1fbaf4[_0xffc9('0x56')];if(!_0x4f1698[_0xffc9('0x47')][_0xffc9('0x49')]('nolimit')){_0x45f1a5['limit']=qs[_0xffc9('0x30')](_0x4f1698[_0xffc9('0x47')][_0xffc9('0x30')]);_0x45f1a5[_0xffc9('0x2e')]=qs[_0xffc9('0x2e')](_0x4f1698['query'][_0xffc9('0x2e')]);}return _0x23183f[_0xffc9('0x94')](_0x45f1a5);}})[_0xffc9('0x1f')](function(_0xa2211e){if(_0xa2211e){return _0xa2211e?{'count':_0x5276e5,'rows':_0xa2211e}:null;}})[_0xffc9('0x1f')](respondWithResult(_0x5c02ae,null))['catch'](handleError(_0x5c02ae,null));}; \ No newline at end of file +var _0x1ce5=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','destroy','get','ChatQueues','stack','name','send','index','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x2c3b55,_0x52944c){var _0x52aff2=function(_0x26dbb0){while(--_0x26dbb0){_0x2c3b55['push'](_0x2c3b55['shift']());}};_0x52aff2(++_0x52944c);}(_0x1ce5,0xea));var _0x51ce=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x1ce5[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x51ce('0x0'));var rp=require(_0x51ce('0x1'));var moment=require(_0x51ce('0x2'));var BPromise=require(_0x51ce('0x3'));var Mustache=require(_0x51ce('0x4'));var util=require(_0x51ce('0x5'));var path=require(_0x51ce('0x6'));var sox=require(_0x51ce('0x7'));var csv=require(_0x51ce('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51ce('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51ce('0xa'));var deskjs=require(_0x51ce('0xb'));var toCsv=require(_0x51ce('0x8'));var querystring=require('querystring');var Papa=require(_0x51ce('0xc'));var Redis=require(_0x51ce('0xd'));var authService=require(_0x51ce('0xe'));var qs=require(_0x51ce('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51ce('0x10'));var logger=require(_0x51ce('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51ce('0x12'));var db=require(_0x51ce('0x13'))['db'];config[_0x51ce('0x14')]=_[_0x51ce('0x15')](config['redis'],{'host':_0x51ce('0x16'),'port':0x18eb});var socket=require(_0x51ce('0x17'))(new Redis(config[_0x51ce('0x14')]));require(_0x51ce('0x18'))[_0x51ce('0x19')](socket);var jayson=require(_0x51ce('0x1a'));var client=jayson[_0x51ce('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7f85,_0x15e57f,_0x57d22d,_0x21d4d8){return new BPromise(function(_0x369bde,_0x13cb2c){var _0x9b73d=_0x21d4d8||client;return _0x9b73d[_0x51ce('0x1c')](_0x1f7f85,_0x57d22d)[_0x51ce('0x1d')](function(_0xd4af01){logger[_0x51ce('0x1e')](_0x51ce('0x1f'),_0x15e57f,_0x51ce('0x20'));logger[_0x51ce('0x21')](_0x51ce('0x22'),_0x15e57f,_0x51ce('0x20'),JSON['stringify'](_0xd4af01));if(_0xd4af01[_0x51ce('0x23')]){if(_0xd4af01[_0x51ce('0x23')][_0x51ce('0x24')]===0x1f4){logger['error'](_0x51ce('0x1f'),_0x15e57f,_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);return _0x13cb2c(_0xd4af01['error']['message']);}logger[_0x51ce('0x23')]('ChatQueue,\x20%s,\x20%s',_0x15e57f,_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);return _0x369bde(_0xd4af01[_0x51ce('0x23')][_0x51ce('0x25')]);}else{logger[_0x51ce('0x1e')]('ChatQueue,\x20%s,\x20%s',_0x15e57f,_0x51ce('0x20'));_0x369bde(_0xd4af01[_0x51ce('0x26')][_0x51ce('0x25')]);}})[_0x51ce('0x27')](function(_0x20aec2){logger[_0x51ce('0x23')](_0x51ce('0x1f'),_0x15e57f,_0x20aec2);_0x13cb2c(_0x20aec2);});});}function respondWithStatusCode(_0x41fa69,_0x3d34db){_0x3d34db=_0x3d34db||0xcc;return function(_0x4f264d){if(_0x4f264d){return _0x41fa69[_0x51ce('0x28')](_0x3d34db);}return _0x41fa69[_0x51ce('0x29')](_0x3d34db)[_0x51ce('0x2a')]();};}function respondWithResult(_0x450089,_0x4d08b8){_0x4d08b8=_0x4d08b8||0xc8;return function(_0x5c6605){if(_0x5c6605){return _0x450089[_0x51ce('0x29')](_0x4d08b8)[_0x51ce('0x2b')](_0x5c6605);}};}function respondWithFilteredResult(_0x1742c3,_0xf2248e){return function(_0x5dd380){if(_0x5dd380){var _0x5ad1e3=typeof _0xf2248e[_0x51ce('0x2c')]===_0x51ce('0x2d')&&typeof _0xf2248e['limit']==='undefined';var _0x6cdfa3=_0x5dd380[_0x51ce('0x2e')];var _0x48eb90=_0x5ad1e3?0x0:_0xf2248e[_0x51ce('0x2c')];var _0x15114a=_0x5ad1e3?_0x5dd380[_0x51ce('0x2e')]:_0xf2248e[_0x51ce('0x2c')]+_0xf2248e[_0x51ce('0x2f')];var _0x35a680;if(_0x15114a>=_0x6cdfa3){_0x15114a=_0x6cdfa3;_0x35a680=0xc8;}else{_0x35a680=0xce;}_0x1742c3[_0x51ce('0x29')](_0x35a680);return _0x1742c3['set'](_0x51ce('0x30'),_0x48eb90+'-'+_0x15114a+'/'+_0x6cdfa3)[_0x51ce('0x2b')](_0x5dd380);}return null;};}function patchUpdates(_0x5b5e16){return function(_0x2219c0){try{jsonpatch[_0x51ce('0x31')](_0x2219c0,_0x5b5e16,!![]);}catch(_0x1f0676){return BPromise[_0x51ce('0x32')](_0x1f0676);}return _0x2219c0['save']();};}function saveUpdates(_0x5cfa0e,_0x8714f6){return function(_0x34225c){if(_0x34225c){return _0x34225c[_0x51ce('0x33')](_0x5cfa0e)[_0x51ce('0x1d')](function(_0x47af16){return _0x47af16;});}return null;};}function removeEntity(_0x3ec336,_0x339697){return function(_0x33d4f8){if(_0x33d4f8){return _0x33d4f8[_0x51ce('0x34')]()[_0x51ce('0x1d')](function(){var _0x3fa98c=_0x33d4f8[_0x51ce('0x35')]({'plain':!![]});var _0x263aba=_0x51ce('0x36');return db['UserProfileResource'][_0x51ce('0x34')]({'where':{'type':_0x263aba,'resourceId':_0x3fa98c['id']}})[_0x51ce('0x1d')](function(){return _0x33d4f8;});})[_0x51ce('0x1d')](function(){_0x3ec336[_0x51ce('0x29')](0xcc)[_0x51ce('0x2a')]();});}};}function handleEntityNotFound(_0x416648,_0x22c026){return function(_0x299440){if(!_0x299440){_0x416648[_0x51ce('0x28')](0x194);}return _0x299440;};}function handleError(_0x16cc30,_0x44ff68){_0x44ff68=_0x44ff68||0x1f4;return function(_0x93abbf){logger[_0x51ce('0x23')](_0x93abbf[_0x51ce('0x37')]);if(_0x93abbf[_0x51ce('0x38')]){delete _0x93abbf[_0x51ce('0x38')];}_0x16cc30[_0x51ce('0x29')](_0x44ff68)[_0x51ce('0x39')](_0x93abbf);};}exports[_0x51ce('0x3a')]=function(_0x22d36b,_0x2f4a34){var _0x4bcffe={},_0x18efea={},_0x12b9c4={'count':0x0,'rows':[]};var _0x3a12f9=_['map'](db[_0x51ce('0x3b')]['rawAttributes'],function(_0x149fb4){return{'name':_0x149fb4[_0x51ce('0x3c')],'type':_0x149fb4[_0x51ce('0x3d')][_0x51ce('0x3e')]};});_0x18efea[_0x51ce('0x3f')]=_['map'](_0x3a12f9,'name');_0x18efea[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x22d36b[_0x51ce('0x40')]);_0x18efea[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x18efea['model'],_0x18efea[_0x51ce('0x40')]);_0x4bcffe[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x18efea[_0x51ce('0x3f')],qs[_0x51ce('0x45')](_0x22d36b[_0x51ce('0x40')][_0x51ce('0x45')]));_0x4bcffe['attributes']=_0x4bcffe[_0x51ce('0x44')][_0x51ce('0x46')]?_0x4bcffe[_0x51ce('0x44')]:_0x18efea[_0x51ce('0x3f')];if(!_0x22d36b[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x4bcffe[_0x51ce('0x2f')]=qs[_0x51ce('0x2f')](_0x22d36b[_0x51ce('0x40')]['limit']);_0x4bcffe[_0x51ce('0x2c')]=qs[_0x51ce('0x2c')](_0x22d36b[_0x51ce('0x40')]['offset']);}_0x4bcffe[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x4bcffe[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x22d36b[_0x51ce('0x40')],_0x18efea[_0x51ce('0x42')]),_0x3a12f9);if(_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x4bcffe['where']=_[_0x51ce('0x4e')](_0x4bcffe[_0x51ce('0x4b')],{'$or':_[_0x51ce('0x4f')](_0x3a12f9,function(_0x587d4f){if(_0x587d4f['type']!==_0x51ce('0x50')){var _0x420c83={};_0x420c83[_0x587d4f[_0x51ce('0x38')]]={'$like':'%'+_0x22d36b[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x420c83;}})});}_0x4bcffe=_['merge']({},_0x4bcffe,_0x22d36b[_0x51ce('0x51')]);var _0x50f75d={'where':_0x4bcffe[_0x51ce('0x4b')]};return db[_0x51ce('0x3b')]['count'](_0x50f75d)[_0x51ce('0x1d')](function(_0x1f43ea){_0x12b9c4[_0x51ce('0x2e')]=_0x1f43ea;if(_0x22d36b[_0x51ce('0x40')][_0x51ce('0x52')]){_0x4bcffe['include']=[{'all':!![]}];}return db[_0x51ce('0x3b')][_0x51ce('0x53')](_0x4bcffe);})[_0x51ce('0x1d')](function(_0xeb8611){_0x12b9c4[_0x51ce('0x54')]=_0xeb8611;return _0x12b9c4;})[_0x51ce('0x1d')](respondWithFilteredResult(_0x2f4a34,_0x4bcffe))[_0x51ce('0x27')](handleError(_0x2f4a34,null));};exports[_0x51ce('0x55')]=function(_0x258972,_0x4df83e){var _0x20c0f0={'raw':!![],'where':{'id':_0x258972['params']['id']}},_0x530451={};_0x530451[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x3b')][_0x51ce('0x56')]);_0x530451[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x258972['query']);_0x530451[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x530451[_0x51ce('0x3f')],_0x530451[_0x51ce('0x40')]);_0x20c0f0[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x530451[_0x51ce('0x3f')],qs[_0x51ce('0x45')](_0x258972[_0x51ce('0x40')]['fields']));_0x20c0f0[_0x51ce('0x44')]=_0x20c0f0['attributes']['length']?_0x20c0f0[_0x51ce('0x44')]:_0x530451[_0x51ce('0x3f')];if(_0x258972[_0x51ce('0x40')][_0x51ce('0x52')]){_0x20c0f0['include']=[{'all':!![]}];}_0x20c0f0=_[_0x51ce('0x4e')]({},_0x20c0f0,_0x258972['options']);return db[_0x51ce('0x3b')][_0x51ce('0x57')](_0x20c0f0)['then'](handleEntityNotFound(_0x4df83e,null))[_0x51ce('0x1d')](respondWithResult(_0x4df83e,null))['catch'](handleError(_0x4df83e,null));};exports[_0x51ce('0x58')]=function(_0x456a1c,_0x1e3b30){return db[_0x51ce('0x3b')]['create'](_0x456a1c[_0x51ce('0x59')],{})['then'](function(_0xf828be){var _0x459700=_0x456a1c[_0x51ce('0x5a')][_0x51ce('0x35')]({'plain':!![]});if(!_0x459700)throw new Error(_0x51ce('0x5b'));if(_0x459700[_0x51ce('0x5c')]==='user'){var _0x26ba3f=_0xf828be[_0x51ce('0x35')]({'plain':!![]});var _0x5aa378='ChatQueues';return db['UserProfileSection'][_0x51ce('0x57')]({'where':{'name':_0x5aa378,'userProfileId':_0x459700[_0x51ce('0x5d')]},'raw':!![]})['then'](function(_0x25a063){if(_0x25a063&&_0x25a063['autoAssociation']===0x0){return db[_0x51ce('0x5e')][_0x51ce('0x58')]({'name':_0x26ba3f[_0x51ce('0x38')],'resourceId':_0x26ba3f['id'],'type':_0x25a063[_0x51ce('0x38')],'sectionId':_0x25a063['id']},{})[_0x51ce('0x1d')](function(){return _0xf828be;});}else{return _0xf828be;}})[_0x51ce('0x27')](function(_0x3e9e56){logger[_0x51ce('0x23')](_0x51ce('0x5f'),_0x3e9e56);throw _0x3e9e56;});}return _0xf828be;})['then'](respondWithResult(_0x1e3b30,0xc9))[_0x51ce('0x27')](handleError(_0x1e3b30,null));};exports['update']=function(_0x5b570b,_0x427dbf){if(_0x5b570b[_0x51ce('0x59')]['id']){delete _0x5b570b[_0x51ce('0x59')]['id'];}return db['ChatQueue'][_0x51ce('0x57')]({'where':{'id':_0x5b570b[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x427dbf,null))[_0x51ce('0x1d')](saveUpdates(_0x5b570b[_0x51ce('0x59')],null))[_0x51ce('0x1d')](respondWithResult(_0x427dbf,null))[_0x51ce('0x27')](handleError(_0x427dbf,null));};exports['destroy']=function(_0x3f82d5,_0x4a21a8){return db[_0x51ce('0x3b')]['find']({'where':{'id':_0x3f82d5[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x4a21a8,null))[_0x51ce('0x1d')](removeEntity(_0x4a21a8,null))[_0x51ce('0x27')](handleError(_0x4a21a8,null));};exports['describe']=function(_0x5a1494,_0x7ecdbe){return db[_0x51ce('0x3b')][_0x51ce('0x61')]()[_0x51ce('0x1d')](respondWithResult(_0x7ecdbe,null))[_0x51ce('0x27')](handleError(_0x7ecdbe,null));};exports['getMembers']=function(_0x39d5ae,_0x261c1b,_0x189e51){var _0x41d6e0={'raw':!![],'where':{}},_0x5fd42a={},_0x30f977;return db[_0x51ce('0x3b')][_0x51ce('0x62')]({'where':{'id':_0x39d5ae[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x261c1b,null))[_0x51ce('0x1d')](function(_0x2bbfd6){if(_0x2bbfd6){_0x30f977=_0x2bbfd6['get']({'plain':!![]});_0x5fd42a[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x63')][_0x51ce('0x56')]);_0x5fd42a['query']=_[_0x51ce('0x41')](_0x39d5ae[_0x51ce('0x40')]);_0x5fd42a['filters']=_[_0x51ce('0x43')](_0x5fd42a[_0x51ce('0x3f')],_0x5fd42a['query']);_0x41d6e0[_0x51ce('0x44')]=_[_0x51ce('0x43')](_0x5fd42a[_0x51ce('0x3f')],qs['fields'](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x45')]));_0x41d6e0[_0x51ce('0x44')]=_0x41d6e0[_0x51ce('0x44')]['length']?_0x41d6e0['attributes']:_0x5fd42a['model'];if(!_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x41d6e0[_0x51ce('0x2f')]=qs['limit'](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x2f')]);_0x41d6e0['offset']=qs[_0x51ce('0x2c')](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x2c')]);}_0x41d6e0[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x41d6e0['where']=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x39d5ae[_0x51ce('0x40')],_0x5fd42a[_0x51ce('0x42')]));_0x41d6e0[_0x51ce('0x4b')][_0x51ce('0x64')]=_0x2bbfd6['id'];if(_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x41d6e0['where']=_['merge'](_0x41d6e0[_0x51ce('0x4b')],{'$or':_[_0x51ce('0x4f')](_0x41d6e0[_0x51ce('0x44')],function(_0x258fc7){var _0x4792f4={};_0x4792f4[_0x258fc7]={'$like':'%'+_0x39d5ae[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x4792f4;})});}_0x41d6e0=_[_0x51ce('0x4e')]({},_0x41d6e0,_0x39d5ae[_0x51ce('0x51')]);return db[_0x51ce('0x63')][_0x51ce('0x53')](_0x41d6e0);}})[_0x51ce('0x1d')](function(_0x15e456){if(_0x15e456){return db[_0x51ce('0x65')][_0x51ce('0x66')]({'where':{'id':_[_0x51ce('0x4f')](_0x15e456,_0x51ce('0x67')),'role':_0x51ce('0x68')},'attributes':['id',_0x51ce('0x38'),_0x51ce('0x69'),_0x51ce('0x6a'),'createdAt']});}})['then'](function(_0x552d6c){if(_0x552d6c){return{'count':_0x552d6c[_0x51ce('0x2e')],'rows':_['map'](_0x552d6c[_0x51ce('0x54')],function(_0x5ee473){return{'membername':_0x5ee473['name'],'UserId':_0x5ee473['id'],'queue_name':_0x30f977[_0x51ce('0x38')],'ChatQueueId':_0x30f977['id'],'interface':util[_0x51ce('0x6b')](_0x51ce('0x6c'),'SIP',_0x5ee473[_0x51ce('0x38')]),'penalty':0x0,'paused':_0x5ee473['chatPause'],'createdAt':_0x5ee473[_0x51ce('0x6d')],'updatedAt':_0x5ee473[_0x51ce('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51ce('0x1d')](respondWithFilteredResult(_0x261c1b,_0x41d6e0))['catch'](handleError(_0x261c1b,null));};exports[_0x51ce('0x6e')]=function(_0x1f9aee,_0x1f989f,_0x8375f0){var _0x36acec={};var _0x1eb274={};var _0x7e7f5f;var _0x5a830c;return db[_0x51ce('0x3b')]['findOne']({'where':{'id':_0x1f9aee[_0x51ce('0x60')]['id']}})['then'](handleEntityNotFound(_0x1f989f,null))['then'](function(_0x506223){if(_0x506223){_0x7e7f5f=_0x506223;_0x1eb274[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x6f')][_0x51ce('0x56')]);_0x1eb274[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x1f9aee[_0x51ce('0x40')]);_0x1eb274[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x1eb274[_0x51ce('0x3f')],_0x1eb274[_0x51ce('0x40')]);_0x36acec['attributes']=_[_0x51ce('0x43')](_0x1eb274['model'],qs['fields'](_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x45')]));_0x36acec[_0x51ce('0x44')]=_0x36acec['attributes'][_0x51ce('0x46')]?_0x36acec[_0x51ce('0x44')]:_0x1eb274[_0x51ce('0x3f')];_0x36acec[_0x51ce('0x49')]=qs[_0x51ce('0x4a')](_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4a')]);_0x36acec[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_['pick'](_0x1f9aee[_0x51ce('0x40')],_0x1eb274[_0x51ce('0x42')]));if(_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x36acec[_0x51ce('0x4b')]=_[_0x51ce('0x4e')](_0x36acec[_0x51ce('0x4b')],{'$or':_['map'](_0x36acec[_0x51ce('0x44')],function(_0x2a7a5e){var _0x4b48a8={};_0x4b48a8[_0x2a7a5e]={'$like':'%'+_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x4b48a8;})});}_0x36acec=_[_0x51ce('0x4e')]({},_0x36acec,_0x1f9aee[_0x51ce('0x51')]);return _0x7e7f5f[_0x51ce('0x6e')](_0x36acec);}})[_0x51ce('0x1d')](function(_0x5c6113){if(_0x5c6113){_0x5a830c=_0x5c6113[_0x51ce('0x46')];if(!_0x1f9aee[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x36acec[_0x51ce('0x2f')]=qs['limit'](_0x1f9aee['query'][_0x51ce('0x2f')]);_0x36acec['offset']=qs[_0x51ce('0x2c')](_0x1f9aee['query'][_0x51ce('0x2c')]);}return _0x7e7f5f[_0x51ce('0x6e')](_0x36acec);}})['then'](function(_0x3400fe){if(_0x3400fe){return _0x3400fe?{'count':_0x5a830c,'rows':_0x3400fe}:null;}})['then'](respondWithResult(_0x1f989f,null))[_0x51ce('0x27')](handleError(_0x1f989f,null));};exports[_0x51ce('0x70')]=function(_0x25db62,_0x4378ac,_0x3127a7){var _0x3fe846=_0x25db62[_0x51ce('0x59')][_0x51ce('0x71')];return db[_0x51ce('0x6f')][_0x51ce('0x53')]({'where':{'id':_0x3fe846},'attributes':['id'],'include':[{'model':db[_0x51ce('0x65')],'as':_0x51ce('0x72'),'attributes':['id',_0x51ce('0x38'),_0x51ce('0x73'),_0x51ce('0x74'),_0x51ce('0x75')],'raw':!![]}]})['then'](function(_0x1c1062){if(_0x1c1062){var _0x24633b=_[_0x51ce('0x76')](_0x1c1062,function(_0x4ee81d){var _0xc2aecf=_0x4ee81d[_0x51ce('0x35')]({'plain':!![]});return _0xc2aecf['Agents'];});return db[_0x51ce('0x3b')][_0x51ce('0x57')]({'where':{'id':_0x25db62[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](function(_0x12c16d){return db['sequelize']['transaction'](function(_0x3202f0){return _0x12c16d['addTeams'](_0x3fe846,{'transaction':_0x3202f0})[_0x51ce('0x1d')](function(){return BPromise['each'](_0x24633b,function(_0x43fb40){return db[_0x51ce('0x63')][_0x51ce('0x77')]({'where':{'UserId':_0x43fb40['id'],'ChatQueueId':_0x25db62[_0x51ce('0x60')]['id']},'transaction':_0x3202f0});});})[_0x51ce('0x1d')](function(){_0x24633b[_0x51ce('0x78')](function(_0x5251ec){socket['emit'](_0x51ce('0x79'),{'UserId':_0x5251ec['id'],'ChatQueueId':_0x12c16d['id']});});});});});}})[_0x51ce('0x1d')](respondWithStatusCode(_0x4378ac,null))[_0x51ce('0x27')](handleError(_0x4378ac,null));};exports[_0x51ce('0x7a')]=function(_0x9db6de,_0x5a18af,_0x2108f9){return db['Team'][_0x51ce('0x53')]({'where':{'id':_0x9db6de[_0x51ce('0x40')][_0x51ce('0x71')]},'attributes':['id'],'include':[{'model':db[_0x51ce('0x65')],'as':_0x51ce('0x72'),'attributes':['id'],'raw':!![]}]})[_0x51ce('0x1d')](handleEntityNotFound(_0x5a18af,null))[_0x51ce('0x1d')](function(_0x35c280){var _0x267f4b=_[_0x51ce('0x4f')](_0x35c280,'id');var _0xe41950=[];var _0x23f79e=[];var _0x492832=squel[_0x51ce('0x7b')]();_0x492832[_0x51ce('0x7c')](_0x51ce('0x7d'))[_0x51ce('0x7e')](_0x51ce('0x7f'),'tq')[_0x51ce('0x80')]('user_has_teams','ut',_0x51ce('0x81'))[_0x51ce('0x4b')]('ChatQueueId\x20=\x20?',_0x9db6de[_0x51ce('0x60')]['id']);for(var _0x511988=0x0;_0x511988<_0x35c280[_0x51ce('0x46')];_0x511988+=0x1){let _0x155b62=_0x35c280[_0x511988];for(var _0x4ae22d=0x0;_0x4ae22d<_0x155b62['Agents'][_0x51ce('0x46')];_0x4ae22d+=0x1){let _0x155908=_0x155b62['Agents'][_0x4ae22d];var _0x536aa3=_0x492832[_0x51ce('0x82')]();_0x536aa3['where'](_0x51ce('0x83'),_0x155908['id']);_0x23f79e[_0x51ce('0x84')](db['sequelize'][_0x51ce('0x40')](_0x536aa3[_0x51ce('0x85')](),{'type':db[_0x51ce('0x86')][_0x51ce('0x87')][_0x51ce('0x88')]})[_0x51ce('0x1d')](function(_0x574d40){if(_0x574d40[_0x51ce('0x46')]===0x1){return _0x155908['id'];}else{var _0x364731=_[_0x51ce('0x89')](_[_0x51ce('0x4f')](_0x574d40,_0x51ce('0x8a')),function(_0x4621cb){return _[_0x51ce('0x8b')](_0x267f4b,_0x4621cb);});if(_0x364731){return _0x155908['id'];}}}));}}return BPromise['all'](_0x23f79e)[_0x51ce('0x1d')](function(_0xa8e76b){_0xe41950=_(_0xe41950)[_0x51ce('0x8c')](_0xa8e76b)[_0x51ce('0x8d')]()[_0x51ce('0x8e')]();return db['ChatQueue'][_0x51ce('0x57')]({'where':{'id':_0x9db6de[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](function(_0x54933e){return db[_0x51ce('0x86')][_0x51ce('0x8f')](function(_0x1308be){return _0x54933e[_0x51ce('0x7a')](_0x9db6de[_0x51ce('0x40')][_0x51ce('0x71')],{'transaction':_0x1308be})[_0x51ce('0x1d')](function(){if(!_['isEmpty'](_0xe41950)){return _0x54933e[_0x51ce('0x90')](_0xe41950,{'transaction':_0x1308be});}})[_0x51ce('0x1d')](function(){_0xe41950['forEach'](function(_0x1b8485){socket[_0x51ce('0x91')](_0x51ce('0x92'),{'UserId':_0x1b8485,'ChatQueueId':_0x54933e['id']});});});});});});})['then'](respondWithStatusCode(_0x5a18af,null))[_0x51ce('0x27')](handleError(_0x5a18af,null));};exports[_0x51ce('0x93')]=function(_0x2a14a4,_0xacecc1,_0x259fbd){return db[_0x51ce('0x3b')][_0x51ce('0x57')]({'where':{'id':_0x2a14a4['params']['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0xacecc1,null))[_0x51ce('0x1d')](function(_0xf6c9f8){if(_0xf6c9f8){return _0xf6c9f8[_0x51ce('0x93')](_0x2a14a4[_0x51ce('0x59')][_0x51ce('0x71')],_[_0x51ce('0x94')](_0x2a14a4[_0x51ce('0x59')],[_0x51ce('0x71'),'id'])||{})[_0x51ce('0x95')](function(_0x131d20){for(var _0x4eff62=0x0;_0x4eff62<_0x2a14a4['body'][_0x51ce('0x71')][_0x51ce('0x46')];_0x4eff62+=0x1){socket['emit'](_0x51ce('0x79'),{'UserId':Number(_0x2a14a4[_0x51ce('0x59')]['ids'][_0x4eff62]),'ChatQueueId':Number(_0x2a14a4[_0x51ce('0x60')]['id'])});}return _0x131d20;});}})[_0x51ce('0x1d')](respondWithResult(_0xacecc1,null))[_0x51ce('0x27')](handleError(_0xacecc1,null));};exports[_0x51ce('0x90')]=function(_0x342e72,_0x143e39,_0x1053b2){return db['ChatQueue']['find']({'where':{'id':_0x342e72[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x143e39,null))[_0x51ce('0x1d')](function(_0x1ed00b){if(_0x1ed00b){return _0x1ed00b[_0x51ce('0x90')](_0x342e72[_0x51ce('0x40')]['ids'])[_0x51ce('0x1d')](function(){if(_[_0x51ce('0x96')](_0x342e72['query'][_0x51ce('0x71')])){for(var _0x2017e4=0x0;_0x2017e4<_0x342e72[_0x51ce('0x40')][_0x51ce('0x71')][_0x51ce('0x46')];_0x2017e4+=0x1){socket[_0x51ce('0x91')]('userChatQueue:remove',{'UserId':Number(_0x342e72['query'][_0x51ce('0x71')][_0x2017e4]),'ChatQueueId':Number(_0x342e72[_0x51ce('0x60')]['id'])});}}else{socket[_0x51ce('0x91')](_0x51ce('0x92'),{'UserId':Number(_0x342e72[_0x51ce('0x40')][_0x51ce('0x71')]),'ChatQueueId':Number(_0x342e72['params']['id'])});}});}})['then'](respondWithStatusCode(_0x143e39,null))[_0x51ce('0x27')](handleError(_0x143e39,null));};exports[_0x51ce('0x97')]=function(_0x22849b,_0x4cab30,_0x4b18cf){var _0x3d6842={};var _0x597967={};var _0x54d965;var _0xf6d566;return db[_0x51ce('0x3b')][_0x51ce('0x62')]({'where':{'id':_0x22849b[_0x51ce('0x60')]['id']}})[_0x51ce('0x1d')](handleEntityNotFound(_0x4cab30,null))[_0x51ce('0x1d')](function(_0x277c74){if(_0x277c74){_0x54d965=_0x277c74;_0x597967[_0x51ce('0x3f')]=_[_0x51ce('0x41')](db[_0x51ce('0x65')][_0x51ce('0x56')]);_0x597967[_0x51ce('0x40')]=_[_0x51ce('0x41')](_0x22849b[_0x51ce('0x40')]);_0x597967[_0x51ce('0x42')]=_[_0x51ce('0x43')](_0x597967[_0x51ce('0x3f')],_0x597967['query']);_0x3d6842['attributes']=_[_0x51ce('0x43')](_0x597967[_0x51ce('0x3f')],qs['fields'](_0x22849b['query']['fields']));_0x3d6842['attributes']=_0x3d6842[_0x51ce('0x44')][_0x51ce('0x46')]?_0x3d6842[_0x51ce('0x44')]:_0x597967['model'];_0x3d6842['order']=qs[_0x51ce('0x4a')](_0x22849b[_0x51ce('0x40')]['sort']);_0x3d6842[_0x51ce('0x4b')]=qs[_0x51ce('0x42')](_[_0x51ce('0x4c')](_0x22849b[_0x51ce('0x40')],_0x597967['filters']));if(_0x22849b[_0x51ce('0x40')][_0x51ce('0x4d')]){_0x3d6842[_0x51ce('0x4b')]=_[_0x51ce('0x4e')](_0x3d6842['where'],{'$or':_[_0x51ce('0x4f')](_0x3d6842[_0x51ce('0x44')],function(_0x8831e1){var _0x12d62a={};_0x12d62a[_0x8831e1]={'$like':'%'+_0x22849b[_0x51ce('0x40')][_0x51ce('0x4d')]+'%'};return _0x12d62a;})});}_0x3d6842=_[_0x51ce('0x4e')]({},_0x3d6842,_0x22849b[_0x51ce('0x51')]);return _0x54d965['getAgents'](_0x3d6842);}})[_0x51ce('0x1d')](function(_0x456e54){if(_0x456e54){_0xf6d566=_0x456e54[_0x51ce('0x46')];if(!_0x22849b[_0x51ce('0x40')][_0x51ce('0x47')](_0x51ce('0x48'))){_0x3d6842[_0x51ce('0x2f')]=qs[_0x51ce('0x2f')](_0x22849b[_0x51ce('0x40')][_0x51ce('0x2f')]);_0x3d6842[_0x51ce('0x2c')]=qs[_0x51ce('0x2c')](_0x22849b['query'][_0x51ce('0x2c')]);}return _0x54d965[_0x51ce('0x97')](_0x3d6842);}})[_0x51ce('0x1d')](function(_0x1f22fb){if(_0x1f22fb){return _0x1f22fb?{'count':_0xf6d566,'rows':_0x1f22fb}:null;}})[_0x51ce('0x1d')](respondWithResult(_0x4cab30,null))[_0x51ce('0x27')](handleError(_0x4cab30,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9d60a0e..91809f2 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 _0xafa5=['exports','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x10a7b2,_0x37587c){var _0x5cf00e=function(_0x69b0b9){while(--_0x69b0b9){_0x10a7b2['push'](_0x10a7b2['shift']());}};_0x5cf00e(++_0x37587c);}(_0xafa5,0x1af));var _0x5afa=function(_0x25d071,_0x488829){_0x25d071=_0x25d071-0x0;var _0x660c3f=_0xafa5[_0x25d071];return _0x660c3f;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5afa('0x0'))['db'][_0x5afa('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5afa('0x2')](0x0);var events={'afterCreate':_0x5afa('0x3'),'afterUpdate':_0x5afa('0x4'),'afterDestroy':_0x5afa('0x5')};function emitEvent(_0x14535b){return function(_0x21b649,_0xac7ca5,_0x1509e4){ChatQueueEvents[_0x5afa('0x6')](_0x14535b+':'+_0x21b649['id'],_0x21b649);ChatQueueEvents['emit'](_0x14535b,_0x21b649);_0x1509e4(null);};}for(var e in events){if(events[_0x5afa('0x7')](e)){var event=events[e];ChatQueue[_0x5afa('0x8')](e,emitEvent(event));}}module[_0x5afa('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xf96e=['hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xba581a,_0x25106a){var _0x263a4f=function(_0x434863){while(--_0x434863){_0xba581a['push'](_0xba581a['shift']());}};_0x263a4f(++_0x25106a);}(_0xf96e,0x196));var _0xef96=function(_0x29f0af,_0x231eda){_0x29f0af=_0x29f0af-0x0;var _0x3d6df2=_0xf96e[_0x29f0af];return _0x3d6df2;};'use strict';var EventEmitter=require(_0xef96('0x0'));var ChatQueue=require(_0xef96('0x1'))['db'][_0xef96('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xef96('0x3')](0x0);var events={'afterCreate':_0xef96('0x4'),'afterUpdate':_0xef96('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c02b8){return function(_0x5b4bba,_0x366a22,_0x3bec69){ChatQueueEvents[_0xef96('0x6')](_0x2c02b8+':'+_0x5b4bba['id'],_0x5b4bba);ChatQueueEvents['emit'](_0x2c02b8,_0x5b4bba);_0x3bec69(null);};}for(var e in events){if(events[_0xef96('0x7')](e)){var event=events[e];ChatQueue[_0xef96('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 ee09a7f..2383162 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 _0x547e=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0x150754,_0x17aa20){var _0x45f993=function(_0x279605){while(--_0x279605){_0x150754['push'](_0x150754['shift']());}};_0x45f993(++_0x17aa20);}(_0x547e,0x6f));var _0xe547=function(_0xafa7c7,_0x3b8fc0){_0xafa7c7=_0xafa7c7-0x0;var _0x4b33ec=_0x547e[_0xafa7c7];return _0x4b33ec;};'use strict';var _=require(_0xe547('0x0'));var util=require(_0xe547('0x1'));var logger=require(_0xe547('0x2'))('api');var moment=require(_0xe547('0x3'));var BPromise=require(_0xe547('0x4'));var rp=require(_0xe547('0x5'));var fs=require('fs');var path=require(_0xe547('0x6'));var rimraf=require(_0xe547('0x7'));var config=require('../../config/environment');var attributes=require(_0xe547('0x8'));module[_0xe547('0x9')]=function(_0x45decc,_0x539a92){return _0x45decc[_0xe547('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6baa=['./chatQueue.attributes','exports','define','chat_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f147b,_0x338154){var _0x1ffa15=function(_0x235078){while(--_0x235078){_0x1f147b['push'](_0x1f147b['shift']());}};_0x1ffa15(++_0x338154);}(_0x6baa,0x1c0));var _0xa6ba=function(_0x4ab0b4,_0x4e280e){_0x4ab0b4=_0x4ab0b4-0x0;var _0x1911cc=_0x6baa[_0x4ab0b4];return _0x1911cc;};'use strict';var _=require('lodash');var util=require(_0xa6ba('0x0'));var logger=require(_0xa6ba('0x1'))('api');var moment=require(_0xa6ba('0x2'));var BPromise=require(_0xa6ba('0x3'));var rp=require(_0xa6ba('0x4'));var fs=require('fs');var path=require(_0xa6ba('0x5'));var rimraf=require(_0xa6ba('0x6'));var config=require(_0xa6ba('0x7'));var attributes=require(_0xa6ba('0x8'));module[_0xa6ba('0x9')]=function(_0x1c9b43,_0x439cd8){return _0x1c9b43[_0xa6ba('0xa')]('ChatQueue',attributes,{'tableName':_0xa6ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index ded4cc1..b911435 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 _0x061a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','find','lodash','util'];(function(_0x4a0cdd,_0x4422df){var _0x10fc7d=function(_0x230ae9){while(--_0x230ae9){_0x4a0cdd['push'](_0x4a0cdd['shift']());}};_0x10fc7d(++_0x4422df);}(_0x061a,0x13e));var _0xa061=function(_0x55b368,_0xbf5cad){_0x55b368=_0x55b368-0x0;var _0x17c286=_0x061a[_0x55b368];return _0x17c286;};'use strict';var _=require(_0xa061('0x0'));var util=require(_0xa061('0x1'));var moment=require(_0xa061('0x2'));var BPromise=require(_0xa061('0x3'));var rs=require(_0xa061('0x4'));var fs=require('fs');var Redis=require(_0xa061('0x5'));var db=require(_0xa061('0x6'))['db'];var utils=require(_0xa061('0x7'));var logger=require('../../config/logger')(_0xa061('0x8'));var config=require(_0xa061('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa061('0xa')][_0xa061('0xb')]({'port':0x232a});config[_0xa061('0xc')]=_[_0xa061('0xd')](config[_0xa061('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa061('0xe'))(new Redis(config[_0xa061('0xc')]));require(_0xa061('0xf'))['register'](socket);function respondWithRpcPromise(_0x55759f,_0x387190,_0x59dc92){return new BPromise(function(_0x1dd546,_0x3c184b){return client[_0xa061('0x10')](_0x55759f,_0x59dc92)[_0xa061('0x11')](function(_0x304495){logger[_0xa061('0x12')](_0xa061('0x13'),_0x387190,_0xa061('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x387190,_0xa061('0x14'),JSON[_0xa061('0x15')](_0x304495));if(_0x304495[_0xa061('0x16')]){if(_0x304495['error'][_0xa061('0x17')]===0x1f4){logger[_0xa061('0x16')](_0xa061('0x13'),_0x387190,_0x304495[_0xa061('0x16')]['message']);return _0x3c184b(_0x304495[_0xa061('0x16')][_0xa061('0x18')]);}logger[_0xa061('0x16')](_0xa061('0x13'),_0x387190,_0x304495[_0xa061('0x16')]['message']);return _0x1dd546(_0x304495[_0xa061('0x16')][_0xa061('0x18')]);}else{logger['info'](_0xa061('0x13'),_0x387190,'request\x20sent');_0x1dd546(_0x304495[_0xa061('0x19')][_0xa061('0x18')]);}})[_0xa061('0x1a')](function(_0x529af8){logger['error']('ChatQueue,\x20%s,\x20%s',_0x387190,_0x529af8);_0x3c184b(_0x529af8);});});}exports[_0xa061('0x1b')]=function(_0x3162c2){var _0x4960f0=this;return new Promise(function(_0x355c56,_0x301713){return db['ChatQueue'][_0xa061('0x1c')]({'raw':_0x3162c2[_0xa061('0x1d')]?_0x3162c2[_0xa061('0x1d')][_0xa061('0x1e')]===undefined?!![]:![]:!![],'where':_0x3162c2['options']?_0x3162c2[_0xa061('0x1d')][_0xa061('0x1f')]||null:null,'attributes':_0x3162c2['options']?_0x3162c2[_0xa061('0x1d')][_0xa061('0x20')]||null:null,'limit':_0x3162c2['options']?_0x3162c2['options'][_0xa061('0x21')]||null:null,'include':_0x3162c2[_0xa061('0x1d')]?_0x3162c2[_0xa061('0x1d')][_0xa061('0x22')]?_[_0xa061('0x23')](_0x3162c2[_0xa061('0x1d')][_0xa061('0x22')],function(_0x1958c7){return{'model':db[_0x1958c7[_0xa061('0x24')]],'as':_0x1958c7['as'],'attributes':_0x1958c7[_0xa061('0x20')],'include':_0x1958c7[_0xa061('0x22')]?_[_0xa061('0x23')](_0x1958c7['include'],function(_0x4c5aae){return{'model':db[_0x4c5aae[_0xa061('0x24')]],'as':_0x4c5aae['as'],'attributes':_0x4c5aae[_0xa061('0x20')],'include':_0x4c5aae[_0xa061('0x22')]?_['map'](_0x4c5aae[_0xa061('0x22')],function(_0x35776e){return{'model':db[_0x35776e['model']],'as':_0x35776e['as'],'attributes':_0x35776e[_0xa061('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa061('0x11')](function(_0x4cc315){logger[_0xa061('0x12')]('GetChatQueue',_0x3162c2);logger['debug'](_0xa061('0x1b'),_0x3162c2,JSON[_0xa061('0x15')](_0x4cc315));_0x355c56(_0x4cc315);})[_0xa061('0x1a')](function(_0x4d8c4b){logger[_0xa061('0x16')](_0xa061('0x1b'),_0x4d8c4b[_0xa061('0x18')],_0x3162c2);_0x301713(_0x4960f0[_0xa061('0x16')](0x1f4,_0x4d8c4b[_0xa061('0x18')]));});});};exports[_0xa061('0x25')]=function(_0x3a33e3){var _0x183d99=this;return new Promise(function(_0x318485,_0x57543d){return db[_0xa061('0x26')][_0xa061('0x27')]({'raw':_0x3a33e3['options']?_0x3a33e3[_0xa061('0x1d')][_0xa061('0x1e')]===undefined?!![]:![]:!![],'where':_0x3a33e3[_0xa061('0x1d')]?_0x3a33e3[_0xa061('0x1d')][_0xa061('0x1f')]||null:null,'attributes':_0x3a33e3['options']?_0x3a33e3[_0xa061('0x1d')]['attributes']||null:null,'include':_0x3a33e3[_0xa061('0x1d')]?_0x3a33e3['options'][_0xa061('0x22')]?_['map'](_0x3a33e3[_0xa061('0x1d')][_0xa061('0x22')],function(_0x1a568e){return{'model':db[_0x1a568e[_0xa061('0x24')]],'as':_0x1a568e['as'],'attributes':_0x1a568e[_0xa061('0x20')],'include':_0x1a568e['include']?_[_0xa061('0x23')](_0x1a568e['include'],function(_0xbf98ef){return{'model':db[_0xbf98ef[_0xa061('0x24')]],'as':_0xbf98ef['as'],'attributes':_0xbf98ef[_0xa061('0x20')],'include':_0xbf98ef[_0xa061('0x22')]?_[_0xa061('0x23')](_0xbf98ef[_0xa061('0x22')],function(_0x4921e3){return{'model':db[_0x4921e3[_0xa061('0x24')]],'as':_0x4921e3['as'],'attributes':_0x4921e3[_0xa061('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa061('0x11')](function(_0x26e8f8){logger[_0xa061('0x12')](_0xa061('0x25'),_0x3a33e3);logger['debug'](_0xa061('0x25'),_0x3a33e3,JSON['stringify'](_0x26e8f8));_0x318485(_0x26e8f8);})[_0xa061('0x1a')](function(_0x57a195){logger[_0xa061('0x16')](_0xa061('0x25'),_0x57a195[_0xa061('0x18')],_0x3a33e3);_0x57543d(_0x183d99[_0xa061('0x16')](0x1f4,_0x57a195[_0xa061('0x18')]));});});}; \ No newline at end of file +var _0x4342=['http','redis','defaults','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetChatQueue','ShowChatQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x494926,_0x5d3a6b){var _0x4be498=function(_0x5a6c11){while(--_0x5a6c11){_0x494926['push'](_0x494926['shift']());}};_0x4be498(++_0x5d3a6b);}(_0x4342,0xe5));var _0x2434=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x4342[_0x3403d5];return _0xf9df4f;};'use strict';var _=require(_0x2434('0x0'));var util=require(_0x2434('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2434('0x2'));var fs=require('fs');var Redis=require(_0x2434('0x3'));var db=require(_0x2434('0x4'))['db'];var utils=require(_0x2434('0x5'));var logger=require(_0x2434('0x6'))(_0x2434('0x7'));var config=require(_0x2434('0x8'));var jayson=require(_0x2434('0x9'));var client=jayson[_0x2434('0xa')][_0x2434('0xb')]({'port':0x232a});config[_0x2434('0xc')]=_[_0x2434('0xd')](config[_0x2434('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x2434('0xe'))(new Redis(config[_0x2434('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x25396f,_0x43f941,_0x3c7618){return new BPromise(function(_0x581ff2,_0x5923f4){return client[_0x2434('0xf')](_0x25396f,_0x3c7618)[_0x2434('0x10')](function(_0xe59f13){logger[_0x2434('0x11')](_0x2434('0x12'),_0x43f941,_0x2434('0x13'));logger['debug'](_0x2434('0x14'),_0x43f941,'request\x20sent',JSON[_0x2434('0x15')](_0xe59f13));if(_0xe59f13['error']){if(_0xe59f13['error'][_0x2434('0x16')]===0x1f4){logger['error'](_0x2434('0x12'),_0x43f941,_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);return _0x5923f4(_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);}logger[_0x2434('0x17')](_0x2434('0x12'),_0x43f941,_0xe59f13[_0x2434('0x17')][_0x2434('0x18')]);return _0x581ff2(_0xe59f13[_0x2434('0x17')]['message']);}else{logger[_0x2434('0x11')](_0x2434('0x12'),_0x43f941,_0x2434('0x13'));_0x581ff2(_0xe59f13['result'][_0x2434('0x18')]);}})[_0x2434('0x19')](function(_0x17db53){logger[_0x2434('0x17')](_0x2434('0x12'),_0x43f941,_0x17db53);_0x5923f4(_0x17db53);});});}exports['GetChatQueue']=function(_0x27478a){var _0x558e0e=this;return new Promise(function(_0x3201d0,_0x5d1c73){return db[_0x2434('0x1a')][_0x2434('0x1b')]({'raw':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x1d')]===undefined?!![]:![]:!![],'where':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x1e')]||null:null,'attributes':_0x27478a['options']?_0x27478a[_0x2434('0x1c')][_0x2434('0x1f')]||null:null,'limit':_0x27478a[_0x2434('0x1c')]?_0x27478a['options'][_0x2434('0x20')]||null:null,'include':_0x27478a[_0x2434('0x1c')]?_0x27478a[_0x2434('0x1c')][_0x2434('0x21')]?_[_0x2434('0x22')](_0x27478a[_0x2434('0x1c')][_0x2434('0x21')],function(_0x460f2e){return{'model':db[_0x460f2e[_0x2434('0x23')]],'as':_0x460f2e['as'],'attributes':_0x460f2e[_0x2434('0x1f')],'include':_0x460f2e['include']?_['map'](_0x460f2e[_0x2434('0x21')],function(_0x1fd483){return{'model':db[_0x1fd483[_0x2434('0x23')]],'as':_0x1fd483['as'],'attributes':_0x1fd483[_0x2434('0x1f')],'include':_0x1fd483[_0x2434('0x21')]?_[_0x2434('0x22')](_0x1fd483[_0x2434('0x21')],function(_0x1e697f){return{'model':db[_0x1e697f[_0x2434('0x23')]],'as':_0x1e697f['as'],'attributes':_0x1e697f[_0x2434('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2434('0x10')](function(_0x3e0ec4){logger['info']('GetChatQueue',_0x27478a);logger[_0x2434('0x24')](_0x2434('0x25'),_0x27478a,JSON[_0x2434('0x15')](_0x3e0ec4));_0x3201d0(_0x3e0ec4);})['catch'](function(_0x371e14){logger[_0x2434('0x17')](_0x2434('0x25'),_0x371e14[_0x2434('0x18')],_0x27478a);_0x5d1c73(_0x558e0e[_0x2434('0x17')](0x1f4,_0x371e14[_0x2434('0x18')]));});});};exports[_0x2434('0x26')]=function(_0x2f2005){var _0x19827d=this;return new Promise(function(_0x493a1c,_0x4851e8){return db['ChatQueue'][_0x2434('0x27')]({'raw':_0x2f2005['options']?_0x2f2005['options'][_0x2434('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f2005[_0x2434('0x1c')]?_0x2f2005[_0x2434('0x1c')]['where']||null:null,'attributes':_0x2f2005[_0x2434('0x1c')]?_0x2f2005['options']['attributes']||null:null,'include':_0x2f2005[_0x2434('0x1c')]?_0x2f2005[_0x2434('0x1c')][_0x2434('0x21')]?_[_0x2434('0x22')](_0x2f2005[_0x2434('0x1c')]['include'],function(_0x42beea){return{'model':db[_0x42beea[_0x2434('0x23')]],'as':_0x42beea['as'],'attributes':_0x42beea[_0x2434('0x1f')],'include':_0x42beea[_0x2434('0x21')]?_[_0x2434('0x22')](_0x42beea['include'],function(_0x37b20b){return{'model':db[_0x37b20b[_0x2434('0x23')]],'as':_0x37b20b['as'],'attributes':_0x37b20b[_0x2434('0x1f')],'include':_0x37b20b[_0x2434('0x21')]?_[_0x2434('0x22')](_0x37b20b[_0x2434('0x21')],function(_0x153ac3){return{'model':db[_0x153ac3[_0x2434('0x23')]],'as':_0x153ac3['as'],'attributes':_0x153ac3[_0x2434('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2434('0x10')](function(_0x69214b){logger[_0x2434('0x11')](_0x2434('0x26'),_0x2f2005);logger[_0x2434('0x24')]('ShowChatQueue',_0x2f2005,JSON['stringify'](_0x69214b));_0x493a1c(_0x69214b);})[_0x2434('0x19')](function(_0x820547){logger['error']('ShowChatQueue',_0x820547[_0x2434('0x18')],_0x2f2005);_0x4851e8(_0x19827d[_0x2434('0x17')](0x1f4,_0x820547[_0x2434('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 7730e2f..0bca192 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 _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x43008d,_0xef7ad8){var _0x171310=function(_0x284990){while(--_0x284990){_0x43008d['push'](_0x43008d['shift']());}};_0x171310(++_0xef7ad8);}(_0x032e,0x124));var _0xe032=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x032e[_0x13ea00];return _0x1f7347;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file +var _0x032e=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','update','emit'];(function(_0x388829,_0xdd81e0){var _0x54962a=function(_0x4bf7ac){while(--_0x4bf7ac){_0x388829['push'](_0x388829['shift']());}};_0x54962a(++_0xdd81e0);}(_0x032e,0x124));var _0xe032=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x032e[_0x1ac595];return _0x455fff;};'use strict';var ChatQueueEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatQueueEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatQueueEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 5f700d2..248fe56 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x5fc3[_0x2c1114];return _0x2b877c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x5fc3,0xa8));var _0x35fc=function(_0x28edda,_0xbd447a){_0x28edda=_0x28edda-0x0;var _0x21f4a4=_0x5fc3[_0x28edda];return _0x21f4a4;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 3abc45c..1790780 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 _0xa7eb=['exports','STRING','DATE','moment','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xa7eb,0x1b6));var _0xba7e=function(_0x22d397,_0x4a1911){_0x22d397=_0x22d397-0x0;var _0x162930=_0xa7eb[_0x22d397];return _0x162930;};'use strict';var moment=require(_0xba7e('0x0'));var Sequelize=require(_0xba7e('0x1'));module[_0xba7e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xba7e('0x3')]},'joinAt':{'type':Sequelize[_0xba7e('0x4')]},'leaveAt':{'type':Sequelize[_0xba7e('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba7e('0x4')]},'reason':{'type':Sequelize[_0xba7e('0x3')]}}; \ No newline at end of file +var _0xdbcc=['moment','sequelize','exports','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdbcc,0xf8));var _0xcdbc=function(_0x5176f6,_0x4343bb){_0x5176f6=_0x5176f6-0x0;var _0x2b1351=_0xdbcc[_0x5176f6];return _0x2b1351;};'use strict';var moment=require(_0xcdbc('0x0'));var Sequelize=require(_0xcdbc('0x1'));module[_0xcdbc('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcdbc('0x3')]},'leaveAt':{'type':Sequelize[_0xcdbc('0x3')]},'acceptAt':{'type':Sequelize[_0xcdbc('0x3')]},'exitAt':{'type':Sequelize[_0xcdbc('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index afcc398..ca55a6d 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 _0xc599=['catch','show','params','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','where','merge','filter','options','includeAll','ChatQueueReport','findAll','rows'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc599,0x1b2));var _0x9c59=function(_0x57cc7a,_0x1e738d){_0x57cc7a=_0x57cc7a-0x0;var _0x5d6159=_0xc599[_0x57cc7a];return _0x5d6159;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9c59('0x1'));var rp=require(_0x9c59('0x2'));var moment=require(_0x9c59('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9c59('0x4'));var util=require(_0x9c59('0x5'));var path=require(_0x9c59('0x6'));var sox=require(_0x9c59('0x7'));var csv=require(_0x9c59('0x8'));var ejs=require(_0x9c59('0x9'));var fs=require('fs');var fs_extra=require(_0x9c59('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c59('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c59('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9c59('0xd'));var Papa=require(_0x9c59('0xe'));var Redis=require(_0x9c59('0xf'));var authService=require(_0x9c59('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c59('0x11'));var logger=require('../../config/logger')(_0x9c59('0x12'));var utils=require('../../config/utils');var config=require(_0x9c59('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c59('0x14'))['db'];function respondWithStatusCode(_0x2cc4f7,_0x40216c){_0x40216c=_0x40216c||0xcc;return function(_0x5d5320){if(_0x5d5320){return _0x2cc4f7['sendStatus'](_0x40216c);}return _0x2cc4f7['status'](_0x40216c)['end']();};}function respondWithResult(_0x5c43bb,_0x13bc3b){_0x13bc3b=_0x13bc3b||0xc8;return function(_0xdfa957){if(_0xdfa957){return _0x5c43bb[_0x9c59('0x15')](_0x13bc3b)[_0x9c59('0x16')](_0xdfa957);}};}function respondWithFilteredResult(_0x55c8ca,_0x1f376d){return function(_0x4019ae){if(_0x4019ae){var _0x1d07fd=typeof _0x1f376d['offset']==='undefined'&&typeof _0x1f376d['limit']===_0x9c59('0x17');var _0x36983f=_0x4019ae[_0x9c59('0x18')];var _0x19f372=_0x1d07fd?0x0:_0x1f376d[_0x9c59('0x19')];var _0x654819=_0x1d07fd?_0x4019ae[_0x9c59('0x18')]:_0x1f376d[_0x9c59('0x19')]+_0x1f376d['limit'];var _0x4eb316;if(_0x654819>=_0x36983f){_0x654819=_0x36983f;_0x4eb316=0xc8;}else{_0x4eb316=0xce;}_0x55c8ca['status'](_0x4eb316);return _0x55c8ca[_0x9c59('0x1a')](_0x9c59('0x1b'),_0x19f372+'-'+_0x654819+'/'+_0x36983f)[_0x9c59('0x16')](_0x4019ae);}return null;};}function patchUpdates(_0x1925a1){return function(_0x566168){try{jsonpatch[_0x9c59('0x1c')](_0x566168,_0x1925a1,!![]);}catch(_0x523dff){return BPromise[_0x9c59('0x1d')](_0x523dff);}return _0x566168[_0x9c59('0x1e')]();};}function saveUpdates(_0x4dcc88,_0x1854b6){return function(_0x3611ca){if(_0x3611ca){return _0x3611ca[_0x9c59('0x1f')](_0x4dcc88)[_0x9c59('0x20')](function(_0x1e5853){return _0x1e5853;});}return null;};}function removeEntity(_0x58dadf,_0x7ffcdd){return function(_0x2eb93e){if(_0x2eb93e){return _0x2eb93e[_0x9c59('0x21')]()['then'](function(){_0x58dadf[_0x9c59('0x15')](0xcc)[_0x9c59('0x22')]();});}};}function handleEntityNotFound(_0x335e36,_0x20ad5c){return function(_0x4f5542){if(!_0x4f5542){_0x335e36[_0x9c59('0x23')](0x194);}return _0x4f5542;};}function handleError(_0x1960f0,_0x41f81c){_0x41f81c=_0x41f81c||0x1f4;return function(_0x597ffc){logger[_0x9c59('0x24')](_0x597ffc[_0x9c59('0x25')]);if(_0x597ffc[_0x9c59('0x26')]){delete _0x597ffc[_0x9c59('0x26')];}_0x1960f0[_0x9c59('0x15')](_0x41f81c)['send'](_0x597ffc);};}exports[_0x9c59('0x27')]=function(_0x9e8833,_0x4f497d){var _0x5d3856={},_0x28fecc={},_0x34fb33={'count':0x0,'rows':[]};var _0x1fd41f=_[_0x9c59('0x28')](db['ChatQueueReport'][_0x9c59('0x29')],function(_0x25c0ab){return{'name':_0x25c0ab[_0x9c59('0x2a')],'type':_0x25c0ab[_0x9c59('0x2b')]['key']};});_0x28fecc[_0x9c59('0x2c')]=_[_0x9c59('0x28')](_0x1fd41f,_0x9c59('0x26'));_0x28fecc[_0x9c59('0x2d')]=_[_0x9c59('0x2e')](_0x9e8833[_0x9c59('0x2d')]);_0x28fecc[_0x9c59('0x2f')]=_[_0x9c59('0x30')](_0x28fecc[_0x9c59('0x2c')],_0x28fecc[_0x9c59('0x2d')]);_0x5d3856[_0x9c59('0x31')]=_[_0x9c59('0x30')](_0x28fecc[_0x9c59('0x2c')],qs['fields'](_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x32')]));_0x5d3856['attributes']=_0x5d3856['attributes'][_0x9c59('0x33')]?_0x5d3856[_0x9c59('0x31')]:_0x28fecc[_0x9c59('0x2c')];if(!_0x9e8833[_0x9c59('0x2d')]['hasOwnProperty'](_0x9c59('0x34'))){_0x5d3856[_0x9c59('0x35')]=qs['limit'](_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x35')]);_0x5d3856['offset']=qs[_0x9c59('0x19')](_0x9e8833['query'][_0x9c59('0x19')]);}_0x5d3856[_0x9c59('0x36')]=qs['sort'](_0x9e8833[_0x9c59('0x2d')]['sort']);_0x5d3856['where']=qs[_0x9c59('0x2f')](_['pick'](_0x9e8833[_0x9c59('0x2d')],_0x28fecc['filters']),_0x1fd41f);if(_0x9e8833['query']['filter']){_0x5d3856[_0x9c59('0x37')]=_[_0x9c59('0x38')](_0x5d3856[_0x9c59('0x37')],{'$or':_[_0x9c59('0x28')](_0x1fd41f,function(_0x282ce8){if(_0x282ce8[_0x9c59('0x2b')]!=='VIRTUAL'){var _0xeb9134={};_0xeb9134[_0x282ce8['name']]={'$like':'%'+_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x39')]+'%'};return _0xeb9134;}})});}_0x5d3856=_[_0x9c59('0x38')]({},_0x5d3856,_0x9e8833[_0x9c59('0x3a')]);var _0x2bab4f={'where':_0x5d3856[_0x9c59('0x37')]};return db['ChatQueueReport'][_0x9c59('0x18')](_0x2bab4f)[_0x9c59('0x20')](function(_0x224fa4){_0x34fb33[_0x9c59('0x18')]=_0x224fa4;if(_0x9e8833[_0x9c59('0x2d')][_0x9c59('0x3b')]){_0x5d3856['include']=[{'all':!![]}];}return db[_0x9c59('0x3c')][_0x9c59('0x3d')](_0x5d3856);})[_0x9c59('0x20')](function(_0x5b8ea2){_0x34fb33[_0x9c59('0x3e')]=_0x5b8ea2;return _0x34fb33;})[_0x9c59('0x20')](respondWithFilteredResult(_0x4f497d,_0x5d3856))[_0x9c59('0x3f')](handleError(_0x4f497d,null));};exports[_0x9c59('0x40')]=function(_0x58dded,_0x3aafc9){var _0x28ab6a={'raw':!![],'where':{'id':_0x58dded[_0x9c59('0x41')]['id']}},_0x767e10={};_0x767e10[_0x9c59('0x2c')]=_[_0x9c59('0x2e')](db['ChatQueueReport']['rawAttributes']);_0x767e10['query']=_['keys'](_0x58dded[_0x9c59('0x2d')]);_0x767e10[_0x9c59('0x2f')]=_[_0x9c59('0x30')](_0x767e10[_0x9c59('0x2c')],_0x767e10[_0x9c59('0x2d')]);_0x28ab6a['attributes']=_['intersection'](_0x767e10[_0x9c59('0x2c')],qs[_0x9c59('0x32')](_0x58dded[_0x9c59('0x2d')][_0x9c59('0x32')]));_0x28ab6a[_0x9c59('0x31')]=_0x28ab6a[_0x9c59('0x31')][_0x9c59('0x33')]?_0x28ab6a[_0x9c59('0x31')]:_0x767e10[_0x9c59('0x2c')];if(_0x58dded[_0x9c59('0x2d')][_0x9c59('0x3b')]){_0x28ab6a[_0x9c59('0x42')]=[{'all':!![]}];}_0x28ab6a=_['merge']({},_0x28ab6a,_0x58dded[_0x9c59('0x3a')]);return db[_0x9c59('0x3c')]['find'](_0x28ab6a)[_0x9c59('0x20')](handleEntityNotFound(_0x3aafc9,null))[_0x9c59('0x20')](respondWithResult(_0x3aafc9,null))[_0x9c59('0x3f')](handleError(_0x3aafc9,null));};exports[_0x9c59('0x43')]=function(_0x170304,_0x145363){return db[_0x9c59('0x3c')][_0x9c59('0x43')](_0x170304['body'],{})[_0x9c59('0x20')](respondWithResult(_0x145363,0xc9))['catch'](handleError(_0x145363,null));};exports[_0x9c59('0x1f')]=function(_0x1668b0,_0x33556c){if(_0x1668b0[_0x9c59('0x44')]['id']){delete _0x1668b0[_0x9c59('0x44')]['id'];}return db[_0x9c59('0x3c')][_0x9c59('0x45')]({'where':{'id':_0x1668b0[_0x9c59('0x41')]['id']}})['then'](handleEntityNotFound(_0x33556c,null))[_0x9c59('0x20')](saveUpdates(_0x1668b0[_0x9c59('0x44')],null))[_0x9c59('0x20')](respondWithResult(_0x33556c,null))[_0x9c59('0x3f')](handleError(_0x33556c,null));};exports[_0x9c59('0x21')]=function(_0xb3bd70,_0x30649a){return db[_0x9c59('0x3c')][_0x9c59('0x45')]({'where':{'id':_0xb3bd70['params']['id']}})[_0x9c59('0x20')](handleEntityNotFound(_0x30649a,null))[_0x9c59('0x20')](removeEntity(_0x30649a,null))[_0x9c59('0x3f')](handleError(_0x30649a,null));};exports[_0x9c59('0x46')]=function(_0x5b5bb9,_0xff3ef2){return db[_0x9c59('0x3c')]['describe']()[_0x9c59('0x20')](respondWithResult(_0xff3ef2,null))['catch'](handleError(_0xff3ef2,null));}; \ No newline at end of file +var _0x9b0d=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','findAll','rows','show','params','include','catch','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x54a214,_0x287d40){var _0x1cd25f=function(_0x565ece){while(--_0x565ece){_0x54a214['push'](_0x54a214['shift']());}};_0x1cd25f(++_0x287d40);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x41e28c,_0x3c0b){_0x41e28c=_0x41e28c-0x0;var _0x1a7ac4=_0x9b0d[_0x41e28c];return _0x1a7ac4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9b0('0x0'));var zipdir=require(_0xd9b0('0x1'));var jsonpatch=require(_0xd9b0('0x2'));var rp=require(_0xd9b0('0x3'));var moment=require('moment');var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require(_0xd9b0('0x6'));var path=require(_0xd9b0('0x7'));var sox=require('sox');var csv=require(_0xd9b0('0x8'));var ejs=require(_0xd9b0('0x9'));var fs=require('fs');var fs_extra=require(_0xd9b0('0xa'));var _=require(_0xd9b0('0xb'));var squel=require(_0xd9b0('0xc'));var crypto=require(_0xd9b0('0xd'));var jsforce=require(_0xd9b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x8'));var querystring=require(_0xd9b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd9b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b0('0x12'));var logger=require(_0xd9b0('0x13'))(_0xd9b0('0x14'));var utils=require(_0xd9b0('0x15'));var config=require(_0xd9b0('0x16'));var licenseUtil=require(_0xd9b0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e9e0,_0x76bb6e){_0x76bb6e=_0x76bb6e||0xcc;return function(_0x4e0210){if(_0x4e0210){return _0x29e9e0[_0xd9b0('0x18')](_0x76bb6e);}return _0x29e9e0[_0xd9b0('0x19')](_0x76bb6e)[_0xd9b0('0x1a')]();};}function respondWithResult(_0x46321d,_0x2a15b1){_0x2a15b1=_0x2a15b1||0xc8;return function(_0x13a800){if(_0x13a800){return _0x46321d['status'](_0x2a15b1)[_0xd9b0('0x1b')](_0x13a800);}};}function respondWithFilteredResult(_0x579aa7,_0x2908a1){return function(_0x288dd4){if(_0x288dd4){var _0x141fea=typeof _0x2908a1[_0xd9b0('0x1c')]===_0xd9b0('0x1d')&&typeof _0x2908a1[_0xd9b0('0x1e')]===_0xd9b0('0x1d');var _0x584d2d=_0x288dd4[_0xd9b0('0x1f')];var _0x3ffdc8=_0x141fea?0x0:_0x2908a1[_0xd9b0('0x1c')];var _0x1b9b8f=_0x141fea?_0x288dd4[_0xd9b0('0x1f')]:_0x2908a1[_0xd9b0('0x1c')]+_0x2908a1[_0xd9b0('0x1e')];var _0x485cdf;if(_0x1b9b8f>=_0x584d2d){_0x1b9b8f=_0x584d2d;_0x485cdf=0xc8;}else{_0x485cdf=0xce;}_0x579aa7[_0xd9b0('0x19')](_0x485cdf);return _0x579aa7['set'](_0xd9b0('0x20'),_0x3ffdc8+'-'+_0x1b9b8f+'/'+_0x584d2d)['json'](_0x288dd4);}return null;};}function patchUpdates(_0x225823){return function(_0x77c318){try{jsonpatch[_0xd9b0('0x21')](_0x77c318,_0x225823,!![]);}catch(_0x3df41b){return BPromise[_0xd9b0('0x22')](_0x3df41b);}return _0x77c318[_0xd9b0('0x23')]();};}function saveUpdates(_0x549cfe,_0x5ecfe7){return function(_0x132710){if(_0x132710){return _0x132710['update'](_0x549cfe)[_0xd9b0('0x24')](function(_0x283da7){return _0x283da7;});}return null;};}function removeEntity(_0x11c443,_0x5a1f95){return function(_0x222229){if(_0x222229){return _0x222229['destroy']()['then'](function(){_0x11c443[_0xd9b0('0x19')](0xcc)[_0xd9b0('0x1a')]();});}};}function handleEntityNotFound(_0x5569c3,_0x3d90f0){return function(_0x4b9935){if(!_0x4b9935){_0x5569c3[_0xd9b0('0x18')](0x194);}return _0x4b9935;};}function handleError(_0xf06e12,_0x1c7ece){_0x1c7ece=_0x1c7ece||0x1f4;return function(_0xe07b77){logger[_0xd9b0('0x25')](_0xe07b77[_0xd9b0('0x26')]);if(_0xe07b77[_0xd9b0('0x27')]){delete _0xe07b77[_0xd9b0('0x27')];}_0xf06e12[_0xd9b0('0x19')](_0x1c7ece)[_0xd9b0('0x28')](_0xe07b77);};}exports[_0xd9b0('0x29')]=function(_0x233aae,_0x160c43){var _0x8be573={},_0x16cd85={},_0x23b2d8={'count':0x0,'rows':[]};var _0x4f5cdc=_[_0xd9b0('0x2a')](db['ChatQueueReport'][_0xd9b0('0x2b')],function(_0x1f8bc8){return{'name':_0x1f8bc8['fieldName'],'type':_0x1f8bc8[_0xd9b0('0x2c')][_0xd9b0('0x2d')]};});_0x16cd85['model']=_[_0xd9b0('0x2a')](_0x4f5cdc,_0xd9b0('0x27'));_0x16cd85[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x233aae[_0xd9b0('0x2e')]);_0x16cd85[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],_0x16cd85['query']);_0x8be573[_0xd9b0('0x33')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x233aae['query']['fields']));_0x8be573[_0xd9b0('0x33')]=_0x8be573['attributes'][_0xd9b0('0x35')]?_0x8be573[_0xd9b0('0x33')]:_0x16cd85['model'];if(!_0x233aae['query'][_0xd9b0('0x36')](_0xd9b0('0x37'))){_0x8be573[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x1e')]);_0x8be573[_0xd9b0('0x1c')]=qs[_0xd9b0('0x1c')](_0x233aae['query'][_0xd9b0('0x1c')]);}_0x8be573[_0xd9b0('0x38')]=qs[_0xd9b0('0x39')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x39')]);_0x8be573[_0xd9b0('0x3a')]=qs[_0xd9b0('0x30')](_[_0xd9b0('0x3b')](_0x233aae[_0xd9b0('0x2e')],_0x16cd85[_0xd9b0('0x30')]),_0x4f5cdc);if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x3c')]){_0x8be573[_0xd9b0('0x3a')]=_[_0xd9b0('0x3d')](_0x8be573[_0xd9b0('0x3a')],{'$or':_[_0xd9b0('0x2a')](_0x4f5cdc,function(_0x1d04de){if(_0x1d04de[_0xd9b0('0x2c')]!==_0xd9b0('0x3e')){var _0x18dc45={};_0x18dc45[_0x1d04de['name']]={'$like':'%'+_0x233aae['query'][_0xd9b0('0x3c')]+'%'};return _0x18dc45;}})});}_0x8be573=_['merge']({},_0x8be573,_0x233aae[_0xd9b0('0x3f')]);var _0x353fd7={'where':_0x8be573[_0xd9b0('0x3a')]};return db[_0xd9b0('0x40')][_0xd9b0('0x1f')](_0x353fd7)[_0xd9b0('0x24')](function(_0x359b3e){_0x23b2d8[_0xd9b0('0x1f')]=_0x359b3e;if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x8be573['include']=[{'all':!![]}];}return db[_0xd9b0('0x40')][_0xd9b0('0x42')](_0x8be573);})['then'](function(_0x1f5333){_0x23b2d8[_0xd9b0('0x43')]=_0x1f5333;return _0x23b2d8;})[_0xd9b0('0x24')](respondWithFilteredResult(_0x160c43,_0x8be573))['catch'](handleError(_0x160c43,null));};exports[_0xd9b0('0x44')]=function(_0x225800,_0x418113){var _0x3a09aa={'raw':!![],'where':{'id':_0x225800[_0xd9b0('0x45')]['id']}},_0x285ca9={};_0x285ca9[_0xd9b0('0x32')]=_[_0xd9b0('0x2f')](db[_0xd9b0('0x40')][_0xd9b0('0x2b')]);_0x285ca9[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x225800[_0xd9b0('0x2e')]);_0x285ca9[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x285ca9[_0xd9b0('0x32')],_0x285ca9[_0xd9b0('0x2e')]);_0x3a09aa[_0xd9b0('0x33')]=_['intersection'](_0x285ca9[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x225800['query'][_0xd9b0('0x34')]));_0x3a09aa[_0xd9b0('0x33')]=_0x3a09aa[_0xd9b0('0x33')]['length']?_0x3a09aa['attributes']:_0x285ca9[_0xd9b0('0x32')];if(_0x225800[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x3a09aa[_0xd9b0('0x46')]=[{'all':!![]}];}_0x3a09aa=_[_0xd9b0('0x3d')]({},_0x3a09aa,_0x225800[_0xd9b0('0x3f')]);return db[_0xd9b0('0x40')]['find'](_0x3a09aa)[_0xd9b0('0x24')](handleEntityNotFound(_0x418113,null))['then'](respondWithResult(_0x418113,null))[_0xd9b0('0x47')](handleError(_0x418113,null));};exports[_0xd9b0('0x48')]=function(_0xd11f53,_0x32857f){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0xd11f53[_0xd9b0('0x49')],{})[_0xd9b0('0x24')](respondWithResult(_0x32857f,0xc9))['catch'](handleError(_0x32857f,null));};exports[_0xd9b0('0x4a')]=function(_0x982ccd,_0x2618a0){if(_0x982ccd[_0xd9b0('0x49')]['id']){delete _0x982ccd[_0xd9b0('0x49')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x4b')]({'where':{'id':_0x982ccd[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x2618a0,null))[_0xd9b0('0x24')](saveUpdates(_0x982ccd[_0xd9b0('0x49')],null))[_0xd9b0('0x24')](respondWithResult(_0x2618a0,null))[_0xd9b0('0x47')](handleError(_0x2618a0,null));};exports[_0xd9b0('0x4c')]=function(_0x39ca70,_0x795b17){return db['ChatQueueReport'][_0xd9b0('0x4b')]({'where':{'id':_0x39ca70[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x795b17,null))[_0xd9b0('0x24')](removeEntity(_0x795b17,null))[_0xd9b0('0x47')](handleError(_0x795b17,null));};exports[_0xd9b0('0x4d')]=function(_0x547321,_0x33c9a6){return db[_0xd9b0('0x40')]['describe']()['then'](respondWithResult(_0x33c9a6,null))[_0xd9b0('0x47')](handleError(_0x33c9a6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 1f6914b..c6909e1 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x5e16aa,_0x101c52){var _0x399629=function(_0x997fa2){while(--_0x997fa2){_0x5e16aa['push'](_0x5e16aa['shift']());}};_0x399629(++_0x101c52);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb7e7[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x81214,_0x5734ac){var _0x57c5cd=function(_0xf55199){while(--_0xf55199){_0x81214['push'](_0x81214['shift']());}};_0x57c5cd(++_0x5734ac);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'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/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 504f749..7e3ad60 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 _0xd90c=['options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','ChatQueueReport','body'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd90c,0x194));var _0xcd90=function(_0x3d8dd8,_0x4dee79){_0x3d8dd8=_0x3d8dd8-0x0;var _0x1955ad=_0xd90c[_0x3d8dd8];return _0x1955ad;};'use strict';var _=require('lodash');var util=require(_0xcd90('0x0'));var moment=require(_0xcd90('0x1'));var BPromise=require('bluebird');var rs=require(_0xcd90('0x2'));var fs=require('fs');var Redis=require(_0xcd90('0x3'));var db=require(_0xcd90('0x4'))['db'];var utils=require(_0xcd90('0x5'));var logger=require(_0xcd90('0x6'))('rpc');var config=require(_0xcd90('0x7'));var jayson=require(_0xcd90('0x8'));var client=jayson['client'][_0xcd90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a70f3,_0x167350,_0x435116){return new BPromise(function(_0x468f67,_0x9787b1){return client[_0xcd90('0xa')](_0x4a70f3,_0x435116)[_0xcd90('0xb')](function(_0xe9d87f){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x167350,'request\x20sent');logger[_0xcd90('0xc')](_0xcd90('0xd'),_0x167350,_0xcd90('0xe'),JSON[_0xcd90('0xf')](_0xe9d87f));if(_0xe9d87f[_0xcd90('0x10')]){if(_0xe9d87f[_0xcd90('0x10')][_0xcd90('0x11')]===0x1f4){logger[_0xcd90('0x10')](_0xcd90('0x12'),_0x167350,_0xe9d87f['error']['message']);return _0x9787b1(_0xe9d87f['error'][_0xcd90('0x13')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x167350,_0xe9d87f['error']['message']);return _0x468f67(_0xe9d87f['error'][_0xcd90('0x13')]);}else{logger[_0xcd90('0x14')](_0xcd90('0x12'),_0x167350,'request\x20sent');_0x468f67(_0xe9d87f[_0xcd90('0x15')]['message']);}})[_0xcd90('0x16')](function(_0x41eb25){logger[_0xcd90('0x10')](_0xcd90('0x12'),_0x167350,_0x41eb25);_0x9787b1(_0x41eb25);});});}exports['CreateChatQueueReport']=function(_0x2c3195){var _0x43d90a=this;return new Promise(function(_0x1212dc,_0x1f46a4){return db[_0xcd90('0x17')]['create'](_0x2c3195[_0xcd90('0x18')],{'raw':_0x2c3195['options']?_0x2c3195[_0xcd90('0x19')][_0xcd90('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4b7bdf){logger[_0xcd90('0x14')](_0xcd90('0x1b'),_0x2c3195);logger[_0xcd90('0xc')]('CreateChatQueueReport',_0x2c3195,JSON[_0xcd90('0xf')](_0x4b7bdf));_0x1212dc(_0x4b7bdf);})[_0xcd90('0x16')](function(_0x383a50){logger[_0xcd90('0x10')](_0xcd90('0x1b'),_0x383a50[_0xcd90('0x13')],_0x2c3195);_0x1f46a4(_0x43d90a[_0xcd90('0x10')](0x1f4,_0x383a50['message']));});});};exports[_0xcd90('0x1c')]=function(_0x2a438b){var _0x5ed642=this;return new Promise(function(_0x5dae8e,_0xef8da){return db['ChatQueueReport'][_0xcd90('0x1d')](_0x2a438b[_0xcd90('0x18')],{'raw':_0x2a438b[_0xcd90('0x19')]?_0x2a438b[_0xcd90('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a438b['options']?_0x2a438b[_0xcd90('0x19')][_0xcd90('0x1e')]||null:null,'attributes':_0x2a438b[_0xcd90('0x19')]?_0x2a438b[_0xcd90('0x19')][_0xcd90('0x1f')]||null:null,'limit':_0x2a438b[_0xcd90('0x19')]?_0x2a438b['options'][_0xcd90('0x20')]||null:null})['then'](function(_0x9133bf){logger[_0xcd90('0x14')](_0xcd90('0x1c'),_0x2a438b);logger[_0xcd90('0xc')](_0xcd90('0x1c'),_0x2a438b,JSON['stringify'](_0x9133bf));_0x5dae8e(_0x9133bf);})[_0xcd90('0x16')](function(_0x325022){logger[_0xcd90('0x10')](_0xcd90('0x1c'),_0x325022[_0xcd90('0x13')],_0x2a438b);_0xef8da(_0x5ed642[_0xcd90('0x10')](0x1f4,_0x325022[_0xcd90('0x13')]));});});}; \ No newline at end of file +var _0x9c7c=['body','options','raw','debug','UpdateChatQueueReport','update','limit','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x1f745c,_0x5be6ea){var _0x5bc387=function(_0x5be6b2){while(--_0x5be6b2){_0x1f745c['push'](_0x1f745c['shift']());}};_0x5bc387(++_0x5be6ea);}(_0x9c7c,0x84));var _0xc9c7=function(_0x3ccf78,_0x132099){_0x3ccf78=_0x3ccf78-0x0;var _0x634386=_0x9c7c[_0x3ccf78];return _0x634386;};'use strict';var _=require(_0xc9c7('0x0'));var util=require(_0xc9c7('0x1'));var moment=require(_0xc9c7('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9c7('0x4'))['db'];var utils=require(_0xc9c7('0x5'));var logger=require(_0xc9c7('0x6'))(_0xc9c7('0x7'));var config=require('../../config/environment');var jayson=require(_0xc9c7('0x8'));var client=jayson['client'][_0xc9c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7395,_0x2b251f,_0x569b6f){return new BPromise(function(_0x50b8db,_0x4e649f){return client['request'](_0x2e7395,_0x569b6f)[_0xc9c7('0xa')](function(_0x43495d){logger[_0xc9c7('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,_0xc9c7('0xc'));logger['debug'](_0xc9c7('0xd'),_0x2b251f,_0xc9c7('0xc'),JSON[_0xc9c7('0xe')](_0x43495d));if(_0x43495d[_0xc9c7('0xf')]){if(_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x10')]===0x1f4){logger[_0xc9c7('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);return _0x4e649f(_0x43495d['error'][_0xc9c7('0x11')]);}logger['error'](_0xc9c7('0x12'),_0x2b251f,_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);return _0x50b8db(_0x43495d[_0xc9c7('0xf')][_0xc9c7('0x11')]);}else{logger[_0xc9c7('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x2b251f,'request\x20sent');_0x50b8db(_0x43495d[_0xc9c7('0x13')][_0xc9c7('0x11')]);}})['catch'](function(_0x25e569){logger[_0xc9c7('0xf')](_0xc9c7('0x12'),_0x2b251f,_0x25e569);_0x4e649f(_0x25e569);});});}exports[_0xc9c7('0x14')]=function(_0x3e1966){var _0x1b24fd=this;return new Promise(function(_0x526965,_0x37c080){return db[_0xc9c7('0x15')][_0xc9c7('0x16')](_0x3e1966[_0xc9c7('0x17')],{'raw':_0x3e1966[_0xc9c7('0x18')]?_0x3e1966[_0xc9c7('0x18')][_0xc9c7('0x19')]===undefined?!![]:![]:!![]})[_0xc9c7('0xa')](function(_0x92912e){logger[_0xc9c7('0xb')](_0xc9c7('0x14'),_0x3e1966);logger[_0xc9c7('0x1a')](_0xc9c7('0x14'),_0x3e1966,JSON[_0xc9c7('0xe')](_0x92912e));_0x526965(_0x92912e);})['catch'](function(_0x50d5a0){logger['error'](_0xc9c7('0x14'),_0x50d5a0[_0xc9c7('0x11')],_0x3e1966);_0x37c080(_0x1b24fd['error'](0x1f4,_0x50d5a0['message']));});});};exports[_0xc9c7('0x1b')]=function(_0x53659c){var _0x20933c=this;return new Promise(function(_0x479714,_0x1c01ef){return db[_0xc9c7('0x15')][_0xc9c7('0x1c')](_0x53659c[_0xc9c7('0x17')],{'raw':_0x53659c[_0xc9c7('0x18')]?_0x53659c[_0xc9c7('0x18')][_0xc9c7('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53659c[_0xc9c7('0x18')]?_0x53659c[_0xc9c7('0x18')]['where']||null:null,'attributes':_0x53659c[_0xc9c7('0x18')]?_0x53659c['options']['attributes']||null:null,'limit':_0x53659c[_0xc9c7('0x18')]?_0x53659c['options'][_0xc9c7('0x1d')]||null:null})[_0xc9c7('0xa')](function(_0x5a6335){logger[_0xc9c7('0xb')](_0xc9c7('0x1b'),_0x53659c);logger['debug'](_0xc9c7('0x1b'),_0x53659c,JSON[_0xc9c7('0xe')](_0x5a6335));_0x479714(_0x5a6335);})[_0xc9c7('0x1e')](function(_0x2a8354){logger[_0xc9c7('0xf')](_0xc9c7('0x1b'),_0x2a8354[_0xc9c7('0x11')],_0x53659c);_0x1c01ef(_0x20933c[_0xc9c7('0xf')](0x1f4,_0x2a8354[_0xc9c7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 02c934e..41de809 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 _0xe2a5=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x450f8f,_0x466054){var _0x1d37d7=function(_0x4394ae){while(--_0x4394ae){_0x450f8f['push'](_0x450f8f['shift']());}};_0x1d37d7(++_0x466054);}(_0xe2a5,0x1bd));var _0x5e2a=function(_0x2625d0,_0x3820ba){_0x2625d0=_0x2625d0-0x0;var _0x15ebea=_0xe2a5[_0x2625d0];return _0x15ebea;};'use strict';var multer=require(_0x5e2a('0x0'));var util=require(_0x5e2a('0x1'));var path=require(_0x5e2a('0x2'));var timeout=require(_0x5e2a('0x3'));var express=require(_0x5e2a('0x4'));var router=express[_0x5e2a('0x5')]();var fs_extra=require(_0x5e2a('0x6'));var auth=require(_0x5e2a('0x7'));var interaction=require(_0x5e2a('0x8'));var config=require(_0x5e2a('0x9'));var controller=require('./chatQueueReport.controller');router[_0x5e2a('0xa')]('/',auth[_0x5e2a('0xb')](),controller['index']);router[_0x5e2a('0xa')](_0x5e2a('0xc'),auth[_0x5e2a('0xb')](),controller['describe']);router[_0x5e2a('0xa')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0xe')]);router[_0x5e2a('0xf')]('/',auth['isAuthenticated'](),controller[_0x5e2a('0x10')]);router[_0x5e2a('0x11')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0x12')]);router[_0x5e2a('0x13')](_0x5e2a('0xd'),auth[_0x5e2a('0xb')](),controller[_0x5e2a('0x14')]);module[_0x5e2a('0x15')]=router; \ No newline at end of file +var _0x344e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2e1cf1,_0x2a4a0a){var _0x2e6c67=function(_0x3df3dc){while(--_0x3df3dc){_0x2e1cf1['push'](_0x2e1cf1['shift']());}};_0x2e6c67(++_0x2a4a0a);}(_0x344e,0x13c));var _0xe344=function(_0x7ab55c,_0x236bde){_0x7ab55c=_0x7ab55c-0x0;var _0xa58648=_0x344e[_0x7ab55c];return _0xa58648;};'use strict';var multer=require(_0xe344('0x0'));var util=require(_0xe344('0x1'));var path=require(_0xe344('0x2'));var timeout=require(_0xe344('0x3'));var express=require('express');var router=express[_0xe344('0x4')]();var fs_extra=require(_0xe344('0x5'));var auth=require(_0xe344('0x6'));var interaction=require(_0xe344('0x7'));var config=require(_0xe344('0x8'));var controller=require(_0xe344('0x9'));router['get']('/',auth[_0xe344('0xa')](),controller[_0xe344('0xb')]);router[_0xe344('0xc')](_0xe344('0xd'),auth[_0xe344('0xa')](),controller['describe']);router[_0xe344('0xc')](_0xe344('0xe'),auth[_0xe344('0xa')](),controller[_0xe344('0xf')]);router['post']('/',auth[_0xe344('0xa')](),controller[_0xe344('0x10')]);router[_0xe344('0x11')](_0xe344('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe344('0xe'),auth[_0xe344('0xa')](),controller[_0xe344('0x12')]);module[_0xe344('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2b26234..ec3d3a9 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26e901,_0x369d87){var _0x5b2032=function(_0x2036b0){while(--_0x2036b0){_0x26e901['push'](_0x26e901['shift']());}};_0x5b2032(++_0x369d87);}(_0xedd9,0xfc));var _0x9edd=function(_0x218454,_0x403302){_0x218454=_0x218454-0x0;var _0x177534=_0xedd9[_0x218454];return _0x177534;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x447256,_0x42bc97){var _0x43c91a=function(_0x48ffc5){while(--_0x48ffc5){_0x447256['push'](_0x447256['shift']());}};_0x43c91a(++_0x42bc97);}(_0xedd9,0xfc));var _0x9edd=function(_0x455502,_0x6451e9){_0x455502=_0x455502-0x0;var _0x4053eb=_0xedd9[_0x455502];return _0x4053eb;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 8860403..fe02b3a 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 _0xce38=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring'];(function(_0x4cc13,_0x40f7a6){var _0x801be7=function(_0x103cda){while(--_0x103cda){_0x4cc13['push'](_0x4cc13['shift']());}};_0x801be7(++_0x40f7a6);}(_0xce38,0x8d));var _0x8ce3=function(_0xf0e391,_0x5433d4){_0xf0e391=_0xf0e391-0x0;var _0x1c126d=_0xce38[_0xf0e391];return _0x1c126d;};'use strict';var emlformat=require(_0x8ce3('0x0'));var rimraf=require(_0x8ce3('0x1'));var zipdir=require(_0x8ce3('0x2'));var jsonpatch=require(_0x8ce3('0x3'));var rp=require(_0x8ce3('0x4'));var moment=require(_0x8ce3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8ce3('0x6'));var util=require(_0x8ce3('0x7'));var path=require(_0x8ce3('0x8'));var sox=require('sox');var csv=require(_0x8ce3('0x9'));var ejs=require(_0x8ce3('0xa'));var fs=require('fs');var fs_extra=require(_0x8ce3('0xb'));var _=require('lodash');var squel=require(_0x8ce3('0xc'));var crypto=require(_0x8ce3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ce3('0x9'));var querystring=require(_0x8ce3('0xe'));var Papa=require(_0x8ce3('0xf'));var Redis=require(_0x8ce3('0x10'));var authService=require(_0x8ce3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8ce3('0x12'));var hardwareService=require(_0x8ce3('0x13'));var logger=require(_0x8ce3('0x14'))('api');var utils=require(_0x8ce3('0x15'));var config=require(_0x8ce3('0x16'));var licenseUtil=require(_0x8ce3('0x17'));var db=require(_0x8ce3('0x18'))['db'];function respondWithStatusCode(_0x394cd6,_0x2764ea){_0x2764ea=_0x2764ea||0xcc;return function(_0x29ba26){if(_0x29ba26){return _0x394cd6[_0x8ce3('0x19')](_0x2764ea);}return _0x394cd6[_0x8ce3('0x1a')](_0x2764ea)[_0x8ce3('0x1b')]();};}function respondWithResult(_0x498e4a,_0x3d2edc){_0x3d2edc=_0x3d2edc||0xc8;return function(_0x32a6c8){if(_0x32a6c8){return _0x498e4a[_0x8ce3('0x1a')](_0x3d2edc)[_0x8ce3('0x1c')](_0x32a6c8);}};}function respondWithFilteredResult(_0x4b6ecc,_0xab3d3c){return function(_0x4d9132){if(_0x4d9132){var _0x1172f3=typeof _0xab3d3c[_0x8ce3('0x1d')]===_0x8ce3('0x1e')&&typeof _0xab3d3c[_0x8ce3('0x1f')]==='undefined';var _0xf5c786=_0x4d9132[_0x8ce3('0x20')];var _0x301095=_0x1172f3?0x0:_0xab3d3c[_0x8ce3('0x1d')];var _0x428291=_0x1172f3?_0x4d9132['count']:_0xab3d3c[_0x8ce3('0x1d')]+_0xab3d3c[_0x8ce3('0x1f')];var _0x45b365;if(_0x428291>=_0xf5c786){_0x428291=_0xf5c786;_0x45b365=0xc8;}else{_0x45b365=0xce;}_0x4b6ecc[_0x8ce3('0x1a')](_0x45b365);return _0x4b6ecc[_0x8ce3('0x21')](_0x8ce3('0x22'),_0x301095+'-'+_0x428291+'/'+_0xf5c786)[_0x8ce3('0x1c')](_0x4d9132);}return null;};}function patchUpdates(_0x5aac9d){return function(_0x1028ae){try{jsonpatch[_0x8ce3('0x23')](_0x1028ae,_0x5aac9d,!![]);}catch(_0x13ae5b){return BPromise[_0x8ce3('0x24')](_0x13ae5b);}return _0x1028ae[_0x8ce3('0x25')]();};}function saveUpdates(_0x2bac1a,_0xf0d6ff){return function(_0x45992d){if(_0x45992d){return _0x45992d[_0x8ce3('0x26')](_0x2bac1a)['then'](function(_0x115bff){return _0x115bff;});}return null;};}function removeEntity(_0x3c8092,_0x4b85ed){return function(_0x567084){if(_0x567084){return _0x567084[_0x8ce3('0x27')]()[_0x8ce3('0x28')](function(){_0x3c8092[_0x8ce3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8b0e83,_0x550655){return function(_0x1163cc){if(!_0x1163cc){_0x8b0e83['sendStatus'](0x194);}return _0x1163cc;};}function handleError(_0x36b2b4,_0x2a39db){_0x2a39db=_0x2a39db||0x1f4;return function(_0x176592){logger[_0x8ce3('0x29')](_0x176592[_0x8ce3('0x2a')]);if(_0x176592[_0x8ce3('0x2b')]){delete _0x176592[_0x8ce3('0x2b')];}_0x36b2b4[_0x8ce3('0x1a')](_0x2a39db)[_0x8ce3('0x2c')](_0x176592);};}exports[_0x8ce3('0x2d')]=function(_0x49e940,_0x4c0c5a){var _0x5b0d83={},_0x237b11={},_0x530ba9={'count':0x0,'rows':[]};var _0x16296d=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x41afb1){return{'name':_0x41afb1[_0x8ce3('0x2e')],'type':_0x41afb1[_0x8ce3('0x2f')]['key']};});_0x237b11[_0x8ce3('0x30')]=_['map'](_0x16296d,_0x8ce3('0x2b'));_0x237b11[_0x8ce3('0x31')]=_['keys'](_0x49e940[_0x8ce3('0x31')]);_0x237b11[_0x8ce3('0x32')]=_[_0x8ce3('0x33')](_0x237b11[_0x8ce3('0x30')],_0x237b11[_0x8ce3('0x31')]);_0x5b0d83[_0x8ce3('0x34')]=_[_0x8ce3('0x33')](_0x237b11[_0x8ce3('0x30')],qs[_0x8ce3('0x35')](_0x49e940[_0x8ce3('0x31')]['fields']));_0x5b0d83[_0x8ce3('0x34')]=_0x5b0d83['attributes'][_0x8ce3('0x36')]?_0x5b0d83[_0x8ce3('0x34')]:_0x237b11[_0x8ce3('0x30')];if(!_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x37')](_0x8ce3('0x38'))){_0x5b0d83[_0x8ce3('0x1f')]=qs[_0x8ce3('0x1f')](_0x49e940['query'][_0x8ce3('0x1f')]);_0x5b0d83[_0x8ce3('0x1d')]=qs[_0x8ce3('0x1d')](_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x1d')]);}_0x5b0d83[_0x8ce3('0x39')]=qs[_0x8ce3('0x3a')](_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x3a')]);_0x5b0d83['where']=qs['filters'](_[_0x8ce3('0x3b')](_0x49e940[_0x8ce3('0x31')],_0x237b11[_0x8ce3('0x32')]),_0x16296d);if(_0x49e940[_0x8ce3('0x31')][_0x8ce3('0x3c')]){_0x5b0d83[_0x8ce3('0x3d')]=_[_0x8ce3('0x3e')](_0x5b0d83['where'],{'$or':_[_0x8ce3('0x3f')](_0x16296d,function(_0x28e73d){if(_0x28e73d[_0x8ce3('0x2f')]!==_0x8ce3('0x40')){var _0x30fdd5={};_0x30fdd5[_0x28e73d[_0x8ce3('0x2b')]]={'$like':'%'+_0x49e940['query'][_0x8ce3('0x3c')]+'%'};return _0x30fdd5;}})});}_0x5b0d83=_['merge']({},_0x5b0d83,_0x49e940[_0x8ce3('0x41')]);var _0x515531={'where':_0x5b0d83[_0x8ce3('0x3d')]};return db[_0x8ce3('0x42')]['count'](_0x515531)[_0x8ce3('0x28')](function(_0x4b6886){_0x530ba9[_0x8ce3('0x20')]=_0x4b6886;if(_0x49e940['query'][_0x8ce3('0x43')]){_0x5b0d83[_0x8ce3('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x8ce3('0x45')](_0x5b0d83);})['then'](function(_0x52bede){_0x530ba9['rows']=_0x52bede;return _0x530ba9;})[_0x8ce3('0x28')](respondWithFilteredResult(_0x4c0c5a,_0x5b0d83))[_0x8ce3('0x46')](handleError(_0x4c0c5a,null));};exports['show']=function(_0x5b7921,_0x4874c0){var _0x21235c={'raw':!![],'where':{'id':_0x5b7921[_0x8ce3('0x47')]['id']}},_0x1ed559={};_0x1ed559[_0x8ce3('0x30')]=_[_0x8ce3('0x48')](db['ChatTransferReport'][_0x8ce3('0x49')]);_0x1ed559['query']=_[_0x8ce3('0x48')](_0x5b7921[_0x8ce3('0x31')]);_0x1ed559[_0x8ce3('0x32')]=_['intersection'](_0x1ed559[_0x8ce3('0x30')],_0x1ed559['query']);_0x21235c['attributes']=_[_0x8ce3('0x33')](_0x1ed559[_0x8ce3('0x30')],qs[_0x8ce3('0x35')](_0x5b7921[_0x8ce3('0x31')][_0x8ce3('0x35')]));_0x21235c[_0x8ce3('0x34')]=_0x21235c[_0x8ce3('0x34')][_0x8ce3('0x36')]?_0x21235c[_0x8ce3('0x34')]:_0x1ed559[_0x8ce3('0x30')];if(_0x5b7921[_0x8ce3('0x31')][_0x8ce3('0x43')]){_0x21235c[_0x8ce3('0x44')]=[{'all':!![]}];}_0x21235c=_[_0x8ce3('0x3e')]({},_0x21235c,_0x5b7921[_0x8ce3('0x41')]);return db[_0x8ce3('0x42')][_0x8ce3('0x4a')](_0x21235c)[_0x8ce3('0x28')](handleEntityNotFound(_0x4874c0,null))[_0x8ce3('0x28')](respondWithResult(_0x4874c0,null))[_0x8ce3('0x46')](handleError(_0x4874c0,null));};exports[_0x8ce3('0x4b')]=function(_0x596949,_0x2ee6b6){return db[_0x8ce3('0x42')][_0x8ce3('0x4b')](_0x596949[_0x8ce3('0x4c')],{})[_0x8ce3('0x28')](respondWithResult(_0x2ee6b6,0xc9))[_0x8ce3('0x46')](handleError(_0x2ee6b6,null));};exports['update']=function(_0x237ded,_0x535eeb){if(_0x237ded['body']['id']){delete _0x237ded[_0x8ce3('0x4c')]['id'];}return db[_0x8ce3('0x42')]['find']({'where':{'id':_0x237ded['params']['id']}})[_0x8ce3('0x28')](handleEntityNotFound(_0x535eeb,null))['then'](saveUpdates(_0x237ded[_0x8ce3('0x4c')],null))[_0x8ce3('0x28')](respondWithResult(_0x535eeb,null))[_0x8ce3('0x46')](handleError(_0x535eeb,null));};exports[_0x8ce3('0x27')]=function(_0x3d0754,_0x1fbd4f){return db[_0x8ce3('0x42')][_0x8ce3('0x4a')]({'where':{'id':_0x3d0754[_0x8ce3('0x47')]['id']}})[_0x8ce3('0x28')](handleEntityNotFound(_0x1fbd4f,null))['then'](removeEntity(_0x1fbd4f,null))['catch'](handleError(_0x1fbd4f,null));};exports[_0x8ce3('0x4d')]=function(_0x132ac9,_0x3d755a){return db[_0x8ce3('0x42')][_0x8ce3('0x4d')]()[_0x8ce3('0x28')](respondWithResult(_0x3d755a,null))['catch'](handleError(_0x3d755a,null));}; \ No newline at end of file +var _0x0860=['include','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatTransferReport','count','includeAll','findAll','show','params','keys'];(function(_0x444c9e,_0x1cd602){var _0x443cea=function(_0x1f7ade){while(--_0x1f7ade){_0x444c9e['push'](_0x444c9e['shift']());}};_0x443cea(++_0x1cd602);}(_0x0860,0x178));var _0x0086=function(_0x23d782,_0x210b7f){_0x23d782=_0x23d782-0x0;var _0x2a2cb6=_0x0860[_0x23d782];return _0x2a2cb6;};'use strict';var emlformat=require(_0x0086('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0086('0x1'));var jsonpatch=require(_0x0086('0x2'));var rp=require(_0x0086('0x3'));var moment=require(_0x0086('0x4'));var BPromise=require(_0x0086('0x5'));var Mustache=require(_0x0086('0x6'));var util=require(_0x0086('0x7'));var path=require(_0x0086('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0086('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0086('0xa'));var deskjs=require(_0x0086('0xb'));var toCsv=require(_0x0086('0xc'));var querystring=require(_0x0086('0xd'));var Papa=require(_0x0086('0xe'));var Redis=require(_0x0086('0xf'));var authService=require(_0x0086('0x10'));var qs=require(_0x0086('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0086('0x12'));var logger=require(_0x0086('0x13'))(_0x0086('0x14'));var utils=require('../../config/utils');var config=require(_0x0086('0x15'));var licenseUtil=require(_0x0086('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5966c7,_0x46094){_0x46094=_0x46094||0xcc;return function(_0x456a18){if(_0x456a18){return _0x5966c7[_0x0086('0x17')](_0x46094);}return _0x5966c7['status'](_0x46094)[_0x0086('0x18')]();};}function respondWithResult(_0x679e38,_0x351a33){_0x351a33=_0x351a33||0xc8;return function(_0x5a5e3b){if(_0x5a5e3b){return _0x679e38['status'](_0x351a33)[_0x0086('0x19')](_0x5a5e3b);}};}function respondWithFilteredResult(_0x91a167,_0x5c5cb7){return function(_0xc9672a){if(_0xc9672a){var _0x3363c2=typeof _0x5c5cb7[_0x0086('0x1a')]==='undefined'&&typeof _0x5c5cb7['limit']===_0x0086('0x1b');var _0x5d6f22=_0xc9672a['count'];var _0x5828b8=_0x3363c2?0x0:_0x5c5cb7[_0x0086('0x1a')];var _0x4028cd=_0x3363c2?_0xc9672a['count']:_0x5c5cb7[_0x0086('0x1a')]+_0x5c5cb7[_0x0086('0x1c')];var _0x293553;if(_0x4028cd>=_0x5d6f22){_0x4028cd=_0x5d6f22;_0x293553=0xc8;}else{_0x293553=0xce;}_0x91a167[_0x0086('0x1d')](_0x293553);return _0x91a167[_0x0086('0x1e')](_0x0086('0x1f'),_0x5828b8+'-'+_0x4028cd+'/'+_0x5d6f22)['json'](_0xc9672a);}return null;};}function patchUpdates(_0x3c2705){return function(_0x349b62){try{jsonpatch[_0x0086('0x20')](_0x349b62,_0x3c2705,!![]);}catch(_0x2ea2b4){return BPromise[_0x0086('0x21')](_0x2ea2b4);}return _0x349b62[_0x0086('0x22')]();};}function saveUpdates(_0x1a9a21,_0x344bdd){return function(_0x6838e7){if(_0x6838e7){return _0x6838e7['update'](_0x1a9a21)[_0x0086('0x23')](function(_0x2720c3){return _0x2720c3;});}return null;};}function removeEntity(_0x4107c,_0x3e0417){return function(_0x238c1f){if(_0x238c1f){return _0x238c1f[_0x0086('0x24')]()[_0x0086('0x23')](function(){_0x4107c[_0x0086('0x1d')](0xcc)[_0x0086('0x18')]();});}};}function handleEntityNotFound(_0x1e6d41,_0x4bad5d){return function(_0x1b72a5){if(!_0x1b72a5){_0x1e6d41[_0x0086('0x17')](0x194);}return _0x1b72a5;};}function handleError(_0x360052,_0x21d8c8){_0x21d8c8=_0x21d8c8||0x1f4;return function(_0x2e13ed){logger[_0x0086('0x25')](_0x2e13ed['stack']);if(_0x2e13ed[_0x0086('0x26')]){delete _0x2e13ed[_0x0086('0x26')];}_0x360052[_0x0086('0x1d')](_0x21d8c8)[_0x0086('0x27')](_0x2e13ed);};}exports[_0x0086('0x28')]=function(_0x14157f,_0x5d4b0e){var _0x20ff01={},_0x31faa0={},_0x74c459={'count':0x0,'rows':[]};var _0x4a9116=_[_0x0086('0x29')](db['ChatTransferReport'][_0x0086('0x2a')],function(_0x3ae709){return{'name':_0x3ae709[_0x0086('0x2b')],'type':_0x3ae709[_0x0086('0x2c')][_0x0086('0x2d')]};});_0x31faa0[_0x0086('0x2e')]=_['map'](_0x4a9116,_0x0086('0x26'));_0x31faa0[_0x0086('0x2f')]=_['keys'](_0x14157f[_0x0086('0x2f')]);_0x31faa0[_0x0086('0x30')]=_[_0x0086('0x31')](_0x31faa0[_0x0086('0x2e')],_0x31faa0[_0x0086('0x2f')]);_0x20ff01[_0x0086('0x32')]=_['intersection'](_0x31faa0[_0x0086('0x2e')],qs[_0x0086('0x33')](_0x14157f['query'][_0x0086('0x33')]));_0x20ff01[_0x0086('0x32')]=_0x20ff01[_0x0086('0x32')][_0x0086('0x34')]?_0x20ff01['attributes']:_0x31faa0[_0x0086('0x2e')];if(!_0x14157f[_0x0086('0x2f')]['hasOwnProperty'](_0x0086('0x35'))){_0x20ff01[_0x0086('0x1c')]=qs[_0x0086('0x1c')](_0x14157f['query'][_0x0086('0x1c')]);_0x20ff01[_0x0086('0x1a')]=qs['offset'](_0x14157f[_0x0086('0x2f')]['offset']);}_0x20ff01[_0x0086('0x36')]=qs[_0x0086('0x37')](_0x14157f[_0x0086('0x2f')][_0x0086('0x37')]);_0x20ff01[_0x0086('0x38')]=qs[_0x0086('0x30')](_[_0x0086('0x39')](_0x14157f[_0x0086('0x2f')],_0x31faa0[_0x0086('0x30')]),_0x4a9116);if(_0x14157f[_0x0086('0x2f')][_0x0086('0x3a')]){_0x20ff01[_0x0086('0x38')]=_[_0x0086('0x3b')](_0x20ff01[_0x0086('0x38')],{'$or':_[_0x0086('0x29')](_0x4a9116,function(_0x3ef3de){if(_0x3ef3de['type']!==_0x0086('0x3c')){var _0x2b05fb={};_0x2b05fb[_0x3ef3de[_0x0086('0x26')]]={'$like':'%'+_0x14157f['query'][_0x0086('0x3a')]+'%'};return _0x2b05fb;}})});}_0x20ff01=_[_0x0086('0x3b')]({},_0x20ff01,_0x14157f['options']);var _0x3e1125={'where':_0x20ff01[_0x0086('0x38')]};return db[_0x0086('0x3d')][_0x0086('0x3e')](_0x3e1125)['then'](function(_0x6f86c5){_0x74c459['count']=_0x6f86c5;if(_0x14157f[_0x0086('0x2f')][_0x0086('0x3f')]){_0x20ff01['include']=[{'all':!![]}];}return db[_0x0086('0x3d')][_0x0086('0x40')](_0x20ff01);})[_0x0086('0x23')](function(_0x1cacb0){_0x74c459['rows']=_0x1cacb0;return _0x74c459;})[_0x0086('0x23')](respondWithFilteredResult(_0x5d4b0e,_0x20ff01))['catch'](handleError(_0x5d4b0e,null));};exports[_0x0086('0x41')]=function(_0x1bed14,_0x502cb5){var _0x3bc408={'raw':!![],'where':{'id':_0x1bed14[_0x0086('0x42')]['id']}},_0x5135fb={};_0x5135fb[_0x0086('0x2e')]=_[_0x0086('0x43')](db[_0x0086('0x3d')]['rawAttributes']);_0x5135fb['query']=_[_0x0086('0x43')](_0x1bed14['query']);_0x5135fb['filters']=_[_0x0086('0x31')](_0x5135fb[_0x0086('0x2e')],_0x5135fb[_0x0086('0x2f')]);_0x3bc408[_0x0086('0x32')]=_[_0x0086('0x31')](_0x5135fb[_0x0086('0x2e')],qs[_0x0086('0x33')](_0x1bed14[_0x0086('0x2f')][_0x0086('0x33')]));_0x3bc408[_0x0086('0x32')]=_0x3bc408['attributes']['length']?_0x3bc408[_0x0086('0x32')]:_0x5135fb[_0x0086('0x2e')];if(_0x1bed14[_0x0086('0x2f')][_0x0086('0x3f')]){_0x3bc408[_0x0086('0x44')]=[{'all':!![]}];}_0x3bc408=_['merge']({},_0x3bc408,_0x1bed14['options']);return db[_0x0086('0x3d')]['find'](_0x3bc408)[_0x0086('0x23')](handleEntityNotFound(_0x502cb5,null))[_0x0086('0x23')](respondWithResult(_0x502cb5,null))[_0x0086('0x45')](handleError(_0x502cb5,null));};exports[_0x0086('0x46')]=function(_0x30afd8,_0xcc8d43){return db['ChatTransferReport'][_0x0086('0x46')](_0x30afd8[_0x0086('0x47')],{})['then'](respondWithResult(_0xcc8d43,0xc9))[_0x0086('0x45')](handleError(_0xcc8d43,null));};exports['update']=function(_0x333c49,_0x41011a){if(_0x333c49['body']['id']){delete _0x333c49[_0x0086('0x47')]['id'];}return db[_0x0086('0x3d')][_0x0086('0x48')]({'where':{'id':_0x333c49[_0x0086('0x42')]['id']}})[_0x0086('0x23')](handleEntityNotFound(_0x41011a,null))['then'](saveUpdates(_0x333c49['body'],null))[_0x0086('0x23')](respondWithResult(_0x41011a,null))[_0x0086('0x45')](handleError(_0x41011a,null));};exports[_0x0086('0x24')]=function(_0xf0d225,_0x5b4598){return db[_0x0086('0x3d')][_0x0086('0x48')]({'where':{'id':_0xf0d225['params']['id']}})[_0x0086('0x23')](handleEntityNotFound(_0x5b4598,null))['then'](removeEntity(_0x5b4598,null))[_0x0086('0x45')](handleError(_0x5b4598,null));};exports[_0x0086('0x49')]=function(_0x1a52dd,_0x5da158){return db[_0x0086('0x3d')][_0x0086('0x49')]()[_0x0086('0x23')](respondWithResult(_0x5da158,null))[_0x0086('0x45')](handleError(_0x5da158,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ab4103c..663015c 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 _0x9de0=['../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x500067,_0x1ea8e8){var _0x3533d9=function(_0x175c77){while(--_0x175c77){_0x500067['push'](_0x500067['shift']());}};_0x3533d9(++_0x1ea8e8);}(_0x9de0,0xc6));var _0x09de=function(_0x11fcbf,_0x3338b0){_0x11fcbf=_0x11fcbf-0x0;var _0x5bd81f=_0x9de0[_0x11fcbf];return _0x5bd81f;};'use strict';var _=require(_0x09de('0x0'));var util=require(_0x09de('0x1'));var logger=require(_0x09de('0x2'))('api');var moment=require(_0x09de('0x3'));var BPromise=require('bluebird');var rp=require(_0x09de('0x4'));var fs=require('fs');var path=require(_0x09de('0x5'));var rimraf=require('rimraf');var config=require(_0x09de('0x6'));var attributes=require(_0x09de('0x7'));module['exports']=function(_0x102a8b,_0x327827){return _0x102a8b[_0x09de('0x8')](_0x09de('0x9'),attributes,{'tableName':_0x09de('0xa'),'paranoid':![],'indexes':[{'name':_0x09de('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x51aa=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x232f04,_0x590eed){var _0x16e3b8=function(_0x2cab4c){while(--_0x2cab4c){_0x232f04['push'](_0x232f04['shift']());}};_0x16e3b8(++_0x590eed);}(_0x51aa,0x162));var _0xa51a=function(_0x4a5e96,_0x2e9b43){_0x4a5e96=_0x4a5e96-0x0;var _0x4b417b=_0x51aa[_0x4a5e96];return _0x4b417b;};'use strict';var _=require(_0xa51a('0x0'));var util=require(_0xa51a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa51a('0x2'));var BPromise=require(_0xa51a('0x3'));var rp=require(_0xa51a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa51a('0x5'));var config=require(_0xa51a('0x6'));var attributes=require(_0xa51a('0x7'));module[_0xa51a('0x8')]=function(_0x49a279,_0x1062ed){return _0x49a279[_0xa51a('0x9')](_0xa51a('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xa51a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 64f84ab..bf1406a 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 _0x46e2=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x46e2,0x166));var _0x246e=function(_0x1d3263,_0x49cd0a){_0x1d3263=_0x1d3263-0x0;var _0xa67ca4=_0x46e2[_0x1d3263];return _0xa67ca4;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require(_0x246e('0x2'));var BPromise=require(_0x246e('0x3'));var rs=require(_0x246e('0x4'));var fs=require('fs');var Redis=require(_0x246e('0x5'));var db=require(_0x246e('0x6'))['db'];var utils=require(_0x246e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x246e('0x8'));var jayson=require(_0x246e('0x9'));var client=jayson[_0x246e('0xa')][_0x246e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32601d,_0x52139f,_0xf5794f){return new BPromise(function(_0x3cd87d,_0x186bba){return client[_0x246e('0xc')](_0x32601d,_0xf5794f)[_0x246e('0xd')](function(_0x3bf8a5){logger[_0x246e('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x52139f,_0x246e('0xf'));logger[_0x246e('0x10')](_0x246e('0x11'),_0x52139f,_0x246e('0xf'),JSON['stringify'](_0x3bf8a5));if(_0x3bf8a5[_0x246e('0x12')]){if(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x13')]===0x1f4){logger[_0x246e('0x12')](_0x246e('0x14'),_0x52139f,_0x3bf8a5['error'][_0x246e('0x15')]);return _0x186bba(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);}logger[_0x246e('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x52139f,_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);return _0x3cd87d(_0x3bf8a5[_0x246e('0x12')][_0x246e('0x15')]);}else{logger[_0x246e('0xe')](_0x246e('0x14'),_0x52139f,_0x246e('0xf'));_0x3cd87d(_0x3bf8a5['result'][_0x246e('0x15')]);}})['catch'](function(_0x2c2112){logger[_0x246e('0x12')](_0x246e('0x14'),_0x52139f,_0x2c2112);_0x186bba(_0x2c2112);});});} \ No newline at end of file +var _0xff29=['http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x1df0a9,_0xc0d944){var _0x13238e=function(_0x12db5c){while(--_0x12db5c){_0x1df0a9['push'](_0x1df0a9['shift']());}};_0x13238e(++_0xc0d944);}(_0xff29,0x1c5));var _0x9ff2=function(_0x12004b,_0x34025c){_0x12004b=_0x12004b-0x0;var _0x24e654=_0xff29[_0x12004b];return _0x24e654;};'use strict';var _=require(_0x9ff2('0x0'));var util=require(_0x9ff2('0x1'));var moment=require(_0x9ff2('0x2'));var BPromise=require(_0x9ff2('0x3'));var rs=require(_0x9ff2('0x4'));var fs=require('fs');var Redis=require(_0x9ff2('0x5'));var db=require(_0x9ff2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ff2('0x7'))('rpc');var config=require(_0x9ff2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9ff2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26b73f,_0x38531e,_0x3d6b8f){return new BPromise(function(_0x4ff6c1,_0x5f60e0){return client[_0x9ff2('0xa')](_0x26b73f,_0x3d6b8f)[_0x9ff2('0xb')](function(_0x58f69d){logger['info'](_0x9ff2('0xc'),_0x38531e,'request\x20sent');logger[_0x9ff2('0xd')](_0x9ff2('0xe'),_0x38531e,'request\x20sent',JSON[_0x9ff2('0xf')](_0x58f69d));if(_0x58f69d[_0x9ff2('0x10')]){if(_0x58f69d['error']['code']===0x1f4){logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x58f69d['error'][_0x9ff2('0x11')]);return _0x5f60e0(_0x58f69d[_0x9ff2('0x10')]['message']);}logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x58f69d[_0x9ff2('0x10')]['message']);return _0x4ff6c1(_0x58f69d['error'][_0x9ff2('0x11')]);}else{logger[_0x9ff2('0x12')](_0x9ff2('0xc'),_0x38531e,_0x9ff2('0x13'));_0x4ff6c1(_0x58f69d[_0x9ff2('0x14')][_0x9ff2('0x11')]);}})['catch'](function(_0x373014){logger[_0x9ff2('0x10')](_0x9ff2('0xc'),_0x38531e,_0x373014);_0x5f60e0(_0x373014);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 2f0265b..2830907 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 _0x3f06=['/describe','describe','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x4ce960,_0x4258e9){var _0x43a9d1=function(_0xc221e3){while(--_0xc221e3){_0x4ce960['push'](_0x4ce960['shift']());}};_0x43a9d1(++_0x4258e9);}(_0x3f06,0xe5));var _0x63f0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3f06[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x63f0('0x0'));var util=require(_0x63f0('0x1'));var path=require(_0x63f0('0x2'));var timeout=require(_0x63f0('0x3'));var express=require(_0x63f0('0x4'));var router=express[_0x63f0('0x5')]();var fs_extra=require(_0x63f0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63f0('0x7'));router[_0x63f0('0x8')]('/',auth[_0x63f0('0x9')](),controller[_0x63f0('0xa')]);router[_0x63f0('0x8')](_0x63f0('0xb'),auth[_0x63f0('0x9')](),controller[_0x63f0('0xc')]);router[_0x63f0('0x8')]('/:id',auth[_0x63f0('0x9')](),controller[_0x63f0('0xd')]);router['post']('/',auth[_0x63f0('0x9')](),controller[_0x63f0('0xe')]);router['put'](_0x63f0('0xf'),auth[_0x63f0('0x9')](),controller[_0x63f0('0x10')]);router[_0x63f0('0x11')](_0x63f0('0xf'),auth[_0x63f0('0x9')](),controller[_0x63f0('0x12')]);module[_0x63f0('0x13')]=router; \ No newline at end of file +var _0x1fc3=['create','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post'];(function(_0xa502ed,_0x1178c7){var _0x2950af=function(_0x5ba0fe){while(--_0x5ba0fe){_0xa502ed['push'](_0xa502ed['shift']());}};_0x2950af(++_0x1178c7);}(_0x1fc3,0x9d));var _0x31fc=function(_0x194d1b,_0x2d79bc){_0x194d1b=_0x194d1b-0x0;var _0x15df17=_0x1fc3[_0x194d1b];return _0x15df17;};'use strict';var multer=require(_0x31fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x31fc('0x1'));var express=require('express');var router=express[_0x31fc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x31fc('0x3'));var interaction=require(_0x31fc('0x4'));var config=require(_0x31fc('0x5'));var controller=require(_0x31fc('0x6'));router['get']('/',auth[_0x31fc('0x7')](),controller['index']);router[_0x31fc('0x8')](_0x31fc('0x9'),auth['isAuthenticated'](),controller[_0x31fc('0xa')]);router[_0x31fc('0x8')](_0x31fc('0xb'),auth['isAuthenticated'](),controller[_0x31fc('0xc')]);router[_0x31fc('0xd')]('/',auth[_0x31fc('0x7')](),controller[_0x31fc('0xe')]);router[_0x31fc('0xf')](_0x31fc('0xb'),auth['isAuthenticated'](),controller[_0x31fc('0x10')]);router[_0x31fc('0x11')]('/:id',auth[_0x31fc('0x7')](),controller['destroy']);module[_0x31fc('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 8460809..c7f16bc 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 _0xc93d=['randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','rounded','squared','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','stringify','input','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x93c304,_0x64fc02){var _0x183dab=function(_0x3a6a5c){while(--_0x3a6a5c){_0x93c304['push'](_0x93c304['shift']());}};_0x183dab(++_0x64fc02);}(_0xc93d,0x19f));var _0xdc93=function(_0x3c9c05,_0x31f740){_0x3c9c05=_0x3c9c05-0x0;var _0x2f1d51=_0xc93d[_0x3c9c05];return _0x2f1d51;};'use strict';var Sequelize=require(_0xdc93('0x0'));var rs=require(_0xdc93('0x1'));module[_0xdc93('0x2')]={'name':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'unique':_0xdc93('0x4')},'description':{'type':Sequelize[_0xdc93('0x3')]},'mapKey':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x5')},'mapKeyOffline':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x6')},'customerAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xdc93('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xdc93('0xa'),_0xdc93('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0xc')},'offline_chat_button':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0xd')},'download_transcript':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xdc93('0x10')]},'closingQuestion':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x13')},'noteTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x14')},'closingMessageButton':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x15')},'skipMessageButton':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x16')},'conditionAgreement':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xdc93('0x17')](_0xdc93('0x18'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':function(){return JSON[_0xdc93('0x19')]({'items':[{'type':_0xdc93('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0xdc93('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xdc93('0x1a'),'props':{'title':_0xdc93('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc93('0x5'),'type':_0xdc93('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xdc93('0x1c')](_0xdc93('0x1d'))?JSON[_0xdc93('0x1e')](this[_0xdc93('0x1c')]('onlineForm')):{};},'set':function(_0x295cf6){return this[_0xdc93('0x1f')](_0xdc93('0x1d'),JSON['stringify'](_0x295cf6));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xdc93('0x19')]({'items':[{'type':_0xdc93('0x1a'),'props':{'title':_0xdc93('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xdc93('0x5'),'type':'email'},'variable':null},{'type':_0xdc93('0x20'),'config':{'placeholder':_0xdc93('0x21')},'props':{'title':_0xdc93('0x21'),'helpText':_0xdc93('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xdc93('0x1c')](_0xdc93('0x23'))?JSON[_0xdc93('0x1e')](this[_0xdc93('0x1c')](_0xdc93('0x23'))):{};},'set':function(_0x58ee39){return this[_0xdc93('0x1f')](_0xdc93('0x23'),JSON['stringify'](_0x58ee39));}},'token':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':function(){return rs[_0xdc93('0x24')]();}},'autoclose':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x25')},'waitingMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x27')},'offlineMessageBody':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x16')},'sendUnmanaged':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xdc93('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':function(){return _0xdc93('0x29');}},'notificationSound':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xdc93('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2c')},'defaultTitle':{'type':Sequelize[_0xdc93('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xdc93('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdc93('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xdc93('0x3')],'defaultValue':_0xdc93('0x2d')},'systemAvatar':{'type':Sequelize[_0xdc93('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdc93('0x9')],'comment':_0xdc93('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![],'comment':_0xdc93('0x2f'),'set':function(_0x3a2b7b){if(!_0x3a2b7b)this[_0xdc93('0x1f')](_0xdc93('0x30'),null);this[_0xdc93('0x1f')](_0xdc93('0x31'),_0x3a2b7b);}},'vidaooEscalation':{'type':Sequelize[_0xdc93('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xdc93('0x3')]},'vidaooTopic':{'type':Sequelize[_0xdc93('0x3')],'allowNull':![],'defaultValue':_0xdc93('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xdc93('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xdc93('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xefcf=['squared','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','thumb','input','text','getDataValue','onlineForm','parse','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','rounded'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefcf,0xce));var _0xfefc=function(_0xadd417,_0x207028){_0xadd417=_0xadd417-0x0;var _0x5c79e7=_0xefcf[_0xadd417];return _0x5c79e7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfefc('0x0'));module[_0xfefc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xfefc('0x2')]},'mapKey':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x3')},'mapKeyOffline':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x3')},'key':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfefc('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xfefc('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfefc('0x7')](_0xfefc('0x8'),_0xfefc('0x9')),'defaultValue':_0xfefc('0x8')},'header_online':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xa')},'header_offline':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xfefc('0xd')]},'closingQuestion':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x10')},'noteTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0xa')},'skipMessageButton':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x11')},'conditionAgreement':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star',_0xfefc('0x12')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xfefc('0x13'),'variable':null,'config':{'placeholder':'name','type':_0xfefc('0x14'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xfefc('0x13'),'props':{'title':_0xfefc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfefc('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfefc('0x15')](_0xfefc('0x16'))?JSON[_0xfefc('0x17')](this['getDataValue'](_0xfefc('0x16'))):{};},'set':function(_0x3a1f47){return this['setDataValue']('onlineForm',JSON[_0xfefc('0x18')](_0x3a1f47));}},'offlineForm':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return JSON[_0xfefc('0x18')]({'items':[{'type':_0xfefc('0x13'),'props':{'title':_0xfefc('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfefc('0x3'),'type':_0xfefc('0x3')},'variable':null},{'type':_0xfefc('0x19'),'config':{'placeholder':_0xfefc('0x1a')},'props':{'title':_0xfefc('0x1a'),'helpText':_0xfefc('0x1b')}}],'fromKey':0x0});},'get':function(){return this[_0xfefc('0x15')](_0xfefc('0x1c'))?JSON[_0xfefc('0x17')](this[_0xfefc('0x15')]('offlineForm')):{};},'set':function(_0x198ad9){return this[_0xfefc('0x1d')](_0xfefc('0x1c'),JSON[_0xfefc('0x18')](_0x198ad9));}},'token':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':function(){return rs[_0xfefc('0x1e')]();}},'autoclose':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfefc('0x2')]},'forwardOffline':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfefc('0x2')]},'waitingTitle':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x1f')},'waitingMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x20')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x21')},'enableUnmanagedNote':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x22')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x11')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfefc('0xd')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':function(){return _0xfefc('0x23');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfefc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':_0xfefc('0x24')},'verticalAlignment':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xfefc('0x2')]},'customerAvatar':{'type':Sequelize[_0xfefc('0xd')]},'showCustomerAvatar':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfefc('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':_0xfefc('0x25'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfefc('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfefc('0x26')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfefc('0x27')},'mandatoryDisposition':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![],'comment':_0xfefc('0x28'),'set':function(_0x461115){if(!_0x461115)this[_0xfefc('0x1d')]('mandatoryDispositionPauseId',null);this[_0xfefc('0x1d')](_0xfefc('0x29'),_0x461115);}},'vidaooEscalation':{'type':Sequelize[_0xfefc('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfefc('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xfefc('0x2')],'defaultValue':function(){return _0xfefc('0x2a');}},'vidaooMetadata':{'type':Sequelize[_0xfefc('0xd')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfefc('0xd')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ec314df..ce01deb 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 _0x4e86=['existsSync','join','server/files/images/logos/','download','getAvatar','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','chat','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','asc','account','List','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','ChatMessage','User','UserId','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','MailAccount','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','remote','connection','remoteAddress','alignment','verticalAlignment','color','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','ChatWebsites','end','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','includeAll','findAll','catch','show','params','intersection','include','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','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','isNil'];(function(_0x22ab14,_0x59cad4){var _0x22064a=function(_0x4683df){while(--_0x4683df){_0x22ab14['push'](_0x22ab14['shift']());}};_0x22064a(++_0x59cad4);}(_0x4e86,0xb1));var _0x64e8=function(_0x33f073,_0x15c2d7){_0x33f073=_0x33f073-0x0;var _0x330bf0=_0x4e86[_0x33f073];return _0x330bf0;};'use strict';var emlformat=require(_0x64e8('0x0'));var rimraf=require(_0x64e8('0x1'));var zipdir=require(_0x64e8('0x2'));var jsonpatch=require(_0x64e8('0x3'));var rp=require(_0x64e8('0x4'));var moment=require('moment');var BPromise=require(_0x64e8('0x5'));var Mustache=require(_0x64e8('0x6'));var util=require(_0x64e8('0x7'));var path=require('path');var sox=require(_0x64e8('0x8'));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(_0x64e8('0x9'));var crypto=require(_0x64e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x64e8('0xb'));var toCsv=require(_0x64e8('0xc'));var querystring=require(_0x64e8('0xd'));var Papa=require(_0x64e8('0xe'));var Redis=require(_0x64e8('0xf'));var authService=require(_0x64e8('0x10'));var qs=require(_0x64e8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64e8('0x12'));var logger=require(_0x64e8('0x13'))(_0x64e8('0x14'));var utils=require('../../config/utils');var config=require(_0x64e8('0x15'));var licenseUtil=require(_0x64e8('0x16'));var db=require(_0x64e8('0x17'))['db'];config[_0x64e8('0x18')]=_['defaults'](config[_0x64e8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x64e8('0x19'))(new Redis(config[_0x64e8('0x18')]));require(_0x64e8('0x1a'))[_0x64e8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232c});var client9002=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232a});var client9003=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x232b});var client9001=jayson[_0x64e8('0x1c')][_0x64e8('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0x361e91,_0x2c0191,_0x5b06ea,_0x5e779d){return new BPromise(function(_0x4dbd1b,_0x103726){var _0x1259b3=_0x5e779d||client;return _0x1259b3[_0x64e8('0x1e')](_0x361e91,_0x5b06ea)['then'](function(_0x4f70b2){logger['info'](_0x64e8('0x1f'),_0x2c0191,_0x64e8('0x20'));logger[_0x64e8('0x21')](_0x64e8('0x22'),_0x2c0191,_0x64e8('0x20'),JSON[_0x64e8('0x23')](_0x4f70b2));if(_0x4f70b2[_0x64e8('0x24')]){if(_0x4f70b2[_0x64e8('0x24')]['code']===0x1f4){logger[_0x64e8('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x2c0191,_0x4f70b2[_0x64e8('0x24')][_0x64e8('0x25')]);return _0x103726(_0x4f70b2['error']['message']);}logger[_0x64e8('0x24')](_0x64e8('0x1f'),_0x2c0191,_0x4f70b2[_0x64e8('0x24')]['message']);return _0x4dbd1b(_0x4f70b2[_0x64e8('0x24')][_0x64e8('0x25')]);}else{logger[_0x64e8('0x26')](_0x64e8('0x1f'),_0x2c0191,'request\x20sent');_0x4dbd1b(_0x4f70b2[_0x64e8('0x27')][_0x64e8('0x25')]);}})['catch'](function(_0x182626){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2c0191,_0x182626);_0x103726(_0x182626);});});}function respondWithStatusCode(_0x447a27,_0xa6d4a6){_0xa6d4a6=_0xa6d4a6||0xcc;return function(_0x1945c4){if(_0x1945c4){return _0x447a27['sendStatus'](_0xa6d4a6);}return _0x447a27[_0x64e8('0x28')](_0xa6d4a6)['end']();};}function respondWithResult(_0x45cd13,_0x4f33b9){_0x4f33b9=_0x4f33b9||0xc8;return function(_0x489e2d){if(_0x489e2d){return _0x45cd13[_0x64e8('0x28')](_0x4f33b9)[_0x64e8('0x29')](_0x489e2d);}};}function respondWithFilteredResult(_0x49a048,_0x3e87f8){return function(_0x1b96a7){if(_0x1b96a7){var _0x31563f=typeof _0x3e87f8['offset']===_0x64e8('0x2a')&&typeof _0x3e87f8[_0x64e8('0x2b')]===_0x64e8('0x2a');var _0xdd52e5=_0x1b96a7[_0x64e8('0x2c')];var _0x5d3438=_0x31563f?0x0:_0x3e87f8[_0x64e8('0x2d')];var _0x77fb56=_0x31563f?_0x1b96a7[_0x64e8('0x2c')]:_0x3e87f8[_0x64e8('0x2d')]+_0x3e87f8[_0x64e8('0x2b')];var _0xa70b97;if(_0x77fb56>=_0xdd52e5){_0x77fb56=_0xdd52e5;_0xa70b97=0xc8;}else{_0xa70b97=0xce;}_0x49a048[_0x64e8('0x28')](_0xa70b97);return _0x49a048[_0x64e8('0x2e')]('Content-Range',_0x5d3438+'-'+_0x77fb56+'/'+_0xdd52e5)['json'](_0x1b96a7);}return null;};}function patchUpdates(_0x24dbdb){return function(_0x17a5a7){try{jsonpatch['apply'](_0x17a5a7,_0x24dbdb,!![]);}catch(_0x32ec89){return BPromise[_0x64e8('0x2f')](_0x32ec89);}return _0x17a5a7[_0x64e8('0x30')]();};}function saveUpdates(_0x12d3ad,_0x3b6431){return function(_0x25248d){if(_0x25248d){return _0x25248d[_0x64e8('0x31')](_0x12d3ad)[_0x64e8('0x32')](function(_0x18e39b){return _0x18e39b;});}return null;};}function removeEntity(_0x1c981f,_0x568254){return function(_0x28d74d){if(_0x28d74d){return _0x28d74d[_0x64e8('0x33')]()['then'](function(){var _0x28daa6=_0x28d74d[_0x64e8('0x34')]({'plain':!![]});var _0x40340e=_0x64e8('0x35');return db['UserProfileResource'][_0x64e8('0x33')]({'where':{'type':_0x40340e,'resourceId':_0x28daa6['id']}})['then'](function(){return _0x28d74d;});})['then'](function(){_0x1c981f[_0x64e8('0x28')](0xcc)[_0x64e8('0x36')]();});}};}function handleEntityNotFound(_0x3d098b,_0x3dfa13){return function(_0x5eeafd){if(!_0x5eeafd){_0x3d098b[_0x64e8('0x37')](0x194);}return _0x5eeafd;};}function handleError(_0x2d8d30,_0x336f46){_0x336f46=_0x336f46||0x1f4;return function(_0x437eec){logger[_0x64e8('0x24')](_0x437eec[_0x64e8('0x38')]);if(_0x437eec[_0x64e8('0x39')]){delete _0x437eec[_0x64e8('0x39')];}_0x2d8d30[_0x64e8('0x28')](_0x336f46)['send'](_0x437eec);};}exports['index']=function(_0x305eed,_0x55b55c){var _0x321c17={'include':[{'model':db[_0x64e8('0x3a')],'as':_0x64e8('0x3b')}]},_0x3c8033={},_0x1163ad={'count':0x0,'rows':[]};var _0xd75fd6=_[_0x64e8('0x3c')](db[_0x64e8('0x3d')]['rawAttributes'],function(_0x5ed8d3){return{'name':_0x5ed8d3['fieldName'],'type':_0x5ed8d3[_0x64e8('0x3e')][_0x64e8('0x3f')]};});_0x3c8033[_0x64e8('0x40')]=_[_0x64e8('0x3c')](_0xd75fd6,_0x64e8('0x39'));_0x3c8033['query']=_[_0x64e8('0x41')](_0x305eed[_0x64e8('0x42')]);_0x3c8033['filters']=_['intersection'](_0x3c8033[_0x64e8('0x40')],_0x3c8033[_0x64e8('0x42')]);_0x321c17['attributes']=_['intersection'](_0x3c8033['model'],qs[_0x64e8('0x43')](_0x305eed[_0x64e8('0x42')][_0x64e8('0x43')]));_0x321c17[_0x64e8('0x44')]=_0x321c17[_0x64e8('0x44')][_0x64e8('0x45')]?_0x321c17[_0x64e8('0x44')]:_0x3c8033[_0x64e8('0x40')];if(!_0x305eed[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x321c17[_0x64e8('0x2b')]=qs['limit'](_0x305eed[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x321c17[_0x64e8('0x2d')]=qs['offset'](_0x305eed[_0x64e8('0x42')][_0x64e8('0x2d')]);}_0x321c17['order']=qs[_0x64e8('0x48')](_0x305eed['query']['sort']);_0x321c17['where']=qs['filters'](_[_0x64e8('0x49')](_0x305eed[_0x64e8('0x42')],_0x3c8033[_0x64e8('0x4a')]),_0xd75fd6);if(_0x305eed[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x321c17['where']=_[_0x64e8('0x4c')](_0x321c17[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0xd75fd6,function(_0x4102ae){if(_0x4102ae[_0x64e8('0x3e')]!=='VIRTUAL'){var _0x192318={};_0x192318[_0x4102ae[_0x64e8('0x39')]]={'$like':'%'+_0x305eed['query'][_0x64e8('0x4b')]+'%'};return _0x192318;}})});}_0x321c17=_['merge']({},_0x321c17,_0x305eed[_0x64e8('0x4e')]);var _0x5d69b8={'where':_0x321c17[_0x64e8('0x4d')]};return db[_0x64e8('0x3d')][_0x64e8('0x2c')](_0x5d69b8)['then'](function(_0x1caa78){_0x1163ad[_0x64e8('0x2c')]=_0x1caa78;if(_0x305eed['query'][_0x64e8('0x4f')]){_0x321c17['include']=[{'all':!![]}];}return db[_0x64e8('0x3d')][_0x64e8('0x50')](_0x321c17);})[_0x64e8('0x32')](function(_0xbf26d6){_0x1163ad['rows']=_0xbf26d6;return _0x1163ad;})[_0x64e8('0x32')](respondWithFilteredResult(_0x55b55c,_0x321c17))[_0x64e8('0x51')](handleError(_0x55b55c,null));};exports[_0x64e8('0x52')]=function(_0x2e98ca,_0x2165ad){var _0x122c69={'raw':![],'where':{'id':_0x2e98ca[_0x64e8('0x53')]['id']},'include':[{'model':db[_0x64e8('0x3a')],'as':_0x64e8('0x3b')}]},_0x3b1147={};_0x3b1147[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x3d')]['rawAttributes']);_0x3b1147[_0x64e8('0x42')]=_['keys'](_0x2e98ca[_0x64e8('0x42')]);_0x3b1147[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x3b1147[_0x64e8('0x40')],_0x3b1147[_0x64e8('0x42')]);_0x122c69[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x3b1147['model'],qs['fields'](_0x2e98ca[_0x64e8('0x42')][_0x64e8('0x43')]));_0x122c69[_0x64e8('0x44')]=_0x122c69[_0x64e8('0x44')][_0x64e8('0x45')]?_0x122c69[_0x64e8('0x44')]:_0x3b1147[_0x64e8('0x40')];if(_0x2e98ca[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x122c69[_0x64e8('0x55')]=[{'all':!![]}];}_0x122c69=_[_0x64e8('0x4c')]({},_0x122c69,_0x2e98ca['options']);return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x122c69)[_0x64e8('0x32')](handleEntityNotFound(_0x2165ad,null))['then'](respondWithResult(_0x2165ad,null))[_0x64e8('0x51')](handleError(_0x2165ad,null));};exports['create']=function(_0x2932ec,_0x1d2583){return db[_0x64e8('0x3d')][_0x64e8('0x57')](_0x2932ec[_0x64e8('0x58')],{})[_0x64e8('0x32')](function(_0x5f24fb){var _0x388691=_0x2932ec[_0x64e8('0x59')][_0x64e8('0x34')]({'plain':!![]});if(!_0x388691)throw new Error(_0x64e8('0x5a'));if(_0x388691['role']===_0x64e8('0x59')){var _0x4fba46=_0x5f24fb[_0x64e8('0x34')]({'plain':!![]});var _0x3bd26f=_0x64e8('0x35');return db[_0x64e8('0x5b')][_0x64e8('0x56')]({'where':{'name':_0x3bd26f,'userProfileId':_0x388691[_0x64e8('0x5c')]},'raw':!![]})[_0x64e8('0x32')](function(_0x59a74a){if(_0x59a74a&&_0x59a74a[_0x64e8('0x5d')]===0x0){return db[_0x64e8('0x5e')][_0x64e8('0x57')]({'name':_0x4fba46[_0x64e8('0x39')],'resourceId':_0x4fba46['id'],'type':_0x59a74a['name'],'sectionId':_0x59a74a['id']},{})['then'](function(){return _0x5f24fb;});}else{return _0x5f24fb;}})[_0x64e8('0x51')](function(_0x1fd3b2){logger['error'](_0x64e8('0x5f'),_0x1fd3b2);throw _0x1fd3b2;});}return _0x5f24fb;})['then'](respondWithResult(_0x1d2583,0xc9))[_0x64e8('0x51')](handleError(_0x1d2583,null));};exports[_0x64e8('0x31')]=function(_0x209c5d,_0x1c32e9){if(_0x209c5d[_0x64e8('0x58')]['id']){delete _0x209c5d[_0x64e8('0x58')]['id'];}return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x209c5d['params']['id']},'include':[{'model':db['Pause'],'as':_0x64e8('0x3b')}]})[_0x64e8('0x32')](handleEntityNotFound(_0x1c32e9,null))[_0x64e8('0x32')](saveUpdates(_0x209c5d['body'],null))[_0x64e8('0x32')](respondWithResult(_0x1c32e9,null))[_0x64e8('0x51')](handleError(_0x1c32e9,null));};exports[_0x64e8('0x33')]=function(_0x470195,_0x3f6c1b){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x470195['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x3f6c1b,null))[_0x64e8('0x32')](removeEntity(_0x3f6c1b,null))[_0x64e8('0x51')](handleError(_0x3f6c1b,null));};exports[_0x64e8('0x60')]=function(_0x16356a,_0x204928){return db[_0x64e8('0x3d')]['describe']()[_0x64e8('0x32')](respondWithResult(_0x204928,null))['catch'](handleError(_0x204928,null));};exports[_0x64e8('0x61')]=function(_0x5ab8dc,_0x2e18df,_0x279838){if(_0x5ab8dc[_0x64e8('0x58')]['id']){delete _0x5ab8dc['body']['id'];}return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x5ab8dc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2e18df,null))[_0x64e8('0x32')](function(_0x560c99){if(_0x560c99){_0x5ab8dc[_0x64e8('0x58')][_0x64e8('0x62')]=_0x560c99['id'];return db[_0x64e8('0x63')][_0x64e8('0x57')](_0x5ab8dc['body']);}})[_0x64e8('0x32')](respondWithResult(_0x2e18df,null))[_0x64e8('0x51')](handleError(_0x2e18df,null));};exports[_0x64e8('0x64')]=function(_0x103e92,_0x386310,_0xe07d94){var _0x407629={'raw':![],'where':{}};var _0x13aca2={};var _0x22e398={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x103e92['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x386310,null))['then'](function(_0x339a33){if(_0x339a33){_0x13aca2[_0x64e8('0x40')]=_['keys'](db[_0x64e8('0x63')][_0x64e8('0x66')]);_0x13aca2[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x103e92[_0x64e8('0x42')]);_0x13aca2['filters']=_[_0x64e8('0x54')](_0x13aca2[_0x64e8('0x40')],_0x13aca2['query']);_0x407629['attributes']=_['intersection'](_0x13aca2[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x103e92[_0x64e8('0x42')][_0x64e8('0x43')]));_0x407629[_0x64e8('0x44')]=_0x407629[_0x64e8('0x44')][_0x64e8('0x45')]?_0x407629[_0x64e8('0x44')]:_0x13aca2['model'];if(!_0x103e92[_0x64e8('0x42')]['hasOwnProperty'](_0x64e8('0x47'))){_0x407629[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x103e92['query'][_0x64e8('0x2b')]);_0x407629[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x103e92['query']['offset']);}_0x407629[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x103e92[_0x64e8('0x42')][_0x64e8('0x48')]);_0x407629['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x103e92['query'],_0x13aca2[_0x64e8('0x4a')]));_0x407629[_0x64e8('0x4d')][_0x64e8('0x62')]=_0x339a33['id'];if(_0x103e92[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x407629[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x407629[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x407629[_0x64e8('0x44')],function(_0x4d7b9b){var _0x40b336={};_0x40b336[_0x4d7b9b]={'$like':'%'+_0x103e92['query'][_0x64e8('0x4b')]+'%'};return _0x40b336;})});}_0x407629=_[_0x64e8('0x4c')]({},_0x407629,_0x103e92['options']);return db[_0x64e8('0x63')][_0x64e8('0x2c')]({'where':_0x407629['where']})['then'](function(_0x56a637){_0x22e398[_0x64e8('0x2c')]=_0x56a637;if(_0x103e92['query']['includeAll']){_0x407629[_0x64e8('0x55')]=[{'all':!![]}];}return db[_0x64e8('0x63')][_0x64e8('0x50')](_0x407629);})[_0x64e8('0x32')](function(_0x407fc1){_0x22e398[_0x64e8('0x68')]=_0x407fc1;return _0x22e398;});}})['then'](respondWithFilteredResult(_0x386310,_0x407629))[_0x64e8('0x51')](handleError(_0x386310,null));};exports['removeDispositions']=function(_0x17f286,_0x3ae571,_0x46dd91){return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x17f286['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x3ae571,null))[_0x64e8('0x32')](function(_0x5ca4af){if(_0x5ca4af){return _0x5ca4af[_0x64e8('0x69')](_0x17f286[_0x64e8('0x42')][_0x64e8('0x6a')]);}})[_0x64e8('0x32')](respondWithStatusCode(_0x3ae571,null))[_0x64e8('0x51')](handleError(_0x3ae571,null));};exports['addAnswer']=function(_0x6a5492,_0x2e7ce5,_0xe6b4f2){if(_0x6a5492[_0x64e8('0x58')]['id']){delete _0x6a5492[_0x64e8('0x58')]['id'];}return db['ChatWebsite'][_0x64e8('0x56')]({'where':{'id':_0x6a5492[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2e7ce5,null))[_0x64e8('0x32')](function(_0x326f56){if(_0x326f56){_0x6a5492[_0x64e8('0x58')]['ChatWebsiteId']=_0x326f56['id'];return db['CannedAnswer'][_0x64e8('0x57')](_0x6a5492[_0x64e8('0x58')]);}})[_0x64e8('0x32')](respondWithResult(_0x2e7ce5,null))[_0x64e8('0x51')](handleError(_0x2e7ce5,null));};exports[_0x64e8('0x6b')]=function(_0x29437f,_0x44b511,_0x580b1f){var _0x306d43={'raw':![],'where':{}};var _0x2488d8={};var _0x5a47b7={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x29437f[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x44b511,null))[_0x64e8('0x32')](function(_0x1dfe2f){if(_0x1dfe2f){_0x2488d8['model']=_['keys'](db['CannedAnswer'][_0x64e8('0x66')]);_0x2488d8['query']=_[_0x64e8('0x41')](_0x29437f['query']);_0x2488d8[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x2488d8['model'],_0x2488d8[_0x64e8('0x42')]);_0x306d43[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x2488d8[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x29437f[_0x64e8('0x42')][_0x64e8('0x43')]));_0x306d43['attributes']=_0x306d43['attributes'][_0x64e8('0x45')]?_0x306d43['attributes']:_0x2488d8['model'];if(!_0x29437f[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x306d43[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x29437f[_0x64e8('0x42')]['limit']);_0x306d43['offset']=qs[_0x64e8('0x2d')](_0x29437f['query']['offset']);}_0x306d43[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x29437f[_0x64e8('0x42')][_0x64e8('0x48')]);_0x306d43['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x29437f[_0x64e8('0x42')],_0x2488d8[_0x64e8('0x4a')]));_0x306d43['where']['ChatWebsiteId']=_0x1dfe2f['id'];if(_0x29437f[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x306d43[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x306d43[_0x64e8('0x4d')],{'$or':_['map'](_0x306d43[_0x64e8('0x44')],function(_0x475896){var _0xd16d1f={};_0xd16d1f[_0x475896]={'$like':'%'+_0x29437f[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0xd16d1f;})});}_0x306d43=_[_0x64e8('0x4c')]({},_0x306d43,_0x29437f[_0x64e8('0x4e')]);return db[_0x64e8('0x6c')][_0x64e8('0x2c')]({'where':_0x306d43[_0x64e8('0x4d')]})[_0x64e8('0x32')](function(_0x143ad7){_0x5a47b7[_0x64e8('0x2c')]=_0x143ad7;if(_0x29437f[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x306d43['include']=[{'all':!![]}];}return db[_0x64e8('0x6c')][_0x64e8('0x50')](_0x306d43);})[_0x64e8('0x32')](function(_0x2f2ac8){_0x5a47b7[_0x64e8('0x68')]=_0x2f2ac8;return _0x5a47b7;});}})['then'](respondWithFilteredResult(_0x44b511,_0x306d43))['catch'](handleError(_0x44b511,null));};exports[_0x64e8('0x6d')]=function(_0x508564,_0x2f3315,_0x2b4203){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x508564[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x2f3315,null))[_0x64e8('0x32')](function(_0x512e3c){if(_0x512e3c){return _0x512e3c['removeAnswers'](_0x508564[_0x64e8('0x42')][_0x64e8('0x6a')]);}})['then'](respondWithStatusCode(_0x2f3315,null))['catch'](handleError(_0x2f3315,null));};exports[_0x64e8('0x6e')]=function(_0x4457a9,_0x2bac49,_0x1105f8){_0x4457a9['body'][_0x64e8('0x6f')]=_0x4457a9[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4457a9[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x2bac49,null))[_0x64e8('0x32')](saveUpdates(_0x4457a9[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x2bac49,null))[_0x64e8('0x51')](handleError(_0x2bac49,null));};exports[_0x64e8('0x72')]=function(_0x287c44,_0x15e3b4,_0x24f68d){_0x287c44['body'][_0x64e8('0x73')]=_0x287c44[_0x64e8('0x70')]['filename'];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x287c44[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x15e3b4,null))[_0x64e8('0x32')](saveUpdates(_0x287c44[_0x64e8('0x58')],null))['then'](respondWithResult(_0x15e3b4,null))[_0x64e8('0x51')](handleError(_0x15e3b4,null));};exports['addCustomerAvatar']=function(_0x4665c4,_0x5ec7be,_0xaab468){_0x4665c4['body'][_0x64e8('0x74')]=_0x4665c4[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4665c4['params']['id']}})['then'](handleEntityNotFound(_0x5ec7be,null))[_0x64e8('0x32')](saveUpdates(_0x4665c4[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x5ec7be,null))[_0x64e8('0x51')](handleError(_0x5ec7be,null));};exports['addSystemAvatar']=function(_0x3fdf9d,_0x433c02,_0x3d3bdf){_0x3fdf9d[_0x64e8('0x58')][_0x64e8('0x75')]=_0x3fdf9d[_0x64e8('0x70')][_0x64e8('0x71')];return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x3fdf9d[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x433c02,null))[_0x64e8('0x32')](saveUpdates(_0x3fdf9d[_0x64e8('0x58')],null))[_0x64e8('0x32')](respondWithResult(_0x433c02,null))[_0x64e8('0x51')](handleError(_0x433c02,null));};exports[_0x64e8('0x76')]=function(_0x144b1d,_0x46df56,_0x1cf8f1){var _0x2bf3e6=path['join'](config[_0x64e8('0x77')],_0x64e8('0x78'));var _0x255dd8={'where':{'id':_0x144b1d[_0x64e8('0x53')]['id']},'attributes':['id',_0x64e8('0x6f')],'raw':!![]};var _0x5628ee=![];return require(_0x64e8('0x16'))[_0x64e8('0x79')]()[_0x64e8('0x32')](function(_0x77798e){if(_0x77798e){_0x5628ee=_0x77798e['custom'];}})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')]['find'](_0x255dd8);})['then'](handleEntityNotFound(_0x46df56,null))[_0x64e8('0x32')](function(_0x2ac87a){if(_0x2ac87a){if(!_[_0x64e8('0x7a')](_0x2ac87a[_0x64e8('0x6f')])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x7d'),_0x2ac87a[_0x64e8('0x6f')]))&&_0x5628ee){_0x2bf3e6=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/logos/',_0x2ac87a[_0x64e8('0x6f')]);}}return _0x46df56[_0x64e8('0x7e')](_0x2bf3e6);}})['catch'](handleError(_0x46df56,null));};exports[_0x64e8('0x7f')]=function(_0x3d9620,_0x1cb06b,_0x2d47a6){var _0xbd573c=path['join'](config[_0x64e8('0x77')],'server/files/images/avatars/default_avatar.png');var _0x438109={'where':{'id':_0x3d9620['params']['id']},'attributes':['id',_0x64e8('0x73')],'raw':!![]};return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x438109)['then'](handleEntityNotFound(_0x1cb06b,null))[_0x64e8('0x32')](function(_0x122eac){if(_0x122eac){if(!_[_0x64e8('0x7a')](_0x122eac[_0x64e8('0x73')])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/avatars/',_0x122eac[_0x64e8('0x73')]))){_0xbd573c=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],'server/files/images/avatars/',_0x122eac[_0x64e8('0x73')]);}}return _0x1cb06b['download'](_0xbd573c);}})[_0x64e8('0x51')](handleError(_0x1cb06b,null));};exports[_0x64e8('0x80')]=function(_0x3aa25a,_0x34da1a,_0x5e0b5a){var _0x41a23=path[_0x64e8('0x7c')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0xb649cb={'where':{'id':_0x3aa25a['params']['id']},'attributes':['id',_0x64e8('0x74'),_0x64e8('0x81')],'raw':!![]};return db[_0x64e8('0x3d')]['find'](_0xb649cb)['then'](handleEntityNotFound(_0x34da1a,null))[_0x64e8('0x32')](function(_0x25bb48){if(_0x25bb48){if(!_[_0x64e8('0x7a')](_0x25bb48['customerAvatar'])){if(fs[_0x64e8('0x7b')](path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x82'),_0x25bb48[_0x64e8('0x74')]))&&_0x25bb48[_0x64e8('0x81')]){_0x41a23=path[_0x64e8('0x7c')](config['root'],_0x64e8('0x82'),_0x25bb48['customerAvatar']);}}return _0x34da1a[_0x64e8('0x7e')](_0x41a23);}})[_0x64e8('0x51')](handleError(_0x34da1a,null));};exports[_0x64e8('0x83')]=function(_0x1e4658,_0x52cd34,_0x2fed9d){var _0x3e4926=path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0x84'));var _0x2deca2={'where':{'id':_0x1e4658[_0x64e8('0x53')]['id']},'attributes':['id',_0x64e8('0x75')],'raw':!![]};return db[_0x64e8('0x3d')][_0x64e8('0x56')](_0x2deca2)[_0x64e8('0x32')](handleEntityNotFound(_0x52cd34,null))[_0x64e8('0x32')](function(_0x5f0276){if(_0x5f0276){if(!_[_0x64e8('0x7a')](_0x5f0276['systemAvatar'])){if(fs[_0x64e8('0x7b')](path['join'](config[_0x64e8('0x77')],_0x64e8('0x82'),_0x5f0276['systemAvatar']))){_0x3e4926=path[_0x64e8('0x7c')](config['root'],_0x64e8('0x82'),_0x5f0276['systemAvatar']);}}return _0x52cd34[_0x64e8('0x7e')](_0x3e4926);}})[_0x64e8('0x51')](handleError(_0x52cd34,null));};exports[_0x64e8('0x85')]=function(_0x4a63eb,_0x2953f7,_0x318e2f){var _0x3d06be=require('user-agent-parser');var _0x4dbfc1=new _0x3d06be();var _0xb86732=_0x4dbfc1[_0x64e8('0x86')](_0x4a63eb[_0x64e8('0x87')][_0x64e8('0x88')])['getResult']();var _0x229c09={'body':_0x4a63eb[_0x64e8('0x58')],'channel':_0x64e8('0x89')};var _0x176561=[];var _0x17b600=[];var _0x2295ab={};var _0x6ee1ff=![];return db['CmContact'][_0x64e8('0x60')]()[_0x64e8('0x32')](function(_0x120dcf){if(!_0x120dcf){throw new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x8b'));}_0x176561=_['difference'](_[_0x64e8('0x41')](_0x120dcf),[_0x64e8('0x8c'),_0x64e8('0x8d')]);_0x17b600=_[_0x64e8('0x8e')](_[_0x64e8('0x41')](_0x120dcf),[_0x64e8('0x8c'),_0x64e8('0x8d'),'CompanyId',_0x64e8('0x8f')]);if(_0x4a63eb[_0x64e8('0x58')]['id']){delete _0x4a63eb['body']['id'];}if(_['isNil'](_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')])){throw new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0x92'));}if(_['isNil'](_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x58')])||_0x4a63eb[_0x64e8('0x58')]['body']===''){throw new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0x93'));}if(_[_0x64e8('0x7a')](_0x4a63eb[_0x64e8('0x58')]['mapKey'])){throw new db['Sequelize'][(_0x64e8('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x17b600);}if(!_[_0x64e8('0x94')](_0x17b600,_0x4a63eb['body'][_0x64e8('0x95')])){throw new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x96')+_0x17b600);}_0x2295ab[_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x95')]]=_0x4a63eb[_0x64e8('0x58')]['from'];})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4a63eb[_0x64e8('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x64e8('0x97')],'as':_0x64e8('0x98'),'where':_0x2295ab,'limit':0x1,'order':[[_0x64e8('0x8d'),_0x64e8('0x99')]]}]},{'model':db[_0x64e8('0x9a')],'as':_0x64e8('0x9b')}]});})[_0x64e8('0x32')](handleEntityNotFound(_0x2953f7,null))[_0x64e8('0x32')](function(_0x334503){if(_0x334503&&_0x334503['List']){_0x229c09['account']=_0x334503;_0x229c09['applications']=_0x334503['Applications'];_0x229c09[_0x64e8('0x9c')]=_0x334503['List'];_0x229c09[_0x64e8('0x9d')]=_[_0x64e8('0x9e')](_0x229c09['applications'],['priority'],[_0x64e8('0x9f')]);if(_0x229c09[_0x64e8('0xa0')]['Applications']){delete _0x229c09[_0x64e8('0xa0')][_0x64e8('0x9b')];}if(_0x229c09[_0x64e8('0xa0')][_0x64e8('0xa1')]&&_0x229c09[_0x64e8('0xa0')]['List']['Contacts'][_0x64e8('0x45')]){return _0x229c09[_0x64e8('0xa0')][_0x64e8('0xa1')][_0x64e8('0x98')][0x0];}var _0x480114=_[_0x64e8('0xa2')](_0x4a63eb[_0x64e8('0x58')],{'firstName':_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')],'ListId':_0x334503['ListId']});_0x480114[_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x95')]]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0x90')];return db[_0x64e8('0x97')]['create'](_0x480114,{'fields':_0x176561,'raw':!![]});}})[_0x64e8('0x32')](handleEntityNotFound(_0x2953f7,null))['then'](function(_0x4bb277){_0x229c09[_0x64e8('0xa3')]=_0x4bb277;var _0x11db9b=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xa4')];if(_0x4a63eb[_0x64e8('0x87')]['cf-connecting-ip']){_0x11db9b=_0x4a63eb['headers'][_0x64e8('0xa5')];}else if(_0x4a63eb['headers'][_0x64e8('0xa6')]){_0x11db9b=_[_0x64e8('0xa7')](_0x4a63eb['headers'][_0x64e8('0xa6')]['split'](','));}if(_0x4bb277){var _0x4e9abd={'ContactId':_0x4bb277['id'],'ChatWebsiteId':_0x4a63eb['params']['id'],'from':(_0x4bb277['firstName']||'')+'\x20'+(_0x4bb277[_0x64e8('0xa8')]||''),'customerIp':_0x11db9b,'customerPort':_0x4a63eb[_0x64e8('0x87')][_0x64e8('0xa9')]?_0x4a63eb[_0x64e8('0x87')]['x-real-port']:null,'referer':_0x4a63eb['body'][_0x64e8('0xaa')],'browserName':_0xb86732['browser'][_0x64e8('0x39')]&&_0xb86732[_0x64e8('0xab')]['version']?util[_0x64e8('0xac')]('%s\x20%s',_0xb86732[_0x64e8('0xab')][_0x64e8('0x39')],_0xb86732[_0x64e8('0xab')][_0x64e8('0xad')]):_0x64e8('0xae'),'browserVersion':_0xb86732[_0x64e8('0xab')]['version']||_0x64e8('0xae'),'osName':util[_0x64e8('0xac')](_0x64e8('0xaf'),_0xb86732['os']['name'],_0xb86732['os'][_0x64e8('0xad')]),'osVersion':_0xb86732['os'][_0x64e8('0xad')],'deviceModel':_0xb86732[_0x64e8('0xb0')]['model']&&_0xb86732[_0x64e8('0xb0')][_0x64e8('0xb1')]?util[_0x64e8('0xac')]('%s\x20%s\x20%s',_0xb86732[_0x64e8('0xb0')][_0x64e8('0x40')],_0xb86732[_0x64e8('0xb0')]['vendor'],_0xb86732[_0x64e8('0xb0')][_0x64e8('0x3e')]):null,'deviceVendor':_0xb86732[_0x64e8('0xb0')][_0x64e8('0xb1')],'deviceType':_0xb86732[_0x64e8('0xb0')][_0x64e8('0x3e')],'formData':JSON[_0x64e8('0x23')](_0x4a63eb['body'])};var _0x557d79={'ChatWebsiteId':_0x4a63eb[_0x64e8('0x53')]['id'],'closed':![]};if(_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')]){_0x557d79[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')];return db[_0x64e8('0xb3')][_0x64e8('0x56')]({'where':_0x557d79})[_0x64e8('0x32')](function(_0x4ea4b9){if(_0x4ea4b9){return[_0x4ea4b9,![]];}_0x4e9abd[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')];_0x4e9abd[_0x64e8('0xb4')]=_0x4a63eb[_0x64e8('0x58')]['externalUrl'];return db[_0x64e8('0xb3')][_0x64e8('0x57')](_0x4e9abd)[_0x64e8('0x32')](function(_0x58fb70){return[_0x58fb70,!![]];});});}_0x557d79[_0x64e8('0xb5')]=_0x4bb277['id'];if(_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb6')]&&_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb6')]['id']){_0x557d79['id']=_0x4a63eb[_0x64e8('0x58')]['interaction']['id'];return db['ChatInteraction'][_0x64e8('0x56')]({'where':_0x557d79})['then'](function(_0x21887e){if(_0x21887e){return[_0x21887e,![]];}return db[_0x64e8('0xb3')]['create'](_0x4e9abd)[_0x64e8('0x32')](function(_0x15967f){return[_0x15967f,!![]];});});}return db['ChatInteraction'][_0x64e8('0x57')](_0x4e9abd)[_0x64e8('0x32')](function(_0x770951){return[_0x770951,!![]];});}})[_0x64e8('0xb7')](function(_0x4bf5f8,_0x5c11d1){if(_0x4bf5f8){_0x6ee1ff=_0x5c11d1;if(!_0x5c11d1){var _0x315e6d={'from':(_0x229c09['contact'][_0x64e8('0xb8')]||'')+'\x20'+(_0x229c09[_0x64e8('0xa3')]['lastName']||'')};if(_0x4a63eb[_0x64e8('0x58')]['threadId']&&_0x4a63eb[_0x64e8('0x58')]['messageId']&&_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb2')]!=_0x4a63eb[_0x64e8('0x58')]['messageId']){_0x315e6d[_0x64e8('0xb2')]=_0x4a63eb[_0x64e8('0x58')][_0x64e8('0xb9')];}return _0x4bf5f8['update'](_0x315e6d);}else{return _0x4bf5f8;}}})['then'](function(_0xb05942){_0x229c09[_0x64e8('0xb6')]=_0xb05942[_0x64e8('0x34')]({'plain':!![]});_0x229c09['interaction'][_0x64e8('0xba')]=_0x6ee1ff;if(_0x229c09[_0x64e8('0xb6')]['created']){if(_0x229c09[_0x64e8('0xa0')][_0x64e8('0xbb')]){_0x229c09[_0x64e8('0x9d')][_0x64e8('0xbc')]({'id':0x0,'priority':_0x229c09[_0x64e8('0x9d')][_0x64e8('0x45')]+0x1,'app':_0x64e8('0xbd'),'appdata':_0x64e8('0xbe'),'interval':'*,*,*,*'});}}return db[_0x64e8('0xbf')][_0x64e8('0x57')]({'body':_0x4a63eb[_0x64e8('0x58')]['body'],'ChatWebsiteId':_0x4a63eb[_0x64e8('0x53')]['id'],'ChatInteractionId':_0xb05942['id'],'direction':'in','ContactId':_0x229c09[_0x64e8('0xa3')]['id'],'AttachmentId':_0x4a63eb[_0x64e8('0x58')]['AttachmentId']});})[_0x64e8('0x32')](function(_0x13accb){_0x229c09[_0x64e8('0x25')]=_0x13accb;if(_0x229c09[_0x64e8('0xb6')]['UserId']){return db[_0x64e8('0xc0')][_0x64e8('0x56')]({'attributes':['id',_0x64e8('0x39')],'where':{'id':_0x229c09[_0x64e8('0xb6')][_0x64e8('0xc1')]}})['then'](function(_0x36d01f){if(_0x36d01f){_0x229c09['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36d01f[_0x64e8('0x39')]+','+(_0x229c09[_0x64e8('0xa0')]['waitForTheAssignedAgent']||0xa),'interval':_0x64e8('0xc2')});_0x229c09[_0x64e8('0xc3')]=!![];}return respondWithRpcPromise(_0x64e8('0xc4'),_0x64e8('0xc5'),_0x229c09);});}return respondWithRpcPromise(_0x64e8('0xc4'),_0x64e8('0xc5'),_0x229c09);})[_0x64e8('0x32')](function(_0x5ad0d7){respondWithRpcPromise(_0x64e8('0xc6'),_0x64e8('0xc6'),{'event':_0x64e8('0x85'),'message':_0x5ad0d7},client9002);return _0x5ad0d7;})[_0x64e8('0x32')](respondWithResult(_0x2953f7,null))['catch'](handleError(_0x2953f7,null));};exports['offline']=function(_0x4a9280,_0x312326,_0x530ffe){var _0xae97e1,_0xcc1dbe,_0x58d946;var _0x31c0ac=[];var _0x38d47c=[];var _0xe83b81={};var _0x43dea9=_0x4a9280[_0x64e8('0xc7')]||[];var _0x4128d7=[];var _0x10bbf4;return db['CmContact'][_0x64e8('0x60')]()[_0x64e8('0x32')](function(_0x350e64){if(!_0x350e64){throw new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))](_0x64e8('0x8b'));}_0x38d47c=_['difference'](_['keys'](_0x350e64),[_0x64e8('0x8c'),'updatedAt']);_0x31c0ac=_[_0x64e8('0x8e')](_[_0x64e8('0x41')](_0x350e64),[_0x64e8('0x8c'),'updatedAt',_0x64e8('0xc8'),_0x64e8('0x8f')]);if(_0x4a9280[_0x64e8('0x58')]['id']){delete _0x4a9280[_0x64e8('0x58')]['id'];}if(_[_0x64e8('0x7a')](_0x4a9280['body']['from'])){throw _0x312326['status'](0x1f4)[_0x64e8('0xc9')](new db[(_0x64e8('0x8a'))]['ValidationError'](_0x64e8('0x92')));}if(_['isNil'](_0x4a9280[_0x64e8('0x58')][_0x64e8('0x58')])||_0x4a9280['body'][_0x64e8('0x58')]===''){throw _0x312326[_0x64e8('0x28')](0x1f4)['send'](new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))](_0x64e8('0x93')));}if(_[_0x64e8('0x7a')](_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')])){throw _0x312326[_0x64e8('0x28')](0x1f4)['send'](new db['Sequelize'][(_0x64e8('0x91'))](_0x64e8('0xcb')+_0x31c0ac));}if(!_[_0x64e8('0x94')](_0x31c0ac,_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')])){throw _0x312326[_0x64e8('0x28')](0x1f4)[_0x64e8('0xc9')](new db[(_0x64e8('0x8a'))][(_0x64e8('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31c0ac));}_0xe83b81[_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')]]=_0x4a9280['body'][_0x64e8('0x90')];})[_0x64e8('0x32')](function(){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x4a9280['params']['id']},'include':[{'model':db[_0x64e8('0xcc')],'as':_0x64e8('0xa1')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x312326,null))[_0x64e8('0x32')](function(_0x26eee6){if(_0x26eee6&&_0x26eee6['List']){_0xcc1dbe=_0x26eee6;var _0xf37083=_['defaults'](_0x4a9280[_0x64e8('0x58')],{'firstName':_0x4a9280[_0x64e8('0x58')][_0x64e8('0x90')],'phone':_0x4a9280[_0x64e8('0x58')]['from'],'ListId':_0x26eee6[_0x64e8('0x8f')]});_0xf37083[_0x4a9280[_0x64e8('0x58')][_0x64e8('0xca')]]=_0x4a9280[_0x64e8('0x58')]['from'];return db['CmContact'][_0x64e8('0xcd')]({'where':_0xe83b81,'defaults':_0xf37083});}})[_0x64e8('0xb7')](function(_0x507657){if(_0x507657){_0x58d946=_0x507657;var _0x336ffb=fs[_0x64e8('0xce')](path[_0x64e8('0x7c')](config['root'],_0x64e8('0xcf')),_0x64e8('0xd0'));var _0x11213c=ejs[_0x64e8('0xd1')](_0x336ffb,{'body':_[_0x64e8('0xd2')](_0x4a9280[_0x64e8('0x58')][_0x64e8('0x58')]),'bodyTitle':_0xcc1dbe[_0x64e8('0xd3')]});return db['ChatOfflineMessage'][_0x64e8('0x57')]({'body':_0x11213c,'ContactId':_0x507657['id'],'ChatWebsiteId':_0xcc1dbe['id']});}})[_0x64e8('0x32')](function(_0x515537){_0x10bbf4=_0x515537;if(_0x43dea9[_0x64e8('0x45')]){var _0x259cf1=_0x43dea9[_0x64e8('0x3c')](function(_0x55ef48){return{'name':_0x55ef48['originalname'],'basename':_0x55ef48[_0x64e8('0x71')],'type':_0x55ef48[_0x64e8('0xd4')],'ChatOfflineMessageId':_0x515537['id']};});_0x4128d7=_0x259cf1[_0x64e8('0x3c')](_0x8a55b7=>{var _0x49d697={'filename':_0x8a55b7[_0x64e8('0x39')],'path':path[_0x64e8('0x7c')](config[_0x64e8('0x77')],_0x64e8('0xd5'),_0x64e8('0xc7'),_0x64e8('0xd6'),_0x64e8('0xd7'),_0x8a55b7[_0x64e8('0xd8')])};return _0x49d697;});if(!_0xcc1dbe[_0x64e8('0xd9')]){return db[_0x64e8('0xda')]['transaction'](function(_0x49470a){return db['Attachment'][_0x64e8('0xdb')](_0x259cf1,{'transaction':_0x49470a});});}}})[_0x64e8('0x32')](function(){if(_0x10bbf4){_0xae97e1=_0x10bbf4;return db['MailAccount']['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x64e8('0xdc'),'raw':!![]}]});}})[_0x64e8('0x32')](function(_0x4b7170){if(_0x4b7170&&_0x4b7170[_0x64e8('0xdc')]&&_0xcc1dbe[_0x64e8('0xdd')]&&_0xcc1dbe[_0x64e8('0xde')]){var _0x5c0691={'tls':{'rejectUnauthorized':![]}};if(_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xdf')]){_0x5c0691[_0x64e8('0xdf')]=_0x4b7170['Smtp'][_0x64e8('0xdf')];}else{_0x5c0691['host']=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe0')];_0x5c0691['port']=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe1')];_0x5c0691[_0x64e8('0xe2')]=_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe2')];}if(_0x4b7170['Smtp']['authentication']){_0x5c0691[_0x64e8('0xe3')]={'user':_0x4b7170[_0x64e8('0xdc')][_0x64e8('0x59')],'pass':_0x4b7170[_0x64e8('0xdc')][_0x64e8('0xe4')]};}return respondWithRpcPromise(_0x64e8('0xe5'),_0x64e8('0xe6'),{'account':_0x5c0691,'message':{'from':util[_0x64e8('0xac')]('\x22%s\x22\x20<%s>',_0x4b7170[_0x64e8('0x39')],_0x4b7170[_0x64e8('0xe7')]||_0x4b7170[_0x64e8('0xdc')][_0x64e8('0x59')]),'to':_0xcc1dbe[_0x64e8('0xde')],'subject':_0xcc1dbe[_0x64e8('0xe8')],'html':_0xae97e1[_0x64e8('0x58')],'attachments':_0x4128d7}},client9003)[_0x64e8('0x32')](function(){return _0xae97e1;})['catch'](function(_0x4e53cb){console[_0x64e8('0x24')](_0x4e53cb);});}})[_0x64e8('0x32')](function(){if(_0xcc1dbe&&_0xcc1dbe[_0x64e8('0xd9')]&&_0xcc1dbe[_0x64e8('0xe9')]){var _0x1fb4bb=[];if(_0x43dea9[_0x64e8('0x45')]){_0x1fb4bb=_0x43dea9['map'](function(_0xc22658){return{'name':_0xc22658['originalname'],'basename':_0xc22658[_0x64e8('0x71')],'type':_0xc22658[_0x64e8('0xd4')],'ChatOfflineMessageId':_0x10bbf4['id']};});}var _0x283fef;if(!_[_0x64e8('0x7a')](_0xcc1dbe[_0x64e8('0xea')])){var _0xc662b8=_[_0x64e8('0x3c')](_0x4a9280['body'],function(_0xa8c2b8){return _0xa8c2b8;});var _0x6d5e7f=_['toPairsIn'](_0xc662b8)[0x0];var _0x1b6032=_['mapValues'](_0x6d5e7f,function(_0x47f638){return _0x47f638;});_0x283fef=_0x1b6032[0x1][_0xcc1dbe['subjectOffline']];}var _0x320866={'from':_0x58d946[_0x64e8('0xe7')],'firstName':_0x58d946['firstName'],'lastName':_0x58d946[_0x64e8('0xa8')],'mapKey':_0x64e8('0xe7'),'message':{'from':_0x58d946[_0x64e8('0xe7')],'to':_0xcc1dbe[_0x64e8('0xeb')]['email'],'cc':'','subject':_[_0x64e8('0x7a')](_0x283fef)?_0xcc1dbe[_0x64e8('0xe8')]:_0x283fef,'messageId':'','sentAt':new Date(),'attach':_0x1fb4bb[_0x64e8('0x45')],'attachments':_0x1fb4bb,'originChannel':'Chat','ChatWebsiteId':_0xcc1dbe['id'],'ChatOfflineMessageId':_0xae97e1['id'],'originTo':_0xcc1dbe[_0x64e8('0xeb')][_0x64e8('0xe7')]},'body':_0xae97e1[_0x64e8('0x58')]};var _0x3b56f1={'account':{'id':_0xcc1dbe[_0x64e8('0xe9')]},'body':_0x320866,'log':_0x64e8('0xec')};return respondWithRpcPromise(_0x64e8('0xec'),_0x64e8('0xed'),_0x3b56f1,client9001)[_0x64e8('0x32')](function(){return _0xae97e1;})['catch'](function(_0x53c386){console[_0x64e8('0x24')](_0x53c386);});}return;})[_0x64e8('0x32')](function(){if(_0xae97e1){return _0xae97e1;}})[_0x64e8('0x32')](respondWithResult(_0x312326,null))[_0x64e8('0x51')](function(_0x33f57e){console[_0x64e8('0x24')](_0x64e8('0x51'),_0x33f57e);for(var _0x20f15e of _0x43dea9){var _0xf90ecb=path[_0x64e8('0x7c')](config['root'],_0x64e8('0xd5'),'files',_0x64e8('0xd6'),'offline-chat',_0x20f15e[_0x64e8('0x71')]);fs_extra[_0x64e8('0xee')](_0xf90ecb)[_0x64e8('0x51')](function(_0x75dbd4){console[_0x64e8('0x24')](_0x64e8('0xef'),_0xf90ecb,_0x75dbd4);});}});};exports[_0x64e8('0xf0')]=function(_0x369bbc,_0x48eaa9,_0x1a4ef7){return db[_0x64e8('0xb3')][_0x64e8('0x56')]({'where':{'id':_0x369bbc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x48eaa9,null))[_0x64e8('0x32')](function(_0xd02b03){if(_0xd02b03){return _0xd02b03[_0x64e8('0xf0')](_0x369bbc[_0x64e8('0x58')]['ids'],_[_0x64e8('0xf1')](_0x369bbc[_0x64e8('0x58')],[_0x64e8('0x6a'),'id'])||{});}})[_0x64e8('0x32')](respondWithResult(_0x48eaa9,null))[_0x64e8('0x51')](handleError(_0x48eaa9,null));};exports[_0x64e8('0xf2')]=function(_0x1f27bb,_0x91513a,_0x9e66a3){var _0x188fdb={'raw':![],'where':{}};var _0x5de474={};var _0x391230={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x1f27bb['params']['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x91513a,null))[_0x64e8('0x32')](function(_0x27a126){if(_0x27a126){_0x5de474[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0xb3')][_0x64e8('0x66')]);_0x5de474[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x1f27bb['query']);_0x5de474[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x5de474[_0x64e8('0x40')],_0x5de474[_0x64e8('0x42')]);_0x188fdb[_0x64e8('0x44')]=_['intersection'](_0x5de474[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x1f27bb[_0x64e8('0x42')]['fields']));_0x188fdb[_0x64e8('0x44')]=_0x188fdb[_0x64e8('0x44')]['length']?_0x188fdb[_0x64e8('0x44')]:_0x5de474[_0x64e8('0x40')];if(!_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x46')]('nolimit')){_0x188fdb['limit']=qs[_0x64e8('0x2b')](_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x188fdb['offset']=qs['offset'](_0x1f27bb['query'][_0x64e8('0x2d')]);}_0x188fdb[_0x64e8('0x67')]=qs['sort'](_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x48')]);_0x188fdb['where']=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x1f27bb[_0x64e8('0x42')],_0x5de474['filters']));_0x188fdb['where'][_0x64e8('0x62')]=_0x27a126['id'];if(_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x188fdb['where']=_[_0x64e8('0x4c')](_0x188fdb[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x188fdb['attributes'],function(_0x429375){var _0xac2ea8={};_0xac2ea8[_0x429375]={'$like':'%'+_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0xac2ea8;})});}_0x188fdb=_[_0x64e8('0x4c')]({},_0x188fdb,_0x1f27bb[_0x64e8('0x4e')]);return db[_0x64e8('0xb3')][_0x64e8('0x2c')]({'where':_0x188fdb[_0x64e8('0x4d')]})[_0x64e8('0x32')](function(_0x136f4d){_0x391230['count']=_0x136f4d;if(_0x1f27bb[_0x64e8('0x42')][_0x64e8('0x4f')]){_0x188fdb[_0x64e8('0x55')]=[{'model':db['CmContact'],'as':_0x64e8('0xf3'),'required':![]},{'model':db[_0x64e8('0xc0')],'as':_0x64e8('0xf4'),'attributes':['name',_0x64e8('0xf5'),_0x64e8('0xf6')],'required':![]},{'model':db[_0x64e8('0xf7')],'as':_0x64e8('0xf8'),'attributes':['id',_0x64e8('0x39'),'color'],'where':_0x1f27bb['query'][_0x64e8('0xf9')]?{'id':_0x1f27bb[_0x64e8('0x42')]['tag']}:undefined,'required':_0x1f27bb[_0x64e8('0x42')][_0x64e8('0xf9')]?!![]:![]}];}return db[_0x64e8('0xb3')][_0x64e8('0x50')](_0x188fdb);})[_0x64e8('0x32')](function(_0x2c36a7){_0x391230[_0x64e8('0x68')]=_0x2c36a7;return _0x391230;});}})[_0x64e8('0x32')](respondWithFilteredResult(_0x91513a,_0x188fdb))[_0x64e8('0x51')](handleError(_0x91513a,null));};function iftimePromise(_0x6ed0f2,_0x3f57e4){return respondWithRpcPromise(_0x64e8('0xfa'),'getSnippet',{'command':_0x3f57e4['timezone']?util[_0x64e8('0xac')](_0x64e8('0xfb'),_0x6ed0f2['interval'],_0x3f57e4[_0x64e8('0xfc')]):util[_0x64e8('0xac')](_0x64e8('0xfd'),_0x6ed0f2[_0x64e8('0xfe')])},client9002)['then'](function(_0x5fbaf7){var _0x1800ec=_0x5fbaf7&&_0x5fbaf7[_0x64e8('0xff')](_0x64e8('0x100'))>=0x0?!![]:![];logger[_0x64e8('0x26')](_0x64e8('0x101'),_0x3f57e4['id'],_0x6ed0f2['id'],_0x6ed0f2['interval'],_0x1800ec?_0x64e8('0x102'):'OFFLINE',_0x3f57e4[_0x64e8('0xfc')]?_0x3f57e4[_0x64e8('0xfc')]:_0x64e8('0x103'));return _0x1800ec;})[_0x64e8('0x51')](function(_0x2f2323){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3f57e4['id'],_0x6ed0f2['id'],_0x6ed0f2[_0x64e8('0xfe')],util['inspect'](_0x2f2323,{'showHidden':![],'depth':null}),_0x3f57e4['timezone']?_0x3f57e4[_0x64e8('0xfc')]:_0x64e8('0x103'));return![];});}exports[_0x64e8('0x104')]=function(_0x4dace5,_0x5b5734,_0x5cdcc8){var _0x4f28c4=0x0;var _0x46777d=0x0;var _0x517448=![];var _0x10bec7;var _0x36908f;return db['ChatWebsite']['find']({'where':{'id':_0x4dace5[_0x64e8('0x53')]['id']},'include':[{'model':db['Interval'],'as':_0x64e8('0x105'),'include':[{'model':db[_0x64e8('0x105')],'as':_0x64e8('0x106'),'attributes':['id',_0x64e8('0xfe')],'raw':!![]}]}]})[_0x64e8('0x32')](handleEntityNotFound(_0x5b5734,null))['then'](function(_0x2cb74e){if(_0x2cb74e){_0x10bec7=_0x2cb74e;return _0x2cb74e[_0x64e8('0x107')]({'raw':!![]});}})['then'](function(_0x22be08){if(_0x10bec7){if(_0x22be08){_0x36908f=_0x22be08;}}return require(_0x64e8('0x16'))[_0x64e8('0x79')]();})[_0x64e8('0x32')](function(_0x3a0b09){if(_0x3a0b09){_0x46777d=_0x3a0b09[_0x64e8('0x108')];_0x517448=_0x3a0b09['custom'];}})[_0x64e8('0x32')](function(){return db[_0x64e8('0xb3')][_0x64e8('0x2c')]({'where':{'closed':![]}});})[_0x64e8('0x32')](function(_0x39b02d){_0x4f28c4=_0x39b02d;if(_0x46777d&&_0x39b02d>_0x46777d){return db['License']['findOne']({'where':{'id':0x1}})[_0x64e8('0x32')](function(_0x443f37){if(_0x443f37){_0x443f37[_0x64e8('0x109')](_0x64e8('0x10a'));}});}})[_0x64e8('0x32')](function(){if(_0x10bec7['Interval']&&_0x10bec7['Interval'][_0x64e8('0x106')]){var _0x190f54=[];for(var _0xbb5d96=0x0;_0xbb5d96<_0x10bec7[_0x64e8('0x105')][_0x64e8('0x106')][_0x64e8('0x45')];_0xbb5d96++){var _0x28e916=_0x10bec7[_0x64e8('0x105')]['Intervals'][_0xbb5d96]['get']({'plain':!![]});_0x190f54[_0x64e8('0xbc')](iftimePromise(_0x28e916,_0x10bec7));}return BPromise[_0x64e8('0x10b')](_0x190f54)[_0x64e8('0x32')](function(_0x5695d7){return _['some'](_0x5695d7);});}else{return!![];}})[_0x64e8('0x32')](function(_0xc101bb){var _0x2e226a=fs[_0x64e8('0xce')](path[_0x64e8('0x7c')](config['root'],'server/files/chat/iframe.ejs'),_0x64e8('0xd0'));var _0x1fd4f4={'remote':_0x10bec7[_0x64e8('0x10c')],'query':querystring[_0x64e8('0x23')](_[_0x64e8('0x4c')](_0x10bec7[_0x64e8('0x34')]({'plain':!![]}),{'customerIp':_0x4dace5[_0x64e8('0x87')]['x-forwarded-for']||_0x4dace5[_0x64e8('0x87')]['x-real-ip']||_0x4dace5[_0x64e8('0x10d')][_0x64e8('0x10e')]||_0x4dace5['ip'],'referer':_0x4dace5[_0x64e8('0x87')]['referer'],'openedInteractions':_0x4f28c4,'maxInteractions':_0x46777d,'virtual':_0x517448['virtual'],'online':_0xc101bb,'custom':_0x517448}))['replace'](/'/g,'\x5c\x27')};_0x5b5734[_0x64e8('0xc9')](ejs[_0x64e8('0xd1')](Mustache['render'](_0x2e226a,_0x1fd4f4),{'proactiveActions':_0x36908f,'alignment':_0x10bec7[_0x64e8('0x10f')],'verticalAlignment':_0x10bec7[_0x64e8('0x110')],'div_color':_0x10bec7[_0x64e8('0x111')],'text_color':_0x10bec7['textColor'],'button_color':_0x10bec7[_0x64e8('0x112')],'background_color':_0x10bec7[_0x64e8('0x113')]}));})[_0x64e8('0x51')](handleError(_0x5b5734,null));};exports[_0x64e8('0x114')]=function(_0x599811,_0xe39d74,_0xf97a45){return db['ChatWebsite'][_0x64e8('0x65')]({'where':{'id':_0x599811[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0xe39d74,null))[_0x64e8('0x32')](function(_0x58da83){if(_0x58da83){return db[_0x64e8('0xda')][_0x64e8('0x115')](function(_0x5917dd){return db[_0x64e8('0x9a')][_0x64e8('0x33')]({'where':{'ChatWebsiteId':_0x599811[_0x64e8('0x53')]['id']},'transaction':_0x5917dd})[_0x64e8('0x32')](function(_0x464016){var _0x5456eb=_[_0x64e8('0x3c')](_0x599811[_0x64e8('0x58')],function(_0x153157){_0x153157[_0x64e8('0x62')]=_0x599811[_0x64e8('0x53')]['id'];return _0x153157;});return db['ChatApplication']['bulkCreate'](_0x5456eb,{'transaction':_0x5917dd});});})[_0x64e8('0x32')](function(){return db[_0x64e8('0x9a')][_0x64e8('0x116')]({'where':{'ChatWebsiteId':_0x599811[_0x64e8('0x53')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0xe39d74,null))['catch'](handleError(_0xe39d74,null));};exports['getApplications']=function(_0x3136be,_0x55665f,_0x32dce4){var _0x4c00a3={};var _0x401654={};var _0x4fa7fa;var _0x3ae010;return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x3136be[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x55665f,null))[_0x64e8('0x32')](function(_0x2b5ea1){if(_0x2b5ea1){_0x4fa7fa=_0x2b5ea1;_0x401654['model']=_[_0x64e8('0x41')](db[_0x64e8('0x9a')]['rawAttributes']);_0x401654['query']=_['keys'](_0x3136be[_0x64e8('0x42')]);_0x401654['filters']=_[_0x64e8('0x54')](_0x401654[_0x64e8('0x40')],_0x401654[_0x64e8('0x42')]);_0x4c00a3[_0x64e8('0x44')]=_[_0x64e8('0x54')](_0x401654[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x3136be['query'][_0x64e8('0x43')]));_0x4c00a3[_0x64e8('0x44')]=_0x4c00a3[_0x64e8('0x44')][_0x64e8('0x45')]?_0x4c00a3[_0x64e8('0x44')]:_0x401654[_0x64e8('0x40')];_0x4c00a3[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x48')]);_0x4c00a3[_0x64e8('0x4d')]=qs[_0x64e8('0x4a')](_[_0x64e8('0x49')](_0x3136be[_0x64e8('0x42')],_0x401654[_0x64e8('0x4a')]));if(_0x3136be[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x4c00a3[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x4c00a3[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x4c00a3[_0x64e8('0x44')],function(_0x174237){var _0x503695={};_0x503695[_0x174237]={'$like':'%'+_0x3136be[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0x503695;})});}_0x4c00a3=_[_0x64e8('0x4c')]({},_0x4c00a3,_0x3136be[_0x64e8('0x4e')]);return _0x4fa7fa[_0x64e8('0x117')](_0x4c00a3);}})[_0x64e8('0x32')](function(_0x5293a2){if(_0x5293a2){_0x3ae010=_0x5293a2['length'];if(!_0x3136be[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x4c00a3[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x4c00a3[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x3136be[_0x64e8('0x42')][_0x64e8('0x2d')]);}return _0x4fa7fa[_0x64e8('0x117')](_0x4c00a3);}})['then'](function(_0x495ca4){if(_0x495ca4){return _0x495ca4?{'count':_0x3ae010,'rows':_0x495ca4}:null;}})[_0x64e8('0x32')](respondWithResult(_0x55665f,null))[_0x64e8('0x51')](handleError(_0x55665f,null));};exports[_0x64e8('0x118')]=function(_0x454f78,_0x42a02f,_0x26d3c5){return db[_0x64e8('0x119')][_0x64e8('0x56')]({'where':{'id':_0x454f78[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0x42a02f,null))[_0x64e8('0x32')](function(_0x31d833){if(_0x31d833){return _0x31d833['addProactiveActions'](_0x454f78[_0x64e8('0x58')][_0x64e8('0x6a')],_[_0x64e8('0xf1')](_0x454f78[_0x64e8('0x58')],['ids','id'])||{});}})[_0x64e8('0x32')](respondWithResult(_0x42a02f,null))[_0x64e8('0x51')](handleError(_0x42a02f,null));};exports[_0x64e8('0x107')]=function(_0x2b5ac2,_0xc1782c,_0x256d2e){var _0x4a1b09={};var _0x268f10={};var _0xbc5036;var _0x4a313d;return db['ChatWebsite'][_0x64e8('0x65')]({'where':{'id':_0x2b5ac2[_0x64e8('0x53')]['id']}})['then'](handleEntityNotFound(_0xc1782c,null))['then'](function(_0x15d486){if(_0x15d486){_0xbc5036=_0x15d486;_0x268f10[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x11a')][_0x64e8('0x66')]);_0x268f10[_0x64e8('0x42')]=_[_0x64e8('0x41')](_0x2b5ac2[_0x64e8('0x42')]);_0x268f10[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x268f10[_0x64e8('0x40')],_0x268f10[_0x64e8('0x42')]);_0x4a1b09[_0x64e8('0x44')]=_['intersection'](_0x268f10['model'],qs[_0x64e8('0x43')](_0x2b5ac2[_0x64e8('0x42')][_0x64e8('0x43')]));_0x4a1b09[_0x64e8('0x44')]=_0x4a1b09[_0x64e8('0x44')]['length']?_0x4a1b09[_0x64e8('0x44')]:_0x268f10[_0x64e8('0x40')];_0x4a1b09[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x2b5ac2['query'][_0x64e8('0x48')]);_0x4a1b09['where']=qs[_0x64e8('0x4a')](_['pick'](_0x2b5ac2[_0x64e8('0x42')],_0x268f10[_0x64e8('0x4a')]));if(_0x2b5ac2[_0x64e8('0x42')]['filter']){_0x4a1b09['where']=_['merge'](_0x4a1b09['where'],{'$or':_[_0x64e8('0x3c')](_0x4a1b09['attributes'],function(_0x31f75){var _0x2b5354={};_0x2b5354[_0x31f75]={'$like':'%'+_0x2b5ac2[_0x64e8('0x42')][_0x64e8('0x4b')]+'%'};return _0x2b5354;})});}_0x4a1b09=_[_0x64e8('0x4c')]({},_0x4a1b09,_0x2b5ac2[_0x64e8('0x4e')]);return _0xbc5036[_0x64e8('0x107')](_0x4a1b09);}})[_0x64e8('0x32')](function(_0x24ff48){if(_0x24ff48){_0x4a313d=_0x24ff48['length'];if(!_0x2b5ac2['query'][_0x64e8('0x46')](_0x64e8('0x47'))){_0x4a1b09[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x2b5ac2[_0x64e8('0x42')]['limit']);_0x4a1b09[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x2b5ac2[_0x64e8('0x42')]['offset']);}return _0xbc5036[_0x64e8('0x107')](_0x4a1b09);}})[_0x64e8('0x32')](function(_0x50ca08){if(_0x50ca08){return _0x50ca08?{'count':_0x4a313d,'rows':_0x50ca08}:null;}})[_0x64e8('0x32')](respondWithResult(_0xc1782c,null))[_0x64e8('0x51')](handleError(_0xc1782c,null));};exports[_0x64e8('0x11b')]=function(_0x2f928a,_0x5388b6,_0x1194d6){var _0x3437c4=_0x2f928a[_0x64e8('0x42')][_0x64e8('0x11c')]===_0x64e8('0x11d')?_0x64e8('0x11e'):'onlineForm';return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'attributes':['id',_0x3437c4],'where':{'id':_0x2f928a['params']['id']}})['then'](handleEntityNotFound(_0x5388b6,null))['then'](function(_0x3750b9){if(_0x3750b9){var _0x5dde5a=_0x3750b9[_0x3437c4];var _0x34893b=_0x5dde5a&&_0x5dde5a[_0x64e8('0x11f')]?_0x5dde5a[_0x64e8('0x11f')]:[];_0x5388b6[_0x64e8('0xc9')]({'fromKey':_[_0x64e8('0x7a')](_0x5dde5a['fromKey'])?undefined:_0x5dde5a[_0x64e8('0x120')],'count':_0x34893b[_0x64e8('0x45')],'rows':_0x34893b});}})['catch'](handleError(_0x5388b6,null));};exports[_0x64e8('0x121')]=function(_0x4b2877,_0x47ca04,_0x15a218){var _0x32e053={'raw':![],'where':{}};var _0x2b86e1={};var _0x2ffff4={'count':0x0,'rows':[]};return db[_0x64e8('0x3d')]['findOne']({'where':{'id':_0x4b2877[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x47ca04,null))['then'](function(_0xe785f8){if(_0xe785f8){_0x2b86e1[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0x122')]['rawAttributes']);_0x2b86e1[_0x64e8('0x42')]=_['keys'](_0x4b2877[_0x64e8('0x42')]);_0x2b86e1[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x2b86e1[_0x64e8('0x40')],_0x2b86e1['query']);_0x32e053['attributes']=_[_0x64e8('0x54')](_0x2b86e1[_0x64e8('0x40')],qs[_0x64e8('0x43')](_0x4b2877[_0x64e8('0x42')]['fields']));_0x32e053[_0x64e8('0x44')]=_0x32e053[_0x64e8('0x44')][_0x64e8('0x45')]?_0x32e053[_0x64e8('0x44')]:_0x2b86e1['model'];if(!_0x4b2877[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x32e053['limit']=qs['limit'](_0x4b2877[_0x64e8('0x42')]['limit']);_0x32e053[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x4b2877[_0x64e8('0x42')][_0x64e8('0x2d')]);}_0x32e053[_0x64e8('0x67')]=qs[_0x64e8('0x48')](_0x4b2877['query'][_0x64e8('0x48')]);_0x32e053[_0x64e8('0x4d')]=qs['filters'](_[_0x64e8('0x49')](_0x4b2877[_0x64e8('0x42')],_0x2b86e1['filters']));_0x32e053[_0x64e8('0x4d')][_0x64e8('0x62')]=_0xe785f8['id'];if(_0x4b2877[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x32e053['where']=_[_0x64e8('0x4c')](_0x32e053[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x32e053[_0x64e8('0x44')],function(_0x231401){var _0x1c1926={};_0x1c1926[_0x231401]={'$like':'%'+_0x4b2877[_0x64e8('0x42')]['filter']+'%'};return _0x1c1926;})});}_0x32e053=_[_0x64e8('0x4c')]({},_0x32e053,_0x4b2877[_0x64e8('0x4e')]);return db[_0x64e8('0x122')][_0x64e8('0x2c')]({'where':_0x32e053['where']})[_0x64e8('0x32')](function(_0x2eef8b){_0x2ffff4[_0x64e8('0x2c')]=_0x2eef8b;if(_0x4b2877[_0x64e8('0x42')]['includeAll']){_0x32e053[_0x64e8('0x55')]=[{'all':!![]}];}else{_0x32e053[_0x64e8('0x55')]=[{'model':db[_0x64e8('0x97')],'as':_0x64e8('0xf3'),'required':![]},{'model':db[_0x64e8('0x123')],'as':_0x64e8('0x124'),'required':![]}];}return db['ChatOfflineMessage'][_0x64e8('0x50')](_0x32e053);})[_0x64e8('0x32')](function(_0x33492e){_0x2ffff4['rows']=_0x33492e;return _0x2ffff4;});}})['then'](respondWithFilteredResult(_0x47ca04,_0x32e053))['catch'](handleError(_0x47ca04,null));};exports['addAgents']=function(_0x57680d,_0x45298e,_0x211d2c){return db[_0x64e8('0x3d')][_0x64e8('0x56')]({'where':{'id':_0x57680d['params']['id']}})['then'](handleEntityNotFound(_0x45298e,null))['then'](function(_0x112e51){if(_0x112e51){return _0x112e51[_0x64e8('0x125')](_0x57680d[_0x64e8('0x58')]['ids'],_[_0x64e8('0xf1')](_0x57680d['body'],[_0x64e8('0x6a'),'id'])||{})[_0x64e8('0xb7')](function(_0x4905a2){for(var _0x6cde4f=0x0;_0x6cde4f<_0x57680d[_0x64e8('0x58')][_0x64e8('0x6a')][_0x64e8('0x45')];_0x6cde4f+=0x1){socket[_0x64e8('0x126')](_0x64e8('0x127'),{'UserId':Number(_0x57680d[_0x64e8('0x58')][_0x64e8('0x6a')][_0x6cde4f]),'ChatWebsiteId':Number(_0x57680d[_0x64e8('0x53')]['id'])});}return _0x4905a2;});}})['then'](respondWithResult(_0x45298e,null))[_0x64e8('0x51')](handleError(_0x45298e,null));};exports[_0x64e8('0x128')]=function(_0x12d95e,_0x311c73,_0x343cb6){return db['ChatWebsite']['find']({'where':{'id':_0x12d95e[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x311c73,null))[_0x64e8('0x32')](function(_0xbb6f15){if(_0xbb6f15){return _0xbb6f15[_0x64e8('0x128')](_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')])[_0x64e8('0x32')](function(){if(_[_0x64e8('0x129')](_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')])){for(var _0x52ead2=0x0;_0x52ead2<_0x12d95e[_0x64e8('0x42')]['ids']['length'];_0x52ead2+=0x1){socket[_0x64e8('0x126')](_0x64e8('0x12a'),{'UserId':Number(_0x12d95e[_0x64e8('0x42')][_0x64e8('0x6a')][_0x52ead2]),'ChatWebsiteId':Number(_0x12d95e[_0x64e8('0x53')]['id'])});}}else{socket[_0x64e8('0x126')](_0x64e8('0x12a'),{'UserId':Number(_0x12d95e['query'][_0x64e8('0x6a')]),'ChatWebsiteId':Number(_0x12d95e[_0x64e8('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x311c73,null))['catch'](handleError(_0x311c73,null));};exports[_0x64e8('0x12b')]=function(_0x166bbc,_0x1d4af0,_0x3d9c27){var _0x3458bf={};var _0x23fada={};var _0x2adfbc;var _0x5ae058;return db[_0x64e8('0x3d')][_0x64e8('0x65')]({'where':{'id':_0x166bbc[_0x64e8('0x53')]['id']}})[_0x64e8('0x32')](handleEntityNotFound(_0x1d4af0,null))[_0x64e8('0x32')](function(_0x2333a8){if(_0x2333a8){_0x2adfbc=_0x2333a8;_0x23fada[_0x64e8('0x40')]=_[_0x64e8('0x41')](db[_0x64e8('0xc0')]['rawAttributes']);_0x23fada['query']=_[_0x64e8('0x41')](_0x166bbc['query']);_0x23fada[_0x64e8('0x4a')]=_[_0x64e8('0x54')](_0x23fada[_0x64e8('0x40')],_0x23fada[_0x64e8('0x42')]);_0x3458bf['attributes']=_[_0x64e8('0x54')](_0x23fada['model'],qs['fields'](_0x166bbc[_0x64e8('0x42')][_0x64e8('0x43')]));_0x3458bf['attributes']=_0x3458bf[_0x64e8('0x44')][_0x64e8('0x45')]?_0x3458bf[_0x64e8('0x44')]:_0x23fada[_0x64e8('0x40')];_0x3458bf['order']=qs['sort'](_0x166bbc['query']['sort']);_0x3458bf[_0x64e8('0x4d')]=qs['filters'](_[_0x64e8('0x49')](_0x166bbc[_0x64e8('0x42')],_0x23fada['filters']));if(_0x166bbc[_0x64e8('0x42')][_0x64e8('0x4b')]){_0x3458bf[_0x64e8('0x4d')]=_[_0x64e8('0x4c')](_0x3458bf[_0x64e8('0x4d')],{'$or':_[_0x64e8('0x3c')](_0x3458bf[_0x64e8('0x44')],function(_0x1abd0e){var _0x42e054={};_0x42e054[_0x1abd0e]={'$like':'%'+_0x166bbc['query'][_0x64e8('0x4b')]+'%'};return _0x42e054;})});}_0x3458bf=_[_0x64e8('0x4c')]({},_0x3458bf,_0x166bbc['options']);return _0x2adfbc[_0x64e8('0x12b')](_0x3458bf);}})[_0x64e8('0x32')](function(_0x46a115){if(_0x46a115){_0x5ae058=_0x46a115[_0x64e8('0x45')];if(!_0x166bbc[_0x64e8('0x42')][_0x64e8('0x46')](_0x64e8('0x47'))){_0x3458bf[_0x64e8('0x2b')]=qs[_0x64e8('0x2b')](_0x166bbc[_0x64e8('0x42')][_0x64e8('0x2b')]);_0x3458bf[_0x64e8('0x2d')]=qs[_0x64e8('0x2d')](_0x166bbc[_0x64e8('0x42')]['offset']);}return _0x2adfbc[_0x64e8('0x12b')](_0x3458bf);}})['then'](function(_0x54c139){if(_0x54c139){return _0x54c139?{'count':_0x5ae058,'rows':_0x54c139}:null;}})[_0x64e8('0x32')](respondWithResult(_0x1d4af0,null))[_0x64e8('0x51')](handleError(_0x1d4af0,null));}; \ No newline at end of file +var _0xa595=['format','%s\x20%s','unknown','version','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','close','unmanaged','ChatMessage','contact','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','utf8','render','toPairs','ChatOfflineMessage','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','custom','License','increment','chatLicenseExceeded','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','color_button','backgroundColor','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','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/utils','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','ChatWebsites','UserProfileResource','destroy','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','pick','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','ids','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','Contacts','from','customerIp','cf-connecting-ip','first','split','firstName','lastName','x-real-port','referer','browser'];(function(_0x9cf85e,_0x3b53c2){var _0x31ac45=function(_0xd9dc7){while(--_0xd9dc7){_0x9cf85e['push'](_0x9cf85e['shift']());}};_0x31ac45(++_0x3b53c2);}(_0xa595,0x1ac));var _0x5a59=function(_0x27dc9c,_0x19aa82){_0x27dc9c=_0x27dc9c-0x0;var _0x3201dc=_0xa595[_0x27dc9c];return _0x3201dc;};'use strict';var emlformat=require(_0x5a59('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5a59('0x1'));var rp=require(_0x5a59('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a59('0x3'));var util=require('util');var path=require(_0x5a59('0x4'));var sox=require(_0x5a59('0x5'));var csv=require(_0x5a59('0x6'));var ejs=require(_0x5a59('0x7'));var fs=require('fs');var fs_extra=require(_0x5a59('0x8'));var _=require(_0x5a59('0x9'));var squel=require(_0x5a59('0xa'));var crypto=require(_0x5a59('0xb'));var jsforce=require(_0x5a59('0xc'));var deskjs=require(_0x5a59('0xd'));var toCsv=require(_0x5a59('0x6'));var querystring=require(_0x5a59('0xe'));var Papa=require('papaparse');var Redis=require(_0x5a59('0xf'));var authService=require(_0x5a59('0x10'));var qs=require(_0x5a59('0x11'));var as=require(_0x5a59('0x12'));var hardwareService=require(_0x5a59('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5a59('0x14'));var config=require(_0x5a59('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a59('0x16'))['db'];config[_0x5a59('0x17')]=_[_0x5a59('0x18')](config[_0x5a59('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a59('0x17')]));require(_0x5a59('0x19'))['register'](socket);var jayson=require(_0x5a59('0x1a'));var client=jayson['client'][_0x5a59('0x1b')]({'port':0x232c});var client9002=jayson[_0x5a59('0x1c')][_0x5a59('0x1b')]({'port':0x232a});var client9003=jayson[_0x5a59('0x1c')][_0x5a59('0x1b')]({'port':0x232b});var client9001=jayson['client'][_0x5a59('0x1b')]({'port':0x2329});function respondWithRpcPromise(_0x58567d,_0x1fd4e1,_0x59a395,_0x51a1c2){return new BPromise(function(_0x428730,_0x5db658){var _0x4bd0e7=_0x51a1c2||client;return _0x4bd0e7[_0x5a59('0x1d')](_0x58567d,_0x59a395)[_0x5a59('0x1e')](function(_0x3d5c51){logger[_0x5a59('0x1f')](_0x5a59('0x20'),_0x1fd4e1,_0x5a59('0x21'));logger[_0x5a59('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1fd4e1,'request\x20sent',JSON[_0x5a59('0x23')](_0x3d5c51));if(_0x3d5c51[_0x5a59('0x24')]){if(_0x3d5c51['error'][_0x5a59('0x25')]===0x1f4){logger['error'](_0x5a59('0x20'),_0x1fd4e1,_0x3d5c51[_0x5a59('0x24')][_0x5a59('0x26')]);return _0x5db658(_0x3d5c51[_0x5a59('0x24')]['message']);}logger[_0x5a59('0x24')](_0x5a59('0x20'),_0x1fd4e1,_0x3d5c51[_0x5a59('0x24')][_0x5a59('0x26')]);return _0x428730(_0x3d5c51[_0x5a59('0x24')]['message']);}else{logger['info'](_0x5a59('0x20'),_0x1fd4e1,_0x5a59('0x21'));_0x428730(_0x3d5c51[_0x5a59('0x27')][_0x5a59('0x26')]);}})[_0x5a59('0x28')](function(_0x2822ac){logger['error'](_0x5a59('0x20'),_0x1fd4e1,_0x2822ac);_0x5db658(_0x2822ac);});});}function respondWithStatusCode(_0x38e236,_0x2909ea){_0x2909ea=_0x2909ea||0xcc;return function(_0x14eda2){if(_0x14eda2){return _0x38e236[_0x5a59('0x29')](_0x2909ea);}return _0x38e236[_0x5a59('0x2a')](_0x2909ea)[_0x5a59('0x2b')]();};}function respondWithResult(_0xee7dae,_0x422f35){_0x422f35=_0x422f35||0xc8;return function(_0xac585d){if(_0xac585d){return _0xee7dae[_0x5a59('0x2a')](_0x422f35)[_0x5a59('0x2c')](_0xac585d);}};}function respondWithFilteredResult(_0x5bb467,_0x4e61cd){return function(_0x41ac2a){if(_0x41ac2a){var _0x220a02=typeof _0x4e61cd[_0x5a59('0x2d')]===_0x5a59('0x2e')&&typeof _0x4e61cd['limit']===_0x5a59('0x2e');var _0x45e0b2=_0x41ac2a['count'];var _0x274c3b=_0x220a02?0x0:_0x4e61cd[_0x5a59('0x2d')];var _0x50630d=_0x220a02?_0x41ac2a[_0x5a59('0x2f')]:_0x4e61cd[_0x5a59('0x2d')]+_0x4e61cd[_0x5a59('0x30')];var _0x5bf673;if(_0x50630d>=_0x45e0b2){_0x50630d=_0x45e0b2;_0x5bf673=0xc8;}else{_0x5bf673=0xce;}_0x5bb467['status'](_0x5bf673);return _0x5bb467['set'](_0x5a59('0x31'),_0x274c3b+'-'+_0x50630d+'/'+_0x45e0b2)[_0x5a59('0x2c')](_0x41ac2a);}return null;};}function patchUpdates(_0x3e0287){return function(_0x79df4b){try{jsonpatch[_0x5a59('0x32')](_0x79df4b,_0x3e0287,!![]);}catch(_0x2a7a71){return BPromise['reject'](_0x2a7a71);}return _0x79df4b['save']();};}function saveUpdates(_0x343385,_0x5ad5cf){return function(_0x175a8b){if(_0x175a8b){return _0x175a8b[_0x5a59('0x33')](_0x343385)['then'](function(_0x428658){return _0x428658;});}return null;};}function removeEntity(_0x3f03d6,_0x2a40e3){return function(_0x37b969){if(_0x37b969){return _0x37b969['destroy']()[_0x5a59('0x1e')](function(){var _0x2efbde=_0x37b969['get']({'plain':!![]});var _0x1cf7e8=_0x5a59('0x34');return db[_0x5a59('0x35')][_0x5a59('0x36')]({'where':{'type':_0x1cf7e8,'resourceId':_0x2efbde['id']}})[_0x5a59('0x1e')](function(){return _0x37b969;});})['then'](function(){_0x3f03d6[_0x5a59('0x2a')](0xcc)[_0x5a59('0x2b')]();});}};}function handleEntityNotFound(_0x285483,_0x2318bc){return function(_0x1ad2db){if(!_0x1ad2db){_0x285483[_0x5a59('0x29')](0x194);}return _0x1ad2db;};}function handleError(_0x407b80,_0x24250b){_0x24250b=_0x24250b||0x1f4;return function(_0x56aa75){logger[_0x5a59('0x24')](_0x56aa75['stack']);if(_0x56aa75[_0x5a59('0x37')]){delete _0x56aa75[_0x5a59('0x37')];}_0x407b80[_0x5a59('0x2a')](_0x24250b)[_0x5a59('0x38')](_0x56aa75);};}exports[_0x5a59('0x39')]=function(_0x303522,_0x4c4f4){var _0x13f1d8={'include':[{'model':db[_0x5a59('0x3a')],'as':_0x5a59('0x3b')}]},_0x3b4f19={},_0xa62e88={'count':0x0,'rows':[]};var _0x2a1ddd=_[_0x5a59('0x3c')](db['ChatWebsite'][_0x5a59('0x3d')],function(_0x2bd7cd){return{'name':_0x2bd7cd['fieldName'],'type':_0x2bd7cd[_0x5a59('0x3e')]['key']};});_0x3b4f19[_0x5a59('0x3f')]=_['map'](_0x2a1ddd,_0x5a59('0x37'));_0x3b4f19[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x303522[_0x5a59('0x40')]);_0x3b4f19[_0x5a59('0x42')]=_['intersection'](_0x3b4f19[_0x5a59('0x3f')],_0x3b4f19[_0x5a59('0x40')]);_0x13f1d8[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x3b4f19['model'],qs[_0x5a59('0x45')](_0x303522[_0x5a59('0x40')][_0x5a59('0x45')]));_0x13f1d8[_0x5a59('0x43')]=_0x13f1d8[_0x5a59('0x43')][_0x5a59('0x46')]?_0x13f1d8[_0x5a59('0x43')]:_0x3b4f19[_0x5a59('0x3f')];if(!_0x303522['query'][_0x5a59('0x47')]('nolimit')){_0x13f1d8[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x303522['query'][_0x5a59('0x30')]);_0x13f1d8[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x303522[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x13f1d8[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x303522[_0x5a59('0x40')][_0x5a59('0x49')]);_0x13f1d8['where']=qs[_0x5a59('0x42')](_['pick'](_0x303522[_0x5a59('0x40')],_0x3b4f19[_0x5a59('0x42')]),_0x2a1ddd);if(_0x303522[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x13f1d8[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x13f1d8[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x2a1ddd,function(_0xfd3d47){if(_0xfd3d47['type']!==_0x5a59('0x4d')){var _0x3f7819={};_0x3f7819[_0xfd3d47[_0x5a59('0x37')]]={'$like':'%'+_0x303522[_0x5a59('0x40')]['filter']+'%'};return _0x3f7819;}})});}_0x13f1d8=_[_0x5a59('0x4c')]({},_0x13f1d8,_0x303522[_0x5a59('0x4e')]);var _0x38de76={'where':_0x13f1d8[_0x5a59('0x4b')]};return db[_0x5a59('0x4f')][_0x5a59('0x2f')](_0x38de76)[_0x5a59('0x1e')](function(_0x137e8c){_0xa62e88[_0x5a59('0x2f')]=_0x137e8c;if(_0x303522[_0x5a59('0x40')][_0x5a59('0x50')]){_0x13f1d8[_0x5a59('0x51')]=[{'all':!![]}];}return db[_0x5a59('0x4f')][_0x5a59('0x52')](_0x13f1d8);})['then'](function(_0x2f79ea){_0xa62e88[_0x5a59('0x53')]=_0x2f79ea;return _0xa62e88;})[_0x5a59('0x1e')](respondWithFilteredResult(_0x4c4f4,_0x13f1d8))['catch'](handleError(_0x4c4f4,null));};exports['show']=function(_0x21d8d1,_0x266b1e){var _0xbb4a17={'raw':![],'where':{'id':_0x21d8d1[_0x5a59('0x54')]['id']},'include':[{'model':db[_0x5a59('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1e2725={};_0x1e2725[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x4f')][_0x5a59('0x3d')]);_0x1e2725[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x21d8d1['query']);_0x1e2725[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x1e2725[_0x5a59('0x3f')],_0x1e2725[_0x5a59('0x40')]);_0xbb4a17[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x1e2725['model'],qs[_0x5a59('0x45')](_0x21d8d1[_0x5a59('0x40')][_0x5a59('0x45')]));_0xbb4a17[_0x5a59('0x43')]=_0xbb4a17[_0x5a59('0x43')]['length']?_0xbb4a17[_0x5a59('0x43')]:_0x1e2725[_0x5a59('0x3f')];if(_0x21d8d1[_0x5a59('0x40')][_0x5a59('0x50')]){_0xbb4a17[_0x5a59('0x51')]=[{'all':!![]}];}_0xbb4a17=_[_0x5a59('0x4c')]({},_0xbb4a17,_0x21d8d1[_0x5a59('0x4e')]);return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0xbb4a17)['then'](handleEntityNotFound(_0x266b1e,null))[_0x5a59('0x1e')](respondWithResult(_0x266b1e,null))[_0x5a59('0x28')](handleError(_0x266b1e,null));};exports[_0x5a59('0x56')]=function(_0x415cb5,_0x1699dd){return db[_0x5a59('0x4f')][_0x5a59('0x56')](_0x415cb5[_0x5a59('0x57')],{})['then'](function(_0x42eef0){var _0x2b5a20=_0x415cb5[_0x5a59('0x58')]['get']({'plain':!![]});if(!_0x2b5a20)throw new Error(_0x5a59('0x59'));if(_0x2b5a20['role']==='user'){var _0x433b87=_0x42eef0[_0x5a59('0x5a')]({'plain':!![]});var _0xfe5e6c='ChatWebsites';return db[_0x5a59('0x5b')][_0x5a59('0x55')]({'where':{'name':_0xfe5e6c,'userProfileId':_0x2b5a20['userProfileId']},'raw':!![]})[_0x5a59('0x1e')](function(_0x23f6c9){if(_0x23f6c9&&_0x23f6c9['autoAssociation']===0x0){return db[_0x5a59('0x35')]['create']({'name':_0x433b87['name'],'resourceId':_0x433b87['id'],'type':_0x23f6c9[_0x5a59('0x37')],'sectionId':_0x23f6c9['id']},{})[_0x5a59('0x1e')](function(){return _0x42eef0;});}else{return _0x42eef0;}})[_0x5a59('0x28')](function(_0x182fff){logger[_0x5a59('0x24')](_0x5a59('0x5c'),_0x182fff);throw _0x182fff;});}return _0x42eef0;})[_0x5a59('0x1e')](respondWithResult(_0x1699dd,0xc9))[_0x5a59('0x28')](handleError(_0x1699dd,null));};exports[_0x5a59('0x33')]=function(_0x38d833,_0x55ddbb){if(_0x38d833[_0x5a59('0x57')]['id']){delete _0x38d833['body']['id'];}return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x38d833[_0x5a59('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x5a59('0x3b')}]})[_0x5a59('0x1e')](handleEntityNotFound(_0x55ddbb,null))[_0x5a59('0x1e')](saveUpdates(_0x38d833[_0x5a59('0x57')],null))[_0x5a59('0x1e')](respondWithResult(_0x55ddbb,null))['catch'](handleError(_0x55ddbb,null));};exports[_0x5a59('0x36')]=function(_0x15691b,_0x2c5238){return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x15691b['params']['id']}})['then'](handleEntityNotFound(_0x2c5238,null))[_0x5a59('0x1e')](removeEntity(_0x2c5238,null))[_0x5a59('0x28')](handleError(_0x2c5238,null));};exports[_0x5a59('0x5d')]=function(_0x2fd297,_0x466e32){return db[_0x5a59('0x4f')][_0x5a59('0x5d')]()[_0x5a59('0x1e')](respondWithResult(_0x466e32,null))[_0x5a59('0x28')](handleError(_0x466e32,null));};exports[_0x5a59('0x5e')]=function(_0x546701,_0x51469e,_0x2fa6b7){if(_0x546701[_0x5a59('0x57')]['id']){delete _0x546701[_0x5a59('0x57')]['id'];}return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x546701[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x51469e,null))[_0x5a59('0x1e')](function(_0x2b5965){if(_0x2b5965){_0x546701[_0x5a59('0x57')][_0x5a59('0x5f')]=_0x2b5965['id'];return db['Disposition'][_0x5a59('0x56')](_0x546701['body']);}})['then'](respondWithResult(_0x51469e,null))[_0x5a59('0x28')](handleError(_0x51469e,null));};exports[_0x5a59('0x60')]=function(_0x45b785,_0x16392e,_0x3cecd3){var _0x365ea8={'raw':![],'where':{}};var _0x5aec1f={};var _0x147114={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5a59('0x61')]({'where':{'id':_0x45b785[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x16392e,null))['then'](function(_0x952eba){if(_0x952eba){_0x5aec1f[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db['Disposition'][_0x5a59('0x3d')]);_0x5aec1f[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x45b785['query']);_0x5aec1f[_0x5a59('0x42')]=_['intersection'](_0x5aec1f[_0x5a59('0x3f')],_0x5aec1f[_0x5a59('0x40')]);_0x365ea8[_0x5a59('0x43')]=_['intersection'](_0x5aec1f[_0x5a59('0x3f')],qs[_0x5a59('0x45')](_0x45b785[_0x5a59('0x40')]['fields']));_0x365ea8['attributes']=_0x365ea8[_0x5a59('0x43')][_0x5a59('0x46')]?_0x365ea8[_0x5a59('0x43')]:_0x5aec1f['model'];if(!_0x45b785[_0x5a59('0x40')][_0x5a59('0x47')]('nolimit')){_0x365ea8['limit']=qs[_0x5a59('0x30')](_0x45b785[_0x5a59('0x40')]['limit']);_0x365ea8['offset']=qs[_0x5a59('0x2d')](_0x45b785[_0x5a59('0x40')]['offset']);}_0x365ea8[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x45b785['query']['sort']);_0x365ea8['where']=qs['filters'](_[_0x5a59('0x62')](_0x45b785[_0x5a59('0x40')],_0x5aec1f[_0x5a59('0x42')]));_0x365ea8['where'][_0x5a59('0x5f')]=_0x952eba['id'];if(_0x45b785[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x365ea8[_0x5a59('0x4b')]=_['merge'](_0x365ea8[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x365ea8[_0x5a59('0x43')],function(_0x4bae97){var _0x22bf92={};_0x22bf92[_0x4bae97]={'$like':'%'+_0x45b785[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x22bf92;})});}_0x365ea8=_[_0x5a59('0x4c')]({},_0x365ea8,_0x45b785['options']);return db[_0x5a59('0x63')]['count']({'where':_0x365ea8[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x9ab936){_0x147114['count']=_0x9ab936;if(_0x45b785[_0x5a59('0x40')][_0x5a59('0x50')]){_0x365ea8[_0x5a59('0x51')]=[{'all':!![]}];}return db[_0x5a59('0x63')][_0x5a59('0x52')](_0x365ea8);})[_0x5a59('0x1e')](function(_0x1988e4){_0x147114[_0x5a59('0x53')]=_0x1988e4;return _0x147114;});}})['then'](respondWithFilteredResult(_0x16392e,_0x365ea8))[_0x5a59('0x28')](handleError(_0x16392e,null));};exports[_0x5a59('0x64')]=function(_0x1d105f,_0x4314f3,_0x74631e){return db['ChatWebsite']['find']({'where':{'id':_0x1d105f[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x4314f3,null))[_0x5a59('0x1e')](function(_0x3be489){if(_0x3be489){return _0x3be489[_0x5a59('0x64')](_0x1d105f[_0x5a59('0x40')]['ids']);}})['then'](respondWithStatusCode(_0x4314f3,null))['catch'](handleError(_0x4314f3,null));};exports[_0x5a59('0x65')]=function(_0x5ceaea,_0x457f6f,_0x5395c3){if(_0x5ceaea['body']['id']){delete _0x5ceaea[_0x5a59('0x57')]['id'];}return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x5ceaea[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x457f6f,null))[_0x5a59('0x1e')](function(_0x29f248){if(_0x29f248){_0x5ceaea[_0x5a59('0x57')][_0x5a59('0x5f')]=_0x29f248['id'];return db[_0x5a59('0x66')][_0x5a59('0x56')](_0x5ceaea[_0x5a59('0x57')]);}})[_0x5a59('0x1e')](respondWithResult(_0x457f6f,null))['catch'](handleError(_0x457f6f,null));};exports[_0x5a59('0x67')]=function(_0xf1c1bb,_0x1a7998,_0x1e9691){var _0x3e04ad={'raw':![],'where':{}};var _0x4ce37f={};var _0x5dfd72={'count':0x0,'rows':[]};return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0xf1c1bb[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x1a7998,null))['then'](function(_0x31c83c){if(_0x31c83c){_0x4ce37f[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x66')][_0x5a59('0x3d')]);_0x4ce37f[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0xf1c1bb[_0x5a59('0x40')]);_0x4ce37f['filters']=_['intersection'](_0x4ce37f[_0x5a59('0x3f')],_0x4ce37f[_0x5a59('0x40')]);_0x3e04ad[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x4ce37f['model'],qs[_0x5a59('0x45')](_0xf1c1bb['query'][_0x5a59('0x45')]));_0x3e04ad[_0x5a59('0x43')]=_0x3e04ad['attributes'][_0x5a59('0x46')]?_0x3e04ad[_0x5a59('0x43')]:_0x4ce37f[_0x5a59('0x3f')];if(!_0xf1c1bb['query'][_0x5a59('0x47')](_0x5a59('0x68'))){_0x3e04ad[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x30')]);_0x3e04ad[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x3e04ad[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x49')]);_0x3e04ad[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0xf1c1bb[_0x5a59('0x40')],_0x4ce37f[_0x5a59('0x42')]));_0x3e04ad[_0x5a59('0x4b')][_0x5a59('0x5f')]=_0x31c83c['id'];if(_0xf1c1bb[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x3e04ad[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x3e04ad[_0x5a59('0x4b')],{'$or':_['map'](_0x3e04ad[_0x5a59('0x43')],function(_0x4adaee){var _0x2500d3={};_0x2500d3[_0x4adaee]={'$like':'%'+_0xf1c1bb[_0x5a59('0x40')]['filter']+'%'};return _0x2500d3;})});}_0x3e04ad=_[_0x5a59('0x4c')]({},_0x3e04ad,_0xf1c1bb[_0x5a59('0x4e')]);return db[_0x5a59('0x66')]['count']({'where':_0x3e04ad[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x6147d7){_0x5dfd72['count']=_0x6147d7;if(_0xf1c1bb[_0x5a59('0x40')]['includeAll']){_0x3e04ad[_0x5a59('0x51')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3e04ad);})[_0x5a59('0x1e')](function(_0x22fcba){_0x5dfd72['rows']=_0x22fcba;return _0x5dfd72;});}})[_0x5a59('0x1e')](respondWithFilteredResult(_0x1a7998,_0x3e04ad))['catch'](handleError(_0x1a7998,null));};exports['removeAnswers']=function(_0x52ea54,_0x2b7142,_0x5adfce){return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x52ea54[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b7142,null))['then'](function(_0x59e4f5){if(_0x59e4f5){return _0x59e4f5[_0x5a59('0x69')](_0x52ea54[_0x5a59('0x40')][_0x5a59('0x6a')]);}})[_0x5a59('0x1e')](respondWithStatusCode(_0x2b7142,null))[_0x5a59('0x28')](handleError(_0x2b7142,null));};exports[_0x5a59('0x6b')]=function(_0x545652,_0x2ca87b,_0x34164e){_0x545652[_0x5a59('0x57')]['sitepic']=_0x545652[_0x5a59('0x6c')]['filename'];return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x545652[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2ca87b,null))['then'](saveUpdates(_0x545652['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x2ca87b,null))[_0x5a59('0x28')](handleError(_0x2ca87b,null));};exports[_0x5a59('0x6d')]=function(_0x129741,_0x45bec9,_0xfe77b){_0x129741[_0x5a59('0x57')]['agentAvatar']=_0x129741['file'][_0x5a59('0x6e')];return db[_0x5a59('0x4f')]['find']({'where':{'id':_0x129741[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x45bec9,null))[_0x5a59('0x1e')](saveUpdates(_0x129741['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x45bec9,null))[_0x5a59('0x28')](handleError(_0x45bec9,null));};exports[_0x5a59('0x6f')]=function(_0x1695af,_0x55711a,_0x43083b){_0x1695af[_0x5a59('0x57')][_0x5a59('0x70')]=_0x1695af[_0x5a59('0x6c')][_0x5a59('0x6e')];return db['ChatWebsite']['find']({'where':{'id':_0x1695af[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x55711a,null))['then'](saveUpdates(_0x1695af['body'],null))[_0x5a59('0x1e')](respondWithResult(_0x55711a,null))[_0x5a59('0x28')](handleError(_0x55711a,null));};exports[_0x5a59('0x71')]=function(_0x235cc8,_0xfad905,_0x448bbd){_0x235cc8[_0x5a59('0x57')][_0x5a59('0x72')]=_0x235cc8[_0x5a59('0x6c')]['filename'];return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x235cc8[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0xfad905,null))[_0x5a59('0x1e')](saveUpdates(_0x235cc8[_0x5a59('0x57')],null))[_0x5a59('0x1e')](respondWithResult(_0xfad905,null))[_0x5a59('0x28')](handleError(_0xfad905,null));};exports[_0x5a59('0x73')]=function(_0x129dba,_0x52a9a9,_0x322adc){var _0x1cb19d=path[_0x5a59('0x74')](config[_0x5a59('0x75')],'server/files/images/logos/default_logo.svg');var _0x15b500={'where':{'id':_0x129dba[_0x5a59('0x54')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x43296b=![];return require(_0x5a59('0x76'))[_0x5a59('0x77')]()[_0x5a59('0x1e')](function(_0x1d4d17){if(_0x1d4d17){_0x43296b=_0x1d4d17['custom'];}})[_0x5a59('0x1e')](function(){return db['ChatWebsite']['find'](_0x15b500);})[_0x5a59('0x1e')](handleEntityNotFound(_0x52a9a9,null))['then'](function(_0x45e099){if(_0x45e099){if(!_[_0x5a59('0x78')](_0x45e099[_0x5a59('0x79')])){if(fs[_0x5a59('0x7a')](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7b'),_0x45e099[_0x5a59('0x79')]))&&_0x43296b){_0x1cb19d=path[_0x5a59('0x74')](config['root'],_0x5a59('0x7b'),_0x45e099[_0x5a59('0x79')]);}}return _0x52a9a9[_0x5a59('0x7c')](_0x1cb19d);}})[_0x5a59('0x28')](handleError(_0x52a9a9,null));};exports[_0x5a59('0x7d')]=function(_0x1b5ffe,_0x1b47e7,_0x5db3ef){var _0x3ccdba=path[_0x5a59('0x74')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x22f14a={'where':{'id':_0x1b5ffe[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x7e')],'raw':!![]};return db[_0x5a59('0x4f')]['find'](_0x22f14a)[_0x5a59('0x1e')](handleEntityNotFound(_0x1b47e7,null))['then'](function(_0x31c759){if(_0x31c759){if(!_[_0x5a59('0x78')](_0x31c759[_0x5a59('0x7e')])){if(fs[_0x5a59('0x7a')](path[_0x5a59('0x74')](config['root'],_0x5a59('0x7f'),_0x31c759[_0x5a59('0x7e')]))){_0x3ccdba=path[_0x5a59('0x74')](config['root'],_0x5a59('0x7f'),_0x31c759[_0x5a59('0x7e')]);}}return _0x1b47e7['download'](_0x3ccdba);}})[_0x5a59('0x28')](handleError(_0x1b47e7,null));};exports[_0x5a59('0x80')]=function(_0x574d87,_0xbacb76,_0x476519){var _0x4e36db=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x81'));var _0x3ca6ff={'where':{'id':_0x574d87[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x70'),_0x5a59('0x82')],'raw':!![]};return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0x3ca6ff)[_0x5a59('0x1e')](handleEntityNotFound(_0xbacb76,null))[_0x5a59('0x1e')](function(_0x28c03d){if(_0x28c03d){if(!_[_0x5a59('0x78')](_0x28c03d[_0x5a59('0x70')])){if(fs['existsSync'](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0x28c03d[_0x5a59('0x70')]))&&_0x28c03d[_0x5a59('0x82')]){_0x4e36db=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0x28c03d[_0x5a59('0x70')]);}}return _0xbacb76[_0x5a59('0x7c')](_0x4e36db);}})[_0x5a59('0x28')](handleError(_0xbacb76,null));};exports[_0x5a59('0x83')]=function(_0x2d59d3,_0x2c6183,_0x1c5e19){var _0x3a7425=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x84'));var _0x4536a7={'where':{'id':_0x2d59d3[_0x5a59('0x54')]['id']},'attributes':['id',_0x5a59('0x72')],'raw':!![]};return db[_0x5a59('0x4f')][_0x5a59('0x55')](_0x4536a7)[_0x5a59('0x1e')](handleEntityNotFound(_0x2c6183,null))['then'](function(_0xf4cf1){if(_0xf4cf1){if(!_[_0x5a59('0x78')](_0xf4cf1[_0x5a59('0x72')])){if(fs[_0x5a59('0x7a')](path['join'](config['root'],_0x5a59('0x7f'),_0xf4cf1['systemAvatar']))){_0x3a7425=path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x7f'),_0xf4cf1[_0x5a59('0x72')]);}}return _0x2c6183['download'](_0x3a7425);}})[_0x5a59('0x28')](handleError(_0x2c6183,null));};exports[_0x5a59('0x85')]=function(_0x3890e8,_0x8311d4,_0x136f1a){var _0x15ddbb=require(_0x5a59('0x86'));var _0xf7d99b=new _0x15ddbb();var _0x5ae8ea=_0xf7d99b[_0x5a59('0x87')](_0x3890e8[_0x5a59('0x88')][_0x5a59('0x89')])[_0x5a59('0x8a')]();var _0xb1ffe9={'body':_0x3890e8[_0x5a59('0x57')],'channel':_0x5a59('0x8b')};var _0x34487b=[];var _0x1014a8=[];var _0x5ef3f6={};var _0x5e1fa9=![];return db[_0x5a59('0x8c')]['describe']()[_0x5a59('0x1e')](function(_0x24eda0){if(!_0x24eda0){throw new db['Sequelize'][(_0x5a59('0x8d'))]('no\x20available\x20attributes');}_0x34487b=_[_0x5a59('0x8e')](_[_0x5a59('0x41')](_0x24eda0),[_0x5a59('0x8f'),'updatedAt']);_0x1014a8=_['difference'](_[_0x5a59('0x41')](_0x24eda0),[_0x5a59('0x8f'),_0x5a59('0x90'),_0x5a59('0x91'),_0x5a59('0x92')]);if(_0x3890e8[_0x5a59('0x57')]['id']){delete _0x3890e8[_0x5a59('0x57')]['id'];}if(_[_0x5a59('0x78')](_0x3890e8['body']['from'])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x94'));}if(_[_0x5a59('0x78')](_0x3890e8['body']['body'])||_0x3890e8[_0x5a59('0x57')]['body']===''){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5a59('0x78')](_0x3890e8[_0x5a59('0x57')]['mapKey'])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x95')+_0x1014a8);}if(!_['includes'](_0x1014a8,_0x3890e8[_0x5a59('0x57')][_0x5a59('0x96')])){throw new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0x97')+_0x1014a8);}_0x5ef3f6[_0x3890e8[_0x5a59('0x57')][_0x5a59('0x96')]]=_0x3890e8[_0x5a59('0x57')]['from'];})[_0x5a59('0x1e')](function(){return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x3890e8['params']['id']},'include':[{'model':db['CmList'],'as':_0x5a59('0x98'),'include':[{'model':db[_0x5a59('0x8c')],'as':'Contacts','where':_0x5ef3f6,'limit':0x1,'order':[['updatedAt',_0x5a59('0x99')]]}]},{'model':db[_0x5a59('0x9a')],'as':_0x5a59('0x9b')}]});})[_0x5a59('0x1e')](handleEntityNotFound(_0x8311d4,null))[_0x5a59('0x1e')](function(_0x232d18){if(_0x232d18&&_0x232d18['List']){_0xb1ffe9[_0x5a59('0x9c')]=_0x232d18;_0xb1ffe9[_0x5a59('0x9d')]=_0x232d18[_0x5a59('0x9b')];_0xb1ffe9[_0x5a59('0x9e')]=_0x232d18[_0x5a59('0x98')];_0xb1ffe9[_0x5a59('0x9d')]=_[_0x5a59('0x9f')](_0xb1ffe9[_0x5a59('0x9d')],[_0x5a59('0xa0')],['asc']);if(_0xb1ffe9[_0x5a59('0x9c')]['Applications']){delete _0xb1ffe9[_0x5a59('0x9c')][_0x5a59('0x9b')];}if(_0xb1ffe9['account'][_0x5a59('0x98')]&&_0xb1ffe9[_0x5a59('0x9c')][_0x5a59('0x98')]['Contacts'][_0x5a59('0x46')]){return _0xb1ffe9['account']['List'][_0x5a59('0xa1')][0x0];}var _0x358a3c=_['defaults'](_0x3890e8[_0x5a59('0x57')],{'firstName':_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa2')],'ListId':_0x232d18[_0x5a59('0x92')]});_0x358a3c[_0x3890e8['body'][_0x5a59('0x96')]]=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa2')];return db['CmContact'][_0x5a59('0x56')](_0x358a3c,{'fields':_0x34487b,'raw':!![]});}})['then'](handleEntityNotFound(_0x8311d4,null))[_0x5a59('0x1e')](function(_0x5521c5){_0xb1ffe9['contact']=_0x5521c5;var _0xc93770=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xa3')];if(_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa4')]){_0xc93770=_0x3890e8['headers'][_0x5a59('0xa4')];}else if(_0x3890e8[_0x5a59('0x88')]['x-forwarded-for']){_0xc93770=_[_0x5a59('0xa5')](_0x3890e8[_0x5a59('0x88')]['x-forwarded-for'][_0x5a59('0xa6')](','));}if(_0x5521c5){var _0x9e9023={'ContactId':_0x5521c5['id'],'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'from':(_0x5521c5[_0x5a59('0xa7')]||'')+'\x20'+(_0x5521c5[_0x5a59('0xa8')]||''),'customerIp':_0xc93770,'customerPort':_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa9')]?_0x3890e8[_0x5a59('0x88')][_0x5a59('0xa9')]:null,'referer':_0x3890e8[_0x5a59('0x57')][_0x5a59('0xaa')],'browserName':_0x5ae8ea[_0x5a59('0xab')][_0x5a59('0x37')]&&_0x5ae8ea['browser']['version']?util[_0x5a59('0xac')](_0x5a59('0xad'),_0x5ae8ea[_0x5a59('0xab')][_0x5a59('0x37')],_0x5ae8ea['browser']['version']):_0x5a59('0xae'),'browserVersion':_0x5ae8ea[_0x5a59('0xab')]['version']||'unknown','osName':util[_0x5a59('0xac')](_0x5a59('0xad'),_0x5ae8ea['os'][_0x5a59('0x37')],_0x5ae8ea['os'][_0x5a59('0xaf')]),'osVersion':_0x5ae8ea['os'][_0x5a59('0xaf')],'deviceModel':_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3f')]&&_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0xb1')]?util['format'](_0x5a59('0xb2'),_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3f')],_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0xb1')],_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3e')]):null,'deviceVendor':_0x5ae8ea['device']['vendor'],'deviceType':_0x5ae8ea[_0x5a59('0xb0')][_0x5a59('0x3e')],'formData':JSON['stringify'](_0x3890e8[_0x5a59('0x57')])};var _0x5cda6f={'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'closed':![]};if(_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')]){_0x5cda6f[_0x5a59('0xb3')]=_0x3890e8['body']['threadId'];return db['ChatInteraction'][_0x5a59('0x55')]({'where':_0x5cda6f})['then'](function(_0x4e0fed){if(_0x4e0fed){return[_0x4e0fed,![]];}_0x9e9023[_0x5a59('0xb3')]=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')];_0x9e9023[_0x5a59('0xb4')]=_0x3890e8['body']['externalUrl'];return db[_0x5a59('0xb5')][_0x5a59('0x56')](_0x9e9023)[_0x5a59('0x1e')](function(_0x295b56){return[_0x295b56,!![]];});});}_0x5cda6f[_0x5a59('0xb6')]=_0x5521c5['id'];if(_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb7')]&&_0x3890e8[_0x5a59('0x57')]['interaction']['id']){_0x5cda6f['id']=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb7')]['id'];return db[_0x5a59('0xb5')][_0x5a59('0x55')]({'where':_0x5cda6f})[_0x5a59('0x1e')](function(_0x4e3cba){if(_0x4e3cba){return[_0x4e3cba,![]];}return db[_0x5a59('0xb5')][_0x5a59('0x56')](_0x9e9023)[_0x5a59('0x1e')](function(_0x12173f){return[_0x12173f,!![]];});});}return db['ChatInteraction']['create'](_0x9e9023)[_0x5a59('0x1e')](function(_0x7fbd69){return[_0x7fbd69,!![]];});}})['spread'](function(_0x18684e,_0x398ef1){if(_0x18684e){_0x5e1fa9=_0x398ef1;if(!_0x398ef1){var _0x3b15dd={'from':(_0xb1ffe9['contact']['firstName']||'')+'\x20'+(_0xb1ffe9['contact'][_0x5a59('0xa8')]||'')};if(_0x3890e8['body']['threadId']&&_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb8')]&&_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb3')]!=_0x3890e8[_0x5a59('0x57')][_0x5a59('0xb8')]){_0x3b15dd[_0x5a59('0xb3')]=_0x3890e8[_0x5a59('0x57')]['messageId'];}return _0x18684e[_0x5a59('0x33')](_0x3b15dd);}else{return _0x18684e;}}})['then'](function(_0x3ba0c8){_0xb1ffe9['interaction']=_0x3ba0c8[_0x5a59('0x5a')]({'plain':!![]});_0xb1ffe9[_0x5a59('0xb7')]['created']=_0x5e1fa9;if(_0xb1ffe9['interaction'][_0x5a59('0xb9')]){if(_0xb1ffe9[_0x5a59('0x9c')]['autoclose']){_0xb1ffe9[_0x5a59('0x9d')]['push']({'id':0x0,'priority':_0xb1ffe9['applications'][_0x5a59('0x46')]+0x1,'app':_0x5a59('0xba'),'appdata':_0x5a59('0xbb'),'interval':'*,*,*,*'});}}return db[_0x5a59('0xbc')]['create']({'body':_0x3890e8[_0x5a59('0x57')][_0x5a59('0x57')],'ChatWebsiteId':_0x3890e8[_0x5a59('0x54')]['id'],'ChatInteractionId':_0x3ba0c8['id'],'direction':'in','ContactId':_0xb1ffe9[_0x5a59('0xbd')]['id'],'AttachmentId':_0x3890e8['body'][_0x5a59('0xbe')]});})[_0x5a59('0x1e')](function(_0x2b9568){_0xb1ffe9[_0x5a59('0x26')]=_0x2b9568;if(_0xb1ffe9[_0x5a59('0xb7')][_0x5a59('0xbf')]){return db[_0x5a59('0xc0')][_0x5a59('0x55')]({'attributes':['id',_0x5a59('0x37')],'where':{'id':_0xb1ffe9[_0x5a59('0xb7')][_0x5a59('0xbf')]}})[_0x5a59('0x1e')](function(_0x20fdf1){if(_0x20fdf1){_0xb1ffe9[_0x5a59('0x9d')][_0x5a59('0xc1')]({'id':0x0,'priority':0x0,'app':_0x5a59('0xc2'),'appdata':_0x20fdf1[_0x5a59('0x37')]+','+(_0xb1ffe9['account'][_0x5a59('0xc3')]||0xa),'interval':_0x5a59('0xc4')});_0xb1ffe9[_0x5a59('0xc5')]=!![];}return respondWithRpcPromise(_0x5a59('0xc6'),_0x5a59('0xc7'),_0xb1ffe9);});}return respondWithRpcPromise('Start',_0x5a59('0xc7'),_0xb1ffe9);})[_0x5a59('0x1e')](function(_0x3f2481){respondWithRpcPromise(_0x5a59('0xc8'),_0x5a59('0xc8'),{'event':_0x5a59('0x85'),'message':_0x3f2481},client9002);return _0x3f2481;})[_0x5a59('0x1e')](respondWithResult(_0x8311d4,null))[_0x5a59('0x28')](handleError(_0x8311d4,null));};exports['offline']=function(_0x2d97f1,_0x2e2ac3,_0x3f02bc){var _0xff22b9,_0x44ece0,_0x2fd195;var _0x15094d=[];var _0x545b95=[];var _0x4b267d={};var _0x5a040a=_0x2d97f1['files']||[];var _0x4e4409=[];var _0x2d45ca;return db[_0x5a59('0x8c')][_0x5a59('0x5d')]()[_0x5a59('0x1e')](function(_0x5901b7){if(!_0x5901b7){throw new db['Sequelize']['ValidationError'](_0x5a59('0xc9'));}_0x545b95=_['difference'](_[_0x5a59('0x41')](_0x5901b7),['createdAt',_0x5a59('0x90')]);_0x15094d=_[_0x5a59('0x8e')](_[_0x5a59('0x41')](_0x5901b7),[_0x5a59('0x8f'),'updatedAt',_0x5a59('0x91'),_0x5a59('0x92')]);if(_0x2d97f1[_0x5a59('0x57')]['id']){delete _0x2d97f1[_0x5a59('0x57')]['id'];}if(_[_0x5a59('0x78')](_0x2d97f1['body'][_0x5a59('0xa2')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db['Sequelize'][(_0x5a59('0x8d'))](_0x5a59('0x94')));}if(_[_0x5a59('0x78')](_0x2d97f1[_0x5a59('0x57')]['body'])||_0x2d97f1[_0x5a59('0x57')][_0x5a59('0x57')]===''){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0xca')));}if(_[_0x5a59('0x78')](_0x2d97f1['body'][_0x5a59('0xcb')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))](_0x5a59('0xcc')+_0x15094d));}if(!_['includes'](_0x15094d,_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xcb')])){throw _0x2e2ac3[_0x5a59('0x2a')](0x1f4)[_0x5a59('0x38')](new db[(_0x5a59('0x93'))][(_0x5a59('0x8d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15094d));}_0x4b267d[_0x2d97f1[_0x5a59('0x57')]['mapKeyOffline']]=_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xa2')];})[_0x5a59('0x1e')](function(){return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x2d97f1[_0x5a59('0x54')]['id']},'include':[{'model':db[_0x5a59('0xcd')],'as':_0x5a59('0x98')},{'model':db['MailAccount'],'as':_0x5a59('0xce')}]});})[_0x5a59('0x1e')](handleEntityNotFound(_0x2e2ac3,null))['then'](function(_0x25c45f){if(_0x25c45f&&_0x25c45f[_0x5a59('0x98')]){_0x44ece0=_0x25c45f;var _0x609b63=_[_0x5a59('0x18')](_0x2d97f1[_0x5a59('0x57')],{'firstName':_0x2d97f1[_0x5a59('0x57')]['from'],'phone':_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xa2')],'ListId':_0x25c45f[_0x5a59('0x92')]});_0x609b63[_0x2d97f1[_0x5a59('0x57')][_0x5a59('0xcb')]]=_0x2d97f1['body']['from'];return db[_0x5a59('0x8c')][_0x5a59('0xcf')]({'where':_0x4b267d,'defaults':_0x609b63});}})['spread'](function(_0x1634ed){if(_0x1634ed){_0x2fd195=_0x1634ed;var _0x5ce8cf=fs['readFileSync'](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x5a59('0xd0'));var _0x5c1572=ejs[_0x5a59('0xd1')](_0x5ce8cf,{'body':_[_0x5a59('0xd2')](_0x2d97f1[_0x5a59('0x57')][_0x5a59('0x57')]),'bodyTitle':_0x44ece0['offlineMessageBody']});return db[_0x5a59('0xd3')][_0x5a59('0x56')]({'body':_0x5c1572,'ContactId':_0x1634ed['id'],'ChatWebsiteId':_0x44ece0['id']});}})[_0x5a59('0x1e')](function(_0x1df740){_0x2d45ca=_0x1df740;if(_0x5a040a[_0x5a59('0x46')]){var _0x3e74c7=_0x5a040a[_0x5a59('0x3c')](function(_0x51c8d8){return{'name':_0x51c8d8['originalname'],'basename':_0x51c8d8['filename'],'type':_0x51c8d8[_0x5a59('0xd4')],'ChatOfflineMessageId':_0x1df740['id']};});_0x4e4409=_0x3e74c7['map'](_0x3e99aa=>{var _0x521f6d={'filename':_0x3e99aa['name'],'path':path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0xd5'),_0x5a59('0xd6'),_0x5a59('0xd7'),_0x5a59('0xd8'),_0x3e99aa[_0x5a59('0xd9')])};return _0x521f6d;});if(!_0x44ece0[_0x5a59('0xda')]){return db[_0x5a59('0xdb')]['transaction'](function(_0x4ef66e){return db[_0x5a59('0xdc')]['bulkCreate'](_0x3e74c7,{'transaction':_0x4ef66e});});}}})[_0x5a59('0x1e')](function(){if(_0x2d45ca){_0xff22b9=_0x2d45ca;return db[_0x5a59('0xce')][_0x5a59('0x61')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5a59('0xdd'),'raw':!![]}]});}})[_0x5a59('0x1e')](function(_0x554464){if(_0x554464&&_0x554464['Smtp']&&_0x44ece0['forwardOffline']&&_0x44ece0[_0x5a59('0xde')]){var _0x4a15e7={'tls':{'rejectUnauthorized':![]}};if(_0x554464[_0x5a59('0xdd')][_0x5a59('0xdf')]){_0x4a15e7[_0x5a59('0xdf')]=_0x554464['Smtp'][_0x5a59('0xdf')];}else{_0x4a15e7[_0x5a59('0xe0')]=_0x554464['Smtp']['host'];_0x4a15e7[_0x5a59('0xe1')]=_0x554464[_0x5a59('0xdd')]['port'];_0x4a15e7[_0x5a59('0xe2')]=_0x554464[_0x5a59('0xdd')][_0x5a59('0xe2')];}if(_0x554464['Smtp'][_0x5a59('0xe3')]){_0x4a15e7[_0x5a59('0xe4')]={'user':_0x554464[_0x5a59('0xdd')][_0x5a59('0x58')],'pass':_0x554464['Smtp'][_0x5a59('0xe5')]};}return respondWithRpcPromise('SendMail',_0x5a59('0xe6'),{'account':_0x4a15e7,'message':{'from':util[_0x5a59('0xac')]('\x22%s\x22\x20<%s>',_0x554464[_0x5a59('0x37')],_0x554464[_0x5a59('0xe7')]||_0x554464[_0x5a59('0xdd')]['user']),'to':_0x44ece0[_0x5a59('0xde')],'subject':_0x44ece0[_0x5a59('0xe8')],'html':_0xff22b9[_0x5a59('0x57')],'attachments':_0x4e4409}},client9003)[_0x5a59('0x1e')](function(){return _0xff22b9;})['catch'](function(_0x2985d3){console['error'](_0x2985d3);});}})['then'](function(){if(_0x44ece0&&_0x44ece0[_0x5a59('0xda')]&&_0x44ece0[_0x5a59('0xe9')]){var _0x416de8=[];if(_0x5a040a[_0x5a59('0x46')]){_0x416de8=_0x5a040a[_0x5a59('0x3c')](function(_0x274b2b){return{'name':_0x274b2b['originalname'],'basename':_0x274b2b[_0x5a59('0x6e')],'type':_0x274b2b[_0x5a59('0xd4')],'ChatOfflineMessageId':_0x2d45ca['id']};});}var _0x365420;if(!_[_0x5a59('0x78')](_0x44ece0[_0x5a59('0xea')])){var _0x121895=_['map'](_0x2d97f1[_0x5a59('0x57')],function(_0x102d25){return _0x102d25;});var _0x43db41=_['toPairsIn'](_0x121895)[0x0];var _0x5942a2=_[_0x5a59('0xeb')](_0x43db41,function(_0x3aaa1f){return _0x3aaa1f;});_0x365420=_0x5942a2[0x1][_0x44ece0[_0x5a59('0xea')]];}var _0x248f3f={'from':_0x2fd195[_0x5a59('0xe7')],'firstName':_0x2fd195['firstName'],'lastName':_0x2fd195[_0x5a59('0xa8')],'mapKey':_0x5a59('0xe7'),'message':{'from':_0x2fd195[_0x5a59('0xe7')],'to':_0x44ece0[_0x5a59('0xce')]['email'],'cc':'','subject':_[_0x5a59('0x78')](_0x365420)?_0x44ece0[_0x5a59('0xe8')]:_0x365420,'messageId':'','sentAt':new Date(),'attach':_0x416de8[_0x5a59('0x46')],'attachments':_0x416de8,'originChannel':'Chat','ChatWebsiteId':_0x44ece0['id'],'ChatOfflineMessageId':_0xff22b9['id'],'originTo':_0x44ece0['MailAccount'][_0x5a59('0xe7')]},'body':_0xff22b9[_0x5a59('0x57')]};var _0x13206a={'account':{'id':_0x44ece0[_0x5a59('0xe9')]},'body':_0x248f3f,'log':_0x5a59('0xec')};return respondWithRpcPromise(_0x5a59('0xec'),_0x5a59('0xed'),_0x13206a,client9001)['then'](function(){return _0xff22b9;})[_0x5a59('0x28')](function(_0x6e5521){console[_0x5a59('0x24')](_0x6e5521);});}return;})[_0x5a59('0x1e')](function(){if(_0xff22b9){return _0xff22b9;}})['then'](respondWithResult(_0x2e2ac3,null))[_0x5a59('0x28')](function(_0x4e406f){console[_0x5a59('0x24')](_0x5a59('0x28'),_0x4e406f);for(var _0x37f216 of _0x5a040a){var _0x486092=path['join'](config['root'],_0x5a59('0xd5'),_0x5a59('0xd6'),_0x5a59('0xd7'),_0x5a59('0xd8'),_0x37f216[_0x5a59('0x6e')]);fs_extra[_0x5a59('0xee')](_0x486092)[_0x5a59('0x28')](function(_0x35ef18){console[_0x5a59('0x24')](_0x5a59('0xef'),_0x486092,_0x35ef18);});}});};exports[_0x5a59('0xf0')]=function(_0x5046d3,_0x18d898,_0x2f08a5){return db['ChatInteraction'][_0x5a59('0x55')]({'where':{'id':_0x5046d3[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x18d898,null))['then'](function(_0x4203df){if(_0x4203df){return _0x4203df[_0x5a59('0xf0')](_0x5046d3['body']['ids'],_['omit'](_0x5046d3['body'],[_0x5a59('0x6a'),'id'])||{});}})[_0x5a59('0x1e')](respondWithResult(_0x18d898,null))[_0x5a59('0x28')](handleError(_0x18d898,null));};exports['getInteractions']=function(_0xaa9035,_0x118773,_0x4ba72b){var _0x552b39={'raw':![],'where':{}};var _0xb2ebb3={};var _0x371223={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x5a59('0x61')]({'where':{'id':_0xaa9035[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x118773,null))[_0x5a59('0x1e')](function(_0x27f1d3){if(_0x27f1d3){_0xb2ebb3[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0xb5')][_0x5a59('0x3d')]);_0xb2ebb3['query']=_[_0x5a59('0x41')](_0xaa9035[_0x5a59('0x40')]);_0xb2ebb3[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0xb2ebb3[_0x5a59('0x3f')],_0xb2ebb3[_0x5a59('0x40')]);_0x552b39['attributes']=_[_0x5a59('0x44')](_0xb2ebb3['model'],qs[_0x5a59('0x45')](_0xaa9035['query'][_0x5a59('0x45')]));_0x552b39[_0x5a59('0x43')]=_0x552b39[_0x5a59('0x43')]['length']?_0x552b39[_0x5a59('0x43')]:_0xb2ebb3[_0x5a59('0x3f')];if(!_0xaa9035[_0x5a59('0x40')]['hasOwnProperty'](_0x5a59('0x68'))){_0x552b39[_0x5a59('0x30')]=qs['limit'](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x30')]);_0x552b39['offset']=qs['offset'](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x2d')]);}_0x552b39['order']=qs[_0x5a59('0x49')](_0xaa9035[_0x5a59('0x40')][_0x5a59('0x49')]);_0x552b39['where']=qs['filters'](_[_0x5a59('0x62')](_0xaa9035[_0x5a59('0x40')],_0xb2ebb3[_0x5a59('0x42')]));_0x552b39[_0x5a59('0x4b')]['ChatWebsiteId']=_0x27f1d3['id'];if(_0xaa9035[_0x5a59('0x40')]['filter']){_0x552b39[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x552b39[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x552b39[_0x5a59('0x43')],function(_0x14f93e){var _0x2dc66e={};_0x2dc66e[_0x14f93e]={'$like':'%'+_0xaa9035[_0x5a59('0x40')]['filter']+'%'};return _0x2dc66e;})});}_0x552b39=_[_0x5a59('0x4c')]({},_0x552b39,_0xaa9035[_0x5a59('0x4e')]);return db[_0x5a59('0xb5')][_0x5a59('0x2f')]({'where':_0x552b39[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x398521){_0x371223[_0x5a59('0x2f')]=_0x398521;if(_0xaa9035[_0x5a59('0x40')]['includeAll']){_0x552b39[_0x5a59('0x51')]=[{'model':db[_0x5a59('0x8c')],'as':'Contact','required':![]},{'model':db[_0x5a59('0xc0')],'as':'Owner','attributes':[_0x5a59('0x37'),_0x5a59('0xf1'),_0x5a59('0xf2')],'required':![]},{'model':db[_0x5a59('0xf3')],'as':_0x5a59('0xf4'),'attributes':['id',_0x5a59('0x37'),_0x5a59('0xf5')],'where':_0xaa9035['query'][_0x5a59('0xf6')]?{'id':_0xaa9035[_0x5a59('0x40')][_0x5a59('0xf6')]}:undefined,'required':_0xaa9035[_0x5a59('0x40')]['tag']?!![]:![]}];}return db[_0x5a59('0xb5')][_0x5a59('0x52')](_0x552b39);})[_0x5a59('0x1e')](function(_0x367929){_0x371223[_0x5a59('0x53')]=_0x367929;return _0x371223;});}})[_0x5a59('0x1e')](respondWithFilteredResult(_0x118773,_0x552b39))[_0x5a59('0x28')](handleError(_0x118773,null));};function iftimePromise(_0x9ebcf7,_0x45141d){return respondWithRpcPromise(_0x5a59('0xf7'),'getSnippet',{'command':_0x45141d[_0x5a59('0xf8')]?util[_0x5a59('0xac')](_0x5a59('0xf9'),_0x9ebcf7['interval'],_0x45141d[_0x5a59('0xf8')]):util[_0x5a59('0xac')](_0x5a59('0xfa'),_0x9ebcf7[_0x5a59('0xfb')])},client9002)['then'](function(_0x352fd8){var _0x28e35a=_0x352fd8&&_0x352fd8[_0x5a59('0xfc')]('true')>=0x0?!![]:![];logger[_0x5a59('0x1f')](_0x5a59('0xfd'),_0x45141d['id'],_0x9ebcf7['id'],_0x9ebcf7[_0x5a59('0xfb')],_0x28e35a?_0x5a59('0xfe'):'OFFLINE',_0x45141d[_0x5a59('0xf8')]?_0x45141d['timezone']:_0x5a59('0xff'));return _0x28e35a;})[_0x5a59('0x28')](function(_0x4f1e85){logger[_0x5a59('0x24')](_0x5a59('0xfd'),_0x45141d['id'],_0x9ebcf7['id'],_0x9ebcf7[_0x5a59('0xfb')],util[_0x5a59('0x100')](_0x4f1e85,{'showHidden':![],'depth':null}),_0x45141d[_0x5a59('0xf8')]?_0x45141d[_0x5a59('0xf8')]:_0x5a59('0xff'));return![];});}exports[_0x5a59('0x101')]=function(_0x2edf08,_0x3f6649,_0x40a557){var _0x431e73=0x0;var _0x1a1910=0x0;var _0x149665=![];var _0x36da6b;var _0x9aa103;return db['ChatWebsite'][_0x5a59('0x55')]({'where':{'id':_0x2edf08['params']['id']},'include':[{'model':db[_0x5a59('0x102')],'as':_0x5a59('0x102'),'include':[{'model':db[_0x5a59('0x102')],'as':_0x5a59('0x103'),'attributes':['id',_0x5a59('0xfb')],'raw':!![]}]}]})[_0x5a59('0x1e')](handleEntityNotFound(_0x3f6649,null))[_0x5a59('0x1e')](function(_0x21f3b0){if(_0x21f3b0){_0x36da6b=_0x21f3b0;return _0x21f3b0[_0x5a59('0x104')]({'raw':!![]});}})[_0x5a59('0x1e')](function(_0x86ad3e){if(_0x36da6b){if(_0x86ad3e){_0x9aa103=_0x86ad3e;}}return require(_0x5a59('0x76'))['getLicense']();})[_0x5a59('0x1e')](function(_0x58b78f){if(_0x58b78f){_0x1a1910=_0x58b78f['virtual'];_0x149665=_0x58b78f[_0x5a59('0x105')];}})['then'](function(){return db[_0x5a59('0xb5')][_0x5a59('0x2f')]({'where':{'closed':![]}});})[_0x5a59('0x1e')](function(_0x170a23){_0x431e73=_0x170a23;if(_0x1a1910&&_0x170a23>_0x1a1910){return db[_0x5a59('0x106')][_0x5a59('0x61')]({'where':{'id':0x1}})[_0x5a59('0x1e')](function(_0x15b2b9){if(_0x15b2b9){_0x15b2b9[_0x5a59('0x107')](_0x5a59('0x108'));}});}})[_0x5a59('0x1e')](function(){if(_0x36da6b[_0x5a59('0x102')]&&_0x36da6b[_0x5a59('0x102')][_0x5a59('0x103')]){var _0x230a76=[];for(var _0x431e00=0x0;_0x431e00<_0x36da6b['Interval'][_0x5a59('0x103')][_0x5a59('0x46')];_0x431e00++){var _0x40ee88=_0x36da6b[_0x5a59('0x102')][_0x5a59('0x103')][_0x431e00][_0x5a59('0x5a')]({'plain':!![]});_0x230a76[_0x5a59('0x109')](iftimePromise(_0x40ee88,_0x36da6b));}return BPromise[_0x5a59('0x10a')](_0x230a76)[_0x5a59('0x1e')](function(_0xe4aadb){return _[_0x5a59('0x10b')](_0xe4aadb);});}else{return!![];}})['then'](function(_0x19aa53){var _0x2189ad=fs[_0x5a59('0x10c')](path[_0x5a59('0x74')](config[_0x5a59('0x75')],_0x5a59('0x10d')),_0x5a59('0xd0'));var _0xd4dafa={'remote':_0x36da6b[_0x5a59('0x10e')],'query':querystring['stringify'](_[_0x5a59('0x4c')](_0x36da6b[_0x5a59('0x5a')]({'plain':!![]}),{'customerIp':_0x2edf08[_0x5a59('0x88')]['x-forwarded-for']||_0x2edf08[_0x5a59('0x88')][_0x5a59('0x10f')]||_0x2edf08[_0x5a59('0x110')][_0x5a59('0x111')]||_0x2edf08['ip'],'referer':_0x2edf08[_0x5a59('0x88')][_0x5a59('0xaa')],'openedInteractions':_0x431e73,'maxInteractions':_0x1a1910,'virtual':_0x149665['virtual'],'online':_0x19aa53,'custom':_0x149665}))[_0x5a59('0x112')](/'/g,'\x5c\x27')};_0x3f6649[_0x5a59('0x38')](ejs[_0x5a59('0xd1')](Mustache[_0x5a59('0xd1')](_0x2189ad,_0xd4dafa),{'proactiveActions':_0x9aa103,'alignment':_0x36da6b['alignment'],'verticalAlignment':_0x36da6b[_0x5a59('0x113')],'div_color':_0x36da6b[_0x5a59('0xf5')],'text_color':_0x36da6b['textColor'],'button_color':_0x36da6b[_0x5a59('0x114')],'background_color':_0x36da6b[_0x5a59('0x115')]}));})[_0x5a59('0x28')](handleError(_0x3f6649,null));};exports[_0x5a59('0x116')]=function(_0x373a53,_0x54dc4d,_0x4c32f4){return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x373a53[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x54dc4d,null))[_0x5a59('0x1e')](function(_0x121d05){if(_0x121d05){return db[_0x5a59('0xdb')]['transaction'](function(_0x5bd889){return db[_0x5a59('0x9a')]['destroy']({'where':{'ChatWebsiteId':_0x373a53['params']['id']},'transaction':_0x5bd889})[_0x5a59('0x1e')](function(_0x271222){var _0x523849=_['map'](_0x373a53[_0x5a59('0x57')],function(_0x484f75){_0x484f75[_0x5a59('0x5f')]=_0x373a53[_0x5a59('0x54')]['id'];return _0x484f75;});return db[_0x5a59('0x9a')][_0x5a59('0x117')](_0x523849,{'transaction':_0x5bd889});});})[_0x5a59('0x1e')](function(){return db[_0x5a59('0x9a')][_0x5a59('0x118')]({'where':{'ChatWebsiteId':_0x373a53['params']['id']},'order':_0x5a59('0xa0')});});}})['then'](respondWithResult(_0x54dc4d,null))[_0x5a59('0x28')](handleError(_0x54dc4d,null));};exports[_0x5a59('0x119')]=function(_0x1a7985,_0x2a8ae1,_0x2d9e1f){var _0x78842e={};var _0x13ec06={};var _0x28bab6;var _0xb7ff64;return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0x1a7985[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2a8ae1,null))[_0x5a59('0x1e')](function(_0x27bcf7){if(_0x27bcf7){_0x28bab6=_0x27bcf7;_0x13ec06[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db[_0x5a59('0x9a')][_0x5a59('0x3d')]);_0x13ec06['query']=_['keys'](_0x1a7985[_0x5a59('0x40')]);_0x13ec06[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x13ec06[_0x5a59('0x3f')],_0x13ec06[_0x5a59('0x40')]);_0x78842e[_0x5a59('0x43')]=_['intersection'](_0x13ec06[_0x5a59('0x3f')],qs[_0x5a59('0x45')](_0x1a7985[_0x5a59('0x40')][_0x5a59('0x45')]));_0x78842e[_0x5a59('0x43')]=_0x78842e[_0x5a59('0x43')]['length']?_0x78842e[_0x5a59('0x43')]:_0x13ec06[_0x5a59('0x3f')];_0x78842e['order']=qs[_0x5a59('0x49')](_0x1a7985[_0x5a59('0x40')]['sort']);_0x78842e[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x1a7985['query'],_0x13ec06[_0x5a59('0x42')]));if(_0x1a7985[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x78842e[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x78842e[_0x5a59('0x4b')],{'$or':_['map'](_0x78842e[_0x5a59('0x43')],function(_0x16c727){var _0x450ede={};_0x450ede[_0x16c727]={'$like':'%'+_0x1a7985[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x450ede;})});}_0x78842e=_[_0x5a59('0x4c')]({},_0x78842e,_0x1a7985[_0x5a59('0x4e')]);return _0x28bab6[_0x5a59('0x119')](_0x78842e);}})['then'](function(_0x22c9b3){if(_0x22c9b3){_0xb7ff64=_0x22c9b3[_0x5a59('0x46')];if(!_0x1a7985[_0x5a59('0x40')]['hasOwnProperty'](_0x5a59('0x68'))){_0x78842e[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x1a7985['query'][_0x5a59('0x30')]);_0x78842e[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x1a7985[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x28bab6['getApplications'](_0x78842e);}})['then'](function(_0x5bde98){if(_0x5bde98){return _0x5bde98?{'count':_0xb7ff64,'rows':_0x5bde98}:null;}})['then'](respondWithResult(_0x2a8ae1,null))[_0x5a59('0x28')](handleError(_0x2a8ae1,null));};exports[_0x5a59('0x11a')]=function(_0x45627f,_0x5ca501,_0x5d2878){return db[_0x5a59('0x11b')][_0x5a59('0x55')]({'where':{'id':_0x45627f[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x5ca501,null))[_0x5a59('0x1e')](function(_0x25db7b){if(_0x25db7b){return _0x25db7b['addProactiveActions'](_0x45627f['body'][_0x5a59('0x6a')],_[_0x5a59('0x11c')](_0x45627f[_0x5a59('0x57')],['ids','id'])||{});}})[_0x5a59('0x1e')](respondWithResult(_0x5ca501,null))[_0x5a59('0x28')](handleError(_0x5ca501,null));};exports[_0x5a59('0x104')]=function(_0x3971e5,_0x3a8167,_0x5a8e11){var _0x330188={};var _0x1237ef={};var _0x493688;var _0x522683;return db[_0x5a59('0x4f')]['findOne']({'where':{'id':_0x3971e5[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x3a8167,null))[_0x5a59('0x1e')](function(_0xa426a9){if(_0xa426a9){_0x493688=_0xa426a9;_0x1237ef[_0x5a59('0x3f')]=_['keys'](db[_0x5a59('0x11d')]['rawAttributes']);_0x1237ef[_0x5a59('0x40')]=_['keys'](_0x3971e5[_0x5a59('0x40')]);_0x1237ef['filters']=_[_0x5a59('0x44')](_0x1237ef['model'],_0x1237ef[_0x5a59('0x40')]);_0x330188[_0x5a59('0x43')]=_['intersection'](_0x1237ef['model'],qs[_0x5a59('0x45')](_0x3971e5['query']['fields']));_0x330188[_0x5a59('0x43')]=_0x330188[_0x5a59('0x43')][_0x5a59('0x46')]?_0x330188[_0x5a59('0x43')]:_0x1237ef[_0x5a59('0x3f')];_0x330188[_0x5a59('0x48')]=qs[_0x5a59('0x49')](_0x3971e5[_0x5a59('0x40')]['sort']);_0x330188['where']=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x3971e5['query'],_0x1237ef[_0x5a59('0x42')]));if(_0x3971e5[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x330188[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x330188['where'],{'$or':_[_0x5a59('0x3c')](_0x330188[_0x5a59('0x43')],function(_0x3ae71a){var _0x2d5ff1={};_0x2d5ff1[_0x3ae71a]={'$like':'%'+_0x3971e5[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x2d5ff1;})});}_0x330188=_[_0x5a59('0x4c')]({},_0x330188,_0x3971e5[_0x5a59('0x4e')]);return _0x493688[_0x5a59('0x104')](_0x330188);}})[_0x5a59('0x1e')](function(_0x3f5123){if(_0x3f5123){_0x522683=_0x3f5123['length'];if(!_0x3971e5[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x330188[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x3971e5[_0x5a59('0x40')][_0x5a59('0x30')]);_0x330188[_0x5a59('0x2d')]=qs[_0x5a59('0x2d')](_0x3971e5[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x493688[_0x5a59('0x104')](_0x330188);}})['then'](function(_0x3a10c7){if(_0x3a10c7){return _0x3a10c7?{'count':_0x522683,'rows':_0x3a10c7}:null;}})[_0x5a59('0x1e')](respondWithResult(_0x3a8167,null))[_0x5a59('0x28')](handleError(_0x3a8167,null));};exports['getFields']=function(_0x3ef5e,_0x7479d0,_0x15ff70){var _0x107a36=_0x3ef5e['query']['online']===_0x5a59('0x11e')?_0x5a59('0x11f'):_0x5a59('0x120');return db['ChatWebsite']['find']({'attributes':['id',_0x107a36],'where':{'id':_0x3ef5e[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x7479d0,null))[_0x5a59('0x1e')](function(_0x1ee9e1){if(_0x1ee9e1){var _0x26ff62=_0x1ee9e1[_0x107a36];var _0x11add1=_0x26ff62&&_0x26ff62[_0x5a59('0x121')]?_0x26ff62[_0x5a59('0x121')]:[];_0x7479d0[_0x5a59('0x38')]({'fromKey':_[_0x5a59('0x78')](_0x26ff62['fromKey'])?undefined:_0x26ff62[_0x5a59('0x122')],'count':_0x11add1[_0x5a59('0x46')],'rows':_0x11add1});}})[_0x5a59('0x28')](handleError(_0x7479d0,null));};exports[_0x5a59('0x123')]=function(_0x3095c3,_0x352831,_0x50f069){var _0x1fefce={'raw':![],'where':{}};var _0x5339a3={};var _0x5b68e2={'count':0x0,'rows':[]};return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x3095c3[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x352831,null))[_0x5a59('0x1e')](function(_0xa9fdd3){if(_0xa9fdd3){_0x5339a3[_0x5a59('0x3f')]=_['keys'](db[_0x5a59('0xd3')][_0x5a59('0x3d')]);_0x5339a3['query']=_['keys'](_0x3095c3['query']);_0x5339a3[_0x5a59('0x42')]=_[_0x5a59('0x44')](_0x5339a3[_0x5a59('0x3f')],_0x5339a3[_0x5a59('0x40')]);_0x1fefce[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x5339a3[_0x5a59('0x3f')],qs['fields'](_0x3095c3[_0x5a59('0x40')]['fields']));_0x1fefce[_0x5a59('0x43')]=_0x1fefce[_0x5a59('0x43')][_0x5a59('0x46')]?_0x1fefce[_0x5a59('0x43')]:_0x5339a3[_0x5a59('0x3f')];if(!_0x3095c3[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x1fefce[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x3095c3[_0x5a59('0x40')][_0x5a59('0x30')]);_0x1fefce[_0x5a59('0x2d')]=qs['offset'](_0x3095c3[_0x5a59('0x40')]['offset']);}_0x1fefce[_0x5a59('0x48')]=qs['sort'](_0x3095c3[_0x5a59('0x40')][_0x5a59('0x49')]);_0x1fefce['where']=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x3095c3[_0x5a59('0x40')],_0x5339a3[_0x5a59('0x42')]));_0x1fefce[_0x5a59('0x4b')][_0x5a59('0x5f')]=_0xa9fdd3['id'];if(_0x3095c3[_0x5a59('0x40')][_0x5a59('0x4a')]){_0x1fefce[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x1fefce['where'],{'$or':_[_0x5a59('0x3c')](_0x1fefce[_0x5a59('0x43')],function(_0x37078b){var _0x116809={};_0x116809[_0x37078b]={'$like':'%'+_0x3095c3[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x116809;})});}_0x1fefce=_[_0x5a59('0x4c')]({},_0x1fefce,_0x3095c3[_0x5a59('0x4e')]);return db[_0x5a59('0xd3')][_0x5a59('0x2f')]({'where':_0x1fefce[_0x5a59('0x4b')]})[_0x5a59('0x1e')](function(_0x2c5345){_0x5b68e2['count']=_0x2c5345;if(_0x3095c3['query'][_0x5a59('0x50')]){_0x1fefce[_0x5a59('0x51')]=[{'all':!![]}];}else{_0x1fefce[_0x5a59('0x51')]=[{'model':db[_0x5a59('0x8c')],'as':_0x5a59('0x124'),'required':![]},{'model':db['Attachment'],'as':_0x5a59('0x125'),'required':![]}];}return db[_0x5a59('0xd3')][_0x5a59('0x52')](_0x1fefce);})['then'](function(_0x15c16f){_0x5b68e2['rows']=_0x15c16f;return _0x5b68e2;});}})['then'](respondWithFilteredResult(_0x352831,_0x1fefce))[_0x5a59('0x28')](handleError(_0x352831,null));};exports[_0x5a59('0x126')]=function(_0x395738,_0x48b5a0,_0x652c84){return db['ChatWebsite']['find']({'where':{'id':_0x395738[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x48b5a0,null))[_0x5a59('0x1e')](function(_0x110ce8){if(_0x110ce8){return _0x110ce8[_0x5a59('0x126')](_0x395738['body']['ids'],_[_0x5a59('0x11c')](_0x395738['body'],[_0x5a59('0x6a'),'id'])||{})['spread'](function(_0x4decae){for(var _0x512849=0x0;_0x512849<_0x395738[_0x5a59('0x57')][_0x5a59('0x6a')][_0x5a59('0x46')];_0x512849+=0x1){socket[_0x5a59('0x127')](_0x5a59('0x128'),{'UserId':Number(_0x395738[_0x5a59('0x57')][_0x5a59('0x6a')][_0x512849]),'ChatWebsiteId':Number(_0x395738[_0x5a59('0x54')]['id'])});}return _0x4decae;});}})['then'](respondWithResult(_0x48b5a0,null))[_0x5a59('0x28')](handleError(_0x48b5a0,null));};exports['removeAgents']=function(_0x500eaf,_0x2aec84,_0xfdb711){return db[_0x5a59('0x4f')][_0x5a59('0x55')]({'where':{'id':_0x500eaf[_0x5a59('0x54')]['id']}})[_0x5a59('0x1e')](handleEntityNotFound(_0x2aec84,null))[_0x5a59('0x1e')](function(_0x962af6){if(_0x962af6){return _0x962af6[_0x5a59('0x129')](_0x500eaf[_0x5a59('0x40')]['ids'])[_0x5a59('0x1e')](function(){if(_['isArray'](_0x500eaf['query']['ids'])){for(var _0x917bb8=0x0;_0x917bb8<_0x500eaf['query'][_0x5a59('0x6a')][_0x5a59('0x46')];_0x917bb8+=0x1){socket[_0x5a59('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x500eaf[_0x5a59('0x40')][_0x5a59('0x6a')][_0x917bb8]),'ChatWebsiteId':Number(_0x500eaf['params']['id'])});}}else{socket[_0x5a59('0x127')](_0x5a59('0x12a'),{'UserId':Number(_0x500eaf[_0x5a59('0x40')][_0x5a59('0x6a')]),'ChatWebsiteId':Number(_0x500eaf['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2aec84,null))[_0x5a59('0x28')](handleError(_0x2aec84,null));};exports[_0x5a59('0x12b')]=function(_0x2ddede,_0x158dcb,_0xfc5e76){var _0x3424ca={};var _0x3170ce={};var _0x4abe73;var _0xd9682c;return db[_0x5a59('0x4f')][_0x5a59('0x61')]({'where':{'id':_0x2ddede[_0x5a59('0x54')]['id']}})['then'](handleEntityNotFound(_0x158dcb,null))[_0x5a59('0x1e')](function(_0x1e2b3f){if(_0x1e2b3f){_0x4abe73=_0x1e2b3f;_0x3170ce[_0x5a59('0x3f')]=_[_0x5a59('0x41')](db['User'][_0x5a59('0x3d')]);_0x3170ce[_0x5a59('0x40')]=_[_0x5a59('0x41')](_0x2ddede[_0x5a59('0x40')]);_0x3170ce['filters']=_[_0x5a59('0x44')](_0x3170ce['model'],_0x3170ce['query']);_0x3424ca[_0x5a59('0x43')]=_[_0x5a59('0x44')](_0x3170ce['model'],qs[_0x5a59('0x45')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x45')]));_0x3424ca[_0x5a59('0x43')]=_0x3424ca[_0x5a59('0x43')]['length']?_0x3424ca['attributes']:_0x3170ce[_0x5a59('0x3f')];_0x3424ca['order']=qs[_0x5a59('0x49')](_0x2ddede['query'][_0x5a59('0x49')]);_0x3424ca[_0x5a59('0x4b')]=qs[_0x5a59('0x42')](_[_0x5a59('0x62')](_0x2ddede[_0x5a59('0x40')],_0x3170ce[_0x5a59('0x42')]));if(_0x2ddede['query'][_0x5a59('0x4a')]){_0x3424ca[_0x5a59('0x4b')]=_[_0x5a59('0x4c')](_0x3424ca[_0x5a59('0x4b')],{'$or':_[_0x5a59('0x3c')](_0x3424ca[_0x5a59('0x43')],function(_0x213bca){var _0x1e968c={};_0x1e968c[_0x213bca]={'$like':'%'+_0x2ddede[_0x5a59('0x40')][_0x5a59('0x4a')]+'%'};return _0x1e968c;})});}_0x3424ca=_[_0x5a59('0x4c')]({},_0x3424ca,_0x2ddede[_0x5a59('0x4e')]);return _0x4abe73[_0x5a59('0x12b')](_0x3424ca);}})[_0x5a59('0x1e')](function(_0x202b3d){if(_0x202b3d){_0xd9682c=_0x202b3d['length'];if(!_0x2ddede[_0x5a59('0x40')][_0x5a59('0x47')](_0x5a59('0x68'))){_0x3424ca[_0x5a59('0x30')]=qs[_0x5a59('0x30')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x30')]);_0x3424ca['offset']=qs[_0x5a59('0x2d')](_0x2ddede[_0x5a59('0x40')][_0x5a59('0x2d')]);}return _0x4abe73[_0x5a59('0x12b')](_0x3424ca);}})[_0x5a59('0x1e')](function(_0x39599f){if(_0x39599f){return _0x39599f?{'count':_0xd9682c,'rows':_0x39599f}:null;}})[_0x5a59('0x1e')](respondWithResult(_0x158dcb,null))[_0x5a59('0x28')](handleError(_0x158dcb,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index a5e454d..508339e 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 _0x795a=['exports','../../mysqldb','ChatWebsite','save','remove','emit','hasOwnProperty'];(function(_0x45e488,_0x3b5665){var _0x2c4fbc=function(_0x509886){while(--_0x509886){_0x45e488['push'](_0x45e488['shift']());}};_0x2c4fbc(++_0x3b5665);}(_0x795a,0xa2));var _0xa795=function(_0x2fb89a,_0x49823a){_0x2fb89a=_0x2fb89a-0x0;var _0x4460d5=_0x795a[_0x2fb89a];return _0x4460d5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xa795('0x0'))['db'][_0xa795('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa795('0x2'),'afterUpdate':'update','afterDestroy':_0xa795('0x3')};function emitEvent(_0x1651a6){return function(_0x4ce3a0,_0x4f7e4e,_0x174575){ChatWebsiteEvents[_0xa795('0x4')](_0x1651a6+':'+_0x4ce3a0['id'],_0x4ce3a0);ChatWebsiteEvents[_0xa795('0x4')](_0x1651a6,_0x4ce3a0);_0x174575(null);};}for(var e in events){if(events[_0xa795('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xa795('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0xfd0f=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x48b764,_0x36a3be){_0x48b764=_0x48b764-0x0;var _0x1a4d80=_0xfd0f[_0x48b764];return _0x1a4d80;};'use strict';var EventEmitter=require(_0xffd0('0x0'));var ChatWebsite=require(_0xffd0('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xffd0('0x2')](0x0);var events={'afterCreate':_0xffd0('0x3'),'afterUpdate':_0xffd0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33e4d8){return function(_0x5e9c0a,_0x303f38,_0x45ecf8){ChatWebsiteEvents[_0xffd0('0x5')](_0x33e4d8+':'+_0x5e9c0a['id'],_0x5e9c0a);ChatWebsiteEvents[_0xffd0('0x5')](_0x33e4d8,_0x5e9c0a);_0x45ecf8(null);};}for(var e in events){if(events[_0xffd0('0x6')](e)){var event=events[e];ChatWebsite[_0xffd0('0x7')](e,emitEvent(event));}}module[_0xffd0('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fb6a9fb..6f20ac8 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 _0xbd0a=['rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','bluebird','request-promise'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xbd0a,0x13c));var _0xabd0=function(_0x164ad3,_0x56ccbe){_0x164ad3=_0x164ad3-0x0;var _0x5393a1=_0xbd0a[_0x164ad3];return _0x5393a1;};'use strict';var _=require(_0xabd0('0x0'));var util=require(_0xabd0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xabd0('0x2'));var rp=require(_0xabd0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabd0('0x4'));var config=require(_0xabd0('0x5'));var attributes=require(_0xabd0('0x6'));module[_0xabd0('0x7')]=function(_0x4aeb16,_0xe652d7){return _0x4aeb16['define'](_0xabd0('0x8'),attributes,{'tableName':_0xabd0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44f3=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0x44f3,0xc1));var _0x344f=function(_0x3689a2,_0x1be4ee){_0x3689a2=_0x3689a2-0x0;var _0x14b146=_0x44f3[_0x3689a2];return _0x14b146;};'use strict';var _=require('lodash');var util=require(_0x344f('0x0'));var logger=require(_0x344f('0x1'))(_0x344f('0x2'));var moment=require(_0x344f('0x3'));var BPromise=require(_0x344f('0x4'));var rp=require(_0x344f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x344f('0x6'));var config=require(_0x344f('0x7'));var attributes=require(_0x344f('0x8'));module[_0x344f('0x9')]=function(_0x5bc4ba,_0x53a536){return _0x5bc4ba[_0x344f('0xa')](_0x344f('0xb'),attributes,{'tableName':_0x344f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 4221ddb..dfa69db 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 _0x878e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x8db656,_0x5784b1){var _0x5ed99f=function(_0xb8ff48){while(--_0xb8ff48){_0x8db656['push'](_0x8db656['shift']());}};_0x5ed99f(++_0x5784b1);}(_0x878e,0x1e1));var _0xe878=function(_0x1b143b,_0x4697e){_0x1b143b=_0x1b143b-0x0;var _0xf48cc7=_0x878e[_0x1b143b];return _0xf48cc7;};'use strict';var _=require(_0xe878('0x0'));var util=require(_0xe878('0x1'));var moment=require(_0xe878('0x2'));var BPromise=require(_0xe878('0x3'));var rs=require(_0xe878('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe878('0x5'))['db'];var utils=require(_0xe878('0x6'));var logger=require(_0xe878('0x7'))(_0xe878('0x8'));var config=require(_0xe878('0x9'));var jayson=require(_0xe878('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xe878('0xb')]=_[_0xe878('0xc')](config['redis'],{'host':_0xe878('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe878('0xb')]));require(_0xe878('0xe'))[_0xe878('0xf')](socket);function respondWithRpcPromise(_0x4829a0,_0x358c7c,_0x2075f3){return new BPromise(function(_0x1308ca,_0x5ca0a0){return client['request'](_0x4829a0,_0x2075f3)[_0xe878('0x10')](function(_0x54cad9){logger[_0xe878('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x358c7c,_0xe878('0x12'));logger[_0xe878('0x13')](_0xe878('0x14'),_0x358c7c,_0xe878('0x12'),JSON[_0xe878('0x15')](_0x54cad9));if(_0x54cad9[_0xe878('0x16')]){if(_0x54cad9[_0xe878('0x16')][_0xe878('0x17')]===0x1f4){logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x54cad9[_0xe878('0x16')]['message']);return _0x5ca0a0(_0x54cad9[_0xe878('0x16')][_0xe878('0x19')]);}logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x54cad9[_0xe878('0x16')]['message']);return _0x1308ca(_0x54cad9[_0xe878('0x16')][_0xe878('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x358c7c,_0xe878('0x12'));_0x1308ca(_0x54cad9[_0xe878('0x1a')]['message']);}})['catch'](function(_0x33cf44){logger[_0xe878('0x16')](_0xe878('0x18'),_0x358c7c,_0x33cf44);_0x5ca0a0(_0x33cf44);});});} \ No newline at end of file +var _0x70d7=['debug','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x70d7,0xc7));var _0x770d=function(_0x43384e,_0x5ba50a){_0x43384e=_0x43384e-0x0;var _0x267ac6=_0x70d7[_0x43384e];return _0x267ac6;};'use strict';var _=require(_0x770d('0x0'));var util=require(_0x770d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x770d('0x2'));var fs=require('fs');var Redis=require(_0x770d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x770d('0x4'));var logger=require('../../config/logger')(_0x770d('0x5'));var config=require('../../config/environment');var jayson=require(_0x770d('0x6'));var client=jayson[_0x770d('0x7')]['http']({'port':0x232a});config[_0x770d('0x8')]=_[_0x770d('0x9')](config[_0x770d('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x770d('0xa'))(new Redis(config[_0x770d('0x8')]));require(_0x770d('0xb'))[_0x770d('0xc')](socket);function respondWithRpcPromise(_0x3cbeb8,_0x1ccc5a,_0x57e7de){return new BPromise(function(_0x36f3bd,_0x21af4b){return client['request'](_0x3cbeb8,_0x57e7de)[_0x770d('0xd')](function(_0x5bb87b){logger[_0x770d('0xe')](_0x770d('0xf'),_0x1ccc5a,_0x770d('0x10'));logger[_0x770d('0x11')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1ccc5a,_0x770d('0x10'),JSON[_0x770d('0x12')](_0x5bb87b));if(_0x5bb87b[_0x770d('0x13')]){if(_0x5bb87b[_0x770d('0x13')][_0x770d('0x14')]===0x1f4){logger[_0x770d('0x13')](_0x770d('0xf'),_0x1ccc5a,_0x5bb87b[_0x770d('0x13')][_0x770d('0x15')]);return _0x21af4b(_0x5bb87b['error'][_0x770d('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1ccc5a,_0x5bb87b['error']['message']);return _0x36f3bd(_0x5bb87b['error'][_0x770d('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1ccc5a,_0x770d('0x10'));_0x36f3bd(_0x5bb87b[_0x770d('0x16')][_0x770d('0x15')]);}})[_0x770d('0x17')](function(_0x364dc6){logger[_0x770d('0x13')](_0x770d('0xf'),_0x1ccc5a,_0x364dc6);_0x21af4b(_0x364dc6);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index d0a56af..ef1a56c 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 _0xf700=['save','remove','update','chatWebsite:','./chatWebsite.events'];(function(_0x2f3168,_0x1ee88a){var _0x1fa716=function(_0x33c240){while(--_0x33c240){_0x2f3168['push'](_0x2f3168['shift']());}};_0x1fa716(++_0x1ee88a);}(_0xf700,0xc7));var _0x0f70=function(_0x2ecc6f,_0x25b176){_0x2ecc6f=_0x2ecc6f-0x0;var _0x27f30e=_0xf700[_0x2ecc6f];return _0x27f30e;};'use strict';var ChatWebsiteEvents=require(_0x0f70('0x0'));var events=[_0x0f70('0x1'),_0x0f70('0x2'),_0x0f70('0x3')];function createListener(_0x45817e,_0x1e96e4){return function(_0x1ef282){_0x1e96e4['emit'](_0x45817e,_0x1ef282);};}function removeListener(_0x48adc8,_0x312eee){return function(){ChatWebsiteEvents['removeListener'](_0x48adc8,_0x312eee);};}exports['register']=function(_0x418f2d){for(var _0x5480de=0x0,_0x51851c=events['length'];_0x5480de<_0x51851c;_0x5480de++){var _0x6caee6=events[_0x5480de];var _0x3c1ac6=createListener(_0x0f70('0x4')+_0x6caee6,_0x418f2d);ChatWebsiteEvents['on'](_0x6caee6,_0x3c1ac6);}}; \ No newline at end of file +var _0xafa0=['register','length','chatWebsite:','./chatWebsite.events','remove','update','removeListener'];(function(_0x2d08d2,_0x22d0c1){var _0x5b91e9=function(_0x4c93b2){while(--_0x4c93b2){_0x2d08d2['push'](_0x2d08d2['shift']());}};_0x5b91e9(++_0x22d0c1);}(_0xafa0,0x1c3));var _0x0afa=function(_0x3f3106,_0x4c0729){_0x3f3106=_0x3f3106-0x0;var _0x596ee8=_0xafa0[_0x3f3106];return _0x596ee8;};'use strict';var ChatWebsiteEvents=require(_0x0afa('0x0'));var events=['save',_0x0afa('0x1'),_0x0afa('0x2')];function createListener(_0x2ae8e2,_0x1115ce){return function(_0x248bd8){_0x1115ce['emit'](_0x2ae8e2,_0x248bd8);};}function removeListener(_0x1f2647,_0xceb4a){return function(){ChatWebsiteEvents[_0x0afa('0x3')](_0x1f2647,_0xceb4a);};}exports[_0x0afa('0x4')]=function(_0x4f4f66){for(var _0xda2853=0x0,_0x4cc661=events[_0x0afa('0x5')];_0xda2853<_0x4cc661;_0xda2853++){var _0x4bb7b0=events[_0xda2853];var _0x2f411d=createListener(_0x0afa('0x6')+_0x4bb7b0,_0x4f4f66);ChatWebsiteEvents['on'](_0x4bb7b0,_0x2f411d);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index c1ef201..4a26711 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 _0x1a54=['./chatWebsite.controller','get','isAuthenticated','/describe','/:id','show','getDispositions','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','format','%s-%s','now','/:id/logo','single','file','addLogo','originalname','addAvatar','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1a54,0xde));var _0x41a5=function(_0x57e9d3,_0x3cad3c){_0x57e9d3=_0x57e9d3-0x0;var _0x180326=_0x1a54[_0x57e9d3];return _0x180326;};'use strict';var multer=require(_0x41a5('0x0'));var util=require(_0x41a5('0x1'));var path=require(_0x41a5('0x2'));var timeout=require(_0x41a5('0x3'));var express=require(_0x41a5('0x4'));var router=express[_0x41a5('0x5')]();var fs_extra=require(_0x41a5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x41a5('0x7'));var config=require(_0x41a5('0x8'));var controller=require(_0x41a5('0x9'));router[_0x41a5('0xa')]('/',auth[_0x41a5('0xb')](),controller['index']);router['get'](_0x41a5('0xc'),auth[_0x41a5('0xb')](),controller['describe']);router[_0x41a5('0xa')](_0x41a5('0xd'),auth[_0x41a5('0xb')](),controller[_0x41a5('0xe')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x41a5('0xf')]);router['get']('/:id/canned_answers',auth[_0x41a5('0xb')](),controller[_0x41a5('0x10')]);router[_0x41a5('0xa')]('/:id/logo',controller[_0x41a5('0x11')]);router[_0x41a5('0xa')]('/:id/avatar',controller[_0x41a5('0x12')]);router['get'](_0x41a5('0x13'),controller['getCustomerAvatar']);router[_0x41a5('0xa')]('/:id/system_avatar',controller[_0x41a5('0x14')]);router[_0x41a5('0xa')](_0x41a5('0x15'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x16')]);router[_0x41a5('0xa')](_0x41a5('0x17'),controller[_0x41a5('0x18')]);router[_0x41a5('0xa')](_0x41a5('0x19'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x1a')]);router[_0x41a5('0xa')](_0x41a5('0x1b'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x1c')]);router[_0x41a5('0xa')](_0x41a5('0x1d'),controller[_0x41a5('0x1e')]);router[_0x41a5('0xa')]('/:id/offline_messages',auth[_0x41a5('0xb')](),controller[_0x41a5('0x1f')]);router[_0x41a5('0xa')](_0x41a5('0x20'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x21')]);router[_0x41a5('0x22')]('/',auth[_0x41a5('0xb')](),controller['create']);router[_0x41a5('0x22')]('/:id/dispositions',auth[_0x41a5('0xb')](),controller[_0x41a5('0x23')]);router[_0x41a5('0x22')](_0x41a5('0x24'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x25')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x3af50f,_0x529258,_0x3e6c16){_0x3e6c16(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],'server/files/images/logos/'));},'filename':function(_0x53ff23,_0x2399ab,_0x998ba5){_0x998ba5(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x2399ab['originalname']));}})});router[_0x41a5('0x22')](_0x41a5('0x2c'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x2f')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x367830,_0x1d5bbc,_0x542493){_0x542493(null,path[_0x41a5('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x238ad8,_0x3fe431,_0xe01629){_0xe01629(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x3fe431[_0x41a5('0x30')]));}})});router[_0x41a5('0x22')]('/:id/avatar',upload[_0x41a5('0x2d')]('file'),controller[_0x41a5('0x31')]);var upload=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x4c8502,_0x1dab80,_0x48e262){_0x48e262(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x32')));},'filename':function(_0x51b8ca,_0x7a0d57,_0x3ca0c2){_0x3ca0c2(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x7a0d57[_0x41a5('0x30')]));}})});router[_0x41a5('0x22')](_0x41a5('0x13'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43441b,_0x16f235,_0x394c14){_0x394c14(null,path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x32')));},'filename':function(_0x20fd68,_0x493bff,_0x151809){_0x151809(null,util[_0x41a5('0x29')](_0x41a5('0x2a'),Date[_0x41a5('0x2b')](),_0x493bff['originalname']));}})});router[_0x41a5('0x22')](_0x41a5('0x34'),upload[_0x41a5('0x2d')](_0x41a5('0x2e')),controller[_0x41a5('0x35')]);router[_0x41a5('0x22')](_0x41a5('0x36'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x41a5('0x26')]({'destination':function(_0x245278,_0x18fd18,_0x5121cd){const _0xa40214=path[_0x41a5('0x27')](config[_0x41a5('0x28')],_0x41a5('0x37'),_0x41a5('0x38'),_0x41a5('0x39'));fs_extra[_0x41a5('0x3a')](_0xa40214,function(){_0x5121cd(null,_0xa40214);});},'filename':function(_0x3f9d88,_0x54b834,_0xf2cbbc){const _0x438228=_0x54b834[_0x41a5('0x30')][_0x41a5('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x418f17=path[_0x41a5('0x3c')](_0x438228);const _0xe5ed1b=Date[_0x41a5('0x2b')]()+'-'+_0x438228[_0x41a5('0x3b')](_0x418f17,'')+_0x418f17;_0xf2cbbc(null,_0xe5ed1b);}})});router[_0x41a5('0x22')](_0x41a5('0x3d'),offlineUploadMulter[_0x41a5('0x3e')](),controller[_0x41a5('0x3f')]);router[_0x41a5('0x22')](_0x41a5('0x15'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x40')]);router[_0x41a5('0x22')](_0x41a5('0x19'),auth['isAuthenticated'](),controller[_0x41a5('0x41')]);router[_0x41a5('0x22')](_0x41a5('0x1b'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x42')]);router['post'](_0x41a5('0x20'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x43')]);router[_0x41a5('0x44')](_0x41a5('0xd'),auth[_0x41a5('0xb')](),controller[_0x41a5('0x45')]);router[_0x41a5('0x46')](_0x41a5('0xd'),auth['isAuthenticated'](),controller[_0x41a5('0x47')]);router[_0x41a5('0x46')](_0x41a5('0x48'),auth['isAuthenticated'](),controller[_0x41a5('0x49')]);router[_0x41a5('0x46')]('/:id/canned_answers',auth[_0x41a5('0xb')](),controller[_0x41a5('0x4a')]);router[_0x41a5('0x46')]('/:id/users',auth[_0x41a5('0xb')](),controller[_0x41a5('0x4b')]);module[_0x41a5('0x4c')]=router; \ No newline at end of file +var _0x76a0=['root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','addLogo','now','file','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','diskStorage','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','/:id/applications','addApplications','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','join'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0x76a0,0x68));var _0x076a=function(_0x7bfe1b,_0x3eb3c3){_0x7bfe1b=_0x7bfe1b-0x0;var _0x24e555=_0x76a0[_0x7bfe1b];return _0x24e555;};'use strict';var multer=require(_0x076a('0x0'));var util=require(_0x076a('0x1'));var path=require('path');var timeout=require(_0x076a('0x2'));var express=require('express');var router=express[_0x076a('0x3')]();var fs_extra=require(_0x076a('0x4'));var auth=require(_0x076a('0x5'));var interaction=require(_0x076a('0x6'));var config=require(_0x076a('0x7'));var controller=require(_0x076a('0x8'));router[_0x076a('0x9')]('/',auth[_0x076a('0xa')](),controller[_0x076a('0xb')]);router[_0x076a('0x9')]('/describe',auth[_0x076a('0xa')](),controller[_0x076a('0xc')]);router[_0x076a('0x9')]('/:id',auth[_0x076a('0xa')](),controller[_0x076a('0xd')]);router[_0x076a('0x9')](_0x076a('0xe'),auth[_0x076a('0xa')](),controller[_0x076a('0xf')]);router[_0x076a('0x9')]('/:id/canned_answers',auth[_0x076a('0xa')](),controller[_0x076a('0x10')]);router[_0x076a('0x9')]('/:id/logo',controller[_0x076a('0x11')]);router[_0x076a('0x9')](_0x076a('0x12'),controller[_0x076a('0x13')]);router[_0x076a('0x9')](_0x076a('0x14'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0x076a('0x15')]);router[_0x076a('0x9')](_0x076a('0x16'),auth['isAuthenticated'](),controller[_0x076a('0x17')]);router[_0x076a('0x9')](_0x076a('0x18'),controller[_0x076a('0x19')]);router[_0x076a('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x076a('0x1a')]);router[_0x076a('0x9')](_0x076a('0x1b'),auth[_0x076a('0xa')](),controller[_0x076a('0x1c')]);router[_0x076a('0x9')](_0x076a('0x1d'),controller[_0x076a('0x1e')]);router[_0x076a('0x9')](_0x076a('0x1f'),auth[_0x076a('0xa')](),controller[_0x076a('0x20')]);router[_0x076a('0x9')](_0x076a('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x076a('0x22')]('/',auth[_0x076a('0xa')](),controller[_0x076a('0x23')]);router[_0x076a('0x22')](_0x076a('0xe'),auth['isAuthenticated'](),controller[_0x076a('0x24')]);router[_0x076a('0x22')](_0x076a('0x25'),auth[_0x076a('0xa')](),controller[_0x076a('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x320438,_0xf954a8,_0x20b282){_0x20b282(null,path[_0x076a('0x27')](config[_0x076a('0x28')],_0x076a('0x29')));},'filename':function(_0x5b1e45,_0x537623,_0x1407fc){_0x1407fc(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date['now'](),_0x537623[_0x076a('0x2c')]));}})});router[_0x076a('0x22')](_0x076a('0x2d'),upload['single']('file'),controller[_0x076a('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x54680c,_0x4a0d85,_0x59eeee){_0x59eeee(null,path[_0x076a('0x27')](config[_0x076a('0x28')],'server/files/images/avatars/'));},'filename':function(_0x827c41,_0xf99590,_0x2811b9){_0x2811b9(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0xf99590[_0x076a('0x2c')]));}})});router['post'](_0x076a('0x12'),upload['single'](_0x076a('0x30')),controller[_0x076a('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x588356,_0x58dd94,_0x4fa5d9){_0x4fa5d9(null,path[_0x076a('0x27')](config[_0x076a('0x28')],_0x076a('0x32')));},'filename':function(_0x27aff6,_0x4cbc21,_0x37c8c4){_0x37c8c4(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0x4cbc21[_0x076a('0x2c')]));}})});router[_0x076a('0x22')](_0x076a('0x14'),upload[_0x076a('0x33')]('file'),controller[_0x076a('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5429db,_0x419ae6,_0x1075a6){_0x1075a6(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x3817e7,_0x37d0c3,_0x554d14){_0x554d14(null,util[_0x076a('0x2a')](_0x076a('0x2b'),Date[_0x076a('0x2f')](),_0x37d0c3[_0x076a('0x2c')]));}})});router['post'](_0x076a('0x35'),upload['single'](_0x076a('0x30')),controller[_0x076a('0x36')]);router[_0x076a('0x22')](_0x076a('0x37'),controller[_0x076a('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x076a('0x39')]({'destination':function(_0x1226db,_0x305f44,_0xa0ea2c){const _0x2a9e97=path[_0x076a('0x27')](config['root'],_0x076a('0x3a'),_0x076a('0x3b'),'offline-chat');fs_extra[_0x076a('0x3c')](_0x2a9e97,function(){_0xa0ea2c(null,_0x2a9e97);});},'filename':function(_0x58b2d4,_0x47ff10,_0x29f23c){const _0x1cbd37=_0x47ff10[_0x076a('0x2c')][_0x076a('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc32d98=path[_0x076a('0x3e')](_0x1cbd37);const _0x8ccbe0=Date['now']()+'-'+_0x1cbd37['replace'](_0xc32d98,'')+_0xc32d98;_0x29f23c(null,_0x8ccbe0);}})});router[_0x076a('0x22')](_0x076a('0x3f'),offlineUploadMulter[_0x076a('0x40')](),controller['offline']);router[_0x076a('0x22')]('/:id/interactions',auth[_0x076a('0xa')](),controller['addInteraction']);router[_0x076a('0x22')](_0x076a('0x41'),auth[_0x076a('0xa')](),controller[_0x076a('0x42')]);router[_0x076a('0x22')](_0x076a('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x076a('0x21'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x076a('0xa')](),controller['update']);router[_0x076a('0x43')]('/:id',auth[_0x076a('0xa')](),controller[_0x076a('0x44')]);router[_0x076a('0x43')]('/:id/dispositions',auth[_0x076a('0xa')](),controller[_0x076a('0x45')]);router[_0x076a('0x43')](_0x076a('0x25'),auth[_0x076a('0xa')](),controller['removeAnswers']);router['delete'](_0x076a('0x21'),auth[_0x076a('0xa')](),controller[_0x076a('0x46')]);module[_0x076a('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 6aeb3f4..92c71c1 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 _0x0618=['exports','ENUM','AmazonAWS','STRING','sequelize'];(function(_0x3f8f4a,_0x1b41db){var _0x1e179e=function(_0x5557e0){while(--_0x5557e0){_0x3f8f4a['push'](_0x3f8f4a['shift']());}};_0x1e179e(++_0x1b41db);}(_0x0618,0x1c6));var _0x8061=function(_0xed2989,_0x35b120){_0xed2989=_0xed2989-0x0;var _0x4e6b11=_0x0618[_0xed2989];return _0x4e6b11;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8061('0x2')](_0x8061('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x8061('0x4')]}}; \ No newline at end of file +var _0xb46f=['Google','STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x4c887a,_0x3e4d93){var _0x604810=function(_0x153ece){while(--_0x153ece){_0x4c887a['push'](_0x4c887a['shift']());}};_0x604810(++_0x3e4d93);}(_0xb46f,0xb6));var _0xfb46=function(_0x2f06a0,_0x4c9c08){_0x2f06a0=_0x2f06a0-0x0;var _0xc77f94=_0xb46f[_0x2f06a0];return _0xc77f94;};'use strict';var Sequelize=require(_0xfb46('0x0'));module[_0xfb46('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xfb46('0x2')](_0xfb46('0x3'),_0xfb46('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xfb46('0x5')]},'data2':{'type':Sequelize[_0xfb46('0x5')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 23a260f..c605ed9 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x2cebb8,_0x5c4767){var _0x27ea64=function(_0x2ae721){while(--_0x2ae721){_0x2cebb8['push'](_0x2cebb8['shift']());}};_0x27ea64(++_0x5c4767);}(_0x2ef3,0xba));var _0x32ef=function(_0x3be5d4,_0x537f82){_0x3be5d4=_0x3be5d4-0x0;var _0x17394d=_0x2ef3[_0x3be5d4];return _0x17394d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x30638f,_0x33b6ec){var _0xed4d2=function(_0x4fa757){while(--_0x4fa757){_0x30638f['push'](_0x30638f['shift']());}};_0xed4d2(++_0x33b6ec);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d033a,_0x444d0d){_0x5d033a=_0x5d033a-0x0;var _0x9f5b59=_0x2ef3[_0x5d033a];return _0x9f5b59;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 0117a16..a200bea 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 _0x622f=['../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','../../config/logger','api','moment','request-promise'];(function(_0x2e4d84,_0x42dd83){var _0x53f832=function(_0x5b9964){while(--_0x5b9964){_0x2e4d84['push'](_0x2e4d84['shift']());}};_0x53f832(++_0x42dd83);}(_0x622f,0x71));var _0xf622=function(_0x459ce0,_0x4906ab){_0x459ce0=_0x459ce0-0x0;var _0x1a4a41=_0x622f[_0x459ce0];return _0x1a4a41;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf622('0x0'))(_0xf622('0x1'));var moment=require(_0xf622('0x2'));var BPromise=require('bluebird');var rp=require(_0xf622('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf622('0x4'));var attributes=require(_0xf622('0x5'));module['exports']=function(_0x1f92ef,_0x188133){return _0x1f92ef[_0xf622('0x6')](_0xf622('0x7'),attributes,{'tableName':_0xf622('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a1f=['moment','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger','api'];(function(_0x6cf3b6,_0x4b7560){var _0xdbe948=function(_0x1504d6){while(--_0x1504d6){_0x6cf3b6['push'](_0x6cf3b6['shift']());}};_0xdbe948(++_0x4b7560);}(_0x3a1f,0x188));var _0xf3a1=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x3a1f[_0x5b561d];return _0x431060;};'use strict';var _=require(_0xf3a1('0x0'));var util=require(_0xf3a1('0x1'));var logger=require(_0xf3a1('0x2'))(_0xf3a1('0x3'));var moment=require(_0xf3a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3a1('0x5'));var fs=require('fs');var path=require(_0xf3a1('0x6'));var rimraf=require(_0xf3a1('0x7'));var config=require(_0xf3a1('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xf3a1('0x9')]=function(_0x276744,_0x2e5691){return _0x276744[_0xf3a1('0xa')](_0xf3a1('0xb'),attributes,{'tableName':'cloud_providers','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 ed6e027..c7ab519 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 _0xd481=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x4aeed0,_0x4b6534){var _0x5a27f4=function(_0x5de2a5){while(--_0x5de2a5){_0x4aeed0['push'](_0x4aeed0['shift']());}};_0x5a27f4(++_0x4b6534);}(_0xd481,0x1e4));var _0x1d48=function(_0x121b85,_0x599aa2){_0x121b85=_0x121b85-0x0;var _0x46347a=_0xd481[_0x121b85];return _0x46347a;};'use strict';var _=require(_0x1d48('0x0'));var util=require('util');var moment=require(_0x1d48('0x1'));var BPromise=require(_0x1d48('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d48('0x3'));var db=require(_0x1d48('0x4'))['db'];var utils=require(_0x1d48('0x5'));var logger=require('../../config/logger')(_0x1d48('0x6'));var config=require('../../config/environment');var jayson=require(_0x1d48('0x7'));var client=jayson[_0x1d48('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472584,_0x3099cc,_0x3b8bd4){return new BPromise(function(_0x27c383,_0x1fc969){return client[_0x1d48('0x9')](_0x472584,_0x3b8bd4)[_0x1d48('0xa')](function(_0x303dce){logger[_0x1d48('0xb')](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));logger[_0x1d48('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3099cc,_0x1d48('0xd'),JSON[_0x1d48('0xf')](_0x303dce));if(_0x303dce[_0x1d48('0x10')]){if(_0x303dce[_0x1d48('0x10')][_0x1d48('0x11')]===0x1f4){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x1fc969(_0x303dce[_0x1d48('0x10')]['message']);}logger[_0x1d48('0x10')]('CloudProvider,\x20%s,\x20%s',_0x3099cc,_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);return _0x27c383(_0x303dce[_0x1d48('0x10')][_0x1d48('0x12')]);}else{logger['info'](_0x1d48('0xc'),_0x3099cc,_0x1d48('0xd'));_0x27c383(_0x303dce[_0x1d48('0x13')]['message']);}})[_0x1d48('0x14')](function(_0x433c92){logger[_0x1d48('0x10')](_0x1d48('0xc'),_0x3099cc,_0x433c92);_0x1fc969(_0x433c92);});});} \ No newline at end of file +var _0x09df=['rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','CloudProvider,\x20%s,\x20%s','message','lodash','util','bluebird','../../mysqldb'];(function(_0x589aab,_0x4de83a){var _0x372b62=function(_0x51de11){while(--_0x51de11){_0x589aab['push'](_0x589aab['shift']());}};_0x372b62(++_0x4de83a);}(_0x09df,0x164));var _0xf09d=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x09df[_0x1cd47d];return _0x29d52f;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var moment=require('moment');var BPromise=require(_0xf09d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf09d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf09d('0x4'));var config=require(_0xf09d('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x284a42,_0x48b82f,_0x28c91c){return new BPromise(function(_0x2555c7,_0x2f1810){return client[_0xf09d('0x6')](_0x284a42,_0x28c91c)[_0xf09d('0x7')](function(_0x2a59a8){logger[_0xf09d('0x8')]('CloudProvider,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'));logger[_0xf09d('0xa')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x48b82f,_0xf09d('0x9'),JSON['stringify'](_0x2a59a8));if(_0x2a59a8[_0xf09d('0xb')]){if(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xc')]===0x1f4){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2f1810(_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);}logger['error'](_0xf09d('0xd'),_0x48b82f,_0x2a59a8[_0xf09d('0xb')][_0xf09d('0xe')]);return _0x2555c7(_0x2a59a8['error']['message']);}else{logger[_0xf09d('0x8')](_0xf09d('0xd'),_0x48b82f,_0xf09d('0x9'));_0x2555c7(_0x2a59a8['result'][_0xf09d('0xe')]);}})['catch'](function(_0x3614f7){logger[_0xf09d('0xb')](_0xf09d('0xd'),_0x48b82f,_0x3614f7);_0x2f1810(_0x3614f7);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index ea38a95..5c27b3e 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 _0xd997=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x2a746e,_0xa993ae){var _0x2331ac=function(_0x244ee1){while(--_0x244ee1){_0x2a746e['push'](_0x2a746e['shift']());}};_0x2331ac(++_0xa993ae);}(_0xd997,0x1a0));var _0x7d99=function(_0x48ed76,_0x579d6a){_0x48ed76=_0x48ed76-0x0;var _0x4cb322=_0xd997[_0x48ed76];return _0x4cb322;};'use strict';var multer=require(_0x7d99('0x0'));var util=require(_0x7d99('0x1'));var path=require(_0x7d99('0x2'));var timeout=require(_0x7d99('0x3'));var express=require(_0x7d99('0x4'));var router=express[_0x7d99('0x5')]();var fs_extra=require(_0x7d99('0x6'));var auth=require(_0x7d99('0x7'));var interaction=require(_0x7d99('0x8'));var config=require(_0x7d99('0x9'));var controller=require(_0x7d99('0xa'));router['get']('/',auth[_0x7d99('0xb')](),controller['index']);router[_0x7d99('0xc')](_0x7d99('0xd'),auth[_0x7d99('0xb')](),controller[_0x7d99('0xe')]);router[_0x7d99('0xf')]('/',auth[_0x7d99('0xb')](),controller[_0x7d99('0x10')]);router[_0x7d99('0x11')](_0x7d99('0xd'),auth['isAuthenticated'](),controller[_0x7d99('0x12')]);router['delete'](_0x7d99('0xd'),auth['isAuthenticated'](),controller[_0x7d99('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9336=['isAuthenticated','show','post','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','index','get'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9336,0x112));var _0x6933=function(_0x185d78,_0xf88d87){_0x185d78=_0x185d78-0x0;var _0x1743b5=_0x9336[_0x185d78];return _0x1743b5;};'use strict';var multer=require(_0x6933('0x0'));var util=require('util');var path=require(_0x6933('0x1'));var timeout=require(_0x6933('0x2'));var express=require(_0x6933('0x3'));var router=express[_0x6933('0x4')]();var fs_extra=require(_0x6933('0x5'));var auth=require(_0x6933('0x6'));var interaction=require(_0x6933('0x7'));var config=require('../../config/environment');var controller=require(_0x6933('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6933('0x9')]);router[_0x6933('0xa')]('/:id',auth[_0x6933('0xb')](),controller[_0x6933('0xc')]);router[_0x6933('0xd')]('/',auth[_0x6933('0xb')](),controller[_0x6933('0xe')]);router[_0x6933('0xf')](_0x6933('0x10'),auth[_0x6933('0xb')](),controller[_0x6933('0x11')]);router['delete'](_0x6933('0x10'),auth[_0x6933('0xb')](),controller['destroy']);module[_0x6933('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 46455ea..8f17566 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 _0xcf64=['STRING','sequelize','exports'];(function(_0x59bc71,_0x5388ca){var _0x49142b=function(_0x3b620b){while(--_0x3b620b){_0x59bc71['push'](_0x59bc71['shift']());}};_0x49142b(++_0x5388ca);}(_0xcf64,0x15a));var _0x4cf6=function(_0x4b5c20,_0x55c19e){_0x4b5c20=_0x4b5c20-0x0;var _0x5b4cb2=_0xcf64[_0x4b5c20];return _0x5b4cb2;};'use strict';var Sequelize=require(_0x4cf6('0x0'));module[_0x4cf6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4cf6('0x2')]},'phone':{'type':Sequelize[_0x4cf6('0x2')]},'fax':{'type':Sequelize[_0x4cf6('0x2')]},'type':{'type':Sequelize[_0x4cf6('0x2')]},'street':{'type':Sequelize[_0x4cf6('0x2')]},'postalCode':{'type':Sequelize[_0x4cf6('0x2')]},'city':{'type':Sequelize[_0x4cf6('0x2')]},'country':{'type':Sequelize[_0x4cf6('0x2')]},'email':{'type':Sequelize[_0x4cf6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4cf6('0x2')]},'sStreet':{'type':Sequelize[_0x4cf6('0x2')]},'sPostalCode':{'type':Sequelize[_0x4cf6('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4cf6('0x2')]},'description':{'type':Sequelize[_0x4cf6('0x2')]}}; \ No newline at end of file +var _0x0aae=['sequelize','exports','STRING','name'];(function(_0x203879,_0x553507){var _0x283bf3=function(_0xc9a355){while(--_0xc9a355){_0x203879['push'](_0x203879['shift']());}};_0x283bf3(++_0x553507);}(_0x0aae,0xe0));var _0xe0aa=function(_0x33f63f,_0xae6f41){_0x33f63f=_0x33f63f-0x0;var _0x4c6e4a=_0x0aae[_0x33f63f];return _0x4c6e4a;};'use strict';var Sequelize=require(_0xe0aa('0x0'));module[_0xe0aa('0x1')]={'name':{'type':Sequelize[_0xe0aa('0x2')],'unique':_0xe0aa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe0aa('0x2')]},'companyId':{'type':Sequelize[_0xe0aa('0x2')]},'website':{'type':Sequelize[_0xe0aa('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe0aa('0x2')]},'type':{'type':Sequelize[_0xe0aa('0x2')]},'street':{'type':Sequelize[_0xe0aa('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe0aa('0x2')]},'country':{'type':Sequelize[_0xe0aa('0x2')]},'email':{'type':Sequelize[_0xe0aa('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xe0aa('0x2')]},'sPostalCode':{'type':Sequelize[_0xe0aa('0x2')]},'sCity':{'type':Sequelize[_0xe0aa('0x2')]},'sCountry':{'type':Sequelize[_0xe0aa('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index ff7cf28..ec07fc3 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 _0x3b23=['role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','order','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x1552a9,_0x3e8176){var _0x5eeb96=function(_0x1c3e96){while(--_0x1c3e96){_0x1552a9['push'](_0x1552a9['shift']());}};_0x5eeb96(++_0x3e8176);}(_0x3b23,0x1b9));var _0x33b2=function(_0xdfd079,_0x4ddb3d){_0xdfd079=_0xdfd079-0x0;var _0x5c9aed=_0x3b23[_0xdfd079];return _0x5c9aed;};'use strict';var emlformat=require(_0x33b2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33b2('0x1'));var rp=require(_0x33b2('0x2'));var moment=require(_0x33b2('0x3'));var BPromise=require(_0x33b2('0x4'));var Mustache=require(_0x33b2('0x5'));var util=require('util');var path=require(_0x33b2('0x6'));var sox=require(_0x33b2('0x7'));var csv=require(_0x33b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33b2('0x9'));var _=require(_0x33b2('0xa'));var squel=require(_0x33b2('0xb'));var crypto=require(_0x33b2('0xc'));var jsforce=require(_0x33b2('0xd'));var deskjs=require(_0x33b2('0xe'));var toCsv=require(_0x33b2('0x8'));var querystring=require('querystring');var Papa=require(_0x33b2('0xf'));var Redis=require(_0x33b2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33b2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x33b2('0x12'));var logger=require(_0x33b2('0x13'))(_0x33b2('0x14'));var utils=require(_0x33b2('0x15'));var config=require(_0x33b2('0x16'));var licenseUtil=require(_0x33b2('0x17'));var db=require(_0x33b2('0x18'))['db'];function respondWithStatusCode(_0x1c64d3,_0x5a0f04){_0x5a0f04=_0x5a0f04||0xcc;return function(_0x103e35){if(_0x103e35){return _0x1c64d3[_0x33b2('0x19')](_0x5a0f04);}return _0x1c64d3['status'](_0x5a0f04)['end']();};}function respondWithResult(_0x4bdcbd,_0x40270e){_0x40270e=_0x40270e||0xc8;return function(_0x40835d){if(_0x40835d){return _0x4bdcbd[_0x33b2('0x1a')](_0x40270e)[_0x33b2('0x1b')](_0x40835d);}};}function respondWithFilteredResult(_0x360de8,_0x4ab04b){return function(_0x417d5f){if(_0x417d5f){var _0x461b23=typeof _0x4ab04b[_0x33b2('0x1c')]===_0x33b2('0x1d')&&typeof _0x4ab04b[_0x33b2('0x1e')]===_0x33b2('0x1d');var _0x778f0d=_0x417d5f[_0x33b2('0x1f')];var _0x3b947a=_0x461b23?0x0:_0x4ab04b[_0x33b2('0x1c')];var _0x2984cb=_0x461b23?_0x417d5f[_0x33b2('0x1f')]:_0x4ab04b[_0x33b2('0x1c')]+_0x4ab04b[_0x33b2('0x1e')];var _0x1888ed;if(_0x2984cb>=_0x778f0d){_0x2984cb=_0x778f0d;_0x1888ed=0xc8;}else{_0x1888ed=0xce;}_0x360de8[_0x33b2('0x1a')](_0x1888ed);return _0x360de8[_0x33b2('0x20')](_0x33b2('0x21'),_0x3b947a+'-'+_0x2984cb+'/'+_0x778f0d)['json'](_0x417d5f);}return null;};}function patchUpdates(_0x3cf2b9){return function(_0x10a953){try{jsonpatch[_0x33b2('0x22')](_0x10a953,_0x3cf2b9,!![]);}catch(_0x5d5b4d){return BPromise[_0x33b2('0x23')](_0x5d5b4d);}return _0x10a953[_0x33b2('0x24')]();};}function saveUpdates(_0x53669f,_0x20ce5b){return function(_0x2e162c){if(_0x2e162c){return _0x2e162c['update'](_0x53669f)[_0x33b2('0x25')](function(_0x3eaddc){return _0x3eaddc;});}return null;};}function removeEntity(_0x4d2460,_0x297823){return function(_0x22df1e){if(_0x22df1e){return _0x22df1e['destroy']()[_0x33b2('0x25')](function(){var _0x43f0f1=_0x22df1e[_0x33b2('0x26')]({'plain':!![]});var _0x1cfd99=_0x33b2('0x27');return db[_0x33b2('0x28')]['destroy']({'where':{'type':_0x1cfd99,'resourceId':_0x43f0f1['id']}})[_0x33b2('0x25')](function(){return _0x22df1e;});})[_0x33b2('0x25')](function(){_0x4d2460[_0x33b2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eeeac,_0x2cb570){return function(_0xc5a0ac){if(!_0xc5a0ac){_0x2eeeac[_0x33b2('0x19')](0x194);}return _0xc5a0ac;};}function handleError(_0x2ad8b5,_0x700665){_0x700665=_0x700665||0x1f4;return function(_0x40eeed){logger[_0x33b2('0x29')](_0x40eeed[_0x33b2('0x2a')]);if(_0x40eeed[_0x33b2('0x2b')]){delete _0x40eeed[_0x33b2('0x2b')];}_0x2ad8b5[_0x33b2('0x1a')](_0x700665)[_0x33b2('0x2c')](_0x40eeed);};}exports[_0x33b2('0x2d')]=function(_0x18b25d,_0x32acaf){var _0x46db4a={},_0xeb558d={},_0x5c7ecb={'count':0x0,'rows':[]};return db[_0x33b2('0x2e')][_0x33b2('0x2f')]()[_0x33b2('0x25')](function(_0x4bbde4){_0xeb558d[_0x33b2('0x30')]=_[_0x33b2('0x31')](_0x4bbde4);_0xeb558d[_0x33b2('0x32')]=_['keys'](_0x18b25d['query']);_0xeb558d['filters']=_[_0x33b2('0x33')](_0xeb558d[_0x33b2('0x30')],_0xeb558d['query']);_0x46db4a[_0x33b2('0x34')]=_['intersection'](_0xeb558d[_0x33b2('0x30')],qs[_0x33b2('0x35')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x35')]));_0x46db4a[_0x33b2('0x34')]=_0x46db4a['attributes'][_0x33b2('0x36')]?_0x46db4a['attributes']:_0xeb558d[_0x33b2('0x30')];if(!_0x18b25d[_0x33b2('0x32')][_0x33b2('0x37')]('nolimit')){_0x46db4a[_0x33b2('0x1e')]=qs[_0x33b2('0x1e')](_0x18b25d['query'][_0x33b2('0x1e')]);_0x46db4a['offset']=qs[_0x33b2('0x1c')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x1c')]);}_0x46db4a['order']=qs[_0x33b2('0x38')](_0x18b25d[_0x33b2('0x32')][_0x33b2('0x38')]);_0x46db4a[_0x33b2('0x39')]=qs['filters'](_[_0x33b2('0x3a')](_0x18b25d[_0x33b2('0x32')],_0xeb558d[_0x33b2('0x3b')]),_0x4bbde4);if(_0x18b25d[_0x33b2('0x32')][_0x33b2('0x3c')]){_0x46db4a[_0x33b2('0x39')]=_[_0x33b2('0x3d')](_0x46db4a[_0x33b2('0x39')],{'$or':_[_0x33b2('0x3e')](_0x46db4a[_0x33b2('0x34')],function(_0x212ff7){var _0x6f508e={};_0x6f508e[_0x212ff7]={'$like':'%'+_0x18b25d[_0x33b2('0x32')][_0x33b2('0x3c')]+'%'};return _0x6f508e;})});}_0x46db4a=_['merge']({},_0x46db4a,_0x18b25d[_0x33b2('0x3f')]);var _0x36c05e={'where':_0x46db4a[_0x33b2('0x39')]};return db[_0x33b2('0x2e')]['count'](_0x36c05e)[_0x33b2('0x25')](function(_0x497b6e){_0x5c7ecb[_0x33b2('0x1f')]=_0x497b6e;if(_0x18b25d['query']['includeAll']){_0x46db4a[_0x33b2('0x40')]=[{'all':!![]}];}return db[_0x33b2('0x2e')]['findAll'](_0x46db4a);})[_0x33b2('0x25')](function(_0x39a066){_0x5c7ecb[_0x33b2('0x41')]=_0x39a066;return _0x5c7ecb;})[_0x33b2('0x25')](respondWithFilteredResult(_0x32acaf,_0x46db4a))[_0x33b2('0x42')](handleError(_0x32acaf,null));})[_0x33b2('0x42')](handleError(_0x32acaf,null));};exports[_0x33b2('0x43')]=function(_0x1885bc,_0x4a55f2){var _0x2e23cf={'raw':![],'where':{'id':_0x1885bc[_0x33b2('0x44')]['id']}},_0x5e93fb={};_0x5e93fb[_0x33b2('0x30')]=_[_0x33b2('0x31')](db['CmCompany'][_0x33b2('0x45')]);_0x5e93fb['query']=_[_0x33b2('0x31')](_0x1885bc[_0x33b2('0x32')]);_0x5e93fb[_0x33b2('0x3b')]=_[_0x33b2('0x33')](_0x5e93fb[_0x33b2('0x30')],_0x5e93fb[_0x33b2('0x32')]);_0x2e23cf[_0x33b2('0x34')]=_[_0x33b2('0x33')](_0x5e93fb['model'],qs[_0x33b2('0x35')](_0x1885bc[_0x33b2('0x32')][_0x33b2('0x35')]));_0x2e23cf[_0x33b2('0x34')]=_0x2e23cf[_0x33b2('0x34')][_0x33b2('0x36')]?_0x2e23cf[_0x33b2('0x34')]:_0x5e93fb[_0x33b2('0x30')];if(_0x1885bc['query'][_0x33b2('0x46')]){_0x2e23cf[_0x33b2('0x40')]=[{'all':!![]}];}_0x2e23cf=_[_0x33b2('0x3d')]({},_0x2e23cf,_0x1885bc['options']);return db['CmCompany'][_0x33b2('0x47')](_0x2e23cf)[_0x33b2('0x25')](handleEntityNotFound(_0x4a55f2,null))[_0x33b2('0x25')](respondWithResult(_0x4a55f2,null))[_0x33b2('0x42')](handleError(_0x4a55f2,null));};exports[_0x33b2('0x48')]=function(_0x137dc3,_0x36971c){return db[_0x33b2('0x2e')][_0x33b2('0x48')](_0x137dc3[_0x33b2('0x49')],{})[_0x33b2('0x25')](function(_0x46cb82){var _0x5980e1=_0x137dc3['user'][_0x33b2('0x26')]({'plain':!![]});if(!_0x5980e1)throw new Error(_0x33b2('0x4a'));if(_0x5980e1[_0x33b2('0x4b')]==='user'){var _0x18166b=_0x46cb82[_0x33b2('0x26')]({'plain':!![]});var _0x2eee67=_0x33b2('0x27');return db[_0x33b2('0x4c')]['find']({'where':{'name':_0x2eee67,'userProfileId':_0x5980e1[_0x33b2('0x4d')]},'raw':!![]})[_0x33b2('0x25')](function(_0x3fa124){if(_0x3fa124&&_0x3fa124['autoAssociation']===0x0){return db[_0x33b2('0x28')]['create']({'name':_0x18166b['name'],'resourceId':_0x18166b['id'],'type':_0x3fa124[_0x33b2('0x2b')],'sectionId':_0x3fa124['id']},{})[_0x33b2('0x25')](function(){return _0x46cb82;});}else{return _0x46cb82;}})[_0x33b2('0x42')](function(_0x47cb0b){logger[_0x33b2('0x29')](_0x33b2('0x4e'),_0x47cb0b);throw _0x47cb0b;});}return _0x46cb82;})[_0x33b2('0x25')](respondWithResult(_0x36971c,0xc9))[_0x33b2('0x42')](handleError(_0x36971c,null));};exports['update']=function(_0xb91e43,_0x1b395d){if(_0xb91e43[_0x33b2('0x49')]['id']){delete _0xb91e43[_0x33b2('0x49')]['id'];}return db[_0x33b2('0x2e')][_0x33b2('0x47')]({'where':{'id':_0xb91e43[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x1b395d,null))[_0x33b2('0x25')](saveUpdates(_0xb91e43['body'],null))[_0x33b2('0x25')](respondWithResult(_0x1b395d,null))[_0x33b2('0x42')](handleError(_0x1b395d,null));};exports['destroy']=function(_0x529d1f,_0x10ae97){return db[_0x33b2('0x2e')][_0x33b2('0x47')]({'where':{'id':_0x529d1f[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x10ae97,null))['then'](removeEntity(_0x10ae97,null))[_0x33b2('0x42')](handleError(_0x10ae97,null));};exports[_0x33b2('0x2f')]=function(_0x262708,_0x5b636c){return db['CmCompany'][_0x33b2('0x2f')]()[_0x33b2('0x25')](respondWithResult(_0x5b636c,null))[_0x33b2('0x42')](handleError(_0x5b636c,null));};exports[_0x33b2('0x4f')]=function(_0x513bf4,_0x2671f3,_0x4e6c59){return db[_0x33b2('0x50')][_0x33b2('0x47')]({'where':{'id':_0x513bf4[_0x33b2('0x44')]['id']}})['then'](handleEntityNotFound(_0x2671f3,null))['then'](function(_0x4c5c1a){if(_0x4c5c1a){return _0x4c5c1a[_0x33b2('0x4f')](_0x513bf4[_0x33b2('0x49')][_0x33b2('0x51')],_[_0x33b2('0x52')](_0x513bf4[_0x33b2('0x49')],[_0x33b2('0x51'),'id'])||{});}})['then'](respondWithResult(_0x2671f3,null))[_0x33b2('0x42')](handleError(_0x2671f3,null));};exports[_0x33b2('0x53')]=function(_0x3c292a,_0x48b1f6,_0x5b7c0e){var _0x84b676={};var _0x5ae626={};var _0x5b9eda;var _0x189a94;return db[_0x33b2('0x2e')]['findOne']({'where':{'id':_0x3c292a[_0x33b2('0x44')]['id']}})[_0x33b2('0x25')](handleEntityNotFound(_0x48b1f6,null))[_0x33b2('0x25')](function(_0x2b4a94){if(_0x2b4a94){_0x5b9eda=_0x2b4a94;_0x5ae626[_0x33b2('0x30')]=_['keys'](db[_0x33b2('0x50')][_0x33b2('0x45')]);_0x5ae626[_0x33b2('0x32')]=_[_0x33b2('0x31')](_0x3c292a[_0x33b2('0x32')]);_0x5ae626['filters']=_[_0x33b2('0x33')](_0x5ae626[_0x33b2('0x30')],_0x5ae626['query']);_0x84b676[_0x33b2('0x34')]=_[_0x33b2('0x33')](_0x5ae626[_0x33b2('0x30')],qs['fields'](_0x3c292a[_0x33b2('0x32')][_0x33b2('0x35')]));_0x84b676[_0x33b2('0x34')]=_0x84b676[_0x33b2('0x34')][_0x33b2('0x36')]?_0x84b676[_0x33b2('0x34')]:_0x5ae626[_0x33b2('0x30')];_0x84b676[_0x33b2('0x54')]=qs[_0x33b2('0x38')](_0x3c292a['query']['sort']);_0x84b676[_0x33b2('0x39')]=qs[_0x33b2('0x3b')](_[_0x33b2('0x3a')](_0x3c292a[_0x33b2('0x32')],_0x5ae626['filters']));if(_0x3c292a[_0x33b2('0x32')][_0x33b2('0x3c')]){_0x84b676['where']=_['merge'](_0x84b676[_0x33b2('0x39')],{'$or':_[_0x33b2('0x3e')](_0x84b676[_0x33b2('0x34')],function(_0x37ecd2){var _0x3f8ccc={};_0x3f8ccc[_0x37ecd2]={'$like':'%'+_0x3c292a[_0x33b2('0x32')][_0x33b2('0x3c')]+'%'};return _0x3f8ccc;})});}_0x84b676=_[_0x33b2('0x3d')]({},_0x84b676,_0x3c292a[_0x33b2('0x3f')]);return _0x5b9eda[_0x33b2('0x53')](_0x84b676);}})[_0x33b2('0x25')](function(_0x273f1d){if(_0x273f1d){_0x189a94=_0x273f1d[_0x33b2('0x36')];if(!_0x3c292a[_0x33b2('0x32')][_0x33b2('0x37')](_0x33b2('0x55'))){_0x84b676[_0x33b2('0x1e')]=qs[_0x33b2('0x1e')](_0x3c292a[_0x33b2('0x32')][_0x33b2('0x1e')]);_0x84b676[_0x33b2('0x1c')]=qs[_0x33b2('0x1c')](_0x3c292a['query']['offset']);}return _0x5b9eda[_0x33b2('0x53')](_0x84b676);}})[_0x33b2('0x25')](function(_0x59688d){if(_0x59688d){return _0x59688d?{'count':_0x189a94,'rows':_0x59688d}:null;}})[_0x33b2('0x25')](respondWithResult(_0x48b1f6,null))[_0x33b2('0x42')](handleError(_0x48b1f6,null));}; \ No newline at end of file +var _0x0793=['../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','getContacts','findOne','hasOwnProperty','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x0793,0x14c));var _0x3079=function(_0x5151ab,_0x5d0dd9){_0x5151ab=_0x5151ab-0x0;var _0x5b6c0a=_0x0793[_0x5151ab];return _0x5b6c0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3079('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3079('0x1'));var rp=require('request-promise');var moment=require(_0x3079('0x2'));var BPromise=require(_0x3079('0x3'));var Mustache=require(_0x3079('0x4'));var util=require(_0x3079('0x5'));var path=require(_0x3079('0x6'));var sox=require(_0x3079('0x7'));var csv=require(_0x3079('0x8'));var ejs=require(_0x3079('0x9'));var fs=require('fs');var fs_extra=require(_0x3079('0xa'));var _=require(_0x3079('0xb'));var squel=require('squel');var crypto=require(_0x3079('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3079('0xd'));var toCsv=require(_0x3079('0x8'));var querystring=require(_0x3079('0xe'));var Papa=require(_0x3079('0xf'));var Redis=require(_0x3079('0x10'));var authService=require(_0x3079('0x11'));var qs=require(_0x3079('0x12'));var as=require(_0x3079('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3079('0x14'))(_0x3079('0x15'));var utils=require('../../config/utils');var config=require(_0x3079('0x16'));var licenseUtil=require(_0x3079('0x17'));var db=require(_0x3079('0x18'))['db'];function respondWithStatusCode(_0x3ee607,_0x331c1d){_0x331c1d=_0x331c1d||0xcc;return function(_0x584cf7){if(_0x584cf7){return _0x3ee607[_0x3079('0x19')](_0x331c1d);}return _0x3ee607[_0x3079('0x1a')](_0x331c1d)[_0x3079('0x1b')]();};}function respondWithResult(_0x52de68,_0x46edf3){_0x46edf3=_0x46edf3||0xc8;return function(_0x330f55){if(_0x330f55){return _0x52de68[_0x3079('0x1a')](_0x46edf3)['json'](_0x330f55);}};}function respondWithFilteredResult(_0x2fd0a2,_0x6fe049){return function(_0x71394){if(_0x71394){var _0x4e097e=typeof _0x6fe049['offset']===_0x3079('0x1c')&&typeof _0x6fe049['limit']===_0x3079('0x1c');var _0x51771b=_0x71394[_0x3079('0x1d')];var _0x221d94=_0x4e097e?0x0:_0x6fe049['offset'];var _0x49de40=_0x4e097e?_0x71394[_0x3079('0x1d')]:_0x6fe049[_0x3079('0x1e')]+_0x6fe049[_0x3079('0x1f')];var _0x3a96ac;if(_0x49de40>=_0x51771b){_0x49de40=_0x51771b;_0x3a96ac=0xc8;}else{_0x3a96ac=0xce;}_0x2fd0a2[_0x3079('0x1a')](_0x3a96ac);return _0x2fd0a2[_0x3079('0x20')]('Content-Range',_0x221d94+'-'+_0x49de40+'/'+_0x51771b)[_0x3079('0x21')](_0x71394);}return null;};}function patchUpdates(_0x16b46c){return function(_0x4e696c){try{jsonpatch[_0x3079('0x22')](_0x4e696c,_0x16b46c,!![]);}catch(_0xee6c76){return BPromise['reject'](_0xee6c76);}return _0x4e696c[_0x3079('0x23')]();};}function saveUpdates(_0x5cd799,_0x5d29d2){return function(_0x2ce6ca){if(_0x2ce6ca){return _0x2ce6ca[_0x3079('0x24')](_0x5cd799)[_0x3079('0x25')](function(_0x3cb008){return _0x3cb008;});}return null;};}function removeEntity(_0x59ace6,_0x551b5b){return function(_0x294010){if(_0x294010){return _0x294010[_0x3079('0x26')]()[_0x3079('0x25')](function(){var _0x2a83a8=_0x294010[_0x3079('0x27')]({'plain':!![]});var _0x471390=_0x3079('0x28');return db[_0x3079('0x29')][_0x3079('0x26')]({'where':{'type':_0x471390,'resourceId':_0x2a83a8['id']}})[_0x3079('0x25')](function(){return _0x294010;});})['then'](function(){_0x59ace6[_0x3079('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d1171,_0x362955){return function(_0x3db46d){if(!_0x3db46d){_0x1d1171['sendStatus'](0x194);}return _0x3db46d;};}function handleError(_0x4d103e,_0x13cae3){_0x13cae3=_0x13cae3||0x1f4;return function(_0x44b789){logger[_0x3079('0x2a')](_0x44b789[_0x3079('0x2b')]);if(_0x44b789[_0x3079('0x2c')]){delete _0x44b789[_0x3079('0x2c')];}_0x4d103e[_0x3079('0x1a')](_0x13cae3)[_0x3079('0x2d')](_0x44b789);};}exports[_0x3079('0x2e')]=function(_0x3f6d30,_0x29c122){var _0x19ea1f={},_0x5ce6ef={},_0x4dd4f5={'count':0x0,'rows':[]};return db[_0x3079('0x2f')][_0x3079('0x30')]()[_0x3079('0x25')](function(_0x306e18){_0x5ce6ef['model']=_['keys'](_0x306e18);_0x5ce6ef['query']=_[_0x3079('0x31')](_0x3f6d30[_0x3079('0x32')]);_0x5ce6ef[_0x3079('0x33')]=_[_0x3079('0x34')](_0x5ce6ef[_0x3079('0x35')],_0x5ce6ef[_0x3079('0x32')]);_0x19ea1f['attributes']=_[_0x3079('0x34')](_0x5ce6ef[_0x3079('0x35')],qs[_0x3079('0x36')](_0x3f6d30[_0x3079('0x32')][_0x3079('0x36')]));_0x19ea1f[_0x3079('0x37')]=_0x19ea1f[_0x3079('0x37')][_0x3079('0x38')]?_0x19ea1f[_0x3079('0x37')]:_0x5ce6ef['model'];if(!_0x3f6d30[_0x3079('0x32')]['hasOwnProperty'](_0x3079('0x39'))){_0x19ea1f['limit']=qs['limit'](_0x3f6d30[_0x3079('0x32')][_0x3079('0x1f')]);_0x19ea1f['offset']=qs[_0x3079('0x1e')](_0x3f6d30['query']['offset']);}_0x19ea1f[_0x3079('0x3a')]=qs[_0x3079('0x3b')](_0x3f6d30[_0x3079('0x32')][_0x3079('0x3b')]);_0x19ea1f[_0x3079('0x3c')]=qs[_0x3079('0x33')](_[_0x3079('0x3d')](_0x3f6d30[_0x3079('0x32')],_0x5ce6ef[_0x3079('0x33')]),_0x306e18);if(_0x3f6d30['query'][_0x3079('0x3e')]){_0x19ea1f[_0x3079('0x3c')]=_[_0x3079('0x3f')](_0x19ea1f[_0x3079('0x3c')],{'$or':_[_0x3079('0x40')](_0x19ea1f['attributes'],function(_0x2e3aea){var _0x3f08f2={};_0x3f08f2[_0x2e3aea]={'$like':'%'+_0x3f6d30[_0x3079('0x32')][_0x3079('0x3e')]+'%'};return _0x3f08f2;})});}_0x19ea1f=_[_0x3079('0x3f')]({},_0x19ea1f,_0x3f6d30['options']);var _0x21af39={'where':_0x19ea1f[_0x3079('0x3c')]};return db['CmCompany'][_0x3079('0x1d')](_0x21af39)[_0x3079('0x25')](function(_0x4ebb19){_0x4dd4f5[_0x3079('0x1d')]=_0x4ebb19;if(_0x3f6d30['query'][_0x3079('0x41')]){_0x19ea1f[_0x3079('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x3079('0x43')](_0x19ea1f);})[_0x3079('0x25')](function(_0x34e376){_0x4dd4f5[_0x3079('0x44')]=_0x34e376;return _0x4dd4f5;})['then'](respondWithFilteredResult(_0x29c122,_0x19ea1f))['catch'](handleError(_0x29c122,null));})[_0x3079('0x45')](handleError(_0x29c122,null));};exports[_0x3079('0x46')]=function(_0x5f40c2,_0x459a81){var _0x335516={'raw':![],'where':{'id':_0x5f40c2['params']['id']}},_0x4a5120={};_0x4a5120[_0x3079('0x35')]=_['keys'](db[_0x3079('0x2f')][_0x3079('0x47')]);_0x4a5120[_0x3079('0x32')]=_[_0x3079('0x31')](_0x5f40c2[_0x3079('0x32')]);_0x4a5120[_0x3079('0x33')]=_['intersection'](_0x4a5120['model'],_0x4a5120[_0x3079('0x32')]);_0x335516[_0x3079('0x37')]=_[_0x3079('0x34')](_0x4a5120[_0x3079('0x35')],qs['fields'](_0x5f40c2['query'][_0x3079('0x36')]));_0x335516[_0x3079('0x37')]=_0x335516[_0x3079('0x37')][_0x3079('0x38')]?_0x335516[_0x3079('0x37')]:_0x4a5120[_0x3079('0x35')];if(_0x5f40c2[_0x3079('0x32')][_0x3079('0x41')]){_0x335516['include']=[{'all':!![]}];}_0x335516=_['merge']({},_0x335516,_0x5f40c2[_0x3079('0x48')]);return db[_0x3079('0x2f')][_0x3079('0x49')](_0x335516)[_0x3079('0x25')](handleEntityNotFound(_0x459a81,null))['then'](respondWithResult(_0x459a81,null))[_0x3079('0x45')](handleError(_0x459a81,null));};exports[_0x3079('0x4a')]=function(_0x5cd52e,_0x5b5c05){return db['CmCompany'][_0x3079('0x4a')](_0x5cd52e[_0x3079('0x4b')],{})[_0x3079('0x25')](function(_0x16b640){var _0x208039=_0x5cd52e[_0x3079('0x4c')][_0x3079('0x27')]({'plain':!![]});if(!_0x208039)throw new Error(_0x3079('0x4d'));if(_0x208039['role']===_0x3079('0x4c')){var _0x387fb4=_0x16b640['get']({'plain':!![]});var _0x5d2b29='Companies';return db[_0x3079('0x4e')][_0x3079('0x49')]({'where':{'name':_0x5d2b29,'userProfileId':_0x208039[_0x3079('0x4f')]},'raw':!![]})[_0x3079('0x25')](function(_0x4cd760){if(_0x4cd760&&_0x4cd760[_0x3079('0x50')]===0x0){return db[_0x3079('0x29')][_0x3079('0x4a')]({'name':_0x387fb4['name'],'resourceId':_0x387fb4['id'],'type':_0x4cd760[_0x3079('0x2c')],'sectionId':_0x4cd760['id']},{})[_0x3079('0x25')](function(){return _0x16b640;});}else{return _0x16b640;}})[_0x3079('0x45')](function(_0x146282){logger[_0x3079('0x2a')](_0x3079('0x51'),_0x146282);throw _0x146282;});}return _0x16b640;})[_0x3079('0x25')](respondWithResult(_0x5b5c05,0xc9))[_0x3079('0x45')](handleError(_0x5b5c05,null));};exports['update']=function(_0x2e9ca3,_0x3f3613){if(_0x2e9ca3[_0x3079('0x4b')]['id']){delete _0x2e9ca3['body']['id'];}return db[_0x3079('0x2f')]['find']({'where':{'id':_0x2e9ca3[_0x3079('0x52')]['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x3f3613,null))['then'](saveUpdates(_0x2e9ca3[_0x3079('0x4b')],null))['then'](respondWithResult(_0x3f3613,null))[_0x3079('0x45')](handleError(_0x3f3613,null));};exports[_0x3079('0x26')]=function(_0x2d5c8a,_0x31af47){return db[_0x3079('0x2f')][_0x3079('0x49')]({'where':{'id':_0x2d5c8a['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x31af47,null))[_0x3079('0x25')](removeEntity(_0x31af47,null))['catch'](handleError(_0x31af47,null));};exports[_0x3079('0x30')]=function(_0x1a4c77,_0x3866d7){return db['CmCompany'][_0x3079('0x30')]()[_0x3079('0x25')](respondWithResult(_0x3866d7,null))[_0x3079('0x45')](handleError(_0x3866d7,null));};exports[_0x3079('0x53')]=function(_0xbd8780,_0x3d0d9b,_0x117b49){return db[_0x3079('0x54')][_0x3079('0x49')]({'where':{'id':_0xbd8780['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x3d0d9b,null))[_0x3079('0x25')](function(_0x176ca8){if(_0x176ca8){return _0x176ca8[_0x3079('0x53')](_0xbd8780['body'][_0x3079('0x55')],_['omit'](_0xbd8780['body'],[_0x3079('0x55'),'id'])||{});}})[_0x3079('0x25')](respondWithResult(_0x3d0d9b,null))[_0x3079('0x45')](handleError(_0x3d0d9b,null));};exports[_0x3079('0x56')]=function(_0x309f9b,_0x5567d0,_0x2a5e75){var _0x53a6f8={};var _0x5c34a3={};var _0x335a03;var _0x4fb787;return db['CmCompany'][_0x3079('0x57')]({'where':{'id':_0x309f9b['params']['id']}})[_0x3079('0x25')](handleEntityNotFound(_0x5567d0,null))[_0x3079('0x25')](function(_0x55f5ac){if(_0x55f5ac){_0x335a03=_0x55f5ac;_0x5c34a3[_0x3079('0x35')]=_['keys'](db[_0x3079('0x54')]['rawAttributes']);_0x5c34a3[_0x3079('0x32')]=_[_0x3079('0x31')](_0x309f9b[_0x3079('0x32')]);_0x5c34a3['filters']=_[_0x3079('0x34')](_0x5c34a3[_0x3079('0x35')],_0x5c34a3[_0x3079('0x32')]);_0x53a6f8[_0x3079('0x37')]=_[_0x3079('0x34')](_0x5c34a3[_0x3079('0x35')],qs['fields'](_0x309f9b[_0x3079('0x32')]['fields']));_0x53a6f8[_0x3079('0x37')]=_0x53a6f8[_0x3079('0x37')][_0x3079('0x38')]?_0x53a6f8['attributes']:_0x5c34a3['model'];_0x53a6f8[_0x3079('0x3a')]=qs[_0x3079('0x3b')](_0x309f9b['query'][_0x3079('0x3b')]);_0x53a6f8['where']=qs[_0x3079('0x33')](_[_0x3079('0x3d')](_0x309f9b['query'],_0x5c34a3[_0x3079('0x33')]));if(_0x309f9b[_0x3079('0x32')][_0x3079('0x3e')]){_0x53a6f8['where']=_['merge'](_0x53a6f8[_0x3079('0x3c')],{'$or':_[_0x3079('0x40')](_0x53a6f8['attributes'],function(_0x542f4d){var _0x2c3836={};_0x2c3836[_0x542f4d]={'$like':'%'+_0x309f9b[_0x3079('0x32')][_0x3079('0x3e')]+'%'};return _0x2c3836;})});}_0x53a6f8=_[_0x3079('0x3f')]({},_0x53a6f8,_0x309f9b[_0x3079('0x48')]);return _0x335a03[_0x3079('0x56')](_0x53a6f8);}})[_0x3079('0x25')](function(_0x4debbe){if(_0x4debbe){_0x4fb787=_0x4debbe[_0x3079('0x38')];if(!_0x309f9b[_0x3079('0x32')][_0x3079('0x58')](_0x3079('0x39'))){_0x53a6f8[_0x3079('0x1f')]=qs['limit'](_0x309f9b[_0x3079('0x32')]['limit']);_0x53a6f8[_0x3079('0x1e')]=qs['offset'](_0x309f9b[_0x3079('0x32')]['offset']);}return _0x335a03[_0x3079('0x56')](_0x53a6f8);}})[_0x3079('0x25')](function(_0xf953e6){if(_0xf953e6){return _0xf953e6?{'count':_0x4fb787,'rows':_0xf953e6}:null;}})[_0x3079('0x25')](respondWithResult(_0x5567d0,null))[_0x3079('0x45')](handleError(_0x5567d0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3dba045..335da78 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 _0x25df=['define','CmCompany','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x341186,_0x4d1b7c){var _0x2b4a7c=function(_0x655936){while(--_0x655936){_0x341186['push'](_0x341186['shift']());}};_0x2b4a7c(++_0x4d1b7c);}(_0x25df,0x12e));var _0xf25d=function(_0x3a2821,_0x446fc7){_0x3a2821=_0x3a2821-0x0;var _0x31b9b6=_0x25df[_0x3a2821];return _0x31b9b6;};'use strict';var _=require('lodash');var util=require(_0xf25d('0x0'));var logger=require(_0xf25d('0x1'))(_0xf25d('0x2'));var moment=require(_0xf25d('0x3'));var BPromise=require(_0xf25d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf25d('0x5'));var config=require(_0xf25d('0x6'));var attributes=require('./cmCompany.attributes');module[_0xf25d('0x7')]=function(_0x6d99e,_0x2ced72){return _0x6d99e[_0xf25d('0x8')](_0xf25d('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddd7=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2df83f,_0x4305f0){var _0x28d7d5=function(_0x497335){while(--_0x497335){_0x2df83f['push'](_0x2df83f['shift']());}};_0x28d7d5(++_0x4305f0);}(_0xddd7,0xa2));var _0x7ddd=function(_0x7c9599,_0x447293){_0x7c9599=_0x7c9599-0x0;var _0x19ee57=_0xddd7[_0x7c9599];return _0x19ee57;};'use strict';var _=require(_0x7ddd('0x0'));var util=require(_0x7ddd('0x1'));var logger=require(_0x7ddd('0x2'))(_0x7ddd('0x3'));var moment=require('moment');var BPromise=require(_0x7ddd('0x4'));var rp=require(_0x7ddd('0x5'));var fs=require('fs');var path=require(_0x7ddd('0x6'));var rimraf=require(_0x7ddd('0x7'));var config=require(_0x7ddd('0x8'));var attributes=require(_0x7ddd('0x9'));module['exports']=function(_0x24254d,_0x5e2b77){return _0x24254d[_0x7ddd('0xa')](_0x7ddd('0xb'),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 74affe1..2bd08f7 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 _0xd117=['../../config/logger','rpc','../../config/environment','client','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x329bd7,_0x58d7a4){var _0x351d9e=function(_0x5238dc){while(--_0x5238dc){_0x329bd7['push'](_0x329bd7['shift']());}};_0x351d9e(++_0x58d7a4);}(_0xd117,0x9a));var _0x7d11=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0xd117[_0x57d13b];return _0x467696;};'use strict';var _=require(_0x7d11('0x0'));var util=require('util');var moment=require(_0x7d11('0x1'));var BPromise=require(_0x7d11('0x2'));var rs=require(_0x7d11('0x3'));var fs=require('fs');var Redis=require(_0x7d11('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d11('0x5'));var logger=require(_0x7d11('0x6'))(_0x7d11('0x7'));var config=require(_0x7d11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d11('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdc4f62,_0x1f74ae,_0x7847b9){return new BPromise(function(_0x2f7bfb,_0x5a5eb5){return client[_0x7d11('0xa')](_0xdc4f62,_0x7847b9)['then'](function(_0x4f942f){logger[_0x7d11('0xb')](_0x7d11('0xc'),_0x1f74ae,_0x7d11('0xd'));logger[_0x7d11('0xe')](_0x7d11('0xf'),_0x1f74ae,_0x7d11('0xd'),JSON[_0x7d11('0x10')](_0x4f942f));if(_0x4f942f[_0x7d11('0x11')]){if(_0x4f942f[_0x7d11('0x11')]['code']===0x1f4){logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x4f942f[_0x7d11('0x11')][_0x7d11('0x12')]);return _0x5a5eb5(_0x4f942f[_0x7d11('0x11')][_0x7d11('0x12')]);}logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x4f942f[_0x7d11('0x11')]['message']);return _0x2f7bfb(_0x4f942f[_0x7d11('0x11')]['message']);}else{logger[_0x7d11('0xb')](_0x7d11('0xc'),_0x1f74ae,_0x7d11('0xd'));_0x2f7bfb(_0x4f942f[_0x7d11('0x13')][_0x7d11('0x12')]);}})['catch'](function(_0x27e244){logger[_0x7d11('0x11')](_0x7d11('0xc'),_0x1f74ae,_0x27e244);_0x5a5eb5(_0x27e244);});});} \ No newline at end of file +var _0x801c=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x801c,0xcb));var _0xc801=function(_0x5a6291,_0x47b1a0){_0x5a6291=_0x5a6291-0x0;var _0x3014ce=_0x801c[_0x5a6291];return _0x3014ce;};'use strict';var _=require(_0xc801('0x0'));var util=require(_0xc801('0x1'));var moment=require(_0xc801('0x2'));var BPromise=require(_0xc801('0x3'));var rs=require(_0xc801('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc801('0x5'))['db'];var utils=require(_0xc801('0x6'));var logger=require(_0xc801('0x7'))('rpc');var config=require(_0xc801('0x8'));var jayson=require(_0xc801('0x9'));var client=jayson['client'][_0xc801('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x531eba,_0x2fb281,_0x57f279){return new BPromise(function(_0x435810,_0x13cf9f){return client['request'](_0x531eba,_0x57f279)[_0xc801('0xb')](function(_0x3fc69b){logger['info'](_0xc801('0xc'),_0x2fb281,_0xc801('0xd'));logger[_0xc801('0xe')](_0xc801('0xf'),_0x2fb281,_0xc801('0xd'),JSON[_0xc801('0x10')](_0x3fc69b));if(_0x3fc69b['error']){if(_0x3fc69b[_0xc801('0x11')][_0xc801('0x12')]===0x1f4){logger[_0xc801('0x11')]('CmCompany,\x20%s,\x20%s',_0x2fb281,_0x3fc69b[_0xc801('0x11')][_0xc801('0x13')]);return _0x13cf9f(_0x3fc69b[_0xc801('0x11')]['message']);}logger['error'](_0xc801('0xc'),_0x2fb281,_0x3fc69b['error']['message']);return _0x435810(_0x3fc69b[_0xc801('0x11')]['message']);}else{logger[_0xc801('0x14')]('CmCompany,\x20%s,\x20%s',_0x2fb281,'request\x20sent');_0x435810(_0x3fc69b['result'][_0xc801('0x13')]);}})[_0xc801('0x15')](function(_0x2592d9){logger['error'](_0xc801('0xc'),_0x2fb281,_0x2592d9);_0x13cf9f(_0x2592d9);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index fd0fa4b..8aa04a4 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 _0xf346=['/:id/contacts','put','destroy','exports','util','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf346,0x134));var _0x6f34=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf346[_0x199572];return _0x13cfa3;};'use strict';var multer=require('multer');var util=require(_0x6f34('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f34('0x1')]();var fs_extra=require(_0x6f34('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6f34('0x3'));var controller=require(_0x6f34('0x4'));router[_0x6f34('0x5')]('/',auth[_0x6f34('0x6')](),controller[_0x6f34('0x7')]);router[_0x6f34('0x5')](_0x6f34('0x8'),auth['isAuthenticated'](),controller[_0x6f34('0x9')]);router['get'](_0x6f34('0xa'),auth[_0x6f34('0x6')](),controller[_0x6f34('0xb')]);router['get']('/:id/contacts',auth[_0x6f34('0x6')](),controller[_0x6f34('0xc')]);router[_0x6f34('0xd')]('/',auth[_0x6f34('0x6')](),controller[_0x6f34('0xe')]);router[_0x6f34('0xd')](_0x6f34('0xf'),auth[_0x6f34('0x6')](),controller['addContacts']);router[_0x6f34('0x10')]('/:id',auth[_0x6f34('0x6')](),controller['update']);router['delete'](_0x6f34('0xa'),auth['isAuthenticated'](),controller[_0x6f34('0x11')]);module[_0x6f34('0x12')]=router; \ No newline at end of file +var _0xdfff=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1f9d05,_0x4a5ecc){var _0x59c1ea=function(_0x54eb43){while(--_0x54eb43){_0x1f9d05['push'](_0x1f9d05['shift']());}};_0x59c1ea(++_0x4a5ecc);}(_0xdfff,0x110));var _0xfdff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdfff[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfdff('0x0'));var util=require(_0xfdff('0x1'));var path=require(_0xfdff('0x2'));var timeout=require(_0xfdff('0x3'));var express=require(_0xfdff('0x4'));var router=express['Router']();var fs_extra=require(_0xfdff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfdff('0x6'));var config=require(_0xfdff('0x7'));var controller=require(_0xfdff('0x8'));router[_0xfdff('0x9')]('/',auth[_0xfdff('0xa')](),controller[_0xfdff('0xb')]);router[_0xfdff('0x9')](_0xfdff('0xc'),auth[_0xfdff('0xa')](),controller[_0xfdff('0xd')]);router[_0xfdff('0x9')](_0xfdff('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0xfdff('0xf'),auth[_0xfdff('0xa')](),controller[_0xfdff('0x10')]);router[_0xfdff('0x11')]('/',auth[_0xfdff('0xa')](),controller[_0xfdff('0x12')]);router['post']('/:id/contacts',auth[_0xfdff('0xa')](),controller[_0xfdff('0x13')]);router[_0xfdff('0x14')]('/:id',auth[_0xfdff('0xa')](),controller[_0xfdff('0x15')]);router[_0xfdff('0x16')](_0xfdff('0xe'),auth[_0xfdff('0xa')](),controller[_0xfdff('0x17')]);module[_0xfdff('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 80fb33e..b742960 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 _0x20e7=['TEXT','UNSIGNED','DATE','NOW','lodash','exports','STRING'];(function(_0x336c97,_0x293692){var _0x493397=function(_0x12cf22){while(--_0x12cf22){_0x336c97['push'](_0x336c97['shift']());}};_0x493397(++_0x293692);}(_0x20e7,0x193));var _0x720e=function(_0x10ce1f,_0x541626){_0x10ce1f=_0x10ce1f-0x0;var _0x5d0fb1=_0x20e7[_0x10ce1f];return _0x5d0fb1;};'use strict';var _=require(_0x720e('0x0'));var Sequelize=require('sequelize');module[_0x720e('0x1')]={'firstName':{'type':Sequelize[_0x720e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x720e('0x2')]},'street':{'type':Sequelize[_0x720e('0x2')]},'postalCode':{'type':Sequelize[_0x720e('0x2')]},'city':{'type':Sequelize[_0x720e('0x2')]},'country':{'type':Sequelize[_0x720e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x720e('0x3')]},'phone':{'type':Sequelize[_0x720e('0x2')]},'mobile':{'type':Sequelize[_0x720e('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x720e('0x2')]},'url':{'type':Sequelize[_0x720e('0x2')]},'facebook':{'type':Sequelize[_0x720e('0x2')]},'fb_data':{'type':Sequelize[_0x720e('0x2')]},'twitter':{'type':Sequelize[_0x720e('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x720e('0x2')]},'line':{'type':Sequelize[_0x720e('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x720e('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x720e('0x5')],'defaultValue':Sequelize[_0x720e('0x6')]}}; \ No newline at end of file +var _0x4dc1=['NOW','lodash','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4dc1,0xef));var _0x14dc=function(_0x2a288d,_0x1a5a5e){_0x2a288d=_0x2a288d-0x0;var _0x976b1b=_0x4dc1[_0x2a288d];return _0x976b1b;};'use strict';var _=require(_0x14dc('0x0'));var Sequelize=require(_0x14dc('0x1'));module[_0x14dc('0x2')]={'firstName':{'type':Sequelize[_0x14dc('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x14dc('0x3')]},'street':{'type':Sequelize[_0x14dc('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x14dc('0x3')]},'country':{'type':Sequelize[_0x14dc('0x3')]},'dateOfBirth':{'type':Sequelize[_0x14dc('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x14dc('0x3')]},'mobile':{'type':Sequelize[_0x14dc('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x14dc('0x3')]},'facebook':{'type':Sequelize[_0x14dc('0x3')]},'fb_data':{'type':Sequelize[_0x14dc('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x14dc('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x14dc('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x14dc('0x3')]},'UserId':{'type':Sequelize[_0x14dc('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x14dc('0x5')],'defaultValue':Sequelize[_0x14dc('0x6')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1a87eb3..d6e6122 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 _0xcea0=['findOne','trimStart','length','fieldType','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','cm_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','SELECT','clone','having','t.id\x20IN\x20?','user','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','sequelize','toString','count','keyBy','merge','CmContact','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','params','tags','displayName','analytics','CmCustomField','findAll','columnName','alias','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','findOrCreate','spread','show','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','phone','getTags','options','setTags','getHoppers','rawAttributes','ContactId','includeAll','include','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','child_process','fork','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','sms','fax','whatsapp','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','destination','endtime','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Account','closed','closedAt','note','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','subject','substatus','openchannel','externalUrl','threadId','Interaction','sortBy','reverse','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','update','then','destroy','end','error','stack','name','send','index','describe','keys','startsWith','cf_','push'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcea0,0xf7));var _0x0cea=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xcea0[_0x346737];return _0x1ade2e;};'use strict';var moment=require(_0x0cea('0x0'));var BPromise=require(_0x0cea('0x1'));var util=require(_0x0cea('0x2'));var path=require(_0x0cea('0x3'));var fs=require('fs');var _=require(_0x0cea('0x4'));var squel=require(_0x0cea('0x5'));var Papa=require('papaparse');var Redis=require(_0x0cea('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x0cea('0x7'));var logger=require(_0x0cea('0x8'))(_0x0cea('0x9'));var config=require(_0x0cea('0xa'));var db=require('../../mysqldb')['db'];config[_0x0cea('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0cea('0xc'))(new Redis(config[_0x0cea('0xb')]));require(_0x0cea('0xd'))[_0x0cea('0xe')](socket);function respondWithResult(_0xfcb455,_0x3b906b){_0x3b906b=_0x3b906b||0xc8;return function(_0x21308c){if(_0x21308c){return _0xfcb455[_0x0cea('0xf')](_0x3b906b)[_0x0cea('0x10')](_0x21308c);}};}function respondWithFilteredResult(_0x2e6ae9,_0x247f88){return function(_0x362df){if(_0x362df){var _0x5352ee=typeof _0x247f88[_0x0cea('0x11')]==='undefined'&&typeof _0x247f88[_0x0cea('0x12')]===_0x0cea('0x13');var _0x1dc038=_0x362df['count'];var _0x4ef0c9=_0x5352ee?0x0:_0x247f88[_0x0cea('0x11')];var _0x5f3fd9=_0x5352ee?_0x362df['count']:_0x247f88[_0x0cea('0x11')]+_0x247f88[_0x0cea('0x12')];var _0x40c3f3;if(_0x5f3fd9>=_0x1dc038){_0x5f3fd9=_0x1dc038;_0x40c3f3=0xc8;}else{_0x40c3f3=0xce;}_0x2e6ae9[_0x0cea('0xf')](_0x40c3f3);return _0x2e6ae9['set']('Content-Range',_0x4ef0c9+'-'+_0x5f3fd9+'/'+_0x1dc038)[_0x0cea('0x10')](_0x362df);}return null;};}function saveUpdates(_0x309205){return function(_0x29c7ca){if(_0x29c7ca){return _0x29c7ca[_0x0cea('0x14')](_0x309205)[_0x0cea('0x15')](function(_0x3d4458){return _0x3d4458;});}return null;};}function removeEntity(_0x45fedf){return function(_0x5824d6){if(_0x5824d6){return _0x5824d6[_0x0cea('0x16')]()[_0x0cea('0x15')](function(){_0x45fedf[_0x0cea('0xf')](0xcc)[_0x0cea('0x17')]();});}};}function handleEntityNotFound(_0x4811d4){return function(_0x5b03a1){if(!_0x5b03a1){_0x4811d4['sendStatus'](0x194);}return _0x5b03a1;};}function handleError(_0x5e97e0,_0x5cd7de){_0x5cd7de=_0x5cd7de||0x1f4;return function(_0x5bc90f){logger[_0x0cea('0x18')](_0x5bc90f[_0x0cea('0x19')]);if(_0x5bc90f[_0x0cea('0x1a')]){delete _0x5bc90f[_0x0cea('0x1a')];}_0x5e97e0[_0x0cea('0xf')](_0x5cd7de)[_0x0cea('0x1b')](_0x5bc90f);};}exports[_0x0cea('0x1c')]=function(_0x1a91cd,_0xa9c147){var _0x504666={},_0x2c9814={},_0xfa14da={'count':0x0,'rows':[]};return db['CmContact'][_0x0cea('0x1d')]()[_0x0cea('0x15')](function(_0x15d092){var _0x45444b=[];for(var _0x46f97b=0x0;_0x46f97b0x1){_0xe2bf72['or'](_0x0cea('0x5d'),qs[_0x0cea('0x5e')](_0x363b10),null);}else{if(qs[_0x0cea('0x5f')](_0x363b10)){_0xe2bf72['or']('c.id\x20LIKE\x20?',_0x363b10+'%');_0xe2bf72['or'](_0x0cea('0x60'),_0x363b10+'%');_0xe2bf72['or']('c.mobile\x20LIKE\x20?',_0x363b10+'%');_0xe2bf72['or'](_0x0cea('0x61'),_0x363b10+'%');}else if(qs[_0x0cea('0x62')](_0x363b10)){_0xe2bf72['or'](_0x0cea('0x63'),_0x363b10+'%');}else{_0xe2bf72['or'](_0x0cea('0x64'),'%'+_0x363b10+'%');_0xe2bf72['or'](_0x0cea('0x65'),'%'+_0x363b10+'%');_0xe2bf72['or'](_0x0cea('0x63'),'%'+_0x363b10+'%');}}}}_0x5f5d31[_0x0cea('0x3c')](_0xe2bf72);_0x5f5d31[_0x0cea('0x66')](_0x0cea('0x67'));var _0x311b1b={'type':db['Sequelize']['QueryTypes'][_0x0cea('0x68')],'raw':!![]};var _0x237910=_0x5f5d31[_0x0cea('0x69')]()['field'](_0x0cea('0x67'));if(_0x504666[_0x0cea('0x2f')]){_0x504666['order']['forEach'](function(_0x35783d){_0x5f5d31[_0x0cea('0x2f')]('c.'+_0x35783d[0x0],_0x35783d[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0cea('0x57')](_0x1d0851)){_0x5f5d31[_0x0cea('0x6a')](_0x3742cf);_0x237910[_0x0cea('0x3c')](_0x0cea('0x6b'),_0x1d0851);}BPromise['resolve']()['then'](function(){if(!_0x347577)return;if(_0x1a91cd[_0x0cea('0x6c')]['role']!==_0x0cea('0x6d'))return;if(!_[_0x0cea('0x6e')](_0x347577[_0x0cea('0x42')],[_0x0cea('0x33'),_0x0cea('0x4a')])){return _0x1a91cd[_0x0cea('0x6c')][_0x0cea('0x6f')]({'attributes':['id'],'raw':!![]})[_0x0cea('0x15')](function(_0x272aa8){if(_[_0x0cea('0x57')](_0x272aa8)){_0x237910[_0x0cea('0x3c')](_0x0cea('0x70'));_0x5f5d31[_0x0cea('0x3c')]('c.ListId\x20IS\x20NULL');}else{_0x237910[_0x0cea('0x3c')](_0x0cea('0x71'),_[_0x0cea('0x46')](_0x272aa8,'id'));_0x5f5d31[_0x0cea('0x3c')]('c.ListId\x20IN\x20?',_[_0x0cea('0x46')](_0x272aa8,'id'));}});}})[_0x0cea('0x15')](function(){if(_0x1a91cd[_0x0cea('0x6c')][_0x0cea('0x72')]===_0x0cea('0x6d')&&!_0x347577&&!_0x1a91cd[_0x0cea('0x28')][_0x0cea('0x58')])return[];return db[_0x0cea('0x73')]['query'](_0x237910[_0x0cea('0x74')](),_0x311b1b);})[_0x0cea('0x15')](function(_0x1be9b0){_0xfa14da[_0x0cea('0x75')]=_0x1be9b0[_0x0cea('0x24')];if(_0xfa14da['count']===0x0)return[];return db[_0x0cea('0x73')][_0x0cea('0x28')](_0x39ec21['toString'](),_0x311b1b)[_0x0cea('0x15')](function(_0x184ae5){_0x5c7847=_[_0x0cea('0x76')](_0x184ae5,'id');_0x311b1b=_[_0x0cea('0x77')](_0x311b1b,{'model':db[_0x0cea('0x78')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a91cd[_0x0cea('0x28')][_0x0cea('0x2b')]){_0x504666[_0x0cea('0x2c')]['forEach'](function(_0x22fafb){_0x5f5d31[_0x0cea('0x33')]('c.'+_0x22fafb);});}else{_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x67'));_0x5f5d31[_0x0cea('0x33')]('c.firstName');_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x79'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7a'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7b'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7c'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7d'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7e'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x7f'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x80'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x81'));_0x5f5d31[_0x0cea('0x33')](_0x0cea('0x82'),'TagIds');}if(_0x504666[_0x0cea('0x12')])_0x5f5d31[_0x0cea('0x12')](_0x504666[_0x0cea('0x12')]);if(_0x504666[_0x0cea('0x11')])_0x5f5d31[_0x0cea('0x11')](_0x504666['offset']);return db['sequelize']['query'](_0x5f5d31['toString'](),_0x311b1b);});})[_0x0cea('0x15')](function(_0x20ab89){_0x20ab89[_0x0cea('0x47')](function(_0x4d5600){if(_0x4d5600[_0x0cea('0x83')]){_0x4d5600['Tags']=[];_0x4d5600[_0x0cea('0x83')][_0x0cea('0x45')](',')[_0x0cea('0x47')](function(_0x9d747b){_0x4d5600[_0x0cea('0x84')][_0x0cea('0x21')](_0x5c7847[_0x9d747b]);});}delete _0x4d5600['TagIds'];});_0xfa14da[_0x0cea('0x85')]=_0x20ab89;return _0xfa14da;})[_0x0cea('0x15')](respondWithFilteredResult(_0xa9c147,_0x504666));})[_0x0cea('0x86')](handleError(_0xa9c147,null));};exports[_0x0cea('0x16')]=function(_0x42d019,_0x477792){return db['CmContact'][_0x0cea('0x87')]({'where':{'id':_0x42d019[_0x0cea('0x88')]['id']}})[_0x0cea('0x15')](handleEntityNotFound(_0x477792,null))[_0x0cea('0x15')](removeEntity(_0x477792,null))[_0x0cea('0x86')](handleError(_0x477792,null));};exports[_0x0cea('0x1d')]=function(_0x14178c,_0x2cb464){return db[_0x0cea('0x78')][_0x0cea('0x1d')]()['then'](function(_0x140c3c){delete _0x140c3c[_0x0cea('0x89')];for(var _0x594493=0x0;_0x594493=_0x216463){_0x2c787b=_0x216463;_0x3f18cf=0xc8;}else{_0x3f18cf=0xce;}_0x276ef9[_0x3582('0x12')](_0x3f18cf);return _0x276ef9[_0x3582('0x17')](_0x3582('0x18'),_0x4ac441+'-'+_0x2c787b+'/'+_0x216463)['json'](_0x97bfb1);}return null;};}function saveUpdates(_0x59dc1f){return function(_0x5a027a){if(_0x5a027a){return _0x5a027a[_0x3582('0x19')](_0x59dc1f)[_0x3582('0x1a')](function(_0x5a9ff7){return _0x5a9ff7;});}return null;};}function removeEntity(_0x49e492){return function(_0x392aec){if(_0x392aec){return _0x392aec[_0x3582('0x1b')]()[_0x3582('0x1a')](function(){_0x49e492[_0x3582('0x12')](0xcc)[_0x3582('0x1c')]();});}};}function handleEntityNotFound(_0xcb872a){return function(_0x18e72b){if(!_0x18e72b){_0xcb872a['sendStatus'](0x194);}return _0x18e72b;};}function handleError(_0x3bb3ef,_0x113f3f){_0x113f3f=_0x113f3f||0x1f4;return function(_0x1e410e){logger[_0x3582('0x1d')](_0x1e410e[_0x3582('0x1e')]);if(_0x1e410e[_0x3582('0x1f')]){delete _0x1e410e['name'];}_0x3bb3ef[_0x3582('0x12')](_0x113f3f)[_0x3582('0x20')](_0x1e410e);};}exports[_0x3582('0x21')]=function(_0xab6e13,_0xdcb5d7){var _0x4d85b5={},_0x51b08d={},_0x381ae9={'count':0x0,'rows':[]};return db[_0x3582('0x22')][_0x3582('0x23')]()['then'](function(_0x5628a7){var _0x6b548c=[];for(var _0x3ea501=0x0;_0x3ea5010x1){_0x390a73['or'](_0x3582('0x60'),qs['getFullTextValue'](_0xd77a48),null);}else{if(qs['isNumeric'](_0xd77a48)){_0x390a73['or'](_0x3582('0x61'),_0xd77a48+'%');_0x390a73['or']('c.phone\x20LIKE\x20?',_0xd77a48+'%');_0x390a73['or']('c.mobile\x20LIKE\x20?',_0xd77a48+'%');_0x390a73['or'](_0x3582('0x62'),_0xd77a48+'%');}else if(qs[_0x3582('0x63')](_0xd77a48)){_0x390a73['or']('c.email\x20LIKE\x20?',_0xd77a48+'%');}else{_0x390a73['or'](_0x3582('0x64'),'%'+_0xd77a48+'%');_0x390a73['or']('c.lastName\x20LIKE\x20?','%'+_0xd77a48+'%');_0x390a73['or']('c.email\x20LIKE\x20?','%'+_0xd77a48+'%');}}}}_0x13e8b0[_0x3582('0x33')](_0x390a73);_0x13e8b0['group']('c.id');var _0x58a2e6={'type':db[_0x3582('0x65')][_0x3582('0x66')]['SELECT'],'raw':!![]};var _0x41f131=_0x13e8b0[_0x3582('0x67')]()[_0x3582('0x34')](_0x3582('0x68'));if(_0x4d85b5[_0x3582('0x69')]){_0x4d85b5[_0x3582('0x69')]['forEach'](function(_0x5765e4){_0x13e8b0[_0x3582('0x69')]('c.'+_0x5765e4[0x0],_0x5765e4[0x1]===_0x3582('0x6a')?![]:!![]);});}if(!_['isEmpty'](_0xaa596b)){_0x13e8b0[_0x3582('0x6b')](_0x100ffd);_0x41f131[_0x3582('0x33')](_0x3582('0x6c'),_0xaa596b);}BPromise['resolve']()[_0x3582('0x1a')](function(){if(!_0x40ffd5)return;if(_0xab6e13[_0x3582('0x6d')][_0x3582('0x6e')]!==_0x3582('0x6f'))return;if(!_[_0x3582('0x70')](_0x40ffd5[_0x3582('0x43')],[_0x3582('0x34'),_0x3582('0x4c')])){return _0xab6e13['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x3582('0x1a')](function(_0x32bd8a){if(_['isEmpty'](_0x32bd8a)){_0x41f131['where'](_0x3582('0x71'));_0x13e8b0[_0x3582('0x33')](_0x3582('0x71'));}else{_0x41f131[_0x3582('0x33')](_0x3582('0x58'),_['map'](_0x32bd8a,'id'));_0x13e8b0[_0x3582('0x33')](_0x3582('0x58'),_[_0x3582('0x48')](_0x32bd8a,'id'));}});}})['then'](function(){if(_0xab6e13[_0x3582('0x6d')][_0x3582('0x6e')]==='agent'&&!_0x40ffd5&&!_0xab6e13[_0x3582('0x2c')][_0x3582('0x57')])return[];return db[_0x3582('0x72')][_0x3582('0x2c')](_0x41f131['toString'](),_0x58a2e6);})[_0x3582('0x1a')](function(_0x6c84b7){_0x381ae9[_0x3582('0x16')]=_0x6c84b7[_0x3582('0x28')];if(_0x381ae9[_0x3582('0x16')]===0x0)return[];return db[_0x3582('0x72')][_0x3582('0x2c')](_0x17a2d9[_0x3582('0x73')](),_0x58a2e6)['then'](function(_0x5b9076){_0x1e5b93=_[_0x3582('0x74')](_0x5b9076,'id');_0x58a2e6=_[_0x3582('0x75')](_0x58a2e6,{'model':db[_0x3582('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xab6e13[_0x3582('0x2c')][_0x3582('0x2f')]){_0x4d85b5[_0x3582('0x30')][_0x3582('0x49')](function(_0x5e95d0){_0x13e8b0[_0x3582('0x34')]('c.'+_0x5e95d0);});}else{_0x13e8b0[_0x3582('0x34')](_0x3582('0x68'));_0x13e8b0[_0x3582('0x34')]('c.firstName');_0x13e8b0['field'](_0x3582('0x76'));_0x13e8b0[_0x3582('0x34')]('c.phone');_0x13e8b0[_0x3582('0x34')](_0x3582('0x77'));_0x13e8b0['field'](_0x3582('0x78'));_0x13e8b0['field'](_0x3582('0x79'));_0x13e8b0[_0x3582('0x34')](_0x3582('0x7a'));_0x13e8b0[_0x3582('0x34')](_0x3582('0x7b'));_0x13e8b0[_0x3582('0x34')](_0x3582('0x7c'));_0x13e8b0[_0x3582('0x34')](_0x3582('0x7d'));_0x13e8b0['field'](_0x3582('0x7e'),'TagIds');}if(_0x4d85b5['limit'])_0x13e8b0['limit'](_0x4d85b5['limit']);if(_0x4d85b5['offset'])_0x13e8b0['offset'](_0x4d85b5['offset']);return db[_0x3582('0x72')]['query'](_0x13e8b0[_0x3582('0x73')](),_0x58a2e6);});})[_0x3582('0x1a')](function(_0x563d4f){_0x563d4f[_0x3582('0x49')](function(_0x7fcc1f){if(_0x7fcc1f['TagIds']){_0x7fcc1f['Tags']=[];_0x7fcc1f[_0x3582('0x7f')]['split'](',')[_0x3582('0x49')](function(_0x3d9965){_0x7fcc1f[_0x3582('0x80')][_0x3582('0x55')](_0x1e5b93[_0x3d9965]);});}delete _0x7fcc1f['TagIds'];});_0x381ae9[_0x3582('0x81')]=_0x563d4f;return _0x381ae9;})[_0x3582('0x1a')](respondWithFilteredResult(_0xdcb5d7,_0x4d85b5));})[_0x3582('0x82')](handleError(_0xdcb5d7,null));};exports[_0x3582('0x1b')]=function(_0x58ba60,_0x310461){return db[_0x3582('0x22')]['find']({'where':{'id':_0x58ba60['params']['id']}})[_0x3582('0x1a')](handleEntityNotFound(_0x310461,null))['then'](removeEntity(_0x310461,null))[_0x3582('0x82')](handleError(_0x310461,null));};exports[_0x3582('0x23')]=function(_0x10e3e9,_0x111a59){return db[_0x3582('0x22')]['describe']()[_0x3582('0x1a')](function(_0x236685){delete _0x236685[_0x3582('0x83')];for(var _0x45b488=0x0;_0x45b488{}\s\\|]/g,'-');_0x3c6ff5(null,util[_0x43a2('0x23')]('%s-%s%s',path[_0x43a2('0x24')](_0x21fb0e['originalname'],path[_0x43a2('0x25')](_0x21fb0e['originalname'])),Date[_0x43a2('0x26')](),path[_0x43a2('0x25')](_0x21fb0e['originalname'])));}})});router[_0x43a2('0x16')](_0x43a2('0x27'),upload[_0x43a2('0x28')](_0x43a2('0x29')),controller[_0x43a2('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa9f314,_0x6977e7,_0x1a0cd6){_0x1a0cd6(null,path['join'](config[_0x43a2('0x1f')],_0x43a2('0x20')));},'filename':function(_0x56f0d9,_0x52abea,_0x170056){_0x52abea[_0x43a2('0x21')]=_0x52abea['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x170056(null,util[_0x43a2('0x23')](_0x43a2('0x2b'),path['basename'](_0x52abea[_0x43a2('0x21')],path['extname'](_0x52abea['originalname'])),Date[_0x43a2('0x26')](),path['extname'](_0x52abea[_0x43a2('0x21')])));}})});router[_0x43a2('0x16')](_0x43a2('0x2c'),upload[_0x43a2('0x28')](_0x43a2('0x29')),controller[_0x43a2('0x2d')]);router[_0x43a2('0x16')](_0x43a2('0x2e'),auth['isAuthenticated'](),controller[_0x43a2('0x2f')]);router['put'](_0x43a2('0xb'),auth[_0x43a2('0x9')](),controller[_0x43a2('0x30')]);router[_0x43a2('0x31')](_0x43a2('0xb'),auth[_0x43a2('0x9')](),controller[_0x43a2('0x32')]);module['exports']=router; \ No newline at end of file +var _0x39a9=['single','file','diskStorage','/upload','upload','import','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','/create_many','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x39a9,0x93));var _0x939a=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x39a9[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0x939a('0x0'));var util=require(_0x939a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x939a('0x2'));var router=express['Router']();var fs_extra=require(_0x939a('0x3'));var auth=require(_0x939a('0x4'));var interaction=require(_0x939a('0x5'));var config=require('../../config/environment');var controller=require(_0x939a('0x6'));router[_0x939a('0x7')]('/',auth[_0x939a('0x8')](),controller[_0x939a('0x9')]);router[_0x939a('0x7')](_0x939a('0xa'),auth[_0x939a('0x8')](),controller[_0x939a('0xb')]);router[_0x939a('0x7')](_0x939a('0xc'),auth[_0x939a('0x8')](),controller[_0x939a('0xd')]);router[_0x939a('0x7')](_0x939a('0xe'),auth[_0x939a('0x8')](),controller[_0x939a('0xf')]);router['get'](_0x939a('0x10'),auth[_0x939a('0x8')](),controller[_0x939a('0x11')]);router[_0x939a('0x7')](_0x939a('0x12'),auth[_0x939a('0x8')](),controller['getHopperHistories']);router[_0x939a('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x939a('0x13')]);router['get'](_0x939a('0x14'),auth[_0x939a('0x8')](),controller['getJscriptySessions']);router[_0x939a('0x7')](_0x939a('0x15'),auth['isAuthenticated'](),controller[_0x939a('0x16')]);router[_0x939a('0x17')](_0x939a('0x18'),auth[_0x939a('0x8')](),controller['merge']);router[_0x939a('0x17')]('/',auth[_0x939a('0x8')](),controller['create']);router[_0x939a('0x17')](_0x939a('0x19'),auth[_0x939a('0x8')](),controller['bulkCreate']);router[_0x939a('0x17')](_0x939a('0xe'),auth[_0x939a('0x8')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x14ca9c,_0x3fce0b,_0x217596){_0x217596(null,path[_0x939a('0x1a')](config[_0x939a('0x1b')],_0x939a('0x1c')));},'filename':function(_0x20d4a9,_0x818c65,_0x234083){_0x818c65['originalname']=_0x818c65[_0x939a('0x1d')][_0x939a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x234083(null,util[_0x939a('0x1f')](_0x939a('0x20'),path[_0x939a('0x21')](_0x818c65[_0x939a('0x1d')],path[_0x939a('0x22')](_0x818c65[_0x939a('0x1d')])),Date[_0x939a('0x23')](),path[_0x939a('0x22')](_0x818c65[_0x939a('0x1d')])));}})});router[_0x939a('0x17')](_0x939a('0x24'),upload[_0x939a('0x25')](_0x939a('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x939a('0x27')]({'destination':function(_0x5cb1e6,_0x272795,_0xfcb388){_0xfcb388(null,path['join'](config[_0x939a('0x1b')],_0x939a('0x1c')));},'filename':function(_0x52f813,_0x212a3c,_0x3da74b){_0x212a3c[_0x939a('0x1d')]=_0x212a3c[_0x939a('0x1d')][_0x939a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3da74b(null,util[_0x939a('0x1f')]('%s-%s%s',path['basename'](_0x212a3c[_0x939a('0x1d')],path[_0x939a('0x22')](_0x212a3c[_0x939a('0x1d')])),Date[_0x939a('0x23')](),path['extname'](_0x212a3c['originalname'])));}})});router[_0x939a('0x17')](_0x939a('0x28'),upload[_0x939a('0x25')](_0x939a('0x26')),controller[_0x939a('0x29')]);router[_0x939a('0x17')]('/upload/:id',auth[_0x939a('0x8')](),controller[_0x939a('0x2a')]);router['put']('/:id',auth[_0x939a('0x8')](),controller[_0x939a('0x2b')]);router['delete']('/:id',auth[_0x939a('0x8')](),controller[_0x939a('0x2c')]);module[_0x939a('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index bb6d0ff..32bf6cb 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 _0x55d9=['sequelize','lodash','getDataValue','alias','STRING','setDataValue','name','TEXT','long','parse','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x16c3e0,_0x22e998){var _0x10071a=function(_0x33da70){while(--_0x33da70){_0x16c3e0['push'](_0x16c3e0['shift']());}};_0x10071a(++_0x22e998);}(_0x55d9,0xd2));var _0x955d=function(_0x18cebd,_0x5f138f){_0x18cebd=_0x18cebd-0x0;var _0x4c702f=_0x55d9[_0x18cebd];return _0x4c702f;};'use strict';var Sequelize=require(_0x955d('0x0'));var _=require(_0x955d('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x8d8ab0){return this[_0x955d('0x2')](_0x955d('0x3'));}},'alias':{'type':Sequelize[_0x955d('0x4')],'allowNull':![],'set':function(_0x2305e9){this[_0x955d('0x5')](_0x955d('0x3'),_0x2305e9?_0x2305e9:this[_0x955d('0x2')](_0x955d('0x6')));}},'type':{'type':Sequelize[_0x955d('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x955d('0x7')](_0x955d('0x8')),'get':function(){if(this['getDataValue']('type')==='select'){return JSON[_0x955d('0x9')](this[_0x955d('0x2')]('values'));}else{return this[_0x955d('0x2')](_0x955d('0xa'));}},'set':function(_0x1faa0f){if(Array[_0x955d('0xb')](_0x1faa0f)){this[_0x955d('0x5')](_0x955d('0xa'),JSON[_0x955d('0xc')](_0x1faa0f));}else{this[_0x955d('0x5')](_0x955d('0xa'),_0x1faa0f);}}},'required':{'type':Sequelize[_0x955d('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x955d('0xe')]('voice')}}; \ No newline at end of file +var _0x428c=['type','select','parse','values','isArray','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','getDataValue','STRING','setDataValue','TEXT','long'];(function(_0x58e93e,_0x5ce190){var _0x5e16f1=function(_0x3f25ee){while(--_0x3f25ee){_0x58e93e['push'](_0x58e93e['shift']());}};_0x5e16f1(++_0x5ce190);}(_0x428c,0xca));var _0xc428=function(_0x1bc797,_0x1d743f){_0x1bc797=_0x1bc797-0x0;var _0x3fdc95=_0x428c[_0x1bc797];return _0x3fdc95;};'use strict';var Sequelize=require(_0xc428('0x0'));var _=require('lodash');module[_0xc428('0x1')]={'name':{'type':Sequelize[_0xc428('0x2')],'get':function(_0xf95673){return this[_0xc428('0x3')]('alias');}},'alias':{'type':Sequelize[_0xc428('0x4')],'allowNull':![],'set':function(_0x4107b1){this[_0xc428('0x5')]('alias',_0x4107b1?_0x4107b1:this[_0xc428('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xc428('0x6')](_0xc428('0x7')),'get':function(){if(this['getDataValue'](_0xc428('0x8'))===_0xc428('0x9')){return JSON[_0xc428('0xa')](this[_0xc428('0x3')]('values'));}else{return this['getDataValue'](_0xc428('0xb'));}},'set':function(_0x2643ac){if(Array[_0xc428('0xc')](_0x2643ac)){this['setDataValue']('values',JSON['stringify'](_0x2643ac));}else{this[_0xc428('0x5')]('values',_0x2643ac);}}},'required':{'type':Sequelize[_0xc428('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc428('0xe')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 92b4b26..d3b5b8f 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 _0x436f=['fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','end','error','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','params','find','update','body','destroy','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x436f,0x19d));var _0xf436=function(_0x30509e,_0xd76fdb){_0x30509e=_0x30509e-0x0;var _0x331f11=_0x436f[_0x30509e];return _0x331f11;};'use strict';var emlformat=require(_0xf436('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf436('0x1'));var jsonpatch=require(_0xf436('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf436('0x3'));var Mustache=require(_0xf436('0x4'));var util=require(_0xf436('0x5'));var path=require(_0xf436('0x6'));var sox=require(_0xf436('0x7'));var csv=require(_0xf436('0x8'));var ejs=require(_0xf436('0x9'));var fs=require('fs');var fs_extra=require(_0xf436('0xa'));var _=require(_0xf436('0xb'));var squel=require(_0xf436('0xc'));var crypto=require(_0xf436('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf436('0xe'));var toCsv=require(_0xf436('0x8'));var querystring=require('querystring');var Papa=require(_0xf436('0xf'));var Redis=require(_0xf436('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf436('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf436('0x12'));var logger=require(_0xf436('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf436('0x14'))['db'];function respondWithStatusCode(_0x3e99f3,_0x3da448){_0x3da448=_0x3da448||0xcc;return function(_0x500609){if(_0x500609){return _0x3e99f3[_0xf436('0x15')](_0x3da448);}return _0x3e99f3[_0xf436('0x16')](_0x3da448)['end']();};}function respondWithResult(_0xc5957c,_0x14c539){_0x14c539=_0x14c539||0xc8;return function(_0x3907ab){if(_0x3907ab){return _0xc5957c[_0xf436('0x16')](_0x14c539)[_0xf436('0x17')](_0x3907ab);}};}function respondWithFilteredResult(_0x340b25,_0xbf8a9b){return function(_0x4f7599){if(_0x4f7599){var _0x85600a=typeof _0xbf8a9b[_0xf436('0x18')]==='undefined'&&typeof _0xbf8a9b[_0xf436('0x19')]===_0xf436('0x1a');var _0x58efab=_0x4f7599[_0xf436('0x1b')];var _0x498540=_0x85600a?0x0:_0xbf8a9b['offset'];var _0x3e4679=_0x85600a?_0x4f7599[_0xf436('0x1b')]:_0xbf8a9b[_0xf436('0x18')]+_0xbf8a9b[_0xf436('0x19')];var _0x1b901c;if(_0x3e4679>=_0x58efab){_0x3e4679=_0x58efab;_0x1b901c=0xc8;}else{_0x1b901c=0xce;}_0x340b25[_0xf436('0x16')](_0x1b901c);return _0x340b25[_0xf436('0x1c')]('Content-Range',_0x498540+'-'+_0x3e4679+'/'+_0x58efab)[_0xf436('0x17')](_0x4f7599);}return null;};}function patchUpdates(_0x1422ca){return function(_0x28350b){try{jsonpatch[_0xf436('0x1d')](_0x28350b,_0x1422ca,!![]);}catch(_0x5e8480){return BPromise['reject'](_0x5e8480);}return _0x28350b[_0xf436('0x1e')]();};}function saveUpdates(_0x3cb78e,_0x5bba91){return function(_0x4bc784){if(_0x4bc784){return _0x4bc784['update'](_0x3cb78e)[_0xf436('0x1f')](function(_0x456144){return _0x456144;});}return null;};}function removeEntity(_0x4c9599,_0x2b1be5){return function(_0x124903){if(_0x124903){return _0x124903['destroy']()[_0xf436('0x1f')](function(){_0x4c9599[_0xf436('0x16')](0xcc)[_0xf436('0x20')]();});}};}function handleEntityNotFound(_0x306dcc,_0x371c3a){return function(_0x3b604b){if(!_0x3b604b){_0x306dcc[_0xf436('0x15')](0x194);}return _0x3b604b;};}function handleError(_0x345df1,_0x4e7f53){_0x4e7f53=_0x4e7f53||0x1f4;return function(_0x5157c9){logger[_0xf436('0x21')](_0x5157c9['stack']);if(_0x5157c9['name']){delete _0x5157c9[_0xf436('0x22')];}_0x345df1[_0xf436('0x16')](_0x4e7f53)[_0xf436('0x23')](_0x5157c9);};}exports[_0xf436('0x24')]=function(_0x4b2a9a,_0x27207c){var _0xf7f4ba={},_0x220270={},_0x108ed3={'count':0x0,'rows':[]};var _0x5b2bd3=_['map'](db[_0xf436('0x25')][_0xf436('0x26')],function(_0x45eeaa){return{'name':_0x45eeaa[_0xf436('0x27')],'type':_0x45eeaa[_0xf436('0x28')][_0xf436('0x29')]};});_0x220270[_0xf436('0x2a')]=_[_0xf436('0x2b')](_['map'](_0x5b2bd3,_0xf436('0x22')),[_0xf436('0x22')]);_0x220270[_0xf436('0x2c')]=_[_0xf436('0x2d')](_0x4b2a9a[_0xf436('0x2c')]);_0x220270[_0xf436('0x2e')]=_[_0xf436('0x2f')](_0x220270[_0xf436('0x2a')],_0x220270[_0xf436('0x2c')]);_0xf7f4ba['attributes']=_[_0xf436('0x2f')](_0x220270[_0xf436('0x2a')],qs['fields'](_0x4b2a9a['query'][_0xf436('0x30')]));_0xf7f4ba[_0xf436('0x31')]=_0xf7f4ba[_0xf436('0x31')][_0xf436('0x32')]?_0xf7f4ba[_0xf436('0x31')]:_0x220270[_0xf436('0x2a')];if(!_0x4b2a9a['query'][_0xf436('0x33')](_0xf436('0x34'))){_0xf7f4ba[_0xf436('0x19')]=qs[_0xf436('0x19')](_0x4b2a9a[_0xf436('0x2c')]['limit']);_0xf7f4ba[_0xf436('0x18')]=qs[_0xf436('0x18')](_0x4b2a9a['query']['offset']);}_0xf7f4ba[_0xf436('0x35')]=qs[_0xf436('0x36')](_0x4b2a9a['query'][_0xf436('0x36')]);_0xf7f4ba[_0xf436('0x37')]=qs[_0xf436('0x2e')](_['pick'](_0x4b2a9a['query'],_0x220270[_0xf436('0x2e')]),_0x5b2bd3);if(_0x4b2a9a[_0xf436('0x2c')][_0xf436('0x38')]){_0xf7f4ba[_0xf436('0x37')]=_[_0xf436('0x39')](_0xf7f4ba[_0xf436('0x37')],{'$or':_[_0xf436('0x3a')](_0x5b2bd3,function(_0x4f9cbc){if(_0x4f9cbc[_0xf436('0x28')]!==_0xf436('0x3b')){var _0x12100c={};_0x12100c[_0x4f9cbc[_0xf436('0x22')]]={'$like':'%'+_0x4b2a9a[_0xf436('0x2c')][_0xf436('0x38')]+'%'};return _0x12100c;}})});}_0xf7f4ba=_[_0xf436('0x39')]({},_0xf7f4ba,_0x4b2a9a[_0xf436('0x3c')]);var _0x430e96={'where':_0xf7f4ba[_0xf436('0x37')]};return db[_0xf436('0x25')][_0xf436('0x1b')](_0x430e96)['then'](function(_0x2f38e9){_0x108ed3[_0xf436('0x1b')]=_0x2f38e9;if(_0x4b2a9a[_0xf436('0x2c')][_0xf436('0x3d')]){_0xf7f4ba[_0xf436('0x3e')]=[{'all':!![]}];}return db[_0xf436('0x25')][_0xf436('0x3f')](_0xf7f4ba);})[_0xf436('0x1f')](function(_0x4f47e5){_0x108ed3['rows']=_0x4f47e5;return _0x108ed3;})[_0xf436('0x1f')](respondWithFilteredResult(_0x27207c,_0xf7f4ba))[_0xf436('0x40')](handleError(_0x27207c,null));};exports['show']=function(_0x49dff9,_0x3923d1){var _0x54f3fb={'raw':!![],'where':{'id':_0x49dff9[_0xf436('0x41')]['id']}},_0x2e92ef={};_0x2e92ef['model']=_[_0xf436('0x2d')](db['CmCustomField'][_0xf436('0x26')]);_0x2e92ef[_0xf436('0x2c')]=_[_0xf436('0x2d')](_0x49dff9['query']);_0x2e92ef[_0xf436('0x2e')]=_[_0xf436('0x2f')](_0x2e92ef[_0xf436('0x2a')],_0x2e92ef[_0xf436('0x2c')]);_0x54f3fb['attributes']=_[_0xf436('0x2f')](_0x2e92ef[_0xf436('0x2a')],qs[_0xf436('0x30')](_0x49dff9['query'][_0xf436('0x30')]));_0x54f3fb['attributes']=_0x54f3fb[_0xf436('0x31')][_0xf436('0x32')]?_0x54f3fb[_0xf436('0x31')]:_0x2e92ef[_0xf436('0x2a')];if(_0x49dff9[_0xf436('0x2c')][_0xf436('0x3d')]){_0x54f3fb['include']=[{'all':!![]}];}_0x54f3fb=_[_0xf436('0x39')]({},_0x54f3fb,_0x49dff9[_0xf436('0x3c')]);return db[_0xf436('0x25')][_0xf436('0x42')](_0x54f3fb)[_0xf436('0x1f')](handleEntityNotFound(_0x3923d1,null))[_0xf436('0x1f')](respondWithResult(_0x3923d1,null))[_0xf436('0x40')](handleError(_0x3923d1,null));};exports[_0xf436('0x43')]=function(_0x248f94,_0xbea2e6){if(_0x248f94[_0xf436('0x44')]['id']){delete _0x248f94[_0xf436('0x44')]['id'];}return db[_0xf436('0x25')][_0xf436('0x42')]({'where':{'id':_0x248f94[_0xf436('0x41')]['id']}})['then'](handleEntityNotFound(_0xbea2e6,null))[_0xf436('0x1f')](saveUpdates(_0x248f94[_0xf436('0x44')],null))[_0xf436('0x1f')](respondWithResult(_0xbea2e6,null))[_0xf436('0x40')](handleError(_0xbea2e6,null));};exports[_0xf436('0x45')]=function(_0x54a78,_0x24092f){return db[_0xf436('0x25')]['find']({'where':{'id':_0x54a78[_0xf436('0x41')]['id']}})[_0xf436('0x1f')](handleEntityNotFound(_0x24092f,null))[_0xf436('0x1f')](removeEntity(_0x24092f,null))[_0xf436('0x40')](handleError(_0x24092f,null));};exports[_0xf436('0x46')]=function(_0xccc0b2,_0x4d6935){var _0x2703d3;return db[_0xf436('0x47')][_0xf436('0x48')](function(_0x4ae5d8){return db['CmCustomField'][_0xf436('0x46')](_0xccc0b2[_0xf436('0x44')],{'transaction':_0x4ae5d8})[_0xf436('0x1f')](function(_0x4d8339){_0x2703d3=_0x4d8339;var _0x1f5370={'type':db[_0xf436('0x49')][_0xf436('0x4a')],'transaction':_0x4ae5d8};switch(_0xccc0b2[_0xf436('0x44')][_0xf436('0x28')]){case'text':_0x1f5370[_0xf436('0x28')]=db[_0xf436('0x49')][_0xf436('0x4a')];break;case _0xf436('0x4b'):_0x1f5370['type']=db['Sequelize'][_0xf436('0x4c')];break;case _0xf436('0x4d'):_0x1f5370[_0xf436('0x28')]=db[_0xf436('0x49')][_0xf436('0x4e')];_0x1f5370['defaultValue']=![];break;default:}return db[_0xf436('0x47')]['queryInterface'][_0xf436('0x4f')](_0xf436('0x50'),util[_0xf436('0x51')](_0xf436('0x52'),_0x2703d3['id']),_0x1f5370);})[_0xf436('0x1f')](function(){return _0x2703d3;});})[_0xf436('0x1f')](respondWithResult(_0x4d6935,0xc9))[_0xf436('0x40')](handleError(_0x4d6935,null));}; \ No newline at end of file +var _0x42a1=['rawAttributes','fieldName','model','differenceBy','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','options','find','update','body','create','sequelize','text','Sequelize','TEXT','INTEGER','BOOLEAN','addColumn','format','cf_%d','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','CmCustomField'];(function(_0x543bfd,_0x2a8438){var _0x87daa2=function(_0x5eadee){while(--_0x5eadee){_0x543bfd['push'](_0x543bfd['shift']());}};_0x87daa2(++_0x2a8438);}(_0x42a1,0x123));var _0x142a=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0x42a1[_0x4a5494];return _0x57cbb5;};'use strict';var emlformat=require(_0x142a('0x0'));var rimraf=require(_0x142a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x142a('0x2'));var rp=require(_0x142a('0x3'));var moment=require(_0x142a('0x4'));var BPromise=require(_0x142a('0x5'));var Mustache=require(_0x142a('0x6'));var util=require(_0x142a('0x7'));var path=require('path');var sox=require(_0x142a('0x8'));var csv=require(_0x142a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x142a('0xa'));var squel=require(_0x142a('0xb'));var crypto=require(_0x142a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x142a('0xd'));var toCsv=require(_0x142a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x142a('0xe'));var authService=require(_0x142a('0xf'));var qs=require(_0x142a('0x10'));var as=require(_0x142a('0x11'));var hardwareService=require(_0x142a('0x12'));var logger=require(_0x142a('0x13'))(_0x142a('0x14'));var utils=require('../../config/utils');var config=require(_0x142a('0x15'));var licenseUtil=require(_0x142a('0x16'));var db=require(_0x142a('0x17'))['db'];function respondWithStatusCode(_0x37a555,_0x32896e){_0x32896e=_0x32896e||0xcc;return function(_0x2bfe39){if(_0x2bfe39){return _0x37a555[_0x142a('0x18')](_0x32896e);}return _0x37a555[_0x142a('0x19')](_0x32896e)[_0x142a('0x1a')]();};}function respondWithResult(_0xdfccc9,_0x512efe){_0x512efe=_0x512efe||0xc8;return function(_0x293ad5){if(_0x293ad5){return _0xdfccc9[_0x142a('0x19')](_0x512efe)[_0x142a('0x1b')](_0x293ad5);}};}function respondWithFilteredResult(_0x3c9682,_0x3e7f8b){return function(_0x7d9a01){if(_0x7d9a01){var _0x72db60=typeof _0x3e7f8b[_0x142a('0x1c')]===_0x142a('0x1d')&&typeof _0x3e7f8b[_0x142a('0x1e')]===_0x142a('0x1d');var _0x2e7233=_0x7d9a01[_0x142a('0x1f')];var _0x5c229d=_0x72db60?0x0:_0x3e7f8b['offset'];var _0x1cd280=_0x72db60?_0x7d9a01[_0x142a('0x1f')]:_0x3e7f8b[_0x142a('0x1c')]+_0x3e7f8b[_0x142a('0x1e')];var _0x28bbf8;if(_0x1cd280>=_0x2e7233){_0x1cd280=_0x2e7233;_0x28bbf8=0xc8;}else{_0x28bbf8=0xce;}_0x3c9682[_0x142a('0x19')](_0x28bbf8);return _0x3c9682[_0x142a('0x20')](_0x142a('0x21'),_0x5c229d+'-'+_0x1cd280+'/'+_0x2e7233)[_0x142a('0x1b')](_0x7d9a01);}return null;};}function patchUpdates(_0x307d1d){return function(_0x1cc36a){try{jsonpatch[_0x142a('0x22')](_0x1cc36a,_0x307d1d,!![]);}catch(_0x535853){return BPromise[_0x142a('0x23')](_0x535853);}return _0x1cc36a[_0x142a('0x24')]();};}function saveUpdates(_0x538179,_0xc339f5){return function(_0x2d0b1b){if(_0x2d0b1b){return _0x2d0b1b['update'](_0x538179)[_0x142a('0x25')](function(_0x46f8db){return _0x46f8db;});}return null;};}function removeEntity(_0x46ed87,_0x377553){return function(_0x370243){if(_0x370243){return _0x370243[_0x142a('0x26')]()[_0x142a('0x25')](function(){_0x46ed87[_0x142a('0x19')](0xcc)[_0x142a('0x1a')]();});}};}function handleEntityNotFound(_0x1c2675,_0x437819){return function(_0x3be897){if(!_0x3be897){_0x1c2675[_0x142a('0x18')](0x194);}return _0x3be897;};}function handleError(_0x54abc0,_0x2d2e5a){_0x2d2e5a=_0x2d2e5a||0x1f4;return function(_0x202136){logger[_0x142a('0x27')](_0x202136[_0x142a('0x28')]);if(_0x202136[_0x142a('0x29')]){delete _0x202136[_0x142a('0x29')];}_0x54abc0['status'](_0x2d2e5a)[_0x142a('0x2a')](_0x202136);};}exports[_0x142a('0x2b')]=function(_0xba4cc3,_0x25e744){var _0x2ab384={},_0x28bbd3={},_0x1455fc={'count':0x0,'rows':[]};var _0x26f847=_['map'](db[_0x142a('0x2c')][_0x142a('0x2d')],function(_0x28aa07){return{'name':_0x28aa07[_0x142a('0x2e')],'type':_0x28aa07['type']['key']};});_0x28bbd3[_0x142a('0x2f')]=_[_0x142a('0x30')](_[_0x142a('0x31')](_0x26f847,_0x142a('0x29')),[_0x142a('0x29')]);_0x28bbd3[_0x142a('0x32')]=_[_0x142a('0x33')](_0xba4cc3[_0x142a('0x32')]);_0x28bbd3[_0x142a('0x34')]=_[_0x142a('0x35')](_0x28bbd3[_0x142a('0x2f')],_0x28bbd3['query']);_0x2ab384[_0x142a('0x36')]=_['intersection'](_0x28bbd3[_0x142a('0x2f')],qs[_0x142a('0x37')](_0xba4cc3[_0x142a('0x32')][_0x142a('0x37')]));_0x2ab384[_0x142a('0x36')]=_0x2ab384['attributes'][_0x142a('0x38')]?_0x2ab384[_0x142a('0x36')]:_0x28bbd3[_0x142a('0x2f')];if(!_0xba4cc3[_0x142a('0x32')][_0x142a('0x39')]('nolimit')){_0x2ab384[_0x142a('0x1e')]=qs[_0x142a('0x1e')](_0xba4cc3['query'][_0x142a('0x1e')]);_0x2ab384[_0x142a('0x1c')]=qs[_0x142a('0x1c')](_0xba4cc3['query']['offset']);}_0x2ab384['order']=qs['sort'](_0xba4cc3[_0x142a('0x32')][_0x142a('0x3a')]);_0x2ab384[_0x142a('0x3b')]=qs['filters'](_['pick'](_0xba4cc3[_0x142a('0x32')],_0x28bbd3[_0x142a('0x34')]),_0x26f847);if(_0xba4cc3[_0x142a('0x32')][_0x142a('0x3c')]){_0x2ab384['where']=_[_0x142a('0x3d')](_0x2ab384[_0x142a('0x3b')],{'$or':_[_0x142a('0x31')](_0x26f847,function(_0x276eaf){if(_0x276eaf[_0x142a('0x3e')]!=='VIRTUAL'){var _0x4f71ac={};_0x4f71ac[_0x276eaf['name']]={'$like':'%'+_0xba4cc3[_0x142a('0x32')]['filter']+'%'};return _0x4f71ac;}})});}_0x2ab384=_['merge']({},_0x2ab384,_0xba4cc3['options']);var _0x370425={'where':_0x2ab384['where']};return db[_0x142a('0x2c')][_0x142a('0x1f')](_0x370425)[_0x142a('0x25')](function(_0x2acbbf){_0x1455fc[_0x142a('0x1f')]=_0x2acbbf;if(_0xba4cc3[_0x142a('0x32')][_0x142a('0x3f')]){_0x2ab384[_0x142a('0x40')]=[{'all':!![]}];}return db[_0x142a('0x2c')][_0x142a('0x41')](_0x2ab384);})[_0x142a('0x25')](function(_0x1fad13){_0x1455fc[_0x142a('0x42')]=_0x1fad13;return _0x1455fc;})[_0x142a('0x25')](respondWithFilteredResult(_0x25e744,_0x2ab384))[_0x142a('0x43')](handleError(_0x25e744,null));};exports[_0x142a('0x44')]=function(_0x274035,_0x2aa223){var _0xa45418={'raw':!![],'where':{'id':_0x274035[_0x142a('0x45')]['id']}},_0x2a48b6={};_0x2a48b6[_0x142a('0x2f')]=_[_0x142a('0x33')](db[_0x142a('0x2c')]['rawAttributes']);_0x2a48b6[_0x142a('0x32')]=_[_0x142a('0x33')](_0x274035[_0x142a('0x32')]);_0x2a48b6[_0x142a('0x34')]=_[_0x142a('0x35')](_0x2a48b6[_0x142a('0x2f')],_0x2a48b6[_0x142a('0x32')]);_0xa45418['attributes']=_[_0x142a('0x35')](_0x2a48b6[_0x142a('0x2f')],qs['fields'](_0x274035[_0x142a('0x32')][_0x142a('0x37')]));_0xa45418['attributes']=_0xa45418[_0x142a('0x36')][_0x142a('0x38')]?_0xa45418[_0x142a('0x36')]:_0x2a48b6[_0x142a('0x2f')];if(_0x274035['query'][_0x142a('0x3f')]){_0xa45418['include']=[{'all':!![]}];}_0xa45418=_[_0x142a('0x3d')]({},_0xa45418,_0x274035[_0x142a('0x46')]);return db[_0x142a('0x2c')][_0x142a('0x47')](_0xa45418)['then'](handleEntityNotFound(_0x2aa223,null))[_0x142a('0x25')](respondWithResult(_0x2aa223,null))[_0x142a('0x43')](handleError(_0x2aa223,null));};exports[_0x142a('0x48')]=function(_0x43a2a0,_0x55b811){if(_0x43a2a0[_0x142a('0x49')]['id']){delete _0x43a2a0[_0x142a('0x49')]['id'];}return db[_0x142a('0x2c')][_0x142a('0x47')]({'where':{'id':_0x43a2a0[_0x142a('0x45')]['id']}})['then'](handleEntityNotFound(_0x55b811,null))[_0x142a('0x25')](saveUpdates(_0x43a2a0[_0x142a('0x49')],null))['then'](respondWithResult(_0x55b811,null))[_0x142a('0x43')](handleError(_0x55b811,null));};exports['destroy']=function(_0x4a31ea,_0x314723){return db[_0x142a('0x2c')]['find']({'where':{'id':_0x4a31ea[_0x142a('0x45')]['id']}})[_0x142a('0x25')](handleEntityNotFound(_0x314723,null))[_0x142a('0x25')](removeEntity(_0x314723,null))[_0x142a('0x43')](handleError(_0x314723,null));};exports[_0x142a('0x4a')]=function(_0x2de655,_0x3f7369){var _0x2f5b2d;return db[_0x142a('0x4b')]['transaction'](function(_0x4a5370){return db[_0x142a('0x2c')][_0x142a('0x4a')](_0x2de655['body'],{'transaction':_0x4a5370})[_0x142a('0x25')](function(_0x4fcb4c){_0x2f5b2d=_0x4fcb4c;var _0x2801a8={'type':db['Sequelize']['TEXT'],'transaction':_0x4a5370};switch(_0x2de655[_0x142a('0x49')][_0x142a('0x3e')]){case _0x142a('0x4c'):_0x2801a8['type']=db[_0x142a('0x4d')][_0x142a('0x4e')];break;case'number':_0x2801a8['type']=db[_0x142a('0x4d')][_0x142a('0x4f')];break;case'switch':_0x2801a8['type']=db[_0x142a('0x4d')][_0x142a('0x50')];_0x2801a8['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x142a('0x51')]('cm_contacts',util[_0x142a('0x52')](_0x142a('0x53'),_0x2f5b2d['id']),_0x2801a8);})[_0x142a('0x25')](function(){return _0x2f5b2d;});})[_0x142a('0x25')](respondWithResult(_0x3f7369,0xc9))[_0x142a('0x43')](handleError(_0x3f7369,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index dcfb952..f680c95 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 _0xa028=['../../config/logger','api','moment','request-promise','path','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','util'];(function(_0x144d6d,_0x2002b3){var _0x3410a3=function(_0x34994c){while(--_0x34994c){_0x144d6d['push'](_0x144d6d['shift']());}};_0x3410a3(++_0x2002b3);}(_0xa028,0x83));var _0x8a02=function(_0x104675,_0x3e8a1b){_0x104675=_0x104675-0x0;var _0x1f76ab=_0xa028[_0x104675];return _0x1f76ab;};'use strict';var _=require('lodash');var util=require(_0x8a02('0x0'));var logger=require(_0x8a02('0x1'))(_0x8a02('0x2'));var moment=require(_0x8a02('0x3'));var BPromise=require('bluebird');var rp=require(_0x8a02('0x4'));var fs=require('fs');var path=require(_0x8a02('0x5'));var rimraf=require('rimraf');var config=require(_0x8a02('0x6'));var attributes=require(_0x8a02('0x7'));module[_0x8a02('0x8')]=function(_0x6b2f59,_0x89dad3){return _0x6b2f59['define'](_0x8a02('0x9'),attributes,{'tableName':_0x8a02('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fd1=['CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','define'];(function(_0x3faa92,_0x892f67){var _0x5f2106=function(_0x2e2565){while(--_0x2e2565){_0x3faa92['push'](_0x3faa92['shift']());}};_0x5f2106(++_0x892f67);}(_0x4fd1,0xce));var _0x14fd=function(_0x4137fa,_0x4a342f){_0x4137fa=_0x4137fa-0x0;var _0x3fb48d=_0x4fd1[_0x4137fa];return _0x3fb48d;};'use strict';var _=require('lodash');var util=require(_0x14fd('0x0'));var logger=require(_0x14fd('0x1'))(_0x14fd('0x2'));var moment=require(_0x14fd('0x3'));var BPromise=require(_0x14fd('0x4'));var rp=require(_0x14fd('0x5'));var fs=require('fs');var path=require(_0x14fd('0x6'));var rimraf=require(_0x14fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x14fd('0x8'));module['exports']=function(_0x4d4e5b,_0x3d38db){return _0x4d4e5b[_0x14fd('0x9')](_0x14fd('0xa'),attributes,{'tableName':_0x14fd('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 6fd3f94..a2c26d0 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 _0x0e0d=['request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','CmCustomField,\x20%s,\x20%s','debug'];(function(_0x28da10,_0x29470c){var _0x298372=function(_0x4acba9){while(--_0x4acba9){_0x28da10['push'](_0x28da10['shift']());}};_0x298372(++_0x29470c);}(_0x0e0d,0x6a));var _0xd0e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0e0('0x0'));var util=require(_0xd0e0('0x1'));var moment=require(_0xd0e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0e0('0x3'));var fs=require('fs');var Redis=require(_0xd0e0('0x4'));var db=require(_0xd0e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd0e0('0x6'));var config=require(_0xd0e0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd0e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca3fd5,_0x4e286e,_0x3c1144){return new BPromise(function(_0x17e984,_0x5153b4){return client[_0xd0e0('0x9')](_0xca3fd5,_0x3c1144)[_0xd0e0('0xa')](function(_0x1c853b){logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');logger[_0xd0e0('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x4e286e,_0xd0e0('0xe'),JSON['stringify'](_0x1c853b));if(_0x1c853b[_0xd0e0('0xf')]){if(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x10')]===0x1f4){logger[_0xd0e0('0xf')]('CmCustomField,\x20%s,\x20%s',_0x4e286e,_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);return _0x5153b4(_0x1c853b[_0xd0e0('0xf')][_0xd0e0('0x11')]);}logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x1c853b[_0xd0e0('0xf')]['message']);return _0x17e984(_0x1c853b['error'][_0xd0e0('0x11')]);}else{logger[_0xd0e0('0xb')](_0xd0e0('0xc'),_0x4e286e,'request\x20sent');_0x17e984(_0x1c853b[_0xd0e0('0x12')][_0xd0e0('0x11')]);}})[_0xd0e0('0x13')](function(_0x63dc4f){logger[_0xd0e0('0xf')](_0xd0e0('0xc'),_0x4e286e,_0x63dc4f);_0x5153b4(_0x63dc4f);});});} \ No newline at end of file +var _0x31d7=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','code','error','message','CmCustomField,\x20%s,\x20%s'];(function(_0x2c7b5c,_0x331adf){var _0x1df5f3=function(_0x4fc30b){while(--_0x4fc30b){_0x2c7b5c['push'](_0x2c7b5c['shift']());}};_0x1df5f3(++_0x331adf);}(_0x31d7,0x11a));var _0x731d=function(_0x2d6334,_0x442f22){_0x2d6334=_0x2d6334-0x0;var _0x2ff29d=_0x31d7[_0x2d6334];return _0x2ff29d;};'use strict';var _=require('lodash');var util=require(_0x731d('0x0'));var moment=require(_0x731d('0x1'));var BPromise=require(_0x731d('0x2'));var rs=require(_0x731d('0x3'));var fs=require('fs');var Redis=require(_0x731d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x731d('0x5'))(_0x731d('0x6'));var config=require(_0x731d('0x7'));var jayson=require(_0x731d('0x8'));var client=jayson[_0x731d('0x9')][_0x731d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x238c14,_0x3aa130,_0x1a34cb){return new BPromise(function(_0x165950,_0x1c64a1){return client['request'](_0x238c14,_0x1a34cb)['then'](function(_0x42296d){logger[_0x731d('0xb')]('CmCustomField,\x20%s,\x20%s',_0x3aa130,_0x731d('0xc'));logger[_0x731d('0xd')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x3aa130,_0x731d('0xc'),JSON['stringify'](_0x42296d));if(_0x42296d['error']){if(_0x42296d['error'][_0x731d('0xe')]===0x1f4){logger[_0x731d('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3aa130,_0x42296d['error'][_0x731d('0x10')]);return _0x1c64a1(_0x42296d[_0x731d('0xf')][_0x731d('0x10')]);}logger[_0x731d('0xf')](_0x731d('0x11'),_0x3aa130,_0x42296d[_0x731d('0xf')]['message']);return _0x165950(_0x42296d[_0x731d('0xf')][_0x731d('0x10')]);}else{logger[_0x731d('0xb')](_0x731d('0x11'),_0x3aa130,_0x731d('0xc'));_0x165950(_0x42296d[_0x731d('0x12')][_0x731d('0x10')]);}})[_0x731d('0x13')](function(_0x3f039b){logger[_0x731d('0xf')](_0x731d('0x11'),_0x3aa130,_0x3f039b);_0x1c64a1(_0x3f039b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2936bca..5b00c4f 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 _0xcbd3=['create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','post'];(function(_0x461277,_0x15e8e7){var _0x1274e9=function(_0x143129){while(--_0x143129){_0x461277['push'](_0x461277['shift']());}};_0x1274e9(++_0x15e8e7);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x37a902,_0x5b03a1){_0x37a902=_0x37a902-0x0;var _0x3baef5=_0xcbd3[_0x37a902];return _0x3baef5;};'use strict';var multer=require(_0x3cbd('0x0'));var util=require(_0x3cbd('0x1'));var path=require(_0x3cbd('0x2'));var timeout=require(_0x3cbd('0x3'));var express=require(_0x3cbd('0x4'));var router=express[_0x3cbd('0x5')]();var fs_extra=require(_0x3cbd('0x6'));var auth=require(_0x3cbd('0x7'));var interaction=require(_0x3cbd('0x8'));var config=require(_0x3cbd('0x9'));var controller=require('./cmCustomField.controller');router[_0x3cbd('0xa')]('/',auth[_0x3cbd('0xb')](),controller['index']);router[_0x3cbd('0xa')]('/:id',auth[_0x3cbd('0xb')](),controller['show']);router[_0x3cbd('0xc')]('/',auth[_0x3cbd('0xb')](),controller[_0x3cbd('0xd')]);router[_0x3cbd('0xe')](_0x3cbd('0xf'),auth['isAuthenticated'](),controller[_0x3cbd('0x10')]);router['delete'](_0x3cbd('0xf'),auth[_0x3cbd('0xb')](),controller[_0x3cbd('0x11')]);module['exports']=router; \ No newline at end of file +var _0x010a=['index','show','post','put','/:id','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x4a5dd2,_0x27f57c){var _0x5e8b75=function(_0x2b0865){while(--_0x2b0865){_0x4a5dd2['push'](_0x4a5dd2['shift']());}};_0x5e8b75(++_0x27f57c);}(_0x010a,0x1f4));var _0xa010=function(_0x299df4,_0x1cba0f){_0x299df4=_0x299df4-0x0;var _0x276712=_0x010a[_0x299df4];return _0x276712;};'use strict';var multer=require('multer');var util=require(_0xa010('0x0'));var path=require('path');var timeout=require(_0xa010('0x1'));var express=require(_0xa010('0x2'));var router=express['Router']();var fs_extra=require(_0xa010('0x3'));var auth=require(_0xa010('0x4'));var interaction=require(_0xa010('0x5'));var config=require(_0xa010('0x6'));var controller=require(_0xa010('0x7'));router[_0xa010('0x8')]('/',auth[_0xa010('0x9')](),controller[_0xa010('0xa')]);router[_0xa010('0x8')]('/:id',auth[_0xa010('0x9')](),controller[_0xa010('0xb')]);router[_0xa010('0xc')]('/',auth[_0xa010('0x9')](),controller['create']);router[_0xa010('0xd')](_0xa010('0xe'),auth[_0xa010('0x9')](),controller['update']);router[_0xa010('0xf')](_0xa010('0xe'),auth[_0xa010('0x9')](),controller[_0xa010('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b5651f7..7afbd00 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 _0xdec1=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x34b331,_0x257246){var _0x26ae99=function(_0x421382){while(--_0x421382){_0x34b331['push'](_0x34b331['shift']());}};_0x26ae99(++_0x257246);}(_0xdec1,0xab));var _0x1dec=function(_0x405fe7,_0x3bc552){_0x405fe7=_0x405fe7-0x0;var _0x391aad=_0xdec1[_0x405fe7];return _0x391aad;};'use strict';var moment=require(_0x1dec('0x0'));var Sequelize=require(_0x1dec('0x1'));module[_0x1dec('0x2')]={'phone':{'type':Sequelize[_0x1dec('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x1dec('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1dec('0x5')],'defaultValue':moment()[_0x1dec('0x6')](_0x1dec('0x7'))},'countbusyretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x1dec('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1dec('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x1dec('0x8')](0x2)[_0x1dec('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1dec('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1dec('0x8')],'unique':_0x1dec('0xa')},'ListId':{'type':Sequelize[_0x1dec('0x8')],'unique':_0x1dec('0xa')},'UserId':{'type':Sequelize[_0x1dec('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x1dec('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1dec('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x91fb=['STRING','BOOLEAN','moment','sequelize','exports','DATE','format','INTEGER'];(function(_0x23ba13,_0x9aa765){var _0x45f12d=function(_0x3d9be7){while(--_0x3d9be7){_0x23ba13['push'](_0x23ba13['shift']());}};_0x45f12d(++_0x9aa765);}(_0x91fb,0x10a));var _0xb91f=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x91fb[_0x3b5049];return _0x12454e;};'use strict';var moment=require(_0xb91f('0x0'));var Sequelize=require(_0xb91f('0x1'));module[_0xb91f('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb91f('0x3')],'defaultValue':moment()[_0xb91f('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb91f('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb91f('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb91f('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb91f('0x3')]},'priority':{'type':Sequelize[_0xb91f('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb91f('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb91f('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb91f('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb91f('0x5')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xb91f('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb91f('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb91f('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb91f('0x5')],'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 f4276a1..280ed26 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 _0xe8e8=['params','keys','rawAttributes','options','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','state','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmContact','getVoiceQueues','outbound','sequelize','format','direction','prev','isEmpty','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','CmCompany','Company','List','Queue','dialActive','getOpenContacts','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','CmHopper','fieldName','type','model','query','filters','intersection','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','rows','catch','show'];(function(_0x2fe959,_0x351d77){var _0x2f6ace=function(_0x4ede54){while(--_0x4ede54){_0x2fe959['push'](_0x2fe959['shift']());}};_0x2f6ace(++_0x351d77);}(_0xe8e8,0xd2));var _0x8e8e=function(_0x1a9dc4,_0xf62b3){_0x1a9dc4=_0x1a9dc4-0x0;var _0xb0c06f=_0xe8e8[_0x1a9dc4];return _0xb0c06f;};'use strict';var emlformat=require(_0x8e8e('0x0'));var rimraf=require(_0x8e8e('0x1'));var zipdir=require(_0x8e8e('0x2'));var jsonpatch=require(_0x8e8e('0x3'));var rp=require(_0x8e8e('0x4'));var moment=require(_0x8e8e('0x5'));var BPromise=require(_0x8e8e('0x6'));var Mustache=require('mustache');var util=require(_0x8e8e('0x7'));var path=require('path');var sox=require(_0x8e8e('0x8'));var csv=require(_0x8e8e('0x9'));var ejs=require(_0x8e8e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e8e('0xb'));var squel=require(_0x8e8e('0xc'));var crypto=require(_0x8e8e('0xd'));var jsforce=require(_0x8e8e('0xe'));var deskjs=require(_0x8e8e('0xf'));var toCsv=require(_0x8e8e('0x9'));var querystring=require(_0x8e8e('0x10'));var Papa=require('papaparse');var Redis=require(_0x8e8e('0x11'));var authService=require(_0x8e8e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8e8e('0x13'));var hardwareService=require(_0x8e8e('0x14'));var logger=require(_0x8e8e('0x15'))('api');var utils=require(_0x8e8e('0x16'));var config=require(_0x8e8e('0x17'));var licenseUtil=require(_0x8e8e('0x18'));var db=require(_0x8e8e('0x19'))['db'];function respondWithStatusCode(_0x786ece,_0x8a5b67){_0x8a5b67=_0x8a5b67||0xcc;return function(_0x55c406){if(_0x55c406){return _0x786ece[_0x8e8e('0x1a')](_0x8a5b67);}return _0x786ece[_0x8e8e('0x1b')](_0x8a5b67)[_0x8e8e('0x1c')]();};}function respondWithResult(_0x29deea,_0x3e79f2){_0x3e79f2=_0x3e79f2||0xc8;return function(_0x5c81e2){if(_0x5c81e2){return _0x29deea[_0x8e8e('0x1b')](_0x3e79f2)[_0x8e8e('0x1d')](_0x5c81e2);}};}function respondWithFilteredResult(_0x3f74f4,_0x499a24){return function(_0x42b73f){if(_0x42b73f){var _0x3af364=typeof _0x499a24[_0x8e8e('0x1e')]===_0x8e8e('0x1f')&&typeof _0x499a24[_0x8e8e('0x20')]===_0x8e8e('0x1f');var _0x45567e=_0x42b73f[_0x8e8e('0x21')];var _0x8577a9=_0x3af364?0x0:_0x499a24[_0x8e8e('0x1e')];var _0x2bf5d4=_0x3af364?_0x42b73f[_0x8e8e('0x21')]:_0x499a24['offset']+_0x499a24['limit'];var _0x1d57f6;if(_0x2bf5d4>=_0x45567e){_0x2bf5d4=_0x45567e;_0x1d57f6=0xc8;}else{_0x1d57f6=0xce;}_0x3f74f4[_0x8e8e('0x1b')](_0x1d57f6);return _0x3f74f4[_0x8e8e('0x22')](_0x8e8e('0x23'),_0x8577a9+'-'+_0x2bf5d4+'/'+_0x45567e)[_0x8e8e('0x1d')](_0x42b73f);}return null;};}function patchUpdates(_0x14d97d){return function(_0x5ddf86){try{jsonpatch[_0x8e8e('0x24')](_0x5ddf86,_0x14d97d,!![]);}catch(_0x2fba16){return BPromise[_0x8e8e('0x25')](_0x2fba16);}return _0x5ddf86[_0x8e8e('0x26')]();};}function saveUpdates(_0x48da1d,_0x5ea744){return function(_0x5d8d2f){if(_0x5d8d2f){return _0x5d8d2f[_0x8e8e('0x27')](_0x48da1d)['then'](function(_0x5412e3){return _0x5412e3;});}return null;};}function removeEntity(_0xd7362a,_0x339aaa){return function(_0x1458a5){if(_0x1458a5){return _0x1458a5[_0x8e8e('0x28')]()[_0x8e8e('0x29')](function(){_0xd7362a['status'](0xcc)[_0x8e8e('0x1c')]();});}};}function handleEntityNotFound(_0x2990b6,_0x4f274c){return function(_0x43d15e){if(!_0x43d15e){_0x2990b6[_0x8e8e('0x1a')](0x194);}return _0x43d15e;};}function handleError(_0x45d91d,_0x51cbc6){_0x51cbc6=_0x51cbc6||0x1f4;return function(_0x18e10b){logger[_0x8e8e('0x2a')](_0x18e10b[_0x8e8e('0x2b')]);if(_0x18e10b['name']){delete _0x18e10b[_0x8e8e('0x2c')];}_0x45d91d[_0x8e8e('0x1b')](_0x51cbc6)[_0x8e8e('0x2d')](_0x18e10b);};}exports['index']=function(_0xe424ca,_0x5be24b){var _0x1e4b3e={},_0x1b0ed8={},_0x2b5133={'count':0x0,'rows':[]};var _0xa791be=_[_0x8e8e('0x2e')](db[_0x8e8e('0x2f')]['rawAttributes'],function(_0x52e72){return{'name':_0x52e72[_0x8e8e('0x30')],'type':_0x52e72[_0x8e8e('0x31')]['key']};});_0x1b0ed8[_0x8e8e('0x32')]=_[_0x8e8e('0x2e')](_0xa791be,_0x8e8e('0x2c'));_0x1b0ed8[_0x8e8e('0x33')]=_['keys'](_0xe424ca['query']);_0x1b0ed8[_0x8e8e('0x34')]=_[_0x8e8e('0x35')](_0x1b0ed8['model'],_0x1b0ed8[_0x8e8e('0x33')]);_0x1b0ed8[_0x8e8e('0x34')]=_['concat'](_0x1b0ed8[_0x8e8e('0x34')],['$and',_0x8e8e('0x36'),_0x8e8e('0x37'),_0x8e8e('0x38'),_0x8e8e('0x39'),_0x8e8e('0x3a'),_0x8e8e('0x3b'),_0x8e8e('0x3c'),_0x8e8e('0x3d'),_0x8e8e('0x3e'),_0x8e8e('0x3f'),_0x8e8e('0x40'),_0x8e8e('0x41'),_0x8e8e('0x42'),_0x8e8e('0x43'),_0x8e8e('0x44'),_0x8e8e('0x45'),_0x8e8e('0x42'),_0x8e8e('0x46'),_0x8e8e('0x47'),'$contained',_0x8e8e('0x48')]);_0x1e4b3e[_0x8e8e('0x49')]=_[_0x8e8e('0x35')](_0x1b0ed8['model'],qs[_0x8e8e('0x4a')](_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x4a')]));_0x1e4b3e[_0x8e8e('0x49')]=_0x1e4b3e[_0x8e8e('0x49')][_0x8e8e('0x4b')]?_0x1e4b3e['attributes']:_0x1b0ed8[_0x8e8e('0x32')];if(!_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x4c')](_0x8e8e('0x4d'))){_0x1e4b3e[_0x8e8e('0x20')]=qs[_0x8e8e('0x20')](_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x20')]);_0x1e4b3e[_0x8e8e('0x1e')]=qs[_0x8e8e('0x1e')](_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x1e')]);}_0x1e4b3e[_0x8e8e('0x4e')]=qs[_0x8e8e('0x4f')](_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x4f')]);_0x1e4b3e[_0x8e8e('0x50')]=qs[_0x8e8e('0x34')](_[_0x8e8e('0x51')](_0xe424ca[_0x8e8e('0x33')],_0x1b0ed8[_0x8e8e('0x34')]),_0xa791be);if(_0xe424ca['query']['filter']){_0x1e4b3e[_0x8e8e('0x50')]=_['merge'](_0x1e4b3e[_0x8e8e('0x50')],{'$or':_[_0x8e8e('0x2e')](_0xa791be,function(_0x2d13f7){if(_0x2d13f7[_0x8e8e('0x31')]!==_0x8e8e('0x52')){var _0x29b270={};_0x29b270[_0x2d13f7[_0x8e8e('0x2c')]]={'$like':'%'+_0xe424ca[_0x8e8e('0x33')][_0x8e8e('0x53')]+'%'};return _0x29b270;}})});}_0x1e4b3e=_[_0x8e8e('0x54')]({},_0x1e4b3e,_0xe424ca['options']);var _0x5e8739={'where':_0x1e4b3e[_0x8e8e('0x50')]};return db[_0x8e8e('0x2f')][_0x8e8e('0x21')](_0x5e8739)[_0x8e8e('0x29')](function(_0xc1a249){_0x2b5133['count']=_0xc1a249;if(_0xe424ca[_0x8e8e('0x33')]['includeAll']){_0x1e4b3e[_0x8e8e('0x55')]=[{'all':!![]}];}return db[_0x8e8e('0x2f')][_0x8e8e('0x56')](_0x1e4b3e);})[_0x8e8e('0x29')](function(_0x45eda1){_0x2b5133[_0x8e8e('0x57')]=_0x45eda1;return _0x2b5133;})['then'](respondWithFilteredResult(_0x5be24b,_0x1e4b3e))[_0x8e8e('0x58')](handleError(_0x5be24b,null));};exports[_0x8e8e('0x59')]=function(_0x2b72a9,_0x5505fb){var _0x2a0417={'raw':!![],'where':{'id':_0x2b72a9[_0x8e8e('0x5a')]['id']}},_0x217531={};_0x217531['model']=_[_0x8e8e('0x5b')](db['CmHopper'][_0x8e8e('0x5c')]);_0x217531['query']=_['keys'](_0x2b72a9[_0x8e8e('0x33')]);_0x217531[_0x8e8e('0x34')]=_[_0x8e8e('0x35')](_0x217531[_0x8e8e('0x32')],_0x217531[_0x8e8e('0x33')]);_0x2a0417['attributes']=_[_0x8e8e('0x35')](_0x217531[_0x8e8e('0x32')],qs['fields'](_0x2b72a9['query']['fields']));_0x2a0417[_0x8e8e('0x49')]=_0x2a0417['attributes'][_0x8e8e('0x4b')]?_0x2a0417[_0x8e8e('0x49')]:_0x217531[_0x8e8e('0x32')];if(_0x2b72a9['query']['includeAll']){_0x2a0417[_0x8e8e('0x55')]=[{'all':!![]}];}_0x2a0417=_[_0x8e8e('0x54')]({},_0x2a0417,_0x2b72a9[_0x8e8e('0x5d')]);return db[_0x8e8e('0x2f')][_0x8e8e('0x5e')](_0x2a0417)[_0x8e8e('0x29')](handleEntityNotFound(_0x5505fb,null))[_0x8e8e('0x29')](respondWithResult(_0x5505fb,null))[_0x8e8e('0x58')](handleError(_0x5505fb,null));};exports[_0x8e8e('0x5f')]=function(_0x10e75a,_0x9935dc){return db[_0x8e8e('0x2f')][_0x8e8e('0x5f')](_0x10e75a[_0x8e8e('0x60')],{})[_0x8e8e('0x29')](respondWithResult(_0x9935dc,0xc9))['catch'](handleError(_0x9935dc,null));};exports[_0x8e8e('0x27')]=function(_0x4391bb,_0x586e29){if(_0x4391bb[_0x8e8e('0x60')]['id']){delete _0x4391bb['body']['id'];}return db[_0x8e8e('0x2f')][_0x8e8e('0x5e')]({'where':{'id':_0x4391bb['params']['id']}})[_0x8e8e('0x29')](handleEntityNotFound(_0x586e29,null))[_0x8e8e('0x29')](saveUpdates(_0x4391bb[_0x8e8e('0x60')],null))['then'](respondWithResult(_0x586e29,null))[_0x8e8e('0x58')](handleError(_0x586e29,null));};exports[_0x8e8e('0x61')]=function(_0x86e55c,_0x1e691c){return db[_0x8e8e('0x2f')][_0x8e8e('0x61')]()[_0x8e8e('0x29')](respondWithResult(_0x1e691c,null))[_0x8e8e('0x58')](handleError(_0x1e691c,null));};exports[_0x8e8e('0x28')]=function(_0x4913c8,_0x57fd8d){var _0x319b95;return db['CmHopper']['find']({'where':{'id':_0x4913c8[_0x8e8e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x57fd8d,null))[_0x8e8e('0x29')](function(_0x319768){if(_0x319768){return _0x319768[_0x8e8e('0x28')]()[_0x8e8e('0x29')](function(_0x1aa760){return _0x1aa760;});}})['then'](function(_0x1c0cbc){_0x319b95=_0x1c0cbc;if(_0x1c0cbc){if(_0x1c0cbc[_0x8e8e('0x62')]||_0x1c0cbc[_0x8e8e('0x63')]){return db[_0x1c0cbc[_0x8e8e('0x62')]?_0x8e8e('0x64'):_0x8e8e('0x65')][_0x8e8e('0x5e')]({'where':{'id':_0x1c0cbc[_0x8e8e('0x62')]?_0x1c0cbc['VoiceQueueId']:_0x1c0cbc[_0x8e8e('0x63')]},'attributes':['id',_0x8e8e('0x2c')],'raw':!![]});}}})[_0x8e8e('0x29')](function(_0x4e9ce3){var _0x16c92a={};if(_0x4e9ce3){_[_0x8e8e('0x54')](_0x16c92a,_[_0x8e8e('0x66')](_0x319b95['dataValues'],['createdAt','updatedAt','id']));_0x16c92a[_0x8e8e('0x67')]=0x15;_0x16c92a['statedesc']=_0x8e8e('0x68');_0x16c92a[_0x8e8e('0x69')]=_0x4e9ce3[_0x8e8e('0x2c')];_0x16c92a['membername']=_0x4913c8[_0x8e8e('0x6a')][_0x8e8e('0x2c')];_0x16c92a[_0x8e8e('0x6b')]=_0x4913c8['user']['id'];_0x16c92a['deleted']=!![];_0x16c92a[_0x8e8e('0x6c')]=moment()['format'](_0x8e8e('0x6d'));_0x16c92a[_0x8e8e('0x6e')]=_0x319b95['phone'];_0x16c92a[_0x8e8e('0x6f')]=_0x319b95[_0x8e8e('0x62')]?_0x8e8e('0x70'):_0x8e8e('0x71');return db['CmContact']['find']({'where':{'id':_0x16c92a[_0x8e8e('0x72')]},'attributes':[_0x8e8e('0x73'),_0x8e8e('0x74')]})[_0x8e8e('0x29')](function(_0x73f375){if(!_[_0x8e8e('0x75')](_0x57fd8d)&&!_[_0x8e8e('0x75')](_0x73f375[_0x8e8e('0x73')])){_0x16c92a[_0x8e8e('0x76')]=_0x73f375[_0x8e8e('0x73')];if(!_[_0x8e8e('0x75')](_0x73f375[_0x8e8e('0x74')])){_0x16c92a[_0x8e8e('0x76')]+='\x20'+_0x73f375[_0x8e8e('0x74')];}}})[_0x8e8e('0x77')](function(){return db[_0x8e8e('0x78')][_0x8e8e('0x5f')](_0x16c92a);});}})[_0x8e8e('0x29')](function(){return _0x57fd8d['status'](0xcc)['end']();})['catch'](handleError(_0x57fd8d,null));};exports['getPreview']=function(_0x402b76,_0x5c12ae,_0x25afbe){var _0x121da0=[];return db[_0x8e8e('0x79')][_0x8e8e('0x61')]()[_0x8e8e('0x29')](function(_0x214b17){_0x121da0=_[_0x8e8e('0x5b')](_0x214b17);return _0x402b76[_0x8e8e('0x6a')][_0x8e8e('0x7a')]({'where':{'type':_0x8e8e('0x7b'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x8e8e('0x29')](function(_0x4e791){if(_0x4e791&&_0x4e791[_0x8e8e('0x4b')]){return db[_0x8e8e('0x7c')]['transaction'](function(_0x4ffb8e){var _0x377a29={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8e8e('0x7d')](_0x8e8e('0x6d'))},'VoiceQueueId':{'$in':_['map'](_0x4e791,'id')},'$or':[{'UserId':null},{'UserId':_0x402b76[_0x8e8e('0x6a')]['id']}]};var _0x21624c=[];if(_0x402b76[_0x8e8e('0x60')][_0x8e8e('0x7e')]&&_0x402b76['body'][_0x8e8e('0x7e')]===_0x8e8e('0x7f')){if(!_[_0x8e8e('0x80')](_0x402b76['body'][_0x8e8e('0x81')])){_0x377a29['id']={'$in':_0x402b76['body'][_0x8e8e('0x81')]};}_0x21624c=[[_0x8e8e('0x82'),'ASC'],[_0x8e8e('0x83'),_0x4e791[0x0][_0x8e8e('0x84')]===_0x8e8e('0x85')?_0x8e8e('0x86'):_0x8e8e('0x85')],db[_0x8e8e('0x7c')][_0x8e8e('0x87')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x8e8e('0x86')]];}else{if(!_['isEmpty'](_0x402b76[_0x8e8e('0x60')][_0x8e8e('0x81')])){_0x377a29['id']={'$notIn':_0x402b76['body']['hopperIds']};}_0x21624c=[[_0x8e8e('0x82'),_0x8e8e('0x86')],[_0x8e8e('0x83'),_0x4e791[0x0][_0x8e8e('0x84')]],db[_0x8e8e('0x7c')][_0x8e8e('0x87')](_0x8e8e('0x88')),['id',_0x8e8e('0x85')]];}return db[_0x8e8e('0x2f')]['findOne']({'attributes':['id',_0x8e8e('0x89')],'where':_0x377a29,'order':_0x21624c,'transaction':_0x4ffb8e,'lock':_0x4ffb8e[_0x8e8e('0x8a')][_0x8e8e('0x8b')],'include':[{'model':db[_0x8e8e('0x79')],'as':'Contact','attributes':_0x121da0,'include':[{'model':db[_0x8e8e('0x8c')],'as':_0x8e8e('0x8d'),'attributes':['id',_0x8e8e('0x2c')]}]},{'model':db['CmList'],'as':_0x8e8e('0x8e'),'attributes':['id',_0x8e8e('0x2c')]},{'model':db[_0x8e8e('0x64')],'as':_0x8e8e('0x8f'),'attributes':['id',_0x8e8e('0x2c'),_0x8e8e('0x90')]}]})[_0x8e8e('0x29')](function(_0x102540){if(_0x102540){return _0x102540[_0x8e8e('0x27')]({'UserId':_0x402b76[_0x8e8e('0x6a')]['id']},{'transaction':_0x4ffb8e});}});});}})['then'](handleEntityNotFound(_0x5c12ae,null))['then'](respondWithResult(_0x5c12ae,null))[_0x8e8e('0x58')](handleError(_0x5c12ae,null));};exports[_0x8e8e('0x91')]=function(_0x58bb56,_0x1305f7,_0x46f19d){return _0x58bb56['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8e8e('0x92')},'attributes':['id'],'raw':!![]})[_0x8e8e('0x29')](function(_0x4e3cac){if(_0x4e3cac&&_0x4e3cac[_0x8e8e('0x4b')]){return db[_0x8e8e('0x2f')][_0x8e8e('0x21')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8e8e('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4e3cac,'id')},'$or':[{'UserId':null},{'UserId':_0x58bb56[_0x8e8e('0x6a')]['id']}]}});}return 0x0;})[_0x8e8e('0x29')](function(_0x1c2c51){if(!_[_0x8e8e('0x75')](_0x1c2c51)&&_[_0x8e8e('0x93')](_0x1c2c51)){return _0x1305f7['status'](0xc8)[_0x8e8e('0x1d')]({'contacts':_0x1c2c51});}else{logger[_0x8e8e('0x2a')](_0x8e8e('0x94'),_0x8e8e('0x91'),0x194,_0x8e8e('0x95'));_0x1305f7[_0x8e8e('0x1a')](0x194);}})[_0x8e8e('0x58')](handleError(_0x1305f7,null));}; \ No newline at end of file +var _0x5cd5=['preview','isNumber','getOpenContacts','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','concat','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$iLike','$notILike','$contained','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','findAll','catch','params','length','include','options','find','create','body','update','VoiceQueueId','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','describe','getVoiceQueues','dialOrderByScheduledAt','direction','prev','hopperIds','ASC','scheduledAt','DESC','literal','isEmpty','priority','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','Company','CmList','List','dialActive','outbound'];(function(_0x5be83f,_0x339226){var _0x24cfc2=function(_0x1483a9){while(--_0x1483a9){_0x5be83f['push'](_0x5be83f['shift']());}};_0x24cfc2(++_0x339226);}(_0x5cd5,0x129));var _0x55cd=function(_0x5a4f4d,_0x18cb11){_0x5a4f4d=_0x5a4f4d-0x0;var _0x559088=_0x5cd5[_0x5a4f4d];return _0x559088;};'use strict';var emlformat=require(_0x55cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55cd('0x1'));var jsonpatch=require(_0x55cd('0x2'));var rp=require(_0x55cd('0x3'));var moment=require(_0x55cd('0x4'));var BPromise=require(_0x55cd('0x5'));var Mustache=require('mustache');var util=require(_0x55cd('0x6'));var path=require(_0x55cd('0x7'));var sox=require(_0x55cd('0x8'));var csv=require(_0x55cd('0x9'));var ejs=require(_0x55cd('0xa'));var fs=require('fs');var fs_extra=require(_0x55cd('0xb'));var _=require(_0x55cd('0xc'));var squel=require(_0x55cd('0xd'));var crypto=require(_0x55cd('0xe'));var jsforce=require(_0x55cd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x55cd('0x10'));var Papa=require(_0x55cd('0x11'));var Redis=require(_0x55cd('0x12'));var authService=require(_0x55cd('0x13'));var qs=require(_0x55cd('0x14'));var as=require(_0x55cd('0x15'));var hardwareService=require(_0x55cd('0x16'));var logger=require(_0x55cd('0x17'))(_0x55cd('0x18'));var utils=require(_0x55cd('0x19'));var config=require(_0x55cd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d1e8c,_0x3023bc){_0x3023bc=_0x3023bc||0xcc;return function(_0x4db588){if(_0x4db588){return _0x1d1e8c[_0x55cd('0x1b')](_0x3023bc);}return _0x1d1e8c[_0x55cd('0x1c')](_0x3023bc)[_0x55cd('0x1d')]();};}function respondWithResult(_0x335d64,_0x10e333){_0x10e333=_0x10e333||0xc8;return function(_0x2432f0){if(_0x2432f0){return _0x335d64[_0x55cd('0x1c')](_0x10e333)[_0x55cd('0x1e')](_0x2432f0);}};}function respondWithFilteredResult(_0x21f2f5,_0x4ce845){return function(_0x11913b){if(_0x11913b){var _0x152542=typeof _0x4ce845[_0x55cd('0x1f')]==='undefined'&&typeof _0x4ce845[_0x55cd('0x20')]===_0x55cd('0x21');var _0x3dd124=_0x11913b[_0x55cd('0x22')];var _0x4e26c2=_0x152542?0x0:_0x4ce845[_0x55cd('0x1f')];var _0x4afcdb=_0x152542?_0x11913b[_0x55cd('0x22')]:_0x4ce845['offset']+_0x4ce845[_0x55cd('0x20')];var _0x18eaf2;if(_0x4afcdb>=_0x3dd124){_0x4afcdb=_0x3dd124;_0x18eaf2=0xc8;}else{_0x18eaf2=0xce;}_0x21f2f5[_0x55cd('0x1c')](_0x18eaf2);return _0x21f2f5[_0x55cd('0x23')](_0x55cd('0x24'),_0x4e26c2+'-'+_0x4afcdb+'/'+_0x3dd124)[_0x55cd('0x1e')](_0x11913b);}return null;};}function patchUpdates(_0x3804cf){return function(_0x31634a){try{jsonpatch[_0x55cd('0x25')](_0x31634a,_0x3804cf,!![]);}catch(_0x39a57d){return BPromise[_0x55cd('0x26')](_0x39a57d);}return _0x31634a[_0x55cd('0x27')]();};}function saveUpdates(_0x1bda9e,_0x5f4855){return function(_0x21c556){if(_0x21c556){return _0x21c556['update'](_0x1bda9e)[_0x55cd('0x28')](function(_0x4778b1){return _0x4778b1;});}return null;};}function removeEntity(_0x4fbb74,_0x4a30bb){return function(_0x1e11e9){if(_0x1e11e9){return _0x1e11e9[_0x55cd('0x29')]()['then'](function(){_0x4fbb74[_0x55cd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbde411,_0x5f5c89){return function(_0x51de36){if(!_0x51de36){_0xbde411[_0x55cd('0x1b')](0x194);}return _0x51de36;};}function handleError(_0x14aaaa,_0x554109){_0x554109=_0x554109||0x1f4;return function(_0x38c476){logger[_0x55cd('0x2a')](_0x38c476[_0x55cd('0x2b')]);if(_0x38c476['name']){delete _0x38c476[_0x55cd('0x2c')];}_0x14aaaa[_0x55cd('0x1c')](_0x554109)[_0x55cd('0x2d')](_0x38c476);};}exports[_0x55cd('0x2e')]=function(_0x4a56af,_0x58a4ae){var _0xe2c41e={},_0x40a7d5={},_0x2f17d9={'count':0x0,'rows':[]};var _0x1b91cc=_[_0x55cd('0x2f')](db[_0x55cd('0x30')][_0x55cd('0x31')],function(_0x507c0e){return{'name':_0x507c0e[_0x55cd('0x32')],'type':_0x507c0e[_0x55cd('0x33')][_0x55cd('0x34')]};});_0x40a7d5[_0x55cd('0x35')]=_[_0x55cd('0x2f')](_0x1b91cc,_0x55cd('0x2c'));_0x40a7d5[_0x55cd('0x36')]=_[_0x55cd('0x37')](_0x4a56af[_0x55cd('0x36')]);_0x40a7d5['filters']=_[_0x55cd('0x38')](_0x40a7d5[_0x55cd('0x35')],_0x40a7d5['query']);_0x40a7d5[_0x55cd('0x39')]=_[_0x55cd('0x3a')](_0x40a7d5[_0x55cd('0x39')],['$and',_0x55cd('0x3b'),_0x55cd('0x3c'),_0x55cd('0x3d'),'$lt',_0x55cd('0x3e'),_0x55cd('0x3f'),_0x55cd('0x40'),_0x55cd('0x41'),_0x55cd('0x42'),_0x55cd('0x43'),_0x55cd('0x44'),'$notIn',_0x55cd('0x45'),'$notLike',_0x55cd('0x46'),_0x55cd('0x47'),'$like','$overlap','$contains',_0x55cd('0x48'),'$any']);_0xe2c41e['attributes']=_['intersection'](_0x40a7d5[_0x55cd('0x35')],qs['fields'](_0x4a56af['query'][_0x55cd('0x49')]));_0xe2c41e[_0x55cd('0x4a')]=_0xe2c41e[_0x55cd('0x4a')]['length']?_0xe2c41e['attributes']:_0x40a7d5['model'];if(!_0x4a56af[_0x55cd('0x36')][_0x55cd('0x4b')](_0x55cd('0x4c'))){_0xe2c41e[_0x55cd('0x20')]=qs[_0x55cd('0x20')](_0x4a56af[_0x55cd('0x36')][_0x55cd('0x20')]);_0xe2c41e[_0x55cd('0x1f')]=qs[_0x55cd('0x1f')](_0x4a56af[_0x55cd('0x36')][_0x55cd('0x1f')]);}_0xe2c41e[_0x55cd('0x4d')]=qs['sort'](_0x4a56af[_0x55cd('0x36')][_0x55cd('0x4e')]);_0xe2c41e[_0x55cd('0x4f')]=qs['filters'](_[_0x55cd('0x50')](_0x4a56af[_0x55cd('0x36')],_0x40a7d5[_0x55cd('0x39')]),_0x1b91cc);if(_0x4a56af[_0x55cd('0x36')]['filter']){_0xe2c41e[_0x55cd('0x4f')]=_['merge'](_0xe2c41e['where'],{'$or':_[_0x55cd('0x2f')](_0x1b91cc,function(_0x430d6d){if(_0x430d6d[_0x55cd('0x33')]!=='VIRTUAL'){var _0x36ef3a={};_0x36ef3a[_0x430d6d[_0x55cd('0x2c')]]={'$like':'%'+_0x4a56af[_0x55cd('0x36')][_0x55cd('0x51')]+'%'};return _0x36ef3a;}})});}_0xe2c41e=_[_0x55cd('0x52')]({},_0xe2c41e,_0x4a56af['options']);var _0x1f1062={'where':_0xe2c41e[_0x55cd('0x4f')]};return db[_0x55cd('0x30')]['count'](_0x1f1062)[_0x55cd('0x28')](function(_0xad2647){_0x2f17d9['count']=_0xad2647;if(_0x4a56af['query'][_0x55cd('0x53')]){_0xe2c41e['include']=[{'all':!![]}];}return db[_0x55cd('0x30')][_0x55cd('0x54')](_0xe2c41e);})[_0x55cd('0x28')](function(_0x3c5723){_0x2f17d9['rows']=_0x3c5723;return _0x2f17d9;})['then'](respondWithFilteredResult(_0x58a4ae,_0xe2c41e))[_0x55cd('0x55')](handleError(_0x58a4ae,null));};exports['show']=function(_0x3c884f,_0x5bdbc6){var _0x437e44={'raw':!![],'where':{'id':_0x3c884f[_0x55cd('0x56')]['id']}},_0x1c3b24={};_0x1c3b24[_0x55cd('0x35')]=_[_0x55cd('0x37')](db[_0x55cd('0x30')][_0x55cd('0x31')]);_0x1c3b24[_0x55cd('0x36')]=_[_0x55cd('0x37')](_0x3c884f[_0x55cd('0x36')]);_0x1c3b24[_0x55cd('0x39')]=_['intersection'](_0x1c3b24[_0x55cd('0x35')],_0x1c3b24[_0x55cd('0x36')]);_0x437e44[_0x55cd('0x4a')]=_[_0x55cd('0x38')](_0x1c3b24[_0x55cd('0x35')],qs['fields'](_0x3c884f['query'][_0x55cd('0x49')]));_0x437e44[_0x55cd('0x4a')]=_0x437e44[_0x55cd('0x4a')][_0x55cd('0x57')]?_0x437e44[_0x55cd('0x4a')]:_0x1c3b24['model'];if(_0x3c884f['query'][_0x55cd('0x53')]){_0x437e44[_0x55cd('0x58')]=[{'all':!![]}];}_0x437e44=_[_0x55cd('0x52')]({},_0x437e44,_0x3c884f[_0x55cd('0x59')]);return db['CmHopper'][_0x55cd('0x5a')](_0x437e44)['then'](handleEntityNotFound(_0x5bdbc6,null))[_0x55cd('0x28')](respondWithResult(_0x5bdbc6,null))[_0x55cd('0x55')](handleError(_0x5bdbc6,null));};exports[_0x55cd('0x5b')]=function(_0x431562,_0x29c992){return db[_0x55cd('0x30')]['create'](_0x431562[_0x55cd('0x5c')],{})[_0x55cd('0x28')](respondWithResult(_0x29c992,0xc9))[_0x55cd('0x55')](handleError(_0x29c992,null));};exports[_0x55cd('0x5d')]=function(_0x3518ba,_0x400e8e){if(_0x3518ba[_0x55cd('0x5c')]['id']){delete _0x3518ba[_0x55cd('0x5c')]['id'];}return db[_0x55cd('0x30')][_0x55cd('0x5a')]({'where':{'id':_0x3518ba[_0x55cd('0x56')]['id']}})['then'](handleEntityNotFound(_0x400e8e,null))['then'](saveUpdates(_0x3518ba[_0x55cd('0x5c')],null))[_0x55cd('0x28')](respondWithResult(_0x400e8e,null))[_0x55cd('0x55')](handleError(_0x400e8e,null));};exports['describe']=function(_0x5d070a,_0x29a448){return db['CmHopper']['describe']()[_0x55cd('0x28')](respondWithResult(_0x29a448,null))[_0x55cd('0x55')](handleError(_0x29a448,null));};exports[_0x55cd('0x29')]=function(_0x54cffa,_0x41bfb7){var _0x3de0fe;return db['CmHopper'][_0x55cd('0x5a')]({'where':{'id':_0x54cffa[_0x55cd('0x56')]['id']}})[_0x55cd('0x28')](handleEntityNotFound(_0x41bfb7,null))['then'](function(_0x148df6){if(_0x148df6){return _0x148df6[_0x55cd('0x29')]()[_0x55cd('0x28')](function(_0x22d83e){return _0x22d83e;});}})['then'](function(_0x197cc4){_0x3de0fe=_0x197cc4;if(_0x197cc4){if(_0x197cc4[_0x55cd('0x5e')]||_0x197cc4[_0x55cd('0x5f')]){return db[_0x197cc4[_0x55cd('0x5e')]?'VoiceQueue':'Campaign'][_0x55cd('0x5a')]({'where':{'id':_0x197cc4[_0x55cd('0x5e')]?_0x197cc4['VoiceQueueId']:_0x197cc4[_0x55cd('0x5f')]},'attributes':['id',_0x55cd('0x2c')],'raw':!![]});}}})[_0x55cd('0x28')](function(_0x19ac89){var _0x42f53d={};if(_0x19ac89){_['merge'](_0x42f53d,_[_0x55cd('0x60')](_0x3de0fe[_0x55cd('0x61')],[_0x55cd('0x62'),_0x55cd('0x63'),'id']));_0x42f53d[_0x55cd('0x64')]=0x15;_0x42f53d[_0x55cd('0x65')]=_0x55cd('0x66');_0x42f53d[_0x55cd('0x67')]=_0x19ac89[_0x55cd('0x2c')];_0x42f53d['membername']=_0x54cffa[_0x55cd('0x68')][_0x55cd('0x2c')];_0x42f53d[_0x55cd('0x69')]=_0x54cffa[_0x55cd('0x68')]['id'];_0x42f53d[_0x55cd('0x66')]=!![];_0x42f53d[_0x55cd('0x6a')]=moment()[_0x55cd('0x6b')](_0x55cd('0x6c'));_0x42f53d[_0x55cd('0x6d')]=_0x3de0fe['phone'];_0x42f53d[_0x55cd('0x6e')]=_0x3de0fe[_0x55cd('0x5e')]?_0x55cd('0x6f'):'ivr';return db[_0x55cd('0x70')][_0x55cd('0x5a')]({'where':{'id':_0x42f53d[_0x55cd('0x71')]},'attributes':[_0x55cd('0x72'),_0x55cd('0x73')]})[_0x55cd('0x28')](function(_0x22fadf){if(!_[_0x55cd('0x74')](_0x41bfb7)&&!_[_0x55cd('0x74')](_0x22fadf[_0x55cd('0x72')])){_0x42f53d[_0x55cd('0x75')]=_0x22fadf[_0x55cd('0x72')];if(!_[_0x55cd('0x74')](_0x22fadf[_0x55cd('0x73')])){_0x42f53d['calleridname']+='\x20'+_0x22fadf[_0x55cd('0x73')];}}})[_0x55cd('0x76')](function(){return db[_0x55cd('0x77')][_0x55cd('0x5b')](_0x42f53d);});}})[_0x55cd('0x28')](function(){return _0x41bfb7['status'](0xcc)['end']();})[_0x55cd('0x55')](handleError(_0x41bfb7,null));};exports[_0x55cd('0x78')]=function(_0x2149fb,_0x416329,_0xcff2f0){var _0x25d5e8=[];return db[_0x55cd('0x70')][_0x55cd('0x79')]()[_0x55cd('0x28')](function(_0x545e4e){_0x25d5e8=_[_0x55cd('0x37')](_0x545e4e);return _0x2149fb['user'][_0x55cd('0x7a')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x55cd('0x7b')],'raw':!![]});})[_0x55cd('0x28')](function(_0x1600d1){if(_0x1600d1&&_0x1600d1[_0x55cd('0x57')]){return db['sequelize']['transaction'](function(_0x11973a){var _0x4f132c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x55cd('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x1600d1,'id')},'$or':[{'UserId':null},{'UserId':_0x2149fb[_0x55cd('0x68')]['id']}]};var _0x251fa0=[];if(_0x2149fb[_0x55cd('0x5c')][_0x55cd('0x7c')]&&_0x2149fb[_0x55cd('0x5c')][_0x55cd('0x7c')]===_0x55cd('0x7d')){if(!_['isEmpty'](_0x2149fb['body'][_0x55cd('0x7e')])){_0x4f132c['id']={'$in':_0x2149fb['body'][_0x55cd('0x7e')]};}_0x251fa0=[['priority',_0x55cd('0x7f')],[_0x55cd('0x80'),_0x1600d1[0x0][_0x55cd('0x7b')]===_0x55cd('0x7f')?_0x55cd('0x81'):_0x55cd('0x7f')],db['sequelize'][_0x55cd('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x55cd('0x81')]];}else{if(!_[_0x55cd('0x83')](_0x2149fb[_0x55cd('0x5c')]['hopperIds'])){_0x4f132c['id']={'$notIn':_0x2149fb[_0x55cd('0x5c')][_0x55cd('0x7e')]};}_0x251fa0=[[_0x55cd('0x84'),_0x55cd('0x81')],['scheduledAt',_0x1600d1[0x0][_0x55cd('0x7b')]],db[_0x55cd('0x85')][_0x55cd('0x82')](_0x55cd('0x86')),['id',_0x55cd('0x7f')]];}return db[_0x55cd('0x30')][_0x55cd('0x87')]({'attributes':['id','scheduledat'],'where':_0x4f132c,'order':_0x251fa0,'transaction':_0x11973a,'lock':_0x11973a[_0x55cd('0x88')][_0x55cd('0x89')],'include':[{'model':db[_0x55cd('0x70')],'as':_0x55cd('0x8a'),'attributes':_0x25d5e8,'include':[{'model':db['CmCompany'],'as':_0x55cd('0x8b'),'attributes':['id',_0x55cd('0x2c')]}]},{'model':db[_0x55cd('0x8c')],'as':_0x55cd('0x8d'),'attributes':['id',_0x55cd('0x2c')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x55cd('0x2c'),_0x55cd('0x8e')]}]})[_0x55cd('0x28')](function(_0x1f3ed0){if(_0x1f3ed0){return _0x1f3ed0['update']({'UserId':_0x2149fb[_0x55cd('0x68')]['id']},{'transaction':_0x11973a});}});});}})[_0x55cd('0x28')](handleEntityNotFound(_0x416329,null))[_0x55cd('0x28')](respondWithResult(_0x416329,null))['catch'](handleError(_0x416329,null));};exports['getOpenContacts']=function(_0x40a723,_0x6c06dd,_0x114059){return _0x40a723[_0x55cd('0x68')]['getVoiceQueues']({'where':{'type':_0x55cd('0x8f'),'dialActive':!![],'dialMethod':_0x55cd('0x90')},'attributes':['id'],'raw':!![]})['then'](function(_0x5e6e44){if(_0x5e6e44&&_0x5e6e44[_0x55cd('0x57')]){return db[_0x55cd('0x30')][_0x55cd('0x22')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x55cd('0x6b')](_0x55cd('0x6c'))},'VoiceQueueId':{'$in':_[_0x55cd('0x2f')](_0x5e6e44,'id')},'$or':[{'UserId':null},{'UserId':_0x40a723['user']['id']}]}});}return 0x0;})['then'](function(_0xa9a031){if(!_['isNil'](_0xa9a031)&&_[_0x55cd('0x91')](_0xa9a031)){return _0x6c06dd[_0x55cd('0x1c')](0xc8)[_0x55cd('0x1e')]({'contacts':_0xa9a031});}else{logger[_0x55cd('0x2a')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x55cd('0x92'),0x194,'entity\x20not\x20found');_0x6c06dd['sendStatus'](0x194);}})[_0x55cd('0x55')](handleError(_0x6c06dd,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index db404ed..0c07a0c 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x408aeb,_0x37a4f7){var _0x4ae4d0=function(_0x580795){while(--_0x580795){_0x408aeb['push'](_0x408aeb['shift']());}};_0x4ae4d0(++_0x37a4f7);}(_0x1883,0xab));var _0x3188=function(_0xbad250,_0x409b3){_0xbad250=_0xbad250-0x0;var _0x4fea7c=_0x1883[_0xbad250];return _0x4fea7c;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3188('0xf')]},{'name':_0x3188('0x10'),'fields':['phone']},{'name':_0x3188('0x11'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['moment','bluebird','path','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x53ec,0x192));var _0xc53e=function(_0xf0e391,_0x5433d4){_0xf0e391=_0xf0e391-0x0;var _0x1c126d=_0x53ec[_0xf0e391];return _0x1c126d;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]},{'name':_0xc53e('0xc'),'fields':[_0xc53e('0xc')]},{'name':_0xc53e('0xd'),'fields':[_0xc53e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 8612206..ff70907 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 _0x75e3=['update','where','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','MoveContactManagedDialer','CmHopperFinal','findAll','literal','`scheduledat`\x20>=\x20','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','all','GetCmHopperPreview','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetCmHopper','CmHopper','options','attributes','limit','include','map','model','then','catch','ShowCmHopper','find','raw','CreateCmHopper','create','body','UpdateCmHopper'];(function(_0x234bb5,_0x4bdbd6){var _0x3a93f9=function(_0x26bb35){while(--_0x26bb35){_0x234bb5['push'](_0x234bb5['shift']());}};_0x3a93f9(++_0x4bdbd6);}(_0x75e3,0x1a6));var _0x375e=function(_0x2646d2,_0x3d5664){_0x2646d2=_0x2646d2-0x0;var _0x4aa00e=_0x75e3[_0x2646d2];return _0x4aa00e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x375e('0x0'));var db=require(_0x375e('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x375e('0x2'))(_0x375e('0x3'));var config=require(_0x375e('0x4'));var jayson=require(_0x375e('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb51795,_0xb86ab8,_0x135dd2){return new BPromise(function(_0x25dc26,_0x4897a6){return client[_0x375e('0x6')](_0xb51795,_0x135dd2)['then'](function(_0x368952){logger[_0x375e('0x7')](_0x375e('0x8'),_0xb86ab8,_0x375e('0x9'));logger[_0x375e('0xa')](_0x375e('0xb'),_0xb86ab8,_0x375e('0x9'),JSON[_0x375e('0xc')](_0x368952));if(_0x368952['error']){if(_0x368952[_0x375e('0xd')][_0x375e('0xe')]===0x1f4){logger[_0x375e('0xd')](_0x375e('0x8'),_0xb86ab8,_0x368952['error'][_0x375e('0xf')]);return _0x4897a6(_0x368952[_0x375e('0xd')]['message']);}logger[_0x375e('0xd')](_0x375e('0x8'),_0xb86ab8,_0x368952[_0x375e('0xd')]['message']);return _0x25dc26(_0x368952[_0x375e('0xd')][_0x375e('0xf')]);}else{logger['info'](_0x375e('0x8'),_0xb86ab8,_0x375e('0x9'));_0x25dc26(_0x368952['result'][_0x375e('0xf')]);}})['catch'](function(_0x4e4aca){logger[_0x375e('0xd')](_0x375e('0x8'),_0xb86ab8,_0x4e4aca);_0x4897a6(_0x4e4aca);});});}exports[_0x375e('0x10')]=function(_0x106e24){var _0x1d5312=this;return new Promise(function(_0x2afab3,_0x5e9c78){return db[_0x375e('0x11')]['findAll']({'raw':_0x106e24['options']?_0x106e24[_0x375e('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x106e24[_0x375e('0x12')]?_0x106e24[_0x375e('0x12')]['where']||null:null,'attributes':_0x106e24[_0x375e('0x12')]?_0x106e24[_0x375e('0x12')][_0x375e('0x13')]||null:null,'limit':_0x106e24['options']?_0x106e24[_0x375e('0x12')][_0x375e('0x14')]||null:null,'include':_0x106e24[_0x375e('0x12')]?_0x106e24[_0x375e('0x12')][_0x375e('0x15')]?_[_0x375e('0x16')](_0x106e24['options'][_0x375e('0x15')],function(_0x45db14){return{'model':db[_0x45db14[_0x375e('0x17')]],'as':_0x45db14['as'],'attributes':_0x45db14[_0x375e('0x13')],'include':_0x45db14[_0x375e('0x15')]?_[_0x375e('0x16')](_0x45db14[_0x375e('0x15')],function(_0x3ffce9){return{'model':db[_0x3ffce9['model']],'as':_0x3ffce9['as'],'attributes':_0x3ffce9[_0x375e('0x13')],'include':_0x3ffce9['include']?_[_0x375e('0x16')](_0x3ffce9['include'],function(_0x528178){return{'model':db[_0x528178[_0x375e('0x17')]],'as':_0x528178['as'],'attributes':_0x528178[_0x375e('0x13')]};}):[]};}):[]};}):[]:[]})[_0x375e('0x18')](function(_0x4c3d1f){logger['info'](_0x375e('0x10'),_0x106e24);logger[_0x375e('0xa')]('GetCmHopper',_0x106e24,JSON['stringify'](_0x4c3d1f));_0x2afab3(_0x4c3d1f);})[_0x375e('0x19')](function(_0x105cca){logger[_0x375e('0xd')]('GetCmHopper',_0x105cca[_0x375e('0xf')],_0x106e24);_0x5e9c78(_0x1d5312[_0x375e('0xd')](0x1f4,_0x105cca[_0x375e('0xf')]));});});};exports[_0x375e('0x1a')]=function(_0xdea83a){var _0x30cdc0=this;return new Promise(function(_0x182a9b,_0x4abd1c){return db[_0x375e('0x11')][_0x375e('0x1b')]({'raw':_0xdea83a[_0x375e('0x12')]?_0xdea83a['options'][_0x375e('0x1c')]===undefined?!![]:![]:!![],'where':_0xdea83a[_0x375e('0x12')]?_0xdea83a[_0x375e('0x12')]['where']||null:null,'attributes':_0xdea83a[_0x375e('0x12')]?_0xdea83a[_0x375e('0x12')][_0x375e('0x13')]||null:null,'include':_0xdea83a[_0x375e('0x12')]?_0xdea83a[_0x375e('0x12')]['include']?_[_0x375e('0x16')](_0xdea83a['options'][_0x375e('0x15')],function(_0xc27fb5){return{'model':db[_0xc27fb5[_0x375e('0x17')]],'as':_0xc27fb5['as'],'attributes':_0xc27fb5[_0x375e('0x13')],'include':_0xc27fb5['include']?_[_0x375e('0x16')](_0xc27fb5[_0x375e('0x15')],function(_0xa2292a){return{'model':db[_0xa2292a[_0x375e('0x17')]],'as':_0xa2292a['as'],'attributes':_0xa2292a[_0x375e('0x13')],'include':_0xa2292a[_0x375e('0x15')]?_['map'](_0xa2292a[_0x375e('0x15')],function(_0x427363){return{'model':db[_0x427363[_0x375e('0x17')]],'as':_0x427363['as'],'attributes':_0x427363[_0x375e('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cc40c){logger[_0x375e('0x7')](_0x375e('0x1a'),_0xdea83a);logger[_0x375e('0xa')](_0x375e('0x1a'),_0xdea83a,JSON['stringify'](_0x2cc40c));_0x182a9b(_0x2cc40c);})['catch'](function(_0x399675){logger['error']('ShowCmHopper',_0x399675[_0x375e('0xf')],_0xdea83a);_0x4abd1c(_0x30cdc0[_0x375e('0xd')](0x1f4,_0x399675[_0x375e('0xf')]));});});};exports[_0x375e('0x1d')]=function(_0x5d6b61){var _0xe4e319=this;return new Promise(function(_0xf04d5,_0x167649){return db['CmHopper'][_0x375e('0x1e')](_0x5d6b61[_0x375e('0x1f')],{'raw':_0x5d6b61['options']?_0x5d6b61['options'][_0x375e('0x1c')]===undefined?!![]:![]:!![]})[_0x375e('0x18')](function(_0x2e3f5b){logger[_0x375e('0x7')](_0x375e('0x1d'),_0x5d6b61);logger[_0x375e('0xa')](_0x375e('0x1d'),_0x5d6b61,JSON[_0x375e('0xc')](_0x2e3f5b));_0xf04d5(_0x2e3f5b);})[_0x375e('0x19')](function(_0x2d7230){logger['error']('CreateCmHopper',_0x2d7230[_0x375e('0xf')],_0x5d6b61);_0x167649(_0xe4e319['error'](0x1f4,_0x2d7230[_0x375e('0xf')]));});});};exports[_0x375e('0x20')]=function(_0x3311a3){var _0x1c55c6=this;return new Promise(function(_0x1d0da1,_0x380882){return db[_0x375e('0x11')][_0x375e('0x21')](_0x3311a3[_0x375e('0x1f')],{'raw':_0x3311a3[_0x375e('0x12')]?_0x3311a3[_0x375e('0x12')][_0x375e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3311a3[_0x375e('0x12')]?_0x3311a3[_0x375e('0x12')][_0x375e('0x22')]||null:null,'attributes':_0x3311a3[_0x375e('0x12')]?_0x3311a3[_0x375e('0x12')][_0x375e('0x13')]||null:null,'limit':_0x3311a3[_0x375e('0x12')]?_0x3311a3[_0x375e('0x12')]['limit']||null:null})[_0x375e('0x18')](function(_0xfc5a0a){logger[_0x375e('0x7')](_0x375e('0x20'),_0x3311a3);logger[_0x375e('0xa')](_0x375e('0x20'),_0x3311a3,JSON[_0x375e('0xc')](_0xfc5a0a));_0x1d0da1(_0xfc5a0a);})['catch'](function(_0x344f1b){logger[_0x375e('0xd')](_0x375e('0x20'),_0x344f1b['message'],_0x3311a3);_0x380882(_0x1c55c6[_0x375e('0xd')](0x1f4,_0x344f1b[_0x375e('0xf')]));});});};exports['DestroyCmHopper']=function(_0x45e492){var _0x19437a=this;return new Promise(function(_0x895710,_0x2e5642){return db[_0x375e('0x11')][_0x375e('0x23')]({'where':_0x45e492[_0x375e('0x12')]?_0x45e492['options'][_0x375e('0x22')]||null:null})[_0x375e('0x18')](function(_0x337b14){logger[_0x375e('0x7')](_0x375e('0x24'),_0x45e492);logger[_0x375e('0xa')](_0x375e('0x24'),_0x45e492,JSON[_0x375e('0xc')](_0x337b14));_0x895710(_0x337b14);})[_0x375e('0x19')](function(_0x5e9c96){logger[_0x375e('0xd')]('DestroyCmHopper',_0x5e9c96[_0x375e('0xf')],_0x45e492);_0x2e5642(_0x19437a[_0x375e('0xd')](0x1f4,_0x5e9c96[_0x375e('0xf')]));});});};exports[_0x375e('0x25')]=function(_0x153f8e){var _0x4690e9=this;return new Promise(function(_0xa11e45,_0x44f1c5){return db['CmContact'][_0x375e('0x26')]()[_0x375e('0x18')](function(_0x4600e7){return db[_0x375e('0x27')][_0x375e('0x28')](function(_0x2d87fe){return db[_0x375e('0x11')]['findAll']({'where':_0x153f8e['options']?_0x153f8e['options'][_0x375e('0x22')]||null:null,'attributes':_0x153f8e[_0x375e('0x12')]?_0x153f8e[_0x375e('0x12')][_0x375e('0x13')]||null:null,'limit':_0x153f8e[_0x375e('0x12')]?_0x153f8e[_0x375e('0x12')]['limit']||null:null,'order':_0x153f8e['options']?_0x153f8e['options']['order']||null:null,'transaction':_0x2d87fe,'lock':_0x2d87fe[_0x375e('0x29')][_0x375e('0x2a')],'include':[{'model':db[_0x375e('0x2b')],'as':_0x375e('0x2c'),'attributes':_[_0x375e('0x2d')](_0x4600e7)},{'model':db[_0x375e('0x2e')],'as':_0x375e('0x2f'),'attributes':['id',_0x375e('0x30'),_0x375e('0x31')]}]})[_0x375e('0x18')](function(_0x192a69){var _0xcf3ec2=[];var _0x1eef0d=[];for(var _0x120efe=0x0;_0x120efe<_0x192a69[_0x375e('0x32')];_0x120efe+=0x1){var _0x1f626c=_0x192a69[_0x120efe][_0x375e('0x33')];if(_0x1f626c===null){_0xcf3ec2[_0x375e('0x34')](_0x192a69[_0x120efe][_0x375e('0x21')](_0x153f8e['body'],{'transaction':_0x2d87fe}));}else if(!_0x1eef0d['includes'](_0x1f626c)){_0x1eef0d[_0x375e('0x34')](_0x1f626c);_0xcf3ec2[_0x375e('0x34')](_0x192a69[_0x120efe][_0x375e('0x21')](_0x153f8e[_0x375e('0x1f')],{'transaction':_0x2d87fe}));}}return BPromise['all'](_0xcf3ec2);});})[_0x375e('0x18')](function(_0x49a48f){logger[_0x375e('0x7')](_0x375e('0x25'),_0x153f8e);logger[_0x375e('0xa')]('GetContactDialer',_0x153f8e,JSON[_0x375e('0xc')](_0x49a48f));_0xa11e45(_0x49a48f);})[_0x375e('0x19')](function(_0x4c0978){logger[_0x375e('0xd')](_0x375e('0x25'),_0x4c0978['message'],_0x153f8e);_0x44f1c5(_0x4690e9[_0x375e('0xd')](0x1f4,_0x4c0978[_0x375e('0xf')]));});});});};exports[_0x375e('0x35')]=function(_0x23abcb){var _0x370a15=this;return new Promise(function(_0x61971c,_0x41b34c){return db[_0x375e('0x27')][_0x375e('0x28')](function(_0x11fdf0){return db[_0x375e('0x36')][_0x375e('0x1e')](_0x23abcb[_0x375e('0x1f')],{'raw':_0x23abcb[_0x375e('0x12')]?_0x23abcb[_0x375e('0x12')][_0x375e('0x1c')]===undefined?!![]:![]:!![],'transaction':_0x11fdf0})[_0x375e('0x18')](function(){return db[_0x375e('0x11')][_0x375e('0x23')]({'where':_0x23abcb['options']?_0x23abcb[_0x375e('0x12')][_0x375e('0x22')]||null:null,'transaction':_0x11fdf0});});})['then'](function(_0x3ef492){logger[_0x375e('0x7')](_0x375e('0x35'),_0x23abcb);logger[_0x375e('0xa')](_0x375e('0x35'),_0x23abcb,JSON[_0x375e('0xc')](_0x3ef492));_0x61971c(_0x3ef492);})[_0x375e('0x19')](function(_0x160b25){logger[_0x375e('0xd')](_0x375e('0x35'),_0x160b25[_0x375e('0xf')],_0x23abcb);_0x41b34c(_0x370a15[_0x375e('0xd')](0x1f4,_0x160b25[_0x375e('0xf')]));});});};exports['CountReScheduled']=function(_0x23df44){var _0x51cc34=this;return new Promise(function(_0x48d530,_0x4d476d){return db['CmHopper'][_0x375e('0x37')]({'raw':_0x23df44[_0x375e('0x12')]?_0x23df44[_0x375e('0x12')][_0x375e('0x1c')]===undefined?!![]:![]:!![],'where':_0x23df44[_0x375e('0x12')]?_0x23df44[_0x375e('0x12')][_0x375e('0x22')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x375e('0x27')][_0x375e('0x38')](_0x375e('0x39')+util[_0x375e('0x3a')]('\x22%s\x22',moment()[_0x375e('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x375e('0x3b')))),_0x375e('0x3c')]]})[_0x375e('0x18')](function(_0x545270){logger['info'](_0x375e('0x3d'),_0x23df44);logger[_0x375e('0xa')]('CountReScheduled',_0x23df44,JSON[_0x375e('0xc')](_0x545270));_0x48d530(_0x545270);})[_0x375e('0x19')](function(_0x44ccaa){logger['error']('CountReScheduled',_0x44ccaa[_0x375e('0xf')],_0x23df44);_0x4d476d(_0x51cc34[_0x375e('0xd')](0x1f4,_0x44ccaa[_0x375e('0xf')]));});});};exports[_0x375e('0x3e')]=function(_0x3d00e5){var _0x2844a6=this;return new Promise(function(_0x46404e,_0x55adc0){return db[_0x375e('0x2b')][_0x375e('0x26')]()[_0x375e('0x18')](function(_0x204639){return db[_0x375e('0x27')]['transaction'](function(_0x140505){return db[_0x375e('0x11')][_0x375e('0x37')]({'where':_0x3d00e5['options']?_0x3d00e5[_0x375e('0x12')][_0x375e('0x22')]||null:null,'attributes':_0x3d00e5[_0x375e('0x12')]?_0x3d00e5[_0x375e('0x12')][_0x375e('0x13')]||null:null,'limit':0x1,'order':_0x3d00e5[_0x375e('0x12')]?_0x3d00e5['options']['order']||null:null,'group':db[_0x375e('0x11')]['UserId'],'transaction':_0x140505,'lock':_0x140505[_0x375e('0x29')][_0x375e('0x2a')],'include':_0x3d00e5[_0x375e('0x12')]?_0x3d00e5[_0x375e('0x12')][_0x375e('0x15')]?_[_0x375e('0x16')](_0x3d00e5[_0x375e('0x12')][_0x375e('0x15')],function(_0x51ba95){return{'model':db[_0x51ba95[_0x375e('0x17')]],'as':_0x51ba95['as'],'attributes':_0x51ba95[_0x375e('0x13')],'include':_0x51ba95[_0x375e('0x15')]?_['map'](_0x51ba95[_0x375e('0x15')],function(_0x41347d){return{'model':db[_0x41347d[_0x375e('0x17')]],'as':_0x41347d['as'],'attributes':_0x41347d['attributes'],'include':_0x41347d[_0x375e('0x15')]?_[_0x375e('0x16')](_0x41347d[_0x375e('0x15')],function(_0x28880d){return{'model':db[_0x28880d[_0x375e('0x17')]],'as':_0x28880d['as'],'attributes':_0x28880d['attributes']};}):[]};}):[]};}):[]:[]})[_0x375e('0x18')](function(_0x4cba7f){var _0x51a01a=[];for(var _0x130a9e=0x0;_0x130a9e<_0x4cba7f['length'];_0x130a9e+=0x1){_0x51a01a[_0x375e('0x34')](_0x4cba7f[_0x130a9e][_0x375e('0x21')](_0x3d00e5[_0x375e('0x1f')],{'transaction':_0x140505}));}return BPromise[_0x375e('0x3f')](_0x51a01a);});})['then'](function(_0x1ac1f8){logger[_0x375e('0x7')]('GetContactRecallMe',_0x3d00e5);logger['debug'](_0x375e('0x3e'),_0x3d00e5,JSON[_0x375e('0xc')](_0x1ac1f8));_0x46404e(_0x1ac1f8);})[_0x375e('0x19')](function(_0x5128ab){logger['error'](_0x375e('0x3e'),_0x5128ab['message'],_0x3d00e5);_0x55adc0(_0x2844a6[_0x375e('0xd')](0x1f4,_0x5128ab[_0x375e('0xf')]));});});});};exports[_0x375e('0x40')]=function(_0x1e70a9){var _0x193be9=this;return new Promise(function(_0x3bd058,_0x46311c){db['CmContact'][_0x375e('0x26')]()[_0x375e('0x18')](function(_0xe04ed2){return db[_0x375e('0x11')]['findAll']({'raw':_0x1e70a9['options']?_0x1e70a9[_0x375e('0x12')][_0x375e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e70a9['options']?_0x1e70a9[_0x375e('0x12')][_0x375e('0x22')]||null:null,'attributes':_0x1e70a9[_0x375e('0x12')]?_0x1e70a9['options'][_0x375e('0x13')]||null:null,'limit':_0x1e70a9[_0x375e('0x12')]?_0x1e70a9[_0x375e('0x12')][_0x375e('0x14')]||null:null,'include':_0x1e70a9[_0x375e('0x12')]?_0x1e70a9[_0x375e('0x12')][_0x375e('0x15')]?_['map'](_0x1e70a9[_0x375e('0x12')][_0x375e('0x15')],function(_0x75bee3){return{'model':db[_0x75bee3[_0x375e('0x17')]],'as':_0x75bee3['as'],'attributes':_0x75bee3['as']===_0x375e('0x2c')?_[_0x375e('0x2d')](_0xe04ed2):_0x75bee3[_0x375e('0x13')],'include':_0x75bee3[_0x375e('0x15')]?_[_0x375e('0x16')](_0x75bee3['include'],function(_0x2635e4){return{'model':db[_0x2635e4[_0x375e('0x17')]],'as':_0x2635e4['as'],'attributes':_0x2635e4[_0x375e('0x13')],'include':_0x2635e4['include']?_[_0x375e('0x16')](_0x2635e4[_0x375e('0x15')],function(_0xfaf33b){return{'model':db[_0xfaf33b['model']],'as':_0xfaf33b['as'],'attributes':_0xfaf33b[_0x375e('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d8a6d){logger['info'](_0x375e('0x10'),_0x1e70a9);logger[_0x375e('0xa')](_0x375e('0x10'),_0x1e70a9,JSON['stringify'](_0x5d8a6d));_0x3bd058(_0x5d8a6d);})[_0x375e('0x19')](function(_0x315ae8){logger[_0x375e('0xd')]('GetCmHopper',_0x315ae8[_0x375e('0xf')],_0x1e70a9);_0x46311c(_0x193be9[_0x375e('0xd')](0x1f4,_0x315ae8[_0x375e('0xf')]));});});});}; \ No newline at end of file +var _0x6d98=['all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','push','GetCmHopperPreview','keys','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','model','map','then','stringify','ShowCmHopper','find','debug','CreateCmHopper','create','body','UpdateCmHopper','update','limit','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','UPDATE','Contact','name','voicePause','length','UserId','includes'];(function(_0x29e4c0,_0xf8b14d){var _0x15b64b=function(_0x31559b){while(--_0x31559b){_0x29e4c0['push'](_0x29e4c0['shift']());}};_0x15b64b(++_0xf8b14d);}(_0x6d98,0x98));var _0x86d9=function(_0x2d4741,_0x2c57e8){_0x2d4741=_0x2d4741-0x0;var _0xaafd5b=_0x6d98[_0x2d4741];return _0xaafd5b;};'use strict';var _=require(_0x86d9('0x0'));var util=require(_0x86d9('0x1'));var moment=require(_0x86d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86d9('0x3'));var db=require(_0x86d9('0x4'))['db'];var utils=require(_0x86d9('0x5'));var logger=require(_0x86d9('0x6'))(_0x86d9('0x7'));var config=require(_0x86d9('0x8'));var jayson=require(_0x86d9('0x9'));var client=jayson[_0x86d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48a279,_0x4409a0,_0x3e3ab8){return new BPromise(function(_0x5e99ef,_0x230086){return client[_0x86d9('0xb')](_0x48a279,_0x3e3ab8)['then'](function(_0x64724d){logger[_0x86d9('0xc')]('CmHopper,\x20%s,\x20%s',_0x4409a0,_0x86d9('0xd'));logger['debug'](_0x86d9('0xe'),_0x4409a0,_0x86d9('0xd'),JSON['stringify'](_0x64724d));if(_0x64724d[_0x86d9('0xf')]){if(_0x64724d[_0x86d9('0xf')][_0x86d9('0x10')]===0x1f4){logger[_0x86d9('0xf')](_0x86d9('0x11'),_0x4409a0,_0x64724d[_0x86d9('0xf')][_0x86d9('0x12')]);return _0x230086(_0x64724d[_0x86d9('0xf')]['message']);}logger[_0x86d9('0xf')]('CmHopper,\x20%s,\x20%s',_0x4409a0,_0x64724d[_0x86d9('0xf')][_0x86d9('0x12')]);return _0x5e99ef(_0x64724d[_0x86d9('0xf')][_0x86d9('0x12')]);}else{logger[_0x86d9('0xc')](_0x86d9('0x11'),_0x4409a0,_0x86d9('0xd'));_0x5e99ef(_0x64724d['result'][_0x86d9('0x12')]);}})[_0x86d9('0x13')](function(_0x517237){logger[_0x86d9('0xf')](_0x86d9('0x11'),_0x4409a0,_0x517237);_0x230086(_0x517237);});});}exports[_0x86d9('0x14')]=function(_0x2546d4){var _0x3a7867=this;return new Promise(function(_0x2dfb2e,_0x50a0cd){return db[_0x86d9('0x15')][_0x86d9('0x16')]({'raw':_0x2546d4['options']?_0x2546d4[_0x86d9('0x17')][_0x86d9('0x18')]===undefined?!![]:![]:!![],'where':_0x2546d4['options']?_0x2546d4[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'attributes':_0x2546d4['options']?_0x2546d4[_0x86d9('0x17')][_0x86d9('0x1a')]||null:null,'limit':_0x2546d4[_0x86d9('0x17')]?_0x2546d4[_0x86d9('0x17')]['limit']||null:null,'include':_0x2546d4[_0x86d9('0x17')]?_0x2546d4[_0x86d9('0x17')][_0x86d9('0x1b')]?_['map'](_0x2546d4[_0x86d9('0x17')][_0x86d9('0x1b')],function(_0x50f8af){return{'model':db[_0x50f8af[_0x86d9('0x1c')]],'as':_0x50f8af['as'],'attributes':_0x50f8af[_0x86d9('0x1a')],'include':_0x50f8af[_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x50f8af[_0x86d9('0x1b')],function(_0x2b09a7){return{'model':db[_0x2b09a7['model']],'as':_0x2b09a7['as'],'attributes':_0x2b09a7[_0x86d9('0x1a')],'include':_0x2b09a7['include']?_[_0x86d9('0x1d')](_0x2b09a7[_0x86d9('0x1b')],function(_0x5ccd3d){return{'model':db[_0x5ccd3d[_0x86d9('0x1c')]],'as':_0x5ccd3d['as'],'attributes':_0x5ccd3d[_0x86d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x86d9('0x1e')](function(_0xe9f69){logger[_0x86d9('0xc')](_0x86d9('0x14'),_0x2546d4);logger['debug'](_0x86d9('0x14'),_0x2546d4,JSON[_0x86d9('0x1f')](_0xe9f69));_0x2dfb2e(_0xe9f69);})[_0x86d9('0x13')](function(_0xb0af2d){logger[_0x86d9('0xf')](_0x86d9('0x14'),_0xb0af2d['message'],_0x2546d4);_0x50a0cd(_0x3a7867[_0x86d9('0xf')](0x1f4,_0xb0af2d[_0x86d9('0x12')]));});});};exports[_0x86d9('0x20')]=function(_0x12318c){var _0xad7da7=this;return new Promise(function(_0x240b56,_0x52f2b5){return db[_0x86d9('0x15')][_0x86d9('0x21')]({'raw':_0x12318c[_0x86d9('0x17')]?_0x12318c['options']['raw']===undefined?!![]:![]:!![],'where':_0x12318c['options']?_0x12318c[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'attributes':_0x12318c[_0x86d9('0x17')]?_0x12318c['options'][_0x86d9('0x1a')]||null:null,'include':_0x12318c[_0x86d9('0x17')]?_0x12318c['options'][_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x12318c['options'][_0x86d9('0x1b')],function(_0xa0509d){return{'model':db[_0xa0509d[_0x86d9('0x1c')]],'as':_0xa0509d['as'],'attributes':_0xa0509d[_0x86d9('0x1a')],'include':_0xa0509d[_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0xa0509d[_0x86d9('0x1b')],function(_0x4f6c2f){return{'model':db[_0x4f6c2f[_0x86d9('0x1c')]],'as':_0x4f6c2f['as'],'attributes':_0x4f6c2f[_0x86d9('0x1a')],'include':_0x4f6c2f[_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x4f6c2f['include'],function(_0x296509){return{'model':db[_0x296509[_0x86d9('0x1c')]],'as':_0x296509['as'],'attributes':_0x296509[_0x86d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x86d9('0x1e')](function(_0x41903e){logger['info'](_0x86d9('0x20'),_0x12318c);logger[_0x86d9('0x22')](_0x86d9('0x20'),_0x12318c,JSON[_0x86d9('0x1f')](_0x41903e));_0x240b56(_0x41903e);})['catch'](function(_0xd35c3a){logger[_0x86d9('0xf')](_0x86d9('0x20'),_0xd35c3a[_0x86d9('0x12')],_0x12318c);_0x52f2b5(_0xad7da7['error'](0x1f4,_0xd35c3a['message']));});});};exports[_0x86d9('0x23')]=function(_0x301bee){var _0x404ef4=this;return new Promise(function(_0x12766f,_0x49dd68){return db['CmHopper'][_0x86d9('0x24')](_0x301bee[_0x86d9('0x25')],{'raw':_0x301bee[_0x86d9('0x17')]?_0x301bee['options']['raw']===undefined?!![]:![]:!![]})[_0x86d9('0x1e')](function(_0x469d75){logger[_0x86d9('0xc')](_0x86d9('0x23'),_0x301bee);logger['debug']('CreateCmHopper',_0x301bee,JSON[_0x86d9('0x1f')](_0x469d75));_0x12766f(_0x469d75);})[_0x86d9('0x13')](function(_0xa8390){logger[_0x86d9('0xf')]('CreateCmHopper',_0xa8390['message'],_0x301bee);_0x49dd68(_0x404ef4[_0x86d9('0xf')](0x1f4,_0xa8390[_0x86d9('0x12')]));});});};exports[_0x86d9('0x26')]=function(_0x4b9257){var _0x54b279=this;return new Promise(function(_0x21a2df,_0x3f5992){return db['CmHopper'][_0x86d9('0x27')](_0x4b9257['body'],{'raw':_0x4b9257['options']?_0x4b9257[_0x86d9('0x17')][_0x86d9('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b9257['options']?_0x4b9257[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'attributes':_0x4b9257['options']?_0x4b9257[_0x86d9('0x17')][_0x86d9('0x1a')]||null:null,'limit':_0x4b9257[_0x86d9('0x17')]?_0x4b9257[_0x86d9('0x17')][_0x86d9('0x28')]||null:null})[_0x86d9('0x1e')](function(_0x7c2e62){logger[_0x86d9('0xc')](_0x86d9('0x26'),_0x4b9257);logger[_0x86d9('0x22')](_0x86d9('0x26'),_0x4b9257,JSON[_0x86d9('0x1f')](_0x7c2e62));_0x21a2df(_0x7c2e62);})[_0x86d9('0x13')](function(_0x282379){logger['error']('UpdateCmHopper',_0x282379[_0x86d9('0x12')],_0x4b9257);_0x3f5992(_0x54b279[_0x86d9('0xf')](0x1f4,_0x282379[_0x86d9('0x12')]));});});};exports[_0x86d9('0x29')]=function(_0x23019c){var _0x2e8fe1=this;return new Promise(function(_0x56c76c,_0x54d628){return db[_0x86d9('0x15')]['destroy']({'where':_0x23019c[_0x86d9('0x17')]?_0x23019c[_0x86d9('0x17')][_0x86d9('0x19')]||null:null})[_0x86d9('0x1e')](function(_0x3a98bc){logger[_0x86d9('0xc')](_0x86d9('0x29'),_0x23019c);logger['debug'](_0x86d9('0x29'),_0x23019c,JSON[_0x86d9('0x1f')](_0x3a98bc));_0x56c76c(_0x3a98bc);})[_0x86d9('0x13')](function(_0x428601){logger[_0x86d9('0xf')](_0x86d9('0x29'),_0x428601[_0x86d9('0x12')],_0x23019c);_0x54d628(_0x2e8fe1[_0x86d9('0xf')](0x1f4,_0x428601['message']));});});};exports[_0x86d9('0x2a')]=function(_0x20d714){var _0x562f75=this;return new Promise(function(_0x3a9852,_0x1596b8){return db[_0x86d9('0x2b')][_0x86d9('0x2c')]()['then'](function(_0x27f23d){return db[_0x86d9('0x2d')][_0x86d9('0x2e')](function(_0xc0f648){return db[_0x86d9('0x15')][_0x86d9('0x16')]({'where':_0x20d714[_0x86d9('0x17')]?_0x20d714[_0x86d9('0x17')]['where']||null:null,'attributes':_0x20d714[_0x86d9('0x17')]?_0x20d714[_0x86d9('0x17')][_0x86d9('0x1a')]||null:null,'limit':_0x20d714[_0x86d9('0x17')]?_0x20d714[_0x86d9('0x17')][_0x86d9('0x28')]||null:null,'order':_0x20d714[_0x86d9('0x17')]?_0x20d714[_0x86d9('0x17')][_0x86d9('0x2f')]||null:null,'transaction':_0xc0f648,'lock':_0xc0f648['LOCK'][_0x86d9('0x30')],'include':[{'model':db[_0x86d9('0x2b')],'as':_0x86d9('0x31'),'attributes':_['keys'](_0x27f23d)},{'model':db['User'],'as':'Agent','attributes':['id',_0x86d9('0x32'),_0x86d9('0x33')]}]})['then'](function(_0x3fe92b){var _0x37243c=[];var _0x352fec=[];for(var _0x330682=0x0;_0x330682<_0x3fe92b[_0x86d9('0x34')];_0x330682+=0x1){var _0x161c75=_0x3fe92b[_0x330682][_0x86d9('0x35')];if(_0x161c75===null){_0x37243c['push'](_0x3fe92b[_0x330682][_0x86d9('0x27')](_0x20d714[_0x86d9('0x25')],{'transaction':_0xc0f648}));}else if(!_0x352fec[_0x86d9('0x36')](_0x161c75)){_0x352fec['push'](_0x161c75);_0x37243c['push'](_0x3fe92b[_0x330682][_0x86d9('0x27')](_0x20d714[_0x86d9('0x25')],{'transaction':_0xc0f648}));}}return BPromise[_0x86d9('0x37')](_0x37243c);});})[_0x86d9('0x1e')](function(_0x1a2986){logger['info'](_0x86d9('0x2a'),_0x20d714);logger[_0x86d9('0x22')](_0x86d9('0x2a'),_0x20d714,JSON['stringify'](_0x1a2986));_0x3a9852(_0x1a2986);})[_0x86d9('0x13')](function(_0x4990a1){logger[_0x86d9('0xf')]('GetContactDialer',_0x4990a1[_0x86d9('0x12')],_0x20d714);_0x1596b8(_0x562f75[_0x86d9('0xf')](0x1f4,_0x4990a1[_0x86d9('0x12')]));});});});};exports[_0x86d9('0x38')]=function(_0x270c59){var _0x11e1b2=this;return new Promise(function(_0x8d2e8,_0x5762fd){return db[_0x86d9('0x2d')][_0x86d9('0x2e')](function(_0x41b1fb){return db['CmHopperFinal'][_0x86d9('0x24')](_0x270c59[_0x86d9('0x25')],{'raw':_0x270c59[_0x86d9('0x17')]?_0x270c59[_0x86d9('0x17')][_0x86d9('0x18')]===undefined?!![]:![]:!![],'transaction':_0x41b1fb})['then'](function(){return db[_0x86d9('0x15')]['destroy']({'where':_0x270c59[_0x86d9('0x17')]?_0x270c59[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'transaction':_0x41b1fb});});})[_0x86d9('0x1e')](function(_0x178bb4){logger[_0x86d9('0xc')](_0x86d9('0x38'),_0x270c59);logger['debug'](_0x86d9('0x38'),_0x270c59,JSON['stringify'](_0x178bb4));_0x8d2e8(_0x178bb4);})[_0x86d9('0x13')](function(_0x54c4cd){logger['error'](_0x86d9('0x38'),_0x54c4cd[_0x86d9('0x12')],_0x270c59);_0x5762fd(_0x11e1b2[_0x86d9('0xf')](0x1f4,_0x54c4cd[_0x86d9('0x12')]));});});};exports[_0x86d9('0x39')]=function(_0x6aed2b){var _0x373b38=this;return new Promise(function(_0x5a62d2,_0x56f49a){return db[_0x86d9('0x15')][_0x86d9('0x16')]({'raw':_0x6aed2b['options']?_0x6aed2b[_0x86d9('0x17')][_0x86d9('0x18')]===undefined?!![]:![]:!![],'where':_0x6aed2b['options']?_0x6aed2b[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'attributes':[[db[_0x86d9('0x2d')]['fn'](_0x86d9('0x3a'),db[_0x86d9('0x2d')]['fn']('IF',db[_0x86d9('0x2d')][_0x86d9('0x3b')]('`scheduledat`\x20>=\x20'+util[_0x86d9('0x3c')]('\x22%s\x22',moment()[_0x86d9('0x3c')](_0x86d9('0x3d')))+_0x86d9('0x3e')))),_0x86d9('0x3f')]]})[_0x86d9('0x1e')](function(_0x476c9b){logger[_0x86d9('0xc')](_0x86d9('0x39'),_0x6aed2b);logger[_0x86d9('0x22')](_0x86d9('0x39'),_0x6aed2b,JSON[_0x86d9('0x1f')](_0x476c9b));_0x5a62d2(_0x476c9b);})['catch'](function(_0x42908c){logger['error'](_0x86d9('0x39'),_0x42908c[_0x86d9('0x12')],_0x6aed2b);_0x56f49a(_0x373b38['error'](0x1f4,_0x42908c['message']));});});};exports[_0x86d9('0x40')]=function(_0x59730a){var _0x1db341=this;return new Promise(function(_0xfdce14,_0x53013e){return db[_0x86d9('0x2b')][_0x86d9('0x2c')]()[_0x86d9('0x1e')](function(_0xa67f0e){return db[_0x86d9('0x2d')][_0x86d9('0x2e')](function(_0x2131e3){return db[_0x86d9('0x15')][_0x86d9('0x16')]({'where':_0x59730a[_0x86d9('0x17')]?_0x59730a[_0x86d9('0x17')][_0x86d9('0x19')]||null:null,'attributes':_0x59730a[_0x86d9('0x17')]?_0x59730a[_0x86d9('0x17')][_0x86d9('0x1a')]||null:null,'limit':0x1,'order':_0x59730a['options']?_0x59730a['options'][_0x86d9('0x2f')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x2131e3,'lock':_0x2131e3[_0x86d9('0x41')][_0x86d9('0x30')],'include':_0x59730a[_0x86d9('0x17')]?_0x59730a[_0x86d9('0x17')][_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x59730a[_0x86d9('0x17')][_0x86d9('0x1b')],function(_0x3102e0){return{'model':db[_0x3102e0['model']],'as':_0x3102e0['as'],'attributes':_0x3102e0[_0x86d9('0x1a')],'include':_0x3102e0[_0x86d9('0x1b')]?_['map'](_0x3102e0[_0x86d9('0x1b')],function(_0x316c09){return{'model':db[_0x316c09[_0x86d9('0x1c')]],'as':_0x316c09['as'],'attributes':_0x316c09[_0x86d9('0x1a')],'include':_0x316c09['include']?_[_0x86d9('0x1d')](_0x316c09['include'],function(_0x25a3f5){return{'model':db[_0x25a3f5[_0x86d9('0x1c')]],'as':_0x25a3f5['as'],'attributes':_0x25a3f5[_0x86d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x86d9('0x1e')](function(_0x4792e6){var _0x58b5f8=[];for(var _0x6829c3=0x0;_0x6829c3<_0x4792e6[_0x86d9('0x34')];_0x6829c3+=0x1){_0x58b5f8[_0x86d9('0x42')](_0x4792e6[_0x6829c3][_0x86d9('0x27')](_0x59730a[_0x86d9('0x25')],{'transaction':_0x2131e3}));}return BPromise[_0x86d9('0x37')](_0x58b5f8);});})[_0x86d9('0x1e')](function(_0x49dda9){logger[_0x86d9('0xc')](_0x86d9('0x40'),_0x59730a);logger[_0x86d9('0x22')]('GetContactRecallMe',_0x59730a,JSON[_0x86d9('0x1f')](_0x49dda9));_0xfdce14(_0x49dda9);})[_0x86d9('0x13')](function(_0x3fdb1d){logger[_0x86d9('0xf')]('GetContactRecallMe',_0x3fdb1d[_0x86d9('0x12')],_0x59730a);_0x53013e(_0x1db341[_0x86d9('0xf')](0x1f4,_0x3fdb1d[_0x86d9('0x12')]));});});});};exports[_0x86d9('0x43')]=function(_0x2de549){var _0x6cc5cb=this;return new Promise(function(_0x5a32d3,_0x452fa9){db[_0x86d9('0x2b')][_0x86d9('0x2c')]()[_0x86d9('0x1e')](function(_0x16911f){return db[_0x86d9('0x15')][_0x86d9('0x16')]({'raw':_0x2de549[_0x86d9('0x17')]?_0x2de549['options'][_0x86d9('0x18')]===undefined?!![]:![]:!![],'where':_0x2de549['options']?_0x2de549['options'][_0x86d9('0x19')]||null:null,'attributes':_0x2de549[_0x86d9('0x17')]?_0x2de549[_0x86d9('0x17')][_0x86d9('0x1a')]||null:null,'limit':_0x2de549[_0x86d9('0x17')]?_0x2de549['options'][_0x86d9('0x28')]||null:null,'include':_0x2de549[_0x86d9('0x17')]?_0x2de549[_0x86d9('0x17')][_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x2de549[_0x86d9('0x17')]['include'],function(_0xa50c89){return{'model':db[_0xa50c89['model']],'as':_0xa50c89['as'],'attributes':_0xa50c89['as']===_0x86d9('0x31')?_[_0x86d9('0x44')](_0x16911f):_0xa50c89[_0x86d9('0x1a')],'include':_0xa50c89['include']?_[_0x86d9('0x1d')](_0xa50c89[_0x86d9('0x1b')],function(_0x528a54){return{'model':db[_0x528a54[_0x86d9('0x1c')]],'as':_0x528a54['as'],'attributes':_0x528a54[_0x86d9('0x1a')],'include':_0x528a54[_0x86d9('0x1b')]?_[_0x86d9('0x1d')](_0x528a54[_0x86d9('0x1b')],function(_0x201145){return{'model':db[_0x201145['model']],'as':_0x201145['as'],'attributes':_0x201145[_0x86d9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x86d9('0x1e')](function(_0x371c7a){logger['info'](_0x86d9('0x14'),_0x2de549);logger[_0x86d9('0x22')](_0x86d9('0x14'),_0x2de549,JSON[_0x86d9('0x1f')](_0x371c7a));_0x5a32d3(_0x371c7a);})['catch'](function(_0x46642f){logger[_0x86d9('0xf')](_0x86d9('0x14'),_0x46642f[_0x86d9('0x12')],_0x2de549);_0x452fa9(_0x6cc5cb[_0x86d9('0xf')](0x1f4,_0x46642f[_0x86d9('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 806c03e..113eb4b 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 _0x88a8=['/:id','show','post','create','/preview','getPreview','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','getOpenContacts'];(function(_0x1ac2d8,_0x2096a7){var _0x253151=function(_0x3399d3){while(--_0x3399d3){_0x1ac2d8['push'](_0x1ac2d8['shift']());}};_0x253151(++_0x2096a7);}(_0x88a8,0x1ed));var _0x888a=function(_0x3fa38e,_0xf97ece){_0x3fa38e=_0x3fa38e-0x0;var _0x42d18d=_0x88a8[_0x3fa38e];return _0x42d18d;};'use strict';var multer=require(_0x888a('0x0'));var util=require('util');var path=require(_0x888a('0x1'));var timeout=require(_0x888a('0x2'));var express=require(_0x888a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x888a('0x4'));var interaction=require(_0x888a('0x5'));var config=require('../../config/environment');var controller=require(_0x888a('0x6'));router[_0x888a('0x7')]('/',auth[_0x888a('0x8')](),controller['index']);router[_0x888a('0x7')](_0x888a('0x9'),auth[_0x888a('0x8')](),controller[_0x888a('0xa')]);router[_0x888a('0x7')](_0x888a('0xb'),auth['isAuthenticated'](),controller[_0x888a('0xc')]);router[_0x888a('0x7')](_0x888a('0xd'),auth['isAuthenticated'](),controller[_0x888a('0xe')]);router[_0x888a('0xf')]('/',auth[_0x888a('0x8')](),controller[_0x888a('0x10')]);router[_0x888a('0xf')](_0x888a('0x11'),auth[_0x888a('0x8')](),controller[_0x888a('0x12')]);router[_0x888a('0x13')](_0x888a('0xd'),auth[_0x888a('0x8')](),controller[_0x888a('0x14')]);router[_0x888a('0x15')]('/:id',auth[_0x888a('0x8')](),controller['destroy']);module[_0x888a('0x16')]=router; \ No newline at end of file +var _0xa43d=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy'];(function(_0x52f14e,_0x458724){var _0x23b181=function(_0x3bf46a){while(--_0x3bf46a){_0x52f14e['push'](_0x52f14e['shift']());}};_0x23b181(++_0x458724);}(_0xa43d,0x159));var _0xda43=function(_0x45dfde,_0x597ea9){_0x45dfde=_0x45dfde-0x0;var _0x26ca3b=_0xa43d[_0x45dfde];return _0x26ca3b;};'use strict';var multer=require(_0xda43('0x0'));var util=require(_0xda43('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xda43('0x2'));var router=express['Router']();var fs_extra=require(_0xda43('0x3'));var auth=require(_0xda43('0x4'));var interaction=require(_0xda43('0x5'));var config=require(_0xda43('0x6'));var controller=require(_0xda43('0x7'));router[_0xda43('0x8')]('/',auth[_0xda43('0x9')](),controller[_0xda43('0xa')]);router[_0xda43('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xda43('0x8')](_0xda43('0xb'),auth['isAuthenticated'](),controller[_0xda43('0xc')]);router[_0xda43('0x8')](_0xda43('0xd'),auth[_0xda43('0x9')](),controller[_0xda43('0xe')]);router[_0xda43('0xf')]('/',auth[_0xda43('0x9')](),controller[_0xda43('0x10')]);router[_0xda43('0xf')](_0xda43('0x11'),auth['isAuthenticated'](),controller[_0xda43('0x12')]);router[_0xda43('0x13')]('/:id',auth[_0xda43('0x9')](),controller[_0xda43('0x14')]);router[_0xda43('0x15')](_0xda43('0xd'),auth['isAuthenticated'](),controller[_0xda43('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a684b39..368c355 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 _0xf2ca=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x417baa,_0x3923d0){_0x417baa=_0x417baa-0x0;var _0x42724f=_0xf2ca[_0x417baa];return _0x42724f;};'use strict';var moment=require(_0xaf2c('0x0'));var Sequelize=require(_0xaf2c('0x1'));module[_0xaf2c('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xaf2c('0x3')],'unique':_0xaf2c('0x4')},'ListId':{'type':Sequelize[_0xaf2c('0x3')],'unique':_0xaf2c('0x4')},'VoiceQueueId':{'type':Sequelize[_0xaf2c('0x3')],'unique':_0xaf2c('0x4')}}; \ No newline at end of file +var _0xd2bb=['INTEGER','contactListQueue','sequelize','STRING'];(function(_0x3461b8,_0x5b2fe1){var _0x5726ef=function(_0x36bc83){while(--_0x36bc83){_0x3461b8['push'](_0x3461b8['shift']());}};_0x5726ef(++_0x5b2fe1);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x26dbbf,_0x164d1e){_0x26dbbf=_0x26dbbf-0x0;var _0x3b6a40=_0xd2bb[_0x26dbbf];return _0x3b6a40;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd2b('0x0'));module['exports']={'phone':{'type':Sequelize[_0xbd2b('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xbd2b('0x2')],'unique':_0xbd2b('0x3')},'ListId':{'type':Sequelize[_0xbd2b('0x2')],'unique':_0xbd2b('0x3')},'VoiceQueueId':{'type':Sequelize[_0xbd2b('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e0edfe2..81ebfa0 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 _0xb9f1=['includeAll','include','rows','catch','params','options','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x18734e,_0x420e39){var _0x9db15a=function(_0x1264b0){while(--_0x1264b0){_0x18734e['push'](_0x18734e['shift']());}};_0x9db15a(++_0x420e39);}(_0xb9f1,0xfc));var _0x1b9f=function(_0x430205,_0xda9a5c){_0x430205=_0x430205-0x0;var _0x3581a3=_0xb9f1[_0x430205];return _0x3581a3;};'use strict';var emlformat=require(_0x1b9f('0x0'));var rimraf=require(_0x1b9f('0x1'));var zipdir=require(_0x1b9f('0x2'));var jsonpatch=require(_0x1b9f('0x3'));var rp=require(_0x1b9f('0x4'));var moment=require(_0x1b9f('0x5'));var BPromise=require(_0x1b9f('0x6'));var Mustache=require(_0x1b9f('0x7'));var util=require(_0x1b9f('0x8'));var path=require(_0x1b9f('0x9'));var sox=require(_0x1b9f('0xa'));var csv=require(_0x1b9f('0xb'));var ejs=require(_0x1b9f('0xc'));var fs=require('fs');var fs_extra=require(_0x1b9f('0xd'));var _=require(_0x1b9f('0xe'));var squel=require(_0x1b9f('0xf'));var crypto=require(_0x1b9f('0x10'));var jsforce=require(_0x1b9f('0x11'));var deskjs=require(_0x1b9f('0x12'));var toCsv=require(_0x1b9f('0xb'));var querystring=require(_0x1b9f('0x13'));var Papa=require(_0x1b9f('0x14'));var Redis=require('ioredis');var authService=require(_0x1b9f('0x15'));var qs=require(_0x1b9f('0x16'));var as=require(_0x1b9f('0x17'));var hardwareService=require(_0x1b9f('0x18'));var logger=require(_0x1b9f('0x19'))(_0x1b9f('0x1a'));var utils=require(_0x1b9f('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x1b9f('0x1c'));var db=require(_0x1b9f('0x1d'))['db'];function respondWithStatusCode(_0x449097,_0x37b4b2){_0x37b4b2=_0x37b4b2||0xcc;return function(_0x5611e2){if(_0x5611e2){return _0x449097[_0x1b9f('0x1e')](_0x37b4b2);}return _0x449097[_0x1b9f('0x1f')](_0x37b4b2)[_0x1b9f('0x20')]();};}function respondWithResult(_0x25aa3c,_0xf1fedf){_0xf1fedf=_0xf1fedf||0xc8;return function(_0x4f6fcc){if(_0x4f6fcc){return _0x25aa3c[_0x1b9f('0x1f')](_0xf1fedf)['json'](_0x4f6fcc);}};}function respondWithFilteredResult(_0x20c011,_0x3c0226){return function(_0x43b2e4){if(_0x43b2e4){var _0x4a3551=typeof _0x3c0226[_0x1b9f('0x21')]===_0x1b9f('0x22')&&typeof _0x3c0226['limit']===_0x1b9f('0x22');var _0x412cfd=_0x43b2e4[_0x1b9f('0x23')];var _0x56930f=_0x4a3551?0x0:_0x3c0226['offset'];var _0x4c75c6=_0x4a3551?_0x43b2e4[_0x1b9f('0x23')]:_0x3c0226[_0x1b9f('0x21')]+_0x3c0226[_0x1b9f('0x24')];var _0x38eda5;if(_0x4c75c6>=_0x412cfd){_0x4c75c6=_0x412cfd;_0x38eda5=0xc8;}else{_0x38eda5=0xce;}_0x20c011['status'](_0x38eda5);return _0x20c011[_0x1b9f('0x25')]('Content-Range',_0x56930f+'-'+_0x4c75c6+'/'+_0x412cfd)['json'](_0x43b2e4);}return null;};}function patchUpdates(_0x2727fb){return function(_0x31b01f){try{jsonpatch[_0x1b9f('0x26')](_0x31b01f,_0x2727fb,!![]);}catch(_0x111b04){return BPromise[_0x1b9f('0x27')](_0x111b04);}return _0x31b01f[_0x1b9f('0x28')]();};}function saveUpdates(_0x57be0c,_0x327c95){return function(_0x10506c){if(_0x10506c){return _0x10506c[_0x1b9f('0x29')](_0x57be0c)[_0x1b9f('0x2a')](function(_0x1016de){return _0x1016de;});}return null;};}function removeEntity(_0x5bc85a,_0x101833){return function(_0x4d1152){if(_0x4d1152){return _0x4d1152[_0x1b9f('0x2b')]()['then'](function(){_0x5bc85a['status'](0xcc)[_0x1b9f('0x20')]();});}};}function handleEntityNotFound(_0x1bb46f,_0x540cb5){return function(_0x47a44a){if(!_0x47a44a){_0x1bb46f[_0x1b9f('0x1e')](0x194);}return _0x47a44a;};}function handleError(_0x52639d,_0x42fd18){_0x42fd18=_0x42fd18||0x1f4;return function(_0x387770){logger[_0x1b9f('0x2c')](_0x387770[_0x1b9f('0x2d')]);if(_0x387770[_0x1b9f('0x2e')]){delete _0x387770['name'];}_0x52639d[_0x1b9f('0x1f')](_0x42fd18)[_0x1b9f('0x2f')](_0x387770);};}exports[_0x1b9f('0x30')]=function(_0xc03724,_0x2adeb3){var _0x40e687={},_0x273666={},_0x52ef9={'count':0x0,'rows':[]};var _0x5a9087=_[_0x1b9f('0x31')](db[_0x1b9f('0x32')][_0x1b9f('0x33')],function(_0x428532){return{'name':_0x428532[_0x1b9f('0x34')],'type':_0x428532[_0x1b9f('0x35')][_0x1b9f('0x36')]};});_0x273666[_0x1b9f('0x37')]=_[_0x1b9f('0x31')](_0x5a9087,_0x1b9f('0x2e'));_0x273666[_0x1b9f('0x38')]=_[_0x1b9f('0x39')](_0xc03724[_0x1b9f('0x38')]);_0x273666[_0x1b9f('0x3a')]=_[_0x1b9f('0x3b')](_0x273666[_0x1b9f('0x37')],_0x273666[_0x1b9f('0x38')]);_0x40e687[_0x1b9f('0x3c')]=_[_0x1b9f('0x3b')](_0x273666[_0x1b9f('0x37')],qs['fields'](_0xc03724[_0x1b9f('0x38')][_0x1b9f('0x3d')]));_0x40e687[_0x1b9f('0x3c')]=_0x40e687['attributes'][_0x1b9f('0x3e')]?_0x40e687[_0x1b9f('0x3c')]:_0x273666['model'];if(!_0xc03724[_0x1b9f('0x38')][_0x1b9f('0x3f')](_0x1b9f('0x40'))){_0x40e687[_0x1b9f('0x24')]=qs[_0x1b9f('0x24')](_0xc03724[_0x1b9f('0x38')][_0x1b9f('0x24')]);_0x40e687[_0x1b9f('0x21')]=qs[_0x1b9f('0x21')](_0xc03724['query']['offset']);}_0x40e687[_0x1b9f('0x41')]=qs[_0x1b9f('0x42')](_0xc03724[_0x1b9f('0x38')]['sort']);_0x40e687['where']=qs[_0x1b9f('0x3a')](_[_0x1b9f('0x43')](_0xc03724[_0x1b9f('0x38')],_0x273666[_0x1b9f('0x3a')]),_0x5a9087);if(_0xc03724[_0x1b9f('0x38')][_0x1b9f('0x44')]){_0x40e687[_0x1b9f('0x45')]=_[_0x1b9f('0x46')](_0x40e687[_0x1b9f('0x45')],{'$or':_[_0x1b9f('0x31')](_0x5a9087,function(_0x3b3916){if(_0x3b3916[_0x1b9f('0x35')]!==_0x1b9f('0x47')){var _0x3e40bb={};_0x3e40bb[_0x3b3916[_0x1b9f('0x2e')]]={'$like':'%'+_0xc03724['query']['filter']+'%'};return _0x3e40bb;}})});}_0x40e687=_[_0x1b9f('0x46')]({},_0x40e687,_0xc03724['options']);var _0x3dc80b={'where':_0x40e687[_0x1b9f('0x45')]};return db[_0x1b9f('0x32')][_0x1b9f('0x23')](_0x3dc80b)[_0x1b9f('0x2a')](function(_0x4ddba4){_0x52ef9[_0x1b9f('0x23')]=_0x4ddba4;if(_0xc03724[_0x1b9f('0x38')][_0x1b9f('0x48')]){_0x40e687[_0x1b9f('0x49')]=[{'all':!![]}];}return db[_0x1b9f('0x32')]['findAll'](_0x40e687);})[_0x1b9f('0x2a')](function(_0x10dc79){_0x52ef9[_0x1b9f('0x4a')]=_0x10dc79;return _0x52ef9;})[_0x1b9f('0x2a')](respondWithFilteredResult(_0x2adeb3,_0x40e687))[_0x1b9f('0x4b')](handleError(_0x2adeb3,null));};exports['show']=function(_0x6fdecd,_0x5fab65){var _0xb9ecd1={'raw':!![],'where':{'id':_0x6fdecd[_0x1b9f('0x4c')]['id']}},_0x3bafae={};_0x3bafae[_0x1b9f('0x37')]=_['keys'](db[_0x1b9f('0x32')][_0x1b9f('0x33')]);_0x3bafae[_0x1b9f('0x38')]=_[_0x1b9f('0x39')](_0x6fdecd[_0x1b9f('0x38')]);_0x3bafae[_0x1b9f('0x3a')]=_[_0x1b9f('0x3b')](_0x3bafae[_0x1b9f('0x37')],_0x3bafae[_0x1b9f('0x38')]);_0xb9ecd1[_0x1b9f('0x3c')]=_['intersection'](_0x3bafae[_0x1b9f('0x37')],qs['fields'](_0x6fdecd['query'][_0x1b9f('0x3d')]));_0xb9ecd1[_0x1b9f('0x3c')]=_0xb9ecd1['attributes']['length']?_0xb9ecd1['attributes']:_0x3bafae[_0x1b9f('0x37')];if(_0x6fdecd['query']['includeAll']){_0xb9ecd1['include']=[{'all':!![]}];}_0xb9ecd1=_[_0x1b9f('0x46')]({},_0xb9ecd1,_0x6fdecd[_0x1b9f('0x4d')]);return db[_0x1b9f('0x32')]['find'](_0xb9ecd1)['then'](handleEntityNotFound(_0x5fab65,null))[_0x1b9f('0x2a')](respondWithResult(_0x5fab65,null))[_0x1b9f('0x4b')](handleError(_0x5fab65,null));};exports['update']=function(_0xf5d08b,_0x55ca3b){if(_0xf5d08b[_0x1b9f('0x4e')]['id']){delete _0xf5d08b['body']['id'];}return db['CmHopperBlack'][_0x1b9f('0x4f')]({'where':{'id':_0xf5d08b[_0x1b9f('0x4c')]['id']}})[_0x1b9f('0x2a')](handleEntityNotFound(_0x55ca3b,null))[_0x1b9f('0x2a')](saveUpdates(_0xf5d08b[_0x1b9f('0x4e')],null))[_0x1b9f('0x2a')](respondWithResult(_0x55ca3b,null))[_0x1b9f('0x4b')](handleError(_0x55ca3b,null));};exports[_0x1b9f('0x2b')]=function(_0x511959,_0x2d3834){return db[_0x1b9f('0x32')][_0x1b9f('0x4f')]({'where':{'id':_0x511959['params']['id']}})[_0x1b9f('0x2a')](handleEntityNotFound(_0x2d3834,null))['then'](removeEntity(_0x2d3834,null))[_0x1b9f('0x4b')](handleError(_0x2d3834,null));};exports[_0x1b9f('0x50')]=function(_0x42e42d,_0x549afc){return db[_0x1b9f('0x32')]['describe']()[_0x1b9f('0x2a')](respondWithResult(_0x549afc,null))[_0x1b9f('0x4b')](handleError(_0x549afc,null));}; \ No newline at end of file +var _0x55fd=['rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','index','CmHopperBlack'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x55fd,0x15c));var _0xd55f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x55fd[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0xd55f('0x0'));var rimraf=require(_0xd55f('0x1'));var zipdir=require(_0xd55f('0x2'));var jsonpatch=require(_0xd55f('0x3'));var rp=require(_0xd55f('0x4'));var moment=require(_0xd55f('0x5'));var BPromise=require(_0xd55f('0x6'));var Mustache=require(_0xd55f('0x7'));var util=require(_0xd55f('0x8'));var path=require(_0xd55f('0x9'));var sox=require(_0xd55f('0xa'));var csv=require(_0xd55f('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd55f('0xc'));var squel=require(_0xd55f('0xd'));var crypto=require(_0xd55f('0xe'));var jsforce=require(_0xd55f('0xf'));var deskjs=require(_0xd55f('0x10'));var toCsv=require(_0xd55f('0xb'));var querystring=require('querystring');var Papa=require(_0xd55f('0x11'));var Redis=require(_0xd55f('0x12'));var authService=require(_0xd55f('0x13'));var qs=require(_0xd55f('0x14'));var as=require(_0xd55f('0x15'));var hardwareService=require(_0xd55f('0x16'));var logger=require('../../config/logger')(_0xd55f('0x17'));var utils=require(_0xd55f('0x18'));var config=require(_0xd55f('0x19'));var licenseUtil=require(_0xd55f('0x1a'));var db=require(_0xd55f('0x1b'))['db'];function respondWithStatusCode(_0x3b70b2,_0x12e16f){_0x12e16f=_0x12e16f||0xcc;return function(_0x270d58){if(_0x270d58){return _0x3b70b2[_0xd55f('0x1c')](_0x12e16f);}return _0x3b70b2[_0xd55f('0x1d')](_0x12e16f)[_0xd55f('0x1e')]();};}function respondWithResult(_0x392efa,_0x6be69b){_0x6be69b=_0x6be69b||0xc8;return function(_0x2683e0){if(_0x2683e0){return _0x392efa[_0xd55f('0x1d')](_0x6be69b)['json'](_0x2683e0);}};}function respondWithFilteredResult(_0x597e17,_0x57f7ed){return function(_0x3cb97f){if(_0x3cb97f){var _0x22b7de=typeof _0x57f7ed[_0xd55f('0x1f')]===_0xd55f('0x20')&&typeof _0x57f7ed[_0xd55f('0x21')]===_0xd55f('0x20');var _0x339619=_0x3cb97f[_0xd55f('0x22')];var _0x7adb2a=_0x22b7de?0x0:_0x57f7ed['offset'];var _0x5276ff=_0x22b7de?_0x3cb97f['count']:_0x57f7ed[_0xd55f('0x1f')]+_0x57f7ed['limit'];var _0x3c7c2f;if(_0x5276ff>=_0x339619){_0x5276ff=_0x339619;_0x3c7c2f=0xc8;}else{_0x3c7c2f=0xce;}_0x597e17[_0xd55f('0x1d')](_0x3c7c2f);return _0x597e17[_0xd55f('0x23')](_0xd55f('0x24'),_0x7adb2a+'-'+_0x5276ff+'/'+_0x339619)[_0xd55f('0x25')](_0x3cb97f);}return null;};}function patchUpdates(_0x8e5821){return function(_0x40a6be){try{jsonpatch[_0xd55f('0x26')](_0x40a6be,_0x8e5821,!![]);}catch(_0x2a8ab5){return BPromise[_0xd55f('0x27')](_0x2a8ab5);}return _0x40a6be['save']();};}function saveUpdates(_0x8a20d4,_0x23ef95){return function(_0x2a8a76){if(_0x2a8a76){return _0x2a8a76[_0xd55f('0x28')](_0x8a20d4)[_0xd55f('0x29')](function(_0x2a2628){return _0x2a2628;});}return null;};}function removeEntity(_0x5948d3,_0x44e68c){return function(_0x1b0f64){if(_0x1b0f64){return _0x1b0f64[_0xd55f('0x2a')]()['then'](function(){_0x5948d3[_0xd55f('0x1d')](0xcc)[_0xd55f('0x1e')]();});}};}function handleEntityNotFound(_0xd3d539,_0x2e2d5d){return function(_0x4be841){if(!_0x4be841){_0xd3d539[_0xd55f('0x1c')](0x194);}return _0x4be841;};}function handleError(_0x2effa1,_0x30f0f2){_0x30f0f2=_0x30f0f2||0x1f4;return function(_0x4ab894){logger[_0xd55f('0x2b')](_0x4ab894[_0xd55f('0x2c')]);if(_0x4ab894['name']){delete _0x4ab894['name'];}_0x2effa1[_0xd55f('0x1d')](_0x30f0f2)['send'](_0x4ab894);};}exports[_0xd55f('0x2d')]=function(_0x246c43,_0x338b5f){var _0x33afc0={},_0x50a3e6={},_0x3f8827={'count':0x0,'rows':[]};var _0x24fb14=_['map'](db[_0xd55f('0x2e')][_0xd55f('0x2f')],function(_0x492f45){return{'name':_0x492f45['fieldName'],'type':_0x492f45[_0xd55f('0x30')][_0xd55f('0x31')]};});_0x50a3e6[_0xd55f('0x32')]=_[_0xd55f('0x33')](_0x24fb14,_0xd55f('0x34'));_0x50a3e6[_0xd55f('0x35')]=_[_0xd55f('0x36')](_0x246c43[_0xd55f('0x35')]);_0x50a3e6[_0xd55f('0x37')]=_[_0xd55f('0x38')](_0x50a3e6[_0xd55f('0x32')],_0x50a3e6[_0xd55f('0x35')]);_0x33afc0[_0xd55f('0x39')]=_[_0xd55f('0x38')](_0x50a3e6[_0xd55f('0x32')],qs['fields'](_0x246c43[_0xd55f('0x35')][_0xd55f('0x3a')]));_0x33afc0[_0xd55f('0x39')]=_0x33afc0[_0xd55f('0x39')][_0xd55f('0x3b')]?_0x33afc0[_0xd55f('0x39')]:_0x50a3e6['model'];if(!_0x246c43['query'][_0xd55f('0x3c')](_0xd55f('0x3d'))){_0x33afc0[_0xd55f('0x21')]=qs['limit'](_0x246c43[_0xd55f('0x35')]['limit']);_0x33afc0[_0xd55f('0x1f')]=qs[_0xd55f('0x1f')](_0x246c43[_0xd55f('0x35')]['offset']);}_0x33afc0[_0xd55f('0x3e')]=qs[_0xd55f('0x3f')](_0x246c43[_0xd55f('0x35')][_0xd55f('0x3f')]);_0x33afc0[_0xd55f('0x40')]=qs['filters'](_[_0xd55f('0x41')](_0x246c43[_0xd55f('0x35')],_0x50a3e6[_0xd55f('0x37')]),_0x24fb14);if(_0x246c43['query']['filter']){_0x33afc0['where']=_[_0xd55f('0x42')](_0x33afc0[_0xd55f('0x40')],{'$or':_[_0xd55f('0x33')](_0x24fb14,function(_0x5bf98c){if(_0x5bf98c['type']!==_0xd55f('0x43')){var _0x19714f={};_0x19714f[_0x5bf98c[_0xd55f('0x34')]]={'$like':'%'+_0x246c43['query'][_0xd55f('0x44')]+'%'};return _0x19714f;}})});}_0x33afc0=_[_0xd55f('0x42')]({},_0x33afc0,_0x246c43[_0xd55f('0x45')]);var _0x30f080={'where':_0x33afc0[_0xd55f('0x40')]};return db[_0xd55f('0x2e')]['count'](_0x30f080)[_0xd55f('0x29')](function(_0x47a1b6){_0x3f8827['count']=_0x47a1b6;if(_0x246c43[_0xd55f('0x35')][_0xd55f('0x46')]){_0x33afc0[_0xd55f('0x47')]=[{'all':!![]}];}return db[_0xd55f('0x2e')][_0xd55f('0x48')](_0x33afc0);})[_0xd55f('0x29')](function(_0x4e8754){_0x3f8827[_0xd55f('0x49')]=_0x4e8754;return _0x3f8827;})[_0xd55f('0x29')](respondWithFilteredResult(_0x338b5f,_0x33afc0))[_0xd55f('0x4a')](handleError(_0x338b5f,null));};exports['show']=function(_0xd8ed55,_0x16678f){var _0xbdf51c={'raw':!![],'where':{'id':_0xd8ed55[_0xd55f('0x4b')]['id']}},_0x3a4415={};_0x3a4415[_0xd55f('0x32')]=_[_0xd55f('0x36')](db[_0xd55f('0x2e')]['rawAttributes']);_0x3a4415[_0xd55f('0x35')]=_[_0xd55f('0x36')](_0xd8ed55[_0xd55f('0x35')]);_0x3a4415[_0xd55f('0x37')]=_[_0xd55f('0x38')](_0x3a4415[_0xd55f('0x32')],_0x3a4415[_0xd55f('0x35')]);_0xbdf51c[_0xd55f('0x39')]=_['intersection'](_0x3a4415[_0xd55f('0x32')],qs[_0xd55f('0x3a')](_0xd8ed55[_0xd55f('0x35')]['fields']));_0xbdf51c[_0xd55f('0x39')]=_0xbdf51c['attributes']['length']?_0xbdf51c[_0xd55f('0x39')]:_0x3a4415[_0xd55f('0x32')];if(_0xd8ed55[_0xd55f('0x35')]['includeAll']){_0xbdf51c[_0xd55f('0x47')]=[{'all':!![]}];}_0xbdf51c=_[_0xd55f('0x42')]({},_0xbdf51c,_0xd8ed55[_0xd55f('0x45')]);return db['CmHopperBlack'][_0xd55f('0x4c')](_0xbdf51c)['then'](handleEntityNotFound(_0x16678f,null))['then'](respondWithResult(_0x16678f,null))['catch'](handleError(_0x16678f,null));};exports[_0xd55f('0x28')]=function(_0x1e4e4d,_0x2bc2d0){if(_0x1e4e4d[_0xd55f('0x4d')]['id']){delete _0x1e4e4d[_0xd55f('0x4d')]['id'];}return db['CmHopperBlack'][_0xd55f('0x4c')]({'where':{'id':_0x1e4e4d[_0xd55f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2bc2d0,null))[_0xd55f('0x29')](saveUpdates(_0x1e4e4d['body'],null))['then'](respondWithResult(_0x2bc2d0,null))[_0xd55f('0x4a')](handleError(_0x2bc2d0,null));};exports['destroy']=function(_0x4c7a6d,_0x1cab77){return db[_0xd55f('0x2e')][_0xd55f('0x4c')]({'where':{'id':_0x4c7a6d['params']['id']}})[_0xd55f('0x29')](handleEntityNotFound(_0x1cab77,null))['then'](removeEntity(_0x1cab77,null))['catch'](handleError(_0x1cab77,null));};exports[_0xd55f('0x4e')]=function(_0x3f85cd,_0x56c394){return db[_0xd55f('0x2e')][_0xd55f('0x4e')]()['then'](respondWithResult(_0x56c394,null))['catch'](handleError(_0x56c394,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 5f5f6a5..53730f1 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 _0xdf7e=['lodash','util','api','moment','bluebird','rimraf','./cmHopperBlack.attributes','define'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xdf7e,0x80));var _0xedf7=function(_0x33478a,_0x295f93){_0x33478a=_0x33478a-0x0;var _0x2ed137=_0xdf7e[_0x33478a];return _0x2ed137;};'use strict';var _=require(_0xedf7('0x0'));var util=require(_0xedf7('0x1'));var logger=require('../../config/logger')(_0xedf7('0x2'));var moment=require(_0xedf7('0x3'));var BPromise=require(_0xedf7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xedf7('0x5'));var config=require('../../config/environment');var attributes=require(_0xedf7('0x6'));module['exports']=function(_0x34c154,_0x85cec0){return _0x34c154[_0xedf7('0x7')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x864b=['path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1529f4,_0x149155){var _0x2e5865=function(_0x1fe0c1){while(--_0x1fe0c1){_0x1529f4['push'](_0x1529f4['shift']());}};_0x2e5865(++_0x149155);}(_0x864b,0x156));var _0xb864=function(_0x5b1d6f,_0x51e913){_0x5b1d6f=_0x5b1d6f-0x0;var _0x25a86d=_0x864b[_0x5b1d6f];return _0x25a86d;};'use strict';var _=require(_0xb864('0x0'));var util=require(_0xb864('0x1'));var logger=require(_0xb864('0x2'))('api');var moment=require(_0xb864('0x3'));var BPromise=require(_0xb864('0x4'));var rp=require(_0xb864('0x5'));var fs=require('fs');var path=require(_0xb864('0x6'));var rimraf=require(_0xb864('0x7'));var config=require('../../config/environment');var attributes=require(_0xb864('0x8'));module[_0xb864('0x9')]=function(_0x3b3bc5,_0x58cbb8){return _0x3b3bc5[_0xb864('0xa')](_0xb864('0xb'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index e3ae87a..1c6c3e1 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 _0x88aa=['DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopperBlack','findAll','options','attributes','limit','include','map','model','debug','stringify','UpdateCmHopperBlack','CmHopperBlack','update','body','where'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x88aa,0x1d6));var _0xa88a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x88aa[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xa88a('0x0'));var util=require(_0xa88a('0x1'));var moment=require(_0xa88a('0x2'));var BPromise=require('bluebird');var rs=require(_0xa88a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa88a('0x4'))['db'];var utils=require(_0xa88a('0x5'));var logger=require(_0xa88a('0x6'))('rpc');var config=require(_0xa88a('0x7'));var jayson=require(_0xa88a('0x8'));var client=jayson[_0xa88a('0x9')][_0xa88a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c7002,_0x4b127f,_0x58303d){return new BPromise(function(_0x43c6c0,_0x14c07d){return client[_0xa88a('0xb')](_0x1c7002,_0x58303d)[_0xa88a('0xc')](function(_0xd6835a){logger['info'](_0xa88a('0xd'),_0x4b127f,_0xa88a('0xe'));logger['debug'](_0xa88a('0xf'),_0x4b127f,_0xa88a('0xe'),JSON['stringify'](_0xd6835a));if(_0xd6835a['error']){if(_0xd6835a[_0xa88a('0x10')][_0xa88a('0x11')]===0x1f4){logger[_0xa88a('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4b127f,_0xd6835a['error'][_0xa88a('0x12')]);return _0x14c07d(_0xd6835a[_0xa88a('0x10')][_0xa88a('0x12')]);}logger[_0xa88a('0x10')](_0xa88a('0xd'),_0x4b127f,_0xd6835a[_0xa88a('0x10')][_0xa88a('0x12')]);return _0x43c6c0(_0xd6835a[_0xa88a('0x10')][_0xa88a('0x12')]);}else{logger[_0xa88a('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4b127f,_0xa88a('0xe'));_0x43c6c0(_0xd6835a[_0xa88a('0x14')][_0xa88a('0x12')]);}})[_0xa88a('0x15')](function(_0x236a31){logger[_0xa88a('0x10')](_0xa88a('0xd'),_0x4b127f,_0x236a31);_0x14c07d(_0x236a31);});});}exports[_0xa88a('0x16')]=function(_0x451ef8){var _0x4b7364=this;return new Promise(function(_0x48246d,_0x20abf0){return db['CmHopperBlack'][_0xa88a('0x17')]({'raw':_0x451ef8['options']?_0x451ef8[_0xa88a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x451ef8[_0xa88a('0x18')]?_0x451ef8[_0xa88a('0x18')]['where']||null:null,'attributes':_0x451ef8[_0xa88a('0x18')]?_0x451ef8[_0xa88a('0x18')][_0xa88a('0x19')]||null:null,'limit':_0x451ef8[_0xa88a('0x18')]?_0x451ef8[_0xa88a('0x18')][_0xa88a('0x1a')]||null:null,'include':_0x451ef8[_0xa88a('0x18')]?_0x451ef8[_0xa88a('0x18')][_0xa88a('0x1b')]?_[_0xa88a('0x1c')](_0x451ef8[_0xa88a('0x18')][_0xa88a('0x1b')],function(_0x2a4750){return{'model':db[_0x2a4750['model']],'as':_0x2a4750['as'],'attributes':_0x2a4750[_0xa88a('0x19')],'include':_0x2a4750[_0xa88a('0x1b')]?_[_0xa88a('0x1c')](_0x2a4750[_0xa88a('0x1b')],function(_0x3c688c){return{'model':db[_0x3c688c[_0xa88a('0x1d')]],'as':_0x3c688c['as'],'attributes':_0x3c688c[_0xa88a('0x19')],'include':_0x3c688c['include']?_[_0xa88a('0x1c')](_0x3c688c['include'],function(_0x54dacc){return{'model':db[_0x54dacc['model']],'as':_0x54dacc['as'],'attributes':_0x54dacc['attributes']};}):[]};}):[]};}):[]:[]})[_0xa88a('0xc')](function(_0x4e728f){logger['info'](_0xa88a('0x16'),_0x451ef8);logger[_0xa88a('0x1e')]('GetCmHopperBlack',_0x451ef8,JSON[_0xa88a('0x1f')](_0x4e728f));_0x48246d(_0x4e728f);})[_0xa88a('0x15')](function(_0x34dcf7){logger['error'](_0xa88a('0x16'),_0x34dcf7[_0xa88a('0x12')],_0x451ef8);_0x20abf0(_0x4b7364[_0xa88a('0x10')](0x1f4,_0x34dcf7[_0xa88a('0x12')]));});});};exports[_0xa88a('0x20')]=function(_0x45f4a2){var _0x390f34=this;return new Promise(function(_0x5cc126,_0x256d1c){return db[_0xa88a('0x21')][_0xa88a('0x22')](_0x45f4a2[_0xa88a('0x23')],{'raw':_0x45f4a2['options']?_0x45f4a2[_0xa88a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f4a2['options']?_0x45f4a2[_0xa88a('0x18')][_0xa88a('0x24')]||null:null,'attributes':_0x45f4a2['options']?_0x45f4a2['options'][_0xa88a('0x19')]||null:null,'limit':_0x45f4a2['options']?_0x45f4a2[_0xa88a('0x18')][_0xa88a('0x1a')]||null:null})[_0xa88a('0xc')](function(_0x32d7ce){logger[_0xa88a('0x13')](_0xa88a('0x20'),_0x45f4a2);logger[_0xa88a('0x1e')]('UpdateCmHopperBlack',_0x45f4a2,JSON[_0xa88a('0x1f')](_0x32d7ce));_0x5cc126(_0x32d7ce);})['catch'](function(_0x11f211){logger[_0xa88a('0x10')](_0xa88a('0x20'),_0x11f211[_0xa88a('0x12')],_0x45f4a2);_0x256d1c(_0x390f34[_0xa88a('0x10')](0x1f4,_0x11f211[_0xa88a('0x12')]));});});};exports[_0xa88a('0x25')]=function(_0x2f5f3d){var _0x4fe583=this;return new Promise(function(_0x139bba,_0x507aa9){return db[_0xa88a('0x21')][_0xa88a('0x26')]({'where':_0x2f5f3d[_0xa88a('0x18')]?_0x2f5f3d[_0xa88a('0x18')][_0xa88a('0x24')]||null:null})['then'](function(_0x3517f6){logger[_0xa88a('0x13')](_0xa88a('0x25'),_0x2f5f3d);logger[_0xa88a('0x1e')](_0xa88a('0x25'),_0x2f5f3d,JSON[_0xa88a('0x1f')](_0x3517f6));_0x139bba(_0x3517f6);})[_0xa88a('0x15')](function(_0x339964){logger['error'](_0xa88a('0x25'),_0x339964['message'],_0x2f5f3d);_0x507aa9(_0x4fe583[_0xa88a('0x10')](0x1f4,_0x339964[_0xa88a('0x12')]));});});}; \ No newline at end of file +var _0xd6b6=['attributes','model','update','body','where','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','include','map'];(function(_0x86b88c,_0x157d4a){var _0x5a19f3=function(_0xdc2fd5){while(--_0xdc2fd5){_0x86b88c['push'](_0x86b88c['shift']());}};_0x5a19f3(++_0x157d4a);}(_0xd6b6,0x74));var _0x6d6b=function(_0x13a79b,_0x3b1352){_0x13a79b=_0x13a79b-0x0;var _0x1e173b=_0xd6b6[_0x13a79b];return _0x1e173b;};'use strict';var _=require(_0x6d6b('0x0'));var util=require('util');var moment=require(_0x6d6b('0x1'));var BPromise=require(_0x6d6b('0x2'));var rs=require(_0x6d6b('0x3'));var fs=require('fs');var Redis=require(_0x6d6b('0x4'));var db=require(_0x6d6b('0x5'))['db'];var utils=require(_0x6d6b('0x6'));var logger=require(_0x6d6b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d6b('0x8')][_0x6d6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x445256,_0x2fda84,_0x44064b){return new BPromise(function(_0x4dce0c,_0x1ed947){return client['request'](_0x445256,_0x44064b)[_0x6d6b('0xa')](function(_0x4cf0d8){logger[_0x6d6b('0xb')](_0x6d6b('0xc'),_0x2fda84,_0x6d6b('0xd'));logger[_0x6d6b('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x2fda84,_0x6d6b('0xd'),JSON[_0x6d6b('0xf')](_0x4cf0d8));if(_0x4cf0d8[_0x6d6b('0x10')]){if(_0x4cf0d8['error']['code']===0x1f4){logger[_0x6d6b('0x10')](_0x6d6b('0xc'),_0x2fda84,_0x4cf0d8[_0x6d6b('0x10')][_0x6d6b('0x11')]);return _0x1ed947(_0x4cf0d8['error']['message']);}logger[_0x6d6b('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2fda84,_0x4cf0d8[_0x6d6b('0x10')][_0x6d6b('0x11')]);return _0x4dce0c(_0x4cf0d8[_0x6d6b('0x10')][_0x6d6b('0x11')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x2fda84,_0x6d6b('0xd'));_0x4dce0c(_0x4cf0d8[_0x6d6b('0x12')][_0x6d6b('0x11')]);}})[_0x6d6b('0x13')](function(_0x37018a){logger[_0x6d6b('0x10')](_0x6d6b('0xc'),_0x2fda84,_0x37018a);_0x1ed947(_0x37018a);});});}exports[_0x6d6b('0x14')]=function(_0x5f3363){var _0x49f21b=this;return new Promise(function(_0x16e0e3,_0x3dd102){return db[_0x6d6b('0x15')][_0x6d6b('0x16')]({'raw':_0x5f3363[_0x6d6b('0x17')]?_0x5f3363[_0x6d6b('0x17')][_0x6d6b('0x18')]===undefined?!![]:![]:!![],'where':_0x5f3363[_0x6d6b('0x17')]?_0x5f3363[_0x6d6b('0x17')]['where']||null:null,'attributes':_0x5f3363['options']?_0x5f3363['options']['attributes']||null:null,'limit':_0x5f3363[_0x6d6b('0x17')]?_0x5f3363[_0x6d6b('0x17')][_0x6d6b('0x19')]||null:null,'include':_0x5f3363[_0x6d6b('0x17')]?_0x5f3363[_0x6d6b('0x17')][_0x6d6b('0x1a')]?_[_0x6d6b('0x1b')](_0x5f3363[_0x6d6b('0x17')][_0x6d6b('0x1a')],function(_0x5863fa){return{'model':db[_0x5863fa['model']],'as':_0x5863fa['as'],'attributes':_0x5863fa[_0x6d6b('0x1c')],'include':_0x5863fa['include']?_[_0x6d6b('0x1b')](_0x5863fa[_0x6d6b('0x1a')],function(_0x53f1f4){return{'model':db[_0x53f1f4[_0x6d6b('0x1d')]],'as':_0x53f1f4['as'],'attributes':_0x53f1f4['attributes'],'include':_0x53f1f4[_0x6d6b('0x1a')]?_[_0x6d6b('0x1b')](_0x53f1f4[_0x6d6b('0x1a')],function(_0x3ade0e){return{'model':db[_0x3ade0e[_0x6d6b('0x1d')]],'as':_0x3ade0e['as'],'attributes':_0x3ade0e['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d6b('0xa')](function(_0x35c724){logger[_0x6d6b('0xb')](_0x6d6b('0x14'),_0x5f3363);logger['debug']('GetCmHopperBlack',_0x5f3363,JSON[_0x6d6b('0xf')](_0x35c724));_0x16e0e3(_0x35c724);})[_0x6d6b('0x13')](function(_0xec9857){logger[_0x6d6b('0x10')](_0x6d6b('0x14'),_0xec9857['message'],_0x5f3363);_0x3dd102(_0x49f21b[_0x6d6b('0x10')](0x1f4,_0xec9857[_0x6d6b('0x11')]));});});};exports['UpdateCmHopperBlack']=function(_0x3c32c8){var _0x18ea2a=this;return new Promise(function(_0x2f5258,_0x28c384){return db['CmHopperBlack'][_0x6d6b('0x1e')](_0x3c32c8[_0x6d6b('0x1f')],{'raw':_0x3c32c8[_0x6d6b('0x17')]?_0x3c32c8['options'][_0x6d6b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c32c8['options']?_0x3c32c8[_0x6d6b('0x17')][_0x6d6b('0x20')]||null:null,'attributes':_0x3c32c8[_0x6d6b('0x17')]?_0x3c32c8[_0x6d6b('0x17')][_0x6d6b('0x1c')]||null:null,'limit':_0x3c32c8['options']?_0x3c32c8[_0x6d6b('0x17')][_0x6d6b('0x19')]||null:null})['then'](function(_0x48b2f1){logger[_0x6d6b('0xb')](_0x6d6b('0x21'),_0x3c32c8);logger['debug'](_0x6d6b('0x21'),_0x3c32c8,JSON[_0x6d6b('0xf')](_0x48b2f1));_0x2f5258(_0x48b2f1);})[_0x6d6b('0x13')](function(_0x4cf705){logger['error'](_0x6d6b('0x21'),_0x4cf705[_0x6d6b('0x11')],_0x3c32c8);_0x28c384(_0x18ea2a['error'](0x1f4,_0x4cf705['message']));});});};exports[_0x6d6b('0x22')]=function(_0x519e64){var _0x599c3c=this;return new Promise(function(_0x385935,_0x5e754b){return db[_0x6d6b('0x15')][_0x6d6b('0x23')]({'where':_0x519e64[_0x6d6b('0x17')]?_0x519e64['options'][_0x6d6b('0x20')]||null:null})[_0x6d6b('0xa')](function(_0x3b3a47){logger[_0x6d6b('0xb')](_0x6d6b('0x22'),_0x519e64);logger['debug'](_0x6d6b('0x22'),_0x519e64,JSON[_0x6d6b('0xf')](_0x3b3a47));_0x385935(_0x3b3a47);})[_0x6d6b('0x13')](function(_0x364a15){logger['error'](_0x6d6b('0x22'),_0x364a15[_0x6d6b('0x11')],_0x519e64);_0x5e754b(_0x599c3c[_0x6d6b('0x10')](0x1f4,_0x364a15['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index a8f0f5b..50f9332 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 _0x4c60=['connect-timeout','Router','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','exports','multer','util','path'];(function(_0x3af77d,_0x254082){var _0xb7e375=function(_0x12c27e){while(--_0x12c27e){_0x3af77d['push'](_0x3af77d['shift']());}};_0xb7e375(++_0x254082);}(_0x4c60,0xc1));var _0x04c6=function(_0x1e2fc4,_0x1f267e){_0x1e2fc4=_0x1e2fc4-0x0;var _0x2a89ec=_0x4c60[_0x1e2fc4];return _0x2a89ec;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['describe']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x04c6('0xc')]);router['delete'](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller['destroy']);module[_0x04c6('0xd')]=router; \ No newline at end of file +var _0xc7a3=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x5a58e6,_0x37b8ff){_0x5a58e6=_0x5a58e6-0x0;var _0x3d78a8=_0xc7a3[_0x5a58e6];return _0x3d78a8;};'use strict';var multer=require('multer');var util=require(_0x3c7a('0x0'));var path=require(_0x3c7a('0x1'));var timeout=require(_0x3c7a('0x2'));var express=require(_0x3c7a('0x3'));var router=express[_0x3c7a('0x4')]();var fs_extra=require(_0x3c7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var controller=require('./cmHopperBlack.controller');router[_0x3c7a('0x8')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xa')]);router['get'](_0x3c7a('0xb'),auth['isAuthenticated'](),controller[_0x3c7a('0xc')]);router['get'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xe')]);router['put'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),controller['update']);router[_0x3c7a('0xf')]('/:id',auth[_0x3c7a('0x9')](),controller['destroy']);module[_0x3c7a('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 53d9aad..93df618 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 _0x4e5f=['diff','dispositionat','BOOLEAN','sequelize','exports','INTEGER','DATE','STRING','setDataValue'];(function(_0x360cac,_0x4c0c26){var _0x5406f0=function(_0x410b65){while(--_0x410b65){_0x360cac['push'](_0x360cac['shift']());}};_0x5406f0(++_0x4c0c26);}(_0x4e5f,0x6f));var _0xf4e5=function(_0x26c924,_0x13ab13){_0x26c924=_0x26c924-0x0;var _0xc5bd8e=_0x4e5f[_0x26c924];return _0xc5bd8e;};'use strict';var Sequelize=require(_0xf4e5('0x0'));var moment=require('moment');module[_0xf4e5('0x1')]={'state':{'type':Sequelize[_0xf4e5('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf4e5('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf4e5('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf4e5('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf4e5('0x4')]},'starttime':{'type':Sequelize[_0xf4e5('0x3')]},'responsetime':{'type':Sequelize[_0xf4e5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xf4e5('0x3')]},'endtime':{'type':Sequelize[_0xf4e5('0x3')]},'ringtime':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf4e5('0x4')]},'campaigntype':{'type':Sequelize[_0xf4e5('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xf4e5('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf4e5('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xf4e5('0x3')],'set':function(_0x4a7d66){var _0x31d749=this['getDataValue']('endtime');if(_0x31d749&&_0x4a7d66){this[_0xf4e5('0x5')]('followuptime',moment(_0x4a7d66)[_0xf4e5('0x6')](moment(_0x31d749),'seconds'));}return this[_0xf4e5('0x5')](_0xf4e5('0x7'),_0x4a7d66);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xf4e5('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf4e5('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf4e5('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf4e5('0x3')]},'callback':{'type':Sequelize[_0xf4e5('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf4e5('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf4e5('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e33=['STRING','DATE','getDataValue','endtime','diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x58ad78,_0x526b8c){var _0x4cd93a=function(_0x14f5e7){while(--_0x14f5e7){_0x58ad78['push'](_0x58ad78['shift']());}};_0x4cd93a(++_0x526b8c);}(_0x8e33,0x189));var _0x38e3=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x8e33[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require(_0x38e3('0x0'));var moment=require('moment');module[_0x38e3('0x1')]={'state':{'type':Sequelize[_0x38e3('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x38e3('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x38e3('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x38e3('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x38e3('0x3')]},'originatecalleridname':{'type':Sequelize[_0x38e3('0x3')]},'calleridnum':{'type':Sequelize[_0x38e3('0x3')]},'calleridname':{'type':Sequelize[_0x38e3('0x3')]},'starttime':{'type':Sequelize[_0x38e3('0x4')]},'responsetime':{'type':Sequelize[_0x38e3('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x38e3('0x4')]},'endtime':{'type':Sequelize[_0x38e3('0x4')]},'ringtime':{'type':Sequelize[_0x38e3('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x38e3('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x38e3('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x38e3('0x3')]},'campaign':{'type':Sequelize[_0x38e3('0x3')]},'campaigntype':{'type':Sequelize[_0x38e3('0x3')]},'membername':{'type':Sequelize[_0x38e3('0x3')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x38e3('0x3')]},'secondDisposition':{'type':Sequelize[_0x38e3('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x38e3('0x4')],'set':function(_0x4b48d0){var _0x19fc06=this[_0x38e3('0x5')](_0x38e3('0x6'));if(_0x19fc06&&_0x4b48d0){this['setDataValue']('followuptime',moment(_0x4b48d0)[_0x38e3('0x7')](moment(_0x19fc06),_0x38e3('0x8')));}return this['setDataValue'](_0x38e3('0x9'),_0x4b48d0);}},'amd':{'type':Sequelize[_0x38e3('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x38e3('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x38e3('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x38e3('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x38e3('0x4')]},'deleted':{'type':Sequelize[_0x38e3('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x38e3('0x4')]},'recallme':{'type':Sequelize[_0x38e3('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x38e3('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x38e3('0x2')],'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/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index b85ce96..f1eb4a1 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 _0x2ef3=['params','keys','describe','uniqueid','body','find','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','answeringMachine','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','select','from','calleridnum','state\x20=\x204','group','Campaign','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','CampaignId\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CmHopperFinal','then','includeAll','include','findAll','catch','show'];(function(_0x20f64c,_0x38c397){var _0xa5ac0d=function(_0x1994d2){while(--_0x1994d2){_0x20f64c['push'](_0x20f64c['shift']());}};_0xa5ac0d(++_0x38c397);}(_0x2ef3,0xba));var _0x32ef=function(_0x46e505,_0x30d4ee){_0x46e505=_0x46e505-0x0;var _0x110bed=_0x2ef3[_0x46e505];return _0x110bed;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CmHopperFinal'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CmHopperFinal'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CmHopperFinal']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')]()[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,null))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x30ad49,_0x36a65c){if(_0x30ad49['body'][_0x32ef('0x47')]){delete _0x30ad49[_0x32ef('0x48')][_0x32ef('0x47')];}return db[_0x32ef('0x3d')][_0x32ef('0x49')]({'where':{'uniqueid':_0x30ad49[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x36a65c,null))[_0x32ef('0x3e')](saveUpdates(_0x30ad49[_0x32ef('0x48')],null))[_0x32ef('0x3e')](respondWithResult(_0x36a65c,null))[_0x32ef('0x42')](handleError(_0x36a65c,null));};exports[_0x32ef('0x4a')]=function(_0x272377,_0x326445,_0x307ac8){return db[_0x32ef('0x3d')][_0x32ef('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x272377[_0x32ef('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x4d')))),_0x32ef('0x4e')],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x50')))),'noAnswerContacts'],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x51')))),'busyContacts'],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db['sequelize'][_0x32ef('0x4c')]('`state`\x20=\x208,\x201,\x20null'))),_0x32ef('0x52')],[db[_0x32ef('0x4b')]['fn']('COUNT',db[_0x32ef('0x4b')]['fn']('IF',db['sequelize'][_0x32ef('0x4c')](_0x32ef('0x53')))),_0x32ef('0x54')],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x32ef('0x55')],[db['sequelize']['fn']('COUNT',db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x56')))),_0x32ef('0x57')],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x32ef('0x3e')](handleEntityNotFound(_0x326445,null))[_0x32ef('0x3e')](respondWithResult(_0x326445,null))['catch'](handleError(_0x326445,null));};exports[_0x32ef('0x58')]=function(_0x12e1ef,_0x2b5703,_0x49c245){return db[_0x32ef('0x3d')][_0x32ef('0x41')]({'raw':![],'where':{'CampaignId':_0x12e1ef[_0x32ef('0x44')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x32ef('0x4b')]['fn']('IF',db['sequelize'][_0x32ef('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db['sequelize'][_0x32ef('0x4c')](_0x32ef('0x50')))),_0x32ef('0x59')],[db['sequelize']['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db['sequelize']['literal'](_0x32ef('0x51')))),_0x32ef('0x5a')],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')]['literal'](_0x32ef('0x5b')))),_0x32ef('0x52')],[db[_0x32ef('0x4b')]['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x53')))),_0x32ef('0x54')],[db['sequelize']['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x5c')))),'abandonedContacts'],[db['sequelize']['fn'](_0x32ef('0x4f'),db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')][_0x32ef('0x4c')](_0x32ef('0x56')))),'reCallContacts'],[db[_0x32ef('0x4b')]['fn']('COUNT',db[_0x32ef('0x4b')]['fn']('IF',db[_0x32ef('0x4b')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x32ef('0x5d')]]})[_0x32ef('0x3e')](handleEntityNotFound(_0x2b5703,null))[_0x32ef('0x3e')](respondWithResult(_0x2b5703,null))['catch'](handleError(_0x2b5703,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x3b4a8e,_0x5edd29,_0x7d2c3a){return db[_0x32ef('0x5e')]['find']({'where':{'id':_0x3b4a8e[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x5edd29,null))[_0x32ef('0x3e')](function(_0xd7a78){var _0x9df27c;if(_0xd7a78){_0x9df27c=squel[_0x32ef('0x5f')]()[_0x32ef('0x60')](_0x32ef('0x61'))[_0x32ef('0x62')]([_0x32ef('0x63'),_0x32ef('0x64'),_0x32ef('0x65'),'ListId','VoiceQueueId',_0x32ef('0x66'),_0x32ef('0x67')],squel['select']()[_0x32ef('0x68')]('ANY_VALUE(calleridnum)',_0x32ef('0x63'))[_0x32ef('0x68')](_0x32ef('0x69'),'scheduledAt')[_0x32ef('0x68')]('ANY_VALUE(ContactId)',_0x32ef('0x65'))[_0x32ef('0x68')]('ANY_VALUE(ListId)','ListId')[_0x32ef('0x68')]('ANY_VALUE(VoiceQueueId)',_0x32ef('0x6a'))['field'](_0x32ef('0x69'),_0x32ef('0x66'))[_0x32ef('0x68')]('NOW()','updatedAt')['from'](_0x32ef('0x6b'))['where'](_0x32ef('0x6c'),_0x3b4a8e[_0x32ef('0x44')]['id'][_0x32ef('0x6d')]())[_0x32ef('0x38')](_0x32ef('0x6e'),_0x3b4a8e[_0x32ef('0x48')]['state'][_0x32ef('0x6d')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x32ef('0x38')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x32ef('0x6f')]()[_0x32ef('0x68')]('phone')[_0x32ef('0x70')](_0x32ef('0x61'))[_0x32ef('0x38')](_0x32ef('0x6c'),_0x3b4a8e[_0x32ef('0x44')]['id'][_0x32ef('0x6d')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x32ef('0x6f')]()['field'](_0x32ef('0x71'))[_0x32ef('0x70')](_0x32ef('0x6b'))[_0x32ef('0x38')](_0x32ef('0x6c'),_0x3b4a8e[_0x32ef('0x44')]['id']['toString']())[_0x32ef('0x38')](_0x32ef('0x72')))[_0x32ef('0x73')](_0x32ef('0x65')))[_0x32ef('0x6d')]();return db['sequelize']['query'](_0x9df27c);}return[];})[_0x32ef('0x3e')](respondWithResult(_0x5edd29,null))[_0x32ef('0x42')](handleError(_0x5edd29,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x211fb1,_0x2e333d,_0x338578){return db[_0x32ef('0x74')][_0x32ef('0x49')]({'where':{'id':_0x211fb1[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x2e333d,null))[_0x32ef('0x3e')](function(_0x353641){var _0x54e65d;if(_0x353641){_0x54e65d=squel[_0x32ef('0x5f')]()[_0x32ef('0x60')]('cm_hopper')[_0x32ef('0x62')](['phone',_0x32ef('0x64'),'ContactId',_0x32ef('0x75'),_0x32ef('0x76'),_0x32ef('0x66'),_0x32ef('0x67')],squel['select']()[_0x32ef('0x68')](_0x32ef('0x77'),_0x32ef('0x63'))['field']('NOW()','scheduledAt')[_0x32ef('0x68')](_0x32ef('0x78'),_0x32ef('0x65'))[_0x32ef('0x68')](_0x32ef('0x79'),'ListId')[_0x32ef('0x68')]('ANY_VALUE(CampaignId)',_0x32ef('0x76'))[_0x32ef('0x68')](_0x32ef('0x69'),'createdAt')[_0x32ef('0x68')](_0x32ef('0x69'),_0x32ef('0x67'))[_0x32ef('0x70')](_0x32ef('0x6b'))['where'](_0x32ef('0x7a'),_0x211fb1['params']['id'][_0x32ef('0x6d')]())[_0x32ef('0x38')]('state\x20=\x20?',_0x211fb1['body'][_0x32ef('0x7b')][_0x32ef('0x6d')]())[_0x32ef('0x38')](_0x32ef('0x7c'))['where'](_0x32ef('0x7d'),squel['select']()['field'](_0x32ef('0x63'))['from'](_0x32ef('0x61'))[_0x32ef('0x38')](_0x32ef('0x7a'),_0x211fb1['params']['id']['toString']()))[_0x32ef('0x38')](_0x32ef('0x7d'),squel[_0x32ef('0x6f')]()[_0x32ef('0x68')](_0x32ef('0x71'))[_0x32ef('0x70')](_0x32ef('0x6b'))['where'](_0x32ef('0x7a'),_0x211fb1[_0x32ef('0x44')]['id'][_0x32ef('0x6d')]())[_0x32ef('0x38')]('state\x20=\x204'))['group'](_0x32ef('0x65')))['toString']();return db[_0x32ef('0x4b')][_0x32ef('0x2f')](_0x54e65d);}return[];})['then'](respondWithResult(_0x2e333d,null))['catch'](handleError(_0x2e333d,null));};exports['checkContactHopper']=function(_0x201675,_0x33f6c3,_0xa53375){return db[_0x32ef('0x7e')]['findOne']({'where':{'VoiceQueueId':_0x201675[_0x32ef('0x48')][_0x32ef('0x6a')],'CampaignId':_0x201675[_0x32ef('0x48')]['CampaignId'],'ContactId':_0x201675[_0x32ef('0x48')]['ContactId']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x33f6c3,null))[_0x32ef('0x3e')](function(_0x5f4890){if(_0x5f4890){return _0x5f4890;}return null;})['then'](respondWithResult(_0x33f6c3,null))[_0x32ef('0x42')](handleError(_0x33f6c3,null));}; \ No newline at end of file +var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`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','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x424e89,_0x739bea){var _0x410f30=function(_0x5c0b22){while(--_0x5c0b22){_0x424e89['push'](_0x424e89['shift']());}};_0x410f30(++_0x739bea);}(_0x5fab,0x177));var _0xb5fa=function(_0x53b611,_0x2912fa){_0x53b611=_0x53b611-0x0;var _0x5649aa=_0x5fab[_0x53b611];return _0x5649aa;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 1277150..7dd7eb8 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 _0xe34e=['exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes'];(function(_0x56e5db,_0x4fbff7){var _0x320b2d=function(_0x324788){while(--_0x324788){_0x56e5db['push'](_0x56e5db['shift']());}};_0x320b2d(++_0x4fbff7);}(_0xe34e,0x170));var _0xee34=function(_0x4d9298,_0xa911f3){_0x4d9298=_0x4d9298-0x0;var _0x2cb2be=_0xe34e[_0x4d9298];return _0x2cb2be;};'use strict';var _=require(_0xee34('0x0'));var util=require(_0xee34('0x1'));var logger=require(_0xee34('0x2'))(_0xee34('0x3'));var moment=require(_0xee34('0x4'));var BPromise=require(_0xee34('0x5'));var rp=require(_0xee34('0x6'));var fs=require('fs');var path=require(_0xee34('0x7'));var rimraf=require(_0xee34('0x8'));var config=require('../../config/environment');var attributes=require(_0xee34('0x9'));module[_0xee34('0xa')]=function(_0x1da786,_0x12ed76){return _0x1da786['define'](_0xee34('0xb'),attributes,{'tableName':_0xee34('0xc'),'paranoid':![],'indexes':[{'name':_0xee34('0xd'),'fields':[_0xee34('0xd')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2df6=['request-promise','path','rimraf','define','calleridnum','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x39b1d8,_0xd5e4d9){var _0x18f8d9=function(_0x58c130){while(--_0x58c130){_0x39b1d8['push'](_0x39b1d8['shift']());}};_0x18f8d9(++_0xd5e4d9);}(_0x2df6,0xce));var _0x62df=function(_0x263e6d,_0x585ebb){_0x263e6d=_0x263e6d-0x0;var _0xc8d72=_0x2df6[_0x263e6d];return _0xc8d72;};'use strict';var _=require(_0x62df('0x0'));var util=require('util');var logger=require(_0x62df('0x1'))(_0x62df('0x2'));var moment=require('moment');var BPromise=require(_0x62df('0x3'));var rp=require(_0x62df('0x4'));var fs=require('fs');var path=require(_0x62df('0x5'));var rimraf=require(_0x62df('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0xe53d3,_0x2cd8d7){return _0xe53d3[_0x62df('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x62df('0x8')]},{'name':_0x62df('0x9'),'fields':[_0x62df('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 28703ea..396225a 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(_0x5748b9,_0x5c8df8){var _0x26e96b=function(_0x4e13da){while(--_0x4e13da){_0x5748b9['push'](_0x5748b9['shift']());}};_0x26e96b(++_0x5c8df8);}(_0x7a54,0x106));var _0x47a5=function(_0x2d542a,_0xc644d2){_0x2d542a=_0x2d542a-0x0;var _0x51226e=_0x7a54[_0x2d542a];return _0x51226e;};'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(_0x1fd2cb,_0x4b56a5){var _0x1e0301=function(_0x4233ce){while(--_0x4233ce){_0x1fd2cb['push'](_0x1fd2cb['shift']());}};_0x1e0301(++_0x4b56a5);}(_0xb10b,0x12a));var _0xbb10=function(_0x4df7be,_0x174cea){_0x4df7be=_0x4df7be-0x0;var _0x3c15a4=_0xb10b[_0x4df7be];return _0x3c15a4;};'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 9233c54..a7db62b 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 _0x5a1b=['/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x15579e,_0x4663d4){var _0xcde7ed=function(_0x230655){while(--_0x230655){_0x15579e['push'](_0x15579e['shift']());}};_0xcde7ed(++_0x4663d4);}(_0x5a1b,0xe6));var _0xb5a1=function(_0x18c3e4,_0xdc74f2){_0x18c3e4=_0x18c3e4-0x0;var _0x5ac03a=_0x5a1b[_0x18c3e4];return _0x5ac03a;};'use strict';var multer=require(_0xb5a1('0x0'));var util=require(_0xb5a1('0x1'));var path=require(_0xb5a1('0x2'));var timeout=require(_0xb5a1('0x3'));var express=require(_0xb5a1('0x4'));var router=express['Router']();var fs_extra=require(_0xb5a1('0x5'));var auth=require(_0xb5a1('0x6'));var interaction=require(_0xb5a1('0x7'));var config=require('../../config/environment');var controller=require(_0xb5a1('0x8'));router['get']('/',auth[_0xb5a1('0x9')](),controller[_0xb5a1('0xa')]);router[_0xb5a1('0xb')]('/describe',auth[_0xb5a1('0x9')](),controller[_0xb5a1('0xc')]);router[_0xb5a1('0xb')](_0xb5a1('0xd'),auth['isAuthenticated'](),controller[_0xb5a1('0xe')]);router[_0xb5a1('0xb')](_0xb5a1('0xf'),auth[_0xb5a1('0x9')](),controller[_0xb5a1('0x10')]);router[_0xb5a1('0xb')](_0xb5a1('0x11'),auth[_0xb5a1('0x9')](),controller[_0xb5a1('0x12')]);router[_0xb5a1('0x13')](_0xb5a1('0x14'),auth[_0xb5a1('0x9')](),controller[_0xb5a1('0x15')]);router['post'](_0xb5a1('0x16'),auth['isAuthenticated'](),controller[_0xb5a1('0x17')]);router[_0xb5a1('0x13')](_0xb5a1('0x18'),auth[_0xb5a1('0x9')](),controller[_0xb5a1('0x19')]);router[_0xb5a1('0x1a')](_0xb5a1('0xd'),auth[_0xb5a1('0x9')](),controller[_0xb5a1('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x571a=['/checkContactHopper','checkContactHopper','put','update','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x571a,0xf6));var _0xa571=function(_0x479511,_0x437058){_0x479511=_0x479511-0x0;var _0x321287=_0x571a[_0x479511];return _0x321287;};'use strict';var multer=require(_0xa571('0x0'));var util=require(_0xa571('0x1'));var path=require(_0xa571('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa571('0x3')]();var fs_extra=require(_0xa571('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa571('0x5'));var config=require(_0xa571('0x6'));var controller=require('./cmHopperFinal.controller');router[_0xa571('0x7')]('/',auth[_0xa571('0x8')](),controller['index']);router['get'](_0xa571('0x9'),auth[_0xa571('0x8')](),controller[_0xa571('0xa')]);router['get'](_0xa571('0xb'),auth['isAuthenticated'](),controller[_0xa571('0xc')]);router[_0xa571('0x7')](_0xa571('0xd'),auth[_0xa571('0x8')](),controller[_0xa571('0xe')]);router[_0xa571('0x7')]('/campaign/countAttributes/:id',auth[_0xa571('0x8')](),controller[_0xa571('0xf')]);router[_0xa571('0x10')]('/voice/queue/moveContacts/:id',auth[_0xa571('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router['post'](_0xa571('0x11'),auth[_0xa571('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xa571('0x10')](_0xa571('0x12'),auth['isAuthenticated'](),controller[_0xa571('0x13')]);router[_0xa571('0x14')](_0xa571('0xb'),auth[_0xa571('0x8')](),controller[_0xa571('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 89fd9ea..fdefefb 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 _0xb2d5=['BOOLEAN','STRING','DATE','INTEGER'];(function(_0x39d5dc,_0x5610ea){var _0x5ba4bb=function(_0x49db46){while(--_0x49db46){_0x39d5dc['push'](_0x39d5dc['shift']());}};_0x5ba4bb(++_0x5610ea);}(_0xb2d5,0xed));var _0x5b2d=function(_0x4a269d,_0x51d684){_0x4a269d=_0x4a269d-0x0;var _0xdf7f09=_0xb2d5[_0x4a269d];return _0xdf7f09;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5b2d('0x0')]},'scheduledat':{'type':Sequelize[_0x5b2d('0x1')]},'countbusyretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5b2d('0x0')]},'originatecalleridnum':{'type':Sequelize[_0x5b2d('0x0')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5b2d('0x0')]},'calleridname':{'type':Sequelize[_0x5b2d('0x0')]},'starttime':{'type':Sequelize[_0x5b2d('0x1')]},'responsetime':{'type':Sequelize[_0x5b2d('0x1')]},'answertime':{'type':Sequelize[_0x5b2d('0x1')]},'droptime':{'type':Sequelize[_0x5b2d('0x1')]},'endtime':{'type':Sequelize[_0x5b2d('0x1')]},'ringtime':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5b2d('0x0')]},'campaign':{'type':Sequelize[_0x5b2d('0x0')]},'campaigntype':{'type':Sequelize[_0x5b2d('0x0')]},'membername':{'type':Sequelize[_0x5b2d('0x0')]},'reason':{'type':Sequelize[_0x5b2d('0x0')]},'amd':{'type':Sequelize[_0x5b2d('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5b2d('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x5b2d('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5b2d('0x1')]},'recallme':{'type':Sequelize[_0x5b2d('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x5b2d('0x1')]},'edited':{'type':Sequelize[_0x5b2d('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5b2d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc88e=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x2d2654,_0x25ee79){var _0x10fc9b=function(_0x5c15cc){while(--_0x5c15cc){_0x2d2654['push'](_0x2d2654['shift']());}};_0x10fc9b(++_0x25ee79);}(_0xc88e,0x12e));var _0xec88=function(_0x507d62,_0x1f83cb){_0x507d62=_0x507d62-0x0;var _0xed22f2=_0xc88e[_0x507d62];return _0xed22f2;};'use strict';var Sequelize=require(_0xec88('0x0'));module['exports']={'state':{'type':Sequelize[_0xec88('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xec88('0x2')]},'scheduledat':{'type':Sequelize[_0xec88('0x3')]},'countbusyretry':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xec88('0x2')]},'calleridnum':{'type':Sequelize[_0xec88('0x2')]},'calleridname':{'type':Sequelize[_0xec88('0x2')]},'starttime':{'type':Sequelize[_0xec88('0x3')]},'responsetime':{'type':Sequelize[_0xec88('0x3')]},'answertime':{'type':Sequelize[_0xec88('0x3')]},'droptime':{'type':Sequelize[_0xec88('0x3')]},'endtime':{'type':Sequelize[_0xec88('0x3')]},'ringtime':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xec88('0x2')]},'campaign':{'type':Sequelize[_0xec88('0x2')]},'campaigntype':{'type':Sequelize[_0xec88('0x2')]},'membername':{'type':Sequelize[_0xec88('0x2')]},'reason':{'type':Sequelize[_0xec88('0x2')]},'amd':{'type':Sequelize[_0xec88('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xec88('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xec88('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xec88('0x3')]},'edited':{'type':Sequelize[_0xec88('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xec88('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xec88('0x1')],'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 a48d6e3..de8e72d 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 _0x9b78=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','then','sendStatus','stack','name','send','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','length','find','create','describe','update','body','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv'];(function(_0x35d286,_0x513a62){var _0x160126=function(_0x5b6eb9){while(--_0x5b6eb9){_0x35d286['push'](_0x35d286['shift']());}};_0x160126(++_0x513a62);}(_0x9b78,0x16f));var _0x89b7=function(_0x43fdf8,_0x8426b3){_0x43fdf8=_0x43fdf8-0x0;var _0x1160c6=_0x9b78[_0x43fdf8];return _0x1160c6;};'use strict';var emlformat=require(_0x89b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89b7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x89b7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x89b7('0x3'));var util=require(_0x89b7('0x4'));var path=require(_0x89b7('0x5'));var sox=require(_0x89b7('0x6'));var csv=require(_0x89b7('0x7'));var ejs=require(_0x89b7('0x8'));var fs=require('fs');var fs_extra=require(_0x89b7('0x9'));var _=require(_0x89b7('0xa'));var squel=require(_0x89b7('0xb'));var crypto=require(_0x89b7('0xc'));var jsforce=require(_0x89b7('0xd'));var deskjs=require(_0x89b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x89b7('0xf'));var Papa=require(_0x89b7('0x10'));var Redis=require(_0x89b7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x89b7('0x12'));var hardwareService=require(_0x89b7('0x13'));var logger=require(_0x89b7('0x14'))(_0x89b7('0x15'));var utils=require(_0x89b7('0x16'));var config=require(_0x89b7('0x17'));var licenseUtil=require(_0x89b7('0x18'));var db=require(_0x89b7('0x19'))['db'];function respondWithStatusCode(_0x87eb5b,_0x54a2e2){_0x54a2e2=_0x54a2e2||0xcc;return function(_0x67bebf){if(_0x67bebf){return _0x87eb5b['sendStatus'](_0x54a2e2);}return _0x87eb5b[_0x89b7('0x1a')](_0x54a2e2)[_0x89b7('0x1b')]();};}function respondWithResult(_0x2fbaff,_0x43243a){_0x43243a=_0x43243a||0xc8;return function(_0x46b0c6){if(_0x46b0c6){return _0x2fbaff[_0x89b7('0x1a')](_0x43243a)['json'](_0x46b0c6);}};}function respondWithFilteredResult(_0xd88462,_0x30b04d){return function(_0x56b614){if(_0x56b614){var _0x3596b0=typeof _0x30b04d[_0x89b7('0x1c')]==='undefined'&&typeof _0x30b04d[_0x89b7('0x1d')]===_0x89b7('0x1e');var _0x582fbd=_0x56b614[_0x89b7('0x1f')];var _0x5cbafa=_0x3596b0?0x0:_0x30b04d[_0x89b7('0x1c')];var _0x151de5=_0x3596b0?_0x56b614['count']:_0x30b04d['offset']+_0x30b04d[_0x89b7('0x1d')];var _0x2e2976;if(_0x151de5>=_0x582fbd){_0x151de5=_0x582fbd;_0x2e2976=0xc8;}else{_0x2e2976=0xce;}_0xd88462[_0x89b7('0x1a')](_0x2e2976);return _0xd88462[_0x89b7('0x20')](_0x89b7('0x21'),_0x5cbafa+'-'+_0x151de5+'/'+_0x582fbd)[_0x89b7('0x22')](_0x56b614);}return null;};}function patchUpdates(_0x2e5cd3){return function(_0x3f00cc){try{jsonpatch[_0x89b7('0x23')](_0x3f00cc,_0x2e5cd3,!![]);}catch(_0x18c1a1){return BPromise[_0x89b7('0x24')](_0x18c1a1);}return _0x3f00cc[_0x89b7('0x25')]();};}function saveUpdates(_0x36c3d0,_0xa1ff5e){return function(_0x413345){if(_0x413345){return _0x413345['update'](_0x36c3d0)['then'](function(_0x3ff62d){return _0x3ff62d;});}return null;};}function removeEntity(_0x520bfc,_0x23f978){return function(_0x3d9743){if(_0x3d9743){return _0x3d9743[_0x89b7('0x26')]()[_0x89b7('0x27')](function(){_0x520bfc[_0x89b7('0x1a')](0xcc)[_0x89b7('0x1b')]();});}};}function handleEntityNotFound(_0x31c0fe,_0x334372){return function(_0x116caa){if(!_0x116caa){_0x31c0fe[_0x89b7('0x28')](0x194);}return _0x116caa;};}function handleError(_0x2f5938,_0xf6af3b){_0xf6af3b=_0xf6af3b||0x1f4;return function(_0x4ecfb4){logger['error'](_0x4ecfb4[_0x89b7('0x29')]);if(_0x4ecfb4[_0x89b7('0x2a')]){delete _0x4ecfb4[_0x89b7('0x2a')];}_0x2f5938[_0x89b7('0x1a')](_0xf6af3b)[_0x89b7('0x2b')](_0x4ecfb4);};}exports['index']=function(_0x2854eb,_0x281a35){var _0x4f5592={},_0x4c1979={},_0x379fcd={'count':0x0,'rows':[]};var _0x204e31=_[_0x89b7('0x2c')](db[_0x89b7('0x2d')]['rawAttributes'],function(_0x436989){return{'name':_0x436989[_0x89b7('0x2e')],'type':_0x436989[_0x89b7('0x2f')][_0x89b7('0x30')]};});_0x4c1979[_0x89b7('0x31')]=_['map'](_0x204e31,_0x89b7('0x2a'));_0x4c1979[_0x89b7('0x32')]=_[_0x89b7('0x33')](_0x2854eb[_0x89b7('0x32')]);_0x4c1979[_0x89b7('0x34')]=_[_0x89b7('0x35')](_0x4c1979[_0x89b7('0x31')],_0x4c1979['query']);_0x4f5592[_0x89b7('0x36')]=_[_0x89b7('0x35')](_0x4c1979[_0x89b7('0x31')],qs[_0x89b7('0x37')](_0x2854eb[_0x89b7('0x32')][_0x89b7('0x37')]));_0x4f5592[_0x89b7('0x36')]=_0x4f5592['attributes']['length']?_0x4f5592[_0x89b7('0x36')]:_0x4c1979[_0x89b7('0x31')];if(!_0x2854eb['query'][_0x89b7('0x38')](_0x89b7('0x39'))){_0x4f5592[_0x89b7('0x1d')]=qs[_0x89b7('0x1d')](_0x2854eb[_0x89b7('0x32')][_0x89b7('0x1d')]);_0x4f5592[_0x89b7('0x1c')]=qs[_0x89b7('0x1c')](_0x2854eb[_0x89b7('0x32')][_0x89b7('0x1c')]);}_0x4f5592['order']=qs[_0x89b7('0x3a')](_0x2854eb['query'][_0x89b7('0x3a')]);_0x4f5592[_0x89b7('0x3b')]=qs[_0x89b7('0x34')](_[_0x89b7('0x3c')](_0x2854eb['query'],_0x4c1979[_0x89b7('0x34')]),_0x204e31);if(_0x2854eb[_0x89b7('0x32')][_0x89b7('0x3d')]){_0x4f5592[_0x89b7('0x3b')]=_[_0x89b7('0x3e')](_0x4f5592[_0x89b7('0x3b')],{'$or':_[_0x89b7('0x2c')](_0x204e31,function(_0x46d03f){if(_0x46d03f[_0x89b7('0x2f')]!=='VIRTUAL'){var _0x2b4fee={};_0x2b4fee[_0x46d03f['name']]={'$like':'%'+_0x2854eb[_0x89b7('0x32')][_0x89b7('0x3d')]+'%'};return _0x2b4fee;}})});}_0x4f5592=_[_0x89b7('0x3e')]({},_0x4f5592,_0x2854eb['options']);var _0x33da37={'where':_0x4f5592['where']};return db[_0x89b7('0x2d')][_0x89b7('0x1f')](_0x33da37)['then'](function(_0x2f5ffd){_0x379fcd[_0x89b7('0x1f')]=_0x2f5ffd;if(_0x2854eb[_0x89b7('0x32')]['includeAll']){_0x4f5592[_0x89b7('0x3f')]=[{'all':!![]}];}return db[_0x89b7('0x2d')][_0x89b7('0x40')](_0x4f5592);})[_0x89b7('0x27')](function(_0x332b66){_0x379fcd[_0x89b7('0x41')]=_0x332b66;return _0x379fcd;})[_0x89b7('0x27')](respondWithFilteredResult(_0x281a35,_0x4f5592))[_0x89b7('0x42')](handleError(_0x281a35,null));};exports[_0x89b7('0x43')]=function(_0x196e2f,_0x597f2b){var _0x412fbe={'raw':!![],'where':{'id':_0x196e2f[_0x89b7('0x44')]['id']}},_0x34f919={};_0x34f919[_0x89b7('0x31')]=_['keys'](db[_0x89b7('0x2d')]['rawAttributes']);_0x34f919[_0x89b7('0x32')]=_[_0x89b7('0x33')](_0x196e2f['query']);_0x34f919[_0x89b7('0x34')]=_['intersection'](_0x34f919[_0x89b7('0x31')],_0x34f919[_0x89b7('0x32')]);_0x412fbe['attributes']=_[_0x89b7('0x35')](_0x34f919['model'],qs['fields'](_0x196e2f[_0x89b7('0x32')][_0x89b7('0x37')]));_0x412fbe['attributes']=_0x412fbe[_0x89b7('0x36')][_0x89b7('0x45')]?_0x412fbe[_0x89b7('0x36')]:_0x34f919['model'];if(_0x196e2f[_0x89b7('0x32')]['includeAll']){_0x412fbe[_0x89b7('0x3f')]=[{'all':!![]}];}_0x412fbe=_[_0x89b7('0x3e')]({},_0x412fbe,_0x196e2f['options']);return db[_0x89b7('0x2d')][_0x89b7('0x46')](_0x412fbe)['then'](handleEntityNotFound(_0x597f2b,null))[_0x89b7('0x27')](respondWithResult(_0x597f2b,null))['catch'](handleError(_0x597f2b,null));};exports['create']=function(_0x37453b,_0x3d055e){return db[_0x89b7('0x2d')][_0x89b7('0x47')](_0x37453b['body'],{})[_0x89b7('0x27')](respondWithResult(_0x3d055e,0xc9))[_0x89b7('0x42')](handleError(_0x3d055e,null));};exports[_0x89b7('0x48')]=function(_0x4aa754,_0x59e873){return db[_0x89b7('0x2d')][_0x89b7('0x48')]()[_0x89b7('0x27')](respondWithResult(_0x59e873,null))[_0x89b7('0x42')](handleError(_0x59e873,null));};exports[_0x89b7('0x49')]=function(_0x542013,_0x56fb84){if(_0x542013[_0x89b7('0x4a')]['uniqueid']){delete _0x542013[_0x89b7('0x4a')]['uniqueid'];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x542013[_0x89b7('0x44')]['id']}})[_0x89b7('0x27')](handleEntityNotFound(_0x56fb84,null))[_0x89b7('0x27')](saveUpdates(_0x542013[_0x89b7('0x4a')],null))['then'](respondWithResult(_0x56fb84,null))['catch'](handleError(_0x56fb84,null));}; \ No newline at end of file +var _0x0187=['hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','options','CmHopperHistory','then','includeAll','include','findAll','show','keys','intersection','find','create','body','catch','describe','uniqueid','params','zip-dir','request-promise','moment','bluebird','util','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','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length'];(function(_0x298c8d,_0x3aa00b){var _0x178e04=function(_0x46a335){while(--_0x46a335){_0x298c8d['push'](_0x298c8d['shift']());}};_0x178e04(++_0x3aa00b);}(_0x0187,0xfe));var _0x7018=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x0187[_0x5b7788];return _0x573871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7018('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7018('0x1'));var moment=require(_0x7018('0x2'));var BPromise=require(_0x7018('0x3'));var Mustache=require('mustache');var util=require(_0x7018('0x4'));var path=require('path');var sox=require(_0x7018('0x5'));var csv=require(_0x7018('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7018('0x7'));var _=require(_0x7018('0x8'));var squel=require(_0x7018('0x9'));var crypto=require('crypto');var jsforce=require(_0x7018('0xa'));var deskjs=require(_0x7018('0xb'));var toCsv=require(_0x7018('0x6'));var querystring=require(_0x7018('0xc'));var Papa=require(_0x7018('0xd'));var Redis=require(_0x7018('0xe'));var authService=require(_0x7018('0xf'));var qs=require(_0x7018('0x10'));var as=require(_0x7018('0x11'));var hardwareService=require(_0x7018('0x12'));var logger=require(_0x7018('0x13'))(_0x7018('0x14'));var utils=require(_0x7018('0x15'));var config=require(_0x7018('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7018('0x17'))['db'];function respondWithStatusCode(_0x328fe2,_0x315c07){_0x315c07=_0x315c07||0xcc;return function(_0x531949){if(_0x531949){return _0x328fe2[_0x7018('0x18')](_0x315c07);}return _0x328fe2[_0x7018('0x19')](_0x315c07)['end']();};}function respondWithResult(_0x17387f,_0x1ef964){_0x1ef964=_0x1ef964||0xc8;return function(_0x41302a){if(_0x41302a){return _0x17387f[_0x7018('0x19')](_0x1ef964)['json'](_0x41302a);}};}function respondWithFilteredResult(_0xb716a0,_0x23ac0c){return function(_0x11fb0d){if(_0x11fb0d){var _0x43ef65=typeof _0x23ac0c[_0x7018('0x1a')]==='undefined'&&typeof _0x23ac0c['limit']===_0x7018('0x1b');var _0x251e8a=_0x11fb0d['count'];var _0x3f6f74=_0x43ef65?0x0:_0x23ac0c['offset'];var _0x2852e0=_0x43ef65?_0x11fb0d[_0x7018('0x1c')]:_0x23ac0c[_0x7018('0x1a')]+_0x23ac0c[_0x7018('0x1d')];var _0x1d7f1d;if(_0x2852e0>=_0x251e8a){_0x2852e0=_0x251e8a;_0x1d7f1d=0xc8;}else{_0x1d7f1d=0xce;}_0xb716a0[_0x7018('0x19')](_0x1d7f1d);return _0xb716a0[_0x7018('0x1e')](_0x7018('0x1f'),_0x3f6f74+'-'+_0x2852e0+'/'+_0x251e8a)[_0x7018('0x20')](_0x11fb0d);}return null;};}function patchUpdates(_0x24bd80){return function(_0x4983ca){try{jsonpatch[_0x7018('0x21')](_0x4983ca,_0x24bd80,!![]);}catch(_0x275a9e){return BPromise[_0x7018('0x22')](_0x275a9e);}return _0x4983ca['save']();};}function saveUpdates(_0x555984,_0x5b4195){return function(_0x8ac4f5){if(_0x8ac4f5){return _0x8ac4f5[_0x7018('0x23')](_0x555984)['then'](function(_0x5a8b55){return _0x5a8b55;});}return null;};}function removeEntity(_0x482f62,_0x133253){return function(_0x2dac15){if(_0x2dac15){return _0x2dac15[_0x7018('0x24')]()['then'](function(){_0x482f62[_0x7018('0x19')](0xcc)[_0x7018('0x25')]();});}};}function handleEntityNotFound(_0x34646f,_0x2c3d9a){return function(_0x118ad7){if(!_0x118ad7){_0x34646f[_0x7018('0x18')](0x194);}return _0x118ad7;};}function handleError(_0x4d24bc,_0x527357){_0x527357=_0x527357||0x1f4;return function(_0x5e0d91){logger[_0x7018('0x26')](_0x5e0d91[_0x7018('0x27')]);if(_0x5e0d91[_0x7018('0x28')]){delete _0x5e0d91[_0x7018('0x28')];}_0x4d24bc[_0x7018('0x19')](_0x527357)[_0x7018('0x29')](_0x5e0d91);};}exports[_0x7018('0x2a')]=function(_0x3b89e8,_0x9ed8e7){var _0x229ebd={},_0x13b119={},_0x1ac63f={'count':0x0,'rows':[]};var _0x2bb1d4=_[_0x7018('0x2b')](db['CmHopperHistory'][_0x7018('0x2c')],function(_0x20227d){return{'name':_0x20227d[_0x7018('0x2d')],'type':_0x20227d[_0x7018('0x2e')][_0x7018('0x2f')]};});_0x13b119[_0x7018('0x30')]=_[_0x7018('0x2b')](_0x2bb1d4,_0x7018('0x28'));_0x13b119[_0x7018('0x31')]=_['keys'](_0x3b89e8[_0x7018('0x31')]);_0x13b119[_0x7018('0x32')]=_['intersection'](_0x13b119['model'],_0x13b119['query']);_0x229ebd[_0x7018('0x33')]=_['intersection'](_0x13b119[_0x7018('0x30')],qs['fields'](_0x3b89e8[_0x7018('0x31')][_0x7018('0x34')]));_0x229ebd[_0x7018('0x33')]=_0x229ebd[_0x7018('0x33')][_0x7018('0x35')]?_0x229ebd[_0x7018('0x33')]:_0x13b119['model'];if(!_0x3b89e8[_0x7018('0x31')][_0x7018('0x36')](_0x7018('0x37'))){_0x229ebd[_0x7018('0x1d')]=qs[_0x7018('0x1d')](_0x3b89e8['query'][_0x7018('0x1d')]);_0x229ebd[_0x7018('0x1a')]=qs[_0x7018('0x1a')](_0x3b89e8[_0x7018('0x31')][_0x7018('0x1a')]);}_0x229ebd['order']=qs[_0x7018('0x38')](_0x3b89e8[_0x7018('0x31')][_0x7018('0x38')]);_0x229ebd[_0x7018('0x39')]=qs[_0x7018('0x32')](_[_0x7018('0x3a')](_0x3b89e8[_0x7018('0x31')],_0x13b119[_0x7018('0x32')]),_0x2bb1d4);if(_0x3b89e8[_0x7018('0x31')]['filter']){_0x229ebd[_0x7018('0x39')]=_['merge'](_0x229ebd[_0x7018('0x39')],{'$or':_[_0x7018('0x2b')](_0x2bb1d4,function(_0x4762d7){if(_0x4762d7['type']!==_0x7018('0x3b')){var _0x538fe6={};_0x538fe6[_0x4762d7[_0x7018('0x28')]]={'$like':'%'+_0x3b89e8['query'][_0x7018('0x3c')]+'%'};return _0x538fe6;}})});}_0x229ebd=_['merge']({},_0x229ebd,_0x3b89e8[_0x7018('0x3d')]);var _0x4d76a0={'where':_0x229ebd[_0x7018('0x39')]};return db[_0x7018('0x3e')]['count'](_0x4d76a0)[_0x7018('0x3f')](function(_0x55a32f){_0x1ac63f[_0x7018('0x1c')]=_0x55a32f;if(_0x3b89e8[_0x7018('0x31')][_0x7018('0x40')]){_0x229ebd[_0x7018('0x41')]=[{'all':!![]}];}return db[_0x7018('0x3e')][_0x7018('0x42')](_0x229ebd);})[_0x7018('0x3f')](function(_0x48c423){_0x1ac63f['rows']=_0x48c423;return _0x1ac63f;})[_0x7018('0x3f')](respondWithFilteredResult(_0x9ed8e7,_0x229ebd))['catch'](handleError(_0x9ed8e7,null));};exports[_0x7018('0x43')]=function(_0x589570,_0x2b295e){var _0x53b108={'raw':!![],'where':{'id':_0x589570['params']['id']}},_0x1e4879={};_0x1e4879[_0x7018('0x30')]=_[_0x7018('0x44')](db[_0x7018('0x3e')][_0x7018('0x2c')]);_0x1e4879[_0x7018('0x31')]=_['keys'](_0x589570[_0x7018('0x31')]);_0x1e4879[_0x7018('0x32')]=_[_0x7018('0x45')](_0x1e4879[_0x7018('0x30')],_0x1e4879[_0x7018('0x31')]);_0x53b108[_0x7018('0x33')]=_['intersection'](_0x1e4879[_0x7018('0x30')],qs[_0x7018('0x34')](_0x589570['query']['fields']));_0x53b108[_0x7018('0x33')]=_0x53b108[_0x7018('0x33')]['length']?_0x53b108[_0x7018('0x33')]:_0x1e4879[_0x7018('0x30')];if(_0x589570[_0x7018('0x31')][_0x7018('0x40')]){_0x53b108['include']=[{'all':!![]}];}_0x53b108=_['merge']({},_0x53b108,_0x589570[_0x7018('0x3d')]);return db['CmHopperHistory'][_0x7018('0x46')](_0x53b108)[_0x7018('0x3f')](handleEntityNotFound(_0x2b295e,null))['then'](respondWithResult(_0x2b295e,null))['catch'](handleError(_0x2b295e,null));};exports[_0x7018('0x47')]=function(_0x68b49a,_0x472764){return db[_0x7018('0x3e')][_0x7018('0x47')](_0x68b49a[_0x7018('0x48')],{})['then'](respondWithResult(_0x472764,0xc9))[_0x7018('0x49')](handleError(_0x472764,null));};exports['describe']=function(_0x204bfa,_0x112899){return db[_0x7018('0x3e')][_0x7018('0x4a')]()[_0x7018('0x3f')](respondWithResult(_0x112899,null))[_0x7018('0x49')](handleError(_0x112899,null));};exports[_0x7018('0x23')]=function(_0xf6a81,_0x4e80c9){if(_0xf6a81[_0x7018('0x48')][_0x7018('0x4b')]){delete _0xf6a81[_0x7018('0x48')][_0x7018('0x4b')];}return db[_0x7018('0x3e')][_0x7018('0x46')]({'where':{'uniqueid':_0xf6a81[_0x7018('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4e80c9,null))[_0x7018('0x3f')](saveUpdates(_0xf6a81[_0x7018('0x48')],null))[_0x7018('0x3f')](respondWithResult(_0x4e80c9,null))[_0x7018('0x49')](handleError(_0x4e80c9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index da26213..b5c266a 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 _0xc7bd=['cm_hopper_history','endtime','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x1c362c,_0x475ce8){var _0x452836=function(_0x2d8d5e){while(--_0x2d8d5e){_0x1c362c['push'](_0x1c362c['shift']());}};_0x452836(++_0x475ce8);}(_0xc7bd,0x86));var _0xdc7b=function(_0x2cad2b,_0xcadfb1){_0x2cad2b=_0x2cad2b-0x0;var _0x44e788=_0xc7bd[_0x2cad2b];return _0x44e788;};'use strict';var _=require('lodash');var util=require(_0xdc7b('0x0'));var logger=require(_0xdc7b('0x1'))('api');var moment=require(_0xdc7b('0x2'));var BPromise=require('bluebird');var rp=require(_0xdc7b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc7b('0x4'));var config=require(_0xdc7b('0x5'));var attributes=require(_0xdc7b('0x6'));module[_0xdc7b('0x7')]=function(_0x3d3e2a,_0xe84171){return _0x3d3e2a[_0xdc7b('0x8')]('CmHopperHistory',attributes,{'tableName':_0xdc7b('0x9'),'paranoid':![],'indexes':[{'name':_0xdc7b('0xa'),'fields':[_0xdc7b('0xa')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x29b1=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','endtime'];(function(_0x38da01,_0x174662){var _0x5c4ad1=function(_0x1de927){while(--_0x1de927){_0x38da01['push'](_0x38da01['shift']());}};_0x5c4ad1(++_0x174662);}(_0x29b1,0x16d));var _0x129b=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x29b1[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x129b('0x0'));var util=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var moment=require(_0x129b('0x4'));var BPromise=require('bluebird');var rp=require(_0x129b('0x5'));var fs=require('fs');var path=require(_0x129b('0x6'));var rimraf=require(_0x129b('0x7'));var config=require(_0x129b('0x8'));var attributes=require(_0x129b('0x9'));module[_0x129b('0xa')]=function(_0x31e428,_0xe27ed4){return _0x31e428['define'](_0x129b('0xb'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x129b('0xc'),'fields':[_0x129b('0xc')]},{'name':'uniqueid','fields':[_0x129b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 548f2a5..6e0fe24 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 _0x781f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x262b58,_0x8da791){var _0x5d2470=function(_0x1f7862){while(--_0x1f7862){_0x262b58['push'](_0x262b58['shift']());}};_0x5d2470(++_0x8da791);}(_0x781f,0x13f));var _0xf781=function(_0x11d95f,_0x34f442){_0x11d95f=_0x11d95f-0x0;var _0x2b1a14=_0x781f[_0x11d95f];return _0x2b1a14;};'use strict';var _=require(_0xf781('0x0'));var util=require(_0xf781('0x1'));var moment=require('moment');var BPromise=require(_0xf781('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf781('0x3'));var db=require(_0xf781('0x4'))['db'];var utils=require(_0xf781('0x5'));var logger=require(_0xf781('0x6'))(_0xf781('0x7'));var config=require(_0xf781('0x8'));var jayson=require(_0xf781('0x9'));var client=jayson[_0xf781('0xa')][_0xf781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33b958,_0x595a3a,_0x21b450){return new BPromise(function(_0x51678a,_0x3df5b0){return client[_0xf781('0xc')](_0x33b958,_0x21b450)['then'](function(_0x404523){logger[_0xf781('0xd')](_0xf781('0xe'),_0x595a3a,_0xf781('0xf'));logger[_0xf781('0x10')](_0xf781('0x11'),_0x595a3a,_0xf781('0xf'),JSON[_0xf781('0x12')](_0x404523));if(_0x404523[_0xf781('0x13')]){if(_0x404523[_0xf781('0x13')][_0xf781('0x14')]===0x1f4){logger[_0xf781('0x13')](_0xf781('0xe'),_0x595a3a,_0x404523['error']['message']);return _0x3df5b0(_0x404523[_0xf781('0x13')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x595a3a,_0x404523[_0xf781('0x13')][_0xf781('0x15')]);return _0x51678a(_0x404523['error'][_0xf781('0x15')]);}else{logger['info'](_0xf781('0xe'),_0x595a3a,_0xf781('0xf'));_0x51678a(_0x404523[_0xf781('0x16')][_0xf781('0x15')]);}})['catch'](function(_0x3e95e4){logger['error'](_0xf781('0xe'),_0x595a3a,_0x3e95e4);_0x3df5b0(_0x3e95e4);});});}exports[_0xf781('0x17')]=function(_0xea6a72){var _0x544776=this;return new Promise(function(_0x103a9b,_0x523ffc){return db[_0xf781('0x18')][_0xf781('0x19')](_0xea6a72['body'],{'raw':_0xea6a72[_0xf781('0x1a')]?_0xea6a72['options']['raw']===undefined?!![]:![]:!![]})[_0xf781('0x1b')](function(_0x574c3c){logger['info'](_0xf781('0x17'),_0xea6a72);logger[_0xf781('0x10')](_0xf781('0x17'),_0xea6a72,JSON['stringify'](_0x574c3c));_0x103a9b(_0x574c3c);})['catch'](function(_0x3c21e2){logger[_0xf781('0x13')](_0xf781('0x17'),_0x3c21e2['message'],_0xea6a72);_0x523ffc(_0x544776['error'](0x1f4,_0x3c21e2['message']));});});};exports[_0xf781('0x1c')]=function(_0x5f1215){var _0x1e8ec8=this;return new Promise(function(_0x27755d,_0x35c2e8){return db[_0xf781('0x18')][_0xf781('0x1d')]({'raw':_0x5f1215['options']?_0x5f1215[_0xf781('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5f1215[_0xf781('0x1a')]?_0x5f1215[_0xf781('0x1a')][_0xf781('0x1e')]||null:null,'attributes':[[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')][_0xf781('0x21')]('id')),_0xf781('0x22')],[db['sequelize']['fn']('COUNT',db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x24')))),_0xf781('0x25')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db['sequelize'][_0xf781('0x23')](_0xf781('0x26')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),_0xf781('0x27')],[db[_0xf781('0x1f')]['fn']('AVG',db[_0xf781('0x1f')]['fn']('IF',db['sequelize'][_0xf781('0x23')](_0xf781('0x28')))),_0xf781('0x29')],[db[_0xf781('0x1f')]['fn']('AVG',db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x2a')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x1db632){logger[_0xf781('0xd')]('AvgHandleTime',_0x5f1215);logger[_0xf781('0x10')](_0xf781('0x1c'),_0x5f1215,JSON['stringify'](_0x1db632));_0x27755d(_0x1db632);})['catch'](function(_0xd0b3f5){logger[_0xf781('0x13')]('AvgHandleTime',_0xd0b3f5[_0xf781('0x15')],_0x5f1215);_0x35c2e8(_0x1e8ec8[_0xf781('0x13')](0x1f4,_0xd0b3f5[_0xf781('0x15')]));});});};exports[_0xf781('0x2b')]=function(_0x2bfa5f){var _0x4c6af4=this;return new Promise(function(_0x56b0da,_0x298c4a){return db[_0xf781('0x18')]['findAll']({'raw':_0x2bfa5f[_0xf781('0x1a')]?_0x2bfa5f['options'][_0xf781('0x2c')]===undefined?!![]:![]:!![],'where':_0x2bfa5f[_0xf781('0x1a')]?_0x2bfa5f[_0xf781('0x1a')]['where']||null:null,'attributes':[['campaign',_0xf781('0x2d')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x2e')))),'outboundNoSuchCallsDay'],[db[_0xf781('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xf781('0x23')](_0xf781('0x2f')))),_0xf781('0x30')],[db['sequelize']['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db['sequelize'][_0xf781('0x23')](_0xf781('0x24')))),'outboundAnswerCallsDay'],[db[_0xf781('0x1f')]['fn']('COUNT',db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0xf781('0x31')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf781('0x32')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x33')))),_0xf781('0x34')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db['sequelize'][_0xf781('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0xf781('0x35')],[db['sequelize']['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')]['literal'](_0xf781('0x36')))),'outboundBlacklistCallsDay'],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x37')))),_0xf781('0x38')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x39')))),_0xf781('0x3a')],[db['sequelize']['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db['sequelize']['fn']('IF',db[_0xf781('0x1f')]['literal'](_0xf781('0x3b')))),_0xf781('0x3a')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db[_0xf781('0x1f')][_0xf781('0x23')](_0xf781('0x3c')))),_0xf781('0x3d')]],'group':[_0xf781('0x3e')]})[_0xf781('0x1b')](function(_0x5b7f5d){logger[_0xf781('0xd')]('GetVoiceQueueHopperHistory',_0x2bfa5f);logger[_0xf781('0x10')]('GetVoiceQueueHopperHistory',_0x2bfa5f,JSON[_0xf781('0x12')](_0x5b7f5d));_0x56b0da(_0x5b7f5d);})['catch'](function(_0x4c2b8f){logger[_0xf781('0x13')](_0xf781('0x2b'),_0x4c2b8f[_0xf781('0x15')],_0x2bfa5f);_0x298c4a(_0x4c6af4[_0xf781('0x13')](0x1f4,_0x4c2b8f[_0xf781('0x15')]));});});};exports[_0xf781('0x3f')]=function(_0x2f725a){var _0x50612d=this;return new Promise(function(_0x2a0e33,_0x2089e2){return db[_0xf781('0x18')][_0xf781('0x1d')]({'raw':_0x2f725a[_0xf781('0x1a')]?_0x2f725a[_0xf781('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2f725a[_0xf781('0x1a')]?_0x2f725a[_0xf781('0x1a')][_0xf781('0x1e')]||null:null,'attributes':[['campaign',_0xf781('0x2d')],[db[_0xf781('0x1f')]['fn']('COUNT',db[_0xf781('0x1f')][_0xf781('0x21')]('id')),_0xf781('0x40')],[db[_0xf781('0x1f')]['fn'](_0xf781('0x20'),db[_0xf781('0x1f')]['fn']('IF',db['sequelize'][_0xf781('0x23')](_0xf781('0x24')))),'ivrAnswerCallsDay']],'group':[_0xf781('0x3e')]})[_0xf781('0x1b')](function(_0x36c756){logger[_0xf781('0xd')]('GetCampaignHopperHistory',_0x2f725a);logger[_0xf781('0x10')](_0xf781('0x3f'),_0x2f725a,JSON[_0xf781('0x12')](_0x36c756));_0x2a0e33(_0x36c756);})['catch'](function(_0x2e767c){logger[_0xf781('0x13')](_0xf781('0x3f'),_0x2e767c['message'],_0x2f725a);_0x2089e2(_0x50612d[_0xf781('0x13')](0x1f4,_0x2e767c[_0xf781('0x15')]));});});}; \ No newline at end of file +var _0xd4bd=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','body','options','raw','debug','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','AVG','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','findAll','col','ivrTotalCallsDays','lodash','util','moment','bluebird'];(function(_0x4feda0,_0x13702d){var _0x1a8334=function(_0x3ed85c){while(--_0x3ed85c){_0x4feda0['push'](_0x4feda0['shift']());}};_0x1a8334(++_0x13702d);}(_0xd4bd,0x15f));var _0xdd4b=function(_0x56de9d,_0x413b89){_0x56de9d=_0x56de9d-0x0;var _0x5b63fd=_0xd4bd[_0x56de9d];return _0x5b63fd;};'use strict';var _=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var moment=require(_0xdd4b('0x2'));var BPromise=require(_0xdd4b('0x3'));var rs=require(_0xdd4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd4b('0x5'))['db'];var utils=require(_0xdd4b('0x6'));var logger=require(_0xdd4b('0x7'))(_0xdd4b('0x8'));var config=require(_0xdd4b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdd4b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x543281,_0x4292d3,_0x173584){return new BPromise(function(_0x4ac6a5,_0x521de8){return client[_0xdd4b('0xb')](_0x543281,_0x173584)[_0xdd4b('0xc')](function(_0x5d2a80){logger[_0xdd4b('0xd')](_0xdd4b('0xe'),_0x4292d3,_0xdd4b('0xf'));logger['debug'](_0xdd4b('0x10'),_0x4292d3,_0xdd4b('0xf'),JSON[_0xdd4b('0x11')](_0x5d2a80));if(_0x5d2a80[_0xdd4b('0x12')]){if(_0x5d2a80[_0xdd4b('0x12')][_0xdd4b('0x13')]===0x1f4){logger[_0xdd4b('0x12')](_0xdd4b('0xe'),_0x4292d3,_0x5d2a80['error'][_0xdd4b('0x14')]);return _0x521de8(_0x5d2a80['error'][_0xdd4b('0x14')]);}logger[_0xdd4b('0x12')](_0xdd4b('0xe'),_0x4292d3,_0x5d2a80[_0xdd4b('0x12')][_0xdd4b('0x14')]);return _0x4ac6a5(_0x5d2a80[_0xdd4b('0x12')]['message']);}else{logger['info'](_0xdd4b('0xe'),_0x4292d3,_0xdd4b('0xf'));_0x4ac6a5(_0x5d2a80[_0xdd4b('0x15')][_0xdd4b('0x14')]);}})[_0xdd4b('0x16')](function(_0x17af01){logger[_0xdd4b('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x4292d3,_0x17af01);_0x521de8(_0x17af01);});});}exports[_0xdd4b('0x17')]=function(_0x423e39){var _0xec67fb=this;return new Promise(function(_0x5331d7,_0x3c7e37){return db['CmHopperHistory']['create'](_0x423e39[_0xdd4b('0x18')],{'raw':_0x423e39[_0xdd4b('0x19')]?_0x423e39['options'][_0xdd4b('0x1a')]===undefined?!![]:![]:!![]})[_0xdd4b('0xc')](function(_0xf6eb51){logger[_0xdd4b('0xd')](_0xdd4b('0x17'),_0x423e39);logger[_0xdd4b('0x1b')](_0xdd4b('0x17'),_0x423e39,JSON['stringify'](_0xf6eb51));_0x5331d7(_0xf6eb51);})['catch'](function(_0x2325fe){logger[_0xdd4b('0x12')](_0xdd4b('0x17'),_0x2325fe['message'],_0x423e39);_0x3c7e37(_0xec67fb[_0xdd4b('0x12')](0x1f4,_0x2325fe[_0xdd4b('0x14')]));});});};exports[_0xdd4b('0x1c')]=function(_0x333a3f){var _0x10e7ee=this;return new Promise(function(_0x10b558,_0x4b2013){return db['CmHopperHistory']['findAll']({'raw':_0x333a3f[_0xdd4b('0x19')]?_0x333a3f[_0xdd4b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x333a3f['options']?_0x333a3f[_0xdd4b('0x19')][_0xdd4b('0x1d')]||null:null,'attributes':[[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['col']('id')),_0xdd4b('0x20')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xdd4b('0x22')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x23')))),_0xdd4b('0x24')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x25')))),_0xdd4b('0x26')],[db[_0xdd4b('0x1e')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x27')))),'predictiveIntervalAvgHoldtime'],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x28'),db['sequelize']['fn']('IF',db['sequelize'][_0xdd4b('0x21')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xdd4b('0x29')]]})['then'](function(_0x4c87f8){logger[_0xdd4b('0xd')](_0xdd4b('0x1c'),_0x333a3f);logger['debug'](_0xdd4b('0x1c'),_0x333a3f,JSON[_0xdd4b('0x11')](_0x4c87f8));_0x10b558(_0x4c87f8);})[_0xdd4b('0x16')](function(_0x26abd5){logger[_0xdd4b('0x12')](_0xdd4b('0x1c'),_0x26abd5[_0xdd4b('0x14')],_0x333a3f);_0x4b2013(_0x10e7ee[_0xdd4b('0x12')](0x1f4,_0x26abd5[_0xdd4b('0x14')]));});});};exports[_0xdd4b('0x2a')]=function(_0xcd93c5){var _0x43f99c=this;return new Promise(function(_0x1525ed,_0x41ff94){return db[_0xdd4b('0x2b')]['findAll']({'raw':_0xcd93c5[_0xdd4b('0x19')]?_0xcd93c5[_0xdd4b('0x19')][_0xdd4b('0x1a')]===undefined?!![]:![]:!![],'where':_0xcd93c5[_0xdd4b('0x19')]?_0xcd93c5[_0xdd4b('0x19')][_0xdd4b('0x1d')]||null:null,'attributes':[[_0xdd4b('0x2c'),_0xdd4b('0x2d')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize'][_0xdd4b('0x21')](_0xdd4b('0x2e')))),_0xdd4b('0x2f')],[db['sequelize']['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x30')))),_0xdd4b('0x31')],[db['sequelize']['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')]['literal'](_0xdd4b('0x32')))),_0xdd4b('0x33')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize'][_0xdd4b('0x21')](_0xdd4b('0x34')))),'outboundBusyCallsDay'],[db[_0xdd4b('0x1e')]['fn']('COUNT',db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xdd4b('0x35')))),_0xdd4b('0x36')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db['sequelize']['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x37')))),_0xdd4b('0x38')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize']['literal'](_0xdd4b('0x39')))),'outboundDropCallsDayCallersExit'],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0xdd4b('0x3a')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize'][_0xdd4b('0x21')](_0xdd4b('0x3b')))),_0xdd4b('0x3c')],[db['sequelize']['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db['sequelize'][_0xdd4b('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0xdd4b('0x3d')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x3e')))),_0xdd4b('0x3f')],[db[_0xdd4b('0x1e')]['fn']('COUNT',db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0xdd4b('0x40')],[db[_0xdd4b('0x1e')]['fn']('COUNT',db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x41')))),_0xdd4b('0x3f')],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')]['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xdd4b('0x42')]],'group':['campaign']})[_0xdd4b('0xc')](function(_0x14b7e7){logger[_0xdd4b('0xd')]('GetVoiceQueueHopperHistory',_0xcd93c5);logger['debug']('GetVoiceQueueHopperHistory',_0xcd93c5,JSON[_0xdd4b('0x11')](_0x14b7e7));_0x1525ed(_0x14b7e7);})[_0xdd4b('0x16')](function(_0x39604d){logger[_0xdd4b('0x12')]('GetVoiceQueueHopperHistory',_0x39604d[_0xdd4b('0x14')],_0xcd93c5);_0x41ff94(_0x43f99c[_0xdd4b('0x12')](0x1f4,_0x39604d[_0xdd4b('0x14')]));});});};exports[_0xdd4b('0x43')]=function(_0x5b5e98){var _0x2a26b2=this;return new Promise(function(_0x404c30,_0x444895){return db[_0xdd4b('0x2b')][_0xdd4b('0x44')]({'raw':_0x5b5e98[_0xdd4b('0x19')]?_0x5b5e98[_0xdd4b('0x19')][_0xdd4b('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b5e98[_0xdd4b('0x19')]?_0x5b5e98[_0xdd4b('0x19')][_0xdd4b('0x1d')]||null:null,'attributes':[[_0xdd4b('0x2c'),'name'],[db[_0xdd4b('0x1e')]['fn'](_0xdd4b('0x1f'),db[_0xdd4b('0x1e')][_0xdd4b('0x45')]('id')),_0xdd4b('0x46')],[db[_0xdd4b('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdd4b('0x1e')][_0xdd4b('0x21')](_0xdd4b('0x32')))),'ivrAnswerCallsDay']],'group':[_0xdd4b('0x2c')]})[_0xdd4b('0xc')](function(_0x5bcd21){logger[_0xdd4b('0xd')](_0xdd4b('0x43'),_0x5b5e98);logger['debug']('GetCampaignHopperHistory',_0x5b5e98,JSON[_0xdd4b('0x11')](_0x5bcd21));_0x404c30(_0x5bcd21);})[_0xdd4b('0x16')](function(_0x9e011){logger[_0xdd4b('0x12')](_0xdd4b('0x43'),_0x9e011['message'],_0x5b5e98);_0x444895(_0x2a26b2['error'](0x1f4,_0x9e011[_0xdd4b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 19394f4..a63b14b 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 _0xce82=['../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xce82,0x174));var _0x2ce8=function(_0x568b3f,_0x6ebe07){_0x568b3f=_0x568b3f-0x0;var _0x2440b3=_0xce82[_0x568b3f];return _0x2440b3;};'use strict';var multer=require(_0x2ce8('0x0'));var util=require(_0x2ce8('0x1'));var path=require('path');var timeout=require(_0x2ce8('0x2'));var express=require('express');var router=express[_0x2ce8('0x3')]();var fs_extra=require(_0x2ce8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2ce8('0x5'));var config=require(_0x2ce8('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x2ce8('0x7')]('/',auth[_0x2ce8('0x8')](),controller[_0x2ce8('0x9')]);router[_0x2ce8('0x7')](_0x2ce8('0xa'),auth[_0x2ce8('0x8')](),controller[_0x2ce8('0xb')]);router[_0x2ce8('0x7')]('/:id',auth[_0x2ce8('0x8')](),controller['show']);router[_0x2ce8('0xc')]('/',auth[_0x2ce8('0x8')](),controller[_0x2ce8('0xd')]);router[_0x2ce8('0xe')](_0x2ce8('0xf'),auth['isAuthenticated'](),controller[_0x2ce8('0x10')]);module[_0x2ce8('0x11')]=router; \ No newline at end of file +var _0x95a5=['index','/describe','describe','/:id','post','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x468050,_0x27407c){var _0xcf6c75=function(_0x24c6d9){while(--_0x24c6d9){_0x468050['push'](_0x468050['shift']());}};_0xcf6c75(++_0x27407c);}(_0x95a5,0x81));var _0x595a=function(_0x523d0e,_0x279013){_0x523d0e=_0x523d0e-0x0;var _0x218d78=_0x95a5[_0x523d0e];return _0x218d78;};'use strict';var multer=require(_0x595a('0x0'));var util=require(_0x595a('0x1'));var path=require(_0x595a('0x2'));var timeout=require('connect-timeout');var express=require(_0x595a('0x3'));var router=express[_0x595a('0x4')]();var fs_extra=require(_0x595a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x595a('0x6'));var config=require(_0x595a('0x7'));var controller=require(_0x595a('0x8'));router[_0x595a('0x9')]('/',auth[_0x595a('0xa')](),controller[_0x595a('0xb')]);router[_0x595a('0x9')](_0x595a('0xc'),auth['isAuthenticated'](),controller[_0x595a('0xd')]);router[_0x595a('0x9')](_0x595a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x595a('0xf')]('/',auth['isAuthenticated'](),controller[_0x595a('0x10')]);router[_0x595a('0x11')](_0x595a('0xe'),auth[_0x595a('0xa')](),controller[_0x595a('0x12')]);module[_0x595a('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 45a62f7..4a65f40 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 _0x18d6=['name','STRING','sequelize','exports'];(function(_0x405183,_0x21609f){var _0x3f4ef8=function(_0x4f17ec){while(--_0x4f17ec){_0x405183['push'](_0x405183['shift']());}};_0x3f4ef8(++_0x21609f);}(_0x18d6,0x166));var _0x618d=function(_0x49ea73,_0x4a82c0){_0x49ea73=_0x49ea73-0x0;var _0x4a7ef0=_0x18d6[_0x49ea73];return _0x4a7ef0;};'use strict';var Sequelize=require(_0x618d('0x0'));module[_0x618d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x618d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x618d('0x3')]},'dialPrefix':{'type':Sequelize[_0x618d('0x3')]}}; \ No newline at end of file +var _0x295f=['exports','STRING','name'];(function(_0x50599f,_0x47ff82){var _0x3a389=function(_0x14a7fe){while(--_0x14a7fe){_0x50599f['push'](_0x50599f['shift']());}};_0x3a389(++_0x47ff82);}(_0x295f,0x168));var _0xf295=function(_0x5bed85,_0x50bf6b){_0x5bed85=_0x5bed85-0x0;var _0x3c4984=_0x295f[_0x5bed85];return _0x3c4984;};'use strict';var Sequelize=require('sequelize');module[_0xf295('0x0')]={'name':{'type':Sequelize[_0xf295('0x1')],'unique':_0xf295('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xf295('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 6d269e2..d2332fe 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 _0x3880=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Lists','end','error','stack','name','send','index','map','CmList','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','show','params','keys','rawAttributes','includeAll','include','options','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','nolimit','removeDispositions','addContacts','CmContact','isArray','tags','each','ids','push','errors','message','Malformed\x20request\x20syntax','CustomFields','concat','raw','getContacts','getContactsCsv','CmCustomField','format','cf_%d','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','sequelize','addCustomFields','Sequelize','TEXT','text','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x2bfb14,_0x23e447){var _0x4688c6=function(_0x559e20){while(--_0x559e20){_0x2bfb14['push'](_0x2bfb14['shift']());}};_0x4688c6(++_0x23e447);}(_0x3880,0x88));var _0x0388=function(_0xcecfd,_0x25c2f9){_0xcecfd=_0xcecfd-0x0;var _0x507144=_0x3880[_0xcecfd];return _0x507144;};'use strict';var emlformat=require(_0x0388('0x0'));var rimraf=require(_0x0388('0x1'));var zipdir=require(_0x0388('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0388('0x3'));var moment=require(_0x0388('0x4'));var BPromise=require(_0x0388('0x5'));var Mustache=require(_0x0388('0x6'));var util=require(_0x0388('0x7'));var path=require('path');var sox=require(_0x0388('0x8'));var csv=require(_0x0388('0x9'));var ejs=require(_0x0388('0xa'));var fs=require('fs');var fs_extra=require(_0x0388('0xb'));var _=require(_0x0388('0xc'));var squel=require('squel');var crypto=require(_0x0388('0xd'));var jsforce=require(_0x0388('0xe'));var deskjs=require(_0x0388('0xf'));var toCsv=require(_0x0388('0x9'));var querystring=require(_0x0388('0x10'));var Papa=require(_0x0388('0x11'));var Redis=require(_0x0388('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0388('0x13'));var as=require(_0x0388('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0388('0x15'))(_0x0388('0x16'));var utils=require(_0x0388('0x17'));var config=require(_0x0388('0x18'));var licenseUtil=require(_0x0388('0x19'));var db=require(_0x0388('0x1a'))['db'];config[_0x0388('0x1b')]=_[_0x0388('0x1c')](config[_0x0388('0x1b')],{'host':_0x0388('0x1d'),'port':0x18eb});var socket=require(_0x0388('0x1e'))(new Redis(config[_0x0388('0x1b')]));require('./cmList.socket')[_0x0388('0x1f')](socket);function respondWithStatusCode(_0x18387c,_0xa1d59a){_0xa1d59a=_0xa1d59a||0xcc;return function(_0x4071b0){if(_0x4071b0){return _0x18387c[_0x0388('0x20')](_0xa1d59a);}return _0x18387c[_0x0388('0x21')](_0xa1d59a)['end']();};}function respondWithResult(_0x2d12e0,_0x327e55){_0x327e55=_0x327e55||0xc8;return function(_0x4a18b6){if(_0x4a18b6){return _0x2d12e0[_0x0388('0x21')](_0x327e55)[_0x0388('0x22')](_0x4a18b6);}};}function respondWithFilteredResult(_0x48aafc,_0x3555e8){return function(_0x2e396d){if(_0x2e396d){var _0x38433e=typeof _0x3555e8[_0x0388('0x23')]===_0x0388('0x24')&&typeof _0x3555e8[_0x0388('0x25')]===_0x0388('0x24');var _0x4b1124=_0x2e396d[_0x0388('0x26')];var _0x1d6f31=_0x38433e?0x0:_0x3555e8[_0x0388('0x23')];var _0xd40e48=_0x38433e?_0x2e396d[_0x0388('0x26')]:_0x3555e8[_0x0388('0x23')]+_0x3555e8[_0x0388('0x25')];var _0x48396b;if(_0xd40e48>=_0x4b1124){_0xd40e48=_0x4b1124;_0x48396b=0xc8;}else{_0x48396b=0xce;}_0x48aafc['status'](_0x48396b);return _0x48aafc[_0x0388('0x27')](_0x0388('0x28'),_0x1d6f31+'-'+_0xd40e48+'/'+_0x4b1124)[_0x0388('0x22')](_0x2e396d);}return null;};}function patchUpdates(_0x16d568){return function(_0x4c2f74){try{jsonpatch[_0x0388('0x29')](_0x4c2f74,_0x16d568,!![]);}catch(_0x4c457b){return BPromise[_0x0388('0x2a')](_0x4c457b);}return _0x4c2f74['save']();};}function saveUpdates(_0x38b85a,_0x19f9b4){return function(_0x4891c1){if(_0x4891c1){return _0x4891c1[_0x0388('0x2b')](_0x38b85a)[_0x0388('0x2c')](function(_0x484c3e){return _0x484c3e;});}return null;};}function removeEntity(_0x378a32,_0x3afd37){return function(_0x4846c9){if(_0x4846c9){return _0x4846c9[_0x0388('0x2d')]()[_0x0388('0x2c')](function(){var _0x218d18=_0x4846c9['get']({'plain':!![]});var _0x2ad97a=_0x0388('0x2e');return db['UserProfileResource'][_0x0388('0x2d')]({'where':{'type':_0x2ad97a,'resourceId':_0x218d18['id']}})[_0x0388('0x2c')](function(){return _0x4846c9;});})[_0x0388('0x2c')](function(){_0x378a32[_0x0388('0x21')](0xcc)[_0x0388('0x2f')]();});}};}function handleEntityNotFound(_0x130d90,_0x8cee80){return function(_0x5636c9){if(!_0x5636c9){_0x130d90[_0x0388('0x20')](0x194);}return _0x5636c9;};}function handleError(_0x5be191,_0x1239c2){_0x1239c2=_0x1239c2||0x1f4;return function(_0xd0930a){logger[_0x0388('0x30')](_0xd0930a[_0x0388('0x31')]);if(_0xd0930a[_0x0388('0x32')]){delete _0xd0930a[_0x0388('0x32')];}_0x5be191[_0x0388('0x21')](_0x1239c2)[_0x0388('0x33')](_0xd0930a);};}exports[_0x0388('0x34')]=function(_0x38a6a2,_0x425b27){var _0x2531b8={},_0x348ef4={},_0x47f0a4={'count':0x0,'rows':[]};var _0x5402dc=_[_0x0388('0x35')](db[_0x0388('0x36')]['rawAttributes'],function(_0x56197c){return{'name':_0x56197c['fieldName'],'type':_0x56197c[_0x0388('0x37')][_0x0388('0x38')]};});_0x348ef4[_0x0388('0x39')]=_[_0x0388('0x35')](_0x5402dc,'name');_0x348ef4[_0x0388('0x3a')]=_['keys'](_0x38a6a2[_0x0388('0x3a')]);_0x348ef4['filters']=_[_0x0388('0x3b')](_0x348ef4['model'],_0x348ef4[_0x0388('0x3a')]);_0x2531b8[_0x0388('0x3c')]=_['intersection'](_0x348ef4[_0x0388('0x39')],qs['fields'](_0x38a6a2[_0x0388('0x3a')][_0x0388('0x3d')]));_0x2531b8[_0x0388('0x3c')]=_0x2531b8[_0x0388('0x3c')][_0x0388('0x3e')]?_0x2531b8['attributes']:_0x348ef4[_0x0388('0x39')];if(!_0x38a6a2[_0x0388('0x3a')][_0x0388('0x3f')]('nolimit')){_0x2531b8[_0x0388('0x25')]=qs[_0x0388('0x25')](_0x38a6a2['query'][_0x0388('0x25')]);_0x2531b8[_0x0388('0x23')]=qs[_0x0388('0x23')](_0x38a6a2[_0x0388('0x3a')][_0x0388('0x23')]);}_0x2531b8[_0x0388('0x40')]=qs[_0x0388('0x41')](_0x38a6a2[_0x0388('0x3a')]['sort']);_0x2531b8[_0x0388('0x42')]=qs[_0x0388('0x43')](_[_0x0388('0x44')](_0x38a6a2[_0x0388('0x3a')],_0x348ef4[_0x0388('0x43')]),_0x5402dc);if(_0x38a6a2[_0x0388('0x3a')][_0x0388('0x45')]){_0x2531b8[_0x0388('0x42')]=_[_0x0388('0x46')](_0x2531b8[_0x0388('0x42')],{'$or':_[_0x0388('0x35')](_0x5402dc,function(_0x4f717e){if(_0x4f717e['type']!==_0x0388('0x47')){var _0x76910d={};_0x76910d[_0x4f717e[_0x0388('0x32')]]={'$like':'%'+_0x38a6a2[_0x0388('0x3a')][_0x0388('0x45')]+'%'};return _0x76910d;}})});}_0x2531b8=_['merge']({},_0x2531b8,_0x38a6a2['options']);var _0x50cd94={'where':_0x2531b8['where']};return db['CmList'][_0x0388('0x26')](_0x50cd94)[_0x0388('0x2c')](function(_0x1c8981){_0x47f0a4[_0x0388('0x26')]=_0x1c8981;if(_0x38a6a2['query']['includeAll']){_0x2531b8['include']=[{'all':!![]}];}return db[_0x0388('0x36')][_0x0388('0x48')](_0x2531b8);})[_0x0388('0x2c')](function(_0x2bf30a){_0x47f0a4['rows']=_0x2bf30a;return _0x47f0a4;})[_0x0388('0x2c')](respondWithFilteredResult(_0x425b27,_0x2531b8))['catch'](handleError(_0x425b27,null));};exports[_0x0388('0x49')]=function(_0x59ab8d,_0xe7cf5f){var _0x127b7f={'raw':![],'where':{'id':_0x59ab8d[_0x0388('0x4a')]['id']}},_0x119e6e={};_0x119e6e[_0x0388('0x39')]=_[_0x0388('0x4b')](db[_0x0388('0x36')][_0x0388('0x4c')]);_0x119e6e['query']=_[_0x0388('0x4b')](_0x59ab8d[_0x0388('0x3a')]);_0x119e6e[_0x0388('0x43')]=_[_0x0388('0x3b')](_0x119e6e[_0x0388('0x39')],_0x119e6e[_0x0388('0x3a')]);_0x127b7f['attributes']=_[_0x0388('0x3b')](_0x119e6e['model'],qs[_0x0388('0x3d')](_0x59ab8d[_0x0388('0x3a')][_0x0388('0x3d')]));_0x127b7f[_0x0388('0x3c')]=_0x127b7f[_0x0388('0x3c')][_0x0388('0x3e')]?_0x127b7f[_0x0388('0x3c')]:_0x119e6e[_0x0388('0x39')];if(_0x59ab8d[_0x0388('0x3a')][_0x0388('0x4d')]){_0x127b7f[_0x0388('0x4e')]=[{'all':!![]}];}_0x127b7f=_[_0x0388('0x46')]({},_0x127b7f,_0x59ab8d[_0x0388('0x4f')]);return db[_0x0388('0x36')]['find'](_0x127b7f)[_0x0388('0x2c')](handleEntityNotFound(_0xe7cf5f,null))[_0x0388('0x2c')](respondWithResult(_0xe7cf5f,null))[_0x0388('0x50')](handleError(_0xe7cf5f,null));};exports[_0x0388('0x51')]=function(_0x37a0ad,_0x485ac3){return db[_0x0388('0x36')][_0x0388('0x51')](_0x37a0ad[_0x0388('0x52')],{})[_0x0388('0x2c')](function(_0x58c65f){var _0x5819a3=_0x37a0ad['user'][_0x0388('0x53')]({'plain':!![]});if(!_0x5819a3)throw new Error(_0x0388('0x54'));if(_0x5819a3['role']==='user'){var _0x20ff14=_0x58c65f['get']({'plain':!![]});var _0x43c641=_0x0388('0x2e');return db[_0x0388('0x55')][_0x0388('0x56')]({'where':{'name':_0x43c641,'userProfileId':_0x5819a3[_0x0388('0x57')]},'raw':!![]})[_0x0388('0x2c')](function(_0x34cd59){if(_0x34cd59&&_0x34cd59[_0x0388('0x58')]===0x0){return db['UserProfileResource'][_0x0388('0x51')]({'name':_0x20ff14[_0x0388('0x32')],'resourceId':_0x20ff14['id'],'type':_0x34cd59[_0x0388('0x32')],'sectionId':_0x34cd59['id']},{})[_0x0388('0x2c')](function(){return _0x58c65f;});}else{return _0x58c65f;}})[_0x0388('0x50')](function(_0x3a35cb){logger['error'](_0x0388('0x59'),_0x3a35cb);throw _0x3a35cb;});}return _0x58c65f;})[_0x0388('0x2c')](respondWithResult(_0x485ac3,0xc9))[_0x0388('0x50')](handleError(_0x485ac3,null));};exports[_0x0388('0x2b')]=function(_0x188407,_0x462d8b){if(_0x188407['body']['id']){delete _0x188407[_0x0388('0x52')]['id'];}return db[_0x0388('0x36')][_0x0388('0x56')]({'where':{'id':_0x188407[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x462d8b,null))[_0x0388('0x2c')](saveUpdates(_0x188407[_0x0388('0x52')],null))[_0x0388('0x2c')](respondWithResult(_0x462d8b,null))[_0x0388('0x50')](handleError(_0x462d8b,null));};exports[_0x0388('0x2d')]=function(_0x2395e1,_0x283431){return db[_0x0388('0x36')]['find']({'where':{'id':_0x2395e1[_0x0388('0x4a')]['id']}})[_0x0388('0x2c')](handleEntityNotFound(_0x283431,null))[_0x0388('0x2c')](removeEntity(_0x283431,null))['catch'](handleError(_0x283431,null));};exports[_0x0388('0x5a')]=function(_0x4b5538,_0x4b8b5a){return db['CmList']['describe']()['then'](respondWithResult(_0x4b8b5a,null))['catch'](handleError(_0x4b8b5a,null));};exports[_0x0388('0x5b')]=function(_0x1f41e1,_0x3ef690,_0x33d571){if(_0x1f41e1[_0x0388('0x52')]['id']){delete _0x1f41e1['body']['id'];}return db[_0x0388('0x36')][_0x0388('0x56')]({'where':{'id':_0x1f41e1[_0x0388('0x4a')]['id']}})[_0x0388('0x2c')](handleEntityNotFound(_0x3ef690,null))[_0x0388('0x2c')](function(_0x472795){if(_0x472795){_0x1f41e1[_0x0388('0x52')][_0x0388('0x5c')]=_0x472795['id'];return db[_0x0388('0x5d')][_0x0388('0x51')](_0x1f41e1[_0x0388('0x52')]);}})[_0x0388('0x2c')](respondWithResult(_0x3ef690,null))[_0x0388('0x50')](handleError(_0x3ef690,null));};exports[_0x0388('0x5e')]=function(_0x4fe3c4,_0x243572,_0x2ccc16){var _0x122997={'raw':![],'where':{}};var _0x2825f1={};var _0x1016ed={'count':0x0,'rows':[]};return db[_0x0388('0x36')]['findOne']({'where':{'id':_0x4fe3c4['params']['id']}})['then'](handleEntityNotFound(_0x243572,null))['then'](function(_0x300399){if(_0x300399){_0x2825f1[_0x0388('0x39')]=_['keys'](db[_0x0388('0x5d')][_0x0388('0x4c')]);_0x2825f1[_0x0388('0x3a')]=_['keys'](_0x4fe3c4[_0x0388('0x3a')]);_0x2825f1[_0x0388('0x43')]=_[_0x0388('0x3b')](_0x2825f1[_0x0388('0x39')],_0x2825f1[_0x0388('0x3a')]);_0x122997[_0x0388('0x3c')]=_[_0x0388('0x3b')](_0x2825f1[_0x0388('0x39')],qs[_0x0388('0x3d')](_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x3d')]));_0x122997['attributes']=_0x122997[_0x0388('0x3c')][_0x0388('0x3e')]?_0x122997[_0x0388('0x3c')]:_0x2825f1[_0x0388('0x39')];if(!_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x3f')](_0x0388('0x5f'))){_0x122997[_0x0388('0x25')]=qs[_0x0388('0x25')](_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x25')]);_0x122997[_0x0388('0x23')]=qs[_0x0388('0x23')](_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x23')]);}_0x122997['order']=qs[_0x0388('0x41')](_0x4fe3c4['query'][_0x0388('0x41')]);_0x122997[_0x0388('0x42')]=qs[_0x0388('0x43')](_['pick'](_0x4fe3c4[_0x0388('0x3a')],_0x2825f1[_0x0388('0x43')]));_0x122997[_0x0388('0x42')]['ListId']=_0x300399['id'];if(_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x45')]){_0x122997['where']=_[_0x0388('0x46')](_0x122997['where'],{'$or':_[_0x0388('0x35')](_0x122997[_0x0388('0x3c')],function(_0x167326){var _0x54d839={};_0x54d839[_0x167326]={'$like':'%'+_0x4fe3c4[_0x0388('0x3a')][_0x0388('0x45')]+'%'};return _0x54d839;})});}_0x122997=_['merge']({},_0x122997,_0x4fe3c4['options']);return db[_0x0388('0x5d')][_0x0388('0x26')]({'where':_0x122997[_0x0388('0x42')]})[_0x0388('0x2c')](function(_0x5e57ca){_0x1016ed[_0x0388('0x26')]=_0x5e57ca;if(_0x4fe3c4['query'][_0x0388('0x4d')]){_0x122997['include']=[{'all':!![]}];}return db['Disposition'][_0x0388('0x48')](_0x122997);})['then'](function(_0x13e7c8){_0x1016ed['rows']=_0x13e7c8;return _0x1016ed;});}})[_0x0388('0x2c')](respondWithFilteredResult(_0x243572,_0x122997))[_0x0388('0x50')](handleError(_0x243572,null));};exports[_0x0388('0x60')]=function(_0x428fe8,_0x39fe37,_0x4e9b98){return db['CmList'][_0x0388('0x56')]({'where':{'id':_0x428fe8[_0x0388('0x4a')]['id']}})[_0x0388('0x2c')](handleEntityNotFound(_0x39fe37,null))[_0x0388('0x2c')](function(_0x4e638d){if(_0x4e638d){return _0x4e638d[_0x0388('0x60')](_0x428fe8['query']['ids']);}})[_0x0388('0x2c')](respondWithStatusCode(_0x39fe37,null))[_0x0388('0x50')](handleError(_0x39fe37,null));};exports[_0x0388('0x61')]=function(_0x58d45f,_0x38e8e6,_0xda79b2){return db[_0x0388('0x36')][_0x0388('0x56')]({'where':{'id':_0x58d45f[_0x0388('0x4a')]['id']}})[_0x0388('0x2c')](handleEntityNotFound(_0x38e8e6,null))[_0x0388('0x2c')](function(_0x130004){if(_0x130004){var _0xfc0539=[];var _0xbf0b7b={'success':[],'errors':[]};return db[_0x0388('0x62')][_0x0388('0x5a')]()[_0x0388('0x2c')](function(_0x47a414){if(_0x58d45f[_0x0388('0x52')]['tags']&&_[_0x0388('0x63')](_0x58d45f[_0x0388('0x52')][_0x0388('0x64')])){if(_0x58d45f['body'][_0x0388('0x64')][_0x0388('0x3e')]){_0x58d45f[_0x0388('0x52')][_0x0388('0x64')]=_0x58d45f[_0x0388('0x52')][_0x0388('0x64')]['join'](';')+';';}else{_0x58d45f[_0x0388('0x52')][_0x0388('0x64')]=null;}}else{_0x58d45f[_0x0388('0x52')]['tags']=null;}if(_0x58d45f['body']&&_[_0x0388('0x63')](_0x58d45f[_0x0388('0x52')])){for(var _0x3a3d01=0x0;_0x3a3d01<_0x58d45f[_0x0388('0x52')][_0x0388('0x3e')];_0x3a3d01+=0x1){_0x58d45f[_0x0388('0x52')][_0x3a3d01][_0x0388('0x5c')]=_0x58d45f[_0x0388('0x4a')]['id'];_0xfc0539['push'](_0x58d45f[_0x0388('0x52')][_0x3a3d01]);}return BPromise[_0x0388('0x65')](_0xfc0539,function(_0x11ca29){return db[_0x0388('0x62')][_0x0388('0x51')](_['omit'](_0x11ca29,[_0x0388('0x66'),'id'])||{},{'fields':_[_0x0388('0x4b')](_0x47a414),'raw':!![]})[_0x0388('0x2c')](function(_0x2b3701){_0xbf0b7b['success'][_0x0388('0x67')](_0x2b3701['dataValues']);})[_0x0388('0x50')](function(_0x37e3cd){_0xbf0b7b[_0x0388('0x68')]['push']({'data':_0x11ca29,'error':_0x37e3cd[_0x0388('0x69')]});});})[_0x0388('0x2c')](function(_0x482a96){return _0xbf0b7b;})[_0x0388('0x50')](function(_0x112af1){return _0x112af1;});}else{_0x38e8e6['status'](0x190)['json']({'message':_0x0388('0x6a')});}});}})['then'](respondWithResult(_0x38e8e6,null))[_0x0388('0x50')](handleError(_0x38e8e6,null));};exports['getContacts']=function(_0x54b893,_0x17424a,_0x48305e){var _0x5d40e0;return db[_0x0388('0x36')]['find']({'where':{'id':_0x54b893[_0x0388('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x0388('0x6b')}]})[_0x0388('0x2c')](handleEntityNotFound(_0x17424a,null))[_0x0388('0x2c')](function(_0x50de8c){if(_0x50de8c){_0x5d40e0=_0x50de8c;return db[_0x0388('0x62')][_0x0388('0x4c')];}})[_0x0388('0x2c')](function(_0x2d0527){if(_0x2d0527){var _0x5336fa={};var _0x5e358b={};_0x5e358b['model']=_[_0x0388('0x6c')](_[_0x0388('0x4b')](_0x2d0527),_[_0x0388('0x35')](_0x5d40e0[_0x0388('0x6b')],function(_0x1312c0){return util['format']('cf_%d',_0x1312c0['id']);}));_0x5e358b[_0x0388('0x3a')]=_['keys'](_0x54b893[_0x0388('0x3a')]);_0x5e358b[_0x0388('0x43')]=_[_0x0388('0x3b')](_0x5e358b[_0x0388('0x39')],_0x5e358b[_0x0388('0x3a')]);_0x5336fa['attributes']=_[_0x0388('0x3b')](_0x5e358b[_0x0388('0x39')],qs[_0x0388('0x3d')](_0x54b893['query'][_0x0388('0x3d')]));_0x5336fa['attributes']=_0x5336fa['attributes'][_0x0388('0x3e')]?_0x5336fa[_0x0388('0x3c')]:_0x5e358b[_0x0388('0x39')];if(!_0x54b893[_0x0388('0x3a')][_0x0388('0x3f')]('nolimit')){_0x5336fa[_0x0388('0x25')]=qs[_0x0388('0x25')](_0x54b893['query'][_0x0388('0x25')]);_0x5336fa[_0x0388('0x23')]=qs['offset'](_0x54b893[_0x0388('0x3a')]['offset']);}_0x5336fa[_0x0388('0x40')]=qs[_0x0388('0x41')](_0x54b893['query'][_0x0388('0x41')]);_0x5336fa[_0x0388('0x42')]=qs[_0x0388('0x43')](_[_0x0388('0x44')](_0x54b893[_0x0388('0x3a')],_0x5e358b[_0x0388('0x43')]));_0x5336fa[_0x0388('0x6d')]=!![];if(_0x54b893[_0x0388('0x3a')][_0x0388('0x45')]){_0x5336fa[_0x0388('0x42')]=_[_0x0388('0x46')](_0x5336fa[_0x0388('0x42')],{'$or':_[_0x0388('0x35')](_0x5336fa[_0x0388('0x3c')],function(_0x3e435b){var _0x14506a={};_0x14506a[_0x3e435b]={'$like':'%'+_0x54b893[_0x0388('0x3a')]['filter']+'%'};return _0x14506a;})});}_0x5336fa=_[_0x0388('0x46')]({},_0x5336fa,_0x54b893['options']);return _0x5d40e0[_0x0388('0x6e')](_0x5336fa);}})[_0x0388('0x2c')](respondWithResult(_0x17424a,null))[_0x0388('0x50')](handleError(_0x17424a,null));};exports[_0x0388('0x6f')]=function(_0x1d2cde,_0xcfb361,_0x258307){var _0x4a20c1;return db['CmList'][_0x0388('0x56')]({'where':{'id':_0x1d2cde['params']['id']},'include':[{'model':db[_0x0388('0x70')],'as':_0x0388('0x6b')}]})[_0x0388('0x2c')](handleEntityNotFound(_0xcfb361,null))[_0x0388('0x2c')](function(_0x12eaf5){if(_0x12eaf5){_0x4a20c1=_0x12eaf5;return db[_0x0388('0x62')]['rawAttributes'];}})[_0x0388('0x2c')](function(_0x3d3949){if(_0x3d3949){var _0x3a55eb={};var _0x5012b8={};_0x5012b8[_0x0388('0x39')]=_[_0x0388('0x6c')](_[_0x0388('0x4b')](_0x3d3949),_[_0x0388('0x35')](_0x4a20c1[_0x0388('0x6b')],function(_0x486688){return util[_0x0388('0x71')](_0x0388('0x72'),_0x486688['id']);}));_0x5012b8[_0x0388('0x3a')]=_['keys'](_0x1d2cde[_0x0388('0x3a')]);_0x5012b8[_0x0388('0x43')]=_[_0x0388('0x3b')](_0x5012b8[_0x0388('0x39')],_0x5012b8[_0x0388('0x3a')]);_0x3a55eb[_0x0388('0x3c')]=_[_0x0388('0x3b')](_0x5012b8[_0x0388('0x39')],qs[_0x0388('0x3d')](_0x1d2cde[_0x0388('0x3a')][_0x0388('0x3d')]));_0x3a55eb[_0x0388('0x3c')]=_0x3a55eb[_0x0388('0x3c')][_0x0388('0x3e')]?_0x3a55eb[_0x0388('0x3c')]:_0x5012b8['model'];if(!_0x1d2cde[_0x0388('0x3a')][_0x0388('0x3f')](_0x0388('0x5f'))){_0x3a55eb[_0x0388('0x25')]=qs[_0x0388('0x25')](_0x1d2cde[_0x0388('0x3a')][_0x0388('0x25')]);_0x3a55eb[_0x0388('0x23')]=qs[_0x0388('0x23')](_0x1d2cde[_0x0388('0x3a')]['offset']);}_0x3a55eb['order']=qs[_0x0388('0x41')](_0x1d2cde[_0x0388('0x3a')][_0x0388('0x41')]);_0x3a55eb[_0x0388('0x42')]=qs[_0x0388('0x43')](_[_0x0388('0x44')](_0x1d2cde[_0x0388('0x3a')],_0x5012b8[_0x0388('0x43')]));_0x3a55eb[_0x0388('0x6d')]=!![];if(_0x1d2cde[_0x0388('0x3a')][_0x0388('0x45')]){_0x3a55eb[_0x0388('0x42')]=_[_0x0388('0x46')](_0x3a55eb[_0x0388('0x42')],{'$or':_[_0x0388('0x35')](_0x3a55eb[_0x0388('0x3c')],function(_0x12060f){var _0x5d98ae={};_0x5d98ae[_0x12060f]={'$like':'%'+_0x1d2cde[_0x0388('0x3a')][_0x0388('0x45')]+'%'};return _0x5d98ae;})});}_0x3a55eb=_[_0x0388('0x46')]({},_0x3a55eb,_0x1d2cde['options']);return _0x4a20c1[_0x0388('0x6e')](_0x3a55eb);}})[_0x0388('0x2c')](function(_0x17bbcc){if(!_['isEmpty'](_0x17bbcc)){var _0x52fd10=toCsv(_0x17bbcc);var _0x5da034=Date[_0x0388('0x73')]();fs[_0x0388('0x74')](util[_0x0388('0x71')](_0x0388('0x75'),_0x4a20c1['id'],_0x5da034),_0x52fd10);_0xcfb361[_0x0388('0x76')](_0x0388('0x77'),'attachment;\x20filename='+util[_0x0388('0x71')](_0x0388('0x78'),_0x4a20c1['id'],_0x5da034));_0xcfb361['setHeader'](_0x0388('0x79'),_0x0388('0x7a'));return _0xcfb361[_0x0388('0x7b')](util[_0x0388('0x71')]('/tmp/list_%d_%s.csv',_0x4a20c1['id'],_0x5da034));}else{return _0xcfb361[_0x0388('0x20')](0xcc);}})[_0x0388('0x50')](handleError(_0xcfb361,null));};exports[_0x0388('0x7c')]=function(_0x2d2c67,_0x5ae839,_0x571a7a){var _0xf7c177;delete _0x2d2c67[_0x0388('0x52')]['id'];return db[_0x0388('0x36')][_0x0388('0x7d')]({'where':{'id':_0x2d2c67[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5ae839,null))[_0x0388('0x2c')](function(_0x118554){if(_0x118554){return db[_0x0388('0x7e')]['transaction'](function(_0x2381fd){return db[_0x0388('0x70')]['create'](_0x2d2c67[_0x0388('0x52')],{'transaction':_0x2381fd})[_0x0388('0x2c')](function(_0x27de3f){_0xf7c177=_0x27de3f;return _0x118554[_0x0388('0x7f')](_0x27de3f,{'transaction':_0x2381fd});})['then'](function(){var _0x4b9edd={'type':db[_0x0388('0x80')][_0x0388('0x81')],'transaction':_0x2381fd};switch(_0x2d2c67[_0x0388('0x52')][_0x0388('0x37')]){case _0x0388('0x82'):_0x4b9edd['type']=db[_0x0388('0x80')][_0x0388('0x81')];break;case'number':_0x4b9edd[_0x0388('0x37')]=db[_0x0388('0x80')][_0x0388('0x83')];break;case'switch':_0x4b9edd[_0x0388('0x37')]=db[_0x0388('0x80')][_0x0388('0x84')];_0x4b9edd[_0x0388('0x85')]=![];break;default:}return db['sequelize'][_0x0388('0x86')][_0x0388('0x87')](_0x0388('0x88'),util[_0x0388('0x71')](_0x0388('0x89'),_0xf7c177['id']),_0x4b9edd);})[_0x0388('0x2c')](function(){return _0xf7c177;});});}})[_0x0388('0x2c')](respondWithResult(_0x5ae839,null))[_0x0388('0x50')](handleError(_0x5ae839,null));};exports['getCustomFields']=function(_0x376dba,_0x1d7cf0,_0x14dc5d){var _0x43c8c3={};var _0x3be6f8={};var _0x32541e;var _0x306ae2;return db[_0x0388('0x36')][_0x0388('0x7d')]({'where':{'id':_0x376dba[_0x0388('0x4a')]['id']}})[_0x0388('0x2c')](handleEntityNotFound(_0x1d7cf0,null))[_0x0388('0x2c')](function(_0x487952){if(_0x487952){_0x32541e=_0x487952;_0x3be6f8[_0x0388('0x39')]=_[_0x0388('0x4b')](db['CmCustomField'][_0x0388('0x4c')]);_0x3be6f8[_0x0388('0x3a')]=_[_0x0388('0x4b')](_0x376dba['query']);_0x3be6f8[_0x0388('0x43')]=_[_0x0388('0x3b')](_0x3be6f8[_0x0388('0x39')],_0x3be6f8['query']);_0x43c8c3[_0x0388('0x3c')]=_['intersection'](_0x3be6f8[_0x0388('0x39')],qs[_0x0388('0x3d')](_0x376dba[_0x0388('0x3a')][_0x0388('0x3d')]));_0x43c8c3[_0x0388('0x3c')]=_0x43c8c3[_0x0388('0x3c')][_0x0388('0x3e')]?_0x43c8c3[_0x0388('0x3c')]:_0x3be6f8[_0x0388('0x39')];_0x43c8c3[_0x0388('0x40')]=qs[_0x0388('0x41')](_0x376dba['query']['sort']);_0x43c8c3[_0x0388('0x42')]=qs[_0x0388('0x43')](_['pick'](_0x376dba[_0x0388('0x3a')],_0x3be6f8[_0x0388('0x43')]));_0x43c8c3[_0x0388('0x42')]=_[_0x0388('0x46')](_0x43c8c3[_0x0388('0x42')],{'$or':[{'ListId':_0x487952['id']},{'ListId':null}]});if(_0x376dba[_0x0388('0x3a')][_0x0388('0x45')]){_0x43c8c3[_0x0388('0x42')]=_[_0x0388('0x46')](_0x43c8c3['where'],{'$or':_[_0x0388('0x35')](_0x43c8c3[_0x0388('0x3c')],function(_0x592bcd){var _0x2d0a5f={};_0x2d0a5f[_0x592bcd]={'$like':'%'+_0x376dba['query'][_0x0388('0x45')]+'%'};return _0x2d0a5f;})});}_0x43c8c3=_[_0x0388('0x46')]({},_0x43c8c3,_0x376dba[_0x0388('0x4f')]);return db[_0x0388('0x70')]['findAndCountAll'](_0x43c8c3);}})['then'](respondWithResult(_0x1d7cf0,null))['catch'](handleError(_0x1d7cf0,null));};exports[_0x0388('0x8a')]=function(_0x2a348f,_0x5d2d33,_0x4fb316){return db[_0x0388('0x36')][_0x0388('0x56')]({'where':{'id':_0x2a348f[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d2d33,null))[_0x0388('0x2c')](function(_0x4a443e){if(_0x4a443e){return _0x4a443e[_0x0388('0x8a')](_0x2a348f[_0x0388('0x52')][_0x0388('0x66')],_['omit'](_0x2a348f['body'],[_0x0388('0x66'),'id'])||{})[_0x0388('0x8b')](function(_0x16b7ef){for(var _0x3d81bc=0x0;_0x3d81bc<_0x2a348f[_0x0388('0x52')][_0x0388('0x66')][_0x0388('0x3e')];_0x3d81bc+=0x1){socket[_0x0388('0x8c')](_0x0388('0x8d'),{'UserId':Number(_0x2a348f['body'][_0x0388('0x66')][_0x3d81bc]),'CmListId':Number(_0x2a348f[_0x0388('0x4a')]['id'])});}return _0x16b7ef;});}})['then'](respondWithResult(_0x5d2d33,null))[_0x0388('0x50')](handleError(_0x5d2d33,null));};exports[_0x0388('0x8e')]=function(_0x29c6b9,_0x58f466,_0xace654){return db['CmList'][_0x0388('0x56')]({'where':{'id':_0x29c6b9[_0x0388('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58f466,null))[_0x0388('0x2c')](function(_0x199379){if(_0x199379){return _0x199379[_0x0388('0x8e')](_0x29c6b9[_0x0388('0x3a')][_0x0388('0x66')])[_0x0388('0x2c')](function(){if(_['isArray'](_0x29c6b9[_0x0388('0x3a')][_0x0388('0x66')])){for(var _0x535e1d=0x0;_0x535e1d<_0x29c6b9[_0x0388('0x3a')][_0x0388('0x66')][_0x0388('0x3e')];_0x535e1d+=0x1){socket[_0x0388('0x8c')](_0x0388('0x8f'),{'UserId':Number(_0x29c6b9[_0x0388('0x3a')][_0x0388('0x66')][_0x535e1d]),'CmListId':Number(_0x29c6b9[_0x0388('0x4a')]['id'])});}}else{socket[_0x0388('0x8c')](_0x0388('0x8f'),{'UserId':Number(_0x29c6b9['query'][_0x0388('0x66')]),'CmListId':Number(_0x29c6b9[_0x0388('0x4a')]['id'])});}});}})[_0x0388('0x2c')](respondWithStatusCode(_0x58f466,null))[_0x0388('0x50')](handleError(_0x58f466,null));};exports[_0x0388('0x90')]=function(_0x37fb57,_0x2793d2,_0x39c211){var _0x4761f7={};var _0x4c7fad={};var _0x4f8a77;var _0x2630fc;return db['CmList'][_0x0388('0x7d')]({'where':{'id':_0x37fb57['params']['id']}})['then'](handleEntityNotFound(_0x2793d2,null))['then'](function(_0x53feb1){if(_0x53feb1){_0x4f8a77=_0x53feb1;_0x4c7fad[_0x0388('0x39')]=_['keys'](db['User']['rawAttributes']);_0x4c7fad['query']=_[_0x0388('0x4b')](_0x37fb57[_0x0388('0x3a')]);_0x4c7fad['filters']=_[_0x0388('0x3b')](_0x4c7fad['model'],_0x4c7fad['query']);_0x4761f7[_0x0388('0x3c')]=_[_0x0388('0x3b')](_0x4c7fad['model'],qs[_0x0388('0x3d')](_0x37fb57[_0x0388('0x3a')][_0x0388('0x3d')]));_0x4761f7[_0x0388('0x3c')]=_0x4761f7[_0x0388('0x3c')][_0x0388('0x3e')]?_0x4761f7[_0x0388('0x3c')]:_0x4c7fad[_0x0388('0x39')];_0x4761f7[_0x0388('0x40')]=qs[_0x0388('0x41')](_0x37fb57[_0x0388('0x3a')]['sort']);_0x4761f7[_0x0388('0x42')]=qs[_0x0388('0x43')](_[_0x0388('0x44')](_0x37fb57[_0x0388('0x3a')],_0x4c7fad['filters']));if(_0x37fb57[_0x0388('0x3a')]['filter']){_0x4761f7[_0x0388('0x42')]=_[_0x0388('0x46')](_0x4761f7['where'],{'$or':_[_0x0388('0x35')](_0x4761f7[_0x0388('0x3c')],function(_0x516874){var _0x5d53a9={};_0x5d53a9[_0x516874]={'$like':'%'+_0x37fb57[_0x0388('0x3a')][_0x0388('0x45')]+'%'};return _0x5d53a9;})});}_0x4761f7=_[_0x0388('0x46')]({},_0x4761f7,_0x37fb57['options']);return _0x4f8a77[_0x0388('0x90')](_0x4761f7);}})[_0x0388('0x2c')](function(_0x278943){if(_0x278943){_0x2630fc=_0x278943['length'];if(!_0x37fb57[_0x0388('0x3a')]['hasOwnProperty'](_0x0388('0x5f'))){_0x4761f7[_0x0388('0x25')]=qs[_0x0388('0x25')](_0x37fb57['query']['limit']);_0x4761f7[_0x0388('0x23')]=qs[_0x0388('0x23')](_0x37fb57[_0x0388('0x3a')][_0x0388('0x23')]);}return _0x4f8a77[_0x0388('0x90')](_0x4761f7);}})[_0x0388('0x2c')](function(_0x16ca43){if(_0x16ca43){return _0x16ca43?{'count':_0x2630fc,'rows':_0x16ca43}:null;}})['then'](respondWithResult(_0x2793d2,null))[_0x0388('0x50')](handleError(_0x2793d2,null));}; \ No newline at end of file +var _0x269a=['Lists','error','stack','name','send','index','CmList','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','options','includeAll','include','rows','catch','show','length','merge','find','create','body','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','findOne','nolimit','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','each','omit','success','dataValues','errors','message','CmCustomField','CustomFields','concat','raw','getContacts','format','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','switch','BOOLEAN','queryInterface','cm_contacts','cf_%s','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get'];(function(_0x5d1d25,_0x763b36){var _0x5d5dce=function(_0x4e813c){while(--_0x4e813c){_0x5d1d25['push'](_0x5d1d25['shift']());}};_0x5d5dce(++_0x763b36);}(_0x269a,0x178));var _0xa269=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x269a[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa269('0x0'));var jsonpatch=require(_0xa269('0x1'));var rp=require(_0xa269('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa269('0x3'));var util=require('util');var path=require(_0xa269('0x4'));var sox=require(_0xa269('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa269('0x6'));var _=require(_0xa269('0x7'));var squel=require(_0xa269('0x8'));var crypto=require(_0xa269('0x9'));var jsforce=require(_0xa269('0xa'));var deskjs=require(_0xa269('0xb'));var toCsv=require(_0xa269('0xc'));var querystring=require(_0xa269('0xd'));var Papa=require(_0xa269('0xe'));var Redis=require(_0xa269('0xf'));var authService=require(_0xa269('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa269('0x11'));var logger=require(_0xa269('0x12'))(_0xa269('0x13'));var utils=require('../../config/utils');var config=require(_0xa269('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa269('0x15'))['db'];config[_0xa269('0x16')]=_[_0xa269('0x17')](config[_0xa269('0x16')],{'host':_0xa269('0x18'),'port':0x18eb});var socket=require(_0xa269('0x19'))(new Redis(config[_0xa269('0x16')]));require(_0xa269('0x1a'))[_0xa269('0x1b')](socket);function respondWithStatusCode(_0x456d65,_0x2c778e){_0x2c778e=_0x2c778e||0xcc;return function(_0x828426){if(_0x828426){return _0x456d65[_0xa269('0x1c')](_0x2c778e);}return _0x456d65[_0xa269('0x1d')](_0x2c778e)[_0xa269('0x1e')]();};}function respondWithResult(_0xf82978,_0x2bc655){_0x2bc655=_0x2bc655||0xc8;return function(_0x21e0ff){if(_0x21e0ff){return _0xf82978[_0xa269('0x1d')](_0x2bc655)['json'](_0x21e0ff);}};}function respondWithFilteredResult(_0x1c5990,_0x5d7eae){return function(_0x38335f){if(_0x38335f){var _0x33d913=typeof _0x5d7eae[_0xa269('0x1f')]===_0xa269('0x20')&&typeof _0x5d7eae[_0xa269('0x21')]===_0xa269('0x20');var _0x34948e=_0x38335f[_0xa269('0x22')];var _0x5b150e=_0x33d913?0x0:_0x5d7eae[_0xa269('0x1f')];var _0x657966=_0x33d913?_0x38335f[_0xa269('0x22')]:_0x5d7eae[_0xa269('0x1f')]+_0x5d7eae['limit'];var _0x550699;if(_0x657966>=_0x34948e){_0x657966=_0x34948e;_0x550699=0xc8;}else{_0x550699=0xce;}_0x1c5990['status'](_0x550699);return _0x1c5990[_0xa269('0x23')](_0xa269('0x24'),_0x5b150e+'-'+_0x657966+'/'+_0x34948e)[_0xa269('0x25')](_0x38335f);}return null;};}function patchUpdates(_0x4ff6fb){return function(_0x535386){try{jsonpatch[_0xa269('0x26')](_0x535386,_0x4ff6fb,!![]);}catch(_0x13d367){return BPromise[_0xa269('0x27')](_0x13d367);}return _0x535386['save']();};}function saveUpdates(_0x471e7b,_0x56a1ef){return function(_0x1d1ae9){if(_0x1d1ae9){return _0x1d1ae9[_0xa269('0x28')](_0x471e7b)[_0xa269('0x29')](function(_0x3053f8){return _0x3053f8;});}return null;};}function removeEntity(_0x59f0d8,_0x1f3c11){return function(_0x378da9){if(_0x378da9){return _0x378da9[_0xa269('0x2a')]()[_0xa269('0x29')](function(){var _0x11fb49=_0x378da9[_0xa269('0x2b')]({'plain':!![]});var _0x4ad75b=_0xa269('0x2c');return db['UserProfileResource'][_0xa269('0x2a')]({'where':{'type':_0x4ad75b,'resourceId':_0x11fb49['id']}})[_0xa269('0x29')](function(){return _0x378da9;});})[_0xa269('0x29')](function(){_0x59f0d8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3763f3,_0x892b8f){return function(_0x28287e){if(!_0x28287e){_0x3763f3[_0xa269('0x1c')](0x194);}return _0x28287e;};}function handleError(_0x17db99,_0x214e3e){_0x214e3e=_0x214e3e||0x1f4;return function(_0x522428){logger[_0xa269('0x2d')](_0x522428[_0xa269('0x2e')]);if(_0x522428[_0xa269('0x2f')]){delete _0x522428[_0xa269('0x2f')];}_0x17db99[_0xa269('0x1d')](_0x214e3e)[_0xa269('0x30')](_0x522428);};}exports[_0xa269('0x31')]=function(_0x47d214,_0x358082){var _0x23482a={},_0x40792e={},_0x56cfeb={'count':0x0,'rows':[]};var _0x427e32=_['map'](db[_0xa269('0x32')][_0xa269('0x33')],function(_0x12d198){return{'name':_0x12d198['fieldName'],'type':_0x12d198[_0xa269('0x34')][_0xa269('0x35')]};});_0x40792e[_0xa269('0x36')]=_[_0xa269('0x37')](_0x427e32,_0xa269('0x2f'));_0x40792e['query']=_[_0xa269('0x38')](_0x47d214[_0xa269('0x39')]);_0x40792e[_0xa269('0x3a')]=_[_0xa269('0x3b')](_0x40792e[_0xa269('0x36')],_0x40792e[_0xa269('0x39')]);_0x23482a[_0xa269('0x3c')]=_[_0xa269('0x3b')](_0x40792e[_0xa269('0x36')],qs[_0xa269('0x3d')](_0x47d214[_0xa269('0x39')][_0xa269('0x3d')]));_0x23482a[_0xa269('0x3c')]=_0x23482a[_0xa269('0x3c')]['length']?_0x23482a['attributes']:_0x40792e['model'];if(!_0x47d214[_0xa269('0x39')][_0xa269('0x3e')]('nolimit')){_0x23482a[_0xa269('0x21')]=qs[_0xa269('0x21')](_0x47d214[_0xa269('0x39')]['limit']);_0x23482a['offset']=qs[_0xa269('0x1f')](_0x47d214['query'][_0xa269('0x1f')]);}_0x23482a[_0xa269('0x3f')]=qs[_0xa269('0x40')](_0x47d214[_0xa269('0x39')]['sort']);_0x23482a['where']=qs[_0xa269('0x3a')](_[_0xa269('0x41')](_0x47d214[_0xa269('0x39')],_0x40792e[_0xa269('0x3a')]),_0x427e32);if(_0x47d214[_0xa269('0x39')][_0xa269('0x42')]){_0x23482a[_0xa269('0x43')]=_['merge'](_0x23482a[_0xa269('0x43')],{'$or':_[_0xa269('0x37')](_0x427e32,function(_0x202ee9){if(_0x202ee9[_0xa269('0x34')]!=='VIRTUAL'){var _0x4f2c4d={};_0x4f2c4d[_0x202ee9[_0xa269('0x2f')]]={'$like':'%'+_0x47d214[_0xa269('0x39')][_0xa269('0x42')]+'%'};return _0x4f2c4d;}})});}_0x23482a=_['merge']({},_0x23482a,_0x47d214[_0xa269('0x44')]);var _0x14c4ea={'where':_0x23482a[_0xa269('0x43')]};return db[_0xa269('0x32')][_0xa269('0x22')](_0x14c4ea)[_0xa269('0x29')](function(_0x5996a9){_0x56cfeb[_0xa269('0x22')]=_0x5996a9;if(_0x47d214[_0xa269('0x39')][_0xa269('0x45')]){_0x23482a[_0xa269('0x46')]=[{'all':!![]}];}return db[_0xa269('0x32')]['findAll'](_0x23482a);})[_0xa269('0x29')](function(_0x1c6218){_0x56cfeb[_0xa269('0x47')]=_0x1c6218;return _0x56cfeb;})[_0xa269('0x29')](respondWithFilteredResult(_0x358082,_0x23482a))[_0xa269('0x48')](handleError(_0x358082,null));};exports[_0xa269('0x49')]=function(_0x4a22d3,_0x47d536){var _0x14c921={'raw':![],'where':{'id':_0x4a22d3['params']['id']}},_0x430b9f={};_0x430b9f[_0xa269('0x36')]=_[_0xa269('0x38')](db['CmList'][_0xa269('0x33')]);_0x430b9f['query']=_[_0xa269('0x38')](_0x4a22d3[_0xa269('0x39')]);_0x430b9f[_0xa269('0x3a')]=_[_0xa269('0x3b')](_0x430b9f[_0xa269('0x36')],_0x430b9f['query']);_0x14c921[_0xa269('0x3c')]=_[_0xa269('0x3b')](_0x430b9f[_0xa269('0x36')],qs['fields'](_0x4a22d3['query']['fields']));_0x14c921[_0xa269('0x3c')]=_0x14c921[_0xa269('0x3c')][_0xa269('0x4a')]?_0x14c921[_0xa269('0x3c')]:_0x430b9f[_0xa269('0x36')];if(_0x4a22d3['query']['includeAll']){_0x14c921[_0xa269('0x46')]=[{'all':!![]}];}_0x14c921=_[_0xa269('0x4b')]({},_0x14c921,_0x4a22d3[_0xa269('0x44')]);return db[_0xa269('0x32')][_0xa269('0x4c')](_0x14c921)[_0xa269('0x29')](handleEntityNotFound(_0x47d536,null))['then'](respondWithResult(_0x47d536,null))['catch'](handleError(_0x47d536,null));};exports['create']=function(_0x1a92ad,_0x2fd42e){return db[_0xa269('0x32')][_0xa269('0x4d')](_0x1a92ad[_0xa269('0x4e')],{})['then'](function(_0x345dbc){var _0x1212d1=_0x1a92ad['user'][_0xa269('0x2b')]({'plain':!![]});if(!_0x1212d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1212d1[_0xa269('0x4f')]===_0xa269('0x50')){var _0x577447=_0x345dbc[_0xa269('0x2b')]({'plain':!![]});var _0x590f3e=_0xa269('0x2c');return db['UserProfileSection'][_0xa269('0x4c')]({'where':{'name':_0x590f3e,'userProfileId':_0x1212d1[_0xa269('0x51')]},'raw':!![]})[_0xa269('0x29')](function(_0x18471b){if(_0x18471b&&_0x18471b[_0xa269('0x52')]===0x0){return db[_0xa269('0x53')]['create']({'name':_0x577447[_0xa269('0x2f')],'resourceId':_0x577447['id'],'type':_0x18471b[_0xa269('0x2f')],'sectionId':_0x18471b['id']},{})['then'](function(){return _0x345dbc;});}else{return _0x345dbc;}})['catch'](function(_0x26dd90){logger[_0xa269('0x2d')](_0xa269('0x54'),_0x26dd90);throw _0x26dd90;});}return _0x345dbc;})[_0xa269('0x29')](respondWithResult(_0x2fd42e,0xc9))[_0xa269('0x48')](handleError(_0x2fd42e,null));};exports[_0xa269('0x28')]=function(_0x598b14,_0xb18405){if(_0x598b14[_0xa269('0x4e')]['id']){delete _0x598b14[_0xa269('0x4e')]['id'];}return db[_0xa269('0x32')][_0xa269('0x4c')]({'where':{'id':_0x598b14[_0xa269('0x55')]['id']}})[_0xa269('0x29')](handleEntityNotFound(_0xb18405,null))[_0xa269('0x29')](saveUpdates(_0x598b14['body'],null))[_0xa269('0x29')](respondWithResult(_0xb18405,null))[_0xa269('0x48')](handleError(_0xb18405,null));};exports['destroy']=function(_0x308e81,_0x40ba51){return db['CmList']['find']({'where':{'id':_0x308e81[_0xa269('0x55')]['id']}})['then'](handleEntityNotFound(_0x40ba51,null))['then'](removeEntity(_0x40ba51,null))[_0xa269('0x48')](handleError(_0x40ba51,null));};exports['describe']=function(_0x4d2c4e,_0x463f3c){return db[_0xa269('0x32')][_0xa269('0x56')]()[_0xa269('0x29')](respondWithResult(_0x463f3c,null))[_0xa269('0x48')](handleError(_0x463f3c,null));};exports[_0xa269('0x57')]=function(_0x50f119,_0x160046,_0x41d727){if(_0x50f119[_0xa269('0x4e')]['id']){delete _0x50f119[_0xa269('0x4e')]['id'];}return db[_0xa269('0x32')][_0xa269('0x4c')]({'where':{'id':_0x50f119[_0xa269('0x55')]['id']}})[_0xa269('0x29')](handleEntityNotFound(_0x160046,null))[_0xa269('0x29')](function(_0x2b1b7a){if(_0x2b1b7a){_0x50f119[_0xa269('0x4e')][_0xa269('0x58')]=_0x2b1b7a['id'];return db[_0xa269('0x59')][_0xa269('0x4d')](_0x50f119['body']);}})[_0xa269('0x29')](respondWithResult(_0x160046,null))[_0xa269('0x48')](handleError(_0x160046,null));};exports['getDispositions']=function(_0x466f62,_0x24e081,_0x558e85){var _0x5b994f={'raw':![],'where':{}};var _0xd4195e={};var _0x5405c7={'count':0x0,'rows':[]};return db['CmList'][_0xa269('0x5a')]({'where':{'id':_0x466f62[_0xa269('0x55')]['id']}})[_0xa269('0x29')](handleEntityNotFound(_0x24e081,null))[_0xa269('0x29')](function(_0x334a51){if(_0x334a51){_0xd4195e[_0xa269('0x36')]=_['keys'](db[_0xa269('0x59')][_0xa269('0x33')]);_0xd4195e[_0xa269('0x39')]=_[_0xa269('0x38')](_0x466f62['query']);_0xd4195e['filters']=_['intersection'](_0xd4195e[_0xa269('0x36')],_0xd4195e[_0xa269('0x39')]);_0x5b994f['attributes']=_['intersection'](_0xd4195e[_0xa269('0x36')],qs['fields'](_0x466f62[_0xa269('0x39')]['fields']));_0x5b994f['attributes']=_0x5b994f[_0xa269('0x3c')][_0xa269('0x4a')]?_0x5b994f['attributes']:_0xd4195e[_0xa269('0x36')];if(!_0x466f62[_0xa269('0x39')][_0xa269('0x3e')](_0xa269('0x5b'))){_0x5b994f[_0xa269('0x21')]=qs[_0xa269('0x21')](_0x466f62[_0xa269('0x39')]['limit']);_0x5b994f[_0xa269('0x1f')]=qs[_0xa269('0x1f')](_0x466f62[_0xa269('0x39')][_0xa269('0x1f')]);}_0x5b994f['order']=qs[_0xa269('0x40')](_0x466f62[_0xa269('0x39')]['sort']);_0x5b994f[_0xa269('0x43')]=qs[_0xa269('0x3a')](_[_0xa269('0x41')](_0x466f62['query'],_0xd4195e[_0xa269('0x3a')]));_0x5b994f['where'][_0xa269('0x58')]=_0x334a51['id'];if(_0x466f62[_0xa269('0x39')]['filter']){_0x5b994f[_0xa269('0x43')]=_['merge'](_0x5b994f[_0xa269('0x43')],{'$or':_[_0xa269('0x37')](_0x5b994f['attributes'],function(_0xae90f8){var _0x516589={};_0x516589[_0xae90f8]={'$like':'%'+_0x466f62[_0xa269('0x39')][_0xa269('0x42')]+'%'};return _0x516589;})});}_0x5b994f=_['merge']({},_0x5b994f,_0x466f62['options']);return db['Disposition'][_0xa269('0x22')]({'where':_0x5b994f[_0xa269('0x43')]})[_0xa269('0x29')](function(_0x57074c){_0x5405c7[_0xa269('0x22')]=_0x57074c;if(_0x466f62[_0xa269('0x39')][_0xa269('0x45')]){_0x5b994f['include']=[{'all':!![]}];}return db[_0xa269('0x59')][_0xa269('0x5c')](_0x5b994f);})['then'](function(_0x350687){_0x5405c7[_0xa269('0x47')]=_0x350687;return _0x5405c7;});}})[_0xa269('0x29')](respondWithFilteredResult(_0x24e081,_0x5b994f))['catch'](handleError(_0x24e081,null));};exports['removeDispositions']=function(_0x168512,_0x435e7f,_0x4a622d){return db[_0xa269('0x32')]['find']({'where':{'id':_0x168512[_0xa269('0x55')]['id']}})[_0xa269('0x29')](handleEntityNotFound(_0x435e7f,null))['then'](function(_0x5b7c77){if(_0x5b7c77){return _0x5b7c77[_0xa269('0x5d')](_0x168512[_0xa269('0x39')][_0xa269('0x5e')]);}})[_0xa269('0x29')](respondWithStatusCode(_0x435e7f,null))[_0xa269('0x48')](handleError(_0x435e7f,null));};exports[_0xa269('0x5f')]=function(_0x8c270a,_0x5aeed9,_0x1bf80a){return db[_0xa269('0x32')][_0xa269('0x4c')]({'where':{'id':_0x8c270a[_0xa269('0x55')]['id']}})['then'](handleEntityNotFound(_0x5aeed9,null))[_0xa269('0x29')](function(_0x347a5e){if(_0x347a5e){var _0x19ebcf=[];var _0x25c66a={'success':[],'errors':[]};return db[_0xa269('0x60')][_0xa269('0x56')]()[_0xa269('0x29')](function(_0x1c08d3){if(_0x8c270a[_0xa269('0x4e')][_0xa269('0x61')]&&_[_0xa269('0x62')](_0x8c270a[_0xa269('0x4e')][_0xa269('0x61')])){if(_0x8c270a['body'][_0xa269('0x61')][_0xa269('0x4a')]){_0x8c270a['body'][_0xa269('0x61')]=_0x8c270a[_0xa269('0x4e')][_0xa269('0x61')]['join'](';')+';';}else{_0x8c270a['body'][_0xa269('0x61')]=null;}}else{_0x8c270a['body']['tags']=null;}if(_0x8c270a[_0xa269('0x4e')]&&_['isArray'](_0x8c270a[_0xa269('0x4e')])){for(var _0x2c1c70=0x0;_0x2c1c70<_0x8c270a[_0xa269('0x4e')]['length'];_0x2c1c70+=0x1){_0x8c270a[_0xa269('0x4e')][_0x2c1c70][_0xa269('0x58')]=_0x8c270a['params']['id'];_0x19ebcf[_0xa269('0x63')](_0x8c270a[_0xa269('0x4e')][_0x2c1c70]);}return BPromise[_0xa269('0x64')](_0x19ebcf,function(_0xb00731){return db['CmContact'][_0xa269('0x4d')](_[_0xa269('0x65')](_0xb00731,[_0xa269('0x5e'),'id'])||{},{'fields':_[_0xa269('0x38')](_0x1c08d3),'raw':!![]})[_0xa269('0x29')](function(_0x4748cf){_0x25c66a[_0xa269('0x66')]['push'](_0x4748cf[_0xa269('0x67')]);})[_0xa269('0x48')](function(_0x2b3bbb){_0x25c66a[_0xa269('0x68')]['push']({'data':_0xb00731,'error':_0x2b3bbb[_0xa269('0x69')]});});})[_0xa269('0x29')](function(_0x53a4f7){return _0x25c66a;})[_0xa269('0x48')](function(_0x40e127){return _0x40e127;});}else{_0x5aeed9['status'](0x190)[_0xa269('0x25')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xa269('0x29')](respondWithResult(_0x5aeed9,null))[_0xa269('0x48')](handleError(_0x5aeed9,null));};exports['getContacts']=function(_0x42701e,_0x2bc7d7,_0x354df0){var _0x7285d6;return db[_0xa269('0x32')]['find']({'where':{'id':_0x42701e[_0xa269('0x55')]['id']},'include':[{'model':db[_0xa269('0x6a')],'as':_0xa269('0x6b')}]})[_0xa269('0x29')](handleEntityNotFound(_0x2bc7d7,null))['then'](function(_0x4039e3){if(_0x4039e3){_0x7285d6=_0x4039e3;return db['CmContact'][_0xa269('0x33')];}})[_0xa269('0x29')](function(_0x7336a3){if(_0x7336a3){var _0x5a0726={};var _0x5b4891={};_0x5b4891[_0xa269('0x36')]=_[_0xa269('0x6c')](_[_0xa269('0x38')](_0x7336a3),_[_0xa269('0x37')](_0x7285d6['CustomFields'],function(_0x1b30f4){return util['format']('cf_%d',_0x1b30f4['id']);}));_0x5b4891[_0xa269('0x39')]=_['keys'](_0x42701e[_0xa269('0x39')]);_0x5b4891['filters']=_[_0xa269('0x3b')](_0x5b4891[_0xa269('0x36')],_0x5b4891[_0xa269('0x39')]);_0x5a0726['attributes']=_['intersection'](_0x5b4891[_0xa269('0x36')],qs[_0xa269('0x3d')](_0x42701e[_0xa269('0x39')][_0xa269('0x3d')]));_0x5a0726[_0xa269('0x3c')]=_0x5a0726[_0xa269('0x3c')]['length']?_0x5a0726[_0xa269('0x3c')]:_0x5b4891[_0xa269('0x36')];if(!_0x42701e[_0xa269('0x39')][_0xa269('0x3e')]('nolimit')){_0x5a0726[_0xa269('0x21')]=qs[_0xa269('0x21')](_0x42701e[_0xa269('0x39')][_0xa269('0x21')]);_0x5a0726[_0xa269('0x1f')]=qs['offset'](_0x42701e[_0xa269('0x39')][_0xa269('0x1f')]);}_0x5a0726['order']=qs[_0xa269('0x40')](_0x42701e[_0xa269('0x39')]['sort']);_0x5a0726[_0xa269('0x43')]=qs[_0xa269('0x3a')](_[_0xa269('0x41')](_0x42701e['query'],_0x5b4891[_0xa269('0x3a')]));_0x5a0726[_0xa269('0x6d')]=!![];if(_0x42701e['query'][_0xa269('0x42')]){_0x5a0726[_0xa269('0x43')]=_[_0xa269('0x4b')](_0x5a0726[_0xa269('0x43')],{'$or':_[_0xa269('0x37')](_0x5a0726[_0xa269('0x3c')],function(_0x54d2b8){var _0x2ab34b={};_0x2ab34b[_0x54d2b8]={'$like':'%'+_0x42701e[_0xa269('0x39')][_0xa269('0x42')]+'%'};return _0x2ab34b;})});}_0x5a0726=_['merge']({},_0x5a0726,_0x42701e[_0xa269('0x44')]);return _0x7285d6[_0xa269('0x6e')](_0x5a0726);}})['then'](respondWithResult(_0x2bc7d7,null))[_0xa269('0x48')](handleError(_0x2bc7d7,null));};exports['getContactsCsv']=function(_0x403af1,_0x4bf331,_0x230857){var _0x43c7e9;return db['CmList']['find']({'where':{'id':_0x403af1['params']['id']},'include':[{'model':db[_0xa269('0x6a')],'as':_0xa269('0x6b')}]})[_0xa269('0x29')](handleEntityNotFound(_0x4bf331,null))[_0xa269('0x29')](function(_0x379aa4){if(_0x379aa4){_0x43c7e9=_0x379aa4;return db[_0xa269('0x60')][_0xa269('0x33')];}})['then'](function(_0x3110bf){if(_0x3110bf){var _0x36a1a1={};var _0x4776ba={};_0x4776ba[_0xa269('0x36')]=_[_0xa269('0x6c')](_[_0xa269('0x38')](_0x3110bf),_[_0xa269('0x37')](_0x43c7e9[_0xa269('0x6b')],function(_0x1e6a50){return util[_0xa269('0x6f')]('cf_%d',_0x1e6a50['id']);}));_0x4776ba[_0xa269('0x39')]=_[_0xa269('0x38')](_0x403af1['query']);_0x4776ba[_0xa269('0x3a')]=_[_0xa269('0x3b')](_0x4776ba[_0xa269('0x36')],_0x4776ba['query']);_0x36a1a1[_0xa269('0x3c')]=_[_0xa269('0x3b')](_0x4776ba['model'],qs['fields'](_0x403af1[_0xa269('0x39')][_0xa269('0x3d')]));_0x36a1a1[_0xa269('0x3c')]=_0x36a1a1[_0xa269('0x3c')]['length']?_0x36a1a1[_0xa269('0x3c')]:_0x4776ba[_0xa269('0x36')];if(!_0x403af1[_0xa269('0x39')]['hasOwnProperty'](_0xa269('0x5b'))){_0x36a1a1[_0xa269('0x21')]=qs[_0xa269('0x21')](_0x403af1['query'][_0xa269('0x21')]);_0x36a1a1[_0xa269('0x1f')]=qs[_0xa269('0x1f')](_0x403af1['query'][_0xa269('0x1f')]);}_0x36a1a1['order']=qs[_0xa269('0x40')](_0x403af1['query'][_0xa269('0x40')]);_0x36a1a1[_0xa269('0x43')]=qs[_0xa269('0x3a')](_[_0xa269('0x41')](_0x403af1[_0xa269('0x39')],_0x4776ba['filters']));_0x36a1a1[_0xa269('0x6d')]=!![];if(_0x403af1[_0xa269('0x39')]['filter']){_0x36a1a1['where']=_[_0xa269('0x4b')](_0x36a1a1[_0xa269('0x43')],{'$or':_['map'](_0x36a1a1['attributes'],function(_0x471d2a){var _0x2eaed9={};_0x2eaed9[_0x471d2a]={'$like':'%'+_0x403af1['query'][_0xa269('0x42')]+'%'};return _0x2eaed9;})});}_0x36a1a1=_[_0xa269('0x4b')]({},_0x36a1a1,_0x403af1[_0xa269('0x44')]);return _0x43c7e9[_0xa269('0x6e')](_0x36a1a1);}})[_0xa269('0x29')](function(_0x43676f){if(!_[_0xa269('0x70')](_0x43676f)){var _0x21de94=toCsv(_0x43676f);var _0x9c0c6e=Date[_0xa269('0x71')]();fs['writeFileSync'](util[_0xa269('0x6f')](_0xa269('0x72'),_0x43c7e9['id'],_0x9c0c6e),_0x21de94);_0x4bf331[_0xa269('0x73')](_0xa269('0x74'),'attachment;\x20filename='+util['format'](_0xa269('0x75'),_0x43c7e9['id'],_0x9c0c6e));_0x4bf331[_0xa269('0x73')]('Content-type',_0xa269('0x76'));return _0x4bf331[_0xa269('0x77')](util[_0xa269('0x6f')](_0xa269('0x72'),_0x43c7e9['id'],_0x9c0c6e));}else{return _0x4bf331['sendStatus'](0xcc);}})[_0xa269('0x48')](handleError(_0x4bf331,null));};exports[_0xa269('0x78')]=function(_0x32aa39,_0x24624,_0x598f6d){var _0x137ffd;delete _0x32aa39[_0xa269('0x4e')]['id'];return db[_0xa269('0x32')][_0xa269('0x5a')]({'where':{'id':_0x32aa39[_0xa269('0x55')]['id']}})['then'](handleEntityNotFound(_0x24624,null))[_0xa269('0x29')](function(_0x2d364f){if(_0x2d364f){return db[_0xa269('0x79')][_0xa269('0x7a')](function(_0x56b55e){return db[_0xa269('0x6a')][_0xa269('0x4d')](_0x32aa39[_0xa269('0x4e')],{'transaction':_0x56b55e})[_0xa269('0x29')](function(_0x2de15b){_0x137ffd=_0x2de15b;return _0x2d364f[_0xa269('0x7b')](_0x2de15b,{'transaction':_0x56b55e});})[_0xa269('0x29')](function(){var _0x1baf6f={'type':db[_0xa269('0x7c')][_0xa269('0x7d')],'transaction':_0x56b55e};switch(_0x32aa39[_0xa269('0x4e')][_0xa269('0x34')]){case _0xa269('0x7e'):_0x1baf6f[_0xa269('0x34')]=db[_0xa269('0x7c')][_0xa269('0x7d')];break;case _0xa269('0x7f'):_0x1baf6f[_0xa269('0x34')]=db['Sequelize']['INTEGER'];break;case _0xa269('0x80'):_0x1baf6f[_0xa269('0x34')]=db[_0xa269('0x7c')][_0xa269('0x81')];_0x1baf6f['defaultValue']=![];break;default:}return db['sequelize'][_0xa269('0x82')]['addColumn'](_0xa269('0x83'),util[_0xa269('0x6f')](_0xa269('0x84'),_0x137ffd['id']),_0x1baf6f);})[_0xa269('0x29')](function(){return _0x137ffd;});});}})[_0xa269('0x29')](respondWithResult(_0x24624,null))[_0xa269('0x48')](handleError(_0x24624,null));};exports['getCustomFields']=function(_0x131965,_0x144278,_0x5569ad){var _0x54dd35={};var _0x26c4bb={};var _0x65590;var _0x5d28b0;return db[_0xa269('0x32')][_0xa269('0x5a')]({'where':{'id':_0x131965[_0xa269('0x55')]['id']}})[_0xa269('0x29')](handleEntityNotFound(_0x144278,null))[_0xa269('0x29')](function(_0x3fed17){if(_0x3fed17){_0x65590=_0x3fed17;_0x26c4bb[_0xa269('0x36')]=_[_0xa269('0x38')](db[_0xa269('0x6a')][_0xa269('0x33')]);_0x26c4bb[_0xa269('0x39')]=_['keys'](_0x131965[_0xa269('0x39')]);_0x26c4bb[_0xa269('0x3a')]=_[_0xa269('0x3b')](_0x26c4bb[_0xa269('0x36')],_0x26c4bb[_0xa269('0x39')]);_0x54dd35[_0xa269('0x3c')]=_[_0xa269('0x3b')](_0x26c4bb[_0xa269('0x36')],qs[_0xa269('0x3d')](_0x131965[_0xa269('0x39')]['fields']));_0x54dd35['attributes']=_0x54dd35[_0xa269('0x3c')]['length']?_0x54dd35[_0xa269('0x3c')]:_0x26c4bb['model'];_0x54dd35[_0xa269('0x3f')]=qs[_0xa269('0x40')](_0x131965['query'][_0xa269('0x40')]);_0x54dd35[_0xa269('0x43')]=qs[_0xa269('0x3a')](_['pick'](_0x131965[_0xa269('0x39')],_0x26c4bb['filters']));_0x54dd35[_0xa269('0x43')]=_[_0xa269('0x4b')](_0x54dd35[_0xa269('0x43')],{'$or':[{'ListId':_0x3fed17['id']},{'ListId':null}]});if(_0x131965['query'][_0xa269('0x42')]){_0x54dd35[_0xa269('0x43')]=_[_0xa269('0x4b')](_0x54dd35[_0xa269('0x43')],{'$or':_[_0xa269('0x37')](_0x54dd35[_0xa269('0x3c')],function(_0x5635d1){var _0x59c371={};_0x59c371[_0x5635d1]={'$like':'%'+_0x131965[_0xa269('0x39')][_0xa269('0x42')]+'%'};return _0x59c371;})});}_0x54dd35=_['merge']({},_0x54dd35,_0x131965[_0xa269('0x44')]);return db[_0xa269('0x6a')]['findAndCountAll'](_0x54dd35);}})[_0xa269('0x29')](respondWithResult(_0x144278,null))[_0xa269('0x48')](handleError(_0x144278,null));};exports[_0xa269('0x85')]=function(_0x54c9f0,_0x4c57cd,_0x22c48b){return db['CmList']['find']({'where':{'id':_0x54c9f0[_0xa269('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c57cd,null))['then'](function(_0x13f362){if(_0x13f362){return _0x13f362['addAgents'](_0x54c9f0[_0xa269('0x4e')][_0xa269('0x5e')],_[_0xa269('0x65')](_0x54c9f0[_0xa269('0x4e')],[_0xa269('0x5e'),'id'])||{})['spread'](function(_0x23a681){for(var _0x4f6529=0x0;_0x4f6529<_0x54c9f0[_0xa269('0x4e')]['ids'][_0xa269('0x4a')];_0x4f6529+=0x1){socket[_0xa269('0x86')](_0xa269('0x87'),{'UserId':Number(_0x54c9f0[_0xa269('0x4e')][_0xa269('0x5e')][_0x4f6529]),'CmListId':Number(_0x54c9f0[_0xa269('0x55')]['id'])});}return _0x23a681;});}})[_0xa269('0x29')](respondWithResult(_0x4c57cd,null))[_0xa269('0x48')](handleError(_0x4c57cd,null));};exports[_0xa269('0x88')]=function(_0x35afa6,_0x22e9d5,_0x3beaec){return db['CmList']['find']({'where':{'id':_0x35afa6[_0xa269('0x55')]['id']}})['then'](handleEntityNotFound(_0x22e9d5,null))[_0xa269('0x29')](function(_0xc13a2d){if(_0xc13a2d){return _0xc13a2d[_0xa269('0x88')](_0x35afa6['query'][_0xa269('0x5e')])[_0xa269('0x29')](function(){if(_[_0xa269('0x62')](_0x35afa6[_0xa269('0x39')][_0xa269('0x5e')])){for(var _0x1786ed=0x0;_0x1786ed<_0x35afa6[_0xa269('0x39')][_0xa269('0x5e')][_0xa269('0x4a')];_0x1786ed+=0x1){socket[_0xa269('0x86')](_0xa269('0x89'),{'UserId':Number(_0x35afa6[_0xa269('0x39')][_0xa269('0x5e')][_0x1786ed]),'CmListId':Number(_0x35afa6[_0xa269('0x55')]['id'])});}}else{socket[_0xa269('0x86')](_0xa269('0x89'),{'UserId':Number(_0x35afa6[_0xa269('0x39')]['ids']),'CmListId':Number(_0x35afa6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22e9d5,null))[_0xa269('0x48')](handleError(_0x22e9d5,null));};exports[_0xa269('0x8a')]=function(_0x4469b7,_0x3ec856,_0x52ae14){var _0x30bd4e={};var _0x5a44a3={};var _0x52bbf3;var _0xbaa026;return db[_0xa269('0x32')][_0xa269('0x5a')]({'where':{'id':_0x4469b7['params']['id']}})[_0xa269('0x29')](handleEntityNotFound(_0x3ec856,null))[_0xa269('0x29')](function(_0x2a9e9c){if(_0x2a9e9c){_0x52bbf3=_0x2a9e9c;_0x5a44a3[_0xa269('0x36')]=_[_0xa269('0x38')](db[_0xa269('0x8b')][_0xa269('0x33')]);_0x5a44a3[_0xa269('0x39')]=_[_0xa269('0x38')](_0x4469b7[_0xa269('0x39')]);_0x5a44a3[_0xa269('0x3a')]=_[_0xa269('0x3b')](_0x5a44a3[_0xa269('0x36')],_0x5a44a3[_0xa269('0x39')]);_0x30bd4e[_0xa269('0x3c')]=_[_0xa269('0x3b')](_0x5a44a3[_0xa269('0x36')],qs['fields'](_0x4469b7[_0xa269('0x39')][_0xa269('0x3d')]));_0x30bd4e['attributes']=_0x30bd4e[_0xa269('0x3c')]['length']?_0x30bd4e[_0xa269('0x3c')]:_0x5a44a3[_0xa269('0x36')];_0x30bd4e[_0xa269('0x3f')]=qs[_0xa269('0x40')](_0x4469b7[_0xa269('0x39')][_0xa269('0x40')]);_0x30bd4e[_0xa269('0x43')]=qs[_0xa269('0x3a')](_[_0xa269('0x41')](_0x4469b7[_0xa269('0x39')],_0x5a44a3['filters']));if(_0x4469b7[_0xa269('0x39')][_0xa269('0x42')]){_0x30bd4e['where']=_[_0xa269('0x4b')](_0x30bd4e[_0xa269('0x43')],{'$or':_[_0xa269('0x37')](_0x30bd4e[_0xa269('0x3c')],function(_0x19760d){var _0x6e5a09={};_0x6e5a09[_0x19760d]={'$like':'%'+_0x4469b7[_0xa269('0x39')][_0xa269('0x42')]+'%'};return _0x6e5a09;})});}_0x30bd4e=_[_0xa269('0x4b')]({},_0x30bd4e,_0x4469b7[_0xa269('0x44')]);return _0x52bbf3[_0xa269('0x8a')](_0x30bd4e);}})[_0xa269('0x29')](function(_0x21ea36){if(_0x21ea36){_0xbaa026=_0x21ea36[_0xa269('0x4a')];if(!_0x4469b7[_0xa269('0x39')][_0xa269('0x3e')](_0xa269('0x5b'))){_0x30bd4e[_0xa269('0x21')]=qs[_0xa269('0x21')](_0x4469b7[_0xa269('0x39')]['limit']);_0x30bd4e[_0xa269('0x1f')]=qs[_0xa269('0x1f')](_0x4469b7[_0xa269('0x39')][_0xa269('0x1f')]);}return _0x52bbf3[_0xa269('0x8a')](_0x30bd4e);}})['then'](function(_0x2e1b6e){if(_0x2e1b6e){return _0x2e1b6e?{'count':_0xbaa026,'rows':_0x2e1b6e}:null;}})['then'](respondWithResult(_0x3ec856,null))[_0xa269('0x48')](handleError(_0x3ec856,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 93b2a4b..16f3cad 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 _0x326f=['exports','events','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x3b37c8,_0x4f8293){_0x3b37c8=_0x3b37c8-0x0;var _0x2bc52d=_0x326f[_0x3b37c8];return _0x2bc52d;};'use strict';var EventEmitter=require(_0xf326('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xf326('0x1')](0x0);var events={'afterCreate':_0xf326('0x2'),'afterUpdate':_0xf326('0x3'),'afterDestroy':_0xf326('0x4')};function emitEvent(_0x27e8d7){return function(_0x120a26,_0x9445c6,_0xf1c243){CmListEvents[_0xf326('0x5')](_0x27e8d7+':'+_0x120a26['id'],_0x120a26);CmListEvents[_0xf326('0x5')](_0x27e8d7,_0x120a26);_0xf1c243(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xf326('0x6')](e,emitEvent(event));}}module[_0xf326('0x7')]=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4a22f3,_0x498fe8){var _0xe7eb07=function(_0x420166){while(--_0x420166){_0x4a22f3['push'](_0x4a22f3['shift']());}};_0xe7eb07(++_0x498fe8);}(_0x814b,0x1a2));var _0xb814=function(_0x49ca6b,_0x3ba842){_0x49ca6b=_0x49ca6b-0x0;var _0x1d957f=_0x814b[_0x49ca6b];return _0x1d957f;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index e1b97a6..5305937 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 _0xec56=['define','CmList','cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x5be5e1,_0x23c52c){var _0x1a3052=function(_0x2a9c1c){while(--_0x2a9c1c){_0x5be5e1['push'](_0x5be5e1['shift']());}};_0x1a3052(++_0x23c52c);}(_0xec56,0x1bd));var _0x6ec5=function(_0x53d1c5,_0x8f5177){_0x53d1c5=_0x53d1c5-0x0;var _0x367f68=_0xec56[_0x53d1c5];return _0x367f68;};'use strict';var _=require(_0x6ec5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec5('0x1'));var moment=require(_0x6ec5('0x2'));var BPromise=require(_0x6ec5('0x3'));var rp=require(_0x6ec5('0x4'));var fs=require('fs');var path=require(_0x6ec5('0x5'));var rimraf=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var attributes=require(_0x6ec5('0x8'));module[_0x6ec5('0x9')]=function(_0x28b12b,_0x2d0a93){return _0x28b12b[_0x6ec5('0xa')](_0x6ec5('0xb'),attributes,{'tableName':_0x6ec5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0x47dc9f,_0x4f4fe3){var _0x48e9b2=function(_0x4597d9){while(--_0x4597d9){_0x47dc9f['push'](_0x47dc9f['shift']());}};_0x48e9b2(++_0x4f4fe3);}(_0xb43b,0x1b2));var _0xbb43=function(_0xcb5135,_0x19f233){_0xcb5135=_0xcb5135-0x0;var _0x8adb89=_0xb43b[_0xcb5135];return _0x8adb89;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'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 90a83b7..46271dd 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 _0x4cf6=['CmList,\x20%s,\x20%s','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x492d69,_0x37fb34){var _0x1d1f51=function(_0x5e100c){while(--_0x5e100c){_0x492d69['push'](_0x492d69['shift']());}};_0x1d1f51(++_0x37fb34);}(_0x4cf6,0xbc));var _0x64cf=function(_0x353bad,_0x2f9cd9){_0x353bad=_0x353bad-0x0;var _0xeca0a1=_0x4cf6[_0x353bad];return _0xeca0a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x64cf('0x0'));var BPromise=require(_0x64cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64cf('0x2'))['db'];var utils=require(_0x64cf('0x3'));var logger=require(_0x64cf('0x4'))(_0x64cf('0x5'));var config=require('../../config/environment');var jayson=require(_0x64cf('0x6'));var client=jayson[_0x64cf('0x7')]['http']({'port':0x232a});config['redis']=_[_0x64cf('0x8')](config[_0x64cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x64cf('0xa'))(new Redis(config[_0x64cf('0x9')]));require(_0x64cf('0xb'))[_0x64cf('0xc')](socket);function respondWithRpcPromise(_0x47e844,_0x486cdd,_0x5a4bd5){return new BPromise(function(_0x546746,_0x10e65e){return client['request'](_0x47e844,_0x5a4bd5)[_0x64cf('0xd')](function(_0x2e035d){logger[_0x64cf('0xe')]('CmList,\x20%s,\x20%s',_0x486cdd,_0x64cf('0xf'));logger['debug'](_0x64cf('0x10'),_0x486cdd,_0x64cf('0xf'),JSON[_0x64cf('0x11')](_0x2e035d));if(_0x2e035d[_0x64cf('0x12')]){if(_0x2e035d[_0x64cf('0x12')]['code']===0x1f4){logger['error'](_0x64cf('0x13'),_0x486cdd,_0x2e035d['error'][_0x64cf('0x14')]);return _0x10e65e(_0x2e035d[_0x64cf('0x12')]['message']);}logger[_0x64cf('0x12')]('CmList,\x20%s,\x20%s',_0x486cdd,_0x2e035d[_0x64cf('0x12')]['message']);return _0x546746(_0x2e035d[_0x64cf('0x12')]['message']);}else{logger[_0x64cf('0xe')](_0x64cf('0x13'),_0x486cdd,_0x64cf('0xf'));_0x546746(_0x2e035d[_0x64cf('0x15')][_0x64cf('0x14')]);}})[_0x64cf('0x16')](function(_0x1c1945){logger[_0x64cf('0x12')](_0x64cf('0x13'),_0x486cdd,_0x1c1945);_0x10e65e(_0x1c1945);});});} \ No newline at end of file +var _0x29b6=['code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fe565,_0x4fac8d){var _0x49b534=function(_0x34fedd){while(--_0x34fedd){_0x4fe565['push'](_0x4fe565['shift']());}};_0x49b534(++_0x4fac8d);}(_0x29b6,0xed));var _0x629b=function(_0x3e3064,_0x3dd6f5){_0x3e3064=_0x3e3064-0x0;var _0x4547e1=_0x29b6[_0x3e3064];return _0x4547e1;};'use strict';var _=require(_0x629b('0x0'));var util=require(_0x629b('0x1'));var moment=require(_0x629b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x629b('0x3'));var db=require(_0x629b('0x4'))['db'];var utils=require(_0x629b('0x5'));var logger=require(_0x629b('0x6'))(_0x629b('0x7'));var config=require(_0x629b('0x8'));var jayson=require(_0x629b('0x9'));var client=jayson['client'][_0x629b('0xa')]({'port':0x232a});config[_0x629b('0xb')]=_[_0x629b('0xc')](config[_0x629b('0xb')],{'host':_0x629b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x629b('0xb')]));require(_0x629b('0xe'))[_0x629b('0xf')](socket);function respondWithRpcPromise(_0x2e3aa7,_0x3470bd,_0x87e455){return new BPromise(function(_0x3a6d9f,_0xfaef55){return client[_0x629b('0x10')](_0x2e3aa7,_0x87e455)[_0x629b('0x11')](function(_0x53261c){logger[_0x629b('0x12')]('CmList,\x20%s,\x20%s',_0x3470bd,_0x629b('0x13'));logger[_0x629b('0x14')](_0x629b('0x15'),_0x3470bd,'request\x20sent',JSON[_0x629b('0x16')](_0x53261c));if(_0x53261c[_0x629b('0x17')]){if(_0x53261c[_0x629b('0x17')][_0x629b('0x18')]===0x1f4){logger[_0x629b('0x17')](_0x629b('0x19'),_0x3470bd,_0x53261c[_0x629b('0x17')][_0x629b('0x1a')]);return _0xfaef55(_0x53261c['error'][_0x629b('0x1a')]);}logger['error'](_0x629b('0x19'),_0x3470bd,_0x53261c[_0x629b('0x17')]['message']);return _0x3a6d9f(_0x53261c['error']['message']);}else{logger[_0x629b('0x12')]('CmList,\x20%s,\x20%s',_0x3470bd,_0x629b('0x13'));_0x3a6d9f(_0x53261c[_0x629b('0x1b')][_0x629b('0x1a')]);}})[_0x629b('0x1c')](function(_0x3a9b22){logger['error']('CmList,\x20%s,\x20%s',_0x3470bd,_0x3a9b22);_0xfaef55(_0x3a9b22);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f9a599f..e672606 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 _0xdcee=['cmList:','save','remove','emit','removeListener','register','length'];(function(_0x2e0586,_0x4f0005){var _0x44323a=function(_0x433992){while(--_0x433992){_0x2e0586['push'](_0x2e0586['shift']());}};_0x44323a(++_0x4f0005);}(_0xdcee,0xb7));var _0xedce=function(_0x2b6453,_0xbaeaf){_0x2b6453=_0x2b6453-0x0;var _0x3fa2dc=_0xdcee[_0x2b6453];return _0x3fa2dc;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xedce('0x0'),_0xedce('0x1'),'update'];function createListener(_0x40680e,_0x31d0ae){return function(_0x519ac6){_0x31d0ae[_0xedce('0x2')](_0x40680e,_0x519ac6);};}function removeListener(_0x5e997e,_0x3300e5){return function(){CmListEvents[_0xedce('0x3')](_0x5e997e,_0x3300e5);};}exports[_0xedce('0x4')]=function(_0x2d88a1){for(var _0x144a55=0x0,_0x379aa5=events[_0xedce('0x5')];_0x144a55<_0x379aa5;_0x144a55++){var _0x5278c7=events[_0x144a55];var _0xb8acf2=createListener(_0xedce('0x6')+_0x5278c7,_0x2d88a1);CmListEvents['on'](_0x5278c7,_0xb8acf2);}}; \ No newline at end of file +var _0x499b=['removeListener','register','length','cmList:','remove','update','emit'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x499b,0x11c));var _0xb499=function(_0x336cb6,_0x5d277b){_0x336cb6=_0x336cb6-0x0;var _0x358d2c=_0x499b[_0x336cb6];return _0x358d2c;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xb499('0x0'),_0xb499('0x1')];function createListener(_0x7d5bf9,_0x9b5c11){return function(_0x284c9a){_0x9b5c11[_0xb499('0x2')](_0x7d5bf9,_0x284c9a);};}function removeListener(_0x19ad2f,_0x1285eb){return function(){CmListEvents[_0xb499('0x3')](_0x19ad2f,_0x1285eb);};}exports[_0xb499('0x4')]=function(_0x44a193){for(var _0x4a5e62=0x0,_0xe22b10=events[_0xb499('0x5')];_0x4a5e62<_0xe22b10;_0x4a5e62++){var _0x20f373=events[_0x4a5e62];var _0x599678=createListener(_0xb499('0x6')+_0x20f373,_0x44a193);CmListEvents['on'](_0x20f373,_0x599678);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3fba805..f71fdf0 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 _0x2323=['../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','Router','fs-extra'];(function(_0x38d85e,_0x49c741){var _0x21491e=function(_0x6018d0){while(--_0x6018d0){_0x38d85e['push'](_0x38d85e['shift']());}};_0x21491e(++_0x49c741);}(_0x2323,0x146));var _0x3232=function(_0x422eae,_0x2bbd48){_0x422eae=_0x422eae-0x0;var _0x442cca=_0x2323[_0x422eae];return _0x442cca;};'use strict';var multer=require(_0x3232('0x0'));var util=require(_0x3232('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3232('0x2')]();var fs_extra=require(_0x3232('0x3'));var auth=require(_0x3232('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3232('0x5'));var controller=require(_0x3232('0x6'));router[_0x3232('0x7')]('/',auth[_0x3232('0x8')](),controller[_0x3232('0x9')]);router[_0x3232('0x7')](_0x3232('0xa'),auth[_0x3232('0x8')](),controller[_0x3232('0xb')]);router['get'](_0x3232('0xc'),auth[_0x3232('0x8')](),controller[_0x3232('0xd')]);router['get'](_0x3232('0xe'),auth[_0x3232('0x8')](),controller[_0x3232('0xf')]);router[_0x3232('0x7')](_0x3232('0x10'),auth[_0x3232('0x8')](),controller[_0x3232('0x11')]);router['get'](_0x3232('0x12'),auth['isAuthenticated'](),controller[_0x3232('0x13')]);router[_0x3232('0x7')](_0x3232('0x14'),auth['isAuthenticated'](),controller[_0x3232('0x15')]);router[_0x3232('0x7')](_0x3232('0x16'),auth['isAuthenticated'](),controller[_0x3232('0x17')]);router[_0x3232('0x18')]('/',auth[_0x3232('0x8')](),controller['create']);router['post'](_0x3232('0xe'),auth[_0x3232('0x8')](),controller[_0x3232('0x19')]);router[_0x3232('0x18')](_0x3232('0x10'),auth[_0x3232('0x8')](),controller[_0x3232('0x1a')]);router[_0x3232('0x18')](_0x3232('0x14'),auth[_0x3232('0x8')](),controller['addCustomField']);router[_0x3232('0x18')](_0x3232('0x16'),auth[_0x3232('0x8')](),controller['addAgents']);router['put'](_0x3232('0xc'),auth['isAuthenticated'](),controller[_0x3232('0x1b')]);router[_0x3232('0x1c')]('/:id',auth[_0x3232('0x8')](),controller[_0x3232('0x1d')]);router[_0x3232('0x1c')]('/:id/dispositions',auth[_0x3232('0x8')](),controller[_0x3232('0x1e')]);router[_0x3232('0x1c')](_0x3232('0x16'),auth['isAuthenticated'](),controller[_0x3232('0x1f')]);module[_0x3232('0x20')]=router; \ No newline at end of file +var _0x00ad=['../../components/interaction/service','../../config/environment','./cmList.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4bf4b1,_0x1317f4){var _0x4a02de=function(_0x198020){while(--_0x198020){_0x4bf4b1['push'](_0x4bf4b1['shift']());}};_0x4a02de(++_0x1317f4);}(_0x00ad,0x15a));var _0xd00a=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x00ad[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var path=require('path');var timeout=require(_0xd00a('0x2'));var express=require(_0xd00a('0x3'));var router=express[_0xd00a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd00a('0x5'));var interaction=require(_0xd00a('0x6'));var config=require(_0xd00a('0x7'));var controller=require(_0xd00a('0x8'));router[_0xd00a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd00a('0xa')]);router[_0xd00a('0x9')]('/describe',auth[_0xd00a('0xb')](),controller[_0xd00a('0xc')]);router[_0xd00a('0x9')](_0xd00a('0xd'),auth[_0xd00a('0xb')](),controller[_0xd00a('0xe')]);router['get'](_0xd00a('0xf'),auth['isAuthenticated'](),controller[_0xd00a('0x10')]);router[_0xd00a('0x9')](_0xd00a('0x11'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x12')]);router[_0xd00a('0x9')]('/:id/contacts/csv',auth[_0xd00a('0xb')](),controller[_0xd00a('0x13')]);router[_0xd00a('0x9')](_0xd00a('0x14'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x15')]);router[_0xd00a('0x9')](_0xd00a('0x16'),auth[_0xd00a('0xb')](),controller['getAgents']);router[_0xd00a('0x17')]('/',auth[_0xd00a('0xb')](),controller['create']);router[_0xd00a('0x17')](_0xd00a('0xf'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x18')]);router[_0xd00a('0x17')]('/:id/contacts',auth[_0xd00a('0xb')](),controller[_0xd00a('0x19')]);router[_0xd00a('0x17')](_0xd00a('0x14'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xd00a('0x17')]('/:id/users',auth[_0xd00a('0xb')](),controller[_0xd00a('0x1a')]);router[_0xd00a('0x1b')](_0xd00a('0xd'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x1c')]);router[_0xd00a('0x1d')](_0xd00a('0xd'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x1e')]);router[_0xd00a('0x1d')]('/:id/dispositions',auth[_0xd00a('0xb')](),controller['removeDispositions']);router['delete'](_0xd00a('0x16'),auth[_0xd00a('0xb')](),controller[_0xd00a('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 48c322c..1b2af48 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 _0x801b=['getDataValue','field','STRING','exports'];(function(_0x3f34ae,_0xb4c2fb){var _0x1b3a38=function(_0x38de9a){while(--_0x38de9a){_0x3f34ae['push'](_0x3f34ae['shift']());}};_0x1b3a38(++_0xb4c2fb);}(_0x801b,0x8f));var _0xb801=function(_0x2a95df,_0x1c3d61){_0x2a95df=_0x2a95df-0x0;var _0x1bf3cf=_0x801b[_0x2a95df];return _0x1bf3cf;};'use strict';var Sequelize=require('sequelize');module[_0xb801('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1f9531){return this[_0xb801('0x1')](_0xb801('0x2'));}},'field':{'type':Sequelize[_0xb801('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb801('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x816c=['exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x816c,0xa0));var _0xc816=function(_0x34e29e,_0x3d6df5){_0x34e29e=_0x34e29e-0x0;var _0x4d0088=_0x816c[_0x34e29e];return _0x4d0088;};'use strict';var Sequelize=require('sequelize');module[_0xc816('0x0')]={'name':{'type':Sequelize[_0xc816('0x1')],'get':function(_0x128267){return this[_0xc816('0x2')](_0xc816('0x3'));}},'field':{'type':Sequelize[_0xc816('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xc816('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xc816('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 5151e02..e6952fe 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(_0x5d2868,_0x1f1a09){var _0xdf1f3e=function(_0x3f1e80){while(--_0x3f1e80){_0x5d2868['push'](_0x5d2868['shift']());}};_0xdf1f3e(++_0x1f1a09);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4e1691,_0x42c1bf){var _0xe77c2e=function(_0x311575){while(--_0x311575){_0x4e1691['push'](_0x4e1691['shift']());}};_0xe77c2e(++_0x42c1bf);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index dacc442..3738db3 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 _0x28ec=['exports','tools_conditions','util','api','moment','bluebird','path','rimraf','./condition.attributes'];(function(_0x8e70d4,_0xe07554){var _0x5a4942=function(_0x411fd4){while(--_0x411fd4){_0x8e70d4['push'](_0x8e70d4['shift']());}};_0x5a4942(++_0xe07554);}(_0x28ec,0xe3));var _0xc28e=function(_0x37eac4,_0x3261e5){_0x37eac4=_0x37eac4-0x0;var _0x1900bb=_0x28ec[_0x37eac4];return _0x1900bb;};'use strict';var _=require('lodash');var util=require(_0xc28e('0x0'));var logger=require('../../config/logger')(_0xc28e('0x1'));var moment=require(_0xc28e('0x2'));var BPromise=require(_0xc28e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc28e('0x4'));var rimraf=require(_0xc28e('0x5'));var config=require('../../config/environment');var attributes=require(_0xc28e('0x6'));module[_0xc28e('0x7')]=function(_0x412f12,_0x4e38cb){return _0x412f12['define']('Condition',attributes,{'tableName':_0xc28e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ace=['bluebird','request-promise','path','rimraf','../../config/environment','define','tools_conditions','lodash','../../config/logger','moment'];(function(_0x159f5f,_0x22e2fa){var _0x279d4f=function(_0x3d8ac5){while(--_0x3d8ac5){_0x159f5f['push'](_0x159f5f['shift']());}};_0x279d4f(++_0x22e2fa);}(_0x7ace,0xe3));var _0xe7ac=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7ace[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0xe7ac('0x0'));var util=require('util');var logger=require(_0xe7ac('0x1'))('api');var moment=require(_0xe7ac('0x2'));var BPromise=require(_0xe7ac('0x3'));var rp=require(_0xe7ac('0x4'));var fs=require('fs');var path=require(_0xe7ac('0x5'));var rimraf=require(_0xe7ac('0x6'));var config=require(_0xe7ac('0x7'));var attributes=require('./condition.attributes');module['exports']=function(_0x3f37ec,_0x4dfbfb){return _0x3f37ec[_0xe7ac('0x8')]('Condition',attributes,{'tableName':_0xe7ac('0x9'),'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 ab7b464..3ecc33e 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 _0xb1f1=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0xb1f1,0x122));var _0x1b1f=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xb1f1[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x1b1f('0x0'));var util=require(_0x1b1f('0x1'));var moment=require(_0x1b1f('0x2'));var BPromise=require(_0x1b1f('0x3'));var rs=require(_0x1b1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b1f('0x5'))['db'];var utils=require(_0x1b1f('0x6'));var logger=require(_0x1b1f('0x7'))('rpc');var config=require(_0x1b1f('0x8'));var jayson=require(_0x1b1f('0x9'));var client=jayson[_0x1b1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ccf00,_0x564908,_0x5cf277){return new BPromise(function(_0x340943,_0x3b290d){return client[_0x1b1f('0xb')](_0x5ccf00,_0x5cf277)[_0x1b1f('0xc')](function(_0x3b2092){logger[_0x1b1f('0xd')](_0x1b1f('0xe'),_0x564908,_0x1b1f('0xf'));logger[_0x1b1f('0x10')](_0x1b1f('0x11'),_0x564908,_0x1b1f('0xf'),JSON['stringify'](_0x3b2092));if(_0x3b2092[_0x1b1f('0x12')]){if(_0x3b2092[_0x1b1f('0x12')]['code']===0x1f4){logger[_0x1b1f('0x12')](_0x1b1f('0xe'),_0x564908,_0x3b2092['error'][_0x1b1f('0x13')]);return _0x3b290d(_0x3b2092[_0x1b1f('0x12')]['message']);}logger[_0x1b1f('0x12')](_0x1b1f('0xe'),_0x564908,_0x3b2092[_0x1b1f('0x12')]['message']);return _0x340943(_0x3b2092[_0x1b1f('0x12')]['message']);}else{logger[_0x1b1f('0xd')](_0x1b1f('0xe'),_0x564908,_0x1b1f('0xf'));_0x340943(_0x3b2092['result'][_0x1b1f('0x13')]);}})[_0x1b1f('0x14')](function(_0x5a81c7){logger[_0x1b1f('0x12')](_0x1b1f('0xe'),_0x564908,_0x5a81c7);_0x3b290d(_0x5a81c7);});});} \ No newline at end of file +var _0x514a=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0x514a,0x90));var _0xa514=function(_0x291956,_0xee9f9d){_0x291956=_0x291956-0x0;var _0x4b874a=_0x514a[_0x291956];return _0x4b874a;};'use strict';var _=require('lodash');var util=require(_0xa514('0x0'));var moment=require(_0xa514('0x1'));var BPromise=require('bluebird');var rs=require(_0xa514('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa514('0x3'))['db'];var utils=require(_0xa514('0x4'));var logger=require(_0xa514('0x5'))(_0xa514('0x6'));var config=require(_0xa514('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa514('0x8')][_0xa514('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed674,_0x2bf39e,_0x17ea3c){return new BPromise(function(_0x33d63a,_0x4c01fa){return client[_0xa514('0xa')](_0x1ed674,_0x17ea3c)['then'](function(_0x2f48ba){logger[_0xa514('0xb')](_0xa514('0xc'),_0x2bf39e,_0xa514('0xd'));logger[_0xa514('0xe')](_0xa514('0xf'),_0x2bf39e,_0xa514('0xd'),JSON['stringify'](_0x2f48ba));if(_0x2f48ba[_0xa514('0x10')]){if(_0x2f48ba[_0xa514('0x10')]['code']===0x1f4){logger['error'](_0xa514('0xc'),_0x2bf39e,_0x2f48ba[_0xa514('0x10')][_0xa514('0x11')]);return _0x4c01fa(_0x2f48ba[_0xa514('0x10')][_0xa514('0x11')]);}logger[_0xa514('0x10')](_0xa514('0xc'),_0x2bf39e,_0x2f48ba[_0xa514('0x10')][_0xa514('0x11')]);return _0x33d63a(_0x2f48ba[_0xa514('0x10')][_0xa514('0x11')]);}else{logger[_0xa514('0xb')]('Condition,\x20%s,\x20%s',_0x2bf39e,'request\x20sent');_0x33d63a(_0x2f48ba['result'][_0xa514('0x11')]);}})['catch'](function(_0x3718b6){logger['error'](_0xa514('0xc'),_0x2bf39e,_0x3718b6);_0x4c01fa(_0x3718b6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5fc5a0a..8359fd2 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 _0x3c16=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3400e0,_0x15ce27){var _0x4f32d6=function(_0x1805de){while(--_0x1805de){_0x3400e0['push'](_0x3400e0['shift']());}};_0x4f32d6(++_0x15ce27);}(_0x3c16,0x1dc));var _0x63c1=function(_0x2e02f7,_0x4e69e6){_0x2e02f7=_0x2e02f7-0x0;var _0x459699=_0x3c16[_0x2e02f7];return _0x459699;};'use strict';var multer=require(_0x63c1('0x0'));var util=require(_0x63c1('0x1'));var path=require(_0x63c1('0x2'));var timeout=require(_0x63c1('0x3'));var express=require(_0x63c1('0x4'));var router=express[_0x63c1('0x5')]();var fs_extra=require(_0x63c1('0x6'));var auth=require(_0x63c1('0x7'));var interaction=require(_0x63c1('0x8'));var config=require(_0x63c1('0x9'));var controller=require('./condition.controller');router['put'](_0x63c1('0xa'),auth[_0x63c1('0xb')](),controller[_0x63c1('0xc')]);router['delete'](_0x63c1('0xa'),auth['isAuthenticated'](),controller[_0x63c1('0xd')]);module[_0x63c1('0xe')]=router; \ No newline at end of file +var _0xc692=['../../config/environment','put','isAuthenticated','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x6639ef,_0x41434f){var _0x4deb1f=function(_0x326853){while(--_0x326853){_0x6639ef['push'](_0x6639ef['shift']());}};_0x4deb1f(++_0x41434f);}(_0xc692,0x173));var _0x2c69=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc692[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var path=require(_0x2c69('0x2'));var timeout=require(_0x2c69('0x3'));var express=require(_0x2c69('0x4'));var router=express[_0x2c69('0x5')]();var fs_extra=require(_0x2c69('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c69('0x7'));var controller=require('./condition.controller');router[_0x2c69('0x8')]('/:id',auth[_0x2c69('0x9')](),controller[_0x2c69('0xa')]);router['delete'](_0x2c69('0xb'),auth[_0x2c69('0x9')](),controller[_0x2c69('0xc')]);module[_0x2c69('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 2b7abb6..b733bbf 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 _0x2032=['name','exports','STRING'];(function(_0x41238f,_0xb8968c){var _0x4adee4=function(_0x3b4633){while(--_0x3b4633){_0x41238f['push'](_0x41238f['shift']());}};_0x4adee4(++_0xb8968c);}(_0x2032,0xd9));var _0x2203=function(_0x3642a3,_0x129f36){_0x3642a3=_0x3642a3-0x0;var _0x467794=_0x2032[_0x3642a3];return _0x467794;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xb7e7[_0x75f869];return _0x10af8b;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 7d62e69..8c0e89d 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 _0x7209=['value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','querystring','papaparse','../../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','./dashboard.socket','register','sendStatus','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','UserProfileResource','status','error','name','send','index','map','Dashboard','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','keys','include','find','catch','create','body','user','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','omit','updatedAt','createdAt','role','iframe','attrs'];(function(_0x46d349,_0x3821ff){var _0x59ecee=function(_0x262a15){while(--_0x262a15){_0x46d349['push'](_0x46d349['shift']());}};_0x59ecee(++_0x3821ff);}(_0x7209,0x8a));var _0x9720=function(_0x527dff,_0x35471a){_0x527dff=_0x527dff-0x0;var _0x8da020=_0x7209[_0x527dff];return _0x8da020;};'use strict';var emlformat=require(_0x9720('0x0'));var rimraf=require(_0x9720('0x1'));var zipdir=require(_0x9720('0x2'));var jsonpatch=require(_0x9720('0x3'));var rp=require(_0x9720('0x4'));var moment=require('moment');var BPromise=require(_0x9720('0x5'));var Mustache=require('mustache');var util=require(_0x9720('0x6'));var path=require(_0x9720('0x7'));var sox=require('sox');var csv=require(_0x9720('0x8'));var ejs=require(_0x9720('0x9'));var fs=require('fs');var fs_extra=require(_0x9720('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9720('0x8'));var querystring=require(_0x9720('0xb'));var Papa=require(_0x9720('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9720('0xd'));var as=require(_0x9720('0xe'));var hardwareService=require(_0x9720('0xf'));var logger=require(_0x9720('0x10'))(_0x9720('0x11'));var utils=require(_0x9720('0x12'));var config=require(_0x9720('0x13'));var licenseUtil=require(_0x9720('0x14'));var db=require(_0x9720('0x15'))['db'];config[_0x9720('0x16')]=_['defaults'](config[_0x9720('0x16')],{'host':_0x9720('0x17'),'port':0x18eb});var socket=require(_0x9720('0x18'))(new Redis(config[_0x9720('0x16')]));require(_0x9720('0x19'))[_0x9720('0x1a')](socket);function respondWithStatusCode(_0x2ba150,_0x2e72d7){_0x2e72d7=_0x2e72d7||0xcc;return function(_0x261c71){if(_0x261c71){return _0x2ba150[_0x9720('0x1b')](_0x2e72d7);}return _0x2ba150['status'](_0x2e72d7)[_0x9720('0x1c')]();};}function respondWithResult(_0x130673,_0x4260ec){_0x4260ec=_0x4260ec||0xc8;return function(_0x2a7d73){if(_0x2a7d73){return _0x130673['status'](_0x4260ec)[_0x9720('0x1d')](_0x2a7d73);}};}function respondWithFilteredResult(_0x3973f6,_0x2f70c8){return function(_0x4dcf08){if(_0x4dcf08){var _0x360fae=typeof _0x2f70c8[_0x9720('0x1e')]===_0x9720('0x1f')&&typeof _0x2f70c8[_0x9720('0x20')]===_0x9720('0x1f');var _0x45b8f2=_0x4dcf08[_0x9720('0x21')];var _0x238337=_0x360fae?0x0:_0x2f70c8['offset'];var _0x4d3108=_0x360fae?_0x4dcf08[_0x9720('0x21')]:_0x2f70c8[_0x9720('0x1e')]+_0x2f70c8[_0x9720('0x20')];var _0x3a5585;if(_0x4d3108>=_0x45b8f2){_0x4d3108=_0x45b8f2;_0x3a5585=0xc8;}else{_0x3a5585=0xce;}_0x3973f6['status'](_0x3a5585);return _0x3973f6['set']('Content-Range',_0x238337+'-'+_0x4d3108+'/'+_0x45b8f2)[_0x9720('0x1d')](_0x4dcf08);}return null;};}function patchUpdates(_0x2ef57a){return function(_0x1ffb8f){try{jsonpatch[_0x9720('0x22')](_0x1ffb8f,_0x2ef57a,!![]);}catch(_0x288bca){return BPromise[_0x9720('0x23')](_0x288bca);}return _0x1ffb8f['save']();};}function saveUpdates(_0x928ad8,_0x272090){return function(_0xf43358){if(_0xf43358){return _0xf43358[_0x9720('0x24')](_0x928ad8)[_0x9720('0x25')](function(_0x41cd08){return _0x41cd08;});}return null;};}function removeEntity(_0x5e4381,_0x6bb10c){return function(_0x13b392){if(_0x13b392){return _0x13b392[_0x9720('0x26')]()['then'](function(){var _0x48669c=_0x13b392[_0x9720('0x27')]({'plain':!![]});var _0x868314='CustomDashboards';return db[_0x9720('0x28')][_0x9720('0x26')]({'where':{'type':_0x868314,'resourceId':_0x48669c['id']}})['then'](function(){return _0x13b392;});})[_0x9720('0x25')](function(){_0x5e4381[_0x9720('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dbc75,_0x22d5f7){return function(_0x5b4c8a){if(!_0x5b4c8a){_0x4dbc75[_0x9720('0x1b')](0x194);}return _0x5b4c8a;};}function handleError(_0x39fb9b,_0x5d9b27){_0x5d9b27=_0x5d9b27||0x1f4;return function(_0x2dcaa5){logger[_0x9720('0x2a')](_0x2dcaa5['stack']);if(_0x2dcaa5[_0x9720('0x2b')]){delete _0x2dcaa5['name'];}_0x39fb9b[_0x9720('0x29')](_0x5d9b27)[_0x9720('0x2c')](_0x2dcaa5);};}exports[_0x9720('0x2d')]=function(_0x121d24,_0x31ce14){var _0x44feff={},_0x275a5e={},_0x342a34={'count':0x0,'rows':[]};var _0x3e4b01=_[_0x9720('0x2e')](db[_0x9720('0x2f')]['rawAttributes'],function(_0x6f906){return{'name':_0x6f906['fieldName'],'type':_0x6f906['type']['key']};});_0x275a5e['model']=_[_0x9720('0x2e')](_0x3e4b01,'name');_0x275a5e[_0x9720('0x30')]=_['keys'](_0x121d24[_0x9720('0x30')]);_0x275a5e[_0x9720('0x31')]=_[_0x9720('0x32')](_0x275a5e[_0x9720('0x33')],_0x275a5e[_0x9720('0x30')]);_0x44feff[_0x9720('0x34')]=_[_0x9720('0x32')](_0x275a5e[_0x9720('0x33')],qs[_0x9720('0x35')](_0x121d24[_0x9720('0x30')]['fields']));_0x44feff['attributes']=_0x44feff[_0x9720('0x34')][_0x9720('0x36')]?_0x44feff[_0x9720('0x34')]:_0x275a5e[_0x9720('0x33')];if(!_0x121d24[_0x9720('0x30')][_0x9720('0x37')](_0x9720('0x38'))){_0x44feff[_0x9720('0x20')]=qs[_0x9720('0x20')](_0x121d24[_0x9720('0x30')][_0x9720('0x20')]);_0x44feff[_0x9720('0x1e')]=qs[_0x9720('0x1e')](_0x121d24[_0x9720('0x30')][_0x9720('0x1e')]);}_0x44feff[_0x9720('0x39')]=qs[_0x9720('0x3a')](_0x121d24['query'][_0x9720('0x3a')]);_0x44feff[_0x9720('0x3b')]=qs[_0x9720('0x31')](_[_0x9720('0x3c')](_0x121d24[_0x9720('0x30')],_0x275a5e[_0x9720('0x31')]),_0x3e4b01);if(_0x121d24[_0x9720('0x30')][_0x9720('0x3d')]){_0x44feff[_0x9720('0x3b')]=_[_0x9720('0x3e')](_0x44feff['where'],{'$or':_[_0x9720('0x2e')](_0x3e4b01,function(_0x5ec443){if(_0x5ec443[_0x9720('0x3f')]!==_0x9720('0x40')){var _0x24f8a8={};_0x24f8a8[_0x5ec443[_0x9720('0x2b')]]={'$like':'%'+_0x121d24[_0x9720('0x30')][_0x9720('0x3d')]+'%'};return _0x24f8a8;}})});}_0x44feff=_[_0x9720('0x3e')]({},_0x44feff,_0x121d24[_0x9720('0x41')]);var _0xbfa93d={'where':_0x44feff[_0x9720('0x3b')]};return db['Dashboard'][_0x9720('0x21')](_0xbfa93d)[_0x9720('0x25')](function(_0x43b813){_0x342a34['count']=_0x43b813;if(_0x121d24[_0x9720('0x30')][_0x9720('0x42')]){_0x44feff['include']=[{'all':!![]}];}return db[_0x9720('0x2f')][_0x9720('0x43')](_0x44feff);})['then'](function(_0xf7fb09){_0x342a34['rows']=_0xf7fb09;return _0x342a34;})[_0x9720('0x25')](respondWithFilteredResult(_0x31ce14,_0x44feff))['catch'](handleError(_0x31ce14,null));};exports['show']=function(_0x1f4fdc,_0x2e5f40){var _0x2aaf9f={'raw':![],'where':{'id':_0x1f4fdc['params']['id']}},_0xb5cb69={};_0xb5cb69[_0x9720('0x33')]=_[_0x9720('0x44')](db['Dashboard']['rawAttributes']);_0xb5cb69[_0x9720('0x30')]=_['keys'](_0x1f4fdc[_0x9720('0x30')]);_0xb5cb69[_0x9720('0x31')]=_['intersection'](_0xb5cb69[_0x9720('0x33')],_0xb5cb69['query']);_0x2aaf9f['attributes']=_[_0x9720('0x32')](_0xb5cb69[_0x9720('0x33')],qs[_0x9720('0x35')](_0x1f4fdc[_0x9720('0x30')][_0x9720('0x35')]));_0x2aaf9f[_0x9720('0x34')]=_0x2aaf9f[_0x9720('0x34')][_0x9720('0x36')]?_0x2aaf9f['attributes']:_0xb5cb69['model'];if(_0x1f4fdc[_0x9720('0x30')]['includeAll']){_0x2aaf9f[_0x9720('0x45')]=[{'all':!![]}];}_0x2aaf9f=_[_0x9720('0x3e')]({},_0x2aaf9f,_0x1f4fdc[_0x9720('0x41')]);return db[_0x9720('0x2f')][_0x9720('0x46')](_0x2aaf9f)[_0x9720('0x25')](handleEntityNotFound(_0x2e5f40,null))[_0x9720('0x25')](respondWithResult(_0x2e5f40,null))[_0x9720('0x47')](handleError(_0x2e5f40,null));};exports['create']=function(_0x5ef82c,_0x27631e){return db[_0x9720('0x2f')][_0x9720('0x48')](_0x5ef82c[_0x9720('0x49')],{})[_0x9720('0x25')](function(_0xb89ea2){var _0x3f4051=_0x5ef82c[_0x9720('0x4a')][_0x9720('0x27')]({'plain':!![]});if(!_0x3f4051)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f4051['role']===_0x9720('0x4a')){var _0x211dac=_0xb89ea2[_0x9720('0x27')]({'plain':!![]});var _0x208341=_0x9720('0x4b');return db[_0x9720('0x4c')][_0x9720('0x46')]({'where':{'name':_0x208341,'userProfileId':_0x3f4051['userProfileId']},'raw':!![]})[_0x9720('0x25')](function(_0x54e269){if(_0x54e269&&_0x54e269[_0x9720('0x4d')]===0x0){return db[_0x9720('0x28')][_0x9720('0x48')]({'name':_0x211dac['name'],'resourceId':_0x211dac['id'],'type':_0x54e269[_0x9720('0x2b')],'sectionId':_0x54e269['id']},{})['then'](function(){return _0xb89ea2;});}else{return _0xb89ea2;}})[_0x9720('0x47')](function(_0x5baad6){logger[_0x9720('0x2a')](_0x9720('0x4e'),_0x5baad6);throw _0x5baad6;});}return _0xb89ea2;})['then'](respondWithResult(_0x27631e,0xc9))[_0x9720('0x47')](handleError(_0x27631e,null));};exports[_0x9720('0x4f')]=function(_0x2d8ebb,_0x1c5c59){var _0xb467fb={'where':{'id':_0x2d8ebb[_0x9720('0x50')]['id']}},_0x5b8f34={};_0x5b8f34['model']=_['keys'](db[_0x9720('0x2f')][_0x9720('0x51')]);_0xb467fb['attributes']=_['intersection'](_0x5b8f34[_0x9720('0x33')],qs[_0x9720('0x35')](_0x2d8ebb[_0x9720('0x30')]['fields']));_0xb467fb[_0x9720('0x34')]=_0xb467fb['attributes'][_0x9720('0x36')]?_0xb467fb[_0x9720('0x34')]:_0x5b8f34[_0x9720('0x33')];if(_0x2d8ebb[_0x9720('0x30')][_0x9720('0x42')]){_0xb467fb[_0x9720('0x45')]=[{'all':!![]}];}_0xb467fb=_[_0x9720('0x3e')]({},_0xb467fb,_0x2d8ebb['options']);return db[_0x9720('0x2f')][_0x9720('0x46')](_0xb467fb)[_0x9720('0x25')](handleEntityNotFound(_0x1c5c59,null))['then'](function(_0x423b5e){if(_0x423b5e){var _0x1cd264=_0x423b5e[_0x9720('0x27')]({'plain':!![]});_0x1cd264=qs[_0x9720('0x52')](_0x1cd264,['id','createdAt',_0x9720('0x53')]);_0x2d8ebb[_0x9720('0x49')]=_['omit'](_0x2d8ebb[_0x9720('0x49')],['id',_0x9720('0x54'),'updatedAt']);return db['Dashboard']['create'](_[_0x9720('0x3e')](_0x1cd264,_0x2d8ebb[_0x9720('0x49')]),{'include':_0x2d8ebb['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x295c86){var _0x26a666=_0x2d8ebb[_0x9720('0x4a')][_0x9720('0x27')]({'plain':!![]});if(!_0x26a666)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26a666[_0x9720('0x55')]==='user'){var _0x202e75=_0x295c86[_0x9720('0x27')]({'plain':!![]});var _0x27a3bc=_0x9720('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x27a3bc,'userProfileId':_0x26a666['userProfileId']},'raw':!![]})[_0x9720('0x25')](function(_0x560aa0){if(_0x560aa0&&_0x560aa0[_0x9720('0x4d')]===0x0){return db[_0x9720('0x28')][_0x9720('0x48')]({'name':_0x202e75['name'],'resourceId':_0x202e75['id'],'type':_0x560aa0[_0x9720('0x2b')],'sectionId':_0x560aa0['id']},{})[_0x9720('0x25')](function(){return _0x295c86;});}else{return _0x295c86;}})[_0x9720('0x47')](function(_0x5e3bd7){logger[_0x9720('0x2a')](_0x9720('0x4e'),_0x5e3bd7);throw _0x5e3bd7;});}return _0x295c86;});}})[_0x9720('0x25')](respondWithResult(_0x1c5c59,0xc9))['catch'](handleError(_0x1c5c59,null));};exports['update']=function(_0x8f30dd,_0x42d885){if(_0x8f30dd[_0x9720('0x49')]['id']){delete _0x8f30dd[_0x9720('0x49')]['id'];}return db['Dashboard'][_0x9720('0x46')]({'where':{'id':_0x8f30dd[_0x9720('0x50')]['id']}})[_0x9720('0x25')](handleEntityNotFound(_0x42d885,null))[_0x9720('0x25')](saveUpdates(_0x8f30dd[_0x9720('0x49')],null))[_0x9720('0x25')](respondWithResult(_0x42d885,null))[_0x9720('0x47')](handleError(_0x42d885,null));};exports[_0x9720('0x26')]=function(_0x3416a0,_0x2ec0de){return db[_0x9720('0x2f')]['find']({'where':{'id':_0x3416a0[_0x9720('0x50')]['id']}})[_0x9720('0x25')](handleEntityNotFound(_0x2ec0de,null))[_0x9720('0x25')](removeEntity(_0x2ec0de,null))['catch'](handleError(_0x2ec0de,null));};function widgetAttributes(_0x2d210e){try{switch(_0x2d210e['type']){case _0x9720('0x56'):return[{'name':'attrUrl','value':_0x2d210e['attrUrl']||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x0]?_0x2d210e[_0x9720('0x57')][0x0][_0x9720('0x58')]:undefined)||_0x9720('0x59')}];case _0x9720('0x5a'):return[{'name':_0x9720('0x5b'),'value':_0x2d210e[_0x9720('0x5b')]||(_0x2d210e['attrs']&&_0x2d210e[_0x9720('0x57')][0x0]?_0x2d210e[_0x9720('0x57')][0x0][_0x9720('0x58')]:undefined)||''}];case _0x9720('0x5c'):return[{'name':_0x9720('0x5d'),'value':_0x2d210e[_0x9720('0x5d')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e['attrs'][0x0]?_0x2d210e['attrs'][0x0][_0x9720('0x58')]:undefined)||'HH:mm:ss'},{'name':_0x9720('0x5e'),'value':_0x2d210e[_0x9720('0x5e')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x1]?_0x2d210e[_0x9720('0x57')][0x1][_0x9720('0x58')]:undefined)||_0x9720('0x5f')},{'name':_0x9720('0x60'),'value':_0x2d210e['attrFontSize']||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e['attrs'][0x2]?_0x2d210e[_0x9720('0x57')][0x2][_0x9720('0x58')]:undefined)||0xc}];case _0x9720('0x61'):return[{'name':_0x9720('0x62'),'value':_0x2d210e[_0x9720('0x62')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e['attrs'][0x0]?_0x2d210e[_0x9720('0x57')][0x0][_0x9720('0x58')]:undefined)||_0x9720('0x63')},{'name':'attrVoiceQueues','value':_0x2d210e[_0x9720('0x64')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e['attrs'][0x1]?_0x2d210e[_0x9720('0x57')][0x1][_0x9720('0x58')]:undefined)||[]},{'name':_0x9720('0x60'),'value':_0x2d210e[_0x9720('0x60')]||(_0x2d210e['attrs']&&_0x2d210e[_0x9720('0x57')][0x2]?_0x2d210e['attrs'][0x2][_0x9720('0x58')]:undefined)||0x14}];case _0x9720('0x65'):case'pie-chart':return[{'name':'attrSerie1','value':_0x2d210e[_0x9720('0x66')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x0]?_0x2d210e[_0x9720('0x57')][0x0][_0x9720('0x58')]:undefined)||_0x9720('0x63')},{'name':_0x9720('0x67'),'value':_0x2d210e[_0x9720('0x67')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x1]?_0x2d210e[_0x9720('0x57')][0x1]['value']:undefined)||null},{'name':_0x9720('0x68'),'value':_0x2d210e['attrSerie3']||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x2]?_0x2d210e[_0x9720('0x57')][0x2][_0x9720('0x58')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2d210e['attrVoiceQueues']||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x3]?_0x2d210e[_0x9720('0x57')][0x3][_0x9720('0x58')]:undefined)||[]}];case'web-report':return[{'name':_0x9720('0x69'),'type':_0x2d210e[_0x9720('0x6a')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x0]?_0x2d210e[_0x9720('0x57')][0x0]['type']:undefined)||null,'value':_0x2d210e[_0x9720('0x69')]||(_0x2d210e['attrs']&&_0x2d210e[_0x9720('0x57')][0x0]?_0x2d210e[_0x9720('0x57')][0x0][_0x9720('0x58')]:undefined)||null},{'name':_0x9720('0x6b'),'value':_0x2d210e[_0x9720('0x6b')]||(_0x2d210e[_0x9720('0x57')]&&_0x2d210e[_0x9720('0x57')][0x1]?_0x2d210e[_0x9720('0x57')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x11b60c){logger['error'](_0x9720('0x6c'),JSON[_0x9720('0x6d')](_0x11b60c));return[];}}exports[_0x9720('0x6e')]=function(_0x516642,_0x3fe351,_0x2cec7f){if(_0x516642['body']['id']){delete _0x516642[_0x9720('0x49')]['id'];}return db[_0x9720('0x2f')][_0x9720('0x46')]({'where':{'id':_0x516642[_0x9720('0x50')]['id']}})[_0x9720('0x25')](handleEntityNotFound(_0x3fe351,null))[_0x9720('0x25')](function(_0x10b016){if(_0x10b016){_0x516642[_0x9720('0x49')][_0x9720('0x6f')]=_0x10b016['id'];_0x516642[_0x9720('0x49')][_0x9720('0x57')]=widgetAttributes(_0x516642['body']);return db[_0x9720('0x70')]['create'](_0x516642[_0x9720('0x49')]);}})[_0x9720('0x25')](respondWithResult(_0x3fe351,null))[_0x9720('0x47')](handleError(_0x3fe351,null));};exports['getItems']=function(_0x517082,_0x258c25,_0x3ba952){var _0x3e63fa={};var _0x1ceecd={};var _0x2be9db;var _0x498955;return db[_0x9720('0x2f')]['findOne']({'where':{'id':_0x517082[_0x9720('0x50')]['id']}})[_0x9720('0x25')](handleEntityNotFound(_0x258c25,null))[_0x9720('0x25')](function(_0x3afda4){if(_0x3afda4){_0x2be9db=_0x3afda4;_0x1ceecd[_0x9720('0x33')]=_[_0x9720('0x44')](db[_0x9720('0x70')][_0x9720('0x51')]);_0x1ceecd[_0x9720('0x30')]=_['keys'](_0x517082[_0x9720('0x30')]);_0x1ceecd[_0x9720('0x31')]=_['intersection'](_0x1ceecd['model'],_0x1ceecd['query']);_0x3e63fa[_0x9720('0x34')]=_[_0x9720('0x32')](_0x1ceecd[_0x9720('0x33')],qs[_0x9720('0x35')](_0x517082[_0x9720('0x30')][_0x9720('0x35')]));_0x3e63fa[_0x9720('0x34')]=_0x3e63fa[_0x9720('0x34')]['length']?_0x3e63fa[_0x9720('0x34')]:_0x1ceecd['model'];_0x3e63fa['order']=qs['sort'](_0x517082[_0x9720('0x30')][_0x9720('0x3a')]);_0x3e63fa[_0x9720('0x3b')]=qs[_0x9720('0x31')](_[_0x9720('0x3c')](_0x517082[_0x9720('0x30')],_0x1ceecd[_0x9720('0x31')]));if(_0x517082[_0x9720('0x30')]['filter']){_0x3e63fa['where']=_[_0x9720('0x3e')](_0x3e63fa[_0x9720('0x3b')],{'$or':_[_0x9720('0x2e')](_0x3e63fa['attributes'],function(_0x2c2107){var _0x49e543={};_0x49e543[_0x2c2107]={'$like':'%'+_0x517082[_0x9720('0x30')][_0x9720('0x3d')]+'%'};return _0x49e543;})});}_0x3e63fa=_['merge']({},_0x3e63fa,_0x517082[_0x9720('0x41')]);return _0x2be9db['getItems'](_0x3e63fa);}})[_0x9720('0x25')](function(_0x5c0f4d){if(_0x5c0f4d){_0x498955=_0x5c0f4d[_0x9720('0x36')];if(!_0x517082[_0x9720('0x30')]['hasOwnProperty']('nolimit')){_0x3e63fa[_0x9720('0x20')]=qs[_0x9720('0x20')](_0x517082[_0x9720('0x30')][_0x9720('0x20')]);_0x3e63fa[_0x9720('0x1e')]=qs['offset'](_0x517082['query']['offset']);}return _0x2be9db['getItems'](_0x3e63fa);}})[_0x9720('0x25')](function(_0x31395f){if(_0x31395f){return _0x31395f?{'count':_0x498955,'rows':_0x31395f}:null;}})[_0x9720('0x25')](respondWithResult(_0x258c25,null))['catch'](handleError(_0x258c25,null));}; \ No newline at end of file +var _0x89f7=['../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','CustomDashboards','destroy','end','error','stack','name','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','addItem','DashboardId','findOne','getItems','nolimit','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x143860,_0x3cdc67){var _0x53833f=function(_0x464128){while(--_0x464128){_0x143860['push'](_0x143860['shift']());}};_0x53833f(++_0x3cdc67);}(_0x89f7,0x1c4));var _0x789f=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x89f7[_0x4afac5];return _0x2404b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x789f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x789f('0x1'));var rp=require(_0x789f('0x2'));var moment=require(_0x789f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x789f('0x4'));var util=require(_0x789f('0x5'));var path=require('path');var sox=require(_0x789f('0x6'));var csv=require('to-csv');var ejs=require(_0x789f('0x7'));var fs=require('fs');var fs_extra=require(_0x789f('0x8'));var _=require(_0x789f('0x9'));var squel=require(_0x789f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x789f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x789f('0xc'));var Papa=require(_0x789f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x789f('0xe'));var as=require(_0x789f('0xf'));var hardwareService=require(_0x789f('0x10'));var logger=require('../../config/logger')(_0x789f('0x11'));var utils=require(_0x789f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x789f('0x13'));var db=require(_0x789f('0x14'))['db'];config[_0x789f('0x15')]=_['defaults'](config[_0x789f('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x789f('0x16'))(new Redis(config[_0x789f('0x15')]));require(_0x789f('0x17'))[_0x789f('0x18')](socket);function respondWithStatusCode(_0x4d0d3e,_0x2f5859){_0x2f5859=_0x2f5859||0xcc;return function(_0x14e619){if(_0x14e619){return _0x4d0d3e[_0x789f('0x19')](_0x2f5859);}return _0x4d0d3e[_0x789f('0x1a')](_0x2f5859)['end']();};}function respondWithResult(_0x48e3c1,_0x9f3f0e){_0x9f3f0e=_0x9f3f0e||0xc8;return function(_0xaaad57){if(_0xaaad57){return _0x48e3c1[_0x789f('0x1a')](_0x9f3f0e)[_0x789f('0x1b')](_0xaaad57);}};}function respondWithFilteredResult(_0x46afd6,_0x237ca8){return function(_0x1fa4fe){if(_0x1fa4fe){var _0x40e7e1=typeof _0x237ca8[_0x789f('0x1c')]===_0x789f('0x1d')&&typeof _0x237ca8['limit']===_0x789f('0x1d');var _0x24363c=_0x1fa4fe[_0x789f('0x1e')];var _0x30674e=_0x40e7e1?0x0:_0x237ca8[_0x789f('0x1c')];var _0x48fabd=_0x40e7e1?_0x1fa4fe['count']:_0x237ca8[_0x789f('0x1c')]+_0x237ca8[_0x789f('0x1f')];var _0x317975;if(_0x48fabd>=_0x24363c){_0x48fabd=_0x24363c;_0x317975=0xc8;}else{_0x317975=0xce;}_0x46afd6[_0x789f('0x1a')](_0x317975);return _0x46afd6['set'](_0x789f('0x20'),_0x30674e+'-'+_0x48fabd+'/'+_0x24363c)['json'](_0x1fa4fe);}return null;};}function patchUpdates(_0x5f4258){return function(_0x2c0c91){try{jsonpatch[_0x789f('0x21')](_0x2c0c91,_0x5f4258,!![]);}catch(_0x2a1a2e){return BPromise[_0x789f('0x22')](_0x2a1a2e);}return _0x2c0c91[_0x789f('0x23')]();};}function saveUpdates(_0x33b116,_0x3dde4f){return function(_0x43fd0a){if(_0x43fd0a){return _0x43fd0a[_0x789f('0x24')](_0x33b116)[_0x789f('0x25')](function(_0x3e1355){return _0x3e1355;});}return null;};}function removeEntity(_0x1dd426,_0x52a3a0){return function(_0x2f9c62){if(_0x2f9c62){return _0x2f9c62['destroy']()[_0x789f('0x25')](function(){var _0x133f8f=_0x2f9c62['get']({'plain':!![]});var _0x4286fd=_0x789f('0x26');return db['UserProfileResource'][_0x789f('0x27')]({'where':{'type':_0x4286fd,'resourceId':_0x133f8f['id']}})[_0x789f('0x25')](function(){return _0x2f9c62;});})[_0x789f('0x25')](function(){_0x1dd426[_0x789f('0x1a')](0xcc)[_0x789f('0x28')]();});}};}function handleEntityNotFound(_0x1ce132,_0x724c7c){return function(_0x54d8fc){if(!_0x54d8fc){_0x1ce132[_0x789f('0x19')](0x194);}return _0x54d8fc;};}function handleError(_0x2b294a,_0x4e492b){_0x4e492b=_0x4e492b||0x1f4;return function(_0x7a8137){logger[_0x789f('0x29')](_0x7a8137[_0x789f('0x2a')]);if(_0x7a8137[_0x789f('0x2b')]){delete _0x7a8137[_0x789f('0x2b')];}_0x2b294a[_0x789f('0x1a')](_0x4e492b)[_0x789f('0x2c')](_0x7a8137);};}exports['index']=function(_0x463da5,_0x28930a){var _0x3b7230={},_0x2d15bf={},_0x43f13d={'count':0x0,'rows':[]};var _0x491620=_[_0x789f('0x2d')](db[_0x789f('0x2e')][_0x789f('0x2f')],function(_0x31e030){return{'name':_0x31e030['fieldName'],'type':_0x31e030[_0x789f('0x30')][_0x789f('0x31')]};});_0x2d15bf[_0x789f('0x32')]=_[_0x789f('0x2d')](_0x491620,_0x789f('0x2b'));_0x2d15bf[_0x789f('0x33')]=_[_0x789f('0x34')](_0x463da5[_0x789f('0x33')]);_0x2d15bf[_0x789f('0x35')]=_[_0x789f('0x36')](_0x2d15bf[_0x789f('0x32')],_0x2d15bf[_0x789f('0x33')]);_0x3b7230[_0x789f('0x37')]=_[_0x789f('0x36')](_0x2d15bf[_0x789f('0x32')],qs[_0x789f('0x38')](_0x463da5['query'][_0x789f('0x38')]));_0x3b7230[_0x789f('0x37')]=_0x3b7230[_0x789f('0x37')][_0x789f('0x39')]?_0x3b7230[_0x789f('0x37')]:_0x2d15bf['model'];if(!_0x463da5[_0x789f('0x33')][_0x789f('0x3a')]('nolimit')){_0x3b7230['limit']=qs[_0x789f('0x1f')](_0x463da5[_0x789f('0x33')][_0x789f('0x1f')]);_0x3b7230['offset']=qs['offset'](_0x463da5[_0x789f('0x33')][_0x789f('0x1c')]);}_0x3b7230[_0x789f('0x3b')]=qs[_0x789f('0x3c')](_0x463da5[_0x789f('0x33')]['sort']);_0x3b7230['where']=qs['filters'](_[_0x789f('0x3d')](_0x463da5[_0x789f('0x33')],_0x2d15bf[_0x789f('0x35')]),_0x491620);if(_0x463da5['query'][_0x789f('0x3e')]){_0x3b7230['where']=_[_0x789f('0x3f')](_0x3b7230[_0x789f('0x40')],{'$or':_[_0x789f('0x2d')](_0x491620,function(_0x4576d3){if(_0x4576d3[_0x789f('0x30')]!==_0x789f('0x41')){var _0x1c8d43={};_0x1c8d43[_0x4576d3[_0x789f('0x2b')]]={'$like':'%'+_0x463da5[_0x789f('0x33')]['filter']+'%'};return _0x1c8d43;}})});}_0x3b7230=_[_0x789f('0x3f')]({},_0x3b7230,_0x463da5['options']);var _0x16df95={'where':_0x3b7230[_0x789f('0x40')]};return db[_0x789f('0x2e')]['count'](_0x16df95)[_0x789f('0x25')](function(_0x4e09e2){_0x43f13d[_0x789f('0x1e')]=_0x4e09e2;if(_0x463da5[_0x789f('0x33')][_0x789f('0x42')]){_0x3b7230[_0x789f('0x43')]=[{'all':!![]}];}return db[_0x789f('0x2e')][_0x789f('0x44')](_0x3b7230);})[_0x789f('0x25')](function(_0x29141c){_0x43f13d['rows']=_0x29141c;return _0x43f13d;})['then'](respondWithFilteredResult(_0x28930a,_0x3b7230))[_0x789f('0x45')](handleError(_0x28930a,null));};exports[_0x789f('0x46')]=function(_0x592556,_0x13f599){var _0x39ddcb={'raw':![],'where':{'id':_0x592556[_0x789f('0x47')]['id']}},_0x14d8b3={};_0x14d8b3[_0x789f('0x32')]=_['keys'](db[_0x789f('0x2e')][_0x789f('0x2f')]);_0x14d8b3[_0x789f('0x33')]=_[_0x789f('0x34')](_0x592556['query']);_0x14d8b3[_0x789f('0x35')]=_['intersection'](_0x14d8b3['model'],_0x14d8b3['query']);_0x39ddcb[_0x789f('0x37')]=_[_0x789f('0x36')](_0x14d8b3[_0x789f('0x32')],qs[_0x789f('0x38')](_0x592556[_0x789f('0x33')][_0x789f('0x38')]));_0x39ddcb['attributes']=_0x39ddcb[_0x789f('0x37')][_0x789f('0x39')]?_0x39ddcb[_0x789f('0x37')]:_0x14d8b3[_0x789f('0x32')];if(_0x592556[_0x789f('0x33')][_0x789f('0x42')]){_0x39ddcb[_0x789f('0x43')]=[{'all':!![]}];}_0x39ddcb=_[_0x789f('0x3f')]({},_0x39ddcb,_0x592556[_0x789f('0x48')]);return db['Dashboard'][_0x789f('0x49')](_0x39ddcb)['then'](handleEntityNotFound(_0x13f599,null))['then'](respondWithResult(_0x13f599,null))[_0x789f('0x45')](handleError(_0x13f599,null));};exports[_0x789f('0x4a')]=function(_0x543ab5,_0x53abfd){return db[_0x789f('0x2e')][_0x789f('0x4a')](_0x543ab5[_0x789f('0x4b')],{})[_0x789f('0x25')](function(_0x310bc9){var _0x33f13a=_0x543ab5[_0x789f('0x4c')][_0x789f('0x4d')]({'plain':!![]});if(!_0x33f13a)throw new Error(_0x789f('0x4e'));if(_0x33f13a[_0x789f('0x4f')]===_0x789f('0x4c')){var _0xa1f3c3=_0x310bc9[_0x789f('0x4d')]({'plain':!![]});var _0x182cbb='CustomDashboards';return db[_0x789f('0x50')]['find']({'where':{'name':_0x182cbb,'userProfileId':_0x33f13a[_0x789f('0x51')]},'raw':!![]})[_0x789f('0x25')](function(_0x467b2b){if(_0x467b2b&&_0x467b2b[_0x789f('0x52')]===0x0){return db[_0x789f('0x53')]['create']({'name':_0xa1f3c3[_0x789f('0x2b')],'resourceId':_0xa1f3c3['id'],'type':_0x467b2b[_0x789f('0x2b')],'sectionId':_0x467b2b['id']},{})[_0x789f('0x25')](function(){return _0x310bc9;});}else{return _0x310bc9;}})[_0x789f('0x45')](function(_0x3493b0){logger[_0x789f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3493b0);throw _0x3493b0;});}return _0x310bc9;})['then'](respondWithResult(_0x53abfd,0xc9))[_0x789f('0x45')](handleError(_0x53abfd,null));};exports['clone']=function(_0x8a6984,_0x1ef2a1){var _0x5a91d1={'where':{'id':_0x8a6984[_0x789f('0x47')]['id']}},_0x463c57={};_0x463c57[_0x789f('0x32')]=_[_0x789f('0x34')](db[_0x789f('0x2e')][_0x789f('0x2f')]);_0x5a91d1[_0x789f('0x37')]=_[_0x789f('0x36')](_0x463c57[_0x789f('0x32')],qs[_0x789f('0x38')](_0x8a6984[_0x789f('0x33')][_0x789f('0x38')]));_0x5a91d1[_0x789f('0x37')]=_0x5a91d1[_0x789f('0x37')]['length']?_0x5a91d1[_0x789f('0x37')]:_0x463c57['model'];if(_0x8a6984[_0x789f('0x33')][_0x789f('0x42')]){_0x5a91d1['include']=[{'all':!![]}];}_0x5a91d1=_[_0x789f('0x3f')]({},_0x5a91d1,_0x8a6984[_0x789f('0x48')]);return db[_0x789f('0x2e')]['find'](_0x5a91d1)[_0x789f('0x25')](handleEntityNotFound(_0x1ef2a1,null))[_0x789f('0x25')](function(_0x3f56c7){if(_0x3f56c7){var _0x2f0512=_0x3f56c7[_0x789f('0x4d')]({'plain':!![]});_0x2f0512=qs[_0x789f('0x54')](_0x2f0512,['id',_0x789f('0x55'),'updatedAt']);_0x8a6984[_0x789f('0x4b')]=_['omit'](_0x8a6984[_0x789f('0x4b')],['id',_0x789f('0x55'),_0x789f('0x56')]);return db[_0x789f('0x2e')][_0x789f('0x4a')](_[_0x789f('0x3f')](_0x2f0512,_0x8a6984[_0x789f('0x4b')]),{'include':_0x8a6984[_0x789f('0x33')][_0x789f('0x42')]?[{'all':!![]}]:undefined})[_0x789f('0x25')](function(_0x16a4b1){var _0x5618af=_0x8a6984[_0x789f('0x4c')][_0x789f('0x4d')]({'plain':!![]});if(!_0x5618af)throw new Error(_0x789f('0x4e'));if(_0x5618af['role']===_0x789f('0x4c')){var _0x5d0ba1=_0x16a4b1[_0x789f('0x4d')]({'plain':!![]});var _0x111b77=_0x789f('0x26');return db[_0x789f('0x50')][_0x789f('0x49')]({'where':{'name':_0x111b77,'userProfileId':_0x5618af[_0x789f('0x51')]},'raw':!![]})['then'](function(_0x123921){if(_0x123921&&_0x123921[_0x789f('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x5d0ba1[_0x789f('0x2b')],'resourceId':_0x5d0ba1['id'],'type':_0x123921[_0x789f('0x2b')],'sectionId':_0x123921['id']},{})[_0x789f('0x25')](function(){return _0x16a4b1;});}else{return _0x16a4b1;}})[_0x789f('0x45')](function(_0x19c3a6){logger[_0x789f('0x29')](_0x789f('0x57'),_0x19c3a6);throw _0x19c3a6;});}return _0x16a4b1;});}})['then'](respondWithResult(_0x1ef2a1,0xc9))[_0x789f('0x45')](handleError(_0x1ef2a1,null));};exports['update']=function(_0x192946,_0x11385f){if(_0x192946[_0x789f('0x4b')]['id']){delete _0x192946[_0x789f('0x4b')]['id'];}return db[_0x789f('0x2e')][_0x789f('0x49')]({'where':{'id':_0x192946[_0x789f('0x47')]['id']}})[_0x789f('0x25')](handleEntityNotFound(_0x11385f,null))[_0x789f('0x25')](saveUpdates(_0x192946[_0x789f('0x4b')],null))[_0x789f('0x25')](respondWithResult(_0x11385f,null))['catch'](handleError(_0x11385f,null));};exports[_0x789f('0x27')]=function(_0x294834,_0xae500e){return db[_0x789f('0x2e')][_0x789f('0x49')]({'where':{'id':_0x294834[_0x789f('0x47')]['id']}})[_0x789f('0x25')](handleEntityNotFound(_0xae500e,null))[_0x789f('0x25')](removeEntity(_0xae500e,null))['catch'](handleError(_0xae500e,null));};function widgetAttributes(_0x5db322){try{switch(_0x5db322['type']){case _0x789f('0x58'):return[{'name':_0x789f('0x59'),'value':_0x5db322[_0x789f('0x59')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322['attrs'][0x0][_0x789f('0x5b')]:undefined)||_0x789f('0x5c')}];case _0x789f('0x5d'):return[{'name':_0x789f('0x5e'),'value':_0x5db322[_0x789f('0x5e')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322[_0x789f('0x5a')][0x0][_0x789f('0x5b')]:undefined)||''}];case _0x789f('0x5f'):return[{'name':'attrHourFormat','value':_0x5db322[_0x789f('0x60')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322[_0x789f('0x5a')][0x0][_0x789f('0x5b')]:undefined)||_0x789f('0x61')},{'name':_0x789f('0x62'),'value':_0x5db322[_0x789f('0x62')]||(_0x5db322['attrs']&&_0x5db322['attrs'][0x1]?_0x5db322[_0x789f('0x5a')][0x1]['value']:undefined)||_0x789f('0x63')},{'name':_0x789f('0x64'),'value':_0x5db322['attrFontSize']||(_0x5db322[_0x789f('0x5a')]&&_0x5db322['attrs'][0x2]?_0x5db322[_0x789f('0x5a')][0x2]['value']:undefined)||0xc}];case _0x789f('0x65'):return[{'name':_0x789f('0x66'),'value':_0x5db322[_0x789f('0x66')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322[_0x789f('0x5a')][0x0][_0x789f('0x5b')]:undefined)||_0x789f('0x67')},{'name':_0x789f('0x68'),'value':_0x5db322[_0x789f('0x68')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322['attrs'][0x1]?_0x5db322['attrs'][0x1][_0x789f('0x5b')]:undefined)||[]},{'name':_0x789f('0x64'),'value':_0x5db322[_0x789f('0x64')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x2]?_0x5db322[_0x789f('0x5a')][0x2][_0x789f('0x5b')]:undefined)||0x14}];case _0x789f('0x69'):case'pie-chart':return[{'name':_0x789f('0x6a'),'value':_0x5db322['attrSerie1']||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322[_0x789f('0x5a')][0x0]['value']:undefined)||_0x789f('0x67')},{'name':_0x789f('0x6b'),'value':_0x5db322[_0x789f('0x6b')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x1]?_0x5db322[_0x789f('0x5a')][0x1][_0x789f('0x5b')]:undefined)||null},{'name':'attrSerie3','value':_0x5db322[_0x789f('0x6c')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x2]?_0x5db322[_0x789f('0x5a')][0x2]['value']:undefined)||null},{'name':_0x789f('0x68'),'value':_0x5db322[_0x789f('0x68')]||(_0x5db322['attrs']&&_0x5db322[_0x789f('0x5a')][0x3]?_0x5db322[_0x789f('0x5a')][0x3]['value']:undefined)||[]}];case _0x789f('0x6d'):return[{'name':_0x789f('0x6e'),'type':_0x5db322['reportType']||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x0]?_0x5db322[_0x789f('0x5a')][0x0][_0x789f('0x30')]:undefined)||null,'value':_0x5db322[_0x789f('0x6e')]||(_0x5db322['attrs']&&_0x5db322['attrs'][0x0]?_0x5db322[_0x789f('0x5a')][0x0][_0x789f('0x5b')]:undefined)||null},{'name':_0x789f('0x6f'),'value':_0x5db322[_0x789f('0x6f')]||(_0x5db322[_0x789f('0x5a')]&&_0x5db322[_0x789f('0x5a')][0x1]?_0x5db322[_0x789f('0x5a')][0x1][_0x789f('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x4edafc){logger[_0x789f('0x29')]('widgetAttributes:\x20%s',JSON['stringify'](_0x4edafc));return[];}}exports[_0x789f('0x70')]=function(_0x39e16a,_0x5935b4,_0x44332f){if(_0x39e16a[_0x789f('0x4b')]['id']){delete _0x39e16a[_0x789f('0x4b')]['id'];}return db['Dashboard'][_0x789f('0x49')]({'where':{'id':_0x39e16a[_0x789f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5935b4,null))[_0x789f('0x25')](function(_0x15747c){if(_0x15747c){_0x39e16a[_0x789f('0x4b')][_0x789f('0x71')]=_0x15747c['id'];_0x39e16a[_0x789f('0x4b')]['attrs']=widgetAttributes(_0x39e16a['body']);return db['DashboardItem'][_0x789f('0x4a')](_0x39e16a['body']);}})['then'](respondWithResult(_0x5935b4,null))['catch'](handleError(_0x5935b4,null));};exports['getItems']=function(_0x1ce4dc,_0x959c55,_0x45272b){var _0x63ad87={};var _0xb86a2={};var _0x149296;var _0x27bbde;return db['Dashboard'][_0x789f('0x72')]({'where':{'id':_0x1ce4dc[_0x789f('0x47')]['id']}})[_0x789f('0x25')](handleEntityNotFound(_0x959c55,null))[_0x789f('0x25')](function(_0x4cb9c9){if(_0x4cb9c9){_0x149296=_0x4cb9c9;_0xb86a2['model']=_[_0x789f('0x34')](db['DashboardItem'][_0x789f('0x2f')]);_0xb86a2['query']=_[_0x789f('0x34')](_0x1ce4dc[_0x789f('0x33')]);_0xb86a2['filters']=_[_0x789f('0x36')](_0xb86a2[_0x789f('0x32')],_0xb86a2[_0x789f('0x33')]);_0x63ad87[_0x789f('0x37')]=_['intersection'](_0xb86a2[_0x789f('0x32')],qs[_0x789f('0x38')](_0x1ce4dc[_0x789f('0x33')]['fields']));_0x63ad87[_0x789f('0x37')]=_0x63ad87[_0x789f('0x37')][_0x789f('0x39')]?_0x63ad87[_0x789f('0x37')]:_0xb86a2[_0x789f('0x32')];_0x63ad87['order']=qs[_0x789f('0x3c')](_0x1ce4dc[_0x789f('0x33')][_0x789f('0x3c')]);_0x63ad87[_0x789f('0x40')]=qs[_0x789f('0x35')](_[_0x789f('0x3d')](_0x1ce4dc[_0x789f('0x33')],_0xb86a2['filters']));if(_0x1ce4dc[_0x789f('0x33')]['filter']){_0x63ad87[_0x789f('0x40')]=_[_0x789f('0x3f')](_0x63ad87[_0x789f('0x40')],{'$or':_['map'](_0x63ad87[_0x789f('0x37')],function(_0x367913){var _0x537df5={};_0x537df5[_0x367913]={'$like':'%'+_0x1ce4dc[_0x789f('0x33')][_0x789f('0x3e')]+'%'};return _0x537df5;})});}_0x63ad87=_['merge']({},_0x63ad87,_0x1ce4dc[_0x789f('0x48')]);return _0x149296[_0x789f('0x73')](_0x63ad87);}})[_0x789f('0x25')](function(_0x4c3b54){if(_0x4c3b54){_0x27bbde=_0x4c3b54[_0x789f('0x39')];if(!_0x1ce4dc[_0x789f('0x33')][_0x789f('0x3a')](_0x789f('0x74'))){_0x63ad87[_0x789f('0x1f')]=qs[_0x789f('0x1f')](_0x1ce4dc[_0x789f('0x33')]['limit']);_0x63ad87[_0x789f('0x1c')]=qs[_0x789f('0x1c')](_0x1ce4dc[_0x789f('0x33')][_0x789f('0x1c')]);}return _0x149296[_0x789f('0x73')](_0x63ad87);}})[_0x789f('0x25')](function(_0x4090ba){if(_0x4090ba){return _0x4090ba?{'count':_0x27bbde,'rows':_0x4090ba}:null;}})[_0x789f('0x25')](respondWithResult(_0x959c55,null))[_0x789f('0x45')](handleError(_0x959c55,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index bb5dcae..2b378cc 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 _0xf2a9=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0xf2a9,0x19d));var _0x9f2a=function(_0x53669b,_0x406078){_0x53669b=_0x53669b-0x0;var _0x4bb2c0=_0xf2a9[_0x53669b];return _0x4bb2c0;};'use strict';var EventEmitter=require(_0x9f2a('0x0'));var Dashboard=require(_0x9f2a('0x1'))['db'][_0x9f2a('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9f2a('0x3')](0x0);var events={'afterCreate':_0x9f2a('0x4'),'afterUpdate':_0x9f2a('0x5'),'afterDestroy':_0x9f2a('0x6')};function emitEvent(_0x388fd3){return function(_0x195c34,_0x96982b,_0x15be3){DashboardEvents[_0x9f2a('0x7')](_0x388fd3+':'+_0x195c34['id'],_0x195c34);DashboardEvents[_0x9f2a('0x7')](_0x388fd3,_0x195c34);_0x15be3(null);};}for(var e in events){if(events[_0x9f2a('0x8')](e)){var event=events[e];Dashboard[_0x9f2a('0x9')](e,emitEvent(event));}}module[_0x9f2a('0xa')]=DashboardEvents; \ No newline at end of file +var _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','Dashboard','setMaxListeners','save'];(function(_0x3a8bee,_0x36c3d2){var _0xac5261=function(_0xde66dc){while(--_0xde66dc){_0x3a8bee['push'](_0x3a8bee['shift']());}};_0xac5261(++_0x36c3d2);}(_0x1033,0x11d));var _0x3103=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x1033[_0x36c5b0];return _0xf19333;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x3103('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){DashboardEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);DashboardEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];Dashboard[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index c8636e7..90555aa 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 _0x89f3=['bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard','dashboards','util','../../config/logger','api','moment'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x89f3,0x1ac));var _0x389f=function(_0x1f868c,_0x10267e){_0x1f868c=_0x1f868c-0x0;var _0x5d7e87=_0x89f3[_0x1f868c];return _0x5d7e87;};'use strict';var _=require('lodash');var util=require(_0x389f('0x0'));var logger=require(_0x389f('0x1'))(_0x389f('0x2'));var moment=require(_0x389f('0x3'));var BPromise=require(_0x389f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x389f('0x5'));var rimraf=require(_0x389f('0x6'));var config=require(_0x389f('0x7'));var attributes=require(_0x389f('0x8'));module[_0x389f('0x9')]=function(_0x5aa54e,_0x21ab75){return _0x5aa54e['define'](_0x389f('0xa'),attributes,{'tableName':_0x389f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6222=['define','dashboards','util','../../config/logger','moment','path','./dashboard.attributes','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6222,0x9a));var _0x2622=function(_0x26f99d,_0x355096){_0x26f99d=_0x26f99d-0x0;var _0x5860e3=_0x6222[_0x26f99d];return _0x5860e3;};'use strict';var _=require('lodash');var util=require(_0x2622('0x0'));var logger=require(_0x2622('0x1'))('api');var moment=require(_0x2622('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2622('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2622('0x4'));module[_0x2622('0x5')]=function(_0x5e8379,_0xf70ae5){return _0x5e8379[_0x2622('0x6')]('Dashboard',attributes,{'tableName':_0x2622('0x7'),'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 311bc0f..25921f2 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 _0xd39f=['defaults','redis','localhost','./dashboard.socket','register','request','info','debug','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x36c482,_0x1a70ee){var _0x5d11c0=function(_0x3aa5a4){while(--_0x3aa5a4){_0x36c482['push'](_0x36c482['shift']());}};_0x5d11c0(++_0x1a70ee);}(_0xd39f,0xc6));var _0xfd39=function(_0x20ae15,_0x28b3f1){_0x20ae15=_0x20ae15-0x0;var _0x3cc5dc=_0xd39f[_0x20ae15];return _0x3cc5dc;};'use strict';var _=require(_0xfd39('0x0'));var util=require(_0xfd39('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd39('0x2'));var db=require(_0xfd39('0x3'))['db'];var utils=require(_0xfd39('0x4'));var logger=require('../../config/logger')(_0xfd39('0x5'));var config=require(_0xfd39('0x6'));var jayson=require(_0xfd39('0x7'));var client=jayson[_0xfd39('0x8')][_0xfd39('0x9')]({'port':0x232a});config['redis']=_[_0xfd39('0xa')](config[_0xfd39('0xb')],{'host':_0xfd39('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd39('0xb')]));require(_0xfd39('0xd'))[_0xfd39('0xe')](socket);function respondWithRpcPromise(_0x3988da,_0x2ed656,_0x2e963c){return new BPromise(function(_0x4299c7,_0x224187){return client[_0xfd39('0xf')](_0x3988da,_0x2e963c)['then'](function(_0xead52f){logger[_0xfd39('0x10')]('Dashboard,\x20%s,\x20%s',_0x2ed656,'request\x20sent');logger[_0xfd39('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2ed656,_0xfd39('0x12'),JSON[_0xfd39('0x13')](_0xead52f));if(_0xead52f[_0xfd39('0x14')]){if(_0xead52f['error'][_0xfd39('0x15')]===0x1f4){logger[_0xfd39('0x14')](_0xfd39('0x16'),_0x2ed656,_0xead52f[_0xfd39('0x14')][_0xfd39('0x17')]);return _0x224187(_0xead52f[_0xfd39('0x14')][_0xfd39('0x17')]);}logger[_0xfd39('0x14')](_0xfd39('0x16'),_0x2ed656,_0xead52f['error'][_0xfd39('0x17')]);return _0x4299c7(_0xead52f['error'][_0xfd39('0x17')]);}else{logger[_0xfd39('0x10')](_0xfd39('0x16'),_0x2ed656,_0xfd39('0x12'));_0x4299c7(_0xead52f[_0xfd39('0x18')][_0xfd39('0x17')]);}})[_0xfd39('0x19')](function(_0x292801){logger[_0xfd39('0x14')]('Dashboard,\x20%s,\x20%s',_0x2ed656,_0x292801);_0x224187(_0x292801);});});} \ No newline at end of file +var _0xaf79=['request\x20sent','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5abc86,_0x302538){var _0x478af1=function(_0x3c96a5){while(--_0x3c96a5){_0x5abc86['push'](_0x5abc86['shift']());}};_0x478af1(++_0x302538);}(_0xaf79,0x1e8));var _0x9af7=function(_0x5f4e56,_0x592e0a){_0x5f4e56=_0x5f4e56-0x0;var _0x5ad71b=_0xaf79[_0x5f4e56];return _0x5ad71b;};'use strict';var _=require(_0x9af7('0x0'));var util=require(_0x9af7('0x1'));var moment=require(_0x9af7('0x2'));var BPromise=require(_0x9af7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9af7('0x4'))['db'];var utils=require(_0x9af7('0x5'));var logger=require(_0x9af7('0x6'))(_0x9af7('0x7'));var config=require(_0x9af7('0x8'));var jayson=require(_0x9af7('0x9'));var client=jayson[_0x9af7('0xa')][_0x9af7('0xb')]({'port':0x232a});config[_0x9af7('0xc')]=_['defaults'](config[_0x9af7('0xc')],{'host':_0x9af7('0xd'),'port':0x18eb});var socket=require(_0x9af7('0xe'))(new Redis(config[_0x9af7('0xc')]));require(_0x9af7('0xf'))['register'](socket);function respondWithRpcPromise(_0x292c21,_0xde7dc,_0x51c002){return new BPromise(function(_0x3c9c01,_0x2eac8a){return client[_0x9af7('0x10')](_0x292c21,_0x51c002)[_0x9af7('0x11')](function(_0x37c639){logger[_0x9af7('0x12')](_0x9af7('0x13'),_0xde7dc,'request\x20sent');logger[_0x9af7('0x14')](_0x9af7('0x15'),_0xde7dc,'request\x20sent',JSON[_0x9af7('0x16')](_0x37c639));if(_0x37c639['error']){if(_0x37c639[_0x9af7('0x17')]['code']===0x1f4){logger[_0x9af7('0x17')](_0x9af7('0x13'),_0xde7dc,_0x37c639[_0x9af7('0x17')][_0x9af7('0x18')]);return _0x2eac8a(_0x37c639[_0x9af7('0x17')][_0x9af7('0x18')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0xde7dc,_0x37c639[_0x9af7('0x17')][_0x9af7('0x18')]);return _0x3c9c01(_0x37c639['error'][_0x9af7('0x18')]);}else{logger[_0x9af7('0x12')](_0x9af7('0x13'),_0xde7dc,_0x9af7('0x19'));_0x3c9c01(_0x37c639[_0x9af7('0x1a')][_0x9af7('0x18')]);}})['catch'](function(_0x4b1dfa){logger[_0x9af7('0x17')]('Dashboard,\x20%s,\x20%s',_0xde7dc,_0x4b1dfa);_0x2eac8a(_0x4b1dfa);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 62d7628..6ac69fa 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 _0x0bd9=['emit','removeListener','register','length','dashboard:','./dashboard.events','save','update'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x0bd9,0xcd));var _0x90bd=function(_0x43bc91,_0x105c81){_0x43bc91=_0x43bc91-0x0;var _0x395949=_0x0bd9[_0x43bc91];return _0x395949;};'use strict';var DashboardEvents=require(_0x90bd('0x0'));var events=[_0x90bd('0x1'),'remove',_0x90bd('0x2')];function createListener(_0x4b2cec,_0x1bbb38){return function(_0xadebf3){_0x1bbb38[_0x90bd('0x3')](_0x4b2cec,_0xadebf3);};}function removeListener(_0x489066,_0x1870bb){return function(){DashboardEvents[_0x90bd('0x4')](_0x489066,_0x1870bb);};}exports[_0x90bd('0x5')]=function(_0x59318d){for(var _0x2bfeaf=0x0,_0x273908=events[_0x90bd('0x6')];_0x2bfeaf<_0x273908;_0x2bfeaf++){var _0x46cb3e=events[_0x2bfeaf];var _0x37c6c4=createListener(_0x90bd('0x7')+_0x46cb3e,_0x59318d);DashboardEvents['on'](_0x46cb3e,_0x37c6c4);}}; \ No newline at end of file +var _0x2412=['register','dashboard:','./dashboard.events','save','remove','emit','removeListener'];(function(_0x40c6e9,_0xad9c65){var _0x1ca3ac=function(_0x211a3f){while(--_0x211a3f){_0x40c6e9['push'](_0x40c6e9['shift']());}};_0x1ca3ac(++_0xad9c65);}(_0x2412,0x10c));var _0x2241=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2412[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require(_0x2241('0x0'));var events=[_0x2241('0x1'),_0x2241('0x2'),'update'];function createListener(_0xb67cd5,_0x35d91e){return function(_0x1e5b3d){_0x35d91e[_0x2241('0x3')](_0xb67cd5,_0x1e5b3d);};}function removeListener(_0x475e3b,_0x5995b1){return function(){DashboardEvents[_0x2241('0x4')](_0x475e3b,_0x5995b1);};}exports[_0x2241('0x5')]=function(_0xa8c7d2){for(var _0x121e34=0x0,_0x344f1d=events['length'];_0x121e34<_0x344f1d;_0x121e34++){var _0x3679e2=events[_0x121e34];var _0x5e2fe7=createListener(_0x2241('0x6')+_0x3679e2,_0xa8c7d2);DashboardEvents['on'](_0x3679e2,_0x5e2fe7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4eba1e3..0ef0fe7 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 _0x287e=['isAuthenticated','index','/:id','getItems','post','create','/:id/clone','clone','/:id/items','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x520f52,_0x3708bd){var _0x2331dd=function(_0x124902){while(--_0x124902){_0x520f52['push'](_0x520f52['shift']());}};_0x2331dd(++_0x3708bd);}(_0x287e,0x1af));var _0xe287=function(_0x4d0b9e,_0x407efa){_0x4d0b9e=_0x4d0b9e-0x0;var _0x30b64b=_0x287e[_0x4d0b9e];return _0x30b64b;};'use strict';var multer=require(_0xe287('0x0'));var util=require(_0xe287('0x1'));var path=require(_0xe287('0x2'));var timeout=require(_0xe287('0x3'));var express=require(_0xe287('0x4'));var router=express['Router']();var fs_extra=require(_0xe287('0x5'));var auth=require(_0xe287('0x6'));var interaction=require(_0xe287('0x7'));var config=require(_0xe287('0x8'));var controller=require('./dashboard.controller');router[_0xe287('0x9')]('/',auth[_0xe287('0xa')](),controller[_0xe287('0xb')]);router[_0xe287('0x9')](_0xe287('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe287('0x9')]('/:id/items',auth['isAuthenticated'](),controller[_0xe287('0xd')]);router[_0xe287('0xe')]('/',auth[_0xe287('0xa')](),controller[_0xe287('0xf')]);router['post'](_0xe287('0x10'),auth[_0xe287('0xa')](),controller[_0xe287('0x11')]);router['post'](_0xe287('0x12'),auth['isAuthenticated'](),controller['addItem']);router[_0xe287('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe287('0x14')]('/:id',auth[_0xe287('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe796=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x4a9925,_0x320cf0){var _0x2bd892=function(_0xd76fa9){while(--_0xd76fa9){_0x4a9925['push'](_0x4a9925['shift']());}};_0x2bd892(++_0x320cf0);}(_0xe796,0xf7));var _0x6e79=function(_0x464c32,_0x241609){_0x464c32=_0x464c32-0x0;var _0x1db3f3=_0xe796[_0x464c32];return _0x1db3f3;};'use strict';var multer=require(_0x6e79('0x0'));var util=require(_0x6e79('0x1'));var path=require(_0x6e79('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6e79('0x3')]();var fs_extra=require(_0x6e79('0x4'));var auth=require(_0x6e79('0x5'));var interaction=require(_0x6e79('0x6'));var config=require(_0x6e79('0x7'));var controller=require('./dashboard.controller');router[_0x6e79('0x8')]('/',auth[_0x6e79('0x9')](),controller[_0x6e79('0xa')]);router[_0x6e79('0x8')](_0x6e79('0xb'),auth['isAuthenticated'](),controller[_0x6e79('0xc')]);router[_0x6e79('0x8')](_0x6e79('0xd'),auth['isAuthenticated'](),controller[_0x6e79('0xe')]);router['post']('/',auth[_0x6e79('0x9')](),controller[_0x6e79('0xf')]);router[_0x6e79('0x10')](_0x6e79('0x11'),auth[_0x6e79('0x9')](),controller[_0x6e79('0x12')]);router[_0x6e79('0x10')](_0x6e79('0xd'),auth['isAuthenticated'](),controller[_0x6e79('0x13')]);router[_0x6e79('0x14')]('/:id',auth[_0x6e79('0x9')](),controller['update']);router[_0x6e79('0x15')]('/:id',auth[_0x6e79('0x9')](),controller[_0x6e79('0x16')]);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 987d7cf..6b4c1c2 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 _0x0295=['#ffffff','sequelize','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','STRING'];(function(_0x4def54,_0x36de1d){var _0x137bee=function(_0x1dd6f4){while(--_0x1dd6f4){_0x4def54['push'](_0x4def54['shift']());}};_0x137bee(++_0x36de1d);}(_0x0295,0x1f0));var _0x5029=function(_0x8eb9d,_0x320ee6){_0x8eb9d=_0x8eb9d-0x0;var _0x28c28=_0x0295[_0x8eb9d];return _0x28c28;};'use strict';var Sequelize=require(_0x5029('0x0'));var squel=require('squel');var _=require('lodash');module[_0x5029('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5029('0x2')](_0x5029('0x3')),'get':function(){try{return JSON[_0x5029('0x4')](this[_0x5029('0x5')](_0x5029('0x6')));}catch(_0x69a497){return[];}},'set':function(_0x200217){try{this[_0x5029('0x7')](_0x5029('0x6'),JSON['stringify'](_0x200217));}catch(_0x54978f){this['setDataValue'](_0x5029('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5029('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5029('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':_0x5029('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5029('0x9')]},'titleFontSize':{'type':Sequelize[_0x5029('0x8')],'defaultValue':0xc}}; \ No newline at end of file +var _0xeda8=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','#ffffff','sequelize','squel','exports','STRING'];(function(_0x41efef,_0x19810a){var _0x51e449=function(_0x1703a8){while(--_0x1703a8){_0x41efef['push'](_0x41efef['shift']());}};_0x51e449(++_0x19810a);}(_0xeda8,0x104));var _0x8eda=function(_0x393141,_0x5d61a5){_0x393141=_0x393141-0x0;var _0xa2e3e2=_0xeda8[_0x393141];return _0xa2e3e2;};'use strict';var Sequelize=require(_0x8eda('0x0'));var squel=require(_0x8eda('0x1'));var _=require('lodash');module[_0x8eda('0x2')]={'title':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eda('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x8eda('0x4')](_0x8eda('0x5')),'get':function(){try{return JSON[_0x8eda('0x6')](this[_0x8eda('0x7')](_0x8eda('0x8')));}catch(_0x22dee9){return[];}},'set':function(_0x1f3556){try{this[_0x8eda('0x9')](_0x8eda('0x8'),JSON['stringify'](_0x1f3556));}catch(_0x28b721){this[_0x8eda('0x9')](_0x8eda('0x8'),JSON[_0x8eda('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':_0x8eda('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x8eda('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eda('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 05e3dd6..8302bf3 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 _0xf990=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','then','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xf990,0x1bc));var _0x0f99=function(_0x4af3b7,_0x30c116){_0x4af3b7=_0x4af3b7-0x0;var _0x24727c=_0xf990[_0x4af3b7];return _0x24727c;};'use strict';var emlformat=require(_0x0f99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f99('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f99('0x2'));var moment=require(_0x0f99('0x3'));var BPromise=require(_0x0f99('0x4'));var Mustache=require('mustache');var util=require(_0x0f99('0x5'));var path=require(_0x0f99('0x6'));var sox=require(_0x0f99('0x7'));var csv=require(_0x0f99('0x8'));var ejs=require(_0x0f99('0x9'));var fs=require('fs');var fs_extra=require(_0x0f99('0xa'));var _=require('lodash');var squel=require(_0x0f99('0xb'));var crypto=require(_0x0f99('0xc'));var jsforce=require(_0x0f99('0xd'));var deskjs=require(_0x0f99('0xe'));var toCsv=require(_0x0f99('0x8'));var querystring=require(_0x0f99('0xf'));var Papa=require(_0x0f99('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f99('0x11'));var as=require(_0x0f99('0x12'));var hardwareService=require(_0x0f99('0x13'));var logger=require(_0x0f99('0x14'))(_0x0f99('0x15'));var utils=require('../../config/utils');var config=require(_0x0f99('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f99('0x17'))['db'];config[_0x0f99('0x18')]=_[_0x0f99('0x19')](config[_0x0f99('0x18')],{'host':_0x0f99('0x1a'),'port':0x18eb});var socket=require(_0x0f99('0x1b'))(new Redis(config[_0x0f99('0x18')]));require(_0x0f99('0x1c'))[_0x0f99('0x1d')](socket);function respondWithStatusCode(_0x21fa76,_0x5d8040){_0x5d8040=_0x5d8040||0xcc;return function(_0x2b7625){if(_0x2b7625){return _0x21fa76[_0x0f99('0x1e')](_0x5d8040);}return _0x21fa76['status'](_0x5d8040)[_0x0f99('0x1f')]();};}function respondWithResult(_0x363b69,_0x9db6b){_0x9db6b=_0x9db6b||0xc8;return function(_0x56deed){if(_0x56deed){return _0x363b69[_0x0f99('0x20')](_0x9db6b)[_0x0f99('0x21')](_0x56deed);}};}function respondWithFilteredResult(_0x350344,_0x5bf2aa){return function(_0x2cd290){if(_0x2cd290){var _0x2fb18f=typeof _0x5bf2aa['offset']===_0x0f99('0x22')&&typeof _0x5bf2aa[_0x0f99('0x23')]===_0x0f99('0x22');var _0x1e45a9=_0x2cd290[_0x0f99('0x24')];var _0xf9888d=_0x2fb18f?0x0:_0x5bf2aa[_0x0f99('0x25')];var _0x50423b=_0x2fb18f?_0x2cd290[_0x0f99('0x24')]:_0x5bf2aa[_0x0f99('0x25')]+_0x5bf2aa['limit'];var _0xd9912e;if(_0x50423b>=_0x1e45a9){_0x50423b=_0x1e45a9;_0xd9912e=0xc8;}else{_0xd9912e=0xce;}_0x350344[_0x0f99('0x20')](_0xd9912e);return _0x350344[_0x0f99('0x26')]('Content-Range',_0xf9888d+'-'+_0x50423b+'/'+_0x1e45a9)[_0x0f99('0x21')](_0x2cd290);}return null;};}function patchUpdates(_0x163b42){return function(_0xa19b5f){try{jsonpatch['apply'](_0xa19b5f,_0x163b42,!![]);}catch(_0x2a79ab){return BPromise[_0x0f99('0x27')](_0x2a79ab);}return _0xa19b5f[_0x0f99('0x28')]();};}function saveUpdates(_0x1d5950,_0x49fa6c){return function(_0x222ebc){if(_0x222ebc){return _0x222ebc['update'](_0x1d5950)[_0x0f99('0x29')](function(_0x5e1d59){return _0x5e1d59;});}return null;};}function removeEntity(_0x4fde03,_0x4aa39b){return function(_0x50951e){if(_0x50951e){return _0x50951e['destroy']()[_0x0f99('0x29')](function(){_0x4fde03[_0x0f99('0x20')](0xcc)[_0x0f99('0x1f')]();});}};}function handleEntityNotFound(_0x581d0d,_0x104050){return function(_0x5f428f){if(!_0x5f428f){_0x581d0d[_0x0f99('0x1e')](0x194);}return _0x5f428f;};}function handleError(_0x6e49b4,_0x41f6ac){_0x41f6ac=_0x41f6ac||0x1f4;return function(_0x3b0710){logger[_0x0f99('0x2a')](_0x3b0710[_0x0f99('0x2b')]);if(_0x3b0710[_0x0f99('0x2c')]){delete _0x3b0710['name'];}_0x6e49b4[_0x0f99('0x20')](_0x41f6ac)[_0x0f99('0x2d')](_0x3b0710);};}exports[_0x0f99('0x2e')]=function(_0x45b7a7,_0x261058){var _0x2d672b={'raw':![],'where':{'id':_0x45b7a7[_0x0f99('0x2f')]['id']}},_0x3dba06={};_0x3dba06[_0x0f99('0x30')]=_[_0x0f99('0x31')](db['DashboardItem'][_0x0f99('0x32')]);_0x3dba06[_0x0f99('0x33')]=_[_0x0f99('0x31')](_0x45b7a7[_0x0f99('0x33')]);_0x3dba06[_0x0f99('0x34')]=_[_0x0f99('0x35')](_0x3dba06['model'],_0x3dba06[_0x0f99('0x33')]);_0x2d672b[_0x0f99('0x36')]=_['intersection'](_0x3dba06[_0x0f99('0x30')],qs[_0x0f99('0x37')](_0x45b7a7[_0x0f99('0x33')]['fields']));_0x2d672b['attributes']=_0x2d672b['attributes'][_0x0f99('0x38')]?_0x2d672b['attributes']:_0x3dba06[_0x0f99('0x30')];if(_0x45b7a7[_0x0f99('0x33')][_0x0f99('0x39')]){_0x2d672b['include']=[{'all':!![]}];}_0x2d672b=_[_0x0f99('0x3a')]({},_0x2d672b,_0x45b7a7[_0x0f99('0x3b')]);return db[_0x0f99('0x3c')][_0x0f99('0x3d')](_0x2d672b)[_0x0f99('0x29')](handleEntityNotFound(_0x261058,null))['then'](respondWithResult(_0x261058,null))['catch'](handleError(_0x261058,null));};exports['destroy']=function(_0x32e1c2,_0x4a0047){return db['DashboardItem'][_0x0f99('0x3d')]({'where':{'id':_0x32e1c2[_0x0f99('0x2f')]['id']}})[_0x0f99('0x29')](handleEntityNotFound(_0x4a0047,null))[_0x0f99('0x29')](removeEntity(_0x4a0047,null))[_0x0f99('0x3e')](handleError(_0x4a0047,null));};function widgetAttributes(_0x191059){try{switch(_0x191059[_0x0f99('0x3f')]){case _0x0f99('0x40'):return[{'name':_0x0f99('0x41'),'value':_0x191059['attrUrl']||(_0x191059[_0x0f99('0x42')]&&_0x191059['attrs'][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||_0x0f99('0x44')}];case _0x0f99('0x45'):return[{'name':_0x0f99('0x46'),'value':_0x191059[_0x0f99('0x46')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x191059['attrHourFormat']||(_0x191059['attrs']&&_0x191059['attrs'][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||_0x0f99('0x47')},{'name':_0x0f99('0x48'),'value':_0x191059[_0x0f99('0x48')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x1]?_0x191059['attrs'][0x1]['value']:undefined)||_0x0f99('0x49')},{'name':'attrFontSize','value':_0x191059[_0x0f99('0x4a')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x2]?_0x191059[_0x0f99('0x42')][0x2][_0x0f99('0x43')]:undefined)||0xc}];case _0x0f99('0x4b'):return[{'name':'attrMetric','value':_0x191059[_0x0f99('0x4c')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||'total'},{'name':_0x0f99('0x4d'),'value':_0x191059['attrVoiceQueues']||(_0x191059[_0x0f99('0x42')]&&_0x191059['attrs'][0x1]?_0x191059['attrs'][0x1][_0x0f99('0x43')]:undefined)||[]},{'name':_0x0f99('0x4a'),'value':_0x191059[_0x0f99('0x4a')]||(_0x191059['attrs']&&_0x191059[_0x0f99('0x42')][0x2]?_0x191059[_0x0f99('0x42')][0x2][_0x0f99('0x43')]:undefined)||0x14}];case _0x0f99('0x4e'):case'pie-chart':return[{'name':'attrSerie1','value':_0x191059[_0x0f99('0x4f')]||(_0x191059['attrs']&&_0x191059[_0x0f99('0x42')][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||_0x0f99('0x50')},{'name':'attrSerie2','value':_0x191059[_0x0f99('0x51')]||(_0x191059['attrs']&&_0x191059[_0x0f99('0x42')][0x1]?_0x191059['attrs'][0x1][_0x0f99('0x43')]:undefined)||null},{'name':_0x0f99('0x52'),'value':_0x191059[_0x0f99('0x52')]||(_0x191059['attrs']&&_0x191059[_0x0f99('0x42')][0x2]?_0x191059[_0x0f99('0x42')][0x2][_0x0f99('0x43')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x191059[_0x0f99('0x4d')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x3]?_0x191059['attrs'][0x3]['value']:undefined)||[]}];case _0x0f99('0x53'):return[{'name':_0x0f99('0x54'),'type':_0x191059[_0x0f99('0x55')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x3f')]:undefined)||null,'value':_0x191059[_0x0f99('0x54')]||(_0x191059[_0x0f99('0x42')]&&_0x191059[_0x0f99('0x42')][0x0]?_0x191059[_0x0f99('0x42')][0x0][_0x0f99('0x43')]:undefined)||null},{'name':_0x0f99('0x56'),'value':_0x191059[_0x0f99('0x56')]||(_0x191059[_0x0f99('0x42')]&&_0x191059['attrs'][0x1]?_0x191059[_0x0f99('0x42')][0x1][_0x0f99('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x3c71f1){logger[_0x0f99('0x2a')](_0x0f99('0x57'),JSON[_0x0f99('0x58')](_0x3c71f1));return[];}}exports[_0x0f99('0x59')]=function(_0xe1c93a,_0x42a0e9){if(_0xe1c93a[_0x0f99('0x5a')]){_0xe1c93a['body'][_0x0f99('0x42')]=widgetAttributes(_0xe1c93a[_0x0f99('0x5a')]);}return db['DashboardItem'][_0x0f99('0x59')](_0xe1c93a[_0x0f99('0x5a')],{})[_0x0f99('0x29')](respondWithResult(_0x42a0e9,0xc9))[_0x0f99('0x3e')](handleError(_0x42a0e9,null));};exports[_0x0f99('0x5b')]=function(_0x4a82d0,_0x58d589){if(_0x4a82d0['body']['id']){delete _0x4a82d0[_0x0f99('0x5a')]['id'];}_0x4a82d0[_0x0f99('0x5a')]['attrs']=widgetAttributes(_0x4a82d0[_0x0f99('0x5a')]);return db['DashboardItem'][_0x0f99('0x3d')]({'where':{'id':_0x4a82d0['params']['id']}})[_0x0f99('0x29')](handleEntityNotFound(_0x58d589,null))[_0x0f99('0x29')](saveUpdates(_0x4a82d0[_0x0f99('0x5a')],null))['then'](respondWithResult(_0x58d589,null))[_0x0f99('0x3e')](handleError(_0x58d589,null));}; \ No newline at end of file +var _0x5c13=['undefined','limit','count','set','apply','reject','save','then','sendStatus','error','name','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','DashboardItem','find','destroy','catch','type','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c13,0x1ef));var _0x35c1=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0x5c13[_0x1a8f86];return _0x20d876;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35c1('0x0'));var zipdir=require(_0x35c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x35c1('0x2'));var moment=require(_0x35c1('0x3'));var BPromise=require(_0x35c1('0x4'));var Mustache=require(_0x35c1('0x5'));var util=require(_0x35c1('0x6'));var path=require('path');var sox=require(_0x35c1('0x7'));var csv=require(_0x35c1('0x8'));var ejs=require(_0x35c1('0x9'));var fs=require('fs');var fs_extra=require(_0x35c1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35c1('0xc'));var toCsv=require(_0x35c1('0x8'));var querystring=require(_0x35c1('0xd'));var Papa=require(_0x35c1('0xe'));var Redis=require(_0x35c1('0xf'));var authService=require(_0x35c1('0x10'));var qs=require(_0x35c1('0x11'));var as=require(_0x35c1('0x12'));var hardwareService=require(_0x35c1('0x13'));var logger=require(_0x35c1('0x14'))('api');var utils=require(_0x35c1('0x15'));var config=require(_0x35c1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x35c1('0x17'))['db'];config[_0x35c1('0x18')]=_[_0x35c1('0x19')](config[_0x35c1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x35c1('0x1a'))(new Redis(config[_0x35c1('0x18')]));require(_0x35c1('0x1b'))[_0x35c1('0x1c')](socket);function respondWithStatusCode(_0x3aca1c,_0x35b8c7){_0x35b8c7=_0x35b8c7||0xcc;return function(_0x14406b){if(_0x14406b){return _0x3aca1c['sendStatus'](_0x35b8c7);}return _0x3aca1c[_0x35c1('0x1d')](_0x35b8c7)[_0x35c1('0x1e')]();};}function respondWithResult(_0x318657,_0x5399f7){_0x5399f7=_0x5399f7||0xc8;return function(_0x21e5f3){if(_0x21e5f3){return _0x318657[_0x35c1('0x1d')](_0x5399f7)[_0x35c1('0x1f')](_0x21e5f3);}};}function respondWithFilteredResult(_0x58dc61,_0x52dfcb){return function(_0x50596d){if(_0x50596d){var _0x123315=typeof _0x52dfcb[_0x35c1('0x20')]===_0x35c1('0x21')&&typeof _0x52dfcb[_0x35c1('0x22')]===_0x35c1('0x21');var _0x233ece=_0x50596d[_0x35c1('0x23')];var _0x548b02=_0x123315?0x0:_0x52dfcb[_0x35c1('0x20')];var _0x493bcc=_0x123315?_0x50596d[_0x35c1('0x23')]:_0x52dfcb[_0x35c1('0x20')]+_0x52dfcb['limit'];var _0x84773;if(_0x493bcc>=_0x233ece){_0x493bcc=_0x233ece;_0x84773=0xc8;}else{_0x84773=0xce;}_0x58dc61[_0x35c1('0x1d')](_0x84773);return _0x58dc61[_0x35c1('0x24')]('Content-Range',_0x548b02+'-'+_0x493bcc+'/'+_0x233ece)['json'](_0x50596d);}return null;};}function patchUpdates(_0x39e83b){return function(_0x16cf1f){try{jsonpatch[_0x35c1('0x25')](_0x16cf1f,_0x39e83b,!![]);}catch(_0x1c67a5){return BPromise[_0x35c1('0x26')](_0x1c67a5);}return _0x16cf1f[_0x35c1('0x27')]();};}function saveUpdates(_0x2d192f,_0x1e542d){return function(_0x500995){if(_0x500995){return _0x500995['update'](_0x2d192f)[_0x35c1('0x28')](function(_0x5315a2){return _0x5315a2;});}return null;};}function removeEntity(_0x133d60,_0x96e33d){return function(_0x150ba8){if(_0x150ba8){return _0x150ba8['destroy']()['then'](function(){_0x133d60[_0x35c1('0x1d')](0xcc)[_0x35c1('0x1e')]();});}};}function handleEntityNotFound(_0x2de680,_0x375b27){return function(_0x4674c8){if(!_0x4674c8){_0x2de680[_0x35c1('0x29')](0x194);}return _0x4674c8;};}function handleError(_0x35a652,_0x944575){_0x944575=_0x944575||0x1f4;return function(_0x104bab){logger[_0x35c1('0x2a')](_0x104bab['stack']);if(_0x104bab[_0x35c1('0x2b')]){delete _0x104bab[_0x35c1('0x2b')];}_0x35a652[_0x35c1('0x1d')](_0x944575)['send'](_0x104bab);};}exports['show']=function(_0x1f7c1d,_0x51f440){var _0x7ca6b={'raw':![],'where':{'id':_0x1f7c1d[_0x35c1('0x2c')]['id']}},_0x3467f6={};_0x3467f6[_0x35c1('0x2d')]=_[_0x35c1('0x2e')](db['DashboardItem'][_0x35c1('0x2f')]);_0x3467f6[_0x35c1('0x30')]=_[_0x35c1('0x2e')](_0x1f7c1d[_0x35c1('0x30')]);_0x3467f6['filters']=_[_0x35c1('0x31')](_0x3467f6[_0x35c1('0x2d')],_0x3467f6[_0x35c1('0x30')]);_0x7ca6b[_0x35c1('0x32')]=_[_0x35c1('0x31')](_0x3467f6['model'],qs[_0x35c1('0x33')](_0x1f7c1d[_0x35c1('0x30')]['fields']));_0x7ca6b[_0x35c1('0x32')]=_0x7ca6b[_0x35c1('0x32')][_0x35c1('0x34')]?_0x7ca6b[_0x35c1('0x32')]:_0x3467f6[_0x35c1('0x2d')];if(_0x1f7c1d[_0x35c1('0x30')]['includeAll']){_0x7ca6b[_0x35c1('0x35')]=[{'all':!![]}];}_0x7ca6b=_[_0x35c1('0x36')]({},_0x7ca6b,_0x1f7c1d['options']);return db[_0x35c1('0x37')][_0x35c1('0x38')](_0x7ca6b)[_0x35c1('0x28')](handleEntityNotFound(_0x51f440,null))[_0x35c1('0x28')](respondWithResult(_0x51f440,null))['catch'](handleError(_0x51f440,null));};exports[_0x35c1('0x39')]=function(_0x38d2b2,_0x437831){return db[_0x35c1('0x37')][_0x35c1('0x38')]({'where':{'id':_0x38d2b2[_0x35c1('0x2c')]['id']}})['then'](handleEntityNotFound(_0x437831,null))['then'](removeEntity(_0x437831,null))[_0x35c1('0x3a')](handleError(_0x437831,null));};function widgetAttributes(_0x4ea96c){try{switch(_0x4ea96c[_0x35c1('0x3b')]){case'iframe':return[{'name':_0x35c1('0x3c'),'value':_0x4ea96c[_0x35c1('0x3c')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3e')]:undefined)||_0x35c1('0x3f')}];case _0x35c1('0x40'):return[{'name':_0x35c1('0x41'),'value':_0x4ea96c[_0x35c1('0x41')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3e')]:undefined)||''}];case _0x35c1('0x42'):return[{'name':_0x35c1('0x43'),'value':_0x4ea96c[_0x35c1('0x43')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c['attrs'][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3e')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x4ea96c[_0x35c1('0x44')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x1]?_0x4ea96c['attrs'][0x1]['value']:undefined)||_0x35c1('0x45')},{'name':'attrFontSize','value':_0x4ea96c['attrFontSize']||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x2]?_0x4ea96c['attrs'][0x2][_0x35c1('0x3e')]:undefined)||0xc}];case _0x35c1('0x46'):return[{'name':_0x35c1('0x47'),'value':_0x4ea96c[_0x35c1('0x47')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c['attrs'][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3e')]:undefined)||_0x35c1('0x48')},{'name':_0x35c1('0x49'),'value':_0x4ea96c[_0x35c1('0x49')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x1]?_0x4ea96c[_0x35c1('0x3d')][0x1][_0x35c1('0x3e')]:undefined)||[]},{'name':_0x35c1('0x4a'),'value':_0x4ea96c[_0x35c1('0x4a')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x2]?_0x4ea96c['attrs'][0x2]['value']:undefined)||0x14}];case _0x35c1('0x4b'):case _0x35c1('0x4c'):return[{'name':_0x35c1('0x4d'),'value':_0x4ea96c[_0x35c1('0x4d')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0]['value']:undefined)||_0x35c1('0x48')},{'name':_0x35c1('0x4e'),'value':_0x4ea96c['attrSerie2']||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c['attrs'][0x1]?_0x4ea96c['attrs'][0x1][_0x35c1('0x3e')]:undefined)||null},{'name':_0x35c1('0x4f'),'value':_0x4ea96c['attrSerie3']||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x2]?_0x4ea96c['attrs'][0x2][_0x35c1('0x3e')]:undefined)||null},{'name':_0x35c1('0x49'),'value':_0x4ea96c['attrVoiceQueues']||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x3]?_0x4ea96c['attrs'][0x3][_0x35c1('0x3e')]:undefined)||[]}];case'web-report':return[{'name':_0x35c1('0x50'),'type':_0x4ea96c[_0x35c1('0x51')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3b')]:undefined)||null,'value':_0x4ea96c[_0x35c1('0x50')]||(_0x4ea96c['attrs']&&_0x4ea96c[_0x35c1('0x3d')][0x0]?_0x4ea96c[_0x35c1('0x3d')][0x0][_0x35c1('0x3e')]:undefined)||null},{'name':_0x35c1('0x52'),'value':_0x4ea96c[_0x35c1('0x52')]||(_0x4ea96c[_0x35c1('0x3d')]&&_0x4ea96c[_0x35c1('0x3d')][0x1]?_0x4ea96c[_0x35c1('0x3d')][0x1][_0x35c1('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x268ac8){logger[_0x35c1('0x2a')](_0x35c1('0x53'),JSON[_0x35c1('0x54')](_0x268ac8));return[];}}exports['create']=function(_0x5bfe97,_0x2601ba){if(_0x5bfe97['body']){_0x5bfe97[_0x35c1('0x55')]['attrs']=widgetAttributes(_0x5bfe97[_0x35c1('0x55')]);}return db[_0x35c1('0x37')][_0x35c1('0x56')](_0x5bfe97[_0x35c1('0x55')],{})[_0x35c1('0x28')](respondWithResult(_0x2601ba,0xc9))[_0x35c1('0x3a')](handleError(_0x2601ba,null));};exports[_0x35c1('0x57')]=function(_0x292a67,_0x55f3ea){if(_0x292a67['body']['id']){delete _0x292a67[_0x35c1('0x55')]['id'];}_0x292a67[_0x35c1('0x55')]['attrs']=widgetAttributes(_0x292a67[_0x35c1('0x55')]);return db[_0x35c1('0x37')][_0x35c1('0x38')]({'where':{'id':_0x292a67[_0x35c1('0x2c')]['id']}})[_0x35c1('0x28')](handleEntityNotFound(_0x55f3ea,null))['then'](saveUpdates(_0x292a67[_0x35c1('0x55')],null))['then'](respondWithResult(_0x55f3ea,null))['catch'](handleError(_0x55f3ea,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index a238877..208d33c 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 _0xea59=['events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xea59,0x1ea));var _0x9ea5=function(_0xc14fcc,_0x241148){_0xc14fcc=_0xc14fcc-0x0;var _0x18840e=_0xea59[_0xc14fcc];return _0x18840e;};'use strict';var EventEmitter=require(_0x9ea5('0x0'));var DashboardItem=require(_0x9ea5('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9ea5('0x2')](0x0);var events={'afterCreate':_0x9ea5('0x3'),'afterUpdate':_0x9ea5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x356348){return function(_0x300433,_0x260e8b,_0x25d57f){DashboardItemEvents[_0x9ea5('0x5')](_0x356348+':'+_0x300433['id'],_0x300433);DashboardItemEvents[_0x9ea5('0x5')](_0x356348,_0x300433);_0x25d57f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x9ea5('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x12fc=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x12fc,0xb6));var _0xc12f=function(_0xa75829,_0xa7dbb8){_0xa75829=_0xa75829-0x0;var _0x4ab74b=_0x12fc[_0xa75829];return _0x4ab74b;};'use strict';var EventEmitter=require(_0xc12f('0x0'));var DashboardItem=require(_0xc12f('0x1'))['db'][_0xc12f('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc12f('0x3')](0x0);var events={'afterCreate':_0xc12f('0x4'),'afterUpdate':_0xc12f('0x5'),'afterDestroy':_0xc12f('0x6')};function emitEvent(_0x35bb31){return function(_0x16b9fd,_0x363045,_0x5d168a){DashboardItemEvents[_0xc12f('0x7')](_0x35bb31+':'+_0x16b9fd['id'],_0x16b9fd);DashboardItemEvents[_0xc12f('0x7')](_0x35bb31,_0x16b9fd);_0x5d168a(null);};}for(var e in events){if(events[_0xc12f('0x8')](e)){var event=events[e];DashboardItem[_0xc12f('0x9')](e,emitEvent(event));}}module[_0xc12f('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 0a31294..aecf241 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 _0xac4e=['../../config/environment','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4e,0x1d9));var _0xeac4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xac4e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xeac4('0x0'));var util=require(_0xeac4('0x1'));var logger=require(_0xeac4('0x2'))(_0xeac4('0x3'));var moment=require(_0xeac4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac4('0x5'));var rimraf=require(_0xeac4('0x6'));var config=require(_0xeac4('0x7'));var attributes=require('./dashboardItem.attributes');module[_0xeac4('0x8')]=function(_0x233a03,_0x2f0039){return _0x233a03[_0xeac4('0x9')](_0xeac4('0xa'),attributes,{'tableName':_0xeac4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x502a=['path','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','api','moment'];(function(_0x4000c3,_0x18ce7f){var _0x3f2d07=function(_0x2704c3){while(--_0x2704c3){_0x4000c3['push'](_0x4000c3['shift']());}};_0x3f2d07(++_0x18ce7f);}(_0x502a,0xd8));var _0xa502=function(_0x635cdb,_0x7aab52){_0x635cdb=_0x635cdb-0x0;var _0x4e66cd=_0x502a[_0x635cdb];return _0x4e66cd;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require('../../config/logger')(_0xa502('0x2'));var moment=require(_0xa502('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa502('0x4'));var rimraf=require('rimraf');var config=require(_0xa502('0x5'));var attributes=require(_0xa502('0x6'));module[_0xa502('0x7')]=function(_0x1cb2e4,_0x136d51){return _0x1cb2e4['define'](_0xa502('0x8'),attributes,{'tableName':_0xa502('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index ed6c820..2f8c03b 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 _0x7255=['rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x22c25b,_0x1f3afe){var _0x24d8be=function(_0x3fa276){while(--_0x3fa276){_0x22c25b['push'](_0x22c25b['shift']());}};_0x24d8be(++_0x1f3afe);}(_0x7255,0x19e));var _0x5725=function(_0xc7e8c1,_0x412a01){_0xc7e8c1=_0xc7e8c1-0x0;var _0x30d27a=_0x7255[_0xc7e8c1];return _0x30d27a;};'use strict';var _=require(_0x5725('0x0'));var util=require('util');var moment=require(_0x5725('0x1'));var BPromise=require('bluebird');var rs=require(_0x5725('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5725('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5725('0x4'));var config=require(_0x5725('0x5'));var jayson=require(_0x5725('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x5725('0x7')],{'host':_0x5725('0x8'),'port':0x18eb});var socket=require(_0x5725('0x9'))(new Redis(config[_0x5725('0x7')]));require(_0x5725('0xa'))['register'](socket);function respondWithRpcPromise(_0x1c89c0,_0x25fcae,_0x1890a8){return new BPromise(function(_0x13f342,_0x2aa584){return client[_0x5725('0xb')](_0x1c89c0,_0x1890a8)[_0x5725('0xc')](function(_0x5956c6){logger['info'](_0x5725('0xd'),_0x25fcae,_0x5725('0xe'));logger['debug'](_0x5725('0xf'),_0x25fcae,'request\x20sent',JSON[_0x5725('0x10')](_0x5956c6));if(_0x5956c6[_0x5725('0x11')]){if(_0x5956c6[_0x5725('0x11')][_0x5725('0x12')]===0x1f4){logger[_0x5725('0x11')](_0x5725('0xd'),_0x25fcae,_0x5956c6[_0x5725('0x11')][_0x5725('0x13')]);return _0x2aa584(_0x5956c6[_0x5725('0x11')][_0x5725('0x13')]);}logger[_0x5725('0x11')](_0x5725('0xd'),_0x25fcae,_0x5956c6[_0x5725('0x11')]['message']);return _0x13f342(_0x5956c6[_0x5725('0x11')][_0x5725('0x13')]);}else{logger['info'](_0x5725('0xd'),_0x25fcae,_0x5725('0xe'));_0x13f342(_0x5956c6[_0x5725('0x14')][_0x5725('0x13')]);}})[_0x5725('0x15')](function(_0x4ecdfb){logger[_0x5725('0x11')]('DashboardItem,\x20%s,\x20%s',_0x25fcae,_0x4ecdfb);_0x2aa584(_0x4ecdfb);});});} \ No newline at end of file +var _0x0831=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x13755c,_0x21c670){var _0x283340=function(_0x2d747f){while(--_0x2d747f){_0x13755c['push'](_0x13755c['shift']());}};_0x283340(++_0x21c670);}(_0x0831,0xac));var _0x1083=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0x0831[_0x9729d7];return _0x3c4ac6;};'use strict';var _=require(_0x1083('0x0'));var util=require(_0x1083('0x1'));var moment=require(_0x1083('0x2'));var BPromise=require('bluebird');var rs=require(_0x1083('0x3'));var fs=require('fs');var Redis=require(_0x1083('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1083('0x5'));var logger=require(_0x1083('0x6'))(_0x1083('0x7'));var config=require(_0x1083('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x1083('0x9')]=_[_0x1083('0xa')](config[_0x1083('0x9')],{'host':_0x1083('0xb'),'port':0x18eb});var socket=require(_0x1083('0xc'))(new Redis(config[_0x1083('0x9')]));require('./dashboardItem.socket')[_0x1083('0xd')](socket);function respondWithRpcPromise(_0x487546,_0x4c6e9f,_0x49251b){return new BPromise(function(_0x11ce09,_0x10269e){return client[_0x1083('0xe')](_0x487546,_0x49251b)['then'](function(_0x50e6a3){logger['info'](_0x1083('0xf'),_0x4c6e9f,_0x1083('0x10'));logger[_0x1083('0x11')](_0x1083('0x12'),_0x4c6e9f,_0x1083('0x10'),JSON[_0x1083('0x13')](_0x50e6a3));if(_0x50e6a3['error']){if(_0x50e6a3[_0x1083('0x14')][_0x1083('0x15')]===0x1f4){logger[_0x1083('0x14')](_0x1083('0xf'),_0x4c6e9f,_0x50e6a3[_0x1083('0x14')][_0x1083('0x16')]);return _0x10269e(_0x50e6a3[_0x1083('0x14')][_0x1083('0x16')]);}logger[_0x1083('0x14')](_0x1083('0xf'),_0x4c6e9f,_0x50e6a3[_0x1083('0x14')][_0x1083('0x16')]);return _0x11ce09(_0x50e6a3['error'][_0x1083('0x16')]);}else{logger[_0x1083('0x17')](_0x1083('0xf'),_0x4c6e9f,_0x1083('0x10'));_0x11ce09(_0x50e6a3['result']['message']);}})[_0x1083('0x18')](function(_0x5546fb){logger[_0x1083('0x14')](_0x1083('0xf'),_0x4c6e9f,_0x5546fb);_0x10269e(_0x5546fb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index adbc2ae..a043647 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 _0xeffe=['register','length','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeffe,0x81));var _0xeeff=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xeffe[_0x2dadb9];return _0x2f0097;};'use strict';var DashboardItemEvents=require(_0xeeff('0x0'));var events=[_0xeeff('0x1'),_0xeeff('0x2'),_0xeeff('0x3')];function createListener(_0xe82343,_0x540193){return function(_0x5d625a){_0x540193[_0xeeff('0x4')](_0xe82343,_0x5d625a);};}function removeListener(_0x396b7b,_0x16c941){return function(){DashboardItemEvents[_0xeeff('0x5')](_0x396b7b,_0x16c941);};}exports[_0xeeff('0x6')]=function(_0x548f4b){for(var _0x47af1c=0x0,_0x585300=events[_0xeeff('0x7')];_0x47af1c<_0x585300;_0x47af1c++){var _0x5ba5ea=events[_0x47af1c];var _0x3e3024=createListener(_0xeeff('0x8')+_0x5ba5ea,_0x548f4b);DashboardItemEvents['on'](_0x5ba5ea,_0x3e3024);}}; \ No newline at end of file +var _0x5894=['update','emit','removeListener','register','length','./dashboardItem.events','remove'];(function(_0x1fdbb7,_0xa03823){var _0x509335=function(_0x1de4d7){while(--_0x1de4d7){_0x1fdbb7['push'](_0x1fdbb7['shift']());}};_0x509335(++_0xa03823);}(_0x5894,0xde));var _0x4589=function(_0x35b0a9,_0x2aa667){_0x35b0a9=_0x35b0a9-0x0;var _0x503822=_0x5894[_0x35b0a9];return _0x503822;};'use strict';var DashboardItemEvents=require(_0x4589('0x0'));var events=['save',_0x4589('0x1'),_0x4589('0x2')];function createListener(_0x3aedfe,_0x3111bf){return function(_0x51e078){_0x3111bf[_0x4589('0x3')](_0x3aedfe,_0x51e078);};}function removeListener(_0x1b22a3,_0x39b007){return function(){DashboardItemEvents[_0x4589('0x4')](_0x1b22a3,_0x39b007);};}exports[_0x4589('0x5')]=function(_0x3c2b1e){for(var _0x3899be=0x0,_0x33b093=events[_0x4589('0x6')];_0x3899be<_0x33b093;_0x3899be++){var _0x5edab9=events[_0x3899be];var _0x2a3ae0=createListener('dashboardItem:'+_0x5edab9,_0x3c2b1e);DashboardItemEvents['on'](_0x5edab9,_0x2a3ae0);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5489e5a..9f62706 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 _0xbc39=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','delete','destroy'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbc39,0xbf));var _0x9bc3=function(_0x580f33,_0x4d524d){_0x580f33=_0x580f33-0x0;var _0x4f9e76=_0xbc39[_0x580f33];return _0x4f9e76;};'use strict';var multer=require(_0x9bc3('0x0'));var util=require(_0x9bc3('0x1'));var path=require(_0x9bc3('0x2'));var timeout=require(_0x9bc3('0x3'));var express=require(_0x9bc3('0x4'));var router=express[_0x9bc3('0x5')]();var fs_extra=require(_0x9bc3('0x6'));var auth=require(_0x9bc3('0x7'));var interaction=require(_0x9bc3('0x8'));var config=require(_0x9bc3('0x9'));var controller=require('./dashboardItem.controller');router[_0x9bc3('0xa')](_0x9bc3('0xb'),auth[_0x9bc3('0xc')](),controller[_0x9bc3('0xd')]);router[_0x9bc3('0xe')]('/',auth[_0x9bc3('0xc')](),controller[_0x9bc3('0xf')]);router['put'](_0x9bc3('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9bc3('0x10')](_0x9bc3('0xb'),auth[_0x9bc3('0xc')](),controller[_0x9bc3('0x11')]);module[_0x9bc3('0x12')]=router; \ No newline at end of file +var _0x8b0b=['../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45aa3d,_0x38ce31){var _0xc83a0c=function(_0x5e4621){while(--_0x5e4621){_0x45aa3d['push'](_0x45aa3d['shift']());}};_0xc83a0c(++_0x38ce31);}(_0x8b0b,0x1ef));var _0xb8b0=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x8b0b[_0x476b00];return _0x44ec8e;};'use strict';var multer=require(_0xb8b0('0x0'));var util=require(_0xb8b0('0x1'));var path=require(_0xb8b0('0x2'));var timeout=require(_0xb8b0('0x3'));var express=require(_0xb8b0('0x4'));var router=express[_0xb8b0('0x5')]();var fs_extra=require(_0xb8b0('0x6'));var auth=require(_0xb8b0('0x7'));var interaction=require(_0xb8b0('0x8'));var config=require(_0xb8b0('0x9'));var controller=require('./dashboardItem.controller');router[_0xb8b0('0xa')](_0xb8b0('0xb'),auth[_0xb8b0('0xc')](),controller[_0xb8b0('0xd')]);router[_0xb8b0('0xe')]('/',auth[_0xb8b0('0xc')](),controller[_0xb8b0('0xf')]);router[_0xb8b0('0x10')](_0xb8b0('0xb'),auth['isAuthenticated'](),controller[_0xb8b0('0x11')]);router[_0xb8b0('0x12')](_0xb8b0('0xb'),auth[_0xb8b0('0xc')](),controller[_0xb8b0('0x13')]);module[_0xb8b0('0x14')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5f5a90d..bb47268 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 _0x139e=['STRING','ENUM','first','second','third','exports'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0x139e,0xcb));var _0xe139=function(_0x52b13c,_0x1dfd59){_0x52b13c=_0x52b13c-0x0;var _0x571f60=_0x139e[_0x52b13c];return _0x571f60;};'use strict';var Sequelize=require('sequelize');module[_0xe139('0x0')]={'name':{'type':Sequelize[_0xe139('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xe139('0x2')](_0xe139('0x3'),_0xe139('0x4'),_0xe139('0x5')),'allowNull':![],'defaultValue':_0xe139('0x3')},'description':{'type':Sequelize[_0xe139('0x1')]}}; \ No newline at end of file +var _0x1fae=['sequelize','exports','STRING','ENUM','first','third'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x1fae,0xea));var _0xe1fa=function(_0x5c8bb9,_0x38024d){_0x5c8bb9=_0x5c8bb9-0x0;var _0x427dc6=_0x1fae[_0x5c8bb9];return _0x427dc6;};'use strict';var Sequelize=require(_0xe1fa('0x0'));module[_0xe1fa('0x1')]={'name':{'type':Sequelize[_0xe1fa('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xe1fa('0x3')](_0xe1fa('0x4'),'second',_0xe1fa('0x5')),'allowNull':![],'defaultValue':_0xe1fa('0x4')},'description':{'type':Sequelize[_0xe1fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d0658eb..5b27064 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 _0x1290=['jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2a1dc3,_0x2bcbcc){var _0x4f0d17=function(_0x4f44a7){while(--_0x4f44a7){_0x2a1dc3['push'](_0x2a1dc3['shift']());}};_0x4f0d17(++_0x2bcbcc);}(_0x1290,0x136));var _0x0129=function(_0x4d80be,_0x228ac2){_0x4d80be=_0x4d80be-0x0;var _0x205d9a=_0x1290[_0x4d80be];return _0x205d9a;};'use strict';var emlformat=require(_0x0129('0x0'));var rimraf=require(_0x0129('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0129('0x2'));var rp=require('request-promise');var moment=require(_0x0129('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0129('0x4'));var util=require(_0x0129('0x5'));var path=require(_0x0129('0x6'));var sox=require(_0x0129('0x7'));var csv=require(_0x0129('0x8'));var ejs=require(_0x0129('0x9'));var fs=require('fs');var fs_extra=require(_0x0129('0xa'));var _=require(_0x0129('0xb'));var squel=require(_0x0129('0xc'));var crypto=require(_0x0129('0xd'));var jsforce=require(_0x0129('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0129('0x8'));var querystring=require(_0x0129('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0129('0x10'));var as=require(_0x0129('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0129('0x12'));var utils=require(_0x0129('0x13'));var config=require(_0x0129('0x14'));var licenseUtil=require(_0x0129('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dbc5d,_0x507cbf){_0x507cbf=_0x507cbf||0xcc;return function(_0x41c48c){if(_0x41c48c){return _0x4dbc5d[_0x0129('0x16')](_0x507cbf);}return _0x4dbc5d[_0x0129('0x17')](_0x507cbf)[_0x0129('0x18')]();};}function respondWithResult(_0x503250,_0x445b75){_0x445b75=_0x445b75||0xc8;return function(_0x27c53b){if(_0x27c53b){return _0x503250[_0x0129('0x17')](_0x445b75)['json'](_0x27c53b);}};}function respondWithFilteredResult(_0xb4d69c,_0x33444e){return function(_0x501868){if(_0x501868){var _0x234a68=typeof _0x33444e[_0x0129('0x19')]===_0x0129('0x1a')&&typeof _0x33444e[_0x0129('0x1b')]===_0x0129('0x1a');var _0x22c4d9=_0x501868[_0x0129('0x1c')];var _0x2f7e51=_0x234a68?0x0:_0x33444e[_0x0129('0x19')];var _0x2b8af9=_0x234a68?_0x501868[_0x0129('0x1c')]:_0x33444e[_0x0129('0x19')]+_0x33444e[_0x0129('0x1b')];var _0x3bb0b1;if(_0x2b8af9>=_0x22c4d9){_0x2b8af9=_0x22c4d9;_0x3bb0b1=0xc8;}else{_0x3bb0b1=0xce;}_0xb4d69c[_0x0129('0x17')](_0x3bb0b1);return _0xb4d69c[_0x0129('0x1d')](_0x0129('0x1e'),_0x2f7e51+'-'+_0x2b8af9+'/'+_0x22c4d9)[_0x0129('0x1f')](_0x501868);}return null;};}function patchUpdates(_0x25e047){return function(_0x25f9c4){try{jsonpatch[_0x0129('0x20')](_0x25f9c4,_0x25e047,!![]);}catch(_0x37acf2){return BPromise[_0x0129('0x21')](_0x37acf2);}return _0x25f9c4['save']();};}function saveUpdates(_0x44d4a2,_0x3ec02b){return function(_0x1c0c2e){if(_0x1c0c2e){return _0x1c0c2e[_0x0129('0x22')](_0x44d4a2)[_0x0129('0x23')](function(_0x205cb7){return _0x205cb7;});}return null;};}function removeEntity(_0xced480,_0x1bf5ee){return function(_0x45a0bf){if(_0x45a0bf){return _0x45a0bf['destroy']()['then'](function(){var _0x4b9df5=_0x45a0bf[_0x0129('0x24')]({'plain':!![]});var _0x87aeb3=_0x0129('0x25');return db[_0x0129('0x26')][_0x0129('0x27')]({'where':{'type':_0x87aeb3,'resourceId':_0x4b9df5['id']}})['then'](function(){return _0x45a0bf;});})['then'](function(){_0xced480[_0x0129('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d67bd,_0x3bd337){return function(_0x3a1f8a){if(!_0x3a1f8a){_0x1d67bd[_0x0129('0x16')](0x194);}return _0x3a1f8a;};}function handleError(_0x5aedd9,_0x54f5b6){_0x54f5b6=_0x54f5b6||0x1f4;return function(_0x644c90){logger[_0x0129('0x28')](_0x644c90[_0x0129('0x29')]);if(_0x644c90[_0x0129('0x2a')]){delete _0x644c90[_0x0129('0x2a')];}_0x5aedd9['status'](_0x54f5b6)['send'](_0x644c90);};}exports['index']=function(_0x1e29d0,_0x181059){var _0x390155={},_0x37ec41={},_0x317a64={'count':0x0,'rows':[]};var _0x47f9af=_[_0x0129('0x2b')](db[_0x0129('0x2c')][_0x0129('0x2d')],function(_0x18a88a){return{'name':_0x18a88a[_0x0129('0x2e')],'type':_0x18a88a[_0x0129('0x2f')][_0x0129('0x30')]};});_0x37ec41[_0x0129('0x31')]=_['map'](_0x47f9af,_0x0129('0x2a'));_0x37ec41[_0x0129('0x32')]=_[_0x0129('0x33')](_0x1e29d0[_0x0129('0x32')]);_0x37ec41['filters']=_[_0x0129('0x34')](_0x37ec41[_0x0129('0x31')],_0x37ec41[_0x0129('0x32')]);_0x390155[_0x0129('0x35')]=_[_0x0129('0x34')](_0x37ec41[_0x0129('0x31')],qs['fields'](_0x1e29d0[_0x0129('0x32')][_0x0129('0x36')]));_0x390155[_0x0129('0x35')]=_0x390155[_0x0129('0x35')][_0x0129('0x37')]?_0x390155['attributes']:_0x37ec41['model'];if(!_0x1e29d0[_0x0129('0x32')][_0x0129('0x38')]('nolimit')){_0x390155['limit']=qs['limit'](_0x1e29d0['query'][_0x0129('0x1b')]);_0x390155[_0x0129('0x19')]=qs[_0x0129('0x19')](_0x1e29d0['query'][_0x0129('0x19')]);}_0x390155[_0x0129('0x39')]=qs[_0x0129('0x3a')](_0x1e29d0[_0x0129('0x32')][_0x0129('0x3a')]);_0x390155['where']=qs[_0x0129('0x3b')](_['pick'](_0x1e29d0[_0x0129('0x32')],_0x37ec41[_0x0129('0x3b')]),_0x47f9af);if(_0x1e29d0[_0x0129('0x32')][_0x0129('0x3c')]){_0x390155[_0x0129('0x3d')]=_['merge'](_0x390155[_0x0129('0x3d')],{'$or':_[_0x0129('0x2b')](_0x47f9af,function(_0x22dabe){if(_0x22dabe[_0x0129('0x2f')]!==_0x0129('0x3e')){var _0x3ac6ba={};_0x3ac6ba[_0x22dabe['name']]={'$like':'%'+_0x1e29d0[_0x0129('0x32')]['filter']+'%'};return _0x3ac6ba;}})});}_0x390155=_[_0x0129('0x3f')]({},_0x390155,_0x1e29d0[_0x0129('0x40')]);var _0x32e531={'where':_0x390155[_0x0129('0x3d')]};return db[_0x0129('0x2c')][_0x0129('0x1c')](_0x32e531)[_0x0129('0x23')](function(_0x3ef5f6){_0x317a64[_0x0129('0x1c')]=_0x3ef5f6;if(_0x1e29d0['query'][_0x0129('0x41')]){_0x390155[_0x0129('0x42')]=[{'all':!![]}];}return db[_0x0129('0x2c')][_0x0129('0x43')](_0x390155);})[_0x0129('0x23')](function(_0x617eea){_0x317a64[_0x0129('0x44')]=_0x617eea;return _0x317a64;})['then'](respondWithFilteredResult(_0x181059,_0x390155))[_0x0129('0x45')](handleError(_0x181059,null));};exports[_0x0129('0x46')]=function(_0x5ee1fc,_0x486c4b){var _0x2d8e33={'raw':!![],'where':{'id':_0x5ee1fc[_0x0129('0x47')]['id']}},_0xc3000b={};_0xc3000b['model']=_[_0x0129('0x33')](db[_0x0129('0x2c')][_0x0129('0x2d')]);_0xc3000b['query']=_['keys'](_0x5ee1fc['query']);_0xc3000b['filters']=_[_0x0129('0x34')](_0xc3000b[_0x0129('0x31')],_0xc3000b[_0x0129('0x32')]);_0x2d8e33[_0x0129('0x35')]=_[_0x0129('0x34')](_0xc3000b[_0x0129('0x31')],qs[_0x0129('0x36')](_0x5ee1fc[_0x0129('0x32')][_0x0129('0x36')]));_0x2d8e33[_0x0129('0x35')]=_0x2d8e33['attributes']['length']?_0x2d8e33[_0x0129('0x35')]:_0xc3000b[_0x0129('0x31')];if(_0x5ee1fc[_0x0129('0x32')][_0x0129('0x41')]){_0x2d8e33[_0x0129('0x42')]=[{'all':!![]}];}_0x2d8e33=_['merge']({},_0x2d8e33,_0x5ee1fc[_0x0129('0x40')]);return db['Disposition'][_0x0129('0x48')](_0x2d8e33)['then'](handleEntityNotFound(_0x486c4b,null))[_0x0129('0x23')](respondWithResult(_0x486c4b,null))[_0x0129('0x45')](handleError(_0x486c4b,null));};exports[_0x0129('0x49')]=function(_0x107f7e,_0xcb4125){return db['Disposition'][_0x0129('0x49')](_0x107f7e[_0x0129('0x4a')],{})[_0x0129('0x23')](function(_0x37b778){var _0x255289=_0x107f7e[_0x0129('0x4b')]['get']({'plain':!![]});if(!_0x255289)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x255289[_0x0129('0x4c')]===_0x0129('0x4b')){var _0x4b9f21=_0x37b778[_0x0129('0x24')]({'plain':!![]});var _0x2ea282='Dispositions';return db[_0x0129('0x4d')][_0x0129('0x48')]({'where':{'name':_0x2ea282,'userProfileId':_0x255289[_0x0129('0x4e')]},'raw':!![]})['then'](function(_0x7c1da8){if(_0x7c1da8&&_0x7c1da8[_0x0129('0x4f')]===0x0){return db[_0x0129('0x26')][_0x0129('0x49')]({'name':_0x4b9f21[_0x0129('0x2a')],'resourceId':_0x4b9f21['id'],'type':_0x7c1da8['name'],'sectionId':_0x7c1da8['id']},{})[_0x0129('0x23')](function(){return _0x37b778;});}else{return _0x37b778;}})[_0x0129('0x45')](function(_0x4d9db0){logger['error'](_0x0129('0x50'),_0x4d9db0);throw _0x4d9db0;});}return _0x37b778;})[_0x0129('0x23')](respondWithResult(_0xcb4125,0xc9))[_0x0129('0x45')](handleError(_0xcb4125,null));};exports[_0x0129('0x22')]=function(_0x158373,_0x463312){if(_0x158373[_0x0129('0x4a')]['id']){delete _0x158373[_0x0129('0x4a')]['id'];}return db[_0x0129('0x2c')][_0x0129('0x48')]({'where':{'id':_0x158373[_0x0129('0x47')]['id']}})[_0x0129('0x23')](handleEntityNotFound(_0x463312,null))['then'](saveUpdates(_0x158373[_0x0129('0x4a')],null))[_0x0129('0x23')](respondWithResult(_0x463312,null))[_0x0129('0x45')](handleError(_0x463312,null));};exports[_0x0129('0x27')]=function(_0x138b6e,_0xb95fe0){return db[_0x0129('0x2c')][_0x0129('0x48')]({'where':{'id':_0x138b6e[_0x0129('0x47')]['id']}})[_0x0129('0x23')](handleEntityNotFound(_0xb95fe0,null))['then'](removeEntity(_0xb95fe0,null))[_0x0129('0x45')](handleError(_0xb95fe0,null));}; \ No newline at end of file +var _0xb3d2=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','include','findAll','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x39dd37,_0x5ac852){var _0xa2d3cd=function(_0x44435c){while(--_0x44435c){_0x39dd37['push'](_0x39dd37['shift']());}};_0xa2d3cd(++_0x5ac852);}(_0xb3d2,0x140));var _0x2b3d=function(_0x11475f,_0x234c45){_0x11475f=_0x11475f-0x0;var _0x1c8a0c=_0xb3d2[_0x11475f];return _0x1c8a0c;};'use strict';var emlformat=require(_0x2b3d('0x0'));var rimraf=require(_0x2b3d('0x1'));var zipdir=require(_0x2b3d('0x2'));var jsonpatch=require(_0x2b3d('0x3'));var rp=require(_0x2b3d('0x4'));var moment=require(_0x2b3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2b3d('0x6'));var util=require(_0x2b3d('0x7'));var path=require(_0x2b3d('0x8'));var sox=require('sox');var csv=require(_0x2b3d('0x9'));var ejs=require(_0x2b3d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b3d('0xb'));var squel=require(_0x2b3d('0xc'));var crypto=require(_0x2b3d('0xd'));var jsforce=require(_0x2b3d('0xe'));var deskjs=require(_0x2b3d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b3d('0x10'));var Papa=require(_0x2b3d('0x11'));var Redis=require('ioredis');var authService=require(_0x2b3d('0x12'));var qs=require(_0x2b3d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b3d('0x14'));var logger=require(_0x2b3d('0x15'))(_0x2b3d('0x16'));var utils=require(_0x2b3d('0x17'));var config=require(_0x2b3d('0x18'));var licenseUtil=require(_0x2b3d('0x19'));var db=require(_0x2b3d('0x1a'))['db'];function respondWithStatusCode(_0x3a6932,_0x383e54){_0x383e54=_0x383e54||0xcc;return function(_0x12fa56){if(_0x12fa56){return _0x3a6932[_0x2b3d('0x1b')](_0x383e54);}return _0x3a6932[_0x2b3d('0x1c')](_0x383e54)[_0x2b3d('0x1d')]();};}function respondWithResult(_0x35e9cd,_0x32fca4){_0x32fca4=_0x32fca4||0xc8;return function(_0x1035d1){if(_0x1035d1){return _0x35e9cd[_0x2b3d('0x1c')](_0x32fca4)[_0x2b3d('0x1e')](_0x1035d1);}};}function respondWithFilteredResult(_0x1874de,_0x19e804){return function(_0x1bed53){if(_0x1bed53){var _0x34fe55=typeof _0x19e804[_0x2b3d('0x1f')]===_0x2b3d('0x20')&&typeof _0x19e804[_0x2b3d('0x21')]===_0x2b3d('0x20');var _0x2cdac2=_0x1bed53[_0x2b3d('0x22')];var _0x195642=_0x34fe55?0x0:_0x19e804[_0x2b3d('0x1f')];var _0x2d6398=_0x34fe55?_0x1bed53[_0x2b3d('0x22')]:_0x19e804[_0x2b3d('0x1f')]+_0x19e804[_0x2b3d('0x21')];var _0x561dc7;if(_0x2d6398>=_0x2cdac2){_0x2d6398=_0x2cdac2;_0x561dc7=0xc8;}else{_0x561dc7=0xce;}_0x1874de['status'](_0x561dc7);return _0x1874de['set'](_0x2b3d('0x23'),_0x195642+'-'+_0x2d6398+'/'+_0x2cdac2)['json'](_0x1bed53);}return null;};}function patchUpdates(_0xb1789d){return function(_0xa1d1a7){try{jsonpatch['apply'](_0xa1d1a7,_0xb1789d,!![]);}catch(_0x2a03db){return BPromise[_0x2b3d('0x24')](_0x2a03db);}return _0xa1d1a7['save']();};}function saveUpdates(_0x45f622,_0x5b120c){return function(_0x20e9f5){if(_0x20e9f5){return _0x20e9f5[_0x2b3d('0x25')](_0x45f622)[_0x2b3d('0x26')](function(_0x22f08c){return _0x22f08c;});}return null;};}function removeEntity(_0x1159f9,_0x5decd4){return function(_0x199cf5){if(_0x199cf5){return _0x199cf5['destroy']()[_0x2b3d('0x26')](function(){var _0xd96587=_0x199cf5[_0x2b3d('0x27')]({'plain':!![]});var _0x2f1bff=_0x2b3d('0x28');return db[_0x2b3d('0x29')][_0x2b3d('0x2a')]({'where':{'type':_0x2f1bff,'resourceId':_0xd96587['id']}})['then'](function(){return _0x199cf5;});})[_0x2b3d('0x26')](function(){_0x1159f9[_0x2b3d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a6fd4,_0x2e4a81){return function(_0x24de0b){if(!_0x24de0b){_0x4a6fd4[_0x2b3d('0x1b')](0x194);}return _0x24de0b;};}function handleError(_0x1252a6,_0x32e5c4){_0x32e5c4=_0x32e5c4||0x1f4;return function(_0x16c44b){logger[_0x2b3d('0x2b')](_0x16c44b[_0x2b3d('0x2c')]);if(_0x16c44b[_0x2b3d('0x2d')]){delete _0x16c44b[_0x2b3d('0x2d')];}_0x1252a6['status'](_0x32e5c4)[_0x2b3d('0x2e')](_0x16c44b);};}exports[_0x2b3d('0x2f')]=function(_0x1977bf,_0x55d5a9){var _0x4c7758={},_0x10d712={},_0x209a16={'count':0x0,'rows':[]};var _0x2bc09b=_[_0x2b3d('0x30')](db['Disposition'][_0x2b3d('0x31')],function(_0xf8000e){return{'name':_0xf8000e[_0x2b3d('0x32')],'type':_0xf8000e[_0x2b3d('0x33')][_0x2b3d('0x34')]};});_0x10d712[_0x2b3d('0x35')]=_['map'](_0x2bc09b,'name');_0x10d712[_0x2b3d('0x36')]=_[_0x2b3d('0x37')](_0x1977bf[_0x2b3d('0x36')]);_0x10d712[_0x2b3d('0x38')]=_[_0x2b3d('0x39')](_0x10d712[_0x2b3d('0x35')],_0x10d712[_0x2b3d('0x36')]);_0x4c7758[_0x2b3d('0x3a')]=_[_0x2b3d('0x39')](_0x10d712[_0x2b3d('0x35')],qs[_0x2b3d('0x3b')](_0x1977bf['query'][_0x2b3d('0x3b')]));_0x4c7758['attributes']=_0x4c7758[_0x2b3d('0x3a')][_0x2b3d('0x3c')]?_0x4c7758[_0x2b3d('0x3a')]:_0x10d712[_0x2b3d('0x35')];if(!_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x3d')]('nolimit')){_0x4c7758[_0x2b3d('0x21')]=qs['limit'](_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x21')]);_0x4c7758[_0x2b3d('0x1f')]=qs['offset'](_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x1f')]);}_0x4c7758[_0x2b3d('0x3e')]=qs[_0x2b3d('0x3f')](_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x3f')]);_0x4c7758[_0x2b3d('0x40')]=qs[_0x2b3d('0x38')](_[_0x2b3d('0x41')](_0x1977bf[_0x2b3d('0x36')],_0x10d712[_0x2b3d('0x38')]),_0x2bc09b);if(_0x1977bf['query'][_0x2b3d('0x42')]){_0x4c7758[_0x2b3d('0x40')]=_[_0x2b3d('0x43')](_0x4c7758[_0x2b3d('0x40')],{'$or':_[_0x2b3d('0x30')](_0x2bc09b,function(_0x572bfd){if(_0x572bfd['type']!==_0x2b3d('0x44')){var _0x2829e0={};_0x2829e0[_0x572bfd[_0x2b3d('0x2d')]]={'$like':'%'+_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x42')]+'%'};return _0x2829e0;}})});}_0x4c7758=_[_0x2b3d('0x43')]({},_0x4c7758,_0x1977bf[_0x2b3d('0x45')]);var _0xef642a={'where':_0x4c7758['where']};return db[_0x2b3d('0x46')][_0x2b3d('0x22')](_0xef642a)[_0x2b3d('0x26')](function(_0x4cbb5c){_0x209a16[_0x2b3d('0x22')]=_0x4cbb5c;if(_0x1977bf[_0x2b3d('0x36')][_0x2b3d('0x47')]){_0x4c7758[_0x2b3d('0x48')]=[{'all':!![]}];}return db[_0x2b3d('0x46')][_0x2b3d('0x49')](_0x4c7758);})[_0x2b3d('0x26')](function(_0x24cdb3){_0x209a16['rows']=_0x24cdb3;return _0x209a16;})[_0x2b3d('0x26')](respondWithFilteredResult(_0x55d5a9,_0x4c7758))['catch'](handleError(_0x55d5a9,null));};exports[_0x2b3d('0x4a')]=function(_0x1a84cc,_0x44c910){var _0x229e8f={'raw':!![],'where':{'id':_0x1a84cc[_0x2b3d('0x4b')]['id']}},_0x35abbe={};_0x35abbe[_0x2b3d('0x35')]=_[_0x2b3d('0x37')](db[_0x2b3d('0x46')][_0x2b3d('0x31')]);_0x35abbe[_0x2b3d('0x36')]=_['keys'](_0x1a84cc[_0x2b3d('0x36')]);_0x35abbe[_0x2b3d('0x38')]=_[_0x2b3d('0x39')](_0x35abbe[_0x2b3d('0x35')],_0x35abbe[_0x2b3d('0x36')]);_0x229e8f[_0x2b3d('0x3a')]=_['intersection'](_0x35abbe[_0x2b3d('0x35')],qs[_0x2b3d('0x3b')](_0x1a84cc['query'][_0x2b3d('0x3b')]));_0x229e8f['attributes']=_0x229e8f['attributes']['length']?_0x229e8f[_0x2b3d('0x3a')]:_0x35abbe[_0x2b3d('0x35')];if(_0x1a84cc[_0x2b3d('0x36')][_0x2b3d('0x47')]){_0x229e8f[_0x2b3d('0x48')]=[{'all':!![]}];}_0x229e8f=_[_0x2b3d('0x43')]({},_0x229e8f,_0x1a84cc[_0x2b3d('0x45')]);return db[_0x2b3d('0x46')][_0x2b3d('0x4c')](_0x229e8f)[_0x2b3d('0x26')](handleEntityNotFound(_0x44c910,null))[_0x2b3d('0x26')](respondWithResult(_0x44c910,null))[_0x2b3d('0x4d')](handleError(_0x44c910,null));};exports['create']=function(_0x56dc26,_0x5049e0){return db[_0x2b3d('0x46')][_0x2b3d('0x4e')](_0x56dc26[_0x2b3d('0x4f')],{})[_0x2b3d('0x26')](function(_0x508c05){var _0x613b28=_0x56dc26['user'][_0x2b3d('0x27')]({'plain':!![]});if(!_0x613b28)throw new Error(_0x2b3d('0x50'));if(_0x613b28['role']==='user'){var _0x2d316b=_0x508c05['get']({'plain':!![]});var _0x19296f=_0x2b3d('0x28');return db[_0x2b3d('0x51')][_0x2b3d('0x4c')]({'where':{'name':_0x19296f,'userProfileId':_0x613b28[_0x2b3d('0x52')]},'raw':!![]})['then'](function(_0x3e2e03){if(_0x3e2e03&&_0x3e2e03[_0x2b3d('0x53')]===0x0){return db['UserProfileResource'][_0x2b3d('0x4e')]({'name':_0x2d316b[_0x2b3d('0x2d')],'resourceId':_0x2d316b['id'],'type':_0x3e2e03[_0x2b3d('0x2d')],'sectionId':_0x3e2e03['id']},{})[_0x2b3d('0x26')](function(){return _0x508c05;});}else{return _0x508c05;}})['catch'](function(_0x29c0ed){logger['error'](_0x2b3d('0x54'),_0x29c0ed);throw _0x29c0ed;});}return _0x508c05;})[_0x2b3d('0x26')](respondWithResult(_0x5049e0,0xc9))[_0x2b3d('0x4d')](handleError(_0x5049e0,null));};exports[_0x2b3d('0x25')]=function(_0x4d723a,_0x335be6){if(_0x4d723a['body']['id']){delete _0x4d723a['body']['id'];}return db[_0x2b3d('0x46')][_0x2b3d('0x4c')]({'where':{'id':_0x4d723a['params']['id']}})[_0x2b3d('0x26')](handleEntityNotFound(_0x335be6,null))[_0x2b3d('0x26')](saveUpdates(_0x4d723a['body'],null))[_0x2b3d('0x26')](respondWithResult(_0x335be6,null))[_0x2b3d('0x4d')](handleError(_0x335be6,null));};exports[_0x2b3d('0x2a')]=function(_0x34d38d,_0x3aefef){return db['Disposition'][_0x2b3d('0x4c')]({'where':{'id':_0x34d38d[_0x2b3d('0x4b')]['id']}})[_0x2b3d('0x26')](handleEntityNotFound(_0x3aefef,null))[_0x2b3d('0x26')](removeEntity(_0x3aefef,null))[_0x2b3d('0x4d')](handleError(_0x3aefef,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 76c782d..81c6b09 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 _0x1caf=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId'];(function(_0x31ca4c,_0x38802c){var _0x423753=function(_0x55988e){while(--_0x55988e){_0x31ca4c['push'](_0x31ca4c['shift']());}};_0x423753(++_0x38802c);}(_0x1caf,0xf3));var _0xf1ca=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1caf[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xf1ca('0x0'));var util=require('util');var logger=require(_0xf1ca('0x1'))(_0xf1ca('0x2'));var moment=require(_0xf1ca('0x3'));var BPromise=require(_0xf1ca('0x4'));var rp=require(_0xf1ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1ca('0x6'));var config=require(_0xf1ca('0x7'));var attributes=require(_0xf1ca('0x8'));module['exports']=function(_0x3d3232,_0xcd1562){return _0x3d3232[_0xf1ca('0x9')](_0xf1ca('0xa'),attributes,{'tableName':_0xf1ca('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf1ca('0xc'),'fields':[_0xf1ca('0xd'),_0xf1ca('0xe')]},{'unique':!![],'name':_0xf1ca('0xf'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x10')]},{'unique':!![],'name':_0xf1ca('0x11'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x12')]},{'unique':!![],'name':_0xf1ca('0x13'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x14')]},{'unique':!![],'name':_0xf1ca('0x15'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x16')]},{'unique':!![],'name':_0xf1ca('0x17'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x18')]},{'unique':!![],'name':_0xf1ca('0x19'),'fields':[_0xf1ca('0xd'),_0xf1ca('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3101=['bluebird','rimraf','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','moment'];(function(_0x5cce5a,_0x298d54){var _0x354e33=function(_0xb372cf){while(--_0xb372cf){_0x5cce5a['push'](_0x5cce5a['shift']());}};_0x354e33(++_0x298d54);}(_0x3101,0x176));var _0x1310=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3101[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1310('0x0'));var util=require(_0x1310('0x1'));var logger=require(_0x1310('0x2'))('api');var moment=require(_0x1310('0x3'));var BPromise=require(_0x1310('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1310('0x5'));var config=require('../../config/environment');var attributes=require(_0x1310('0x6'));module[_0x1310('0x7')]=function(_0x6571da,_0x2139c8){return _0x6571da[_0x1310('0x8')]('Disposition',attributes,{'tableName':_0x1310('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1310('0xa'),'fields':[_0x1310('0xb'),_0x1310('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x1310('0xb'),_0x1310('0xd')]},{'unique':!![],'name':_0x1310('0xe'),'fields':[_0x1310('0xb'),_0x1310('0xf')]},{'unique':!![],'name':_0x1310('0x10'),'fields':[_0x1310('0xb'),_0x1310('0x11')]},{'unique':!![],'name':'name_fax','fields':['name',_0x1310('0x12')]},{'unique':!![],'name':_0x1310('0x13'),'fields':[_0x1310('0xb'),_0x1310('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x1310('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ec17a1e..247e35c 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(_0xb6b48e,_0xb0afb2){var _0x459529=function(_0x11d5cb){while(--_0x11d5cb){_0xb6b48e['push'](_0xb6b48e['shift']());}};_0x459529(++_0xb0afb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x1a1a68,_0x217819){var _0x3f81fe=function(_0x2e26e1){while(--_0x2e26e1){_0x1a1a68['push'](_0x1a1a68['shift']());}};_0x3f81fe(++_0x217819);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 b060155..7162843 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 _0x651d=['get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller'];(function(_0x503d00,_0x323df1){var _0x2263d8=function(_0x441850){while(--_0x441850){_0x503d00['push'](_0x503d00['shift']());}};_0x2263d8(++_0x323df1);}(_0x651d,0x196));var _0xd651=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0x651d[_0x3e91a9];return _0x25c9ad;};'use strict';var multer=require('multer');var util=require(_0xd651('0x0'));var path=require('path');var timeout=require(_0xd651('0x1'));var express=require(_0xd651('0x2'));var router=express[_0xd651('0x3')]();var fs_extra=require(_0xd651('0x4'));var auth=require(_0xd651('0x5'));var interaction=require(_0xd651('0x6'));var config=require('../../config/environment');var controller=require(_0xd651('0x7'));router[_0xd651('0x8')]('/',auth['isAuthenticated'](),controller[_0xd651('0x9')]);router[_0xd651('0x8')](_0xd651('0xa'),auth[_0xd651('0xb')](),controller['show']);router[_0xd651('0xc')]('/',auth[_0xd651('0xb')](),controller[_0xd651('0xd')]);router[_0xd651('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd651('0xf')](_0xd651('0xa'),auth['isAuthenticated'](),controller[_0xd651('0x10')]);module[_0xd651('0x11')]=router; \ No newline at end of file +var _0x6fda=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x6fda,0x1e3));var _0xa6fd=function(_0x557062,_0xcd1e42){_0x557062=_0x557062-0x0;var _0x3f9733=_0x6fda[_0x557062];return _0x3f9733;};'use strict';var multer=require(_0xa6fd('0x0'));var util=require(_0xa6fd('0x1'));var path=require(_0xa6fd('0x2'));var timeout=require(_0xa6fd('0x3'));var express=require(_0xa6fd('0x4'));var router=express[_0xa6fd('0x5')]();var fs_extra=require(_0xa6fd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa6fd('0x7'));var config=require(_0xa6fd('0x8'));var controller=require(_0xa6fd('0x9'));router[_0xa6fd('0xa')]('/',auth[_0xa6fd('0xb')](),controller[_0xa6fd('0xc')]);router[_0xa6fd('0xa')](_0xa6fd('0xd'),auth[_0xa6fd('0xb')](),controller[_0xa6fd('0xe')]);router[_0xa6fd('0xf')]('/',auth[_0xa6fd('0xb')](),controller[_0xa6fd('0x10')]);router[_0xa6fd('0x11')](_0xa6fd('0xd'),auth[_0xa6fd('0xb')](),controller['update']);router[_0xa6fd('0x12')](_0xa6fd('0xd'),auth['isAuthenticated'](),controller[_0xa6fd('0x13')]);module[_0xa6fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index f070203..8d936ae 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 _0x416c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','4800','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x22fb75,_0x14674b){var _0x4572e8=function(_0x49bc8a){while(--_0x49bc8a){_0x22fb75['push'](_0x22fb75['shift']());}};_0x4572e8(++_0x14674b);}(_0x416c,0x160));var _0xc416=function(_0xd74a1,_0x5c3704){_0xd74a1=_0xd74a1-0x0;var _0x53d731=_0x416c[_0xd74a1];return _0x53d731;};'use strict';var Sequelize=require(_0xc416('0x0'));module[_0xc416('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc416('0x2')]},'ecm':{'type':Sequelize[_0xc416('0x3')](_0xc416('0x4'),'no'),'defaultValue':_0xc416('0x4')},'headerinfo':{'type':Sequelize[_0xc416('0x2')],'defaultValue':_0xc416('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xc416('0x6')},'minrate':{'type':Sequelize[_0xc416('0x3')](_0xc416('0x7'),'4800',_0xc416('0x8'),_0xc416('0x9'),'12000','14400'),'defaultValue':_0xc416('0xa')},'maxrate':{'type':Sequelize[_0xc416('0x3')](_0xc416('0x7'),'4800',_0xc416('0x8'),_0xc416('0x9'),_0xc416('0xb'),'14400'),'defaultValue':_0xc416('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xc416('0xd')},'gateway':{'type':Sequelize[_0xc416('0x2')],'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[_0xc416('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc416('0x3')](_0xc416('0xf'),_0xc416('0x10'),_0xc416('0x11'),_0xc416('0x12')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc416('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc416('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc416('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc416('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc416('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc416('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc416('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc416('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xc416('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xc416('0x14')],'defaultValue':![],'comment':_0xc416('0x16'),'set':function(_0x582f83){if(!_0x582f83)this['setDataValue'](_0xc416('0x17'),null);this['setDataValue'](_0xc416('0x18'),_0x582f83);}}}; \ No newline at end of file +var _0xf38a=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','12000','14400','9600','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','TEXT'];(function(_0x25444a,_0x1ce7d7){var _0x1293d0=function(_0x326c69){while(--_0x326c69){_0x25444a['push'](_0x25444a['shift']());}};_0x1293d0(++_0x1ce7d7);}(_0xf38a,0x1b0));var _0xaf38=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0xf38a[_0x420f2a];return _0x28f802;};'use strict';var Sequelize=require(_0xaf38('0x0'));module[_0xaf38('0x1')]={'name':{'type':Sequelize[_0xaf38('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaf38('0x2')]},'ecm':{'type':Sequelize[_0xaf38('0x3')](_0xaf38('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xaf38('0x2')],'defaultValue':_0xaf38('0x5')},'localstationid':{'type':Sequelize[_0xaf38('0x2')],'unique':_0xaf38('0x6')},'minrate':{'type':Sequelize[_0xaf38('0x3')](_0xaf38('0x7'),_0xaf38('0x8'),'7200','9600',_0xaf38('0x9'),_0xaf38('0xa')),'defaultValue':_0xaf38('0x8')},'maxrate':{'type':Sequelize[_0xaf38('0x3')](_0xaf38('0x7'),_0xaf38('0x8'),'7200',_0xaf38('0xb'),_0xaf38('0x9'),_0xaf38('0xa')),'defaultValue':_0xaf38('0xa')},'modem':{'type':Sequelize[_0xaf38('0x2')],'defaultValue':_0xaf38('0xc')},'gateway':{'type':Sequelize[_0xaf38('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xaf38('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xaf38('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xaf38('0x3')](_0xaf38('0xe'),'IAX',_0xaf38('0xf'),_0xaf38('0x10')),'defaultValue':_0xaf38('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xaf38('0x11')],'defaultValue':function(){return _0xaf38('0x12');}},'notificationSound':{'type':Sequelize[_0xaf38('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf38('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaf38('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf38('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xaf38('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xaf38('0x15'),'set':function(_0x5c5b27){if(!_0x5c5b27)this[_0xaf38('0x16')](_0xaf38('0x17'),null);this[_0xaf38('0x16')](_0xaf38('0x18'),_0x5c5b27);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index f2d986c..c283164 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 _0x7bd6=['sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','get','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','ListId','getMessages','$gte','format','FaxMessage','CmList','List','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','FaxAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','FaxAccount','includeAll','include','findAll','show','Pause','options','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','describe','FaxAccountId','getDispositions','Disposition','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications'];(function(_0x297f98,_0x2ef8da){var _0x4e65ab=function(_0x225818){while(--_0x225818){_0x297f98['push'](_0x297f98['shift']());}};_0x4e65ab(++_0x2ef8da);}(_0x7bd6,0x109));var _0x67bd=function(_0x2bd440,_0xfb5a9d){_0x2bd440=_0x2bd440-0x0;var _0x58f325=_0x7bd6[_0x2bd440];return _0x58f325;};'use strict';var emlformat=require(_0x67bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67bd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x67bd('0x2'));var BPromise=require(_0x67bd('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x67bd('0x4'));var sox=require(_0x67bd('0x5'));var csv=require(_0x67bd('0x6'));var ejs=require(_0x67bd('0x7'));var fs=require('fs');var fs_extra=require(_0x67bd('0x8'));var _=require(_0x67bd('0x9'));var squel=require(_0x67bd('0xa'));var crypto=require('crypto');var jsforce=require(_0x67bd('0xb'));var deskjs=require(_0x67bd('0xc'));var toCsv=require(_0x67bd('0x6'));var querystring=require(_0x67bd('0xd'));var Papa=require(_0x67bd('0xe'));var Redis=require(_0x67bd('0xf'));var authService=require(_0x67bd('0x10'));var qs=require(_0x67bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x67bd('0x12'))(_0x67bd('0x13'));var utils=require(_0x67bd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x67bd('0x15'));var db=require(_0x67bd('0x16'))['db'];config[_0x67bd('0x17')]=_[_0x67bd('0x18')](config['redis'],{'host':_0x67bd('0x19'),'port':0x18eb});var socket=require(_0x67bd('0x1a'))(new Redis(config[_0x67bd('0x17')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x67bd('0x1b'));var client=jayson[_0x67bd('0x1c')][_0x67bd('0x1d')]({'port':0x232c});var client9002=jayson[_0x67bd('0x1c')][_0x67bd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x45e0b8,_0x388295,_0x55fd0e,_0x40702b){return new BPromise(function(_0x4edb22,_0x135c82){var _0x9ea187=_0x40702b||client;return _0x9ea187['request'](_0x45e0b8,_0x55fd0e)[_0x67bd('0x1e')](function(_0x3b1cf1){logger[_0x67bd('0x1f')](_0x67bd('0x20'),_0x388295,_0x67bd('0x21'));logger[_0x67bd('0x22')](_0x67bd('0x23'),_0x388295,_0x67bd('0x21'),JSON['stringify'](_0x3b1cf1));if(_0x3b1cf1['error']){if(_0x3b1cf1['error'][_0x67bd('0x24')]===0x1f4){logger[_0x67bd('0x25')]('FaxAccount,\x20%s,\x20%s',_0x388295,_0x3b1cf1['error'][_0x67bd('0x26')]);return _0x135c82(_0x3b1cf1[_0x67bd('0x25')][_0x67bd('0x26')]);}logger['error'](_0x67bd('0x20'),_0x388295,_0x3b1cf1['error'][_0x67bd('0x26')]);return _0x4edb22(_0x3b1cf1[_0x67bd('0x25')][_0x67bd('0x26')]);}else{logger[_0x67bd('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x388295,_0x67bd('0x21'));_0x4edb22(_0x3b1cf1[_0x67bd('0x27')][_0x67bd('0x26')]);}})[_0x67bd('0x28')](function(_0x328150){logger[_0x67bd('0x25')]('FaxAccount,\x20%s,\x20%s',_0x388295,_0x328150);_0x135c82(_0x328150);});});}function respondWithStatusCode(_0x4ffc09,_0xbacc98){_0xbacc98=_0xbacc98||0xcc;return function(_0x7ea2d0){if(_0x7ea2d0){return _0x4ffc09['sendStatus'](_0xbacc98);}return _0x4ffc09['status'](_0xbacc98)[_0x67bd('0x29')]();};}function respondWithResult(_0x1f35cf,_0x376ab9){_0x376ab9=_0x376ab9||0xc8;return function(_0x5e59ae){if(_0x5e59ae){return _0x1f35cf[_0x67bd('0x2a')](_0x376ab9)[_0x67bd('0x2b')](_0x5e59ae);}};}function respondWithFilteredResult(_0xffb714,_0x1d810f){return function(_0x54e34d){if(_0x54e34d){var _0x10a0aa=typeof _0x1d810f[_0x67bd('0x2c')]===_0x67bd('0x2d')&&typeof _0x1d810f['limit']===_0x67bd('0x2d');var _0x2a7546=_0x54e34d[_0x67bd('0x2e')];var _0x3aca6c=_0x10a0aa?0x0:_0x1d810f['offset'];var _0x28a313=_0x10a0aa?_0x54e34d['count']:_0x1d810f[_0x67bd('0x2c')]+_0x1d810f[_0x67bd('0x2f')];var _0xfb3695;if(_0x28a313>=_0x2a7546){_0x28a313=_0x2a7546;_0xfb3695=0xc8;}else{_0xfb3695=0xce;}_0xffb714[_0x67bd('0x2a')](_0xfb3695);return _0xffb714[_0x67bd('0x30')](_0x67bd('0x31'),_0x3aca6c+'-'+_0x28a313+'/'+_0x2a7546)[_0x67bd('0x2b')](_0x54e34d);}return null;};}function patchUpdates(_0x45e8ad){return function(_0xdde46b){try{jsonpatch[_0x67bd('0x32')](_0xdde46b,_0x45e8ad,!![]);}catch(_0x1583dc){return BPromise['reject'](_0x1583dc);}return _0xdde46b[_0x67bd('0x33')]();};}function saveUpdates(_0x3bfedb,_0x2f2f65){return function(_0x2ce3c3){if(_0x2ce3c3){return _0x2ce3c3[_0x67bd('0x34')](_0x3bfedb)[_0x67bd('0x1e')](function(_0x21498b){return _0x21498b;});}return null;};}function removeEntity(_0xe4e9cb,_0x3fbb87){return function(_0x5e7cc6){if(_0x5e7cc6){return _0x5e7cc6['destroy']()[_0x67bd('0x1e')](function(){var _0x5929f7=_0x5e7cc6['get']({'plain':!![]});var _0x21f422=_0x67bd('0x35');return db[_0x67bd('0x36')][_0x67bd('0x37')]({'where':{'type':_0x21f422,'resourceId':_0x5929f7['id']}})['then'](function(){return _0x5e7cc6;});})[_0x67bd('0x1e')](function(){_0xe4e9cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x589ccf,_0x274eec){return function(_0x258596){if(!_0x258596){_0x589ccf[_0x67bd('0x38')](0x194);}return _0x258596;};}function handleError(_0x4fdc04,_0x56c45c){_0x56c45c=_0x56c45c||0x1f4;return function(_0x5ce36c){logger[_0x67bd('0x25')](_0x5ce36c[_0x67bd('0x39')]);if(_0x5ce36c[_0x67bd('0x3a')]){delete _0x5ce36c[_0x67bd('0x3a')];}_0x4fdc04[_0x67bd('0x2a')](_0x56c45c)[_0x67bd('0x3b')](_0x5ce36c);};}exports['index']=function(_0xf36774,_0x391ec5){var _0x39a6c1={'include':[{'model':db['Pause'],'as':_0x67bd('0x3c')}]},_0x13b00e={},_0x15b954={'count':0x0,'rows':[]};var _0x5c9056=_[_0x67bd('0x3d')](db['FaxAccount'][_0x67bd('0x3e')],function(_0x175a07){return{'name':_0x175a07['fieldName'],'type':_0x175a07[_0x67bd('0x3f')][_0x67bd('0x40')]};});_0x13b00e[_0x67bd('0x41')]=_['map'](_0x5c9056,'name');_0x13b00e[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0xf36774[_0x67bd('0x42')]);_0x13b00e[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x13b00e[_0x67bd('0x41')],_0x13b00e[_0x67bd('0x42')]);_0x39a6c1[_0x67bd('0x46')]=_['intersection'](_0x13b00e[_0x67bd('0x41')],qs[_0x67bd('0x47')](_0xf36774[_0x67bd('0x42')]['fields']));_0x39a6c1[_0x67bd('0x46')]=_0x39a6c1['attributes'][_0x67bd('0x48')]?_0x39a6c1[_0x67bd('0x46')]:_0x13b00e[_0x67bd('0x41')];if(!_0xf36774[_0x67bd('0x42')][_0x67bd('0x49')](_0x67bd('0x4a'))){_0x39a6c1[_0x67bd('0x2f')]=qs['limit'](_0xf36774[_0x67bd('0x42')][_0x67bd('0x2f')]);_0x39a6c1[_0x67bd('0x2c')]=qs['offset'](_0xf36774[_0x67bd('0x42')]['offset']);}_0x39a6c1['order']=qs[_0x67bd('0x4b')](_0xf36774[_0x67bd('0x42')][_0x67bd('0x4b')]);_0x39a6c1['where']=qs[_0x67bd('0x44')](_['pick'](_0xf36774[_0x67bd('0x42')],_0x13b00e[_0x67bd('0x44')]),_0x5c9056);if(_0xf36774[_0x67bd('0x42')][_0x67bd('0x4c')]){_0x39a6c1[_0x67bd('0x4d')]=_[_0x67bd('0x4e')](_0x39a6c1[_0x67bd('0x4d')],{'$or':_[_0x67bd('0x3d')](_0x5c9056,function(_0x8f7271){if(_0x8f7271['type']!==_0x67bd('0x4f')){var _0x52648d={};_0x52648d[_0x8f7271[_0x67bd('0x3a')]]={'$like':'%'+_0xf36774[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0x52648d;}})});}_0x39a6c1=_['merge']({},_0x39a6c1,_0xf36774['options']);var _0x36c3a4={'where':_0x39a6c1['where']};return db[_0x67bd('0x50')]['count'](_0x36c3a4)['then'](function(_0x330834){_0x15b954[_0x67bd('0x2e')]=_0x330834;if(_0xf36774['query'][_0x67bd('0x51')]){_0x39a6c1[_0x67bd('0x52')]=[{'all':!![]}];}return db[_0x67bd('0x50')][_0x67bd('0x53')](_0x39a6c1);})['then'](function(_0x343af3){_0x15b954['rows']=_0x343af3;return _0x15b954;})[_0x67bd('0x1e')](respondWithFilteredResult(_0x391ec5,_0x39a6c1))['catch'](handleError(_0x391ec5,null));};exports[_0x67bd('0x54')]=function(_0x4a19d9,_0x4fe72c){var _0x367921={'raw':![],'where':{'id':_0x4a19d9['params']['id']},'include':[{'model':db[_0x67bd('0x55')],'as':_0x67bd('0x3c')}]},_0x244c25={};_0x244c25[_0x67bd('0x41')]=_[_0x67bd('0x43')](db[_0x67bd('0x50')]['rawAttributes']);_0x244c25[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0x4a19d9['query']);_0x244c25[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x244c25['model'],_0x244c25[_0x67bd('0x42')]);_0x367921['attributes']=_['intersection'](_0x244c25['model'],qs['fields'](_0x4a19d9[_0x67bd('0x42')][_0x67bd('0x47')]));_0x367921[_0x67bd('0x46')]=_0x367921[_0x67bd('0x46')]['length']?_0x367921['attributes']:_0x244c25['model'];if(_0x4a19d9[_0x67bd('0x42')][_0x67bd('0x51')]){_0x367921['include']=[{'all':!![]}];}_0x367921=_[_0x67bd('0x4e')]({},_0x367921,_0x4a19d9[_0x67bd('0x56')]);return db[_0x67bd('0x50')][_0x67bd('0x57')](_0x367921)[_0x67bd('0x1e')](handleEntityNotFound(_0x4fe72c,null))[_0x67bd('0x1e')](respondWithResult(_0x4fe72c,null))[_0x67bd('0x28')](handleError(_0x4fe72c,null));};exports[_0x67bd('0x58')]=function(_0x39886f,_0x5ede86){return db['FaxAccount'][_0x67bd('0x58')](_0x39886f[_0x67bd('0x59')],{})[_0x67bd('0x1e')](function(_0x16eb25){var _0x4e85e1=_0x39886f[_0x67bd('0x5a')]['get']({'plain':!![]});if(!_0x4e85e1)throw new Error(_0x67bd('0x5b'));if(_0x4e85e1[_0x67bd('0x5c')]===_0x67bd('0x5a')){var _0x141834=_0x16eb25['get']({'plain':!![]});var _0x4588b5=_0x67bd('0x35');return db[_0x67bd('0x5d')][_0x67bd('0x57')]({'where':{'name':_0x4588b5,'userProfileId':_0x4e85e1[_0x67bd('0x5e')]},'raw':!![]})[_0x67bd('0x1e')](function(_0x13251a){if(_0x13251a&&_0x13251a[_0x67bd('0x5f')]===0x0){return db[_0x67bd('0x36')][_0x67bd('0x58')]({'name':_0x141834[_0x67bd('0x3a')],'resourceId':_0x141834['id'],'type':_0x13251a['name'],'sectionId':_0x13251a['id']},{})[_0x67bd('0x1e')](function(){return _0x16eb25;});}else{return _0x16eb25;}})['catch'](function(_0x2cd0d5){logger[_0x67bd('0x25')](_0x67bd('0x60'),_0x2cd0d5);throw _0x2cd0d5;});}return _0x16eb25;})[_0x67bd('0x1e')](respondWithResult(_0x5ede86,0xc9))['catch'](handleError(_0x5ede86,null));};exports['update']=function(_0x51eac8,_0x4d130a){if(_0x51eac8['body']['id']){delete _0x51eac8[_0x67bd('0x59')]['id'];}return db['FaxAccount'][_0x67bd('0x57')]({'where':{'id':_0x51eac8['params']['id']},'include':[{'model':db[_0x67bd('0x55')],'as':_0x67bd('0x3c')}]})[_0x67bd('0x1e')](handleEntityNotFound(_0x4d130a,null))['then'](saveUpdates(_0x51eac8[_0x67bd('0x59')],null))[_0x67bd('0x1e')](respondWithResult(_0x4d130a,null))[_0x67bd('0x28')](handleError(_0x4d130a,null));};exports['destroy']=function(_0x4f694f,_0x1e7cec){return db[_0x67bd('0x50')]['find']({'where':{'id':_0x4f694f[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x1e7cec,null))[_0x67bd('0x1e')](removeEntity(_0x1e7cec,null))[_0x67bd('0x28')](handleError(_0x1e7cec,null));};exports['describe']=function(_0x56b146,_0x15cbfc){return db[_0x67bd('0x50')][_0x67bd('0x62')]()[_0x67bd('0x1e')](respondWithResult(_0x15cbfc,null))[_0x67bd('0x28')](handleError(_0x15cbfc,null));};exports['addDisposition']=function(_0x168964,_0x2f7ebc,_0x1b4441){if(_0x168964[_0x67bd('0x59')]['id']){delete _0x168964[_0x67bd('0x59')]['id'];}return db[_0x67bd('0x50')][_0x67bd('0x57')]({'where':{'id':_0x168964[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x2f7ebc,null))['then'](function(_0x4d6822){if(_0x4d6822){_0x168964[_0x67bd('0x59')][_0x67bd('0x63')]=_0x4d6822['id'];return db['Disposition'][_0x67bd('0x58')](_0x168964[_0x67bd('0x59')]);}})[_0x67bd('0x1e')](respondWithResult(_0x2f7ebc,null))[_0x67bd('0x28')](handleError(_0x2f7ebc,null));};exports[_0x67bd('0x64')]=function(_0xeece9,_0x570a1a,_0x5d0b7d){var _0x15fd62={'raw':![],'where':{}};var _0x22e9c3={};var _0xcbbf5d={'count':0x0,'rows':[]};return db[_0x67bd('0x50')]['findOne']({'where':{'id':_0xeece9[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x570a1a,null))[_0x67bd('0x1e')](function(_0x243ed1){if(_0x243ed1){_0x22e9c3[_0x67bd('0x41')]=_[_0x67bd('0x43')](db[_0x67bd('0x65')][_0x67bd('0x3e')]);_0x22e9c3[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0xeece9[_0x67bd('0x42')]);_0x22e9c3[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x22e9c3[_0x67bd('0x41')],_0x22e9c3[_0x67bd('0x42')]);_0x15fd62[_0x67bd('0x46')]=_[_0x67bd('0x45')](_0x22e9c3[_0x67bd('0x41')],qs[_0x67bd('0x47')](_0xeece9[_0x67bd('0x42')]['fields']));_0x15fd62[_0x67bd('0x46')]=_0x15fd62['attributes'][_0x67bd('0x48')]?_0x15fd62[_0x67bd('0x46')]:_0x22e9c3[_0x67bd('0x41')];if(!_0xeece9[_0x67bd('0x42')][_0x67bd('0x49')](_0x67bd('0x4a'))){_0x15fd62[_0x67bd('0x2f')]=qs['limit'](_0xeece9[_0x67bd('0x42')][_0x67bd('0x2f')]);_0x15fd62[_0x67bd('0x2c')]=qs['offset'](_0xeece9[_0x67bd('0x42')][_0x67bd('0x2c')]);}_0x15fd62['order']=qs[_0x67bd('0x4b')](_0xeece9[_0x67bd('0x42')][_0x67bd('0x4b')]);_0x15fd62[_0x67bd('0x4d')]=qs[_0x67bd('0x44')](_[_0x67bd('0x66')](_0xeece9[_0x67bd('0x42')],_0x22e9c3[_0x67bd('0x44')]));_0x15fd62[_0x67bd('0x4d')]['FaxAccountId']=_0x243ed1['id'];if(_0xeece9['query'][_0x67bd('0x4c')]){_0x15fd62['where']=_[_0x67bd('0x4e')](_0x15fd62['where'],{'$or':_[_0x67bd('0x3d')](_0x15fd62['attributes'],function(_0x28162b){var _0x1e97fd={};_0x1e97fd[_0x28162b]={'$like':'%'+_0xeece9[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0x1e97fd;})});}_0x15fd62=_[_0x67bd('0x4e')]({},_0x15fd62,_0xeece9[_0x67bd('0x56')]);return db[_0x67bd('0x65')][_0x67bd('0x2e')]({'where':_0x15fd62[_0x67bd('0x4d')]})['then'](function(_0x14adec){_0xcbbf5d['count']=_0x14adec;if(_0xeece9['query']['includeAll']){_0x15fd62[_0x67bd('0x52')]=[{'all':!![]}];}return db[_0x67bd('0x65')][_0x67bd('0x53')](_0x15fd62);})[_0x67bd('0x1e')](function(_0x1d18c5){_0xcbbf5d[_0x67bd('0x67')]=_0x1d18c5;return _0xcbbf5d;});}})[_0x67bd('0x1e')](respondWithFilteredResult(_0x570a1a,_0x15fd62))[_0x67bd('0x28')](handleError(_0x570a1a,null));};exports[_0x67bd('0x68')]=function(_0x2f355e,_0x30e5cc,_0xcf5661){return db['FaxAccount'][_0x67bd('0x57')]({'where':{'id':_0x2f355e[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x30e5cc,null))[_0x67bd('0x1e')](function(_0x56569c){if(_0x56569c){return _0x56569c[_0x67bd('0x68')](_0x2f355e[_0x67bd('0x42')][_0x67bd('0x69')]);}})[_0x67bd('0x1e')](respondWithStatusCode(_0x30e5cc,null))[_0x67bd('0x28')](handleError(_0x30e5cc,null));};exports[_0x67bd('0x6a')]=function(_0xf23867,_0x454890,_0x1bbe71){if(_0xf23867['body']['id']){delete _0xf23867[_0x67bd('0x59')]['id'];}return db[_0x67bd('0x50')][_0x67bd('0x57')]({'where':{'id':_0xf23867['params']['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x454890,null))['then'](function(_0x145094){if(_0x145094){_0xf23867[_0x67bd('0x59')][_0x67bd('0x63')]=_0x145094['id'];return db[_0x67bd('0x6b')][_0x67bd('0x58')](_0xf23867[_0x67bd('0x59')]);}})['then'](respondWithResult(_0x454890,null))[_0x67bd('0x28')](handleError(_0x454890,null));};exports[_0x67bd('0x6c')]=function(_0x363220,_0x327e89,_0x3e90f5){var _0x5cdd89={'raw':![],'where':{}};var _0x5b1c87={};var _0x20cd2b={'count':0x0,'rows':[]};return db[_0x67bd('0x50')]['findOne']({'where':{'id':_0x363220[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x327e89,null))[_0x67bd('0x1e')](function(_0x1d1be8){if(_0x1d1be8){_0x5b1c87[_0x67bd('0x41')]=_[_0x67bd('0x43')](db[_0x67bd('0x6b')][_0x67bd('0x3e')]);_0x5b1c87[_0x67bd('0x42')]=_['keys'](_0x363220[_0x67bd('0x42')]);_0x5b1c87[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x5b1c87['model'],_0x5b1c87[_0x67bd('0x42')]);_0x5cdd89[_0x67bd('0x46')]=_[_0x67bd('0x45')](_0x5b1c87['model'],qs[_0x67bd('0x47')](_0x363220[_0x67bd('0x42')][_0x67bd('0x47')]));_0x5cdd89[_0x67bd('0x46')]=_0x5cdd89['attributes']['length']?_0x5cdd89[_0x67bd('0x46')]:_0x5b1c87['model'];if(!_0x363220['query'][_0x67bd('0x49')]('nolimit')){_0x5cdd89[_0x67bd('0x2f')]=qs['limit'](_0x363220[_0x67bd('0x42')][_0x67bd('0x2f')]);_0x5cdd89[_0x67bd('0x2c')]=qs['offset'](_0x363220['query'][_0x67bd('0x2c')]);}_0x5cdd89[_0x67bd('0x6d')]=qs['sort'](_0x363220[_0x67bd('0x42')][_0x67bd('0x4b')]);_0x5cdd89[_0x67bd('0x4d')]=qs['filters'](_[_0x67bd('0x66')](_0x363220[_0x67bd('0x42')],_0x5b1c87[_0x67bd('0x44')]));_0x5cdd89[_0x67bd('0x4d')]['FaxAccountId']=_0x1d1be8['id'];if(_0x363220[_0x67bd('0x42')][_0x67bd('0x4c')]){_0x5cdd89[_0x67bd('0x4d')]=_['merge'](_0x5cdd89[_0x67bd('0x4d')],{'$or':_[_0x67bd('0x3d')](_0x5cdd89['attributes'],function(_0x1ebc99){var _0x39afde={};_0x39afde[_0x1ebc99]={'$like':'%'+_0x363220[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0x39afde;})});}_0x5cdd89=_[_0x67bd('0x4e')]({},_0x5cdd89,_0x363220[_0x67bd('0x56')]);return db[_0x67bd('0x6b')][_0x67bd('0x2e')]({'where':_0x5cdd89[_0x67bd('0x4d')]})[_0x67bd('0x1e')](function(_0x382dce){_0x20cd2b[_0x67bd('0x2e')]=_0x382dce;if(_0x363220['query'][_0x67bd('0x51')]){_0x5cdd89[_0x67bd('0x52')]=[{'all':!![]}];}return db[_0x67bd('0x6b')][_0x67bd('0x53')](_0x5cdd89);})[_0x67bd('0x1e')](function(_0x56b586){_0x20cd2b[_0x67bd('0x67')]=_0x56b586;return _0x20cd2b;});}})[_0x67bd('0x1e')](respondWithFilteredResult(_0x327e89,_0x5cdd89))[_0x67bd('0x28')](handleError(_0x327e89,null));};exports['removeAnswers']=function(_0x55e2fe,_0x4c77e9,_0x4eee96){return db['FaxAccount'][_0x67bd('0x57')]({'where':{'id':_0x55e2fe['params']['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x4c77e9,null))[_0x67bd('0x1e')](function(_0x3baa4c){if(_0x3baa4c){return _0x3baa4c[_0x67bd('0x6e')](_0x55e2fe[_0x67bd('0x42')][_0x67bd('0x69')]);}})['then'](respondWithStatusCode(_0x4c77e9,null))[_0x67bd('0x28')](handleError(_0x4c77e9,null));};exports[_0x67bd('0x6f')]=function(_0x5a4afa,_0x59df29,_0x3e8134){return db[_0x67bd('0x70')][_0x67bd('0x57')]({'where':{'id':_0x5a4afa[_0x67bd('0x61')]['id']}})['then'](handleEntityNotFound(_0x59df29,null))[_0x67bd('0x1e')](function(_0x349293){if(_0x349293){return _0x349293[_0x67bd('0x6f')](_0x5a4afa['body'][_0x67bd('0x69')],_[_0x67bd('0x71')](_0x5a4afa[_0x67bd('0x59')],['ids','id'])||{});}})['then'](respondWithResult(_0x59df29,null))[_0x67bd('0x28')](handleError(_0x59df29,null));};exports[_0x67bd('0x72')]=function(_0x2afdae,_0x514540,_0x3e225e){var _0x25a70e={'raw':![],'where':{}};var _0x5c35c1={};var _0x575042={'count':0x0,'rows':[]};return db[_0x67bd('0x50')][_0x67bd('0x73')]({'where':{'id':_0x2afdae['params']['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x514540,null))[_0x67bd('0x1e')](function(_0x236969){if(_0x236969){_0x5c35c1[_0x67bd('0x41')]=_[_0x67bd('0x43')](db[_0x67bd('0x70')]['rawAttributes']);_0x5c35c1[_0x67bd('0x42')]=_['keys'](_0x2afdae['query']);_0x5c35c1[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x5c35c1[_0x67bd('0x41')],_0x5c35c1[_0x67bd('0x42')]);_0x25a70e[_0x67bd('0x46')]=_[_0x67bd('0x45')](_0x5c35c1[_0x67bd('0x41')],qs[_0x67bd('0x47')](_0x2afdae[_0x67bd('0x42')][_0x67bd('0x47')]));_0x25a70e['attributes']=_0x25a70e[_0x67bd('0x46')][_0x67bd('0x48')]?_0x25a70e['attributes']:_0x5c35c1[_0x67bd('0x41')];if(!_0x2afdae['query'][_0x67bd('0x49')](_0x67bd('0x4a'))){_0x25a70e[_0x67bd('0x2f')]=qs[_0x67bd('0x2f')](_0x2afdae['query'][_0x67bd('0x2f')]);_0x25a70e[_0x67bd('0x2c')]=qs[_0x67bd('0x2c')](_0x2afdae[_0x67bd('0x42')]['offset']);}_0x25a70e[_0x67bd('0x6d')]=qs['sort'](_0x2afdae[_0x67bd('0x42')][_0x67bd('0x4b')]);_0x25a70e[_0x67bd('0x4d')]=qs[_0x67bd('0x44')](_[_0x67bd('0x66')](_0x2afdae['query'],_0x5c35c1['filters']));_0x25a70e[_0x67bd('0x4d')]['FaxAccountId']=_0x236969['id'];if(_0x2afdae[_0x67bd('0x42')]['filter']){_0x25a70e[_0x67bd('0x4d')]=_[_0x67bd('0x4e')](_0x25a70e['where'],{'$or':_['map'](_0x25a70e[_0x67bd('0x46')],function(_0x21b2f0){var _0xfde6dc={};_0xfde6dc[_0x21b2f0]={'$like':'%'+_0x2afdae[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0xfde6dc;})});}_0x25a70e=_[_0x67bd('0x4e')]({},_0x25a70e,_0x2afdae[_0x67bd('0x56')]);return db[_0x67bd('0x70')]['count']({'where':_0x25a70e['where']})[_0x67bd('0x1e')](function(_0x36386d){_0x575042['count']=_0x36386d;if(_0x2afdae['query'][_0x67bd('0x51')]){_0x25a70e[_0x67bd('0x52')]=[{'model':db[_0x67bd('0x74')],'as':_0x67bd('0x75'),'required':![]},{'model':db[_0x67bd('0x76')],'as':'Owner','attributes':[_0x67bd('0x3a'),_0x67bd('0x77'),_0x67bd('0x78')],'required':![]},{'model':db['Tag'],'as':_0x67bd('0x79'),'attributes':['id',_0x67bd('0x3a'),_0x67bd('0x7a')],'where':_0x2afdae['query']['tag']?{'id':_0x2afdae[_0x67bd('0x42')][_0x67bd('0x7b')]}:undefined,'required':_0x2afdae[_0x67bd('0x42')][_0x67bd('0x7b')]?!![]:![]}];}return db[_0x67bd('0x70')]['findAll'](_0x25a70e);})[_0x67bd('0x1e')](function(_0x11f09d){_0x575042['rows']=_0x11f09d;return _0x575042;});}})[_0x67bd('0x1e')](respondWithFilteredResult(_0x514540,_0x25a70e))['catch'](handleError(_0x514540,null));};exports[_0x67bd('0x7c')]=function(_0x3b5d0f,_0x51daa4,_0x506513){return db[_0x67bd('0x50')][_0x67bd('0x73')]({'where':{'id':_0x3b5d0f[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x51daa4,null))[_0x67bd('0x1e')](function(_0x201e03){if(_0x201e03){return db[_0x67bd('0x7d')][_0x67bd('0x7e')](function(_0x546612){return db[_0x67bd('0x7f')][_0x67bd('0x37')]({'where':{'FaxAccountId':_0x3b5d0f[_0x67bd('0x61')]['id']},'transaction':_0x546612})[_0x67bd('0x1e')](function(_0x502b74){var _0x366024=_[_0x67bd('0x3d')](_0x3b5d0f[_0x67bd('0x59')],function(_0x2e4341){_0x2e4341[_0x67bd('0x63')]=_0x3b5d0f[_0x67bd('0x61')]['id'];return _0x2e4341;});return db[_0x67bd('0x7f')][_0x67bd('0x80')](_0x366024,{'transaction':_0x546612});});})['then'](function(){return db[_0x67bd('0x7f')][_0x67bd('0x81')]({'where':{'FaxAccountId':_0x3b5d0f[_0x67bd('0x61')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x51daa4,null))[_0x67bd('0x28')](handleError(_0x51daa4,null));};exports[_0x67bd('0x82')]=function(_0x16c90e,_0x5609a7,_0x50847f){var _0x4b2ed0={};var _0x12d2a7={};var _0x438d02;var _0x415482;return db[_0x67bd('0x50')][_0x67bd('0x73')]({'where':{'id':_0x16c90e[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x5609a7,null))[_0x67bd('0x1e')](function(_0x27696c){if(_0x27696c){_0x438d02=_0x27696c;_0x12d2a7['model']=_[_0x67bd('0x43')](db[_0x67bd('0x7f')][_0x67bd('0x3e')]);_0x12d2a7[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0x16c90e[_0x67bd('0x42')]);_0x12d2a7[_0x67bd('0x44')]=_['intersection'](_0x12d2a7[_0x67bd('0x41')],_0x12d2a7[_0x67bd('0x42')]);_0x4b2ed0[_0x67bd('0x46')]=_[_0x67bd('0x45')](_0x12d2a7[_0x67bd('0x41')],qs['fields'](_0x16c90e[_0x67bd('0x42')][_0x67bd('0x47')]));_0x4b2ed0[_0x67bd('0x46')]=_0x4b2ed0[_0x67bd('0x46')]['length']?_0x4b2ed0[_0x67bd('0x46')]:_0x12d2a7['model'];_0x4b2ed0[_0x67bd('0x6d')]=qs[_0x67bd('0x4b')](_0x16c90e[_0x67bd('0x42')]['sort']);_0x4b2ed0['where']=qs[_0x67bd('0x44')](_[_0x67bd('0x66')](_0x16c90e['query'],_0x12d2a7[_0x67bd('0x44')]));if(_0x16c90e[_0x67bd('0x42')][_0x67bd('0x4c')]){_0x4b2ed0[_0x67bd('0x4d')]=_[_0x67bd('0x4e')](_0x4b2ed0[_0x67bd('0x4d')],{'$or':_[_0x67bd('0x3d')](_0x4b2ed0[_0x67bd('0x46')],function(_0x58718f){var _0x51dfa7={};_0x51dfa7[_0x58718f]={'$like':'%'+_0x16c90e[_0x67bd('0x42')]['filter']+'%'};return _0x51dfa7;})});}_0x4b2ed0=_['merge']({},_0x4b2ed0,_0x16c90e[_0x67bd('0x56')]);return _0x438d02[_0x67bd('0x82')](_0x4b2ed0);}})[_0x67bd('0x1e')](function(_0x5ce070){if(_0x5ce070){_0x415482=_0x5ce070['length'];if(!_0x16c90e[_0x67bd('0x42')]['hasOwnProperty']('nolimit')){_0x4b2ed0[_0x67bd('0x2f')]=qs[_0x67bd('0x2f')](_0x16c90e[_0x67bd('0x42')]['limit']);_0x4b2ed0[_0x67bd('0x2c')]=qs[_0x67bd('0x2c')](_0x16c90e[_0x67bd('0x42')][_0x67bd('0x2c')]);}return _0x438d02[_0x67bd('0x82')](_0x4b2ed0);}})[_0x67bd('0x1e')](function(_0x2967d4){if(_0x2967d4){return _0x2967d4?{'count':_0x415482,'rows':_0x2967d4}:null;}})[_0x67bd('0x1e')](respondWithResult(_0x5609a7,null))['catch'](handleError(_0x5609a7,null));};function Extension(_0x8a07e,_0x15d4ca,_0x3da32e,_0x41b986){this[_0x67bd('0x83')]=_0x67bd('0x84');this[_0x67bd('0x85')]=_0x8a07e[_0x67bd('0x86')];this['app']=_0x41b986;this[_0x67bd('0x3f')]=_0x67bd('0x87');this['description']=_0x67bd('0x88');this[_0x67bd('0x63')]=_0x8a07e['id'];this['priority']=_0x15d4ca;this[_0x67bd('0x89')]=_0x3da32e;}function createExtensionsReciveFax(_0x40ff03){var _0xade06f=0x1;var _0x4780ea=[];_0x4780ea[_0x67bd('0x8a')](new Extension(_0x40ff03,_0xade06f,'','Answer'));_0xade06f+=0x1;_0x4780ea[_0x67bd('0x8a')](new Extension(_0x40ff03,_0xade06f,_0x67bd('0x8b'),_0x67bd('0x8c')));_0xade06f+=0x1;for(var _0x21cc04 in _0x40ff03){if(_0x40ff03[_0x67bd('0x49')](_0x21cc04)&&(_0x21cc04==='ecm'||_0x21cc04===_0x67bd('0x86')||_0x21cc04===_0x67bd('0x8d')||_0x21cc04===_0x67bd('0x8e')||_0x21cc04===_0x67bd('0x8f')||_0x21cc04===_0x67bd('0x90')||_0x21cc04===_0x67bd('0x91')||_0x21cc04===_0x67bd('0x92')||_0x21cc04===_0x67bd('0x93'))){_0x4780ea[_0x67bd('0x8a')](new Extension(_0x40ff03,_0xade06f,_0x67bd('0x94')+_0x21cc04+')='+_0x40ff03[_0x21cc04],_0x67bd('0x8c')));_0xade06f+=0x1;}}_0x4780ea[_0x67bd('0x8a')](new Extension(_0x40ff03,_0xade06f,'6',_0x67bd('0x95')));_0xade06f+=0x1;_0x4780ea['push'](new Extension(_0x40ff03,_0xade06f,_0x67bd('0x96'),_0x67bd('0x97')));_0xade06f=0x0;return _0x4780ea;}exports[_0x67bd('0x98')]=function(_0x5dee27,_0x523645,_0x10cd9b){var _0x3ec786;return db['sequelize'][_0x67bd('0x7e')](function(_0x2106d4){return db[_0x67bd('0x50')][_0x67bd('0x58')](_0x5dee27[_0x67bd('0x59')],{'transaction':_0x2106d4})['then'](function(_0x27b294){_0x3ec786=_0x27b294[_0x67bd('0x99')]({'plain':!![]});return db[_0x67bd('0x9a')]['bulkCreate'](createExtensionsReciveFax(_0x3ec786),{'transaction':_0x2106d4});});})[_0x67bd('0x1e')](function(){return _0x3ec786;})['then'](respondWithResult(_0x523645,null))[_0x67bd('0x28')](handleError(_0x523645,null));};exports[_0x67bd('0x9b')]=function(_0x4055d3,_0x2c0235,_0x5d5aa2){var _0x2e3298;return db[_0x67bd('0x7d')][_0x67bd('0x7e')](function(_0x337151){return db['FaxAccount'][_0x67bd('0x34')](_0x4055d3[_0x67bd('0x59')],{'where':{'id':_0x4055d3[_0x67bd('0x59')]['id']},'transaction':_0x337151})[_0x67bd('0x1e')](function(_0x354953){return db[_0x67bd('0x9a')][_0x67bd('0x37')]({'where':{'FaxAccountId':_0x4055d3['body']['id']},'transaction':_0x337151})[_0x67bd('0x1e')](function(_0x448d7d){return db[_0x67bd('0x9a')]['bulkCreate'](createExtensionsReciveFax(_[_0x67bd('0x71')](_0x4055d3[_0x67bd('0x59')],[_0x67bd('0x9c'),_0x67bd('0x40'),_0x67bd('0x9d'),_0x67bd('0x9e'),'TrunkId',_0x67bd('0x9f')])),{'transaction':_0x337151});});});})[_0x67bd('0x1e')](function(){return db['FaxAccount']['findById'](_0x4055d3[_0x67bd('0x59')]['id']);})[_0x67bd('0x1e')](respondWithResult(_0x2c0235,null))[_0x67bd('0x28')](handleError(_0x2c0235,null));};exports[_0x67bd('0xa0')]=function(_0x319294,_0x43bc27,_0x1165b3){var _0x2ec677={'raw':!![],'where':{}};var _0x41f447={};var _0x4108c4={'count':0x0,'rows':[]};return db[_0x67bd('0x50')][_0x67bd('0x73')]({'where':{'id':_0x319294['params']['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x43bc27,null))[_0x67bd('0x1e')](function(_0x22fb56){if(_0x22fb56){_0x41f447[_0x67bd('0x41')]=_[_0x67bd('0x43')](db['FaxMessage'][_0x67bd('0x3e')]);_0x41f447[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0x319294['query']);_0x41f447[_0x67bd('0x44')]=_[_0x67bd('0x45')](_0x41f447[_0x67bd('0x41')],_0x41f447[_0x67bd('0x42')]);_0x2ec677[_0x67bd('0x46')]=_[_0x67bd('0x45')](_0x41f447[_0x67bd('0x41')],qs[_0x67bd('0x47')](_0x319294['query']['fields']));_0x2ec677['attributes']=_0x2ec677[_0x67bd('0x46')][_0x67bd('0x48')]?_0x2ec677[_0x67bd('0x46')]:_0x41f447[_0x67bd('0x41')];if(!_0x319294[_0x67bd('0x42')][_0x67bd('0x49')](_0x67bd('0x4a'))){_0x2ec677[_0x67bd('0x2f')]=qs['limit'](_0x319294[_0x67bd('0x42')][_0x67bd('0x2f')]);_0x2ec677[_0x67bd('0x2c')]=qs[_0x67bd('0x2c')](_0x319294[_0x67bd('0x42')]['offset']);}_0x2ec677[_0x67bd('0x6d')]=qs[_0x67bd('0x4b')](_0x319294['query'][_0x67bd('0x4b')]);_0x2ec677[_0x67bd('0x4d')]=qs[_0x67bd('0x44')](_[_0x67bd('0x66')](_0x319294['query'],_0x41f447[_0x67bd('0x44')]));_0x2ec677[_0x67bd('0x4d')]['FaxAccountId']=_0x22fb56['id'];if(_0x319294['query'][_0x67bd('0x4c')]){_0x2ec677['where']=_[_0x67bd('0x4e')](_0x2ec677[_0x67bd('0x4d')],{'$or':_[_0x67bd('0x3d')](_0x2ec677[_0x67bd('0x46')],function(_0x3bfbfa){var _0x3ad947={};_0x3ad947[_0x3bfbfa]={'$like':'%'+_0x319294[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0x3ad947;})});}if(_0x319294['query'][_0x67bd('0xa1')]){var _0x1afda6=_0x319294[_0x67bd('0x42')][_0x67bd('0xa1')]['split'](',');var _0x28b4c6={};_0x28b4c6[_0x1afda6[0x0]]={'$gte':moment(_0x1afda6[0x1])[_0x67bd('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2ec677[_0x67bd('0x4d')]=_[_0x67bd('0x4e')](_0x2ec677[_0x67bd('0x4d')],_0x28b4c6);}_0x2ec677=_[_0x67bd('0x4e')]({},_0x2ec677,_0x319294[_0x67bd('0x56')]);return db[_0x67bd('0xa3')]['count']({'where':_0x2ec677['where']})[_0x67bd('0x1e')](function(_0x461894){_0x4108c4[_0x67bd('0x2e')]=_0x461894;if(_0x319294['query'][_0x67bd('0x51')]){_0x2ec677[_0x67bd('0x52')]=[{'all':!![]}];}return db[_0x67bd('0xa3')][_0x67bd('0x53')](_0x2ec677);})[_0x67bd('0x1e')](function(_0x51f721){_0x4108c4[_0x67bd('0x67')]=_0x51f721;return _0x4108c4;});}})[_0x67bd('0x1e')](respondWithFilteredResult(_0x43bc27,_0x2ec677))[_0x67bd('0x28')](handleError(_0x43bc27,null));};exports['send']=function(_0x393590,_0x59250b,_0x5ac561){var _0x11c08f,_0x3565ee={},_0xf5e81b;if(_0x393590['body']['to']){_0xf5e81b=_0x393590[_0x67bd('0x59')]['to'][0x0];}return db[_0x67bd('0x50')]['find']({'where':{'id':_0x393590[_0x67bd('0x61')]['id']},'include':[{'model':db[_0x67bd('0xa4')],'as':_0x67bd('0xa5'),'include':[{'model':db[_0x67bd('0x74')],'as':'Contacts','where':{'fax':_0xf5e81b},'limit':0x1,'order':[['updatedAt',_0x67bd('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x59250b,null))[_0x67bd('0x1e')](function(_0x22aa70){_0x11c08f=_0x22aa70;if(_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')]&&_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][_0x67bd('0x48')]){for(var _0x4e9518=0x0;_0x4e9518<_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][_0x67bd('0x48')];_0x4e9518+=0x1){_0x393590['body'][_0x67bd('0xa7')][_0x4e9518]={'filename':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][_0x4e9518][_0x67bd('0x3a')],'id':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][_0x4e9518]['id'],'path':path['join'](config[_0x67bd('0xa8')],_0x67bd('0xa9'),_0x393590[_0x67bd('0x59')]['attachments'][_0x4e9518][_0x67bd('0xaa')])};}}return respondWithRpcPromise(_0x67bd('0xab'),_0x67bd('0xab'),{'FaxAccountId':_['isNil'](_0x393590[_0x67bd('0x61')]['id'])?undefined:_0x393590[_0x67bd('0x61')]['id'],'path':_[_0x67bd('0xac')](_0x393590['body'][_0x67bd('0xa7')][0x0][_0x67bd('0x4')])?undefined:_0x393590[_0x67bd('0x59')]['attachments'][0x0][_0x67bd('0x4')],'fax':_[_0x67bd('0xac')](_0x393590['body']['to'][0x0])?undefined:_0x393590[_0x67bd('0x59')]['to'][0x0]},client9002);})[_0x67bd('0x1e')](function(){if(_0x11c08f){if(_['isNil'](_0x393590[_0x67bd('0x59')][_0x67bd('0xad')])){_0x393590[_0x67bd('0x59')][_0x67bd('0xad')]=util[_0x67bd('0xa2')](_0x67bd('0xae'),_0x11c08f[_0x67bd('0x3a')],_0x11c08f[_0x67bd('0xaf')]);}if(_0x11c08f[_0x67bd('0xa5')]){if(_0x11c08f[_0x67bd('0xa5')][_0x67bd('0xb0')][_0x67bd('0x48')]){return _0x11c08f[_0x67bd('0xa5')][_0x67bd('0xb0')][0x0];}else{return db[_0x67bd('0x74')]['create'](_[_0x67bd('0x18')](_0x393590[_0x67bd('0x59')],{'firstName':_0x393590[_0x67bd('0x59')]['to'][0x0],'phone':_0x393590[_0x67bd('0x59')]['to'][0x0],'fax':_0x393590['body']['to'][0x0],'ListId':_0x11c08f['ListId']}));}}else{throw new Error(_0x67bd('0xb1'));}}else{throw new Error(_0x67bd('0xb2'));}})[_0x67bd('0x1e')](function(_0x313aa4){if(_0x313aa4){return db['FaxInteraction'][_0x67bd('0x57')]({'where':{'ContactId':_0x313aa4['id'],'closed':![],'FaxAccountId':_0x11c08f['id']}})[_0x67bd('0x1e')](function(_0xd5f110){if(_0xd5f110){return[_0xd5f110,![]];}return db['FaxInteraction']['create']({'UserId':_0x393590[_0x67bd('0x5a')]['id'],'ContactId':_0x313aa4['id'],'FaxAccountId':_0x11c08f['id'],'fax':_0x393590[_0x67bd('0x59')]['to'][0x0],'firstMsgDirection':_0x67bd('0xb3'),'Messages':[_[_0x67bd('0x4e')](_0x393590[_0x67bd('0x59')],{'read':![],'body':_0x393590['body'][_0x67bd('0xa7')][0x0][_0x67bd('0xb4')],'FaxAccountId':_0x11c08f['id'],'UserId':_0x393590[_0x67bd('0x5a')]['id'],'ContactId':_0x313aa4['id'],'AttachmentId':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x67bd('0xb5')}]})['then'](function(_0x5e170){return[_0x5e170,!![]];});});}else{throw new Error(_0x67bd('0xb6'));}})[_0x67bd('0xb7')](function(_0x547143,_0x1c67b6){if(_0x1c67b6){return _0x547143;}return db[_0x67bd('0xa3')][_0x67bd('0x58')]({'direction':'out','read':![],'body':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0]['filename'],'FaxAccountId':_0x11c08f['id'],'FaxInteractionId':_0x547143['id'],'UserId':_0x393590[_0x67bd('0x5a')]['id'],'ContactId':_0x547143[_0x67bd('0xb8')],'AttachmentId':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0]['id']})[_0x67bd('0x1e')](function(_0x2201a6){_0x547143['dataValues']['Messages']=[];_0x547143[_0x67bd('0xb9')][_0x67bd('0xb5')][_0x67bd('0x8a')](_0x2201a6[_0x67bd('0xb9')]);return _0x547143;});})['then'](function(_0x46d7cd){respondWithRpcPromise(_0x67bd('0xba'),_0x67bd('0xba'),{'FaxAccountId':_[_0x67bd('0xac')](_0x393590[_0x67bd('0x61')]['id'])?undefined:_0x393590[_0x67bd('0x61')]['id'],'path':_[_0x67bd('0xac')](_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0]['path'])?undefined:_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0][_0x67bd('0x4')],'fax':_[_0x67bd('0xac')](_0x393590[_0x67bd('0x59')]['to'][0x0])?undefined:_0x393590['body']['to'][0x0],'AttachmentId':_0x393590[_0x67bd('0x59')][_0x67bd('0xa7')][0x0]['id']},client9002)[_0x67bd('0x1e')](function(_0x310e83){logger[_0x67bd('0x1f')](_0x67bd('0xbb'),_0x310e83);})[_0x67bd('0x28')](function(_0x1fb95a){logger[_0x67bd('0x1f')](_0x67bd('0xbb'),_0x1fb95a);});return _0x46d7cd;})['then'](respondWithResult(_0x59250b,null))['catch'](handleError(_0x59250b,null));};exports[_0x67bd('0xbc')]=function(_0x26fe5f,_0x3934cb,_0x95bd61){return db[_0x67bd('0x50')][_0x67bd('0x57')]({'where':{'id':_0x26fe5f[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x3934cb,null))[_0x67bd('0x1e')](function(_0x4a4827){if(_0x4a4827){return _0x4a4827[_0x67bd('0xbc')](_0x26fe5f[_0x67bd('0x59')][_0x67bd('0x69')],_[_0x67bd('0x71')](_0x26fe5f[_0x67bd('0x59')],[_0x67bd('0x69'),'id'])||{})[_0x67bd('0xb7')](function(_0xd17e0c){for(var _0xd903b=0x0;_0xd903b<_0x26fe5f[_0x67bd('0x59')][_0x67bd('0x69')][_0x67bd('0x48')];_0xd903b+=0x1){socket[_0x67bd('0xbd')](_0x67bd('0xbe'),{'UserId':Number(_0x26fe5f['body'][_0x67bd('0x69')][_0xd903b]),'FaxAccountId':Number(_0x26fe5f['params']['id'])});}return _0xd17e0c;});}})[_0x67bd('0x1e')](respondWithResult(_0x3934cb,null))['catch'](handleError(_0x3934cb,null));};exports[_0x67bd('0xbf')]=function(_0x243e02,_0x5d6eb2,_0x439e22){return db[_0x67bd('0x50')][_0x67bd('0x57')]({'where':{'id':_0x243e02[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x5d6eb2,null))['then'](function(_0x4d18d4){if(_0x4d18d4){return _0x4d18d4[_0x67bd('0xbf')](_0x243e02[_0x67bd('0x42')][_0x67bd('0x69')])[_0x67bd('0x1e')](function(){if(_[_0x67bd('0xc0')](_0x243e02['query']['ids'])){for(var _0x1900b0=0x0;_0x1900b0<_0x243e02[_0x67bd('0x42')][_0x67bd('0x69')]['length'];_0x1900b0+=0x1){socket['emit'](_0x67bd('0xc1'),{'UserId':Number(_0x243e02[_0x67bd('0x42')][_0x67bd('0x69')][_0x1900b0]),'FaxAccountId':Number(_0x243e02[_0x67bd('0x61')]['id'])});}}else{socket['emit'](_0x67bd('0xc1'),{'UserId':Number(_0x243e02[_0x67bd('0x42')][_0x67bd('0x69')]),'FaxAccountId':Number(_0x243e02[_0x67bd('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x5d6eb2,null))[_0x67bd('0x28')](handleError(_0x5d6eb2,null));};exports[_0x67bd('0xc2')]=function(_0x402161,_0x1b738d,_0xe5dc80){var _0x161acf={};var _0x16fa21={};var _0x48420d;var _0x254199;return db[_0x67bd('0x50')][_0x67bd('0x73')]({'where':{'id':_0x402161[_0x67bd('0x61')]['id']}})[_0x67bd('0x1e')](handleEntityNotFound(_0x1b738d,null))[_0x67bd('0x1e')](function(_0x62fbb1){if(_0x62fbb1){_0x48420d=_0x62fbb1;_0x16fa21[_0x67bd('0x41')]=_[_0x67bd('0x43')](db['User'][_0x67bd('0x3e')]);_0x16fa21[_0x67bd('0x42')]=_[_0x67bd('0x43')](_0x402161[_0x67bd('0x42')]);_0x16fa21['filters']=_['intersection'](_0x16fa21['model'],_0x16fa21['query']);_0x161acf[_0x67bd('0x46')]=_['intersection'](_0x16fa21['model'],qs[_0x67bd('0x47')](_0x402161[_0x67bd('0x42')][_0x67bd('0x47')]));_0x161acf[_0x67bd('0x46')]=_0x161acf[_0x67bd('0x46')]['length']?_0x161acf[_0x67bd('0x46')]:_0x16fa21[_0x67bd('0x41')];_0x161acf['order']=qs[_0x67bd('0x4b')](_0x402161[_0x67bd('0x42')]['sort']);_0x161acf[_0x67bd('0x4d')]=qs[_0x67bd('0x44')](_[_0x67bd('0x66')](_0x402161[_0x67bd('0x42')],_0x16fa21[_0x67bd('0x44')]));if(_0x402161[_0x67bd('0x42')][_0x67bd('0x4c')]){_0x161acf[_0x67bd('0x4d')]=_['merge'](_0x161acf[_0x67bd('0x4d')],{'$or':_[_0x67bd('0x3d')](_0x161acf[_0x67bd('0x46')],function(_0x49dc77){var _0x2164e1={};_0x2164e1[_0x49dc77]={'$like':'%'+_0x402161[_0x67bd('0x42')][_0x67bd('0x4c')]+'%'};return _0x2164e1;})});}_0x161acf=_['merge']({},_0x161acf,_0x402161[_0x67bd('0x56')]);return _0x48420d[_0x67bd('0xc2')](_0x161acf);}})[_0x67bd('0x1e')](function(_0x360629){if(_0x360629){_0x254199=_0x360629[_0x67bd('0x48')];if(!_0x402161[_0x67bd('0x42')][_0x67bd('0x49')]('nolimit')){_0x161acf[_0x67bd('0x2f')]=qs[_0x67bd('0x2f')](_0x402161[_0x67bd('0x42')]['limit']);_0x161acf['offset']=qs[_0x67bd('0x2c')](_0x402161[_0x67bd('0x42')][_0x67bd('0x2c')]);}return _0x48420d[_0x67bd('0xc2')](_0x161acf);}})['then'](function(_0x166e80){if(_0x166e80){return _0x166e80?{'count':_0x254199,'rows':_0x166e80}:null;}})['then'](respondWithResult(_0x1b738d,null))[_0x67bd('0x28')](handleError(_0x1b738d,null));}; \ No newline at end of file +var _0x2bcf=['createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','http','client','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','FaxAccounts','sendStatus','name','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','catch','show','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','FaxAccountId','Disposition','getDispositions','findOne','options','findAll','rows','removeDispositions','ids','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','fullname','Tag','Tags','color','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','key'];(function(_0x3073c5,_0x426ccc){var _0x35f385=function(_0x45b159){while(--_0x45b159){_0x3073c5['push'](_0x3073c5['shift']());}};_0x35f385(++_0x426ccc);}(_0x2bcf,0xe2));var _0xf2bc=function(_0xf973b7,_0x46699f){_0xf973b7=_0xf973b7-0x0;var _0x499087=_0x2bcf[_0xf973b7];return _0x499087;};'use strict';var emlformat=require(_0xf2bc('0x0'));var rimraf=require(_0xf2bc('0x1'));var zipdir=require(_0xf2bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2bc('0x3'));var moment=require(_0xf2bc('0x4'));var BPromise=require(_0xf2bc('0x5'));var Mustache=require(_0xf2bc('0x6'));var util=require(_0xf2bc('0x7'));var path=require(_0xf2bc('0x8'));var sox=require(_0xf2bc('0x9'));var csv=require(_0xf2bc('0xa'));var ejs=require(_0xf2bc('0xb'));var fs=require('fs');var fs_extra=require(_0xf2bc('0xc'));var _=require(_0xf2bc('0xd'));var squel=require(_0xf2bc('0xe'));var crypto=require(_0xf2bc('0xf'));var jsforce=require(_0xf2bc('0x10'));var deskjs=require(_0xf2bc('0x11'));var toCsv=require(_0xf2bc('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf2bc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf2bc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2bc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf2bc('0x15'));var config=require(_0xf2bc('0x16'));var licenseUtil=require(_0xf2bc('0x17'));var db=require(_0xf2bc('0x18'))['db'];config[_0xf2bc('0x19')]=_[_0xf2bc('0x1a')](config[_0xf2bc('0x19')],{'host':_0xf2bc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf2bc('0x19')]));require(_0xf2bc('0x1c'))[_0xf2bc('0x1d')](socket);var jayson=require(_0xf2bc('0x1e'));var client=jayson['client'][_0xf2bc('0x1f')]({'port':0x232c});var client9002=jayson[_0xf2bc('0x20')][_0xf2bc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x970f3c,_0x49611e,_0x53d4cf,_0x42c54c){return new BPromise(function(_0x476e55,_0x39e3e5){var _0x2e4a2f=_0x42c54c||client;return _0x2e4a2f['request'](_0x970f3c,_0x53d4cf)[_0xf2bc('0x21')](function(_0x556ff0){logger[_0xf2bc('0x22')](_0xf2bc('0x23'),_0x49611e,_0xf2bc('0x24'));logger[_0xf2bc('0x25')](_0xf2bc('0x26'),_0x49611e,_0xf2bc('0x24'),JSON['stringify'](_0x556ff0));if(_0x556ff0[_0xf2bc('0x27')]){if(_0x556ff0[_0xf2bc('0x27')][_0xf2bc('0x28')]===0x1f4){logger[_0xf2bc('0x27')](_0xf2bc('0x23'),_0x49611e,_0x556ff0[_0xf2bc('0x27')][_0xf2bc('0x29')]);return _0x39e3e5(_0x556ff0[_0xf2bc('0x27')][_0xf2bc('0x29')]);}logger[_0xf2bc('0x27')]('FaxAccount,\x20%s,\x20%s',_0x49611e,_0x556ff0[_0xf2bc('0x27')]['message']);return _0x476e55(_0x556ff0[_0xf2bc('0x27')][_0xf2bc('0x29')]);}else{logger[_0xf2bc('0x22')](_0xf2bc('0x23'),_0x49611e,_0xf2bc('0x24'));_0x476e55(_0x556ff0[_0xf2bc('0x2a')][_0xf2bc('0x29')]);}})['catch'](function(_0x4137b2){logger[_0xf2bc('0x27')](_0xf2bc('0x23'),_0x49611e,_0x4137b2);_0x39e3e5(_0x4137b2);});});}function respondWithStatusCode(_0x18cd21,_0x42ea77){_0x42ea77=_0x42ea77||0xcc;return function(_0x424205){if(_0x424205){return _0x18cd21['sendStatus'](_0x42ea77);}return _0x18cd21[_0xf2bc('0x2b')](_0x42ea77)[_0xf2bc('0x2c')]();};}function respondWithResult(_0x5570b8,_0x54d9cc){_0x54d9cc=_0x54d9cc||0xc8;return function(_0xa13bb6){if(_0xa13bb6){return _0x5570b8[_0xf2bc('0x2b')](_0x54d9cc)[_0xf2bc('0x2d')](_0xa13bb6);}};}function respondWithFilteredResult(_0x3f7a3e,_0x49daed){return function(_0x29defb){if(_0x29defb){var _0x325282=typeof _0x49daed['offset']===_0xf2bc('0x2e')&&typeof _0x49daed[_0xf2bc('0x2f')]===_0xf2bc('0x2e');var _0x4b7b10=_0x29defb[_0xf2bc('0x30')];var _0x2daf38=_0x325282?0x0:_0x49daed[_0xf2bc('0x31')];var _0x5dbd31=_0x325282?_0x29defb[_0xf2bc('0x30')]:_0x49daed['offset']+_0x49daed[_0xf2bc('0x2f')];var _0x35e6a2;if(_0x5dbd31>=_0x4b7b10){_0x5dbd31=_0x4b7b10;_0x35e6a2=0xc8;}else{_0x35e6a2=0xce;}_0x3f7a3e[_0xf2bc('0x2b')](_0x35e6a2);return _0x3f7a3e[_0xf2bc('0x32')](_0xf2bc('0x33'),_0x2daf38+'-'+_0x5dbd31+'/'+_0x4b7b10)[_0xf2bc('0x2d')](_0x29defb);}return null;};}function patchUpdates(_0x5c38b6){return function(_0x2800d1){try{jsonpatch[_0xf2bc('0x34')](_0x2800d1,_0x5c38b6,!![]);}catch(_0x21f03c){return BPromise['reject'](_0x21f03c);}return _0x2800d1[_0xf2bc('0x35')]();};}function saveUpdates(_0x19bd6b,_0xfbf8bb){return function(_0x384ec0){if(_0x384ec0){return _0x384ec0[_0xf2bc('0x36')](_0x19bd6b)['then'](function(_0x5b9560){return _0x5b9560;});}return null;};}function removeEntity(_0x436569,_0x2d28db){return function(_0x451526){if(_0x451526){return _0x451526[_0xf2bc('0x37')]()[_0xf2bc('0x21')](function(){var _0x56c4e0=_0x451526['get']({'plain':!![]});var _0x176f64=_0xf2bc('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0x176f64,'resourceId':_0x56c4e0['id']}})[_0xf2bc('0x21')](function(){return _0x451526;});})[_0xf2bc('0x21')](function(){_0x436569[_0xf2bc('0x2b')](0xcc)[_0xf2bc('0x2c')]();});}};}function handleEntityNotFound(_0x4dadd9,_0x19bb2a){return function(_0x40c704){if(!_0x40c704){_0x4dadd9[_0xf2bc('0x39')](0x194);}return _0x40c704;};}function handleError(_0x2de2f6,_0x2745af){_0x2745af=_0x2745af||0x1f4;return function(_0x3db5c6){logger['error'](_0x3db5c6['stack']);if(_0x3db5c6['name']){delete _0x3db5c6[_0xf2bc('0x3a')];}_0x2de2f6['status'](_0x2745af)['send'](_0x3db5c6);};}exports['index']=function(_0x1255ab,_0x1239e2){var _0x2077ea={'include':[{'model':db['Pause'],'as':_0xf2bc('0x3b')}]},_0x2bfbe6={},_0x6f0a71={'count':0x0,'rows':[]};var _0x583a3c=_[_0xf2bc('0x3c')](db[_0xf2bc('0x3d')][_0xf2bc('0x3e')],function(_0x5980a4){return{'name':_0x5980a4[_0xf2bc('0x3f')],'type':_0x5980a4[_0xf2bc('0x40')]['key']};});_0x2bfbe6['model']=_[_0xf2bc('0x3c')](_0x583a3c,_0xf2bc('0x3a'));_0x2bfbe6[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0x1255ab[_0xf2bc('0x41')]);_0x2bfbe6[_0xf2bc('0x43')]=_[_0xf2bc('0x44')](_0x2bfbe6['model'],_0x2bfbe6['query']);_0x2077ea['attributes']=_[_0xf2bc('0x44')](_0x2bfbe6[_0xf2bc('0x45')],qs[_0xf2bc('0x46')](_0x1255ab[_0xf2bc('0x41')]['fields']));_0x2077ea[_0xf2bc('0x47')]=_0x2077ea['attributes'][_0xf2bc('0x48')]?_0x2077ea[_0xf2bc('0x47')]:_0x2bfbe6[_0xf2bc('0x45')];if(!_0x1255ab[_0xf2bc('0x41')][_0xf2bc('0x49')](_0xf2bc('0x4a'))){_0x2077ea[_0xf2bc('0x2f')]=qs['limit'](_0x1255ab[_0xf2bc('0x41')][_0xf2bc('0x2f')]);_0x2077ea['offset']=qs[_0xf2bc('0x31')](_0x1255ab[_0xf2bc('0x41')][_0xf2bc('0x31')]);}_0x2077ea[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0x1255ab[_0xf2bc('0x41')][_0xf2bc('0x4c')]);_0x2077ea['where']=qs['filters'](_[_0xf2bc('0x4d')](_0x1255ab['query'],_0x2bfbe6[_0xf2bc('0x43')]),_0x583a3c);if(_0x1255ab['query']['filter']){_0x2077ea[_0xf2bc('0x4e')]=_[_0xf2bc('0x4f')](_0x2077ea[_0xf2bc('0x4e')],{'$or':_['map'](_0x583a3c,function(_0x1713d7){if(_0x1713d7[_0xf2bc('0x40')]!=='VIRTUAL'){var _0x345d8d={};_0x345d8d[_0x1713d7[_0xf2bc('0x3a')]]={'$like':'%'+_0x1255ab['query'][_0xf2bc('0x50')]+'%'};return _0x345d8d;}})});}_0x2077ea=_[_0xf2bc('0x4f')]({},_0x2077ea,_0x1255ab['options']);var _0x554c0a={'where':_0x2077ea['where']};return db[_0xf2bc('0x3d')][_0xf2bc('0x30')](_0x554c0a)[_0xf2bc('0x21')](function(_0x4a5fa3){_0x6f0a71['count']=_0x4a5fa3;if(_0x1255ab[_0xf2bc('0x41')]['includeAll']){_0x2077ea['include']=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x2077ea);})[_0xf2bc('0x21')](function(_0x2ed6db){_0x6f0a71['rows']=_0x2ed6db;return _0x6f0a71;})[_0xf2bc('0x21')](respondWithFilteredResult(_0x1239e2,_0x2077ea))[_0xf2bc('0x51')](handleError(_0x1239e2,null));};exports[_0xf2bc('0x52')]=function(_0x279d3a,_0x1e2057){var _0x36a03={'raw':![],'where':{'id':_0x279d3a['params']['id']},'include':[{'model':db['Pause'],'as':_0xf2bc('0x3b')}]},_0x3afec5={};_0x3afec5[_0xf2bc('0x45')]=_[_0xf2bc('0x42')](db[_0xf2bc('0x3d')]['rawAttributes']);_0x3afec5['query']=_[_0xf2bc('0x42')](_0x279d3a[_0xf2bc('0x41')]);_0x3afec5['filters']=_[_0xf2bc('0x44')](_0x3afec5[_0xf2bc('0x45')],_0x3afec5[_0xf2bc('0x41')]);_0x36a03[_0xf2bc('0x47')]=_[_0xf2bc('0x44')](_0x3afec5['model'],qs['fields'](_0x279d3a[_0xf2bc('0x41')][_0xf2bc('0x46')]));_0x36a03['attributes']=_0x36a03[_0xf2bc('0x47')]['length']?_0x36a03[_0xf2bc('0x47')]:_0x3afec5[_0xf2bc('0x45')];if(_0x279d3a[_0xf2bc('0x41')][_0xf2bc('0x53')]){_0x36a03[_0xf2bc('0x54')]=[{'all':!![]}];}_0x36a03=_[_0xf2bc('0x4f')]({},_0x36a03,_0x279d3a['options']);return db[_0xf2bc('0x3d')][_0xf2bc('0x55')](_0x36a03)[_0xf2bc('0x21')](handleEntityNotFound(_0x1e2057,null))[_0xf2bc('0x21')](respondWithResult(_0x1e2057,null))['catch'](handleError(_0x1e2057,null));};exports[_0xf2bc('0x56')]=function(_0x2c0c25,_0x30a3b4){return db['FaxAccount'][_0xf2bc('0x56')](_0x2c0c25[_0xf2bc('0x57')],{})[_0xf2bc('0x21')](function(_0x87c41b){var _0x39d24d=_0x2c0c25[_0xf2bc('0x58')][_0xf2bc('0x59')]({'plain':!![]});if(!_0x39d24d)throw new Error(_0xf2bc('0x5a'));if(_0x39d24d[_0xf2bc('0x5b')]===_0xf2bc('0x58')){var _0x17f84c=_0x87c41b[_0xf2bc('0x59')]({'plain':!![]});var _0x5b4bcd=_0xf2bc('0x38');return db[_0xf2bc('0x5c')]['find']({'where':{'name':_0x5b4bcd,'userProfileId':_0x39d24d['userProfileId']},'raw':!![]})['then'](function(_0x18d729){if(_0x18d729&&_0x18d729[_0xf2bc('0x5d')]===0x0){return db[_0xf2bc('0x5e')][_0xf2bc('0x56')]({'name':_0x17f84c[_0xf2bc('0x3a')],'resourceId':_0x17f84c['id'],'type':_0x18d729[_0xf2bc('0x3a')],'sectionId':_0x18d729['id']},{})[_0xf2bc('0x21')](function(){return _0x87c41b;});}else{return _0x87c41b;}})[_0xf2bc('0x51')](function(_0x11d2af){logger[_0xf2bc('0x27')](_0xf2bc('0x5f'),_0x11d2af);throw _0x11d2af;});}return _0x87c41b;})[_0xf2bc('0x21')](respondWithResult(_0x30a3b4,0xc9))[_0xf2bc('0x51')](handleError(_0x30a3b4,null));};exports['update']=function(_0x231037,_0x183609){if(_0x231037[_0xf2bc('0x57')]['id']){delete _0x231037[_0xf2bc('0x57')]['id'];}return db[_0xf2bc('0x3d')]['find']({'where':{'id':_0x231037[_0xf2bc('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xf2bc('0x3b')}]})[_0xf2bc('0x21')](handleEntityNotFound(_0x183609,null))[_0xf2bc('0x21')](saveUpdates(_0x231037[_0xf2bc('0x57')],null))[_0xf2bc('0x21')](respondWithResult(_0x183609,null))[_0xf2bc('0x51')](handleError(_0x183609,null));};exports[_0xf2bc('0x37')]=function(_0x9f40b8,_0x349f09){return db[_0xf2bc('0x3d')][_0xf2bc('0x55')]({'where':{'id':_0x9f40b8[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x349f09,null))[_0xf2bc('0x21')](removeEntity(_0x349f09,null))[_0xf2bc('0x51')](handleError(_0x349f09,null));};exports['describe']=function(_0x51df1e,_0x69c54f){return db[_0xf2bc('0x3d')][_0xf2bc('0x61')]()[_0xf2bc('0x21')](respondWithResult(_0x69c54f,null))['catch'](handleError(_0x69c54f,null));};exports['addDisposition']=function(_0x22f717,_0xa7df16,_0x5f49bd){if(_0x22f717['body']['id']){delete _0x22f717[_0xf2bc('0x57')]['id'];}return db[_0xf2bc('0x3d')][_0xf2bc('0x55')]({'where':{'id':_0x22f717['params']['id']}})['then'](handleEntityNotFound(_0xa7df16,null))[_0xf2bc('0x21')](function(_0x296d67){if(_0x296d67){_0x22f717[_0xf2bc('0x57')][_0xf2bc('0x62')]=_0x296d67['id'];return db[_0xf2bc('0x63')][_0xf2bc('0x56')](_0x22f717[_0xf2bc('0x57')]);}})[_0xf2bc('0x21')](respondWithResult(_0xa7df16,null))[_0xf2bc('0x51')](handleError(_0xa7df16,null));};exports[_0xf2bc('0x64')]=function(_0x53cebd,_0x398163,_0x2233d3){var _0x320fff={'raw':![],'where':{}};var _0x5dde2b={};var _0x11f414={'count':0x0,'rows':[]};return db['FaxAccount'][_0xf2bc('0x65')]({'where':{'id':_0x53cebd[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x398163,null))['then'](function(_0x2642cb){if(_0x2642cb){_0x5dde2b[_0xf2bc('0x45')]=_['keys'](db[_0xf2bc('0x63')][_0xf2bc('0x3e')]);_0x5dde2b['query']=_[_0xf2bc('0x42')](_0x53cebd[_0xf2bc('0x41')]);_0x5dde2b[_0xf2bc('0x43')]=_[_0xf2bc('0x44')](_0x5dde2b[_0xf2bc('0x45')],_0x5dde2b[_0xf2bc('0x41')]);_0x320fff['attributes']=_[_0xf2bc('0x44')](_0x5dde2b[_0xf2bc('0x45')],qs['fields'](_0x53cebd['query'][_0xf2bc('0x46')]));_0x320fff[_0xf2bc('0x47')]=_0x320fff[_0xf2bc('0x47')][_0xf2bc('0x48')]?_0x320fff[_0xf2bc('0x47')]:_0x5dde2b[_0xf2bc('0x45')];if(!_0x53cebd[_0xf2bc('0x41')][_0xf2bc('0x49')]('nolimit')){_0x320fff[_0xf2bc('0x2f')]=qs[_0xf2bc('0x2f')](_0x53cebd[_0xf2bc('0x41')][_0xf2bc('0x2f')]);_0x320fff['offset']=qs[_0xf2bc('0x31')](_0x53cebd['query']['offset']);}_0x320fff['order']=qs[_0xf2bc('0x4c')](_0x53cebd[_0xf2bc('0x41')][_0xf2bc('0x4c')]);_0x320fff[_0xf2bc('0x4e')]=qs['filters'](_[_0xf2bc('0x4d')](_0x53cebd['query'],_0x5dde2b['filters']));_0x320fff[_0xf2bc('0x4e')][_0xf2bc('0x62')]=_0x2642cb['id'];if(_0x53cebd[_0xf2bc('0x41')][_0xf2bc('0x50')]){_0x320fff[_0xf2bc('0x4e')]=_[_0xf2bc('0x4f')](_0x320fff[_0xf2bc('0x4e')],{'$or':_['map'](_0x320fff[_0xf2bc('0x47')],function(_0x15f933){var _0xd9ecbc={};_0xd9ecbc[_0x15f933]={'$like':'%'+_0x53cebd['query']['filter']+'%'};return _0xd9ecbc;})});}_0x320fff=_[_0xf2bc('0x4f')]({},_0x320fff,_0x53cebd[_0xf2bc('0x66')]);return db[_0xf2bc('0x63')][_0xf2bc('0x30')]({'where':_0x320fff[_0xf2bc('0x4e')]})[_0xf2bc('0x21')](function(_0x18e05d){_0x11f414['count']=_0x18e05d;if(_0x53cebd[_0xf2bc('0x41')][_0xf2bc('0x53')]){_0x320fff['include']=[{'all':!![]}];}return db['Disposition'][_0xf2bc('0x67')](_0x320fff);})[_0xf2bc('0x21')](function(_0x7e1b56){_0x11f414[_0xf2bc('0x68')]=_0x7e1b56;return _0x11f414;});}})[_0xf2bc('0x21')](respondWithFilteredResult(_0x398163,_0x320fff))[_0xf2bc('0x51')](handleError(_0x398163,null));};exports['removeDispositions']=function(_0x281d09,_0x555c0b,_0x271fa0){return db[_0xf2bc('0x3d')][_0xf2bc('0x55')]({'where':{'id':_0x281d09[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x555c0b,null))['then'](function(_0x457b94){if(_0x457b94){return _0x457b94[_0xf2bc('0x69')](_0x281d09[_0xf2bc('0x41')][_0xf2bc('0x6a')]);}})['then'](respondWithStatusCode(_0x555c0b,null))[_0xf2bc('0x51')](handleError(_0x555c0b,null));};exports['addAnswer']=function(_0x57cd64,_0x4f5fde,_0x2ebbb0){if(_0x57cd64[_0xf2bc('0x57')]['id']){delete _0x57cd64[_0xf2bc('0x57')]['id'];}return db[_0xf2bc('0x3d')][_0xf2bc('0x55')]({'where':{'id':_0x57cd64[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x4f5fde,null))[_0xf2bc('0x21')](function(_0x3d52fe){if(_0x3d52fe){_0x57cd64[_0xf2bc('0x57')][_0xf2bc('0x62')]=_0x3d52fe['id'];return db[_0xf2bc('0x6b')][_0xf2bc('0x56')](_0x57cd64[_0xf2bc('0x57')]);}})[_0xf2bc('0x21')](respondWithResult(_0x4f5fde,null))[_0xf2bc('0x51')](handleError(_0x4f5fde,null));};exports['getAnswers']=function(_0xace697,_0x43db8a,_0x2ab64b){var _0x504708={'raw':![],'where':{}};var _0x1391c5={};var _0x491dc7={'count':0x0,'rows':[]};return db[_0xf2bc('0x3d')][_0xf2bc('0x65')]({'where':{'id':_0xace697[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x43db8a,null))['then'](function(_0x494953){if(_0x494953){_0x1391c5['model']=_[_0xf2bc('0x42')](db[_0xf2bc('0x6b')][_0xf2bc('0x3e')]);_0x1391c5[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0xace697[_0xf2bc('0x41')]);_0x1391c5[_0xf2bc('0x43')]=_[_0xf2bc('0x44')](_0x1391c5[_0xf2bc('0x45')],_0x1391c5[_0xf2bc('0x41')]);_0x504708['attributes']=_['intersection'](_0x1391c5[_0xf2bc('0x45')],qs['fields'](_0xace697['query'][_0xf2bc('0x46')]));_0x504708['attributes']=_0x504708[_0xf2bc('0x47')]['length']?_0x504708[_0xf2bc('0x47')]:_0x1391c5['model'];if(!_0xace697[_0xf2bc('0x41')][_0xf2bc('0x49')](_0xf2bc('0x4a'))){_0x504708[_0xf2bc('0x2f')]=qs[_0xf2bc('0x2f')](_0xace697[_0xf2bc('0x41')][_0xf2bc('0x2f')]);_0x504708[_0xf2bc('0x31')]=qs[_0xf2bc('0x31')](_0xace697[_0xf2bc('0x41')][_0xf2bc('0x31')]);}_0x504708[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0xace697['query'][_0xf2bc('0x4c')]);_0x504708[_0xf2bc('0x4e')]=qs[_0xf2bc('0x43')](_[_0xf2bc('0x4d')](_0xace697[_0xf2bc('0x41')],_0x1391c5[_0xf2bc('0x43')]));_0x504708[_0xf2bc('0x4e')][_0xf2bc('0x62')]=_0x494953['id'];if(_0xace697[_0xf2bc('0x41')][_0xf2bc('0x50')]){_0x504708['where']=_[_0xf2bc('0x4f')](_0x504708['where'],{'$or':_['map'](_0x504708[_0xf2bc('0x47')],function(_0x4593b9){var _0x60f28e={};_0x60f28e[_0x4593b9]={'$like':'%'+_0xace697[_0xf2bc('0x41')]['filter']+'%'};return _0x60f28e;})});}_0x504708=_['merge']({},_0x504708,_0xace697[_0xf2bc('0x66')]);return db['CannedAnswer']['count']({'where':_0x504708[_0xf2bc('0x4e')]})[_0xf2bc('0x21')](function(_0x5946b9){_0x491dc7[_0xf2bc('0x30')]=_0x5946b9;if(_0xace697[_0xf2bc('0x41')][_0xf2bc('0x53')]){_0x504708['include']=[{'all':!![]}];}return db[_0xf2bc('0x6b')][_0xf2bc('0x67')](_0x504708);})['then'](function(_0x2ed811){_0x491dc7[_0xf2bc('0x68')]=_0x2ed811;return _0x491dc7;});}})['then'](respondWithFilteredResult(_0x43db8a,_0x504708))[_0xf2bc('0x51')](handleError(_0x43db8a,null));};exports['removeAnswers']=function(_0x51e82b,_0x523f5c,_0x3c65a3){return db['FaxAccount'][_0xf2bc('0x55')]({'where':{'id':_0x51e82b[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x523f5c,null))[_0xf2bc('0x21')](function(_0x5d8584){if(_0x5d8584){return _0x5d8584[_0xf2bc('0x6c')](_0x51e82b['query']['ids']);}})['then'](respondWithStatusCode(_0x523f5c,null))[_0xf2bc('0x51')](handleError(_0x523f5c,null));};exports[_0xf2bc('0x6d')]=function(_0x2dc885,_0x5d8e47,_0x4bd494){return db[_0xf2bc('0x6e')][_0xf2bc('0x55')]({'where':{'id':_0x2dc885['params']['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x5d8e47,null))[_0xf2bc('0x21')](function(_0x49e458){if(_0x49e458){return _0x49e458[_0xf2bc('0x6d')](_0x2dc885[_0xf2bc('0x57')][_0xf2bc('0x6a')],_[_0xf2bc('0x6f')](_0x2dc885[_0xf2bc('0x57')],[_0xf2bc('0x6a'),'id'])||{});}})[_0xf2bc('0x21')](respondWithResult(_0x5d8e47,null))[_0xf2bc('0x51')](handleError(_0x5d8e47,null));};exports[_0xf2bc('0x70')]=function(_0x57d40c,_0x15ba99,_0x168799){var _0x110ad7={'raw':![],'where':{}};var _0x319b33={};var _0x4e1ed0={'count':0x0,'rows':[]};return db[_0xf2bc('0x3d')][_0xf2bc('0x65')]({'where':{'id':_0x57d40c[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x15ba99,null))['then'](function(_0x43418c){if(_0x43418c){_0x319b33['model']=_[_0xf2bc('0x42')](db[_0xf2bc('0x6e')][_0xf2bc('0x3e')]);_0x319b33[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0x57d40c[_0xf2bc('0x41')]);_0x319b33['filters']=_['intersection'](_0x319b33['model'],_0x319b33['query']);_0x110ad7[_0xf2bc('0x47')]=_[_0xf2bc('0x44')](_0x319b33[_0xf2bc('0x45')],qs[_0xf2bc('0x46')](_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x46')]));_0x110ad7[_0xf2bc('0x47')]=_0x110ad7[_0xf2bc('0x47')]['length']?_0x110ad7[_0xf2bc('0x47')]:_0x319b33[_0xf2bc('0x45')];if(!_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x49')](_0xf2bc('0x4a'))){_0x110ad7['limit']=qs[_0xf2bc('0x2f')](_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x2f')]);_0x110ad7[_0xf2bc('0x31')]=qs['offset'](_0x57d40c[_0xf2bc('0x41')]['offset']);}_0x110ad7[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x4c')]);_0x110ad7[_0xf2bc('0x4e')]=qs[_0xf2bc('0x43')](_['pick'](_0x57d40c[_0xf2bc('0x41')],_0x319b33[_0xf2bc('0x43')]));_0x110ad7[_0xf2bc('0x4e')]['FaxAccountId']=_0x43418c['id'];if(_0x57d40c['query'][_0xf2bc('0x50')]){_0x110ad7[_0xf2bc('0x4e')]=_['merge'](_0x110ad7[_0xf2bc('0x4e')],{'$or':_[_0xf2bc('0x3c')](_0x110ad7[_0xf2bc('0x47')],function(_0x42a0d2){var _0xee2dc6={};_0xee2dc6[_0x42a0d2]={'$like':'%'+_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x50')]+'%'};return _0xee2dc6;})});}_0x110ad7=_[_0xf2bc('0x4f')]({},_0x110ad7,_0x57d40c['options']);return db[_0xf2bc('0x6e')][_0xf2bc('0x30')]({'where':_0x110ad7[_0xf2bc('0x4e')]})[_0xf2bc('0x21')](function(_0x4ad03e){_0x4e1ed0[_0xf2bc('0x30')]=_0x4ad03e;if(_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x53')]){_0x110ad7['include']=[{'model':db[_0xf2bc('0x71')],'as':_0xf2bc('0x72'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xf2bc('0x3a'),_0xf2bc('0x73'),'internal'],'required':![]},{'model':db[_0xf2bc('0x74')],'as':_0xf2bc('0x75'),'attributes':['id',_0xf2bc('0x3a'),_0xf2bc('0x76')],'where':_0x57d40c[_0xf2bc('0x41')]['tag']?{'id':_0x57d40c['query'][_0xf2bc('0x77')]}:undefined,'required':_0x57d40c[_0xf2bc('0x41')][_0xf2bc('0x77')]?!![]:![]}];}return db['FaxInteraction'][_0xf2bc('0x67')](_0x110ad7);})[_0xf2bc('0x21')](function(_0x2f86cb){_0x4e1ed0[_0xf2bc('0x68')]=_0x2f86cb;return _0x4e1ed0;});}})[_0xf2bc('0x21')](respondWithFilteredResult(_0x15ba99,_0x110ad7))[_0xf2bc('0x51')](handleError(_0x15ba99,null));};exports['addApplications']=function(_0x15f749,_0x3f65d2,_0x174351){return db[_0xf2bc('0x3d')][_0xf2bc('0x65')]({'where':{'id':_0x15f749[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x3f65d2,null))[_0xf2bc('0x21')](function(_0x26a4d6){if(_0x26a4d6){return db[_0xf2bc('0x78')]['transaction'](function(_0xa4e792){return db[_0xf2bc('0x79')][_0xf2bc('0x37')]({'where':{'FaxAccountId':_0x15f749[_0xf2bc('0x60')]['id']},'transaction':_0xa4e792})[_0xf2bc('0x21')](function(_0x39d48b){var _0x33afb9=_[_0xf2bc('0x3c')](_0x15f749[_0xf2bc('0x57')],function(_0xb079a3){_0xb079a3[_0xf2bc('0x62')]=_0x15f749[_0xf2bc('0x60')]['id'];return _0xb079a3;});return db[_0xf2bc('0x79')][_0xf2bc('0x7a')](_0x33afb9,{'transaction':_0xa4e792});});})['then'](function(){return db['FaxApplication'][_0xf2bc('0x7b')]({'where':{'FaxAccountId':_0x15f749[_0xf2bc('0x60')]['id']},'order':_0xf2bc('0x7c')});});}})[_0xf2bc('0x21')](respondWithResult(_0x3f65d2,null))[_0xf2bc('0x51')](handleError(_0x3f65d2,null));};exports[_0xf2bc('0x7d')]=function(_0x594510,_0x53b5fc,_0xec8a1f){var _0x45f0b6={};var _0x53b2fd={};var _0x5b27b5;var _0x3f476a;return db['FaxAccount'][_0xf2bc('0x65')]({'where':{'id':_0x594510[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x53b5fc,null))[_0xf2bc('0x21')](function(_0x75b263){if(_0x75b263){_0x5b27b5=_0x75b263;_0x53b2fd[_0xf2bc('0x45')]=_['keys'](db[_0xf2bc('0x79')][_0xf2bc('0x3e')]);_0x53b2fd[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0x594510['query']);_0x53b2fd[_0xf2bc('0x43')]=_[_0xf2bc('0x44')](_0x53b2fd['model'],_0x53b2fd[_0xf2bc('0x41')]);_0x45f0b6[_0xf2bc('0x47')]=_[_0xf2bc('0x44')](_0x53b2fd[_0xf2bc('0x45')],qs[_0xf2bc('0x46')](_0x594510[_0xf2bc('0x41')][_0xf2bc('0x46')]));_0x45f0b6[_0xf2bc('0x47')]=_0x45f0b6[_0xf2bc('0x47')][_0xf2bc('0x48')]?_0x45f0b6[_0xf2bc('0x47')]:_0x53b2fd[_0xf2bc('0x45')];_0x45f0b6[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0x594510[_0xf2bc('0x41')][_0xf2bc('0x4c')]);_0x45f0b6[_0xf2bc('0x4e')]=qs['filters'](_[_0xf2bc('0x4d')](_0x594510[_0xf2bc('0x41')],_0x53b2fd[_0xf2bc('0x43')]));if(_0x594510['query'][_0xf2bc('0x50')]){_0x45f0b6[_0xf2bc('0x4e')]=_['merge'](_0x45f0b6['where'],{'$or':_[_0xf2bc('0x3c')](_0x45f0b6[_0xf2bc('0x47')],function(_0x1349d4){var _0x809a13={};_0x809a13[_0x1349d4]={'$like':'%'+_0x594510['query'][_0xf2bc('0x50')]+'%'};return _0x809a13;})});}_0x45f0b6=_[_0xf2bc('0x4f')]({},_0x45f0b6,_0x594510[_0xf2bc('0x66')]);return _0x5b27b5['getApplications'](_0x45f0b6);}})[_0xf2bc('0x21')](function(_0xa025fd){if(_0xa025fd){_0x3f476a=_0xa025fd[_0xf2bc('0x48')];if(!_0x594510['query'][_0xf2bc('0x49')](_0xf2bc('0x4a'))){_0x45f0b6['limit']=qs['limit'](_0x594510[_0xf2bc('0x41')]['limit']);_0x45f0b6[_0xf2bc('0x31')]=qs[_0xf2bc('0x31')](_0x594510['query'][_0xf2bc('0x31')]);}return _0x5b27b5['getApplications'](_0x45f0b6);}})[_0xf2bc('0x21')](function(_0x2d21f3){if(_0x2d21f3){return _0x2d21f3?{'count':_0x3f476a,'rows':_0x2d21f3}:null;}})[_0xf2bc('0x21')](respondWithResult(_0x53b5fc,null))[_0xf2bc('0x51')](handleError(_0x53b5fc,null));};function Extension(_0x5d67ce,_0x3bafaa,_0xdc63a,_0x4a1338){this[_0xf2bc('0x7e')]=_0xf2bc('0x7f');this['exten']=_0x5d67ce[_0xf2bc('0x80')];this[_0xf2bc('0x81')]=_0x4a1338;this[_0xf2bc('0x40')]=_0xf2bc('0x82');this[_0xf2bc('0x83')]=_0xf2bc('0x84');this[_0xf2bc('0x62')]=_0x5d67ce['id'];this[_0xf2bc('0x7c')]=_0x3bafaa;this['appdata']=_0xdc63a;}function createExtensionsReciveFax(_0x5b31c){var _0x4d461c=0x1;var _0x449d48=[];_0x449d48[_0xf2bc('0x85')](new Extension(_0x5b31c,_0x4d461c,'',_0xf2bc('0x86')));_0x4d461c+=0x1;_0x449d48[_0xf2bc('0x85')](new Extension(_0x5b31c,_0x4d461c,_0xf2bc('0x87'),_0xf2bc('0x88')));_0x4d461c+=0x1;for(var _0x2c7a34 in _0x5b31c){if(_0x5b31c[_0xf2bc('0x49')](_0x2c7a34)&&(_0x2c7a34===_0xf2bc('0x89')||_0x2c7a34===_0xf2bc('0x80')||_0x2c7a34==='gateway'||_0x2c7a34===_0xf2bc('0x8a')||_0x2c7a34===_0xf2bc('0x8b')||_0x2c7a34===_0xf2bc('0x8c')||_0x2c7a34===_0xf2bc('0x8d')||_0x2c7a34===_0xf2bc('0x8e')||_0x2c7a34===_0xf2bc('0x8f'))){_0x449d48[_0xf2bc('0x85')](new Extension(_0x5b31c,_0x4d461c,'FAXOPT('+_0x2c7a34+')='+_0x5b31c[_0x2c7a34],_0xf2bc('0x88')));_0x4d461c+=0x1;}}_0x449d48[_0xf2bc('0x85')](new Extension(_0x5b31c,_0x4d461c,'6',_0xf2bc('0x90')));_0x4d461c+=0x1;_0x449d48[_0xf2bc('0x85')](new Extension(_0x5b31c,_0x4d461c,_0xf2bc('0x91'),'ReceiveFax'));_0x4d461c=0x0;return _0x449d48;}exports[_0xf2bc('0x92')]=function(_0x3c7a03,_0x52d2fb,_0x6b5079){var _0xbcf69f;return db[_0xf2bc('0x78')][_0xf2bc('0x93')](function(_0x1a6f5d){return db[_0xf2bc('0x3d')]['create'](_0x3c7a03['body'],{'transaction':_0x1a6f5d})[_0xf2bc('0x21')](function(_0x503187){_0xbcf69f=_0x503187[_0xf2bc('0x59')]({'plain':!![]});return db[_0xf2bc('0x94')][_0xf2bc('0x7a')](createExtensionsReciveFax(_0xbcf69f),{'transaction':_0x1a6f5d});});})['then'](function(){return _0xbcf69f;})['then'](respondWithResult(_0x52d2fb,null))[_0xf2bc('0x51')](handleError(_0x52d2fb,null));};exports[_0xf2bc('0x95')]=function(_0xce31ad,_0x20b7a8,_0x1f8607){var _0x1224a2;return db[_0xf2bc('0x78')][_0xf2bc('0x93')](function(_0x3a993e){return db['FaxAccount'][_0xf2bc('0x36')](_0xce31ad[_0xf2bc('0x57')],{'where':{'id':_0xce31ad[_0xf2bc('0x57')]['id']},'transaction':_0x3a993e})[_0xf2bc('0x21')](function(_0x348a98){return db[_0xf2bc('0x94')]['destroy']({'where':{'FaxAccountId':_0xce31ad['body']['id']},'transaction':_0x3a993e})['then'](function(_0x1578a6){return db[_0xf2bc('0x94')]['bulkCreate'](createExtensionsReciveFax(_[_0xf2bc('0x6f')](_0xce31ad[_0xf2bc('0x57')],[_0xf2bc('0x96'),_0xf2bc('0x97'),_0xf2bc('0x98'),'updatedAt',_0xf2bc('0x99'),'ListId'])),{'transaction':_0x3a993e});});});})[_0xf2bc('0x21')](function(){return db[_0xf2bc('0x3d')][_0xf2bc('0x9a')](_0xce31ad[_0xf2bc('0x57')]['id']);})[_0xf2bc('0x21')](respondWithResult(_0x20b7a8,null))['catch'](handleError(_0x20b7a8,null));};exports[_0xf2bc('0x9b')]=function(_0xf7a95c,_0x110928,_0x59282e){var _0x539ec9={'raw':!![],'where':{}};var _0x250466={};var _0x409c6e={'count':0x0,'rows':[]};return db[_0xf2bc('0x3d')][_0xf2bc('0x65')]({'where':{'id':_0xf7a95c[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x110928,null))[_0xf2bc('0x21')](function(_0x961b65){if(_0x961b65){_0x250466[_0xf2bc('0x45')]=_[_0xf2bc('0x42')](db[_0xf2bc('0x9c')][_0xf2bc('0x3e')]);_0x250466[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0xf7a95c[_0xf2bc('0x41')]);_0x250466[_0xf2bc('0x43')]=_['intersection'](_0x250466[_0xf2bc('0x45')],_0x250466[_0xf2bc('0x41')]);_0x539ec9[_0xf2bc('0x47')]=_[_0xf2bc('0x44')](_0x250466[_0xf2bc('0x45')],qs[_0xf2bc('0x46')](_0xf7a95c[_0xf2bc('0x41')][_0xf2bc('0x46')]));_0x539ec9[_0xf2bc('0x47')]=_0x539ec9[_0xf2bc('0x47')]['length']?_0x539ec9[_0xf2bc('0x47')]:_0x250466[_0xf2bc('0x45')];if(!_0xf7a95c[_0xf2bc('0x41')][_0xf2bc('0x49')]('nolimit')){_0x539ec9[_0xf2bc('0x2f')]=qs[_0xf2bc('0x2f')](_0xf7a95c['query'][_0xf2bc('0x2f')]);_0x539ec9[_0xf2bc('0x31')]=qs['offset'](_0xf7a95c['query'][_0xf2bc('0x31')]);}_0x539ec9[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0xf7a95c[_0xf2bc('0x41')]['sort']);_0x539ec9[_0xf2bc('0x4e')]=qs[_0xf2bc('0x43')](_[_0xf2bc('0x4d')](_0xf7a95c[_0xf2bc('0x41')],_0x250466[_0xf2bc('0x43')]));_0x539ec9[_0xf2bc('0x4e')][_0xf2bc('0x62')]=_0x961b65['id'];if(_0xf7a95c['query'][_0xf2bc('0x50')]){_0x539ec9[_0xf2bc('0x4e')]=_[_0xf2bc('0x4f')](_0x539ec9['where'],{'$or':_['map'](_0x539ec9['attributes'],function(_0x22fa69){var _0x38f6e9={};_0x38f6e9[_0x22fa69]={'$like':'%'+_0xf7a95c[_0xf2bc('0x41')]['filter']+'%'};return _0x38f6e9;})});}if(_0xf7a95c['query'][_0xf2bc('0x9d')]){var _0x5dd0cf=_0xf7a95c['query']['$gte'][_0xf2bc('0x9e')](',');var _0x3ae020={};_0x3ae020[_0x5dd0cf[0x0]]={'$gte':moment(_0x5dd0cf[0x1])[_0xf2bc('0x9f')](_0xf2bc('0xa0'))};_0x539ec9[_0xf2bc('0x4e')]=_[_0xf2bc('0x4f')](_0x539ec9[_0xf2bc('0x4e')],_0x3ae020);}_0x539ec9=_[_0xf2bc('0x4f')]({},_0x539ec9,_0xf7a95c['options']);return db[_0xf2bc('0x9c')][_0xf2bc('0x30')]({'where':_0x539ec9[_0xf2bc('0x4e')]})[_0xf2bc('0x21')](function(_0x8ac37f){_0x409c6e[_0xf2bc('0x30')]=_0x8ac37f;if(_0xf7a95c[_0xf2bc('0x41')][_0xf2bc('0x53')]){_0x539ec9[_0xf2bc('0x54')]=[{'all':!![]}];}return db[_0xf2bc('0x9c')][_0xf2bc('0x67')](_0x539ec9);})[_0xf2bc('0x21')](function(_0x3212c6){_0x409c6e[_0xf2bc('0x68')]=_0x3212c6;return _0x409c6e;});}})['then'](respondWithFilteredResult(_0x110928,_0x539ec9))[_0xf2bc('0x51')](handleError(_0x110928,null));};exports[_0xf2bc('0xa1')]=function(_0x3095b8,_0x360a26,_0x253e69){var _0x31edc2,_0x394987={},_0x258ca1;if(_0x3095b8['body']['to']){_0x258ca1=_0x3095b8[_0xf2bc('0x57')]['to'][0x0];}return db[_0xf2bc('0x3d')][_0xf2bc('0x55')]({'where':{'id':_0x3095b8[_0xf2bc('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xf2bc('0xa2'),'include':[{'model':db[_0xf2bc('0x71')],'as':_0xf2bc('0xa3'),'where':{'fax':_0x258ca1},'limit':0x1,'order':[['updatedAt',_0xf2bc('0xa4')]]}]}]})[_0xf2bc('0x21')](handleEntityNotFound(_0x360a26,null))[_0xf2bc('0x21')](function(_0x536f0f){_0x31edc2=_0x536f0f;if(_0x3095b8['body'][_0xf2bc('0xa5')]&&_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')]['length']){for(var _0x591da4=0x0;_0x591da4<_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')]['length'];_0x591da4+=0x1){_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][_0x591da4]={'filename':_0x3095b8['body'][_0xf2bc('0xa5')][_0x591da4][_0xf2bc('0x3a')],'id':_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][_0x591da4]['id'],'path':path[_0xf2bc('0xa6')](config[_0xf2bc('0xa7')],_0xf2bc('0xa8'),_0x3095b8['body'][_0xf2bc('0xa5')][_0x591da4][_0xf2bc('0xa9')])};}}return respondWithRpcPromise(_0xf2bc('0xaa'),_0xf2bc('0xaa'),{'FaxAccountId':_[_0xf2bc('0xab')](_0x3095b8[_0xf2bc('0x60')]['id'])?undefined:_0x3095b8[_0xf2bc('0x60')]['id'],'path':_[_0xf2bc('0xab')](_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0][_0xf2bc('0x8')])?undefined:_0x3095b8['body'][_0xf2bc('0xa5')][0x0][_0xf2bc('0x8')],'fax':_[_0xf2bc('0xab')](_0x3095b8[_0xf2bc('0x57')]['to'][0x0])?undefined:_0x3095b8['body']['to'][0x0]},client9002);})['then'](function(){if(_0x31edc2){if(_['isNil'](_0x3095b8[_0xf2bc('0x57')]['from'])){_0x3095b8['body'][_0xf2bc('0xac')]=util['format'](_0xf2bc('0xad'),_0x31edc2['name'],_0x31edc2[_0xf2bc('0xae')]);}if(_0x31edc2[_0xf2bc('0xa2')]){if(_0x31edc2[_0xf2bc('0xa2')][_0xf2bc('0xa3')][_0xf2bc('0x48')]){return _0x31edc2[_0xf2bc('0xa2')]['Contacts'][0x0];}else{return db[_0xf2bc('0x71')]['create'](_[_0xf2bc('0x1a')](_0x3095b8[_0xf2bc('0x57')],{'firstName':_0x3095b8[_0xf2bc('0x57')]['to'][0x0],'phone':_0x3095b8[_0xf2bc('0x57')]['to'][0x0],'fax':_0x3095b8[_0xf2bc('0x57')]['to'][0x0],'ListId':_0x31edc2['ListId']}));}}else{throw new Error(_0xf2bc('0xaf'));}}else{throw new Error(_0xf2bc('0xb0'));}})[_0xf2bc('0x21')](function(_0x339ebd){if(_0x339ebd){return db[_0xf2bc('0x6e')]['find']({'where':{'ContactId':_0x339ebd['id'],'closed':![],'FaxAccountId':_0x31edc2['id']}})['then'](function(_0x5ae63b){if(_0x5ae63b){return[_0x5ae63b,![]];}return db[_0xf2bc('0x6e')][_0xf2bc('0x56')]({'UserId':_0x3095b8['user']['id'],'ContactId':_0x339ebd['id'],'FaxAccountId':_0x31edc2['id'],'fax':_0x3095b8[_0xf2bc('0x57')]['to'][0x0],'firstMsgDirection':_0xf2bc('0xb1'),'Messages':[_['merge'](_0x3095b8[_0xf2bc('0x57')],{'read':![],'body':_0x3095b8['body'][_0xf2bc('0xa5')][0x0][_0xf2bc('0xb2')],'FaxAccountId':_0x31edc2['id'],'UserId':_0x3095b8['user']['id'],'ContactId':_0x339ebd['id'],'AttachmentId':_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0]['id']})]},{'include':[{'model':db[_0xf2bc('0x9c')],'as':'Messages'}]})[_0xf2bc('0x21')](function(_0x508d89){return[_0x508d89,!![]];});});}else{throw new Error(_0xf2bc('0xb3'));}})['spread'](function(_0x45affd,_0x15338b){if(_0x15338b){return _0x45affd;}return db[_0xf2bc('0x9c')][_0xf2bc('0x56')]({'direction':'out','read':![],'body':_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0][_0xf2bc('0xb2')],'FaxAccountId':_0x31edc2['id'],'FaxInteractionId':_0x45affd['id'],'UserId':_0x3095b8['user']['id'],'ContactId':_0x45affd[_0xf2bc('0xb4')],'AttachmentId':_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0]['id']})[_0xf2bc('0x21')](function(_0x272132){_0x45affd[_0xf2bc('0xb5')][_0xf2bc('0xb6')]=[];_0x45affd[_0xf2bc('0xb5')][_0xf2bc('0xb6')][_0xf2bc('0x85')](_0x272132[_0xf2bc('0xb5')]);return _0x45affd;});})[_0xf2bc('0x21')](function(_0x40ab1d){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xf2bc('0xab')](_0x3095b8[_0xf2bc('0x60')]['id'])?undefined:_0x3095b8[_0xf2bc('0x60')]['id'],'path':_[_0xf2bc('0xab')](_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0]['path'])?undefined:_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0][_0xf2bc('0x8')],'fax':_[_0xf2bc('0xab')](_0x3095b8['body']['to'][0x0])?undefined:_0x3095b8['body']['to'][0x0],'AttachmentId':_0x3095b8[_0xf2bc('0x57')][_0xf2bc('0xa5')][0x0]['id']},client9002)['then'](function(_0x47adcf){logger[_0xf2bc('0x22')]('SendFaxRpc,\x20%s',_0x47adcf);})[_0xf2bc('0x51')](function(_0x4fde1c){logger[_0xf2bc('0x22')]('SendFaxRpc,\x20%s',_0x4fde1c);});return _0x40ab1d;})[_0xf2bc('0x21')](respondWithResult(_0x360a26,null))[_0xf2bc('0x51')](handleError(_0x360a26,null));};exports['addAgents']=function(_0x48a8e9,_0x1dca42,_0x431b74){return db['FaxAccount'][_0xf2bc('0x55')]({'where':{'id':_0x48a8e9[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x1dca42,null))['then'](function(_0xd41edf){if(_0xd41edf){return _0xd41edf[_0xf2bc('0xb7')](_0x48a8e9[_0xf2bc('0x57')][_0xf2bc('0x6a')],_[_0xf2bc('0x6f')](_0x48a8e9[_0xf2bc('0x57')],[_0xf2bc('0x6a'),'id'])||{})['spread'](function(_0x260849){for(var _0x42a058=0x0;_0x42a058<_0x48a8e9[_0xf2bc('0x57')]['ids'][_0xf2bc('0x48')];_0x42a058+=0x1){socket[_0xf2bc('0xb8')](_0xf2bc('0xb9'),{'UserId':Number(_0x48a8e9[_0xf2bc('0x57')][_0xf2bc('0x6a')][_0x42a058]),'FaxAccountId':Number(_0x48a8e9[_0xf2bc('0x60')]['id'])});}return _0x260849;});}})['then'](respondWithResult(_0x1dca42,null))[_0xf2bc('0x51')](handleError(_0x1dca42,null));};exports[_0xf2bc('0xba')]=function(_0x4b2d00,_0x4887ae,_0x5dc44b){return db[_0xf2bc('0x3d')]['find']({'where':{'id':_0x4b2d00[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x4887ae,null))[_0xf2bc('0x21')](function(_0x23aab1){if(_0x23aab1){return _0x23aab1[_0xf2bc('0xba')](_0x4b2d00['query'][_0xf2bc('0x6a')])['then'](function(){if(_[_0xf2bc('0xbb')](_0x4b2d00['query']['ids'])){for(var _0xbc6b37=0x0;_0xbc6b37<_0x4b2d00[_0xf2bc('0x41')][_0xf2bc('0x6a')]['length'];_0xbc6b37+=0x1){socket[_0xf2bc('0xb8')](_0xf2bc('0xbc'),{'UserId':Number(_0x4b2d00[_0xf2bc('0x41')][_0xf2bc('0x6a')][_0xbc6b37]),'FaxAccountId':Number(_0x4b2d00['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x4b2d00[_0xf2bc('0x41')][_0xf2bc('0x6a')]),'FaxAccountId':Number(_0x4b2d00[_0xf2bc('0x60')]['id'])});}});}})[_0xf2bc('0x21')](respondWithStatusCode(_0x4887ae,null))[_0xf2bc('0x51')](handleError(_0x4887ae,null));};exports['getAgents']=function(_0x452d27,_0x50fe4f,_0x52c7f9){var _0x5e3edb={};var _0xaea18d={};var _0x1013b6;var _0x436052;return db[_0xf2bc('0x3d')][_0xf2bc('0x65')]({'where':{'id':_0x452d27[_0xf2bc('0x60')]['id']}})[_0xf2bc('0x21')](handleEntityNotFound(_0x50fe4f,null))[_0xf2bc('0x21')](function(_0x4b19fe){if(_0x4b19fe){_0x1013b6=_0x4b19fe;_0xaea18d[_0xf2bc('0x45')]=_[_0xf2bc('0x42')](db['User'][_0xf2bc('0x3e')]);_0xaea18d[_0xf2bc('0x41')]=_[_0xf2bc('0x42')](_0x452d27[_0xf2bc('0x41')]);_0xaea18d[_0xf2bc('0x43')]=_[_0xf2bc('0x44')](_0xaea18d[_0xf2bc('0x45')],_0xaea18d[_0xf2bc('0x41')]);_0x5e3edb['attributes']=_['intersection'](_0xaea18d[_0xf2bc('0x45')],qs[_0xf2bc('0x46')](_0x452d27[_0xf2bc('0x41')]['fields']));_0x5e3edb[_0xf2bc('0x47')]=_0x5e3edb[_0xf2bc('0x47')][_0xf2bc('0x48')]?_0x5e3edb[_0xf2bc('0x47')]:_0xaea18d[_0xf2bc('0x45')];_0x5e3edb[_0xf2bc('0x4b')]=qs[_0xf2bc('0x4c')](_0x452d27['query'][_0xf2bc('0x4c')]);_0x5e3edb['where']=qs[_0xf2bc('0x43')](_[_0xf2bc('0x4d')](_0x452d27['query'],_0xaea18d['filters']));if(_0x452d27[_0xf2bc('0x41')][_0xf2bc('0x50')]){_0x5e3edb[_0xf2bc('0x4e')]=_[_0xf2bc('0x4f')](_0x5e3edb[_0xf2bc('0x4e')],{'$or':_[_0xf2bc('0x3c')](_0x5e3edb['attributes'],function(_0x2a2ef3){var _0x539a94={};_0x539a94[_0x2a2ef3]={'$like':'%'+_0x452d27[_0xf2bc('0x41')][_0xf2bc('0x50')]+'%'};return _0x539a94;})});}_0x5e3edb=_[_0xf2bc('0x4f')]({},_0x5e3edb,_0x452d27[_0xf2bc('0x66')]);return _0x1013b6['getAgents'](_0x5e3edb);}})[_0xf2bc('0x21')](function(_0x4ec947){if(_0x4ec947){_0x436052=_0x4ec947['length'];if(!_0x452d27['query'][_0xf2bc('0x49')](_0xf2bc('0x4a'))){_0x5e3edb[_0xf2bc('0x2f')]=qs[_0xf2bc('0x2f')](_0x452d27[_0xf2bc('0x41')]['limit']);_0x5e3edb[_0xf2bc('0x31')]=qs[_0xf2bc('0x31')](_0x452d27[_0xf2bc('0x41')][_0xf2bc('0x31')]);}return _0x1013b6['getAgents'](_0x5e3edb);}})[_0xf2bc('0x21')](function(_0x29af53){if(_0x29af53){return _0x29af53?{'count':_0x436052,'rows':_0x29af53}:null;}})['then'](respondWithResult(_0x50fe4f,null))[_0xf2bc('0x51')](handleError(_0x50fe4f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 38ebc2b..b0514a7 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 _0x662a=['exports','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1fbd78,_0x538cc0){var _0x4181d3=function(_0x53f104){while(--_0x53f104){_0x1fbd78['push'](_0x1fbd78['shift']());}};_0x4181d3(++_0x538cc0);}(_0x662a,0x1cf));var _0xa662=function(_0x19ced6,_0x210f9b){_0x19ced6=_0x19ced6-0x0;var _0x331a2e=_0x662a[_0x19ced6];return _0x331a2e;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa662('0x0'),'afterUpdate':_0xa662('0x1'),'afterDestroy':_0xa662('0x2')};function emitEvent(_0x33506d){return function(_0x1a0bc3,_0x1606cc,_0x46bc6b){FaxAccountEvents[_0xa662('0x3')](_0x33506d+':'+_0x1a0bc3['id'],_0x1a0bc3);FaxAccountEvents[_0xa662('0x3')](_0x33506d,_0x1a0bc3);_0x46bc6b(null);};}for(var e in events){if(events[_0xa662('0x4')](e)){var event=events[e];FaxAccount[_0xa662('0x5')](e,emitEvent(event));}}module[_0xa662('0x6')]=FaxAccountEvents; \ No newline at end of file +var _0x6320=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6320,0x6a));var _0x0632=function(_0x5ebfbc,_0x3e6fbf){_0x5ebfbc=_0x5ebfbc-0x0;var _0x6c85f6=_0x6320[_0x5ebfbc];return _0x6c85f6;};'use strict';var EventEmitter=require(_0x0632('0x0'));var FaxAccount=require(_0x0632('0x1'))['db'][_0x0632('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0632('0x3')](0x0);var events={'afterCreate':_0x0632('0x4'),'afterUpdate':_0x0632('0x5'),'afterDestroy':_0x0632('0x6')};function emitEvent(_0x50b6ab){return function(_0x4fc07b,_0x111556,_0xfa26af){FaxAccountEvents[_0x0632('0x7')](_0x50b6ab+':'+_0x4fc07b['id'],_0x4fc07b);FaxAccountEvents[_0x0632('0x7')](_0x50b6ab,_0x4fc07b);_0xfa26af(null);};}for(var e in events){if(events[_0x0632('0x8')](e)){var event=events[e];FaxAccount[_0x0632('0x9')](e,emitEvent(event));}}module[_0x0632('0xa')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 8c9aef5..500df9d 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 _0xc867=['FaxAccount','fax_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define'];(function(_0xa7662e,_0x22304d){var _0x425053=function(_0x3e24a6){while(--_0x3e24a6){_0xa7662e['push'](_0xa7662e['shift']());}};_0x425053(++_0x22304d);}(_0xc867,0xf4));var _0x7c86=function(_0x696054,_0x5473ec){_0x696054=_0x696054-0x0;var _0x5ab054=_0xc867[_0x696054];return _0x5ab054;};'use strict';var _=require(_0x7c86('0x0'));var util=require(_0x7c86('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7c86('0x2'));var rp=require(_0x7c86('0x3'));var fs=require('fs');var path=require(_0x7c86('0x4'));var rimraf=require(_0x7c86('0x5'));var config=require(_0x7c86('0x6'));var attributes=require(_0x7c86('0x7'));module['exports']=function(_0x4c0365,_0x3488d5){return _0x4c0365[_0x7c86('0x8')](_0x7c86('0x9'),attributes,{'tableName':_0x7c86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e7a=['fax_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3a6537,_0x3903ee){var _0x5cb87c=function(_0x3224e3){while(--_0x3224e3){_0x3a6537['push'](_0x3a6537['shift']());}};_0x5cb87c(++_0x3903ee);}(_0x1e7a,0x1c4));var _0xa1e7=function(_0x15e7d,_0x3c21dc){_0x15e7d=_0x15e7d-0x0;var _0x19af09=_0x1e7a[_0x15e7d];return _0x19af09;};'use strict';var _=require(_0xa1e7('0x0'));var util=require(_0xa1e7('0x1'));var logger=require(_0xa1e7('0x2'))(_0xa1e7('0x3'));var moment=require(_0xa1e7('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1e7('0x5'));var fs=require('fs');var path=require(_0xa1e7('0x6'));var rimraf=require(_0xa1e7('0x7'));var config=require(_0xa1e7('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x53eec7,_0x13eb6a){return _0x53eec7[_0xa1e7('0x9')]('FaxAccount',attributes,{'tableName':_0xa1e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 0ed4c7f..5551a7e 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 _0x0aeb=['created','ContactId','AttachmentId','interaction','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','model','map','include','then','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','asc','length','create','contact','fax','FaxInteraction','spread','autoclose','push','close'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x0aeb,0x65));var _0xb0ae=function(_0x43d5ab,_0x2b8009){_0x43d5ab=_0x43d5ab-0x0;var _0x2c913c=_0x0aeb[_0x43d5ab];return _0x2c913c;};'use strict';var _=require(_0xb0ae('0x0'));var util=require('util');var moment=require(_0xb0ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0ae('0x2'));var fs=require('fs');var Redis=require(_0xb0ae('0x3'));var db=require(_0xb0ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb0ae('0x5'));var jayson=require(_0xb0ae('0x6'));var client=jayson['client']['http']({'port':0x232c});config[_0xb0ae('0x7')]=_[_0xb0ae('0x8')](config[_0xb0ae('0x7')],{'host':_0xb0ae('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxAccount.socket')[_0xb0ae('0xa')](socket);function respondWithRpcPromise(_0x678aa7,_0x7970c5,_0x24b8ac){return new BPromise(function(_0x4a215d,_0x4b90cb){return client[_0xb0ae('0xb')](_0x678aa7,_0x24b8ac)['then'](function(_0x38181a){logger[_0xb0ae('0xc')](_0xb0ae('0xd'),_0x7970c5,_0xb0ae('0xe'));logger[_0xb0ae('0xf')](_0xb0ae('0x10'),_0x7970c5,_0xb0ae('0xe'),JSON[_0xb0ae('0x11')](_0x38181a));if(_0x38181a[_0xb0ae('0x12')]){if(_0x38181a[_0xb0ae('0x12')][_0xb0ae('0x13')]===0x1f4){logger[_0xb0ae('0x12')](_0xb0ae('0xd'),_0x7970c5,_0x38181a[_0xb0ae('0x12')]['message']);return _0x4b90cb(_0x38181a[_0xb0ae('0x12')][_0xb0ae('0x14')]);}logger[_0xb0ae('0x12')](_0xb0ae('0xd'),_0x7970c5,_0x38181a[_0xb0ae('0x12')][_0xb0ae('0x14')]);return _0x4a215d(_0x38181a['error'][_0xb0ae('0x14')]);}else{logger[_0xb0ae('0xc')]('FaxAccount,\x20%s,\x20%s',_0x7970c5,'request\x20sent');_0x4a215d(_0x38181a[_0xb0ae('0x15')]['message']);}})[_0xb0ae('0x16')](function(_0x4283ba){logger[_0xb0ae('0x12')]('FaxAccount,\x20%s,\x20%s',_0x7970c5,_0x4283ba);_0x4b90cb(_0x4283ba);});});}exports[_0xb0ae('0x17')]=function(_0x226d00){var _0x2a14f5=this;return new Promise(function(_0x4cd5da,_0x5272ce){return db[_0xb0ae('0x18')][_0xb0ae('0x19')]({'raw':_0x226d00['options']?_0x226d00[_0xb0ae('0x1a')][_0xb0ae('0x1b')]===undefined?!![]:![]:!![],'where':_0x226d00[_0xb0ae('0x1a')]?_0x226d00['options'][_0xb0ae('0x1c')]||null:null,'attributes':_0x226d00[_0xb0ae('0x1a')]?_0x226d00[_0xb0ae('0x1a')][_0xb0ae('0x1d')]||null:null,'limit':_0x226d00['options']?_0x226d00[_0xb0ae('0x1a')][_0xb0ae('0x1e')]||null:null,'include':_0x226d00['options']?_0x226d00[_0xb0ae('0x1a')]['include']?_['map'](_0x226d00['options']['include'],function(_0x59ac3f){return{'model':db[_0x59ac3f[_0xb0ae('0x1f')]],'as':_0x59ac3f['as'],'attributes':_0x59ac3f['attributes'],'include':_0x59ac3f['include']?_[_0xb0ae('0x20')](_0x59ac3f[_0xb0ae('0x21')],function(_0xc0a5d8){return{'model':db[_0xc0a5d8[_0xb0ae('0x1f')]],'as':_0xc0a5d8['as'],'attributes':_0xc0a5d8[_0xb0ae('0x1d')],'include':_0xc0a5d8['include']?_[_0xb0ae('0x20')](_0xc0a5d8[_0xb0ae('0x21')],function(_0x34520a){return{'model':db[_0x34520a[_0xb0ae('0x1f')]],'as':_0x34520a['as'],'attributes':_0x34520a[_0xb0ae('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb0ae('0x22')](function(_0x4f806b){logger[_0xb0ae('0xc')]('GetFaxAccount',_0x226d00);logger[_0xb0ae('0xf')](_0xb0ae('0x17'),_0x226d00,JSON[_0xb0ae('0x11')](_0x4f806b));_0x4cd5da(_0x4f806b);})[_0xb0ae('0x16')](function(_0x20f007){logger[_0xb0ae('0x12')]('GetFaxAccount',_0x20f007[_0xb0ae('0x14')],_0x226d00);_0x5272ce(_0x2a14f5[_0xb0ae('0x12')](0x1f4,_0x20f007[_0xb0ae('0x14')]));});});};exports[_0xb0ae('0x23')]=function(_0x678773,_0x162166,_0x460ae4){var _0x5dae8f=this;return new Promise(function(_0x1cf727,_0x33360c){var _0xf4765={'body':_0x678773[_0xb0ae('0x24')],'channel':'fax'};var _0x2475ca=[];var _0x5e1892=[];var _0x411491={};return db[_0xb0ae('0x25')][_0xb0ae('0x26')]()[_0xb0ae('0x22')](function(_0x6b12db){if(!_0x6b12db){throw new db[(_0xb0ae('0x27'))][(_0xb0ae('0x28'))]('no\x20available\x20attributes');}_0x2475ca=_[_0xb0ae('0x29')](_['keys'](_0x6b12db),[_0xb0ae('0x2a'),_0xb0ae('0x2b')]);_0x5e1892=_['difference'](_[_0xb0ae('0x2c')](_0x6b12db),[_0xb0ae('0x2a'),_0xb0ae('0x2b'),_0xb0ae('0x2d'),_0xb0ae('0x2e')]);if(_0x678773['body']['id']){delete _0x678773[_0xb0ae('0x24')]['id'];}if(_[_0xb0ae('0x2f')](_0x678773[_0xb0ae('0x24')][_0xb0ae('0x30')])){throw new db[(_0xb0ae('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xb0ae('0x2f')](_0x678773[_0xb0ae('0x24')][_0xb0ae('0x24')])||_0x678773[_0xb0ae('0x24')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb0ae('0x2f')](_0x678773[_0xb0ae('0x24')][_0xb0ae('0x31')])){throw new db['Sequelize'][(_0xb0ae('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5e1892);}if(!_[_0xb0ae('0x32')](_0x5e1892,_0x678773[_0xb0ae('0x24')][_0xb0ae('0x31')])){throw new db[(_0xb0ae('0x27'))]['ValidationError'](_0xb0ae('0x33')+_0x5e1892);}_0x411491[_0x678773[_0xb0ae('0x24')][_0xb0ae('0x31')]]=_0x678773[_0xb0ae('0x24')][_0xb0ae('0x30')];})[_0xb0ae('0x22')](function(){return db[_0xb0ae('0x18')][_0xb0ae('0x34')]({'where':{'id':_0x678773[_0xb0ae('0x35')]['id']},'include':[{'model':db[_0xb0ae('0x36')],'as':_0xb0ae('0x37'),'include':[{'model':db['CmContact'],'as':_0xb0ae('0x38'),'where':_0x411491,'limit':0x1,'order':[[_0xb0ae('0x2b'),_0xb0ae('0x39')]]}]},{'model':db[_0xb0ae('0x3a')],'as':_0xb0ae('0x3b')}]});})['then'](function(_0x251b19){if(_0x251b19&&_0x251b19[_0xb0ae('0x37')]){var _0x877709=_0x251b19[_0xb0ae('0x3c')]({'plain':!![]});_0xf4765[_0xb0ae('0x35')]=_0x877709;_0xf4765[_0xb0ae('0x3d')]=_0x877709['Applications'];_0xf4765[_0xb0ae('0x3e')]=_0x877709['List'];_0xf4765['applications']=_[_0xb0ae('0x3f')](_0xf4765['applications'],[_0xb0ae('0x40')],[_0xb0ae('0x41')]);if(_0xf4765[_0xb0ae('0x35')][_0xb0ae('0x3b')]){delete _0xf4765['account']['Applications'];}if(_0xf4765[_0xb0ae('0x35')][_0xb0ae('0x37')]&&_0xf4765[_0xb0ae('0x35')][_0xb0ae('0x37')][_0xb0ae('0x38')][_0xb0ae('0x42')]){return _0xf4765['account'][_0xb0ae('0x37')][_0xb0ae('0x38')][0x0];}var _0x1f24ae=_['defaults'](_0x678773['body'],{'firstName':_0x678773['body'][_0xb0ae('0x30')],'ListId':_0x877709[_0xb0ae('0x2e')]});_0x1f24ae[_0x678773[_0xb0ae('0x24')][_0xb0ae('0x31')]]=_0x678773[_0xb0ae('0x24')]['from'];return db[_0xb0ae('0x25')][_0xb0ae('0x43')](_0x1f24ae,{'fields':_0x2475ca,'raw':!![]});}})['then'](function(_0x3edb18){_0xf4765[_0xb0ae('0x44')]=_0x3edb18;if(_0x3edb18){var _0x11661e={'ContactId':_0x3edb18['id'],'FaxAccountId':_0x678773[_0xb0ae('0x35')]['id'],'fax':_0x3edb18[_0xb0ae('0x45')]};return db[_0xb0ae('0x46')][_0xb0ae('0x34')]({'where':{'ContactId':_0x3edb18['id'],'closed':![],'FaxAccountId':_0x678773['account']['id']}})['then'](function(_0x212149){if(_0x212149){return[_0x212149,![]];}return db[_0xb0ae('0x46')][_0xb0ae('0x43')](_0x11661e)[_0xb0ae('0x22')](function(_0x36ef17){return[_0x36ef17,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb0ae('0x47')](function(_0x45bf38,_0x5a0c5d){var _0x81c314=_0x45bf38[_0xb0ae('0x3c')]({'plain':!![]});if(_0x5a0c5d){if(_0xf4765[_0xb0ae('0x35')][_0xb0ae('0x48')]){_0xf4765['applications'][_0xb0ae('0x49')]({'id':0x0,'priority':_0xf4765[_0xb0ae('0x3d')][_0xb0ae('0x42')]+0x1,'app':_0xb0ae('0x4a'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x81c314[_0xb0ae('0x4b')]=!![];}else{_0x81c314[_0xb0ae('0x4b')]=![];}_0xf4765['interaction']=_0x81c314;return db['FaxMessage'][_0xb0ae('0x43')]({'body':_0x678773[_0xb0ae('0x24')]['body'],'FaxAccountId':_0x678773[_0xb0ae('0x35')]['id'],'FaxInteractionId':_0x45bf38['id'],'direction':'in','ContactId':_0x45bf38[_0xb0ae('0x4c')],'AttachmentId':_0x678773[_0xb0ae('0x24')][_0xb0ae('0x4d')]});})[_0xb0ae('0x22')](function(_0x1dc2d5){_0xf4765[_0xb0ae('0x14')]=_0x1dc2d5;if(_0xf4765[_0xb0ae('0x4e')][_0xb0ae('0x4f')]){return db[_0xb0ae('0x50')]['find']({'attributes':['id',_0xb0ae('0x51')],'where':{'id':_0xf4765[_0xb0ae('0x4e')][_0xb0ae('0x4f')]}})[_0xb0ae('0x22')](function(_0x5d3dd9){if(_0x5d3dd9){_0xf4765[_0xb0ae('0x3d')][_0xb0ae('0x52')]({'id':0x0,'priority':0x0,'app':_0xb0ae('0x53'),'appdata':_0x5d3dd9['name']+','+(_0xf4765[_0xb0ae('0x35')][_0xb0ae('0x54')]||0xa),'interval':_0xb0ae('0x55')});}return respondWithRpcPromise(_0xb0ae('0x56'),_0xb0ae('0x57'),_0xf4765);});}return respondWithRpcPromise(_0xb0ae('0x56'),_0xb0ae('0x57'),_0xf4765);})[_0xb0ae('0x22')](function(_0x52b41c){_0x1cf727(_0x52b41c);})[_0xb0ae('0x16')](function(_0x42f446){_0x33360c(_0x5dae8f[_0xb0ae('0x12')](0x1f4,_0x42f446[_0xb0ae('0x14')]));});});}; \ No newline at end of file +var _0x99d0=['orderBy','priority','length','ListId','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','created','interaction','ContactId','AttachmentId','UserId','User','unshift','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','List'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x99d0,0x1e4));var _0x099d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x99d0[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x099d('0x0'));var BPromise=require(_0x099d('0x1'));var rs=require(_0x099d('0x2'));var fs=require('fs');var Redis=require(_0x099d('0x3'));var db=require(_0x099d('0x4'))['db'];var utils=require(_0x099d('0x5'));var logger=require(_0x099d('0x6'))(_0x099d('0x7'));var config=require(_0x099d('0x8'));var jayson=require(_0x099d('0x9'));var client=jayson[_0x099d('0xa')][_0x099d('0xb')]({'port':0x232c});config[_0x099d('0xc')]=_[_0x099d('0xd')](config['redis'],{'host':_0x099d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x099d('0xc')]));require(_0x099d('0xf'))['register'](socket);function respondWithRpcPromise(_0x4b6c36,_0x1e6331,_0x214962){return new BPromise(function(_0x5bbf19,_0x8e22b9){return client[_0x099d('0x10')](_0x4b6c36,_0x214962)[_0x099d('0x11')](function(_0x895f1d){logger[_0x099d('0x12')](_0x099d('0x13'),_0x1e6331,'request\x20sent');logger[_0x099d('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1e6331,_0x099d('0x15'),JSON[_0x099d('0x16')](_0x895f1d));if(_0x895f1d['error']){if(_0x895f1d[_0x099d('0x17')]['code']===0x1f4){logger['error'](_0x099d('0x13'),_0x1e6331,_0x895f1d[_0x099d('0x17')]['message']);return _0x8e22b9(_0x895f1d[_0x099d('0x17')]['message']);}logger[_0x099d('0x17')]('FaxAccount,\x20%s,\x20%s',_0x1e6331,_0x895f1d[_0x099d('0x17')][_0x099d('0x18')]);return _0x5bbf19(_0x895f1d['error'][_0x099d('0x18')]);}else{logger[_0x099d('0x12')](_0x099d('0x13'),_0x1e6331,'request\x20sent');_0x5bbf19(_0x895f1d[_0x099d('0x19')][_0x099d('0x18')]);}})[_0x099d('0x1a')](function(_0x49aa20){logger[_0x099d('0x17')](_0x099d('0x13'),_0x1e6331,_0x49aa20);_0x8e22b9(_0x49aa20);});});}exports[_0x099d('0x1b')]=function(_0x28260b){var _0x201696=this;return new Promise(function(_0x42676d,_0xd5f775){return db[_0x099d('0x1c')][_0x099d('0x1d')]({'raw':_0x28260b[_0x099d('0x1e')]?_0x28260b[_0x099d('0x1e')][_0x099d('0x1f')]===undefined?!![]:![]:!![],'where':_0x28260b[_0x099d('0x1e')]?_0x28260b[_0x099d('0x1e')][_0x099d('0x20')]||null:null,'attributes':_0x28260b[_0x099d('0x1e')]?_0x28260b[_0x099d('0x1e')][_0x099d('0x21')]||null:null,'limit':_0x28260b[_0x099d('0x1e')]?_0x28260b[_0x099d('0x1e')]['limit']||null:null,'include':_0x28260b[_0x099d('0x1e')]?_0x28260b[_0x099d('0x1e')][_0x099d('0x22')]?_[_0x099d('0x23')](_0x28260b[_0x099d('0x1e')][_0x099d('0x22')],function(_0x27ecbb){return{'model':db[_0x27ecbb[_0x099d('0x24')]],'as':_0x27ecbb['as'],'attributes':_0x27ecbb['attributes'],'include':_0x27ecbb[_0x099d('0x22')]?_[_0x099d('0x23')](_0x27ecbb[_0x099d('0x22')],function(_0x357a56){return{'model':db[_0x357a56[_0x099d('0x24')]],'as':_0x357a56['as'],'attributes':_0x357a56[_0x099d('0x21')],'include':_0x357a56['include']?_[_0x099d('0x23')](_0x357a56['include'],function(_0x159758){return{'model':db[_0x159758[_0x099d('0x24')]],'as':_0x159758['as'],'attributes':_0x159758[_0x099d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x099d('0x11')](function(_0x1aa237){logger['info'](_0x099d('0x1b'),_0x28260b);logger[_0x099d('0x14')]('GetFaxAccount',_0x28260b,JSON['stringify'](_0x1aa237));_0x42676d(_0x1aa237);})[_0x099d('0x1a')](function(_0x5f5503){logger[_0x099d('0x17')](_0x099d('0x1b'),_0x5f5503['message'],_0x28260b);_0xd5f775(_0x201696[_0x099d('0x17')](0x1f4,_0x5f5503[_0x099d('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x384ee3,_0x359f03,_0x476951){var _0x1b346c=this;return new Promise(function(_0x30c155,_0x3968d3){var _0x56ff21={'body':_0x384ee3['body'],'channel':_0x099d('0x25')};var _0x12b5de=[];var _0x26e5bd=[];var _0x594048={};return db[_0x099d('0x26')][_0x099d('0x27')]()[_0x099d('0x11')](function(_0x1a818c){if(!_0x1a818c){throw new db[(_0x099d('0x28'))][(_0x099d('0x29'))](_0x099d('0x2a'));}_0x12b5de=_[_0x099d('0x2b')](_[_0x099d('0x2c')](_0x1a818c),[_0x099d('0x2d'),_0x099d('0x2e')]);_0x26e5bd=_[_0x099d('0x2b')](_[_0x099d('0x2c')](_0x1a818c),['createdAt',_0x099d('0x2e'),_0x099d('0x2f'),'ListId']);if(_0x384ee3[_0x099d('0x30')]['id']){delete _0x384ee3['body']['id'];}if(_['isNil'](_0x384ee3[_0x099d('0x30')][_0x099d('0x31')])){throw new db['Sequelize']['ValidationError'](_0x099d('0x32'));}if(_[_0x099d('0x33')](_0x384ee3[_0x099d('0x30')][_0x099d('0x30')])||_0x384ee3[_0x099d('0x30')][_0x099d('0x30')]===''){throw new db[(_0x099d('0x28'))]['ValidationError'](_0x099d('0x34'));}if(_['isNil'](_0x384ee3[_0x099d('0x30')][_0x099d('0x35')])){throw new db[(_0x099d('0x28'))]['ValidationError'](_0x099d('0x36')+_0x26e5bd);}if(!_[_0x099d('0x37')](_0x26e5bd,_0x384ee3['body'][_0x099d('0x35')])){throw new db[(_0x099d('0x28'))][(_0x099d('0x29'))](_0x099d('0x38')+_0x26e5bd);}_0x594048[_0x384ee3['body'][_0x099d('0x35')]]=_0x384ee3[_0x099d('0x30')][_0x099d('0x31')];})[_0x099d('0x11')](function(){return db['FaxAccount'][_0x099d('0x39')]({'where':{'id':_0x384ee3['account']['id']},'include':[{'model':db[_0x099d('0x3a')],'as':'List','include':[{'model':db[_0x099d('0x26')],'as':_0x099d('0x3b'),'where':_0x594048,'limit':0x1,'order':[['updatedAt',_0x099d('0x3c')]]}]},{'model':db[_0x099d('0x3d')],'as':_0x099d('0x3e')}]});})[_0x099d('0x11')](function(_0x49f313){if(_0x49f313&&_0x49f313['List']){var _0x1bfe5a=_0x49f313[_0x099d('0x3f')]({'plain':!![]});_0x56ff21[_0x099d('0x40')]=_0x1bfe5a;_0x56ff21[_0x099d('0x41')]=_0x1bfe5a[_0x099d('0x3e')];_0x56ff21[_0x099d('0x42')]=_0x1bfe5a[_0x099d('0x43')];_0x56ff21[_0x099d('0x41')]=_[_0x099d('0x44')](_0x56ff21[_0x099d('0x41')],[_0x099d('0x45')],['asc']);if(_0x56ff21[_0x099d('0x40')]['Applications']){delete _0x56ff21[_0x099d('0x40')][_0x099d('0x3e')];}if(_0x56ff21[_0x099d('0x40')]['List']&&_0x56ff21[_0x099d('0x40')]['List'][_0x099d('0x3b')][_0x099d('0x46')]){return _0x56ff21[_0x099d('0x40')][_0x099d('0x43')][_0x099d('0x3b')][0x0];}var _0x507d73=_[_0x099d('0xd')](_0x384ee3[_0x099d('0x30')],{'firstName':_0x384ee3[_0x099d('0x30')][_0x099d('0x31')],'ListId':_0x1bfe5a[_0x099d('0x47')]});_0x507d73[_0x384ee3[_0x099d('0x30')][_0x099d('0x35')]]=_0x384ee3[_0x099d('0x30')][_0x099d('0x31')];return db[_0x099d('0x26')][_0x099d('0x48')](_0x507d73,{'fields':_0x12b5de,'raw':!![]});}})[_0x099d('0x11')](function(_0x55a89e){_0x56ff21[_0x099d('0x49')]=_0x55a89e;if(_0x55a89e){var _0x423cd5={'ContactId':_0x55a89e['id'],'FaxAccountId':_0x384ee3[_0x099d('0x40')]['id'],'fax':_0x55a89e[_0x099d('0x25')]};return db[_0x099d('0x4a')][_0x099d('0x39')]({'where':{'ContactId':_0x55a89e['id'],'closed':![],'FaxAccountId':_0x384ee3[_0x099d('0x40')]['id']}})[_0x099d('0x11')](function(_0x3c74ee){if(_0x3c74ee){return[_0x3c74ee,![]];}return db[_0x099d('0x4a')]['create'](_0x423cd5)['then'](function(_0x316e50){return[_0x316e50,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x099d('0x4b')](function(_0x8ccb27,_0xc7eb4a){var _0x540051=_0x8ccb27[_0x099d('0x3f')]({'plain':!![]});if(_0xc7eb4a){if(_0x56ff21[_0x099d('0x40')][_0x099d('0x4c')]){_0x56ff21[_0x099d('0x41')][_0x099d('0x4d')]({'id':0x0,'priority':_0x56ff21[_0x099d('0x41')]['length']+0x1,'app':_0x099d('0x4e'),'appdata':_0x099d('0x4f'),'interval':'*,*,*,*'});}_0x540051[_0x099d('0x50')]=!![];}else{_0x540051[_0x099d('0x50')]=![];}_0x56ff21[_0x099d('0x51')]=_0x540051;return db['FaxMessage']['create']({'body':_0x384ee3[_0x099d('0x30')][_0x099d('0x30')],'FaxAccountId':_0x384ee3[_0x099d('0x40')]['id'],'FaxInteractionId':_0x8ccb27['id'],'direction':'in','ContactId':_0x8ccb27[_0x099d('0x52')],'AttachmentId':_0x384ee3['body'][_0x099d('0x53')]});})[_0x099d('0x11')](function(_0x335275){_0x56ff21[_0x099d('0x18')]=_0x335275;if(_0x56ff21['interaction'][_0x099d('0x54')]){return db[_0x099d('0x55')]['find']({'attributes':['id','name'],'where':{'id':_0x56ff21[_0x099d('0x51')]['UserId']}})[_0x099d('0x11')](function(_0x1dcfe0){if(_0x1dcfe0){_0x56ff21[_0x099d('0x41')][_0x099d('0x56')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1dcfe0[_0x099d('0x57')]+','+(_0x56ff21['account'][_0x099d('0x58')]||0xa),'interval':_0x099d('0x59')});}return respondWithRpcPromise(_0x099d('0x5a'),_0x099d('0x5b'),_0x56ff21);});}return respondWithRpcPromise(_0x099d('0x5a'),_0x099d('0x5b'),_0x56ff21);})[_0x099d('0x11')](function(_0x45789a){_0x30c155(_0x45789a);})[_0x099d('0x1a')](function(_0x5a1d48){_0x3968d3(_0x1b346c[_0x099d('0x17')](0x1f4,_0x5a1d48['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 3b437aa..43caf12 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 _0xce75=['./faxAccount.events','remove','update','register','length','faxAccount:'];(function(_0x5b4c6a,_0x4923ec){var _0x2c2ec2=function(_0x2d4e72){while(--_0x2d4e72){_0x5b4c6a['push'](_0x5b4c6a['shift']());}};_0x2c2ec2(++_0x4923ec);}(_0xce75,0xae));var _0x5ce7=function(_0x572f85,_0x1b20f4){_0x572f85=_0x572f85-0x0;var _0x387fc8=_0xce75[_0x572f85];return _0x387fc8;};'use strict';var FaxAccountEvents=require(_0x5ce7('0x0'));var events=['save',_0x5ce7('0x1'),_0x5ce7('0x2')];function createListener(_0x1ce944,_0x3ed88c){return function(_0xf092b6){_0x3ed88c['emit'](_0x1ce944,_0xf092b6);};}function removeListener(_0x5284cc,_0x4d16d8){return function(){FaxAccountEvents['removeListener'](_0x5284cc,_0x4d16d8);};}exports[_0x5ce7('0x3')]=function(_0x3bae3b){for(var _0x49cd79=0x0,_0x4973ee=events[_0x5ce7('0x4')];_0x49cd79<_0x4973ee;_0x49cd79++){var _0x3699ed=events[_0x49cd79];var _0x404f81=createListener(_0x5ce7('0x5')+_0x3699ed,_0x3bae3b);FaxAccountEvents['on'](_0x3699ed,_0x404f81);}}; \ No newline at end of file +var _0xd693=['update','register','length','faxAccount:','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd693,0x19c));var _0x3d69=function(_0x2d8d86,_0x16e75d){_0x2d8d86=_0x2d8d86-0x0;var _0x4d91a4=_0xd693[_0x2d8d86];return _0x4d91a4;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x3d69('0x0'),_0x3d69('0x1'),_0x3d69('0x2')];function createListener(_0x1a973d,_0x191f12){return function(_0x292b06){_0x191f12['emit'](_0x1a973d,_0x292b06);};}function removeListener(_0x41cef9,_0x5d1857){return function(){FaxAccountEvents['removeListener'](_0x41cef9,_0x5d1857);};}exports[_0x3d69('0x3')]=function(_0x13d417){for(var _0x50c93d=0x0,_0x23f956=events[_0x3d69('0x4')];_0x50c93d<_0x23f956;_0x50c93d++){var _0x2c55b1=events[_0x50c93d];var _0x2ff2c1=createListener(_0x3d69('0x5')+_0x2c55b1,_0x13d417);FaxAccountEvents['on'](_0x2c55b1,_0x2ff2c1);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 285ebcc..cab2d60 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(_0x532172,_0x171a9c){var _0x3c33d4=function(_0x5594a2){while(--_0x5594a2){_0x532172['push'](_0x532172['shift']());}};_0x3c33d4(++_0x171a9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x59947d,_0x27ad58){var _0x4b59e0=function(_0x3f996a){while(--_0x3f996a){_0x59947d['push'](_0x59947d['shift']());}};_0x4b59e0(++_0x27ad58);}(_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['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 dd1f972..90c3be1 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 _0xc0e9=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x50a864,_0x3303e2){var _0x2fb82f=function(_0x2dc650){while(--_0x2dc650){_0x50a864['push'](_0x50a864['shift']());}};_0x2fb82f(++_0x3303e2);}(_0xc0e9,0x69));var _0x9c0e=function(_0x45dc2d,_0x52062f){_0x45dc2d=_0x45dc2d-0x0;var _0xcd71f5=_0xc0e9[_0x45dc2d];return _0xcd71f5;};'use strict';var Sequelize=require('sequelize');module[_0x9c0e('0x0')]={'priority':{'type':Sequelize[_0x9c0e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9c0e('0x2')],'allowNull':![],'defaultValue':_0x9c0e('0x3')},'appdata':{'type':Sequelize[_0x9c0e('0x4')]()},'description':{'type':Sequelize[_0x9c0e('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9c0e('0x5')}}; \ No newline at end of file +var _0x4f18=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0x528d90,_0x5c9e09){var _0x47ea4f=function(_0x204698){while(--_0x204698){_0x528d90['push'](_0x528d90['shift']());}};_0x47ea4f(++_0x5c9e09);}(_0x4f18,0x86));var _0x84f1=function(_0x45b127,_0x10a86b){_0x45b127=_0x45b127-0x0;var _0x201e64=_0x4f18[_0x45b127];return _0x201e64;};'use strict';var Sequelize=require(_0x84f1('0x0'));module[_0x84f1('0x1')]={'priority':{'type':Sequelize[_0x84f1('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x84f1('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x84f1('0x4')]},'interval':{'type':Sequelize[_0x84f1('0x4')],'defaultValue':_0x84f1('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 01ee910..006d4fd 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 _0x1adf=['catch','show','rawAttributes','intersection','length','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','update','then','destroy','error','stack','name','send','map','FaxApplication','fieldName','type','key','model','query','keys','fields','attributes','hasOwnProperty','order','sort','filters','pick','where','merge','options','includeAll','include','findAll','rows'];(function(_0x37575e,_0x9a0e5c){var _0x4aa148=function(_0xfa3cbf){while(--_0xfa3cbf){_0x37575e['push'](_0x37575e['shift']());}};_0x4aa148(++_0x9a0e5c);}(_0x1adf,0x16c));var _0xf1ad=function(_0x559a98,_0x28c39b){_0x559a98=_0x559a98-0x0;var _0x22810a=_0x1adf[_0x559a98];return _0x22810a;};'use strict';var emlformat=require(_0xf1ad('0x0'));var rimraf=require(_0xf1ad('0x1'));var zipdir=require(_0xf1ad('0x2'));var jsonpatch=require(_0xf1ad('0x3'));var rp=require(_0xf1ad('0x4'));var moment=require(_0xf1ad('0x5'));var BPromise=require(_0xf1ad('0x6'));var Mustache=require(_0xf1ad('0x7'));var util=require('util');var path=require(_0xf1ad('0x8'));var sox=require(_0xf1ad('0x9'));var csv=require(_0xf1ad('0xa'));var ejs=require(_0xf1ad('0xb'));var fs=require('fs');var fs_extra=require(_0xf1ad('0xc'));var _=require(_0xf1ad('0xd'));var squel=require('squel');var crypto=require(_0xf1ad('0xe'));var jsforce=require(_0xf1ad('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf1ad('0xa'));var querystring=require(_0xf1ad('0x10'));var Papa=require(_0xf1ad('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf1ad('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1ad('0x13'));var logger=require('../../config/logger')(_0xf1ad('0x14'));var utils=require(_0xf1ad('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf1ad('0x16'));var db=require(_0xf1ad('0x17'))['db'];function respondWithStatusCode(_0x57b1bc,_0x333670){_0x333670=_0x333670||0xcc;return function(_0x3ad85e){if(_0x3ad85e){return _0x57b1bc['sendStatus'](_0x333670);}return _0x57b1bc[_0xf1ad('0x18')](_0x333670)[_0xf1ad('0x19')]();};}function respondWithResult(_0x413d6f,_0xa0e826){_0xa0e826=_0xa0e826||0xc8;return function(_0x17b9d5){if(_0x17b9d5){return _0x413d6f[_0xf1ad('0x18')](_0xa0e826)[_0xf1ad('0x1a')](_0x17b9d5);}};}function respondWithFilteredResult(_0x5939c2,_0xf50493){return function(_0x26bfb8){if(_0x26bfb8){var _0x10cb92=typeof _0xf50493['offset']==='undefined'&&typeof _0xf50493[_0xf1ad('0x1b')]===_0xf1ad('0x1c');var _0x295125=_0x26bfb8[_0xf1ad('0x1d')];var _0x14751d=_0x10cb92?0x0:_0xf50493[_0xf1ad('0x1e')];var _0x4bc0f6=_0x10cb92?_0x26bfb8[_0xf1ad('0x1d')]:_0xf50493[_0xf1ad('0x1e')]+_0xf50493[_0xf1ad('0x1b')];var _0x1ee5ad;if(_0x4bc0f6>=_0x295125){_0x4bc0f6=_0x295125;_0x1ee5ad=0xc8;}else{_0x1ee5ad=0xce;}_0x5939c2['status'](_0x1ee5ad);return _0x5939c2[_0xf1ad('0x1f')]('Content-Range',_0x14751d+'-'+_0x4bc0f6+'/'+_0x295125)[_0xf1ad('0x1a')](_0x26bfb8);}return null;};}function patchUpdates(_0x1e3358){return function(_0xc08a39){try{jsonpatch[_0xf1ad('0x20')](_0xc08a39,_0x1e3358,!![]);}catch(_0x4406b4){return BPromise['reject'](_0x4406b4);}return _0xc08a39['save']();};}function saveUpdates(_0x6f345f,_0x6bae8b){return function(_0x48f276){if(_0x48f276){return _0x48f276[_0xf1ad('0x21')](_0x6f345f)[_0xf1ad('0x22')](function(_0x19ffa6){return _0x19ffa6;});}return null;};}function removeEntity(_0x1ab65e,_0x2273d8){return function(_0x78df5d){if(_0x78df5d){return _0x78df5d[_0xf1ad('0x23')]()['then'](function(){_0x1ab65e['status'](0xcc)[_0xf1ad('0x19')]();});}};}function handleEntityNotFound(_0x3f8f07,_0x2de89d){return function(_0x4fd9fd){if(!_0x4fd9fd){_0x3f8f07['sendStatus'](0x194);}return _0x4fd9fd;};}function handleError(_0x24131f,_0x4a6b3b){_0x4a6b3b=_0x4a6b3b||0x1f4;return function(_0x868f2e){logger[_0xf1ad('0x24')](_0x868f2e[_0xf1ad('0x25')]);if(_0x868f2e[_0xf1ad('0x26')]){delete _0x868f2e[_0xf1ad('0x26')];}_0x24131f[_0xf1ad('0x18')](_0x4a6b3b)[_0xf1ad('0x27')](_0x868f2e);};}exports['index']=function(_0xfdd6df,_0x426231){var _0x1b3829={},_0x4f92f2={},_0xa793e={'count':0x0,'rows':[]};var _0x325dbb=_[_0xf1ad('0x28')](db[_0xf1ad('0x29')]['rawAttributes'],function(_0x4090c7){return{'name':_0x4090c7[_0xf1ad('0x2a')],'type':_0x4090c7[_0xf1ad('0x2b')][_0xf1ad('0x2c')]};});_0x4f92f2[_0xf1ad('0x2d')]=_[_0xf1ad('0x28')](_0x325dbb,'name');_0x4f92f2[_0xf1ad('0x2e')]=_[_0xf1ad('0x2f')](_0xfdd6df[_0xf1ad('0x2e')]);_0x4f92f2['filters']=_['intersection'](_0x4f92f2[_0xf1ad('0x2d')],_0x4f92f2[_0xf1ad('0x2e')]);_0x1b3829['attributes']=_['intersection'](_0x4f92f2['model'],qs[_0xf1ad('0x30')](_0xfdd6df[_0xf1ad('0x2e')][_0xf1ad('0x30')]));_0x1b3829[_0xf1ad('0x31')]=_0x1b3829[_0xf1ad('0x31')]['length']?_0x1b3829[_0xf1ad('0x31')]:_0x4f92f2[_0xf1ad('0x2d')];if(!_0xfdd6df['query'][_0xf1ad('0x32')]('nolimit')){_0x1b3829[_0xf1ad('0x1b')]=qs[_0xf1ad('0x1b')](_0xfdd6df[_0xf1ad('0x2e')][_0xf1ad('0x1b')]);_0x1b3829['offset']=qs[_0xf1ad('0x1e')](_0xfdd6df[_0xf1ad('0x2e')]['offset']);}_0x1b3829[_0xf1ad('0x33')]=qs[_0xf1ad('0x34')](_0xfdd6df[_0xf1ad('0x2e')][_0xf1ad('0x34')]);_0x1b3829['where']=qs[_0xf1ad('0x35')](_[_0xf1ad('0x36')](_0xfdd6df[_0xf1ad('0x2e')],_0x4f92f2['filters']),_0x325dbb);if(_0xfdd6df[_0xf1ad('0x2e')]['filter']){_0x1b3829[_0xf1ad('0x37')]=_[_0xf1ad('0x38')](_0x1b3829[_0xf1ad('0x37')],{'$or':_['map'](_0x325dbb,function(_0x45aee7){if(_0x45aee7['type']!=='VIRTUAL'){var _0x148878={};_0x148878[_0x45aee7[_0xf1ad('0x26')]]={'$like':'%'+_0xfdd6df[_0xf1ad('0x2e')]['filter']+'%'};return _0x148878;}})});}_0x1b3829=_[_0xf1ad('0x38')]({},_0x1b3829,_0xfdd6df[_0xf1ad('0x39')]);var _0x748097={'where':_0x1b3829[_0xf1ad('0x37')]};return db[_0xf1ad('0x29')][_0xf1ad('0x1d')](_0x748097)[_0xf1ad('0x22')](function(_0x570afd){_0xa793e[_0xf1ad('0x1d')]=_0x570afd;if(_0xfdd6df[_0xf1ad('0x2e')][_0xf1ad('0x3a')]){_0x1b3829[_0xf1ad('0x3b')]=[{'all':!![]}];}return db['FaxApplication'][_0xf1ad('0x3c')](_0x1b3829);})['then'](function(_0xf74bb5){_0xa793e[_0xf1ad('0x3d')]=_0xf74bb5;return _0xa793e;})[_0xf1ad('0x22')](respondWithFilteredResult(_0x426231,_0x1b3829))[_0xf1ad('0x3e')](handleError(_0x426231,null));};exports[_0xf1ad('0x3f')]=function(_0x309f68,_0x21d4f0){var _0x2b2342={'raw':!![],'where':{'id':_0x309f68['params']['id']}},_0x233c46={};_0x233c46[_0xf1ad('0x2d')]=_[_0xf1ad('0x2f')](db['FaxApplication'][_0xf1ad('0x40')]);_0x233c46['query']=_[_0xf1ad('0x2f')](_0x309f68['query']);_0x233c46[_0xf1ad('0x35')]=_[_0xf1ad('0x41')](_0x233c46[_0xf1ad('0x2d')],_0x233c46[_0xf1ad('0x2e')]);_0x2b2342['attributes']=_[_0xf1ad('0x41')](_0x233c46[_0xf1ad('0x2d')],qs[_0xf1ad('0x30')](_0x309f68[_0xf1ad('0x2e')]['fields']));_0x2b2342[_0xf1ad('0x31')]=_0x2b2342[_0xf1ad('0x31')][_0xf1ad('0x42')]?_0x2b2342[_0xf1ad('0x31')]:_0x233c46[_0xf1ad('0x2d')];if(_0x309f68[_0xf1ad('0x2e')][_0xf1ad('0x3a')]){_0x2b2342[_0xf1ad('0x3b')]=[{'all':!![]}];}_0x2b2342=_[_0xf1ad('0x38')]({},_0x2b2342,_0x309f68[_0xf1ad('0x39')]);return db[_0xf1ad('0x29')][_0xf1ad('0x43')](_0x2b2342)['then'](handleEntityNotFound(_0x21d4f0,null))[_0xf1ad('0x22')](respondWithResult(_0x21d4f0,null))[_0xf1ad('0x3e')](handleError(_0x21d4f0,null));};exports[_0xf1ad('0x44')]=function(_0x143023,_0x322c4a){return db[_0xf1ad('0x29')][_0xf1ad('0x44')](_0x143023['body'],{})[_0xf1ad('0x22')](respondWithResult(_0x322c4a,0xc9))[_0xf1ad('0x3e')](handleError(_0x322c4a,null));};exports[_0xf1ad('0x21')]=function(_0x547e53,_0x5ad388){if(_0x547e53[_0xf1ad('0x45')]['id']){delete _0x547e53['body']['id'];}return db[_0xf1ad('0x29')][_0xf1ad('0x43')]({'where':{'id':_0x547e53[_0xf1ad('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ad388,null))[_0xf1ad('0x22')](saveUpdates(_0x547e53[_0xf1ad('0x45')],null))['then'](respondWithResult(_0x5ad388,null))[_0xf1ad('0x3e')](handleError(_0x5ad388,null));};exports[_0xf1ad('0x23')]=function(_0x159152,_0x4193a8){return db[_0xf1ad('0x29')][_0xf1ad('0x43')]({'where':{'id':_0x159152[_0xf1ad('0x46')]['id']}})[_0xf1ad('0x22')](handleEntityNotFound(_0x4193a8,null))[_0xf1ad('0x22')](removeEntity(_0x4193a8,null))[_0xf1ad('0x3e')](handleError(_0x4193a8,null));}; \ No newline at end of file +var _0x5a14=['save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','Content-Range','apply','reject'];(function(_0x528353,_0x3ec997){var _0x586fc8=function(_0x20ed92){while(--_0x20ed92){_0x528353['push'](_0x528353['shift']());}};_0x586fc8(++_0x3ec997);}(_0x5a14,0x155));var _0x45a1=function(_0x1aff60,_0x29256d){_0x1aff60=_0x1aff60-0x0;var _0x14e3c0=_0x5a14[_0x1aff60];return _0x14e3c0;};'use strict';var emlformat=require(_0x45a1('0x0'));var rimraf=require(_0x45a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x45a1('0x2'));var moment=require(_0x45a1('0x3'));var BPromise=require(_0x45a1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x45a1('0x5'));var sox=require(_0x45a1('0x6'));var csv=require(_0x45a1('0x7'));var ejs=require(_0x45a1('0x8'));var fs=require('fs');var fs_extra=require(_0x45a1('0x9'));var _=require(_0x45a1('0xa'));var squel=require(_0x45a1('0xb'));var crypto=require('crypto');var jsforce=require(_0x45a1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x45a1('0x7'));var querystring=require(_0x45a1('0xd'));var Papa=require(_0x45a1('0xe'));var Redis=require(_0x45a1('0xf'));var authService=require(_0x45a1('0x10'));var qs=require(_0x45a1('0x11'));var as=require(_0x45a1('0x12'));var hardwareService=require(_0x45a1('0x13'));var logger=require(_0x45a1('0x14'))(_0x45a1('0x15'));var utils=require(_0x45a1('0x16'));var config=require(_0x45a1('0x17'));var licenseUtil=require(_0x45a1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ef0c4,_0x3f979e){_0x3f979e=_0x3f979e||0xcc;return function(_0x5d30db){if(_0x5d30db){return _0x5ef0c4['sendStatus'](_0x3f979e);}return _0x5ef0c4[_0x45a1('0x19')](_0x3f979e)[_0x45a1('0x1a')]();};}function respondWithResult(_0x320d11,_0x26b0c7){_0x26b0c7=_0x26b0c7||0xc8;return function(_0x259678){if(_0x259678){return _0x320d11['status'](_0x26b0c7)['json'](_0x259678);}};}function respondWithFilteredResult(_0xf91ddd,_0x2a70be){return function(_0x591b55){if(_0x591b55){var _0x7a7553=typeof _0x2a70be[_0x45a1('0x1b')]==='undefined'&&typeof _0x2a70be['limit']===_0x45a1('0x1c');var _0x2d238a=_0x591b55[_0x45a1('0x1d')];var _0x39aa30=_0x7a7553?0x0:_0x2a70be['offset'];var _0x2e0ec6=_0x7a7553?_0x591b55[_0x45a1('0x1d')]:_0x2a70be[_0x45a1('0x1b')]+_0x2a70be['limit'];var _0x458966;if(_0x2e0ec6>=_0x2d238a){_0x2e0ec6=_0x2d238a;_0x458966=0xc8;}else{_0x458966=0xce;}_0xf91ddd[_0x45a1('0x19')](_0x458966);return _0xf91ddd[_0x45a1('0x1e')](_0x45a1('0x1f'),_0x39aa30+'-'+_0x2e0ec6+'/'+_0x2d238a)['json'](_0x591b55);}return null;};}function patchUpdates(_0x16f778){return function(_0x22f0b9){try{jsonpatch[_0x45a1('0x20')](_0x22f0b9,_0x16f778,!![]);}catch(_0x140c9d){return BPromise[_0x45a1('0x21')](_0x140c9d);}return _0x22f0b9[_0x45a1('0x22')]();};}function saveUpdates(_0x19da3b,_0x12bae4){return function(_0x3d2bfc){if(_0x3d2bfc){return _0x3d2bfc[_0x45a1('0x23')](_0x19da3b)[_0x45a1('0x24')](function(_0x7bfd4f){return _0x7bfd4f;});}return null;};}function removeEntity(_0x27f49b,_0x96daf5){return function(_0x8d7c54){if(_0x8d7c54){return _0x8d7c54[_0x45a1('0x25')]()[_0x45a1('0x24')](function(){_0x27f49b['status'](0xcc)[_0x45a1('0x1a')]();});}};}function handleEntityNotFound(_0x3bc321,_0x3f7b09){return function(_0x5f37c7){if(!_0x5f37c7){_0x3bc321[_0x45a1('0x26')](0x194);}return _0x5f37c7;};}function handleError(_0x2ebffb,_0x266dc7){_0x266dc7=_0x266dc7||0x1f4;return function(_0x2c1104){logger[_0x45a1('0x27')](_0x2c1104[_0x45a1('0x28')]);if(_0x2c1104[_0x45a1('0x29')]){delete _0x2c1104[_0x45a1('0x29')];}_0x2ebffb[_0x45a1('0x19')](_0x266dc7)[_0x45a1('0x2a')](_0x2c1104);};}exports[_0x45a1('0x2b')]=function(_0x45ce6f,_0x4dd8f7){var _0x877d59={},_0x52cb16={},_0x4d6682={'count':0x0,'rows':[]};var _0x548516=_[_0x45a1('0x2c')](db[_0x45a1('0x2d')][_0x45a1('0x2e')],function(_0x2501fe){return{'name':_0x2501fe['fieldName'],'type':_0x2501fe['type'][_0x45a1('0x2f')]};});_0x52cb16[_0x45a1('0x30')]=_[_0x45a1('0x2c')](_0x548516,'name');_0x52cb16[_0x45a1('0x31')]=_[_0x45a1('0x32')](_0x45ce6f['query']);_0x52cb16[_0x45a1('0x33')]=_[_0x45a1('0x34')](_0x52cb16['model'],_0x52cb16[_0x45a1('0x31')]);_0x877d59[_0x45a1('0x35')]=_[_0x45a1('0x34')](_0x52cb16['model'],qs[_0x45a1('0x36')](_0x45ce6f['query'][_0x45a1('0x36')]));_0x877d59[_0x45a1('0x35')]=_0x877d59[_0x45a1('0x35')][_0x45a1('0x37')]?_0x877d59[_0x45a1('0x35')]:_0x52cb16[_0x45a1('0x30')];if(!_0x45ce6f[_0x45a1('0x31')]['hasOwnProperty']('nolimit')){_0x877d59[_0x45a1('0x38')]=qs[_0x45a1('0x38')](_0x45ce6f[_0x45a1('0x31')][_0x45a1('0x38')]);_0x877d59['offset']=qs['offset'](_0x45ce6f['query'][_0x45a1('0x1b')]);}_0x877d59[_0x45a1('0x39')]=qs[_0x45a1('0x3a')](_0x45ce6f[_0x45a1('0x31')][_0x45a1('0x3a')]);_0x877d59['where']=qs['filters'](_['pick'](_0x45ce6f[_0x45a1('0x31')],_0x52cb16[_0x45a1('0x33')]),_0x548516);if(_0x45ce6f[_0x45a1('0x31')][_0x45a1('0x3b')]){_0x877d59[_0x45a1('0x3c')]=_[_0x45a1('0x3d')](_0x877d59[_0x45a1('0x3c')],{'$or':_[_0x45a1('0x2c')](_0x548516,function(_0x18edf2){if(_0x18edf2[_0x45a1('0x3e')]!==_0x45a1('0x3f')){var _0x3f05cc={};_0x3f05cc[_0x18edf2[_0x45a1('0x29')]]={'$like':'%'+_0x45ce6f['query'][_0x45a1('0x3b')]+'%'};return _0x3f05cc;}})});}_0x877d59=_[_0x45a1('0x3d')]({},_0x877d59,_0x45ce6f[_0x45a1('0x40')]);var _0x29ffb9={'where':_0x877d59[_0x45a1('0x3c')]};return db[_0x45a1('0x2d')]['count'](_0x29ffb9)[_0x45a1('0x24')](function(_0x3b382a){_0x4d6682[_0x45a1('0x1d')]=_0x3b382a;if(_0x45ce6f[_0x45a1('0x31')][_0x45a1('0x41')]){_0x877d59[_0x45a1('0x42')]=[{'all':!![]}];}return db[_0x45a1('0x2d')][_0x45a1('0x43')](_0x877d59);})[_0x45a1('0x24')](function(_0x5cca25){_0x4d6682[_0x45a1('0x44')]=_0x5cca25;return _0x4d6682;})[_0x45a1('0x24')](respondWithFilteredResult(_0x4dd8f7,_0x877d59))[_0x45a1('0x45')](handleError(_0x4dd8f7,null));};exports[_0x45a1('0x46')]=function(_0xfe4568,_0x2b370c){var _0x4c4cf2={'raw':!![],'where':{'id':_0xfe4568['params']['id']}},_0x5058f3={};_0x5058f3[_0x45a1('0x30')]=_[_0x45a1('0x32')](db[_0x45a1('0x2d')][_0x45a1('0x2e')]);_0x5058f3['query']=_[_0x45a1('0x32')](_0xfe4568[_0x45a1('0x31')]);_0x5058f3[_0x45a1('0x33')]=_['intersection'](_0x5058f3[_0x45a1('0x30')],_0x5058f3[_0x45a1('0x31')]);_0x4c4cf2[_0x45a1('0x35')]=_[_0x45a1('0x34')](_0x5058f3[_0x45a1('0x30')],qs[_0x45a1('0x36')](_0xfe4568[_0x45a1('0x31')][_0x45a1('0x36')]));_0x4c4cf2['attributes']=_0x4c4cf2[_0x45a1('0x35')]['length']?_0x4c4cf2[_0x45a1('0x35')]:_0x5058f3[_0x45a1('0x30')];if(_0xfe4568[_0x45a1('0x31')][_0x45a1('0x41')]){_0x4c4cf2[_0x45a1('0x42')]=[{'all':!![]}];}_0x4c4cf2=_['merge']({},_0x4c4cf2,_0xfe4568['options']);return db[_0x45a1('0x2d')][_0x45a1('0x47')](_0x4c4cf2)['then'](handleEntityNotFound(_0x2b370c,null))[_0x45a1('0x24')](respondWithResult(_0x2b370c,null))[_0x45a1('0x45')](handleError(_0x2b370c,null));};exports[_0x45a1('0x48')]=function(_0x1ab65b,_0x1b650f){return db[_0x45a1('0x2d')][_0x45a1('0x48')](_0x1ab65b['body'],{})['then'](respondWithResult(_0x1b650f,0xc9))[_0x45a1('0x45')](handleError(_0x1b650f,null));};exports[_0x45a1('0x23')]=function(_0x17bcd9,_0x5b2c57){if(_0x17bcd9[_0x45a1('0x49')]['id']){delete _0x17bcd9[_0x45a1('0x49')]['id'];}return db[_0x45a1('0x2d')][_0x45a1('0x47')]({'where':{'id':_0x17bcd9[_0x45a1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b2c57,null))['then'](saveUpdates(_0x17bcd9[_0x45a1('0x49')],null))[_0x45a1('0x24')](respondWithResult(_0x5b2c57,null))[_0x45a1('0x45')](handleError(_0x5b2c57,null));};exports[_0x45a1('0x25')]=function(_0x357569,_0x162073){return db['FaxApplication'][_0x45a1('0x47')]({'where':{'id':_0x357569[_0x45a1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x162073,null))[_0x45a1('0x24')](removeEntity(_0x162073,null))[_0x45a1('0x45')](handleError(_0x162073,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 5ac39a1..721caa8 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 _0x8130=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x8130,0x162));var _0x0813=function(_0x5db8f1,_0x5b9017){_0x5db8f1=_0x5db8f1-0x0;var _0x209ca9=_0x8130[_0x5db8f1];return _0x209ca9;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var logger=require(_0x0813('0x2'))(_0x0813('0x3'));var moment=require('moment');var BPromise=require(_0x0813('0x4'));var rp=require(_0x0813('0x5'));var fs=require('fs');var path=require(_0x0813('0x6'));var rimraf=require(_0x0813('0x7'));var config=require(_0x0813('0x8'));var attributes=require(_0x0813('0x9'));module[_0x0813('0xa')]=function(_0x559bfe,_0x3f8c0d){return _0x559bfe['define'](_0x0813('0xb'),attributes,{'tableName':_0x0813('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0813('0xd'),'collate':_0x0813('0xe')});}; \ No newline at end of file +var _0x5dd1=['../../config/environment','./faxApplication.attributes','exports','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x276413,_0x2c8e7a){var _0xff711d=function(_0x1babaf){while(--_0x1babaf){_0x276413['push'](_0x276413['shift']());}};_0xff711d(++_0x2c8e7a);}(_0x5dd1,0x1b7));var _0x15dd=function(_0x2a403a,_0x4ec334){_0x2a403a=_0x2a403a-0x0;var _0x3a0f0d=_0x5dd1[_0x2a403a];return _0x3a0f0d;};'use strict';var _=require(_0x15dd('0x0'));var util=require(_0x15dd('0x1'));var logger=require(_0x15dd('0x2'))(_0x15dd('0x3'));var moment=require(_0x15dd('0x4'));var BPromise=require(_0x15dd('0x5'));var rp=require(_0x15dd('0x6'));var fs=require('fs');var path=require(_0x15dd('0x7'));var rimraf=require(_0x15dd('0x8'));var config=require(_0x15dd('0x9'));var attributes=require(_0x15dd('0xa'));module[_0x15dd('0xb')]=function(_0x4120d7,_0x5752d9){return _0x4120d7['define']('FaxApplication',attributes,{'tableName':_0x15dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15dd('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 8003a53..35f3173 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 _0x7331=['request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x7331,0xe3));var _0x1733=function(_0x3b2bec,_0x3780fd){_0x3b2bec=_0x3b2bec-0x0;var _0x4ef986=_0x7331[_0x3b2bec];return _0x4ef986;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1733('0x0'));var BPromise=require(_0x1733('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1733('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1733('0x3'));var logger=require(_0x1733('0x4'))(_0x1733('0x5'));var config=require(_0x1733('0x6'));var jayson=require(_0x1733('0x7'));var client=jayson[_0x1733('0x8')][_0x1733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x288880,_0x186b8a,_0x5d7c2b){return new BPromise(function(_0xfad707,_0x5c8d83){return client[_0x1733('0xa')](_0x288880,_0x5d7c2b)[_0x1733('0xb')](function(_0x10257d){logger[_0x1733('0xc')]('FaxApplication,\x20%s,\x20%s',_0x186b8a,_0x1733('0xd'));logger[_0x1733('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x186b8a,_0x1733('0xd'),JSON[_0x1733('0xf')](_0x10257d));if(_0x10257d[_0x1733('0x10')]){if(_0x10257d[_0x1733('0x10')][_0x1733('0x11')]===0x1f4){logger[_0x1733('0x10')](_0x1733('0x12'),_0x186b8a,_0x10257d[_0x1733('0x10')][_0x1733('0x13')]);return _0x5c8d83(_0x10257d[_0x1733('0x10')][_0x1733('0x13')]);}logger[_0x1733('0x10')]('FaxApplication,\x20%s,\x20%s',_0x186b8a,_0x10257d['error'][_0x1733('0x13')]);return _0xfad707(_0x10257d[_0x1733('0x10')]['message']);}else{logger[_0x1733('0xc')](_0x1733('0x12'),_0x186b8a,_0x1733('0xd'));_0xfad707(_0x10257d[_0x1733('0x14')][_0x1733('0x13')]);}})[_0x1733('0x15')](function(_0x3b8691){logger[_0x1733('0x10')](_0x1733('0x12'),_0x186b8a,_0x3b8691);_0x5c8d83(_0x3b8691);});});}exports[_0x1733('0x16')]=function(_0x49dbdf){var _0x58f073=this;return new Promise(function(_0x2942f7,_0x595f29){return db['FaxApplication'][_0x1733('0x17')](_0x49dbdf[_0x1733('0x18')],{'raw':_0x49dbdf[_0x1733('0x19')]?_0x49dbdf[_0x1733('0x19')][_0x1733('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49dbdf[_0x1733('0x19')]?_0x49dbdf[_0x1733('0x19')][_0x1733('0x1b')]||null:null,'attributes':_0x49dbdf[_0x1733('0x19')]?_0x49dbdf[_0x1733('0x19')][_0x1733('0x1c')]||null:null,'limit':_0x49dbdf[_0x1733('0x19')]?_0x49dbdf[_0x1733('0x19')][_0x1733('0x1d')]||null:null})['then'](function(_0x38e581){logger['info'](_0x1733('0x16'),_0x49dbdf);logger['debug'](_0x1733('0x16'),_0x49dbdf,JSON['stringify'](_0x38e581));_0x2942f7(_0x38e581);})[_0x1733('0x15')](function(_0xaafaf8){logger[_0x1733('0x10')](_0x1733('0x16'),_0xaafaf8[_0x1733('0x13')],_0x49dbdf);_0x595f29(_0x58f073[_0x1733('0x10')](0x1f4,_0xaafaf8[_0x1733('0x13')]));});});}; \ No newline at end of file +var _0x8627=['rpc','../../config/environment','jayson/promise','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa31594,_0x1269d1){var _0x55de32=function(_0x2c8a97){while(--_0x2c8a97){_0xa31594['push'](_0xa31594['shift']());}};_0x55de32(++_0x1269d1);}(_0x8627,0xd1));var _0x7862=function(_0x54978a,_0x3fba10){_0x54978a=_0x54978a-0x0;var _0x4d4d06=_0x8627[_0x54978a];return _0x4d4d06;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7862('0x0'));var BPromise=require(_0x7862('0x1'));var rs=require(_0x7862('0x2'));var fs=require('fs');var Redis=require(_0x7862('0x3'));var db=require(_0x7862('0x4'))['db'];var utils=require(_0x7862('0x5'));var logger=require(_0x7862('0x6'))(_0x7862('0x7'));var config=require(_0x7862('0x8'));var jayson=require(_0x7862('0x9'));var client=jayson['client'][_0x7862('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1bb8,_0x1fa876,_0x2d400d){return new BPromise(function(_0x6c1ec5,_0x1cdd31){return client['request'](_0x5f1bb8,_0x2d400d)[_0x7862('0xb')](function(_0x3a2f5a){logger['info'](_0x7862('0xc'),_0x1fa876,_0x7862('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1fa876,_0x7862('0xd'),JSON['stringify'](_0x3a2f5a));if(_0x3a2f5a[_0x7862('0xe')]){if(_0x3a2f5a[_0x7862('0xe')]['code']===0x1f4){logger['error'](_0x7862('0xc'),_0x1fa876,_0x3a2f5a[_0x7862('0xe')]['message']);return _0x1cdd31(_0x3a2f5a[_0x7862('0xe')][_0x7862('0xf')]);}logger[_0x7862('0xe')](_0x7862('0xc'),_0x1fa876,_0x3a2f5a['error'][_0x7862('0xf')]);return _0x6c1ec5(_0x3a2f5a[_0x7862('0xe')][_0x7862('0xf')]);}else{logger[_0x7862('0x10')]('FaxApplication,\x20%s,\x20%s',_0x1fa876,_0x7862('0xd'));_0x6c1ec5(_0x3a2f5a[_0x7862('0x11')][_0x7862('0xf')]);}})[_0x7862('0x12')](function(_0x2cae75){logger[_0x7862('0xe')](_0x7862('0xc'),_0x1fa876,_0x2cae75);_0x1cdd31(_0x2cae75);});});}exports[_0x7862('0x13')]=function(_0x12b3a8){var _0x57c508=this;return new Promise(function(_0x5c4ddf,_0x28bb2c){return db[_0x7862('0x14')]['update'](_0x12b3a8[_0x7862('0x15')],{'raw':_0x12b3a8[_0x7862('0x16')]?_0x12b3a8[_0x7862('0x16')][_0x7862('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12b3a8[_0x7862('0x16')]?_0x12b3a8[_0x7862('0x16')][_0x7862('0x18')]||null:null,'attributes':_0x12b3a8[_0x7862('0x16')]?_0x12b3a8[_0x7862('0x16')][_0x7862('0x19')]||null:null,'limit':_0x12b3a8[_0x7862('0x16')]?_0x12b3a8['options']['limit']||null:null})['then'](function(_0x5c9da1){logger[_0x7862('0x10')]('UpdateFaxApplication',_0x12b3a8);logger[_0x7862('0x1a')]('UpdateFaxApplication',_0x12b3a8,JSON['stringify'](_0x5c9da1));_0x5c4ddf(_0x5c9da1);})[_0x7862('0x12')](function(_0x103aaf){logger['error'](_0x7862('0x13'),_0x103aaf[_0x7862('0xf')],_0x12b3a8);_0x28bb2c(_0x57c508[_0x7862('0xe')](0x1f4,_0x103aaf[_0x7862('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 79e77dd..ea17cfe 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 _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x4ee558,_0x337827){var _0x391eb4=function(_0x1c12e9){while(--_0x1c12e9){_0x4ee558['push'](_0x4ee558['shift']());}};_0x391eb4(++_0x337827);}(_0x7916,0x128));var _0x6791=function(_0x4606f5,_0x1519aa){_0x4606f5=_0x4606f5-0x0;var _0x2594ae=_0x7916[_0x4606f5];return _0x2594ae;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file +var _0x3266=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3266,0x6a));var _0x6326=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x3266[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var fs_extra=require(_0x6326('0x6'));var auth=require(_0x6326('0x7'));var interaction=require(_0x6326('0x8'));var config=require('../../config/environment');var controller=require(_0x6326('0x9'));router['get']('/',auth[_0x6326('0xa')](),controller[_0x6326('0xb')]);router[_0x6326('0xc')]('/:id',auth[_0x6326('0xa')](),controller['show']);router[_0x6326('0xd')]('/',auth[_0x6326('0xa')](),controller[_0x6326('0xe')]);router[_0x6326('0xf')](_0x6326('0x10'),auth['isAuthenticated'](),controller[_0x6326('0x11')]);router[_0x6326('0x12')](_0x6326('0x10'),auth[_0x6326('0xa')](),controller[_0x6326('0x13')]);module[_0x6326('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 11c1b80..f0ef00d 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 _0xea7c=['BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xea7c,0xe6));var _0xcea7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xea7c[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xcea7('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcea7('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xcea7('0x1')]},'note':{'type':Sequelize[_0xcea7('0x1')]},'read1stAt':{'type':Sequelize[_0xcea7('0x2')]},'fax':{'type':Sequelize[_0xcea7('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xcea7('0x3')]('in',_0xcea7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcea7('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xcea7('0x3')]('in',_0xcea7('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xcc7d=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xcc7d,0x94));var _0xdcc7=function(_0xf2fdf0,_0x252cd3){_0xf2fdf0=_0xf2fdf0-0x0;var _0x31fae0=_0xcc7d[_0xf2fdf0];return _0x31fae0;};'use strict';var Sequelize=require('sequelize');module[_0xdcc7('0x0')]={'closed':{'type':Sequelize[_0xdcc7('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdcc7('0x2')]},'disposition':{'type':Sequelize[_0xdcc7('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdcc7('0x3')]},'note':{'type':Sequelize[_0xdcc7('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xdcc7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdcc7('0x4')]('in',_0xdcc7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdcc7('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xdcc7('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 810b159..703266c 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 _0x92e9=['user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','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','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','includeAll','include','merge','options','create','update','params','describe','FaxMessage','addMessage','ids','getMessages','rawAttributes','findAll','rows','setTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','catch','index','FaxInteraction','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','user_has_fax_interactions','users','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','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','body','start','keys','some','compact','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent'];(function(_0x2afcd0,_0x439560){var _0x3d0527=function(_0x494f19){while(--_0x494f19){_0x2afcd0['push'](_0x2afcd0['shift']());}};_0x3d0527(++_0x439560);}(_0x92e9,0x1e6));var _0x992e=function(_0x5ca671,_0x2f7814){_0x5ca671=_0x5ca671-0x0;var _0x12d3c7=_0x92e9[_0x5ca671];return _0x12d3c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x992e('0x0'));var zipdir=require(_0x992e('0x1'));var jsonpatch=require(_0x992e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x992e('0x3'));var util=require('util');var path=require(_0x992e('0x4'));var sox=require(_0x992e('0x5'));var csv=require(_0x992e('0x6'));var ejs=require(_0x992e('0x7'));var fs=require('fs');var fs_extra=require(_0x992e('0x8'));var _=require(_0x992e('0x9'));var squel=require(_0x992e('0xa'));var crypto=require(_0x992e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x992e('0xc'));var toCsv=require(_0x992e('0x6'));var querystring=require(_0x992e('0xd'));var Papa=require(_0x992e('0xe'));var Redis=require('ioredis');var authService=require(_0x992e('0xf'));var qs=require(_0x992e('0x10'));var as=require(_0x992e('0x11'));var hardwareService=require(_0x992e('0x12'));var logger=require(_0x992e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x992e('0x14'));var licenseUtil=require(_0x992e('0x15'));var db=require('../../mysqldb')['db'];config[_0x992e('0x16')]=_['defaults'](config[_0x992e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x992e('0x17'))(new Redis(config[_0x992e('0x16')]));require('./faxInteraction.socket')[_0x992e('0x18')](socket);function respondWithStatusCode(_0xd72f28,_0x21fb9a){_0x21fb9a=_0x21fb9a||0xcc;return function(_0x1994c9){if(_0x1994c9){return _0xd72f28[_0x992e('0x19')](_0x21fb9a);}return _0xd72f28[_0x992e('0x1a')](_0x21fb9a)['end']();};}function respondWithResult(_0x1ec22d,_0x3df1ec){_0x3df1ec=_0x3df1ec||0xc8;return function(_0x1dca58){if(_0x1dca58){return _0x1ec22d[_0x992e('0x1a')](_0x3df1ec)[_0x992e('0x1b')](_0x1dca58);}};}function respondWithFilteredResult(_0x59cc24,_0x5bc42a){return function(_0x5c5538){if(_0x5c5538){var _0x70ccc3=typeof _0x5bc42a[_0x992e('0x1c')]===_0x992e('0x1d')&&typeof _0x5bc42a['limit']===_0x992e('0x1d');var _0x446355=_0x5c5538[_0x992e('0x1e')];var _0x184cc9=_0x70ccc3?0x0:_0x5bc42a['offset'];var _0x2fdf3e=_0x70ccc3?_0x5c5538[_0x992e('0x1e')]:_0x5bc42a[_0x992e('0x1c')]+_0x5bc42a[_0x992e('0x1f')];var _0x51c3f1;if(_0x2fdf3e>=_0x446355){_0x2fdf3e=_0x446355;_0x51c3f1=0xc8;}else{_0x51c3f1=0xce;}_0x59cc24[_0x992e('0x1a')](_0x51c3f1);return _0x59cc24[_0x992e('0x20')]('Content-Range',_0x184cc9+'-'+_0x2fdf3e+'/'+_0x446355)[_0x992e('0x1b')](_0x5c5538);}return null;};}function patchUpdates(_0x2470a1){return function(_0x5b86da){try{jsonpatch[_0x992e('0x21')](_0x5b86da,_0x2470a1,!![]);}catch(_0x34885a){return BPromise[_0x992e('0x22')](_0x34885a);}return _0x5b86da[_0x992e('0x23')]();};}function saveUpdates(_0x4042ee,_0x2b5b8e){return function(_0x14543a){if(_0x14543a){return _0x14543a['update'](_0x4042ee)[_0x992e('0x24')](function(_0x562250){return _0x562250;});}return null;};}function removeEntity(_0x3aaf9c,_0x39213c){return function(_0xd785ee){if(_0xd785ee){return _0xd785ee[_0x992e('0x25')]()[_0x992e('0x24')](function(){_0x3aaf9c[_0x992e('0x1a')](0xcc)[_0x992e('0x26')]();});}};}function handleEntityNotFound(_0x36af3a,_0x4908b3){return function(_0x54b6cb){if(!_0x54b6cb){_0x36af3a[_0x992e('0x19')](0x194);}return _0x54b6cb;};}function handleError(_0xee8db5,_0xe0dc1d){_0xe0dc1d=_0xe0dc1d||0x1f4;return function(_0x2b0638){logger[_0x992e('0x27')](_0x2b0638[_0x992e('0x28')]);if(_0x2b0638[_0x992e('0x29')]){delete _0x2b0638[_0x992e('0x29')];}_0xee8db5['status'](_0xe0dc1d)[_0x992e('0x2a')](_0x2b0638);};}function getInteractionUsers(_0x34bf2e,_0x2b0e44){return new BPromise(function(_0x379e4b,_0x5b7580){try{if(_0x2b0e44[_0x34bf2e['id']]){_0x34bf2e[_0x992e('0x2b')]=_[_0x992e('0x2c')](_0x2b0e44[_0x34bf2e['id']],function(_0x3fe8f5){return{'id':_0x3fe8f5['id'],'fullname':_0x3fe8f5[_0x992e('0x2d')]};});}}catch(_0x2f89ee){_0x5b7580(_0x2f89ee);}_0x379e4b(_0x34bf2e);});}function getInteractionTags(_0x39d204,_0x42a98b){return new BPromise(function(_0x34a84f,_0x3343c4){try{if(_0x39d204[_0x992e('0x2e')]){_0x39d204[_0x992e('0x2f')]=[];_0x39d204['TagIds'][_0x992e('0x30')](',')['forEach'](function(_0x5f1a9f){_0x39d204['Tags']['push'](_0x42a98b[_0x5f1a9f]);});}delete _0x39d204[_0x992e('0x2e')];}catch(_0x2def0b){_0x3343c4(_0x2def0b);}_0x34a84f(_0x39d204);});}function updateFaxInteraction(_0x4085dc,_0x483803,_0x1366b2){return new BPromise(function(_0x2b4557,_0x56a506){return getInteractionUsers(_0x4085dc,_0x1366b2)[_0x992e('0x24')](function(_0x3e8036){return getInteractionTags(_0x3e8036,_0x483803);})[_0x992e('0x24')](function(_0x292377){_0x2b4557(_0x292377);})[_0x992e('0x31')](function(_0x546351){_0x56a506(_0x546351);});});}exports[_0x992e('0x32')]=function(_0x2cbf90,_0x4cafc6){var _0x5a3002={},_0x1d3452={},_0x304318={'count':0x0,'rows':[]};var _0x34053a=_['map'](db[_0x992e('0x33')]['rawAttributes'],function(_0x4a9206){return{'name':_0x4a9206['fieldName'],'type':_0x4a9206[_0x992e('0x34')][_0x992e('0x35')]};});_0x1d3452[_0x992e('0x36')]=_['map'](_0x34053a,_0x992e('0x29'));_0x1d3452['query']=_['keys'](_0x2cbf90[_0x992e('0x37')]);_0x1d3452[_0x992e('0x38')]=_['intersection'](_0x1d3452[_0x992e('0x36')],_0x1d3452[_0x992e('0x37')]);_0x5a3002[_0x992e('0x39')]=_[_0x992e('0x3a')](_0x1d3452['model'],qs[_0x992e('0x3b')](_0x2cbf90[_0x992e('0x37')]['fields']));_0x5a3002[_0x992e('0x39')]=_0x5a3002[_0x992e('0x39')][_0x992e('0x3c')]?_0x5a3002['attributes']:_0x1d3452[_0x992e('0x36')];if(!_0x2cbf90[_0x992e('0x37')][_0x992e('0x3d')](_0x992e('0x3e'))){_0x5a3002[_0x992e('0x1f')]=qs['limit'](_0x2cbf90['query'][_0x992e('0x1f')]);_0x5a3002[_0x992e('0x1c')]=qs['offset'](_0x2cbf90['query'][_0x992e('0x1c')]);}_0x5a3002['order']=qs[_0x992e('0x3f')](_0x2cbf90[_0x992e('0x37')][_0x992e('0x3f')]);_0x5a3002[_0x992e('0x40')]=qs[_0x992e('0x38')](_[_0x992e('0x41')](_0x2cbf90[_0x992e('0x37')],_0x1d3452[_0x992e('0x38')]),_0x34053a);var _0x2f2ffc=[];var _0x59ff18=squel[_0x992e('0x42')]()[_0x992e('0x43')]('id')[_0x992e('0x43')](_0x992e('0x29'))['field'](_0x992e('0x44'))[_0x992e('0x45')]('tools_tags');var _0x25fe04=squel[_0x992e('0x42')]()[_0x992e('0x43')]('u.id')[_0x992e('0x43')]('u.fullname')['field']('ui.FaxInteractionId')[_0x992e('0x45')](_0x992e('0x46'),'ui')['left_join'](_0x992e('0x47'),'u','u.id\x20=\x20ui.UserId');var _0x457dae=squel[_0x992e('0x42')]()[_0x992e('0x45')](_0x992e('0x48'),'i')[_0x992e('0x49')](_0x992e('0x4a'),'c',_0x992e('0x4b'))[_0x992e('0x49')](_0x992e('0x47'),'o',_0x992e('0x4c'))[_0x992e('0x49')](_0x992e('0x4d'),'a',_0x992e('0x4e'))[_0x992e('0x49')]('fax_messages','me',_0x992e('0x4f'))[_0x992e('0x49')](_0x992e('0x50'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x992e('0x49')]('tools_tags','t',_0x992e('0x51'));var _0x3a1084=squel[_0x992e('0x52')]();var _0x176e31=[];var _0x2d840f=squel[_0x992e('0x52')]();var _0x5eb016;if(_0x2cbf90[_0x992e('0x37')][_0x992e('0x53')]){_0x5eb016=as['parseSearch'](_0x2cbf90[_0x992e('0x37')]['search']);var _0x41dce1=_0x5eb016['sqlOperator'];for(var _0x59fbb5=0x0;_0x59fbb5<_0x5eb016['conditions'][_0x992e('0x3c')];_0x59fbb5++){var _0x379eac=_0x5eb016[_0x992e('0x54')][_0x59fbb5];var _0x2f2ec7='i';var _0x12e045=_[_0x992e('0x55')](_0x34053a,[_0x992e('0x29'),_0x379eac[_0x992e('0x43')]]);if(!_0x12e045){switch(_0x379eac[_0x992e('0x43')]){case _0x992e('0x56'):if(_0x379eac[_0x992e('0x57')]==0x1){_0x457dae[_0x992e('0x58')]('`'+_0x379eac[_0x992e('0x43')]+_0x992e('0x59'));}else{_0x457dae[_0x992e('0x58')]('`'+_0x379eac['field']+'`\x20>\x200');}break;case'Contact':if(_0x379eac[_0x992e('0x5a')]==='$substring'){if(_0x379eac[_0x992e('0x57')][_0x992e('0x30')]('\x20')[_0x992e('0x3c')]>0x1){_0x3a1084[_0x41dce1]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x992e('0x5b')](_0x379eac[_0x992e('0x57')]),null);}else{var _0x22b5a2='%'+_0x379eac[_0x992e('0x57')]+'%';_0x3a1084[_0x41dce1](_0x992e('0x5c'),_0x22b5a2,_0x22b5a2,_0x22b5a2);}}else{_0x12e045=_['find'](_0x34053a,[_0x992e('0x29'),'ContactId']);_0x379eac['field']=_0x992e('0x5d');_0x9c11a6=as[_0x992e('0x5e')](_0x2f2ec7,_0x12e045[_0x992e('0x34')],_0x379eac);_0x3a1084[_0x41dce1](_0x9c11a6[_0x992e('0x5f')],_0x9c11a6[_0x992e('0x57')]['start'],_0x9c11a6[_0x992e('0x57')]['end']);}break;case _0x992e('0x60'):var _0x27950c=_0x379eac[_0x992e('0x57')][_0x992e('0x30')](',')[_0x992e('0x2c')](function(_0x444646){return Number(_0x444646);});_0x27950c['forEach'](function(_0x4fe48f){_0x2d840f['or'](_0x992e('0x61'),'%,'+_0x4fe48f+',%');});_0x176e31=_[_0x992e('0x62')](_0x176e31,_0x27950c);break;case _0x992e('0x63'):if(_0x379eac[_0x992e('0x5a')]==='$substring'){_0x3a1084[_0x41dce1](_0x992e('0x64'),'%'+_0x379eac[_0x992e('0x57')]+'%',null);}else{_0x12e045=_[_0x992e('0x55')](_0x34053a,[_0x992e('0x29'),_0x992e('0x65')]);_0x379eac[_0x992e('0x43')]=_0x992e('0x65');_0x9c11a6=as['buildExpression'](_0x2f2ec7,_0x12e045[_0x992e('0x34')],_0x379eac);_0x3a1084[_0x41dce1](_0x9c11a6[_0x992e('0x5f')],_0x9c11a6[_0x992e('0x57')]['start'],_0x9c11a6[_0x992e('0x57')][_0x992e('0x26')]);}break;case _0x992e('0x66'):_0x9c11a6=as[_0x992e('0x5e')]('me',null,_0x379eac);_0x3a1084[_0x41dce1](_0x9c11a6[_0x992e('0x5f')],_0x9c11a6[_0x992e('0x57')][_0x992e('0x67')],_0x9c11a6['value'][_0x992e('0x26')]);break;}}else{var _0x9c11a6=as['buildExpression'](_0x2f2ec7,_0x12e045['type'],_0x379eac);_0x3a1084[_0x41dce1](_0x9c11a6['text'],_0x9c11a6['value'][_0x992e('0x67')],_0x9c11a6[_0x992e('0x57')][_0x992e('0x26')]);}}}else{var _0x7c72de=_(_0x2cbf90[_0x992e('0x37')])[_0x992e('0x68')]()[_0x992e('0x2c')](function(_0x11ff09){return _[_0x992e('0x69')](_0x34053a,[_0x992e('0x29'),_0x11ff09])?_0x11ff09:undefined;})[_0x992e('0x6a')]()[_0x992e('0x57')]();if(!_['isEmpty'](_0x7c72de)){_0x7c72de[_0x992e('0x6b')](function(_0x1610ea){if(_0x1610ea===_0x992e('0x6c')){_0x457dae[_0x992e('0x40')](_0x992e('0x6d'),[]['concat'](_0x2cbf90[_0x992e('0x37')][_0x1610ea]));}else if(_0x1610ea===_0x992e('0x6e')){var _0x2f664a=JSON[_0x992e('0x6f')](_0x2cbf90['query'][_0x1610ea])[_0x992e('0x70')];var _0x2c5b88=JSON[_0x992e('0x6f')](_0x2cbf90[_0x992e('0x37')][_0x1610ea])[_0x992e('0x71')];_0x457dae['where'](_0x992e('0x72'),_0x2f664a,_0x2c5b88);}else{if(_0x2cbf90[_0x992e('0x37')][_0x1610ea]===_0x992e('0x73')){_0x457dae[_0x992e('0x40')]('i.'+_0x1610ea+_0x992e('0x74'));}else{_0x457dae[_0x992e('0x40')]('i.'+_0x1610ea+'\x20=\x20?',_0x2cbf90[_0x992e('0x37')][_0x1610ea]);}}});}if(_0x2cbf90[_0x992e('0x37')][_0x992e('0x75')]){if(_0x2cbf90['query'][_0x992e('0x75')]==0x1){_0x457dae[_0x992e('0x58')]('`unreadMessages`\x20=\x200');}else{_0x457dae['having'](_0x992e('0x76'));}}if(_0x2cbf90[_0x992e('0x37')]['tag']){_0x176e31=_[_0x992e('0x77')](_0x2cbf90[_0x992e('0x37')]['tag'])?_0x2cbf90[_0x992e('0x37')][_0x992e('0x78')]:new Array(_0x2cbf90[_0x992e('0x37')][_0x992e('0x78')]);_0x176e31[_0x992e('0x6b')](function(_0x512685){_0x2d840f['or'](_0x992e('0x61'),'%,'+_0x512685+',%');});}if(_0x2cbf90[_0x992e('0x37')][_0x992e('0x79')]){var _0x167158=_0x2cbf90[_0x992e('0x37')][_0x992e('0x79')][_0x992e('0x7a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x992e('0x7b')](_0x167158)){_0x3a1084['or'](_0x992e('0x7c'),_0x167158+'%')['or'](_0x992e('0x7d'),_0x167158+'%');}_0x3a1084['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x167158+'%');}}_0x457dae[_0x992e('0x40')](_0x3a1084);_0x457dae[_0x992e('0x7e')](_0x992e('0x7f'));var _0x4e2419={'type':db['Sequelize'][_0x992e('0x80')][_0x992e('0x81')],'raw':!![]};var _0x51f44e=_0x457dae[_0x992e('0x82')]();_0x51f44e['field'](_0x992e('0x7f'));_0x51f44e[_0x992e('0x43')](_0x992e('0x83'),_0x992e('0x56'));if(_0x5a3002[_0x992e('0x84')]){_0x5a3002[_0x992e('0x84')][_0x992e('0x6b')](function(_0x2afff3){var _0x3736b3=_0x2afff3[0x0]===_0x992e('0x85')?_0x2afff3[0x0]:'i.'+_0x2afff3[0x0];_0x457dae[_0x992e('0x84')](_0x3736b3,_0x2afff3[0x1]===_0x992e('0x86')?![]:!![]);});}if(!_[_0x992e('0x87')](_0x176e31)){_0x457dae[_0x992e('0x58')](_0x2d840f);_0x51f44e['where'](_0x992e('0x88'),_0x176e31);}BPromise[_0x992e('0x89')]()[_0x992e('0x24')](function(){if(!_0x5eb016){if(_0x2cbf90[_0x992e('0x37')][_0x992e('0x6c')])return;_0x51f44e['where'](_0x992e('0x8a'));_0x457dae[_0x992e('0x40')](_0x992e('0x8a'));return;}if(_0x2cbf90['user'][_0x992e('0x8b')]!==_0x992e('0x8c'))return;return _0x2cbf90[_0x992e('0x8d')][_0x992e('0x8e')]({'attributes':['id'],'raw':!![]})[_0x992e('0x24')](function(_0x269685){if(_[_0x992e('0x87')](_0x269685)){_0x51f44e['where'](_0x992e('0x8f'));_0x457dae[_0x992e('0x40')](_0x992e('0x8f'));}else{_0x51f44e['where'](_0x992e('0x6d'),_[_0x992e('0x2c')](_0x269685,'id'));_0x457dae[_0x992e('0x40')](_0x992e('0x6d'),_[_0x992e('0x2c')](_0x269685,'id'));}});})[_0x992e('0x24')](function(){if(_0x2cbf90['user'][_0x992e('0x8b')]===_0x992e('0x8c')&&!_0x5eb016&&!_0x2cbf90['query'][_0x992e('0x6c')])return[];return db[_0x992e('0x90')]['query'](_0x51f44e[_0x992e('0x91')](),_0x4e2419);})[_0x992e('0x24')](function(_0x18ec33){_0x304318['count']=_0x18ec33[_0x992e('0x3c')];if(_0x304318['count']===0x0)return[];return db[_0x992e('0x90')][_0x992e('0x37')](_0x59ff18[_0x992e('0x91')](),_0x4e2419)[_0x992e('0x24')](function(_0x1713c9){_0x2f2ffc=_[_0x992e('0x92')](_0x1713c9,'id');_0x4e2419=_['merge'](_0x4e2419,{'model':db[_0x992e('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2cbf90[_0x992e('0x37')][_0x992e('0x3b')]){_0x5a3002[_0x992e('0x39')][_0x992e('0x6b')](function(_0x5a7e9f){_0x457dae[_0x992e('0x43')]('i.'+_0x5a7e9f);});}else{_0x457dae[_0x992e('0x43')](_0x992e('0x83'),_0x992e('0x56'));_0x457dae[_0x992e('0x43')](_0x992e('0x93'),_0x992e('0x94'));_0x457dae['field']('a.mandatoryDisposition',_0x992e('0x95'));_0x457dae[_0x992e('0x43')](_0x992e('0x96'),'contactName');_0x457dae[_0x992e('0x43')](_0x992e('0x97'));_0x457dae[_0x992e('0x43')]('c.firstName','Contact.firstName');_0x457dae[_0x992e('0x43')]('c.lastName',_0x992e('0x98'));_0x457dae[_0x992e('0x43')](_0x992e('0x99'),_0x992e('0x9a'));_0x457dae[_0x992e('0x43')](_0x992e('0x9b'),_0x992e('0x9c'));_0x457dae[_0x992e('0x43')](_0x992e('0x9d'),_0x992e('0x9e'));_0x457dae[_0x992e('0x43')](_0x992e('0x9f'),_0x992e('0xa0'));_0x457dae[_0x992e('0x43')](_0x992e('0xa1'),_0x992e('0xa2'));_0x457dae[_0x992e('0x43')](_0x992e('0xa3'),'Owner.internal');_0x457dae[_0x992e('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x5a3002[_0x992e('0x1f')])_0x457dae[_0x992e('0x1f')](_0x5a3002[_0x992e('0x1f')]);if(_0x5a3002[_0x992e('0x1c')])_0x457dae[_0x992e('0x1c')](_0x5a3002['offset']);return db['sequelize']['query'](_0x457dae[_0x992e('0x91')](),_0x4e2419);})[_0x992e('0x24')](function(_0x12022c){if(_0x12022c[_0x992e('0x3c')]>0x0)_0x25fe04[_0x992e('0x40')](_0x992e('0xa4'),_[_0x992e('0x2c')](_0x12022c,'id'));return db[_0x992e('0x90')][_0x992e('0x37')](_0x25fe04[_0x992e('0x91')](),_0x4e2419)[_0x992e('0x24')](function(_0x592424){var _0x344b07=_[_0x992e('0xa5')](_0x592424,_0x992e('0xa6'));var _0x2ee1b8=[];_0x12022c[_0x992e('0x6b')](function(_0x59c826){_0x2ee1b8['push'](updateFaxInteraction(_0x59c826,_0x2f2ffc,_0x344b07));});return BPromise[_0x992e('0xa7')](_0x2ee1b8);});});})[_0x992e('0x24')](function(_0x28718c){_0x304318['rows']=_0x28718c;return _0x304318;})[_0x992e('0x24')](respondWithFilteredResult(_0x4cafc6,_0x5a3002))[_0x992e('0x31')](handleError(_0x4cafc6,null));};exports[_0x992e('0xa8')]=function(_0x480a6b,_0x40364a){var _0x17ca92={'raw':![],'where':{'id':_0x480a6b['params']['id']}},_0x15a658={};_0x15a658['model']=_['keys'](db[_0x992e('0x33')]['rawAttributes']);_0x15a658[_0x992e('0x37')]=_[_0x992e('0x68')](_0x480a6b[_0x992e('0x37')]);_0x15a658[_0x992e('0x38')]=_[_0x992e('0x3a')](_0x15a658['model'],_0x15a658[_0x992e('0x37')]);_0x17ca92['attributes']=_[_0x992e('0x3a')](_0x15a658[_0x992e('0x36')],qs[_0x992e('0x3b')](_0x480a6b[_0x992e('0x37')][_0x992e('0x3b')]));_0x17ca92[_0x992e('0x39')]=_0x17ca92['attributes'][_0x992e('0x3c')]?_0x17ca92[_0x992e('0x39')]:_0x15a658[_0x992e('0x36')];if(_0x480a6b[_0x992e('0x37')][_0x992e('0xa9')]){_0x17ca92[_0x992e('0xaa')]=[{'all':!![]}];}_0x17ca92=_[_0x992e('0xab')]({},_0x17ca92,_0x480a6b[_0x992e('0xac')]);return db[_0x992e('0x33')]['find'](_0x17ca92)[_0x992e('0x24')](handleEntityNotFound(_0x40364a,null))[_0x992e('0x24')](respondWithResult(_0x40364a,null))[_0x992e('0x31')](handleError(_0x40364a,null));};exports[_0x992e('0xad')]=function(_0x2c6105,_0x37a5f5){return db[_0x992e('0x33')][_0x992e('0xad')](_0x2c6105[_0x992e('0x66')],{})[_0x992e('0x24')](respondWithResult(_0x37a5f5,0xc9))['catch'](handleError(_0x37a5f5,null));};exports[_0x992e('0xae')]=function(_0x2cc401,_0x46979e){if(_0x2cc401[_0x992e('0x66')]['id']){delete _0x2cc401[_0x992e('0x66')]['id'];}return db['FaxInteraction'][_0x992e('0x55')]({'where':{'id':_0x2cc401[_0x992e('0xaf')]['id']}})[_0x992e('0x24')](handleEntityNotFound(_0x46979e,null))[_0x992e('0x24')](saveUpdates(_0x2cc401[_0x992e('0x66')],null))['then'](respondWithResult(_0x46979e,null))['catch'](handleError(_0x46979e,null));};exports[_0x992e('0x25')]=function(_0x3f81cc,_0x373b56){return db['FaxInteraction'][_0x992e('0x55')]({'where':{'id':_0x3f81cc[_0x992e('0xaf')]['id']}})[_0x992e('0x24')](handleEntityNotFound(_0x373b56,null))[_0x992e('0x24')](removeEntity(_0x373b56,null))[_0x992e('0x31')](handleError(_0x373b56,null));};exports[_0x992e('0xb0')]=function(_0x37aea1,_0x4070c8){return db[_0x992e('0x33')][_0x992e('0xb0')]()[_0x992e('0x24')](respondWithResult(_0x4070c8,null))[_0x992e('0x31')](handleError(_0x4070c8,null));};exports['addMessage']=function(_0x14f72d,_0x1a9f91,_0x4bc451){return db[_0x992e('0xb1')][_0x992e('0x55')]({'where':{'id':_0x14f72d[_0x992e('0xaf')]['id']}})['then'](handleEntityNotFound(_0x1a9f91,null))[_0x992e('0x24')](function(_0x328b57){if(_0x328b57){return _0x328b57[_0x992e('0xb2')](_0x14f72d['body'][_0x992e('0xb3')],_['omit'](_0x14f72d[_0x992e('0x66')],[_0x992e('0xb3'),'id'])||{});}})[_0x992e('0x24')](respondWithResult(_0x1a9f91,null))[_0x992e('0x31')](handleError(_0x1a9f91,null));};exports[_0x992e('0xb4')]=function(_0x2d1972,_0x13b07a,_0x2e597b){var _0x18f3df={'raw':![],'where':{}};var _0x17f435={};var _0x293c58={'count':0x0,'rows':[]};return db[_0x992e('0x33')]['findOne']({'where':{'id':_0x2d1972['params']['id']}})['then'](handleEntityNotFound(_0x13b07a,null))[_0x992e('0x24')](function(_0x3d45e7){if(_0x3d45e7){_0x17f435[_0x992e('0x36')]=_[_0x992e('0x68')](db[_0x992e('0xb1')][_0x992e('0xb5')]);_0x17f435['query']=_[_0x992e('0x68')](_0x2d1972[_0x992e('0x37')]);_0x17f435['filters']=_['intersection'](_0x17f435['model'],_0x17f435[_0x992e('0x37')]);_0x18f3df[_0x992e('0x39')]=_[_0x992e('0x3a')](_0x17f435[_0x992e('0x36')],qs[_0x992e('0x3b')](_0x2d1972['query'][_0x992e('0x3b')]));_0x18f3df[_0x992e('0x39')]=_0x18f3df['attributes'][_0x992e('0x3c')]?_0x18f3df['attributes']:_0x17f435[_0x992e('0x36')];if(!_0x2d1972[_0x992e('0x37')][_0x992e('0x3d')](_0x992e('0x3e'))){_0x18f3df['limit']=qs['limit'](_0x2d1972[_0x992e('0x37')][_0x992e('0x1f')]);_0x18f3df[_0x992e('0x1c')]=qs[_0x992e('0x1c')](_0x2d1972[_0x992e('0x37')][_0x992e('0x1c')]);}_0x18f3df[_0x992e('0x84')]=qs[_0x992e('0x3f')](_0x2d1972[_0x992e('0x37')][_0x992e('0x3f')]);_0x18f3df[_0x992e('0x40')]=qs[_0x992e('0x38')](_[_0x992e('0x41')](_0x2d1972[_0x992e('0x37')],_0x17f435[_0x992e('0x38')]));_0x18f3df[_0x992e('0x40')][_0x992e('0xa6')]=_0x3d45e7['id'];if(_0x2d1972[_0x992e('0x37')]['filter']){_0x18f3df[_0x992e('0x40')]=_[_0x992e('0xab')](_0x18f3df[_0x992e('0x40')],{'$or':_[_0x992e('0x2c')](_0x18f3df[_0x992e('0x39')],function(_0x4eafa0){var _0x363c9f={};_0x363c9f[_0x4eafa0]={'$like':'%'+_0x2d1972[_0x992e('0x37')][_0x992e('0x79')]+'%'};return _0x363c9f;})});}if(_0x2d1972[_0x992e('0x37')]['$gte']){var _0x251d00=_0x2d1972['query']['$gte'][_0x992e('0x30')](',');var _0x28d0df={};_0x28d0df[_0x251d00[0x0]]={'$gte':moment(_0x251d00[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x18f3df[_0x992e('0x40')]=_[_0x992e('0xab')](_0x18f3df[_0x992e('0x40')],_0x28d0df);}_0x18f3df=_[_0x992e('0xab')]({},_0x18f3df,_0x2d1972[_0x992e('0xac')]);return db[_0x992e('0xb1')][_0x992e('0x1e')]({'where':_0x18f3df[_0x992e('0x40')]})[_0x992e('0x24')](function(_0x5efd4f){_0x293c58['count']=_0x5efd4f;if(_0x2d1972[_0x992e('0x37')][_0x992e('0xa9')]){_0x18f3df[_0x992e('0xaa')]=[{'all':!![]}];}return db[_0x992e('0xb1')][_0x992e('0xb6')](_0x18f3df);})['then'](function(_0x584818){_0x293c58[_0x992e('0xb7')]=_0x584818;return _0x293c58;});}})[_0x992e('0x24')](respondWithFilteredResult(_0x13b07a,_0x18f3df))[_0x992e('0x31')](handleError(_0x13b07a,null));};exports['addTags']=function(_0x3faff,_0x3b2f29,_0x35b102){return db[_0x992e('0x33')]['find']({'where':{'id':_0x3faff[_0x992e('0xaf')]['id']}})['then'](handleEntityNotFound(_0x3b2f29,null))[_0x992e('0x24')](function(_0x28a958){if(_0x28a958){return _0x28a958[_0x992e('0xb8')](_0x3faff[_0x992e('0x66')][_0x992e('0xb3')],_[_0x992e('0xb9')](_0x3faff[_0x992e('0x66')],[_0x992e('0xb3'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x992e('0x29'),'color'],'where':{'id':_0x3faff['body']['ids']}});})[_0x992e('0x24')](function(_0x2e5dfa){socket[_0x992e('0xba')](_0x992e('0xbb'),{'id':Number(_0x3faff[_0x992e('0xaf')]['id']),'tags':_0x2e5dfa||[]});return{'id':Number(_0x3faff[_0x992e('0xaf')]['id']),'tags':_0x2e5dfa||[]};});}})['then'](respondWithResult(_0x3b2f29,null))['catch'](handleError(_0x3b2f29,null));};exports[_0x992e('0xbc')]=function(_0x19c2f3,_0x537c64,_0x3d3ebc){return db[_0x992e('0x33')][_0x992e('0x55')]({'where':{'id':_0x19c2f3[_0x992e('0xaf')]['id']}})['then'](handleEntityNotFound(_0x537c64,null))[_0x992e('0x24')](function(_0xd3842a){if(_0xd3842a){return _0xd3842a['removeTags'](_0x19c2f3[_0x992e('0x37')][_0x992e('0xb3')]);}})[_0x992e('0x24')](respondWithStatusCode(_0x537c64,null))[_0x992e('0x31')](handleError(_0x537c64,null));};exports[_0x992e('0xbd')]=function(_0x3ef6dc,_0x4d3f1d){var _0x3deff6=moment()[_0x992e('0xbe')]()[_0x992e('0x91')]();var _0x3948ad=path[_0x992e('0xbf')](config[_0x992e('0xc0')],_0x992e('0xc1'),'files',_0x992e('0xc2'));var _0x577415=path[_0x992e('0xbf')](config[_0x992e('0xc0')],_0x992e('0xc1'),_0x992e('0xc3'),'attachments');var _0x4ce7e8=path[_0x992e('0xbf')](_0x3948ad,_0x3deff6);var _0x5d90c4=util['format']('transcript-%d-%s.zip',_0x3ef6dc[_0x992e('0xaf')]['id'],_0x3deff6);var _0x2b1aea=path['join'](_0x3948ad,_0x5d90c4);var _0x4c9e90=[];_0x4c9e90[_0x992e('0xc4')]({'model':db['Attachment'],'as':_0x992e('0xc5'),'raw':!![]});var _0xedffb1=[{'model':db[_0x992e('0xb1')],'as':'Messages','attributes':['id',_0x992e('0x66'),_0x992e('0x6e')],'include':_0x4c9e90}];return db['FaxInteraction'][_0x992e('0x55')]({'where':{'id':_0x3ef6dc[_0x992e('0xaf')]['id']},'include':_0xedffb1})[_0x992e('0x24')](handleEntityNotFound(_0x4d3f1d,null))['then'](function(_0x154a39){if(_0x154a39&&_0x154a39[_0x992e('0xc6')]){var _0x3d25af=_0x154a39[_0x992e('0xc7')]({'plain':!![]});fs[_0x992e('0xc8')](_0x4ce7e8);for(var _0x24a6a2=0x0;_0x24a6a2<_0x3d25af[_0x992e('0xc6')][_0x992e('0x3c')];_0x24a6a2++){var _0x39761e=_0x3d25af['Messages'][_0x24a6a2][_0x992e('0xc5')];if(_0x39761e){var _0x58f21b=path['join'](_0x577415,_0x39761e[_0x992e('0xc9')]);if(fs[_0x992e('0xca')](_0x58f21b)){fs[_0x992e('0xcb')](_0x58f21b)[_0x992e('0xcc')](fs[_0x992e('0xcd')](path[_0x992e('0xbf')](_0x4ce7e8,_0x39761e[_0x992e('0xc9')])));}}}return BPromise[_0x992e('0x89')]()[_0x992e('0x24')](function(){return new BPromise(function(_0x58371c,_0x5731fb){zipdir(_0x4ce7e8,{'saveTo':_0x2b1aea},function(_0x1b32ea,_0x2dd29b){if(_0x1b32ea)return _0x5731fb(_0x1b32ea);return _0x58371c(_0x2dd29b);});})[_0x992e('0x24')](function(){return new BPromise(function(_0x15c72d,_0x35cffb){rimraf(_0x4ce7e8,function(_0x28fefe){if(_0x28fefe)_0x35cffb(_0x28fefe);return _0x15c72d();});});})['then'](function(){return _0x4d3f1d[_0x992e('0xbd')](_0x2b1aea,_0x5d90c4,function(_0x495a77){if(_0x495a77){console[_0x992e('0xce')](_0x992e('0xcf'),_0x495a77);}else{fs[_0x992e('0xd0')](_0x2b1aea);}});});});}else{return _0x4d3f1d['sendStatus'](0xc8);}})[_0x992e('0x31')](handleError(_0x4d3f1d,null));}; \ No newline at end of file +var _0x2412=['end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','status','error','name','Users','map','TagIds','Tags','forEach','push','catch','index','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','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','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','value','having','`\x20=\x200','`\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','ContactId','buildExpression','text','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','keys','some','compact','FaxAccountId','where','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','groupBy','FaxInteractionId','all','rows','show','FaxInteraction','includeAll','include','options','create','body','params','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','Attachment','Messages','basename','existsSync','pipe','createWriteStream','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus'];(function(_0xc6837f,_0x2c47aa){var _0x28943a=function(_0x126551){while(--_0x126551){_0xc6837f['push'](_0xc6837f['shift']());}};_0x28943a(++_0x2c47aa);}(_0x2412,0xb8));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2241('0x0'));var rimraf=require(_0x2241('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2241('0x2'));var rp=require(_0x2241('0x3'));var moment=require(_0x2241('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2241('0x5'));var util=require(_0x2241('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('fs-extra');var _=require(_0x2241('0x7'));var squel=require(_0x2241('0x8'));var crypto=require(_0x2241('0x9'));var jsforce=require(_0x2241('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2241('0xb'));var querystring=require(_0x2241('0xc'));var Papa=require(_0x2241('0xd'));var Redis=require(_0x2241('0xe'));var authService=require(_0x2241('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2241('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2241('0x11'))(_0x2241('0x12'));var utils=require('../../config/utils');var config=require(_0x2241('0x13'));var licenseUtil=require(_0x2241('0x14'));var db=require('../../mysqldb')['db'];config[_0x2241('0x15')]=_[_0x2241('0x16')](config[_0x2241('0x15')],{'host':_0x2241('0x17'),'port':0x18eb});var socket=require(_0x2241('0x18'))(new Redis(config[_0x2241('0x15')]));require(_0x2241('0x19'))[_0x2241('0x1a')](socket);function respondWithStatusCode(_0x5147ce,_0x1d3067){_0x1d3067=_0x1d3067||0xcc;return function(_0x4bcb53){if(_0x4bcb53){return _0x5147ce[_0x2241('0x1b')](_0x1d3067);}return _0x5147ce['status'](_0x1d3067)[_0x2241('0x1c')]();};}function respondWithResult(_0x5ba975,_0x3e80aa){_0x3e80aa=_0x3e80aa||0xc8;return function(_0xcc452e){if(_0xcc452e){return _0x5ba975['status'](_0x3e80aa)[_0x2241('0x1d')](_0xcc452e);}};}function respondWithFilteredResult(_0x242e83,_0x4d433a){return function(_0xf7263f){if(_0xf7263f){var _0x1a9f0d=typeof _0x4d433a[_0x2241('0x1e')]===_0x2241('0x1f')&&typeof _0x4d433a[_0x2241('0x20')]===_0x2241('0x1f');var _0x235725=_0xf7263f[_0x2241('0x21')];var _0x180516=_0x1a9f0d?0x0:_0x4d433a['offset'];var _0x1c57ff=_0x1a9f0d?_0xf7263f[_0x2241('0x21')]:_0x4d433a[_0x2241('0x1e')]+_0x4d433a[_0x2241('0x20')];var _0x4111e9;if(_0x1c57ff>=_0x235725){_0x1c57ff=_0x235725;_0x4111e9=0xc8;}else{_0x4111e9=0xce;}_0x242e83['status'](_0x4111e9);return _0x242e83['set'](_0x2241('0x22'),_0x180516+'-'+_0x1c57ff+'/'+_0x235725)[_0x2241('0x1d')](_0xf7263f);}return null;};}function patchUpdates(_0x47178b){return function(_0x36b871){try{jsonpatch['apply'](_0x36b871,_0x47178b,!![]);}catch(_0x84c577){return BPromise[_0x2241('0x23')](_0x84c577);}return _0x36b871[_0x2241('0x24')]();};}function saveUpdates(_0xa23ecb,_0x17d274){return function(_0x4a4bb3){if(_0x4a4bb3){return _0x4a4bb3[_0x2241('0x25')](_0xa23ecb)['then'](function(_0x4b7733){return _0x4b7733;});}return null;};}function removeEntity(_0xaee9e7,_0x238b7e){return function(_0x47ee67){if(_0x47ee67){return _0x47ee67[_0x2241('0x26')]()[_0x2241('0x27')](function(){_0xaee9e7[_0x2241('0x28')](0xcc)[_0x2241('0x1c')]();});}};}function handleEntityNotFound(_0x22d403,_0x3e345f){return function(_0x553dd1){if(!_0x553dd1){_0x22d403['sendStatus'](0x194);}return _0x553dd1;};}function handleError(_0x5cdf8c,_0x4299e5){_0x4299e5=_0x4299e5||0x1f4;return function(_0x2420cd){logger[_0x2241('0x29')](_0x2420cd['stack']);if(_0x2420cd[_0x2241('0x2a')]){delete _0x2420cd[_0x2241('0x2a')];}_0x5cdf8c[_0x2241('0x28')](_0x4299e5)['send'](_0x2420cd);};}function getInteractionUsers(_0x441cbb,_0x1c5402){return new BPromise(function(_0x33d45d,_0x6a1dbe){try{if(_0x1c5402[_0x441cbb['id']]){_0x441cbb[_0x2241('0x2b')]=_[_0x2241('0x2c')](_0x1c5402[_0x441cbb['id']],function(_0x428ba0){return{'id':_0x428ba0['id'],'fullname':_0x428ba0['fullname']};});}}catch(_0x45991f){_0x6a1dbe(_0x45991f);}_0x33d45d(_0x441cbb);});}function getInteractionTags(_0x4aff9e,_0x2d4d86){return new BPromise(function(_0x3a4321,_0x3e085e){try{if(_0x4aff9e[_0x2241('0x2d')]){_0x4aff9e[_0x2241('0x2e')]=[];_0x4aff9e[_0x2241('0x2d')]['split'](',')[_0x2241('0x2f')](function(_0x5202a9){_0x4aff9e[_0x2241('0x2e')][_0x2241('0x30')](_0x2d4d86[_0x5202a9]);});}delete _0x4aff9e[_0x2241('0x2d')];}catch(_0xaef903){_0x3e085e(_0xaef903);}_0x3a4321(_0x4aff9e);});}function updateFaxInteraction(_0x58ca38,_0x222d00,_0x2584ff){return new BPromise(function(_0x37e1c7,_0x1d4abe){return getInteractionUsers(_0x58ca38,_0x2584ff)[_0x2241('0x27')](function(_0x19af92){return getInteractionTags(_0x19af92,_0x222d00);})[_0x2241('0x27')](function(_0x2d86b9){_0x37e1c7(_0x2d86b9);})[_0x2241('0x31')](function(_0xf514b6){_0x1d4abe(_0xf514b6);});});}exports[_0x2241('0x32')]=function(_0x300e16,_0x4970af){var _0xd92706={},_0x3e1af2={},_0x1f8d70={'count':0x0,'rows':[]};var _0x25b2aa=_[_0x2241('0x2c')](db['FaxInteraction'][_0x2241('0x33')],function(_0x52ace5){return{'name':_0x52ace5[_0x2241('0x34')],'type':_0x52ace5[_0x2241('0x35')][_0x2241('0x36')]};});_0x3e1af2[_0x2241('0x37')]=_[_0x2241('0x2c')](_0x25b2aa,_0x2241('0x2a'));_0x3e1af2['query']=_['keys'](_0x300e16[_0x2241('0x38')]);_0x3e1af2[_0x2241('0x39')]=_['intersection'](_0x3e1af2[_0x2241('0x37')],_0x3e1af2[_0x2241('0x38')]);_0xd92706[_0x2241('0x3a')]=_[_0x2241('0x3b')](_0x3e1af2['model'],qs[_0x2241('0x3c')](_0x300e16[_0x2241('0x38')][_0x2241('0x3c')]));_0xd92706[_0x2241('0x3a')]=_0xd92706[_0x2241('0x3a')]['length']?_0xd92706[_0x2241('0x3a')]:_0x3e1af2[_0x2241('0x37')];if(!_0x300e16[_0x2241('0x38')][_0x2241('0x3d')](_0x2241('0x3e'))){_0xd92706[_0x2241('0x20')]=qs[_0x2241('0x20')](_0x300e16[_0x2241('0x38')][_0x2241('0x20')]);_0xd92706[_0x2241('0x1e')]=qs[_0x2241('0x1e')](_0x300e16[_0x2241('0x38')][_0x2241('0x1e')]);}_0xd92706[_0x2241('0x3f')]=qs[_0x2241('0x40')](_0x300e16[_0x2241('0x38')][_0x2241('0x40')]);_0xd92706['where']=qs[_0x2241('0x39')](_[_0x2241('0x41')](_0x300e16[_0x2241('0x38')],_0x3e1af2['filters']),_0x25b2aa);var _0x5de21=[];var _0x169bce=squel[_0x2241('0x42')]()[_0x2241('0x43')]('id')[_0x2241('0x43')]('name')[_0x2241('0x43')](_0x2241('0x44'))[_0x2241('0x45')](_0x2241('0x46'));var _0xcbffea=squel['select']()['field'](_0x2241('0x47'))[_0x2241('0x43')](_0x2241('0x48'))['field']('ui.FaxInteractionId')[_0x2241('0x45')]('user_has_fax_interactions','ui')['left_join'](_0x2241('0x49'),'u',_0x2241('0x4a'));var _0x2c7034=squel[_0x2241('0x42')]()[_0x2241('0x45')](_0x2241('0x4b'),'i')[_0x2241('0x4c')]('cm_contacts','c',_0x2241('0x4d'))['left_join']('users','o',_0x2241('0x4e'))[_0x2241('0x4c')](_0x2241('0x4f'),'a',_0x2241('0x50'))[_0x2241('0x4c')](_0x2241('0x51'),'me',_0x2241('0x52'))[_0x2241('0x4c')](_0x2241('0x53'),'it',_0x2241('0x54'))['left_join'](_0x2241('0x46'),'t',_0x2241('0x55'));var _0x5e815d=squel['expr']();var _0x511ce7=[];var _0x569cc4=squel[_0x2241('0x56')]();var _0x3f97ed;if(_0x300e16[_0x2241('0x38')][_0x2241('0x57')]){_0x3f97ed=as[_0x2241('0x58')](_0x300e16['query'][_0x2241('0x57')]);var _0x4fc118=_0x3f97ed['sqlOperator'];for(var _0x4ccd41=0x0;_0x4ccd41<_0x3f97ed[_0x2241('0x59')][_0x2241('0x5a')];_0x4ccd41++){var _0x3451f9=_0x3f97ed[_0x2241('0x59')][_0x4ccd41];var _0x2aab44='i';var _0x15cfcb=_[_0x2241('0x5b')](_0x25b2aa,[_0x2241('0x2a'),_0x3451f9['field']]);if(!_0x15cfcb){switch(_0x3451f9['field']){case'unreadMessages':if(_0x3451f9[_0x2241('0x5c')]==0x1){_0x2c7034[_0x2241('0x5d')]('`'+_0x3451f9[_0x2241('0x43')]+_0x2241('0x5e'));}else{_0x2c7034[_0x2241('0x5d')]('`'+_0x3451f9[_0x2241('0x43')]+_0x2241('0x5f'));}break;case _0x2241('0x60'):if(_0x3451f9[_0x2241('0x61')]===_0x2241('0x62')){if(_0x3451f9['value'][_0x2241('0x63')]('\x20')[_0x2241('0x5a')]>0x1){_0x5e815d[_0x4fc118](_0x2241('0x64'),qs[_0x2241('0x65')](_0x3451f9['value']),null);}else{var _0x230663='%'+_0x3451f9[_0x2241('0x5c')]+'%';_0x5e815d[_0x4fc118]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x230663,_0x230663,_0x230663);}}else{_0x15cfcb=_['find'](_0x25b2aa,['name',_0x2241('0x66')]);_0x3451f9[_0x2241('0x43')]=_0x2241('0x66');_0x5cb692=as[_0x2241('0x67')](_0x2aab44,_0x15cfcb['type'],_0x3451f9);_0x5e815d[_0x4fc118](_0x5cb692[_0x2241('0x68')],_0x5cb692['value']['start'],_0x5cb692[_0x2241('0x5c')][_0x2241('0x1c')]);}break;case _0x2241('0x69'):var _0x2bb286=_0x3451f9[_0x2241('0x5c')]['split'](',')[_0x2241('0x2c')](function(_0x1b3a35){return Number(_0x1b3a35);});_0x2bb286['forEach'](function(_0x5c3693){_0x569cc4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5c3693+',%');});_0x511ce7=_[_0x2241('0x6a')](_0x511ce7,_0x2bb286);break;case _0x2241('0x6b'):if(_0x3451f9['operator']===_0x2241('0x62')){_0x5e815d[_0x4fc118](_0x2241('0x6c'),'%'+_0x3451f9['value']+'%',null);}else{_0x15cfcb=_[_0x2241('0x5b')](_0x25b2aa,[_0x2241('0x2a'),'UserId']);_0x3451f9[_0x2241('0x43')]='UserId';_0x5cb692=as[_0x2241('0x67')](_0x2aab44,_0x15cfcb['type'],_0x3451f9);_0x5e815d[_0x4fc118](_0x5cb692[_0x2241('0x68')],_0x5cb692[_0x2241('0x5c')][_0x2241('0x6d')],_0x5cb692[_0x2241('0x5c')]['end']);}break;case'body':_0x5cb692=as['buildExpression']('me',null,_0x3451f9);_0x5e815d[_0x4fc118](_0x5cb692[_0x2241('0x68')],_0x5cb692[_0x2241('0x5c')][_0x2241('0x6d')],_0x5cb692[_0x2241('0x5c')][_0x2241('0x1c')]);break;}}else{var _0x5cb692=as[_0x2241('0x67')](_0x2aab44,_0x15cfcb[_0x2241('0x35')],_0x3451f9);_0x5e815d[_0x4fc118](_0x5cb692[_0x2241('0x68')],_0x5cb692['value']['start'],_0x5cb692[_0x2241('0x5c')][_0x2241('0x1c')]);}}}else{var _0x1eb215=_(_0x300e16[_0x2241('0x38')])[_0x2241('0x6e')]()['map'](function(_0xcbfe4f){return _[_0x2241('0x6f')](_0x25b2aa,[_0x2241('0x2a'),_0xcbfe4f])?_0xcbfe4f:undefined;})[_0x2241('0x70')]()['value']();if(!_['isEmpty'](_0x1eb215)){_0x1eb215[_0x2241('0x2f')](function(_0x86739a){if(_0x86739a===_0x2241('0x71')){_0x2c7034[_0x2241('0x72')]('i.FaxAccountId\x20IN\x20?',[][_0x2241('0x73')](_0x300e16[_0x2241('0x38')][_0x86739a]));}else if(_0x86739a===_0x2241('0x74')){var _0x558d83=JSON[_0x2241('0x75')](_0x300e16[_0x2241('0x38')][_0x86739a])['$gte'];var _0x338690=JSON['parse'](_0x300e16[_0x2241('0x38')][_0x86739a])['$lte'];_0x2c7034[_0x2241('0x72')](_0x2241('0x76'),_0x558d83,_0x338690);}else{if(_0x300e16[_0x2241('0x38')][_0x86739a]===_0x2241('0x77')){_0x2c7034[_0x2241('0x72')]('i.'+_0x86739a+_0x2241('0x78'));}else{_0x2c7034[_0x2241('0x72')]('i.'+_0x86739a+_0x2241('0x79'),_0x300e16['query'][_0x86739a]);}}});}if(_0x300e16[_0x2241('0x38')]['read']){if(_0x300e16[_0x2241('0x38')][_0x2241('0x7a')]==0x1){_0x2c7034[_0x2241('0x5d')](_0x2241('0x7b'));}else{_0x2c7034[_0x2241('0x5d')](_0x2241('0x7c'));}}if(_0x300e16[_0x2241('0x38')][_0x2241('0x7d')]){_0x511ce7=_[_0x2241('0x7e')](_0x300e16[_0x2241('0x38')][_0x2241('0x7d')])?_0x300e16[_0x2241('0x38')][_0x2241('0x7d')]:new Array(_0x300e16[_0x2241('0x38')][_0x2241('0x7d')]);_0x511ce7['forEach'](function(_0x501298){_0x569cc4['or'](_0x2241('0x7f'),'%,'+_0x501298+',%');});}if(_0x300e16[_0x2241('0x38')][_0x2241('0x80')]){var _0x5d5e27=_0x300e16[_0x2241('0x38')][_0x2241('0x80')][_0x2241('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2241('0x82')](_0x5d5e27)){_0x5e815d['or'](_0x2241('0x83'),_0x5d5e27+'%')['or']('i.fax\x20LIKE\x20?',_0x5d5e27+'%');}_0x5e815d['or'](_0x2241('0x84'),_0x5d5e27+'%');}}_0x2c7034[_0x2241('0x72')](_0x5e815d);_0x2c7034[_0x2241('0x85')](_0x2241('0x86'));var _0x1d75b4={'type':db[_0x2241('0x87')][_0x2241('0x88')]['SELECT'],'raw':!![]};var _0xf6137f=_0x2c7034[_0x2241('0x89')]();_0xf6137f['field'](_0x2241('0x86'));_0xf6137f[_0x2241('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2241('0x8a'));if(_0xd92706[_0x2241('0x3f')]){_0xd92706[_0x2241('0x3f')][_0x2241('0x2f')](function(_0x267519){var _0x5cd220=_0x267519[0x0]===_0x2241('0x8b')?_0x267519[0x0]:'i.'+_0x267519[0x0];_0x2c7034[_0x2241('0x3f')](_0x5cd220,_0x267519[0x1]===_0x2241('0x8c')?![]:!![]);});}if(!_[_0x2241('0x8d')](_0x511ce7)){_0x2c7034['having'](_0x569cc4);_0xf6137f['where'](_0x2241('0x8e'),_0x511ce7);}BPromise[_0x2241('0x8f')]()[_0x2241('0x27')](function(){if(!_0x3f97ed){if(_0x300e16[_0x2241('0x38')][_0x2241('0x71')])return;_0xf6137f[_0x2241('0x72')](_0x2241('0x90'));_0x2c7034[_0x2241('0x72')](_0x2241('0x90'));return;}if(_0x300e16[_0x2241('0x91')][_0x2241('0x92')]!==_0x2241('0x93'))return;return _0x300e16[_0x2241('0x91')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x2241('0x27')](function(_0x381242){if(_[_0x2241('0x8d')](_0x381242)){_0xf6137f[_0x2241('0x72')]('i.FaxAccountId\x20IS\x20NULL');_0x2c7034[_0x2241('0x72')]('i.FaxAccountId\x20IS\x20NULL');}else{_0xf6137f[_0x2241('0x72')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x381242,'id'));_0x2c7034[_0x2241('0x72')](_0x2241('0x94'),_[_0x2241('0x2c')](_0x381242,'id'));}});})['then'](function(){if(_0x300e16[_0x2241('0x91')][_0x2241('0x92')]===_0x2241('0x93')&&!_0x3f97ed&&!_0x300e16[_0x2241('0x38')][_0x2241('0x71')])return[];return db[_0x2241('0x95')][_0x2241('0x38')](_0xf6137f[_0x2241('0x96')](),_0x1d75b4);})[_0x2241('0x27')](function(_0x4e6ce4){_0x1f8d70[_0x2241('0x21')]=_0x4e6ce4['length'];if(_0x1f8d70[_0x2241('0x21')]===0x0)return[];return db[_0x2241('0x95')]['query'](_0x169bce[_0x2241('0x96')](),_0x1d75b4)[_0x2241('0x27')](function(_0x4fdc83){_0x5de21=_[_0x2241('0x97')](_0x4fdc83,'id');_0x1d75b4=_[_0x2241('0x98')](_0x1d75b4,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x300e16['query'][_0x2241('0x3c')]){_0xd92706['attributes'][_0x2241('0x2f')](function(_0x57d504){_0x2c7034['field']('i.'+_0x57d504);});}else{_0x2c7034[_0x2241('0x43')](_0x2241('0x99'),'unreadMessages');_0x2c7034[_0x2241('0x43')](_0x2241('0x9a'),_0x2241('0x9b'));_0x2c7034[_0x2241('0x43')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2c7034[_0x2241('0x43')]('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');_0x2c7034[_0x2241('0x43')](_0x2241('0x9c'));_0x2c7034[_0x2241('0x43')]('c.firstName',_0x2241('0x9d'));_0x2c7034[_0x2241('0x43')](_0x2241('0x9e'),_0x2241('0x9f'));_0x2c7034[_0x2241('0x43')](_0x2241('0xa0'),_0x2241('0xa1'));_0x2c7034[_0x2241('0x43')]('c.phone',_0x2241('0xa2'));_0x2c7034[_0x2241('0x43')](_0x2241('0xa3'),_0x2241('0xa4'));_0x2c7034[_0x2241('0x43')](_0x2241('0xa5'),'Contact.fax');_0x2c7034[_0x2241('0x43')](_0x2241('0xa6'),_0x2241('0xa7'));_0x2c7034[_0x2241('0x43')]('o.internal','Owner.internal');_0x2c7034[_0x2241('0x43')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2241('0x2d'));}if(_0xd92706[_0x2241('0x20')])_0x2c7034['limit'](_0xd92706['limit']);if(_0xd92706[_0x2241('0x1e')])_0x2c7034['offset'](_0xd92706[_0x2241('0x1e')]);return db['sequelize']['query'](_0x2c7034[_0x2241('0x96')](),_0x1d75b4);})[_0x2241('0x27')](function(_0x12e59b){if(_0x12e59b['length']>0x0)_0xcbffea[_0x2241('0x72')]('ui.FaxInteractionId\x20IN\x20?',_[_0x2241('0x2c')](_0x12e59b,'id'));return db[_0x2241('0x95')][_0x2241('0x38')](_0xcbffea['toString'](),_0x1d75b4)['then'](function(_0x4d83ab){var _0x2e07a1=_[_0x2241('0xa8')](_0x4d83ab,_0x2241('0xa9'));var _0x7a8f31=[];_0x12e59b[_0x2241('0x2f')](function(_0x5b788b){_0x7a8f31['push'](updateFaxInteraction(_0x5b788b,_0x5de21,_0x2e07a1));});return BPromise[_0x2241('0xaa')](_0x7a8f31);});});})[_0x2241('0x27')](function(_0x155d46){_0x1f8d70[_0x2241('0xab')]=_0x155d46;return _0x1f8d70;})[_0x2241('0x27')](respondWithFilteredResult(_0x4970af,_0xd92706))['catch'](handleError(_0x4970af,null));};exports[_0x2241('0xac')]=function(_0x28a063,_0x333132){var _0x3c8a1f={'raw':![],'where':{'id':_0x28a063['params']['id']}},_0x36edd6={};_0x36edd6[_0x2241('0x37')]=_[_0x2241('0x6e')](db[_0x2241('0xad')][_0x2241('0x33')]);_0x36edd6[_0x2241('0x38')]=_[_0x2241('0x6e')](_0x28a063[_0x2241('0x38')]);_0x36edd6['filters']=_[_0x2241('0x3b')](_0x36edd6[_0x2241('0x37')],_0x36edd6[_0x2241('0x38')]);_0x3c8a1f[_0x2241('0x3a')]=_[_0x2241('0x3b')](_0x36edd6[_0x2241('0x37')],qs[_0x2241('0x3c')](_0x28a063[_0x2241('0x38')][_0x2241('0x3c')]));_0x3c8a1f['attributes']=_0x3c8a1f[_0x2241('0x3a')]['length']?_0x3c8a1f[_0x2241('0x3a')]:_0x36edd6[_0x2241('0x37')];if(_0x28a063[_0x2241('0x38')][_0x2241('0xae')]){_0x3c8a1f[_0x2241('0xaf')]=[{'all':!![]}];}_0x3c8a1f=_[_0x2241('0x98')]({},_0x3c8a1f,_0x28a063[_0x2241('0xb0')]);return db[_0x2241('0xad')][_0x2241('0x5b')](_0x3c8a1f)[_0x2241('0x27')](handleEntityNotFound(_0x333132,null))['then'](respondWithResult(_0x333132,null))[_0x2241('0x31')](handleError(_0x333132,null));};exports[_0x2241('0xb1')]=function(_0x4cf450,_0x142245){return db[_0x2241('0xad')]['create'](_0x4cf450[_0x2241('0xb2')],{})[_0x2241('0x27')](respondWithResult(_0x142245,0xc9))[_0x2241('0x31')](handleError(_0x142245,null));};exports[_0x2241('0x25')]=function(_0x20c5ed,_0x3c2c86){if(_0x20c5ed[_0x2241('0xb2')]['id']){delete _0x20c5ed['body']['id'];}return db[_0x2241('0xad')][_0x2241('0x5b')]({'where':{'id':_0x20c5ed[_0x2241('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3c2c86,null))[_0x2241('0x27')](saveUpdates(_0x20c5ed[_0x2241('0xb2')],null))[_0x2241('0x27')](respondWithResult(_0x3c2c86,null))[_0x2241('0x31')](handleError(_0x3c2c86,null));};exports['destroy']=function(_0x1b66c2,_0x482a63){return db['FaxInteraction'][_0x2241('0x5b')]({'where':{'id':_0x1b66c2[_0x2241('0xb3')]['id']}})['then'](handleEntityNotFound(_0x482a63,null))[_0x2241('0x27')](removeEntity(_0x482a63,null))['catch'](handleError(_0x482a63,null));};exports[_0x2241('0xb4')]=function(_0x244e61,_0x534b8d){return db[_0x2241('0xad')][_0x2241('0xb4')]()[_0x2241('0x27')](respondWithResult(_0x534b8d,null))[_0x2241('0x31')](handleError(_0x534b8d,null));};exports[_0x2241('0xb5')]=function(_0x5227d0,_0x175540,_0x17df0d){return db[_0x2241('0xb6')][_0x2241('0x5b')]({'where':{'id':_0x5227d0[_0x2241('0xb3')]['id']}})[_0x2241('0x27')](handleEntityNotFound(_0x175540,null))[_0x2241('0x27')](function(_0x57050e){if(_0x57050e){return _0x57050e['addMessage'](_0x5227d0[_0x2241('0xb2')]['ids'],_[_0x2241('0xb7')](_0x5227d0[_0x2241('0xb2')],[_0x2241('0xb8'),'id'])||{});}})[_0x2241('0x27')](respondWithResult(_0x175540,null))[_0x2241('0x31')](handleError(_0x175540,null));};exports[_0x2241('0xb9')]=function(_0x11b5fc,_0x4e88aa,_0x2fff32){var _0x327ca4={'raw':![],'where':{}};var _0x5f0cbc={};var _0x468648={'count':0x0,'rows':[]};return db[_0x2241('0xad')][_0x2241('0xba')]({'where':{'id':_0x11b5fc[_0x2241('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4e88aa,null))[_0x2241('0x27')](function(_0xf72abc){if(_0xf72abc){_0x5f0cbc[_0x2241('0x37')]=_[_0x2241('0x6e')](db[_0x2241('0xb6')][_0x2241('0x33')]);_0x5f0cbc[_0x2241('0x38')]=_['keys'](_0x11b5fc['query']);_0x5f0cbc[_0x2241('0x39')]=_['intersection'](_0x5f0cbc[_0x2241('0x37')],_0x5f0cbc[_0x2241('0x38')]);_0x327ca4[_0x2241('0x3a')]=_[_0x2241('0x3b')](_0x5f0cbc[_0x2241('0x37')],qs[_0x2241('0x3c')](_0x11b5fc['query'][_0x2241('0x3c')]));_0x327ca4[_0x2241('0x3a')]=_0x327ca4[_0x2241('0x3a')][_0x2241('0x5a')]?_0x327ca4[_0x2241('0x3a')]:_0x5f0cbc[_0x2241('0x37')];if(!_0x11b5fc[_0x2241('0x38')]['hasOwnProperty'](_0x2241('0x3e'))){_0x327ca4[_0x2241('0x20')]=qs[_0x2241('0x20')](_0x11b5fc[_0x2241('0x38')][_0x2241('0x20')]);_0x327ca4[_0x2241('0x1e')]=qs[_0x2241('0x1e')](_0x11b5fc[_0x2241('0x38')][_0x2241('0x1e')]);}_0x327ca4['order']=qs[_0x2241('0x40')](_0x11b5fc[_0x2241('0x38')][_0x2241('0x40')]);_0x327ca4[_0x2241('0x72')]=qs[_0x2241('0x39')](_[_0x2241('0x41')](_0x11b5fc[_0x2241('0x38')],_0x5f0cbc['filters']));_0x327ca4[_0x2241('0x72')][_0x2241('0xa9')]=_0xf72abc['id'];if(_0x11b5fc['query']['filter']){_0x327ca4[_0x2241('0x72')]=_[_0x2241('0x98')](_0x327ca4[_0x2241('0x72')],{'$or':_['map'](_0x327ca4['attributes'],function(_0x47613d){var _0x5eb176={};_0x5eb176[_0x47613d]={'$like':'%'+_0x11b5fc[_0x2241('0x38')][_0x2241('0x80')]+'%'};return _0x5eb176;})});}if(_0x11b5fc[_0x2241('0x38')][_0x2241('0xbb')]){var _0x2df790=_0x11b5fc['query'][_0x2241('0xbb')][_0x2241('0x63')](',');var _0x52e6f0={};_0x52e6f0[_0x2df790[0x0]]={'$gte':moment(_0x2df790[0x1])[_0x2241('0xbc')](_0x2241('0xbd'))};_0x327ca4['where']=_['merge'](_0x327ca4[_0x2241('0x72')],_0x52e6f0);}_0x327ca4=_[_0x2241('0x98')]({},_0x327ca4,_0x11b5fc[_0x2241('0xb0')]);return db['FaxMessage'][_0x2241('0x21')]({'where':_0x327ca4[_0x2241('0x72')]})['then'](function(_0x50b3ef){_0x468648[_0x2241('0x21')]=_0x50b3ef;if(_0x11b5fc[_0x2241('0x38')][_0x2241('0xae')]){_0x327ca4[_0x2241('0xaf')]=[{'all':!![]}];}return db[_0x2241('0xb6')][_0x2241('0xbe')](_0x327ca4);})[_0x2241('0x27')](function(_0xbaf5e3){_0x468648[_0x2241('0xab')]=_0xbaf5e3;return _0x468648;});}})[_0x2241('0x27')](respondWithFilteredResult(_0x4e88aa,_0x327ca4))[_0x2241('0x31')](handleError(_0x4e88aa,null));};exports[_0x2241('0xbf')]=function(_0x3c923c,_0x154a03,_0x14e232){return db['FaxInteraction'][_0x2241('0x5b')]({'where':{'id':_0x3c923c['params']['id']}})[_0x2241('0x27')](handleEntityNotFound(_0x154a03,null))['then'](function(_0x37136c){if(_0x37136c){return _0x37136c[_0x2241('0xc0')](_0x3c923c[_0x2241('0xb2')][_0x2241('0xb8')],_['omit'](_0x3c923c[_0x2241('0xb2')],[_0x2241('0xb8'),'id'])||{})[_0x2241('0xc1')](function(){return db['Tag'][_0x2241('0xbe')]({'attributes':['id',_0x2241('0x2a'),_0x2241('0x44')],'where':{'id':_0x3c923c['body'][_0x2241('0xb8')]}});})[_0x2241('0x27')](function(_0x11b843){socket[_0x2241('0xc2')](_0x2241('0xc3'),{'id':Number(_0x3c923c[_0x2241('0xb3')]['id']),'tags':_0x11b843||[]});return{'id':Number(_0x3c923c[_0x2241('0xb3')]['id']),'tags':_0x11b843||[]};});}})[_0x2241('0x27')](respondWithResult(_0x154a03,null))[_0x2241('0x31')](handleError(_0x154a03,null));};exports[_0x2241('0xc4')]=function(_0x3e8048,_0x3063be,_0x1cc39c){return db[_0x2241('0xad')][_0x2241('0x5b')]({'where':{'id':_0x3e8048[_0x2241('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3063be,null))[_0x2241('0x27')](function(_0x1182bd){if(_0x1182bd){return _0x1182bd[_0x2241('0xc4')](_0x3e8048[_0x2241('0x38')][_0x2241('0xb8')]);}})[_0x2241('0x27')](respondWithStatusCode(_0x3063be,null))['catch'](handleError(_0x3063be,null));};exports[_0x2241('0xc5')]=function(_0x543032,_0x1667c2){var _0x5c172d=moment()[_0x2241('0xc6')]()[_0x2241('0x96')]();var _0x5d987b=path[_0x2241('0xc7')](config[_0x2241('0xc8')],_0x2241('0xc9'),_0x2241('0xca'),'tmp');var _0x1ecccf=path[_0x2241('0xc7')](config[_0x2241('0xc8')],_0x2241('0xc9'),_0x2241('0xca'),_0x2241('0xcb'));var _0x32e0a1=path['join'](_0x5d987b,_0x5c172d);var _0xe292fc=util[_0x2241('0xbc')]('transcript-%d-%s.zip',_0x543032[_0x2241('0xb3')]['id'],_0x5c172d);var _0x3bfea5=path['join'](_0x5d987b,_0xe292fc);var _0x4bb31b=[];_0x4bb31b[_0x2241('0x30')]({'model':db[_0x2241('0xcc')],'as':_0x2241('0xcc'),'raw':!![]});var _0xc615fc=[{'model':db[_0x2241('0xb6')],'as':_0x2241('0xcd'),'attributes':['id',_0x2241('0xb2'),_0x2241('0x74')],'include':_0x4bb31b}];return db['FaxInteraction']['find']({'where':{'id':_0x543032['params']['id']},'include':_0xc615fc})[_0x2241('0x27')](handleEntityNotFound(_0x1667c2,null))['then'](function(_0x50f02e){if(_0x50f02e&&_0x50f02e[_0x2241('0xcd')]){var _0xf75caa=_0x50f02e['get']({'plain':!![]});fs['mkdirSync'](_0x32e0a1);for(var _0x2e7ece=0x0;_0x2e7ece<_0xf75caa['Messages'][_0x2241('0x5a')];_0x2e7ece++){var _0x4ee595=_0xf75caa['Messages'][_0x2e7ece][_0x2241('0xcc')];if(_0x4ee595){var _0x4d9cae=path[_0x2241('0xc7')](_0x1ecccf,_0x4ee595[_0x2241('0xce')]);if(fs[_0x2241('0xcf')](_0x4d9cae)){fs['createReadStream'](_0x4d9cae)[_0x2241('0xd0')](fs[_0x2241('0xd1')](path[_0x2241('0xc7')](_0x32e0a1,_0x4ee595[_0x2241('0xce')])));}}}return BPromise[_0x2241('0x8f')]()['then'](function(){return new BPromise(function(_0x15c113,_0x12ea9a){zipdir(_0x32e0a1,{'saveTo':_0x3bfea5},function(_0x29af69,_0x5bb983){if(_0x29af69)return _0x12ea9a(_0x29af69);return _0x15c113(_0x5bb983);});})[_0x2241('0x27')](function(){return new BPromise(function(_0x50a9f5,_0x24fd32){rimraf(_0x32e0a1,function(_0x130b4d){if(_0x130b4d)_0x24fd32(_0x130b4d);return _0x50a9f5();});});})[_0x2241('0x27')](function(){return _0x1667c2['download'](_0x3bfea5,_0xe292fc,function(_0x1e6e93){if(_0x1e6e93){console['log'](_0x2241('0xd2'),_0x1e6e93);}else{fs[_0x2241('0xd3')](_0x3bfea5);}});});});}else{return _0x1667c2[_0x2241('0x1b')](0xc8);}})[_0x2241('0x31')](handleError(_0x1667c2,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index dbef9bf..58ec40f 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 _0xa011=['events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x27deda,_0x300d08){var _0x29c0eb=function(_0x2d9a77){while(--_0x2d9a77){_0x27deda['push'](_0x27deda['shift']());}};_0x29c0eb(++_0x300d08);}(_0xa011,0x17a));var _0x1a01=function(_0x2697a0,_0x4bd9d4){_0x2697a0=_0x2697a0-0x0;var _0x3a24d9=_0xa011[_0x2697a0];return _0x3a24d9;};'use strict';var EventEmitter=require(_0x1a01('0x0'));var FaxInteraction=require(_0x1a01('0x1'))['db'][_0x1a01('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x1a01('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1a01('0x4')](0x0);var events={'afterCreate':_0x1a01('0x5'),'afterUpdate':_0x1a01('0x6'),'afterDestroy':_0x1a01('0x7')};function emitEvent(_0x37b6cf){return function(_0x2f2a35,_0x3da0a0,_0x1c986f){_0x2f2a35['getUsers']({'attributes':['id'],'raw':!![]})[_0x1a01('0x8')](function(_0x4fd65c){_0x2f2a35[_0x1a01('0x9')](_0x1a01('0xa'),_0x4fd65c[_0x1a01('0xb')](function(_0x1c3de4){return{'id':_0x1c3de4['id']};}));return FaxMessage[_0x1a01('0xc')]({'where':{'FaxInteractionId':_0x2f2a35['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1e1e90){_0x2f2a35[_0x1a01('0x9')](_0x1a01('0xd'),_0x1e1e90[_0x1a01('0xe')]);FaxInteractionEvents['emit'](_0x37b6cf+':'+_0x2f2a35['id'],_0x2f2a35);FaxInteractionEvents[_0x1a01('0xf')](_0x37b6cf,_0x2f2a35);_0x1c986f(null);})[_0x1a01('0x10')](_0x1c986f(null));};}for(var e in events){if(events[_0x1a01('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0xb286=['Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','setMaxListeners','save','update','getUsers','then','setDataValue'];(function(_0x3ace8,_0x4bf514){var _0x4968d3=function(_0x2c7386){while(--_0x2c7386){_0x3ace8['push'](_0x3ace8['shift']());}};_0x4968d3(++_0x4bf514);}(_0xb286,0x90));var _0x6b28=function(_0x5d5c36,_0x108b1d){_0x5d5c36=_0x5d5c36-0x0;var _0x5e9148=_0xb286[_0x5d5c36];return _0x5e9148;};'use strict';var EventEmitter=require(_0x6b28('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x6b28('0x1')];var FaxMessage=require(_0x6b28('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6b28('0x3')](0x0);var events={'afterCreate':_0x6b28('0x4'),'afterUpdate':_0x6b28('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5a1c71){return function(_0x2ef5c1,_0x51cde5,_0x347137){_0x2ef5c1[_0x6b28('0x6')]({'attributes':['id'],'raw':!![]})[_0x6b28('0x7')](function(_0x494d2c){_0x2ef5c1[_0x6b28('0x8')](_0x6b28('0x9'),_0x494d2c[_0x6b28('0xa')](function(_0x47e8d3){return{'id':_0x47e8d3['id']};}));return FaxMessage[_0x6b28('0xb')]({'where':{'FaxInteractionId':_0x2ef5c1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6b28('0x7')](function(_0x5befb4){_0x2ef5c1['setDataValue']('unreadMessages',_0x5befb4['length']);FaxInteractionEvents[_0x6b28('0xc')](_0x5a1c71+':'+_0x2ef5c1['id'],_0x2ef5c1);FaxInteractionEvents['emit'](_0x5a1c71,_0x2ef5c1);_0x347137(null);})[_0x6b28('0xd')](_0x347137(null));};}for(var e in events){if(events[_0x6b28('0xe')](e)){var event=events[e];FaxInteraction[_0x6b28('0xf')](e,emitEvent(event));}}module[_0x6b28('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c153c22..0362072 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 _0x58b6=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x39676d,_0x3aa4e1){var _0xb8cc06=function(_0x4d2211){while(--_0x4d2211){_0x39676d['push'](_0x39676d['shift']());}};_0xb8cc06(++_0x3aa4e1);}(_0x58b6,0x103));var _0x658b=function(_0x2d33db,_0x120832){_0x2d33db=_0x2d33db-0x0;var _0x392a86=_0x58b6[_0x2d33db];return _0x392a86;};'use strict';var _=require(_0x658b('0x0'));var util=require(_0x658b('0x1'));var logger=require(_0x658b('0x2'))(_0x658b('0x3'));var moment=require(_0x658b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x658b('0x5'));var rimraf=require(_0x658b('0x6'));var config=require(_0x658b('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x658b('0x8')]=function(_0x3605bf,_0x3efa4a){return _0x3605bf[_0x658b('0x9')](_0x658b('0xa'),attributes,{'tableName':_0x658b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x513344,_0x27d721,_0x5bcda5){if(_0x513344[_0x658b('0xc')](_0x658b('0xd'))){_0x513344['closedAt']=moment()[_0x658b('0xe')](_0x658b('0xf'));}_0x5bcda5(null,_0x513344);}}});}; \ No newline at end of file +var _0xa899=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closedAt'];(function(_0x3cfc6c,_0x5d1fcb){var _0x3e5066=function(_0x4436aa){while(--_0x4436aa){_0x3cfc6c['push'](_0x3cfc6c['shift']());}};_0x3e5066(++_0x5d1fcb);}(_0xa899,0x155));var _0x9a89=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0xa899[_0x2daef6];return _0x62d030;};'use strict';var _=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var logger=require(_0x9a89('0x2'))('api');var moment=require(_0x9a89('0x3'));var BPromise=require(_0x9a89('0x4'));var rp=require(_0x9a89('0x5'));var fs=require('fs');var path=require(_0x9a89('0x6'));var rimraf=require(_0x9a89('0x7'));var config=require(_0x9a89('0x8'));var attributes=require(_0x9a89('0x9'));module[_0x9a89('0xa')]=function(_0x126099,_0x413d15){return _0x126099[_0x9a89('0xb')](_0x9a89('0xc'),attributes,{'tableName':_0x9a89('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ab174,_0x4d2b72,_0xe61171){if(_0x5ab174[_0x9a89('0xe')]('closed')){_0x5ab174[_0x9a89('0xf')]=moment()['format'](_0x9a89('0x10'));}_0xe61171(null,_0x5ab174);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 587e492..149a098 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 _0xde84=['code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','raw','attributes','then','stringify','catch','AddTagsToFaxInteraction','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x1a0a72,_0x5c8ef8){var _0x3e39a6=function(_0x160137){while(--_0x160137){_0x1a0a72['push'](_0x1a0a72['shift']());}};_0x3e39a6(++_0x5c8ef8);}(_0xde84,0x167));var _0x4de8=function(_0x53ca64,_0x1928ab){_0x53ca64=_0x53ca64-0x0;var _0x9b8d8f=_0xde84[_0x53ca64];return _0x9b8d8f;};'use strict';var _=require(_0x4de8('0x0'));var util=require(_0x4de8('0x1'));var moment=require('moment');var BPromise=require(_0x4de8('0x2'));var rs=require(_0x4de8('0x3'));var fs=require('fs');var Redis=require(_0x4de8('0x4'));var db=require(_0x4de8('0x5'))['db'];var utils=require(_0x4de8('0x6'));var logger=require(_0x4de8('0x7'))('rpc');var config=require(_0x4de8('0x8'));var jayson=require(_0x4de8('0x9'));var client=jayson[_0x4de8('0xa')][_0x4de8('0xb')]({'port':0x232a});config[_0x4de8('0xc')]=_[_0x4de8('0xd')](config[_0x4de8('0xc')],{'host':_0x4de8('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de8('0xc')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x261ad5,_0xc4480b,_0x2218b0){return new BPromise(function(_0xe8face,_0x3aba70){return client[_0x4de8('0xf')](_0x261ad5,_0x2218b0)['then'](function(_0x8ac498){logger[_0x4de8('0x10')](_0x4de8('0x11'),_0xc4480b,'request\x20sent');logger[_0x4de8('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xc4480b,_0x4de8('0x13'),JSON['stringify'](_0x8ac498));if(_0x8ac498['error']){if(_0x8ac498[_0x4de8('0x14')][_0x4de8('0x15')]===0x1f4){logger['error'](_0x4de8('0x11'),_0xc4480b,_0x8ac498[_0x4de8('0x14')]['message']);return _0x3aba70(_0x8ac498['error'][_0x4de8('0x16')]);}logger['error'](_0x4de8('0x11'),_0xc4480b,_0x8ac498[_0x4de8('0x14')][_0x4de8('0x16')]);return _0xe8face(_0x8ac498[_0x4de8('0x14')][_0x4de8('0x16')]);}else{logger[_0x4de8('0x10')](_0x4de8('0x11'),_0xc4480b,'request\x20sent');_0xe8face(_0x8ac498[_0x4de8('0x17')][_0x4de8('0x16')]);}})['catch'](function(_0x275bb9){logger[_0x4de8('0x14')]('FaxInteraction,\x20%s,\x20%s',_0xc4480b,_0x275bb9);_0x3aba70(_0x275bb9);});});}exports[_0x4de8('0x18')]=function(_0x4c4730){var _0x411f86=this;return new Promise(function(_0x443009,_0x4b5731){return db[_0x4de8('0x19')]['update'](_0x4c4730[_0x4de8('0x1a')],{'raw':_0x4c4730[_0x4de8('0x1b')]?_0x4c4730[_0x4de8('0x1b')][_0x4de8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c4730[_0x4de8('0x1b')]?_0x4c4730[_0x4de8('0x1b')]['where']||null:null,'attributes':_0x4c4730[_0x4de8('0x1b')]?_0x4c4730[_0x4de8('0x1b')][_0x4de8('0x1d')]||null:null,'limit':_0x4c4730[_0x4de8('0x1b')]?_0x4c4730[_0x4de8('0x1b')]['limit']||null:null})[_0x4de8('0x1e')](function(_0x3507ef){logger['info'](_0x4de8('0x18'),_0x4c4730);logger[_0x4de8('0x12')](_0x4de8('0x18'),_0x4c4730,JSON[_0x4de8('0x1f')](_0x3507ef));_0x443009(_0x3507ef);})[_0x4de8('0x20')](function(_0x473d96){logger[_0x4de8('0x14')]('UpdateFaxInteraction',_0x473d96[_0x4de8('0x16')],_0x4c4730);_0x4b5731(_0x411f86[_0x4de8('0x14')](0x1f4,_0x473d96['message']));});});};exports[_0x4de8('0x21')]=function(_0x4c6184){return new Promise(function(_0x3dea55,_0x5421ee){return db['FaxInteraction']['find']({'where':_0x4c6184[_0x4de8('0x1b')]?_0x4c6184[_0x4de8('0x1b')]['where']||null:null})[_0x4de8('0x1e')](function(_0xa08f64){if(_0xa08f64){return _0xa08f64[_0x4de8('0x22')](_0x4c6184['body'][_0x4de8('0x23')],_['omit'](_0x4c6184['body'],[_0x4de8('0x23'),'id'])||{});}})[_0x4de8('0x24')](function(_0x1a1a01){logger['info'](_0x4de8('0x25'),_0x4c6184);logger[_0x4de8('0x12')](_0x4de8('0x25'),_0x4c6184,JSON[_0x4de8('0x1f')](_0x1a1a01));_0x3dea55(_0x1a1a01);})['catch'](function(_0x165628){logger[_0x4de8('0x14')](_0x4de8('0x25'),_0x165628[_0x4de8('0x16')],_0x4c6184);_0x5421ee(_this[_0x4de8('0x14')](0x1f4,_0x165628[_0x4de8('0x16')]));});});}; \ No newline at end of file +var _0x1977=['debug','request\x20sent','code','error','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./faxInteraction.socket','register','request','then'];(function(_0x25d74c,_0x2b73d0){var _0x39c281=function(_0x4076e9){while(--_0x4076e9){_0x25d74c['push'](_0x25d74c['shift']());}};_0x39c281(++_0x2b73d0);}(_0x1977,0x189));var _0x7197=function(_0x5d0185,_0x341ba9){_0x5d0185=_0x5d0185-0x0;var _0x383e76=_0x1977[_0x5d0185];return _0x383e76;};'use strict';var _=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var moment=require(_0x7197('0x2'));var BPromise=require(_0x7197('0x3'));var rs=require(_0x7197('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7197('0x5'));var logger=require(_0x7197('0x6'))('rpc');var config=require(_0x7197('0x7'));var jayson=require(_0x7197('0x8'));var client=jayson[_0x7197('0x9')][_0x7197('0xa')]({'port':0x232a});config[_0x7197('0xb')]=_[_0x7197('0xc')](config[_0x7197('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7197('0xb')]));require(_0x7197('0xd'))[_0x7197('0xe')](socket);function respondWithRpcPromise(_0x38798e,_0x2d81bf,_0x1f93e6){return new BPromise(function(_0x5dabcb,_0x3dd4dd){return client[_0x7197('0xf')](_0x38798e,_0x1f93e6)[_0x7197('0x10')](function(_0x22cdea){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x2d81bf,'request\x20sent');logger[_0x7197('0x11')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x2d81bf,_0x7197('0x12'),JSON['stringify'](_0x22cdea));if(_0x22cdea['error']){if(_0x22cdea['error'][_0x7197('0x13')]===0x1f4){logger[_0x7197('0x14')](_0x7197('0x15'),_0x2d81bf,_0x22cdea[_0x7197('0x14')]['message']);return _0x3dd4dd(_0x22cdea[_0x7197('0x14')]['message']);}logger['error'](_0x7197('0x15'),_0x2d81bf,_0x22cdea[_0x7197('0x14')][_0x7197('0x16')]);return _0x5dabcb(_0x22cdea['error']['message']);}else{logger[_0x7197('0x17')](_0x7197('0x15'),_0x2d81bf,_0x7197('0x12'));_0x5dabcb(_0x22cdea[_0x7197('0x18')]['message']);}})[_0x7197('0x19')](function(_0x28d1b2){logger[_0x7197('0x14')](_0x7197('0x15'),_0x2d81bf,_0x28d1b2);_0x3dd4dd(_0x28d1b2);});});}exports[_0x7197('0x1a')]=function(_0x1c65a1){var _0x41d47e=this;return new Promise(function(_0x3a5273,_0x2912a2){return db[_0x7197('0x1b')][_0x7197('0x1c')](_0x1c65a1[_0x7197('0x1d')],{'raw':_0x1c65a1[_0x7197('0x1e')]?_0x1c65a1[_0x7197('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c65a1[_0x7197('0x1e')]?_0x1c65a1[_0x7197('0x1e')][_0x7197('0x1f')]||null:null,'attributes':_0x1c65a1[_0x7197('0x1e')]?_0x1c65a1[_0x7197('0x1e')][_0x7197('0x20')]||null:null,'limit':_0x1c65a1[_0x7197('0x1e')]?_0x1c65a1['options'][_0x7197('0x21')]||null:null})['then'](function(_0x4c8990){logger[_0x7197('0x17')](_0x7197('0x1a'),_0x1c65a1);logger[_0x7197('0x11')](_0x7197('0x1a'),_0x1c65a1,JSON['stringify'](_0x4c8990));_0x3a5273(_0x4c8990);})[_0x7197('0x19')](function(_0x3cd69d){logger['error']('UpdateFaxInteraction',_0x3cd69d[_0x7197('0x16')],_0x1c65a1);_0x2912a2(_0x41d47e[_0x7197('0x14')](0x1f4,_0x3cd69d['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x28dbff){return new Promise(function(_0x15cf78,_0x1ec2be){return db['FaxInteraction'][_0x7197('0x22')]({'where':_0x28dbff['options']?_0x28dbff['options']['where']||null:null})['then'](function(_0x4e5410){if(_0x4e5410){return _0x4e5410[_0x7197('0x23')](_0x28dbff['body'][_0x7197('0x24')],_[_0x7197('0x25')](_0x28dbff[_0x7197('0x1d')],['ids','id'])||{});}})[_0x7197('0x26')](function(_0x330af8){logger[_0x7197('0x17')]('AddTags',_0x28dbff);logger[_0x7197('0x11')](_0x7197('0x27'),_0x28dbff,JSON[_0x7197('0x28')](_0x330af8));_0x15cf78(_0x330af8);})[_0x7197('0x19')](function(_0x1aebe6){logger[_0x7197('0x14')](_0x7197('0x27'),_0x1aebe6[_0x7197('0x16')],_0x28dbff);_0x1ec2be(_this['error'](0x1f4,_0x1aebe6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e0f7cd7..55f4ef1 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 _0x954d=['register','faxInteraction:','save','remove','emit'];(function(_0x1b1a3b,_0x52a88a){var _0x385347=function(_0x4ca60a){while(--_0x4ca60a){_0x1b1a3b['push'](_0x1b1a3b['shift']());}};_0x385347(++_0x52a88a);}(_0x954d,0x1d3));var _0xd954=function(_0x11a1a6,_0x3bb701){_0x11a1a6=_0x11a1a6-0x0;var _0x38f91e=_0x954d[_0x11a1a6];return _0x38f91e;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xd954('0x0'),_0xd954('0x1'),'update'];function createListener(_0x165675,_0x3c0fc2){return function(_0x26a76c){_0x3c0fc2[_0xd954('0x2')](_0x165675,_0x26a76c);};}function removeListener(_0x3faa49,_0x459890){return function(){FaxInteractionEvents['removeListener'](_0x3faa49,_0x459890);};}exports[_0xd954('0x3')]=function(_0x3c2b88){for(var _0x14a3e4=0x0,_0x54ef18=events['length'];_0x14a3e4<_0x54ef18;_0x14a3e4++){var _0x3b0788=events[_0x14a3e4];var _0x480022=createListener(_0xd954('0x4')+_0x3b0788,_0x3c2b88);FaxInteractionEvents['on'](_0x3b0788,_0x480022);}}; \ No newline at end of file +var _0xa839=['removeListener','length','faxInteraction:','save','remove'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0xa839,0x170));var _0x9a83=function(_0x4872eb,_0x4b343c){_0x4872eb=_0x4872eb-0x0;var _0x2f6ead=_0xa839[_0x4872eb];return _0x2f6ead;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x9a83('0x0'),_0x9a83('0x1'),'update'];function createListener(_0x287aa8,_0x1789f9){return function(_0x2707e7){_0x1789f9['emit'](_0x287aa8,_0x2707e7);};}function removeListener(_0xdda210,_0x51a55b){return function(){FaxInteractionEvents[_0x9a83('0x2')](_0xdda210,_0x51a55b);};}exports['register']=function(_0x492b6e){for(var _0x1893a8=0x0,_0x4a2496=events[_0x9a83('0x3')];_0x1893a8<_0x4a2496;_0x1893a8++){var _0xc946f3=events[_0x1893a8];var _0x344068=createListener(_0x9a83('0x4')+_0xc946f3,_0x492b6e);FaxInteractionEvents['on'](_0xc946f3,_0x344068);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 4c9184e..ec30d2a 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 _0x60f2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','tracked','fax','update','delete','faxinteraction:destroy','/:id/tags','multer','util','path'];(function(_0x57536a,_0x28439c){var _0x32dcda=function(_0x211638){while(--_0x211638){_0x57536a['push'](_0x57536a['shift']());}};_0x32dcda(++_0x28439c);}(_0x60f2,0x1bd));var _0x260f=function(_0xe2b65b,_0x290494){_0xe2b65b=_0xe2b65b-0x0;var _0x1395f5=_0x60f2[_0xe2b65b];return _0x1395f5;};'use strict';var multer=require(_0x260f('0x0'));var util=require(_0x260f('0x1'));var path=require(_0x260f('0x2'));var timeout=require('connect-timeout');var express=require(_0x260f('0x3'));var router=express[_0x260f('0x4')]();var fs_extra=require(_0x260f('0x5'));var auth=require(_0x260f('0x6'));var interaction=require(_0x260f('0x7'));var config=require('../../config/environment');var controller=require(_0x260f('0x8'));router[_0x260f('0x9')]('/',auth[_0x260f('0xa')](),controller[_0x260f('0xb')]);router[_0x260f('0x9')](_0x260f('0xc'),auth['isAuthenticated'](),controller[_0x260f('0xd')]);router[_0x260f('0x9')](_0x260f('0xe'),auth[_0x260f('0xa')](),controller[_0x260f('0xf')]);router[_0x260f('0x9')](_0x260f('0x10'),auth[_0x260f('0xa')](),controller['getMessages']);router[_0x260f('0x9')](_0x260f('0x11'),auth[_0x260f('0xa')](),controller[_0x260f('0x12')]);router['post']('/',auth[_0x260f('0xa')](),controller[_0x260f('0x13')]);router[_0x260f('0x14')](_0x260f('0x10'),auth['isAuthenticated'](),controller[_0x260f('0x15')]);router['post']('/:id/tags',auth[_0x260f('0xa')](),interaction[_0x260f('0x16')](_0x260f('0x17'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0x260f('0xe'),auth[_0x260f('0xa')](),interaction[_0x260f('0x16')](_0x260f('0x17'),'faxinteraction:update'),controller[_0x260f('0x18')]);router[_0x260f('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x260f('0x16')](_0x260f('0x17'),_0x260f('0x1a')),controller['destroy']);router['delete'](_0x260f('0x1b'),auth[_0x260f('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x46b9=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','index','/describe','/:id','show','/:id/messages','isAuthenticated','getMessages','download','post','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x46b9,0x7b));var _0x946b=function(_0x332861,_0x5c1261){_0x332861=_0x332861-0x0;var _0x3b49a8=_0x46b9[_0x332861];return _0x3b49a8;};'use strict';var multer=require(_0x946b('0x0'));var util=require(_0x946b('0x1'));var path=require('path');var timeout=require(_0x946b('0x2'));var express=require(_0x946b('0x3'));var router=express['Router']();var fs_extra=require(_0x946b('0x4'));var auth=require(_0x946b('0x5'));var interaction=require(_0x946b('0x6'));var config=require('../../config/environment');var controller=require(_0x946b('0x7'));router[_0x946b('0x8')]('/',auth['isAuthenticated'](),controller[_0x946b('0x9')]);router[_0x946b('0x8')](_0x946b('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x946b('0xb'),auth['isAuthenticated'](),controller[_0x946b('0xc')]);router[_0x946b('0x8')](_0x946b('0xd'),auth[_0x946b('0xe')](),controller[_0x946b('0xf')]);router[_0x946b('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x946b('0x10')]);router[_0x946b('0x11')]('/',auth[_0x946b('0xe')](),controller['create']);router['post'](_0x946b('0xd'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x946b('0x12'),auth[_0x946b('0xe')](),interaction[_0x946b('0x13')](_0x946b('0x14'),_0x946b('0x15')),controller[_0x946b('0x16')]);router[_0x946b('0x17')](_0x946b('0xb'),auth[_0x946b('0xe')](),interaction['tracked'](_0x946b('0x14'),_0x946b('0x18')),controller[_0x946b('0x19')]);router['delete'](_0x946b('0xb'),auth[_0x946b('0xe')](),interaction[_0x946b('0x13')](_0x946b('0x14'),_0x946b('0x1a')),controller[_0x946b('0x1b')]);router[_0x946b('0x1c')](_0x946b('0x12'),auth[_0x946b('0xe')](),controller[_0x946b('0x1d')]);module[_0x946b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 21a2d14..68e2b30 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 _0xb28a=['BOOLEAN','DATE','exports','TEXT'];(function(_0x9ebf33,_0x3e4a70){var _0x50c521=function(_0x38702a){while(--_0x38702a){_0x9ebf33['push'](_0x9ebf33['shift']());}};_0x50c521(++_0x3e4a70);}(_0xb28a,0x166));var _0xab28=function(_0x14fa94,_0x5da10b){_0x14fa94=_0x14fa94-0x0;var _0x3f1bfe=_0xb28a[_0x14fa94];return _0x3f1bfe;};'use strict';var Sequelize=require('sequelize');module[_0xab28('0x0')]={'body':{'type':Sequelize[_0xab28('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xab28('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xab28('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xab28('0x3')]}}; \ No newline at end of file +var _0x9099=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x9099,0x1ac));var _0x9909=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x9099[_0x205e5a];return _0x10da58;};'use strict';var Sequelize=require(_0x9909('0x0'));module['exports']={'body':{'type':Sequelize[_0x9909('0x1')](_0x9909('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9909('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9909('0x4')]('in',_0x9909('0x5')),'defaultValue':_0x9909('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x9909('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x9909('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8fbe6ed..cf36d93 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 _0xe20d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','find','update','body','describe','read','readAt','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','format','channel','motionChannel','accept','EventManager','fax-interactions','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SIP/%s','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','files','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe20d,0x7b));var _0xde20=function(_0x4563b6,_0x2611c5){_0x4563b6=_0x4563b6-0x0;var _0xa7e08c=_0xe20d[_0x4563b6];return _0xa7e08c;};'use strict';var emlformat=require(_0xde20('0x0'));var rimraf=require(_0xde20('0x1'));var zipdir=require(_0xde20('0x2'));var jsonpatch=require(_0xde20('0x3'));var rp=require(_0xde20('0x4'));var moment=require(_0xde20('0x5'));var BPromise=require(_0xde20('0x6'));var Mustache=require(_0xde20('0x7'));var util=require(_0xde20('0x8'));var path=require(_0xde20('0x9'));var sox=require(_0xde20('0xa'));var csv=require(_0xde20('0xb'));var ejs=require(_0xde20('0xc'));var fs=require('fs');var fs_extra=require(_0xde20('0xd'));var _=require(_0xde20('0xe'));var squel=require('squel');var crypto=require(_0xde20('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xde20('0x10'));var toCsv=require('to-csv');var querystring=require(_0xde20('0x11'));var Papa=require('papaparse');var Redis=require(_0xde20('0x12'));var authService=require(_0xde20('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xde20('0x14'));var hardwareService=require(_0xde20('0x15'));var logger=require(_0xde20('0x16'))(_0xde20('0x17'));var utils=require(_0xde20('0x18'));var config=require(_0xde20('0x19'));var licenseUtil=require(_0xde20('0x1a'));var db=require(_0xde20('0x1b'))['db'];config[_0xde20('0x1c')]=_[_0xde20('0x1d')](config[_0xde20('0x1c')],{'host':_0xde20('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xde20('0x1f'))[_0xde20('0x20')](socket);var jayson=require(_0xde20('0x21'));var client=jayson[_0xde20('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xde20('0x22')][_0xde20('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x55b86e,_0x4848e3,_0xe9b0da,_0x56b0f2){return new BPromise(function(_0x3dfdca,_0x2abbc8){var _0x641df4=_0x56b0f2||client;return _0x641df4[_0xde20('0x24')](_0x55b86e,_0xe9b0da)[_0xde20('0x25')](function(_0x288f00){logger[_0xde20('0x26')](_0xde20('0x27'),_0x4848e3,_0xde20('0x28'));logger['debug'](_0xde20('0x29'),_0x4848e3,_0xde20('0x28'),JSON[_0xde20('0x2a')](_0x288f00));if(_0x288f00[_0xde20('0x2b')]){if(_0x288f00[_0xde20('0x2b')]['code']===0x1f4){logger[_0xde20('0x2b')](_0xde20('0x27'),_0x4848e3,_0x288f00['error'][_0xde20('0x2c')]);return _0x2abbc8(_0x288f00[_0xde20('0x2b')][_0xde20('0x2c')]);}logger[_0xde20('0x2b')](_0xde20('0x27'),_0x4848e3,_0x288f00['error'][_0xde20('0x2c')]);return _0x3dfdca(_0x288f00['error'][_0xde20('0x2c')]);}else{logger[_0xde20('0x26')]('FaxMessage,\x20%s,\x20%s',_0x4848e3,_0xde20('0x28'));_0x3dfdca(_0x288f00['result'][_0xde20('0x2c')]);}})[_0xde20('0x2d')](function(_0x12908f){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4848e3,_0x12908f);_0x2abbc8(_0x12908f);});});}function respondWithStatusCode(_0x191b25,_0x33cc71){_0x33cc71=_0x33cc71||0xcc;return function(_0x17e184){if(_0x17e184){return _0x191b25[_0xde20('0x2e')](_0x33cc71);}return _0x191b25[_0xde20('0x2f')](_0x33cc71)[_0xde20('0x30')]();};}function respondWithResult(_0x1cd20f,_0x610e12){_0x610e12=_0x610e12||0xc8;return function(_0x408793){if(_0x408793){return _0x1cd20f[_0xde20('0x2f')](_0x610e12)['json'](_0x408793);}};}function respondWithFilteredResult(_0x5ac1db,_0x5c7b27){return function(_0x30fa74){if(_0x30fa74){var _0x1f2d1f=typeof _0x5c7b27[_0xde20('0x31')]===_0xde20('0x32')&&typeof _0x5c7b27[_0xde20('0x33')]===_0xde20('0x32');var _0x50c13c=_0x30fa74[_0xde20('0x34')];var _0x17c249=_0x1f2d1f?0x0:_0x5c7b27[_0xde20('0x31')];var _0x54265f=_0x1f2d1f?_0x30fa74[_0xde20('0x34')]:_0x5c7b27[_0xde20('0x31')]+_0x5c7b27[_0xde20('0x33')];var _0x383823;if(_0x54265f>=_0x50c13c){_0x54265f=_0x50c13c;_0x383823=0xc8;}else{_0x383823=0xce;}_0x5ac1db[_0xde20('0x2f')](_0x383823);return _0x5ac1db[_0xde20('0x35')](_0xde20('0x36'),_0x17c249+'-'+_0x54265f+'/'+_0x50c13c)[_0xde20('0x37')](_0x30fa74);}return null;};}function patchUpdates(_0x35543f){return function(_0x2a74f6){try{jsonpatch['apply'](_0x2a74f6,_0x35543f,!![]);}catch(_0x59b2be){return BPromise[_0xde20('0x38')](_0x59b2be);}return _0x2a74f6[_0xde20('0x39')]();};}function saveUpdates(_0xf11712,_0x539ce4){return function(_0x32a930){if(_0x32a930){return _0x32a930['update'](_0xf11712)[_0xde20('0x25')](function(_0x2cbbed){return _0x2cbbed;});}return null;};}function removeEntity(_0x1c6b0a,_0x117e4c){return function(_0x8015c9){if(_0x8015c9){return _0x8015c9[_0xde20('0x3a')]()[_0xde20('0x25')](function(){_0x1c6b0a[_0xde20('0x2f')](0xcc)[_0xde20('0x30')]();});}};}function handleEntityNotFound(_0x49a9f4,_0x2d7db0){return function(_0x5208f5){if(!_0x5208f5){_0x49a9f4['sendStatus'](0x194);}return _0x5208f5;};}function handleError(_0x29eb6f,_0x1829c8){_0x1829c8=_0x1829c8||0x1f4;return function(_0x108c4c){logger[_0xde20('0x2b')](_0x108c4c[_0xde20('0x3b')]);if(_0x108c4c['name']){delete _0x108c4c[_0xde20('0x3c')];}_0x29eb6f['status'](_0x1829c8)[_0xde20('0x3d')](_0x108c4c);};}exports[_0xde20('0x3e')]=function(_0x17fa3b,_0x26f57e){var _0x223124={},_0x1ad33c={},_0x76e97={'count':0x0,'rows':[]};var _0x59fada=_[_0xde20('0x3f')](db[_0xde20('0x40')][_0xde20('0x41')],function(_0x59e4ab){return{'name':_0x59e4ab[_0xde20('0x42')],'type':_0x59e4ab['type'][_0xde20('0x43')]};});_0x1ad33c[_0xde20('0x44')]=_[_0xde20('0x3f')](_0x59fada,_0xde20('0x3c'));_0x1ad33c[_0xde20('0x45')]=_['keys'](_0x17fa3b['query']);_0x1ad33c['filters']=_[_0xde20('0x46')](_0x1ad33c['model'],_0x1ad33c[_0xde20('0x45')]);_0x223124[_0xde20('0x47')]=_[_0xde20('0x46')](_0x1ad33c[_0xde20('0x44')],qs[_0xde20('0x48')](_0x17fa3b[_0xde20('0x45')][_0xde20('0x48')]));_0x223124['attributes']=_0x223124[_0xde20('0x47')]['length']?_0x223124[_0xde20('0x47')]:_0x1ad33c[_0xde20('0x44')];if(!_0x17fa3b['query'][_0xde20('0x49')](_0xde20('0x4a'))){_0x223124[_0xde20('0x33')]=qs[_0xde20('0x33')](_0x17fa3b['query'][_0xde20('0x33')]);_0x223124[_0xde20('0x31')]=qs['offset'](_0x17fa3b['query'][_0xde20('0x31')]);}_0x223124[_0xde20('0x4b')]=qs[_0xde20('0x4c')](_0x17fa3b[_0xde20('0x45')][_0xde20('0x4c')]);_0x223124[_0xde20('0x4d')]=qs[_0xde20('0x4e')](_[_0xde20('0x4f')](_0x17fa3b[_0xde20('0x45')],_0x1ad33c[_0xde20('0x4e')]),_0x59fada);if(_0x17fa3b[_0xde20('0x45')][_0xde20('0x50')]){_0x223124[_0xde20('0x4d')]=_[_0xde20('0x51')](_0x223124['where'],{'$or':_[_0xde20('0x3f')](_0x59fada,function(_0x255fc8){if(_0x255fc8['type']!==_0xde20('0x52')){var _0x54aa7a={};_0x54aa7a[_0x255fc8[_0xde20('0x3c')]]={'$like':'%'+_0x17fa3b[_0xde20('0x45')][_0xde20('0x50')]+'%'};return _0x54aa7a;}})});}_0x223124=_[_0xde20('0x51')]({},_0x223124,_0x17fa3b[_0xde20('0x53')]);var _0x2638c7={'where':_0x223124[_0xde20('0x4d')]};return db[_0xde20('0x40')]['count'](_0x2638c7)['then'](function(_0x280f78){_0x76e97[_0xde20('0x34')]=_0x280f78;if(_0x17fa3b[_0xde20('0x45')][_0xde20('0x54')]){_0x223124['include']=[{'all':!![]}];}return db[_0xde20('0x40')][_0xde20('0x55')](_0x223124);})[_0xde20('0x25')](function(_0x5019a6){_0x76e97[_0xde20('0x56')]=_0x5019a6;return _0x76e97;})[_0xde20('0x25')](respondWithFilteredResult(_0x26f57e,_0x223124))['catch'](handleError(_0x26f57e,null));};exports['show']=function(_0x703441,_0x336323){var _0x3c735c={'raw':!![],'where':{'id':_0x703441[_0xde20('0x57')]['id']}},_0x345346={};_0x345346[_0xde20('0x44')]=_['keys'](db[_0xde20('0x40')][_0xde20('0x41')]);_0x345346[_0xde20('0x45')]=_[_0xde20('0x58')](_0x703441['query']);_0x345346['filters']=_[_0xde20('0x46')](_0x345346[_0xde20('0x44')],_0x345346[_0xde20('0x45')]);_0x3c735c['attributes']=_[_0xde20('0x46')](_0x345346[_0xde20('0x44')],qs[_0xde20('0x48')](_0x703441[_0xde20('0x45')][_0xde20('0x48')]));_0x3c735c[_0xde20('0x47')]=_0x3c735c[_0xde20('0x47')]['length']?_0x3c735c['attributes']:_0x345346[_0xde20('0x44')];if(_0x703441[_0xde20('0x45')][_0xde20('0x54')]){_0x3c735c['include']=[{'all':!![]}];}_0x3c735c=_[_0xde20('0x51')]({},_0x3c735c,_0x703441[_0xde20('0x53')]);return db[_0xde20('0x40')][_0xde20('0x59')](_0x3c735c)['then'](handleEntityNotFound(_0x336323,null))[_0xde20('0x25')](respondWithResult(_0x336323,null))[_0xde20('0x2d')](handleError(_0x336323,null));};exports[_0xde20('0x5a')]=function(_0x3ba1a0,_0x32d4e8){if(_0x3ba1a0[_0xde20('0x5b')]['id']){delete _0x3ba1a0['body']['id'];}return db['FaxMessage'][_0xde20('0x59')]({'where':{'id':_0x3ba1a0[_0xde20('0x57')]['id']}})[_0xde20('0x25')](handleEntityNotFound(_0x32d4e8,null))[_0xde20('0x25')](saveUpdates(_0x3ba1a0['body'],null))[_0xde20('0x25')](respondWithResult(_0x32d4e8,null))['catch'](handleError(_0x32d4e8,null));};exports[_0xde20('0x3a')]=function(_0x437165,_0x3df188){return db[_0xde20('0x40')][_0xde20('0x59')]({'where':{'id':_0x437165[_0xde20('0x57')]['id']}})[_0xde20('0x25')](handleEntityNotFound(_0x3df188,null))['then'](removeEntity(_0x3df188,null))[_0xde20('0x2d')](handleError(_0x3df188,null));};exports[_0xde20('0x5c')]=function(_0x4e4c6d,_0x10eb28){return db[_0xde20('0x40')]['describe']()[_0xde20('0x25')](respondWithResult(_0x10eb28,null))['catch'](handleError(_0x10eb28,null));};var interaction_log=require(_0xde20('0x16'))('fax-interactions');exports['accept']=function(_0x2d9c3b,_0x53f3a0,_0x3f590b){var _0x430a88={'agent':{},'channel':'fax'};if(_0x2d9c3b[_0xde20('0x5b')]['id']){delete _0x2d9c3b[_0xde20('0x5b')]['id'];}_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x5d')]=!![];_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x5f')]=_0x2d9c3b['body'][_0xde20('0x5f')]||_0x2d9c3b[_0xde20('0x60')]['id'];_0x430a88['agent']['id']=_0x2d9c3b['body'][_0xde20('0x5f')];return db['FaxMessage'][_0xde20('0x59')]({'where':{'id':_0x2d9c3b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53f3a0,null))[_0xde20('0x25')](saveUpdates(_0x2d9c3b[_0xde20('0x5b')],null))[_0xde20('0x25')](function(_0x58f937){if(_0x58f937){_0x430a88[_0xde20('0x2c')]=_0x58f937[_0xde20('0x61')]({'plain':!![]});return db[_0xde20('0x62')]['find']({'where':{'id':_0x58f937[_0xde20('0x63')]}});}return null;})[_0xde20('0x25')](handleEntityNotFound(_0x53f3a0,null))[_0xde20('0x25')](function(_0x424050){if(_0x424050){return _0x424050[_0xde20('0x5a')]({'UserId':_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x5f')],'read1stAt':_[_0xde20('0x64')](_0x424050[_0xde20('0x65')])?moment()['format'](_0xde20('0x66')):undefined});}return null;})['then'](function(_0x17dbbf){if(_0x17dbbf){_0x430a88[_0xde20('0x67')]=_0x17dbbf['get']({'plain':!![]});interaction_log[_0xde20('0x26')](_0xde20('0x68'),_0x2d9c3b[_0xde20('0x60')]['id'],_0x2d9c3b['user']['name'],_0x2d9c3b[_0xde20('0x60')]['role'],_0x430a88['interaction']['id'],_0x2d9c3b[_0xde20('0x5b')]?JSON['stringify'](_0x2d9c3b['body']):'null');return respondWithRpcPromise(_0xde20('0x69'),_0xde20('0x6a'),_0x430a88);}return null;})['then'](function(_0x35393b){var _0x442c23='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x35393b[_0xde20('0x2c')][_0xde20('0x6b')];return db['sequelize'][_0xde20('0x45')](_0x442c23,{'type':db['Sequelize'][_0xde20('0x6c')][_0xde20('0x6d')],'raw':!![]})[_0xde20('0x25')](function(_0x2e6a6d){return _0x2e6a6d;});})[_0xde20('0x25')](function(_0x2a27dc){if(_0x2a27dc){_0x430a88['message']['contact']=_0x2a27dc[0x0];if(!_0x2d9c3b[_0xde20('0x5b')]['UserId'])return;return db[_0xde20('0x6e')][_0xde20('0x59')]({'where':{'id':_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x5f')],'role':_0xde20('0x6f')},'attributes':['id',_0xde20('0x3c'),_0xde20('0x70'),_0xde20('0x71'),_0xde20('0x72')],'raw':!![]});}return null;})['then'](function(_0x36691d){if(!_0x36691d)return null;_0x430a88[_0xde20('0x2c')][_0xde20('0x6f')]=_0x36691d;return _0x430a88;})[_0xde20('0x25')](function(_0x2ba5f8){if(_0x2ba5f8){if(_0x2d9c3b[_0xde20('0x5b')][_0xde20('0x73')]){_0x430a88[_0xde20('0x2c')][_0xde20('0x74')]=util[_0xde20('0x75')]('SIP/%s',_0x2d9c3b[_0xde20('0x60')]['name']);_0x430a88['message'][_0xde20('0x76')]=_0x430a88[_0xde20('0x76')];_0x430a88[_0xde20('0x2c')][_0xde20('0x77')]=_0x430a88[_0xde20('0x76')];_0x430a88['message']['event']=_0xde20('0x78');return respondWithRpcPromise('EventManager',_0xde20('0x79'),{'event':'acceptmessage','message':_0x430a88[_0xde20('0x2c')]},client9002)[_0xde20('0x25')](function(){return _0x430a88;});}return _0x430a88;}return null;})['then'](respondWithResult(_0x53f3a0,null))[_0xde20('0x2d')](handleError(_0x53f3a0,null));};var interaction_log=require(_0xde20('0x16'))(_0xde20('0x7a'));exports[_0xde20('0x38')]=function(_0xb5c191,_0x42ce62,_0x54b13a){var _0x2ef31b={'agent':{},'channel':_0xde20('0x7b')};if(_0xb5c191[_0xde20('0x5b')]['id']){delete _0xb5c191['body']['id'];}_0xb5c191[_0xde20('0x5b')][_0xde20('0x5f')]=_0xb5c191['body']['UserId']||_0xb5c191[_0xde20('0x60')]['id'];_0x2ef31b['agent']['id']=_0xb5c191['body'][_0xde20('0x5f')];return db[_0xde20('0x40')]['find']({'where':{'id':_0xb5c191['params']['id'],'UserId':null}})[_0xde20('0x25')](handleEntityNotFound(_0x42ce62,null))[_0xde20('0x25')](function(_0xd371c8){if(_0xd371c8){_0x2ef31b[_0xde20('0x2c')]=_0xd371c8['get']({'plain':!![]});return db[_0xde20('0x62')]['find']({'where':{'id':_0xd371c8[_0xde20('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x42ce62,null))[_0xde20('0x25')](function(_0x2ab137){if(_0x2ab137){_0x2ef31b['interaction']=_0x2ab137[_0xde20('0x61')]({'plain':!![]});interaction_log['info'](_0xde20('0x7c'),_0xb5c191['user']['id'],_0xb5c191[_0xde20('0x60')][_0xde20('0x3c')],_0xb5c191[_0xde20('0x60')][_0xde20('0x7d')],_0x2ef31b[_0xde20('0x67')]['id'],_0xb5c191[_0xde20('0x5b')]?JSON[_0xde20('0x2a')](_0xb5c191['body']):'null');return respondWithRpcPromise(_0xde20('0x7e'),_0xde20('0x7f'),_0x2ef31b);}return null;})[_0xde20('0x25')](function(_0x3b75aa){var _0x304f7a=_0xde20('0x80')+_0x3b75aa[_0xde20('0x2c')][_0xde20('0x6b')];return db[_0xde20('0x81')][_0xde20('0x45')](_0x304f7a,{'type':db[_0xde20('0x82')][_0xde20('0x6c')][_0xde20('0x6d')],'raw':!![]})[_0xde20('0x25')](function(_0x41b374){return _0x41b374;});})[_0xde20('0x25')](function(_0x5a03ae){if(_0x5a03ae){_0x2ef31b[_0xde20('0x2c')]['contact']=_0x5a03ae[0x0];if(!_0xb5c191[_0xde20('0x5b')][_0xde20('0x5f')])return;return db[_0xde20('0x6e')]['find']({'where':{'id':_0xb5c191[_0xde20('0x5b')][_0xde20('0x5f')],'role':_0xde20('0x6f')},'attributes':['id','name',_0xde20('0x70'),_0xde20('0x71'),_0xde20('0x72')],'raw':!![]});}return null;})[_0xde20('0x25')](function(_0x15fe39){if(!_0x15fe39)return null;_0x2ef31b[_0xde20('0x2c')][_0xde20('0x6f')]=_0x15fe39;return _0x2ef31b;})[_0xde20('0x25')](function(_0x207996){if(_0x207996){_0x207996[_0xde20('0x2c')][_0xde20('0x74')]=util[_0xde20('0x75')](_0xde20('0x83'),_0xb5c191[_0xde20('0x60')][_0xde20('0x3c')]);_0x207996['message'][_0xde20('0x76')]=_0x2ef31b[_0xde20('0x76')];_0x207996[_0xde20('0x2c')][_0xde20('0x77')]=_0x2ef31b[_0xde20('0x76')];_0x207996[_0xde20('0x2c')][_0xde20('0x84')]='reject';respondWithRpcPromise(_0xde20('0x79'),_0xde20('0x79'),{'event':_0xde20('0x85'),'message':_0x207996[_0xde20('0x2c')]},client9002);return _0x2ef31b;}return null;})[_0xde20('0x25')](respondWithResult(_0x42ce62,null))[_0xde20('0x2d')](handleError(_0x42ce62,null));};exports[_0xde20('0x86')]=function(_0x5bdfb8,_0x5a59a6){var _0x2dc83b;return db['FaxMessage'][_0xde20('0x86')](_0x5bdfb8[_0xde20('0x5b')],{})[_0xde20('0x25')](function(_0x2c5243){_0x2dc83b=_0x2c5243;return db[_0xde20('0x87')][_0xde20('0x88')]({'where':{'id':_0x2dc83b[_0xde20('0x6b')]}});})[_0xde20('0x25')](function(_0x25663d){if(_['isNil'](_0x25663d)){return;}else{_0x2dc83b[_0xde20('0x7b')]=_0x25663d[_0xde20('0x7b')];return db[_0xde20('0x89')][_0xde20('0x88')]({'where':{'id':_0x2dc83b[_0xde20('0x8a')]}});}})[_0xde20('0x25')](function(_0x3401c7){return respondWithRpcPromise(_0xde20('0x8b'),_0xde20('0x8b'),{'FaxAccountId':_[_0xde20('0x64')](_0x5bdfb8[_0xde20('0x5b')])?undefined:_0x5bdfb8[_0xde20('0x5b')]['FaxAccountId'],'path':_[_0xde20('0x64')](_0x3401c7)?undefined:util['format'](_0xde20('0x8c'),_0x3401c7['basename']),'fax':_[_0xde20('0x64')](_0x2dc83b[_0xde20('0x7b')])?undefined:_0x2dc83b[_0xde20('0x7b')],'AttachmentId':_0x2dc83b[_0xde20('0x8a')]},client9002);})[_0xde20('0x25')](respondWithResult(_0x5a59a6,0xc9))[_0xde20('0x2d')](handleError(_0x5a59a6,null));};exports[_0xde20('0x8d')]=function(_0x426035,_0x446896){var _0x1fe675=path[_0xde20('0x8e')](config[_0xde20('0x8f')],'server',_0xde20('0x90'),_0xde20('0x91'));return db[_0xde20('0x40')]['find']({'where':{'id':_0x426035[_0xde20('0x57')]['id']},'include':[{'model':db[_0xde20('0x89')],'as':_0xde20('0x89')}]})['then'](handleEntityNotFound(_0x446896,null))[_0xde20('0x25')](function(_0x21d3ec){if(_0x21d3ec){return _0x446896['download'](path['join'](_0x1fe675,_0x21d3ec[_0xde20('0x89')][_0xde20('0x92')]));}})[_0xde20('0x2d')](handleError(_0x446896,null));}; \ No newline at end of file +var _0x01f1=['fax','readAt','format','UserId','agent','get','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','user','null','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','channel','EventManager','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','internal','SIP/%s','motionChannel','event','rejectmessage','create','ContactId','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','fs-extra','squel','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/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','merge','where','includeAll','findAll','rows','show','params','include','options','find','body','describe','fax-interactions','accept'];(function(_0x473908,_0x39253b){var _0x2139b9=function(_0x24e938){while(--_0x24e938){_0x473908['push'](_0x473908['shift']());}};_0x2139b9(++_0x39253b);}(_0x01f1,0xc1));var _0x101f=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0x01f1[_0x3a8b7c];return _0x40eb80;};'use strict';var emlformat=require(_0x101f('0x0'));var rimraf=require(_0x101f('0x1'));var zipdir=require(_0x101f('0x2'));var jsonpatch=require(_0x101f('0x3'));var rp=require('request-promise');var moment=require(_0x101f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x101f('0x5'));var util=require(_0x101f('0x6'));var path=require(_0x101f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x101f('0x8'));var _=require('lodash');var squel=require(_0x101f('0x9'));var crypto=require('crypto');var jsforce=require(_0x101f('0xa'));var deskjs=require(_0x101f('0xb'));var toCsv=require(_0x101f('0xc'));var querystring=require('querystring');var Papa=require(_0x101f('0xd'));var Redis=require(_0x101f('0xe'));var authService=require(_0x101f('0xf'));var qs=require(_0x101f('0x10'));var as=require(_0x101f('0x11'));var hardwareService=require(_0x101f('0x12'));var logger=require(_0x101f('0x13'))(_0x101f('0x14'));var utils=require(_0x101f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x101f('0x16'));var db=require(_0x101f('0x17'))['db'];config[_0x101f('0x18')]=_[_0x101f('0x19')](config[_0x101f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x101f('0x1a'))(new Redis(config[_0x101f('0x18')]));require('./faxMessage.socket')[_0x101f('0x1b')](socket);var jayson=require(_0x101f('0x1c'));var client=jayson[_0x101f('0x1d')][_0x101f('0x1e')]({'port':0x232c});var client9002=jayson[_0x101f('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157241,_0x2328c5,_0x448e9d,_0x34a720){return new BPromise(function(_0x3c69df,_0x836ed4){var _0x311e8c=_0x34a720||client;return _0x311e8c[_0x101f('0x1f')](_0x157241,_0x448e9d)[_0x101f('0x20')](function(_0x78ec84){logger[_0x101f('0x21')]('FaxMessage,\x20%s,\x20%s',_0x2328c5,_0x101f('0x22'));logger[_0x101f('0x23')](_0x101f('0x24'),_0x2328c5,_0x101f('0x22'),JSON[_0x101f('0x25')](_0x78ec84));if(_0x78ec84[_0x101f('0x26')]){if(_0x78ec84['error'][_0x101f('0x27')]===0x1f4){logger[_0x101f('0x26')](_0x101f('0x28'),_0x2328c5,_0x78ec84[_0x101f('0x26')][_0x101f('0x29')]);return _0x836ed4(_0x78ec84['error'][_0x101f('0x29')]);}logger[_0x101f('0x26')](_0x101f('0x28'),_0x2328c5,_0x78ec84[_0x101f('0x26')][_0x101f('0x29')]);return _0x3c69df(_0x78ec84[_0x101f('0x26')][_0x101f('0x29')]);}else{logger['info'](_0x101f('0x28'),_0x2328c5,_0x101f('0x22'));_0x3c69df(_0x78ec84[_0x101f('0x2a')]['message']);}})[_0x101f('0x2b')](function(_0x159de7){logger[_0x101f('0x26')]('FaxMessage,\x20%s,\x20%s',_0x2328c5,_0x159de7);_0x836ed4(_0x159de7);});});}function respondWithStatusCode(_0x12251d,_0x33d158){_0x33d158=_0x33d158||0xcc;return function(_0x1a14e1){if(_0x1a14e1){return _0x12251d[_0x101f('0x2c')](_0x33d158);}return _0x12251d[_0x101f('0x2d')](_0x33d158)[_0x101f('0x2e')]();};}function respondWithResult(_0x279ac1,_0x48859d){_0x48859d=_0x48859d||0xc8;return function(_0x35f74d){if(_0x35f74d){return _0x279ac1['status'](_0x48859d)[_0x101f('0x2f')](_0x35f74d);}};}function respondWithFilteredResult(_0x16b36f,_0x5455dc){return function(_0x1e5598){if(_0x1e5598){var _0x4a2f04=typeof _0x5455dc[_0x101f('0x30')]==='undefined'&&typeof _0x5455dc[_0x101f('0x31')]===_0x101f('0x32');var _0x1a0e1d=_0x1e5598['count'];var _0x4a193f=_0x4a2f04?0x0:_0x5455dc[_0x101f('0x30')];var _0x4785d8=_0x4a2f04?_0x1e5598[_0x101f('0x33')]:_0x5455dc['offset']+_0x5455dc[_0x101f('0x31')];var _0x76c3d4;if(_0x4785d8>=_0x1a0e1d){_0x4785d8=_0x1a0e1d;_0x76c3d4=0xc8;}else{_0x76c3d4=0xce;}_0x16b36f[_0x101f('0x2d')](_0x76c3d4);return _0x16b36f[_0x101f('0x34')](_0x101f('0x35'),_0x4a193f+'-'+_0x4785d8+'/'+_0x1a0e1d)['json'](_0x1e5598);}return null;};}function patchUpdates(_0x2eaa02){return function(_0x185bf0){try{jsonpatch[_0x101f('0x36')](_0x185bf0,_0x2eaa02,!![]);}catch(_0x2d0779){return BPromise[_0x101f('0x37')](_0x2d0779);}return _0x185bf0['save']();};}function saveUpdates(_0x2b2611,_0x15a9eb){return function(_0x3a52be){if(_0x3a52be){return _0x3a52be[_0x101f('0x38')](_0x2b2611)['then'](function(_0x4f4494){return _0x4f4494;});}return null;};}function removeEntity(_0x3f5138,_0xf0b4a5){return function(_0x5f1a5f){if(_0x5f1a5f){return _0x5f1a5f[_0x101f('0x39')]()[_0x101f('0x20')](function(){_0x3f5138[_0x101f('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1e51,_0x4f4920){return function(_0x6a8bf6){if(!_0x6a8bf6){_0x3a1e51[_0x101f('0x2c')](0x194);}return _0x6a8bf6;};}function handleError(_0x4f556b,_0x3f16e6){_0x3f16e6=_0x3f16e6||0x1f4;return function(_0x48105a){logger['error'](_0x48105a['stack']);if(_0x48105a['name']){delete _0x48105a[_0x101f('0x3a')];}_0x4f556b[_0x101f('0x2d')](_0x3f16e6)[_0x101f('0x3b')](_0x48105a);};}exports[_0x101f('0x3c')]=function(_0x520ff9,_0x5623d4){var _0x45acb0={},_0x1054f5={},_0x25fe61={'count':0x0,'rows':[]};var _0x4936dc=_[_0x101f('0x3d')](db[_0x101f('0x3e')][_0x101f('0x3f')],function(_0x2f9ba8){return{'name':_0x2f9ba8[_0x101f('0x40')],'type':_0x2f9ba8[_0x101f('0x41')][_0x101f('0x42')]};});_0x1054f5[_0x101f('0x43')]=_[_0x101f('0x3d')](_0x4936dc,_0x101f('0x3a'));_0x1054f5['query']=_[_0x101f('0x44')](_0x520ff9[_0x101f('0x45')]);_0x1054f5['filters']=_[_0x101f('0x46')](_0x1054f5[_0x101f('0x43')],_0x1054f5['query']);_0x45acb0[_0x101f('0x47')]=_[_0x101f('0x46')](_0x1054f5[_0x101f('0x43')],qs['fields'](_0x520ff9[_0x101f('0x45')][_0x101f('0x48')]));_0x45acb0[_0x101f('0x47')]=_0x45acb0[_0x101f('0x47')][_0x101f('0x49')]?_0x45acb0[_0x101f('0x47')]:_0x1054f5[_0x101f('0x43')];if(!_0x520ff9[_0x101f('0x45')][_0x101f('0x4a')]('nolimit')){_0x45acb0[_0x101f('0x31')]=qs['limit'](_0x520ff9[_0x101f('0x45')][_0x101f('0x31')]);_0x45acb0['offset']=qs['offset'](_0x520ff9[_0x101f('0x45')][_0x101f('0x30')]);}_0x45acb0['order']=qs[_0x101f('0x4b')](_0x520ff9['query'][_0x101f('0x4b')]);_0x45acb0['where']=qs[_0x101f('0x4c')](_[_0x101f('0x4d')](_0x520ff9[_0x101f('0x45')],_0x1054f5[_0x101f('0x4c')]),_0x4936dc);if(_0x520ff9['query'][_0x101f('0x4e')]){_0x45acb0['where']=_[_0x101f('0x4f')](_0x45acb0[_0x101f('0x50')],{'$or':_[_0x101f('0x3d')](_0x4936dc,function(_0x337f6d){if(_0x337f6d[_0x101f('0x41')]!=='VIRTUAL'){var _0xc6dc85={};_0xc6dc85[_0x337f6d['name']]={'$like':'%'+_0x520ff9[_0x101f('0x45')][_0x101f('0x4e')]+'%'};return _0xc6dc85;}})});}_0x45acb0=_['merge']({},_0x45acb0,_0x520ff9['options']);var _0x408833={'where':_0x45acb0[_0x101f('0x50')]};return db[_0x101f('0x3e')][_0x101f('0x33')](_0x408833)[_0x101f('0x20')](function(_0xd998c2){_0x25fe61['count']=_0xd998c2;if(_0x520ff9[_0x101f('0x45')][_0x101f('0x51')]){_0x45acb0['include']=[{'all':!![]}];}return db[_0x101f('0x3e')][_0x101f('0x52')](_0x45acb0);})[_0x101f('0x20')](function(_0x4e913e){_0x25fe61[_0x101f('0x53')]=_0x4e913e;return _0x25fe61;})[_0x101f('0x20')](respondWithFilteredResult(_0x5623d4,_0x45acb0))['catch'](handleError(_0x5623d4,null));};exports[_0x101f('0x54')]=function(_0x3c033d,_0x187ed8){var _0x3c124f={'raw':!![],'where':{'id':_0x3c033d[_0x101f('0x55')]['id']}},_0x79604a={};_0x79604a[_0x101f('0x43')]=_[_0x101f('0x44')](db[_0x101f('0x3e')][_0x101f('0x3f')]);_0x79604a[_0x101f('0x45')]=_[_0x101f('0x44')](_0x3c033d[_0x101f('0x45')]);_0x79604a['filters']=_[_0x101f('0x46')](_0x79604a[_0x101f('0x43')],_0x79604a[_0x101f('0x45')]);_0x3c124f[_0x101f('0x47')]=_[_0x101f('0x46')](_0x79604a['model'],qs[_0x101f('0x48')](_0x3c033d[_0x101f('0x45')]['fields']));_0x3c124f['attributes']=_0x3c124f[_0x101f('0x47')][_0x101f('0x49')]?_0x3c124f[_0x101f('0x47')]:_0x79604a[_0x101f('0x43')];if(_0x3c033d[_0x101f('0x45')][_0x101f('0x51')]){_0x3c124f[_0x101f('0x56')]=[{'all':!![]}];}_0x3c124f=_['merge']({},_0x3c124f,_0x3c033d[_0x101f('0x57')]);return db['FaxMessage'][_0x101f('0x58')](_0x3c124f)[_0x101f('0x20')](handleEntityNotFound(_0x187ed8,null))[_0x101f('0x20')](respondWithResult(_0x187ed8,null))['catch'](handleError(_0x187ed8,null));};exports[_0x101f('0x38')]=function(_0x5aa212,_0x2ad73d){if(_0x5aa212['body']['id']){delete _0x5aa212[_0x101f('0x59')]['id'];}return db['FaxMessage'][_0x101f('0x58')]({'where':{'id':_0x5aa212[_0x101f('0x55')]['id']}})[_0x101f('0x20')](handleEntityNotFound(_0x2ad73d,null))['then'](saveUpdates(_0x5aa212['body'],null))[_0x101f('0x20')](respondWithResult(_0x2ad73d,null))[_0x101f('0x2b')](handleError(_0x2ad73d,null));};exports[_0x101f('0x39')]=function(_0xaf1799,_0x15b970){return db[_0x101f('0x3e')][_0x101f('0x58')]({'where':{'id':_0xaf1799[_0x101f('0x55')]['id']}})['then'](handleEntityNotFound(_0x15b970,null))[_0x101f('0x20')](removeEntity(_0x15b970,null))[_0x101f('0x2b')](handleError(_0x15b970,null));};exports[_0x101f('0x5a')]=function(_0x35213d,_0x10ce29){return db['FaxMessage']['describe']()[_0x101f('0x20')](respondWithResult(_0x10ce29,null))['catch'](handleError(_0x10ce29,null));};var interaction_log=require(_0x101f('0x13'))(_0x101f('0x5b'));exports[_0x101f('0x5c')]=function(_0x2b098d,_0x57b897,_0x48c5e6){var _0x5d2292={'agent':{},'channel':_0x101f('0x5d')};if(_0x2b098d[_0x101f('0x59')]['id']){delete _0x2b098d[_0x101f('0x59')]['id'];}_0x2b098d[_0x101f('0x59')]['read']=!![];_0x2b098d[_0x101f('0x59')][_0x101f('0x5e')]=moment()[_0x101f('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b098d[_0x101f('0x59')][_0x101f('0x60')]=_0x2b098d[_0x101f('0x59')][_0x101f('0x60')]||_0x2b098d['user']['id'];_0x5d2292[_0x101f('0x61')]['id']=_0x2b098d[_0x101f('0x59')][_0x101f('0x60')];return db[_0x101f('0x3e')][_0x101f('0x58')]({'where':{'id':_0x2b098d[_0x101f('0x55')]['id'],'UserId':null}})[_0x101f('0x20')](handleEntityNotFound(_0x57b897,null))['then'](saveUpdates(_0x2b098d[_0x101f('0x59')],null))[_0x101f('0x20')](function(_0x57ae13){if(_0x57ae13){_0x5d2292['message']=_0x57ae13[_0x101f('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x101f('0x58')]({'where':{'id':_0x57ae13[_0x101f('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x57b897,null))[_0x101f('0x20')](function(_0x46ecfd){if(_0x46ecfd){return _0x46ecfd[_0x101f('0x38')]({'UserId':_0x2b098d['body'][_0x101f('0x60')],'read1stAt':_[_0x101f('0x64')](_0x46ecfd['read1stAt'])?moment()[_0x101f('0x5f')](_0x101f('0x65')):undefined});}return null;})[_0x101f('0x20')](function(_0x23f47c){if(_0x23f47c){_0x5d2292[_0x101f('0x66')]=_0x23f47c[_0x101f('0x62')]({'plain':!![]});interaction_log[_0x101f('0x21')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b098d[_0x101f('0x67')]['id'],_0x2b098d['user']['name'],_0x2b098d[_0x101f('0x67')]['role'],_0x5d2292['interaction']['id'],_0x2b098d['body']?JSON[_0x101f('0x25')](_0x2b098d[_0x101f('0x59')]):_0x101f('0x68'));return respondWithRpcPromise(_0x101f('0x69'),_0x101f('0x6a'),_0x5d2292);}return null;})['then'](function(_0x264479){var _0x47cc7f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x264479[_0x101f('0x29')]['ContactId'];return db[_0x101f('0x6b')][_0x101f('0x45')](_0x47cc7f,{'type':db[_0x101f('0x6c')][_0x101f('0x6d')][_0x101f('0x6e')],'raw':!![]})[_0x101f('0x20')](function(_0x3585c1){return _0x3585c1;});})['then'](function(_0x5c5537){if(_0x5c5537){_0x5d2292[_0x101f('0x29')][_0x101f('0x6f')]=_0x5c5537[0x0];if(!_0x2b098d[_0x101f('0x59')]['UserId'])return;return db[_0x101f('0x70')][_0x101f('0x58')]({'where':{'id':_0x2b098d[_0x101f('0x59')][_0x101f('0x60')],'role':_0x101f('0x61')},'attributes':['id','name',_0x101f('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x101f('0x20')](function(_0x449ff6){if(!_0x449ff6)return null;_0x5d2292['message'][_0x101f('0x61')]=_0x449ff6;return _0x5d2292;})[_0x101f('0x20')](function(_0x5700c0){if(_0x5700c0){if(_0x2b098d['body'][_0x101f('0x72')]){_0x5d2292[_0x101f('0x29')][_0x101f('0x73')]=util[_0x101f('0x5f')]('SIP/%s',_0x2b098d['user'][_0x101f('0x3a')]);_0x5d2292[_0x101f('0x29')][_0x101f('0x74')]=_0x5d2292[_0x101f('0x74')];_0x5d2292[_0x101f('0x29')]['motionChannel']=_0x5d2292[_0x101f('0x74')];_0x5d2292[_0x101f('0x29')]['event']=_0x101f('0x5c');return respondWithRpcPromise(_0x101f('0x75'),_0x101f('0x75'),{'event':'acceptmessage','message':_0x5d2292[_0x101f('0x29')]},client9002)[_0x101f('0x20')](function(){return _0x5d2292;});}return _0x5d2292;}return null;})[_0x101f('0x20')](respondWithResult(_0x57b897,null))[_0x101f('0x2b')](handleError(_0x57b897,null));};var interaction_log=require(_0x101f('0x13'))('fax-interactions');exports[_0x101f('0x37')]=function(_0x7d5cc7,_0x5d9f95,_0x10db53){var _0x4a5af1={'agent':{},'channel':_0x101f('0x5d')};if(_0x7d5cc7[_0x101f('0x59')]['id']){delete _0x7d5cc7['body']['id'];}_0x7d5cc7[_0x101f('0x59')][_0x101f('0x60')]=_0x7d5cc7[_0x101f('0x59')]['UserId']||_0x7d5cc7[_0x101f('0x67')]['id'];_0x4a5af1[_0x101f('0x61')]['id']=_0x7d5cc7[_0x101f('0x59')][_0x101f('0x60')];return db[_0x101f('0x3e')][_0x101f('0x58')]({'where':{'id':_0x7d5cc7['params']['id'],'UserId':null}})[_0x101f('0x20')](handleEntityNotFound(_0x5d9f95,null))['then'](function(_0xb6a49c){if(_0xb6a49c){_0x4a5af1['message']=_0xb6a49c[_0x101f('0x62')]({'plain':!![]});return db[_0x101f('0x76')][_0x101f('0x58')]({'where':{'id':_0xb6a49c[_0x101f('0x63')]}});}return null;})[_0x101f('0x20')](handleEntityNotFound(_0x5d9f95,null))[_0x101f('0x20')](function(_0x17baee){if(_0x17baee){_0x4a5af1['interaction']=_0x17baee[_0x101f('0x62')]({'plain':!![]});interaction_log['info'](_0x101f('0x77'),_0x7d5cc7['user']['id'],_0x7d5cc7['user'][_0x101f('0x3a')],_0x7d5cc7[_0x101f('0x67')][_0x101f('0x78')],_0x4a5af1[_0x101f('0x66')]['id'],_0x7d5cc7[_0x101f('0x59')]?JSON[_0x101f('0x25')](_0x7d5cc7[_0x101f('0x59')]):_0x101f('0x68'));return respondWithRpcPromise(_0x101f('0x79'),'rejectMessage',_0x4a5af1);}return null;})[_0x101f('0x20')](function(_0x38b75c){var _0x36c28f=_0x101f('0x7a')+_0x38b75c[_0x101f('0x29')]['ContactId'];return db[_0x101f('0x6b')][_0x101f('0x45')](_0x36c28f,{'type':db[_0x101f('0x6c')][_0x101f('0x6d')][_0x101f('0x6e')],'raw':!![]})[_0x101f('0x20')](function(_0x3c1ecf){return _0x3c1ecf;});})[_0x101f('0x20')](function(_0x3ed863){if(_0x3ed863){_0x4a5af1[_0x101f('0x29')][_0x101f('0x6f')]=_0x3ed863[0x0];if(!_0x7d5cc7[_0x101f('0x59')][_0x101f('0x60')])return;return db[_0x101f('0x70')][_0x101f('0x58')]({'where':{'id':_0x7d5cc7[_0x101f('0x59')][_0x101f('0x60')],'role':_0x101f('0x61')},'attributes':['id','name',_0x101f('0x71'),_0x101f('0x7b'),_0x101f('0x7c')],'raw':!![]});}return null;})[_0x101f('0x20')](function(_0x5a9ea3){if(!_0x5a9ea3)return null;_0x4a5af1['message']['agent']=_0x5a9ea3;return _0x4a5af1;})[_0x101f('0x20')](function(_0x5b3cff){if(_0x5b3cff){_0x5b3cff[_0x101f('0x29')]['interface']=util[_0x101f('0x5f')](_0x101f('0x7d'),_0x7d5cc7[_0x101f('0x67')]['name']);_0x5b3cff[_0x101f('0x29')][_0x101f('0x74')]=_0x4a5af1[_0x101f('0x74')];_0x5b3cff['message'][_0x101f('0x7e')]=_0x4a5af1[_0x101f('0x74')];_0x5b3cff[_0x101f('0x29')][_0x101f('0x7f')]=_0x101f('0x37');respondWithRpcPromise(_0x101f('0x75'),'EventManager',{'event':_0x101f('0x80'),'message':_0x5b3cff['message']},client9002);return _0x4a5af1;}return null;})[_0x101f('0x20')](respondWithResult(_0x5d9f95,null))[_0x101f('0x2b')](handleError(_0x5d9f95,null));};exports[_0x101f('0x81')]=function(_0x2f6a61,_0x51da22){var _0x114c76;return db[_0x101f('0x3e')][_0x101f('0x81')](_0x2f6a61[_0x101f('0x59')],{})[_0x101f('0x20')](function(_0x250e14){_0x114c76=_0x250e14;return db['CmContact']['findOne']({'where':{'id':_0x114c76[_0x101f('0x82')]}});})['then'](function(_0x2b812d){if(_[_0x101f('0x64')](_0x2b812d)){return;}else{_0x114c76['fax']=_0x2b812d[_0x101f('0x5d')];return db[_0x101f('0x83')]['findOne']({'where':{'id':_0x114c76['AttachmentId']}});}})[_0x101f('0x20')](function(_0x4ed597){return respondWithRpcPromise(_0x101f('0x84'),_0x101f('0x84'),{'FaxAccountId':_['isNil'](_0x2f6a61[_0x101f('0x59')])?undefined:_0x2f6a61[_0x101f('0x59')][_0x101f('0x85')],'path':_[_0x101f('0x64')](_0x4ed597)?undefined:util[_0x101f('0x5f')](_0x101f('0x86'),_0x4ed597[_0x101f('0x87')]),'fax':_[_0x101f('0x64')](_0x114c76[_0x101f('0x5d')])?undefined:_0x114c76['fax'],'AttachmentId':_0x114c76[_0x101f('0x88')]},client9002);})[_0x101f('0x20')](respondWithResult(_0x51da22,0xc9))[_0x101f('0x2b')](handleError(_0x51da22,null));};exports[_0x101f('0x89')]=function(_0x5a01ee,_0x1a2b07){var _0x5375c3=path[_0x101f('0x8a')](config[_0x101f('0x8b')],_0x101f('0x8c'),_0x101f('0x8d'),_0x101f('0x8e'));return db[_0x101f('0x3e')][_0x101f('0x58')]({'where':{'id':_0x5a01ee[_0x101f('0x55')]['id']},'include':[{'model':db[_0x101f('0x83')],'as':_0x101f('0x83')}]})[_0x101f('0x20')](handleEntityNotFound(_0x1a2b07,null))[_0x101f('0x20')](function(_0x107c4c){if(_0x107c4c){return _0x1a2b07[_0x101f('0x89')](path[_0x101f('0x8a')](_0x5375c3,_0x107c4c['Attachment']['basename']));}})[_0x101f('0x2b')](handleError(_0x1a2b07,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index a138f80..db5dd3e 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 _0x7958=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x2b6869,_0x484f4f){var _0x45182f=function(_0x10a96c){while(--_0x10a96c){_0x2b6869['push'](_0x2b6869['shift']());}};_0x45182f(++_0x484f4f);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8795('0x0'));var FaxMessage=require(_0x8795('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8795('0x2')](0x0);var events={'afterCreate':_0x8795('0x3'),'afterUpdate':_0x8795('0x4'),'afterDestroy':_0x8795('0x5')};function emitEvent(_0x3becac){return function(_0x43aff1,_0x347089,_0x2f2594){FaxMessageEvents['emit'](_0x3becac+':'+_0x43aff1['id'],_0x43aff1);FaxMessageEvents[_0x8795('0x6')](_0x3becac,_0x43aff1);_0x2f2594(null);};}for(var e in events){if(events[_0x8795('0x7')](e)){var event=events[e];FaxMessage[_0x8795('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x287e=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb','FaxMessage'];(function(_0x238def,_0x1e9ad2){var _0x121f47=function(_0x4a9013){while(--_0x4a9013){_0x238def['push'](_0x238def['shift']());}};_0x121f47(++_0x1e9ad2);}(_0x287e,0x1e3));var _0xe287=function(_0x55c378,_0x38e2dc){_0x55c378=_0x55c378-0x0;var _0x283646=_0x287e[_0x55c378];return _0x283646;};'use strict';var EventEmitter=require(_0xe287('0x0'));var FaxMessage=require(_0xe287('0x1'))['db'][_0xe287('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe287('0x3')](0x0);var events={'afterCreate':_0xe287('0x4'),'afterUpdate':_0xe287('0x5'),'afterDestroy':_0xe287('0x6')};function emitEvent(_0x3ce68e){return function(_0x16d2d7,_0x5f34d6,_0x113035){FaxMessageEvents[_0xe287('0x7')](_0x3ce68e+':'+_0x16d2d7['id'],_0x16d2d7);FaxMessageEvents['emit'](_0x3ce68e,_0x16d2d7);_0x113035(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xe287('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e17471a..838f5fa 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 _0x5ed0=['FaxMessage','fax_messages','FULLTEXT','models','get','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x4deab4,_0x224db3){var _0x592d6d=function(_0x26babb){while(--_0x26babb){_0x4deab4['push'](_0x4deab4['shift']());}};_0x592d6d(++_0x224db3);}(_0x5ed0,0x7b));var _0x05ed=function(_0x520fe2,_0x3bfe8b){_0x520fe2=_0x520fe2-0x0;var _0x509442=_0x5ed0[_0x520fe2];return _0x509442;};'use strict';var _=require(_0x05ed('0x0'));var util=require(_0x05ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x05ed('0x2'));var BPromise=require('bluebird');var rp=require(_0x05ed('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05ed('0x4'));var config=require(_0x05ed('0x5'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x188767,_0x4e0d9a){return _0x188767[_0x05ed('0x6')](_0x05ed('0x7'),attributes,{'tableName':_0x05ed('0x8'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x05ed('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x467c5b,_0x3ff9de,_0x50b77d){var _0x3fbc82=_0x188767[_0x05ed('0xa')];var _0x34a93b=_0x467c5b[_0x05ed('0xb')]({'plain':!![]});if(_0x34a93b['direction'][_0x05ed('0xc')]()==='in'||_0x34a93b['direction'][_0x05ed('0xc')]()==='out'&&!_0x34a93b[_0x05ed('0xd')]&&!_[_0x05ed('0xe')](_0x34a93b[_0x05ed('0xf')])){_0x3fbc82[_0x05ed('0x10')][_0x05ed('0x11')]({'where':{'id':_0x34a93b[_0x05ed('0x12')]}})['then'](function(_0x38a1dc){if(_0x38a1dc){_0x38a1dc[_0x05ed('0x13')]({'lastMsgAt':_0x34a93b[_0x05ed('0x14')],'lastMsgDirection':_0x34a93b[_0x05ed('0x15')][_0x05ed('0xc')]()});}})[_0x05ed('0x16')](function(_0xe8cb6){console[_0x05ed('0x17')](_0xe8cb6);});}_0x50b77d();}},'charset':_0x05ed('0x18'),'collate':_0x05ed('0x19')});}; \ No newline at end of file +var _0xebb4=['FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages'];(function(_0x39f6d8,_0x2a9b4c){var _0x1f252e=function(_0x5464ac){while(--_0x5464ac){_0x39f6d8['push'](_0x39f6d8['shift']());}};_0x1f252e(++_0x2a9b4c);}(_0xebb4,0x1e1));var _0x4ebb=function(_0x143f05,_0x2185af){_0x143f05=_0x143f05-0x0;var _0x36f994=_0xebb4[_0x143f05];return _0x36f994;};'use strict';var _=require(_0x4ebb('0x0'));var util=require(_0x4ebb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4ebb('0x2'));var BPromise=require(_0x4ebb('0x3'));var rp=require(_0x4ebb('0x4'));var fs=require('fs');var path=require(_0x4ebb('0x5'));var rimraf=require('rimraf');var config=require(_0x4ebb('0x6'));var attributes=require(_0x4ebb('0x7'));module[_0x4ebb('0x8')]=function(_0x126442,_0x32b80c){return _0x126442['define'](_0x4ebb('0x9'),attributes,{'tableName':_0x4ebb('0xa'),'paranoid':![],'indexes':[{'name':_0x4ebb('0xb'),'fields':['body'],'type':_0x4ebb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30a755,_0x49425d,_0x25a51a){var _0x25e968=_0x126442[_0x4ebb('0xd')];var _0x4ee681=_0x30a755[_0x4ebb('0xe')]({'plain':!![]});if(_0x4ee681[_0x4ebb('0xf')][_0x4ebb('0x10')]()==='in'||_0x4ee681['direction'][_0x4ebb('0x10')]()==='out'&&!_0x4ee681[_0x4ebb('0x11')]&&!_[_0x4ebb('0x12')](_0x4ee681[_0x4ebb('0x13')])){_0x25e968[_0x4ebb('0x14')][_0x4ebb('0x15')]({'where':{'id':_0x4ee681[_0x4ebb('0x16')]}})[_0x4ebb('0x17')](function(_0x2b7089){if(_0x2b7089){_0x2b7089[_0x4ebb('0x18')]({'lastMsgAt':_0x4ee681[_0x4ebb('0x19')],'lastMsgDirection':_0x4ee681[_0x4ebb('0xf')]['toLowerCase']()});}})['catch'](function(_0x25c5c2){console[_0x4ebb('0x1a')](_0x25c5c2);});}_0x25a51a();}},'charset':_0x4ebb('0x1b'),'collate':_0x4ebb('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index a88485b..b820750 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 _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x1b1f04,_0x107699){var _0x3c2e4a=function(_0x569e01){while(--_0x569e01){_0x1b1f04['push'](_0x1b1f04['shift']());}};_0x3c2e4a(++_0x107699);}(_0xac31,0xca));var _0x1ac3=function(_0x4fd688,_0x337ad6){_0x4fd688=_0x4fd688-0x0;var _0x19b857=_0xac31[_0x4fd688];return _0x19b857;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});}; \ No newline at end of file +var _0x425d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x425d,0x1e0));var _0xd425=function(_0x3c17f1,_0x5bd639){_0x3c17f1=_0x3c17f1-0x0;var _0x5ec099=_0x425d[_0x3c17f1];return _0x5ec099;};'use strict';var _=require(_0xd425('0x0'));var util=require('util');var moment=require(_0xd425('0x1'));var BPromise=require(_0xd425('0x2'));var rs=require(_0xd425('0x3'));var fs=require('fs');var Redis=require(_0xd425('0x4'));var db=require(_0xd425('0x5'))['db'];var utils=require(_0xd425('0x6'));var logger=require(_0xd425('0x7'))('rpc');var config=require(_0xd425('0x8'));var jayson=require(_0xd425('0x9'));var client=jayson[_0xd425('0xa')][_0xd425('0xb')]({'port':0x232a});config[_0xd425('0xc')]=_[_0xd425('0xd')](config['redis'],{'host':_0xd425('0xe'),'port':0x18eb});var socket=require(_0xd425('0xf'))(new Redis(config[_0xd425('0xc')]));require(_0xd425('0x10'))[_0xd425('0x11')](socket);function respondWithRpcPromise(_0x2beb20,_0x30111e,_0x1969ba){return new BPromise(function(_0x3a7a01,_0x35a7f4){return client[_0xd425('0x12')](_0x2beb20,_0x1969ba)[_0xd425('0x13')](function(_0x26f6d2){logger[_0xd425('0x14')](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));logger[_0xd425('0x17')](_0xd425('0x18'),_0x30111e,_0xd425('0x16'),JSON[_0xd425('0x19')](_0x26f6d2));if(_0x26f6d2['error']){if(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1b')]===0x1f4){logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x35a7f4(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}logger[_0xd425('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);return _0x3a7a01(_0x26f6d2[_0xd425('0x1a')][_0xd425('0x1c')]);}else{logger['info'](_0xd425('0x15'),_0x30111e,_0xd425('0x16'));_0x3a7a01(_0x26f6d2[_0xd425('0x1d')][_0xd425('0x1c')]);}})['catch'](function(_0x58a0c1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x30111e,_0x58a0c1);_0x35a7f4(_0x58a0c1);});});}exports[_0xd425('0x1e')]=function(_0xb92870){var _0x3c98db=this;return new Promise(function(_0x5e797a,_0x355af0){return db[_0xd425('0x1f')]['create'](_0xb92870[_0xd425('0x20')],{'raw':_0xb92870[_0xd425('0x21')]?_0xb92870[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![]})[_0xd425('0x13')](function(_0xb240c4){logger[_0xd425('0x14')](_0xd425('0x1e'),_0xb92870);logger[_0xd425('0x17')](_0xd425('0x1e'),_0xb92870,JSON[_0xd425('0x19')](_0xb240c4));_0x5e797a(_0xb240c4);})[_0xd425('0x23')](function(_0x47f44a){logger[_0xd425('0x1a')](_0xd425('0x1e'),_0x47f44a[_0xd425('0x1c')],_0xb92870);_0x355af0(_0x3c98db[_0xd425('0x1a')](0x1f4,_0x47f44a[_0xd425('0x1c')]));});});};exports[_0xd425('0x24')]=function(_0x3c3402){var _0x577e4b=this;return new Promise(function(_0x12f951,_0x177de2){return db[_0xd425('0x1f')]['update'](_0x3c3402[_0xd425('0x20')],{'raw':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x25')]||null:null,'attributes':_0x3c3402[_0xd425('0x21')]?_0x3c3402[_0xd425('0x21')][_0xd425('0x26')]||null:null,'limit':_0x3c3402['options']?_0x3c3402[_0xd425('0x21')][_0xd425('0x27')]||null:null})[_0xd425('0x13')](function(_0x3695dd){logger[_0xd425('0x14')](_0xd425('0x24'),_0x3c3402);logger[_0xd425('0x17')](_0xd425('0x24'),_0x3c3402,JSON[_0xd425('0x19')](_0x3695dd));_0x12f951(_0x3695dd);})[_0xd425('0x23')](function(_0x3583b0){logger['error'](_0xd425('0x24'),_0x3583b0[_0xd425('0x1c')],_0x3c3402);_0x177de2(_0x577e4b[_0xd425('0x1a')](0x1f4,_0x3583b0[_0xd425('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 96e418e..ea30fda 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 _0xba10=['save','emit','register','length','faxMessage:','./faxMessage.events'];(function(_0xc46b33,_0x34fc66){var _0x477de6=function(_0x2c6a6f){while(--_0x2c6a6f){_0xc46b33['push'](_0xc46b33['shift']());}};_0x477de6(++_0x34fc66);}(_0xba10,0xad));var _0x0ba1=function(_0x22bfa6,_0x2c55b2){_0x22bfa6=_0x22bfa6-0x0;var _0x5da7bc=_0xba10[_0x22bfa6];return _0x5da7bc;};'use strict';var FaxMessageEvents=require(_0x0ba1('0x0'));var events=[_0x0ba1('0x1'),'remove','update'];function createListener(_0x2c871b,_0x4b47a4){return function(_0x1946ee){_0x4b47a4[_0x0ba1('0x2')](_0x2c871b,_0x1946ee);};}function removeListener(_0x2fc6bf,_0x3590e3){return function(){FaxMessageEvents['removeListener'](_0x2fc6bf,_0x3590e3);};}exports[_0x0ba1('0x3')]=function(_0x5dd959){for(var _0x209a46=0x0,_0x444b30=events[_0x0ba1('0x4')];_0x209a46<_0x444b30;_0x209a46++){var _0x1f91ad=events[_0x209a46];var _0x3c6428=createListener(_0x0ba1('0x5')+_0x1f91ad,_0x5dd959);FaxMessageEvents['on'](_0x1f91ad,_0x3c6428);}}; \ No newline at end of file +var _0x8e76=['update','emit','removeListener','register','length','faxMessage:','save','remove'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x8e76,0xee));var _0x68e7=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8e76[_0x5b561d];return _0x431060;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x68e7('0x0'),_0x68e7('0x1'),_0x68e7('0x2')];function createListener(_0x328da9,_0x41530c){return function(_0x3e3df1){_0x41530c[_0x68e7('0x3')](_0x328da9,_0x3e3df1);};}function removeListener(_0x4a2805,_0x16d77e){return function(){FaxMessageEvents[_0x68e7('0x4')](_0x4a2805,_0x16d77e);};}exports[_0x68e7('0x5')]=function(_0x158ac4){for(var _0xc1411b=0x0,_0x37bc6d=events[_0x68e7('0x6')];_0xc1411b<_0x37bc6d;_0xc1411b++){var _0x372bb8=events[_0xc1411b];var _0x28967f=createListener(_0x68e7('0x7')+_0x372bb8,_0x158ac4);FaxMessageEvents['on'](_0x372bb8,_0x28967f);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3038d7e..e26e9b4 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 _0x8ce3=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','/describe','describe','/:id'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x8ce3,0xc3));var _0x38ce=function(_0x53e3bf,_0x547106){_0x53e3bf=_0x53e3bf-0x0;var _0x59b198=_0x8ce3[_0x53e3bf];return _0x59b198;};'use strict';var multer=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var path=require('path');var timeout=require(_0x38ce('0x2'));var express=require(_0x38ce('0x3'));var router=express[_0x38ce('0x4')]();var fs_extra=require(_0x38ce('0x5'));var auth=require(_0x38ce('0x6'));var interaction=require(_0x38ce('0x7'));var config=require(_0x38ce('0x8'));var controller=require(_0x38ce('0x9'));router['get']('/',auth[_0x38ce('0xa')](),controller[_0x38ce('0xb')]);router['get'](_0x38ce('0xc'),auth[_0x38ce('0xa')](),controller[_0x38ce('0xd')]);router['get'](_0x38ce('0xe'),auth['isAuthenticated'](),controller[_0x38ce('0xf')]);router['get'](_0x38ce('0x10'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x11')]);router[_0x38ce('0x12')]('/',auth[_0x38ce('0xa')](),interaction[_0x38ce('0x13')](_0x38ce('0x14'),_0x38ce('0x15')),controller[_0x38ce('0x16')]);router[_0x38ce('0x17')](_0x38ce('0xe'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x18')]);router[_0x38ce('0x17')](_0x38ce('0x19'),auth[_0x38ce('0xa')](),controller['accept']);router['put'](_0x38ce('0x1a'),auth[_0x38ce('0xa')](),controller[_0x38ce('0x1b')]);router['delete'](_0x38ce('0xe'),auth['isAuthenticated'](),controller[_0x38ce('0x1c')]);module[_0x38ce('0x1d')]=router; \ No newline at end of file +var _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/download','download','tracked','fax','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x41361f,_0x2f611c){var _0x22602f=function(_0x58eafb){while(--_0x58eafb){_0x41361f['push'](_0x41361f['shift']());}};_0x22602f(++_0x2f611c);}(_0x13f6,0x124));var _0x613f=function(_0x40d015,_0x4fc6e6){_0x40d015=_0x40d015-0x0;var _0x2af92e=_0x13f6[_0x40d015];return _0x2af92e;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['post']('/',auth[_0x613f('0x8')](),interaction[_0x613f('0xf')](_0x613f('0x10'),'faxmessage:create'),controller[_0x613f('0x11')]);router[_0x613f('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x613f('0x12')](_0x613f('0x13'),auth[_0x613f('0x8')](),controller[_0x613f('0x14')]);router[_0x613f('0x12')](_0x613f('0x15'),auth[_0x613f('0x8')](),controller[_0x613f('0x16')]);router[_0x613f('0x17')](_0x613f('0xb'),auth['isAuthenticated'](),controller[_0x613f('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 2f2c171..ce3164b 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 _0x73a3=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3ccb44,_0x49574f){var _0x35e22f=function(_0xa27a0e){while(--_0xa27a0e){_0x3ccb44['push'](_0x3ccb44['shift']());}};_0x35e22f(++_0x49574f);}(_0x73a3,0x14e));var _0x373a=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x73a3[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0x373a('0x0'));module[_0x373a('0x1')]={'name':{'type':Sequelize[_0x373a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x373a('0x2')]},'timeout':{'type':Sequelize[_0x373a('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x373a('0x4')](_0x373a('0x5'),_0x373a('0x6'),_0x373a('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x373a('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e50=['name','INTEGER','ENUM','beepall','exports','STRING'];(function(_0x44c669,_0x378649){var _0x2e133c=function(_0x1465ef){while(--_0x1465ef){_0x44c669['push'](_0x44c669['shift']());}};_0x2e133c(++_0x378649);}(_0x1e50,0x10c));var _0x01e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e50[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x01e5('0x0')]={'name':{'type':Sequelize[_0x01e5('0x1')],'unique':_0x01e5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x01e5('0x1')]},'timeout':{'type':Sequelize[_0x01e5('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01e5('0x4')]('rrmemory',_0x01e5('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 f67db8e..fc0c00c 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 _0x6979=['name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','rows','catch','show','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','nolimit','order','FaxQueueId','findAll','User','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','field','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','QueryTypes','every','TeamId','includes','union','value','isEmpty','removeAgents','spread','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','offset','undefined','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x6979,0xe0));var _0x9697=function(_0x2a7396,_0x333412){_0x2a7396=_0x2a7396-0x0;var _0x2af25b=_0x6979[_0x2a7396];return _0x2af25b;};'use strict';var emlformat=require(_0x9697('0x0'));var rimraf=require(_0x9697('0x1'));var zipdir=require(_0x9697('0x2'));var jsonpatch=require(_0x9697('0x3'));var rp=require(_0x9697('0x4'));var moment=require('moment');var BPromise=require(_0x9697('0x5'));var Mustache=require(_0x9697('0x6'));var util=require(_0x9697('0x7'));var path=require(_0x9697('0x8'));var sox=require(_0x9697('0x9'));var csv=require(_0x9697('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9697('0xb'));var _=require(_0x9697('0xc'));var squel=require(_0x9697('0xd'));var crypto=require(_0x9697('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9697('0xf'));var toCsv=require(_0x9697('0xa'));var querystring=require(_0x9697('0x10'));var Papa=require('papaparse');var Redis=require(_0x9697('0x11'));var authService=require(_0x9697('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9697('0x13'));var logger=require(_0x9697('0x14'))(_0x9697('0x15'));var utils=require(_0x9697('0x16'));var config=require(_0x9697('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9697('0x18')],{'host':_0x9697('0x19'),'port':0x18eb});var socket=require(_0x9697('0x1a'))(new Redis(config['redis']));require(_0x9697('0x1b'))[_0x9697('0x1c')](socket);function respondWithStatusCode(_0x888552,_0x29d0d5){_0x29d0d5=_0x29d0d5||0xcc;return function(_0x490b62){if(_0x490b62){return _0x888552[_0x9697('0x1d')](_0x29d0d5);}return _0x888552['status'](_0x29d0d5)[_0x9697('0x1e')]();};}function respondWithResult(_0x50e8f1,_0x70e3c){_0x70e3c=_0x70e3c||0xc8;return function(_0x56713b){if(_0x56713b){return _0x50e8f1[_0x9697('0x1f')](_0x70e3c)['json'](_0x56713b);}};}function respondWithFilteredResult(_0x519f57,_0x3013e0){return function(_0x207b0d){if(_0x207b0d){var _0x3d8b8e=typeof _0x3013e0[_0x9697('0x20')]==='undefined'&&typeof _0x3013e0['limit']===_0x9697('0x21');var _0x3e1a98=_0x207b0d['count'];var _0x42c045=_0x3d8b8e?0x0:_0x3013e0[_0x9697('0x20')];var _0x3df7d1=_0x3d8b8e?_0x207b0d['count']:_0x3013e0[_0x9697('0x20')]+_0x3013e0['limit'];var _0x38ad32;if(_0x3df7d1>=_0x3e1a98){_0x3df7d1=_0x3e1a98;_0x38ad32=0xc8;}else{_0x38ad32=0xce;}_0x519f57[_0x9697('0x1f')](_0x38ad32);return _0x519f57[_0x9697('0x22')](_0x9697('0x23'),_0x42c045+'-'+_0x3df7d1+'/'+_0x3e1a98)[_0x9697('0x24')](_0x207b0d);}return null;};}function patchUpdates(_0x2daa4a){return function(_0x33bc71){try{jsonpatch[_0x9697('0x25')](_0x33bc71,_0x2daa4a,!![]);}catch(_0x25b2d9){return BPromise[_0x9697('0x26')](_0x25b2d9);}return _0x33bc71[_0x9697('0x27')]();};}function saveUpdates(_0x704a27,_0x53bd38){return function(_0xe3bade){if(_0xe3bade){return _0xe3bade[_0x9697('0x28')](_0x704a27)[_0x9697('0x29')](function(_0x2a6fdd){return _0x2a6fdd;});}return null;};}function removeEntity(_0x18edf3,_0x4e71c2){return function(_0x37af00){if(_0x37af00){return _0x37af00[_0x9697('0x2a')]()[_0x9697('0x29')](function(){var _0x4fef82=_0x37af00[_0x9697('0x2b')]({'plain':!![]});var _0x5a5cff=_0x9697('0x2c');return db[_0x9697('0x2d')]['destroy']({'where':{'type':_0x5a5cff,'resourceId':_0x4fef82['id']}})['then'](function(){return _0x37af00;});})['then'](function(){_0x18edf3['status'](0xcc)[_0x9697('0x1e')]();});}};}function handleEntityNotFound(_0x465c4a,_0x375206){return function(_0x1f8bd5){if(!_0x1f8bd5){_0x465c4a['sendStatus'](0x194);}return _0x1f8bd5;};}function handleError(_0x5878ff,_0x5d332b){_0x5d332b=_0x5d332b||0x1f4;return function(_0x289868){logger[_0x9697('0x2e')](_0x289868[_0x9697('0x2f')]);if(_0x289868[_0x9697('0x30')]){delete _0x289868[_0x9697('0x30')];}_0x5878ff[_0x9697('0x1f')](_0x5d332b)[_0x9697('0x31')](_0x289868);};}exports[_0x9697('0x32')]=function(_0x2ac7bc,_0x20a423){var _0x1f7edd={},_0x164508={},_0x1d2a9c={'count':0x0,'rows':[]};var _0x426125=_[_0x9697('0x33')](db[_0x9697('0x34')][_0x9697('0x35')],function(_0x282bc2){return{'name':_0x282bc2[_0x9697('0x36')],'type':_0x282bc2[_0x9697('0x37')][_0x9697('0x38')]};});_0x164508[_0x9697('0x39')]=_[_0x9697('0x33')](_0x426125,'name');_0x164508[_0x9697('0x3a')]=_[_0x9697('0x3b')](_0x2ac7bc[_0x9697('0x3a')]);_0x164508['filters']=_['intersection'](_0x164508[_0x9697('0x39')],_0x164508[_0x9697('0x3a')]);_0x1f7edd[_0x9697('0x3c')]=_[_0x9697('0x3d')](_0x164508['model'],qs[_0x9697('0x3e')](_0x2ac7bc[_0x9697('0x3a')][_0x9697('0x3e')]));_0x1f7edd[_0x9697('0x3c')]=_0x1f7edd[_0x9697('0x3c')][_0x9697('0x3f')]?_0x1f7edd[_0x9697('0x3c')]:_0x164508[_0x9697('0x39')];if(!_0x2ac7bc[_0x9697('0x3a')][_0x9697('0x40')]('nolimit')){_0x1f7edd[_0x9697('0x41')]=qs[_0x9697('0x41')](_0x2ac7bc[_0x9697('0x3a')][_0x9697('0x41')]);_0x1f7edd[_0x9697('0x20')]=qs['offset'](_0x2ac7bc['query'][_0x9697('0x20')]);}_0x1f7edd['order']=qs[_0x9697('0x42')](_0x2ac7bc['query']['sort']);_0x1f7edd[_0x9697('0x43')]=qs[_0x9697('0x44')](_[_0x9697('0x45')](_0x2ac7bc[_0x9697('0x3a')],_0x164508[_0x9697('0x44')]),_0x426125);if(_0x2ac7bc[_0x9697('0x3a')][_0x9697('0x46')]){_0x1f7edd[_0x9697('0x43')]=_['merge'](_0x1f7edd[_0x9697('0x43')],{'$or':_[_0x9697('0x33')](_0x426125,function(_0x342215){if(_0x342215['type']!==_0x9697('0x47')){var _0x3c638e={};_0x3c638e[_0x342215['name']]={'$like':'%'+_0x2ac7bc[_0x9697('0x3a')]['filter']+'%'};return _0x3c638e;}})});}_0x1f7edd=_[_0x9697('0x48')]({},_0x1f7edd,_0x2ac7bc[_0x9697('0x49')]);var _0x672c8b={'where':_0x1f7edd[_0x9697('0x43')]};return db[_0x9697('0x34')][_0x9697('0x4a')](_0x672c8b)[_0x9697('0x29')](function(_0x5c270c){_0x1d2a9c[_0x9697('0x4a')]=_0x5c270c;if(_0x2ac7bc[_0x9697('0x3a')]['includeAll']){_0x1f7edd['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x1f7edd);})[_0x9697('0x29')](function(_0x162ad4){_0x1d2a9c[_0x9697('0x4b')]=_0x162ad4;return _0x1d2a9c;})[_0x9697('0x29')](respondWithFilteredResult(_0x20a423,_0x1f7edd))[_0x9697('0x4c')](handleError(_0x20a423,null));};exports[_0x9697('0x4d')]=function(_0x4be1c1,_0x4f6a83){var _0x4a8cf1={'raw':!![],'where':{'id':_0x4be1c1['params']['id']}},_0x32fd5d={};_0x32fd5d['model']=_['keys'](db[_0x9697('0x34')][_0x9697('0x35')]);_0x32fd5d[_0x9697('0x3a')]=_['keys'](_0x4be1c1[_0x9697('0x3a')]);_0x32fd5d[_0x9697('0x44')]=_[_0x9697('0x3d')](_0x32fd5d[_0x9697('0x39')],_0x32fd5d[_0x9697('0x3a')]);_0x4a8cf1['attributes']=_[_0x9697('0x3d')](_0x32fd5d[_0x9697('0x39')],qs[_0x9697('0x3e')](_0x4be1c1[_0x9697('0x3a')][_0x9697('0x3e')]));_0x4a8cf1[_0x9697('0x3c')]=_0x4a8cf1[_0x9697('0x3c')][_0x9697('0x3f')]?_0x4a8cf1[_0x9697('0x3c')]:_0x32fd5d[_0x9697('0x39')];if(_0x4be1c1[_0x9697('0x3a')]['includeAll']){_0x4a8cf1[_0x9697('0x4e')]=[{'all':!![]}];}_0x4a8cf1=_[_0x9697('0x48')]({},_0x4a8cf1,_0x4be1c1[_0x9697('0x49')]);return db[_0x9697('0x34')][_0x9697('0x4f')](_0x4a8cf1)[_0x9697('0x29')](handleEntityNotFound(_0x4f6a83,null))[_0x9697('0x29')](respondWithResult(_0x4f6a83,null))[_0x9697('0x4c')](handleError(_0x4f6a83,null));};exports[_0x9697('0x50')]=function(_0x2375c7,_0xc4c205){return db[_0x9697('0x34')][_0x9697('0x50')](_0x2375c7[_0x9697('0x51')],{})[_0x9697('0x29')](function(_0x1928fd){var _0x53996b=_0x2375c7['user'][_0x9697('0x2b')]({'plain':!![]});if(!_0x53996b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53996b['role']===_0x9697('0x52')){var _0x389c17=_0x1928fd['get']({'plain':!![]});var _0x154249=_0x9697('0x2c');return db[_0x9697('0x53')][_0x9697('0x4f')]({'where':{'name':_0x154249,'userProfileId':_0x53996b[_0x9697('0x54')]},'raw':!![]})[_0x9697('0x29')](function(_0x5d1171){if(_0x5d1171&&_0x5d1171[_0x9697('0x55')]===0x0){return db[_0x9697('0x2d')][_0x9697('0x50')]({'name':_0x389c17['name'],'resourceId':_0x389c17['id'],'type':_0x5d1171['name'],'sectionId':_0x5d1171['id']},{})['then'](function(){return _0x1928fd;});}else{return _0x1928fd;}})[_0x9697('0x4c')](function(_0x5f5a1d){logger[_0x9697('0x2e')](_0x9697('0x56'),_0x5f5a1d);throw _0x5f5a1d;});}return _0x1928fd;})[_0x9697('0x29')](respondWithResult(_0xc4c205,0xc9))['catch'](handleError(_0xc4c205,null));};exports['update']=function(_0x29d948,_0x5329b7){if(_0x29d948[_0x9697('0x51')]['id']){delete _0x29d948[_0x9697('0x51')]['id'];}return db[_0x9697('0x34')][_0x9697('0x4f')]({'where':{'id':_0x29d948[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x5329b7,null))[_0x9697('0x29')](saveUpdates(_0x29d948[_0x9697('0x51')],null))[_0x9697('0x29')](respondWithResult(_0x5329b7,null))[_0x9697('0x4c')](handleError(_0x5329b7,null));};exports[_0x9697('0x2a')]=function(_0x200b12,_0x1aead2){return db[_0x9697('0x34')][_0x9697('0x4f')]({'where':{'id':_0x200b12[_0x9697('0x57')]['id']}})['then'](handleEntityNotFound(_0x1aead2,null))[_0x9697('0x29')](removeEntity(_0x1aead2,null))['catch'](handleError(_0x1aead2,null));};exports[_0x9697('0x58')]=function(_0x1e3170,_0x21e309){return db[_0x9697('0x34')][_0x9697('0x58')]()[_0x9697('0x29')](respondWithResult(_0x21e309,null))['catch'](handleError(_0x21e309,null));};exports[_0x9697('0x59')]=function(_0x27a33b,_0x5e6536,_0x2f6f14){var _0x487851={'raw':!![],'where':{}},_0x12d620={},_0x966780;return db[_0x9697('0x34')][_0x9697('0x5a')]({'where':{'id':_0x27a33b[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x5e6536,null))[_0x9697('0x29')](function(_0x5c4c3b){if(_0x5c4c3b){_0x966780=_0x5c4c3b[_0x9697('0x2b')]({'plain':!![]});_0x12d620[_0x9697('0x39')]=_[_0x9697('0x3b')](db[_0x9697('0x5b')][_0x9697('0x35')]);_0x12d620[_0x9697('0x3a')]=_[_0x9697('0x3b')](_0x27a33b['query']);_0x12d620['filters']=_[_0x9697('0x3d')](_0x12d620[_0x9697('0x39')],_0x12d620[_0x9697('0x3a')]);_0x487851[_0x9697('0x3c')]=_[_0x9697('0x3d')](_0x12d620['model'],qs[_0x9697('0x3e')](_0x27a33b['query']['fields']));_0x487851[_0x9697('0x3c')]=_0x487851['attributes']['length']?_0x487851['attributes']:_0x12d620[_0x9697('0x39')];if(!_0x27a33b[_0x9697('0x3a')]['hasOwnProperty'](_0x9697('0x5c'))){_0x487851[_0x9697('0x41')]=qs[_0x9697('0x41')](_0x27a33b[_0x9697('0x3a')][_0x9697('0x41')]);_0x487851['offset']=qs[_0x9697('0x20')](_0x27a33b['query'][_0x9697('0x20')]);}_0x487851[_0x9697('0x5d')]=qs['sort'](_0x27a33b[_0x9697('0x3a')]['sort']);_0x487851['where']=qs[_0x9697('0x44')](_[_0x9697('0x45')](_0x27a33b[_0x9697('0x3a')],_0x12d620[_0x9697('0x44')]));_0x487851[_0x9697('0x43')][_0x9697('0x5e')]=_0x5c4c3b['id'];if(_0x27a33b[_0x9697('0x3a')][_0x9697('0x46')]){_0x487851[_0x9697('0x43')]=_[_0x9697('0x48')](_0x487851[_0x9697('0x43')],{'$or':_[_0x9697('0x33')](_0x487851['attributes'],function(_0x1b126a){var _0x23e26b={};_0x23e26b[_0x1b126a]={'$like':'%'+_0x27a33b[_0x9697('0x3a')][_0x9697('0x46')]+'%'};return _0x23e26b;})});}_0x487851=_[_0x9697('0x48')]({},_0x487851,_0x27a33b[_0x9697('0x49')]);return db[_0x9697('0x5b')][_0x9697('0x5f')](_0x487851);}})[_0x9697('0x29')](function(_0x5afa56){if(_0x5afa56){return db[_0x9697('0x60')]['findAndCountAll']({'where':{'id':_[_0x9697('0x33')](_0x5afa56,'UserId'),'role':'agent'},'attributes':['id','name',_0x9697('0x61'),_0x9697('0x62'),_0x9697('0x63')]});}})['then'](function(_0x3e72f6){if(_0x3e72f6){return{'count':_0x3e72f6[_0x9697('0x4a')],'rows':_[_0x9697('0x33')](_0x3e72f6['rows'],function(_0x155088){return{'membername':_0x155088[_0x9697('0x30')],'UserId':_0x155088['id'],'queue_name':_0x966780['name'],'FaxQueueId':_0x966780['id'],'interface':util[_0x9697('0x64')](_0x9697('0x65'),_0x9697('0x66'),_0x155088[_0x9697('0x30')]),'penalty':0x0,'paused':_0x155088[_0x9697('0x61')],'createdAt':_0x155088[_0x9697('0x63')],'updatedAt':_0x155088[_0x9697('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9697('0x29')](respondWithFilteredResult(_0x5e6536,_0x487851))[_0x9697('0x4c')](handleError(_0x5e6536,null));};exports['getTeams']=function(_0x3419d5,_0x56a131,_0x129450){var _0x10b114={};var _0x39c774={};var _0x31b06a;var _0x465572;return db[_0x9697('0x34')][_0x9697('0x5a')]({'where':{'id':_0x3419d5[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x56a131,null))['then'](function(_0x2e25b5){if(_0x2e25b5){_0x31b06a=_0x2e25b5;_0x39c774[_0x9697('0x39')]=_[_0x9697('0x3b')](db[_0x9697('0x67')][_0x9697('0x35')]);_0x39c774[_0x9697('0x3a')]=_[_0x9697('0x3b')](_0x3419d5['query']);_0x39c774['filters']=_[_0x9697('0x3d')](_0x39c774['model'],_0x39c774[_0x9697('0x3a')]);_0x10b114[_0x9697('0x3c')]=_[_0x9697('0x3d')](_0x39c774['model'],qs['fields'](_0x3419d5[_0x9697('0x3a')][_0x9697('0x3e')]));_0x10b114[_0x9697('0x3c')]=_0x10b114['attributes'][_0x9697('0x3f')]?_0x10b114[_0x9697('0x3c')]:_0x39c774[_0x9697('0x39')];_0x10b114[_0x9697('0x5d')]=qs[_0x9697('0x42')](_0x3419d5[_0x9697('0x3a')]['sort']);_0x10b114['where']=qs[_0x9697('0x44')](_[_0x9697('0x45')](_0x3419d5[_0x9697('0x3a')],_0x39c774[_0x9697('0x44')]));if(_0x3419d5['query'][_0x9697('0x46')]){_0x10b114[_0x9697('0x43')]=_[_0x9697('0x48')](_0x10b114[_0x9697('0x43')],{'$or':_[_0x9697('0x33')](_0x10b114[_0x9697('0x3c')],function(_0x2fcfce){var _0x6c0e2c={};_0x6c0e2c[_0x2fcfce]={'$like':'%'+_0x3419d5[_0x9697('0x3a')][_0x9697('0x46')]+'%'};return _0x6c0e2c;})});}_0x10b114=_[_0x9697('0x48')]({},_0x10b114,_0x3419d5[_0x9697('0x49')]);return _0x31b06a[_0x9697('0x68')](_0x10b114);}})[_0x9697('0x29')](function(_0x538c7d){if(_0x538c7d){_0x465572=_0x538c7d[_0x9697('0x3f')];if(!_0x3419d5[_0x9697('0x3a')][_0x9697('0x40')]('nolimit')){_0x10b114[_0x9697('0x41')]=qs[_0x9697('0x41')](_0x3419d5['query']['limit']);_0x10b114['offset']=qs[_0x9697('0x20')](_0x3419d5['query'][_0x9697('0x20')]);}return _0x31b06a[_0x9697('0x68')](_0x10b114);}})[_0x9697('0x29')](function(_0xb5ccaa){if(_0xb5ccaa){return _0xb5ccaa?{'count':_0x465572,'rows':_0xb5ccaa}:null;}})['then'](respondWithResult(_0x56a131,null))[_0x9697('0x4c')](handleError(_0x56a131,null));};exports[_0x9697('0x69')]=function(_0x4fe072,_0x5aac92,_0x3ba87c){var _0x24aa60=_0x4fe072['body'][_0x9697('0x6a')];return db[_0x9697('0x67')][_0x9697('0x5f')]({'where':{'id':_0x24aa60},'attributes':['id'],'include':[{'model':db[_0x9697('0x60')],'as':_0x9697('0x6b'),'attributes':['id',_0x9697('0x30'),_0x9697('0x6c'),_0x9697('0x6d'),_0x9697('0x6e')],'raw':!![]}]})['then'](function(_0x2bf481){if(_0x2bf481){var _0xb5cd16=_['flatMap'](_0x2bf481,function(_0x436271){var _0x3243ff=_0x436271['get']({'plain':!![]});return _0x3243ff['Agents'];});return db['FaxQueue'][_0x9697('0x4f')]({'where':{'id':_0x4fe072[_0x9697('0x57')]['id']}})[_0x9697('0x29')](function(_0x5f03e5){return db[_0x9697('0x6f')][_0x9697('0x70')](function(_0x5aa0a8){return _0x5f03e5[_0x9697('0x69')](_0x24aa60,{'transaction':_0x5aa0a8})[_0x9697('0x29')](function(){return BPromise['each'](_0xb5cd16,function(_0x28322f){return db[_0x9697('0x5b')][_0x9697('0x71')]({'where':{'UserId':_0x28322f['id'],'FaxQueueId':_0x4fe072[_0x9697('0x57')]['id']},'transaction':_0x5aa0a8});});})['then'](function(){_0xb5cd16[_0x9697('0x72')](function(_0x39a8c3){socket[_0x9697('0x73')](_0x9697('0x74'),{'UserId':_0x39a8c3['id'],'FaxQueueId':_0x5f03e5['id']});});});});});}})[_0x9697('0x29')](respondWithStatusCode(_0x5aac92,null))[_0x9697('0x4c')](handleError(_0x5aac92,null));};exports[_0x9697('0x75')]=function(_0x3fc7e9,_0xa1a993,_0x4e8aae){return db['Team'][_0x9697('0x5f')]({'where':{'id':_0x3fc7e9[_0x9697('0x3a')][_0x9697('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x9697('0x60')],'as':_0x9697('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x9697('0x29')](handleEntityNotFound(_0xa1a993,null))[_0x9697('0x29')](function(_0x5af705){var _0x29b1d1=_['map'](_0x5af705,'id');var _0x2b8293=[];var _0x3f1de5=[];var _0x5cd6c1=squel['select']();_0x5cd6c1[_0x9697('0x76')]('tq.TeamId')['from'](_0x9697('0x77'),'tq')[_0x9697('0x78')]('user_has_teams','ut',_0x9697('0x79'))[_0x9697('0x43')](_0x9697('0x7a'),_0x3fc7e9[_0x9697('0x57')]['id']);for(var _0x335538=0x0;_0x335538<_0x5af705['length'];_0x335538+=0x1){let _0xcf78f8=_0x5af705[_0x335538];for(var _0x4efa9f=0x0;_0x4efa9f<_0xcf78f8[_0x9697('0x6b')]['length'];_0x4efa9f+=0x1){let _0x444471=_0xcf78f8[_0x9697('0x6b')][_0x4efa9f];var _0x522b39=_0x5cd6c1[_0x9697('0x7b')]();_0x522b39[_0x9697('0x43')]('ut.UserId\x20=\x20?',_0x444471['id']);_0x3f1de5[_0x9697('0x7c')](db[_0x9697('0x6f')][_0x9697('0x3a')](_0x522b39['toString'](),{'type':db[_0x9697('0x6f')][_0x9697('0x7d')]['SELECT']})['then'](function(_0x52491e){if(_0x52491e[_0x9697('0x3f')]===0x1){return _0x444471['id'];}else{var _0x30ded6=_[_0x9697('0x7e')](_['map'](_0x52491e,_0x9697('0x7f')),function(_0x21694a){return _[_0x9697('0x80')](_0x29b1d1,_0x21694a);});if(_0x30ded6){return _0x444471['id'];}}}));}}return BPromise['all'](_0x3f1de5)['then'](function(_0x507c75){_0x2b8293=_(_0x2b8293)[_0x9697('0x81')](_0x507c75)['compact']()[_0x9697('0x82')]();return db[_0x9697('0x34')][_0x9697('0x4f')]({'where':{'id':_0x3fc7e9['params']['id']}})[_0x9697('0x29')](function(_0xf6138a){return db['sequelize']['transaction'](function(_0x45c9e4){return _0xf6138a[_0x9697('0x75')](_0x3fc7e9[_0x9697('0x3a')][_0x9697('0x6a')],{'transaction':_0x45c9e4})[_0x9697('0x29')](function(){if(!_[_0x9697('0x83')](_0x2b8293)){return _0xf6138a[_0x9697('0x84')](_0x2b8293,{'transaction':_0x45c9e4});}})[_0x9697('0x29')](function(){_0x2b8293[_0x9697('0x72')](function(_0x71215e){socket['emit']('userFaxQueue:remove',{'UserId':_0x71215e,'FaxQueueId':_0xf6138a['id']});});});});});});})['then'](respondWithStatusCode(_0xa1a993,null))[_0x9697('0x4c')](handleError(_0xa1a993,null));};exports['addAgents']=function(_0x4b26a7,_0x4202fb,_0x4b089c){return db['FaxQueue'][_0x9697('0x4f')]({'where':{'id':_0x4b26a7[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x4202fb,null))['then'](function(_0x5a3c7e){if(_0x5a3c7e){return _0x5a3c7e['addAgents'](_0x4b26a7[_0x9697('0x51')][_0x9697('0x6a')],_['omit'](_0x4b26a7[_0x9697('0x51')],['ids','id'])||{})[_0x9697('0x85')](function(_0x45e56d){for(var _0x304afc=0x0;_0x304afc<_0x4b26a7[_0x9697('0x51')][_0x9697('0x6a')][_0x9697('0x3f')];_0x304afc+=0x1){socket[_0x9697('0x73')](_0x9697('0x74'),{'UserId':Number(_0x4b26a7[_0x9697('0x51')][_0x9697('0x6a')][_0x304afc]),'FaxQueueId':Number(_0x4b26a7[_0x9697('0x57')]['id'])});}return _0x45e56d;});}})[_0x9697('0x29')](respondWithResult(_0x4202fb,null))['catch'](handleError(_0x4202fb,null));};exports[_0x9697('0x84')]=function(_0x514932,_0x52f04e,_0x276dd6){return db['FaxQueue'][_0x9697('0x4f')]({'where':{'id':_0x514932[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x52f04e,null))['then'](function(_0x3576cd){if(_0x3576cd){return _0x3576cd[_0x9697('0x84')](_0x514932[_0x9697('0x3a')]['ids'])['then'](function(){if(_['isArray'](_0x514932[_0x9697('0x3a')][_0x9697('0x6a')])){for(var _0x3259f3=0x0;_0x3259f3<_0x514932[_0x9697('0x3a')]['ids']['length'];_0x3259f3+=0x1){socket[_0x9697('0x73')](_0x9697('0x86'),{'UserId':Number(_0x514932[_0x9697('0x3a')][_0x9697('0x6a')][_0x3259f3]),'FaxQueueId':Number(_0x514932[_0x9697('0x57')]['id'])});}}else{socket[_0x9697('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x514932[_0x9697('0x3a')][_0x9697('0x6a')]),'FaxQueueId':Number(_0x514932[_0x9697('0x57')]['id'])});}});}})[_0x9697('0x29')](respondWithStatusCode(_0x52f04e,null))['catch'](handleError(_0x52f04e,null));};exports[_0x9697('0x87')]=function(_0x51d677,_0x32769e,_0x4dc03a){var _0x1cd33b={};var _0x1c7ee0={};var _0x331ed6;var _0xd26b0a;return db[_0x9697('0x34')][_0x9697('0x5a')]({'where':{'id':_0x51d677[_0x9697('0x57')]['id']}})[_0x9697('0x29')](handleEntityNotFound(_0x32769e,null))['then'](function(_0x3155f3){if(_0x3155f3){_0x331ed6=_0x3155f3;_0x1c7ee0[_0x9697('0x39')]=_[_0x9697('0x3b')](db['User'][_0x9697('0x35')]);_0x1c7ee0['query']=_[_0x9697('0x3b')](_0x51d677['query']);_0x1c7ee0['filters']=_[_0x9697('0x3d')](_0x1c7ee0[_0x9697('0x39')],_0x1c7ee0[_0x9697('0x3a')]);_0x1cd33b[_0x9697('0x3c')]=_[_0x9697('0x3d')](_0x1c7ee0['model'],qs[_0x9697('0x3e')](_0x51d677[_0x9697('0x3a')][_0x9697('0x3e')]));_0x1cd33b[_0x9697('0x3c')]=_0x1cd33b[_0x9697('0x3c')]['length']?_0x1cd33b[_0x9697('0x3c')]:_0x1c7ee0[_0x9697('0x39')];_0x1cd33b['order']=qs[_0x9697('0x42')](_0x51d677[_0x9697('0x3a')][_0x9697('0x42')]);_0x1cd33b[_0x9697('0x43')]=qs[_0x9697('0x44')](_[_0x9697('0x45')](_0x51d677['query'],_0x1c7ee0['filters']));if(_0x51d677[_0x9697('0x3a')]['filter']){_0x1cd33b['where']=_['merge'](_0x1cd33b['where'],{'$or':_[_0x9697('0x33')](_0x1cd33b[_0x9697('0x3c')],function(_0x2f37c2){var _0x49139d={};_0x49139d[_0x2f37c2]={'$like':'%'+_0x51d677['query'][_0x9697('0x46')]+'%'};return _0x49139d;})});}_0x1cd33b=_[_0x9697('0x48')]({},_0x1cd33b,_0x51d677[_0x9697('0x49')]);return _0x331ed6[_0x9697('0x87')](_0x1cd33b);}})['then'](function(_0x1fd24b){if(_0x1fd24b){_0xd26b0a=_0x1fd24b['length'];if(!_0x51d677['query']['hasOwnProperty'](_0x9697('0x5c'))){_0x1cd33b[_0x9697('0x41')]=qs['limit'](_0x51d677['query']['limit']);_0x1cd33b[_0x9697('0x20')]=qs[_0x9697('0x20')](_0x51d677[_0x9697('0x3a')][_0x9697('0x20')]);}return _0x331ed6['getAgents'](_0x1cd33b);}})[_0x9697('0x29')](function(_0x24fcd8){if(_0x24fcd8){return _0x24fcd8?{'count':_0xd26b0a,'rows':_0x24fcd8}:null;}})[_0x9697('0x29')](respondWithResult(_0x32769e,null))[_0x9697('0x4c')](handleError(_0x32769e,null));}; \ No newline at end of file +var _0x0be3=['Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','FaxQueue','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','FaxQueueId','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','User','online','voicePause','flatMap'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x0be3,0x1cc));var _0x30be=function(_0x40d722,_0x5ab18c){_0x40d722=_0x40d722-0x0;var _0x232ffa=_0x0be3[_0x40d722];return _0x232ffa;};'use strict';var emlformat=require(_0x30be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x30be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x30be('0x2'));var BPromise=require(_0x30be('0x3'));var Mustache=require(_0x30be('0x4'));var util=require(_0x30be('0x5'));var path=require(_0x30be('0x6'));var sox=require(_0x30be('0x7'));var csv=require(_0x30be('0x8'));var ejs=require(_0x30be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30be('0xa'));var squel=require(_0x30be('0xb'));var crypto=require(_0x30be('0xc'));var jsforce=require(_0x30be('0xd'));var deskjs=require(_0x30be('0xe'));var toCsv=require(_0x30be('0x8'));var querystring=require(_0x30be('0xf'));var Papa=require(_0x30be('0x10'));var Redis=require('ioredis');var authService=require(_0x30be('0x11'));var qs=require(_0x30be('0x12'));var as=require(_0x30be('0x13'));var hardwareService=require(_0x30be('0x14'));var logger=require('../../config/logger')(_0x30be('0x15'));var utils=require(_0x30be('0x16'));var config=require(_0x30be('0x17'));var licenseUtil=require(_0x30be('0x18'));var db=require(_0x30be('0x19'))['db'];config[_0x30be('0x1a')]=_['defaults'](config[_0x30be('0x1a')],{'host':_0x30be('0x1b'),'port':0x18eb});var socket=require(_0x30be('0x1c'))(new Redis(config[_0x30be('0x1a')]));require('./faxQueue.socket')[_0x30be('0x1d')](socket);function respondWithStatusCode(_0x4eddd1,_0xe15f00){_0xe15f00=_0xe15f00||0xcc;return function(_0x2e8ecf){if(_0x2e8ecf){return _0x4eddd1[_0x30be('0x1e')](_0xe15f00);}return _0x4eddd1['status'](_0xe15f00)[_0x30be('0x1f')]();};}function respondWithResult(_0x297bc4,_0x39e081){_0x39e081=_0x39e081||0xc8;return function(_0x5590e6){if(_0x5590e6){return _0x297bc4[_0x30be('0x20')](_0x39e081)['json'](_0x5590e6);}};}function respondWithFilteredResult(_0x49225b,_0x1c7550){return function(_0x4df114){if(_0x4df114){var _0x315e3d=typeof _0x1c7550[_0x30be('0x21')]===_0x30be('0x22')&&typeof _0x1c7550[_0x30be('0x23')]===_0x30be('0x22');var _0x506cd5=_0x4df114[_0x30be('0x24')];var _0x21d24b=_0x315e3d?0x0:_0x1c7550['offset'];var _0x191ab7=_0x315e3d?_0x4df114[_0x30be('0x24')]:_0x1c7550['offset']+_0x1c7550[_0x30be('0x23')];var _0x20bb9b;if(_0x191ab7>=_0x506cd5){_0x191ab7=_0x506cd5;_0x20bb9b=0xc8;}else{_0x20bb9b=0xce;}_0x49225b[_0x30be('0x20')](_0x20bb9b);return _0x49225b['set'](_0x30be('0x25'),_0x21d24b+'-'+_0x191ab7+'/'+_0x506cd5)[_0x30be('0x26')](_0x4df114);}return null;};}function patchUpdates(_0x5386bb){return function(_0x44f347){try{jsonpatch[_0x30be('0x27')](_0x44f347,_0x5386bb,!![]);}catch(_0x4a0b27){return BPromise[_0x30be('0x28')](_0x4a0b27);}return _0x44f347['save']();};}function saveUpdates(_0x31d821,_0x232812){return function(_0x2d46a0){if(_0x2d46a0){return _0x2d46a0[_0x30be('0x29')](_0x31d821)[_0x30be('0x2a')](function(_0x1eabc1){return _0x1eabc1;});}return null;};}function removeEntity(_0x36da3c,_0x658615){return function(_0x5af78c){if(_0x5af78c){return _0x5af78c[_0x30be('0x2b')]()[_0x30be('0x2a')](function(){var _0x6bc42=_0x5af78c[_0x30be('0x2c')]({'plain':!![]});var _0x3e0a01='FaxQueues';return db[_0x30be('0x2d')][_0x30be('0x2b')]({'where':{'type':_0x3e0a01,'resourceId':_0x6bc42['id']}})[_0x30be('0x2a')](function(){return _0x5af78c;});})[_0x30be('0x2a')](function(){_0x36da3c[_0x30be('0x20')](0xcc)[_0x30be('0x1f')]();});}};}function handleEntityNotFound(_0x3a39ab,_0x551acf){return function(_0x37bb46){if(!_0x37bb46){_0x3a39ab[_0x30be('0x1e')](0x194);}return _0x37bb46;};}function handleError(_0x544fba,_0x572523){_0x572523=_0x572523||0x1f4;return function(_0x400e46){logger[_0x30be('0x2e')](_0x400e46[_0x30be('0x2f')]);if(_0x400e46[_0x30be('0x30')]){delete _0x400e46['name'];}_0x544fba['status'](_0x572523)['send'](_0x400e46);};}exports[_0x30be('0x31')]=function(_0x3b2780,_0x2e887e){var _0x221bfe={},_0x58a1ae={},_0x425777={'count':0x0,'rows':[]};var _0x1d4544=_[_0x30be('0x32')](db[_0x30be('0x33')]['rawAttributes'],function(_0x355dcf){return{'name':_0x355dcf[_0x30be('0x34')],'type':_0x355dcf[_0x30be('0x35')][_0x30be('0x36')]};});_0x58a1ae[_0x30be('0x37')]=_[_0x30be('0x32')](_0x1d4544,'name');_0x58a1ae[_0x30be('0x38')]=_[_0x30be('0x39')](_0x3b2780[_0x30be('0x38')]);_0x58a1ae[_0x30be('0x3a')]=_['intersection'](_0x58a1ae[_0x30be('0x37')],_0x58a1ae[_0x30be('0x38')]);_0x221bfe[_0x30be('0x3b')]=_[_0x30be('0x3c')](_0x58a1ae[_0x30be('0x37')],qs['fields'](_0x3b2780[_0x30be('0x38')]['fields']));_0x221bfe[_0x30be('0x3b')]=_0x221bfe[_0x30be('0x3b')][_0x30be('0x3d')]?_0x221bfe['attributes']:_0x58a1ae[_0x30be('0x37')];if(!_0x3b2780[_0x30be('0x38')][_0x30be('0x3e')](_0x30be('0x3f'))){_0x221bfe['limit']=qs[_0x30be('0x23')](_0x3b2780[_0x30be('0x38')][_0x30be('0x23')]);_0x221bfe[_0x30be('0x21')]=qs['offset'](_0x3b2780[_0x30be('0x38')][_0x30be('0x21')]);}_0x221bfe[_0x30be('0x40')]=qs[_0x30be('0x41')](_0x3b2780[_0x30be('0x38')]['sort']);_0x221bfe['where']=qs[_0x30be('0x3a')](_[_0x30be('0x42')](_0x3b2780[_0x30be('0x38')],_0x58a1ae[_0x30be('0x3a')]),_0x1d4544);if(_0x3b2780['query']['filter']){_0x221bfe[_0x30be('0x43')]=_[_0x30be('0x44')](_0x221bfe[_0x30be('0x43')],{'$or':_[_0x30be('0x32')](_0x1d4544,function(_0x5de646){if(_0x5de646['type']!==_0x30be('0x45')){var _0x2f2f3a={};_0x2f2f3a[_0x5de646[_0x30be('0x30')]]={'$like':'%'+_0x3b2780[_0x30be('0x38')][_0x30be('0x46')]+'%'};return _0x2f2f3a;}})});}_0x221bfe=_[_0x30be('0x44')]({},_0x221bfe,_0x3b2780['options']);var _0x360060={'where':_0x221bfe['where']};return db[_0x30be('0x33')][_0x30be('0x24')](_0x360060)[_0x30be('0x2a')](function(_0x34c320){_0x425777[_0x30be('0x24')]=_0x34c320;if(_0x3b2780['query'][_0x30be('0x47')]){_0x221bfe[_0x30be('0x48')]=[{'all':!![]}];}return db['FaxQueue'][_0x30be('0x49')](_0x221bfe);})[_0x30be('0x2a')](function(_0x184fa5){_0x425777[_0x30be('0x4a')]=_0x184fa5;return _0x425777;})[_0x30be('0x2a')](respondWithFilteredResult(_0x2e887e,_0x221bfe))[_0x30be('0x4b')](handleError(_0x2e887e,null));};exports[_0x30be('0x4c')]=function(_0x1688ee,_0x44507c){var _0x5b182d={'raw':!![],'where':{'id':_0x1688ee[_0x30be('0x4d')]['id']}},_0x52c580={};_0x52c580['model']=_[_0x30be('0x39')](db[_0x30be('0x33')][_0x30be('0x4e')]);_0x52c580[_0x30be('0x38')]=_[_0x30be('0x39')](_0x1688ee[_0x30be('0x38')]);_0x52c580[_0x30be('0x3a')]=_[_0x30be('0x3c')](_0x52c580[_0x30be('0x37')],_0x52c580['query']);_0x5b182d['attributes']=_[_0x30be('0x3c')](_0x52c580[_0x30be('0x37')],qs[_0x30be('0x4f')](_0x1688ee['query'][_0x30be('0x4f')]));_0x5b182d[_0x30be('0x3b')]=_0x5b182d[_0x30be('0x3b')][_0x30be('0x3d')]?_0x5b182d[_0x30be('0x3b')]:_0x52c580['model'];if(_0x1688ee[_0x30be('0x38')][_0x30be('0x47')]){_0x5b182d['include']=[{'all':!![]}];}_0x5b182d=_['merge']({},_0x5b182d,_0x1688ee[_0x30be('0x50')]);return db[_0x30be('0x33')][_0x30be('0x51')](_0x5b182d)[_0x30be('0x2a')](handleEntityNotFound(_0x44507c,null))['then'](respondWithResult(_0x44507c,null))[_0x30be('0x4b')](handleError(_0x44507c,null));};exports[_0x30be('0x52')]=function(_0x4d3367,_0x452358){return db[_0x30be('0x33')][_0x30be('0x52')](_0x4d3367[_0x30be('0x53')],{})[_0x30be('0x2a')](function(_0x596fc2){var _0x5da44f=_0x4d3367[_0x30be('0x54')][_0x30be('0x2c')]({'plain':!![]});if(!_0x5da44f)throw new Error(_0x30be('0x55'));if(_0x5da44f[_0x30be('0x56')]==='user'){var _0x490b19=_0x596fc2[_0x30be('0x2c')]({'plain':!![]});var _0x2203ac='FaxQueues';return db['UserProfileSection'][_0x30be('0x51')]({'where':{'name':_0x2203ac,'userProfileId':_0x5da44f[_0x30be('0x57')]},'raw':!![]})['then'](function(_0x3054ec){if(_0x3054ec&&_0x3054ec[_0x30be('0x58')]===0x0){return db['UserProfileResource'][_0x30be('0x52')]({'name':_0x490b19[_0x30be('0x30')],'resourceId':_0x490b19['id'],'type':_0x3054ec[_0x30be('0x30')],'sectionId':_0x3054ec['id']},{})['then'](function(){return _0x596fc2;});}else{return _0x596fc2;}})[_0x30be('0x4b')](function(_0x114042){logger[_0x30be('0x2e')](_0x30be('0x59'),_0x114042);throw _0x114042;});}return _0x596fc2;})[_0x30be('0x2a')](respondWithResult(_0x452358,0xc9))[_0x30be('0x4b')](handleError(_0x452358,null));};exports[_0x30be('0x29')]=function(_0x4ccdf4,_0x364fd1){if(_0x4ccdf4[_0x30be('0x53')]['id']){delete _0x4ccdf4[_0x30be('0x53')]['id'];}return db[_0x30be('0x33')][_0x30be('0x51')]({'where':{'id':_0x4ccdf4[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x364fd1,null))[_0x30be('0x2a')](saveUpdates(_0x4ccdf4[_0x30be('0x53')],null))['then'](respondWithResult(_0x364fd1,null))['catch'](handleError(_0x364fd1,null));};exports[_0x30be('0x2b')]=function(_0xf20777,_0x5e1e8b){return db[_0x30be('0x33')]['find']({'where':{'id':_0xf20777['params']['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x5e1e8b,null))[_0x30be('0x2a')](removeEntity(_0x5e1e8b,null))[_0x30be('0x4b')](handleError(_0x5e1e8b,null));};exports['describe']=function(_0x35e7c9,_0x4209d4){return db['FaxQueue']['describe']()['then'](respondWithResult(_0x4209d4,null))[_0x30be('0x4b')](handleError(_0x4209d4,null));};exports['getMembers']=function(_0x2e4a3b,_0x496676,_0x59ff33){var _0x4c8e74={'raw':!![],'where':{}},_0x4254bb={},_0x33666b;return db[_0x30be('0x33')][_0x30be('0x5a')]({'where':{'id':_0x2e4a3b[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x496676,null))['then'](function(_0x400974){if(_0x400974){_0x33666b=_0x400974['get']({'plain':!![]});_0x4254bb['model']=_['keys'](db['UserFaxQueue'][_0x30be('0x4e')]);_0x4254bb[_0x30be('0x38')]=_[_0x30be('0x39')](_0x2e4a3b[_0x30be('0x38')]);_0x4254bb['filters']=_['intersection'](_0x4254bb[_0x30be('0x37')],_0x4254bb[_0x30be('0x38')]);_0x4c8e74['attributes']=_['intersection'](_0x4254bb[_0x30be('0x37')],qs[_0x30be('0x4f')](_0x2e4a3b[_0x30be('0x38')][_0x30be('0x4f')]));_0x4c8e74[_0x30be('0x3b')]=_0x4c8e74[_0x30be('0x3b')][_0x30be('0x3d')]?_0x4c8e74[_0x30be('0x3b')]:_0x4254bb[_0x30be('0x37')];if(!_0x2e4a3b[_0x30be('0x38')][_0x30be('0x3e')](_0x30be('0x3f'))){_0x4c8e74[_0x30be('0x23')]=qs[_0x30be('0x23')](_0x2e4a3b[_0x30be('0x38')]['limit']);_0x4c8e74[_0x30be('0x21')]=qs['offset'](_0x2e4a3b[_0x30be('0x38')][_0x30be('0x21')]);}_0x4c8e74[_0x30be('0x40')]=qs[_0x30be('0x41')](_0x2e4a3b[_0x30be('0x38')][_0x30be('0x41')]);_0x4c8e74['where']=qs['filters'](_['pick'](_0x2e4a3b[_0x30be('0x38')],_0x4254bb[_0x30be('0x3a')]));_0x4c8e74[_0x30be('0x43')][_0x30be('0x5b')]=_0x400974['id'];if(_0x2e4a3b[_0x30be('0x38')][_0x30be('0x46')]){_0x4c8e74[_0x30be('0x43')]=_[_0x30be('0x44')](_0x4c8e74['where'],{'$or':_[_0x30be('0x32')](_0x4c8e74['attributes'],function(_0x39fbf4){var _0x82c81f={};_0x82c81f[_0x39fbf4]={'$like':'%'+_0x2e4a3b[_0x30be('0x38')][_0x30be('0x46')]+'%'};return _0x82c81f;})});}_0x4c8e74=_[_0x30be('0x44')]({},_0x4c8e74,_0x2e4a3b['options']);return db[_0x30be('0x5c')][_0x30be('0x49')](_0x4c8e74);}})[_0x30be('0x2a')](function(_0x3a5fcf){if(_0x3a5fcf){return db['User'][_0x30be('0x5d')]({'where':{'id':_[_0x30be('0x32')](_0x3a5fcf,_0x30be('0x5e')),'role':_0x30be('0x5f')},'attributes':['id',_0x30be('0x30'),_0x30be('0x60'),_0x30be('0x61'),_0x30be('0x62')]});}})[_0x30be('0x2a')](function(_0x13dcff){if(_0x13dcff){return{'count':_0x13dcff['count'],'rows':_[_0x30be('0x32')](_0x13dcff[_0x30be('0x4a')],function(_0x5e314e){return{'membername':_0x5e314e[_0x30be('0x30')],'UserId':_0x5e314e['id'],'queue_name':_0x33666b[_0x30be('0x30')],'FaxQueueId':_0x33666b['id'],'interface':util[_0x30be('0x63')]('%s/%s',_0x30be('0x64'),_0x5e314e[_0x30be('0x30')]),'penalty':0x0,'paused':_0x5e314e[_0x30be('0x60')],'createdAt':_0x5e314e[_0x30be('0x62')],'updatedAt':_0x5e314e[_0x30be('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x30be('0x2a')](respondWithFilteredResult(_0x496676,_0x4c8e74))[_0x30be('0x4b')](handleError(_0x496676,null));};exports[_0x30be('0x65')]=function(_0x30ba0b,_0x5ee7ff,_0x475674){var _0x36ddc7={};var _0x69b8d0={};var _0x53cb4c;var _0x5a8118;return db['FaxQueue'][_0x30be('0x5a')]({'where':{'id':_0x30ba0b[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x5ee7ff,null))[_0x30be('0x2a')](function(_0x506210){if(_0x506210){_0x53cb4c=_0x506210;_0x69b8d0[_0x30be('0x37')]=_[_0x30be('0x39')](db[_0x30be('0x66')][_0x30be('0x4e')]);_0x69b8d0[_0x30be('0x38')]=_['keys'](_0x30ba0b['query']);_0x69b8d0[_0x30be('0x3a')]=_[_0x30be('0x3c')](_0x69b8d0[_0x30be('0x37')],_0x69b8d0['query']);_0x36ddc7[_0x30be('0x3b')]=_[_0x30be('0x3c')](_0x69b8d0[_0x30be('0x37')],qs['fields'](_0x30ba0b[_0x30be('0x38')]['fields']));_0x36ddc7[_0x30be('0x3b')]=_0x36ddc7[_0x30be('0x3b')][_0x30be('0x3d')]?_0x36ddc7[_0x30be('0x3b')]:_0x69b8d0[_0x30be('0x37')];_0x36ddc7[_0x30be('0x40')]=qs[_0x30be('0x41')](_0x30ba0b[_0x30be('0x38')][_0x30be('0x41')]);_0x36ddc7[_0x30be('0x43')]=qs[_0x30be('0x3a')](_[_0x30be('0x42')](_0x30ba0b[_0x30be('0x38')],_0x69b8d0['filters']));if(_0x30ba0b[_0x30be('0x38')]['filter']){_0x36ddc7['where']=_[_0x30be('0x44')](_0x36ddc7['where'],{'$or':_[_0x30be('0x32')](_0x36ddc7[_0x30be('0x3b')],function(_0x53dd8d){var _0x40e630={};_0x40e630[_0x53dd8d]={'$like':'%'+_0x30ba0b['query'][_0x30be('0x46')]+'%'};return _0x40e630;})});}_0x36ddc7=_[_0x30be('0x44')]({},_0x36ddc7,_0x30ba0b[_0x30be('0x50')]);return _0x53cb4c[_0x30be('0x65')](_0x36ddc7);}})[_0x30be('0x2a')](function(_0x1e494a){if(_0x1e494a){_0x5a8118=_0x1e494a[_0x30be('0x3d')];if(!_0x30ba0b[_0x30be('0x38')]['hasOwnProperty'](_0x30be('0x3f'))){_0x36ddc7[_0x30be('0x23')]=qs[_0x30be('0x23')](_0x30ba0b['query'][_0x30be('0x23')]);_0x36ddc7[_0x30be('0x21')]=qs[_0x30be('0x21')](_0x30ba0b['query']['offset']);}return _0x53cb4c[_0x30be('0x65')](_0x36ddc7);}})['then'](function(_0x4b06d){if(_0x4b06d){return _0x4b06d?{'count':_0x5a8118,'rows':_0x4b06d}:null;}})[_0x30be('0x2a')](respondWithResult(_0x5ee7ff,null))[_0x30be('0x4b')](handleError(_0x5ee7ff,null));};exports['addTeams']=function(_0x4ad2a7,_0x2a15be,_0x3a33da){var _0x548d3a=_0x4ad2a7[_0x30be('0x53')][_0x30be('0x67')];return db['Team'][_0x30be('0x49')]({'where':{'id':_0x548d3a},'attributes':['id'],'include':[{'model':db[_0x30be('0x68')],'as':'Agents','attributes':['id',_0x30be('0x30'),_0x30be('0x69'),_0x30be('0x6a'),'interface'],'raw':!![]}]})[_0x30be('0x2a')](function(_0x4c8edb){if(_0x4c8edb){var _0x21bb8a=_[_0x30be('0x6b')](_0x4c8edb,function(_0x5aa0cc){var _0x24e6ac=_0x5aa0cc[_0x30be('0x2c')]({'plain':!![]});return _0x24e6ac[_0x30be('0x6c')];});return db[_0x30be('0x33')][_0x30be('0x51')]({'where':{'id':_0x4ad2a7['params']['id']}})[_0x30be('0x2a')](function(_0x555e53){return db[_0x30be('0x6d')][_0x30be('0x6e')](function(_0x36afa3){return _0x555e53[_0x30be('0x6f')](_0x548d3a,{'transaction':_0x36afa3})[_0x30be('0x2a')](function(){return BPromise[_0x30be('0x70')](_0x21bb8a,function(_0x1444ca){return db[_0x30be('0x5c')][_0x30be('0x71')]({'where':{'UserId':_0x1444ca['id'],'FaxQueueId':_0x4ad2a7[_0x30be('0x4d')]['id']},'transaction':_0x36afa3});});})[_0x30be('0x2a')](function(){_0x21bb8a[_0x30be('0x72')](function(_0x355c46){socket[_0x30be('0x73')](_0x30be('0x74'),{'UserId':_0x355c46['id'],'FaxQueueId':_0x555e53['id']});});});});});}})[_0x30be('0x2a')](respondWithStatusCode(_0x2a15be,null))[_0x30be('0x4b')](handleError(_0x2a15be,null));};exports[_0x30be('0x75')]=function(_0x58c420,_0x3e50e0,_0x1993bf){return db['Team']['findAll']({'where':{'id':_0x58c420['query'][_0x30be('0x67')]},'attributes':['id'],'include':[{'model':db[_0x30be('0x68')],'as':_0x30be('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x30be('0x2a')](handleEntityNotFound(_0x3e50e0,null))[_0x30be('0x2a')](function(_0x702e9d){var _0x3865d6=_[_0x30be('0x32')](_0x702e9d,'id');var _0x5b12c9=[];var _0x42f963=[];var _0x15607a=squel[_0x30be('0x76')]();_0x15607a[_0x30be('0x77')]('tq.TeamId')[_0x30be('0x78')]('team_has_fax_queues','tq')[_0x30be('0x79')](_0x30be('0x7a'),'ut',_0x30be('0x7b'))['where'](_0x30be('0x7c'),_0x58c420[_0x30be('0x4d')]['id']);for(var _0x3051b8=0x0;_0x3051b8<_0x702e9d['length'];_0x3051b8+=0x1){let _0x3391c9=_0x702e9d[_0x3051b8];for(var _0x5e4d5e=0x0;_0x5e4d5e<_0x3391c9[_0x30be('0x6c')][_0x30be('0x3d')];_0x5e4d5e+=0x1){let _0x161d65=_0x3391c9[_0x30be('0x6c')][_0x5e4d5e];var _0x41b77c=_0x15607a[_0x30be('0x7d')]();_0x41b77c['where']('ut.UserId\x20=\x20?',_0x161d65['id']);_0x42f963['push'](db[_0x30be('0x6d')][_0x30be('0x38')](_0x41b77c[_0x30be('0x7e')](),{'type':db[_0x30be('0x6d')][_0x30be('0x7f')][_0x30be('0x80')]})[_0x30be('0x2a')](function(_0x3ce9f6){if(_0x3ce9f6[_0x30be('0x3d')]===0x1){return _0x161d65['id'];}else{var _0x5ba50d=_[_0x30be('0x81')](_[_0x30be('0x32')](_0x3ce9f6,_0x30be('0x82')),function(_0x47bcb3){return _[_0x30be('0x83')](_0x3865d6,_0x47bcb3);});if(_0x5ba50d){return _0x161d65['id'];}}}));}}return BPromise['all'](_0x42f963)[_0x30be('0x2a')](function(_0x46b5f3){_0x5b12c9=_(_0x5b12c9)[_0x30be('0x84')](_0x46b5f3)[_0x30be('0x85')]()['value']();return db[_0x30be('0x33')][_0x30be('0x51')]({'where':{'id':_0x58c420[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](function(_0x599905){return db['sequelize'][_0x30be('0x6e')](function(_0x56d791){return _0x599905['removeTeams'](_0x58c420[_0x30be('0x38')][_0x30be('0x67')],{'transaction':_0x56d791})['then'](function(){if(!_[_0x30be('0x86')](_0x5b12c9)){return _0x599905[_0x30be('0x87')](_0x5b12c9,{'transaction':_0x56d791});}})[_0x30be('0x2a')](function(){_0x5b12c9[_0x30be('0x72')](function(_0x224d27){socket['emit'](_0x30be('0x88'),{'UserId':_0x224d27,'FaxQueueId':_0x599905['id']});});});});});});})['then'](respondWithStatusCode(_0x3e50e0,null))[_0x30be('0x4b')](handleError(_0x3e50e0,null));};exports['addAgents']=function(_0x29e8b4,_0xc26590,_0x5bd50c){return db[_0x30be('0x33')]['find']({'where':{'id':_0x29e8b4[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0xc26590,null))[_0x30be('0x2a')](function(_0x230782){if(_0x230782){return _0x230782[_0x30be('0x89')](_0x29e8b4[_0x30be('0x53')][_0x30be('0x67')],_[_0x30be('0x8a')](_0x29e8b4[_0x30be('0x53')],[_0x30be('0x67'),'id'])||{})[_0x30be('0x8b')](function(_0x16683f){for(var _0x4de658=0x0;_0x4de658<_0x29e8b4['body'][_0x30be('0x67')][_0x30be('0x3d')];_0x4de658+=0x1){socket['emit'](_0x30be('0x74'),{'UserId':Number(_0x29e8b4['body'][_0x30be('0x67')][_0x4de658]),'FaxQueueId':Number(_0x29e8b4['params']['id'])});}return _0x16683f;});}})[_0x30be('0x2a')](respondWithResult(_0xc26590,null))[_0x30be('0x4b')](handleError(_0xc26590,null));};exports[_0x30be('0x87')]=function(_0x5c0671,_0x59f043,_0x261098){return db['FaxQueue']['find']({'where':{'id':_0x5c0671[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x59f043,null))[_0x30be('0x2a')](function(_0x4e3079){if(_0x4e3079){return _0x4e3079[_0x30be('0x87')](_0x5c0671[_0x30be('0x38')][_0x30be('0x67')])['then'](function(){if(_[_0x30be('0x8c')](_0x5c0671[_0x30be('0x38')][_0x30be('0x67')])){for(var _0x2fdbcb=0x0;_0x2fdbcb<_0x5c0671[_0x30be('0x38')][_0x30be('0x67')][_0x30be('0x3d')];_0x2fdbcb+=0x1){socket[_0x30be('0x73')](_0x30be('0x88'),{'UserId':Number(_0x5c0671[_0x30be('0x38')]['ids'][_0x2fdbcb]),'FaxQueueId':Number(_0x5c0671['params']['id'])});}}else{socket[_0x30be('0x73')](_0x30be('0x88'),{'UserId':Number(_0x5c0671[_0x30be('0x38')][_0x30be('0x67')]),'FaxQueueId':Number(_0x5c0671[_0x30be('0x4d')]['id'])});}});}})[_0x30be('0x2a')](respondWithStatusCode(_0x59f043,null))[_0x30be('0x4b')](handleError(_0x59f043,null));};exports[_0x30be('0x8d')]=function(_0x548f1d,_0x4543e8,_0x1f61e1){var _0x454a29={};var _0x1371dc={};var _0x1bed87;var _0xf8c90;return db['FaxQueue'][_0x30be('0x5a')]({'where':{'id':_0x548f1d[_0x30be('0x4d')]['id']}})[_0x30be('0x2a')](handleEntityNotFound(_0x4543e8,null))[_0x30be('0x2a')](function(_0x424fab){if(_0x424fab){_0x1bed87=_0x424fab;_0x1371dc[_0x30be('0x37')]=_[_0x30be('0x39')](db['User']['rawAttributes']);_0x1371dc['query']=_[_0x30be('0x39')](_0x548f1d[_0x30be('0x38')]);_0x1371dc[_0x30be('0x3a')]=_[_0x30be('0x3c')](_0x1371dc[_0x30be('0x37')],_0x1371dc[_0x30be('0x38')]);_0x454a29[_0x30be('0x3b')]=_[_0x30be('0x3c')](_0x1371dc[_0x30be('0x37')],qs['fields'](_0x548f1d[_0x30be('0x38')][_0x30be('0x4f')]));_0x454a29[_0x30be('0x3b')]=_0x454a29[_0x30be('0x3b')][_0x30be('0x3d')]?_0x454a29[_0x30be('0x3b')]:_0x1371dc[_0x30be('0x37')];_0x454a29[_0x30be('0x40')]=qs[_0x30be('0x41')](_0x548f1d['query'][_0x30be('0x41')]);_0x454a29[_0x30be('0x43')]=qs[_0x30be('0x3a')](_['pick'](_0x548f1d[_0x30be('0x38')],_0x1371dc[_0x30be('0x3a')]));if(_0x548f1d['query']['filter']){_0x454a29['where']=_['merge'](_0x454a29[_0x30be('0x43')],{'$or':_[_0x30be('0x32')](_0x454a29[_0x30be('0x3b')],function(_0x5ea4c9){var _0x3a3848={};_0x3a3848[_0x5ea4c9]={'$like':'%'+_0x548f1d[_0x30be('0x38')][_0x30be('0x46')]+'%'};return _0x3a3848;})});}_0x454a29=_[_0x30be('0x44')]({},_0x454a29,_0x548f1d[_0x30be('0x50')]);return _0x1bed87[_0x30be('0x8d')](_0x454a29);}})[_0x30be('0x2a')](function(_0x5349f5){if(_0x5349f5){_0xf8c90=_0x5349f5[_0x30be('0x3d')];if(!_0x548f1d['query'][_0x30be('0x3e')](_0x30be('0x3f'))){_0x454a29['limit']=qs['limit'](_0x548f1d[_0x30be('0x38')][_0x30be('0x23')]);_0x454a29[_0x30be('0x21')]=qs[_0x30be('0x21')](_0x548f1d['query'][_0x30be('0x21')]);}return _0x1bed87['getAgents'](_0x454a29);}})[_0x30be('0x2a')](function(_0x149d77){if(_0x149d77){return _0x149d77?{'count':_0xf8c90,'rows':_0x149d77}:null;}})['then'](respondWithResult(_0x4543e8,null))[_0x30be('0x4b')](handleError(_0x4543e8,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index fb09b70..9b0f7f6 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 _0x29a3=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x29a3,0x1c9));var _0x329a=function(_0x2afae1,_0x1a41d0){_0x2afae1=_0x2afae1-0x0;var _0x57665c=_0x29a3[_0x2afae1];return _0x57665c;};'use strict';var EventEmitter=require(_0x329a('0x0'));var FaxQueue=require(_0x329a('0x1'))['db'][_0x329a('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x329a('0x3')](0x0);var events={'afterCreate':_0x329a('0x4'),'afterUpdate':_0x329a('0x5'),'afterDestroy':_0x329a('0x6')};function emitEvent(_0x36efa7){return function(_0x433969,_0x5e31af,_0x2a090d){FaxQueueEvents[_0x329a('0x7')](_0x36efa7+':'+_0x433969['id'],_0x433969);FaxQueueEvents[_0x329a('0x7')](_0x36efa7,_0x433969);_0x2a090d(null);};}for(var e in events){if(events[_0x329a('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x329a('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x704c=['save','update','remove','emit','hook','exports','events'];(function(_0x172e0a,_0x15d22a){var _0x4baf16=function(_0xcbd5e5){while(--_0xcbd5e5){_0x172e0a['push'](_0x172e0a['shift']());}};_0x4baf16(++_0x15d22a);}(_0x704c,0x172));var _0xc704=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x704c[_0x6a0266];return _0x309e00;};'use strict';var EventEmitter=require(_0xc704('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc704('0x1'),'afterUpdate':_0xc704('0x2'),'afterDestroy':_0xc704('0x3')};function emitEvent(_0x2932b4){return function(_0x17ee98,_0x352fc1,_0x4a3037){FaxQueueEvents[_0xc704('0x4')](_0x2932b4+':'+_0x17ee98['id'],_0x17ee98);FaxQueueEvents['emit'](_0x2932b4,_0x17ee98);_0x4a3037(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xc704('0x5')](e,emitEvent(event));}}module[_0xc704('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 1b1a267..bbbb1c7 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 _0xd1f7=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','bluebird','request-promise'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd1f7,0x11b));var _0x7d1f=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0xd1f7[_0x65c597];return _0x1ec368;};'use strict';var _=require('lodash');var util=require(_0x7d1f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7d1f('0x1'));var rp=require(_0x7d1f('0x2'));var fs=require('fs');var path=require(_0x7d1f('0x3'));var rimraf=require(_0x7d1f('0x4'));var config=require(_0x7d1f('0x5'));var attributes=require(_0x7d1f('0x6'));module[_0x7d1f('0x7')]=function(_0x418892,_0x352814){return _0x418892[_0x7d1f('0x8')](_0x7d1f('0x9'),attributes,{'tableName':_0x7d1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7207=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger','moment','path'];(function(_0x4092ba,_0x3b7c0a){var _0x3e4433=function(_0x3ebac6){while(--_0x3ebac6){_0x4092ba['push'](_0x4092ba['shift']());}};_0x3e4433(++_0x3b7c0a);}(_0x7207,0x1e0));var _0x7720=function(_0x2f36e2,_0x17699f){_0x2f36e2=_0x2f36e2-0x0;var _0x3de763=_0x7207[_0x2f36e2];return _0x3de763;};'use strict';var _=require(_0x7720('0x0'));var util=require('util');var logger=require(_0x7720('0x1'))('api');var moment=require(_0x7720('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7720('0x3'));var rimraf=require(_0x7720('0x4'));var config=require(_0x7720('0x5'));var attributes=require(_0x7720('0x6'));module[_0x7720('0x7')]=function(_0x2c67c2,_0x121b8a){return _0x2c67c2[_0x7720('0x8')](_0x7720('0x9'),attributes,{'tableName':_0x7720('0xa'),'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 13bda09..9221392 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 _0xf426=['catch','GetFaxQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowFaxQueue','FaxQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x3bf7d1,_0x124cb9){var _0x5db5f1=function(_0x2b23bf){while(--_0x2b23bf){_0x3bf7d1['push'](_0x3bf7d1['shift']());}};_0x5db5f1(++_0x124cb9);}(_0xf426,0x86));var _0x6f42=function(_0x46b832,_0x454e18){_0x46b832=_0x46b832-0x0;var _0x42b328=_0xf426[_0x46b832];return _0x42b328;};'use strict';var _=require('lodash');var util=require(_0x6f42('0x0'));var moment=require(_0x6f42('0x1'));var BPromise=require('bluebird');var rs=require(_0x6f42('0x2'));var fs=require('fs');var Redis=require(_0x6f42('0x3'));var db=require(_0x6f42('0x4'))['db'];var utils=require(_0x6f42('0x5'));var logger=require(_0x6f42('0x6'))(_0x6f42('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f42('0x8'));var client=jayson[_0x6f42('0x9')][_0x6f42('0xa')]({'port':0x232a});config['redis']=_[_0x6f42('0xb')](config[_0x6f42('0xc')],{'host':_0x6f42('0xd'),'port':0x18eb});var socket=require(_0x6f42('0xe'))(new Redis(config[_0x6f42('0xc')]));require(_0x6f42('0xf'))[_0x6f42('0x10')](socket);function respondWithRpcPromise(_0x222f30,_0x46863a,_0x594b94){return new BPromise(function(_0x4a8311,_0x4e0ca4){return client[_0x6f42('0x11')](_0x222f30,_0x594b94)[_0x6f42('0x12')](function(_0x3f92d0){logger[_0x6f42('0x13')](_0x6f42('0x14'),_0x46863a,_0x6f42('0x15'));logger[_0x6f42('0x16')](_0x6f42('0x17'),_0x46863a,'request\x20sent',JSON['stringify'](_0x3f92d0));if(_0x3f92d0[_0x6f42('0x18')]){if(_0x3f92d0[_0x6f42('0x18')]['code']===0x1f4){logger['error'](_0x6f42('0x14'),_0x46863a,_0x3f92d0[_0x6f42('0x18')][_0x6f42('0x19')]);return _0x4e0ca4(_0x3f92d0[_0x6f42('0x18')][_0x6f42('0x19')]);}logger['error'](_0x6f42('0x14'),_0x46863a,_0x3f92d0[_0x6f42('0x18')][_0x6f42('0x19')]);return _0x4a8311(_0x3f92d0[_0x6f42('0x18')][_0x6f42('0x19')]);}else{logger['info'](_0x6f42('0x14'),_0x46863a,'request\x20sent');_0x4a8311(_0x3f92d0['result']['message']);}})[_0x6f42('0x1a')](function(_0x28fee6){logger[_0x6f42('0x18')](_0x6f42('0x14'),_0x46863a,_0x28fee6);_0x4e0ca4(_0x28fee6);});});}exports[_0x6f42('0x1b')]=function(_0x351bac){var _0x36f78d=this;return new Promise(function(_0x537bc9,_0x4ea209){return db['FaxQueue']['findAll']({'raw':_0x351bac[_0x6f42('0x1c')]?_0x351bac['options'][_0x6f42('0x1d')]===undefined?!![]:![]:!![],'where':_0x351bac['options']?_0x351bac['options'][_0x6f42('0x1e')]||null:null,'attributes':_0x351bac[_0x6f42('0x1c')]?_0x351bac['options'][_0x6f42('0x1f')]||null:null,'limit':_0x351bac[_0x6f42('0x1c')]?_0x351bac['options'][_0x6f42('0x20')]||null:null,'include':_0x351bac[_0x6f42('0x1c')]?_0x351bac[_0x6f42('0x1c')][_0x6f42('0x21')]?_[_0x6f42('0x22')](_0x351bac[_0x6f42('0x1c')][_0x6f42('0x21')],function(_0x1b8c3e){return{'model':db[_0x1b8c3e['model']],'as':_0x1b8c3e['as'],'attributes':_0x1b8c3e[_0x6f42('0x1f')],'include':_0x1b8c3e[_0x6f42('0x21')]?_[_0x6f42('0x22')](_0x1b8c3e[_0x6f42('0x21')],function(_0x446359){return{'model':db[_0x446359[_0x6f42('0x23')]],'as':_0x446359['as'],'attributes':_0x446359['attributes'],'include':_0x446359[_0x6f42('0x21')]?_[_0x6f42('0x22')](_0x446359[_0x6f42('0x21')],function(_0xabc6b8){return{'model':db[_0xabc6b8['model']],'as':_0xabc6b8['as'],'attributes':_0xabc6b8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c77f7){logger[_0x6f42('0x13')](_0x6f42('0x1b'),_0x351bac);logger[_0x6f42('0x16')](_0x6f42('0x1b'),_0x351bac,JSON[_0x6f42('0x24')](_0x4c77f7));_0x537bc9(_0x4c77f7);})[_0x6f42('0x1a')](function(_0x21dba9){logger[_0x6f42('0x18')](_0x6f42('0x1b'),_0x21dba9[_0x6f42('0x19')],_0x351bac);_0x4ea209(_0x36f78d[_0x6f42('0x18')](0x1f4,_0x21dba9[_0x6f42('0x19')]));});});};exports[_0x6f42('0x25')]=function(_0x27605f){var _0x369633=this;return new Promise(function(_0x30ce83,_0x368a21){return db[_0x6f42('0x26')][_0x6f42('0x27')]({'raw':_0x27605f[_0x6f42('0x1c')]?_0x27605f[_0x6f42('0x1c')][_0x6f42('0x1d')]===undefined?!![]:![]:!![],'where':_0x27605f[_0x6f42('0x1c')]?_0x27605f[_0x6f42('0x1c')][_0x6f42('0x1e')]||null:null,'attributes':_0x27605f[_0x6f42('0x1c')]?_0x27605f['options'][_0x6f42('0x1f')]||null:null,'include':_0x27605f[_0x6f42('0x1c')]?_0x27605f[_0x6f42('0x1c')][_0x6f42('0x21')]?_['map'](_0x27605f[_0x6f42('0x1c')][_0x6f42('0x21')],function(_0x44a3f3){return{'model':db[_0x44a3f3[_0x6f42('0x23')]],'as':_0x44a3f3['as'],'attributes':_0x44a3f3['attributes'],'include':_0x44a3f3[_0x6f42('0x21')]?_[_0x6f42('0x22')](_0x44a3f3[_0x6f42('0x21')],function(_0x398a8c){return{'model':db[_0x398a8c[_0x6f42('0x23')]],'as':_0x398a8c['as'],'attributes':_0x398a8c[_0x6f42('0x1f')],'include':_0x398a8c[_0x6f42('0x21')]?_[_0x6f42('0x22')](_0x398a8c[_0x6f42('0x21')],function(_0x269655){return{'model':db[_0x269655[_0x6f42('0x23')]],'as':_0x269655['as'],'attributes':_0x269655[_0x6f42('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6f42('0x12')](function(_0x23c256){logger[_0x6f42('0x13')](_0x6f42('0x25'),_0x27605f);logger[_0x6f42('0x16')](_0x6f42('0x25'),_0x27605f,JSON[_0x6f42('0x24')](_0x23c256));_0x30ce83(_0x23c256);})[_0x6f42('0x1a')](function(_0x3b65cc){logger[_0x6f42('0x18')]('ShowFaxQueue',_0x3b65cc['message'],_0x27605f);_0x368a21(_0x369633[_0x6f42('0x18')](0x1f4,_0x3b65cc[_0x6f42('0x19')]));});});}; \ No newline at end of file +var _0x2330=['socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','options','where','attributes','limit','include','model','map','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x3eebab,_0x5e12a7){var _0xbae508=function(_0x212eba){while(--_0x212eba){_0x3eebab['push'](_0x3eebab['shift']());}};_0xbae508(++_0x5e12a7);}(_0x2330,0x8f));var _0x0233=function(_0xdb1da0,_0x5813b2){_0xdb1da0=_0xdb1da0-0x0;var _0x53065e=_0x2330[_0xdb1da0];return _0x53065e;};'use strict';var _=require(_0x0233('0x0'));var util=require(_0x0233('0x1'));var moment=require(_0x0233('0x2'));var BPromise=require(_0x0233('0x3'));var rs=require(_0x0233('0x4'));var fs=require('fs');var Redis=require(_0x0233('0x5'));var db=require(_0x0233('0x6'))['db'];var utils=require(_0x0233('0x7'));var logger=require('../../config/logger')(_0x0233('0x8'));var config=require(_0x0233('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0233('0xa')][_0x0233('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0233('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0233('0xd'))(new Redis(config[_0x0233('0xc')]));require(_0x0233('0xe'))[_0x0233('0xf')](socket);function respondWithRpcPromise(_0x430cab,_0x5f246e,_0x17f58e){return new BPromise(function(_0x430ca5,_0x4c9f60){return client[_0x0233('0x10')](_0x430cab,_0x17f58e)[_0x0233('0x11')](function(_0x23ddb0){logger[_0x0233('0x12')](_0x0233('0x13'),_0x5f246e,_0x0233('0x14'));logger[_0x0233('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x5f246e,_0x0233('0x14'),JSON[_0x0233('0x16')](_0x23ddb0));if(_0x23ddb0[_0x0233('0x17')]){if(_0x23ddb0['error'][_0x0233('0x18')]===0x1f4){logger[_0x0233('0x17')](_0x0233('0x13'),_0x5f246e,_0x23ddb0[_0x0233('0x17')][_0x0233('0x19')]);return _0x4c9f60(_0x23ddb0[_0x0233('0x17')][_0x0233('0x19')]);}logger['error'](_0x0233('0x13'),_0x5f246e,_0x23ddb0['error'][_0x0233('0x19')]);return _0x430ca5(_0x23ddb0['error'][_0x0233('0x19')]);}else{logger['info'](_0x0233('0x13'),_0x5f246e,_0x0233('0x14'));_0x430ca5(_0x23ddb0[_0x0233('0x1a')]['message']);}})[_0x0233('0x1b')](function(_0x531f6c){logger[_0x0233('0x17')](_0x0233('0x13'),_0x5f246e,_0x531f6c);_0x4c9f60(_0x531f6c);});});}exports[_0x0233('0x1c')]=function(_0x24033f){var _0x1f5e3a=this;return new Promise(function(_0x1a8dc1,_0x2aea19){return db['FaxQueue']['findAll']({'raw':_0x24033f[_0x0233('0x1d')]?_0x24033f[_0x0233('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x24033f['options']?_0x24033f[_0x0233('0x1d')][_0x0233('0x1e')]||null:null,'attributes':_0x24033f['options']?_0x24033f[_0x0233('0x1d')][_0x0233('0x1f')]||null:null,'limit':_0x24033f[_0x0233('0x1d')]?_0x24033f[_0x0233('0x1d')][_0x0233('0x20')]||null:null,'include':_0x24033f[_0x0233('0x1d')]?_0x24033f[_0x0233('0x1d')][_0x0233('0x21')]?_['map'](_0x24033f[_0x0233('0x1d')][_0x0233('0x21')],function(_0xad303b){return{'model':db[_0xad303b[_0x0233('0x22')]],'as':_0xad303b['as'],'attributes':_0xad303b[_0x0233('0x1f')],'include':_0xad303b[_0x0233('0x21')]?_[_0x0233('0x23')](_0xad303b[_0x0233('0x21')],function(_0x13c438){return{'model':db[_0x13c438[_0x0233('0x22')]],'as':_0x13c438['as'],'attributes':_0x13c438[_0x0233('0x1f')],'include':_0x13c438[_0x0233('0x21')]?_[_0x0233('0x23')](_0x13c438[_0x0233('0x21')],function(_0x7eaaec){return{'model':db[_0x7eaaec[_0x0233('0x22')]],'as':_0x7eaaec['as'],'attributes':_0x7eaaec[_0x0233('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0233('0x11')](function(_0x5bc2f7){logger[_0x0233('0x12')](_0x0233('0x1c'),_0x24033f);logger['debug'](_0x0233('0x1c'),_0x24033f,JSON[_0x0233('0x16')](_0x5bc2f7));_0x1a8dc1(_0x5bc2f7);})[_0x0233('0x1b')](function(_0x386cf5){logger[_0x0233('0x17')](_0x0233('0x1c'),_0x386cf5['message'],_0x24033f);_0x2aea19(_0x1f5e3a[_0x0233('0x17')](0x1f4,_0x386cf5[_0x0233('0x19')]));});});};exports[_0x0233('0x24')]=function(_0x5412f0){var _0x5e3a7c=this;return new Promise(function(_0x2649e6,_0x51f7be){return db['FaxQueue'][_0x0233('0x25')]({'raw':_0x5412f0[_0x0233('0x1d')]?_0x5412f0['options'][_0x0233('0x26')]===undefined?!![]:![]:!![],'where':_0x5412f0[_0x0233('0x1d')]?_0x5412f0[_0x0233('0x1d')][_0x0233('0x1e')]||null:null,'attributes':_0x5412f0[_0x0233('0x1d')]?_0x5412f0[_0x0233('0x1d')]['attributes']||null:null,'include':_0x5412f0[_0x0233('0x1d')]?_0x5412f0['options'][_0x0233('0x21')]?_['map'](_0x5412f0[_0x0233('0x1d')][_0x0233('0x21')],function(_0x2b56fc){return{'model':db[_0x2b56fc['model']],'as':_0x2b56fc['as'],'attributes':_0x2b56fc[_0x0233('0x1f')],'include':_0x2b56fc[_0x0233('0x21')]?_['map'](_0x2b56fc[_0x0233('0x21')],function(_0x2b5420){return{'model':db[_0x2b5420['model']],'as':_0x2b5420['as'],'attributes':_0x2b5420['attributes'],'include':_0x2b5420[_0x0233('0x21')]?_[_0x0233('0x23')](_0x2b5420[_0x0233('0x21')],function(_0xe02c59){return{'model':db[_0xe02c59[_0x0233('0x22')]],'as':_0xe02c59['as'],'attributes':_0xe02c59[_0x0233('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x72a9df){logger[_0x0233('0x12')](_0x0233('0x24'),_0x5412f0);logger[_0x0233('0x15')](_0x0233('0x24'),_0x5412f0,JSON[_0x0233('0x16')](_0x72a9df));_0x2649e6(_0x72a9df);})[_0x0233('0x1b')](function(_0x4757e0){logger['error'](_0x0233('0x24'),_0x4757e0['message'],_0x5412f0);_0x51f7be(_0x5e3a7c['error'](0x1f4,_0x4757e0[_0x0233('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 2c6038f..6b98725 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 _0x5dd9=['register','length','faxQueue:','save','update','emit','removeListener'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5dd9,0x1e6));var _0x95dd=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5dd9[_0x28107d];return _0x2b1cbe;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x95dd('0x0'),'remove',_0x95dd('0x1')];function createListener(_0x23589f,_0x30e7cb){return function(_0x5a9a26){_0x30e7cb[_0x95dd('0x2')](_0x23589f,_0x5a9a26);};}function removeListener(_0xa2798a,_0x5033eb){return function(){FaxQueueEvents[_0x95dd('0x3')](_0xa2798a,_0x5033eb);};}exports[_0x95dd('0x4')]=function(_0x554402){for(var _0x372e57=0x0,_0x5e0aa8=events[_0x95dd('0x5')];_0x372e57<_0x5e0aa8;_0x372e57++){var _0x4c5e0a=events[_0x372e57];var _0x27b93e=createListener(_0x95dd('0x6')+_0x4c5e0a,_0x554402);FaxQueueEvents['on'](_0x4c5e0a,_0x27b93e);}}; \ No newline at end of file +var _0xcf58=['register','./faxQueue.events','save','update','emit','removeListener'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xcf58,0x193));var _0x8cf5=function(_0x4bff91,_0xcf22c4){_0x4bff91=_0x4bff91-0x0;var _0xd94754=_0xcf58[_0x4bff91];return _0xd94754;};'use strict';var FaxQueueEvents=require(_0x8cf5('0x0'));var events=[_0x8cf5('0x1'),'remove',_0x8cf5('0x2')];function createListener(_0x2c876b,_0x7a4a12){return function(_0x35aa59){_0x7a4a12[_0x8cf5('0x3')](_0x2c876b,_0x35aa59);};}function removeListener(_0x1f770,_0x3ec5f7){return function(){FaxQueueEvents[_0x8cf5('0x4')](_0x1f770,_0x3ec5f7);};}exports[_0x8cf5('0x5')]=function(_0x200c39){for(var _0x1e2237=0x0,_0x22212f=events['length'];_0x1e2237<_0x22212f;_0x1e2237++){var _0x2ebef8=events[_0x1e2237];var _0x9cee79=createListener('faxQueue:'+_0x2ebef8,_0x200c39);FaxQueueEvents['on'](_0x2ebef8,_0x9cee79);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 568c0aa..62e3a64 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 _0x49c1=['put','/:id','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents'];(function(_0x26499b,_0x4fccc6){var _0x4be9ab=function(_0x36deba){while(--_0x36deba){_0x26499b['push'](_0x26499b['shift']());}};_0x4be9ab(++_0x4fccc6);}(_0x49c1,0xef));var _0x149c=function(_0x2b7f98,_0xb83916){_0x2b7f98=_0x2b7f98-0x0;var _0x3b32fc=_0x49c1[_0x2b7f98];return _0x3b32fc;};'use strict';var multer=require(_0x149c('0x0'));var util=require('util');var path=require(_0x149c('0x1'));var timeout=require(_0x149c('0x2'));var express=require(_0x149c('0x3'));var router=express['Router']();var fs_extra=require(_0x149c('0x4'));var auth=require(_0x149c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x149c('0x6'));var controller=require(_0x149c('0x7'));router['get']('/',auth[_0x149c('0x8')](),controller['index']);router[_0x149c('0x9')](_0x149c('0xa'),auth['isAuthenticated'](),controller[_0x149c('0xb')]);router[_0x149c('0x9')]('/:id',auth[_0x149c('0x8')](),controller[_0x149c('0xc')]);router['get'](_0x149c('0xd'),auth[_0x149c('0x8')](),controller[_0x149c('0xe')]);router[_0x149c('0x9')]('/:id/teams',auth[_0x149c('0x8')](),controller[_0x149c('0xf')]);router[_0x149c('0x9')](_0x149c('0x10'),auth[_0x149c('0x8')](),controller[_0x149c('0x11')]);router[_0x149c('0x12')]('/',auth[_0x149c('0x8')](),controller['create']);router[_0x149c('0x12')](_0x149c('0x13'),auth['isAuthenticated'](),controller[_0x149c('0x14')]);router['post'](_0x149c('0x10'),auth[_0x149c('0x8')](),controller[_0x149c('0x15')]);router[_0x149c('0x16')](_0x149c('0x17'),auth[_0x149c('0x8')](),controller[_0x149c('0x18')]);router[_0x149c('0x19')](_0x149c('0x17'),auth['isAuthenticated'](),controller[_0x149c('0x1a')]);router[_0x149c('0x19')](_0x149c('0x13'),auth[_0x149c('0x8')](),controller[_0x149c('0x1b')]);router[_0x149c('0x19')](_0x149c('0x10'),auth[_0x149c('0x8')](),controller['removeAgents']);module[_0x149c('0x1c')]=router; \ No newline at end of file +var _0x5fab=['/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers'];(function(_0xe28cd5,_0x4a5431){var _0x3f4716=function(_0x153492){while(--_0x153492){_0xe28cd5['push'](_0xe28cd5['shift']());}};_0x3f4716(++_0x4a5431);}(_0x5fab,0x177));var _0xb5fa=function(_0x3382e2,_0x6fbda2){_0x3382e2=_0x3382e2-0x0;var _0x25381b=_0x5fab[_0x3382e2];return _0x25381b;};'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/members',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getAgents']);router[_0xb5fa('0x14')]('/',auth[_0xb5fa('0xb')](),controller['create']);router[_0xb5fa('0x14')]('/:id/teams',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x15')]);router[_0xb5fa('0x14')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['addAgents']);router['put'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x16')]);router[_0xb5fa('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x18')]);router[_0xb5fa('0x17')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x17')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1a')]);module[_0xb5fa('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 92f7f5b..84d3804 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 _0xdb6f=['moment','sequelize','exports','STRING','DATE'];(function(_0xafdec6,_0x3d94df){var _0x372bdb=function(_0x5b3fd6){while(--_0x5b3fd6){_0xafdec6['push'](_0xafdec6['shift']());}};_0x372bdb(++_0x3d94df);}(_0xdb6f,0x64));var _0xfdb6=function(_0x1f0cff,_0x5a97d5){_0x1f0cff=_0x1f0cff-0x0;var _0xfe5909=_0xdb6f[_0x1f0cff];return _0xfe5909;};'use strict';var moment=require(_0xfdb6('0x0'));var Sequelize=require(_0xfdb6('0x1'));module[_0xfdb6('0x2')]={'uniqueid':{'type':Sequelize[_0xfdb6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfdb6('0x3')]},'joinAt':{'type':Sequelize[_0xfdb6('0x4')]},'leaveAt':{'type':Sequelize[_0xfdb6('0x4')]},'acceptAt':{'type':Sequelize[_0xfdb6('0x4')]},'exitAt':{'type':Sequelize[_0xfdb6('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x643d=['exports','DATE','sequelize'];(function(_0x523f94,_0x5dc9b4){var _0x10f200=function(_0x293f75){while(--_0x293f75){_0x523f94['push'](_0x523f94['shift']());}};_0x10f200(++_0x5dc9b4);}(_0x643d,0x1df));var _0xd643=function(_0x72a33d,_0x5691da){_0x72a33d=_0x72a33d-0x0;var _0x2621d5=_0x643d[_0x72a33d];return _0x2621d5;};'use strict';var moment=require('moment');var Sequelize=require(_0xd643('0x0'));module[_0xd643('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd643('0x2')]},'leaveAt':{'type':Sequelize[_0xd643('0x2')]},'acceptAt':{'type':Sequelize[_0xd643('0x2')]},'exitAt':{'type':Sequelize[_0xd643('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ca40c29..57d37e6 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 _0x8f1f=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','where','merge','options','FaxQueueReport','includeAll','include','findAll','rows','catch','keys','find','create','body','params','describe'];(function(_0x19da3b,_0xe41b64){var _0x1a86c1=function(_0x500ae5){while(--_0x500ae5){_0x19da3b['push'](_0x19da3b['shift']());}};_0x1a86c1(++_0xe41b64);}(_0x8f1f,0xe1));var _0xf8f1=function(_0x486be5,_0x443cb9){_0x486be5=_0x486be5-0x0;var _0x5ebcbe=_0x8f1f[_0x486be5];return _0x5ebcbe;};'use strict';var emlformat=require(_0xf8f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8f1('0x1'));var rp=require(_0xf8f1('0x2'));var moment=require(_0xf8f1('0x3'));var BPromise=require(_0xf8f1('0x4'));var Mustache=require(_0xf8f1('0x5'));var util=require(_0xf8f1('0x6'));var path=require(_0xf8f1('0x7'));var sox=require(_0xf8f1('0x8'));var csv=require('to-csv');var ejs=require(_0xf8f1('0x9'));var fs=require('fs');var fs_extra=require(_0xf8f1('0xa'));var _=require(_0xf8f1('0xb'));var squel=require(_0xf8f1('0xc'));var crypto=require(_0xf8f1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8f1('0xe'));var toCsv=require(_0xf8f1('0xf'));var querystring=require(_0xf8f1('0x10'));var Papa=require(_0xf8f1('0x11'));var Redis=require(_0xf8f1('0x12'));var authService=require(_0xf8f1('0x13'));var qs=require(_0xf8f1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f1('0x15'));var logger=require(_0xf8f1('0x16'))(_0xf8f1('0x17'));var utils=require(_0xf8f1('0x18'));var config=require(_0xf8f1('0x19'));var licenseUtil=require(_0xf8f1('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220eb0,_0x1e9238){_0x1e9238=_0x1e9238||0xcc;return function(_0x1f4774){if(_0x1f4774){return _0x220eb0[_0xf8f1('0x1b')](_0x1e9238);}return _0x220eb0[_0xf8f1('0x1c')](_0x1e9238)['end']();};}function respondWithResult(_0x1996b2,_0x1b96f3){_0x1b96f3=_0x1b96f3||0xc8;return function(_0x3e7fd8){if(_0x3e7fd8){return _0x1996b2[_0xf8f1('0x1c')](_0x1b96f3)[_0xf8f1('0x1d')](_0x3e7fd8);}};}function respondWithFilteredResult(_0x36cb1b,_0x21f855){return function(_0x5a5a82){if(_0x5a5a82){var _0x88a1f6=typeof _0x21f855[_0xf8f1('0x1e')]==='undefined'&&typeof _0x21f855[_0xf8f1('0x1f')]===_0xf8f1('0x20');var _0x32d2c1=_0x5a5a82['count'];var _0x3bd8ba=_0x88a1f6?0x0:_0x21f855[_0xf8f1('0x1e')];var _0x410299=_0x88a1f6?_0x5a5a82[_0xf8f1('0x21')]:_0x21f855[_0xf8f1('0x1e')]+_0x21f855['limit'];var _0x12474a;if(_0x410299>=_0x32d2c1){_0x410299=_0x32d2c1;_0x12474a=0xc8;}else{_0x12474a=0xce;}_0x36cb1b['status'](_0x12474a);return _0x36cb1b[_0xf8f1('0x22')](_0xf8f1('0x23'),_0x3bd8ba+'-'+_0x410299+'/'+_0x32d2c1)['json'](_0x5a5a82);}return null;};}function patchUpdates(_0x3aaa1c){return function(_0xfeed91){try{jsonpatch[_0xf8f1('0x24')](_0xfeed91,_0x3aaa1c,!![]);}catch(_0x409e7b){return BPromise[_0xf8f1('0x25')](_0x409e7b);}return _0xfeed91[_0xf8f1('0x26')]();};}function saveUpdates(_0x51ac2e,_0x23cf7f){return function(_0x4d93b6){if(_0x4d93b6){return _0x4d93b6[_0xf8f1('0x27')](_0x51ac2e)[_0xf8f1('0x28')](function(_0x2e5f1b){return _0x2e5f1b;});}return null;};}function removeEntity(_0x3e97e4,_0x113ffd){return function(_0x842ecb){if(_0x842ecb){return _0x842ecb[_0xf8f1('0x29')]()['then'](function(){_0x3e97e4['status'](0xcc)[_0xf8f1('0x2a')]();});}};}function handleEntityNotFound(_0x34bd9b,_0x59a6a5){return function(_0x1a7abe){if(!_0x1a7abe){_0x34bd9b[_0xf8f1('0x1b')](0x194);}return _0x1a7abe;};}function handleError(_0x2d2c5b,_0x1a96f5){_0x1a96f5=_0x1a96f5||0x1f4;return function(_0xf428fc){logger[_0xf8f1('0x2b')](_0xf428fc[_0xf8f1('0x2c')]);if(_0xf428fc['name']){delete _0xf428fc[_0xf8f1('0x2d')];}_0x2d2c5b['status'](_0x1a96f5)[_0xf8f1('0x2e')](_0xf428fc);};}exports[_0xf8f1('0x2f')]=function(_0x138c01,_0x5e4755){var _0x20c4a7={},_0x13dcd5={},_0x205283={'count':0x0,'rows':[]};var _0x4fa285=_['map'](db['FaxQueueReport'][_0xf8f1('0x30')],function(_0x116d88){return{'name':_0x116d88[_0xf8f1('0x31')],'type':_0x116d88[_0xf8f1('0x32')]['key']};});_0x13dcd5[_0xf8f1('0x33')]=_[_0xf8f1('0x34')](_0x4fa285,_0xf8f1('0x2d'));_0x13dcd5[_0xf8f1('0x35')]=_['keys'](_0x138c01[_0xf8f1('0x35')]);_0x13dcd5['filters']=_[_0xf8f1('0x36')](_0x13dcd5['model'],_0x13dcd5[_0xf8f1('0x35')]);_0x20c4a7[_0xf8f1('0x37')]=_[_0xf8f1('0x36')](_0x13dcd5[_0xf8f1('0x33')],qs[_0xf8f1('0x38')](_0x138c01[_0xf8f1('0x35')]['fields']));_0x20c4a7[_0xf8f1('0x37')]=_0x20c4a7[_0xf8f1('0x37')][_0xf8f1('0x39')]?_0x20c4a7[_0xf8f1('0x37')]:_0x13dcd5['model'];if(!_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x3a')]('nolimit')){_0x20c4a7[_0xf8f1('0x1f')]=qs[_0xf8f1('0x1f')](_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x1f')]);_0x20c4a7[_0xf8f1('0x1e')]=qs[_0xf8f1('0x1e')](_0x138c01['query'][_0xf8f1('0x1e')]);}_0x20c4a7[_0xf8f1('0x3b')]=qs['sort'](_0x138c01[_0xf8f1('0x35')]['sort']);_0x20c4a7[_0xf8f1('0x3c')]=qs['filters'](_['pick'](_0x138c01[_0xf8f1('0x35')],_0x13dcd5['filters']),_0x4fa285);if(_0x138c01[_0xf8f1('0x35')]['filter']){_0x20c4a7[_0xf8f1('0x3c')]=_['merge'](_0x20c4a7[_0xf8f1('0x3c')],{'$or':_[_0xf8f1('0x34')](_0x4fa285,function(_0x2396a6){if(_0x2396a6[_0xf8f1('0x32')]!=='VIRTUAL'){var _0x4cdba2={};_0x4cdba2[_0x2396a6[_0xf8f1('0x2d')]]={'$like':'%'+_0x138c01[_0xf8f1('0x35')]['filter']+'%'};return _0x4cdba2;}})});}_0x20c4a7=_[_0xf8f1('0x3d')]({},_0x20c4a7,_0x138c01[_0xf8f1('0x3e')]);var _0x1cbe05={'where':_0x20c4a7[_0xf8f1('0x3c')]};return db[_0xf8f1('0x3f')][_0xf8f1('0x21')](_0x1cbe05)[_0xf8f1('0x28')](function(_0x459594){_0x205283['count']=_0x459594;if(_0x138c01[_0xf8f1('0x35')][_0xf8f1('0x40')]){_0x20c4a7[_0xf8f1('0x41')]=[{'all':!![]}];}return db[_0xf8f1('0x3f')][_0xf8f1('0x42')](_0x20c4a7);})[_0xf8f1('0x28')](function(_0x1bc45a){_0x205283[_0xf8f1('0x43')]=_0x1bc45a;return _0x205283;})['then'](respondWithFilteredResult(_0x5e4755,_0x20c4a7))[_0xf8f1('0x44')](handleError(_0x5e4755,null));};exports['show']=function(_0x37d3ea,_0x14ddfc){var _0x221496={'raw':!![],'where':{'id':_0x37d3ea['params']['id']}},_0x108238={};_0x108238[_0xf8f1('0x33')]=_[_0xf8f1('0x45')](db[_0xf8f1('0x3f')][_0xf8f1('0x30')]);_0x108238['query']=_[_0xf8f1('0x45')](_0x37d3ea[_0xf8f1('0x35')]);_0x108238['filters']=_['intersection'](_0x108238[_0xf8f1('0x33')],_0x108238[_0xf8f1('0x35')]);_0x221496[_0xf8f1('0x37')]=_[_0xf8f1('0x36')](_0x108238[_0xf8f1('0x33')],qs['fields'](_0x37d3ea[_0xf8f1('0x35')]['fields']));_0x221496[_0xf8f1('0x37')]=_0x221496['attributes'][_0xf8f1('0x39')]?_0x221496[_0xf8f1('0x37')]:_0x108238[_0xf8f1('0x33')];if(_0x37d3ea[_0xf8f1('0x35')]['includeAll']){_0x221496[_0xf8f1('0x41')]=[{'all':!![]}];}_0x221496=_[_0xf8f1('0x3d')]({},_0x221496,_0x37d3ea[_0xf8f1('0x3e')]);return db[_0xf8f1('0x3f')][_0xf8f1('0x46')](_0x221496)[_0xf8f1('0x28')](handleEntityNotFound(_0x14ddfc,null))[_0xf8f1('0x28')](respondWithResult(_0x14ddfc,null))[_0xf8f1('0x44')](handleError(_0x14ddfc,null));};exports['create']=function(_0x215ac1,_0x247c9f){return db[_0xf8f1('0x3f')][_0xf8f1('0x47')](_0x215ac1[_0xf8f1('0x48')],{})[_0xf8f1('0x28')](respondWithResult(_0x247c9f,0xc9))[_0xf8f1('0x44')](handleError(_0x247c9f,null));};exports[_0xf8f1('0x27')]=function(_0x513778,_0x3f461e){if(_0x513778[_0xf8f1('0x48')]['id']){delete _0x513778[_0xf8f1('0x48')]['id'];}return db[_0xf8f1('0x3f')]['find']({'where':{'id':_0x513778['params']['id']}})[_0xf8f1('0x28')](handleEntityNotFound(_0x3f461e,null))['then'](saveUpdates(_0x513778['body'],null))[_0xf8f1('0x28')](respondWithResult(_0x3f461e,null))[_0xf8f1('0x44')](handleError(_0x3f461e,null));};exports[_0xf8f1('0x29')]=function(_0x2f653f,_0x353dd8){return db['FaxQueueReport']['find']({'where':{'id':_0x2f653f[_0xf8f1('0x49')]['id']}})['then'](handleEntityNotFound(_0x353dd8,null))[_0xf8f1('0x28')](removeEntity(_0x353dd8,null))[_0xf8f1('0x44')](handleError(_0x353dd8,null));};exports[_0xf8f1('0x4a')]=function(_0x35a42a,_0x4f901e){return db['FaxQueueReport']['describe']()[_0xf8f1('0x28')](respondWithResult(_0x4f901e,null))['catch'](handleError(_0x4f901e,null));}; \ No newline at end of file +var _0xe0c0=['intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','keys','find','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query'];(function(_0x527adb,_0x154ef0){var _0x382096=function(_0x346ac1){while(--_0x346ac1){_0x527adb['push'](_0x527adb['shift']());}};_0x382096(++_0x154ef0);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x43fb5c,_0x1fb238){_0x43fb5c=_0x43fb5c-0x0;var _0x4cc3f4=_0xe0c0[_0x43fb5c];return _0x4cc3f4;};'use strict';var emlformat=require(_0x0e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e0c('0x1'));var jsonpatch=require(_0x0e0c('0x2'));var rp=require(_0x0e0c('0x3'));var moment=require(_0x0e0c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e0c('0x5'));var util=require(_0x0e0c('0x6'));var path=require(_0x0e0c('0x7'));var sox=require('sox');var csv=require(_0x0e0c('0x8'));var ejs=require(_0x0e0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e0c('0xa'));var squel=require(_0x0e0c('0xb'));var crypto=require(_0x0e0c('0xc'));var jsforce=require(_0x0e0c('0xd'));var deskjs=require(_0x0e0c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0e0c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0e0c('0x10'));var as=require(_0x0e0c('0x11'));var hardwareService=require(_0x0e0c('0x12'));var logger=require(_0x0e0c('0x13'))(_0x0e0c('0x14'));var utils=require(_0x0e0c('0x15'));var config=require(_0x0e0c('0x16'));var licenseUtil=require(_0x0e0c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246fd6,_0x5c31c7){_0x5c31c7=_0x5c31c7||0xcc;return function(_0x5794fa){if(_0x5794fa){return _0x246fd6[_0x0e0c('0x18')](_0x5c31c7);}return _0x246fd6[_0x0e0c('0x19')](_0x5c31c7)[_0x0e0c('0x1a')]();};}function respondWithResult(_0x305042,_0x1b598b){_0x1b598b=_0x1b598b||0xc8;return function(_0x19f315){if(_0x19f315){return _0x305042['status'](_0x1b598b)[_0x0e0c('0x1b')](_0x19f315);}};}function respondWithFilteredResult(_0x27cbcd,_0x3b6d65){return function(_0x4ebe33){if(_0x4ebe33){var _0x368ba0=typeof _0x3b6d65[_0x0e0c('0x1c')]===_0x0e0c('0x1d')&&typeof _0x3b6d65[_0x0e0c('0x1e')]===_0x0e0c('0x1d');var _0x2b0cb6=_0x4ebe33[_0x0e0c('0x1f')];var _0x18f3ef=_0x368ba0?0x0:_0x3b6d65[_0x0e0c('0x1c')];var _0x562f2c=_0x368ba0?_0x4ebe33[_0x0e0c('0x1f')]:_0x3b6d65['offset']+_0x3b6d65['limit'];var _0x5518b6;if(_0x562f2c>=_0x2b0cb6){_0x562f2c=_0x2b0cb6;_0x5518b6=0xc8;}else{_0x5518b6=0xce;}_0x27cbcd[_0x0e0c('0x19')](_0x5518b6);return _0x27cbcd[_0x0e0c('0x20')](_0x0e0c('0x21'),_0x18f3ef+'-'+_0x562f2c+'/'+_0x2b0cb6)[_0x0e0c('0x1b')](_0x4ebe33);}return null;};}function patchUpdates(_0x26ad69){return function(_0x3cc1cc){try{jsonpatch['apply'](_0x3cc1cc,_0x26ad69,!![]);}catch(_0x177ec6){return BPromise['reject'](_0x177ec6);}return _0x3cc1cc[_0x0e0c('0x22')]();};}function saveUpdates(_0x4419e9,_0x58fa02){return function(_0x2d01e5){if(_0x2d01e5){return _0x2d01e5[_0x0e0c('0x23')](_0x4419e9)['then'](function(_0x3346aa){return _0x3346aa;});}return null;};}function removeEntity(_0x29ee52,_0x315b35){return function(_0x29ff87){if(_0x29ff87){return _0x29ff87[_0x0e0c('0x24')]()[_0x0e0c('0x25')](function(){_0x29ee52[_0x0e0c('0x19')](0xcc)[_0x0e0c('0x1a')]();});}};}function handleEntityNotFound(_0x426bf1,_0x3ae1b4){return function(_0x5a7519){if(!_0x5a7519){_0x426bf1[_0x0e0c('0x18')](0x194);}return _0x5a7519;};}function handleError(_0x429f6f,_0x48a33a){_0x48a33a=_0x48a33a||0x1f4;return function(_0x59f3e8){logger[_0x0e0c('0x26')](_0x59f3e8['stack']);if(_0x59f3e8[_0x0e0c('0x27')]){delete _0x59f3e8[_0x0e0c('0x27')];}_0x429f6f[_0x0e0c('0x19')](_0x48a33a)[_0x0e0c('0x28')](_0x59f3e8);};}exports[_0x0e0c('0x29')]=function(_0x15bb5a,_0x252143){var _0x2d1444={},_0x2c9c82={},_0x433f56={'count':0x0,'rows':[]};var _0xe5f2c5=_[_0x0e0c('0x2a')](db[_0x0e0c('0x2b')][_0x0e0c('0x2c')],function(_0x2c7d33){return{'name':_0x2c7d33[_0x0e0c('0x2d')],'type':_0x2c7d33['type'][_0x0e0c('0x2e')]};});_0x2c9c82[_0x0e0c('0x2f')]=_[_0x0e0c('0x2a')](_0xe5f2c5,_0x0e0c('0x27'));_0x2c9c82[_0x0e0c('0x30')]=_['keys'](_0x15bb5a[_0x0e0c('0x30')]);_0x2c9c82['filters']=_[_0x0e0c('0x31')](_0x2c9c82[_0x0e0c('0x2f')],_0x2c9c82['query']);_0x2d1444['attributes']=_['intersection'](_0x2c9c82['model'],qs[_0x0e0c('0x32')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x32')]));_0x2d1444['attributes']=_0x2d1444['attributes'][_0x0e0c('0x33')]?_0x2d1444[_0x0e0c('0x34')]:_0x2c9c82['model'];if(!_0x15bb5a['query'][_0x0e0c('0x35')]('nolimit')){_0x2d1444[_0x0e0c('0x1e')]=qs[_0x0e0c('0x1e')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x1e')]);_0x2d1444[_0x0e0c('0x1c')]=qs[_0x0e0c('0x1c')](_0x15bb5a[_0x0e0c('0x30')]['offset']);}_0x2d1444[_0x0e0c('0x36')]=qs[_0x0e0c('0x37')](_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x37')]);_0x2d1444[_0x0e0c('0x38')]=qs[_0x0e0c('0x39')](_[_0x0e0c('0x3a')](_0x15bb5a[_0x0e0c('0x30')],_0x2c9c82['filters']),_0xe5f2c5);if(_0x15bb5a['query'][_0x0e0c('0x3b')]){_0x2d1444[_0x0e0c('0x38')]=_[_0x0e0c('0x3c')](_0x2d1444[_0x0e0c('0x38')],{'$or':_['map'](_0xe5f2c5,function(_0x1553d9){if(_0x1553d9['type']!=='VIRTUAL'){var _0x31fa4e={};_0x31fa4e[_0x1553d9[_0x0e0c('0x27')]]={'$like':'%'+_0x15bb5a[_0x0e0c('0x30')][_0x0e0c('0x3b')]+'%'};return _0x31fa4e;}})});}_0x2d1444=_[_0x0e0c('0x3c')]({},_0x2d1444,_0x15bb5a[_0x0e0c('0x3d')]);var _0x2cc92a={'where':_0x2d1444[_0x0e0c('0x38')]};return db[_0x0e0c('0x2b')][_0x0e0c('0x1f')](_0x2cc92a)['then'](function(_0x533314){_0x433f56[_0x0e0c('0x1f')]=_0x533314;if(_0x15bb5a['query'][_0x0e0c('0x3e')]){_0x2d1444[_0x0e0c('0x3f')]=[{'all':!![]}];}return db[_0x0e0c('0x2b')][_0x0e0c('0x40')](_0x2d1444);})[_0x0e0c('0x25')](function(_0x182985){_0x433f56['rows']=_0x182985;return _0x433f56;})[_0x0e0c('0x25')](respondWithFilteredResult(_0x252143,_0x2d1444))[_0x0e0c('0x41')](handleError(_0x252143,null));};exports[_0x0e0c('0x42')]=function(_0x1b0ea9,_0x23e8c9){var _0x44ebbd={'raw':!![],'where':{'id':_0x1b0ea9['params']['id']}},_0x15124c={};_0x15124c['model']=_[_0x0e0c('0x43')](db['FaxQueueReport']['rawAttributes']);_0x15124c['query']=_[_0x0e0c('0x43')](_0x1b0ea9[_0x0e0c('0x30')]);_0x15124c[_0x0e0c('0x39')]=_[_0x0e0c('0x31')](_0x15124c[_0x0e0c('0x2f')],_0x15124c[_0x0e0c('0x30')]);_0x44ebbd[_0x0e0c('0x34')]=_[_0x0e0c('0x31')](_0x15124c[_0x0e0c('0x2f')],qs[_0x0e0c('0x32')](_0x1b0ea9[_0x0e0c('0x30')][_0x0e0c('0x32')]));_0x44ebbd['attributes']=_0x44ebbd[_0x0e0c('0x34')][_0x0e0c('0x33')]?_0x44ebbd[_0x0e0c('0x34')]:_0x15124c[_0x0e0c('0x2f')];if(_0x1b0ea9['query'][_0x0e0c('0x3e')]){_0x44ebbd[_0x0e0c('0x3f')]=[{'all':!![]}];}_0x44ebbd=_[_0x0e0c('0x3c')]({},_0x44ebbd,_0x1b0ea9[_0x0e0c('0x3d')]);return db[_0x0e0c('0x2b')][_0x0e0c('0x44')](_0x44ebbd)[_0x0e0c('0x25')](handleEntityNotFound(_0x23e8c9,null))[_0x0e0c('0x25')](respondWithResult(_0x23e8c9,null))[_0x0e0c('0x41')](handleError(_0x23e8c9,null));};exports['create']=function(_0x39cb27,_0xcabc6a){return db['FaxQueueReport']['create'](_0x39cb27[_0x0e0c('0x45')],{})[_0x0e0c('0x25')](respondWithResult(_0xcabc6a,0xc9))[_0x0e0c('0x41')](handleError(_0xcabc6a,null));};exports['update']=function(_0x29c971,_0x472c78){if(_0x29c971[_0x0e0c('0x45')]['id']){delete _0x29c971[_0x0e0c('0x45')]['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x29c971[_0x0e0c('0x46')]['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x472c78,null))[_0x0e0c('0x25')](saveUpdates(_0x29c971[_0x0e0c('0x45')],null))[_0x0e0c('0x25')](respondWithResult(_0x472c78,null))['catch'](handleError(_0x472c78,null));};exports['destroy']=function(_0x6e907c,_0x58a1c7){return db[_0x0e0c('0x2b')][_0x0e0c('0x44')]({'where':{'id':_0x6e907c[_0x0e0c('0x46')]['id']}})[_0x0e0c('0x25')](handleEntityNotFound(_0x58a1c7,null))['then'](removeEntity(_0x58a1c7,null))[_0x0e0c('0x41')](handleError(_0x58a1c7,null));};exports['describe']=function(_0x1ad56a,_0x21ec4d){return db[_0x0e0c('0x2b')][_0x0e0c('0x47')]()[_0x0e0c('0x25')](respondWithResult(_0x21ec4d,null))[_0x0e0c('0x41')](handleError(_0x21ec4d,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a01378e..178dfec 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 _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54c863,_0x22e1f9){var _0xd69281=function(_0x74d3d2){while(--_0x74d3d2){_0x54c863['push'](_0x54c863['shift']());}};_0xd69281(++_0x22e1f9);}(_0x4975,0x86));var _0x5497=function(_0xdb28d3,_0x5c4d92){_0xdb28d3=_0xdb28d3-0x0;var _0x30ecc6=_0x4975[_0xdb28d3];return _0x30ecc6;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5e8d64,_0x3bb037){var _0x976312=function(_0x2c25f2){while(--_0x2c25f2){_0x5e8d64['push'](_0x5e8d64['shift']());}};_0x976312(++_0x3bb037);}(_0x53ec,0x192));var _0xc53e=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x53ec[_0x485f35];return _0x2ad118;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index a82f04d..65485f9 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 _0xc4d4=['options','raw','UpdateFaxQueueReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body'];(function(_0x2811a0,_0x33a383){var _0x11dee3=function(_0x715e81){while(--_0x715e81){_0x2811a0['push'](_0x2811a0['shift']());}};_0x11dee3(++_0x33a383);}(_0xc4d4,0xd2));var _0x4c4d=function(_0xb8111f,_0x2b0a3b){_0xb8111f=_0xb8111f-0x0;var _0x233d1b=_0xc4d4[_0xb8111f];return _0x233d1b;};'use strict';var _=require(_0x4c4d('0x0'));var util=require(_0x4c4d('0x1'));var moment=require(_0x4c4d('0x2'));var BPromise=require(_0x4c4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c4d('0x4'));var db=require(_0x4c4d('0x5'))['db'];var utils=require(_0x4c4d('0x6'));var logger=require(_0x4c4d('0x7'))(_0x4c4d('0x8'));var config=require(_0x4c4d('0x9'));var jayson=require(_0x4c4d('0xa'));var client=jayson[_0x4c4d('0xb')][_0x4c4d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x197ed4,_0x1cfdc7,_0x3f4c6c){return new BPromise(function(_0x4d0659,_0x4b2e67){return client['request'](_0x197ed4,_0x3f4c6c)[_0x4c4d('0xd')](function(_0x569d9b){logger[_0x4c4d('0xe')](_0x4c4d('0xf'),_0x1cfdc7,_0x4c4d('0x10'));logger[_0x4c4d('0x11')](_0x4c4d('0x12'),_0x1cfdc7,_0x4c4d('0x10'),JSON[_0x4c4d('0x13')](_0x569d9b));if(_0x569d9b[_0x4c4d('0x14')]){if(_0x569d9b[_0x4c4d('0x14')]['code']===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1cfdc7,_0x569d9b[_0x4c4d('0x14')][_0x4c4d('0x15')]);return _0x4b2e67(_0x569d9b['error'][_0x4c4d('0x15')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x1cfdc7,_0x569d9b[_0x4c4d('0x14')]['message']);return _0x4d0659(_0x569d9b[_0x4c4d('0x14')][_0x4c4d('0x15')]);}else{logger[_0x4c4d('0xe')](_0x4c4d('0xf'),_0x1cfdc7,_0x4c4d('0x10'));_0x4d0659(_0x569d9b[_0x4c4d('0x16')][_0x4c4d('0x15')]);}})[_0x4c4d('0x17')](function(_0x5f00cc){logger[_0x4c4d('0x14')](_0x4c4d('0xf'),_0x1cfdc7,_0x5f00cc);_0x4b2e67(_0x5f00cc);});});}exports[_0x4c4d('0x18')]=function(_0x40ab5f){var _0x3e31a7=this;return new Promise(function(_0x5de5d6,_0x4147a7){return db[_0x4c4d('0x19')][_0x4c4d('0x1a')](_0x40ab5f[_0x4c4d('0x1b')],{'raw':_0x40ab5f[_0x4c4d('0x1c')]?_0x40ab5f[_0x4c4d('0x1c')][_0x4c4d('0x1d')]===undefined?!![]:![]:!![]})[_0x4c4d('0xd')](function(_0x5d9094){logger[_0x4c4d('0xe')](_0x4c4d('0x18'),_0x40ab5f);logger[_0x4c4d('0x11')](_0x4c4d('0x18'),_0x40ab5f,JSON[_0x4c4d('0x13')](_0x5d9094));_0x5de5d6(_0x5d9094);})[_0x4c4d('0x17')](function(_0x545fdf){logger[_0x4c4d('0x14')](_0x4c4d('0x18'),_0x545fdf['message'],_0x40ab5f);_0x4147a7(_0x3e31a7[_0x4c4d('0x14')](0x1f4,_0x545fdf[_0x4c4d('0x15')]));});});};exports[_0x4c4d('0x1e')]=function(_0x2fc2be){var _0x5c48d4=this;return new Promise(function(_0x20acb7,_0x3e7eb1){return db[_0x4c4d('0x19')]['update'](_0x2fc2be['body'],{'raw':_0x2fc2be['options']?_0x2fc2be[_0x4c4d('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fc2be[_0x4c4d('0x1c')]?_0x2fc2be[_0x4c4d('0x1c')][_0x4c4d('0x1f')]||null:null,'attributes':_0x2fc2be[_0x4c4d('0x1c')]?_0x2fc2be['options'][_0x4c4d('0x20')]||null:null,'limit':_0x2fc2be[_0x4c4d('0x1c')]?_0x2fc2be['options'][_0x4c4d('0x21')]||null:null})[_0x4c4d('0xd')](function(_0x4a081e){logger[_0x4c4d('0xe')](_0x4c4d('0x1e'),_0x2fc2be);logger[_0x4c4d('0x11')](_0x4c4d('0x1e'),_0x2fc2be,JSON[_0x4c4d('0x13')](_0x4a081e));_0x20acb7(_0x4a081e);})[_0x4c4d('0x17')](function(_0xb2b604){logger[_0x4c4d('0x14')](_0x4c4d('0x1e'),_0xb2b604[_0x4c4d('0x15')],_0x2fc2be);_0x3e7eb1(_0x5c48d4[_0x4c4d('0x14')](0x1f4,_0xb2b604[_0x4c4d('0x15')]));});});}; \ No newline at end of file +var _0x9e78=['FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','FaxQueueReport','update','where','attributes','limit','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info'];(function(_0x4c390b,_0x536d80){var _0x54197b=function(_0x1a016a){while(--_0x1a016a){_0x4c390b['push'](_0x4c390b['shift']());}};_0x54197b(++_0x536d80);}(_0x9e78,0x136));var _0x89e7=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9e78[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89e7('0x0'));var fs=require('fs');var Redis=require(_0x89e7('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x89e7('0x2'));var logger=require(_0x89e7('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x89e7('0x4')][_0x89e7('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x16dfb0,_0xbed5a9,_0x21ec5d){return new BPromise(function(_0x38258e,_0x110714){return client[_0x89e7('0x6')](_0x16dfb0,_0x21ec5d)[_0x89e7('0x7')](function(_0x27391e){logger[_0x89e7('0x8')]('FaxQueueReport,\x20%s,\x20%s',_0xbed5a9,'request\x20sent');logger['debug'](_0x89e7('0x9'),_0xbed5a9,_0x89e7('0xa'),JSON[_0x89e7('0xb')](_0x27391e));if(_0x27391e[_0x89e7('0xc')]){if(_0x27391e[_0x89e7('0xc')]['code']===0x1f4){logger[_0x89e7('0xc')](_0x89e7('0xd'),_0xbed5a9,_0x27391e[_0x89e7('0xc')][_0x89e7('0xe')]);return _0x110714(_0x27391e[_0x89e7('0xc')][_0x89e7('0xe')]);}logger['error'](_0x89e7('0xd'),_0xbed5a9,_0x27391e[_0x89e7('0xc')][_0x89e7('0xe')]);return _0x38258e(_0x27391e[_0x89e7('0xc')][_0x89e7('0xe')]);}else{logger[_0x89e7('0x8')]('FaxQueueReport,\x20%s,\x20%s',_0xbed5a9,'request\x20sent');_0x38258e(_0x27391e[_0x89e7('0xf')][_0x89e7('0xe')]);}})[_0x89e7('0x10')](function(_0x1d3d06){logger[_0x89e7('0xc')](_0x89e7('0xd'),_0xbed5a9,_0x1d3d06);_0x110714(_0x1d3d06);});});}exports[_0x89e7('0x11')]=function(_0x224b7f){var _0xef3ed4=this;return new Promise(function(_0x40ebe4,_0x43bfe8){return db['FaxQueueReport'][_0x89e7('0x12')](_0x224b7f[_0x89e7('0x13')],{'raw':_0x224b7f[_0x89e7('0x14')]?_0x224b7f[_0x89e7('0x14')][_0x89e7('0x15')]===undefined?!![]:![]:!![]})[_0x89e7('0x7')](function(_0x5cbba8){logger[_0x89e7('0x8')](_0x89e7('0x11'),_0x224b7f);logger[_0x89e7('0x16')](_0x89e7('0x11'),_0x224b7f,JSON[_0x89e7('0xb')](_0x5cbba8));_0x40ebe4(_0x5cbba8);})[_0x89e7('0x10')](function(_0x3525ea){logger[_0x89e7('0xc')](_0x89e7('0x11'),_0x3525ea[_0x89e7('0xe')],_0x224b7f);_0x43bfe8(_0xef3ed4[_0x89e7('0xc')](0x1f4,_0x3525ea[_0x89e7('0xe')]));});});};exports[_0x89e7('0x17')]=function(_0x1f1d25){var _0x24956a=this;return new Promise(function(_0x5fd432,_0x3c964b){return db[_0x89e7('0x18')][_0x89e7('0x19')](_0x1f1d25[_0x89e7('0x13')],{'raw':_0x1f1d25[_0x89e7('0x14')]?_0x1f1d25['options'][_0x89e7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f1d25['options']?_0x1f1d25[_0x89e7('0x14')][_0x89e7('0x1a')]||null:null,'attributes':_0x1f1d25['options']?_0x1f1d25[_0x89e7('0x14')][_0x89e7('0x1b')]||null:null,'limit':_0x1f1d25[_0x89e7('0x14')]?_0x1f1d25[_0x89e7('0x14')][_0x89e7('0x1c')]||null:null})['then'](function(_0x2e9346){logger[_0x89e7('0x8')](_0x89e7('0x17'),_0x1f1d25);logger[_0x89e7('0x16')](_0x89e7('0x17'),_0x1f1d25,JSON[_0x89e7('0xb')](_0x2e9346));_0x5fd432(_0x2e9346);})['catch'](function(_0x160c0f){logger['error']('UpdateFaxQueueReport',_0x160c0f[_0x89e7('0xe')],_0x1f1d25);_0x3c964b(_0x24956a[_0x89e7('0xc')](0x1f4,_0x160c0f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 83dee68..7f51447 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 _0x534c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xaff7d1,_0xaaf24f){var _0x276d49=function(_0x5f17bf){while(--_0x5f17bf){_0xaff7d1['push'](_0xaff7d1['shift']());}};_0x276d49(++_0xaaf24f);}(_0x534c,0x153));var _0xc534=function(_0x78a191,_0xeda604){_0x78a191=_0x78a191-0x0;var _0x1343eb=_0x534c[_0x78a191];return _0x1343eb;};'use strict';var multer=require(_0xc534('0x0'));var util=require(_0xc534('0x1'));var path=require(_0xc534('0x2'));var timeout=require(_0xc534('0x3'));var express=require(_0xc534('0x4'));var router=express[_0xc534('0x5')]();var fs_extra=require(_0xc534('0x6'));var auth=require(_0xc534('0x7'));var interaction=require(_0xc534('0x8'));var config=require(_0xc534('0x9'));var controller=require(_0xc534('0xa'));router[_0xc534('0xb')]('/',auth[_0xc534('0xc')](),controller['index']);router[_0xc534('0xb')](_0xc534('0xd'),auth[_0xc534('0xc')](),controller[_0xc534('0xe')]);router[_0xc534('0xb')](_0xc534('0xf'),auth[_0xc534('0xc')](),controller[_0xc534('0x10')]);router[_0xc534('0x11')]('/',auth[_0xc534('0xc')](),controller[_0xc534('0x12')]);router['put'](_0xc534('0xf'),auth[_0xc534('0xc')](),controller[_0xc534('0x13')]);router[_0xc534('0x14')](_0xc534('0xf'),auth[_0xc534('0xc')](),controller[_0xc534('0x15')]);module[_0xc534('0x16')]=router; \ No newline at end of file +var _0x831d=['index','/describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','get','isAuthenticated'];(function(_0x1d90ec,_0x5097b6){var _0x76df68=function(_0x5c661a){while(--_0x5c661a){_0x1d90ec['push'](_0x1d90ec['shift']());}};_0x76df68(++_0x5097b6);}(_0x831d,0x15e));var _0xd831=function(_0x29311d,_0x3f9e23){_0x29311d=_0x29311d-0x0;var _0xa29b8f=_0x831d[_0x29311d];return _0xa29b8f;};'use strict';var multer=require(_0xd831('0x0'));var util=require(_0xd831('0x1'));var path=require(_0xd831('0x2'));var timeout=require('connect-timeout');var express=require(_0xd831('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd831('0x4'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xd831('0x5')]('/',auth[_0xd831('0x6')](),controller[_0xd831('0x7')]);router[_0xd831('0x5')](_0xd831('0x8'),auth[_0xd831('0x6')](),controller['describe']);router['get'](_0xd831('0x9'),auth[_0xd831('0x6')](),controller['show']);router[_0xd831('0xa')]('/',auth[_0xd831('0x6')](),controller[_0xd831('0xb')]);router[_0xd831('0xc')](_0xd831('0x9'),auth[_0xd831('0x6')](),controller[_0xd831('0xd')]);router[_0xd831('0xe')](_0xd831('0x9'),auth[_0xd831('0x6')](),controller[_0xd831('0xf')]);module[_0xd831('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9a71095..61e8806 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x5cdc8e,_0x3dafa5){var _0x4f897b=function(_0x32c7cc){while(--_0x32c7cc){_0x5cdc8e['push'](_0x5cdc8e['shift']());}};_0x4f897b(++_0x3dafa5);}(_0xe706,0xa3));var _0x6e70=function(_0xe33b12,_0x2a9761){_0xe33b12=_0xe33b12-0x0;var _0x30699d=_0xe706[_0xe33b12];return _0x30699d;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x409d51,_0x1f0de6){var _0x13eb4b=function(_0x374388){while(--_0x374388){_0x409d51['push'](_0x409d51['shift']());}};_0x13eb4b(++_0x1f0de6);}(_0x54ef,0x112));var _0xf54e=function(_0xc5395c,_0x4fc872){_0xc5395c=_0xc5395c-0x0;var _0x42337b=_0x54ef[_0xc5395c];return _0x42337b;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 63bec52..06dd987 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 _0xc0fa=['json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x5fd856,_0x410151){var _0xb26373=function(_0x39fb67){while(--_0x39fb67){_0x5fd856['push'](_0x5fd856['shift']());}};_0xb26373(++_0x410151);}(_0xc0fa,0x10b));var _0xac0f=function(_0x204e14,_0x430bda){_0x204e14=_0x204e14-0x0;var _0x218450=_0xc0fa[_0x204e14];return _0x218450;};'use strict';var emlformat=require(_0xac0f('0x0'));var rimraf=require(_0xac0f('0x1'));var zipdir=require(_0xac0f('0x2'));var jsonpatch=require(_0xac0f('0x3'));var rp=require(_0xac0f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac0f('0x5'));var util=require(_0xac0f('0x6'));var path=require(_0xac0f('0x7'));var sox=require(_0xac0f('0x8'));var csv=require(_0xac0f('0x9'));var ejs=require(_0xac0f('0xa'));var fs=require('fs');var fs_extra=require(_0xac0f('0xb'));var _=require(_0xac0f('0xc'));var squel=require('squel');var crypto=require(_0xac0f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xac0f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xac0f('0xf'));var Papa=require(_0xac0f('0x10'));var Redis=require('ioredis');var authService=require(_0xac0f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac0f('0x12'));var logger=require(_0xac0f('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xac0f('0x14'));var db=require(_0xac0f('0x15'))['db'];function respondWithStatusCode(_0x514dbf,_0xe4f486){_0xe4f486=_0xe4f486||0xcc;return function(_0x56cd0c){if(_0x56cd0c){return _0x514dbf[_0xac0f('0x16')](_0xe4f486);}return _0x514dbf[_0xac0f('0x17')](_0xe4f486)[_0xac0f('0x18')]();};}function respondWithResult(_0x33be85,_0x245519){_0x245519=_0x245519||0xc8;return function(_0x33b045){if(_0x33b045){return _0x33be85[_0xac0f('0x17')](_0x245519)[_0xac0f('0x19')](_0x33b045);}};}function respondWithFilteredResult(_0x7268b9,_0x1bff5e){return function(_0x1637e1){if(_0x1637e1){var _0x26af30=typeof _0x1bff5e[_0xac0f('0x1a')]===_0xac0f('0x1b')&&typeof _0x1bff5e[_0xac0f('0x1c')]===_0xac0f('0x1b');var _0x557a67=_0x1637e1[_0xac0f('0x1d')];var _0x3ae820=_0x26af30?0x0:_0x1bff5e[_0xac0f('0x1a')];var _0x5ded3c=_0x26af30?_0x1637e1['count']:_0x1bff5e[_0xac0f('0x1a')]+_0x1bff5e['limit'];var _0x2b42fb;if(_0x5ded3c>=_0x557a67){_0x5ded3c=_0x557a67;_0x2b42fb=0xc8;}else{_0x2b42fb=0xce;}_0x7268b9[_0xac0f('0x17')](_0x2b42fb);return _0x7268b9['set'](_0xac0f('0x1e'),_0x3ae820+'-'+_0x5ded3c+'/'+_0x557a67)['json'](_0x1637e1);}return null;};}function patchUpdates(_0x5d7225){return function(_0x1d65d5){try{jsonpatch['apply'](_0x1d65d5,_0x5d7225,!![]);}catch(_0x3b968e){return BPromise[_0xac0f('0x1f')](_0x3b968e);}return _0x1d65d5[_0xac0f('0x20')]();};}function saveUpdates(_0x47b540,_0x7785b){return function(_0x598159){if(_0x598159){return _0x598159[_0xac0f('0x21')](_0x47b540)[_0xac0f('0x22')](function(_0x8a66eb){return _0x8a66eb;});}return null;};}function removeEntity(_0x24ddbd,_0x5b532d){return function(_0x59acce){if(_0x59acce){return _0x59acce[_0xac0f('0x23')]()[_0xac0f('0x22')](function(){_0x24ddbd['status'](0xcc)[_0xac0f('0x18')]();});}};}function handleEntityNotFound(_0x1f6c83,_0x2023ad){return function(_0x1eff4c){if(!_0x1eff4c){_0x1f6c83[_0xac0f('0x16')](0x194);}return _0x1eff4c;};}function handleError(_0x4ec565,_0x4ca54f){_0x4ca54f=_0x4ca54f||0x1f4;return function(_0x446cfb){logger['error'](_0x446cfb[_0xac0f('0x24')]);if(_0x446cfb[_0xac0f('0x25')]){delete _0x446cfb[_0xac0f('0x25')];}_0x4ec565[_0xac0f('0x17')](_0x4ca54f)[_0xac0f('0x26')](_0x446cfb);};}exports[_0xac0f('0x27')]=function(_0x4299b0,_0x2cef05){var _0x40ff99={},_0x470014={},_0x273b36={'count':0x0,'rows':[]};var _0x459096=_[_0xac0f('0x28')](db[_0xac0f('0x29')][_0xac0f('0x2a')],function(_0x813945){return{'name':_0x813945[_0xac0f('0x2b')],'type':_0x813945['type'][_0xac0f('0x2c')]};});_0x470014[_0xac0f('0x2d')]=_[_0xac0f('0x28')](_0x459096,_0xac0f('0x25'));_0x470014['query']=_[_0xac0f('0x2e')](_0x4299b0['query']);_0x470014[_0xac0f('0x2f')]=_[_0xac0f('0x30')](_0x470014['model'],_0x470014[_0xac0f('0x31')]);_0x40ff99[_0xac0f('0x32')]=_[_0xac0f('0x30')](_0x470014[_0xac0f('0x2d')],qs[_0xac0f('0x33')](_0x4299b0[_0xac0f('0x31')][_0xac0f('0x33')]));_0x40ff99[_0xac0f('0x32')]=_0x40ff99[_0xac0f('0x32')][_0xac0f('0x34')]?_0x40ff99[_0xac0f('0x32')]:_0x470014[_0xac0f('0x2d')];if(!_0x4299b0['query'][_0xac0f('0x35')](_0xac0f('0x36'))){_0x40ff99[_0xac0f('0x1c')]=qs['limit'](_0x4299b0[_0xac0f('0x31')][_0xac0f('0x1c')]);_0x40ff99['offset']=qs[_0xac0f('0x1a')](_0x4299b0['query'][_0xac0f('0x1a')]);}_0x40ff99[_0xac0f('0x37')]=qs[_0xac0f('0x38')](_0x4299b0[_0xac0f('0x31')][_0xac0f('0x38')]);_0x40ff99[_0xac0f('0x39')]=qs[_0xac0f('0x2f')](_['pick'](_0x4299b0[_0xac0f('0x31')],_0x470014[_0xac0f('0x2f')]),_0x459096);if(_0x4299b0[_0xac0f('0x31')][_0xac0f('0x3a')]){_0x40ff99[_0xac0f('0x39')]=_[_0xac0f('0x3b')](_0x40ff99['where'],{'$or':_['map'](_0x459096,function(_0x26f39a){if(_0x26f39a[_0xac0f('0x3c')]!==_0xac0f('0x3d')){var _0x30d32b={};_0x30d32b[_0x26f39a[_0xac0f('0x25')]]={'$like':'%'+_0x4299b0[_0xac0f('0x31')][_0xac0f('0x3a')]+'%'};return _0x30d32b;}})});}_0x40ff99=_[_0xac0f('0x3b')]({},_0x40ff99,_0x4299b0['options']);var _0x557e20={'where':_0x40ff99['where']};return db[_0xac0f('0x29')][_0xac0f('0x1d')](_0x557e20)['then'](function(_0x594b24){_0x273b36[_0xac0f('0x1d')]=_0x594b24;if(_0x4299b0[_0xac0f('0x31')][_0xac0f('0x3e')]){_0x40ff99[_0xac0f('0x3f')]=[{'all':!![]}];}return db[_0xac0f('0x29')][_0xac0f('0x40')](_0x40ff99);})['then'](function(_0x27a2a4){_0x273b36[_0xac0f('0x41')]=_0x27a2a4;return _0x273b36;})['then'](respondWithFilteredResult(_0x2cef05,_0x40ff99))[_0xac0f('0x42')](handleError(_0x2cef05,null));};exports[_0xac0f('0x43')]=function(_0x1a2228,_0x2c0a60){var _0x48daff={'raw':!![],'where':{'id':_0x1a2228[_0xac0f('0x44')]['id']}},_0x11606b={};_0x11606b['model']=_[_0xac0f('0x2e')](db[_0xac0f('0x29')][_0xac0f('0x2a')]);_0x11606b[_0xac0f('0x31')]=_['keys'](_0x1a2228[_0xac0f('0x31')]);_0x11606b[_0xac0f('0x2f')]=_[_0xac0f('0x30')](_0x11606b['model'],_0x11606b[_0xac0f('0x31')]);_0x48daff['attributes']=_['intersection'](_0x11606b['model'],qs['fields'](_0x1a2228[_0xac0f('0x31')]['fields']));_0x48daff[_0xac0f('0x32')]=_0x48daff[_0xac0f('0x32')][_0xac0f('0x34')]?_0x48daff[_0xac0f('0x32')]:_0x11606b[_0xac0f('0x2d')];if(_0x1a2228[_0xac0f('0x31')][_0xac0f('0x3e')]){_0x48daff[_0xac0f('0x3f')]=[{'all':!![]}];}_0x48daff=_['merge']({},_0x48daff,_0x1a2228['options']);return db['FaxTransferReport']['find'](_0x48daff)[_0xac0f('0x22')](handleEntityNotFound(_0x2c0a60,null))[_0xac0f('0x22')](respondWithResult(_0x2c0a60,null))[_0xac0f('0x42')](handleError(_0x2c0a60,null));};exports[_0xac0f('0x45')]=function(_0x18c3c4,_0x2ac1d0){return db[_0xac0f('0x29')][_0xac0f('0x45')](_0x18c3c4[_0xac0f('0x46')],{})[_0xac0f('0x22')](respondWithResult(_0x2ac1d0,0xc9))['catch'](handleError(_0x2ac1d0,null));};exports[_0xac0f('0x21')]=function(_0x2c6af8,_0x29cfa4){if(_0x2c6af8['body']['id']){delete _0x2c6af8[_0xac0f('0x46')]['id'];}return db[_0xac0f('0x29')][_0xac0f('0x47')]({'where':{'id':_0x2c6af8['params']['id']}})['then'](handleEntityNotFound(_0x29cfa4,null))['then'](saveUpdates(_0x2c6af8[_0xac0f('0x46')],null))[_0xac0f('0x22')](respondWithResult(_0x29cfa4,null))[_0xac0f('0x42')](handleError(_0x29cfa4,null));};exports[_0xac0f('0x23')]=function(_0x419883,_0x123933){return db[_0xac0f('0x29')][_0xac0f('0x47')]({'where':{'id':_0x419883[_0xac0f('0x44')]['id']}})[_0xac0f('0x22')](handleEntityNotFound(_0x123933,null))['then'](removeEntity(_0x123933,null))['catch'](handleError(_0x123933,null));};exports[_0xac0f('0x48')]=function(_0x3576b1,_0xe8411c){return db['FaxTransferReport']['describe']()['then'](respondWithResult(_0xe8411c,null))[_0xac0f('0x42')](handleError(_0xe8411c,null));}; \ No newline at end of file +var _0x5a94=['keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','name','index','FaxTransferReport','rawAttributes','fieldName','key','model','query'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0x5a94,0x192));var _0x45a9=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x5a94[_0x5f09c5];return _0x426ad9;};'use strict';var emlformat=require(_0x45a9('0x0'));var rimraf=require(_0x45a9('0x1'));var zipdir=require(_0x45a9('0x2'));var jsonpatch=require(_0x45a9('0x3'));var rp=require(_0x45a9('0x4'));var moment=require(_0x45a9('0x5'));var BPromise=require(_0x45a9('0x6'));var Mustache=require('mustache');var util=require(_0x45a9('0x7'));var path=require(_0x45a9('0x8'));var sox=require(_0x45a9('0x9'));var csv=require(_0x45a9('0xa'));var ejs=require(_0x45a9('0xb'));var fs=require('fs');var fs_extra=require(_0x45a9('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x45a9('0xd'));var jsforce=require(_0x45a9('0xe'));var deskjs=require(_0x45a9('0xf'));var toCsv=require(_0x45a9('0xa'));var querystring=require(_0x45a9('0x10'));var Papa=require(_0x45a9('0x11'));var Redis=require(_0x45a9('0x12'));var authService=require(_0x45a9('0x13'));var qs=require(_0x45a9('0x14'));var as=require(_0x45a9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45a9('0x16'))(_0x45a9('0x17'));var utils=require(_0x45a9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x45a9('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8628,_0x34e6df){_0x34e6df=_0x34e6df||0xcc;return function(_0x4e1720){if(_0x4e1720){return _0x5a8628[_0x45a9('0x1a')](_0x34e6df);}return _0x5a8628['status'](_0x34e6df)[_0x45a9('0x1b')]();};}function respondWithResult(_0x15e2b4,_0x2253fb){_0x2253fb=_0x2253fb||0xc8;return function(_0x281c79){if(_0x281c79){return _0x15e2b4[_0x45a9('0x1c')](_0x2253fb)[_0x45a9('0x1d')](_0x281c79);}};}function respondWithFilteredResult(_0x2c5d98,_0x2b053a){return function(_0x506a8d){if(_0x506a8d){var _0xce34f7=typeof _0x2b053a[_0x45a9('0x1e')]===_0x45a9('0x1f')&&typeof _0x2b053a[_0x45a9('0x20')]===_0x45a9('0x1f');var _0x482a50=_0x506a8d['count'];var _0x2d79b3=_0xce34f7?0x0:_0x2b053a[_0x45a9('0x1e')];var _0x3e6af0=_0xce34f7?_0x506a8d[_0x45a9('0x21')]:_0x2b053a[_0x45a9('0x1e')]+_0x2b053a[_0x45a9('0x20')];var _0x5a5e3b;if(_0x3e6af0>=_0x482a50){_0x3e6af0=_0x482a50;_0x5a5e3b=0xc8;}else{_0x5a5e3b=0xce;}_0x2c5d98[_0x45a9('0x1c')](_0x5a5e3b);return _0x2c5d98['set'](_0x45a9('0x22'),_0x2d79b3+'-'+_0x3e6af0+'/'+_0x482a50)[_0x45a9('0x1d')](_0x506a8d);}return null;};}function patchUpdates(_0x20afba){return function(_0x2e2f14){try{jsonpatch['apply'](_0x2e2f14,_0x20afba,!![]);}catch(_0x41d0d7){return BPromise['reject'](_0x41d0d7);}return _0x2e2f14[_0x45a9('0x23')]();};}function saveUpdates(_0x1df5d0,_0xe5494f){return function(_0x58ebd5){if(_0x58ebd5){return _0x58ebd5[_0x45a9('0x24')](_0x1df5d0)[_0x45a9('0x25')](function(_0x5ce721){return _0x5ce721;});}return null;};}function removeEntity(_0x6c5b7a,_0x574a9a){return function(_0x3d36fc){if(_0x3d36fc){return _0x3d36fc[_0x45a9('0x26')]()[_0x45a9('0x25')](function(){_0x6c5b7a[_0x45a9('0x1c')](0xcc)[_0x45a9('0x1b')]();});}};}function handleEntityNotFound(_0x4161a6,_0x4dfe9d){return function(_0x51b23e){if(!_0x51b23e){_0x4161a6[_0x45a9('0x1a')](0x194);}return _0x51b23e;};}function handleError(_0x28e74f,_0x47ce6c){_0x47ce6c=_0x47ce6c||0x1f4;return function(_0x51cdf4){logger[_0x45a9('0x27')](_0x51cdf4['stack']);if(_0x51cdf4['name']){delete _0x51cdf4[_0x45a9('0x28')];}_0x28e74f['status'](_0x47ce6c)['send'](_0x51cdf4);};}exports[_0x45a9('0x29')]=function(_0x25dde6,_0x33b0f4){var _0x5c70da={},_0x149e5b={},_0x2bd940={'count':0x0,'rows':[]};var _0x890772=_['map'](db[_0x45a9('0x2a')][_0x45a9('0x2b')],function(_0xfc63e5){return{'name':_0xfc63e5[_0x45a9('0x2c')],'type':_0xfc63e5['type'][_0x45a9('0x2d')]};});_0x149e5b[_0x45a9('0x2e')]=_['map'](_0x890772,_0x45a9('0x28'));_0x149e5b[_0x45a9('0x2f')]=_[_0x45a9('0x30')](_0x25dde6[_0x45a9('0x2f')]);_0x149e5b[_0x45a9('0x31')]=_[_0x45a9('0x32')](_0x149e5b[_0x45a9('0x2e')],_0x149e5b[_0x45a9('0x2f')]);_0x5c70da['attributes']=_[_0x45a9('0x32')](_0x149e5b[_0x45a9('0x2e')],qs['fields'](_0x25dde6['query'][_0x45a9('0x33')]));_0x5c70da[_0x45a9('0x34')]=_0x5c70da[_0x45a9('0x34')]['length']?_0x5c70da['attributes']:_0x149e5b['model'];if(!_0x25dde6[_0x45a9('0x2f')]['hasOwnProperty'](_0x45a9('0x35'))){_0x5c70da[_0x45a9('0x20')]=qs[_0x45a9('0x20')](_0x25dde6[_0x45a9('0x2f')]['limit']);_0x5c70da[_0x45a9('0x1e')]=qs[_0x45a9('0x1e')](_0x25dde6[_0x45a9('0x2f')][_0x45a9('0x1e')]);}_0x5c70da[_0x45a9('0x36')]=qs[_0x45a9('0x37')](_0x25dde6[_0x45a9('0x2f')][_0x45a9('0x37')]);_0x5c70da[_0x45a9('0x38')]=qs[_0x45a9('0x31')](_[_0x45a9('0x39')](_0x25dde6[_0x45a9('0x2f')],_0x149e5b[_0x45a9('0x31')]),_0x890772);if(_0x25dde6[_0x45a9('0x2f')][_0x45a9('0x3a')]){_0x5c70da[_0x45a9('0x38')]=_[_0x45a9('0x3b')](_0x5c70da[_0x45a9('0x38')],{'$or':_[_0x45a9('0x3c')](_0x890772,function(_0x29a22a){if(_0x29a22a[_0x45a9('0x3d')]!=='VIRTUAL'){var _0xd8ce24={};_0xd8ce24[_0x29a22a[_0x45a9('0x28')]]={'$like':'%'+_0x25dde6[_0x45a9('0x2f')][_0x45a9('0x3a')]+'%'};return _0xd8ce24;}})});}_0x5c70da=_['merge']({},_0x5c70da,_0x25dde6[_0x45a9('0x3e')]);var _0x20fa01={'where':_0x5c70da['where']};return db[_0x45a9('0x2a')][_0x45a9('0x21')](_0x20fa01)['then'](function(_0x537801){_0x2bd940[_0x45a9('0x21')]=_0x537801;if(_0x25dde6[_0x45a9('0x2f')][_0x45a9('0x3f')]){_0x5c70da['include']=[{'all':!![]}];}return db[_0x45a9('0x2a')][_0x45a9('0x40')](_0x5c70da);})[_0x45a9('0x25')](function(_0x640f12){_0x2bd940[_0x45a9('0x41')]=_0x640f12;return _0x2bd940;})[_0x45a9('0x25')](respondWithFilteredResult(_0x33b0f4,_0x5c70da))[_0x45a9('0x42')](handleError(_0x33b0f4,null));};exports[_0x45a9('0x43')]=function(_0x469eb0,_0x34cb67){var _0x945e49={'raw':!![],'where':{'id':_0x469eb0[_0x45a9('0x44')]['id']}},_0x584536={};_0x584536[_0x45a9('0x2e')]=_[_0x45a9('0x30')](db[_0x45a9('0x2a')][_0x45a9('0x2b')]);_0x584536['query']=_[_0x45a9('0x30')](_0x469eb0[_0x45a9('0x2f')]);_0x584536['filters']=_[_0x45a9('0x32')](_0x584536['model'],_0x584536[_0x45a9('0x2f')]);_0x945e49[_0x45a9('0x34')]=_[_0x45a9('0x32')](_0x584536[_0x45a9('0x2e')],qs[_0x45a9('0x33')](_0x469eb0[_0x45a9('0x2f')][_0x45a9('0x33')]));_0x945e49['attributes']=_0x945e49['attributes'][_0x45a9('0x45')]?_0x945e49[_0x45a9('0x34')]:_0x584536[_0x45a9('0x2e')];if(_0x469eb0[_0x45a9('0x2f')][_0x45a9('0x3f')]){_0x945e49[_0x45a9('0x46')]=[{'all':!![]}];}_0x945e49=_[_0x45a9('0x3b')]({},_0x945e49,_0x469eb0[_0x45a9('0x3e')]);return db['FaxTransferReport'][_0x45a9('0x47')](_0x945e49)[_0x45a9('0x25')](handleEntityNotFound(_0x34cb67,null))[_0x45a9('0x25')](respondWithResult(_0x34cb67,null))[_0x45a9('0x42')](handleError(_0x34cb67,null));};exports[_0x45a9('0x48')]=function(_0x5a42c5,_0x5afb69){return db[_0x45a9('0x2a')][_0x45a9('0x48')](_0x5a42c5[_0x45a9('0x49')],{})[_0x45a9('0x25')](respondWithResult(_0x5afb69,0xc9))[_0x45a9('0x42')](handleError(_0x5afb69,null));};exports[_0x45a9('0x24')]=function(_0x36505a,_0x275dd7){if(_0x36505a[_0x45a9('0x49')]['id']){delete _0x36505a[_0x45a9('0x49')]['id'];}return db[_0x45a9('0x2a')][_0x45a9('0x47')]({'where':{'id':_0x36505a[_0x45a9('0x44')]['id']}})[_0x45a9('0x25')](handleEntityNotFound(_0x275dd7,null))[_0x45a9('0x25')](saveUpdates(_0x36505a['body'],null))[_0x45a9('0x25')](respondWithResult(_0x275dd7,null))[_0x45a9('0x42')](handleError(_0x275dd7,null));};exports['destroy']=function(_0x11bdfa,_0x47a31e){return db[_0x45a9('0x2a')]['find']({'where':{'id':_0x11bdfa[_0x45a9('0x44')]['id']}})[_0x45a9('0x25')](handleEntityNotFound(_0x47a31e,null))[_0x45a9('0x25')](removeEntity(_0x47a31e,null))['catch'](handleError(_0x47a31e,null));};exports['describe']=function(_0x5da4d0,_0x545c14){return db[_0x45a9('0x2a')][_0x45a9('0x4a')]()['then'](respondWithResult(_0x545c14,null))[_0x45a9('0x42')](handleError(_0x545c14,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 528cb57..ab5ceda 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 _0x6b6b=['define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x6b6b,0x16b));var _0xb6b6=function(_0x43dbe9,_0xf43a4a){_0x43dbe9=_0x43dbe9-0x0;var _0x11a746=_0x6b6b[_0x43dbe9];return _0x11a746;};'use strict';var _=require(_0xb6b6('0x0'));var util=require(_0xb6b6('0x1'));var logger=require(_0xb6b6('0x2'))(_0xb6b6('0x3'));var moment=require(_0xb6b6('0x4'));var BPromise=require(_0xb6b6('0x5'));var rp=require(_0xb6b6('0x6'));var fs=require('fs');var path=require(_0xb6b6('0x7'));var rimraf=require(_0xb6b6('0x8'));var config=require(_0xb6b6('0x9'));var attributes=require(_0xb6b6('0xa'));module[_0xb6b6('0xb')]=function(_0x521272,_0x48c97c){return _0x521272[_0xb6b6('0xc')]('FaxTransferReport',attributes,{'tableName':_0xb6b6('0xd'),'paranoid':![],'indexes':[{'name':_0xb6b6('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x364e=['api','moment','request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x450e67,_0x39fdbd){var _0x50a0e6=function(_0x2251f0){while(--_0x2251f0){_0x450e67['push'](_0x450e67['shift']());}};_0x50a0e6(++_0x39fdbd);}(_0x364e,0x99));var _0xe364=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x364e[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xe364('0x0'));var util=require(_0xe364('0x1'));var logger=require(_0xe364('0x2'))(_0xe364('0x3'));var moment=require(_0xe364('0x4'));var BPromise=require('bluebird');var rp=require(_0xe364('0x5'));var fs=require('fs');var path=require(_0xe364('0x6'));var rimraf=require('rimraf');var config=require(_0xe364('0x7'));var attributes=require(_0xe364('0x8'));module[_0xe364('0x9')]=function(_0x2c08fb,_0x1f39e8){return _0x2c08fb[_0xe364('0xa')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xe364('0xb'),'fields':[_0xe364('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 0ce9c75..1f982f1 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 _0x967f=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring'];(function(_0x4f789c,_0x5c2a52){var _0x45540e=function(_0x58ad03){while(--_0x58ad03){_0x4f789c['push'](_0x4f789c['shift']());}};_0x45540e(++_0x5c2a52);}(_0x967f,0x8f));var _0xf967=function(_0x300cf0,_0x17e246){_0x300cf0=_0x300cf0-0x0;var _0x16688a=_0x967f[_0x300cf0];return _0x16688a;};'use strict';var _=require('lodash');var util=require(_0xf967('0x0'));var moment=require(_0xf967('0x1'));var BPromise=require(_0xf967('0x2'));var rs=require(_0xf967('0x3'));var fs=require('fs');var Redis=require(_0xf967('0x4'));var db=require(_0xf967('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf967('0x6'));var config=require(_0xf967('0x7'));var jayson=require(_0xf967('0x8'));var client=jayson[_0xf967('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3644ad,_0x5d20d7,_0x152a53){return new BPromise(function(_0x2327dc,_0x180ac2){return client[_0xf967('0xa')](_0x3644ad,_0x152a53)[_0xf967('0xb')](function(_0x5ba6a6){logger[_0xf967('0xc')](_0xf967('0xd'),_0x5d20d7,_0xf967('0xe'));logger[_0xf967('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5d20d7,'request\x20sent',JSON[_0xf967('0x10')](_0x5ba6a6));if(_0x5ba6a6[_0xf967('0x11')]){if(_0x5ba6a6[_0xf967('0x11')][_0xf967('0x12')]===0x1f4){logger[_0xf967('0x11')](_0xf967('0xd'),_0x5d20d7,_0x5ba6a6['error'][_0xf967('0x13')]);return _0x180ac2(_0x5ba6a6[_0xf967('0x11')][_0xf967('0x13')]);}logger[_0xf967('0x11')](_0xf967('0xd'),_0x5d20d7,_0x5ba6a6[_0xf967('0x11')]['message']);return _0x2327dc(_0x5ba6a6[_0xf967('0x11')][_0xf967('0x13')]);}else{logger[_0xf967('0xc')](_0xf967('0xd'),_0x5d20d7,_0xf967('0xe'));_0x2327dc(_0x5ba6a6[_0xf967('0x14')][_0xf967('0x13')]);}})['catch'](function(_0x343714){logger[_0xf967('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x5d20d7,_0x343714);_0x180ac2(_0x343714);});});} \ No newline at end of file +var _0xe569=['info','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x7ebf0c,_0x2c8364){var _0x1eb521=function(_0x4f639e){while(--_0x4f639e){_0x7ebf0c['push'](_0x7ebf0c['shift']());}};_0x1eb521(++_0x2c8364);}(_0xe569,0xdf));var _0x9e56=function(_0x40b61c,_0x13015c){_0x40b61c=_0x40b61c-0x0;var _0x29ea9b=_0xe569[_0x40b61c];return _0x29ea9b;};'use strict';var _=require(_0x9e56('0x0'));var util=require(_0x9e56('0x1'));var moment=require(_0x9e56('0x2'));var BPromise=require(_0x9e56('0x3'));var rs=require(_0x9e56('0x4'));var fs=require('fs');var Redis=require(_0x9e56('0x5'));var db=require(_0x9e56('0x6'))['db'];var utils=require(_0x9e56('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x9e56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e56('0x9')][_0x9e56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ca871,_0xfdd5de,_0x4daf09){return new BPromise(function(_0x4fdabc,_0x53e274){return client[_0x9e56('0xb')](_0x5ca871,_0x4daf09)[_0x9e56('0xc')](function(_0x3e6682){logger['info'](_0x9e56('0xd'),_0xfdd5de,'request\x20sent');logger[_0x9e56('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xfdd5de,'request\x20sent',JSON[_0x9e56('0xf')](_0x3e6682));if(_0x3e6682[_0x9e56('0x10')]){if(_0x3e6682['error'][_0x9e56('0x11')]===0x1f4){logger[_0x9e56('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0xfdd5de,_0x3e6682['error']['message']);return _0x53e274(_0x3e6682[_0x9e56('0x10')]['message']);}logger[_0x9e56('0x10')](_0x9e56('0xd'),_0xfdd5de,_0x3e6682[_0x9e56('0x10')][_0x9e56('0x12')]);return _0x4fdabc(_0x3e6682[_0x9e56('0x10')][_0x9e56('0x12')]);}else{logger[_0x9e56('0x13')](_0x9e56('0xd'),_0xfdd5de,_0x9e56('0x14'));_0x4fdabc(_0x3e6682['result'][_0x9e56('0x12')]);}})[_0x9e56('0x15')](function(_0x85bc19){logger[_0x9e56('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0xfdd5de,_0x85bc19);_0x53e274(_0x85bc19);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d86d0b0..b469a6a 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 _0x3e6a=['/describe','isAuthenticated','/:id','show','post','create','put','delete','destroy','multer','path','connect-timeout','express','../../config/environment','get','index'];(function(_0x4a262e,_0x4454bc){var _0x1d1b20=function(_0x5cda55){while(--_0x5cda55){_0x4a262e['push'](_0x4a262e['shift']());}};_0x1d1b20(++_0x4454bc);}(_0x3e6a,0x199));var _0xa3e6=function(_0x86de05,_0x1f034a){_0x86de05=_0x86de05-0x0;var _0x43604d=_0x3e6a[_0x86de05];return _0x43604d;};'use strict';var multer=require(_0xa3e6('0x0'));var util=require('util');var path=require(_0xa3e6('0x1'));var timeout=require(_0xa3e6('0x2'));var express=require(_0xa3e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa3e6('0x4'));var controller=require('./faxTransferReport.controller');router[_0xa3e6('0x5')]('/',auth['isAuthenticated'](),controller[_0xa3e6('0x6')]);router['get'](_0xa3e6('0x7'),auth[_0xa3e6('0x8')](),controller['describe']);router[_0xa3e6('0x5')](_0xa3e6('0x9'),auth['isAuthenticated'](),controller[_0xa3e6('0xa')]);router[_0xa3e6('0xb')]('/',auth['isAuthenticated'](),controller[_0xa3e6('0xc')]);router[_0xa3e6('0xd')](_0xa3e6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xa3e6('0xe')](_0xa3e6('0x9'),auth[_0xa3e6('0x8')](),controller[_0xa3e6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7f4d=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x7f4d,0x191));var _0xd7f4=function(_0x52b01d,_0x4758e1){_0x52b01d=_0x52b01d-0x0;var _0x116055=_0x7f4d[_0x52b01d];return _0x116055;};'use strict';var multer=require(_0xd7f4('0x0'));var util=require('util');var path=require(_0xd7f4('0x1'));var timeout=require(_0xd7f4('0x2'));var express=require(_0xd7f4('0x3'));var router=express['Router']();var fs_extra=require(_0xd7f4('0x4'));var auth=require(_0xd7f4('0x5'));var interaction=require(_0xd7f4('0x6'));var config=require('../../config/environment');var controller=require(_0xd7f4('0x7'));router[_0xd7f4('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7f4('0x9')]);router[_0xd7f4('0x8')](_0xd7f4('0xa'),auth[_0xd7f4('0xb')](),controller[_0xd7f4('0xc')]);router[_0xd7f4('0x8')](_0xd7f4('0xd'),auth[_0xd7f4('0xb')](),controller['show']);router[_0xd7f4('0xe')]('/',auth[_0xd7f4('0xb')](),controller[_0xd7f4('0xf')]);router[_0xd7f4('0x10')](_0xd7f4('0xd'),auth['isAuthenticated'](),controller[_0xd7f4('0x11')]);router[_0xd7f4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd7f4('0x13')]);module[_0xd7f4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index ff89219..9a74d7f 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 _0x7274=['delete','destroy','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x224a1e,_0x60c18e){var _0x3d0457=function(_0x395c8d){while(--_0x395c8d){_0x224a1e['push'](_0x224a1e['shift']());}};_0x3d0457(++_0x60c18e);}(_0x7274,0xc8));var _0x4727=function(_0x18915d,_0x5cfb85){_0x18915d=_0x18915d-0x0;var _0x478c51=_0x7274[_0x18915d];return _0x478c51;};'use strict';var multer=require(_0x4727('0x0'));var util=require('util');var path=require(_0x4727('0x1'));var timeout=require(_0x4727('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4727('0x3'));var auth=require(_0x4727('0x4'));var interaction=require(_0x4727('0x5'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x4727('0x6')]('/',auth[_0x4727('0x7')](),controller[_0x4727('0x8')]);router[_0x4727('0x6')](_0x4727('0x9'),auth[_0x4727('0x7')](),controller[_0x4727('0xa')]);router[_0x4727('0x6')](_0x4727('0xb'),auth[_0x4727('0x7')](),controller[_0x4727('0xc')]);router[_0x4727('0x6')](_0x4727('0xd'),auth[_0x4727('0x7')](),controller[_0x4727('0xe')]);router[_0x4727('0xf')]('/',auth[_0x4727('0x7')](),controller[_0x4727('0x10')]);router[_0x4727('0xf')](_0x4727('0xb'),auth['isAuthenticated'](),controller[_0x4727('0x11')]);router[_0x4727('0x12')]('/:id',auth[_0x4727('0x7')](),controller[_0x4727('0x13')]);router[_0x4727('0x14')](_0x4727('0x9'),auth[_0x4727('0x7')](),controller[_0x4727('0x15')]);module['exports']=router; \ No newline at end of file +var _0xef98=['multer','path','connect-timeout','Router','../../components/auth/service','./intDeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','/:id','update','destroy','exports'];(function(_0x4a8a0d,_0x74ea56){var _0x1e4826=function(_0x5c1206){while(--_0x5c1206){_0x4a8a0d['push'](_0x4a8a0d['shift']());}};_0x1e4826(++_0x74ea56);}(_0xef98,0xa2));var _0x8ef9=function(_0x3ec1df,_0x1f7175){_0x3ec1df=_0x3ec1df-0x0;var _0x4f26b0=_0xef98[_0x3ec1df];return _0x4f26b0;};'use strict';var multer=require(_0x8ef9('0x0'));var util=require('util');var path=require(_0x8ef9('0x1'));var timeout=require(_0x8ef9('0x2'));var express=require('express');var router=express[_0x8ef9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ef9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8ef9('0x5'));router[_0x8ef9('0x6')]('/',auth[_0x8ef9('0x7')](),controller['index']);router[_0x8ef9('0x6')]('/:id',auth[_0x8ef9('0x7')](),controller['show']);router[_0x8ef9('0x6')](_0x8ef9('0x8'),auth[_0x8ef9('0x7')](),controller[_0x8ef9('0x9')]);router['get'](_0x8ef9('0xa'),auth[_0x8ef9('0x7')](),controller['getFields']);router[_0x8ef9('0xb')]('/',auth[_0x8ef9('0x7')](),controller['create']);router[_0x8ef9('0xb')]('/:id/configurations',auth[_0x8ef9('0x7')](),controller[_0x8ef9('0xc')]);router[_0x8ef9('0xd')](_0x8ef9('0xe'),auth[_0x8ef9('0x7')](),controller[_0x8ef9('0xf')]);router['delete'](_0x8ef9('0xe'),auth['isAuthenticated'](),controller[_0x8ef9('0x10')]);module[_0x8ef9('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 21ba48a..5d235f5 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 _0x65be=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x55efdf,_0x4ccf12){var _0x195eb3=function(_0x38e928){while(--_0x38e928){_0x55efdf['push'](_0x55efdf['shift']());}};_0x195eb3(++_0x4ccf12);}(_0x65be,0x14e));var _0xe65b=function(_0x1c269e,_0x27d1cf){_0x1c269e=_0x1c269e-0x0;var _0x5115e0=_0x65be[_0x1c269e];return _0x5115e0;};'use strict';var Sequelize=require(_0xe65b('0x0'));module[_0xe65b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe65b('0x2')]},'username':{'type':Sequelize[_0xe65b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xe65b('0x3')](_0xe65b('0x4')),'defaultValue':_0xe65b('0x4')},'password':{'type':Sequelize[_0xe65b('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xe65b('0x2')]},'token':{'type':Sequelize[_0xe65b('0x2')]},'tokenSecret':{'type':Sequelize[_0xe65b('0x2')]},'serverUrl':{'type':Sequelize[_0xe65b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe65b('0x5'),_0xe65b('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xdfbe=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x204bdb,_0x12484c){var _0x1ce9b6=function(_0x2f70c3){while(--_0x2f70c3){_0x204bdb['push'](_0x204bdb['shift']());}};_0x1ce9b6(++_0x12484c);}(_0xdfbe,0x1e0));var _0xedfb=function(_0xdf5705,_0x25e85e){_0xdf5705=_0xdf5705-0x0;var _0x4d03a2=_0xdfbe[_0xdf5705];return _0x4d03a2;};'use strict';var Sequelize=require(_0xedfb('0x0'));module[_0xedfb('0x1')]={'name':{'type':Sequelize[_0xedfb('0x2')]},'description':{'type':Sequelize[_0xedfb('0x2')]},'username':{'type':Sequelize[_0xedfb('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0xedfb('0x3')](_0xedfb('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xedfb('0x2')]},'consumerKey':{'type':Sequelize[_0xedfb('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xedfb('0x2')]},'serverUrl':{'type':Sequelize[_0xedfb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xedfb('0x3')](_0xedfb('0x5'),_0xedfb('0x6')),'defaultValue':_0xedfb('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8dc3e7b..1cd186e 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 _0x1117=['set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','order','pick','filters','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','create','body','find','getConfigurations','findOne','DeskConfiguration','sort','filter','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit'];(function(_0x29d31b,_0x81b5e8){var _0x28c433=function(_0x44e752){while(--_0x44e752){_0x29d31b['push'](_0x29d31b['shift']());}};_0x28c433(++_0x81b5e8);}(_0x1117,0xc3));var _0x7111=function(_0x3f186c,_0x407d8c){_0x3f186c=_0x3f186c-0x0;var _0x16f766=_0x1117[_0x3f186c];return _0x16f766;};'use strict';var emlformat=require(_0x7111('0x0'));var rimraf=require(_0x7111('0x1'));var zipdir=require(_0x7111('0x2'));var jsonpatch=require(_0x7111('0x3'));var rp=require(_0x7111('0x4'));var moment=require(_0x7111('0x5'));var BPromise=require(_0x7111('0x6'));var Mustache=require(_0x7111('0x7'));var util=require(_0x7111('0x8'));var path=require(_0x7111('0x9'));var sox=require(_0x7111('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7111('0xb'));var deskjs=require(_0x7111('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7111('0xd'));var Redis=require(_0x7111('0xe'));var authService=require(_0x7111('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7111('0x10'));var hardwareService=require(_0x7111('0x11'));var logger=require(_0x7111('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7111('0x13'));var licenseUtil=require(_0x7111('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7111('0x15'));function respondWithStatusCode(_0x3c55b8,_0x44e63e){_0x44e63e=_0x44e63e||0xcc;return function(_0xdfc723){if(_0xdfc723){return _0x3c55b8[_0x7111('0x16')](_0x44e63e);}return _0x3c55b8[_0x7111('0x17')](_0x44e63e)['end']();};}function respondWithResult(_0x262728,_0x3133de){_0x3133de=_0x3133de||0xc8;return function(_0x15ea54){if(_0x15ea54){return _0x262728[_0x7111('0x17')](_0x3133de)[_0x7111('0x18')](_0x15ea54);}};}function respondWithFilteredResult(_0x3f8589,_0x1653c9){return function(_0x55c591){if(_0x55c591){var _0x56e825=typeof _0x1653c9[_0x7111('0x19')]==='undefined'&&typeof _0x1653c9['limit']===_0x7111('0x1a');var _0x19db04=_0x55c591[_0x7111('0x1b')];var _0x58926a=_0x56e825?0x0:_0x1653c9[_0x7111('0x19')];var _0x3f46cc=_0x56e825?_0x55c591['count']:_0x1653c9[_0x7111('0x19')]+_0x1653c9[_0x7111('0x1c')];var _0x1afce1;if(_0x3f46cc>=_0x19db04){_0x3f46cc=_0x19db04;_0x1afce1=0xc8;}else{_0x1afce1=0xce;}_0x3f8589[_0x7111('0x17')](_0x1afce1);return _0x3f8589[_0x7111('0x1d')](_0x7111('0x1e'),_0x58926a+'-'+_0x3f46cc+'/'+_0x19db04)[_0x7111('0x18')](_0x55c591);}return null;};}function patchUpdates(_0x280d35){return function(_0x14810c){try{jsonpatch[_0x7111('0x1f')](_0x14810c,_0x280d35,!![]);}catch(_0x55a087){return BPromise[_0x7111('0x20')](_0x55a087);}return _0x14810c['save']();};}function saveUpdates(_0x56fdfd,_0x5744aa){return function(_0x207737){if(_0x207737){return _0x207737[_0x7111('0x21')](_0x56fdfd)[_0x7111('0x22')](function(_0x35f2e2){return _0x35f2e2;});}return null;};}function removeEntity(_0x1984c6,_0x50bba1){return function(_0x49d7f2){if(_0x49d7f2){return _0x49d7f2[_0x7111('0x23')]()[_0x7111('0x22')](function(){_0x1984c6['status'](0xcc)[_0x7111('0x24')]();});}};}function handleEntityNotFound(_0x98a487,_0x5200aa){return function(_0x576fb5){if(!_0x576fb5){_0x98a487[_0x7111('0x16')](0x194);}return _0x576fb5;};}function handleError(_0x104919,_0x12702d){_0x12702d=_0x12702d||0x1f4;return function(_0x36b37f){logger[_0x7111('0x25')](_0x36b37f[_0x7111('0x26')]);if(_0x36b37f[_0x7111('0x27')]){delete _0x36b37f[_0x7111('0x27')];}_0x104919[_0x7111('0x17')](_0x12702d)[_0x7111('0x28')](_0x36b37f);};}exports[_0x7111('0x29')]=function(_0x8b4261,_0xaa9b21){var _0x3e3962={},_0x3e44d2={},_0x4ea9a6={'count':0x0,'rows':[]};var _0x2f1f33=_['map'](db[_0x7111('0x2a')][_0x7111('0x2b')],function(_0x1e537c){return{'name':_0x1e537c[_0x7111('0x2c')],'type':_0x1e537c[_0x7111('0x2d')][_0x7111('0x2e')]};});_0x3e44d2['model']=_[_0x7111('0x2f')](_0x2f1f33,_0x7111('0x27'));_0x3e44d2[_0x7111('0x30')]=_[_0x7111('0x31')](_0x8b4261[_0x7111('0x30')]);_0x3e44d2['filters']=_['intersection'](_0x3e44d2[_0x7111('0x32')],_0x3e44d2[_0x7111('0x30')]);_0x3e3962[_0x7111('0x33')]=_[_0x7111('0x34')](_0x3e44d2[_0x7111('0x32')],qs[_0x7111('0x35')](_0x8b4261[_0x7111('0x30')][_0x7111('0x35')]));_0x3e3962['attributes']=_0x3e3962[_0x7111('0x33')][_0x7111('0x36')]?_0x3e3962['attributes']:_0x3e44d2['model'];if(!_0x8b4261[_0x7111('0x30')]['hasOwnProperty']('nolimit')){_0x3e3962['limit']=qs[_0x7111('0x1c')](_0x8b4261['query'][_0x7111('0x1c')]);_0x3e3962[_0x7111('0x19')]=qs[_0x7111('0x19')](_0x8b4261['query'][_0x7111('0x19')]);}_0x3e3962[_0x7111('0x37')]=qs['sort'](_0x8b4261[_0x7111('0x30')]['sort']);_0x3e3962['where']=qs['filters'](_[_0x7111('0x38')](_0x8b4261[_0x7111('0x30')],_0x3e44d2[_0x7111('0x39')]),_0x2f1f33);if(_0x8b4261['query']['filter']){_0x3e3962[_0x7111('0x3a')]=_[_0x7111('0x3b')](_0x3e3962[_0x7111('0x3a')],{'$or':_[_0x7111('0x2f')](_0x2f1f33,function(_0x1aa0f5){if(_0x1aa0f5[_0x7111('0x2d')]!==_0x7111('0x3c')){var _0x4517e8={};_0x4517e8[_0x1aa0f5['name']]={'$like':'%'+_0x8b4261[_0x7111('0x30')]['filter']+'%'};return _0x4517e8;}})});}_0x3e3962=_[_0x7111('0x3b')]({},_0x3e3962,_0x8b4261[_0x7111('0x3d')]);var _0x5799ad={'where':_0x3e3962['where']};return db['DeskAccount']['count'](_0x5799ad)['then'](function(_0x4636de){_0x4ea9a6[_0x7111('0x1b')]=_0x4636de;if(_0x8b4261[_0x7111('0x30')][_0x7111('0x3e')]){_0x3e3962['include']=[{'all':!![]}];}return db[_0x7111('0x2a')][_0x7111('0x3f')](_0x3e3962);})['then'](function(_0x1c7f5f){_0x4ea9a6[_0x7111('0x40')]=_0x1c7f5f;return _0x4ea9a6;})['then'](respondWithFilteredResult(_0xaa9b21,_0x3e3962))[_0x7111('0x41')](handleError(_0xaa9b21,null));};exports['show']=function(_0x312af5,_0x4d34aa){var _0x55af7b={'raw':![],'where':{'id':_0x312af5[_0x7111('0x42')]['id']}},_0x48bd19={};_0x48bd19[_0x7111('0x32')]=_[_0x7111('0x31')](db[_0x7111('0x2a')][_0x7111('0x2b')]);_0x48bd19[_0x7111('0x30')]=_['keys'](_0x312af5['query']);_0x48bd19[_0x7111('0x39')]=_[_0x7111('0x34')](_0x48bd19[_0x7111('0x32')],_0x48bd19[_0x7111('0x30')]);_0x55af7b[_0x7111('0x33')]=_[_0x7111('0x34')](_0x48bd19[_0x7111('0x32')],qs[_0x7111('0x35')](_0x312af5[_0x7111('0x30')][_0x7111('0x35')]));_0x55af7b['attributes']=_0x55af7b[_0x7111('0x33')][_0x7111('0x36')]?_0x55af7b[_0x7111('0x33')]:_0x48bd19['model'];if(_0x312af5[_0x7111('0x30')][_0x7111('0x3e')]){_0x55af7b[_0x7111('0x43')]=[{'all':!![]}];}_0x55af7b=_[_0x7111('0x3b')]({},_0x55af7b,_0x312af5[_0x7111('0x3d')]);return db[_0x7111('0x2a')]['find'](_0x55af7b)[_0x7111('0x22')](handleEntityNotFound(_0x4d34aa,null))[_0x7111('0x22')](respondWithResult(_0x4d34aa,null))[_0x7111('0x41')](handleError(_0x4d34aa,null));};exports[_0x7111('0x44')]=function(_0x1dd83d,_0x4118f8){return db[_0x7111('0x2a')][_0x7111('0x44')](_0x1dd83d[_0x7111('0x45')],{})[_0x7111('0x22')](respondWithResult(_0x4118f8,0xc9))[_0x7111('0x41')](handleError(_0x4118f8,null));};exports[_0x7111('0x21')]=function(_0x2ce7ed,_0x4bebe8){if(_0x2ce7ed[_0x7111('0x45')]['id']){delete _0x2ce7ed[_0x7111('0x45')]['id'];}return db['DeskAccount'][_0x7111('0x46')]({'where':{'id':_0x2ce7ed['params']['id']}})[_0x7111('0x22')](handleEntityNotFound(_0x4bebe8,null))[_0x7111('0x22')](saveUpdates(_0x2ce7ed[_0x7111('0x45')],null))['then'](respondWithResult(_0x4bebe8,null))['catch'](handleError(_0x4bebe8,null));};exports[_0x7111('0x23')]=function(_0x3d2509,_0x9cdfca){return db['DeskAccount'][_0x7111('0x46')]({'where':{'id':_0x3d2509['params']['id']}})[_0x7111('0x22')](handleEntityNotFound(_0x9cdfca,null))[_0x7111('0x22')](removeEntity(_0x9cdfca,null))[_0x7111('0x41')](handleError(_0x9cdfca,null));};exports[_0x7111('0x47')]=function(_0x225fc5,_0x37001e,_0x2ac250){var _0x3f86ac={};var _0x53789f={};var _0x2da736;var _0x10fbfd;return db[_0x7111('0x2a')][_0x7111('0x48')]({'where':{'id':_0x225fc5[_0x7111('0x42')]['id']}})['then'](handleEntityNotFound(_0x37001e,null))['then'](function(_0x1c380b){if(_0x1c380b){_0x2da736=_0x1c380b;_0x53789f[_0x7111('0x32')]=_[_0x7111('0x31')](db[_0x7111('0x49')][_0x7111('0x2b')]);_0x53789f['query']=_[_0x7111('0x31')](_0x225fc5['query']);_0x53789f[_0x7111('0x39')]=_['intersection'](_0x53789f[_0x7111('0x32')],_0x53789f['query']);_0x3f86ac[_0x7111('0x33')]=_[_0x7111('0x34')](_0x53789f[_0x7111('0x32')],qs[_0x7111('0x35')](_0x225fc5[_0x7111('0x30')]['fields']));_0x3f86ac[_0x7111('0x33')]=_0x3f86ac[_0x7111('0x33')][_0x7111('0x36')]?_0x3f86ac[_0x7111('0x33')]:_0x53789f[_0x7111('0x32')];_0x3f86ac[_0x7111('0x37')]=qs[_0x7111('0x4a')](_0x225fc5[_0x7111('0x30')][_0x7111('0x4a')]);_0x3f86ac[_0x7111('0x3a')]=qs[_0x7111('0x39')](_['pick'](_0x225fc5[_0x7111('0x30')],_0x53789f[_0x7111('0x39')]));if(_0x225fc5[_0x7111('0x30')]['filter']){_0x3f86ac[_0x7111('0x3a')]=_[_0x7111('0x3b')](_0x3f86ac[_0x7111('0x3a')],{'$or':_[_0x7111('0x2f')](_0x3f86ac[_0x7111('0x33')],function(_0x5b63f4){var _0x47f8aa={};_0x47f8aa[_0x5b63f4]={'$like':'%'+_0x225fc5[_0x7111('0x30')][_0x7111('0x4b')]+'%'};return _0x47f8aa;})});}_0x3f86ac=_[_0x7111('0x3b')]({},_0x3f86ac,_0x225fc5[_0x7111('0x3d')]);return _0x2da736[_0x7111('0x47')](_0x3f86ac);}})['then'](function(_0xf5cba6){if(_0xf5cba6){_0x10fbfd=_0xf5cba6[_0x7111('0x36')];if(!_0x225fc5['query'][_0x7111('0x4c')](_0x7111('0x4d'))){_0x3f86ac[_0x7111('0x1c')]=qs[_0x7111('0x1c')](_0x225fc5[_0x7111('0x30')][_0x7111('0x1c')]);_0x3f86ac[_0x7111('0x19')]=qs['offset'](_0x225fc5[_0x7111('0x30')][_0x7111('0x19')]);}return _0x2da736[_0x7111('0x47')](_0x3f86ac);}})[_0x7111('0x22')](function(_0x33ad6c){if(_0x33ad6c){return _0x33ad6c?{'count':_0x10fbfd,'rows':_0x33ad6c}:null;}})[_0x7111('0x22')](respondWithResult(_0x37001e,null))['catch'](handleError(_0x37001e,null));};exports[_0x7111('0x4e')]=function(_0x2b3924,_0x59efc0,_0x5d45ad){if(_0x2b3924[_0x7111('0x45')]['id']){delete _0x2b3924[_0x7111('0x45')]['id'];}return db[_0x7111('0x2a')][_0x7111('0x48')]({'where':{'id':_0x2b3924['params']['id']}})['then'](handleEntityNotFound(_0x59efc0,null))[_0x7111('0x22')](function(_0x739717){if(_0x739717){_0x2b3924[_0x7111('0x45')][_0x7111('0x4f')]=_0x739717['id'];_0x2b3924['body'][_0x7111('0x50')]=integrations['getSubjects'](_0x2b3924['body'][_0x7111('0x51')],_0x2b3924[_0x7111('0x45')][_0x7111('0x2d')]);_0x2b3924[_0x7111('0x45')][_0x7111('0x52')]=integrations[_0x7111('0x53')](_0x2b3924[_0x7111('0x45')]['channel'],_0x2b3924[_0x7111('0x45')][_0x7111('0x2d')]);return db[_0x7111('0x49')][_0x7111('0x44')](_0x2b3924['body'],{'include':[{'model':db[_0x7111('0x54')],'as':_0x7111('0x50')},{'model':db[_0x7111('0x54')],'as':'Descriptions'}]});}return null;})[_0x7111('0x22')](respondWithResult(_0x59efc0,null))['catch'](handleError(_0x59efc0,null));};exports[_0x7111('0x55')]=function(_0x8b20b5,_0x9bfd0d,_0x5dd146){var _0x77b7c6=[{'name':_0x7111('0x56'),'label':_0x7111('0x56'),'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 _0x8ed60a='';return db[_0x7111('0x2a')][_0x7111('0x48')]({'where':{'id':_0x8b20b5['params']['id']},'attributes':['id','remoteUri',_0x7111('0x57'),_0x7111('0x58'),_0x7111('0x59'),_0x7111('0x5a'),_0x7111('0x5b'),'token',_0x7111('0x5c')]})['then'](handleEntityNotFound(_0x9bfd0d,null))[_0x7111('0x22')](function(_0x232ef7){if(_0x232ef7){_0x8ed60a=_0x232ef7['remoteUri'];var _0x582427=_0x8ed60a[_0x7111('0x5d')](-0x1);if(_0x582427==='/'){_0x8ed60a=_0x8ed60a[_0x7111('0x5e')](0x0,_0x8ed60a['lastIndexOf'](_0x582427));}var _0xb8a932={'method':'GET','uri':util[_0x7111('0x5f')](_0x7111('0x60'),_0x8ed60a),'headers':{'Content-Type':_0x7111('0x61'),'Accept':_0x7111('0x61')},'json':!![]};if(_0x232ef7[_0x7111('0x57')]==='basic'){_0xb8a932[_0x7111('0x62')][_0x7111('0x63')]=util['format'](_0x7111('0x64'),new Buffer(util['format'](_0x7111('0x65'),_0x232ef7[_0x7111('0x58')],_0x232ef7[_0x7111('0x59')]))[_0x7111('0x66')]('base64'));}return rp(_0xb8a932)[_0x7111('0x22')](function(_0x2725f0){return _0x77b7c6[_0x7111('0x67')](_[_0x7111('0x2f')](_0x2725f0[_0x7111('0x68')][_0x7111('0x69')],function(_0x123d99){return{'id':_0x123d99[_0x7111('0x27')],'name':_0x123d99['name'],'type':_0x123d99[_0x7111('0x2d')],'active':_0x123d99[_0x7111('0x6a')],'label':_0x123d99[_0x7111('0x6b')],'custom':!![]};}));});}})['then'](function(_0x3249de){return{'count':_0x3249de['length'],'rows':_0x3249de};})[_0x7111('0x22')](respondWithResult(_0x9bfd0d,null))[_0x7111('0x41')](function(_0x22d96c){var _0x33ee66=_0x8b20b5[_0x7111('0x30')][_0x7111('0x6c')]?0x1f4:_0x22d96c['statusCode']||0x1f4;logger[_0x7111('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x7111('0x55'),_0x33ee66,JSON[_0x7111('0x6d')](_0x22d96c));delete _0x22d96c[_0x7111('0x27')];if(_0x33ee66===0x191){_0x33ee66=0x190;}_0x9bfd0d['status'](_0x33ee66)[_0x7111('0x28')](_0x8b20b5[_0x7111('0x30')][_0x7111('0x6c')]?{'message':_0x7111('0x6e'),'statusCode':_0x22d96c[_0x7111('0x6f')]}:_0x22d96c);});}; \ No newline at end of file +var _0x0991=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','fields','length','include','find','create','body','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','priority','remoteUri','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','%s:%s','toString','base64','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','DeskAccount','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes'];(function(_0x57545d,_0x1cef9a){var _0x5c85cf=function(_0x5040f8){while(--_0x5040f8){_0x57545d['push'](_0x57545d['shift']());}};_0x5c85cf(++_0x1cef9a);}(_0x0991,0x1a0));var _0x1099=function(_0x208c91,_0x3936bc){_0x208c91=_0x208c91-0x0;var _0x42a304=_0x0991[_0x208c91];return _0x42a304;};'use strict';var emlformat=require(_0x1099('0x0'));var rimraf=require(_0x1099('0x1'));var zipdir=require(_0x1099('0x2'));var jsonpatch=require(_0x1099('0x3'));var rp=require(_0x1099('0x4'));var moment=require(_0x1099('0x5'));var BPromise=require(_0x1099('0x6'));var Mustache=require(_0x1099('0x7'));var util=require(_0x1099('0x8'));var path=require(_0x1099('0x9'));var sox=require('sox');var csv=require(_0x1099('0xa'));var ejs=require(_0x1099('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1099('0xc'));var squel=require(_0x1099('0xd'));var crypto=require(_0x1099('0xe'));var jsforce=require(_0x1099('0xf'));var deskjs=require(_0x1099('0x10'));var toCsv=require(_0x1099('0xa'));var querystring=require(_0x1099('0x11'));var Papa=require(_0x1099('0x12'));var Redis=require(_0x1099('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1099('0x14'));var as=require(_0x1099('0x15'));var hardwareService=require(_0x1099('0x16'));var logger=require('../../config/logger')(_0x1099('0x17'));var utils=require(_0x1099('0x18'));var config=require(_0x1099('0x19'));var licenseUtil=require(_0x1099('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1099('0x1b'));function respondWithStatusCode(_0x26357b,_0x3a11a2){_0x3a11a2=_0x3a11a2||0xcc;return function(_0x2f7948){if(_0x2f7948){return _0x26357b[_0x1099('0x1c')](_0x3a11a2);}return _0x26357b[_0x1099('0x1d')](_0x3a11a2)[_0x1099('0x1e')]();};}function respondWithResult(_0xfb2560,_0x338a43){_0x338a43=_0x338a43||0xc8;return function(_0x26eb90){if(_0x26eb90){return _0xfb2560[_0x1099('0x1d')](_0x338a43)['json'](_0x26eb90);}};}function respondWithFilteredResult(_0xcd3814,_0x853d6d){return function(_0x3b8506){if(_0x3b8506){var _0x43d278=typeof _0x853d6d['offset']===_0x1099('0x1f')&&typeof _0x853d6d['limit']===_0x1099('0x1f');var _0x25ca3d=_0x3b8506[_0x1099('0x20')];var _0x5f07bd=_0x43d278?0x0:_0x853d6d['offset'];var _0x21e41c=_0x43d278?_0x3b8506[_0x1099('0x20')]:_0x853d6d[_0x1099('0x21')]+_0x853d6d['limit'];var _0xdc4fa5;if(_0x21e41c>=_0x25ca3d){_0x21e41c=_0x25ca3d;_0xdc4fa5=0xc8;}else{_0xdc4fa5=0xce;}_0xcd3814['status'](_0xdc4fa5);return _0xcd3814[_0x1099('0x22')](_0x1099('0x23'),_0x5f07bd+'-'+_0x21e41c+'/'+_0x25ca3d)['json'](_0x3b8506);}return null;};}function patchUpdates(_0x10fc76){return function(_0x38ce0f){try{jsonpatch[_0x1099('0x24')](_0x38ce0f,_0x10fc76,!![]);}catch(_0x3e0559){return BPromise[_0x1099('0x25')](_0x3e0559);}return _0x38ce0f[_0x1099('0x26')]();};}function saveUpdates(_0x80292,_0x53058b){return function(_0xe85282){if(_0xe85282){return _0xe85282[_0x1099('0x27')](_0x80292)[_0x1099('0x28')](function(_0x254588){return _0x254588;});}return null;};}function removeEntity(_0xd95ff4,_0xa62953){return function(_0x4c6740){if(_0x4c6740){return _0x4c6740[_0x1099('0x29')]()['then'](function(){_0xd95ff4[_0x1099('0x1d')](0xcc)[_0x1099('0x1e')]();});}};}function handleEntityNotFound(_0x3808b5,_0x44fb89){return function(_0x393426){if(!_0x393426){_0x3808b5['sendStatus'](0x194);}return _0x393426;};}function handleError(_0x19bda2,_0x41fca0){_0x41fca0=_0x41fca0||0x1f4;return function(_0x1f3567){logger[_0x1099('0x2a')](_0x1f3567['stack']);if(_0x1f3567['name']){delete _0x1f3567[_0x1099('0x2b')];}_0x19bda2[_0x1099('0x1d')](_0x41fca0)['send'](_0x1f3567);};}exports[_0x1099('0x2c')]=function(_0x202951,_0x11c6cf){var _0x52935c={},_0x201a1c={},_0x357662={'count':0x0,'rows':[]};var _0x264716=_['map'](db[_0x1099('0x2d')][_0x1099('0x2e')],function(_0xf922b4){return{'name':_0xf922b4[_0x1099('0x2f')],'type':_0xf922b4[_0x1099('0x30')]['key']};});_0x201a1c[_0x1099('0x31')]=_[_0x1099('0x32')](_0x264716,_0x1099('0x2b'));_0x201a1c['query']=_[_0x1099('0x33')](_0x202951['query']);_0x201a1c[_0x1099('0x34')]=_[_0x1099('0x35')](_0x201a1c[_0x1099('0x31')],_0x201a1c[_0x1099('0x36')]);_0x52935c[_0x1099('0x37')]=_['intersection'](_0x201a1c[_0x1099('0x31')],qs['fields'](_0x202951[_0x1099('0x36')]['fields']));_0x52935c[_0x1099('0x37')]=_0x52935c[_0x1099('0x37')]['length']?_0x52935c[_0x1099('0x37')]:_0x201a1c[_0x1099('0x31')];if(!_0x202951[_0x1099('0x36')][_0x1099('0x38')](_0x1099('0x39'))){_0x52935c[_0x1099('0x3a')]=qs[_0x1099('0x3a')](_0x202951[_0x1099('0x36')][_0x1099('0x3a')]);_0x52935c[_0x1099('0x21')]=qs[_0x1099('0x21')](_0x202951['query'][_0x1099('0x21')]);}_0x52935c[_0x1099('0x3b')]=qs[_0x1099('0x3c')](_0x202951[_0x1099('0x36')]['sort']);_0x52935c[_0x1099('0x3d')]=qs[_0x1099('0x34')](_[_0x1099('0x3e')](_0x202951[_0x1099('0x36')],_0x201a1c[_0x1099('0x34')]),_0x264716);if(_0x202951[_0x1099('0x36')][_0x1099('0x3f')]){_0x52935c['where']=_[_0x1099('0x40')](_0x52935c[_0x1099('0x3d')],{'$or':_[_0x1099('0x32')](_0x264716,function(_0x5d81e8){if(_0x5d81e8[_0x1099('0x30')]!==_0x1099('0x41')){var _0x41a99a={};_0x41a99a[_0x5d81e8[_0x1099('0x2b')]]={'$like':'%'+_0x202951[_0x1099('0x36')][_0x1099('0x3f')]+'%'};return _0x41a99a;}})});}_0x52935c=_[_0x1099('0x40')]({},_0x52935c,_0x202951[_0x1099('0x42')]);var _0x5ee708={'where':_0x52935c[_0x1099('0x3d')]};return db[_0x1099('0x2d')][_0x1099('0x20')](_0x5ee708)['then'](function(_0x41f8e4){_0x357662[_0x1099('0x20')]=_0x41f8e4;if(_0x202951[_0x1099('0x36')]['includeAll']){_0x52935c['include']=[{'all':!![]}];}return db['DeskAccount'][_0x1099('0x43')](_0x52935c);})[_0x1099('0x28')](function(_0xd9d658){_0x357662[_0x1099('0x44')]=_0xd9d658;return _0x357662;})[_0x1099('0x28')](respondWithFilteredResult(_0x11c6cf,_0x52935c))[_0x1099('0x45')](handleError(_0x11c6cf,null));};exports['show']=function(_0x3511ac,_0x10e04f){var _0x45e4a1={'raw':![],'where':{'id':_0x3511ac[_0x1099('0x46')]['id']}},_0x214586={};_0x214586[_0x1099('0x31')]=_['keys'](db[_0x1099('0x2d')][_0x1099('0x2e')]);_0x214586[_0x1099('0x36')]=_[_0x1099('0x33')](_0x3511ac[_0x1099('0x36')]);_0x214586[_0x1099('0x34')]=_[_0x1099('0x35')](_0x214586[_0x1099('0x31')],_0x214586[_0x1099('0x36')]);_0x45e4a1[_0x1099('0x37')]=_[_0x1099('0x35')](_0x214586[_0x1099('0x31')],qs['fields'](_0x3511ac[_0x1099('0x36')][_0x1099('0x47')]));_0x45e4a1[_0x1099('0x37')]=_0x45e4a1[_0x1099('0x37')][_0x1099('0x48')]?_0x45e4a1[_0x1099('0x37')]:_0x214586[_0x1099('0x31')];if(_0x3511ac[_0x1099('0x36')]['includeAll']){_0x45e4a1[_0x1099('0x49')]=[{'all':!![]}];}_0x45e4a1=_['merge']({},_0x45e4a1,_0x3511ac[_0x1099('0x42')]);return db['DeskAccount'][_0x1099('0x4a')](_0x45e4a1)['then'](handleEntityNotFound(_0x10e04f,null))[_0x1099('0x28')](respondWithResult(_0x10e04f,null))[_0x1099('0x45')](handleError(_0x10e04f,null));};exports[_0x1099('0x4b')]=function(_0x2ae642,_0x4d30d0){return db[_0x1099('0x2d')][_0x1099('0x4b')](_0x2ae642[_0x1099('0x4c')],{})[_0x1099('0x28')](respondWithResult(_0x4d30d0,0xc9))['catch'](handleError(_0x4d30d0,null));};exports[_0x1099('0x27')]=function(_0x6b5417,_0x244873){if(_0x6b5417['body']['id']){delete _0x6b5417[_0x1099('0x4c')]['id'];}return db[_0x1099('0x2d')]['find']({'where':{'id':_0x6b5417[_0x1099('0x46')]['id']}})[_0x1099('0x28')](handleEntityNotFound(_0x244873,null))['then'](saveUpdates(_0x6b5417['body'],null))[_0x1099('0x28')](respondWithResult(_0x244873,null))[_0x1099('0x45')](handleError(_0x244873,null));};exports[_0x1099('0x29')]=function(_0x3bbbc6,_0x3e3fbb){return db[_0x1099('0x2d')]['find']({'where':{'id':_0x3bbbc6[_0x1099('0x46')]['id']}})[_0x1099('0x28')](handleEntityNotFound(_0x3e3fbb,null))['then'](removeEntity(_0x3e3fbb,null))[_0x1099('0x45')](handleError(_0x3e3fbb,null));};exports[_0x1099('0x4d')]=function(_0x214329,_0x4729c9,_0x372eb5){var _0x520f47={};var _0x10c6b3={};var _0x14a261;var _0x445543;return db[_0x1099('0x2d')]['findOne']({'where':{'id':_0x214329['params']['id']}})['then'](handleEntityNotFound(_0x4729c9,null))[_0x1099('0x28')](function(_0x4ac399){if(_0x4ac399){_0x14a261=_0x4ac399;_0x10c6b3['model']=_[_0x1099('0x33')](db[_0x1099('0x4e')]['rawAttributes']);_0x10c6b3['query']=_[_0x1099('0x33')](_0x214329[_0x1099('0x36')]);_0x10c6b3[_0x1099('0x34')]=_[_0x1099('0x35')](_0x10c6b3[_0x1099('0x31')],_0x10c6b3[_0x1099('0x36')]);_0x520f47[_0x1099('0x37')]=_['intersection'](_0x10c6b3['model'],qs[_0x1099('0x47')](_0x214329['query'][_0x1099('0x47')]));_0x520f47['attributes']=_0x520f47[_0x1099('0x37')][_0x1099('0x48')]?_0x520f47[_0x1099('0x37')]:_0x10c6b3['model'];_0x520f47[_0x1099('0x3b')]=qs['sort'](_0x214329[_0x1099('0x36')][_0x1099('0x3c')]);_0x520f47[_0x1099('0x3d')]=qs[_0x1099('0x34')](_[_0x1099('0x3e')](_0x214329[_0x1099('0x36')],_0x10c6b3[_0x1099('0x34')]));if(_0x214329[_0x1099('0x36')][_0x1099('0x3f')]){_0x520f47[_0x1099('0x3d')]=_['merge'](_0x520f47['where'],{'$or':_[_0x1099('0x32')](_0x520f47['attributes'],function(_0xcc341e){var _0x4c5917={};_0x4c5917[_0xcc341e]={'$like':'%'+_0x214329[_0x1099('0x36')]['filter']+'%'};return _0x4c5917;})});}_0x520f47=_[_0x1099('0x40')]({},_0x520f47,_0x214329[_0x1099('0x42')]);return _0x14a261[_0x1099('0x4d')](_0x520f47);}})[_0x1099('0x28')](function(_0x139b2d){if(_0x139b2d){_0x445543=_0x139b2d[_0x1099('0x48')];if(!_0x214329[_0x1099('0x36')][_0x1099('0x38')](_0x1099('0x39'))){_0x520f47['limit']=qs[_0x1099('0x3a')](_0x214329[_0x1099('0x36')][_0x1099('0x3a')]);_0x520f47[_0x1099('0x21')]=qs[_0x1099('0x21')](_0x214329[_0x1099('0x36')][_0x1099('0x21')]);}return _0x14a261[_0x1099('0x4d')](_0x520f47);}})[_0x1099('0x28')](function(_0x278d54){if(_0x278d54){return _0x278d54?{'count':_0x445543,'rows':_0x278d54}:null;}})['then'](respondWithResult(_0x4729c9,null))[_0x1099('0x45')](handleError(_0x4729c9,null));};exports[_0x1099('0x4f')]=function(_0x3e8648,_0x5ae7b3,_0x3aefe7){if(_0x3e8648['body']['id']){delete _0x3e8648[_0x1099('0x4c')]['id'];}return db[_0x1099('0x2d')][_0x1099('0x50')]({'where':{'id':_0x3e8648[_0x1099('0x46')]['id']}})[_0x1099('0x28')](handleEntityNotFound(_0x5ae7b3,null))[_0x1099('0x28')](function(_0x379a85){if(_0x379a85){_0x3e8648[_0x1099('0x4c')][_0x1099('0x51')]=_0x379a85['id'];_0x3e8648[_0x1099('0x4c')][_0x1099('0x52')]=integrations[_0x1099('0x53')](_0x3e8648[_0x1099('0x4c')][_0x1099('0x54')],_0x3e8648[_0x1099('0x4c')][_0x1099('0x30')]);_0x3e8648[_0x1099('0x4c')][_0x1099('0x55')]=integrations[_0x1099('0x56')](_0x3e8648[_0x1099('0x4c')][_0x1099('0x54')],_0x3e8648[_0x1099('0x4c')]['type']);return db['DeskConfiguration'][_0x1099('0x4b')](_0x3e8648[_0x1099('0x4c')],{'include':[{'model':db[_0x1099('0x57')],'as':_0x1099('0x52')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0x1099('0x28')](respondWithResult(_0x5ae7b3,null))[_0x1099('0x45')](handleError(_0x5ae7b3,null));};exports['getFields']=function(_0x554715,_0x4f7dfb,_0x22552d){var _0x15032c=[{'name':_0x1099('0x58'),'label':_0x1099('0x58'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x15cad7='';return db[_0x1099('0x2d')][_0x1099('0x50')]({'where':{'id':_0x554715[_0x1099('0x46')]['id']},'attributes':['id',_0x1099('0x59'),'authType',_0x1099('0x5a'),_0x1099('0x5b'),'consumerKey',_0x1099('0x5c'),_0x1099('0x5d'),_0x1099('0x5e')]})[_0x1099('0x28')](handleEntityNotFound(_0x4f7dfb,null))[_0x1099('0x28')](function(_0x5217fc){if(_0x5217fc){_0x15cad7=_0x5217fc[_0x1099('0x59')];var _0x4685eb=_0x15cad7[_0x1099('0x5f')](-0x1);if(_0x4685eb==='/'){_0x15cad7=_0x15cad7[_0x1099('0x60')](0x0,_0x15cad7[_0x1099('0x61')](_0x4685eb));}var _0x261399={'method':_0x1099('0x62'),'uri':util[_0x1099('0x63')](_0x1099('0x64'),_0x15cad7),'headers':{'Content-Type':'application/json','Accept':_0x1099('0x65')},'json':!![]};if(_0x5217fc[_0x1099('0x66')]===_0x1099('0x67')){_0x261399[_0x1099('0x68')]['Authorization']=util[_0x1099('0x63')]('Basic\x20%s',new Buffer(util[_0x1099('0x63')](_0x1099('0x69'),_0x5217fc[_0x1099('0x5a')],_0x5217fc[_0x1099('0x5b')]))[_0x1099('0x6a')](_0x1099('0x6b')));}return rp(_0x261399)[_0x1099('0x28')](function(_0x41954d){return _0x15032c['concat'](_[_0x1099('0x32')](_0x41954d[_0x1099('0x6c')][_0x1099('0x6d')],function(_0x5b4ae9){return{'id':_0x5b4ae9['name'],'name':_0x5b4ae9[_0x1099('0x2b')],'type':_0x5b4ae9[_0x1099('0x30')],'active':_0x5b4ae9['active'],'label':_0x5b4ae9[_0x1099('0x6e')],'custom':!![]};}));});}})[_0x1099('0x28')](function(_0x231b65){return{'count':_0x231b65['length'],'rows':_0x231b65};})[_0x1099('0x28')](respondWithResult(_0x4f7dfb,null))[_0x1099('0x45')](function(_0x3eee3d){var _0x50af1c=_0x554715[_0x1099('0x36')][_0x1099('0x6f')]?0x1f4:_0x3eee3d[_0x1099('0x70')]||0x1f4;logger[_0x1099('0x2a')](_0x1099('0x71'),_0x1099('0x72'),_0x50af1c,JSON[_0x1099('0x73')](_0x3eee3d));delete _0x3eee3d[_0x1099('0x2b')];if(_0x50af1c===0x191){_0x50af1c=0x190;}_0x4f7dfb[_0x1099('0x1d')](_0x50af1c)[_0x1099('0x74')](_0x554715[_0x1099('0x36')][_0x1099('0x6f')]?{'message':_0x1099('0x75'),'statusCode':_0x3eee3d[_0x1099('0x70')]}:_0x3eee3d);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index abeabcf..8c2e9dd 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 _0x18cd=['request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0x18cd,0x1e9));var _0xd18c=function(_0x515f88,_0x286ee0){_0x515f88=_0x515f88-0x0;var _0x2da645=_0x18cd[_0x515f88];return _0x2da645;};'use strict';var _=require(_0xd18c('0x0'));var util=require(_0xd18c('0x1'));var logger=require(_0xd18c('0x2'))(_0xd18c('0x3'));var moment=require('moment');var BPromise=require(_0xd18c('0x4'));var rp=require(_0xd18c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd18c('0x6'));var config=require(_0xd18c('0x7'));var attributes=require(_0xd18c('0x8'));var integrations=require(_0xd18c('0x9'));module['exports']=function(_0x5250eb,_0x198701){return _0x5250eb[_0xd18c('0xa')](_0xd18c('0xb'),attributes,{'tableName':_0xd18c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb00=['../../config/logger','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define','util'];(function(_0xb604f1,_0x1249ac){var _0x38fd9e=function(_0x2dad10){while(--_0x2dad10){_0xb604f1['push'](_0xb604f1['shift']());}};_0x38fd9e(++_0x1249ac);}(_0xdb00,0x14f));var _0x0db0=function(_0x318f46,_0x3ed5a9){_0x318f46=_0x318f46-0x0;var _0x125f88=_0xdb00[_0x318f46];return _0x125f88;};'use strict';var _=require('lodash');var util=require(_0x0db0('0x0'));var logger=require(_0x0db0('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0db0('0x2'));var rp=require(_0x0db0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0db0('0x4'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x0db0('0x5'));module[_0x0db0('0x6')]=function(_0x489336,_0x272fe5){return _0x489336[_0x0db0('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index fe27913..49d651c 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 _0xb1d9=['then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetDeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb1d9,0x7a));var _0x9b1d=function(_0x1b8a17,_0x29d15e){_0x1b8a17=_0x1b8a17-0x0;var _0x4ad233=_0xb1d9[_0x1b8a17];return _0x4ad233;};'use strict';var _=require(_0x9b1d('0x0'));var util=require(_0x9b1d('0x1'));var moment=require(_0x9b1d('0x2'));var BPromise=require(_0x9b1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b1d('0x4'));var db=require(_0x9b1d('0x5'))['db'];var utils=require(_0x9b1d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9b1d('0x7'));var client=jayson[_0x9b1d('0x8')][_0x9b1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36d16f,_0x12b3e9,_0x1aa273){return new BPromise(function(_0x190c83,_0x1bf34e){return client['request'](_0x36d16f,_0x1aa273)[_0x9b1d('0xa')](function(_0x5b4c4f){logger['info'](_0x9b1d('0xb'),_0x12b3e9,_0x9b1d('0xc'));logger[_0x9b1d('0xd')](_0x9b1d('0xe'),_0x12b3e9,_0x9b1d('0xc'),JSON['stringify'](_0x5b4c4f));if(_0x5b4c4f['error']){if(_0x5b4c4f[_0x9b1d('0xf')][_0x9b1d('0x10')]===0x1f4){logger[_0x9b1d('0xf')](_0x9b1d('0xb'),_0x12b3e9,_0x5b4c4f[_0x9b1d('0xf')][_0x9b1d('0x11')]);return _0x1bf34e(_0x5b4c4f['error']['message']);}logger['error'](_0x9b1d('0xb'),_0x12b3e9,_0x5b4c4f[_0x9b1d('0xf')][_0x9b1d('0x11')]);return _0x190c83(_0x5b4c4f['error'][_0x9b1d('0x11')]);}else{logger[_0x9b1d('0x12')](_0x9b1d('0xb'),_0x12b3e9,_0x9b1d('0xc'));_0x190c83(_0x5b4c4f['result']['message']);}})[_0x9b1d('0x13')](function(_0x402fee){logger[_0x9b1d('0xf')]('DeskAccount,\x20%s,\x20%s',_0x12b3e9,_0x402fee);_0x1bf34e(_0x402fee);});});}exports[_0x9b1d('0x14')]=function(_0x561fd5){var _0x5762ef=this;return new Promise(function(_0xf9c4d7,_0x18bf68){return db['DeskAccount'][_0x9b1d('0x15')]({'raw':_0x561fd5[_0x9b1d('0x16')]?_0x561fd5[_0x9b1d('0x16')][_0x9b1d('0x17')]===undefined?!![]:![]:!![],'where':_0x561fd5[_0x9b1d('0x16')]?_0x561fd5[_0x9b1d('0x16')][_0x9b1d('0x18')]||null:null,'attributes':_0x561fd5['options']?_0x561fd5[_0x9b1d('0x16')]['attributes']||null:null,'limit':_0x561fd5[_0x9b1d('0x16')]?_0x561fd5[_0x9b1d('0x16')][_0x9b1d('0x19')]||null:null,'include':_0x561fd5[_0x9b1d('0x16')]?_0x561fd5[_0x9b1d('0x16')][_0x9b1d('0x1a')]?_[_0x9b1d('0x1b')](_0x561fd5[_0x9b1d('0x16')][_0x9b1d('0x1a')],function(_0x494ef3){return{'model':db[_0x494ef3[_0x9b1d('0x1c')]],'as':_0x494ef3['as'],'attributes':_0x494ef3[_0x9b1d('0x1d')],'include':_0x494ef3[_0x9b1d('0x1a')]?_['map'](_0x494ef3[_0x9b1d('0x1a')],function(_0x458203){return{'model':db[_0x458203[_0x9b1d('0x1c')]],'as':_0x458203['as'],'attributes':_0x458203[_0x9b1d('0x1d')],'include':_0x458203[_0x9b1d('0x1a')]?_[_0x9b1d('0x1b')](_0x458203['include'],function(_0x59f638){return{'model':db[_0x59f638[_0x9b1d('0x1c')]],'as':_0x59f638['as'],'attributes':_0x59f638[_0x9b1d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9b1d('0xa')](function(_0x19e297){logger[_0x9b1d('0x12')]('GetDeskAccount',_0x561fd5);logger['debug'](_0x9b1d('0x14'),_0x561fd5,JSON['stringify'](_0x19e297));_0xf9c4d7(_0x19e297);})[_0x9b1d('0x13')](function(_0x54d435){logger[_0x9b1d('0xf')](_0x9b1d('0x14'),_0x54d435[_0x9b1d('0x11')],_0x561fd5);_0x18bf68(_0x5762ef[_0x9b1d('0xf')](0x1f4,_0x54d435['message']));});});};exports[_0x9b1d('0x1e')]=function(_0x1ae07){var _0x152c14=this;return new Promise(function(_0x416ebd,_0x22d6c9){return db[_0x9b1d('0x1f')][_0x9b1d('0x20')]({'raw':_0x1ae07[_0x9b1d('0x16')]?_0x1ae07[_0x9b1d('0x16')][_0x9b1d('0x17')]===undefined?!![]:![]:!![],'where':_0x1ae07[_0x9b1d('0x16')]?_0x1ae07[_0x9b1d('0x16')]['where']||null:null,'attributes':_0x1ae07[_0x9b1d('0x16')]?_0x1ae07[_0x9b1d('0x16')][_0x9b1d('0x1d')]||null:null,'include':_0x1ae07[_0x9b1d('0x16')]?_0x1ae07[_0x9b1d('0x16')][_0x9b1d('0x1a')]?_[_0x9b1d('0x1b')](_0x1ae07[_0x9b1d('0x16')][_0x9b1d('0x1a')],function(_0x324bca){return{'model':db[_0x324bca[_0x9b1d('0x1c')]],'as':_0x324bca['as'],'attributes':_0x324bca['attributes'],'include':_0x324bca[_0x9b1d('0x1a')]?_['map'](_0x324bca['include'],function(_0x3cbbac){return{'model':db[_0x3cbbac[_0x9b1d('0x1c')]],'as':_0x3cbbac['as'],'attributes':_0x3cbbac[_0x9b1d('0x1d')],'include':_0x3cbbac[_0x9b1d('0x1a')]?_[_0x9b1d('0x1b')](_0x3cbbac['include'],function(_0x454b8a){return{'model':db[_0x454b8a[_0x9b1d('0x1c')]],'as':_0x454b8a['as'],'attributes':_0x454b8a[_0x9b1d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9b1d('0xa')](function(_0x4923db){logger[_0x9b1d('0x12')]('ShowDeskAccount',_0x1ae07);logger[_0x9b1d('0xd')](_0x9b1d('0x1e'),_0x1ae07,JSON['stringify'](_0x4923db));_0x416ebd(_0x4923db);})['catch'](function(_0x35e886){logger[_0x9b1d('0xf')](_0x9b1d('0x1e'),_0x35e886[_0x9b1d('0x11')],_0x1ae07);_0x22d6c9(_0x152c14[_0x9b1d('0xf')](0x1f4,_0x35e886[_0x9b1d('0x11')]));});});}; \ No newline at end of file +var _0x561a=['stringify','error','code','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','model','GetDeskAccount','debug','ShowDeskAccount','find','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x561a,0x89));var _0xa561=function(_0x53e55c,_0x40898b){_0x53e55c=_0x53e55c-0x0;var _0x451802=_0x561a[_0x53e55c];return _0x451802;};'use strict';var _=require(_0xa561('0x0'));var util=require(_0xa561('0x1'));var moment=require(_0xa561('0x2'));var BPromise=require(_0xa561('0x3'));var rs=require(_0xa561('0x4'));var fs=require('fs');var Redis=require(_0xa561('0x5'));var db=require(_0xa561('0x6'))['db'];var utils=require(_0xa561('0x7'));var logger=require(_0xa561('0x8'))(_0xa561('0x9'));var config=require(_0xa561('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa561('0xb')][_0xa561('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22b967,_0x420e88,_0x23af2e){return new BPromise(function(_0x8f3011,_0xe7b553){return client[_0xa561('0xd')](_0x22b967,_0x23af2e)[_0xa561('0xe')](function(_0x18d61f){logger[_0xa561('0xf')](_0xa561('0x10'),_0x420e88,_0xa561('0x11'));logger['debug'](_0xa561('0x12'),_0x420e88,_0xa561('0x11'),JSON[_0xa561('0x13')](_0x18d61f));if(_0x18d61f[_0xa561('0x14')]){if(_0x18d61f[_0xa561('0x14')][_0xa561('0x15')]===0x1f4){logger[_0xa561('0x14')](_0xa561('0x10'),_0x420e88,_0x18d61f[_0xa561('0x14')][_0xa561('0x16')]);return _0xe7b553(_0x18d61f['error'][_0xa561('0x16')]);}logger[_0xa561('0x14')](_0xa561('0x10'),_0x420e88,_0x18d61f['error'][_0xa561('0x16')]);return _0x8f3011(_0x18d61f[_0xa561('0x14')][_0xa561('0x16')]);}else{logger[_0xa561('0xf')]('DeskAccount,\x20%s,\x20%s',_0x420e88,_0xa561('0x11'));_0x8f3011(_0x18d61f[_0xa561('0x17')][_0xa561('0x16')]);}})[_0xa561('0x18')](function(_0x41495b){logger['error'](_0xa561('0x10'),_0x420e88,_0x41495b);_0xe7b553(_0x41495b);});});}exports['GetDeskAccount']=function(_0x332ed1){var _0x21a099=this;return new Promise(function(_0x407583,_0x4127d2){return db[_0xa561('0x19')][_0xa561('0x1a')]({'raw':_0x332ed1[_0xa561('0x1b')]?_0x332ed1[_0xa561('0x1b')][_0xa561('0x1c')]===undefined?!![]:![]:!![],'where':_0x332ed1['options']?_0x332ed1[_0xa561('0x1b')][_0xa561('0x1d')]||null:null,'attributes':_0x332ed1['options']?_0x332ed1[_0xa561('0x1b')][_0xa561('0x1e')]||null:null,'limit':_0x332ed1[_0xa561('0x1b')]?_0x332ed1['options'][_0xa561('0x1f')]||null:null,'include':_0x332ed1[_0xa561('0x1b')]?_0x332ed1[_0xa561('0x1b')][_0xa561('0x20')]?_['map'](_0x332ed1[_0xa561('0x1b')][_0xa561('0x20')],function(_0x51ad73){return{'model':db[_0x51ad73[_0xa561('0x21')]],'as':_0x51ad73['as'],'attributes':_0x51ad73['attributes'],'include':_0x51ad73[_0xa561('0x20')]?_['map'](_0x51ad73[_0xa561('0x20')],function(_0x4119a1){return{'model':db[_0x4119a1[_0xa561('0x21')]],'as':_0x4119a1['as'],'attributes':_0x4119a1[_0xa561('0x1e')],'include':_0x4119a1['include']?_['map'](_0x4119a1['include'],function(_0x527f49){return{'model':db[_0x527f49[_0xa561('0x21')]],'as':_0x527f49['as'],'attributes':_0x527f49[_0xa561('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa561('0xe')](function(_0x292cf7){logger['info'](_0xa561('0x22'),_0x332ed1);logger[_0xa561('0x23')](_0xa561('0x22'),_0x332ed1,JSON[_0xa561('0x13')](_0x292cf7));_0x407583(_0x292cf7);})[_0xa561('0x18')](function(_0x1c0bb4){logger[_0xa561('0x14')]('GetDeskAccount',_0x1c0bb4[_0xa561('0x16')],_0x332ed1);_0x4127d2(_0x21a099['error'](0x1f4,_0x1c0bb4[_0xa561('0x16')]));});});};exports[_0xa561('0x24')]=function(_0x35340e){var _0xfbe1e4=this;return new Promise(function(_0x1ed973,_0x1c7cba){return db[_0xa561('0x19')][_0xa561('0x25')]({'raw':_0x35340e[_0xa561('0x1b')]?_0x35340e[_0xa561('0x1b')][_0xa561('0x1c')]===undefined?!![]:![]:!![],'where':_0x35340e[_0xa561('0x1b')]?_0x35340e['options']['where']||null:null,'attributes':_0x35340e[_0xa561('0x1b')]?_0x35340e[_0xa561('0x1b')][_0xa561('0x1e')]||null:null,'include':_0x35340e['options']?_0x35340e['options'][_0xa561('0x20')]?_[_0xa561('0x26')](_0x35340e[_0xa561('0x1b')]['include'],function(_0x2f80db){return{'model':db[_0x2f80db[_0xa561('0x21')]],'as':_0x2f80db['as'],'attributes':_0x2f80db[_0xa561('0x1e')],'include':_0x2f80db['include']?_[_0xa561('0x26')](_0x2f80db[_0xa561('0x20')],function(_0x5288cc){return{'model':db[_0x5288cc['model']],'as':_0x5288cc['as'],'attributes':_0x5288cc['attributes'],'include':_0x5288cc[_0xa561('0x20')]?_[_0xa561('0x26')](_0x5288cc[_0xa561('0x20')],function(_0x569412){return{'model':db[_0x569412['model']],'as':_0x569412['as'],'attributes':_0x569412[_0xa561('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e2e9){logger[_0xa561('0xf')]('ShowDeskAccount',_0x35340e);logger[_0xa561('0x23')]('ShowDeskAccount',_0x35340e,JSON['stringify'](_0x47e2e9));_0x1ed973(_0x47e2e9);})[_0xa561('0x18')](function(_0x5b54b1){logger[_0xa561('0x14')](_0xa561('0x24'),_0x5b54b1[_0xa561('0x16')],_0x35340e);_0x1c7cba(_0xfbe1e4[_0xa561('0x14')](0x1f4,_0x5b54b1[_0xa561('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index a2cdc2a..d0694b0 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 _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x55ca,0x126));var _0xa55c=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0x55ca[_0x46e523];return _0x5da0ee;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file +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(_0x13fd17,_0x529d58){var _0x245ca7=function(_0x12bbdf){while(--_0x12bbdf){_0x13fd17['push'](_0x13fd17['shift']());}};_0x245ca7(++_0x529d58);}(_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/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 8c08e75..d8f8825 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 _0x6d35=['sequelize'];(function(_0x104c9b,_0x56944d){var _0x39ba4d=function(_0x5d81a1){while(--_0x5d81a1){_0x104c9b['push'](_0x104c9b['shift']());}};_0x39ba4d(++_0x56944d);}(_0x6d35,0x1e9));var _0x56d3=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x6d35[_0x240261];return _0x45c332;};'use strict';var Sequelize=require(_0x56d3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad59=['sequelize','exports','STRING'];(function(_0x42bbe9,_0x599327){var _0x159a36=function(_0x336906){while(--_0x336906){_0x42bbe9['push'](_0x42bbe9['shift']());}};_0x159a36(++_0x599327);}(_0xad59,0x15f));var _0x9ad5=function(_0x28261e,_0x31b3e4){_0x28261e=_0x28261e-0x0;var _0x529264=_0xad59[_0x28261e];return _0x529264;};'use strict';var Sequelize=require(_0x9ad5('0x0'));module[_0x9ad5('0x1')]={'name':{'type':Sequelize[_0x9ad5('0x2')]},'description':{'type':Sequelize[_0x9ad5('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 8ed6d05..365a18c 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 _0x3b5b=['fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','getSubjects','findOne','DeskField','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x46fc39,_0x417b1a){var _0x41ee76=function(_0x28c4db){while(--_0x28c4db){_0x46fc39['push'](_0x46fc39['shift']());}};_0x41ee76(++_0x417b1a);}(_0x3b5b,0xfe));var _0xb3b5=function(_0x57ee1d,_0x54111b){_0x57ee1d=_0x57ee1d-0x0;var _0x12a933=_0x3b5b[_0x57ee1d];return _0x12a933;};'use strict';var emlformat=require(_0xb3b5('0x0'));var rimraf=require(_0xb3b5('0x1'));var zipdir=require(_0xb3b5('0x2'));var jsonpatch=require(_0xb3b5('0x3'));var rp=require(_0xb3b5('0x4'));var moment=require(_0xb3b5('0x5'));var BPromise=require(_0xb3b5('0x6'));var Mustache=require(_0xb3b5('0x7'));var util=require(_0xb3b5('0x8'));var path=require(_0xb3b5('0x9'));var sox=require(_0xb3b5('0xa'));var csv=require(_0xb3b5('0xb'));var ejs=require(_0xb3b5('0xc'));var fs=require('fs');var fs_extra=require(_0xb3b5('0xd'));var _=require(_0xb3b5('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb3b5('0xf'));var deskjs=require(_0xb3b5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb3b5('0x11'));var Papa=require(_0xb3b5('0x12'));var Redis=require(_0xb3b5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb3b5('0x14'));var hardwareService=require(_0xb3b5('0x15'));var logger=require(_0xb3b5('0x16'))(_0xb3b5('0x17'));var utils=require(_0xb3b5('0x18'));var config=require(_0xb3b5('0x19'));var licenseUtil=require(_0xb3b5('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6846b8,_0x3b0352){_0x3b0352=_0x3b0352||0xcc;return function(_0x3b7955){if(_0x3b7955){return _0x6846b8['sendStatus'](_0x3b0352);}return _0x6846b8['status'](_0x3b0352)[_0xb3b5('0x1b')]();};}function respondWithResult(_0x19e936,_0x5dcda6){_0x5dcda6=_0x5dcda6||0xc8;return function(_0x29111a){if(_0x29111a){return _0x19e936[_0xb3b5('0x1c')](_0x5dcda6)[_0xb3b5('0x1d')](_0x29111a);}};}function respondWithFilteredResult(_0x1d3aab,_0x56eb55){return function(_0x367668){if(_0x367668){var _0x4f1f9b=typeof _0x56eb55[_0xb3b5('0x1e')]===_0xb3b5('0x1f')&&typeof _0x56eb55[_0xb3b5('0x20')]===_0xb3b5('0x1f');var _0x998a1e=_0x367668[_0xb3b5('0x21')];var _0x3b31f5=_0x4f1f9b?0x0:_0x56eb55[_0xb3b5('0x1e')];var _0x223617=_0x4f1f9b?_0x367668[_0xb3b5('0x21')]:_0x56eb55['offset']+_0x56eb55['limit'];var _0x354c2f;if(_0x223617>=_0x998a1e){_0x223617=_0x998a1e;_0x354c2f=0xc8;}else{_0x354c2f=0xce;}_0x1d3aab[_0xb3b5('0x1c')](_0x354c2f);return _0x1d3aab['set'](_0xb3b5('0x22'),_0x3b31f5+'-'+_0x223617+'/'+_0x998a1e)[_0xb3b5('0x1d')](_0x367668);}return null;};}function patchUpdates(_0x3f8c3a){return function(_0x87063e){try{jsonpatch['apply'](_0x87063e,_0x3f8c3a,!![]);}catch(_0x1ca045){return BPromise[_0xb3b5('0x23')](_0x1ca045);}return _0x87063e[_0xb3b5('0x24')]();};}function saveUpdates(_0x4150a4,_0x2ae57d){return function(_0x3947a3){if(_0x3947a3){return _0x3947a3[_0xb3b5('0x25')](_0x4150a4)[_0xb3b5('0x26')](function(_0x261c7f){return _0x261c7f;});}return null;};}function removeEntity(_0x1ee256,_0x113501){return function(_0x1ba17a){if(_0x1ba17a){return _0x1ba17a[_0xb3b5('0x27')]()[_0xb3b5('0x26')](function(){_0x1ee256[_0xb3b5('0x1c')](0xcc)[_0xb3b5('0x1b')]();});}};}function handleEntityNotFound(_0x25c1ad,_0x19ffe6){return function(_0x2fc50e){if(!_0x2fc50e){_0x25c1ad[_0xb3b5('0x28')](0x194);}return _0x2fc50e;};}function handleError(_0x4a438d,_0xedb84c){_0xedb84c=_0xedb84c||0x1f4;return function(_0x21bba9){logger[_0xb3b5('0x29')](_0x21bba9[_0xb3b5('0x2a')]);if(_0x21bba9[_0xb3b5('0x2b')]){delete _0x21bba9[_0xb3b5('0x2b')];}_0x4a438d[_0xb3b5('0x1c')](_0xedb84c)[_0xb3b5('0x2c')](_0x21bba9);};}exports[_0xb3b5('0x2d')]=function(_0x1278ad,_0x4c21b6){var _0x3c8218={},_0x5cb907={},_0x4e6e9c={'count':0x0,'rows':[]};var _0x9f32b2=_['map'](db[_0xb3b5('0x2e')][_0xb3b5('0x2f')],function(_0x33fbd6){return{'name':_0x33fbd6[_0xb3b5('0x30')],'type':_0x33fbd6[_0xb3b5('0x31')][_0xb3b5('0x32')]};});_0x5cb907[_0xb3b5('0x33')]=_['map'](_0x9f32b2,_0xb3b5('0x2b'));_0x5cb907[_0xb3b5('0x34')]=_[_0xb3b5('0x35')](_0x1278ad[_0xb3b5('0x34')]);_0x5cb907[_0xb3b5('0x36')]=_[_0xb3b5('0x37')](_0x5cb907[_0xb3b5('0x33')],_0x5cb907[_0xb3b5('0x34')]);_0x3c8218['attributes']=_[_0xb3b5('0x37')](_0x5cb907['model'],qs['fields'](_0x1278ad[_0xb3b5('0x34')][_0xb3b5('0x38')]));_0x3c8218[_0xb3b5('0x39')]=_0x3c8218['attributes']['length']?_0x3c8218['attributes']:_0x5cb907[_0xb3b5('0x33')];if(!_0x1278ad['query'][_0xb3b5('0x3a')](_0xb3b5('0x3b'))){_0x3c8218[_0xb3b5('0x20')]=qs[_0xb3b5('0x20')](_0x1278ad['query']['limit']);_0x3c8218['offset']=qs['offset'](_0x1278ad[_0xb3b5('0x34')][_0xb3b5('0x1e')]);}_0x3c8218[_0xb3b5('0x3c')]=qs['sort'](_0x1278ad[_0xb3b5('0x34')][_0xb3b5('0x3d')]);_0x3c8218[_0xb3b5('0x3e')]=qs[_0xb3b5('0x36')](_['pick'](_0x1278ad[_0xb3b5('0x34')],_0x5cb907[_0xb3b5('0x36')]),_0x9f32b2);if(_0x1278ad['query'][_0xb3b5('0x3f')]){_0x3c8218[_0xb3b5('0x3e')]=_['merge'](_0x3c8218[_0xb3b5('0x3e')],{'$or':_[_0xb3b5('0x40')](_0x9f32b2,function(_0x5eb21a){if(_0x5eb21a[_0xb3b5('0x31')]!==_0xb3b5('0x41')){var _0x4739dd={};_0x4739dd[_0x5eb21a[_0xb3b5('0x2b')]]={'$like':'%'+_0x1278ad[_0xb3b5('0x34')][_0xb3b5('0x3f')]+'%'};return _0x4739dd;}})});}_0x3c8218=_[_0xb3b5('0x42')]({},_0x3c8218,_0x1278ad[_0xb3b5('0x43')]);var _0x3d96d9={'where':_0x3c8218[_0xb3b5('0x3e')]};return db[_0xb3b5('0x2e')][_0xb3b5('0x21')](_0x3d96d9)[_0xb3b5('0x26')](function(_0x2b2d2c){_0x4e6e9c[_0xb3b5('0x21')]=_0x2b2d2c;if(_0x1278ad[_0xb3b5('0x34')][_0xb3b5('0x44')]){_0x3c8218[_0xb3b5('0x45')]=[{'all':!![]}];}return db[_0xb3b5('0x2e')][_0xb3b5('0x46')](_0x3c8218);})[_0xb3b5('0x26')](function(_0x28be09){_0x4e6e9c[_0xb3b5('0x47')]=_0x28be09;return _0x4e6e9c;})[_0xb3b5('0x26')](respondWithFilteredResult(_0x4c21b6,_0x3c8218))[_0xb3b5('0x48')](handleError(_0x4c21b6,null));};exports[_0xb3b5('0x49')]=function(_0x869cc1,_0x1d41f6){var _0x4380b2={'raw':![],'where':{'id':_0x869cc1[_0xb3b5('0x4a')]['id']}},_0x9c1ec={};_0x9c1ec[_0xb3b5('0x33')]=_[_0xb3b5('0x35')](db['DeskConfiguration'][_0xb3b5('0x2f')]);_0x9c1ec[_0xb3b5('0x34')]=_[_0xb3b5('0x35')](_0x869cc1[_0xb3b5('0x34')]);_0x9c1ec[_0xb3b5('0x36')]=_['intersection'](_0x9c1ec[_0xb3b5('0x33')],_0x9c1ec['query']);_0x4380b2[_0xb3b5('0x39')]=_[_0xb3b5('0x37')](_0x9c1ec['model'],qs['fields'](_0x869cc1[_0xb3b5('0x34')][_0xb3b5('0x38')]));_0x4380b2[_0xb3b5('0x39')]=_0x4380b2['attributes'][_0xb3b5('0x4b')]?_0x4380b2[_0xb3b5('0x39')]:_0x9c1ec[_0xb3b5('0x33')];if(_0x869cc1[_0xb3b5('0x34')][_0xb3b5('0x44')]){_0x4380b2[_0xb3b5('0x45')]=[{'all':!![]}];}_0x4380b2=_['merge']({},_0x4380b2,_0x869cc1[_0xb3b5('0x43')]);return db['DeskConfiguration'][_0xb3b5('0x4c')](_0x4380b2)[_0xb3b5('0x26')](handleEntityNotFound(_0x1d41f6,null))[_0xb3b5('0x26')](respondWithResult(_0x1d41f6,null))[_0xb3b5('0x48')](handleError(_0x1d41f6,null));};exports[_0xb3b5('0x4d')]=function(_0x37fb7e,_0x22ca6d){return db[_0xb3b5('0x2e')]['create'](_0x37fb7e['body'],{})[_0xb3b5('0x26')](respondWithResult(_0x22ca6d,0xc9))[_0xb3b5('0x48')](handleError(_0x22ca6d,null));};exports[_0xb3b5('0x25')]=function(_0x4b479f,_0x14310e){if(_0x4b479f['body']['id']){delete _0x4b479f[_0xb3b5('0x4e')]['id'];}return db[_0xb3b5('0x2e')][_0xb3b5('0x4c')]({'where':{'id':_0x4b479f[_0xb3b5('0x4a')]['id']}})[_0xb3b5('0x26')](handleEntityNotFound(_0x14310e,null))['then'](saveUpdates(_0x4b479f[_0xb3b5('0x4e')],null))[_0xb3b5('0x26')](respondWithResult(_0x14310e,null))[_0xb3b5('0x48')](handleError(_0x14310e,null));};exports[_0xb3b5('0x27')]=function(_0x45fc37,_0x9fb1d9){return db['DeskConfiguration'][_0xb3b5('0x4c')]({'where':{'id':_0x45fc37[_0xb3b5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9fb1d9,null))['then'](removeEntity(_0x9fb1d9,null))[_0xb3b5('0x48')](handleError(_0x9fb1d9,null));};exports[_0xb3b5('0x4f')]=function(_0x599cdc,_0x30c333,_0x5ce279){var _0x273be6={};var _0x2131c4={};var _0x14ac0a;var _0x40c4c8;return db[_0xb3b5('0x2e')]['findOne']({'where':{'id':_0x599cdc[_0xb3b5('0x4a')]['id']}})[_0xb3b5('0x26')](handleEntityNotFound(_0x30c333,null))['then'](function(_0x4c8dcd){if(_0x4c8dcd){_0x14ac0a=_0x4c8dcd;_0x2131c4[_0xb3b5('0x33')]=_[_0xb3b5('0x35')](db['DeskField'][_0xb3b5('0x2f')]);_0x2131c4['query']=_[_0xb3b5('0x35')](_0x599cdc[_0xb3b5('0x34')]);_0x2131c4[_0xb3b5('0x36')]=_['intersection'](_0x2131c4['model'],_0x2131c4['query']);_0x273be6[_0xb3b5('0x39')]=_[_0xb3b5('0x37')](_0x2131c4[_0xb3b5('0x33')],qs[_0xb3b5('0x38')](_0x599cdc[_0xb3b5('0x34')][_0xb3b5('0x38')]));_0x273be6[_0xb3b5('0x39')]=_0x273be6[_0xb3b5('0x39')][_0xb3b5('0x4b')]?_0x273be6[_0xb3b5('0x39')]:_0x2131c4[_0xb3b5('0x33')];_0x273be6['order']=qs[_0xb3b5('0x3d')](_0x599cdc[_0xb3b5('0x34')][_0xb3b5('0x3d')]);_0x273be6[_0xb3b5('0x3e')]=qs[_0xb3b5('0x36')](_['pick'](_0x599cdc['query'],_0x2131c4[_0xb3b5('0x36')]));if(_0x599cdc[_0xb3b5('0x34')]['filter']){_0x273be6['where']=_[_0xb3b5('0x42')](_0x273be6[_0xb3b5('0x3e')],{'$or':_[_0xb3b5('0x40')](_0x273be6[_0xb3b5('0x39')],function(_0x352c61){var _0x1e5f4e={};_0x1e5f4e[_0x352c61]={'$like':'%'+_0x599cdc['query'][_0xb3b5('0x3f')]+'%'};return _0x1e5f4e;})});}_0x273be6=_[_0xb3b5('0x42')]({},_0x273be6,_0x599cdc['options']);return _0x14ac0a[_0xb3b5('0x4f')](_0x273be6);}})[_0xb3b5('0x26')](function(_0x5077ab){if(_0x5077ab){_0x40c4c8=_0x5077ab['length'];if(!_0x599cdc[_0xb3b5('0x34')][_0xb3b5('0x3a')](_0xb3b5('0x3b'))){_0x273be6[_0xb3b5('0x20')]=qs['limit'](_0x599cdc[_0xb3b5('0x34')][_0xb3b5('0x20')]);_0x273be6[_0xb3b5('0x1e')]=qs[_0xb3b5('0x1e')](_0x599cdc['query'][_0xb3b5('0x1e')]);}return _0x14ac0a[_0xb3b5('0x4f')](_0x273be6);}})['then'](function(_0x2e477f){if(_0x2e477f){return _0x2e477f?{'count':_0x40c4c8,'rows':_0x2e477f}:null;}})[_0xb3b5('0x26')](respondWithResult(_0x30c333,null))[_0xb3b5('0x48')](handleError(_0x30c333,null));};exports[_0xb3b5('0x50')]=function(_0x7c1832,_0x357590,_0x542ebf){var _0x4930f6={};var _0x54c2ea={};var _0x4aefac;var _0x5182c1;return db['DeskConfiguration'][_0xb3b5('0x51')]({'where':{'id':_0x7c1832[_0xb3b5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x357590,null))['then'](function(_0x50f569){if(_0x50f569){_0x4aefac=_0x50f569;_0x54c2ea[_0xb3b5('0x33')]=_['keys'](db[_0xb3b5('0x52')][_0xb3b5('0x2f')]);_0x54c2ea[_0xb3b5('0x34')]=_[_0xb3b5('0x35')](_0x7c1832[_0xb3b5('0x34')]);_0x54c2ea[_0xb3b5('0x36')]=_['intersection'](_0x54c2ea['model'],_0x54c2ea['query']);_0x4930f6[_0xb3b5('0x39')]=_[_0xb3b5('0x37')](_0x54c2ea[_0xb3b5('0x33')],qs[_0xb3b5('0x38')](_0x7c1832[_0xb3b5('0x34')]['fields']));_0x4930f6['attributes']=_0x4930f6[_0xb3b5('0x39')][_0xb3b5('0x4b')]?_0x4930f6[_0xb3b5('0x39')]:_0x54c2ea[_0xb3b5('0x33')];_0x4930f6[_0xb3b5('0x3c')]=qs[_0xb3b5('0x3d')](_0x7c1832['query']['sort']);_0x4930f6[_0xb3b5('0x3e')]=qs['filters'](_[_0xb3b5('0x53')](_0x7c1832['query'],_0x54c2ea['filters']));if(_0x7c1832[_0xb3b5('0x34')]['filter']){_0x4930f6[_0xb3b5('0x3e')]=_[_0xb3b5('0x42')](_0x4930f6[_0xb3b5('0x3e')],{'$or':_['map'](_0x4930f6[_0xb3b5('0x39')],function(_0x2b2a22){var _0x5131ac={};_0x5131ac[_0x2b2a22]={'$like':'%'+_0x7c1832[_0xb3b5('0x34')]['filter']+'%'};return _0x5131ac;})});}_0x4930f6=_[_0xb3b5('0x42')]({},_0x4930f6,_0x7c1832[_0xb3b5('0x43')]);return _0x4aefac['getSubjects'](_0x4930f6);}})[_0xb3b5('0x26')](function(_0x170500){if(_0x170500){_0x5182c1=_0x170500[_0xb3b5('0x4b')];if(!_0x7c1832[_0xb3b5('0x34')][_0xb3b5('0x3a')](_0xb3b5('0x3b'))){_0x4930f6['limit']=qs[_0xb3b5('0x20')](_0x7c1832[_0xb3b5('0x34')][_0xb3b5('0x20')]);_0x4930f6['offset']=qs['offset'](_0x7c1832[_0xb3b5('0x34')][_0xb3b5('0x1e')]);}return _0x4aefac[_0xb3b5('0x50')](_0x4930f6);}})[_0xb3b5('0x26')](function(_0x6b4601){if(_0x6b4601){return _0x6b4601?{'count':_0x5182c1,'rows':_0x6b4601}:null;}})[_0xb3b5('0x26')](respondWithResult(_0x357590,null))['catch'](handleError(_0x357590,null));};exports[_0xb3b5('0x54')]=function(_0x2bdd83,_0x31a02c,_0x2178cf){var _0x3ee2f2={};var _0x530589={};var _0x58d7f8;var _0x4dc6f6;return db[_0xb3b5('0x2e')][_0xb3b5('0x51')]({'where':{'id':_0x2bdd83['params']['id']}})[_0xb3b5('0x26')](handleEntityNotFound(_0x31a02c,null))['then'](function(_0x4ad83b){if(_0x4ad83b){_0x58d7f8=_0x4ad83b;_0x530589[_0xb3b5('0x33')]=_[_0xb3b5('0x35')](db[_0xb3b5('0x52')][_0xb3b5('0x2f')]);_0x530589[_0xb3b5('0x34')]=_[_0xb3b5('0x35')](_0x2bdd83[_0xb3b5('0x34')]);_0x530589[_0xb3b5('0x36')]=_['intersection'](_0x530589[_0xb3b5('0x33')],_0x530589[_0xb3b5('0x34')]);_0x3ee2f2['attributes']=_[_0xb3b5('0x37')](_0x530589[_0xb3b5('0x33')],qs[_0xb3b5('0x38')](_0x2bdd83['query'][_0xb3b5('0x38')]));_0x3ee2f2['attributes']=_0x3ee2f2[_0xb3b5('0x39')]['length']?_0x3ee2f2[_0xb3b5('0x39')]:_0x530589[_0xb3b5('0x33')];_0x3ee2f2['order']=qs[_0xb3b5('0x3d')](_0x2bdd83[_0xb3b5('0x34')][_0xb3b5('0x3d')]);_0x3ee2f2[_0xb3b5('0x3e')]=qs[_0xb3b5('0x36')](_['pick'](_0x2bdd83[_0xb3b5('0x34')],_0x530589['filters']));if(_0x2bdd83['query'][_0xb3b5('0x3f')]){_0x3ee2f2[_0xb3b5('0x3e')]=_[_0xb3b5('0x42')](_0x3ee2f2[_0xb3b5('0x3e')],{'$or':_['map'](_0x3ee2f2['attributes'],function(_0x4e8a9d){var _0xfb9e25={};_0xfb9e25[_0x4e8a9d]={'$like':'%'+_0x2bdd83[_0xb3b5('0x34')][_0xb3b5('0x3f')]+'%'};return _0xfb9e25;})});}_0x3ee2f2=_[_0xb3b5('0x42')]({},_0x3ee2f2,_0x2bdd83[_0xb3b5('0x43')]);return _0x58d7f8[_0xb3b5('0x54')](_0x3ee2f2);}})['then'](function(_0x389f41){if(_0x389f41){_0x4dc6f6=_0x389f41['length'];if(!_0x2bdd83[_0xb3b5('0x34')][_0xb3b5('0x3a')]('nolimit')){_0x3ee2f2[_0xb3b5('0x20')]=qs[_0xb3b5('0x20')](_0x2bdd83[_0xb3b5('0x34')][_0xb3b5('0x20')]);_0x3ee2f2[_0xb3b5('0x1e')]=qs[_0xb3b5('0x1e')](_0x2bdd83[_0xb3b5('0x34')][_0xb3b5('0x1e')]);}return _0x58d7f8[_0xb3b5('0x54')](_0x3ee2f2);}})[_0xb3b5('0x26')](function(_0x32476f){if(_0x32476f){return _0x32476f?{'count':_0x4dc6f6,'rows':_0x32476f}:null;}})[_0xb3b5('0x26')](respondWithResult(_0x31a02c,null))['catch'](handleError(_0x31a02c,null));};exports[_0xb3b5('0x55')]=function(_0x3c499b,_0x3e24b5,_0xdbc7eb){var _0xf4aad5={};var _0x137bba={};var _0x492352;var _0x5abc5a;return db[_0xb3b5('0x2e')]['findOne']({'where':{'id':_0x3c499b['params']['id']}})['then'](handleEntityNotFound(_0x3e24b5,null))[_0xb3b5('0x26')](function(_0x3c4394){if(_0x3c4394){_0x492352=_0x3c4394;_0x137bba[_0xb3b5('0x33')]=_['keys'](db[_0xb3b5('0x56')][_0xb3b5('0x2f')]);_0x137bba['query']=_[_0xb3b5('0x35')](_0x3c499b['query']);_0x137bba['filters']=_[_0xb3b5('0x37')](_0x137bba[_0xb3b5('0x33')],_0x137bba['query']);_0xf4aad5['attributes']=_[_0xb3b5('0x37')](_0x137bba[_0xb3b5('0x33')],qs[_0xb3b5('0x38')](_0x3c499b['query']['fields']));_0xf4aad5[_0xb3b5('0x39')]=_0xf4aad5[_0xb3b5('0x39')][_0xb3b5('0x4b')]?_0xf4aad5[_0xb3b5('0x39')]:_0x137bba[_0xb3b5('0x33')];_0xf4aad5[_0xb3b5('0x3c')]=qs['sort'](_0x3c499b[_0xb3b5('0x34')][_0xb3b5('0x3d')]);_0xf4aad5['where']=qs[_0xb3b5('0x36')](_[_0xb3b5('0x53')](_0x3c499b[_0xb3b5('0x34')],_0x137bba[_0xb3b5('0x36')]));if(_0x3c499b[_0xb3b5('0x34')]['filter']){_0xf4aad5[_0xb3b5('0x3e')]=_[_0xb3b5('0x42')](_0xf4aad5[_0xb3b5('0x3e')],{'$or':_['map'](_0xf4aad5[_0xb3b5('0x39')],function(_0xfcc601){var _0x498f91={};_0x498f91[_0xfcc601]={'$like':'%'+_0x3c499b[_0xb3b5('0x34')][_0xb3b5('0x3f')]+'%'};return _0x498f91;})});}_0xf4aad5=_[_0xb3b5('0x42')]({},_0xf4aad5,_0x3c499b[_0xb3b5('0x43')]);return _0x492352[_0xb3b5('0x55')](_0xf4aad5);}})[_0xb3b5('0x26')](function(_0x12742d){if(_0x12742d){_0x5abc5a=_0x12742d[_0xb3b5('0x4b')];if(!_0x3c499b[_0xb3b5('0x34')][_0xb3b5('0x3a')](_0xb3b5('0x3b'))){_0xf4aad5[_0xb3b5('0x20')]=qs[_0xb3b5('0x20')](_0x3c499b[_0xb3b5('0x34')][_0xb3b5('0x20')]);_0xf4aad5[_0xb3b5('0x1e')]=qs['offset'](_0x3c499b['query'][_0xb3b5('0x1e')]);}return _0x492352[_0xb3b5('0x55')](_0xf4aad5);}})[_0xb3b5('0x26')](function(_0xe0568f){if(_0xe0568f){return _0xe0568f?{'count':_0x5abc5a,'rows':_0xe0568f}:null;}})[_0xb3b5('0x26')](respondWithResult(_0x3e24b5,null))[_0xb3b5('0x48')](handleError(_0x3e24b5,null));};exports['setTags']=function(_0x32bbd7,_0x4d2e93,_0x4a5862){if(_0x32bbd7[_0xb3b5('0x4e')]['id']){delete _0x32bbd7[_0xb3b5('0x4e')]['id'];}return db[_0xb3b5('0x2e')][_0xb3b5('0x51')]({'where':{'id':_0x32bbd7['params']['id']}})['then'](handleEntityNotFound(_0x4d2e93,null))[_0xb3b5('0x26')](function(_0x5a9629){if(_0x5a9629){return _0x5a9629[_0xb3b5('0x57')](_0x32bbd7[_0xb3b5('0x4e')][_0xb3b5('0x58')]||[]);}return null;})['then'](respondWithResult(_0x4d2e93,null))[_0xb3b5('0x48')](handleError(_0x4d2e93,null));}; \ No newline at end of file +var _0x8e53=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','DeskConfiguration','findAll','rows','catch','includeAll','find','create','body','params','destroy','findOne','DeskField','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection'];(function(_0x1fa334,_0x57c7f1){var _0x57729f=function(_0x5964b9){while(--_0x5964b9){_0x1fa334['push'](_0x1fa334['shift']());}};_0x57729f(++_0x57c7f1);}(_0x8e53,0x73));var _0x38e5=function(_0x4ad9a2,_0x594d5a){_0x4ad9a2=_0x4ad9a2-0x0;var _0x24aefd=_0x8e53[_0x4ad9a2];return _0x24aefd;};'use strict';var emlformat=require(_0x38e5('0x0'));var rimraf=require(_0x38e5('0x1'));var zipdir=require(_0x38e5('0x2'));var jsonpatch=require(_0x38e5('0x3'));var rp=require('request-promise');var moment=require(_0x38e5('0x4'));var BPromise=require(_0x38e5('0x5'));var Mustache=require(_0x38e5('0x6'));var util=require('util');var path=require('path');var sox=require(_0x38e5('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38e5('0x8'));var _=require(_0x38e5('0x9'));var squel=require(_0x38e5('0xa'));var crypto=require(_0x38e5('0xb'));var jsforce=require(_0x38e5('0xc'));var deskjs=require(_0x38e5('0xd'));var toCsv=require(_0x38e5('0xe'));var querystring=require(_0x38e5('0xf'));var Papa=require(_0x38e5('0x10'));var Redis=require('ioredis');var authService=require(_0x38e5('0x11'));var qs=require(_0x38e5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e5('0x13'));var logger=require(_0x38e5('0x14'))('api');var utils=require(_0x38e5('0x15'));var config=require(_0x38e5('0x16'));var licenseUtil=require(_0x38e5('0x17'));var db=require(_0x38e5('0x18'))['db'];function respondWithStatusCode(_0xe8cd27,_0x4ef2b5){_0x4ef2b5=_0x4ef2b5||0xcc;return function(_0x567d78){if(_0x567d78){return _0xe8cd27['sendStatus'](_0x4ef2b5);}return _0xe8cd27[_0x38e5('0x19')](_0x4ef2b5)['end']();};}function respondWithResult(_0xe44307,_0x3f0392){_0x3f0392=_0x3f0392||0xc8;return function(_0x5903b3){if(_0x5903b3){return _0xe44307[_0x38e5('0x19')](_0x3f0392)[_0x38e5('0x1a')](_0x5903b3);}};}function respondWithFilteredResult(_0x306f82,_0x2120a5){return function(_0x7b6344){if(_0x7b6344){var _0x1efef1=typeof _0x2120a5[_0x38e5('0x1b')]===_0x38e5('0x1c')&&typeof _0x2120a5[_0x38e5('0x1d')]==='undefined';var _0x2ec552=_0x7b6344['count'];var _0x37860e=_0x1efef1?0x0:_0x2120a5[_0x38e5('0x1b')];var _0x24d03c=_0x1efef1?_0x7b6344[_0x38e5('0x1e')]:_0x2120a5[_0x38e5('0x1b')]+_0x2120a5[_0x38e5('0x1d')];var _0x5a8cae;if(_0x24d03c>=_0x2ec552){_0x24d03c=_0x2ec552;_0x5a8cae=0xc8;}else{_0x5a8cae=0xce;}_0x306f82['status'](_0x5a8cae);return _0x306f82[_0x38e5('0x1f')](_0x38e5('0x20'),_0x37860e+'-'+_0x24d03c+'/'+_0x2ec552)['json'](_0x7b6344);}return null;};}function patchUpdates(_0x4f6bf5){return function(_0x36a0b2){try{jsonpatch[_0x38e5('0x21')](_0x36a0b2,_0x4f6bf5,!![]);}catch(_0x4279e2){return BPromise[_0x38e5('0x22')](_0x4279e2);}return _0x36a0b2[_0x38e5('0x23')]();};}function saveUpdates(_0x1b776c,_0x39cfa8){return function(_0x43b5b9){if(_0x43b5b9){return _0x43b5b9[_0x38e5('0x24')](_0x1b776c)['then'](function(_0x2bed94){return _0x2bed94;});}return null;};}function removeEntity(_0x469159,_0x2c974d){return function(_0x20b58b){if(_0x20b58b){return _0x20b58b['destroy']()[_0x38e5('0x25')](function(){_0x469159['status'](0xcc)[_0x38e5('0x26')]();});}};}function handleEntityNotFound(_0x1132c7,_0x16d04a){return function(_0x553eae){if(!_0x553eae){_0x1132c7['sendStatus'](0x194);}return _0x553eae;};}function handleError(_0x1d3fdc,_0x4dace5){_0x4dace5=_0x4dace5||0x1f4;return function(_0x47849f){logger[_0x38e5('0x27')](_0x47849f[_0x38e5('0x28')]);if(_0x47849f[_0x38e5('0x29')]){delete _0x47849f['name'];}_0x1d3fdc[_0x38e5('0x19')](_0x4dace5)['send'](_0x47849f);};}exports['index']=function(_0x1af748,_0x2ae4f3){var _0x51c09d={},_0x560a32={},_0x446676={'count':0x0,'rows':[]};var _0x1d2b9e=_[_0x38e5('0x2a')](db['DeskConfiguration'][_0x38e5('0x2b')],function(_0x85c41e){return{'name':_0x85c41e[_0x38e5('0x2c')],'type':_0x85c41e[_0x38e5('0x2d')]['key']};});_0x560a32[_0x38e5('0x2e')]=_[_0x38e5('0x2a')](_0x1d2b9e,_0x38e5('0x29'));_0x560a32['query']=_[_0x38e5('0x2f')](_0x1af748[_0x38e5('0x30')]);_0x560a32[_0x38e5('0x31')]=_[_0x38e5('0x32')](_0x560a32[_0x38e5('0x2e')],_0x560a32['query']);_0x51c09d[_0x38e5('0x33')]=_['intersection'](_0x560a32['model'],qs[_0x38e5('0x34')](_0x1af748['query']['fields']));_0x51c09d[_0x38e5('0x33')]=_0x51c09d[_0x38e5('0x33')][_0x38e5('0x35')]?_0x51c09d['attributes']:_0x560a32[_0x38e5('0x2e')];if(!_0x1af748['query'][_0x38e5('0x36')](_0x38e5('0x37'))){_0x51c09d[_0x38e5('0x1d')]=qs[_0x38e5('0x1d')](_0x1af748[_0x38e5('0x30')][_0x38e5('0x1d')]);_0x51c09d[_0x38e5('0x1b')]=qs[_0x38e5('0x1b')](_0x1af748[_0x38e5('0x30')]['offset']);}_0x51c09d[_0x38e5('0x38')]=qs[_0x38e5('0x39')](_0x1af748['query'][_0x38e5('0x39')]);_0x51c09d[_0x38e5('0x3a')]=qs[_0x38e5('0x31')](_['pick'](_0x1af748[_0x38e5('0x30')],_0x560a32[_0x38e5('0x31')]),_0x1d2b9e);if(_0x1af748[_0x38e5('0x30')][_0x38e5('0x3b')]){_0x51c09d[_0x38e5('0x3a')]=_[_0x38e5('0x3c')](_0x51c09d['where'],{'$or':_[_0x38e5('0x2a')](_0x1d2b9e,function(_0x10bd5e){if(_0x10bd5e[_0x38e5('0x2d')]!=='VIRTUAL'){var _0x267445={};_0x267445[_0x10bd5e['name']]={'$like':'%'+_0x1af748[_0x38e5('0x30')][_0x38e5('0x3b')]+'%'};return _0x267445;}})});}_0x51c09d=_[_0x38e5('0x3c')]({},_0x51c09d,_0x1af748[_0x38e5('0x3d')]);var _0x8494a9={'where':_0x51c09d[_0x38e5('0x3a')]};return db['DeskConfiguration'][_0x38e5('0x1e')](_0x8494a9)[_0x38e5('0x25')](function(_0x4560b5){_0x446676[_0x38e5('0x1e')]=_0x4560b5;if(_0x1af748[_0x38e5('0x30')]['includeAll']){_0x51c09d[_0x38e5('0x3e')]=[{'all':!![]}];}return db[_0x38e5('0x3f')][_0x38e5('0x40')](_0x51c09d);})[_0x38e5('0x25')](function(_0x48c9d6){_0x446676[_0x38e5('0x41')]=_0x48c9d6;return _0x446676;})[_0x38e5('0x25')](respondWithFilteredResult(_0x2ae4f3,_0x51c09d))[_0x38e5('0x42')](handleError(_0x2ae4f3,null));};exports['show']=function(_0x31f311,_0x549c3f){var _0xe0ba20={'raw':![],'where':{'id':_0x31f311['params']['id']}},_0x1788e1={};_0x1788e1['model']=_[_0x38e5('0x2f')](db['DeskConfiguration'][_0x38e5('0x2b')]);_0x1788e1[_0x38e5('0x30')]=_[_0x38e5('0x2f')](_0x31f311['query']);_0x1788e1['filters']=_[_0x38e5('0x32')](_0x1788e1[_0x38e5('0x2e')],_0x1788e1[_0x38e5('0x30')]);_0xe0ba20[_0x38e5('0x33')]=_[_0x38e5('0x32')](_0x1788e1[_0x38e5('0x2e')],qs[_0x38e5('0x34')](_0x31f311[_0x38e5('0x30')]['fields']));_0xe0ba20[_0x38e5('0x33')]=_0xe0ba20['attributes'][_0x38e5('0x35')]?_0xe0ba20[_0x38e5('0x33')]:_0x1788e1[_0x38e5('0x2e')];if(_0x31f311[_0x38e5('0x30')][_0x38e5('0x43')]){_0xe0ba20[_0x38e5('0x3e')]=[{'all':!![]}];}_0xe0ba20=_[_0x38e5('0x3c')]({},_0xe0ba20,_0x31f311[_0x38e5('0x3d')]);return db[_0x38e5('0x3f')][_0x38e5('0x44')](_0xe0ba20)[_0x38e5('0x25')](handleEntityNotFound(_0x549c3f,null))[_0x38e5('0x25')](respondWithResult(_0x549c3f,null))['catch'](handleError(_0x549c3f,null));};exports[_0x38e5('0x45')]=function(_0x5bfa51,_0x5abfee){return db[_0x38e5('0x3f')][_0x38e5('0x45')](_0x5bfa51[_0x38e5('0x46')],{})[_0x38e5('0x25')](respondWithResult(_0x5abfee,0xc9))[_0x38e5('0x42')](handleError(_0x5abfee,null));};exports[_0x38e5('0x24')]=function(_0x18bc5a,_0x255b73){if(_0x18bc5a[_0x38e5('0x46')]['id']){delete _0x18bc5a[_0x38e5('0x46')]['id'];}return db[_0x38e5('0x3f')][_0x38e5('0x44')]({'where':{'id':_0x18bc5a[_0x38e5('0x47')]['id']}})['then'](handleEntityNotFound(_0x255b73,null))['then'](saveUpdates(_0x18bc5a[_0x38e5('0x46')],null))['then'](respondWithResult(_0x255b73,null))['catch'](handleError(_0x255b73,null));};exports[_0x38e5('0x48')]=function(_0x16ecfe,_0x2bf54e){return db[_0x38e5('0x3f')][_0x38e5('0x44')]({'where':{'id':_0x16ecfe[_0x38e5('0x47')]['id']}})[_0x38e5('0x25')](handleEntityNotFound(_0x2bf54e,null))['then'](removeEntity(_0x2bf54e,null))[_0x38e5('0x42')](handleError(_0x2bf54e,null));};exports['getFields']=function(_0x2e54af,_0x19879e,_0x211f8e){var _0x42e6c7={};var _0xf08df4={};var _0x5dbb9e;var _0x46b934;return db[_0x38e5('0x3f')][_0x38e5('0x49')]({'where':{'id':_0x2e54af[_0x38e5('0x47')]['id']}})[_0x38e5('0x25')](handleEntityNotFound(_0x19879e,null))[_0x38e5('0x25')](function(_0x207abf){if(_0x207abf){_0x5dbb9e=_0x207abf;_0xf08df4[_0x38e5('0x2e')]=_[_0x38e5('0x2f')](db[_0x38e5('0x4a')][_0x38e5('0x2b')]);_0xf08df4['query']=_['keys'](_0x2e54af[_0x38e5('0x30')]);_0xf08df4[_0x38e5('0x31')]=_[_0x38e5('0x32')](_0xf08df4[_0x38e5('0x2e')],_0xf08df4[_0x38e5('0x30')]);_0x42e6c7[_0x38e5('0x33')]=_['intersection'](_0xf08df4[_0x38e5('0x2e')],qs['fields'](_0x2e54af[_0x38e5('0x30')]['fields']));_0x42e6c7[_0x38e5('0x33')]=_0x42e6c7[_0x38e5('0x33')][_0x38e5('0x35')]?_0x42e6c7[_0x38e5('0x33')]:_0xf08df4['model'];_0x42e6c7['order']=qs['sort'](_0x2e54af[_0x38e5('0x30')][_0x38e5('0x39')]);_0x42e6c7['where']=qs['filters'](_[_0x38e5('0x4b')](_0x2e54af['query'],_0xf08df4[_0x38e5('0x31')]));if(_0x2e54af[_0x38e5('0x30')]['filter']){_0x42e6c7[_0x38e5('0x3a')]=_[_0x38e5('0x3c')](_0x42e6c7[_0x38e5('0x3a')],{'$or':_['map'](_0x42e6c7['attributes'],function(_0x3639e9){var _0x21167f={};_0x21167f[_0x3639e9]={'$like':'%'+_0x2e54af[_0x38e5('0x30')]['filter']+'%'};return _0x21167f;})});}_0x42e6c7=_[_0x38e5('0x3c')]({},_0x42e6c7,_0x2e54af['options']);return _0x5dbb9e[_0x38e5('0x4c')](_0x42e6c7);}})['then'](function(_0x494ccc){if(_0x494ccc){_0x46b934=_0x494ccc[_0x38e5('0x35')];if(!_0x2e54af[_0x38e5('0x30')][_0x38e5('0x36')](_0x38e5('0x37'))){_0x42e6c7['limit']=qs[_0x38e5('0x1d')](_0x2e54af[_0x38e5('0x30')][_0x38e5('0x1d')]);_0x42e6c7[_0x38e5('0x1b')]=qs[_0x38e5('0x1b')](_0x2e54af['query'][_0x38e5('0x1b')]);}return _0x5dbb9e[_0x38e5('0x4c')](_0x42e6c7);}})['then'](function(_0x3e9764){if(_0x3e9764){return _0x3e9764?{'count':_0x46b934,'rows':_0x3e9764}:null;}})[_0x38e5('0x25')](respondWithResult(_0x19879e,null))[_0x38e5('0x42')](handleError(_0x19879e,null));};exports[_0x38e5('0x4d')]=function(_0x93e91a,_0x59bd7c,_0xc41ba4){var _0x30d8c6={};var _0x4179b4={};var _0x86b4fb;var _0x394dd6;return db[_0x38e5('0x3f')][_0x38e5('0x49')]({'where':{'id':_0x93e91a[_0x38e5('0x47')]['id']}})[_0x38e5('0x25')](handleEntityNotFound(_0x59bd7c,null))[_0x38e5('0x25')](function(_0x59c35e){if(_0x59c35e){_0x86b4fb=_0x59c35e;_0x4179b4['model']=_[_0x38e5('0x2f')](db[_0x38e5('0x4a')][_0x38e5('0x2b')]);_0x4179b4[_0x38e5('0x30')]=_[_0x38e5('0x2f')](_0x93e91a['query']);_0x4179b4[_0x38e5('0x31')]=_[_0x38e5('0x32')](_0x4179b4['model'],_0x4179b4[_0x38e5('0x30')]);_0x30d8c6[_0x38e5('0x33')]=_[_0x38e5('0x32')](_0x4179b4[_0x38e5('0x2e')],qs[_0x38e5('0x34')](_0x93e91a[_0x38e5('0x30')]['fields']));_0x30d8c6[_0x38e5('0x33')]=_0x30d8c6[_0x38e5('0x33')][_0x38e5('0x35')]?_0x30d8c6[_0x38e5('0x33')]:_0x4179b4['model'];_0x30d8c6['order']=qs[_0x38e5('0x39')](_0x93e91a[_0x38e5('0x30')][_0x38e5('0x39')]);_0x30d8c6[_0x38e5('0x3a')]=qs[_0x38e5('0x31')](_[_0x38e5('0x4b')](_0x93e91a[_0x38e5('0x30')],_0x4179b4['filters']));if(_0x93e91a[_0x38e5('0x30')][_0x38e5('0x3b')]){_0x30d8c6['where']=_[_0x38e5('0x3c')](_0x30d8c6[_0x38e5('0x3a')],{'$or':_[_0x38e5('0x2a')](_0x30d8c6[_0x38e5('0x33')],function(_0x49ba01){var _0x58f820={};_0x58f820[_0x49ba01]={'$like':'%'+_0x93e91a[_0x38e5('0x30')]['filter']+'%'};return _0x58f820;})});}_0x30d8c6=_[_0x38e5('0x3c')]({},_0x30d8c6,_0x93e91a[_0x38e5('0x3d')]);return _0x86b4fb[_0x38e5('0x4d')](_0x30d8c6);}})[_0x38e5('0x25')](function(_0x373c8e){if(_0x373c8e){_0x394dd6=_0x373c8e['length'];if(!_0x93e91a[_0x38e5('0x30')]['hasOwnProperty']('nolimit')){_0x30d8c6[_0x38e5('0x1d')]=qs[_0x38e5('0x1d')](_0x93e91a['query'][_0x38e5('0x1d')]);_0x30d8c6[_0x38e5('0x1b')]=qs[_0x38e5('0x1b')](_0x93e91a[_0x38e5('0x30')][_0x38e5('0x1b')]);}return _0x86b4fb[_0x38e5('0x4d')](_0x30d8c6);}})[_0x38e5('0x25')](function(_0x18b0e6){if(_0x18b0e6){return _0x18b0e6?{'count':_0x394dd6,'rows':_0x18b0e6}:null;}})['then'](respondWithResult(_0x59bd7c,null))['catch'](handleError(_0x59bd7c,null));};exports[_0x38e5('0x4e')]=function(_0x2742be,_0x1d6e98,_0x552f7b){var _0x511522={};var _0x186b0a={};var _0x495d74;var _0x21a7d5;return db[_0x38e5('0x3f')][_0x38e5('0x49')]({'where':{'id':_0x2742be[_0x38e5('0x47')]['id']}})[_0x38e5('0x25')](handleEntityNotFound(_0x1d6e98,null))[_0x38e5('0x25')](function(_0x1f9e48){if(_0x1f9e48){_0x495d74=_0x1f9e48;_0x186b0a[_0x38e5('0x2e')]=_[_0x38e5('0x2f')](db[_0x38e5('0x4a')][_0x38e5('0x2b')]);_0x186b0a[_0x38e5('0x30')]=_[_0x38e5('0x2f')](_0x2742be[_0x38e5('0x30')]);_0x186b0a[_0x38e5('0x31')]=_[_0x38e5('0x32')](_0x186b0a['model'],_0x186b0a['query']);_0x511522['attributes']=_[_0x38e5('0x32')](_0x186b0a['model'],qs[_0x38e5('0x34')](_0x2742be[_0x38e5('0x30')]['fields']));_0x511522[_0x38e5('0x33')]=_0x511522[_0x38e5('0x33')][_0x38e5('0x35')]?_0x511522[_0x38e5('0x33')]:_0x186b0a[_0x38e5('0x2e')];_0x511522['order']=qs[_0x38e5('0x39')](_0x2742be['query']['sort']);_0x511522[_0x38e5('0x3a')]=qs[_0x38e5('0x31')](_['pick'](_0x2742be[_0x38e5('0x30')],_0x186b0a[_0x38e5('0x31')]));if(_0x2742be[_0x38e5('0x30')][_0x38e5('0x3b')]){_0x511522['where']=_[_0x38e5('0x3c')](_0x511522[_0x38e5('0x3a')],{'$or':_['map'](_0x511522[_0x38e5('0x33')],function(_0x2add07){var _0x57f9f5={};_0x57f9f5[_0x2add07]={'$like':'%'+_0x2742be[_0x38e5('0x30')]['filter']+'%'};return _0x57f9f5;})});}_0x511522=_[_0x38e5('0x3c')]({},_0x511522,_0x2742be[_0x38e5('0x3d')]);return _0x495d74[_0x38e5('0x4e')](_0x511522);}})[_0x38e5('0x25')](function(_0xeb8f1c){if(_0xeb8f1c){_0x21a7d5=_0xeb8f1c[_0x38e5('0x35')];if(!_0x2742be[_0x38e5('0x30')][_0x38e5('0x36')](_0x38e5('0x37'))){_0x511522[_0x38e5('0x1d')]=qs['limit'](_0x2742be[_0x38e5('0x30')]['limit']);_0x511522[_0x38e5('0x1b')]=qs['offset'](_0x2742be[_0x38e5('0x30')][_0x38e5('0x1b')]);}return _0x495d74[_0x38e5('0x4e')](_0x511522);}})['then'](function(_0x12145b){if(_0x12145b){return _0x12145b?{'count':_0x21a7d5,'rows':_0x12145b}:null;}})['then'](respondWithResult(_0x1d6e98,null))[_0x38e5('0x42')](handleError(_0x1d6e98,null));};exports['getTags']=function(_0x1856e4,_0xca43fc,_0x935a02){var _0x1bcbca={};var _0x46170e={};var _0x3d1b83;var _0x55b7e0;return db[_0x38e5('0x3f')][_0x38e5('0x49')]({'where':{'id':_0x1856e4[_0x38e5('0x47')]['id']}})['then'](handleEntityNotFound(_0xca43fc,null))[_0x38e5('0x25')](function(_0xfa68fe){if(_0xfa68fe){_0x3d1b83=_0xfa68fe;_0x46170e[_0x38e5('0x2e')]=_[_0x38e5('0x2f')](db[_0x38e5('0x4f')][_0x38e5('0x2b')]);_0x46170e[_0x38e5('0x30')]=_[_0x38e5('0x2f')](_0x1856e4[_0x38e5('0x30')]);_0x46170e[_0x38e5('0x31')]=_[_0x38e5('0x32')](_0x46170e[_0x38e5('0x2e')],_0x46170e[_0x38e5('0x30')]);_0x1bcbca[_0x38e5('0x33')]=_[_0x38e5('0x32')](_0x46170e[_0x38e5('0x2e')],qs['fields'](_0x1856e4[_0x38e5('0x30')][_0x38e5('0x34')]));_0x1bcbca[_0x38e5('0x33')]=_0x1bcbca['attributes'][_0x38e5('0x35')]?_0x1bcbca['attributes']:_0x46170e[_0x38e5('0x2e')];_0x1bcbca['order']=qs[_0x38e5('0x39')](_0x1856e4['query'][_0x38e5('0x39')]);_0x1bcbca[_0x38e5('0x3a')]=qs[_0x38e5('0x31')](_[_0x38e5('0x4b')](_0x1856e4[_0x38e5('0x30')],_0x46170e['filters']));if(_0x1856e4[_0x38e5('0x30')][_0x38e5('0x3b')]){_0x1bcbca[_0x38e5('0x3a')]=_[_0x38e5('0x3c')](_0x1bcbca[_0x38e5('0x3a')],{'$or':_['map'](_0x1bcbca['attributes'],function(_0x4305f6){var _0x2737a2={};_0x2737a2[_0x4305f6]={'$like':'%'+_0x1856e4['query'][_0x38e5('0x3b')]+'%'};return _0x2737a2;})});}_0x1bcbca=_[_0x38e5('0x3c')]({},_0x1bcbca,_0x1856e4[_0x38e5('0x3d')]);return _0x3d1b83[_0x38e5('0x50')](_0x1bcbca);}})[_0x38e5('0x25')](function(_0x21f317){if(_0x21f317){_0x55b7e0=_0x21f317[_0x38e5('0x35')];if(!_0x1856e4[_0x38e5('0x30')][_0x38e5('0x36')](_0x38e5('0x37'))){_0x1bcbca[_0x38e5('0x1d')]=qs[_0x38e5('0x1d')](_0x1856e4['query']['limit']);_0x1bcbca[_0x38e5('0x1b')]=qs[_0x38e5('0x1b')](_0x1856e4[_0x38e5('0x30')][_0x38e5('0x1b')]);}return _0x3d1b83[_0x38e5('0x50')](_0x1bcbca);}})[_0x38e5('0x25')](function(_0x3eeeee){if(_0x3eeeee){return _0x3eeeee?{'count':_0x55b7e0,'rows':_0x3eeeee}:null;}})[_0x38e5('0x25')](respondWithResult(_0xca43fc,null))['catch'](handleError(_0xca43fc,null));};exports['setTags']=function(_0x21c0ad,_0x1d997c,_0x1f9463){if(_0x21c0ad[_0x38e5('0x46')]['id']){delete _0x21c0ad[_0x38e5('0x46')]['id'];}return db[_0x38e5('0x3f')][_0x38e5('0x49')]({'where':{'id':_0x21c0ad['params']['id']}})[_0x38e5('0x25')](handleEntityNotFound(_0x1d997c,null))[_0x38e5('0x25')](function(_0x15381c){if(_0x15381c){return _0x15381c[_0x38e5('0x51')](_0x21c0ad[_0x38e5('0x46')][_0x38e5('0x52')]||[]);}return null;})[_0x38e5('0x25')](respondWithResult(_0x1d997c,null))[_0x38e5('0x42')](handleError(_0x1d997c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2640d15..6fd26c1 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 _0xaee7=['api','moment','bluebird','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x4391c0,_0x2a32af){var _0x386600=function(_0x52707b){while(--_0x52707b){_0x4391c0['push'](_0x4391c0['shift']());}};_0x386600(++_0x2a32af);}(_0xaee7,0xdf));var _0x7aee=function(_0x1dfbc5,_0x330c6f){_0x1dfbc5=_0x1dfbc5-0x0;var _0x4db21b=_0xaee7[_0x1dfbc5];return _0x4db21b;};'use strict';var _=require(_0x7aee('0x0'));var util=require(_0x7aee('0x1'));var logger=require('../../config/logger')(_0x7aee('0x2'));var moment=require(_0x7aee('0x3'));var BPromise=require(_0x7aee('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(_0x7aee('0x5'));module[_0x7aee('0x6')]=function(_0x51b765,_0xb51c36){return _0x51b765['define'](_0x7aee('0x7'),attributes,{'tableName':_0x7aee('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x752b=['api','moment','bluebird','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x778aa1,_0x40b24){var _0x2c50a5=function(_0x222598){while(--_0x222598){_0x778aa1['push'](_0x778aa1['shift']());}};_0x2c50a5(++_0x40b24);}(_0x752b,0x1e9));var _0xb752=function(_0xe325f1,_0x33eb5b){_0xe325f1=_0xe325f1-0x0;var _0x42ec51=_0x752b[_0xe325f1];return _0x42ec51;};'use strict';var _=require(_0xb752('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb752('0x1'));var moment=require(_0xb752('0x2'));var BPromise=require(_0xb752('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb752('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb752('0x5'));module[_0xb752('0x6')]=function(_0x2eb25c,_0x2fca68){return _0x2eb25c[_0xb752('0x7')](_0xb752('0x8'),attributes,{'tableName':_0xb752('0x9'),'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 d662bd1..8fc8b94 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 _0x3c85=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','debug','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3c85,0x1a0));var _0x53c8=function(_0x56cbe0,_0xba8df2){_0x56cbe0=_0x56cbe0-0x0;var _0x3bcf4c=_0x3c85[_0x56cbe0];return _0x3bcf4c;};'use strict';var _=require(_0x53c8('0x0'));var util=require(_0x53c8('0x1'));var moment=require(_0x53c8('0x2'));var BPromise=require(_0x53c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53c8('0x4'))['db'];var utils=require(_0x53c8('0x5'));var logger=require(_0x53c8('0x6'))('rpc');var config=require(_0x53c8('0x7'));var jayson=require(_0x53c8('0x8'));var client=jayson[_0x53c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5271ad,_0x4bc6ae,_0x4bb757){return new BPromise(function(_0x7d5c2a,_0x4de781){return client['request'](_0x5271ad,_0x4bb757)[_0x53c8('0xa')](function(_0x19504c){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent');logger[_0x53c8('0xb')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4bc6ae,'request\x20sent',JSON[_0x53c8('0xc')](_0x19504c));if(_0x19504c[_0x53c8('0xd')]){if(_0x19504c[_0x53c8('0xd')][_0x53c8('0xe')]===0x1f4){logger[_0x53c8('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4bc6ae,_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);return _0x4de781(_0x19504c[_0x53c8('0xd')]['message']);}logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x19504c['error'][_0x53c8('0xf')]);return _0x7d5c2a(_0x19504c[_0x53c8('0xd')][_0x53c8('0xf')]);}else{logger[_0x53c8('0x11')](_0x53c8('0x10'),_0x4bc6ae,_0x53c8('0x12'));_0x7d5c2a(_0x19504c[_0x53c8('0x13')][_0x53c8('0xf')]);}})[_0x53c8('0x14')](function(_0x8a7c46){logger[_0x53c8('0xd')](_0x53c8('0x10'),_0x4bc6ae,_0x8a7c46);_0x4de781(_0x8a7c46);});});} \ No newline at end of file +var _0xc23d=['stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xc23d,0x7f));var _0xdc23=function(_0x7b68cc,_0x3f522e){_0x7b68cc=_0x7b68cc-0x0;var _0x36470e=_0xc23d[_0x7b68cc];return _0x36470e;};'use strict';var _=require(_0xdc23('0x0'));var util=require(_0xdc23('0x1'));var moment=require(_0xdc23('0x2'));var BPromise=require(_0xdc23('0x3'));var rs=require(_0xdc23('0x4'));var fs=require('fs');var Redis=require(_0xdc23('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc23('0x6'));var logger=require(_0xdc23('0x7'))(_0xdc23('0x8'));var config=require(_0xdc23('0x9'));var jayson=require(_0xdc23('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17cb48,_0x47c9cd,_0x2a5303){return new BPromise(function(_0x4d16cf,_0x459f6d){return client[_0xdc23('0xb')](_0x17cb48,_0x2a5303)[_0xdc23('0xc')](function(_0x43ba94){logger[_0xdc23('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x47c9cd,_0xdc23('0xe'));logger[_0xdc23('0xf')](_0xdc23('0x10'),_0x47c9cd,_0xdc23('0xe'),JSON[_0xdc23('0x11')](_0x43ba94));if(_0x43ba94[_0xdc23('0x12')]){if(_0x43ba94['error'][_0xdc23('0x13')]===0x1f4){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')]['message']);return _0x459f6d(_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);}logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x43ba94[_0xdc23('0x12')][_0xdc23('0x15')]);return _0x4d16cf(_0x43ba94['error'][_0xdc23('0x15')]);}else{logger['info'](_0xdc23('0x14'),_0x47c9cd,_0xdc23('0xe'));_0x4d16cf(_0x43ba94[_0xdc23('0x16')]['message']);}})[_0xdc23('0x17')](function(_0x476654){logger[_0xdc23('0x12')](_0xdc23('0x14'),_0x47c9cd,_0x476654);_0x459f6d(_0x476654);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 11545ce..5908426 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 _0x0df5=['update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id'];(function(_0x194c0b,_0x1189d){var _0x587fae=function(_0x4cb940){while(--_0x4cb940){_0x194c0b['push'](_0x194c0b['shift']());}};_0x587fae(++_0x1189d);}(_0x0df5,0x18f));var _0x50df=function(_0x347f5d,_0x5812a1){_0x347f5d=_0x347f5d-0x0;var _0x1bd5b0=_0x0df5[_0x347f5d];return _0x1bd5b0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x50df('0x0'));var timeout=require(_0x50df('0x1'));var express=require(_0x50df('0x2'));var router=express['Router']();var fs_extra=require(_0x50df('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x50df('0x4'));var config=require(_0x50df('0x5'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x50df('0x6')](),controller['index']);router[_0x50df('0x7')](_0x50df('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x50df('0x8'),auth[_0x50df('0x6')](),controller[_0x50df('0x9')]);router['delete'](_0x50df('0x8'),auth[_0x50df('0x6')](),controller[_0x50df('0xa')]);module[_0x50df('0xb')]=router; \ No newline at end of file +var _0x1b0e=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports'];(function(_0x14a487,_0x377999){var _0x2ed916=function(_0xcbba84){while(--_0xcbba84){_0x14a487['push'](_0x14a487['shift']());}};_0x2ed916(++_0x377999);}(_0x1b0e,0x132));var _0xe1b0=function(_0x272c6f,_0x28f232){_0x272c6f=_0x272c6f-0x0;var _0x5a5097=_0x1b0e[_0x272c6f];return _0x5a5097;};'use strict';var multer=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var path=require(_0xe1b0('0x2'));var timeout=require(_0xe1b0('0x3'));var express=require(_0xe1b0('0x4'));var router=express[_0xe1b0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var controller=require('./intDeskField.controller');router[_0xe1b0('0x8')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xa')]);router['get'](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['show']);router[_0xe1b0('0xc')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xd')]);router[_0xe1b0('0xe')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xf')]);router[_0xe1b0('0x10')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['destroy']);module[_0xe1b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 062ce9b..5dba5f1 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 _0xd026=['string','variable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x5ce6ed,_0x44197d){var _0x1291eb=function(_0x3b94d8){while(--_0x3b94d8){_0x5ce6ed['push'](_0x5ce6ed['shift']());}};_0x1291eb(++_0x44197d);}(_0xd026,0x19e));var _0x6d02=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xd026[_0x15bc81];return _0x59440e;};'use strict';var Sequelize=require('sequelize');module[_0x6d02('0x0')]={'type':{'type':Sequelize[_0x6d02('0x1')](_0x6d02('0x2'),_0x6d02('0x3'),'customVariable',_0x6d02('0x4'),_0x6d02('0x5')),'defaultValue':_0x6d02('0x2')},'content':{'type':Sequelize[_0x6d02('0x6')]},'key':{'type':Sequelize[_0x6d02('0x6')]},'keyType':{'type':Sequelize[_0x6d02('0x1')](_0x6d02('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x6d02('0x6')]},'idField':{'type':Sequelize[_0x6d02('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6d02('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d02('0x6')]}}; \ No newline at end of file +var _0x8ed0=['string','variable','picklist','STRING','ENUM'];(function(_0x96db6c,_0x4fb2a7){var _0x5ac559=function(_0x2d2b5d){while(--_0x2d2b5d){_0x96db6c['push'](_0x96db6c['shift']());}};_0x5ac559(++_0x4fb2a7);}(_0x8ed0,0x90));var _0x08ed=function(_0x59ff34,_0x17e179){_0x59ff34=_0x59ff34-0x0;var _0x38bd29=_0x8ed0[_0x59ff34];return _0x38bd29;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x08ed('0x0')](_0x08ed('0x1'),_0x08ed('0x2'),'customVariable','keyValue',_0x08ed('0x3')),'defaultValue':_0x08ed('0x1')},'content':{'type':Sequelize[_0x08ed('0x4')]},'key':{'type':Sequelize[_0x08ed('0x4')]},'keyType':{'type':Sequelize[_0x08ed('0x0')](_0x08ed('0x1'),_0x08ed('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x08ed('0x4')]},'idField':{'type':Sequelize[_0x08ed('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 46bc408..2278374 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 _0x277c=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','DeskField','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set'];(function(_0x1a6d31,_0x5e2ca3){var _0x3ac36c=function(_0x4e1f5a){while(--_0x4e1f5a){_0x1a6d31['push'](_0x1a6d31['shift']());}};_0x3ac36c(++_0x5e2ca3);}(_0x277c,0x153));var _0xc277=function(_0x416340,_0x2c7bda){_0x416340=_0x416340-0x0;var _0x434575=_0x277c[_0x416340];return _0x434575;};'use strict';var emlformat=require(_0xc277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc277('0x1'));var jsonpatch=require(_0xc277('0x2'));var rp=require(_0xc277('0x3'));var moment=require(_0xc277('0x4'));var BPromise=require(_0xc277('0x5'));var Mustache=require(_0xc277('0x6'));var util=require(_0xc277('0x7'));var path=require(_0xc277('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc277('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc277('0xa'));var squel=require('squel');var crypto=require(_0xc277('0xb'));var jsforce=require(_0xc277('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc277('0xd'));var querystring=require(_0xc277('0xe'));var Papa=require(_0xc277('0xf'));var Redis=require(_0xc277('0x10'));var authService=require(_0xc277('0x11'));var qs=require(_0xc277('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc277('0x13'))(_0xc277('0x14'));var utils=require(_0xc277('0x15'));var config=require(_0xc277('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc277('0x17'))['db'];function respondWithStatusCode(_0x4a7700,_0xb6b933){_0xb6b933=_0xb6b933||0xcc;return function(_0x2bba87){if(_0x2bba87){return _0x4a7700[_0xc277('0x18')](_0xb6b933);}return _0x4a7700[_0xc277('0x19')](_0xb6b933)['end']();};}function respondWithResult(_0x222bc8,_0x182d35){_0x182d35=_0x182d35||0xc8;return function(_0x8895bd){if(_0x8895bd){return _0x222bc8['status'](_0x182d35)['json'](_0x8895bd);}};}function respondWithFilteredResult(_0x178e6d,_0x5c212c){return function(_0x46d20c){if(_0x46d20c){var _0x5d73f8=typeof _0x5c212c[_0xc277('0x1a')]===_0xc277('0x1b')&&typeof _0x5c212c[_0xc277('0x1c')]==='undefined';var _0x5cdb4b=_0x46d20c[_0xc277('0x1d')];var _0x4d23a7=_0x5d73f8?0x0:_0x5c212c['offset'];var _0x1e1a9b=_0x5d73f8?_0x46d20c[_0xc277('0x1d')]:_0x5c212c[_0xc277('0x1a')]+_0x5c212c[_0xc277('0x1c')];var _0xe2b7c1;if(_0x1e1a9b>=_0x5cdb4b){_0x1e1a9b=_0x5cdb4b;_0xe2b7c1=0xc8;}else{_0xe2b7c1=0xce;}_0x178e6d[_0xc277('0x19')](_0xe2b7c1);return _0x178e6d[_0xc277('0x1e')]('Content-Range',_0x4d23a7+'-'+_0x1e1a9b+'/'+_0x5cdb4b)['json'](_0x46d20c);}return null;};}function patchUpdates(_0x697d6f){return function(_0x28900e){try{jsonpatch[_0xc277('0x1f')](_0x28900e,_0x697d6f,!![]);}catch(_0x28b7b1){return BPromise[_0xc277('0x20')](_0x28b7b1);}return _0x28900e[_0xc277('0x21')]();};}function saveUpdates(_0xb4685f,_0x42cb0b){return function(_0x1bc888){if(_0x1bc888){return _0x1bc888[_0xc277('0x22')](_0xb4685f)[_0xc277('0x23')](function(_0x57a198){return _0x57a198;});}return null;};}function removeEntity(_0x2b9936,_0x21af1b){return function(_0x54b2e1){if(_0x54b2e1){return _0x54b2e1[_0xc277('0x24')]()['then'](function(){_0x2b9936['status'](0xcc)[_0xc277('0x25')]();});}};}function handleEntityNotFound(_0x57b03,_0x1583b6){return function(_0x436784){if(!_0x436784){_0x57b03[_0xc277('0x18')](0x194);}return _0x436784;};}function handleError(_0x3aa598,_0x37b893){_0x37b893=_0x37b893||0x1f4;return function(_0x9ad1c5){logger[_0xc277('0x26')](_0x9ad1c5[_0xc277('0x27')]);if(_0x9ad1c5[_0xc277('0x28')]){delete _0x9ad1c5['name'];}_0x3aa598['status'](_0x37b893)[_0xc277('0x29')](_0x9ad1c5);};}exports[_0xc277('0x2a')]=function(_0x4ebb0f,_0x4efc1e){var _0x388717={},_0x3bc773={},_0x37e27b={'count':0x0,'rows':[]};var _0x21c78c=_[_0xc277('0x2b')](db['DeskField'][_0xc277('0x2c')],function(_0x5edf7e){return{'name':_0x5edf7e[_0xc277('0x2d')],'type':_0x5edf7e[_0xc277('0x2e')][_0xc277('0x2f')]};});_0x3bc773[_0xc277('0x30')]=_['map'](_0x21c78c,_0xc277('0x28'));_0x3bc773['query']=_[_0xc277('0x31')](_0x4ebb0f[_0xc277('0x32')]);_0x3bc773[_0xc277('0x33')]=_[_0xc277('0x34')](_0x3bc773['model'],_0x3bc773[_0xc277('0x32')]);_0x388717[_0xc277('0x35')]=_['intersection'](_0x3bc773[_0xc277('0x30')],qs['fields'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x36')]));_0x388717[_0xc277('0x35')]=_0x388717[_0xc277('0x35')][_0xc277('0x37')]?_0x388717[_0xc277('0x35')]:_0x3bc773[_0xc277('0x30')];if(!_0x4ebb0f[_0xc277('0x32')][_0xc277('0x38')](_0xc277('0x39'))){_0x388717[_0xc277('0x1c')]=qs['limit'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1c')]);_0x388717[_0xc277('0x1a')]=qs['offset'](_0x4ebb0f[_0xc277('0x32')][_0xc277('0x1a')]);}_0x388717[_0xc277('0x3a')]=qs[_0xc277('0x3b')](_0x4ebb0f[_0xc277('0x32')]['sort']);_0x388717['where']=qs[_0xc277('0x33')](_['pick'](_0x4ebb0f[_0xc277('0x32')],_0x3bc773[_0xc277('0x33')]),_0x21c78c);if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]){_0x388717[_0xc277('0x3d')]=_[_0xc277('0x3e')](_0x388717[_0xc277('0x3d')],{'$or':_[_0xc277('0x2b')](_0x21c78c,function(_0x2e35b5){if(_0x2e35b5[_0xc277('0x2e')]!==_0xc277('0x3f')){var _0x4eaa6c={};_0x4eaa6c[_0x2e35b5[_0xc277('0x28')]]={'$like':'%'+_0x4ebb0f[_0xc277('0x32')][_0xc277('0x3c')]+'%'};return _0x4eaa6c;}})});}_0x388717=_['merge']({},_0x388717,_0x4ebb0f[_0xc277('0x40')]);var _0x278a92={'where':_0x388717['where']};return db['DeskField'][_0xc277('0x1d')](_0x278a92)[_0xc277('0x23')](function(_0x22c5b3){_0x37e27b[_0xc277('0x1d')]=_0x22c5b3;if(_0x4ebb0f[_0xc277('0x32')][_0xc277('0x41')]){_0x388717[_0xc277('0x42')]=[{'all':!![]}];}return db['DeskField'][_0xc277('0x43')](_0x388717);})[_0xc277('0x23')](function(_0x142ca6){_0x37e27b['rows']=_0x142ca6;return _0x37e27b;})['then'](respondWithFilteredResult(_0x4efc1e,_0x388717))['catch'](handleError(_0x4efc1e,null));};exports['show']=function(_0x519f14,_0x25723a){var _0x4a26e3={'raw':!![],'where':{'id':_0x519f14[_0xc277('0x44')]['id']}},_0x46fda3={};_0x46fda3[_0xc277('0x30')]=_['keys'](db[_0xc277('0x45')][_0xc277('0x2c')]);_0x46fda3[_0xc277('0x32')]=_[_0xc277('0x31')](_0x519f14['query']);_0x46fda3[_0xc277('0x33')]=_[_0xc277('0x34')](_0x46fda3['model'],_0x46fda3[_0xc277('0x32')]);_0x4a26e3[_0xc277('0x35')]=_[_0xc277('0x34')](_0x46fda3[_0xc277('0x30')],qs[_0xc277('0x36')](_0x519f14[_0xc277('0x32')][_0xc277('0x36')]));_0x4a26e3[_0xc277('0x35')]=_0x4a26e3[_0xc277('0x35')][_0xc277('0x37')]?_0x4a26e3[_0xc277('0x35')]:_0x46fda3['model'];if(_0x519f14[_0xc277('0x32')][_0xc277('0x41')]){_0x4a26e3[_0xc277('0x42')]=[{'all':!![]}];}_0x4a26e3=_[_0xc277('0x3e')]({},_0x4a26e3,_0x519f14['options']);return db[_0xc277('0x45')]['find'](_0x4a26e3)[_0xc277('0x23')](handleEntityNotFound(_0x25723a,null))[_0xc277('0x23')](respondWithResult(_0x25723a,null))[_0xc277('0x46')](handleError(_0x25723a,null));};exports[_0xc277('0x47')]=function(_0x4129bc,_0x57c759){return db[_0xc277('0x45')][_0xc277('0x47')](_0x4129bc[_0xc277('0x48')],{})[_0xc277('0x23')](respondWithResult(_0x57c759,0xc9))['catch'](handleError(_0x57c759,null));};exports[_0xc277('0x22')]=function(_0x9c910a,_0x150876){if(_0x9c910a['body']['id']){delete _0x9c910a[_0xc277('0x48')]['id'];}return db['DeskField'][_0xc277('0x49')]({'where':{'id':_0x9c910a[_0xc277('0x44')]['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x150876,null))[_0xc277('0x23')](saveUpdates(_0x9c910a[_0xc277('0x48')],null))[_0xc277('0x23')](respondWithResult(_0x150876,null))[_0xc277('0x46')](handleError(_0x150876,null));};exports[_0xc277('0x24')]=function(_0x8752f2,_0x25f5e1){return db[_0xc277('0x45')][_0xc277('0x49')]({'where':{'id':_0x8752f2['params']['id']}})[_0xc277('0x23')](handleEntityNotFound(_0x25f5e1,null))['then'](removeEntity(_0x25f5e1,null))[_0xc277('0x46')](handleError(_0x25f5e1,null));}; \ No newline at end of file +var _0x9b0d=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskField','includeAll','findAll','rows','show','params','include','catch','create','body','update','find','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','query','keys'];(function(_0x12566d,_0x323fb4){var _0x2c4555=function(_0x1b43b1){while(--_0x1b43b1){_0x12566d['push'](_0x12566d['shift']());}};_0x2c4555(++_0x323fb4);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x36511b,_0x1a7c22){_0x36511b=_0x36511b-0x0;var _0x143559=_0x9b0d[_0x36511b];return _0x143559;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd9b0('0x0'));var zipdir=require(_0xd9b0('0x1'));var jsonpatch=require(_0xd9b0('0x2'));var rp=require(_0xd9b0('0x3'));var moment=require('moment');var BPromise=require(_0xd9b0('0x4'));var Mustache=require(_0xd9b0('0x5'));var util=require(_0xd9b0('0x6'));var path=require(_0xd9b0('0x7'));var sox=require('sox');var csv=require(_0xd9b0('0x8'));var ejs=require(_0xd9b0('0x9'));var fs=require('fs');var fs_extra=require(_0xd9b0('0xa'));var _=require(_0xd9b0('0xb'));var squel=require(_0xd9b0('0xc'));var crypto=require(_0xd9b0('0xd'));var jsforce=require(_0xd9b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd9b0('0x8'));var querystring=require(_0xd9b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xd9b0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd9b0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9b0('0x12'));var logger=require(_0xd9b0('0x13'))(_0xd9b0('0x14'));var utils=require(_0xd9b0('0x15'));var config=require(_0xd9b0('0x16'));var licenseUtil=require(_0xd9b0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29e9e0,_0x76bb6e){_0x76bb6e=_0x76bb6e||0xcc;return function(_0x4e0210){if(_0x4e0210){return _0x29e9e0[_0xd9b0('0x18')](_0x76bb6e);}return _0x29e9e0[_0xd9b0('0x19')](_0x76bb6e)[_0xd9b0('0x1a')]();};}function respondWithResult(_0x46321d,_0x2a15b1){_0x2a15b1=_0x2a15b1||0xc8;return function(_0x13a800){if(_0x13a800){return _0x46321d['status'](_0x2a15b1)[_0xd9b0('0x1b')](_0x13a800);}};}function respondWithFilteredResult(_0x579aa7,_0x2908a1){return function(_0x288dd4){if(_0x288dd4){var _0x141fea=typeof _0x2908a1[_0xd9b0('0x1c')]===_0xd9b0('0x1d')&&typeof _0x2908a1[_0xd9b0('0x1e')]===_0xd9b0('0x1d');var _0x584d2d=_0x288dd4[_0xd9b0('0x1f')];var _0x3ffdc8=_0x141fea?0x0:_0x2908a1[_0xd9b0('0x1c')];var _0x1b9b8f=_0x141fea?_0x288dd4[_0xd9b0('0x1f')]:_0x2908a1[_0xd9b0('0x1c')]+_0x2908a1[_0xd9b0('0x1e')];var _0x485cdf;if(_0x1b9b8f>=_0x584d2d){_0x1b9b8f=_0x584d2d;_0x485cdf=0xc8;}else{_0x485cdf=0xce;}_0x579aa7[_0xd9b0('0x19')](_0x485cdf);return _0x579aa7['set'](_0xd9b0('0x20'),_0x3ffdc8+'-'+_0x1b9b8f+'/'+_0x584d2d)['json'](_0x288dd4);}return null;};}function patchUpdates(_0x225823){return function(_0x77c318){try{jsonpatch[_0xd9b0('0x21')](_0x77c318,_0x225823,!![]);}catch(_0x3df41b){return BPromise[_0xd9b0('0x22')](_0x3df41b);}return _0x77c318[_0xd9b0('0x23')]();};}function saveUpdates(_0x549cfe,_0x5ecfe7){return function(_0x132710){if(_0x132710){return _0x132710['update'](_0x549cfe)[_0xd9b0('0x24')](function(_0x283da7){return _0x283da7;});}return null;};}function removeEntity(_0x11c443,_0x5a1f95){return function(_0x222229){if(_0x222229){return _0x222229['destroy']()['then'](function(){_0x11c443[_0xd9b0('0x19')](0xcc)[_0xd9b0('0x1a')]();});}};}function handleEntityNotFound(_0x5569c3,_0x3d90f0){return function(_0x4b9935){if(!_0x4b9935){_0x5569c3[_0xd9b0('0x18')](0x194);}return _0x4b9935;};}function handleError(_0xf06e12,_0x1c7ece){_0x1c7ece=_0x1c7ece||0x1f4;return function(_0xe07b77){logger[_0xd9b0('0x25')](_0xe07b77[_0xd9b0('0x26')]);if(_0xe07b77[_0xd9b0('0x27')]){delete _0xe07b77[_0xd9b0('0x27')];}_0xf06e12[_0xd9b0('0x19')](_0x1c7ece)[_0xd9b0('0x28')](_0xe07b77);};}exports[_0xd9b0('0x29')]=function(_0x233aae,_0x160c43){var _0x8be573={},_0x16cd85={},_0x23b2d8={'count':0x0,'rows':[]};var _0x4f5cdc=_[_0xd9b0('0x2a')](db['DeskField'][_0xd9b0('0x2b')],function(_0x1f8bc8){return{'name':_0x1f8bc8['fieldName'],'type':_0x1f8bc8[_0xd9b0('0x2c')][_0xd9b0('0x2d')]};});_0x16cd85['model']=_[_0xd9b0('0x2a')](_0x4f5cdc,_0xd9b0('0x27'));_0x16cd85[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x233aae[_0xd9b0('0x2e')]);_0x16cd85[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],_0x16cd85['query']);_0x8be573[_0xd9b0('0x33')]=_[_0xd9b0('0x31')](_0x16cd85[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x233aae['query']['fields']));_0x8be573[_0xd9b0('0x33')]=_0x8be573['attributes'][_0xd9b0('0x35')]?_0x8be573[_0xd9b0('0x33')]:_0x16cd85['model'];if(!_0x233aae['query'][_0xd9b0('0x36')](_0xd9b0('0x37'))){_0x8be573[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x1e')]);_0x8be573[_0xd9b0('0x1c')]=qs[_0xd9b0('0x1c')](_0x233aae['query'][_0xd9b0('0x1c')]);}_0x8be573[_0xd9b0('0x38')]=qs[_0xd9b0('0x39')](_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x39')]);_0x8be573[_0xd9b0('0x3a')]=qs[_0xd9b0('0x30')](_[_0xd9b0('0x3b')](_0x233aae[_0xd9b0('0x2e')],_0x16cd85[_0xd9b0('0x30')]),_0x4f5cdc);if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x3c')]){_0x8be573[_0xd9b0('0x3a')]=_[_0xd9b0('0x3d')](_0x8be573[_0xd9b0('0x3a')],{'$or':_[_0xd9b0('0x2a')](_0x4f5cdc,function(_0x1d04de){if(_0x1d04de[_0xd9b0('0x2c')]!==_0xd9b0('0x3e')){var _0x18dc45={};_0x18dc45[_0x1d04de['name']]={'$like':'%'+_0x233aae['query'][_0xd9b0('0x3c')]+'%'};return _0x18dc45;}})});}_0x8be573=_['merge']({},_0x8be573,_0x233aae[_0xd9b0('0x3f')]);var _0x353fd7={'where':_0x8be573[_0xd9b0('0x3a')]};return db[_0xd9b0('0x40')][_0xd9b0('0x1f')](_0x353fd7)[_0xd9b0('0x24')](function(_0x359b3e){_0x23b2d8[_0xd9b0('0x1f')]=_0x359b3e;if(_0x233aae[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x8be573['include']=[{'all':!![]}];}return db[_0xd9b0('0x40')][_0xd9b0('0x42')](_0x8be573);})['then'](function(_0x1f5333){_0x23b2d8[_0xd9b0('0x43')]=_0x1f5333;return _0x23b2d8;})[_0xd9b0('0x24')](respondWithFilteredResult(_0x160c43,_0x8be573))['catch'](handleError(_0x160c43,null));};exports[_0xd9b0('0x44')]=function(_0x225800,_0x418113){var _0x3a09aa={'raw':!![],'where':{'id':_0x225800[_0xd9b0('0x45')]['id']}},_0x285ca9={};_0x285ca9[_0xd9b0('0x32')]=_[_0xd9b0('0x2f')](db[_0xd9b0('0x40')][_0xd9b0('0x2b')]);_0x285ca9[_0xd9b0('0x2e')]=_[_0xd9b0('0x2f')](_0x225800[_0xd9b0('0x2e')]);_0x285ca9[_0xd9b0('0x30')]=_[_0xd9b0('0x31')](_0x285ca9[_0xd9b0('0x32')],_0x285ca9[_0xd9b0('0x2e')]);_0x3a09aa[_0xd9b0('0x33')]=_['intersection'](_0x285ca9[_0xd9b0('0x32')],qs[_0xd9b0('0x34')](_0x225800['query'][_0xd9b0('0x34')]));_0x3a09aa[_0xd9b0('0x33')]=_0x3a09aa[_0xd9b0('0x33')]['length']?_0x3a09aa['attributes']:_0x285ca9[_0xd9b0('0x32')];if(_0x225800[_0xd9b0('0x2e')][_0xd9b0('0x41')]){_0x3a09aa[_0xd9b0('0x46')]=[{'all':!![]}];}_0x3a09aa=_[_0xd9b0('0x3d')]({},_0x3a09aa,_0x225800[_0xd9b0('0x3f')]);return db[_0xd9b0('0x40')]['find'](_0x3a09aa)[_0xd9b0('0x24')](handleEntityNotFound(_0x418113,null))['then'](respondWithResult(_0x418113,null))[_0xd9b0('0x47')](handleError(_0x418113,null));};exports[_0xd9b0('0x48')]=function(_0xd11f53,_0x32857f){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0xd11f53[_0xd9b0('0x49')],{})[_0xd9b0('0x24')](respondWithResult(_0x32857f,0xc9))['catch'](handleError(_0x32857f,null));};exports[_0xd9b0('0x4a')]=function(_0x982ccd,_0x2618a0){if(_0x982ccd[_0xd9b0('0x49')]['id']){delete _0x982ccd[_0xd9b0('0x49')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x4b')]({'where':{'id':_0x982ccd[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x2618a0,null))[_0xd9b0('0x24')](saveUpdates(_0x982ccd[_0xd9b0('0x49')],null))[_0xd9b0('0x24')](respondWithResult(_0x2618a0,null))[_0xd9b0('0x47')](handleError(_0x2618a0,null));};exports[_0xd9b0('0x4c')]=function(_0x39ca70,_0x795b17){return db['DeskField'][_0xd9b0('0x4b')]({'where':{'id':_0x39ca70[_0xd9b0('0x45')]['id']}})[_0xd9b0('0x24')](handleEntityNotFound(_0x795b17,null))[_0xd9b0('0x24')](removeEntity(_0x795b17,null))[_0xd9b0('0x47')](handleError(_0x795b17,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index b833fd1..019e3ec 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 _0x28da=['request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x4f750b,_0x4e3e43){var _0x918b39=function(_0x106d8f){while(--_0x106d8f){_0x4f750b['push'](_0x4f750b['shift']());}};_0x918b39(++_0x4e3e43);}(_0x28da,0x1bd));var _0xa28d=function(_0x537139,_0x2e9d24){_0x537139=_0x537139-0x0;var _0x179304=_0x28da[_0x537139];return _0x179304;};'use strict';var _=require(_0xa28d('0x0'));var util=require(_0xa28d('0x1'));var logger=require(_0xa28d('0x2'))(_0xa28d('0x3'));var moment=require(_0xa28d('0x4'));var BPromise=require('bluebird');var rp=require(_0xa28d('0x5'));var fs=require('fs');var path=require(_0xa28d('0x6'));var rimraf=require(_0xa28d('0x7'));var config=require(_0xa28d('0x8'));var attributes=require(_0xa28d('0x9'));module[_0xa28d('0xa')]=function(_0x37da1b,_0x2fd665){return _0x37da1b[_0xa28d('0xb')]('DeskField',attributes,{'tableName':_0xa28d('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xa28d('0xd'),_0xa28d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b86=['lodash','util','../../config/logger','api','moment','request-promise','path','./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField'];(function(_0x4572e1,_0x48282f){var _0x5a57d7=function(_0x1413a7){while(--_0x1413a7){_0x4572e1['push'](_0x4572e1['shift']());}};_0x5a57d7(++_0x48282f);}(_0x6b86,0xa9));var _0x66b8=function(_0xfc7786,_0x3fc5e9){_0xfc7786=_0xfc7786-0x0;var _0x2d5f07=_0x6b86[_0xfc7786];return _0x2d5f07;};'use strict';var _=require(_0x66b8('0x0'));var util=require(_0x66b8('0x1'));var logger=require(_0x66b8('0x2'))(_0x66b8('0x3'));var moment=require(_0x66b8('0x4'));var BPromise=require('bluebird');var rp=require(_0x66b8('0x5'));var fs=require('fs');var path=require(_0x66b8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x66b8('0x7'));module['exports']=function(_0x2e545c,_0x2d04b1){return _0x2e545c[_0x66b8('0x8')](_0x66b8('0x9'),attributes,{'tableName':_0x66b8('0xa'),'paranoid':![],'indexes':[{'name':_0x66b8('0xb'),'fields':[_0x66b8('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 8d15500..c510c7c 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 _0x788e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','randomstring'];(function(_0x16480d,_0xcfc38e){var _0x5a9988=function(_0x1a8185){while(--_0x1a8185){_0x16480d['push'](_0x16480d['shift']());}};_0x5a9988(++_0xcfc38e);}(_0x788e,0x12a));var _0xe788=function(_0x4451ed,_0x3fbaf3){_0x4451ed=_0x4451ed-0x0;var _0x436f04=_0x788e[_0x4451ed];return _0x436f04;};'use strict';var _=require(_0xe788('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe788('0x1'));var fs=require('fs');var Redis=require(_0xe788('0x2'));var db=require(_0xe788('0x3'))['db'];var utils=require(_0xe788('0x4'));var logger=require(_0xe788('0x5'))('rpc');var config=require(_0xe788('0x6'));var jayson=require(_0xe788('0x7'));var client=jayson[_0xe788('0x8')][_0xe788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x112bdc,_0x41332a,_0x314eee){return new BPromise(function(_0x3f37f9,_0x25d78e){return client[_0xe788('0xa')](_0x112bdc,_0x314eee)[_0xe788('0xb')](function(_0x5a8d96){logger[_0xe788('0xc')]('DeskField,\x20%s,\x20%s',_0x41332a,_0xe788('0xd'));logger['debug'](_0xe788('0xe'),_0x41332a,'request\x20sent',JSON['stringify'](_0x5a8d96));if(_0x5a8d96[_0xe788('0xf')]){if(_0x5a8d96[_0xe788('0xf')][_0xe788('0x10')]===0x1f4){logger['error'](_0xe788('0x11'),_0x41332a,_0x5a8d96['error'][_0xe788('0x12')]);return _0x25d78e(_0x5a8d96[_0xe788('0xf')][_0xe788('0x12')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x41332a,_0x5a8d96[_0xe788('0xf')][_0xe788('0x12')]);return _0x3f37f9(_0x5a8d96['error'][_0xe788('0x12')]);}else{logger[_0xe788('0xc')]('DeskField,\x20%s,\x20%s',_0x41332a,_0xe788('0xd'));_0x3f37f9(_0x5a8d96['result'][_0xe788('0x12')]);}})[_0xe788('0x13')](function(_0x158511){logger['error']('DeskField,\x20%s,\x20%s',_0x41332a,_0x158511);_0x25d78e(_0x158511);});});} \ No newline at end of file +var _0x6c74=['../../config/environment','jayson/promise','http','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','DeskField,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x28f91f,_0xbfbfa0){var _0x54eee6=function(_0x17e2aa){while(--_0x17e2aa){_0x28f91f['push'](_0x28f91f['shift']());}};_0x54eee6(++_0xbfbfa0);}(_0x6c74,0xb7));var _0x46c7=function(_0x4d5e64,_0x2982a6){_0x4d5e64=_0x4d5e64-0x0;var _0x3c5c61=_0x6c74[_0x4d5e64];return _0x3c5c61;};'use strict';var _=require(_0x46c7('0x0'));var util=require(_0x46c7('0x1'));var moment=require(_0x46c7('0x2'));var BPromise=require(_0x46c7('0x3'));var rs=require(_0x46c7('0x4'));var fs=require('fs');var Redis=require(_0x46c7('0x5'));var db=require(_0x46c7('0x6'))['db'];var utils=require(_0x46c7('0x7'));var logger=require('../../config/logger')(_0x46c7('0x8'));var config=require(_0x46c7('0x9'));var jayson=require(_0x46c7('0xa'));var client=jayson['client'][_0x46c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13ba54,_0x3b5d98,_0x38b38d){return new BPromise(function(_0x398797,_0x3a925a){return client[_0x46c7('0xc')](_0x13ba54,_0x38b38d)[_0x46c7('0xd')](function(_0xa097cb){logger[_0x46c7('0xe')]('DeskField,\x20%s,\x20%s',_0x3b5d98,'request\x20sent');logger[_0x46c7('0xf')](_0x46c7('0x10'),_0x3b5d98,'request\x20sent',JSON[_0x46c7('0x11')](_0xa097cb));if(_0xa097cb[_0x46c7('0x12')]){if(_0xa097cb['error']['code']===0x1f4){logger[_0x46c7('0x12')]('DeskField,\x20%s,\x20%s',_0x3b5d98,_0xa097cb[_0x46c7('0x12')][_0x46c7('0x13')]);return _0x3a925a(_0xa097cb[_0x46c7('0x12')][_0x46c7('0x13')]);}logger[_0x46c7('0x12')]('DeskField,\x20%s,\x20%s',_0x3b5d98,_0xa097cb[_0x46c7('0x12')][_0x46c7('0x13')]);return _0x398797(_0xa097cb['error'][_0x46c7('0x13')]);}else{logger[_0x46c7('0xe')](_0x46c7('0x14'),_0x3b5d98,_0x46c7('0x15'));_0x398797(_0xa097cb[_0x46c7('0x16')]['message']);}})[_0x46c7('0x17')](function(_0x2ff1ef){logger[_0x46c7('0x12')]('DeskField,\x20%s,\x20%s',_0x3b5d98,_0x2ff1ef);_0x3a925a(_0x2ff1ef);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6be8348..963eb5d 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 _0x24f4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','put','delete','destroy','multer','util','express','Router','fs-extra'];(function(_0x27d21c,_0x55114a){var _0x4a209b=function(_0x2e4d75){while(--_0x2e4d75){_0x27d21c['push'](_0x27d21c['shift']());}};_0x4a209b(++_0x55114a);}(_0x24f4,0x136));var _0x424f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24f4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x424f('0x0'));var util=require(_0x424f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x424f('0x2'));var router=express[_0x424f('0x3')]();var fs_extra=require(_0x424f('0x4'));var auth=require(_0x424f('0x5'));var interaction=require(_0x424f('0x6'));var config=require(_0x424f('0x7'));var controller=require(_0x424f('0x8'));router[_0x424f('0x9')]('/',auth[_0x424f('0xa')](),controller[_0x424f('0xb')]);router['get'](_0x424f('0xc'),auth[_0x424f('0xa')](),controller[_0x424f('0xd')]);router['get'](_0x424f('0xe'),auth[_0x424f('0xa')](),controller['getConfigurations']);router[_0x424f('0x9')](_0x424f('0xf'),auth[_0x424f('0xa')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x424f('0x10')](_0x424f('0xe'),auth['isAuthenticated'](),controller[_0x424f('0x11')]);router[_0x424f('0x12')](_0x424f('0xc'),auth[_0x424f('0xa')](),controller['update']);router[_0x424f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x424f('0x14')]);module['exports']=router; \ No newline at end of file +var _0x07c9=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x07c9,0x1bd));var _0x907c=function(_0x3e8be8,_0x1edb94){_0x3e8be8=_0x3e8be8-0x0;var _0x54f288=_0x07c9[_0x3e8be8];return _0x54f288;};'use strict';var multer=require('multer');var util=require(_0x907c('0x0'));var path=require(_0x907c('0x1'));var timeout=require(_0x907c('0x2'));var express=require(_0x907c('0x3'));var router=express[_0x907c('0x4')]();var fs_extra=require(_0x907c('0x5'));var auth=require(_0x907c('0x6'));var interaction=require(_0x907c('0x7'));var config=require(_0x907c('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x907c('0x9')]('/',auth[_0x907c('0xa')](),controller[_0x907c('0xb')]);router[_0x907c('0x9')](_0x907c('0xc'),auth[_0x907c('0xa')](),controller['show']);router[_0x907c('0x9')](_0x907c('0xd'),auth[_0x907c('0xa')](),controller[_0x907c('0xe')]);router[_0x907c('0x9')](_0x907c('0xf'),auth[_0x907c('0xa')](),controller[_0x907c('0x10')]);router[_0x907c('0x11')]('/',auth[_0x907c('0xa')](),controller[_0x907c('0x12')]);router[_0x907c('0x11')]('/:id/configurations',auth[_0x907c('0xa')](),controller[_0x907c('0x13')]);router[_0x907c('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x907c('0x15')](_0x907c('0xc'),auth['isAuthenticated'](),controller[_0x907c('0x16')]);module[_0x907c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 54ea427..6e6f1b8 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 _0x489a=['exports','STRING','sequelize'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x489a,0x1c4));var _0xa489=function(_0x4b7c65,_0x48df1d){_0x4b7c65=_0x4b7c65-0x0;var _0x16a07f=_0x489a[_0x4b7c65];return _0x16a07f;};'use strict';var Sequelize=require(_0xa489('0x0'));module[_0xa489('0x1')]={'name':{'type':Sequelize[_0xa489('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa489('0x2')]},'remoteUri':{'type':Sequelize[_0xa489('0x2')]},'tenantId':{'type':Sequelize[_0xa489('0x2')]},'clientId':{'type':Sequelize[_0xa489('0x2')]},'clientSecret':{'type':Sequelize[_0xa489('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa489('0x2')]}}; \ No newline at end of file +var _0x6655=['sequelize','exports','STRING'];(function(_0x1d5b53,_0xe66d46){var _0x2708dc=function(_0x56ac9e){while(--_0x56ac9e){_0x1d5b53['push'](_0x1d5b53['shift']());}};_0x2708dc(++_0xe66d46);}(_0x6655,0x9c));var _0x5665=function(_0x42b363,_0x26dfc8){_0x42b363=_0x42b363-0x0;var _0x334947=_0x6655[_0x42b363];return _0x334947;};'use strict';var Sequelize=require(_0x5665('0x0'));module[_0x5665('0x1')]={'name':{'type':Sequelize[_0x5665('0x2')]},'username':{'type':Sequelize[_0x5665('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5665('0x2')]},'tenantId':{'type':Sequelize[_0x5665('0x2')]},'clientId':{'type':Sequelize[_0x5665('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5665('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index e435d69..0e56217 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 _0x5697=['substring','PicklistAttributeMetadata','push','all','forEach','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','false','eml-format','zip-dir','fast-json-patch','request-promise','sox','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','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','json','apply','save','update','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','Dynamics365Configuration','hasOwnProperty','addConfiguration','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','Descriptions','ticketType','incident','Incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','resolveby','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','findOne','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','@odata.type'];(function(_0x56fdca,_0x52041f){var _0x2cb5d8=function(_0x52f2d8){while(--_0x52f2d8){_0x56fdca['push'](_0x56fdca['shift']());}};_0x2cb5d8(++_0x52041f);}(_0x5697,0x1b5));var _0x7569=function(_0x1a73f7,_0x274c12){_0x1a73f7=_0x1a73f7-0x0;var _0x3570fa=_0x5697[_0x1a73f7];return _0x3570fa;};'use strict';var emlformat=require(_0x7569('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7569('0x1'));var jsonpatch=require(_0x7569('0x2'));var rp=require(_0x7569('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7569('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7569('0x5'));var squel=require(_0x7569('0x6'));var crypto=require(_0x7569('0x7'));var jsforce=require(_0x7569('0x8'));var deskjs=require(_0x7569('0x9'));var toCsv=require(_0x7569('0xa'));var querystring=require('querystring');var Papa=require(_0x7569('0xb'));var Redis=require('ioredis');var authService=require(_0x7569('0xc'));var qs=require(_0x7569('0xd'));var as=require(_0x7569('0xe'));var hardwareService=require(_0x7569('0xf'));var logger=require(_0x7569('0x10'))(_0x7569('0x11'));var utils=require(_0x7569('0x12'));var config=require(_0x7569('0x13'));var licenseUtil=require(_0x7569('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7569('0x15'));function respondWithStatusCode(_0x3def0f,_0x411e47){_0x411e47=_0x411e47||0xcc;return function(_0xb4e76e){if(_0xb4e76e){return _0x3def0f[_0x7569('0x16')](_0x411e47);}return _0x3def0f[_0x7569('0x17')](_0x411e47)['end']();};}function respondWithResult(_0x1ac382,_0x3d6e8c){_0x3d6e8c=_0x3d6e8c||0xc8;return function(_0x10af23){if(_0x10af23){return _0x1ac382[_0x7569('0x17')](_0x3d6e8c)['json'](_0x10af23);}};}function respondWithFilteredResult(_0x358b10,_0x25299a){return function(_0x507670){if(_0x507670){var _0x4936e3=typeof _0x25299a[_0x7569('0x18')]===_0x7569('0x19')&&typeof _0x25299a['limit']===_0x7569('0x19');var _0xf382ad=_0x507670['count'];var _0x39a02d=_0x4936e3?0x0:_0x25299a[_0x7569('0x18')];var _0x2fee4d=_0x4936e3?_0x507670[_0x7569('0x1a')]:_0x25299a[_0x7569('0x18')]+_0x25299a[_0x7569('0x1b')];var _0x7dc3dc;if(_0x2fee4d>=_0xf382ad){_0x2fee4d=_0xf382ad;_0x7dc3dc=0xc8;}else{_0x7dc3dc=0xce;}_0x358b10['status'](_0x7dc3dc);return _0x358b10['set']('Content-Range',_0x39a02d+'-'+_0x2fee4d+'/'+_0xf382ad)[_0x7569('0x1c')](_0x507670);}return null;};}function patchUpdates(_0x4c36c9){return function(_0x303c22){try{jsonpatch[_0x7569('0x1d')](_0x303c22,_0x4c36c9,!![]);}catch(_0x58aa33){return BPromise['reject'](_0x58aa33);}return _0x303c22[_0x7569('0x1e')]();};}function saveUpdates(_0x5ea4f8,_0x4278d1){return function(_0x58a59f){if(_0x58a59f){return _0x58a59f[_0x7569('0x1f')](_0x5ea4f8)[_0x7569('0x20')](function(_0xf2d6c0){return _0xf2d6c0;});}return null;};}function removeEntity(_0x2e1df7,_0x76e4b2){return function(_0x34af47){if(_0x34af47){return _0x34af47['destroy']()[_0x7569('0x20')](function(){_0x2e1df7[_0x7569('0x17')](0xcc)[_0x7569('0x21')]();});}};}function handleEntityNotFound(_0x3b8346,_0x34147b){return function(_0x37539d){if(!_0x37539d){_0x3b8346[_0x7569('0x16')](0x194);}return _0x37539d;};}function handleError(_0x1820bd,_0x101702){_0x101702=_0x101702||0x1f4;return function(_0x1134b4){logger[_0x7569('0x22')](_0x1134b4[_0x7569('0x23')]);if(_0x1134b4[_0x7569('0x24')]){delete _0x1134b4[_0x7569('0x24')];}_0x1820bd['status'](_0x101702)[_0x7569('0x25')](_0x1134b4);};}exports[_0x7569('0x26')]=function(_0x5d5e1e,_0xdf5df9){var _0x1c2a57={},_0x111562={},_0x33f889={'count':0x0,'rows':[]};var _0x7ac8f9=_[_0x7569('0x27')](db['Dynamics365Account']['rawAttributes'],function(_0x5f1ce4){return{'name':_0x5f1ce4[_0x7569('0x28')],'type':_0x5f1ce4[_0x7569('0x29')][_0x7569('0x2a')]};});_0x111562[_0x7569('0x2b')]=_[_0x7569('0x27')](_0x7ac8f9,_0x7569('0x24'));_0x111562[_0x7569('0x2c')]=_[_0x7569('0x2d')](_0x5d5e1e['query']);_0x111562[_0x7569('0x2e')]=_[_0x7569('0x2f')](_0x111562['model'],_0x111562[_0x7569('0x2c')]);_0x1c2a57[_0x7569('0x30')]=_[_0x7569('0x2f')](_0x111562[_0x7569('0x2b')],qs[_0x7569('0x31')](_0x5d5e1e[_0x7569('0x2c')][_0x7569('0x31')]));_0x1c2a57[_0x7569('0x30')]=_0x1c2a57[_0x7569('0x30')][_0x7569('0x32')]?_0x1c2a57[_0x7569('0x30')]:_0x111562['model'];if(!_0x5d5e1e['query']['hasOwnProperty'](_0x7569('0x33'))){_0x1c2a57[_0x7569('0x1b')]=qs['limit'](_0x5d5e1e['query'][_0x7569('0x1b')]);_0x1c2a57[_0x7569('0x18')]=qs[_0x7569('0x18')](_0x5d5e1e['query']['offset']);}_0x1c2a57[_0x7569('0x34')]=qs[_0x7569('0x35')](_0x5d5e1e[_0x7569('0x2c')][_0x7569('0x35')]);_0x1c2a57[_0x7569('0x36')]=qs['filters'](_[_0x7569('0x37')](_0x5d5e1e[_0x7569('0x2c')],_0x111562[_0x7569('0x2e')]),_0x7ac8f9);if(_0x5d5e1e[_0x7569('0x2c')]['filter']){_0x1c2a57[_0x7569('0x36')]=_[_0x7569('0x38')](_0x1c2a57['where'],{'$or':_['map'](_0x7ac8f9,function(_0x516a6b){if(_0x516a6b[_0x7569('0x29')]!==_0x7569('0x39')){var _0x31fddd={};_0x31fddd[_0x516a6b[_0x7569('0x24')]]={'$like':'%'+_0x5d5e1e[_0x7569('0x2c')][_0x7569('0x3a')]+'%'};return _0x31fddd;}})});}_0x1c2a57=_[_0x7569('0x38')]({},_0x1c2a57,_0x5d5e1e[_0x7569('0x3b')]);var _0x286368={'where':_0x1c2a57['where']};return db[_0x7569('0x3c')]['count'](_0x286368)[_0x7569('0x20')](function(_0x377061){_0x33f889[_0x7569('0x1a')]=_0x377061;if(_0x5d5e1e[_0x7569('0x2c')][_0x7569('0x3d')]){_0x1c2a57[_0x7569('0x3e')]=[{'all':!![]}];}return db[_0x7569('0x3c')][_0x7569('0x3f')](_0x1c2a57);})[_0x7569('0x20')](function(_0x52c799){_0x33f889[_0x7569('0x40')]=_0x52c799;return _0x33f889;})[_0x7569('0x20')](respondWithFilteredResult(_0xdf5df9,_0x1c2a57))[_0x7569('0x41')](handleError(_0xdf5df9,null));};exports[_0x7569('0x42')]=function(_0x3fe5f6,_0x3655e0){var _0x4013e1={'raw':![],'where':{'id':_0x3fe5f6[_0x7569('0x43')]['id']}},_0x4cc17c={};_0x4cc17c[_0x7569('0x2b')]=_['keys'](db['Dynamics365Account'][_0x7569('0x44')]);_0x4cc17c[_0x7569('0x2c')]=_[_0x7569('0x2d')](_0x3fe5f6[_0x7569('0x2c')]);_0x4cc17c['filters']=_[_0x7569('0x2f')](_0x4cc17c['model'],_0x4cc17c[_0x7569('0x2c')]);_0x4013e1[_0x7569('0x30')]=_[_0x7569('0x2f')](_0x4cc17c['model'],qs['fields'](_0x3fe5f6[_0x7569('0x2c')][_0x7569('0x31')]));_0x4013e1['attributes']=_0x4013e1[_0x7569('0x30')][_0x7569('0x32')]?_0x4013e1[_0x7569('0x30')]:_0x4cc17c['model'];if(_0x3fe5f6['query'][_0x7569('0x3d')]){_0x4013e1['include']=[{'all':!![]}];}_0x4013e1=_[_0x7569('0x38')]({},_0x4013e1,_0x3fe5f6[_0x7569('0x3b')]);return db[_0x7569('0x3c')][_0x7569('0x45')](_0x4013e1)[_0x7569('0x20')](handleEntityNotFound(_0x3655e0,null))[_0x7569('0x20')](respondWithResult(_0x3655e0,null))[_0x7569('0x41')](handleError(_0x3655e0,null));};exports[_0x7569('0x46')]=function(_0x50184f,_0xf3eaca){return db[_0x7569('0x3c')][_0x7569('0x46')](_0x50184f[_0x7569('0x47')],{})[_0x7569('0x20')](respondWithResult(_0xf3eaca,0xc9))[_0x7569('0x41')](handleError(_0xf3eaca,null));};exports[_0x7569('0x1f')]=function(_0x2ef4d2,_0x3f5429){if(_0x2ef4d2[_0x7569('0x47')]['id']){delete _0x2ef4d2[_0x7569('0x47')]['id'];}return db[_0x7569('0x3c')]['find']({'where':{'id':_0x2ef4d2['params']['id']}})[_0x7569('0x20')](handleEntityNotFound(_0x3f5429,null))['then'](saveUpdates(_0x2ef4d2['body'],null))['then'](respondWithResult(_0x3f5429,null))['catch'](handleError(_0x3f5429,null));};exports[_0x7569('0x48')]=function(_0x38db7c,_0x5d4260){return db['Dynamics365Account'][_0x7569('0x45')]({'where':{'id':_0x38db7c[_0x7569('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d4260,null))[_0x7569('0x20')](removeEntity(_0x5d4260,null))['catch'](handleError(_0x5d4260,null));};exports[_0x7569('0x49')]=function(_0x3d92b1,_0x3761aa,_0x200388){var _0x50600a={};var _0xb388b0={};var _0x2a5971;var _0x4fe90b;return db[_0x7569('0x3c')]['findOne']({'where':{'id':_0x3d92b1[_0x7569('0x43')]['id']}})[_0x7569('0x20')](handleEntityNotFound(_0x3761aa,null))['then'](function(_0x40fef3){if(_0x40fef3){_0x2a5971=_0x40fef3;_0xb388b0[_0x7569('0x2b')]=_[_0x7569('0x2d')](db[_0x7569('0x4a')]['rawAttributes']);_0xb388b0['query']=_['keys'](_0x3d92b1[_0x7569('0x2c')]);_0xb388b0[_0x7569('0x2e')]=_['intersection'](_0xb388b0['model'],_0xb388b0[_0x7569('0x2c')]);_0x50600a[_0x7569('0x30')]=_[_0x7569('0x2f')](_0xb388b0[_0x7569('0x2b')],qs['fields'](_0x3d92b1[_0x7569('0x2c')][_0x7569('0x31')]));_0x50600a[_0x7569('0x30')]=_0x50600a[_0x7569('0x30')][_0x7569('0x32')]?_0x50600a[_0x7569('0x30')]:_0xb388b0[_0x7569('0x2b')];_0x50600a[_0x7569('0x34')]=qs['sort'](_0x3d92b1['query']['sort']);_0x50600a[_0x7569('0x36')]=qs[_0x7569('0x2e')](_[_0x7569('0x37')](_0x3d92b1[_0x7569('0x2c')],_0xb388b0[_0x7569('0x2e')]));if(_0x3d92b1[_0x7569('0x2c')][_0x7569('0x3a')]){_0x50600a[_0x7569('0x36')]=_[_0x7569('0x38')](_0x50600a['where'],{'$or':_[_0x7569('0x27')](_0x50600a['attributes'],function(_0x5d8b12){var _0x2eed01={};_0x2eed01[_0x5d8b12]={'$like':'%'+_0x3d92b1[_0x7569('0x2c')]['filter']+'%'};return _0x2eed01;})});}_0x50600a=_[_0x7569('0x38')]({},_0x50600a,_0x3d92b1['options']);return _0x2a5971[_0x7569('0x49')](_0x50600a);}})[_0x7569('0x20')](function(_0x34fd9a){if(_0x34fd9a){_0x4fe90b=_0x34fd9a[_0x7569('0x32')];if(!_0x3d92b1['query'][_0x7569('0x4b')]('nolimit')){_0x50600a[_0x7569('0x1b')]=qs[_0x7569('0x1b')](_0x3d92b1[_0x7569('0x2c')][_0x7569('0x1b')]);_0x50600a[_0x7569('0x18')]=qs['offset'](_0x3d92b1['query'][_0x7569('0x18')]);}return _0x2a5971['getConfigurations'](_0x50600a);}})['then'](function(_0x1d0b08){if(_0x1d0b08){return _0x1d0b08?{'count':_0x4fe90b,'rows':_0x1d0b08}:null;}})['then'](respondWithResult(_0x3761aa,null))['catch'](handleError(_0x3761aa,null));};exports[_0x7569('0x4c')]=function(_0x3493dd,_0x3323c2,_0x11649d){if(_0x3493dd[_0x7569('0x47')]['id']){delete _0x3493dd['body']['id'];}return db[_0x7569('0x3c')]['findOne']({'where':{'id':_0x3493dd['params']['id']}})[_0x7569('0x20')](handleEntityNotFound(_0x3323c2,null))[_0x7569('0x20')](function(_0x36fa16){if(_0x36fa16){_0x3493dd['body']['AccountId']=_0x36fa16['id'];_0x3493dd['body']['Subjects']=integrations[_0x7569('0x4d')](_0x3493dd[_0x7569('0x47')][_0x7569('0x4e')],_0x3493dd[_0x7569('0x47')][_0x7569('0x29')]);_0x3493dd[_0x7569('0x47')]['Descriptions']=integrations[_0x7569('0x4f')](_0x3493dd[_0x7569('0x47')][_0x7569('0x4e')],_0x3493dd[_0x7569('0x47')][_0x7569('0x29')]);return db[_0x7569('0x4a')]['create'](_0x3493dd['body'],{'include':[{'model':db[_0x7569('0x50')],'as':_0x7569('0x51')},{'model':db['Dynamics365Field'],'as':_0x7569('0x52')}]});}return null;})[_0x7569('0x20')](respondWithResult(_0x3323c2,null))[_0x7569('0x41')](handleError(_0x3323c2,null));};exports['getFields']=function(_0x3533ca,_0x57af87,_0x475d23){var _0x15fafc=_0x3533ca[_0x7569('0x2c')][_0x7569('0x53')];var _0x551987=_0x15fafc===_0x7569('0x54')?_0x7569('0x55'):_0x7569('0x56');var _0x10362b='';var _0x530971='';var _0x4bfa75='';var _0x27893e='';var _0x488da9='';var _0x27ce3d='';var _0x3dc17a='';var _0x2d2a7a='';var _0x5061a2=[_0x7569('0x57'),_0x7569('0x58'),'customerid','ownerid',_0x7569('0x59'),_0x7569('0x5a'),_0x7569('0x5b'),_0x7569('0x5c'),_0x7569('0x5d'),_0x7569('0x5e')];var _0x1c5174=['accountidname',_0x7569('0x5f'),_0x7569('0x60'),_0x7569('0x61'),_0x7569('0x62'),_0x7569('0x63'),'contractdetailidname',_0x7569('0x64'),'createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname',_0x7569('0x65'),_0x7569('0x66'),_0x7569('0x67'),_0x7569('0x68'),_0x7569('0x69'),_0x7569('0x6a'),_0x7569('0x6b'),_0x7569('0x6c'),_0x7569('0x6d'),_0x7569('0x6e'),_0x7569('0x6f'),'escalatedon','exchangerate','firstresponsebykpiidname',_0x7569('0x70'),_0x7569('0x71'),_0x7569('0x72'),_0x7569('0x73'),_0x7569('0x74'),'masteridname',_0x7569('0x75'),_0x7569('0x76'),_0x7569('0x77'),_0x7569('0x78'),_0x7569('0x79'),'modifiedonbehalfbyname',_0x7569('0x7a'),_0x7569('0x7b'),'msdyn_iotalertname',_0x7569('0x7c'),_0x7569('0x7d'),'overriddencreatedon',_0x7569('0x7e'),_0x7569('0x7f'),_0x7569('0x80'),_0x7569('0x81'),_0x7569('0x82'),'primarycontactidyominame',_0x7569('0x83'),_0x7569('0x84'),'productserialnumber',_0x7569('0x85'),'resolvebykpiidname','responseby',_0x7569('0x86'),_0x7569('0x87'),'sentimentvalue','slainvokedidname',_0x7569('0x88'),_0x7569('0x89'),_0x7569('0x8a'),_0x7569('0x8b'),_0x7569('0x8c'),_0x7569('0x8d'),_0x7569('0x8e'),_0x7569('0x8f'),_0x7569('0x90'),'utcconversiontimezonecode',_0x7569('0x91')];var _0x4a3490=_0x5061a2['concat'](_0x1c5174);return db[_0x7569('0x3c')][_0x7569('0x92')]({'where':{'id':_0x3533ca[_0x7569('0x43')]['id']},'attributes':['id',_0x7569('0x93'),_0x7569('0x94'),_0x7569('0x95'),_0x7569('0x96'),_0x7569('0x97'),_0x7569('0x98')]})[_0x7569('0x20')](handleEntityNotFound(_0x57af87,null))[_0x7569('0x20')](function(_0x56046d){if(_0x56046d){_0x2d2a7a=_0x56046d[_0x7569('0x95')];var _0x416289=_0x2d2a7a[_0x7569('0x99')](-0x1);if(_0x416289==='/'){_0x2d2a7a=_0x2d2a7a['substring'](0x0,_0x2d2a7a[_0x7569('0x9a')](_0x416289));}_0x3dc17a=util[_0x7569('0x9b')](_0x7569('0x9c'),_0x2d2a7a);var _0x423fae={'method':_0x7569('0x9d'),'uri':'https://login.microsoftonline.com/'+_0x56046d[_0x7569('0x96')]+_0x7569('0x9e'),'form':{'client_id':_0x56046d[_0x7569('0x97')],'resource':_0x2d2a7a,'username':_0x56046d['username'],'password':_0x56046d[_0x7569('0x94')],'grant_type':'password','client_secret':_0x56046d[_0x7569('0x98')]},'json':!![]};return rp(_0x423fae);}})['then'](function(_0x354168){_0x27ce3d=_0x354168[_0x7569('0x9f')];var _0x37a64b={'method':'GET','uri':encodeURI(_0x3dc17a+_0x7569('0xa0')+_0x551987+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x27ce3d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x37a64b);})['then'](function(_0x597984){var _0x441d37=_0x597984['value'][0x0];var _0x580f13=_0x441d37[_0x7569('0xa1')];var _0x3c264f={'method':_0x7569('0xa2'),'uri':_0x3dc17a+_0x7569('0xa3')+_0x580f13+_0x7569('0xa4'),'headers':{'Authorization':_0x7569('0xa5')+_0x27ce3d,'If-None-Match':null,'OData-Version':_0x7569('0xa6')},'json':!![]};return rp(_0x3c264f);})[_0x7569('0x20')](function(_0x5062e7){_0x10362b=_0x5062e7;_0x530971=_0x10362b[_0x7569('0xa7')];_0x530971=_[_0x7569('0xa8')](_0x530971,function(_0x31f8bd){return!_0x4a3490[_0x7569('0xa9')](_0x31f8bd[_0x7569('0xaa')]);});var _0x4165a3=[];var _0x418b6a=[];_0x530971['forEach'](function(_0x472635){if(_0x472635[_0x7569('0xab')]){var _0x4f227a=_0x472635[_0x7569('0xab')][_0x7569('0xac')](_0x472635[_0x7569('0xab')][_0x7569('0x9a')]('.')+0x1);if(_0x4f227a===_0x7569('0xad')){_0x4165a3[_0x7569('0xae')](getSelectList(_0x3dc17a,_0x15fafc,_0x418b6a,_0x10362b[_0x7569('0xa1')],_0x472635[_0x7569('0xa1')],_0x27ce3d));}}});return Promise[_0x7569('0xaf')](_0x4165a3);})[_0x7569('0x20')](function(_0x44f4a0){_0x4bfa75=_0x44f4a0[0x0];var _0x327e70=[];var _0x4d4bcb=[];_0x530971[_0x7569('0xb0')](function(_0x34be7e){if(!_['isNil'](_0x34be7e[_0x7569('0xab')])){var _0x2ed37a=_0x34be7e[_0x7569('0xab')][_0x7569('0xac')](_0x34be7e[_0x7569('0xab')][_0x7569('0x9a')]('.')+0x1);if(_0x2ed37a===_0x7569('0xb1')){_0x327e70[_0x7569('0xae')](getBooleanList(_0x3dc17a,_0x15fafc,_0x4d4bcb,_0x10362b[_0x7569('0xa1')],_0x34be7e[_0x7569('0xa1')],_0x27ce3d));}}});return Promise[_0x7569('0xaf')](_0x327e70);})[_0x7569('0x20')](function(_0x25bd28){_0x27893e=_0x25bd28[0x0];var _0x55c359=[];var _0xbd08a6=[];_0x530971[_0x7569('0xb0')](function(_0x4f349e){if(_0x4f349e[_0x7569('0xab')]){var _0x444272=_0x4f349e[_0x7569('0xab')]['substring'](_0x4f349e[_0x7569('0xab')][_0x7569('0x9a')]('.')+0x1);if(_0x444272===_0x7569('0xb2')||_0x444272===_0x7569('0xb3')||_0x444272===_0x7569('0xb4')||_0x444272===_0x7569('0xb5')||_0x444272===_0x7569('0xb6')||_0x444272===_0x7569('0xb7')||_0x444272===_0x7569('0xb8')||_0x444272===_0x7569('0xb9')||_0x444272===_0x7569('0xba')||_0x444272===_0x7569('0xbb')){_0x55c359['push'](getInputList(_0x3dc17a,_0x15fafc,_0x444272,_0xbd08a6,_0x10362b[_0x7569('0xa1')],_0x4f349e[_0x7569('0xa1')],_0x27ce3d));}}});return Promise[_0x7569('0xaf')](_0x55c359);})[_0x7569('0x20')](function(_0x18922e){_0x488da9=_0x18922e[0x0];var _0x2f67a2=_0x4bfa75['concat'](_0x27893e)[_0x7569('0xbc')](_0x488da9);var _0x5eb6f9={'count':_0x2f67a2[_0x7569('0x32')],'rows':_0x2f67a2};return _0x5eb6f9;})[_0x7569('0x20')](respondWithResult(_0x57af87,null))[_0x7569('0x41')](function(_0x3ffae2){var _0x361f72=_0x3533ca[_0x7569('0x2c')]['test']?0x1f4:_0x3ffae2['statusCode']||0x1f4;logger[_0x7569('0x22')](_0x3ffae2[_0x7569('0x23')]);delete _0x3ffae2[_0x7569('0x24')];if(_0x361f72===0x191){_0x361f72=0x190;}_0x57af87['status'](_0x361f72)[_0x7569('0x25')](_0x3533ca[_0x7569('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3ffae2[_0x7569('0xbd')]}:_0x3ffae2);});};function getSelectList(_0x62cea2,_0x36ce26,_0x766cad,_0x156444,_0x230ee9,_0x13da04){var _0x5d3bc9={'method':_0x7569('0xa2'),'uri':_0x62cea2+_0x7569('0xa3')+_0x156444+_0x7569('0xbe')+_0x230ee9+_0x7569('0xbf')+_0x7569('0xc0'),'headers':{'Authorization':_0x7569('0xa5')+_0x13da04,'If-None-Match':null,'OData-Version':_0x7569('0xa6')},'json':!![]};return rp(_0x5d3bc9)[_0x7569('0x20')](function(_0x37c26d){var _0x30360e=[];var _0x2135cf=_0x37c26d['OptionSet'][_0x7569('0xc1')];_0x2135cf[_0x7569('0xb0')](function(_0x96334e){_0x30360e[_0x7569('0xae')]({'name':_0x96334e['Label'][_0x7569('0xc2')][_0x7569('0xc3')],'value':String(_0x96334e[_0x7569('0xc4')])});});var _0x160ee7={'id':_0x36ce26+'_'+_0x37c26d[_0x7569('0xaa')],'name':_0x37c26d[_0x7569('0xc5')][_0x7569('0xc2')]['Label'],'custom':![],'options':_0x30360e};_0x766cad[_0x7569('0xae')](_0x160ee7);return _0x766cad;});}function getBooleanList(_0x1479bd,_0x227a64,_0x2bb75c,_0xe0b217,_0x538fe8,_0x39ce5c){var _0x5676e9={'method':_0x7569('0xa2'),'uri':_0x1479bd+_0x7569('0xa3')+_0xe0b217+')/Attributes('+_0x538fe8+_0x7569('0xc6'),'headers':{'Authorization':_0x7569('0xa5')+_0x39ce5c,'If-None-Match':null,'OData-Version':_0x7569('0xa6')},'json':!![]};return rp(_0x5676e9)[_0x7569('0x20')](function(_0x3e0180){var _0xb88d29=[];_0xb88d29[_0x7569('0xae')]({'name':_0x3e0180[_0x7569('0xc7')][_0x7569('0xc8')][_0x7569('0xc3')]['UserLocalizedLabel'][_0x7569('0xc3')],'value':_0x7569('0xc9')},{'name':_0x3e0180[_0x7569('0xc7')]['FalseOption'][_0x7569('0xc3')][_0x7569('0xc2')]['Label'],'value':_0x7569('0xca')});var _0x5e58fb={'id':_0x227a64+'_'+_0x3e0180[_0x7569('0xaa')],'name':_0x3e0180[_0x7569('0xc5')][_0x7569('0xc2')]['Label'],'custom':![],'options':_0xb88d29};_0x2bb75c[_0x7569('0xae')](_0x5e58fb);return _0x2bb75c;});}function getInputList(_0x469ef8,_0x16616b,_0x433f56,_0x258e23,_0xa8b7ad,_0x5be6af,_0xe0f3e){var _0x36eb23={'method':_0x7569('0xa2'),'uri':_0x469ef8+_0x7569('0xa3')+_0xa8b7ad+_0x7569('0xbe')+_0x5be6af+')/Microsoft.Dynamics.CRM.'+_0x433f56+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x7569('0xa5')+_0xe0f3e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x36eb23)[_0x7569('0x20')](function(_0x535e18){var _0x1de22a={'id':_0x16616b+'_'+_0x535e18[_0x7569('0xaa')],'name':_0x535e18[_0x7569('0xc5')][_0x7569('0xc2')]?_0x535e18[_0x7569('0xc5')][_0x7569('0xc2')][_0x7569('0xc3')]:_0x535e18[_0x7569('0xaa')],'custom':![],'options':[]};_0x258e23['push'](_0x1de22a);return _0x258e23;});} \ No newline at end of file +var _0xa7dc=['importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientId','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','4.0','OptionSet','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','attributes','options','create','body','find','findOne','Dynamics365Configuration','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ticketType','incident','Incident','title','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby'];(function(_0x1a6e19,_0x1b8010){var _0x1bdf83=function(_0x5610d5){while(--_0x5610d5){_0x1a6e19['push'](_0x1a6e19['shift']());}};_0x1bdf83(++_0x1b8010);}(_0xa7dc,0x11d));var _0xca7d=function(_0x15aae7,_0x1ec22c){_0x15aae7=_0x15aae7-0x0;var _0x68dd54=_0xa7dc[_0x15aae7];return _0x68dd54;};'use strict';var emlformat=require(_0xca7d('0x0'));var rimraf=require(_0xca7d('0x1'));var zipdir=require(_0xca7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca7d('0x3'));var moment=require('moment');var BPromise=require(_0xca7d('0x4'));var Mustache=require(_0xca7d('0x5'));var util=require(_0xca7d('0x6'));var path=require(_0xca7d('0x7'));var sox=require(_0xca7d('0x8'));var csv=require(_0xca7d('0x9'));var ejs=require(_0xca7d('0xa'));var fs=require('fs');var fs_extra=require(_0xca7d('0xb'));var _=require('lodash');var squel=require(_0xca7d('0xc'));var crypto=require(_0xca7d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xca7d('0xe'));var toCsv=require(_0xca7d('0x9'));var querystring=require(_0xca7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xca7d('0x10'));var authService=require(_0xca7d('0x11'));var qs=require(_0xca7d('0x12'));var as=require(_0xca7d('0x13'));var hardwareService=require(_0xca7d('0x14'));var logger=require('../../config/logger')(_0xca7d('0x15'));var utils=require('../../config/utils');var config=require(_0xca7d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xca7d('0x17'))['db'];var integrations=require(_0xca7d('0x18'));function respondWithStatusCode(_0x3b8467,_0x2c3730){_0x2c3730=_0x2c3730||0xcc;return function(_0x4c1618){if(_0x4c1618){return _0x3b8467['sendStatus'](_0x2c3730);}return _0x3b8467['status'](_0x2c3730)[_0xca7d('0x19')]();};}function respondWithResult(_0x36f922,_0x3d8e7b){_0x3d8e7b=_0x3d8e7b||0xc8;return function(_0x39caec){if(_0x39caec){return _0x36f922[_0xca7d('0x1a')](_0x3d8e7b)[_0xca7d('0x1b')](_0x39caec);}};}function respondWithFilteredResult(_0x369923,_0x37bae3){return function(_0x254305){if(_0x254305){var _0x1a6cb7=typeof _0x37bae3[_0xca7d('0x1c')]===_0xca7d('0x1d')&&typeof _0x37bae3['limit']==='undefined';var _0x26e7f6=_0x254305[_0xca7d('0x1e')];var _0x134e51=_0x1a6cb7?0x0:_0x37bae3[_0xca7d('0x1c')];var _0xdee74e=_0x1a6cb7?_0x254305['count']:_0x37bae3['offset']+_0x37bae3[_0xca7d('0x1f')];var _0x4cb0d8;if(_0xdee74e>=_0x26e7f6){_0xdee74e=_0x26e7f6;_0x4cb0d8=0xc8;}else{_0x4cb0d8=0xce;}_0x369923[_0xca7d('0x1a')](_0x4cb0d8);return _0x369923[_0xca7d('0x20')]('Content-Range',_0x134e51+'-'+_0xdee74e+'/'+_0x26e7f6)[_0xca7d('0x1b')](_0x254305);}return null;};}function patchUpdates(_0x5c106e){return function(_0x583a24){try{jsonpatch[_0xca7d('0x21')](_0x583a24,_0x5c106e,!![]);}catch(_0x38a488){return BPromise[_0xca7d('0x22')](_0x38a488);}return _0x583a24[_0xca7d('0x23')]();};}function saveUpdates(_0x5d049b,_0x4121ce){return function(_0x1cca8a){if(_0x1cca8a){return _0x1cca8a[_0xca7d('0x24')](_0x5d049b)[_0xca7d('0x25')](function(_0x79fc7d){return _0x79fc7d;});}return null;};}function removeEntity(_0x351c87,_0xf4b873){return function(_0x44e415){if(_0x44e415){return _0x44e415[_0xca7d('0x26')]()[_0xca7d('0x25')](function(){_0x351c87['status'](0xcc)[_0xca7d('0x19')]();});}};}function handleEntityNotFound(_0x41938b,_0x3b5bbb){return function(_0x59449f){if(!_0x59449f){_0x41938b[_0xca7d('0x27')](0x194);}return _0x59449f;};}function handleError(_0xc2048d,_0x38ee14){_0x38ee14=_0x38ee14||0x1f4;return function(_0x162bf8){logger[_0xca7d('0x28')](_0x162bf8[_0xca7d('0x29')]);if(_0x162bf8['name']){delete _0x162bf8[_0xca7d('0x2a')];}_0xc2048d[_0xca7d('0x1a')](_0x38ee14)['send'](_0x162bf8);};}exports[_0xca7d('0x2b')]=function(_0x5df354,_0x50c290){var _0x13c1df={},_0x5dfe5f={},_0x37c8a6={'count':0x0,'rows':[]};var _0x1c4e7d=_[_0xca7d('0x2c')](db[_0xca7d('0x2d')][_0xca7d('0x2e')],function(_0x527920){return{'name':_0x527920['fieldName'],'type':_0x527920[_0xca7d('0x2f')][_0xca7d('0x30')]};});_0x5dfe5f[_0xca7d('0x31')]=_['map'](_0x1c4e7d,_0xca7d('0x2a'));_0x5dfe5f[_0xca7d('0x32')]=_[_0xca7d('0x33')](_0x5df354[_0xca7d('0x32')]);_0x5dfe5f[_0xca7d('0x34')]=_[_0xca7d('0x35')](_0x5dfe5f[_0xca7d('0x31')],_0x5dfe5f[_0xca7d('0x32')]);_0x13c1df['attributes']=_['intersection'](_0x5dfe5f[_0xca7d('0x31')],qs[_0xca7d('0x36')](_0x5df354[_0xca7d('0x32')][_0xca7d('0x36')]));_0x13c1df['attributes']=_0x13c1df['attributes'][_0xca7d('0x37')]?_0x13c1df['attributes']:_0x5dfe5f['model'];if(!_0x5df354['query'][_0xca7d('0x38')]('nolimit')){_0x13c1df[_0xca7d('0x1f')]=qs[_0xca7d('0x1f')](_0x5df354[_0xca7d('0x32')]['limit']);_0x13c1df[_0xca7d('0x1c')]=qs[_0xca7d('0x1c')](_0x5df354[_0xca7d('0x32')]['offset']);}_0x13c1df[_0xca7d('0x39')]=qs[_0xca7d('0x3a')](_0x5df354['query'][_0xca7d('0x3a')]);_0x13c1df['where']=qs[_0xca7d('0x34')](_['pick'](_0x5df354['query'],_0x5dfe5f[_0xca7d('0x34')]),_0x1c4e7d);if(_0x5df354[_0xca7d('0x32')][_0xca7d('0x3b')]){_0x13c1df['where']=_[_0xca7d('0x3c')](_0x13c1df[_0xca7d('0x3d')],{'$or':_[_0xca7d('0x2c')](_0x1c4e7d,function(_0x161416){if(_0x161416[_0xca7d('0x2f')]!==_0xca7d('0x3e')){var _0x1b9ff0={};_0x1b9ff0[_0x161416['name']]={'$like':'%'+_0x5df354['query']['filter']+'%'};return _0x1b9ff0;}})});}_0x13c1df=_[_0xca7d('0x3c')]({},_0x13c1df,_0x5df354['options']);var _0x2f5c6a={'where':_0x13c1df['where']};return db[_0xca7d('0x2d')]['count'](_0x2f5c6a)[_0xca7d('0x25')](function(_0x5856eb){_0x37c8a6[_0xca7d('0x1e')]=_0x5856eb;if(_0x5df354[_0xca7d('0x32')][_0xca7d('0x3f')]){_0x13c1df[_0xca7d('0x40')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x13c1df);})[_0xca7d('0x25')](function(_0x500951){_0x37c8a6[_0xca7d('0x41')]=_0x500951;return _0x37c8a6;})[_0xca7d('0x25')](respondWithFilteredResult(_0x50c290,_0x13c1df))[_0xca7d('0x42')](handleError(_0x50c290,null));};exports[_0xca7d('0x43')]=function(_0x266bd4,_0x451121){var _0x2f19a0={'raw':![],'where':{'id':_0x266bd4[_0xca7d('0x44')]['id']}},_0x4c9a38={};_0x4c9a38['model']=_[_0xca7d('0x33')](db['Dynamics365Account'][_0xca7d('0x2e')]);_0x4c9a38['query']=_[_0xca7d('0x33')](_0x266bd4['query']);_0x4c9a38['filters']=_[_0xca7d('0x35')](_0x4c9a38['model'],_0x4c9a38[_0xca7d('0x32')]);_0x2f19a0['attributes']=_[_0xca7d('0x35')](_0x4c9a38['model'],qs['fields'](_0x266bd4[_0xca7d('0x32')][_0xca7d('0x36')]));_0x2f19a0['attributes']=_0x2f19a0['attributes'][_0xca7d('0x37')]?_0x2f19a0[_0xca7d('0x45')]:_0x4c9a38['model'];if(_0x266bd4['query']['includeAll']){_0x2f19a0[_0xca7d('0x40')]=[{'all':!![]}];}_0x2f19a0=_[_0xca7d('0x3c')]({},_0x2f19a0,_0x266bd4[_0xca7d('0x46')]);return db[_0xca7d('0x2d')]['find'](_0x2f19a0)[_0xca7d('0x25')](handleEntityNotFound(_0x451121,null))[_0xca7d('0x25')](respondWithResult(_0x451121,null))[_0xca7d('0x42')](handleError(_0x451121,null));};exports['create']=function(_0x420693,_0x8023a7){return db[_0xca7d('0x2d')][_0xca7d('0x47')](_0x420693[_0xca7d('0x48')],{})[_0xca7d('0x25')](respondWithResult(_0x8023a7,0xc9))[_0xca7d('0x42')](handleError(_0x8023a7,null));};exports[_0xca7d('0x24')]=function(_0xc19132,_0x263b1c){if(_0xc19132[_0xca7d('0x48')]['id']){delete _0xc19132['body']['id'];}return db['Dynamics365Account'][_0xca7d('0x49')]({'where':{'id':_0xc19132[_0xca7d('0x44')]['id']}})['then'](handleEntityNotFound(_0x263b1c,null))[_0xca7d('0x25')](saveUpdates(_0xc19132[_0xca7d('0x48')],null))['then'](respondWithResult(_0x263b1c,null))[_0xca7d('0x42')](handleError(_0x263b1c,null));};exports[_0xca7d('0x26')]=function(_0x4fe7f8,_0x2ac51d){return db['Dynamics365Account']['find']({'where':{'id':_0x4fe7f8[_0xca7d('0x44')]['id']}})[_0xca7d('0x25')](handleEntityNotFound(_0x2ac51d,null))['then'](removeEntity(_0x2ac51d,null))[_0xca7d('0x42')](handleError(_0x2ac51d,null));};exports['getConfigurations']=function(_0x55ed52,_0x1e8bdd,_0x985ad9){var _0x3da6bd={};var _0x61b4b5={};var _0x17e9f9;var _0x473df6;return db[_0xca7d('0x2d')][_0xca7d('0x4a')]({'where':{'id':_0x55ed52[_0xca7d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e8bdd,null))['then'](function(_0x59ea9f){if(_0x59ea9f){_0x17e9f9=_0x59ea9f;_0x61b4b5['model']=_[_0xca7d('0x33')](db[_0xca7d('0x4b')][_0xca7d('0x2e')]);_0x61b4b5[_0xca7d('0x32')]=_['keys'](_0x55ed52[_0xca7d('0x32')]);_0x61b4b5[_0xca7d('0x34')]=_[_0xca7d('0x35')](_0x61b4b5[_0xca7d('0x31')],_0x61b4b5[_0xca7d('0x32')]);_0x3da6bd[_0xca7d('0x45')]=_['intersection'](_0x61b4b5[_0xca7d('0x31')],qs['fields'](_0x55ed52['query'][_0xca7d('0x36')]));_0x3da6bd[_0xca7d('0x45')]=_0x3da6bd['attributes']['length']?_0x3da6bd[_0xca7d('0x45')]:_0x61b4b5[_0xca7d('0x31')];_0x3da6bd['order']=qs[_0xca7d('0x3a')](_0x55ed52[_0xca7d('0x32')][_0xca7d('0x3a')]);_0x3da6bd[_0xca7d('0x3d')]=qs[_0xca7d('0x34')](_['pick'](_0x55ed52[_0xca7d('0x32')],_0x61b4b5['filters']));if(_0x55ed52['query'][_0xca7d('0x3b')]){_0x3da6bd['where']=_['merge'](_0x3da6bd[_0xca7d('0x3d')],{'$or':_['map'](_0x3da6bd['attributes'],function(_0x4abee9){var _0x3360dc={};_0x3360dc[_0x4abee9]={'$like':'%'+_0x55ed52['query'][_0xca7d('0x3b')]+'%'};return _0x3360dc;})});}_0x3da6bd=_['merge']({},_0x3da6bd,_0x55ed52['options']);return _0x17e9f9[_0xca7d('0x4c')](_0x3da6bd);}})['then'](function(_0x36a2d8){if(_0x36a2d8){_0x473df6=_0x36a2d8[_0xca7d('0x37')];if(!_0x55ed52['query'][_0xca7d('0x38')](_0xca7d('0x4d'))){_0x3da6bd[_0xca7d('0x1f')]=qs[_0xca7d('0x1f')](_0x55ed52[_0xca7d('0x32')][_0xca7d('0x1f')]);_0x3da6bd[_0xca7d('0x1c')]=qs[_0xca7d('0x1c')](_0x55ed52[_0xca7d('0x32')][_0xca7d('0x1c')]);}return _0x17e9f9[_0xca7d('0x4c')](_0x3da6bd);}})['then'](function(_0x68be92){if(_0x68be92){return _0x68be92?{'count':_0x473df6,'rows':_0x68be92}:null;}})[_0xca7d('0x25')](respondWithResult(_0x1e8bdd,null))[_0xca7d('0x42')](handleError(_0x1e8bdd,null));};exports['addConfiguration']=function(_0x3fc27b,_0x36ee0b,_0x5e01ca){if(_0x3fc27b[_0xca7d('0x48')]['id']){delete _0x3fc27b[_0xca7d('0x48')]['id'];}return db['Dynamics365Account'][_0xca7d('0x4a')]({'where':{'id':_0x3fc27b[_0xca7d('0x44')]['id']}})[_0xca7d('0x25')](handleEntityNotFound(_0x36ee0b,null))['then'](function(_0xc59fcd){if(_0xc59fcd){_0x3fc27b[_0xca7d('0x48')][_0xca7d('0x4e')]=_0xc59fcd['id'];_0x3fc27b[_0xca7d('0x48')][_0xca7d('0x4f')]=integrations[_0xca7d('0x50')](_0x3fc27b[_0xca7d('0x48')][_0xca7d('0x51')],_0x3fc27b['body'][_0xca7d('0x2f')]);_0x3fc27b[_0xca7d('0x48')][_0xca7d('0x52')]=integrations[_0xca7d('0x53')](_0x3fc27b[_0xca7d('0x48')][_0xca7d('0x51')],_0x3fc27b['body']['type']);return db[_0xca7d('0x4b')][_0xca7d('0x47')](_0x3fc27b[_0xca7d('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0xca7d('0x4f')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0xca7d('0x25')](respondWithResult(_0x36ee0b,null))[_0xca7d('0x42')](handleError(_0x36ee0b,null));};exports['getFields']=function(_0x5144d7,_0x5ce321,_0x1a40ed){var _0x8943c5=_0x5144d7[_0xca7d('0x32')][_0xca7d('0x54')];var _0x24bc58=_0x8943c5===_0xca7d('0x55')?_0xca7d('0x56'):'PhoneCall';var _0x4bda07='';var _0x4ac985='';var _0x55ce2e='';var _0x4c693e='';var _0x229671='';var _0x24ab4d='';var _0x58a88c='';var _0x5b4766='';var _0x464353=[_0xca7d('0x57'),'description',_0xca7d('0x58'),'ownerid',_0xca7d('0x59'),'subject',_0xca7d('0x5a'),_0xca7d('0x5b'),_0xca7d('0x5c'),'phonecall_activity_parties'];var _0x55aafb=[_0xca7d('0x5d'),_0xca7d('0x5e'),_0xca7d('0x5f'),_0xca7d('0x60'),'contactidname',_0xca7d('0x61'),'contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame',_0xca7d('0x62'),'createdonbehalfbyname',_0xca7d('0x63'),_0xca7d('0x64'),_0xca7d('0x65'),_0xca7d('0x66'),_0xca7d('0x67'),_0xca7d('0x68'),_0xca7d('0x69'),'entityimage_url','escalatedon',_0xca7d('0x6a'),_0xca7d('0x6b'),_0xca7d('0x6c'),_0xca7d('0x6d'),_0xca7d('0x6e'),_0xca7d('0x6f'),_0xca7d('0x70'),_0xca7d('0x71'),'modifiedbyexternalpartyname',_0xca7d('0x72'),_0xca7d('0x73'),_0xca7d('0x74'),_0xca7d('0x75'),_0xca7d('0x76'),'modifiedonbehalfbyyominame',_0xca7d('0x77'),_0xca7d('0x78'),_0xca7d('0x79'),'onholdtime',_0xca7d('0x7a'),_0xca7d('0x7b'),_0xca7d('0x7c'),'owneridyominame',_0xca7d('0x7d'),_0xca7d('0x7e'),_0xca7d('0x7f'),'prioritycodename',_0xca7d('0x80'),_0xca7d('0x81'),_0xca7d('0x82'),_0xca7d('0x83'),_0xca7d('0x84'),'responsiblecontactidname',_0xca7d('0x85'),_0xca7d('0x86'),_0xca7d('0x87'),_0xca7d('0x88'),'socialprofileidname',_0xca7d('0x89'),'statuscode',_0xca7d('0x8a'),_0xca7d('0x8b'),'timezoneruleversionnumber',_0xca7d('0x8c'),_0xca7d('0x8d'),_0xca7d('0x8e'),_0xca7d('0x8f')];var _0x213641=_0x464353[_0xca7d('0x90')](_0x55aafb);return db['Dynamics365Account'][_0xca7d('0x4a')]({'where':{'id':_0x5144d7[_0xca7d('0x44')]['id']},'attributes':['id','username',_0xca7d('0x91'),'remoteUri','tenantId','clientId','clientSecret']})[_0xca7d('0x25')](handleEntityNotFound(_0x5ce321,null))[_0xca7d('0x25')](function(_0x4c80d6){if(_0x4c80d6){_0x5b4766=_0x4c80d6['remoteUri'];var _0x5ed25c=_0x5b4766['slice'](-0x1);if(_0x5ed25c==='/'){_0x5b4766=_0x5b4766[_0xca7d('0x92')](0x0,_0x5b4766[_0xca7d('0x93')](_0x5ed25c));}_0x58a88c=util[_0xca7d('0x94')](_0xca7d('0x95'),_0x5b4766);var _0x467bea={'method':_0xca7d('0x96'),'uri':_0xca7d('0x97')+_0x4c80d6[_0xca7d('0x98')]+_0xca7d('0x99'),'form':{'client_id':_0x4c80d6[_0xca7d('0x9a')],'resource':_0x5b4766,'username':_0x4c80d6['username'],'password':_0x4c80d6['password'],'grant_type':'password','client_secret':_0x4c80d6['clientSecret']},'json':!![]};return rp(_0x467bea);}})[_0xca7d('0x25')](function(_0xa2f752){_0x24ab4d=_0xa2f752[_0xca7d('0x9b')];var _0xd1308b={'method':_0xca7d('0x9c'),'uri':encodeURI(_0x58a88c+_0xca7d('0x9d')+_0x24bc58+'\x27'),'headers':{'Authorization':_0xca7d('0x9e')+_0x24ab4d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd1308b);})[_0xca7d('0x25')](function(_0x47ba88){var _0x306c27=_0x47ba88[_0xca7d('0x9f')][0x0];var _0x1a1b54=_0x306c27[_0xca7d('0xa0')];var _0xc601cf={'method':_0xca7d('0x9c'),'uri':_0x58a88c+_0xca7d('0xa1')+_0x1a1b54+_0xca7d('0xa2'),'headers':{'Authorization':_0xca7d('0x9e')+_0x24ab4d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xc601cf);})[_0xca7d('0x25')](function(_0x2c7959){_0x4bda07=_0x2c7959;_0x4ac985=_0x4bda07[_0xca7d('0xa3')];_0x4ac985=_['remove'](_0x4ac985,function(_0x3f6df8){return!_0x213641[_0xca7d('0xa4')](_0x3f6df8['LogicalName']);});var _0x1c47f1=[];var _0x16992a=[];_0x4ac985[_0xca7d('0xa5')](function(_0x5c9e30){if(_0x5c9e30['@odata.type']){var _0x305437=_0x5c9e30[_0xca7d('0xa6')]['substring'](_0x5c9e30[_0xca7d('0xa6')][_0xca7d('0x93')]('.')+0x1);if(_0x305437===_0xca7d('0xa7')){_0x1c47f1[_0xca7d('0xa8')](getSelectList(_0x58a88c,_0x8943c5,_0x16992a,_0x4bda07[_0xca7d('0xa0')],_0x5c9e30[_0xca7d('0xa0')],_0x24ab4d));}}});return Promise[_0xca7d('0xa9')](_0x1c47f1);})[_0xca7d('0x25')](function(_0x1dd355){_0x55ce2e=_0x1dd355[0x0];var _0x47c4e8=[];var _0x42dda0=[];_0x4ac985[_0xca7d('0xa5')](function(_0x146491){if(!_[_0xca7d('0xaa')](_0x146491[_0xca7d('0xa6')])){var _0x21f53e=_0x146491[_0xca7d('0xa6')]['substring'](_0x146491[_0xca7d('0xa6')][_0xca7d('0x93')]('.')+0x1);if(_0x21f53e==='BooleanAttributeMetadata'){_0x47c4e8[_0xca7d('0xa8')](getBooleanList(_0x58a88c,_0x8943c5,_0x42dda0,_0x4bda07['MetadataId'],_0x146491['MetadataId'],_0x24ab4d));}}});return Promise[_0xca7d('0xa9')](_0x47c4e8);})['then'](function(_0x1698aa){_0x4c693e=_0x1698aa[0x0];var _0x3f135b=[];var _0x572d71=[];_0x4ac985[_0xca7d('0xa5')](function(_0x36521d){if(_0x36521d[_0xca7d('0xa6')]){var _0x1843fa=_0x36521d[_0xca7d('0xa6')]['substring'](_0x36521d['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1843fa===_0xca7d('0xab')||_0x1843fa==='DoubleAttributeMetadata'||_0x1843fa===_0xca7d('0xac')||_0x1843fa===_0xca7d('0xad')||_0x1843fa===_0xca7d('0xae')||_0x1843fa==='DateTimeAttributeMetadata'||_0x1843fa===_0xca7d('0xaf')||_0x1843fa===_0xca7d('0xb0')||_0x1843fa===_0xca7d('0xb1')||_0x1843fa===_0xca7d('0xb2')){_0x3f135b['push'](getInputList(_0x58a88c,_0x8943c5,_0x1843fa,_0x572d71,_0x4bda07['MetadataId'],_0x36521d[_0xca7d('0xa0')],_0x24ab4d));}}});return Promise[_0xca7d('0xa9')](_0x3f135b);})[_0xca7d('0x25')](function(_0xfcb6a0){_0x229671=_0xfcb6a0[0x0];var _0x528d03=_0x55ce2e[_0xca7d('0x90')](_0x4c693e)[_0xca7d('0x90')](_0x229671);var _0x3f6a20={'count':_0x528d03[_0xca7d('0x37')],'rows':_0x528d03};return _0x3f6a20;})[_0xca7d('0x25')](respondWithResult(_0x5ce321,null))['catch'](function(_0x2bddfa){var _0x503b3f=_0x5144d7['query']['test']?0x1f4:_0x2bddfa[_0xca7d('0xb3')]||0x1f4;logger[_0xca7d('0x28')](_0x2bddfa[_0xca7d('0x29')]);delete _0x2bddfa[_0xca7d('0x2a')];if(_0x503b3f===0x191){_0x503b3f=0x190;}_0x5ce321[_0xca7d('0x1a')](_0x503b3f)['send'](_0x5144d7[_0xca7d('0x32')]['test']?{'message':_0xca7d('0xb4'),'statusCode':_0x2bddfa[_0xca7d('0xb3')]}:_0x2bddfa);});};function getSelectList(_0x1624c9,_0x4ea434,_0x1d9950,_0x1baded,_0x55fd18,_0x30f3f0){var _0x554472={'method':_0xca7d('0x9c'),'uri':_0x1624c9+_0xca7d('0xa1')+_0x1baded+')/Attributes('+_0x55fd18+_0xca7d('0xb5')+_0xca7d('0xb6'),'headers':{'Authorization':_0xca7d('0x9e')+_0x30f3f0,'If-None-Match':null,'OData-Version':_0xca7d('0xb7')},'json':!![]};return rp(_0x554472)[_0xca7d('0x25')](function(_0x35f778){var _0x4049cd=[];var _0x33c484=_0x35f778[_0xca7d('0xb8')]['Options'];_0x33c484[_0xca7d('0xa5')](function(_0x41c5be){_0x4049cd[_0xca7d('0xa8')]({'name':_0x41c5be[_0xca7d('0xb9')][_0xca7d('0xba')][_0xca7d('0xb9')],'value':String(_0x41c5be[_0xca7d('0xbb')])});});var _0x59b2ef={'id':_0x4ea434+'_'+_0x35f778[_0xca7d('0xbc')],'name':_0x35f778[_0xca7d('0xbd')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x4049cd};_0x1d9950['push'](_0x59b2ef);return _0x1d9950;});}function getBooleanList(_0x5cac25,_0xda0e4a,_0x44ecab,_0x3931a3,_0x53b57e,_0x45ba9f){var _0x90dc7f={'method':_0xca7d('0x9c'),'uri':_0x5cac25+_0xca7d('0xa1')+_0x3931a3+')/Attributes('+_0x53b57e+_0xca7d('0xbe'),'headers':{'Authorization':_0xca7d('0x9e')+_0x45ba9f,'If-None-Match':null,'OData-Version':_0xca7d('0xb7')},'json':!![]};return rp(_0x90dc7f)['then'](function(_0x57a7f5){var _0x1c0cb6=[];_0x1c0cb6[_0xca7d('0xa8')]({'name':_0x57a7f5[_0xca7d('0xb8')][_0xca7d('0xbf')][_0xca7d('0xb9')][_0xca7d('0xba')][_0xca7d('0xb9')],'value':_0xca7d('0xc0')},{'name':_0x57a7f5[_0xca7d('0xb8')][_0xca7d('0xc1')][_0xca7d('0xb9')][_0xca7d('0xba')][_0xca7d('0xb9')],'value':_0xca7d('0xc2')});var _0x85bbe7={'id':_0xda0e4a+'_'+_0x57a7f5[_0xca7d('0xbc')],'name':_0x57a7f5[_0xca7d('0xbd')]['UserLocalizedLabel'][_0xca7d('0xb9')],'custom':![],'options':_0x1c0cb6};_0x44ecab[_0xca7d('0xa8')](_0x85bbe7);return _0x44ecab;});}function getInputList(_0xb7d688,_0x41802d,_0x3be302,_0x3fb016,_0x23281f,_0x400a88,_0xbf4ea7){var _0x41f8bc={'method':_0xca7d('0x9c'),'uri':_0xb7d688+'EntityDefinitions('+_0x23281f+')/Attributes('+_0x400a88+_0xca7d('0xc3')+_0x3be302+_0xca7d('0xc4'),'headers':{'Authorization':_0xca7d('0x9e')+_0xbf4ea7,'If-None-Match':null,'OData-Version':_0xca7d('0xb7')},'json':!![]};return rp(_0x41f8bc)['then'](function(_0x9ad6f9){var _0x1748f4={'id':_0x41802d+'_'+_0x9ad6f9[_0xca7d('0xbc')],'name':_0x9ad6f9['DisplayName']['UserLocalizedLabel']?_0x9ad6f9[_0xca7d('0xbd')][_0xca7d('0xba')][_0xca7d('0xb9')]:_0x9ad6f9[_0xca7d('0xbc')],'custom':![],'options':[]};_0x3fb016[_0xca7d('0xa8')](_0x1748f4);return _0x3fb016;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7348c36..cbdaff2 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x565c8c,_0x216606){var _0x54c8a6=function(_0x12a214){while(--_0x12a214){_0x565c8c['push'](_0x565c8c['shift']());}};_0x54c8a6(++_0x216606);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0xcb91[_0x31c19c];return _0x1a87f7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x4f3b60,_0x2c7515){var _0x13b975=function(_0x2a9d56){while(--_0x2a9d56){_0x4f3b60['push'](_0x4f3b60['shift']());}};_0x13b975(++_0x2c7515);}(_0xe706,0xa3));var _0x6e70=function(_0x397c86,_0x24edb8){_0x397c86=_0x397c86-0x0;var _0x5c40c5=_0xe706[_0x397c86];return _0x5c40c5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f7c01d2..d2db0ec 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 _0x3c65=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowDynamics365Account','lodash','util'];(function(_0x3edf9b,_0x441bb1){var _0x47408a=function(_0x53f883){while(--_0x53f883){_0x3edf9b['push'](_0x3edf9b['shift']());}};_0x47408a(++_0x441bb1);}(_0x3c65,0xdc));var _0x53c6=function(_0x5400b,_0x55943a){_0x5400b=_0x5400b-0x0;var _0x36a39b=_0x3c65[_0x5400b];return _0x36a39b;};'use strict';var _=require(_0x53c6('0x0'));var util=require(_0x53c6('0x1'));var moment=require(_0x53c6('0x2'));var BPromise=require(_0x53c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53c6('0x4'))['db'];var utils=require(_0x53c6('0x5'));var logger=require(_0x53c6('0x6'))(_0x53c6('0x7'));var config=require(_0x53c6('0x8'));var jayson=require(_0x53c6('0x9'));var client=jayson[_0x53c6('0xa')][_0x53c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b4e49,_0x447328,_0x246c06){return new BPromise(function(_0x28e954,_0x478c1b){return client[_0x53c6('0xc')](_0x3b4e49,_0x246c06)[_0x53c6('0xd')](function(_0x3cd9c9){logger[_0x53c6('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x447328,_0x53c6('0xf'));logger['debug'](_0x53c6('0x10'),_0x447328,'request\x20sent',JSON[_0x53c6('0x11')](_0x3cd9c9));if(_0x3cd9c9[_0x53c6('0x12')]){if(_0x3cd9c9[_0x53c6('0x12')][_0x53c6('0x13')]===0x1f4){logger[_0x53c6('0x12')](_0x53c6('0x14'),_0x447328,_0x3cd9c9[_0x53c6('0x12')][_0x53c6('0x15')]);return _0x478c1b(_0x3cd9c9['error']['message']);}logger[_0x53c6('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x447328,_0x3cd9c9['error']['message']);return _0x28e954(_0x3cd9c9[_0x53c6('0x12')][_0x53c6('0x15')]);}else{logger[_0x53c6('0xe')](_0x53c6('0x14'),_0x447328,'request\x20sent');_0x28e954(_0x3cd9c9[_0x53c6('0x16')][_0x53c6('0x15')]);}})[_0x53c6('0x17')](function(_0x4bf4c3){logger['error'](_0x53c6('0x14'),_0x447328,_0x4bf4c3);_0x478c1b(_0x4bf4c3);});});}exports[_0x53c6('0x18')]=function(_0x93505){var _0x12cf8f=this;return new Promise(function(_0x542633,_0x3bc302){return db[_0x53c6('0x19')][_0x53c6('0x1a')]({'raw':_0x93505[_0x53c6('0x1b')]?_0x93505[_0x53c6('0x1b')][_0x53c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x93505[_0x53c6('0x1b')]?_0x93505['options'][_0x53c6('0x1d')]||null:null,'attributes':_0x93505[_0x53c6('0x1b')]?_0x93505[_0x53c6('0x1b')][_0x53c6('0x1e')]||null:null,'limit':_0x93505[_0x53c6('0x1b')]?_0x93505[_0x53c6('0x1b')][_0x53c6('0x1f')]||null:null,'include':_0x93505[_0x53c6('0x1b')]?_0x93505['options'][_0x53c6('0x20')]?_['map'](_0x93505[_0x53c6('0x1b')][_0x53c6('0x20')],function(_0x10362d){return{'model':db[_0x10362d['model']],'as':_0x10362d['as'],'attributes':_0x10362d['attributes'],'include':_0x10362d[_0x53c6('0x20')]?_[_0x53c6('0x21')](_0x10362d[_0x53c6('0x20')],function(_0x342b09){return{'model':db[_0x342b09[_0x53c6('0x22')]],'as':_0x342b09['as'],'attributes':_0x342b09[_0x53c6('0x1e')],'include':_0x342b09[_0x53c6('0x20')]?_[_0x53c6('0x21')](_0x342b09[_0x53c6('0x20')],function(_0x5d5967){return{'model':db[_0x5d5967[_0x53c6('0x22')]],'as':_0x5d5967['as'],'attributes':_0x5d5967[_0x53c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x53c6('0xd')](function(_0x38ddf4){logger['info'](_0x53c6('0x18'),_0x93505);logger[_0x53c6('0x23')](_0x53c6('0x18'),_0x93505,JSON[_0x53c6('0x11')](_0x38ddf4));_0x542633(_0x38ddf4);})[_0x53c6('0x17')](function(_0x4a3737){logger[_0x53c6('0x12')](_0x53c6('0x18'),_0x4a3737[_0x53c6('0x15')],_0x93505);_0x3bc302(_0x12cf8f[_0x53c6('0x12')](0x1f4,_0x4a3737[_0x53c6('0x15')]));});});};exports[_0x53c6('0x24')]=function(_0x1fe3e8){var _0x277b01=this;return new Promise(function(_0x5de4e3,_0x44ccd8){return db[_0x53c6('0x19')]['find']({'raw':_0x1fe3e8[_0x53c6('0x1b')]?_0x1fe3e8[_0x53c6('0x1b')][_0x53c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fe3e8[_0x53c6('0x1b')]?_0x1fe3e8[_0x53c6('0x1b')][_0x53c6('0x1d')]||null:null,'attributes':_0x1fe3e8[_0x53c6('0x1b')]?_0x1fe3e8['options'][_0x53c6('0x1e')]||null:null,'include':_0x1fe3e8[_0x53c6('0x1b')]?_0x1fe3e8[_0x53c6('0x1b')][_0x53c6('0x20')]?_[_0x53c6('0x21')](_0x1fe3e8[_0x53c6('0x1b')]['include'],function(_0x285e15){return{'model':db[_0x285e15[_0x53c6('0x22')]],'as':_0x285e15['as'],'attributes':_0x285e15[_0x53c6('0x1e')],'include':_0x285e15[_0x53c6('0x20')]?_[_0x53c6('0x21')](_0x285e15[_0x53c6('0x20')],function(_0xd627dc){return{'model':db[_0xd627dc[_0x53c6('0x22')]],'as':_0xd627dc['as'],'attributes':_0xd627dc['attributes'],'include':_0xd627dc[_0x53c6('0x20')]?_[_0x53c6('0x21')](_0xd627dc[_0x53c6('0x20')],function(_0xce6f13){return{'model':db[_0xce6f13[_0x53c6('0x22')]],'as':_0xce6f13['as'],'attributes':_0xce6f13[_0x53c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x53c6('0xd')](function(_0x3d20cf){logger[_0x53c6('0xe')](_0x53c6('0x24'),_0x1fe3e8);logger[_0x53c6('0x23')]('ShowDynamics365Account',_0x1fe3e8,JSON[_0x53c6('0x11')](_0x3d20cf));_0x5de4e3(_0x3d20cf);})['catch'](function(_0x17e1a3){logger[_0x53c6('0x12')](_0x53c6('0x24'),_0x17e1a3[_0x53c6('0x15')],_0x1fe3e8);_0x44ccd8(_0x277b01[_0x53c6('0x12')](0x1f4,_0x17e1a3[_0x53c6('0x15')]));});});}; \ No newline at end of file +var _0xc766=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','options','raw','where','limit','include','map','attributes','model','GetDynamics365Account','catch','ShowDynamics365Account','lodash','moment','randomstring','ioredis'];(function(_0x148495,_0x2e0831){var _0x30f60c=function(_0x250efb){while(--_0x250efb){_0x148495['push'](_0x148495['shift']());}};_0x30f60c(++_0x2e0831);}(_0xc766,0xc8));var _0x6c76=function(_0x354611,_0x10b9ea){_0x354611=_0x354611-0x0;var _0x51ea9f=_0xc766[_0x354611];return _0x51ea9f;};'use strict';var _=require(_0x6c76('0x0'));var util=require('util');var moment=require(_0x6c76('0x1'));var BPromise=require('bluebird');var rs=require(_0x6c76('0x2'));var fs=require('fs');var Redis=require(_0x6c76('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c76('0x4'));var logger=require(_0x6c76('0x5'))(_0x6c76('0x6'));var config=require('../../config/environment');var jayson=require(_0x6c76('0x7'));var client=jayson[_0x6c76('0x8')][_0x6c76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59b7d4,_0x42325e,_0x3295ec){return new BPromise(function(_0x24f873,_0x3ac2d8){return client[_0x6c76('0xa')](_0x59b7d4,_0x3295ec)[_0x6c76('0xb')](function(_0x2677cf){logger[_0x6c76('0xc')](_0x6c76('0xd'),_0x42325e,_0x6c76('0xe'));logger[_0x6c76('0xf')](_0x6c76('0x10'),_0x42325e,'request\x20sent',JSON[_0x6c76('0x11')](_0x2677cf));if(_0x2677cf[_0x6c76('0x12')]){if(_0x2677cf[_0x6c76('0x12')][_0x6c76('0x13')]===0x1f4){logger[_0x6c76('0x12')](_0x6c76('0xd'),_0x42325e,_0x2677cf[_0x6c76('0x12')][_0x6c76('0x14')]);return _0x3ac2d8(_0x2677cf['error'][_0x6c76('0x14')]);}logger[_0x6c76('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x42325e,_0x2677cf['error'][_0x6c76('0x14')]);return _0x24f873(_0x2677cf[_0x6c76('0x12')][_0x6c76('0x14')]);}else{logger['info'](_0x6c76('0xd'),_0x42325e,_0x6c76('0xe'));_0x24f873(_0x2677cf[_0x6c76('0x15')][_0x6c76('0x14')]);}})['catch'](function(_0x2e95dc){logger[_0x6c76('0x12')](_0x6c76('0xd'),_0x42325e,_0x2e95dc);_0x3ac2d8(_0x2e95dc);});});}exports['GetDynamics365Account']=function(_0x15d7e1){var _0x15b2f4=this;return new Promise(function(_0x77d0d4,_0x310a5f){return db[_0x6c76('0x16')]['findAll']({'raw':_0x15d7e1['options']?_0x15d7e1[_0x6c76('0x17')][_0x6c76('0x18')]===undefined?!![]:![]:!![],'where':_0x15d7e1['options']?_0x15d7e1[_0x6c76('0x17')][_0x6c76('0x19')]||null:null,'attributes':_0x15d7e1[_0x6c76('0x17')]?_0x15d7e1[_0x6c76('0x17')]['attributes']||null:null,'limit':_0x15d7e1['options']?_0x15d7e1[_0x6c76('0x17')][_0x6c76('0x1a')]||null:null,'include':_0x15d7e1['options']?_0x15d7e1[_0x6c76('0x17')][_0x6c76('0x1b')]?_[_0x6c76('0x1c')](_0x15d7e1[_0x6c76('0x17')]['include'],function(_0x437b6a){return{'model':db[_0x437b6a['model']],'as':_0x437b6a['as'],'attributes':_0x437b6a[_0x6c76('0x1d')],'include':_0x437b6a['include']?_['map'](_0x437b6a[_0x6c76('0x1b')],function(_0x1c1dc3){return{'model':db[_0x1c1dc3[_0x6c76('0x1e')]],'as':_0x1c1dc3['as'],'attributes':_0x1c1dc3['attributes'],'include':_0x1c1dc3['include']?_[_0x6c76('0x1c')](_0x1c1dc3['include'],function(_0x213f9c){return{'model':db[_0x213f9c[_0x6c76('0x1e')]],'as':_0x213f9c['as'],'attributes':_0x213f9c[_0x6c76('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e2b21){logger['info'](_0x6c76('0x1f'),_0x15d7e1);logger[_0x6c76('0xf')](_0x6c76('0x1f'),_0x15d7e1,JSON[_0x6c76('0x11')](_0x1e2b21));_0x77d0d4(_0x1e2b21);})[_0x6c76('0x20')](function(_0x1d8a68){logger[_0x6c76('0x12')](_0x6c76('0x1f'),_0x1d8a68[_0x6c76('0x14')],_0x15d7e1);_0x310a5f(_0x15b2f4[_0x6c76('0x12')](0x1f4,_0x1d8a68['message']));});});};exports[_0x6c76('0x21')]=function(_0x11ec27){var _0x536bdc=this;return new Promise(function(_0x4a12c1,_0x354d47){return db[_0x6c76('0x16')]['find']({'raw':_0x11ec27[_0x6c76('0x17')]?_0x11ec27[_0x6c76('0x17')][_0x6c76('0x18')]===undefined?!![]:![]:!![],'where':_0x11ec27[_0x6c76('0x17')]?_0x11ec27[_0x6c76('0x17')][_0x6c76('0x19')]||null:null,'attributes':_0x11ec27[_0x6c76('0x17')]?_0x11ec27[_0x6c76('0x17')][_0x6c76('0x1d')]||null:null,'include':_0x11ec27[_0x6c76('0x17')]?_0x11ec27[_0x6c76('0x17')][_0x6c76('0x1b')]?_[_0x6c76('0x1c')](_0x11ec27[_0x6c76('0x17')][_0x6c76('0x1b')],function(_0x2b15a2){return{'model':db[_0x2b15a2['model']],'as':_0x2b15a2['as'],'attributes':_0x2b15a2[_0x6c76('0x1d')],'include':_0x2b15a2['include']?_[_0x6c76('0x1c')](_0x2b15a2[_0x6c76('0x1b')],function(_0x2abd79){return{'model':db[_0x2abd79[_0x6c76('0x1e')]],'as':_0x2abd79['as'],'attributes':_0x2abd79[_0x6c76('0x1d')],'include':_0x2abd79[_0x6c76('0x1b')]?_[_0x6c76('0x1c')](_0x2abd79['include'],function(_0x2cece4){return{'model':db[_0x2cece4[_0x6c76('0x1e')]],'as':_0x2cece4['as'],'attributes':_0x2cece4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x102994){logger['info']('ShowDynamics365Account',_0x11ec27);logger[_0x6c76('0xf')](_0x6c76('0x21'),_0x11ec27,JSON[_0x6c76('0x11')](_0x102994));_0x4a12c1(_0x102994);})[_0x6c76('0x20')](function(_0x40096f){logger[_0x6c76('0x12')]('ShowDynamics365Account',_0x40096f[_0x6c76('0x14')],_0x11ec27);_0x354d47(_0x536bdc[_0x6c76('0x12')](0x1f4,_0x40096f[_0x6c76('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index c533647..d3adf05 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 _0xce2f=['../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getDescriptions','post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x66c934,_0x3e5a35){var _0x48eb5b=function(_0x262756){while(--_0x262756){_0x66c934['push'](_0x66c934['shift']());}};_0x48eb5b(++_0x3e5a35);}(_0xce2f,0x18a));var _0xfce2=function(_0x6bf50d,_0x46e9ef){_0x6bf50d=_0x6bf50d-0x0;var _0x44b0f9=_0xce2f[_0x6bf50d];return _0x44b0f9;};'use strict';var multer=require('multer');var util=require(_0xfce2('0x0'));var path=require(_0xfce2('0x1'));var timeout=require(_0xfce2('0x2'));var express=require(_0xfce2('0x3'));var router=express[_0xfce2('0x4')]();var fs_extra=require(_0xfce2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfce2('0x6'));var config=require('../../config/environment');var controller=require(_0xfce2('0x7'));router['get']('/',auth[_0xfce2('0x8')](),controller[_0xfce2('0x9')]);router[_0xfce2('0xa')](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0xc')]);router[_0xfce2('0xa')](_0xfce2('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xfce2('0xa')]('/:id/subjects',auth[_0xfce2('0x8')](),controller['getSubjects']);router[_0xfce2('0xa')]('/:id/descriptions',auth[_0xfce2('0x8')](),controller[_0xfce2('0xe')]);router[_0xfce2('0xf')]('/',auth['isAuthenticated'](),controller[_0xfce2('0x10')]);router['put'](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0x11')]);router[_0xfce2('0x12')](_0xfce2('0xb'),auth[_0xfce2('0x8')](),controller[_0xfce2('0x13')]);module['exports']=router; \ No newline at end of file +var _0x26fb=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x144efe,_0x19c160){var _0xd40e31=function(_0x232e39){while(--_0x232e39){_0x144efe['push'](_0x144efe['shift']());}};_0xd40e31(++_0x19c160);}(_0x26fb,0x1f4));var _0xb26f=function(_0x3de39f,_0xb97bc5){_0x3de39f=_0x3de39f-0x0;var _0x18b8ec=_0x26fb[_0x3de39f];return _0x18b8ec;};'use strict';var multer=require(_0xb26f('0x0'));var util=require(_0xb26f('0x1'));var path=require(_0xb26f('0x2'));var timeout=require(_0xb26f('0x3'));var express=require(_0xb26f('0x4'));var router=express[_0xb26f('0x5')]();var fs_extra=require(_0xb26f('0x6'));var auth=require(_0xb26f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb26f('0x8'));var controller=require(_0xb26f('0x9'));router[_0xb26f('0xa')]('/',auth[_0xb26f('0xb')](),controller[_0xb26f('0xc')]);router['get'](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0xe')]);router[_0xb26f('0xa')](_0xb26f('0xf'),auth['isAuthenticated'](),controller[_0xb26f('0x10')]);router[_0xb26f('0xa')](_0xb26f('0x11'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x12')]);router[_0xb26f('0xa')](_0xb26f('0x13'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x14')]);router[_0xb26f('0x15')]('/',auth[_0xb26f('0xb')](),controller[_0xb26f('0x16')]);router[_0xb26f('0x17')](_0xb26f('0xd'),auth['isAuthenticated'](),controller[_0xb26f('0x18')]);router[_0xb26f('0x19')](_0xb26f('0xd'),auth[_0xb26f('0xb')](),controller[_0xb26f('0x1a')]);module[_0xb26f('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 239e1a1..d4335e9 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 _0x7924=['sequelize','exports','STRING','incident','phonecall'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7924,0xaa));var _0x4792=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0x7924[_0x3c5ad6];return _0x3154f2;};'use strict';var Sequelize=require(_0x4792('0x0'));module[_0x4792('0x1')]={'name':{'type':Sequelize[_0x4792('0x2')]},'description':{'type':Sequelize[_0x4792('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x4792('0x3'),_0x4792('0x4')),'defaultValue':_0x4792('0x3')}}; \ No newline at end of file +var _0xefaf=['STRING','incident','phonecall','sequelize'];(function(_0x2f37e0,_0x393ef9){var _0x43ccce=function(_0x318b51){while(--_0x318b51){_0x2f37e0['push'](_0x2f37e0['shift']());}};_0x43ccce(++_0x393ef9);}(_0xefaf,0x197));var _0xfefa=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0xefaf[_0x22dac7];return _0x3e6cfa;};'use strict';var Sequelize=require(_0xfefa('0x0'));module['exports']={'name':{'type':Sequelize[_0xfefa('0x1')]},'description':{'type':Sequelize[_0xfefa('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xfefa('0x2'),_0xfefa('0x3')),'defaultValue':'incident'}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ed43bcb..102ab8c 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 _0xa116=['order','filter','getFields','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','map','type','VIRTUAL','options','includeAll','include','findAll','catch','show','merge','find','create','body','update','params','findOne'];(function(_0x591781,_0x8e0ed2){var _0x315bd9=function(_0x39166c){while(--_0x39166c){_0x591781['push'](_0x591781['shift']());}};_0x315bd9(++_0x8e0ed2);}(_0xa116,0x1e6));var _0x6a11=function(_0x212e5e,_0xc267df){_0x212e5e=_0x212e5e-0x0;var _0x3942c4=_0xa116[_0x212e5e];return _0x3942c4;};'use strict';var emlformat=require(_0x6a11('0x0'));var rimraf=require(_0x6a11('0x1'));var zipdir=require(_0x6a11('0x2'));var jsonpatch=require(_0x6a11('0x3'));var rp=require(_0x6a11('0x4'));var moment=require(_0x6a11('0x5'));var BPromise=require(_0x6a11('0x6'));var Mustache=require('mustache');var util=require(_0x6a11('0x7'));var path=require(_0x6a11('0x8'));var sox=require(_0x6a11('0x9'));var csv=require(_0x6a11('0xa'));var ejs=require(_0x6a11('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a11('0xc'));var squel=require(_0x6a11('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6a11('0xe'));var toCsv=require(_0x6a11('0xa'));var querystring=require(_0x6a11('0xf'));var Papa=require(_0x6a11('0x10'));var Redis=require(_0x6a11('0x11'));var authService=require(_0x6a11('0x12'));var qs=require(_0x6a11('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6a11('0x14'));var utils=require('../../config/utils');var config=require(_0x6a11('0x15'));var licenseUtil=require(_0x6a11('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47b076,_0x4a2632){_0x4a2632=_0x4a2632||0xcc;return function(_0x14c311){if(_0x14c311){return _0x47b076[_0x6a11('0x17')](_0x4a2632);}return _0x47b076[_0x6a11('0x18')](_0x4a2632)[_0x6a11('0x19')]();};}function respondWithResult(_0x559b00,_0x3a5238){_0x3a5238=_0x3a5238||0xc8;return function(_0x4eb9d0){if(_0x4eb9d0){return _0x559b00['status'](_0x3a5238)[_0x6a11('0x1a')](_0x4eb9d0);}};}function respondWithFilteredResult(_0x2490f3,_0xb31fb){return function(_0x53aef1){if(_0x53aef1){var _0x3686d2=typeof _0xb31fb[_0x6a11('0x1b')]===_0x6a11('0x1c')&&typeof _0xb31fb[_0x6a11('0x1d')]===_0x6a11('0x1c');var _0x15204a=_0x53aef1[_0x6a11('0x1e')];var _0xbc8413=_0x3686d2?0x0:_0xb31fb[_0x6a11('0x1b')];var _0x5e1387=_0x3686d2?_0x53aef1[_0x6a11('0x1e')]:_0xb31fb[_0x6a11('0x1b')]+_0xb31fb[_0x6a11('0x1d')];var _0x5bdd5d;if(_0x5e1387>=_0x15204a){_0x5e1387=_0x15204a;_0x5bdd5d=0xc8;}else{_0x5bdd5d=0xce;}_0x2490f3[_0x6a11('0x18')](_0x5bdd5d);return _0x2490f3[_0x6a11('0x1f')]('Content-Range',_0xbc8413+'-'+_0x5e1387+'/'+_0x15204a)[_0x6a11('0x1a')](_0x53aef1);}return null;};}function patchUpdates(_0x3a6563){return function(_0x148bec){try{jsonpatch[_0x6a11('0x20')](_0x148bec,_0x3a6563,!![]);}catch(_0x1daf31){return BPromise[_0x6a11('0x21')](_0x1daf31);}return _0x148bec[_0x6a11('0x22')]();};}function saveUpdates(_0x32af25,_0x476156){return function(_0x43b95b){if(_0x43b95b){return _0x43b95b['update'](_0x32af25)['then'](function(_0x4f7755){return _0x4f7755;});}return null;};}function removeEntity(_0x35834f,_0x6c530){return function(_0x5e7291){if(_0x5e7291){return _0x5e7291[_0x6a11('0x23')]()[_0x6a11('0x24')](function(){_0x35834f[_0x6a11('0x18')](0xcc)[_0x6a11('0x19')]();});}};}function handleEntityNotFound(_0x295cfd,_0x742ee){return function(_0x445019){if(!_0x445019){_0x295cfd[_0x6a11('0x17')](0x194);}return _0x445019;};}function handleError(_0x2e92b0,_0x3e35de){_0x3e35de=_0x3e35de||0x1f4;return function(_0x25a5ed){logger[_0x6a11('0x25')](_0x25a5ed['stack']);if(_0x25a5ed[_0x6a11('0x26')]){delete _0x25a5ed[_0x6a11('0x26')];}_0x2e92b0['status'](_0x3e35de)[_0x6a11('0x27')](_0x25a5ed);};}exports[_0x6a11('0x28')]=function(_0x378915,_0x564936){var _0x5871e8={},_0x10f3f7={},_0x47a508={'count':0x0,'rows':[]};var _0x38389b=_['map'](db[_0x6a11('0x29')][_0x6a11('0x2a')],function(_0x36b812){return{'name':_0x36b812[_0x6a11('0x2b')],'type':_0x36b812['type'][_0x6a11('0x2c')]};});_0x10f3f7[_0x6a11('0x2d')]=_['map'](_0x38389b,_0x6a11('0x26'));_0x10f3f7[_0x6a11('0x2e')]=_[_0x6a11('0x2f')](_0x378915[_0x6a11('0x2e')]);_0x10f3f7[_0x6a11('0x30')]=_[_0x6a11('0x31')](_0x10f3f7[_0x6a11('0x2d')],_0x10f3f7[_0x6a11('0x2e')]);_0x5871e8[_0x6a11('0x32')]=_[_0x6a11('0x31')](_0x10f3f7[_0x6a11('0x2d')],qs[_0x6a11('0x33')](_0x378915[_0x6a11('0x2e')][_0x6a11('0x33')]));_0x5871e8['attributes']=_0x5871e8[_0x6a11('0x32')][_0x6a11('0x34')]?_0x5871e8['attributes']:_0x10f3f7[_0x6a11('0x2d')];if(!_0x378915[_0x6a11('0x2e')][_0x6a11('0x35')](_0x6a11('0x36'))){_0x5871e8[_0x6a11('0x1d')]=qs['limit'](_0x378915['query'][_0x6a11('0x1d')]);_0x5871e8[_0x6a11('0x1b')]=qs[_0x6a11('0x1b')](_0x378915['query'][_0x6a11('0x1b')]);}_0x5871e8['order']=qs[_0x6a11('0x37')](_0x378915[_0x6a11('0x2e')][_0x6a11('0x37')]);_0x5871e8[_0x6a11('0x38')]=qs['filters'](_[_0x6a11('0x39')](_0x378915['query'],_0x10f3f7['filters']),_0x38389b);if(_0x378915[_0x6a11('0x2e')]['filter']){_0x5871e8[_0x6a11('0x38')]=_['merge'](_0x5871e8[_0x6a11('0x38')],{'$or':_[_0x6a11('0x3a')](_0x38389b,function(_0x26a611){if(_0x26a611[_0x6a11('0x3b')]!==_0x6a11('0x3c')){var _0xf14a67={};_0xf14a67[_0x26a611[_0x6a11('0x26')]]={'$like':'%'+_0x378915[_0x6a11('0x2e')]['filter']+'%'};return _0xf14a67;}})});}_0x5871e8=_['merge']({},_0x5871e8,_0x378915[_0x6a11('0x3d')]);var _0x231421={'where':_0x5871e8[_0x6a11('0x38')]};return db[_0x6a11('0x29')]['count'](_0x231421)[_0x6a11('0x24')](function(_0xbcf052){_0x47a508[_0x6a11('0x1e')]=_0xbcf052;if(_0x378915['query'][_0x6a11('0x3e')]){_0x5871e8[_0x6a11('0x3f')]=[{'all':!![]}];}return db[_0x6a11('0x29')][_0x6a11('0x40')](_0x5871e8);})[_0x6a11('0x24')](function(_0x5d4336){_0x47a508['rows']=_0x5d4336;return _0x47a508;})[_0x6a11('0x24')](respondWithFilteredResult(_0x564936,_0x5871e8))[_0x6a11('0x41')](handleError(_0x564936,null));};exports[_0x6a11('0x42')]=function(_0x14ea00,_0x491f35){var _0x1429d6={'raw':![],'where':{'id':_0x14ea00['params']['id']}},_0xba8077={};_0xba8077[_0x6a11('0x2d')]=_[_0x6a11('0x2f')](db[_0x6a11('0x29')]['rawAttributes']);_0xba8077['query']=_[_0x6a11('0x2f')](_0x14ea00['query']);_0xba8077[_0x6a11('0x30')]=_[_0x6a11('0x31')](_0xba8077[_0x6a11('0x2d')],_0xba8077['query']);_0x1429d6[_0x6a11('0x32')]=_['intersection'](_0xba8077['model'],qs[_0x6a11('0x33')](_0x14ea00[_0x6a11('0x2e')]['fields']));_0x1429d6[_0x6a11('0x32')]=_0x1429d6['attributes'][_0x6a11('0x34')]?_0x1429d6[_0x6a11('0x32')]:_0xba8077[_0x6a11('0x2d')];if(_0x14ea00['query']['includeAll']){_0x1429d6['include']=[{'all':!![]}];}_0x1429d6=_[_0x6a11('0x43')]({},_0x1429d6,_0x14ea00[_0x6a11('0x3d')]);return db[_0x6a11('0x29')][_0x6a11('0x44')](_0x1429d6)[_0x6a11('0x24')](handleEntityNotFound(_0x491f35,null))['then'](respondWithResult(_0x491f35,null))['catch'](handleError(_0x491f35,null));};exports[_0x6a11('0x45')]=function(_0x5243de,_0x1c51a2){return db[_0x6a11('0x29')][_0x6a11('0x45')](_0x5243de[_0x6a11('0x46')],{})[_0x6a11('0x24')](respondWithResult(_0x1c51a2,0xc9))[_0x6a11('0x41')](handleError(_0x1c51a2,null));};exports[_0x6a11('0x47')]=function(_0x345e2c,_0x120f5e){if(_0x345e2c[_0x6a11('0x46')]['id']){delete _0x345e2c[_0x6a11('0x46')]['id'];}return db[_0x6a11('0x29')][_0x6a11('0x44')]({'where':{'id':_0x345e2c[_0x6a11('0x48')]['id']}})[_0x6a11('0x24')](handleEntityNotFound(_0x120f5e,null))[_0x6a11('0x24')](saveUpdates(_0x345e2c[_0x6a11('0x46')],null))[_0x6a11('0x24')](respondWithResult(_0x120f5e,null))[_0x6a11('0x41')](handleError(_0x120f5e,null));};exports[_0x6a11('0x23')]=function(_0x421e6c,_0x380aa1){return db[_0x6a11('0x29')][_0x6a11('0x44')]({'where':{'id':_0x421e6c['params']['id']}})[_0x6a11('0x24')](handleEntityNotFound(_0x380aa1,null))[_0x6a11('0x24')](removeEntity(_0x380aa1,null))[_0x6a11('0x41')](handleError(_0x380aa1,null));};exports['getFields']=function(_0x19026c,_0x1d8a5c,_0xea717d){var _0x4fc5be={};var _0x324bfc={};var _0x551652;var _0x43a785;return db['Dynamics365Configuration'][_0x6a11('0x49')]({'where':{'id':_0x19026c[_0x6a11('0x48')]['id']}})[_0x6a11('0x24')](handleEntityNotFound(_0x1d8a5c,null))[_0x6a11('0x24')](function(_0x2d9b8c){if(_0x2d9b8c){_0x551652=_0x2d9b8c;_0x324bfc['model']=_[_0x6a11('0x2f')](db['Dynamics365Field'][_0x6a11('0x2a')]);_0x324bfc[_0x6a11('0x2e')]=_[_0x6a11('0x2f')](_0x19026c[_0x6a11('0x2e')]);_0x324bfc[_0x6a11('0x30')]=_['intersection'](_0x324bfc['model'],_0x324bfc['query']);_0x4fc5be[_0x6a11('0x32')]=_['intersection'](_0x324bfc[_0x6a11('0x2d')],qs[_0x6a11('0x33')](_0x19026c[_0x6a11('0x2e')]['fields']));_0x4fc5be[_0x6a11('0x32')]=_0x4fc5be[_0x6a11('0x32')][_0x6a11('0x34')]?_0x4fc5be['attributes']:_0x324bfc[_0x6a11('0x2d')];_0x4fc5be[_0x6a11('0x4a')]=qs[_0x6a11('0x37')](_0x19026c[_0x6a11('0x2e')][_0x6a11('0x37')]);_0x4fc5be[_0x6a11('0x38')]=qs[_0x6a11('0x30')](_[_0x6a11('0x39')](_0x19026c[_0x6a11('0x2e')],_0x324bfc[_0x6a11('0x30')]));if(_0x19026c['query'][_0x6a11('0x4b')]){_0x4fc5be['where']=_[_0x6a11('0x43')](_0x4fc5be[_0x6a11('0x38')],{'$or':_[_0x6a11('0x3a')](_0x4fc5be['attributes'],function(_0x3eb355){var _0x2a46b4={};_0x2a46b4[_0x3eb355]={'$like':'%'+_0x19026c[_0x6a11('0x2e')][_0x6a11('0x4b')]+'%'};return _0x2a46b4;})});}_0x4fc5be=_[_0x6a11('0x43')]({},_0x4fc5be,_0x19026c['options']);return _0x551652['getFields'](_0x4fc5be);}})[_0x6a11('0x24')](function(_0x3c7890){if(_0x3c7890){_0x43a785=_0x3c7890[_0x6a11('0x34')];if(!_0x19026c[_0x6a11('0x2e')][_0x6a11('0x35')](_0x6a11('0x36'))){_0x4fc5be[_0x6a11('0x1d')]=qs[_0x6a11('0x1d')](_0x19026c['query']['limit']);_0x4fc5be[_0x6a11('0x1b')]=qs[_0x6a11('0x1b')](_0x19026c[_0x6a11('0x2e')][_0x6a11('0x1b')]);}return _0x551652[_0x6a11('0x4c')](_0x4fc5be);}})[_0x6a11('0x24')](function(_0x2dc012){if(_0x2dc012){return _0x2dc012?{'count':_0x43a785,'rows':_0x2dc012}:null;}})[_0x6a11('0x24')](respondWithResult(_0x1d8a5c,null))[_0x6a11('0x41')](handleError(_0x1d8a5c,null));};exports[_0x6a11('0x4d')]=function(_0x24dfad,_0x7e1de1,_0xcccd82){var _0x5992df={};var _0x5d5c1b={};var _0x3add81;var _0x191cf1;return db[_0x6a11('0x29')]['findOne']({'where':{'id':_0x24dfad[_0x6a11('0x48')]['id']}})[_0x6a11('0x24')](handleEntityNotFound(_0x7e1de1,null))[_0x6a11('0x24')](function(_0x43466b){if(_0x43466b){_0x3add81=_0x43466b;_0x5d5c1b[_0x6a11('0x2d')]=_[_0x6a11('0x2f')](db[_0x6a11('0x4e')]['rawAttributes']);_0x5d5c1b[_0x6a11('0x2e')]=_[_0x6a11('0x2f')](_0x24dfad['query']);_0x5d5c1b[_0x6a11('0x30')]=_[_0x6a11('0x31')](_0x5d5c1b['model'],_0x5d5c1b[_0x6a11('0x2e')]);_0x5992df['attributes']=_[_0x6a11('0x31')](_0x5d5c1b['model'],qs['fields'](_0x24dfad[_0x6a11('0x2e')][_0x6a11('0x33')]));_0x5992df[_0x6a11('0x32')]=_0x5992df[_0x6a11('0x32')]['length']?_0x5992df[_0x6a11('0x32')]:_0x5d5c1b[_0x6a11('0x2d')];_0x5992df[_0x6a11('0x4a')]=qs[_0x6a11('0x37')](_0x24dfad[_0x6a11('0x2e')][_0x6a11('0x37')]);_0x5992df[_0x6a11('0x38')]=qs[_0x6a11('0x30')](_['pick'](_0x24dfad[_0x6a11('0x2e')],_0x5d5c1b['filters']));if(_0x24dfad[_0x6a11('0x2e')][_0x6a11('0x4b')]){_0x5992df[_0x6a11('0x38')]=_['merge'](_0x5992df[_0x6a11('0x38')],{'$or':_[_0x6a11('0x3a')](_0x5992df[_0x6a11('0x32')],function(_0x3d4804){var _0x461bb0={};_0x461bb0[_0x3d4804]={'$like':'%'+_0x24dfad[_0x6a11('0x2e')][_0x6a11('0x4b')]+'%'};return _0x461bb0;})});}_0x5992df=_['merge']({},_0x5992df,_0x24dfad[_0x6a11('0x3d')]);return _0x3add81[_0x6a11('0x4d')](_0x5992df);}})['then'](function(_0x3d81e0){if(_0x3d81e0){_0x191cf1=_0x3d81e0[_0x6a11('0x34')];if(!_0x24dfad['query'][_0x6a11('0x35')](_0x6a11('0x36'))){_0x5992df[_0x6a11('0x1d')]=qs[_0x6a11('0x1d')](_0x24dfad['query'][_0x6a11('0x1d')]);_0x5992df[_0x6a11('0x1b')]=qs['offset'](_0x24dfad['query']['offset']);}return _0x3add81['getSubjects'](_0x5992df);}})[_0x6a11('0x24')](function(_0x4a294d){if(_0x4a294d){return _0x4a294d?{'count':_0x191cf1,'rows':_0x4a294d}:null;}})['then'](respondWithResult(_0x7e1de1,null))[_0x6a11('0x41')](handleError(_0x7e1de1,null));};exports[_0x6a11('0x4f')]=function(_0x2a692a,_0x29f9dc,_0x523181){var _0x588399={};var _0x5bdd24={};var _0x916e1b;var _0x213751;return db[_0x6a11('0x29')]['findOne']({'where':{'id':_0x2a692a['params']['id']}})[_0x6a11('0x24')](handleEntityNotFound(_0x29f9dc,null))[_0x6a11('0x24')](function(_0x4cec04){if(_0x4cec04){_0x916e1b=_0x4cec04;_0x5bdd24[_0x6a11('0x2d')]=_[_0x6a11('0x2f')](db['Dynamics365Field'][_0x6a11('0x2a')]);_0x5bdd24[_0x6a11('0x2e')]=_[_0x6a11('0x2f')](_0x2a692a[_0x6a11('0x2e')]);_0x5bdd24[_0x6a11('0x30')]=_[_0x6a11('0x31')](_0x5bdd24[_0x6a11('0x2d')],_0x5bdd24[_0x6a11('0x2e')]);_0x588399[_0x6a11('0x32')]=_[_0x6a11('0x31')](_0x5bdd24[_0x6a11('0x2d')],qs['fields'](_0x2a692a['query'][_0x6a11('0x33')]));_0x588399[_0x6a11('0x32')]=_0x588399[_0x6a11('0x32')][_0x6a11('0x34')]?_0x588399[_0x6a11('0x32')]:_0x5bdd24['model'];_0x588399['order']=qs[_0x6a11('0x37')](_0x2a692a[_0x6a11('0x2e')][_0x6a11('0x37')]);_0x588399[_0x6a11('0x38')]=qs['filters'](_[_0x6a11('0x39')](_0x2a692a['query'],_0x5bdd24['filters']));if(_0x2a692a[_0x6a11('0x2e')][_0x6a11('0x4b')]){_0x588399[_0x6a11('0x38')]=_[_0x6a11('0x43')](_0x588399[_0x6a11('0x38')],{'$or':_[_0x6a11('0x3a')](_0x588399[_0x6a11('0x32')],function(_0x3ff00b){var _0x48e6c8={};_0x48e6c8[_0x3ff00b]={'$like':'%'+_0x2a692a[_0x6a11('0x2e')][_0x6a11('0x4b')]+'%'};return _0x48e6c8;})});}_0x588399=_[_0x6a11('0x43')]({},_0x588399,_0x2a692a[_0x6a11('0x3d')]);return _0x916e1b[_0x6a11('0x4f')](_0x588399);}})['then'](function(_0x57a60e){if(_0x57a60e){_0x213751=_0x57a60e[_0x6a11('0x34')];if(!_0x2a692a[_0x6a11('0x2e')][_0x6a11('0x35')](_0x6a11('0x36'))){_0x588399[_0x6a11('0x1d')]=qs[_0x6a11('0x1d')](_0x2a692a[_0x6a11('0x2e')][_0x6a11('0x1d')]);_0x588399[_0x6a11('0x1b')]=qs[_0x6a11('0x1b')](_0x2a692a[_0x6a11('0x2e')]['offset']);}return _0x916e1b['getDescriptions'](_0x588399);}})[_0x6a11('0x24')](function(_0x33fae5){if(_0x33fae5){return _0x33fae5?{'count':_0x213751,'rows':_0x33fae5}:null;}})[_0x6a11('0x24')](respondWithResult(_0x29f9dc,null))['catch'](handleError(_0x29f9dc,null));}; \ No newline at end of file +var _0xe738=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','update','destroy','error','name','send','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','VIRTUAL','merge','options','Dynamics365Configuration','then','includeAll','include','findAll','rows','show','params','fields','find','create','body','catch','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe738,0xe9));var _0x8e73=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe738[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x8e73('0x0'));var rimraf=require(_0x8e73('0x1'));var zipdir=require(_0x8e73('0x2'));var jsonpatch=require(_0x8e73('0x3'));var rp=require(_0x8e73('0x4'));var moment=require(_0x8e73('0x5'));var BPromise=require(_0x8e73('0x6'));var Mustache=require(_0x8e73('0x7'));var util=require(_0x8e73('0x8'));var path=require(_0x8e73('0x9'));var sox=require('sox');var csv=require(_0x8e73('0xa'));var ejs=require(_0x8e73('0xb'));var fs=require('fs');var fs_extra=require(_0x8e73('0xc'));var _=require(_0x8e73('0xd'));var squel=require(_0x8e73('0xe'));var crypto=require('crypto');var jsforce=require(_0x8e73('0xf'));var deskjs=require(_0x8e73('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8e73('0x11'));var authService=require(_0x8e73('0x12'));var qs=require(_0x8e73('0x13'));var as=require(_0x8e73('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e73('0x15'))(_0x8e73('0x16'));var utils=require('../../config/utils');var config=require(_0x8e73('0x17'));var licenseUtil=require(_0x8e73('0x18'));var db=require(_0x8e73('0x19'))['db'];function respondWithStatusCode(_0xbf6c38,_0x372b2a){_0x372b2a=_0x372b2a||0xcc;return function(_0x3f6446){if(_0x3f6446){return _0xbf6c38[_0x8e73('0x1a')](_0x372b2a);}return _0xbf6c38[_0x8e73('0x1b')](_0x372b2a)[_0x8e73('0x1c')]();};}function respondWithResult(_0x3f2f0e,_0x3b9202){_0x3b9202=_0x3b9202||0xc8;return function(_0x96ffd1){if(_0x96ffd1){return _0x3f2f0e[_0x8e73('0x1b')](_0x3b9202)[_0x8e73('0x1d')](_0x96ffd1);}};}function respondWithFilteredResult(_0x1dad83,_0x10d98e){return function(_0x43ad37){if(_0x43ad37){var _0x7c1b02=typeof _0x10d98e['offset']===_0x8e73('0x1e')&&typeof _0x10d98e[_0x8e73('0x1f')]===_0x8e73('0x1e');var _0x315ddd=_0x43ad37[_0x8e73('0x20')];var _0x944b2e=_0x7c1b02?0x0:_0x10d98e['offset'];var _0x3d08b8=_0x7c1b02?_0x43ad37['count']:_0x10d98e['offset']+_0x10d98e[_0x8e73('0x1f')];var _0x52f705;if(_0x3d08b8>=_0x315ddd){_0x3d08b8=_0x315ddd;_0x52f705=0xc8;}else{_0x52f705=0xce;}_0x1dad83['status'](_0x52f705);return _0x1dad83[_0x8e73('0x21')](_0x8e73('0x22'),_0x944b2e+'-'+_0x3d08b8+'/'+_0x315ddd)[_0x8e73('0x1d')](_0x43ad37);}return null;};}function patchUpdates(_0x578b76){return function(_0xb97b28){try{jsonpatch[_0x8e73('0x23')](_0xb97b28,_0x578b76,!![]);}catch(_0x1a6f4c){return BPromise['reject'](_0x1a6f4c);}return _0xb97b28['save']();};}function saveUpdates(_0x4d0e58,_0x43899b){return function(_0x10f3d2){if(_0x10f3d2){return _0x10f3d2[_0x8e73('0x24')](_0x4d0e58)['then'](function(_0x1a185e){return _0x1a185e;});}return null;};}function removeEntity(_0x51e451,_0x48de0f){return function(_0x28f2c2){if(_0x28f2c2){return _0x28f2c2[_0x8e73('0x25')]()['then'](function(){_0x51e451[_0x8e73('0x1b')](0xcc)[_0x8e73('0x1c')]();});}};}function handleEntityNotFound(_0x3b95ac,_0x44c152){return function(_0x420a6f){if(!_0x420a6f){_0x3b95ac['sendStatus'](0x194);}return _0x420a6f;};}function handleError(_0x3a2007,_0x2aae53){_0x2aae53=_0x2aae53||0x1f4;return function(_0x18211d){logger[_0x8e73('0x26')](_0x18211d['stack']);if(_0x18211d[_0x8e73('0x27')]){delete _0x18211d[_0x8e73('0x27')];}_0x3a2007[_0x8e73('0x1b')](_0x2aae53)[_0x8e73('0x28')](_0x18211d);};}exports['index']=function(_0xed87c3,_0x276b95){var _0x565b06={},_0x315c8f={},_0xbbee83={'count':0x0,'rows':[]};var _0xb1fb5c=_['map'](db['Dynamics365Configuration'][_0x8e73('0x29')],function(_0x2fe826){return{'name':_0x2fe826[_0x8e73('0x2a')],'type':_0x2fe826['type'][_0x8e73('0x2b')]};});_0x315c8f['model']=_['map'](_0xb1fb5c,_0x8e73('0x27'));_0x315c8f[_0x8e73('0x2c')]=_[_0x8e73('0x2d')](_0xed87c3[_0x8e73('0x2c')]);_0x315c8f[_0x8e73('0x2e')]=_[_0x8e73('0x2f')](_0x315c8f[_0x8e73('0x30')],_0x315c8f[_0x8e73('0x2c')]);_0x565b06[_0x8e73('0x31')]=_[_0x8e73('0x2f')](_0x315c8f[_0x8e73('0x30')],qs['fields'](_0xed87c3['query']['fields']));_0x565b06['attributes']=_0x565b06[_0x8e73('0x31')][_0x8e73('0x32')]?_0x565b06[_0x8e73('0x31')]:_0x315c8f['model'];if(!_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x33')](_0x8e73('0x34'))){_0x565b06[_0x8e73('0x1f')]=qs[_0x8e73('0x1f')](_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x1f')]);_0x565b06[_0x8e73('0x35')]=qs[_0x8e73('0x35')](_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x35')]);}_0x565b06[_0x8e73('0x36')]=qs[_0x8e73('0x37')](_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x37')]);_0x565b06[_0x8e73('0x38')]=qs[_0x8e73('0x2e')](_[_0x8e73('0x39')](_0xed87c3[_0x8e73('0x2c')],_0x315c8f[_0x8e73('0x2e')]),_0xb1fb5c);if(_0xed87c3['query'][_0x8e73('0x3a')]){_0x565b06[_0x8e73('0x38')]=_['merge'](_0x565b06[_0x8e73('0x38')],{'$or':_[_0x8e73('0x3b')](_0xb1fb5c,function(_0x3ae0d1){if(_0x3ae0d1['type']!==_0x8e73('0x3c')){var _0x4e74a4={};_0x4e74a4[_0x3ae0d1[_0x8e73('0x27')]]={'$like':'%'+_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x3a')]+'%'};return _0x4e74a4;}})});}_0x565b06=_[_0x8e73('0x3d')]({},_0x565b06,_0xed87c3[_0x8e73('0x3e')]);var _0x3cbcc5={'where':_0x565b06[_0x8e73('0x38')]};return db[_0x8e73('0x3f')][_0x8e73('0x20')](_0x3cbcc5)[_0x8e73('0x40')](function(_0x3918d2){_0xbbee83[_0x8e73('0x20')]=_0x3918d2;if(_0xed87c3[_0x8e73('0x2c')][_0x8e73('0x41')]){_0x565b06[_0x8e73('0x42')]=[{'all':!![]}];}return db[_0x8e73('0x3f')][_0x8e73('0x43')](_0x565b06);})[_0x8e73('0x40')](function(_0x3e0d56){_0xbbee83[_0x8e73('0x44')]=_0x3e0d56;return _0xbbee83;})[_0x8e73('0x40')](respondWithFilteredResult(_0x276b95,_0x565b06))['catch'](handleError(_0x276b95,null));};exports[_0x8e73('0x45')]=function(_0x39da03,_0x522eb0){var _0x1f607b={'raw':![],'where':{'id':_0x39da03[_0x8e73('0x46')]['id']}},_0x249f74={};_0x249f74['model']=_[_0x8e73('0x2d')](db['Dynamics365Configuration'][_0x8e73('0x29')]);_0x249f74[_0x8e73('0x2c')]=_['keys'](_0x39da03['query']);_0x249f74[_0x8e73('0x2e')]=_[_0x8e73('0x2f')](_0x249f74[_0x8e73('0x30')],_0x249f74[_0x8e73('0x2c')]);_0x1f607b[_0x8e73('0x31')]=_['intersection'](_0x249f74[_0x8e73('0x30')],qs[_0x8e73('0x47')](_0x39da03[_0x8e73('0x2c')][_0x8e73('0x47')]));_0x1f607b[_0x8e73('0x31')]=_0x1f607b[_0x8e73('0x31')]['length']?_0x1f607b[_0x8e73('0x31')]:_0x249f74[_0x8e73('0x30')];if(_0x39da03[_0x8e73('0x2c')][_0x8e73('0x41')]){_0x1f607b['include']=[{'all':!![]}];}_0x1f607b=_[_0x8e73('0x3d')]({},_0x1f607b,_0x39da03[_0x8e73('0x3e')]);return db[_0x8e73('0x3f')][_0x8e73('0x48')](_0x1f607b)[_0x8e73('0x40')](handleEntityNotFound(_0x522eb0,null))[_0x8e73('0x40')](respondWithResult(_0x522eb0,null))['catch'](handleError(_0x522eb0,null));};exports[_0x8e73('0x49')]=function(_0x483d1b,_0x88108){return db[_0x8e73('0x3f')][_0x8e73('0x49')](_0x483d1b[_0x8e73('0x4a')],{})[_0x8e73('0x40')](respondWithResult(_0x88108,0xc9))[_0x8e73('0x4b')](handleError(_0x88108,null));};exports['update']=function(_0x101d1a,_0x290a6e){if(_0x101d1a[_0x8e73('0x4a')]['id']){delete _0x101d1a[_0x8e73('0x4a')]['id'];}return db[_0x8e73('0x3f')]['find']({'where':{'id':_0x101d1a[_0x8e73('0x46')]['id']}})[_0x8e73('0x40')](handleEntityNotFound(_0x290a6e,null))[_0x8e73('0x40')](saveUpdates(_0x101d1a['body'],null))[_0x8e73('0x40')](respondWithResult(_0x290a6e,null))[_0x8e73('0x4b')](handleError(_0x290a6e,null));};exports[_0x8e73('0x25')]=function(_0x5bb07f,_0x23f608){return db[_0x8e73('0x3f')][_0x8e73('0x48')]({'where':{'id':_0x5bb07f[_0x8e73('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f608,null))[_0x8e73('0x40')](removeEntity(_0x23f608,null))['catch'](handleError(_0x23f608,null));};exports['getFields']=function(_0x343341,_0x310c1e,_0x2d3f97){var _0x340a20={};var _0x4ceda7={};var _0x4fa035;var _0x5a2c34;return db[_0x8e73('0x3f')][_0x8e73('0x4c')]({'where':{'id':_0x343341['params']['id']}})[_0x8e73('0x40')](handleEntityNotFound(_0x310c1e,null))[_0x8e73('0x40')](function(_0x3dd043){if(_0x3dd043){_0x4fa035=_0x3dd043;_0x4ceda7['model']=_[_0x8e73('0x2d')](db[_0x8e73('0x4d')][_0x8e73('0x29')]);_0x4ceda7[_0x8e73('0x2c')]=_[_0x8e73('0x2d')](_0x343341[_0x8e73('0x2c')]);_0x4ceda7['filters']=_['intersection'](_0x4ceda7[_0x8e73('0x30')],_0x4ceda7['query']);_0x340a20['attributes']=_[_0x8e73('0x2f')](_0x4ceda7[_0x8e73('0x30')],qs[_0x8e73('0x47')](_0x343341[_0x8e73('0x2c')][_0x8e73('0x47')]));_0x340a20[_0x8e73('0x31')]=_0x340a20[_0x8e73('0x31')][_0x8e73('0x32')]?_0x340a20[_0x8e73('0x31')]:_0x4ceda7['model'];_0x340a20[_0x8e73('0x36')]=qs[_0x8e73('0x37')](_0x343341[_0x8e73('0x2c')][_0x8e73('0x37')]);_0x340a20[_0x8e73('0x38')]=qs['filters'](_[_0x8e73('0x39')](_0x343341[_0x8e73('0x2c')],_0x4ceda7[_0x8e73('0x2e')]));if(_0x343341[_0x8e73('0x2c')][_0x8e73('0x3a')]){_0x340a20[_0x8e73('0x38')]=_[_0x8e73('0x3d')](_0x340a20[_0x8e73('0x38')],{'$or':_['map'](_0x340a20[_0x8e73('0x31')],function(_0x397a47){var _0x588a9e={};_0x588a9e[_0x397a47]={'$like':'%'+_0x343341[_0x8e73('0x2c')][_0x8e73('0x3a')]+'%'};return _0x588a9e;})});}_0x340a20=_[_0x8e73('0x3d')]({},_0x340a20,_0x343341[_0x8e73('0x3e')]);return _0x4fa035[_0x8e73('0x4e')](_0x340a20);}})[_0x8e73('0x40')](function(_0x394744){if(_0x394744){_0x5a2c34=_0x394744[_0x8e73('0x32')];if(!_0x343341[_0x8e73('0x2c')][_0x8e73('0x33')]('nolimit')){_0x340a20[_0x8e73('0x1f')]=qs[_0x8e73('0x1f')](_0x343341[_0x8e73('0x2c')][_0x8e73('0x1f')]);_0x340a20[_0x8e73('0x35')]=qs[_0x8e73('0x35')](_0x343341[_0x8e73('0x2c')]['offset']);}return _0x4fa035[_0x8e73('0x4e')](_0x340a20);}})[_0x8e73('0x40')](function(_0xee3ae5){if(_0xee3ae5){return _0xee3ae5?{'count':_0x5a2c34,'rows':_0xee3ae5}:null;}})[_0x8e73('0x40')](respondWithResult(_0x310c1e,null))[_0x8e73('0x4b')](handleError(_0x310c1e,null));};exports[_0x8e73('0x4f')]=function(_0x4a582a,_0x157324,_0x2cd451){var _0x5f1488={};var _0x3adf0d={};var _0x5d16e3;var _0x3cba57;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4a582a[_0x8e73('0x46')]['id']}})[_0x8e73('0x40')](handleEntityNotFound(_0x157324,null))[_0x8e73('0x40')](function(_0x3f93d2){if(_0x3f93d2){_0x5d16e3=_0x3f93d2;_0x3adf0d[_0x8e73('0x30')]=_[_0x8e73('0x2d')](db['Dynamics365Field'][_0x8e73('0x29')]);_0x3adf0d[_0x8e73('0x2c')]=_['keys'](_0x4a582a[_0x8e73('0x2c')]);_0x3adf0d[_0x8e73('0x2e')]=_['intersection'](_0x3adf0d[_0x8e73('0x30')],_0x3adf0d[_0x8e73('0x2c')]);_0x5f1488['attributes']=_[_0x8e73('0x2f')](_0x3adf0d[_0x8e73('0x30')],qs['fields'](_0x4a582a[_0x8e73('0x2c')][_0x8e73('0x47')]));_0x5f1488[_0x8e73('0x31')]=_0x5f1488[_0x8e73('0x31')][_0x8e73('0x32')]?_0x5f1488[_0x8e73('0x31')]:_0x3adf0d[_0x8e73('0x30')];_0x5f1488[_0x8e73('0x36')]=qs[_0x8e73('0x37')](_0x4a582a[_0x8e73('0x2c')]['sort']);_0x5f1488[_0x8e73('0x38')]=qs['filters'](_[_0x8e73('0x39')](_0x4a582a[_0x8e73('0x2c')],_0x3adf0d[_0x8e73('0x2e')]));if(_0x4a582a['query'][_0x8e73('0x3a')]){_0x5f1488[_0x8e73('0x38')]=_[_0x8e73('0x3d')](_0x5f1488[_0x8e73('0x38')],{'$or':_[_0x8e73('0x3b')](_0x5f1488[_0x8e73('0x31')],function(_0x2a24fa){var _0x115050={};_0x115050[_0x2a24fa]={'$like':'%'+_0x4a582a[_0x8e73('0x2c')][_0x8e73('0x3a')]+'%'};return _0x115050;})});}_0x5f1488=_[_0x8e73('0x3d')]({},_0x5f1488,_0x4a582a['options']);return _0x5d16e3['getSubjects'](_0x5f1488);}})['then'](function(_0x10dfbf){if(_0x10dfbf){_0x3cba57=_0x10dfbf[_0x8e73('0x32')];if(!_0x4a582a[_0x8e73('0x2c')][_0x8e73('0x33')](_0x8e73('0x34'))){_0x5f1488[_0x8e73('0x1f')]=qs['limit'](_0x4a582a[_0x8e73('0x2c')][_0x8e73('0x1f')]);_0x5f1488[_0x8e73('0x35')]=qs['offset'](_0x4a582a[_0x8e73('0x2c')][_0x8e73('0x35')]);}return _0x5d16e3[_0x8e73('0x4f')](_0x5f1488);}})[_0x8e73('0x40')](function(_0x4d07da){if(_0x4d07da){return _0x4d07da?{'count':_0x3cba57,'rows':_0x4d07da}:null;}})['then'](respondWithResult(_0x157324,null))['catch'](handleError(_0x157324,null));};exports['getDescriptions']=function(_0x18d97f,_0x521635,_0x314ef5){var _0x29ddbf={};var _0x264d8d={};var _0xf33b38;var _0x1f1a8b;return db[_0x8e73('0x3f')]['findOne']({'where':{'id':_0x18d97f[_0x8e73('0x46')]['id']}})[_0x8e73('0x40')](handleEntityNotFound(_0x521635,null))[_0x8e73('0x40')](function(_0x5087aa){if(_0x5087aa){_0xf33b38=_0x5087aa;_0x264d8d[_0x8e73('0x30')]=_[_0x8e73('0x2d')](db[_0x8e73('0x4d')][_0x8e73('0x29')]);_0x264d8d[_0x8e73('0x2c')]=_[_0x8e73('0x2d')](_0x18d97f[_0x8e73('0x2c')]);_0x264d8d['filters']=_[_0x8e73('0x2f')](_0x264d8d[_0x8e73('0x30')],_0x264d8d['query']);_0x29ddbf[_0x8e73('0x31')]=_[_0x8e73('0x2f')](_0x264d8d['model'],qs[_0x8e73('0x47')](_0x18d97f[_0x8e73('0x2c')]['fields']));_0x29ddbf[_0x8e73('0x31')]=_0x29ddbf[_0x8e73('0x31')]['length']?_0x29ddbf['attributes']:_0x264d8d[_0x8e73('0x30')];_0x29ddbf[_0x8e73('0x36')]=qs[_0x8e73('0x37')](_0x18d97f['query'][_0x8e73('0x37')]);_0x29ddbf[_0x8e73('0x38')]=qs[_0x8e73('0x2e')](_[_0x8e73('0x39')](_0x18d97f[_0x8e73('0x2c')],_0x264d8d[_0x8e73('0x2e')]));if(_0x18d97f['query']['filter']){_0x29ddbf[_0x8e73('0x38')]=_[_0x8e73('0x3d')](_0x29ddbf[_0x8e73('0x38')],{'$or':_[_0x8e73('0x3b')](_0x29ddbf['attributes'],function(_0x515da4){var _0x1c5345={};_0x1c5345[_0x515da4]={'$like':'%'+_0x18d97f[_0x8e73('0x2c')]['filter']+'%'};return _0x1c5345;})});}_0x29ddbf=_['merge']({},_0x29ddbf,_0x18d97f[_0x8e73('0x3e')]);return _0xf33b38[_0x8e73('0x50')](_0x29ddbf);}})[_0x8e73('0x40')](function(_0x5d1706){if(_0x5d1706){_0x1f1a8b=_0x5d1706['length'];if(!_0x18d97f[_0x8e73('0x2c')]['hasOwnProperty'](_0x8e73('0x34'))){_0x29ddbf[_0x8e73('0x1f')]=qs[_0x8e73('0x1f')](_0x18d97f[_0x8e73('0x2c')][_0x8e73('0x1f')]);_0x29ddbf[_0x8e73('0x35')]=qs['offset'](_0x18d97f['query']['offset']);}return _0xf33b38['getDescriptions'](_0x29ddbf);}})[_0x8e73('0x40')](function(_0x11ea4c){if(_0x11ea4c){return _0x11ea4c?{'count':_0x1f1a8b,'rows':_0x11ea4c}:null;}})[_0x8e73('0x40')](respondWithResult(_0x521635,null))[_0x8e73('0x4b')](handleError(_0x521635,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 3689d4f..78ecf07 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x292423,_0x1759b7){_0x292423=_0x292423-0x0;var _0x2801cb=_0x4b84[_0x292423];return _0x2801cb;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0x008c,0x188));var _0xc008=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x008c[_0x1ebd10];return _0x1004d3;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 33a3894..2c6ec6c 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 _0x4e49=['info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x24e369,_0x56406b){var _0x4a1dd3=function(_0x463676){while(--_0x463676){_0x24e369['push'](_0x24e369['shift']());}};_0x4a1dd3(++_0x56406b);}(_0x4e49,0x80));var _0x94e4=function(_0x3b68c0,_0x26f208){_0x3b68c0=_0x3b68c0-0x0;var _0x195f2f=_0x4e49[_0x3b68c0];return _0x195f2f;};'use strict';var _=require(_0x94e4('0x0'));var util=require('util');var moment=require(_0x94e4('0x1'));var BPromise=require(_0x94e4('0x2'));var rs=require(_0x94e4('0x3'));var fs=require('fs');var Redis=require(_0x94e4('0x4'));var db=require(_0x94e4('0x5'))['db'];var utils=require(_0x94e4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x94e4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94e4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311d1e,_0x58d5e5,_0x2c91d6){return new BPromise(function(_0x50f144,_0x1ed493){return client[_0x94e4('0x9')](_0x311d1e,_0x2c91d6)['then'](function(_0x176cee){logger['info'](_0x94e4('0xa'),_0x58d5e5,_0x94e4('0xb'));logger[_0x94e4('0xc')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x58d5e5,_0x94e4('0xb'),JSON[_0x94e4('0xd')](_0x176cee));if(_0x176cee[_0x94e4('0xe')]){if(_0x176cee['error']['code']===0x1f4){logger[_0x94e4('0xe')](_0x94e4('0xa'),_0x58d5e5,_0x176cee['error'][_0x94e4('0xf')]);return _0x1ed493(_0x176cee[_0x94e4('0xe')]['message']);}logger[_0x94e4('0xe')](_0x94e4('0xa'),_0x58d5e5,_0x176cee[_0x94e4('0xe')][_0x94e4('0xf')]);return _0x50f144(_0x176cee[_0x94e4('0xe')]['message']);}else{logger[_0x94e4('0x10')](_0x94e4('0xa'),_0x58d5e5,_0x94e4('0xb'));_0x50f144(_0x176cee[_0x94e4('0x11')]['message']);}})['catch'](function(_0x3389fc){logger['error'](_0x94e4('0xa'),_0x58d5e5,_0x3389fc);_0x1ed493(_0x3389fc);});});} \ No newline at end of file +var _0x0b7d=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x0b7d,0xd0));var _0xd0b7=function(_0x531b1e,_0x301978){_0x531b1e=_0x531b1e-0x0;var _0x1208b6=_0x0b7d[_0x531b1e];return _0x1208b6;};'use strict';var _=require(_0xd0b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd0b7('0x1'));var rs=require(_0xd0b7('0x2'));var fs=require('fs');var Redis=require(_0xd0b7('0x3'));var db=require(_0xd0b7('0x4'))['db'];var utils=require(_0xd0b7('0x5'));var logger=require(_0xd0b7('0x6'))(_0xd0b7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0b7('0x8')][_0xd0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x214c3d,_0x533bda,_0x54a1f1){return new BPromise(function(_0x548004,_0x3247e2){return client[_0xd0b7('0xa')](_0x214c3d,_0x54a1f1)[_0xd0b7('0xb')](function(_0x4ffd39){logger[_0xd0b7('0xc')](_0xd0b7('0xd'),_0x533bda,_0xd0b7('0xe'));logger[_0xd0b7('0xf')](_0xd0b7('0x10'),_0x533bda,_0xd0b7('0xe'),JSON[_0xd0b7('0x11')](_0x4ffd39));if(_0x4ffd39[_0xd0b7('0x12')]){if(_0x4ffd39[_0xd0b7('0x12')]['code']===0x1f4){logger[_0xd0b7('0x12')](_0xd0b7('0xd'),_0x533bda,_0x4ffd39[_0xd0b7('0x12')][_0xd0b7('0x13')]);return _0x3247e2(_0x4ffd39['error'][_0xd0b7('0x13')]);}logger[_0xd0b7('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x533bda,_0x4ffd39[_0xd0b7('0x12')]['message']);return _0x548004(_0x4ffd39[_0xd0b7('0x12')]['message']);}else{logger[_0xd0b7('0xc')](_0xd0b7('0xd'),_0x533bda,_0xd0b7('0xe'));_0x548004(_0x4ffd39[_0xd0b7('0x14')]['message']);}})[_0xd0b7('0x15')](function(_0x469136){logger[_0xd0b7('0x12')](_0xd0b7('0xd'),_0x533bda,_0x469136);_0x3247e2(_0x469136);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 71ad198..3aaf749 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 _0x76de=['index','get','show','post','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x76de,0x197));var _0xe76d=function(_0x426e5f,_0x4b385b){_0x426e5f=_0x426e5f-0x0;var _0x9a6cb3=_0x76de[_0x426e5f];return _0x9a6cb3;};'use strict';var multer=require(_0xe76d('0x0'));var util=require('util');var path=require(_0xe76d('0x1'));var timeout=require(_0xe76d('0x2'));var express=require(_0xe76d('0x3'));var router=express[_0xe76d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe76d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe76d('0x6'));var controller=require(_0xe76d('0x7'));router['get']('/',auth[_0xe76d('0x8')](),controller[_0xe76d('0x9')]);router[_0xe76d('0xa')]('/:id',auth[_0xe76d('0x8')](),controller[_0xe76d('0xb')]);router[_0xe76d('0xc')]('/',auth[_0xe76d('0x8')](),controller['create']);router['put']('/:id',auth[_0xe76d('0x8')](),controller['update']);router[_0xe76d('0xd')](_0xe76d('0xe'),auth[_0xe76d('0x8')](),controller['destroy']);module[_0xe76d('0xf')]=router; \ No newline at end of file +var _0x7485=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','create'];(function(_0x29ab05,_0x43c115){var _0xdc93fe=function(_0x36f957){while(--_0x36f957){_0x29ab05['push'](_0x29ab05['shift']());}};_0xdc93fe(++_0x43c115);}(_0x7485,0x15a));var _0x5748=function(_0x750528,_0x5b98be){_0x750528=_0x750528-0x0;var _0x5d2576=_0x7485[_0x750528];return _0x5d2576;};'use strict';var multer=require(_0x5748('0x0'));var util=require(_0x5748('0x1'));var path=require(_0x5748('0x2'));var timeout=require(_0x5748('0x3'));var express=require(_0x5748('0x4'));var router=express['Router']();var fs_extra=require(_0x5748('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5748('0x6'));var config=require(_0x5748('0x7'));var controller=require(_0x5748('0x8'));router[_0x5748('0x9')]('/',auth[_0x5748('0xa')](),controller[_0x5748('0xb')]);router[_0x5748('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5748('0xc')]);router['post']('/',auth[_0x5748('0xa')](),controller[_0x5748('0xd')]);router[_0x5748('0xe')](_0x5748('0xf'),auth[_0x5748('0xa')](),controller[_0x5748('0x10')]);router[_0x5748('0x11')]('/:id',auth[_0x5748('0xa')](),controller[_0x5748('0x12')]);module[_0x5748('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 002a7af..c6ba23c 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 _0x348f=['STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','picklist'];(function(_0x1cc5b3,_0x37bd09){var _0x44b75e=function(_0x40e63f){while(--_0x40e63f){_0x1cc5b3['push'](_0x1cc5b3['shift']());}};_0x44b75e(++_0x37bd09);}(_0x348f,0xaa));var _0xf348=function(_0x21680b,_0x1e3c43){_0x21680b=_0x21680b-0x0;var _0x5ab25f=_0x348f[_0x21680b];return _0x5ab25f;};'use strict';var Sequelize=require(_0xf348('0x0'));module['exports']={'type':{'type':Sequelize[_0xf348('0x1')]('string',_0xf348('0x2'),_0xf348('0x3'),'keyValue',_0xf348('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf348('0x5')]},'key':{'type':Sequelize[_0xf348('0x5')]},'keyType':{'type':Sequelize[_0xf348('0x1')]('string','variable',_0xf348('0x3'))},'keyContent':{'type':Sequelize[_0xf348('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf348('0x5')]},'customField':{'type':Sequelize[_0xf348('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2e65=['STRING','ENUM','BOOLEAN','exports','variable','customVariable','picklist','string'];(function(_0x5cb91c,_0x432026){var _0x5903af=function(_0x10ba19){while(--_0x10ba19){_0x5cb91c['push'](_0x5cb91c['shift']());}};_0x5903af(++_0x432026);}(_0x2e65,0x1ab));var _0x52e6=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x2e65[_0xf51c06];return _0x1d5420;};'use strict';var Sequelize=require('sequelize');module[_0x52e6('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x52e6('0x1'),_0x52e6('0x2'),'keyValue',_0x52e6('0x3')),'defaultValue':_0x52e6('0x4')},'content':{'type':Sequelize[_0x52e6('0x5')]},'key':{'type':Sequelize[_0x52e6('0x5')]},'keyType':{'type':Sequelize[_0x52e6('0x6')](_0x52e6('0x4'),_0x52e6('0x1'),_0x52e6('0x2'))},'keyContent':{'type':Sequelize[_0x52e6('0x5')]},'idField':{'type':Sequelize[_0x52e6('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x52e6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x52e6('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 09ba8e1..861ce84 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 _0xad11=['sort','where','filters','pick','merge','VIRTUAL','filter','options','Dynamics365Field','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad11,0x1e2));var _0x1ad1=function(_0x443953,_0x461aed){_0x443953=_0x443953-0x0;var _0x2c39dd=_0xad11[_0x443953];return _0x2c39dd;};'use strict';var emlformat=require(_0x1ad1('0x0'));var rimraf=require(_0x1ad1('0x1'));var zipdir=require(_0x1ad1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ad1('0x3'));var moment=require(_0x1ad1('0x4'));var BPromise=require(_0x1ad1('0x5'));var Mustache=require(_0x1ad1('0x6'));var util=require(_0x1ad1('0x7'));var path=require(_0x1ad1('0x8'));var sox=require(_0x1ad1('0x9'));var csv=require(_0x1ad1('0xa'));var ejs=require(_0x1ad1('0xb'));var fs=require('fs');var fs_extra=require(_0x1ad1('0xc'));var _=require('lodash');var squel=require(_0x1ad1('0xd'));var crypto=require(_0x1ad1('0xe'));var jsforce=require(_0x1ad1('0xf'));var deskjs=require(_0x1ad1('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1ad1('0x11'));var authService=require(_0x1ad1('0x12'));var qs=require(_0x1ad1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ad1('0x14'));var logger=require(_0x1ad1('0x15'))(_0x1ad1('0x16'));var utils=require(_0x1ad1('0x17'));var config=require(_0x1ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ad1('0x19'))['db'];function respondWithStatusCode(_0x2ccc49,_0x38d790){_0x38d790=_0x38d790||0xcc;return function(_0x4f8923){if(_0x4f8923){return _0x2ccc49[_0x1ad1('0x1a')](_0x38d790);}return _0x2ccc49[_0x1ad1('0x1b')](_0x38d790)[_0x1ad1('0x1c')]();};}function respondWithResult(_0x5510e3,_0xf98692){_0xf98692=_0xf98692||0xc8;return function(_0x1a6907){if(_0x1a6907){return _0x5510e3[_0x1ad1('0x1b')](_0xf98692)['json'](_0x1a6907);}};}function respondWithFilteredResult(_0x154d5b,_0x3a753e){return function(_0x11fd73){if(_0x11fd73){var _0x2fa783=typeof _0x3a753e[_0x1ad1('0x1d')]==='undefined'&&typeof _0x3a753e[_0x1ad1('0x1e')]==='undefined';var _0x2d73b7=_0x11fd73['count'];var _0x35110b=_0x2fa783?0x0:_0x3a753e[_0x1ad1('0x1d')];var _0x250900=_0x2fa783?_0x11fd73[_0x1ad1('0x1f')]:_0x3a753e[_0x1ad1('0x1d')]+_0x3a753e[_0x1ad1('0x1e')];var _0x306204;if(_0x250900>=_0x2d73b7){_0x250900=_0x2d73b7;_0x306204=0xc8;}else{_0x306204=0xce;}_0x154d5b[_0x1ad1('0x1b')](_0x306204);return _0x154d5b[_0x1ad1('0x20')](_0x1ad1('0x21'),_0x35110b+'-'+_0x250900+'/'+_0x2d73b7)['json'](_0x11fd73);}return null;};}function patchUpdates(_0x30eb54){return function(_0x35b834){try{jsonpatch[_0x1ad1('0x22')](_0x35b834,_0x30eb54,!![]);}catch(_0x1cee38){return BPromise[_0x1ad1('0x23')](_0x1cee38);}return _0x35b834[_0x1ad1('0x24')]();};}function saveUpdates(_0x2f2ded,_0x5c61ff){return function(_0x338b26){if(_0x338b26){return _0x338b26[_0x1ad1('0x25')](_0x2f2ded)[_0x1ad1('0x26')](function(_0x45a275){return _0x45a275;});}return null;};}function removeEntity(_0x8ebf0f,_0x5d0455){return function(_0x546c63){if(_0x546c63){return _0x546c63[_0x1ad1('0x27')]()[_0x1ad1('0x26')](function(){_0x8ebf0f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eab29,_0x3b939d){return function(_0x5c26bf){if(!_0x5c26bf){_0x3eab29['sendStatus'](0x194);}return _0x5c26bf;};}function handleError(_0x3aff12,_0x130302){_0x130302=_0x130302||0x1f4;return function(_0x6f675a){logger[_0x1ad1('0x28')](_0x6f675a[_0x1ad1('0x29')]);if(_0x6f675a[_0x1ad1('0x2a')]){delete _0x6f675a[_0x1ad1('0x2a')];}_0x3aff12['status'](_0x130302)[_0x1ad1('0x2b')](_0x6f675a);};}exports[_0x1ad1('0x2c')]=function(_0x17c871,_0x1ea0cc){var _0x2f074f={},_0x3f3fa5={},_0x20a053={'count':0x0,'rows':[]};var _0x4e3529=_[_0x1ad1('0x2d')](db['Dynamics365Field'][_0x1ad1('0x2e')],function(_0x261eb9){return{'name':_0x261eb9['fieldName'],'type':_0x261eb9[_0x1ad1('0x2f')][_0x1ad1('0x30')]};});_0x3f3fa5[_0x1ad1('0x31')]=_[_0x1ad1('0x2d')](_0x4e3529,'name');_0x3f3fa5[_0x1ad1('0x32')]=_[_0x1ad1('0x33')](_0x17c871['query']);_0x3f3fa5['filters']=_[_0x1ad1('0x34')](_0x3f3fa5[_0x1ad1('0x31')],_0x3f3fa5[_0x1ad1('0x32')]);_0x2f074f[_0x1ad1('0x35')]=_[_0x1ad1('0x34')](_0x3f3fa5[_0x1ad1('0x31')],qs[_0x1ad1('0x36')](_0x17c871[_0x1ad1('0x32')][_0x1ad1('0x36')]));_0x2f074f['attributes']=_0x2f074f[_0x1ad1('0x35')]['length']?_0x2f074f['attributes']:_0x3f3fa5[_0x1ad1('0x31')];if(!_0x17c871[_0x1ad1('0x32')][_0x1ad1('0x37')]('nolimit')){_0x2f074f['limit']=qs[_0x1ad1('0x1e')](_0x17c871[_0x1ad1('0x32')][_0x1ad1('0x1e')]);_0x2f074f['offset']=qs[_0x1ad1('0x1d')](_0x17c871['query'][_0x1ad1('0x1d')]);}_0x2f074f[_0x1ad1('0x38')]=qs['sort'](_0x17c871['query'][_0x1ad1('0x39')]);_0x2f074f[_0x1ad1('0x3a')]=qs[_0x1ad1('0x3b')](_[_0x1ad1('0x3c')](_0x17c871[_0x1ad1('0x32')],_0x3f3fa5[_0x1ad1('0x3b')]),_0x4e3529);if(_0x17c871[_0x1ad1('0x32')]['filter']){_0x2f074f[_0x1ad1('0x3a')]=_[_0x1ad1('0x3d')](_0x2f074f[_0x1ad1('0x3a')],{'$or':_['map'](_0x4e3529,function(_0x587e7e){if(_0x587e7e[_0x1ad1('0x2f')]!==_0x1ad1('0x3e')){var _0x30c973={};_0x30c973[_0x587e7e[_0x1ad1('0x2a')]]={'$like':'%'+_0x17c871[_0x1ad1('0x32')][_0x1ad1('0x3f')]+'%'};return _0x30c973;}})});}_0x2f074f=_[_0x1ad1('0x3d')]({},_0x2f074f,_0x17c871[_0x1ad1('0x40')]);var _0x2d0bde={'where':_0x2f074f['where']};return db[_0x1ad1('0x41')]['count'](_0x2d0bde)[_0x1ad1('0x26')](function(_0x5cc8f4){_0x20a053['count']=_0x5cc8f4;if(_0x17c871[_0x1ad1('0x32')][_0x1ad1('0x42')]){_0x2f074f[_0x1ad1('0x43')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x1ad1('0x44')](_0x2f074f);})[_0x1ad1('0x26')](function(_0x790b21){_0x20a053[_0x1ad1('0x45')]=_0x790b21;return _0x20a053;})['then'](respondWithFilteredResult(_0x1ea0cc,_0x2f074f))[_0x1ad1('0x46')](handleError(_0x1ea0cc,null));};exports[_0x1ad1('0x47')]=function(_0x13b3da,_0x2ab907){var _0x38599b={'raw':!![],'where':{'id':_0x13b3da[_0x1ad1('0x48')]['id']}},_0x107682={};_0x107682[_0x1ad1('0x31')]=_[_0x1ad1('0x33')](db[_0x1ad1('0x41')][_0x1ad1('0x2e')]);_0x107682[_0x1ad1('0x32')]=_[_0x1ad1('0x33')](_0x13b3da['query']);_0x107682[_0x1ad1('0x3b')]=_[_0x1ad1('0x34')](_0x107682['model'],_0x107682['query']);_0x38599b[_0x1ad1('0x35')]=_[_0x1ad1('0x34')](_0x107682['model'],qs[_0x1ad1('0x36')](_0x13b3da[_0x1ad1('0x32')][_0x1ad1('0x36')]));_0x38599b['attributes']=_0x38599b['attributes'][_0x1ad1('0x49')]?_0x38599b[_0x1ad1('0x35')]:_0x107682['model'];if(_0x13b3da[_0x1ad1('0x32')][_0x1ad1('0x42')]){_0x38599b['include']=[{'all':!![]}];}_0x38599b=_[_0x1ad1('0x3d')]({},_0x38599b,_0x13b3da[_0x1ad1('0x40')]);return db[_0x1ad1('0x41')][_0x1ad1('0x4a')](_0x38599b)[_0x1ad1('0x26')](handleEntityNotFound(_0x2ab907,null))[_0x1ad1('0x26')](respondWithResult(_0x2ab907,null))['catch'](handleError(_0x2ab907,null));};exports[_0x1ad1('0x4b')]=function(_0x26e8e7,_0x32a394){return db[_0x1ad1('0x41')][_0x1ad1('0x4b')](_0x26e8e7['body'],{})[_0x1ad1('0x26')](respondWithResult(_0x32a394,0xc9))['catch'](handleError(_0x32a394,null));};exports[_0x1ad1('0x25')]=function(_0x2a17bc,_0x37f645){if(_0x2a17bc[_0x1ad1('0x4c')]['id']){delete _0x2a17bc['body']['id'];}return db[_0x1ad1('0x41')][_0x1ad1('0x4a')]({'where':{'id':_0x2a17bc[_0x1ad1('0x48')]['id']}})[_0x1ad1('0x26')](handleEntityNotFound(_0x37f645,null))[_0x1ad1('0x26')](saveUpdates(_0x2a17bc[_0x1ad1('0x4c')],null))[_0x1ad1('0x26')](respondWithResult(_0x37f645,null))[_0x1ad1('0x46')](handleError(_0x37f645,null));};exports['destroy']=function(_0x3d2498,_0x56f99d){return db['Dynamics365Field'][_0x1ad1('0x4a')]({'where':{'id':_0x3d2498['params']['id']}})[_0x1ad1('0x26')](handleEntityNotFound(_0x56f99d,null))[_0x1ad1('0x26')](removeEntity(_0x56f99d,null))[_0x1ad1('0x46')](handleError(_0x56f99d,null));}; \ No newline at end of file +var _0xf825=['status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','Dynamics365Field','includeAll','include','catch','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x26a847,_0x3824cc){var _0x383d7c=function(_0x5d806b){while(--_0x5d806b){_0x26a847['push'](_0x26a847['shift']());}};_0x383d7c(++_0x3824cc);}(_0xf825,0x1a3));var _0x5f82=function(_0x286a3e,_0x2b0f37){_0x286a3e=_0x286a3e-0x0;var _0x15214c=_0xf825[_0x286a3e];return _0x15214c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f82('0x0'));var jsonpatch=require(_0x5f82('0x1'));var rp=require(_0x5f82('0x2'));var moment=require(_0x5f82('0x3'));var BPromise=require(_0x5f82('0x4'));var Mustache=require(_0x5f82('0x5'));var util=require(_0x5f82('0x6'));var path=require(_0x5f82('0x7'));var sox=require(_0x5f82('0x8'));var csv=require(_0x5f82('0x9'));var ejs=require(_0x5f82('0xa'));var fs=require('fs');var fs_extra=require(_0x5f82('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5f82('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5f82('0xd'));var toCsv=require(_0x5f82('0x9'));var querystring=require(_0x5f82('0xe'));var Papa=require(_0x5f82('0xf'));var Redis=require(_0x5f82('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5f82('0x11'));var as=require(_0x5f82('0x12'));var hardwareService=require(_0x5f82('0x13'));var logger=require('../../config/logger')(_0x5f82('0x14'));var utils=require('../../config/utils');var config=require(_0x5f82('0x15'));var licenseUtil=require(_0x5f82('0x16'));var db=require(_0x5f82('0x17'))['db'];function respondWithStatusCode(_0xb934e1,_0x1d5e9b){_0x1d5e9b=_0x1d5e9b||0xcc;return function(_0x9b2d1c){if(_0x9b2d1c){return _0xb934e1[_0x5f82('0x18')](_0x1d5e9b);}return _0xb934e1[_0x5f82('0x19')](_0x1d5e9b)['end']();};}function respondWithResult(_0x4346e9,_0x1bbe38){_0x1bbe38=_0x1bbe38||0xc8;return function(_0x31a69){if(_0x31a69){return _0x4346e9['status'](_0x1bbe38)[_0x5f82('0x1a')](_0x31a69);}};}function respondWithFilteredResult(_0xfbcc92,_0x2dd234){return function(_0x5876c1){if(_0x5876c1){var _0x12d0b6=typeof _0x2dd234[_0x5f82('0x1b')]===_0x5f82('0x1c')&&typeof _0x2dd234['limit']===_0x5f82('0x1c');var _0x2d1175=_0x5876c1['count'];var _0x2136ea=_0x12d0b6?0x0:_0x2dd234[_0x5f82('0x1b')];var _0x500c52=_0x12d0b6?_0x5876c1[_0x5f82('0x1d')]:_0x2dd234['offset']+_0x2dd234[_0x5f82('0x1e')];var _0x5c8504;if(_0x500c52>=_0x2d1175){_0x500c52=_0x2d1175;_0x5c8504=0xc8;}else{_0x5c8504=0xce;}_0xfbcc92[_0x5f82('0x19')](_0x5c8504);return _0xfbcc92['set'](_0x5f82('0x1f'),_0x2136ea+'-'+_0x500c52+'/'+_0x2d1175)[_0x5f82('0x1a')](_0x5876c1);}return null;};}function patchUpdates(_0x1c58a5){return function(_0x32a164){try{jsonpatch[_0x5f82('0x20')](_0x32a164,_0x1c58a5,!![]);}catch(_0xf61d5c){return BPromise[_0x5f82('0x21')](_0xf61d5c);}return _0x32a164[_0x5f82('0x22')]();};}function saveUpdates(_0x774050,_0x251d21){return function(_0x4f5c46){if(_0x4f5c46){return _0x4f5c46[_0x5f82('0x23')](_0x774050)[_0x5f82('0x24')](function(_0x4be9bc){return _0x4be9bc;});}return null;};}function removeEntity(_0x272d4d,_0xf5f22a){return function(_0x7b0b1){if(_0x7b0b1){return _0x7b0b1[_0x5f82('0x25')]()[_0x5f82('0x24')](function(){_0x272d4d['status'](0xcc)[_0x5f82('0x26')]();});}};}function handleEntityNotFound(_0x2c3043,_0x597ed7){return function(_0x13cc0b){if(!_0x13cc0b){_0x2c3043['sendStatus'](0x194);}return _0x13cc0b;};}function handleError(_0xd67688,_0x39b848){_0x39b848=_0x39b848||0x1f4;return function(_0xad15f4){logger[_0x5f82('0x27')](_0xad15f4[_0x5f82('0x28')]);if(_0xad15f4[_0x5f82('0x29')]){delete _0xad15f4[_0x5f82('0x29')];}_0xd67688[_0x5f82('0x19')](_0x39b848)[_0x5f82('0x2a')](_0xad15f4);};}exports[_0x5f82('0x2b')]=function(_0x473662,_0x196ed6){var _0x15f691={},_0x274b15={},_0x4fa16d={'count':0x0,'rows':[]};var _0xc7d416=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x130cc2){return{'name':_0x130cc2[_0x5f82('0x2c')],'type':_0x130cc2[_0x5f82('0x2d')][_0x5f82('0x2e')]};});_0x274b15[_0x5f82('0x2f')]=_[_0x5f82('0x30')](_0xc7d416,'name');_0x274b15[_0x5f82('0x31')]=_[_0x5f82('0x32')](_0x473662['query']);_0x274b15[_0x5f82('0x33')]=_[_0x5f82('0x34')](_0x274b15[_0x5f82('0x2f')],_0x274b15[_0x5f82('0x31')]);_0x15f691[_0x5f82('0x35')]=_['intersection'](_0x274b15['model'],qs[_0x5f82('0x36')](_0x473662[_0x5f82('0x31')][_0x5f82('0x36')]));_0x15f691[_0x5f82('0x35')]=_0x15f691[_0x5f82('0x35')][_0x5f82('0x37')]?_0x15f691[_0x5f82('0x35')]:_0x274b15['model'];if(!_0x473662[_0x5f82('0x31')][_0x5f82('0x38')](_0x5f82('0x39'))){_0x15f691[_0x5f82('0x1e')]=qs[_0x5f82('0x1e')](_0x473662[_0x5f82('0x31')]['limit']);_0x15f691['offset']=qs[_0x5f82('0x1b')](_0x473662[_0x5f82('0x31')][_0x5f82('0x1b')]);}_0x15f691[_0x5f82('0x3a')]=qs[_0x5f82('0x3b')](_0x473662[_0x5f82('0x31')][_0x5f82('0x3b')]);_0x15f691[_0x5f82('0x3c')]=qs[_0x5f82('0x33')](_[_0x5f82('0x3d')](_0x473662[_0x5f82('0x31')],_0x274b15[_0x5f82('0x33')]),_0xc7d416);if(_0x473662[_0x5f82('0x31')][_0x5f82('0x3e')]){_0x15f691['where']=_['merge'](_0x15f691[_0x5f82('0x3c')],{'$or':_['map'](_0xc7d416,function(_0x533177){if(_0x533177[_0x5f82('0x2d')]!==_0x5f82('0x3f')){var _0x201dbd={};_0x201dbd[_0x533177[_0x5f82('0x29')]]={'$like':'%'+_0x473662[_0x5f82('0x31')][_0x5f82('0x3e')]+'%'};return _0x201dbd;}})});}_0x15f691=_[_0x5f82('0x40')]({},_0x15f691,_0x473662['options']);var _0x553f72={'where':_0x15f691[_0x5f82('0x3c')]};return db[_0x5f82('0x41')][_0x5f82('0x1d')](_0x553f72)[_0x5f82('0x24')](function(_0x4dea20){_0x4fa16d[_0x5f82('0x1d')]=_0x4dea20;if(_0x473662['query'][_0x5f82('0x42')]){_0x15f691[_0x5f82('0x43')]=[{'all':!![]}];}return db[_0x5f82('0x41')]['findAll'](_0x15f691);})[_0x5f82('0x24')](function(_0x14b317){_0x4fa16d['rows']=_0x14b317;return _0x4fa16d;})[_0x5f82('0x24')](respondWithFilteredResult(_0x196ed6,_0x15f691))[_0x5f82('0x44')](handleError(_0x196ed6,null));};exports['show']=function(_0x3dbb29,_0x3da962){var _0xba959f={'raw':!![],'where':{'id':_0x3dbb29['params']['id']}},_0x3280aa={};_0x3280aa['model']=_['keys'](db[_0x5f82('0x41')]['rawAttributes']);_0x3280aa[_0x5f82('0x31')]=_['keys'](_0x3dbb29[_0x5f82('0x31')]);_0x3280aa[_0x5f82('0x33')]=_[_0x5f82('0x34')](_0x3280aa['model'],_0x3280aa['query']);_0xba959f[_0x5f82('0x35')]=_[_0x5f82('0x34')](_0x3280aa[_0x5f82('0x2f')],qs[_0x5f82('0x36')](_0x3dbb29[_0x5f82('0x31')][_0x5f82('0x36')]));_0xba959f['attributes']=_0xba959f[_0x5f82('0x35')][_0x5f82('0x37')]?_0xba959f['attributes']:_0x3280aa[_0x5f82('0x2f')];if(_0x3dbb29[_0x5f82('0x31')]['includeAll']){_0xba959f[_0x5f82('0x43')]=[{'all':!![]}];}_0xba959f=_['merge']({},_0xba959f,_0x3dbb29[_0x5f82('0x45')]);return db['Dynamics365Field'][_0x5f82('0x46')](_0xba959f)[_0x5f82('0x24')](handleEntityNotFound(_0x3da962,null))['then'](respondWithResult(_0x3da962,null))['catch'](handleError(_0x3da962,null));};exports[_0x5f82('0x47')]=function(_0x12c05a,_0x39a4fd){return db['Dynamics365Field'][_0x5f82('0x47')](_0x12c05a['body'],{})[_0x5f82('0x24')](respondWithResult(_0x39a4fd,0xc9))[_0x5f82('0x44')](handleError(_0x39a4fd,null));};exports['update']=function(_0x39619e,_0x31cce3){if(_0x39619e[_0x5f82('0x48')]['id']){delete _0x39619e[_0x5f82('0x48')]['id'];}return db[_0x5f82('0x41')]['find']({'where':{'id':_0x39619e[_0x5f82('0x49')]['id']}})[_0x5f82('0x24')](handleEntityNotFound(_0x31cce3,null))[_0x5f82('0x24')](saveUpdates(_0x39619e[_0x5f82('0x48')],null))[_0x5f82('0x24')](respondWithResult(_0x31cce3,null))[_0x5f82('0x44')](handleError(_0x31cce3,null));};exports[_0x5f82('0x25')]=function(_0xfd6fa4,_0x5c8b95){return db['Dynamics365Field'][_0x5f82('0x46')]({'where':{'id':_0xfd6fa4['params']['id']}})[_0x5f82('0x24')](handleEntityNotFound(_0x5c8b95,null))[_0x5f82('0x24')](removeEntity(_0x5c8b95,null))[_0x5f82('0x44')](handleError(_0x5c8b95,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index ae64314..0066923 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 _0x188a=['int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x565c3f,_0x1eddfa){var _0x25595d=function(_0x37346a){while(--_0x37346a){_0x565c3f['push'](_0x565c3f['shift']());}};_0x25595d(++_0x1eddfa);}(_0x188a,0xc7));var _0xa188=function(_0x304c6f,_0xbf63c0){_0x304c6f=_0x304c6f-0x0;var _0x51f3a6=_0x188a[_0x304c6f];return _0x51f3a6;};'use strict';var _=require(_0xa188('0x0'));var util=require(_0xa188('0x1'));var logger=require(_0xa188('0x2'))('api');var moment=require(_0xa188('0x3'));var BPromise=require('bluebird');var rp=require(_0xa188('0x4'));var fs=require('fs');var path=require(_0xa188('0x5'));var rimraf=require(_0xa188('0x6'));var config=require(_0xa188('0x7'));var attributes=require(_0xa188('0x8'));module[_0xa188('0x9')]=function(_0xc27756,_0x4c7ff9){return _0xc27756['define'](_0xa188('0xa'),attributes,{'tableName':_0xa188('0xb'),'paranoid':![],'indexes':[{'name':_0xa188('0xc'),'fields':[_0xa188('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8fde=['path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8fde,0x117));var _0xe8fd=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x8fde[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0xe8fd('0x0'));var util=require('util');var logger=require(_0xe8fd('0x1'))(_0xe8fd('0x2'));var moment=require(_0xe8fd('0x3'));var BPromise=require(_0xe8fd('0x4'));var rp=require(_0xe8fd('0x5'));var fs=require('fs');var path=require(_0xe8fd('0x6'));var rimraf=require(_0xe8fd('0x7'));var config=require('../../config/environment');var attributes=require(_0xe8fd('0x8'));module[_0xe8fd('0x9')]=function(_0x5f0a08,_0x47c200){return _0x5f0a08[_0xe8fd('0xa')](_0xe8fd('0xb'),attributes,{'tableName':_0xe8fd('0xc'),'paranoid':![],'indexes':[{'name':_0xe8fd('0xd'),'fields':['idField',_0xe8fd('0xe')],'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 658dc32..5a20fc1 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 _0x53e3=['jayson/promise','client','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x53e3,0xae));var _0x353e=function(_0x20b7b1,_0x8df421){_0x20b7b1=_0x20b7b1-0x0;var _0x5ede08=_0x53e3[_0x20b7b1];return _0x5ede08;};'use strict';var _=require(_0x353e('0x0'));var util=require(_0x353e('0x1'));var moment=require(_0x353e('0x2'));var BPromise=require(_0x353e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x353e('0x4'));var db=require(_0x353e('0x5'))['db'];var utils=require(_0x353e('0x6'));var logger=require(_0x353e('0x7'))(_0x353e('0x8'));var config=require(_0x353e('0x9'));var jayson=require(_0x353e('0xa'));var client=jayson[_0x353e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2540d8,_0x43a4f2,_0x3d1fae){return new BPromise(function(_0x153daf,_0x532fbd){return client[_0x353e('0xc')](_0x2540d8,_0x3d1fae)['then'](function(_0x141dcb){logger[_0x353e('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x43a4f2,_0x353e('0xe'));logger[_0x353e('0xf')](_0x353e('0x10'),_0x43a4f2,_0x353e('0xe'),JSON[_0x353e('0x11')](_0x141dcb));if(_0x141dcb[_0x353e('0x12')]){if(_0x141dcb['error'][_0x353e('0x13')]===0x1f4){logger[_0x353e('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x43a4f2,_0x141dcb[_0x353e('0x12')][_0x353e('0x14')]);return _0x532fbd(_0x141dcb[_0x353e('0x12')][_0x353e('0x14')]);}logger[_0x353e('0x12')](_0x353e('0x15'),_0x43a4f2,_0x141dcb[_0x353e('0x12')][_0x353e('0x14')]);return _0x153daf(_0x141dcb[_0x353e('0x12')][_0x353e('0x14')]);}else{logger[_0x353e('0xd')](_0x353e('0x15'),_0x43a4f2,_0x353e('0xe'));_0x153daf(_0x141dcb[_0x353e('0x16')][_0x353e('0x14')]);}})['catch'](function(_0x5f309){logger[_0x353e('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x43a4f2,_0x5f309);_0x532fbd(_0x5f309);});});} \ No newline at end of file +var _0x9e0c=['rpc','../../config/environment','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x35c648,_0xd9b7d5){var _0x30b86d=function(_0x3421ca){while(--_0x3421ca){_0x35c648['push'](_0x35c648['shift']());}};_0x30b86d(++_0xd9b7d5);}(_0x9e0c,0x1c6));var _0xc9e0=function(_0x43a3b2,_0x2e74a8){_0x43a3b2=_0x43a3b2-0x0;var _0x209d25=_0x9e0c[_0x43a3b2];return _0x209d25;};'use strict';var _=require(_0xc9e0('0x0'));var util=require(_0xc9e0('0x1'));var moment=require(_0xc9e0('0x2'));var BPromise=require(_0xc9e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9e0('0x4'));var db=require(_0xc9e0('0x5'))['db'];var utils=require(_0xc9e0('0x6'));var logger=require(_0xc9e0('0x7'))(_0xc9e0('0x8'));var config=require(_0xc9e0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bc0b5,_0x1224e7,_0x4821e2){return new BPromise(function(_0x445044,_0xd45d24){return client['request'](_0x3bc0b5,_0x4821e2)[_0xc9e0('0xb')](function(_0xeb94ef){logger[_0xc9e0('0xc')](_0xc9e0('0xd'),_0x1224e7,_0xc9e0('0xe'));logger['debug'](_0xc9e0('0xf'),_0x1224e7,'request\x20sent',JSON[_0xc9e0('0x10')](_0xeb94ef));if(_0xeb94ef[_0xc9e0('0x11')]){if(_0xeb94ef[_0xc9e0('0x11')]['code']===0x1f4){logger[_0xc9e0('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x1224e7,_0xeb94ef[_0xc9e0('0x11')][_0xc9e0('0x12')]);return _0xd45d24(_0xeb94ef['error'][_0xc9e0('0x12')]);}logger[_0xc9e0('0x11')](_0xc9e0('0xd'),_0x1224e7,_0xeb94ef[_0xc9e0('0x11')][_0xc9e0('0x12')]);return _0x445044(_0xeb94ef['error'][_0xc9e0('0x12')]);}else{logger['info'](_0xc9e0('0xd'),_0x1224e7,_0xc9e0('0xe'));_0x445044(_0xeb94ef[_0xc9e0('0x13')][_0xc9e0('0x12')]);}})[_0xc9e0('0x14')](function(_0x1d761f){logger['error'](_0xc9e0('0xd'),_0x1224e7,_0x1d761f);_0xd45d24(_0x1d761f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 854ad75..025a12d 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 _0x6e89=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','put','update','delete','destroy','exports','multer','path'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x6e89,0x1ca));var _0x96e8=function(_0x4381c3,_0x274da4){_0x4381c3=_0x4381c3-0x0;var _0x272db2=_0x6e89[_0x4381c3];return _0x272db2;};'use strict';var multer=require(_0x96e8('0x0'));var util=require('util');var path=require(_0x96e8('0x1'));var timeout=require(_0x96e8('0x2'));var express=require(_0x96e8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x96e8('0x4'));var interaction=require(_0x96e8('0x5'));var config=require(_0x96e8('0x6'));var controller=require(_0x96e8('0x7'));router[_0x96e8('0x8')]('/',auth[_0x96e8('0x9')](),controller[_0x96e8('0xa')]);router[_0x96e8('0x8')](_0x96e8('0xb'),auth[_0x96e8('0x9')](),controller[_0x96e8('0xc')]);router[_0x96e8('0x8')](_0x96e8('0xd'),auth[_0x96e8('0x9')](),controller[_0x96e8('0xe')]);router[_0x96e8('0x8')]('/:id/fields',auth[_0x96e8('0x9')](),controller[_0x96e8('0xf')]);router['post']('/',auth[_0x96e8('0x9')](),controller[_0x96e8('0x10')]);router[_0x96e8('0x11')](_0x96e8('0xd'),auth[_0x96e8('0x9')](),controller['addConfiguration']);router[_0x96e8('0x12')](_0x96e8('0xb'),auth[_0x96e8('0x9')](),controller[_0x96e8('0x13')]);router[_0x96e8('0x14')](_0x96e8('0xb'),auth[_0x96e8('0x9')](),controller[_0x96e8('0x15')]);module[_0x96e8('0x16')]=router; \ No newline at end of file +var _0x86a5=['create','addConfiguration','put','update','delete','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x3e0520,_0xcb3f7f){var _0x2dafa2=function(_0x1143f1){while(--_0x1143f1){_0x3e0520['push'](_0x3e0520['shift']());}};_0x2dafa2(++_0xcb3f7f);}(_0x86a5,0x124));var _0x586a=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x86a5[_0x45783c];return _0x1161da;};'use strict';var multer=require(_0x586a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x586a('0x1'));var router=express[_0x586a('0x2')]();var fs_extra=require(_0x586a('0x3'));var auth=require(_0x586a('0x4'));var interaction=require(_0x586a('0x5'));var config=require(_0x586a('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x586a('0x7')]('/',auth['isAuthenticated'](),controller[_0x586a('0x8')]);router[_0x586a('0x7')](_0x586a('0x9'),auth[_0x586a('0xa')](),controller['show']);router[_0x586a('0x7')](_0x586a('0xb'),auth[_0x586a('0xa')](),controller[_0x586a('0xc')]);router['get'](_0x586a('0xd'),auth[_0x586a('0xa')](),controller[_0x586a('0xe')]);router[_0x586a('0xf')]('/',auth['isAuthenticated'](),controller[_0x586a('0x10')]);router[_0x586a('0xf')](_0x586a('0xb'),auth[_0x586a('0xa')](),controller[_0x586a('0x11')]);router[_0x586a('0x12')](_0x586a('0x9'),auth[_0x586a('0xa')](),controller[_0x586a('0x13')]);router[_0x586a('0x14')]('/:id',auth[_0x586a('0xa')](),controller['destroy']);module[_0x586a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index aec879a..ad5a2a4 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 _0x2032=['remoteUri','exports','STRING','username'];(function(_0x1f8ed8,_0x32f9f0){var _0x5179c1=function(_0x39ebc5){while(--_0x39ebc5){_0x1f8ed8['push'](_0x1f8ed8['shift']());}};_0x5179c1(++_0x32f9f0);}(_0x2032,0xd9));var _0x2203=function(_0x4ce720,_0x4341b5){_0x4ce720=_0x4ce720-0x0;var _0x22a5b2=_0x2032[_0x4ce720];return _0x22a5b2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')]},'description':{'type':Sequelize[_0x2203('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2203('0x2')},'apiKey':{'type':Sequelize[_0x2203('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2203('0x3')},'serverUrl':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x93e9=['sequelize','exports','STRING','username'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x93e9,0xcc));var _0x993e=function(_0xbe6dd2,_0x376a3d){_0xbe6dd2=_0xbe6dd2-0x0;var _0x558cc2=_0x93e9[_0xbe6dd2];return _0x558cc2;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'name':{'type':Sequelize[_0x993e('0x2')]},'description':{'type':Sequelize[_0x993e('0x2')]},'username':{'type':Sequelize[_0x993e('0x2')],'unique':_0x993e('0x3')},'apiKey':{'type':Sequelize[_0x993e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x993e('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 8f2fe8f..5ef9464 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 _0xffda=['error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','index','map','FreshdeskAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','rawAttributes','catch','create','body','find','params','getConfigurations','findOne','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','group','source','company','remove','name','default','custom_text','label','choices','capitalize','test','statusCode'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffda,0x73));var _0xaffd=function(_0x410008,_0x4e5984){_0x410008=_0x410008-0x0;var _0x51431d=_0xffda[_0x410008];return _0x51431d;};'use strict';var emlformat=require(_0xaffd('0x0'));var rimraf=require(_0xaffd('0x1'));var zipdir=require(_0xaffd('0x2'));var jsonpatch=require(_0xaffd('0x3'));var rp=require('request-promise');var moment=require(_0xaffd('0x4'));var BPromise=require(_0xaffd('0x5'));var Mustache=require(_0xaffd('0x6'));var util=require('util');var path=require(_0xaffd('0x7'));var sox=require('sox');var csv=require(_0xaffd('0x8'));var ejs=require(_0xaffd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaffd('0xa'));var crypto=require(_0xaffd('0xb'));var jsforce=require(_0xaffd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xaffd('0x8'));var querystring=require(_0xaffd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaffd('0xe'));var qs=require(_0xaffd('0xf'));var as=require(_0xaffd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaffd('0x11'))(_0xaffd('0x12'));var utils=require('../../config/utils');var config=require(_0xaffd('0x13'));var licenseUtil=require(_0xaffd('0x14'));var db=require(_0xaffd('0x15'))['db'];var integrations=require(_0xaffd('0x16'));function respondWithStatusCode(_0x144652,_0x5e5c2b){_0x5e5c2b=_0x5e5c2b||0xcc;return function(_0x10b322){if(_0x10b322){return _0x144652['sendStatus'](_0x5e5c2b);}return _0x144652['status'](_0x5e5c2b)[_0xaffd('0x17')]();};}function respondWithResult(_0x2da32c,_0x1be095){_0x1be095=_0x1be095||0xc8;return function(_0x58ed4a){if(_0x58ed4a){return _0x2da32c[_0xaffd('0x18')](_0x1be095)[_0xaffd('0x19')](_0x58ed4a);}};}function respondWithFilteredResult(_0x14caba,_0x2de573){return function(_0x1557bf){if(_0x1557bf){var _0x2b89e6=typeof _0x2de573[_0xaffd('0x1a')]===_0xaffd('0x1b')&&typeof _0x2de573['limit']===_0xaffd('0x1b');var _0x2f4d08=_0x1557bf[_0xaffd('0x1c')];var _0x70d8fe=_0x2b89e6?0x0:_0x2de573[_0xaffd('0x1a')];var _0x2165ce=_0x2b89e6?_0x1557bf['count']:_0x2de573['offset']+_0x2de573['limit'];var _0xe69889;if(_0x2165ce>=_0x2f4d08){_0x2165ce=_0x2f4d08;_0xe69889=0xc8;}else{_0xe69889=0xce;}_0x14caba[_0xaffd('0x18')](_0xe69889);return _0x14caba['set'](_0xaffd('0x1d'),_0x70d8fe+'-'+_0x2165ce+'/'+_0x2f4d08)[_0xaffd('0x19')](_0x1557bf);}return null;};}function patchUpdates(_0x1b4ad1){return function(_0x15b212){try{jsonpatch[_0xaffd('0x1e')](_0x15b212,_0x1b4ad1,!![]);}catch(_0x2a56e1){return BPromise[_0xaffd('0x1f')](_0x2a56e1);}return _0x15b212[_0xaffd('0x20')]();};}function saveUpdates(_0x449419,_0xe9a941){return function(_0x131a72){if(_0x131a72){return _0x131a72[_0xaffd('0x21')](_0x449419)[_0xaffd('0x22')](function(_0x180cea){return _0x180cea;});}return null;};}function removeEntity(_0xa29103,_0x1aa1db){return function(_0x127ba4){if(_0x127ba4){return _0x127ba4[_0xaffd('0x23')]()['then'](function(){_0xa29103[_0xaffd('0x18')](0xcc)[_0xaffd('0x17')]();});}};}function handleEntityNotFound(_0x39f333,_0x30602e){return function(_0x3e5241){if(!_0x3e5241){_0x39f333[_0xaffd('0x24')](0x194);}return _0x3e5241;};}function handleError(_0x401ad7,_0x356538){_0x356538=_0x356538||0x1f4;return function(_0x3fdc73){logger['error'](_0x3fdc73[_0xaffd('0x25')]);if(_0x3fdc73['name']){delete _0x3fdc73['name'];}_0x401ad7[_0xaffd('0x18')](_0x356538)['send'](_0x3fdc73);};}exports[_0xaffd('0x26')]=function(_0x199706,_0x3f339f){var _0x59f11a={},_0x78a316={},_0x39e879={'count':0x0,'rows':[]};var _0x193926=_[_0xaffd('0x27')](db[_0xaffd('0x28')]['rawAttributes'],function(_0x4ef464){return{'name':_0x4ef464[_0xaffd('0x29')],'type':_0x4ef464['type'][_0xaffd('0x2a')]};});_0x78a316[_0xaffd('0x2b')]=_[_0xaffd('0x27')](_0x193926,'name');_0x78a316[_0xaffd('0x2c')]=_[_0xaffd('0x2d')](_0x199706[_0xaffd('0x2c')]);_0x78a316[_0xaffd('0x2e')]=_[_0xaffd('0x2f')](_0x78a316[_0xaffd('0x2b')],_0x78a316[_0xaffd('0x2c')]);_0x59f11a[_0xaffd('0x30')]=_['intersection'](_0x78a316[_0xaffd('0x2b')],qs['fields'](_0x199706['query'][_0xaffd('0x31')]));_0x59f11a[_0xaffd('0x30')]=_0x59f11a['attributes'][_0xaffd('0x32')]?_0x59f11a['attributes']:_0x78a316[_0xaffd('0x2b')];if(!_0x199706[_0xaffd('0x2c')][_0xaffd('0x33')](_0xaffd('0x34'))){_0x59f11a[_0xaffd('0x35')]=qs[_0xaffd('0x35')](_0x199706[_0xaffd('0x2c')][_0xaffd('0x35')]);_0x59f11a['offset']=qs[_0xaffd('0x1a')](_0x199706[_0xaffd('0x2c')][_0xaffd('0x1a')]);}_0x59f11a[_0xaffd('0x36')]=qs[_0xaffd('0x37')](_0x199706['query'][_0xaffd('0x37')]);_0x59f11a[_0xaffd('0x38')]=qs[_0xaffd('0x2e')](_[_0xaffd('0x39')](_0x199706[_0xaffd('0x2c')],_0x78a316[_0xaffd('0x2e')]),_0x193926);if(_0x199706[_0xaffd('0x2c')]['filter']){_0x59f11a[_0xaffd('0x38')]=_[_0xaffd('0x3a')](_0x59f11a[_0xaffd('0x38')],{'$or':_[_0xaffd('0x27')](_0x193926,function(_0x337b90){if(_0x337b90['type']!==_0xaffd('0x3b')){var _0x1d1eca={};_0x1d1eca[_0x337b90['name']]={'$like':'%'+_0x199706[_0xaffd('0x2c')][_0xaffd('0x3c')]+'%'};return _0x1d1eca;}})});}_0x59f11a=_[_0xaffd('0x3a')]({},_0x59f11a,_0x199706[_0xaffd('0x3d')]);var _0x38a904={'where':_0x59f11a[_0xaffd('0x38')]};return db['FreshdeskAccount']['count'](_0x38a904)[_0xaffd('0x22')](function(_0x54a86e){_0x39e879[_0xaffd('0x1c')]=_0x54a86e;if(_0x199706['query'][_0xaffd('0x3e')]){_0x59f11a[_0xaffd('0x3f')]=[{'all':!![]}];}return db[_0xaffd('0x28')][_0xaffd('0x40')](_0x59f11a);})[_0xaffd('0x22')](function(_0x5e119e){_0x39e879['rows']=_0x5e119e;return _0x39e879;})['then'](respondWithFilteredResult(_0x3f339f,_0x59f11a))['catch'](handleError(_0x3f339f,null));};exports[_0xaffd('0x41')]=function(_0x35b453,_0x5e2bbf){var _0x5b8f43={'raw':![],'where':{'id':_0x35b453['params']['id']}},_0x6c65dd={};_0x6c65dd[_0xaffd('0x2b')]=_[_0xaffd('0x2d')](db[_0xaffd('0x28')][_0xaffd('0x42')]);_0x6c65dd[_0xaffd('0x2c')]=_[_0xaffd('0x2d')](_0x35b453['query']);_0x6c65dd[_0xaffd('0x2e')]=_['intersection'](_0x6c65dd[_0xaffd('0x2b')],_0x6c65dd[_0xaffd('0x2c')]);_0x5b8f43['attributes']=_['intersection'](_0x6c65dd[_0xaffd('0x2b')],qs['fields'](_0x35b453[_0xaffd('0x2c')][_0xaffd('0x31')]));_0x5b8f43[_0xaffd('0x30')]=_0x5b8f43['attributes'][_0xaffd('0x32')]?_0x5b8f43[_0xaffd('0x30')]:_0x6c65dd[_0xaffd('0x2b')];if(_0x35b453[_0xaffd('0x2c')]['includeAll']){_0x5b8f43[_0xaffd('0x3f')]=[{'all':!![]}];}_0x5b8f43=_[_0xaffd('0x3a')]({},_0x5b8f43,_0x35b453[_0xaffd('0x3d')]);return db['FreshdeskAccount']['find'](_0x5b8f43)[_0xaffd('0x22')](handleEntityNotFound(_0x5e2bbf,null))[_0xaffd('0x22')](respondWithResult(_0x5e2bbf,null))[_0xaffd('0x43')](handleError(_0x5e2bbf,null));};exports[_0xaffd('0x44')]=function(_0x591056,_0x4b4f45){return db[_0xaffd('0x28')][_0xaffd('0x44')](_0x591056[_0xaffd('0x45')],{})[_0xaffd('0x22')](respondWithResult(_0x4b4f45,0xc9))[_0xaffd('0x43')](handleError(_0x4b4f45,null));};exports[_0xaffd('0x21')]=function(_0x38e3a1,_0x4afa85){if(_0x38e3a1[_0xaffd('0x45')]['id']){delete _0x38e3a1['body']['id'];}return db['FreshdeskAccount'][_0xaffd('0x46')]({'where':{'id':_0x38e3a1[_0xaffd('0x47')]['id']}})[_0xaffd('0x22')](handleEntityNotFound(_0x4afa85,null))['then'](saveUpdates(_0x38e3a1[_0xaffd('0x45')],null))['then'](respondWithResult(_0x4afa85,null))['catch'](handleError(_0x4afa85,null));};exports[_0xaffd('0x23')]=function(_0x52127d,_0x3dda42){return db['FreshdeskAccount'][_0xaffd('0x46')]({'where':{'id':_0x52127d[_0xaffd('0x47')]['id']}})[_0xaffd('0x22')](handleEntityNotFound(_0x3dda42,null))[_0xaffd('0x22')](removeEntity(_0x3dda42,null))[_0xaffd('0x43')](handleError(_0x3dda42,null));};exports[_0xaffd('0x48')]=function(_0x4141c6,_0x2105cc,_0x571435){var _0x22595e={};var _0x3b8cc2={};var _0x49c3b6;var _0x4bf2a0;return db[_0xaffd('0x28')][_0xaffd('0x49')]({'where':{'id':_0x4141c6['params']['id']}})['then'](handleEntityNotFound(_0x2105cc,null))[_0xaffd('0x22')](function(_0x1ed070){if(_0x1ed070){_0x49c3b6=_0x1ed070;_0x3b8cc2[_0xaffd('0x2b')]=_[_0xaffd('0x2d')](db['FreshdeskConfiguration'][_0xaffd('0x42')]);_0x3b8cc2['query']=_['keys'](_0x4141c6[_0xaffd('0x2c')]);_0x3b8cc2[_0xaffd('0x2e')]=_[_0xaffd('0x2f')](_0x3b8cc2[_0xaffd('0x2b')],_0x3b8cc2[_0xaffd('0x2c')]);_0x22595e[_0xaffd('0x30')]=_[_0xaffd('0x2f')](_0x3b8cc2['model'],qs[_0xaffd('0x31')](_0x4141c6[_0xaffd('0x2c')][_0xaffd('0x31')]));_0x22595e['attributes']=_0x22595e[_0xaffd('0x30')][_0xaffd('0x32')]?_0x22595e[_0xaffd('0x30')]:_0x3b8cc2['model'];_0x22595e[_0xaffd('0x36')]=qs[_0xaffd('0x37')](_0x4141c6[_0xaffd('0x2c')]['sort']);_0x22595e['where']=qs[_0xaffd('0x2e')](_[_0xaffd('0x39')](_0x4141c6['query'],_0x3b8cc2[_0xaffd('0x2e')]));if(_0x4141c6['query'][_0xaffd('0x3c')]){_0x22595e['where']=_[_0xaffd('0x3a')](_0x22595e[_0xaffd('0x38')],{'$or':_[_0xaffd('0x27')](_0x22595e['attributes'],function(_0x470b38){var _0x53bb09={};_0x53bb09[_0x470b38]={'$like':'%'+_0x4141c6['query'][_0xaffd('0x3c')]+'%'};return _0x53bb09;})});}_0x22595e=_[_0xaffd('0x3a')]({},_0x22595e,_0x4141c6['options']);return _0x49c3b6[_0xaffd('0x48')](_0x22595e);}})[_0xaffd('0x22')](function(_0x3e6efb){if(_0x3e6efb){_0x4bf2a0=_0x3e6efb['length'];if(!_0x4141c6[_0xaffd('0x2c')]['hasOwnProperty'](_0xaffd('0x34'))){_0x22595e['limit']=qs['limit'](_0x4141c6[_0xaffd('0x2c')][_0xaffd('0x35')]);_0x22595e['offset']=qs[_0xaffd('0x1a')](_0x4141c6[_0xaffd('0x2c')][_0xaffd('0x1a')]);}return _0x49c3b6[_0xaffd('0x48')](_0x22595e);}})[_0xaffd('0x22')](function(_0x347cd4){if(_0x347cd4){return _0x347cd4?{'count':_0x4bf2a0,'rows':_0x347cd4}:null;}})[_0xaffd('0x22')](respondWithResult(_0x2105cc,null))[_0xaffd('0x43')](handleError(_0x2105cc,null));};exports['addConfiguration']=function(_0x57b1a7,_0x254f1c,_0xa2c61f){if(_0x57b1a7[_0xaffd('0x45')]['id']){delete _0x57b1a7[_0xaffd('0x45')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x57b1a7[_0xaffd('0x47')]['id']}})[_0xaffd('0x22')](handleEntityNotFound(_0x254f1c,null))[_0xaffd('0x22')](function(_0x2ccfbb){if(_0x2ccfbb){_0x57b1a7[_0xaffd('0x45')]['AccountId']=_0x2ccfbb['id'];_0x57b1a7[_0xaffd('0x45')][_0xaffd('0x4a')]=integrations[_0xaffd('0x4b')](_0x57b1a7['body'][_0xaffd('0x4c')],_0x57b1a7[_0xaffd('0x45')][_0xaffd('0x4d')]);_0x57b1a7['body'][_0xaffd('0x4e')]=integrations[_0xaffd('0x4f')](_0x57b1a7[_0xaffd('0x45')][_0xaffd('0x4c')],_0x57b1a7[_0xaffd('0x45')][_0xaffd('0x4d')]);return db['FreshdeskConfiguration']['create'](_0x57b1a7[_0xaffd('0x45')],{'include':[{'model':db[_0xaffd('0x50')],'as':_0xaffd('0x4a')},{'model':db[_0xaffd('0x50')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x254f1c,null))[_0xaffd('0x43')](handleError(_0x254f1c,null));};exports[_0xaffd('0x51')]=function(_0x55c190,_0x140610,_0x1fb83d){var _0x596fab='';return db[_0xaffd('0x28')][_0xaffd('0x49')]({'where':{'id':_0x55c190['params']['id']},'attributes':['id',_0xaffd('0x52'),_0xaffd('0x53')]})[_0xaffd('0x22')](handleEntityNotFound(_0x140610,null))[_0xaffd('0x22')](function(_0xd9f7a7){if(_0xd9f7a7){_0x596fab=_0xd9f7a7[_0xaffd('0x52')];var _0x111b4e=_0x596fab[_0xaffd('0x54')](-0x1);if(_0x111b4e==='/'){_0x596fab=_0x596fab[_0xaffd('0x55')](0x0,_0x596fab['lastIndexOf'](_0x111b4e));}return rp({'method':_0xaffd('0x56'),'uri':util[_0xaffd('0x57')]('%s/%s',_0x596fab,_0xaffd('0x58')),'headers':{'Authorization':util[_0xaffd('0x57')](_0xaffd('0x59'),new Buffer(util[_0xaffd('0x57')](_0xaffd('0x5a'),_0xd9f7a7[_0xaffd('0x53')]))[_0xaffd('0x5b')](_0xaffd('0x5c')))},'json':!![]});}})[_0xaffd('0x22')](function(_0xa882f3){if(_0xa882f3){var _0x4620b7=[_0xaffd('0x5d'),_0xaffd('0x5e'),_0xaffd('0x5f'),_0xaffd('0x60'),_0xaffd('0x18'),'priority',_0xaffd('0x61'),_0xaffd('0x62'),'ticket_type',_0xaffd('0x61'),_0xaffd('0x63')];_[_0xaffd('0x64')](_0xa882f3,function(_0x1e8ee4){return _0x4620b7['includes'](_0x1e8ee4[_0xaffd('0x65')])||!_0x1e8ee4[_0xaffd('0x66')]&&_0x1e8ee4['type']!==_0xaffd('0x67')&&_0x1e8ee4[_0xaffd('0x4d')]!=='custom_dropdown';});return{'count':_0xa882f3[_0xaffd('0x32')],'rows':_[_0xaffd('0x27')](_0xa882f3,function(_0x88d85f){return{'id':_0x88d85f[_0xaffd('0x65')],'name':_0x88d85f[_0xaffd('0x68')],'custom':!_0x88d85f['default'],'options':_0x88d85f[_0xaffd('0x69')]?_[_0xaffd('0x27')](_0x88d85f['choices'],function(_0x10e398){return{'name':_[_0xaffd('0x6a')](_0x10e398),'value':_0x10e398};}):[]};})};}})[_0xaffd('0x22')](respondWithResult(_0x140610,null))[_0xaffd('0x43')](function(_0x2ce9cc){var _0x48211d=_0x55c190['query'][_0xaffd('0x6b')]?0x1f4:_0x2ce9cc[_0xaffd('0x6c')]||0x1f4;logger[_0xaffd('0x6d')](_0xaffd('0x6e'),'getFields',_0x48211d,JSON['stringify'](_0x2ce9cc));delete _0x2ce9cc[_0xaffd('0x65')];if(_0x48211d===0x191){_0x48211d=0x190;}_0x140610[_0xaffd('0x18')](_0x48211d)[_0xaffd('0x6f')](_0x55c190[_0xaffd('0x2c')][_0xaffd('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x2ce9cc[_0xaffd('0x6c')]}:_0x2ce9cc);});}; \ No newline at end of file +var _0x280f=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','index','map','FreshdeskAccount','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','rawAttributes','getConfigurations','nolimit','limit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','agent','description','priority','ticket_type','group','company','remove','default','custom_text','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x280f,0xe2));var _0xf280=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x280f[_0x5e6ea3];return _0x4048b5;};'use strict';var emlformat=require(_0xf280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf280('0x1'));var jsonpatch=require(_0xf280('0x2'));var rp=require(_0xf280('0x3'));var moment=require(_0xf280('0x4'));var BPromise=require(_0xf280('0x5'));var Mustache=require(_0xf280('0x6'));var util=require(_0xf280('0x7'));var path=require('path');var sox=require(_0xf280('0x8'));var csv=require(_0xf280('0x9'));var ejs=require(_0xf280('0xa'));var fs=require('fs');var fs_extra=require(_0xf280('0xb'));var _=require(_0xf280('0xc'));var squel=require('squel');var crypto=require(_0xf280('0xd'));var jsforce=require(_0xf280('0xe'));var deskjs=require(_0xf280('0xf'));var toCsv=require(_0xf280('0x9'));var querystring=require(_0xf280('0x10'));var Papa=require(_0xf280('0x11'));var Redis=require('ioredis');var authService=require(_0xf280('0x12'));var qs=require(_0xf280('0x13'));var as=require(_0xf280('0x14'));var hardwareService=require(_0xf280('0x15'));var logger=require(_0xf280('0x16'))(_0xf280('0x17'));var utils=require(_0xf280('0x18'));var config=require(_0xf280('0x19'));var licenseUtil=require(_0xf280('0x1a'));var db=require(_0xf280('0x1b'))['db'];var integrations=require(_0xf280('0x1c'));function respondWithStatusCode(_0x56221f,_0x566eb7){_0x566eb7=_0x566eb7||0xcc;return function(_0x45162a){if(_0x45162a){return _0x56221f[_0xf280('0x1d')](_0x566eb7);}return _0x56221f[_0xf280('0x1e')](_0x566eb7)[_0xf280('0x1f')]();};}function respondWithResult(_0x3e9acc,_0x59fb22){_0x59fb22=_0x59fb22||0xc8;return function(_0xb49bec){if(_0xb49bec){return _0x3e9acc[_0xf280('0x1e')](_0x59fb22)[_0xf280('0x20')](_0xb49bec);}};}function respondWithFilteredResult(_0x224162,_0x1e8f4d){return function(_0x462177){if(_0x462177){var _0x1d8dbd=typeof _0x1e8f4d['offset']==='undefined'&&typeof _0x1e8f4d['limit']===_0xf280('0x21');var _0x50a5ec=_0x462177[_0xf280('0x22')];var _0x57cd66=_0x1d8dbd?0x0:_0x1e8f4d[_0xf280('0x23')];var _0x464a5f=_0x1d8dbd?_0x462177['count']:_0x1e8f4d[_0xf280('0x23')]+_0x1e8f4d['limit'];var _0x6845b5;if(_0x464a5f>=_0x50a5ec){_0x464a5f=_0x50a5ec;_0x6845b5=0xc8;}else{_0x6845b5=0xce;}_0x224162[_0xf280('0x1e')](_0x6845b5);return _0x224162[_0xf280('0x24')](_0xf280('0x25'),_0x57cd66+'-'+_0x464a5f+'/'+_0x50a5ec)[_0xf280('0x20')](_0x462177);}return null;};}function patchUpdates(_0x3a4eff){return function(_0xdab5ea){try{jsonpatch[_0xf280('0x26')](_0xdab5ea,_0x3a4eff,!![]);}catch(_0xd90a7b){return BPromise['reject'](_0xd90a7b);}return _0xdab5ea[_0xf280('0x27')]();};}function saveUpdates(_0x5a1aa1,_0xfb624e){return function(_0x4422a8){if(_0x4422a8){return _0x4422a8[_0xf280('0x28')](_0x5a1aa1)[_0xf280('0x29')](function(_0x3de08f){return _0x3de08f;});}return null;};}function removeEntity(_0x42020c,_0x4c3618){return function(_0x15d27b){if(_0x15d27b){return _0x15d27b[_0xf280('0x2a')]()[_0xf280('0x29')](function(){_0x42020c[_0xf280('0x1e')](0xcc)[_0xf280('0x1f')]();});}};}function handleEntityNotFound(_0x302132,_0x4509c1){return function(_0x2c99ed){if(!_0x2c99ed){_0x302132['sendStatus'](0x194);}return _0x2c99ed;};}function handleError(_0x368b24,_0x1b21fb){_0x1b21fb=_0x1b21fb||0x1f4;return function(_0x1126d9){logger[_0xf280('0x2b')](_0x1126d9['stack']);if(_0x1126d9['name']){delete _0x1126d9['name'];}_0x368b24['status'](_0x1b21fb)['send'](_0x1126d9);};}exports[_0xf280('0x2c')]=function(_0x2409f4,_0xa1fbb7){var _0x34edaf={},_0x545ccf={},_0x1cdf05={'count':0x0,'rows':[]};var _0x556111=_[_0xf280('0x2d')](db[_0xf280('0x2e')]['rawAttributes'],function(_0x25a2d7){return{'name':_0x25a2d7[_0xf280('0x2f')],'type':_0x25a2d7[_0xf280('0x30')][_0xf280('0x31')]};});_0x545ccf['model']=_[_0xf280('0x2d')](_0x556111,_0xf280('0x32'));_0x545ccf[_0xf280('0x33')]=_[_0xf280('0x34')](_0x2409f4[_0xf280('0x33')]);_0x545ccf[_0xf280('0x35')]=_[_0xf280('0x36')](_0x545ccf[_0xf280('0x37')],_0x545ccf['query']);_0x34edaf[_0xf280('0x38')]=_[_0xf280('0x36')](_0x545ccf[_0xf280('0x37')],qs[_0xf280('0x39')](_0x2409f4['query']['fields']));_0x34edaf[_0xf280('0x38')]=_0x34edaf['attributes'][_0xf280('0x3a')]?_0x34edaf[_0xf280('0x38')]:_0x545ccf[_0xf280('0x37')];if(!_0x2409f4[_0xf280('0x33')][_0xf280('0x3b')]('nolimit')){_0x34edaf['limit']=qs['limit'](_0x2409f4[_0xf280('0x33')]['limit']);_0x34edaf[_0xf280('0x23')]=qs[_0xf280('0x23')](_0x2409f4['query'][_0xf280('0x23')]);}_0x34edaf[_0xf280('0x3c')]=qs[_0xf280('0x3d')](_0x2409f4[_0xf280('0x33')][_0xf280('0x3d')]);_0x34edaf[_0xf280('0x3e')]=qs[_0xf280('0x35')](_[_0xf280('0x3f')](_0x2409f4[_0xf280('0x33')],_0x545ccf[_0xf280('0x35')]),_0x556111);if(_0x2409f4['query'][_0xf280('0x40')]){_0x34edaf[_0xf280('0x3e')]=_[_0xf280('0x41')](_0x34edaf[_0xf280('0x3e')],{'$or':_[_0xf280('0x2d')](_0x556111,function(_0x4986a5){if(_0x4986a5[_0xf280('0x30')]!==_0xf280('0x42')){var _0x4f8929={};_0x4f8929[_0x4986a5[_0xf280('0x32')]]={'$like':'%'+_0x2409f4[_0xf280('0x33')][_0xf280('0x40')]+'%'};return _0x4f8929;}})});}_0x34edaf=_['merge']({},_0x34edaf,_0x2409f4[_0xf280('0x43')]);var _0x126762={'where':_0x34edaf['where']};return db[_0xf280('0x2e')][_0xf280('0x22')](_0x126762)[_0xf280('0x29')](function(_0x1c0761){_0x1cdf05[_0xf280('0x22')]=_0x1c0761;if(_0x2409f4[_0xf280('0x33')][_0xf280('0x44')]){_0x34edaf[_0xf280('0x45')]=[{'all':!![]}];}return db[_0xf280('0x2e')][_0xf280('0x46')](_0x34edaf);})[_0xf280('0x29')](function(_0x55f575){_0x1cdf05[_0xf280('0x47')]=_0x55f575;return _0x1cdf05;})[_0xf280('0x29')](respondWithFilteredResult(_0xa1fbb7,_0x34edaf))[_0xf280('0x48')](handleError(_0xa1fbb7,null));};exports[_0xf280('0x49')]=function(_0x4dcffd,_0x2ef2c6){var _0x456ac6={'raw':![],'where':{'id':_0x4dcffd[_0xf280('0x4a')]['id']}},_0x45d8df={};_0x45d8df[_0xf280('0x37')]=_['keys'](db[_0xf280('0x2e')]['rawAttributes']);_0x45d8df[_0xf280('0x33')]=_['keys'](_0x4dcffd[_0xf280('0x33')]);_0x45d8df[_0xf280('0x35')]=_[_0xf280('0x36')](_0x45d8df['model'],_0x45d8df['query']);_0x456ac6[_0xf280('0x38')]=_[_0xf280('0x36')](_0x45d8df['model'],qs[_0xf280('0x39')](_0x4dcffd[_0xf280('0x33')][_0xf280('0x39')]));_0x456ac6[_0xf280('0x38')]=_0x456ac6[_0xf280('0x38')]['length']?_0x456ac6[_0xf280('0x38')]:_0x45d8df[_0xf280('0x37')];if(_0x4dcffd[_0xf280('0x33')][_0xf280('0x44')]){_0x456ac6[_0xf280('0x45')]=[{'all':!![]}];}_0x456ac6=_[_0xf280('0x41')]({},_0x456ac6,_0x4dcffd[_0xf280('0x43')]);return db['FreshdeskAccount'][_0xf280('0x4b')](_0x456ac6)[_0xf280('0x29')](handleEntityNotFound(_0x2ef2c6,null))[_0xf280('0x29')](respondWithResult(_0x2ef2c6,null))[_0xf280('0x48')](handleError(_0x2ef2c6,null));};exports['create']=function(_0x29c7f0,_0x14f4a6){return db['FreshdeskAccount'][_0xf280('0x4c')](_0x29c7f0[_0xf280('0x4d')],{})['then'](respondWithResult(_0x14f4a6,0xc9))[_0xf280('0x48')](handleError(_0x14f4a6,null));};exports['update']=function(_0x5f45ca,_0x51ad69){if(_0x5f45ca[_0xf280('0x4d')]['id']){delete _0x5f45ca['body']['id'];}return db['FreshdeskAccount'][_0xf280('0x4b')]({'where':{'id':_0x5f45ca['params']['id']}})[_0xf280('0x29')](handleEntityNotFound(_0x51ad69,null))[_0xf280('0x29')](saveUpdates(_0x5f45ca[_0xf280('0x4d')],null))[_0xf280('0x29')](respondWithResult(_0x51ad69,null))[_0xf280('0x48')](handleError(_0x51ad69,null));};exports[_0xf280('0x2a')]=function(_0xc3a873,_0x47ab97){return db[_0xf280('0x2e')][_0xf280('0x4b')]({'where':{'id':_0xc3a873['params']['id']}})['then'](handleEntityNotFound(_0x47ab97,null))['then'](removeEntity(_0x47ab97,null))['catch'](handleError(_0x47ab97,null));};exports['getConfigurations']=function(_0x1ed725,_0x23d26a,_0x4a3844){var _0x3a847b={};var _0xf601c0={};var _0x4f4b5a;var _0x3842a3;return db['FreshdeskAccount'][_0xf280('0x4e')]({'where':{'id':_0x1ed725['params']['id']}})[_0xf280('0x29')](handleEntityNotFound(_0x23d26a,null))[_0xf280('0x29')](function(_0x85ec5a){if(_0x85ec5a){_0x4f4b5a=_0x85ec5a;_0xf601c0[_0xf280('0x37')]=_[_0xf280('0x34')](db['FreshdeskConfiguration'][_0xf280('0x4f')]);_0xf601c0[_0xf280('0x33')]=_[_0xf280('0x34')](_0x1ed725[_0xf280('0x33')]);_0xf601c0[_0xf280('0x35')]=_[_0xf280('0x36')](_0xf601c0[_0xf280('0x37')],_0xf601c0[_0xf280('0x33')]);_0x3a847b[_0xf280('0x38')]=_[_0xf280('0x36')](_0xf601c0[_0xf280('0x37')],qs[_0xf280('0x39')](_0x1ed725['query']['fields']));_0x3a847b['attributes']=_0x3a847b['attributes'][_0xf280('0x3a')]?_0x3a847b[_0xf280('0x38')]:_0xf601c0[_0xf280('0x37')];_0x3a847b['order']=qs[_0xf280('0x3d')](_0x1ed725[_0xf280('0x33')][_0xf280('0x3d')]);_0x3a847b[_0xf280('0x3e')]=qs[_0xf280('0x35')](_[_0xf280('0x3f')](_0x1ed725[_0xf280('0x33')],_0xf601c0[_0xf280('0x35')]));if(_0x1ed725[_0xf280('0x33')][_0xf280('0x40')]){_0x3a847b[_0xf280('0x3e')]=_['merge'](_0x3a847b['where'],{'$or':_[_0xf280('0x2d')](_0x3a847b[_0xf280('0x38')],function(_0x3e7e2e){var _0x5a129f={};_0x5a129f[_0x3e7e2e]={'$like':'%'+_0x1ed725[_0xf280('0x33')][_0xf280('0x40')]+'%'};return _0x5a129f;})});}_0x3a847b=_[_0xf280('0x41')]({},_0x3a847b,_0x1ed725[_0xf280('0x43')]);return _0x4f4b5a[_0xf280('0x50')](_0x3a847b);}})[_0xf280('0x29')](function(_0x5110fe){if(_0x5110fe){_0x3842a3=_0x5110fe['length'];if(!_0x1ed725['query'][_0xf280('0x3b')](_0xf280('0x51'))){_0x3a847b[_0xf280('0x52')]=qs[_0xf280('0x52')](_0x1ed725['query'][_0xf280('0x52')]);_0x3a847b[_0xf280('0x23')]=qs['offset'](_0x1ed725[_0xf280('0x33')][_0xf280('0x23')]);}return _0x4f4b5a[_0xf280('0x50')](_0x3a847b);}})[_0xf280('0x29')](function(_0x258bd7){if(_0x258bd7){return _0x258bd7?{'count':_0x3842a3,'rows':_0x258bd7}:null;}})[_0xf280('0x29')](respondWithResult(_0x23d26a,null))[_0xf280('0x48')](handleError(_0x23d26a,null));};exports[_0xf280('0x53')]=function(_0x1af030,_0x516b8a,_0x4ba32d){if(_0x1af030[_0xf280('0x4d')]['id']){delete _0x1af030[_0xf280('0x4d')]['id'];}return db[_0xf280('0x2e')][_0xf280('0x4e')]({'where':{'id':_0x1af030[_0xf280('0x4a')]['id']}})[_0xf280('0x29')](handleEntityNotFound(_0x516b8a,null))[_0xf280('0x29')](function(_0x5dc18a){if(_0x5dc18a){_0x1af030[_0xf280('0x4d')][_0xf280('0x54')]=_0x5dc18a['id'];_0x1af030[_0xf280('0x4d')][_0xf280('0x55')]=integrations[_0xf280('0x56')](_0x1af030[_0xf280('0x4d')][_0xf280('0x57')],_0x1af030[_0xf280('0x4d')][_0xf280('0x30')]);_0x1af030[_0xf280('0x4d')][_0xf280('0x58')]=integrations[_0xf280('0x59')](_0x1af030['body'][_0xf280('0x57')],_0x1af030['body'][_0xf280('0x30')]);return db['FreshdeskConfiguration'][_0xf280('0x4c')](_0x1af030[_0xf280('0x4d')],{'include':[{'model':db[_0xf280('0x5a')],'as':_0xf280('0x55')},{'model':db[_0xf280('0x5a')],'as':_0xf280('0x58')}]});}return null;})['then'](respondWithResult(_0x516b8a,null))[_0xf280('0x48')](handleError(_0x516b8a,null));};exports[_0xf280('0x5b')]=function(_0x332942,_0x1c078a,_0x576505){var _0x3acddf='';return db[_0xf280('0x2e')][_0xf280('0x4e')]({'where':{'id':_0x332942[_0xf280('0x4a')]['id']},'attributes':['id',_0xf280('0x5c'),_0xf280('0x5d')]})['then'](handleEntityNotFound(_0x1c078a,null))[_0xf280('0x29')](function(_0x241a04){if(_0x241a04){_0x3acddf=_0x241a04['remoteUri'];var _0x16155b=_0x3acddf[_0xf280('0x5e')](-0x1);if(_0x16155b==='/'){_0x3acddf=_0x3acddf[_0xf280('0x5f')](0x0,_0x3acddf['lastIndexOf'](_0x16155b));}return rp({'method':'GET','uri':util[_0xf280('0x60')](_0xf280('0x61'),_0x3acddf,_0xf280('0x62')),'headers':{'Authorization':util['format'](_0xf280('0x63'),new Buffer(util[_0xf280('0x60')](_0xf280('0x64'),_0x241a04[_0xf280('0x5d')]))[_0xf280('0x65')](_0xf280('0x66')))},'json':!![]});}})[_0xf280('0x29')](function(_0x20ea5d){if(_0x20ea5d){var _0x27ca03=[_0xf280('0x67'),'subject',_0xf280('0x68'),_0xf280('0x69'),_0xf280('0x1e'),_0xf280('0x6a'),'group','source',_0xf280('0x6b'),_0xf280('0x6c'),_0xf280('0x6d')];_[_0xf280('0x6e')](_0x20ea5d,function(_0x29344a){return _0x27ca03['includes'](_0x29344a[_0xf280('0x32')])||!_0x29344a[_0xf280('0x6f')]&&_0x29344a[_0xf280('0x30')]!==_0xf280('0x70')&&_0x29344a[_0xf280('0x30')]!=='custom_dropdown';});return{'count':_0x20ea5d[_0xf280('0x3a')],'rows':_[_0xf280('0x2d')](_0x20ea5d,function(_0x22c44c){return{'id':_0x22c44c[_0xf280('0x32')],'name':_0x22c44c['label'],'custom':!_0x22c44c['default'],'options':_0x22c44c[_0xf280('0x71')]?_['map'](_0x22c44c[_0xf280('0x71')],function(_0x3ac72a){return{'name':_[_0xf280('0x72')](_0x3ac72a),'value':_0x3ac72a};}):[]};})};}})['then'](respondWithResult(_0x1c078a,null))[_0xf280('0x48')](function(_0x42a765){var _0x341c4d=_0x332942[_0xf280('0x33')][_0xf280('0x73')]?0x1f4:_0x42a765[_0xf280('0x74')]||0x1f4;logger['error'](_0xf280('0x75'),_0xf280('0x5b'),_0x341c4d,JSON[_0xf280('0x76')](_0x42a765));delete _0x42a765[_0xf280('0x32')];if(_0x341c4d===0x191){_0x341c4d=0x190;}_0x1c078a[_0xf280('0x1e')](_0x341c4d)[_0xf280('0x77')](_0x332942[_0xf280('0x33')][_0xf280('0x73')]?{'message':_0xf280('0x78'),'statusCode':_0x42a765[_0xf280('0x74')]}:_0x42a765);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7446ebe..1c47b3b 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 _0x00a5=['int_freshdesk_accounts','../../config/logger','api','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount'];(function(_0x5e7282,_0xf4ad80){var _0x346994=function(_0x50e9fc){while(--_0x50e9fc){_0x5e7282['push'](_0x5e7282['shift']());}};_0x346994(++_0xf4ad80);}(_0x00a5,0x12a));var _0x500a=function(_0x2e0225,_0x2c2001){_0x2e0225=_0x2e0225-0x0;var _0x21d9f1=_0x00a5[_0x2e0225];return _0x21d9f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x500a('0x0'))(_0x500a('0x1'));var moment=require('moment');var BPromise=require(_0x500a('0x2'));var rp=require(_0x500a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x500a('0x4'));var config=require('../../config/environment');var attributes=require(_0x500a('0x5'));var integrations=require(_0x500a('0x6'));module[_0x500a('0x7')]=function(_0x3f8315,_0x2d7b75){return _0x3f8315[_0x500a('0x8')](_0x500a('0x9'),attributes,{'tableName':_0x500a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d5a=['../../config/environment','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x448bdd,_0x34d0ea){var _0x11ad0c=function(_0x343e90){while(--_0x343e90){_0x448bdd['push'](_0x448bdd['shift']());}};_0x11ad0c(++_0x34d0ea);}(_0x1d5a,0x172));var _0xa1d5=function(_0x68403a,_0x306983){_0x68403a=_0x68403a-0x0;var _0x29964a=_0x1d5a[_0x68403a];return _0x29964a;};'use strict';var _=require(_0xa1d5('0x0'));var util=require(_0xa1d5('0x1'));var logger=require(_0xa1d5('0x2'))(_0xa1d5('0x3'));var moment=require(_0xa1d5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1d5('0x5'));var fs=require('fs');var path=require(_0xa1d5('0x6'));var rimraf=require(_0xa1d5('0x7'));var config=require(_0xa1d5('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0xa1d5('0x9'));module[_0xa1d5('0xa')]=function(_0x382cb8,_0x2778ac){return _0x382cb8[_0xa1d5('0xb')](_0xa1d5('0xc'),attributes,{'tableName':_0xa1d5('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 e65cdd7..73fcda3 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 _0xe02c=['GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','info'];(function(_0x3c5d55,_0x40ab1d){var _0x2858ec=function(_0x4c89e3){while(--_0x4c89e3){_0x3c5d55['push'](_0x3c5d55['shift']());}};_0x2858ec(++_0x40ab1d);}(_0xe02c,0xae));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce02('0x0'));var util=require('util');var moment=require(_0xce02('0x1'));var BPromise=require(_0xce02('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce02('0x3'));var db=require(_0xce02('0x4'))['db'];var utils=require(_0xce02('0x5'));var logger=require('../../config/logger')(_0xce02('0x6'));var config=require(_0xce02('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xce02('0x8')][_0xce02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x452e11,_0x1cc92f,_0x3f98a0){return new BPromise(function(_0x5086a1,_0x1e9dbe){return client[_0xce02('0xa')](_0x452e11,_0x3f98a0)[_0xce02('0xb')](function(_0x479c8c){logger['info'](_0xce02('0xc'),_0x1cc92f,_0xce02('0xd'));logger[_0xce02('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1cc92f,'request\x20sent',JSON[_0xce02('0xf')](_0x479c8c));if(_0x479c8c[_0xce02('0x10')]){if(_0x479c8c[_0xce02('0x10')]['code']===0x1f4){logger[_0xce02('0x10')](_0xce02('0xc'),_0x1cc92f,_0x479c8c[_0xce02('0x10')][_0xce02('0x11')]);return _0x1e9dbe(_0x479c8c['error'][_0xce02('0x11')]);}logger[_0xce02('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1cc92f,_0x479c8c['error'][_0xce02('0x11')]);return _0x5086a1(_0x479c8c[_0xce02('0x10')]['message']);}else{logger['info'](_0xce02('0xc'),_0x1cc92f,_0xce02('0xd'));_0x5086a1(_0x479c8c[_0xce02('0x12')]['message']);}})[_0xce02('0x13')](function(_0x4d847d){logger[_0xce02('0x10')](_0xce02('0xc'),_0x1cc92f,_0x4d847d);_0x1e9dbe(_0x4d847d);});});}exports['GetFreshdeskAccount']=function(_0x93ce59){var _0x44d311=this;return new Promise(function(_0x3d546a,_0xd7c86e){return db[_0xce02('0x14')][_0xce02('0x15')]({'raw':_0x93ce59['options']?_0x93ce59[_0xce02('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x17')]||null:null,'attributes':_0x93ce59[_0xce02('0x16')]?_0x93ce59['options'][_0xce02('0x18')]||null:null,'limit':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x19')]||null:null,'include':_0x93ce59[_0xce02('0x16')]?_0x93ce59[_0xce02('0x16')][_0xce02('0x1a')]?_[_0xce02('0x1b')](_0x93ce59[_0xce02('0x16')][_0xce02('0x1a')],function(_0x1a32cc){return{'model':db[_0x1a32cc[_0xce02('0x1c')]],'as':_0x1a32cc['as'],'attributes':_0x1a32cc[_0xce02('0x18')],'include':_0x1a32cc[_0xce02('0x1a')]?_[_0xce02('0x1b')](_0x1a32cc[_0xce02('0x1a')],function(_0x330edf){return{'model':db[_0x330edf[_0xce02('0x1c')]],'as':_0x330edf['as'],'attributes':_0x330edf[_0xce02('0x18')],'include':_0x330edf['include']?_[_0xce02('0x1b')](_0x330edf[_0xce02('0x1a')],function(_0xfe3349){return{'model':db[_0xfe3349[_0xce02('0x1c')]],'as':_0xfe3349['as'],'attributes':_0xfe3349[_0xce02('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4011c0){logger[_0xce02('0x1d')](_0xce02('0x1e'),_0x93ce59);logger['debug'](_0xce02('0x1e'),_0x93ce59,JSON['stringify'](_0x4011c0));_0x3d546a(_0x4011c0);})['catch'](function(_0x2a0b4c){logger[_0xce02('0x10')]('GetFreshdeskAccount',_0x2a0b4c['message'],_0x93ce59);_0xd7c86e(_0x44d311[_0xce02('0x10')](0x1f4,_0x2a0b4c[_0xce02('0x11')]));});});};exports[_0xce02('0x1f')]=function(_0x570a0e){var _0x331584=this;return new Promise(function(_0x2f7e97,_0x5d05c9){return db['FreshdeskAccount'][_0xce02('0x20')]({'raw':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x21')]===undefined?!![]:![]:!![],'where':_0x570a0e['options']?_0x570a0e['options'][_0xce02('0x17')]||null:null,'attributes':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x18')]||null:null,'include':_0x570a0e[_0xce02('0x16')]?_0x570a0e[_0xce02('0x16')][_0xce02('0x1a')]?_['map'](_0x570a0e[_0xce02('0x16')][_0xce02('0x1a')],function(_0x3f6d7f){return{'model':db[_0x3f6d7f[_0xce02('0x1c')]],'as':_0x3f6d7f['as'],'attributes':_0x3f6d7f[_0xce02('0x18')],'include':_0x3f6d7f['include']?_[_0xce02('0x1b')](_0x3f6d7f[_0xce02('0x1a')],function(_0x3ad316){return{'model':db[_0x3ad316[_0xce02('0x1c')]],'as':_0x3ad316['as'],'attributes':_0x3ad316[_0xce02('0x18')],'include':_0x3ad316['include']?_[_0xce02('0x1b')](_0x3ad316[_0xce02('0x1a')],function(_0x5dc1fc){return{'model':db[_0x5dc1fc['model']],'as':_0x5dc1fc['as'],'attributes':_0x5dc1fc['attributes']};}):[]};}):[]};}):[]:[]})[_0xce02('0xb')](function(_0x4f8412){logger[_0xce02('0x1d')](_0xce02('0x1f'),_0x570a0e);logger[_0xce02('0xe')](_0xce02('0x1f'),_0x570a0e,JSON['stringify'](_0x4f8412));_0x2f7e97(_0x4f8412);})[_0xce02('0x13')](function(_0xe81009){logger[_0xce02('0x10')](_0xce02('0x1f'),_0xe81009[_0xce02('0x11')],_0x570a0e);_0x5d05c9(_0x331584[_0xce02('0x10')](0x1f4,_0xe81009[_0xce02('0x11')]));});});}; \ No newline at end of file +var _0xff98=['catch','FreshdeskAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetFreshdeskAccount','stringify','ShowFreshdeskAccount','find','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x658fea,_0x3cfe9c){var _0x2063e7=function(_0x312eaf){while(--_0x312eaf){_0x658fea['push'](_0x658fea['shift']());}};_0x2063e7(++_0x3cfe9c);}(_0xff98,0x9c));var _0x8ff9=function(_0x36230d,_0x156c2c){_0x36230d=_0x36230d-0x0;var _0x56997a=_0xff98[_0x36230d];return _0x56997a;};'use strict';var _=require('lodash');var util=require(_0x8ff9('0x0'));var moment=require(_0x8ff9('0x1'));var BPromise=require(_0x8ff9('0x2'));var rs=require(_0x8ff9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ff9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ff9('0x5'))('rpc');var config=require(_0x8ff9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8ff9('0x7')][_0x8ff9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4122b2,_0x3e6002,_0x280acf){return new BPromise(function(_0x428b0f,_0x32d672){return client[_0x8ff9('0x9')](_0x4122b2,_0x280acf)['then'](function(_0x36de34){logger[_0x8ff9('0xa')](_0x8ff9('0xb'),_0x3e6002,_0x8ff9('0xc'));logger[_0x8ff9('0xd')](_0x8ff9('0xe'),_0x3e6002,_0x8ff9('0xc'),JSON['stringify'](_0x36de34));if(_0x36de34['error']){if(_0x36de34['error'][_0x8ff9('0xf')]===0x1f4){logger[_0x8ff9('0x10')](_0x8ff9('0xb'),_0x3e6002,_0x36de34['error'][_0x8ff9('0x11')]);return _0x32d672(_0x36de34[_0x8ff9('0x10')][_0x8ff9('0x11')]);}logger[_0x8ff9('0x10')](_0x8ff9('0xb'),_0x3e6002,_0x36de34[_0x8ff9('0x10')][_0x8ff9('0x11')]);return _0x428b0f(_0x36de34['error'][_0x8ff9('0x11')]);}else{logger[_0x8ff9('0xa')](_0x8ff9('0xb'),_0x3e6002,'request\x20sent');_0x428b0f(_0x36de34[_0x8ff9('0x12')]['message']);}})[_0x8ff9('0x13')](function(_0x578fe3){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x3e6002,_0x578fe3);_0x32d672(_0x578fe3);});});}exports['GetFreshdeskAccount']=function(_0x20d149){var _0x2dedbc=this;return new Promise(function(_0xad903b,_0x406bc8){return db[_0x8ff9('0x14')][_0x8ff9('0x15')]({'raw':_0x20d149[_0x8ff9('0x16')]?_0x20d149['options'][_0x8ff9('0x17')]===undefined?!![]:![]:!![],'where':_0x20d149[_0x8ff9('0x16')]?_0x20d149[_0x8ff9('0x16')]['where']||null:null,'attributes':_0x20d149[_0x8ff9('0x16')]?_0x20d149[_0x8ff9('0x16')][_0x8ff9('0x18')]||null:null,'limit':_0x20d149[_0x8ff9('0x16')]?_0x20d149[_0x8ff9('0x16')][_0x8ff9('0x19')]||null:null,'include':_0x20d149[_0x8ff9('0x16')]?_0x20d149[_0x8ff9('0x16')][_0x8ff9('0x1a')]?_[_0x8ff9('0x1b')](_0x20d149[_0x8ff9('0x16')][_0x8ff9('0x1a')],function(_0x3aff05){return{'model':db[_0x3aff05['model']],'as':_0x3aff05['as'],'attributes':_0x3aff05['attributes'],'include':_0x3aff05[_0x8ff9('0x1a')]?_['map'](_0x3aff05[_0x8ff9('0x1a')],function(_0x5a1116){return{'model':db[_0x5a1116[_0x8ff9('0x1c')]],'as':_0x5a1116['as'],'attributes':_0x5a1116[_0x8ff9('0x18')],'include':_0x5a1116[_0x8ff9('0x1a')]?_[_0x8ff9('0x1b')](_0x5a1116[_0x8ff9('0x1a')],function(_0xcdd5d8){return{'model':db[_0xcdd5d8[_0x8ff9('0x1c')]],'as':_0xcdd5d8['as'],'attributes':_0xcdd5d8[_0x8ff9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8ff9('0x1d')](function(_0x1207b2){logger['info'](_0x8ff9('0x1e'),_0x20d149);logger[_0x8ff9('0xd')](_0x8ff9('0x1e'),_0x20d149,JSON[_0x8ff9('0x1f')](_0x1207b2));_0xad903b(_0x1207b2);})[_0x8ff9('0x13')](function(_0x5c2a7a){logger[_0x8ff9('0x10')]('GetFreshdeskAccount',_0x5c2a7a[_0x8ff9('0x11')],_0x20d149);_0x406bc8(_0x2dedbc[_0x8ff9('0x10')](0x1f4,_0x5c2a7a[_0x8ff9('0x11')]));});});};exports[_0x8ff9('0x20')]=function(_0x26ec22){var _0x12e0da=this;return new Promise(function(_0x52d14f,_0xe9ade1){return db[_0x8ff9('0x14')][_0x8ff9('0x21')]({'raw':_0x26ec22[_0x8ff9('0x16')]?_0x26ec22[_0x8ff9('0x16')][_0x8ff9('0x17')]===undefined?!![]:![]:!![],'where':_0x26ec22['options']?_0x26ec22['options'][_0x8ff9('0x22')]||null:null,'attributes':_0x26ec22['options']?_0x26ec22[_0x8ff9('0x16')][_0x8ff9('0x18')]||null:null,'include':_0x26ec22[_0x8ff9('0x16')]?_0x26ec22[_0x8ff9('0x16')][_0x8ff9('0x1a')]?_[_0x8ff9('0x1b')](_0x26ec22['options'][_0x8ff9('0x1a')],function(_0x4407a7){return{'model':db[_0x4407a7[_0x8ff9('0x1c')]],'as':_0x4407a7['as'],'attributes':_0x4407a7[_0x8ff9('0x18')],'include':_0x4407a7['include']?_[_0x8ff9('0x1b')](_0x4407a7[_0x8ff9('0x1a')],function(_0x1dc393){return{'model':db[_0x1dc393[_0x8ff9('0x1c')]],'as':_0x1dc393['as'],'attributes':_0x1dc393[_0x8ff9('0x18')],'include':_0x1dc393[_0x8ff9('0x1a')]?_[_0x8ff9('0x1b')](_0x1dc393[_0x8ff9('0x1a')],function(_0x5ac4b1){return{'model':db[_0x5ac4b1[_0x8ff9('0x1c')]],'as':_0x5ac4b1['as'],'attributes':_0x5ac4b1[_0x8ff9('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5227ee){logger[_0x8ff9('0xa')](_0x8ff9('0x20'),_0x26ec22);logger[_0x8ff9('0xd')](_0x8ff9('0x20'),_0x26ec22,JSON[_0x8ff9('0x1f')](_0x5227ee));_0x52d14f(_0x5227ee);})['catch'](function(_0x2144f4){logger[_0x8ff9('0x10')](_0x8ff9('0x20'),_0x2144f4[_0x8ff9('0x11')],_0x26ec22);_0xe9ade1(_0x12e0da[_0x8ff9('0x10')](0x1f4,_0x2144f4[_0x8ff9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index dca13e2..9051693 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 _0x3b72=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','put','update','delete'];(function(_0x2e6ce5,_0x58a272){var _0x2de504=function(_0x82cb51){while(--_0x82cb51){_0x2e6ce5['push'](_0x2e6ce5['shift']());}};_0x2de504(++_0x58a272);}(_0x3b72,0x1d2));var _0x23b7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3b72[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x23b7('0x0'));var util=require('util');var path=require(_0x23b7('0x1'));var timeout=require(_0x23b7('0x2'));var express=require(_0x23b7('0x3'));var router=express[_0x23b7('0x4')]();var fs_extra=require(_0x23b7('0x5'));var auth=require(_0x23b7('0x6'));var interaction=require(_0x23b7('0x7'));var config=require(_0x23b7('0x8'));var controller=require(_0x23b7('0x9'));router[_0x23b7('0xa')]('/',auth[_0x23b7('0xb')](),controller[_0x23b7('0xc')]);router[_0x23b7('0xa')](_0x23b7('0xd'),auth['isAuthenticated'](),controller[_0x23b7('0xe')]);router[_0x23b7('0xa')]('/:id/fields',auth[_0x23b7('0xb')](),controller[_0x23b7('0xf')]);router[_0x23b7('0xa')](_0x23b7('0x10'),auth['isAuthenticated'](),controller[_0x23b7('0x11')]);router[_0x23b7('0xa')](_0x23b7('0x12'),auth['isAuthenticated'](),controller[_0x23b7('0x13')]);router[_0x23b7('0xa')](_0x23b7('0x14'),auth[_0x23b7('0xb')](),controller[_0x23b7('0x15')]);router['post']('/',auth[_0x23b7('0xb')](),controller[_0x23b7('0x16')]);router[_0x23b7('0x17')](_0x23b7('0x14'),auth[_0x23b7('0xb')](),controller['setTags']);router[_0x23b7('0x18')](_0x23b7('0xd'),auth['isAuthenticated'](),controller[_0x23b7('0x19')]);router[_0x23b7('0x1a')](_0x23b7('0xd'),auth[_0x23b7('0xb')](),controller[_0x23b7('0x1b')]);module[_0x23b7('0x1c')]=router; \ No newline at end of file +var _0x70de=['index','/:id','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x58c05c,_0x21948e){var _0x2062cb=function(_0x54e108){while(--_0x54e108){_0x58c05c['push'](_0x58c05c['shift']());}};_0x2062cb(++_0x21948e);}(_0x70de,0xf1));var _0xe70d=function(_0x46f3f8,_0x12c74b){_0x46f3f8=_0x46f3f8-0x0;var _0xbc57cd=_0x70de[_0x46f3f8];return _0xbc57cd;};'use strict';var multer=require(_0xe70d('0x0'));var util=require(_0xe70d('0x1'));var path=require(_0xe70d('0x2'));var timeout=require(_0xe70d('0x3'));var express=require(_0xe70d('0x4'));var router=express[_0xe70d('0x5')]();var fs_extra=require(_0xe70d('0x6'));var auth=require(_0xe70d('0x7'));var interaction=require(_0xe70d('0x8'));var config=require(_0xe70d('0x9'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xe70d('0xa')]('/',auth['isAuthenticated'](),controller[_0xe70d('0xb')]);router[_0xe70d('0xa')](_0xe70d('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe70d('0xa')](_0xe70d('0xd'),auth[_0xe70d('0xe')](),controller[_0xe70d('0xf')]);router[_0xe70d('0xa')](_0xe70d('0x10'),auth[_0xe70d('0xe')](),controller[_0xe70d('0x11')]);router['get']('/:id/descriptions',auth[_0xe70d('0xe')](),controller[_0xe70d('0x12')]);router[_0xe70d('0xa')](_0xe70d('0x13'),auth[_0xe70d('0xe')](),controller[_0xe70d('0x14')]);router[_0xe70d('0x15')]('/',auth[_0xe70d('0xe')](),controller[_0xe70d('0x16')]);router[_0xe70d('0x15')](_0xe70d('0x13'),auth[_0xe70d('0xe')](),controller['setTags']);router[_0xe70d('0x17')]('/:id',auth[_0xe70d('0xe')](),controller[_0xe70d('0x18')]);router[_0xe70d('0x19')](_0xe70d('0xc'),auth[_0xe70d('0xe')](),controller[_0xe70d('0x1a')]);module[_0xe70d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 973ef0e..2bf9950 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 _0xaad8=['sequelize','STRING'];(function(_0x468ef4,_0x5341d4){var _0x1f6570=function(_0x51d33c){while(--_0x51d33c){_0x468ef4['push'](_0x468ef4['shift']());}};_0x1f6570(++_0x5341d4);}(_0xaad8,0x11c));var _0x8aad=function(_0x437c06,_0x41dd4f){_0x437c06=_0x437c06-0x0;var _0xebe299=_0xaad8[_0x437c06];return _0xebe299;};'use strict';var Sequelize=require(_0x8aad('0x0'));module['exports']={'name':{'type':Sequelize[_0x8aad('0x1')]},'description':{'type':Sequelize[_0x8aad('0x1')]}}; \ No newline at end of file +var _0xa4b4=['STRING','sequelize'];(function(_0x50ee65,_0x146715){var _0x50baab=function(_0x92c3ae){while(--_0x92c3ae){_0x50ee65['push'](_0x50ee65['shift']());}};_0x50baab(++_0x146715);}(_0xa4b4,0xf3));var _0x4a4b=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0xa4b4[_0x5ec453];return _0x25548f;};'use strict';var Sequelize=require(_0x4a4b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a4b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c26a67d..102b00b 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 _0xf7ac=['update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','getFields','findOne','FreshdeskField','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x2db9b6,_0x5ef6b2){var _0x3310e9=function(_0x2436b1){while(--_0x2436b1){_0x2db9b6['push'](_0x2db9b6['shift']());}};_0x3310e9(++_0x5ef6b2);}(_0xf7ac,0xdb));var _0xcf7a=function(_0x4bf029,_0x3e24f6){_0x4bf029=_0x4bf029-0x0;var _0x359cf3=_0xf7ac[_0x4bf029];return _0x359cf3;};'use strict';var emlformat=require(_0xcf7a('0x0'));var rimraf=require(_0xcf7a('0x1'));var zipdir=require(_0xcf7a('0x2'));var jsonpatch=require(_0xcf7a('0x3'));var rp=require(_0xcf7a('0x4'));var moment=require('moment');var BPromise=require(_0xcf7a('0x5'));var Mustache=require(_0xcf7a('0x6'));var util=require(_0xcf7a('0x7'));var path=require(_0xcf7a('0x8'));var sox=require('sox');var csv=require(_0xcf7a('0x9'));var ejs=require(_0xcf7a('0xa'));var fs=require('fs');var fs_extra=require(_0xcf7a('0xb'));var _=require(_0xcf7a('0xc'));var squel=require(_0xcf7a('0xd'));var crypto=require('crypto');var jsforce=require(_0xcf7a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf7a('0xf'));var Papa=require(_0xcf7a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf7a('0x11'));var as=require(_0xcf7a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf7a('0x13'));var utils=require(_0xcf7a('0x14'));var config=require(_0xcf7a('0x15'));var licenseUtil=require(_0xcf7a('0x16'));var db=require(_0xcf7a('0x17'))['db'];function respondWithStatusCode(_0x184329,_0x3c5438){_0x3c5438=_0x3c5438||0xcc;return function(_0x3f55b3){if(_0x3f55b3){return _0x184329[_0xcf7a('0x18')](_0x3c5438);}return _0x184329[_0xcf7a('0x19')](_0x3c5438)['end']();};}function respondWithResult(_0x5d6b9a,_0x4c427e){_0x4c427e=_0x4c427e||0xc8;return function(_0x2a79ae){if(_0x2a79ae){return _0x5d6b9a[_0xcf7a('0x19')](_0x4c427e)['json'](_0x2a79ae);}};}function respondWithFilteredResult(_0x388edf,_0x4527ce){return function(_0x269b1c){if(_0x269b1c){var _0x17a40a=typeof _0x4527ce[_0xcf7a('0x1a')]===_0xcf7a('0x1b')&&typeof _0x4527ce[_0xcf7a('0x1c')]===_0xcf7a('0x1b');var _0x2e01af=_0x269b1c[_0xcf7a('0x1d')];var _0x8c2f41=_0x17a40a?0x0:_0x4527ce[_0xcf7a('0x1a')];var _0x5d1e28=_0x17a40a?_0x269b1c[_0xcf7a('0x1d')]:_0x4527ce[_0xcf7a('0x1a')]+_0x4527ce[_0xcf7a('0x1c')];var _0x4a5e46;if(_0x5d1e28>=_0x2e01af){_0x5d1e28=_0x2e01af;_0x4a5e46=0xc8;}else{_0x4a5e46=0xce;}_0x388edf['status'](_0x4a5e46);return _0x388edf[_0xcf7a('0x1e')](_0xcf7a('0x1f'),_0x8c2f41+'-'+_0x5d1e28+'/'+_0x2e01af)[_0xcf7a('0x20')](_0x269b1c);}return null;};}function patchUpdates(_0x2f4299){return function(_0x160c7e){try{jsonpatch['apply'](_0x160c7e,_0x2f4299,!![]);}catch(_0x2dd371){return BPromise['reject'](_0x2dd371);}return _0x160c7e['save']();};}function saveUpdates(_0x441f62,_0x589b12){return function(_0x2408b9){if(_0x2408b9){return _0x2408b9[_0xcf7a('0x21')](_0x441f62)[_0xcf7a('0x22')](function(_0x22d0b4){return _0x22d0b4;});}return null;};}function removeEntity(_0x411e72,_0x35fd59){return function(_0x25348b){if(_0x25348b){return _0x25348b[_0xcf7a('0x23')]()[_0xcf7a('0x22')](function(){_0x411e72[_0xcf7a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca7d5,_0x3d17d6){return function(_0x160694){if(!_0x160694){_0x3ca7d5[_0xcf7a('0x18')](0x194);}return _0x160694;};}function handleError(_0x49ee8e,_0x3b9e59){_0x3b9e59=_0x3b9e59||0x1f4;return function(_0x8e17e4){logger[_0xcf7a('0x24')](_0x8e17e4[_0xcf7a('0x25')]);if(_0x8e17e4[_0xcf7a('0x26')]){delete _0x8e17e4[_0xcf7a('0x26')];}_0x49ee8e[_0xcf7a('0x19')](_0x3b9e59)[_0xcf7a('0x27')](_0x8e17e4);};}exports[_0xcf7a('0x28')]=function(_0x567c47,_0x15b6a8){var _0x204f28={},_0x13ae5c={},_0x59b08e={'count':0x0,'rows':[]};var _0x2b82cc=_[_0xcf7a('0x29')](db[_0xcf7a('0x2a')][_0xcf7a('0x2b')],function(_0x201804){return{'name':_0x201804[_0xcf7a('0x2c')],'type':_0x201804['type'][_0xcf7a('0x2d')]};});_0x13ae5c[_0xcf7a('0x2e')]=_[_0xcf7a('0x29')](_0x2b82cc,_0xcf7a('0x26'));_0x13ae5c[_0xcf7a('0x2f')]=_['keys'](_0x567c47[_0xcf7a('0x2f')]);_0x13ae5c[_0xcf7a('0x30')]=_[_0xcf7a('0x31')](_0x13ae5c[_0xcf7a('0x2e')],_0x13ae5c[_0xcf7a('0x2f')]);_0x204f28[_0xcf7a('0x32')]=_[_0xcf7a('0x31')](_0x13ae5c[_0xcf7a('0x2e')],qs[_0xcf7a('0x33')](_0x567c47[_0xcf7a('0x2f')][_0xcf7a('0x33')]));_0x204f28[_0xcf7a('0x32')]=_0x204f28['attributes'][_0xcf7a('0x34')]?_0x204f28[_0xcf7a('0x32')]:_0x13ae5c[_0xcf7a('0x2e')];if(!_0x567c47[_0xcf7a('0x2f')]['hasOwnProperty'](_0xcf7a('0x35'))){_0x204f28[_0xcf7a('0x1c')]=qs['limit'](_0x567c47['query'][_0xcf7a('0x1c')]);_0x204f28[_0xcf7a('0x1a')]=qs[_0xcf7a('0x1a')](_0x567c47[_0xcf7a('0x2f')][_0xcf7a('0x1a')]);}_0x204f28[_0xcf7a('0x36')]=qs[_0xcf7a('0x37')](_0x567c47['query'][_0xcf7a('0x37')]);_0x204f28[_0xcf7a('0x38')]=qs['filters'](_[_0xcf7a('0x39')](_0x567c47[_0xcf7a('0x2f')],_0x13ae5c['filters']),_0x2b82cc);if(_0x567c47[_0xcf7a('0x2f')][_0xcf7a('0x3a')]){_0x204f28[_0xcf7a('0x38')]=_['merge'](_0x204f28[_0xcf7a('0x38')],{'$or':_[_0xcf7a('0x29')](_0x2b82cc,function(_0x39b5cb){if(_0x39b5cb[_0xcf7a('0x3b')]!==_0xcf7a('0x3c')){var _0x1164d8={};_0x1164d8[_0x39b5cb[_0xcf7a('0x26')]]={'$like':'%'+_0x567c47[_0xcf7a('0x2f')]['filter']+'%'};return _0x1164d8;}})});}_0x204f28=_['merge']({},_0x204f28,_0x567c47[_0xcf7a('0x3d')]);var _0x5273e0={'where':_0x204f28[_0xcf7a('0x38')]};return db['FreshdeskConfiguration'][_0xcf7a('0x1d')](_0x5273e0)['then'](function(_0x2b26c1){_0x59b08e[_0xcf7a('0x1d')]=_0x2b26c1;if(_0x567c47[_0xcf7a('0x2f')][_0xcf7a('0x3e')]){_0x204f28[_0xcf7a('0x3f')]=[{'all':!![]}];}return db[_0xcf7a('0x2a')][_0xcf7a('0x40')](_0x204f28);})[_0xcf7a('0x22')](function(_0x3044d0){_0x59b08e[_0xcf7a('0x41')]=_0x3044d0;return _0x59b08e;})[_0xcf7a('0x22')](respondWithFilteredResult(_0x15b6a8,_0x204f28))[_0xcf7a('0x42')](handleError(_0x15b6a8,null));};exports[_0xcf7a('0x43')]=function(_0x13883e,_0x41032c){var _0x4b171e={'raw':![],'where':{'id':_0x13883e[_0xcf7a('0x44')]['id']}},_0x1016da={};_0x1016da['model']=_[_0xcf7a('0x45')](db['FreshdeskConfiguration']['rawAttributes']);_0x1016da[_0xcf7a('0x2f')]=_['keys'](_0x13883e[_0xcf7a('0x2f')]);_0x1016da['filters']=_['intersection'](_0x1016da[_0xcf7a('0x2e')],_0x1016da['query']);_0x4b171e[_0xcf7a('0x32')]=_['intersection'](_0x1016da['model'],qs[_0xcf7a('0x33')](_0x13883e[_0xcf7a('0x2f')]['fields']));_0x4b171e[_0xcf7a('0x32')]=_0x4b171e[_0xcf7a('0x32')][_0xcf7a('0x34')]?_0x4b171e[_0xcf7a('0x32')]:_0x1016da[_0xcf7a('0x2e')];if(_0x13883e['query'][_0xcf7a('0x3e')]){_0x4b171e['include']=[{'all':!![]}];}_0x4b171e=_[_0xcf7a('0x46')]({},_0x4b171e,_0x13883e[_0xcf7a('0x3d')]);return db[_0xcf7a('0x2a')][_0xcf7a('0x47')](_0x4b171e)[_0xcf7a('0x22')](handleEntityNotFound(_0x41032c,null))[_0xcf7a('0x22')](respondWithResult(_0x41032c,null))[_0xcf7a('0x42')](handleError(_0x41032c,null));};exports[_0xcf7a('0x48')]=function(_0x28db29,_0x5cefbe){return db[_0xcf7a('0x2a')][_0xcf7a('0x48')](_0x28db29[_0xcf7a('0x49')],{})[_0xcf7a('0x22')](respondWithResult(_0x5cefbe,0xc9))[_0xcf7a('0x42')](handleError(_0x5cefbe,null));};exports[_0xcf7a('0x21')]=function(_0x5c3092,_0x1c653f){if(_0x5c3092['body']['id']){delete _0x5c3092[_0xcf7a('0x49')]['id'];}return db['FreshdeskConfiguration'][_0xcf7a('0x47')]({'where':{'id':_0x5c3092['params']['id']}})['then'](handleEntityNotFound(_0x1c653f,null))[_0xcf7a('0x22')](saveUpdates(_0x5c3092[_0xcf7a('0x49')],null))[_0xcf7a('0x22')](respondWithResult(_0x1c653f,null))['catch'](handleError(_0x1c653f,null));};exports[_0xcf7a('0x23')]=function(_0x95e451,_0x4375a6){return db[_0xcf7a('0x2a')]['find']({'where':{'id':_0x95e451[_0xcf7a('0x44')]['id']}})['then'](handleEntityNotFound(_0x4375a6,null))[_0xcf7a('0x22')](removeEntity(_0x4375a6,null))[_0xcf7a('0x42')](handleError(_0x4375a6,null));};exports[_0xcf7a('0x4a')]=function(_0x44bbc6,_0x1067b8,_0x22129f){var _0x26e847={};var _0x14e716={};var _0x3b67fb;var _0x2c153d;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x44bbc6[_0xcf7a('0x44')]['id']}})[_0xcf7a('0x22')](handleEntityNotFound(_0x1067b8,null))['then'](function(_0x2890a4){if(_0x2890a4){_0x3b67fb=_0x2890a4;_0x14e716['model']=_[_0xcf7a('0x45')](db['FreshdeskField'][_0xcf7a('0x2b')]);_0x14e716[_0xcf7a('0x2f')]=_[_0xcf7a('0x45')](_0x44bbc6[_0xcf7a('0x2f')]);_0x14e716['filters']=_['intersection'](_0x14e716[_0xcf7a('0x2e')],_0x14e716['query']);_0x26e847[_0xcf7a('0x32')]=_[_0xcf7a('0x31')](_0x14e716[_0xcf7a('0x2e')],qs[_0xcf7a('0x33')](_0x44bbc6[_0xcf7a('0x2f')]['fields']));_0x26e847[_0xcf7a('0x32')]=_0x26e847[_0xcf7a('0x32')][_0xcf7a('0x34')]?_0x26e847['attributes']:_0x14e716[_0xcf7a('0x2e')];_0x26e847[_0xcf7a('0x36')]=qs[_0xcf7a('0x37')](_0x44bbc6[_0xcf7a('0x2f')][_0xcf7a('0x37')]);_0x26e847[_0xcf7a('0x38')]=qs[_0xcf7a('0x30')](_[_0xcf7a('0x39')](_0x44bbc6[_0xcf7a('0x2f')],_0x14e716[_0xcf7a('0x30')]));if(_0x44bbc6[_0xcf7a('0x2f')]['filter']){_0x26e847[_0xcf7a('0x38')]=_[_0xcf7a('0x46')](_0x26e847[_0xcf7a('0x38')],{'$or':_[_0xcf7a('0x29')](_0x26e847[_0xcf7a('0x32')],function(_0x5977fa){var _0x2086a8={};_0x2086a8[_0x5977fa]={'$like':'%'+_0x44bbc6[_0xcf7a('0x2f')][_0xcf7a('0x3a')]+'%'};return _0x2086a8;})});}_0x26e847=_[_0xcf7a('0x46')]({},_0x26e847,_0x44bbc6[_0xcf7a('0x3d')]);return _0x3b67fb['getFields'](_0x26e847);}})['then'](function(_0x3c85ed){if(_0x3c85ed){_0x2c153d=_0x3c85ed['length'];if(!_0x44bbc6[_0xcf7a('0x2f')]['hasOwnProperty'](_0xcf7a('0x35'))){_0x26e847[_0xcf7a('0x1c')]=qs[_0xcf7a('0x1c')](_0x44bbc6['query'][_0xcf7a('0x1c')]);_0x26e847['offset']=qs['offset'](_0x44bbc6[_0xcf7a('0x2f')]['offset']);}return _0x3b67fb['getFields'](_0x26e847);}})[_0xcf7a('0x22')](function(_0x1a98b6){if(_0x1a98b6){return _0x1a98b6?{'count':_0x2c153d,'rows':_0x1a98b6}:null;}})[_0xcf7a('0x22')](respondWithResult(_0x1067b8,null))[_0xcf7a('0x42')](handleError(_0x1067b8,null));};exports['getSubjects']=function(_0x2cafa4,_0x304ba0,_0x4f7f97){var _0x45262a={};var _0x231a4e={};var _0x28897b;var _0x4ebdce;return db[_0xcf7a('0x2a')][_0xcf7a('0x4b')]({'where':{'id':_0x2cafa4['params']['id']}})[_0xcf7a('0x22')](handleEntityNotFound(_0x304ba0,null))[_0xcf7a('0x22')](function(_0xe0bb8c){if(_0xe0bb8c){_0x28897b=_0xe0bb8c;_0x231a4e[_0xcf7a('0x2e')]=_[_0xcf7a('0x45')](db[_0xcf7a('0x4c')]['rawAttributes']);_0x231a4e[_0xcf7a('0x2f')]=_['keys'](_0x2cafa4['query']);_0x231a4e[_0xcf7a('0x30')]=_['intersection'](_0x231a4e[_0xcf7a('0x2e')],_0x231a4e[_0xcf7a('0x2f')]);_0x45262a[_0xcf7a('0x32')]=_[_0xcf7a('0x31')](_0x231a4e['model'],qs[_0xcf7a('0x33')](_0x2cafa4[_0xcf7a('0x2f')][_0xcf7a('0x33')]));_0x45262a[_0xcf7a('0x32')]=_0x45262a['attributes'][_0xcf7a('0x34')]?_0x45262a[_0xcf7a('0x32')]:_0x231a4e[_0xcf7a('0x2e')];_0x45262a['order']=qs['sort'](_0x2cafa4[_0xcf7a('0x2f')][_0xcf7a('0x37')]);_0x45262a[_0xcf7a('0x38')]=qs[_0xcf7a('0x30')](_[_0xcf7a('0x39')](_0x2cafa4[_0xcf7a('0x2f')],_0x231a4e[_0xcf7a('0x30')]));if(_0x2cafa4[_0xcf7a('0x2f')][_0xcf7a('0x3a')]){_0x45262a[_0xcf7a('0x38')]=_[_0xcf7a('0x46')](_0x45262a[_0xcf7a('0x38')],{'$or':_['map'](_0x45262a['attributes'],function(_0x2d295f){var _0x4df170={};_0x4df170[_0x2d295f]={'$like':'%'+_0x2cafa4['query']['filter']+'%'};return _0x4df170;})});}_0x45262a=_[_0xcf7a('0x46')]({},_0x45262a,_0x2cafa4[_0xcf7a('0x3d')]);return _0x28897b[_0xcf7a('0x4d')](_0x45262a);}})[_0xcf7a('0x22')](function(_0x170e4a){if(_0x170e4a){_0x4ebdce=_0x170e4a[_0xcf7a('0x34')];if(!_0x2cafa4['query'][_0xcf7a('0x4e')](_0xcf7a('0x35'))){_0x45262a[_0xcf7a('0x1c')]=qs['limit'](_0x2cafa4['query'][_0xcf7a('0x1c')]);_0x45262a[_0xcf7a('0x1a')]=qs[_0xcf7a('0x1a')](_0x2cafa4[_0xcf7a('0x2f')][_0xcf7a('0x1a')]);}return _0x28897b[_0xcf7a('0x4d')](_0x45262a);}})['then'](function(_0xf74b0c){if(_0xf74b0c){return _0xf74b0c?{'count':_0x4ebdce,'rows':_0xf74b0c}:null;}})[_0xcf7a('0x22')](respondWithResult(_0x304ba0,null))['catch'](handleError(_0x304ba0,null));};exports[_0xcf7a('0x4f')]=function(_0x3480b2,_0x3c5fb1,_0x1af9ea){var _0x49efd8={};var _0x240223={};var _0x5373c1;var _0x45795b;return db['FreshdeskConfiguration'][_0xcf7a('0x4b')]({'where':{'id':_0x3480b2[_0xcf7a('0x44')]['id']}})[_0xcf7a('0x22')](handleEntityNotFound(_0x3c5fb1,null))[_0xcf7a('0x22')](function(_0x153307){if(_0x153307){_0x5373c1=_0x153307;_0x240223['model']=_['keys'](db['FreshdeskField'][_0xcf7a('0x2b')]);_0x240223['query']=_['keys'](_0x3480b2[_0xcf7a('0x2f')]);_0x240223[_0xcf7a('0x30')]=_[_0xcf7a('0x31')](_0x240223[_0xcf7a('0x2e')],_0x240223['query']);_0x49efd8['attributes']=_[_0xcf7a('0x31')](_0x240223[_0xcf7a('0x2e')],qs['fields'](_0x3480b2[_0xcf7a('0x2f')][_0xcf7a('0x33')]));_0x49efd8['attributes']=_0x49efd8[_0xcf7a('0x32')][_0xcf7a('0x34')]?_0x49efd8[_0xcf7a('0x32')]:_0x240223['model'];_0x49efd8[_0xcf7a('0x36')]=qs[_0xcf7a('0x37')](_0x3480b2[_0xcf7a('0x2f')]['sort']);_0x49efd8[_0xcf7a('0x38')]=qs[_0xcf7a('0x30')](_[_0xcf7a('0x39')](_0x3480b2['query'],_0x240223[_0xcf7a('0x30')]));if(_0x3480b2[_0xcf7a('0x2f')][_0xcf7a('0x3a')]){_0x49efd8[_0xcf7a('0x38')]=_[_0xcf7a('0x46')](_0x49efd8[_0xcf7a('0x38')],{'$or':_[_0xcf7a('0x29')](_0x49efd8[_0xcf7a('0x32')],function(_0x263192){var _0x49d910={};_0x49d910[_0x263192]={'$like':'%'+_0x3480b2[_0xcf7a('0x2f')]['filter']+'%'};return _0x49d910;})});}_0x49efd8=_['merge']({},_0x49efd8,_0x3480b2[_0xcf7a('0x3d')]);return _0x5373c1['getDescriptions'](_0x49efd8);}})[_0xcf7a('0x22')](function(_0x29f8bf){if(_0x29f8bf){_0x45795b=_0x29f8bf[_0xcf7a('0x34')];if(!_0x3480b2[_0xcf7a('0x2f')][_0xcf7a('0x4e')](_0xcf7a('0x35'))){_0x49efd8[_0xcf7a('0x1c')]=qs[_0xcf7a('0x1c')](_0x3480b2[_0xcf7a('0x2f')][_0xcf7a('0x1c')]);_0x49efd8[_0xcf7a('0x1a')]=qs['offset'](_0x3480b2[_0xcf7a('0x2f')][_0xcf7a('0x1a')]);}return _0x5373c1[_0xcf7a('0x4f')](_0x49efd8);}})[_0xcf7a('0x22')](function(_0x4a3f91){if(_0x4a3f91){return _0x4a3f91?{'count':_0x45795b,'rows':_0x4a3f91}:null;}})[_0xcf7a('0x22')](respondWithResult(_0x3c5fb1,null))[_0xcf7a('0x42')](handleError(_0x3c5fb1,null));};exports[_0xcf7a('0x50')]=function(_0x4373ee,_0x21646c,_0x3efd90){var _0x3b0b30={};var _0x2ea018={};var _0x427dd5;var _0x503a44;return db[_0xcf7a('0x2a')][_0xcf7a('0x4b')]({'where':{'id':_0x4373ee[_0xcf7a('0x44')]['id']}})[_0xcf7a('0x22')](handleEntityNotFound(_0x21646c,null))['then'](function(_0x6cb287){if(_0x6cb287){_0x427dd5=_0x6cb287;_0x2ea018['model']=_[_0xcf7a('0x45')](db[_0xcf7a('0x51')][_0xcf7a('0x2b')]);_0x2ea018[_0xcf7a('0x2f')]=_['keys'](_0x4373ee[_0xcf7a('0x2f')]);_0x2ea018[_0xcf7a('0x30')]=_[_0xcf7a('0x31')](_0x2ea018[_0xcf7a('0x2e')],_0x2ea018[_0xcf7a('0x2f')]);_0x3b0b30[_0xcf7a('0x32')]=_[_0xcf7a('0x31')](_0x2ea018[_0xcf7a('0x2e')],qs['fields'](_0x4373ee[_0xcf7a('0x2f')][_0xcf7a('0x33')]));_0x3b0b30[_0xcf7a('0x32')]=_0x3b0b30[_0xcf7a('0x32')]['length']?_0x3b0b30[_0xcf7a('0x32')]:_0x2ea018[_0xcf7a('0x2e')];_0x3b0b30['order']=qs[_0xcf7a('0x37')](_0x4373ee['query']['sort']);_0x3b0b30[_0xcf7a('0x38')]=qs[_0xcf7a('0x30')](_[_0xcf7a('0x39')](_0x4373ee[_0xcf7a('0x2f')],_0x2ea018['filters']));if(_0x4373ee[_0xcf7a('0x2f')]['filter']){_0x3b0b30[_0xcf7a('0x38')]=_[_0xcf7a('0x46')](_0x3b0b30[_0xcf7a('0x38')],{'$or':_[_0xcf7a('0x29')](_0x3b0b30[_0xcf7a('0x32')],function(_0x3f5a04){var _0x179646={};_0x179646[_0x3f5a04]={'$like':'%'+_0x4373ee['query'][_0xcf7a('0x3a')]+'%'};return _0x179646;})});}_0x3b0b30=_[_0xcf7a('0x46')]({},_0x3b0b30,_0x4373ee[_0xcf7a('0x3d')]);return _0x427dd5['getTags'](_0x3b0b30);}})[_0xcf7a('0x22')](function(_0x36d62e){if(_0x36d62e){_0x503a44=_0x36d62e[_0xcf7a('0x34')];if(!_0x4373ee['query'][_0xcf7a('0x4e')]('nolimit')){_0x3b0b30[_0xcf7a('0x1c')]=qs['limit'](_0x4373ee['query'][_0xcf7a('0x1c')]);_0x3b0b30[_0xcf7a('0x1a')]=qs['offset'](_0x4373ee[_0xcf7a('0x2f')][_0xcf7a('0x1a')]);}return _0x427dd5[_0xcf7a('0x50')](_0x3b0b30);}})[_0xcf7a('0x22')](function(_0x28180b){if(_0x28180b){return _0x28180b?{'count':_0x503a44,'rows':_0x28180b}:null;}})[_0xcf7a('0x22')](respondWithResult(_0x21646c,null))[_0xcf7a('0x42')](handleError(_0x21646c,null));};exports[_0xcf7a('0x52')]=function(_0x40d319,_0x4868e4,_0x1c264e){if(_0x40d319[_0xcf7a('0x49')]['id']){delete _0x40d319['body']['id'];}return db[_0xcf7a('0x2a')]['findOne']({'where':{'id':_0x40d319[_0xcf7a('0x44')]['id']}})[_0xcf7a('0x22')](handleEntityNotFound(_0x4868e4,null))[_0xcf7a('0x22')](function(_0x1b3e7c){if(_0x1b3e7c){return _0x1b3e7c[_0xcf7a('0x52')](_0x40d319[_0xcf7a('0x49')][_0xcf7a('0x53')]||[]);}return null;})['then'](respondWithResult(_0x4868e4,null))['catch'](handleError(_0x4868e4,null));}; \ No newline at end of file +var _0x534c=['attributes','intersection','fields','length','query','order','sort','where','pick','filter','merge','VIRTUAL','FreshdeskConfiguration','findAll','catch','show','params','includeAll','options','create','body','find','findOne','FreshdeskField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','rawAttributes','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','fieldName','type','key','model','keys','filters'];(function(_0x56222e,_0x45b96b){var _0x344f5d=function(_0x17f8d9){while(--_0x17f8d9){_0x56222e['push'](_0x56222e['shift']());}};_0x344f5d(++_0x45b96b);}(_0x534c,0x75));var _0xc534=function(_0x1668a6,_0x5e7100){_0x1668a6=_0x1668a6-0x0;var _0x5e1da8=_0x534c[_0x1668a6];return _0x5e1da8;};'use strict';var emlformat=require(_0xc534('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc534('0x1'));var jsonpatch=require(_0xc534('0x2'));var rp=require('request-promise');var moment=require(_0xc534('0x3'));var BPromise=require(_0xc534('0x4'));var Mustache=require(_0xc534('0x5'));var util=require(_0xc534('0x6'));var path=require(_0xc534('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc534('0x8'));var fs=require('fs');var fs_extra=require(_0xc534('0x9'));var _=require(_0xc534('0xa'));var squel=require(_0xc534('0xb'));var crypto=require(_0xc534('0xc'));var jsforce=require(_0xc534('0xd'));var deskjs=require(_0xc534('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc534('0xf'));var Papa=require(_0xc534('0x10'));var Redis=require('ioredis');var authService=require(_0xc534('0x11'));var qs=require(_0xc534('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc534('0x13'));var logger=require(_0xc534('0x14'))(_0xc534('0x15'));var utils=require(_0xc534('0x16'));var config=require(_0xc534('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d83f,_0x4da616){_0x4da616=_0x4da616||0xcc;return function(_0x3930df){if(_0x3930df){return _0x1d83f[_0xc534('0x18')](_0x4da616);}return _0x1d83f['status'](_0x4da616)[_0xc534('0x19')]();};}function respondWithResult(_0x33302f,_0x33aa61){_0x33aa61=_0x33aa61||0xc8;return function(_0xd5cd0e){if(_0xd5cd0e){return _0x33302f['status'](_0x33aa61)[_0xc534('0x1a')](_0xd5cd0e);}};}function respondWithFilteredResult(_0x480b87,_0x1ae6e4){return function(_0x465134){if(_0x465134){var _0x231c90=typeof _0x1ae6e4[_0xc534('0x1b')]===_0xc534('0x1c')&&typeof _0x1ae6e4[_0xc534('0x1d')]===_0xc534('0x1c');var _0x5addc0=_0x465134[_0xc534('0x1e')];var _0x33a791=_0x231c90?0x0:_0x1ae6e4[_0xc534('0x1b')];var _0x3c2ac5=_0x231c90?_0x465134[_0xc534('0x1e')]:_0x1ae6e4['offset']+_0x1ae6e4[_0xc534('0x1d')];var _0x461379;if(_0x3c2ac5>=_0x5addc0){_0x3c2ac5=_0x5addc0;_0x461379=0xc8;}else{_0x461379=0xce;}_0x480b87[_0xc534('0x1f')](_0x461379);return _0x480b87[_0xc534('0x20')](_0xc534('0x21'),_0x33a791+'-'+_0x3c2ac5+'/'+_0x5addc0)['json'](_0x465134);}return null;};}function patchUpdates(_0x5cfc62){return function(_0x3c748a){try{jsonpatch['apply'](_0x3c748a,_0x5cfc62,!![]);}catch(_0x1c3a79){return BPromise[_0xc534('0x22')](_0x1c3a79);}return _0x3c748a[_0xc534('0x23')]();};}function saveUpdates(_0x2f0265,_0x1d1d79){return function(_0x2cceb8){if(_0x2cceb8){return _0x2cceb8[_0xc534('0x24')](_0x2f0265)[_0xc534('0x25')](function(_0x292c79){return _0x292c79;});}return null;};}function removeEntity(_0x1d10da,_0x5b1b54){return function(_0x24fc10){if(_0x24fc10){return _0x24fc10[_0xc534('0x26')]()[_0xc534('0x25')](function(){_0x1d10da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf488,_0x5a98da){return function(_0x39350a){if(!_0x39350a){_0x1bf488[_0xc534('0x18')](0x194);}return _0x39350a;};}function handleError(_0x245e15,_0x57732a){_0x57732a=_0x57732a||0x1f4;return function(_0x35c317){logger[_0xc534('0x27')](_0x35c317[_0xc534('0x28')]);if(_0x35c317[_0xc534('0x29')]){delete _0x35c317[_0xc534('0x29')];}_0x245e15[_0xc534('0x1f')](_0x57732a)['send'](_0x35c317);};}exports['index']=function(_0x38b531,_0x261a00){var _0x559648={},_0x211eec={},_0x572316={'count':0x0,'rows':[]};var _0x345da9=_[_0xc534('0x2a')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x39959f){return{'name':_0x39959f[_0xc534('0x2b')],'type':_0x39959f[_0xc534('0x2c')][_0xc534('0x2d')]};});_0x211eec[_0xc534('0x2e')]=_[_0xc534('0x2a')](_0x345da9,_0xc534('0x29'));_0x211eec['query']=_[_0xc534('0x2f')](_0x38b531['query']);_0x211eec[_0xc534('0x30')]=_['intersection'](_0x211eec[_0xc534('0x2e')],_0x211eec['query']);_0x559648[_0xc534('0x31')]=_[_0xc534('0x32')](_0x211eec[_0xc534('0x2e')],qs[_0xc534('0x33')](_0x38b531['query'][_0xc534('0x33')]));_0x559648[_0xc534('0x31')]=_0x559648[_0xc534('0x31')][_0xc534('0x34')]?_0x559648[_0xc534('0x31')]:_0x211eec[_0xc534('0x2e')];if(!_0x38b531[_0xc534('0x35')]['hasOwnProperty']('nolimit')){_0x559648[_0xc534('0x1d')]=qs[_0xc534('0x1d')](_0x38b531[_0xc534('0x35')][_0xc534('0x1d')]);_0x559648[_0xc534('0x1b')]=qs['offset'](_0x38b531[_0xc534('0x35')][_0xc534('0x1b')]);}_0x559648[_0xc534('0x36')]=qs[_0xc534('0x37')](_0x38b531['query'][_0xc534('0x37')]);_0x559648[_0xc534('0x38')]=qs[_0xc534('0x30')](_[_0xc534('0x39')](_0x38b531[_0xc534('0x35')],_0x211eec[_0xc534('0x30')]),_0x345da9);if(_0x38b531[_0xc534('0x35')][_0xc534('0x3a')]){_0x559648[_0xc534('0x38')]=_[_0xc534('0x3b')](_0x559648['where'],{'$or':_[_0xc534('0x2a')](_0x345da9,function(_0x323065){if(_0x323065[_0xc534('0x2c')]!==_0xc534('0x3c')){var _0x35c87c={};_0x35c87c[_0x323065[_0xc534('0x29')]]={'$like':'%'+_0x38b531[_0xc534('0x35')]['filter']+'%'};return _0x35c87c;}})});}_0x559648=_['merge']({},_0x559648,_0x38b531['options']);var _0x44d4cd={'where':_0x559648[_0xc534('0x38')]};return db[_0xc534('0x3d')][_0xc534('0x1e')](_0x44d4cd)[_0xc534('0x25')](function(_0x162893){_0x572316['count']=_0x162893;if(_0x38b531[_0xc534('0x35')]['includeAll']){_0x559648['include']=[{'all':!![]}];}return db[_0xc534('0x3d')][_0xc534('0x3e')](_0x559648);})[_0xc534('0x25')](function(_0xaa2dee){_0x572316['rows']=_0xaa2dee;return _0x572316;})[_0xc534('0x25')](respondWithFilteredResult(_0x261a00,_0x559648))[_0xc534('0x3f')](handleError(_0x261a00,null));};exports[_0xc534('0x40')]=function(_0xfa8f76,_0x1de31e){var _0x265903={'raw':![],'where':{'id':_0xfa8f76[_0xc534('0x41')]['id']}},_0xb48a94={};_0xb48a94[_0xc534('0x2e')]=_[_0xc534('0x2f')](db[_0xc534('0x3d')]['rawAttributes']);_0xb48a94[_0xc534('0x35')]=_['keys'](_0xfa8f76['query']);_0xb48a94[_0xc534('0x30')]=_[_0xc534('0x32')](_0xb48a94[_0xc534('0x2e')],_0xb48a94[_0xc534('0x35')]);_0x265903[_0xc534('0x31')]=_[_0xc534('0x32')](_0xb48a94['model'],qs[_0xc534('0x33')](_0xfa8f76[_0xc534('0x35')][_0xc534('0x33')]));_0x265903[_0xc534('0x31')]=_0x265903['attributes'][_0xc534('0x34')]?_0x265903['attributes']:_0xb48a94[_0xc534('0x2e')];if(_0xfa8f76[_0xc534('0x35')][_0xc534('0x42')]){_0x265903['include']=[{'all':!![]}];}_0x265903=_[_0xc534('0x3b')]({},_0x265903,_0xfa8f76[_0xc534('0x43')]);return db[_0xc534('0x3d')]['find'](_0x265903)[_0xc534('0x25')](handleEntityNotFound(_0x1de31e,null))[_0xc534('0x25')](respondWithResult(_0x1de31e,null))[_0xc534('0x3f')](handleError(_0x1de31e,null));};exports[_0xc534('0x44')]=function(_0x5edfd3,_0x54b5eb){return db['FreshdeskConfiguration']['create'](_0x5edfd3[_0xc534('0x45')],{})[_0xc534('0x25')](respondWithResult(_0x54b5eb,0xc9))[_0xc534('0x3f')](handleError(_0x54b5eb,null));};exports[_0xc534('0x24')]=function(_0x4f8bb7,_0x2a17ad){if(_0x4f8bb7[_0xc534('0x45')]['id']){delete _0x4f8bb7[_0xc534('0x45')]['id'];}return db[_0xc534('0x3d')][_0xc534('0x46')]({'where':{'id':_0x4f8bb7[_0xc534('0x41')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x2a17ad,null))['then'](saveUpdates(_0x4f8bb7['body'],null))['then'](respondWithResult(_0x2a17ad,null))['catch'](handleError(_0x2a17ad,null));};exports[_0xc534('0x26')]=function(_0x44f93a,_0x57b8f0){return db[_0xc534('0x3d')][_0xc534('0x46')]({'where':{'id':_0x44f93a[_0xc534('0x41')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x57b8f0,null))[_0xc534('0x25')](removeEntity(_0x57b8f0,null))[_0xc534('0x3f')](handleError(_0x57b8f0,null));};exports['getFields']=function(_0x59aff6,_0x33f6fe,_0x952ed){var _0x2e0f1a={};var _0x28d163={};var _0x1c99c4;var _0x1a85e3;return db[_0xc534('0x3d')][_0xc534('0x47')]({'where':{'id':_0x59aff6['params']['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x33f6fe,null))['then'](function(_0x2fe537){if(_0x2fe537){_0x1c99c4=_0x2fe537;_0x28d163[_0xc534('0x2e')]=_['keys'](db[_0xc534('0x48')]['rawAttributes']);_0x28d163[_0xc534('0x35')]=_[_0xc534('0x2f')](_0x59aff6[_0xc534('0x35')]);_0x28d163[_0xc534('0x30')]=_[_0xc534('0x32')](_0x28d163[_0xc534('0x2e')],_0x28d163['query']);_0x2e0f1a[_0xc534('0x31')]=_[_0xc534('0x32')](_0x28d163[_0xc534('0x2e')],qs[_0xc534('0x33')](_0x59aff6[_0xc534('0x35')][_0xc534('0x33')]));_0x2e0f1a[_0xc534('0x31')]=_0x2e0f1a[_0xc534('0x31')][_0xc534('0x34')]?_0x2e0f1a['attributes']:_0x28d163['model'];_0x2e0f1a[_0xc534('0x36')]=qs[_0xc534('0x37')](_0x59aff6[_0xc534('0x35')]['sort']);_0x2e0f1a[_0xc534('0x38')]=qs[_0xc534('0x30')](_[_0xc534('0x39')](_0x59aff6['query'],_0x28d163[_0xc534('0x30')]));if(_0x59aff6[_0xc534('0x35')][_0xc534('0x3a')]){_0x2e0f1a[_0xc534('0x38')]=_[_0xc534('0x3b')](_0x2e0f1a[_0xc534('0x38')],{'$or':_[_0xc534('0x2a')](_0x2e0f1a[_0xc534('0x31')],function(_0x21da60){var _0x79559c={};_0x79559c[_0x21da60]={'$like':'%'+_0x59aff6[_0xc534('0x35')][_0xc534('0x3a')]+'%'};return _0x79559c;})});}_0x2e0f1a=_[_0xc534('0x3b')]({},_0x2e0f1a,_0x59aff6[_0xc534('0x43')]);return _0x1c99c4[_0xc534('0x49')](_0x2e0f1a);}})[_0xc534('0x25')](function(_0x3d419a){if(_0x3d419a){_0x1a85e3=_0x3d419a[_0xc534('0x34')];if(!_0x59aff6[_0xc534('0x35')][_0xc534('0x4a')](_0xc534('0x4b'))){_0x2e0f1a[_0xc534('0x1d')]=qs[_0xc534('0x1d')](_0x59aff6[_0xc534('0x35')][_0xc534('0x1d')]);_0x2e0f1a['offset']=qs[_0xc534('0x1b')](_0x59aff6[_0xc534('0x35')]['offset']);}return _0x1c99c4[_0xc534('0x49')](_0x2e0f1a);}})[_0xc534('0x25')](function(_0x483387){if(_0x483387){return _0x483387?{'count':_0x1a85e3,'rows':_0x483387}:null;}})[_0xc534('0x25')](respondWithResult(_0x33f6fe,null))['catch'](handleError(_0x33f6fe,null));};exports[_0xc534('0x4c')]=function(_0x4708f3,_0x8e2132,_0x4e6ff3){var _0x455281={};var _0x1d0209={};var _0x4d3007;var _0x4a9b07;return db[_0xc534('0x3d')][_0xc534('0x47')]({'where':{'id':_0x4708f3[_0xc534('0x41')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x8e2132,null))[_0xc534('0x25')](function(_0x3c25dd){if(_0x3c25dd){_0x4d3007=_0x3c25dd;_0x1d0209[_0xc534('0x2e')]=_[_0xc534('0x2f')](db[_0xc534('0x48')]['rawAttributes']);_0x1d0209[_0xc534('0x35')]=_['keys'](_0x4708f3[_0xc534('0x35')]);_0x1d0209[_0xc534('0x30')]=_['intersection'](_0x1d0209['model'],_0x1d0209[_0xc534('0x35')]);_0x455281[_0xc534('0x31')]=_[_0xc534('0x32')](_0x1d0209[_0xc534('0x2e')],qs[_0xc534('0x33')](_0x4708f3['query'][_0xc534('0x33')]));_0x455281[_0xc534('0x31')]=_0x455281[_0xc534('0x31')][_0xc534('0x34')]?_0x455281[_0xc534('0x31')]:_0x1d0209[_0xc534('0x2e')];_0x455281[_0xc534('0x36')]=qs[_0xc534('0x37')](_0x4708f3[_0xc534('0x35')][_0xc534('0x37')]);_0x455281[_0xc534('0x38')]=qs[_0xc534('0x30')](_[_0xc534('0x39')](_0x4708f3[_0xc534('0x35')],_0x1d0209['filters']));if(_0x4708f3['query']['filter']){_0x455281[_0xc534('0x38')]=_[_0xc534('0x3b')](_0x455281['where'],{'$or':_[_0xc534('0x2a')](_0x455281[_0xc534('0x31')],function(_0x43265f){var _0x2c7133={};_0x2c7133[_0x43265f]={'$like':'%'+_0x4708f3[_0xc534('0x35')][_0xc534('0x3a')]+'%'};return _0x2c7133;})});}_0x455281=_[_0xc534('0x3b')]({},_0x455281,_0x4708f3[_0xc534('0x43')]);return _0x4d3007[_0xc534('0x4c')](_0x455281);}})[_0xc534('0x25')](function(_0x5d111d){if(_0x5d111d){_0x4a9b07=_0x5d111d['length'];if(!_0x4708f3[_0xc534('0x35')][_0xc534('0x4a')](_0xc534('0x4b'))){_0x455281[_0xc534('0x1d')]=qs[_0xc534('0x1d')](_0x4708f3[_0xc534('0x35')]['limit']);_0x455281[_0xc534('0x1b')]=qs[_0xc534('0x1b')](_0x4708f3[_0xc534('0x35')][_0xc534('0x1b')]);}return _0x4d3007[_0xc534('0x4c')](_0x455281);}})[_0xc534('0x25')](function(_0x554967){if(_0x554967){return _0x554967?{'count':_0x4a9b07,'rows':_0x554967}:null;}})[_0xc534('0x25')](respondWithResult(_0x8e2132,null))[_0xc534('0x3f')](handleError(_0x8e2132,null));};exports[_0xc534('0x4d')]=function(_0x39d09b,_0x3c6640,_0x3e0c0a){var _0x8e19d9={};var _0x213dc6={};var _0x4b430e;var _0x576a43;return db['FreshdeskConfiguration'][_0xc534('0x47')]({'where':{'id':_0x39d09b[_0xc534('0x41')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x3c6640,null))[_0xc534('0x25')](function(_0x348d91){if(_0x348d91){_0x4b430e=_0x348d91;_0x213dc6[_0xc534('0x2e')]=_[_0xc534('0x2f')](db[_0xc534('0x48')]['rawAttributes']);_0x213dc6[_0xc534('0x35')]=_[_0xc534('0x2f')](_0x39d09b[_0xc534('0x35')]);_0x213dc6[_0xc534('0x30')]=_['intersection'](_0x213dc6[_0xc534('0x2e')],_0x213dc6['query']);_0x8e19d9[_0xc534('0x31')]=_[_0xc534('0x32')](_0x213dc6[_0xc534('0x2e')],qs[_0xc534('0x33')](_0x39d09b['query'][_0xc534('0x33')]));_0x8e19d9['attributes']=_0x8e19d9[_0xc534('0x31')]['length']?_0x8e19d9[_0xc534('0x31')]:_0x213dc6['model'];_0x8e19d9[_0xc534('0x36')]=qs[_0xc534('0x37')](_0x39d09b[_0xc534('0x35')][_0xc534('0x37')]);_0x8e19d9[_0xc534('0x38')]=qs[_0xc534('0x30')](_[_0xc534('0x39')](_0x39d09b[_0xc534('0x35')],_0x213dc6['filters']));if(_0x39d09b[_0xc534('0x35')][_0xc534('0x3a')]){_0x8e19d9[_0xc534('0x38')]=_[_0xc534('0x3b')](_0x8e19d9[_0xc534('0x38')],{'$or':_[_0xc534('0x2a')](_0x8e19d9[_0xc534('0x31')],function(_0x2fc665){var _0x92ec77={};_0x92ec77[_0x2fc665]={'$like':'%'+_0x39d09b[_0xc534('0x35')]['filter']+'%'};return _0x92ec77;})});}_0x8e19d9=_[_0xc534('0x3b')]({},_0x8e19d9,_0x39d09b[_0xc534('0x43')]);return _0x4b430e[_0xc534('0x4d')](_0x8e19d9);}})[_0xc534('0x25')](function(_0x356a86){if(_0x356a86){_0x576a43=_0x356a86[_0xc534('0x34')];if(!_0x39d09b[_0xc534('0x35')][_0xc534('0x4a')](_0xc534('0x4b'))){_0x8e19d9['limit']=qs['limit'](_0x39d09b['query'][_0xc534('0x1d')]);_0x8e19d9[_0xc534('0x1b')]=qs['offset'](_0x39d09b[_0xc534('0x35')][_0xc534('0x1b')]);}return _0x4b430e[_0xc534('0x4d')](_0x8e19d9);}})['then'](function(_0x1ed1a9){if(_0x1ed1a9){return _0x1ed1a9?{'count':_0x576a43,'rows':_0x1ed1a9}:null;}})['then'](respondWithResult(_0x3c6640,null))[_0xc534('0x3f')](handleError(_0x3c6640,null));};exports[_0xc534('0x4e')]=function(_0x2cb8fd,_0x217fd2,_0x5e3166){var _0x8dfe3d={};var _0x43ed2e={};var _0x1a5e1b;var _0x4b0d2c;return db[_0xc534('0x3d')][_0xc534('0x47')]({'where':{'id':_0x2cb8fd[_0xc534('0x41')]['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x217fd2,null))[_0xc534('0x25')](function(_0xb1cc12){if(_0xb1cc12){_0x1a5e1b=_0xb1cc12;_0x43ed2e[_0xc534('0x2e')]=_['keys'](db[_0xc534('0x4f')][_0xc534('0x50')]);_0x43ed2e[_0xc534('0x35')]=_['keys'](_0x2cb8fd['query']);_0x43ed2e[_0xc534('0x30')]=_[_0xc534('0x32')](_0x43ed2e[_0xc534('0x2e')],_0x43ed2e[_0xc534('0x35')]);_0x8dfe3d[_0xc534('0x31')]=_[_0xc534('0x32')](_0x43ed2e[_0xc534('0x2e')],qs[_0xc534('0x33')](_0x2cb8fd[_0xc534('0x35')][_0xc534('0x33')]));_0x8dfe3d[_0xc534('0x31')]=_0x8dfe3d[_0xc534('0x31')][_0xc534('0x34')]?_0x8dfe3d[_0xc534('0x31')]:_0x43ed2e[_0xc534('0x2e')];_0x8dfe3d['order']=qs[_0xc534('0x37')](_0x2cb8fd[_0xc534('0x35')]['sort']);_0x8dfe3d['where']=qs['filters'](_['pick'](_0x2cb8fd[_0xc534('0x35')],_0x43ed2e[_0xc534('0x30')]));if(_0x2cb8fd['query'][_0xc534('0x3a')]){_0x8dfe3d['where']=_[_0xc534('0x3b')](_0x8dfe3d[_0xc534('0x38')],{'$or':_[_0xc534('0x2a')](_0x8dfe3d[_0xc534('0x31')],function(_0x4e0b9e){var _0x20d4a6={};_0x20d4a6[_0x4e0b9e]={'$like':'%'+_0x2cb8fd[_0xc534('0x35')]['filter']+'%'};return _0x20d4a6;})});}_0x8dfe3d=_['merge']({},_0x8dfe3d,_0x2cb8fd[_0xc534('0x43')]);return _0x1a5e1b[_0xc534('0x4e')](_0x8dfe3d);}})['then'](function(_0x347247){if(_0x347247){_0x4b0d2c=_0x347247['length'];if(!_0x2cb8fd[_0xc534('0x35')]['hasOwnProperty'](_0xc534('0x4b'))){_0x8dfe3d['limit']=qs[_0xc534('0x1d')](_0x2cb8fd[_0xc534('0x35')][_0xc534('0x1d')]);_0x8dfe3d['offset']=qs[_0xc534('0x1b')](_0x2cb8fd[_0xc534('0x35')][_0xc534('0x1b')]);}return _0x1a5e1b[_0xc534('0x4e')](_0x8dfe3d);}})[_0xc534('0x25')](function(_0x155068){if(_0x155068){return _0x155068?{'count':_0x4b0d2c,'rows':_0x155068}:null;}})[_0xc534('0x25')](respondWithResult(_0x217fd2,null))[_0xc534('0x3f')](handleError(_0x217fd2,null));};exports[_0xc534('0x51')]=function(_0x39fb4a,_0x428213,_0x268b71){if(_0x39fb4a[_0xc534('0x45')]['id']){delete _0x39fb4a['body']['id'];}return db[_0xc534('0x3d')][_0xc534('0x47')]({'where':{'id':_0x39fb4a['params']['id']}})[_0xc534('0x25')](handleEntityNotFound(_0x428213,null))[_0xc534('0x25')](function(_0x2cffae){if(_0x2cffae){return _0x2cffae[_0xc534('0x51')](_0x39fb4a['body'][_0xc534('0x52')]||[]);}return null;})[_0xc534('0x25')](respondWithResult(_0x428213,null))[_0xc534('0x3f')](handleError(_0x428213,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index f3e9ced..69bf8a7 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 _0x280c=['define','FreshdeskConfiguration','lodash','util','api','moment','request-promise','path','./intFreshdeskConfiguration.attributes','exports'];(function(_0x144fbf,_0xc74c77){var _0x48d821=function(_0x581ded){while(--_0x581ded){_0x144fbf['push'](_0x144fbf['shift']());}};_0x48d821(++_0xc74c77);}(_0x280c,0xd4));var _0xc280=function(_0x233f99,_0x1bbf4b){_0x233f99=_0x233f99-0x0;var _0x2d9344=_0x280c[_0x233f99];return _0x2d9344;};'use strict';var _=require(_0xc280('0x0'));var util=require(_0xc280('0x1'));var logger=require('../../config/logger')(_0xc280('0x2'));var moment=require(_0xc280('0x3'));var BPromise=require('bluebird');var rp=require(_0xc280('0x4'));var fs=require('fs');var path=require(_0xc280('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc280('0x6'));module[_0xc280('0x7')]=function(_0x5546a9,_0x47a987){return _0x5546a9[_0xc280('0x8')](_0xc280('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2048=['request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','api','moment'];(function(_0x20c3b8,_0x214df8){var _0x4f6c8b=function(_0x21a295){while(--_0x21a295){_0x20c3b8['push'](_0x20c3b8['shift']());}};_0x4f6c8b(++_0x214df8);}(_0x2048,0x1e7));var _0x8204=function(_0x4256c5,_0x288cee){_0x4256c5=_0x4256c5-0x0;var _0x3c8bfd=_0x2048[_0x4256c5];return _0x3c8bfd;};'use strict';var _=require(_0x8204('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8204('0x1'));var moment=require(_0x8204('0x2'));var BPromise=require('bluebird');var rp=require(_0x8204('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8204('0x4'));var attributes=require(_0x8204('0x5'));module[_0x8204('0x6')]=function(_0xbf3fcd,_0x3696a0){return _0xbf3fcd[_0x8204('0x7')](_0x8204('0x8'),attributes,{'tableName':_0x8204('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 8836d3c..d1fd410 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 _0xd915=['../../config/logger','rpc','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2f5810,_0x36dc97){var _0x4845cf=function(_0x20b46b){while(--_0x20b46b){_0x2f5810['push'](_0x2f5810['shift']());}};_0x4845cf(++_0x36dc97);}(_0xd915,0x87));var _0x5d91=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xd915[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d91('0x0'));var BPromise=require(_0x5d91('0x1'));var rs=require(_0x5d91('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d91('0x3'))['db'];var utils=require(_0x5d91('0x4'));var logger=require(_0x5d91('0x5'))(_0x5d91('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d91('0x7')][_0x5d91('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3504cb,_0x10fe91,_0xb3f70f){return new BPromise(function(_0x49a64c,_0x1c101e){return client[_0x5d91('0x9')](_0x3504cb,_0xb3f70f)['then'](function(_0x57f667){logger[_0x5d91('0xa')](_0x5d91('0xb'),_0x10fe91,'request\x20sent');logger[_0x5d91('0xc')](_0x5d91('0xd'),_0x10fe91,'request\x20sent',JSON[_0x5d91('0xe')](_0x57f667));if(_0x57f667[_0x5d91('0xf')]){if(_0x57f667[_0x5d91('0xf')][_0x5d91('0x10')]===0x1f4){logger[_0x5d91('0xf')](_0x5d91('0xb'),_0x10fe91,_0x57f667[_0x5d91('0xf')]['message']);return _0x1c101e(_0x57f667[_0x5d91('0xf')][_0x5d91('0x11')]);}logger[_0x5d91('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x10fe91,_0x57f667[_0x5d91('0xf')][_0x5d91('0x11')]);return _0x49a64c(_0x57f667[_0x5d91('0xf')][_0x5d91('0x11')]);}else{logger[_0x5d91('0xa')](_0x5d91('0xb'),_0x10fe91,_0x5d91('0x12'));_0x49a64c(_0x57f667['result'][_0x5d91('0x11')]);}})[_0x5d91('0x13')](function(_0x49acbd){logger[_0x5d91('0xf')](_0x5d91('0xb'),_0x10fe91,_0x49acbd);_0x1c101e(_0x49acbd);});});} \ No newline at end of file +var _0x6faf=['http','then','request\x20sent','debug','error','code','message','info','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3f8ce2,_0x321d49){var _0x43a68c=function(_0x377809){while(--_0x377809){_0x3f8ce2['push'](_0x3f8ce2['shift']());}};_0x43a68c(++_0x321d49);}(_0x6faf,0x16b));var _0xf6fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6faf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf6fa('0x0'));var util=require(_0xf6fa('0x1'));var moment=require(_0xf6fa('0x2'));var BPromise=require(_0xf6fa('0x3'));var rs=require(_0xf6fa('0x4'));var fs=require('fs');var Redis=require(_0xf6fa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6fa('0x6'));var logger=require(_0xf6fa('0x7'))(_0xf6fa('0x8'));var config=require(_0xf6fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf6fa('0xa')][_0xf6fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x391589,_0xb4ddd7,_0x3c6954){return new BPromise(function(_0x34afe2,_0x12501e){return client['request'](_0x391589,_0x3c6954)[_0xf6fa('0xc')](function(_0x1c8dfb){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0xb4ddd7,_0xf6fa('0xd'));logger[_0xf6fa('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xb4ddd7,_0xf6fa('0xd'),JSON['stringify'](_0x1c8dfb));if(_0x1c8dfb[_0xf6fa('0xf')]){if(_0x1c8dfb[_0xf6fa('0xf')][_0xf6fa('0x10')]===0x1f4){logger[_0xf6fa('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xb4ddd7,_0x1c8dfb['error'][_0xf6fa('0x11')]);return _0x12501e(_0x1c8dfb[_0xf6fa('0xf')][_0xf6fa('0x11')]);}logger[_0xf6fa('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xb4ddd7,_0x1c8dfb[_0xf6fa('0xf')][_0xf6fa('0x11')]);return _0x34afe2(_0x1c8dfb[_0xf6fa('0xf')][_0xf6fa('0x11')]);}else{logger[_0xf6fa('0x12')](_0xf6fa('0x13'),_0xb4ddd7,'request\x20sent');_0x34afe2(_0x1c8dfb[_0xf6fa('0x14')][_0xf6fa('0x11')]);}})[_0xf6fa('0x15')](function(_0x415de1){logger['error'](_0xf6fa('0x13'),_0xb4ddd7,_0x415de1);_0x12501e(_0x415de1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index fe6c60e..eacddea 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 _0xf91a=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x267c95,_0x5f3e92){var _0x510cf5=function(_0x5b43d9){while(--_0x5b43d9){_0x267c95['push'](_0x267c95['shift']());}};_0x510cf5(++_0x5f3e92);}(_0xf91a,0xad));var _0xaf91=function(_0x4c5aa9,_0x3ab79b){_0x4c5aa9=_0x4c5aa9-0x0;var _0x359197=_0xf91a[_0x4c5aa9];return _0x359197;};'use strict';var multer=require(_0xaf91('0x0'));var util=require(_0xaf91('0x1'));var path=require(_0xaf91('0x2'));var timeout=require(_0xaf91('0x3'));var express=require(_0xaf91('0x4'));var router=express['Router']();var fs_extra=require(_0xaf91('0x5'));var auth=require(_0xaf91('0x6'));var interaction=require(_0xaf91('0x7'));var config=require(_0xaf91('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xaf91('0x9')]('/',auth[_0xaf91('0xa')](),controller[_0xaf91('0xb')]);router[_0xaf91('0x9')](_0xaf91('0xc'),auth['isAuthenticated'](),controller[_0xaf91('0xd')]);router[_0xaf91('0xe')]('/',auth[_0xaf91('0xa')](),controller[_0xaf91('0xf')]);router[_0xaf91('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xaf91('0x11')]);router[_0xaf91('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xaf91('0x13')]);module[_0xaf91('0x14')]=router; \ No newline at end of file +var _0xbfad=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x37c24d,_0x25fc14){var _0x28fcaf=function(_0x4c5a33){while(--_0x4c5a33){_0x37c24d['push'](_0x37c24d['shift']());}};_0x28fcaf(++_0x25fc14);}(_0xbfad,0x8c));var _0xdbfa=function(_0x4a54d6,_0x3baa9f){_0x4a54d6=_0x4a54d6-0x0;var _0x113d41=_0xbfad[_0x4a54d6];return _0x113d41;};'use strict';var multer=require(_0xdbfa('0x0'));var util=require(_0xdbfa('0x1'));var path=require('path');var timeout=require(_0xdbfa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdbfa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xdbfa('0x4'));var config=require(_0xdbfa('0x5'));var controller=require('./intFreshdeskField.controller');router[_0xdbfa('0x6')]('/',auth[_0xdbfa('0x7')](),controller[_0xdbfa('0x8')]);router[_0xdbfa('0x6')](_0xdbfa('0x9'),auth[_0xdbfa('0x7')](),controller[_0xdbfa('0xa')]);router[_0xdbfa('0xb')]('/',auth[_0xdbfa('0x7')](),controller['create']);router[_0xdbfa('0xc')](_0xdbfa('0x9'),auth[_0xdbfa('0x7')](),controller[_0xdbfa('0xd')]);router['delete'](_0xdbfa('0x9'),auth['isAuthenticated'](),controller[_0xdbfa('0xe')]);module[_0xdbfa('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 2b8ce35..749e11b 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 _0xbdc6=['customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xbdc6,0xef));var _0x6bdc=function(_0x3939c1,_0xa23f4c){_0x3939c1=_0x3939c1-0x0;var _0x236819=_0xbdc6[_0x3939c1];return _0x236819;};'use strict';var Sequelize=require(_0x6bdc('0x0'));module[_0x6bdc('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6bdc('0x2'),_0x6bdc('0x3'),_0x6bdc('0x4'),'keyValue',_0x6bdc('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6bdc('0x6')]},'keyType':{'type':Sequelize[_0x6bdc('0x7')](_0x6bdc('0x2'),_0x6bdc('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x6bdc('0x6')]},'idField':{'type':Sequelize[_0x6bdc('0x6')]},'nameField':{'type':Sequelize[_0x6bdc('0x6')]},'customField':{'type':Sequelize[_0x6bdc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0e58=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0e58,0x67));var _0x80e5=function(_0x2c25c7,_0x57f2d7){_0x2c25c7=_0x2c25c7-0x0;var _0x1e51bd=_0x0e58[_0x2c25c7];return _0x1e51bd;};'use strict';var Sequelize=require(_0x80e5('0x0'));module[_0x80e5('0x1')]={'type':{'type':Sequelize[_0x80e5('0x2')](_0x80e5('0x3'),_0x80e5('0x4'),'customVariable',_0x80e5('0x5'),_0x80e5('0x6')),'defaultValue':_0x80e5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x80e5('0x7')]},'keyType':{'type':Sequelize[_0x80e5('0x2')](_0x80e5('0x3'),_0x80e5('0x4'),_0x80e5('0x8'))},'keyContent':{'type':Sequelize[_0x80e5('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x80e5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x80e5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 58536c6..1db2682 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 _0xa9e0=['nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','body','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','FreshdeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x2bbc2b,_0x31cb2e){var _0x1f7b53=function(_0x46c516){while(--_0x46c516){_0x2bbc2b['push'](_0x2bbc2b['shift']());}};_0x1f7b53(++_0x31cb2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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['FreshdeskField'][_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));}; \ No newline at end of file +var _0xbf6e=['rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','FreshdeskField','includeAll','include','rows','catch','show','keys','intersection','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x4681e8,_0x53fd8a){var _0x41b60f=function(_0x3035e6){while(--_0x3035e6){_0x4681e8['push'](_0x4681e8['shift']());}};_0x41b60f(++_0x53fd8a);}(_0xbf6e,0x149));var _0xebf6=function(_0x34ce8c,_0x526c3c){_0x34ce8c=_0x34ce8c-0x0;var _0x31bde5=_0xbf6e[_0x34ce8c];return _0x31bde5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebf6('0x0'));var jsonpatch=require(_0xebf6('0x1'));var rp=require(_0xebf6('0x2'));var moment=require(_0xebf6('0x3'));var BPromise=require(_0xebf6('0x4'));var Mustache=require(_0xebf6('0x5'));var util=require(_0xebf6('0x6'));var path=require('path');var sox=require(_0xebf6('0x7'));var csv=require(_0xebf6('0x8'));var ejs=require(_0xebf6('0x9'));var fs=require('fs');var fs_extra=require(_0xebf6('0xa'));var _=require(_0xebf6('0xb'));var squel=require(_0xebf6('0xc'));var crypto=require(_0xebf6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xebf6('0xe'));var toCsv=require(_0xebf6('0x8'));var querystring=require(_0xebf6('0xf'));var Papa=require('papaparse');var Redis=require(_0xebf6('0x10'));var authService=require(_0xebf6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebf6('0x12'));var hardwareService=require(_0xebf6('0x13'));var logger=require(_0xebf6('0x14'))(_0xebf6('0x15'));var utils=require(_0xebf6('0x16'));var config=require(_0xebf6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf6('0x18'))['db'];function respondWithStatusCode(_0xedc361,_0x4919f1){_0x4919f1=_0x4919f1||0xcc;return function(_0x332ca0){if(_0x332ca0){return _0xedc361[_0xebf6('0x19')](_0x4919f1);}return _0xedc361[_0xebf6('0x1a')](_0x4919f1)[_0xebf6('0x1b')]();};}function respondWithResult(_0x3f69e6,_0x4dbf51){_0x4dbf51=_0x4dbf51||0xc8;return function(_0x4c01f4){if(_0x4c01f4){return _0x3f69e6['status'](_0x4dbf51)[_0xebf6('0x1c')](_0x4c01f4);}};}function respondWithFilteredResult(_0x1ae2f7,_0x50d80f){return function(_0x35570e){if(_0x35570e){var _0x2c980f=typeof _0x50d80f[_0xebf6('0x1d')]===_0xebf6('0x1e')&&typeof _0x50d80f[_0xebf6('0x1f')]===_0xebf6('0x1e');var _0x219621=_0x35570e[_0xebf6('0x20')];var _0x2d3984=_0x2c980f?0x0:_0x50d80f[_0xebf6('0x1d')];var _0x55fa31=_0x2c980f?_0x35570e['count']:_0x50d80f[_0xebf6('0x1d')]+_0x50d80f[_0xebf6('0x1f')];var _0x10051e;if(_0x55fa31>=_0x219621){_0x55fa31=_0x219621;_0x10051e=0xc8;}else{_0x10051e=0xce;}_0x1ae2f7[_0xebf6('0x1a')](_0x10051e);return _0x1ae2f7[_0xebf6('0x21')](_0xebf6('0x22'),_0x2d3984+'-'+_0x55fa31+'/'+_0x219621)[_0xebf6('0x1c')](_0x35570e);}return null;};}function patchUpdates(_0x80f523){return function(_0x4fb497){try{jsonpatch[_0xebf6('0x23')](_0x4fb497,_0x80f523,!![]);}catch(_0x81fdb3){return BPromise[_0xebf6('0x24')](_0x81fdb3);}return _0x4fb497[_0xebf6('0x25')]();};}function saveUpdates(_0x6303ac,_0x14c8ac){return function(_0x2f419e){if(_0x2f419e){return _0x2f419e[_0xebf6('0x26')](_0x6303ac)[_0xebf6('0x27')](function(_0x2e32c6){return _0x2e32c6;});}return null;};}function removeEntity(_0x232074,_0x2dd2ed){return function(_0x43c4e2){if(_0x43c4e2){return _0x43c4e2[_0xebf6('0x28')]()[_0xebf6('0x27')](function(){_0x232074[_0xebf6('0x1a')](0xcc)[_0xebf6('0x1b')]();});}};}function handleEntityNotFound(_0x1534b2,_0x3b58cb){return function(_0x4dadf7){if(!_0x4dadf7){_0x1534b2['sendStatus'](0x194);}return _0x4dadf7;};}function handleError(_0x2605a2,_0x4dc5be){_0x4dc5be=_0x4dc5be||0x1f4;return function(_0x230d84){logger[_0xebf6('0x29')](_0x230d84['stack']);if(_0x230d84['name']){delete _0x230d84[_0xebf6('0x2a')];}_0x2605a2[_0xebf6('0x1a')](_0x4dc5be)[_0xebf6('0x2b')](_0x230d84);};}exports[_0xebf6('0x2c')]=function(_0xedaaeb,_0x2dc0cf){var _0x7976d={},_0x7551ce={},_0x4c3495={'count':0x0,'rows':[]};var _0x37cd67=_[_0xebf6('0x2d')](db['FreshdeskField'][_0xebf6('0x2e')],function(_0x28bbea){return{'name':_0x28bbea['fieldName'],'type':_0x28bbea[_0xebf6('0x2f')][_0xebf6('0x30')]};});_0x7551ce[_0xebf6('0x31')]=_[_0xebf6('0x2d')](_0x37cd67,_0xebf6('0x2a'));_0x7551ce[_0xebf6('0x32')]=_['keys'](_0xedaaeb[_0xebf6('0x32')]);_0x7551ce[_0xebf6('0x33')]=_['intersection'](_0x7551ce['model'],_0x7551ce[_0xebf6('0x32')]);_0x7976d[_0xebf6('0x34')]=_['intersection'](_0x7551ce[_0xebf6('0x31')],qs[_0xebf6('0x35')](_0xedaaeb['query'][_0xebf6('0x35')]));_0x7976d[_0xebf6('0x34')]=_0x7976d[_0xebf6('0x34')]['length']?_0x7976d[_0xebf6('0x34')]:_0x7551ce[_0xebf6('0x31')];if(!_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x36')]('nolimit')){_0x7976d['limit']=qs[_0xebf6('0x1f')](_0xedaaeb[_0xebf6('0x32')]['limit']);_0x7976d[_0xebf6('0x1d')]=qs[_0xebf6('0x1d')](_0xedaaeb['query'][_0xebf6('0x1d')]);}_0x7976d[_0xebf6('0x37')]=qs[_0xebf6('0x38')](_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x38')]);_0x7976d['where']=qs[_0xebf6('0x33')](_['pick'](_0xedaaeb[_0xebf6('0x32')],_0x7551ce['filters']),_0x37cd67);if(_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x39')]){_0x7976d[_0xebf6('0x3a')]=_[_0xebf6('0x3b')](_0x7976d[_0xebf6('0x3a')],{'$or':_[_0xebf6('0x2d')](_0x37cd67,function(_0x5eb1ea){if(_0x5eb1ea[_0xebf6('0x2f')]!==_0xebf6('0x3c')){var _0x3cd9a0={};_0x3cd9a0[_0x5eb1ea[_0xebf6('0x2a')]]={'$like':'%'+_0xedaaeb[_0xebf6('0x32')][_0xebf6('0x39')]+'%'};return _0x3cd9a0;}})});}_0x7976d=_['merge']({},_0x7976d,_0xedaaeb[_0xebf6('0x3d')]);var _0x2782a5={'where':_0x7976d[_0xebf6('0x3a')]};return db[_0xebf6('0x3e')][_0xebf6('0x20')](_0x2782a5)[_0xebf6('0x27')](function(_0x4887a8){_0x4c3495['count']=_0x4887a8;if(_0xedaaeb['query'][_0xebf6('0x3f')]){_0x7976d[_0xebf6('0x40')]=[{'all':!![]}];}return db[_0xebf6('0x3e')]['findAll'](_0x7976d);})[_0xebf6('0x27')](function(_0x1c3809){_0x4c3495[_0xebf6('0x41')]=_0x1c3809;return _0x4c3495;})['then'](respondWithFilteredResult(_0x2dc0cf,_0x7976d))[_0xebf6('0x42')](handleError(_0x2dc0cf,null));};exports[_0xebf6('0x43')]=function(_0x53ccc8,_0x3813a5){var _0x1de50e={'raw':!![],'where':{'id':_0x53ccc8['params']['id']}},_0x17c4af={};_0x17c4af[_0xebf6('0x31')]=_['keys'](db['FreshdeskField'][_0xebf6('0x2e')]);_0x17c4af[_0xebf6('0x32')]=_[_0xebf6('0x44')](_0x53ccc8[_0xebf6('0x32')]);_0x17c4af['filters']=_[_0xebf6('0x45')](_0x17c4af['model'],_0x17c4af[_0xebf6('0x32')]);_0x1de50e[_0xebf6('0x34')]=_[_0xebf6('0x45')](_0x17c4af[_0xebf6('0x31')],qs[_0xebf6('0x35')](_0x53ccc8['query']['fields']));_0x1de50e[_0xebf6('0x34')]=_0x1de50e[_0xebf6('0x34')][_0xebf6('0x46')]?_0x1de50e[_0xebf6('0x34')]:_0x17c4af['model'];if(_0x53ccc8[_0xebf6('0x32')][_0xebf6('0x3f')]){_0x1de50e[_0xebf6('0x40')]=[{'all':!![]}];}_0x1de50e=_[_0xebf6('0x3b')]({},_0x1de50e,_0x53ccc8[_0xebf6('0x3d')]);return db[_0xebf6('0x3e')][_0xebf6('0x47')](_0x1de50e)['then'](handleEntityNotFound(_0x3813a5,null))[_0xebf6('0x27')](respondWithResult(_0x3813a5,null))[_0xebf6('0x42')](handleError(_0x3813a5,null));};exports[_0xebf6('0x48')]=function(_0x42e3e1,_0x166664){return db[_0xebf6('0x3e')][_0xebf6('0x48')](_0x42e3e1['body'],{})[_0xebf6('0x27')](respondWithResult(_0x166664,0xc9))['catch'](handleError(_0x166664,null));};exports[_0xebf6('0x26')]=function(_0x31d8ba,_0x5d84ac){if(_0x31d8ba[_0xebf6('0x49')]['id']){delete _0x31d8ba['body']['id'];}return db[_0xebf6('0x3e')][_0xebf6('0x47')]({'where':{'id':_0x31d8ba[_0xebf6('0x4a')]['id']}})[_0xebf6('0x27')](handleEntityNotFound(_0x5d84ac,null))[_0xebf6('0x27')](saveUpdates(_0x31d8ba['body'],null))[_0xebf6('0x27')](respondWithResult(_0x5d84ac,null))[_0xebf6('0x42')](handleError(_0x5d84ac,null));};exports['destroy']=function(_0x1f98fd,_0x2765f2){return db[_0xebf6('0x3e')][_0xebf6('0x47')]({'where':{'id':_0x1f98fd[_0xebf6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2765f2,null))[_0xebf6('0x27')](removeEntity(_0x2765f2,null))[_0xebf6('0x42')](handleError(_0x2765f2,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index fdd9ba9..ebf34b2 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 _0xf0f4=['FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3ae472,_0x14d950){var _0x141927=function(_0x1085f3){while(--_0x1085f3){_0x3ae472['push'](_0x3ae472['shift']());}};_0x141927(++_0x14d950);}(_0xf0f4,0x1d3));var _0x4f0f=function(_0x33070d,_0x19a08a){_0x33070d=_0x33070d-0x0;var _0x7f8cf0=_0xf0f4[_0x33070d];return _0x7f8cf0;};'use strict';var _=require(_0x4f0f('0x0'));var util=require(_0x4f0f('0x1'));var logger=require(_0x4f0f('0x2'))(_0x4f0f('0x3'));var moment=require(_0x4f0f('0x4'));var BPromise=require(_0x4f0f('0x5'));var rp=require(_0x4f0f('0x6'));var fs=require('fs');var path=require(_0x4f0f('0x7'));var rimraf=require('rimraf');var config=require(_0x4f0f('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x21ee5d,_0x53e4b5){return _0x21ee5d['define'](_0x4f0f('0x9'),attributes,{'tableName':_0x4f0f('0xa'),'paranoid':![],'indexes':[{'name':_0x4f0f('0xb'),'fields':[_0x4f0f('0xc'),_0x4f0f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07a4=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x5f1e6f,_0x12f575){var _0x53deee=function(_0x497669){while(--_0x497669){_0x5f1e6f['push'](_0x5f1e6f['shift']());}};_0x53deee(++_0x12f575);}(_0x07a4,0x1ef));var _0x407a=function(_0x4788a1,_0x145489){_0x4788a1=_0x4788a1-0x0;var _0x43cb35=_0x07a4[_0x4788a1];return _0x43cb35;};'use strict';var _=require('lodash');var util=require(_0x407a('0x0'));var logger=require(_0x407a('0x1'))(_0x407a('0x2'));var moment=require('moment');var BPromise=require(_0x407a('0x3'));var rp=require(_0x407a('0x4'));var fs=require('fs');var path=require(_0x407a('0x5'));var rimraf=require(_0x407a('0x6'));var config=require(_0x407a('0x7'));var attributes=require(_0x407a('0x8'));module[_0x407a('0x9')]=function(_0x44cc95,_0x1551f2){return _0x44cc95[_0x407a('0xa')](_0x407a('0xb'),attributes,{'tableName':_0x407a('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x407a('0xd'),_0x407a('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index a907d58..ed27092 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 _0x1588=['client','http','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x428c90,_0x1ee132){var _0x1f2c6c=function(_0x5674c1){while(--_0x5674c1){_0x428c90['push'](_0x428c90['shift']());}};_0x1f2c6c(++_0x1ee132);}(_0x1588,0xea));var _0x8158=function(_0x3e5ecd,_0x1f8219){_0x3e5ecd=_0x3e5ecd-0x0;var _0x46ac38=_0x1588[_0x3e5ecd];return _0x46ac38;};'use strict';var _=require(_0x8158('0x0'));var util=require(_0x8158('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8158('0x2'));var db=require(_0x8158('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8158('0x4'))(_0x8158('0x5'));var config=require(_0x8158('0x6'));var jayson=require(_0x8158('0x7'));var client=jayson[_0x8158('0x8')][_0x8158('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb297d1,_0x1c9b2b,_0x151d1f){return new BPromise(function(_0x22a348,_0x33d693){return client['request'](_0xb297d1,_0x151d1f)[_0x8158('0xa')](function(_0x6b304b){logger[_0x8158('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x1c9b2b,_0x8158('0xc'));logger[_0x8158('0xd')](_0x8158('0xe'),_0x1c9b2b,'request\x20sent',JSON[_0x8158('0xf')](_0x6b304b));if(_0x6b304b[_0x8158('0x10')]){if(_0x6b304b[_0x8158('0x10')][_0x8158('0x11')]===0x1f4){logger[_0x8158('0x10')](_0x8158('0x12'),_0x1c9b2b,_0x6b304b[_0x8158('0x10')][_0x8158('0x13')]);return _0x33d693(_0x6b304b[_0x8158('0x10')][_0x8158('0x13')]);}logger['error'](_0x8158('0x12'),_0x1c9b2b,_0x6b304b[_0x8158('0x10')][_0x8158('0x13')]);return _0x22a348(_0x6b304b[_0x8158('0x10')][_0x8158('0x13')]);}else{logger['info'](_0x8158('0x12'),_0x1c9b2b,_0x8158('0xc'));_0x22a348(_0x6b304b[_0x8158('0x14')][_0x8158('0x13')]);}})[_0x8158('0x15')](function(_0x9997c0){logger['error'](_0x8158('0x12'),_0x1c9b2b,_0x9997c0);_0x33d693(_0x9997c0);});});} \ No newline at end of file +var _0x14a8=['moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x4c4aa2,_0x2de77e){var _0x59a1e5=function(_0x5487c9){while(--_0x5487c9){_0x4c4aa2['push'](_0x4c4aa2['shift']());}};_0x59a1e5(++_0x2de77e);}(_0x14a8,0x11d));var _0x814a=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x14a8[_0x376b45];return _0x2341b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x814a('0x0'));var BPromise=require('bluebird');var rs=require(_0x814a('0x1'));var fs=require('fs');var Redis=require(_0x814a('0x2'));var db=require(_0x814a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x814a('0x4'))(_0x814a('0x5'));var config=require(_0x814a('0x6'));var jayson=require(_0x814a('0x7'));var client=jayson['client'][_0x814a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bb131,_0x8d2953,_0x5d5c9f){return new BPromise(function(_0xc03c13,_0x2fbb15){return client[_0x814a('0x9')](_0x3bb131,_0x5d5c9f)['then'](function(_0x440dff){logger['info'](_0x814a('0xa'),_0x8d2953,_0x814a('0xb'));logger['debug'](_0x814a('0xc'),_0x8d2953,_0x814a('0xb'),JSON[_0x814a('0xd')](_0x440dff));if(_0x440dff[_0x814a('0xe')]){if(_0x440dff[_0x814a('0xe')][_0x814a('0xf')]===0x1f4){logger[_0x814a('0xe')](_0x814a('0xa'),_0x8d2953,_0x440dff[_0x814a('0xe')][_0x814a('0x10')]);return _0x2fbb15(_0x440dff[_0x814a('0xe')][_0x814a('0x10')]);}logger[_0x814a('0xe')](_0x814a('0xa'),_0x8d2953,_0x440dff[_0x814a('0xe')][_0x814a('0x10')]);return _0xc03c13(_0x440dff[_0x814a('0xe')][_0x814a('0x10')]);}else{logger[_0x814a('0x11')](_0x814a('0xa'),_0x8d2953,'request\x20sent');_0xc03c13(_0x440dff['result'][_0x814a('0x10')]);}})[_0x814a('0x12')](function(_0x321000){logger[_0x814a('0xe')](_0x814a('0xa'),_0x8d2953,_0x321000);_0x2fbb15(_0x321000);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index efea313..45bcd4a 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 _0x3c81=['connect-timeout','express','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','multer','util'];(function(_0x437105,_0x1f2cc2){var _0x5625b5=function(_0x93bc){while(--_0x93bc){_0x437105['push'](_0x437105['shift']());}};_0x5625b5(++_0x1f2cc2);}(_0x3c81,0x102));var _0x13c8=function(_0x843540,_0x3887da){_0x843540=_0x843540-0x0;var _0x1a5162=_0x3c81[_0x843540];return _0x1a5162;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x11')]);router['put'](_0x13c8('0x9'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);router[_0x13c8('0x13')]('/:id',auth[_0x13c8('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd87e=['post','create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','getFields'];(function(_0x32bf73,_0x724874){var _0x3325a1=function(_0x4038c3){while(--_0x4038c3){_0x32bf73['push'](_0x32bf73['shift']());}};_0x3325a1(++_0x724874);}(_0xd87e,0x1bf));var _0xed87=function(_0x4c56b6,_0x239082){_0x4c56b6=_0x4c56b6-0x0;var _0x1ee73a=_0xd87e[_0x4c56b6];return _0x1ee73a;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),controller[_0xed87('0x10')]);router[_0xed87('0xf')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0x11')]);router['put']('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0x12')]);router[_0xed87('0x13')](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index c1627cd..5d0c351 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 _0x524e=['username','remoteUri','STRING'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x524e,0x15e));var _0xe524=function(_0x5428a8,_0x400417){_0x5428a8=_0x5428a8-0x0;var _0x5dd312=_0x524e[_0x5428a8];return _0x5dd312;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe524('0x0')]},'description':{'type':Sequelize[_0xe524('0x0')]},'username':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x1')},'apiKey':{'type':Sequelize[_0xe524('0x0')]},'remoteUri':{'type':Sequelize[_0xe524('0x0')],'unique':_0xe524('0x2')},'serverUrl':{'type':Sequelize[_0xe524('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x8aad=['STRING','username','sequelize','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8aad,0x146));var _0xd8aa=function(_0x5d6661,_0x4c1954){_0x5d6661=_0x5d6661-0x0;var _0x362c06=_0x8aad[_0x5d6661];return _0x362c06;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x3')},'apiKey':{'type':Sequelize[_0xd8aa('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd8aa('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 f7e0f5d..c0d0e71 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 _0x2bb7=['catch','options','create','body','find','params','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','GET','format','/api/selector/owners','users','email','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows'];(function(_0x1bb47b,_0x54e02e){var _0x566418=function(_0x4ceb66){while(--_0x4ceb66){_0x1bb47b['push'](_0x1bb47b['shift']());}};_0x566418(++_0x54e02e);}(_0x2bb7,0x146));var _0x72bb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2bb7[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0x72bb('0x0'));var rimraf=require(_0x72bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x72bb('0x2'));var moment=require(_0x72bb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x72bb('0x4'));var util=require(_0x72bb('0x5'));var path=require(_0x72bb('0x6'));var sox=require(_0x72bb('0x7'));var csv=require(_0x72bb('0x8'));var ejs=require(_0x72bb('0x9'));var fs=require('fs');var fs_extra=require(_0x72bb('0xa'));var _=require(_0x72bb('0xb'));var squel=require('squel');var crypto=require(_0x72bb('0xc'));var jsforce=require(_0x72bb('0xd'));var deskjs=require(_0x72bb('0xe'));var toCsv=require(_0x72bb('0x8'));var querystring=require(_0x72bb('0xf'));var Papa=require(_0x72bb('0x10'));var Redis=require(_0x72bb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x72bb('0x12'));var hardwareService=require(_0x72bb('0x13'));var logger=require(_0x72bb('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72bb('0x15'))['db'];var integrations=require(_0x72bb('0x16'));function respondWithStatusCode(_0x5eb3e3,_0x500adf){_0x500adf=_0x500adf||0xcc;return function(_0x2df493){if(_0x2df493){return _0x5eb3e3[_0x72bb('0x17')](_0x500adf);}return _0x5eb3e3[_0x72bb('0x18')](_0x500adf)[_0x72bb('0x19')]();};}function respondWithResult(_0x4de008,_0x3169b4){_0x3169b4=_0x3169b4||0xc8;return function(_0x55dff2){if(_0x55dff2){return _0x4de008['status'](_0x3169b4)[_0x72bb('0x1a')](_0x55dff2);}};}function respondWithFilteredResult(_0xbadf27,_0x4be743){return function(_0x4d4c3b){if(_0x4d4c3b){var _0x1a1fd3=typeof _0x4be743[_0x72bb('0x1b')]===_0x72bb('0x1c')&&typeof _0x4be743[_0x72bb('0x1d')]==='undefined';var _0x31d2dd=_0x4d4c3b[_0x72bb('0x1e')];var _0x4131aa=_0x1a1fd3?0x0:_0x4be743['offset'];var _0x1b1858=_0x1a1fd3?_0x4d4c3b[_0x72bb('0x1e')]:_0x4be743['offset']+_0x4be743[_0x72bb('0x1d')];var _0x52a7fb;if(_0x1b1858>=_0x31d2dd){_0x1b1858=_0x31d2dd;_0x52a7fb=0xc8;}else{_0x52a7fb=0xce;}_0xbadf27[_0x72bb('0x18')](_0x52a7fb);return _0xbadf27[_0x72bb('0x1f')]('Content-Range',_0x4131aa+'-'+_0x1b1858+'/'+_0x31d2dd)[_0x72bb('0x1a')](_0x4d4c3b);}return null;};}function patchUpdates(_0x3b9447){return function(_0x305944){try{jsonpatch[_0x72bb('0x20')](_0x305944,_0x3b9447,!![]);}catch(_0x48ce6a){return BPromise[_0x72bb('0x21')](_0x48ce6a);}return _0x305944[_0x72bb('0x22')]();};}function saveUpdates(_0x595370,_0x851e5d){return function(_0x5b51d4){if(_0x5b51d4){return _0x5b51d4[_0x72bb('0x23')](_0x595370)[_0x72bb('0x24')](function(_0x3106a9){return _0x3106a9;});}return null;};}function removeEntity(_0x19b1fc,_0x5ccd82){return function(_0xca4e5e){if(_0xca4e5e){return _0xca4e5e[_0x72bb('0x25')]()[_0x72bb('0x24')](function(){_0x19b1fc[_0x72bb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb6e8b,_0x58596b){return function(_0x9a9db3){if(!_0x9a9db3){_0xeb6e8b[_0x72bb('0x17')](0x194);}return _0x9a9db3;};}function handleError(_0x3f8e1f,_0x5ab7c4){_0x5ab7c4=_0x5ab7c4||0x1f4;return function(_0x3d6c45){logger[_0x72bb('0x26')](_0x3d6c45[_0x72bb('0x27')]);if(_0x3d6c45[_0x72bb('0x28')]){delete _0x3d6c45[_0x72bb('0x28')];}_0x3f8e1f[_0x72bb('0x18')](_0x5ab7c4)[_0x72bb('0x29')](_0x3d6c45);};}exports['index']=function(_0x33e192,_0x57d54a){var _0xf57e79={},_0x55c81b={},_0x3289c3={'count':0x0,'rows':[]};var _0x1a3ab3=_[_0x72bb('0x2a')](db[_0x72bb('0x2b')][_0x72bb('0x2c')],function(_0x1900f9){return{'name':_0x1900f9['fieldName'],'type':_0x1900f9[_0x72bb('0x2d')][_0x72bb('0x2e')]};});_0x55c81b[_0x72bb('0x2f')]=_[_0x72bb('0x2a')](_0x1a3ab3,_0x72bb('0x28'));_0x55c81b[_0x72bb('0x30')]=_[_0x72bb('0x31')](_0x33e192[_0x72bb('0x30')]);_0x55c81b[_0x72bb('0x32')]=_[_0x72bb('0x33')](_0x55c81b[_0x72bb('0x2f')],_0x55c81b['query']);_0xf57e79['attributes']=_[_0x72bb('0x33')](_0x55c81b[_0x72bb('0x2f')],qs[_0x72bb('0x34')](_0x33e192[_0x72bb('0x30')][_0x72bb('0x34')]));_0xf57e79[_0x72bb('0x35')]=_0xf57e79[_0x72bb('0x35')][_0x72bb('0x36')]?_0xf57e79[_0x72bb('0x35')]:_0x55c81b[_0x72bb('0x2f')];if(!_0x33e192[_0x72bb('0x30')]['hasOwnProperty'](_0x72bb('0x37'))){_0xf57e79['limit']=qs[_0x72bb('0x1d')](_0x33e192[_0x72bb('0x30')][_0x72bb('0x1d')]);_0xf57e79[_0x72bb('0x1b')]=qs[_0x72bb('0x1b')](_0x33e192[_0x72bb('0x30')][_0x72bb('0x1b')]);}_0xf57e79[_0x72bb('0x38')]=qs[_0x72bb('0x39')](_0x33e192['query'][_0x72bb('0x39')]);_0xf57e79[_0x72bb('0x3a')]=qs[_0x72bb('0x32')](_[_0x72bb('0x3b')](_0x33e192[_0x72bb('0x30')],_0x55c81b[_0x72bb('0x32')]),_0x1a3ab3);if(_0x33e192[_0x72bb('0x30')][_0x72bb('0x3c')]){_0xf57e79[_0x72bb('0x3a')]=_['merge'](_0xf57e79[_0x72bb('0x3a')],{'$or':_[_0x72bb('0x2a')](_0x1a3ab3,function(_0x205370){if(_0x205370['type']!=='VIRTUAL'){var _0x22c05a={};_0x22c05a[_0x205370[_0x72bb('0x28')]]={'$like':'%'+_0x33e192[_0x72bb('0x30')][_0x72bb('0x3c')]+'%'};return _0x22c05a;}})});}_0xf57e79=_[_0x72bb('0x3d')]({},_0xf57e79,_0x33e192['options']);var _0x48135e={'where':_0xf57e79[_0x72bb('0x3a')]};return db[_0x72bb('0x2b')][_0x72bb('0x1e')](_0x48135e)['then'](function(_0x2a8cce){_0x3289c3[_0x72bb('0x1e')]=_0x2a8cce;if(_0x33e192[_0x72bb('0x30')][_0x72bb('0x3e')]){_0xf57e79[_0x72bb('0x3f')]=[{'all':!![]}];}return db[_0x72bb('0x2b')][_0x72bb('0x40')](_0xf57e79);})['then'](function(_0x497fef){_0x3289c3[_0x72bb('0x41')]=_0x497fef;return _0x3289c3;})[_0x72bb('0x24')](respondWithFilteredResult(_0x57d54a,_0xf57e79))[_0x72bb('0x42')](handleError(_0x57d54a,null));};exports['show']=function(_0x2df6ef,_0x52a53e){var _0x30a96d={'raw':![],'where':{'id':_0x2df6ef['params']['id']}},_0x580d58={};_0x580d58[_0x72bb('0x2f')]=_[_0x72bb('0x31')](db[_0x72bb('0x2b')][_0x72bb('0x2c')]);_0x580d58['query']=_[_0x72bb('0x31')](_0x2df6ef['query']);_0x580d58[_0x72bb('0x32')]=_[_0x72bb('0x33')](_0x580d58['model'],_0x580d58[_0x72bb('0x30')]);_0x30a96d[_0x72bb('0x35')]=_['intersection'](_0x580d58['model'],qs[_0x72bb('0x34')](_0x2df6ef['query'][_0x72bb('0x34')]));_0x30a96d['attributes']=_0x30a96d[_0x72bb('0x35')][_0x72bb('0x36')]?_0x30a96d[_0x72bb('0x35')]:_0x580d58[_0x72bb('0x2f')];if(_0x2df6ef[_0x72bb('0x30')][_0x72bb('0x3e')]){_0x30a96d[_0x72bb('0x3f')]=[{'all':!![]}];}_0x30a96d=_[_0x72bb('0x3d')]({},_0x30a96d,_0x2df6ef[_0x72bb('0x43')]);return db[_0x72bb('0x2b')]['find'](_0x30a96d)[_0x72bb('0x24')](handleEntityNotFound(_0x52a53e,null))[_0x72bb('0x24')](respondWithResult(_0x52a53e,null))['catch'](handleError(_0x52a53e,null));};exports['create']=function(_0x210ee2,_0x12b0f7){return db['FreshsalesAccount'][_0x72bb('0x44')](_0x210ee2['body'],{})[_0x72bb('0x24')](respondWithResult(_0x12b0f7,0xc9))[_0x72bb('0x42')](handleError(_0x12b0f7,null));};exports[_0x72bb('0x23')]=function(_0xaccae,_0xece37a){if(_0xaccae[_0x72bb('0x45')]['id']){delete _0xaccae[_0x72bb('0x45')]['id'];}return db['FreshsalesAccount'][_0x72bb('0x46')]({'where':{'id':_0xaccae[_0x72bb('0x47')]['id']}})[_0x72bb('0x24')](handleEntityNotFound(_0xece37a,null))['then'](saveUpdates(_0xaccae[_0x72bb('0x45')],null))[_0x72bb('0x24')](respondWithResult(_0xece37a,null))[_0x72bb('0x42')](handleError(_0xece37a,null));};exports['destroy']=function(_0x2fadf3,_0x1b55b5){return db[_0x72bb('0x2b')][_0x72bb('0x46')]({'where':{'id':_0x2fadf3['params']['id']}})[_0x72bb('0x24')](handleEntityNotFound(_0x1b55b5,null))[_0x72bb('0x24')](removeEntity(_0x1b55b5,null))[_0x72bb('0x42')](handleError(_0x1b55b5,null));};exports[_0x72bb('0x48')]=function(_0x2b1341,_0x10ccdd,_0x40048d){var _0x212f93={};var _0x351b9b={};var _0x2f256b;var _0x387158;return db[_0x72bb('0x2b')][_0x72bb('0x49')]({'where':{'id':_0x2b1341[_0x72bb('0x47')]['id']}})[_0x72bb('0x24')](handleEntityNotFound(_0x10ccdd,null))[_0x72bb('0x24')](function(_0x5c1647){if(_0x5c1647){_0x2f256b=_0x5c1647;_0x351b9b[_0x72bb('0x2f')]=_[_0x72bb('0x31')](db[_0x72bb('0x4a')]['rawAttributes']);_0x351b9b[_0x72bb('0x30')]=_['keys'](_0x2b1341[_0x72bb('0x30')]);_0x351b9b['filters']=_[_0x72bb('0x33')](_0x351b9b['model'],_0x351b9b['query']);_0x212f93['attributes']=_[_0x72bb('0x33')](_0x351b9b[_0x72bb('0x2f')],qs[_0x72bb('0x34')](_0x2b1341[_0x72bb('0x30')][_0x72bb('0x34')]));_0x212f93[_0x72bb('0x35')]=_0x212f93[_0x72bb('0x35')][_0x72bb('0x36')]?_0x212f93[_0x72bb('0x35')]:_0x351b9b[_0x72bb('0x2f')];_0x212f93[_0x72bb('0x38')]=qs[_0x72bb('0x39')](_0x2b1341['query'][_0x72bb('0x39')]);_0x212f93[_0x72bb('0x3a')]=qs['filters'](_[_0x72bb('0x3b')](_0x2b1341[_0x72bb('0x30')],_0x351b9b['filters']));if(_0x2b1341[_0x72bb('0x30')][_0x72bb('0x3c')]){_0x212f93[_0x72bb('0x3a')]=_[_0x72bb('0x3d')](_0x212f93[_0x72bb('0x3a')],{'$or':_[_0x72bb('0x2a')](_0x212f93[_0x72bb('0x35')],function(_0x56ba74){var _0x2a32a9={};_0x2a32a9[_0x56ba74]={'$like':'%'+_0x2b1341[_0x72bb('0x30')][_0x72bb('0x3c')]+'%'};return _0x2a32a9;})});}_0x212f93=_['merge']({},_0x212f93,_0x2b1341[_0x72bb('0x43')]);return _0x2f256b['getConfigurations'](_0x212f93);}})[_0x72bb('0x24')](function(_0x2dbb44){if(_0x2dbb44){_0x387158=_0x2dbb44[_0x72bb('0x36')];if(!_0x2b1341[_0x72bb('0x30')][_0x72bb('0x4b')](_0x72bb('0x37'))){_0x212f93[_0x72bb('0x1d')]=qs[_0x72bb('0x1d')](_0x2b1341[_0x72bb('0x30')][_0x72bb('0x1d')]);_0x212f93[_0x72bb('0x1b')]=qs[_0x72bb('0x1b')](_0x2b1341['query']['offset']);}return _0x2f256b[_0x72bb('0x48')](_0x212f93);}})['then'](function(_0x41d1bd){if(_0x41d1bd){return _0x41d1bd?{'count':_0x387158,'rows':_0x41d1bd}:null;}})['then'](respondWithResult(_0x10ccdd,null))['catch'](handleError(_0x10ccdd,null));};exports[_0x72bb('0x4c')]=function(_0x3d3089,_0x80ce2,_0x222a9b){if(_0x3d3089[_0x72bb('0x45')]['id']){delete _0x3d3089[_0x72bb('0x45')]['id'];}return db[_0x72bb('0x2b')]['findOne']({'where':{'id':_0x3d3089[_0x72bb('0x47')]['id']}})[_0x72bb('0x24')](handleEntityNotFound(_0x80ce2,null))[_0x72bb('0x24')](function(_0x3c9e50){if(_0x3c9e50){_0x3d3089[_0x72bb('0x45')]['AccountId']=_0x3c9e50['id'];_0x3d3089['body'][_0x72bb('0x4d')]=integrations[_0x72bb('0x4e')](_0x3d3089[_0x72bb('0x45')][_0x72bb('0x4f')],_0x3d3089['body'][_0x72bb('0x2d')]);_0x3d3089[_0x72bb('0x45')][_0x72bb('0x50')]=integrations[_0x72bb('0x51')](_0x3d3089[_0x72bb('0x45')][_0x72bb('0x4f')],_0x3d3089[_0x72bb('0x45')]['type']);return db[_0x72bb('0x4a')]['create'](_0x3d3089[_0x72bb('0x45')],{'include':[{'model':db[_0x72bb('0x52')],'as':_0x72bb('0x4d')},{'model':db['FreshsalesField'],'as':_0x72bb('0x50')}]});}return null;})[_0x72bb('0x24')](respondWithResult(_0x80ce2,null))[_0x72bb('0x42')](handleError(_0x80ce2,null));};exports[_0x72bb('0x53')]=function(_0xf1d1e4,_0x15111a,_0x2ca226){var _0x21ba24='';var _0x1a3f77='';return db[_0x72bb('0x2b')][_0x72bb('0x49')]({'where':{'id':_0xf1d1e4['params']['id']},'attributes':['id',_0x72bb('0x54'),_0x72bb('0x55'),_0x72bb('0x56')]})[_0x72bb('0x24')](handleEntityNotFound(_0x15111a,null))['then'](function(_0x2492ab){if(_0x2492ab){_0x1a3f77=_0x2492ab[_0x72bb('0x54')];_0x21ba24=_0x2492ab[_0x72bb('0x55')];var _0x56c7b2=_0x2492ab[_0x72bb('0x55')][_0x72bb('0x57')](-0x1);if(_0x56c7b2==='/'){_0x21ba24=_0x21ba24['substring'](0x0,_0x21ba24[_0x72bb('0x58')](_0x56c7b2));}return rp({'method':_0x72bb('0x59'),'uri':util[_0x72bb('0x5a')]('%s%s',_0x21ba24,_0x72bb('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x2492ab[_0x72bb('0x56')]},'json':!![]});}})[_0x72bb('0x24')](function(_0x127358){if(_0x127358){var _0x1e86be=_0x127358[_0x72bb('0x5c')];var _0x5db59=![];var _0x44e7f5=null;for(_0x44e7f5=0x0;_0x44e7f5<_0x1e86be[_0x72bb('0x36')];_0x44e7f5++){if(_0x1e86be[_0x44e7f5][_0x72bb('0x5d')]===_0x1a3f77){_0x5db59=!![];}}if(_0x5db59){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x15111a,null))[_0x72bb('0x42')](function(_0x1946c4){var _0x40cd4e=_0xf1d1e4[_0x72bb('0x30')][_0x72bb('0x5e')]?0x1f4:_0x1946c4[_0x72bb('0x5f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x72bb('0x53'),_0x40cd4e,JSON[_0x72bb('0x60')](_0x1946c4));delete _0x1946c4[_0x72bb('0x28')];if(_0x40cd4e===0x191){_0x40cd4e=0x190;}_0x15111a[_0x72bb('0x18')](_0x40cd4e)[_0x72bb('0x29')](_0xf1d1e4[_0x72bb('0x30')]['test']?{'message':_0x72bb('0x61'),'statusCode':_0x1946c4['statusCode']}:_0x1946c4);});}; \ No newline at end of file +var _0x0916=['test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','filter','merge','options','FreshsalesAccount','include','findAll','rows','catch','show','params','attributes','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','Requested\x20Resource\x20not\x20Found'];(function(_0x362719,_0x58aa5a){var _0x236baf=function(_0x4ba4e3){while(--_0x4ba4e3){_0x362719['push'](_0x362719['shift']());}};_0x236baf(++_0x58aa5a);}(_0x0916,0x195));var _0x6091=function(_0x346974,_0x58b2ae){_0x346974=_0x346974-0x0;var _0x3f21eb=_0x0916[_0x346974];return _0x3f21eb;};'use strict';var emlformat=require(_0x6091('0x0'));var rimraf=require(_0x6091('0x1'));var zipdir=require(_0x6091('0x2'));var jsonpatch=require(_0x6091('0x3'));var rp=require('request-promise');var moment=require(_0x6091('0x4'));var BPromise=require(_0x6091('0x5'));var Mustache=require('mustache');var util=require(_0x6091('0x6'));var path=require(_0x6091('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6091('0x8'));var fs=require('fs');var fs_extra=require(_0x6091('0x9'));var _=require(_0x6091('0xa'));var squel=require(_0x6091('0xb'));var crypto=require('crypto');var jsforce=require(_0x6091('0xc'));var deskjs=require(_0x6091('0xd'));var toCsv=require(_0x6091('0xe'));var querystring=require(_0x6091('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6091('0x10'));var as=require(_0x6091('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6091('0x12'))(_0x6091('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x6091('0x14'));function respondWithStatusCode(_0x45dc61,_0x20f7cd){_0x20f7cd=_0x20f7cd||0xcc;return function(_0x28c521){if(_0x28c521){return _0x45dc61[_0x6091('0x15')](_0x20f7cd);}return _0x45dc61[_0x6091('0x16')](_0x20f7cd)[_0x6091('0x17')]();};}function respondWithResult(_0x3a3b49,_0x380f63){_0x380f63=_0x380f63||0xc8;return function(_0x40d66e){if(_0x40d66e){return _0x3a3b49[_0x6091('0x16')](_0x380f63)['json'](_0x40d66e);}};}function respondWithFilteredResult(_0x140a85,_0x5d965f){return function(_0x4c0734){if(_0x4c0734){var _0xf9f4cf=typeof _0x5d965f['offset']===_0x6091('0x18')&&typeof _0x5d965f[_0x6091('0x19')]===_0x6091('0x18');var _0x49f7b6=_0x4c0734[_0x6091('0x1a')];var _0x1f980e=_0xf9f4cf?0x0:_0x5d965f[_0x6091('0x1b')];var _0x5ee005=_0xf9f4cf?_0x4c0734[_0x6091('0x1a')]:_0x5d965f[_0x6091('0x1b')]+_0x5d965f[_0x6091('0x19')];var _0x152163;if(_0x5ee005>=_0x49f7b6){_0x5ee005=_0x49f7b6;_0x152163=0xc8;}else{_0x152163=0xce;}_0x140a85[_0x6091('0x16')](_0x152163);return _0x140a85[_0x6091('0x1c')](_0x6091('0x1d'),_0x1f980e+'-'+_0x5ee005+'/'+_0x49f7b6)[_0x6091('0x1e')](_0x4c0734);}return null;};}function patchUpdates(_0x122a79){return function(_0x5e7b15){try{jsonpatch[_0x6091('0x1f')](_0x5e7b15,_0x122a79,!![]);}catch(_0x24cacd){return BPromise[_0x6091('0x20')](_0x24cacd);}return _0x5e7b15[_0x6091('0x21')]();};}function saveUpdates(_0x587a6b,_0x4505c7){return function(_0x3ba4b8){if(_0x3ba4b8){return _0x3ba4b8[_0x6091('0x22')](_0x587a6b)[_0x6091('0x23')](function(_0x32eb13){return _0x32eb13;});}return null;};}function removeEntity(_0xedb3ad,_0x39fb7b){return function(_0x4de1f2){if(_0x4de1f2){return _0x4de1f2[_0x6091('0x24')]()[_0x6091('0x23')](function(){_0xedb3ad[_0x6091('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x66be35,_0x44267f){return function(_0x170318){if(!_0x170318){_0x66be35[_0x6091('0x15')](0x194);}return _0x170318;};}function handleError(_0x208737,_0x777db3){_0x777db3=_0x777db3||0x1f4;return function(_0x2637ed){logger[_0x6091('0x25')](_0x2637ed[_0x6091('0x26')]);if(_0x2637ed[_0x6091('0x27')]){delete _0x2637ed['name'];}_0x208737['status'](_0x777db3)['send'](_0x2637ed);};}exports[_0x6091('0x28')]=function(_0x4074ee,_0x40a00b){var _0x597cf1={},_0x555ba4={},_0x24090e={'count':0x0,'rows':[]};var _0x12ff15=_['map'](db['FreshsalesAccount'][_0x6091('0x29')],function(_0x5cbf0a){return{'name':_0x5cbf0a[_0x6091('0x2a')],'type':_0x5cbf0a[_0x6091('0x2b')]['key']};});_0x555ba4[_0x6091('0x2c')]=_['map'](_0x12ff15,_0x6091('0x27'));_0x555ba4[_0x6091('0x2d')]=_[_0x6091('0x2e')](_0x4074ee[_0x6091('0x2d')]);_0x555ba4[_0x6091('0x2f')]=_[_0x6091('0x30')](_0x555ba4[_0x6091('0x2c')],_0x555ba4[_0x6091('0x2d')]);_0x597cf1['attributes']=_['intersection'](_0x555ba4['model'],qs['fields'](_0x4074ee[_0x6091('0x2d')][_0x6091('0x31')]));_0x597cf1['attributes']=_0x597cf1['attributes'][_0x6091('0x32')]?_0x597cf1['attributes']:_0x555ba4[_0x6091('0x2c')];if(!_0x4074ee[_0x6091('0x2d')][_0x6091('0x33')](_0x6091('0x34'))){_0x597cf1[_0x6091('0x19')]=qs[_0x6091('0x19')](_0x4074ee['query']['limit']);_0x597cf1[_0x6091('0x1b')]=qs['offset'](_0x4074ee[_0x6091('0x2d')][_0x6091('0x1b')]);}_0x597cf1[_0x6091('0x35')]=qs[_0x6091('0x36')](_0x4074ee['query'][_0x6091('0x36')]);_0x597cf1[_0x6091('0x37')]=qs[_0x6091('0x2f')](_[_0x6091('0x38')](_0x4074ee[_0x6091('0x2d')],_0x555ba4['filters']),_0x12ff15);if(_0x4074ee[_0x6091('0x2d')]['filter']){_0x597cf1[_0x6091('0x37')]=_['merge'](_0x597cf1[_0x6091('0x37')],{'$or':_[_0x6091('0x39')](_0x12ff15,function(_0x2f1f24){if(_0x2f1f24[_0x6091('0x2b')]!=='VIRTUAL'){var _0xc8032b={};_0xc8032b[_0x2f1f24[_0x6091('0x27')]]={'$like':'%'+_0x4074ee[_0x6091('0x2d')][_0x6091('0x3a')]+'%'};return _0xc8032b;}})});}_0x597cf1=_[_0x6091('0x3b')]({},_0x597cf1,_0x4074ee[_0x6091('0x3c')]);var _0x1c8af7={'where':_0x597cf1[_0x6091('0x37')]};return db[_0x6091('0x3d')][_0x6091('0x1a')](_0x1c8af7)[_0x6091('0x23')](function(_0x44e980){_0x24090e['count']=_0x44e980;if(_0x4074ee[_0x6091('0x2d')]['includeAll']){_0x597cf1[_0x6091('0x3e')]=[{'all':!![]}];}return db[_0x6091('0x3d')][_0x6091('0x3f')](_0x597cf1);})['then'](function(_0x638eb0){_0x24090e[_0x6091('0x40')]=_0x638eb0;return _0x24090e;})[_0x6091('0x23')](respondWithFilteredResult(_0x40a00b,_0x597cf1))[_0x6091('0x41')](handleError(_0x40a00b,null));};exports[_0x6091('0x42')]=function(_0x191d96,_0x2b2706){var _0x33fe90={'raw':![],'where':{'id':_0x191d96[_0x6091('0x43')]['id']}},_0x2bd6e1={};_0x2bd6e1['model']=_[_0x6091('0x2e')](db[_0x6091('0x3d')][_0x6091('0x29')]);_0x2bd6e1[_0x6091('0x2d')]=_['keys'](_0x191d96[_0x6091('0x2d')]);_0x2bd6e1[_0x6091('0x2f')]=_[_0x6091('0x30')](_0x2bd6e1['model'],_0x2bd6e1['query']);_0x33fe90[_0x6091('0x44')]=_[_0x6091('0x30')](_0x2bd6e1['model'],qs[_0x6091('0x31')](_0x191d96['query'][_0x6091('0x31')]));_0x33fe90[_0x6091('0x44')]=_0x33fe90['attributes'][_0x6091('0x32')]?_0x33fe90[_0x6091('0x44')]:_0x2bd6e1['model'];if(_0x191d96['query'][_0x6091('0x45')]){_0x33fe90[_0x6091('0x3e')]=[{'all':!![]}];}_0x33fe90=_[_0x6091('0x3b')]({},_0x33fe90,_0x191d96[_0x6091('0x3c')]);return db[_0x6091('0x3d')][_0x6091('0x46')](_0x33fe90)[_0x6091('0x23')](handleEntityNotFound(_0x2b2706,null))[_0x6091('0x23')](respondWithResult(_0x2b2706,null))[_0x6091('0x41')](handleError(_0x2b2706,null));};exports[_0x6091('0x47')]=function(_0x22e0e8,_0x57fed4){return db[_0x6091('0x3d')]['create'](_0x22e0e8['body'],{})['then'](respondWithResult(_0x57fed4,0xc9))['catch'](handleError(_0x57fed4,null));};exports[_0x6091('0x22')]=function(_0x394495,_0x5094e7){if(_0x394495['body']['id']){delete _0x394495[_0x6091('0x48')]['id'];}return db['FreshsalesAccount'][_0x6091('0x46')]({'where':{'id':_0x394495[_0x6091('0x43')]['id']}})[_0x6091('0x23')](handleEntityNotFound(_0x5094e7,null))['then'](saveUpdates(_0x394495[_0x6091('0x48')],null))[_0x6091('0x23')](respondWithResult(_0x5094e7,null))[_0x6091('0x41')](handleError(_0x5094e7,null));};exports['destroy']=function(_0x1e4a59,_0x1dc71b){return db[_0x6091('0x3d')][_0x6091('0x46')]({'where':{'id':_0x1e4a59['params']['id']}})[_0x6091('0x23')](handleEntityNotFound(_0x1dc71b,null))[_0x6091('0x23')](removeEntity(_0x1dc71b,null))[_0x6091('0x41')](handleError(_0x1dc71b,null));};exports[_0x6091('0x49')]=function(_0x2c0a43,_0x213f59,_0x5ad3b9){var _0x243c02={};var _0x35c321={};var _0x49c88e;var _0x4b8e08;return db[_0x6091('0x3d')][_0x6091('0x4a')]({'where':{'id':_0x2c0a43[_0x6091('0x43')]['id']}})[_0x6091('0x23')](handleEntityNotFound(_0x213f59,null))['then'](function(_0x112374){if(_0x112374){_0x49c88e=_0x112374;_0x35c321[_0x6091('0x2c')]=_[_0x6091('0x2e')](db[_0x6091('0x4b')]['rawAttributes']);_0x35c321[_0x6091('0x2d')]=_[_0x6091('0x2e')](_0x2c0a43[_0x6091('0x2d')]);_0x35c321[_0x6091('0x2f')]=_[_0x6091('0x30')](_0x35c321[_0x6091('0x2c')],_0x35c321[_0x6091('0x2d')]);_0x243c02[_0x6091('0x44')]=_[_0x6091('0x30')](_0x35c321['model'],qs['fields'](_0x2c0a43['query']['fields']));_0x243c02[_0x6091('0x44')]=_0x243c02[_0x6091('0x44')][_0x6091('0x32')]?_0x243c02[_0x6091('0x44')]:_0x35c321[_0x6091('0x2c')];_0x243c02[_0x6091('0x35')]=qs['sort'](_0x2c0a43[_0x6091('0x2d')][_0x6091('0x36')]);_0x243c02[_0x6091('0x37')]=qs[_0x6091('0x2f')](_[_0x6091('0x38')](_0x2c0a43['query'],_0x35c321[_0x6091('0x2f')]));if(_0x2c0a43['query'][_0x6091('0x3a')]){_0x243c02['where']=_['merge'](_0x243c02[_0x6091('0x37')],{'$or':_['map'](_0x243c02[_0x6091('0x44')],function(_0x1105f1){var _0x3bfef0={};_0x3bfef0[_0x1105f1]={'$like':'%'+_0x2c0a43[_0x6091('0x2d')][_0x6091('0x3a')]+'%'};return _0x3bfef0;})});}_0x243c02=_[_0x6091('0x3b')]({},_0x243c02,_0x2c0a43[_0x6091('0x3c')]);return _0x49c88e[_0x6091('0x49')](_0x243c02);}})[_0x6091('0x23')](function(_0x4018e6){if(_0x4018e6){_0x4b8e08=_0x4018e6['length'];if(!_0x2c0a43[_0x6091('0x2d')][_0x6091('0x33')](_0x6091('0x34'))){_0x243c02[_0x6091('0x19')]=qs['limit'](_0x2c0a43['query']['limit']);_0x243c02['offset']=qs[_0x6091('0x1b')](_0x2c0a43[_0x6091('0x2d')][_0x6091('0x1b')]);}return _0x49c88e[_0x6091('0x49')](_0x243c02);}})[_0x6091('0x23')](function(_0x4af7f6){if(_0x4af7f6){return _0x4af7f6?{'count':_0x4b8e08,'rows':_0x4af7f6}:null;}})[_0x6091('0x23')](respondWithResult(_0x213f59,null))[_0x6091('0x41')](handleError(_0x213f59,null));};exports[_0x6091('0x4c')]=function(_0x37183d,_0x14d81a,_0x36e22b){if(_0x37183d['body']['id']){delete _0x37183d[_0x6091('0x48')]['id'];}return db['FreshsalesAccount'][_0x6091('0x4a')]({'where':{'id':_0x37183d[_0x6091('0x43')]['id']}})['then'](handleEntityNotFound(_0x14d81a,null))['then'](function(_0x48927b){if(_0x48927b){_0x37183d[_0x6091('0x48')]['AccountId']=_0x48927b['id'];_0x37183d[_0x6091('0x48')][_0x6091('0x4d')]=integrations[_0x6091('0x4e')](_0x37183d['body']['channel'],_0x37183d['body'][_0x6091('0x2b')]);_0x37183d[_0x6091('0x48')][_0x6091('0x4f')]=integrations['getDescriptions'](_0x37183d[_0x6091('0x48')][_0x6091('0x50')],_0x37183d[_0x6091('0x48')][_0x6091('0x2b')]);return db['FreshsalesConfiguration'][_0x6091('0x47')](_0x37183d[_0x6091('0x48')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x6091('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x14d81a,null))[_0x6091('0x41')](handleError(_0x14d81a,null));};exports[_0x6091('0x52')]=function(_0x245b94,_0xf8b883,_0x1cd78d){var _0x57e54f='';var _0xb20291='';return db['FreshsalesAccount'][_0x6091('0x4a')]({'where':{'id':_0x245b94['params']['id']},'attributes':['id',_0x6091('0x53'),_0x6091('0x54'),_0x6091('0x55')]})[_0x6091('0x23')](handleEntityNotFound(_0xf8b883,null))[_0x6091('0x23')](function(_0x4fb4be){if(_0x4fb4be){_0xb20291=_0x4fb4be[_0x6091('0x53')];_0x57e54f=_0x4fb4be[_0x6091('0x54')];var _0xa5da62=_0x4fb4be[_0x6091('0x54')][_0x6091('0x56')](-0x1);if(_0xa5da62==='/'){_0x57e54f=_0x57e54f[_0x6091('0x57')](0x0,_0x57e54f[_0x6091('0x58')](_0xa5da62));}return rp({'method':_0x6091('0x59'),'uri':util[_0x6091('0x5a')](_0x6091('0x5b'),_0x57e54f,_0x6091('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x4fb4be[_0x6091('0x55')]},'json':!![]});}})[_0x6091('0x23')](function(_0x75b205){if(_0x75b205){var _0x321e45=_0x75b205[_0x6091('0x5d')];var _0x402a12=![];var _0xeb6392=null;for(_0xeb6392=0x0;_0xeb6392<_0x321e45[_0x6091('0x32')];_0xeb6392++){if(_0x321e45[_0xeb6392]['email']===_0xb20291){_0x402a12=!![];}}if(_0x402a12){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6091('0x5e')});}}})[_0x6091('0x23')](respondWithResult(_0xf8b883,null))['catch'](function(_0x45b07a){var _0x3d71e2=_0x245b94['query'][_0x6091('0x5f')]?0x1f4:_0x45b07a[_0x6091('0x60')]||0x1f4;logger[_0x6091('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3d71e2,JSON[_0x6091('0x61')](_0x45b07a));delete _0x45b07a[_0x6091('0x27')];if(_0x3d71e2===0x191){_0x3d71e2=0x190;}_0xf8b883[_0x6091('0x16')](_0x3d71e2)[_0x6091('0x62')](_0x245b94[_0x6091('0x2d')]['test']?{'message':_0x6091('0x63'),'statusCode':_0x45b07a[_0x6091('0x60')]}:_0x45b07a);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 6dffe8f..e01cc76 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 _0x1623=['path','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','api','moment','bluebird','request-promise'];(function(_0x29ffe4,_0x42f7f7){var _0x52e951=function(_0x3beb95){while(--_0x3beb95){_0x29ffe4['push'](_0x29ffe4['shift']());}};_0x52e951(++_0x42f7f7);}(_0x1623,0xab));var _0x3162=function(_0xffa95,_0x55fb22){_0xffa95=_0xffa95-0x0;var _0x423b97=_0x1623[_0xffa95];return _0x423b97;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x3162('0x7')]=function(_0x428de6,_0x53260d){return _0x428de6[_0x3162('0x8')](_0x3162('0x9'),attributes,{'tableName':_0x3162('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5464=['int_freshsales_accounts','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount'];(function(_0x10214a,_0x13e795){var _0x1a4289=function(_0x2b5203){while(--_0x2b5203){_0x10214a['push'](_0x10214a['shift']());}};_0x1a4289(++_0x13e795);}(_0x5464,0x15d));var _0x4546=function(_0x437238,_0x31415f){_0x437238=_0x437238-0x0;var _0x1326c6=_0x5464[_0x437238];return _0x1326c6;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var logger=require(_0x4546('0x2'))('api');var moment=require(_0x4546('0x3'));var BPromise=require('bluebird');var rp=require(_0x4546('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var attributes=require(_0x4546('0x7'));var integrations=require(_0x4546('0x8'));module['exports']=function(_0x57391f,_0x5c5e09){return _0x57391f[_0x4546('0x9')](_0x4546('0xa'),attributes,{'tableName':_0x4546('0xb'),'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 7b464f3..bc25c20 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 _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x122469,_0x396d06){var _0x4642aa=function(_0x233891){while(--_0x233891){_0x122469['push'](_0x122469['shift']());}};_0x4642aa(++_0x396d06);}(_0x0598,0x92));var _0x8059=function(_0x78d204,_0x37b120){_0x78d204=_0x78d204-0x0;var _0x4fb622=_0x0598[_0x78d204];return _0x4fb622;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x01d9=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where','stringify','lodash','util','moment'];(function(_0x3a9651,_0x3968c5){var _0x1b49dd=function(_0x5e07ed){while(--_0x5e07ed){_0x3a9651['push'](_0x3a9651['shift']());}};_0x1b49dd(++_0x3968c5);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')]({'raw':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x285353['options']?_0x285353['options']['where']||null:null,'attributes':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1c')]||null:null,'limit':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1d')]||null:null,'include':_0x285353['options']?_0x285353[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x285353[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1818d3){return{'model':db[_0x1818d3[_0x901d('0x20')]],'as':_0x1818d3['as'],'attributes':_0x1818d3[_0x901d('0x1c')],'include':_0x1818d3['include']?_[_0x901d('0x1f')](_0x1818d3[_0x901d('0x1e')],function(_0xbc89a5){return{'model':db[_0xbc89a5[_0x901d('0x20')]],'as':_0xbc89a5['as'],'attributes':_0xbc89a5['attributes'],'include':_0xbc89a5[_0x901d('0x1e')]?_[_0x901d('0x1f')](_0xbc89a5[_0x901d('0x1e')],function(_0x3cbe43){return{'model':db[_0x3cbe43[_0x901d('0x20')]],'as':_0x3cbe43['as'],'attributes':_0x3cbe43['attributes']};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0xc52d0f){logger[_0x901d('0xe')](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')](_0x901d('0x17'),_0x285353,JSON['stringify'](_0xc52d0f));_0x38f42b(_0xc52d0f);})[_0x901d('0x16')](function(_0x533038){logger[_0x901d('0x12')](_0x901d('0x17'),_0x533038[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x533038[_0x901d('0x14')]));});});};exports[_0x901d('0x21')]=function(_0x4137b7){var _0x115676=this;return new Promise(function(_0x530c4b,_0x336f28){return db[_0x901d('0x18')][_0x901d('0x22')]({'raw':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4137b7['options']?_0x4137b7[_0x901d('0x1a')][_0x901d('0x23')]||null:null,'attributes':_0x4137b7[_0x901d('0x1a')]?_0x4137b7['options'][_0x901d('0x1c')]||null:null,'include':_0x4137b7[_0x901d('0x1a')]?_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')]?_[_0x901d('0x1f')](_0x4137b7[_0x901d('0x1a')][_0x901d('0x1e')],function(_0x1b8d3){return{'model':db[_0x1b8d3[_0x901d('0x20')]],'as':_0x1b8d3['as'],'attributes':_0x1b8d3[_0x901d('0x1c')],'include':_0x1b8d3['include']?_['map'](_0x1b8d3[_0x901d('0x1e')],function(_0x4e66b4){return{'model':db[_0x4e66b4[_0x901d('0x20')]],'as':_0x4e66b4['as'],'attributes':_0x4e66b4[_0x901d('0x1c')],'include':_0x4e66b4['include']?_[_0x901d('0x1f')](_0x4e66b4[_0x901d('0x1e')],function(_0x2f5e22){return{'model':db[_0x2f5e22['model']],'as':_0x2f5e22['as'],'attributes':_0x2f5e22[_0x901d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x901d('0xd')](function(_0x1a1f9c){logger[_0x901d('0xe')](_0x901d('0x21'),_0x4137b7);logger[_0x901d('0x11')](_0x901d('0x21'),_0x4137b7,JSON[_0x901d('0x24')](_0x1a1f9c));_0x530c4b(_0x1a1f9c);})[_0x901d('0x16')](function(_0x384d82){logger[_0x901d('0x12')](_0x901d('0x21'),_0x384d82[_0x901d('0x14')],_0x4137b7);_0x336f28(_0x115676[_0x901d('0x12')](0x1f4,_0x384d82[_0x901d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 447a05c..47cf24e 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 _0xa9aa=['index','get','/:id','isAuthenticated','show','getSubjects','getDescriptions','/:id/fields','getFields','create','put','update','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x148ca6,_0x2057df){var _0x248276=function(_0xc1dd0){while(--_0xc1dd0){_0x148ca6['push'](_0x148ca6['shift']());}};_0x248276(++_0x2057df);}(_0xa9aa,0xcb));var _0xaa9a=function(_0x41ccf3,_0x4dcb8d){_0x41ccf3=_0x41ccf3-0x0;var _0x2d0de4=_0xa9aa[_0x41ccf3];return _0x2d0de4;};'use strict';var multer=require('multer');var util=require(_0xaa9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaa9a('0x1')]();var fs_extra=require(_0xaa9a('0x2'));var auth=require(_0xaa9a('0x3'));var interaction=require(_0xaa9a('0x4'));var config=require(_0xaa9a('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaa9a('0x6')]);router[_0xaa9a('0x7')](_0xaa9a('0x8'),auth[_0xaa9a('0x9')](),controller[_0xaa9a('0xa')]);router['get']('/:id/subjects',auth[_0xaa9a('0x9')](),controller[_0xaa9a('0xb')]);router[_0xaa9a('0x7')]('/:id/descriptions',auth[_0xaa9a('0x9')](),controller[_0xaa9a('0xc')]);router[_0xaa9a('0x7')](_0xaa9a('0xd'),auth[_0xaa9a('0x9')](),controller[_0xaa9a('0xe')]);router['post']('/',auth[_0xaa9a('0x9')](),controller[_0xaa9a('0xf')]);router[_0xaa9a('0x10')](_0xaa9a('0x8'),auth[_0xaa9a('0x9')](),controller[_0xaa9a('0x11')]);router['delete'](_0xaa9a('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa9a('0x12')]=router; \ No newline at end of file +var _0xec9e=['getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects'];(function(_0x4fe75f,_0x1054b9){var _0xeedd8f=function(_0x4e4fce){while(--_0x4e4fce){_0x4fe75f['push'](_0x4fe75f['shift']());}};_0xeedd8f(++_0x1054b9);}(_0xec9e,0x19b));var _0xeec9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec9e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xeec9('0x0'));var util=require(_0xeec9('0x1'));var path=require('path');var timeout=require(_0xeec9('0x2'));var express=require(_0xeec9('0x3'));var router=express['Router']();var fs_extra=require(_0xeec9('0x4'));var auth=require(_0xeec9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeec9('0x6'));var controller=require(_0xeec9('0x7'));router[_0xeec9('0x8')]('/',auth[_0xeec9('0x9')](),controller[_0xeec9('0xa')]);router[_0xeec9('0x8')](_0xeec9('0xb'),auth['isAuthenticated'](),controller[_0xeec9('0xc')]);router[_0xeec9('0x8')](_0xeec9('0xd'),auth[_0xeec9('0x9')](),controller[_0xeec9('0xe')]);router[_0xeec9('0x8')](_0xeec9('0xf'),auth[_0xeec9('0x9')](),controller[_0xeec9('0x10')]);router[_0xeec9('0x8')](_0xeec9('0x11'),auth[_0xeec9('0x9')](),controller[_0xeec9('0x12')]);router[_0xeec9('0x13')]('/',auth[_0xeec9('0x9')](),controller[_0xeec9('0x14')]);router[_0xeec9('0x15')](_0xeec9('0xb'),auth[_0xeec9('0x9')](),controller[_0xeec9('0x16')]);router['delete']('/:id',auth[_0xeec9('0x9')](),controller[_0xeec9('0x17')]);module[_0xeec9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 39fb801..09e40eb 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 _0x75c7=['sequelize','exports','STRING'];(function(_0x1de38b,_0x185f13){var _0x4da732=function(_0x449925){while(--_0x449925){_0x1de38b['push'](_0x1de38b['shift']());}};_0x4da732(++_0x185f13);}(_0x75c7,0x1a1));var _0x775c=function(_0x65c465,_0x1f2ac0){_0x65c465=_0x65c465-0x0;var _0x5490e6=_0x75c7[_0x65c465];return _0x5490e6;};'use strict';var Sequelize=require(_0x775c('0x0'));module[_0x775c('0x1')]={'name':{'type':Sequelize[_0x775c('0x2')]},'description':{'type':Sequelize[_0x775c('0x2')]}}; \ No newline at end of file +var _0x466c=['STRING','sequelize','exports'];(function(_0xb975db,_0x2d93ad){var _0x245a1f=function(_0x16743d){while(--_0x16743d){_0xb975db['push'](_0xb975db['shift']());}};_0x245a1f(++_0x2d93ad);}(_0x466c,0xeb));var _0xc466=function(_0x5bd938,_0x1f02f2){_0x5bd938=_0x5bd938-0x0;var _0x283b61=_0x466c[_0x5bd938];return _0x283b61;};'use strict';var Sequelize=require(_0xc466('0x0'));module[_0xc466('0x1')]={'name':{'type':Sequelize[_0xc466('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 1b374ec..feba07c 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 _0xbd19=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','FreshsalesConfiguration','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','update','find','getSubjects','findOne','FreshsalesField','getDescriptions','getFields'];(function(_0x449c07,_0x450bdb){var _0x7b2db3=function(_0x5d1332){while(--_0x5d1332){_0x449c07['push'](_0x449c07['shift']());}};_0x7b2db3(++_0x450bdb);}(_0xbd19,0x13c));var _0x9bd1=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xbd19[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x9bd1('0x0'));var rimraf=require(_0x9bd1('0x1'));var zipdir=require(_0x9bd1('0x2'));var jsonpatch=require(_0x9bd1('0x3'));var rp=require(_0x9bd1('0x4'));var moment=require(_0x9bd1('0x5'));var BPromise=require(_0x9bd1('0x6'));var Mustache=require(_0x9bd1('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9bd1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9bd1('0x9'));var _=require(_0x9bd1('0xa'));var squel=require(_0x9bd1('0xb'));var crypto=require(_0x9bd1('0xc'));var jsforce=require(_0x9bd1('0xd'));var deskjs=require(_0x9bd1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9bd1('0xf'));var Papa=require(_0x9bd1('0x10'));var Redis=require('ioredis');var authService=require(_0x9bd1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9bd1('0x12'));var hardwareService=require(_0x9bd1('0x13'));var logger=require(_0x9bd1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9bd1('0x15'));var licenseUtil=require(_0x9bd1('0x16'));var db=require(_0x9bd1('0x17'))['db'];function respondWithStatusCode(_0x521cd9,_0x38125b){_0x38125b=_0x38125b||0xcc;return function(_0x4da8e2){if(_0x4da8e2){return _0x521cd9[_0x9bd1('0x18')](_0x38125b);}return _0x521cd9[_0x9bd1('0x19')](_0x38125b)[_0x9bd1('0x1a')]();};}function respondWithResult(_0x534668,_0x544ed9){_0x544ed9=_0x544ed9||0xc8;return function(_0x24e0da){if(_0x24e0da){return _0x534668[_0x9bd1('0x19')](_0x544ed9)[_0x9bd1('0x1b')](_0x24e0da);}};}function respondWithFilteredResult(_0x14aa86,_0x408ff7){return function(_0x5f5c29){if(_0x5f5c29){var _0x4bc4cc=typeof _0x408ff7['offset']===_0x9bd1('0x1c')&&typeof _0x408ff7[_0x9bd1('0x1d')]===_0x9bd1('0x1c');var _0x14db4d=_0x5f5c29[_0x9bd1('0x1e')];var _0x100102=_0x4bc4cc?0x0:_0x408ff7[_0x9bd1('0x1f')];var _0xa021be=_0x4bc4cc?_0x5f5c29[_0x9bd1('0x1e')]:_0x408ff7[_0x9bd1('0x1f')]+_0x408ff7[_0x9bd1('0x1d')];var _0x1f407e;if(_0xa021be>=_0x14db4d){_0xa021be=_0x14db4d;_0x1f407e=0xc8;}else{_0x1f407e=0xce;}_0x14aa86[_0x9bd1('0x19')](_0x1f407e);return _0x14aa86[_0x9bd1('0x20')](_0x9bd1('0x21'),_0x100102+'-'+_0xa021be+'/'+_0x14db4d)['json'](_0x5f5c29);}return null;};}function patchUpdates(_0x217a96){return function(_0x141370){try{jsonpatch[_0x9bd1('0x22')](_0x141370,_0x217a96,!![]);}catch(_0x25fc79){return BPromise[_0x9bd1('0x23')](_0x25fc79);}return _0x141370[_0x9bd1('0x24')]();};}function saveUpdates(_0x43f533,_0x59ea1c){return function(_0x51d0ff){if(_0x51d0ff){return _0x51d0ff['update'](_0x43f533)[_0x9bd1('0x25')](function(_0xed62fb){return _0xed62fb;});}return null;};}function removeEntity(_0x551622,_0x2c88a7){return function(_0x5d1674){if(_0x5d1674){return _0x5d1674[_0x9bd1('0x26')]()[_0x9bd1('0x25')](function(){_0x551622[_0x9bd1('0x19')](0xcc)[_0x9bd1('0x1a')]();});}};}function handleEntityNotFound(_0x23b3e7,_0x15c9f7){return function(_0x505be5){if(!_0x505be5){_0x23b3e7[_0x9bd1('0x18')](0x194);}return _0x505be5;};}function handleError(_0x22fd28,_0x55d56d){_0x55d56d=_0x55d56d||0x1f4;return function(_0x2be9a1){logger[_0x9bd1('0x27')](_0x2be9a1['stack']);if(_0x2be9a1[_0x9bd1('0x28')]){delete _0x2be9a1[_0x9bd1('0x28')];}_0x22fd28[_0x9bd1('0x19')](_0x55d56d)[_0x9bd1('0x29')](_0x2be9a1);};}exports['index']=function(_0x147b42,_0x581011){var _0x47d29f={},_0x1288e1={},_0x43a922={'count':0x0,'rows':[]};var _0x414713=_[_0x9bd1('0x2a')](db[_0x9bd1('0x2b')]['rawAttributes'],function(_0x102438){return{'name':_0x102438[_0x9bd1('0x2c')],'type':_0x102438[_0x9bd1('0x2d')]['key']};});_0x1288e1[_0x9bd1('0x2e')]=_[_0x9bd1('0x2a')](_0x414713,_0x9bd1('0x28'));_0x1288e1[_0x9bd1('0x2f')]=_[_0x9bd1('0x30')](_0x147b42[_0x9bd1('0x2f')]);_0x1288e1[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x1288e1[_0x9bd1('0x2e')],_0x1288e1['query']);_0x47d29f['attributes']=_[_0x9bd1('0x32')](_0x1288e1['model'],qs[_0x9bd1('0x33')](_0x147b42['query'][_0x9bd1('0x33')]));_0x47d29f['attributes']=_0x47d29f[_0x9bd1('0x34')][_0x9bd1('0x35')]?_0x47d29f[_0x9bd1('0x34')]:_0x1288e1['model'];if(!_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x36')](_0x9bd1('0x37'))){_0x47d29f['limit']=qs[_0x9bd1('0x1d')](_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x1d')]);_0x47d29f[_0x9bd1('0x1f')]=qs[_0x9bd1('0x1f')](_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x1f')]);}_0x47d29f[_0x9bd1('0x38')]=qs[_0x9bd1('0x39')](_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x39')]);_0x47d29f[_0x9bd1('0x3a')]=qs[_0x9bd1('0x31')](_[_0x9bd1('0x3b')](_0x147b42['query'],_0x1288e1[_0x9bd1('0x31')]),_0x414713);if(_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x3c')]){_0x47d29f[_0x9bd1('0x3a')]=_[_0x9bd1('0x3d')](_0x47d29f[_0x9bd1('0x3a')],{'$or':_[_0x9bd1('0x2a')](_0x414713,function(_0x495bd3){if(_0x495bd3[_0x9bd1('0x2d')]!==_0x9bd1('0x3e')){var _0x581451={};_0x581451[_0x495bd3['name']]={'$like':'%'+_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x3c')]+'%'};return _0x581451;}})});}_0x47d29f=_['merge']({},_0x47d29f,_0x147b42[_0x9bd1('0x3f')]);var _0x48ddf3={'where':_0x47d29f[_0x9bd1('0x3a')]};return db['FreshsalesConfiguration'][_0x9bd1('0x1e')](_0x48ddf3)[_0x9bd1('0x25')](function(_0x5dee8d){_0x43a922['count']=_0x5dee8d;if(_0x147b42[_0x9bd1('0x2f')][_0x9bd1('0x40')]){_0x47d29f[_0x9bd1('0x41')]=[{'all':!![]}];}return db[_0x9bd1('0x2b')][_0x9bd1('0x42')](_0x47d29f);})['then'](function(_0x24c786){_0x43a922['rows']=_0x24c786;return _0x43a922;})['then'](respondWithFilteredResult(_0x581011,_0x47d29f))[_0x9bd1('0x43')](handleError(_0x581011,null));};exports[_0x9bd1('0x44')]=function(_0x3472db,_0x1e30fd){var _0x2b40db={'raw':![],'where':{'id':_0x3472db[_0x9bd1('0x45')]['id']}},_0x319b11={};_0x319b11[_0x9bd1('0x2e')]=_[_0x9bd1('0x30')](db['FreshsalesConfiguration']['rawAttributes']);_0x319b11['query']=_[_0x9bd1('0x30')](_0x3472db[_0x9bd1('0x2f')]);_0x319b11[_0x9bd1('0x31')]=_['intersection'](_0x319b11[_0x9bd1('0x2e')],_0x319b11[_0x9bd1('0x2f')]);_0x2b40db[_0x9bd1('0x34')]=_['intersection'](_0x319b11[_0x9bd1('0x2e')],qs[_0x9bd1('0x33')](_0x3472db['query'][_0x9bd1('0x33')]));_0x2b40db[_0x9bd1('0x34')]=_0x2b40db[_0x9bd1('0x34')][_0x9bd1('0x35')]?_0x2b40db[_0x9bd1('0x34')]:_0x319b11[_0x9bd1('0x2e')];if(_0x3472db[_0x9bd1('0x2f')][_0x9bd1('0x40')]){_0x2b40db[_0x9bd1('0x41')]=[{'all':!![]}];}_0x2b40db=_[_0x9bd1('0x3d')]({},_0x2b40db,_0x3472db[_0x9bd1('0x3f')]);return db[_0x9bd1('0x2b')]['find'](_0x2b40db)['then'](handleEntityNotFound(_0x1e30fd,null))[_0x9bd1('0x25')](respondWithResult(_0x1e30fd,null))[_0x9bd1('0x43')](handleError(_0x1e30fd,null));};exports[_0x9bd1('0x46')]=function(_0x5488ec,_0x53d0f6){return db[_0x9bd1('0x2b')]['create'](_0x5488ec[_0x9bd1('0x47')],{})['then'](respondWithResult(_0x53d0f6,0xc9))[_0x9bd1('0x43')](handleError(_0x53d0f6,null));};exports[_0x9bd1('0x48')]=function(_0x535853,_0x1f3e47){if(_0x535853[_0x9bd1('0x47')]['id']){delete _0x535853[_0x9bd1('0x47')]['id'];}return db[_0x9bd1('0x2b')]['find']({'where':{'id':_0x535853['params']['id']}})[_0x9bd1('0x25')](handleEntityNotFound(_0x1f3e47,null))[_0x9bd1('0x25')](saveUpdates(_0x535853[_0x9bd1('0x47')],null))[_0x9bd1('0x25')](respondWithResult(_0x1f3e47,null))[_0x9bd1('0x43')](handleError(_0x1f3e47,null));};exports['destroy']=function(_0x2fff90,_0x2dcaf2){return db['FreshsalesConfiguration'][_0x9bd1('0x49')]({'where':{'id':_0x2fff90['params']['id']}})['then'](handleEntityNotFound(_0x2dcaf2,null))[_0x9bd1('0x25')](removeEntity(_0x2dcaf2,null))[_0x9bd1('0x43')](handleError(_0x2dcaf2,null));};exports[_0x9bd1('0x4a')]=function(_0x5998d6,_0x58c436,_0x561c6b){var _0x3c04f2={};var _0x5575c8={};var _0x29f470;var _0x5174ea;return db[_0x9bd1('0x2b')][_0x9bd1('0x4b')]({'where':{'id':_0x5998d6[_0x9bd1('0x45')]['id']}})[_0x9bd1('0x25')](handleEntityNotFound(_0x58c436,null))[_0x9bd1('0x25')](function(_0x534f70){if(_0x534f70){_0x29f470=_0x534f70;_0x5575c8['model']=_[_0x9bd1('0x30')](db[_0x9bd1('0x4c')]['rawAttributes']);_0x5575c8[_0x9bd1('0x2f')]=_[_0x9bd1('0x30')](_0x5998d6[_0x9bd1('0x2f')]);_0x5575c8[_0x9bd1('0x31')]=_[_0x9bd1('0x32')](_0x5575c8[_0x9bd1('0x2e')],_0x5575c8[_0x9bd1('0x2f')]);_0x3c04f2['attributes']=_[_0x9bd1('0x32')](_0x5575c8[_0x9bd1('0x2e')],qs[_0x9bd1('0x33')](_0x5998d6[_0x9bd1('0x2f')][_0x9bd1('0x33')]));_0x3c04f2[_0x9bd1('0x34')]=_0x3c04f2['attributes'][_0x9bd1('0x35')]?_0x3c04f2[_0x9bd1('0x34')]:_0x5575c8[_0x9bd1('0x2e')];_0x3c04f2['order']=qs['sort'](_0x5998d6[_0x9bd1('0x2f')]['sort']);_0x3c04f2[_0x9bd1('0x3a')]=qs[_0x9bd1('0x31')](_[_0x9bd1('0x3b')](_0x5998d6['query'],_0x5575c8[_0x9bd1('0x31')]));if(_0x5998d6['query'][_0x9bd1('0x3c')]){_0x3c04f2['where']=_['merge'](_0x3c04f2[_0x9bd1('0x3a')],{'$or':_['map'](_0x3c04f2[_0x9bd1('0x34')],function(_0x2430df){var _0x95d7be={};_0x95d7be[_0x2430df]={'$like':'%'+_0x5998d6[_0x9bd1('0x2f')][_0x9bd1('0x3c')]+'%'};return _0x95d7be;})});}_0x3c04f2=_[_0x9bd1('0x3d')]({},_0x3c04f2,_0x5998d6['options']);return _0x29f470[_0x9bd1('0x4a')](_0x3c04f2);}})[_0x9bd1('0x25')](function(_0x2c943e){if(_0x2c943e){_0x5174ea=_0x2c943e['length'];if(!_0x5998d6[_0x9bd1('0x2f')][_0x9bd1('0x36')](_0x9bd1('0x37'))){_0x3c04f2[_0x9bd1('0x1d')]=qs[_0x9bd1('0x1d')](_0x5998d6['query'][_0x9bd1('0x1d')]);_0x3c04f2['offset']=qs[_0x9bd1('0x1f')](_0x5998d6[_0x9bd1('0x2f')][_0x9bd1('0x1f')]);}return _0x29f470['getSubjects'](_0x3c04f2);}})[_0x9bd1('0x25')](function(_0x38d397){if(_0x38d397){return _0x38d397?{'count':_0x5174ea,'rows':_0x38d397}:null;}})['then'](respondWithResult(_0x58c436,null))['catch'](handleError(_0x58c436,null));};exports[_0x9bd1('0x4d')]=function(_0x577527,_0x14cbb2,_0x34dd1a){var _0x2ebd0b={};var _0x1dff0a={};var _0x2c293a;var _0x47e2d0;return db[_0x9bd1('0x2b')]['findOne']({'where':{'id':_0x577527[_0x9bd1('0x45')]['id']}})[_0x9bd1('0x25')](handleEntityNotFound(_0x14cbb2,null))[_0x9bd1('0x25')](function(_0x43cddd){if(_0x43cddd){_0x2c293a=_0x43cddd;_0x1dff0a[_0x9bd1('0x2e')]=_[_0x9bd1('0x30')](db[_0x9bd1('0x4c')]['rawAttributes']);_0x1dff0a['query']=_[_0x9bd1('0x30')](_0x577527['query']);_0x1dff0a['filters']=_['intersection'](_0x1dff0a[_0x9bd1('0x2e')],_0x1dff0a[_0x9bd1('0x2f')]);_0x2ebd0b[_0x9bd1('0x34')]=_[_0x9bd1('0x32')](_0x1dff0a[_0x9bd1('0x2e')],qs[_0x9bd1('0x33')](_0x577527['query'][_0x9bd1('0x33')]));_0x2ebd0b[_0x9bd1('0x34')]=_0x2ebd0b[_0x9bd1('0x34')][_0x9bd1('0x35')]?_0x2ebd0b[_0x9bd1('0x34')]:_0x1dff0a[_0x9bd1('0x2e')];_0x2ebd0b[_0x9bd1('0x38')]=qs['sort'](_0x577527[_0x9bd1('0x2f')]['sort']);_0x2ebd0b['where']=qs[_0x9bd1('0x31')](_[_0x9bd1('0x3b')](_0x577527[_0x9bd1('0x2f')],_0x1dff0a[_0x9bd1('0x31')]));if(_0x577527[_0x9bd1('0x2f')]['filter']){_0x2ebd0b[_0x9bd1('0x3a')]=_['merge'](_0x2ebd0b['where'],{'$or':_['map'](_0x2ebd0b[_0x9bd1('0x34')],function(_0x2f15d7){var _0x5bb42e={};_0x5bb42e[_0x2f15d7]={'$like':'%'+_0x577527['query']['filter']+'%'};return _0x5bb42e;})});}_0x2ebd0b=_['merge']({},_0x2ebd0b,_0x577527[_0x9bd1('0x3f')]);return _0x2c293a[_0x9bd1('0x4d')](_0x2ebd0b);}})[_0x9bd1('0x25')](function(_0xa3f0de){if(_0xa3f0de){_0x47e2d0=_0xa3f0de[_0x9bd1('0x35')];if(!_0x577527[_0x9bd1('0x2f')][_0x9bd1('0x36')](_0x9bd1('0x37'))){_0x2ebd0b['limit']=qs['limit'](_0x577527[_0x9bd1('0x2f')]['limit']);_0x2ebd0b[_0x9bd1('0x1f')]=qs[_0x9bd1('0x1f')](_0x577527[_0x9bd1('0x2f')][_0x9bd1('0x1f')]);}return _0x2c293a[_0x9bd1('0x4d')](_0x2ebd0b);}})[_0x9bd1('0x25')](function(_0x19d034){if(_0x19d034){return _0x19d034?{'count':_0x47e2d0,'rows':_0x19d034}:null;}})[_0x9bd1('0x25')](respondWithResult(_0x14cbb2,null))[_0x9bd1('0x43')](handleError(_0x14cbb2,null));};exports['getFields']=function(_0xb24b1,_0x5c3483,_0x3a2b3e){var _0x4e0c79={};var _0x20c043={};var _0x2d4b66;var _0x191203;return db[_0x9bd1('0x2b')][_0x9bd1('0x4b')]({'where':{'id':_0xb24b1[_0x9bd1('0x45')]['id']}})[_0x9bd1('0x25')](handleEntityNotFound(_0x5c3483,null))[_0x9bd1('0x25')](function(_0x23769c){if(_0x23769c){_0x2d4b66=_0x23769c;_0x20c043[_0x9bd1('0x2e')]=_[_0x9bd1('0x30')](db['FreshsalesField']['rawAttributes']);_0x20c043[_0x9bd1('0x2f')]=_[_0x9bd1('0x30')](_0xb24b1['query']);_0x20c043[_0x9bd1('0x31')]=_['intersection'](_0x20c043[_0x9bd1('0x2e')],_0x20c043[_0x9bd1('0x2f')]);_0x4e0c79[_0x9bd1('0x34')]=_['intersection'](_0x20c043['model'],qs['fields'](_0xb24b1['query'][_0x9bd1('0x33')]));_0x4e0c79[_0x9bd1('0x34')]=_0x4e0c79[_0x9bd1('0x34')]['length']?_0x4e0c79[_0x9bd1('0x34')]:_0x20c043['model'];_0x4e0c79[_0x9bd1('0x38')]=qs[_0x9bd1('0x39')](_0xb24b1['query'][_0x9bd1('0x39')]);_0x4e0c79[_0x9bd1('0x3a')]=qs[_0x9bd1('0x31')](_[_0x9bd1('0x3b')](_0xb24b1[_0x9bd1('0x2f')],_0x20c043[_0x9bd1('0x31')]));if(_0xb24b1[_0x9bd1('0x2f')][_0x9bd1('0x3c')]){_0x4e0c79['where']=_[_0x9bd1('0x3d')](_0x4e0c79['where'],{'$or':_['map'](_0x4e0c79[_0x9bd1('0x34')],function(_0x33d692){var _0x3e919a={};_0x3e919a[_0x33d692]={'$like':'%'+_0xb24b1[_0x9bd1('0x2f')][_0x9bd1('0x3c')]+'%'};return _0x3e919a;})});}_0x4e0c79=_['merge']({},_0x4e0c79,_0xb24b1['options']);return _0x2d4b66[_0x9bd1('0x4e')](_0x4e0c79);}})['then'](function(_0x4fe49e){if(_0x4fe49e){_0x191203=_0x4fe49e[_0x9bd1('0x35')];if(!_0xb24b1[_0x9bd1('0x2f')][_0x9bd1('0x36')](_0x9bd1('0x37'))){_0x4e0c79[_0x9bd1('0x1d')]=qs[_0x9bd1('0x1d')](_0xb24b1[_0x9bd1('0x2f')][_0x9bd1('0x1d')]);_0x4e0c79[_0x9bd1('0x1f')]=qs[_0x9bd1('0x1f')](_0xb24b1[_0x9bd1('0x2f')]['offset']);}return _0x2d4b66[_0x9bd1('0x4e')](_0x4e0c79);}})[_0x9bd1('0x25')](function(_0x169499){if(_0x169499){return _0x169499?{'count':_0x191203,'rows':_0x169499}:null;}})['then'](respondWithResult(_0x5c3483,null))[_0x9bd1('0x43')](handleError(_0x5c3483,null));}; \ No newline at end of file +var _0x834d=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x834d,0xee));var _0xd834=function(_0x293a68,_0x3b803e){_0x293a68=_0x293a68-0x0;var _0x30bc35=_0x834d[_0x293a68];return _0x30bc35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd834('0x0'));var zipdir=require(_0xd834('0x1'));var jsonpatch=require(_0xd834('0x2'));var rp=require(_0xd834('0x3'));var moment=require(_0xd834('0x4'));var BPromise=require(_0xd834('0x5'));var Mustache=require(_0xd834('0x6'));var util=require(_0xd834('0x7'));var path=require(_0xd834('0x8'));var sox=require(_0xd834('0x9'));var csv=require(_0xd834('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd834('0xb'));var _=require(_0xd834('0xc'));var squel=require(_0xd834('0xd'));var crypto=require(_0xd834('0xe'));var jsforce=require(_0xd834('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd834('0x10'));var Papa=require(_0xd834('0x11'));var Redis=require(_0xd834('0x12'));var authService=require(_0xd834('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd834('0x14'));var logger=require(_0xd834('0x15'))(_0xd834('0x16'));var utils=require('../../config/utils');var config=require(_0xd834('0x17'));var licenseUtil=require(_0xd834('0x18'));var db=require(_0xd834('0x19'))['db'];function respondWithStatusCode(_0x2e0ff7,_0x41ef98){_0x41ef98=_0x41ef98||0xcc;return function(_0x5ed712){if(_0x5ed712){return _0x2e0ff7['sendStatus'](_0x41ef98);}return _0x2e0ff7['status'](_0x41ef98)[_0xd834('0x1a')]();};}function respondWithResult(_0x372395,_0xe67e9){_0xe67e9=_0xe67e9||0xc8;return function(_0x3b1bb1){if(_0x3b1bb1){return _0x372395[_0xd834('0x1b')](_0xe67e9)['json'](_0x3b1bb1);}};}function respondWithFilteredResult(_0x4beb0d,_0x46cf29){return function(_0x6bc7ae){if(_0x6bc7ae){var _0x25ecd2=typeof _0x46cf29[_0xd834('0x1c')]===_0xd834('0x1d')&&typeof _0x46cf29[_0xd834('0x1e')]===_0xd834('0x1d');var _0x5cf4dd=_0x6bc7ae[_0xd834('0x1f')];var _0x22b86a=_0x25ecd2?0x0:_0x46cf29[_0xd834('0x1c')];var _0x10cef6=_0x25ecd2?_0x6bc7ae[_0xd834('0x1f')]:_0x46cf29[_0xd834('0x1c')]+_0x46cf29[_0xd834('0x1e')];var _0xfb5466;if(_0x10cef6>=_0x5cf4dd){_0x10cef6=_0x5cf4dd;_0xfb5466=0xc8;}else{_0xfb5466=0xce;}_0x4beb0d[_0xd834('0x1b')](_0xfb5466);return _0x4beb0d['set']('Content-Range',_0x22b86a+'-'+_0x10cef6+'/'+_0x5cf4dd)[_0xd834('0x20')](_0x6bc7ae);}return null;};}function patchUpdates(_0x177d39){return function(_0x293c0e){try{jsonpatch[_0xd834('0x21')](_0x293c0e,_0x177d39,!![]);}catch(_0x9fe937){return BPromise[_0xd834('0x22')](_0x9fe937);}return _0x293c0e['save']();};}function saveUpdates(_0x37b5b9,_0x41b06e){return function(_0x5026a6){if(_0x5026a6){return _0x5026a6[_0xd834('0x23')](_0x37b5b9)[_0xd834('0x24')](function(_0xb9b344){return _0xb9b344;});}return null;};}function removeEntity(_0x38624d,_0x2a7e63){return function(_0x9a19e8){if(_0x9a19e8){return _0x9a19e8[_0xd834('0x25')]()['then'](function(){_0x38624d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22ece0,_0x444b40){return function(_0x484400){if(!_0x484400){_0x22ece0[_0xd834('0x26')](0x194);}return _0x484400;};}function handleError(_0x2c43c2,_0x378046){_0x378046=_0x378046||0x1f4;return function(_0x43a7a1){logger[_0xd834('0x27')](_0x43a7a1[_0xd834('0x28')]);if(_0x43a7a1[_0xd834('0x29')]){delete _0x43a7a1[_0xd834('0x29')];}_0x2c43c2[_0xd834('0x1b')](_0x378046)[_0xd834('0x2a')](_0x43a7a1);};}exports[_0xd834('0x2b')]=function(_0x3263a8,_0xf32bf4){var _0x5761cc={},_0x21423e={},_0x49561a={'count':0x0,'rows':[]};var _0x236026=_[_0xd834('0x2c')](db[_0xd834('0x2d')][_0xd834('0x2e')],function(_0x52cbd8){return{'name':_0x52cbd8[_0xd834('0x2f')],'type':_0x52cbd8[_0xd834('0x30')][_0xd834('0x31')]};});_0x21423e[_0xd834('0x32')]=_[_0xd834('0x2c')](_0x236026,_0xd834('0x29'));_0x21423e[_0xd834('0x33')]=_[_0xd834('0x34')](_0x3263a8[_0xd834('0x33')]);_0x21423e[_0xd834('0x35')]=_[_0xd834('0x36')](_0x21423e['model'],_0x21423e[_0xd834('0x33')]);_0x5761cc['attributes']=_['intersection'](_0x21423e[_0xd834('0x32')],qs[_0xd834('0x37')](_0x3263a8['query']['fields']));_0x5761cc['attributes']=_0x5761cc[_0xd834('0x38')][_0xd834('0x39')]?_0x5761cc[_0xd834('0x38')]:_0x21423e['model'];if(!_0x3263a8[_0xd834('0x33')][_0xd834('0x3a')](_0xd834('0x3b'))){_0x5761cc['limit']=qs[_0xd834('0x1e')](_0x3263a8[_0xd834('0x33')][_0xd834('0x1e')]);_0x5761cc[_0xd834('0x1c')]=qs['offset'](_0x3263a8['query']['offset']);}_0x5761cc[_0xd834('0x3c')]=qs[_0xd834('0x3d')](_0x3263a8[_0xd834('0x33')][_0xd834('0x3d')]);_0x5761cc['where']=qs['filters'](_[_0xd834('0x3e')](_0x3263a8[_0xd834('0x33')],_0x21423e['filters']),_0x236026);if(_0x3263a8[_0xd834('0x33')][_0xd834('0x3f')]){_0x5761cc[_0xd834('0x40')]=_[_0xd834('0x41')](_0x5761cc[_0xd834('0x40')],{'$or':_[_0xd834('0x2c')](_0x236026,function(_0xe10cad){if(_0xe10cad[_0xd834('0x30')]!==_0xd834('0x42')){var _0x4ee21d={};_0x4ee21d[_0xe10cad[_0xd834('0x29')]]={'$like':'%'+_0x3263a8[_0xd834('0x33')][_0xd834('0x3f')]+'%'};return _0x4ee21d;}})});}_0x5761cc=_[_0xd834('0x41')]({},_0x5761cc,_0x3263a8[_0xd834('0x43')]);var _0x2cf6b8={'where':_0x5761cc['where']};return db[_0xd834('0x2d')]['count'](_0x2cf6b8)['then'](function(_0x5467c1){_0x49561a[_0xd834('0x1f')]=_0x5467c1;if(_0x3263a8[_0xd834('0x33')]['includeAll']){_0x5761cc[_0xd834('0x44')]=[{'all':!![]}];}return db[_0xd834('0x2d')][_0xd834('0x45')](_0x5761cc);})['then'](function(_0xcb6948){_0x49561a[_0xd834('0x46')]=_0xcb6948;return _0x49561a;})[_0xd834('0x24')](respondWithFilteredResult(_0xf32bf4,_0x5761cc))[_0xd834('0x47')](handleError(_0xf32bf4,null));};exports[_0xd834('0x48')]=function(_0x12aabd,_0x2ea513){var _0x524ce={'raw':![],'where':{'id':_0x12aabd['params']['id']}},_0xdd448d={};_0xdd448d['model']=_[_0xd834('0x34')](db[_0xd834('0x2d')]['rawAttributes']);_0xdd448d['query']=_['keys'](_0x12aabd['query']);_0xdd448d[_0xd834('0x35')]=_['intersection'](_0xdd448d[_0xd834('0x32')],_0xdd448d[_0xd834('0x33')]);_0x524ce[_0xd834('0x38')]=_['intersection'](_0xdd448d[_0xd834('0x32')],qs[_0xd834('0x37')](_0x12aabd['query'][_0xd834('0x37')]));_0x524ce['attributes']=_0x524ce[_0xd834('0x38')]['length']?_0x524ce['attributes']:_0xdd448d[_0xd834('0x32')];if(_0x12aabd['query']['includeAll']){_0x524ce[_0xd834('0x44')]=[{'all':!![]}];}_0x524ce=_[_0xd834('0x41')]({},_0x524ce,_0x12aabd['options']);return db[_0xd834('0x2d')][_0xd834('0x49')](_0x524ce)[_0xd834('0x24')](handleEntityNotFound(_0x2ea513,null))[_0xd834('0x24')](respondWithResult(_0x2ea513,null))['catch'](handleError(_0x2ea513,null));};exports[_0xd834('0x4a')]=function(_0x3c3ec1,_0x43ee89){return db[_0xd834('0x2d')]['create'](_0x3c3ec1[_0xd834('0x4b')],{})['then'](respondWithResult(_0x43ee89,0xc9))[_0xd834('0x47')](handleError(_0x43ee89,null));};exports['update']=function(_0x5afecb,_0x144c3a){if(_0x5afecb['body']['id']){delete _0x5afecb[_0xd834('0x4b')]['id'];}return db[_0xd834('0x2d')][_0xd834('0x49')]({'where':{'id':_0x5afecb[_0xd834('0x4c')]['id']}})[_0xd834('0x24')](handleEntityNotFound(_0x144c3a,null))[_0xd834('0x24')](saveUpdates(_0x5afecb[_0xd834('0x4b')],null))['then'](respondWithResult(_0x144c3a,null))[_0xd834('0x47')](handleError(_0x144c3a,null));};exports[_0xd834('0x25')]=function(_0x4838b2,_0x184990){return db[_0xd834('0x2d')][_0xd834('0x49')]({'where':{'id':_0x4838b2[_0xd834('0x4c')]['id']}})['then'](handleEntityNotFound(_0x184990,null))['then'](removeEntity(_0x184990,null))[_0xd834('0x47')](handleError(_0x184990,null));};exports[_0xd834('0x4d')]=function(_0x3415c8,_0x28f8c5,_0x3e1fff){var _0x491e58={};var _0xf2a3c={};var _0x43b593;var _0x12c037;return db[_0xd834('0x2d')][_0xd834('0x4e')]({'where':{'id':_0x3415c8[_0xd834('0x4c')]['id']}})[_0xd834('0x24')](handleEntityNotFound(_0x28f8c5,null))['then'](function(_0x4fc326){if(_0x4fc326){_0x43b593=_0x4fc326;_0xf2a3c['model']=_[_0xd834('0x34')](db[_0xd834('0x4f')][_0xd834('0x2e')]);_0xf2a3c['query']=_[_0xd834('0x34')](_0x3415c8['query']);_0xf2a3c[_0xd834('0x35')]=_[_0xd834('0x36')](_0xf2a3c['model'],_0xf2a3c[_0xd834('0x33')]);_0x491e58[_0xd834('0x38')]=_[_0xd834('0x36')](_0xf2a3c[_0xd834('0x32')],qs[_0xd834('0x37')](_0x3415c8[_0xd834('0x33')][_0xd834('0x37')]));_0x491e58['attributes']=_0x491e58[_0xd834('0x38')]['length']?_0x491e58[_0xd834('0x38')]:_0xf2a3c['model'];_0x491e58[_0xd834('0x3c')]=qs['sort'](_0x3415c8[_0xd834('0x33')]['sort']);_0x491e58['where']=qs[_0xd834('0x35')](_['pick'](_0x3415c8[_0xd834('0x33')],_0xf2a3c[_0xd834('0x35')]));if(_0x3415c8[_0xd834('0x33')][_0xd834('0x3f')]){_0x491e58[_0xd834('0x40')]=_['merge'](_0x491e58['where'],{'$or':_[_0xd834('0x2c')](_0x491e58['attributes'],function(_0x4f5eb4){var _0x28f7f1={};_0x28f7f1[_0x4f5eb4]={'$like':'%'+_0x3415c8[_0xd834('0x33')][_0xd834('0x3f')]+'%'};return _0x28f7f1;})});}_0x491e58=_[_0xd834('0x41')]({},_0x491e58,_0x3415c8['options']);return _0x43b593[_0xd834('0x4d')](_0x491e58);}})[_0xd834('0x24')](function(_0xe183f9){if(_0xe183f9){_0x12c037=_0xe183f9[_0xd834('0x39')];if(!_0x3415c8['query']['hasOwnProperty']('nolimit')){_0x491e58[_0xd834('0x1e')]=qs[_0xd834('0x1e')](_0x3415c8[_0xd834('0x33')]['limit']);_0x491e58[_0xd834('0x1c')]=qs[_0xd834('0x1c')](_0x3415c8[_0xd834('0x33')][_0xd834('0x1c')]);}return _0x43b593['getSubjects'](_0x491e58);}})[_0xd834('0x24')](function(_0x2a62d1){if(_0x2a62d1){return _0x2a62d1?{'count':_0x12c037,'rows':_0x2a62d1}:null;}})['then'](respondWithResult(_0x28f8c5,null))[_0xd834('0x47')](handleError(_0x28f8c5,null));};exports['getDescriptions']=function(_0x17041f,_0x57e922,_0x25174f){var _0x40a65b={};var _0x4d3897={};var _0x9c7916;var _0x459323;return db[_0xd834('0x2d')]['findOne']({'where':{'id':_0x17041f[_0xd834('0x4c')]['id']}})[_0xd834('0x24')](handleEntityNotFound(_0x57e922,null))[_0xd834('0x24')](function(_0x3f3e89){if(_0x3f3e89){_0x9c7916=_0x3f3e89;_0x4d3897[_0xd834('0x32')]=_[_0xd834('0x34')](db[_0xd834('0x4f')]['rawAttributes']);_0x4d3897[_0xd834('0x33')]=_[_0xd834('0x34')](_0x17041f[_0xd834('0x33')]);_0x4d3897[_0xd834('0x35')]=_[_0xd834('0x36')](_0x4d3897[_0xd834('0x32')],_0x4d3897[_0xd834('0x33')]);_0x40a65b['attributes']=_[_0xd834('0x36')](_0x4d3897[_0xd834('0x32')],qs[_0xd834('0x37')](_0x17041f[_0xd834('0x33')]['fields']));_0x40a65b[_0xd834('0x38')]=_0x40a65b[_0xd834('0x38')][_0xd834('0x39')]?_0x40a65b[_0xd834('0x38')]:_0x4d3897[_0xd834('0x32')];_0x40a65b['order']=qs[_0xd834('0x3d')](_0x17041f[_0xd834('0x33')][_0xd834('0x3d')]);_0x40a65b['where']=qs[_0xd834('0x35')](_[_0xd834('0x3e')](_0x17041f[_0xd834('0x33')],_0x4d3897[_0xd834('0x35')]));if(_0x17041f[_0xd834('0x33')][_0xd834('0x3f')]){_0x40a65b[_0xd834('0x40')]=_[_0xd834('0x41')](_0x40a65b[_0xd834('0x40')],{'$or':_[_0xd834('0x2c')](_0x40a65b[_0xd834('0x38')],function(_0x3ad763){var _0x2466b7={};_0x2466b7[_0x3ad763]={'$like':'%'+_0x17041f[_0xd834('0x33')][_0xd834('0x3f')]+'%'};return _0x2466b7;})});}_0x40a65b=_['merge']({},_0x40a65b,_0x17041f[_0xd834('0x43')]);return _0x9c7916[_0xd834('0x50')](_0x40a65b);}})[_0xd834('0x24')](function(_0x388fdb){if(_0x388fdb){_0x459323=_0x388fdb['length'];if(!_0x17041f['query']['hasOwnProperty'](_0xd834('0x3b'))){_0x40a65b[_0xd834('0x1e')]=qs['limit'](_0x17041f[_0xd834('0x33')]['limit']);_0x40a65b[_0xd834('0x1c')]=qs[_0xd834('0x1c')](_0x17041f[_0xd834('0x33')][_0xd834('0x1c')]);}return _0x9c7916['getDescriptions'](_0x40a65b);}})['then'](function(_0x18e95e){if(_0x18e95e){return _0x18e95e?{'count':_0x459323,'rows':_0x18e95e}:null;}})[_0xd834('0x24')](respondWithResult(_0x57e922,null))[_0xd834('0x47')](handleError(_0x57e922,null));};exports[_0xd834('0x51')]=function(_0x359a1a,_0x5e295c,_0x4d3660){var _0x3b184c={};var _0x23b025={};var _0x1d165d;var _0x864de7;return db[_0xd834('0x2d')][_0xd834('0x4e')]({'where':{'id':_0x359a1a[_0xd834('0x4c')]['id']}})[_0xd834('0x24')](handleEntityNotFound(_0x5e295c,null))[_0xd834('0x24')](function(_0x3c37a8){if(_0x3c37a8){_0x1d165d=_0x3c37a8;_0x23b025[_0xd834('0x32')]=_[_0xd834('0x34')](db[_0xd834('0x4f')][_0xd834('0x2e')]);_0x23b025['query']=_[_0xd834('0x34')](_0x359a1a[_0xd834('0x33')]);_0x23b025['filters']=_[_0xd834('0x36')](_0x23b025[_0xd834('0x32')],_0x23b025[_0xd834('0x33')]);_0x3b184c[_0xd834('0x38')]=_[_0xd834('0x36')](_0x23b025[_0xd834('0x32')],qs[_0xd834('0x37')](_0x359a1a[_0xd834('0x33')][_0xd834('0x37')]));_0x3b184c[_0xd834('0x38')]=_0x3b184c[_0xd834('0x38')][_0xd834('0x39')]?_0x3b184c[_0xd834('0x38')]:_0x23b025['model'];_0x3b184c[_0xd834('0x3c')]=qs[_0xd834('0x3d')](_0x359a1a['query'][_0xd834('0x3d')]);_0x3b184c[_0xd834('0x40')]=qs['filters'](_['pick'](_0x359a1a[_0xd834('0x33')],_0x23b025[_0xd834('0x35')]));if(_0x359a1a['query'][_0xd834('0x3f')]){_0x3b184c[_0xd834('0x40')]=_[_0xd834('0x41')](_0x3b184c[_0xd834('0x40')],{'$or':_[_0xd834('0x2c')](_0x3b184c[_0xd834('0x38')],function(_0x20439e){var _0x3eb4df={};_0x3eb4df[_0x20439e]={'$like':'%'+_0x359a1a[_0xd834('0x33')][_0xd834('0x3f')]+'%'};return _0x3eb4df;})});}_0x3b184c=_[_0xd834('0x41')]({},_0x3b184c,_0x359a1a[_0xd834('0x43')]);return _0x1d165d[_0xd834('0x51')](_0x3b184c);}})[_0xd834('0x24')](function(_0x4426d1){if(_0x4426d1){_0x864de7=_0x4426d1['length'];if(!_0x359a1a['query'][_0xd834('0x3a')](_0xd834('0x3b'))){_0x3b184c[_0xd834('0x1e')]=qs['limit'](_0x359a1a[_0xd834('0x33')][_0xd834('0x1e')]);_0x3b184c[_0xd834('0x1c')]=qs[_0xd834('0x1c')](_0x359a1a[_0xd834('0x33')][_0xd834('0x1c')]);}return _0x1d165d[_0xd834('0x51')](_0x3b184c);}})['then'](function(_0x1937ed){if(_0x1937ed){return _0x1937ed?{'count':_0x864de7,'rows':_0x1937ed}:null;}})[_0xd834('0x24')](respondWithResult(_0x5e295c,null))[_0xd834('0x47')](handleError(_0x5e295c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 2955573..2c3a28c 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 _0x7732=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x1e134d,_0x4b0563){var _0x2dc1da=function(_0x1acacd){while(--_0x1acacd){_0x1e134d['push'](_0x1e134d['shift']());}};_0x2dc1da(++_0x4b0563);}(_0x7732,0x186));var _0x2773=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0x7732[_0x5c811c];return _0x5df3af;};'use strict';var _=require(_0x2773('0x0'));var util=require(_0x2773('0x1'));var logger=require('../../config/logger')(_0x2773('0x2'));var moment=require(_0x2773('0x3'));var BPromise=require(_0x2773('0x4'));var rp=require(_0x2773('0x5'));var fs=require('fs');var path=require(_0x2773('0x6'));var rimraf=require(_0x2773('0x7'));var config=require(_0x2773('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x2773('0x9')]=function(_0x19969b,_0x4f920f){return _0x19969b[_0x2773('0xa')](_0x2773('0xb'),attributes,{'tableName':_0x2773('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4239=['bluebird','request-promise','rimraf','../../config/environment','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment'];(function(_0x3b44ff,_0x5824f0){var _0xbae2e5=function(_0x255770){while(--_0x255770){_0x3b44ff['push'](_0x3b44ff['shift']());}};_0xbae2e5(++_0x5824f0);}(_0x4239,0x7e));var _0x9423=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x4239[_0x4b12ae];return _0x16957b;};'use strict';var _=require(_0x9423('0x0'));var util=require('util');var logger=require(_0x9423('0x1'))(_0x9423('0x2'));var moment=require(_0x9423('0x3'));var BPromise=require(_0x9423('0x4'));var rp=require(_0x9423('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9423('0x6'));var config=require(_0x9423('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x1ca5c2,_0x5d4583){return _0x1ca5c2['define'](_0x9423('0x8'),attributes,{'tableName':_0x9423('0x9'),'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 61b890f..d252d82 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 _0x0dc2=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1b731a,_0x13b70c){var _0x2854fc=function(_0x8c29a9){while(--_0x8c29a9){_0x1b731a['push'](_0x1b731a['shift']());}};_0x2854fc(++_0x13b70c);}(_0x0dc2,0x16c));var _0x20dc=function(_0x538b2b,_0x33546d){_0x538b2b=_0x538b2b-0x0;var _0x238ce6=_0x0dc2[_0x538b2b];return _0x238ce6;};'use strict';var _=require(_0x20dc('0x0'));var util=require(_0x20dc('0x1'));var moment=require(_0x20dc('0x2'));var BPromise=require(_0x20dc('0x3'));var rs=require(_0x20dc('0x4'));var fs=require('fs');var Redis=require(_0x20dc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20dc('0x6'));var logger=require('../../config/logger')(_0x20dc('0x7'));var config=require('../../config/environment');var jayson=require(_0x20dc('0x8'));var client=jayson[_0x20dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52dc71,_0x3605e3,_0x1187e8){return new BPromise(function(_0x587f78,_0x10ae4a){return client[_0x20dc('0xa')](_0x52dc71,_0x1187e8)[_0x20dc('0xb')](function(_0x339a42){logger[_0x20dc('0xc')](_0x20dc('0xd'),_0x3605e3,_0x20dc('0xe'));logger['debug'](_0x20dc('0xf'),_0x3605e3,_0x20dc('0xe'),JSON['stringify'](_0x339a42));if(_0x339a42[_0x20dc('0x10')]){if(_0x339a42[_0x20dc('0x10')][_0x20dc('0x11')]===0x1f4){logger[_0x20dc('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3605e3,_0x339a42[_0x20dc('0x10')][_0x20dc('0x12')]);return _0x10ae4a(_0x339a42[_0x20dc('0x10')][_0x20dc('0x12')]);}logger['error'](_0x20dc('0xd'),_0x3605e3,_0x339a42[_0x20dc('0x10')][_0x20dc('0x12')]);return _0x587f78(_0x339a42['error'][_0x20dc('0x12')]);}else{logger[_0x20dc('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3605e3,_0x20dc('0xe'));_0x587f78(_0x339a42[_0x20dc('0x13')][_0x20dc('0x12')]);}})['catch'](function(_0x1f5f39){logger[_0x20dc('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3605e3,_0x1f5f39);_0x10ae4a(_0x1f5f39);});});} \ No newline at end of file +var _0xf4d7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0xf4d7,0xae));var _0x7f4d=function(_0x1cab6f,_0x480208){_0x1cab6f=_0x1cab6f-0x0;var _0x4328f1=_0xf4d7[_0x1cab6f];return _0x4328f1;};'use strict';var _=require('lodash');var util=require(_0x7f4d('0x0'));var moment=require(_0x7f4d('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f4d('0x2'));var fs=require('fs');var Redis=require(_0x7f4d('0x3'));var db=require(_0x7f4d('0x4'))['db'];var utils=require(_0x7f4d('0x5'));var logger=require(_0x7f4d('0x6'))('rpc');var config=require(_0x7f4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7f4d('0x8')][_0x7f4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2564fb,_0x1f1349,_0xa77479){return new BPromise(function(_0xa00915,_0x56e4a1){return client[_0x7f4d('0xa')](_0x2564fb,_0xa77479)[_0x7f4d('0xb')](function(_0x138986){logger['info'](_0x7f4d('0xc'),_0x1f1349,'request\x20sent');logger[_0x7f4d('0xd')](_0x7f4d('0xe'),_0x1f1349,_0x7f4d('0xf'),JSON[_0x7f4d('0x10')](_0x138986));if(_0x138986[_0x7f4d('0x11')]){if(_0x138986[_0x7f4d('0x11')]['code']===0x1f4){logger[_0x7f4d('0x11')](_0x7f4d('0xc'),_0x1f1349,_0x138986['error'][_0x7f4d('0x12')]);return _0x56e4a1(_0x138986[_0x7f4d('0x11')]['message']);}logger['error'](_0x7f4d('0xc'),_0x1f1349,_0x138986[_0x7f4d('0x11')][_0x7f4d('0x12')]);return _0xa00915(_0x138986[_0x7f4d('0x11')]['message']);}else{logger[_0x7f4d('0x13')](_0x7f4d('0xc'),_0x1f1349,_0x7f4d('0xf'));_0xa00915(_0x138986[_0x7f4d('0x14')][_0x7f4d('0x12')]);}})[_0x7f4d('0x15')](function(_0x2d6883){logger[_0x7f4d('0x11')](_0x7f4d('0xc'),_0x1f1349,_0x2d6883);_0x56e4a1(_0x2d6883);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1b33aa9..d750bc0 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 _0xe700=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0xe700,0x16a));var _0x0e70=function(_0x220e57,_0x863240){_0x220e57=_0x220e57-0x0;var _0x28c583=_0xe700[_0x220e57];return _0x28c583;};'use strict';var multer=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var path=require(_0x0e70('0x2'));var timeout=require(_0x0e70('0x3'));var express=require(_0x0e70('0x4'));var router=express['Router']();var fs_extra=require(_0x0e70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e70('0x6'));var config=require(_0x0e70('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0x9')]);router[_0x0e70('0xa')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0xc')]);router[_0x0e70('0xd')]('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0xe')]);router[_0x0e70('0xf')](_0x0e70('0xb'),auth[_0x0e70('0x8')](),controller['update']);router[_0x0e70('0x10')](_0x0e70('0xb'),auth[_0x0e70('0x8')](),controller['destroy']);module[_0x0e70('0x11')]=router; \ No newline at end of file +var _0xaa88=['./intFreshsalesField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xd78afd,_0x57ee8a){var _0x1360a1=function(_0x561a7e){while(--_0x561a7e){_0xd78afd['push'](_0xd78afd['shift']());}};_0x1360a1(++_0x57ee8a);}(_0xaa88,0x137));var _0x8aa8=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0xaa88[_0x60df74];return _0x5ee872;};'use strict';var multer=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var path=require(_0x8aa8('0x2'));var timeout=require(_0x8aa8('0x3'));var express=require('express');var router=express[_0x8aa8('0x4')]();var fs_extra=require(_0x8aa8('0x5'));var auth=require(_0x8aa8('0x6'));var interaction=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var controller=require(_0x8aa8('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8aa8('0xa')]);router['get'](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller[_0x8aa8('0xd')]);router[_0x8aa8('0xe')]('/',auth['isAuthenticated'](),controller[_0x8aa8('0xf')]);router[_0x8aa8('0x10')](_0x8aa8('0xb'),auth['isAuthenticated'](),controller[_0x8aa8('0x11')]);router[_0x8aa8('0x12')](_0x8aa8('0xb'),auth[_0x8aa8('0xc')](),controller['destroy']);module[_0x8aa8('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ba1c4bc..4004f67 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 _0x63ea=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x63ea,0xfc));var _0xa63e=function(_0x2ea6bb,_0x27f074){_0x2ea6bb=_0x2ea6bb-0x0;var _0x16072d=_0x63ea[_0x2ea6bb];return _0x16072d;};'use strict';var Sequelize=require('sequelize');module[_0xa63e('0x0')]={'type':{'type':Sequelize[_0xa63e('0x1')](_0xa63e('0x2'),_0xa63e('0x3'),_0xa63e('0x4'),_0xa63e('0x5'),'picklist'),'defaultValue':_0xa63e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa63e('0x6')]},'keyType':{'type':Sequelize[_0xa63e('0x1')](_0xa63e('0x2'),_0xa63e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa63e('0x6')]},'idField':{'type':Sequelize[_0xa63e('0x6')]},'nameField':{'type':Sequelize[_0xa63e('0x6')]},'customField':{'type':Sequelize[_0xa63e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa63e('0x6')]}}; \ No newline at end of file +var _0x853e=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x12c50f,_0x29be50){var _0x36dc8e=function(_0x283fad){while(--_0x283fad){_0x12c50f['push'](_0x12c50f['shift']());}};_0x36dc8e(++_0x29be50);}(_0x853e,0x1c2));var _0xe853=function(_0x4e7e3e,_0x13c6b8){_0x4e7e3e=_0x4e7e3e-0x0;var _0x4030c8=_0x853e[_0x4e7e3e];return _0x4030c8;};'use strict';var Sequelize=require(_0xe853('0x0'));module[_0xe853('0x1')]={'type':{'type':Sequelize[_0xe853('0x2')](_0xe853('0x3'),_0xe853('0x4'),_0xe853('0x5'),_0xe853('0x6'),_0xe853('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe853('0x8')]},'key':{'type':Sequelize[_0xe853('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xe853('0x3'),'variable',_0xe853('0x5'))},'keyContent':{'type':Sequelize[_0xe853('0x8')]},'idField':{'type':Sequelize[_0xe853('0x8')]},'nameField':{'type':Sequelize[_0xe853('0x8')]},'customField':{'type':Sequelize[_0xe853('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe853('0x8')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 456e90d..a20cddf 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 _0xb0cb=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','map','FreshsalesField'];(function(_0x4a98eb,_0x4cb8e5){var _0xfa8227=function(_0x128c94){while(--_0x128c94){_0x4a98eb['push'](_0x4a98eb['shift']());}};_0xfa8227(++_0x4cb8e5);}(_0xb0cb,0x19f));var _0xbb0c=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xb0cb[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0xbb0c('0x0'));var rimraf=require(_0xbb0c('0x1'));var zipdir=require(_0xbb0c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb0c('0x3'));var moment=require(_0xbb0c('0x4'));var BPromise=require(_0xbb0c('0x5'));var Mustache=require(_0xbb0c('0x6'));var util=require(_0xbb0c('0x7'));var path=require(_0xbb0c('0x8'));var sox=require(_0xbb0c('0x9'));var csv=require(_0xbb0c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb0c('0xb'));var squel=require(_0xbb0c('0xc'));var crypto=require(_0xbb0c('0xd'));var jsforce=require(_0xbb0c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb0c('0xa'));var querystring=require(_0xbb0c('0xf'));var Papa=require(_0xbb0c('0x10'));var Redis=require(_0xbb0c('0x11'));var authService=require(_0xbb0c('0x12'));var qs=require(_0xbb0c('0x13'));var as=require(_0xbb0c('0x14'));var hardwareService=require(_0xbb0c('0x15'));var logger=require(_0xbb0c('0x16'))(_0xbb0c('0x17'));var utils=require(_0xbb0c('0x18'));var config=require(_0xbb0c('0x19'));var licenseUtil=require(_0xbb0c('0x1a'));var db=require(_0xbb0c('0x1b'))['db'];function respondWithStatusCode(_0x52d0b8,_0x5e6fbc){_0x5e6fbc=_0x5e6fbc||0xcc;return function(_0x2def89){if(_0x2def89){return _0x52d0b8[_0xbb0c('0x1c')](_0x5e6fbc);}return _0x52d0b8[_0xbb0c('0x1d')](_0x5e6fbc)[_0xbb0c('0x1e')]();};}function respondWithResult(_0x2b4ee5,_0x5da465){_0x5da465=_0x5da465||0xc8;return function(_0x411dcc){if(_0x411dcc){return _0x2b4ee5[_0xbb0c('0x1d')](_0x5da465)[_0xbb0c('0x1f')](_0x411dcc);}};}function respondWithFilteredResult(_0x606691,_0xd5e14b){return function(_0x2fcc4b){if(_0x2fcc4b){var _0x57c4e3=typeof _0xd5e14b[_0xbb0c('0x20')]===_0xbb0c('0x21')&&typeof _0xd5e14b[_0xbb0c('0x22')]===_0xbb0c('0x21');var _0xdb65b9=_0x2fcc4b[_0xbb0c('0x23')];var _0x298e36=_0x57c4e3?0x0:_0xd5e14b[_0xbb0c('0x20')];var _0x166162=_0x57c4e3?_0x2fcc4b[_0xbb0c('0x23')]:_0xd5e14b[_0xbb0c('0x20')]+_0xd5e14b[_0xbb0c('0x22')];var _0x525daf;if(_0x166162>=_0xdb65b9){_0x166162=_0xdb65b9;_0x525daf=0xc8;}else{_0x525daf=0xce;}_0x606691['status'](_0x525daf);return _0x606691[_0xbb0c('0x24')](_0xbb0c('0x25'),_0x298e36+'-'+_0x166162+'/'+_0xdb65b9)[_0xbb0c('0x1f')](_0x2fcc4b);}return null;};}function patchUpdates(_0x4dc919){return function(_0x5c0868){try{jsonpatch['apply'](_0x5c0868,_0x4dc919,!![]);}catch(_0x2ef870){return BPromise[_0xbb0c('0x26')](_0x2ef870);}return _0x5c0868['save']();};}function saveUpdates(_0x28b1cf,_0x230be7){return function(_0x298a19){if(_0x298a19){return _0x298a19[_0xbb0c('0x27')](_0x28b1cf)[_0xbb0c('0x28')](function(_0x639539){return _0x639539;});}return null;};}function removeEntity(_0x51791a,_0x58df1b){return function(_0x2a7e5f){if(_0x2a7e5f){return _0x2a7e5f[_0xbb0c('0x29')]()[_0xbb0c('0x28')](function(){_0x51791a[_0xbb0c('0x1d')](0xcc)[_0xbb0c('0x1e')]();});}};}function handleEntityNotFound(_0x30399e,_0x54d19d){return function(_0x53b783){if(!_0x53b783){_0x30399e[_0xbb0c('0x1c')](0x194);}return _0x53b783;};}function handleError(_0x5bf423,_0x9d8ce){_0x9d8ce=_0x9d8ce||0x1f4;return function(_0x6bfe6d){logger[_0xbb0c('0x2a')](_0x6bfe6d['stack']);if(_0x6bfe6d['name']){delete _0x6bfe6d[_0xbb0c('0x2b')];}_0x5bf423[_0xbb0c('0x1d')](_0x9d8ce)[_0xbb0c('0x2c')](_0x6bfe6d);};}exports['index']=function(_0x5a6c78,_0x8b2df2){var _0x33e4e4={},_0x5d7e2f={},_0x399ba8={'count':0x0,'rows':[]};var _0x852c19=_[_0xbb0c('0x2d')](db[_0xbb0c('0x2e')][_0xbb0c('0x2f')],function(_0x7c5ef5){return{'name':_0x7c5ef5[_0xbb0c('0x30')],'type':_0x7c5ef5[_0xbb0c('0x31')]['key']};});_0x5d7e2f[_0xbb0c('0x32')]=_[_0xbb0c('0x2d')](_0x852c19,_0xbb0c('0x2b'));_0x5d7e2f[_0xbb0c('0x33')]=_[_0xbb0c('0x34')](_0x5a6c78[_0xbb0c('0x33')]);_0x5d7e2f[_0xbb0c('0x35')]=_[_0xbb0c('0x36')](_0x5d7e2f[_0xbb0c('0x32')],_0x5d7e2f['query']);_0x33e4e4[_0xbb0c('0x37')]=_[_0xbb0c('0x36')](_0x5d7e2f[_0xbb0c('0x32')],qs[_0xbb0c('0x38')](_0x5a6c78['query'][_0xbb0c('0x38')]));_0x33e4e4[_0xbb0c('0x37')]=_0x33e4e4['attributes'][_0xbb0c('0x39')]?_0x33e4e4[_0xbb0c('0x37')]:_0x5d7e2f[_0xbb0c('0x32')];if(!_0x5a6c78[_0xbb0c('0x33')]['hasOwnProperty'](_0xbb0c('0x3a'))){_0x33e4e4['limit']=qs[_0xbb0c('0x22')](_0x5a6c78[_0xbb0c('0x33')][_0xbb0c('0x22')]);_0x33e4e4[_0xbb0c('0x20')]=qs[_0xbb0c('0x20')](_0x5a6c78[_0xbb0c('0x33')][_0xbb0c('0x20')]);}_0x33e4e4[_0xbb0c('0x3b')]=qs[_0xbb0c('0x3c')](_0x5a6c78[_0xbb0c('0x33')][_0xbb0c('0x3c')]);_0x33e4e4[_0xbb0c('0x3d')]=qs[_0xbb0c('0x35')](_[_0xbb0c('0x3e')](_0x5a6c78['query'],_0x5d7e2f[_0xbb0c('0x35')]),_0x852c19);if(_0x5a6c78[_0xbb0c('0x33')][_0xbb0c('0x3f')]){_0x33e4e4['where']=_[_0xbb0c('0x40')](_0x33e4e4['where'],{'$or':_[_0xbb0c('0x2d')](_0x852c19,function(_0x28d926){if(_0x28d926['type']!==_0xbb0c('0x41')){var _0x41e037={};_0x41e037[_0x28d926['name']]={'$like':'%'+_0x5a6c78['query'][_0xbb0c('0x3f')]+'%'};return _0x41e037;}})});}_0x33e4e4=_['merge']({},_0x33e4e4,_0x5a6c78[_0xbb0c('0x42')]);var _0x3b67ee={'where':_0x33e4e4[_0xbb0c('0x3d')]};return db[_0xbb0c('0x2e')]['count'](_0x3b67ee)[_0xbb0c('0x28')](function(_0x36cc1f){_0x399ba8[_0xbb0c('0x23')]=_0x36cc1f;if(_0x5a6c78[_0xbb0c('0x33')][_0xbb0c('0x43')]){_0x33e4e4[_0xbb0c('0x44')]=[{'all':!![]}];}return db[_0xbb0c('0x2e')][_0xbb0c('0x45')](_0x33e4e4);})['then'](function(_0x53e255){_0x399ba8[_0xbb0c('0x46')]=_0x53e255;return _0x399ba8;})[_0xbb0c('0x28')](respondWithFilteredResult(_0x8b2df2,_0x33e4e4))[_0xbb0c('0x47')](handleError(_0x8b2df2,null));};exports[_0xbb0c('0x48')]=function(_0x56cd49,_0x497954){var _0xa0fd87={'raw':!![],'where':{'id':_0x56cd49['params']['id']}},_0x12aadb={};_0x12aadb[_0xbb0c('0x32')]=_[_0xbb0c('0x34')](db[_0xbb0c('0x2e')]['rawAttributes']);_0x12aadb[_0xbb0c('0x33')]=_[_0xbb0c('0x34')](_0x56cd49[_0xbb0c('0x33')]);_0x12aadb[_0xbb0c('0x35')]=_[_0xbb0c('0x36')](_0x12aadb[_0xbb0c('0x32')],_0x12aadb[_0xbb0c('0x33')]);_0xa0fd87[_0xbb0c('0x37')]=_[_0xbb0c('0x36')](_0x12aadb['model'],qs[_0xbb0c('0x38')](_0x56cd49[_0xbb0c('0x33')][_0xbb0c('0x38')]));_0xa0fd87[_0xbb0c('0x37')]=_0xa0fd87[_0xbb0c('0x37')][_0xbb0c('0x39')]?_0xa0fd87[_0xbb0c('0x37')]:_0x12aadb[_0xbb0c('0x32')];if(_0x56cd49[_0xbb0c('0x33')][_0xbb0c('0x43')]){_0xa0fd87[_0xbb0c('0x44')]=[{'all':!![]}];}_0xa0fd87=_[_0xbb0c('0x40')]({},_0xa0fd87,_0x56cd49[_0xbb0c('0x42')]);return db[_0xbb0c('0x2e')][_0xbb0c('0x49')](_0xa0fd87)[_0xbb0c('0x28')](handleEntityNotFound(_0x497954,null))[_0xbb0c('0x28')](respondWithResult(_0x497954,null))['catch'](handleError(_0x497954,null));};exports[_0xbb0c('0x4a')]=function(_0x306f5e,_0x20cb12){return db['FreshsalesField']['create'](_0x306f5e[_0xbb0c('0x4b')],{})['then'](respondWithResult(_0x20cb12,0xc9))['catch'](handleError(_0x20cb12,null));};exports[_0xbb0c('0x27')]=function(_0x273ac1,_0x3d1e3c){if(_0x273ac1[_0xbb0c('0x4b')]['id']){delete _0x273ac1[_0xbb0c('0x4b')]['id'];}return db[_0xbb0c('0x2e')]['find']({'where':{'id':_0x273ac1['params']['id']}})[_0xbb0c('0x28')](handleEntityNotFound(_0x3d1e3c,null))[_0xbb0c('0x28')](saveUpdates(_0x273ac1[_0xbb0c('0x4b')],null))[_0xbb0c('0x28')](respondWithResult(_0x3d1e3c,null))[_0xbb0c('0x47')](handleError(_0x3d1e3c,null));};exports[_0xbb0c('0x29')]=function(_0x2b1f5e,_0x3068b1){return db[_0xbb0c('0x2e')][_0xbb0c('0x49')]({'where':{'id':_0x2b1f5e[_0xbb0c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3068b1,null))[_0xbb0c('0x28')](removeEntity(_0x3068b1,null))[_0xbb0c('0x47')](handleError(_0x3068b1,null));}; \ No newline at end of file +var _0x59a0=['../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x44fde7,_0x173eb8){var _0x116b5f=function(_0x40c163){while(--_0x40c163){_0x44fde7['push'](_0x44fde7['shift']());}};_0x116b5f(++_0x173eb8);}(_0x59a0,0xbf));var _0x059a=function(_0x51c26c,_0x54079e){_0x51c26c=_0x51c26c-0x0;var _0x54b8fe=_0x59a0[_0x51c26c];return _0x54b8fe;};'use strict';var emlformat=require(_0x059a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x059a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x059a('0x2'));var moment=require('moment');var BPromise=require(_0x059a('0x3'));var Mustache=require(_0x059a('0x4'));var util=require('util');var path=require(_0x059a('0x5'));var sox=require(_0x059a('0x6'));var csv=require(_0x059a('0x7'));var ejs=require(_0x059a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x059a('0x9'));var squel=require(_0x059a('0xa'));var crypto=require('crypto');var jsforce=require(_0x059a('0xb'));var deskjs=require(_0x059a('0xc'));var toCsv=require(_0x059a('0x7'));var querystring=require(_0x059a('0xd'));var Papa=require('papaparse');var Redis=require(_0x059a('0xe'));var authService=require(_0x059a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x059a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x059a('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x059a('0x12'));var db=require(_0x059a('0x13'))['db'];function respondWithStatusCode(_0x10a712,_0x81131c){_0x81131c=_0x81131c||0xcc;return function(_0x463165){if(_0x463165){return _0x10a712[_0x059a('0x14')](_0x81131c);}return _0x10a712['status'](_0x81131c)[_0x059a('0x15')]();};}function respondWithResult(_0x3d12f0,_0x186de5){_0x186de5=_0x186de5||0xc8;return function(_0x6d4abc){if(_0x6d4abc){return _0x3d12f0[_0x059a('0x16')](_0x186de5)[_0x059a('0x17')](_0x6d4abc);}};}function respondWithFilteredResult(_0x567c6b,_0x335ca7){return function(_0x26ca16){if(_0x26ca16){var _0x2efa57=typeof _0x335ca7[_0x059a('0x18')]===_0x059a('0x19')&&typeof _0x335ca7['limit']===_0x059a('0x19');var _0x6d892f=_0x26ca16[_0x059a('0x1a')];var _0x20c372=_0x2efa57?0x0:_0x335ca7[_0x059a('0x18')];var _0x351220=_0x2efa57?_0x26ca16[_0x059a('0x1a')]:_0x335ca7[_0x059a('0x18')]+_0x335ca7[_0x059a('0x1b')];var _0x317c12;if(_0x351220>=_0x6d892f){_0x351220=_0x6d892f;_0x317c12=0xc8;}else{_0x317c12=0xce;}_0x567c6b[_0x059a('0x16')](_0x317c12);return _0x567c6b[_0x059a('0x1c')]('Content-Range',_0x20c372+'-'+_0x351220+'/'+_0x6d892f)[_0x059a('0x17')](_0x26ca16);}return null;};}function patchUpdates(_0x441394){return function(_0x157fca){try{jsonpatch['apply'](_0x157fca,_0x441394,!![]);}catch(_0x500173){return BPromise[_0x059a('0x1d')](_0x500173);}return _0x157fca[_0x059a('0x1e')]();};}function saveUpdates(_0x6dac34,_0x515299){return function(_0x472a45){if(_0x472a45){return _0x472a45[_0x059a('0x1f')](_0x6dac34)[_0x059a('0x20')](function(_0x5140b5){return _0x5140b5;});}return null;};}function removeEntity(_0x589837,_0x4405ec){return function(_0x1148bd){if(_0x1148bd){return _0x1148bd[_0x059a('0x21')]()['then'](function(){_0x589837['status'](0xcc)[_0x059a('0x15')]();});}};}function handleEntityNotFound(_0x1b8b43,_0x1e92a4){return function(_0x59a10e){if(!_0x59a10e){_0x1b8b43['sendStatus'](0x194);}return _0x59a10e;};}function handleError(_0x23179c,_0x193f36){_0x193f36=_0x193f36||0x1f4;return function(_0x22ceff){logger[_0x059a('0x22')](_0x22ceff[_0x059a('0x23')]);if(_0x22ceff[_0x059a('0x24')]){delete _0x22ceff[_0x059a('0x24')];}_0x23179c['status'](_0x193f36)[_0x059a('0x25')](_0x22ceff);};}exports['index']=function(_0x17893c,_0x541762){var _0x14f55f={},_0x89af4f={},_0x541c6d={'count':0x0,'rows':[]};var _0x1ed450=_[_0x059a('0x26')](db[_0x059a('0x27')]['rawAttributes'],function(_0x2ed0a2){return{'name':_0x2ed0a2[_0x059a('0x28')],'type':_0x2ed0a2[_0x059a('0x29')][_0x059a('0x2a')]};});_0x89af4f[_0x059a('0x2b')]=_['map'](_0x1ed450,'name');_0x89af4f[_0x059a('0x2c')]=_[_0x059a('0x2d')](_0x17893c['query']);_0x89af4f[_0x059a('0x2e')]=_[_0x059a('0x2f')](_0x89af4f['model'],_0x89af4f[_0x059a('0x2c')]);_0x14f55f[_0x059a('0x30')]=_[_0x059a('0x2f')](_0x89af4f['model'],qs['fields'](_0x17893c[_0x059a('0x2c')][_0x059a('0x31')]));_0x14f55f['attributes']=_0x14f55f[_0x059a('0x30')][_0x059a('0x32')]?_0x14f55f[_0x059a('0x30')]:_0x89af4f[_0x059a('0x2b')];if(!_0x17893c[_0x059a('0x2c')][_0x059a('0x33')](_0x059a('0x34'))){_0x14f55f[_0x059a('0x1b')]=qs[_0x059a('0x1b')](_0x17893c[_0x059a('0x2c')]['limit']);_0x14f55f[_0x059a('0x18')]=qs['offset'](_0x17893c[_0x059a('0x2c')][_0x059a('0x18')]);}_0x14f55f['order']=qs[_0x059a('0x35')](_0x17893c[_0x059a('0x2c')]['sort']);_0x14f55f[_0x059a('0x36')]=qs['filters'](_[_0x059a('0x37')](_0x17893c[_0x059a('0x2c')],_0x89af4f[_0x059a('0x2e')]),_0x1ed450);if(_0x17893c[_0x059a('0x2c')][_0x059a('0x38')]){_0x14f55f['where']=_[_0x059a('0x39')](_0x14f55f['where'],{'$or':_[_0x059a('0x26')](_0x1ed450,function(_0x4625da){if(_0x4625da[_0x059a('0x29')]!=='VIRTUAL'){var _0x1c86de={};_0x1c86de[_0x4625da[_0x059a('0x24')]]={'$like':'%'+_0x17893c[_0x059a('0x2c')][_0x059a('0x38')]+'%'};return _0x1c86de;}})});}_0x14f55f=_[_0x059a('0x39')]({},_0x14f55f,_0x17893c[_0x059a('0x3a')]);var _0x3c2e0d={'where':_0x14f55f['where']};return db['FreshsalesField'][_0x059a('0x1a')](_0x3c2e0d)[_0x059a('0x20')](function(_0x3d7d61){_0x541c6d['count']=_0x3d7d61;if(_0x17893c['query'][_0x059a('0x3b')]){_0x14f55f['include']=[{'all':!![]}];}return db[_0x059a('0x27')][_0x059a('0x3c')](_0x14f55f);})[_0x059a('0x20')](function(_0x3969a8){_0x541c6d[_0x059a('0x3d')]=_0x3969a8;return _0x541c6d;})[_0x059a('0x20')](respondWithFilteredResult(_0x541762,_0x14f55f))[_0x059a('0x3e')](handleError(_0x541762,null));};exports[_0x059a('0x3f')]=function(_0x4569df,_0x3f5008){var _0x545716={'raw':!![],'where':{'id':_0x4569df['params']['id']}},_0x27772b={};_0x27772b['model']=_['keys'](db[_0x059a('0x27')]['rawAttributes']);_0x27772b['query']=_[_0x059a('0x2d')](_0x4569df[_0x059a('0x2c')]);_0x27772b[_0x059a('0x2e')]=_[_0x059a('0x2f')](_0x27772b[_0x059a('0x2b')],_0x27772b['query']);_0x545716[_0x059a('0x30')]=_[_0x059a('0x2f')](_0x27772b[_0x059a('0x2b')],qs[_0x059a('0x31')](_0x4569df[_0x059a('0x2c')][_0x059a('0x31')]));_0x545716['attributes']=_0x545716[_0x059a('0x30')][_0x059a('0x32')]?_0x545716['attributes']:_0x27772b[_0x059a('0x2b')];if(_0x4569df[_0x059a('0x2c')][_0x059a('0x3b')]){_0x545716[_0x059a('0x40')]=[{'all':!![]}];}_0x545716=_[_0x059a('0x39')]({},_0x545716,_0x4569df[_0x059a('0x3a')]);return db['FreshsalesField'][_0x059a('0x41')](_0x545716)[_0x059a('0x20')](handleEntityNotFound(_0x3f5008,null))['then'](respondWithResult(_0x3f5008,null))[_0x059a('0x3e')](handleError(_0x3f5008,null));};exports[_0x059a('0x42')]=function(_0x5023ab,_0x4b0c48){return db[_0x059a('0x27')][_0x059a('0x42')](_0x5023ab[_0x059a('0x43')],{})['then'](respondWithResult(_0x4b0c48,0xc9))[_0x059a('0x3e')](handleError(_0x4b0c48,null));};exports['update']=function(_0xa35837,_0x59378d){if(_0xa35837[_0x059a('0x43')]['id']){delete _0xa35837['body']['id'];}return db[_0x059a('0x27')]['find']({'where':{'id':_0xa35837[_0x059a('0x44')]['id']}})[_0x059a('0x20')](handleEntityNotFound(_0x59378d,null))[_0x059a('0x20')](saveUpdates(_0xa35837[_0x059a('0x43')],null))['then'](respondWithResult(_0x59378d,null))[_0x059a('0x3e')](handleError(_0x59378d,null));};exports[_0x059a('0x21')]=function(_0x3196c7,_0x2c57c6){return db[_0x059a('0x27')][_0x059a('0x41')]({'where':{'id':_0x3196c7[_0x059a('0x44')]['id']}})[_0x059a('0x20')](handleEntityNotFound(_0x2c57c6,null))['then'](removeEntity(_0x2c57c6,null))[_0x059a('0x3e')](handleError(_0x2c57c6,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index ab008ec..689a338 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 _0xa2cb=['request-promise','path','FreshsalesField','freshsales_unique_index','idField','lodash','util','api','moment','bluebird'];(function(_0x26331d,_0x4ff301){var _0x301024=function(_0x1f4376){while(--_0x1f4376){_0x26331d['push'](_0x26331d['shift']());}};_0x301024(++_0x4ff301);}(_0xa2cb,0x7d));var _0xba2c=function(_0x38fded,_0x5725ac){_0x38fded=_0x38fded-0x0;var _0x20356b=_0xa2cb[_0x38fded];return _0x20356b;};'use strict';var _=require(_0xba2c('0x0'));var util=require(_0xba2c('0x1'));var logger=require('../../config/logger')(_0xba2c('0x2'));var moment=require(_0xba2c('0x3'));var BPromise=require(_0xba2c('0x4'));var rp=require(_0xba2c('0x5'));var fs=require('fs');var path=require(_0xba2c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x55034c,_0x21acc2){return _0x55034c['define'](_0xba2c('0x7'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xba2c('0x8'),'fields':[_0xba2c('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88c3=['idField','FieldId','lodash','../../config/logger','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x42da94,_0x337285){var _0x16344b=function(_0x3b93bd){while(--_0x3b93bd){_0x42da94['push'](_0x42da94['shift']());}};_0x16344b(++_0x337285);}(_0x88c3,0x1ee));var _0x388c=function(_0x403bfa,_0x4da74a){_0x403bfa=_0x403bfa-0x0;var _0x3a08f6=_0x88c3[_0x403bfa];return _0x3a08f6;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var logger=require(_0x388c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x388c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x388c('0x3'));var config=require(_0x388c('0x4'));var attributes=require(_0x388c('0x5'));module[_0x388c('0x6')]=function(_0x28ed4d,_0x23199c){return _0x28ed4d['define'](_0x388c('0x7'),attributes,{'tableName':_0x388c('0x8'),'paranoid':![],'indexes':[{'name':_0x388c('0x9'),'fields':[_0x388c('0xa'),_0x388c('0xb')],'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 4893cbd..779a166 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 _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x411207,_0xbba01f){var _0x35ceac=function(_0x182006){while(--_0x182006){_0x411207['push'](_0x411207['shift']());}};_0x35ceac(++_0xbba01f);}(_0x90b1,0x1bb));var _0x190b=function(_0x490d4c,_0x50eb76){_0x490d4c=_0x490d4c-0x0;var _0x540b78=_0x90b1[_0x490d4c];return _0x540b78;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x50e8bf,_0x22514e){var _0x143871=function(_0x103b1b){while(--_0x103b1b){_0x50e8bf['push'](_0x50e8bf['shift']());}};_0x143871(++_0x22514e);}(_0x5fab,0x177));var _0xb5fa=function(_0xe37cad,_0x9fcbdd){_0xe37cad=_0xe37cad-0x0;var _0x24593e=_0x5fab[_0xe37cad];return _0x24593e;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3297441..aa968c0 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2e5d4e,_0x34a2a5){var _0x496acb=function(_0x492fb6){while(--_0x492fb6){_0x2e5d4e['push'](_0x2e5d4e['shift']());}};_0x496acb(++_0x34a2a5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x413597,_0x348039){var _0x5e3705=function(_0x489062){while(--_0x489062){_0x413597['push'](_0x413597['shift']());}};_0x5e3705(++_0x348039);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 69b1315..6984ec8 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 _0x1189=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x5603d3,_0x3187c9){var _0x429ace=function(_0x3e7578){while(--_0x3e7578){_0x5603d3['push'](_0x5603d3['shift']());}};_0x429ace(++_0x3187c9);}(_0x1189,0x17f));var _0x9118=function(_0x50220c,_0x47dfaa){_0x50220c=_0x50220c-0x0;var _0x507949=_0x1189[_0x50220c];return _0x507949;};'use strict';var Sequelize=require(_0x9118('0x0'));module[_0x9118('0x1')]={'name':{'type':Sequelize[_0x9118('0x2')]},'description':{'type':Sequelize[_0x9118('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x9118('0x3')},'remoteUri':{'type':Sequelize[_0x9118('0x2')]},'password':{'type':Sequelize[_0x9118('0x2')]},'clientId':{'type':Sequelize[_0x9118('0x2')]},'clientSecret':{'type':Sequelize[_0x9118('0x2')]},'securityToken':{'type':Sequelize[_0x9118('0x2')]},'serverUrl':{'type':Sequelize[_0x9118('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x9118('0x4'),_0x9118('0x5')),'defaultValue':_0x9118('0x4')}}; \ No newline at end of file +var _0xdafc=['integrationTab','newTab','sequelize','STRING'];(function(_0x356385,_0x258aa9){var _0x53977d=function(_0x1c651a){while(--_0x1c651a){_0x356385['push'](_0x356385['shift']());}};_0x53977d(++_0x258aa9);}(_0xdafc,0x1a6));var _0xcdaf=function(_0x4f46a4,_0x42846a){_0x4f46a4=_0x4f46a4-0x0;var _0x510c1f=_0xdafc[_0x4f46a4];return _0x510c1f;};'use strict';var Sequelize=require(_0xcdaf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcdaf('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xcdaf('0x1')]},'password':{'type':Sequelize[_0xcdaf('0x1')]},'clientId':{'type':Sequelize[_0xcdaf('0x1')]},'clientSecret':{'type':Sequelize[_0xcdaf('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcdaf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xcdaf('0x2'),_0xcdaf('0x3')),'defaultValue':_0xcdaf('0x2')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 14b84ed..197985b 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 _0xb4f7=['False','false','test','statusCode','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','params','keys','options','create','body','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','string','int','picklist','boolean','email','textarea','phone','includes','label','True','true'];(function(_0x483083,_0x5f4dbc){var _0x20e19d=function(_0x209247){while(--_0x209247){_0x483083['push'](_0x483083['shift']());}};_0x20e19d(++_0x5f4dbc);}(_0xb4f7,0xf9));var _0x7b4f=function(_0x2635c0,_0x3086c0){_0x2635c0=_0x2635c0-0x0;var _0x214668=_0xb4f7[_0x2635c0];return _0x214668;};'use strict';var emlformat=require(_0x7b4f('0x0'));var rimraf=require(_0x7b4f('0x1'));var zipdir=require(_0x7b4f('0x2'));var jsonpatch=require(_0x7b4f('0x3'));var rp=require(_0x7b4f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b4f('0x5'));var path=require('path');var sox=require(_0x7b4f('0x6'));var csv=require(_0x7b4f('0x7'));var ejs=require(_0x7b4f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b4f('0x9'));var squel=require(_0x7b4f('0xa'));var crypto=require(_0x7b4f('0xb'));var jsforce=require(_0x7b4f('0xc'));var deskjs=require(_0x7b4f('0xd'));var toCsv=require(_0x7b4f('0x7'));var querystring=require(_0x7b4f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7b4f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b4f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b4f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7b4f('0x12'));var licenseUtil=require(_0x7b4f('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7b4f('0x14'));function respondWithStatusCode(_0x1ce7c6,_0x3ab1b4){_0x3ab1b4=_0x3ab1b4||0xcc;return function(_0x30c7d8){if(_0x30c7d8){return _0x1ce7c6[_0x7b4f('0x15')](_0x3ab1b4);}return _0x1ce7c6[_0x7b4f('0x16')](_0x3ab1b4)['end']();};}function respondWithResult(_0x133a00,_0x25eda8){_0x25eda8=_0x25eda8||0xc8;return function(_0x3834cc){if(_0x3834cc){return _0x133a00[_0x7b4f('0x16')](_0x25eda8)[_0x7b4f('0x17')](_0x3834cc);}};}function respondWithFilteredResult(_0x14f9c6,_0x250a2e){return function(_0x4b5143){if(_0x4b5143){var _0x4f058b=typeof _0x250a2e[_0x7b4f('0x18')]==='undefined'&&typeof _0x250a2e[_0x7b4f('0x19')]==='undefined';var _0x3c8eac=_0x4b5143[_0x7b4f('0x1a')];var _0x3eec0c=_0x4f058b?0x0:_0x250a2e[_0x7b4f('0x18')];var _0x14261f=_0x4f058b?_0x4b5143[_0x7b4f('0x1a')]:_0x250a2e['offset']+_0x250a2e['limit'];var _0x21e541;if(_0x14261f>=_0x3c8eac){_0x14261f=_0x3c8eac;_0x21e541=0xc8;}else{_0x21e541=0xce;}_0x14f9c6[_0x7b4f('0x16')](_0x21e541);return _0x14f9c6[_0x7b4f('0x1b')](_0x7b4f('0x1c'),_0x3eec0c+'-'+_0x14261f+'/'+_0x3c8eac)[_0x7b4f('0x17')](_0x4b5143);}return null;};}function patchUpdates(_0x2c96b7){return function(_0x249154){try{jsonpatch[_0x7b4f('0x1d')](_0x249154,_0x2c96b7,!![]);}catch(_0x3d8100){return BPromise[_0x7b4f('0x1e')](_0x3d8100);}return _0x249154[_0x7b4f('0x1f')]();};}function saveUpdates(_0x3d699d,_0x157e58){return function(_0x2cf708){if(_0x2cf708){return _0x2cf708[_0x7b4f('0x20')](_0x3d699d)[_0x7b4f('0x21')](function(_0x490e5a){return _0x490e5a;});}return null;};}function removeEntity(_0x121e84,_0x2c0a6f){return function(_0x522319){if(_0x522319){return _0x522319[_0x7b4f('0x22')]()['then'](function(){_0x121e84[_0x7b4f('0x16')](0xcc)[_0x7b4f('0x23')]();});}};}function handleEntityNotFound(_0x283e49,_0x157284){return function(_0x373751){if(!_0x373751){_0x283e49[_0x7b4f('0x15')](0x194);}return _0x373751;};}function handleError(_0x2a774d,_0x4993fe){_0x4993fe=_0x4993fe||0x1f4;return function(_0x4ddcd1){logger[_0x7b4f('0x24')](_0x4ddcd1[_0x7b4f('0x25')]);if(_0x4ddcd1['name']){delete _0x4ddcd1[_0x7b4f('0x26')];}_0x2a774d[_0x7b4f('0x16')](_0x4993fe)[_0x7b4f('0x27')](_0x4ddcd1);};}exports[_0x7b4f('0x28')]=function(_0x24ec20,_0x11956e){var _0x53bc09={},_0x5c8d8c={},_0x263e7b={'count':0x0,'rows':[]};var _0x1fcf34=_[_0x7b4f('0x29')](db[_0x7b4f('0x2a')][_0x7b4f('0x2b')],function(_0x30b899){return{'name':_0x30b899[_0x7b4f('0x2c')],'type':_0x30b899[_0x7b4f('0x2d')][_0x7b4f('0x2e')]};});_0x5c8d8c['model']=_[_0x7b4f('0x29')](_0x1fcf34,'name');_0x5c8d8c[_0x7b4f('0x2f')]=_['keys'](_0x24ec20[_0x7b4f('0x2f')]);_0x5c8d8c[_0x7b4f('0x30')]=_[_0x7b4f('0x31')](_0x5c8d8c[_0x7b4f('0x32')],_0x5c8d8c[_0x7b4f('0x2f')]);_0x53bc09[_0x7b4f('0x33')]=_[_0x7b4f('0x31')](_0x5c8d8c[_0x7b4f('0x32')],qs[_0x7b4f('0x34')](_0x24ec20[_0x7b4f('0x2f')]['fields']));_0x53bc09[_0x7b4f('0x33')]=_0x53bc09['attributes'][_0x7b4f('0x35')]?_0x53bc09['attributes']:_0x5c8d8c[_0x7b4f('0x32')];if(!_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x36')](_0x7b4f('0x37'))){_0x53bc09[_0x7b4f('0x19')]=qs[_0x7b4f('0x19')](_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x19')]);_0x53bc09[_0x7b4f('0x18')]=qs[_0x7b4f('0x18')](_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x18')]);}_0x53bc09[_0x7b4f('0x38')]=qs['sort'](_0x24ec20['query'][_0x7b4f('0x39')]);_0x53bc09[_0x7b4f('0x3a')]=qs[_0x7b4f('0x30')](_[_0x7b4f('0x3b')](_0x24ec20[_0x7b4f('0x2f')],_0x5c8d8c[_0x7b4f('0x30')]),_0x1fcf34);if(_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x3c')]){_0x53bc09[_0x7b4f('0x3a')]=_['merge'](_0x53bc09[_0x7b4f('0x3a')],{'$or':_[_0x7b4f('0x29')](_0x1fcf34,function(_0xcb5e6){if(_0xcb5e6[_0x7b4f('0x2d')]!=='VIRTUAL'){var _0x4f85a7={};_0x4f85a7[_0xcb5e6['name']]={'$like':'%'+_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x3c')]+'%'};return _0x4f85a7;}})});}_0x53bc09=_[_0x7b4f('0x3d')]({},_0x53bc09,_0x24ec20['options']);var _0x4276f4={'where':_0x53bc09[_0x7b4f('0x3a')]};return db[_0x7b4f('0x2a')][_0x7b4f('0x1a')](_0x4276f4)[_0x7b4f('0x21')](function(_0x200a9d){_0x263e7b[_0x7b4f('0x1a')]=_0x200a9d;if(_0x24ec20[_0x7b4f('0x2f')][_0x7b4f('0x3e')]){_0x53bc09[_0x7b4f('0x3f')]=[{'all':!![]}];}return db[_0x7b4f('0x2a')][_0x7b4f('0x40')](_0x53bc09);})[_0x7b4f('0x21')](function(_0x2ddd63){_0x263e7b['rows']=_0x2ddd63;return _0x263e7b;})[_0x7b4f('0x21')](respondWithFilteredResult(_0x11956e,_0x53bc09))[_0x7b4f('0x41')](handleError(_0x11956e,null));};exports['show']=function(_0x119f31,_0x337f88){var _0x2ca8ae={'raw':![],'where':{'id':_0x119f31[_0x7b4f('0x42')]['id']}},_0x332d0b={};_0x332d0b[_0x7b4f('0x32')]=_['keys'](db[_0x7b4f('0x2a')][_0x7b4f('0x2b')]);_0x332d0b[_0x7b4f('0x2f')]=_[_0x7b4f('0x43')](_0x119f31[_0x7b4f('0x2f')]);_0x332d0b[_0x7b4f('0x30')]=_[_0x7b4f('0x31')](_0x332d0b[_0x7b4f('0x32')],_0x332d0b[_0x7b4f('0x2f')]);_0x2ca8ae['attributes']=_[_0x7b4f('0x31')](_0x332d0b['model'],qs[_0x7b4f('0x34')](_0x119f31[_0x7b4f('0x2f')][_0x7b4f('0x34')]));_0x2ca8ae[_0x7b4f('0x33')]=_0x2ca8ae[_0x7b4f('0x33')][_0x7b4f('0x35')]?_0x2ca8ae['attributes']:_0x332d0b['model'];if(_0x119f31[_0x7b4f('0x2f')]['includeAll']){_0x2ca8ae[_0x7b4f('0x3f')]=[{'all':!![]}];}_0x2ca8ae=_['merge']({},_0x2ca8ae,_0x119f31[_0x7b4f('0x44')]);return db[_0x7b4f('0x2a')]['find'](_0x2ca8ae)[_0x7b4f('0x21')](handleEntityNotFound(_0x337f88,null))[_0x7b4f('0x21')](respondWithResult(_0x337f88,null))[_0x7b4f('0x41')](handleError(_0x337f88,null));};exports['create']=function(_0x4480e9,_0x101ef9){return db[_0x7b4f('0x2a')][_0x7b4f('0x45')](_0x4480e9[_0x7b4f('0x46')],{})['then'](respondWithResult(_0x101ef9,0xc9))[_0x7b4f('0x41')](handleError(_0x101ef9,null));};exports[_0x7b4f('0x20')]=function(_0x4b71ac,_0x440e91){if(_0x4b71ac['body']['id']){delete _0x4b71ac[_0x7b4f('0x46')]['id'];}return db[_0x7b4f('0x2a')][_0x7b4f('0x47')]({'where':{'id':_0x4b71ac[_0x7b4f('0x42')]['id']}})[_0x7b4f('0x21')](handleEntityNotFound(_0x440e91,null))[_0x7b4f('0x21')](saveUpdates(_0x4b71ac[_0x7b4f('0x46')],null))[_0x7b4f('0x21')](respondWithResult(_0x440e91,null))[_0x7b4f('0x41')](handleError(_0x440e91,null));};exports[_0x7b4f('0x22')]=function(_0x12dbd6,_0x5a90ed){return db[_0x7b4f('0x2a')][_0x7b4f('0x47')]({'where':{'id':_0x12dbd6['params']['id']}})[_0x7b4f('0x21')](handleEntityNotFound(_0x5a90ed,null))['then'](removeEntity(_0x5a90ed,null))[_0x7b4f('0x41')](handleError(_0x5a90ed,null));};exports[_0x7b4f('0x48')]=function(_0x2d7063,_0x204253,_0x45e447){var _0x4532be={};var _0x3649b9={};var _0x5972e7;var _0x3c0972;return db[_0x7b4f('0x2a')][_0x7b4f('0x49')]({'where':{'id':_0x2d7063[_0x7b4f('0x42')]['id']}})[_0x7b4f('0x21')](handleEntityNotFound(_0x204253,null))[_0x7b4f('0x21')](function(_0x2359aa){if(_0x2359aa){_0x5972e7=_0x2359aa;_0x3649b9[_0x7b4f('0x32')]=_['keys'](db[_0x7b4f('0x4a')]['rawAttributes']);_0x3649b9[_0x7b4f('0x2f')]=_[_0x7b4f('0x43')](_0x2d7063[_0x7b4f('0x2f')]);_0x3649b9['filters']=_[_0x7b4f('0x31')](_0x3649b9[_0x7b4f('0x32')],_0x3649b9[_0x7b4f('0x2f')]);_0x4532be[_0x7b4f('0x33')]=_[_0x7b4f('0x31')](_0x3649b9[_0x7b4f('0x32')],qs[_0x7b4f('0x34')](_0x2d7063[_0x7b4f('0x2f')][_0x7b4f('0x34')]));_0x4532be[_0x7b4f('0x33')]=_0x4532be[_0x7b4f('0x33')][_0x7b4f('0x35')]?_0x4532be['attributes']:_0x3649b9['model'];_0x4532be[_0x7b4f('0x38')]=qs[_0x7b4f('0x39')](_0x2d7063[_0x7b4f('0x2f')]['sort']);_0x4532be[_0x7b4f('0x3a')]=qs[_0x7b4f('0x30')](_[_0x7b4f('0x3b')](_0x2d7063[_0x7b4f('0x2f')],_0x3649b9[_0x7b4f('0x30')]));if(_0x2d7063['query'][_0x7b4f('0x3c')]){_0x4532be[_0x7b4f('0x3a')]=_[_0x7b4f('0x3d')](_0x4532be[_0x7b4f('0x3a')],{'$or':_[_0x7b4f('0x29')](_0x4532be[_0x7b4f('0x33')],function(_0x5b6074){var _0x47dd76={};_0x47dd76[_0x5b6074]={'$like':'%'+_0x2d7063['query'][_0x7b4f('0x3c')]+'%'};return _0x47dd76;})});}_0x4532be=_[_0x7b4f('0x3d')]({},_0x4532be,_0x2d7063[_0x7b4f('0x44')]);return _0x5972e7['getConfigurations'](_0x4532be);}})[_0x7b4f('0x21')](function(_0x386054){if(_0x386054){_0x3c0972=_0x386054[_0x7b4f('0x35')];if(!_0x2d7063[_0x7b4f('0x2f')][_0x7b4f('0x36')](_0x7b4f('0x37'))){_0x4532be[_0x7b4f('0x19')]=qs[_0x7b4f('0x19')](_0x2d7063[_0x7b4f('0x2f')][_0x7b4f('0x19')]);_0x4532be[_0x7b4f('0x18')]=qs[_0x7b4f('0x18')](_0x2d7063[_0x7b4f('0x2f')][_0x7b4f('0x18')]);}return _0x5972e7[_0x7b4f('0x48')](_0x4532be);}})['then'](function(_0x53b3a7){if(_0x53b3a7){return _0x53b3a7?{'count':_0x3c0972,'rows':_0x53b3a7}:null;}})[_0x7b4f('0x21')](respondWithResult(_0x204253,null))[_0x7b4f('0x41')](handleError(_0x204253,null));};exports[_0x7b4f('0x4b')]=function(_0x19d8ba,_0x3e2fc2,_0x22d111){if(_0x19d8ba['body']['id']){delete _0x19d8ba[_0x7b4f('0x46')]['id'];}return db[_0x7b4f('0x2a')]['findOne']({'where':{'id':_0x19d8ba[_0x7b4f('0x42')]['id']}})[_0x7b4f('0x21')](handleEntityNotFound(_0x3e2fc2,null))[_0x7b4f('0x21')](function(_0xb8249a){if(_0xb8249a){_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x4c')]=_0xb8249a['id'];_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x4d')]=integrations[_0x7b4f('0x4e')](_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x4f')],_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x2d')]);_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x50')]=integrations[_0x7b4f('0x51')](_0x19d8ba[_0x7b4f('0x46')][_0x7b4f('0x4f')],_0x19d8ba['body'][_0x7b4f('0x2d')]);return db['SalesforceConfiguration'][_0x7b4f('0x45')](_0x19d8ba[_0x7b4f('0x46')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0x7b4f('0x52')],'as':'Descriptions'}]});}return null;})[_0x7b4f('0x21')](respondWithResult(_0x3e2fc2,null))[_0x7b4f('0x41')](handleError(_0x3e2fc2,null));};exports['getFields']=function(_0x3be936,_0x2d4a87,_0x14dfb4){var _0x3c72f2;var _0x25897c='';var _0x181444=_0x7b4f('0x53');return db[_0x7b4f('0x2a')][_0x7b4f('0x49')]({'where':{'id':_0x3be936[_0x7b4f('0x42')]['id']},'attributes':['id',_0x7b4f('0x54'),_0x7b4f('0x55'),_0x7b4f('0x56'),_0x7b4f('0x57'),_0x7b4f('0x58'),_0x7b4f('0x59')]})['then'](handleEntityNotFound(_0x2d4a87,null))[_0x7b4f('0x21')](function(_0x20e65a){if(_0x20e65a){_0x25897c=_0x20e65a[_0x7b4f('0x54')];var _0x5a377d=_0x25897c[_0x7b4f('0x5a')](-0x1);if(_0x5a377d==='/'){_0x25897c=_0x25897c[_0x7b4f('0x5b')](0x0,_0x25897c[_0x7b4f('0x5c')](_0x5a377d));}_0x3c72f2=new jsforce[(_0x7b4f('0x5d'))]({'oauth2':{'loginUrl':_0x25897c,'clientId':_0x20e65a['clientId'],'clientSecret':_0x20e65a[_0x7b4f('0x56')]}});return _0x3c72f2[_0x7b4f('0x5e')](_0x20e65a[_0x7b4f('0x57')],_0x20e65a[_0x7b4f('0x58')][_0x7b4f('0x5f')](_0x20e65a['securityToken']));}})[_0x7b4f('0x21')](function(_0x8bb8c2){if(_0x8bb8c2){if(!_[_0x7b4f('0x60')](_0x3be936['query'][_0x7b4f('0x61')])){_0x181444=_0x3be936[_0x7b4f('0x2f')][_0x7b4f('0x61')];}return _0x3c72f2[_0x7b4f('0x62')](_0x181444)[_0x7b4f('0x63')]();}})[_0x7b4f('0x21')](function(_0x4553ab){var _0x151821=[_0x7b4f('0x64'),_0x7b4f('0x65'),'IsReminderSet',_0x7b4f('0x66'),'Subject','Description'];var _0x34f4d8=[_0x7b4f('0x67'),_0x7b4f('0x68'),_0x7b4f('0x69'),_0x7b4f('0x6a'),_0x7b4f('0x6b'),_0x7b4f('0x6c'),_0x7b4f('0x6d')];if(_0x4553ab){_['remove'](_0x4553ab['fields'],function(_0x5af6d3){return _0x151821['includes'](_0x5af6d3['name'])||!_0x34f4d8[_0x7b4f('0x6e')](_0x5af6d3[_0x7b4f('0x2d')]);});return{'count':_0x4553ab[_0x7b4f('0x34')]['length'],'rows':_['map'](_0x4553ab['fields'],function(_0x273605){return{'id':_0x273605[_0x7b4f('0x26')],'name':_0x273605[_0x7b4f('0x6f')],'custom':_0x273605['custom'],'options':_0x273605['picklistValues']['length']>0x0?_[_0x7b4f('0x29')](_0x273605['picklistValues'],function(_0x50f79f){return{'name':_0x50f79f[_0x7b4f('0x6f')],'value':_0x50f79f['value']};}):_0x273605['type']=='boolean'?[{'name':_0x7b4f('0x70'),'value':_0x7b4f('0x71')},{'name':_0x7b4f('0x72'),'value':_0x7b4f('0x73')}]:[]};})};}})[_0x7b4f('0x21')](respondWithResult(_0x2d4a87,null))[_0x7b4f('0x41')](function(_0x5f5cbe){var _0x179007=_0x3be936['query'][_0x7b4f('0x74')]?0x1f4:_0x5f5cbe[_0x7b4f('0x75')]||0x1f4;logger[_0x7b4f('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x7b4f('0x76'),_0x179007,JSON[_0x7b4f('0x77')](_0x5f5cbe));delete _0x5f5cbe[_0x7b4f('0x26')];if(_0x179007===0x191){_0x179007=0x190;}_0x2d4a87['status'](_0x179007)[_0x7b4f('0x27')](_0x3be936[_0x7b4f('0x2f')][_0x7b4f('0x74')]?{'message':_0x7b4f('0x78'),'statusCode':_0x5f5cbe[_0x7b4f('0x75')]}:_0x5f5cbe);});}; \ No newline at end of file +var _0x0d61=['SalesforceAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','findOne','SalesforceConfiguration','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','username','password','slice','clientSecret','login','concat','securityToken','isNil','ticketType','OwnerId','IsReminderSet','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','picklistValues','label','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','map'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x0d61,0x14f));var _0x10d6=function(_0x2b7d9d,_0x224257){_0x2b7d9d=_0x2b7d9d-0x0;var _0xea8f90=_0x0d61[_0x2b7d9d];return _0xea8f90;};'use strict';var emlformat=require(_0x10d6('0x0'));var rimraf=require(_0x10d6('0x1'));var zipdir=require(_0x10d6('0x2'));var jsonpatch=require(_0x10d6('0x3'));var rp=require(_0x10d6('0x4'));var moment=require(_0x10d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x10d6('0x6'));var util=require(_0x10d6('0x7'));var path=require(_0x10d6('0x8'));var sox=require(_0x10d6('0x9'));var csv=require('to-csv');var ejs=require(_0x10d6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x10d6('0xb'));var squel=require(_0x10d6('0xc'));var crypto=require(_0x10d6('0xd'));var jsforce=require(_0x10d6('0xe'));var deskjs=require(_0x10d6('0xf'));var toCsv=require(_0x10d6('0x10'));var querystring=require(_0x10d6('0x11'));var Papa=require(_0x10d6('0x12'));var Redis=require(_0x10d6('0x13'));var authService=require(_0x10d6('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10d6('0x15'));var logger=require(_0x10d6('0x16'))('api');var utils=require(_0x10d6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x10d6('0x18'));var db=require(_0x10d6('0x19'))['db'];var integrations=require(_0x10d6('0x1a'));function respondWithStatusCode(_0x294417,_0x4d161e){_0x4d161e=_0x4d161e||0xcc;return function(_0x540b07){if(_0x540b07){return _0x294417[_0x10d6('0x1b')](_0x4d161e);}return _0x294417[_0x10d6('0x1c')](_0x4d161e)[_0x10d6('0x1d')]();};}function respondWithResult(_0x5ac6f8,_0x2614a7){_0x2614a7=_0x2614a7||0xc8;return function(_0x790530){if(_0x790530){return _0x5ac6f8[_0x10d6('0x1c')](_0x2614a7)['json'](_0x790530);}};}function respondWithFilteredResult(_0x511ad2,_0x5d88dc){return function(_0xd9d4c1){if(_0xd9d4c1){var _0x9ae751=typeof _0x5d88dc['offset']===_0x10d6('0x1e')&&typeof _0x5d88dc[_0x10d6('0x1f')]===_0x10d6('0x1e');var _0x4b109c=_0xd9d4c1['count'];var _0xd8abc9=_0x9ae751?0x0:_0x5d88dc[_0x10d6('0x20')];var _0x30906e=_0x9ae751?_0xd9d4c1['count']:_0x5d88dc[_0x10d6('0x20')]+_0x5d88dc['limit'];var _0x2ad53c;if(_0x30906e>=_0x4b109c){_0x30906e=_0x4b109c;_0x2ad53c=0xc8;}else{_0x2ad53c=0xce;}_0x511ad2[_0x10d6('0x1c')](_0x2ad53c);return _0x511ad2[_0x10d6('0x21')](_0x10d6('0x22'),_0xd8abc9+'-'+_0x30906e+'/'+_0x4b109c)[_0x10d6('0x23')](_0xd9d4c1);}return null;};}function patchUpdates(_0x46a73d){return function(_0x1972b9){try{jsonpatch[_0x10d6('0x24')](_0x1972b9,_0x46a73d,!![]);}catch(_0x2110e7){return BPromise[_0x10d6('0x25')](_0x2110e7);}return _0x1972b9[_0x10d6('0x26')]();};}function saveUpdates(_0x23b8ea,_0x59bc73){return function(_0x45828e){if(_0x45828e){return _0x45828e['update'](_0x23b8ea)['then'](function(_0x5e4ca8){return _0x5e4ca8;});}return null;};}function removeEntity(_0x12a431,_0xc5a018){return function(_0x673aa0){if(_0x673aa0){return _0x673aa0[_0x10d6('0x27')]()[_0x10d6('0x28')](function(){_0x12a431[_0x10d6('0x1c')](0xcc)[_0x10d6('0x1d')]();});}};}function handleEntityNotFound(_0x22369b,_0x252df0){return function(_0x573a2e){if(!_0x573a2e){_0x22369b[_0x10d6('0x1b')](0x194);}return _0x573a2e;};}function handleError(_0x1728c0,_0x1af0d0){_0x1af0d0=_0x1af0d0||0x1f4;return function(_0x149c4d){logger[_0x10d6('0x29')](_0x149c4d[_0x10d6('0x2a')]);if(_0x149c4d[_0x10d6('0x2b')]){delete _0x149c4d[_0x10d6('0x2b')];}_0x1728c0[_0x10d6('0x1c')](_0x1af0d0)[_0x10d6('0x2c')](_0x149c4d);};}exports['index']=function(_0x3b38f9,_0x4ac2b3){var _0x1e0026={},_0x1207dc={},_0xb05d85={'count':0x0,'rows':[]};var _0x373b40=_[_0x10d6('0x2d')](db[_0x10d6('0x2e')][_0x10d6('0x2f')],function(_0x580f70){return{'name':_0x580f70['fieldName'],'type':_0x580f70[_0x10d6('0x30')][_0x10d6('0x31')]};});_0x1207dc[_0x10d6('0x32')]=_[_0x10d6('0x2d')](_0x373b40,_0x10d6('0x2b'));_0x1207dc['query']=_['keys'](_0x3b38f9[_0x10d6('0x33')]);_0x1207dc[_0x10d6('0x34')]=_[_0x10d6('0x35')](_0x1207dc[_0x10d6('0x32')],_0x1207dc[_0x10d6('0x33')]);_0x1e0026[_0x10d6('0x36')]=_[_0x10d6('0x35')](_0x1207dc[_0x10d6('0x32')],qs['fields'](_0x3b38f9[_0x10d6('0x33')][_0x10d6('0x37')]));_0x1e0026[_0x10d6('0x36')]=_0x1e0026[_0x10d6('0x36')][_0x10d6('0x38')]?_0x1e0026[_0x10d6('0x36')]:_0x1207dc[_0x10d6('0x32')];if(!_0x3b38f9[_0x10d6('0x33')][_0x10d6('0x39')](_0x10d6('0x3a'))){_0x1e0026[_0x10d6('0x1f')]=qs[_0x10d6('0x1f')](_0x3b38f9['query'][_0x10d6('0x1f')]);_0x1e0026['offset']=qs[_0x10d6('0x20')](_0x3b38f9['query'][_0x10d6('0x20')]);}_0x1e0026['order']=qs[_0x10d6('0x3b')](_0x3b38f9[_0x10d6('0x33')]['sort']);_0x1e0026[_0x10d6('0x3c')]=qs[_0x10d6('0x34')](_[_0x10d6('0x3d')](_0x3b38f9['query'],_0x1207dc[_0x10d6('0x34')]),_0x373b40);if(_0x3b38f9[_0x10d6('0x33')][_0x10d6('0x3e')]){_0x1e0026['where']=_[_0x10d6('0x3f')](_0x1e0026[_0x10d6('0x3c')],{'$or':_['map'](_0x373b40,function(_0x36f71f){if(_0x36f71f[_0x10d6('0x30')]!==_0x10d6('0x40')){var _0x5481e3={};_0x5481e3[_0x36f71f[_0x10d6('0x2b')]]={'$like':'%'+_0x3b38f9[_0x10d6('0x33')][_0x10d6('0x3e')]+'%'};return _0x5481e3;}})});}_0x1e0026=_[_0x10d6('0x3f')]({},_0x1e0026,_0x3b38f9[_0x10d6('0x41')]);var _0x540c3a={'where':_0x1e0026[_0x10d6('0x3c')]};return db[_0x10d6('0x2e')][_0x10d6('0x42')](_0x540c3a)[_0x10d6('0x28')](function(_0x57cc21){_0xb05d85[_0x10d6('0x42')]=_0x57cc21;if(_0x3b38f9['query'][_0x10d6('0x43')]){_0x1e0026[_0x10d6('0x44')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x10d6('0x45')](_0x1e0026);})[_0x10d6('0x28')](function(_0x31ea89){_0xb05d85[_0x10d6('0x46')]=_0x31ea89;return _0xb05d85;})[_0x10d6('0x28')](respondWithFilteredResult(_0x4ac2b3,_0x1e0026))['catch'](handleError(_0x4ac2b3,null));};exports[_0x10d6('0x47')]=function(_0x1a8eca,_0x214b52){var _0x4333e1={'raw':![],'where':{'id':_0x1a8eca[_0x10d6('0x48')]['id']}},_0x59b476={};_0x59b476['model']=_[_0x10d6('0x49')](db[_0x10d6('0x2e')][_0x10d6('0x2f')]);_0x59b476[_0x10d6('0x33')]=_[_0x10d6('0x49')](_0x1a8eca['query']);_0x59b476[_0x10d6('0x34')]=_[_0x10d6('0x35')](_0x59b476[_0x10d6('0x32')],_0x59b476[_0x10d6('0x33')]);_0x4333e1['attributes']=_[_0x10d6('0x35')](_0x59b476['model'],qs['fields'](_0x1a8eca[_0x10d6('0x33')]['fields']));_0x4333e1[_0x10d6('0x36')]=_0x4333e1[_0x10d6('0x36')]['length']?_0x4333e1['attributes']:_0x59b476[_0x10d6('0x32')];if(_0x1a8eca['query'][_0x10d6('0x43')]){_0x4333e1[_0x10d6('0x44')]=[{'all':!![]}];}_0x4333e1=_[_0x10d6('0x3f')]({},_0x4333e1,_0x1a8eca[_0x10d6('0x41')]);return db[_0x10d6('0x2e')][_0x10d6('0x4a')](_0x4333e1)[_0x10d6('0x28')](handleEntityNotFound(_0x214b52,null))['then'](respondWithResult(_0x214b52,null))[_0x10d6('0x4b')](handleError(_0x214b52,null));};exports[_0x10d6('0x4c')]=function(_0x351257,_0x5833a6){return db['SalesforceAccount'][_0x10d6('0x4c')](_0x351257[_0x10d6('0x4d')],{})[_0x10d6('0x28')](respondWithResult(_0x5833a6,0xc9))[_0x10d6('0x4b')](handleError(_0x5833a6,null));};exports[_0x10d6('0x4e')]=function(_0x4f2678,_0x3ed7e1){if(_0x4f2678[_0x10d6('0x4d')]['id']){delete _0x4f2678[_0x10d6('0x4d')]['id'];}return db[_0x10d6('0x2e')]['find']({'where':{'id':_0x4f2678[_0x10d6('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ed7e1,null))[_0x10d6('0x28')](saveUpdates(_0x4f2678[_0x10d6('0x4d')],null))[_0x10d6('0x28')](respondWithResult(_0x3ed7e1,null))['catch'](handleError(_0x3ed7e1,null));};exports[_0x10d6('0x27')]=function(_0x4d7313,_0x143d68){return db[_0x10d6('0x2e')][_0x10d6('0x4a')]({'where':{'id':_0x4d7313[_0x10d6('0x48')]['id']}})[_0x10d6('0x28')](handleEntityNotFound(_0x143d68,null))[_0x10d6('0x28')](removeEntity(_0x143d68,null))['catch'](handleError(_0x143d68,null));};exports['getConfigurations']=function(_0x1547ae,_0x5dc844,_0x308a39){var _0x5ee5d6={};var _0x36790d={};var _0x5000f8;var _0x44a84d;return db[_0x10d6('0x2e')][_0x10d6('0x4f')]({'where':{'id':_0x1547ae['params']['id']}})['then'](handleEntityNotFound(_0x5dc844,null))['then'](function(_0x33bf24){if(_0x33bf24){_0x5000f8=_0x33bf24;_0x36790d['model']=_[_0x10d6('0x49')](db[_0x10d6('0x50')][_0x10d6('0x2f')]);_0x36790d[_0x10d6('0x33')]=_[_0x10d6('0x49')](_0x1547ae[_0x10d6('0x33')]);_0x36790d['filters']=_['intersection'](_0x36790d[_0x10d6('0x32')],_0x36790d[_0x10d6('0x33')]);_0x5ee5d6[_0x10d6('0x36')]=_[_0x10d6('0x35')](_0x36790d[_0x10d6('0x32')],qs[_0x10d6('0x37')](_0x1547ae[_0x10d6('0x33')][_0x10d6('0x37')]));_0x5ee5d6[_0x10d6('0x36')]=_0x5ee5d6[_0x10d6('0x36')][_0x10d6('0x38')]?_0x5ee5d6[_0x10d6('0x36')]:_0x36790d[_0x10d6('0x32')];_0x5ee5d6[_0x10d6('0x51')]=qs['sort'](_0x1547ae['query']['sort']);_0x5ee5d6[_0x10d6('0x3c')]=qs[_0x10d6('0x34')](_[_0x10d6('0x3d')](_0x1547ae[_0x10d6('0x33')],_0x36790d['filters']));if(_0x1547ae['query'][_0x10d6('0x3e')]){_0x5ee5d6[_0x10d6('0x3c')]=_[_0x10d6('0x3f')](_0x5ee5d6[_0x10d6('0x3c')],{'$or':_[_0x10d6('0x2d')](_0x5ee5d6[_0x10d6('0x36')],function(_0xfdb8ad){var _0x2adccc={};_0x2adccc[_0xfdb8ad]={'$like':'%'+_0x1547ae[_0x10d6('0x33')][_0x10d6('0x3e')]+'%'};return _0x2adccc;})});}_0x5ee5d6=_[_0x10d6('0x3f')]({},_0x5ee5d6,_0x1547ae[_0x10d6('0x41')]);return _0x5000f8['getConfigurations'](_0x5ee5d6);}})['then'](function(_0x353a39){if(_0x353a39){_0x44a84d=_0x353a39[_0x10d6('0x38')];if(!_0x1547ae[_0x10d6('0x33')][_0x10d6('0x39')]('nolimit')){_0x5ee5d6['limit']=qs[_0x10d6('0x1f')](_0x1547ae[_0x10d6('0x33')][_0x10d6('0x1f')]);_0x5ee5d6[_0x10d6('0x20')]=qs[_0x10d6('0x20')](_0x1547ae['query'][_0x10d6('0x20')]);}return _0x5000f8[_0x10d6('0x52')](_0x5ee5d6);}})[_0x10d6('0x28')](function(_0x1ea1d3){if(_0x1ea1d3){return _0x1ea1d3?{'count':_0x44a84d,'rows':_0x1ea1d3}:null;}})[_0x10d6('0x28')](respondWithResult(_0x5dc844,null))[_0x10d6('0x4b')](handleError(_0x5dc844,null));};exports[_0x10d6('0x53')]=function(_0x12af4e,_0x5da974,_0x3d71d1){if(_0x12af4e['body']['id']){delete _0x12af4e[_0x10d6('0x4d')]['id'];}return db['SalesforceAccount'][_0x10d6('0x4f')]({'where':{'id':_0x12af4e[_0x10d6('0x48')]['id']}})[_0x10d6('0x28')](handleEntityNotFound(_0x5da974,null))[_0x10d6('0x28')](function(_0xc4cfb0){if(_0xc4cfb0){_0x12af4e[_0x10d6('0x4d')][_0x10d6('0x54')]=_0xc4cfb0['id'];_0x12af4e[_0x10d6('0x4d')][_0x10d6('0x55')]=integrations[_0x10d6('0x56')](_0x12af4e[_0x10d6('0x4d')][_0x10d6('0x57')],_0x12af4e[_0x10d6('0x4d')][_0x10d6('0x30')]);_0x12af4e[_0x10d6('0x4d')]['Descriptions']=integrations[_0x10d6('0x58')](_0x12af4e[_0x10d6('0x4d')]['channel'],_0x12af4e[_0x10d6('0x4d')][_0x10d6('0x30')]);return db[_0x10d6('0x50')]['create'](_0x12af4e[_0x10d6('0x4d')],{'include':[{'model':db[_0x10d6('0x59')],'as':_0x10d6('0x55')},{'model':db[_0x10d6('0x59')],'as':_0x10d6('0x5a')}]});}return null;})[_0x10d6('0x28')](respondWithResult(_0x5da974,null))[_0x10d6('0x4b')](handleError(_0x5da974,null));};exports[_0x10d6('0x5b')]=function(_0xad76b2,_0x2b7149,_0x170870){var _0xc78c5f;var _0x234ecf='';var _0x4c86f4=_0x10d6('0x5c');return db[_0x10d6('0x2e')][_0x10d6('0x4f')]({'where':{'id':_0xad76b2[_0x10d6('0x48')]['id']},'attributes':['id',_0x10d6('0x5d'),_0x10d6('0x5e'),'clientSecret',_0x10d6('0x5f'),_0x10d6('0x60'),'securityToken']})['then'](handleEntityNotFound(_0x2b7149,null))[_0x10d6('0x28')](function(_0x333027){if(_0x333027){_0x234ecf=_0x333027['remoteUri'];var _0x241dad=_0x234ecf[_0x10d6('0x61')](-0x1);if(_0x241dad==='/'){_0x234ecf=_0x234ecf['substring'](0x0,_0x234ecf['lastIndexOf'](_0x241dad));}_0xc78c5f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x234ecf,'clientId':_0x333027[_0x10d6('0x5e')],'clientSecret':_0x333027[_0x10d6('0x62')]}});return _0xc78c5f[_0x10d6('0x63')](_0x333027[_0x10d6('0x5f')],_0x333027['password'][_0x10d6('0x64')](_0x333027[_0x10d6('0x65')]));}})[_0x10d6('0x28')](function(_0x471512){if(_0x471512){if(!_[_0x10d6('0x66')](_0xad76b2['query'][_0x10d6('0x67')])){_0x4c86f4=_0xad76b2[_0x10d6('0x33')][_0x10d6('0x67')];}return _0xc78c5f['sobject'](_0x4c86f4)['describe']();}})[_0x10d6('0x28')](function(_0x2b1bfe){var _0x412c21=[_0x10d6('0x68'),'ActivityDate',_0x10d6('0x69'),'IsRecurrence',_0x10d6('0x6a'),_0x10d6('0x6b')];var _0x2a630c=[_0x10d6('0x6c'),_0x10d6('0x6d'),_0x10d6('0x6e'),_0x10d6('0x6f'),'email',_0x10d6('0x70'),_0x10d6('0x71')];if(_0x2b1bfe){_[_0x10d6('0x72')](_0x2b1bfe['fields'],function(_0x3a421f){return _0x412c21[_0x10d6('0x73')](_0x3a421f[_0x10d6('0x2b')])||!_0x2a630c['includes'](_0x3a421f[_0x10d6('0x30')]);});return{'count':_0x2b1bfe[_0x10d6('0x37')][_0x10d6('0x38')],'rows':_[_0x10d6('0x2d')](_0x2b1bfe[_0x10d6('0x37')],function(_0x55187d){return{'id':_0x55187d[_0x10d6('0x2b')],'name':_0x55187d['label'],'custom':_0x55187d['custom'],'options':_0x55187d['picklistValues'][_0x10d6('0x38')]>0x0?_[_0x10d6('0x2d')](_0x55187d[_0x10d6('0x74')],function(_0x9eec07){return{'name':_0x9eec07[_0x10d6('0x75')],'value':_0x9eec07[_0x10d6('0x76')]};}):_0x55187d['type']==_0x10d6('0x6f')?[{'name':_0x10d6('0x77'),'value':_0x10d6('0x78')},{'name':'False','value':_0x10d6('0x79')}]:[]};})};}})[_0x10d6('0x28')](respondWithResult(_0x2b7149,null))[_0x10d6('0x4b')](function(_0x2fbe3c){var _0xff938d=_0xad76b2['query'][_0x10d6('0x7a')]?0x1f4:_0x2fbe3c[_0x10d6('0x7b')]||0x1f4;logger[_0x10d6('0x29')](_0x10d6('0x7c'),_0x10d6('0x5b'),_0xff938d,JSON[_0x10d6('0x7d')](_0x2fbe3c));delete _0x2fbe3c['name'];if(_0xff938d===0x191){_0xff938d=0x190;}_0x2b7149[_0x10d6('0x1c')](_0xff938d)[_0x10d6('0x2c')](_0xad76b2[_0x10d6('0x33')]['test']?{'message':_0x10d6('0x7e'),'statusCode':_0x2fbe3c[_0x10d6('0x7b')]}:_0x2fbe3c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 905ceb0..667e362 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 _0x5752=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4557dc,_0x3687b2){var _0x1377aa=function(_0x41c62a){while(--_0x41c62a){_0x4557dc['push'](_0x4557dc['shift']());}};_0x1377aa(++_0x3687b2);}(_0x5752,0x99));var _0x2575=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x5752[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x2575('0x0'));var util=require(_0x2575('0x1'));var logger=require(_0x2575('0x2'))(_0x2575('0x3'));var moment=require(_0x2575('0x4'));var BPromise=require(_0x2575('0x5'));var rp=require(_0x2575('0x6'));var fs=require('fs');var path=require(_0x2575('0x7'));var rimraf=require(_0x2575('0x8'));var config=require('../../config/environment');var attributes=require(_0x2575('0x9'));var integrations=require(_0x2575('0xa'));module[_0x2575('0xb')]=function(_0x2251aa,_0x21d6ff){return _0x2251aa[_0x2575('0xc')](_0x2575('0xd'),attributes,{'tableName':_0x2575('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3785=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x3785,0x92));var _0x5378=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x3785[_0x179e11];return _0x549f04;};'use strict';var _=require(_0x5378('0x0'));var util=require(_0x5378('0x1'));var logger=require(_0x5378('0x2'))(_0x5378('0x3'));var moment=require(_0x5378('0x4'));var BPromise=require(_0x5378('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5378('0x6'));var rimraf=require(_0x5378('0x7'));var config=require('../../config/environment');var attributes=require(_0x5378('0x8'));var integrations=require(_0x5378('0x9'));module[_0x5378('0xa')]=function(_0x3fbf27,_0x19dde7){return _0x3fbf27[_0x5378('0xb')](_0x5378('0xc'),attributes,{'tableName':_0x5378('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 875508d..d299222 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 _0x9a0a=['options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','findAll'];(function(_0x544df3,_0xfd5f3){var _0x592dd0=function(_0x9a5389){while(--_0x9a5389){_0x544df3['push'](_0x544df3['shift']());}};_0x592dd0(++_0xfd5f3);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x351aa0,_0x57d41f){_0x351aa0=_0x351aa0-0x0;var _0x657b7=_0x9a0a[_0x351aa0];return _0x657b7;};'use strict';var _=require(_0xa9a0('0x0'));var util=require(_0xa9a0('0x1'));var moment=require(_0xa9a0('0x2'));var BPromise=require(_0xa9a0('0x3'));var rs=require(_0xa9a0('0x4'));var fs=require('fs');var Redis=require(_0xa9a0('0x5'));var db=require(_0xa9a0('0x6'))['db'];var utils=require(_0xa9a0('0x7'));var logger=require(_0xa9a0('0x8'))('rpc');var config=require(_0xa9a0('0x9'));var jayson=require(_0xa9a0('0xa'));var client=jayson[_0xa9a0('0xb')][_0xa9a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1357ea,_0x20b546,_0x48070c){return new BPromise(function(_0x13b1c0,_0xbd243b){return client[_0xa9a0('0xd')](_0x1357ea,_0x48070c)[_0xa9a0('0xe')](function(_0x316175){logger['info'](_0xa9a0('0xf'),_0x20b546,'request\x20sent');logger[_0xa9a0('0x10')](_0xa9a0('0x11'),_0x20b546,_0xa9a0('0x12'),JSON[_0xa9a0('0x13')](_0x316175));if(_0x316175['error']){if(_0x316175[_0xa9a0('0x14')][_0xa9a0('0x15')]===0x1f4){logger[_0xa9a0('0x14')](_0xa9a0('0xf'),_0x20b546,_0x316175[_0xa9a0('0x14')][_0xa9a0('0x16')]);return _0xbd243b(_0x316175[_0xa9a0('0x14')]['message']);}logger[_0xa9a0('0x14')](_0xa9a0('0xf'),_0x20b546,_0x316175[_0xa9a0('0x14')][_0xa9a0('0x16')]);return _0x13b1c0(_0x316175[_0xa9a0('0x14')][_0xa9a0('0x16')]);}else{logger[_0xa9a0('0x17')](_0xa9a0('0xf'),_0x20b546,_0xa9a0('0x12'));_0x13b1c0(_0x316175[_0xa9a0('0x18')]['message']);}})[_0xa9a0('0x19')](function(_0x523b44){logger[_0xa9a0('0x14')](_0xa9a0('0xf'),_0x20b546,_0x523b44);_0xbd243b(_0x523b44);});});}exports[_0xa9a0('0x1a')]=function(_0x88a34d){var _0x1e3f5d=this;return new Promise(function(_0x3ee40c,_0xb86a0a){return db['SalesforceAccount'][_0xa9a0('0x1b')]({'raw':_0x88a34d[_0xa9a0('0x1c')]?_0x88a34d['options'][_0xa9a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x88a34d['options']?_0x88a34d[_0xa9a0('0x1c')][_0xa9a0('0x1e')]||null:null,'attributes':_0x88a34d['options']?_0x88a34d[_0xa9a0('0x1c')][_0xa9a0('0x1f')]||null:null,'limit':_0x88a34d[_0xa9a0('0x1c')]?_0x88a34d[_0xa9a0('0x1c')][_0xa9a0('0x20')]||null:null,'include':_0x88a34d['options']?_0x88a34d['options'][_0xa9a0('0x21')]?_[_0xa9a0('0x22')](_0x88a34d[_0xa9a0('0x1c')][_0xa9a0('0x21')],function(_0x18254c){return{'model':db[_0x18254c[_0xa9a0('0x23')]],'as':_0x18254c['as'],'attributes':_0x18254c[_0xa9a0('0x1f')],'include':_0x18254c[_0xa9a0('0x21')]?_[_0xa9a0('0x22')](_0x18254c[_0xa9a0('0x21')],function(_0x1b876f){return{'model':db[_0x1b876f[_0xa9a0('0x23')]],'as':_0x1b876f['as'],'attributes':_0x1b876f[_0xa9a0('0x1f')],'include':_0x1b876f[_0xa9a0('0x21')]?_[_0xa9a0('0x22')](_0x1b876f[_0xa9a0('0x21')],function(_0x3d7e9f){return{'model':db[_0x3d7e9f[_0xa9a0('0x23')]],'as':_0x3d7e9f['as'],'attributes':_0x3d7e9f[_0xa9a0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x251bc0){logger['info'](_0xa9a0('0x1a'),_0x88a34d);logger[_0xa9a0('0x10')](_0xa9a0('0x1a'),_0x88a34d,JSON[_0xa9a0('0x13')](_0x251bc0));_0x3ee40c(_0x251bc0);})[_0xa9a0('0x19')](function(_0x12ab84){logger[_0xa9a0('0x14')](_0xa9a0('0x1a'),_0x12ab84[_0xa9a0('0x16')],_0x88a34d);_0xb86a0a(_0x1e3f5d[_0xa9a0('0x14')](0x1f4,_0x12ab84[_0xa9a0('0x16')]));});});};exports[_0xa9a0('0x24')]=function(_0x503b95){var _0x3a9b78=this;return new Promise(function(_0xe0db5,_0x598e8a){return db['SalesforceAccount'][_0xa9a0('0x25')]({'raw':_0x503b95[_0xa9a0('0x1c')]?_0x503b95[_0xa9a0('0x1c')][_0xa9a0('0x1d')]===undefined?!![]:![]:!![],'where':_0x503b95[_0xa9a0('0x1c')]?_0x503b95['options'][_0xa9a0('0x1e')]||null:null,'attributes':_0x503b95[_0xa9a0('0x1c')]?_0x503b95[_0xa9a0('0x1c')][_0xa9a0('0x1f')]||null:null,'include':_0x503b95[_0xa9a0('0x1c')]?_0x503b95['options']['include']?_[_0xa9a0('0x22')](_0x503b95['options'][_0xa9a0('0x21')],function(_0x52109a){return{'model':db[_0x52109a[_0xa9a0('0x23')]],'as':_0x52109a['as'],'attributes':_0x52109a[_0xa9a0('0x1f')],'include':_0x52109a[_0xa9a0('0x21')]?_['map'](_0x52109a[_0xa9a0('0x21')],function(_0x419628){return{'model':db[_0x419628[_0xa9a0('0x23')]],'as':_0x419628['as'],'attributes':_0x419628[_0xa9a0('0x1f')],'include':_0x419628[_0xa9a0('0x21')]?_['map'](_0x419628[_0xa9a0('0x21')],function(_0xdee64a){return{'model':db[_0xdee64a[_0xa9a0('0x23')]],'as':_0xdee64a['as'],'attributes':_0xdee64a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34bbb5){logger[_0xa9a0('0x17')]('ShowSalesforceAccount',_0x503b95);logger['debug'](_0xa9a0('0x24'),_0x503b95,JSON[_0xa9a0('0x13')](_0x34bbb5));_0xe0db5(_0x34bbb5);})[_0xa9a0('0x19')](function(_0x288963){logger[_0xa9a0('0x14')](_0xa9a0('0x24'),_0x288963[_0xa9a0('0x16')],_0x503b95);_0x598e8a(_0x3a9b78[_0xa9a0('0x14')](0x1f4,_0x288963[_0xa9a0('0x16')]));});});}; \ No newline at end of file +var _0x0856=['find','where','debug','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount'];(function(_0x2365db,_0x4ea500){var _0x2bee41=function(_0x617f7b){while(--_0x617f7b){_0x2365db['push'](_0x2365db['shift']());}};_0x2bee41(++_0x4ea500);}(_0x0856,0x6a));var _0x6085=function(_0x41f21e,_0x461c5f){_0x41f21e=_0x41f21e-0x0;var _0x24a995=_0x0856[_0x41f21e];return _0x24a995;};'use strict';var _=require(_0x6085('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6085('0x1'));var rs=require(_0x6085('0x2'));var fs=require('fs');var Redis=require(_0x6085('0x3'));var db=require(_0x6085('0x4'))['db'];var utils=require(_0x6085('0x5'));var logger=require(_0x6085('0x6'))('rpc');var config=require(_0x6085('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6085('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c4219,_0x1f4591,_0x40d4b2){return new BPromise(function(_0x500c68,_0x4af9c7){return client[_0x6085('0x9')](_0x4c4219,_0x40d4b2)[_0x6085('0xa')](function(_0x4b6ee4){logger[_0x6085('0xb')](_0x6085('0xc'),_0x1f4591,'request\x20sent');logger['debug'](_0x6085('0xd'),_0x1f4591,_0x6085('0xe'),JSON[_0x6085('0xf')](_0x4b6ee4));if(_0x4b6ee4['error']){if(_0x4b6ee4['error']['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x1f4591,_0x4b6ee4[_0x6085('0x10')][_0x6085('0x11')]);return _0x4af9c7(_0x4b6ee4[_0x6085('0x10')][_0x6085('0x11')]);}logger[_0x6085('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x1f4591,_0x4b6ee4[_0x6085('0x10')][_0x6085('0x11')]);return _0x500c68(_0x4b6ee4[_0x6085('0x10')][_0x6085('0x11')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x1f4591,_0x6085('0xe'));_0x500c68(_0x4b6ee4[_0x6085('0x12')][_0x6085('0x11')]);}})['catch'](function(_0x319291){logger[_0x6085('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x1f4591,_0x319291);_0x4af9c7(_0x319291);});});}exports['GetSalesforceAccount']=function(_0x4d0cb3){var _0x550054=this;return new Promise(function(_0x67064b,_0x4bfd11){return db[_0x6085('0x13')][_0x6085('0x14')]({'raw':_0x4d0cb3[_0x6085('0x15')]?_0x4d0cb3[_0x6085('0x15')][_0x6085('0x16')]===undefined?!![]:![]:!![],'where':_0x4d0cb3[_0x6085('0x15')]?_0x4d0cb3[_0x6085('0x15')]['where']||null:null,'attributes':_0x4d0cb3[_0x6085('0x15')]?_0x4d0cb3[_0x6085('0x15')][_0x6085('0x17')]||null:null,'limit':_0x4d0cb3['options']?_0x4d0cb3[_0x6085('0x15')][_0x6085('0x18')]||null:null,'include':_0x4d0cb3['options']?_0x4d0cb3[_0x6085('0x15')][_0x6085('0x19')]?_[_0x6085('0x1a')](_0x4d0cb3[_0x6085('0x15')][_0x6085('0x19')],function(_0x1c950e){return{'model':db[_0x1c950e[_0x6085('0x1b')]],'as':_0x1c950e['as'],'attributes':_0x1c950e[_0x6085('0x17')],'include':_0x1c950e[_0x6085('0x19')]?_['map'](_0x1c950e[_0x6085('0x19')],function(_0x1b09de){return{'model':db[_0x1b09de['model']],'as':_0x1b09de['as'],'attributes':_0x1b09de[_0x6085('0x17')],'include':_0x1b09de['include']?_[_0x6085('0x1a')](_0x1b09de[_0x6085('0x19')],function(_0x54a3c9){return{'model':db[_0x54a3c9[_0x6085('0x1b')]],'as':_0x54a3c9['as'],'attributes':_0x54a3c9[_0x6085('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6085('0xa')](function(_0x48cc36){logger['info'](_0x6085('0x1c'),_0x4d0cb3);logger['debug'](_0x6085('0x1c'),_0x4d0cb3,JSON[_0x6085('0xf')](_0x48cc36));_0x67064b(_0x48cc36);})['catch'](function(_0x4406ac){logger[_0x6085('0x10')](_0x6085('0x1c'),_0x4406ac[_0x6085('0x11')],_0x4d0cb3);_0x4bfd11(_0x550054['error'](0x1f4,_0x4406ac['message']));});});};exports[_0x6085('0x1d')]=function(_0x24ad26){var _0x75edc6=this;return new Promise(function(_0x2a5e43,_0x2fd617){return db['SalesforceAccount'][_0x6085('0x1e')]({'raw':_0x24ad26['options']?_0x24ad26['options']['raw']===undefined?!![]:![]:!![],'where':_0x24ad26[_0x6085('0x15')]?_0x24ad26[_0x6085('0x15')][_0x6085('0x1f')]||null:null,'attributes':_0x24ad26[_0x6085('0x15')]?_0x24ad26[_0x6085('0x15')]['attributes']||null:null,'include':_0x24ad26[_0x6085('0x15')]?_0x24ad26['options'][_0x6085('0x19')]?_[_0x6085('0x1a')](_0x24ad26[_0x6085('0x15')][_0x6085('0x19')],function(_0x366ec9){return{'model':db[_0x366ec9[_0x6085('0x1b')]],'as':_0x366ec9['as'],'attributes':_0x366ec9[_0x6085('0x17')],'include':_0x366ec9[_0x6085('0x19')]?_[_0x6085('0x1a')](_0x366ec9[_0x6085('0x19')],function(_0x2ffb8c){return{'model':db[_0x2ffb8c['model']],'as':_0x2ffb8c['as'],'attributes':_0x2ffb8c[_0x6085('0x17')],'include':_0x2ffb8c['include']?_['map'](_0x2ffb8c[_0x6085('0x19')],function(_0x45545a){return{'model':db[_0x45545a[_0x6085('0x1b')]],'as':_0x45545a['as'],'attributes':_0x45545a[_0x6085('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6085('0xa')](function(_0x28243d){logger[_0x6085('0xb')](_0x6085('0x1d'),_0x24ad26);logger[_0x6085('0x20')]('ShowSalesforceAccount',_0x24ad26,JSON[_0x6085('0xf')](_0x28243d));_0x2a5e43(_0x28243d);})[_0x6085('0x21')](function(_0x157ccb){logger[_0x6085('0x10')](_0x6085('0x1d'),_0x157ccb['message'],_0x24ad26);_0x2fd617(_0x75edc6[_0x6085('0x10')](0x1f4,_0x157ccb[_0x6085('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d5de939..c49d852 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x3f3569,_0x2753c1){var _0x54ad24=function(_0x1d40c0){while(--_0x1d40c0){_0x3f3569['push'](_0x3f3569['shift']());}};_0x54ad24(++_0x2753c1);}(_0xadb5,0xad));var _0x5adb=function(_0x385eb6,_0x55d109){_0x385eb6=_0x385eb6-0x0;var _0x5f1578=_0xadb5[_0x385eb6];return _0x5f1578;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +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(_0x276ca4,_0x19fff3){var _0x34612c=function(_0x42f084){while(--_0x42f084){_0x276ca4['push'](_0x276ca4['shift']());}};_0x34612c(++_0x19fff3);}(_0x2ef3,0xba));var _0x32ef=function(_0xb0c828,_0x295076){_0xb0c828=_0xb0c828-0x0;var _0x3d21a0=_0x2ef3[_0xb0c828];return _0x3d21a0;};'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 9a5c370..5d39c93 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 _0x0796=['contact','nothing','lead','account','sequelize','exports','STRING','ENUM','Case','Task','contact_lead'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x0796,0x12d));var _0x6079=function(_0x5b2013,_0x180463){_0x5b2013=_0x5b2013-0x0;var _0x3be402=_0x0796[_0x5b2013];return _0x3be402;};'use strict';var Sequelize=require(_0x6079('0x0'));module[_0x6079('0x1')]={'name':{'type':Sequelize[_0x6079('0x2')]},'description':{'type':Sequelize[_0x6079('0x2')]},'ticketType':{'type':Sequelize[_0x6079('0x3')]('Task',_0x6079('0x4')),'defaultValue':_0x6079('0x5')},'moduleSearch':{'type':Sequelize[_0x6079('0x3')](_0x6079('0x6'),_0x6079('0x7'),'lead','account_contact_lead','account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x6079('0x8'),_0x6079('0x7'),_0x6079('0x9'),_0x6079('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x6079('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x6079('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x6079('0x2')]}}; \ No newline at end of file +var _0x4936=['STRING','ENUM','Task','contact_lead','contact','account_contact_lead','nothing','lead','account','exports'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4936,0x171));var _0x6493=function(_0x2b18f6,_0x5adb44){_0x2b18f6=_0x2b18f6-0x0;var _0x78a5e2=_0x4936[_0x2b18f6];return _0x78a5e2;};'use strict';var Sequelize=require('sequelize');module[_0x6493('0x0')]={'name':{'type':Sequelize[_0x6493('0x1')]},'description':{'type':Sequelize[_0x6493('0x1')]},'ticketType':{'type':Sequelize[_0x6493('0x2')](_0x6493('0x3'),'Case'),'defaultValue':_0x6493('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x6493('0x4'),_0x6493('0x5'),'lead',_0x6493('0x6'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x6493('0x2')](_0x6493('0x7'),'contact',_0x6493('0x8'),_0x6493('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x6493('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x6493('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x6493('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x6493('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 7781122..d4e4bfb 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 _0x687d=['includeAll','catch','create','body','params','find','getFields','findOne','SalesforceField','nolimit','order','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','limit','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceConfiguration','include','rows','show'];(function(_0x3e0498,_0x56f30f){var _0x563ad2=function(_0x51533c){while(--_0x51533c){_0x3e0498['push'](_0x3e0498['shift']());}};_0x563ad2(++_0x56f30f);}(_0x687d,0x194));var _0xd687=function(_0x1bef07,_0x2a4e64){_0x1bef07=_0x1bef07-0x0;var _0x29edf6=_0x687d[_0x1bef07];return _0x29edf6;};'use strict';var emlformat=require(_0xd687('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd687('0x1'));var jsonpatch=require(_0xd687('0x2'));var rp=require(_0xd687('0x3'));var moment=require(_0xd687('0x4'));var BPromise=require(_0xd687('0x5'));var Mustache=require(_0xd687('0x6'));var util=require(_0xd687('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd687('0x8'));var fs=require('fs');var fs_extra=require(_0xd687('0x9'));var _=require('lodash');var squel=require(_0xd687('0xa'));var crypto=require(_0xd687('0xb'));var jsforce=require(_0xd687('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd687('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd687('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd687('0xf'));var hardwareService=require(_0xd687('0x10'));var logger=require(_0xd687('0x11'))(_0xd687('0x12'));var utils=require(_0xd687('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd687('0x14'));var db=require(_0xd687('0x15'))['db'];function respondWithStatusCode(_0x2161ce,_0x426610){_0x426610=_0x426610||0xcc;return function(_0x1c5767){if(_0x1c5767){return _0x2161ce[_0xd687('0x16')](_0x426610);}return _0x2161ce['status'](_0x426610)[_0xd687('0x17')]();};}function respondWithResult(_0x10478a,_0x24d345){_0x24d345=_0x24d345||0xc8;return function(_0x1ab4a4){if(_0x1ab4a4){return _0x10478a[_0xd687('0x18')](_0x24d345)[_0xd687('0x19')](_0x1ab4a4);}};}function respondWithFilteredResult(_0x1f5c55,_0x54f6e2){return function(_0x295301){if(_0x295301){var _0x3dc819=typeof _0x54f6e2['offset']===_0xd687('0x1a')&&typeof _0x54f6e2['limit']===_0xd687('0x1a');var _0x3b3827=_0x295301[_0xd687('0x1b')];var _0x882a2=_0x3dc819?0x0:_0x54f6e2[_0xd687('0x1c')];var _0x3ba279=_0x3dc819?_0x295301[_0xd687('0x1b')]:_0x54f6e2['offset']+_0x54f6e2['limit'];var _0x1b347e;if(_0x3ba279>=_0x3b3827){_0x3ba279=_0x3b3827;_0x1b347e=0xc8;}else{_0x1b347e=0xce;}_0x1f5c55[_0xd687('0x18')](_0x1b347e);return _0x1f5c55['set'](_0xd687('0x1d'),_0x882a2+'-'+_0x3ba279+'/'+_0x3b3827)[_0xd687('0x19')](_0x295301);}return null;};}function patchUpdates(_0x3a42bc){return function(_0x532943){try{jsonpatch['apply'](_0x532943,_0x3a42bc,!![]);}catch(_0x2af99b){return BPromise[_0xd687('0x1e')](_0x2af99b);}return _0x532943[_0xd687('0x1f')]();};}function saveUpdates(_0x515244,_0x26ac53){return function(_0x3e0c44){if(_0x3e0c44){return _0x3e0c44[_0xd687('0x20')](_0x515244)[_0xd687('0x21')](function(_0x57b7e7){return _0x57b7e7;});}return null;};}function removeEntity(_0x21df66,_0x164b3b){return function(_0x31d02d){if(_0x31d02d){return _0x31d02d[_0xd687('0x22')]()[_0xd687('0x21')](function(){_0x21df66[_0xd687('0x18')](0xcc)[_0xd687('0x17')]();});}};}function handleEntityNotFound(_0x3a6071,_0x2e9d4e){return function(_0x499edc){if(!_0x499edc){_0x3a6071[_0xd687('0x16')](0x194);}return _0x499edc;};}function handleError(_0x511afd,_0x57bf5f){_0x57bf5f=_0x57bf5f||0x1f4;return function(_0x348dc6){logger[_0xd687('0x23')](_0x348dc6[_0xd687('0x24')]);if(_0x348dc6['name']){delete _0x348dc6[_0xd687('0x25')];}_0x511afd[_0xd687('0x18')](_0x57bf5f)['send'](_0x348dc6);};}exports[_0xd687('0x26')]=function(_0x592785,_0x49a8d7){var _0x4aac7b={},_0x37bc49={},_0x3b8545={'count':0x0,'rows':[]};var _0x3b918b=_['map'](db['SalesforceConfiguration'][_0xd687('0x27')],function(_0x43e517){return{'name':_0x43e517[_0xd687('0x28')],'type':_0x43e517[_0xd687('0x29')][_0xd687('0x2a')]};});_0x37bc49[_0xd687('0x2b')]=_[_0xd687('0x2c')](_0x3b918b,_0xd687('0x25'));_0x37bc49[_0xd687('0x2d')]=_[_0xd687('0x2e')](_0x592785[_0xd687('0x2d')]);_0x37bc49[_0xd687('0x2f')]=_[_0xd687('0x30')](_0x37bc49[_0xd687('0x2b')],_0x37bc49[_0xd687('0x2d')]);_0x4aac7b[_0xd687('0x31')]=_[_0xd687('0x30')](_0x37bc49[_0xd687('0x2b')],qs[_0xd687('0x32')](_0x592785[_0xd687('0x2d')][_0xd687('0x32')]));_0x4aac7b['attributes']=_0x4aac7b[_0xd687('0x31')][_0xd687('0x33')]?_0x4aac7b[_0xd687('0x31')]:_0x37bc49[_0xd687('0x2b')];if(!_0x592785[_0xd687('0x2d')]['hasOwnProperty']('nolimit')){_0x4aac7b['limit']=qs['limit'](_0x592785['query'][_0xd687('0x34')]);_0x4aac7b[_0xd687('0x1c')]=qs['offset'](_0x592785[_0xd687('0x2d')][_0xd687('0x1c')]);}_0x4aac7b['order']=qs['sort'](_0x592785[_0xd687('0x2d')][_0xd687('0x35')]);_0x4aac7b[_0xd687('0x36')]=qs[_0xd687('0x2f')](_[_0xd687('0x37')](_0x592785[_0xd687('0x2d')],_0x37bc49['filters']),_0x3b918b);if(_0x592785[_0xd687('0x2d')]['filter']){_0x4aac7b[_0xd687('0x36')]=_[_0xd687('0x38')](_0x4aac7b['where'],{'$or':_[_0xd687('0x2c')](_0x3b918b,function(_0x1449a6){if(_0x1449a6[_0xd687('0x29')]!==_0xd687('0x39')){var _0x29e20b={};_0x29e20b[_0x1449a6[_0xd687('0x25')]]={'$like':'%'+_0x592785[_0xd687('0x2d')][_0xd687('0x3a')]+'%'};return _0x29e20b;}})});}_0x4aac7b=_[_0xd687('0x38')]({},_0x4aac7b,_0x592785[_0xd687('0x3b')]);var _0x160fa8={'where':_0x4aac7b[_0xd687('0x36')]};return db[_0xd687('0x3c')][_0xd687('0x1b')](_0x160fa8)[_0xd687('0x21')](function(_0x12b3d1){_0x3b8545[_0xd687('0x1b')]=_0x12b3d1;if(_0x592785['query']['includeAll']){_0x4aac7b[_0xd687('0x3d')]=[{'all':!![]}];}return db[_0xd687('0x3c')]['findAll'](_0x4aac7b);})[_0xd687('0x21')](function(_0x40db7f){_0x3b8545[_0xd687('0x3e')]=_0x40db7f;return _0x3b8545;})[_0xd687('0x21')](respondWithFilteredResult(_0x49a8d7,_0x4aac7b))['catch'](handleError(_0x49a8d7,null));};exports[_0xd687('0x3f')]=function(_0x372212,_0x417cab){var _0x474d45={'raw':![],'where':{'id':_0x372212['params']['id']}},_0x5c1ff0={};_0x5c1ff0[_0xd687('0x2b')]=_[_0xd687('0x2e')](db[_0xd687('0x3c')][_0xd687('0x27')]);_0x5c1ff0['query']=_['keys'](_0x372212['query']);_0x5c1ff0[_0xd687('0x2f')]=_[_0xd687('0x30')](_0x5c1ff0[_0xd687('0x2b')],_0x5c1ff0[_0xd687('0x2d')]);_0x474d45[_0xd687('0x31')]=_[_0xd687('0x30')](_0x5c1ff0['model'],qs[_0xd687('0x32')](_0x372212[_0xd687('0x2d')]['fields']));_0x474d45[_0xd687('0x31')]=_0x474d45[_0xd687('0x31')]['length']?_0x474d45[_0xd687('0x31')]:_0x5c1ff0[_0xd687('0x2b')];if(_0x372212[_0xd687('0x2d')][_0xd687('0x40')]){_0x474d45[_0xd687('0x3d')]=[{'all':!![]}];}_0x474d45=_['merge']({},_0x474d45,_0x372212['options']);return db['SalesforceConfiguration']['find'](_0x474d45)['then'](handleEntityNotFound(_0x417cab,null))[_0xd687('0x21')](respondWithResult(_0x417cab,null))[_0xd687('0x41')](handleError(_0x417cab,null));};exports['create']=function(_0x4b63d8,_0x5c878c){return db[_0xd687('0x3c')][_0xd687('0x42')](_0x4b63d8['body'],{})[_0xd687('0x21')](respondWithResult(_0x5c878c,0xc9))[_0xd687('0x41')](handleError(_0x5c878c,null));};exports[_0xd687('0x20')]=function(_0x30f951,_0x16ead3){if(_0x30f951[_0xd687('0x43')]['id']){delete _0x30f951['body']['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x30f951[_0xd687('0x44')]['id']}})[_0xd687('0x21')](handleEntityNotFound(_0x16ead3,null))['then'](saveUpdates(_0x30f951['body'],null))[_0xd687('0x21')](respondWithResult(_0x16ead3,null))[_0xd687('0x41')](handleError(_0x16ead3,null));};exports[_0xd687('0x22')]=function(_0x21ffa7,_0x552d49){return db[_0xd687('0x3c')][_0xd687('0x45')]({'where':{'id':_0x21ffa7[_0xd687('0x44')]['id']}})[_0xd687('0x21')](handleEntityNotFound(_0x552d49,null))[_0xd687('0x21')](removeEntity(_0x552d49,null))['catch'](handleError(_0x552d49,null));};exports[_0xd687('0x46')]=function(_0x4d72cb,_0x5f5b75,_0x89472){var _0x6f0bb1={};var _0x4e0a09={};var _0x714ccb;var _0x16cf01;return db[_0xd687('0x3c')][_0xd687('0x47')]({'where':{'id':_0x4d72cb['params']['id']}})[_0xd687('0x21')](handleEntityNotFound(_0x5f5b75,null))[_0xd687('0x21')](function(_0xf24f8a){if(_0xf24f8a){_0x714ccb=_0xf24f8a;_0x4e0a09[_0xd687('0x2b')]=_[_0xd687('0x2e')](db[_0xd687('0x48')][_0xd687('0x27')]);_0x4e0a09['query']=_['keys'](_0x4d72cb[_0xd687('0x2d')]);_0x4e0a09['filters']=_[_0xd687('0x30')](_0x4e0a09[_0xd687('0x2b')],_0x4e0a09['query']);_0x6f0bb1[_0xd687('0x31')]=_['intersection'](_0x4e0a09[_0xd687('0x2b')],qs[_0xd687('0x32')](_0x4d72cb[_0xd687('0x2d')][_0xd687('0x32')]));_0x6f0bb1[_0xd687('0x31')]=_0x6f0bb1[_0xd687('0x31')]['length']?_0x6f0bb1['attributes']:_0x4e0a09['model'];_0x6f0bb1['order']=qs['sort'](_0x4d72cb['query'][_0xd687('0x35')]);_0x6f0bb1['where']=qs[_0xd687('0x2f')](_[_0xd687('0x37')](_0x4d72cb[_0xd687('0x2d')],_0x4e0a09['filters']));if(_0x4d72cb['query']['filter']){_0x6f0bb1[_0xd687('0x36')]=_[_0xd687('0x38')](_0x6f0bb1['where'],{'$or':_[_0xd687('0x2c')](_0x6f0bb1[_0xd687('0x31')],function(_0x330768){var _0x504dd7={};_0x504dd7[_0x330768]={'$like':'%'+_0x4d72cb[_0xd687('0x2d')]['filter']+'%'};return _0x504dd7;})});}_0x6f0bb1=_[_0xd687('0x38')]({},_0x6f0bb1,_0x4d72cb[_0xd687('0x3b')]);return _0x714ccb[_0xd687('0x46')](_0x6f0bb1);}})[_0xd687('0x21')](function(_0x9c052b){if(_0x9c052b){_0x16cf01=_0x9c052b[_0xd687('0x33')];if(!_0x4d72cb[_0xd687('0x2d')]['hasOwnProperty'](_0xd687('0x49'))){_0x6f0bb1['limit']=qs[_0xd687('0x34')](_0x4d72cb[_0xd687('0x2d')][_0xd687('0x34')]);_0x6f0bb1[_0xd687('0x1c')]=qs[_0xd687('0x1c')](_0x4d72cb[_0xd687('0x2d')][_0xd687('0x1c')]);}return _0x714ccb['getFields'](_0x6f0bb1);}})['then'](function(_0x2a1659){if(_0x2a1659){return _0x2a1659?{'count':_0x16cf01,'rows':_0x2a1659}:null;}})['then'](respondWithResult(_0x5f5b75,null))[_0xd687('0x41')](handleError(_0x5f5b75,null));};exports['getSubjects']=function(_0x8e8453,_0x4233e7,_0x673795){var _0x15d44e={};var _0x50e457={};var _0x3e73f1;var _0x12d398;return db[_0xd687('0x3c')][_0xd687('0x47')]({'where':{'id':_0x8e8453[_0xd687('0x44')]['id']}})[_0xd687('0x21')](handleEntityNotFound(_0x4233e7,null))[_0xd687('0x21')](function(_0x513370){if(_0x513370){_0x3e73f1=_0x513370;_0x50e457[_0xd687('0x2b')]=_['keys'](db[_0xd687('0x48')][_0xd687('0x27')]);_0x50e457[_0xd687('0x2d')]=_[_0xd687('0x2e')](_0x8e8453[_0xd687('0x2d')]);_0x50e457[_0xd687('0x2f')]=_[_0xd687('0x30')](_0x50e457['model'],_0x50e457['query']);_0x15d44e[_0xd687('0x31')]=_['intersection'](_0x50e457[_0xd687('0x2b')],qs['fields'](_0x8e8453[_0xd687('0x2d')][_0xd687('0x32')]));_0x15d44e[_0xd687('0x31')]=_0x15d44e[_0xd687('0x31')][_0xd687('0x33')]?_0x15d44e[_0xd687('0x31')]:_0x50e457[_0xd687('0x2b')];_0x15d44e[_0xd687('0x4a')]=qs[_0xd687('0x35')](_0x8e8453[_0xd687('0x2d')][_0xd687('0x35')]);_0x15d44e['where']=qs['filters'](_[_0xd687('0x37')](_0x8e8453[_0xd687('0x2d')],_0x50e457[_0xd687('0x2f')]));if(_0x8e8453[_0xd687('0x2d')][_0xd687('0x3a')]){_0x15d44e[_0xd687('0x36')]=_[_0xd687('0x38')](_0x15d44e[_0xd687('0x36')],{'$or':_[_0xd687('0x2c')](_0x15d44e[_0xd687('0x31')],function(_0x4c21d2){var _0x2f5e67={};_0x2f5e67[_0x4c21d2]={'$like':'%'+_0x8e8453['query'][_0xd687('0x3a')]+'%'};return _0x2f5e67;})});}_0x15d44e=_[_0xd687('0x38')]({},_0x15d44e,_0x8e8453[_0xd687('0x3b')]);return _0x3e73f1['getSubjects'](_0x15d44e);}})[_0xd687('0x21')](function(_0x479f07){if(_0x479f07){_0x12d398=_0x479f07['length'];if(!_0x8e8453[_0xd687('0x2d')][_0xd687('0x4b')](_0xd687('0x49'))){_0x15d44e['limit']=qs[_0xd687('0x34')](_0x8e8453[_0xd687('0x2d')][_0xd687('0x34')]);_0x15d44e['offset']=qs[_0xd687('0x1c')](_0x8e8453[_0xd687('0x2d')][_0xd687('0x1c')]);}return _0x3e73f1[_0xd687('0x4c')](_0x15d44e);}})[_0xd687('0x21')](function(_0x294ad2){if(_0x294ad2){return _0x294ad2?{'count':_0x12d398,'rows':_0x294ad2}:null;}})['then'](respondWithResult(_0x4233e7,null))['catch'](handleError(_0x4233e7,null));};exports['getDescriptions']=function(_0x53ae85,_0x4abd2d,_0x53e263){var _0x2c99b4={};var _0x24ef11={};var _0x1b03fe;var _0x252481;return db[_0xd687('0x3c')]['findOne']({'where':{'id':_0x53ae85['params']['id']}})[_0xd687('0x21')](handleEntityNotFound(_0x4abd2d,null))[_0xd687('0x21')](function(_0x391073){if(_0x391073){_0x1b03fe=_0x391073;_0x24ef11['model']=_[_0xd687('0x2e')](db[_0xd687('0x48')]['rawAttributes']);_0x24ef11[_0xd687('0x2d')]=_['keys'](_0x53ae85[_0xd687('0x2d')]);_0x24ef11[_0xd687('0x2f')]=_[_0xd687('0x30')](_0x24ef11[_0xd687('0x2b')],_0x24ef11[_0xd687('0x2d')]);_0x2c99b4[_0xd687('0x31')]=_[_0xd687('0x30')](_0x24ef11['model'],qs[_0xd687('0x32')](_0x53ae85[_0xd687('0x2d')][_0xd687('0x32')]));_0x2c99b4[_0xd687('0x31')]=_0x2c99b4['attributes'][_0xd687('0x33')]?_0x2c99b4['attributes']:_0x24ef11['model'];_0x2c99b4['order']=qs[_0xd687('0x35')](_0x53ae85[_0xd687('0x2d')][_0xd687('0x35')]);_0x2c99b4['where']=qs[_0xd687('0x2f')](_[_0xd687('0x37')](_0x53ae85[_0xd687('0x2d')],_0x24ef11['filters']));if(_0x53ae85[_0xd687('0x2d')][_0xd687('0x3a')]){_0x2c99b4[_0xd687('0x36')]=_['merge'](_0x2c99b4['where'],{'$or':_[_0xd687('0x2c')](_0x2c99b4[_0xd687('0x31')],function(_0x408766){var _0x24b3a3={};_0x24b3a3[_0x408766]={'$like':'%'+_0x53ae85[_0xd687('0x2d')][_0xd687('0x3a')]+'%'};return _0x24b3a3;})});}_0x2c99b4=_[_0xd687('0x38')]({},_0x2c99b4,_0x53ae85[_0xd687('0x3b')]);return _0x1b03fe['getDescriptions'](_0x2c99b4);}})['then'](function(_0x1f7af1){if(_0x1f7af1){_0x252481=_0x1f7af1[_0xd687('0x33')];if(!_0x53ae85[_0xd687('0x2d')][_0xd687('0x4b')](_0xd687('0x49'))){_0x2c99b4['limit']=qs[_0xd687('0x34')](_0x53ae85[_0xd687('0x2d')][_0xd687('0x34')]);_0x2c99b4[_0xd687('0x1c')]=qs[_0xd687('0x1c')](_0x53ae85['query'][_0xd687('0x1c')]);}return _0x1b03fe[_0xd687('0x4d')](_0x2c99b4);}})[_0xd687('0x21')](function(_0x35eb96){if(_0x35eb96){return _0x35eb96?{'count':_0x252481,'rows':_0x35eb96}:null;}})['then'](respondWithResult(_0x4abd2d,null))[_0xd687('0x41')](handleError(_0x4abd2d,null));}; \ No newline at end of file +var _0x4f03=['VIRTUAL','filter','merge','options','SalesforceConfiguration','include','findAll','rows','catch','show','includeAll','find','create','body','params','findOne','order','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','status','error','stack','name','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','sort','where','pick','type'];(function(_0x10d68e,_0x43f513){var _0x521d7b=function(_0x376e09){while(--_0x376e09){_0x10d68e['push'](_0x10d68e['shift']());}};_0x521d7b(++_0x43f513);}(_0x4f03,0xfc));var _0x34f0=function(_0x3e0e6c,_0x4757cd){_0x3e0e6c=_0x3e0e6c-0x0;var _0xad2be9=_0x4f03[_0x3e0e6c];return _0xad2be9;};'use strict';var emlformat=require(_0x34f0('0x0'));var rimraf=require(_0x34f0('0x1'));var zipdir=require(_0x34f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x34f0('0x3'));var moment=require('moment');var BPromise=require(_0x34f0('0x4'));var Mustache=require(_0x34f0('0x5'));var util=require(_0x34f0('0x6'));var path=require(_0x34f0('0x7'));var sox=require(_0x34f0('0x8'));var csv=require(_0x34f0('0x9'));var ejs=require(_0x34f0('0xa'));var fs=require('fs');var fs_extra=require(_0x34f0('0xb'));var _=require(_0x34f0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34f0('0xd'));var deskjs=require(_0x34f0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x34f0('0xf'));var Papa=require(_0x34f0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34f0('0x11'));var logger=require(_0x34f0('0x12'))(_0x34f0('0x13'));var utils=require(_0x34f0('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x664462,_0x9badbd){_0x9badbd=_0x9badbd||0xcc;return function(_0xb4e11f){if(_0xb4e11f){return _0x664462[_0x34f0('0x15')](_0x9badbd);}return _0x664462['status'](_0x9badbd)[_0x34f0('0x16')]();};}function respondWithResult(_0xb30927,_0x571172){_0x571172=_0x571172||0xc8;return function(_0x2eccda){if(_0x2eccda){return _0xb30927['status'](_0x571172)['json'](_0x2eccda);}};}function respondWithFilteredResult(_0x1c83cc,_0xee9731){return function(_0x5299b8){if(_0x5299b8){var _0x20254a=typeof _0xee9731[_0x34f0('0x17')]===_0x34f0('0x18')&&typeof _0xee9731[_0x34f0('0x19')]===_0x34f0('0x18');var _0x316284=_0x5299b8['count'];var _0x2295ef=_0x20254a?0x0:_0xee9731[_0x34f0('0x17')];var _0x558a3c=_0x20254a?_0x5299b8[_0x34f0('0x1a')]:_0xee9731[_0x34f0('0x17')]+_0xee9731['limit'];var _0x5adb66;if(_0x558a3c>=_0x316284){_0x558a3c=_0x316284;_0x5adb66=0xc8;}else{_0x5adb66=0xce;}_0x1c83cc['status'](_0x5adb66);return _0x1c83cc[_0x34f0('0x1b')]('Content-Range',_0x2295ef+'-'+_0x558a3c+'/'+_0x316284)[_0x34f0('0x1c')](_0x5299b8);}return null;};}function patchUpdates(_0x41b079){return function(_0x5953e1){try{jsonpatch[_0x34f0('0x1d')](_0x5953e1,_0x41b079,!![]);}catch(_0x2a8319){return BPromise[_0x34f0('0x1e')](_0x2a8319);}return _0x5953e1['save']();};}function saveUpdates(_0x27fd51,_0x39ebb0){return function(_0x2c3c48){if(_0x2c3c48){return _0x2c3c48[_0x34f0('0x1f')](_0x27fd51)['then'](function(_0x50af7f){return _0x50af7f;});}return null;};}function removeEntity(_0x265163,_0x21b912){return function(_0x10da06){if(_0x10da06){return _0x10da06[_0x34f0('0x20')]()[_0x34f0('0x21')](function(){_0x265163[_0x34f0('0x22')](0xcc)[_0x34f0('0x16')]();});}};}function handleEntityNotFound(_0x11a9bd,_0x53338d){return function(_0x524213){if(!_0x524213){_0x11a9bd[_0x34f0('0x15')](0x194);}return _0x524213;};}function handleError(_0x1a1958,_0x5d743c){_0x5d743c=_0x5d743c||0x1f4;return function(_0x12c1ec){logger[_0x34f0('0x23')](_0x12c1ec[_0x34f0('0x24')]);if(_0x12c1ec[_0x34f0('0x25')]){delete _0x12c1ec[_0x34f0('0x25')];}_0x1a1958[_0x34f0('0x22')](_0x5d743c)['send'](_0x12c1ec);};}exports[_0x34f0('0x26')]=function(_0x2770cf,_0x59c96e){var _0x404dfc={},_0x10c3ff={},_0x183dae={'count':0x0,'rows':[]};var _0x40273d=_[_0x34f0('0x27')](db['SalesforceConfiguration'][_0x34f0('0x28')],function(_0x12c3c4){return{'name':_0x12c3c4[_0x34f0('0x29')],'type':_0x12c3c4['type'][_0x34f0('0x2a')]};});_0x10c3ff[_0x34f0('0x2b')]=_['map'](_0x40273d,_0x34f0('0x25'));_0x10c3ff['query']=_[_0x34f0('0x2c')](_0x2770cf['query']);_0x10c3ff[_0x34f0('0x2d')]=_[_0x34f0('0x2e')](_0x10c3ff[_0x34f0('0x2b')],_0x10c3ff['query']);_0x404dfc[_0x34f0('0x2f')]=_[_0x34f0('0x2e')](_0x10c3ff[_0x34f0('0x2b')],qs[_0x34f0('0x30')](_0x2770cf[_0x34f0('0x31')][_0x34f0('0x30')]));_0x404dfc['attributes']=_0x404dfc['attributes'][_0x34f0('0x32')]?_0x404dfc[_0x34f0('0x2f')]:_0x10c3ff[_0x34f0('0x2b')];if(!_0x2770cf[_0x34f0('0x31')]['hasOwnProperty'](_0x34f0('0x33'))){_0x404dfc[_0x34f0('0x19')]=qs[_0x34f0('0x19')](_0x2770cf['query'][_0x34f0('0x19')]);_0x404dfc[_0x34f0('0x17')]=qs['offset'](_0x2770cf[_0x34f0('0x31')][_0x34f0('0x17')]);}_0x404dfc['order']=qs['sort'](_0x2770cf['query'][_0x34f0('0x34')]);_0x404dfc[_0x34f0('0x35')]=qs['filters'](_[_0x34f0('0x36')](_0x2770cf[_0x34f0('0x31')],_0x10c3ff[_0x34f0('0x2d')]),_0x40273d);if(_0x2770cf[_0x34f0('0x31')]['filter']){_0x404dfc['where']=_['merge'](_0x404dfc[_0x34f0('0x35')],{'$or':_[_0x34f0('0x27')](_0x40273d,function(_0x121fae){if(_0x121fae[_0x34f0('0x37')]!==_0x34f0('0x38')){var _0x553d70={};_0x553d70[_0x121fae[_0x34f0('0x25')]]={'$like':'%'+_0x2770cf[_0x34f0('0x31')][_0x34f0('0x39')]+'%'};return _0x553d70;}})});}_0x404dfc=_[_0x34f0('0x3a')]({},_0x404dfc,_0x2770cf[_0x34f0('0x3b')]);var _0x471439={'where':_0x404dfc['where']};return db[_0x34f0('0x3c')][_0x34f0('0x1a')](_0x471439)[_0x34f0('0x21')](function(_0x339c81){_0x183dae[_0x34f0('0x1a')]=_0x339c81;if(_0x2770cf[_0x34f0('0x31')]['includeAll']){_0x404dfc[_0x34f0('0x3d')]=[{'all':!![]}];}return db[_0x34f0('0x3c')][_0x34f0('0x3e')](_0x404dfc);})['then'](function(_0x82870c){_0x183dae[_0x34f0('0x3f')]=_0x82870c;return _0x183dae;})[_0x34f0('0x21')](respondWithFilteredResult(_0x59c96e,_0x404dfc))[_0x34f0('0x40')](handleError(_0x59c96e,null));};exports[_0x34f0('0x41')]=function(_0x20f1c9,_0xe14f3){var _0x59ef84={'raw':![],'where':{'id':_0x20f1c9['params']['id']}},_0x2e8f83={};_0x2e8f83[_0x34f0('0x2b')]=_['keys'](db[_0x34f0('0x3c')][_0x34f0('0x28')]);_0x2e8f83[_0x34f0('0x31')]=_[_0x34f0('0x2c')](_0x20f1c9['query']);_0x2e8f83['filters']=_['intersection'](_0x2e8f83[_0x34f0('0x2b')],_0x2e8f83[_0x34f0('0x31')]);_0x59ef84[_0x34f0('0x2f')]=_[_0x34f0('0x2e')](_0x2e8f83[_0x34f0('0x2b')],qs[_0x34f0('0x30')](_0x20f1c9[_0x34f0('0x31')]['fields']));_0x59ef84[_0x34f0('0x2f')]=_0x59ef84[_0x34f0('0x2f')][_0x34f0('0x32')]?_0x59ef84[_0x34f0('0x2f')]:_0x2e8f83[_0x34f0('0x2b')];if(_0x20f1c9[_0x34f0('0x31')][_0x34f0('0x42')]){_0x59ef84['include']=[{'all':!![]}];}_0x59ef84=_[_0x34f0('0x3a')]({},_0x59ef84,_0x20f1c9[_0x34f0('0x3b')]);return db['SalesforceConfiguration'][_0x34f0('0x43')](_0x59ef84)['then'](handleEntityNotFound(_0xe14f3,null))[_0x34f0('0x21')](respondWithResult(_0xe14f3,null))[_0x34f0('0x40')](handleError(_0xe14f3,null));};exports[_0x34f0('0x44')]=function(_0xce8bd3,_0x34516e){return db[_0x34f0('0x3c')]['create'](_0xce8bd3['body'],{})[_0x34f0('0x21')](respondWithResult(_0x34516e,0xc9))[_0x34f0('0x40')](handleError(_0x34516e,null));};exports[_0x34f0('0x1f')]=function(_0x5f10b9,_0x2126c7){if(_0x5f10b9[_0x34f0('0x45')]['id']){delete _0x5f10b9[_0x34f0('0x45')]['id'];}return db['SalesforceConfiguration'][_0x34f0('0x43')]({'where':{'id':_0x5f10b9[_0x34f0('0x46')]['id']}})['then'](handleEntityNotFound(_0x2126c7,null))[_0x34f0('0x21')](saveUpdates(_0x5f10b9['body'],null))['then'](respondWithResult(_0x2126c7,null))['catch'](handleError(_0x2126c7,null));};exports[_0x34f0('0x20')]=function(_0x46c4ab,_0x1c28bd){return db[_0x34f0('0x3c')][_0x34f0('0x43')]({'where':{'id':_0x46c4ab['params']['id']}})[_0x34f0('0x21')](handleEntityNotFound(_0x1c28bd,null))[_0x34f0('0x21')](removeEntity(_0x1c28bd,null))[_0x34f0('0x40')](handleError(_0x1c28bd,null));};exports['getFields']=function(_0x3cb568,_0x975732,_0x256238){var _0x706d8d={};var _0x5ac240={};var _0x495253;var _0x348eab;return db[_0x34f0('0x3c')][_0x34f0('0x47')]({'where':{'id':_0x3cb568[_0x34f0('0x46')]['id']}})['then'](handleEntityNotFound(_0x975732,null))[_0x34f0('0x21')](function(_0x2beb09){if(_0x2beb09){_0x495253=_0x2beb09;_0x5ac240[_0x34f0('0x2b')]=_[_0x34f0('0x2c')](db['SalesforceField'][_0x34f0('0x28')]);_0x5ac240[_0x34f0('0x31')]=_[_0x34f0('0x2c')](_0x3cb568['query']);_0x5ac240[_0x34f0('0x2d')]=_['intersection'](_0x5ac240[_0x34f0('0x2b')],_0x5ac240[_0x34f0('0x31')]);_0x706d8d['attributes']=_['intersection'](_0x5ac240[_0x34f0('0x2b')],qs[_0x34f0('0x30')](_0x3cb568['query']['fields']));_0x706d8d[_0x34f0('0x2f')]=_0x706d8d[_0x34f0('0x2f')][_0x34f0('0x32')]?_0x706d8d['attributes']:_0x5ac240[_0x34f0('0x2b')];_0x706d8d[_0x34f0('0x48')]=qs[_0x34f0('0x34')](_0x3cb568[_0x34f0('0x31')][_0x34f0('0x34')]);_0x706d8d[_0x34f0('0x35')]=qs[_0x34f0('0x2d')](_[_0x34f0('0x36')](_0x3cb568[_0x34f0('0x31')],_0x5ac240[_0x34f0('0x2d')]));if(_0x3cb568[_0x34f0('0x31')]['filter']){_0x706d8d[_0x34f0('0x35')]=_[_0x34f0('0x3a')](_0x706d8d[_0x34f0('0x35')],{'$or':_[_0x34f0('0x27')](_0x706d8d[_0x34f0('0x2f')],function(_0x488535){var _0x3bcb19={};_0x3bcb19[_0x488535]={'$like':'%'+_0x3cb568[_0x34f0('0x31')]['filter']+'%'};return _0x3bcb19;})});}_0x706d8d=_[_0x34f0('0x3a')]({},_0x706d8d,_0x3cb568[_0x34f0('0x3b')]);return _0x495253['getFields'](_0x706d8d);}})[_0x34f0('0x21')](function(_0x1f98ad){if(_0x1f98ad){_0x348eab=_0x1f98ad[_0x34f0('0x32')];if(!_0x3cb568[_0x34f0('0x31')][_0x34f0('0x49')](_0x34f0('0x33'))){_0x706d8d[_0x34f0('0x19')]=qs[_0x34f0('0x19')](_0x3cb568[_0x34f0('0x31')][_0x34f0('0x19')]);_0x706d8d[_0x34f0('0x17')]=qs[_0x34f0('0x17')](_0x3cb568[_0x34f0('0x31')]['offset']);}return _0x495253['getFields'](_0x706d8d);}})[_0x34f0('0x21')](function(_0x299c59){if(_0x299c59){return _0x299c59?{'count':_0x348eab,'rows':_0x299c59}:null;}})[_0x34f0('0x21')](respondWithResult(_0x975732,null))[_0x34f0('0x40')](handleError(_0x975732,null));};exports[_0x34f0('0x4a')]=function(_0x23c7ee,_0x4f8a49,_0x1e42e8){var _0x3d040e={};var _0x1aebef={};var _0x57870e;var _0x447131;return db[_0x34f0('0x3c')][_0x34f0('0x47')]({'where':{'id':_0x23c7ee['params']['id']}})[_0x34f0('0x21')](handleEntityNotFound(_0x4f8a49,null))[_0x34f0('0x21')](function(_0x1bfb64){if(_0x1bfb64){_0x57870e=_0x1bfb64;_0x1aebef[_0x34f0('0x2b')]=_['keys'](db[_0x34f0('0x4b')][_0x34f0('0x28')]);_0x1aebef['query']=_[_0x34f0('0x2c')](_0x23c7ee['query']);_0x1aebef['filters']=_[_0x34f0('0x2e')](_0x1aebef[_0x34f0('0x2b')],_0x1aebef[_0x34f0('0x31')]);_0x3d040e[_0x34f0('0x2f')]=_[_0x34f0('0x2e')](_0x1aebef['model'],qs['fields'](_0x23c7ee['query'][_0x34f0('0x30')]));_0x3d040e[_0x34f0('0x2f')]=_0x3d040e[_0x34f0('0x2f')]['length']?_0x3d040e[_0x34f0('0x2f')]:_0x1aebef[_0x34f0('0x2b')];_0x3d040e[_0x34f0('0x48')]=qs[_0x34f0('0x34')](_0x23c7ee[_0x34f0('0x31')][_0x34f0('0x34')]);_0x3d040e[_0x34f0('0x35')]=qs[_0x34f0('0x2d')](_[_0x34f0('0x36')](_0x23c7ee[_0x34f0('0x31')],_0x1aebef[_0x34f0('0x2d')]));if(_0x23c7ee[_0x34f0('0x31')][_0x34f0('0x39')]){_0x3d040e['where']=_[_0x34f0('0x3a')](_0x3d040e[_0x34f0('0x35')],{'$or':_[_0x34f0('0x27')](_0x3d040e[_0x34f0('0x2f')],function(_0x28df87){var _0x3481fe={};_0x3481fe[_0x28df87]={'$like':'%'+_0x23c7ee['query'][_0x34f0('0x39')]+'%'};return _0x3481fe;})});}_0x3d040e=_['merge']({},_0x3d040e,_0x23c7ee[_0x34f0('0x3b')]);return _0x57870e[_0x34f0('0x4a')](_0x3d040e);}})[_0x34f0('0x21')](function(_0x576817){if(_0x576817){_0x447131=_0x576817[_0x34f0('0x32')];if(!_0x23c7ee[_0x34f0('0x31')][_0x34f0('0x49')](_0x34f0('0x33'))){_0x3d040e['limit']=qs['limit'](_0x23c7ee['query'][_0x34f0('0x19')]);_0x3d040e[_0x34f0('0x17')]=qs[_0x34f0('0x17')](_0x23c7ee[_0x34f0('0x31')]['offset']);}return _0x57870e[_0x34f0('0x4a')](_0x3d040e);}})[_0x34f0('0x21')](function(_0x25811a){if(_0x25811a){return _0x25811a?{'count':_0x447131,'rows':_0x25811a}:null;}})['then'](respondWithResult(_0x4f8a49,null))[_0x34f0('0x40')](handleError(_0x4f8a49,null));};exports[_0x34f0('0x4c')]=function(_0x289429,_0x331dfa,_0x109f8f){var _0x5e353f={};var _0x13d44d={};var _0x5df60c;var _0x2625be;return db['SalesforceConfiguration'][_0x34f0('0x47')]({'where':{'id':_0x289429['params']['id']}})[_0x34f0('0x21')](handleEntityNotFound(_0x331dfa,null))['then'](function(_0x4e8659){if(_0x4e8659){_0x5df60c=_0x4e8659;_0x13d44d['model']=_[_0x34f0('0x2c')](db['SalesforceField'][_0x34f0('0x28')]);_0x13d44d[_0x34f0('0x31')]=_['keys'](_0x289429[_0x34f0('0x31')]);_0x13d44d[_0x34f0('0x2d')]=_[_0x34f0('0x2e')](_0x13d44d[_0x34f0('0x2b')],_0x13d44d['query']);_0x5e353f['attributes']=_['intersection'](_0x13d44d[_0x34f0('0x2b')],qs['fields'](_0x289429[_0x34f0('0x31')][_0x34f0('0x30')]));_0x5e353f[_0x34f0('0x2f')]=_0x5e353f['attributes'][_0x34f0('0x32')]?_0x5e353f[_0x34f0('0x2f')]:_0x13d44d[_0x34f0('0x2b')];_0x5e353f[_0x34f0('0x48')]=qs[_0x34f0('0x34')](_0x289429[_0x34f0('0x31')][_0x34f0('0x34')]);_0x5e353f[_0x34f0('0x35')]=qs[_0x34f0('0x2d')](_[_0x34f0('0x36')](_0x289429[_0x34f0('0x31')],_0x13d44d['filters']));if(_0x289429[_0x34f0('0x31')]['filter']){_0x5e353f[_0x34f0('0x35')]=_[_0x34f0('0x3a')](_0x5e353f[_0x34f0('0x35')],{'$or':_['map'](_0x5e353f['attributes'],function(_0x50836b){var _0x37348e={};_0x37348e[_0x50836b]={'$like':'%'+_0x289429[_0x34f0('0x31')][_0x34f0('0x39')]+'%'};return _0x37348e;})});}_0x5e353f=_[_0x34f0('0x3a')]({},_0x5e353f,_0x289429[_0x34f0('0x3b')]);return _0x5df60c['getDescriptions'](_0x5e353f);}})[_0x34f0('0x21')](function(_0x51a647){if(_0x51a647){_0x2625be=_0x51a647[_0x34f0('0x32')];if(!_0x289429[_0x34f0('0x31')][_0x34f0('0x49')](_0x34f0('0x33'))){_0x5e353f['limit']=qs['limit'](_0x289429[_0x34f0('0x31')][_0x34f0('0x19')]);_0x5e353f['offset']=qs['offset'](_0x289429[_0x34f0('0x31')][_0x34f0('0x17')]);}return _0x5df60c['getDescriptions'](_0x5e353f);}})[_0x34f0('0x21')](function(_0x4783fb){if(_0x4783fb){return _0x4783fb?{'count':_0x2625be,'rows':_0x4783fb}:null;}})[_0x34f0('0x21')](respondWithResult(_0x331dfa,null))[_0x34f0('0x40')](handleError(_0x331dfa,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e0a2686..9d32a66 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 _0xe618=['path','rimraf','../../config/environment','exports','define','SalesforceConfiguration','int_salesforce_configurations','moment','bluebird'];(function(_0x163ba3,_0x4dba51){var _0x4e9f67=function(_0x4a617c){while(--_0x4a617c){_0x163ba3['push'](_0x163ba3['shift']());}};_0x4e9f67(++_0x4dba51);}(_0xe618,0xa9));var _0x8e61=function(_0x1c4006,_0x2524d4){_0x1c4006=_0x1c4006-0x0;var _0x19586e=_0xe618[_0x1c4006];return _0x19586e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8e61('0x0'));var BPromise=require(_0x8e61('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e61('0x2'));var rimraf=require(_0x8e61('0x3'));var config=require(_0x8e61('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x8e61('0x5')]=function(_0x1770ae,_0x47dd0c){return _0x1770ae[_0x8e61('0x6')](_0x8e61('0x7'),attributes,{'tableName':_0x8e61('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5766=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations','lodash','api','request-promise','path'];(function(_0x4f7bee,_0x5217ae){var _0x222e67=function(_0x5ddbd9){while(--_0x5ddbd9){_0x4f7bee['push'](_0x4f7bee['shift']());}};_0x222e67(++_0x5217ae);}(_0x5766,0x88));var _0x6576=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5766[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6576('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6576('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6576('0x2'));var fs=require('fs');var path=require(_0x6576('0x3'));var rimraf=require(_0x6576('0x4'));var config=require(_0x6576('0x5'));var attributes=require(_0x6576('0x6'));module[_0x6576('0x7')]=function(_0x1232ae,_0x566f2d){return _0x1232ae[_0x6576('0x8')]('SalesforceConfiguration',attributes,{'tableName':_0x6576('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 f5fca24..d5abf84 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 _0xd9cc=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x87d4a0,_0x12a380){var _0x1f6db2=function(_0xe4510f){while(--_0xe4510f){_0x87d4a0['push'](_0x87d4a0['shift']());}};_0x1f6db2(++_0x12a380);}(_0xd9cc,0x11a));var _0xcd9c=function(_0x884ed0,_0x121d44){_0x884ed0=_0x884ed0-0x0;var _0x3ca8eb=_0xd9cc[_0x884ed0];return _0x3ca8eb;};'use strict';var _=require('lodash');var util=require(_0xcd9c('0x0'));var moment=require(_0xcd9c('0x1'));var BPromise=require(_0xcd9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd9c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd9c('0x4'));var logger=require(_0xcd9c('0x5'))(_0xcd9c('0x6'));var config=require(_0xcd9c('0x7'));var jayson=require(_0xcd9c('0x8'));var client=jayson[_0xcd9c('0x9')][_0xcd9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47ef7d,_0x1b58c1,_0x25599e){return new BPromise(function(_0x24aa40,_0x327a9){return client[_0xcd9c('0xb')](_0x47ef7d,_0x25599e)[_0xcd9c('0xc')](function(_0x86ec54){logger[_0xcd9c('0xd')](_0xcd9c('0xe'),_0x1b58c1,_0xcd9c('0xf'));logger[_0xcd9c('0x10')](_0xcd9c('0x11'),_0x1b58c1,_0xcd9c('0xf'),JSON[_0xcd9c('0x12')](_0x86ec54));if(_0x86ec54['error']){if(_0x86ec54[_0xcd9c('0x13')][_0xcd9c('0x14')]===0x1f4){logger[_0xcd9c('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b58c1,_0x86ec54['error'][_0xcd9c('0x15')]);return _0x327a9(_0x86ec54[_0xcd9c('0x13')]['message']);}logger[_0xcd9c('0x13')](_0xcd9c('0xe'),_0x1b58c1,_0x86ec54['error']['message']);return _0x24aa40(_0x86ec54['error']['message']);}else{logger[_0xcd9c('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b58c1,_0xcd9c('0xf'));_0x24aa40(_0x86ec54[_0xcd9c('0x16')][_0xcd9c('0x15')]);}})['catch'](function(_0xc84c11){logger[_0xcd9c('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1b58c1,_0xc84c11);_0x327a9(_0xc84c11);});});} \ No newline at end of file +var _0xb52a=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb52a,0x16a));var _0xab52=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0xb52a[_0x5806c3];return _0x48ac77;};'use strict';var _=require(_0xab52('0x0'));var util=require(_0xab52('0x1'));var moment=require(_0xab52('0x2'));var BPromise=require(_0xab52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab52('0x4'));var db=require(_0xab52('0x5'))['db'];var utils=require(_0xab52('0x6'));var logger=require('../../config/logger')(_0xab52('0x7'));var config=require(_0xab52('0x8'));var jayson=require(_0xab52('0x9'));var client=jayson['client'][_0xab52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f1a3e,_0x15af37,_0x458dad){return new BPromise(function(_0x9036fc,_0x5f4cce){return client[_0xab52('0xb')](_0x4f1a3e,_0x458dad)['then'](function(_0x405b06){logger['info'](_0xab52('0xc'),_0x15af37,_0xab52('0xd'));logger[_0xab52('0xe')](_0xab52('0xf'),_0x15af37,_0xab52('0xd'),JSON['stringify'](_0x405b06));if(_0x405b06[_0xab52('0x10')]){if(_0x405b06[_0xab52('0x10')][_0xab52('0x11')]===0x1f4){logger[_0xab52('0x10')](_0xab52('0xc'),_0x15af37,_0x405b06[_0xab52('0x10')][_0xab52('0x12')]);return _0x5f4cce(_0x405b06['error']['message']);}logger['error'](_0xab52('0xc'),_0x15af37,_0x405b06[_0xab52('0x10')]['message']);return _0x9036fc(_0x405b06[_0xab52('0x10')][_0xab52('0x12')]);}else{logger[_0xab52('0x13')](_0xab52('0xc'),_0x15af37,_0xab52('0xd'));_0x9036fc(_0x405b06[_0xab52('0x14')][_0xab52('0x12')]);}})[_0xab52('0x15')](function(_0x3221ce){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x15af37,_0x3221ce);_0x5f4cce(_0x3221ce);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 1a72d5b..d27d660 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 _0x9a83=['/:id','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x912b06,_0x44db09){var _0x1d0f68=function(_0x56b7c3){while(--_0x56b7c3){_0x912b06['push'](_0x912b06['shift']());}};_0x1d0f68(++_0x44db09);}(_0x9a83,0x1a7));var _0x39a8=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0x9a83[_0x132d12];return _0x1c3163;};'use strict';var multer=require(_0x39a8('0x0'));var util=require(_0x39a8('0x1'));var path=require(_0x39a8('0x2'));var timeout=require(_0x39a8('0x3'));var express=require(_0x39a8('0x4'));var router=express[_0x39a8('0x5')]();var fs_extra=require(_0x39a8('0x6'));var auth=require(_0x39a8('0x7'));var interaction=require(_0x39a8('0x8'));var config=require(_0x39a8('0x9'));var controller=require(_0x39a8('0xa'));router[_0x39a8('0xb')]('/',auth[_0x39a8('0xc')](),controller[_0x39a8('0xd')]);router[_0x39a8('0xb')](_0x39a8('0xe'),auth[_0x39a8('0xc')](),controller['show']);router[_0x39a8('0xf')]('/',auth[_0x39a8('0xc')](),controller['create']);router['put']('/:id',auth[_0x39a8('0xc')](),controller[_0x39a8('0x10')]);router['delete'](_0x39a8('0xe'),auth[_0x39a8('0xc')](),controller[_0x39a8('0x11')]);module[_0x39a8('0x12')]=router; \ No newline at end of file +var _0x01c3=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put','/:id','update','exports','multer','util','connect-timeout'];(function(_0x108393,_0x533251){var _0x1be89d=function(_0x428a46){while(--_0x428a46){_0x108393['push'](_0x108393['shift']());}};_0x1be89d(++_0x533251);}(_0x01c3,0x18c));var _0x301c=function(_0x2c4061,_0x40ea27){_0x2c4061=_0x2c4061-0x0;var _0x36987b=_0x01c3[_0x2c4061];return _0x36987b;};'use strict';var multer=require(_0x301c('0x0'));var util=require(_0x301c('0x1'));var path=require('path');var timeout=require(_0x301c('0x2'));var express=require(_0x301c('0x3'));var router=express[_0x301c('0x4')]();var fs_extra=require(_0x301c('0x5'));var auth=require(_0x301c('0x6'));var interaction=require(_0x301c('0x7'));var config=require(_0x301c('0x8'));var controller=require(_0x301c('0x9'));router[_0x301c('0xa')]('/',auth[_0x301c('0xb')](),controller[_0x301c('0xc')]);router[_0x301c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x301c('0xd')]);router['post']('/',auth[_0x301c('0xb')](),controller[_0x301c('0xe')]);router[_0x301c('0xf')](_0x301c('0x10'),auth[_0x301c('0xb')](),controller[_0x301c('0x11')]);router['delete']('/:id',auth[_0x301c('0xb')](),controller['destroy']);module[_0x301c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index c057ca8..dfd695c 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 _0x61d3=['customVariable','keyValue','variable','exports','string'];(function(_0x281a0e,_0x47d5c9){var _0x347927=function(_0x54baae){while(--_0x54baae){_0x281a0e['push'](_0x281a0e['shift']());}};_0x347927(++_0x47d5c9);}(_0x61d3,0x134));var _0x361d=function(_0x743b6c,_0x4dbc78){_0x743b6c=_0x743b6c-0x0;var _0x41575a=_0x61d3[_0x743b6c];return _0x41575a;};'use strict';var Sequelize=require('sequelize');module[_0x361d('0x0')]={'type':{'type':Sequelize['ENUM'](_0x361d('0x1'),'variable',_0x361d('0x2'),_0x361d('0x3'),'picklist'),'defaultValue':_0x361d('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x361d('0x1'),_0x361d('0x4'),_0x361d('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb12b=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','string','variable'];(function(_0x3321ed,_0x5415ba){var _0x458650=function(_0x2c9242){while(--_0x2c9242){_0x3321ed['push'](_0x3321ed['shift']());}};_0x458650(++_0x5415ba);}(_0xb12b,0x13d));var _0xbb12=function(_0x5835c3,_0x32ec9b){_0x5835c3=_0x5835c3-0x0;var _0x42edb4=_0xb12b[_0x5835c3];return _0x42edb4;};'use strict';var Sequelize=require(_0xbb12('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xbb12('0x1'),_0xbb12('0x2'),_0xbb12('0x3'),_0xbb12('0x4'),_0xbb12('0x5')),'defaultValue':_0xbb12('0x1')},'content':{'type':Sequelize[_0xbb12('0x6')]},'key':{'type':Sequelize[_0xbb12('0x6')]},'keyType':{'type':Sequelize[_0xbb12('0x7')](_0xbb12('0x1'),_0xbb12('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb12('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xbb12('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index daaa86d..ea7c6bb 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 _0x2bdd=['moment','bluebird','mustache','path','ejs','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','SalesforceField','includeAll','include','catch','show','params','options','find','create','body','update','eml-format','fast-json-patch','request-promise'];(function(_0x51be63,_0x529a6a){var _0x35cc5f=function(_0xb05464){while(--_0xb05464){_0x51be63['push'](_0x51be63['shift']());}};_0x35cc5f(++_0x529a6a);}(_0x2bdd,0x18f));var _0xd2bd=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x2bdd[_0x456bd2];return _0x2218c1;};'use strict';var emlformat=require(_0xd2bd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd2bd('0x1'));var rp=require(_0xd2bd('0x2'));var moment=require(_0xd2bd('0x3'));var BPromise=require(_0xd2bd('0x4'));var Mustache=require(_0xd2bd('0x5'));var util=require('util');var path=require(_0xd2bd('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd2bd('0x7'));var fs=require('fs');var fs_extra=require(_0xd2bd('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd2bd('0x9'));var deskjs=require(_0xd2bd('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd2bd('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd2bd('0xc'));var qs=require(_0xd2bd('0xd'));var as=require(_0xd2bd('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2bd('0xf'))(_0xd2bd('0x10'));var utils=require(_0xd2bd('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd2bd('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a2958,_0x4a45f9){_0x4a45f9=_0x4a45f9||0xcc;return function(_0x4c599b){if(_0x4c599b){return _0x4a2958['sendStatus'](_0x4a45f9);}return _0x4a2958[_0xd2bd('0x13')](_0x4a45f9)[_0xd2bd('0x14')]();};}function respondWithResult(_0x3a1eb7,_0x3b0234){_0x3b0234=_0x3b0234||0xc8;return function(_0x14ac35){if(_0x14ac35){return _0x3a1eb7['status'](_0x3b0234)[_0xd2bd('0x15')](_0x14ac35);}};}function respondWithFilteredResult(_0x5db5c5,_0x4bd0ba){return function(_0x5bf6b0){if(_0x5bf6b0){var _0x262f8d=typeof _0x4bd0ba[_0xd2bd('0x16')]===_0xd2bd('0x17')&&typeof _0x4bd0ba[_0xd2bd('0x18')]===_0xd2bd('0x17');var _0x2554fa=_0x5bf6b0['count'];var _0x752c=_0x262f8d?0x0:_0x4bd0ba[_0xd2bd('0x16')];var _0x40c1a4=_0x262f8d?_0x5bf6b0[_0xd2bd('0x19')]:_0x4bd0ba[_0xd2bd('0x16')]+_0x4bd0ba[_0xd2bd('0x18')];var _0x18d029;if(_0x40c1a4>=_0x2554fa){_0x40c1a4=_0x2554fa;_0x18d029=0xc8;}else{_0x18d029=0xce;}_0x5db5c5[_0xd2bd('0x13')](_0x18d029);return _0x5db5c5[_0xd2bd('0x1a')]('Content-Range',_0x752c+'-'+_0x40c1a4+'/'+_0x2554fa)[_0xd2bd('0x15')](_0x5bf6b0);}return null;};}function patchUpdates(_0x3be872){return function(_0x4346e4){try{jsonpatch[_0xd2bd('0x1b')](_0x4346e4,_0x3be872,!![]);}catch(_0x3ec137){return BPromise[_0xd2bd('0x1c')](_0x3ec137);}return _0x4346e4['save']();};}function saveUpdates(_0x101d00,_0x5b512d){return function(_0x2d39d3){if(_0x2d39d3){return _0x2d39d3['update'](_0x101d00)[_0xd2bd('0x1d')](function(_0x4a4295){return _0x4a4295;});}return null;};}function removeEntity(_0x59e2d1,_0x1c1ab0){return function(_0x5869bf){if(_0x5869bf){return _0x5869bf[_0xd2bd('0x1e')]()[_0xd2bd('0x1d')](function(){_0x59e2d1['status'](0xcc)[_0xd2bd('0x14')]();});}};}function handleEntityNotFound(_0x42d359,_0x1cff14){return function(_0x303313){if(!_0x303313){_0x42d359['sendStatus'](0x194);}return _0x303313;};}function handleError(_0x14eddb,_0x4b79a2){_0x4b79a2=_0x4b79a2||0x1f4;return function(_0xe066e9){logger[_0xd2bd('0x1f')](_0xe066e9[_0xd2bd('0x20')]);if(_0xe066e9['name']){delete _0xe066e9['name'];}_0x14eddb['status'](_0x4b79a2)[_0xd2bd('0x21')](_0xe066e9);};}exports[_0xd2bd('0x22')]=function(_0x37cf0b,_0x186367){var _0xc71b6f={},_0x4f207f={},_0x1bf6ed={'count':0x0,'rows':[]};var _0xe77e1a=_[_0xd2bd('0x23')](db['SalesforceField'][_0xd2bd('0x24')],function(_0x355b3c){return{'name':_0x355b3c[_0xd2bd('0x25')],'type':_0x355b3c[_0xd2bd('0x26')]['key']};});_0x4f207f[_0xd2bd('0x27')]=_[_0xd2bd('0x23')](_0xe77e1a,_0xd2bd('0x28'));_0x4f207f['query']=_[_0xd2bd('0x29')](_0x37cf0b['query']);_0x4f207f[_0xd2bd('0x2a')]=_[_0xd2bd('0x2b')](_0x4f207f[_0xd2bd('0x27')],_0x4f207f[_0xd2bd('0x2c')]);_0xc71b6f[_0xd2bd('0x2d')]=_[_0xd2bd('0x2b')](_0x4f207f['model'],qs[_0xd2bd('0x2e')](_0x37cf0b[_0xd2bd('0x2c')]['fields']));_0xc71b6f[_0xd2bd('0x2d')]=_0xc71b6f[_0xd2bd('0x2d')][_0xd2bd('0x2f')]?_0xc71b6f[_0xd2bd('0x2d')]:_0x4f207f[_0xd2bd('0x27')];if(!_0x37cf0b['query'][_0xd2bd('0x30')](_0xd2bd('0x31'))){_0xc71b6f[_0xd2bd('0x18')]=qs[_0xd2bd('0x18')](_0x37cf0b[_0xd2bd('0x2c')][_0xd2bd('0x18')]);_0xc71b6f[_0xd2bd('0x16')]=qs[_0xd2bd('0x16')](_0x37cf0b[_0xd2bd('0x2c')][_0xd2bd('0x16')]);}_0xc71b6f[_0xd2bd('0x32')]=qs['sort'](_0x37cf0b['query'][_0xd2bd('0x33')]);_0xc71b6f[_0xd2bd('0x34')]=qs[_0xd2bd('0x2a')](_[_0xd2bd('0x35')](_0x37cf0b[_0xd2bd('0x2c')],_0x4f207f[_0xd2bd('0x2a')]),_0xe77e1a);if(_0x37cf0b['query']['filter']){_0xc71b6f[_0xd2bd('0x34')]=_[_0xd2bd('0x36')](_0xc71b6f[_0xd2bd('0x34')],{'$or':_['map'](_0xe77e1a,function(_0x18a79a){if(_0x18a79a[_0xd2bd('0x26')]!=='VIRTUAL'){var _0x113be1={};_0x113be1[_0x18a79a[_0xd2bd('0x28')]]={'$like':'%'+_0x37cf0b[_0xd2bd('0x2c')][_0xd2bd('0x37')]+'%'};return _0x113be1;}})});}_0xc71b6f=_['merge']({},_0xc71b6f,_0x37cf0b['options']);var _0x12b989={'where':_0xc71b6f[_0xd2bd('0x34')]};return db[_0xd2bd('0x38')][_0xd2bd('0x19')](_0x12b989)[_0xd2bd('0x1d')](function(_0x3ff4aa){_0x1bf6ed[_0xd2bd('0x19')]=_0x3ff4aa;if(_0x37cf0b[_0xd2bd('0x2c')][_0xd2bd('0x39')]){_0xc71b6f[_0xd2bd('0x3a')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0xc71b6f);})[_0xd2bd('0x1d')](function(_0x2b2d98){_0x1bf6ed['rows']=_0x2b2d98;return _0x1bf6ed;})[_0xd2bd('0x1d')](respondWithFilteredResult(_0x186367,_0xc71b6f))[_0xd2bd('0x3b')](handleError(_0x186367,null));};exports[_0xd2bd('0x3c')]=function(_0x2d6f67,_0x166ac7){var _0x1c519a={'raw':!![],'where':{'id':_0x2d6f67[_0xd2bd('0x3d')]['id']}},_0x3cbe22={};_0x3cbe22[_0xd2bd('0x27')]=_['keys'](db[_0xd2bd('0x38')]['rawAttributes']);_0x3cbe22[_0xd2bd('0x2c')]=_['keys'](_0x2d6f67[_0xd2bd('0x2c')]);_0x3cbe22['filters']=_['intersection'](_0x3cbe22['model'],_0x3cbe22['query']);_0x1c519a['attributes']=_[_0xd2bd('0x2b')](_0x3cbe22[_0xd2bd('0x27')],qs[_0xd2bd('0x2e')](_0x2d6f67[_0xd2bd('0x2c')][_0xd2bd('0x2e')]));_0x1c519a['attributes']=_0x1c519a[_0xd2bd('0x2d')][_0xd2bd('0x2f')]?_0x1c519a[_0xd2bd('0x2d')]:_0x3cbe22[_0xd2bd('0x27')];if(_0x2d6f67[_0xd2bd('0x2c')][_0xd2bd('0x39')]){_0x1c519a[_0xd2bd('0x3a')]=[{'all':!![]}];}_0x1c519a=_[_0xd2bd('0x36')]({},_0x1c519a,_0x2d6f67[_0xd2bd('0x3e')]);return db[_0xd2bd('0x38')][_0xd2bd('0x3f')](_0x1c519a)['then'](handleEntityNotFound(_0x166ac7,null))[_0xd2bd('0x1d')](respondWithResult(_0x166ac7,null))[_0xd2bd('0x3b')](handleError(_0x166ac7,null));};exports[_0xd2bd('0x40')]=function(_0x3a9ea4,_0x3e2316){return db['SalesforceField'][_0xd2bd('0x40')](_0x3a9ea4[_0xd2bd('0x41')],{})[_0xd2bd('0x1d')](respondWithResult(_0x3e2316,0xc9))[_0xd2bd('0x3b')](handleError(_0x3e2316,null));};exports[_0xd2bd('0x42')]=function(_0x2e8719,_0x105b4d){if(_0x2e8719[_0xd2bd('0x41')]['id']){delete _0x2e8719[_0xd2bd('0x41')]['id'];}return db[_0xd2bd('0x38')][_0xd2bd('0x3f')]({'where':{'id':_0x2e8719[_0xd2bd('0x3d')]['id']}})[_0xd2bd('0x1d')](handleEntityNotFound(_0x105b4d,null))[_0xd2bd('0x1d')](saveUpdates(_0x2e8719[_0xd2bd('0x41')],null))[_0xd2bd('0x1d')](respondWithResult(_0x105b4d,null))['catch'](handleError(_0x105b4d,null));};exports[_0xd2bd('0x1e')]=function(_0xf1b549,_0x5e6774){return db[_0xd2bd('0x38')][_0xd2bd('0x3f')]({'where':{'id':_0xf1b549[_0xd2bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5e6774,null))[_0xd2bd('0x1d')](removeEntity(_0x5e6774,null))['catch'](handleError(_0x5e6774,null));}; \ No newline at end of file +var _0x521e=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SalesforceField','includeAll','include','rows','catch','show','params','rawAttributes','fields','create','body','find','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x551be0,_0x3372c1){var _0x112d08=function(_0x4c82b9){while(--_0x4c82b9){_0x551be0['push'](_0x551be0['shift']());}};_0x112d08(++_0x3372c1);}(_0x521e,0x1b3));var _0xe521=function(_0x31fc6e,_0x144352){_0x31fc6e=_0x31fc6e-0x0;var _0x3fc13c=_0x521e[_0x31fc6e];return _0x3fc13c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe521('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe521('0x1'));var rp=require('request-promise');var moment=require(_0xe521('0x2'));var BPromise=require(_0xe521('0x3'));var Mustache=require('mustache');var util=require(_0xe521('0x4'));var path=require('path');var sox=require(_0xe521('0x5'));var csv=require(_0xe521('0x6'));var ejs=require(_0xe521('0x7'));var fs=require('fs');var fs_extra=require(_0xe521('0x8'));var _=require(_0xe521('0x9'));var squel=require('squel');var crypto=require(_0xe521('0xa'));var jsforce=require(_0xe521('0xb'));var deskjs=require(_0xe521('0xc'));var toCsv=require(_0xe521('0x6'));var querystring=require('querystring');var Papa=require(_0xe521('0xd'));var Redis=require(_0xe521('0xe'));var authService=require(_0xe521('0xf'));var qs=require(_0xe521('0x10'));var as=require(_0xe521('0x11'));var hardwareService=require(_0xe521('0x12'));var logger=require(_0xe521('0x13'))(_0xe521('0x14'));var utils=require(_0xe521('0x15'));var config=require(_0xe521('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe521('0x17'))['db'];function respondWithStatusCode(_0x2ad2a1,_0x47719a){_0x47719a=_0x47719a||0xcc;return function(_0x12f20e){if(_0x12f20e){return _0x2ad2a1[_0xe521('0x18')](_0x47719a);}return _0x2ad2a1[_0xe521('0x19')](_0x47719a)[_0xe521('0x1a')]();};}function respondWithResult(_0x120455,_0xa586cd){_0xa586cd=_0xa586cd||0xc8;return function(_0x249107){if(_0x249107){return _0x120455[_0xe521('0x19')](_0xa586cd)['json'](_0x249107);}};}function respondWithFilteredResult(_0x58ecbf,_0x277038){return function(_0x461234){if(_0x461234){var _0x97e3e7=typeof _0x277038[_0xe521('0x1b')]===_0xe521('0x1c')&&typeof _0x277038[_0xe521('0x1d')]===_0xe521('0x1c');var _0x38671e=_0x461234[_0xe521('0x1e')];var _0x1aef57=_0x97e3e7?0x0:_0x277038[_0xe521('0x1b')];var _0x43756c=_0x97e3e7?_0x461234['count']:_0x277038['offset']+_0x277038[_0xe521('0x1d')];var _0xd2274e;if(_0x43756c>=_0x38671e){_0x43756c=_0x38671e;_0xd2274e=0xc8;}else{_0xd2274e=0xce;}_0x58ecbf[_0xe521('0x19')](_0xd2274e);return _0x58ecbf[_0xe521('0x1f')](_0xe521('0x20'),_0x1aef57+'-'+_0x43756c+'/'+_0x38671e)[_0xe521('0x21')](_0x461234);}return null;};}function patchUpdates(_0x3c4f9e){return function(_0x5269b4){try{jsonpatch[_0xe521('0x22')](_0x5269b4,_0x3c4f9e,!![]);}catch(_0x49da5b){return BPromise[_0xe521('0x23')](_0x49da5b);}return _0x5269b4[_0xe521('0x24')]();};}function saveUpdates(_0x31dfcf,_0x33eef9){return function(_0x350fba){if(_0x350fba){return _0x350fba[_0xe521('0x25')](_0x31dfcf)['then'](function(_0x552bbd){return _0x552bbd;});}return null;};}function removeEntity(_0x19b288,_0x31fee5){return function(_0x33f766){if(_0x33f766){return _0x33f766[_0xe521('0x26')]()[_0xe521('0x27')](function(){_0x19b288[_0xe521('0x19')](0xcc)[_0xe521('0x1a')]();});}};}function handleEntityNotFound(_0x490388,_0x57acaf){return function(_0x1ccbbd){if(!_0x1ccbbd){_0x490388[_0xe521('0x18')](0x194);}return _0x1ccbbd;};}function handleError(_0x1185b6,_0x442f06){_0x442f06=_0x442f06||0x1f4;return function(_0x13b014){logger[_0xe521('0x28')](_0x13b014[_0xe521('0x29')]);if(_0x13b014[_0xe521('0x2a')]){delete _0x13b014[_0xe521('0x2a')];}_0x1185b6[_0xe521('0x19')](_0x442f06)[_0xe521('0x2b')](_0x13b014);};}exports[_0xe521('0x2c')]=function(_0x3fc5bf,_0x5fd024){var _0x412a79={},_0x1b7f5b={},_0x5cab4f={'count':0x0,'rows':[]};var _0x104f27=_[_0xe521('0x2d')](db['SalesforceField']['rawAttributes'],function(_0x28a1b0){return{'name':_0x28a1b0[_0xe521('0x2e')],'type':_0x28a1b0[_0xe521('0x2f')][_0xe521('0x30')]};});_0x1b7f5b[_0xe521('0x31')]=_[_0xe521('0x2d')](_0x104f27,_0xe521('0x2a'));_0x1b7f5b['query']=_[_0xe521('0x32')](_0x3fc5bf[_0xe521('0x33')]);_0x1b7f5b[_0xe521('0x34')]=_[_0xe521('0x35')](_0x1b7f5b['model'],_0x1b7f5b['query']);_0x412a79[_0xe521('0x36')]=_['intersection'](_0x1b7f5b[_0xe521('0x31')],qs['fields'](_0x3fc5bf[_0xe521('0x33')]['fields']));_0x412a79[_0xe521('0x36')]=_0x412a79[_0xe521('0x36')][_0xe521('0x37')]?_0x412a79[_0xe521('0x36')]:_0x1b7f5b[_0xe521('0x31')];if(!_0x3fc5bf[_0xe521('0x33')]['hasOwnProperty'](_0xe521('0x38'))){_0x412a79['limit']=qs[_0xe521('0x1d')](_0x3fc5bf[_0xe521('0x33')][_0xe521('0x1d')]);_0x412a79[_0xe521('0x1b')]=qs[_0xe521('0x1b')](_0x3fc5bf['query'][_0xe521('0x1b')]);}_0x412a79[_0xe521('0x39')]=qs['sort'](_0x3fc5bf[_0xe521('0x33')][_0xe521('0x3a')]);_0x412a79[_0xe521('0x3b')]=qs[_0xe521('0x34')](_[_0xe521('0x3c')](_0x3fc5bf[_0xe521('0x33')],_0x1b7f5b[_0xe521('0x34')]),_0x104f27);if(_0x3fc5bf['query'][_0xe521('0x3d')]){_0x412a79[_0xe521('0x3b')]=_['merge'](_0x412a79['where'],{'$or':_[_0xe521('0x2d')](_0x104f27,function(_0x8ac233){if(_0x8ac233[_0xe521('0x2f')]!==_0xe521('0x3e')){var _0x3155dd={};_0x3155dd[_0x8ac233[_0xe521('0x2a')]]={'$like':'%'+_0x3fc5bf['query'][_0xe521('0x3d')]+'%'};return _0x3155dd;}})});}_0x412a79=_[_0xe521('0x3f')]({},_0x412a79,_0x3fc5bf[_0xe521('0x40')]);var _0x568f0d={'where':_0x412a79[_0xe521('0x3b')]};return db[_0xe521('0x41')][_0xe521('0x1e')](_0x568f0d)[_0xe521('0x27')](function(_0x4469ca){_0x5cab4f[_0xe521('0x1e')]=_0x4469ca;if(_0x3fc5bf['query'][_0xe521('0x42')]){_0x412a79[_0xe521('0x43')]=[{'all':!![]}];}return db[_0xe521('0x41')]['findAll'](_0x412a79);})['then'](function(_0x52d334){_0x5cab4f[_0xe521('0x44')]=_0x52d334;return _0x5cab4f;})['then'](respondWithFilteredResult(_0x5fd024,_0x412a79))[_0xe521('0x45')](handleError(_0x5fd024,null));};exports[_0xe521('0x46')]=function(_0x5ca0c0,_0x243b8a){var _0xd4bee6={'raw':!![],'where':{'id':_0x5ca0c0[_0xe521('0x47')]['id']}},_0x258aa8={};_0x258aa8[_0xe521('0x31')]=_['keys'](db['SalesforceField'][_0xe521('0x48')]);_0x258aa8[_0xe521('0x33')]=_['keys'](_0x5ca0c0[_0xe521('0x33')]);_0x258aa8[_0xe521('0x34')]=_[_0xe521('0x35')](_0x258aa8[_0xe521('0x31')],_0x258aa8[_0xe521('0x33')]);_0xd4bee6['attributes']=_[_0xe521('0x35')](_0x258aa8[_0xe521('0x31')],qs[_0xe521('0x49')](_0x5ca0c0[_0xe521('0x33')][_0xe521('0x49')]));_0xd4bee6[_0xe521('0x36')]=_0xd4bee6['attributes'][_0xe521('0x37')]?_0xd4bee6[_0xe521('0x36')]:_0x258aa8['model'];if(_0x5ca0c0['query'][_0xe521('0x42')]){_0xd4bee6[_0xe521('0x43')]=[{'all':!![]}];}_0xd4bee6=_[_0xe521('0x3f')]({},_0xd4bee6,_0x5ca0c0[_0xe521('0x40')]);return db[_0xe521('0x41')]['find'](_0xd4bee6)['then'](handleEntityNotFound(_0x243b8a,null))[_0xe521('0x27')](respondWithResult(_0x243b8a,null))[_0xe521('0x45')](handleError(_0x243b8a,null));};exports[_0xe521('0x4a')]=function(_0x15b1f7,_0x333637){return db[_0xe521('0x41')][_0xe521('0x4a')](_0x15b1f7[_0xe521('0x4b')],{})[_0xe521('0x27')](respondWithResult(_0x333637,0xc9))['catch'](handleError(_0x333637,null));};exports[_0xe521('0x25')]=function(_0x485f1d,_0x11827b){if(_0x485f1d[_0xe521('0x4b')]['id']){delete _0x485f1d[_0xe521('0x4b')]['id'];}return db[_0xe521('0x41')][_0xe521('0x4c')]({'where':{'id':_0x485f1d[_0xe521('0x47')]['id']}})[_0xe521('0x27')](handleEntityNotFound(_0x11827b,null))[_0xe521('0x27')](saveUpdates(_0x485f1d[_0xe521('0x4b')],null))['then'](respondWithResult(_0x11827b,null))[_0xe521('0x45')](handleError(_0x11827b,null));};exports[_0xe521('0x26')]=function(_0x369ff0,_0x174800){return db['SalesforceField'][_0xe521('0x4c')]({'where':{'id':_0x369ff0[_0xe521('0x47')]['id']}})[_0xe521('0x27')](handleEntityNotFound(_0x174800,null))[_0xe521('0x27')](removeEntity(_0x174800,null))[_0xe521('0x45')](handleError(_0x174800,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b43987d..4ac9de0 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 _0x14db=['salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields'];(function(_0x393e94,_0x4746bf){var _0x544941=function(_0x1d8383){while(--_0x1d8383){_0x393e94['push'](_0x393e94['shift']());}};_0x544941(++_0x4746bf);}(_0x14db,0xe3));var _0xb14d=function(_0xc0c39a,_0x2355fb){_0xc0c39a=_0xc0c39a-0x0;var _0x17ea64=_0x14db[_0xc0c39a];return _0x17ea64;};'use strict';var _=require(_0xb14d('0x0'));var util=require(_0xb14d('0x1'));var logger=require('../../config/logger')(_0xb14d('0x2'));var moment=require(_0xb14d('0x3'));var BPromise=require(_0xb14d('0x4'));var rp=require(_0xb14d('0x5'));var fs=require('fs');var path=require(_0xb14d('0x6'));var rimraf=require(_0xb14d('0x7'));var config=require(_0xb14d('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0xb14d('0x9')]=function(_0x43e528,_0x32816f){return _0x43e528[_0xb14d('0xa')](_0xb14d('0xb'),attributes,{'tableName':_0xb14d('0xc'),'paranoid':![],'indexes':[{'name':_0xb14d('0xd'),'fields':[_0xb14d('0xe'),_0xb14d('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x763e=['idField','FieldId','api','moment','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x763e,0x1c4));var _0xe763=function(_0x19dd4b,_0x1b690d){_0x19dd4b=_0x19dd4b-0x0;var _0x33f418=_0x763e[_0x19dd4b];return _0x33f418;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe763('0x0'));var moment=require(_0xe763('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe763('0x2'));var config=require(_0xe763('0x3'));var attributes=require(_0xe763('0x4'));module['exports']=function(_0x55df08,_0xc6f906){return _0x55df08[_0xe763('0x5')](_0xe763('0x6'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xe763('0x7'),_0xe763('0x8')],'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 4902133..443a5fb 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 _0x014d=['code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4c66e0,_0x2a6d3b){var _0x58e2dc=function(_0x2d9b99){while(--_0x2d9b99){_0x4c66e0['push'](_0x4c66e0['shift']());}};_0x58e2dc(++_0x2a6d3b);}(_0x014d,0x1a6));var _0xd014=function(_0x514c14,_0x5878){_0x514c14=_0x514c14-0x0;var _0x1fcf9d=_0x014d[_0x514c14];return _0x1fcf9d;};'use strict';var _=require('lodash');var util=require(_0xd014('0x0'));var moment=require(_0xd014('0x1'));var BPromise=require('bluebird');var rs=require(_0xd014('0x2'));var fs=require('fs');var Redis=require(_0xd014('0x3'));var db=require(_0xd014('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd014('0x5'))('rpc');var config=require(_0xd014('0x6'));var jayson=require(_0xd014('0x7'));var client=jayson[_0xd014('0x8')][_0xd014('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5745,_0x5dda59,_0x256666){return new BPromise(function(_0xf0b15d,_0x187bcd){return client[_0xd014('0xa')](_0x2b5745,_0x256666)['then'](function(_0x1684b0){logger[_0xd014('0xb')](_0xd014('0xc'),_0x5dda59,_0xd014('0xd'));logger[_0xd014('0xe')](_0xd014('0xf'),_0x5dda59,_0xd014('0xd'),JSON[_0xd014('0x10')](_0x1684b0));if(_0x1684b0[_0xd014('0x11')]){if(_0x1684b0[_0xd014('0x11')][_0xd014('0x12')]===0x1f4){logger[_0xd014('0x11')](_0xd014('0xc'),_0x5dda59,_0x1684b0['error']['message']);return _0x187bcd(_0x1684b0[_0xd014('0x11')][_0xd014('0x13')]);}logger[_0xd014('0x11')](_0xd014('0xc'),_0x5dda59,_0x1684b0['error']['message']);return _0xf0b15d(_0x1684b0[_0xd014('0x11')][_0xd014('0x13')]);}else{logger[_0xd014('0xb')](_0xd014('0xc'),_0x5dda59,_0xd014('0xd'));_0xf0b15d(_0x1684b0[_0xd014('0x14')][_0xd014('0x13')]);}})[_0xd014('0x15')](function(_0x8ad782){logger[_0xd014('0x11')](_0xd014('0xc'),_0x5dda59,_0x8ad782);_0x187bcd(_0x8ad782);});});} \ No newline at end of file +var _0x2771=['../../config/utils','../../config/logger','rpc','../../config/environment','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x5a2ec8,_0x560609){var _0x69efdb=function(_0x948ca){while(--_0x948ca){_0x5a2ec8['push'](_0x5a2ec8['shift']());}};_0x69efdb(++_0x560609);}(_0x2771,0x1de));var _0x1277=function(_0x24087b,_0x10c09a){_0x24087b=_0x24087b-0x0;var _0x1ba8e4=_0x2771[_0x24087b];return _0x1ba8e4;};'use strict';var _=require(_0x1277('0x0'));var util=require(_0x1277('0x1'));var moment=require('moment');var BPromise=require(_0x1277('0x2'));var rs=require(_0x1277('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1277('0x4'))['db'];var utils=require(_0x1277('0x5'));var logger=require(_0x1277('0x6'))(_0x1277('0x7'));var config=require(_0x1277('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1277('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26d747,_0x15b4ce,_0x1ca900){return new BPromise(function(_0x4d6dca,_0x2b4bb9){return client['request'](_0x26d747,_0x1ca900)['then'](function(_0xc0e55f){logger[_0x1277('0xa')](_0x1277('0xb'),_0x15b4ce,_0x1277('0xc'));logger[_0x1277('0xd')](_0x1277('0xe'),_0x15b4ce,_0x1277('0xc'),JSON[_0x1277('0xf')](_0xc0e55f));if(_0xc0e55f['error']){if(_0xc0e55f[_0x1277('0x10')][_0x1277('0x11')]===0x1f4){logger[_0x1277('0x10')](_0x1277('0xb'),_0x15b4ce,_0xc0e55f['error'][_0x1277('0x12')]);return _0x2b4bb9(_0xc0e55f[_0x1277('0x10')][_0x1277('0x12')]);}logger[_0x1277('0x10')](_0x1277('0xb'),_0x15b4ce,_0xc0e55f[_0x1277('0x10')]['message']);return _0x4d6dca(_0xc0e55f[_0x1277('0x10')][_0x1277('0x12')]);}else{logger['info'](_0x1277('0xb'),_0x15b4ce,_0x1277('0xc'));_0x4d6dca(_0xc0e55f[_0x1277('0x13')]['message']);}})[_0x1277('0x14')](function(_0x34a29c){logger[_0x1277('0x10')](_0x1277('0xb'),_0x15b4ce,_0x34a29c);_0x2b4bb9(_0x34a29c);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 0daf311..bd3d0f8 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 _0x80fb=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports'];(function(_0x18df79,_0x19fc76){var _0x46d9a2=function(_0x233d48){while(--_0x233d48){_0x18df79['push'](_0x18df79['shift']());}};_0x46d9a2(++_0x19fc76);}(_0x80fb,0x11e));var _0xb80f=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x80fb[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0xb80f('0x0'));var path=require(_0xb80f('0x1'));var timeout=require('connect-timeout');var express=require(_0xb80f('0x2'));var router=express[_0xb80f('0x3')]();var fs_extra=require(_0xb80f('0x4'));var auth=require(_0xb80f('0x5'));var interaction=require(_0xb80f('0x6'));var config=require(_0xb80f('0x7'));var controller=require(_0xb80f('0x8'));router[_0xb80f('0x9')]('/',auth['isAuthenticated'](),controller[_0xb80f('0xa')]);router[_0xb80f('0x9')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0xd')]);router[_0xb80f('0x9')](_0xb80f('0xe'),auth[_0xb80f('0xc')](),controller[_0xb80f('0xf')]);router[_0xb80f('0x9')](_0xb80f('0x10'),auth[_0xb80f('0xc')](),controller[_0xb80f('0x11')]);router[_0xb80f('0x12')]('/',auth[_0xb80f('0xc')](),controller[_0xb80f('0x13')]);router['post'](_0xb80f('0xe'),auth['isAuthenticated'](),controller[_0xb80f('0x14')]);router[_0xb80f('0x15')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0x16')]);router[_0xb80f('0x17')](_0xb80f('0xb'),auth[_0xb80f('0xc')](),controller[_0xb80f('0x18')]);module[_0xb80f('0x19')]=router; \ No newline at end of file +var _0xa403=['./intServicenowAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','/:id','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c4664,_0x506a85){var _0x2920cf=function(_0x54a19d){while(--_0x54a19d){_0x4c4664['push'](_0x4c4664['shift']());}};_0x2920cf(++_0x506a85);}(_0xa403,0x1f2));var _0x3a40=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0xa403[_0x258b93];return _0x35484b;};'use strict';var multer=require('multer');var util=require(_0x3a40('0x0'));var path=require(_0x3a40('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a40('0x2'));var router=express[_0x3a40('0x3')]();var fs_extra=require(_0x3a40('0x4'));var auth=require(_0x3a40('0x5'));var interaction=require(_0x3a40('0x6'));var config=require(_0x3a40('0x7'));var controller=require(_0x3a40('0x8'));router[_0x3a40('0x9')]('/',auth[_0x3a40('0xa')](),controller['index']);router[_0x3a40('0x9')]('/:id',auth[_0x3a40('0xa')](),controller[_0x3a40('0xb')]);router[_0x3a40('0x9')]('/:id/configurations',auth[_0x3a40('0xa')](),controller[_0x3a40('0xc')]);router['get'](_0x3a40('0xd'),auth[_0x3a40('0xa')](),controller[_0x3a40('0xe')]);router[_0x3a40('0xf')]('/',auth[_0x3a40('0xa')](),controller['create']);router[_0x3a40('0xf')](_0x3a40('0x10'),auth[_0x3a40('0xa')](),controller[_0x3a40('0x11')]);router[_0x3a40('0x12')](_0x3a40('0x13'),auth[_0x3a40('0xa')](),controller['update']);router[_0x3a40('0x14')](_0x3a40('0x13'),auth[_0x3a40('0xa')](),controller['destroy']);module[_0x3a40('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 340c93b..bbd00ec 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 _0x03b8=['remoteUri','exports','STRING'];(function(_0xb653f2,_0x456cb2){var _0xf43ef8=function(_0x3f0d7a){while(--_0x3f0d7a){_0xb653f2['push'](_0xb653f2['shift']());}};_0xf43ef8(++_0x456cb2);}(_0x03b8,0xeb));var _0x803b=function(_0xe2f7a3,_0x1b9cb9){_0xe2f7a3=_0xe2f7a3-0x0;var _0x40e99=_0x03b8[_0xe2f7a3];return _0x40e99;};'use strict';var Sequelize=require('sequelize');module[_0x803b('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x803b('0x1')]},'username':{'type':Sequelize[_0x803b('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x803b('0x1')]},'email':{'type':Sequelize[_0x803b('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x803b('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x61c5=['exports','STRING','username','remoteUri'];(function(_0x5cc450,_0xbc6fa8){var _0x781ec6=function(_0x3f772b){while(--_0x3f772b){_0x5cc450['push'](_0x5cc450['shift']());}};_0x781ec6(++_0xbc6fa8);}(_0x61c5,0x130));var _0x561c=function(_0x289801,_0x3773a8){_0x289801=_0x289801-0x0;var _0x6f2b04=_0x61c5[_0x289801];return _0x6f2b04;};'use strict';var Sequelize=require('sequelize');module[_0x561c('0x0')]={'name':{'type':Sequelize[_0x561c('0x1')]},'description':{'type':Sequelize[_0x561c('0x1')]},'username':{'type':Sequelize[_0x561c('0x1')],'unique':_0x561c('0x2')},'password':{'type':Sequelize[_0x561c('0x1')]},'email':{'type':Sequelize[_0x561c('0x1')]},'remoteUri':{'type':Sequelize[_0x561c('0x1')],'unique':_0x561c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index d494352..61994aa 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 _0x3aff=['sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','type','channel','ServicenowField','Descriptions','made_sla','hold_reason','subcategory','close_code','severity','parent','watch_list','upon_reject','sys_updated_on','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','impact','active','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','location','category','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','assign','forEach','label','push','all','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','statusCode','send','boolean','true','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','then','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','nolimit','order'];(function(_0x1b39b3,_0x14a718){var _0x14b68f=function(_0x49b9e5){while(--_0x49b9e5){_0x1b39b3['push'](_0x1b39b3['shift']());}};_0x14b68f(++_0x14a718);}(_0x3aff,0x12f));var _0xf3af=function(_0x2dbad8,_0xbec645){_0x2dbad8=_0x2dbad8-0x0;var _0x10ac42=_0x3aff[_0x2dbad8];return _0x10ac42;};'use strict';var emlformat=require(_0xf3af('0x0'));var rimraf=require(_0xf3af('0x1'));var zipdir=require(_0xf3af('0x2'));var jsonpatch=require(_0xf3af('0x3'));var rp=require(_0xf3af('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3af('0x5'));var util=require(_0xf3af('0x6'));var path=require(_0xf3af('0x7'));var sox=require(_0xf3af('0x8'));var csv=require(_0xf3af('0x9'));var ejs=require(_0xf3af('0xa'));var fs=require('fs');var fs_extra=require(_0xf3af('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf3af('0xc'));var jsforce=require(_0xf3af('0xd'));var deskjs=require(_0xf3af('0xe'));var toCsv=require(_0xf3af('0x9'));var querystring=require('querystring');var Papa=require(_0xf3af('0xf'));var Redis=require('ioredis');var authService=require(_0xf3af('0x10'));var qs=require(_0xf3af('0x11'));var as=require(_0xf3af('0x12'));var hardwareService=require(_0xf3af('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3af('0x14'));var db=require(_0xf3af('0x15'))['db'];var integrations=require(_0xf3af('0x16'));function respondWithStatusCode(_0x2c552f,_0x2b7fcd){_0x2b7fcd=_0x2b7fcd||0xcc;return function(_0x52aae1){if(_0x52aae1){return _0x2c552f[_0xf3af('0x17')](_0x2b7fcd);}return _0x2c552f[_0xf3af('0x18')](_0x2b7fcd)[_0xf3af('0x19')]();};}function respondWithResult(_0x39bf21,_0x305ae8){_0x305ae8=_0x305ae8||0xc8;return function(_0x4a2c23){if(_0x4a2c23){return _0x39bf21[_0xf3af('0x18')](_0x305ae8)[_0xf3af('0x1a')](_0x4a2c23);}};}function respondWithFilteredResult(_0x3772de,_0x3a4f21){return function(_0x5cd147){if(_0x5cd147){var _0x50ef22=typeof _0x3a4f21[_0xf3af('0x1b')]===_0xf3af('0x1c')&&typeof _0x3a4f21[_0xf3af('0x1d')]===_0xf3af('0x1c');var _0x53b32f=_0x5cd147[_0xf3af('0x1e')];var _0x1ed2f9=_0x50ef22?0x0:_0x3a4f21[_0xf3af('0x1b')];var _0x390e4e=_0x50ef22?_0x5cd147[_0xf3af('0x1e')]:_0x3a4f21[_0xf3af('0x1b')]+_0x3a4f21[_0xf3af('0x1d')];var _0x4c76b9;if(_0x390e4e>=_0x53b32f){_0x390e4e=_0x53b32f;_0x4c76b9=0xc8;}else{_0x4c76b9=0xce;}_0x3772de['status'](_0x4c76b9);return _0x3772de['set']('Content-Range',_0x1ed2f9+'-'+_0x390e4e+'/'+_0x53b32f)[_0xf3af('0x1a')](_0x5cd147);}return null;};}function patchUpdates(_0x4c792c){return function(_0x423a65){try{jsonpatch['apply'](_0x423a65,_0x4c792c,!![]);}catch(_0x44fff8){return BPromise[_0xf3af('0x1f')](_0x44fff8);}return _0x423a65[_0xf3af('0x20')]();};}function saveUpdates(_0x3208d2,_0x295b1f){return function(_0x15c3f2){if(_0x15c3f2){return _0x15c3f2[_0xf3af('0x21')](_0x3208d2)['then'](function(_0x323ca){return _0x323ca;});}return null;};}function removeEntity(_0x16438f,_0x2a4f9f){return function(_0x51fb6c){if(_0x51fb6c){return _0x51fb6c[_0xf3af('0x22')]()[_0xf3af('0x23')](function(){_0x16438f[_0xf3af('0x18')](0xcc)[_0xf3af('0x19')]();});}};}function handleEntityNotFound(_0x1c71d6,_0x133878){return function(_0x16b3e0){if(!_0x16b3e0){_0x1c71d6[_0xf3af('0x17')](0x194);}return _0x16b3e0;};}function handleError(_0x51241f,_0xe991fa){_0xe991fa=_0xe991fa||0x1f4;return function(_0x2d21db){logger[_0xf3af('0x24')](_0x2d21db[_0xf3af('0x25')]);if(_0x2d21db[_0xf3af('0x26')]){delete _0x2d21db[_0xf3af('0x26')];}_0x51241f[_0xf3af('0x18')](_0xe991fa)['send'](_0x2d21db);};}exports[_0xf3af('0x27')]=function(_0x5431fb,_0x2828a5){var _0x230113={},_0x27ae29={},_0x111992={'count':0x0,'rows':[]};var _0xa65421=_[_0xf3af('0x28')](db[_0xf3af('0x29')][_0xf3af('0x2a')],function(_0x5e5502){return{'name':_0x5e5502[_0xf3af('0x2b')],'type':_0x5e5502['type'][_0xf3af('0x2c')]};});_0x27ae29[_0xf3af('0x2d')]=_[_0xf3af('0x28')](_0xa65421,_0xf3af('0x26'));_0x27ae29[_0xf3af('0x2e')]=_['keys'](_0x5431fb[_0xf3af('0x2e')]);_0x27ae29['filters']=_[_0xf3af('0x2f')](_0x27ae29['model'],_0x27ae29[_0xf3af('0x2e')]);_0x230113[_0xf3af('0x30')]=_[_0xf3af('0x2f')](_0x27ae29['model'],qs[_0xf3af('0x31')](_0x5431fb['query'][_0xf3af('0x31')]));_0x230113[_0xf3af('0x30')]=_0x230113[_0xf3af('0x30')][_0xf3af('0x32')]?_0x230113[_0xf3af('0x30')]:_0x27ae29[_0xf3af('0x2d')];if(!_0x5431fb['query']['hasOwnProperty'](_0xf3af('0x33'))){_0x230113['limit']=qs[_0xf3af('0x1d')](_0x5431fb[_0xf3af('0x2e')]['limit']);_0x230113[_0xf3af('0x1b')]=qs[_0xf3af('0x1b')](_0x5431fb[_0xf3af('0x2e')][_0xf3af('0x1b')]);}_0x230113[_0xf3af('0x34')]=qs['sort'](_0x5431fb[_0xf3af('0x2e')][_0xf3af('0x35')]);_0x230113[_0xf3af('0x36')]=qs[_0xf3af('0x37')](_[_0xf3af('0x38')](_0x5431fb[_0xf3af('0x2e')],_0x27ae29[_0xf3af('0x37')]),_0xa65421);if(_0x5431fb[_0xf3af('0x2e')][_0xf3af('0x39')]){_0x230113[_0xf3af('0x36')]=_[_0xf3af('0x3a')](_0x230113[_0xf3af('0x36')],{'$or':_[_0xf3af('0x28')](_0xa65421,function(_0x121b2f){if(_0x121b2f['type']!=='VIRTUAL'){var _0x487a9f={};_0x487a9f[_0x121b2f[_0xf3af('0x26')]]={'$like':'%'+_0x5431fb[_0xf3af('0x2e')][_0xf3af('0x39')]+'%'};return _0x487a9f;}})});}_0x230113=_['merge']({},_0x230113,_0x5431fb['options']);var _0x806572={'where':_0x230113[_0xf3af('0x36')]};return db[_0xf3af('0x29')][_0xf3af('0x1e')](_0x806572)[_0xf3af('0x23')](function(_0x3c7279){_0x111992[_0xf3af('0x1e')]=_0x3c7279;if(_0x5431fb[_0xf3af('0x2e')][_0xf3af('0x3b')]){_0x230113[_0xf3af('0x3c')]=[{'all':!![]}];}return db[_0xf3af('0x29')][_0xf3af('0x3d')](_0x230113);})[_0xf3af('0x23')](function(_0x34d299){_0x111992[_0xf3af('0x3e')]=_0x34d299;return _0x111992;})['then'](respondWithFilteredResult(_0x2828a5,_0x230113))[_0xf3af('0x3f')](handleError(_0x2828a5,null));};exports[_0xf3af('0x40')]=function(_0x1903f5,_0x4efdde){var _0x2936f0={'raw':![],'where':{'id':_0x1903f5['params']['id']}},_0x27cbd9={};_0x27cbd9[_0xf3af('0x2d')]=_[_0xf3af('0x41')](db['ServicenowAccount']['rawAttributes']);_0x27cbd9['query']=_[_0xf3af('0x41')](_0x1903f5[_0xf3af('0x2e')]);_0x27cbd9['filters']=_[_0xf3af('0x2f')](_0x27cbd9[_0xf3af('0x2d')],_0x27cbd9[_0xf3af('0x2e')]);_0x2936f0[_0xf3af('0x30')]=_[_0xf3af('0x2f')](_0x27cbd9[_0xf3af('0x2d')],qs[_0xf3af('0x31')](_0x1903f5['query'][_0xf3af('0x31')]));_0x2936f0[_0xf3af('0x30')]=_0x2936f0[_0xf3af('0x30')][_0xf3af('0x32')]?_0x2936f0['attributes']:_0x27cbd9[_0xf3af('0x2d')];if(_0x1903f5['query'][_0xf3af('0x3b')]){_0x2936f0['include']=[{'all':!![]}];}_0x2936f0=_[_0xf3af('0x3a')]({},_0x2936f0,_0x1903f5['options']);return db[_0xf3af('0x29')]['find'](_0x2936f0)[_0xf3af('0x23')](handleEntityNotFound(_0x4efdde,null))[_0xf3af('0x23')](respondWithResult(_0x4efdde,null))['catch'](handleError(_0x4efdde,null));};exports['create']=function(_0x249f63,_0x25fd96){return db[_0xf3af('0x29')][_0xf3af('0x42')](_0x249f63['body'],{})[_0xf3af('0x23')](respondWithResult(_0x25fd96,0xc9))[_0xf3af('0x3f')](handleError(_0x25fd96,null));};exports['update']=function(_0x41dd96,_0x4e8b14){if(_0x41dd96[_0xf3af('0x43')]['id']){delete _0x41dd96['body']['id'];}return db[_0xf3af('0x29')][_0xf3af('0x44')]({'where':{'id':_0x41dd96[_0xf3af('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e8b14,null))[_0xf3af('0x23')](saveUpdates(_0x41dd96[_0xf3af('0x43')],null))[_0xf3af('0x23')](respondWithResult(_0x4e8b14,null))[_0xf3af('0x3f')](handleError(_0x4e8b14,null));};exports[_0xf3af('0x22')]=function(_0x3fd266,_0x230815){return db[_0xf3af('0x29')][_0xf3af('0x44')]({'where':{'id':_0x3fd266[_0xf3af('0x45')]['id']}})[_0xf3af('0x23')](handleEntityNotFound(_0x230815,null))[_0xf3af('0x23')](removeEntity(_0x230815,null))['catch'](handleError(_0x230815,null));};exports[_0xf3af('0x46')]=function(_0x13d327,_0xb2b3a4,_0x45fa80){var _0x15a55f={};var _0xbd7d34={};var _0x2c1ecf;var _0x4e2802;return db[_0xf3af('0x29')][_0xf3af('0x47')]({'where':{'id':_0x13d327[_0xf3af('0x45')]['id']}})['then'](handleEntityNotFound(_0xb2b3a4,null))[_0xf3af('0x23')](function(_0x2897bd){if(_0x2897bd){_0x2c1ecf=_0x2897bd;_0xbd7d34[_0xf3af('0x2d')]=_[_0xf3af('0x41')](db[_0xf3af('0x48')][_0xf3af('0x2a')]);_0xbd7d34['query']=_[_0xf3af('0x41')](_0x13d327[_0xf3af('0x2e')]);_0xbd7d34[_0xf3af('0x37')]=_[_0xf3af('0x2f')](_0xbd7d34[_0xf3af('0x2d')],_0xbd7d34[_0xf3af('0x2e')]);_0x15a55f[_0xf3af('0x30')]=_['intersection'](_0xbd7d34[_0xf3af('0x2d')],qs['fields'](_0x13d327[_0xf3af('0x2e')][_0xf3af('0x31')]));_0x15a55f[_0xf3af('0x30')]=_0x15a55f[_0xf3af('0x30')][_0xf3af('0x32')]?_0x15a55f[_0xf3af('0x30')]:_0xbd7d34[_0xf3af('0x2d')];_0x15a55f[_0xf3af('0x34')]=qs['sort'](_0x13d327[_0xf3af('0x2e')][_0xf3af('0x35')]);_0x15a55f[_0xf3af('0x36')]=qs['filters'](_[_0xf3af('0x38')](_0x13d327['query'],_0xbd7d34[_0xf3af('0x37')]));if(_0x13d327['query'][_0xf3af('0x39')]){_0x15a55f[_0xf3af('0x36')]=_['merge'](_0x15a55f[_0xf3af('0x36')],{'$or':_[_0xf3af('0x28')](_0x15a55f[_0xf3af('0x30')],function(_0x3e1b48){var _0x227372={};_0x227372[_0x3e1b48]={'$like':'%'+_0x13d327[_0xf3af('0x2e')][_0xf3af('0x39')]+'%'};return _0x227372;})});}_0x15a55f=_[_0xf3af('0x3a')]({},_0x15a55f,_0x13d327[_0xf3af('0x49')]);return _0x2c1ecf[_0xf3af('0x46')](_0x15a55f);}})[_0xf3af('0x23')](function(_0x46d115){if(_0x46d115){_0x4e2802=_0x46d115[_0xf3af('0x32')];if(!_0x13d327[_0xf3af('0x2e')][_0xf3af('0x4a')](_0xf3af('0x33'))){_0x15a55f['limit']=qs[_0xf3af('0x1d')](_0x13d327[_0xf3af('0x2e')][_0xf3af('0x1d')]);_0x15a55f[_0xf3af('0x1b')]=qs[_0xf3af('0x1b')](_0x13d327[_0xf3af('0x2e')][_0xf3af('0x1b')]);}return _0x2c1ecf[_0xf3af('0x46')](_0x15a55f);}})[_0xf3af('0x23')](function(_0x3e4ea7){if(_0x3e4ea7){return _0x3e4ea7?{'count':_0x4e2802,'rows':_0x3e4ea7}:null;}})[_0xf3af('0x23')](respondWithResult(_0xb2b3a4,null))[_0xf3af('0x3f')](handleError(_0xb2b3a4,null));};exports[_0xf3af('0x4b')]=function(_0x4afc2b,_0x4ed379,_0x5dd486){if(_0x4afc2b['body']['id']){delete _0x4afc2b[_0xf3af('0x43')]['id'];}return db[_0xf3af('0x29')]['findOne']({'where':{'id':_0x4afc2b['params']['id']}})[_0xf3af('0x23')](handleEntityNotFound(_0x4ed379,null))['then'](function(_0x1ff962){if(_0x1ff962){_0x4afc2b['body'][_0xf3af('0x4c')]=_0x1ff962['id'];_0x4afc2b[_0xf3af('0x43')][_0xf3af('0x4d')]=integrations[_0xf3af('0x4e')](_0x4afc2b[_0xf3af('0x43')]['channel'],_0x4afc2b[_0xf3af('0x43')][_0xf3af('0x4f')]);_0x4afc2b[_0xf3af('0x43')]['Descriptions']=integrations['getDescriptions'](_0x4afc2b['body'][_0xf3af('0x50')],_0x4afc2b[_0xf3af('0x43')][_0xf3af('0x4f')]);return db[_0xf3af('0x48')][_0xf3af('0x42')](_0x4afc2b[_0xf3af('0x43')],{'include':[{'model':db[_0xf3af('0x51')],'as':_0xf3af('0x4d')},{'model':db[_0xf3af('0x51')],'as':_0xf3af('0x52')}]});}return null;})[_0xf3af('0x23')](respondWithResult(_0x4ed379,null))[_0xf3af('0x3f')](handleError(_0x4ed379,null));};exports['getFields']=function(_0x62490c,_0xfaae4b,_0xacc46f){var _0x54d7ca=[_0xf3af('0x53'),_0xf3af('0x54'),'knowledge',_0xf3af('0x55'),_0xf3af('0x56'),'notify','incident_state',_0xf3af('0x57'),'category'];var _0x4c2eb3=[_0xf3af('0x58'),_0xf3af('0x53'),'caused_by',_0xf3af('0x59'),_0xf3af('0x5a'),_0xf3af('0x5b'),'child_incidents','hold_reason',_0xf3af('0x5c'),_0xf3af('0x5d'),_0xf3af('0x5e'),_0xf3af('0x5f'),_0xf3af('0x60'),'user_input',_0xf3af('0x61'),_0xf3af('0x62'),_0xf3af('0x63'),_0xf3af('0x64'),_0xf3af('0x65'),_0xf3af('0x34'),_0xf3af('0x66'),'closed_at',_0xf3af('0x67'),'delivery_plan',_0xf3af('0x68'),_0xf3af('0x69'),'work_notes_list',_0xf3af('0x6a'),_0xf3af('0x6b'),'sys_domain_path',_0xf3af('0x6c'),_0xf3af('0x6d'),_0xf3af('0x6e'),'opened_at',_0xf3af('0x6f'),_0xf3af('0x70'),_0xf3af('0x71'),_0xf3af('0x72'),'resolved_at','caller_id',_0xf3af('0x73'),_0xf3af('0x55'),_0xf3af('0x74'),_0xf3af('0x75'),_0xf3af('0x56'),'correlation_display',_0xf3af('0x76'),_0xf3af('0x77'),'assignment_group',_0xf3af('0x78'),_0xf3af('0x79'),_0xf3af('0x7a'),_0xf3af('0x7b'),_0xf3af('0x7c'),'sys_class_name',_0xf3af('0x7d'),_0xf3af('0x7e'),_0xf3af('0x7f'),_0xf3af('0x80'),'sys_id',_0xf3af('0x81'),_0xf3af('0x82'),'incident_state',_0xf3af('0x83'),_0xf3af('0x84'),_0xf3af('0x85'),_0xf3af('0x86'),_0xf3af('0x87'),_0xf3af('0x88'),_0xf3af('0x57'),'comments',_0xf3af('0x89'),_0xf3af('0x8a'),_0xf3af('0x8b'),_0xf3af('0x8c'),'sys_mod_count',_0xf3af('0x8d'),_0xf3af('0x8e'),_0xf3af('0x8f'),_0xf3af('0x90'),'correlation_id',_0xf3af('0x91'),_0xf3af('0x92')];var _0x27a3f4='';var _0x10e36d='';var _0xb297e=[];var _0x4d4b84='';var _0x36f240='';var _0x50e4bd=[];var _0x109f14='';var _0x3c9ec7='';var _0x33fe17={};var _0x19965f='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x62490c[_0xf3af('0x45')]['id']},'attributes':['id','username',_0xf3af('0x93'),_0xf3af('0x94'),_0xf3af('0x95'),_0xf3af('0x96')]})[_0xf3af('0x23')](handleEntityNotFound(_0xfaae4b,null))[_0xf3af('0x23')](function(_0x2d23e2){if(_0x2d23e2){_0x19965f=_0x2d23e2['remoteUri'];var _0x3f8baf=_0x19965f[_0xf3af('0x97')](-0x1);if(_0x3f8baf==='/'){_0x19965f=_0x19965f['substring'](0x0,_0x19965f[_0xf3af('0x98')](_0x3f8baf));}_0x3c9ec7=util[_0xf3af('0x99')](_0xf3af('0x9a'),_0x19965f);_0x109f14=util[_0xf3af('0x99')](_0xf3af('0x9b'),_0x19965f);_0x33fe17={'user':_0x2d23e2[_0xf3af('0x9c')],'pass':_0x2d23e2['password']};var _0x378ab3={'method':_0xf3af('0x9d'),'uri':_0x3c9ec7+_0xf3af('0x9e'),'auth':_0x33fe17,'json':!![]};return rp(_0x378ab3);}})[_0xf3af('0x23')](function(_0x9b4c4c){if(_0x9b4c4c['result']['length']>0x0){_0x27a3f4=_0x9b4c4c[_0xf3af('0x9f')];}console[_0xf3af('0xa0')]('incident\x20table\x20objects',_0x27a3f4);_0x50e4bd=[];_0x10e36d=Object[_0xf3af('0xa1')]([],_0x27a3f4);_['remove'](_0x10e36d,function(_0x38d989){return!_0x54d7ca['includes'](_0x38d989[_0xf3af('0x26')]);});_0x10e36d[_0xf3af('0xa2')](function(_0x2b3ee7){var _0x30865e=createFieldObject(_0x109f14,_0x33fe17,_0x2b3ee7['internalType'],_0x2b3ee7['name'],_0x2b3ee7[_0xf3af('0xa3')],![]);_0x50e4bd[_0xf3af('0xa4')](_0x30865e);});return Promise[_0xf3af('0xa5')](_0x50e4bd);})[_0xf3af('0x23')](function(_0x269446){_0xb297e=_0x269446;_0x4d4b84=Object['assign']([],_0x27a3f4);console[_0xf3af('0xa0')]('TCL:\x20_object',_0x27a3f4);_[_0xf3af('0xa6')](_0x4d4b84,function(_0x123f9f){return _0x4c2eb3['includes'](_0x123f9f['name']);});console[_0xf3af('0xa0')](_0xf3af('0xa7'),_0x4d4b84);_0x50e4bd=[];_0x4d4b84[_0xf3af('0xa2')](function(_0x27661a){var _0x2e5491=createFieldObject(_0x109f14,_0x33fe17,_0x27661a[_0xf3af('0xa8')],_0x27661a[_0xf3af('0x26')],_0x27661a[_0xf3af('0xa3')],!![]);_0x50e4bd[_0xf3af('0xa4')](_0x2e5491);});return Promise[_0xf3af('0xa5')](_0x50e4bd);})[_0xf3af('0x23')](function(_0x40374c){_0x36f240=_0x40374c;var _0x49583e=_0xb297e[_0xf3af('0xa9')](_0x36f240);return{'count':_0x49583e[_0xf3af('0x32')],'rows':_0x49583e};})[_0xf3af('0x23')](respondWithResult(_0xfaae4b,null))[_0xf3af('0x3f')](function(_0x276b00){console[_0xf3af('0xa0')]('ServiceNow\x20error:\x20'+_0x276b00);var _0x1efb3a=_0x62490c[_0xf3af('0x2e')][_0xf3af('0xaa')]?0x1f4:_0x276b00[_0xf3af('0xab')]||0x1f4;logger['error'](_0x276b00['stack']);delete _0x276b00['name'];if(_0x1efb3a===0x191){_0x1efb3a=0x190;}_0xfaae4b[_0xf3af('0x18')](_0x1efb3a)[_0xf3af('0xac')](_0x62490c[_0xf3af('0x2e')][_0xf3af('0xaa')]?{'message':'Wrong\x20credentials','statusCode':_0x276b00['statusCode']}:_0x276b00);});};function createFieldObject(_0x584845,_0x4ae09f,_0x3f8d23,_0x5e3c23,_0x4ff431,_0x4aa93c){return new Promise(function(_0x292a72,_0x3ac3de){var _0x1b516f={'id':_0x5e3c23,'name':_0x4ff431,'custom':_0x4aa93c};if(_0x3f8d23===_0xf3af('0xad')){_0x1b516f[_0xf3af('0x49')]=[{'name':'True','value':_0xf3af('0xae')},{'name':'False','value':_0xf3af('0xaf')}];_0x292a72(_0x1b516f);}else{var _0x399d7f={'method':_0xf3af('0x9d'),'uri':_0x584845+_0xf3af('0xb0')+_0x5e3c23,'auth':_0x4ae09f,'json':!![]};return rp(_0x399d7f)[_0xf3af('0x23')](function(_0x501441){var _0x65ce1e=[];if(_0x501441[_0xf3af('0x9f')][_0xf3af('0x32')]>0x0){_0x501441[_0xf3af('0x9f')][_0xf3af('0xa2')](function(_0x19fa97){if(_0x19fa97['inactive']===_0xf3af('0xaf')){var _0x4fc4e0={'name':_0x19fa97[_0xf3af('0xa3')],'value':_0x19fa97[_0xf3af('0xb1')]};_0x65ce1e[_0xf3af('0xa4')](_0x4fc4e0);}});}_0x1b516f[_0xf3af('0x49')]=_0x65ce1e;if(_0x1b516f[_0xf3af('0x49')][_0xf3af('0x32')]>0x0){_0x292a72(_0x1b516f);}else{if(_0x4aa93c==![]){_0x292a72();}else{_0x292a72(_0x1b516f);}}});}});} \ No newline at end of file +var _0x429a=['send','index','map','ServicenowAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','include','merge','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','severity','category','parent','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','incident_state','urgency','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','email','remoteUri','slice','lastIndexOf','format','%s/api/now/table/','username','password','incident?sysparm_display_value=all','incident\x20table\x20objects','assign','includes','internalType','label','push','all','log','remove','forEach','concat','test','statusCode','stack','Wrong\x20credentials','boolean','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','name'];(function(_0x5a18d4,_0xd119b4){var _0x843a23=function(_0x2decb5){while(--_0x2decb5){_0x5a18d4['push'](_0x5a18d4['shift']());}};_0x843a23(++_0xd119b4);}(_0x429a,0x8c));var _0xa429=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x429a[_0x1e2321];return _0x1d346d;};'use strict';var emlformat=require(_0xa429('0x0'));var rimraf=require(_0xa429('0x1'));var zipdir=require(_0xa429('0x2'));var jsonpatch=require(_0xa429('0x3'));var rp=require(_0xa429('0x4'));var moment=require(_0xa429('0x5'));var BPromise=require(_0xa429('0x6'));var Mustache=require(_0xa429('0x7'));var util=require(_0xa429('0x8'));var path=require(_0xa429('0x9'));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('squel');var crypto=require(_0xa429('0xa'));var jsforce=require(_0xa429('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa429('0xc'));var querystring=require(_0xa429('0xd'));var Papa=require('papaparse');var Redis=require(_0xa429('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa429('0xf'));var as=require(_0xa429('0x10'));var hardwareService=require(_0xa429('0x11'));var logger=require('../../config/logger')(_0xa429('0x12'));var utils=require(_0xa429('0x13'));var config=require(_0xa429('0x14'));var licenseUtil=require(_0xa429('0x15'));var db=require(_0xa429('0x16'))['db'];var integrations=require(_0xa429('0x17'));function respondWithStatusCode(_0x1d783a,_0x3e497c){_0x3e497c=_0x3e497c||0xcc;return function(_0x648a6a){if(_0x648a6a){return _0x1d783a[_0xa429('0x18')](_0x3e497c);}return _0x1d783a[_0xa429('0x19')](_0x3e497c)[_0xa429('0x1a')]();};}function respondWithResult(_0xced9d,_0x57f9f0){_0x57f9f0=_0x57f9f0||0xc8;return function(_0x462691){if(_0x462691){return _0xced9d[_0xa429('0x19')](_0x57f9f0)[_0xa429('0x1b')](_0x462691);}};}function respondWithFilteredResult(_0x5831d4,_0x477660){return function(_0x3c5ee9){if(_0x3c5ee9){var _0x46e290=typeof _0x477660[_0xa429('0x1c')]==='undefined'&&typeof _0x477660[_0xa429('0x1d')]===_0xa429('0x1e');var _0x2a9723=_0x3c5ee9[_0xa429('0x1f')];var _0x2b6afa=_0x46e290?0x0:_0x477660['offset'];var _0x2e440c=_0x46e290?_0x3c5ee9[_0xa429('0x1f')]:_0x477660[_0xa429('0x1c')]+_0x477660[_0xa429('0x1d')];var _0x4ebe8b;if(_0x2e440c>=_0x2a9723){_0x2e440c=_0x2a9723;_0x4ebe8b=0xc8;}else{_0x4ebe8b=0xce;}_0x5831d4[_0xa429('0x19')](_0x4ebe8b);return _0x5831d4[_0xa429('0x20')](_0xa429('0x21'),_0x2b6afa+'-'+_0x2e440c+'/'+_0x2a9723)['json'](_0x3c5ee9);}return null;};}function patchUpdates(_0x577d77){return function(_0xde30cf){try{jsonpatch[_0xa429('0x22')](_0xde30cf,_0x577d77,!![]);}catch(_0x116ee1){return BPromise[_0xa429('0x23')](_0x116ee1);}return _0xde30cf['save']();};}function saveUpdates(_0x1ffef3,_0x56e38a){return function(_0x2a4a53){if(_0x2a4a53){return _0x2a4a53[_0xa429('0x24')](_0x1ffef3)[_0xa429('0x25')](function(_0x346eef){return _0x346eef;});}return null;};}function removeEntity(_0x3dc9f2,_0x422b10){return function(_0x4f5abd){if(_0x4f5abd){return _0x4f5abd['destroy']()[_0xa429('0x25')](function(){_0x3dc9f2['status'](0xcc)[_0xa429('0x1a')]();});}};}function handleEntityNotFound(_0x3c7f02,_0x2db3a2){return function(_0x58e685){if(!_0x58e685){_0x3c7f02['sendStatus'](0x194);}return _0x58e685;};}function handleError(_0xfce724,_0x89767){_0x89767=_0x89767||0x1f4;return function(_0x51d31a){logger['error'](_0x51d31a['stack']);if(_0x51d31a[_0xa429('0x26')]){delete _0x51d31a[_0xa429('0x26')];}_0xfce724[_0xa429('0x19')](_0x89767)[_0xa429('0x27')](_0x51d31a);};}exports[_0xa429('0x28')]=function(_0x70fd78,_0x49d2f4){var _0x278b2c={},_0x1180a0={},_0x4f4633={'count':0x0,'rows':[]};var _0x2264bc=_[_0xa429('0x29')](db[_0xa429('0x2a')]['rawAttributes'],function(_0x224bfe){return{'name':_0x224bfe[_0xa429('0x2b')],'type':_0x224bfe[_0xa429('0x2c')][_0xa429('0x2d')]};});_0x1180a0[_0xa429('0x2e')]=_['map'](_0x2264bc,'name');_0x1180a0['query']=_[_0xa429('0x2f')](_0x70fd78[_0xa429('0x30')]);_0x1180a0[_0xa429('0x31')]=_[_0xa429('0x32')](_0x1180a0[_0xa429('0x2e')],_0x1180a0[_0xa429('0x30')]);_0x278b2c[_0xa429('0x33')]=_[_0xa429('0x32')](_0x1180a0['model'],qs[_0xa429('0x34')](_0x70fd78[_0xa429('0x30')][_0xa429('0x34')]));_0x278b2c[_0xa429('0x33')]=_0x278b2c['attributes'][_0xa429('0x35')]?_0x278b2c[_0xa429('0x33')]:_0x1180a0[_0xa429('0x2e')];if(!_0x70fd78[_0xa429('0x30')][_0xa429('0x36')](_0xa429('0x37'))){_0x278b2c[_0xa429('0x1d')]=qs[_0xa429('0x1d')](_0x70fd78[_0xa429('0x30')][_0xa429('0x1d')]);_0x278b2c[_0xa429('0x1c')]=qs[_0xa429('0x1c')](_0x70fd78[_0xa429('0x30')][_0xa429('0x1c')]);}_0x278b2c['order']=qs[_0xa429('0x38')](_0x70fd78['query'][_0xa429('0x38')]);_0x278b2c[_0xa429('0x39')]=qs[_0xa429('0x31')](_[_0xa429('0x3a')](_0x70fd78[_0xa429('0x30')],_0x1180a0[_0xa429('0x31')]),_0x2264bc);if(_0x70fd78[_0xa429('0x30')][_0xa429('0x3b')]){_0x278b2c[_0xa429('0x39')]=_['merge'](_0x278b2c[_0xa429('0x39')],{'$or':_[_0xa429('0x29')](_0x2264bc,function(_0x28ab00){if(_0x28ab00[_0xa429('0x2c')]!==_0xa429('0x3c')){var _0x427813={};_0x427813[_0x28ab00['name']]={'$like':'%'+_0x70fd78[_0xa429('0x30')]['filter']+'%'};return _0x427813;}})});}_0x278b2c=_['merge']({},_0x278b2c,_0x70fd78[_0xa429('0x3d')]);var _0x2e6a3c={'where':_0x278b2c[_0xa429('0x39')]};return db['ServicenowAccount'][_0xa429('0x1f')](_0x2e6a3c)[_0xa429('0x25')](function(_0x5ab655){_0x4f4633[_0xa429('0x1f')]=_0x5ab655;if(_0x70fd78[_0xa429('0x30')][_0xa429('0x3e')]){_0x278b2c['include']=[{'all':!![]}];}return db[_0xa429('0x2a')][_0xa429('0x3f')](_0x278b2c);})[_0xa429('0x25')](function(_0x5ccdcf){_0x4f4633['rows']=_0x5ccdcf;return _0x4f4633;})['then'](respondWithFilteredResult(_0x49d2f4,_0x278b2c))[_0xa429('0x40')](handleError(_0x49d2f4,null));};exports['show']=function(_0x1a0bfa,_0x496b47){var _0x1d191e={'raw':![],'where':{'id':_0x1a0bfa['params']['id']}},_0x2637bb={};_0x2637bb[_0xa429('0x2e')]=_[_0xa429('0x2f')](db[_0xa429('0x2a')][_0xa429('0x41')]);_0x2637bb[_0xa429('0x30')]=_[_0xa429('0x2f')](_0x1a0bfa[_0xa429('0x30')]);_0x2637bb[_0xa429('0x31')]=_[_0xa429('0x32')](_0x2637bb[_0xa429('0x2e')],_0x2637bb[_0xa429('0x30')]);_0x1d191e[_0xa429('0x33')]=_[_0xa429('0x32')](_0x2637bb['model'],qs['fields'](_0x1a0bfa['query'][_0xa429('0x34')]));_0x1d191e[_0xa429('0x33')]=_0x1d191e['attributes'][_0xa429('0x35')]?_0x1d191e['attributes']:_0x2637bb[_0xa429('0x2e')];if(_0x1a0bfa[_0xa429('0x30')][_0xa429('0x3e')]){_0x1d191e[_0xa429('0x42')]=[{'all':!![]}];}_0x1d191e=_[_0xa429('0x43')]({},_0x1d191e,_0x1a0bfa['options']);return db['ServicenowAccount'][_0xa429('0x44')](_0x1d191e)[_0xa429('0x25')](handleEntityNotFound(_0x496b47,null))[_0xa429('0x25')](respondWithResult(_0x496b47,null))[_0xa429('0x40')](handleError(_0x496b47,null));};exports[_0xa429('0x45')]=function(_0x36cf74,_0x2958f6){return db[_0xa429('0x2a')]['create'](_0x36cf74[_0xa429('0x46')],{})[_0xa429('0x25')](respondWithResult(_0x2958f6,0xc9))[_0xa429('0x40')](handleError(_0x2958f6,null));};exports[_0xa429('0x24')]=function(_0x1a8275,_0x2d7430){if(_0x1a8275['body']['id']){delete _0x1a8275[_0xa429('0x46')]['id'];}return db[_0xa429('0x2a')]['find']({'where':{'id':_0x1a8275[_0xa429('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d7430,null))['then'](saveUpdates(_0x1a8275['body'],null))[_0xa429('0x25')](respondWithResult(_0x2d7430,null))[_0xa429('0x40')](handleError(_0x2d7430,null));};exports['destroy']=function(_0x5bf28c,_0x15601a){return db[_0xa429('0x2a')]['find']({'where':{'id':_0x5bf28c[_0xa429('0x47')]['id']}})[_0xa429('0x25')](handleEntityNotFound(_0x15601a,null))[_0xa429('0x25')](removeEntity(_0x15601a,null))[_0xa429('0x40')](handleError(_0x15601a,null));};exports[_0xa429('0x48')]=function(_0x460bf6,_0x32c40b,_0x26c693){var _0x5288b6={};var _0x3d762f={};var _0x22910c;var _0x450eab;return db[_0xa429('0x2a')][_0xa429('0x49')]({'where':{'id':_0x460bf6[_0xa429('0x47')]['id']}})[_0xa429('0x25')](handleEntityNotFound(_0x32c40b,null))[_0xa429('0x25')](function(_0x4f96e9){if(_0x4f96e9){_0x22910c=_0x4f96e9;_0x3d762f['model']=_[_0xa429('0x2f')](db[_0xa429('0x4a')][_0xa429('0x41')]);_0x3d762f['query']=_[_0xa429('0x2f')](_0x460bf6[_0xa429('0x30')]);_0x3d762f[_0xa429('0x31')]=_[_0xa429('0x32')](_0x3d762f[_0xa429('0x2e')],_0x3d762f[_0xa429('0x30')]);_0x5288b6['attributes']=_['intersection'](_0x3d762f['model'],qs[_0xa429('0x34')](_0x460bf6[_0xa429('0x30')][_0xa429('0x34')]));_0x5288b6[_0xa429('0x33')]=_0x5288b6[_0xa429('0x33')][_0xa429('0x35')]?_0x5288b6[_0xa429('0x33')]:_0x3d762f[_0xa429('0x2e')];_0x5288b6[_0xa429('0x4b')]=qs[_0xa429('0x38')](_0x460bf6[_0xa429('0x30')]['sort']);_0x5288b6['where']=qs[_0xa429('0x31')](_[_0xa429('0x3a')](_0x460bf6[_0xa429('0x30')],_0x3d762f[_0xa429('0x31')]));if(_0x460bf6[_0xa429('0x30')]['filter']){_0x5288b6[_0xa429('0x39')]=_['merge'](_0x5288b6['where'],{'$or':_['map'](_0x5288b6[_0xa429('0x33')],function(_0x415e65){var _0x19c42c={};_0x19c42c[_0x415e65]={'$like':'%'+_0x460bf6['query'][_0xa429('0x3b')]+'%'};return _0x19c42c;})});}_0x5288b6=_['merge']({},_0x5288b6,_0x460bf6[_0xa429('0x3d')]);return _0x22910c[_0xa429('0x48')](_0x5288b6);}})[_0xa429('0x25')](function(_0x3f4edc){if(_0x3f4edc){_0x450eab=_0x3f4edc[_0xa429('0x35')];if(!_0x460bf6[_0xa429('0x30')][_0xa429('0x36')]('nolimit')){_0x5288b6[_0xa429('0x1d')]=qs['limit'](_0x460bf6[_0xa429('0x30')]['limit']);_0x5288b6['offset']=qs[_0xa429('0x1c')](_0x460bf6[_0xa429('0x30')][_0xa429('0x1c')]);}return _0x22910c[_0xa429('0x48')](_0x5288b6);}})[_0xa429('0x25')](function(_0x1e2ea3){if(_0x1e2ea3){return _0x1e2ea3?{'count':_0x450eab,'rows':_0x1e2ea3}:null;}})[_0xa429('0x25')](respondWithResult(_0x32c40b,null))['catch'](handleError(_0x32c40b,null));};exports[_0xa429('0x4c')]=function(_0xa07a7,_0x2dc765,_0x4878ed){if(_0xa07a7['body']['id']){delete _0xa07a7[_0xa429('0x46')]['id'];}return db[_0xa429('0x2a')][_0xa429('0x49')]({'where':{'id':_0xa07a7[_0xa429('0x47')]['id']}})[_0xa429('0x25')](handleEntityNotFound(_0x2dc765,null))[_0xa429('0x25')](function(_0x32be55){if(_0x32be55){_0xa07a7['body'][_0xa429('0x4d')]=_0x32be55['id'];_0xa07a7['body'][_0xa429('0x4e')]=integrations[_0xa429('0x4f')](_0xa07a7[_0xa429('0x46')][_0xa429('0x50')],_0xa07a7[_0xa429('0x46')][_0xa429('0x2c')]);_0xa07a7[_0xa429('0x46')]['Descriptions']=integrations['getDescriptions'](_0xa07a7[_0xa429('0x46')][_0xa429('0x50')],_0xa07a7[_0xa429('0x46')]['type']);return db[_0xa429('0x4a')]['create'](_0xa07a7[_0xa429('0x46')],{'include':[{'model':db['ServicenowField'],'as':_0xa429('0x4e')},{'model':db[_0xa429('0x51')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2dc765,null))[_0xa429('0x40')](handleError(_0x2dc765,null));};exports[_0xa429('0x52')]=function(_0x5d6f90,_0xfe3e0f,_0x4ffc27){var _0x1d68d7=[_0xa429('0x53'),'hold_reason',_0xa429('0x54'),_0xa429('0x55'),_0xa429('0x56'),'notify','incident_state',_0xa429('0x57'),_0xa429('0x58')];var _0x2243d6=[_0xa429('0x59'),_0xa429('0x53'),'caused_by','watch_list',_0xa429('0x5a'),_0xa429('0x5b'),_0xa429('0x5c'),_0xa429('0x5d'),_0xa429('0x5e'),_0xa429('0x5f'),'resolved_by','sys_updated_by',_0xa429('0x60'),_0xa429('0x61'),_0xa429('0x62'),_0xa429('0x63'),_0xa429('0x64'),_0xa429('0x65'),_0xa429('0x54'),_0xa429('0x4b'),'calendar_stc','closed_at',_0xa429('0x66'),'delivery_plan',_0xa429('0x67'),_0xa429('0x68'),_0xa429('0x69'),_0xa429('0x6a'),'priority',_0xa429('0x6b'),_0xa429('0x6c'),_0xa429('0x6d'),'expected_start',_0xa429('0x6e'),'business_duration',_0xa429('0x6f'),_0xa429('0x70'),_0xa429('0x71'),_0xa429('0x72'),_0xa429('0x73'),'approval_set',_0xa429('0x55'),_0xa429('0x74'),_0xa429('0x75'),'close_code',_0xa429('0x76'),'delivery_task','work_start',_0xa429('0x77'),_0xa429('0x78'),_0xa429('0x79'),_0xa429('0x7a'),_0xa429('0x7b'),_0xa429('0x7c'),_0xa429('0x7d'),_0xa429('0x7e'),_0xa429('0x7f'),_0xa429('0x80'),_0xa429('0x81'),_0xa429('0x82'),_0xa429('0x83'),'reopened_by',_0xa429('0x84'),_0xa429('0x85'),'problem_id','company',_0xa429('0x86'),_0xa429('0x87'),'assigned_to',_0xa429('0x57'),_0xa429('0x88'),_0xa429('0x89'),_0xa429('0x8a'),_0xa429('0x8b'),'due_date',_0xa429('0x8c'),_0xa429('0x8d'),_0xa429('0x8e'),'escalation',_0xa429('0x8f'),_0xa429('0x90'),_0xa429('0x91'),_0xa429('0x58')];var _0x443776='';var _0x37bff8='';var _0x3d6ba5=[];var _0xbf49dd='';var _0x59e788='';var _0x2a4a1f=[];var _0x4f7e2f='';var _0x18112d='';var _0x55349d={};var _0x4f10f4='';return db[_0xa429('0x2a')][_0xa429('0x49')]({'where':{'id':_0x5d6f90['params']['id']},'attributes':['id','username','password',_0xa429('0x92'),'remoteUri','serverUrl']})[_0xa429('0x25')](handleEntityNotFound(_0xfe3e0f,null))['then'](function(_0x1e07c8){if(_0x1e07c8){_0x4f10f4=_0x1e07c8[_0xa429('0x93')];var _0xc6ac73=_0x4f10f4[_0xa429('0x94')](-0x1);if(_0xc6ac73==='/'){_0x4f10f4=_0x4f10f4['substring'](0x0,_0x4f10f4[_0xa429('0x95')](_0xc6ac73));}_0x18112d=util[_0xa429('0x96')]('%s/api/now/doc/table/schema/',_0x4f10f4);_0x4f7e2f=util[_0xa429('0x96')](_0xa429('0x97'),_0x4f10f4);_0x55349d={'user':_0x1e07c8[_0xa429('0x98')],'pass':_0x1e07c8[_0xa429('0x99')]};var _0x7e27a5={'method':'GET','uri':_0x18112d+_0xa429('0x9a'),'auth':_0x55349d,'json':!![]};return rp(_0x7e27a5);}})[_0xa429('0x25')](function(_0x4687f4){if(_0x4687f4['result'][_0xa429('0x35')]>0x0){_0x443776=_0x4687f4['result'];}console['log'](_0xa429('0x9b'),_0x443776);_0x2a4a1f=[];_0x37bff8=Object[_0xa429('0x9c')]([],_0x443776);_['remove'](_0x37bff8,function(_0x48d967){return!_0x1d68d7[_0xa429('0x9d')](_0x48d967[_0xa429('0x26')]);});_0x37bff8['forEach'](function(_0xbd6ed7){var _0x20d64=createFieldObject(_0x4f7e2f,_0x55349d,_0xbd6ed7[_0xa429('0x9e')],_0xbd6ed7[_0xa429('0x26')],_0xbd6ed7[_0xa429('0x9f')],![]);_0x2a4a1f[_0xa429('0xa0')](_0x20d64);});return Promise[_0xa429('0xa1')](_0x2a4a1f);})[_0xa429('0x25')](function(_0x3677e4){_0x3d6ba5=_0x3677e4;_0xbf49dd=Object[_0xa429('0x9c')]([],_0x443776);console[_0xa429('0xa2')]('TCL:\x20_object',_0x443776);_[_0xa429('0xa3')](_0xbf49dd,function(_0x58f56d){return _0x2243d6[_0xa429('0x9d')](_0x58f56d['name']);});console[_0xa429('0xa2')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0xbf49dd);_0x2a4a1f=[];_0xbf49dd[_0xa429('0xa4')](function(_0x14adb6){var _0x256333=createFieldObject(_0x4f7e2f,_0x55349d,_0x14adb6['internalType'],_0x14adb6[_0xa429('0x26')],_0x14adb6[_0xa429('0x9f')],!![]);_0x2a4a1f[_0xa429('0xa0')](_0x256333);});return Promise['all'](_0x2a4a1f);})[_0xa429('0x25')](function(_0x7586fe){_0x59e788=_0x7586fe;var _0x4122fc=_0x3d6ba5[_0xa429('0xa5')](_0x59e788);return{'count':_0x4122fc[_0xa429('0x35')],'rows':_0x4122fc};})[_0xa429('0x25')](respondWithResult(_0xfe3e0f,null))[_0xa429('0x40')](function(_0x518d5b){console['log']('ServiceNow\x20error:\x20'+_0x518d5b);var _0x4fbce5=_0x5d6f90[_0xa429('0x30')][_0xa429('0xa6')]?0x1f4:_0x518d5b[_0xa429('0xa7')]||0x1f4;logger['error'](_0x518d5b[_0xa429('0xa8')]);delete _0x518d5b[_0xa429('0x26')];if(_0x4fbce5===0x191){_0x4fbce5=0x190;}_0xfe3e0f[_0xa429('0x19')](_0x4fbce5)[_0xa429('0x27')](_0x5d6f90['query'][_0xa429('0xa6')]?{'message':_0xa429('0xa9'),'statusCode':_0x518d5b['statusCode']}:_0x518d5b);});};function createFieldObject(_0x3c211c,_0x2a3318,_0x1f0c4e,_0x1c36ec,_0x421611,_0x2a905d){return new Promise(function(_0x3042bc,_0x173295){var _0x2828a8={'id':_0x1c36ec,'name':_0x421611,'custom':_0x2a905d};if(_0x1f0c4e===_0xa429('0xaa')){_0x2828a8[_0xa429('0x3d')]=[{'name':'True','value':_0xa429('0xab')},{'name':_0xa429('0xac'),'value':_0xa429('0xad')}];_0x3042bc(_0x2828a8);}else{var _0x2f66a5={'method':_0xa429('0xae'),'uri':_0x3c211c+_0xa429('0xaf')+_0x1c36ec,'auth':_0x2a3318,'json':!![]};return rp(_0x2f66a5)[_0xa429('0x25')](function(_0x58b47c){var _0x59e30f=[];if(_0x58b47c[_0xa429('0xb0')][_0xa429('0x35')]>0x0){_0x58b47c['result']['forEach'](function(_0x27141e){if(_0x27141e[_0xa429('0xb1')]===_0xa429('0xad')){var _0x47aab0={'name':_0x27141e[_0xa429('0x9f')],'value':_0x27141e[_0xa429('0xb2')]};_0x59e30f[_0xa429('0xa0')](_0x47aab0);}});}_0x2828a8[_0xa429('0x3d')]=_0x59e30f;if(_0x2828a8[_0xa429('0x3d')][_0xa429('0x35')]>0x0){_0x3042bc(_0x2828a8);}else{if(_0x2a905d==![]){_0x3042bc();}else{_0x3042bc(_0x2828a8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 8ca3db4..779e40f 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 _0xe14b=['bluebird','path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','moment'];(function(_0x470319,_0x891ce8){var _0xfad8f7=function(_0x3e0745){while(--_0x3e0745){_0x470319['push'](_0x470319['shift']());}};_0xfad8f7(++_0x891ce8);}(_0xe14b,0x93));var _0xbe14=function(_0x3554f6,_0x3df0c1){_0x3554f6=_0x3554f6-0x0;var _0x5113aa=_0xe14b[_0x3554f6];return _0x5113aa;};'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'));var integrations=require(_0xbe14('0x6'));module[_0xbe14('0x7')]=function(_0x1ff100,_0x1d9ade){return _0x1ff100[_0xbe14('0x8')](_0xbe14('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['bluebird','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment'];(function(_0x235f7e,_0x147fa7){var _0x3f27e1=function(_0x27ef96){while(--_0x27ef96){_0x235f7e['push'](_0x235f7e['shift']());}};_0x3f27e1(++_0x147fa7);}(_0x46ed,0x168));var _0xd46e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x46ed[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));var integrations=require(_0xd46e('0x8'));module[_0xd46e('0x9')]=function(_0x25cf78,_0x45e680){return _0x25cf78[_0xd46e('0xa')](_0xd46e('0xb'),attributes,{'tableName':_0xd46e('0xc'),'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 3474b74..a3f7aba 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 _0x2b8a=['stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','attributes','include','model','map','catch','ShowServicenowAccount','find','raw','where','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0xe9099e,_0x3e387d){var _0x25fedd=function(_0x251efb){while(--_0x251efb){_0xe9099e['push'](_0xe9099e['shift']());}};_0x25fedd(++_0x3e387d);}(_0x2b8a,0x122));var _0xa2b8=function(_0x2098aa,_0x4ac851){_0x2098aa=_0x2098aa-0x0;var _0x530b28=_0x2b8a[_0x2098aa];return _0x530b28;};'use strict';var _=require(_0xa2b8('0x0'));var util=require('util');var moment=require(_0xa2b8('0x1'));var BPromise=require(_0xa2b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa2b8('0x4'))(_0xa2b8('0x5'));var config=require(_0xa2b8('0x6'));var jayson=require(_0xa2b8('0x7'));var client=jayson[_0xa2b8('0x8')][_0xa2b8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x355b11,_0x1bc0a6,_0x469955){return new BPromise(function(_0x36c8c4,_0xf86648){return client['request'](_0x355b11,_0x469955)[_0xa2b8('0xa')](function(_0x22a072){logger[_0xa2b8('0xb')](_0xa2b8('0xc'),_0x1bc0a6,_0xa2b8('0xd'));logger[_0xa2b8('0xe')](_0xa2b8('0xf'),_0x1bc0a6,_0xa2b8('0xd'),JSON[_0xa2b8('0x10')](_0x22a072));if(_0x22a072['error']){if(_0x22a072[_0xa2b8('0x11')][_0xa2b8('0x12')]===0x1f4){logger[_0xa2b8('0x11')](_0xa2b8('0xc'),_0x1bc0a6,_0x22a072[_0xa2b8('0x11')]['message']);return _0xf86648(_0x22a072[_0xa2b8('0x11')][_0xa2b8('0x13')]);}logger[_0xa2b8('0x11')](_0xa2b8('0xc'),_0x1bc0a6,_0x22a072[_0xa2b8('0x11')][_0xa2b8('0x13')]);return _0x36c8c4(_0x22a072[_0xa2b8('0x11')]['message']);}else{logger[_0xa2b8('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x1bc0a6,_0xa2b8('0xd'));_0x36c8c4(_0x22a072[_0xa2b8('0x14')][_0xa2b8('0x13')]);}})['catch'](function(_0x333792){logger[_0xa2b8('0x11')](_0xa2b8('0xc'),_0x1bc0a6,_0x333792);_0xf86648(_0x333792);});});}exports[_0xa2b8('0x15')]=function(_0x400dde){var _0x44d05e=this;return new Promise(function(_0x599ff2,_0x1db1fe){return db[_0xa2b8('0x16')][_0xa2b8('0x17')]({'raw':_0x400dde[_0xa2b8('0x18')]?_0x400dde['options']['raw']===undefined?!![]:![]:!![],'where':_0x400dde[_0xa2b8('0x18')]?_0x400dde[_0xa2b8('0x18')]['where']||null:null,'attributes':_0x400dde['options']?_0x400dde[_0xa2b8('0x18')][_0xa2b8('0x19')]||null:null,'limit':_0x400dde[_0xa2b8('0x18')]?_0x400dde['options']['limit']||null:null,'include':_0x400dde[_0xa2b8('0x18')]?_0x400dde[_0xa2b8('0x18')][_0xa2b8('0x1a')]?_['map'](_0x400dde[_0xa2b8('0x18')][_0xa2b8('0x1a')],function(_0x4ba99c){return{'model':db[_0x4ba99c['model']],'as':_0x4ba99c['as'],'attributes':_0x4ba99c[_0xa2b8('0x19')],'include':_0x4ba99c[_0xa2b8('0x1a')]?_['map'](_0x4ba99c[_0xa2b8('0x1a')],function(_0x53f28b){return{'model':db[_0x53f28b[_0xa2b8('0x1b')]],'as':_0x53f28b['as'],'attributes':_0x53f28b['attributes'],'include':_0x53f28b[_0xa2b8('0x1a')]?_[_0xa2b8('0x1c')](_0x53f28b['include'],function(_0x565ed9){return{'model':db[_0x565ed9[_0xa2b8('0x1b')]],'as':_0x565ed9['as'],'attributes':_0x565ed9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa2b8('0xa')](function(_0x5c8646){logger['info']('GetServicenowAccount',_0x400dde);logger[_0xa2b8('0xe')]('GetServicenowAccount',_0x400dde,JSON[_0xa2b8('0x10')](_0x5c8646));_0x599ff2(_0x5c8646);})[_0xa2b8('0x1d')](function(_0xb0db27){logger[_0xa2b8('0x11')](_0xa2b8('0x15'),_0xb0db27[_0xa2b8('0x13')],_0x400dde);_0x1db1fe(_0x44d05e[_0xa2b8('0x11')](0x1f4,_0xb0db27['message']));});});};exports[_0xa2b8('0x1e')]=function(_0xf7c691){var _0x15a5dc=this;return new Promise(function(_0x30a64c,_0x15e37e){return db['ServicenowAccount'][_0xa2b8('0x1f')]({'raw':_0xf7c691[_0xa2b8('0x18')]?_0xf7c691['options'][_0xa2b8('0x20')]===undefined?!![]:![]:!![],'where':_0xf7c691[_0xa2b8('0x18')]?_0xf7c691['options'][_0xa2b8('0x21')]||null:null,'attributes':_0xf7c691['options']?_0xf7c691[_0xa2b8('0x18')][_0xa2b8('0x19')]||null:null,'include':_0xf7c691[_0xa2b8('0x18')]?_0xf7c691[_0xa2b8('0x18')][_0xa2b8('0x1a')]?_[_0xa2b8('0x1c')](_0xf7c691['options'][_0xa2b8('0x1a')],function(_0x4ab04c){return{'model':db[_0x4ab04c[_0xa2b8('0x1b')]],'as':_0x4ab04c['as'],'attributes':_0x4ab04c['attributes'],'include':_0x4ab04c[_0xa2b8('0x1a')]?_[_0xa2b8('0x1c')](_0x4ab04c[_0xa2b8('0x1a')],function(_0x3899cd){return{'model':db[_0x3899cd[_0xa2b8('0x1b')]],'as':_0x3899cd['as'],'attributes':_0x3899cd[_0xa2b8('0x19')],'include':_0x3899cd[_0xa2b8('0x1a')]?_[_0xa2b8('0x1c')](_0x3899cd[_0xa2b8('0x1a')],function(_0xb5e898){return{'model':db[_0xb5e898[_0xa2b8('0x1b')]],'as':_0xb5e898['as'],'attributes':_0xb5e898[_0xa2b8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa2b8('0xa')](function(_0x2dd6e9){logger[_0xa2b8('0xb')](_0xa2b8('0x1e'),_0xf7c691);logger[_0xa2b8('0xe')]('ShowServicenowAccount',_0xf7c691,JSON[_0xa2b8('0x10')](_0x2dd6e9));_0x30a64c(_0x2dd6e9);})[_0xa2b8('0x1d')](function(_0x27bc0d){logger['error'](_0xa2b8('0x1e'),_0x27bc0d[_0xa2b8('0x13')],_0xf7c691);_0x15e37e(_0x15a5dc[_0xa2b8('0x11')](0x1f4,_0x27bc0d['message']));});});}; \ No newline at end of file +var _0x01be=['debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetServicenowAccount','ShowServicenowAccount','find','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x4f280f,_0x2c8f5e){var _0x3376a2=function(_0xe8a6c9){while(--_0xe8a6c9){_0x4f280f['push'](_0x4f280f['shift']());}};_0x3376a2(++_0x2c8f5e);}(_0x01be,0x136));var _0xe01b=function(_0x9dd167,_0x3ec79d){_0x9dd167=_0x9dd167-0x0;var _0x108f72=_0x01be[_0x9dd167];return _0x108f72;};'use strict';var _=require(_0xe01b('0x0'));var util=require(_0xe01b('0x1'));var moment=require(_0xe01b('0x2'));var BPromise=require(_0xe01b('0x3'));var rs=require(_0xe01b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe01b('0x5'))['db'];var utils=require(_0xe01b('0x6'));var logger=require('../../config/logger')(_0xe01b('0x7'));var config=require(_0xe01b('0x8'));var jayson=require(_0xe01b('0x9'));var client=jayson[_0xe01b('0xa')][_0xe01b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3abcd8,_0x5889a0,_0x31599c){return new BPromise(function(_0x5ab7dc,_0xb847ad){return client[_0xe01b('0xc')](_0x3abcd8,_0x31599c)['then'](function(_0x392151){logger[_0xe01b('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x5889a0,'request\x20sent');logger[_0xe01b('0xe')](_0xe01b('0xf'),_0x5889a0,_0xe01b('0x10'),JSON['stringify'](_0x392151));if(_0x392151[_0xe01b('0x11')]){if(_0x392151[_0xe01b('0x11')][_0xe01b('0x12')]===0x1f4){logger[_0xe01b('0x11')](_0xe01b('0x13'),_0x5889a0,_0x392151[_0xe01b('0x11')][_0xe01b('0x14')]);return _0xb847ad(_0x392151[_0xe01b('0x11')][_0xe01b('0x14')]);}logger['error'](_0xe01b('0x13'),_0x5889a0,_0x392151[_0xe01b('0x11')][_0xe01b('0x14')]);return _0x5ab7dc(_0x392151['error'][_0xe01b('0x14')]);}else{logger['info'](_0xe01b('0x13'),_0x5889a0,'request\x20sent');_0x5ab7dc(_0x392151['result']['message']);}})[_0xe01b('0x15')](function(_0x564d57){logger['error'](_0xe01b('0x13'),_0x5889a0,_0x564d57);_0xb847ad(_0x564d57);});});}exports['GetServicenowAccount']=function(_0x3e8021){var _0x67bf8c=this;return new Promise(function(_0x35dca5,_0x45cb5d){return db['ServicenowAccount'][_0xe01b('0x16')]({'raw':_0x3e8021[_0xe01b('0x17')]?_0x3e8021[_0xe01b('0x17')][_0xe01b('0x18')]===undefined?!![]:![]:!![],'where':_0x3e8021['options']?_0x3e8021['options'][_0xe01b('0x19')]||null:null,'attributes':_0x3e8021[_0xe01b('0x17')]?_0x3e8021[_0xe01b('0x17')][_0xe01b('0x1a')]||null:null,'limit':_0x3e8021[_0xe01b('0x17')]?_0x3e8021[_0xe01b('0x17')][_0xe01b('0x1b')]||null:null,'include':_0x3e8021[_0xe01b('0x17')]?_0x3e8021[_0xe01b('0x17')][_0xe01b('0x1c')]?_[_0xe01b('0x1d')](_0x3e8021[_0xe01b('0x17')][_0xe01b('0x1c')],function(_0x3ba705){return{'model':db[_0x3ba705[_0xe01b('0x1e')]],'as':_0x3ba705['as'],'attributes':_0x3ba705[_0xe01b('0x1a')],'include':_0x3ba705[_0xe01b('0x1c')]?_[_0xe01b('0x1d')](_0x3ba705[_0xe01b('0x1c')],function(_0x222f51){return{'model':db[_0x222f51['model']],'as':_0x222f51['as'],'attributes':_0x222f51[_0xe01b('0x1a')],'include':_0x222f51['include']?_[_0xe01b('0x1d')](_0x222f51['include'],function(_0x52741f){return{'model':db[_0x52741f[_0xe01b('0x1e')]],'as':_0x52741f['as'],'attributes':_0x52741f[_0xe01b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe01b('0x1f')](function(_0x23b586){logger[_0xe01b('0xd')](_0xe01b('0x20'),_0x3e8021);logger[_0xe01b('0xe')]('GetServicenowAccount',_0x3e8021,JSON['stringify'](_0x23b586));_0x35dca5(_0x23b586);})['catch'](function(_0x5e83ea){logger['error']('GetServicenowAccount',_0x5e83ea[_0xe01b('0x14')],_0x3e8021);_0x45cb5d(_0x67bf8c[_0xe01b('0x11')](0x1f4,_0x5e83ea[_0xe01b('0x14')]));});});};exports[_0xe01b('0x21')]=function(_0x4a8a38){var _0x4ccf01=this;return new Promise(function(_0x57b364,_0x5065d8){return db['ServicenowAccount'][_0xe01b('0x22')]({'raw':_0x4a8a38['options']?_0x4a8a38[_0xe01b('0x17')][_0xe01b('0x18')]===undefined?!![]:![]:!![],'where':_0x4a8a38[_0xe01b('0x17')]?_0x4a8a38['options'][_0xe01b('0x19')]||null:null,'attributes':_0x4a8a38[_0xe01b('0x17')]?_0x4a8a38[_0xe01b('0x17')][_0xe01b('0x1a')]||null:null,'include':_0x4a8a38[_0xe01b('0x17')]?_0x4a8a38[_0xe01b('0x17')]['include']?_[_0xe01b('0x1d')](_0x4a8a38[_0xe01b('0x17')]['include'],function(_0x280235){return{'model':db[_0x280235[_0xe01b('0x1e')]],'as':_0x280235['as'],'attributes':_0x280235['attributes'],'include':_0x280235[_0xe01b('0x1c')]?_[_0xe01b('0x1d')](_0x280235[_0xe01b('0x1c')],function(_0x55e11a){return{'model':db[_0x55e11a[_0xe01b('0x1e')]],'as':_0x55e11a['as'],'attributes':_0x55e11a[_0xe01b('0x1a')],'include':_0x55e11a[_0xe01b('0x1c')]?_['map'](_0x55e11a[_0xe01b('0x1c')],function(_0x91ff0d){return{'model':db[_0x91ff0d['model']],'as':_0x91ff0d['as'],'attributes':_0x91ff0d[_0xe01b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe01b('0x1f')](function(_0x15217a){logger['info'](_0xe01b('0x21'),_0x4a8a38);logger['debug'](_0xe01b('0x21'),_0x4a8a38,JSON[_0xe01b('0x23')](_0x15217a));_0x57b364(_0x15217a);})['catch'](function(_0x44d470){logger['error'](_0xe01b('0x21'),_0x44d470['message'],_0x4a8a38);_0x5065d8(_0x4ccf01[_0xe01b('0x11')](0x1f4,_0x44d470[_0xe01b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index e356ee4..0966b85 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 _0xb993=['get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xb993,0x137));var _0x3b99=function(_0x4a35d6,_0x12e913){_0x4a35d6=_0x4a35d6-0x0;var _0x335499=_0xb993[_0x4a35d6];return _0x335499;};'use strict';var multer=require(_0x3b99('0x0'));var util=require('util');var path=require(_0x3b99('0x1'));var timeout=require('connect-timeout');var express=require(_0x3b99('0x2'));var router=express[_0x3b99('0x3')]();var fs_extra=require(_0x3b99('0x4'));var auth=require(_0x3b99('0x5'));var interaction=require(_0x3b99('0x6'));var config=require(_0x3b99('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x3b99('0x8')](),controller[_0x3b99('0x9')]);router['get'](_0x3b99('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3b99('0xb')]('/:id/fields',auth[_0x3b99('0x8')](),controller[_0x3b99('0xc')]);router[_0x3b99('0xb')](_0x3b99('0xd'),auth[_0x3b99('0x8')](),controller[_0x3b99('0xe')]);router[_0x3b99('0xb')](_0x3b99('0xf'),auth[_0x3b99('0x8')](),controller[_0x3b99('0x10')]);router[_0x3b99('0x11')]('/',auth['isAuthenticated'](),controller[_0x3b99('0x12')]);router[_0x3b99('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3b99('0x14')]);router[_0x3b99('0x15')](_0x3b99('0xa'),auth[_0x3b99('0x8')](),controller['destroy']);module[_0x3b99('0x16')]=router; \ No newline at end of file +var _0x9162=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intServicenowConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','create','put'];(function(_0x579567,_0x1e0a39){var _0x5844cb=function(_0x2eb063){while(--_0x2eb063){_0x579567['push'](_0x579567['shift']());}};_0x5844cb(++_0x1e0a39);}(_0x9162,0x192));var _0x2916=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x9162[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x2916('0x0'));var util=require('util');var path=require(_0x2916('0x1'));var timeout=require(_0x2916('0x2'));var express=require(_0x2916('0x3'));var router=express[_0x2916('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2916('0x5'));var config=require('../../config/environment');var controller=require(_0x2916('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2916('0x7')](_0x2916('0x8'),auth[_0x2916('0x9')](),controller['show']);router['get'](_0x2916('0xa'),auth[_0x2916('0x9')](),controller[_0x2916('0xb')]);router[_0x2916('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x2916('0xc')]);router[_0x2916('0x7')]('/:id/descriptions',auth[_0x2916('0x9')](),controller[_0x2916('0xd')]);router['post']('/',auth[_0x2916('0x9')](),controller[_0x2916('0xe')]);router[_0x2916('0xf')](_0x2916('0x8'),auth[_0x2916('0x9')](),controller[_0x2916('0x10')]);router['delete'](_0x2916('0x8'),auth[_0x2916('0x9')](),controller[_0x2916('0x11')]);module[_0x2916('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 6ef5e50..9f8e0bc 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 _0xeefc=['exports','STRING'];(function(_0x202cf2,_0x175408){var _0x4c9388=function(_0x2dd09e){while(--_0x2dd09e){_0x202cf2['push'](_0x202cf2['shift']());}};_0x4c9388(++_0x175408);}(_0xeefc,0x8c));var _0xceef=function(_0x13282b,_0x327836){_0x13282b=_0x13282b-0x0;var _0x1d7c1d=_0xeefc[_0x13282b];return _0x1d7c1d;};'use strict';var Sequelize=require('sequelize');module[_0xceef('0x0')]={'name':{'type':Sequelize[_0xceef('0x1')]},'description':{'type':Sequelize[_0xceef('0x1')]}}; \ No newline at end of file +var _0x17a7=['exports','STRING','sequelize'];(function(_0x5dde91,_0x3bb66e){var _0x402888=function(_0x3ee674){while(--_0x3ee674){_0x5dde91['push'](_0x5dde91['shift']());}};_0x402888(++_0x3bb66e);}(_0x17a7,0x1be));var _0x717a=function(_0x2508da,_0x115b09){_0x2508da=_0x2508da-0x0;var _0x426619=_0x17a7[_0x2508da];return _0x426619;};'use strict';var Sequelize=require(_0x717a('0x0'));module[_0x717a('0x1')]={'name':{'type':Sequelize[_0x717a('0x2')]},'description':{'type':Sequelize[_0x717a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 372c2ae..b197546 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 _0x3416=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','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','end','json','offset','limit','undefined','count','set','reject','update','destroy','then','error','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create','body','getFields','findOne','ServicenowField','getSubjects','sort','getDescriptions','eml-format'];(function(_0x15d28f,_0x342dde){var _0x5e1356=function(_0x186fc1){while(--_0x186fc1){_0x15d28f['push'](_0x15d28f['shift']());}};_0x5e1356(++_0x342dde);}(_0x3416,0xef));var _0x6341=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x3416[_0x3df871];return _0x570f7b;};'use strict';var emlformat=require(_0x6341('0x0'));var rimraf=require(_0x6341('0x1'));var zipdir=require(_0x6341('0x2'));var jsonpatch=require(_0x6341('0x3'));var rp=require(_0x6341('0x4'));var moment=require('moment');var BPromise=require(_0x6341('0x5'));var Mustache=require(_0x6341('0x6'));var util=require(_0x6341('0x7'));var path=require('path');var sox=require(_0x6341('0x8'));var csv=require(_0x6341('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6341('0xa'));var squel=require(_0x6341('0xb'));var crypto=require(_0x6341('0xc'));var jsforce=require(_0x6341('0xd'));var deskjs=require(_0x6341('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6341('0xf'));var Papa=require(_0x6341('0x10'));var Redis=require(_0x6341('0x11'));var authService=require(_0x6341('0x12'));var qs=require(_0x6341('0x13'));var as=require(_0x6341('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6341('0x15'))(_0x6341('0x16'));var utils=require(_0x6341('0x17'));var config=require(_0x6341('0x18'));var licenseUtil=require(_0x6341('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1bdc,_0x4782de){_0x4782de=_0x4782de||0xcc;return function(_0x4954ab){if(_0x4954ab){return _0x5f1bdc[_0x6341('0x1a')](_0x4782de);}return _0x5f1bdc[_0x6341('0x1b')](_0x4782de)[_0x6341('0x1c')]();};}function respondWithResult(_0x5d08fa,_0x317921){_0x317921=_0x317921||0xc8;return function(_0x2a5f81){if(_0x2a5f81){return _0x5d08fa[_0x6341('0x1b')](_0x317921)[_0x6341('0x1d')](_0x2a5f81);}};}function respondWithFilteredResult(_0x52fdd3,_0xb5a76b){return function(_0xd39c5d){if(_0xd39c5d){var _0x438483=typeof _0xb5a76b[_0x6341('0x1e')]==='undefined'&&typeof _0xb5a76b[_0x6341('0x1f')]===_0x6341('0x20');var _0x37021a=_0xd39c5d[_0x6341('0x21')];var _0x38c067=_0x438483?0x0:_0xb5a76b[_0x6341('0x1e')];var _0x106788=_0x438483?_0xd39c5d[_0x6341('0x21')]:_0xb5a76b[_0x6341('0x1e')]+_0xb5a76b[_0x6341('0x1f')];var _0x422e6b;if(_0x106788>=_0x37021a){_0x106788=_0x37021a;_0x422e6b=0xc8;}else{_0x422e6b=0xce;}_0x52fdd3[_0x6341('0x1b')](_0x422e6b);return _0x52fdd3[_0x6341('0x22')]('Content-Range',_0x38c067+'-'+_0x106788+'/'+_0x37021a)[_0x6341('0x1d')](_0xd39c5d);}return null;};}function patchUpdates(_0x30985e){return function(_0x8e2e89){try{jsonpatch['apply'](_0x8e2e89,_0x30985e,!![]);}catch(_0x291e62){return BPromise[_0x6341('0x23')](_0x291e62);}return _0x8e2e89['save']();};}function saveUpdates(_0x48cb0b,_0x20301f){return function(_0x3b0a7c){if(_0x3b0a7c){return _0x3b0a7c[_0x6341('0x24')](_0x48cb0b)['then'](function(_0x451d4d){return _0x451d4d;});}return null;};}function removeEntity(_0x4379ce,_0xc55541){return function(_0x4fe813){if(_0x4fe813){return _0x4fe813[_0x6341('0x25')]()[_0x6341('0x26')](function(){_0x4379ce[_0x6341('0x1b')](0xcc)[_0x6341('0x1c')]();});}};}function handleEntityNotFound(_0x248f9f,_0x5186a1){return function(_0x902efe){if(!_0x902efe){_0x248f9f[_0x6341('0x1a')](0x194);}return _0x902efe;};}function handleError(_0x1fdf56,_0x3f1d7c){_0x3f1d7c=_0x3f1d7c||0x1f4;return function(_0x2b4978){logger[_0x6341('0x27')](_0x2b4978[_0x6341('0x28')]);if(_0x2b4978['name']){delete _0x2b4978[_0x6341('0x29')];}_0x1fdf56[_0x6341('0x1b')](_0x3f1d7c)['send'](_0x2b4978);};}exports[_0x6341('0x2a')]=function(_0x4736f7,_0x4ee030){var _0x3d424c={},_0x388987={},_0x59b5ff={'count':0x0,'rows':[]};var _0x42c9dd=_['map'](db[_0x6341('0x2b')][_0x6341('0x2c')],function(_0x55104e){return{'name':_0x55104e[_0x6341('0x2d')],'type':_0x55104e['type'][_0x6341('0x2e')]};});_0x388987[_0x6341('0x2f')]=_[_0x6341('0x30')](_0x42c9dd,_0x6341('0x29'));_0x388987[_0x6341('0x31')]=_[_0x6341('0x32')](_0x4736f7[_0x6341('0x31')]);_0x388987['filters']=_[_0x6341('0x33')](_0x388987[_0x6341('0x2f')],_0x388987[_0x6341('0x31')]);_0x3d424c[_0x6341('0x34')]=_['intersection'](_0x388987['model'],qs['fields'](_0x4736f7['query']['fields']));_0x3d424c[_0x6341('0x34')]=_0x3d424c[_0x6341('0x34')][_0x6341('0x35')]?_0x3d424c[_0x6341('0x34')]:_0x388987[_0x6341('0x2f')];if(!_0x4736f7['query'][_0x6341('0x36')](_0x6341('0x37'))){_0x3d424c[_0x6341('0x1f')]=qs[_0x6341('0x1f')](_0x4736f7[_0x6341('0x31')]['limit']);_0x3d424c[_0x6341('0x1e')]=qs[_0x6341('0x1e')](_0x4736f7[_0x6341('0x31')][_0x6341('0x1e')]);}_0x3d424c[_0x6341('0x38')]=qs['sort'](_0x4736f7[_0x6341('0x31')]['sort']);_0x3d424c[_0x6341('0x39')]=qs[_0x6341('0x3a')](_[_0x6341('0x3b')](_0x4736f7[_0x6341('0x31')],_0x388987[_0x6341('0x3a')]),_0x42c9dd);if(_0x4736f7[_0x6341('0x31')][_0x6341('0x3c')]){_0x3d424c[_0x6341('0x39')]=_[_0x6341('0x3d')](_0x3d424c['where'],{'$or':_['map'](_0x42c9dd,function(_0x5eb618){if(_0x5eb618[_0x6341('0x3e')]!==_0x6341('0x3f')){var _0x1aad75={};_0x1aad75[_0x5eb618['name']]={'$like':'%'+_0x4736f7[_0x6341('0x31')][_0x6341('0x3c')]+'%'};return _0x1aad75;}})});}_0x3d424c=_['merge']({},_0x3d424c,_0x4736f7[_0x6341('0x40')]);var _0x214616={'where':_0x3d424c[_0x6341('0x39')]};return db[_0x6341('0x2b')][_0x6341('0x21')](_0x214616)['then'](function(_0x41912d){_0x59b5ff['count']=_0x41912d;if(_0x4736f7['query'][_0x6341('0x41')]){_0x3d424c[_0x6341('0x42')]=[{'all':!![]}];}return db[_0x6341('0x2b')]['findAll'](_0x3d424c);})[_0x6341('0x26')](function(_0x506eef){_0x59b5ff['rows']=_0x506eef;return _0x59b5ff;})[_0x6341('0x26')](respondWithFilteredResult(_0x4ee030,_0x3d424c))[_0x6341('0x43')](handleError(_0x4ee030,null));};exports[_0x6341('0x44')]=function(_0x271e74,_0x482b54){var _0xd1aabe={'raw':![],'where':{'id':_0x271e74[_0x6341('0x45')]['id']}},_0x3f1070={};_0x3f1070[_0x6341('0x2f')]=_['keys'](db[_0x6341('0x2b')][_0x6341('0x2c')]);_0x3f1070[_0x6341('0x31')]=_['keys'](_0x271e74[_0x6341('0x31')]);_0x3f1070[_0x6341('0x3a')]=_[_0x6341('0x33')](_0x3f1070['model'],_0x3f1070['query']);_0xd1aabe[_0x6341('0x34')]=_[_0x6341('0x33')](_0x3f1070['model'],qs[_0x6341('0x46')](_0x271e74[_0x6341('0x31')][_0x6341('0x46')]));_0xd1aabe['attributes']=_0xd1aabe['attributes'][_0x6341('0x35')]?_0xd1aabe[_0x6341('0x34')]:_0x3f1070['model'];if(_0x271e74[_0x6341('0x31')]['includeAll']){_0xd1aabe[_0x6341('0x42')]=[{'all':!![]}];}_0xd1aabe=_[_0x6341('0x3d')]({},_0xd1aabe,_0x271e74[_0x6341('0x40')]);return db['ServicenowConfiguration'][_0x6341('0x47')](_0xd1aabe)[_0x6341('0x26')](handleEntityNotFound(_0x482b54,null))[_0x6341('0x26')](respondWithResult(_0x482b54,null))['catch'](handleError(_0x482b54,null));};exports[_0x6341('0x48')]=function(_0x335a54,_0x3a990d){return db[_0x6341('0x2b')][_0x6341('0x48')](_0x335a54[_0x6341('0x49')],{})[_0x6341('0x26')](respondWithResult(_0x3a990d,0xc9))[_0x6341('0x43')](handleError(_0x3a990d,null));};exports[_0x6341('0x24')]=function(_0x5e136b,_0x53b9c2){if(_0x5e136b['body']['id']){delete _0x5e136b[_0x6341('0x49')]['id'];}return db[_0x6341('0x2b')][_0x6341('0x47')]({'where':{'id':_0x5e136b['params']['id']}})[_0x6341('0x26')](handleEntityNotFound(_0x53b9c2,null))[_0x6341('0x26')](saveUpdates(_0x5e136b[_0x6341('0x49')],null))[_0x6341('0x26')](respondWithResult(_0x53b9c2,null))[_0x6341('0x43')](handleError(_0x53b9c2,null));};exports['destroy']=function(_0x1c6ed4,_0x4dbea6){return db[_0x6341('0x2b')][_0x6341('0x47')]({'where':{'id':_0x1c6ed4[_0x6341('0x45')]['id']}})['then'](handleEntityNotFound(_0x4dbea6,null))[_0x6341('0x26')](removeEntity(_0x4dbea6,null))['catch'](handleError(_0x4dbea6,null));};exports[_0x6341('0x4a')]=function(_0x37c43c,_0x2a9ae1,_0x16c1a0){var _0x1b36b1={};var _0xcccd44={};var _0x444207;var _0x20dc1e;return db['ServicenowConfiguration'][_0x6341('0x4b')]({'where':{'id':_0x37c43c[_0x6341('0x45')]['id']}})[_0x6341('0x26')](handleEntityNotFound(_0x2a9ae1,null))[_0x6341('0x26')](function(_0x329768){if(_0x329768){_0x444207=_0x329768;_0xcccd44[_0x6341('0x2f')]=_[_0x6341('0x32')](db[_0x6341('0x4c')]['rawAttributes']);_0xcccd44[_0x6341('0x31')]=_[_0x6341('0x32')](_0x37c43c['query']);_0xcccd44['filters']=_['intersection'](_0xcccd44['model'],_0xcccd44['query']);_0x1b36b1[_0x6341('0x34')]=_[_0x6341('0x33')](_0xcccd44[_0x6341('0x2f')],qs['fields'](_0x37c43c[_0x6341('0x31')][_0x6341('0x46')]));_0x1b36b1[_0x6341('0x34')]=_0x1b36b1[_0x6341('0x34')][_0x6341('0x35')]?_0x1b36b1[_0x6341('0x34')]:_0xcccd44[_0x6341('0x2f')];_0x1b36b1[_0x6341('0x38')]=qs['sort'](_0x37c43c[_0x6341('0x31')]['sort']);_0x1b36b1['where']=qs[_0x6341('0x3a')](_[_0x6341('0x3b')](_0x37c43c[_0x6341('0x31')],_0xcccd44[_0x6341('0x3a')]));if(_0x37c43c[_0x6341('0x31')][_0x6341('0x3c')]){_0x1b36b1[_0x6341('0x39')]=_['merge'](_0x1b36b1[_0x6341('0x39')],{'$or':_[_0x6341('0x30')](_0x1b36b1['attributes'],function(_0x4c3cbb){var _0x1ae1fc={};_0x1ae1fc[_0x4c3cbb]={'$like':'%'+_0x37c43c[_0x6341('0x31')]['filter']+'%'};return _0x1ae1fc;})});}_0x1b36b1=_['merge']({},_0x1b36b1,_0x37c43c[_0x6341('0x40')]);return _0x444207[_0x6341('0x4a')](_0x1b36b1);}})[_0x6341('0x26')](function(_0x1515c9){if(_0x1515c9){_0x20dc1e=_0x1515c9['length'];if(!_0x37c43c[_0x6341('0x31')]['hasOwnProperty'](_0x6341('0x37'))){_0x1b36b1[_0x6341('0x1f')]=qs[_0x6341('0x1f')](_0x37c43c[_0x6341('0x31')][_0x6341('0x1f')]);_0x1b36b1[_0x6341('0x1e')]=qs[_0x6341('0x1e')](_0x37c43c[_0x6341('0x31')][_0x6341('0x1e')]);}return _0x444207['getFields'](_0x1b36b1);}})[_0x6341('0x26')](function(_0x3286a9){if(_0x3286a9){return _0x3286a9?{'count':_0x20dc1e,'rows':_0x3286a9}:null;}})[_0x6341('0x26')](respondWithResult(_0x2a9ae1,null))[_0x6341('0x43')](handleError(_0x2a9ae1,null));};exports[_0x6341('0x4d')]=function(_0xf2f1dd,_0x194117,_0x3304f8){var _0x14483d={};var _0x49b708={};var _0x27c0cb;var _0x153a2d;return db[_0x6341('0x2b')][_0x6341('0x4b')]({'where':{'id':_0xf2f1dd[_0x6341('0x45')]['id']}})[_0x6341('0x26')](handleEntityNotFound(_0x194117,null))[_0x6341('0x26')](function(_0x225d02){if(_0x225d02){_0x27c0cb=_0x225d02;_0x49b708[_0x6341('0x2f')]=_[_0x6341('0x32')](db[_0x6341('0x4c')][_0x6341('0x2c')]);_0x49b708[_0x6341('0x31')]=_[_0x6341('0x32')](_0xf2f1dd[_0x6341('0x31')]);_0x49b708[_0x6341('0x3a')]=_['intersection'](_0x49b708[_0x6341('0x2f')],_0x49b708[_0x6341('0x31')]);_0x14483d['attributes']=_[_0x6341('0x33')](_0x49b708[_0x6341('0x2f')],qs[_0x6341('0x46')](_0xf2f1dd['query']['fields']));_0x14483d[_0x6341('0x34')]=_0x14483d[_0x6341('0x34')][_0x6341('0x35')]?_0x14483d[_0x6341('0x34')]:_0x49b708[_0x6341('0x2f')];_0x14483d[_0x6341('0x38')]=qs['sort'](_0xf2f1dd['query'][_0x6341('0x4e')]);_0x14483d[_0x6341('0x39')]=qs['filters'](_[_0x6341('0x3b')](_0xf2f1dd[_0x6341('0x31')],_0x49b708[_0x6341('0x3a')]));if(_0xf2f1dd[_0x6341('0x31')][_0x6341('0x3c')]){_0x14483d['where']=_[_0x6341('0x3d')](_0x14483d['where'],{'$or':_[_0x6341('0x30')](_0x14483d[_0x6341('0x34')],function(_0x3948b3){var _0x54a2e0={};_0x54a2e0[_0x3948b3]={'$like':'%'+_0xf2f1dd[_0x6341('0x31')][_0x6341('0x3c')]+'%'};return _0x54a2e0;})});}_0x14483d=_['merge']({},_0x14483d,_0xf2f1dd[_0x6341('0x40')]);return _0x27c0cb[_0x6341('0x4d')](_0x14483d);}})[_0x6341('0x26')](function(_0x1f9cd1){if(_0x1f9cd1){_0x153a2d=_0x1f9cd1[_0x6341('0x35')];if(!_0xf2f1dd[_0x6341('0x31')][_0x6341('0x36')]('nolimit')){_0x14483d['limit']=qs[_0x6341('0x1f')](_0xf2f1dd[_0x6341('0x31')][_0x6341('0x1f')]);_0x14483d['offset']=qs['offset'](_0xf2f1dd[_0x6341('0x31')][_0x6341('0x1e')]);}return _0x27c0cb[_0x6341('0x4d')](_0x14483d);}})['then'](function(_0x443289){if(_0x443289){return _0x443289?{'count':_0x153a2d,'rows':_0x443289}:null;}})[_0x6341('0x26')](respondWithResult(_0x194117,null))['catch'](handleError(_0x194117,null));};exports['getDescriptions']=function(_0x1b61b1,_0x5dbfaa,_0x5254af){var _0x24a7ad={};var _0x59f577={};var _0x54bd36;var _0x1bcb4b;return db[_0x6341('0x2b')]['findOne']({'where':{'id':_0x1b61b1[_0x6341('0x45')]['id']}})[_0x6341('0x26')](handleEntityNotFound(_0x5dbfaa,null))[_0x6341('0x26')](function(_0x131ebf){if(_0x131ebf){_0x54bd36=_0x131ebf;_0x59f577['model']=_['keys'](db[_0x6341('0x4c')][_0x6341('0x2c')]);_0x59f577[_0x6341('0x31')]=_[_0x6341('0x32')](_0x1b61b1[_0x6341('0x31')]);_0x59f577['filters']=_[_0x6341('0x33')](_0x59f577['model'],_0x59f577[_0x6341('0x31')]);_0x24a7ad[_0x6341('0x34')]=_[_0x6341('0x33')](_0x59f577[_0x6341('0x2f')],qs['fields'](_0x1b61b1[_0x6341('0x31')][_0x6341('0x46')]));_0x24a7ad['attributes']=_0x24a7ad['attributes'][_0x6341('0x35')]?_0x24a7ad[_0x6341('0x34')]:_0x59f577['model'];_0x24a7ad['order']=qs[_0x6341('0x4e')](_0x1b61b1[_0x6341('0x31')][_0x6341('0x4e')]);_0x24a7ad[_0x6341('0x39')]=qs[_0x6341('0x3a')](_[_0x6341('0x3b')](_0x1b61b1[_0x6341('0x31')],_0x59f577[_0x6341('0x3a')]));if(_0x1b61b1[_0x6341('0x31')][_0x6341('0x3c')]){_0x24a7ad[_0x6341('0x39')]=_[_0x6341('0x3d')](_0x24a7ad[_0x6341('0x39')],{'$or':_[_0x6341('0x30')](_0x24a7ad['attributes'],function(_0xb7a410){var _0x4abb27={};_0x4abb27[_0xb7a410]={'$like':'%'+_0x1b61b1[_0x6341('0x31')][_0x6341('0x3c')]+'%'};return _0x4abb27;})});}_0x24a7ad=_[_0x6341('0x3d')]({},_0x24a7ad,_0x1b61b1[_0x6341('0x40')]);return _0x54bd36['getDescriptions'](_0x24a7ad);}})[_0x6341('0x26')](function(_0x7642c6){if(_0x7642c6){_0x1bcb4b=_0x7642c6['length'];if(!_0x1b61b1['query'][_0x6341('0x36')](_0x6341('0x37'))){_0x24a7ad['limit']=qs[_0x6341('0x1f')](_0x1b61b1['query'][_0x6341('0x1f')]);_0x24a7ad[_0x6341('0x1e')]=qs[_0x6341('0x1e')](_0x1b61b1[_0x6341('0x31')][_0x6341('0x1e')]);}return _0x54bd36[_0x6341('0x4f')](_0x24a7ad);}})['then'](function(_0x5b870f){if(_0x5b870f){return _0x5b870f?{'count':_0x1bcb4b,'rows':_0x5b870f}:null;}})[_0x6341('0x26')](respondWithResult(_0x5dbfaa,null))[_0x6341('0x43')](handleError(_0x5dbfaa,null));}; \ No newline at end of file +var _0xbe07=['ejs','fs-extra','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','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','sort','filters','filter','where','VIRTUAL','merge','options','then','includeAll','include','findAll','catch','keys','create','find','params','getFields','findOne','ServicenowField','pick','hasOwnProperty','nolimit','order','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x3389d0,_0x2ff345){var _0xfaf4af=function(_0x32c865){while(--_0x32c865){_0x3389d0['push'](_0x3389d0['shift']());}};_0xfaf4af(++_0x2ff345);}(_0xbe07,0x133));var _0x7be0=function(_0x4253c9,_0xf95c64){_0x4253c9=_0x4253c9-0x0;var _0x42965a=_0xbe07[_0x4253c9];return _0x42965a;};'use strict';var emlformat=require(_0x7be0('0x0'));var rimraf=require(_0x7be0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7be0('0x2'));var rp=require(_0x7be0('0x3'));var moment=require(_0x7be0('0x4'));var BPromise=require(_0x7be0('0x5'));var Mustache=require('mustache');var util=require(_0x7be0('0x6'));var path=require('path');var sox=require(_0x7be0('0x7'));var csv=require(_0x7be0('0x8'));var ejs=require(_0x7be0('0x9'));var fs=require('fs');var fs_extra=require(_0x7be0('0xa'));var _=require('lodash');var squel=require(_0x7be0('0xb'));var crypto=require(_0x7be0('0xc'));var jsforce=require(_0x7be0('0xd'));var deskjs=require(_0x7be0('0xe'));var toCsv=require(_0x7be0('0x8'));var querystring=require('querystring');var Papa=require(_0x7be0('0xf'));var Redis=require(_0x7be0('0x10'));var authService=require(_0x7be0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7be0('0x12'));var hardwareService=require(_0x7be0('0x13'));var logger=require(_0x7be0('0x14'))(_0x7be0('0x15'));var utils=require(_0x7be0('0x16'));var config=require(_0x7be0('0x17'));var licenseUtil=require(_0x7be0('0x18'));var db=require(_0x7be0('0x19'))['db'];function respondWithStatusCode(_0x461d0a,_0x46ddbf){_0x46ddbf=_0x46ddbf||0xcc;return function(_0x7a661d){if(_0x7a661d){return _0x461d0a[_0x7be0('0x1a')](_0x46ddbf);}return _0x461d0a[_0x7be0('0x1b')](_0x46ddbf)[_0x7be0('0x1c')]();};}function respondWithResult(_0x19b801,_0x23fcb5){_0x23fcb5=_0x23fcb5||0xc8;return function(_0x259852){if(_0x259852){return _0x19b801[_0x7be0('0x1b')](_0x23fcb5)['json'](_0x259852);}};}function respondWithFilteredResult(_0x2c31de,_0xa26b41){return function(_0x2d1d33){if(_0x2d1d33){var _0x37cbbf=typeof _0xa26b41[_0x7be0('0x1d')]===_0x7be0('0x1e')&&typeof _0xa26b41[_0x7be0('0x1f')]===_0x7be0('0x1e');var _0x35634b=_0x2d1d33[_0x7be0('0x20')];var _0x4640cf=_0x37cbbf?0x0:_0xa26b41[_0x7be0('0x1d')];var _0x517b7c=_0x37cbbf?_0x2d1d33[_0x7be0('0x20')]:_0xa26b41[_0x7be0('0x1d')]+_0xa26b41[_0x7be0('0x1f')];var _0x1c322f;if(_0x517b7c>=_0x35634b){_0x517b7c=_0x35634b;_0x1c322f=0xc8;}else{_0x1c322f=0xce;}_0x2c31de[_0x7be0('0x1b')](_0x1c322f);return _0x2c31de[_0x7be0('0x21')](_0x7be0('0x22'),_0x4640cf+'-'+_0x517b7c+'/'+_0x35634b)['json'](_0x2d1d33);}return null;};}function patchUpdates(_0x5821b9){return function(_0x32a15c){try{jsonpatch[_0x7be0('0x23')](_0x32a15c,_0x5821b9,!![]);}catch(_0xc221b7){return BPromise[_0x7be0('0x24')](_0xc221b7);}return _0x32a15c['save']();};}function saveUpdates(_0x48c706,_0x416499){return function(_0x1b2d83){if(_0x1b2d83){return _0x1b2d83[_0x7be0('0x25')](_0x48c706)['then'](function(_0x2b6590){return _0x2b6590;});}return null;};}function removeEntity(_0xad947a,_0x703b35){return function(_0x2b3250){if(_0x2b3250){return _0x2b3250[_0x7be0('0x26')]()['then'](function(){_0xad947a[_0x7be0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb8246,_0x17eed2){return function(_0x224014){if(!_0x224014){_0xeb8246['sendStatus'](0x194);}return _0x224014;};}function handleError(_0x380193,_0xb94e88){_0xb94e88=_0xb94e88||0x1f4;return function(_0xc17898){logger[_0x7be0('0x27')](_0xc17898[_0x7be0('0x28')]);if(_0xc17898[_0x7be0('0x29')]){delete _0xc17898['name'];}_0x380193[_0x7be0('0x1b')](_0xb94e88)['send'](_0xc17898);};}exports[_0x7be0('0x2a')]=function(_0x336084,_0x9e66a4){var _0x301c25={},_0x252e39={},_0x2ce5f6={'count':0x0,'rows':[]};var _0x1fd97e=_['map'](db[_0x7be0('0x2b')][_0x7be0('0x2c')],function(_0x4c7313){return{'name':_0x4c7313[_0x7be0('0x2d')],'type':_0x4c7313['type'][_0x7be0('0x2e')]};});_0x252e39[_0x7be0('0x2f')]=_[_0x7be0('0x30')](_0x1fd97e,_0x7be0('0x29'));_0x252e39[_0x7be0('0x31')]=_['keys'](_0x336084[_0x7be0('0x31')]);_0x252e39['filters']=_[_0x7be0('0x32')](_0x252e39['model'],_0x252e39[_0x7be0('0x31')]);_0x301c25['attributes']=_[_0x7be0('0x32')](_0x252e39[_0x7be0('0x2f')],qs[_0x7be0('0x33')](_0x336084['query'][_0x7be0('0x33')]));_0x301c25['attributes']=_0x301c25[_0x7be0('0x34')][_0x7be0('0x35')]?_0x301c25[_0x7be0('0x34')]:_0x252e39[_0x7be0('0x2f')];if(!_0x336084[_0x7be0('0x31')]['hasOwnProperty']('nolimit')){_0x301c25['limit']=qs[_0x7be0('0x1f')](_0x336084[_0x7be0('0x31')]['limit']);_0x301c25[_0x7be0('0x1d')]=qs['offset'](_0x336084[_0x7be0('0x31')][_0x7be0('0x1d')]);}_0x301c25['order']=qs[_0x7be0('0x36')](_0x336084[_0x7be0('0x31')]['sort']);_0x301c25['where']=qs[_0x7be0('0x37')](_['pick'](_0x336084[_0x7be0('0x31')],_0x252e39['filters']),_0x1fd97e);if(_0x336084[_0x7be0('0x31')][_0x7be0('0x38')]){_0x301c25[_0x7be0('0x39')]=_['merge'](_0x301c25[_0x7be0('0x39')],{'$or':_[_0x7be0('0x30')](_0x1fd97e,function(_0x5d5461){if(_0x5d5461['type']!==_0x7be0('0x3a')){var _0x3414bc={};_0x3414bc[_0x5d5461['name']]={'$like':'%'+_0x336084[_0x7be0('0x31')][_0x7be0('0x38')]+'%'};return _0x3414bc;}})});}_0x301c25=_[_0x7be0('0x3b')]({},_0x301c25,_0x336084[_0x7be0('0x3c')]);var _0x27b80a={'where':_0x301c25[_0x7be0('0x39')]};return db['ServicenowConfiguration'][_0x7be0('0x20')](_0x27b80a)[_0x7be0('0x3d')](function(_0x884792){_0x2ce5f6[_0x7be0('0x20')]=_0x884792;if(_0x336084[_0x7be0('0x31')][_0x7be0('0x3e')]){_0x301c25[_0x7be0('0x3f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x7be0('0x40')](_0x301c25);})[_0x7be0('0x3d')](function(_0x45a7fc){_0x2ce5f6['rows']=_0x45a7fc;return _0x2ce5f6;})['then'](respondWithFilteredResult(_0x9e66a4,_0x301c25))[_0x7be0('0x41')](handleError(_0x9e66a4,null));};exports['show']=function(_0x4374dc,_0x2f1cee){var _0xc44dc7={'raw':![],'where':{'id':_0x4374dc['params']['id']}},_0xc72dc9={};_0xc72dc9[_0x7be0('0x2f')]=_[_0x7be0('0x42')](db['ServicenowConfiguration']['rawAttributes']);_0xc72dc9[_0x7be0('0x31')]=_['keys'](_0x4374dc['query']);_0xc72dc9[_0x7be0('0x37')]=_[_0x7be0('0x32')](_0xc72dc9[_0x7be0('0x2f')],_0xc72dc9[_0x7be0('0x31')]);_0xc44dc7['attributes']=_[_0x7be0('0x32')](_0xc72dc9[_0x7be0('0x2f')],qs[_0x7be0('0x33')](_0x4374dc[_0x7be0('0x31')][_0x7be0('0x33')]));_0xc44dc7['attributes']=_0xc44dc7['attributes'][_0x7be0('0x35')]?_0xc44dc7[_0x7be0('0x34')]:_0xc72dc9[_0x7be0('0x2f')];if(_0x4374dc[_0x7be0('0x31')][_0x7be0('0x3e')]){_0xc44dc7[_0x7be0('0x3f')]=[{'all':!![]}];}_0xc44dc7=_[_0x7be0('0x3b')]({},_0xc44dc7,_0x4374dc[_0x7be0('0x3c')]);return db[_0x7be0('0x2b')]['find'](_0xc44dc7)[_0x7be0('0x3d')](handleEntityNotFound(_0x2f1cee,null))[_0x7be0('0x3d')](respondWithResult(_0x2f1cee,null))[_0x7be0('0x41')](handleError(_0x2f1cee,null));};exports[_0x7be0('0x43')]=function(_0x1a9080,_0x4f24a3){return db['ServicenowConfiguration'][_0x7be0('0x43')](_0x1a9080['body'],{})[_0x7be0('0x3d')](respondWithResult(_0x4f24a3,0xc9))[_0x7be0('0x41')](handleError(_0x4f24a3,null));};exports['update']=function(_0x45160f,_0x58f96d){if(_0x45160f['body']['id']){delete _0x45160f['body']['id'];}return db[_0x7be0('0x2b')][_0x7be0('0x44')]({'where':{'id':_0x45160f[_0x7be0('0x45')]['id']}})[_0x7be0('0x3d')](handleEntityNotFound(_0x58f96d,null))['then'](saveUpdates(_0x45160f['body'],null))[_0x7be0('0x3d')](respondWithResult(_0x58f96d,null))['catch'](handleError(_0x58f96d,null));};exports[_0x7be0('0x26')]=function(_0x38c209,_0x27f4f2){return db[_0x7be0('0x2b')]['find']({'where':{'id':_0x38c209[_0x7be0('0x45')]['id']}})[_0x7be0('0x3d')](handleEntityNotFound(_0x27f4f2,null))[_0x7be0('0x3d')](removeEntity(_0x27f4f2,null))[_0x7be0('0x41')](handleError(_0x27f4f2,null));};exports[_0x7be0('0x46')]=function(_0x14b420,_0x16045c,_0x1a81e9){var _0x16a0f3={};var _0x1fc666={};var _0x13e9da;var _0x1c15ef;return db[_0x7be0('0x2b')][_0x7be0('0x47')]({'where':{'id':_0x14b420['params']['id']}})['then'](handleEntityNotFound(_0x16045c,null))[_0x7be0('0x3d')](function(_0x47d02d){if(_0x47d02d){_0x13e9da=_0x47d02d;_0x1fc666[_0x7be0('0x2f')]=_[_0x7be0('0x42')](db[_0x7be0('0x48')][_0x7be0('0x2c')]);_0x1fc666['query']=_[_0x7be0('0x42')](_0x14b420[_0x7be0('0x31')]);_0x1fc666['filters']=_['intersection'](_0x1fc666[_0x7be0('0x2f')],_0x1fc666[_0x7be0('0x31')]);_0x16a0f3[_0x7be0('0x34')]=_[_0x7be0('0x32')](_0x1fc666[_0x7be0('0x2f')],qs[_0x7be0('0x33')](_0x14b420[_0x7be0('0x31')][_0x7be0('0x33')]));_0x16a0f3[_0x7be0('0x34')]=_0x16a0f3[_0x7be0('0x34')][_0x7be0('0x35')]?_0x16a0f3[_0x7be0('0x34')]:_0x1fc666['model'];_0x16a0f3['order']=qs[_0x7be0('0x36')](_0x14b420[_0x7be0('0x31')][_0x7be0('0x36')]);_0x16a0f3['where']=qs['filters'](_[_0x7be0('0x49')](_0x14b420[_0x7be0('0x31')],_0x1fc666['filters']));if(_0x14b420[_0x7be0('0x31')][_0x7be0('0x38')]){_0x16a0f3[_0x7be0('0x39')]=_['merge'](_0x16a0f3[_0x7be0('0x39')],{'$or':_[_0x7be0('0x30')](_0x16a0f3['attributes'],function(_0x18da39){var _0x3c298b={};_0x3c298b[_0x18da39]={'$like':'%'+_0x14b420[_0x7be0('0x31')][_0x7be0('0x38')]+'%'};return _0x3c298b;})});}_0x16a0f3=_[_0x7be0('0x3b')]({},_0x16a0f3,_0x14b420[_0x7be0('0x3c')]);return _0x13e9da[_0x7be0('0x46')](_0x16a0f3);}})[_0x7be0('0x3d')](function(_0x2f8b4d){if(_0x2f8b4d){_0x1c15ef=_0x2f8b4d[_0x7be0('0x35')];if(!_0x14b420['query'][_0x7be0('0x4a')](_0x7be0('0x4b'))){_0x16a0f3['limit']=qs['limit'](_0x14b420['query'][_0x7be0('0x1f')]);_0x16a0f3[_0x7be0('0x1d')]=qs[_0x7be0('0x1d')](_0x14b420[_0x7be0('0x31')][_0x7be0('0x1d')]);}return _0x13e9da[_0x7be0('0x46')](_0x16a0f3);}})['then'](function(_0x33cf93){if(_0x33cf93){return _0x33cf93?{'count':_0x1c15ef,'rows':_0x33cf93}:null;}})[_0x7be0('0x3d')](respondWithResult(_0x16045c,null))[_0x7be0('0x41')](handleError(_0x16045c,null));};exports['getSubjects']=function(_0x59a61d,_0x3416ed,_0x211f6c){var _0x223b05={};var _0x224a76={};var _0x56123c;var _0x20f981;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x59a61d[_0x7be0('0x45')]['id']}})[_0x7be0('0x3d')](handleEntityNotFound(_0x3416ed,null))[_0x7be0('0x3d')](function(_0x417cbd){if(_0x417cbd){_0x56123c=_0x417cbd;_0x224a76[_0x7be0('0x2f')]=_[_0x7be0('0x42')](db[_0x7be0('0x48')][_0x7be0('0x2c')]);_0x224a76[_0x7be0('0x31')]=_[_0x7be0('0x42')](_0x59a61d[_0x7be0('0x31')]);_0x224a76[_0x7be0('0x37')]=_['intersection'](_0x224a76[_0x7be0('0x2f')],_0x224a76[_0x7be0('0x31')]);_0x223b05['attributes']=_[_0x7be0('0x32')](_0x224a76[_0x7be0('0x2f')],qs[_0x7be0('0x33')](_0x59a61d[_0x7be0('0x31')][_0x7be0('0x33')]));_0x223b05[_0x7be0('0x34')]=_0x223b05['attributes']['length']?_0x223b05[_0x7be0('0x34')]:_0x224a76[_0x7be0('0x2f')];_0x223b05[_0x7be0('0x4c')]=qs[_0x7be0('0x36')](_0x59a61d[_0x7be0('0x31')]['sort']);_0x223b05['where']=qs['filters'](_[_0x7be0('0x49')](_0x59a61d[_0x7be0('0x31')],_0x224a76[_0x7be0('0x37')]));if(_0x59a61d[_0x7be0('0x31')][_0x7be0('0x38')]){_0x223b05[_0x7be0('0x39')]=_[_0x7be0('0x3b')](_0x223b05[_0x7be0('0x39')],{'$or':_[_0x7be0('0x30')](_0x223b05['attributes'],function(_0x290446){var _0x342dcf={};_0x342dcf[_0x290446]={'$like':'%'+_0x59a61d[_0x7be0('0x31')][_0x7be0('0x38')]+'%'};return _0x342dcf;})});}_0x223b05=_[_0x7be0('0x3b')]({},_0x223b05,_0x59a61d['options']);return _0x56123c[_0x7be0('0x4d')](_0x223b05);}})[_0x7be0('0x3d')](function(_0xa42d16){if(_0xa42d16){_0x20f981=_0xa42d16[_0x7be0('0x35')];if(!_0x59a61d[_0x7be0('0x31')][_0x7be0('0x4a')](_0x7be0('0x4b'))){_0x223b05[_0x7be0('0x1f')]=qs[_0x7be0('0x1f')](_0x59a61d[_0x7be0('0x31')][_0x7be0('0x1f')]);_0x223b05[_0x7be0('0x1d')]=qs[_0x7be0('0x1d')](_0x59a61d[_0x7be0('0x31')][_0x7be0('0x1d')]);}return _0x56123c['getSubjects'](_0x223b05);}})[_0x7be0('0x3d')](function(_0x121185){if(_0x121185){return _0x121185?{'count':_0x20f981,'rows':_0x121185}:null;}})['then'](respondWithResult(_0x3416ed,null))[_0x7be0('0x41')](handleError(_0x3416ed,null));};exports['getDescriptions']=function(_0x4ce031,_0x3b9897,_0x49a334){var _0x58f5ef={};var _0x7eccc5={};var _0x48d6b0;var _0x5630c0;return db[_0x7be0('0x2b')]['findOne']({'where':{'id':_0x4ce031[_0x7be0('0x45')]['id']}})[_0x7be0('0x3d')](handleEntityNotFound(_0x3b9897,null))[_0x7be0('0x3d')](function(_0x49e923){if(_0x49e923){_0x48d6b0=_0x49e923;_0x7eccc5['model']=_['keys'](db[_0x7be0('0x48')][_0x7be0('0x2c')]);_0x7eccc5['query']=_[_0x7be0('0x42')](_0x4ce031['query']);_0x7eccc5[_0x7be0('0x37')]=_[_0x7be0('0x32')](_0x7eccc5['model'],_0x7eccc5[_0x7be0('0x31')]);_0x58f5ef['attributes']=_['intersection'](_0x7eccc5[_0x7be0('0x2f')],qs[_0x7be0('0x33')](_0x4ce031[_0x7be0('0x31')][_0x7be0('0x33')]));_0x58f5ef[_0x7be0('0x34')]=_0x58f5ef['attributes']['length']?_0x58f5ef[_0x7be0('0x34')]:_0x7eccc5[_0x7be0('0x2f')];_0x58f5ef[_0x7be0('0x4c')]=qs[_0x7be0('0x36')](_0x4ce031[_0x7be0('0x31')]['sort']);_0x58f5ef['where']=qs[_0x7be0('0x37')](_[_0x7be0('0x49')](_0x4ce031[_0x7be0('0x31')],_0x7eccc5['filters']));if(_0x4ce031[_0x7be0('0x31')][_0x7be0('0x38')]){_0x58f5ef[_0x7be0('0x39')]=_[_0x7be0('0x3b')](_0x58f5ef['where'],{'$or':_[_0x7be0('0x30')](_0x58f5ef[_0x7be0('0x34')],function(_0x5a3ccc){var _0x3eac33={};_0x3eac33[_0x5a3ccc]={'$like':'%'+_0x4ce031[_0x7be0('0x31')][_0x7be0('0x38')]+'%'};return _0x3eac33;})});}_0x58f5ef=_[_0x7be0('0x3b')]({},_0x58f5ef,_0x4ce031[_0x7be0('0x3c')]);return _0x48d6b0['getDescriptions'](_0x58f5ef);}})['then'](function(_0xd5ab3b){if(_0xd5ab3b){_0x5630c0=_0xd5ab3b[_0x7be0('0x35')];if(!_0x4ce031[_0x7be0('0x31')][_0x7be0('0x4a')](_0x7be0('0x4b'))){_0x58f5ef['limit']=qs[_0x7be0('0x1f')](_0x4ce031[_0x7be0('0x31')]['limit']);_0x58f5ef[_0x7be0('0x1d')]=qs[_0x7be0('0x1d')](_0x4ce031[_0x7be0('0x31')][_0x7be0('0x1d')]);}return _0x48d6b0[_0x7be0('0x4e')](_0x58f5ef);}})[_0x7be0('0x3d')](function(_0x56652c){if(_0x56652c){return _0x56652c?{'count':_0x5630c0,'rows':_0x56652c}:null;}})[_0x7be0('0x3d')](respondWithResult(_0x3b9897,null))[_0x7be0('0x41')](handleError(_0x3b9897,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e6f4b8a..4b1fdf6 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 _0x18c9=['./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x18c9,0x13c));var _0x918c=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x18c9[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0x918c('0x0'));var util=require(_0x918c('0x1'));var logger=require(_0x918c('0x2'))(_0x918c('0x3'));var moment=require(_0x918c('0x4'));var BPromise=require(_0x918c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x918c('0x6'));var rimraf=require(_0x918c('0x7'));var config=require('../../config/environment');var attributes=require(_0x918c('0x8'));module['exports']=function(_0x20573f,_0x29a649){return _0x20573f[_0x918c('0x9')](_0x918c('0xa'),attributes,{'tableName':_0x918c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd20=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x4acd43,_0x570e6b){var _0x2b9743=function(_0x5dac6d){while(--_0x5dac6d){_0x4acd43['push'](_0x4acd43['shift']());}};_0x2b9743(++_0x570e6b);}(_0xbd20,0x14a));var _0x0bd2=function(_0x127187,_0x4f7f5c){_0x127187=_0x127187-0x0;var _0xcb9e8e=_0xbd20[_0x127187];return _0xcb9e8e;};'use strict';var _=require(_0x0bd2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bd2('0x1'));var moment=require(_0x0bd2('0x2'));var BPromise=require(_0x0bd2('0x3'));var rp=require(_0x0bd2('0x4'));var fs=require('fs');var path=require(_0x0bd2('0x5'));var rimraf=require('rimraf');var config=require(_0x0bd2('0x6'));var attributes=require(_0x0bd2('0x7'));module[_0x0bd2('0x8')]=function(_0x550f03,_0xe39613){return _0x550f03[_0x0bd2('0x9')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c7b08c7..6370979 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 _0x6e64=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util'];(function(_0x137c34,_0x2ebd98){var _0x145d9b=function(_0x1b7701){while(--_0x1b7701){_0x137c34['push'](_0x137c34['shift']());}};_0x145d9b(++_0x2ebd98);}(_0x6e64,0x10f));var _0x46e6=function(_0x38e6d6,_0x3ae095){_0x38e6d6=_0x38e6d6-0x0;var _0x2a05a4=_0x6e64[_0x38e6d6];return _0x2a05a4;};'use strict';var _=require(_0x46e6('0x0'));var util=require(_0x46e6('0x1'));var moment=require(_0x46e6('0x2'));var BPromise=require(_0x46e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46e6('0x5'));var logger=require('../../config/logger')(_0x46e6('0x6'));var config=require(_0x46e6('0x7'));var jayson=require(_0x46e6('0x8'));var client=jayson[_0x46e6('0x9')][_0x46e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420d3d,_0x5c7310,_0x1184c5){return new BPromise(function(_0x254590,_0x1af29f){return client[_0x46e6('0xb')](_0x420d3d,_0x1184c5)[_0x46e6('0xc')](function(_0x369de7){logger[_0x46e6('0xd')](_0x46e6('0xe'),_0x5c7310,_0x46e6('0xf'));logger[_0x46e6('0x10')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5c7310,_0x46e6('0xf'),JSON['stringify'](_0x369de7));if(_0x369de7['error']){if(_0x369de7[_0x46e6('0x11')][_0x46e6('0x12')]===0x1f4){logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x369de7['error']['message']);return _0x1af29f(_0x369de7[_0x46e6('0x11')][_0x46e6('0x13')]);}logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x369de7[_0x46e6('0x11')][_0x46e6('0x13')]);return _0x254590(_0x369de7[_0x46e6('0x11')]['message']);}else{logger[_0x46e6('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5c7310,_0x46e6('0xf'));_0x254590(_0x369de7[_0x46e6('0x14')]['message']);}})['catch'](function(_0x1f9e4f){logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x1f9e4f);_0x1af29f(_0x1f9e4f);});});} \ No newline at end of file +var _0xf576=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x45a5a3,_0x4bbd82){var _0x5ba07c=function(_0xaedf7f){while(--_0xaedf7f){_0x45a5a3['push'](_0x45a5a3['shift']());}};_0x5ba07c(++_0x4bbd82);}(_0xf576,0xef));var _0x6f57=function(_0x515982,_0x148cf6){_0x515982=_0x515982-0x0;var _0x1f9386=_0xf576[_0x515982];return _0x1f9386;};'use strict';var _=require(_0x6f57('0x0'));var util=require(_0x6f57('0x1'));var moment=require(_0x6f57('0x2'));var BPromise=require(_0x6f57('0x3'));var rs=require(_0x6f57('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f57('0x5'));var logger=require(_0x6f57('0x6'))(_0x6f57('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f57('0x8'));var client=jayson[_0x6f57('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8ced,_0x40647a,_0x6edc9d){return new BPromise(function(_0x4292c8,_0x5951fb){return client['request'](_0x5a8ced,_0x6edc9d)[_0x6f57('0xa')](function(_0x4ecc94){logger[_0x6f57('0xb')](_0x6f57('0xc'),_0x40647a,_0x6f57('0xd'));logger[_0x6f57('0xe')](_0x6f57('0xf'),_0x40647a,_0x6f57('0xd'),JSON['stringify'](_0x4ecc94));if(_0x4ecc94[_0x6f57('0x10')]){if(_0x4ecc94[_0x6f57('0x10')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x40647a,_0x4ecc94[_0x6f57('0x10')][_0x6f57('0x11')]);return _0x5951fb(_0x4ecc94[_0x6f57('0x10')][_0x6f57('0x11')]);}logger[_0x6f57('0x10')](_0x6f57('0xc'),_0x40647a,_0x4ecc94[_0x6f57('0x10')]['message']);return _0x4292c8(_0x4ecc94['error'][_0x6f57('0x11')]);}else{logger[_0x6f57('0xb')](_0x6f57('0xc'),_0x40647a,'request\x20sent');_0x4292c8(_0x4ecc94[_0x6f57('0x12')][_0x6f57('0x11')]);}})[_0x6f57('0x13')](function(_0x13565c){logger[_0x6f57('0x10')](_0x6f57('0xc'),_0x40647a,_0x13565c);_0x5951fb(_0x13565c);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 75266aa..e8a230a 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 _0x4ce7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1d2ff6,_0x2216b4){var _0x4b269f=function(_0xe28d81){while(--_0xe28d81){_0x1d2ff6['push'](_0x1d2ff6['shift']());}};_0x4b269f(++_0x2216b4);}(_0x4ce7,0x188));var _0x74ce=function(_0x390387,_0x4422f2){_0x390387=_0x390387-0x0;var _0x55382e=_0x4ce7[_0x390387];return _0x55382e;};'use strict';var multer=require(_0x74ce('0x0'));var util=require(_0x74ce('0x1'));var path=require(_0x74ce('0x2'));var timeout=require(_0x74ce('0x3'));var express=require(_0x74ce('0x4'));var router=express[_0x74ce('0x5')]();var fs_extra=require(_0x74ce('0x6'));var auth=require(_0x74ce('0x7'));var interaction=require(_0x74ce('0x8'));var config=require(_0x74ce('0x9'));var controller=require('./intServicenowField.controller');router[_0x74ce('0xa')]('/',auth[_0x74ce('0xb')](),controller[_0x74ce('0xc')]);router[_0x74ce('0xa')](_0x74ce('0xd'),auth['isAuthenticated'](),controller[_0x74ce('0xe')]);router[_0x74ce('0xf')]('/',auth[_0x74ce('0xb')](),controller[_0x74ce('0x10')]);router[_0x74ce('0x11')](_0x74ce('0xd'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x12')]);router[_0x74ce('0x13')](_0x74ce('0xd'),auth[_0x74ce('0xb')](),controller[_0x74ce('0x14')]);module[_0x74ce('0x15')]=router; \ No newline at end of file +var _0xc4db=['post','create','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x527f3c,_0xd891c0){var _0x180898=function(_0x564c04){while(--_0x564c04){_0x527f3c['push'](_0x527f3c['shift']());}};_0x180898(++_0xd891c0);}(_0xc4db,0x1f3));var _0xbc4d=function(_0x3c7152,_0x302b29){_0x3c7152=_0x3c7152-0x0;var _0x43aea5=_0xc4db[_0x3c7152];return _0x43aea5;};'use strict';var multer=require('multer');var util=require(_0xbc4d('0x0'));var path=require(_0xbc4d('0x1'));var timeout=require(_0xbc4d('0x2'));var express=require('express');var router=express[_0xbc4d('0x3')]();var fs_extra=require(_0xbc4d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbc4d('0x5'));var config=require('../../config/environment');var controller=require(_0xbc4d('0x6'));router[_0xbc4d('0x7')]('/',auth['isAuthenticated'](),controller[_0xbc4d('0x8')]);router['get'](_0xbc4d('0x9'),auth[_0xbc4d('0xa')](),controller['show']);router[_0xbc4d('0xb')]('/',auth['isAuthenticated'](),controller[_0xbc4d('0xc')]);router['put'](_0xbc4d('0x9'),auth[_0xbc4d('0xa')](),controller[_0xbc4d('0xd')]);router[_0xbc4d('0xe')](_0xbc4d('0x9'),auth[_0xbc4d('0xa')](),controller['destroy']);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 afa59ad..79ea5d4 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 _0x006c=['keyValue','picklist','STRING','customVariable','sequelize','ENUM','string','variable'];(function(_0x3375e5,_0x39809c){var _0x1afb8e=function(_0x1e466d){while(--_0x1e466d){_0x3375e5['push'](_0x3375e5['shift']());}};_0x1afb8e(++_0x39809c);}(_0x006c,0x164));var _0xc006=function(_0x42816e,_0x4d4e12){_0x42816e=_0x42816e-0x0;var _0x4d7c35=_0x006c[_0x42816e];return _0x4d7c35;};'use strict';var Sequelize=require(_0xc006('0x0'));module['exports']={'type':{'type':Sequelize[_0xc006('0x1')](_0xc006('0x2'),_0xc006('0x3'),'customVariable',_0xc006('0x4'),_0xc006('0x5')),'defaultValue':_0xc006('0x2')},'content':{'type':Sequelize[_0xc006('0x6')]},'key':{'type':Sequelize[_0xc006('0x6')]},'keyType':{'type':Sequelize[_0xc006('0x1')]('string',_0xc006('0x3'),_0xc006('0x7'))},'keyContent':{'type':Sequelize[_0xc006('0x6')]},'idField':{'type':Sequelize[_0xc006('0x6')]},'nameField':{'type':Sequelize[_0xc006('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc006('0x6')]}}; \ No newline at end of file +var _0x1b7a=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0xde3693,_0xc3283f){var _0x140917=function(_0x1fb8f7){while(--_0x1fb8f7){_0xde3693['push'](_0xde3693['shift']());}};_0x140917(++_0xc3283f);}(_0x1b7a,0x1cb));var _0xa1b7=function(_0x2aa032,_0x523bd6){_0x2aa032=_0x2aa032-0x0;var _0x567ce3=_0x1b7a[_0x2aa032];return _0x567ce3;};'use strict';var Sequelize=require(_0xa1b7('0x0'));module[_0xa1b7('0x1')]={'type':{'type':Sequelize[_0xa1b7('0x2')](_0xa1b7('0x3'),'variable',_0xa1b7('0x4'),_0xa1b7('0x5'),_0xa1b7('0x6')),'defaultValue':_0xa1b7('0x3')},'content':{'type':Sequelize[_0xa1b7('0x7')]},'key':{'type':Sequelize[_0xa1b7('0x7')]},'keyType':{'type':Sequelize[_0xa1b7('0x2')](_0xa1b7('0x3'),_0xa1b7('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xa1b7('0x7')]},'idField':{'type':Sequelize[_0xa1b7('0x7')]},'nameField':{'type':Sequelize[_0xa1b7('0x7')]},'customField':{'type':Sequelize[_0xa1b7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 44eb8d0..116e08b 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 _0x037d=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes'];(function(_0x13a11b,_0x5361b4){var _0xe65d31=function(_0x5f2a91){while(--_0x5f2a91){_0x13a11b['push'](_0x13a11b['shift']());}};_0xe65d31(++_0x5361b4);}(_0x037d,0x13b));var _0xd037=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x037d[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd037('0x0'));var zipdir=require(_0xd037('0x1'));var jsonpatch=require(_0xd037('0x2'));var rp=require(_0xd037('0x3'));var moment=require(_0xd037('0x4'));var BPromise=require(_0xd037('0x5'));var Mustache=require(_0xd037('0x6'));var util=require(_0xd037('0x7'));var path=require(_0xd037('0x8'));var sox=require(_0xd037('0x9'));var csv=require(_0xd037('0xa'));var ejs=require(_0xd037('0xb'));var fs=require('fs');var fs_extra=require(_0xd037('0xc'));var _=require(_0xd037('0xd'));var squel=require(_0xd037('0xe'));var crypto=require(_0xd037('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd037('0xa'));var querystring=require('querystring');var Papa=require(_0xd037('0x10'));var Redis=require(_0xd037('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd037('0x12'));var hardwareService=require(_0xd037('0x13'));var logger=require(_0xd037('0x14'))(_0xd037('0x15'));var utils=require(_0xd037('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40a662,_0x4ea46c){_0x4ea46c=_0x4ea46c||0xcc;return function(_0x528f51){if(_0x528f51){return _0x40a662[_0xd037('0x17')](_0x4ea46c);}return _0x40a662[_0xd037('0x18')](_0x4ea46c)[_0xd037('0x19')]();};}function respondWithResult(_0x2ee58f,_0x2fc28f){_0x2fc28f=_0x2fc28f||0xc8;return function(_0x5dc4b6){if(_0x5dc4b6){return _0x2ee58f[_0xd037('0x18')](_0x2fc28f)[_0xd037('0x1a')](_0x5dc4b6);}};}function respondWithFilteredResult(_0x15cf4f,_0x4968a1){return function(_0x25a167){if(_0x25a167){var _0x55d1e4=typeof _0x4968a1[_0xd037('0x1b')]===_0xd037('0x1c')&&typeof _0x4968a1['limit']===_0xd037('0x1c');var _0x45ba34=_0x25a167[_0xd037('0x1d')];var _0x2282be=_0x55d1e4?0x0:_0x4968a1[_0xd037('0x1b')];var _0x3caf23=_0x55d1e4?_0x25a167[_0xd037('0x1d')]:_0x4968a1[_0xd037('0x1b')]+_0x4968a1[_0xd037('0x1e')];var _0x3390ef;if(_0x3caf23>=_0x45ba34){_0x3caf23=_0x45ba34;_0x3390ef=0xc8;}else{_0x3390ef=0xce;}_0x15cf4f['status'](_0x3390ef);return _0x15cf4f[_0xd037('0x1f')](_0xd037('0x20'),_0x2282be+'-'+_0x3caf23+'/'+_0x45ba34)['json'](_0x25a167);}return null;};}function patchUpdates(_0x5235fa){return function(_0x352938){try{jsonpatch['apply'](_0x352938,_0x5235fa,!![]);}catch(_0x83b8be){return BPromise[_0xd037('0x21')](_0x83b8be);}return _0x352938['save']();};}function saveUpdates(_0x384e10,_0x10a935){return function(_0x1a5828){if(_0x1a5828){return _0x1a5828[_0xd037('0x22')](_0x384e10)['then'](function(_0x4769af){return _0x4769af;});}return null;};}function removeEntity(_0x2cfc30,_0x3759bf){return function(_0x1c22f){if(_0x1c22f){return _0x1c22f[_0xd037('0x23')]()[_0xd037('0x24')](function(){_0x2cfc30[_0xd037('0x18')](0xcc)[_0xd037('0x19')]();});}};}function handleEntityNotFound(_0x311f5f,_0x45df1e){return function(_0x326da4){if(!_0x326da4){_0x311f5f['sendStatus'](0x194);}return _0x326da4;};}function handleError(_0xb9ade9,_0x515e71){_0x515e71=_0x515e71||0x1f4;return function(_0x46fb8b){logger[_0xd037('0x25')](_0x46fb8b[_0xd037('0x26')]);if(_0x46fb8b[_0xd037('0x27')]){delete _0x46fb8b[_0xd037('0x27')];}_0xb9ade9[_0xd037('0x18')](_0x515e71)[_0xd037('0x28')](_0x46fb8b);};}exports[_0xd037('0x29')]=function(_0x1cc243,_0x2e7eaf){var _0x514fc4={},_0x32cf3d={},_0x39fd49={'count':0x0,'rows':[]};var _0x542a8b=_[_0xd037('0x2a')](db[_0xd037('0x2b')][_0xd037('0x2c')],function(_0x1e7e0f){return{'name':_0x1e7e0f[_0xd037('0x2d')],'type':_0x1e7e0f[_0xd037('0x2e')][_0xd037('0x2f')]};});_0x32cf3d[_0xd037('0x30')]=_['map'](_0x542a8b,'name');_0x32cf3d[_0xd037('0x31')]=_[_0xd037('0x32')](_0x1cc243['query']);_0x32cf3d[_0xd037('0x33')]=_[_0xd037('0x34')](_0x32cf3d[_0xd037('0x30')],_0x32cf3d[_0xd037('0x31')]);_0x514fc4[_0xd037('0x35')]=_['intersection'](_0x32cf3d[_0xd037('0x30')],qs[_0xd037('0x36')](_0x1cc243[_0xd037('0x31')][_0xd037('0x36')]));_0x514fc4[_0xd037('0x35')]=_0x514fc4[_0xd037('0x35')]['length']?_0x514fc4[_0xd037('0x35')]:_0x32cf3d['model'];if(!_0x1cc243[_0xd037('0x31')]['hasOwnProperty']('nolimit')){_0x514fc4[_0xd037('0x1e')]=qs[_0xd037('0x1e')](_0x1cc243[_0xd037('0x31')][_0xd037('0x1e')]);_0x514fc4[_0xd037('0x1b')]=qs[_0xd037('0x1b')](_0x1cc243[_0xd037('0x31')][_0xd037('0x1b')]);}_0x514fc4[_0xd037('0x37')]=qs[_0xd037('0x38')](_0x1cc243['query']['sort']);_0x514fc4[_0xd037('0x39')]=qs[_0xd037('0x33')](_[_0xd037('0x3a')](_0x1cc243['query'],_0x32cf3d[_0xd037('0x33')]),_0x542a8b);if(_0x1cc243[_0xd037('0x31')][_0xd037('0x3b')]){_0x514fc4[_0xd037('0x39')]=_[_0xd037('0x3c')](_0x514fc4[_0xd037('0x39')],{'$or':_[_0xd037('0x2a')](_0x542a8b,function(_0x2e1af2){if(_0x2e1af2[_0xd037('0x2e')]!==_0xd037('0x3d')){var _0x3304e5={};_0x3304e5[_0x2e1af2['name']]={'$like':'%'+_0x1cc243[_0xd037('0x31')][_0xd037('0x3b')]+'%'};return _0x3304e5;}})});}_0x514fc4=_[_0xd037('0x3c')]({},_0x514fc4,_0x1cc243[_0xd037('0x3e')]);var _0x1c673d={'where':_0x514fc4[_0xd037('0x39')]};return db[_0xd037('0x2b')][_0xd037('0x1d')](_0x1c673d)['then'](function(_0x40a256){_0x39fd49[_0xd037('0x1d')]=_0x40a256;if(_0x1cc243[_0xd037('0x31')][_0xd037('0x3f')]){_0x514fc4[_0xd037('0x40')]=[{'all':!![]}];}return db[_0xd037('0x2b')][_0xd037('0x41')](_0x514fc4);})[_0xd037('0x24')](function(_0xfc7bf7){_0x39fd49['rows']=_0xfc7bf7;return _0x39fd49;})[_0xd037('0x24')](respondWithFilteredResult(_0x2e7eaf,_0x514fc4))[_0xd037('0x42')](handleError(_0x2e7eaf,null));};exports['show']=function(_0x4c25a7,_0x56387c){var _0x2785fd={'raw':!![],'where':{'id':_0x4c25a7[_0xd037('0x43')]['id']}},_0x40af99={};_0x40af99[_0xd037('0x30')]=_[_0xd037('0x32')](db['ServicenowField']['rawAttributes']);_0x40af99['query']=_[_0xd037('0x32')](_0x4c25a7['query']);_0x40af99[_0xd037('0x33')]=_[_0xd037('0x34')](_0x40af99[_0xd037('0x30')],_0x40af99[_0xd037('0x31')]);_0x2785fd[_0xd037('0x35')]=_[_0xd037('0x34')](_0x40af99[_0xd037('0x30')],qs[_0xd037('0x36')](_0x4c25a7[_0xd037('0x31')]['fields']));_0x2785fd[_0xd037('0x35')]=_0x2785fd['attributes'][_0xd037('0x44')]?_0x2785fd['attributes']:_0x40af99['model'];if(_0x4c25a7[_0xd037('0x31')][_0xd037('0x3f')]){_0x2785fd['include']=[{'all':!![]}];}_0x2785fd=_[_0xd037('0x3c')]({},_0x2785fd,_0x4c25a7[_0xd037('0x3e')]);return db[_0xd037('0x2b')][_0xd037('0x45')](_0x2785fd)[_0xd037('0x24')](handleEntityNotFound(_0x56387c,null))[_0xd037('0x24')](respondWithResult(_0x56387c,null))['catch'](handleError(_0x56387c,null));};exports[_0xd037('0x46')]=function(_0x1a495a,_0x2c14fb){return db[_0xd037('0x2b')][_0xd037('0x46')](_0x1a495a[_0xd037('0x47')],{})[_0xd037('0x24')](respondWithResult(_0x2c14fb,0xc9))[_0xd037('0x42')](handleError(_0x2c14fb,null));};exports[_0xd037('0x22')]=function(_0x1c8673,_0x5985ae){if(_0x1c8673[_0xd037('0x47')]['id']){delete _0x1c8673[_0xd037('0x47')]['id'];}return db['ServicenowField'][_0xd037('0x45')]({'where':{'id':_0x1c8673[_0xd037('0x43')]['id']}})['then'](handleEntityNotFound(_0x5985ae,null))[_0xd037('0x24')](saveUpdates(_0x1c8673[_0xd037('0x47')],null))[_0xd037('0x24')](respondWithResult(_0x5985ae,null))[_0xd037('0x42')](handleError(_0x5985ae,null));};exports[_0xd037('0x23')]=function(_0x69d6ab,_0x219718){return db[_0xd037('0x2b')][_0xd037('0x45')]({'where':{'id':_0x69d6ab[_0xd037('0x43')]['id']}})['then'](handleEntityNotFound(_0x219718,null))[_0xd037('0x24')](removeEntity(_0x219718,null))[_0xd037('0x42')](handleError(_0x219718,null));}; \ No newline at end of file +var _0x7514=['show','params','rawAttributes','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','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','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3ad4b8,_0x528645){var _0xdd7aa6=function(_0x552baf){while(--_0x552baf){_0x3ad4b8['push'](_0x3ad4b8['shift']());}};_0xdd7aa6(++_0x528645);}(_0x7514,0x13c));var _0x4751=function(_0x30c39a,_0x431fbd){_0x30c39a=_0x30c39a-0x0;var _0x2d944c=_0x7514[_0x30c39a];return _0x2d944c;};'use strict';var emlformat=require(_0x4751('0x0'));var rimraf=require(_0x4751('0x1'));var zipdir=require(_0x4751('0x2'));var jsonpatch=require(_0x4751('0x3'));var rp=require(_0x4751('0x4'));var moment=require(_0x4751('0x5'));var BPromise=require(_0x4751('0x6'));var Mustache=require('mustache');var util=require(_0x4751('0x7'));var path=require(_0x4751('0x8'));var sox=require('sox');var csv=require(_0x4751('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4751('0xa'));var squel=require(_0x4751('0xb'));var crypto=require(_0x4751('0xc'));var jsforce=require(_0x4751('0xd'));var deskjs=require(_0x4751('0xe'));var toCsv=require(_0x4751('0x9'));var querystring=require(_0x4751('0xf'));var Papa=require(_0x4751('0x10'));var Redis=require(_0x4751('0x11'));var authService=require(_0x4751('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4751('0x13'));var hardwareService=require(_0x4751('0x14'));var logger=require(_0x4751('0x15'))(_0x4751('0x16'));var utils=require(_0x4751('0x17'));var config=require(_0x4751('0x18'));var licenseUtil=require(_0x4751('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x122431,_0x25ba69){_0x25ba69=_0x25ba69||0xcc;return function(_0x359674){if(_0x359674){return _0x122431[_0x4751('0x1a')](_0x25ba69);}return _0x122431[_0x4751('0x1b')](_0x25ba69)[_0x4751('0x1c')]();};}function respondWithResult(_0x48026f,_0x426409){_0x426409=_0x426409||0xc8;return function(_0x2dfb63){if(_0x2dfb63){return _0x48026f[_0x4751('0x1b')](_0x426409)['json'](_0x2dfb63);}};}function respondWithFilteredResult(_0x2cdc5e,_0x597011){return function(_0x2b5856){if(_0x2b5856){var _0x2b44cb=typeof _0x597011['offset']===_0x4751('0x1d')&&typeof _0x597011[_0x4751('0x1e')]==='undefined';var _0x57546e=_0x2b5856['count'];var _0x51dcf4=_0x2b44cb?0x0:_0x597011[_0x4751('0x1f')];var _0x1bf4a5=_0x2b44cb?_0x2b5856[_0x4751('0x20')]:_0x597011[_0x4751('0x1f')]+_0x597011[_0x4751('0x1e')];var _0x5e76a;if(_0x1bf4a5>=_0x57546e){_0x1bf4a5=_0x57546e;_0x5e76a=0xc8;}else{_0x5e76a=0xce;}_0x2cdc5e[_0x4751('0x1b')](_0x5e76a);return _0x2cdc5e['set'](_0x4751('0x21'),_0x51dcf4+'-'+_0x1bf4a5+'/'+_0x57546e)[_0x4751('0x22')](_0x2b5856);}return null;};}function patchUpdates(_0x42309c){return function(_0x1b3e0f){try{jsonpatch[_0x4751('0x23')](_0x1b3e0f,_0x42309c,!![]);}catch(_0x3011c6){return BPromise[_0x4751('0x24')](_0x3011c6);}return _0x1b3e0f[_0x4751('0x25')]();};}function saveUpdates(_0x26d322,_0x1f3219){return function(_0x12c0fd){if(_0x12c0fd){return _0x12c0fd[_0x4751('0x26')](_0x26d322)[_0x4751('0x27')](function(_0x1c35f6){return _0x1c35f6;});}return null;};}function removeEntity(_0x19e179,_0x1bae89){return function(_0xdea9b4){if(_0xdea9b4){return _0xdea9b4['destroy']()[_0x4751('0x27')](function(){_0x19e179[_0x4751('0x1b')](0xcc)[_0x4751('0x1c')]();});}};}function handleEntityNotFound(_0x117cfe,_0x4547fa){return function(_0x51556b){if(!_0x51556b){_0x117cfe[_0x4751('0x1a')](0x194);}return _0x51556b;};}function handleError(_0x3e221b,_0xa2e162){_0xa2e162=_0xa2e162||0x1f4;return function(_0x4eeabd){logger[_0x4751('0x28')](_0x4eeabd[_0x4751('0x29')]);if(_0x4eeabd[_0x4751('0x2a')]){delete _0x4eeabd['name'];}_0x3e221b[_0x4751('0x1b')](_0xa2e162)[_0x4751('0x2b')](_0x4eeabd);};}exports[_0x4751('0x2c')]=function(_0x3367d1,_0x3f88a7){var _0x512751={},_0x57a7ce={},_0x26fc7e={'count':0x0,'rows':[]};var _0x3e8ac1=_[_0x4751('0x2d')](db[_0x4751('0x2e')]['rawAttributes'],function(_0x2efcb6){return{'name':_0x2efcb6[_0x4751('0x2f')],'type':_0x2efcb6[_0x4751('0x30')]['key']};});_0x57a7ce[_0x4751('0x31')]=_[_0x4751('0x2d')](_0x3e8ac1,_0x4751('0x2a'));_0x57a7ce[_0x4751('0x32')]=_[_0x4751('0x33')](_0x3367d1[_0x4751('0x32')]);_0x57a7ce[_0x4751('0x34')]=_[_0x4751('0x35')](_0x57a7ce[_0x4751('0x31')],_0x57a7ce[_0x4751('0x32')]);_0x512751[_0x4751('0x36')]=_[_0x4751('0x35')](_0x57a7ce['model'],qs[_0x4751('0x37')](_0x3367d1[_0x4751('0x32')]['fields']));_0x512751[_0x4751('0x36')]=_0x512751[_0x4751('0x36')][_0x4751('0x38')]?_0x512751['attributes']:_0x57a7ce[_0x4751('0x31')];if(!_0x3367d1[_0x4751('0x32')][_0x4751('0x39')](_0x4751('0x3a'))){_0x512751['limit']=qs['limit'](_0x3367d1['query'][_0x4751('0x1e')]);_0x512751[_0x4751('0x1f')]=qs[_0x4751('0x1f')](_0x3367d1[_0x4751('0x32')][_0x4751('0x1f')]);}_0x512751['order']=qs['sort'](_0x3367d1[_0x4751('0x32')]['sort']);_0x512751['where']=qs[_0x4751('0x34')](_[_0x4751('0x3b')](_0x3367d1['query'],_0x57a7ce[_0x4751('0x34')]),_0x3e8ac1);if(_0x3367d1[_0x4751('0x32')][_0x4751('0x3c')]){_0x512751[_0x4751('0x3d')]=_[_0x4751('0x3e')](_0x512751[_0x4751('0x3d')],{'$or':_[_0x4751('0x2d')](_0x3e8ac1,function(_0x6a89fd){if(_0x6a89fd[_0x4751('0x30')]!==_0x4751('0x3f')){var _0x379236={};_0x379236[_0x6a89fd[_0x4751('0x2a')]]={'$like':'%'+_0x3367d1[_0x4751('0x32')][_0x4751('0x3c')]+'%'};return _0x379236;}})});}_0x512751=_[_0x4751('0x3e')]({},_0x512751,_0x3367d1[_0x4751('0x40')]);var _0x57c84a={'where':_0x512751[_0x4751('0x3d')]};return db['ServicenowField'][_0x4751('0x20')](_0x57c84a)[_0x4751('0x27')](function(_0x5c68b7){_0x26fc7e[_0x4751('0x20')]=_0x5c68b7;if(_0x3367d1[_0x4751('0x32')][_0x4751('0x41')]){_0x512751[_0x4751('0x42')]=[{'all':!![]}];}return db[_0x4751('0x2e')][_0x4751('0x43')](_0x512751);})['then'](function(_0x577567){_0x26fc7e[_0x4751('0x44')]=_0x577567;return _0x26fc7e;})['then'](respondWithFilteredResult(_0x3f88a7,_0x512751))['catch'](handleError(_0x3f88a7,null));};exports[_0x4751('0x45')]=function(_0x2378b2,_0x128fbb){var _0x43e6cb={'raw':!![],'where':{'id':_0x2378b2[_0x4751('0x46')]['id']}},_0x46a739={};_0x46a739['model']=_[_0x4751('0x33')](db[_0x4751('0x2e')][_0x4751('0x47')]);_0x46a739[_0x4751('0x32')]=_[_0x4751('0x33')](_0x2378b2[_0x4751('0x32')]);_0x46a739[_0x4751('0x34')]=_['intersection'](_0x46a739['model'],_0x46a739[_0x4751('0x32')]);_0x43e6cb[_0x4751('0x36')]=_['intersection'](_0x46a739[_0x4751('0x31')],qs['fields'](_0x2378b2[_0x4751('0x32')][_0x4751('0x37')]));_0x43e6cb['attributes']=_0x43e6cb[_0x4751('0x36')][_0x4751('0x38')]?_0x43e6cb[_0x4751('0x36')]:_0x46a739[_0x4751('0x31')];if(_0x2378b2[_0x4751('0x32')][_0x4751('0x41')]){_0x43e6cb[_0x4751('0x42')]=[{'all':!![]}];}_0x43e6cb=_['merge']({},_0x43e6cb,_0x2378b2['options']);return db[_0x4751('0x2e')][_0x4751('0x48')](_0x43e6cb)[_0x4751('0x27')](handleEntityNotFound(_0x128fbb,null))['then'](respondWithResult(_0x128fbb,null))[_0x4751('0x49')](handleError(_0x128fbb,null));};exports[_0x4751('0x4a')]=function(_0x274833,_0x5108f3){return db[_0x4751('0x2e')]['create'](_0x274833[_0x4751('0x4b')],{})[_0x4751('0x27')](respondWithResult(_0x5108f3,0xc9))[_0x4751('0x49')](handleError(_0x5108f3,null));};exports[_0x4751('0x26')]=function(_0x17cace,_0x2c8bef){if(_0x17cace[_0x4751('0x4b')]['id']){delete _0x17cace[_0x4751('0x4b')]['id'];}return db[_0x4751('0x2e')][_0x4751('0x48')]({'where':{'id':_0x17cace[_0x4751('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c8bef,null))[_0x4751('0x27')](saveUpdates(_0x17cace['body'],null))[_0x4751('0x27')](respondWithResult(_0x2c8bef,null))[_0x4751('0x49')](handleError(_0x2c8bef,null));};exports[_0x4751('0x4c')]=function(_0x3a6280,_0x59165f){return db[_0x4751('0x2e')][_0x4751('0x48')]({'where':{'id':_0x3a6280[_0x4751('0x46')]['id']}})[_0x4751('0x27')](handleEntityNotFound(_0x59165f,null))['then'](removeEntity(_0x59165f,null))['catch'](handleError(_0x59165f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index d73b1f3..5bafd8e 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 _0xa4b2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x302128,_0x34cf5b){var _0x33b9b5=function(_0xcbadbd){while(--_0xcbadbd){_0x302128['push'](_0x302128['shift']());}};_0x33b9b5(++_0x34cf5b);}(_0xa4b2,0x195));var _0x2a4b=function(_0x925df8,_0xa6172b){_0x925df8=_0x925df8-0x0;var _0xa98420=_0xa4b2[_0x925df8];return _0xa98420;};'use strict';var _=require(_0x2a4b('0x0'));var util=require(_0x2a4b('0x1'));var logger=require(_0x2a4b('0x2'))(_0x2a4b('0x3'));var moment=require(_0x2a4b('0x4'));var BPromise=require(_0x2a4b('0x5'));var rp=require(_0x2a4b('0x6'));var fs=require('fs');var path=require(_0x2a4b('0x7'));var rimraf=require('rimraf');var config=require(_0x2a4b('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x2a4b('0x9')]=function(_0x26fba0,_0x51f9f1){return _0x26fba0[_0x2a4b('0xa')](_0x2a4b('0xb'),attributes,{'tableName':_0x2a4b('0xc'),'paranoid':![],'indexes':[{'name':_0x2a4b('0xd'),'fields':[_0x2a4b('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x589c=['FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField'];(function(_0x35a709,_0x21dabd){var _0x21062a=function(_0x16093f){while(--_0x16093f){_0x35a709['push'](_0x35a709['shift']());}};_0x21062a(++_0x21dabd);}(_0x589c,0xef));var _0xc589=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x589c[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xc589('0x0'));var util=require('util');var logger=require(_0xc589('0x1'))(_0xc589('0x2'));var moment=require(_0xc589('0x3'));var BPromise=require('bluebird');var rp=require(_0xc589('0x4'));var fs=require('fs');var path=require(_0xc589('0x5'));var rimraf=require(_0xc589('0x6'));var config=require('../../config/environment');var attributes=require(_0xc589('0x7'));module[_0xc589('0x8')]=function(_0x488b2b,_0xf99847){return _0x488b2b[_0xc589('0x9')]('ServicenowField',attributes,{'tableName':_0xc589('0xa'),'paranoid':![],'indexes':[{'name':_0xc589('0xb'),'fields':[_0xc589('0xc'),_0xc589('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 0811897..1513dd7 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 _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(_0x406264,_0xe930cd){var _0x5a8066=function(_0x1cd0a2){while(--_0x1cd0a2){_0x406264['push'](_0x406264['shift']());}};_0x5a8066(++_0xe930cd);}(_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 +var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x1558ab,_0x39d1de){var _0x53b64a=function(_0x4771ed){while(--_0x4771ed){_0x1558ab['push'](_0x1558ab['shift']());}};_0x53b64a(++_0x39d1de);}(_0xda3f,0xec));var _0xfda3=function(_0x42e938,_0x6c4b2a){_0x42e938=_0x42e938-0x0;var _0x410889=_0xda3f[_0x42e938];return _0x410889;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 0998671..1df4774 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5692f4,_0x535a41){var _0x7aaf51=function(_0x60f98b){while(--_0x60f98b){_0x5692f4['push'](_0x5692f4['shift']());}};_0x7aaf51(++_0x535a41);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x58e590,_0x4b64c9){var _0x594dcf=function(_0x10ecb5){while(--_0x10ecb5){_0x58e590['push'](_0x58e590['shift']());}};_0x594dcf(++_0x4b64c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 b0031da..dbc155e 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(_0x42b46d,_0x2a493f){var _0x21f2cc=function(_0x8b1a7c){while(--_0x8b1a7c){_0x42b46d['push'](_0x42b46d['shift']());}};_0x21f2cc(++_0x2a493f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x469929,_0x269a68){var _0x3d62b6=function(_0x52ed90){while(--_0x52ed90){_0x469929['push'](_0x469929['shift']());}};_0x3d62b6(++_0x269a68);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 1024705..48cd892 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 _0x67cc=['Descriptions','getDescriptions','SugarcrmField','getFields','created_by','duration_hours','parent_id','parent_name','direction','password','remoteUri','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','endsWith','values','value','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','eml-format','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','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','merge','VIRTUAL','filter','where','findAll','catch','show','params','includeAll','include','options','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x2581be,_0x59eec3){var _0x36c076=function(_0x9d6a87){while(--_0x9d6a87){_0x2581be['push'](_0x2581be['shift']());}};_0x36c076(++_0x59eec3);}(_0x67cc,0x1f4));var _0xc67c=function(_0x116ec2,_0x23b3d9){_0x116ec2=_0x116ec2-0x0;var _0x44c06e=_0x67cc[_0x116ec2];return _0x44c06e;};'use strict';var emlformat=require(_0xc67c('0x0'));var rimraf=require(_0xc67c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc67c('0x2'));var rp=require(_0xc67c('0x3'));var moment=require('moment');var BPromise=require(_0xc67c('0x4'));var Mustache=require(_0xc67c('0x5'));var util=require(_0xc67c('0x6'));var path=require('path');var sox=require(_0xc67c('0x7'));var csv=require(_0xc67c('0x8'));var ejs=require(_0xc67c('0x9'));var fs=require('fs');var fs_extra=require(_0xc67c('0xa'));var _=require(_0xc67c('0xb'));var squel=require(_0xc67c('0xc'));var crypto=require(_0xc67c('0xd'));var jsforce=require(_0xc67c('0xe'));var deskjs=require(_0xc67c('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc67c('0x10'));var Papa=require(_0xc67c('0x11'));var Redis=require(_0xc67c('0x12'));var authService=require(_0xc67c('0x13'));var qs=require(_0xc67c('0x14'));var as=require(_0xc67c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc67c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc67c('0x17'));var licenseUtil=require(_0xc67c('0x18'));var db=require(_0xc67c('0x19'))['db'];var integrations=require(_0xc67c('0x1a'));function respondWithStatusCode(_0x25532b,_0x3a052f){_0x3a052f=_0x3a052f||0xcc;return function(_0x56d738){if(_0x56d738){return _0x25532b[_0xc67c('0x1b')](_0x3a052f);}return _0x25532b[_0xc67c('0x1c')](_0x3a052f)[_0xc67c('0x1d')]();};}function respondWithResult(_0x10303d,_0x2626b2){_0x2626b2=_0x2626b2||0xc8;return function(_0x4b6380){if(_0x4b6380){return _0x10303d['status'](_0x2626b2)[_0xc67c('0x1e')](_0x4b6380);}};}function respondWithFilteredResult(_0x172c6e,_0x38d342){return function(_0xd44b83){if(_0xd44b83){var _0x1ea044=typeof _0x38d342[_0xc67c('0x1f')]===_0xc67c('0x20')&&typeof _0x38d342[_0xc67c('0x21')]===_0xc67c('0x20');var _0x352e7c=_0xd44b83['count'];var _0x4ce36d=_0x1ea044?0x0:_0x38d342[_0xc67c('0x1f')];var _0x16f87b=_0x1ea044?_0xd44b83[_0xc67c('0x22')]:_0x38d342[_0xc67c('0x1f')]+_0x38d342[_0xc67c('0x21')];var _0x5dc94c;if(_0x16f87b>=_0x352e7c){_0x16f87b=_0x352e7c;_0x5dc94c=0xc8;}else{_0x5dc94c=0xce;}_0x172c6e[_0xc67c('0x1c')](_0x5dc94c);return _0x172c6e[_0xc67c('0x23')](_0xc67c('0x24'),_0x4ce36d+'-'+_0x16f87b+'/'+_0x352e7c)['json'](_0xd44b83);}return null;};}function patchUpdates(_0x3ea13d){return function(_0x49722f){try{jsonpatch['apply'](_0x49722f,_0x3ea13d,!![]);}catch(_0xba83b8){return BPromise[_0xc67c('0x25')](_0xba83b8);}return _0x49722f[_0xc67c('0x26')]();};}function saveUpdates(_0x52832a,_0x1d6e11){return function(_0x15127c){if(_0x15127c){return _0x15127c[_0xc67c('0x27')](_0x52832a)[_0xc67c('0x28')](function(_0x21941c){return _0x21941c;});}return null;};}function removeEntity(_0x516378,_0x211819){return function(_0x3dfc4c){if(_0x3dfc4c){return _0x3dfc4c['destroy']()['then'](function(){_0x516378[_0xc67c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dcd83,_0x1335dc){return function(_0x2699c0){if(!_0x2699c0){_0x2dcd83[_0xc67c('0x1b')](0x194);}return _0x2699c0;};}function handleError(_0xbf14e9,_0x4b09a0){_0x4b09a0=_0x4b09a0||0x1f4;return function(_0x446006){logger[_0xc67c('0x29')](_0x446006['stack']);if(_0x446006[_0xc67c('0x2a')]){delete _0x446006[_0xc67c('0x2a')];}_0xbf14e9[_0xc67c('0x1c')](_0x4b09a0)[_0xc67c('0x2b')](_0x446006);};}exports[_0xc67c('0x2c')]=function(_0x37aff4,_0x13c31e){var _0x2fa4ee={},_0x59e37d={},_0x1958ba={'count':0x0,'rows':[]};var _0x4ac1d7=_[_0xc67c('0x2d')](db[_0xc67c('0x2e')][_0xc67c('0x2f')],function(_0x301d8e){return{'name':_0x301d8e[_0xc67c('0x30')],'type':_0x301d8e[_0xc67c('0x31')][_0xc67c('0x32')]};});_0x59e37d[_0xc67c('0x33')]=_[_0xc67c('0x2d')](_0x4ac1d7,_0xc67c('0x2a'));_0x59e37d[_0xc67c('0x34')]=_[_0xc67c('0x35')](_0x37aff4[_0xc67c('0x34')]);_0x59e37d[_0xc67c('0x36')]=_[_0xc67c('0x37')](_0x59e37d[_0xc67c('0x33')],_0x59e37d['query']);_0x2fa4ee[_0xc67c('0x38')]=_['intersection'](_0x59e37d[_0xc67c('0x33')],qs[_0xc67c('0x39')](_0x37aff4[_0xc67c('0x34')][_0xc67c('0x39')]));_0x2fa4ee[_0xc67c('0x38')]=_0x2fa4ee[_0xc67c('0x38')][_0xc67c('0x3a')]?_0x2fa4ee[_0xc67c('0x38')]:_0x59e37d[_0xc67c('0x33')];if(!_0x37aff4[_0xc67c('0x34')]['hasOwnProperty'](_0xc67c('0x3b'))){_0x2fa4ee[_0xc67c('0x21')]=qs['limit'](_0x37aff4['query']['limit']);_0x2fa4ee[_0xc67c('0x1f')]=qs[_0xc67c('0x1f')](_0x37aff4[_0xc67c('0x34')]['offset']);}_0x2fa4ee[_0xc67c('0x3c')]=qs[_0xc67c('0x3d')](_0x37aff4['query'][_0xc67c('0x3d')]);_0x2fa4ee['where']=qs[_0xc67c('0x36')](_[_0xc67c('0x3e')](_0x37aff4[_0xc67c('0x34')],_0x59e37d[_0xc67c('0x36')]),_0x4ac1d7);if(_0x37aff4['query']['filter']){_0x2fa4ee['where']=_[_0xc67c('0x3f')](_0x2fa4ee['where'],{'$or':_[_0xc67c('0x2d')](_0x4ac1d7,function(_0xd91504){if(_0xd91504['type']!==_0xc67c('0x40')){var _0x3578e4={};_0x3578e4[_0xd91504[_0xc67c('0x2a')]]={'$like':'%'+_0x37aff4['query'][_0xc67c('0x41')]+'%'};return _0x3578e4;}})});}_0x2fa4ee=_['merge']({},_0x2fa4ee,_0x37aff4['options']);var _0x966a4d={'where':_0x2fa4ee[_0xc67c('0x42')]};return db[_0xc67c('0x2e')][_0xc67c('0x22')](_0x966a4d)['then'](function(_0x197855){_0x1958ba[_0xc67c('0x22')]=_0x197855;if(_0x37aff4[_0xc67c('0x34')]['includeAll']){_0x2fa4ee['include']=[{'all':!![]}];}return db[_0xc67c('0x2e')][_0xc67c('0x43')](_0x2fa4ee);})['then'](function(_0x18494f){_0x1958ba['rows']=_0x18494f;return _0x1958ba;})[_0xc67c('0x28')](respondWithFilteredResult(_0x13c31e,_0x2fa4ee))[_0xc67c('0x44')](handleError(_0x13c31e,null));};exports[_0xc67c('0x45')]=function(_0x308180,_0x481a5f){var _0x5e594e={'raw':![],'where':{'id':_0x308180[_0xc67c('0x46')]['id']}},_0x23be05={};_0x23be05[_0xc67c('0x33')]=_[_0xc67c('0x35')](db[_0xc67c('0x2e')][_0xc67c('0x2f')]);_0x23be05[_0xc67c('0x34')]=_[_0xc67c('0x35')](_0x308180[_0xc67c('0x34')]);_0x23be05[_0xc67c('0x36')]=_['intersection'](_0x23be05[_0xc67c('0x33')],_0x23be05['query']);_0x5e594e[_0xc67c('0x38')]=_['intersection'](_0x23be05[_0xc67c('0x33')],qs[_0xc67c('0x39')](_0x308180['query'][_0xc67c('0x39')]));_0x5e594e['attributes']=_0x5e594e[_0xc67c('0x38')][_0xc67c('0x3a')]?_0x5e594e[_0xc67c('0x38')]:_0x23be05[_0xc67c('0x33')];if(_0x308180[_0xc67c('0x34')][_0xc67c('0x47')]){_0x5e594e[_0xc67c('0x48')]=[{'all':!![]}];}_0x5e594e=_['merge']({},_0x5e594e,_0x308180[_0xc67c('0x49')]);return db[_0xc67c('0x2e')][_0xc67c('0x4a')](_0x5e594e)[_0xc67c('0x28')](handleEntityNotFound(_0x481a5f,null))['then'](respondWithResult(_0x481a5f,null))[_0xc67c('0x44')](handleError(_0x481a5f,null));};exports['create']=function(_0x61c4aa,_0x265f30){return db[_0xc67c('0x2e')][_0xc67c('0x4b')](_0x61c4aa[_0xc67c('0x4c')],{})[_0xc67c('0x28')](respondWithResult(_0x265f30,0xc9))['catch'](handleError(_0x265f30,null));};exports[_0xc67c('0x27')]=function(_0x32d709,_0x51f0c7){if(_0x32d709['body']['id']){delete _0x32d709['body']['id'];}return db[_0xc67c('0x2e')][_0xc67c('0x4a')]({'where':{'id':_0x32d709['params']['id']}})[_0xc67c('0x28')](handleEntityNotFound(_0x51f0c7,null))[_0xc67c('0x28')](saveUpdates(_0x32d709[_0xc67c('0x4c')],null))[_0xc67c('0x28')](respondWithResult(_0x51f0c7,null))[_0xc67c('0x44')](handleError(_0x51f0c7,null));};exports[_0xc67c('0x4d')]=function(_0x236492,_0x482991){return db[_0xc67c('0x2e')][_0xc67c('0x4a')]({'where':{'id':_0x236492[_0xc67c('0x46')]['id']}})[_0xc67c('0x28')](handleEntityNotFound(_0x482991,null))[_0xc67c('0x28')](removeEntity(_0x482991,null))[_0xc67c('0x44')](handleError(_0x482991,null));};exports[_0xc67c('0x4e')]=function(_0x2fbf65,_0x1344d4,_0x108716){var _0x7b946c={};var _0x473465={};var _0x3769b5;var _0x4bb3d7;return db[_0xc67c('0x2e')][_0xc67c('0x4f')]({'where':{'id':_0x2fbf65[_0xc67c('0x46')]['id']}})[_0xc67c('0x28')](handleEntityNotFound(_0x1344d4,null))[_0xc67c('0x28')](function(_0x15c33e){if(_0x15c33e){_0x3769b5=_0x15c33e;_0x473465[_0xc67c('0x33')]=_['keys'](db[_0xc67c('0x50')]['rawAttributes']);_0x473465['query']=_['keys'](_0x2fbf65[_0xc67c('0x34')]);_0x473465[_0xc67c('0x36')]=_['intersection'](_0x473465[_0xc67c('0x33')],_0x473465[_0xc67c('0x34')]);_0x7b946c[_0xc67c('0x38')]=_['intersection'](_0x473465['model'],qs[_0xc67c('0x39')](_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x39')]));_0x7b946c[_0xc67c('0x38')]=_0x7b946c[_0xc67c('0x38')][_0xc67c('0x3a')]?_0x7b946c[_0xc67c('0x38')]:_0x473465[_0xc67c('0x33')];_0x7b946c[_0xc67c('0x3c')]=qs[_0xc67c('0x3d')](_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x3d')]);_0x7b946c[_0xc67c('0x42')]=qs[_0xc67c('0x36')](_[_0xc67c('0x3e')](_0x2fbf65['query'],_0x473465[_0xc67c('0x36')]));if(_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x41')]){_0x7b946c[_0xc67c('0x42')]=_[_0xc67c('0x3f')](_0x7b946c['where'],{'$or':_[_0xc67c('0x2d')](_0x7b946c[_0xc67c('0x38')],function(_0x4f0e7d){var _0x3b25e6={};_0x3b25e6[_0x4f0e7d]={'$like':'%'+_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x41')]+'%'};return _0x3b25e6;})});}_0x7b946c=_[_0xc67c('0x3f')]({},_0x7b946c,_0x2fbf65[_0xc67c('0x49')]);return _0x3769b5[_0xc67c('0x4e')](_0x7b946c);}})['then'](function(_0x1a5056){if(_0x1a5056){_0x4bb3d7=_0x1a5056['length'];if(!_0x2fbf65[_0xc67c('0x34')]['hasOwnProperty'](_0xc67c('0x3b'))){_0x7b946c[_0xc67c('0x21')]=qs[_0xc67c('0x21')](_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x21')]);_0x7b946c[_0xc67c('0x1f')]=qs[_0xc67c('0x1f')](_0x2fbf65[_0xc67c('0x34')][_0xc67c('0x1f')]);}return _0x3769b5[_0xc67c('0x4e')](_0x7b946c);}})[_0xc67c('0x28')](function(_0x4b7195){if(_0x4b7195){return _0x4b7195?{'count':_0x4bb3d7,'rows':_0x4b7195}:null;}})[_0xc67c('0x28')](respondWithResult(_0x1344d4,null))['catch'](handleError(_0x1344d4,null));};exports['addConfiguration']=function(_0x4a405d,_0x1a1a50,_0x593513){if(_0x4a405d[_0xc67c('0x4c')]['id']){delete _0x4a405d[_0xc67c('0x4c')]['id'];}return db[_0xc67c('0x2e')][_0xc67c('0x4f')]({'where':{'id':_0x4a405d[_0xc67c('0x46')]['id']}})[_0xc67c('0x28')](handleEntityNotFound(_0x1a1a50,null))[_0xc67c('0x28')](function(_0xdb7fd4){if(_0xdb7fd4){_0x4a405d[_0xc67c('0x4c')][_0xc67c('0x51')]=_0xdb7fd4['id'];_0x4a405d['body'][_0xc67c('0x52')]=integrations[_0xc67c('0x53')](_0x4a405d[_0xc67c('0x4c')][_0xc67c('0x54')],_0x4a405d[_0xc67c('0x4c')]['type']);_0x4a405d[_0xc67c('0x4c')][_0xc67c('0x55')]=integrations[_0xc67c('0x56')](_0x4a405d[_0xc67c('0x4c')][_0xc67c('0x54')],_0x4a405d[_0xc67c('0x4c')][_0xc67c('0x31')]);return db[_0xc67c('0x50')][_0xc67c('0x4b')](_0x4a405d[_0xc67c('0x4c')],{'include':[{'model':db[_0xc67c('0x57')],'as':'Subjects'},{'model':db[_0xc67c('0x57')],'as':'Descriptions'}]});}return null;})[_0xc67c('0x28')](respondWithResult(_0x1a1a50,null))[_0xc67c('0x44')](handleError(_0x1a1a50,null));};exports[_0xc67c('0x58')]=function(_0x3ec6c0,_0xc97466,_0x3ffcab){var _0x5523ff='';var _0x1e0d0=['id','name','assigned_user_id',_0xc67c('0x59'),'description','date_start',_0xc67c('0x5a'),'duration_minutes',_0xc67c('0x5b'),'parent_type',_0xc67c('0x5c'),_0xc67c('0x5d')];return db[_0xc67c('0x2e')][_0xc67c('0x4f')]({'where':{'id':_0x3ec6c0['params']['id']},'attributes':['id','username',_0xc67c('0x5e'),_0xc67c('0x5f')]})['then'](handleEntityNotFound(_0xc97466,null))['then'](function(_0x1e0ecb){if(_0x1e0ecb){_0x5523ff=_0x1e0ecb[_0xc67c('0x5f')];var _0x52d571=_0x5523ff['slice'](-0x1);if(_0x52d571==='/'){_0x5523ff=_0x5523ff['substring'](0x0,_0x5523ff['lastIndexOf'](_0x52d571));}return rp({'method':_0xc67c('0x60'),'uri':util[_0xc67c('0x61')](_0xc67c('0x62'),_0x5523ff,_0xc67c('0x63')),'json':!![],'form':{'method':_0xc67c('0x64'),'input_type':_0xc67c('0x65'),'response_type':_0xc67c('0x65'),'rest_data':JSON[_0xc67c('0x66')]({'user_auth':{'user_name':_0x1e0ecb[_0xc67c('0x67')],'password':_0x1e0ecb[_0xc67c('0x5e')],'encryption':_0xc67c('0x68')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xc67c('0x28')](function(_0x39b172){if(_0x39b172&&_0x39b172[_0xc67c('0x2a')]!==_0xc67c('0x69')&&_0x39b172[_0xc67c('0x2a')]!==_0xc67c('0x6a')){return rp({'method':_0xc67c('0x60'),'uri':util['format'](_0xc67c('0x62'),_0x5523ff,_0xc67c('0x63')),'json':!![],'form':{'method':_0xc67c('0x6b'),'input_type':_0xc67c('0x65'),'response_type':_0xc67c('0x65'),'rest_data':JSON[_0xc67c('0x66')]({'session':_0x39b172['id'],'module_name':_0xc67c('0x6c')})}})[_0xc67c('0x28')](function(_0x9d163b){if(_0x9d163b){var _0x40ae5a=_['values'](_0x9d163b[_0xc67c('0x6d')]);_[_0xc67c('0x6e')](_0x40ae5a,function(_0xbc721b){return _0x1e0d0['includes'](_0xbc721b[_0xc67c('0x2a')]);});return{'count':_0x40ae5a[_0xc67c('0x3a')],'rows':_[_0xc67c('0x2d')](_0x40ae5a,function(_0x15cc4a){return{'id':_0x15cc4a[_0xc67c('0x2a')],'name':_0x15cc4a['label'],'custom':_[_0xc67c('0x6f')](_0x15cc4a[_0xc67c('0x2a')],'_c')?!![]:![],'options':_0x15cc4a[_0xc67c('0x49')]?_[_0xc67c('0x2d')](_[_0xc67c('0x70')](_0x15cc4a['options']),function(_0x57d557){return{'name':_0x57d557[_0xc67c('0x71')],'value':_0x57d557[_0xc67c('0x2a')]};}):[]};})};}})[_0xc67c('0x28')](respondWithResult(_0xc97466,null))[_0xc67c('0x44')](function(_0x2b4939){var _0x102225=_0x3ec6c0[_0xc67c('0x34')]['test']?0x1f4:_0x2b4939['statusCode']||0x1f4;logger['error'](_0xc67c('0x72'),'getFields',_0x102225,JSON[_0xc67c('0x66')](_0x2b4939));delete _0x2b4939['name'];if(_0x102225===0x191){_0x102225=0x190;}_0xc97466[_0xc67c('0x1c')](_0x102225)['send'](_0x3ec6c0['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2b4939[_0xc67c('0x73')]}:_0x2b4939);});}else{var _0x4e45a4=0x1f4;_0xc97466[_0xc67c('0x1c')](_0x4e45a4)[_0xc67c('0x2b')]({'message':_0xc67c('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x8faf=['findAll','rows','catch','show','params','rawAttributes','include','options','create','body','update','find','destroy','getConfigurations','findOne','SugarcrmConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','POST','format','/service/v4_1/rest.php','login','JSON','stringify','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','SugarcrmAccount','includeAll'];(function(_0x5e238b,_0x17ae49){var _0x389bea=function(_0x3cc1c1){while(--_0x3cc1c1){_0x5e238b['push'](_0x5e238b['shift']());}};_0x389bea(++_0x17ae49);}(_0x8faf,0x133));var _0xf8fa=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x8faf[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0xf8fa('0x0'));var rimraf=require(_0xf8fa('0x1'));var zipdir=require(_0xf8fa('0x2'));var jsonpatch=require(_0xf8fa('0x3'));var rp=require('request-promise');var moment=require(_0xf8fa('0x4'));var BPromise=require(_0xf8fa('0x5'));var Mustache=require(_0xf8fa('0x6'));var util=require(_0xf8fa('0x7'));var path=require(_0xf8fa('0x8'));var sox=require(_0xf8fa('0x9'));var csv=require(_0xf8fa('0xa'));var ejs=require(_0xf8fa('0xb'));var fs=require('fs');var fs_extra=require(_0xf8fa('0xc'));var _=require(_0xf8fa('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf8fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf8fa('0xa'));var querystring=require(_0xf8fa('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf8fa('0x10'));var as=require(_0xf8fa('0x11'));var hardwareService=require(_0xf8fa('0x12'));var logger=require(_0xf8fa('0x13'))(_0xf8fa('0x14'));var utils=require(_0xf8fa('0x15'));var config=require(_0xf8fa('0x16'));var licenseUtil=require(_0xf8fa('0x17'));var db=require(_0xf8fa('0x18'))['db'];var integrations=require(_0xf8fa('0x19'));function respondWithStatusCode(_0x16315a,_0x144efb){_0x144efb=_0x144efb||0xcc;return function(_0x4e3217){if(_0x4e3217){return _0x16315a[_0xf8fa('0x1a')](_0x144efb);}return _0x16315a[_0xf8fa('0x1b')](_0x144efb)[_0xf8fa('0x1c')]();};}function respondWithResult(_0x5d51ac,_0xfd21a7){_0xfd21a7=_0xfd21a7||0xc8;return function(_0x4ca6c1){if(_0x4ca6c1){return _0x5d51ac[_0xf8fa('0x1b')](_0xfd21a7)[_0xf8fa('0x1d')](_0x4ca6c1);}};}function respondWithFilteredResult(_0x1f6a48,_0x566d86){return function(_0x2e2187){if(_0x2e2187){var _0x415f40=typeof _0x566d86[_0xf8fa('0x1e')]===_0xf8fa('0x1f')&&typeof _0x566d86[_0xf8fa('0x20')]==='undefined';var _0x224b83=_0x2e2187['count'];var _0x2436b9=_0x415f40?0x0:_0x566d86['offset'];var _0x1d9e7e=_0x415f40?_0x2e2187[_0xf8fa('0x21')]:_0x566d86[_0xf8fa('0x1e')]+_0x566d86['limit'];var _0x355a3d;if(_0x1d9e7e>=_0x224b83){_0x1d9e7e=_0x224b83;_0x355a3d=0xc8;}else{_0x355a3d=0xce;}_0x1f6a48[_0xf8fa('0x1b')](_0x355a3d);return _0x1f6a48[_0xf8fa('0x22')](_0xf8fa('0x23'),_0x2436b9+'-'+_0x1d9e7e+'/'+_0x224b83)[_0xf8fa('0x1d')](_0x2e2187);}return null;};}function patchUpdates(_0x3eacce){return function(_0xe13d28){try{jsonpatch[_0xf8fa('0x24')](_0xe13d28,_0x3eacce,!![]);}catch(_0x5898db){return BPromise[_0xf8fa('0x25')](_0x5898db);}return _0xe13d28[_0xf8fa('0x26')]();};}function saveUpdates(_0x27adea,_0x154325){return function(_0x16fe7a){if(_0x16fe7a){return _0x16fe7a['update'](_0x27adea)[_0xf8fa('0x27')](function(_0x504fa3){return _0x504fa3;});}return null;};}function removeEntity(_0x487039,_0x35c256){return function(_0x5f3ce2){if(_0x5f3ce2){return _0x5f3ce2['destroy']()[_0xf8fa('0x27')](function(){_0x487039[_0xf8fa('0x1b')](0xcc)[_0xf8fa('0x1c')]();});}};}function handleEntityNotFound(_0x436906,_0x228dc3){return function(_0x5196d7){if(!_0x5196d7){_0x436906[_0xf8fa('0x1a')](0x194);}return _0x5196d7;};}function handleError(_0x27c85c,_0x4b41e3){_0x4b41e3=_0x4b41e3||0x1f4;return function(_0x258b9a){logger['error'](_0x258b9a[_0xf8fa('0x28')]);if(_0x258b9a[_0xf8fa('0x29')]){delete _0x258b9a[_0xf8fa('0x29')];}_0x27c85c[_0xf8fa('0x1b')](_0x4b41e3)[_0xf8fa('0x2a')](_0x258b9a);};}exports['index']=function(_0x256d7f,_0x13afce){var _0x384ac9={},_0x2c7fed={},_0x4afaa6={'count':0x0,'rows':[]};var _0x76c387=_[_0xf8fa('0x2b')](db['SugarcrmAccount']['rawAttributes'],function(_0x49fbb0){return{'name':_0x49fbb0[_0xf8fa('0x2c')],'type':_0x49fbb0[_0xf8fa('0x2d')]['key']};});_0x2c7fed[_0xf8fa('0x2e')]=_[_0xf8fa('0x2b')](_0x76c387,'name');_0x2c7fed[_0xf8fa('0x2f')]=_[_0xf8fa('0x30')](_0x256d7f[_0xf8fa('0x2f')]);_0x2c7fed[_0xf8fa('0x31')]=_[_0xf8fa('0x32')](_0x2c7fed['model'],_0x2c7fed[_0xf8fa('0x2f')]);_0x384ac9['attributes']=_[_0xf8fa('0x32')](_0x2c7fed[_0xf8fa('0x2e')],qs['fields'](_0x256d7f[_0xf8fa('0x2f')][_0xf8fa('0x33')]));_0x384ac9['attributes']=_0x384ac9[_0xf8fa('0x34')][_0xf8fa('0x35')]?_0x384ac9[_0xf8fa('0x34')]:_0x2c7fed[_0xf8fa('0x2e')];if(!_0x256d7f[_0xf8fa('0x2f')][_0xf8fa('0x36')](_0xf8fa('0x37'))){_0x384ac9[_0xf8fa('0x20')]=qs['limit'](_0x256d7f['query'][_0xf8fa('0x20')]);_0x384ac9[_0xf8fa('0x1e')]=qs[_0xf8fa('0x1e')](_0x256d7f[_0xf8fa('0x2f')][_0xf8fa('0x1e')]);}_0x384ac9[_0xf8fa('0x38')]=qs[_0xf8fa('0x39')](_0x256d7f[_0xf8fa('0x2f')]['sort']);_0x384ac9['where']=qs[_0xf8fa('0x31')](_[_0xf8fa('0x3a')](_0x256d7f[_0xf8fa('0x2f')],_0x2c7fed['filters']),_0x76c387);if(_0x256d7f[_0xf8fa('0x2f')][_0xf8fa('0x3b')]){_0x384ac9['where']=_[_0xf8fa('0x3c')](_0x384ac9[_0xf8fa('0x3d')],{'$or':_[_0xf8fa('0x2b')](_0x76c387,function(_0x5bd123){if(_0x5bd123[_0xf8fa('0x2d')]!==_0xf8fa('0x3e')){var _0x1cfc60={};_0x1cfc60[_0x5bd123[_0xf8fa('0x29')]]={'$like':'%'+_0x256d7f['query']['filter']+'%'};return _0x1cfc60;}})});}_0x384ac9=_['merge']({},_0x384ac9,_0x256d7f['options']);var _0x182db1={'where':_0x384ac9['where']};return db[_0xf8fa('0x3f')][_0xf8fa('0x21')](_0x182db1)[_0xf8fa('0x27')](function(_0xd26043){_0x4afaa6[_0xf8fa('0x21')]=_0xd26043;if(_0x256d7f['query'][_0xf8fa('0x40')]){_0x384ac9['include']=[{'all':!![]}];}return db[_0xf8fa('0x3f')][_0xf8fa('0x41')](_0x384ac9);})[_0xf8fa('0x27')](function(_0x3b6fdc){_0x4afaa6[_0xf8fa('0x42')]=_0x3b6fdc;return _0x4afaa6;})[_0xf8fa('0x27')](respondWithFilteredResult(_0x13afce,_0x384ac9))[_0xf8fa('0x43')](handleError(_0x13afce,null));};exports[_0xf8fa('0x44')]=function(_0xf77efa,_0x3aadf1){var _0x31d8a7={'raw':![],'where':{'id':_0xf77efa[_0xf8fa('0x45')]['id']}},_0x5cadda={};_0x5cadda[_0xf8fa('0x2e')]=_[_0xf8fa('0x30')](db[_0xf8fa('0x3f')][_0xf8fa('0x46')]);_0x5cadda[_0xf8fa('0x2f')]=_['keys'](_0xf77efa[_0xf8fa('0x2f')]);_0x5cadda[_0xf8fa('0x31')]=_[_0xf8fa('0x32')](_0x5cadda[_0xf8fa('0x2e')],_0x5cadda['query']);_0x31d8a7[_0xf8fa('0x34')]=_[_0xf8fa('0x32')](_0x5cadda[_0xf8fa('0x2e')],qs[_0xf8fa('0x33')](_0xf77efa[_0xf8fa('0x2f')]['fields']));_0x31d8a7[_0xf8fa('0x34')]=_0x31d8a7['attributes'][_0xf8fa('0x35')]?_0x31d8a7[_0xf8fa('0x34')]:_0x5cadda['model'];if(_0xf77efa[_0xf8fa('0x2f')]['includeAll']){_0x31d8a7[_0xf8fa('0x47')]=[{'all':!![]}];}_0x31d8a7=_[_0xf8fa('0x3c')]({},_0x31d8a7,_0xf77efa[_0xf8fa('0x48')]);return db[_0xf8fa('0x3f')]['find'](_0x31d8a7)['then'](handleEntityNotFound(_0x3aadf1,null))[_0xf8fa('0x27')](respondWithResult(_0x3aadf1,null))[_0xf8fa('0x43')](handleError(_0x3aadf1,null));};exports[_0xf8fa('0x49')]=function(_0x276453,_0x4a164e){return db[_0xf8fa('0x3f')][_0xf8fa('0x49')](_0x276453[_0xf8fa('0x4a')],{})['then'](respondWithResult(_0x4a164e,0xc9))[_0xf8fa('0x43')](handleError(_0x4a164e,null));};exports[_0xf8fa('0x4b')]=function(_0x5dc188,_0x3d1d1a){if(_0x5dc188[_0xf8fa('0x4a')]['id']){delete _0x5dc188[_0xf8fa('0x4a')]['id'];}return db['SugarcrmAccount'][_0xf8fa('0x4c')]({'where':{'id':_0x5dc188[_0xf8fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d1d1a,null))['then'](saveUpdates(_0x5dc188[_0xf8fa('0x4a')],null))['then'](respondWithResult(_0x3d1d1a,null))['catch'](handleError(_0x3d1d1a,null));};exports[_0xf8fa('0x4d')]=function(_0x44fd19,_0x511af4){return db['SugarcrmAccount'][_0xf8fa('0x4c')]({'where':{'id':_0x44fd19[_0xf8fa('0x45')]['id']}})[_0xf8fa('0x27')](handleEntityNotFound(_0x511af4,null))[_0xf8fa('0x27')](removeEntity(_0x511af4,null))[_0xf8fa('0x43')](handleError(_0x511af4,null));};exports[_0xf8fa('0x4e')]=function(_0x2ebe77,_0x5f55a7,_0x32578c){var _0x3611cc={};var _0x248d60={};var _0x43e6ed;var _0x576247;return db[_0xf8fa('0x3f')][_0xf8fa('0x4f')]({'where':{'id':_0x2ebe77[_0xf8fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x5f55a7,null))[_0xf8fa('0x27')](function(_0x57ba44){if(_0x57ba44){_0x43e6ed=_0x57ba44;_0x248d60['model']=_[_0xf8fa('0x30')](db[_0xf8fa('0x50')][_0xf8fa('0x46')]);_0x248d60[_0xf8fa('0x2f')]=_[_0xf8fa('0x30')](_0x2ebe77[_0xf8fa('0x2f')]);_0x248d60[_0xf8fa('0x31')]=_[_0xf8fa('0x32')](_0x248d60[_0xf8fa('0x2e')],_0x248d60[_0xf8fa('0x2f')]);_0x3611cc[_0xf8fa('0x34')]=_[_0xf8fa('0x32')](_0x248d60['model'],qs[_0xf8fa('0x33')](_0x2ebe77[_0xf8fa('0x2f')]['fields']));_0x3611cc[_0xf8fa('0x34')]=_0x3611cc['attributes']['length']?_0x3611cc[_0xf8fa('0x34')]:_0x248d60[_0xf8fa('0x2e')];_0x3611cc[_0xf8fa('0x38')]=qs['sort'](_0x2ebe77[_0xf8fa('0x2f')]['sort']);_0x3611cc[_0xf8fa('0x3d')]=qs['filters'](_[_0xf8fa('0x3a')](_0x2ebe77[_0xf8fa('0x2f')],_0x248d60['filters']));if(_0x2ebe77['query'][_0xf8fa('0x3b')]){_0x3611cc[_0xf8fa('0x3d')]=_['merge'](_0x3611cc[_0xf8fa('0x3d')],{'$or':_[_0xf8fa('0x2b')](_0x3611cc['attributes'],function(_0x229af3){var _0xca8b26={};_0xca8b26[_0x229af3]={'$like':'%'+_0x2ebe77[_0xf8fa('0x2f')][_0xf8fa('0x3b')]+'%'};return _0xca8b26;})});}_0x3611cc=_['merge']({},_0x3611cc,_0x2ebe77[_0xf8fa('0x48')]);return _0x43e6ed[_0xf8fa('0x4e')](_0x3611cc);}})[_0xf8fa('0x27')](function(_0x5d8ecd){if(_0x5d8ecd){_0x576247=_0x5d8ecd[_0xf8fa('0x35')];if(!_0x2ebe77['query']['hasOwnProperty'](_0xf8fa('0x37'))){_0x3611cc[_0xf8fa('0x20')]=qs[_0xf8fa('0x20')](_0x2ebe77['query'][_0xf8fa('0x20')]);_0x3611cc[_0xf8fa('0x1e')]=qs['offset'](_0x2ebe77[_0xf8fa('0x2f')][_0xf8fa('0x1e')]);}return _0x43e6ed[_0xf8fa('0x4e')](_0x3611cc);}})['then'](function(_0x5ad23b){if(_0x5ad23b){return _0x5ad23b?{'count':_0x576247,'rows':_0x5ad23b}:null;}})[_0xf8fa('0x27')](respondWithResult(_0x5f55a7,null))[_0xf8fa('0x43')](handleError(_0x5f55a7,null));};exports['addConfiguration']=function(_0x5d3a7a,_0x4e5d2c,_0x56b7e2){if(_0x5d3a7a['body']['id']){delete _0x5d3a7a['body']['id'];}return db[_0xf8fa('0x3f')][_0xf8fa('0x4f')]({'where':{'id':_0x5d3a7a[_0xf8fa('0x45')]['id']}})[_0xf8fa('0x27')](handleEntityNotFound(_0x4e5d2c,null))[_0xf8fa('0x27')](function(_0x328ee3){if(_0x328ee3){_0x5d3a7a[_0xf8fa('0x4a')][_0xf8fa('0x51')]=_0x328ee3['id'];_0x5d3a7a[_0xf8fa('0x4a')]['Subjects']=integrations[_0xf8fa('0x52')](_0x5d3a7a[_0xf8fa('0x4a')][_0xf8fa('0x53')],_0x5d3a7a[_0xf8fa('0x4a')][_0xf8fa('0x2d')]);_0x5d3a7a['body'][_0xf8fa('0x54')]=integrations[_0xf8fa('0x55')](_0x5d3a7a['body'][_0xf8fa('0x53')],_0x5d3a7a['body'][_0xf8fa('0x2d')]);return db[_0xf8fa('0x50')]['create'](_0x5d3a7a['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0xf8fa('0x56')],'as':_0xf8fa('0x54')}]});}return null;})[_0xf8fa('0x27')](respondWithResult(_0x4e5d2c,null))[_0xf8fa('0x43')](handleError(_0x4e5d2c,null));};exports[_0xf8fa('0x57')]=function(_0x56ed96,_0x5040da,_0x5896f2){var _0x2f7263='';var _0x1e9f27=['id','name',_0xf8fa('0x58'),_0xf8fa('0x59'),_0xf8fa('0x5a'),_0xf8fa('0x5b'),_0xf8fa('0x5c'),_0xf8fa('0x5d'),_0xf8fa('0x5e'),_0xf8fa('0x5f'),_0xf8fa('0x60'),_0xf8fa('0x61')];return db[_0xf8fa('0x3f')][_0xf8fa('0x4f')]({'where':{'id':_0x56ed96[_0xf8fa('0x45')]['id']},'attributes':['id',_0xf8fa('0x62'),_0xf8fa('0x63'),'remoteUri']})['then'](handleEntityNotFound(_0x5040da,null))[_0xf8fa('0x27')](function(_0x4e41b8){if(_0x4e41b8){_0x2f7263=_0x4e41b8[_0xf8fa('0x64')];var _0x53967e=_0x2f7263[_0xf8fa('0x65')](-0x1);if(_0x53967e==='/'){_0x2f7263=_0x2f7263['substring'](0x0,_0x2f7263['lastIndexOf'](_0x53967e));}return rp({'method':_0xf8fa('0x66'),'uri':util[_0xf8fa('0x67')]('%s%s',_0x2f7263,_0xf8fa('0x68')),'json':!![],'form':{'method':_0xf8fa('0x69'),'input_type':_0xf8fa('0x6a'),'response_type':_0xf8fa('0x6a'),'rest_data':JSON[_0xf8fa('0x6b')]({'user_auth':{'user_name':_0x4e41b8[_0xf8fa('0x62')],'password':_0x4e41b8[_0xf8fa('0x63')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xf8fa('0x27')](function(_0x3aa4d9){if(_0x3aa4d9&&_0x3aa4d9[_0xf8fa('0x29')]!==_0xf8fa('0x6c')&&_0x3aa4d9[_0xf8fa('0x29')]!==_0xf8fa('0x6d')){return rp({'method':'POST','uri':util['format'](_0xf8fa('0x6e'),_0x2f7263,_0xf8fa('0x68')),'json':!![],'form':{'method':_0xf8fa('0x6f'),'input_type':_0xf8fa('0x6a'),'response_type':'JSON','rest_data':JSON[_0xf8fa('0x6b')]({'session':_0x3aa4d9['id'],'module_name':_0xf8fa('0x70')})}})[_0xf8fa('0x27')](function(_0x381627){if(_0x381627){var _0x235f06=_[_0xf8fa('0x71')](_0x381627[_0xf8fa('0x72')]);_[_0xf8fa('0x73')](_0x235f06,function(_0x4bf72a){return _0x1e9f27[_0xf8fa('0x74')](_0x4bf72a['name']);});return{'count':_0x235f06[_0xf8fa('0x35')],'rows':_[_0xf8fa('0x2b')](_0x235f06,function(_0x5b9a88){return{'id':_0x5b9a88[_0xf8fa('0x29')],'name':_0x5b9a88[_0xf8fa('0x75')],'custom':_[_0xf8fa('0x76')](_0x5b9a88[_0xf8fa('0x29')],'_c')?!![]:![],'options':_0x5b9a88[_0xf8fa('0x48')]?_['map'](_[_0xf8fa('0x71')](_0x5b9a88['options']),function(_0x5c7234){return{'name':_0x5c7234[_0xf8fa('0x77')],'value':_0x5c7234['name']};}):[]};})};}})[_0xf8fa('0x27')](respondWithResult(_0x5040da,null))[_0xf8fa('0x43')](function(_0x18f381){var _0xb81797=_0x56ed96['query'][_0xf8fa('0x78')]?0x1f4:_0x18f381[_0xf8fa('0x79')]||0x1f4;logger['error'](_0xf8fa('0x7a'),_0xf8fa('0x57'),_0xb81797,JSON['stringify'](_0x18f381));delete _0x18f381[_0xf8fa('0x29')];if(_0xb81797===0x191){_0xb81797=0x190;}_0x5040da[_0xf8fa('0x1b')](_0xb81797)[_0xf8fa('0x2a')](_0x56ed96[_0xf8fa('0x2f')]['test']?{'message':_0xf8fa('0x7b'),'statusCode':_0x18f381[_0xf8fa('0x79')]}:_0x18f381);});}else{var _0x3cb6e0=0x1f4;_0x5040da['status'](_0x3cb6e0)[_0xf8fa('0x2a')]({'message':_0xf8fa('0x7b'),'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 3727f71..8683260 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 _0x94e7=['exports','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration'];(function(_0x5012e1,_0x27783e){var _0x20c780=function(_0x411377){while(--_0x411377){_0x5012e1['push'](_0x5012e1['shift']());}};_0x20c780(++_0x27783e);}(_0x94e7,0x7c));var _0x794e=function(_0x193513,_0x4d6e2b){_0x193513=_0x193513-0x0;var _0x2b2f53=_0x94e7[_0x193513];return _0x2b2f53;};'use strict';var _=require('lodash');var util=require(_0x794e('0x0'));var logger=require(_0x794e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x794e('0x2'));var rp=require(_0x794e('0x3'));var fs=require('fs');var path=require(_0x794e('0x4'));var rimraf=require('rimraf');var config=require(_0x794e('0x5'));var attributes=require(_0x794e('0x6'));var integrations=require(_0x794e('0x7'));module[_0x794e('0x8')]=function(_0x2116a6,_0x307e36){return _0x2116a6['define'](_0x794e('0x9'),attributes,{'tableName':_0x794e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe21d=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xe21d,0x149));var _0xde21=function(_0x2a5959,_0x4cdb4c){_0x2a5959=_0x2a5959-0x0;var _0x211000=_0xe21d[_0x2a5959];return _0x211000;};'use strict';var _=require(_0xde21('0x0'));var util=require(_0xde21('0x1'));var logger=require(_0xde21('0x2'))('api');var moment=require(_0xde21('0x3'));var BPromise=require(_0xde21('0x4'));var rp=require(_0xde21('0x5'));var fs=require('fs');var path=require(_0xde21('0x6'));var rimraf=require(_0xde21('0x7'));var config=require(_0xde21('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xde21('0x9'));module[_0xde21('0xa')]=function(_0x5108a9,_0x105a55){return _0x5108a9[_0xde21('0xb')]('SugarcrmAccount',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 aa86fff..39f20e5 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 _0xbbe3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','SugarcrmAccount','findAll','options','where','limit','include','map','model','attributes','GetSugarcrmAccount','debug','find','raw','ShowSugarcrmAccount','util','moment','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbe3,0x189));var _0x3bbe=function(_0x553183,_0x5479b4){_0x553183=_0x553183-0x0;var _0xfc0ebe=_0xbbe3[_0x553183];return _0xfc0ebe;};'use strict';var _=require('lodash');var util=require(_0x3bbe('0x0'));var moment=require(_0x3bbe('0x1'));var BPromise=require('bluebird');var rs=require(_0x3bbe('0x2'));var fs=require('fs');var Redis=require(_0x3bbe('0x3'));var db=require(_0x3bbe('0x4'))['db'];var utils=require(_0x3bbe('0x5'));var logger=require(_0x3bbe('0x6'))(_0x3bbe('0x7'));var config=require(_0x3bbe('0x8'));var jayson=require(_0x3bbe('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38350d,_0x45554a,_0x1d9921){return new BPromise(function(_0x412587,_0x45b33e){return client[_0x3bbe('0xa')](_0x38350d,_0x1d9921)[_0x3bbe('0xb')](function(_0x2e6631){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x45554a,_0x3bbe('0xc'));logger['debug'](_0x3bbe('0xd'),_0x45554a,_0x3bbe('0xc'),JSON[_0x3bbe('0xe')](_0x2e6631));if(_0x2e6631[_0x3bbe('0xf')]){if(_0x2e6631[_0x3bbe('0xf')][_0x3bbe('0x10')]===0x1f4){logger[_0x3bbe('0xf')](_0x3bbe('0x11'),_0x45554a,_0x2e6631[_0x3bbe('0xf')][_0x3bbe('0x12')]);return _0x45b33e(_0x2e6631['error'][_0x3bbe('0x12')]);}logger[_0x3bbe('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x45554a,_0x2e6631['error'][_0x3bbe('0x12')]);return _0x412587(_0x2e6631[_0x3bbe('0xf')]['message']);}else{logger[_0x3bbe('0x13')](_0x3bbe('0x11'),_0x45554a,_0x3bbe('0xc'));_0x412587(_0x2e6631[_0x3bbe('0x14')][_0x3bbe('0x12')]);}})[_0x3bbe('0x15')](function(_0x336924){logger[_0x3bbe('0xf')](_0x3bbe('0x11'),_0x45554a,_0x336924);_0x45b33e(_0x336924);});});}exports['GetSugarcrmAccount']=function(_0x2aeda5){var _0x125047=this;return new Promise(function(_0x32f43c,_0x8ebe3a){return db[_0x3bbe('0x16')][_0x3bbe('0x17')]({'raw':_0x2aeda5[_0x3bbe('0x18')]?_0x2aeda5[_0x3bbe('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2aeda5[_0x3bbe('0x18')]?_0x2aeda5[_0x3bbe('0x18')][_0x3bbe('0x19')]||null:null,'attributes':_0x2aeda5['options']?_0x2aeda5[_0x3bbe('0x18')]['attributes']||null:null,'limit':_0x2aeda5[_0x3bbe('0x18')]?_0x2aeda5[_0x3bbe('0x18')][_0x3bbe('0x1a')]||null:null,'include':_0x2aeda5[_0x3bbe('0x18')]?_0x2aeda5[_0x3bbe('0x18')][_0x3bbe('0x1b')]?_[_0x3bbe('0x1c')](_0x2aeda5[_0x3bbe('0x18')][_0x3bbe('0x1b')],function(_0x552cb6){return{'model':db[_0x552cb6[_0x3bbe('0x1d')]],'as':_0x552cb6['as'],'attributes':_0x552cb6[_0x3bbe('0x1e')],'include':_0x552cb6[_0x3bbe('0x1b')]?_[_0x3bbe('0x1c')](_0x552cb6['include'],function(_0xd5631f){return{'model':db[_0xd5631f[_0x3bbe('0x1d')]],'as':_0xd5631f['as'],'attributes':_0xd5631f['attributes'],'include':_0xd5631f[_0x3bbe('0x1b')]?_[_0x3bbe('0x1c')](_0xd5631f[_0x3bbe('0x1b')],function(_0x43aa01){return{'model':db[_0x43aa01['model']],'as':_0x43aa01['as'],'attributes':_0x43aa01[_0x3bbe('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3bbe('0xb')](function(_0x392f47){logger[_0x3bbe('0x13')](_0x3bbe('0x1f'),_0x2aeda5);logger[_0x3bbe('0x20')](_0x3bbe('0x1f'),_0x2aeda5,JSON['stringify'](_0x392f47));_0x32f43c(_0x392f47);})[_0x3bbe('0x15')](function(_0x222421){logger[_0x3bbe('0xf')]('GetSugarcrmAccount',_0x222421['message'],_0x2aeda5);_0x8ebe3a(_0x125047[_0x3bbe('0xf')](0x1f4,_0x222421[_0x3bbe('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x4f4e52){var _0x5dfd2e=this;return new Promise(function(_0x3ce869,_0x267a46){return db[_0x3bbe('0x16')][_0x3bbe('0x21')]({'raw':_0x4f4e52[_0x3bbe('0x18')]?_0x4f4e52[_0x3bbe('0x18')][_0x3bbe('0x22')]===undefined?!![]:![]:!![],'where':_0x4f4e52[_0x3bbe('0x18')]?_0x4f4e52[_0x3bbe('0x18')]['where']||null:null,'attributes':_0x4f4e52[_0x3bbe('0x18')]?_0x4f4e52[_0x3bbe('0x18')][_0x3bbe('0x1e')]||null:null,'include':_0x4f4e52[_0x3bbe('0x18')]?_0x4f4e52['options']['include']?_[_0x3bbe('0x1c')](_0x4f4e52[_0x3bbe('0x18')][_0x3bbe('0x1b')],function(_0x186112){return{'model':db[_0x186112[_0x3bbe('0x1d')]],'as':_0x186112['as'],'attributes':_0x186112[_0x3bbe('0x1e')],'include':_0x186112[_0x3bbe('0x1b')]?_[_0x3bbe('0x1c')](_0x186112['include'],function(_0x23533c){return{'model':db[_0x23533c['model']],'as':_0x23533c['as'],'attributes':_0x23533c[_0x3bbe('0x1e')],'include':_0x23533c[_0x3bbe('0x1b')]?_['map'](_0x23533c[_0x3bbe('0x1b')],function(_0x292c3b){return{'model':db[_0x292c3b['model']],'as':_0x292c3b['as'],'attributes':_0x292c3b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bbe('0xb')](function(_0x2739c7){logger[_0x3bbe('0x13')](_0x3bbe('0x23'),_0x4f4e52);logger[_0x3bbe('0x20')](_0x3bbe('0x23'),_0x4f4e52,JSON[_0x3bbe('0xe')](_0x2739c7));_0x3ce869(_0x2739c7);})[_0x3bbe('0x15')](function(_0x2bb562){logger[_0x3bbe('0xf')](_0x3bbe('0x23'),_0x2bb562[_0x3bbe('0x12')],_0x4f4e52);_0x267a46(_0x5dfd2e[_0x3bbe('0xf')](0x1f4,_0x2bb562[_0x3bbe('0x12')]));});});}; \ No newline at end of file +var _0xfd46=['findAll','options','where','attributes','include','map','model','debug','catch','ShowSugarcrmAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','GetSugarcrmAccount','SugarcrmAccount'];(function(_0x4773ab,_0x25e001){var _0x323107=function(_0x5b8d8f){while(--_0x5b8d8f){_0x4773ab['push'](_0x4773ab['shift']());}};_0x323107(++_0x25e001);}(_0xfd46,0x7b));var _0x6fd4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfd46[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x6fd4('0x0'));var util=require('util');var moment=require(_0x6fd4('0x1'));var BPromise=require(_0x6fd4('0x2'));var rs=require(_0x6fd4('0x3'));var fs=require('fs');var Redis=require(_0x6fd4('0x4'));var db=require(_0x6fd4('0x5'))['db'];var utils=require(_0x6fd4('0x6'));var logger=require(_0x6fd4('0x7'))(_0x6fd4('0x8'));var config=require(_0x6fd4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6fd4('0xa')][_0x6fd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a4090,_0x103a2a,_0xebb272){return new BPromise(function(_0x2a40ae,_0x1b43a7){return client[_0x6fd4('0xc')](_0x5a4090,_0xebb272)[_0x6fd4('0xd')](function(_0x3696b2){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x103a2a,'request\x20sent');logger['debug'](_0x6fd4('0xe'),_0x103a2a,_0x6fd4('0xf'),JSON[_0x6fd4('0x10')](_0x3696b2));if(_0x3696b2[_0x6fd4('0x11')]){if(_0x3696b2[_0x6fd4('0x11')][_0x6fd4('0x12')]===0x1f4){logger[_0x6fd4('0x11')](_0x6fd4('0x13'),_0x103a2a,_0x3696b2[_0x6fd4('0x11')][_0x6fd4('0x14')]);return _0x1b43a7(_0x3696b2[_0x6fd4('0x11')]['message']);}logger[_0x6fd4('0x11')](_0x6fd4('0x13'),_0x103a2a,_0x3696b2['error'][_0x6fd4('0x14')]);return _0x2a40ae(_0x3696b2[_0x6fd4('0x11')][_0x6fd4('0x14')]);}else{logger[_0x6fd4('0x15')](_0x6fd4('0x13'),_0x103a2a,_0x6fd4('0xf'));_0x2a40ae(_0x3696b2[_0x6fd4('0x16')][_0x6fd4('0x14')]);}})['catch'](function(_0x931e59){logger[_0x6fd4('0x11')](_0x6fd4('0x13'),_0x103a2a,_0x931e59);_0x1b43a7(_0x931e59);});});}exports[_0x6fd4('0x17')]=function(_0x1c16a5){var _0x2aaf90=this;return new Promise(function(_0xbc43e2,_0x28b628){return db[_0x6fd4('0x18')][_0x6fd4('0x19')]({'raw':_0x1c16a5[_0x6fd4('0x1a')]?_0x1c16a5[_0x6fd4('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1c16a5[_0x6fd4('0x1a')]?_0x1c16a5[_0x6fd4('0x1a')][_0x6fd4('0x1b')]||null:null,'attributes':_0x1c16a5[_0x6fd4('0x1a')]?_0x1c16a5['options'][_0x6fd4('0x1c')]||null:null,'limit':_0x1c16a5[_0x6fd4('0x1a')]?_0x1c16a5[_0x6fd4('0x1a')]['limit']||null:null,'include':_0x1c16a5[_0x6fd4('0x1a')]?_0x1c16a5[_0x6fd4('0x1a')][_0x6fd4('0x1d')]?_[_0x6fd4('0x1e')](_0x1c16a5[_0x6fd4('0x1a')]['include'],function(_0x5885eb){return{'model':db[_0x5885eb['model']],'as':_0x5885eb['as'],'attributes':_0x5885eb[_0x6fd4('0x1c')],'include':_0x5885eb['include']?_[_0x6fd4('0x1e')](_0x5885eb[_0x6fd4('0x1d')],function(_0x39627d){return{'model':db[_0x39627d[_0x6fd4('0x1f')]],'as':_0x39627d['as'],'attributes':_0x39627d[_0x6fd4('0x1c')],'include':_0x39627d[_0x6fd4('0x1d')]?_[_0x6fd4('0x1e')](_0x39627d[_0x6fd4('0x1d')],function(_0xefa16f){return{'model':db[_0xefa16f[_0x6fd4('0x1f')]],'as':_0xefa16f['as'],'attributes':_0xefa16f['attributes']};}):[]};}):[]};}):[]:[]})[_0x6fd4('0xd')](function(_0x10237b){logger[_0x6fd4('0x15')]('GetSugarcrmAccount',_0x1c16a5);logger[_0x6fd4('0x20')](_0x6fd4('0x17'),_0x1c16a5,JSON['stringify'](_0x10237b));_0xbc43e2(_0x10237b);})[_0x6fd4('0x21')](function(_0x16dae4){logger[_0x6fd4('0x11')]('GetSugarcrmAccount',_0x16dae4[_0x6fd4('0x14')],_0x1c16a5);_0x28b628(_0x2aaf90[_0x6fd4('0x11')](0x1f4,_0x16dae4['message']));});});};exports[_0x6fd4('0x22')]=function(_0xbe8fbd){var _0x40529e=this;return new Promise(function(_0x5effc9,_0x54bf6b){return db[_0x6fd4('0x18')][_0x6fd4('0x23')]({'raw':_0xbe8fbd[_0x6fd4('0x1a')]?_0xbe8fbd[_0x6fd4('0x1a')][_0x6fd4('0x24')]===undefined?!![]:![]:!![],'where':_0xbe8fbd[_0x6fd4('0x1a')]?_0xbe8fbd[_0x6fd4('0x1a')][_0x6fd4('0x1b')]||null:null,'attributes':_0xbe8fbd[_0x6fd4('0x1a')]?_0xbe8fbd[_0x6fd4('0x1a')][_0x6fd4('0x1c')]||null:null,'include':_0xbe8fbd[_0x6fd4('0x1a')]?_0xbe8fbd[_0x6fd4('0x1a')][_0x6fd4('0x1d')]?_[_0x6fd4('0x1e')](_0xbe8fbd['options']['include'],function(_0x4f618e){return{'model':db[_0x4f618e[_0x6fd4('0x1f')]],'as':_0x4f618e['as'],'attributes':_0x4f618e[_0x6fd4('0x1c')],'include':_0x4f618e[_0x6fd4('0x1d')]?_[_0x6fd4('0x1e')](_0x4f618e['include'],function(_0x43822a){return{'model':db[_0x43822a[_0x6fd4('0x1f')]],'as':_0x43822a['as'],'attributes':_0x43822a['attributes'],'include':_0x43822a[_0x6fd4('0x1d')]?_[_0x6fd4('0x1e')](_0x43822a[_0x6fd4('0x1d')],function(_0x3ec70f){return{'model':db[_0x3ec70f['model']],'as':_0x3ec70f['as'],'attributes':_0x3ec70f[_0x6fd4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6fd4('0xd')](function(_0x46f880){logger[_0x6fd4('0x15')]('ShowSugarcrmAccount',_0xbe8fbd);logger[_0x6fd4('0x20')](_0x6fd4('0x22'),_0xbe8fbd,JSON['stringify'](_0x46f880));_0x5effc9(_0x46f880);})['catch'](function(_0x3d2c8a){logger[_0x6fd4('0x11')](_0x6fd4('0x22'),_0x3d2c8a[_0x6fd4('0x14')],_0xbe8fbd);_0x54bf6b(_0x40529e[_0x6fd4('0x11')](0x1f4,_0x3d2c8a[_0x6fd4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 260b1ee..79cdc6f 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 _0x8a80=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra'];(function(_0xba0502,_0x2fb75b){var _0x5ed16d=function(_0x3154a7){while(--_0x3154a7){_0xba0502['push'](_0xba0502['shift']());}};_0x5ed16d(++_0x2fb75b);}(_0x8a80,0x13d));var _0x08a8=function(_0x36c4e3,_0x350b34){_0x36c4e3=_0x36c4e3-0x0;var _0x52734d=_0x8a80[_0x36c4e3];return _0x52734d;};'use strict';var multer=require(_0x08a8('0x0'));var util=require(_0x08a8('0x1'));var path=require(_0x08a8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x08a8('0x3')]();var fs_extra=require(_0x08a8('0x4'));var auth=require(_0x08a8('0x5'));var interaction=require(_0x08a8('0x6'));var config=require(_0x08a8('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x08a8('0x8')]('/',auth[_0x08a8('0x9')](),controller[_0x08a8('0xa')]);router[_0x08a8('0x8')](_0x08a8('0xb'),auth[_0x08a8('0x9')](),controller[_0x08a8('0xc')]);router['get'](_0x08a8('0xd'),auth[_0x08a8('0x9')](),controller['getFields']);router[_0x08a8('0x8')](_0x08a8('0xe'),auth[_0x08a8('0x9')](),controller[_0x08a8('0xf')]);router[_0x08a8('0x8')](_0x08a8('0x10'),auth[_0x08a8('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x08a8('0x9')](),controller[_0x08a8('0x11')]);router[_0x08a8('0x12')](_0x08a8('0xb'),auth[_0x08a8('0x9')](),controller[_0x08a8('0x13')]);router[_0x08a8('0x14')](_0x08a8('0xb'),auth[_0x08a8('0x9')](),controller[_0x08a8('0x15')]);module[_0x08a8('0x16')]=router; \ No newline at end of file +var _0x3202=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x101802,_0x11f913){var _0x5d61ce=function(_0x4acc0){while(--_0x4acc0){_0x101802['push'](_0x101802['shift']());}};_0x5d61ce(++_0x11f913);}(_0x3202,0x1b8));var _0x2320=function(_0x558099,_0x4be744){_0x558099=_0x558099-0x0;var _0x18ac2e=_0x3202[_0x558099];return _0x18ac2e;};'use strict';var multer=require(_0x2320('0x0'));var util=require(_0x2320('0x1'));var path=require(_0x2320('0x2'));var timeout=require(_0x2320('0x3'));var express=require(_0x2320('0x4'));var router=express[_0x2320('0x5')]();var fs_extra=require(_0x2320('0x6'));var auth=require(_0x2320('0x7'));var interaction=require(_0x2320('0x8'));var config=require(_0x2320('0x9'));var controller=require(_0x2320('0xa'));router['get']('/',auth[_0x2320('0xb')](),controller['index']);router['get']('/:id',auth[_0x2320('0xb')](),controller[_0x2320('0xc')]);router[_0x2320('0xd')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x2320('0xd')](_0x2320('0xe'),auth[_0x2320('0xb')](),controller[_0x2320('0xf')]);router['get'](_0x2320('0x10'),auth[_0x2320('0xb')](),controller[_0x2320('0x11')]);router[_0x2320('0x12')]('/',auth[_0x2320('0xb')](),controller[_0x2320('0x13')]);router[_0x2320('0x14')](_0x2320('0x15'),auth['isAuthenticated'](),controller[_0x2320('0x16')]);router[_0x2320('0x17')](_0x2320('0x15'),auth[_0x2320('0xb')](),controller[_0x2320('0x18')]);module[_0x2320('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4701443..cec2f3d 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 _0x237b=['STRING','sequelize','exports'];(function(_0x2eda23,_0x1ec991){var _0x4587ae=function(_0x59641c){while(--_0x59641c){_0x2eda23['push'](_0x2eda23['shift']());}};_0x4587ae(++_0x1ec991);}(_0x237b,0x139));var _0xb237=function(_0x47af23,_0x58fe0a){_0x47af23=_0x47af23-0x0;var _0x17a44f=_0x237b[_0x47af23];return _0x17a44f;};'use strict';var Sequelize=require(_0xb237('0x0'));module[_0xb237('0x1')]={'name':{'type':Sequelize[_0xb237('0x2')]},'description':{'type':Sequelize[_0xb237('0x2')]}}; \ No newline at end of file +var _0x47eb=['sequelize','exports','STRING'];(function(_0x13088e,_0x3e6040){var _0x59983f=function(_0x421328){while(--_0x421328){_0x13088e['push'](_0x13088e['shift']());}};_0x59983f(++_0x3e6040);}(_0x47eb,0x1b0));var _0xb47e=function(_0x45d5ef,_0x10c29b){_0x45d5ef=_0x45d5ef-0x0;var _0x474d19=_0x47eb[_0x45d5ef];return _0x474d19;};'use strict';var Sequelize=require(_0xb47e('0x0'));module[_0xb47e('0x1')]={'name':{'type':Sequelize[_0xb47e('0x2')]},'description':{'type':Sequelize[_0xb47e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9bc799c..b365c9d 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 _0x1a6e=['then','destroy','stack','name','SugarcrmConfiguration','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','includeAll','include','findAll','show','params','rawAttributes','length','find','create','catch','body','getFields','findOne','SugarcrmField','sort','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a6e,0x15d));var _0xe1a6=function(_0x6c0b0a,_0x496391){_0x6c0b0a=_0x6c0b0a-0x0;var _0x5f456a=_0x1a6e[_0x6c0b0a];return _0x5f456a;};'use strict';var emlformat=require(_0xe1a6('0x0'));var rimraf=require(_0xe1a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1a6('0x2'));var rp=require(_0xe1a6('0x3'));var moment=require(_0xe1a6('0x4'));var BPromise=require(_0xe1a6('0x5'));var Mustache=require('mustache');var util=require(_0xe1a6('0x6'));var path=require(_0xe1a6('0x7'));var sox=require(_0xe1a6('0x8'));var csv=require(_0xe1a6('0x9'));var ejs=require(_0xe1a6('0xa'));var fs=require('fs');var fs_extra=require(_0xe1a6('0xb'));var _=require('lodash');var squel=require(_0xe1a6('0xc'));var crypto=require('crypto');var jsforce=require(_0xe1a6('0xd'));var deskjs=require(_0xe1a6('0xe'));var toCsv=require(_0xe1a6('0x9'));var querystring=require(_0xe1a6('0xf'));var Papa=require(_0xe1a6('0x10'));var Redis=require(_0xe1a6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe1a6('0x12'));var hardwareService=require(_0xe1a6('0x13'));var logger=require(_0xe1a6('0x14'))(_0xe1a6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f39c0,_0xaa8eb2){_0xaa8eb2=_0xaa8eb2||0xcc;return function(_0x45089b){if(_0x45089b){return _0x2f39c0[_0xe1a6('0x16')](_0xaa8eb2);}return _0x2f39c0['status'](_0xaa8eb2)[_0xe1a6('0x17')]();};}function respondWithResult(_0x56c3c2,_0xd9eb74){_0xd9eb74=_0xd9eb74||0xc8;return function(_0x26616f){if(_0x26616f){return _0x56c3c2[_0xe1a6('0x18')](_0xd9eb74)[_0xe1a6('0x19')](_0x26616f);}};}function respondWithFilteredResult(_0x43295c,_0x2ac2a3){return function(_0x585960){if(_0x585960){var _0x55b489=typeof _0x2ac2a3[_0xe1a6('0x1a')]===_0xe1a6('0x1b')&&typeof _0x2ac2a3[_0xe1a6('0x1c')]===_0xe1a6('0x1b');var _0x3fb1fb=_0x585960[_0xe1a6('0x1d')];var _0x53a58f=_0x55b489?0x0:_0x2ac2a3[_0xe1a6('0x1a')];var _0x4e0a35=_0x55b489?_0x585960[_0xe1a6('0x1d')]:_0x2ac2a3[_0xe1a6('0x1a')]+_0x2ac2a3['limit'];var _0x37e058;if(_0x4e0a35>=_0x3fb1fb){_0x4e0a35=_0x3fb1fb;_0x37e058=0xc8;}else{_0x37e058=0xce;}_0x43295c[_0xe1a6('0x18')](_0x37e058);return _0x43295c[_0xe1a6('0x1e')](_0xe1a6('0x1f'),_0x53a58f+'-'+_0x4e0a35+'/'+_0x3fb1fb)['json'](_0x585960);}return null;};}function patchUpdates(_0x4122d9){return function(_0x2b3391){try{jsonpatch[_0xe1a6('0x20')](_0x2b3391,_0x4122d9,!![]);}catch(_0x8326ee){return BPromise[_0xe1a6('0x21')](_0x8326ee);}return _0x2b3391[_0xe1a6('0x22')]();};}function saveUpdates(_0x146266,_0x9d5607){return function(_0xe92bd6){if(_0xe92bd6){return _0xe92bd6[_0xe1a6('0x23')](_0x146266)[_0xe1a6('0x24')](function(_0x29ea3f){return _0x29ea3f;});}return null;};}function removeEntity(_0x335df2,_0x4b4da1){return function(_0x47347f){if(_0x47347f){return _0x47347f[_0xe1a6('0x25')]()[_0xe1a6('0x24')](function(){_0x335df2[_0xe1a6('0x18')](0xcc)[_0xe1a6('0x17')]();});}};}function handleEntityNotFound(_0x4a1861,_0xc16999){return function(_0x4866af){if(!_0x4866af){_0x4a1861['sendStatus'](0x194);}return _0x4866af;};}function handleError(_0x128afb,_0x11f9e1){_0x11f9e1=_0x11f9e1||0x1f4;return function(_0x307858){logger['error'](_0x307858[_0xe1a6('0x26')]);if(_0x307858[_0xe1a6('0x27')]){delete _0x307858[_0xe1a6('0x27')];}_0x128afb['status'](_0x11f9e1)['send'](_0x307858);};}exports['index']=function(_0x71e0df,_0x389c89){var _0x14e3ff={},_0x2fdbe4={},_0x33a6c2={'count':0x0,'rows':[]};var _0x4e70c1=_['map'](db[_0xe1a6('0x28')]['rawAttributes'],function(_0x16f952){return{'name':_0x16f952[_0xe1a6('0x29')],'type':_0x16f952[_0xe1a6('0x2a')][_0xe1a6('0x2b')]};});_0x2fdbe4[_0xe1a6('0x2c')]=_[_0xe1a6('0x2d')](_0x4e70c1,_0xe1a6('0x27'));_0x2fdbe4[_0xe1a6('0x2e')]=_[_0xe1a6('0x2f')](_0x71e0df['query']);_0x2fdbe4[_0xe1a6('0x30')]=_[_0xe1a6('0x31')](_0x2fdbe4[_0xe1a6('0x2c')],_0x2fdbe4[_0xe1a6('0x2e')]);_0x14e3ff['attributes']=_[_0xe1a6('0x31')](_0x2fdbe4[_0xe1a6('0x2c')],qs[_0xe1a6('0x32')](_0x71e0df[_0xe1a6('0x2e')][_0xe1a6('0x32')]));_0x14e3ff['attributes']=_0x14e3ff['attributes']['length']?_0x14e3ff[_0xe1a6('0x33')]:_0x2fdbe4[_0xe1a6('0x2c')];if(!_0x71e0df['query'][_0xe1a6('0x34')](_0xe1a6('0x35'))){_0x14e3ff[_0xe1a6('0x1c')]=qs[_0xe1a6('0x1c')](_0x71e0df[_0xe1a6('0x2e')]['limit']);_0x14e3ff[_0xe1a6('0x1a')]=qs[_0xe1a6('0x1a')](_0x71e0df[_0xe1a6('0x2e')][_0xe1a6('0x1a')]);}_0x14e3ff[_0xe1a6('0x36')]=qs['sort'](_0x71e0df['query']['sort']);_0x14e3ff['where']=qs[_0xe1a6('0x30')](_[_0xe1a6('0x37')](_0x71e0df[_0xe1a6('0x2e')],_0x2fdbe4[_0xe1a6('0x30')]),_0x4e70c1);if(_0x71e0df[_0xe1a6('0x2e')]['filter']){_0x14e3ff[_0xe1a6('0x38')]=_[_0xe1a6('0x39')](_0x14e3ff['where'],{'$or':_[_0xe1a6('0x2d')](_0x4e70c1,function(_0x16cb21){if(_0x16cb21['type']!=='VIRTUAL'){var _0x4137d2={};_0x4137d2[_0x16cb21[_0xe1a6('0x27')]]={'$like':'%'+_0x71e0df[_0xe1a6('0x2e')][_0xe1a6('0x3a')]+'%'};return _0x4137d2;}})});}_0x14e3ff=_['merge']({},_0x14e3ff,_0x71e0df[_0xe1a6('0x3b')]);var _0x4ce302={'where':_0x14e3ff[_0xe1a6('0x38')]};return db[_0xe1a6('0x28')]['count'](_0x4ce302)[_0xe1a6('0x24')](function(_0x266838){_0x33a6c2[_0xe1a6('0x1d')]=_0x266838;if(_0x71e0df[_0xe1a6('0x2e')][_0xe1a6('0x3c')]){_0x14e3ff[_0xe1a6('0x3d')]=[{'all':!![]}];}return db[_0xe1a6('0x28')][_0xe1a6('0x3e')](_0x14e3ff);})[_0xe1a6('0x24')](function(_0x4931a3){_0x33a6c2['rows']=_0x4931a3;return _0x33a6c2;})[_0xe1a6('0x24')](respondWithFilteredResult(_0x389c89,_0x14e3ff))['catch'](handleError(_0x389c89,null));};exports[_0xe1a6('0x3f')]=function(_0x334a4b,_0x511a95){var _0x2bf727={'raw':![],'where':{'id':_0x334a4b[_0xe1a6('0x40')]['id']}},_0xfbe2c5={};_0xfbe2c5[_0xe1a6('0x2c')]=_[_0xe1a6('0x2f')](db['SugarcrmConfiguration'][_0xe1a6('0x41')]);_0xfbe2c5['query']=_[_0xe1a6('0x2f')](_0x334a4b[_0xe1a6('0x2e')]);_0xfbe2c5['filters']=_[_0xe1a6('0x31')](_0xfbe2c5[_0xe1a6('0x2c')],_0xfbe2c5[_0xe1a6('0x2e')]);_0x2bf727[_0xe1a6('0x33')]=_[_0xe1a6('0x31')](_0xfbe2c5[_0xe1a6('0x2c')],qs[_0xe1a6('0x32')](_0x334a4b[_0xe1a6('0x2e')]['fields']));_0x2bf727[_0xe1a6('0x33')]=_0x2bf727[_0xe1a6('0x33')][_0xe1a6('0x42')]?_0x2bf727[_0xe1a6('0x33')]:_0xfbe2c5[_0xe1a6('0x2c')];if(_0x334a4b[_0xe1a6('0x2e')][_0xe1a6('0x3c')]){_0x2bf727['include']=[{'all':!![]}];}_0x2bf727=_[_0xe1a6('0x39')]({},_0x2bf727,_0x334a4b[_0xe1a6('0x3b')]);return db[_0xe1a6('0x28')][_0xe1a6('0x43')](_0x2bf727)['then'](handleEntityNotFound(_0x511a95,null))[_0xe1a6('0x24')](respondWithResult(_0x511a95,null))['catch'](handleError(_0x511a95,null));};exports[_0xe1a6('0x44')]=function(_0x178f9a,_0x48b9d3){return db['SugarcrmConfiguration']['create'](_0x178f9a['body'],{})[_0xe1a6('0x24')](respondWithResult(_0x48b9d3,0xc9))[_0xe1a6('0x45')](handleError(_0x48b9d3,null));};exports[_0xe1a6('0x23')]=function(_0x4cfb94,_0x32bffc){if(_0x4cfb94['body']['id']){delete _0x4cfb94[_0xe1a6('0x46')]['id'];}return db['SugarcrmConfiguration'][_0xe1a6('0x43')]({'where':{'id':_0x4cfb94[_0xe1a6('0x40')]['id']}})[_0xe1a6('0x24')](handleEntityNotFound(_0x32bffc,null))['then'](saveUpdates(_0x4cfb94[_0xe1a6('0x46')],null))[_0xe1a6('0x24')](respondWithResult(_0x32bffc,null))[_0xe1a6('0x45')](handleError(_0x32bffc,null));};exports[_0xe1a6('0x25')]=function(_0xb6265,_0xf46fa0){return db['SugarcrmConfiguration']['find']({'where':{'id':_0xb6265['params']['id']}})[_0xe1a6('0x24')](handleEntityNotFound(_0xf46fa0,null))[_0xe1a6('0x24')](removeEntity(_0xf46fa0,null))[_0xe1a6('0x45')](handleError(_0xf46fa0,null));};exports[_0xe1a6('0x47')]=function(_0x13ac41,_0x1c8382,_0x569245){var _0x37dca8={};var _0x5ae9ee={};var _0x92f37d;var _0x1f17a8;return db['SugarcrmConfiguration'][_0xe1a6('0x48')]({'where':{'id':_0x13ac41['params']['id']}})[_0xe1a6('0x24')](handleEntityNotFound(_0x1c8382,null))['then'](function(_0x446800){if(_0x446800){_0x92f37d=_0x446800;_0x5ae9ee[_0xe1a6('0x2c')]=_['keys'](db[_0xe1a6('0x49')][_0xe1a6('0x41')]);_0x5ae9ee[_0xe1a6('0x2e')]=_[_0xe1a6('0x2f')](_0x13ac41[_0xe1a6('0x2e')]);_0x5ae9ee[_0xe1a6('0x30')]=_[_0xe1a6('0x31')](_0x5ae9ee[_0xe1a6('0x2c')],_0x5ae9ee[_0xe1a6('0x2e')]);_0x37dca8['attributes']=_['intersection'](_0x5ae9ee['model'],qs[_0xe1a6('0x32')](_0x13ac41[_0xe1a6('0x2e')][_0xe1a6('0x32')]));_0x37dca8[_0xe1a6('0x33')]=_0x37dca8[_0xe1a6('0x33')][_0xe1a6('0x42')]?_0x37dca8['attributes']:_0x5ae9ee[_0xe1a6('0x2c')];_0x37dca8['order']=qs[_0xe1a6('0x4a')](_0x13ac41[_0xe1a6('0x2e')][_0xe1a6('0x4a')]);_0x37dca8['where']=qs[_0xe1a6('0x30')](_[_0xe1a6('0x37')](_0x13ac41[_0xe1a6('0x2e')],_0x5ae9ee[_0xe1a6('0x30')]));if(_0x13ac41[_0xe1a6('0x2e')]['filter']){_0x37dca8[_0xe1a6('0x38')]=_[_0xe1a6('0x39')](_0x37dca8[_0xe1a6('0x38')],{'$or':_[_0xe1a6('0x2d')](_0x37dca8[_0xe1a6('0x33')],function(_0x1b87ef){var _0xb3b05a={};_0xb3b05a[_0x1b87ef]={'$like':'%'+_0x13ac41[_0xe1a6('0x2e')][_0xe1a6('0x3a')]+'%'};return _0xb3b05a;})});}_0x37dca8=_['merge']({},_0x37dca8,_0x13ac41[_0xe1a6('0x3b')]);return _0x92f37d[_0xe1a6('0x47')](_0x37dca8);}})[_0xe1a6('0x24')](function(_0x4d9f92){if(_0x4d9f92){_0x1f17a8=_0x4d9f92[_0xe1a6('0x42')];if(!_0x13ac41[_0xe1a6('0x2e')][_0xe1a6('0x34')](_0xe1a6('0x35'))){_0x37dca8['limit']=qs[_0xe1a6('0x1c')](_0x13ac41[_0xe1a6('0x2e')]['limit']);_0x37dca8[_0xe1a6('0x1a')]=qs['offset'](_0x13ac41[_0xe1a6('0x2e')][_0xe1a6('0x1a')]);}return _0x92f37d[_0xe1a6('0x47')](_0x37dca8);}})[_0xe1a6('0x24')](function(_0x275068){if(_0x275068){return _0x275068?{'count':_0x1f17a8,'rows':_0x275068}:null;}})[_0xe1a6('0x24')](respondWithResult(_0x1c8382,null))['catch'](handleError(_0x1c8382,null));};exports[_0xe1a6('0x4b')]=function(_0x8086c6,_0x3e3d11,_0x3b0d52){var _0x46be0d={};var _0x463b84={};var _0x173d35;var _0x2c641c;return db[_0xe1a6('0x28')][_0xe1a6('0x48')]({'where':{'id':_0x8086c6[_0xe1a6('0x40')]['id']}})[_0xe1a6('0x24')](handleEntityNotFound(_0x3e3d11,null))[_0xe1a6('0x24')](function(_0x13aa9e){if(_0x13aa9e){_0x173d35=_0x13aa9e;_0x463b84[_0xe1a6('0x2c')]=_['keys'](db['SugarcrmField'][_0xe1a6('0x41')]);_0x463b84[_0xe1a6('0x2e')]=_[_0xe1a6('0x2f')](_0x8086c6[_0xe1a6('0x2e')]);_0x463b84['filters']=_[_0xe1a6('0x31')](_0x463b84[_0xe1a6('0x2c')],_0x463b84[_0xe1a6('0x2e')]);_0x46be0d[_0xe1a6('0x33')]=_[_0xe1a6('0x31')](_0x463b84['model'],qs[_0xe1a6('0x32')](_0x8086c6[_0xe1a6('0x2e')][_0xe1a6('0x32')]));_0x46be0d[_0xe1a6('0x33')]=_0x46be0d[_0xe1a6('0x33')]['length']?_0x46be0d['attributes']:_0x463b84['model'];_0x46be0d['order']=qs[_0xe1a6('0x4a')](_0x8086c6[_0xe1a6('0x2e')][_0xe1a6('0x4a')]);_0x46be0d['where']=qs[_0xe1a6('0x30')](_['pick'](_0x8086c6[_0xe1a6('0x2e')],_0x463b84[_0xe1a6('0x30')]));if(_0x8086c6[_0xe1a6('0x2e')][_0xe1a6('0x3a')]){_0x46be0d[_0xe1a6('0x38')]=_[_0xe1a6('0x39')](_0x46be0d[_0xe1a6('0x38')],{'$or':_[_0xe1a6('0x2d')](_0x46be0d[_0xe1a6('0x33')],function(_0x1bf1f6){var _0x5c9439={};_0x5c9439[_0x1bf1f6]={'$like':'%'+_0x8086c6[_0xe1a6('0x2e')][_0xe1a6('0x3a')]+'%'};return _0x5c9439;})});}_0x46be0d=_['merge']({},_0x46be0d,_0x8086c6['options']);return _0x173d35[_0xe1a6('0x4b')](_0x46be0d);}})['then'](function(_0x4e118e){if(_0x4e118e){_0x2c641c=_0x4e118e[_0xe1a6('0x42')];if(!_0x8086c6['query'][_0xe1a6('0x34')](_0xe1a6('0x35'))){_0x46be0d[_0xe1a6('0x1c')]=qs[_0xe1a6('0x1c')](_0x8086c6[_0xe1a6('0x2e')][_0xe1a6('0x1c')]);_0x46be0d[_0xe1a6('0x1a')]=qs[_0xe1a6('0x1a')](_0x8086c6[_0xe1a6('0x2e')]['offset']);}return _0x173d35[_0xe1a6('0x4b')](_0x46be0d);}})[_0xe1a6('0x24')](function(_0x1f20ee){if(_0x1f20ee){return _0x1f20ee?{'count':_0x2c641c,'rows':_0x1f20ee}:null;}})[_0xe1a6('0x24')](respondWithResult(_0x3e3d11,null))[_0xe1a6('0x45')](handleError(_0x3e3d11,null));};exports[_0xe1a6('0x4c')]=function(_0x1f8640,_0x48dc57,_0x5a4a08){var _0x384d2e={};var _0x1e9d17={};var _0x1abead;var _0x2582b2;return db[_0xe1a6('0x28')]['findOne']({'where':{'id':_0x1f8640[_0xe1a6('0x40')]['id']}})[_0xe1a6('0x24')](handleEntityNotFound(_0x48dc57,null))[_0xe1a6('0x24')](function(_0x276a59){if(_0x276a59){_0x1abead=_0x276a59;_0x1e9d17['model']=_[_0xe1a6('0x2f')](db[_0xe1a6('0x49')]['rawAttributes']);_0x1e9d17[_0xe1a6('0x2e')]=_[_0xe1a6('0x2f')](_0x1f8640[_0xe1a6('0x2e')]);_0x1e9d17[_0xe1a6('0x30')]=_[_0xe1a6('0x31')](_0x1e9d17[_0xe1a6('0x2c')],_0x1e9d17[_0xe1a6('0x2e')]);_0x384d2e['attributes']=_['intersection'](_0x1e9d17['model'],qs['fields'](_0x1f8640[_0xe1a6('0x2e')][_0xe1a6('0x32')]));_0x384d2e[_0xe1a6('0x33')]=_0x384d2e['attributes']['length']?_0x384d2e[_0xe1a6('0x33')]:_0x1e9d17[_0xe1a6('0x2c')];_0x384d2e[_0xe1a6('0x36')]=qs['sort'](_0x1f8640['query'][_0xe1a6('0x4a')]);_0x384d2e[_0xe1a6('0x38')]=qs['filters'](_[_0xe1a6('0x37')](_0x1f8640[_0xe1a6('0x2e')],_0x1e9d17['filters']));if(_0x1f8640[_0xe1a6('0x2e')][_0xe1a6('0x3a')]){_0x384d2e[_0xe1a6('0x38')]=_[_0xe1a6('0x39')](_0x384d2e[_0xe1a6('0x38')],{'$or':_[_0xe1a6('0x2d')](_0x384d2e[_0xe1a6('0x33')],function(_0x4be6e6){var _0xbdde6b={};_0xbdde6b[_0x4be6e6]={'$like':'%'+_0x1f8640[_0xe1a6('0x2e')][_0xe1a6('0x3a')]+'%'};return _0xbdde6b;})});}_0x384d2e=_[_0xe1a6('0x39')]({},_0x384d2e,_0x1f8640[_0xe1a6('0x3b')]);return _0x1abead[_0xe1a6('0x4c')](_0x384d2e);}})[_0xe1a6('0x24')](function(_0x2ef777){if(_0x2ef777){_0x2582b2=_0x2ef777[_0xe1a6('0x42')];if(!_0x1f8640[_0xe1a6('0x2e')]['hasOwnProperty'](_0xe1a6('0x35'))){_0x384d2e[_0xe1a6('0x1c')]=qs[_0xe1a6('0x1c')](_0x1f8640[_0xe1a6('0x2e')][_0xe1a6('0x1c')]);_0x384d2e['offset']=qs['offset'](_0x1f8640[_0xe1a6('0x2e')][_0xe1a6('0x1a')]);}return _0x1abead['getDescriptions'](_0x384d2e);}})['then'](function(_0x1e6517){if(_0x1e6517){return _0x1e6517?{'count':_0x2582b2,'rows':_0x1e6517}:null;}})['then'](respondWithResult(_0x48dc57,null))[_0xe1a6('0x45')](handleError(_0x48dc57,null));}; \ No newline at end of file +var _0x5cfe=['path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','json','apply','save','destroy','then','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','update','find','getFields','findOne','SugarcrmField','hasOwnProperty','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util'];(function(_0x334f61,_0x20cd4c){var _0x307da4=function(_0x516e0d){while(--_0x516e0d){_0x334f61['push'](_0x334f61['shift']());}};_0x307da4(++_0x20cd4c);}(_0x5cfe,0x139));var _0xe5cf=function(_0x197d4b,_0x5e7e46){_0x197d4b=_0x197d4b-0x0;var _0x3b96f9=_0x5cfe[_0x197d4b];return _0x3b96f9;};'use strict';var emlformat=require(_0xe5cf('0x0'));var rimraf=require(_0xe5cf('0x1'));var zipdir=require(_0xe5cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5cf('0x3'));var moment=require(_0xe5cf('0x4'));var BPromise=require(_0xe5cf('0x5'));var Mustache=require('mustache');var util=require(_0xe5cf('0x6'));var path=require(_0xe5cf('0x7'));var sox=require(_0xe5cf('0x8'));var csv=require(_0xe5cf('0x9'));var ejs=require(_0xe5cf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe5cf('0xb'));var squel=require(_0xe5cf('0xc'));var crypto=require(_0xe5cf('0xd'));var jsforce=require(_0xe5cf('0xe'));var deskjs=require(_0xe5cf('0xf'));var toCsv=require(_0xe5cf('0x9'));var querystring=require(_0xe5cf('0x10'));var Papa=require(_0xe5cf('0x11'));var Redis=require(_0xe5cf('0x12'));var authService=require(_0xe5cf('0x13'));var qs=require(_0xe5cf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe5cf('0x15'));var logger=require('../../config/logger')(_0xe5cf('0x16'));var utils=require(_0xe5cf('0x17'));var config=require(_0xe5cf('0x18'));var licenseUtil=require(_0xe5cf('0x19'));var db=require(_0xe5cf('0x1a'))['db'];function respondWithStatusCode(_0x40fd49,_0x14daea){_0x14daea=_0x14daea||0xcc;return function(_0x3905a8){if(_0x3905a8){return _0x40fd49[_0xe5cf('0x1b')](_0x14daea);}return _0x40fd49[_0xe5cf('0x1c')](_0x14daea)['end']();};}function respondWithResult(_0x268317,_0xe71b56){_0xe71b56=_0xe71b56||0xc8;return function(_0x278c7a){if(_0x278c7a){return _0x268317[_0xe5cf('0x1c')](_0xe71b56)['json'](_0x278c7a);}};}function respondWithFilteredResult(_0x50a9af,_0x160fb2){return function(_0x19d455){if(_0x19d455){var _0xa17543=typeof _0x160fb2['offset']===_0xe5cf('0x1d')&&typeof _0x160fb2[_0xe5cf('0x1e')]===_0xe5cf('0x1d');var _0x22c334=_0x19d455['count'];var _0x24d2f5=_0xa17543?0x0:_0x160fb2[_0xe5cf('0x1f')];var _0x12e36a=_0xa17543?_0x19d455['count']:_0x160fb2[_0xe5cf('0x1f')]+_0x160fb2[_0xe5cf('0x1e')];var _0x3e6c2e;if(_0x12e36a>=_0x22c334){_0x12e36a=_0x22c334;_0x3e6c2e=0xc8;}else{_0x3e6c2e=0xce;}_0x50a9af[_0xe5cf('0x1c')](_0x3e6c2e);return _0x50a9af['set']('Content-Range',_0x24d2f5+'-'+_0x12e36a+'/'+_0x22c334)[_0xe5cf('0x20')](_0x19d455);}return null;};}function patchUpdates(_0x59fea3){return function(_0x508950){try{jsonpatch[_0xe5cf('0x21')](_0x508950,_0x59fea3,!![]);}catch(_0x8f1da4){return BPromise['reject'](_0x8f1da4);}return _0x508950[_0xe5cf('0x22')]();};}function saveUpdates(_0x124e0d,_0x264ea0){return function(_0x300477){if(_0x300477){return _0x300477['update'](_0x124e0d)['then'](function(_0x251716){return _0x251716;});}return null;};}function removeEntity(_0x137d3b,_0x29226f){return function(_0x2c8e67){if(_0x2c8e67){return _0x2c8e67[_0xe5cf('0x23')]()[_0xe5cf('0x24')](function(){_0x137d3b[_0xe5cf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b8e3,_0x1a5f20){return function(_0x33a2c6){if(!_0x33a2c6){_0x23b8e3[_0xe5cf('0x1b')](0x194);}return _0x33a2c6;};}function handleError(_0x442af9,_0x5520ee){_0x5520ee=_0x5520ee||0x1f4;return function(_0x5ec7b4){logger['error'](_0x5ec7b4['stack']);if(_0x5ec7b4['name']){delete _0x5ec7b4[_0xe5cf('0x25')];}_0x442af9[_0xe5cf('0x1c')](_0x5520ee)[_0xe5cf('0x26')](_0x5ec7b4);};}exports[_0xe5cf('0x27')]=function(_0x57309b,_0x42f0d3){var _0x5e425d={},_0x1bec4d={},_0x19898d={'count':0x0,'rows':[]};var _0x3ab5b4=_[_0xe5cf('0x28')](db[_0xe5cf('0x29')][_0xe5cf('0x2a')],function(_0x525709){return{'name':_0x525709[_0xe5cf('0x2b')],'type':_0x525709['type'][_0xe5cf('0x2c')]};});_0x1bec4d[_0xe5cf('0x2d')]=_[_0xe5cf('0x28')](_0x3ab5b4,_0xe5cf('0x25'));_0x1bec4d[_0xe5cf('0x2e')]=_[_0xe5cf('0x2f')](_0x57309b[_0xe5cf('0x2e')]);_0x1bec4d[_0xe5cf('0x30')]=_['intersection'](_0x1bec4d[_0xe5cf('0x2d')],_0x1bec4d[_0xe5cf('0x2e')]);_0x5e425d[_0xe5cf('0x31')]=_[_0xe5cf('0x32')](_0x1bec4d[_0xe5cf('0x2d')],qs[_0xe5cf('0x33')](_0x57309b[_0xe5cf('0x2e')][_0xe5cf('0x33')]));_0x5e425d[_0xe5cf('0x31')]=_0x5e425d[_0xe5cf('0x31')][_0xe5cf('0x34')]?_0x5e425d[_0xe5cf('0x31')]:_0x1bec4d[_0xe5cf('0x2d')];if(!_0x57309b[_0xe5cf('0x2e')]['hasOwnProperty']('nolimit')){_0x5e425d[_0xe5cf('0x1e')]=qs[_0xe5cf('0x1e')](_0x57309b['query'][_0xe5cf('0x1e')]);_0x5e425d['offset']=qs[_0xe5cf('0x1f')](_0x57309b['query']['offset']);}_0x5e425d[_0xe5cf('0x35')]=qs['sort'](_0x57309b[_0xe5cf('0x2e')][_0xe5cf('0x36')]);_0x5e425d[_0xe5cf('0x37')]=qs[_0xe5cf('0x30')](_[_0xe5cf('0x38')](_0x57309b['query'],_0x1bec4d[_0xe5cf('0x30')]),_0x3ab5b4);if(_0x57309b['query'][_0xe5cf('0x39')]){_0x5e425d[_0xe5cf('0x37')]=_[_0xe5cf('0x3a')](_0x5e425d[_0xe5cf('0x37')],{'$or':_['map'](_0x3ab5b4,function(_0x2d0a39){if(_0x2d0a39[_0xe5cf('0x3b')]!==_0xe5cf('0x3c')){var _0x27c2df={};_0x27c2df[_0x2d0a39[_0xe5cf('0x25')]]={'$like':'%'+_0x57309b['query']['filter']+'%'};return _0x27c2df;}})});}_0x5e425d=_[_0xe5cf('0x3a')]({},_0x5e425d,_0x57309b[_0xe5cf('0x3d')]);var _0x43e94f={'where':_0x5e425d['where']};return db[_0xe5cf('0x29')]['count'](_0x43e94f)[_0xe5cf('0x24')](function(_0x2b2d83){_0x19898d[_0xe5cf('0x3e')]=_0x2b2d83;if(_0x57309b[_0xe5cf('0x2e')][_0xe5cf('0x3f')]){_0x5e425d[_0xe5cf('0x40')]=[{'all':!![]}];}return db[_0xe5cf('0x29')][_0xe5cf('0x41')](_0x5e425d);})[_0xe5cf('0x24')](function(_0x1a9289){_0x19898d['rows']=_0x1a9289;return _0x19898d;})[_0xe5cf('0x24')](respondWithFilteredResult(_0x42f0d3,_0x5e425d))[_0xe5cf('0x42')](handleError(_0x42f0d3,null));};exports[_0xe5cf('0x43')]=function(_0x1f6270,_0x2c4dae){var _0x27727a={'raw':![],'where':{'id':_0x1f6270[_0xe5cf('0x44')]['id']}},_0x86a1c8={};_0x86a1c8['model']=_['keys'](db[_0xe5cf('0x29')][_0xe5cf('0x2a')]);_0x86a1c8[_0xe5cf('0x2e')]=_[_0xe5cf('0x2f')](_0x1f6270['query']);_0x86a1c8[_0xe5cf('0x30')]=_[_0xe5cf('0x32')](_0x86a1c8[_0xe5cf('0x2d')],_0x86a1c8[_0xe5cf('0x2e')]);_0x27727a['attributes']=_[_0xe5cf('0x32')](_0x86a1c8[_0xe5cf('0x2d')],qs[_0xe5cf('0x33')](_0x1f6270[_0xe5cf('0x2e')][_0xe5cf('0x33')]));_0x27727a[_0xe5cf('0x31')]=_0x27727a[_0xe5cf('0x31')][_0xe5cf('0x34')]?_0x27727a[_0xe5cf('0x31')]:_0x86a1c8[_0xe5cf('0x2d')];if(_0x1f6270[_0xe5cf('0x2e')][_0xe5cf('0x3f')]){_0x27727a[_0xe5cf('0x40')]=[{'all':!![]}];}_0x27727a=_[_0xe5cf('0x3a')]({},_0x27727a,_0x1f6270['options']);return db[_0xe5cf('0x29')]['find'](_0x27727a)[_0xe5cf('0x24')](handleEntityNotFound(_0x2c4dae,null))['then'](respondWithResult(_0x2c4dae,null))['catch'](handleError(_0x2c4dae,null));};exports['create']=function(_0x2fecda,_0x29c785){return db[_0xe5cf('0x29')][_0xe5cf('0x45')](_0x2fecda[_0xe5cf('0x46')],{})[_0xe5cf('0x24')](respondWithResult(_0x29c785,0xc9))[_0xe5cf('0x42')](handleError(_0x29c785,null));};exports[_0xe5cf('0x47')]=function(_0x9729e4,_0x145410){if(_0x9729e4[_0xe5cf('0x46')]['id']){delete _0x9729e4[_0xe5cf('0x46')]['id'];}return db[_0xe5cf('0x29')][_0xe5cf('0x48')]({'where':{'id':_0x9729e4['params']['id']}})[_0xe5cf('0x24')](handleEntityNotFound(_0x145410,null))[_0xe5cf('0x24')](saveUpdates(_0x9729e4[_0xe5cf('0x46')],null))[_0xe5cf('0x24')](respondWithResult(_0x145410,null))['catch'](handleError(_0x145410,null));};exports[_0xe5cf('0x23')]=function(_0x4147a7,_0x4e9548){return db[_0xe5cf('0x29')][_0xe5cf('0x48')]({'where':{'id':_0x4147a7[_0xe5cf('0x44')]['id']}})[_0xe5cf('0x24')](handleEntityNotFound(_0x4e9548,null))[_0xe5cf('0x24')](removeEntity(_0x4e9548,null))['catch'](handleError(_0x4e9548,null));};exports[_0xe5cf('0x49')]=function(_0x315057,_0x1116f8,_0xb7808a){var _0x410217={};var _0x26e98d={};var _0x1af090;var _0x13eace;return db[_0xe5cf('0x29')][_0xe5cf('0x4a')]({'where':{'id':_0x315057[_0xe5cf('0x44')]['id']}})[_0xe5cf('0x24')](handleEntityNotFound(_0x1116f8,null))[_0xe5cf('0x24')](function(_0x247640){if(_0x247640){_0x1af090=_0x247640;_0x26e98d[_0xe5cf('0x2d')]=_[_0xe5cf('0x2f')](db[_0xe5cf('0x4b')][_0xe5cf('0x2a')]);_0x26e98d[_0xe5cf('0x2e')]=_[_0xe5cf('0x2f')](_0x315057['query']);_0x26e98d[_0xe5cf('0x30')]=_[_0xe5cf('0x32')](_0x26e98d[_0xe5cf('0x2d')],_0x26e98d[_0xe5cf('0x2e')]);_0x410217[_0xe5cf('0x31')]=_['intersection'](_0x26e98d[_0xe5cf('0x2d')],qs[_0xe5cf('0x33')](_0x315057[_0xe5cf('0x2e')]['fields']));_0x410217[_0xe5cf('0x31')]=_0x410217[_0xe5cf('0x31')]['length']?_0x410217[_0xe5cf('0x31')]:_0x26e98d[_0xe5cf('0x2d')];_0x410217['order']=qs[_0xe5cf('0x36')](_0x315057['query'][_0xe5cf('0x36')]);_0x410217[_0xe5cf('0x37')]=qs['filters'](_[_0xe5cf('0x38')](_0x315057[_0xe5cf('0x2e')],_0x26e98d[_0xe5cf('0x30')]));if(_0x315057[_0xe5cf('0x2e')][_0xe5cf('0x39')]){_0x410217[_0xe5cf('0x37')]=_['merge'](_0x410217[_0xe5cf('0x37')],{'$or':_[_0xe5cf('0x28')](_0x410217[_0xe5cf('0x31')],function(_0xc31d43){var _0x36aae2={};_0x36aae2[_0xc31d43]={'$like':'%'+_0x315057[_0xe5cf('0x2e')][_0xe5cf('0x39')]+'%'};return _0x36aae2;})});}_0x410217=_['merge']({},_0x410217,_0x315057[_0xe5cf('0x3d')]);return _0x1af090[_0xe5cf('0x49')](_0x410217);}})[_0xe5cf('0x24')](function(_0x3ae37d){if(_0x3ae37d){_0x13eace=_0x3ae37d[_0xe5cf('0x34')];if(!_0x315057[_0xe5cf('0x2e')][_0xe5cf('0x4c')](_0xe5cf('0x4d'))){_0x410217[_0xe5cf('0x1e')]=qs[_0xe5cf('0x1e')](_0x315057['query']['limit']);_0x410217['offset']=qs[_0xe5cf('0x1f')](_0x315057[_0xe5cf('0x2e')]['offset']);}return _0x1af090[_0xe5cf('0x49')](_0x410217);}})[_0xe5cf('0x24')](function(_0xccdde6){if(_0xccdde6){return _0xccdde6?{'count':_0x13eace,'rows':_0xccdde6}:null;}})[_0xe5cf('0x24')](respondWithResult(_0x1116f8,null))[_0xe5cf('0x42')](handleError(_0x1116f8,null));};exports[_0xe5cf('0x4e')]=function(_0x4c492f,_0x8bcc71,_0x997f3e){var _0x230256={};var _0x212c05={};var _0x443dda;var _0x3410c9;return db[_0xe5cf('0x29')][_0xe5cf('0x4a')]({'where':{'id':_0x4c492f['params']['id']}})[_0xe5cf('0x24')](handleEntityNotFound(_0x8bcc71,null))[_0xe5cf('0x24')](function(_0x9f6214){if(_0x9f6214){_0x443dda=_0x9f6214;_0x212c05['model']=_[_0xe5cf('0x2f')](db[_0xe5cf('0x4b')][_0xe5cf('0x2a')]);_0x212c05['query']=_[_0xe5cf('0x2f')](_0x4c492f['query']);_0x212c05['filters']=_[_0xe5cf('0x32')](_0x212c05['model'],_0x212c05[_0xe5cf('0x2e')]);_0x230256[_0xe5cf('0x31')]=_[_0xe5cf('0x32')](_0x212c05['model'],qs[_0xe5cf('0x33')](_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x33')]));_0x230256[_0xe5cf('0x31')]=_0x230256['attributes']['length']?_0x230256[_0xe5cf('0x31')]:_0x212c05[_0xe5cf('0x2d')];_0x230256['order']=qs[_0xe5cf('0x36')](_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x36')]);_0x230256[_0xe5cf('0x37')]=qs[_0xe5cf('0x30')](_['pick'](_0x4c492f[_0xe5cf('0x2e')],_0x212c05[_0xe5cf('0x30')]));if(_0x4c492f['query']['filter']){_0x230256[_0xe5cf('0x37')]=_['merge'](_0x230256[_0xe5cf('0x37')],{'$or':_['map'](_0x230256[_0xe5cf('0x31')],function(_0x30207c){var _0x51e459={};_0x51e459[_0x30207c]={'$like':'%'+_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x39')]+'%'};return _0x51e459;})});}_0x230256=_[_0xe5cf('0x3a')]({},_0x230256,_0x4c492f[_0xe5cf('0x3d')]);return _0x443dda['getSubjects'](_0x230256);}})[_0xe5cf('0x24')](function(_0x3e39e4){if(_0x3e39e4){_0x3410c9=_0x3e39e4[_0xe5cf('0x34')];if(!_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x4c')](_0xe5cf('0x4d'))){_0x230256[_0xe5cf('0x1e')]=qs[_0xe5cf('0x1e')](_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x1e')]);_0x230256[_0xe5cf('0x1f')]=qs[_0xe5cf('0x1f')](_0x4c492f[_0xe5cf('0x2e')][_0xe5cf('0x1f')]);}return _0x443dda[_0xe5cf('0x4e')](_0x230256);}})[_0xe5cf('0x24')](function(_0x418f69){if(_0x418f69){return _0x418f69?{'count':_0x3410c9,'rows':_0x418f69}:null;}})[_0xe5cf('0x24')](respondWithResult(_0x8bcc71,null))[_0xe5cf('0x42')](handleError(_0x8bcc71,null));};exports[_0xe5cf('0x4f')]=function(_0x4bc6db,_0x38434b,_0x2defab){var _0x288989={};var _0x481218={};var _0x4c101c;var _0xebc44c;return db[_0xe5cf('0x29')]['findOne']({'where':{'id':_0x4bc6db['params']['id']}})['then'](handleEntityNotFound(_0x38434b,null))[_0xe5cf('0x24')](function(_0x1b0b2e){if(_0x1b0b2e){_0x4c101c=_0x1b0b2e;_0x481218[_0xe5cf('0x2d')]=_[_0xe5cf('0x2f')](db[_0xe5cf('0x4b')][_0xe5cf('0x2a')]);_0x481218[_0xe5cf('0x2e')]=_[_0xe5cf('0x2f')](_0x4bc6db[_0xe5cf('0x2e')]);_0x481218[_0xe5cf('0x30')]=_['intersection'](_0x481218[_0xe5cf('0x2d')],_0x481218[_0xe5cf('0x2e')]);_0x288989['attributes']=_[_0xe5cf('0x32')](_0x481218[_0xe5cf('0x2d')],qs[_0xe5cf('0x33')](_0x4bc6db[_0xe5cf('0x2e')][_0xe5cf('0x33')]));_0x288989[_0xe5cf('0x31')]=_0x288989[_0xe5cf('0x31')][_0xe5cf('0x34')]?_0x288989[_0xe5cf('0x31')]:_0x481218[_0xe5cf('0x2d')];_0x288989[_0xe5cf('0x35')]=qs[_0xe5cf('0x36')](_0x4bc6db[_0xe5cf('0x2e')]['sort']);_0x288989[_0xe5cf('0x37')]=qs[_0xe5cf('0x30')](_[_0xe5cf('0x38')](_0x4bc6db[_0xe5cf('0x2e')],_0x481218[_0xe5cf('0x30')]));if(_0x4bc6db[_0xe5cf('0x2e')][_0xe5cf('0x39')]){_0x288989[_0xe5cf('0x37')]=_['merge'](_0x288989[_0xe5cf('0x37')],{'$or':_[_0xe5cf('0x28')](_0x288989['attributes'],function(_0x2eba2e){var _0x552570={};_0x552570[_0x2eba2e]={'$like':'%'+_0x4bc6db[_0xe5cf('0x2e')][_0xe5cf('0x39')]+'%'};return _0x552570;})});}_0x288989=_['merge']({},_0x288989,_0x4bc6db['options']);return _0x4c101c[_0xe5cf('0x4f')](_0x288989);}})[_0xe5cf('0x24')](function(_0x27d140){if(_0x27d140){_0xebc44c=_0x27d140['length'];if(!_0x4bc6db[_0xe5cf('0x2e')][_0xe5cf('0x4c')](_0xe5cf('0x4d'))){_0x288989['limit']=qs[_0xe5cf('0x1e')](_0x4bc6db[_0xe5cf('0x2e')][_0xe5cf('0x1e')]);_0x288989[_0xe5cf('0x1f')]=qs[_0xe5cf('0x1f')](_0x4bc6db[_0xe5cf('0x2e')]['offset']);}return _0x4c101c[_0xe5cf('0x4f')](_0x288989);}})['then'](function(_0x37c5c4){if(_0x37c5c4){return _0x37c5c4?{'count':_0xebc44c,'rows':_0x37c5c4}:null;}})['then'](respondWithResult(_0x38434b,null))[_0xe5cf('0x42')](handleError(_0x38434b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 938f38b..a7866d2 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 _0xd2bc=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x4a54e8,_0xa92c5c){var _0x2bf831=function(_0x40f951){while(--_0x40f951){_0x4a54e8['push'](_0x4a54e8['shift']());}};_0x2bf831(++_0xa92c5c);}(_0xd2bc,0x131));var _0xcd2b=function(_0xb116ec,_0x17b7fe){_0xb116ec=_0xb116ec-0x0;var _0x2f73b4=_0xd2bc[_0xb116ec];return _0x2f73b4;};'use strict';var _=require(_0xcd2b('0x0'));var util=require(_0xcd2b('0x1'));var logger=require(_0xcd2b('0x2'))(_0xcd2b('0x3'));var moment=require(_0xcd2b('0x4'));var BPromise=require(_0xcd2b('0x5'));var rp=require(_0xcd2b('0x6'));var fs=require('fs');var path=require(_0xcd2b('0x7'));var rimraf=require(_0xcd2b('0x8'));var config=require(_0xcd2b('0x9'));var attributes=require(_0xcd2b('0xa'));module[_0xcd2b('0xb')]=function(_0x568be6,_0x6b7368){return _0x568be6['define'](_0xcd2b('0xc'),attributes,{'tableName':_0xcd2b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc16f=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x125073,_0x13f40e){var _0x452d19=function(_0x2bc999){while(--_0x2bc999){_0x125073['push'](_0x125073['shift']());}};_0x452d19(++_0x13f40e);}(_0xc16f,0x183));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc16('0x0'));var util=require(_0xfc16('0x1'));var logger=require(_0xfc16('0x2'))('api');var moment=require(_0xfc16('0x3'));var BPromise=require(_0xfc16('0x4'));var rp=require(_0xfc16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc16('0x6'));var config=require(_0xfc16('0x7'));var attributes=require(_0xfc16('0x8'));module[_0xfc16('0x9')]=function(_0x3157b8,_0x26b843){return _0x3157b8['define'](_0xfc16('0xa'),attributes,{'tableName':_0xfc16('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 dd84b59..9d172c7 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 _0x3ff2=['../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2f199a,_0x58c7dc){var _0x18ad6f=function(_0x48a5b3){while(--_0x48a5b3){_0x2f199a['push'](_0x2f199a['shift']());}};_0x18ad6f(++_0x58c7dc);}(_0x3ff2,0x144));var _0x23ff=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ff2[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x23ff('0x0'));var util=require(_0x23ff('0x1'));var moment=require(_0x23ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x23ff('0x3'));var fs=require('fs');var Redis=require(_0x23ff('0x4'));var db=require(_0x23ff('0x5'))['db'];var utils=require(_0x23ff('0x6'));var logger=require(_0x23ff('0x7'))('rpc');var config=require(_0x23ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27d486,_0x448485,_0x76c39b){return new BPromise(function(_0x4227ee,_0x315c6c){return client[_0x23ff('0xa')](_0x27d486,_0x76c39b)['then'](function(_0x3d376c){logger[_0x23ff('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x448485,_0x23ff('0xc'));logger[_0x23ff('0xd')](_0x23ff('0xe'),_0x448485,_0x23ff('0xc'),JSON[_0x23ff('0xf')](_0x3d376c));if(_0x3d376c['error']){if(_0x3d376c[_0x23ff('0x10')][_0x23ff('0x11')]===0x1f4){logger[_0x23ff('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x448485,_0x3d376c['error']['message']);return _0x315c6c(_0x3d376c[_0x23ff('0x10')]['message']);}logger[_0x23ff('0x10')](_0x23ff('0x12'),_0x448485,_0x3d376c[_0x23ff('0x10')][_0x23ff('0x13')]);return _0x4227ee(_0x3d376c[_0x23ff('0x10')][_0x23ff('0x13')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x448485,_0x23ff('0xc'));_0x4227ee(_0x3d376c[_0x23ff('0x14')][_0x23ff('0x13')]);}})[_0x23ff('0x15')](function(_0x537700){logger['error'](_0x23ff('0x12'),_0x448485,_0x537700);_0x315c6c(_0x537700);});});} \ No newline at end of file +var _0x83de=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x1630b0,_0x26e3c1){var _0x410ca3=function(_0x3bffb4){while(--_0x3bffb4){_0x1630b0['push'](_0x1630b0['shift']());}};_0x410ca3(++_0x26e3c1);}(_0x83de,0x1c0));var _0xe83d=function(_0x336f77,_0x54f2ea){_0x336f77=_0x336f77-0x0;var _0x591cd6=_0x83de[_0x336f77];return _0x591cd6;};'use strict';var _=require(_0xe83d('0x0'));var util=require('util');var moment=require(_0xe83d('0x1'));var BPromise=require(_0xe83d('0x2'));var rs=require(_0xe83d('0x3'));var fs=require('fs');var Redis=require(_0xe83d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe83d('0x5'));var logger=require('../../config/logger')(_0xe83d('0x6'));var config=require(_0xe83d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8bfcf9,_0x3b5a3f,_0x31807c){return new BPromise(function(_0x26349c,_0x495ea3){return client['request'](_0x8bfcf9,_0x31807c)['then'](function(_0x3c71d5){logger[_0xe83d('0x8')](_0xe83d('0x9'),_0x3b5a3f,_0xe83d('0xa'));logger[_0xe83d('0xb')](_0xe83d('0xc'),_0x3b5a3f,_0xe83d('0xa'),JSON[_0xe83d('0xd')](_0x3c71d5));if(_0x3c71d5[_0xe83d('0xe')]){if(_0x3c71d5['error']['code']===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3b5a3f,_0x3c71d5[_0xe83d('0xe')][_0xe83d('0xf')]);return _0x495ea3(_0x3c71d5[_0xe83d('0xe')][_0xe83d('0xf')]);}logger['error'](_0xe83d('0x9'),_0x3b5a3f,_0x3c71d5['error'][_0xe83d('0xf')]);return _0x26349c(_0x3c71d5['error'][_0xe83d('0xf')]);}else{logger[_0xe83d('0x8')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3b5a3f,_0xe83d('0xa'));_0x26349c(_0x3c71d5['result'][_0xe83d('0xf')]);}})[_0xe83d('0x10')](function(_0x3029ea){logger[_0xe83d('0xe')](_0xe83d('0x9'),_0x3b5a3f,_0x3029ea);_0x495ea3(_0x3029ea);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 874f331..a2b8cdf 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 _0x28ca=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x164914,_0x172059){var _0x48b8e1=function(_0x279dd1){while(--_0x279dd1){_0x164914['push'](_0x164914['shift']());}};_0x48b8e1(++_0x172059);}(_0x28ca,0xd0));var _0xa28c=function(_0x57bfad,_0x5126cc){_0x57bfad=_0x57bfad-0x0;var _0x5d8e2f=_0x28ca[_0x57bfad];return _0x5d8e2f;};'use strict';var multer=require(_0xa28c('0x0'));var util=require(_0xa28c('0x1'));var path=require(_0xa28c('0x2'));var timeout=require('connect-timeout');var express=require(_0xa28c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa28c('0x4'));var interaction=require(_0xa28c('0x5'));var config=require(_0xa28c('0x6'));var controller=require(_0xa28c('0x7'));router[_0xa28c('0x8')]('/',auth[_0xa28c('0x9')](),controller[_0xa28c('0xa')]);router[_0xa28c('0x8')](_0xa28c('0xb'),auth[_0xa28c('0x9')](),controller[_0xa28c('0xc')]);router[_0xa28c('0xd')]('/',auth[_0xa28c('0x9')](),controller[_0xa28c('0xe')]);router['put'](_0xa28c('0xb'),auth[_0xa28c('0x9')](),controller[_0xa28c('0xf')]);router[_0xa28c('0x10')](_0xa28c('0xb'),auth[_0xa28c('0x9')](),controller[_0xa28c('0x11')]);module[_0xa28c('0x12')]=router; \ No newline at end of file +var _0x15d3=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path'];(function(_0x17e675,_0x2b67ae){var _0x4cc4c4=function(_0xe24ebd){while(--_0xe24ebd){_0x17e675['push'](_0x17e675['shift']());}};_0x4cc4c4(++_0x2b67ae);}(_0x15d3,0xe2));var _0x315d=function(_0x480b46,_0x3c2f8b){_0x480b46=_0x480b46-0x0;var _0x509fe5=_0x15d3[_0x480b46];return _0x509fe5;};'use strict';var multer=require(_0x315d('0x0'));var util=require('util');var path=require(_0x315d('0x1'));var timeout=require(_0x315d('0x2'));var express=require(_0x315d('0x3'));var router=express[_0x315d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x315d('0x5'));var config=require(_0x315d('0x6'));var controller=require(_0x315d('0x7'));router[_0x315d('0x8')]('/',auth[_0x315d('0x9')](),controller[_0x315d('0xa')]);router[_0x315d('0x8')](_0x315d('0xb'),auth[_0x315d('0x9')](),controller[_0x315d('0xc')]);router[_0x315d('0xd')]('/',auth[_0x315d('0x9')](),controller[_0x315d('0xe')]);router[_0x315d('0xf')](_0x315d('0xb'),auth['isAuthenticated'](),controller[_0x315d('0x10')]);router[_0x315d('0x11')](_0x315d('0xb'),auth[_0x315d('0x9')](),controller['destroy']);module[_0x315d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9e2c9c4..b92b7d9 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 _0xf5c4=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x180a45,_0x4ddd14){var _0x34e92c=function(_0x504616){while(--_0x504616){_0x180a45['push'](_0x180a45['shift']());}};_0x34e92c(++_0x4ddd14);}(_0xf5c4,0x1b4));var _0x4f5c=function(_0x5d3906,_0x40035f){_0x5d3906=_0x5d3906-0x0;var _0x3d0cc6=_0xf5c4[_0x5d3906];return _0x3d0cc6;};'use strict';var Sequelize=require(_0x4f5c('0x0'));module[_0x4f5c('0x1')]={'type':{'type':Sequelize[_0x4f5c('0x2')](_0x4f5c('0x3'),_0x4f5c('0x4'),_0x4f5c('0x5'),_0x4f5c('0x6'),_0x4f5c('0x7')),'defaultValue':_0x4f5c('0x3')},'content':{'type':Sequelize[_0x4f5c('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x4f5c('0x4'),_0x4f5c('0x5'))},'keyContent':{'type':Sequelize[_0x4f5c('0x8')]},'idField':{'type':Sequelize[_0x4f5c('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4f5c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4f5c('0x8')]}}; \ No newline at end of file +var _0xa033=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x250ce1,_0xa2472e){var _0x574f68=function(_0x1c032e){while(--_0x1c032e){_0x250ce1['push'](_0x250ce1['shift']());}};_0x574f68(++_0xa2472e);}(_0xa033,0x163));var _0x3a03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa033[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a03('0x0'));module[_0x3a03('0x1')]={'type':{'type':Sequelize[_0x3a03('0x2')](_0x3a03('0x3'),_0x3a03('0x4'),_0x3a03('0x5'),'keyValue',_0x3a03('0x6')),'defaultValue':_0x3a03('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3a03('0x7')]},'keyType':{'type':Sequelize[_0x3a03('0x2')]('string',_0x3a03('0x4'),_0x3a03('0x5'))},'keyContent':{'type':Sequelize[_0x3a03('0x7')]},'idField':{'type':Sequelize[_0x3a03('0x7')]},'nameField':{'type':Sequelize[_0x3a03('0x7')]},'customField':{'type':Sequelize[_0x3a03('0x8')],'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 ee3b80e..761d65b 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 _0x8bac=['sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','reject','save','update','then','destroy','error','stack','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x313635,_0x1de2ef){var _0xf8c777=function(_0x3ac7fe){while(--_0x3ac7fe){_0x313635['push'](_0x313635['shift']());}};_0xf8c777(++_0x1de2ef);}(_0x8bac,0x1a1));var _0xc8ba=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x8bac[_0x421cf8];return _0x145c48;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc8ba('0x0'));var jsonpatch=require(_0xc8ba('0x1'));var rp=require(_0xc8ba('0x2'));var moment=require(_0xc8ba('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc8ba('0x4'));var util=require(_0xc8ba('0x5'));var path=require('path');var sox=require(_0xc8ba('0x6'));var csv=require(_0xc8ba('0x7'));var ejs=require(_0xc8ba('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc8ba('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc8ba('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc8ba('0x7'));var querystring=require(_0xc8ba('0xb'));var Papa=require(_0xc8ba('0xc'));var Redis=require(_0xc8ba('0xd'));var authService=require(_0xc8ba('0xe'));var qs=require(_0xc8ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8ba('0x10'))(_0xc8ba('0x11'));var utils=require(_0xc8ba('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc8ba('0x13'));var db=require(_0xc8ba('0x14'))['db'];function respondWithStatusCode(_0x394a64,_0x3415b4){_0x3415b4=_0x3415b4||0xcc;return function(_0x3542de){if(_0x3542de){return _0x394a64[_0xc8ba('0x15')](_0x3415b4);}return _0x394a64['status'](_0x3415b4)[_0xc8ba('0x16')]();};}function respondWithResult(_0x221b56,_0x3f8ed9){_0x3f8ed9=_0x3f8ed9||0xc8;return function(_0x3af984){if(_0x3af984){return _0x221b56['status'](_0x3f8ed9)['json'](_0x3af984);}};}function respondWithFilteredResult(_0x5a5dfa,_0x35bd57){return function(_0x210f24){if(_0x210f24){var _0x2fc004=typeof _0x35bd57[_0xc8ba('0x17')]===_0xc8ba('0x18')&&typeof _0x35bd57['limit']===_0xc8ba('0x18');var _0x13575e=_0x210f24[_0xc8ba('0x19')];var _0x5258ab=_0x2fc004?0x0:_0x35bd57['offset'];var _0x199e6e=_0x2fc004?_0x210f24[_0xc8ba('0x19')]:_0x35bd57[_0xc8ba('0x17')]+_0x35bd57[_0xc8ba('0x1a')];var _0x37413e;if(_0x199e6e>=_0x13575e){_0x199e6e=_0x13575e;_0x37413e=0xc8;}else{_0x37413e=0xce;}_0x5a5dfa[_0xc8ba('0x1b')](_0x37413e);return _0x5a5dfa[_0xc8ba('0x1c')](_0xc8ba('0x1d'),_0x5258ab+'-'+_0x199e6e+'/'+_0x13575e)[_0xc8ba('0x1e')](_0x210f24);}return null;};}function patchUpdates(_0x45f9d4){return function(_0x5c2e3a){try{jsonpatch['apply'](_0x5c2e3a,_0x45f9d4,!![]);}catch(_0x58f665){return BPromise[_0xc8ba('0x1f')](_0x58f665);}return _0x5c2e3a[_0xc8ba('0x20')]();};}function saveUpdates(_0x22117c,_0xb7801){return function(_0x466c66){if(_0x466c66){return _0x466c66[_0xc8ba('0x21')](_0x22117c)[_0xc8ba('0x22')](function(_0x5277d5){return _0x5277d5;});}return null;};}function removeEntity(_0x358245,_0x4467ce){return function(_0x169442){if(_0x169442){return _0x169442[_0xc8ba('0x23')]()[_0xc8ba('0x22')](function(){_0x358245[_0xc8ba('0x1b')](0xcc)[_0xc8ba('0x16')]();});}};}function handleEntityNotFound(_0x83e062,_0x31f9cc){return function(_0x44a64d){if(!_0x44a64d){_0x83e062['sendStatus'](0x194);}return _0x44a64d;};}function handleError(_0x2912df,_0x4bd5c0){_0x4bd5c0=_0x4bd5c0||0x1f4;return function(_0xcb3803){logger[_0xc8ba('0x24')](_0xcb3803[_0xc8ba('0x25')]);if(_0xcb3803['name']){delete _0xcb3803['name'];}_0x2912df[_0xc8ba('0x1b')](_0x4bd5c0)[_0xc8ba('0x26')](_0xcb3803);};}exports[_0xc8ba('0x27')]=function(_0x56de8e,_0x38c327){var _0x509282={},_0xa9d28={},_0x140ad0={'count':0x0,'rows':[]};var _0x337e92=_[_0xc8ba('0x28')](db[_0xc8ba('0x29')][_0xc8ba('0x2a')],function(_0x4276ff){return{'name':_0x4276ff[_0xc8ba('0x2b')],'type':_0x4276ff[_0xc8ba('0x2c')][_0xc8ba('0x2d')]};});_0xa9d28[_0xc8ba('0x2e')]=_[_0xc8ba('0x28')](_0x337e92,_0xc8ba('0x2f'));_0xa9d28[_0xc8ba('0x30')]=_[_0xc8ba('0x31')](_0x56de8e[_0xc8ba('0x30')]);_0xa9d28[_0xc8ba('0x32')]=_[_0xc8ba('0x33')](_0xa9d28[_0xc8ba('0x2e')],_0xa9d28['query']);_0x509282[_0xc8ba('0x34')]=_[_0xc8ba('0x33')](_0xa9d28[_0xc8ba('0x2e')],qs[_0xc8ba('0x35')](_0x56de8e[_0xc8ba('0x30')][_0xc8ba('0x35')]));_0x509282[_0xc8ba('0x34')]=_0x509282[_0xc8ba('0x34')][_0xc8ba('0x36')]?_0x509282['attributes']:_0xa9d28[_0xc8ba('0x2e')];if(!_0x56de8e[_0xc8ba('0x30')]['hasOwnProperty'](_0xc8ba('0x37'))){_0x509282['limit']=qs[_0xc8ba('0x1a')](_0x56de8e['query'][_0xc8ba('0x1a')]);_0x509282['offset']=qs['offset'](_0x56de8e[_0xc8ba('0x30')][_0xc8ba('0x17')]);}_0x509282[_0xc8ba('0x38')]=qs['sort'](_0x56de8e[_0xc8ba('0x30')][_0xc8ba('0x39')]);_0x509282[_0xc8ba('0x3a')]=qs[_0xc8ba('0x32')](_[_0xc8ba('0x3b')](_0x56de8e[_0xc8ba('0x30')],_0xa9d28['filters']),_0x337e92);if(_0x56de8e[_0xc8ba('0x30')][_0xc8ba('0x3c')]){_0x509282[_0xc8ba('0x3a')]=_[_0xc8ba('0x3d')](_0x509282[_0xc8ba('0x3a')],{'$or':_[_0xc8ba('0x28')](_0x337e92,function(_0x4b1198){if(_0x4b1198['type']!==_0xc8ba('0x3e')){var _0x3ec1c1={};_0x3ec1c1[_0x4b1198[_0xc8ba('0x2f')]]={'$like':'%'+_0x56de8e[_0xc8ba('0x30')][_0xc8ba('0x3c')]+'%'};return _0x3ec1c1;}})});}_0x509282=_['merge']({},_0x509282,_0x56de8e[_0xc8ba('0x3f')]);var _0x3927be={'where':_0x509282[_0xc8ba('0x3a')]};return db[_0xc8ba('0x29')][_0xc8ba('0x19')](_0x3927be)[_0xc8ba('0x22')](function(_0x5ddbd8){_0x140ad0[_0xc8ba('0x19')]=_0x5ddbd8;if(_0x56de8e['query']['includeAll']){_0x509282[_0xc8ba('0x40')]=[{'all':!![]}];}return db[_0xc8ba('0x29')][_0xc8ba('0x41')](_0x509282);})[_0xc8ba('0x22')](function(_0x4f124a){_0x140ad0[_0xc8ba('0x42')]=_0x4f124a;return _0x140ad0;})['then'](respondWithFilteredResult(_0x38c327,_0x509282))[_0xc8ba('0x43')](handleError(_0x38c327,null));};exports[_0xc8ba('0x44')]=function(_0x5a2ec5,_0x249041){var _0x2ce42a={'raw':!![],'where':{'id':_0x5a2ec5[_0xc8ba('0x45')]['id']}},_0x5970b8={};_0x5970b8[_0xc8ba('0x2e')]=_[_0xc8ba('0x31')](db[_0xc8ba('0x29')][_0xc8ba('0x2a')]);_0x5970b8[_0xc8ba('0x30')]=_[_0xc8ba('0x31')](_0x5a2ec5[_0xc8ba('0x30')]);_0x5970b8[_0xc8ba('0x32')]=_[_0xc8ba('0x33')](_0x5970b8['model'],_0x5970b8['query']);_0x2ce42a[_0xc8ba('0x34')]=_['intersection'](_0x5970b8[_0xc8ba('0x2e')],qs['fields'](_0x5a2ec5[_0xc8ba('0x30')]['fields']));_0x2ce42a['attributes']=_0x2ce42a[_0xc8ba('0x34')][_0xc8ba('0x36')]?_0x2ce42a['attributes']:_0x5970b8[_0xc8ba('0x2e')];if(_0x5a2ec5[_0xc8ba('0x30')]['includeAll']){_0x2ce42a['include']=[{'all':!![]}];}_0x2ce42a=_[_0xc8ba('0x3d')]({},_0x2ce42a,_0x5a2ec5[_0xc8ba('0x3f')]);return db[_0xc8ba('0x29')][_0xc8ba('0x46')](_0x2ce42a)[_0xc8ba('0x22')](handleEntityNotFound(_0x249041,null))['then'](respondWithResult(_0x249041,null))[_0xc8ba('0x43')](handleError(_0x249041,null));};exports[_0xc8ba('0x47')]=function(_0x20b073,_0x405284){return db['SugarcrmField'][_0xc8ba('0x47')](_0x20b073[_0xc8ba('0x48')],{})[_0xc8ba('0x22')](respondWithResult(_0x405284,0xc9))[_0xc8ba('0x43')](handleError(_0x405284,null));};exports[_0xc8ba('0x21')]=function(_0x3e56e6,_0x37da26){if(_0x3e56e6[_0xc8ba('0x48')]['id']){delete _0x3e56e6['body']['id'];}return db[_0xc8ba('0x29')][_0xc8ba('0x46')]({'where':{'id':_0x3e56e6[_0xc8ba('0x45')]['id']}})[_0xc8ba('0x22')](handleEntityNotFound(_0x37da26,null))[_0xc8ba('0x22')](saveUpdates(_0x3e56e6[_0xc8ba('0x48')],null))[_0xc8ba('0x22')](respondWithResult(_0x37da26,null))[_0xc8ba('0x43')](handleError(_0x37da26,null));};exports[_0xc8ba('0x23')]=function(_0xb618ab,_0xd54c15){return db['SugarcrmField'][_0xc8ba('0x46')]({'where':{'id':_0xb618ab[_0xc8ba('0x45')]['id']}})['then'](handleEntityNotFound(_0xd54c15,null))['then'](removeEntity(_0xd54c15,null))['catch'](handleError(_0xd54c15,null));}; \ No newline at end of file +var _0x2ffb=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','intersection','includeAll','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x2ffb,0x83));var _0xb2ff=function(_0x4fc4e7,_0x16bfc4){_0x4fc4e7=_0x4fc4e7-0x0;var _0x297133=_0x2ffb[_0x4fc4e7];return _0x297133;};'use strict';var emlformat=require(_0xb2ff('0x0'));var rimraf=require(_0xb2ff('0x1'));var zipdir=require(_0xb2ff('0x2'));var jsonpatch=require(_0xb2ff('0x3'));var rp=require(_0xb2ff('0x4'));var moment=require(_0xb2ff('0x5'));var BPromise=require(_0xb2ff('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb2ff('0x7'));var csv=require('to-csv');var ejs=require(_0xb2ff('0x8'));var fs=require('fs');var fs_extra=require(_0xb2ff('0x9'));var _=require(_0xb2ff('0xa'));var squel=require('squel');var crypto=require(_0xb2ff('0xb'));var jsforce=require(_0xb2ff('0xc'));var deskjs=require(_0xb2ff('0xd'));var toCsv=require(_0xb2ff('0xe'));var querystring=require('querystring');var Papa=require(_0xb2ff('0xf'));var Redis=require(_0xb2ff('0x10'));var authService=require(_0xb2ff('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb2ff('0x12'));var hardwareService=require(_0xb2ff('0x13'));var logger=require(_0xb2ff('0x14'))(_0xb2ff('0x15'));var utils=require(_0xb2ff('0x16'));var config=require(_0xb2ff('0x17'));var licenseUtil=require(_0xb2ff('0x18'));var db=require(_0xb2ff('0x19'))['db'];function respondWithStatusCode(_0x3a237f,_0x46db5a){_0x46db5a=_0x46db5a||0xcc;return function(_0x8bac8){if(_0x8bac8){return _0x3a237f[_0xb2ff('0x1a')](_0x46db5a);}return _0x3a237f[_0xb2ff('0x1b')](_0x46db5a)['end']();};}function respondWithResult(_0x3c991e,_0x42b575){_0x42b575=_0x42b575||0xc8;return function(_0x45c9f2){if(_0x45c9f2){return _0x3c991e[_0xb2ff('0x1b')](_0x42b575)[_0xb2ff('0x1c')](_0x45c9f2);}};}function respondWithFilteredResult(_0x58ce1a,_0x29a599){return function(_0x839922){if(_0x839922){var _0x5779d9=typeof _0x29a599[_0xb2ff('0x1d')]===_0xb2ff('0x1e')&&typeof _0x29a599[_0xb2ff('0x1f')]===_0xb2ff('0x1e');var _0x7f0420=_0x839922['count'];var _0x4112c3=_0x5779d9?0x0:_0x29a599[_0xb2ff('0x1d')];var _0x400fd4=_0x5779d9?_0x839922[_0xb2ff('0x20')]:_0x29a599[_0xb2ff('0x1d')]+_0x29a599[_0xb2ff('0x1f')];var _0x1cb456;if(_0x400fd4>=_0x7f0420){_0x400fd4=_0x7f0420;_0x1cb456=0xc8;}else{_0x1cb456=0xce;}_0x58ce1a[_0xb2ff('0x1b')](_0x1cb456);return _0x58ce1a[_0xb2ff('0x21')](_0xb2ff('0x22'),_0x4112c3+'-'+_0x400fd4+'/'+_0x7f0420)['json'](_0x839922);}return null;};}function patchUpdates(_0x21f804){return function(_0x5d13e7){try{jsonpatch[_0xb2ff('0x23')](_0x5d13e7,_0x21f804,!![]);}catch(_0x1d253f){return BPromise[_0xb2ff('0x24')](_0x1d253f);}return _0x5d13e7[_0xb2ff('0x25')]();};}function saveUpdates(_0x4f0559,_0x43f43e){return function(_0x274b80){if(_0x274b80){return _0x274b80[_0xb2ff('0x26')](_0x4f0559)[_0xb2ff('0x27')](function(_0x3224c9){return _0x3224c9;});}return null;};}function removeEntity(_0x52fa5c,_0x20ea1e){return function(_0x41c278){if(_0x41c278){return _0x41c278[_0xb2ff('0x28')]()[_0xb2ff('0x27')](function(){_0x52fa5c[_0xb2ff('0x1b')](0xcc)[_0xb2ff('0x29')]();});}};}function handleEntityNotFound(_0x87b546,_0x15aa1f){return function(_0x141dfe){if(!_0x141dfe){_0x87b546['sendStatus'](0x194);}return _0x141dfe;};}function handleError(_0x38266b,_0x548bfa){_0x548bfa=_0x548bfa||0x1f4;return function(_0x4b44ea){logger['error'](_0x4b44ea['stack']);if(_0x4b44ea[_0xb2ff('0x2a')]){delete _0x4b44ea[_0xb2ff('0x2a')];}_0x38266b['status'](_0x548bfa)[_0xb2ff('0x2b')](_0x4b44ea);};}exports[_0xb2ff('0x2c')]=function(_0x1a9af3,_0x4e513d){var _0x40ed59={},_0x41d9f9={},_0x223c54={'count':0x0,'rows':[]};var _0x317824=_[_0xb2ff('0x2d')](db[_0xb2ff('0x2e')]['rawAttributes'],function(_0x482bde){return{'name':_0x482bde[_0xb2ff('0x2f')],'type':_0x482bde[_0xb2ff('0x30')][_0xb2ff('0x31')]};});_0x41d9f9[_0xb2ff('0x32')]=_[_0xb2ff('0x2d')](_0x317824,_0xb2ff('0x2a'));_0x41d9f9['query']=_['keys'](_0x1a9af3['query']);_0x41d9f9['filters']=_['intersection'](_0x41d9f9['model'],_0x41d9f9[_0xb2ff('0x33')]);_0x40ed59['attributes']=_['intersection'](_0x41d9f9[_0xb2ff('0x32')],qs[_0xb2ff('0x34')](_0x1a9af3[_0xb2ff('0x33')][_0xb2ff('0x34')]));_0x40ed59[_0xb2ff('0x35')]=_0x40ed59[_0xb2ff('0x35')][_0xb2ff('0x36')]?_0x40ed59[_0xb2ff('0x35')]:_0x41d9f9['model'];if(!_0x1a9af3[_0xb2ff('0x33')][_0xb2ff('0x37')]('nolimit')){_0x40ed59[_0xb2ff('0x1f')]=qs['limit'](_0x1a9af3['query']['limit']);_0x40ed59[_0xb2ff('0x1d')]=qs[_0xb2ff('0x1d')](_0x1a9af3[_0xb2ff('0x33')][_0xb2ff('0x1d')]);}_0x40ed59['order']=qs[_0xb2ff('0x38')](_0x1a9af3[_0xb2ff('0x33')][_0xb2ff('0x38')]);_0x40ed59[_0xb2ff('0x39')]=qs[_0xb2ff('0x3a')](_[_0xb2ff('0x3b')](_0x1a9af3[_0xb2ff('0x33')],_0x41d9f9[_0xb2ff('0x3a')]),_0x317824);if(_0x1a9af3[_0xb2ff('0x33')][_0xb2ff('0x3c')]){_0x40ed59['where']=_[_0xb2ff('0x3d')](_0x40ed59[_0xb2ff('0x39')],{'$or':_[_0xb2ff('0x2d')](_0x317824,function(_0x16805a){if(_0x16805a[_0xb2ff('0x30')]!==_0xb2ff('0x3e')){var _0x23524a={};_0x23524a[_0x16805a[_0xb2ff('0x2a')]]={'$like':'%'+_0x1a9af3[_0xb2ff('0x33')]['filter']+'%'};return _0x23524a;}})});}_0x40ed59=_[_0xb2ff('0x3d')]({},_0x40ed59,_0x1a9af3[_0xb2ff('0x3f')]);var _0x7759d={'where':_0x40ed59[_0xb2ff('0x39')]};return db['SugarcrmField']['count'](_0x7759d)[_0xb2ff('0x27')](function(_0x596a45){_0x223c54['count']=_0x596a45;if(_0x1a9af3[_0xb2ff('0x33')]['includeAll']){_0x40ed59[_0xb2ff('0x40')]=[{'all':!![]}];}return db[_0xb2ff('0x2e')]['findAll'](_0x40ed59);})['then'](function(_0x540901){_0x223c54[_0xb2ff('0x41')]=_0x540901;return _0x223c54;})[_0xb2ff('0x27')](respondWithFilteredResult(_0x4e513d,_0x40ed59))[_0xb2ff('0x42')](handleError(_0x4e513d,null));};exports[_0xb2ff('0x43')]=function(_0x183844,_0x3538c2){var _0x580970={'raw':!![],'where':{'id':_0x183844['params']['id']}},_0x5af99a={};_0x5af99a[_0xb2ff('0x32')]=_[_0xb2ff('0x44')](db['SugarcrmField']['rawAttributes']);_0x5af99a['query']=_[_0xb2ff('0x44')](_0x183844[_0xb2ff('0x33')]);_0x5af99a[_0xb2ff('0x3a')]=_['intersection'](_0x5af99a[_0xb2ff('0x32')],_0x5af99a[_0xb2ff('0x33')]);_0x580970[_0xb2ff('0x35')]=_[_0xb2ff('0x45')](_0x5af99a[_0xb2ff('0x32')],qs[_0xb2ff('0x34')](_0x183844[_0xb2ff('0x33')]['fields']));_0x580970[_0xb2ff('0x35')]=_0x580970[_0xb2ff('0x35')][_0xb2ff('0x36')]?_0x580970[_0xb2ff('0x35')]:_0x5af99a['model'];if(_0x183844['query'][_0xb2ff('0x46')]){_0x580970[_0xb2ff('0x40')]=[{'all':!![]}];}_0x580970=_[_0xb2ff('0x3d')]({},_0x580970,_0x183844[_0xb2ff('0x3f')]);return db[_0xb2ff('0x2e')]['find'](_0x580970)[_0xb2ff('0x27')](handleEntityNotFound(_0x3538c2,null))[_0xb2ff('0x27')](respondWithResult(_0x3538c2,null))[_0xb2ff('0x42')](handleError(_0x3538c2,null));};exports[_0xb2ff('0x47')]=function(_0x5eea2d,_0x3a0d45){return db[_0xb2ff('0x2e')][_0xb2ff('0x47')](_0x5eea2d['body'],{})[_0xb2ff('0x27')](respondWithResult(_0x3a0d45,0xc9))['catch'](handleError(_0x3a0d45,null));};exports['update']=function(_0x370845,_0x2eae65){if(_0x370845[_0xb2ff('0x48')]['id']){delete _0x370845[_0xb2ff('0x48')]['id'];}return db[_0xb2ff('0x2e')][_0xb2ff('0x49')]({'where':{'id':_0x370845[_0xb2ff('0x4a')]['id']}})[_0xb2ff('0x27')](handleEntityNotFound(_0x2eae65,null))[_0xb2ff('0x27')](saveUpdates(_0x370845[_0xb2ff('0x48')],null))[_0xb2ff('0x27')](respondWithResult(_0x2eae65,null))[_0xb2ff('0x42')](handleError(_0x2eae65,null));};exports[_0xb2ff('0x28')]=function(_0x316bd9,_0x5cb11c){return db[_0xb2ff('0x2e')]['find']({'where':{'id':_0x316bd9[_0xb2ff('0x4a')]['id']}})[_0xb2ff('0x27')](handleEntityNotFound(_0x5cb11c,null))[_0xb2ff('0x27')](removeEntity(_0x5cb11c,null))[_0xb2ff('0x42')](handleError(_0x5cb11c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b1a8a5e..bfbb9ee 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 _0xb10b=['api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0xb10b,0xaa));var _0xbb10=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0xb10b[_0x16bb4b];return _0x8aeb84;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbb10('0x0'));var moment=require(_0xbb10('0x1'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb10('0x3'));var config=require(_0xbb10('0x4'));var attributes=require(_0xbb10('0x5'));module['exports']=function(_0x144bd7,_0x28197d){return _0x144bd7['define']('SugarcrmField',attributes,{'tableName':_0xbb10('0x6'),'paranoid':![],'indexes':[{'name':_0xbb10('0x7'),'fields':[_0xbb10('0x8'),_0xbb10('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfe04=['../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5f002d,_0x1b9dc8){var _0x544598=function(_0x929264){while(--_0x929264){_0x5f002d['push'](_0x5f002d['shift']());}};_0x544598(++_0x1b9dc8);}(_0xfe04,0xae));var _0x4fe0=function(_0x3a28e5,_0x47c7f3){_0x3a28e5=_0x3a28e5-0x0;var _0x162c1f=_0xfe04[_0x3a28e5];return _0x162c1f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4fe0('0x0'));var moment=require(_0x4fe0('0x1'));var BPromise=require(_0x4fe0('0x2'));var rp=require(_0x4fe0('0x3'));var fs=require('fs');var path=require(_0x4fe0('0x4'));var rimraf=require(_0x4fe0('0x5'));var config=require(_0x4fe0('0x6'));var attributes=require(_0x4fe0('0x7'));module['exports']=function(_0x18008f,_0x56727a){return _0x18008f['define']('SugarcrmField',attributes,{'tableName':_0x4fe0('0x8'),'paranoid':![],'indexes':[{'name':_0x4fe0('0x9'),'fields':[_0x4fe0('0xa'),_0x4fe0('0xb')],'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 b05c6b2..4302498 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 _0xcc69=['client','request','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x256336,_0x3d0356){var _0x25009a=function(_0x51aad4){while(--_0x51aad4){_0x256336['push'](_0x256336['shift']());}};_0x25009a(++_0x3d0356);}(_0xcc69,0x15b));var _0x9cc6=function(_0x2b22a6,_0x4194c8){_0x2b22a6=_0x2b22a6-0x0;var _0x359277=_0xcc69[_0x2b22a6];return _0x359277;};'use strict';var _=require(_0x9cc6('0x0'));var util=require('util');var moment=require(_0x9cc6('0x1'));var BPromise=require(_0x9cc6('0x2'));var rs=require(_0x9cc6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cc6('0x4'))['db'];var utils=require(_0x9cc6('0x5'));var logger=require(_0x9cc6('0x6'))(_0x9cc6('0x7'));var config=require(_0x9cc6('0x8'));var jayson=require(_0x9cc6('0x9'));var client=jayson[_0x9cc6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c8a2b,_0x13ecb4,_0x2a3f7d){return new BPromise(function(_0xf0a165,_0x18d0e1){return client[_0x9cc6('0xb')](_0x1c8a2b,_0x2a3f7d)[_0x9cc6('0xc')](function(_0x35e63a){logger['info'](_0x9cc6('0xd'),_0x13ecb4,'request\x20sent');logger[_0x9cc6('0xe')](_0x9cc6('0xf'),_0x13ecb4,_0x9cc6('0x10'),JSON['stringify'](_0x35e63a));if(_0x35e63a['error']){if(_0x35e63a[_0x9cc6('0x11')][_0x9cc6('0x12')]===0x1f4){logger[_0x9cc6('0x11')](_0x9cc6('0xd'),_0x13ecb4,_0x35e63a[_0x9cc6('0x11')][_0x9cc6('0x13')]);return _0x18d0e1(_0x35e63a[_0x9cc6('0x11')][_0x9cc6('0x13')]);}logger[_0x9cc6('0x11')](_0x9cc6('0xd'),_0x13ecb4,_0x35e63a[_0x9cc6('0x11')]['message']);return _0xf0a165(_0x35e63a[_0x9cc6('0x11')]['message']);}else{logger['info'](_0x9cc6('0xd'),_0x13ecb4,_0x9cc6('0x10'));_0xf0a165(_0x35e63a[_0x9cc6('0x14')]['message']);}})['catch'](function(_0x437501){logger[_0x9cc6('0x11')](_0x9cc6('0xd'),_0x13ecb4,_0x437501);_0x18d0e1(_0x437501);});});} \ No newline at end of file +var _0xe96f=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x9fc1a3,_0xc0e081){var _0x1e0cdf=function(_0x37daec){while(--_0x37daec){_0x9fc1a3['push'](_0x9fc1a3['shift']());}};_0x1e0cdf(++_0xc0e081);}(_0xe96f,0x1bc));var _0xfe96=function(_0x1f8dc4,_0x2b62de){_0x1f8dc4=_0x1f8dc4-0x0;var _0x173987=_0xe96f[_0x1f8dc4];return _0x173987;};'use strict';var _=require(_0xfe96('0x0'));var util=require('util');var moment=require(_0xfe96('0x1'));var BPromise=require(_0xfe96('0x2'));var rs=require(_0xfe96('0x3'));var fs=require('fs');var Redis=require(_0xfe96('0x4'));var db=require(_0xfe96('0x5'))['db'];var utils=require(_0xfe96('0x6'));var logger=require(_0xfe96('0x7'))(_0xfe96('0x8'));var config=require(_0xfe96('0x9'));var jayson=require(_0xfe96('0xa'));var client=jayson[_0xfe96('0xb')][_0xfe96('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x588d22,_0x28159e,_0x68b34f){return new BPromise(function(_0x566e18,_0x5e7d6d){return client[_0xfe96('0xd')](_0x588d22,_0x68b34f)[_0xfe96('0xe')](function(_0x36d20b){logger['info'](_0xfe96('0xf'),_0x28159e,'request\x20sent');logger[_0xfe96('0x10')](_0xfe96('0x11'),_0x28159e,_0xfe96('0x12'),JSON[_0xfe96('0x13')](_0x36d20b));if(_0x36d20b['error']){if(_0x36d20b[_0xfe96('0x14')][_0xfe96('0x15')]===0x1f4){logger[_0xfe96('0x14')](_0xfe96('0xf'),_0x28159e,_0x36d20b[_0xfe96('0x14')][_0xfe96('0x16')]);return _0x5e7d6d(_0x36d20b['error'][_0xfe96('0x16')]);}logger['error'](_0xfe96('0xf'),_0x28159e,_0x36d20b[_0xfe96('0x14')]['message']);return _0x566e18(_0x36d20b[_0xfe96('0x14')][_0xfe96('0x16')]);}else{logger[_0xfe96('0x17')](_0xfe96('0xf'),_0x28159e,_0xfe96('0x12'));_0x566e18(_0x36d20b[_0xfe96('0x18')]['message']);}})[_0xfe96('0x19')](function(_0x1909ab){logger[_0xfe96('0x14')](_0xfe96('0xf'),_0x28159e,_0x1909ab);_0x5e7d6d(_0x1909ab);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 85f2597..f2fc771 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 _0xcb06=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcb06,0x127));var _0x6cb0=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0xcb06[_0x483d2a];return _0x5ba5d5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6cb0('0x0'));var express=require('express');var router=express[_0x6cb0('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x6cb0('0x3'));var controller=require('./intVtigerAccount.controller');router[_0x6cb0('0x4')]('/',auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x6')]);router[_0x6cb0('0x4')](_0x6cb0('0x7'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x8')]);router['get'](_0x6cb0('0x9'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xa')]);router[_0x6cb0('0x4')](_0x6cb0('0xb'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xc')]);router[_0x6cb0('0xd')]('/',auth[_0x6cb0('0x5')](),controller[_0x6cb0('0xe')]);router[_0x6cb0('0xd')](_0x6cb0('0x9'),auth[_0x6cb0('0x5')](),controller['addConfiguration']);router[_0x6cb0('0xf')](_0x6cb0('0x7'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x10')]);router['delete'](_0x6cb0('0x7'),auth[_0x6cb0('0x5')](),controller[_0x6cb0('0x11')]);module[_0x6cb0('0x12')]=router; \ No newline at end of file +var _0xd1d4=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer'];(function(_0x39bc1b,_0x4e2c4f){var _0x2fd4e5=function(_0x1a36d4){while(--_0x1a36d4){_0x39bc1b['push'](_0x39bc1b['shift']());}};_0x2fd4e5(++_0x4e2c4f);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xd1d4[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require(_0x4d1d('0x0'));var util=require(_0x4d1d('0x1'));var path=require('path');var timeout=require(_0x4d1d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d1d('0x3'));var auth=require(_0x4d1d('0x4'));var interaction=require(_0x4d1d('0x5'));var config=require(_0x4d1d('0x6'));var controller=require(_0x4d1d('0x7'));router[_0x4d1d('0x8')]('/',auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xa')]);router[_0x4d1d('0x8')](_0x4d1d('0xb'),auth[_0x4d1d('0x9')](),controller['show']);router['get'](_0x4d1d('0xc'),auth[_0x4d1d('0x9')](),controller['getConfigurations']);router[_0x4d1d('0x8')](_0x4d1d('0xd'),auth[_0x4d1d('0x9')](),controller[_0x4d1d('0xe')]);router[_0x4d1d('0xf')]('/',auth[_0x4d1d('0x9')](),controller[_0x4d1d('0x10')]);router[_0x4d1d('0xf')](_0x4d1d('0xc'),auth[_0x4d1d('0x9')](),controller[_0x4d1d('0x11')]);router[_0x4d1d('0x12')](_0x4d1d('0xb'),auth['isAuthenticated'](),controller[_0x4d1d('0x13')]);router[_0x4d1d('0x14')](_0x4d1d('0xb'),auth[_0x4d1d('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 121f27d..825255f 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 _0xc56c=['sequelize','exports','STRING'];(function(_0x4aca6e,_0x3f4668){var _0x3afa54=function(_0x2fc83f){while(--_0x2fc83f){_0x4aca6e['push'](_0x4aca6e['shift']());}};_0x3afa54(++_0x3f4668);}(_0xc56c,0x1e9));var _0xcc56=function(_0x33afe6,_0xf4c0ce){_0x33afe6=_0x33afe6-0x0;var _0xcf5089=_0xc56c[_0x33afe6];return _0xcf5089;};'use strict';var Sequelize=require(_0xcc56('0x0'));module[_0xcc56('0x1')]={'name':{'type':Sequelize[_0xcc56('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcc56('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xcc56('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xcc56('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xcc56('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7f5c=['exports','STRING','sequelize'];(function(_0x52a839,_0x593287){var _0x284108=function(_0x5a4fc6){while(--_0x5a4fc6){_0x52a839['push'](_0x52a839['shift']());}};_0x284108(++_0x593287);}(_0x7f5c,0xe9));var _0xc7f5=function(_0x51abca,_0x21098c){_0x51abca=_0x51abca-0x0;var _0x447d48=_0x7f5c[_0x51abca];return _0x447d48;};'use strict';var Sequelize=require(_0xc7f5('0x0'));module[_0xc7f5('0x1')]={'name':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc7f5('0x2')]},'username':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xc7f5('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5997e89..aa6bd8b 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 _0x4794=['username','description','accessKey','remoteUri','slice','lastIndexOf','GET','getchallenge','success','login','result','token','describe','autogenerated','owner','remove','editable','label','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','update','then','destroy','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','find','catch','create','body','params','findOne','VtigerConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5'];(function(_0xf592a3,_0x5386bf){var _0x4d3e4a=function(_0x536622){while(--_0x536622){_0xf592a3['push'](_0xf592a3['shift']());}};_0x4d3e4a(++_0x5386bf);}(_0x4794,0xf8));var _0x4479=function(_0xbee4e8,_0x41ee25){_0xbee4e8=_0xbee4e8-0x0;var _0x4ca1ea=_0x4794[_0xbee4e8];return _0x4ca1ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4479('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4479('0x1'));var rp=require(_0x4479('0x2'));var moment=require(_0x4479('0x3'));var BPromise=require(_0x4479('0x4'));var Mustache=require(_0x4479('0x5'));var util=require(_0x4479('0x6'));var path=require('path');var sox=require(_0x4479('0x7'));var csv=require(_0x4479('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4479('0x9'));var squel=require('squel');var crypto=require(_0x4479('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4479('0x8'));var querystring=require(_0x4479('0xb'));var Papa=require(_0x4479('0xc'));var Redis=require(_0x4479('0xd'));var authService=require(_0x4479('0xe'));var qs=require(_0x4479('0xf'));var as=require(_0x4479('0x10'));var hardwareService=require(_0x4479('0x11'));var logger=require('../../config/logger')(_0x4479('0x12'));var utils=require('../../config/utils');var config=require(_0x4479('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4479('0x14'))['db'];var integrations=require(_0x4479('0x15'));function respondWithStatusCode(_0x52e253,_0x2b19a7){_0x2b19a7=_0x2b19a7||0xcc;return function(_0x1c11bd){if(_0x1c11bd){return _0x52e253[_0x4479('0x16')](_0x2b19a7);}return _0x52e253[_0x4479('0x17')](_0x2b19a7)[_0x4479('0x18')]();};}function respondWithResult(_0x12676c,_0x2ceb3f){_0x2ceb3f=_0x2ceb3f||0xc8;return function(_0x164477){if(_0x164477){return _0x12676c[_0x4479('0x17')](_0x2ceb3f)[_0x4479('0x19')](_0x164477);}};}function respondWithFilteredResult(_0x3694ff,_0x4f91ac){return function(_0x21ae63){if(_0x21ae63){var _0x15a058=typeof _0x4f91ac[_0x4479('0x1a')]===_0x4479('0x1b')&&typeof _0x4f91ac['limit']===_0x4479('0x1b');var _0x5e5576=_0x21ae63[_0x4479('0x1c')];var _0xb40f3f=_0x15a058?0x0:_0x4f91ac[_0x4479('0x1a')];var _0x216ff1=_0x15a058?_0x21ae63[_0x4479('0x1c')]:_0x4f91ac[_0x4479('0x1a')]+_0x4f91ac['limit'];var _0x3baf0e;if(_0x216ff1>=_0x5e5576){_0x216ff1=_0x5e5576;_0x3baf0e=0xc8;}else{_0x3baf0e=0xce;}_0x3694ff[_0x4479('0x17')](_0x3baf0e);return _0x3694ff[_0x4479('0x1d')]('Content-Range',_0xb40f3f+'-'+_0x216ff1+'/'+_0x5e5576)[_0x4479('0x19')](_0x21ae63);}return null;};}function patchUpdates(_0x281487){return function(_0x3b260d){try{jsonpatch[_0x4479('0x1e')](_0x3b260d,_0x281487,!![]);}catch(_0x45d8e5){return BPromise[_0x4479('0x1f')](_0x45d8e5);}return _0x3b260d['save']();};}function saveUpdates(_0x2373e2,_0x32a0dd){return function(_0x185338){if(_0x185338){return _0x185338[_0x4479('0x20')](_0x2373e2)[_0x4479('0x21')](function(_0x488591){return _0x488591;});}return null;};}function removeEntity(_0x5ecd8d,_0x3aade5){return function(_0x3db566){if(_0x3db566){return _0x3db566[_0x4479('0x22')]()['then'](function(){_0x5ecd8d[_0x4479('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5443f0,_0x40519b){return function(_0x2c7e77){if(!_0x2c7e77){_0x5443f0[_0x4479('0x16')](0x194);}return _0x2c7e77;};}function handleError(_0x172a73,_0x40e3ec){_0x40e3ec=_0x40e3ec||0x1f4;return function(_0x2b4c67){logger['error'](_0x2b4c67['stack']);if(_0x2b4c67[_0x4479('0x23')]){delete _0x2b4c67[_0x4479('0x23')];}_0x172a73[_0x4479('0x17')](_0x40e3ec)[_0x4479('0x24')](_0x2b4c67);};}exports[_0x4479('0x25')]=function(_0x269d50,_0x20ac8a){var _0x5cb9b9={},_0x3cd653={},_0x283f14={'count':0x0,'rows':[]};var _0x578be9=_['map'](db[_0x4479('0x26')][_0x4479('0x27')],function(_0x428ec2){return{'name':_0x428ec2[_0x4479('0x28')],'type':_0x428ec2[_0x4479('0x29')]['key']};});_0x3cd653[_0x4479('0x2a')]=_[_0x4479('0x2b')](_0x578be9,_0x4479('0x23'));_0x3cd653[_0x4479('0x2c')]=_[_0x4479('0x2d')](_0x269d50[_0x4479('0x2c')]);_0x3cd653[_0x4479('0x2e')]=_[_0x4479('0x2f')](_0x3cd653['model'],_0x3cd653[_0x4479('0x2c')]);_0x5cb9b9[_0x4479('0x30')]=_[_0x4479('0x2f')](_0x3cd653[_0x4479('0x2a')],qs[_0x4479('0x31')](_0x269d50[_0x4479('0x2c')][_0x4479('0x31')]));_0x5cb9b9['attributes']=_0x5cb9b9[_0x4479('0x30')][_0x4479('0x32')]?_0x5cb9b9[_0x4479('0x30')]:_0x3cd653['model'];if(!_0x269d50['query']['hasOwnProperty'](_0x4479('0x33'))){_0x5cb9b9['limit']=qs[_0x4479('0x34')](_0x269d50[_0x4479('0x2c')][_0x4479('0x34')]);_0x5cb9b9['offset']=qs[_0x4479('0x1a')](_0x269d50['query'][_0x4479('0x1a')]);}_0x5cb9b9[_0x4479('0x35')]=qs[_0x4479('0x36')](_0x269d50[_0x4479('0x2c')][_0x4479('0x36')]);_0x5cb9b9[_0x4479('0x37')]=qs['filters'](_[_0x4479('0x38')](_0x269d50['query'],_0x3cd653[_0x4479('0x2e')]),_0x578be9);if(_0x269d50['query'][_0x4479('0x39')]){_0x5cb9b9[_0x4479('0x37')]=_['merge'](_0x5cb9b9[_0x4479('0x37')],{'$or':_[_0x4479('0x2b')](_0x578be9,function(_0x466a77){if(_0x466a77['type']!==_0x4479('0x3a')){var _0x5cf895={};_0x5cf895[_0x466a77[_0x4479('0x23')]]={'$like':'%'+_0x269d50[_0x4479('0x2c')][_0x4479('0x39')]+'%'};return _0x5cf895;}})});}_0x5cb9b9=_[_0x4479('0x3b')]({},_0x5cb9b9,_0x269d50[_0x4479('0x3c')]);var _0x1ee796={'where':_0x5cb9b9[_0x4479('0x37')]};return db[_0x4479('0x26')][_0x4479('0x1c')](_0x1ee796)[_0x4479('0x21')](function(_0x9efc38){_0x283f14['count']=_0x9efc38;if(_0x269d50[_0x4479('0x2c')][_0x4479('0x3d')]){_0x5cb9b9[_0x4479('0x3e')]=[{'all':!![]}];}return db[_0x4479('0x26')][_0x4479('0x3f')](_0x5cb9b9);})[_0x4479('0x21')](function(_0x1cd500){_0x283f14[_0x4479('0x40')]=_0x1cd500;return _0x283f14;})[_0x4479('0x21')](respondWithFilteredResult(_0x20ac8a,_0x5cb9b9))['catch'](handleError(_0x20ac8a,null));};exports['show']=function(_0x6ec960,_0x385f91){var _0x48a8c2={'raw':![],'where':{'id':_0x6ec960['params']['id']}},_0x2cf1e4={};_0x2cf1e4['model']=_['keys'](db['VtigerAccount'][_0x4479('0x27')]);_0x2cf1e4[_0x4479('0x2c')]=_['keys'](_0x6ec960[_0x4479('0x2c')]);_0x2cf1e4['filters']=_[_0x4479('0x2f')](_0x2cf1e4[_0x4479('0x2a')],_0x2cf1e4[_0x4479('0x2c')]);_0x48a8c2[_0x4479('0x30')]=_[_0x4479('0x2f')](_0x2cf1e4[_0x4479('0x2a')],qs['fields'](_0x6ec960[_0x4479('0x2c')]['fields']));_0x48a8c2[_0x4479('0x30')]=_0x48a8c2[_0x4479('0x30')][_0x4479('0x32')]?_0x48a8c2[_0x4479('0x30')]:_0x2cf1e4[_0x4479('0x2a')];if(_0x6ec960[_0x4479('0x2c')][_0x4479('0x3d')]){_0x48a8c2['include']=[{'all':!![]}];}_0x48a8c2=_[_0x4479('0x3b')]({},_0x48a8c2,_0x6ec960[_0x4479('0x3c')]);return db['VtigerAccount'][_0x4479('0x41')](_0x48a8c2)[_0x4479('0x21')](handleEntityNotFound(_0x385f91,null))[_0x4479('0x21')](respondWithResult(_0x385f91,null))[_0x4479('0x42')](handleError(_0x385f91,null));};exports[_0x4479('0x43')]=function(_0x38eaa3,_0x4a2b22){return db['VtigerAccount'][_0x4479('0x43')](_0x38eaa3['body'],{})[_0x4479('0x21')](respondWithResult(_0x4a2b22,0xc9))['catch'](handleError(_0x4a2b22,null));};exports['update']=function(_0x318daa,_0x583a3f){if(_0x318daa[_0x4479('0x44')]['id']){delete _0x318daa[_0x4479('0x44')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x318daa[_0x4479('0x45')]['id']}})['then'](handleEntityNotFound(_0x583a3f,null))[_0x4479('0x21')](saveUpdates(_0x318daa[_0x4479('0x44')],null))[_0x4479('0x21')](respondWithResult(_0x583a3f,null))[_0x4479('0x42')](handleError(_0x583a3f,null));};exports[_0x4479('0x22')]=function(_0xecab92,_0x3f26cd){return db['VtigerAccount']['find']({'where':{'id':_0xecab92[_0x4479('0x45')]['id']}})[_0x4479('0x21')](handleEntityNotFound(_0x3f26cd,null))[_0x4479('0x21')](removeEntity(_0x3f26cd,null))[_0x4479('0x42')](handleError(_0x3f26cd,null));};exports['getConfigurations']=function(_0x31d8f7,_0x2537e1,_0x1410ca){var _0x4da0bc={};var _0x40692e={};var _0x32d930;var _0x37e342;return db[_0x4479('0x26')][_0x4479('0x46')]({'where':{'id':_0x31d8f7[_0x4479('0x45')]['id']}})[_0x4479('0x21')](handleEntityNotFound(_0x2537e1,null))[_0x4479('0x21')](function(_0x3c365a){if(_0x3c365a){_0x32d930=_0x3c365a;_0x40692e[_0x4479('0x2a')]=_['keys'](db[_0x4479('0x47')][_0x4479('0x27')]);_0x40692e['query']=_['keys'](_0x31d8f7[_0x4479('0x2c')]);_0x40692e[_0x4479('0x2e')]=_[_0x4479('0x2f')](_0x40692e[_0x4479('0x2a')],_0x40692e[_0x4479('0x2c')]);_0x4da0bc[_0x4479('0x30')]=_[_0x4479('0x2f')](_0x40692e[_0x4479('0x2a')],qs[_0x4479('0x31')](_0x31d8f7[_0x4479('0x2c')]['fields']));_0x4da0bc[_0x4479('0x30')]=_0x4da0bc[_0x4479('0x30')]['length']?_0x4da0bc[_0x4479('0x30')]:_0x40692e[_0x4479('0x2a')];_0x4da0bc[_0x4479('0x35')]=qs[_0x4479('0x36')](_0x31d8f7[_0x4479('0x2c')][_0x4479('0x36')]);_0x4da0bc['where']=qs[_0x4479('0x2e')](_[_0x4479('0x38')](_0x31d8f7[_0x4479('0x2c')],_0x40692e[_0x4479('0x2e')]));if(_0x31d8f7['query'][_0x4479('0x39')]){_0x4da0bc[_0x4479('0x37')]=_[_0x4479('0x3b')](_0x4da0bc['where'],{'$or':_[_0x4479('0x2b')](_0x4da0bc[_0x4479('0x30')],function(_0x4dc4d4){var _0x2021ec={};_0x2021ec[_0x4dc4d4]={'$like':'%'+_0x31d8f7[_0x4479('0x2c')][_0x4479('0x39')]+'%'};return _0x2021ec;})});}_0x4da0bc=_[_0x4479('0x3b')]({},_0x4da0bc,_0x31d8f7[_0x4479('0x3c')]);return _0x32d930[_0x4479('0x48')](_0x4da0bc);}})[_0x4479('0x21')](function(_0x5dc0aa){if(_0x5dc0aa){_0x37e342=_0x5dc0aa[_0x4479('0x32')];if(!_0x31d8f7[_0x4479('0x2c')]['hasOwnProperty'](_0x4479('0x33'))){_0x4da0bc[_0x4479('0x34')]=qs[_0x4479('0x34')](_0x31d8f7[_0x4479('0x2c')][_0x4479('0x34')]);_0x4da0bc[_0x4479('0x1a')]=qs['offset'](_0x31d8f7['query'][_0x4479('0x1a')]);}return _0x32d930['getConfigurations'](_0x4da0bc);}})[_0x4479('0x21')](function(_0x22525f){if(_0x22525f){return _0x22525f?{'count':_0x37e342,'rows':_0x22525f}:null;}})[_0x4479('0x21')](respondWithResult(_0x2537e1,null))[_0x4479('0x42')](handleError(_0x2537e1,null));};exports[_0x4479('0x49')]=function(_0x4848e5,_0x3cfe4a,_0x4836aa){if(_0x4848e5[_0x4479('0x44')]['id']){delete _0x4848e5['body']['id'];}return db[_0x4479('0x26')][_0x4479('0x46')]({'where':{'id':_0x4848e5[_0x4479('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cfe4a,null))[_0x4479('0x21')](function(_0x5242b4){if(_0x5242b4){_0x4848e5['body'][_0x4479('0x4a')]=_0x5242b4['id'];_0x4848e5[_0x4479('0x44')][_0x4479('0x4b')]=integrations[_0x4479('0x4c')](_0x4848e5[_0x4479('0x44')][_0x4479('0x4d')],_0x4848e5[_0x4479('0x44')]['type']);_0x4848e5[_0x4479('0x44')][_0x4479('0x4e')]=integrations[_0x4479('0x4f')](_0x4848e5['body'][_0x4479('0x4d')],_0x4848e5[_0x4479('0x44')]['type']);return db[_0x4479('0x47')]['create'](_0x4848e5['body'],{'include':[{'model':db[_0x4479('0x50')],'as':_0x4479('0x4b')},{'model':db[_0x4479('0x50')],'as':_0x4479('0x4e')}]});}return null;})[_0x4479('0x21')](respondWithResult(_0x3cfe4a,null))[_0x4479('0x42')](handleError(_0x3cfe4a,null));};var md5=require(_0x4479('0x51'));exports['getFields']=function(_0x3efefe,_0xbc017e,_0x46f0c7){var _0x284a8c=null;var _0x2cd664=null;var _0x2bb518=null;var _0x1b1190=null;var _0x5be1ff='';return db[_0x4479('0x26')][_0x4479('0x46')]({'where':{'id':_0x3efefe[_0x4479('0x45')]['id']},'attributes':['id','name',_0x4479('0x52'),_0x4479('0x53'),'moduleName','remoteUri','serverUrl',_0x4479('0x54')]})[_0x4479('0x21')](handleEntityNotFound(_0xbc017e,null))[_0x4479('0x21')](function(_0x11f227){if(_0x11f227){_0x284a8c=_0x11f227[_0x4479('0x52')];_0x2cd664=_0x11f227[_0x4479('0x54')];_0x2bb518=_0x11f227['moduleName'];_0x5be1ff=_0x11f227[_0x4479('0x55')];var _0x32c5f4=_0x5be1ff[_0x4479('0x56')](-0x1);if(_0x32c5f4==='/'){_0x5be1ff=_0x5be1ff['substring'](0x0,_0x5be1ff[_0x4479('0x57')](_0x32c5f4));}_0x1b1190=util['format']('%s/webservice.php',_0x5be1ff);var _0x124e7f={'method':_0x4479('0x58'),'uri':_0x1b1190,'qs':{'operation':_0x4479('0x59'),'username':_0x11f227[_0x4479('0x52')]},'json':!![]};return rp(_0x124e7f);}})[_0x4479('0x21')](function(_0x39230e){if(_0x39230e[_0x4479('0x5a')]){var _0x57a447={'method':'POST','uri':_0x1b1190,'form':{'operation':_0x4479('0x5b'),'username':_0x284a8c,'accessKey':md5(_0x39230e[_0x4479('0x5c')][_0x4479('0x5d')]+_0x2cd664)},'json':!![]};return rp(_0x57a447);}})[_0x4479('0x21')](function(_0x2dabcd){if(_0x2dabcd[_0x4479('0x5a')]){var _0x2a7132={'method':_0x4479('0x58'),'uri':_0x1b1190,'qs':{'operation':_0x4479('0x5e'),'username':_0x284a8c,'sessionName':_0x2dabcd['result']['sessionName'],'elementType':_0x2bb518},'json':!![]};return rp(_0x2a7132);}})[_0x4479('0x21')](function(_0x1fe7fc){if(_0x1fe7fc[_0x4479('0x5a')]){var _0x158101=[_0x4479('0x5f'),'reference',_0x4479('0x60')];_[_0x4479('0x61')](_0x1fe7fc[_0x4479('0x5c')]['fields'],function(_0x33d172){return _0x158101['includes'](_0x33d172[_0x4479('0x29')][_0x4479('0x23')]);});_['remove'](_0x1fe7fc[_0x4479('0x5c')][_0x4479('0x31')],function(_0x56e74f){return _0x56e74f[_0x4479('0x62')]==='false';});return{'count':_0x1fe7fc[_0x4479('0x5c')][_0x4479('0x31')][_0x4479('0x32')],'rows':_[_0x4479('0x2b')](_0x1fe7fc['result'][_0x4479('0x31')],function(_0x10a5c3){return{'id':_0x10a5c3[_0x4479('0x23')],'name':_0x10a5c3[_0x4479('0x63')],'custom':_['startsWith'](_0x10a5c3['name'],'cf_')?!![]:![],'options':_0x10a5c3[_0x4479('0x29')]['name']===_0x4479('0x64')&&_0x10a5c3['type'][_0x4479('0x65')][_0x4479('0x32')]>0x0?_[_0x4479('0x2b')](_0x10a5c3['type']['picklistValues'],function(_0x56b694){return{'name':_0x56b694[_0x4479('0x63')],'value':_0x56b694[_0x4479('0x66')]};}):[]};})};}})[_0x4479('0x21')](respondWithResult(_0xbc017e,null))[_0x4479('0x42')](function(_0x22b9a2){console[_0x4479('0x67')](_0x4479('0x68')+_0x22b9a2);var _0xa6a366=_0x3efefe[_0x4479('0x2c')][_0x4479('0x69')]?0x1f4:_0x22b9a2[_0x4479('0x6a')]||0x1f4;logger[_0x4479('0x6b')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xa6a366,JSON[_0x4479('0x6c')](_0x22b9a2));delete _0x22b9a2[_0x4479('0x23')];if(_0xa6a366===0x191){_0xa6a366=0x190;}_0xbc017e[_0x4479('0x17')](_0xa6a366)['send'](_0x3efefe['query']['test']?{'message':_0x4479('0x6d'),'statusCode':_0x22b9a2[_0x4479('0x6a')]}:_0x22b9a2);});}; \ No newline at end of file +var _0x6a39=['moduleName','remoteUri','serverUrl','accessKey','slice','substring','format','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','editable','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','VtigerAccount','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','then','rows','show','params','length','find','catch','create','body','findOne','VtigerConfiguration','rawAttributes','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','username','description'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x6a39,0x186));var _0x96a3=function(_0x446186,_0x116e31){_0x446186=_0x446186-0x0;var _0x63b564=_0x6a39[_0x446186];return _0x63b564;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x96a3('0x0'));var zipdir=require(_0x96a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96a3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96a3('0x3'));var util=require(_0x96a3('0x4'));var path=require(_0x96a3('0x5'));var sox=require(_0x96a3('0x6'));var csv=require(_0x96a3('0x7'));var ejs=require(_0x96a3('0x8'));var fs=require('fs');var fs_extra=require(_0x96a3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x96a3('0xa'));var jsforce=require(_0x96a3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x96a3('0x7'));var querystring=require(_0x96a3('0xc'));var Papa=require(_0x96a3('0xd'));var Redis=require(_0x96a3('0xe'));var authService=require(_0x96a3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x96a3('0x10'));var hardwareService=require(_0x96a3('0x11'));var logger=require(_0x96a3('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x96a3('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x96a3('0x14'))['db'];var integrations=require(_0x96a3('0x15'));function respondWithStatusCode(_0x5ae2ad,_0x150493){_0x150493=_0x150493||0xcc;return function(_0x57815f){if(_0x57815f){return _0x5ae2ad['sendStatus'](_0x150493);}return _0x5ae2ad[_0x96a3('0x16')](_0x150493)[_0x96a3('0x17')]();};}function respondWithResult(_0x48be3b,_0x13009f){_0x13009f=_0x13009f||0xc8;return function(_0x247cf5){if(_0x247cf5){return _0x48be3b['status'](_0x13009f)[_0x96a3('0x18')](_0x247cf5);}};}function respondWithFilteredResult(_0x28055b,_0x2934bd){return function(_0x4e1739){if(_0x4e1739){var _0xb8caca=typeof _0x2934bd[_0x96a3('0x19')]===_0x96a3('0x1a')&&typeof _0x2934bd[_0x96a3('0x1b')]===_0x96a3('0x1a');var _0x2c5d95=_0x4e1739[_0x96a3('0x1c')];var _0x4d912e=_0xb8caca?0x0:_0x2934bd[_0x96a3('0x19')];var _0x3dbafc=_0xb8caca?_0x4e1739['count']:_0x2934bd[_0x96a3('0x19')]+_0x2934bd[_0x96a3('0x1b')];var _0x5f2e6c;if(_0x3dbafc>=_0x2c5d95){_0x3dbafc=_0x2c5d95;_0x5f2e6c=0xc8;}else{_0x5f2e6c=0xce;}_0x28055b[_0x96a3('0x16')](_0x5f2e6c);return _0x28055b[_0x96a3('0x1d')](_0x96a3('0x1e'),_0x4d912e+'-'+_0x3dbafc+'/'+_0x2c5d95)['json'](_0x4e1739);}return null;};}function patchUpdates(_0x36698a){return function(_0x55fabe){try{jsonpatch[_0x96a3('0x1f')](_0x55fabe,_0x36698a,!![]);}catch(_0x36933c){return BPromise[_0x96a3('0x20')](_0x36933c);}return _0x55fabe['save']();};}function saveUpdates(_0x1d1e20,_0x36b2ed){return function(_0x50c8aa){if(_0x50c8aa){return _0x50c8aa[_0x96a3('0x21')](_0x1d1e20)['then'](function(_0x30b755){return _0x30b755;});}return null;};}function removeEntity(_0x2b2ff3,_0x59c5cb){return function(_0x230357){if(_0x230357){return _0x230357[_0x96a3('0x22')]()['then'](function(){_0x2b2ff3[_0x96a3('0x16')](0xcc)[_0x96a3('0x17')]();});}};}function handleEntityNotFound(_0x50c787,_0x3bcc06){return function(_0x145234){if(!_0x145234){_0x50c787['sendStatus'](0x194);}return _0x145234;};}function handleError(_0x529220,_0x23e139){_0x23e139=_0x23e139||0x1f4;return function(_0x41d22c){logger[_0x96a3('0x23')](_0x41d22c[_0x96a3('0x24')]);if(_0x41d22c[_0x96a3('0x25')]){delete _0x41d22c[_0x96a3('0x25')];}_0x529220[_0x96a3('0x16')](_0x23e139)[_0x96a3('0x26')](_0x41d22c);};}exports[_0x96a3('0x27')]=function(_0x3b8b32,_0x5a0eca){var _0x478e6f={},_0x41e66d={},_0x2b3be1={'count':0x0,'rows':[]};var _0x70edb=_[_0x96a3('0x28')](db[_0x96a3('0x29')]['rawAttributes'],function(_0x28998a){return{'name':_0x28998a[_0x96a3('0x2a')],'type':_0x28998a['type']['key']};});_0x41e66d[_0x96a3('0x2b')]=_[_0x96a3('0x28')](_0x70edb,_0x96a3('0x25'));_0x41e66d[_0x96a3('0x2c')]=_[_0x96a3('0x2d')](_0x3b8b32[_0x96a3('0x2c')]);_0x41e66d[_0x96a3('0x2e')]=_[_0x96a3('0x2f')](_0x41e66d[_0x96a3('0x2b')],_0x41e66d['query']);_0x478e6f[_0x96a3('0x30')]=_['intersection'](_0x41e66d[_0x96a3('0x2b')],qs[_0x96a3('0x31')](_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x31')]));_0x478e6f[_0x96a3('0x30')]=_0x478e6f[_0x96a3('0x30')]['length']?_0x478e6f[_0x96a3('0x30')]:_0x41e66d[_0x96a3('0x2b')];if(!_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x32')](_0x96a3('0x33'))){_0x478e6f[_0x96a3('0x1b')]=qs[_0x96a3('0x1b')](_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x1b')]);_0x478e6f[_0x96a3('0x19')]=qs[_0x96a3('0x19')](_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x19')]);}_0x478e6f[_0x96a3('0x34')]=qs[_0x96a3('0x35')](_0x3b8b32[_0x96a3('0x2c')]['sort']);_0x478e6f['where']=qs[_0x96a3('0x2e')](_['pick'](_0x3b8b32['query'],_0x41e66d[_0x96a3('0x2e')]),_0x70edb);if(_0x3b8b32['query'][_0x96a3('0x36')]){_0x478e6f[_0x96a3('0x37')]=_['merge'](_0x478e6f[_0x96a3('0x37')],{'$or':_[_0x96a3('0x28')](_0x70edb,function(_0x5f263f){if(_0x5f263f[_0x96a3('0x38')]!==_0x96a3('0x39')){var _0x469008={};_0x469008[_0x5f263f[_0x96a3('0x25')]]={'$like':'%'+_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x36')]+'%'};return _0x469008;}})});}_0x478e6f=_[_0x96a3('0x3a')]({},_0x478e6f,_0x3b8b32[_0x96a3('0x3b')]);var _0x3e166f={'where':_0x478e6f['where']};return db[_0x96a3('0x29')][_0x96a3('0x1c')](_0x3e166f)['then'](function(_0x33761a){_0x2b3be1[_0x96a3('0x1c')]=_0x33761a;if(_0x3b8b32[_0x96a3('0x2c')][_0x96a3('0x3c')]){_0x478e6f[_0x96a3('0x3d')]=[{'all':!![]}];}return db[_0x96a3('0x29')][_0x96a3('0x3e')](_0x478e6f);})[_0x96a3('0x3f')](function(_0x268437){_0x2b3be1[_0x96a3('0x40')]=_0x268437;return _0x2b3be1;})[_0x96a3('0x3f')](respondWithFilteredResult(_0x5a0eca,_0x478e6f))['catch'](handleError(_0x5a0eca,null));};exports[_0x96a3('0x41')]=function(_0x9da65b,_0x529a11){var _0x478083={'raw':![],'where':{'id':_0x9da65b[_0x96a3('0x42')]['id']}},_0x81393f={};_0x81393f[_0x96a3('0x2b')]=_[_0x96a3('0x2d')](db[_0x96a3('0x29')]['rawAttributes']);_0x81393f[_0x96a3('0x2c')]=_[_0x96a3('0x2d')](_0x9da65b[_0x96a3('0x2c')]);_0x81393f[_0x96a3('0x2e')]=_[_0x96a3('0x2f')](_0x81393f[_0x96a3('0x2b')],_0x81393f[_0x96a3('0x2c')]);_0x478083[_0x96a3('0x30')]=_[_0x96a3('0x2f')](_0x81393f[_0x96a3('0x2b')],qs[_0x96a3('0x31')](_0x9da65b['query']['fields']));_0x478083['attributes']=_0x478083[_0x96a3('0x30')][_0x96a3('0x43')]?_0x478083['attributes']:_0x81393f[_0x96a3('0x2b')];if(_0x9da65b[_0x96a3('0x2c')]['includeAll']){_0x478083[_0x96a3('0x3d')]=[{'all':!![]}];}_0x478083=_[_0x96a3('0x3a')]({},_0x478083,_0x9da65b[_0x96a3('0x3b')]);return db[_0x96a3('0x29')][_0x96a3('0x44')](_0x478083)[_0x96a3('0x3f')](handleEntityNotFound(_0x529a11,null))[_0x96a3('0x3f')](respondWithResult(_0x529a11,null))[_0x96a3('0x45')](handleError(_0x529a11,null));};exports[_0x96a3('0x46')]=function(_0x52bfd5,_0x40768a){return db[_0x96a3('0x29')][_0x96a3('0x46')](_0x52bfd5[_0x96a3('0x47')],{})[_0x96a3('0x3f')](respondWithResult(_0x40768a,0xc9))[_0x96a3('0x45')](handleError(_0x40768a,null));};exports['update']=function(_0x4bb301,_0x19de71){if(_0x4bb301['body']['id']){delete _0x4bb301[_0x96a3('0x47')]['id'];}return db[_0x96a3('0x29')]['find']({'where':{'id':_0x4bb301[_0x96a3('0x42')]['id']}})['then'](handleEntityNotFound(_0x19de71,null))[_0x96a3('0x3f')](saveUpdates(_0x4bb301[_0x96a3('0x47')],null))[_0x96a3('0x3f')](respondWithResult(_0x19de71,null))[_0x96a3('0x45')](handleError(_0x19de71,null));};exports[_0x96a3('0x22')]=function(_0x68d4ef,_0x53aca3){return db[_0x96a3('0x29')][_0x96a3('0x44')]({'where':{'id':_0x68d4ef[_0x96a3('0x42')]['id']}})[_0x96a3('0x3f')](handleEntityNotFound(_0x53aca3,null))[_0x96a3('0x3f')](removeEntity(_0x53aca3,null))[_0x96a3('0x45')](handleError(_0x53aca3,null));};exports['getConfigurations']=function(_0x401d28,_0x2c5740,_0x444866){var _0x2a8e96={};var _0x133ce1={};var _0x3ffb09;var _0x35cf24;return db[_0x96a3('0x29')][_0x96a3('0x48')]({'where':{'id':_0x401d28['params']['id']}})['then'](handleEntityNotFound(_0x2c5740,null))[_0x96a3('0x3f')](function(_0x280485){if(_0x280485){_0x3ffb09=_0x280485;_0x133ce1[_0x96a3('0x2b')]=_[_0x96a3('0x2d')](db[_0x96a3('0x49')][_0x96a3('0x4a')]);_0x133ce1[_0x96a3('0x2c')]=_[_0x96a3('0x2d')](_0x401d28[_0x96a3('0x2c')]);_0x133ce1['filters']=_['intersection'](_0x133ce1['model'],_0x133ce1[_0x96a3('0x2c')]);_0x2a8e96[_0x96a3('0x30')]=_[_0x96a3('0x2f')](_0x133ce1['model'],qs[_0x96a3('0x31')](_0x401d28[_0x96a3('0x2c')][_0x96a3('0x31')]));_0x2a8e96[_0x96a3('0x30')]=_0x2a8e96[_0x96a3('0x30')][_0x96a3('0x43')]?_0x2a8e96[_0x96a3('0x30')]:_0x133ce1[_0x96a3('0x2b')];_0x2a8e96['order']=qs[_0x96a3('0x35')](_0x401d28[_0x96a3('0x2c')][_0x96a3('0x35')]);_0x2a8e96[_0x96a3('0x37')]=qs['filters'](_['pick'](_0x401d28['query'],_0x133ce1['filters']));if(_0x401d28['query'][_0x96a3('0x36')]){_0x2a8e96[_0x96a3('0x37')]=_[_0x96a3('0x3a')](_0x2a8e96['where'],{'$or':_[_0x96a3('0x28')](_0x2a8e96[_0x96a3('0x30')],function(_0xe38992){var _0x5af41c={};_0x5af41c[_0xe38992]={'$like':'%'+_0x401d28[_0x96a3('0x2c')][_0x96a3('0x36')]+'%'};return _0x5af41c;})});}_0x2a8e96=_[_0x96a3('0x3a')]({},_0x2a8e96,_0x401d28['options']);return _0x3ffb09[_0x96a3('0x4b')](_0x2a8e96);}})['then'](function(_0x2b4bd4){if(_0x2b4bd4){_0x35cf24=_0x2b4bd4['length'];if(!_0x401d28[_0x96a3('0x2c')]['hasOwnProperty'](_0x96a3('0x33'))){_0x2a8e96[_0x96a3('0x1b')]=qs[_0x96a3('0x1b')](_0x401d28[_0x96a3('0x2c')][_0x96a3('0x1b')]);_0x2a8e96[_0x96a3('0x19')]=qs[_0x96a3('0x19')](_0x401d28[_0x96a3('0x2c')][_0x96a3('0x19')]);}return _0x3ffb09[_0x96a3('0x4b')](_0x2a8e96);}})['then'](function(_0x3a802b){if(_0x3a802b){return _0x3a802b?{'count':_0x35cf24,'rows':_0x3a802b}:null;}})[_0x96a3('0x3f')](respondWithResult(_0x2c5740,null))[_0x96a3('0x45')](handleError(_0x2c5740,null));};exports[_0x96a3('0x4c')]=function(_0x771982,_0x14ce46,_0x52a729){if(_0x771982[_0x96a3('0x47')]['id']){delete _0x771982[_0x96a3('0x47')]['id'];}return db[_0x96a3('0x29')][_0x96a3('0x48')]({'where':{'id':_0x771982['params']['id']}})[_0x96a3('0x3f')](handleEntityNotFound(_0x14ce46,null))[_0x96a3('0x3f')](function(_0x460d53){if(_0x460d53){_0x771982['body'][_0x96a3('0x4d')]=_0x460d53['id'];_0x771982[_0x96a3('0x47')][_0x96a3('0x4e')]=integrations[_0x96a3('0x4f')](_0x771982['body'][_0x96a3('0x50')],_0x771982['body'][_0x96a3('0x38')]);_0x771982[_0x96a3('0x47')]['Descriptions']=integrations[_0x96a3('0x51')](_0x771982[_0x96a3('0x47')][_0x96a3('0x50')],_0x771982['body'][_0x96a3('0x38')]);return db[_0x96a3('0x49')][_0x96a3('0x46')](_0x771982[_0x96a3('0x47')],{'include':[{'model':db[_0x96a3('0x52')],'as':_0x96a3('0x4e')},{'model':db[_0x96a3('0x52')],'as':'Descriptions'}]});}return null;})[_0x96a3('0x3f')](respondWithResult(_0x14ce46,null))[_0x96a3('0x45')](handleError(_0x14ce46,null));};var md5=require(_0x96a3('0x53'));exports['getFields']=function(_0x12374e,_0x2c23e0,_0x571b26){var _0x3d59c6=null;var _0x4fde8e=null;var _0x361483=null;var _0x2f26e3=null;var _0x5b5eab='';return db[_0x96a3('0x29')]['findOne']({'where':{'id':_0x12374e[_0x96a3('0x42')]['id']},'attributes':['id',_0x96a3('0x25'),_0x96a3('0x54'),_0x96a3('0x55'),_0x96a3('0x56'),_0x96a3('0x57'),_0x96a3('0x58'),'accessKey']})['then'](handleEntityNotFound(_0x2c23e0,null))[_0x96a3('0x3f')](function(_0x1284d2){if(_0x1284d2){_0x3d59c6=_0x1284d2[_0x96a3('0x54')];_0x4fde8e=_0x1284d2[_0x96a3('0x59')];_0x361483=_0x1284d2[_0x96a3('0x56')];_0x5b5eab=_0x1284d2[_0x96a3('0x57')];var _0x26f1e3=_0x5b5eab[_0x96a3('0x5a')](-0x1);if(_0x26f1e3==='/'){_0x5b5eab=_0x5b5eab[_0x96a3('0x5b')](0x0,_0x5b5eab['lastIndexOf'](_0x26f1e3));}_0x2f26e3=util[_0x96a3('0x5c')](_0x96a3('0x5d'),_0x5b5eab);var _0x1ec1bd={'method':_0x96a3('0x5e'),'uri':_0x2f26e3,'qs':{'operation':'getchallenge','username':_0x1284d2['username']},'json':!![]};return rp(_0x1ec1bd);}})['then'](function(_0x7961ae){if(_0x7961ae[_0x96a3('0x5f')]){var _0x48d722={'method':_0x96a3('0x60'),'uri':_0x2f26e3,'form':{'operation':_0x96a3('0x61'),'username':_0x3d59c6,'accessKey':md5(_0x7961ae[_0x96a3('0x62')][_0x96a3('0x63')]+_0x4fde8e)},'json':!![]};return rp(_0x48d722);}})['then'](function(_0x2b5ae3){if(_0x2b5ae3['success']){var _0xedf658={'method':_0x96a3('0x5e'),'uri':_0x2f26e3,'qs':{'operation':'describe','username':_0x3d59c6,'sessionName':_0x2b5ae3[_0x96a3('0x62')][_0x96a3('0x64')],'elementType':_0x361483},'json':!![]};return rp(_0xedf658);}})['then'](function(_0x165203){if(_0x165203[_0x96a3('0x5f')]){var _0x29ea30=[_0x96a3('0x65'),_0x96a3('0x66'),_0x96a3('0x67')];_[_0x96a3('0x68')](_0x165203['result'][_0x96a3('0x31')],function(_0x495a42){return _0x29ea30[_0x96a3('0x69')](_0x495a42['type'][_0x96a3('0x25')]);});_[_0x96a3('0x68')](_0x165203[_0x96a3('0x62')]['fields'],function(_0x5cf95f){return _0x5cf95f[_0x96a3('0x6a')]==='false';});return{'count':_0x165203[_0x96a3('0x62')][_0x96a3('0x31')]['length'],'rows':_[_0x96a3('0x28')](_0x165203[_0x96a3('0x62')][_0x96a3('0x31')],function(_0x593442){return{'id':_0x593442[_0x96a3('0x25')],'name':_0x593442['label'],'custom':_['startsWith'](_0x593442[_0x96a3('0x25')],_0x96a3('0x6b'))?!![]:![],'options':_0x593442[_0x96a3('0x38')][_0x96a3('0x25')]===_0x96a3('0x6c')&&_0x593442['type'][_0x96a3('0x6d')]['length']>0x0?_['map'](_0x593442[_0x96a3('0x38')][_0x96a3('0x6d')],function(_0x13f883){return{'name':_0x13f883['label'],'value':_0x13f883[_0x96a3('0x6e')]};}):[]};})};}})['then'](respondWithResult(_0x2c23e0,null))['catch'](function(_0x1a9845){console[_0x96a3('0x6f')](_0x96a3('0x70')+_0x1a9845);var _0x3aa6bb=_0x12374e[_0x96a3('0x2c')][_0x96a3('0x71')]?0x1f4:_0x1a9845['statusCode']||0x1f4;logger[_0x96a3('0x23')](_0x96a3('0x72'),_0x96a3('0x73'),_0x3aa6bb,JSON[_0x96a3('0x74')](_0x1a9845));delete _0x1a9845[_0x96a3('0x25')];if(_0x3aa6bb===0x191){_0x3aa6bb=0x190;}_0x2c23e0[_0x96a3('0x16')](_0x3aa6bb)[_0x96a3('0x26')](_0x12374e[_0x96a3('0x2c')][_0x96a3('0x71')]?{'message':_0x96a3('0x75'),'statusCode':_0x1a9845[_0x96a3('0x76')]}:_0x1a9845);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index a0d5425..f16e7cf 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 _0x845a=['moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x4e8592,_0x4103e6){var _0x3f6680=function(_0x5002fd){while(--_0x5002fd){_0x4e8592['push'](_0x4e8592['shift']());}};_0x3f6680(++_0x4103e6);}(_0x845a,0x1af));var _0xa845=function(_0x15ce9b,_0x24f5f4){_0x15ce9b=_0x15ce9b-0x0;var _0x50e796=_0x845a[_0x15ce9b];return _0x50e796;};'use strict';var _=require(_0xa845('0x0'));var util=require(_0xa845('0x1'));var logger=require(_0xa845('0x2'))(_0xa845('0x3'));var moment=require(_0xa845('0x4'));var BPromise=require(_0xa845('0x5'));var rp=require(_0xa845('0x6'));var fs=require('fs');var path=require(_0xa845('0x7'));var rimraf=require('rimraf');var config=require(_0xa845('0x8'));var attributes=require(_0xa845('0x9'));var integrations=require(_0xa845('0xa'));module[_0xa845('0xb')]=function(_0x11fdee,_0x5bc811){return _0x11fdee[_0xa845('0xc')](_0xa845('0xd'),attributes,{'tableName':_0xa845('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e9a=['exports','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x15545d,_0x2be90d){var _0x502069=function(_0x5ac820){while(--_0x5ac820){_0x15545d['push'](_0x15545d['shift']());}};_0x502069(++_0x2be90d);}(_0x3e9a,0x16f));var _0xa3e9=function(_0x41c99a,_0x12414d){_0x41c99a=_0x41c99a-0x0;var _0x303bf9=_0x3e9a[_0x41c99a];return _0x303bf9;};'use strict';var _=require(_0xa3e9('0x0'));var util=require(_0xa3e9('0x1'));var logger=require(_0xa3e9('0x2'))(_0xa3e9('0x3'));var moment=require(_0xa3e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xa3e9('0x5'));var fs=require('fs');var path=require(_0xa3e9('0x6'));var rimraf=require(_0xa3e9('0x7'));var config=require(_0xa3e9('0x8'));var attributes=require(_0xa3e9('0x9'));var integrations=require(_0xa3e9('0xa'));module[_0xa3e9('0xb')]=function(_0x268de2,_0x47222e){return _0x268de2['define'](_0xa3e9('0xc'),attributes,{'tableName':_0xa3e9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 581dbdf..d3ae1e3 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 _0x96cc=['model','map','debug','ShowVtigerAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x2cbc82,_0x30d15a){var _0x222f31=function(_0x51bc14){while(--_0x51bc14){_0x2cbc82['push'](_0x2cbc82['shift']());}};_0x222f31(++_0x30d15a);}(_0x96cc,0x16c));var _0xc96c=function(_0x5a8981,_0x12fe84){_0x5a8981=_0x5a8981-0x0;var _0x4a3592=_0x96cc[_0x5a8981];return _0x4a3592;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});}exports[_0xc96c('0x17')]=function(_0x99c402){var _0x16b6ce=this;return new Promise(function(_0x2ae19a,_0x4aa6a3){return db[_0xc96c('0x18')][_0xc96c('0x19')]({'raw':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1c')]||null:null,'attributes':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'limit':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1e')]||null:null,'include':_0x99c402[_0xc96c('0x1a')]?_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')]?_['map'](_0x99c402[_0xc96c('0x1a')][_0xc96c('0x1f')],function(_0x4456bf){return{'model':db[_0x4456bf[_0xc96c('0x20')]],'as':_0x4456bf['as'],'attributes':_0x4456bf[_0xc96c('0x1d')],'include':_0x4456bf[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4456bf[_0xc96c('0x1f')],function(_0x1a77df){return{'model':db[_0x1a77df[_0xc96c('0x20')]],'as':_0x1a77df['as'],'attributes':_0x1a77df['attributes'],'include':_0x1a77df[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x1a77df[_0xc96c('0x1f')],function(_0x294fee){return{'model':db[_0x294fee['model']],'as':_0x294fee['as'],'attributes':_0x294fee['attributes']};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x12c293){logger[_0xc96c('0xd')](_0xc96c('0x17'),_0x99c402);logger[_0xc96c('0x22')](_0xc96c('0x17'),_0x99c402,JSON[_0xc96c('0x11')](_0x12c293));_0x2ae19a(_0x12c293);})[_0xc96c('0x16')](function(_0xa0efbc){logger[_0xc96c('0x12')](_0xc96c('0x17'),_0xa0efbc[_0xc96c('0x14')],_0x99c402);_0x4aa6a3(_0x16b6ce[_0xc96c('0x12')](0x1f4,_0xa0efbc[_0xc96c('0x14')]));});});};exports['ShowVtigerAccount']=function(_0x3aa436){var _0x53c994=this;return new Promise(function(_0x3f4b0e,_0x442c7f){return db[_0xc96c('0x18')]['find']({'raw':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436['options']['where']||null:null,'attributes':_0x3aa436[_0xc96c('0x1a')]?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1d')]||null:null,'include':_0x3aa436['options']?_0x3aa436[_0xc96c('0x1a')][_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x3aa436[_0xc96c('0x1a')]['include'],function(_0x4132a9){return{'model':db[_0x4132a9[_0xc96c('0x20')]],'as':_0x4132a9['as'],'attributes':_0x4132a9['attributes'],'include':_0x4132a9[_0xc96c('0x1f')]?_[_0xc96c('0x21')](_0x4132a9[_0xc96c('0x1f')],function(_0x2d2595){return{'model':db[_0x2d2595[_0xc96c('0x20')]],'as':_0x2d2595['as'],'attributes':_0x2d2595[_0xc96c('0x1d')],'include':_0x2d2595['include']?_[_0xc96c('0x21')](_0x2d2595[_0xc96c('0x1f')],function(_0x15b68b){return{'model':db[_0x15b68b[_0xc96c('0x20')]],'as':_0x15b68b['as'],'attributes':_0x15b68b[_0xc96c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc96c('0xc')](function(_0x52d4a2){logger['info'](_0xc96c('0x23'),_0x3aa436);logger[_0xc96c('0x22')]('ShowVtigerAccount',_0x3aa436,JSON['stringify'](_0x52d4a2));_0x3f4b0e(_0x52d4a2);})[_0xc96c('0x16')](function(_0x1df393){logger[_0xc96c('0x12')](_0xc96c('0x23'),_0x1df393[_0xc96c('0x14')],_0x3aa436);_0x442c7f(_0x53c994[_0xc96c('0x12')](0x1f4,_0x1df393[_0xc96c('0x14')]));});});}; \ No newline at end of file +var _0xb574=['where','attributes','include','map','model','ShowVtigerAccount','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0xb574,0x106));var _0x4b57=function(_0x111710,_0x3482b2){_0x111710=_0x111710-0x0;var _0x3c7602=_0xb574[_0x111710];return _0x3c7602;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var moment=require('moment');var BPromise=require(_0x4b57('0x2'));var rs=require(_0x4b57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b57('0x4'))['db'];var utils=require(_0x4b57('0x5'));var logger=require(_0x4b57('0x6'))(_0x4b57('0x7'));var config=require(_0x4b57('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4b57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a0f,_0x585d86,_0x4b2d65){return new BPromise(function(_0x548ee8,_0x291e54){return client[_0x4b57('0xa')](_0x4a4a0f,_0x4b2d65)[_0x4b57('0xb')](function(_0x3b112d){logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,_0x4b57('0xe'));logger[_0x4b57('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x585d86,_0x4b57('0xe'),JSON[_0x4b57('0x10')](_0x3b112d));if(_0x3b112d[_0x4b57('0x11')]){if(_0x3b112d['error']['code']===0x1f4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);return _0x291e54(_0x3b112d[_0x4b57('0x11')][_0x4b57('0x12')]);}logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x3b112d[_0x4b57('0x11')]['message']);return _0x548ee8(_0x3b112d['error'][_0x4b57('0x12')]);}else{logger[_0x4b57('0xc')](_0x4b57('0xd'),_0x585d86,'request\x20sent');_0x548ee8(_0x3b112d[_0x4b57('0x13')]['message']);}})[_0x4b57('0x14')](function(_0x42aff4){logger[_0x4b57('0x11')](_0x4b57('0xd'),_0x585d86,_0x42aff4);_0x291e54(_0x42aff4);});});}exports[_0x4b57('0x15')]=function(_0xfb71cc){var _0x4ede42=this;return new Promise(function(_0x1b35ff,_0x1a0b72){return db[_0x4b57('0x16')][_0x4b57('0x17')]({'raw':_0xfb71cc['options']?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1a')]||null:null,'attributes':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc['options'][_0x4b57('0x1b')]||null:null,'limit':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')]['limit']||null:null,'include':_0xfb71cc[_0x4b57('0x18')]?_0xfb71cc[_0x4b57('0x18')][_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0xfb71cc['options'][_0x4b57('0x1c')],function(_0x368c5f){return{'model':db[_0x368c5f['model']],'as':_0x368c5f['as'],'attributes':_0x368c5f[_0x4b57('0x1b')],'include':_0x368c5f[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x368c5f[_0x4b57('0x1c')],function(_0x540eff){return{'model':db[_0x540eff[_0x4b57('0x1e')]],'as':_0x540eff['as'],'attributes':_0x540eff['attributes'],'include':_0x540eff[_0x4b57('0x1c')]?_['map'](_0x540eff[_0x4b57('0x1c')],function(_0x2dc9d8){return{'model':db[_0x2dc9d8[_0x4b57('0x1e')]],'as':_0x2dc9d8['as'],'attributes':_0x2dc9d8[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4b57('0xb')](function(_0x392e37){logger['info']('GetVtigerAccount',_0xfb71cc);logger[_0x4b57('0xf')]('GetVtigerAccount',_0xfb71cc,JSON[_0x4b57('0x10')](_0x392e37));_0x1b35ff(_0x392e37);})[_0x4b57('0x14')](function(_0x874cf7){logger[_0x4b57('0x11')](_0x4b57('0x15'),_0x874cf7[_0x4b57('0x12')],_0xfb71cc);_0x1a0b72(_0x4ede42['error'](0x1f4,_0x874cf7[_0x4b57('0x12')]));});});};exports[_0x4b57('0x1f')]=function(_0x68be27){var _0x3cd331=this;return new Promise(function(_0x4ccf89,_0xa91ba){return db[_0x4b57('0x16')]['find']({'raw':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x19')]===undefined?!![]:![]:!![],'where':_0x68be27[_0x4b57('0x18')]?_0x68be27['options']['where']||null:null,'attributes':_0x68be27['options']?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1b')]||null:null,'include':_0x68be27[_0x4b57('0x18')]?_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')]?_['map'](_0x68be27[_0x4b57('0x18')][_0x4b57('0x1c')],function(_0x1fd3f7){return{'model':db[_0x1fd3f7['model']],'as':_0x1fd3f7['as'],'attributes':_0x1fd3f7[_0x4b57('0x1b')],'include':_0x1fd3f7[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x1fd3f7['include'],function(_0x28a0ee){return{'model':db[_0x28a0ee[_0x4b57('0x1e')]],'as':_0x28a0ee['as'],'attributes':_0x28a0ee['attributes'],'include':_0x28a0ee[_0x4b57('0x1c')]?_[_0x4b57('0x1d')](_0x28a0ee[_0x4b57('0x1c')],function(_0x91f32e){return{'model':db[_0x91f32e[_0x4b57('0x1e')]],'as':_0x91f32e['as'],'attributes':_0x91f32e[_0x4b57('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9f76){logger[_0x4b57('0xc')](_0x4b57('0x1f'),_0x68be27);logger[_0x4b57('0xf')](_0x4b57('0x1f'),_0x68be27,JSON[_0x4b57('0x10')](_0x1f9f76));_0x4ccf89(_0x1f9f76);})[_0x4b57('0x14')](function(_0x4c5b82){logger['error'](_0x4b57('0x1f'),_0x4c5b82[_0x4b57('0x12')],_0x68be27);_0xa91ba(_0x3cd331[_0x4b57('0x11')](0x1f4,_0x4c5b82['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 33206c0..a712a8e 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 _0xe02b=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a59f3,_0x4826ab){var _0x10dc95=function(_0x3afa2c){while(--_0x3afa2c){_0x1a59f3['push'](_0x1a59f3['shift']());}};_0x10dc95(++_0x4826ab);}(_0xe02b,0x67));var _0xbe02=function(_0x16fa96,_0x191e9f){_0x16fa96=_0x16fa96-0x0;var _0x4e52d3=_0xe02b[_0x16fa96];return _0x4e52d3;};'use strict';var multer=require('multer');var util=require(_0xbe02('0x0'));var path=require(_0xbe02('0x1'));var timeout=require(_0xbe02('0x2'));var express=require(_0xbe02('0x3'));var router=express[_0xbe02('0x4')]();var fs_extra=require(_0xbe02('0x5'));var auth=require(_0xbe02('0x6'));var interaction=require(_0xbe02('0x7'));var config=require(_0xbe02('0x8'));var controller=require(_0xbe02('0x9'));router['get']('/',auth[_0xbe02('0xa')](),controller[_0xbe02('0xb')]);router[_0xbe02('0xc')](_0xbe02('0xd'),auth[_0xbe02('0xa')](),controller[_0xbe02('0xe')]);router[_0xbe02('0xc')](_0xbe02('0xf'),auth[_0xbe02('0xa')](),controller[_0xbe02('0x10')]);router[_0xbe02('0xc')]('/:id/subjects',auth[_0xbe02('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xbe02('0xa')](),controller[_0xbe02('0x11')]);router[_0xbe02('0x12')](_0xbe02('0xd'),auth[_0xbe02('0xa')](),controller[_0xbe02('0x13')]);router[_0xbe02('0x14')](_0xbe02('0xd'),auth[_0xbe02('0xa')](),controller[_0xbe02('0x15')]);module['exports']=router; \ No newline at end of file +var _0xfef2=['isAuthenticated','getFields','/:id/subjects','getSubjects','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','/:id','show'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xfef2,0x73));var _0x2fef=function(_0x5d38c4,_0x451a17){_0x5d38c4=_0x5d38c4-0x0;var _0x2558eb=_0xfef2[_0x5d38c4];return _0x2558eb;};'use strict';var multer=require(_0x2fef('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2fef('0x1'));var express=require(_0x2fef('0x2'));var router=express[_0x2fef('0x3')]();var fs_extra=require(_0x2fef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2fef('0x5'));var config=require('../../config/environment');var controller=require(_0x2fef('0x6'));router[_0x2fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x2fef('0x8')]);router[_0x2fef('0x7')](_0x2fef('0x9'),auth['isAuthenticated'](),controller[_0x2fef('0xa')]);router[_0x2fef('0x7')]('/:id/fields',auth[_0x2fef('0xb')](),controller[_0x2fef('0xc')]);router['get'](_0x2fef('0xd'),auth['isAuthenticated'](),controller[_0x2fef('0xe')]);router[_0x2fef('0x7')]('/:id/descriptions',auth[_0x2fef('0xb')](),controller['getDescriptions']);router[_0x2fef('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2fef('0x10')](_0x2fef('0x9'),auth['isAuthenticated'](),controller[_0x2fef('0x11')]);router[_0x2fef('0x12')]('/:id',auth[_0x2fef('0xb')](),controller[_0x2fef('0x13')]);module[_0x2fef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c6194a7..9f9029c 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 _0x1518=['exports','STRING','sequelize'];(function(_0x377ac5,_0xfd30ac){var _0x5b84cb=function(_0x1f239a){while(--_0x1f239a){_0x377ac5['push'](_0x377ac5['shift']());}};_0x5b84cb(++_0xfd30ac);}(_0x1518,0xad));var _0x8151=function(_0x55580a,_0x490eac){_0x55580a=_0x55580a-0x0;var _0x3ed525=_0x1518[_0x55580a];return _0x3ed525;};'use strict';var Sequelize=require(_0x8151('0x0'));module[_0x8151('0x1')]={'name':{'type':Sequelize[_0x8151('0x2')]},'description':{'type':Sequelize[_0x8151('0x2')]}}; \ No newline at end of file +var _0x82bd=['STRING','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x82bd,0x121));var _0xd82b=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x82bd[_0x5ef905];return _0x367808;};'use strict';var Sequelize=require('sequelize');module[_0xd82b('0x0')]={'name':{'type':Sequelize[_0xd82b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 2e6dc1b..43257b1 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 _0x99e9=['create','update','body','getFields','findOne','VtigerField','order','sort','pick','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','model','fields','attributes','length','nolimit','where','VIRTUAL','filter','merge','includeAll','include','rows','show','params','keys','filters','intersection','options','catch'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x99e9,0xb4));var _0x999e=function(_0x108831,_0x5e4f70){_0x108831=_0x108831-0x0;var _0x4da77a=_0x99e9[_0x108831];return _0x4da77a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x999e('0x0'));var zipdir=require(_0x999e('0x1'));var jsonpatch=require(_0x999e('0x2'));var rp=require(_0x999e('0x3'));var moment=require('moment');var BPromise=require(_0x999e('0x4'));var Mustache=require(_0x999e('0x5'));var util=require(_0x999e('0x6'));var path=require('path');var sox=require(_0x999e('0x7'));var csv=require('to-csv');var ejs=require(_0x999e('0x8'));var fs=require('fs');var fs_extra=require(_0x999e('0x9'));var _=require(_0x999e('0xa'));var squel=require(_0x999e('0xb'));var crypto=require('crypto');var jsforce=require(_0x999e('0xc'));var deskjs=require(_0x999e('0xd'));var toCsv=require(_0x999e('0xe'));var querystring=require(_0x999e('0xf'));var Papa=require(_0x999e('0x10'));var Redis=require(_0x999e('0x11'));var authService=require(_0x999e('0x12'));var qs=require(_0x999e('0x13'));var as=require(_0x999e('0x14'));var hardwareService=require(_0x999e('0x15'));var logger=require(_0x999e('0x16'))(_0x999e('0x17'));var utils=require(_0x999e('0x18'));var config=require(_0x999e('0x19'));var licenseUtil=require(_0x999e('0x1a'));var db=require(_0x999e('0x1b'))['db'];function respondWithStatusCode(_0x26b55a,_0x47a3c1){_0x47a3c1=_0x47a3c1||0xcc;return function(_0x15f771){if(_0x15f771){return _0x26b55a['sendStatus'](_0x47a3c1);}return _0x26b55a[_0x999e('0x1c')](_0x47a3c1)[_0x999e('0x1d')]();};}function respondWithResult(_0x2fbc3e,_0x538a92){_0x538a92=_0x538a92||0xc8;return function(_0x28bdd1){if(_0x28bdd1){return _0x2fbc3e['status'](_0x538a92)[_0x999e('0x1e')](_0x28bdd1);}};}function respondWithFilteredResult(_0x539598,_0x549ad4){return function(_0x1eee64){if(_0x1eee64){var _0x22feac=typeof _0x549ad4[_0x999e('0x1f')]===_0x999e('0x20')&&typeof _0x549ad4[_0x999e('0x21')]===_0x999e('0x20');var _0x4aac66=_0x1eee64['count'];var _0x4fcdfb=_0x22feac?0x0:_0x549ad4[_0x999e('0x1f')];var _0x43b09e=_0x22feac?_0x1eee64[_0x999e('0x22')]:_0x549ad4[_0x999e('0x1f')]+_0x549ad4[_0x999e('0x21')];var _0x3ece5e;if(_0x43b09e>=_0x4aac66){_0x43b09e=_0x4aac66;_0x3ece5e=0xc8;}else{_0x3ece5e=0xce;}_0x539598['status'](_0x3ece5e);return _0x539598['set'](_0x999e('0x23'),_0x4fcdfb+'-'+_0x43b09e+'/'+_0x4aac66)[_0x999e('0x1e')](_0x1eee64);}return null;};}function patchUpdates(_0x3b3642){return function(_0x510fa2){try{jsonpatch[_0x999e('0x24')](_0x510fa2,_0x3b3642,!![]);}catch(_0x42e167){return BPromise[_0x999e('0x25')](_0x42e167);}return _0x510fa2[_0x999e('0x26')]();};}function saveUpdates(_0x373b80,_0x3750a0){return function(_0x427bcf){if(_0x427bcf){return _0x427bcf['update'](_0x373b80)['then'](function(_0x11a6bf){return _0x11a6bf;});}return null;};}function removeEntity(_0x4f0091,_0x4c5491){return function(_0x452acd){if(_0x452acd){return _0x452acd[_0x999e('0x27')]()[_0x999e('0x28')](function(){_0x4f0091[_0x999e('0x1c')](0xcc)[_0x999e('0x1d')]();});}};}function handleEntityNotFound(_0x320634,_0x4f8406){return function(_0x2e1cc5){if(!_0x2e1cc5){_0x320634[_0x999e('0x29')](0x194);}return _0x2e1cc5;};}function handleError(_0x11068e,_0x12b9ad){_0x12b9ad=_0x12b9ad||0x1f4;return function(_0x1b7adb){logger[_0x999e('0x2a')](_0x1b7adb[_0x999e('0x2b')]);if(_0x1b7adb['name']){delete _0x1b7adb[_0x999e('0x2c')];}_0x11068e['status'](_0x12b9ad)['send'](_0x1b7adb);};}exports[_0x999e('0x2d')]=function(_0x1059bd,_0x1f89f2){var _0x555ca0={},_0x1ea0e4={},_0x28f7ba={'count':0x0,'rows':[]};var _0x22cd81=_[_0x999e('0x2e')](db[_0x999e('0x2f')][_0x999e('0x30')],function(_0x82e067){return{'name':_0x82e067[_0x999e('0x31')],'type':_0x82e067[_0x999e('0x32')][_0x999e('0x33')]};});_0x1ea0e4['model']=_[_0x999e('0x2e')](_0x22cd81,_0x999e('0x2c'));_0x1ea0e4[_0x999e('0x34')]=_['keys'](_0x1059bd[_0x999e('0x34')]);_0x1ea0e4['filters']=_['intersection'](_0x1ea0e4[_0x999e('0x35')],_0x1ea0e4[_0x999e('0x34')]);_0x555ca0['attributes']=_['intersection'](_0x1ea0e4[_0x999e('0x35')],qs[_0x999e('0x36')](_0x1059bd[_0x999e('0x34')][_0x999e('0x36')]));_0x555ca0['attributes']=_0x555ca0[_0x999e('0x37')][_0x999e('0x38')]?_0x555ca0[_0x999e('0x37')]:_0x1ea0e4[_0x999e('0x35')];if(!_0x1059bd['query']['hasOwnProperty'](_0x999e('0x39'))){_0x555ca0['limit']=qs[_0x999e('0x21')](_0x1059bd[_0x999e('0x34')][_0x999e('0x21')]);_0x555ca0[_0x999e('0x1f')]=qs['offset'](_0x1059bd[_0x999e('0x34')][_0x999e('0x1f')]);}_0x555ca0['order']=qs['sort'](_0x1059bd[_0x999e('0x34')]['sort']);_0x555ca0[_0x999e('0x3a')]=qs['filters'](_['pick'](_0x1059bd['query'],_0x1ea0e4['filters']),_0x22cd81);if(_0x1059bd[_0x999e('0x34')]['filter']){_0x555ca0[_0x999e('0x3a')]=_['merge'](_0x555ca0['where'],{'$or':_['map'](_0x22cd81,function(_0x2f7d79){if(_0x2f7d79[_0x999e('0x32')]!==_0x999e('0x3b')){var _0xe3c089={};_0xe3c089[_0x2f7d79[_0x999e('0x2c')]]={'$like':'%'+_0x1059bd[_0x999e('0x34')][_0x999e('0x3c')]+'%'};return _0xe3c089;}})});}_0x555ca0=_[_0x999e('0x3d')]({},_0x555ca0,_0x1059bd['options']);var _0x3ff20a={'where':_0x555ca0[_0x999e('0x3a')]};return db[_0x999e('0x2f')][_0x999e('0x22')](_0x3ff20a)['then'](function(_0x141358){_0x28f7ba['count']=_0x141358;if(_0x1059bd[_0x999e('0x34')][_0x999e('0x3e')]){_0x555ca0[_0x999e('0x3f')]=[{'all':!![]}];}return db[_0x999e('0x2f')]['findAll'](_0x555ca0);})[_0x999e('0x28')](function(_0x108c96){_0x28f7ba[_0x999e('0x40')]=_0x108c96;return _0x28f7ba;})['then'](respondWithFilteredResult(_0x1f89f2,_0x555ca0))['catch'](handleError(_0x1f89f2,null));};exports[_0x999e('0x41')]=function(_0x30d943,_0x4098ad){var _0x42a3a0={'raw':![],'where':{'id':_0x30d943[_0x999e('0x42')]['id']}},_0x1009a0={};_0x1009a0[_0x999e('0x35')]=_[_0x999e('0x43')](db[_0x999e('0x2f')][_0x999e('0x30')]);_0x1009a0['query']=_['keys'](_0x30d943[_0x999e('0x34')]);_0x1009a0[_0x999e('0x44')]=_[_0x999e('0x45')](_0x1009a0[_0x999e('0x35')],_0x1009a0[_0x999e('0x34')]);_0x42a3a0[_0x999e('0x37')]=_['intersection'](_0x1009a0[_0x999e('0x35')],qs['fields'](_0x30d943['query'][_0x999e('0x36')]));_0x42a3a0['attributes']=_0x42a3a0['attributes']['length']?_0x42a3a0['attributes']:_0x1009a0[_0x999e('0x35')];if(_0x30d943[_0x999e('0x34')]['includeAll']){_0x42a3a0[_0x999e('0x3f')]=[{'all':!![]}];}_0x42a3a0=_[_0x999e('0x3d')]({},_0x42a3a0,_0x30d943[_0x999e('0x46')]);return db['VtigerConfiguration']['find'](_0x42a3a0)[_0x999e('0x28')](handleEntityNotFound(_0x4098ad,null))[_0x999e('0x28')](respondWithResult(_0x4098ad,null))[_0x999e('0x47')](handleError(_0x4098ad,null));};exports['create']=function(_0x4b43dd,_0x4d0358){return db['VtigerConfiguration'][_0x999e('0x48')](_0x4b43dd['body'],{})['then'](respondWithResult(_0x4d0358,0xc9))[_0x999e('0x47')](handleError(_0x4d0358,null));};exports[_0x999e('0x49')]=function(_0x5843f1,_0xa50dc6){if(_0x5843f1[_0x999e('0x4a')]['id']){delete _0x5843f1['body']['id'];}return db[_0x999e('0x2f')]['find']({'where':{'id':_0x5843f1[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0xa50dc6,null))['then'](saveUpdates(_0x5843f1[_0x999e('0x4a')],null))[_0x999e('0x28')](respondWithResult(_0xa50dc6,null))['catch'](handleError(_0xa50dc6,null));};exports['destroy']=function(_0x254292,_0x561fb4){return db['VtigerConfiguration']['find']({'where':{'id':_0x254292[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x561fb4,null))[_0x999e('0x28')](removeEntity(_0x561fb4,null))[_0x999e('0x47')](handleError(_0x561fb4,null));};exports[_0x999e('0x4b')]=function(_0x14c01c,_0x5b2645,_0x14f8de){var _0x2317c5={};var _0x4f1347={};var _0x1e506f;var _0x384893;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x14c01c[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x5b2645,null))[_0x999e('0x28')](function(_0x4636fa){if(_0x4636fa){_0x1e506f=_0x4636fa;_0x4f1347[_0x999e('0x35')]=_['keys'](db[_0x999e('0x4d')][_0x999e('0x30')]);_0x4f1347[_0x999e('0x34')]=_[_0x999e('0x43')](_0x14c01c['query']);_0x4f1347[_0x999e('0x44')]=_[_0x999e('0x45')](_0x4f1347[_0x999e('0x35')],_0x4f1347[_0x999e('0x34')]);_0x2317c5[_0x999e('0x37')]=_[_0x999e('0x45')](_0x4f1347[_0x999e('0x35')],qs[_0x999e('0x36')](_0x14c01c['query']['fields']));_0x2317c5[_0x999e('0x37')]=_0x2317c5[_0x999e('0x37')][_0x999e('0x38')]?_0x2317c5[_0x999e('0x37')]:_0x4f1347[_0x999e('0x35')];_0x2317c5[_0x999e('0x4e')]=qs[_0x999e('0x4f')](_0x14c01c['query']['sort']);_0x2317c5[_0x999e('0x3a')]=qs[_0x999e('0x44')](_[_0x999e('0x50')](_0x14c01c[_0x999e('0x34')],_0x4f1347[_0x999e('0x44')]));if(_0x14c01c['query'][_0x999e('0x3c')]){_0x2317c5[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x2317c5[_0x999e('0x3a')],{'$or':_[_0x999e('0x2e')](_0x2317c5[_0x999e('0x37')],function(_0x2b4bbe){var _0x53734c={};_0x53734c[_0x2b4bbe]={'$like':'%'+_0x14c01c[_0x999e('0x34')]['filter']+'%'};return _0x53734c;})});}_0x2317c5=_[_0x999e('0x3d')]({},_0x2317c5,_0x14c01c[_0x999e('0x46')]);return _0x1e506f[_0x999e('0x4b')](_0x2317c5);}})[_0x999e('0x28')](function(_0x440a3c){if(_0x440a3c){_0x384893=_0x440a3c[_0x999e('0x38')];if(!_0x14c01c['query'][_0x999e('0x51')](_0x999e('0x39'))){_0x2317c5[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x14c01c[_0x999e('0x34')][_0x999e('0x21')]);_0x2317c5[_0x999e('0x1f')]=qs[_0x999e('0x1f')](_0x14c01c[_0x999e('0x34')][_0x999e('0x1f')]);}return _0x1e506f[_0x999e('0x4b')](_0x2317c5);}})[_0x999e('0x28')](function(_0x77a387){if(_0x77a387){return _0x77a387?{'count':_0x384893,'rows':_0x77a387}:null;}})[_0x999e('0x28')](respondWithResult(_0x5b2645,null))[_0x999e('0x47')](handleError(_0x5b2645,null));};exports['getSubjects']=function(_0x425639,_0x157c1f,_0x296d59){var _0x3f18fb={};var _0x4e5e6e={};var _0x4871c9;var _0x21c8be;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x425639[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x157c1f,null))[_0x999e('0x28')](function(_0x1596bb){if(_0x1596bb){_0x4871c9=_0x1596bb;_0x4e5e6e[_0x999e('0x35')]=_[_0x999e('0x43')](db['VtigerField'][_0x999e('0x30')]);_0x4e5e6e['query']=_[_0x999e('0x43')](_0x425639[_0x999e('0x34')]);_0x4e5e6e['filters']=_[_0x999e('0x45')](_0x4e5e6e[_0x999e('0x35')],_0x4e5e6e[_0x999e('0x34')]);_0x3f18fb[_0x999e('0x37')]=_[_0x999e('0x45')](_0x4e5e6e['model'],qs[_0x999e('0x36')](_0x425639[_0x999e('0x34')]['fields']));_0x3f18fb['attributes']=_0x3f18fb['attributes'][_0x999e('0x38')]?_0x3f18fb[_0x999e('0x37')]:_0x4e5e6e[_0x999e('0x35')];_0x3f18fb[_0x999e('0x4e')]=qs[_0x999e('0x4f')](_0x425639['query']['sort']);_0x3f18fb['where']=qs[_0x999e('0x44')](_['pick'](_0x425639['query'],_0x4e5e6e[_0x999e('0x44')]));if(_0x425639['query'][_0x999e('0x3c')]){_0x3f18fb[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x3f18fb['where'],{'$or':_[_0x999e('0x2e')](_0x3f18fb[_0x999e('0x37')],function(_0x2ddf00){var _0x61f168={};_0x61f168[_0x2ddf00]={'$like':'%'+_0x425639[_0x999e('0x34')][_0x999e('0x3c')]+'%'};return _0x61f168;})});}_0x3f18fb=_[_0x999e('0x3d')]({},_0x3f18fb,_0x425639['options']);return _0x4871c9[_0x999e('0x52')](_0x3f18fb);}})[_0x999e('0x28')](function(_0x193c80){if(_0x193c80){_0x21c8be=_0x193c80['length'];if(!_0x425639[_0x999e('0x34')][_0x999e('0x51')]('nolimit')){_0x3f18fb[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x425639[_0x999e('0x34')][_0x999e('0x21')]);_0x3f18fb[_0x999e('0x1f')]=qs[_0x999e('0x1f')](_0x425639[_0x999e('0x34')][_0x999e('0x1f')]);}return _0x4871c9[_0x999e('0x52')](_0x3f18fb);}})['then'](function(_0xe27738){if(_0xe27738){return _0xe27738?{'count':_0x21c8be,'rows':_0xe27738}:null;}})[_0x999e('0x28')](respondWithResult(_0x157c1f,null))[_0x999e('0x47')](handleError(_0x157c1f,null));};exports['getDescriptions']=function(_0x46365a,_0x48e0ca,_0x14f13a){var _0x115be6={};var _0x3a7596={};var _0x4e6c30;var _0x43377d;return db[_0x999e('0x2f')][_0x999e('0x4c')]({'where':{'id':_0x46365a[_0x999e('0x42')]['id']}})[_0x999e('0x28')](handleEntityNotFound(_0x48e0ca,null))[_0x999e('0x28')](function(_0x5c4a50){if(_0x5c4a50){_0x4e6c30=_0x5c4a50;_0x3a7596[_0x999e('0x35')]=_['keys'](db[_0x999e('0x4d')]['rawAttributes']);_0x3a7596['query']=_[_0x999e('0x43')](_0x46365a['query']);_0x3a7596[_0x999e('0x44')]=_[_0x999e('0x45')](_0x3a7596['model'],_0x3a7596[_0x999e('0x34')]);_0x115be6[_0x999e('0x37')]=_['intersection'](_0x3a7596[_0x999e('0x35')],qs[_0x999e('0x36')](_0x46365a[_0x999e('0x34')][_0x999e('0x36')]));_0x115be6[_0x999e('0x37')]=_0x115be6[_0x999e('0x37')][_0x999e('0x38')]?_0x115be6[_0x999e('0x37')]:_0x3a7596['model'];_0x115be6['order']=qs[_0x999e('0x4f')](_0x46365a[_0x999e('0x34')][_0x999e('0x4f')]);_0x115be6[_0x999e('0x3a')]=qs[_0x999e('0x44')](_[_0x999e('0x50')](_0x46365a['query'],_0x3a7596[_0x999e('0x44')]));if(_0x46365a[_0x999e('0x34')]['filter']){_0x115be6[_0x999e('0x3a')]=_[_0x999e('0x3d')](_0x115be6[_0x999e('0x3a')],{'$or':_['map'](_0x115be6[_0x999e('0x37')],function(_0x1a53c9){var _0x328c2d={};_0x328c2d[_0x1a53c9]={'$like':'%'+_0x46365a['query'][_0x999e('0x3c')]+'%'};return _0x328c2d;})});}_0x115be6=_[_0x999e('0x3d')]({},_0x115be6,_0x46365a[_0x999e('0x46')]);return _0x4e6c30['getDescriptions'](_0x115be6);}})['then'](function(_0x10a6f1){if(_0x10a6f1){_0x43377d=_0x10a6f1['length'];if(!_0x46365a[_0x999e('0x34')][_0x999e('0x51')](_0x999e('0x39'))){_0x115be6[_0x999e('0x21')]=qs[_0x999e('0x21')](_0x46365a[_0x999e('0x34')][_0x999e('0x21')]);_0x115be6['offset']=qs[_0x999e('0x1f')](_0x46365a['query']['offset']);}return _0x4e6c30[_0x999e('0x53')](_0x115be6);}})[_0x999e('0x28')](function(_0xa0a5de){if(_0xa0a5de){return _0xa0a5de?{'count':_0x43377d,'rows':_0xa0a5de}:null;}})[_0x999e('0x28')](respondWithResult(_0x48e0ca,null))[_0x999e('0x47')](handleError(_0x48e0ca,null));}; \ No newline at end of file +var _0x34d4=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','VtigerConfiguration','include','findAll','then','rows','catch','params','rawAttributes','find','create','body','getFields','findOne','VtigerField','getSubjects','pick','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x34d4,0x12e));var _0x434d=function(_0x34fba1,_0x5a091b){_0x34fba1=_0x34fba1-0x0;var _0x1c1314=_0x34d4[_0x34fba1];return _0x1c1314;};'use strict';var emlformat=require(_0x434d('0x0'));var rimraf=require(_0x434d('0x1'));var zipdir=require(_0x434d('0x2'));var jsonpatch=require(_0x434d('0x3'));var rp=require('request-promise');var moment=require(_0x434d('0x4'));var BPromise=require(_0x434d('0x5'));var Mustache=require('mustache');var util=require(_0x434d('0x6'));var path=require(_0x434d('0x7'));var sox=require(_0x434d('0x8'));var csv=require(_0x434d('0x9'));var ejs=require(_0x434d('0xa'));var fs=require('fs');var fs_extra=require(_0x434d('0xb'));var _=require(_0x434d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x434d('0xd'));var deskjs=require(_0x434d('0xe'));var toCsv=require(_0x434d('0x9'));var querystring=require(_0x434d('0xf'));var Papa=require(_0x434d('0x10'));var Redis=require(_0x434d('0x11'));var authService=require(_0x434d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x434d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x434d('0x14'))(_0x434d('0x15'));var utils=require(_0x434d('0x16'));var config=require(_0x434d('0x17'));var licenseUtil=require(_0x434d('0x18'));var db=require(_0x434d('0x19'))['db'];function respondWithStatusCode(_0x1b33e0,_0x4f2d7f){_0x4f2d7f=_0x4f2d7f||0xcc;return function(_0x531c16){if(_0x531c16){return _0x1b33e0[_0x434d('0x1a')](_0x4f2d7f);}return _0x1b33e0[_0x434d('0x1b')](_0x4f2d7f)[_0x434d('0x1c')]();};}function respondWithResult(_0x125984,_0x394cd6){_0x394cd6=_0x394cd6||0xc8;return function(_0x21db0f){if(_0x21db0f){return _0x125984[_0x434d('0x1b')](_0x394cd6)[_0x434d('0x1d')](_0x21db0f);}};}function respondWithFilteredResult(_0x213d0d,_0x150e67){return function(_0x3e8b8e){if(_0x3e8b8e){var _0x124207=typeof _0x150e67[_0x434d('0x1e')]==='undefined'&&typeof _0x150e67[_0x434d('0x1f')]===_0x434d('0x20');var _0x133a0c=_0x3e8b8e[_0x434d('0x21')];var _0x2259cc=_0x124207?0x0:_0x150e67['offset'];var _0x3d7d8c=_0x124207?_0x3e8b8e['count']:_0x150e67[_0x434d('0x1e')]+_0x150e67['limit'];var _0x48f618;if(_0x3d7d8c>=_0x133a0c){_0x3d7d8c=_0x133a0c;_0x48f618=0xc8;}else{_0x48f618=0xce;}_0x213d0d[_0x434d('0x1b')](_0x48f618);return _0x213d0d[_0x434d('0x22')]('Content-Range',_0x2259cc+'-'+_0x3d7d8c+'/'+_0x133a0c)[_0x434d('0x1d')](_0x3e8b8e);}return null;};}function patchUpdates(_0x9a7144){return function(_0x4f1903){try{jsonpatch[_0x434d('0x23')](_0x4f1903,_0x9a7144,!![]);}catch(_0x512348){return BPromise[_0x434d('0x24')](_0x512348);}return _0x4f1903[_0x434d('0x25')]();};}function saveUpdates(_0x88cd14,_0x43ccbc){return function(_0x15c677){if(_0x15c677){return _0x15c677['update'](_0x88cd14)['then'](function(_0x164d1b){return _0x164d1b;});}return null;};}function removeEntity(_0x2ad9da,_0x4b6e47){return function(_0xaed330){if(_0xaed330){return _0xaed330[_0x434d('0x26')]()['then'](function(){_0x2ad9da[_0x434d('0x1b')](0xcc)[_0x434d('0x1c')]();});}};}function handleEntityNotFound(_0x36a757,_0x48cdaf){return function(_0x350a56){if(!_0x350a56){_0x36a757[_0x434d('0x1a')](0x194);}return _0x350a56;};}function handleError(_0x5ed576,_0x25d7f8){_0x25d7f8=_0x25d7f8||0x1f4;return function(_0x4f0493){logger[_0x434d('0x27')](_0x4f0493[_0x434d('0x28')]);if(_0x4f0493[_0x434d('0x29')]){delete _0x4f0493[_0x434d('0x29')];}_0x5ed576[_0x434d('0x1b')](_0x25d7f8)[_0x434d('0x2a')](_0x4f0493);};}exports[_0x434d('0x2b')]=function(_0x4450df,_0x8d39b7){var _0x522614={},_0x1d47b6={},_0x54fa09={'count':0x0,'rows':[]};var _0x2fee29=_[_0x434d('0x2c')](db['VtigerConfiguration']['rawAttributes'],function(_0x177005){return{'name':_0x177005[_0x434d('0x2d')],'type':_0x177005[_0x434d('0x2e')][_0x434d('0x2f')]};});_0x1d47b6[_0x434d('0x30')]=_['map'](_0x2fee29,_0x434d('0x29'));_0x1d47b6[_0x434d('0x31')]=_[_0x434d('0x32')](_0x4450df[_0x434d('0x31')]);_0x1d47b6[_0x434d('0x33')]=_[_0x434d('0x34')](_0x1d47b6[_0x434d('0x30')],_0x1d47b6[_0x434d('0x31')]);_0x522614[_0x434d('0x35')]=_[_0x434d('0x34')](_0x1d47b6[_0x434d('0x30')],qs[_0x434d('0x36')](_0x4450df['query'][_0x434d('0x36')]));_0x522614[_0x434d('0x35')]=_0x522614[_0x434d('0x35')][_0x434d('0x37')]?_0x522614['attributes']:_0x1d47b6[_0x434d('0x30')];if(!_0x4450df[_0x434d('0x31')][_0x434d('0x38')](_0x434d('0x39'))){_0x522614[_0x434d('0x1f')]=qs[_0x434d('0x1f')](_0x4450df[_0x434d('0x31')][_0x434d('0x1f')]);_0x522614['offset']=qs[_0x434d('0x1e')](_0x4450df['query'][_0x434d('0x1e')]);}_0x522614[_0x434d('0x3a')]=qs['sort'](_0x4450df[_0x434d('0x31')][_0x434d('0x3b')]);_0x522614[_0x434d('0x3c')]=qs['filters'](_['pick'](_0x4450df[_0x434d('0x31')],_0x1d47b6[_0x434d('0x33')]),_0x2fee29);if(_0x4450df[_0x434d('0x31')]['filter']){_0x522614['where']=_[_0x434d('0x3d')](_0x522614[_0x434d('0x3c')],{'$or':_['map'](_0x2fee29,function(_0x3c168d){if(_0x3c168d['type']!=='VIRTUAL'){var _0x31a89a={};_0x31a89a[_0x3c168d[_0x434d('0x29')]]={'$like':'%'+_0x4450df[_0x434d('0x31')][_0x434d('0x3e')]+'%'};return _0x31a89a;}})});}_0x522614=_[_0x434d('0x3d')]({},_0x522614,_0x4450df[_0x434d('0x3f')]);var _0x4143c6={'where':_0x522614[_0x434d('0x3c')]};return db[_0x434d('0x40')][_0x434d('0x21')](_0x4143c6)['then'](function(_0x1c7362){_0x54fa09[_0x434d('0x21')]=_0x1c7362;if(_0x4450df[_0x434d('0x31')]['includeAll']){_0x522614[_0x434d('0x41')]=[{'all':!![]}];}return db[_0x434d('0x40')][_0x434d('0x42')](_0x522614);})[_0x434d('0x43')](function(_0x4905e5){_0x54fa09[_0x434d('0x44')]=_0x4905e5;return _0x54fa09;})['then'](respondWithFilteredResult(_0x8d39b7,_0x522614))[_0x434d('0x45')](handleError(_0x8d39b7,null));};exports['show']=function(_0x196bc5,_0x3176c4){var _0x27566f={'raw':![],'where':{'id':_0x196bc5[_0x434d('0x46')]['id']}},_0x11aec2={};_0x11aec2[_0x434d('0x30')]=_[_0x434d('0x32')](db[_0x434d('0x40')][_0x434d('0x47')]);_0x11aec2[_0x434d('0x31')]=_[_0x434d('0x32')](_0x196bc5['query']);_0x11aec2[_0x434d('0x33')]=_[_0x434d('0x34')](_0x11aec2[_0x434d('0x30')],_0x11aec2[_0x434d('0x31')]);_0x27566f[_0x434d('0x35')]=_[_0x434d('0x34')](_0x11aec2[_0x434d('0x30')],qs[_0x434d('0x36')](_0x196bc5[_0x434d('0x31')][_0x434d('0x36')]));_0x27566f[_0x434d('0x35')]=_0x27566f[_0x434d('0x35')][_0x434d('0x37')]?_0x27566f[_0x434d('0x35')]:_0x11aec2[_0x434d('0x30')];if(_0x196bc5[_0x434d('0x31')]['includeAll']){_0x27566f[_0x434d('0x41')]=[{'all':!![]}];}_0x27566f=_['merge']({},_0x27566f,_0x196bc5[_0x434d('0x3f')]);return db[_0x434d('0x40')][_0x434d('0x48')](_0x27566f)[_0x434d('0x43')](handleEntityNotFound(_0x3176c4,null))[_0x434d('0x43')](respondWithResult(_0x3176c4,null))[_0x434d('0x45')](handleError(_0x3176c4,null));};exports[_0x434d('0x49')]=function(_0x4ab0b2,_0x4936bf){return db[_0x434d('0x40')][_0x434d('0x49')](_0x4ab0b2[_0x434d('0x4a')],{})[_0x434d('0x43')](respondWithResult(_0x4936bf,0xc9))[_0x434d('0x45')](handleError(_0x4936bf,null));};exports['update']=function(_0x1fa7c9,_0x423e86){if(_0x1fa7c9[_0x434d('0x4a')]['id']){delete _0x1fa7c9[_0x434d('0x4a')]['id'];}return db[_0x434d('0x40')]['find']({'where':{'id':_0x1fa7c9[_0x434d('0x46')]['id']}})[_0x434d('0x43')](handleEntityNotFound(_0x423e86,null))[_0x434d('0x43')](saveUpdates(_0x1fa7c9['body'],null))[_0x434d('0x43')](respondWithResult(_0x423e86,null))[_0x434d('0x45')](handleError(_0x423e86,null));};exports['destroy']=function(_0x584612,_0x579c27){return db[_0x434d('0x40')]['find']({'where':{'id':_0x584612['params']['id']}})[_0x434d('0x43')](handleEntityNotFound(_0x579c27,null))[_0x434d('0x43')](removeEntity(_0x579c27,null))['catch'](handleError(_0x579c27,null));};exports[_0x434d('0x4b')]=function(_0x23cf3f,_0x25cb86,_0x2ac32f){var _0x4e8dfa={};var _0x9c1402={};var _0x541f4a;var _0x451483;return db[_0x434d('0x40')][_0x434d('0x4c')]({'where':{'id':_0x23cf3f['params']['id']}})[_0x434d('0x43')](handleEntityNotFound(_0x25cb86,null))['then'](function(_0x36de2a){if(_0x36de2a){_0x541f4a=_0x36de2a;_0x9c1402[_0x434d('0x30')]=_['keys'](db[_0x434d('0x4d')][_0x434d('0x47')]);_0x9c1402[_0x434d('0x31')]=_[_0x434d('0x32')](_0x23cf3f['query']);_0x9c1402['filters']=_[_0x434d('0x34')](_0x9c1402['model'],_0x9c1402[_0x434d('0x31')]);_0x4e8dfa['attributes']=_[_0x434d('0x34')](_0x9c1402['model'],qs[_0x434d('0x36')](_0x23cf3f[_0x434d('0x31')][_0x434d('0x36')]));_0x4e8dfa[_0x434d('0x35')]=_0x4e8dfa[_0x434d('0x35')][_0x434d('0x37')]?_0x4e8dfa[_0x434d('0x35')]:_0x9c1402[_0x434d('0x30')];_0x4e8dfa['order']=qs[_0x434d('0x3b')](_0x23cf3f[_0x434d('0x31')]['sort']);_0x4e8dfa[_0x434d('0x3c')]=qs[_0x434d('0x33')](_['pick'](_0x23cf3f[_0x434d('0x31')],_0x9c1402[_0x434d('0x33')]));if(_0x23cf3f[_0x434d('0x31')][_0x434d('0x3e')]){_0x4e8dfa[_0x434d('0x3c')]=_[_0x434d('0x3d')](_0x4e8dfa[_0x434d('0x3c')],{'$or':_['map'](_0x4e8dfa[_0x434d('0x35')],function(_0xb8dc14){var _0xcedd94={};_0xcedd94[_0xb8dc14]={'$like':'%'+_0x23cf3f['query']['filter']+'%'};return _0xcedd94;})});}_0x4e8dfa=_[_0x434d('0x3d')]({},_0x4e8dfa,_0x23cf3f[_0x434d('0x3f')]);return _0x541f4a[_0x434d('0x4b')](_0x4e8dfa);}})[_0x434d('0x43')](function(_0x33a067){if(_0x33a067){_0x451483=_0x33a067[_0x434d('0x37')];if(!_0x23cf3f[_0x434d('0x31')][_0x434d('0x38')](_0x434d('0x39'))){_0x4e8dfa['limit']=qs[_0x434d('0x1f')](_0x23cf3f['query'][_0x434d('0x1f')]);_0x4e8dfa['offset']=qs['offset'](_0x23cf3f[_0x434d('0x31')][_0x434d('0x1e')]);}return _0x541f4a[_0x434d('0x4b')](_0x4e8dfa);}})['then'](function(_0xc204b4){if(_0xc204b4){return _0xc204b4?{'count':_0x451483,'rows':_0xc204b4}:null;}})['then'](respondWithResult(_0x25cb86,null))['catch'](handleError(_0x25cb86,null));};exports[_0x434d('0x4e')]=function(_0x176aa6,_0xbd1114,_0xb4e3ab){var _0x38e568={};var _0x50921b={};var _0x4cf8ae;var _0x55ba2f;return db['VtigerConfiguration'][_0x434d('0x4c')]({'where':{'id':_0x176aa6[_0x434d('0x46')]['id']}})[_0x434d('0x43')](handleEntityNotFound(_0xbd1114,null))[_0x434d('0x43')](function(_0x59da43){if(_0x59da43){_0x4cf8ae=_0x59da43;_0x50921b[_0x434d('0x30')]=_[_0x434d('0x32')](db[_0x434d('0x4d')][_0x434d('0x47')]);_0x50921b[_0x434d('0x31')]=_[_0x434d('0x32')](_0x176aa6['query']);_0x50921b[_0x434d('0x33')]=_['intersection'](_0x50921b[_0x434d('0x30')],_0x50921b[_0x434d('0x31')]);_0x38e568['attributes']=_[_0x434d('0x34')](_0x50921b[_0x434d('0x30')],qs[_0x434d('0x36')](_0x176aa6[_0x434d('0x31')][_0x434d('0x36')]));_0x38e568['attributes']=_0x38e568[_0x434d('0x35')][_0x434d('0x37')]?_0x38e568[_0x434d('0x35')]:_0x50921b['model'];_0x38e568['order']=qs[_0x434d('0x3b')](_0x176aa6['query']['sort']);_0x38e568[_0x434d('0x3c')]=qs['filters'](_[_0x434d('0x4f')](_0x176aa6[_0x434d('0x31')],_0x50921b[_0x434d('0x33')]));if(_0x176aa6[_0x434d('0x31')]['filter']){_0x38e568[_0x434d('0x3c')]=_[_0x434d('0x3d')](_0x38e568[_0x434d('0x3c')],{'$or':_['map'](_0x38e568[_0x434d('0x35')],function(_0x39ca56){var _0x22ac4a={};_0x22ac4a[_0x39ca56]={'$like':'%'+_0x176aa6['query'][_0x434d('0x3e')]+'%'};return _0x22ac4a;})});}_0x38e568=_['merge']({},_0x38e568,_0x176aa6[_0x434d('0x3f')]);return _0x4cf8ae[_0x434d('0x4e')](_0x38e568);}})['then'](function(_0x3f9c00){if(_0x3f9c00){_0x55ba2f=_0x3f9c00[_0x434d('0x37')];if(!_0x176aa6[_0x434d('0x31')][_0x434d('0x38')](_0x434d('0x39'))){_0x38e568[_0x434d('0x1f')]=qs[_0x434d('0x1f')](_0x176aa6[_0x434d('0x31')][_0x434d('0x1f')]);_0x38e568[_0x434d('0x1e')]=qs[_0x434d('0x1e')](_0x176aa6[_0x434d('0x31')][_0x434d('0x1e')]);}return _0x4cf8ae['getSubjects'](_0x38e568);}})[_0x434d('0x43')](function(_0x26c8c1){if(_0x26c8c1){return _0x26c8c1?{'count':_0x55ba2f,'rows':_0x26c8c1}:null;}})[_0x434d('0x43')](respondWithResult(_0xbd1114,null))[_0x434d('0x45')](handleError(_0xbd1114,null));};exports[_0x434d('0x50')]=function(_0x2d9feb,_0x10f224,_0xf877){var _0x5ace4d={};var _0x64a18={};var _0x2de3ae;var _0x5443fa;return db['VtigerConfiguration'][_0x434d('0x4c')]({'where':{'id':_0x2d9feb['params']['id']}})[_0x434d('0x43')](handleEntityNotFound(_0x10f224,null))[_0x434d('0x43')](function(_0x23dab5){if(_0x23dab5){_0x2de3ae=_0x23dab5;_0x64a18[_0x434d('0x30')]=_[_0x434d('0x32')](db['VtigerField']['rawAttributes']);_0x64a18['query']=_[_0x434d('0x32')](_0x2d9feb[_0x434d('0x31')]);_0x64a18[_0x434d('0x33')]=_['intersection'](_0x64a18[_0x434d('0x30')],_0x64a18[_0x434d('0x31')]);_0x5ace4d[_0x434d('0x35')]=_[_0x434d('0x34')](_0x64a18[_0x434d('0x30')],qs['fields'](_0x2d9feb['query'][_0x434d('0x36')]));_0x5ace4d['attributes']=_0x5ace4d['attributes']['length']?_0x5ace4d[_0x434d('0x35')]:_0x64a18[_0x434d('0x30')];_0x5ace4d[_0x434d('0x3a')]=qs['sort'](_0x2d9feb['query'][_0x434d('0x3b')]);_0x5ace4d['where']=qs[_0x434d('0x33')](_[_0x434d('0x4f')](_0x2d9feb['query'],_0x64a18['filters']));if(_0x2d9feb[_0x434d('0x31')][_0x434d('0x3e')]){_0x5ace4d[_0x434d('0x3c')]=_[_0x434d('0x3d')](_0x5ace4d['where'],{'$or':_['map'](_0x5ace4d[_0x434d('0x35')],function(_0x59285d){var _0x3c5f88={};_0x3c5f88[_0x59285d]={'$like':'%'+_0x2d9feb['query'][_0x434d('0x3e')]+'%'};return _0x3c5f88;})});}_0x5ace4d=_[_0x434d('0x3d')]({},_0x5ace4d,_0x2d9feb[_0x434d('0x3f')]);return _0x2de3ae['getDescriptions'](_0x5ace4d);}})['then'](function(_0x1b3db5){if(_0x1b3db5){_0x5443fa=_0x1b3db5[_0x434d('0x37')];if(!_0x2d9feb['query'][_0x434d('0x38')](_0x434d('0x39'))){_0x5ace4d[_0x434d('0x1f')]=qs['limit'](_0x2d9feb[_0x434d('0x31')][_0x434d('0x1f')]);_0x5ace4d['offset']=qs[_0x434d('0x1e')](_0x2d9feb[_0x434d('0x31')]['offset']);}return _0x2de3ae[_0x434d('0x50')](_0x5ace4d);}})[_0x434d('0x43')](function(_0x58fd8e){if(_0x58fd8e){return _0x58fd8e?{'count':_0x5443fa,'rows':_0x58fd8e}:null;}})['then'](respondWithResult(_0x10f224,null))[_0x434d('0x45')](handleError(_0x10f224,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4e5f3e2..98e1d7c 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 _0x3f05=['util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x55953c,_0x7a02ee){var _0x59b980=function(_0x2c7fd9){while(--_0x2c7fd9){_0x55953c['push'](_0x55953c['shift']());}};_0x59b980(++_0x7a02ee);}(_0x3f05,0x64));var _0x53f0=function(_0x2eb355,_0x3f0a5a){_0x2eb355=_0x2eb355-0x0;var _0x18a043=_0x3f05[_0x2eb355];return _0x18a043;};'use strict';var _=require('lodash');var util=require(_0x53f0('0x0'));var logger=require(_0x53f0('0x1'))('api');var moment=require(_0x53f0('0x2'));var BPromise=require(_0x53f0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x53f0('0x4'));var config=require(_0x53f0('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x53f0('0x6')]=function(_0x209cbf,_0x6baa7c){return _0x209cbf[_0x53f0('0x7')](_0x53f0('0x8'),attributes,{'tableName':_0x53f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8b5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x6d2495,_0x2f9d1a){var _0x2e57fe=function(_0x11ce98){while(--_0x11ce98){_0x6d2495['push'](_0x6d2495['shift']());}};_0x2e57fe(++_0x2f9d1a);}(_0xb8b5,0x186));var _0x5b8b=function(_0xf1ee6f,_0x1b7aa8){_0xf1ee6f=_0xf1ee6f-0x0;var _0x59e5d3=_0xb8b5[_0xf1ee6f];return _0x59e5d3;};'use strict';var _=require(_0x5b8b('0x0'));var util=require(_0x5b8b('0x1'));var logger=require(_0x5b8b('0x2'))(_0x5b8b('0x3'));var moment=require(_0x5b8b('0x4'));var BPromise=require(_0x5b8b('0x5'));var rp=require(_0x5b8b('0x6'));var fs=require('fs');var path=require(_0x5b8b('0x7'));var rimraf=require(_0x5b8b('0x8'));var config=require(_0x5b8b('0x9'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x53ac34,_0x5973ca){return _0x53ac34[_0x5b8b('0xa')](_0x5b8b('0xb'),attributes,{'tableName':_0x5b8b('0xc'),'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 6738d16..80eb06f 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 _0x917b=['client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1cf3fb,_0x4e76d5){var _0x31664f=function(_0x53dc52){while(--_0x53dc52){_0x1cf3fb['push'](_0x1cf3fb['shift']());}};_0x31664f(++_0x4e76d5);}(_0x917b,0xe8));var _0xb917=function(_0x215130,_0x42173d){_0x215130=_0x215130-0x0;var _0x5d31d6=_0x917b[_0x215130];return _0x5d31d6;};'use strict';var _=require(_0xb917('0x0'));var util=require('util');var moment=require(_0xb917('0x1'));var BPromise=require(_0xb917('0x2'));var rs=require(_0xb917('0x3'));var fs=require('fs');var Redis=require(_0xb917('0x4'));var db=require(_0xb917('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb917('0x6'))(_0xb917('0x7'));var config=require(_0xb917('0x8'));var jayson=require(_0xb917('0x9'));var client=jayson[_0xb917('0xa')][_0xb917('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16c558,_0x374a54,_0x37c07e){return new BPromise(function(_0x3899bd,_0x1e8235){return client[_0xb917('0xc')](_0x16c558,_0x37c07e)[_0xb917('0xd')](function(_0x412fa6){logger[_0xb917('0xe')](_0xb917('0xf'),_0x374a54,'request\x20sent');logger['debug'](_0xb917('0x10'),_0x374a54,'request\x20sent',JSON['stringify'](_0x412fa6));if(_0x412fa6['error']){if(_0x412fa6[_0xb917('0x11')][_0xb917('0x12')]===0x1f4){logger[_0xb917('0x11')](_0xb917('0xf'),_0x374a54,_0x412fa6[_0xb917('0x11')][_0xb917('0x13')]);return _0x1e8235(_0x412fa6['error'][_0xb917('0x13')]);}logger['error'](_0xb917('0xf'),_0x374a54,_0x412fa6[_0xb917('0x11')]['message']);return _0x3899bd(_0x412fa6[_0xb917('0x11')][_0xb917('0x13')]);}else{logger[_0xb917('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x374a54,_0xb917('0x14'));_0x3899bd(_0x412fa6['result'][_0xb917('0x13')]);}})[_0xb917('0x15')](function(_0x3dbe0e){logger[_0xb917('0x11')](_0xb917('0xf'),_0x374a54,_0x3dbe0e);_0x1e8235(_0x3dbe0e);});});} \ No newline at end of file +var _0x065b=['error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x7403d8,_0x29fc21){var _0x598476=function(_0x1a676a){while(--_0x1a676a){_0x7403d8['push'](_0x7403d8['shift']());}};_0x598476(++_0x29fc21);}(_0x065b,0x1a8));var _0xb065=function(_0x1ad992,_0x5ddc63){_0x1ad992=_0x1ad992-0x0;var _0x535234=_0x065b[_0x1ad992];return _0x535234;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb065('0x0'));var BPromise=require('bluebird');var rs=require(_0xb065('0x1'));var fs=require('fs');var Redis=require(_0xb065('0x2'));var db=require(_0xb065('0x3'))['db'];var utils=require(_0xb065('0x4'));var logger=require(_0xb065('0x5'))(_0xb065('0x6'));var config=require(_0xb065('0x7'));var jayson=require(_0xb065('0x8'));var client=jayson['client'][_0xb065('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce622,_0xd0bda7,_0x3a4c6f){return new BPromise(function(_0x59ac11,_0x45509d){return client[_0xb065('0xa')](_0x3ce622,_0x3a4c6f)['then'](function(_0xb19828){logger[_0xb065('0xb')](_0xb065('0xc'),_0xd0bda7,_0xb065('0xd'));logger[_0xb065('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xd0bda7,_0xb065('0xd'),JSON[_0xb065('0xf')](_0xb19828));if(_0xb19828[_0xb065('0x10')]){if(_0xb19828['error'][_0xb065('0x11')]===0x1f4){logger[_0xb065('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0xd0bda7,_0xb19828['error'][_0xb065('0x12')]);return _0x45509d(_0xb19828[_0xb065('0x10')][_0xb065('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0xd0bda7,_0xb19828[_0xb065('0x10')][_0xb065('0x12')]);return _0x59ac11(_0xb19828['error'][_0xb065('0x12')]);}else{logger[_0xb065('0xb')](_0xb065('0xc'),_0xd0bda7,'request\x20sent');_0x59ac11(_0xb19828[_0xb065('0x13')][_0xb065('0x12')]);}})['catch'](function(_0x5e4457){logger[_0xb065('0x10')](_0xb065('0xc'),_0xd0bda7,_0x5e4457);_0x45509d(_0x5e4457);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d878ba9..d86c33c 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 _0x9e97=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','show','post'];(function(_0x54b907,_0x29ff96){var _0x363d89=function(_0x184d8f){while(--_0x184d8f){_0x54b907['push'](_0x54b907['shift']());}};_0x363d89(++_0x29ff96);}(_0x9e97,0x1bf));var _0x79e9=function(_0x23f8be,_0x34ea95){_0x23f8be=_0x23f8be-0x0;var _0x1ac3e6=_0x9e97[_0x23f8be];return _0x1ac3e6;};'use strict';var multer=require(_0x79e9('0x0'));var util=require(_0x79e9('0x1'));var path=require(_0x79e9('0x2'));var timeout=require(_0x79e9('0x3'));var express=require('express');var router=express[_0x79e9('0x4')]();var fs_extra=require(_0x79e9('0x5'));var auth=require(_0x79e9('0x6'));var interaction=require(_0x79e9('0x7'));var config=require('../../config/environment');var controller=require(_0x79e9('0x8'));router[_0x79e9('0x9')]('/',auth[_0x79e9('0xa')](),controller['index']);router[_0x79e9('0x9')]('/:id',auth[_0x79e9('0xa')](),controller[_0x79e9('0xb')]);router[_0x79e9('0xc')]('/',auth[_0x79e9('0xa')](),controller[_0x79e9('0xd')]);router[_0x79e9('0xe')](_0x79e9('0xf'),auth['isAuthenticated'](),controller[_0x79e9('0x10')]);router[_0x79e9('0x11')](_0x79e9('0xf'),auth['isAuthenticated'](),controller[_0x79e9('0x12')]);module[_0x79e9('0x13')]=router; \ No newline at end of file +var _0xc52e=['path','Router','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','destroy','exports','multer','util'];(function(_0x13659a,_0x41453c){var _0x4b1c49=function(_0x270c47){while(--_0x270c47){_0x13659a['push'](_0x13659a['shift']());}};_0x4b1c49(++_0x41453c);}(_0xc52e,0x194));var _0xec52=function(_0x132990,_0x1370c9){_0x132990=_0x132990-0x0;var _0x2aa89d=_0xc52e[_0x132990];return _0x2aa89d;};'use strict';var multer=require(_0xec52('0x0'));var util=require(_0xec52('0x1'));var path=require(_0xec52('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xec52('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec52('0x4'));var controller=require('./intVtigerField.controller');router[_0xec52('0x5')]('/',auth['isAuthenticated'](),controller[_0xec52('0x6')]);router[_0xec52('0x5')](_0xec52('0x7'),auth['isAuthenticated'](),controller[_0xec52('0x8')]);router[_0xec52('0x9')]('/',auth[_0xec52('0xa')](),controller[_0xec52('0xb')]);router['put']('/:id',auth[_0xec52('0xa')](),controller['update']);router['delete']('/:id',auth[_0xec52('0xa')](),controller[_0xec52('0xc')]);module[_0xec52('0xd')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 0900115..08e45e9 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 _0xcf60=['sequelize','ENUM','variable','picklist','string','customVariable','BOOLEAN','STRING'];(function(_0x34695d,_0x5b5e4f){var _0x4698cc=function(_0x347d80){while(--_0x347d80){_0x34695d['push'](_0x34695d['shift']());}};_0x4698cc(++_0x5b5e4f);}(_0xcf60,0x100));var _0x0cf6=function(_0x2a5346,_0x472fe1){_0x2a5346=_0x2a5346-0x0;var _0x10694e=_0xcf60[_0x2a5346];return _0x10694e;};'use strict';var Sequelize=require(_0x0cf6('0x0'));module['exports']={'type':{'type':Sequelize[_0x0cf6('0x1')]('string',_0x0cf6('0x2'),'customVariable','keyValue',_0x0cf6('0x3')),'defaultValue':_0x0cf6('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0cf6('0x4'),'variable',_0x0cf6('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0cf6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cf6('0x7')]}}; \ No newline at end of file +var _0x922e=['STRING','ENUM','variable','customVariable','string'];(function(_0x1c781b,_0x45e3da){var _0x2a4c0e=function(_0x3c0b18){while(--_0x3c0b18){_0x1c781b['push'](_0x1c781b['shift']());}};_0x2a4c0e(++_0x45e3da);}(_0x922e,0x105));var _0xe922=function(_0x17b07f,_0x27a4a4){_0x17b07f=_0x17b07f-0x0;var _0x12c1cc=_0x922e[_0x17b07f];return _0x12c1cc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe922('0x0')]('string',_0xe922('0x1'),_0xe922('0x2'),'keyValue','picklist'),'defaultValue':_0xe922('0x3')},'content':{'type':Sequelize[_0xe922('0x4')]},'key':{'type':Sequelize[_0xe922('0x4')]},'keyType':{'type':Sequelize[_0xe922('0x0')](_0xe922('0x3'),'variable',_0xe922('0x2'))},'keyContent':{'type':Sequelize[_0xe922('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe922('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 96f4feb..e7bb178 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 _0xc3f7=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map','VtigerField','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0xc45c30,_0x206f01){var _0x22797e=function(_0x1c6033){while(--_0x1c6033){_0xc45c30['push'](_0xc45c30['shift']());}};_0x22797e(++_0x206f01);}(_0xc3f7,0xc8));var _0x7c3f=function(_0x54880a,_0x4ce03c){_0x54880a=_0x54880a-0x0;var _0x2eae69=_0xc3f7[_0x54880a];return _0x2eae69;};'use strict';var emlformat=require(_0x7c3f('0x0'));var rimraf=require(_0x7c3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c3f('0x2'));var rp=require(_0x7c3f('0x3'));var moment=require(_0x7c3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7c3f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7c3f('0x6'));var ejs=require(_0x7c3f('0x7'));var fs=require('fs');var fs_extra=require(_0x7c3f('0x8'));var _=require(_0x7c3f('0x9'));var squel=require(_0x7c3f('0xa'));var crypto=require('crypto');var jsforce=require(_0x7c3f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7c3f('0x6'));var querystring=require(_0x7c3f('0xc'));var Papa=require(_0x7c3f('0xd'));var Redis=require(_0x7c3f('0xe'));var authService=require(_0x7c3f('0xf'));var qs=require(_0x7c3f('0x10'));var as=require(_0x7c3f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c3f('0x12'));var utils=require(_0x7c3f('0x13'));var config=require(_0x7c3f('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x689b5e,_0x2ef023){_0x2ef023=_0x2ef023||0xcc;return function(_0x2d5056){if(_0x2d5056){return _0x689b5e[_0x7c3f('0x15')](_0x2ef023);}return _0x689b5e[_0x7c3f('0x16')](_0x2ef023)[_0x7c3f('0x17')]();};}function respondWithResult(_0x389812,_0x19619c){_0x19619c=_0x19619c||0xc8;return function(_0x1d7462){if(_0x1d7462){return _0x389812[_0x7c3f('0x16')](_0x19619c)[_0x7c3f('0x18')](_0x1d7462);}};}function respondWithFilteredResult(_0x5d99e5,_0x2f30cf){return function(_0x31508e){if(_0x31508e){var _0x4a850b=typeof _0x2f30cf[_0x7c3f('0x19')]===_0x7c3f('0x1a')&&typeof _0x2f30cf[_0x7c3f('0x1b')]===_0x7c3f('0x1a');var _0x1ccd21=_0x31508e[_0x7c3f('0x1c')];var _0x40ac4b=_0x4a850b?0x0:_0x2f30cf[_0x7c3f('0x19')];var _0x5e5593=_0x4a850b?_0x31508e['count']:_0x2f30cf[_0x7c3f('0x19')]+_0x2f30cf['limit'];var _0x5538df;if(_0x5e5593>=_0x1ccd21){_0x5e5593=_0x1ccd21;_0x5538df=0xc8;}else{_0x5538df=0xce;}_0x5d99e5['status'](_0x5538df);return _0x5d99e5[_0x7c3f('0x1d')](_0x7c3f('0x1e'),_0x40ac4b+'-'+_0x5e5593+'/'+_0x1ccd21)[_0x7c3f('0x18')](_0x31508e);}return null;};}function patchUpdates(_0x7d337d){return function(_0x53a002){try{jsonpatch[_0x7c3f('0x1f')](_0x53a002,_0x7d337d,!![]);}catch(_0x582f4e){return BPromise[_0x7c3f('0x20')](_0x582f4e);}return _0x53a002[_0x7c3f('0x21')]();};}function saveUpdates(_0x1c69a1,_0x3c4838){return function(_0x3c2356){if(_0x3c2356){return _0x3c2356[_0x7c3f('0x22')](_0x1c69a1)[_0x7c3f('0x23')](function(_0x45b48e){return _0x45b48e;});}return null;};}function removeEntity(_0xb230e5,_0x1c90d2){return function(_0x1c969b){if(_0x1c969b){return _0x1c969b[_0x7c3f('0x24')]()[_0x7c3f('0x23')](function(){_0xb230e5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afb5d,_0x217425){return function(_0x438afe){if(!_0x438afe){_0x1afb5d[_0x7c3f('0x15')](0x194);}return _0x438afe;};}function handleError(_0x7f809b,_0x516f3a){_0x516f3a=_0x516f3a||0x1f4;return function(_0x3a4378){logger[_0x7c3f('0x25')](_0x3a4378['stack']);if(_0x3a4378[_0x7c3f('0x26')]){delete _0x3a4378[_0x7c3f('0x26')];}_0x7f809b[_0x7c3f('0x16')](_0x516f3a)['send'](_0x3a4378);};}exports['index']=function(_0x591e58,_0x5c5963){var _0x484539={},_0x1d30e7={},_0x2d2155={'count':0x0,'rows':[]};var _0x4bc806=_[_0x7c3f('0x27')](db[_0x7c3f('0x28')]['rawAttributes'],function(_0x46f718){return{'name':_0x46f718['fieldName'],'type':_0x46f718['type'][_0x7c3f('0x29')]};});_0x1d30e7['model']=_[_0x7c3f('0x27')](_0x4bc806,_0x7c3f('0x26'));_0x1d30e7[_0x7c3f('0x2a')]=_[_0x7c3f('0x2b')](_0x591e58[_0x7c3f('0x2a')]);_0x1d30e7[_0x7c3f('0x2c')]=_[_0x7c3f('0x2d')](_0x1d30e7[_0x7c3f('0x2e')],_0x1d30e7[_0x7c3f('0x2a')]);_0x484539[_0x7c3f('0x2f')]=_['intersection'](_0x1d30e7['model'],qs['fields'](_0x591e58['query'][_0x7c3f('0x30')]));_0x484539[_0x7c3f('0x2f')]=_0x484539[_0x7c3f('0x2f')][_0x7c3f('0x31')]?_0x484539['attributes']:_0x1d30e7[_0x7c3f('0x2e')];if(!_0x591e58[_0x7c3f('0x2a')]['hasOwnProperty'](_0x7c3f('0x32'))){_0x484539[_0x7c3f('0x1b')]=qs['limit'](_0x591e58[_0x7c3f('0x2a')][_0x7c3f('0x1b')]);_0x484539['offset']=qs['offset'](_0x591e58[_0x7c3f('0x2a')][_0x7c3f('0x19')]);}_0x484539[_0x7c3f('0x33')]=qs['sort'](_0x591e58[_0x7c3f('0x2a')][_0x7c3f('0x34')]);_0x484539[_0x7c3f('0x35')]=qs[_0x7c3f('0x2c')](_[_0x7c3f('0x36')](_0x591e58[_0x7c3f('0x2a')],_0x1d30e7[_0x7c3f('0x2c')]),_0x4bc806);if(_0x591e58['query'][_0x7c3f('0x37')]){_0x484539[_0x7c3f('0x35')]=_[_0x7c3f('0x38')](_0x484539['where'],{'$or':_[_0x7c3f('0x27')](_0x4bc806,function(_0x41fe35){if(_0x41fe35[_0x7c3f('0x39')]!==_0x7c3f('0x3a')){var _0x2fee33={};_0x2fee33[_0x41fe35['name']]={'$like':'%'+_0x591e58['query']['filter']+'%'};return _0x2fee33;}})});}_0x484539=_[_0x7c3f('0x38')]({},_0x484539,_0x591e58[_0x7c3f('0x3b')]);var _0x200365={'where':_0x484539[_0x7c3f('0x35')]};return db['VtigerField']['count'](_0x200365)[_0x7c3f('0x23')](function(_0x414bcd){_0x2d2155[_0x7c3f('0x1c')]=_0x414bcd;if(_0x591e58['query'][_0x7c3f('0x3c')]){_0x484539[_0x7c3f('0x3d')]=[{'all':!![]}];}return db[_0x7c3f('0x28')][_0x7c3f('0x3e')](_0x484539);})[_0x7c3f('0x23')](function(_0x5a32e8){_0x2d2155[_0x7c3f('0x3f')]=_0x5a32e8;return _0x2d2155;})['then'](respondWithFilteredResult(_0x5c5963,_0x484539))[_0x7c3f('0x40')](handleError(_0x5c5963,null));};exports[_0x7c3f('0x41')]=function(_0x47a76d,_0x4d8fb2){var _0x586445={'raw':!![],'where':{'id':_0x47a76d['params']['id']}},_0x4ba19f={};_0x4ba19f[_0x7c3f('0x2e')]=_['keys'](db[_0x7c3f('0x28')][_0x7c3f('0x42')]);_0x4ba19f['query']=_[_0x7c3f('0x2b')](_0x47a76d[_0x7c3f('0x2a')]);_0x4ba19f[_0x7c3f('0x2c')]=_[_0x7c3f('0x2d')](_0x4ba19f[_0x7c3f('0x2e')],_0x4ba19f[_0x7c3f('0x2a')]);_0x586445[_0x7c3f('0x2f')]=_[_0x7c3f('0x2d')](_0x4ba19f[_0x7c3f('0x2e')],qs[_0x7c3f('0x30')](_0x47a76d[_0x7c3f('0x2a')][_0x7c3f('0x30')]));_0x586445[_0x7c3f('0x2f')]=_0x586445[_0x7c3f('0x2f')]['length']?_0x586445[_0x7c3f('0x2f')]:_0x4ba19f['model'];if(_0x47a76d[_0x7c3f('0x2a')][_0x7c3f('0x3c')]){_0x586445[_0x7c3f('0x3d')]=[{'all':!![]}];}_0x586445=_['merge']({},_0x586445,_0x47a76d[_0x7c3f('0x3b')]);return db['VtigerField'][_0x7c3f('0x43')](_0x586445)[_0x7c3f('0x23')](handleEntityNotFound(_0x4d8fb2,null))[_0x7c3f('0x23')](respondWithResult(_0x4d8fb2,null))[_0x7c3f('0x40')](handleError(_0x4d8fb2,null));};exports[_0x7c3f('0x44')]=function(_0x2690a3,_0xd2289){return db['VtigerField'][_0x7c3f('0x44')](_0x2690a3[_0x7c3f('0x45')],{})[_0x7c3f('0x23')](respondWithResult(_0xd2289,0xc9))[_0x7c3f('0x40')](handleError(_0xd2289,null));};exports[_0x7c3f('0x22')]=function(_0x42c5ce,_0x1eeee0){if(_0x42c5ce[_0x7c3f('0x45')]['id']){delete _0x42c5ce[_0x7c3f('0x45')]['id'];}return db[_0x7c3f('0x28')][_0x7c3f('0x43')]({'where':{'id':_0x42c5ce['params']['id']}})[_0x7c3f('0x23')](handleEntityNotFound(_0x1eeee0,null))[_0x7c3f('0x23')](saveUpdates(_0x42c5ce[_0x7c3f('0x45')],null))[_0x7c3f('0x23')](respondWithResult(_0x1eeee0,null))['catch'](handleError(_0x1eeee0,null));};exports[_0x7c3f('0x24')]=function(_0x11fa48,_0x1bb1d6){return db['VtigerField'][_0x7c3f('0x43')]({'where':{'id':_0x11fa48[_0x7c3f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1bb1d6,null))['then'](removeEntity(_0x1bb1d6,null))[_0x7c3f('0x40')](handleError(_0x1bb1d6,null));}; \ No newline at end of file +var _0xd089=['pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xd089,0x1e3));var _0x9d08=function(_0x2af984,_0x41a850){_0x2af984=_0x2af984-0x0;var _0x3d4f92=_0xd089[_0x2af984];return _0x3d4f92;};'use strict';var emlformat=require(_0x9d08('0x0'));var rimraf=require(_0x9d08('0x1'));var zipdir=require(_0x9d08('0x2'));var jsonpatch=require(_0x9d08('0x3'));var rp=require(_0x9d08('0x4'));var moment=require(_0x9d08('0x5'));var BPromise=require(_0x9d08('0x6'));var Mustache=require(_0x9d08('0x7'));var util=require('util');var path=require(_0x9d08('0x8'));var sox=require('sox');var csv=require(_0x9d08('0x9'));var ejs=require(_0x9d08('0xa'));var fs=require('fs');var fs_extra=require(_0x9d08('0xb'));var _=require(_0x9d08('0xc'));var squel=require(_0x9d08('0xd'));var crypto=require(_0x9d08('0xe'));var jsforce=require(_0x9d08('0xf'));var deskjs=require(_0x9d08('0x10'));var toCsv=require(_0x9d08('0x9'));var querystring=require('querystring');var Papa=require(_0x9d08('0x11'));var Redis=require(_0x9d08('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9d08('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d08('0x14'))(_0x9d08('0x15'));var utils=require(_0x9d08('0x16'));var config=require(_0x9d08('0x17'));var licenseUtil=require(_0x9d08('0x18'));var db=require(_0x9d08('0x19'))['db'];function respondWithStatusCode(_0x1ba0c9,_0x19b22d){_0x19b22d=_0x19b22d||0xcc;return function(_0x5373f4){if(_0x5373f4){return _0x1ba0c9[_0x9d08('0x1a')](_0x19b22d);}return _0x1ba0c9[_0x9d08('0x1b')](_0x19b22d)['end']();};}function respondWithResult(_0x2a5f94,_0x29a32e){_0x29a32e=_0x29a32e||0xc8;return function(_0xcf20f7){if(_0xcf20f7){return _0x2a5f94[_0x9d08('0x1b')](_0x29a32e)['json'](_0xcf20f7);}};}function respondWithFilteredResult(_0x329270,_0x43acc3){return function(_0x3e9f63){if(_0x3e9f63){var _0x3b18ba=typeof _0x43acc3[_0x9d08('0x1c')]==='undefined'&&typeof _0x43acc3[_0x9d08('0x1d')]===_0x9d08('0x1e');var _0x1ad065=_0x3e9f63[_0x9d08('0x1f')];var _0x5d77cc=_0x3b18ba?0x0:_0x43acc3['offset'];var _0x34286d=_0x3b18ba?_0x3e9f63[_0x9d08('0x1f')]:_0x43acc3[_0x9d08('0x1c')]+_0x43acc3['limit'];var _0x23d3f8;if(_0x34286d>=_0x1ad065){_0x34286d=_0x1ad065;_0x23d3f8=0xc8;}else{_0x23d3f8=0xce;}_0x329270[_0x9d08('0x1b')](_0x23d3f8);return _0x329270[_0x9d08('0x20')](_0x9d08('0x21'),_0x5d77cc+'-'+_0x34286d+'/'+_0x1ad065)[_0x9d08('0x22')](_0x3e9f63);}return null;};}function patchUpdates(_0x2e4326){return function(_0x5933ac){try{jsonpatch[_0x9d08('0x23')](_0x5933ac,_0x2e4326,!![]);}catch(_0x4e16a0){return BPromise[_0x9d08('0x24')](_0x4e16a0);}return _0x5933ac[_0x9d08('0x25')]();};}function saveUpdates(_0x3bee19,_0x39a114){return function(_0x21ac48){if(_0x21ac48){return _0x21ac48[_0x9d08('0x26')](_0x3bee19)[_0x9d08('0x27')](function(_0x7695ce){return _0x7695ce;});}return null;};}function removeEntity(_0x363c3a,_0x14e3a3){return function(_0xbf0128){if(_0xbf0128){return _0xbf0128[_0x9d08('0x28')]()[_0x9d08('0x27')](function(){_0x363c3a[_0x9d08('0x1b')](0xcc)[_0x9d08('0x29')]();});}};}function handleEntityNotFound(_0x33af26,_0x13515a){return function(_0x588e79){if(!_0x588e79){_0x33af26[_0x9d08('0x1a')](0x194);}return _0x588e79;};}function handleError(_0xfeb86d,_0x191474){_0x191474=_0x191474||0x1f4;return function(_0xe23cf4){logger[_0x9d08('0x2a')](_0xe23cf4[_0x9d08('0x2b')]);if(_0xe23cf4[_0x9d08('0x2c')]){delete _0xe23cf4[_0x9d08('0x2c')];}_0xfeb86d[_0x9d08('0x1b')](_0x191474)[_0x9d08('0x2d')](_0xe23cf4);};}exports[_0x9d08('0x2e')]=function(_0x5296c1,_0x306827){var _0xe98e4e={},_0x2fdbbf={},_0x4c5669={'count':0x0,'rows':[]};var _0x397e5f=_['map'](db[_0x9d08('0x2f')][_0x9d08('0x30')],function(_0x181fe8){return{'name':_0x181fe8[_0x9d08('0x31')],'type':_0x181fe8[_0x9d08('0x32')][_0x9d08('0x33')]};});_0x2fdbbf['model']=_['map'](_0x397e5f,_0x9d08('0x2c'));_0x2fdbbf[_0x9d08('0x34')]=_['keys'](_0x5296c1[_0x9d08('0x34')]);_0x2fdbbf[_0x9d08('0x35')]=_[_0x9d08('0x36')](_0x2fdbbf[_0x9d08('0x37')],_0x2fdbbf[_0x9d08('0x34')]);_0xe98e4e[_0x9d08('0x38')]=_[_0x9d08('0x36')](_0x2fdbbf[_0x9d08('0x37')],qs[_0x9d08('0x39')](_0x5296c1[_0x9d08('0x34')]['fields']));_0xe98e4e[_0x9d08('0x38')]=_0xe98e4e['attributes'][_0x9d08('0x3a')]?_0xe98e4e['attributes']:_0x2fdbbf[_0x9d08('0x37')];if(!_0x5296c1[_0x9d08('0x34')][_0x9d08('0x3b')](_0x9d08('0x3c'))){_0xe98e4e[_0x9d08('0x1d')]=qs[_0x9d08('0x1d')](_0x5296c1[_0x9d08('0x34')][_0x9d08('0x1d')]);_0xe98e4e[_0x9d08('0x1c')]=qs['offset'](_0x5296c1['query']['offset']);}_0xe98e4e['order']=qs['sort'](_0x5296c1[_0x9d08('0x34')][_0x9d08('0x3d')]);_0xe98e4e[_0x9d08('0x3e')]=qs['filters'](_[_0x9d08('0x3f')](_0x5296c1[_0x9d08('0x34')],_0x2fdbbf[_0x9d08('0x35')]),_0x397e5f);if(_0x5296c1[_0x9d08('0x34')][_0x9d08('0x40')]){_0xe98e4e[_0x9d08('0x3e')]=_[_0x9d08('0x41')](_0xe98e4e[_0x9d08('0x3e')],{'$or':_[_0x9d08('0x42')](_0x397e5f,function(_0x298279){if(_0x298279['type']!==_0x9d08('0x43')){var _0x28c25d={};_0x28c25d[_0x298279[_0x9d08('0x2c')]]={'$like':'%'+_0x5296c1['query'][_0x9d08('0x40')]+'%'};return _0x28c25d;}})});}_0xe98e4e=_[_0x9d08('0x41')]({},_0xe98e4e,_0x5296c1['options']);var _0x38fb7c={'where':_0xe98e4e[_0x9d08('0x3e')]};return db[_0x9d08('0x2f')]['count'](_0x38fb7c)['then'](function(_0x259883){_0x4c5669[_0x9d08('0x1f')]=_0x259883;if(_0x5296c1['query'][_0x9d08('0x44')]){_0xe98e4e[_0x9d08('0x45')]=[{'all':!![]}];}return db[_0x9d08('0x2f')][_0x9d08('0x46')](_0xe98e4e);})['then'](function(_0x1f1295){_0x4c5669[_0x9d08('0x47')]=_0x1f1295;return _0x4c5669;})[_0x9d08('0x27')](respondWithFilteredResult(_0x306827,_0xe98e4e))[_0x9d08('0x48')](handleError(_0x306827,null));};exports['show']=function(_0x216cce,_0x158f29){var _0x230356={'raw':!![],'where':{'id':_0x216cce[_0x9d08('0x49')]['id']}},_0x347a95={};_0x347a95[_0x9d08('0x37')]=_['keys'](db['VtigerField']['rawAttributes']);_0x347a95[_0x9d08('0x34')]=_[_0x9d08('0x4a')](_0x216cce[_0x9d08('0x34')]);_0x347a95[_0x9d08('0x35')]=_[_0x9d08('0x36')](_0x347a95[_0x9d08('0x37')],_0x347a95[_0x9d08('0x34')]);_0x230356[_0x9d08('0x38')]=_[_0x9d08('0x36')](_0x347a95[_0x9d08('0x37')],qs['fields'](_0x216cce['query']['fields']));_0x230356[_0x9d08('0x38')]=_0x230356[_0x9d08('0x38')][_0x9d08('0x3a')]?_0x230356['attributes']:_0x347a95[_0x9d08('0x37')];if(_0x216cce[_0x9d08('0x34')][_0x9d08('0x44')]){_0x230356['include']=[{'all':!![]}];}_0x230356=_['merge']({},_0x230356,_0x216cce[_0x9d08('0x4b')]);return db[_0x9d08('0x2f')][_0x9d08('0x4c')](_0x230356)['then'](handleEntityNotFound(_0x158f29,null))['then'](respondWithResult(_0x158f29,null))[_0x9d08('0x48')](handleError(_0x158f29,null));};exports['create']=function(_0x264f07,_0x27daba){return db[_0x9d08('0x2f')]['create'](_0x264f07[_0x9d08('0x4d')],{})[_0x9d08('0x27')](respondWithResult(_0x27daba,0xc9))[_0x9d08('0x48')](handleError(_0x27daba,null));};exports[_0x9d08('0x26')]=function(_0x1b64e1,_0x1cd121){if(_0x1b64e1['body']['id']){delete _0x1b64e1[_0x9d08('0x4d')]['id'];}return db[_0x9d08('0x2f')]['find']({'where':{'id':_0x1b64e1[_0x9d08('0x49')]['id']}})[_0x9d08('0x27')](handleEntityNotFound(_0x1cd121,null))[_0x9d08('0x27')](saveUpdates(_0x1b64e1[_0x9d08('0x4d')],null))['then'](respondWithResult(_0x1cd121,null))[_0x9d08('0x48')](handleError(_0x1cd121,null));};exports[_0x9d08('0x28')]=function(_0x4f54aa,_0x55e2dd){return db['VtigerField'][_0x9d08('0x4c')]({'where':{'id':_0x4f54aa[_0x9d08('0x49')]['id']}})[_0x9d08('0x27')](handleEntityNotFound(_0x55e2dd,null))['then'](removeEntity(_0x55e2dd,null))['catch'](handleError(_0x55e2dd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 785e8e2..d79af62 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 _0x919e=['request-promise','rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x47856a,_0x1ad7a0){var _0x1edd96=function(_0x4da7f3){while(--_0x4da7f3){_0x47856a['push'](_0x47856a['shift']());}};_0x1edd96(++_0x1ad7a0);}(_0x919e,0x1ad));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var logger=require(_0xe919('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe919('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe919('0x4'));var config=require('../../config/environment');var attributes=require(_0xe919('0x5'));module[_0xe919('0x6')]=function(_0x10829e,_0x7317e9){return _0x10829e[_0xe919('0x7')](_0xe919('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xe919('0x9'),'fields':[_0xe919('0xa'),_0xe919('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa135=['util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','idField','FieldId','lodash'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0xa135,0x133));var _0x5a13=function(_0x1c87c0,_0xd6b0ee){_0x1c87c0=_0x1c87c0-0x0;var _0x5a93cf=_0xa135[_0x1c87c0];return _0x5a93cf;};'use strict';var _=require(_0x5a13('0x0'));var util=require(_0x5a13('0x1'));var logger=require(_0x5a13('0x2'))(_0x5a13('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5a13('0x4'));var fs=require('fs');var path=require(_0x5a13('0x5'));var rimraf=require('rimraf');var config=require(_0x5a13('0x6'));var attributes=require('./intVtigerField.attributes');module[_0x5a13('0x7')]=function(_0x5d76c3,_0x3454b8){return _0x5d76c3[_0x5a13('0x8')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x5a13('0x9'),_0x5a13('0xa')],'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 1f7e2ad..9b5cef1 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 _0xac57=['ioredis','../../config/utils','rpc','../../config/environment','http','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x5e425c,_0x3c02b2){var _0x1c2634=function(_0x146717){while(--_0x146717){_0x5e425c['push'](_0x5e425c['shift']());}};_0x1c2634(++_0x3c02b2);}(_0xac57,0x100));var _0x7ac5=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0xac57[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x7ac5('0x0'));var util=require('util');var moment=require(_0x7ac5('0x1'));var BPromise=require(_0x7ac5('0x2'));var rs=require(_0x7ac5('0x3'));var fs=require('fs');var Redis=require(_0x7ac5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ac5('0x5'));var logger=require('../../config/logger')(_0x7ac5('0x6'));var config=require(_0x7ac5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7ac5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x130bf2,_0x2050b7,_0x4c00b1){return new BPromise(function(_0xe9253d,_0x233043){return client['request'](_0x130bf2,_0x4c00b1)[_0x7ac5('0x9')](function(_0x323342){logger['info'](_0x7ac5('0xa'),_0x2050b7,_0x7ac5('0xb'));logger[_0x7ac5('0xc')](_0x7ac5('0xd'),_0x2050b7,_0x7ac5('0xb'),JSON[_0x7ac5('0xe')](_0x323342));if(_0x323342[_0x7ac5('0xf')]){if(_0x323342[_0x7ac5('0xf')][_0x7ac5('0x10')]===0x1f4){logger[_0x7ac5('0xf')](_0x7ac5('0xa'),_0x2050b7,_0x323342[_0x7ac5('0xf')][_0x7ac5('0x11')]);return _0x233043(_0x323342[_0x7ac5('0xf')][_0x7ac5('0x11')]);}logger[_0x7ac5('0xf')](_0x7ac5('0xa'),_0x2050b7,_0x323342[_0x7ac5('0xf')][_0x7ac5('0x11')]);return _0xe9253d(_0x323342[_0x7ac5('0xf')]['message']);}else{logger['info'](_0x7ac5('0xa'),_0x2050b7,_0x7ac5('0xb'));_0xe9253d(_0x323342[_0x7ac5('0x12')][_0x7ac5('0x11')]);}})[_0x7ac5('0x13')](function(_0x49b8be){logger[_0x7ac5('0xf')](_0x7ac5('0xa'),_0x2050b7,_0x49b8be);_0x233043(_0x49b8be);});});} \ No newline at end of file +var _0x268d=['request','info','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VtigerField,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x268d,0x6f));var _0xd268=function(_0x37b4dd,_0x3ad337){_0x37b4dd=_0x37b4dd-0x0;var _0x5aa12b=_0x268d[_0x37b4dd];return _0x5aa12b;};'use strict';var _=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var moment=require(_0xd268('0x2'));var BPromise=require('bluebird');var rs=require(_0xd268('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd268('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd268('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd268('0x6'));var client=jayson[_0xd268('0x7')][_0xd268('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19995a,_0x5f00d9,_0x5ad91c){return new BPromise(function(_0x154edb,_0x45b74c){return client[_0xd268('0x9')](_0x19995a,_0x5ad91c)['then'](function(_0x5e793f){logger[_0xd268('0xa')]('VtigerField,\x20%s,\x20%s',_0x5f00d9,'request\x20sent');logger[_0xd268('0xb')](_0xd268('0xc'),_0x5f00d9,_0xd268('0xd'),JSON[_0xd268('0xe')](_0x5e793f));if(_0x5e793f[_0xd268('0xf')]){if(_0x5e793f[_0xd268('0xf')][_0xd268('0x10')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x5f00d9,_0x5e793f[_0xd268('0xf')][_0xd268('0x11')]);return _0x45b74c(_0x5e793f[_0xd268('0xf')][_0xd268('0x11')]);}logger[_0xd268('0xf')](_0xd268('0x12'),_0x5f00d9,_0x5e793f[_0xd268('0xf')][_0xd268('0x11')]);return _0x154edb(_0x5e793f['error'][_0xd268('0x11')]);}else{logger[_0xd268('0xa')](_0xd268('0x12'),_0x5f00d9,_0xd268('0xd'));_0x154edb(_0x5e793f['result'][_0xd268('0x11')]);}})[_0xd268('0x13')](function(_0x917a8b){logger[_0xd268('0xf')]('VtigerField,\x20%s,\x20%s',_0x5f00d9,_0x917a8b);_0x45b74c(_0x917a8b);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 312c447..8d1f507 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 _0x881e=['getConfigurations','get','post','create','/:id/configurations','addConfiguration','put','/:id','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','isAuthenticated','show'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x881e,0x1c2));var _0xe881=function(_0xe01085,_0x42105b){_0xe01085=_0xe01085-0x0;var _0x58b60a=_0x881e[_0xe01085];return _0x58b60a;};'use strict';var multer=require(_0xe881('0x0'));var util=require('util');var path=require(_0xe881('0x1'));var timeout=require(_0xe881('0x2'));var express=require(_0xe881('0x3'));var router=express['Router']();var fs_extra=require(_0xe881('0x4'));var auth=require(_0xe881('0x5'));var interaction=require(_0xe881('0x6'));var config=require(_0xe881('0x7'));var controller=require(_0xe881('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe881('0x9')]);router['get']('/:id',auth[_0xe881('0xa')](),controller[_0xe881('0xb')]);router['get']('/:id/configurations',auth[_0xe881('0xa')](),controller[_0xe881('0xc')]);router[_0xe881('0xd')]('/:id/fields',auth[_0xe881('0xa')](),controller['getFields']);router[_0xe881('0xe')]('/',auth[_0xe881('0xa')](),controller[_0xe881('0xf')]);router[_0xe881('0xe')](_0xe881('0x10'),auth[_0xe881('0xa')](),controller[_0xe881('0x11')]);router[_0xe881('0x12')](_0xe881('0x13'),auth[_0xe881('0xa')](),controller[_0xe881('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe881('0x15')]=router; \ No newline at end of file +var _0xbe55=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x5cf7a6,_0x3d6a1b){var _0xc6429f=function(_0x27099e){while(--_0x27099e){_0x5cf7a6['push'](_0x5cf7a6['shift']());}};_0xc6429f(++_0x3d6a1b);}(_0xbe55,0x1b6));var _0x5be5=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xbe55[_0x397cfb];return _0x15fed9;};'use strict';var multer=require(_0x5be5('0x0'));var util=require(_0x5be5('0x1'));var path=require('path');var timeout=require(_0x5be5('0x2'));var express=require(_0x5be5('0x3'));var router=express[_0x5be5('0x4')]();var fs_extra=require(_0x5be5('0x5'));var auth=require(_0x5be5('0x6'));var interaction=require(_0x5be5('0x7'));var config=require(_0x5be5('0x8'));var controller=require(_0x5be5('0x9'));router[_0x5be5('0xa')]('/',auth[_0x5be5('0xb')](),controller[_0x5be5('0xc')]);router[_0x5be5('0xa')](_0x5be5('0xd'),auth[_0x5be5('0xb')](),controller['show']);router['get'](_0x5be5('0xe'),auth[_0x5be5('0xb')](),controller[_0x5be5('0xf')]);router['get'](_0x5be5('0x10'),auth[_0x5be5('0xb')](),controller[_0x5be5('0x11')]);router[_0x5be5('0x12')]('/',auth[_0x5be5('0xb')](),controller[_0x5be5('0x13')]);router[_0x5be5('0x12')](_0x5be5('0xe'),auth[_0x5be5('0xb')](),controller[_0x5be5('0x14')]);router[_0x5be5('0x15')](_0x5be5('0xd'),auth['isAuthenticated'](),controller[_0x5be5('0x16')]);router[_0x5be5('0x17')](_0x5be5('0xd'),auth['isAuthenticated'](),controller[_0x5be5('0x18')]);module[_0x5be5('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index ddd2fc5..ca24ed5 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 _0x8c8b=['newTab','sequelize','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0x16acb7,_0x23f034){var _0x39bf39=function(_0x21281e){while(--_0x21281e){_0x16acb7['push'](_0x16acb7['shift']());}};_0x39bf39(++_0x23f034);}(_0x8c8b,0x106));var _0xb8c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c8b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb8c8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb8c8('0x1')]},'username':{'type':Sequelize[_0xb8c8('0x1')],'unique':_0xb8c8('0x2')},'password':{'type':Sequelize[_0xb8c8('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb8c8('0x3')},'authType':{'type':Sequelize[_0xb8c8('0x4')](_0xb8c8('0x5'),_0xb8c8('0x6')),'defaultValue':_0xb8c8('0x5')},'serverUrl':{'type':Sequelize[_0xb8c8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb8c8('0x4')](_0xb8c8('0x7'),_0xb8c8('0x8')),'defaultValue':_0xb8c8('0x7')}}; \ No newline at end of file +var _0x7ed1=['password','token','integrationTab','newTab','sequelize','STRING','username','remoteUri','ENUM'];(function(_0x6f948b,_0x472103){var _0x594f08=function(_0x3717ae){while(--_0x3717ae){_0x6f948b['push'](_0x6f948b['shift']());}};_0x594f08(++_0x472103);}(_0x7ed1,0xca));var _0x17ed=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7ed1[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require(_0x17ed('0x0'));module['exports']={'name':{'type':Sequelize[_0x17ed('0x1')]},'description':{'type':Sequelize[_0x17ed('0x1')]},'username':{'type':Sequelize[_0x17ed('0x1')],'unique':_0x17ed('0x2')},'password':{'type':Sequelize[_0x17ed('0x1')]},'token':{'type':Sequelize[_0x17ed('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x17ed('0x3')},'authType':{'type':Sequelize[_0x17ed('0x4')](_0x17ed('0x5'),_0x17ed('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x17ed('0x4')](_0x17ed('0x7'),_0x17ed('0x8')),'defaultValue':_0x17ed('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index fee4c56..91c54cb 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 _0x4e81=['limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','show','params','find','catch','create','body','findOne','ZendeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','ZendeskField','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','password','headers','Basic\x20%s','toString','base64','format','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','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','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined'];(function(_0x10f0de,_0x47f1a8){var _0x214d99=function(_0x3b6504){while(--_0x3b6504){_0x10f0de['push'](_0x10f0de['shift']());}};_0x214d99(++_0x47f1a8);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0x4e81[_0x5c7a85];return _0x35290f;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x14e8('0x19'));function respondWithStatusCode(_0x59c6c9,_0x2607ef){_0x2607ef=_0x2607ef||0xcc;return function(_0x341d40){if(_0x341d40){return _0x59c6c9[_0x14e8('0x1a')](_0x2607ef);}return _0x59c6c9['status'](_0x2607ef)[_0x14e8('0x1b')]();};}function respondWithResult(_0x4e1064,_0x458e4a){_0x458e4a=_0x458e4a||0xc8;return function(_0x58d26e){if(_0x58d26e){return _0x4e1064[_0x14e8('0x1c')](_0x458e4a)[_0x14e8('0x1d')](_0x58d26e);}};}function respondWithFilteredResult(_0xc6101f,_0x135996){return function(_0x52e64f){if(_0x52e64f){var _0x10c4a9=typeof _0x135996[_0x14e8('0x1e')]===_0x14e8('0x1f')&&typeof _0x135996[_0x14e8('0x20')]===_0x14e8('0x1f');var _0x1f1a0d=_0x52e64f[_0x14e8('0x21')];var _0x462259=_0x10c4a9?0x0:_0x135996['offset'];var _0x328c5a=_0x10c4a9?_0x52e64f[_0x14e8('0x21')]:_0x135996[_0x14e8('0x1e')]+_0x135996[_0x14e8('0x20')];var _0x246c5d;if(_0x328c5a>=_0x1f1a0d){_0x328c5a=_0x1f1a0d;_0x246c5d=0xc8;}else{_0x246c5d=0xce;}_0xc6101f['status'](_0x246c5d);return _0xc6101f[_0x14e8('0x22')](_0x14e8('0x23'),_0x462259+'-'+_0x328c5a+'/'+_0x1f1a0d)[_0x14e8('0x1d')](_0x52e64f);}return null;};}function patchUpdates(_0x48e30a){return function(_0x2c3f45){try{jsonpatch['apply'](_0x2c3f45,_0x48e30a,!![]);}catch(_0x4cca43){return BPromise[_0x14e8('0x24')](_0x4cca43);}return _0x2c3f45[_0x14e8('0x25')]();};}function saveUpdates(_0x117b00,_0xcf673){return function(_0x4ad25d){if(_0x4ad25d){return _0x4ad25d[_0x14e8('0x26')](_0x117b00)['then'](function(_0x31bdd3){return _0x31bdd3;});}return null;};}function removeEntity(_0x185a0e,_0x4ffc8b){return function(_0x58a3a1){if(_0x58a3a1){return _0x58a3a1['destroy']()[_0x14e8('0x27')](function(){_0x185a0e[_0x14e8('0x1c')](0xcc)[_0x14e8('0x1b')]();});}};}function handleEntityNotFound(_0x20bfe8,_0x333d44){return function(_0x57eb46){if(!_0x57eb46){_0x20bfe8[_0x14e8('0x1a')](0x194);}return _0x57eb46;};}function handleError(_0x3fd96d,_0x3c09cb){_0x3c09cb=_0x3c09cb||0x1f4;return function(_0x2f5818){logger[_0x14e8('0x28')](_0x2f5818[_0x14e8('0x29')]);if(_0x2f5818[_0x14e8('0x2a')]){delete _0x2f5818['name'];}_0x3fd96d[_0x14e8('0x1c')](_0x3c09cb)[_0x14e8('0x2b')](_0x2f5818);};}exports[_0x14e8('0x2c')]=function(_0x5f5abb,_0x48eed0){var _0x5cacd7={},_0x8fe0e2={},_0x2a408d={'count':0x0,'rows':[]};var _0x567385=_[_0x14e8('0x2d')](db[_0x14e8('0x2e')][_0x14e8('0x2f')],function(_0xa83433){return{'name':_0xa83433['fieldName'],'type':_0xa83433[_0x14e8('0x30')][_0x14e8('0x31')]};});_0x8fe0e2[_0x14e8('0x32')]=_[_0x14e8('0x2d')](_0x567385,_0x14e8('0x2a'));_0x8fe0e2['query']=_[_0x14e8('0x33')](_0x5f5abb[_0x14e8('0x34')]);_0x8fe0e2[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x8fe0e2['model'],_0x8fe0e2[_0x14e8('0x34')]);_0x5cacd7['attributes']=_[_0x14e8('0x36')](_0x8fe0e2[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x37')]));_0x5cacd7[_0x14e8('0x38')]=_0x5cacd7[_0x14e8('0x38')][_0x14e8('0x39')]?_0x5cacd7[_0x14e8('0x38')]:_0x8fe0e2[_0x14e8('0x32')];if(!_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3a')]('nolimit')){_0x5cacd7['limit']=qs['limit'](_0x5f5abb[_0x14e8('0x34')]['limit']);_0x5cacd7[_0x14e8('0x1e')]=qs['offset'](_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x1e')]);}_0x5cacd7[_0x14e8('0x3b')]=qs[_0x14e8('0x3c')](_0x5f5abb['query'][_0x14e8('0x3c')]);_0x5cacd7['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x5f5abb[_0x14e8('0x34')],_0x8fe0e2[_0x14e8('0x35')]),_0x567385);if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x5cacd7['where']=_[_0x14e8('0x3f')](_0x5cacd7['where'],{'$or':_[_0x14e8('0x2d')](_0x567385,function(_0x20f69d){if(_0x20f69d[_0x14e8('0x30')]!=='VIRTUAL'){var _0x27d51b={};_0x27d51b[_0x20f69d[_0x14e8('0x2a')]]={'$like':'%'+_0x5f5abb['query'][_0x14e8('0x3e')]+'%'};return _0x27d51b;}})});}_0x5cacd7=_[_0x14e8('0x3f')]({},_0x5cacd7,_0x5f5abb[_0x14e8('0x40')]);var _0x3a7aa7={'where':_0x5cacd7[_0x14e8('0x41')]};return db[_0x14e8('0x2e')][_0x14e8('0x21')](_0x3a7aa7)[_0x14e8('0x27')](function(_0x33743a){_0x2a408d[_0x14e8('0x21')]=_0x33743a;if(_0x5f5abb[_0x14e8('0x34')][_0x14e8('0x42')]){_0x5cacd7[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2e')][_0x14e8('0x44')](_0x5cacd7);})['then'](function(_0x24c9e6){_0x2a408d['rows']=_0x24c9e6;return _0x2a408d;})['then'](respondWithFilteredResult(_0x48eed0,_0x5cacd7))['catch'](handleError(_0x48eed0,null));};exports[_0x14e8('0x45')]=function(_0x5ed821,_0x46a3c4){var _0x45bff0={'raw':![],'where':{'id':_0x5ed821[_0x14e8('0x46')]['id']}},_0x7907e8={};_0x7907e8[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x2e')][_0x14e8('0x2f')]);_0x7907e8[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x5ed821[_0x14e8('0x34')]);_0x7907e8['filters']=_[_0x14e8('0x36')](_0x7907e8[_0x14e8('0x32')],_0x7907e8[_0x14e8('0x34')]);_0x45bff0[_0x14e8('0x38')]=_['intersection'](_0x7907e8[_0x14e8('0x32')],qs[_0x14e8('0x37')](_0x5ed821['query']['fields']));_0x45bff0[_0x14e8('0x38')]=_0x45bff0['attributes']['length']?_0x45bff0[_0x14e8('0x38')]:_0x7907e8[_0x14e8('0x32')];if(_0x5ed821['query'][_0x14e8('0x42')]){_0x45bff0[_0x14e8('0x43')]=[{'all':!![]}];}_0x45bff0=_['merge']({},_0x45bff0,_0x5ed821[_0x14e8('0x40')]);return db[_0x14e8('0x2e')][_0x14e8('0x47')](_0x45bff0)[_0x14e8('0x27')](handleEntityNotFound(_0x46a3c4,null))[_0x14e8('0x27')](respondWithResult(_0x46a3c4,null))[_0x14e8('0x48')](handleError(_0x46a3c4,null));};exports[_0x14e8('0x49')]=function(_0x2541ad,_0x146e2c){return db[_0x14e8('0x2e')][_0x14e8('0x49')](_0x2541ad[_0x14e8('0x4a')],{})[_0x14e8('0x27')](respondWithResult(_0x146e2c,0xc9))[_0x14e8('0x48')](handleError(_0x146e2c,null));};exports[_0x14e8('0x26')]=function(_0x1f50bc,_0x59820f){if(_0x1f50bc[_0x14e8('0x4a')]['id']){delete _0x1f50bc['body']['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x47')]({'where':{'id':_0x1f50bc[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x59820f,null))['then'](saveUpdates(_0x1f50bc['body'],null))['then'](respondWithResult(_0x59820f,null))[_0x14e8('0x48')](handleError(_0x59820f,null));};exports['destroy']=function(_0x55f9b0,_0xd2b281){return db[_0x14e8('0x2e')]['find']({'where':{'id':_0x55f9b0[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0xd2b281,null))[_0x14e8('0x27')](removeEntity(_0xd2b281,null))[_0x14e8('0x48')](handleError(_0xd2b281,null));};exports['getConfigurations']=function(_0x519c9c,_0x1cdcca,_0xc602b1){var _0x15464a={};var _0x3a09b7={};var _0x41b5ab;var _0x2fbac7;return db['ZendeskAccount'][_0x14e8('0x4b')]({'where':{'id':_0x519c9c[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x1cdcca,null))[_0x14e8('0x27')](function(_0x5e6083){if(_0x5e6083){_0x41b5ab=_0x5e6083;_0x3a09b7[_0x14e8('0x32')]=_[_0x14e8('0x33')](db[_0x14e8('0x4c')][_0x14e8('0x2f')]);_0x3a09b7['query']=_[_0x14e8('0x33')](_0x519c9c[_0x14e8('0x34')]);_0x3a09b7[_0x14e8('0x35')]=_[_0x14e8('0x36')](_0x3a09b7[_0x14e8('0x32')],_0x3a09b7[_0x14e8('0x34')]);_0x15464a[_0x14e8('0x38')]=_[_0x14e8('0x36')](_0x3a09b7['model'],qs['fields'](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x37')]));_0x15464a[_0x14e8('0x38')]=_0x15464a[_0x14e8('0x38')][_0x14e8('0x39')]?_0x15464a['attributes']:_0x3a09b7['model'];_0x15464a['order']=qs[_0x14e8('0x3c')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3c')]);_0x15464a['where']=qs[_0x14e8('0x35')](_[_0x14e8('0x3d')](_0x519c9c[_0x14e8('0x34')],_0x3a09b7['filters']));if(_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]){_0x15464a[_0x14e8('0x41')]=_[_0x14e8('0x3f')](_0x15464a[_0x14e8('0x41')],{'$or':_[_0x14e8('0x2d')](_0x15464a[_0x14e8('0x38')],function(_0x12a2b3){var _0x2da07b={};_0x2da07b[_0x12a2b3]={'$like':'%'+_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3e')]+'%'};return _0x2da07b;})});}_0x15464a=_['merge']({},_0x15464a,_0x519c9c[_0x14e8('0x40')]);return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x38e79a){if(_0x38e79a){_0x2fbac7=_0x38e79a[_0x14e8('0x39')];if(!_0x519c9c[_0x14e8('0x34')][_0x14e8('0x3a')](_0x14e8('0x4e'))){_0x15464a[_0x14e8('0x20')]=qs[_0x14e8('0x20')](_0x519c9c[_0x14e8('0x34')][_0x14e8('0x20')]);_0x15464a['offset']=qs[_0x14e8('0x1e')](_0x519c9c[_0x14e8('0x34')]['offset']);}return _0x41b5ab[_0x14e8('0x4d')](_0x15464a);}})[_0x14e8('0x27')](function(_0x31e785){if(_0x31e785){return _0x31e785?{'count':_0x2fbac7,'rows':_0x31e785}:null;}})[_0x14e8('0x27')](respondWithResult(_0x1cdcca,null))[_0x14e8('0x48')](handleError(_0x1cdcca,null));};exports[_0x14e8('0x4f')]=function(_0x139405,_0x5b6e28,_0x4c30dd){if(_0x139405['body']['id']){delete _0x139405[_0x14e8('0x4a')]['id'];}return db[_0x14e8('0x2e')][_0x14e8('0x4b')]({'where':{'id':_0x139405[_0x14e8('0x46')]['id']}})[_0x14e8('0x27')](handleEntityNotFound(_0x5b6e28,null))[_0x14e8('0x27')](function(_0x402956){if(_0x402956){_0x139405['body'][_0x14e8('0x50')]=_0x402956['id'];_0x139405[_0x14e8('0x4a')]['Subjects']=integrations[_0x14e8('0x51')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405['body']['type']);_0x139405[_0x14e8('0x4a')][_0x14e8('0x52')]=integrations[_0x14e8('0x53')](_0x139405[_0x14e8('0x4a')]['channel'],_0x139405[_0x14e8('0x4a')][_0x14e8('0x30')]);return db[_0x14e8('0x4c')][_0x14e8('0x49')](_0x139405[_0x14e8('0x4a')],{'include':[{'model':db[_0x14e8('0x54')],'as':'Subjects'},{'model':db[_0x14e8('0x54')],'as':_0x14e8('0x52')}]});}return null;})[_0x14e8('0x27')](respondWithResult(_0x5b6e28,null))['catch'](handleError(_0x5b6e28,null));};exports['getFields']=function(_0x20a598,_0x53d0c8,_0x25f63c){var _0x5cbce8='';return db[_0x14e8('0x2e')]['findOne']({'where':{'id':_0x20a598[_0x14e8('0x46')]['id']},'attributes':['id',_0x14e8('0x55'),'password',_0x14e8('0x56'),_0x14e8('0x57'),_0x14e8('0x58')]})[_0x14e8('0x27')](handleEntityNotFound(_0x53d0c8,null))[_0x14e8('0x27')](function(_0x6dee32){if(_0x6dee32){_0x5cbce8=_0x6dee32[_0x14e8('0x58')];var _0x2ba695=_0x5cbce8[_0x14e8('0x59')](-0x1);if(_0x2ba695==='/'){_0x5cbce8=_0x5cbce8[_0x14e8('0x5a')](0x0,_0x5cbce8[_0x14e8('0x5b')](_0x2ba695));}var _0x2e0e7d={'method':_0x14e8('0x5c'),'uri':util['format']('%s/%s',_0x5cbce8,'ticket_fields'),'json':!![]};switch(_0x6dee32[_0x14e8('0x57')]){case _0x14e8('0x5d'):_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util['format']('%s:%s',_0x6dee32['username'],_0x6dee32[_0x14e8('0x5d')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;case'token':_0x2e0e7d[_0x14e8('0x5e')]={'Authorization':util['format'](_0x14e8('0x5f'),new Buffer(util[_0x14e8('0x62')](_0x14e8('0x63'),_0x6dee32[_0x14e8('0x55')],_0x6dee32[_0x14e8('0x56')]))[_0x14e8('0x60')](_0x14e8('0x61')))};break;default:throw new db[(_0x14e8('0x64'))][(_0x14e8('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x2e0e7d);}})[_0x14e8('0x27')](function(_0x4eb2ef){if(_0x4eb2ef){var _0x355395=[_0x14e8('0x66'),_0x14e8('0x67'),_0x14e8('0x68'),_0x14e8('0x69')];_[_0x14e8('0x6a')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x308617){return _0x355395[_0x14e8('0x6c')](_0x308617['type']);});return{'count':_0x4eb2ef[_0x14e8('0x6b')][_0x14e8('0x39')],'rows':_[_0x14e8('0x2d')](_0x4eb2ef[_0x14e8('0x6b')],function(_0x492757){return{'id':_0x492757['id'],'name':_0x492757[_0x14e8('0x6d')]>0x7?_0x492757[_0x14e8('0x6e')]:_0x492757[_0x14e8('0x30')],'custom':_0x492757[_0x14e8('0x6d')]>0x7?!![]:![],'options':_0x492757['system_field_options']?_0x492757[_0x14e8('0x6f')]:_0x492757['custom_field_options']?_0x492757[_0x14e8('0x70')]:[]};})};}})['then'](respondWithResult(_0x53d0c8,null))['catch'](function(_0x3e820f){var _0xb68079=_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?0x1f4:_0x3e820f[_0x14e8('0x72')]||0x1f4;logger[_0x14e8('0x28')](_0x14e8('0x73'),_0x14e8('0x74'),_0xb68079,JSON[_0x14e8('0x75')](_0x3e820f));delete _0x3e820f[_0x14e8('0x2a')];if(_0xb68079===0x191){_0xb68079=0x190;}_0x53d0c8[_0x14e8('0x1c')](_0xb68079)['send'](_0x20a598[_0x14e8('0x34')][_0x14e8('0x71')]?{'message':_0x14e8('0x76'),'statusCode':_0x3e820f['statusCode']}:_0x3e820f);});}; \ No newline at end of file +var _0x9354=['Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','ValidationError','subject','description','group','assignee','includes','position','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ZendeskAccount','rawAttributes','type','key','keys','query','filters','attributes','model','fields','nolimit','order','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x9354,0x96));var _0x4935=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x9354[_0x115621];return _0x5ef5ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];var integrations=require(_0x4935('0x17'));function respondWithStatusCode(_0x3bb388,_0x1c6c22){_0x1c6c22=_0x1c6c22||0xcc;return function(_0x3b246a){if(_0x3b246a){return _0x3bb388[_0x4935('0x18')](_0x1c6c22);}return _0x3bb388[_0x4935('0x19')](_0x1c6c22)[_0x4935('0x1a')]();};}function respondWithResult(_0x57549f,_0x237e28){_0x237e28=_0x237e28||0xc8;return function(_0x1ce1ba){if(_0x1ce1ba){return _0x57549f[_0x4935('0x19')](_0x237e28)[_0x4935('0x1b')](_0x1ce1ba);}};}function respondWithFilteredResult(_0x3652c4,_0x24cc99){return function(_0x395a43){if(_0x395a43){var _0x57d7ed=typeof _0x24cc99[_0x4935('0x1c')]===_0x4935('0x1d')&&typeof _0x24cc99[_0x4935('0x1e')]===_0x4935('0x1d');var _0x1f0e81=_0x395a43[_0x4935('0x1f')];var _0x4ebc63=_0x57d7ed?0x0:_0x24cc99[_0x4935('0x1c')];var _0x145277=_0x57d7ed?_0x395a43['count']:_0x24cc99[_0x4935('0x1c')]+_0x24cc99[_0x4935('0x1e')];var _0x1e7e38;if(_0x145277>=_0x1f0e81){_0x145277=_0x1f0e81;_0x1e7e38=0xc8;}else{_0x1e7e38=0xce;}_0x3652c4['status'](_0x1e7e38);return _0x3652c4['set'](_0x4935('0x20'),_0x4ebc63+'-'+_0x145277+'/'+_0x1f0e81)[_0x4935('0x1b')](_0x395a43);}return null;};}function patchUpdates(_0x1ae059){return function(_0x388422){try{jsonpatch[_0x4935('0x21')](_0x388422,_0x1ae059,!![]);}catch(_0x16ab7c){return BPromise[_0x4935('0x22')](_0x16ab7c);}return _0x388422[_0x4935('0x23')]();};}function saveUpdates(_0x58b2f3,_0x2f520a){return function(_0x320d81){if(_0x320d81){return _0x320d81[_0x4935('0x24')](_0x58b2f3)[_0x4935('0x25')](function(_0x52c65a){return _0x52c65a;});}return null;};}function removeEntity(_0x53530f,_0x4dc1f5){return function(_0x36e76a){if(_0x36e76a){return _0x36e76a[_0x4935('0x26')]()[_0x4935('0x25')](function(){_0x53530f[_0x4935('0x19')](0xcc)[_0x4935('0x1a')]();});}};}function handleEntityNotFound(_0x1c37ba,_0x3784f9){return function(_0x1d53a7){if(!_0x1d53a7){_0x1c37ba[_0x4935('0x18')](0x194);}return _0x1d53a7;};}function handleError(_0xf4abb2,_0x1d08b5){_0x1d08b5=_0x1d08b5||0x1f4;return function(_0x39d07b){logger[_0x4935('0x27')](_0x39d07b[_0x4935('0x28')]);if(_0x39d07b[_0x4935('0x29')]){delete _0x39d07b['name'];}_0xf4abb2['status'](_0x1d08b5)['send'](_0x39d07b);};}exports[_0x4935('0x2a')]=function(_0x76ea7d,_0x4f1163){var _0x3f0707={},_0x20755a={},_0x24a3b6={'count':0x0,'rows':[]};var _0x9fe9f6=_[_0x4935('0x2b')](db[_0x4935('0x2c')][_0x4935('0x2d')],function(_0x2fe6da){return{'name':_0x2fe6da['fieldName'],'type':_0x2fe6da[_0x4935('0x2e')][_0x4935('0x2f')]};});_0x20755a['model']=_['map'](_0x9fe9f6,_0x4935('0x29'));_0x20755a['query']=_[_0x4935('0x30')](_0x76ea7d[_0x4935('0x31')]);_0x20755a[_0x4935('0x32')]=_['intersection'](_0x20755a['model'],_0x20755a[_0x4935('0x31')]);_0x3f0707[_0x4935('0x33')]=_['intersection'](_0x20755a[_0x4935('0x34')],qs[_0x4935('0x35')](_0x76ea7d[_0x4935('0x31')][_0x4935('0x35')]));_0x3f0707[_0x4935('0x33')]=_0x3f0707['attributes']['length']?_0x3f0707[_0x4935('0x33')]:_0x20755a[_0x4935('0x34')];if(!_0x76ea7d['query']['hasOwnProperty'](_0x4935('0x36'))){_0x3f0707['limit']=qs[_0x4935('0x1e')](_0x76ea7d[_0x4935('0x31')][_0x4935('0x1e')]);_0x3f0707[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x76ea7d[_0x4935('0x31')]['offset']);}_0x3f0707[_0x4935('0x37')]=qs['sort'](_0x76ea7d[_0x4935('0x31')]['sort']);_0x3f0707[_0x4935('0x38')]=qs['filters'](_[_0x4935('0x39')](_0x76ea7d[_0x4935('0x31')],_0x20755a[_0x4935('0x32')]),_0x9fe9f6);if(_0x76ea7d[_0x4935('0x31')][_0x4935('0x3a')]){_0x3f0707[_0x4935('0x38')]=_[_0x4935('0x3b')](_0x3f0707['where'],{'$or':_['map'](_0x9fe9f6,function(_0x2efc45){if(_0x2efc45['type']!=='VIRTUAL'){var _0x1552b2={};_0x1552b2[_0x2efc45['name']]={'$like':'%'+_0x76ea7d[_0x4935('0x31')][_0x4935('0x3a')]+'%'};return _0x1552b2;}})});}_0x3f0707=_[_0x4935('0x3b')]({},_0x3f0707,_0x76ea7d[_0x4935('0x3c')]);var _0xb366e6={'where':_0x3f0707['where']};return db['ZendeskAccount'][_0x4935('0x1f')](_0xb366e6)[_0x4935('0x25')](function(_0x28f545){_0x24a3b6[_0x4935('0x1f')]=_0x28f545;if(_0x76ea7d[_0x4935('0x31')][_0x4935('0x3d')]){_0x3f0707[_0x4935('0x3e')]=[{'all':!![]}];}return db[_0x4935('0x2c')]['findAll'](_0x3f0707);})['then'](function(_0x213230){_0x24a3b6[_0x4935('0x3f')]=_0x213230;return _0x24a3b6;})['then'](respondWithFilteredResult(_0x4f1163,_0x3f0707))[_0x4935('0x40')](handleError(_0x4f1163,null));};exports[_0x4935('0x41')]=function(_0x4706eb,_0xe5c9f5){var _0x52ab0c={'raw':![],'where':{'id':_0x4706eb[_0x4935('0x42')]['id']}},_0x542689={};_0x542689[_0x4935('0x34')]=_['keys'](db[_0x4935('0x2c')][_0x4935('0x2d')]);_0x542689[_0x4935('0x31')]=_['keys'](_0x4706eb[_0x4935('0x31')]);_0x542689[_0x4935('0x32')]=_[_0x4935('0x43')](_0x542689[_0x4935('0x34')],_0x542689[_0x4935('0x31')]);_0x52ab0c[_0x4935('0x33')]=_[_0x4935('0x43')](_0x542689[_0x4935('0x34')],qs[_0x4935('0x35')](_0x4706eb[_0x4935('0x31')][_0x4935('0x35')]));_0x52ab0c[_0x4935('0x33')]=_0x52ab0c[_0x4935('0x33')][_0x4935('0x44')]?_0x52ab0c[_0x4935('0x33')]:_0x542689[_0x4935('0x34')];if(_0x4706eb[_0x4935('0x31')][_0x4935('0x3d')]){_0x52ab0c['include']=[{'all':!![]}];}_0x52ab0c=_[_0x4935('0x3b')]({},_0x52ab0c,_0x4706eb['options']);return db[_0x4935('0x2c')][_0x4935('0x45')](_0x52ab0c)[_0x4935('0x25')](handleEntityNotFound(_0xe5c9f5,null))[_0x4935('0x25')](respondWithResult(_0xe5c9f5,null))['catch'](handleError(_0xe5c9f5,null));};exports[_0x4935('0x46')]=function(_0x9c8bad,_0x2b34d5){return db[_0x4935('0x2c')][_0x4935('0x46')](_0x9c8bad[_0x4935('0x47')],{})[_0x4935('0x25')](respondWithResult(_0x2b34d5,0xc9))[_0x4935('0x40')](handleError(_0x2b34d5,null));};exports[_0x4935('0x24')]=function(_0x392cba,_0x5d48dd){if(_0x392cba[_0x4935('0x47')]['id']){delete _0x392cba[_0x4935('0x47')]['id'];}return db['ZendeskAccount'][_0x4935('0x45')]({'where':{'id':_0x392cba[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x5d48dd,null))[_0x4935('0x25')](saveUpdates(_0x392cba[_0x4935('0x47')],null))[_0x4935('0x25')](respondWithResult(_0x5d48dd,null))[_0x4935('0x40')](handleError(_0x5d48dd,null));};exports[_0x4935('0x26')]=function(_0x4b9c70,_0x57d0d9){return db['ZendeskAccount']['find']({'where':{'id':_0x4b9c70[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x57d0d9,null))[_0x4935('0x25')](removeEntity(_0x57d0d9,null))[_0x4935('0x40')](handleError(_0x57d0d9,null));};exports[_0x4935('0x48')]=function(_0x487cf3,_0x32e004,_0x4a88db){var _0x2cc0c1={};var _0x345454={};var _0x377ff4;var _0x8196b4;return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x487cf3[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x32e004,null))['then'](function(_0x24b83b){if(_0x24b83b){_0x377ff4=_0x24b83b;_0x345454['model']=_[_0x4935('0x30')](db[_0x4935('0x4a')]['rawAttributes']);_0x345454[_0x4935('0x31')]=_['keys'](_0x487cf3['query']);_0x345454['filters']=_[_0x4935('0x43')](_0x345454[_0x4935('0x34')],_0x345454[_0x4935('0x31')]);_0x2cc0c1[_0x4935('0x33')]=_[_0x4935('0x43')](_0x345454['model'],qs['fields'](_0x487cf3[_0x4935('0x31')][_0x4935('0x35')]));_0x2cc0c1[_0x4935('0x33')]=_0x2cc0c1['attributes'][_0x4935('0x44')]?_0x2cc0c1[_0x4935('0x33')]:_0x345454[_0x4935('0x34')];_0x2cc0c1[_0x4935('0x37')]=qs['sort'](_0x487cf3[_0x4935('0x31')]['sort']);_0x2cc0c1['where']=qs['filters'](_[_0x4935('0x39')](_0x487cf3[_0x4935('0x31')],_0x345454['filters']));if(_0x487cf3[_0x4935('0x31')][_0x4935('0x3a')]){_0x2cc0c1['where']=_[_0x4935('0x3b')](_0x2cc0c1[_0x4935('0x38')],{'$or':_[_0x4935('0x2b')](_0x2cc0c1[_0x4935('0x33')],function(_0x42ff64){var _0x2d21f0={};_0x2d21f0[_0x42ff64]={'$like':'%'+_0x487cf3[_0x4935('0x31')]['filter']+'%'};return _0x2d21f0;})});}_0x2cc0c1=_[_0x4935('0x3b')]({},_0x2cc0c1,_0x487cf3['options']);return _0x377ff4['getConfigurations'](_0x2cc0c1);}})[_0x4935('0x25')](function(_0xc3fb8f){if(_0xc3fb8f){_0x8196b4=_0xc3fb8f['length'];if(!_0x487cf3['query'][_0x4935('0x4b')](_0x4935('0x36'))){_0x2cc0c1[_0x4935('0x1e')]=qs['limit'](_0x487cf3[_0x4935('0x31')]['limit']);_0x2cc0c1[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x487cf3[_0x4935('0x31')][_0x4935('0x1c')]);}return _0x377ff4[_0x4935('0x48')](_0x2cc0c1);}})['then'](function(_0x1eb15d){if(_0x1eb15d){return _0x1eb15d?{'count':_0x8196b4,'rows':_0x1eb15d}:null;}})[_0x4935('0x25')](respondWithResult(_0x32e004,null))['catch'](handleError(_0x32e004,null));};exports[_0x4935('0x4c')]=function(_0x2ae5ee,_0x283b75,_0x2046b2){if(_0x2ae5ee[_0x4935('0x47')]['id']){delete _0x2ae5ee[_0x4935('0x47')]['id'];}return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x2ae5ee[_0x4935('0x42')]['id']}})[_0x4935('0x25')](handleEntityNotFound(_0x283b75,null))[_0x4935('0x25')](function(_0x5d4435){if(_0x5d4435){_0x2ae5ee[_0x4935('0x47')][_0x4935('0x4d')]=_0x5d4435['id'];_0x2ae5ee[_0x4935('0x47')][_0x4935('0x4e')]=integrations[_0x4935('0x4f')](_0x2ae5ee[_0x4935('0x47')][_0x4935('0x50')],_0x2ae5ee[_0x4935('0x47')][_0x4935('0x2e')]);_0x2ae5ee[_0x4935('0x47')][_0x4935('0x51')]=integrations[_0x4935('0x52')](_0x2ae5ee[_0x4935('0x47')]['channel'],_0x2ae5ee['body'][_0x4935('0x2e')]);return db[_0x4935('0x4a')]['create'](_0x2ae5ee[_0x4935('0x47')],{'include':[{'model':db[_0x4935('0x53')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x4935('0x51')}]});}return null;})[_0x4935('0x25')](respondWithResult(_0x283b75,null))[_0x4935('0x40')](handleError(_0x283b75,null));};exports[_0x4935('0x54')]=function(_0x105e38,_0x5a612b,_0x404b2c){var _0x1f5e21='';return db[_0x4935('0x2c')][_0x4935('0x49')]({'where':{'id':_0x105e38['params']['id']},'attributes':['id',_0x4935('0x55'),'password','token',_0x4935('0x56'),_0x4935('0x57')]})['then'](handleEntityNotFound(_0x5a612b,null))[_0x4935('0x25')](function(_0x22d594){if(_0x22d594){_0x1f5e21=_0x22d594[_0x4935('0x57')];var _0x4c1b82=_0x1f5e21[_0x4935('0x58')](-0x1);if(_0x4c1b82==='/'){_0x1f5e21=_0x1f5e21['substring'](0x0,_0x1f5e21['lastIndexOf'](_0x4c1b82));}var _0x190186={'method':_0x4935('0x59'),'uri':util[_0x4935('0x5a')](_0x4935('0x5b'),_0x1f5e21,_0x4935('0x5c')),'json':!![]};switch(_0x22d594[_0x4935('0x56')]){case _0x4935('0x5d'):_0x190186[_0x4935('0x5e')]={'Authorization':util['format'](_0x4935('0x5f'),new Buffer(util[_0x4935('0x5a')](_0x4935('0x60'),_0x22d594['username'],_0x22d594['password']))[_0x4935('0x61')](_0x4935('0x62')))};break;case'token':_0x190186[_0x4935('0x5e')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4935('0x5a')](_0x4935('0x63'),_0x22d594[_0x4935('0x55')],_0x22d594['token']))['toString'](_0x4935('0x62')))};break;default:throw new db['Sequelize'][(_0x4935('0x64'))]('Unknown\x20authentication\x20type');}return rp(_0x190186);}})[_0x4935('0x25')](function(_0x91b821){if(_0x91b821){var _0xa5c497=[_0x4935('0x65'),_0x4935('0x66'),_0x4935('0x67'),_0x4935('0x68')];_['remove'](_0x91b821[_0x4935('0x5c')],function(_0x493392){return _0xa5c497[_0x4935('0x69')](_0x493392[_0x4935('0x2e')]);});return{'count':_0x91b821['ticket_fields'][_0x4935('0x44')],'rows':_['map'](_0x91b821[_0x4935('0x5c')],function(_0x402963){return{'id':_0x402963['id'],'name':_0x402963['position']>0x7?_0x402963['title']:_0x402963['type'],'custom':_0x402963[_0x4935('0x6a')]>0x7?!![]:![],'options':_0x402963['system_field_options']?_0x402963['system_field_options']:_0x402963[_0x4935('0x6b')]?_0x402963['custom_field_options']:[]};})};}})[_0x4935('0x25')](respondWithResult(_0x5a612b,null))['catch'](function(_0x497246){var _0x5c5978=_0x105e38[_0x4935('0x31')]['test']?0x1f4:_0x497246[_0x4935('0x6c')]||0x1f4;logger[_0x4935('0x27')](_0x4935('0x6d'),_0x4935('0x54'),_0x5c5978,JSON[_0x4935('0x6e')](_0x497246));delete _0x497246['name'];if(_0x5c5978===0x191){_0x5c5978=0x190;}_0x5a612b[_0x4935('0x19')](_0x5c5978)[_0x4935('0x6f')](_0x105e38['query'][_0x4935('0x70')]?{'message':_0x4935('0x71'),'statusCode':_0x497246['statusCode']}:_0x497246);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 683d8eb..c7e9ef6 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 _0x6cc7=['../../config/environment','exports','define','ZendeskAccount','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x49b5ed,_0x35cb99){var _0x117247=function(_0x13d664){while(--_0x13d664){_0x49b5ed['push'](_0x49b5ed['shift']());}};_0x117247(++_0x35cb99);}(_0x6cc7,0x10c));var _0x76cc=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0x6cc7[_0x1ae31c];return _0x19519d;};'use strict';var _=require(_0x76cc('0x0'));var util=require('util');var logger=require(_0x76cc('0x1'))(_0x76cc('0x2'));var moment=require(_0x76cc('0x3'));var BPromise=require(_0x76cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76cc('0x5'));var rimraf=require(_0x76cc('0x6'));var config=require(_0x76cc('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x76cc('0x8')]=function(_0x23a516,_0x3a7e04){return _0x23a516[_0x76cc('0x9')](_0x76cc('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b03=['request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x2b03,0x11a));var _0x32b0=function(_0xc48bd8,_0x355a3c){_0xc48bd8=_0xc48bd8-0x0;var _0x437282=_0x2b03[_0xc48bd8];return _0x437282;};'use strict';var _=require(_0x32b0('0x0'));var util=require(_0x32b0('0x1'));var logger=require(_0x32b0('0x2'))(_0x32b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x32b0('0x4'));var fs=require('fs');var path=require(_0x32b0('0x5'));var rimraf=require(_0x32b0('0x6'));var config=require(_0x32b0('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x32b0('0x8'));module[_0x32b0('0x9')]=function(_0x527bf5,_0x4d4eb4){return _0x527bf5['define']('ZendeskAccount',attributes,{'tableName':_0x32b0('0xa'),'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 bc32d74..03a00b3 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 _0xec28=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetZendeskAccount','findAll','options','raw','attributes','limit','map','include','model','ZendeskAccount','find','ShowZendeskAccount','lodash','util','bluebird'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xec28,0x14a));var _0x8ec2=function(_0x5aa023,_0x1cf1d2){_0x5aa023=_0x5aa023-0x0;var _0x31ceb5=_0xec28[_0x5aa023];return _0x31ceb5;};'use strict';var _=require(_0x8ec2('0x0'));var util=require(_0x8ec2('0x1'));var moment=require('moment');var BPromise=require(_0x8ec2('0x2'));var rs=require(_0x8ec2('0x3'));var fs=require('fs');var Redis=require(_0x8ec2('0x4'));var db=require(_0x8ec2('0x5'))['db'];var utils=require(_0x8ec2('0x6'));var logger=require(_0x8ec2('0x7'))(_0x8ec2('0x8'));var config=require(_0x8ec2('0x9'));var jayson=require(_0x8ec2('0xa'));var client=jayson[_0x8ec2('0xb')][_0x8ec2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2cfbc0,_0xdee3a7,_0x4558bf){return new BPromise(function(_0x22fa33,_0xcae745){return client[_0x8ec2('0xd')](_0x2cfbc0,_0x4558bf)[_0x8ec2('0xe')](function(_0x386011){logger['info'](_0x8ec2('0xf'),_0xdee3a7,'request\x20sent');logger[_0x8ec2('0x10')](_0x8ec2('0x11'),_0xdee3a7,_0x8ec2('0x12'),JSON[_0x8ec2('0x13')](_0x386011));if(_0x386011[_0x8ec2('0x14')]){if(_0x386011[_0x8ec2('0x14')]['code']===0x1f4){logger[_0x8ec2('0x14')](_0x8ec2('0xf'),_0xdee3a7,_0x386011[_0x8ec2('0x14')][_0x8ec2('0x15')]);return _0xcae745(_0x386011[_0x8ec2('0x14')][_0x8ec2('0x15')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0xdee3a7,_0x386011[_0x8ec2('0x14')]['message']);return _0x22fa33(_0x386011[_0x8ec2('0x14')]['message']);}else{logger[_0x8ec2('0x16')](_0x8ec2('0xf'),_0xdee3a7,_0x8ec2('0x12'));_0x22fa33(_0x386011[_0x8ec2('0x17')]['message']);}})[_0x8ec2('0x18')](function(_0x1328b5){logger[_0x8ec2('0x14')](_0x8ec2('0xf'),_0xdee3a7,_0x1328b5);_0xcae745(_0x1328b5);});});}exports[_0x8ec2('0x19')]=function(_0x483c78){var _0x4d23c9=this;return new Promise(function(_0xccccac,_0x2d2b61){return db['ZendeskAccount'][_0x8ec2('0x1a')]({'raw':_0x483c78[_0x8ec2('0x1b')]?_0x483c78[_0x8ec2('0x1b')][_0x8ec2('0x1c')]===undefined?!![]:![]:!![],'where':_0x483c78[_0x8ec2('0x1b')]?_0x483c78[_0x8ec2('0x1b')]['where']||null:null,'attributes':_0x483c78[_0x8ec2('0x1b')]?_0x483c78[_0x8ec2('0x1b')][_0x8ec2('0x1d')]||null:null,'limit':_0x483c78[_0x8ec2('0x1b')]?_0x483c78[_0x8ec2('0x1b')][_0x8ec2('0x1e')]||null:null,'include':_0x483c78[_0x8ec2('0x1b')]?_0x483c78[_0x8ec2('0x1b')]['include']?_[_0x8ec2('0x1f')](_0x483c78[_0x8ec2('0x1b')][_0x8ec2('0x20')],function(_0x2d740b){return{'model':db[_0x2d740b[_0x8ec2('0x21')]],'as':_0x2d740b['as'],'attributes':_0x2d740b['attributes'],'include':_0x2d740b[_0x8ec2('0x20')]?_[_0x8ec2('0x1f')](_0x2d740b[_0x8ec2('0x20')],function(_0x3a869f){return{'model':db[_0x3a869f[_0x8ec2('0x21')]],'as':_0x3a869f['as'],'attributes':_0x3a869f['attributes'],'include':_0x3a869f['include']?_[_0x8ec2('0x1f')](_0x3a869f['include'],function(_0x196329){return{'model':db[_0x196329[_0x8ec2('0x21')]],'as':_0x196329['as'],'attributes':_0x196329[_0x8ec2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8ec2('0xe')](function(_0x3ac02d){logger[_0x8ec2('0x16')](_0x8ec2('0x19'),_0x483c78);logger[_0x8ec2('0x10')](_0x8ec2('0x19'),_0x483c78,JSON['stringify'](_0x3ac02d));_0xccccac(_0x3ac02d);})[_0x8ec2('0x18')](function(_0x5a360f){logger[_0x8ec2('0x14')](_0x8ec2('0x19'),_0x5a360f['message'],_0x483c78);_0x2d2b61(_0x4d23c9['error'](0x1f4,_0x5a360f[_0x8ec2('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x3dc7ea){var _0x5050aa=this;return new Promise(function(_0xa50b0,_0xc0363c){return db[_0x8ec2('0x22')][_0x8ec2('0x23')]({'raw':_0x3dc7ea[_0x8ec2('0x1b')]?_0x3dc7ea[_0x8ec2('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3dc7ea[_0x8ec2('0x1b')]?_0x3dc7ea[_0x8ec2('0x1b')]['where']||null:null,'attributes':_0x3dc7ea['options']?_0x3dc7ea['options'][_0x8ec2('0x1d')]||null:null,'include':_0x3dc7ea[_0x8ec2('0x1b')]?_0x3dc7ea['options'][_0x8ec2('0x20')]?_[_0x8ec2('0x1f')](_0x3dc7ea[_0x8ec2('0x1b')][_0x8ec2('0x20')],function(_0x519ea4){return{'model':db[_0x519ea4[_0x8ec2('0x21')]],'as':_0x519ea4['as'],'attributes':_0x519ea4[_0x8ec2('0x1d')],'include':_0x519ea4[_0x8ec2('0x20')]?_[_0x8ec2('0x1f')](_0x519ea4[_0x8ec2('0x20')],function(_0x36abf2){return{'model':db[_0x36abf2[_0x8ec2('0x21')]],'as':_0x36abf2['as'],'attributes':_0x36abf2[_0x8ec2('0x1d')],'include':_0x36abf2[_0x8ec2('0x20')]?_[_0x8ec2('0x1f')](_0x36abf2['include'],function(_0x1456d7){return{'model':db[_0x1456d7[_0x8ec2('0x21')]],'as':_0x1456d7['as'],'attributes':_0x1456d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ec2('0xe')](function(_0x4b4e61){logger[_0x8ec2('0x16')]('ShowZendeskAccount',_0x3dc7ea);logger['debug']('ShowZendeskAccount',_0x3dc7ea,JSON[_0x8ec2('0x13')](_0x4b4e61));_0xa50b0(_0x4b4e61);})[_0x8ec2('0x18')](function(_0x127995){logger['error'](_0x8ec2('0x24'),_0x127995['message'],_0x3dc7ea);_0xc0363c(_0x5050aa['error'](0x1f4,_0x127995[_0x8ec2('0x15')]));});});}; \ No newline at end of file +var _0x3619=['then','find','ShowZendeskAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','include','map','model'];(function(_0x40cd30,_0x17e002){var _0x53ad7f=function(_0x429d28){while(--_0x429d28){_0x40cd30['push'](_0x40cd30['shift']());}};_0x53ad7f(++_0x17e002);}(_0x3619,0x6d));var _0x9361=function(_0x29faf8,_0x555fbb){_0x29faf8=_0x29faf8-0x0;var _0x36c0f1=_0x3619[_0x29faf8];return _0x36c0f1;};'use strict';var _=require('lodash');var util=require(_0x9361('0x0'));var moment=require(_0x9361('0x1'));var BPromise=require(_0x9361('0x2'));var rs=require(_0x9361('0x3'));var fs=require('fs');var Redis=require(_0x9361('0x4'));var db=require(_0x9361('0x5'))['db'];var utils=require(_0x9361('0x6'));var logger=require('../../config/logger')(_0x9361('0x7'));var config=require(_0x9361('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9361('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb1bf,_0x288508,_0x321b64){return new BPromise(function(_0x3b01a8,_0x4ae74f){return client[_0x9361('0xa')](_0x2bb1bf,_0x321b64)['then'](function(_0x1857a3){logger['info'](_0x9361('0xb'),_0x288508,'request\x20sent');logger[_0x9361('0xc')](_0x9361('0xd'),_0x288508,_0x9361('0xe'),JSON[_0x9361('0xf')](_0x1857a3));if(_0x1857a3[_0x9361('0x10')]){if(_0x1857a3['error'][_0x9361('0x11')]===0x1f4){logger[_0x9361('0x10')](_0x9361('0xb'),_0x288508,_0x1857a3[_0x9361('0x10')][_0x9361('0x12')]);return _0x4ae74f(_0x1857a3[_0x9361('0x10')][_0x9361('0x12')]);}logger[_0x9361('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x288508,_0x1857a3[_0x9361('0x10')][_0x9361('0x12')]);return _0x3b01a8(_0x1857a3[_0x9361('0x10')][_0x9361('0x12')]);}else{logger[_0x9361('0x13')](_0x9361('0xb'),_0x288508,'request\x20sent');_0x3b01a8(_0x1857a3[_0x9361('0x14')][_0x9361('0x12')]);}})['catch'](function(_0x3a4648){logger[_0x9361('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x288508,_0x3a4648);_0x4ae74f(_0x3a4648);});});}exports[_0x9361('0x15')]=function(_0x2dfd71){var _0x205be8=this;return new Promise(function(_0x1a89ba,_0x2236d7){return db[_0x9361('0x16')]['findAll']({'raw':_0x2dfd71[_0x9361('0x17')]?_0x2dfd71[_0x9361('0x17')][_0x9361('0x18')]===undefined?!![]:![]:!![],'where':_0x2dfd71[_0x9361('0x17')]?_0x2dfd71[_0x9361('0x17')][_0x9361('0x19')]||null:null,'attributes':_0x2dfd71[_0x9361('0x17')]?_0x2dfd71[_0x9361('0x17')][_0x9361('0x1a')]||null:null,'limit':_0x2dfd71[_0x9361('0x17')]?_0x2dfd71[_0x9361('0x17')][_0x9361('0x1b')]||null:null,'include':_0x2dfd71[_0x9361('0x17')]?_0x2dfd71[_0x9361('0x17')][_0x9361('0x1c')]?_['map'](_0x2dfd71[_0x9361('0x17')][_0x9361('0x1c')],function(_0x565f7f){return{'model':db[_0x565f7f['model']],'as':_0x565f7f['as'],'attributes':_0x565f7f[_0x9361('0x1a')],'include':_0x565f7f[_0x9361('0x1c')]?_[_0x9361('0x1d')](_0x565f7f[_0x9361('0x1c')],function(_0x283f2c){return{'model':db[_0x283f2c[_0x9361('0x1e')]],'as':_0x283f2c['as'],'attributes':_0x283f2c[_0x9361('0x1a')],'include':_0x283f2c[_0x9361('0x1c')]?_[_0x9361('0x1d')](_0x283f2c['include'],function(_0x257b67){return{'model':db[_0x257b67['model']],'as':_0x257b67['as'],'attributes':_0x257b67[_0x9361('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9361('0x1f')](function(_0x3a4c2e){logger[_0x9361('0x13')](_0x9361('0x15'),_0x2dfd71);logger[_0x9361('0xc')]('GetZendeskAccount',_0x2dfd71,JSON['stringify'](_0x3a4c2e));_0x1a89ba(_0x3a4c2e);})['catch'](function(_0x2e6e44){logger[_0x9361('0x10')](_0x9361('0x15'),_0x2e6e44[_0x9361('0x12')],_0x2dfd71);_0x2236d7(_0x205be8[_0x9361('0x10')](0x1f4,_0x2e6e44[_0x9361('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x3cb576){var _0x3ff390=this;return new Promise(function(_0x18a963,_0x22c8e6){return db['ZendeskAccount'][_0x9361('0x20')]({'raw':_0x3cb576[_0x9361('0x17')]?_0x3cb576[_0x9361('0x17')][_0x9361('0x18')]===undefined?!![]:![]:!![],'where':_0x3cb576['options']?_0x3cb576['options']['where']||null:null,'attributes':_0x3cb576[_0x9361('0x17')]?_0x3cb576[_0x9361('0x17')][_0x9361('0x1a')]||null:null,'include':_0x3cb576[_0x9361('0x17')]?_0x3cb576['options'][_0x9361('0x1c')]?_[_0x9361('0x1d')](_0x3cb576['options']['include'],function(_0x177711){return{'model':db[_0x177711[_0x9361('0x1e')]],'as':_0x177711['as'],'attributes':_0x177711[_0x9361('0x1a')],'include':_0x177711['include']?_['map'](_0x177711['include'],function(_0x4e6102){return{'model':db[_0x4e6102[_0x9361('0x1e')]],'as':_0x4e6102['as'],'attributes':_0x4e6102[_0x9361('0x1a')],'include':_0x4e6102[_0x9361('0x1c')]?_[_0x9361('0x1d')](_0x4e6102['include'],function(_0x4e9263){return{'model':db[_0x4e9263['model']],'as':_0x4e9263['as'],'attributes':_0x4e9263[_0x9361('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x318052){logger[_0x9361('0x13')](_0x9361('0x21'),_0x3cb576);logger[_0x9361('0xc')](_0x9361('0x21'),_0x3cb576,JSON[_0x9361('0xf')](_0x318052));_0x18a963(_0x318052);})[_0x9361('0x22')](function(_0x37fe70){logger[_0x9361('0x10')]('ShowZendeskAccount',_0x37fe70['message'],_0x3cb576);_0x22c8e6(_0x3ff390[_0x9361('0x10')](0x1f4,_0x37fe70[_0x9361('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c847cdb..49283e3 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 _0x36ee=['Router','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','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x36ee,0xe8));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0xaa9357,_0x5f1bcd){var _0x7c4583=function(_0x379405){while(--_0x379405){_0xaa9357['push'](_0xaa9357['shift']());}};_0x7c4583(++_0x5f1bcd);}(_0xda3f,0xec));var _0xfda3=function(_0x2daae9,_0x16f4b9){_0x2daae9=_0x2daae9-0x0;var _0x42830d=_0xda3f[_0x2daae9];return _0x42830d;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9ede08b..c9f8842 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 _0x1ef2=['exports','STRING','sequelize'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0x1ef2,0x1e2));var _0x21ef=function(_0x134c72,_0x29aae6){_0x134c72=_0x134c72-0x0;var _0x36d3fc=_0x1ef2[_0x134c72];return _0x36d3fc;};'use strict';var Sequelize=require(_0x21ef('0x0'));module[_0x21ef('0x1')]={'name':{'type':Sequelize[_0x21ef('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8c05=['exports','STRING'];(function(_0x315d32,_0x33485b){var _0x3ea98d=function(_0x4111ee){while(--_0x4111ee){_0x315d32['push'](_0x315d32['shift']());}};_0x3ea98d(++_0x33485b);}(_0x8c05,0x8e));var _0x58c0=function(_0x3d4af2,_0x415445){_0x3d4af2=_0x3d4af2-0x0;var _0x347c55=_0x8c05[_0x3d4af2];return _0x347c55;};'use strict';var Sequelize=require('sequelize');module[_0x58c0('0x0')]={'name':{'type':Sequelize[_0x58c0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d4fa6b3..a1b5241 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 _0x5d2a=['send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','ZendeskConfiguration','include','find','create','body','getFields','findOne','ZendeskField','length','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x5d2a,0xce));var _0xa5d2=function(_0x2e5434,_0x408c9c){_0x2e5434=_0x2e5434-0x0;var _0x1f3535=_0x5d2a[_0x2e5434];return _0x1f3535;};'use strict';var emlformat=require(_0xa5d2('0x0'));var rimraf=require(_0xa5d2('0x1'));var zipdir=require(_0xa5d2('0x2'));var jsonpatch=require(_0xa5d2('0x3'));var rp=require(_0xa5d2('0x4'));var moment=require('moment');var BPromise=require(_0xa5d2('0x5'));var Mustache=require('mustache');var util=require(_0xa5d2('0x6'));var path=require('path');var sox=require(_0xa5d2('0x7'));var csv=require(_0xa5d2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa5d2('0x9'));var squel=require(_0xa5d2('0xa'));var crypto=require(_0xa5d2('0xb'));var jsforce=require(_0xa5d2('0xc'));var deskjs=require(_0xa5d2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa5d2('0xe'));var Papa=require(_0xa5d2('0xf'));var Redis=require(_0xa5d2('0x10'));var authService=require(_0xa5d2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5d2('0x12'))(_0xa5d2('0x13'));var utils=require(_0xa5d2('0x14'));var config=require(_0xa5d2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d2('0x16'))['db'];function respondWithStatusCode(_0x4c6cb5,_0x579ce2){_0x579ce2=_0x579ce2||0xcc;return function(_0x17f4af){if(_0x17f4af){return _0x4c6cb5[_0xa5d2('0x17')](_0x579ce2);}return _0x4c6cb5[_0xa5d2('0x18')](_0x579ce2)[_0xa5d2('0x19')]();};}function respondWithResult(_0x288722,_0xe2b7cb){_0xe2b7cb=_0xe2b7cb||0xc8;return function(_0x4e27bb){if(_0x4e27bb){return _0x288722[_0xa5d2('0x18')](_0xe2b7cb)['json'](_0x4e27bb);}};}function respondWithFilteredResult(_0x230f10,_0x2905da){return function(_0x3101df){if(_0x3101df){var _0x48b2b0=typeof _0x2905da[_0xa5d2('0x1a')]===_0xa5d2('0x1b')&&typeof _0x2905da[_0xa5d2('0x1c')]==='undefined';var _0x35f737=_0x3101df[_0xa5d2('0x1d')];var _0x2328c4=_0x48b2b0?0x0:_0x2905da[_0xa5d2('0x1a')];var _0x21d26c=_0x48b2b0?_0x3101df[_0xa5d2('0x1d')]:_0x2905da[_0xa5d2('0x1a')]+_0x2905da[_0xa5d2('0x1c')];var _0xd4ceae;if(_0x21d26c>=_0x35f737){_0x21d26c=_0x35f737;_0xd4ceae=0xc8;}else{_0xd4ceae=0xce;}_0x230f10['status'](_0xd4ceae);return _0x230f10[_0xa5d2('0x1e')](_0xa5d2('0x1f'),_0x2328c4+'-'+_0x21d26c+'/'+_0x35f737)[_0xa5d2('0x20')](_0x3101df);}return null;};}function patchUpdates(_0x5c70d0){return function(_0x155740){try{jsonpatch[_0xa5d2('0x21')](_0x155740,_0x5c70d0,!![]);}catch(_0x388392){return BPromise[_0xa5d2('0x22')](_0x388392);}return _0x155740[_0xa5d2('0x23')]();};}function saveUpdates(_0x64bd69,_0x3f0bcb){return function(_0x2be2f4){if(_0x2be2f4){return _0x2be2f4[_0xa5d2('0x24')](_0x64bd69)[_0xa5d2('0x25')](function(_0x4d59e8){return _0x4d59e8;});}return null;};}function removeEntity(_0x2820ab,_0x2f392d){return function(_0x2d3d77){if(_0x2d3d77){return _0x2d3d77[_0xa5d2('0x26')]()[_0xa5d2('0x25')](function(){_0x2820ab[_0xa5d2('0x18')](0xcc)[_0xa5d2('0x19')]();});}};}function handleEntityNotFound(_0x352045,_0x45146f){return function(_0xc644cc){if(!_0xc644cc){_0x352045['sendStatus'](0x194);}return _0xc644cc;};}function handleError(_0x3727c8,_0x446758){_0x446758=_0x446758||0x1f4;return function(_0x159d35){logger['error'](_0x159d35['stack']);if(_0x159d35['name']){delete _0x159d35[_0xa5d2('0x27')];}_0x3727c8['status'](_0x446758)[_0xa5d2('0x28')](_0x159d35);};}exports['index']=function(_0x1c9fb4,_0x57a421){var _0x15fe5f={},_0x52095a={},_0x3e83b4={'count':0x0,'rows':[]};var _0x49bee6=_['map'](db['ZendeskConfiguration'][_0xa5d2('0x29')],function(_0xd1bf9f){return{'name':_0xd1bf9f[_0xa5d2('0x2a')],'type':_0xd1bf9f[_0xa5d2('0x2b')]['key']};});_0x52095a[_0xa5d2('0x2c')]=_[_0xa5d2('0x2d')](_0x49bee6,_0xa5d2('0x27'));_0x52095a[_0xa5d2('0x2e')]=_[_0xa5d2('0x2f')](_0x1c9fb4[_0xa5d2('0x2e')]);_0x52095a[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x52095a[_0xa5d2('0x2c')],_0x52095a[_0xa5d2('0x2e')]);_0x15fe5f['attributes']=_['intersection'](_0x52095a[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x32')]));_0x15fe5f[_0xa5d2('0x33')]=_0x15fe5f[_0xa5d2('0x33')]['length']?_0x15fe5f[_0xa5d2('0x33')]:_0x52095a[_0xa5d2('0x2c')];if(!_0x1c9fb4[_0xa5d2('0x2e')]['hasOwnProperty']('nolimit')){_0x15fe5f[_0xa5d2('0x1c')]=qs[_0xa5d2('0x1c')](_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x1c')]);_0x15fe5f['offset']=qs['offset'](_0x1c9fb4['query'][_0xa5d2('0x1a')]);}_0x15fe5f[_0xa5d2('0x34')]=qs[_0xa5d2('0x35')](_0x1c9fb4['query'][_0xa5d2('0x35')]);_0x15fe5f[_0xa5d2('0x36')]=qs['filters'](_[_0xa5d2('0x37')](_0x1c9fb4[_0xa5d2('0x2e')],_0x52095a['filters']),_0x49bee6);if(_0x1c9fb4[_0xa5d2('0x2e')]['filter']){_0x15fe5f[_0xa5d2('0x36')]=_[_0xa5d2('0x38')](_0x15fe5f[_0xa5d2('0x36')],{'$or':_[_0xa5d2('0x2d')](_0x49bee6,function(_0x476dc7){if(_0x476dc7[_0xa5d2('0x2b')]!==_0xa5d2('0x39')){var _0x2a5afe={};_0x2a5afe[_0x476dc7[_0xa5d2('0x27')]]={'$like':'%'+_0x1c9fb4['query'][_0xa5d2('0x3a')]+'%'};return _0x2a5afe;}})});}_0x15fe5f=_[_0xa5d2('0x38')]({},_0x15fe5f,_0x1c9fb4[_0xa5d2('0x3b')]);var _0x6c1d02={'where':_0x15fe5f[_0xa5d2('0x36')]};return db['ZendeskConfiguration'][_0xa5d2('0x1d')](_0x6c1d02)['then'](function(_0x3b0701){_0x3e83b4['count']=_0x3b0701;if(_0x1c9fb4[_0xa5d2('0x2e')][_0xa5d2('0x3c')]){_0x15fe5f['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x15fe5f);})[_0xa5d2('0x25')](function(_0x4cbcf9){_0x3e83b4[_0xa5d2('0x3d')]=_0x4cbcf9;return _0x3e83b4;})[_0xa5d2('0x25')](respondWithFilteredResult(_0x57a421,_0x15fe5f))[_0xa5d2('0x3e')](handleError(_0x57a421,null));};exports[_0xa5d2('0x3f')]=function(_0x11284c,_0x3e5514){var _0x393b95={'raw':![],'where':{'id':_0x11284c[_0xa5d2('0x40')]['id']}},_0x2babdb={};_0x2babdb[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db[_0xa5d2('0x41')][_0xa5d2('0x29')]);_0x2babdb['query']=_[_0xa5d2('0x2f')](_0x11284c[_0xa5d2('0x2e')]);_0x2babdb[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x2babdb[_0xa5d2('0x2c')],_0x2babdb[_0xa5d2('0x2e')]);_0x393b95['attributes']=_['intersection'](_0x2babdb[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x11284c[_0xa5d2('0x2e')]['fields']));_0x393b95['attributes']=_0x393b95['attributes']['length']?_0x393b95[_0xa5d2('0x33')]:_0x2babdb[_0xa5d2('0x2c')];if(_0x11284c[_0xa5d2('0x2e')][_0xa5d2('0x3c')]){_0x393b95[_0xa5d2('0x42')]=[{'all':!![]}];}_0x393b95=_[_0xa5d2('0x38')]({},_0x393b95,_0x11284c['options']);return db[_0xa5d2('0x41')][_0xa5d2('0x43')](_0x393b95)[_0xa5d2('0x25')](handleEntityNotFound(_0x3e5514,null))['then'](respondWithResult(_0x3e5514,null))['catch'](handleError(_0x3e5514,null));};exports[_0xa5d2('0x44')]=function(_0x5d47a2,_0xf2a53d){return db['ZendeskConfiguration'][_0xa5d2('0x44')](_0x5d47a2['body'],{})[_0xa5d2('0x25')](respondWithResult(_0xf2a53d,0xc9))[_0xa5d2('0x3e')](handleError(_0xf2a53d,null));};exports[_0xa5d2('0x24')]=function(_0x3c4b71,_0x2d9c30){if(_0x3c4b71[_0xa5d2('0x45')]['id']){delete _0x3c4b71[_0xa5d2('0x45')]['id'];}return db[_0xa5d2('0x41')][_0xa5d2('0x43')]({'where':{'id':_0x3c4b71['params']['id']}})['then'](handleEntityNotFound(_0x2d9c30,null))['then'](saveUpdates(_0x3c4b71[_0xa5d2('0x45')],null))[_0xa5d2('0x25')](respondWithResult(_0x2d9c30,null))['catch'](handleError(_0x2d9c30,null));};exports[_0xa5d2('0x26')]=function(_0x19946c,_0x1ce3c8){return db[_0xa5d2('0x41')][_0xa5d2('0x43')]({'where':{'id':_0x19946c[_0xa5d2('0x40')]['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x1ce3c8,null))['then'](removeEntity(_0x1ce3c8,null))[_0xa5d2('0x3e')](handleError(_0x1ce3c8,null));};exports[_0xa5d2('0x46')]=function(_0x38d127,_0x2dfd08,_0x58f788){var _0x4f9038={};var _0x451e01={};var _0xaefeae;var _0x26c1a7;return db[_0xa5d2('0x41')][_0xa5d2('0x47')]({'where':{'id':_0x38d127['params']['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x2dfd08,null))[_0xa5d2('0x25')](function(_0x414917){if(_0x414917){_0xaefeae=_0x414917;_0x451e01[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db[_0xa5d2('0x48')][_0xa5d2('0x29')]);_0x451e01[_0xa5d2('0x2e')]=_[_0xa5d2('0x2f')](_0x38d127['query']);_0x451e01[_0xa5d2('0x30')]=_['intersection'](_0x451e01[_0xa5d2('0x2c')],_0x451e01[_0xa5d2('0x2e')]);_0x4f9038['attributes']=_[_0xa5d2('0x31')](_0x451e01[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x38d127[_0xa5d2('0x2e')][_0xa5d2('0x32')]));_0x4f9038[_0xa5d2('0x33')]=_0x4f9038[_0xa5d2('0x33')][_0xa5d2('0x49')]?_0x4f9038['attributes']:_0x451e01['model'];_0x4f9038['order']=qs[_0xa5d2('0x35')](_0x38d127['query'][_0xa5d2('0x35')]);_0x4f9038[_0xa5d2('0x36')]=qs['filters'](_[_0xa5d2('0x37')](_0x38d127['query'],_0x451e01['filters']));if(_0x38d127[_0xa5d2('0x2e')][_0xa5d2('0x3a')]){_0x4f9038['where']=_['merge'](_0x4f9038[_0xa5d2('0x36')],{'$or':_[_0xa5d2('0x2d')](_0x4f9038[_0xa5d2('0x33')],function(_0xa7decb){var _0x22fbae={};_0x22fbae[_0xa7decb]={'$like':'%'+_0x38d127[_0xa5d2('0x2e')]['filter']+'%'};return _0x22fbae;})});}_0x4f9038=_[_0xa5d2('0x38')]({},_0x4f9038,_0x38d127[_0xa5d2('0x3b')]);return _0xaefeae['getFields'](_0x4f9038);}})['then'](function(_0x3c264b){if(_0x3c264b){_0x26c1a7=_0x3c264b[_0xa5d2('0x49')];if(!_0x38d127['query'][_0xa5d2('0x4a')](_0xa5d2('0x4b'))){_0x4f9038[_0xa5d2('0x1c')]=qs[_0xa5d2('0x1c')](_0x38d127['query'][_0xa5d2('0x1c')]);_0x4f9038[_0xa5d2('0x1a')]=qs[_0xa5d2('0x1a')](_0x38d127[_0xa5d2('0x2e')]['offset']);}return _0xaefeae[_0xa5d2('0x46')](_0x4f9038);}})[_0xa5d2('0x25')](function(_0x42e8ed){if(_0x42e8ed){return _0x42e8ed?{'count':_0x26c1a7,'rows':_0x42e8ed}:null;}})[_0xa5d2('0x25')](respondWithResult(_0x2dfd08,null))[_0xa5d2('0x3e')](handleError(_0x2dfd08,null));};exports[_0xa5d2('0x4c')]=function(_0x1859ac,_0x176dc1,_0x51f918){var _0x284995={};var _0x5d9fed={};var _0x591e7b;var _0x2f7604;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1859ac[_0xa5d2('0x40')]['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x176dc1,null))[_0xa5d2('0x25')](function(_0x2e4287){if(_0x2e4287){_0x591e7b=_0x2e4287;_0x5d9fed[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db[_0xa5d2('0x48')][_0xa5d2('0x29')]);_0x5d9fed[_0xa5d2('0x2e')]=_[_0xa5d2('0x2f')](_0x1859ac[_0xa5d2('0x2e')]);_0x5d9fed['filters']=_['intersection'](_0x5d9fed[_0xa5d2('0x2c')],_0x5d9fed[_0xa5d2('0x2e')]);_0x284995[_0xa5d2('0x33')]=_[_0xa5d2('0x31')](_0x5d9fed[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x1859ac['query']['fields']));_0x284995[_0xa5d2('0x33')]=_0x284995[_0xa5d2('0x33')][_0xa5d2('0x49')]?_0x284995['attributes']:_0x5d9fed[_0xa5d2('0x2c')];_0x284995[_0xa5d2('0x34')]=qs['sort'](_0x1859ac[_0xa5d2('0x2e')][_0xa5d2('0x35')]);_0x284995[_0xa5d2('0x36')]=qs[_0xa5d2('0x30')](_[_0xa5d2('0x37')](_0x1859ac['query'],_0x5d9fed[_0xa5d2('0x30')]));if(_0x1859ac[_0xa5d2('0x2e')][_0xa5d2('0x3a')]){_0x284995['where']=_[_0xa5d2('0x38')](_0x284995['where'],{'$or':_[_0xa5d2('0x2d')](_0x284995[_0xa5d2('0x33')],function(_0x1db3ad){var _0x7d4377={};_0x7d4377[_0x1db3ad]={'$like':'%'+_0x1859ac[_0xa5d2('0x2e')][_0xa5d2('0x3a')]+'%'};return _0x7d4377;})});}_0x284995=_[_0xa5d2('0x38')]({},_0x284995,_0x1859ac['options']);return _0x591e7b[_0xa5d2('0x4c')](_0x284995);}})[_0xa5d2('0x25')](function(_0xfcebc6){if(_0xfcebc6){_0x2f7604=_0xfcebc6[_0xa5d2('0x49')];if(!_0x1859ac['query'][_0xa5d2('0x4a')]('nolimit')){_0x284995[_0xa5d2('0x1c')]=qs['limit'](_0x1859ac[_0xa5d2('0x2e')][_0xa5d2('0x1c')]);_0x284995[_0xa5d2('0x1a')]=qs[_0xa5d2('0x1a')](_0x1859ac[_0xa5d2('0x2e')][_0xa5d2('0x1a')]);}return _0x591e7b[_0xa5d2('0x4c')](_0x284995);}})[_0xa5d2('0x25')](function(_0x725944){if(_0x725944){return _0x725944?{'count':_0x2f7604,'rows':_0x725944}:null;}})[_0xa5d2('0x25')](respondWithResult(_0x176dc1,null))[_0xa5d2('0x3e')](handleError(_0x176dc1,null));};exports['getDescriptions']=function(_0x56001b,_0x1f9305,_0x257306){var _0x162075={};var _0x292913={};var _0x5e3740;var _0x3390e1;return db[_0xa5d2('0x41')][_0xa5d2('0x47')]({'where':{'id':_0x56001b[_0xa5d2('0x40')]['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x1f9305,null))['then'](function(_0x44189d){if(_0x44189d){_0x5e3740=_0x44189d;_0x292913[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db['ZendeskField']['rawAttributes']);_0x292913['query']=_['keys'](_0x56001b[_0xa5d2('0x2e')]);_0x292913[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x292913['model'],_0x292913[_0xa5d2('0x2e')]);_0x162075[_0xa5d2('0x33')]=_[_0xa5d2('0x31')](_0x292913[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x56001b[_0xa5d2('0x2e')][_0xa5d2('0x32')]));_0x162075['attributes']=_0x162075[_0xa5d2('0x33')][_0xa5d2('0x49')]?_0x162075[_0xa5d2('0x33')]:_0x292913['model'];_0x162075[_0xa5d2('0x34')]=qs[_0xa5d2('0x35')](_0x56001b['query'][_0xa5d2('0x35')]);_0x162075[_0xa5d2('0x36')]=qs[_0xa5d2('0x30')](_['pick'](_0x56001b[_0xa5d2('0x2e')],_0x292913[_0xa5d2('0x30')]));if(_0x56001b[_0xa5d2('0x2e')][_0xa5d2('0x3a')]){_0x162075['where']=_['merge'](_0x162075[_0xa5d2('0x36')],{'$or':_[_0xa5d2('0x2d')](_0x162075[_0xa5d2('0x33')],function(_0x5e6dd2){var _0x15ddf6={};_0x15ddf6[_0x5e6dd2]={'$like':'%'+_0x56001b[_0xa5d2('0x2e')][_0xa5d2('0x3a')]+'%'};return _0x15ddf6;})});}_0x162075=_[_0xa5d2('0x38')]({},_0x162075,_0x56001b[_0xa5d2('0x3b')]);return _0x5e3740[_0xa5d2('0x4d')](_0x162075);}})[_0xa5d2('0x25')](function(_0x44d8c0){if(_0x44d8c0){_0x3390e1=_0x44d8c0[_0xa5d2('0x49')];if(!_0x56001b[_0xa5d2('0x2e')][_0xa5d2('0x4a')](_0xa5d2('0x4b'))){_0x162075[_0xa5d2('0x1c')]=qs[_0xa5d2('0x1c')](_0x56001b['query'][_0xa5d2('0x1c')]);_0x162075[_0xa5d2('0x1a')]=qs[_0xa5d2('0x1a')](_0x56001b[_0xa5d2('0x2e')][_0xa5d2('0x1a')]);}return _0x5e3740[_0xa5d2('0x4d')](_0x162075);}})[_0xa5d2('0x25')](function(_0x4c38d4){if(_0x4c38d4){return _0x4c38d4?{'count':_0x3390e1,'rows':_0x4c38d4}:null;}})[_0xa5d2('0x25')](respondWithResult(_0x1f9305,null))[_0xa5d2('0x3e')](handleError(_0x1f9305,null));};exports[_0xa5d2('0x4e')]=function(_0x291a6c,_0x3b20c3,_0x44eba5){var _0x2b7722={};var _0x131a7a={};var _0x43b338;var _0x57447d;return db[_0xa5d2('0x41')][_0xa5d2('0x47')]({'where':{'id':_0x291a6c['params']['id']}})[_0xa5d2('0x25')](handleEntityNotFound(_0x3b20c3,null))['then'](function(_0x4788c4){if(_0x4788c4){_0x43b338=_0x4788c4;_0x131a7a[_0xa5d2('0x2c')]=_[_0xa5d2('0x2f')](db[_0xa5d2('0x4f')][_0xa5d2('0x29')]);_0x131a7a[_0xa5d2('0x2e')]=_[_0xa5d2('0x2f')](_0x291a6c[_0xa5d2('0x2e')]);_0x131a7a[_0xa5d2('0x30')]=_[_0xa5d2('0x31')](_0x131a7a[_0xa5d2('0x2c')],_0x131a7a[_0xa5d2('0x2e')]);_0x2b7722[_0xa5d2('0x33')]=_[_0xa5d2('0x31')](_0x131a7a[_0xa5d2('0x2c')],qs[_0xa5d2('0x32')](_0x291a6c['query'][_0xa5d2('0x32')]));_0x2b7722[_0xa5d2('0x33')]=_0x2b7722['attributes'][_0xa5d2('0x49')]?_0x2b7722[_0xa5d2('0x33')]:_0x131a7a[_0xa5d2('0x2c')];_0x2b7722['order']=qs[_0xa5d2('0x35')](_0x291a6c[_0xa5d2('0x2e')][_0xa5d2('0x35')]);_0x2b7722['where']=qs[_0xa5d2('0x30')](_[_0xa5d2('0x37')](_0x291a6c[_0xa5d2('0x2e')],_0x131a7a[_0xa5d2('0x30')]));if(_0x291a6c[_0xa5d2('0x2e')][_0xa5d2('0x3a')]){_0x2b7722[_0xa5d2('0x36')]=_['merge'](_0x2b7722['where'],{'$or':_[_0xa5d2('0x2d')](_0x2b7722[_0xa5d2('0x33')],function(_0x1b2a88){var _0x122bee={};_0x122bee[_0x1b2a88]={'$like':'%'+_0x291a6c[_0xa5d2('0x2e')][_0xa5d2('0x3a')]+'%'};return _0x122bee;})});}_0x2b7722=_[_0xa5d2('0x38')]({},_0x2b7722,_0x291a6c[_0xa5d2('0x3b')]);return _0x43b338[_0xa5d2('0x4e')](_0x2b7722);}})[_0xa5d2('0x25')](function(_0x22ad73){if(_0x22ad73){_0x57447d=_0x22ad73['length'];if(!_0x291a6c['query'][_0xa5d2('0x4a')](_0xa5d2('0x4b'))){_0x2b7722[_0xa5d2('0x1c')]=qs['limit'](_0x291a6c['query'][_0xa5d2('0x1c')]);_0x2b7722[_0xa5d2('0x1a')]=qs[_0xa5d2('0x1a')](_0x291a6c['query'][_0xa5d2('0x1a')]);}return _0x43b338[_0xa5d2('0x4e')](_0x2b7722);}})[_0xa5d2('0x25')](function(_0x447fce){if(_0x447fce){return _0x447fce?{'count':_0x57447d,'rows':_0x447fce}:null;}})[_0xa5d2('0x25')](respondWithResult(_0x3b20c3,null))[_0xa5d2('0x3e')](handleError(_0x3b20c3,null));};exports[_0xa5d2('0x50')]=function(_0x29ba3d,_0x2954b3,_0x39e714){if(_0x29ba3d[_0xa5d2('0x45')]['id']){delete _0x29ba3d[_0xa5d2('0x45')]['id'];}return db['ZendeskConfiguration'][_0xa5d2('0x47')]({'where':{'id':_0x29ba3d[_0xa5d2('0x40')]['id']}})['then'](handleEntityNotFound(_0x2954b3,null))[_0xa5d2('0x25')](function(_0x2ef247){if(_0x2ef247){return _0x2ef247[_0xa5d2('0x50')](_0x29ba3d[_0xa5d2('0x45')][_0xa5d2('0x51')]||[]);}return null;})[_0xa5d2('0x25')](respondWithResult(_0x2954b3,null))[_0xa5d2('0x3e')](handleError(_0x2954b3,null));}; \ No newline at end of file +var _0xc648=['count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','ZendeskConfiguration','findAll','catch','show','params','keys','includeAll','include','find','update','body','getFields','findOne','ZendeskField','filter','getSubjects','getDescriptions','Tag','getTags','setTags','ids','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','json','offset','undefined','limit'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xc648,0x181));var _0x8c64=function(_0x21660c,_0x1a74dd){_0x21660c=_0x21660c-0x0;var _0x1ded4b=_0xc648[_0x21660c];return _0x1ded4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8c64('0x0'));var rp=require(_0x8c64('0x1'));var moment=require(_0x8c64('0x2'));var BPromise=require(_0x8c64('0x3'));var Mustache=require(_0x8c64('0x4'));var util=require('util');var path=require(_0x8c64('0x5'));var sox=require(_0x8c64('0x6'));var csv=require('to-csv');var ejs=require(_0x8c64('0x7'));var fs=require('fs');var fs_extra=require(_0x8c64('0x8'));var _=require(_0x8c64('0x9'));var squel=require(_0x8c64('0xa'));var crypto=require(_0x8c64('0xb'));var jsforce=require(_0x8c64('0xc'));var deskjs=require(_0x8c64('0xd'));var toCsv=require(_0x8c64('0xe'));var querystring=require(_0x8c64('0xf'));var Papa=require(_0x8c64('0x10'));var Redis=require(_0x8c64('0x11'));var authService=require(_0x8c64('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8c64('0x13'));var hardwareService=require(_0x8c64('0x14'));var logger=require(_0x8c64('0x15'))('api');var utils=require(_0x8c64('0x16'));var config=require(_0x8c64('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x295371,_0x1f30aa){_0x1f30aa=_0x1f30aa||0xcc;return function(_0x561b96){if(_0x561b96){return _0x295371['sendStatus'](_0x1f30aa);}return _0x295371['status'](_0x1f30aa)[_0x8c64('0x18')]();};}function respondWithResult(_0x333e55,_0x1db4cb){_0x1db4cb=_0x1db4cb||0xc8;return function(_0x12bf22){if(_0x12bf22){return _0x333e55[_0x8c64('0x19')](_0x1db4cb)[_0x8c64('0x1a')](_0x12bf22);}};}function respondWithFilteredResult(_0x412b1a,_0x2aad72){return function(_0x5ae8ba){if(_0x5ae8ba){var _0x495e77=typeof _0x2aad72[_0x8c64('0x1b')]===_0x8c64('0x1c')&&typeof _0x2aad72[_0x8c64('0x1d')]===_0x8c64('0x1c');var _0x30c1d0=_0x5ae8ba[_0x8c64('0x1e')];var _0x46abfb=_0x495e77?0x0:_0x2aad72[_0x8c64('0x1b')];var _0x435e47=_0x495e77?_0x5ae8ba[_0x8c64('0x1e')]:_0x2aad72[_0x8c64('0x1b')]+_0x2aad72[_0x8c64('0x1d')];var _0x116db9;if(_0x435e47>=_0x30c1d0){_0x435e47=_0x30c1d0;_0x116db9=0xc8;}else{_0x116db9=0xce;}_0x412b1a[_0x8c64('0x19')](_0x116db9);return _0x412b1a['set'](_0x8c64('0x1f'),_0x46abfb+'-'+_0x435e47+'/'+_0x30c1d0)[_0x8c64('0x1a')](_0x5ae8ba);}return null;};}function patchUpdates(_0xfb38f4){return function(_0x2ac326){try{jsonpatch[_0x8c64('0x20')](_0x2ac326,_0xfb38f4,!![]);}catch(_0x3a78dc){return BPromise[_0x8c64('0x21')](_0x3a78dc);}return _0x2ac326[_0x8c64('0x22')]();};}function saveUpdates(_0x2ee790,_0x211983){return function(_0x55f3e8){if(_0x55f3e8){return _0x55f3e8['update'](_0x2ee790)[_0x8c64('0x23')](function(_0x44b8f9){return _0x44b8f9;});}return null;};}function removeEntity(_0x58658f,_0x163779){return function(_0x165228){if(_0x165228){return _0x165228[_0x8c64('0x24')]()[_0x8c64('0x23')](function(){_0x58658f['status'](0xcc)[_0x8c64('0x18')]();});}};}function handleEntityNotFound(_0x207f68,_0x59866c){return function(_0x328e82){if(!_0x328e82){_0x207f68[_0x8c64('0x25')](0x194);}return _0x328e82;};}function handleError(_0x43e333,_0x3f7a0f){_0x3f7a0f=_0x3f7a0f||0x1f4;return function(_0x227588){logger[_0x8c64('0x26')](_0x227588[_0x8c64('0x27')]);if(_0x227588[_0x8c64('0x28')]){delete _0x227588[_0x8c64('0x28')];}_0x43e333[_0x8c64('0x19')](_0x3f7a0f)[_0x8c64('0x29')](_0x227588);};}exports['index']=function(_0x1d0df9,_0x1316cb){var _0x4248aa={},_0x110d8e={},_0x30589b={'count':0x0,'rows':[]};var _0x6d8d5=_[_0x8c64('0x2a')](db['ZendeskConfiguration'][_0x8c64('0x2b')],function(_0x46c4cd){return{'name':_0x46c4cd[_0x8c64('0x2c')],'type':_0x46c4cd[_0x8c64('0x2d')][_0x8c64('0x2e')]};});_0x110d8e[_0x8c64('0x2f')]=_[_0x8c64('0x2a')](_0x6d8d5,_0x8c64('0x28'));_0x110d8e[_0x8c64('0x30')]=_['keys'](_0x1d0df9[_0x8c64('0x30')]);_0x110d8e[_0x8c64('0x31')]=_['intersection'](_0x110d8e[_0x8c64('0x2f')],_0x110d8e[_0x8c64('0x30')]);_0x4248aa[_0x8c64('0x32')]=_[_0x8c64('0x33')](_0x110d8e[_0x8c64('0x2f')],qs[_0x8c64('0x34')](_0x1d0df9['query']['fields']));_0x4248aa[_0x8c64('0x32')]=_0x4248aa[_0x8c64('0x32')][_0x8c64('0x35')]?_0x4248aa['attributes']:_0x110d8e[_0x8c64('0x2f')];if(!_0x1d0df9[_0x8c64('0x30')][_0x8c64('0x36')](_0x8c64('0x37'))){_0x4248aa['limit']=qs[_0x8c64('0x1d')](_0x1d0df9[_0x8c64('0x30')][_0x8c64('0x1d')]);_0x4248aa[_0x8c64('0x1b')]=qs[_0x8c64('0x1b')](_0x1d0df9[_0x8c64('0x30')][_0x8c64('0x1b')]);}_0x4248aa[_0x8c64('0x38')]=qs[_0x8c64('0x39')](_0x1d0df9[_0x8c64('0x30')][_0x8c64('0x39')]);_0x4248aa[_0x8c64('0x3a')]=qs[_0x8c64('0x31')](_[_0x8c64('0x3b')](_0x1d0df9[_0x8c64('0x30')],_0x110d8e['filters']),_0x6d8d5);if(_0x1d0df9['query']['filter']){_0x4248aa['where']=_[_0x8c64('0x3c')](_0x4248aa[_0x8c64('0x3a')],{'$or':_[_0x8c64('0x2a')](_0x6d8d5,function(_0x81cc8b){if(_0x81cc8b[_0x8c64('0x2d')]!=='VIRTUAL'){var _0x3bcc17={};_0x3bcc17[_0x81cc8b[_0x8c64('0x28')]]={'$like':'%'+_0x1d0df9[_0x8c64('0x30')]['filter']+'%'};return _0x3bcc17;}})});}_0x4248aa=_[_0x8c64('0x3c')]({},_0x4248aa,_0x1d0df9[_0x8c64('0x3d')]);var _0x2d9e3d={'where':_0x4248aa[_0x8c64('0x3a')]};return db[_0x8c64('0x3e')]['count'](_0x2d9e3d)['then'](function(_0x3a03d1){_0x30589b[_0x8c64('0x1e')]=_0x3a03d1;if(_0x1d0df9[_0x8c64('0x30')]['includeAll']){_0x4248aa['include']=[{'all':!![]}];}return db[_0x8c64('0x3e')][_0x8c64('0x3f')](_0x4248aa);})[_0x8c64('0x23')](function(_0x2fe506){_0x30589b['rows']=_0x2fe506;return _0x30589b;})[_0x8c64('0x23')](respondWithFilteredResult(_0x1316cb,_0x4248aa))[_0x8c64('0x40')](handleError(_0x1316cb,null));};exports[_0x8c64('0x41')]=function(_0x7e002c,_0x395280){var _0x1a058f={'raw':![],'where':{'id':_0x7e002c[_0x8c64('0x42')]['id']}},_0x9a069d={};_0x9a069d[_0x8c64('0x2f')]=_[_0x8c64('0x43')](db[_0x8c64('0x3e')]['rawAttributes']);_0x9a069d[_0x8c64('0x30')]=_[_0x8c64('0x43')](_0x7e002c[_0x8c64('0x30')]);_0x9a069d['filters']=_['intersection'](_0x9a069d[_0x8c64('0x2f')],_0x9a069d['query']);_0x1a058f[_0x8c64('0x32')]=_[_0x8c64('0x33')](_0x9a069d[_0x8c64('0x2f')],qs[_0x8c64('0x34')](_0x7e002c['query']['fields']));_0x1a058f[_0x8c64('0x32')]=_0x1a058f[_0x8c64('0x32')]['length']?_0x1a058f[_0x8c64('0x32')]:_0x9a069d[_0x8c64('0x2f')];if(_0x7e002c[_0x8c64('0x30')][_0x8c64('0x44')]){_0x1a058f[_0x8c64('0x45')]=[{'all':!![]}];}_0x1a058f=_[_0x8c64('0x3c')]({},_0x1a058f,_0x7e002c[_0x8c64('0x3d')]);return db[_0x8c64('0x3e')][_0x8c64('0x46')](_0x1a058f)[_0x8c64('0x23')](handleEntityNotFound(_0x395280,null))[_0x8c64('0x23')](respondWithResult(_0x395280,null))[_0x8c64('0x40')](handleError(_0x395280,null));};exports['create']=function(_0x3c88d2,_0x5668ff){return db[_0x8c64('0x3e')]['create'](_0x3c88d2['body'],{})[_0x8c64('0x23')](respondWithResult(_0x5668ff,0xc9))[_0x8c64('0x40')](handleError(_0x5668ff,null));};exports[_0x8c64('0x47')]=function(_0x3a3e5b,_0x12a7ad){if(_0x3a3e5b[_0x8c64('0x48')]['id']){delete _0x3a3e5b[_0x8c64('0x48')]['id'];}return db[_0x8c64('0x3e')][_0x8c64('0x46')]({'where':{'id':_0x3a3e5b[_0x8c64('0x42')]['id']}})[_0x8c64('0x23')](handleEntityNotFound(_0x12a7ad,null))[_0x8c64('0x23')](saveUpdates(_0x3a3e5b[_0x8c64('0x48')],null))[_0x8c64('0x23')](respondWithResult(_0x12a7ad,null))[_0x8c64('0x40')](handleError(_0x12a7ad,null));};exports[_0x8c64('0x24')]=function(_0xd474c7,_0x26bc1f){return db[_0x8c64('0x3e')][_0x8c64('0x46')]({'where':{'id':_0xd474c7[_0x8c64('0x42')]['id']}})['then'](handleEntityNotFound(_0x26bc1f,null))[_0x8c64('0x23')](removeEntity(_0x26bc1f,null))['catch'](handleError(_0x26bc1f,null));};exports[_0x8c64('0x49')]=function(_0x3c954b,_0x33f1eb,_0x32ec79){var _0x4148f4={};var _0x182853={};var _0x413b67;var _0x5694f6;return db[_0x8c64('0x3e')][_0x8c64('0x4a')]({'where':{'id':_0x3c954b[_0x8c64('0x42')]['id']}})[_0x8c64('0x23')](handleEntityNotFound(_0x33f1eb,null))[_0x8c64('0x23')](function(_0x581113){if(_0x581113){_0x413b67=_0x581113;_0x182853['model']=_[_0x8c64('0x43')](db[_0x8c64('0x4b')][_0x8c64('0x2b')]);_0x182853['query']=_[_0x8c64('0x43')](_0x3c954b[_0x8c64('0x30')]);_0x182853[_0x8c64('0x31')]=_[_0x8c64('0x33')](_0x182853[_0x8c64('0x2f')],_0x182853[_0x8c64('0x30')]);_0x4148f4['attributes']=_['intersection'](_0x182853['model'],qs[_0x8c64('0x34')](_0x3c954b['query']['fields']));_0x4148f4[_0x8c64('0x32')]=_0x4148f4['attributes']['length']?_0x4148f4[_0x8c64('0x32')]:_0x182853[_0x8c64('0x2f')];_0x4148f4[_0x8c64('0x38')]=qs[_0x8c64('0x39')](_0x3c954b['query'][_0x8c64('0x39')]);_0x4148f4[_0x8c64('0x3a')]=qs[_0x8c64('0x31')](_[_0x8c64('0x3b')](_0x3c954b['query'],_0x182853[_0x8c64('0x31')]));if(_0x3c954b['query'][_0x8c64('0x4c')]){_0x4148f4[_0x8c64('0x3a')]=_[_0x8c64('0x3c')](_0x4148f4[_0x8c64('0x3a')],{'$or':_['map'](_0x4148f4[_0x8c64('0x32')],function(_0xfccee8){var _0x844ee={};_0x844ee[_0xfccee8]={'$like':'%'+_0x3c954b['query'][_0x8c64('0x4c')]+'%'};return _0x844ee;})});}_0x4148f4=_[_0x8c64('0x3c')]({},_0x4148f4,_0x3c954b[_0x8c64('0x3d')]);return _0x413b67['getFields'](_0x4148f4);}})[_0x8c64('0x23')](function(_0x59f8d6){if(_0x59f8d6){_0x5694f6=_0x59f8d6[_0x8c64('0x35')];if(!_0x3c954b['query'][_0x8c64('0x36')](_0x8c64('0x37'))){_0x4148f4[_0x8c64('0x1d')]=qs[_0x8c64('0x1d')](_0x3c954b[_0x8c64('0x30')]['limit']);_0x4148f4[_0x8c64('0x1b')]=qs['offset'](_0x3c954b['query'][_0x8c64('0x1b')]);}return _0x413b67[_0x8c64('0x49')](_0x4148f4);}})[_0x8c64('0x23')](function(_0x29dea6){if(_0x29dea6){return _0x29dea6?{'count':_0x5694f6,'rows':_0x29dea6}:null;}})[_0x8c64('0x23')](respondWithResult(_0x33f1eb,null))[_0x8c64('0x40')](handleError(_0x33f1eb,null));};exports[_0x8c64('0x4d')]=function(_0x33f29e,_0x425ccf,_0x2d59c2){var _0x55f585={};var _0x4308da={};var _0x4847d5;var _0x3df9a5;return db[_0x8c64('0x3e')]['findOne']({'where':{'id':_0x33f29e['params']['id']}})[_0x8c64('0x23')](handleEntityNotFound(_0x425ccf,null))['then'](function(_0xb5f0f2){if(_0xb5f0f2){_0x4847d5=_0xb5f0f2;_0x4308da[_0x8c64('0x2f')]=_[_0x8c64('0x43')](db[_0x8c64('0x4b')][_0x8c64('0x2b')]);_0x4308da[_0x8c64('0x30')]=_[_0x8c64('0x43')](_0x33f29e[_0x8c64('0x30')]);_0x4308da[_0x8c64('0x31')]=_[_0x8c64('0x33')](_0x4308da['model'],_0x4308da[_0x8c64('0x30')]);_0x55f585[_0x8c64('0x32')]=_[_0x8c64('0x33')](_0x4308da[_0x8c64('0x2f')],qs[_0x8c64('0x34')](_0x33f29e[_0x8c64('0x30')][_0x8c64('0x34')]));_0x55f585[_0x8c64('0x32')]=_0x55f585[_0x8c64('0x32')][_0x8c64('0x35')]?_0x55f585[_0x8c64('0x32')]:_0x4308da['model'];_0x55f585[_0x8c64('0x38')]=qs[_0x8c64('0x39')](_0x33f29e[_0x8c64('0x30')][_0x8c64('0x39')]);_0x55f585[_0x8c64('0x3a')]=qs[_0x8c64('0x31')](_[_0x8c64('0x3b')](_0x33f29e[_0x8c64('0x30')],_0x4308da[_0x8c64('0x31')]));if(_0x33f29e['query'][_0x8c64('0x4c')]){_0x55f585[_0x8c64('0x3a')]=_[_0x8c64('0x3c')](_0x55f585[_0x8c64('0x3a')],{'$or':_[_0x8c64('0x2a')](_0x55f585[_0x8c64('0x32')],function(_0x31abe7){var _0x2ee4b9={};_0x2ee4b9[_0x31abe7]={'$like':'%'+_0x33f29e[_0x8c64('0x30')][_0x8c64('0x4c')]+'%'};return _0x2ee4b9;})});}_0x55f585=_['merge']({},_0x55f585,_0x33f29e['options']);return _0x4847d5[_0x8c64('0x4d')](_0x55f585);}})[_0x8c64('0x23')](function(_0x16e5a0){if(_0x16e5a0){_0x3df9a5=_0x16e5a0[_0x8c64('0x35')];if(!_0x33f29e['query'][_0x8c64('0x36')]('nolimit')){_0x55f585[_0x8c64('0x1d')]=qs['limit'](_0x33f29e[_0x8c64('0x30')][_0x8c64('0x1d')]);_0x55f585[_0x8c64('0x1b')]=qs[_0x8c64('0x1b')](_0x33f29e[_0x8c64('0x30')][_0x8c64('0x1b')]);}return _0x4847d5['getSubjects'](_0x55f585);}})[_0x8c64('0x23')](function(_0x458bae){if(_0x458bae){return _0x458bae?{'count':_0x3df9a5,'rows':_0x458bae}:null;}})['then'](respondWithResult(_0x425ccf,null))[_0x8c64('0x40')](handleError(_0x425ccf,null));};exports[_0x8c64('0x4e')]=function(_0x90787a,_0x20a3e7,_0x89d397){var _0x4f19c3={};var _0x1a50e9={};var _0x293538;var _0x4fef16;return db[_0x8c64('0x3e')][_0x8c64('0x4a')]({'where':{'id':_0x90787a[_0x8c64('0x42')]['id']}})[_0x8c64('0x23')](handleEntityNotFound(_0x20a3e7,null))[_0x8c64('0x23')](function(_0x1f61bb){if(_0x1f61bb){_0x293538=_0x1f61bb;_0x1a50e9[_0x8c64('0x2f')]=_['keys'](db[_0x8c64('0x4b')][_0x8c64('0x2b')]);_0x1a50e9['query']=_['keys'](_0x90787a[_0x8c64('0x30')]);_0x1a50e9[_0x8c64('0x31')]=_[_0x8c64('0x33')](_0x1a50e9[_0x8c64('0x2f')],_0x1a50e9[_0x8c64('0x30')]);_0x4f19c3[_0x8c64('0x32')]=_[_0x8c64('0x33')](_0x1a50e9[_0x8c64('0x2f')],qs[_0x8c64('0x34')](_0x90787a['query'][_0x8c64('0x34')]));_0x4f19c3[_0x8c64('0x32')]=_0x4f19c3[_0x8c64('0x32')]['length']?_0x4f19c3[_0x8c64('0x32')]:_0x1a50e9[_0x8c64('0x2f')];_0x4f19c3['order']=qs[_0x8c64('0x39')](_0x90787a[_0x8c64('0x30')][_0x8c64('0x39')]);_0x4f19c3[_0x8c64('0x3a')]=qs[_0x8c64('0x31')](_['pick'](_0x90787a['query'],_0x1a50e9[_0x8c64('0x31')]));if(_0x90787a[_0x8c64('0x30')][_0x8c64('0x4c')]){_0x4f19c3[_0x8c64('0x3a')]=_['merge'](_0x4f19c3[_0x8c64('0x3a')],{'$or':_[_0x8c64('0x2a')](_0x4f19c3['attributes'],function(_0xa8547a){var _0x4faee0={};_0x4faee0[_0xa8547a]={'$like':'%'+_0x90787a['query'][_0x8c64('0x4c')]+'%'};return _0x4faee0;})});}_0x4f19c3=_[_0x8c64('0x3c')]({},_0x4f19c3,_0x90787a[_0x8c64('0x3d')]);return _0x293538[_0x8c64('0x4e')](_0x4f19c3);}})[_0x8c64('0x23')](function(_0x5f3796){if(_0x5f3796){_0x4fef16=_0x5f3796[_0x8c64('0x35')];if(!_0x90787a[_0x8c64('0x30')][_0x8c64('0x36')](_0x8c64('0x37'))){_0x4f19c3[_0x8c64('0x1d')]=qs[_0x8c64('0x1d')](_0x90787a[_0x8c64('0x30')][_0x8c64('0x1d')]);_0x4f19c3[_0x8c64('0x1b')]=qs[_0x8c64('0x1b')](_0x90787a[_0x8c64('0x30')][_0x8c64('0x1b')]);}return _0x293538[_0x8c64('0x4e')](_0x4f19c3);}})[_0x8c64('0x23')](function(_0x4596a3){if(_0x4596a3){return _0x4596a3?{'count':_0x4fef16,'rows':_0x4596a3}:null;}})[_0x8c64('0x23')](respondWithResult(_0x20a3e7,null))['catch'](handleError(_0x20a3e7,null));};exports['getTags']=function(_0x286f1e,_0x49b393,_0x597f69){var _0x2d94cd={};var _0x102f7b={};var _0x508947;var _0x54e705;return db[_0x8c64('0x3e')]['findOne']({'where':{'id':_0x286f1e[_0x8c64('0x42')]['id']}})['then'](handleEntityNotFound(_0x49b393,null))['then'](function(_0x35bc8e){if(_0x35bc8e){_0x508947=_0x35bc8e;_0x102f7b['model']=_['keys'](db[_0x8c64('0x4f')]['rawAttributes']);_0x102f7b[_0x8c64('0x30')]=_[_0x8c64('0x43')](_0x286f1e[_0x8c64('0x30')]);_0x102f7b['filters']=_[_0x8c64('0x33')](_0x102f7b[_0x8c64('0x2f')],_0x102f7b[_0x8c64('0x30')]);_0x2d94cd[_0x8c64('0x32')]=_[_0x8c64('0x33')](_0x102f7b[_0x8c64('0x2f')],qs['fields'](_0x286f1e['query'][_0x8c64('0x34')]));_0x2d94cd[_0x8c64('0x32')]=_0x2d94cd[_0x8c64('0x32')][_0x8c64('0x35')]?_0x2d94cd['attributes']:_0x102f7b[_0x8c64('0x2f')];_0x2d94cd['order']=qs['sort'](_0x286f1e[_0x8c64('0x30')][_0x8c64('0x39')]);_0x2d94cd[_0x8c64('0x3a')]=qs[_0x8c64('0x31')](_[_0x8c64('0x3b')](_0x286f1e['query'],_0x102f7b[_0x8c64('0x31')]));if(_0x286f1e[_0x8c64('0x30')][_0x8c64('0x4c')]){_0x2d94cd[_0x8c64('0x3a')]=_[_0x8c64('0x3c')](_0x2d94cd['where'],{'$or':_['map'](_0x2d94cd['attributes'],function(_0x8e3f4e){var _0x31f273={};_0x31f273[_0x8e3f4e]={'$like':'%'+_0x286f1e[_0x8c64('0x30')][_0x8c64('0x4c')]+'%'};return _0x31f273;})});}_0x2d94cd=_[_0x8c64('0x3c')]({},_0x2d94cd,_0x286f1e[_0x8c64('0x3d')]);return _0x508947[_0x8c64('0x50')](_0x2d94cd);}})[_0x8c64('0x23')](function(_0x5009a0){if(_0x5009a0){_0x54e705=_0x5009a0[_0x8c64('0x35')];if(!_0x286f1e[_0x8c64('0x30')][_0x8c64('0x36')](_0x8c64('0x37'))){_0x2d94cd[_0x8c64('0x1d')]=qs['limit'](_0x286f1e[_0x8c64('0x30')]['limit']);_0x2d94cd[_0x8c64('0x1b')]=qs[_0x8c64('0x1b')](_0x286f1e[_0x8c64('0x30')][_0x8c64('0x1b')]);}return _0x508947[_0x8c64('0x50')](_0x2d94cd);}})['then'](function(_0x868705){if(_0x868705){return _0x868705?{'count':_0x54e705,'rows':_0x868705}:null;}})[_0x8c64('0x23')](respondWithResult(_0x49b393,null))[_0x8c64('0x40')](handleError(_0x49b393,null));};exports[_0x8c64('0x51')]=function(_0x2b8ce9,_0x1a23e6,_0xabe328){if(_0x2b8ce9[_0x8c64('0x48')]['id']){delete _0x2b8ce9[_0x8c64('0x48')]['id'];}return db[_0x8c64('0x3e')][_0x8c64('0x4a')]({'where':{'id':_0x2b8ce9[_0x8c64('0x42')]['id']}})[_0x8c64('0x23')](handleEntityNotFound(_0x1a23e6,null))[_0x8c64('0x23')](function(_0x54a32d){if(_0x54a32d){return _0x54a32d[_0x8c64('0x51')](_0x2b8ce9[_0x8c64('0x48')][_0x8c64('0x52')]||[]);}return null;})[_0x8c64('0x23')](respondWithResult(_0x1a23e6,null))[_0x8c64('0x40')](handleError(_0x1a23e6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 43cc0ec..d437566 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 _0xb688=['exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x266495,_0x3dcf5d){var _0x3200b9=function(_0x5a3f86){while(--_0x5a3f86){_0x266495['push'](_0x266495['shift']());}};_0x3200b9(++_0x3dcf5d);}(_0xb688,0xcf));var _0x8b68=function(_0x26f9a1,_0x1ddb10){_0x26f9a1=_0x26f9a1-0x0;var _0x58e9cb=_0xb688[_0x26f9a1];return _0x58e9cb;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0x4fc2,0x111));var _0x24fc=function(_0x1ae1ae,_0xc793fb){_0x1ae1ae=_0x1ae1ae-0x0;var _0x2da926=_0x4fc2[_0x1ae1ae];return _0x2da926;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index c3c8bb5..0a26c06 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 _0x5689=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x5689,0x168));var _0x9568=function(_0x55c70f,_0x356d94){_0x55c70f=_0x55c70f-0x0;var _0x5b0442=_0x5689[_0x55c70f];return _0x5b0442;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9568('0x0'));var BPromise=require(_0x9568('0x1'));var rs=require(_0x9568('0x2'));var fs=require('fs');var Redis=require(_0x9568('0x3'));var db=require(_0x9568('0x4'))['db'];var utils=require(_0x9568('0x5'));var logger=require(_0x9568('0x6'))('rpc');var config=require(_0x9568('0x7'));var jayson=require(_0x9568('0x8'));var client=jayson[_0x9568('0x9')][_0x9568('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a56f4,_0x3c39d0,_0x2514d0){return new BPromise(function(_0x5d92b2,_0x51735f){return client[_0x9568('0xb')](_0x1a56f4,_0x2514d0)['then'](function(_0x5774e2){logger['info'](_0x9568('0xc'),_0x3c39d0,_0x9568('0xd'));logger[_0x9568('0xe')](_0x9568('0xf'),_0x3c39d0,'request\x20sent',JSON[_0x9568('0x10')](_0x5774e2));if(_0x5774e2[_0x9568('0x11')]){if(_0x5774e2['error']['code']===0x1f4){logger['error'](_0x9568('0xc'),_0x3c39d0,_0x5774e2[_0x9568('0x11')][_0x9568('0x12')]);return _0x51735f(_0x5774e2[_0x9568('0x11')][_0x9568('0x12')]);}logger['error'](_0x9568('0xc'),_0x3c39d0,_0x5774e2['error'][_0x9568('0x12')]);return _0x5d92b2(_0x5774e2[_0x9568('0x11')][_0x9568('0x12')]);}else{logger[_0x9568('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3c39d0,'request\x20sent');_0x5d92b2(_0x5774e2[_0x9568('0x14')][_0x9568('0x12')]);}})[_0x9568('0x15')](function(_0x2682e8){logger[_0x9568('0x11')](_0x9568('0xc'),_0x3c39d0,_0x2682e8);_0x51735f(_0x2682e8);});});} \ No newline at end of file +var _0xe8f7=['request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client'];(function(_0x4244a3,_0x1d920e){var _0x24f692=function(_0x492fea){while(--_0x492fea){_0x4244a3['push'](_0x4244a3['shift']());}};_0x24f692(++_0x1d920e);}(_0xe8f7,0x184));var _0x7e8f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe8f7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7e8f('0x0'));var moment=require(_0x7e8f('0x1'));var BPromise=require(_0x7e8f('0x2'));var rs=require(_0x7e8f('0x3'));var fs=require('fs');var Redis=require(_0x7e8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e8f('0x5'));var config=require('../../config/environment');var jayson=require(_0x7e8f('0x6'));var client=jayson[_0x7e8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a4123,_0x5d70ac,_0xdf079){return new BPromise(function(_0x586eb1,_0x2c601f){return client[_0x7e8f('0x8')](_0x4a4123,_0xdf079)[_0x7e8f('0x9')](function(_0x5560e4){logger['info'](_0x7e8f('0xa'),_0x5d70ac,_0x7e8f('0xb'));logger[_0x7e8f('0xc')](_0x7e8f('0xd'),_0x5d70ac,_0x7e8f('0xb'),JSON['stringify'](_0x5560e4));if(_0x5560e4[_0x7e8f('0xe')]){if(_0x5560e4[_0x7e8f('0xe')][_0x7e8f('0xf')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5d70ac,_0x5560e4[_0x7e8f('0xe')][_0x7e8f('0x10')]);return _0x2c601f(_0x5560e4[_0x7e8f('0xe')][_0x7e8f('0x10')]);}logger[_0x7e8f('0xe')](_0x7e8f('0xa'),_0x5d70ac,_0x5560e4['error'][_0x7e8f('0x10')]);return _0x586eb1(_0x5560e4[_0x7e8f('0xe')][_0x7e8f('0x10')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5d70ac,'request\x20sent');_0x586eb1(_0x5560e4[_0x7e8f('0x11')][_0x7e8f('0x10')]);}})['catch'](function(_0x3f5e8c){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5d70ac,_0x3f5e8c);_0x2c601f(_0x3f5e8c);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 951ee56..4b0127c 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 _0x0509=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','create','put','update','/:id','destroy','exports','path'];(function(_0x59f97a,_0x511696){var _0x411b33=function(_0x4f801e){while(--_0x4f801e){_0x59f97a['push'](_0x59f97a['shift']());}};_0x411b33(++_0x511696);}(_0x0509,0xfe));var _0x9050=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x0509[_0x19b84f];return _0x18067b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9050('0x0'));var timeout=require(_0x9050('0x1'));var express=require('express');var router=express[_0x9050('0x2')]();var fs_extra=require(_0x9050('0x3'));var auth=require(_0x9050('0x4'));var interaction=require(_0x9050('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0x9050('0x6')]('/',auth[_0x9050('0x7')](),controller[_0x9050('0x8')]);router[_0x9050('0x6')]('/:id',auth[_0x9050('0x7')](),controller['show']);router['post']('/',auth[_0x9050('0x7')](),controller[_0x9050('0x9')]);router[_0x9050('0xa')]('/:id',auth[_0x9050('0x7')](),controller[_0x9050('0xb')]);router['delete'](_0x9050('0xc'),auth[_0x9050('0x7')](),controller[_0x9050('0xd')]);module[_0x9050('0xe')]=router; \ No newline at end of file +var _0x640a=['./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x640a,0x11a));var _0xa640=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x640a[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xa640('0x0'));var path=require('path');var timeout=require(_0xa640('0x1'));var express=require(_0xa640('0x2'));var router=express[_0xa640('0x3')]();var fs_extra=require(_0xa640('0x4'));var auth=require(_0xa640('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa640('0x6'));var controller=require(_0xa640('0x7'));router[_0xa640('0x8')]('/',auth[_0xa640('0x9')](),controller['index']);router[_0xa640('0x8')](_0xa640('0xa'),auth[_0xa640('0x9')](),controller[_0xa640('0xb')]);router[_0xa640('0xc')]('/',auth[_0xa640('0x9')](),controller[_0xa640('0xd')]);router['put'](_0xa640('0xa'),auth[_0xa640('0x9')](),controller[_0xa640('0xe')]);router['delete'](_0xa640('0xa'),auth[_0xa640('0x9')](),controller[_0xa640('0xf')]);module[_0xa640('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2078cff..2043e93 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 _0xef34=['variable','customVariable','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x1744f6,_0x6a7eb0){var _0x1d51ef=function(_0x2c8da9){while(--_0x2c8da9){_0x1744f6['push'](_0x1744f6['shift']());}};_0x1d51ef(++_0x6a7eb0);}(_0xef34,0x1e3));var _0x4ef3=function(_0xdefb4,_0x5e0588){_0xdefb4=_0xdefb4-0x0;var _0x5c8148=_0xef34[_0xdefb4];return _0x5c8148;};'use strict';var Sequelize=require(_0x4ef3('0x0'));module[_0x4ef3('0x1')]={'type':{'type':Sequelize[_0x4ef3('0x2')]('string',_0x4ef3('0x3'),_0x4ef3('0x4'),'keyValue',_0x4ef3('0x5')),'defaultValue':_0x4ef3('0x6')},'content':{'type':Sequelize[_0x4ef3('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4ef3('0x2')](_0x4ef3('0x6'),'variable',_0x4ef3('0x4'))},'keyContent':{'type':Sequelize[_0x4ef3('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4ef3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4ef3('0x7')]}}; \ No newline at end of file +var _0x0faf=['keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string','variable'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0x0faf,0x112));var _0xf0fa=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0x0faf[_0x19aa84];return _0x536146;};'use strict';var Sequelize=require(_0xf0fa('0x0'));module[_0xf0fa('0x1')]={'type':{'type':Sequelize[_0xf0fa('0x2')](_0xf0fa('0x3'),_0xf0fa('0x4'),'customVariable',_0xf0fa('0x5'),_0xf0fa('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf0fa('0x7')]},'keyType':{'type':Sequelize[_0xf0fa('0x2')](_0xf0fa('0x3'),'variable',_0xf0fa('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf0fa('0x7')]},'nameField':{'type':Sequelize[_0xf0fa('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf0fa('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 85eb9ad..c34d3c4 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 _0x8192=['offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','ZendeskField','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8192,0x82));var _0x2819=function(_0x460c31,_0x4a580f){_0x460c31=_0x460c31-0x0;var _0x5c0460=_0x8192[_0x460c31];return _0x5c0460;};'use strict';var emlformat=require(_0x2819('0x0'));var rimraf=require(_0x2819('0x1'));var zipdir=require(_0x2819('0x2'));var jsonpatch=require(_0x2819('0x3'));var rp=require(_0x2819('0x4'));var moment=require('moment');var BPromise=require(_0x2819('0x5'));var Mustache=require(_0x2819('0x6'));var util=require(_0x2819('0x7'));var path=require(_0x2819('0x8'));var sox=require(_0x2819('0x9'));var csv=require(_0x2819('0xa'));var ejs=require(_0x2819('0xb'));var fs=require('fs');var fs_extra=require(_0x2819('0xc'));var _=require('lodash');var squel=require(_0x2819('0xd'));var crypto=require(_0x2819('0xe'));var jsforce=require(_0x2819('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2819('0x10'));var Papa=require(_0x2819('0x11'));var Redis=require(_0x2819('0x12'));var authService=require(_0x2819('0x13'));var qs=require(_0x2819('0x14'));var as=require(_0x2819('0x15'));var hardwareService=require(_0x2819('0x16'));var logger=require(_0x2819('0x17'))(_0x2819('0x18'));var utils=require(_0x2819('0x19'));var config=require(_0x2819('0x1a'));var licenseUtil=require(_0x2819('0x1b'));var db=require(_0x2819('0x1c'))['db'];function respondWithStatusCode(_0x3bc184,_0x25e2a4){_0x25e2a4=_0x25e2a4||0xcc;return function(_0x20d003){if(_0x20d003){return _0x3bc184['sendStatus'](_0x25e2a4);}return _0x3bc184[_0x2819('0x1d')](_0x25e2a4)[_0x2819('0x1e')]();};}function respondWithResult(_0x11732f,_0x17eff7){_0x17eff7=_0x17eff7||0xc8;return function(_0x4838f3){if(_0x4838f3){return _0x11732f[_0x2819('0x1d')](_0x17eff7)[_0x2819('0x1f')](_0x4838f3);}};}function respondWithFilteredResult(_0x2ab9e7,_0x587efd){return function(_0x2927b3){if(_0x2927b3){var _0x503f2d=typeof _0x587efd[_0x2819('0x20')]===_0x2819('0x21')&&typeof _0x587efd[_0x2819('0x22')]===_0x2819('0x21');var _0x53629c=_0x2927b3[_0x2819('0x23')];var _0x2673d3=_0x503f2d?0x0:_0x587efd[_0x2819('0x20')];var _0x3e55b2=_0x503f2d?_0x2927b3[_0x2819('0x23')]:_0x587efd[_0x2819('0x20')]+_0x587efd[_0x2819('0x22')];var _0x29503d;if(_0x3e55b2>=_0x53629c){_0x3e55b2=_0x53629c;_0x29503d=0xc8;}else{_0x29503d=0xce;}_0x2ab9e7[_0x2819('0x1d')](_0x29503d);return _0x2ab9e7[_0x2819('0x24')](_0x2819('0x25'),_0x2673d3+'-'+_0x3e55b2+'/'+_0x53629c)[_0x2819('0x1f')](_0x2927b3);}return null;};}function patchUpdates(_0x5b94fc){return function(_0x21e3c0){try{jsonpatch[_0x2819('0x26')](_0x21e3c0,_0x5b94fc,!![]);}catch(_0x30d78d){return BPromise[_0x2819('0x27')](_0x30d78d);}return _0x21e3c0['save']();};}function saveUpdates(_0x446d80,_0x4b998e){return function(_0x1b7acb){if(_0x1b7acb){return _0x1b7acb[_0x2819('0x28')](_0x446d80)[_0x2819('0x29')](function(_0x44e36d){return _0x44e36d;});}return null;};}function removeEntity(_0x163a6a,_0x387e6b){return function(_0x475178){if(_0x475178){return _0x475178['destroy']()['then'](function(){_0x163a6a[_0x2819('0x1d')](0xcc)[_0x2819('0x1e')]();});}};}function handleEntityNotFound(_0x2211d7,_0x242f8e){return function(_0x415695){if(!_0x415695){_0x2211d7['sendStatus'](0x194);}return _0x415695;};}function handleError(_0x1be98c,_0x373f17){_0x373f17=_0x373f17||0x1f4;return function(_0x66de54){logger[_0x2819('0x2a')](_0x66de54[_0x2819('0x2b')]);if(_0x66de54['name']){delete _0x66de54[_0x2819('0x2c')];}_0x1be98c['status'](_0x373f17)[_0x2819('0x2d')](_0x66de54);};}exports[_0x2819('0x2e')]=function(_0x5a6c84,_0x4df929){var _0xc051cb={},_0x54bb97={},_0x492841={'count':0x0,'rows':[]};var _0x5f1f14=_['map'](db[_0x2819('0x2f')]['rawAttributes'],function(_0x33c1d9){return{'name':_0x33c1d9[_0x2819('0x30')],'type':_0x33c1d9[_0x2819('0x31')][_0x2819('0x32')]};});_0x54bb97[_0x2819('0x33')]=_['map'](_0x5f1f14,'name');_0x54bb97['query']=_[_0x2819('0x34')](_0x5a6c84[_0x2819('0x35')]);_0x54bb97[_0x2819('0x36')]=_[_0x2819('0x37')](_0x54bb97[_0x2819('0x33')],_0x54bb97[_0x2819('0x35')]);_0xc051cb['attributes']=_[_0x2819('0x37')](_0x54bb97[_0x2819('0x33')],qs[_0x2819('0x38')](_0x5a6c84[_0x2819('0x35')]['fields']));_0xc051cb[_0x2819('0x39')]=_0xc051cb[_0x2819('0x39')][_0x2819('0x3a')]?_0xc051cb[_0x2819('0x39')]:_0x54bb97[_0x2819('0x33')];if(!_0x5a6c84[_0x2819('0x35')][_0x2819('0x3b')](_0x2819('0x3c'))){_0xc051cb['limit']=qs[_0x2819('0x22')](_0x5a6c84[_0x2819('0x35')][_0x2819('0x22')]);_0xc051cb['offset']=qs[_0x2819('0x20')](_0x5a6c84[_0x2819('0x35')][_0x2819('0x20')]);}_0xc051cb[_0x2819('0x3d')]=qs[_0x2819('0x3e')](_0x5a6c84[_0x2819('0x35')][_0x2819('0x3e')]);_0xc051cb['where']=qs[_0x2819('0x36')](_[_0x2819('0x3f')](_0x5a6c84['query'],_0x54bb97[_0x2819('0x36')]),_0x5f1f14);if(_0x5a6c84[_0x2819('0x35')][_0x2819('0x40')]){_0xc051cb[_0x2819('0x41')]=_[_0x2819('0x42')](_0xc051cb[_0x2819('0x41')],{'$or':_[_0x2819('0x43')](_0x5f1f14,function(_0x5606dc){if(_0x5606dc[_0x2819('0x31')]!==_0x2819('0x44')){var _0x577762={};_0x577762[_0x5606dc[_0x2819('0x2c')]]={'$like':'%'+_0x5a6c84['query'][_0x2819('0x40')]+'%'};return _0x577762;}})});}_0xc051cb=_[_0x2819('0x42')]({},_0xc051cb,_0x5a6c84[_0x2819('0x45')]);var _0x1f8e86={'where':_0xc051cb[_0x2819('0x41')]};return db['ZendeskField']['count'](_0x1f8e86)[_0x2819('0x29')](function(_0x20590b){_0x492841[_0x2819('0x23')]=_0x20590b;if(_0x5a6c84['query'][_0x2819('0x46')]){_0xc051cb[_0x2819('0x47')]=[{'all':!![]}];}return db[_0x2819('0x2f')][_0x2819('0x48')](_0xc051cb);})['then'](function(_0x160e7e){_0x492841[_0x2819('0x49')]=_0x160e7e;return _0x492841;})[_0x2819('0x29')](respondWithFilteredResult(_0x4df929,_0xc051cb))[_0x2819('0x4a')](handleError(_0x4df929,null));};exports[_0x2819('0x4b')]=function(_0x25a3aa,_0x1436fd){var _0x3b70e9={'raw':!![],'where':{'id':_0x25a3aa[_0x2819('0x4c')]['id']}},_0x3a9f2a={};_0x3a9f2a[_0x2819('0x33')]=_['keys'](db['ZendeskField']['rawAttributes']);_0x3a9f2a[_0x2819('0x35')]=_[_0x2819('0x34')](_0x25a3aa[_0x2819('0x35')]);_0x3a9f2a[_0x2819('0x36')]=_[_0x2819('0x37')](_0x3a9f2a['model'],_0x3a9f2a['query']);_0x3b70e9[_0x2819('0x39')]=_[_0x2819('0x37')](_0x3a9f2a['model'],qs[_0x2819('0x38')](_0x25a3aa[_0x2819('0x35')][_0x2819('0x38')]));_0x3b70e9[_0x2819('0x39')]=_0x3b70e9[_0x2819('0x39')][_0x2819('0x3a')]?_0x3b70e9[_0x2819('0x39')]:_0x3a9f2a[_0x2819('0x33')];if(_0x25a3aa[_0x2819('0x35')][_0x2819('0x46')]){_0x3b70e9[_0x2819('0x47')]=[{'all':!![]}];}_0x3b70e9=_[_0x2819('0x42')]({},_0x3b70e9,_0x25a3aa[_0x2819('0x45')]);return db['ZendeskField'][_0x2819('0x4d')](_0x3b70e9)[_0x2819('0x29')](handleEntityNotFound(_0x1436fd,null))[_0x2819('0x29')](respondWithResult(_0x1436fd,null))[_0x2819('0x4a')](handleError(_0x1436fd,null));};exports[_0x2819('0x4e')]=function(_0x37b987,_0x16a27a){return db[_0x2819('0x2f')][_0x2819('0x4e')](_0x37b987['body'],{})[_0x2819('0x29')](respondWithResult(_0x16a27a,0xc9))[_0x2819('0x4a')](handleError(_0x16a27a,null));};exports['update']=function(_0x558dec,_0x1a743d){if(_0x558dec[_0x2819('0x4f')]['id']){delete _0x558dec[_0x2819('0x4f')]['id'];}return db[_0x2819('0x2f')]['find']({'where':{'id':_0x558dec[_0x2819('0x4c')]['id']}})[_0x2819('0x29')](handleEntityNotFound(_0x1a743d,null))['then'](saveUpdates(_0x558dec['body'],null))[_0x2819('0x29')](respondWithResult(_0x1a743d,null))['catch'](handleError(_0x1a743d,null));};exports[_0x2819('0x50')]=function(_0x1721da,_0x3bb153){return db[_0x2819('0x2f')][_0x2819('0x4d')]({'where':{'id':_0x1721da['params']['id']}})[_0x2819('0x29')](handleEntityNotFound(_0x3bb153,null))[_0x2819('0x29')](removeEntity(_0x3bb153,null))['catch'](handleError(_0x3bb153,null));}; \ No newline at end of file +var _0xc8fc=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x372e48,_0x1caa0b){var _0x405be0=function(_0x53d7d9){while(--_0x53d7d9){_0x372e48['push'](_0x372e48['shift']());}};_0x405be0(++_0x1caa0b);}(_0xc8fc,0x78));var _0xcc8f=function(_0x370e20,_0x4b15bb){_0x370e20=_0x370e20-0x0;var _0xcc30ab=_0xc8fc[_0x370e20];return _0xcc30ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc8f('0x0'));var zipdir=require(_0xcc8f('0x1'));var jsonpatch=require(_0xcc8f('0x2'));var rp=require('request-promise');var moment=require(_0xcc8f('0x3'));var BPromise=require(_0xcc8f('0x4'));var Mustache=require(_0xcc8f('0x5'));var util=require('util');var path=require(_0xcc8f('0x6'));var sox=require(_0xcc8f('0x7'));var csv=require(_0xcc8f('0x8'));var ejs=require(_0xcc8f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc8f('0xa'));var squel=require(_0xcc8f('0xb'));var crypto=require(_0xcc8f('0xc'));var jsforce=require(_0xcc8f('0xd'));var deskjs=require(_0xcc8f('0xe'));var toCsv=require(_0xcc8f('0x8'));var querystring=require('querystring');var Papa=require(_0xcc8f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcc8f('0x10'));var as=require(_0xcc8f('0x11'));var hardwareService=require(_0xcc8f('0x12'));var logger=require('../../config/logger')(_0xcc8f('0x13'));var utils=require(_0xcc8f('0x14'));var config=require(_0xcc8f('0x15'));var licenseUtil=require(_0xcc8f('0x16'));var db=require(_0xcc8f('0x17'))['db'];function respondWithStatusCode(_0x475c73,_0x23a8de){_0x23a8de=_0x23a8de||0xcc;return function(_0x4e835c){if(_0x4e835c){return _0x475c73[_0xcc8f('0x18')](_0x23a8de);}return _0x475c73[_0xcc8f('0x19')](_0x23a8de)[_0xcc8f('0x1a')]();};}function respondWithResult(_0x235d3b,_0x22c3b1){_0x22c3b1=_0x22c3b1||0xc8;return function(_0x4acd89){if(_0x4acd89){return _0x235d3b[_0xcc8f('0x19')](_0x22c3b1)[_0xcc8f('0x1b')](_0x4acd89);}};}function respondWithFilteredResult(_0x3fe3a9,_0x45b501){return function(_0x477ccc){if(_0x477ccc){var _0x2457d9=typeof _0x45b501[_0xcc8f('0x1c')]===_0xcc8f('0x1d')&&typeof _0x45b501[_0xcc8f('0x1e')]===_0xcc8f('0x1d');var _0x4ebbda=_0x477ccc[_0xcc8f('0x1f')];var _0x1460cb=_0x2457d9?0x0:_0x45b501[_0xcc8f('0x1c')];var _0x203a51=_0x2457d9?_0x477ccc[_0xcc8f('0x1f')]:_0x45b501[_0xcc8f('0x1c')]+_0x45b501[_0xcc8f('0x1e')];var _0x228a6a;if(_0x203a51>=_0x4ebbda){_0x203a51=_0x4ebbda;_0x228a6a=0xc8;}else{_0x228a6a=0xce;}_0x3fe3a9[_0xcc8f('0x19')](_0x228a6a);return _0x3fe3a9[_0xcc8f('0x20')](_0xcc8f('0x21'),_0x1460cb+'-'+_0x203a51+'/'+_0x4ebbda)[_0xcc8f('0x1b')](_0x477ccc);}return null;};}function patchUpdates(_0x12cc5a){return function(_0x5d40be){try{jsonpatch[_0xcc8f('0x22')](_0x5d40be,_0x12cc5a,!![]);}catch(_0x39f5f7){return BPromise[_0xcc8f('0x23')](_0x39f5f7);}return _0x5d40be[_0xcc8f('0x24')]();};}function saveUpdates(_0x1aea99,_0x4e4a7b){return function(_0xc4e59c){if(_0xc4e59c){return _0xc4e59c[_0xcc8f('0x25')](_0x1aea99)[_0xcc8f('0x26')](function(_0x54f180){return _0x54f180;});}return null;};}function removeEntity(_0xba74ae,_0x4d2f9e){return function(_0x546e90){if(_0x546e90){return _0x546e90[_0xcc8f('0x27')]()[_0xcc8f('0x26')](function(){_0xba74ae[_0xcc8f('0x19')](0xcc)[_0xcc8f('0x1a')]();});}};}function handleEntityNotFound(_0x3dc989,_0x291843){return function(_0x5844d7){if(!_0x5844d7){_0x3dc989['sendStatus'](0x194);}return _0x5844d7;};}function handleError(_0x54a5f0,_0x3adb97){_0x3adb97=_0x3adb97||0x1f4;return function(_0x126628){logger[_0xcc8f('0x28')](_0x126628[_0xcc8f('0x29')]);if(_0x126628[_0xcc8f('0x2a')]){delete _0x126628[_0xcc8f('0x2a')];}_0x54a5f0['status'](_0x3adb97)[_0xcc8f('0x2b')](_0x126628);};}exports[_0xcc8f('0x2c')]=function(_0x49f466,_0x3fcfee){var _0x4c34a8={},_0x451c2a={},_0x314a95={'count':0x0,'rows':[]};var _0x2b5733=_[_0xcc8f('0x2d')](db[_0xcc8f('0x2e')][_0xcc8f('0x2f')],function(_0x449453){return{'name':_0x449453[_0xcc8f('0x30')],'type':_0x449453[_0xcc8f('0x31')]['key']};});_0x451c2a['model']=_[_0xcc8f('0x2d')](_0x2b5733,'name');_0x451c2a[_0xcc8f('0x32')]=_[_0xcc8f('0x33')](_0x49f466[_0xcc8f('0x32')]);_0x451c2a['filters']=_[_0xcc8f('0x34')](_0x451c2a[_0xcc8f('0x35')],_0x451c2a[_0xcc8f('0x32')]);_0x4c34a8[_0xcc8f('0x36')]=_[_0xcc8f('0x34')](_0x451c2a[_0xcc8f('0x35')],qs['fields'](_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x37')]));_0x4c34a8[_0xcc8f('0x36')]=_0x4c34a8[_0xcc8f('0x36')]['length']?_0x4c34a8[_0xcc8f('0x36')]:_0x451c2a[_0xcc8f('0x35')];if(!_0x49f466[_0xcc8f('0x32')]['hasOwnProperty'](_0xcc8f('0x38'))){_0x4c34a8[_0xcc8f('0x1e')]=qs[_0xcc8f('0x1e')](_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x1e')]);_0x4c34a8['offset']=qs[_0xcc8f('0x1c')](_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x1c')]);}_0x4c34a8['order']=qs[_0xcc8f('0x39')](_0x49f466[_0xcc8f('0x32')]['sort']);_0x4c34a8[_0xcc8f('0x3a')]=qs[_0xcc8f('0x3b')](_['pick'](_0x49f466[_0xcc8f('0x32')],_0x451c2a[_0xcc8f('0x3b')]),_0x2b5733);if(_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x3c')]){_0x4c34a8[_0xcc8f('0x3a')]=_['merge'](_0x4c34a8[_0xcc8f('0x3a')],{'$or':_[_0xcc8f('0x2d')](_0x2b5733,function(_0x418f1c){if(_0x418f1c['type']!==_0xcc8f('0x3d')){var _0x3e9cf2={};_0x3e9cf2[_0x418f1c[_0xcc8f('0x2a')]]={'$like':'%'+_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x3c')]+'%'};return _0x3e9cf2;}})});}_0x4c34a8=_[_0xcc8f('0x3e')]({},_0x4c34a8,_0x49f466[_0xcc8f('0x3f')]);var _0x1730e4={'where':_0x4c34a8[_0xcc8f('0x3a')]};return db[_0xcc8f('0x2e')][_0xcc8f('0x1f')](_0x1730e4)[_0xcc8f('0x26')](function(_0x42a423){_0x314a95[_0xcc8f('0x1f')]=_0x42a423;if(_0x49f466[_0xcc8f('0x32')][_0xcc8f('0x40')]){_0x4c34a8[_0xcc8f('0x41')]=[{'all':!![]}];}return db[_0xcc8f('0x2e')][_0xcc8f('0x42')](_0x4c34a8);})['then'](function(_0x585373){_0x314a95[_0xcc8f('0x43')]=_0x585373;return _0x314a95;})['then'](respondWithFilteredResult(_0x3fcfee,_0x4c34a8))[_0xcc8f('0x44')](handleError(_0x3fcfee,null));};exports[_0xcc8f('0x45')]=function(_0x4beba3,_0x4e1724){var _0x3d2cd3={'raw':!![],'where':{'id':_0x4beba3['params']['id']}},_0x3b81f3={};_0x3b81f3[_0xcc8f('0x35')]=_['keys'](db[_0xcc8f('0x2e')][_0xcc8f('0x2f')]);_0x3b81f3[_0xcc8f('0x32')]=_[_0xcc8f('0x33')](_0x4beba3[_0xcc8f('0x32')]);_0x3b81f3['filters']=_[_0xcc8f('0x34')](_0x3b81f3[_0xcc8f('0x35')],_0x3b81f3[_0xcc8f('0x32')]);_0x3d2cd3['attributes']=_['intersection'](_0x3b81f3[_0xcc8f('0x35')],qs[_0xcc8f('0x37')](_0x4beba3[_0xcc8f('0x32')][_0xcc8f('0x37')]));_0x3d2cd3[_0xcc8f('0x36')]=_0x3d2cd3[_0xcc8f('0x36')][_0xcc8f('0x46')]?_0x3d2cd3[_0xcc8f('0x36')]:_0x3b81f3[_0xcc8f('0x35')];if(_0x4beba3['query']['includeAll']){_0x3d2cd3['include']=[{'all':!![]}];}_0x3d2cd3=_['merge']({},_0x3d2cd3,_0x4beba3['options']);return db[_0xcc8f('0x2e')][_0xcc8f('0x47')](_0x3d2cd3)['then'](handleEntityNotFound(_0x4e1724,null))[_0xcc8f('0x26')](respondWithResult(_0x4e1724,null))['catch'](handleError(_0x4e1724,null));};exports[_0xcc8f('0x48')]=function(_0x3258ab,_0x49b3a9){return db[_0xcc8f('0x2e')][_0xcc8f('0x48')](_0x3258ab['body'],{})[_0xcc8f('0x26')](respondWithResult(_0x49b3a9,0xc9))[_0xcc8f('0x44')](handleError(_0x49b3a9,null));};exports[_0xcc8f('0x25')]=function(_0x3b881c,_0x356a27){if(_0x3b881c['body']['id']){delete _0x3b881c[_0xcc8f('0x49')]['id'];}return db[_0xcc8f('0x2e')][_0xcc8f('0x47')]({'where':{'id':_0x3b881c[_0xcc8f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x356a27,null))[_0xcc8f('0x26')](saveUpdates(_0x3b881c['body'],null))[_0xcc8f('0x26')](respondWithResult(_0x356a27,null))['catch'](handleError(_0x356a27,null));};exports[_0xcc8f('0x27')]=function(_0x277e6d,_0x55eaae){return db[_0xcc8f('0x2e')]['find']({'where':{'id':_0x277e6d[_0xcc8f('0x4a')]['id']}})[_0xcc8f('0x26')](handleEntityNotFound(_0x55eaae,null))[_0xcc8f('0x26')](removeEntity(_0x55eaae,null))[_0xcc8f('0x44')](handleError(_0x55eaae,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 174d1b8..14d5008 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 _0x48c4=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ZendeskField','int_zendesk_fields','lodash','util','moment'];(function(_0x14da60,_0x5e6ae0){var _0x55dd8c=function(_0x5ac403){while(--_0x5ac403){_0x14da60['push'](_0x14da60['shift']());}};_0x55dd8c(++_0x5e6ae0);}(_0x48c4,0xe4));var _0x448c=function(_0x4cb91b,_0x38e9c0){_0x4cb91b=_0x4cb91b-0x0;var _0x1e090a=_0x48c4[_0x4cb91b];return _0x1e090a;};'use strict';var _=require(_0x448c('0x0'));var util=require(_0x448c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x448c('0x2'));var BPromise=require(_0x448c('0x3'));var rp=require(_0x448c('0x4'));var fs=require('fs');var path=require(_0x448c('0x5'));var rimraf=require(_0x448c('0x6'));var config=require(_0x448c('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x448c('0x8')]=function(_0x19d99a,_0x2a2bee){return _0x19d99a['define'](_0x448c('0x9'),attributes,{'tableName':_0x448c('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e21=['request-promise','path','rimraf','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x9a861,_0x6e7f3){var _0x8fdb5b=function(_0x18d182){while(--_0x18d182){_0x9a861['push'](_0x9a861['shift']());}};_0x8fdb5b(++_0x6e7f3);}(_0x3e21,0x1b7));var _0x13e2=function(_0x50fecb,_0x2b0104){_0x50fecb=_0x50fecb-0x0;var _0x567fb5=_0x3e21[_0x50fecb];return _0x567fb5;};'use strict';var _=require(_0x13e2('0x0'));var util=require(_0x13e2('0x1'));var logger=require(_0x13e2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x13e2('0x3'));var fs=require('fs');var path=require(_0x13e2('0x4'));var rimraf=require(_0x13e2('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0x13e2('0x6')]=function(_0x25696c,_0x443001){return _0x25696c[_0x13e2('0x7')](_0x13e2('0x8'),attributes,{'tableName':_0x13e2('0x9'),'paranoid':![],'indexes':[{'name':_0x13e2('0xa'),'fields':[_0x13e2('0xb'),_0x13e2('0xc')],'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 e4bd0fc..cb0fe8a 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 _0x2a4a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2a4a,0x1f3));var _0xa2a4=function(_0x1210e1,_0x458eda){_0x1210e1=_0x1210e1-0x0;var _0x384a73=_0x2a4a[_0x1210e1];return _0x384a73;};'use strict';var _=require(_0xa2a4('0x0'));var util=require(_0xa2a4('0x1'));var moment=require('moment');var BPromise=require(_0xa2a4('0x2'));var rs=require(_0xa2a4('0x3'));var fs=require('fs');var Redis=require(_0xa2a4('0x4'));var db=require(_0xa2a4('0x5'))['db'];var utils=require(_0xa2a4('0x6'));var logger=require(_0xa2a4('0x7'))(_0xa2a4('0x8'));var config=require(_0xa2a4('0x9'));var jayson=require(_0xa2a4('0xa'));var client=jayson[_0xa2a4('0xb')][_0xa2a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dd15d,_0x346e66,_0x438211){return new BPromise(function(_0x1fad36,_0x5d6aa1){return client[_0xa2a4('0xd')](_0x2dd15d,_0x438211)[_0xa2a4('0xe')](function(_0x2a352c){logger['info'](_0xa2a4('0xf'),_0x346e66,'request\x20sent');logger[_0xa2a4('0x10')](_0xa2a4('0x11'),_0x346e66,_0xa2a4('0x12'),JSON[_0xa2a4('0x13')](_0x2a352c));if(_0x2a352c[_0xa2a4('0x14')]){if(_0x2a352c[_0xa2a4('0x14')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x346e66,_0x2a352c['error'][_0xa2a4('0x15')]);return _0x5d6aa1(_0x2a352c[_0xa2a4('0x14')][_0xa2a4('0x15')]);}logger['error'](_0xa2a4('0xf'),_0x346e66,_0x2a352c[_0xa2a4('0x14')][_0xa2a4('0x15')]);return _0x1fad36(_0x2a352c[_0xa2a4('0x14')][_0xa2a4('0x15')]);}else{logger['info'](_0xa2a4('0xf'),_0x346e66,_0xa2a4('0x12'));_0x1fad36(_0x2a352c[_0xa2a4('0x16')][_0xa2a4('0x15')]);}})[_0xa2a4('0x17')](function(_0x4d2282){logger[_0xa2a4('0x14')](_0xa2a4('0xf'),_0x346e66,_0x4d2282);_0x5d6aa1(_0x4d2282);});});} \ No newline at end of file +var _0x3690=['ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x506a0c,_0x1af375){var _0x582ff9=function(_0x3e27d5){while(--_0x3e27d5){_0x506a0c['push'](_0x506a0c['shift']());}};_0x582ff9(++_0x1af375);}(_0x3690,0x17c));var _0x0369=function(_0x2da209,_0x316405){_0x2da209=_0x2da209-0x0;var _0x74e05f=_0x3690[_0x2da209];return _0x74e05f;};'use strict';var _=require(_0x0369('0x0'));var util=require('util');var moment=require(_0x0369('0x1'));var BPromise=require('bluebird');var rs=require(_0x0369('0x2'));var fs=require('fs');var Redis=require(_0x0369('0x3'));var db=require(_0x0369('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0369('0x5'))(_0x0369('0x6'));var config=require(_0x0369('0x7'));var jayson=require(_0x0369('0x8'));var client=jayson[_0x0369('0x9')][_0x0369('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19fa37,_0x47fb5a,_0x32d824){return new BPromise(function(_0x212b7f,_0x5daad9){return client['request'](_0x19fa37,_0x32d824)[_0x0369('0xb')](function(_0x3ce6f6){logger[_0x0369('0xc')](_0x0369('0xd'),_0x47fb5a,_0x0369('0xe'));logger[_0x0369('0xf')](_0x0369('0x10'),_0x47fb5a,_0x0369('0xe'),JSON[_0x0369('0x11')](_0x3ce6f6));if(_0x3ce6f6[_0x0369('0x12')]){if(_0x3ce6f6[_0x0369('0x12')]['code']===0x1f4){logger[_0x0369('0x12')](_0x0369('0xd'),_0x47fb5a,_0x3ce6f6[_0x0369('0x12')][_0x0369('0x13')]);return _0x5daad9(_0x3ce6f6[_0x0369('0x12')][_0x0369('0x13')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x47fb5a,_0x3ce6f6['error'][_0x0369('0x13')]);return _0x212b7f(_0x3ce6f6[_0x0369('0x12')][_0x0369('0x13')]);}else{logger['info'](_0x0369('0xd'),_0x47fb5a,_0x0369('0xe'));_0x212b7f(_0x3ce6f6[_0x0369('0x14')]['message']);}})[_0x0369('0x15')](function(_0x1be0a3){logger[_0x0369('0x12')](_0x0369('0xd'),_0x47fb5a,_0x1be0a3);_0x5daad9(_0x1be0a3);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 5662a36..83fcb87 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 _0x01ef=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x01ef,0x1c3));var _0xf01e=function(_0x5a909b,_0x4a7af1){_0x5a909b=_0x5a909b-0x0;var _0x1ee86f=_0x01ef[_0x5a909b];return _0x1ee86f;};'use strict';var multer=require(_0xf01e('0x0'));var util=require(_0xf01e('0x1'));var path=require('path');var timeout=require(_0xf01e('0x2'));var express=require(_0xf01e('0x3'));var router=express[_0xf01e('0x4')]();var fs_extra=require(_0xf01e('0x5'));var auth=require(_0xf01e('0x6'));var interaction=require(_0xf01e('0x7'));var config=require(_0xf01e('0x8'));var controller=require(_0xf01e('0x9'));router[_0xf01e('0xa')]('/',auth[_0xf01e('0xb')](),controller[_0xf01e('0xc')]);router[_0xf01e('0xa')]('/:id',auth[_0xf01e('0xb')](),controller[_0xf01e('0xd')]);router[_0xf01e('0xa')](_0xf01e('0xe'),auth[_0xf01e('0xb')](),controller[_0xf01e('0xf')]);router[_0xf01e('0xa')](_0xf01e('0x10'),auth[_0xf01e('0xb')](),controller[_0xf01e('0x11')]);router[_0xf01e('0x12')]('/',auth[_0xf01e('0xb')](),controller['create']);router[_0xf01e('0x12')](_0xf01e('0xe'),auth[_0xf01e('0xb')](),controller[_0xf01e('0x13')]);router['put'](_0xf01e('0x14'),auth[_0xf01e('0xb')](),controller[_0xf01e('0x15')]);router['delete'](_0xf01e('0x14'),auth[_0xf01e('0xb')](),controller[_0xf01e('0x16')]);module[_0xf01e('0x17')]=router; \ No newline at end of file +var _0x7cd6=['create','addConfiguration','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x345451,_0x42168e){var _0x1be34b=function(_0x1a77c4){while(--_0x1a77c4){_0x345451['push'](_0x345451['shift']());}};_0x1be34b(++_0x42168e);}(_0x7cd6,0x1a9));var _0x67cd=function(_0x7d6765,_0x53187d){_0x7d6765=_0x7d6765-0x0;var _0x1fc8da=_0x7cd6[_0x7d6765];return _0x1fc8da;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x67cd('0x0'));var timeout=require(_0x67cd('0x1'));var express=require(_0x67cd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x67cd('0x3'));var interaction=require(_0x67cd('0x4'));var config=require(_0x67cd('0x5'));var controller=require(_0x67cd('0x6'));router[_0x67cd('0x7')]('/',auth['isAuthenticated'](),controller[_0x67cd('0x8')]);router[_0x67cd('0x7')](_0x67cd('0x9'),auth[_0x67cd('0xa')](),controller[_0x67cd('0xb')]);router[_0x67cd('0x7')]('/:id/configurations',auth[_0x67cd('0xa')](),controller[_0x67cd('0xc')]);router[_0x67cd('0x7')](_0x67cd('0xd'),auth[_0x67cd('0xa')](),controller[_0x67cd('0xe')]);router[_0x67cd('0xf')]('/',auth[_0x67cd('0xa')](),controller[_0x67cd('0x10')]);router[_0x67cd('0xf')]('/:id/configurations',auth[_0x67cd('0xa')](),controller[_0x67cd('0x11')]);router[_0x67cd('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x67cd('0x13')](_0x67cd('0x9'),auth[_0x67cd('0xa')](),controller['destroy']);module[_0x67cd('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 914d6ad..5cf3938 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 _0x70e0=['STRING','sequelize','exports'];(function(_0x141405,_0x3a60a5){var _0x27e7ba=function(_0x15c54b){while(--_0x15c54b){_0x141405['push'](_0x141405['shift']());}};_0x27e7ba(++_0x3a60a5);}(_0x70e0,0x17b));var _0x070e=function(_0xa4ec2d,_0x48c260){_0xa4ec2d=_0xa4ec2d-0x0;var _0x40b16e=_0x70e0[_0xa4ec2d];return _0x40b16e;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file +var _0x2750=['STRING','sequelize'];(function(_0x55cdc5,_0x2b2297){var _0x29acd5=function(_0x405234){while(--_0x405234){_0x55cdc5['push'](_0x55cdc5['shift']());}};_0x29acd5(++_0x2b2297);}(_0x2750,0x13b));var _0x0275=function(_0x1ab011,_0x42779c){_0x1ab011=_0x1ab011-0x0;var _0x530151=_0x2750[_0x1ab011];return _0x530151;};'use strict';var Sequelize=require(_0x0275('0x0'));module['exports']={'name':{'type':Sequelize[_0x0275('0x1')]},'description':{'type':Sequelize[_0x0275('0x1')]},'host':{'type':Sequelize[_0x0275('0x1')]},'zone':{'type':Sequelize[_0x0275('0x1')]},'clientId':{'type':Sequelize[_0x0275('0x1')]},'clientSecret':{'type':Sequelize[_0x0275('0x1')]},'serverUrl':{'type':Sequelize[_0x0275('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x0275('0x1')]},'refreshToken':{'type':Sequelize[_0x0275('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6fc2929..e94d751 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 _0x1a67=['https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','access_token','getFields','host','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','ZohoAccount','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','ZohoConfiguration','sort','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in'];(function(_0x451e90,_0x31e9ba){var _0x53c74a=function(_0x3dae30){while(--_0x3dae30){_0x451e90['push'](_0x451e90['shift']());}};_0x53c74a(++_0x31e9ba);}(_0x1a67,0x129));var _0x71a6=function(_0x33dc59,_0x644520){_0x33dc59=_0x33dc59-0x0;var _0x59236e=_0x1a67[_0x33dc59];return _0x59236e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x71a6('0x0'));var rp=require(_0x71a6('0x1'));var moment=require(_0x71a6('0x2'));var BPromise=require(_0x71a6('0x3'));var Mustache=require(_0x71a6('0x4'));var util=require('util');var path=require(_0x71a6('0x5'));var sox=require('sox');var csv=require(_0x71a6('0x6'));var ejs=require(_0x71a6('0x7'));var fs=require('fs');var fs_extra=require(_0x71a6('0x8'));var _=require(_0x71a6('0x9'));var squel=require(_0x71a6('0xa'));var crypto=require(_0x71a6('0xb'));var jsforce=require(_0x71a6('0xc'));var deskjs=require(_0x71a6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a6('0xe'));var Redis=require(_0x71a6('0xf'));var authService=require(_0x71a6('0x10'));var qs=require(_0x71a6('0x11'));var as=require(_0x71a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x71a6('0x13'));var utils=require(_0x71a6('0x14'));var config=require(_0x71a6('0x15'));var licenseUtil=require(_0x71a6('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x71a6('0x17'));function respondWithStatusCode(_0x3eb568,_0x31d515){_0x31d515=_0x31d515||0xcc;return function(_0x3733fd){if(_0x3733fd){return _0x3eb568['sendStatus'](_0x31d515);}return _0x3eb568[_0x71a6('0x18')](_0x31d515)[_0x71a6('0x19')]();};}function respondWithResult(_0x4a6fad,_0x220d2d){_0x220d2d=_0x220d2d||0xc8;return function(_0x22af52){if(_0x22af52){return _0x4a6fad[_0x71a6('0x18')](_0x220d2d)['json'](_0x22af52);}};}function respondWithFilteredResult(_0x43c6b2,_0x5e6b5f){return function(_0x53c615){if(_0x53c615){var _0x2ca8f5=typeof _0x5e6b5f[_0x71a6('0x1a')]===_0x71a6('0x1b')&&typeof _0x5e6b5f['limit']==='undefined';var _0x2c01a1=_0x53c615['count'];var _0x19b8ff=_0x2ca8f5?0x0:_0x5e6b5f['offset'];var _0x47a610=_0x2ca8f5?_0x53c615[_0x71a6('0x1c')]:_0x5e6b5f[_0x71a6('0x1a')]+_0x5e6b5f[_0x71a6('0x1d')];var _0x286a4c;if(_0x47a610>=_0x2c01a1){_0x47a610=_0x2c01a1;_0x286a4c=0xc8;}else{_0x286a4c=0xce;}_0x43c6b2[_0x71a6('0x18')](_0x286a4c);return _0x43c6b2[_0x71a6('0x1e')]('Content-Range',_0x19b8ff+'-'+_0x47a610+'/'+_0x2c01a1)['json'](_0x53c615);}return null;};}function patchUpdates(_0x749d3a){return function(_0x33e703){try{jsonpatch[_0x71a6('0x1f')](_0x33e703,_0x749d3a,!![]);}catch(_0x2ecbba){return BPromise[_0x71a6('0x20')](_0x2ecbba);}return _0x33e703[_0x71a6('0x21')]();};}function saveUpdates(_0x3b2f7c,_0x33e7cb){return function(_0x50af96){if(_0x50af96){return _0x50af96[_0x71a6('0x22')](_0x3b2f7c)[_0x71a6('0x23')](function(_0x2a8836){return _0x2a8836;});}return null;};}function removeEntity(_0x2b469a,_0x2012c1){return function(_0x51c783){if(_0x51c783){return _0x51c783[_0x71a6('0x24')]()['then'](function(){_0x2b469a[_0x71a6('0x18')](0xcc)[_0x71a6('0x19')]();});}};}function handleEntityNotFound(_0x35adc1,_0x2cc19a){return function(_0x3660ed){if(!_0x3660ed){_0x35adc1['sendStatus'](0x194);}return _0x3660ed;};}function handleError(_0x1cb135,_0x2584a7){_0x2584a7=_0x2584a7||0x1f4;return function(_0x3b9d0a){logger[_0x71a6('0x25')](_0x3b9d0a[_0x71a6('0x26')]);if(_0x3b9d0a[_0x71a6('0x27')]){delete _0x3b9d0a[_0x71a6('0x27')];}_0x1cb135[_0x71a6('0x18')](_0x2584a7)[_0x71a6('0x28')](_0x3b9d0a);};}exports[_0x71a6('0x29')]=function(_0x3f1463,_0x2437b7){var _0x31e66e={},_0x35efdd={},_0x1a230e={'count':0x0,'rows':[]};var _0x5f31be=_['map'](db['ZohoAccount'][_0x71a6('0x2a')],function(_0x3163d9){return{'name':_0x3163d9['fieldName'],'type':_0x3163d9[_0x71a6('0x2b')][_0x71a6('0x2c')]};});_0x35efdd[_0x71a6('0x2d')]=_[_0x71a6('0x2e')](_0x5f31be,_0x71a6('0x27'));_0x35efdd[_0x71a6('0x2f')]=_[_0x71a6('0x30')](_0x3f1463[_0x71a6('0x2f')]);_0x35efdd[_0x71a6('0x31')]=_[_0x71a6('0x32')](_0x35efdd[_0x71a6('0x2d')],_0x35efdd[_0x71a6('0x2f')]);_0x31e66e[_0x71a6('0x33')]=_[_0x71a6('0x32')](_0x35efdd[_0x71a6('0x2d')],qs[_0x71a6('0x34')](_0x3f1463[_0x71a6('0x2f')][_0x71a6('0x34')]));_0x31e66e[_0x71a6('0x33')]=_0x31e66e[_0x71a6('0x33')][_0x71a6('0x35')]?_0x31e66e[_0x71a6('0x33')]:_0x35efdd[_0x71a6('0x2d')];if(!_0x3f1463['query'][_0x71a6('0x36')](_0x71a6('0x37'))){_0x31e66e[_0x71a6('0x1d')]=qs[_0x71a6('0x1d')](_0x3f1463[_0x71a6('0x2f')]['limit']);_0x31e66e[_0x71a6('0x1a')]=qs[_0x71a6('0x1a')](_0x3f1463[_0x71a6('0x2f')]['offset']);}_0x31e66e[_0x71a6('0x38')]=qs['sort'](_0x3f1463[_0x71a6('0x2f')]['sort']);_0x31e66e[_0x71a6('0x39')]=qs[_0x71a6('0x31')](_[_0x71a6('0x3a')](_0x3f1463[_0x71a6('0x2f')],_0x35efdd[_0x71a6('0x31')]),_0x5f31be);if(_0x3f1463[_0x71a6('0x2f')][_0x71a6('0x3b')]){_0x31e66e[_0x71a6('0x39')]=_['merge'](_0x31e66e[_0x71a6('0x39')],{'$or':_[_0x71a6('0x2e')](_0x5f31be,function(_0x100084){if(_0x100084[_0x71a6('0x2b')]!==_0x71a6('0x3c')){var _0x56be6a={};_0x56be6a[_0x100084['name']]={'$like':'%'+_0x3f1463[_0x71a6('0x2f')][_0x71a6('0x3b')]+'%'};return _0x56be6a;}})});}_0x31e66e=_[_0x71a6('0x3d')]({},_0x31e66e,_0x3f1463[_0x71a6('0x3e')]);var _0x2c114a={'where':_0x31e66e[_0x71a6('0x39')]};return db[_0x71a6('0x3f')]['count'](_0x2c114a)[_0x71a6('0x23')](function(_0x373e3d){_0x1a230e[_0x71a6('0x1c')]=_0x373e3d;if(_0x3f1463[_0x71a6('0x2f')][_0x71a6('0x40')]){_0x31e66e[_0x71a6('0x41')]=[{'all':!![]}];}return db[_0x71a6('0x3f')][_0x71a6('0x42')](_0x31e66e);})[_0x71a6('0x23')](function(_0x1f43db){_0x1a230e[_0x71a6('0x43')]=_0x1f43db;return _0x1a230e;})[_0x71a6('0x23')](respondWithFilteredResult(_0x2437b7,_0x31e66e))[_0x71a6('0x44')](handleError(_0x2437b7,null));};exports['show']=function(_0x56981b,_0xeb376b){var _0x46cc35={'raw':![],'where':{'id':_0x56981b[_0x71a6('0x45')]['id']}},_0x3cf258={};_0x3cf258[_0x71a6('0x2d')]=_[_0x71a6('0x30')](db[_0x71a6('0x3f')]['rawAttributes']);_0x3cf258[_0x71a6('0x2f')]=_[_0x71a6('0x30')](_0x56981b[_0x71a6('0x2f')]);_0x3cf258[_0x71a6('0x31')]=_[_0x71a6('0x32')](_0x3cf258[_0x71a6('0x2d')],_0x3cf258['query']);_0x46cc35[_0x71a6('0x33')]=_['intersection'](_0x3cf258['model'],qs[_0x71a6('0x34')](_0x56981b['query'][_0x71a6('0x34')]));_0x46cc35[_0x71a6('0x33')]=_0x46cc35[_0x71a6('0x33')][_0x71a6('0x35')]?_0x46cc35[_0x71a6('0x33')]:_0x3cf258[_0x71a6('0x2d')];if(_0x56981b[_0x71a6('0x2f')][_0x71a6('0x40')]){_0x46cc35[_0x71a6('0x41')]=[{'all':!![]}];}_0x46cc35=_[_0x71a6('0x3d')]({},_0x46cc35,_0x56981b['options']);return db[_0x71a6('0x3f')][_0x71a6('0x46')](_0x46cc35)['then'](handleEntityNotFound(_0xeb376b,null))[_0x71a6('0x23')](respondWithResult(_0xeb376b,null))['catch'](handleError(_0xeb376b,null));};exports[_0x71a6('0x47')]=function(_0x313f20,_0x3f8854){return db['ZohoAccount'][_0x71a6('0x47')](_0x313f20[_0x71a6('0x48')],{})[_0x71a6('0x23')](respondWithResult(_0x3f8854,0xc9))[_0x71a6('0x44')](handleError(_0x3f8854,null));};exports['update']=function(_0x3deffd,_0x2b3bf6){if(_0x3deffd[_0x71a6('0x48')]['id']){delete _0x3deffd[_0x71a6('0x48')]['id'];}return db[_0x71a6('0x3f')]['find']({'where':{'id':_0x3deffd[_0x71a6('0x45')]['id']}})[_0x71a6('0x23')](handleEntityNotFound(_0x2b3bf6,null))[_0x71a6('0x23')](saveUpdates(_0x3deffd[_0x71a6('0x48')],null))[_0x71a6('0x23')](respondWithResult(_0x2b3bf6,null))[_0x71a6('0x44')](handleError(_0x2b3bf6,null));};exports['destroy']=function(_0x3c1e59,_0xc8e0b){return db[_0x71a6('0x3f')][_0x71a6('0x46')]({'where':{'id':_0x3c1e59[_0x71a6('0x45')]['id']}})['then'](handleEntityNotFound(_0xc8e0b,null))[_0x71a6('0x23')](removeEntity(_0xc8e0b,null))[_0x71a6('0x44')](handleError(_0xc8e0b,null));};exports[_0x71a6('0x49')]=function(_0x541596,_0x192617,_0x247c7d){var _0x3701d0={};var _0x3700aa={};var _0x5931ab;var _0xa6c111;return db['ZohoAccount']['findOne']({'where':{'id':_0x541596[_0x71a6('0x45')]['id']}})[_0x71a6('0x23')](handleEntityNotFound(_0x192617,null))['then'](function(_0x60f031){if(_0x60f031){_0x5931ab=_0x60f031;_0x3700aa[_0x71a6('0x2d')]=_[_0x71a6('0x30')](db[_0x71a6('0x4a')][_0x71a6('0x2a')]);_0x3700aa[_0x71a6('0x2f')]=_[_0x71a6('0x30')](_0x541596[_0x71a6('0x2f')]);_0x3700aa[_0x71a6('0x31')]=_[_0x71a6('0x32')](_0x3700aa[_0x71a6('0x2d')],_0x3700aa[_0x71a6('0x2f')]);_0x3701d0['attributes']=_[_0x71a6('0x32')](_0x3700aa[_0x71a6('0x2d')],qs[_0x71a6('0x34')](_0x541596['query']['fields']));_0x3701d0[_0x71a6('0x33')]=_0x3701d0[_0x71a6('0x33')][_0x71a6('0x35')]?_0x3701d0['attributes']:_0x3700aa[_0x71a6('0x2d')];_0x3701d0[_0x71a6('0x38')]=qs[_0x71a6('0x4b')](_0x541596[_0x71a6('0x2f')][_0x71a6('0x4b')]);_0x3701d0[_0x71a6('0x39')]=qs['filters'](_[_0x71a6('0x3a')](_0x541596[_0x71a6('0x2f')],_0x3700aa[_0x71a6('0x31')]));if(_0x541596[_0x71a6('0x2f')]['filter']){_0x3701d0[_0x71a6('0x39')]=_[_0x71a6('0x3d')](_0x3701d0[_0x71a6('0x39')],{'$or':_[_0x71a6('0x2e')](_0x3701d0['attributes'],function(_0x543b50){var _0x59b1b={};_0x59b1b[_0x543b50]={'$like':'%'+_0x541596[_0x71a6('0x2f')][_0x71a6('0x3b')]+'%'};return _0x59b1b;})});}_0x3701d0=_['merge']({},_0x3701d0,_0x541596[_0x71a6('0x3e')]);return _0x5931ab[_0x71a6('0x49')](_0x3701d0);}})[_0x71a6('0x23')](function(_0x3d730a){if(_0x3d730a){_0xa6c111=_0x3d730a['length'];if(!_0x541596[_0x71a6('0x2f')][_0x71a6('0x36')](_0x71a6('0x37'))){_0x3701d0['limit']=qs[_0x71a6('0x1d')](_0x541596[_0x71a6('0x2f')]['limit']);_0x3701d0[_0x71a6('0x1a')]=qs[_0x71a6('0x1a')](_0x541596[_0x71a6('0x2f')][_0x71a6('0x1a')]);}return _0x5931ab[_0x71a6('0x49')](_0x3701d0);}})[_0x71a6('0x23')](function(_0x45b56a){if(_0x45b56a){return _0x45b56a?{'count':_0xa6c111,'rows':_0x45b56a}:null;}})[_0x71a6('0x23')](respondWithResult(_0x192617,null))['catch'](handleError(_0x192617,null));};exports[_0x71a6('0x4c')]=function(_0x2e8963,_0x15f81f,_0x2792ba){if(_0x2e8963[_0x71a6('0x48')]['id']){delete _0x2e8963[_0x71a6('0x48')]['id'];}return db[_0x71a6('0x3f')][_0x71a6('0x4d')]({'where':{'id':_0x2e8963[_0x71a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x15f81f,null))[_0x71a6('0x23')](function(_0x164a0e){if(_0x164a0e){_0x2e8963[_0x71a6('0x48')][_0x71a6('0x4e')]=_0x164a0e['id'];_0x2e8963['body']['Subjects']=integrations[_0x71a6('0x4f')](_0x2e8963[_0x71a6('0x48')][_0x71a6('0x50')],_0x2e8963[_0x71a6('0x48')]['type']);_0x2e8963[_0x71a6('0x48')][_0x71a6('0x51')]=integrations[_0x71a6('0x52')](_0x2e8963['body'][_0x71a6('0x50')],_0x2e8963[_0x71a6('0x48')][_0x71a6('0x2b')]);return db['ZohoConfiguration'][_0x71a6('0x47')](_0x2e8963[_0x71a6('0x48')],{'include':[{'model':db[_0x71a6('0x53')],'as':_0x71a6('0x54')},{'model':db[_0x71a6('0x53')],'as':'Descriptions'}]});}return null;})[_0x71a6('0x23')](respondWithResult(_0x15f81f,null))[_0x71a6('0x44')](handleError(_0x15f81f,null));};function getAccessToken(_0xb8dfe2){return new Promise(function(_0x3228bd,_0x38e9bc){var _0xa69219;switch(_0xb8dfe2[_0x71a6('0x55')]){case'US':_0xa69219=_0x71a6('0x56');break;case'AU':_0xa69219=_0x71a6('0x57');break;case'EU':_0xa69219=_0x71a6('0x58');break;case'IN':_0xa69219=_0x71a6('0x59');break;case'CN':_0xa69219=_0x71a6('0x5a');break;default:_0xa69219='https://accounts.zoho.eu';break;}var _0x5dfe01={'method':'POST','uri':_0xa69219+_0x71a6('0x5b'),'qs':{'refresh_token':_0xb8dfe2['refreshToken'],'client_id':_0xb8dfe2[_0x71a6('0x5c')],'client_secret':_0xb8dfe2[_0x71a6('0x5d')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5dfe01)['then'](function(_0x4bca43){if(_0x4bca43[_0x71a6('0x5e')]){_0x3228bd(_0x4bca43['access_token']);}else{_0x38e9bc('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x415970){_0x38e9bc(_0x415970);});});}exports[_0x71a6('0x5f')]=function(_0x45a400,_0x1dff60,_0x106d0a){var _0x15efc6,_0x2d62d9,_0x14c168,_0x9691a1,_0x526ace;return db['ZohoAccount'][_0x71a6('0x4d')]({'where':{'id':_0x45a400[_0x71a6('0x45')]['id']},'attributes':['id',_0x71a6('0x60'),_0x71a6('0x55'),_0x71a6('0x5c'),'clientSecret',_0x71a6('0x61'),_0x71a6('0x62'),_0x71a6('0x63')]})[_0x71a6('0x23')](handleEntityNotFound(_0x1dff60,null))[_0x71a6('0x23')](function(_0xac53a0){_0x526ace=_0xac53a0;_0x15efc6=_0x526ace[_0x71a6('0x60')];_0x2d62d9=_0x15efc6===_0x71a6('0x64')?'eu':_0x71a6('0x65');_0x14c168=_0x526ace[_0x71a6('0x61')];var _0x43eeb7=_0x14c168[_0x71a6('0x66')](-0x1);if(_0x43eeb7==='/'||_0x43eeb7==='\x5c'||_0x43eeb7===':'){_0x14c168=_0x14c168[_0x71a6('0x67')](0x0,_0x14c168[_0x71a6('0x68')](_0x43eeb7));}if(!_0x526ace[_0x71a6('0x63')]){throw new Error(_0x71a6('0x69'));}return getAccessToken(_0x526ace);})[_0x71a6('0x23')](function(_0x20e761){if(_0x20e761){return rp({'method':_0x71a6('0x6a'),'uri':util['format'](_0x71a6('0x6b'),_0x2d62d9),'qs':{'module':_0x71a6('0x6c')},'headers':{'Authorization':_0x71a6('0x6d')+_0x20e761},'json':!![]});}})[_0x71a6('0x23')](function(_0x1dc4e8){if(_0x1dc4e8){if(_0x1dc4e8[_0x71a6('0x6e')]&&_0x1dc4e8[_0x71a6('0x6e')][_0x71a6('0x25')]){throw new Error(_0x1dc4e8['response'][_0x71a6('0x25')]['message']);}var _0x33f0cd=[];var _0x49de4f=[];var _0x26b345=[_0x71a6('0x6f'),_0x71a6('0x70'),'Description','WhoId','Call_Duration',_0x71a6('0x71'),_0x71a6('0x72'),'Call_Type'];_0x49de4f=_[_0x71a6('0x73')](_0x1dc4e8[_0x71a6('0x34')],function(_0x5631ad){return _0x26b345[_0x71a6('0x74')](_0x5631ad[_0x71a6('0x75')]);});for(var _0x4a6684=0x0;_0x4a6684<_0x49de4f['length'];_0x4a6684++){if(_0x49de4f[_0x4a6684][_0x71a6('0x76')]===![]){_0x33f0cd[_0x71a6('0x77')]({'id':_0x49de4f[_0x4a6684]['id'],'name':_0x49de4f[_0x4a6684][_0x71a6('0x78')],'custom':_0x49de4f[_0x4a6684][_0x71a6('0x79')],'options':_0x49de4f[_0x4a6684][_0x71a6('0x7a')]===_0x71a6('0x7b')&&_0x49de4f[_0x4a6684][_0x71a6('0x7c')][_0x71a6('0x35')]>-0x1?_[_0x71a6('0x2e')](_0x49de4f[_0x4a6684][_0x71a6('0x7c')],function(_0x18fb8b){return{'name':_0x18fb8b,'value':_0x18fb8b};}):[]});}}return{'count':_0x33f0cd['length'],'rows':_0x33f0cd};}else{return{'count':0x0,'rows':[]};}})[_0x71a6('0x23')](respondWithResult(_0x1dff60,null))[_0x71a6('0x44')](function(_0x1e2369){var _0x4eeaee=_0x45a400[_0x71a6('0x2f')][_0x71a6('0x7d')]?0x1f4:_0x1e2369[_0x71a6('0x7e')]||0x1f4;logger['error'](_0x71a6('0x7f'),_0x71a6('0x5f'),_0x4eeaee,JSON[_0x71a6('0x80')](_0x1e2369));delete _0x1e2369[_0x71a6('0x27')];if(_0x4eeaee===0x191){_0x4eeaee=0x190;}_0x1dff60['status'](_0x4eeaee)[_0x71a6('0x28')](_0x45a400['query'][_0x71a6('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x1e2369[_0x71a6('0x7e')]}:_0x1e2369);});}; \ No newline at end of file +var _0xe040=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','includeAll','include','catch','show','params','keys','fields','find','create','body','update','getConfigurations','findOne','order','sort','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','Subjects','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','host','zone','clientId','serverUrl','zoho.eu','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','error','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xe040,0x6f));var _0x0e04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe040[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0e04('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e04('0x1'));var jsonpatch=require(_0x0e04('0x2'));var rp=require(_0x0e04('0x3'));var moment=require(_0x0e04('0x4'));var BPromise=require(_0x0e04('0x5'));var Mustache=require(_0x0e04('0x6'));var util=require(_0x0e04('0x7'));var path=require(_0x0e04('0x8'));var sox=require(_0x0e04('0x9'));var csv=require(_0x0e04('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e04('0xb'));var _=require(_0x0e04('0xc'));var squel=require(_0x0e04('0xd'));var crypto=require(_0x0e04('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0e04('0xf'));var toCsv=require(_0x0e04('0xa'));var querystring=require(_0x0e04('0x10'));var Papa=require(_0x0e04('0x11'));var Redis=require(_0x0e04('0x12'));var authService=require(_0x0e04('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0e04('0x14'));var hardwareService=require(_0x0e04('0x15'));var logger=require(_0x0e04('0x16'))('api');var utils=require(_0x0e04('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0e04('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x0e04('0x19'));function respondWithStatusCode(_0x30d05c,_0xb707a7){_0xb707a7=_0xb707a7||0xcc;return function(_0x1b6dfa){if(_0x1b6dfa){return _0x30d05c[_0x0e04('0x1a')](_0xb707a7);}return _0x30d05c[_0x0e04('0x1b')](_0xb707a7)[_0x0e04('0x1c')]();};}function respondWithResult(_0x5892a9,_0x27ef58){_0x27ef58=_0x27ef58||0xc8;return function(_0x22f080){if(_0x22f080){return _0x5892a9[_0x0e04('0x1b')](_0x27ef58)['json'](_0x22f080);}};}function respondWithFilteredResult(_0x371733,_0x254c71){return function(_0xe92b80){if(_0xe92b80){var _0x1f6392=typeof _0x254c71[_0x0e04('0x1d')]==='undefined'&&typeof _0x254c71['limit']===_0x0e04('0x1e');var _0x5afa00=_0xe92b80[_0x0e04('0x1f')];var _0x28ab64=_0x1f6392?0x0:_0x254c71['offset'];var _0x32204f=_0x1f6392?_0xe92b80[_0x0e04('0x1f')]:_0x254c71[_0x0e04('0x1d')]+_0x254c71[_0x0e04('0x20')];var _0x231139;if(_0x32204f>=_0x5afa00){_0x32204f=_0x5afa00;_0x231139=0xc8;}else{_0x231139=0xce;}_0x371733[_0x0e04('0x1b')](_0x231139);return _0x371733[_0x0e04('0x21')](_0x0e04('0x22'),_0x28ab64+'-'+_0x32204f+'/'+_0x5afa00)[_0x0e04('0x23')](_0xe92b80);}return null;};}function patchUpdates(_0x3bad6c){return function(_0x451c41){try{jsonpatch[_0x0e04('0x24')](_0x451c41,_0x3bad6c,!![]);}catch(_0x36c557){return BPromise[_0x0e04('0x25')](_0x36c557);}return _0x451c41[_0x0e04('0x26')]();};}function saveUpdates(_0x4a8548,_0x135214){return function(_0x1605d4){if(_0x1605d4){return _0x1605d4['update'](_0x4a8548)[_0x0e04('0x27')](function(_0x4efb58){return _0x4efb58;});}return null;};}function removeEntity(_0x3b8a50,_0x4ff490){return function(_0x348214){if(_0x348214){return _0x348214[_0x0e04('0x28')]()[_0x0e04('0x27')](function(){_0x3b8a50[_0x0e04('0x1b')](0xcc)[_0x0e04('0x1c')]();});}};}function handleEntityNotFound(_0x5ff285,_0x353bc6){return function(_0x2a6732){if(!_0x2a6732){_0x5ff285[_0x0e04('0x1a')](0x194);}return _0x2a6732;};}function handleError(_0x2148a6,_0x4998c7){_0x4998c7=_0x4998c7||0x1f4;return function(_0x4e0b9a){logger['error'](_0x4e0b9a['stack']);if(_0x4e0b9a[_0x0e04('0x29')]){delete _0x4e0b9a[_0x0e04('0x29')];}_0x2148a6['status'](_0x4998c7)['send'](_0x4e0b9a);};}exports[_0x0e04('0x2a')]=function(_0x4ec65f,_0x267acd){var _0x20a05a={},_0x5661db={},_0x2b4f42={'count':0x0,'rows':[]};var _0x11982c=_[_0x0e04('0x2b')](db[_0x0e04('0x2c')][_0x0e04('0x2d')],function(_0x2ce1f4){return{'name':_0x2ce1f4[_0x0e04('0x2e')],'type':_0x2ce1f4['type'][_0x0e04('0x2f')]};});_0x5661db[_0x0e04('0x30')]=_[_0x0e04('0x2b')](_0x11982c,_0x0e04('0x29'));_0x5661db['query']=_['keys'](_0x4ec65f[_0x0e04('0x31')]);_0x5661db[_0x0e04('0x32')]=_[_0x0e04('0x33')](_0x5661db[_0x0e04('0x30')],_0x5661db['query']);_0x20a05a['attributes']=_[_0x0e04('0x33')](_0x5661db[_0x0e04('0x30')],qs['fields'](_0x4ec65f[_0x0e04('0x31')]['fields']));_0x20a05a[_0x0e04('0x34')]=_0x20a05a['attributes'][_0x0e04('0x35')]?_0x20a05a[_0x0e04('0x34')]:_0x5661db[_0x0e04('0x30')];if(!_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x36')](_0x0e04('0x37'))){_0x20a05a['limit']=qs['limit'](_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x20')]);_0x20a05a[_0x0e04('0x1d')]=qs[_0x0e04('0x1d')](_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x1d')]);}_0x20a05a['order']=qs['sort'](_0x4ec65f[_0x0e04('0x31')]['sort']);_0x20a05a[_0x0e04('0x38')]=qs[_0x0e04('0x32')](_[_0x0e04('0x39')](_0x4ec65f[_0x0e04('0x31')],_0x5661db[_0x0e04('0x32')]),_0x11982c);if(_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x3a')]){_0x20a05a[_0x0e04('0x38')]=_[_0x0e04('0x3b')](_0x20a05a['where'],{'$or':_['map'](_0x11982c,function(_0x6f7bf3){if(_0x6f7bf3[_0x0e04('0x3c')]!=='VIRTUAL'){var _0x399d2e={};_0x399d2e[_0x6f7bf3[_0x0e04('0x29')]]={'$like':'%'+_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x3a')]+'%'};return _0x399d2e;}})});}_0x20a05a=_[_0x0e04('0x3b')]({},_0x20a05a,_0x4ec65f[_0x0e04('0x3d')]);var _0x3684b6={'where':_0x20a05a[_0x0e04('0x38')]};return db['ZohoAccount'][_0x0e04('0x1f')](_0x3684b6)['then'](function(_0x41b451){_0x2b4f42['count']=_0x41b451;if(_0x4ec65f[_0x0e04('0x31')][_0x0e04('0x3e')]){_0x20a05a[_0x0e04('0x3f')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x20a05a);})[_0x0e04('0x27')](function(_0x44273d){_0x2b4f42['rows']=_0x44273d;return _0x2b4f42;})[_0x0e04('0x27')](respondWithFilteredResult(_0x267acd,_0x20a05a))[_0x0e04('0x40')](handleError(_0x267acd,null));};exports[_0x0e04('0x41')]=function(_0x3fc299,_0xf4faa1){var _0x4202c2={'raw':![],'where':{'id':_0x3fc299[_0x0e04('0x42')]['id']}},_0x387183={};_0x387183['model']=_[_0x0e04('0x43')](db[_0x0e04('0x2c')]['rawAttributes']);_0x387183[_0x0e04('0x31')]=_[_0x0e04('0x43')](_0x3fc299[_0x0e04('0x31')]);_0x387183['filters']=_[_0x0e04('0x33')](_0x387183[_0x0e04('0x30')],_0x387183['query']);_0x4202c2[_0x0e04('0x34')]=_['intersection'](_0x387183[_0x0e04('0x30')],qs['fields'](_0x3fc299[_0x0e04('0x31')][_0x0e04('0x44')]));_0x4202c2[_0x0e04('0x34')]=_0x4202c2[_0x0e04('0x34')]['length']?_0x4202c2[_0x0e04('0x34')]:_0x387183[_0x0e04('0x30')];if(_0x3fc299[_0x0e04('0x31')]['includeAll']){_0x4202c2[_0x0e04('0x3f')]=[{'all':!![]}];}_0x4202c2=_['merge']({},_0x4202c2,_0x3fc299[_0x0e04('0x3d')]);return db[_0x0e04('0x2c')][_0x0e04('0x45')](_0x4202c2)[_0x0e04('0x27')](handleEntityNotFound(_0xf4faa1,null))[_0x0e04('0x27')](respondWithResult(_0xf4faa1,null))[_0x0e04('0x40')](handleError(_0xf4faa1,null));};exports['create']=function(_0x7adf3e,_0x5d5e25){return db['ZohoAccount'][_0x0e04('0x46')](_0x7adf3e[_0x0e04('0x47')],{})[_0x0e04('0x27')](respondWithResult(_0x5d5e25,0xc9))[_0x0e04('0x40')](handleError(_0x5d5e25,null));};exports[_0x0e04('0x48')]=function(_0x4b0cdd,_0x46fd06){if(_0x4b0cdd[_0x0e04('0x47')]['id']){delete _0x4b0cdd[_0x0e04('0x47')]['id'];}return db['ZohoAccount'][_0x0e04('0x45')]({'where':{'id':_0x4b0cdd['params']['id']}})[_0x0e04('0x27')](handleEntityNotFound(_0x46fd06,null))[_0x0e04('0x27')](saveUpdates(_0x4b0cdd[_0x0e04('0x47')],null))['then'](respondWithResult(_0x46fd06,null))[_0x0e04('0x40')](handleError(_0x46fd06,null));};exports['destroy']=function(_0x4a1aa3,_0x53f9d6){return db[_0x0e04('0x2c')][_0x0e04('0x45')]({'where':{'id':_0x4a1aa3[_0x0e04('0x42')]['id']}})[_0x0e04('0x27')](handleEntityNotFound(_0x53f9d6,null))['then'](removeEntity(_0x53f9d6,null))[_0x0e04('0x40')](handleError(_0x53f9d6,null));};exports[_0x0e04('0x49')]=function(_0x33b182,_0x57c9c6,_0x2dfaa9){var _0x20a1b3={};var _0x52510c={};var _0x5031d1;var _0x55c9df;return db['ZohoAccount'][_0x0e04('0x4a')]({'where':{'id':_0x33b182['params']['id']}})['then'](handleEntityNotFound(_0x57c9c6,null))['then'](function(_0x472cc1){if(_0x472cc1){_0x5031d1=_0x472cc1;_0x52510c[_0x0e04('0x30')]=_[_0x0e04('0x43')](db['ZohoConfiguration'][_0x0e04('0x2d')]);_0x52510c[_0x0e04('0x31')]=_[_0x0e04('0x43')](_0x33b182[_0x0e04('0x31')]);_0x52510c[_0x0e04('0x32')]=_[_0x0e04('0x33')](_0x52510c[_0x0e04('0x30')],_0x52510c['query']);_0x20a1b3['attributes']=_[_0x0e04('0x33')](_0x52510c[_0x0e04('0x30')],qs[_0x0e04('0x44')](_0x33b182[_0x0e04('0x31')][_0x0e04('0x44')]));_0x20a1b3[_0x0e04('0x34')]=_0x20a1b3['attributes'][_0x0e04('0x35')]?_0x20a1b3[_0x0e04('0x34')]:_0x52510c[_0x0e04('0x30')];_0x20a1b3[_0x0e04('0x4b')]=qs[_0x0e04('0x4c')](_0x33b182[_0x0e04('0x31')]['sort']);_0x20a1b3['where']=qs[_0x0e04('0x32')](_[_0x0e04('0x39')](_0x33b182[_0x0e04('0x31')],_0x52510c['filters']));if(_0x33b182[_0x0e04('0x31')][_0x0e04('0x3a')]){_0x20a1b3[_0x0e04('0x38')]=_[_0x0e04('0x3b')](_0x20a1b3['where'],{'$or':_[_0x0e04('0x2b')](_0x20a1b3['attributes'],function(_0x1e6efe){var _0x3a2532={};_0x3a2532[_0x1e6efe]={'$like':'%'+_0x33b182[_0x0e04('0x31')][_0x0e04('0x3a')]+'%'};return _0x3a2532;})});}_0x20a1b3=_[_0x0e04('0x3b')]({},_0x20a1b3,_0x33b182[_0x0e04('0x3d')]);return _0x5031d1[_0x0e04('0x49')](_0x20a1b3);}})['then'](function(_0x23e4cf){if(_0x23e4cf){_0x55c9df=_0x23e4cf['length'];if(!_0x33b182['query'][_0x0e04('0x36')](_0x0e04('0x37'))){_0x20a1b3['limit']=qs[_0x0e04('0x20')](_0x33b182[_0x0e04('0x31')]['limit']);_0x20a1b3[_0x0e04('0x1d')]=qs[_0x0e04('0x1d')](_0x33b182['query'][_0x0e04('0x1d')]);}return _0x5031d1['getConfigurations'](_0x20a1b3);}})[_0x0e04('0x27')](function(_0x42d118){if(_0x42d118){return _0x42d118?{'count':_0x55c9df,'rows':_0x42d118}:null;}})[_0x0e04('0x27')](respondWithResult(_0x57c9c6,null))[_0x0e04('0x40')](handleError(_0x57c9c6,null));};exports['addConfiguration']=function(_0x1cd4f5,_0x2422ed,_0x5e423a){if(_0x1cd4f5[_0x0e04('0x47')]['id']){delete _0x1cd4f5[_0x0e04('0x47')]['id'];}return db[_0x0e04('0x2c')][_0x0e04('0x4a')]({'where':{'id':_0x1cd4f5[_0x0e04('0x42')]['id']}})[_0x0e04('0x27')](handleEntityNotFound(_0x2422ed,null))[_0x0e04('0x27')](function(_0x2e34d1){if(_0x2e34d1){_0x1cd4f5[_0x0e04('0x47')]['AccountId']=_0x2e34d1['id'];_0x1cd4f5['body']['Subjects']=integrations[_0x0e04('0x4d')](_0x1cd4f5['body'][_0x0e04('0x4e')],_0x1cd4f5[_0x0e04('0x47')]['type']);_0x1cd4f5['body'][_0x0e04('0x4f')]=integrations[_0x0e04('0x50')](_0x1cd4f5[_0x0e04('0x47')][_0x0e04('0x4e')],_0x1cd4f5[_0x0e04('0x47')][_0x0e04('0x3c')]);return db[_0x0e04('0x51')][_0x0e04('0x46')](_0x1cd4f5['body'],{'include':[{'model':db[_0x0e04('0x52')],'as':_0x0e04('0x53')},{'model':db[_0x0e04('0x52')],'as':_0x0e04('0x4f')}]});}return null;})['then'](respondWithResult(_0x2422ed,null))[_0x0e04('0x40')](handleError(_0x2422ed,null));};function getAccessToken(_0x160c83){return new Promise(function(_0x47d2d7,_0x4e9236){var _0x4cacc0;switch(_0x160c83['zone']){case'US':_0x4cacc0=_0x0e04('0x54');break;case'AU':_0x4cacc0='https://accounts.zoho.com.au';break;case'EU':_0x4cacc0=_0x0e04('0x55');break;case'IN':_0x4cacc0=_0x0e04('0x56');break;case'CN':_0x4cacc0=_0x0e04('0x57');break;default:_0x4cacc0=_0x0e04('0x55');break;}var _0xba3d7e={'method':_0x0e04('0x58'),'uri':_0x4cacc0+_0x0e04('0x59'),'qs':{'refresh_token':_0x160c83[_0x0e04('0x5a')],'client_id':_0x160c83['clientId'],'client_secret':_0x160c83[_0x0e04('0x5b')],'grant_type':_0x0e04('0x5c')},'json':!![]};return rp(_0xba3d7e)[_0x0e04('0x27')](function(_0x328cd7){if(_0x328cd7[_0x0e04('0x5d')]){_0x47d2d7(_0x328cd7[_0x0e04('0x5d')]);}else{_0x4e9236('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x0e04('0x40')](function(_0x2bbc26){_0x4e9236(_0x2bbc26);});});}exports['getFields']=function(_0x405224,_0x54f275,_0xb20bd4){var _0x4fea47,_0x4a8197,_0x53dfa4,_0x1b2e5a,_0x1e5631;return db[_0x0e04('0x2c')]['findOne']({'where':{'id':_0x405224[_0x0e04('0x42')]['id']},'attributes':['id',_0x0e04('0x5e'),_0x0e04('0x5f'),_0x0e04('0x60'),_0x0e04('0x5b'),_0x0e04('0x61'),'code',_0x0e04('0x5a')]})[_0x0e04('0x27')](handleEntityNotFound(_0x54f275,null))[_0x0e04('0x27')](function(_0xf037ae){_0x1e5631=_0xf037ae;_0x4fea47=_0x1e5631[_0x0e04('0x5e')];_0x4a8197=_0x4fea47===_0x0e04('0x62')?'eu':'com';_0x53dfa4=_0x1e5631[_0x0e04('0x61')];var _0x1d36ad=_0x53dfa4[_0x0e04('0x63')](-0x1);if(_0x1d36ad==='/'||_0x1d36ad==='\x5c'||_0x1d36ad===':'){_0x53dfa4=_0x53dfa4[_0x0e04('0x64')](0x0,_0x53dfa4['lastIndexOf'](_0x1d36ad));}if(!_0x1e5631['refreshToken']){throw new Error(_0x0e04('0x65'));}return getAccessToken(_0x1e5631);})[_0x0e04('0x27')](function(_0x18c219){if(_0x18c219){return rp({'method':_0x0e04('0x66'),'uri':util[_0x0e04('0x67')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4a8197),'qs':{'module':_0x0e04('0x68')},'headers':{'Authorization':_0x0e04('0x69')+_0x18c219},'json':!![]});}})[_0x0e04('0x27')](function(_0x40436f){if(_0x40436f){if(_0x40436f[_0x0e04('0x6a')]&&_0x40436f[_0x0e04('0x6a')][_0x0e04('0x6b')]){throw new Error(_0x40436f[_0x0e04('0x6a')][_0x0e04('0x6b')]['message']);}var _0x439d5f=[];var _0x29b88f=[];var _0x284856=[_0x0e04('0x6c'),_0x0e04('0x6d'),_0x0e04('0x6e'),_0x0e04('0x6f'),_0x0e04('0x70'),_0x0e04('0x71'),_0x0e04('0x72'),_0x0e04('0x73')];_0x29b88f=_['remove'](_0x40436f[_0x0e04('0x44')],function(_0x155a81){return _0x284856[_0x0e04('0x74')](_0x155a81[_0x0e04('0x75')]);});for(var _0x1b0049=0x0;_0x1b0049<_0x29b88f[_0x0e04('0x35')];_0x1b0049++){if(_0x29b88f[_0x1b0049][_0x0e04('0x76')]===![]){_0x439d5f[_0x0e04('0x77')]({'id':_0x29b88f[_0x1b0049]['id'],'name':_0x29b88f[_0x1b0049][_0x0e04('0x78')],'custom':_0x29b88f[_0x1b0049][_0x0e04('0x79')],'options':_0x29b88f[_0x1b0049][_0x0e04('0x7a')]===_0x0e04('0x7b')&&_0x29b88f[_0x1b0049][_0x0e04('0x7c')][_0x0e04('0x35')]>-0x1?_['map'](_0x29b88f[_0x1b0049][_0x0e04('0x7c')],function(_0x58d410){return{'name':_0x58d410,'value':_0x58d410};}):[]});}}return{'count':_0x439d5f[_0x0e04('0x35')],'rows':_0x439d5f};}else{return{'count':0x0,'rows':[]};}})[_0x0e04('0x27')](respondWithResult(_0x54f275,null))[_0x0e04('0x40')](function(_0x225c25){var _0x34c99b=_0x405224[_0x0e04('0x31')][_0x0e04('0x7d')]?0x1f4:_0x225c25['statusCode']||0x1f4;logger[_0x0e04('0x6b')](_0x0e04('0x7e'),'getFields',_0x34c99b,JSON[_0x0e04('0x7f')](_0x225c25));delete _0x225c25[_0x0e04('0x29')];if(_0x34c99b===0x191){_0x34c99b=0x190;}_0x54f275[_0x0e04('0x1b')](_0x34c99b)[_0x0e04('0x80')](_0x405224[_0x0e04('0x31')][_0x0e04('0x7d')]?{'message':_0x0e04('0x81'),'statusCode':_0x225c25[_0x0e04('0x82')]}:_0x225c25);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 147f855..a95004f 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 _0x19bc=['rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','slice','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.eu','authorization_code','lodash','util','../../config/logger','api','moment','path'];(function(_0x363eb6,_0x28d16c){var _0x546fa6=function(_0xcf1362){while(--_0xcf1362){_0x363eb6['push'](_0x363eb6['shift']());}};_0x546fa6(++_0x28d16c);}(_0x19bc,0x19e));var _0xc19b=function(_0x38f73c,_0x59494f){_0x38f73c=_0x38f73c-0x0;var _0x35d234=_0x19bc[_0x38f73c];return _0x35d234;};'use strict';var _=require(_0xc19b('0x0'));var util=require(_0xc19b('0x1'));var logger=require(_0xc19b('0x2'))(_0xc19b('0x3'));var moment=require(_0xc19b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc19b('0x5'));var rimraf=require(_0xc19b('0x6'));var config=require(_0xc19b('0x7'));var attributes=require(_0xc19b('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc19b('0x9')]=function(_0x4a34e3,_0x6a3dec){return _0x4a34e3[_0xc19b('0xa')](_0xc19b('0xb'),attributes,{'tableName':_0xc19b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x923a20,_0x222f40,_0x238e40){if(_0x923a20[_0xc19b('0xd')]('zone')||_0x923a20[_0xc19b('0xd')]('serverUrl')||_0x923a20[_0xc19b('0xd')](_0xc19b('0xe'))||_0x923a20['changed'](_0xc19b('0xf'))||_0x923a20['changed']('code')||_0x923a20[_0xc19b('0xd')](_0xc19b('0x10'))){var _0x315384,_0x29fd58;_0x315384=_0x923a20[_0xc19b('0x11')];var _0x11aad5=_0x315384[_0xc19b('0x12')](-0x1);if(_0x11aad5==='/'||_0x11aad5==='\x5c'||_0x11aad5===':'){_0x315384=_0x315384[_0xc19b('0x13')](0x0,_0x315384['lastIndexOf'](_0x11aad5));}switch(_0x923a20['zone']){case'US':_0x29fd58='https://accounts.zoho.com';break;case'AU':_0x29fd58=_0xc19b('0x14');break;case'IN':_0x29fd58=_0xc19b('0x15');break;case'CN':_0x29fd58=_0xc19b('0x16');break;default:_0x29fd58='https://accounts.zoho.eu';break;}var _0x51846e={'method':_0xc19b('0x17'),'uri':_0x29fd58+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x923a20[_0xc19b('0xe')],'client_secret':_0x923a20[_0xc19b('0xf')],'redirect_uri':_0x923a20[_0xc19b('0x11')],'code':_0x923a20[_0xc19b('0x18')]},'headers':{'Content-Type':_0xc19b('0x19')}};return rp(_0x51846e)[_0xc19b('0x1a')](function(_0x57e3e4){var _0x406af4=JSON[_0xc19b('0x1b')](_0x57e3e4);if(_0x406af4[_0xc19b('0x1c')]){_0x923a20[_0xc19b('0x1d')]=_0x406af4[_0xc19b('0x1c')];logger[_0xc19b('0x1e')](util[_0xc19b('0x1f')](_0xc19b('0x20'),_0x923a20[_0xc19b('0x21')],_0x923a20['id']));}else{logger['error'](util[_0xc19b('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x923a20['name'],_0x923a20['id']),util['inspect'](_0x406af4,{'showHidden':![],'depth':null}));}return _0x238e40(null,_0x222f40);})[_0xc19b('0x22')](function(_0x599772){logger[_0xc19b('0x23')](util['format'](_0xc19b('0x24'),_0x923a20[_0xc19b('0x21')],_0x923a20['id']),util[_0xc19b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x238e40(_0x599772);});}else{return _0x238e40(null,_0x222f40);}},'beforeUpdate':function(_0x3ccc4d,_0x3e9ec0,_0x433f95){if(_0x3ccc4d[_0xc19b('0xd')]('zone')||_0x3ccc4d[_0xc19b('0xd')](_0xc19b('0x11'))||_0x3ccc4d[_0xc19b('0xd')](_0xc19b('0xe'))||_0x3ccc4d[_0xc19b('0xd')](_0xc19b('0xf'))||_0x3ccc4d[_0xc19b('0xd')](_0xc19b('0x18'))||_0x3ccc4d['changed'](_0xc19b('0x10'))){var _0x8b6faa,_0x4d7359;_0x8b6faa=_0x3ccc4d[_0xc19b('0x11')];var _0x49067a=_0x8b6faa['slice'](-0x1);if(_0x49067a==='/'||_0x49067a==='\x5c'||_0x49067a===':'){_0x8b6faa=_0x8b6faa['substring'](0x0,_0x8b6faa[_0xc19b('0x26')](_0x49067a));}switch(_0x3ccc4d['zone']){case'US':_0x4d7359=_0xc19b('0x27');break;case'AU':_0x4d7359=_0xc19b('0x14');break;case'IN':_0x4d7359=_0xc19b('0x15');break;case'CN':_0x4d7359=_0xc19b('0x16');break;default:_0x4d7359=_0xc19b('0x28');break;}var _0x1f9021={'method':_0xc19b('0x17'),'uri':_0x4d7359+'/oauth/v2/token','form':{'grant_type':_0xc19b('0x29'),'client_id':_0x3ccc4d[_0xc19b('0xe')],'client_secret':_0x3ccc4d['clientSecret'],'redirect_uri':_0x3ccc4d['serverUrl'],'code':_0x3ccc4d['code']},'headers':{'Content-Type':_0xc19b('0x19')}};return rp(_0x1f9021)[_0xc19b('0x1a')](function(_0x5eb672){var _0x403c53=JSON[_0xc19b('0x1b')](_0x5eb672);if(_0x403c53[_0xc19b('0x1c')]){_0x3ccc4d[_0xc19b('0x1d')]=_0x403c53[_0xc19b('0x1c')];logger[_0xc19b('0x1e')](util['format'](_0xc19b('0x20'),_0x3ccc4d[_0xc19b('0x21')],_0x3ccc4d['id']));}else{logger[_0xc19b('0x23')](util[_0xc19b('0x1f')](_0xc19b('0x24'),_0x3ccc4d[_0xc19b('0x21')],_0x3ccc4d['id']),util[_0xc19b('0x25')](_0x403c53,{'showHidden':![],'depth':null}));}return _0x433f95(null,_0x3e9ec0);})[_0xc19b('0x22')](function(_0x4248bf){logger['error'](util[_0xc19b('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3ccc4d[_0xc19b('0x21')],_0x3ccc4d['id']),util[_0xc19b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x433f95(_0x4248bf);});}else{return _0x433f95(null,_0x3e9ec0);}}}});}; \ No newline at end of file +var _0xa9e5=['inspect','catch','POST','lodash','util','api','request-promise','rimraf','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x83c54b,_0x2bb731){var _0x1ec98a=function(_0x5bc66e){while(--_0x5bc66e){_0x83c54b['push'](_0x83c54b['shift']());}};_0x1ec98a(++_0x2bb731);}(_0xa9e5,0x72));var _0x5a9e=function(_0x36a1a0,_0x2db1e7){_0x36a1a0=_0x36a1a0-0x0;var _0x46b02b=_0xa9e5[_0x36a1a0];return _0x46b02b;};'use strict';var _=require(_0x5a9e('0x0'));var util=require(_0x5a9e('0x1'));var logger=require('../../config/logger')(_0x5a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5a9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a9e('0x4'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5a9e('0x5')]=function(_0x50d56f,_0x2ca01f){return _0x50d56f[_0x5a9e('0x6')](_0x5a9e('0x7'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d61aa,_0x4c4462,_0x3b6ea3){if(_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0x9'))||_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0xa'))||_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0xb'))||_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0xc'))||_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0xd'))||_0x1d61aa[_0x5a9e('0x8')](_0x5a9e('0xe'))){var _0x4dc3e4,_0x200481;_0x4dc3e4=_0x1d61aa[_0x5a9e('0xa')];var _0x20afbf=_0x4dc3e4[_0x5a9e('0xf')](-0x1);if(_0x20afbf==='/'||_0x20afbf==='\x5c'||_0x20afbf===':'){_0x4dc3e4=_0x4dc3e4[_0x5a9e('0x10')](0x0,_0x4dc3e4[_0x5a9e('0x11')](_0x20afbf));}switch(_0x1d61aa['zone']){case'US':_0x200481=_0x5a9e('0x12');break;case'AU':_0x200481=_0x5a9e('0x13');break;case'IN':_0x200481=_0x5a9e('0x14');break;case'CN':_0x200481='https://accounts.zoho.com.cn';break;default:_0x200481=_0x5a9e('0x15');break;}var _0x2aae3e={'method':'POST','uri':_0x200481+_0x5a9e('0x16'),'form':{'grant_type':_0x5a9e('0x17'),'client_id':_0x1d61aa[_0x5a9e('0xb')],'client_secret':_0x1d61aa[_0x5a9e('0xc')],'redirect_uri':_0x1d61aa['serverUrl'],'code':_0x1d61aa[_0x5a9e('0xd')]},'headers':{'Content-Type':_0x5a9e('0x18')}};return rp(_0x2aae3e)[_0x5a9e('0x19')](function(_0x116b4e){var _0x4bb5a9=JSON[_0x5a9e('0x1a')](_0x116b4e);if(_0x4bb5a9['refresh_token']){_0x1d61aa[_0x5a9e('0x1b')]=_0x4bb5a9['refresh_token'];logger[_0x5a9e('0x1c')](util[_0x5a9e('0x1d')](_0x5a9e('0x1e'),_0x1d61aa[_0x5a9e('0x1f')],_0x1d61aa['id']));}else{logger[_0x5a9e('0x20')](util[_0x5a9e('0x1d')](_0x5a9e('0x21'),_0x1d61aa[_0x5a9e('0x1f')],_0x1d61aa['id']),util[_0x5a9e('0x22')](_0x4bb5a9,{'showHidden':![],'depth':null}));}return _0x3b6ea3(null,_0x4c4462);})[_0x5a9e('0x23')](function(_0x39ffcc){logger[_0x5a9e('0x20')](util[_0x5a9e('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1d61aa[_0x5a9e('0x1f')],_0x1d61aa['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3b6ea3(_0x39ffcc);});}else{return _0x3b6ea3(null,_0x4c4462);}},'beforeUpdate':function(_0x41d4c0,_0x460e1a,_0x198330){if(_0x41d4c0[_0x5a9e('0x8')](_0x5a9e('0x9'))||_0x41d4c0['changed'](_0x5a9e('0xa'))||_0x41d4c0[_0x5a9e('0x8')](_0x5a9e('0xb'))||_0x41d4c0['changed']('clientSecret')||_0x41d4c0[_0x5a9e('0x8')](_0x5a9e('0xd'))||_0x41d4c0[_0x5a9e('0x8')](_0x5a9e('0xe'))){var _0x59e860,_0x44138f;_0x59e860=_0x41d4c0[_0x5a9e('0xa')];var _0x5b6cc1=_0x59e860[_0x5a9e('0xf')](-0x1);if(_0x5b6cc1==='/'||_0x5b6cc1==='\x5c'||_0x5b6cc1===':'){_0x59e860=_0x59e860[_0x5a9e('0x10')](0x0,_0x59e860['lastIndexOf'](_0x5b6cc1));}switch(_0x41d4c0[_0x5a9e('0x9')]){case'US':_0x44138f=_0x5a9e('0x12');break;case'AU':_0x44138f=_0x5a9e('0x13');break;case'IN':_0x44138f=_0x5a9e('0x14');break;case'CN':_0x44138f='https://accounts.zoho.com.cn';break;default:_0x44138f=_0x5a9e('0x15');break;}var _0x414ac1={'method':_0x5a9e('0x24'),'uri':_0x44138f+'/oauth/v2/token','form':{'grant_type':_0x5a9e('0x17'),'client_id':_0x41d4c0[_0x5a9e('0xb')],'client_secret':_0x41d4c0[_0x5a9e('0xc')],'redirect_uri':_0x41d4c0[_0x5a9e('0xa')],'code':_0x41d4c0[_0x5a9e('0xd')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x414ac1)[_0x5a9e('0x19')](function(_0x51764a){var _0x5620dc=JSON['parse'](_0x51764a);if(_0x5620dc['refresh_token']){_0x41d4c0['refreshToken']=_0x5620dc['refresh_token'];logger['info'](util[_0x5a9e('0x1d')](_0x5a9e('0x1e'),_0x41d4c0[_0x5a9e('0x1f')],_0x41d4c0['id']));}else{logger[_0x5a9e('0x20')](util[_0x5a9e('0x1d')](_0x5a9e('0x21'),_0x41d4c0[_0x5a9e('0x1f')],_0x41d4c0['id']),util[_0x5a9e('0x22')](_0x5620dc,{'showHidden':![],'depth':null}));}return _0x198330(null,_0x460e1a);})['catch'](function(_0xd37550){logger[_0x5a9e('0x20')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x41d4c0[_0x5a9e('0x1f')],_0x41d4c0['id']),util[_0x5a9e('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x198330(_0xd37550);});}else{return _0x198330(null,_0x460e1a);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 00aec77..6ca6cdb 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 _0xfba8=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','include','map','model','attributes','ShowZohoAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x506d83,_0x1899e9){var _0x335e8b=function(_0x4a7044){while(--_0x4a7044){_0x506d83['push'](_0x506d83['shift']());}};_0x335e8b(++_0x1899e9);}(_0xfba8,0x1d6));var _0x8fba=function(_0x11ecde,_0x145c6d){_0x11ecde=_0x11ecde-0x0;var _0x40eba8=_0xfba8[_0x11ecde];return _0x40eba8;};'use strict';var _=require(_0x8fba('0x0'));var util=require(_0x8fba('0x1'));var moment=require(_0x8fba('0x2'));var BPromise=require(_0x8fba('0x3'));var rs=require(_0x8fba('0x4'));var fs=require('fs');var Redis=require(_0x8fba('0x5'));var db=require(_0x8fba('0x6'))['db'];var utils=require(_0x8fba('0x7'));var logger=require(_0x8fba('0x8'))('rpc');var config=require(_0x8fba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8fba('0xa')][_0x8fba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38aacc,_0x45a73b,_0x43eeaa){return new BPromise(function(_0x16312d,_0x1794bc){return client['request'](_0x38aacc,_0x43eeaa)[_0x8fba('0xc')](function(_0x589ec6){logger[_0x8fba('0xd')](_0x8fba('0xe'),_0x45a73b,_0x8fba('0xf'));logger[_0x8fba('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x45a73b,_0x8fba('0xf'),JSON[_0x8fba('0x11')](_0x589ec6));if(_0x589ec6['error']){if(_0x589ec6[_0x8fba('0x12')][_0x8fba('0x13')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x45a73b,_0x589ec6[_0x8fba('0x12')]['message']);return _0x1794bc(_0x589ec6[_0x8fba('0x12')][_0x8fba('0x14')]);}logger[_0x8fba('0x12')](_0x8fba('0xe'),_0x45a73b,_0x589ec6[_0x8fba('0x12')][_0x8fba('0x14')]);return _0x16312d(_0x589ec6['error']['message']);}else{logger[_0x8fba('0xd')](_0x8fba('0xe'),_0x45a73b,_0x8fba('0xf'));_0x16312d(_0x589ec6[_0x8fba('0x15')][_0x8fba('0x14')]);}})[_0x8fba('0x16')](function(_0x5223b7){logger[_0x8fba('0x12')](_0x8fba('0xe'),_0x45a73b,_0x5223b7);_0x1794bc(_0x5223b7);});});}exports[_0x8fba('0x17')]=function(_0x3194e7){var _0x37a826=this;return new Promise(function(_0x3aba78,_0x3e42ad){return db[_0x8fba('0x18')]['findAll']({'raw':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')][_0x8fba('0x1a')]===undefined?!![]:![]:!![],'where':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')]['where']||null:null,'attributes':_0x3194e7[_0x8fba('0x19')]?_0x3194e7[_0x8fba('0x19')]['attributes']||null:null,'limit':_0x3194e7[_0x8fba('0x19')]?_0x3194e7['options']['limit']||null:null,'include':_0x3194e7[_0x8fba('0x19')]?_0x3194e7['options'][_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x3194e7[_0x8fba('0x19')][_0x8fba('0x1b')],function(_0x52eebd){return{'model':db[_0x52eebd[_0x8fba('0x1d')]],'as':_0x52eebd['as'],'attributes':_0x52eebd[_0x8fba('0x1e')],'include':_0x52eebd[_0x8fba('0x1b')]?_['map'](_0x52eebd[_0x8fba('0x1b')],function(_0x5030c4){return{'model':db[_0x5030c4[_0x8fba('0x1d')]],'as':_0x5030c4['as'],'attributes':_0x5030c4[_0x8fba('0x1e')],'include':_0x5030c4[_0x8fba('0x1b')]?_['map'](_0x5030c4['include'],function(_0x38ad81){return{'model':db[_0x38ad81[_0x8fba('0x1d')]],'as':_0x38ad81['as'],'attributes':_0x38ad81[_0x8fba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fba('0xc')](function(_0x964d27){logger[_0x8fba('0xd')]('GetZohoAccount',_0x3194e7);logger['debug'](_0x8fba('0x17'),_0x3194e7,JSON[_0x8fba('0x11')](_0x964d27));_0x3aba78(_0x964d27);})[_0x8fba('0x16')](function(_0x20fd52){logger[_0x8fba('0x12')](_0x8fba('0x17'),_0x20fd52[_0x8fba('0x14')],_0x3194e7);_0x3e42ad(_0x37a826[_0x8fba('0x12')](0x1f4,_0x20fd52['message']));});});};exports[_0x8fba('0x1f')]=function(_0x4cf857){var _0x3774a0=this;return new Promise(function(_0x457d4e,_0x297ff9){return db[_0x8fba('0x18')][_0x8fba('0x20')]({'raw':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf857['options']?_0x4cf857[_0x8fba('0x19')][_0x8fba('0x21')]||null:null,'attributes':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')]['attributes']||null:null,'include':_0x4cf857[_0x8fba('0x19')]?_0x4cf857[_0x8fba('0x19')][_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x4cf857[_0x8fba('0x19')][_0x8fba('0x1b')],function(_0x4591d0){return{'model':db[_0x4591d0[_0x8fba('0x1d')]],'as':_0x4591d0['as'],'attributes':_0x4591d0[_0x8fba('0x1e')],'include':_0x4591d0[_0x8fba('0x1b')]?_[_0x8fba('0x1c')](_0x4591d0[_0x8fba('0x1b')],function(_0x1c374e){return{'model':db[_0x1c374e[_0x8fba('0x1d')]],'as':_0x1c374e['as'],'attributes':_0x1c374e[_0x8fba('0x1e')],'include':_0x1c374e[_0x8fba('0x1b')]?_['map'](_0x1c374e[_0x8fba('0x1b')],function(_0x386546){return{'model':db[_0x386546[_0x8fba('0x1d')]],'as':_0x386546['as'],'attributes':_0x386546[_0x8fba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fba('0xc')](function(_0x4b73a0){logger[_0x8fba('0xd')](_0x8fba('0x1f'),_0x4cf857);logger[_0x8fba('0x10')](_0x8fba('0x1f'),_0x4cf857,JSON['stringify'](_0x4b73a0));_0x457d4e(_0x4b73a0);})[_0x8fba('0x16')](function(_0x498ade){logger[_0x8fba('0x12')](_0x8fba('0x1f'),_0x498ade[_0x8fba('0x14')],_0x4cf857);_0x297ff9(_0x3774a0[_0x8fba('0x12')](0x1f4,_0x498ade[_0x8fba('0x14')]));});});}; \ No newline at end of file +var _0x896e=['limit','include','model','attributes','map','ShowZohoAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x220b5f,_0x49327f){var _0x1f0d6e=function(_0x382758){while(--_0x382758){_0x220b5f['push'](_0x220b5f['shift']());}};_0x1f0d6e(++_0x49327f);}(_0x896e,0x1e9));var _0xe896=function(_0x2adc39,_0x26e493){_0x2adc39=_0x2adc39-0x0;var _0x51ec8d=_0x896e[_0x2adc39];return _0x51ec8d;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}exports[_0xe896('0x18')]=function(_0x32f86d){var _0x2d4cf0=this;return new Promise(function(_0x5dc89d,_0x782813){return db[_0xe896('0x19')][_0xe896('0x1a')]({'raw':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')]['where']||null:null,'attributes':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options']['attributes']||null:null,'limit':_0x32f86d[_0xe896('0x1b')]?_0x32f86d[_0xe896('0x1b')][_0xe896('0x1d')]||null:null,'include':_0x32f86d[_0xe896('0x1b')]?_0x32f86d['options'][_0xe896('0x1e')]?_['map'](_0x32f86d['options'][_0xe896('0x1e')],function(_0x41e689){return{'model':db[_0x41e689[_0xe896('0x1f')]],'as':_0x41e689['as'],'attributes':_0x41e689[_0xe896('0x20')],'include':_0x41e689[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x41e689[_0xe896('0x1e')],function(_0x4b71cc){return{'model':db[_0x4b71cc[_0xe896('0x1f')]],'as':_0x4b71cc['as'],'attributes':_0x4b71cc[_0xe896('0x20')],'include':_0x4b71cc[_0xe896('0x1e')]?_['map'](_0x4b71cc[_0xe896('0x1e')],function(_0xd50fe2){return{'model':db[_0xd50fe2[_0xe896('0x1f')]],'as':_0xd50fe2['as'],'attributes':_0xd50fe2[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe896('0xe')](function(_0x3f8ceb){logger['info'](_0xe896('0x18'),_0x32f86d);logger[_0xe896('0x10')](_0xe896('0x18'),_0x32f86d,JSON[_0xe896('0x12')](_0x3f8ceb));_0x5dc89d(_0x3f8ceb);})[_0xe896('0x17')](function(_0x5e0d9b){logger['error']('GetZohoAccount',_0x5e0d9b['message'],_0x32f86d);_0x782813(_0x2d4cf0['error'](0x1f4,_0x5e0d9b[_0xe896('0x15')]));});});};exports[_0xe896('0x22')]=function(_0x10fd26){var _0x76c781=this;return new Promise(function(_0x3cd88e,_0x1a6090){return db[_0xe896('0x19')][_0xe896('0x23')]({'raw':_0x10fd26['options']?_0x10fd26['options'][_0xe896('0x1c')]===undefined?!![]:![]:!![],'where':_0x10fd26[_0xe896('0x1b')]?_0x10fd26[_0xe896('0x1b')][_0xe896('0x24')]||null:null,'attributes':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')]['attributes']||null:null,'include':_0x10fd26['options']?_0x10fd26[_0xe896('0x1b')][_0xe896('0x1e')]?_[_0xe896('0x21')](_0x10fd26['options']['include'],function(_0x567589){return{'model':db[_0x567589[_0xe896('0x1f')]],'as':_0x567589['as'],'attributes':_0x567589[_0xe896('0x20')],'include':_0x567589[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x567589[_0xe896('0x1e')],function(_0x486eb5){return{'model':db[_0x486eb5[_0xe896('0x1f')]],'as':_0x486eb5['as'],'attributes':_0x486eb5[_0xe896('0x20')],'include':_0x486eb5[_0xe896('0x1e')]?_[_0xe896('0x21')](_0x486eb5[_0xe896('0x1e')],function(_0x2cce09){return{'model':db[_0x2cce09[_0xe896('0x1f')]],'as':_0x2cce09['as'],'attributes':_0x2cce09[_0xe896('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42f3fb){logger[_0xe896('0x16')]('ShowZohoAccount',_0x10fd26);logger[_0xe896('0x10')]('ShowZohoAccount',_0x10fd26,JSON[_0xe896('0x12')](_0x42f3fb));_0x3cd88e(_0x42f3fb);})['catch'](function(_0x42f445){logger['error'](_0xe896('0x22'),_0x42f445[_0xe896('0x15')],_0x10fd26);_0x1a6090(_0x76c781[_0xe896('0x13')](0x1f4,_0x42f445[_0xe896('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 46f8acc..13ef04d 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 _0x17d5=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0x17d5,0x114));var _0x517d=function(_0x5e6442,_0x2424bc){_0x5e6442=_0x5e6442-0x0;var _0x1ed30a=_0x17d5[_0x5e6442];return _0x1ed30a;};'use strict';var multer=require(_0x517d('0x0'));var util=require('util');var path=require(_0x517d('0x1'));var timeout=require('connect-timeout');var express=require(_0x517d('0x2'));var router=express[_0x517d('0x3')]();var fs_extra=require(_0x517d('0x4'));var auth=require(_0x517d('0x5'));var interaction=require(_0x517d('0x6'));var config=require('../../config/environment');var controller=require(_0x517d('0x7'));router[_0x517d('0x8')]('/',auth[_0x517d('0x9')](),controller[_0x517d('0xa')]);router[_0x517d('0x8')]('/:id',auth[_0x517d('0x9')](),controller[_0x517d('0xb')]);router['get'](_0x517d('0xc'),auth[_0x517d('0x9')](),controller[_0x517d('0xd')]);router[_0x517d('0x8')](_0x517d('0xe'),auth[_0x517d('0x9')](),controller[_0x517d('0xf')]);router[_0x517d('0x8')](_0x517d('0x10'),auth[_0x517d('0x9')](),controller[_0x517d('0x11')]);router[_0x517d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x517d('0x13')](_0x517d('0x14'),auth['isAuthenticated'](),controller[_0x517d('0x15')]);router[_0x517d('0x16')]('/:id',auth[_0x517d('0x9')](),controller[_0x517d('0x17')]);module[_0x517d('0x18')]=router; \ No newline at end of file +var _0x39ea=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','delete','destroy','exports','multer','util'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x39ea,0x71));var _0xa39e=function(_0x5bb586,_0x294bd5){_0x5bb586=_0x5bb586-0x0;var _0x2a8401=_0x39ea[_0x5bb586];return _0x2a8401;};'use strict';var multer=require(_0xa39e('0x0'));var util=require(_0xa39e('0x1'));var path=require('path');var timeout=require(_0xa39e('0x2'));var express=require(_0xa39e('0x3'));var router=express[_0xa39e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa39e('0x5'));var config=require(_0xa39e('0x6'));var controller=require(_0xa39e('0x7'));router[_0xa39e('0x8')]('/',auth[_0xa39e('0x9')](),controller[_0xa39e('0xa')]);router[_0xa39e('0x8')](_0xa39e('0xb'),auth[_0xa39e('0x9')](),controller[_0xa39e('0xc')]);router[_0xa39e('0x8')](_0xa39e('0xd'),auth['isAuthenticated'](),controller[_0xa39e('0xe')]);router[_0xa39e('0x8')](_0xa39e('0xf'),auth[_0xa39e('0x9')](),controller['getSubjects']);router[_0xa39e('0x8')](_0xa39e('0x10'),auth[_0xa39e('0x9')](),controller[_0xa39e('0x11')]);router[_0xa39e('0x12')]('/',auth['isAuthenticated'](),controller[_0xa39e('0x13')]);router['put'](_0xa39e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa39e('0x14')](_0xa39e('0xb'),auth[_0xa39e('0x9')](),controller[_0xa39e('0x15')]);module[_0xa39e('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 ed1ba46..bf14669 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 _0xb23f=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xb23f,0x90));var _0xfb23=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb23f[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xfb23('0x0'));module[_0xfb23('0x1')]={'name':{'type':Sequelize[_0xfb23('0x2')]},'moduleCreate':{'type':Sequelize[_0xfb23('0x3')](_0xfb23('0x4'),_0xfb23('0x5'),_0xfb23('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfb23('0x3')](_0xfb23('0x7'),_0xfb23('0x5'),_0xfb23('0x4')),'defaultValue':_0xfb23('0x7')},'description':{'type':Sequelize[_0xfb23('0x2')]}}; \ No newline at end of file +var _0x863a=['lead','contact_lead','contact','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x863a,0x107));var _0xa863=function(_0x8450fd,_0x4121a9){_0x8450fd=_0x8450fd-0x0;var _0xa249ad=_0x863a[_0x8450fd];return _0xa249ad;};'use strict';var Sequelize=require('sequelize');module[_0xa863('0x0')]={'name':{'type':Sequelize[_0xa863('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xa863('0x2'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xa863('0x3'),_0xa863('0x4'),_0xa863('0x2')),'defaultValue':_0xa863('0x3')},'description':{'type':Sequelize[_0xa863('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 005f0db..8114907 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 _0xbae5=['find','create','body','ZohoField','order','filter','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','save','update','then','destroy','end','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','findAll','rows','catch','show','params'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbae5,0x195));var _0x5bae=function(_0x2b3a0a,_0x4d1d1c){_0x2b3a0a=_0x2b3a0a-0x0;var _0x2b73ed=_0xbae5[_0x2b3a0a];return _0x2b73ed;};'use strict';var emlformat=require(_0x5bae('0x0'));var rimraf=require(_0x5bae('0x1'));var zipdir=require(_0x5bae('0x2'));var jsonpatch=require(_0x5bae('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5bae('0x4'));var Mustache=require(_0x5bae('0x5'));var util=require(_0x5bae('0x6'));var path=require('path');var sox=require(_0x5bae('0x7'));var csv=require(_0x5bae('0x8'));var ejs=require(_0x5bae('0x9'));var fs=require('fs');var fs_extra=require(_0x5bae('0xa'));var _=require('lodash');var squel=require(_0x5bae('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5bae('0x8'));var querystring=require(_0x5bae('0xd'));var Papa=require(_0x5bae('0xe'));var Redis=require(_0x5bae('0xf'));var authService=require(_0x5bae('0x10'));var qs=require(_0x5bae('0x11'));var as=require(_0x5bae('0x12'));var hardwareService=require(_0x5bae('0x13'));var logger=require(_0x5bae('0x14'))(_0x5bae('0x15'));var utils=require(_0x5bae('0x16'));var config=require(_0x5bae('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bae('0x18'))['db'];function respondWithStatusCode(_0x39cba0,_0x54a815){_0x54a815=_0x54a815||0xcc;return function(_0x17a68d){if(_0x17a68d){return _0x39cba0[_0x5bae('0x19')](_0x54a815);}return _0x39cba0[_0x5bae('0x1a')](_0x54a815)['end']();};}function respondWithResult(_0x155d7a,_0x29ddd9){_0x29ddd9=_0x29ddd9||0xc8;return function(_0x4165fb){if(_0x4165fb){return _0x155d7a['status'](_0x29ddd9)['json'](_0x4165fb);}};}function respondWithFilteredResult(_0x5f3286,_0x594ab0){return function(_0x3b94d4){if(_0x3b94d4){var _0x2115fa=typeof _0x594ab0[_0x5bae('0x1b')]==='undefined'&&typeof _0x594ab0['limit']===_0x5bae('0x1c');var _0x580999=_0x3b94d4[_0x5bae('0x1d')];var _0xd898a9=_0x2115fa?0x0:_0x594ab0[_0x5bae('0x1b')];var _0x33541a=_0x2115fa?_0x3b94d4['count']:_0x594ab0[_0x5bae('0x1b')]+_0x594ab0[_0x5bae('0x1e')];var _0x22fc12;if(_0x33541a>=_0x580999){_0x33541a=_0x580999;_0x22fc12=0xc8;}else{_0x22fc12=0xce;}_0x5f3286[_0x5bae('0x1a')](_0x22fc12);return _0x5f3286['set'](_0x5bae('0x1f'),_0xd898a9+'-'+_0x33541a+'/'+_0x580999)[_0x5bae('0x20')](_0x3b94d4);}return null;};}function patchUpdates(_0x247cf9){return function(_0x5a87c5){try{jsonpatch['apply'](_0x5a87c5,_0x247cf9,!![]);}catch(_0x183fde){return BPromise['reject'](_0x183fde);}return _0x5a87c5[_0x5bae('0x21')]();};}function saveUpdates(_0x5cbc04,_0x1a5592){return function(_0x155747){if(_0x155747){return _0x155747[_0x5bae('0x22')](_0x5cbc04)[_0x5bae('0x23')](function(_0x4df7b2){return _0x4df7b2;});}return null;};}function removeEntity(_0x354794,_0x2afce3){return function(_0x102f1d){if(_0x102f1d){return _0x102f1d[_0x5bae('0x24')]()[_0x5bae('0x23')](function(){_0x354794[_0x5bae('0x1a')](0xcc)[_0x5bae('0x25')]();});}};}function handleEntityNotFound(_0x18fcb6,_0x380e79){return function(_0x4041fb){if(!_0x4041fb){_0x18fcb6[_0x5bae('0x19')](0x194);}return _0x4041fb;};}function handleError(_0x1fdc76,_0x56dca0){_0x56dca0=_0x56dca0||0x1f4;return function(_0x165c6b){logger[_0x5bae('0x26')](_0x165c6b[_0x5bae('0x27')]);if(_0x165c6b[_0x5bae('0x28')]){delete _0x165c6b[_0x5bae('0x28')];}_0x1fdc76[_0x5bae('0x1a')](_0x56dca0)[_0x5bae('0x29')](_0x165c6b);};}exports[_0x5bae('0x2a')]=function(_0x2ec107,_0x495f10){var _0x55a16d={},_0x344b4a={},_0x253d66={'count':0x0,'rows':[]};var _0x5ce7e2=_['map'](db[_0x5bae('0x2b')][_0x5bae('0x2c')],function(_0x1537e8){return{'name':_0x1537e8[_0x5bae('0x2d')],'type':_0x1537e8[_0x5bae('0x2e')][_0x5bae('0x2f')]};});_0x344b4a[_0x5bae('0x30')]=_[_0x5bae('0x31')](_0x5ce7e2,_0x5bae('0x28'));_0x344b4a[_0x5bae('0x32')]=_[_0x5bae('0x33')](_0x2ec107[_0x5bae('0x32')]);_0x344b4a[_0x5bae('0x34')]=_[_0x5bae('0x35')](_0x344b4a[_0x5bae('0x30')],_0x344b4a[_0x5bae('0x32')]);_0x55a16d[_0x5bae('0x36')]=_[_0x5bae('0x35')](_0x344b4a[_0x5bae('0x30')],qs[_0x5bae('0x37')](_0x2ec107[_0x5bae('0x32')][_0x5bae('0x37')]));_0x55a16d[_0x5bae('0x36')]=_0x55a16d[_0x5bae('0x36')][_0x5bae('0x38')]?_0x55a16d[_0x5bae('0x36')]:_0x344b4a[_0x5bae('0x30')];if(!_0x2ec107['query'][_0x5bae('0x39')](_0x5bae('0x3a'))){_0x55a16d[_0x5bae('0x1e')]=qs[_0x5bae('0x1e')](_0x2ec107[_0x5bae('0x32')][_0x5bae('0x1e')]);_0x55a16d[_0x5bae('0x1b')]=qs[_0x5bae('0x1b')](_0x2ec107['query']['offset']);}_0x55a16d['order']=qs[_0x5bae('0x3b')](_0x2ec107[_0x5bae('0x32')][_0x5bae('0x3b')]);_0x55a16d[_0x5bae('0x3c')]=qs[_0x5bae('0x34')](_[_0x5bae('0x3d')](_0x2ec107[_0x5bae('0x32')],_0x344b4a[_0x5bae('0x34')]),_0x5ce7e2);if(_0x2ec107[_0x5bae('0x32')]['filter']){_0x55a16d[_0x5bae('0x3c')]=_['merge'](_0x55a16d[_0x5bae('0x3c')],{'$or':_['map'](_0x5ce7e2,function(_0x24e289){if(_0x24e289['type']!=='VIRTUAL'){var _0x40456f={};_0x40456f[_0x24e289[_0x5bae('0x28')]]={'$like':'%'+_0x2ec107['query']['filter']+'%'};return _0x40456f;}})});}_0x55a16d=_[_0x5bae('0x3e')]({},_0x55a16d,_0x2ec107[_0x5bae('0x3f')]);var _0x152e09={'where':_0x55a16d[_0x5bae('0x3c')]};return db[_0x5bae('0x2b')][_0x5bae('0x1d')](_0x152e09)[_0x5bae('0x23')](function(_0x34f0c8){_0x253d66[_0x5bae('0x1d')]=_0x34f0c8;if(_0x2ec107[_0x5bae('0x32')]['includeAll']){_0x55a16d['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0x5bae('0x40')](_0x55a16d);})[_0x5bae('0x23')](function(_0xfad1b4){_0x253d66[_0x5bae('0x41')]=_0xfad1b4;return _0x253d66;})[_0x5bae('0x23')](respondWithFilteredResult(_0x495f10,_0x55a16d))[_0x5bae('0x42')](handleError(_0x495f10,null));};exports[_0x5bae('0x43')]=function(_0x1b905a,_0x1fcd7e){var _0x167dc4={'raw':![],'where':{'id':_0x1b905a[_0x5bae('0x44')]['id']}},_0x2c2b51={};_0x2c2b51[_0x5bae('0x30')]=_[_0x5bae('0x33')](db[_0x5bae('0x2b')][_0x5bae('0x2c')]);_0x2c2b51[_0x5bae('0x32')]=_[_0x5bae('0x33')](_0x1b905a['query']);_0x2c2b51[_0x5bae('0x34')]=_['intersection'](_0x2c2b51[_0x5bae('0x30')],_0x2c2b51['query']);_0x167dc4[_0x5bae('0x36')]=_['intersection'](_0x2c2b51[_0x5bae('0x30')],qs['fields'](_0x1b905a[_0x5bae('0x32')]['fields']));_0x167dc4[_0x5bae('0x36')]=_0x167dc4[_0x5bae('0x36')][_0x5bae('0x38')]?_0x167dc4['attributes']:_0x2c2b51[_0x5bae('0x30')];if(_0x1b905a[_0x5bae('0x32')]['includeAll']){_0x167dc4['include']=[{'all':!![]}];}_0x167dc4=_['merge']({},_0x167dc4,_0x1b905a[_0x5bae('0x3f')]);return db[_0x5bae('0x2b')][_0x5bae('0x45')](_0x167dc4)[_0x5bae('0x23')](handleEntityNotFound(_0x1fcd7e,null))[_0x5bae('0x23')](respondWithResult(_0x1fcd7e,null))[_0x5bae('0x42')](handleError(_0x1fcd7e,null));};exports[_0x5bae('0x46')]=function(_0x3ae484,_0x20a0d5){return db['ZohoConfiguration'][_0x5bae('0x46')](_0x3ae484[_0x5bae('0x47')],{})[_0x5bae('0x23')](respondWithResult(_0x20a0d5,0xc9))[_0x5bae('0x42')](handleError(_0x20a0d5,null));};exports[_0x5bae('0x22')]=function(_0x437929,_0x459096){if(_0x437929[_0x5bae('0x47')]['id']){delete _0x437929['body']['id'];}return db[_0x5bae('0x2b')][_0x5bae('0x45')]({'where':{'id':_0x437929[_0x5bae('0x44')]['id']}})[_0x5bae('0x23')](handleEntityNotFound(_0x459096,null))[_0x5bae('0x23')](saveUpdates(_0x437929[_0x5bae('0x47')],null))[_0x5bae('0x23')](respondWithResult(_0x459096,null))[_0x5bae('0x42')](handleError(_0x459096,null));};exports[_0x5bae('0x24')]=function(_0x4cf3cf,_0x536d54){return db[_0x5bae('0x2b')][_0x5bae('0x45')]({'where':{'id':_0x4cf3cf['params']['id']}})[_0x5bae('0x23')](handleEntityNotFound(_0x536d54,null))['then'](removeEntity(_0x536d54,null))[_0x5bae('0x42')](handleError(_0x536d54,null));};exports['getFields']=function(_0x548da0,_0x9ec11,_0x267064){var _0x78a1ab={};var _0x5de117={};var _0x4f6286;var _0x5d3e8b;return db[_0x5bae('0x2b')]['findOne']({'where':{'id':_0x548da0[_0x5bae('0x44')]['id']}})['then'](handleEntityNotFound(_0x9ec11,null))['then'](function(_0x408505){if(_0x408505){_0x4f6286=_0x408505;_0x5de117[_0x5bae('0x30')]=_[_0x5bae('0x33')](db[_0x5bae('0x48')]['rawAttributes']);_0x5de117[_0x5bae('0x32')]=_['keys'](_0x548da0[_0x5bae('0x32')]);_0x5de117['filters']=_[_0x5bae('0x35')](_0x5de117[_0x5bae('0x30')],_0x5de117[_0x5bae('0x32')]);_0x78a1ab[_0x5bae('0x36')]=_[_0x5bae('0x35')](_0x5de117[_0x5bae('0x30')],qs[_0x5bae('0x37')](_0x548da0[_0x5bae('0x32')][_0x5bae('0x37')]));_0x78a1ab['attributes']=_0x78a1ab[_0x5bae('0x36')][_0x5bae('0x38')]?_0x78a1ab[_0x5bae('0x36')]:_0x5de117[_0x5bae('0x30')];_0x78a1ab[_0x5bae('0x49')]=qs[_0x5bae('0x3b')](_0x548da0[_0x5bae('0x32')][_0x5bae('0x3b')]);_0x78a1ab[_0x5bae('0x3c')]=qs[_0x5bae('0x34')](_[_0x5bae('0x3d')](_0x548da0['query'],_0x5de117[_0x5bae('0x34')]));if(_0x548da0['query'][_0x5bae('0x4a')]){_0x78a1ab[_0x5bae('0x3c')]=_[_0x5bae('0x3e')](_0x78a1ab[_0x5bae('0x3c')],{'$or':_[_0x5bae('0x31')](_0x78a1ab[_0x5bae('0x36')],function(_0x281078){var _0x4da196={};_0x4da196[_0x281078]={'$like':'%'+_0x548da0[_0x5bae('0x32')][_0x5bae('0x4a')]+'%'};return _0x4da196;})});}_0x78a1ab=_[_0x5bae('0x3e')]({},_0x78a1ab,_0x548da0[_0x5bae('0x3f')]);return _0x4f6286['getFields'](_0x78a1ab);}})['then'](function(_0xb1bf42){if(_0xb1bf42){_0x5d3e8b=_0xb1bf42[_0x5bae('0x38')];if(!_0x548da0[_0x5bae('0x32')][_0x5bae('0x39')]('nolimit')){_0x78a1ab[_0x5bae('0x1e')]=qs[_0x5bae('0x1e')](_0x548da0[_0x5bae('0x32')][_0x5bae('0x1e')]);_0x78a1ab['offset']=qs[_0x5bae('0x1b')](_0x548da0[_0x5bae('0x32')]['offset']);}return _0x4f6286[_0x5bae('0x4b')](_0x78a1ab);}})[_0x5bae('0x23')](function(_0xee8e9c){if(_0xee8e9c){return _0xee8e9c?{'count':_0x5d3e8b,'rows':_0xee8e9c}:null;}})['then'](respondWithResult(_0x9ec11,null))[_0x5bae('0x42')](handleError(_0x9ec11,null));};exports[_0x5bae('0x4c')]=function(_0x47c7c8,_0x5dbbbb,_0x56bd04){var _0x2eca90={};var _0x205cb1={};var _0x5c6664;var _0x544e51;return db[_0x5bae('0x2b')][_0x5bae('0x4d')]({'where':{'id':_0x47c7c8['params']['id']}})['then'](handleEntityNotFound(_0x5dbbbb,null))[_0x5bae('0x23')](function(_0x1a910f){if(_0x1a910f){_0x5c6664=_0x1a910f;_0x205cb1[_0x5bae('0x30')]=_['keys'](db[_0x5bae('0x48')][_0x5bae('0x2c')]);_0x205cb1[_0x5bae('0x32')]=_[_0x5bae('0x33')](_0x47c7c8[_0x5bae('0x32')]);_0x205cb1[_0x5bae('0x34')]=_['intersection'](_0x205cb1[_0x5bae('0x30')],_0x205cb1[_0x5bae('0x32')]);_0x2eca90[_0x5bae('0x36')]=_['intersection'](_0x205cb1[_0x5bae('0x30')],qs[_0x5bae('0x37')](_0x47c7c8[_0x5bae('0x32')][_0x5bae('0x37')]));_0x2eca90[_0x5bae('0x36')]=_0x2eca90['attributes']['length']?_0x2eca90[_0x5bae('0x36')]:_0x205cb1['model'];_0x2eca90[_0x5bae('0x49')]=qs['sort'](_0x47c7c8[_0x5bae('0x32')]['sort']);_0x2eca90[_0x5bae('0x3c')]=qs[_0x5bae('0x34')](_[_0x5bae('0x3d')](_0x47c7c8[_0x5bae('0x32')],_0x205cb1[_0x5bae('0x34')]));if(_0x47c7c8['query'][_0x5bae('0x4a')]){_0x2eca90['where']=_[_0x5bae('0x3e')](_0x2eca90['where'],{'$or':_[_0x5bae('0x31')](_0x2eca90[_0x5bae('0x36')],function(_0x35beaf){var _0x2bec94={};_0x2bec94[_0x35beaf]={'$like':'%'+_0x47c7c8[_0x5bae('0x32')][_0x5bae('0x4a')]+'%'};return _0x2bec94;})});}_0x2eca90=_[_0x5bae('0x3e')]({},_0x2eca90,_0x47c7c8[_0x5bae('0x3f')]);return _0x5c6664[_0x5bae('0x4c')](_0x2eca90);}})['then'](function(_0xd2b304){if(_0xd2b304){_0x544e51=_0xd2b304[_0x5bae('0x38')];if(!_0x47c7c8['query']['hasOwnProperty'](_0x5bae('0x3a'))){_0x2eca90[_0x5bae('0x1e')]=qs[_0x5bae('0x1e')](_0x47c7c8['query'][_0x5bae('0x1e')]);_0x2eca90[_0x5bae('0x1b')]=qs[_0x5bae('0x1b')](_0x47c7c8['query'][_0x5bae('0x1b')]);}return _0x5c6664[_0x5bae('0x4c')](_0x2eca90);}})['then'](function(_0x37e52e){if(_0x37e52e){return _0x37e52e?{'count':_0x544e51,'rows':_0x37e52e}:null;}})['then'](respondWithResult(_0x5dbbbb,null))[_0x5bae('0x42')](handleError(_0x5dbbbb,null));};exports[_0x5bae('0x4e')]=function(_0x505555,_0x692a25,_0x36b65f){var _0x4cc1c4={};var _0x57805b={};var _0x8f2d9f;var _0x1c1f80;return db[_0x5bae('0x2b')][_0x5bae('0x4d')]({'where':{'id':_0x505555[_0x5bae('0x44')]['id']}})[_0x5bae('0x23')](handleEntityNotFound(_0x692a25,null))[_0x5bae('0x23')](function(_0x1bf4fb){if(_0x1bf4fb){_0x8f2d9f=_0x1bf4fb;_0x57805b[_0x5bae('0x30')]=_[_0x5bae('0x33')](db['ZohoField']['rawAttributes']);_0x57805b[_0x5bae('0x32')]=_['keys'](_0x505555[_0x5bae('0x32')]);_0x57805b[_0x5bae('0x34')]=_[_0x5bae('0x35')](_0x57805b['model'],_0x57805b[_0x5bae('0x32')]);_0x4cc1c4[_0x5bae('0x36')]=_[_0x5bae('0x35')](_0x57805b['model'],qs[_0x5bae('0x37')](_0x505555[_0x5bae('0x32')][_0x5bae('0x37')]));_0x4cc1c4[_0x5bae('0x36')]=_0x4cc1c4[_0x5bae('0x36')]['length']?_0x4cc1c4['attributes']:_0x57805b[_0x5bae('0x30')];_0x4cc1c4['order']=qs[_0x5bae('0x3b')](_0x505555[_0x5bae('0x32')][_0x5bae('0x3b')]);_0x4cc1c4[_0x5bae('0x3c')]=qs[_0x5bae('0x34')](_[_0x5bae('0x3d')](_0x505555[_0x5bae('0x32')],_0x57805b[_0x5bae('0x34')]));if(_0x505555[_0x5bae('0x32')][_0x5bae('0x4a')]){_0x4cc1c4[_0x5bae('0x3c')]=_[_0x5bae('0x3e')](_0x4cc1c4[_0x5bae('0x3c')],{'$or':_['map'](_0x4cc1c4[_0x5bae('0x36')],function(_0x360e85){var _0x249c45={};_0x249c45[_0x360e85]={'$like':'%'+_0x505555[_0x5bae('0x32')]['filter']+'%'};return _0x249c45;})});}_0x4cc1c4=_[_0x5bae('0x3e')]({},_0x4cc1c4,_0x505555[_0x5bae('0x3f')]);return _0x8f2d9f[_0x5bae('0x4e')](_0x4cc1c4);}})[_0x5bae('0x23')](function(_0x488f43){if(_0x488f43){_0x1c1f80=_0x488f43[_0x5bae('0x38')];if(!_0x505555[_0x5bae('0x32')][_0x5bae('0x39')](_0x5bae('0x3a'))){_0x4cc1c4[_0x5bae('0x1e')]=qs[_0x5bae('0x1e')](_0x505555[_0x5bae('0x32')]['limit']);_0x4cc1c4['offset']=qs[_0x5bae('0x1b')](_0x505555[_0x5bae('0x32')]['offset']);}return _0x8f2d9f[_0x5bae('0x4e')](_0x4cc1c4);}})['then'](function(_0x20b260){if(_0x20b260){return _0x20b260?{'count':_0x1c1f80,'rows':_0x20b260}:null;}})['then'](respondWithResult(_0x692a25,null))[_0x5bae('0x42')](handleError(_0x692a25,null));}; \ No newline at end of file +var _0xf054=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','offset','count','limit','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','ZohoConfiguration','includeAll','include','findAll','rows','keys','rawAttributes','options','create','catch','body','params','destroy','find','getFields','findOne','sort','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2759e3,_0x1aaefb){var _0x4f165f=function(_0x3124ab){while(--_0x3124ab){_0x2759e3['push'](_0x2759e3['shift']());}};_0x4f165f(++_0x1aaefb);}(_0xf054,0x194));var _0x4f05=function(_0xab8f99,_0x3fde85){_0xab8f99=_0xab8f99-0x0;var _0x153663=_0xf054[_0xab8f99];return _0x153663;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f05('0x1'));var rp=require(_0x4f05('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f05('0x3'));var util=require(_0x4f05('0x4'));var path=require(_0x4f05('0x5'));var sox=require(_0x4f05('0x6'));var csv=require(_0x4f05('0x7'));var ejs=require(_0x4f05('0x8'));var fs=require('fs');var fs_extra=require(_0x4f05('0x9'));var _=require(_0x4f05('0xa'));var squel=require(_0x4f05('0xb'));var crypto=require(_0x4f05('0xc'));var jsforce=require(_0x4f05('0xd'));var deskjs=require(_0x4f05('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4f05('0xf'));var Papa=require(_0x4f05('0x10'));var Redis=require(_0x4f05('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4f05('0x12'));var as=require(_0x4f05('0x13'));var hardwareService=require(_0x4f05('0x14'));var logger=require(_0x4f05('0x15'))(_0x4f05('0x16'));var utils=require(_0x4f05('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4f05('0x18'));var db=require(_0x4f05('0x19'))['db'];function respondWithStatusCode(_0x20e88d,_0x5d3d06){_0x5d3d06=_0x5d3d06||0xcc;return function(_0x6e6f89){if(_0x6e6f89){return _0x20e88d[_0x4f05('0x1a')](_0x5d3d06);}return _0x20e88d['status'](_0x5d3d06)[_0x4f05('0x1b')]();};}function respondWithResult(_0x3445b9,_0x2c46e6){_0x2c46e6=_0x2c46e6||0xc8;return function(_0x2a629f){if(_0x2a629f){return _0x3445b9['status'](_0x2c46e6)[_0x4f05('0x1c')](_0x2a629f);}};}function respondWithFilteredResult(_0x49efa5,_0x39257e){return function(_0x517b5f){if(_0x517b5f){var _0x2855c9=typeof _0x39257e['offset']===_0x4f05('0x1d')&&typeof _0x39257e['limit']===_0x4f05('0x1d');var _0xa5b5db=_0x517b5f['count'];var _0x1b9f46=_0x2855c9?0x0:_0x39257e[_0x4f05('0x1e')];var _0x3d3269=_0x2855c9?_0x517b5f[_0x4f05('0x1f')]:_0x39257e[_0x4f05('0x1e')]+_0x39257e[_0x4f05('0x20')];var _0x33dea5;if(_0x3d3269>=_0xa5b5db){_0x3d3269=_0xa5b5db;_0x33dea5=0xc8;}else{_0x33dea5=0xce;}_0x49efa5[_0x4f05('0x21')](_0x33dea5);return _0x49efa5[_0x4f05('0x22')](_0x4f05('0x23'),_0x1b9f46+'-'+_0x3d3269+'/'+_0xa5b5db)['json'](_0x517b5f);}return null;};}function patchUpdates(_0x13b991){return function(_0x531ec1){try{jsonpatch[_0x4f05('0x24')](_0x531ec1,_0x13b991,!![]);}catch(_0x2c34e0){return BPromise[_0x4f05('0x25')](_0x2c34e0);}return _0x531ec1[_0x4f05('0x26')]();};}function saveUpdates(_0xa71f05,_0x388338){return function(_0x52b62d){if(_0x52b62d){return _0x52b62d[_0x4f05('0x27')](_0xa71f05)[_0x4f05('0x28')](function(_0x5d3c46){return _0x5d3c46;});}return null;};}function removeEntity(_0x1a6450,_0x582c3b){return function(_0x541a90){if(_0x541a90){return _0x541a90['destroy']()[_0x4f05('0x28')](function(){_0x1a6450[_0x4f05('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12df17,_0x2912b5){return function(_0x2edde6){if(!_0x2edde6){_0x12df17[_0x4f05('0x1a')](0x194);}return _0x2edde6;};}function handleError(_0x269a18,_0x24306f){_0x24306f=_0x24306f||0x1f4;return function(_0x5a78de){logger[_0x4f05('0x29')](_0x5a78de[_0x4f05('0x2a')]);if(_0x5a78de[_0x4f05('0x2b')]){delete _0x5a78de[_0x4f05('0x2b')];}_0x269a18[_0x4f05('0x21')](_0x24306f)[_0x4f05('0x2c')](_0x5a78de);};}exports[_0x4f05('0x2d')]=function(_0x28b877,_0x2e778d){var _0x4ba25c={},_0x29b5a8={},_0x1b80b3={'count':0x0,'rows':[]};var _0x205cc9=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x5bc043){return{'name':_0x5bc043[_0x4f05('0x2e')],'type':_0x5bc043[_0x4f05('0x2f')][_0x4f05('0x30')]};});_0x29b5a8[_0x4f05('0x31')]=_[_0x4f05('0x32')](_0x205cc9,_0x4f05('0x2b'));_0x29b5a8[_0x4f05('0x33')]=_['keys'](_0x28b877[_0x4f05('0x33')]);_0x29b5a8[_0x4f05('0x34')]=_[_0x4f05('0x35')](_0x29b5a8[_0x4f05('0x31')],_0x29b5a8[_0x4f05('0x33')]);_0x4ba25c[_0x4f05('0x36')]=_[_0x4f05('0x35')](_0x29b5a8[_0x4f05('0x31')],qs[_0x4f05('0x37')](_0x28b877[_0x4f05('0x33')][_0x4f05('0x37')]));_0x4ba25c[_0x4f05('0x36')]=_0x4ba25c[_0x4f05('0x36')][_0x4f05('0x38')]?_0x4ba25c['attributes']:_0x29b5a8[_0x4f05('0x31')];if(!_0x28b877[_0x4f05('0x33')][_0x4f05('0x39')](_0x4f05('0x3a'))){_0x4ba25c[_0x4f05('0x20')]=qs[_0x4f05('0x20')](_0x28b877[_0x4f05('0x33')]['limit']);_0x4ba25c[_0x4f05('0x1e')]=qs[_0x4f05('0x1e')](_0x28b877[_0x4f05('0x33')][_0x4f05('0x1e')]);}_0x4ba25c[_0x4f05('0x3b')]=qs['sort'](_0x28b877[_0x4f05('0x33')]['sort']);_0x4ba25c[_0x4f05('0x3c')]=qs[_0x4f05('0x34')](_[_0x4f05('0x3d')](_0x28b877[_0x4f05('0x33')],_0x29b5a8[_0x4f05('0x34')]),_0x205cc9);if(_0x28b877['query'][_0x4f05('0x3e')]){_0x4ba25c[_0x4f05('0x3c')]=_[_0x4f05('0x3f')](_0x4ba25c[_0x4f05('0x3c')],{'$or':_[_0x4f05('0x32')](_0x205cc9,function(_0x54f34a){if(_0x54f34a[_0x4f05('0x2f')]!==_0x4f05('0x40')){var _0x4ab0da={};_0x4ab0da[_0x54f34a[_0x4f05('0x2b')]]={'$like':'%'+_0x28b877['query'][_0x4f05('0x3e')]+'%'};return _0x4ab0da;}})});}_0x4ba25c=_['merge']({},_0x4ba25c,_0x28b877['options']);var _0x212a29={'where':_0x4ba25c['where']};return db[_0x4f05('0x41')][_0x4f05('0x1f')](_0x212a29)[_0x4f05('0x28')](function(_0x5b9882){_0x1b80b3[_0x4f05('0x1f')]=_0x5b9882;if(_0x28b877[_0x4f05('0x33')][_0x4f05('0x42')]){_0x4ba25c[_0x4f05('0x43')]=[{'all':!![]}];}return db[_0x4f05('0x41')][_0x4f05('0x44')](_0x4ba25c);})[_0x4f05('0x28')](function(_0x333d4e){_0x1b80b3[_0x4f05('0x45')]=_0x333d4e;return _0x1b80b3;})['then'](respondWithFilteredResult(_0x2e778d,_0x4ba25c))['catch'](handleError(_0x2e778d,null));};exports['show']=function(_0x481c47,_0x53e77e){var _0x489b87={'raw':![],'where':{'id':_0x481c47['params']['id']}},_0x1c6f3f={};_0x1c6f3f['model']=_[_0x4f05('0x46')](db[_0x4f05('0x41')][_0x4f05('0x47')]);_0x1c6f3f[_0x4f05('0x33')]=_[_0x4f05('0x46')](_0x481c47[_0x4f05('0x33')]);_0x1c6f3f[_0x4f05('0x34')]=_[_0x4f05('0x35')](_0x1c6f3f[_0x4f05('0x31')],_0x1c6f3f['query']);_0x489b87[_0x4f05('0x36')]=_[_0x4f05('0x35')](_0x1c6f3f[_0x4f05('0x31')],qs[_0x4f05('0x37')](_0x481c47[_0x4f05('0x33')][_0x4f05('0x37')]));_0x489b87[_0x4f05('0x36')]=_0x489b87[_0x4f05('0x36')]['length']?_0x489b87[_0x4f05('0x36')]:_0x1c6f3f[_0x4f05('0x31')];if(_0x481c47[_0x4f05('0x33')][_0x4f05('0x42')]){_0x489b87[_0x4f05('0x43')]=[{'all':!![]}];}_0x489b87=_[_0x4f05('0x3f')]({},_0x489b87,_0x481c47[_0x4f05('0x48')]);return db[_0x4f05('0x41')]['find'](_0x489b87)[_0x4f05('0x28')](handleEntityNotFound(_0x53e77e,null))[_0x4f05('0x28')](respondWithResult(_0x53e77e,null))['catch'](handleError(_0x53e77e,null));};exports['create']=function(_0x1a74a0,_0x247997){return db['ZohoConfiguration'][_0x4f05('0x49')](_0x1a74a0['body'],{})[_0x4f05('0x28')](respondWithResult(_0x247997,0xc9))[_0x4f05('0x4a')](handleError(_0x247997,null));};exports[_0x4f05('0x27')]=function(_0x3732ec,_0x1fb136){if(_0x3732ec[_0x4f05('0x4b')]['id']){delete _0x3732ec[_0x4f05('0x4b')]['id'];}return db[_0x4f05('0x41')]['find']({'where':{'id':_0x3732ec[_0x4f05('0x4c')]['id']}})[_0x4f05('0x28')](handleEntityNotFound(_0x1fb136,null))[_0x4f05('0x28')](saveUpdates(_0x3732ec[_0x4f05('0x4b')],null))['then'](respondWithResult(_0x1fb136,null))[_0x4f05('0x4a')](handleError(_0x1fb136,null));};exports[_0x4f05('0x4d')]=function(_0x1e6d28,_0x250af3){return db[_0x4f05('0x41')][_0x4f05('0x4e')]({'where':{'id':_0x1e6d28['params']['id']}})['then'](handleEntityNotFound(_0x250af3,null))['then'](removeEntity(_0x250af3,null))[_0x4f05('0x4a')](handleError(_0x250af3,null));};exports[_0x4f05('0x4f')]=function(_0x2c3876,_0x57471a,_0xdaf586){var _0x198f59={};var _0x4ada05={};var _0x50efcf;var _0x21eb75;return db['ZohoConfiguration'][_0x4f05('0x50')]({'where':{'id':_0x2c3876[_0x4f05('0x4c')]['id']}})[_0x4f05('0x28')](handleEntityNotFound(_0x57471a,null))['then'](function(_0x5dad1b){if(_0x5dad1b){_0x50efcf=_0x5dad1b;_0x4ada05[_0x4f05('0x31')]=_[_0x4f05('0x46')](db['ZohoField'][_0x4f05('0x47')]);_0x4ada05['query']=_[_0x4f05('0x46')](_0x2c3876[_0x4f05('0x33')]);_0x4ada05[_0x4f05('0x34')]=_[_0x4f05('0x35')](_0x4ada05[_0x4f05('0x31')],_0x4ada05[_0x4f05('0x33')]);_0x198f59['attributes']=_[_0x4f05('0x35')](_0x4ada05[_0x4f05('0x31')],qs[_0x4f05('0x37')](_0x2c3876[_0x4f05('0x33')][_0x4f05('0x37')]));_0x198f59['attributes']=_0x198f59[_0x4f05('0x36')]['length']?_0x198f59[_0x4f05('0x36')]:_0x4ada05[_0x4f05('0x31')];_0x198f59[_0x4f05('0x3b')]=qs['sort'](_0x2c3876['query']['sort']);_0x198f59[_0x4f05('0x3c')]=qs[_0x4f05('0x34')](_[_0x4f05('0x3d')](_0x2c3876[_0x4f05('0x33')],_0x4ada05[_0x4f05('0x34')]));if(_0x2c3876[_0x4f05('0x33')]['filter']){_0x198f59[_0x4f05('0x3c')]=_[_0x4f05('0x3f')](_0x198f59[_0x4f05('0x3c')],{'$or':_[_0x4f05('0x32')](_0x198f59[_0x4f05('0x36')],function(_0x3e98f4){var _0x3cb495={};_0x3cb495[_0x3e98f4]={'$like':'%'+_0x2c3876[_0x4f05('0x33')][_0x4f05('0x3e')]+'%'};return _0x3cb495;})});}_0x198f59=_[_0x4f05('0x3f')]({},_0x198f59,_0x2c3876[_0x4f05('0x48')]);return _0x50efcf[_0x4f05('0x4f')](_0x198f59);}})['then'](function(_0x4aa8f8){if(_0x4aa8f8){_0x21eb75=_0x4aa8f8['length'];if(!_0x2c3876[_0x4f05('0x33')][_0x4f05('0x39')](_0x4f05('0x3a'))){_0x198f59[_0x4f05('0x20')]=qs[_0x4f05('0x20')](_0x2c3876['query']['limit']);_0x198f59[_0x4f05('0x1e')]=qs[_0x4f05('0x1e')](_0x2c3876[_0x4f05('0x33')]['offset']);}return _0x50efcf[_0x4f05('0x4f')](_0x198f59);}})['then'](function(_0x53cc1a){if(_0x53cc1a){return _0x53cc1a?{'count':_0x21eb75,'rows':_0x53cc1a}:null;}})[_0x4f05('0x28')](respondWithResult(_0x57471a,null))['catch'](handleError(_0x57471a,null));};exports['getSubjects']=function(_0x35eede,_0x17f14a,_0x3a4128){var _0x477310={};var _0x1ec1eb={};var _0x2ffabd;var _0x505f9e;return db['ZohoConfiguration'][_0x4f05('0x50')]({'where':{'id':_0x35eede['params']['id']}})[_0x4f05('0x28')](handleEntityNotFound(_0x17f14a,null))[_0x4f05('0x28')](function(_0x2caf61){if(_0x2caf61){_0x2ffabd=_0x2caf61;_0x1ec1eb[_0x4f05('0x31')]=_[_0x4f05('0x46')](db['ZohoField']['rawAttributes']);_0x1ec1eb[_0x4f05('0x33')]=_['keys'](_0x35eede['query']);_0x1ec1eb[_0x4f05('0x34')]=_[_0x4f05('0x35')](_0x1ec1eb['model'],_0x1ec1eb[_0x4f05('0x33')]);_0x477310['attributes']=_[_0x4f05('0x35')](_0x1ec1eb[_0x4f05('0x31')],qs['fields'](_0x35eede[_0x4f05('0x33')][_0x4f05('0x37')]));_0x477310['attributes']=_0x477310[_0x4f05('0x36')][_0x4f05('0x38')]?_0x477310['attributes']:_0x1ec1eb['model'];_0x477310['order']=qs['sort'](_0x35eede['query'][_0x4f05('0x51')]);_0x477310[_0x4f05('0x3c')]=qs[_0x4f05('0x34')](_[_0x4f05('0x3d')](_0x35eede[_0x4f05('0x33')],_0x1ec1eb[_0x4f05('0x34')]));if(_0x35eede[_0x4f05('0x33')]['filter']){_0x477310[_0x4f05('0x3c')]=_[_0x4f05('0x3f')](_0x477310[_0x4f05('0x3c')],{'$or':_[_0x4f05('0x32')](_0x477310[_0x4f05('0x36')],function(_0xeefac4){var _0x2a08ed={};_0x2a08ed[_0xeefac4]={'$like':'%'+_0x35eede[_0x4f05('0x33')][_0x4f05('0x3e')]+'%'};return _0x2a08ed;})});}_0x477310=_[_0x4f05('0x3f')]({},_0x477310,_0x35eede[_0x4f05('0x48')]);return _0x2ffabd[_0x4f05('0x52')](_0x477310);}})[_0x4f05('0x28')](function(_0x24cc60){if(_0x24cc60){_0x505f9e=_0x24cc60['length'];if(!_0x35eede[_0x4f05('0x33')][_0x4f05('0x39')](_0x4f05('0x3a'))){_0x477310[_0x4f05('0x20')]=qs['limit'](_0x35eede['query'][_0x4f05('0x20')]);_0x477310[_0x4f05('0x1e')]=qs[_0x4f05('0x1e')](_0x35eede[_0x4f05('0x33')][_0x4f05('0x1e')]);}return _0x2ffabd['getSubjects'](_0x477310);}})[_0x4f05('0x28')](function(_0x512515){if(_0x512515){return _0x512515?{'count':_0x505f9e,'rows':_0x512515}:null;}})[_0x4f05('0x28')](respondWithResult(_0x17f14a,null))[_0x4f05('0x4a')](handleError(_0x17f14a,null));};exports[_0x4f05('0x53')]=function(_0x37ae80,_0x55ee5e,_0x3f9272){var _0x3743ad={};var _0x528f68={};var _0x1776cd;var _0x22f3a5;return db['ZohoConfiguration'][_0x4f05('0x50')]({'where':{'id':_0x37ae80['params']['id']}})[_0x4f05('0x28')](handleEntityNotFound(_0x55ee5e,null))['then'](function(_0x2da796){if(_0x2da796){_0x1776cd=_0x2da796;_0x528f68[_0x4f05('0x31')]=_['keys'](db['ZohoField'][_0x4f05('0x47')]);_0x528f68[_0x4f05('0x33')]=_[_0x4f05('0x46')](_0x37ae80[_0x4f05('0x33')]);_0x528f68[_0x4f05('0x34')]=_[_0x4f05('0x35')](_0x528f68[_0x4f05('0x31')],_0x528f68['query']);_0x3743ad[_0x4f05('0x36')]=_[_0x4f05('0x35')](_0x528f68[_0x4f05('0x31')],qs['fields'](_0x37ae80['query'][_0x4f05('0x37')]));_0x3743ad['attributes']=_0x3743ad[_0x4f05('0x36')][_0x4f05('0x38')]?_0x3743ad[_0x4f05('0x36')]:_0x528f68[_0x4f05('0x31')];_0x3743ad[_0x4f05('0x3b')]=qs[_0x4f05('0x51')](_0x37ae80[_0x4f05('0x33')][_0x4f05('0x51')]);_0x3743ad['where']=qs[_0x4f05('0x34')](_[_0x4f05('0x3d')](_0x37ae80[_0x4f05('0x33')],_0x528f68['filters']));if(_0x37ae80[_0x4f05('0x33')][_0x4f05('0x3e')]){_0x3743ad['where']=_[_0x4f05('0x3f')](_0x3743ad[_0x4f05('0x3c')],{'$or':_['map'](_0x3743ad[_0x4f05('0x36')],function(_0x357435){var _0x2ad3ef={};_0x2ad3ef[_0x357435]={'$like':'%'+_0x37ae80[_0x4f05('0x33')][_0x4f05('0x3e')]+'%'};return _0x2ad3ef;})});}_0x3743ad=_[_0x4f05('0x3f')]({},_0x3743ad,_0x37ae80[_0x4f05('0x48')]);return _0x1776cd[_0x4f05('0x53')](_0x3743ad);}})[_0x4f05('0x28')](function(_0xcb8101){if(_0xcb8101){_0x22f3a5=_0xcb8101[_0x4f05('0x38')];if(!_0x37ae80[_0x4f05('0x33')]['hasOwnProperty']('nolimit')){_0x3743ad['limit']=qs[_0x4f05('0x20')](_0x37ae80[_0x4f05('0x33')][_0x4f05('0x20')]);_0x3743ad[_0x4f05('0x1e')]=qs[_0x4f05('0x1e')](_0x37ae80['query'][_0x4f05('0x1e')]);}return _0x1776cd['getDescriptions'](_0x3743ad);}})[_0x4f05('0x28')](function(_0x565d03){if(_0x565d03){return _0x565d03?{'count':_0x22f3a5,'rows':_0x565d03}:null;}})[_0x4f05('0x28')](respondWithResult(_0x55ee5e,null))[_0x4f05('0x4a')](handleError(_0x55ee5e,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index fdb4f77..c2b0e3b 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 _0x9e8c=['exports','ZohoConfiguration','int_zoho_configurations','util','moment','bluebird','request-promise','path','./intZohoConfiguration.attributes'];(function(_0x6ed305,_0x18d107){var _0x2cc461=function(_0x45743a){while(--_0x45743a){_0x6ed305['push'](_0x6ed305['shift']());}};_0x2cc461(++_0x18d107);}(_0x9e8c,0xe4));var _0xc9e8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e8c[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var util=require(_0xc9e8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc9e8('0x1'));var BPromise=require(_0xc9e8('0x2'));var rp=require(_0xc9e8('0x3'));var fs=require('fs');var path=require(_0xc9e8('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9e8('0x5'));module[_0xc9e8('0x6')]=function(_0xf9f1c9,_0x4fe9ba){return _0xf9f1c9['define'](_0xc9e8('0x7'),attributes,{'tableName':_0xc9e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ce=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','int_zoho_configurations','lodash','../../config/logger','api','moment'];(function(_0x2f84a1,_0x5f27d5){var _0x40b335=function(_0x546b62){while(--_0x546b62){_0x2f84a1['push'](_0x2f84a1['shift']());}};_0x40b335(++_0x5f27d5);}(_0xd2ce,0x158));var _0xed2c=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xd2ce[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xed2c('0x0'));var util=require('util');var logger=require(_0xed2c('0x1'))(_0xed2c('0x2'));var moment=require(_0xed2c('0x3'));var BPromise=require('bluebird');var rp=require(_0xed2c('0x4'));var fs=require('fs');var path=require(_0xed2c('0x5'));var rimraf=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var attributes=require(_0xed2c('0x8'));module[_0xed2c('0x9')]=function(_0x4e4bcf,_0x13b670){return _0x4e4bcf[_0xed2c('0xa')]('ZohoConfiguration',attributes,{'tableName':_0xed2c('0xb'),'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 36c5d37..b8ce8e3 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 _0x9fc6=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x240c50,_0x3a27d7){var _0x26fb46=function(_0x22fa46){while(--_0x22fa46){_0x240c50['push'](_0x240c50['shift']());}};_0x26fb46(++_0x3a27d7);}(_0x9fc6,0xef));var _0x69fc=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x9fc6[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0x69fc('0x0'));var util=require(_0x69fc('0x1'));var moment=require(_0x69fc('0x2'));var BPromise=require(_0x69fc('0x3'));var rs=require(_0x69fc('0x4'));var fs=require('fs');var Redis=require(_0x69fc('0x5'));var db=require(_0x69fc('0x6'))['db'];var utils=require(_0x69fc('0x7'));var logger=require(_0x69fc('0x8'))(_0x69fc('0x9'));var config=require(_0x69fc('0xa'));var jayson=require(_0x69fc('0xb'));var client=jayson['client'][_0x69fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc5a1dd,_0x3c7f9,_0x4af926){return new BPromise(function(_0x12fbb7,_0x277311){return client['request'](_0xc5a1dd,_0x4af926)['then'](function(_0x31dace){logger[_0x69fc('0xd')](_0x69fc('0xe'),_0x3c7f9,_0x69fc('0xf'));logger[_0x69fc('0x10')](_0x69fc('0x11'),_0x3c7f9,_0x69fc('0xf'),JSON[_0x69fc('0x12')](_0x31dace));if(_0x31dace['error']){if(_0x31dace[_0x69fc('0x13')][_0x69fc('0x14')]===0x1f4){logger[_0x69fc('0x13')](_0x69fc('0xe'),_0x3c7f9,_0x31dace[_0x69fc('0x13')]['message']);return _0x277311(_0x31dace[_0x69fc('0x13')]['message']);}logger[_0x69fc('0x13')](_0x69fc('0xe'),_0x3c7f9,_0x31dace['error'][_0x69fc('0x15')]);return _0x12fbb7(_0x31dace[_0x69fc('0x13')][_0x69fc('0x15')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3c7f9,'request\x20sent');_0x12fbb7(_0x31dace['result'][_0x69fc('0x15')]);}})[_0x69fc('0x16')](function(_0x1f75eb){logger[_0x69fc('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c7f9,_0x1f75eb);_0x277311(_0x1f75eb);});});} \ No newline at end of file +var _0x6320=['moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','lodash'];(function(_0x17f269,_0x26f812){var _0x2ea5c6=function(_0x2bf121){while(--_0x2bf121){_0x17f269['push'](_0x17f269['shift']());}};_0x2ea5c6(++_0x26f812);}(_0x6320,0x167));var _0x0632=function(_0x46682c,_0x13dc57){_0x46682c=_0x46682c-0x0;var _0x3d05e9=_0x6320[_0x46682c];return _0x3d05e9;};'use strict';var _=require(_0x0632('0x0'));var util=require('util');var moment=require(_0x0632('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0632('0x2'))['db'];var utils=require(_0x0632('0x3'));var logger=require(_0x0632('0x4'))(_0x0632('0x5'));var config=require(_0x0632('0x6'));var jayson=require(_0x0632('0x7'));var client=jayson[_0x0632('0x8')][_0x0632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3e6c,_0x2d5856,_0x41dee1){return new BPromise(function(_0x6a2707,_0x524ff0){return client[_0x0632('0xa')](_0x1a3e6c,_0x41dee1)['then'](function(_0x4ee256){logger[_0x0632('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d5856,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2d5856,_0x0632('0xc'),JSON[_0x0632('0xd')](_0x4ee256));if(_0x4ee256[_0x0632('0xe')]){if(_0x4ee256[_0x0632('0xe')][_0x0632('0xf')]===0x1f4){logger[_0x0632('0xe')](_0x0632('0x10'),_0x2d5856,_0x4ee256[_0x0632('0xe')]['message']);return _0x524ff0(_0x4ee256[_0x0632('0xe')][_0x0632('0x11')]);}logger[_0x0632('0xe')](_0x0632('0x10'),_0x2d5856,_0x4ee256[_0x0632('0xe')][_0x0632('0x11')]);return _0x6a2707(_0x4ee256['error']['message']);}else{logger[_0x0632('0xb')](_0x0632('0x10'),_0x2d5856,'request\x20sent');_0x6a2707(_0x4ee256['result'][_0x0632('0x11')]);}})['catch'](function(_0x4d7cf9){logger[_0x0632('0xe')](_0x0632('0x10'),_0x2d5856,_0x4d7cf9);_0x524ff0(_0x4d7cf9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 2e8567c..9858d5c 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 _0xf4ce=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xf4ce,0x96));var _0xef4c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf4ce[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xef4c('0x0'));var util=require(_0xef4c('0x1'));var path=require(_0xef4c('0x2'));var timeout=require(_0xef4c('0x3'));var express=require(_0xef4c('0x4'));var router=express[_0xef4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xef4c('0x6'));var interaction=require(_0xef4c('0x7'));var config=require('../../config/environment');var controller=require(_0xef4c('0x8'));router['get']('/',auth[_0xef4c('0x9')](),controller[_0xef4c('0xa')]);router['get'](_0xef4c('0xb'),auth[_0xef4c('0x9')](),controller[_0xef4c('0xc')]);router[_0xef4c('0xd')]('/',auth[_0xef4c('0x9')](),controller[_0xef4c('0xe')]);router[_0xef4c('0xf')](_0xef4c('0xb'),auth[_0xef4c('0x9')](),controller[_0xef4c('0x10')]);router['delete'](_0xef4c('0xb'),auth[_0xef4c('0x9')](),controller[_0xef4c('0x11')]);module[_0xef4c('0x12')]=router; \ No newline at end of file +var _0x7316=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0x46fce6,_0x291591){var _0x3133d0=function(_0x18eeae){while(--_0x18eeae){_0x46fce6['push'](_0x46fce6['shift']());}};_0x3133d0(++_0x291591);}(_0x7316,0x1a3));var _0x6731=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0x7316[_0x5d6c3e];return _0x44ecb7;};'use strict';var multer=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var path=require('path');var timeout=require(_0x6731('0x2'));var express=require(_0x6731('0x3'));var router=express[_0x6731('0x4')]();var fs_extra=require(_0x6731('0x5'));var auth=require(_0x6731('0x6'));var interaction=require(_0x6731('0x7'));var config=require(_0x6731('0x8'));var controller=require('./intZohoField.controller');router[_0x6731('0x9')]('/',auth['isAuthenticated'](),controller[_0x6731('0xa')]);router[_0x6731('0x9')](_0x6731('0xb'),auth[_0x6731('0xc')](),controller[_0x6731('0xd')]);router[_0x6731('0xe')]('/',auth[_0x6731('0xc')](),controller[_0x6731('0xf')]);router[_0x6731('0x10')](_0x6731('0xb'),auth[_0x6731('0xc')](),controller[_0x6731('0x11')]);router['delete'](_0x6731('0xb'),auth[_0x6731('0xc')](),controller[_0x6731('0x12')]);module[_0x6731('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2f31b2f..2bcc39c 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 _0x1f4b=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x3823e6,_0x39d304){var _0x151993=function(_0xd3a76e){while(--_0xd3a76e){_0x3823e6['push'](_0x3823e6['shift']());}};_0x151993(++_0x39d304);}(_0x1f4b,0x15d));var _0xb1f4=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0x1f4b[_0x521378];return _0x4b2fc4;};'use strict';var Sequelize=require(_0xb1f4('0x0'));module[_0xb1f4('0x1')]={'type':{'type':Sequelize[_0xb1f4('0x2')]('string',_0xb1f4('0x3'),_0xb1f4('0x4'),_0xb1f4('0x5'),_0xb1f4('0x6')),'defaultValue':_0xb1f4('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb1f4('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0xb1f4('0x7'),'variable',_0xb1f4('0x4'))},'keyContent':{'type':Sequelize[_0xb1f4('0x8')]},'idField':{'type':Sequelize[_0xb1f4('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb1f4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb1f4('0x8')]}}; \ No newline at end of file +var _0x3979=['sequelize','exports','string','keyValue','STRING','ENUM','BOOLEAN'];(function(_0x33ae98,_0x5ed0dd){var _0xa19034=function(_0x17f01d){while(--_0x17f01d){_0x33ae98['push'](_0x33ae98['shift']());}};_0xa19034(++_0x5ed0dd);}(_0x3979,0x17a));var _0x9397=function(_0x25bda7,_0x536e69){_0x25bda7=_0x25bda7-0x0;var _0x3ae81d=_0x3979[_0x25bda7];return _0x3ae81d;};'use strict';var Sequelize=require(_0x9397('0x0'));module[_0x9397('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9397('0x2'),'variable','customVariable',_0x9397('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9397('0x4')]},'keyType':{'type':Sequelize[_0x9397('0x5')](_0x9397('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9397('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9397('0x6')],'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 38af951..7de341b 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 _0xfdbe=['findAll','catch','show','params','merge','find','create','body','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','ZohoField','includeAll','include'];(function(_0x5c66fa,_0x488caf){var _0x35fa93=function(_0x285e0a){while(--_0x285e0a){_0x5c66fa['push'](_0x5c66fa['shift']());}};_0x35fa93(++_0x488caf);}(_0xfdbe,0x1ac));var _0xefdb=function(_0x5c2f5c,_0x2632d7){_0x5c2f5c=_0x5c2f5c-0x0;var _0x230e26=_0xfdbe[_0x5c2f5c];return _0x230e26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xefdb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefdb('0x1'));var moment=require(_0xefdb('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xefdb('0x3'));var util=require(_0xefdb('0x4'));var path=require('path');var sox=require(_0xefdb('0x5'));var csv=require(_0xefdb('0x6'));var ejs=require(_0xefdb('0x7'));var fs=require('fs');var fs_extra=require(_0xefdb('0x8'));var _=require('lodash');var squel=require(_0xefdb('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xefdb('0xa'));var toCsv=require(_0xefdb('0x6'));var querystring=require(_0xefdb('0xb'));var Papa=require(_0xefdb('0xc'));var Redis=require(_0xefdb('0xd'));var authService=require(_0xefdb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xefdb('0xf'));var hardwareService=require(_0xefdb('0x10'));var logger=require(_0xefdb('0x11'))(_0xefdb('0x12'));var utils=require(_0xefdb('0x13'));var config=require(_0xefdb('0x14'));var licenseUtil=require(_0xefdb('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x271a04,_0x2c2697){_0x2c2697=_0x2c2697||0xcc;return function(_0x492a61){if(_0x492a61){return _0x271a04['sendStatus'](_0x2c2697);}return _0x271a04['status'](_0x2c2697)['end']();};}function respondWithResult(_0x4699be,_0x5562ab){_0x5562ab=_0x5562ab||0xc8;return function(_0x45370e){if(_0x45370e){return _0x4699be[_0xefdb('0x16')](_0x5562ab)[_0xefdb('0x17')](_0x45370e);}};}function respondWithFilteredResult(_0x6624a0,_0x1654b6){return function(_0x5728d9){if(_0x5728d9){var _0x43b70c=typeof _0x1654b6[_0xefdb('0x18')]===_0xefdb('0x19')&&typeof _0x1654b6['limit']==='undefined';var _0x1cf873=_0x5728d9[_0xefdb('0x1a')];var _0x2f98df=_0x43b70c?0x0:_0x1654b6[_0xefdb('0x18')];var _0x1b8a1c=_0x43b70c?_0x5728d9['count']:_0x1654b6[_0xefdb('0x18')]+_0x1654b6[_0xefdb('0x1b')];var _0x9bf7b2;if(_0x1b8a1c>=_0x1cf873){_0x1b8a1c=_0x1cf873;_0x9bf7b2=0xc8;}else{_0x9bf7b2=0xce;}_0x6624a0[_0xefdb('0x16')](_0x9bf7b2);return _0x6624a0['set']('Content-Range',_0x2f98df+'-'+_0x1b8a1c+'/'+_0x1cf873)[_0xefdb('0x17')](_0x5728d9);}return null;};}function patchUpdates(_0x419b86){return function(_0x3388df){try{jsonpatch[_0xefdb('0x1c')](_0x3388df,_0x419b86,!![]);}catch(_0xc5c9be){return BPromise['reject'](_0xc5c9be);}return _0x3388df[_0xefdb('0x1d')]();};}function saveUpdates(_0xef0e81,_0x46d6bb){return function(_0x19c972){if(_0x19c972){return _0x19c972[_0xefdb('0x1e')](_0xef0e81)[_0xefdb('0x1f')](function(_0x6c378e){return _0x6c378e;});}return null;};}function removeEntity(_0x232a2b,_0x521af3){return function(_0x393a98){if(_0x393a98){return _0x393a98[_0xefdb('0x20')]()[_0xefdb('0x1f')](function(){_0x232a2b[_0xefdb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57e656,_0x361eb7){return function(_0x3124f0){if(!_0x3124f0){_0x57e656[_0xefdb('0x21')](0x194);}return _0x3124f0;};}function handleError(_0x58a27d,_0x5c772a){_0x5c772a=_0x5c772a||0x1f4;return function(_0x56f13d){logger['error'](_0x56f13d['stack']);if(_0x56f13d[_0xefdb('0x22')]){delete _0x56f13d['name'];}_0x58a27d[_0xefdb('0x16')](_0x5c772a)[_0xefdb('0x23')](_0x56f13d);};}exports[_0xefdb('0x24')]=function(_0x2a40cb,_0x248e72){var _0x4931c5={},_0x2fa07a={},_0x53a3dc={'count':0x0,'rows':[]};var _0x1fe6a2=_['map'](db['ZohoField'][_0xefdb('0x25')],function(_0x4aa032){return{'name':_0x4aa032[_0xefdb('0x26')],'type':_0x4aa032['type'][_0xefdb('0x27')]};});_0x2fa07a[_0xefdb('0x28')]=_[_0xefdb('0x29')](_0x1fe6a2,_0xefdb('0x22'));_0x2fa07a[_0xefdb('0x2a')]=_[_0xefdb('0x2b')](_0x2a40cb[_0xefdb('0x2a')]);_0x2fa07a[_0xefdb('0x2c')]=_[_0xefdb('0x2d')](_0x2fa07a[_0xefdb('0x28')],_0x2fa07a[_0xefdb('0x2a')]);_0x4931c5['attributes']=_['intersection'](_0x2fa07a[_0xefdb('0x28')],qs[_0xefdb('0x2e')](_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x2e')]));_0x4931c5[_0xefdb('0x2f')]=_0x4931c5[_0xefdb('0x2f')][_0xefdb('0x30')]?_0x4931c5[_0xefdb('0x2f')]:_0x2fa07a[_0xefdb('0x28')];if(!_0x2a40cb['query'][_0xefdb('0x31')](_0xefdb('0x32'))){_0x4931c5[_0xefdb('0x1b')]=qs['limit'](_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x1b')]);_0x4931c5[_0xefdb('0x18')]=qs[_0xefdb('0x18')](_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x18')]);}_0x4931c5[_0xefdb('0x33')]=qs[_0xefdb('0x34')](_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x34')]);_0x4931c5[_0xefdb('0x35')]=qs[_0xefdb('0x2c')](_[_0xefdb('0x36')](_0x2a40cb[_0xefdb('0x2a')],_0x2fa07a['filters']),_0x1fe6a2);if(_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x37')]){_0x4931c5['where']=_['merge'](_0x4931c5[_0xefdb('0x35')],{'$or':_[_0xefdb('0x29')](_0x1fe6a2,function(_0x5b0f60){if(_0x5b0f60[_0xefdb('0x38')]!==_0xefdb('0x39')){var _0x236876={};_0x236876[_0x5b0f60['name']]={'$like':'%'+_0x2a40cb[_0xefdb('0x2a')][_0xefdb('0x37')]+'%'};return _0x236876;}})});}_0x4931c5=_['merge']({},_0x4931c5,_0x2a40cb[_0xefdb('0x3a')]);var _0x15cd2f={'where':_0x4931c5[_0xefdb('0x35')]};return db[_0xefdb('0x3b')]['count'](_0x15cd2f)[_0xefdb('0x1f')](function(_0x580a69){_0x53a3dc[_0xefdb('0x1a')]=_0x580a69;if(_0x2a40cb['query'][_0xefdb('0x3c')]){_0x4931c5[_0xefdb('0x3d')]=[{'all':!![]}];}return db[_0xefdb('0x3b')][_0xefdb('0x3e')](_0x4931c5);})['then'](function(_0x249930){_0x53a3dc['rows']=_0x249930;return _0x53a3dc;})[_0xefdb('0x1f')](respondWithFilteredResult(_0x248e72,_0x4931c5))[_0xefdb('0x3f')](handleError(_0x248e72,null));};exports[_0xefdb('0x40')]=function(_0x4b22ed,_0x4c041c){var _0xd41ff8={'raw':!![],'where':{'id':_0x4b22ed[_0xefdb('0x41')]['id']}},_0x1baeb8={};_0x1baeb8[_0xefdb('0x28')]=_[_0xefdb('0x2b')](db['ZohoField'][_0xefdb('0x25')]);_0x1baeb8[_0xefdb('0x2a')]=_[_0xefdb('0x2b')](_0x4b22ed['query']);_0x1baeb8[_0xefdb('0x2c')]=_[_0xefdb('0x2d')](_0x1baeb8['model'],_0x1baeb8[_0xefdb('0x2a')]);_0xd41ff8[_0xefdb('0x2f')]=_[_0xefdb('0x2d')](_0x1baeb8[_0xefdb('0x28')],qs['fields'](_0x4b22ed[_0xefdb('0x2a')]['fields']));_0xd41ff8['attributes']=_0xd41ff8[_0xefdb('0x2f')]['length']?_0xd41ff8[_0xefdb('0x2f')]:_0x1baeb8[_0xefdb('0x28')];if(_0x4b22ed[_0xefdb('0x2a')][_0xefdb('0x3c')]){_0xd41ff8[_0xefdb('0x3d')]=[{'all':!![]}];}_0xd41ff8=_[_0xefdb('0x42')]({},_0xd41ff8,_0x4b22ed[_0xefdb('0x3a')]);return db[_0xefdb('0x3b')][_0xefdb('0x43')](_0xd41ff8)[_0xefdb('0x1f')](handleEntityNotFound(_0x4c041c,null))['then'](respondWithResult(_0x4c041c,null))[_0xefdb('0x3f')](handleError(_0x4c041c,null));};exports[_0xefdb('0x44')]=function(_0x4d0383,_0x58865f){return db[_0xefdb('0x3b')][_0xefdb('0x44')](_0x4d0383['body'],{})['then'](respondWithResult(_0x58865f,0xc9))[_0xefdb('0x3f')](handleError(_0x58865f,null));};exports[_0xefdb('0x1e')]=function(_0x462712,_0x2d1ce7){if(_0x462712[_0xefdb('0x45')]['id']){delete _0x462712[_0xefdb('0x45')]['id'];}return db[_0xefdb('0x3b')][_0xefdb('0x43')]({'where':{'id':_0x462712[_0xefdb('0x41')]['id']}})[_0xefdb('0x1f')](handleEntityNotFound(_0x2d1ce7,null))[_0xefdb('0x1f')](saveUpdates(_0x462712[_0xefdb('0x45')],null))['then'](respondWithResult(_0x2d1ce7,null))[_0xefdb('0x3f')](handleError(_0x2d1ce7,null));};exports[_0xefdb('0x20')]=function(_0x52afba,_0x1cbc01){return db['ZohoField']['find']({'where':{'id':_0x52afba[_0xefdb('0x41')]['id']}})[_0xefdb('0x1f')](handleEntityNotFound(_0x1cbc01,null))['then'](removeEntity(_0x1cbc01,null))[_0xefdb('0x3f')](handleError(_0x1cbc01,null));}; \ No newline at end of file +var _0x82bb=['zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','count','set','Content-Range','json','apply','save','update','then','stack','name','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','ZohoField','includeAll','include','rows','catch','show','rawAttributes','find','create','body','params','destroy','eml-format','rimraf'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x82bb,0xd0));var _0xb82b=function(_0x222601,_0x51d5af){_0x222601=_0x222601-0x0;var _0x101936=_0x82bb[_0x222601];return _0x101936;};'use strict';var emlformat=require(_0xb82b('0x0'));var rimraf=require(_0xb82b('0x1'));var zipdir=require(_0xb82b('0x2'));var jsonpatch=require(_0xb82b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb82b('0x4'));var Mustache=require(_0xb82b('0x5'));var util=require(_0xb82b('0x6'));var path=require(_0xb82b('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb82b('0x8'));var fs=require('fs');var fs_extra=require(_0xb82b('0x9'));var _=require(_0xb82b('0xa'));var squel=require(_0xb82b('0xb'));var crypto=require(_0xb82b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb82b('0xd'));var toCsv=require(_0xb82b('0xe'));var querystring=require(_0xb82b('0xf'));var Papa=require('papaparse');var Redis=require(_0xb82b('0x10'));var authService=require(_0xb82b('0x11'));var qs=require(_0xb82b('0x12'));var as=require(_0xb82b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb82b('0x14'))(_0xb82b('0x15'));var utils=require(_0xb82b('0x16'));var config=require(_0xb82b('0x17'));var licenseUtil=require(_0xb82b('0x18'));var db=require(_0xb82b('0x19'))['db'];function respondWithStatusCode(_0x364741,_0x55933b){_0x55933b=_0x55933b||0xcc;return function(_0x328f14){if(_0x328f14){return _0x364741['sendStatus'](_0x55933b);}return _0x364741[_0xb82b('0x1a')](_0x55933b)[_0xb82b('0x1b')]();};}function respondWithResult(_0x1c9dab,_0x11e447){_0x11e447=_0x11e447||0xc8;return function(_0x5cc378){if(_0x5cc378){return _0x1c9dab['status'](_0x11e447)['json'](_0x5cc378);}};}function respondWithFilteredResult(_0x2ac30b,_0x13799a){return function(_0x3fff1a){if(_0x3fff1a){var _0x55a608=typeof _0x13799a[_0xb82b('0x1c')]==='undefined'&&typeof _0x13799a[_0xb82b('0x1d')]==='undefined';var _0x4c06ff=_0x3fff1a[_0xb82b('0x1e')];var _0x2b3249=_0x55a608?0x0:_0x13799a['offset'];var _0x51cd93=_0x55a608?_0x3fff1a['count']:_0x13799a[_0xb82b('0x1c')]+_0x13799a[_0xb82b('0x1d')];var _0xaf9255;if(_0x51cd93>=_0x4c06ff){_0x51cd93=_0x4c06ff;_0xaf9255=0xc8;}else{_0xaf9255=0xce;}_0x2ac30b[_0xb82b('0x1a')](_0xaf9255);return _0x2ac30b[_0xb82b('0x1f')](_0xb82b('0x20'),_0x2b3249+'-'+_0x51cd93+'/'+_0x4c06ff)[_0xb82b('0x21')](_0x3fff1a);}return null;};}function patchUpdates(_0xba12e2){return function(_0x529c55){try{jsonpatch[_0xb82b('0x22')](_0x529c55,_0xba12e2,!![]);}catch(_0x94447d){return BPromise['reject'](_0x94447d);}return _0x529c55[_0xb82b('0x23')]();};}function saveUpdates(_0x2160a3,_0x64e5a1){return function(_0x491f32){if(_0x491f32){return _0x491f32[_0xb82b('0x24')](_0x2160a3)[_0xb82b('0x25')](function(_0x24cf3d){return _0x24cf3d;});}return null;};}function removeEntity(_0x59767b,_0x49ad94){return function(_0x54766d){if(_0x54766d){return _0x54766d['destroy']()['then'](function(){_0x59767b[_0xb82b('0x1a')](0xcc)[_0xb82b('0x1b')]();});}};}function handleEntityNotFound(_0x4cd362,_0x4a5315){return function(_0x17cee3){if(!_0x17cee3){_0x4cd362['sendStatus'](0x194);}return _0x17cee3;};}function handleError(_0x3a5873,_0x360337){_0x360337=_0x360337||0x1f4;return function(_0x521a2c){logger['error'](_0x521a2c[_0xb82b('0x26')]);if(_0x521a2c[_0xb82b('0x27')]){delete _0x521a2c['name'];}_0x3a5873[_0xb82b('0x1a')](_0x360337)['send'](_0x521a2c);};}exports['index']=function(_0x47c5e6,_0x2378e4){var _0x57cfee={},_0x33a355={},_0x264fe1={'count':0x0,'rows':[]};var _0x2a38ea=_[_0xb82b('0x28')](db['ZohoField']['rawAttributes'],function(_0x375d21){return{'name':_0x375d21[_0xb82b('0x29')],'type':_0x375d21[_0xb82b('0x2a')]['key']};});_0x33a355[_0xb82b('0x2b')]=_[_0xb82b('0x28')](_0x2a38ea,'name');_0x33a355[_0xb82b('0x2c')]=_[_0xb82b('0x2d')](_0x47c5e6[_0xb82b('0x2c')]);_0x33a355[_0xb82b('0x2e')]=_[_0xb82b('0x2f')](_0x33a355[_0xb82b('0x2b')],_0x33a355[_0xb82b('0x2c')]);_0x57cfee[_0xb82b('0x30')]=_['intersection'](_0x33a355[_0xb82b('0x2b')],qs[_0xb82b('0x31')](_0x47c5e6[_0xb82b('0x2c')][_0xb82b('0x31')]));_0x57cfee[_0xb82b('0x30')]=_0x57cfee['attributes'][_0xb82b('0x32')]?_0x57cfee['attributes']:_0x33a355[_0xb82b('0x2b')];if(!_0x47c5e6[_0xb82b('0x2c')][_0xb82b('0x33')](_0xb82b('0x34'))){_0x57cfee[_0xb82b('0x1d')]=qs['limit'](_0x47c5e6[_0xb82b('0x2c')][_0xb82b('0x1d')]);_0x57cfee[_0xb82b('0x1c')]=qs[_0xb82b('0x1c')](_0x47c5e6['query'][_0xb82b('0x1c')]);}_0x57cfee[_0xb82b('0x35')]=qs['sort'](_0x47c5e6[_0xb82b('0x2c')]['sort']);_0x57cfee[_0xb82b('0x36')]=qs[_0xb82b('0x2e')](_['pick'](_0x47c5e6[_0xb82b('0x2c')],_0x33a355[_0xb82b('0x2e')]),_0x2a38ea);if(_0x47c5e6[_0xb82b('0x2c')][_0xb82b('0x37')]){_0x57cfee[_0xb82b('0x36')]=_[_0xb82b('0x38')](_0x57cfee[_0xb82b('0x36')],{'$or':_[_0xb82b('0x28')](_0x2a38ea,function(_0x2a5d2a){if(_0x2a5d2a['type']!=='VIRTUAL'){var _0x163587={};_0x163587[_0x2a5d2a[_0xb82b('0x27')]]={'$like':'%'+_0x47c5e6[_0xb82b('0x2c')]['filter']+'%'};return _0x163587;}})});}_0x57cfee=_[_0xb82b('0x38')]({},_0x57cfee,_0x47c5e6[_0xb82b('0x39')]);var _0x2f0f8c={'where':_0x57cfee[_0xb82b('0x36')]};return db[_0xb82b('0x3a')]['count'](_0x2f0f8c)['then'](function(_0x2d4ff5){_0x264fe1[_0xb82b('0x1e')]=_0x2d4ff5;if(_0x47c5e6['query'][_0xb82b('0x3b')]){_0x57cfee[_0xb82b('0x3c')]=[{'all':!![]}];}return db[_0xb82b('0x3a')]['findAll'](_0x57cfee);})[_0xb82b('0x25')](function(_0x28b34e){_0x264fe1[_0xb82b('0x3d')]=_0x28b34e;return _0x264fe1;})['then'](respondWithFilteredResult(_0x2378e4,_0x57cfee))[_0xb82b('0x3e')](handleError(_0x2378e4,null));};exports[_0xb82b('0x3f')]=function(_0x274a15,_0x27d609){var _0x653eac={'raw':!![],'where':{'id':_0x274a15['params']['id']}},_0x396c4d={};_0x396c4d[_0xb82b('0x2b')]=_[_0xb82b('0x2d')](db[_0xb82b('0x3a')][_0xb82b('0x40')]);_0x396c4d[_0xb82b('0x2c')]=_['keys'](_0x274a15[_0xb82b('0x2c')]);_0x396c4d['filters']=_[_0xb82b('0x2f')](_0x396c4d[_0xb82b('0x2b')],_0x396c4d['query']);_0x653eac[_0xb82b('0x30')]=_['intersection'](_0x396c4d[_0xb82b('0x2b')],qs[_0xb82b('0x31')](_0x274a15[_0xb82b('0x2c')][_0xb82b('0x31')]));_0x653eac[_0xb82b('0x30')]=_0x653eac[_0xb82b('0x30')][_0xb82b('0x32')]?_0x653eac['attributes']:_0x396c4d[_0xb82b('0x2b')];if(_0x274a15[_0xb82b('0x2c')][_0xb82b('0x3b')]){_0x653eac['include']=[{'all':!![]}];}_0x653eac=_[_0xb82b('0x38')]({},_0x653eac,_0x274a15[_0xb82b('0x39')]);return db[_0xb82b('0x3a')][_0xb82b('0x41')](_0x653eac)[_0xb82b('0x25')](handleEntityNotFound(_0x27d609,null))[_0xb82b('0x25')](respondWithResult(_0x27d609,null))[_0xb82b('0x3e')](handleError(_0x27d609,null));};exports[_0xb82b('0x42')]=function(_0x44e610,_0x2e6143){return db[_0xb82b('0x3a')][_0xb82b('0x42')](_0x44e610[_0xb82b('0x43')],{})['then'](respondWithResult(_0x2e6143,0xc9))[_0xb82b('0x3e')](handleError(_0x2e6143,null));};exports[_0xb82b('0x24')]=function(_0x27071d,_0x4a2cdd){if(_0x27071d[_0xb82b('0x43')]['id']){delete _0x27071d[_0xb82b('0x43')]['id'];}return db[_0xb82b('0x3a')][_0xb82b('0x41')]({'where':{'id':_0x27071d[_0xb82b('0x44')]['id']}})[_0xb82b('0x25')](handleEntityNotFound(_0x4a2cdd,null))['then'](saveUpdates(_0x27071d['body'],null))['then'](respondWithResult(_0x4a2cdd,null))[_0xb82b('0x3e')](handleError(_0x4a2cdd,null));};exports[_0xb82b('0x45')]=function(_0x5a1892,_0x4a32d0){return db[_0xb82b('0x3a')][_0xb82b('0x41')]({'where':{'id':_0x5a1892[_0xb82b('0x44')]['id']}})[_0xb82b('0x25')](handleEntityNotFound(_0x4a32d0,null))[_0xb82b('0x25')](removeEntity(_0x4a32d0,null))['catch'](handleError(_0x4a32d0,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0014943..388dbbd 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 _0xacf4=['bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','../../config/logger','api','moment'];(function(_0x2752c9,_0x4a7334){var _0x2b4a9d=function(_0xfa3124){while(--_0xfa3124){_0x2752c9['push'](_0x2752c9['shift']());}};_0x2b4a9d(++_0x4a7334);}(_0xacf4,0xe7));var _0x4acf=function(_0x3e6b83,_0x224b71){_0x3e6b83=_0x3e6b83-0x0;var _0x599977=_0xacf4[_0x3e6b83];return _0x599977;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1a85=['rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','idField','../../config/logger','api','moment','path'];(function(_0x3d0369,_0x5991ec){var _0x395c99=function(_0x555d02){while(--_0x555d02){_0x3d0369['push'](_0x3d0369['shift']());}};_0x395c99(++_0x5991ec);}(_0x1a85,0x178));var _0x51a8=function(_0x5b5af1,_0x1db01b){_0x5b5af1=_0x5b5af1-0x0;var _0x45ab7b=_0x1a85[_0x5b5af1];return _0x45ab7b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intZohoField.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x51a8('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index d6b4878..523759d 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 _0x10f8=['error','code','message','ZohoField,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','stringify'];(function(_0x134299,_0x42bd37){var _0xfc4c8c=function(_0xf76372){while(--_0xf76372){_0x134299['push'](_0x134299['shift']());}};_0xfc4c8c(++_0x42bd37);}(_0x10f8,0x159));var _0x810f=function(_0x3df685,_0x4439dd){_0x3df685=_0x3df685-0x0;var _0x219d6d=_0x10f8[_0x3df685];return _0x219d6d;};'use strict';var _=require('lodash');var util=require(_0x810f('0x0'));var moment=require(_0x810f('0x1'));var BPromise=require(_0x810f('0x2'));var rs=require(_0x810f('0x3'));var fs=require('fs');var Redis=require(_0x810f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x810f('0x5'));var logger=require(_0x810f('0x6'))(_0x810f('0x7'));var config=require(_0x810f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x810f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4496a3,_0x108353,_0x5236b4){return new BPromise(function(_0x16b168,_0x2ca6c4){return client[_0x810f('0xa')](_0x4496a3,_0x5236b4)[_0x810f('0xb')](function(_0x12da3f){logger[_0x810f('0xc')]('ZohoField,\x20%s,\x20%s',_0x108353,'request\x20sent');logger[_0x810f('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x108353,'request\x20sent',JSON[_0x810f('0xe')](_0x12da3f));if(_0x12da3f['error']){if(_0x12da3f[_0x810f('0xf')][_0x810f('0x10')]===0x1f4){logger[_0x810f('0xf')]('ZohoField,\x20%s,\x20%s',_0x108353,_0x12da3f[_0x810f('0xf')]['message']);return _0x2ca6c4(_0x12da3f['error'][_0x810f('0x11')]);}logger[_0x810f('0xf')]('ZohoField,\x20%s,\x20%s',_0x108353,_0x12da3f['error'][_0x810f('0x11')]);return _0x16b168(_0x12da3f[_0x810f('0xf')][_0x810f('0x11')]);}else{logger['info'](_0x810f('0x12'),_0x108353,'request\x20sent');_0x16b168(_0x12da3f[_0x810f('0x13')][_0x810f('0x11')]);}})['catch'](function(_0x2b97df){logger['error'](_0x810f('0x12'),_0x108353,_0x2b97df);_0x2ca6c4(_0x2b97df);});});} \ No newline at end of file +var _0xd868=['ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd868,0xee));var _0x8d86=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xd868[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x8d86('0x0'));var util=require(_0x8d86('0x1'));var moment=require('moment');var BPromise=require(_0x8d86('0x2'));var rs=require(_0x8d86('0x3'));var fs=require('fs');var Redis=require(_0x8d86('0x4'));var db=require(_0x8d86('0x5'))['db'];var utils=require(_0x8d86('0x6'));var logger=require('../../config/logger')(_0x8d86('0x7'));var config=require(_0x8d86('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8d86('0x9')][_0x8d86('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56aecb,_0x251ba8,_0x43c6c6){return new BPromise(function(_0x1df646,_0x378dc0){return client[_0x8d86('0xb')](_0x56aecb,_0x43c6c6)[_0x8d86('0xc')](function(_0x2eb618){logger[_0x8d86('0xd')](_0x8d86('0xe'),_0x251ba8,'request\x20sent');logger['debug'](_0x8d86('0xf'),_0x251ba8,_0x8d86('0x10'),JSON[_0x8d86('0x11')](_0x2eb618));if(_0x2eb618['error']){if(_0x2eb618[_0x8d86('0x12')][_0x8d86('0x13')]===0x1f4){logger[_0x8d86('0x12')]('ZohoField,\x20%s,\x20%s',_0x251ba8,_0x2eb618['error']['message']);return _0x378dc0(_0x2eb618[_0x8d86('0x12')]['message']);}logger[_0x8d86('0x12')](_0x8d86('0xe'),_0x251ba8,_0x2eb618[_0x8d86('0x12')]['message']);return _0x1df646(_0x2eb618[_0x8d86('0x12')]['message']);}else{logger['info'](_0x8d86('0xe'),_0x251ba8,_0x8d86('0x10'));_0x1df646(_0x2eb618[_0x8d86('0x14')][_0x8d86('0x15')]);}})[_0x8d86('0x16')](function(_0x563f6c){logger[_0x8d86('0x12')](_0x8d86('0xe'),_0x251ba8,_0x563f6c);_0x378dc0(_0x563f6c);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c2673ff..a8e002f 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(_0x4dccfb,_0x5c9f92){var _0x20bc89=function(_0x1719cf){while(--_0x1719cf){_0x4dccfb['push'](_0x4dccfb['shift']());}};_0x20bc89(++_0x5c9f92);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2ac1ea,_0x170e49){var _0x40e762=function(_0x16bdfa){while(--_0x16bdfa){_0x2ac1ea['push'](_0x2ac1ea['shift']());}};_0x40e762(++_0x170e49);}(_0xedd9,0xfc));var _0x9edd=function(_0x55af21,_0x5ad23b){_0x55af21=_0x55af21-0x0;var _0x5bcc19=_0xedd9[_0x55af21];return _0x5bcc19;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ff9c155..4497091 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 _0xbb43=['app.js','STRING','INTEGER','BOOLEAN','sequelize','exports','unique_name_and_version'];(function(_0x4e7db4,_0x3a607d){var _0x5e3b2c=function(_0x423d1b){while(--_0x423d1b){_0x4e7db4['push'](_0x4e7db4['shift']());}};_0x5e3b2c(++_0x3a607d);}(_0xbb43,0x10e));var _0x3bb4=function(_0x2f4d41,_0x525047){_0x2f4d41=_0x2f4d41-0x0;var _0x3b0bb2=_0xbb43[_0x2f4d41];return _0x3b0bb2;};'use strict';var Sequelize=require(_0x3bb4('0x0'));module[_0x3bb4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3bb4('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x3bb4('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3bb4('0x4')]},'type':{'type':Sequelize[_0x3bb4('0x4')]},'size':{'type':Sequelize[_0x3bb4('0x5')]},'active':{'type':Sequelize[_0x3bb4('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x3bb4('0x4')]},'state':{'type':Sequelize[_0x3bb4('0x4')],'unique':'state'},'description':{'type':Sequelize[_0x3bb4('0x4')]},'title':{'type':Sequelize[_0x3bb4('0x4')]},'remoteUri':{'type':Sequelize[_0x3bb4('0x4')]},'link':{'type':Sequelize[_0x3bb4('0x4')],'defaultValue':'#'}}; \ No newline at end of file +var _0xdfcb=['STRING','unique_name_and_version','BOOLEAN','state','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdfcb,0x10d));var _0xbdfc=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0xdfcb[_0x1bb58c];return _0x277586;};'use strict';var Sequelize=require(_0xbdfc('0x0'));module['exports']={'name':{'type':Sequelize[_0xbdfc('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbdfc('0x2')},'main':{'type':Sequelize[_0xbdfc('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xbdfc('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xbdfc('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0xbdfc('0x1')]},'logo':{'type':Sequelize[_0xbdfc('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0xbdfc('0x4')},'description':{'type':Sequelize[_0xbdfc('0x1')]},'title':{'type':Sequelize[_0xbdfc('0x1')]},'remoteUri':{'type':Sequelize[_0xbdfc('0x1')]},'link':{'type':Sequelize[_0xbdfc('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index a072bb8..263d2fe 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 _0x01d9=['map','Integration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x2dc3ec,_0x42a72a){var _0x408e96=function(_0x1b0ed4){while(--_0x1b0ed4){_0x2dc3ec['push'](_0x2dc3ec['shift']());}};_0x408e96(++_0x42a72a);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['Integration'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['Integration'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file +var _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x524e,0x15e));var _0xe524=function(_0x299da9,_0x44fe01){_0x299da9=_0x299da9-0x0;var _0x3af1bd=_0x524e[_0x299da9];return _0x3af1bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index b36fe86..18c1f9a 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 _0xf995=['../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x52e83e,_0x46f4e2){var _0x5bf581=function(_0x37f392){while(--_0x37f392){_0x52e83e['push'](_0x52e83e['shift']());}};_0x5bf581(++_0x46f4e2);}(_0xf995,0x114));var _0x5f99=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf995[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x5f99('0x0'));var util=require(_0x5f99('0x1'));var logger=require(_0x5f99('0x2'))(_0x5f99('0x3'));var moment=require(_0x5f99('0x4'));var BPromise=require(_0x5f99('0x5'));var rp=require(_0x5f99('0x6'));var fs=require('fs');var path=require(_0x5f99('0x7'));var rimraf=require(_0x5f99('0x8'));var config=require(_0x5f99('0x9'));var attributes=require(_0x5f99('0xa'));module[_0x5f99('0xb')]=function(_0x32229c,_0xb7d15a){return _0x32229c[_0x5f99('0xc')](_0x5f99('0xd'),attributes,{'tableName':_0x5f99('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f5f=['request-promise','path','rimraf','../../config/environment','./integration.attributes','define','integrations','lodash','util','api','moment','bluebird'];(function(_0x3b5317,_0x37b6c5){var _0x40387f=function(_0x54634d){while(--_0x54634d){_0x3b5317['push'](_0x3b5317['shift']());}};_0x40387f(++_0x37b6c5);}(_0x2f5f,0x13f));var _0xf2f5=function(_0x38a562,_0x17b6a7){_0x38a562=_0x38a562-0x0;var _0x38fc9c=_0x2f5f[_0x38a562];return _0x38fc9c;};'use strict';var _=require(_0xf2f5('0x0'));var util=require(_0xf2f5('0x1'));var logger=require('../../config/logger')(_0xf2f5('0x2'));var moment=require(_0xf2f5('0x3'));var BPromise=require(_0xf2f5('0x4'));var rp=require(_0xf2f5('0x5'));var fs=require('fs');var path=require(_0xf2f5('0x6'));var rimraf=require(_0xf2f5('0x7'));var config=require(_0xf2f5('0x8'));var attributes=require(_0xf2f5('0x9'));module['exports']=function(_0x5d08d4,_0x3f1543){return _0x5d08d4[_0xf2f5('0xa')]('Integration',attributes,{'tableName':_0xf2f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index dcdf21a..11468fe 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 _0xef0f=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x147c56,_0x515b2f){var _0x375cb9=function(_0x25f164){while(--_0x25f164){_0x147c56['push'](_0x147c56['shift']());}};_0x375cb9(++_0x515b2f);}(_0xef0f,0x168));var _0xfef0=function(_0x4eb1b7,_0x110795){_0x4eb1b7=_0x4eb1b7-0x0;var _0x2cda9e=_0xef0f[_0x4eb1b7];return _0x2cda9e;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('Integration,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('Integration,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4ca160,_0x14886c){var _0x303ae9=function(_0xa1d94c){while(--_0xa1d94c){_0x4ca160['push'](_0x4ca160['shift']());}};_0x303ae9(++_0x14886c);}(_0x2ef3,0xba));var _0x32ef=function(_0x21feeb,_0x3dfdb8){_0x21feeb=_0x21feeb-0x0;var _0x5947f6=_0x2ef3[_0x21feeb];return _0x5947f6;};'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')]('Integration,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('Integration,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 7ae8d65..8c69e78 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x5ae761,_0x9afc7c){var _0x42add3=function(_0x5e0fa8){while(--_0x5e0fa8){_0x5ae761['push'](_0x5ae761['shift']());}};_0x42add3(++_0x9afc7c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x357696,_0x15ccf){_0x357696=_0x357696-0x0;var _0x4bf472=_0x9f0e[_0x357696];return _0x4bf472;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x23a20c,_0x3397b9){var _0x4bcff7=function(_0x4a5766){while(--_0x4a5766){_0x23a20c['push'](_0x23a20c['shift']());}};_0x4bcff7(++_0x3397b9);}(_0x2ef3,0xba));var _0x32ef=function(_0x44270d,_0x37809b){_0x44270d=_0x44270d-0x0;var _0x4b91de=_0x2ef3[_0x44270d];return _0x4b91de;};'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('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 951f9fd..25ce199 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 _0x17eb=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING','RECEIVED'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x17eb,0x1ae));var _0xb17e=function(_0x3c0873,_0x190c92){_0x3c0873=_0x3c0873-0x0;var _0x101cfc=_0x17eb[_0x3c0873];return _0x101cfc;};'use strict';var Sequelize=require(_0xb17e('0x0'));module[_0xb17e('0x1')]={'integration':{'type':Sequelize[_0xb17e('0x2')]},'eventChannel':{'type':Sequelize[_0xb17e('0x2')]},'exitStatus':{'type':Sequelize[_0xb17e('0x2')]},'ticketId':{'type':Sequelize[_0xb17e('0x2')]},'integrationId':{'type':Sequelize[_0xb17e('0x3')]},'contacts':{'type':Sequelize[_0xb17e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb17e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb17e('0x2')]},'interface':{'type':Sequelize[_0xb17e('0x2')]},'membername':{'type':Sequelize[_0xb17e('0x2')]},'agentcalledAt':{'type':Sequelize[_0xb17e('0x4')]},'agentconnectAt':{'type':Sequelize[_0xb17e('0x4')]},'holdtime':{'type':Sequelize[_0xb17e('0x3')]},'agentcomplete':{'type':Sequelize[_0xb17e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xb17e('0x4')]},'talktime':{'type':Sequelize[_0xb17e('0x3')]},'agentacw':{'type':Sequelize[_0xb17e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb17e('0x3')]},'reason':{'type':Sequelize[_0xb17e('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xb17e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb17e('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xb17e('0x2')]},'channel':{'type':Sequelize[_0xb17e('0x2')]},'channelstate':{'type':Sequelize[_0xb17e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xb17e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb17e('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb17e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb17e('0x2')]},'priority':{'type':Sequelize[_0xb17e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb17e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb17e('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xb17e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xb17e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb17e('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb17e('0x2')]},'destcontext':{'type':Sequelize[_0xb17e('0x2')]},'destexten':{'type':Sequelize[_0xb17e('0x2')]},'destpriority':{'type':Sequelize[_0xb17e('0x2')]},'destuniqueid':{'type':Sequelize[_0xb17e('0x2')]},'messageId':{'type':Sequelize[_0xb17e('0x2')]},'inReplyTo':{'type':Sequelize[_0xb17e('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xb17e('0x2')]},'to':{'type':Sequelize[_0xb17e('0x2')]},'cc':{'type':Sequelize[_0xb17e('0x2')]},'attachment':{'type':Sequelize[_0xb17e('0x6')]},'html':{'type':Sequelize[_0xb17e('0x6')]},'text':{'type':Sequelize[_0xb17e('0x6')]},'status':{'type':Sequelize['ENUM'](_0xb17e('0x7'),_0xb17e('0x8'),_0xb17e('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xb17e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x33f9=['RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','SENDING'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x33f9,0x66));var _0x933f=function(_0x153c4e,_0x35a6c4){_0x153c4e=_0x153c4e-0x0;var _0x19e328=_0x33f9[_0x153c4e];return _0x19e328;};'use strict';var Sequelize=require(_0x933f('0x0'));module['exports']={'integration':{'type':Sequelize[_0x933f('0x1')]},'eventChannel':{'type':Sequelize[_0x933f('0x1')]},'exitStatus':{'type':Sequelize[_0x933f('0x1')]},'ticketId':{'type':Sequelize[_0x933f('0x1')]},'integrationId':{'type':Sequelize[_0x933f('0x2')]},'contacts':{'type':Sequelize[_0x933f('0x1')]},'uniqueid':{'type':Sequelize[_0x933f('0x1')]},'calleridnum':{'type':Sequelize[_0x933f('0x1')]},'calleridname':{'type':Sequelize[_0x933f('0x1')]},'queue':{'type':Sequelize[_0x933f('0x1')]},'interface':{'type':Sequelize[_0x933f('0x1')]},'membername':{'type':Sequelize[_0x933f('0x1')]},'agentcalledAt':{'type':Sequelize[_0x933f('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x933f('0x2')]},'agentcomplete':{'type':Sequelize[_0x933f('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x933f('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x933f('0x2')]},'reason':{'type':Sequelize[_0x933f('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x933f('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x933f('0x3')]},'lastevent':{'type':Sequelize[_0x933f('0x1')]},'channel':{'type':Sequelize[_0x933f('0x1')]},'channelstate':{'type':Sequelize[_0x933f('0x2')]},'channelstatedesc':{'type':Sequelize[_0x933f('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x933f('0x1')]},'language':{'type':Sequelize[_0x933f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x933f('0x1')]},'exten':{'type':Sequelize[_0x933f('0x1')]},'priority':{'type':Sequelize[_0x933f('0x1')]},'destchannel':{'type':Sequelize[_0x933f('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x933f('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x933f('0x1')]},'destlanguage':{'type':Sequelize[_0x933f('0x1')]},'destaccountcode':{'type':Sequelize[_0x933f('0x1')]},'destcontext':{'type':Sequelize[_0x933f('0x1')]},'destexten':{'type':Sequelize[_0x933f('0x1')]},'destpriority':{'type':Sequelize[_0x933f('0x1')]},'destuniqueid':{'type':Sequelize[_0x933f('0x1')]},'messageId':{'type':Sequelize[_0x933f('0x1')]},'inReplyTo':{'type':Sequelize[_0x933f('0x1')]},'subject':{'type':Sequelize[_0x933f('0x1')]},'from':{'type':Sequelize[_0x933f('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x933f('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x933f('0x5')]},'text':{'type':Sequelize[_0x933f('0x5')]},'status':{'type':Sequelize['ENUM'](_0x933f('0x6'),_0x933f('0x7'),_0x933f('0x8'),_0x933f('0x9'))},'url':{'type':Sequelize[_0x933f('0x1')]},'app':{'type':Sequelize[_0x933f('0x1')]},'appdata':{'type':Sequelize[_0x933f('0x1')]},'projectId':{'type':Sequelize[_0x933f('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 0d14008..cfcb364 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 _0x5679=['catch','params','keys','length','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','merge','VIRTUAL','IntegrationReport','includeAll','include','findAll'];(function(_0x438bf9,_0x47116c){var _0xc10627=function(_0x20b74b){while(--_0x20b74b){_0x438bf9['push'](_0x438bf9['shift']());}};_0xc10627(++_0x47116c);}(_0x5679,0x99));var _0x9567=function(_0x57a301,_0x20cd42){_0x57a301=_0x57a301-0x0;var _0x46ed86=_0x5679[_0x57a301];return _0x46ed86;};'use strict';var emlformat=require(_0x9567('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9567('0x1'));var jsonpatch=require(_0x9567('0x2'));var rp=require(_0x9567('0x3'));var moment=require('moment');var BPromise=require(_0x9567('0x4'));var Mustache=require(_0x9567('0x5'));var util=require('util');var path=require(_0x9567('0x6'));var sox=require(_0x9567('0x7'));var csv=require(_0x9567('0x8'));var ejs=require(_0x9567('0x9'));var fs=require('fs');var fs_extra=require(_0x9567('0xa'));var _=require('lodash');var squel=require(_0x9567('0xb'));var crypto=require(_0x9567('0xc'));var jsforce=require(_0x9567('0xd'));var deskjs=require(_0x9567('0xe'));var toCsv=require(_0x9567('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9567('0xf'));var qs=require(_0x9567('0x10'));var as=require(_0x9567('0x11'));var hardwareService=require(_0x9567('0x12'));var logger=require(_0x9567('0x13'))(_0x9567('0x14'));var utils=require(_0x9567('0x15'));var config=require(_0x9567('0x16'));var licenseUtil=require(_0x9567('0x17'));var db=require(_0x9567('0x18'))['db'];function respondWithStatusCode(_0x1e56e5,_0xb11204){_0xb11204=_0xb11204||0xcc;return function(_0x1e8341){if(_0x1e8341){return _0x1e56e5[_0x9567('0x19')](_0xb11204);}return _0x1e56e5[_0x9567('0x1a')](_0xb11204)[_0x9567('0x1b')]();};}function respondWithResult(_0x3398f1,_0x134cb8){_0x134cb8=_0x134cb8||0xc8;return function(_0xc75189){if(_0xc75189){return _0x3398f1[_0x9567('0x1a')](_0x134cb8)['json'](_0xc75189);}};}function respondWithFilteredResult(_0x4bf742,_0x14a15e){return function(_0x41b9f8){if(_0x41b9f8){var _0x8fce14=typeof _0x14a15e[_0x9567('0x1c')]===_0x9567('0x1d')&&typeof _0x14a15e['limit']==='undefined';var _0xd884a0=_0x41b9f8[_0x9567('0x1e')];var _0x3fb68b=_0x8fce14?0x0:_0x14a15e[_0x9567('0x1c')];var _0x295cfe=_0x8fce14?_0x41b9f8[_0x9567('0x1e')]:_0x14a15e[_0x9567('0x1c')]+_0x14a15e[_0x9567('0x1f')];var _0x27fb85;if(_0x295cfe>=_0xd884a0){_0x295cfe=_0xd884a0;_0x27fb85=0xc8;}else{_0x27fb85=0xce;}_0x4bf742[_0x9567('0x1a')](_0x27fb85);return _0x4bf742[_0x9567('0x20')]('Content-Range',_0x3fb68b+'-'+_0x295cfe+'/'+_0xd884a0)[_0x9567('0x21')](_0x41b9f8);}return null;};}function patchUpdates(_0x4fc75b){return function(_0xb78458){try{jsonpatch[_0x9567('0x22')](_0xb78458,_0x4fc75b,!![]);}catch(_0x55ebab){return BPromise['reject'](_0x55ebab);}return _0xb78458['save']();};}function saveUpdates(_0x597c11,_0x354367){return function(_0x5d521e){if(_0x5d521e){return _0x5d521e[_0x9567('0x23')](_0x597c11)['then'](function(_0x16b56f){return _0x16b56f;});}return null;};}function removeEntity(_0x1592f8,_0x26a982){return function(_0x5a7f4d){if(_0x5a7f4d){return _0x5a7f4d[_0x9567('0x24')]()[_0x9567('0x25')](function(){_0x1592f8[_0x9567('0x1a')](0xcc)[_0x9567('0x1b')]();});}};}function handleEntityNotFound(_0x263c40,_0x297617){return function(_0x5beee4){if(!_0x5beee4){_0x263c40[_0x9567('0x19')](0x194);}return _0x5beee4;};}function handleError(_0x4c4205,_0x636c47){_0x636c47=_0x636c47||0x1f4;return function(_0x3ae5d7){logger['error'](_0x3ae5d7[_0x9567('0x26')]);if(_0x3ae5d7['name']){delete _0x3ae5d7[_0x9567('0x27')];}_0x4c4205[_0x9567('0x1a')](_0x636c47)[_0x9567('0x28')](_0x3ae5d7);};}exports[_0x9567('0x29')]=function(_0xb54f72,_0x1ac91b){var _0x2391e3={},_0x5ebd63={},_0x231dc8={'count':0x0,'rows':[]};var _0x17e0c3=_[_0x9567('0x2a')](db['IntegrationReport'][_0x9567('0x2b')],function(_0x37c145){return{'name':_0x37c145[_0x9567('0x2c')],'type':_0x37c145[_0x9567('0x2d')][_0x9567('0x2e')]};});_0x5ebd63['model']=_[_0x9567('0x2a')](_0x17e0c3,_0x9567('0x27'));_0x5ebd63[_0x9567('0x2f')]=_['keys'](_0xb54f72[_0x9567('0x2f')]);_0x5ebd63[_0x9567('0x30')]=_[_0x9567('0x31')](_0x5ebd63[_0x9567('0x32')],_0x5ebd63['query']);_0x2391e3['attributes']=_[_0x9567('0x31')](_0x5ebd63[_0x9567('0x32')],qs[_0x9567('0x33')](_0xb54f72[_0x9567('0x2f')][_0x9567('0x33')]));_0x2391e3[_0x9567('0x34')]=_0x2391e3[_0x9567('0x34')]['length']?_0x2391e3['attributes']:_0x5ebd63[_0x9567('0x32')];if(!_0xb54f72[_0x9567('0x2f')]['hasOwnProperty'](_0x9567('0x35'))){_0x2391e3[_0x9567('0x1f')]=qs[_0x9567('0x1f')](_0xb54f72[_0x9567('0x2f')][_0x9567('0x1f')]);_0x2391e3[_0x9567('0x1c')]=qs[_0x9567('0x1c')](_0xb54f72['query'][_0x9567('0x1c')]);}_0x2391e3['order']=qs[_0x9567('0x36')](_0xb54f72['query']['sort']);_0x2391e3[_0x9567('0x37')]=qs[_0x9567('0x30')](_[_0x9567('0x38')](_0xb54f72[_0x9567('0x2f')],_0x5ebd63[_0x9567('0x30')]),_0x17e0c3);if(_0xb54f72[_0x9567('0x2f')]['filter']){_0x2391e3[_0x9567('0x37')]=_[_0x9567('0x39')](_0x2391e3[_0x9567('0x37')],{'$or':_[_0x9567('0x2a')](_0x17e0c3,function(_0x2b6467){if(_0x2b6467[_0x9567('0x2d')]!==_0x9567('0x3a')){var _0x20ea27={};_0x20ea27[_0x2b6467['name']]={'$like':'%'+_0xb54f72[_0x9567('0x2f')]['filter']+'%'};return _0x20ea27;}})});}_0x2391e3=_[_0x9567('0x39')]({},_0x2391e3,_0xb54f72['options']);var _0x41b39a={'where':_0x2391e3[_0x9567('0x37')]};return db[_0x9567('0x3b')]['count'](_0x41b39a)[_0x9567('0x25')](function(_0x3a3a08){_0x231dc8[_0x9567('0x1e')]=_0x3a3a08;if(_0xb54f72[_0x9567('0x2f')][_0x9567('0x3c')]){_0x2391e3[_0x9567('0x3d')]=[{'all':!![]}];}return db['IntegrationReport'][_0x9567('0x3e')](_0x2391e3);})[_0x9567('0x25')](function(_0x4ab08c){_0x231dc8['rows']=_0x4ab08c;return _0x231dc8;})[_0x9567('0x25')](respondWithFilteredResult(_0x1ac91b,_0x2391e3))[_0x9567('0x3f')](handleError(_0x1ac91b,null));};exports['show']=function(_0x1eb2bd,_0xa95af8){var _0x4a9719={'raw':![],'where':{'id':_0x1eb2bd[_0x9567('0x40')]['id']}},_0x22baaf={};_0x22baaf[_0x9567('0x32')]=_[_0x9567('0x41')](db[_0x9567('0x3b')]['rawAttributes']);_0x22baaf[_0x9567('0x2f')]=_[_0x9567('0x41')](_0x1eb2bd['query']);_0x22baaf[_0x9567('0x30')]=_[_0x9567('0x31')](_0x22baaf[_0x9567('0x32')],_0x22baaf[_0x9567('0x2f')]);_0x4a9719[_0x9567('0x34')]=_['intersection'](_0x22baaf[_0x9567('0x32')],qs[_0x9567('0x33')](_0x1eb2bd[_0x9567('0x2f')][_0x9567('0x33')]));_0x4a9719['attributes']=_0x4a9719[_0x9567('0x34')][_0x9567('0x42')]?_0x4a9719['attributes']:_0x22baaf['model'];if(_0x1eb2bd[_0x9567('0x2f')][_0x9567('0x3c')]){_0x4a9719[_0x9567('0x3d')]=[{'all':!![]}];}_0x4a9719=_[_0x9567('0x39')]({},_0x4a9719,_0x1eb2bd[_0x9567('0x43')]);return db[_0x9567('0x3b')][_0x9567('0x44')](_0x4a9719)[_0x9567('0x25')](handleEntityNotFound(_0xa95af8,null))[_0x9567('0x25')](respondWithResult(_0xa95af8,null))['catch'](handleError(_0xa95af8,null));};exports[_0x9567('0x45')]=function(_0x7d7331,_0x50d01e){return db[_0x9567('0x3b')]['create'](_0x7d7331[_0x9567('0x46')],{})['then'](respondWithResult(_0x50d01e,0xc9))[_0x9567('0x3f')](handleError(_0x50d01e,null));};exports['update']=function(_0x43bdfa,_0x419c75){if(_0x43bdfa[_0x9567('0x46')]['id']){delete _0x43bdfa['body']['id'];}return db[_0x9567('0x3b')][_0x9567('0x44')]({'where':{'id':_0x43bdfa['params']['id']}})[_0x9567('0x25')](handleEntityNotFound(_0x419c75,null))[_0x9567('0x25')](saveUpdates(_0x43bdfa[_0x9567('0x46')],null))[_0x9567('0x25')](respondWithResult(_0x419c75,null))['catch'](handleError(_0x419c75,null));};exports['destroy']=function(_0x81c1c,_0x1d3f77){return db['IntegrationReport'][_0x9567('0x44')]({'where':{'id':_0x81c1c[_0x9567('0x40')]['id']}})[_0x9567('0x25')](handleEntityNotFound(_0x1d3f77,null))[_0x9567('0x25')](removeEntity(_0x1d3f77,null))[_0x9567('0x3f')](handleError(_0x1d3f77,null));};exports['describe']=function(_0x40d1d8,_0x51e362){return db[_0x9567('0x3b')][_0x9567('0x47')]()[_0x9567('0x25')](respondWithResult(_0x51e362,null))[_0x9567('0x3f')](handleError(_0x51e362,null));}; \ No newline at end of file +var _0x0044=['show','params','options','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','include','findAll','catch'];(function(_0x2d2ea1,_0x4e3a1f){var _0xea1275=function(_0x4310be){while(--_0x4310be){_0x2d2ea1['push'](_0x2d2ea1['shift']());}};_0xea1275(++_0x4e3a1f);}(_0x0044,0x16e));var _0x4004=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x0044[_0x58db4e];return _0x40139a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4004('0x0'));var zipdir=require(_0x4004('0x1'));var jsonpatch=require(_0x4004('0x2'));var rp=require(_0x4004('0x3'));var moment=require(_0x4004('0x4'));var BPromise=require(_0x4004('0x5'));var Mustache=require(_0x4004('0x6'));var util=require(_0x4004('0x7'));var path=require(_0x4004('0x8'));var sox=require('sox');var csv=require(_0x4004('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4004('0xa'));var _=require(_0x4004('0xb'));var squel=require(_0x4004('0xc'));var crypto=require('crypto');var jsforce=require(_0x4004('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4004('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4004('0xe'));var authService=require(_0x4004('0xf'));var qs=require(_0x4004('0x10'));var as=require(_0x4004('0x11'));var hardwareService=require(_0x4004('0x12'));var logger=require('../../config/logger')(_0x4004('0x13'));var utils=require('../../config/utils');var config=require(_0x4004('0x14'));var licenseUtil=require(_0x4004('0x15'));var db=require(_0x4004('0x16'))['db'];function respondWithStatusCode(_0x48910e,_0x3e53d6){_0x3e53d6=_0x3e53d6||0xcc;return function(_0xf8b508){if(_0xf8b508){return _0x48910e[_0x4004('0x17')](_0x3e53d6);}return _0x48910e[_0x4004('0x18')](_0x3e53d6)[_0x4004('0x19')]();};}function respondWithResult(_0x5b8858,_0x510d2){_0x510d2=_0x510d2||0xc8;return function(_0x885e8){if(_0x885e8){return _0x5b8858[_0x4004('0x18')](_0x510d2)['json'](_0x885e8);}};}function respondWithFilteredResult(_0xf7cf72,_0x1e67cb){return function(_0x3fc446){if(_0x3fc446){var _0x314144=typeof _0x1e67cb['offset']===_0x4004('0x1a')&&typeof _0x1e67cb[_0x4004('0x1b')]===_0x4004('0x1a');var _0x345651=_0x3fc446['count'];var _0x43e4d7=_0x314144?0x0:_0x1e67cb['offset'];var _0x5a794c=_0x314144?_0x3fc446[_0x4004('0x1c')]:_0x1e67cb[_0x4004('0x1d')]+_0x1e67cb[_0x4004('0x1b')];var _0x13043d;if(_0x5a794c>=_0x345651){_0x5a794c=_0x345651;_0x13043d=0xc8;}else{_0x13043d=0xce;}_0xf7cf72['status'](_0x13043d);return _0xf7cf72[_0x4004('0x1e')]('Content-Range',_0x43e4d7+'-'+_0x5a794c+'/'+_0x345651)['json'](_0x3fc446);}return null;};}function patchUpdates(_0x4d5715){return function(_0x34dcad){try{jsonpatch[_0x4004('0x1f')](_0x34dcad,_0x4d5715,!![]);}catch(_0x1df0f7){return BPromise['reject'](_0x1df0f7);}return _0x34dcad[_0x4004('0x20')]();};}function saveUpdates(_0x536948,_0x1d1251){return function(_0x48eafa){if(_0x48eafa){return _0x48eafa[_0x4004('0x21')](_0x536948)[_0x4004('0x22')](function(_0x1bc184){return _0x1bc184;});}return null;};}function removeEntity(_0x33abb4,_0x1958fe){return function(_0x3269b9){if(_0x3269b9){return _0x3269b9[_0x4004('0x23')]()[_0x4004('0x22')](function(){_0x33abb4[_0x4004('0x18')](0xcc)[_0x4004('0x19')]();});}};}function handleEntityNotFound(_0x319a12,_0x446851){return function(_0x2f8f79){if(!_0x2f8f79){_0x319a12['sendStatus'](0x194);}return _0x2f8f79;};}function handleError(_0x68801d,_0x388935){_0x388935=_0x388935||0x1f4;return function(_0x48bb8d){logger[_0x4004('0x24')](_0x48bb8d[_0x4004('0x25')]);if(_0x48bb8d[_0x4004('0x26')]){delete _0x48bb8d[_0x4004('0x26')];}_0x68801d[_0x4004('0x18')](_0x388935)[_0x4004('0x27')](_0x48bb8d);};}exports['index']=function(_0x936c1b,_0x1f7509){var _0xfa8056={},_0x2d4dfb={},_0x3edb1d={'count':0x0,'rows':[]};var _0x3c5b06=_['map'](db[_0x4004('0x28')][_0x4004('0x29')],function(_0x1e4787){return{'name':_0x1e4787[_0x4004('0x2a')],'type':_0x1e4787[_0x4004('0x2b')][_0x4004('0x2c')]};});_0x2d4dfb[_0x4004('0x2d')]=_[_0x4004('0x2e')](_0x3c5b06,'name');_0x2d4dfb[_0x4004('0x2f')]=_[_0x4004('0x30')](_0x936c1b['query']);_0x2d4dfb['filters']=_[_0x4004('0x31')](_0x2d4dfb[_0x4004('0x2d')],_0x2d4dfb['query']);_0xfa8056[_0x4004('0x32')]=_[_0x4004('0x31')](_0x2d4dfb['model'],qs['fields'](_0x936c1b['query'][_0x4004('0x33')]));_0xfa8056[_0x4004('0x32')]=_0xfa8056[_0x4004('0x32')][_0x4004('0x34')]?_0xfa8056[_0x4004('0x32')]:_0x2d4dfb[_0x4004('0x2d')];if(!_0x936c1b[_0x4004('0x2f')][_0x4004('0x35')](_0x4004('0x36'))){_0xfa8056[_0x4004('0x1b')]=qs['limit'](_0x936c1b[_0x4004('0x2f')]['limit']);_0xfa8056['offset']=qs[_0x4004('0x1d')](_0x936c1b[_0x4004('0x2f')][_0x4004('0x1d')]);}_0xfa8056[_0x4004('0x37')]=qs[_0x4004('0x38')](_0x936c1b[_0x4004('0x2f')]['sort']);_0xfa8056['where']=qs[_0x4004('0x39')](_[_0x4004('0x3a')](_0x936c1b[_0x4004('0x2f')],_0x2d4dfb[_0x4004('0x39')]),_0x3c5b06);if(_0x936c1b['query'][_0x4004('0x3b')]){_0xfa8056[_0x4004('0x3c')]=_[_0x4004('0x3d')](_0xfa8056[_0x4004('0x3c')],{'$or':_[_0x4004('0x2e')](_0x3c5b06,function(_0x176063){if(_0x176063[_0x4004('0x2b')]!=='VIRTUAL'){var _0xb816a2={};_0xb816a2[_0x176063['name']]={'$like':'%'+_0x936c1b[_0x4004('0x2f')][_0x4004('0x3b')]+'%'};return _0xb816a2;}})});}_0xfa8056=_[_0x4004('0x3d')]({},_0xfa8056,_0x936c1b['options']);var _0xde1457={'where':_0xfa8056[_0x4004('0x3c')]};return db[_0x4004('0x28')]['count'](_0xde1457)[_0x4004('0x22')](function(_0x485c67){_0x3edb1d[_0x4004('0x1c')]=_0x485c67;if(_0x936c1b[_0x4004('0x2f')][_0x4004('0x3e')]){_0xfa8056[_0x4004('0x3f')]=[{'all':!![]}];}return db[_0x4004('0x28')][_0x4004('0x40')](_0xfa8056);})['then'](function(_0x45b9b7){_0x3edb1d['rows']=_0x45b9b7;return _0x3edb1d;})[_0x4004('0x22')](respondWithFilteredResult(_0x1f7509,_0xfa8056))[_0x4004('0x41')](handleError(_0x1f7509,null));};exports[_0x4004('0x42')]=function(_0x805060,_0x297837){var _0x6cbc05={'raw':![],'where':{'id':_0x805060[_0x4004('0x43')]['id']}},_0x138d91={};_0x138d91[_0x4004('0x2d')]=_[_0x4004('0x30')](db[_0x4004('0x28')]['rawAttributes']);_0x138d91[_0x4004('0x2f')]=_[_0x4004('0x30')](_0x805060[_0x4004('0x2f')]);_0x138d91[_0x4004('0x39')]=_[_0x4004('0x31')](_0x138d91[_0x4004('0x2d')],_0x138d91[_0x4004('0x2f')]);_0x6cbc05[_0x4004('0x32')]=_['intersection'](_0x138d91[_0x4004('0x2d')],qs[_0x4004('0x33')](_0x805060[_0x4004('0x2f')][_0x4004('0x33')]));_0x6cbc05[_0x4004('0x32')]=_0x6cbc05[_0x4004('0x32')][_0x4004('0x34')]?_0x6cbc05[_0x4004('0x32')]:_0x138d91['model'];if(_0x805060[_0x4004('0x2f')][_0x4004('0x3e')]){_0x6cbc05['include']=[{'all':!![]}];}_0x6cbc05=_[_0x4004('0x3d')]({},_0x6cbc05,_0x805060[_0x4004('0x44')]);return db[_0x4004('0x28')]['find'](_0x6cbc05)['then'](handleEntityNotFound(_0x297837,null))[_0x4004('0x22')](respondWithResult(_0x297837,null))[_0x4004('0x41')](handleError(_0x297837,null));};exports['create']=function(_0x4421e2,_0x330d6f){return db[_0x4004('0x28')]['create'](_0x4421e2[_0x4004('0x45')],{})[_0x4004('0x22')](respondWithResult(_0x330d6f,0xc9))[_0x4004('0x41')](handleError(_0x330d6f,null));};exports[_0x4004('0x21')]=function(_0x409d4e,_0x1170da){if(_0x409d4e[_0x4004('0x45')]['id']){delete _0x409d4e[_0x4004('0x45')]['id'];}return db['IntegrationReport'][_0x4004('0x46')]({'where':{'id':_0x409d4e['params']['id']}})[_0x4004('0x22')](handleEntityNotFound(_0x1170da,null))[_0x4004('0x22')](saveUpdates(_0x409d4e[_0x4004('0x45')],null))[_0x4004('0x22')](respondWithResult(_0x1170da,null))[_0x4004('0x41')](handleError(_0x1170da,null));};exports['destroy']=function(_0x2e9e4a,_0x5044b8){return db[_0x4004('0x28')]['find']({'where':{'id':_0x2e9e4a[_0x4004('0x43')]['id']}})[_0x4004('0x22')](handleEntityNotFound(_0x5044b8,null))[_0x4004('0x22')](removeEntity(_0x5044b8,null))['catch'](handleError(_0x5044b8,null));};exports[_0x4004('0x47')]=function(_0x16642c,_0x48d479){return db[_0x4004('0x28')]['describe']()[_0x4004('0x22')](respondWithResult(_0x48d479,null))[_0x4004('0x41')](handleError(_0x48d479,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index b04fa61..682f349 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 _0x704a=['report_integration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','IntegrationReport'];(function(_0x46ce14,_0x4f7796){var _0x1f15f0=function(_0x314f19){while(--_0x314f19){_0x46ce14['push'](_0x46ce14['shift']());}};_0x1f15f0(++_0x4f7796);}(_0x704a,0x1c9));var _0xa704=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x704a[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require(_0xa704('0x0'));var logger=require(_0xa704('0x1'))(_0xa704('0x2'));var moment=require(_0xa704('0x3'));var BPromise=require(_0xa704('0x4'));var rp=require(_0xa704('0x5'));var fs=require('fs');var path=require(_0xa704('0x6'));var rimraf=require(_0xa704('0x7'));var config=require(_0xa704('0x8'));var attributes=require(_0xa704('0x9'));module['exports']=function(_0x223651,_0x4dce50){return _0x223651['define'](_0xa704('0xa'),attributes,{'tableName':_0xa704('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x219e=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x219e,0x167));var _0xe219=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x219e[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xe219('0x0'));var util=require(_0xe219('0x1'));var logger=require('../../config/logger')(_0xe219('0x2'));var moment=require(_0xe219('0x3'));var BPromise=require(_0xe219('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe219('0x5'));var rimraf=require(_0xe219('0x6'));var config=require(_0xe219('0x7'));var attributes=require('./integrationReport.attributes');module[_0xe219('0x8')]=function(_0x343983,_0x521f55){return _0x343983[_0xe219('0x9')](_0xe219('0xa'),attributes,{'tableName':_0xe219('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 0ff6179..662bba1 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 _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0x524e,0x15e));var _0xe524=function(_0x1393a0,_0x4b900e){_0x1393a0=_0x1393a0-0x0;var _0x4d2482=_0x524e[_0x1393a0];return _0x4d2482;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a5e8a,_0x354dd0){var _0x5eec65=function(_0x3448d0){while(--_0x3448d0){_0x1a5e8a['push'](_0x1a5e8a['shift']());}};_0x5eec65(++_0x354dd0);}(_0xda19,0xd5));var _0x9da1=function(_0x52cd17,_0x387952){_0x52cd17=_0x52cd17-0x0;var _0xbb7948=_0xda19[_0x52cd17];return _0xbb7948;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ee8d891..21bf93d 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 _0xe58e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','/:id','show','get','/:id/sub_intervals','create','addInterval','post','/:id/sub_intervals/create_many','addIntervals','put','multer','util','express'];(function(_0x2dcbdf,_0x3fe9d0){var _0x4bfadd=function(_0x36e89c){while(--_0x36e89c){_0x2dcbdf['push'](_0x2dcbdf['shift']());}};_0x4bfadd(++_0x3fe9d0);}(_0xe58e,0x10e));var _0xee58=function(_0x141eb6,_0x2a2a43){_0x141eb6=_0x141eb6-0x0;var _0x54c359=_0xe58e[_0x141eb6];return _0x54c359;};'use strict';var multer=require(_0xee58('0x0'));var util=require(_0xee58('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee58('0x2'));var router=express[_0xee58('0x3')]();var fs_extra=require(_0xee58('0x4'));var auth=require(_0xee58('0x5'));var interaction=require(_0xee58('0x6'));var config=require(_0xee58('0x7'));var controller=require(_0xee58('0x8'));router['get']('/',auth[_0xee58('0x9')](),controller[_0xee58('0xa')]);router['get'](_0xee58('0xb'),auth[_0xee58('0x9')](),controller[_0xee58('0xc')]);router[_0xee58('0xd')](_0xee58('0xe'),auth[_0xee58('0x9')](),controller['getIntervals']);router['post']('/',auth[_0xee58('0x9')](),controller[_0xee58('0xf')]);router['post']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xee58('0x10')]);router[_0xee58('0x11')](_0xee58('0x12'),auth['isAuthenticated'](),controller[_0xee58('0x13')]);router[_0xee58('0x14')]('/:id',auth[_0xee58('0x9')](),controller['update']);router['delete']('/:id',auth[_0xee58('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6050=['show','get','/:id/sub_intervals','isAuthenticated','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','/:id','update','delete','destroy','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(_0x57eac6,_0x57f46d){_0x57eac6=_0x57eac6-0x0;var _0xcefe9e=_0x6050[_0x57eac6];return _0xcefe9e;};'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('./interval.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0x11')]);router[_0x0605('0x10')](_0x0605('0x12'),auth[_0x0605('0xd')](),controller[_0x0605('0x13')]);router[_0x0605('0x14')](_0x0605('0x15'),auth[_0x0605('0xd')](),controller[_0x0605('0x16')]);router[_0x0605('0x17')](_0x0605('0x15'),auth[_0x0605('0xd')](),controller[_0x0605('0x18')]);module[_0x0605('0x19')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 13afce5..9b8760e 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 _0xdbc0=['exports','STRING','sequelize'];(function(_0x509e40,_0x24d6ee){var _0x14f8a6=function(_0x4bc79d){while(--_0x4bc79d){_0x509e40['push'](_0x509e40['shift']());}};_0x14f8a6(++_0x24d6ee);}(_0xdbc0,0x18b));var _0x0dbc=function(_0x593903,_0x3ef0cc){_0x593903=_0x593903-0x0;var _0x4f0d9e=_0xdbc0[_0x593903];return _0x4f0d9e;};'use strict';var Sequelize=require(_0x0dbc('0x0'));module[_0x0dbc('0x1')]={'name':{'type':Sequelize[_0x0dbc('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe8e1=['sequelize','exports','STRING'];(function(_0x5c2e44,_0x40309e){var _0x439c96=function(_0x5b1413){while(--_0x5b1413){_0x5c2e44['push'](_0x5c2e44['shift']());}};_0x439c96(++_0x40309e);}(_0xe8e1,0x186));var _0x1e8e=function(_0x3113b1,_0x42646c){_0x3113b1=_0x3113b1-0x0;var _0x4d45a8=_0xe8e1[_0x3113b1];return _0x4d45a8;};'use strict';var Sequelize=require(_0x1e8e('0x0'));module[_0x1e8e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e8e('0x2')]},'interval':{'type':Sequelize[_0x1e8e('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index cdd5eb7..f846e12 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 _0xf957=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','params','rawAttributes','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','body','find','addInterval','IntervalId','getIntervals','findOne','keys','length','addIntervals','sequelize','transaction','bulkCreate','findAll','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0xf957,0xa1));var _0x7f95=function(_0x821ad9,_0x50efa6){_0x821ad9=_0x821ad9-0x0;var _0x557272=_0xf957[_0x821ad9];return _0x557272;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f95('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f95('0x1'));var rp=require(_0x7f95('0x2'));var moment=require(_0x7f95('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7f95('0x4'));var sox=require(_0x7f95('0x5'));var csv=require(_0x7f95('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f95('0x7'));var _=require(_0x7f95('0x8'));var squel=require('squel');var crypto=require(_0x7f95('0x9'));var jsforce=require(_0x7f95('0xa'));var deskjs=require(_0x7f95('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7f95('0xc'));var Papa=require(_0x7f95('0xd'));var Redis=require(_0x7f95('0xe'));var authService=require(_0x7f95('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7f95('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f95('0x11'))(_0x7f95('0x12'));var utils=require('../../config/utils');var config=require(_0x7f95('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f95('0x14'))['db'];var extensions=require(_0x7f95('0x15'));function respondWithStatusCode(_0x548607,_0x139202){_0x139202=_0x139202||0xcc;return function(_0x5589c7){if(_0x5589c7){return _0x548607['sendStatus'](_0x139202);}return _0x548607[_0x7f95('0x16')](_0x139202)[_0x7f95('0x17')]();};}function respondWithResult(_0x7c0f4a,_0x3da3ae){_0x3da3ae=_0x3da3ae||0xc8;return function(_0x3c393c){if(_0x3c393c){return _0x7c0f4a[_0x7f95('0x16')](_0x3da3ae)[_0x7f95('0x18')](_0x3c393c);}};}function respondWithFilteredResult(_0x47509c,_0x3bdab2){return function(_0x2ce4af){if(_0x2ce4af){var _0x59cc26=typeof _0x3bdab2[_0x7f95('0x19')]==='undefined'&&typeof _0x3bdab2['limit']===_0x7f95('0x1a');var _0x2df134=_0x2ce4af[_0x7f95('0x1b')];var _0x1a3f61=_0x59cc26?0x0:_0x3bdab2[_0x7f95('0x19')];var _0x17a663=_0x59cc26?_0x2ce4af[_0x7f95('0x1b')]:_0x3bdab2[_0x7f95('0x19')]+_0x3bdab2['limit'];var _0x21da98;if(_0x17a663>=_0x2df134){_0x17a663=_0x2df134;_0x21da98=0xc8;}else{_0x21da98=0xce;}_0x47509c[_0x7f95('0x16')](_0x21da98);return _0x47509c[_0x7f95('0x1c')](_0x7f95('0x1d'),_0x1a3f61+'-'+_0x17a663+'/'+_0x2df134)[_0x7f95('0x18')](_0x2ce4af);}return null;};}function patchUpdates(_0x5d41d2){return function(_0x228f02){try{jsonpatch['apply'](_0x228f02,_0x5d41d2,!![]);}catch(_0x23f27c){return BPromise['reject'](_0x23f27c);}return _0x228f02['save']();};}function saveUpdates(_0xb4e07f,_0x4f062e){return function(_0x37d994){if(_0x37d994){return _0x37d994[_0x7f95('0x1e')](_0xb4e07f)[_0x7f95('0x1f')](function(_0x40ca3f){return _0x40ca3f;});}return null;};}function removeEntity(_0x4b07b2,_0x392c5b){return function(_0xa4ea42){if(_0xa4ea42){return _0xa4ea42[_0x7f95('0x20')]()[_0x7f95('0x1f')](function(){var _0x28be58=_0xa4ea42[_0x7f95('0x21')]({'plain':!![]});var _0x13f722=_0x7f95('0x22');return db[_0x7f95('0x23')][_0x7f95('0x20')]({'where':{'type':_0x13f722,'resourceId':_0x28be58['id']}})[_0x7f95('0x1f')](function(){return _0xa4ea42;});})[_0x7f95('0x1f')](function(){_0x4b07b2['status'](0xcc)[_0x7f95('0x17')]();});}};}function handleEntityNotFound(_0x469867,_0x3734f8){return function(_0x567094){if(!_0x567094){_0x469867['sendStatus'](0x194);}return _0x567094;};}function handleError(_0x50d2f5,_0x4ebcfe){_0x4ebcfe=_0x4ebcfe||0x1f4;return function(_0x69f648){logger[_0x7f95('0x24')](_0x69f648[_0x7f95('0x25')]);if(_0x69f648[_0x7f95('0x26')]){delete _0x69f648['name'];}_0x50d2f5['status'](_0x4ebcfe)[_0x7f95('0x27')](_0x69f648);};}exports[_0x7f95('0x28')]=function(_0x3d94e6,_0x29578e){var _0x1e3eb7={},_0x382d78={},_0x3ab656={'count':0x0,'rows':[]};var _0x5e2d4c=_[_0x7f95('0x29')](db[_0x7f95('0x2a')]['rawAttributes'],function(_0x32bee0){return{'name':_0x32bee0[_0x7f95('0x2b')],'type':_0x32bee0[_0x7f95('0x2c')]['key']};});_0x382d78[_0x7f95('0x2d')]=_['map'](_0x5e2d4c,'name');_0x382d78[_0x7f95('0x2e')]=_['keys'](_0x3d94e6[_0x7f95('0x2e')]);_0x382d78[_0x7f95('0x2f')]=_[_0x7f95('0x30')](_0x382d78['model'],_0x382d78[_0x7f95('0x2e')]);_0x1e3eb7['attributes']=_[_0x7f95('0x30')](_0x382d78['model'],qs[_0x7f95('0x31')](_0x3d94e6[_0x7f95('0x2e')]['fields']));_0x1e3eb7['attributes']=_0x1e3eb7[_0x7f95('0x32')]['length']?_0x1e3eb7[_0x7f95('0x32')]:_0x382d78['model'];if(!_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x33')](_0x7f95('0x34'))){_0x1e3eb7[_0x7f95('0x35')]=qs[_0x7f95('0x35')](_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x35')]);_0x1e3eb7['offset']=qs[_0x7f95('0x19')](_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x19')]);}_0x1e3eb7[_0x7f95('0x36')]=qs[_0x7f95('0x37')](_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x37')]);_0x1e3eb7[_0x7f95('0x38')]=qs[_0x7f95('0x2f')](_[_0x7f95('0x39')](_0x3d94e6[_0x7f95('0x2e')],_0x382d78[_0x7f95('0x2f')]),_0x5e2d4c);if(_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x3a')]){_0x1e3eb7[_0x7f95('0x38')]=_['merge'](_0x1e3eb7['where'],{'$or':_['map'](_0x5e2d4c,function(_0x414dcf){if(_0x414dcf[_0x7f95('0x2c')]!==_0x7f95('0x3b')){var _0x1c7350={};_0x1c7350[_0x414dcf[_0x7f95('0x26')]]={'$like':'%'+_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x3a')]+'%'};return _0x1c7350;}})});}_0x1e3eb7=_[_0x7f95('0x3c')]({},_0x1e3eb7,_0x3d94e6[_0x7f95('0x3d')]);var _0x496150={'where':_0x1e3eb7[_0x7f95('0x38')]};return db[_0x7f95('0x2a')]['count'](_0x496150)[_0x7f95('0x1f')](function(_0x572509){_0x3ab656[_0x7f95('0x1b')]=_0x572509;if(_0x3d94e6[_0x7f95('0x2e')][_0x7f95('0x3e')]){_0x1e3eb7['include']=[{'all':!![]}];}return db[_0x7f95('0x2a')]['findAll'](_0x1e3eb7);})[_0x7f95('0x1f')](function(_0x1be342){_0x3ab656['rows']=_0x1be342;return _0x3ab656;})['then'](respondWithFilteredResult(_0x29578e,_0x1e3eb7))[_0x7f95('0x3f')](handleError(_0x29578e,null));};exports['show']=function(_0x17cf09,_0x7f1d3e){var _0x5ded66={'raw':!![],'where':{'id':_0x17cf09[_0x7f95('0x40')]['id']}},_0x4ca21f={};_0x4ca21f[_0x7f95('0x2d')]=_['keys'](db[_0x7f95('0x2a')][_0x7f95('0x41')]);_0x4ca21f[_0x7f95('0x2e')]=_['keys'](_0x17cf09[_0x7f95('0x2e')]);_0x4ca21f['filters']=_[_0x7f95('0x30')](_0x4ca21f[_0x7f95('0x2d')],_0x4ca21f[_0x7f95('0x2e')]);_0x5ded66['attributes']=_['intersection'](_0x4ca21f[_0x7f95('0x2d')],qs[_0x7f95('0x31')](_0x17cf09[_0x7f95('0x2e')][_0x7f95('0x31')]));_0x5ded66[_0x7f95('0x32')]=_0x5ded66['attributes']['length']?_0x5ded66[_0x7f95('0x32')]:_0x4ca21f[_0x7f95('0x2d')];if(_0x17cf09[_0x7f95('0x2e')][_0x7f95('0x3e')]){_0x5ded66['include']=[{'all':!![]}];}_0x5ded66=_[_0x7f95('0x3c')]({},_0x5ded66,_0x17cf09['options']);return db[_0x7f95('0x2a')]['find'](_0x5ded66)[_0x7f95('0x1f')](handleEntityNotFound(_0x7f1d3e,null))[_0x7f95('0x1f')](respondWithResult(_0x7f1d3e,null))['catch'](handleError(_0x7f1d3e,null));};exports['create']=function(_0x2caff6,_0x2ec142){return db[_0x7f95('0x2a')][_0x7f95('0x42')](_0x2caff6['body'],{})[_0x7f95('0x1f')](function(_0x534cb5){var _0x4157cf=_0x2caff6[_0x7f95('0x43')]['get']({'plain':!![]});if(!_0x4157cf)throw new Error(_0x7f95('0x44'));if(_0x4157cf[_0x7f95('0x45')]===_0x7f95('0x43')){var _0x5b7f03=_0x534cb5[_0x7f95('0x21')]({'plain':!![]});var _0x3d26e5='Intervals';return db[_0x7f95('0x46')]['find']({'where':{'name':_0x3d26e5,'userProfileId':_0x4157cf['userProfileId']},'raw':!![]})['then'](function(_0x58f7c7){if(_0x58f7c7&&_0x58f7c7['autoAssociation']===0x0){return db['UserProfileResource'][_0x7f95('0x42')]({'name':_0x5b7f03[_0x7f95('0x26')],'resourceId':_0x5b7f03['id'],'type':_0x58f7c7[_0x7f95('0x26')],'sectionId':_0x58f7c7['id']},{})['then'](function(){return _0x534cb5;});}else{return _0x534cb5;}})[_0x7f95('0x3f')](function(_0x44699a){logger[_0x7f95('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44699a);throw _0x44699a;});}return _0x534cb5;})[_0x7f95('0x1f')](respondWithResult(_0x2ec142,0xc9))[_0x7f95('0x3f')](handleError(_0x2ec142,null));};exports[_0x7f95('0x1e')]=function(_0xa6a2f3,_0x1a9b44){if(_0xa6a2f3[_0x7f95('0x47')]['id']){delete _0xa6a2f3[_0x7f95('0x47')]['id'];}return db[_0x7f95('0x2a')]['find']({'where':{'id':_0xa6a2f3[_0x7f95('0x40')]['id']}})[_0x7f95('0x1f')](handleEntityNotFound(_0x1a9b44,null))['then'](saveUpdates(_0xa6a2f3[_0x7f95('0x47')],null))[_0x7f95('0x1f')](respondWithResult(_0x1a9b44,null))[_0x7f95('0x3f')](handleError(_0x1a9b44,null));};exports[_0x7f95('0x20')]=function(_0x538164,_0x455153){return db['Interval'][_0x7f95('0x48')]({'where':{'id':_0x538164[_0x7f95('0x40')]['id']}})[_0x7f95('0x1f')](handleEntityNotFound(_0x455153,null))[_0x7f95('0x1f')](removeEntity(_0x455153,null))[_0x7f95('0x3f')](handleError(_0x455153,null));};exports[_0x7f95('0x49')]=function(_0x1f31b9,_0x5293ce,_0x52257d){if(_0x1f31b9[_0x7f95('0x47')]['id']){delete _0x1f31b9[_0x7f95('0x47')]['id'];}return db[_0x7f95('0x2a')][_0x7f95('0x48')]({'where':{'id':_0x1f31b9[_0x7f95('0x40')]['id']}})['then'](handleEntityNotFound(_0x5293ce,null))[_0x7f95('0x1f')](function(_0x53ac0b){if(_0x53ac0b){_0x1f31b9[_0x7f95('0x47')][_0x7f95('0x4a')]=_0x53ac0b['id'];return db[_0x7f95('0x2a')][_0x7f95('0x42')](_0x1f31b9['body']);}})[_0x7f95('0x1f')](respondWithResult(_0x5293ce,null))[_0x7f95('0x3f')](handleError(_0x5293ce,null));};exports[_0x7f95('0x4b')]=function(_0x4d631e,_0xc0d361,_0x460d8d){var _0x501818={};var _0x32d8f9={};var _0x46f07b;var _0x1380fe;return db['Interval'][_0x7f95('0x4c')]({'where':{'id':_0x4d631e[_0x7f95('0x40')]['id']}})[_0x7f95('0x1f')](handleEntityNotFound(_0xc0d361,null))[_0x7f95('0x1f')](function(_0x150a6e){if(_0x150a6e){_0x46f07b=_0x150a6e;_0x32d8f9['model']=_[_0x7f95('0x4d')](db[_0x7f95('0x2a')][_0x7f95('0x41')]);_0x32d8f9['query']=_[_0x7f95('0x4d')](_0x4d631e['query']);_0x32d8f9[_0x7f95('0x2f')]=_[_0x7f95('0x30')](_0x32d8f9[_0x7f95('0x2d')],_0x32d8f9[_0x7f95('0x2e')]);_0x501818[_0x7f95('0x32')]=_['intersection'](_0x32d8f9[_0x7f95('0x2d')],qs['fields'](_0x4d631e['query'][_0x7f95('0x31')]));_0x501818[_0x7f95('0x32')]=_0x501818['attributes'][_0x7f95('0x4e')]?_0x501818[_0x7f95('0x32')]:_0x32d8f9[_0x7f95('0x2d')];_0x501818[_0x7f95('0x36')]=qs[_0x7f95('0x37')](_0x4d631e[_0x7f95('0x2e')]['sort']);_0x501818['where']=qs[_0x7f95('0x2f')](_['pick'](_0x4d631e[_0x7f95('0x2e')],_0x32d8f9[_0x7f95('0x2f')]));if(_0x4d631e[_0x7f95('0x2e')][_0x7f95('0x3a')]){_0x501818[_0x7f95('0x38')]=_['merge'](_0x501818['where'],{'$or':_[_0x7f95('0x29')](_0x501818[_0x7f95('0x32')],function(_0x2ae2a4){var _0x316617={};_0x316617[_0x2ae2a4]={'$like':'%'+_0x4d631e[_0x7f95('0x2e')][_0x7f95('0x3a')]+'%'};return _0x316617;})});}_0x501818=_[_0x7f95('0x3c')]({},_0x501818,_0x4d631e[_0x7f95('0x3d')]);return _0x46f07b['getIntervals'](_0x501818);}})['then'](function(_0x401c72){if(_0x401c72){_0x1380fe=_0x401c72[_0x7f95('0x4e')];if(!_0x4d631e['query']['hasOwnProperty'](_0x7f95('0x34'))){_0x501818[_0x7f95('0x35')]=qs['limit'](_0x4d631e['query'][_0x7f95('0x35')]);_0x501818[_0x7f95('0x19')]=qs[_0x7f95('0x19')](_0x4d631e[_0x7f95('0x2e')]['offset']);}return _0x46f07b[_0x7f95('0x4b')](_0x501818);}})[_0x7f95('0x1f')](function(_0x227922){if(_0x227922){return _0x227922?{'count':_0x1380fe,'rows':_0x227922}:null;}})[_0x7f95('0x1f')](respondWithResult(_0xc0d361,null))[_0x7f95('0x3f')](handleError(_0xc0d361,null));};exports[_0x7f95('0x4f')]=function(_0x4a820f,_0xe22ae1,_0x2a1d27){return db[_0x7f95('0x2a')]['findOne']({'where':{'id':_0x4a820f[_0x7f95('0x40')]['id']}})['then'](handleEntityNotFound(_0xe22ae1,null))[_0x7f95('0x1f')](function(_0x2d3c28){if(_0x2d3c28){return db[_0x7f95('0x50')][_0x7f95('0x51')](function(_0x1ba3dd){return db[_0x7f95('0x2a')][_0x7f95('0x20')]({'where':{'IntervalId':_0x4a820f[_0x7f95('0x40')]['id']},'transaction':_0x1ba3dd})[_0x7f95('0x1f')](function(_0xa1712f){var _0x183ba7=_[_0x7f95('0x29')](_0x4a820f[_0x7f95('0x47')],function(_0x4d6ee0){delete _0x4d6ee0['id'];_0x4d6ee0['IntervalId']=_0x4a820f[_0x7f95('0x40')]['id'];return _0x4d6ee0;});return db['Interval'][_0x7f95('0x52')](_0x183ba7,{'transaction':_0x1ba3dd});});})[_0x7f95('0x1f')](function(){return db[_0x7f95('0x2a')][_0x7f95('0x53')]({'where':{'IntervalId':_0x4a820f[_0x7f95('0x40')]['id']}});});}})[_0x7f95('0x1f')](respondWithResult(_0xe22ae1,null))['catch'](handleError(_0xe22ae1,null));}; \ No newline at end of file +var _0xd0c2=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','Interval','include','findAll','show','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','pick','nolimit','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack'];(function(_0x4c0fd0,_0x20935c){var _0x3f8ceb=function(_0x5e9767){while(--_0x5e9767){_0x4c0fd0['push'](_0x4c0fd0['shift']());}};_0x3f8ceb(++_0x20935c);}(_0xd0c2,0x139));var _0x2d0c=function(_0x11b12d,_0x292ed8){_0x11b12d=_0x11b12d-0x0;var _0x3d1327=_0xd0c2[_0x11b12d];return _0x3d1327;};'use strict';var emlformat=require(_0x2d0c('0x0'));var rimraf=require(_0x2d0c('0x1'));var zipdir=require(_0x2d0c('0x2'));var jsonpatch=require(_0x2d0c('0x3'));var rp=require(_0x2d0c('0x4'));var moment=require(_0x2d0c('0x5'));var BPromise=require(_0x2d0c('0x6'));var Mustache=require(_0x2d0c('0x7'));var util=require(_0x2d0c('0x8'));var path=require(_0x2d0c('0x9'));var sox=require(_0x2d0c('0xa'));var csv=require(_0x2d0c('0xb'));var ejs=require(_0x2d0c('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2d0c('0xd'));var crypto=require('crypto');var jsforce=require(_0x2d0c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d0c('0xb'));var querystring=require(_0x2d0c('0xf'));var Papa=require('papaparse');var Redis=require(_0x2d0c('0x10'));var authService=require(_0x2d0c('0x11'));var qs=require(_0x2d0c('0x12'));var as=require(_0x2d0c('0x13'));var hardwareService=require(_0x2d0c('0x14'));var logger=require(_0x2d0c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2d0c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2d0c('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x54c8f0,_0xd21ac7){_0xd21ac7=_0xd21ac7||0xcc;return function(_0x5c09f5){if(_0x5c09f5){return _0x54c8f0[_0x2d0c('0x18')](_0xd21ac7);}return _0x54c8f0[_0x2d0c('0x19')](_0xd21ac7)['end']();};}function respondWithResult(_0x5ae11f,_0x524e3c){_0x524e3c=_0x524e3c||0xc8;return function(_0x581aa2){if(_0x581aa2){return _0x5ae11f['status'](_0x524e3c)[_0x2d0c('0x1a')](_0x581aa2);}};}function respondWithFilteredResult(_0x35d76d,_0x1b2a56){return function(_0x1f1512){if(_0x1f1512){var _0xb32215=typeof _0x1b2a56[_0x2d0c('0x1b')]===_0x2d0c('0x1c')&&typeof _0x1b2a56['limit']===_0x2d0c('0x1c');var _0x4f461d=_0x1f1512['count'];var _0x52275e=_0xb32215?0x0:_0x1b2a56[_0x2d0c('0x1b')];var _0x36312d=_0xb32215?_0x1f1512[_0x2d0c('0x1d')]:_0x1b2a56[_0x2d0c('0x1b')]+_0x1b2a56[_0x2d0c('0x1e')];var _0x5727e0;if(_0x36312d>=_0x4f461d){_0x36312d=_0x4f461d;_0x5727e0=0xc8;}else{_0x5727e0=0xce;}_0x35d76d[_0x2d0c('0x19')](_0x5727e0);return _0x35d76d[_0x2d0c('0x1f')]('Content-Range',_0x52275e+'-'+_0x36312d+'/'+_0x4f461d)['json'](_0x1f1512);}return null;};}function patchUpdates(_0x23728b){return function(_0x4d5fb2){try{jsonpatch[_0x2d0c('0x20')](_0x4d5fb2,_0x23728b,!![]);}catch(_0x26081c){return BPromise[_0x2d0c('0x21')](_0x26081c);}return _0x4d5fb2[_0x2d0c('0x22')]();};}function saveUpdates(_0x1357c8,_0x588901){return function(_0x2670dd){if(_0x2670dd){return _0x2670dd[_0x2d0c('0x23')](_0x1357c8)[_0x2d0c('0x24')](function(_0x59f3ed){return _0x59f3ed;});}return null;};}function removeEntity(_0x28642f,_0x213c78){return function(_0x146db7){if(_0x146db7){return _0x146db7[_0x2d0c('0x25')]()[_0x2d0c('0x24')](function(){var _0x53b8f4=_0x146db7[_0x2d0c('0x26')]({'plain':!![]});var _0x1183ad='Intervals';return db[_0x2d0c('0x27')][_0x2d0c('0x25')]({'where':{'type':_0x1183ad,'resourceId':_0x53b8f4['id']}})[_0x2d0c('0x24')](function(){return _0x146db7;});})['then'](function(){_0x28642f[_0x2d0c('0x19')](0xcc)[_0x2d0c('0x28')]();});}};}function handleEntityNotFound(_0x460f5b,_0x32a8be){return function(_0x2a1acc){if(!_0x2a1acc){_0x460f5b[_0x2d0c('0x18')](0x194);}return _0x2a1acc;};}function handleError(_0x134bff,_0x23c503){_0x23c503=_0x23c503||0x1f4;return function(_0x243e40){logger[_0x2d0c('0x29')](_0x243e40[_0x2d0c('0x2a')]);if(_0x243e40[_0x2d0c('0x2b')]){delete _0x243e40['name'];}_0x134bff['status'](_0x23c503)[_0x2d0c('0x2c')](_0x243e40);};}exports['index']=function(_0x5680a4,_0x1b8888){var _0x28900d={},_0x164289={},_0x372eb1={'count':0x0,'rows':[]};var _0x5256fc=_[_0x2d0c('0x2d')](db['Interval'][_0x2d0c('0x2e')],function(_0x5545ee){return{'name':_0x5545ee[_0x2d0c('0x2f')],'type':_0x5545ee[_0x2d0c('0x30')][_0x2d0c('0x31')]};});_0x164289[_0x2d0c('0x32')]=_['map'](_0x5256fc,_0x2d0c('0x2b'));_0x164289['query']=_['keys'](_0x5680a4[_0x2d0c('0x33')]);_0x164289[_0x2d0c('0x34')]=_[_0x2d0c('0x35')](_0x164289[_0x2d0c('0x32')],_0x164289['query']);_0x28900d[_0x2d0c('0x36')]=_['intersection'](_0x164289[_0x2d0c('0x32')],qs[_0x2d0c('0x37')](_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x37')]));_0x28900d[_0x2d0c('0x36')]=_0x28900d['attributes']['length']?_0x28900d['attributes']:_0x164289[_0x2d0c('0x32')];if(!_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x38')]('nolimit')){_0x28900d[_0x2d0c('0x1e')]=qs['limit'](_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x1e')]);_0x28900d[_0x2d0c('0x1b')]=qs[_0x2d0c('0x1b')](_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x1b')]);}_0x28900d[_0x2d0c('0x39')]=qs['sort'](_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x3a')]);_0x28900d[_0x2d0c('0x3b')]=qs[_0x2d0c('0x34')](_['pick'](_0x5680a4[_0x2d0c('0x33')],_0x164289[_0x2d0c('0x34')]),_0x5256fc);if(_0x5680a4['query'][_0x2d0c('0x3c')]){_0x28900d['where']=_[_0x2d0c('0x3d')](_0x28900d[_0x2d0c('0x3b')],{'$or':_[_0x2d0c('0x2d')](_0x5256fc,function(_0x420f11){if(_0x420f11['type']!=='VIRTUAL'){var _0x5358e4={};_0x5358e4[_0x420f11['name']]={'$like':'%'+_0x5680a4[_0x2d0c('0x33')][_0x2d0c('0x3c')]+'%'};return _0x5358e4;}})});}_0x28900d=_[_0x2d0c('0x3d')]({},_0x28900d,_0x5680a4[_0x2d0c('0x3e')]);var _0x502a2e={'where':_0x28900d['where']};return db[_0x2d0c('0x3f')][_0x2d0c('0x1d')](_0x502a2e)[_0x2d0c('0x24')](function(_0x586770){_0x372eb1['count']=_0x586770;if(_0x5680a4[_0x2d0c('0x33')]['includeAll']){_0x28900d[_0x2d0c('0x40')]=[{'all':!![]}];}return db[_0x2d0c('0x3f')][_0x2d0c('0x41')](_0x28900d);})['then'](function(_0x44b2c1){_0x372eb1['rows']=_0x44b2c1;return _0x372eb1;})[_0x2d0c('0x24')](respondWithFilteredResult(_0x1b8888,_0x28900d))['catch'](handleError(_0x1b8888,null));};exports[_0x2d0c('0x42')]=function(_0x2a65ab,_0x15a243){var _0x122856={'raw':!![],'where':{'id':_0x2a65ab[_0x2d0c('0x43')]['id']}},_0x5353d4={};_0x5353d4[_0x2d0c('0x32')]=_[_0x2d0c('0x44')](db[_0x2d0c('0x3f')][_0x2d0c('0x2e')]);_0x5353d4[_0x2d0c('0x33')]=_[_0x2d0c('0x44')](_0x2a65ab[_0x2d0c('0x33')]);_0x5353d4[_0x2d0c('0x34')]=_[_0x2d0c('0x35')](_0x5353d4['model'],_0x5353d4[_0x2d0c('0x33')]);_0x122856[_0x2d0c('0x36')]=_['intersection'](_0x5353d4[_0x2d0c('0x32')],qs[_0x2d0c('0x37')](_0x2a65ab[_0x2d0c('0x33')][_0x2d0c('0x37')]));_0x122856['attributes']=_0x122856['attributes'][_0x2d0c('0x45')]?_0x122856[_0x2d0c('0x36')]:_0x5353d4[_0x2d0c('0x32')];if(_0x2a65ab[_0x2d0c('0x33')]['includeAll']){_0x122856['include']=[{'all':!![]}];}_0x122856=_['merge']({},_0x122856,_0x2a65ab[_0x2d0c('0x3e')]);return db['Interval'][_0x2d0c('0x46')](_0x122856)[_0x2d0c('0x24')](handleEntityNotFound(_0x15a243,null))[_0x2d0c('0x24')](respondWithResult(_0x15a243,null))[_0x2d0c('0x47')](handleError(_0x15a243,null));};exports[_0x2d0c('0x48')]=function(_0x1c2ad8,_0xae7a88){return db[_0x2d0c('0x3f')][_0x2d0c('0x48')](_0x1c2ad8[_0x2d0c('0x49')],{})[_0x2d0c('0x24')](function(_0x17af62){var _0x2ecb0c=_0x1c2ad8[_0x2d0c('0x4a')]['get']({'plain':!![]});if(!_0x2ecb0c)throw new Error(_0x2d0c('0x4b'));if(_0x2ecb0c[_0x2d0c('0x4c')]===_0x2d0c('0x4a')){var _0x2517fa=_0x17af62[_0x2d0c('0x26')]({'plain':!![]});var _0x3c9b47=_0x2d0c('0x4d');return db['UserProfileSection'][_0x2d0c('0x46')]({'where':{'name':_0x3c9b47,'userProfileId':_0x2ecb0c[_0x2d0c('0x4e')]},'raw':!![]})['then'](function(_0x45bc43){if(_0x45bc43&&_0x45bc43[_0x2d0c('0x4f')]===0x0){return db[_0x2d0c('0x27')][_0x2d0c('0x48')]({'name':_0x2517fa[_0x2d0c('0x2b')],'resourceId':_0x2517fa['id'],'type':_0x45bc43['name'],'sectionId':_0x45bc43['id']},{})['then'](function(){return _0x17af62;});}else{return _0x17af62;}})[_0x2d0c('0x47')](function(_0x7a62bc){logger[_0x2d0c('0x29')](_0x2d0c('0x50'),_0x7a62bc);throw _0x7a62bc;});}return _0x17af62;})[_0x2d0c('0x24')](respondWithResult(_0xae7a88,0xc9))[_0x2d0c('0x47')](handleError(_0xae7a88,null));};exports[_0x2d0c('0x23')]=function(_0x27fd99,_0x118cb7){if(_0x27fd99[_0x2d0c('0x49')]['id']){delete _0x27fd99[_0x2d0c('0x49')]['id'];}return db['Interval'][_0x2d0c('0x46')]({'where':{'id':_0x27fd99[_0x2d0c('0x43')]['id']}})['then'](handleEntityNotFound(_0x118cb7,null))['then'](saveUpdates(_0x27fd99[_0x2d0c('0x49')],null))[_0x2d0c('0x24')](respondWithResult(_0x118cb7,null))['catch'](handleError(_0x118cb7,null));};exports[_0x2d0c('0x25')]=function(_0x1c2f4d,_0x5b2614){return db[_0x2d0c('0x3f')][_0x2d0c('0x46')]({'where':{'id':_0x1c2f4d[_0x2d0c('0x43')]['id']}})[_0x2d0c('0x24')](handleEntityNotFound(_0x5b2614,null))[_0x2d0c('0x24')](removeEntity(_0x5b2614,null))[_0x2d0c('0x47')](handleError(_0x5b2614,null));};exports[_0x2d0c('0x51')]=function(_0x5e417d,_0x530280,_0xda6bfd){if(_0x5e417d[_0x2d0c('0x49')]['id']){delete _0x5e417d[_0x2d0c('0x49')]['id'];}return db[_0x2d0c('0x3f')][_0x2d0c('0x46')]({'where':{'id':_0x5e417d['params']['id']}})[_0x2d0c('0x24')](handleEntityNotFound(_0x530280,null))[_0x2d0c('0x24')](function(_0x2ef152){if(_0x2ef152){_0x5e417d[_0x2d0c('0x49')][_0x2d0c('0x52')]=_0x2ef152['id'];return db[_0x2d0c('0x3f')][_0x2d0c('0x48')](_0x5e417d[_0x2d0c('0x49')]);}})[_0x2d0c('0x24')](respondWithResult(_0x530280,null))[_0x2d0c('0x47')](handleError(_0x530280,null));};exports[_0x2d0c('0x53')]=function(_0x5a1e69,_0x2d6b2e,_0x37c195){var _0x293560={};var _0x26affe={};var _0x23ac61;var _0x57bc4a;return db[_0x2d0c('0x3f')][_0x2d0c('0x54')]({'where':{'id':_0x5a1e69['params']['id']}})['then'](handleEntityNotFound(_0x2d6b2e,null))['then'](function(_0xc11e44){if(_0xc11e44){_0x23ac61=_0xc11e44;_0x26affe[_0x2d0c('0x32')]=_[_0x2d0c('0x44')](db[_0x2d0c('0x3f')][_0x2d0c('0x2e')]);_0x26affe[_0x2d0c('0x33')]=_[_0x2d0c('0x44')](_0x5a1e69[_0x2d0c('0x33')]);_0x26affe[_0x2d0c('0x34')]=_[_0x2d0c('0x35')](_0x26affe['model'],_0x26affe['query']);_0x293560[_0x2d0c('0x36')]=_[_0x2d0c('0x35')](_0x26affe['model'],qs[_0x2d0c('0x37')](_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x37')]));_0x293560[_0x2d0c('0x36')]=_0x293560['attributes'][_0x2d0c('0x45')]?_0x293560['attributes']:_0x26affe[_0x2d0c('0x32')];_0x293560[_0x2d0c('0x39')]=qs[_0x2d0c('0x3a')](_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x3a')]);_0x293560[_0x2d0c('0x3b')]=qs[_0x2d0c('0x34')](_[_0x2d0c('0x55')](_0x5a1e69[_0x2d0c('0x33')],_0x26affe['filters']));if(_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x3c')]){_0x293560[_0x2d0c('0x3b')]=_[_0x2d0c('0x3d')](_0x293560['where'],{'$or':_[_0x2d0c('0x2d')](_0x293560[_0x2d0c('0x36')],function(_0x2a951b){var _0x669081={};_0x669081[_0x2a951b]={'$like':'%'+_0x5a1e69[_0x2d0c('0x33')]['filter']+'%'};return _0x669081;})});}_0x293560=_['merge']({},_0x293560,_0x5a1e69['options']);return _0x23ac61['getIntervals'](_0x293560);}})[_0x2d0c('0x24')](function(_0x49089e){if(_0x49089e){_0x57bc4a=_0x49089e[_0x2d0c('0x45')];if(!_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x38')](_0x2d0c('0x56'))){_0x293560[_0x2d0c('0x1e')]=qs[_0x2d0c('0x1e')](_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x1e')]);_0x293560[_0x2d0c('0x1b')]=qs['offset'](_0x5a1e69[_0x2d0c('0x33')][_0x2d0c('0x1b')]);}return _0x23ac61[_0x2d0c('0x53')](_0x293560);}})['then'](function(_0x4c3f6e){if(_0x4c3f6e){return _0x4c3f6e?{'count':_0x57bc4a,'rows':_0x4c3f6e}:null;}})[_0x2d0c('0x24')](respondWithResult(_0x2d6b2e,null))[_0x2d0c('0x47')](handleError(_0x2d6b2e,null));};exports['addIntervals']=function(_0x32e448,_0x4a7eaa,_0x512704){return db[_0x2d0c('0x3f')][_0x2d0c('0x54')]({'where':{'id':_0x32e448['params']['id']}})['then'](handleEntityNotFound(_0x4a7eaa,null))['then'](function(_0x3fe278){if(_0x3fe278){return db['sequelize'][_0x2d0c('0x57')](function(_0x23216f){return db[_0x2d0c('0x3f')][_0x2d0c('0x25')]({'where':{'IntervalId':_0x32e448[_0x2d0c('0x43')]['id']},'transaction':_0x23216f})[_0x2d0c('0x24')](function(_0x46923d){var _0x2a4d8d=_[_0x2d0c('0x2d')](_0x32e448[_0x2d0c('0x49')],function(_0x195b7d){delete _0x195b7d['id'];_0x195b7d[_0x2d0c('0x52')]=_0x32e448[_0x2d0c('0x43')]['id'];return _0x195b7d;});return db[_0x2d0c('0x3f')][_0x2d0c('0x58')](_0x2a4d8d,{'transaction':_0x23216f});});})[_0x2d0c('0x24')](function(){return db[_0x2d0c('0x3f')][_0x2d0c('0x41')]({'where':{'IntervalId':_0x32e448[_0x2d0c('0x43')]['id']}});});}})[_0x2d0c('0x24')](respondWithResult(_0x4a7eaa,null))['catch'](handleError(_0x4a7eaa,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 05dba5c..bfd257d 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 _0x6570=['api','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger'];(function(_0xb8c69b,_0x2cd106){var _0x4a46d6=function(_0xfd95bb){while(--_0xfd95bb){_0xb8c69b['push'](_0xb8c69b['shift']());}};_0x4a46d6(++_0x2cd106);}(_0x6570,0x1ec));var _0x0657=function(_0x564523,_0x5db1c8){_0x564523=_0x564523-0x0;var _0x404d2a=_0x6570[_0x564523];return _0x404d2a;};'use strict';var _=require(_0x0657('0x0'));var util=require(_0x0657('0x1'));var logger=require(_0x0657('0x2'))(_0x0657('0x3'));var moment=require('moment');var BPromise=require(_0x0657('0x4'));var rp=require(_0x0657('0x5'));var fs=require('fs');var path=require(_0x0657('0x6'));var rimraf=require(_0x0657('0x7'));var config=require(_0x0657('0x8'));var attributes=require(_0x0657('0x9'));var extensions=require('../../components/extensions/rewrite');module[_0x0657('0xa')]=function(_0x52f923,_0x56d41c){return _0x52f923[_0x0657('0xb')](_0x0657('0xc'),attributes,{'tableName':_0x0657('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16f9bf,_0x133fcc){extensions['rewrite'](_0x52f923,_0x16f9bf);},'afterBulkCreate':function(_0x10c48c,_0x5af8d9,_0x4d9adf){_0x4d9adf();extensions['rewrite'](_0x52f923,_0x10c48c[0x0]);},'afterUpdate':function(_0x5489a1,_0x45dcd3){extensions[_0x0657('0xe')](_0x52f923,_0x5489a1);},'afterDestroy':function(_0x3a2191,_0x5d2772){extensions[_0x0657('0xe')](_0x52f923,_0x3a2191);}}});}; \ No newline at end of file +var _0x234b=['rimraf','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0x234b,0xc6));var _0xb234=function(_0x4d606e,_0x53b7b){_0x4d606e=_0x4d606e-0x0;var _0x3a8860=_0x234b[_0x4d606e];return _0x3a8860;};'use strict';var _=require('lodash');var util=require(_0xb234('0x0'));var logger=require(_0xb234('0x1'))(_0xb234('0x2'));var moment=require(_0xb234('0x3'));var BPromise=require(_0xb234('0x4'));var rp=require(_0xb234('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb234('0x6'));var config=require('../../config/environment');var attributes=require(_0xb234('0x7'));var extensions=require(_0xb234('0x8'));module[_0xb234('0x9')]=function(_0x4a6ae2,_0x3ae659){return _0x4a6ae2['define'](_0xb234('0xa'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x433568,_0x30ea6c){extensions[_0xb234('0xb')](_0x4a6ae2,_0x433568);},'afterBulkCreate':function(_0x55097c,_0x2e3f96,_0x4ef570){_0x4ef570();extensions[_0xb234('0xb')](_0x4a6ae2,_0x55097c[0x0]);},'afterUpdate':function(_0x191105,_0x10b27f){extensions[_0xb234('0xb')](_0x4a6ae2,_0x191105);},'afterDestroy':function(_0x56674b,_0xbdd42d){extensions[_0xb234('0xb')](_0x4a6ae2,_0x56674b);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index a4fd753..c45d738 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(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x11e03f,_0x20b967){var _0x5666fe=function(_0x19ce63){while(--_0x19ce63){_0x11e03f['push'](_0x11e03f['shift']());}};_0x5666fe(++_0x20b967);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 75d3409..7fdbf49 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0x0b0e[_0x173113];return _0x3bea89;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4297f1,_0x272fdc){var _0x58676b=function(_0x5110e0){while(--_0x5110e0){_0x4297f1['push'](_0x4297f1['shift']());}};_0x58676b(++_0x272fdc);}(_0xadb5,0xad));var _0x5adb=function(_0x597f6c,_0xf70473){_0x597f6c=_0x597f6c-0x0;var _0x29e44e=_0xadb5[_0x597f6c];return _0x29e44e;};'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 4b8e011..6465f00 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 _0xf63a=['description','stringify','issuetype','Bug','customfield_11500','email','customfield_11501','fields','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','end','openIssue','send','connection','socket','remoteAddress','body','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20'];(function(_0xb175b2,_0x52f40f){var _0x5763a7=function(_0x5ceb29){while(--_0x5ceb29){_0xb175b2['push'](_0xb175b2['shift']());}};_0x5763a7(++_0x52f40f);}(_0xf63a,0x7a));var _0xaf63=function(_0x5d76cc,_0x195736){_0x5d76cc=_0x5d76cc-0x0;var _0x4acce4=_0xf63a[_0x5d76cc];return _0x4acce4;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require(_0xaf63('0x0'))(_0xaf63('0x1'));var USERNAME='support';var PASSWORD=_0xaf63('0x2');function openIssue(_0x47c2a6,_0x309b05){var _0x142bd4={'fields':{'project':{'key':_0x47c2a6[_0xaf63('0x3')]||'MOTGUI'},'summary':(_0x47c2a6[_0xaf63('0x4')]||_0xaf63('0x5'))+_0xaf63('0x6')+_0x47c2a6['ip'],'description':_0x47c2a6[_0xaf63('0x7')]||JSON[_0xaf63('0x8')](_0x47c2a6),'issuetype':{'name':_0x47c2a6[_0xaf63('0x9')]||_0xaf63('0xa')}}};_0x142bd4['fields'][_0xaf63('0xb')]=_0x47c2a6[_0xaf63('0xc')];_0x142bd4['fields'][_0xaf63('0xd')]=_0x47c2a6['oldToken'];_0x142bd4[_0xaf63('0xe')]['customfield_11502']=_0x47c2a6[_0xaf63('0xf')];_0x142bd4[_0xaf63('0xe')][_0xaf63('0x10')]=_0x47c2a6[_0xaf63('0x11')];_0x142bd4[_0xaf63('0xe')]['customfield_11504']=_0x47c2a6['reason'];_0x142bd4['fields'][_0xaf63('0x12')]=_0x47c2a6['ip'];var _0x486323={'host':_0xaf63('0x13'),'port':0x1bb,'path':_0xaf63('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xaf63('0x15'),'Authorization':_0xaf63('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xaf63('0x17')](_0xaf63('0x18'))}};var _0x337fc2=JSON[_0xaf63('0x8')](_0x142bd4);var _0xdc6c1a=https[_0xaf63('0x19')](_0x486323,function(_0x2a0212){_0x2a0212[_0xaf63('0x1a')](_0xaf63('0x1b'));var _0x3aa41a='';_0x2a0212['on'](_0xaf63('0x1c'),function(_0x1ba83f){_0x3aa41a+=_0x1ba83f;});_0x2a0212['on']('end',function(){if(_0x309b05){return _0x309b05[_0xaf63('0x1d')](_0x2a0212[_0xaf63('0x1e')])[_0xaf63('0x1f')](JSON[_0xaf63('0x20')](_0x3aa41a));}});});_0xdc6c1a['on'](_0xaf63('0x21'),function(_0x57c852){if(_0x309b05){return _0x309b05[_0xaf63('0x1d')](0x1f4)[_0xaf63('0x1f')]({'errors':[{'message':_0xaf63('0x22'),'type':'api.jira'}]});}});_0xdc6c1a[_0xaf63('0x23')](_0x337fc2);_0xdc6c1a[_0xaf63('0x24')]();}exports[_0xaf63('0x25')]=openIssue;exports[_0xaf63('0x26')]=function(_0x184e0f,_0x3eddaf){_0x184e0f['body']['ip']=_0x184e0f['headers']['x-forwarded-for']||_0x184e0f[_0xaf63('0x27')]['remoteAddress']||_0x184e0f[_0xaf63('0x28')][_0xaf63('0x29')]||_0x184e0f[_0xaf63('0x27')][_0xaf63('0x28')][_0xaf63('0x29')];return openIssue(_0x184e0f[_0xaf63('0x2a')],_0x3eddaf);}; \ No newline at end of file +var _0x23bd=['status','statusCode','json','error','api.jira','write','end','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','https','api','support','key','summary','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','base64','request','setEncoding','utf8'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x23bd,0x157));var _0xd23b=function(_0x31bb1d,_0x8eea6b){_0x31bb1d=_0x31bb1d-0x0;var _0x2eb906=_0x23bd[_0x31bb1d];return _0x2eb906;};'use strict';var BPromise=require('bluebird');var https=require(_0xd23b('0x0'));var logger=require('../../config/logger')(_0xd23b('0x1'));var USERNAME=_0xd23b('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x47e49d,_0x508a59){var _0x14f450={'fields':{'project':{'key':_0x47e49d[_0xd23b('0x3')]||'MOTGUI'},'summary':(_0x47e49d[_0xd23b('0x4')]||'Report')+'\x20from\x20'+_0x47e49d['ip'],'description':_0x47e49d['description']||JSON[_0xd23b('0x5')](_0x47e49d),'issuetype':{'name':_0x47e49d[_0xd23b('0x6')]||_0xd23b('0x7')}}};_0x14f450[_0xd23b('0x8')][_0xd23b('0x9')]=_0x47e49d[_0xd23b('0xa')];_0x14f450[_0xd23b('0x8')]['customfield_11501']=_0x47e49d[_0xd23b('0xb')];_0x14f450['fields'][_0xd23b('0xc')]=_0x47e49d['newToken'];_0x14f450[_0xd23b('0x8')][_0xd23b('0xd')]=_0x47e49d[_0xd23b('0xe')];_0x14f450['fields'][_0xd23b('0xf')]=_0x47e49d[_0xd23b('0x10')];_0x14f450['fields'][_0xd23b('0x11')]=_0x47e49d['ip'];var _0x1c1173={'host':_0xd23b('0x12'),'port':0x1bb,'path':_0xd23b('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xd23b('0x14'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xd23b('0x15')](_0xd23b('0x16'))}};var _0x439509=JSON[_0xd23b('0x5')](_0x14f450);var _0x3fabe3=https[_0xd23b('0x17')](_0x1c1173,function(_0x2338b4){_0x2338b4[_0xd23b('0x18')](_0xd23b('0x19'));var _0x328482='';_0x2338b4['on']('data',function(_0x5eedf2){_0x328482+=_0x5eedf2;});_0x2338b4['on']('end',function(){if(_0x508a59){return _0x508a59[_0xd23b('0x1a')](_0x2338b4[_0xd23b('0x1b')])[_0xd23b('0x1c')](JSON['parse'](_0x328482));}});});_0x3fabe3['on'](_0xd23b('0x1d'),function(_0x49caf5){if(_0x508a59){return _0x508a59[_0xd23b('0x1a')](0x1f4)[_0xd23b('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xd23b('0x1e')}]});}});_0x3fabe3[_0xd23b('0x1f')](_0x439509);_0x3fabe3[_0xd23b('0x20')]();}exports[_0xd23b('0x21')]=openIssue;exports[_0xd23b('0x22')]=function(_0x3c7b6f,_0x1f39e3){_0x3c7b6f['body']['ip']=_0x3c7b6f[_0xd23b('0x23')][_0xd23b('0x24')]||_0x3c7b6f[_0xd23b('0x25')][_0xd23b('0x26')]||_0x3c7b6f[_0xd23b('0x27')][_0xd23b('0x26')]||_0x3c7b6f[_0xd23b('0x25')][_0xd23b('0x27')]['remoteAddress'];return openIssue(_0x3c7b6f[_0xd23b('0x28')],_0x1f39e3);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3ad3761..b833935 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 _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xf109,0xce));var _0x9f10=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf109[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router; \ No newline at end of file +var _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xf109,0xce));var _0x9f10=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xf109[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index b006943..a5dd027 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0x3b40c2,_0x13b95f){_0x3b40c2=_0x3b40c2-0x0;var _0x552f29=_0x7a54[_0x3b40c2];return _0x552f29;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x163004,_0x5ed254){_0x163004=_0x163004-0x0;var _0x204083=_0x7a54[_0x163004];return _0x204083;};'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 72ac096..b74ea29 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 _0xbd10=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','map','JscriptyAnswerReport','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x329d27,_0xab97b1){var _0x4e631a=function(_0x1bc4d3){while(--_0x1bc4d3){_0x329d27['push'](_0x329d27['shift']());}};_0x4e631a(++_0xab97b1);}(_0xbd10,0x85));var _0x0bd1=function(_0x576fd7,_0x37ddda){_0x576fd7=_0x576fd7-0x0;var _0x2fc23a=_0xbd10[_0x576fd7];return _0x2fc23a;};'use strict';var emlformat=require(_0x0bd1('0x0'));var rimraf=require(_0x0bd1('0x1'));var zipdir=require(_0x0bd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd1('0x3'));var moment=require(_0x0bd1('0x4'));var BPromise=require(_0x0bd1('0x5'));var Mustache=require('mustache');var util=require(_0x0bd1('0x6'));var path=require(_0x0bd1('0x7'));var sox=require(_0x0bd1('0x8'));var csv=require(_0x0bd1('0x9'));var ejs=require(_0x0bd1('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd1('0xb'));var _=require('lodash');var squel=require(_0x0bd1('0xc'));var crypto=require('crypto');var jsforce=require(_0x0bd1('0xd'));var deskjs=require(_0x0bd1('0xe'));var toCsv=require(_0x0bd1('0x9'));var querystring=require(_0x0bd1('0xf'));var Papa=require('papaparse');var Redis=require(_0x0bd1('0x10'));var authService=require(_0x0bd1('0x11'));var qs=require(_0x0bd1('0x12'));var as=require(_0x0bd1('0x13'));var hardwareService=require(_0x0bd1('0x14'));var logger=require(_0x0bd1('0x15'))('api');var utils=require(_0x0bd1('0x16'));var config=require(_0x0bd1('0x17'));var licenseUtil=require(_0x0bd1('0x18'));var db=require(_0x0bd1('0x19'))['db'];function respondWithStatusCode(_0x4009e4,_0x1f441f){_0x1f441f=_0x1f441f||0xcc;return function(_0x57fd1d){if(_0x57fd1d){return _0x4009e4[_0x0bd1('0x1a')](_0x1f441f);}return _0x4009e4[_0x0bd1('0x1b')](_0x1f441f)[_0x0bd1('0x1c')]();};}function respondWithResult(_0x5025e1,_0x51f988){_0x51f988=_0x51f988||0xc8;return function(_0x3e2f49){if(_0x3e2f49){return _0x5025e1[_0x0bd1('0x1b')](_0x51f988)[_0x0bd1('0x1d')](_0x3e2f49);}};}function respondWithFilteredResult(_0x56055b,_0x5ab8a5){return function(_0x180809){if(_0x180809){var _0x88e088=typeof _0x5ab8a5[_0x0bd1('0x1e')]==='undefined'&&typeof _0x5ab8a5[_0x0bd1('0x1f')]===_0x0bd1('0x20');var _0x2f2969=_0x180809[_0x0bd1('0x21')];var _0x4790eb=_0x88e088?0x0:_0x5ab8a5[_0x0bd1('0x1e')];var _0x3d1170=_0x88e088?_0x180809['count']:_0x5ab8a5[_0x0bd1('0x1e')]+_0x5ab8a5[_0x0bd1('0x1f')];var _0x59d106;if(_0x3d1170>=_0x2f2969){_0x3d1170=_0x2f2969;_0x59d106=0xc8;}else{_0x59d106=0xce;}_0x56055b['status'](_0x59d106);return _0x56055b[_0x0bd1('0x22')](_0x0bd1('0x23'),_0x4790eb+'-'+_0x3d1170+'/'+_0x2f2969)[_0x0bd1('0x1d')](_0x180809);}return null;};}function patchUpdates(_0x6959b7){return function(_0x1f8536){try{jsonpatch[_0x0bd1('0x24')](_0x1f8536,_0x6959b7,!![]);}catch(_0xc5ece1){return BPromise[_0x0bd1('0x25')](_0xc5ece1);}return _0x1f8536['save']();};}function saveUpdates(_0x2d5861,_0x44095f){return function(_0x31eaf5){if(_0x31eaf5){return _0x31eaf5[_0x0bd1('0x26')](_0x2d5861)[_0x0bd1('0x27')](function(_0x569b09){return _0x569b09;});}return null;};}function removeEntity(_0x35a8ca,_0x4d6828){return function(_0x5f0742){if(_0x5f0742){return _0x5f0742[_0x0bd1('0x28')]()[_0x0bd1('0x27')](function(){_0x35a8ca[_0x0bd1('0x1b')](0xcc)[_0x0bd1('0x1c')]();});}};}function handleEntityNotFound(_0x237f4a,_0x16eb7b){return function(_0x3e0c07){if(!_0x3e0c07){_0x237f4a[_0x0bd1('0x1a')](0x194);}return _0x3e0c07;};}function handleError(_0x2cacfc,_0x58a565){_0x58a565=_0x58a565||0x1f4;return function(_0x5cb236){logger[_0x0bd1('0x29')](_0x5cb236['stack']);if(_0x5cb236[_0x0bd1('0x2a')]){delete _0x5cb236[_0x0bd1('0x2a')];}_0x2cacfc['status'](_0x58a565)['send'](_0x5cb236);};}exports['index']=function(_0x4b64cb,_0x551fcd){var _0x4616b9={},_0x2ac8bb={},_0x38e655={'count':0x0,'rows':[]};var _0x5b07cd=_[_0x0bd1('0x2b')](db[_0x0bd1('0x2c')]['rawAttributes'],function(_0x49debf){return{'name':_0x49debf[_0x0bd1('0x2d')],'type':_0x49debf['type']['key']};});_0x2ac8bb['model']=_[_0x0bd1('0x2b')](_0x5b07cd,_0x0bd1('0x2a'));_0x2ac8bb[_0x0bd1('0x2e')]=_['keys'](_0x4b64cb[_0x0bd1('0x2e')]);_0x2ac8bb[_0x0bd1('0x2f')]=_['intersection'](_0x2ac8bb['model'],_0x2ac8bb[_0x0bd1('0x2e')]);_0x4616b9['attributes']=_[_0x0bd1('0x30')](_0x2ac8bb[_0x0bd1('0x31')],qs['fields'](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x32')]));_0x4616b9[_0x0bd1('0x33')]=_0x4616b9['attributes'][_0x0bd1('0x34')]?_0x4616b9['attributes']:_0x2ac8bb[_0x0bd1('0x31')];if(!_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x35')](_0x0bd1('0x36'))){_0x4616b9['limit']=qs[_0x0bd1('0x1f')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1f')]);_0x4616b9[_0x0bd1('0x1e')]=qs[_0x0bd1('0x1e')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1e')]);}_0x4616b9['order']=qs[_0x0bd1('0x37')](_0x4b64cb[_0x0bd1('0x2e')]['sort']);_0x4616b9[_0x0bd1('0x38')]=qs[_0x0bd1('0x2f')](_[_0x0bd1('0x39')](_0x4b64cb[_0x0bd1('0x2e')],_0x2ac8bb[_0x0bd1('0x2f')]),_0x5b07cd);if(_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]){_0x4616b9[_0x0bd1('0x38')]=_[_0x0bd1('0x3b')](_0x4616b9[_0x0bd1('0x38')],{'$or':_[_0x0bd1('0x2b')](_0x5b07cd,function(_0x3715f6){if(_0x3715f6[_0x0bd1('0x3c')]!==_0x0bd1('0x3d')){var _0x28b835={};_0x28b835[_0x3715f6[_0x0bd1('0x2a')]]={'$like':'%'+_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]+'%'};return _0x28b835;}})});}_0x4616b9=_['merge']({},_0x4616b9,_0x4b64cb['options']);var _0x2fe9da={'where':_0x4616b9[_0x0bd1('0x38')]};return db[_0x0bd1('0x2c')][_0x0bd1('0x21')](_0x2fe9da)[_0x0bd1('0x27')](function(_0x5fcd17){_0x38e655['count']=_0x5fcd17;if(_0x4b64cb['query'][_0x0bd1('0x3e')]){_0x4616b9[_0x0bd1('0x3f')]=[{'all':!![]}];}return db[_0x0bd1('0x2c')][_0x0bd1('0x40')](_0x4616b9);})['then'](function(_0x12c010){_0x38e655['rows']=_0x12c010;return _0x38e655;})[_0x0bd1('0x27')](respondWithFilteredResult(_0x551fcd,_0x4616b9))['catch'](handleError(_0x551fcd,null));};exports[_0x0bd1('0x41')]=function(_0x3b7677,_0x32cff5){var _0xd4217c={'raw':!![],'where':{'id':_0x3b7677[_0x0bd1('0x42')]['id']}},_0x5894f4={};_0x5894f4[_0x0bd1('0x31')]=_[_0x0bd1('0x43')](db['JscriptyAnswerReport'][_0x0bd1('0x44')]);_0x5894f4[_0x0bd1('0x2e')]=_[_0x0bd1('0x43')](_0x3b7677[_0x0bd1('0x2e')]);_0x5894f4[_0x0bd1('0x2f')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],_0x5894f4[_0x0bd1('0x2e')]);_0xd4217c[_0x0bd1('0x33')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],qs['fields'](_0x3b7677['query'][_0x0bd1('0x32')]));_0xd4217c['attributes']=_0xd4217c[_0x0bd1('0x33')]['length']?_0xd4217c[_0x0bd1('0x33')]:_0x5894f4[_0x0bd1('0x31')];if(_0x3b7677[_0x0bd1('0x2e')][_0x0bd1('0x3e')]){_0xd4217c[_0x0bd1('0x3f')]=[{'all':!![]}];}_0xd4217c=_[_0x0bd1('0x3b')]({},_0xd4217c,_0x3b7677[_0x0bd1('0x45')]);return db[_0x0bd1('0x2c')][_0x0bd1('0x46')](_0xd4217c)[_0x0bd1('0x27')](handleEntityNotFound(_0x32cff5,null))['then'](respondWithResult(_0x32cff5,null))[_0x0bd1('0x47')](handleError(_0x32cff5,null));};exports[_0x0bd1('0x48')]=function(_0x34a20d,_0x1ef213){return db['JscriptyAnswerReport']['create'](_0x34a20d[_0x0bd1('0x49')],{})[_0x0bd1('0x27')](respondWithResult(_0x1ef213,0xc9))[_0x0bd1('0x47')](handleError(_0x1ef213,null));};exports['update']=function(_0x3cc311,_0x2cf6cb){if(_0x3cc311[_0x0bd1('0x49')]['id']){delete _0x3cc311[_0x0bd1('0x49')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3cc311[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf6cb,null))[_0x0bd1('0x27')](saveUpdates(_0x3cc311['body'],null))[_0x0bd1('0x27')](respondWithResult(_0x2cf6cb,null))['catch'](handleError(_0x2cf6cb,null));};exports[_0x0bd1('0x28')]=function(_0x43ecb5,_0x53b563){return db['JscriptyAnswerReport'][_0x0bd1('0x46')]({'where':{'id':_0x43ecb5[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x53b563,null))['then'](removeEntity(_0x53b563,null))[_0x0bd1('0x47')](handleError(_0x53b563,null));};exports[_0x0bd1('0x4a')]=function(_0x1adf77,_0x4ca2e8){return db['JscriptyAnswerReport'][_0x0bd1('0x4a')]()[_0x0bd1('0x27')](respondWithResult(_0x4ca2e8,null))[_0x0bd1('0x47')](handleError(_0x4ca2e8,null));}; \ No newline at end of file +var _0x6bac=['destroy','end','error','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','JscriptyAnswerReport','count','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then'];(function(_0x747af3,_0xcf5902){var _0xcdac1=function(_0x1e3f6b){while(--_0x1e3f6b){_0x747af3['push'](_0x747af3['shift']());}};_0xcdac1(++_0xcf5902);}(_0x6bac,0xa5));var _0xc6ba=function(_0x12547a,_0x4154c4){_0x12547a=_0x12547a-0x0;var _0x39a650=_0x6bac[_0x12547a];return _0x39a650;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6ba('0x1'));var jsonpatch=require(_0xc6ba('0x2'));var rp=require(_0xc6ba('0x3'));var moment=require(_0xc6ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6ba('0x5'));var sox=require(_0xc6ba('0x6'));var csv=require('to-csv');var ejs=require(_0xc6ba('0x7'));var fs=require('fs');var fs_extra=require(_0xc6ba('0x8'));var _=require(_0xc6ba('0x9'));var squel=require(_0xc6ba('0xa'));var crypto=require(_0xc6ba('0xb'));var jsforce=require(_0xc6ba('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc6ba('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6ba('0xe'));var logger=require(_0xc6ba('0xf'))(_0xc6ba('0x10'));var utils=require(_0xc6ba('0x11'));var config=require(_0xc6ba('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7642,_0x2cfa3d){_0x2cfa3d=_0x2cfa3d||0xcc;return function(_0x31def2){if(_0x31def2){return _0x3e7642[_0xc6ba('0x13')](_0x2cfa3d);}return _0x3e7642[_0xc6ba('0x14')](_0x2cfa3d)['end']();};}function respondWithResult(_0x498aa1,_0x595561){_0x595561=_0x595561||0xc8;return function(_0x2f6e76){if(_0x2f6e76){return _0x498aa1[_0xc6ba('0x14')](_0x595561)[_0xc6ba('0x15')](_0x2f6e76);}};}function respondWithFilteredResult(_0x342007,_0x425cec){return function(_0x29f0b7){if(_0x29f0b7){var _0x1be8ef=typeof _0x425cec[_0xc6ba('0x16')]==='undefined'&&typeof _0x425cec['limit']==='undefined';var _0x488fb4=_0x29f0b7['count'];var _0x494d17=_0x1be8ef?0x0:_0x425cec[_0xc6ba('0x16')];var _0x15a135=_0x1be8ef?_0x29f0b7['count']:_0x425cec['offset']+_0x425cec[_0xc6ba('0x17')];var _0x5d1f4e;if(_0x15a135>=_0x488fb4){_0x15a135=_0x488fb4;_0x5d1f4e=0xc8;}else{_0x5d1f4e=0xce;}_0x342007[_0xc6ba('0x14')](_0x5d1f4e);return _0x342007[_0xc6ba('0x18')]('Content-Range',_0x494d17+'-'+_0x15a135+'/'+_0x488fb4)[_0xc6ba('0x15')](_0x29f0b7);}return null;};}function patchUpdates(_0x362f68){return function(_0x4a463e){try{jsonpatch[_0xc6ba('0x19')](_0x4a463e,_0x362f68,!![]);}catch(_0x459dfa){return BPromise[_0xc6ba('0x1a')](_0x459dfa);}return _0x4a463e[_0xc6ba('0x1b')]();};}function saveUpdates(_0x28f8ba,_0x3f7082){return function(_0xc2de63){if(_0xc2de63){return _0xc2de63[_0xc6ba('0x1c')](_0x28f8ba)[_0xc6ba('0x1d')](function(_0x3c7edd){return _0x3c7edd;});}return null;};}function removeEntity(_0x280ab0,_0xf326f9){return function(_0x4a2082){if(_0x4a2082){return _0x4a2082[_0xc6ba('0x1e')]()[_0xc6ba('0x1d')](function(){_0x280ab0['status'](0xcc)[_0xc6ba('0x1f')]();});}};}function handleEntityNotFound(_0x29a175,_0x2946f0){return function(_0xcfb503){if(!_0xcfb503){_0x29a175[_0xc6ba('0x13')](0x194);}return _0xcfb503;};}function handleError(_0x3b5ed7,_0x47998c){_0x47998c=_0x47998c||0x1f4;return function(_0x447407){logger[_0xc6ba('0x20')](_0x447407['stack']);if(_0x447407[_0xc6ba('0x21')]){delete _0x447407[_0xc6ba('0x21')];}_0x3b5ed7['status'](_0x47998c)[_0xc6ba('0x22')](_0x447407);};}exports['index']=function(_0x3fea76,_0x2dd085){var _0x111ce4={},_0x393d4d={},_0x5ac5dd={'count':0x0,'rows':[]};var _0x4fe380=_[_0xc6ba('0x23')](db['JscriptyAnswerReport'][_0xc6ba('0x24')],function(_0x5d5ebe){return{'name':_0x5d5ebe[_0xc6ba('0x25')],'type':_0x5d5ebe[_0xc6ba('0x26')]['key']};});_0x393d4d[_0xc6ba('0x27')]=_[_0xc6ba('0x23')](_0x4fe380,_0xc6ba('0x21'));_0x393d4d[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x3fea76[_0xc6ba('0x28')]);_0x393d4d['filters']=_[_0xc6ba('0x2a')](_0x393d4d[_0xc6ba('0x27')],_0x393d4d['query']);_0x111ce4[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x393d4d['model'],qs[_0xc6ba('0x2c')](_0x3fea76[_0xc6ba('0x28')]['fields']));_0x111ce4[_0xc6ba('0x2b')]=_0x111ce4[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x111ce4[_0xc6ba('0x2b')]:_0x393d4d[_0xc6ba('0x27')];if(!_0x3fea76[_0xc6ba('0x28')]['hasOwnProperty'](_0xc6ba('0x2e'))){_0x111ce4[_0xc6ba('0x17')]=qs[_0xc6ba('0x17')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x17')]);_0x111ce4[_0xc6ba('0x16')]=qs[_0xc6ba('0x16')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x16')]);}_0x111ce4[_0xc6ba('0x2f')]=qs[_0xc6ba('0x30')](_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x30')]);_0x111ce4[_0xc6ba('0x31')]=qs['filters'](_[_0xc6ba('0x32')](_0x3fea76[_0xc6ba('0x28')],_0x393d4d[_0xc6ba('0x33')]),_0x4fe380);if(_0x3fea76['query'][_0xc6ba('0x34')]){_0x111ce4['where']=_[_0xc6ba('0x35')](_0x111ce4['where'],{'$or':_[_0xc6ba('0x23')](_0x4fe380,function(_0x57d2fb){if(_0x57d2fb[_0xc6ba('0x26')]!=='VIRTUAL'){var _0x4d92cf={};_0x4d92cf[_0x57d2fb[_0xc6ba('0x21')]]={'$like':'%'+_0x3fea76[_0xc6ba('0x28')][_0xc6ba('0x34')]+'%'};return _0x4d92cf;}})});}_0x111ce4=_[_0xc6ba('0x35')]({},_0x111ce4,_0x3fea76['options']);var _0x2f8c39={'where':_0x111ce4[_0xc6ba('0x31')]};return db[_0xc6ba('0x36')][_0xc6ba('0x37')](_0x2f8c39)[_0xc6ba('0x1d')](function(_0x3273f4){_0x5ac5dd[_0xc6ba('0x37')]=_0x3273f4;if(_0x3fea76['query'][_0xc6ba('0x38')]){_0x111ce4[_0xc6ba('0x39')]=[{'all':!![]}];}return db[_0xc6ba('0x36')][_0xc6ba('0x3a')](_0x111ce4);})[_0xc6ba('0x1d')](function(_0x4985f8){_0x5ac5dd['rows']=_0x4985f8;return _0x5ac5dd;})[_0xc6ba('0x1d')](respondWithFilteredResult(_0x2dd085,_0x111ce4))[_0xc6ba('0x3b')](handleError(_0x2dd085,null));};exports['show']=function(_0x2d3d5a,_0x23e2d1){var _0x35f1fc={'raw':!![],'where':{'id':_0x2d3d5a[_0xc6ba('0x3c')]['id']}},_0x279d89={};_0x279d89[_0xc6ba('0x27')]=_['keys'](db['JscriptyAnswerReport'][_0xc6ba('0x24')]);_0x279d89[_0xc6ba('0x28')]=_[_0xc6ba('0x29')](_0x2d3d5a['query']);_0x279d89['filters']=_[_0xc6ba('0x2a')](_0x279d89[_0xc6ba('0x27')],_0x279d89[_0xc6ba('0x28')]);_0x35f1fc[_0xc6ba('0x2b')]=_[_0xc6ba('0x2a')](_0x279d89['model'],qs[_0xc6ba('0x2c')](_0x2d3d5a[_0xc6ba('0x28')][_0xc6ba('0x2c')]));_0x35f1fc[_0xc6ba('0x2b')]=_0x35f1fc[_0xc6ba('0x2b')][_0xc6ba('0x2d')]?_0x35f1fc[_0xc6ba('0x2b')]:_0x279d89[_0xc6ba('0x27')];if(_0x2d3d5a['query'][_0xc6ba('0x38')]){_0x35f1fc[_0xc6ba('0x39')]=[{'all':!![]}];}_0x35f1fc=_[_0xc6ba('0x35')]({},_0x35f1fc,_0x2d3d5a['options']);return db[_0xc6ba('0x36')][_0xc6ba('0x3d')](_0x35f1fc)[_0xc6ba('0x1d')](handleEntityNotFound(_0x23e2d1,null))['then'](respondWithResult(_0x23e2d1,null))['catch'](handleError(_0x23e2d1,null));};exports[_0xc6ba('0x3e')]=function(_0xe4747e,_0x56add1){return db[_0xc6ba('0x36')][_0xc6ba('0x3e')](_0xe4747e[_0xc6ba('0x3f')],{})[_0xc6ba('0x1d')](respondWithResult(_0x56add1,0xc9))[_0xc6ba('0x3b')](handleError(_0x56add1,null));};exports[_0xc6ba('0x1c')]=function(_0x36e159,_0x283dac){if(_0x36e159['body']['id']){delete _0x36e159[_0xc6ba('0x3f')]['id'];}return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x36e159[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x283dac,null))[_0xc6ba('0x1d')](saveUpdates(_0x36e159[_0xc6ba('0x3f')],null))['then'](respondWithResult(_0x283dac,null))['catch'](handleError(_0x283dac,null));};exports['destroy']=function(_0x47a4ee,_0x2c71f7){return db['JscriptyAnswerReport'][_0xc6ba('0x3d')]({'where':{'id':_0x47a4ee[_0xc6ba('0x3c')]['id']}})[_0xc6ba('0x1d')](handleEntityNotFound(_0x2c71f7,null))[_0xc6ba('0x1d')](removeEntity(_0x2c71f7,null))['catch'](handleError(_0x2c71f7,null));};exports['describe']=function(_0x121fa6,_0x2ab774){return db['JscriptyAnswerReport'][_0xc6ba('0x40')]()[_0xc6ba('0x1d')](respondWithResult(_0x2ab774,null))[_0xc6ba('0x3b')](handleError(_0x2ab774,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 7321f5f..41087b6 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 _0x587b=['./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x587b,0x1bc));var _0xb587=function(_0x4c2f42,_0x3abe26){_0x4c2f42=_0x4c2f42-0x0;var _0x3baed4=_0x587b[_0x4c2f42];return _0x3baed4;};'use strict';var _=require(_0xb587('0x0'));var util=require(_0xb587('0x1'));var logger=require('../../config/logger')(_0xb587('0x2'));var moment=require(_0xb587('0x3'));var BPromise=require(_0xb587('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb587('0x5'));var config=require(_0xb587('0x6'));var attributes=require(_0xb587('0x7'));module[_0xb587('0x8')]=function(_0x2cb993,_0x5c1c62){return _0x2cb993[_0xb587('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0xb587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ad7=['../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4fbc9f,_0x1ba070){var _0x205885=function(_0x1765d9){while(--_0x1765d9){_0x4fbc9f['push'](_0x4fbc9f['shift']());}};_0x205885(++_0x1ba070);}(_0x4ad7,0x10c));var _0x74ad=function(_0x190498,_0x11f1c0){_0x190498=_0x190498-0x0;var _0x541297=_0x4ad7[_0x190498];return _0x541297;};'use strict';var _=require(_0x74ad('0x0'));var util=require(_0x74ad('0x1'));var logger=require(_0x74ad('0x2'))(_0x74ad('0x3'));var moment=require(_0x74ad('0x4'));var BPromise=require(_0x74ad('0x5'));var rp=require(_0x74ad('0x6'));var fs=require('fs');var path=require(_0x74ad('0x7'));var rimraf=require('rimraf');var config=require(_0x74ad('0x8'));var attributes=require(_0x74ad('0x9'));module['exports']=function(_0x3151e2,_0x29d043){return _0x3151e2[_0x74ad('0xa')](_0x74ad('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 29319db..0eb6651 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 _0x3755=['message','JscriptyAnswerReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4048fa,_0x19fdb5){var _0x2c4159=function(_0x315c13){while(--_0x315c13){_0x4048fa['push'](_0x4048fa['shift']());}};_0x2c4159(++_0x19fdb5);}(_0x3755,0x1bb));var _0x5375=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3755[_0x432682];return _0x463d05;};'use strict';var _=require(_0x5375('0x0'));var util=require(_0x5375('0x1'));var moment=require(_0x5375('0x2'));var BPromise=require(_0x5375('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5375('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5375('0x5'));var logger=require(_0x5375('0x6'))(_0x5375('0x7'));var config=require(_0x5375('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5375('0x9')][_0x5375('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x343094,_0x41dcce,_0x3374f4){return new BPromise(function(_0x28330a,_0x59328a){return client[_0x5375('0xb')](_0x343094,_0x3374f4)[_0x5375('0xc')](function(_0x286361){logger[_0x5375('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x41dcce,'request\x20sent');logger['debug'](_0x5375('0xe'),_0x41dcce,_0x5375('0xf'),JSON[_0x5375('0x10')](_0x286361));if(_0x286361[_0x5375('0x11')]){if(_0x286361[_0x5375('0x11')][_0x5375('0x12')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x41dcce,_0x286361[_0x5375('0x11')][_0x5375('0x13')]);return _0x59328a(_0x286361[_0x5375('0x11')][_0x5375('0x13')]);}logger[_0x5375('0x11')](_0x5375('0x14'),_0x41dcce,_0x286361[_0x5375('0x11')]['message']);return _0x28330a(_0x286361['error'][_0x5375('0x13')]);}else{logger[_0x5375('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x41dcce,_0x5375('0xf'));_0x28330a(_0x286361[_0x5375('0x15')][_0x5375('0x13')]);}})['catch'](function(_0x46d83a){logger[_0x5375('0x11')](_0x5375('0x14'),_0x41dcce,_0x46d83a);_0x59328a(_0x46d83a);});});} \ No newline at end of file +var _0xd855=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util'];(function(_0x22a6b9,_0x5f2e4e){var _0x12f069=function(_0x236327){while(--_0x236327){_0x22a6b9['push'](_0x22a6b9['shift']());}};_0x12f069(++_0x5f2e4e);}(_0xd855,0xc5));var _0x5d85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd855[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x5d85('0x0'));var moment=require(_0x5d85('0x1'));var BPromise=require(_0x5d85('0x2'));var rs=require(_0x5d85('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d85('0x4'))['db'];var utils=require(_0x5d85('0x5'));var logger=require(_0x5d85('0x6'))(_0x5d85('0x7'));var config=require(_0x5d85('0x8'));var jayson=require(_0x5d85('0x9'));var client=jayson[_0x5d85('0xa')][_0x5d85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48b1ea,_0x5cca73,_0x3e2b14){return new BPromise(function(_0x25f0f2,_0x2221ca){return client[_0x5d85('0xc')](_0x48b1ea,_0x3e2b14)['then'](function(_0x54f39f){logger[_0x5d85('0xd')](_0x5d85('0xe'),_0x5cca73,_0x5d85('0xf'));logger[_0x5d85('0x10')](_0x5d85('0x11'),_0x5cca73,'request\x20sent',JSON['stringify'](_0x54f39f));if(_0x54f39f[_0x5d85('0x12')]){if(_0x54f39f[_0x5d85('0x12')]['code']===0x1f4){logger[_0x5d85('0x12')](_0x5d85('0xe'),_0x5cca73,_0x54f39f[_0x5d85('0x12')][_0x5d85('0x13')]);return _0x2221ca(_0x54f39f[_0x5d85('0x12')][_0x5d85('0x13')]);}logger[_0x5d85('0x12')](_0x5d85('0xe'),_0x5cca73,_0x54f39f[_0x5d85('0x12')][_0x5d85('0x13')]);return _0x25f0f2(_0x54f39f['error']['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5cca73,'request\x20sent');_0x25f0f2(_0x54f39f[_0x5d85('0x14')][_0x5d85('0x13')]);}})[_0x5d85('0x15')](function(_0x82ee18){logger[_0x5d85('0x12')](_0x5d85('0xe'),_0x5cca73,_0x82ee18);_0x2221ca(_0x82ee18);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 6a58ae2..bfb0e56 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 _0x7a83=['/:id','/:id/answers','getAnswers','/:id/summary','post','create','/:id/clone','clone','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x3b9b95,_0x39d303){var _0x298bd2=function(_0x393b05){while(--_0x393b05){_0x3b9b95['push'](_0x3b9b95['shift']());}};_0x298bd2(++_0x39d303);}(_0x7a83,0x6e));var _0x37a8=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x7a83[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x37a8('0x0'));var util=require('util');var path=require(_0x37a8('0x1'));var timeout=require(_0x37a8('0x2'));var express=require('express');var router=express[_0x37a8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x37a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x37a8('0x5'));var controller=require(_0x37a8('0x6'));router[_0x37a8('0x7')]('/',auth[_0x37a8('0x8')](),controller[_0x37a8('0x9')]);router[_0x37a8('0x7')](_0x37a8('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x37a8('0x7')]('/:id/sessions',auth['isAuthenticated'](),controller['getSessions']);router[_0x37a8('0x7')](_0x37a8('0xb'),auth[_0x37a8('0x8')](),controller[_0x37a8('0xc')]);router[_0x37a8('0x7')](_0x37a8('0xd'),auth[_0x37a8('0x8')](),timeout('30s'),controller['getSummary']);router[_0x37a8('0xe')]('/',auth[_0x37a8('0x8')](),controller[_0x37a8('0xf')]);router[_0x37a8('0xe')](_0x37a8('0x10'),auth[_0x37a8('0x8')](),controller[_0x37a8('0x11')]);router['put'](_0x37a8('0xa'),auth[_0x37a8('0x8')](),controller['update']);router['delete'](_0x37a8('0xa'),auth[_0x37a8('0x8')](),controller[_0x37a8('0x12')]);module[_0x37a8('0x13')]=router; \ No newline at end of file +var _0x2f4d=['create','/:id/clone','put','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','index','/:id','show','/:id/sessions','getSessions','isAuthenticated','getAnswers','/:id/summary','getSummary','post'];(function(_0x271f4f,_0x19f01f){var _0x359814=function(_0x2e68d4){while(--_0x2e68d4){_0x271f4f['push'](_0x271f4f['shift']());}};_0x359814(++_0x19f01f);}(_0x2f4d,0xf4));var _0xd2f4=function(_0x45fcc5,_0x2d1425){_0x45fcc5=_0x45fcc5-0x0;var _0x4bb44d=_0x2f4d[_0x45fcc5];return _0x4bb44d;};'use strict';var multer=require(_0xd2f4('0x0'));var util=require(_0xd2f4('0x1'));var path=require(_0xd2f4('0x2'));var timeout=require(_0xd2f4('0x3'));var express=require(_0xd2f4('0x4'));var router=express[_0xd2f4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd2f4('0x6'));var interaction=require(_0xd2f4('0x7'));var config=require('../../config/environment');var controller=require(_0xd2f4('0x8'));router[_0xd2f4('0x9')]('/',auth['isAuthenticated'](),controller[_0xd2f4('0xa')]);router[_0xd2f4('0x9')](_0xd2f4('0xb'),auth['isAuthenticated'](),controller[_0xd2f4('0xc')]);router['get'](_0xd2f4('0xd'),auth['isAuthenticated'](),controller[_0xd2f4('0xe')]);router[_0xd2f4('0x9')]('/:id/answers',auth[_0xd2f4('0xf')](),controller[_0xd2f4('0x10')]);router[_0xd2f4('0x9')](_0xd2f4('0x11'),auth['isAuthenticated'](),timeout('30s'),controller[_0xd2f4('0x12')]);router[_0xd2f4('0x13')]('/',auth[_0xd2f4('0xf')](),controller[_0xd2f4('0x14')]);router[_0xd2f4('0x13')](_0xd2f4('0x15'),auth[_0xd2f4('0xf')](),controller['clone']);router[_0xd2f4('0x16')]('/:id',auth[_0xd2f4('0xf')](),controller['update']);router[_0xd2f4('0x17')](_0xd2f4('0xb'),auth[_0xd2f4('0xf')](),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 0657ac8..18bf27d 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 _0x3aa2=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','getDataValue','description','sequelize','lodash','util','exports','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x3e8c05,_0x407623){var _0x39f671=function(_0x2cbcb3){while(--_0x2cbcb3){_0x3e8c05['push'](_0x3e8c05['shift']());}};_0x39f671(++_0x407623);}(_0x3aa2,0x134));var _0x23aa=function(_0x3773dd,_0x2d0048){_0x3773dd=_0x3773dd-0x0;var _0x212e34=_0x3aa2[_0x3773dd];return _0x212e34;};'use strict';var Sequelize=require(_0x23aa('0x0'));var _=require(_0x23aa('0x1'));var util=require(_0x23aa('0x2'));module[_0x23aa('0x3')]={'name':{'type':Sequelize[_0x23aa('0x4')],'unique':'name'},'description':{'type':Sequelize[_0x23aa('0x4')]},'formData':{'type':Sequelize[_0x23aa('0x5')](_0x23aa('0x6')),'set':function(_0x4a15ba){if(_[_0x23aa('0x7')](_0x4a15ba)){this[_0x23aa('0x8')](_0x23aa('0x9'),JSON[_0x23aa('0xa')](_0x4a15ba));}else if(_[_0x23aa('0xb')](_0x4a15ba)){this[_0x23aa('0x8')](_0x23aa('0x9'),_0x4a15ba);}else{this[_0x23aa('0x8')](_0x23aa('0x9'),util['format'](_0x23aa('0xc'),this['getDataValue'](_0x23aa('0xd'))||'',this[_0x23aa('0xe')](_0x23aa('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbc6e=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','long','isObjectLike','setDataValue','formData','stringify','isString'];(function(_0x5c7943,_0x249c59){var _0x4dfe6b=function(_0x544410){while(--_0x544410){_0x5c7943['push'](_0x5c7943['shift']());}};_0x4dfe6b(++_0x249c59);}(_0xbc6e,0x1c0));var _0xebc6=function(_0x1dc67b,_0x1cf1c6){_0x1dc67b=_0x1dc67b-0x0;var _0x1cf400=_0xbc6e[_0x1dc67b];return _0x1cf400;};'use strict';var Sequelize=require(_0xebc6('0x0'));var _=require(_0xebc6('0x1'));var util=require(_0xebc6('0x2'));module[_0xebc6('0x3')]={'name':{'type':Sequelize[_0xebc6('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xebc6('0x4')]},'formData':{'type':Sequelize['TEXT'](_0xebc6('0x5')),'set':function(_0x39dd9b){if(_[_0xebc6('0x6')](_0x39dd9b)){this[_0xebc6('0x7')](_0xebc6('0x8'),JSON[_0xebc6('0x9')](_0x39dd9b));}else if(_[_0xebc6('0xa')](_0x39dd9b)){this['setDataValue'](_0xebc6('0x8'),_0x39dd9b);}else{this[_0xebc6('0x7')](_0xebc6('0x8'),util[_0xebc6('0xb')](_0xebc6('0xc'),this[_0xebc6('0xd')](_0xebc6('0xe'))||'',this[_0xebc6('0xd')](_0xebc6('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xebc6('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xebc6('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 5881bab..e36c161 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 _0x1f75=['JscriptyProject','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','update','getSessions','findOne','JscriptySessionReport','nolimit','getAnswers','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','end','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','Projects','error','stack','name','send','map'];(function(_0x524c25,_0x2e9065){var _0x2d7051=function(_0x16b013){while(--_0x16b013){_0x524c25['push'](_0x524c25['shift']());}};_0x2d7051(++_0x2e9065);}(_0x1f75,0x13c));var _0x51f7=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1f75[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51f7('0x0'));var zipdir=require(_0x51f7('0x1'));var jsonpatch=require(_0x51f7('0x2'));var rp=require(_0x51f7('0x3'));var moment=require(_0x51f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51f7('0x5'));var util=require(_0x51f7('0x6'));var path=require(_0x51f7('0x7'));var sox=require(_0x51f7('0x8'));var csv=require(_0x51f7('0x9'));var ejs=require(_0x51f7('0xa'));var fs=require('fs');var fs_extra=require(_0x51f7('0xb'));var _=require(_0x51f7('0xc'));var squel=require(_0x51f7('0xd'));var crypto=require(_0x51f7('0xe'));var jsforce=require(_0x51f7('0xf'));var deskjs=require(_0x51f7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x51f7('0x11'));var Papa=require(_0x51f7('0x12'));var Redis=require('ioredis');var authService=require(_0x51f7('0x13'));var qs=require(_0x51f7('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x51f7('0x15'))(_0x51f7('0x16'));var utils=require('../../config/utils');var config=require(_0x51f7('0x17'));var licenseUtil=require(_0x51f7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x452c6b,_0x180e9d){_0x180e9d=_0x180e9d||0xcc;return function(_0x11cc37){if(_0x11cc37){return _0x452c6b['sendStatus'](_0x180e9d);}return _0x452c6b['status'](_0x180e9d)[_0x51f7('0x19')]();};}function respondWithResult(_0x29884b,_0x3c4b5a){_0x3c4b5a=_0x3c4b5a||0xc8;return function(_0x3fc869){if(_0x3fc869){return _0x29884b[_0x51f7('0x1a')](_0x3c4b5a)[_0x51f7('0x1b')](_0x3fc869);}};}function respondWithFilteredResult(_0x56f9e3,_0x10aa7f){return function(_0x6e0f2e){if(_0x6e0f2e){var _0x12e09d=typeof _0x10aa7f[_0x51f7('0x1c')]===_0x51f7('0x1d')&&typeof _0x10aa7f[_0x51f7('0x1e')]===_0x51f7('0x1d');var _0x4f9fd0=_0x6e0f2e[_0x51f7('0x1f')];var _0x33d2a7=_0x12e09d?0x0:_0x10aa7f['offset'];var _0x1201c1=_0x12e09d?_0x6e0f2e[_0x51f7('0x1f')]:_0x10aa7f['offset']+_0x10aa7f['limit'];var _0x564686;if(_0x1201c1>=_0x4f9fd0){_0x1201c1=_0x4f9fd0;_0x564686=0xc8;}else{_0x564686=0xce;}_0x56f9e3[_0x51f7('0x1a')](_0x564686);return _0x56f9e3['set']('Content-Range',_0x33d2a7+'-'+_0x1201c1+'/'+_0x4f9fd0)[_0x51f7('0x1b')](_0x6e0f2e);}return null;};}function patchUpdates(_0x1decc1){return function(_0x475566){try{jsonpatch[_0x51f7('0x20')](_0x475566,_0x1decc1,!![]);}catch(_0x669234){return BPromise[_0x51f7('0x21')](_0x669234);}return _0x475566[_0x51f7('0x22')]();};}function saveUpdates(_0x22f585,_0x4e277e){return function(_0x28566c){if(_0x28566c){return _0x28566c['update'](_0x22f585)[_0x51f7('0x23')](function(_0x38801b){return _0x38801b;});}return null;};}function removeEntity(_0xa001f4,_0x1bde25){return function(_0x19e020){if(_0x19e020){return _0x19e020[_0x51f7('0x24')]()[_0x51f7('0x23')](function(){var _0x1b7282=_0x19e020[_0x51f7('0x25')]({'plain':!![]});var _0x10f90b=_0x51f7('0x26');return db['UserProfileResource'][_0x51f7('0x24')]({'where':{'type':_0x10f90b,'resourceId':_0x1b7282['id']}})[_0x51f7('0x23')](function(){return _0x19e020;});})[_0x51f7('0x23')](function(){_0xa001f4['status'](0xcc)[_0x51f7('0x19')]();});}};}function handleEntityNotFound(_0x11e723,_0x438edb){return function(_0x12461c){if(!_0x12461c){_0x11e723['sendStatus'](0x194);}return _0x12461c;};}function handleError(_0x2d61e8,_0x41f696){_0x41f696=_0x41f696||0x1f4;return function(_0x1d8bf6){logger[_0x51f7('0x27')](_0x1d8bf6[_0x51f7('0x28')]);if(_0x1d8bf6['name']){delete _0x1d8bf6[_0x51f7('0x29')];}_0x2d61e8[_0x51f7('0x1a')](_0x41f696)[_0x51f7('0x2a')](_0x1d8bf6);};}exports['index']=function(_0x1238ce,_0x50a2f4){var _0x4edee1={},_0x12a9ce={},_0x39c9bc={'count':0x0,'rows':[]};var _0x75946f=_[_0x51f7('0x2b')](db[_0x51f7('0x2c')][_0x51f7('0x2d')],function(_0x46bb0c){return{'name':_0x46bb0c['fieldName'],'type':_0x46bb0c['type'][_0x51f7('0x2e')]};});_0x12a9ce[_0x51f7('0x2f')]=_[_0x51f7('0x2b')](_0x75946f,_0x51f7('0x29'));_0x12a9ce[_0x51f7('0x30')]=_[_0x51f7('0x31')](_0x1238ce[_0x51f7('0x30')]);_0x12a9ce[_0x51f7('0x32')]=_[_0x51f7('0x33')](_0x12a9ce['model'],_0x12a9ce[_0x51f7('0x30')]);_0x4edee1['attributes']=_[_0x51f7('0x33')](_0x12a9ce['model'],qs[_0x51f7('0x34')](_0x1238ce['query'][_0x51f7('0x34')]));_0x4edee1['attributes']=_0x4edee1[_0x51f7('0x35')][_0x51f7('0x36')]?_0x4edee1[_0x51f7('0x35')]:_0x12a9ce['model'];if(!_0x1238ce[_0x51f7('0x30')][_0x51f7('0x37')]('nolimit')){_0x4edee1['limit']=qs['limit'](_0x1238ce[_0x51f7('0x30')][_0x51f7('0x1e')]);_0x4edee1[_0x51f7('0x1c')]=qs['offset'](_0x1238ce[_0x51f7('0x30')][_0x51f7('0x1c')]);}_0x4edee1[_0x51f7('0x38')]=qs['sort'](_0x1238ce[_0x51f7('0x30')][_0x51f7('0x39')]);_0x4edee1[_0x51f7('0x3a')]=qs['filters'](_[_0x51f7('0x3b')](_0x1238ce[_0x51f7('0x30')],_0x12a9ce[_0x51f7('0x32')]),_0x75946f);if(_0x1238ce['query'][_0x51f7('0x3c')]){_0x4edee1[_0x51f7('0x3a')]=_[_0x51f7('0x3d')](_0x4edee1[_0x51f7('0x3a')],{'$or':_[_0x51f7('0x2b')](_0x75946f,function(_0x58d701){if(_0x58d701[_0x51f7('0x3e')]!==_0x51f7('0x3f')){var _0xd30b96={};_0xd30b96[_0x58d701[_0x51f7('0x29')]]={'$like':'%'+_0x1238ce['query'][_0x51f7('0x3c')]+'%'};return _0xd30b96;}})});}_0x4edee1=_['merge']({},_0x4edee1,_0x1238ce[_0x51f7('0x40')]);var _0x3400c9={'where':_0x4edee1[_0x51f7('0x3a')]};return db[_0x51f7('0x2c')][_0x51f7('0x1f')](_0x3400c9)[_0x51f7('0x23')](function(_0x1339a3){_0x39c9bc[_0x51f7('0x1f')]=_0x1339a3;if(_0x1238ce[_0x51f7('0x30')][_0x51f7('0x41')]){_0x4edee1[_0x51f7('0x42')]=[{'all':!![]}];}return db[_0x51f7('0x2c')][_0x51f7('0x43')](_0x4edee1);})['then'](function(_0x53ba21){_0x39c9bc[_0x51f7('0x44')]=_0x53ba21;return _0x39c9bc;})[_0x51f7('0x23')](respondWithFilteredResult(_0x50a2f4,_0x4edee1))['catch'](handleError(_0x50a2f4,null));};exports['show']=function(_0x114a89,_0x1ae1cc){var _0x361ec5={'raw':![],'where':{'id':_0x114a89[_0x51f7('0x45')]['id']}},_0x499102={};_0x499102[_0x51f7('0x2f')]=_[_0x51f7('0x31')](db[_0x51f7('0x2c')]['rawAttributes']);_0x499102[_0x51f7('0x30')]=_[_0x51f7('0x31')](_0x114a89[_0x51f7('0x30')]);_0x499102[_0x51f7('0x32')]=_[_0x51f7('0x33')](_0x499102[_0x51f7('0x2f')],_0x499102[_0x51f7('0x30')]);_0x361ec5[_0x51f7('0x35')]=_['intersection'](_0x499102[_0x51f7('0x2f')],qs['fields'](_0x114a89[_0x51f7('0x30')][_0x51f7('0x34')]));_0x361ec5[_0x51f7('0x35')]=_0x361ec5[_0x51f7('0x35')][_0x51f7('0x36')]?_0x361ec5[_0x51f7('0x35')]:_0x499102[_0x51f7('0x2f')];if(_0x114a89[_0x51f7('0x30')]['includeAll']){_0x361ec5[_0x51f7('0x42')]=[{'all':!![]}];}_0x361ec5=_['merge']({},_0x361ec5,_0x114a89[_0x51f7('0x40')]);return db['JscriptyProject'][_0x51f7('0x46')](_0x361ec5)['then'](handleEntityNotFound(_0x1ae1cc,null))[_0x51f7('0x23')](respondWithResult(_0x1ae1cc,null))[_0x51f7('0x47')](handleError(_0x1ae1cc,null));};exports[_0x51f7('0x48')]=function(_0x501cb8,_0x5c0207){return db[_0x51f7('0x2c')][_0x51f7('0x48')](_0x501cb8[_0x51f7('0x49')],{})[_0x51f7('0x23')](function(_0x525a91){var _0x3c6f9f=_0x501cb8[_0x51f7('0x4a')][_0x51f7('0x25')]({'plain':!![]});if(!_0x3c6f9f)throw new Error(_0x51f7('0x4b'));if(_0x3c6f9f[_0x51f7('0x4c')]===_0x51f7('0x4a')){var _0x2ea89d=_0x525a91['get']({'plain':!![]});var _0x2a66ba=_0x51f7('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x2a66ba,'userProfileId':_0x3c6f9f[_0x51f7('0x4d')]},'raw':!![]})['then'](function(_0x20d437){if(_0x20d437&&_0x20d437[_0x51f7('0x4e')]===0x0){return db[_0x51f7('0x4f')]['create']({'name':_0x2ea89d[_0x51f7('0x29')],'resourceId':_0x2ea89d['id'],'type':_0x20d437['name'],'sectionId':_0x20d437['id']},{})[_0x51f7('0x23')](function(){return _0x525a91;});}else{return _0x525a91;}})[_0x51f7('0x47')](function(_0x1eadbc){logger[_0x51f7('0x27')](_0x51f7('0x50'),_0x1eadbc);throw _0x1eadbc;});}return _0x525a91;})['then'](respondWithResult(_0x5c0207,0xc9))[_0x51f7('0x47')](handleError(_0x5c0207,null));};exports[_0x51f7('0x51')]=function(_0x2f5444,_0x3ba3a6){var _0x3dc739={'where':{'id':_0x2f5444['params']['id']}},_0x1310c2={};_0x1310c2[_0x51f7('0x2f')]=_['keys'](db[_0x51f7('0x2c')][_0x51f7('0x2d')]);_0x3dc739['attributes']=_[_0x51f7('0x33')](_0x1310c2[_0x51f7('0x2f')],qs[_0x51f7('0x34')](_0x2f5444['query'][_0x51f7('0x34')]));_0x3dc739['attributes']=_0x3dc739[_0x51f7('0x35')][_0x51f7('0x36')]?_0x3dc739[_0x51f7('0x35')]:_0x1310c2[_0x51f7('0x2f')];if(_0x2f5444[_0x51f7('0x30')][_0x51f7('0x41')]){_0x3dc739[_0x51f7('0x42')]=[{'all':!![]}];}_0x3dc739=_[_0x51f7('0x3d')]({},_0x3dc739,_0x2f5444['options']);return db[_0x51f7('0x2c')][_0x51f7('0x46')](_0x3dc739)[_0x51f7('0x23')](handleEntityNotFound(_0x3ba3a6,null))[_0x51f7('0x23')](function(_0x8172dc){if(_0x8172dc){var _0x3206d1=_0x8172dc[_0x51f7('0x25')]({'plain':!![]});_0x3206d1=qs['omit'](_0x3206d1,['id',_0x51f7('0x52'),_0x51f7('0x53')]);_0x2f5444[_0x51f7('0x49')]=_[_0x51f7('0x54')](_0x2f5444[_0x51f7('0x49')],['id',_0x51f7('0x52'),_0x51f7('0x53')]);return db[_0x51f7('0x2c')][_0x51f7('0x48')](_[_0x51f7('0x3d')](_0x3206d1,_0x2f5444[_0x51f7('0x49')]),{'include':_0x2f5444[_0x51f7('0x30')][_0x51f7('0x41')]?[{'all':!![]}]:undefined})[_0x51f7('0x23')](function(_0x57e81d){var _0x53d196=_0x2f5444[_0x51f7('0x4a')]['get']({'plain':!![]});if(!_0x53d196)throw new Error(_0x51f7('0x4b'));if(_0x53d196[_0x51f7('0x4c')]===_0x51f7('0x4a')){var _0x52bfc6=_0x57e81d[_0x51f7('0x25')]({'plain':!![]});var _0x5aae6b=_0x51f7('0x26');return db[_0x51f7('0x55')][_0x51f7('0x46')]({'where':{'name':_0x5aae6b,'userProfileId':_0x53d196[_0x51f7('0x4d')]},'raw':!![]})[_0x51f7('0x23')](function(_0x2b173b){if(_0x2b173b&&_0x2b173b[_0x51f7('0x4e')]===0x0){return db[_0x51f7('0x4f')]['create']({'name':_0x52bfc6[_0x51f7('0x29')],'resourceId':_0x52bfc6['id'],'type':_0x2b173b[_0x51f7('0x29')],'sectionId':_0x2b173b['id']},{})[_0x51f7('0x23')](function(){return _0x57e81d;});}else{return _0x57e81d;}})[_0x51f7('0x47')](function(_0x217e5c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x217e5c);throw _0x217e5c;});}return _0x57e81d;});}})['then'](respondWithResult(_0x3ba3a6,0xc9))[_0x51f7('0x47')](handleError(_0x3ba3a6,null));};exports[_0x51f7('0x56')]=function(_0x4ef842,_0xe5988d){if(_0x4ef842[_0x51f7('0x49')]['id']){delete _0x4ef842[_0x51f7('0x49')]['id'];}return db[_0x51f7('0x2c')][_0x51f7('0x46')]({'where':{'id':_0x4ef842[_0x51f7('0x45')]['id']}})[_0x51f7('0x23')](handleEntityNotFound(_0xe5988d,null))['then'](saveUpdates(_0x4ef842[_0x51f7('0x49')],null))[_0x51f7('0x23')](respondWithResult(_0xe5988d,null))[_0x51f7('0x47')](handleError(_0xe5988d,null));};exports[_0x51f7('0x24')]=function(_0x5a896a,_0x122ae0){return db[_0x51f7('0x2c')][_0x51f7('0x46')]({'where':{'id':_0x5a896a['params']['id']}})[_0x51f7('0x23')](handleEntityNotFound(_0x122ae0,null))[_0x51f7('0x23')](removeEntity(_0x122ae0,null))[_0x51f7('0x47')](handleError(_0x122ae0,null));};exports[_0x51f7('0x57')]=function(_0x1f4115,_0x3d9cc4,_0x166f84){var _0x4c6409={'raw':!![],'where':{}};var _0x2a9ac0={};var _0x278329={'count':0x0,'rows':[]};return db[_0x51f7('0x2c')][_0x51f7('0x58')]({'where':{'id':_0x1f4115[_0x51f7('0x45')]['id']}})[_0x51f7('0x23')](handleEntityNotFound(_0x3d9cc4,null))[_0x51f7('0x23')](function(_0x583ea5){if(_0x583ea5){_0x2a9ac0[_0x51f7('0x2f')]=_[_0x51f7('0x31')](db[_0x51f7('0x59')]['rawAttributes']);_0x2a9ac0[_0x51f7('0x30')]=_[_0x51f7('0x31')](_0x1f4115[_0x51f7('0x30')]);_0x2a9ac0[_0x51f7('0x32')]=_['intersection'](_0x2a9ac0[_0x51f7('0x2f')],_0x2a9ac0[_0x51f7('0x30')]);_0x4c6409['attributes']=_[_0x51f7('0x33')](_0x2a9ac0[_0x51f7('0x2f')],qs['fields'](_0x1f4115[_0x51f7('0x30')][_0x51f7('0x34')]));_0x4c6409['attributes']=_0x4c6409['attributes']['length']?_0x4c6409[_0x51f7('0x35')]:_0x2a9ac0['model'];if(!_0x1f4115[_0x51f7('0x30')][_0x51f7('0x37')](_0x51f7('0x5a'))){_0x4c6409[_0x51f7('0x1e')]=qs[_0x51f7('0x1e')](_0x1f4115[_0x51f7('0x30')][_0x51f7('0x1e')]);_0x4c6409[_0x51f7('0x1c')]=qs['offset'](_0x1f4115[_0x51f7('0x30')][_0x51f7('0x1c')]);}_0x4c6409[_0x51f7('0x38')]=qs[_0x51f7('0x39')](_0x1f4115[_0x51f7('0x30')]['sort']);_0x4c6409[_0x51f7('0x3a')]=qs[_0x51f7('0x32')](_[_0x51f7('0x3b')](_0x1f4115[_0x51f7('0x30')],_0x2a9ac0[_0x51f7('0x32')]));_0x4c6409[_0x51f7('0x3a')]['ProjectId']=_0x583ea5['id'];if(_0x1f4115['query'][_0x51f7('0x3c')]){_0x4c6409[_0x51f7('0x3a')]=_['merge'](_0x4c6409[_0x51f7('0x3a')],{'$or':_[_0x51f7('0x2b')](_0x4c6409[_0x51f7('0x35')],function(_0x250ffe){var _0x43e109={};_0x43e109[_0x250ffe]={'$like':'%'+_0x1f4115[_0x51f7('0x30')][_0x51f7('0x3c')]+'%'};return _0x43e109;})});}_0x4c6409=_[_0x51f7('0x3d')]({},_0x4c6409,_0x1f4115[_0x51f7('0x40')]);return db[_0x51f7('0x59')][_0x51f7('0x1f')]({'where':_0x4c6409[_0x51f7('0x3a')]})['then'](function(_0x2df077){_0x278329[_0x51f7('0x1f')]=_0x2df077;if(_0x1f4115[_0x51f7('0x30')]['includeAll']){_0x4c6409['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4c6409);})['then'](function(_0x2e1352){_0x278329['rows']=_0x2e1352;return _0x278329;});}})[_0x51f7('0x23')](respondWithFilteredResult(_0x3d9cc4,_0x4c6409))['catch'](handleError(_0x3d9cc4,null));};exports[_0x51f7('0x5b')]=function(_0x376a89,_0x47e5ea,_0x1603e2){var _0x3a4ca9={'raw':!![],'where':{}};var _0x4c8b6e={};var _0x370b9c={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x51f7('0x58')]({'where':{'id':_0x376a89[_0x51f7('0x45')]['id']}})[_0x51f7('0x23')](handleEntityNotFound(_0x47e5ea,null))[_0x51f7('0x23')](function(_0xee882c){if(_0xee882c){_0x4c8b6e[_0x51f7('0x2f')]=_[_0x51f7('0x31')](db[_0x51f7('0x5c')][_0x51f7('0x2d')]);_0x4c8b6e['query']=_[_0x51f7('0x31')](_0x376a89[_0x51f7('0x30')]);_0x4c8b6e[_0x51f7('0x32')]=_[_0x51f7('0x33')](_0x4c8b6e[_0x51f7('0x2f')],_0x4c8b6e['query']);_0x3a4ca9[_0x51f7('0x35')]=_[_0x51f7('0x33')](_0x4c8b6e[_0x51f7('0x2f')],qs[_0x51f7('0x34')](_0x376a89[_0x51f7('0x30')][_0x51f7('0x34')]));_0x3a4ca9[_0x51f7('0x35')]=_0x3a4ca9[_0x51f7('0x35')]['length']?_0x3a4ca9[_0x51f7('0x35')]:_0x4c8b6e[_0x51f7('0x2f')];if(!_0x376a89[_0x51f7('0x30')][_0x51f7('0x37')]('nolimit')){_0x3a4ca9[_0x51f7('0x1e')]=qs[_0x51f7('0x1e')](_0x376a89[_0x51f7('0x30')][_0x51f7('0x1e')]);_0x3a4ca9[_0x51f7('0x1c')]=qs[_0x51f7('0x1c')](_0x376a89[_0x51f7('0x30')][_0x51f7('0x1c')]);}_0x3a4ca9[_0x51f7('0x38')]=qs[_0x51f7('0x39')](_0x376a89[_0x51f7('0x30')][_0x51f7('0x39')]);_0x3a4ca9[_0x51f7('0x3a')]=qs['filters'](_[_0x51f7('0x3b')](_0x376a89['query'],_0x4c8b6e['filters']));_0x3a4ca9['where']['ProjectId']=_0xee882c['id'];if(_0x376a89[_0x51f7('0x30')][_0x51f7('0x3c')]){_0x3a4ca9['where']=_[_0x51f7('0x3d')](_0x3a4ca9['where'],{'$or':_[_0x51f7('0x2b')](_0x3a4ca9[_0x51f7('0x35')],function(_0xbaa73c){var _0x41fd2e={};_0x41fd2e[_0xbaa73c]={'$like':'%'+_0x376a89[_0x51f7('0x30')][_0x51f7('0x3c')]+'%'};return _0x41fd2e;})});}_0x3a4ca9=_[_0x51f7('0x3d')]({},_0x3a4ca9,_0x376a89[_0x51f7('0x40')]);return db[_0x51f7('0x5c')][_0x51f7('0x1f')]({'where':_0x3a4ca9[_0x51f7('0x3a')]})[_0x51f7('0x23')](function(_0x2de3ef){_0x370b9c[_0x51f7('0x1f')]=_0x2de3ef;if(_0x376a89[_0x51f7('0x30')][_0x51f7('0x41')]){_0x3a4ca9[_0x51f7('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x51f7('0x43')](_0x3a4ca9);})[_0x51f7('0x23')](function(_0x29cb48){_0x370b9c[_0x51f7('0x44')]=_0x29cb48;return _0x370b9c;});}})['then'](respondWithFilteredResult(_0x47e5ea,_0x3a4ca9))[_0x51f7('0x47')](handleError(_0x47e5ea,null));};function char(_0x14be28){return _0x51f7('0x5d')===typeof _0x14be28?String[_0x51f7('0x5e')][_0x51f7('0x20')](null,arguments):_0x14be28;}function needsEncapsulation(_0x38a355){return!!_0x38a355&&(_0x38a355['toString']()[_0x51f7('0x5f')](char(0xd))>=0x0||_0x38a355['toString']()[_0x51f7('0x5f')](char(0xa))>=0x0||_0x38a355[_0x51f7('0x60')]()['indexOf'](char(0x2c))>=0x0||_0x38a355['toString']()[_0x51f7('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x14aa7e){var _0x1f1670=char(0x22),_0x728e42='\x5c'+char(0x22),_0x631a15=_0x14aa7e['toString']()['replace'](new RegExp(_0x1f1670,'g'),_0x728e42);return _0x1f1670+_0x631a15+_0x1f1670;}exports['getSummary']=function(_0x161e67,_0x5f4c35,_0x30e868){var _0x271e7f,_0x2fd3b1;var _0x30ba11={'where':{'ProjectId':_0x161e67[_0x51f7('0x45')]['id']}};if(_0x161e67[_0x51f7('0x30')]['startTime']){_0x30ba11['where'][_0x51f7('0x61')]=JSON[_0x51f7('0x62')](_0x161e67['query'][_0x51f7('0x63')]);}return db[_0x51f7('0x59')][_0x51f7('0x43')](_0x30ba11)[_0x51f7('0x23')](handleEntityNotFound(_0x5f4c35,null))['then'](function(_0x304897){if(_0x304897){_0x271e7f=_0x304897;return db[_0x51f7('0x64')][_0x51f7('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x271e7f,'id')},'ProjectId':_0x161e67[_0x51f7('0x45')]['id']},'order':_0x51f7('0x65')});}})[_0x51f7('0x23')](handleEntityNotFound(_0x5f4c35,null))[_0x51f7('0x23')](function(_0x1881cc){if(_0x1881cc){_0x2fd3b1=_0x1881cc;var _0x38c8d2={};for(var _0x171920=0x0,_0x54c8ab=_0x2fd3b1[_0x51f7('0x36')];_0x171920<_0x54c8ab;_0x171920++){if(!_0x38c8d2[_0x51f7('0x37')](_0x2fd3b1[_0x171920][_0x51f7('0x66')])){_0x38c8d2[_0x2fd3b1[_0x171920][_0x51f7('0x66')]]=needsEncapsulation(_0x2fd3b1[_0x171920][_0x51f7('0x67')])?encapsulate(_0x2fd3b1[_0x171920]['question']):_0x2fd3b1[_0x171920]['question'];}}var _0x449fe7=[],_0x6e3999={};for(var _0x39db6b=0x0,_0xc33aba=_0x271e7f[_0x51f7('0x36')];_0x39db6b<_0xc33aba;_0x39db6b++){_0x6e3999={'ProjectId':_0x161e67[_0x51f7('0x45')]['id'],'SessionId':_0x271e7f[_0x39db6b]['id'],'StartTime':moment(_0x271e7f[_0x39db6b][_0x51f7('0x61')])[_0x51f7('0x68')](_0x51f7('0x69'))};for(var _0x564633=0x0,_0x5c18f3=_0x2fd3b1[_0x51f7('0x36')];_0x564633<_0x5c18f3;_0x564633++){if(_0x2fd3b1[_0x564633][_0x51f7('0x6a')]==_0x271e7f[_0x39db6b]['id']&&_0x38c8d2[_0x51f7('0x37')](_0x2fd3b1[_0x564633][_0x51f7('0x66')])){_0x6e3999[_0x38c8d2[_0x2fd3b1[_0x564633][_0x51f7('0x66')]]]=_0x2fd3b1[_0x564633][_0x51f7('0x6b')];}}for(var _0x56da1e in _0x38c8d2){if(!_0x6e3999[_0x51f7('0x37')](_0x38c8d2[_0x56da1e])){_0x6e3999[_0x38c8d2[_0x56da1e]]=null;}}_0x449fe7[_0x51f7('0x6c')](_0x6e3999);}return _0x449fe7;}})[_0x51f7('0x23')](function(_0xa77342){if(!_[_0x51f7('0x6d')](_0xa77342)){var _0x7816f8=toCsv(_0xa77342);var _0x29545d=Date[_0x51f7('0x6e')]();fs[_0x51f7('0x6f')](util[_0x51f7('0x68')](_0x51f7('0x70'),_0x161e67[_0x51f7('0x45')]['id'],_0x29545d),_0x7816f8);_0x5f4c35[_0x51f7('0x71')](_0x51f7('0x72'),_0x51f7('0x73')+util[_0x51f7('0x68')](_0x51f7('0x74'),_0x161e67[_0x51f7('0x45')]['id'],_0x29545d));_0x5f4c35['setHeader']('Content-type',_0x51f7('0x75'));return _0x5f4c35[_0x51f7('0x76')](util[_0x51f7('0x68')](_0x51f7('0x70'),_0x161e67[_0x51f7('0x45')]['id'],_0x29545d));}else{return _0x5f4c35[_0x51f7('0x77')](0xcc);}})['catch'](handleError(_0x5f4c35,null));}; \ No newline at end of file +var _0xc5dc=['apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','end','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','JscriptyProject','includeAll','findAll','catch','show','params','keys','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','role','autoAssociation','getSessions','JscriptySessionReport','JscriptyAnswerReport','include','rows','number','toString','indexOf','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','zip-dir','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','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','count','Content-Range'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xc5dc,0xc2));var _0xcc5d=function(_0x59a81c,_0x7d1496){_0x59a81c=_0x59a81c-0x0;var _0x27286b=_0xc5dc[_0x59a81c];return _0x27286b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc5d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc5d('0x1'));var BPromise=require(_0xcc5d('0x2'));var Mustache=require('mustache');var util=require(_0xcc5d('0x3'));var path=require('path');var sox=require(_0xcc5d('0x4'));var csv=require(_0xcc5d('0x5'));var ejs=require(_0xcc5d('0x6'));var fs=require('fs');var fs_extra=require(_0xcc5d('0x7'));var _=require(_0xcc5d('0x8'));var squel=require(_0xcc5d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcc5d('0xa'));var toCsv=require(_0xcc5d('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc5d('0xb'));var authService=require(_0xcc5d('0xc'));var qs=require(_0xcc5d('0xd'));var as=require(_0xcc5d('0xe'));var hardwareService=require(_0xcc5d('0xf'));var logger=require('../../config/logger')(_0xcc5d('0x10'));var utils=require(_0xcc5d('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xcc5d('0x12'));var db=require(_0xcc5d('0x13'))['db'];function respondWithStatusCode(_0xb0f24d,_0x38c0de){_0x38c0de=_0x38c0de||0xcc;return function(_0x407c49){if(_0x407c49){return _0xb0f24d[_0xcc5d('0x14')](_0x38c0de);}return _0xb0f24d[_0xcc5d('0x15')](_0x38c0de)['end']();};}function respondWithResult(_0x4fb7d7,_0x2d2f17){_0x2d2f17=_0x2d2f17||0xc8;return function(_0x8289a3){if(_0x8289a3){return _0x4fb7d7[_0xcc5d('0x15')](_0x2d2f17)[_0xcc5d('0x16')](_0x8289a3);}};}function respondWithFilteredResult(_0x457e16,_0x29a5e1){return function(_0x2b266c){if(_0x2b266c){var _0x539993=typeof _0x29a5e1[_0xcc5d('0x17')]===_0xcc5d('0x18')&&typeof _0x29a5e1[_0xcc5d('0x19')]==='undefined';var _0x4ae9ff=_0x2b266c[_0xcc5d('0x1a')];var _0x49f78a=_0x539993?0x0:_0x29a5e1[_0xcc5d('0x17')];var _0x239098=_0x539993?_0x2b266c['count']:_0x29a5e1['offset']+_0x29a5e1[_0xcc5d('0x19')];var _0x142452;if(_0x239098>=_0x4ae9ff){_0x239098=_0x4ae9ff;_0x142452=0xc8;}else{_0x142452=0xce;}_0x457e16['status'](_0x142452);return _0x457e16['set'](_0xcc5d('0x1b'),_0x49f78a+'-'+_0x239098+'/'+_0x4ae9ff)[_0xcc5d('0x16')](_0x2b266c);}return null;};}function patchUpdates(_0x30bfa6){return function(_0x37da96){try{jsonpatch[_0xcc5d('0x1c')](_0x37da96,_0x30bfa6,!![]);}catch(_0x28938f){return BPromise[_0xcc5d('0x1d')](_0x28938f);}return _0x37da96[_0xcc5d('0x1e')]();};}function saveUpdates(_0x57200b,_0x3e92af){return function(_0xd229eb){if(_0xd229eb){return _0xd229eb[_0xcc5d('0x1f')](_0x57200b)[_0xcc5d('0x20')](function(_0xbb63bc){return _0xbb63bc;});}return null;};}function removeEntity(_0x4ee308,_0x9ea7f3){return function(_0x53db6c){if(_0x53db6c){return _0x53db6c['destroy']()[_0xcc5d('0x20')](function(){var _0x485ba4=_0x53db6c[_0xcc5d('0x21')]({'plain':!![]});var _0x5b3db9=_0xcc5d('0x22');return db[_0xcc5d('0x23')][_0xcc5d('0x24')]({'where':{'type':_0x5b3db9,'resourceId':_0x485ba4['id']}})['then'](function(){return _0x53db6c;});})['then'](function(){_0x4ee308['status'](0xcc)[_0xcc5d('0x25')]();});}};}function handleEntityNotFound(_0x878720,_0x5dff59){return function(_0x19343f){if(!_0x19343f){_0x878720[_0xcc5d('0x14')](0x194);}return _0x19343f;};}function handleError(_0x55d9c4,_0x313215){_0x313215=_0x313215||0x1f4;return function(_0x42d926){logger[_0xcc5d('0x26')](_0x42d926[_0xcc5d('0x27')]);if(_0x42d926['name']){delete _0x42d926[_0xcc5d('0x28')];}_0x55d9c4[_0xcc5d('0x15')](_0x313215)[_0xcc5d('0x29')](_0x42d926);};}exports['index']=function(_0x86dc6f,_0x1e77eb){var _0x13ce1d={},_0x2d8544={},_0x30a7f8={'count':0x0,'rows':[]};var _0x29b4be=_[_0xcc5d('0x2a')](db['JscriptyProject'][_0xcc5d('0x2b')],function(_0x197cb9){return{'name':_0x197cb9['fieldName'],'type':_0x197cb9[_0xcc5d('0x2c')][_0xcc5d('0x2d')]};});_0x2d8544[_0xcc5d('0x2e')]=_[_0xcc5d('0x2a')](_0x29b4be,_0xcc5d('0x28'));_0x2d8544['query']=_['keys'](_0x86dc6f[_0xcc5d('0x2f')]);_0x2d8544[_0xcc5d('0x30')]=_[_0xcc5d('0x31')](_0x2d8544['model'],_0x2d8544[_0xcc5d('0x2f')]);_0x13ce1d[_0xcc5d('0x32')]=_[_0xcc5d('0x31')](_0x2d8544[_0xcc5d('0x2e')],qs[_0xcc5d('0x33')](_0x86dc6f['query'][_0xcc5d('0x33')]));_0x13ce1d[_0xcc5d('0x32')]=_0x13ce1d[_0xcc5d('0x32')][_0xcc5d('0x34')]?_0x13ce1d['attributes']:_0x2d8544['model'];if(!_0x86dc6f[_0xcc5d('0x2f')][_0xcc5d('0x35')](_0xcc5d('0x36'))){_0x13ce1d['limit']=qs['limit'](_0x86dc6f[_0xcc5d('0x2f')][_0xcc5d('0x19')]);_0x13ce1d[_0xcc5d('0x17')]=qs[_0xcc5d('0x17')](_0x86dc6f[_0xcc5d('0x2f')]['offset']);}_0x13ce1d[_0xcc5d('0x37')]=qs['sort'](_0x86dc6f[_0xcc5d('0x2f')][_0xcc5d('0x38')]);_0x13ce1d[_0xcc5d('0x39')]=qs[_0xcc5d('0x30')](_[_0xcc5d('0x3a')](_0x86dc6f[_0xcc5d('0x2f')],_0x2d8544[_0xcc5d('0x30')]),_0x29b4be);if(_0x86dc6f[_0xcc5d('0x2f')]['filter']){_0x13ce1d[_0xcc5d('0x39')]=_['merge'](_0x13ce1d[_0xcc5d('0x39')],{'$or':_[_0xcc5d('0x2a')](_0x29b4be,function(_0x2715a0){if(_0x2715a0[_0xcc5d('0x2c')]!=='VIRTUAL'){var _0x595fd4={};_0x595fd4[_0x2715a0['name']]={'$like':'%'+_0x86dc6f['query'][_0xcc5d('0x3b')]+'%'};return _0x595fd4;}})});}_0x13ce1d=_['merge']({},_0x13ce1d,_0x86dc6f[_0xcc5d('0x3c')]);var _0x2bd6d7={'where':_0x13ce1d[_0xcc5d('0x39')]};return db[_0xcc5d('0x3d')][_0xcc5d('0x1a')](_0x2bd6d7)['then'](function(_0x3bab9b){_0x30a7f8[_0xcc5d('0x1a')]=_0x3bab9b;if(_0x86dc6f[_0xcc5d('0x2f')][_0xcc5d('0x3e')]){_0x13ce1d['include']=[{'all':!![]}];}return db[_0xcc5d('0x3d')][_0xcc5d('0x3f')](_0x13ce1d);})['then'](function(_0x4f80c6){_0x30a7f8['rows']=_0x4f80c6;return _0x30a7f8;})[_0xcc5d('0x20')](respondWithFilteredResult(_0x1e77eb,_0x13ce1d))[_0xcc5d('0x40')](handleError(_0x1e77eb,null));};exports[_0xcc5d('0x41')]=function(_0x275efd,_0x42918c){var _0x564ca1={'raw':![],'where':{'id':_0x275efd[_0xcc5d('0x42')]['id']}},_0x1bbd04={};_0x1bbd04['model']=_[_0xcc5d('0x43')](db['JscriptyProject'][_0xcc5d('0x2b')]);_0x1bbd04[_0xcc5d('0x2f')]=_['keys'](_0x275efd[_0xcc5d('0x2f')]);_0x1bbd04[_0xcc5d('0x30')]=_[_0xcc5d('0x31')](_0x1bbd04[_0xcc5d('0x2e')],_0x1bbd04[_0xcc5d('0x2f')]);_0x564ca1['attributes']=_[_0xcc5d('0x31')](_0x1bbd04['model'],qs[_0xcc5d('0x33')](_0x275efd['query'][_0xcc5d('0x33')]));_0x564ca1[_0xcc5d('0x32')]=_0x564ca1[_0xcc5d('0x32')][_0xcc5d('0x34')]?_0x564ca1[_0xcc5d('0x32')]:_0x1bbd04[_0xcc5d('0x2e')];if(_0x275efd['query']['includeAll']){_0x564ca1['include']=[{'all':!![]}];}_0x564ca1=_[_0xcc5d('0x44')]({},_0x564ca1,_0x275efd[_0xcc5d('0x3c')]);return db[_0xcc5d('0x3d')][_0xcc5d('0x45')](_0x564ca1)[_0xcc5d('0x20')](handleEntityNotFound(_0x42918c,null))[_0xcc5d('0x20')](respondWithResult(_0x42918c,null))[_0xcc5d('0x40')](handleError(_0x42918c,null));};exports['create']=function(_0x34e331,_0xd5b455){return db['JscriptyProject'][_0xcc5d('0x46')](_0x34e331['body'],{})['then'](function(_0x5cfe6f){var _0x15913f=_0x34e331[_0xcc5d('0x47')][_0xcc5d('0x21')]({'plain':!![]});if(!_0x15913f)throw new Error(_0xcc5d('0x48'));if(_0x15913f['role']==='user'){var _0x5ee762=_0x5cfe6f[_0xcc5d('0x21')]({'plain':!![]});var _0x168869='Projects';return db[_0xcc5d('0x49')][_0xcc5d('0x45')]({'where':{'name':_0x168869,'userProfileId':_0x15913f[_0xcc5d('0x4a')]},'raw':!![]})['then'](function(_0x4ea918){if(_0x4ea918&&_0x4ea918['autoAssociation']===0x0){return db[_0xcc5d('0x23')]['create']({'name':_0x5ee762[_0xcc5d('0x28')],'resourceId':_0x5ee762['id'],'type':_0x4ea918[_0xcc5d('0x28')],'sectionId':_0x4ea918['id']},{})[_0xcc5d('0x20')](function(){return _0x5cfe6f;});}else{return _0x5cfe6f;}})['catch'](function(_0x1a8875){logger[_0xcc5d('0x26')](_0xcc5d('0x4b'),_0x1a8875);throw _0x1a8875;});}return _0x5cfe6f;})[_0xcc5d('0x20')](respondWithResult(_0xd5b455,0xc9))[_0xcc5d('0x40')](handleError(_0xd5b455,null));};exports['clone']=function(_0x3782a2,_0x519a2d){var _0x20b213={'where':{'id':_0x3782a2[_0xcc5d('0x42')]['id']}},_0x4a375c={};_0x4a375c['model']=_[_0xcc5d('0x43')](db[_0xcc5d('0x3d')][_0xcc5d('0x2b')]);_0x20b213[_0xcc5d('0x32')]=_[_0xcc5d('0x31')](_0x4a375c[_0xcc5d('0x2e')],qs['fields'](_0x3782a2[_0xcc5d('0x2f')][_0xcc5d('0x33')]));_0x20b213['attributes']=_0x20b213[_0xcc5d('0x32')]['length']?_0x20b213[_0xcc5d('0x32')]:_0x4a375c[_0xcc5d('0x2e')];if(_0x3782a2[_0xcc5d('0x2f')][_0xcc5d('0x3e')]){_0x20b213['include']=[{'all':!![]}];}_0x20b213=_[_0xcc5d('0x44')]({},_0x20b213,_0x3782a2['options']);return db[_0xcc5d('0x3d')][_0xcc5d('0x45')](_0x20b213)['then'](handleEntityNotFound(_0x519a2d,null))[_0xcc5d('0x20')](function(_0x4c62d1){if(_0x4c62d1){var _0x512ba3=_0x4c62d1['get']({'plain':!![]});_0x512ba3=qs[_0xcc5d('0x4c')](_0x512ba3,['id',_0xcc5d('0x4d'),_0xcc5d('0x4e')]);_0x3782a2['body']=_[_0xcc5d('0x4c')](_0x3782a2['body'],['id',_0xcc5d('0x4d'),'updatedAt']);return db[_0xcc5d('0x3d')][_0xcc5d('0x46')](_[_0xcc5d('0x44')](_0x512ba3,_0x3782a2[_0xcc5d('0x4f')]),{'include':_0x3782a2[_0xcc5d('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0xcc5d('0x20')](function(_0x2ab715){var _0x162f12=_0x3782a2[_0xcc5d('0x47')]['get']({'plain':!![]});if(!_0x162f12)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x162f12[_0xcc5d('0x50')]===_0xcc5d('0x47')){var _0x4d6856=_0x2ab715[_0xcc5d('0x21')]({'plain':!![]});var _0x3e8356=_0xcc5d('0x22');return db['UserProfileSection'][_0xcc5d('0x45')]({'where':{'name':_0x3e8356,'userProfileId':_0x162f12['userProfileId']},'raw':!![]})[_0xcc5d('0x20')](function(_0x554544){if(_0x554544&&_0x554544[_0xcc5d('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d6856[_0xcc5d('0x28')],'resourceId':_0x4d6856['id'],'type':_0x554544['name'],'sectionId':_0x554544['id']},{})[_0xcc5d('0x20')](function(){return _0x2ab715;});}else{return _0x2ab715;}})['catch'](function(_0x101c85){logger[_0xcc5d('0x26')](_0xcc5d('0x4b'),_0x101c85);throw _0x101c85;});}return _0x2ab715;});}})[_0xcc5d('0x20')](respondWithResult(_0x519a2d,0xc9))[_0xcc5d('0x40')](handleError(_0x519a2d,null));};exports[_0xcc5d('0x1f')]=function(_0x3e9784,_0x2d7d4e){if(_0x3e9784[_0xcc5d('0x4f')]['id']){delete _0x3e9784[_0xcc5d('0x4f')]['id'];}return db[_0xcc5d('0x3d')][_0xcc5d('0x45')]({'where':{'id':_0x3e9784[_0xcc5d('0x42')]['id']}})[_0xcc5d('0x20')](handleEntityNotFound(_0x2d7d4e,null))[_0xcc5d('0x20')](saveUpdates(_0x3e9784[_0xcc5d('0x4f')],null))['then'](respondWithResult(_0x2d7d4e,null))[_0xcc5d('0x40')](handleError(_0x2d7d4e,null));};exports[_0xcc5d('0x24')]=function(_0x12ab1e,_0x326e91){return db[_0xcc5d('0x3d')][_0xcc5d('0x45')]({'where':{'id':_0x12ab1e[_0xcc5d('0x42')]['id']}})['then'](handleEntityNotFound(_0x326e91,null))['then'](removeEntity(_0x326e91,null))[_0xcc5d('0x40')](handleError(_0x326e91,null));};exports[_0xcc5d('0x52')]=function(_0x2bce42,_0x3ec50e,_0x54e21e){var _0x16a96b={'raw':!![],'where':{}};var _0x1495c6={};var _0xc4a440={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2bce42[_0xcc5d('0x42')]['id']}})[_0xcc5d('0x20')](handleEntityNotFound(_0x3ec50e,null))[_0xcc5d('0x20')](function(_0x867fe7){if(_0x867fe7){_0x1495c6[_0xcc5d('0x2e')]=_[_0xcc5d('0x43')](db[_0xcc5d('0x53')][_0xcc5d('0x2b')]);_0x1495c6[_0xcc5d('0x2f')]=_[_0xcc5d('0x43')](_0x2bce42[_0xcc5d('0x2f')]);_0x1495c6[_0xcc5d('0x30')]=_[_0xcc5d('0x31')](_0x1495c6['model'],_0x1495c6[_0xcc5d('0x2f')]);_0x16a96b[_0xcc5d('0x32')]=_[_0xcc5d('0x31')](_0x1495c6[_0xcc5d('0x2e')],qs['fields'](_0x2bce42['query'][_0xcc5d('0x33')]));_0x16a96b[_0xcc5d('0x32')]=_0x16a96b[_0xcc5d('0x32')][_0xcc5d('0x34')]?_0x16a96b[_0xcc5d('0x32')]:_0x1495c6[_0xcc5d('0x2e')];if(!_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x35')](_0xcc5d('0x36'))){_0x16a96b[_0xcc5d('0x19')]=qs[_0xcc5d('0x19')](_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x19')]);_0x16a96b[_0xcc5d('0x17')]=qs[_0xcc5d('0x17')](_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x17')]);}_0x16a96b[_0xcc5d('0x37')]=qs[_0xcc5d('0x38')](_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x38')]);_0x16a96b[_0xcc5d('0x39')]=qs[_0xcc5d('0x30')](_['pick'](_0x2bce42[_0xcc5d('0x2f')],_0x1495c6[_0xcc5d('0x30')]));_0x16a96b[_0xcc5d('0x39')]['ProjectId']=_0x867fe7['id'];if(_0x2bce42['query']['filter']){_0x16a96b[_0xcc5d('0x39')]=_[_0xcc5d('0x44')](_0x16a96b[_0xcc5d('0x39')],{'$or':_[_0xcc5d('0x2a')](_0x16a96b[_0xcc5d('0x32')],function(_0x3027d3){var _0x2e3d0b={};_0x2e3d0b[_0x3027d3]={'$like':'%'+_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x3b')]+'%'};return _0x2e3d0b;})});}_0x16a96b=_[_0xcc5d('0x44')]({},_0x16a96b,_0x2bce42[_0xcc5d('0x3c')]);return db[_0xcc5d('0x53')][_0xcc5d('0x1a')]({'where':_0x16a96b[_0xcc5d('0x39')]})[_0xcc5d('0x20')](function(_0x4fc89e){_0xc4a440[_0xcc5d('0x1a')]=_0x4fc89e;if(_0x2bce42[_0xcc5d('0x2f')][_0xcc5d('0x3e')]){_0x16a96b['include']=[{'all':!![]}];}return db[_0xcc5d('0x53')][_0xcc5d('0x3f')](_0x16a96b);})[_0xcc5d('0x20')](function(_0x40d3cb){_0xc4a440['rows']=_0x40d3cb;return _0xc4a440;});}})['then'](respondWithFilteredResult(_0x3ec50e,_0x16a96b))[_0xcc5d('0x40')](handleError(_0x3ec50e,null));};exports['getAnswers']=function(_0x5be52d,_0x5b7934,_0x45f720){var _0xf644da={'raw':!![],'where':{}};var _0x105c4a={};var _0x3e35c3={'count':0x0,'rows':[]};return db[_0xcc5d('0x3d')]['findOne']({'where':{'id':_0x5be52d[_0xcc5d('0x42')]['id']}})[_0xcc5d('0x20')](handleEntityNotFound(_0x5b7934,null))[_0xcc5d('0x20')](function(_0x1611e9){if(_0x1611e9){_0x105c4a['model']=_['keys'](db[_0xcc5d('0x54')][_0xcc5d('0x2b')]);_0x105c4a['query']=_['keys'](_0x5be52d[_0xcc5d('0x2f')]);_0x105c4a['filters']=_[_0xcc5d('0x31')](_0x105c4a[_0xcc5d('0x2e')],_0x105c4a['query']);_0xf644da['attributes']=_['intersection'](_0x105c4a[_0xcc5d('0x2e')],qs[_0xcc5d('0x33')](_0x5be52d[_0xcc5d('0x2f')][_0xcc5d('0x33')]));_0xf644da[_0xcc5d('0x32')]=_0xf644da[_0xcc5d('0x32')][_0xcc5d('0x34')]?_0xf644da['attributes']:_0x105c4a['model'];if(!_0x5be52d[_0xcc5d('0x2f')][_0xcc5d('0x35')](_0xcc5d('0x36'))){_0xf644da[_0xcc5d('0x19')]=qs['limit'](_0x5be52d[_0xcc5d('0x2f')]['limit']);_0xf644da[_0xcc5d('0x17')]=qs['offset'](_0x5be52d[_0xcc5d('0x2f')][_0xcc5d('0x17')]);}_0xf644da[_0xcc5d('0x37')]=qs[_0xcc5d('0x38')](_0x5be52d['query'][_0xcc5d('0x38')]);_0xf644da['where']=qs[_0xcc5d('0x30')](_[_0xcc5d('0x3a')](_0x5be52d[_0xcc5d('0x2f')],_0x105c4a[_0xcc5d('0x30')]));_0xf644da[_0xcc5d('0x39')]['ProjectId']=_0x1611e9['id'];if(_0x5be52d[_0xcc5d('0x2f')][_0xcc5d('0x3b')]){_0xf644da[_0xcc5d('0x39')]=_[_0xcc5d('0x44')](_0xf644da['where'],{'$or':_['map'](_0xf644da[_0xcc5d('0x32')],function(_0x16ab4d){var _0x28b637={};_0x28b637[_0x16ab4d]={'$like':'%'+_0x5be52d['query'][_0xcc5d('0x3b')]+'%'};return _0x28b637;})});}_0xf644da=_[_0xcc5d('0x44')]({},_0xf644da,_0x5be52d[_0xcc5d('0x3c')]);return db[_0xcc5d('0x54')][_0xcc5d('0x1a')]({'where':_0xf644da[_0xcc5d('0x39')]})[_0xcc5d('0x20')](function(_0x22b9a9){_0x3e35c3[_0xcc5d('0x1a')]=_0x22b9a9;if(_0x5be52d[_0xcc5d('0x2f')][_0xcc5d('0x3e')]){_0xf644da[_0xcc5d('0x55')]=[{'all':!![]}];}return db[_0xcc5d('0x54')]['findAll'](_0xf644da);})[_0xcc5d('0x20')](function(_0x4a2b53){_0x3e35c3[_0xcc5d('0x56')]=_0x4a2b53;return _0x3e35c3;});}})['then'](respondWithFilteredResult(_0x5b7934,_0xf644da))[_0xcc5d('0x40')](handleError(_0x5b7934,null));};function char(_0x2f6bd9){return _0xcc5d('0x57')===typeof _0x2f6bd9?String['fromCharCode'][_0xcc5d('0x1c')](null,arguments):_0x2f6bd9;}function needsEncapsulation(_0x1f49b1){return!!_0x1f49b1&&(_0x1f49b1[_0xcc5d('0x58')]()[_0xcc5d('0x59')](char(0xd))>=0x0||_0x1f49b1[_0xcc5d('0x58')]()['indexOf'](char(0xa))>=0x0||_0x1f49b1[_0xcc5d('0x58')]()[_0xcc5d('0x59')](char(0x2c))>=0x0||_0x1f49b1[_0xcc5d('0x58')]()[_0xcc5d('0x59')](char(0x22))>=0x0);}function encapsulate(_0xda4deb){var _0x3e16a2=char(0x22),_0x5f15d1='\x5c'+char(0x22),_0x320d9c=_0xda4deb[_0xcc5d('0x58')]()['replace'](new RegExp(_0x3e16a2,'g'),_0x5f15d1);return _0x3e16a2+_0x320d9c+_0x3e16a2;}exports[_0xcc5d('0x5a')]=function(_0x326694,_0x238418,_0x1e4b54){var _0x5392d8,_0x47cb88;var _0x4bea45={'where':{'ProjectId':_0x326694[_0xcc5d('0x42')]['id']}};if(_0x326694[_0xcc5d('0x2f')][_0xcc5d('0x5b')]){_0x4bea45[_0xcc5d('0x39')][_0xcc5d('0x5c')]=JSON[_0xcc5d('0x5d')](_0x326694[_0xcc5d('0x2f')]['startTime']);}return db[_0xcc5d('0x53')][_0xcc5d('0x3f')](_0x4bea45)[_0xcc5d('0x20')](handleEntityNotFound(_0x238418,null))[_0xcc5d('0x20')](function(_0x38e94e){if(_0x38e94e){_0x5392d8=_0x38e94e;return db[_0xcc5d('0x5e')][_0xcc5d('0x3f')]({'where':{'SessionId':{'$in':_[_0xcc5d('0x2a')](_0x5392d8,'id')},'ProjectId':_0x326694[_0xcc5d('0x42')]['id']},'order':'-createdAt'});}})[_0xcc5d('0x20')](handleEntityNotFound(_0x238418,null))['then'](function(_0x5c556e){if(_0x5c556e){_0x47cb88=_0x5c556e;var _0x4f786c={};for(var _0x200d9a=0x0,_0x295077=_0x47cb88[_0xcc5d('0x34')];_0x200d9a<_0x295077;_0x200d9a++){if(!_0x4f786c[_0xcc5d('0x35')](_0x47cb88[_0x200d9a][_0xcc5d('0x5f')])){_0x4f786c[_0x47cb88[_0x200d9a][_0xcc5d('0x5f')]]=needsEncapsulation(_0x47cb88[_0x200d9a][_0xcc5d('0x60')])?encapsulate(_0x47cb88[_0x200d9a]['question']):_0x47cb88[_0x200d9a][_0xcc5d('0x60')];}}var _0x540e15=[],_0x40d13e={};for(var _0x192b6d=0x0,_0x59f54b=_0x5392d8[_0xcc5d('0x34')];_0x192b6d<_0x59f54b;_0x192b6d++){_0x40d13e={'ProjectId':_0x326694[_0xcc5d('0x42')]['id'],'SessionId':_0x5392d8[_0x192b6d]['id'],'StartTime':moment(_0x5392d8[_0x192b6d][_0xcc5d('0x5c')])[_0xcc5d('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xd54189=0x0,_0x391f51=_0x47cb88['length'];_0xd54189<_0x391f51;_0xd54189++){if(_0x47cb88[_0xd54189][_0xcc5d('0x62')]==_0x5392d8[_0x192b6d]['id']&&_0x4f786c[_0xcc5d('0x35')](_0x47cb88[_0xd54189][_0xcc5d('0x5f')])){_0x40d13e[_0x4f786c[_0x47cb88[_0xd54189][_0xcc5d('0x5f')]]]=_0x47cb88[_0xd54189][_0xcc5d('0x63')];}}for(var _0xecc93b in _0x4f786c){if(!_0x40d13e[_0xcc5d('0x35')](_0x4f786c[_0xecc93b])){_0x40d13e[_0x4f786c[_0xecc93b]]=null;}}_0x540e15[_0xcc5d('0x64')](_0x40d13e);}return _0x540e15;}})['then'](function(_0x292dac){if(!_[_0xcc5d('0x65')](_0x292dac)){var _0x17f653=toCsv(_0x292dac);var _0x2499c1=Date[_0xcc5d('0x66')]();fs['writeFileSync'](util['format'](_0xcc5d('0x67'),_0x326694[_0xcc5d('0x42')]['id'],_0x2499c1),_0x17f653);_0x238418['setHeader'](_0xcc5d('0x68'),_0xcc5d('0x69')+util[_0xcc5d('0x61')](_0xcc5d('0x6a'),_0x326694[_0xcc5d('0x42')]['id'],_0x2499c1));_0x238418[_0xcc5d('0x6b')](_0xcc5d('0x6c'),_0xcc5d('0x6d'));return _0x238418[_0xcc5d('0x6e')](util[_0xcc5d('0x61')](_0xcc5d('0x67'),_0x326694['params']['id'],_0x2499c1));}else{return _0x238418[_0xcc5d('0x14')](0xcc);}})[_0xcc5d('0x40')](handleError(_0x238418,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 928a87e..72c461d 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 _0x4abf=['rimraf','exports','define','jscripty_projects','lodash','util','api','path'];(function(_0x3cb4cd,_0x5d3f61){var _0x31dc8a=function(_0xce3820){while(--_0xce3820){_0x3cb4cd['push'](_0x3cb4cd['shift']());}};_0x31dc8a(++_0x5d3f61);}(_0x4abf,0xac));var _0xf4ab=function(_0x327e47,_0x1f69a3){_0x327e47=_0x327e47-0x0;var _0xd2b5cd=_0x4abf[_0x327e47];return _0xd2b5cd;};'use strict';var _=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var logger=require('../../config/logger')(_0xf4ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ab('0x3'));var rimraf=require(_0xf4ab('0x4'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xf4ab('0x5')]=function(_0x4160fb,_0x2e6efe){return _0x4160fb[_0xf4ab('0x6')]('JscriptyProject',attributes,{'tableName':_0xf4ab('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb13b=['api','moment','request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger'];(function(_0x1f9e6e,_0x1cedd8){var _0x1d8590=function(_0x2421a0){while(--_0x2421a0){_0x1f9e6e['push'](_0x1f9e6e['shift']());}};_0x1d8590(++_0x1cedd8);}(_0xb13b,0x1de));var _0xbb13=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xb13b[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xbb13('0x0'));var util=require(_0xbb13('0x1'));var logger=require(_0xbb13('0x2'))(_0xbb13('0x3'));var moment=require(_0xbb13('0x4'));var BPromise=require('bluebird');var rp=require(_0xbb13('0x5'));var fs=require('fs');var path=require(_0xbb13('0x6'));var rimraf=require('rimraf');var config=require(_0xbb13('0x7'));var attributes=require(_0xbb13('0x8'));module[_0xbb13('0x9')]=function(_0x464c50,_0x296632){return _0x464c50[_0xbb13('0xa')](_0xbb13('0xb'),attributes,{'tableName':_0xbb13('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 8a3ba07..5dead2c 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 _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xac4a,0x13f));var _0xaac4=function(_0xe05f56,_0x2046ca){_0xe05f56=_0xe05f56-0x0;var _0x146e2b=_0xac4a[_0xe05f56];return _0x146e2b;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x23dfb0,_0x41349a){var _0x1f929b=function(_0x4d567d){while(--_0x4d567d){_0x23dfb0['push'](_0x23dfb0['shift']());}};_0x1f929b(++_0x41349a);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 7300973..7df6d55 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 _0xf886=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0xe113e2,_0x2240ae){var _0x14fb5f=function(_0x46b502){while(--_0x46b502){_0xe113e2['push'](_0xe113e2['shift']());}};_0x14fb5f(++_0x2240ae);}(_0xf886,0x140));var _0x6f88=function(_0x5cc556,_0x158710){_0x5cc556=_0x5cc556-0x0;var _0x12103b=_0xf886[_0x5cc556];return _0x12103b;};'use strict';var multer=require(_0x6f88('0x0'));var util=require(_0x6f88('0x1'));var path=require(_0x6f88('0x2'));var timeout=require(_0x6f88('0x3'));var express=require(_0x6f88('0x4'));var router=express[_0x6f88('0x5')]();var fs_extra=require(_0x6f88('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6f88('0x7'));var config=require(_0x6f88('0x8'));var controller=require(_0x6f88('0x9'));router[_0x6f88('0xa')]('/',auth[_0x6f88('0xb')](),controller[_0x6f88('0xc')]);router[_0x6f88('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x6f88('0xd')]);router[_0x6f88('0xa')](_0x6f88('0xe'),auth[_0x6f88('0xb')](),controller[_0x6f88('0xf')]);router[_0x6f88('0x10')]('/',auth[_0x6f88('0xb')](),controller[_0x6f88('0x11')]);router[_0x6f88('0x12')](_0x6f88('0xe'),auth[_0x6f88('0xb')](),controller[_0x6f88('0x13')]);router[_0x6f88('0x14')](_0x6f88('0xe'),auth[_0x6f88('0xb')](),controller[_0x6f88('0x15')]);module[_0x6f88('0x16')]=router; \ No newline at end of file +var _0xadfa=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','put','update'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xadfa,0x134));var _0xaadf=function(_0x1b01db,_0x5e41da){_0x1b01db=_0x1b01db-0x0;var _0x5873e0=_0xadfa[_0x1b01db];return _0x5873e0;};'use strict';var multer=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var path=require('path');var timeout=require(_0xaadf('0x2'));var express=require(_0xaadf('0x3'));var router=express['Router']();var fs_extra=require(_0xaadf('0x4'));var auth=require(_0xaadf('0x5'));var interaction=require(_0xaadf('0x6'));var config=require(_0xaadf('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xaadf('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaadf('0x9'),auth[_0xaadf('0xa')](),controller[_0xaadf('0xb')]);router[_0xaadf('0x8')](_0xaadf('0xc'),auth['isAuthenticated'](),controller[_0xaadf('0xd')]);router['post']('/',auth[_0xaadf('0xa')](),controller['create']);router[_0xaadf('0xe')](_0xaadf('0xc'),auth[_0xaadf('0xa')](),controller[_0xaadf('0xf')]);router['delete'](_0xaadf('0xc'),auth[_0xaadf('0xa')](),controller[_0xaadf('0x10')]);module[_0xaadf('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 173eb8b..c3d9af9 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x1a58c7,_0x2024d1){_0x1a58c7=_0x1a58c7-0x0;var _0x43320d=_0x7a54[_0x1a58c7];return _0x43320d;};'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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x414b3e,_0x359dea){_0x414b3e=_0x414b3e-0x0;var _0x146942=_0x7a54[_0x414b3e];return _0x146942;};'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 1e7e296..0e8bd1e 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 _0xc3d9=['end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','JscriptyQuestionReport','include','rows','catch','show','params','length','includeAll','merge','find','create','body','describe','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x91cb04,_0xdaa229){var _0x1bc12a=function(_0x3ccd72){while(--_0x3ccd72){_0x91cb04['push'](_0x91cb04['shift']());}};_0x1bc12a(++_0xdaa229);}(_0xc3d9,0x1a0));var _0x9c3d=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0xc3d9[_0x38c0b2];return _0x283c00;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9c3d('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c3d('0x1'));var BPromise=require(_0x9c3d('0x2'));var Mustache=require(_0x9c3d('0x3'));var util=require(_0x9c3d('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x9c3d('0x5'));var ejs=require(_0x9c3d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9c3d('0x7'));var squel=require(_0x9c3d('0x8'));var crypto=require('crypto');var jsforce=require(_0x9c3d('0x9'));var deskjs=require(_0x9c3d('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9c3d('0xb'));var Papa=require(_0x9c3d('0xc'));var Redis=require('ioredis');var authService=require(_0x9c3d('0xd'));var qs=require(_0x9c3d('0xe'));var as=require(_0x9c3d('0xf'));var hardwareService=require(_0x9c3d('0x10'));var logger=require(_0x9c3d('0x11'))(_0x9c3d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9c3d('0x13'));var db=require(_0x9c3d('0x14'))['db'];function respondWithStatusCode(_0x5ef9fb,_0xc50e7b){_0xc50e7b=_0xc50e7b||0xcc;return function(_0x2e5235){if(_0x2e5235){return _0x5ef9fb[_0x9c3d('0x15')](_0xc50e7b);}return _0x5ef9fb['status'](_0xc50e7b)[_0x9c3d('0x16')]();};}function respondWithResult(_0x2b817a,_0x490161){_0x490161=_0x490161||0xc8;return function(_0x43b258){if(_0x43b258){return _0x2b817a['status'](_0x490161)[_0x9c3d('0x17')](_0x43b258);}};}function respondWithFilteredResult(_0x4905b3,_0x17dddc){return function(_0x504619){if(_0x504619){var _0x4dbf0a=typeof _0x17dddc[_0x9c3d('0x18')]===_0x9c3d('0x19')&&typeof _0x17dddc['limit']===_0x9c3d('0x19');var _0x313b91=_0x504619[_0x9c3d('0x1a')];var _0x45156f=_0x4dbf0a?0x0:_0x17dddc['offset'];var _0x2dfc37=_0x4dbf0a?_0x504619['count']:_0x17dddc['offset']+_0x17dddc[_0x9c3d('0x1b')];var _0x389b0a;if(_0x2dfc37>=_0x313b91){_0x2dfc37=_0x313b91;_0x389b0a=0xc8;}else{_0x389b0a=0xce;}_0x4905b3['status'](_0x389b0a);return _0x4905b3['set'](_0x9c3d('0x1c'),_0x45156f+'-'+_0x2dfc37+'/'+_0x313b91)['json'](_0x504619);}return null;};}function patchUpdates(_0x4a41fb){return function(_0x2c6ea4){try{jsonpatch['apply'](_0x2c6ea4,_0x4a41fb,!![]);}catch(_0x5b3a06){return BPromise[_0x9c3d('0x1d')](_0x5b3a06);}return _0x2c6ea4[_0x9c3d('0x1e')]();};}function saveUpdates(_0x687e44,_0x4d564e){return function(_0x1907ca){if(_0x1907ca){return _0x1907ca[_0x9c3d('0x1f')](_0x687e44)[_0x9c3d('0x20')](function(_0x2f0720){return _0x2f0720;});}return null;};}function removeEntity(_0xc61fe2,_0x1d2d0d){return function(_0x3c9fb7){if(_0x3c9fb7){return _0x3c9fb7[_0x9c3d('0x21')]()[_0x9c3d('0x20')](function(){_0xc61fe2[_0x9c3d('0x22')](0xcc)[_0x9c3d('0x16')]();});}};}function handleEntityNotFound(_0x97fce2,_0x12b68b){return function(_0x30b135){if(!_0x30b135){_0x97fce2[_0x9c3d('0x15')](0x194);}return _0x30b135;};}function handleError(_0x5ce7c0,_0x3a0d1e){_0x3a0d1e=_0x3a0d1e||0x1f4;return function(_0x3550b4){logger[_0x9c3d('0x23')](_0x3550b4[_0x9c3d('0x24')]);if(_0x3550b4[_0x9c3d('0x25')]){delete _0x3550b4['name'];}_0x5ce7c0[_0x9c3d('0x22')](_0x3a0d1e)[_0x9c3d('0x26')](_0x3550b4);};}exports[_0x9c3d('0x27')]=function(_0x51dc61,_0xb00e4a){var _0x14b552={},_0x237ae5={},_0x5e4b20={'count':0x0,'rows':[]};var _0x4df2fb=_[_0x9c3d('0x28')](db['JscriptyQuestionReport'][_0x9c3d('0x29')],function(_0x21b92d){return{'name':_0x21b92d[_0x9c3d('0x2a')],'type':_0x21b92d[_0x9c3d('0x2b')][_0x9c3d('0x2c')]};});_0x237ae5[_0x9c3d('0x2d')]=_[_0x9c3d('0x28')](_0x4df2fb,_0x9c3d('0x25'));_0x237ae5['query']=_[_0x9c3d('0x2e')](_0x51dc61[_0x9c3d('0x2f')]);_0x237ae5['filters']=_[_0x9c3d('0x30')](_0x237ae5[_0x9c3d('0x2d')],_0x237ae5['query']);_0x14b552[_0x9c3d('0x31')]=_[_0x9c3d('0x30')](_0x237ae5[_0x9c3d('0x2d')],qs[_0x9c3d('0x32')](_0x51dc61[_0x9c3d('0x2f')][_0x9c3d('0x32')]));_0x14b552[_0x9c3d('0x31')]=_0x14b552[_0x9c3d('0x31')]['length']?_0x14b552[_0x9c3d('0x31')]:_0x237ae5[_0x9c3d('0x2d')];if(!_0x51dc61[_0x9c3d('0x2f')][_0x9c3d('0x33')](_0x9c3d('0x34'))){_0x14b552[_0x9c3d('0x1b')]=qs[_0x9c3d('0x1b')](_0x51dc61[_0x9c3d('0x2f')][_0x9c3d('0x1b')]);_0x14b552[_0x9c3d('0x18')]=qs[_0x9c3d('0x18')](_0x51dc61['query'][_0x9c3d('0x18')]);}_0x14b552[_0x9c3d('0x35')]=qs[_0x9c3d('0x36')](_0x51dc61[_0x9c3d('0x2f')]['sort']);_0x14b552[_0x9c3d('0x37')]=qs[_0x9c3d('0x38')](_['pick'](_0x51dc61[_0x9c3d('0x2f')],_0x237ae5[_0x9c3d('0x38')]),_0x4df2fb);if(_0x51dc61[_0x9c3d('0x2f')][_0x9c3d('0x39')]){_0x14b552[_0x9c3d('0x37')]=_['merge'](_0x14b552['where'],{'$or':_[_0x9c3d('0x28')](_0x4df2fb,function(_0x1f7528){if(_0x1f7528[_0x9c3d('0x2b')]!==_0x9c3d('0x3a')){var _0x40b7ad={};_0x40b7ad[_0x1f7528[_0x9c3d('0x25')]]={'$like':'%'+_0x51dc61[_0x9c3d('0x2f')][_0x9c3d('0x39')]+'%'};return _0x40b7ad;}})});}_0x14b552=_['merge']({},_0x14b552,_0x51dc61[_0x9c3d('0x3b')]);var _0x1848ab={'where':_0x14b552[_0x9c3d('0x37')]};return db[_0x9c3d('0x3c')][_0x9c3d('0x1a')](_0x1848ab)[_0x9c3d('0x20')](function(_0x4e125e){_0x5e4b20[_0x9c3d('0x1a')]=_0x4e125e;if(_0x51dc61['query']['includeAll']){_0x14b552[_0x9c3d('0x3d')]=[{'all':!![]}];}return db[_0x9c3d('0x3c')]['findAll'](_0x14b552);})[_0x9c3d('0x20')](function(_0xf7beaa){_0x5e4b20[_0x9c3d('0x3e')]=_0xf7beaa;return _0x5e4b20;})[_0x9c3d('0x20')](respondWithFilteredResult(_0xb00e4a,_0x14b552))[_0x9c3d('0x3f')](handleError(_0xb00e4a,null));};exports[_0x9c3d('0x40')]=function(_0x2afc02,_0x59e90e){var _0x2f0db3={'raw':!![],'where':{'id':_0x2afc02[_0x9c3d('0x41')]['id']}},_0x163b6c={};_0x163b6c[_0x9c3d('0x2d')]=_[_0x9c3d('0x2e')](db[_0x9c3d('0x3c')]['rawAttributes']);_0x163b6c[_0x9c3d('0x2f')]=_['keys'](_0x2afc02[_0x9c3d('0x2f')]);_0x163b6c[_0x9c3d('0x38')]=_[_0x9c3d('0x30')](_0x163b6c[_0x9c3d('0x2d')],_0x163b6c[_0x9c3d('0x2f')]);_0x2f0db3[_0x9c3d('0x31')]=_[_0x9c3d('0x30')](_0x163b6c[_0x9c3d('0x2d')],qs['fields'](_0x2afc02[_0x9c3d('0x2f')]['fields']));_0x2f0db3[_0x9c3d('0x31')]=_0x2f0db3[_0x9c3d('0x31')][_0x9c3d('0x42')]?_0x2f0db3[_0x9c3d('0x31')]:_0x163b6c[_0x9c3d('0x2d')];if(_0x2afc02['query'][_0x9c3d('0x43')]){_0x2f0db3[_0x9c3d('0x3d')]=[{'all':!![]}];}_0x2f0db3=_[_0x9c3d('0x44')]({},_0x2f0db3,_0x2afc02['options']);return db[_0x9c3d('0x3c')][_0x9c3d('0x45')](_0x2f0db3)[_0x9c3d('0x20')](handleEntityNotFound(_0x59e90e,null))['then'](respondWithResult(_0x59e90e,null))[_0x9c3d('0x3f')](handleError(_0x59e90e,null));};exports[_0x9c3d('0x46')]=function(_0x2bad4b,_0x239641){return db[_0x9c3d('0x3c')][_0x9c3d('0x46')](_0x2bad4b['body'],{})[_0x9c3d('0x20')](respondWithResult(_0x239641,0xc9))[_0x9c3d('0x3f')](handleError(_0x239641,null));};exports[_0x9c3d('0x1f')]=function(_0x4e4598,_0x3bddc4){if(_0x4e4598['body']['id']){delete _0x4e4598[_0x9c3d('0x47')]['id'];}return db[_0x9c3d('0x3c')][_0x9c3d('0x45')]({'where':{'id':_0x4e4598[_0x9c3d('0x41')]['id']}})[_0x9c3d('0x20')](handleEntityNotFound(_0x3bddc4,null))[_0x9c3d('0x20')](saveUpdates(_0x4e4598['body'],null))[_0x9c3d('0x20')](respondWithResult(_0x3bddc4,null))[_0x9c3d('0x3f')](handleError(_0x3bddc4,null));};exports[_0x9c3d('0x21')]=function(_0x5009b3,_0x36373e){return db[_0x9c3d('0x3c')][_0x9c3d('0x45')]({'where':{'id':_0x5009b3['params']['id']}})[_0x9c3d('0x20')](handleEntityNotFound(_0x36373e,null))[_0x9c3d('0x20')](removeEntity(_0x36373e,null))[_0x9c3d('0x3f')](handleError(_0x36373e,null));};exports[_0x9c3d('0x48')]=function(_0x58ba44,_0x18699f){return db['JscriptyQuestionReport'][_0x9c3d('0x48')]()[_0x9c3d('0x20')](respondWithResult(_0x18699f,null))['catch'](handleError(_0x18699f,null));}; \ No newline at end of file +var _0xa0ea=['api','../../config/environment','../../mysqldb','end','status','undefined','limit','offset','count','set','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','length','order','sort','filters','pick','merge','where','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0ea,0x1d7));var _0xaa0e=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xa0ea[_0x1fafa5];return _0xcf08c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa0e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaa0e('0x1'));var moment=require(_0xaa0e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xaa0e('0x3'));var util=require(_0xaa0e('0x4'));var path=require(_0xaa0e('0x5'));var sox=require(_0xaa0e('0x6'));var csv=require('to-csv');var ejs=require(_0xaa0e('0x7'));var fs=require('fs');var fs_extra=require(_0xaa0e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa0e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xaa0e('0xa'));var toCsv=require(_0xaa0e('0xb'));var querystring=require(_0xaa0e('0xc'));var Papa=require('papaparse');var Redis=require(_0xaa0e('0xd'));var authService=require(_0xaa0e('0xe'));var qs=require(_0xaa0e('0xf'));var as=require(_0xaa0e('0x10'));var hardwareService=require(_0xaa0e('0x11'));var logger=require(_0xaa0e('0x12'))(_0xaa0e('0x13'));var utils=require('../../config/utils');var config=require(_0xaa0e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xaa0e('0x15'))['db'];function respondWithStatusCode(_0x2b2fb6,_0x38fc67){_0x38fc67=_0x38fc67||0xcc;return function(_0x37462e){if(_0x37462e){return _0x2b2fb6['sendStatus'](_0x38fc67);}return _0x2b2fb6['status'](_0x38fc67)[_0xaa0e('0x16')]();};}function respondWithResult(_0x37e785,_0x2fe8a9){_0x2fe8a9=_0x2fe8a9||0xc8;return function(_0x87ce3){if(_0x87ce3){return _0x37e785[_0xaa0e('0x17')](_0x2fe8a9)['json'](_0x87ce3);}};}function respondWithFilteredResult(_0x511436,_0x161565){return function(_0x92867c){if(_0x92867c){var _0x9228b3=typeof _0x161565['offset']===_0xaa0e('0x18')&&typeof _0x161565[_0xaa0e('0x19')]===_0xaa0e('0x18');var _0x26f48a=_0x92867c['count'];var _0x15a7a0=_0x9228b3?0x0:_0x161565[_0xaa0e('0x1a')];var _0x396d37=_0x9228b3?_0x92867c[_0xaa0e('0x1b')]:_0x161565[_0xaa0e('0x1a')]+_0x161565[_0xaa0e('0x19')];var _0x30d504;if(_0x396d37>=_0x26f48a){_0x396d37=_0x26f48a;_0x30d504=0xc8;}else{_0x30d504=0xce;}_0x511436[_0xaa0e('0x17')](_0x30d504);return _0x511436[_0xaa0e('0x1c')]('Content-Range',_0x15a7a0+'-'+_0x396d37+'/'+_0x26f48a)[_0xaa0e('0x1d')](_0x92867c);}return null;};}function patchUpdates(_0xbeb067){return function(_0x2bdc65){try{jsonpatch[_0xaa0e('0x1e')](_0x2bdc65,_0xbeb067,!![]);}catch(_0x1d9199){return BPromise[_0xaa0e('0x1f')](_0x1d9199);}return _0x2bdc65['save']();};}function saveUpdates(_0x510435,_0x471ca0){return function(_0x1a7927){if(_0x1a7927){return _0x1a7927['update'](_0x510435)[_0xaa0e('0x20')](function(_0x43ab3){return _0x43ab3;});}return null;};}function removeEntity(_0x206899,_0x4e83d4){return function(_0x2310f8){if(_0x2310f8){return _0x2310f8[_0xaa0e('0x21')]()[_0xaa0e('0x20')](function(){_0x206899[_0xaa0e('0x17')](0xcc)[_0xaa0e('0x16')]();});}};}function handleEntityNotFound(_0x4d7e0b,_0x286b74){return function(_0x594684){if(!_0x594684){_0x4d7e0b[_0xaa0e('0x22')](0x194);}return _0x594684;};}function handleError(_0x3a8aaf,_0x28c4b7){_0x28c4b7=_0x28c4b7||0x1f4;return function(_0x14342e){logger[_0xaa0e('0x23')](_0x14342e[_0xaa0e('0x24')]);if(_0x14342e['name']){delete _0x14342e[_0xaa0e('0x25')];}_0x3a8aaf[_0xaa0e('0x17')](_0x28c4b7)[_0xaa0e('0x26')](_0x14342e);};}exports[_0xaa0e('0x27')]=function(_0x4664aa,_0x4800f3){var _0x3c2a96={},_0x36fd2a={},_0x388fc1={'count':0x0,'rows':[]};var _0x2dda58=_[_0xaa0e('0x28')](db[_0xaa0e('0x29')][_0xaa0e('0x2a')],function(_0xf610cc){return{'name':_0xf610cc['fieldName'],'type':_0xf610cc[_0xaa0e('0x2b')][_0xaa0e('0x2c')]};});_0x36fd2a[_0xaa0e('0x2d')]=_[_0xaa0e('0x28')](_0x2dda58,_0xaa0e('0x25'));_0x36fd2a['query']=_[_0xaa0e('0x2e')](_0x4664aa[_0xaa0e('0x2f')]);_0x36fd2a['filters']=_['intersection'](_0x36fd2a['model'],_0x36fd2a[_0xaa0e('0x2f')]);_0x3c2a96[_0xaa0e('0x30')]=_[_0xaa0e('0x31')](_0x36fd2a[_0xaa0e('0x2d')],qs[_0xaa0e('0x32')](_0x4664aa['query'][_0xaa0e('0x32')]));_0x3c2a96[_0xaa0e('0x30')]=_0x3c2a96[_0xaa0e('0x30')][_0xaa0e('0x33')]?_0x3c2a96[_0xaa0e('0x30')]:_0x36fd2a['model'];if(!_0x4664aa[_0xaa0e('0x2f')]['hasOwnProperty']('nolimit')){_0x3c2a96[_0xaa0e('0x19')]=qs['limit'](_0x4664aa[_0xaa0e('0x2f')][_0xaa0e('0x19')]);_0x3c2a96[_0xaa0e('0x1a')]=qs['offset'](_0x4664aa['query']['offset']);}_0x3c2a96[_0xaa0e('0x34')]=qs['sort'](_0x4664aa[_0xaa0e('0x2f')][_0xaa0e('0x35')]);_0x3c2a96['where']=qs[_0xaa0e('0x36')](_[_0xaa0e('0x37')](_0x4664aa[_0xaa0e('0x2f')],_0x36fd2a[_0xaa0e('0x36')]),_0x2dda58);if(_0x4664aa[_0xaa0e('0x2f')]['filter']){_0x3c2a96['where']=_[_0xaa0e('0x38')](_0x3c2a96[_0xaa0e('0x39')],{'$or':_['map'](_0x2dda58,function(_0x4594c5){if(_0x4594c5[_0xaa0e('0x2b')]!=='VIRTUAL'){var _0x5d9ec4={};_0x5d9ec4[_0x4594c5[_0xaa0e('0x25')]]={'$like':'%'+_0x4664aa[_0xaa0e('0x2f')]['filter']+'%'};return _0x5d9ec4;}})});}_0x3c2a96=_['merge']({},_0x3c2a96,_0x4664aa[_0xaa0e('0x3a')]);var _0x293ae7={'where':_0x3c2a96[_0xaa0e('0x39')]};return db[_0xaa0e('0x29')][_0xaa0e('0x1b')](_0x293ae7)[_0xaa0e('0x20')](function(_0x11c4fa){_0x388fc1[_0xaa0e('0x1b')]=_0x11c4fa;if(_0x4664aa[_0xaa0e('0x2f')][_0xaa0e('0x3b')]){_0x3c2a96[_0xaa0e('0x3c')]=[{'all':!![]}];}return db[_0xaa0e('0x29')][_0xaa0e('0x3d')](_0x3c2a96);})[_0xaa0e('0x20')](function(_0x2b8a60){_0x388fc1[_0xaa0e('0x3e')]=_0x2b8a60;return _0x388fc1;})[_0xaa0e('0x20')](respondWithFilteredResult(_0x4800f3,_0x3c2a96))[_0xaa0e('0x3f')](handleError(_0x4800f3,null));};exports[_0xaa0e('0x40')]=function(_0x215f0b,_0x4569d8){var _0x85f6d0={'raw':!![],'where':{'id':_0x215f0b[_0xaa0e('0x41')]['id']}},_0x5d7d93={};_0x5d7d93[_0xaa0e('0x2d')]=_[_0xaa0e('0x2e')](db['JscriptyQuestionReport'][_0xaa0e('0x2a')]);_0x5d7d93[_0xaa0e('0x2f')]=_[_0xaa0e('0x2e')](_0x215f0b[_0xaa0e('0x2f')]);_0x5d7d93['filters']=_[_0xaa0e('0x31')](_0x5d7d93[_0xaa0e('0x2d')],_0x5d7d93[_0xaa0e('0x2f')]);_0x85f6d0[_0xaa0e('0x30')]=_[_0xaa0e('0x31')](_0x5d7d93[_0xaa0e('0x2d')],qs[_0xaa0e('0x32')](_0x215f0b[_0xaa0e('0x2f')]['fields']));_0x85f6d0[_0xaa0e('0x30')]=_0x85f6d0[_0xaa0e('0x30')]['length']?_0x85f6d0['attributes']:_0x5d7d93[_0xaa0e('0x2d')];if(_0x215f0b[_0xaa0e('0x2f')]['includeAll']){_0x85f6d0['include']=[{'all':!![]}];}_0x85f6d0=_[_0xaa0e('0x38')]({},_0x85f6d0,_0x215f0b['options']);return db['JscriptyQuestionReport'][_0xaa0e('0x42')](_0x85f6d0)[_0xaa0e('0x20')](handleEntityNotFound(_0x4569d8,null))[_0xaa0e('0x20')](respondWithResult(_0x4569d8,null))[_0xaa0e('0x3f')](handleError(_0x4569d8,null));};exports['create']=function(_0x14ea99,_0xab9b4a){return db[_0xaa0e('0x29')][_0xaa0e('0x43')](_0x14ea99[_0xaa0e('0x44')],{})[_0xaa0e('0x20')](respondWithResult(_0xab9b4a,0xc9))[_0xaa0e('0x3f')](handleError(_0xab9b4a,null));};exports['update']=function(_0x56a990,_0x1054a6){if(_0x56a990[_0xaa0e('0x44')]['id']){delete _0x56a990['body']['id'];}return db[_0xaa0e('0x29')]['find']({'where':{'id':_0x56a990['params']['id']}})[_0xaa0e('0x20')](handleEntityNotFound(_0x1054a6,null))[_0xaa0e('0x20')](saveUpdates(_0x56a990[_0xaa0e('0x44')],null))[_0xaa0e('0x20')](respondWithResult(_0x1054a6,null))[_0xaa0e('0x3f')](handleError(_0x1054a6,null));};exports[_0xaa0e('0x21')]=function(_0x4838a5,_0xd3144a){return db[_0xaa0e('0x29')][_0xaa0e('0x42')]({'where':{'id':_0x4838a5[_0xaa0e('0x41')]['id']}})['then'](handleEntityNotFound(_0xd3144a,null))['then'](removeEntity(_0xd3144a,null))['catch'](handleError(_0xd3144a,null));};exports[_0xaa0e('0x45')]=function(_0x1d2aa5,_0x4cdad0){return db['JscriptyQuestionReport'][_0xaa0e('0x45')]()[_0xaa0e('0x20')](respondWithResult(_0x4cdad0,null))[_0xaa0e('0x3f')](handleError(_0x4cdad0,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3132f45..c1e7684 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 _0xec0a=['../../config/environment','define','report_jscripty_questions','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0xec0a,0xdb));var _0xaec0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xec0a[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaec0('0x0'))('api');var moment=require(_0xaec0('0x1'));var BPromise=require('bluebird');var rp=require(_0xaec0('0x2'));var fs=require('fs');var path=require(_0xaec0('0x3'));var rimraf=require(_0xaec0('0x4'));var config=require(_0xaec0('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x23b7c3,_0x2a5e84){return _0x23b7c3[_0xaec0('0x6')]('JscriptyQuestionReport',attributes,{'tableName':_0xaec0('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fe2=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x0fe2,0x155));var _0x20fe=function(_0xce6d8c,_0x9e6785){_0xce6d8c=_0xce6d8c-0x0;var _0x5bd041=_0x0fe2[_0xce6d8c];return _0x5bd041;};'use strict';var _=require(_0x20fe('0x0'));var util=require(_0x20fe('0x1'));var logger=require(_0x20fe('0x2'))(_0x20fe('0x3'));var moment=require(_0x20fe('0x4'));var BPromise=require(_0x20fe('0x5'));var rp=require(_0x20fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20fe('0x7'));var config=require(_0x20fe('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x20fe('0x9')]=function(_0x3eac68,_0x474535){return _0x3eac68[_0x20fe('0xa')](_0x20fe('0xb'),attributes,{'tableName':_0x20fe('0xc'),'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 06390e2..368acb6 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 _0x4d79=['../../config/logger','rpc','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x16d4e4,_0x19f8d7){var _0x4514ed=function(_0x304769){while(--_0x304769){_0x16d4e4['push'](_0x16d4e4['shift']());}};_0x4514ed(++_0x19f8d7);}(_0x4d79,0x1c7));var _0x94d7=function(_0x16cfae,_0x3c3596){_0x16cfae=_0x16cfae-0x0;var _0x5a04cf=_0x4d79[_0x16cfae];return _0x5a04cf;};'use strict';var _=require(_0x94d7('0x0'));var util=require(_0x94d7('0x1'));var moment=require(_0x94d7('0x2'));var BPromise=require(_0x94d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94d7('0x4'));var db=require(_0x94d7('0x5'))['db'];var utils=require(_0x94d7('0x6'));var logger=require(_0x94d7('0x7'))(_0x94d7('0x8'));var config=require('../../config/environment');var jayson=require(_0x94d7('0x9'));var client=jayson[_0x94d7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a0985,_0x42b667,_0x1c45e6){return new BPromise(function(_0x408308,_0x1c40cc){return client[_0x94d7('0xb')](_0x5a0985,_0x1c45e6)[_0x94d7('0xc')](function(_0x57b802){logger[_0x94d7('0xd')](_0x94d7('0xe'),_0x42b667,_0x94d7('0xf'));logger[_0x94d7('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x42b667,_0x94d7('0xf'),JSON[_0x94d7('0x11')](_0x57b802));if(_0x57b802['error']){if(_0x57b802[_0x94d7('0x12')]['code']===0x1f4){logger[_0x94d7('0x12')](_0x94d7('0xe'),_0x42b667,_0x57b802[_0x94d7('0x12')][_0x94d7('0x13')]);return _0x1c40cc(_0x57b802[_0x94d7('0x12')][_0x94d7('0x13')]);}logger['error'](_0x94d7('0xe'),_0x42b667,_0x57b802[_0x94d7('0x12')]['message']);return _0x408308(_0x57b802['error']['message']);}else{logger[_0x94d7('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x42b667,_0x94d7('0xf'));_0x408308(_0x57b802[_0x94d7('0x14')][_0x94d7('0x13')]);}})['catch'](function(_0x25736f){logger[_0x94d7('0x12')](_0x94d7('0xe'),_0x42b667,_0x25736f);_0x1c40cc(_0x25736f);});});} \ No newline at end of file +var _0xda0e=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5f4062,_0x595ea5){var _0x4a46b0=function(_0x1be6de){while(--_0x1be6de){_0x5f4062['push'](_0x5f4062['shift']());}};_0x4a46b0(++_0x595ea5);}(_0xda0e,0xe3));var _0xeda0=function(_0x4783a4,_0x5850ad){_0x4783a4=_0x4783a4-0x0;var _0x48be62=_0xda0e[_0x4783a4];return _0x48be62;};'use strict';var _=require(_0xeda0('0x0'));var util=require(_0xeda0('0x1'));var moment=require(_0xeda0('0x2'));var BPromise=require(_0xeda0('0x3'));var rs=require(_0xeda0('0x4'));var fs=require('fs');var Redis=require(_0xeda0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeda0('0x6'));var logger=require('../../config/logger')(_0xeda0('0x7'));var config=require(_0xeda0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xeda0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x138003,_0x4eedb3,_0x17cc37){return new BPromise(function(_0x2b9711,_0x5f4250){return client[_0xeda0('0xa')](_0x138003,_0x17cc37)[_0xeda0('0xb')](function(_0x423507){logger[_0xeda0('0xc')](_0xeda0('0xd'),_0x4eedb3,_0xeda0('0xe'));logger[_0xeda0('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x4eedb3,_0xeda0('0xe'),JSON[_0xeda0('0x10')](_0x423507));if(_0x423507[_0xeda0('0x11')]){if(_0x423507[_0xeda0('0x11')]['code']===0x1f4){logger[_0xeda0('0x11')](_0xeda0('0xd'),_0x4eedb3,_0x423507[_0xeda0('0x11')]['message']);return _0x5f4250(_0x423507['error'][_0xeda0('0x12')]);}logger[_0xeda0('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4eedb3,_0x423507[_0xeda0('0x11')]['message']);return _0x2b9711(_0x423507[_0xeda0('0x11')][_0xeda0('0x12')]);}else{logger[_0xeda0('0xc')](_0xeda0('0xd'),_0x4eedb3,_0xeda0('0xe'));_0x2b9711(_0x423507[_0xeda0('0x13')]['message']);}})[_0xeda0('0x14')](function(_0x357fe6){logger[_0xeda0('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4eedb3,_0x357fe6);_0x5f4250(_0x357fe6);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index e9f0716..fccdd3c 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 _0x0b2e=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','/:id/questions','post','create','put','/:id','destroy','exports'];(function(_0x38734b,_0x1549b2){var _0x73979d=function(_0x398432){while(--_0x398432){_0x38734b['push'](_0x38734b['shift']());}};_0x73979d(++_0x1549b2);}(_0x0b2e,0x64));var _0xe0b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b2e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe0b2('0x0'));var path=require(_0xe0b2('0x1'));var timeout=require(_0xe0b2('0x2'));var express=require(_0xe0b2('0x3'));var router=express['Router']();var fs_extra=require(_0xe0b2('0x4'));var auth=require(_0xe0b2('0x5'));var interaction=require(_0xe0b2('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0xe0b2('0x7')](),controller[_0xe0b2('0x8')]);router[_0xe0b2('0x9')](_0xe0b2('0xa'),auth['isAuthenticated'](),controller[_0xe0b2('0xb')]);router['get']('/:id',auth[_0xe0b2('0x7')](),controller[_0xe0b2('0xc')]);router['get'](_0xe0b2('0xd'),auth[_0xe0b2('0x7')](),controller['getQuestions']);router[_0xe0b2('0xe')]('/',auth[_0xe0b2('0x7')](),controller[_0xe0b2('0xf')]);router[_0xe0b2('0x10')]('/:id',auth[_0xe0b2('0x7')](),controller['update']);router['delete'](_0xe0b2('0x11'),auth['isAuthenticated'](),controller[_0xe0b2('0x12')]);module[_0xe0b2('0x13')]=router; \ No newline at end of file +var _0xbadd=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','isAuthenticated','show','getQuestions','post','update','delete'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbadd,0x12f));var _0xdbad=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xbadd[_0xf26c2e];return _0x46ecb4;};'use strict';var multer=require(_0xdbad('0x0'));var util=require(_0xdbad('0x1'));var path=require(_0xdbad('0x2'));var timeout=require(_0xdbad('0x3'));var express=require(_0xdbad('0x4'));var router=express[_0xdbad('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbad('0x6'));var config=require(_0xdbad('0x7'));var controller=require(_0xdbad('0x8'));router[_0xdbad('0x9')]('/',auth['isAuthenticated'](),controller[_0xdbad('0xa')]);router[_0xdbad('0x9')]('/describe',auth[_0xdbad('0xb')](),controller['describe']);router['get']('/:id',auth[_0xdbad('0xb')](),controller[_0xdbad('0xc')]);router[_0xdbad('0x9')]('/:id/questions',auth[_0xdbad('0xb')](),controller[_0xdbad('0xd')]);router[_0xdbad('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xdbad('0xb')](),controller[_0xdbad('0xf')]);router[_0xdbad('0x10')](_0xdbad('0x11'),auth[_0xdbad('0xb')](),controller[_0xdbad('0x12')]);module[_0xdbad('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 368bcb6..f9ab891 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 _0x4e09=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime'];(function(_0x24dee5,_0x2f2c86){var _0x6333e6=function(_0xc0af4c){while(--_0xc0af4c){_0x24dee5['push'](_0x24dee5['shift']());}};_0x6333e6(++_0x2f2c86);}(_0x4e09,0x11b));var _0x94e0=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x4e09[_0x126558];return _0x1f6d14;};'use strict';var moment=require(_0x94e0('0x0'));var Sequelize=require(_0x94e0('0x1'));module[_0x94e0('0x2')]={'starttime':{'type':Sequelize[_0x94e0('0x3')],'set':function(_0x3521d6){this['setDataValue'](_0x94e0('0x4'),_0x3521d6);this['setDataValue']('endtime',moment()[_0x94e0('0x5')](_0x94e0('0x6')));}},'endtime':{'type':Sequelize[_0x94e0('0x3')]},'membername':{'type':Sequelize[_0x94e0('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x94e0('0x7')]},'calleridname':{'type':Sequelize[_0x94e0('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x94e0('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x01c2=['sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment'];(function(_0x4ca0c2,_0x2df1be){var _0x1e2836=function(_0x492e80){while(--_0x492e80){_0x4ca0c2['push'](_0x4ca0c2['shift']());}};_0x1e2836(++_0x2df1be);}(_0x01c2,0x17b));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x201c('0x0'));var Sequelize=require(_0x201c('0x1'));module[_0x201c('0x2')]={'starttime':{'type':Sequelize[_0x201c('0x3')],'set':function(_0x8a6f8d){this[_0x201c('0x4')](_0x201c('0x5'),_0x8a6f8d);this[_0x201c('0x4')]('endtime',moment()[_0x201c('0x6')](_0x201c('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x201c('0x8')]},'queue':{'type':Sequelize[_0x201c('0x8')]},'uniqueid':{'type':Sequelize[_0x201c('0x8')]},'calleridname':{'type':Sequelize[_0x201c('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x201c('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 26f638d..d99cb2b 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 _0x3f37=['model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','catch','show','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','include','rows','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','index','JscriptySessionReport','rawAttributes','fieldName','type','key'];(function(_0x5baa25,_0x1cab73){var _0x4b72f0=function(_0x417de9){while(--_0x417de9){_0x5baa25['push'](_0x5baa25['shift']());}};_0x4b72f0(++_0x1cab73);}(_0x3f37,0xc7));var _0x73f3=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0x3f37[_0x5ec365];return _0xab187d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x73f3('0x0'));var zipdir=require(_0x73f3('0x1'));var jsonpatch=require(_0x73f3('0x2'));var rp=require(_0x73f3('0x3'));var moment=require(_0x73f3('0x4'));var BPromise=require(_0x73f3('0x5'));var Mustache=require(_0x73f3('0x6'));var util=require(_0x73f3('0x7'));var path=require(_0x73f3('0x8'));var sox=require(_0x73f3('0x9'));var csv=require(_0x73f3('0xa'));var ejs=require(_0x73f3('0xb'));var fs=require('fs');var fs_extra=require(_0x73f3('0xc'));var _=require(_0x73f3('0xd'));var squel=require(_0x73f3('0xe'));var crypto=require(_0x73f3('0xf'));var jsforce=require(_0x73f3('0x10'));var deskjs=require(_0x73f3('0x11'));var toCsv=require(_0x73f3('0xa'));var querystring=require(_0x73f3('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x73f3('0x13'));var as=require(_0x73f3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x73f3('0x15'));var utils=require(_0x73f3('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x73f3('0x17'))['db'];function respondWithStatusCode(_0x422e59,_0x3cfc69){_0x3cfc69=_0x3cfc69||0xcc;return function(_0x52d0fa){if(_0x52d0fa){return _0x422e59['sendStatus'](_0x3cfc69);}return _0x422e59[_0x73f3('0x18')](_0x3cfc69)[_0x73f3('0x19')]();};}function respondWithResult(_0x172b8d,_0x13434d){_0x13434d=_0x13434d||0xc8;return function(_0x45e39e){if(_0x45e39e){return _0x172b8d[_0x73f3('0x18')](_0x13434d)[_0x73f3('0x1a')](_0x45e39e);}};}function respondWithFilteredResult(_0x12ea68,_0x3fb9d4){return function(_0x6472e3){if(_0x6472e3){var _0x58e533=typeof _0x3fb9d4[_0x73f3('0x1b')]===_0x73f3('0x1c')&&typeof _0x3fb9d4[_0x73f3('0x1d')]===_0x73f3('0x1c');var _0x3840e3=_0x6472e3['count'];var _0x4ac81c=_0x58e533?0x0:_0x3fb9d4[_0x73f3('0x1b')];var _0x5ee569=_0x58e533?_0x6472e3[_0x73f3('0x1e')]:_0x3fb9d4['offset']+_0x3fb9d4[_0x73f3('0x1d')];var _0x415f9d;if(_0x5ee569>=_0x3840e3){_0x5ee569=_0x3840e3;_0x415f9d=0xc8;}else{_0x415f9d=0xce;}_0x12ea68['status'](_0x415f9d);return _0x12ea68['set'](_0x73f3('0x1f'),_0x4ac81c+'-'+_0x5ee569+'/'+_0x3840e3)[_0x73f3('0x1a')](_0x6472e3);}return null;};}function patchUpdates(_0xa72fb9){return function(_0x3de04f){try{jsonpatch[_0x73f3('0x20')](_0x3de04f,_0xa72fb9,!![]);}catch(_0x334878){return BPromise[_0x73f3('0x21')](_0x334878);}return _0x3de04f[_0x73f3('0x22')]();};}function saveUpdates(_0x29ecfd,_0x12a3fb){return function(_0xf5b425){if(_0xf5b425){return _0xf5b425[_0x73f3('0x23')](_0x29ecfd)[_0x73f3('0x24')](function(_0x6fcad0){return _0x6fcad0;});}return null;};}function removeEntity(_0x24c509,_0x47f301){return function(_0xbda2de){if(_0xbda2de){return _0xbda2de[_0x73f3('0x25')]()[_0x73f3('0x24')](function(){_0x24c509[_0x73f3('0x18')](0xcc)[_0x73f3('0x19')]();});}};}function handleEntityNotFound(_0x2c86ec,_0x502c1b){return function(_0x19186e){if(!_0x19186e){_0x2c86ec[_0x73f3('0x26')](0x194);}return _0x19186e;};}function handleError(_0x552283,_0x2329c4){_0x2329c4=_0x2329c4||0x1f4;return function(_0x573045){logger[_0x73f3('0x27')](_0x573045[_0x73f3('0x28')]);if(_0x573045['name']){delete _0x573045['name'];}_0x552283['status'](_0x2329c4)['send'](_0x573045);};}exports[_0x73f3('0x29')]=function(_0xeb1a66,_0x394fbb){var _0x357fd1={},_0x172377={},_0x4c976e={'count':0x0,'rows':[]};var _0x4d31ef=_['map'](db[_0x73f3('0x2a')][_0x73f3('0x2b')],function(_0x2b877b){return{'name':_0x2b877b[_0x73f3('0x2c')],'type':_0x2b877b[_0x73f3('0x2d')][_0x73f3('0x2e')]};});_0x172377[_0x73f3('0x2f')]=_['map'](_0x4d31ef,_0x73f3('0x30'));_0x172377['query']=_[_0x73f3('0x31')](_0xeb1a66[_0x73f3('0x32')]);_0x172377[_0x73f3('0x33')]=_[_0x73f3('0x34')](_0x172377[_0x73f3('0x2f')],_0x172377['query']);_0x357fd1[_0x73f3('0x35')]=_[_0x73f3('0x34')](_0x172377[_0x73f3('0x2f')],qs[_0x73f3('0x36')](_0xeb1a66[_0x73f3('0x32')][_0x73f3('0x36')]));_0x357fd1[_0x73f3('0x35')]=_0x357fd1[_0x73f3('0x35')][_0x73f3('0x37')]?_0x357fd1[_0x73f3('0x35')]:_0x172377['model'];if(!_0xeb1a66[_0x73f3('0x32')][_0x73f3('0x38')](_0x73f3('0x39'))){_0x357fd1[_0x73f3('0x1d')]=qs[_0x73f3('0x1d')](_0xeb1a66['query'][_0x73f3('0x1d')]);_0x357fd1[_0x73f3('0x1b')]=qs[_0x73f3('0x1b')](_0xeb1a66[_0x73f3('0x32')][_0x73f3('0x1b')]);}_0x357fd1['order']=qs[_0x73f3('0x3a')](_0xeb1a66['query'][_0x73f3('0x3a')]);_0x357fd1[_0x73f3('0x3b')]=qs[_0x73f3('0x33')](_['pick'](_0xeb1a66[_0x73f3('0x32')],_0x172377[_0x73f3('0x33')]),_0x4d31ef);if(_0xeb1a66['query']['filter']){_0x357fd1[_0x73f3('0x3b')]=_[_0x73f3('0x3c')](_0x357fd1[_0x73f3('0x3b')],{'$or':_[_0x73f3('0x3d')](_0x4d31ef,function(_0x2b6d52){if(_0x2b6d52[_0x73f3('0x2d')]!==_0x73f3('0x3e')){var _0x15fb74={};_0x15fb74[_0x2b6d52[_0x73f3('0x30')]]={'$like':'%'+_0xeb1a66['query'][_0x73f3('0x3f')]+'%'};return _0x15fb74;}})});}_0x357fd1=_[_0x73f3('0x3c')]({},_0x357fd1,_0xeb1a66[_0x73f3('0x40')]);var _0x2b04d1={'where':_0x357fd1[_0x73f3('0x3b')]};return db['JscriptySessionReport']['count'](_0x2b04d1)['then'](function(_0x26dc0e){_0x4c976e[_0x73f3('0x1e')]=_0x26dc0e;if(_0xeb1a66[_0x73f3('0x32')][_0x73f3('0x41')]){_0x357fd1['include']=[{'all':!![]}];}return db[_0x73f3('0x2a')][_0x73f3('0x42')](_0x357fd1);})[_0x73f3('0x24')](function(_0x5caaf9){_0x4c976e['rows']=_0x5caaf9;return _0x4c976e;})[_0x73f3('0x24')](respondWithFilteredResult(_0x394fbb,_0x357fd1))[_0x73f3('0x43')](handleError(_0x394fbb,null));};exports[_0x73f3('0x44')]=function(_0x34675e,_0x213e43){var _0x3e1965={'raw':!![],'where':{'id':_0x34675e['params']['id']}},_0x2034dc={};_0x2034dc['model']=_[_0x73f3('0x31')](db[_0x73f3('0x2a')][_0x73f3('0x2b')]);_0x2034dc[_0x73f3('0x32')]=_['keys'](_0x34675e[_0x73f3('0x32')]);_0x2034dc[_0x73f3('0x33')]=_['intersection'](_0x2034dc[_0x73f3('0x2f')],_0x2034dc['query']);_0x3e1965[_0x73f3('0x35')]=_[_0x73f3('0x34')](_0x2034dc[_0x73f3('0x2f')],qs[_0x73f3('0x36')](_0x34675e[_0x73f3('0x32')]['fields']));_0x3e1965[_0x73f3('0x35')]=_0x3e1965[_0x73f3('0x35')]['length']?_0x3e1965[_0x73f3('0x35')]:_0x2034dc[_0x73f3('0x2f')];if(_0x34675e[_0x73f3('0x32')]['includeAll']){_0x3e1965['include']=[{'all':!![]}];}_0x3e1965=_[_0x73f3('0x3c')]({},_0x3e1965,_0x34675e['options']);return db[_0x73f3('0x2a')][_0x73f3('0x45')](_0x3e1965)[_0x73f3('0x24')](handleEntityNotFound(_0x213e43,null))[_0x73f3('0x24')](respondWithResult(_0x213e43,null))[_0x73f3('0x43')](handleError(_0x213e43,null));};exports[_0x73f3('0x46')]=function(_0x10e0e4,_0x25f685){return db[_0x73f3('0x2a')][_0x73f3('0x46')](_0x10e0e4[_0x73f3('0x47')],{})[_0x73f3('0x24')](respondWithResult(_0x25f685,0xc9))[_0x73f3('0x43')](handleError(_0x25f685,null));};exports['update']=function(_0x40baa4,_0x1a5024){if(_0x40baa4[_0x73f3('0x47')]['id']){delete _0x40baa4[_0x73f3('0x47')]['id'];}return db[_0x73f3('0x2a')][_0x73f3('0x45')]({'where':{'id':_0x40baa4[_0x73f3('0x48')]['id']}})[_0x73f3('0x24')](handleEntityNotFound(_0x1a5024,null))[_0x73f3('0x24')](saveUpdates(_0x40baa4[_0x73f3('0x47')],null))[_0x73f3('0x24')](respondWithResult(_0x1a5024,null))[_0x73f3('0x43')](handleError(_0x1a5024,null));};exports[_0x73f3('0x25')]=function(_0x581615,_0xd4362f){return db['JscriptySessionReport'][_0x73f3('0x45')]({'where':{'id':_0x581615[_0x73f3('0x48')]['id']}})[_0x73f3('0x24')](handleEntityNotFound(_0xd4362f,null))['then'](removeEntity(_0xd4362f,null))[_0x73f3('0x43')](handleError(_0xd4362f,null));};exports[_0x73f3('0x49')]=function(_0x3eeeb7,_0x50dc43){return db[_0x73f3('0x2a')][_0x73f3('0x49')]()[_0x73f3('0x24')](respondWithResult(_0x50dc43,null))[_0x73f3('0x43')](handleError(_0x50dc43,null));};exports[_0x73f3('0x4a')]=function(_0x3d0d58,_0x2148bf,_0x193a91){var _0x47c270={'raw':!![],'where':{}};var _0x2a9a6b={};var _0x4845b1={'count':0x0,'rows':[]};return db[_0x73f3('0x2a')][_0x73f3('0x4b')]({'where':{'id':_0x3d0d58[_0x73f3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2148bf,null))[_0x73f3('0x24')](function(_0x4fac43){if(_0x4fac43){_0x2a9a6b['model']=_[_0x73f3('0x31')](db[_0x73f3('0x4c')][_0x73f3('0x2b')]);_0x2a9a6b['query']=_['keys'](_0x3d0d58[_0x73f3('0x32')]);_0x2a9a6b[_0x73f3('0x33')]=_[_0x73f3('0x34')](_0x2a9a6b[_0x73f3('0x2f')],_0x2a9a6b[_0x73f3('0x32')]);_0x47c270[_0x73f3('0x35')]=_[_0x73f3('0x34')](_0x2a9a6b['model'],qs[_0x73f3('0x36')](_0x3d0d58[_0x73f3('0x32')][_0x73f3('0x36')]));_0x47c270[_0x73f3('0x35')]=_0x47c270[_0x73f3('0x35')][_0x73f3('0x37')]?_0x47c270[_0x73f3('0x35')]:_0x2a9a6b[_0x73f3('0x2f')];if(!_0x3d0d58[_0x73f3('0x32')][_0x73f3('0x38')](_0x73f3('0x39'))){_0x47c270[_0x73f3('0x1d')]=qs[_0x73f3('0x1d')](_0x3d0d58['query']['limit']);_0x47c270[_0x73f3('0x1b')]=qs[_0x73f3('0x1b')](_0x3d0d58[_0x73f3('0x32')][_0x73f3('0x1b')]);}_0x47c270[_0x73f3('0x4d')]=qs[_0x73f3('0x3a')](_0x3d0d58['query'][_0x73f3('0x3a')]);_0x47c270[_0x73f3('0x3b')]=qs[_0x73f3('0x33')](_[_0x73f3('0x4e')](_0x3d0d58['query'],_0x2a9a6b[_0x73f3('0x33')]));_0x47c270[_0x73f3('0x3b')][_0x73f3('0x4f')]=_0x4fac43['id'];if(_0x3d0d58['query'][_0x73f3('0x3f')]){_0x47c270['where']=_[_0x73f3('0x3c')](_0x47c270[_0x73f3('0x3b')],{'$or':_[_0x73f3('0x3d')](_0x47c270[_0x73f3('0x35')],function(_0x3e79f2){var _0x4981d5={};_0x4981d5[_0x3e79f2]={'$like':'%'+_0x3d0d58[_0x73f3('0x32')][_0x73f3('0x3f')]+'%'};return _0x4981d5;})});}_0x47c270=_[_0x73f3('0x3c')]({},_0x47c270,_0x3d0d58[_0x73f3('0x40')]);return db[_0x73f3('0x4c')][_0x73f3('0x1e')]({'where':_0x47c270['where']})[_0x73f3('0x24')](function(_0x3e216d){_0x4845b1[_0x73f3('0x1e')]=_0x3e216d;if(_0x3d0d58[_0x73f3('0x32')][_0x73f3('0x41')]){_0x47c270[_0x73f3('0x50')]=[{'all':!![]}];}return db[_0x73f3('0x4c')][_0x73f3('0x42')](_0x47c270);})[_0x73f3('0x24')](function(_0x14c4b4){_0x4845b1[_0x73f3('0x51')]=_0x14c4b4;return _0x4845b1;});}})['then'](respondWithFilteredResult(_0x2148bf,_0x47c270))[_0x73f3('0x43')](handleError(_0x2148bf,null));}; \ No newline at end of file +var _0xad77=['index','map','JscriptySessionReport','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','model','create','body','find','describe','getQuestions','findOne','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','send'];(function(_0x385e92,_0xb98f63){var _0x13f730=function(_0x898ed0){while(--_0x898ed0){_0x385e92['push'](_0x385e92['shift']());}};_0x13f730(++_0xb98f63);}(_0xad77,0xbe));var _0x7ad7=function(_0x4f3ddf,_0x5e57bb){_0x4f3ddf=_0x4f3ddf-0x0;var _0x54190b=_0xad77[_0x4f3ddf];return _0x54190b;};'use strict';var emlformat=require(_0x7ad7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ad7('0x1'));var jsonpatch=require(_0x7ad7('0x2'));var rp=require('request-promise');var moment=require(_0x7ad7('0x3'));var BPromise=require(_0x7ad7('0x4'));var Mustache=require(_0x7ad7('0x5'));var util=require(_0x7ad7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7ad7('0x7'));var ejs=require(_0x7ad7('0x8'));var fs=require('fs');var fs_extra=require(_0x7ad7('0x9'));var _=require(_0x7ad7('0xa'));var squel=require(_0x7ad7('0xb'));var crypto=require(_0x7ad7('0xc'));var jsforce=require(_0x7ad7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7ad7('0x7'));var querystring=require(_0x7ad7('0xe'));var Papa=require(_0x7ad7('0xf'));var Redis=require(_0x7ad7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7ad7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ad7('0x12'))(_0x7ad7('0x13'));var utils=require(_0x7ad7('0x14'));var config=require(_0x7ad7('0x15'));var licenseUtil=require(_0x7ad7('0x16'));var db=require(_0x7ad7('0x17'))['db'];function respondWithStatusCode(_0x591964,_0x13b51a){_0x13b51a=_0x13b51a||0xcc;return function(_0x49c3c2){if(_0x49c3c2){return _0x591964[_0x7ad7('0x18')](_0x13b51a);}return _0x591964[_0x7ad7('0x19')](_0x13b51a)[_0x7ad7('0x1a')]();};}function respondWithResult(_0x58aff9,_0x5a5200){_0x5a5200=_0x5a5200||0xc8;return function(_0x4f5a98){if(_0x4f5a98){return _0x58aff9['status'](_0x5a5200)[_0x7ad7('0x1b')](_0x4f5a98);}};}function respondWithFilteredResult(_0x45e21b,_0x3981c7){return function(_0x5a4a26){if(_0x5a4a26){var _0x39fd0b=typeof _0x3981c7[_0x7ad7('0x1c')]===_0x7ad7('0x1d')&&typeof _0x3981c7[_0x7ad7('0x1e')]===_0x7ad7('0x1d');var _0xd01af6=_0x5a4a26['count'];var _0x28e218=_0x39fd0b?0x0:_0x3981c7[_0x7ad7('0x1c')];var _0x232baa=_0x39fd0b?_0x5a4a26[_0x7ad7('0x1f')]:_0x3981c7[_0x7ad7('0x1c')]+_0x3981c7[_0x7ad7('0x1e')];var _0x36f940;if(_0x232baa>=_0xd01af6){_0x232baa=_0xd01af6;_0x36f940=0xc8;}else{_0x36f940=0xce;}_0x45e21b['status'](_0x36f940);return _0x45e21b[_0x7ad7('0x20')](_0x7ad7('0x21'),_0x28e218+'-'+_0x232baa+'/'+_0xd01af6)[_0x7ad7('0x1b')](_0x5a4a26);}return null;};}function patchUpdates(_0x1875f6){return function(_0x28c080){try{jsonpatch[_0x7ad7('0x22')](_0x28c080,_0x1875f6,!![]);}catch(_0x33f1e6){return BPromise['reject'](_0x33f1e6);}return _0x28c080['save']();};}function saveUpdates(_0x17303a,_0x2154ea){return function(_0x4e30d2){if(_0x4e30d2){return _0x4e30d2[_0x7ad7('0x23')](_0x17303a)[_0x7ad7('0x24')](function(_0x385e35){return _0x385e35;});}return null;};}function removeEntity(_0x363c7a,_0x2601e7){return function(_0x3d4fa0){if(_0x3d4fa0){return _0x3d4fa0['destroy']()[_0x7ad7('0x24')](function(){_0x363c7a[_0x7ad7('0x19')](0xcc)[_0x7ad7('0x1a')]();});}};}function handleEntityNotFound(_0x293476,_0x569b2a){return function(_0x119199){if(!_0x119199){_0x293476[_0x7ad7('0x18')](0x194);}return _0x119199;};}function handleError(_0x4bd26d,_0x12826e){_0x12826e=_0x12826e||0x1f4;return function(_0x3b3ccc){logger[_0x7ad7('0x25')](_0x3b3ccc[_0x7ad7('0x26')]);if(_0x3b3ccc['name']){delete _0x3b3ccc[_0x7ad7('0x27')];}_0x4bd26d[_0x7ad7('0x19')](_0x12826e)[_0x7ad7('0x28')](_0x3b3ccc);};}exports[_0x7ad7('0x29')]=function(_0x26f60f,_0x1daa86){var _0x14883c={},_0x3b2e83={},_0x5d4ff3={'count':0x0,'rows':[]};var _0x424b34=_[_0x7ad7('0x2a')](db[_0x7ad7('0x2b')]['rawAttributes'],function(_0x2cc6d2){return{'name':_0x2cc6d2[_0x7ad7('0x2c')],'type':_0x2cc6d2[_0x7ad7('0x2d')][_0x7ad7('0x2e')]};});_0x3b2e83['model']=_[_0x7ad7('0x2a')](_0x424b34,_0x7ad7('0x27'));_0x3b2e83[_0x7ad7('0x2f')]=_[_0x7ad7('0x30')](_0x26f60f[_0x7ad7('0x2f')]);_0x3b2e83[_0x7ad7('0x31')]=_[_0x7ad7('0x32')](_0x3b2e83['model'],_0x3b2e83[_0x7ad7('0x2f')]);_0x14883c[_0x7ad7('0x33')]=_[_0x7ad7('0x32')](_0x3b2e83['model'],qs[_0x7ad7('0x34')](_0x26f60f[_0x7ad7('0x2f')][_0x7ad7('0x34')]));_0x14883c[_0x7ad7('0x33')]=_0x14883c[_0x7ad7('0x33')][_0x7ad7('0x35')]?_0x14883c[_0x7ad7('0x33')]:_0x3b2e83['model'];if(!_0x26f60f[_0x7ad7('0x2f')][_0x7ad7('0x36')](_0x7ad7('0x37'))){_0x14883c[_0x7ad7('0x1e')]=qs[_0x7ad7('0x1e')](_0x26f60f[_0x7ad7('0x2f')][_0x7ad7('0x1e')]);_0x14883c[_0x7ad7('0x1c')]=qs[_0x7ad7('0x1c')](_0x26f60f['query'][_0x7ad7('0x1c')]);}_0x14883c['order']=qs['sort'](_0x26f60f[_0x7ad7('0x2f')][_0x7ad7('0x38')]);_0x14883c[_0x7ad7('0x39')]=qs[_0x7ad7('0x31')](_['pick'](_0x26f60f[_0x7ad7('0x2f')],_0x3b2e83[_0x7ad7('0x31')]),_0x424b34);if(_0x26f60f[_0x7ad7('0x2f')][_0x7ad7('0x3a')]){_0x14883c[_0x7ad7('0x39')]=_[_0x7ad7('0x3b')](_0x14883c['where'],{'$or':_['map'](_0x424b34,function(_0x2e815b){if(_0x2e815b[_0x7ad7('0x2d')]!=='VIRTUAL'){var _0x386bbb={};_0x386bbb[_0x2e815b[_0x7ad7('0x27')]]={'$like':'%'+_0x26f60f[_0x7ad7('0x2f')]['filter']+'%'};return _0x386bbb;}})});}_0x14883c=_[_0x7ad7('0x3b')]({},_0x14883c,_0x26f60f[_0x7ad7('0x3c')]);var _0x207ee6={'where':_0x14883c[_0x7ad7('0x39')]};return db['JscriptySessionReport']['count'](_0x207ee6)[_0x7ad7('0x24')](function(_0x12792d){_0x5d4ff3[_0x7ad7('0x1f')]=_0x12792d;if(_0x26f60f['query'][_0x7ad7('0x3d')]){_0x14883c[_0x7ad7('0x3e')]=[{'all':!![]}];}return db[_0x7ad7('0x2b')][_0x7ad7('0x3f')](_0x14883c);})[_0x7ad7('0x24')](function(_0x4b6fa9){_0x5d4ff3[_0x7ad7('0x40')]=_0x4b6fa9;return _0x5d4ff3;})[_0x7ad7('0x24')](respondWithFilteredResult(_0x1daa86,_0x14883c))[_0x7ad7('0x41')](handleError(_0x1daa86,null));};exports['show']=function(_0x408df0,_0x259816){var _0x2fec79={'raw':!![],'where':{'id':_0x408df0[_0x7ad7('0x42')]['id']}},_0x1eb910={};_0x1eb910[_0x7ad7('0x43')]=_[_0x7ad7('0x30')](db[_0x7ad7('0x2b')]['rawAttributes']);_0x1eb910['query']=_[_0x7ad7('0x30')](_0x408df0['query']);_0x1eb910[_0x7ad7('0x31')]=_[_0x7ad7('0x32')](_0x1eb910[_0x7ad7('0x43')],_0x1eb910[_0x7ad7('0x2f')]);_0x2fec79[_0x7ad7('0x33')]=_[_0x7ad7('0x32')](_0x1eb910[_0x7ad7('0x43')],qs[_0x7ad7('0x34')](_0x408df0[_0x7ad7('0x2f')]['fields']));_0x2fec79['attributes']=_0x2fec79['attributes'][_0x7ad7('0x35')]?_0x2fec79['attributes']:_0x1eb910[_0x7ad7('0x43')];if(_0x408df0[_0x7ad7('0x2f')]['includeAll']){_0x2fec79[_0x7ad7('0x3e')]=[{'all':!![]}];}_0x2fec79=_[_0x7ad7('0x3b')]({},_0x2fec79,_0x408df0[_0x7ad7('0x3c')]);return db['JscriptySessionReport']['find'](_0x2fec79)[_0x7ad7('0x24')](handleEntityNotFound(_0x259816,null))[_0x7ad7('0x24')](respondWithResult(_0x259816,null))[_0x7ad7('0x41')](handleError(_0x259816,null));};exports['create']=function(_0x36c3e6,_0x4b6b59){return db['JscriptySessionReport'][_0x7ad7('0x44')](_0x36c3e6[_0x7ad7('0x45')],{})['then'](respondWithResult(_0x4b6b59,0xc9))[_0x7ad7('0x41')](handleError(_0x4b6b59,null));};exports[_0x7ad7('0x23')]=function(_0x2b515d,_0x3ca771){if(_0x2b515d[_0x7ad7('0x45')]['id']){delete _0x2b515d[_0x7ad7('0x45')]['id'];}return db[_0x7ad7('0x2b')][_0x7ad7('0x46')]({'where':{'id':_0x2b515d[_0x7ad7('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ca771,null))[_0x7ad7('0x24')](saveUpdates(_0x2b515d['body'],null))[_0x7ad7('0x24')](respondWithResult(_0x3ca771,null))['catch'](handleError(_0x3ca771,null));};exports['destroy']=function(_0x3e323e,_0x551eae){return db[_0x7ad7('0x2b')][_0x7ad7('0x46')]({'where':{'id':_0x3e323e[_0x7ad7('0x42')]['id']}})['then'](handleEntityNotFound(_0x551eae,null))[_0x7ad7('0x24')](removeEntity(_0x551eae,null))['catch'](handleError(_0x551eae,null));};exports[_0x7ad7('0x47')]=function(_0x421103,_0x394e42){return db[_0x7ad7('0x2b')][_0x7ad7('0x47')]()[_0x7ad7('0x24')](respondWithResult(_0x394e42,null))[_0x7ad7('0x41')](handleError(_0x394e42,null));};exports[_0x7ad7('0x48')]=function(_0x43556d,_0x104844,_0x458561){var _0x4078ff={'raw':!![],'where':{}};var _0x4b46e8={};var _0x90e32a={'count':0x0,'rows':[]};return db[_0x7ad7('0x2b')][_0x7ad7('0x49')]({'where':{'id':_0x43556d[_0x7ad7('0x42')]['id']}})['then'](handleEntityNotFound(_0x104844,null))[_0x7ad7('0x24')](function(_0x18c6df){if(_0x18c6df){_0x4b46e8['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x4b46e8[_0x7ad7('0x2f')]=_[_0x7ad7('0x30')](_0x43556d[_0x7ad7('0x2f')]);_0x4b46e8[_0x7ad7('0x31')]=_[_0x7ad7('0x32')](_0x4b46e8[_0x7ad7('0x43')],_0x4b46e8['query']);_0x4078ff['attributes']=_[_0x7ad7('0x32')](_0x4b46e8[_0x7ad7('0x43')],qs[_0x7ad7('0x34')](_0x43556d[_0x7ad7('0x2f')][_0x7ad7('0x34')]));_0x4078ff[_0x7ad7('0x33')]=_0x4078ff['attributes'][_0x7ad7('0x35')]?_0x4078ff['attributes']:_0x4b46e8[_0x7ad7('0x43')];if(!_0x43556d[_0x7ad7('0x2f')][_0x7ad7('0x36')](_0x7ad7('0x37'))){_0x4078ff[_0x7ad7('0x1e')]=qs['limit'](_0x43556d[_0x7ad7('0x2f')][_0x7ad7('0x1e')]);_0x4078ff[_0x7ad7('0x1c')]=qs[_0x7ad7('0x1c')](_0x43556d['query'][_0x7ad7('0x1c')]);}_0x4078ff[_0x7ad7('0x4a')]=qs[_0x7ad7('0x38')](_0x43556d[_0x7ad7('0x2f')][_0x7ad7('0x38')]);_0x4078ff[_0x7ad7('0x39')]=qs[_0x7ad7('0x31')](_['pick'](_0x43556d[_0x7ad7('0x2f')],_0x4b46e8[_0x7ad7('0x31')]));_0x4078ff[_0x7ad7('0x39')][_0x7ad7('0x4b')]=_0x18c6df['id'];if(_0x43556d[_0x7ad7('0x2f')][_0x7ad7('0x3a')]){_0x4078ff[_0x7ad7('0x39')]=_[_0x7ad7('0x3b')](_0x4078ff['where'],{'$or':_[_0x7ad7('0x2a')](_0x4078ff[_0x7ad7('0x33')],function(_0x37c68a){var _0x39a48={};_0x39a48[_0x37c68a]={'$like':'%'+_0x43556d[_0x7ad7('0x2f')]['filter']+'%'};return _0x39a48;})});}_0x4078ff=_[_0x7ad7('0x3b')]({},_0x4078ff,_0x43556d[_0x7ad7('0x3c')]);return db['JscriptyQuestionReport'][_0x7ad7('0x1f')]({'where':_0x4078ff[_0x7ad7('0x39')]})[_0x7ad7('0x24')](function(_0x2e7163){_0x90e32a['count']=_0x2e7163;if(_0x43556d[_0x7ad7('0x2f')]['includeAll']){_0x4078ff[_0x7ad7('0x3e')]=[{'all':!![]}];}return db[_0x7ad7('0x4c')][_0x7ad7('0x3f')](_0x4078ff);})[_0x7ad7('0x24')](function(_0x504b08){_0x90e32a['rows']=_0x504b08;return _0x90e32a;});}})[_0x7ad7('0x24')](respondWithFilteredResult(_0x104844,_0x4078ff))[_0x7ad7('0x41')](handleError(_0x104844,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 02233ad..0dc452e 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 _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x885a,0x180));var _0xa885=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x885a[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x741c=['../../config/logger','api','moment','bluebird','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x2e39e8,_0x5ec47c){var _0x32c7fc=function(_0x51ca66){while(--_0x51ca66){_0x2e39e8['push'](_0x2e39e8['shift']());}};_0x32c7fc(++_0x5ec47c);}(_0x741c,0x196));var _0xc741=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x741c[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var logger=require(_0xc741('0x2'))(_0xc741('0x3'));var moment=require(_0xc741('0x4'));var BPromise=require(_0xc741('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc741('0x6'));var config=require('../../config/environment');var attributes=require(_0xc741('0x7'));module[_0xc741('0x8')]=function(_0x3708ae,_0x133bc4){return _0x3708ae[_0xc741('0x9')](_0xc741('0xa'),attributes,{'tableName':_0xc741('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 6d1739f..267d764 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 _0x1893=['../../config/logger','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9dd37c,_0x3e255e){var _0x2a522c=function(_0x2ce2ca){while(--_0x2ce2ca){_0x9dd37c['push'](_0x9dd37c['shift']());}};_0x2a522c(++_0x3e255e);}(_0x1893,0xa2));var _0x3189=function(_0x2d05fa,_0x372364){_0x2d05fa=_0x2d05fa-0x0;var _0x10ae61=_0x1893[_0x2d05fa];return _0x10ae61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3189('0x0'));var BPromise=require(_0x3189('0x1'));var rs=require(_0x3189('0x2'));var fs=require('fs');var Redis=require(_0x3189('0x3'));var db=require(_0x3189('0x4'))['db'];var utils=require(_0x3189('0x5'));var logger=require(_0x3189('0x6'))('rpc');var config=require(_0x3189('0x7'));var jayson=require(_0x3189('0x8'));var client=jayson[_0x3189('0x9')][_0x3189('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x77c566,_0x118970,_0x14d84b){return new BPromise(function(_0x1f6764,_0x5312a3){return client[_0x3189('0xb')](_0x77c566,_0x14d84b)['then'](function(_0x127449){logger['info'](_0x3189('0xc'),_0x118970,_0x3189('0xd'));logger[_0x3189('0xe')](_0x3189('0xf'),_0x118970,'request\x20sent',JSON[_0x3189('0x10')](_0x127449));if(_0x127449[_0x3189('0x11')]){if(_0x127449[_0x3189('0x11')][_0x3189('0x12')]===0x1f4){logger[_0x3189('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x5312a3(_0x127449[_0x3189('0x11')][_0x3189('0x13')]);}logger[_0x3189('0x11')](_0x3189('0xc'),_0x118970,_0x127449[_0x3189('0x11')][_0x3189('0x13')]);return _0x1f6764(_0x127449['error'][_0x3189('0x13')]);}else{logger[_0x3189('0x14')](_0x3189('0xc'),_0x118970,_0x3189('0xd'));_0x1f6764(_0x127449['result'][_0x3189('0x13')]);}})['catch'](function(_0x55f432){logger[_0x3189('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x118970,_0x55f432);_0x5312a3(_0x55f432);});});} \ No newline at end of file +var _0x47c5=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x47c5,0x165));var _0x547c=function(_0x12e1fa,_0x2da3b8){_0x12e1fa=_0x12e1fa-0x0;var _0x498b71=_0x47c5[_0x12e1fa];return _0x498b71;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 5c249dc..6d7cbf3 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 _0x85d8=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','put','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0x4a151f,_0x1adefa){var _0x28f5dd=function(_0x2a0ca9){while(--_0x2a0ca9){_0x4a151f['push'](_0x4a151f['shift']());}};_0x28f5dd(++_0x1adefa);}(_0x85d8,0x1b0));var _0x885d=function(_0x3cdc17,_0xb002e1){_0x3cdc17=_0x3cdc17-0x0;var _0x20f054=_0x85d8[_0x3cdc17];return _0x20f054;};'use strict';var multer=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var path=require(_0x885d('0x2'));var timeout=require(_0x885d('0x3'));var express=require(_0x885d('0x4'));var router=express['Router']();var fs_extra=require(_0x885d('0x5'));var auth=require(_0x885d('0x6'));var interaction=require(_0x885d('0x7'));var config=require(_0x885d('0x8'));var controller=require('./license.controller');router['get']('/',controller[_0x885d('0x9')]);router[_0x885d('0xa')](_0x885d('0xb'),auth[_0x885d('0xc')](),controller[_0x885d('0xd')]);module[_0x885d('0xe')]=router; \ No newline at end of file +var _0x77a5=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','/:id'];(function(_0x323e32,_0x3ed8c8){var _0x4596a7=function(_0x31dc43){while(--_0x31dc43){_0x323e32['push'](_0x323e32['shift']());}};_0x4596a7(++_0x3ed8c8);}(_0x77a5,0x196));var _0x577a=function(_0xf36a76,_0x3967b3){_0xf36a76=_0xf36a76-0x0;var _0x414aa5=_0x77a5[_0xf36a76];return _0x414aa5;};'use strict';var multer=require(_0x577a('0x0'));var util=require(_0x577a('0x1'));var path=require(_0x577a('0x2'));var timeout=require(_0x577a('0x3'));var express=require(_0x577a('0x4'));var router=express[_0x577a('0x5')]();var fs_extra=require(_0x577a('0x6'));var auth=require(_0x577a('0x7'));var interaction=require(_0x577a('0x8'));var config=require(_0x577a('0x9'));var controller=require(_0x577a('0xa'));router[_0x577a('0xb')]('/',controller['index']);router[_0x577a('0xc')](_0x577a('0xd'),auth['isAuthenticated'](),controller[_0x577a('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 4ef8939..327cc8a 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 _0x2788=['sequelize','exports','STRING','INTEGER'];(function(_0x188db4,_0x273b2a){var _0x238427=function(_0x5ee3ef){while(--_0x5ee3ef){_0x188db4['push'](_0x188db4['shift']());}};_0x238427(++_0x273b2a);}(_0x2788,0x6c));var _0x8278=function(_0x19ec65,_0xfb4991){_0x19ec65=_0x19ec65-0x0;var _0x9c893b=_0x2788[_0x19ec65];return _0x9c893b;};'use strict';var Sequelize=require(_0x8278('0x0'));module[_0x8278('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x8278('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x8278('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5a60=['TEXT','INTEGER','sequelize','exports'];(function(_0x1ac186,_0x7cec31){var _0x4186cb=function(_0x164c76){while(--_0x164c76){_0x1ac186['push'](_0x1ac186['shift']());}};_0x4186cb(++_0x7cec31);}(_0x5a60,0xae));var _0x05a6=function(_0x266414,_0x4afcfe){_0x266414=_0x266414-0x0;var _0x10016b=_0x5a60[_0x266414];return _0x10016b;};'use strict';var Sequelize=require(_0x05a6('0x0'));module[_0x05a6('0x1')]={'license':{'type':Sequelize[_0x05a6('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x05a6('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 1e79b56..450f6bf 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 _0x7a54=['count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','License','query','keys','intersection','attributes','fields','length','options','getLicense','body','find','checkLicense','key','demo','catch','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'];(function(_0x17fe77,_0x3ed5ca){var _0x5efa87=function(_0x1fe411){while(--_0x1fe411){_0x17fe77['push'](_0x17fe77['shift']());}};_0x5efa87(++_0x3ed5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x4eb81f,_0x2389e5){_0x4eb81f=_0x4eb81f-0x0;var _0x3a1c6a=_0x7a54[_0x4eb81f];return _0x3a1c6a;};'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);};}var utilLicense=require(_0x47a5('0x14'));exports[_0x47a5('0x29')]=function(_0x16631f,_0x361bfa){var _0x1127f8={'raw':!![],'where':{'id':0x1}},_0x11a4fa={};_0x11a4fa[_0x47a5('0x2a')]=_['keys'](db[_0x47a5('0x2b')]['rawAttributes']);_0x11a4fa[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x16631f[_0x47a5('0x2c')]);_0x11a4fa['filters']=_[_0x47a5('0x2e')](_0x11a4fa[_0x47a5('0x2a')],_0x11a4fa[_0x47a5('0x2c')]);_0x1127f8[_0x47a5('0x2f')]=_['intersection'](_0x11a4fa['model'],qs[_0x47a5('0x30')](_0x16631f[_0x47a5('0x2c')]['fields']));_0x1127f8['attributes']=_0x1127f8[_0x47a5('0x2f')][_0x47a5('0x31')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x2a')];_0x1127f8=_['merge']({},_0x1127f8,_0x16631f[_0x47a5('0x32')]);return utilLicense[_0x47a5('0x33')](_0x1127f8)['then'](respondWithResult(_0x361bfa,null))['catch'](handleError(_0x361bfa,null));};exports[_0x47a5('0x22')]=function(_0x5910bb,_0x403028){if(_0x5910bb[_0x47a5('0x34')]['id']){delete _0x5910bb[_0x47a5('0x34')]['id'];}return db['License'][_0x47a5('0x35')]({'where':{'id':_0x5910bb['params']['id']}})['then'](handleEntityNotFound(_0x403028,null))[_0x47a5('0x23')](function(_0x5a8a7c){var _0x25cce0=_0x5a8a7c['get']({'plain':!![]});return utilLicense[_0x47a5('0x36')](_0x25cce0,_0x5910bb[_0x47a5('0x34')][_0x47a5('0x37')]);})[_0x47a5('0x23')](function(_0x36add5){if(!_0x36add5[_0x47a5('0x38')]){return saveUpdates(_0x5910bb[_0x47a5('0x34')],null);}return _0x36add5;})[_0x47a5('0x23')](respondWithResult(_0x403028,null))[_0x47a5('0x39')](handleError(_0x403028,null));}; \ No newline at end of file +var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x3485de,_0x319486){var _0x21551f=function(_0x239f28){while(--_0x239f28){_0x3485de['push'](_0x3485de['shift']());}};_0x21551f(++_0x319486);}(_0x4975,0x86));var _0x5497=function(_0x1047e3,_0x4a0091){_0x1047e3=_0x1047e3-0x0;var _0x587622=_0x4975[_0x1047e3];return _0x587622;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 286d4ac..73b1596 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 _0x2f5e=['exports','define','License','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x2f5e,0x14d));var _0xe2f5=function(_0x3bc730,_0xa7112b){_0x3bc730=_0x3bc730-0x0;var _0x4a7d76=_0x2f5e[_0x3bc730];return _0x4a7d76;};'use strict';var _=require(_0xe2f5('0x0'));var util=require(_0xe2f5('0x1'));var logger=require(_0xe2f5('0x2'))('api');var moment=require(_0xe2f5('0x3'));var BPromise=require(_0xe2f5('0x4'));var rp=require(_0xe2f5('0x5'));var fs=require('fs');var path=require(_0xe2f5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xe2f5('0x7')]=function(_0x76e063,_0x28d33a){return _0x76e063[_0xe2f5('0x8')](_0xe2f5('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf5a=['./license.attributes','exports','license','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x284556,_0x214e94){var _0x5517ec=function(_0x5c6938){while(--_0x5c6938){_0x284556['push'](_0x284556['shift']());}};_0x5517ec(++_0x214e94);}(_0xaf5a,0x116));var _0xaaf5=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0xaf5a[_0xf26d40];return _0x50b68c;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var logger=require(_0xaaf5('0x1'))(_0xaaf5('0x2'));var moment=require(_0xaaf5('0x3'));var BPromise=require(_0xaaf5('0x4'));var rp=require(_0xaaf5('0x5'));var fs=require('fs');var path=require(_0xaaf5('0x6'));var rimraf=require(_0xaaf5('0x7'));var config=require('../../config/environment');var attributes=require(_0xaaf5('0x8'));module[_0xaaf5('0x9')]=function(_0x38d568,_0x8833b8){return _0x38d568['define']('License',attributes,{'tableName':_0xaaf5('0xa'),'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 3194680..244503a 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 _0xac40=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x1452f2,_0x39c749){var _0xda7706=function(_0x44b0ee){while(--_0x44b0ee){_0x1452f2['push'](_0x1452f2['shift']());}};_0xda7706(++_0x39c749);}(_0xac40,0x83));var _0x0ac4=function(_0x507d62,_0x1d792d){_0x507d62=_0x507d62-0x0;var _0x53a5c7=_0xac40[_0x507d62];return _0x53a5c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ac4('0x0'));var BPromise=require(_0x0ac4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ac4('0x2'));var db=require(_0x0ac4('0x3'))['db'];var utils=require(_0x0ac4('0x4'));var logger=require(_0x0ac4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0ac4('0x6'));var client=jayson['client'][_0x0ac4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xa17b87,_0x4a5811,_0x5dc48e){return new BPromise(function(_0x52d9d0,_0x164715){return client[_0x0ac4('0x8')](_0xa17b87,_0x5dc48e)[_0x0ac4('0x9')](function(_0x172371){logger[_0x0ac4('0xa')](_0x0ac4('0xb'),_0x4a5811,_0x0ac4('0xc'));logger[_0x0ac4('0xd')](_0x0ac4('0xe'),_0x4a5811,'request\x20sent',JSON[_0x0ac4('0xf')](_0x172371));if(_0x172371[_0x0ac4('0x10')]){if(_0x172371[_0x0ac4('0x10')]['code']===0x1f4){logger[_0x0ac4('0x10')]('License,\x20%s,\x20%s',_0x4a5811,_0x172371[_0x0ac4('0x10')][_0x0ac4('0x11')]);return _0x164715(_0x172371[_0x0ac4('0x10')][_0x0ac4('0x11')]);}logger['error'](_0x0ac4('0xb'),_0x4a5811,_0x172371[_0x0ac4('0x10')][_0x0ac4('0x11')]);return _0x52d9d0(_0x172371['error']['message']);}else{logger[_0x0ac4('0xa')](_0x0ac4('0xb'),_0x4a5811,_0x0ac4('0xc'));_0x52d9d0(_0x172371['result'][_0x0ac4('0x11')]);}})['catch'](function(_0x4c933b){logger[_0x0ac4('0x10')]('License,\x20%s,\x20%s',_0x4a5811,_0x4c933b);_0x164715(_0x4c933b);});});} \ No newline at end of file +var _0xb948=['License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x5f4606,_0xdfa5cd){var _0x644983=function(_0x4d13b1){while(--_0x4d13b1){_0x5f4606['push'](_0x5f4606['shift']());}};_0x644983(++_0xdfa5cd);}(_0xb948,0xed));var _0x8b94=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0xb948[_0x9d1e6b];return _0x2b3070;};'use strict';var _=require('lodash');var util=require(_0x8b94('0x0'));var moment=require(_0x8b94('0x1'));var BPromise=require(_0x8b94('0x2'));var rs=require(_0x8b94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b94('0x4'))['db'];var utils=require(_0x8b94('0x5'));var logger=require('../../config/logger')(_0x8b94('0x6'));var config=require(_0x8b94('0x7'));var jayson=require(_0x8b94('0x8'));var client=jayson[_0x8b94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x448392,_0x48e76c,_0x5a8506){return new BPromise(function(_0x4ac3e5,_0x1a2444){return client[_0x8b94('0xa')](_0x448392,_0x5a8506)[_0x8b94('0xb')](function(_0xb7c12b){logger[_0x8b94('0xc')]('License,\x20%s,\x20%s',_0x48e76c,_0x8b94('0xd'));logger[_0x8b94('0xe')](_0x8b94('0xf'),_0x48e76c,_0x8b94('0xd'),JSON[_0x8b94('0x10')](_0xb7c12b));if(_0xb7c12b[_0x8b94('0x11')]){if(_0xb7c12b[_0x8b94('0x11')]['code']===0x1f4){logger[_0x8b94('0x11')](_0x8b94('0x12'),_0x48e76c,_0xb7c12b['error']['message']);return _0x1a2444(_0xb7c12b[_0x8b94('0x11')][_0x8b94('0x13')]);}logger[_0x8b94('0x11')](_0x8b94('0x12'),_0x48e76c,_0xb7c12b[_0x8b94('0x11')][_0x8b94('0x13')]);return _0x4ac3e5(_0xb7c12b['error']['message']);}else{logger[_0x8b94('0xc')]('License,\x20%s,\x20%s',_0x48e76c,_0x8b94('0xd'));_0x4ac3e5(_0xb7c12b['result']['message']);}})[_0x8b94('0x14')](function(_0x1bd357){logger[_0x8b94('0x11')](_0x8b94('0x12'),_0x48e76c,_0x1bd357);_0x1a2444(_0x1bd357);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 2169cd3..b45ff4f 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 _0xdfed=['addDisposition','post','addAnswer','create','addImap','addSmtp','addApplications','/:id/send','send','addAgents','put','/:id','delete','/:id/canned_answers','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','show','getDispositions','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','/:id/dispositions'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xdfed,0x9d));var _0xddfe=function(_0x11b19b,_0x213234){_0x11b19b=_0x11b19b-0x0;var _0x1daac1=_0xdfed[_0x11b19b];return _0x1daac1;};'use strict';var multer=require(_0xddfe('0x0'));var util=require(_0xddfe('0x1'));var path=require(_0xddfe('0x2'));var timeout=require(_0xddfe('0x3'));var express=require(_0xddfe('0x4'));var router=express[_0xddfe('0x5')]();var fs_extra=require(_0xddfe('0x6'));var auth=require(_0xddfe('0x7'));var interaction=require(_0xddfe('0x8'));var config=require('../../config/environment');var controller=require(_0xddfe('0x9'));router[_0xddfe('0xa')]('/',auth[_0xddfe('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xddfe('0xa')]('/:id',auth[_0xddfe('0xb')](),controller[_0xddfe('0xc')]);router[_0xddfe('0xa')]('/:id/dispositions',auth[_0xddfe('0xb')](),controller[_0xddfe('0xd')]);router[_0xddfe('0xa')]('/:id/canned_answers',auth[_0xddfe('0xb')](),controller['getAnswers']);router[_0xddfe('0xa')](_0xddfe('0xe'),auth[_0xddfe('0xb')](),controller[_0xddfe('0xf')]);router['get'](_0xddfe('0x10'),auth[_0xddfe('0xb')](),controller['getSmtp']);router[_0xddfe('0xa')](_0xddfe('0x11'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x12')]);router['get'](_0xddfe('0x13'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x14')]);router[_0xddfe('0xa')](_0xddfe('0x15'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x16')]);router[_0xddfe('0xa')](_0xddfe('0x17'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x18')]);router['get'](_0xddfe('0x19'),auth[_0xddfe('0xb')](),controller['getAgents']);router['post'](_0xddfe('0x1a'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x1b')]);router[_0xddfe('0x1c')]('/:id/canned_answers',auth[_0xddfe('0xb')](),controller[_0xddfe('0x1d')]);router[_0xddfe('0x1c')]('/',auth['isAuthenticated'](),controller[_0xddfe('0x1e')]);router['post']('/:id/in_servers',auth[_0xddfe('0xb')](),controller[_0xddfe('0x1f')]);router[_0xddfe('0x1c')](_0xddfe('0x10'),auth['isAuthenticated'](),controller[_0xddfe('0x20')]);router['post'](_0xddfe('0x11'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xddfe('0x1c')](_0xddfe('0x13'),auth['isAuthenticated'](),controller[_0xddfe('0x21')]);router['post'](_0xddfe('0x22'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x23')]);router[_0xddfe('0x1c')](_0xddfe('0x19'),auth['isAuthenticated'](),controller[_0xddfe('0x24')]);router[_0xddfe('0x25')](_0xddfe('0x26'),auth[_0xddfe('0xb')](),controller['update']);router['delete'](_0xddfe('0x1a'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xddfe('0x27')](_0xddfe('0x28'),auth['isAuthenticated'](),controller[_0xddfe('0x29')]);router[_0xddfe('0x27')](_0xddfe('0xe'),auth[_0xddfe('0xb')](),controller['removeImap']);router[_0xddfe('0x27')](_0xddfe('0x10'),auth['isAuthenticated'](),controller[_0xddfe('0x2a')]);router[_0xddfe('0x27')](_0xddfe('0x26'),auth[_0xddfe('0xb')](),controller[_0xddfe('0x2b')]);router[_0xddfe('0x27')](_0xddfe('0x19'),auth['isAuthenticated'](),controller[_0xddfe('0x2c')]);module[_0xddfe('0x2d')]=router; \ No newline at end of file +var _0x8f53=['send','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addAnswer','addImap','addSmtp','addInteraction','/:id/send'];(function(_0x1d458f,_0x24b3b6){var _0x1324b7=function(_0x43a60c){while(--_0x43a60c){_0x1d458f['push'](_0x1d458f['shift']());}};_0x1324b7(++_0x24b3b6);}(_0x8f53,0x1a7));var _0x38f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f53[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var path=require(_0x38f5('0x2'));var timeout=require(_0x38f5('0x3'));var express=require('express');var router=express[_0x38f5('0x4')]();var fs_extra=require(_0x38f5('0x5'));var auth=require(_0x38f5('0x6'));var interaction=require(_0x38f5('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x38f5('0x8')]('/',auth['isAuthenticated'](),controller[_0x38f5('0x9')]);router[_0x38f5('0x8')](_0x38f5('0xa'),auth[_0x38f5('0xb')](),controller[_0x38f5('0xc')]);router['get'](_0x38f5('0xd'),auth[_0x38f5('0xb')](),controller[_0x38f5('0xe')]);router['get'](_0x38f5('0xf'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x10')]);router[_0x38f5('0x8')](_0x38f5('0x11'),auth['isAuthenticated'](),controller[_0x38f5('0x12')]);router[_0x38f5('0x8')](_0x38f5('0x13'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x14')]);router[_0x38f5('0x8')](_0x38f5('0x15'),auth['isAuthenticated'](),controller[_0x38f5('0x16')]);router[_0x38f5('0x8')](_0x38f5('0x17'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x18')]);router[_0x38f5('0x8')](_0x38f5('0x19'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x1a')]);router[_0x38f5('0x8')]('/:id/messages',auth[_0x38f5('0xb')](),controller[_0x38f5('0x1b')]);router[_0x38f5('0x8')]('/:id/verify',auth['isAuthenticated'](),controller[_0x38f5('0x1c')]);router[_0x38f5('0x8')](_0x38f5('0x1d'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x1e')]);router[_0x38f5('0x1f')](_0x38f5('0xf'),auth[_0x38f5('0xb')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x38f5('0xb')](),controller[_0x38f5('0x20')]);router['post']('/',auth[_0x38f5('0xb')](),controller['create']);router['post'](_0x38f5('0x13'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x21')]);router[_0x38f5('0x1f')]('/:id/out_servers',auth[_0x38f5('0xb')](),controller[_0x38f5('0x22')]);router[_0x38f5('0x1f')](_0x38f5('0x17'),auth['isAuthenticated'](),controller[_0x38f5('0x23')]);router[_0x38f5('0x1f')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x38f5('0x1f')](_0x38f5('0x24'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x25')]);router['post'](_0x38f5('0x1d'),auth['isAuthenticated'](),controller['addAgents']);router[_0x38f5('0x26')](_0x38f5('0xd'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x27')]);router[_0x38f5('0x28')](_0x38f5('0xf'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x29')]);router[_0x38f5('0x28')]('/:id/canned_answers',auth[_0x38f5('0xb')](),controller[_0x38f5('0x2a')]);router['delete']('/:id/in_servers',auth[_0x38f5('0xb')](),controller[_0x38f5('0x2b')]);router[_0x38f5('0x28')](_0x38f5('0x15'),auth[_0x38f5('0xb')](),controller['removeSmtp']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x38f5('0x2c')]);router['delete'](_0x38f5('0x1d'),auth[_0x38f5('0xb')](),controller[_0x38f5('0x2d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 5ceef3f..1004798 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 _0xdb4b=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports'];(function(_0x3a99f4,_0x2a81c1){var _0xea0b42=function(_0x41f533){while(--_0x41f533){_0x3a99f4['push'](_0x3a99f4['shift']());}};_0xea0b42(++_0x2a81c1);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x4bee59,_0x48f132){_0x4bee59=_0x4bee59-0x0;var _0x3ed6bb=_0xdb4b[_0x4bee59];return _0x3ed6bb;};'use strict';var Sequelize=require('sequelize');module[_0xbdb4('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xbdb4('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xbdb4('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xbdb4('0x3')]},'markAsUnread':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xbdb4('0x1')],'allowNull':![],'defaultValue':_0xbdb4('0x4')},'fontSize':{'type':Sequelize[_0xbdb4('0x5')](0x2)[_0xbdb4('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xbdb4('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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbdb4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbdb4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbdb4('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xbdb4('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xbdb4('0x2')],'defaultValue':![],'comment':_0xbdb4('0x8'),'set':function(_0x5b0420){if(!_0x5b0420)this['setDataValue'](_0xbdb4('0x9'),null);this[_0xbdb4('0xa')](_0xbdb4('0xb'),_0x5b0420);}}}; \ No newline at end of file +var _0x950a=['STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','exports'];(function(_0x2f110a,_0x597990){var _0x4608a5=function(_0xf855d8){while(--_0xf855d8){_0x2f110a['push'](_0x2f110a['shift']());}};_0x4608a5(++_0x597990);}(_0x950a,0x111));var _0xa950=function(_0x34f0be,_0x14b4db){_0x34f0be=_0x34f0be-0x0;var _0x537a5d=_0x950a[_0x34f0be];return _0x537a5d;};'use strict';var Sequelize=require(_0xa950('0x0'));module[_0xa950('0x1')]={'description':{'type':Sequelize[_0xa950('0x2')]},'name':{'type':Sequelize[_0xa950('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa950('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa950('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa950('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xa950('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa950('0x2')],'allowNull':![],'defaultValue':_0xa950('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xa950('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa950('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa950('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa950('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa950('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa950('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa950('0x8'),'set':function(_0x48c1b5){if(!_0x48c1b5)this[_0xa950('0x9')](_0xa950('0xa'),null);this[_0xa950('0x9')]('mandatoryDisposition',_0x48c1b5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e867f0c..19b7d5c 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 _0xce5c=['key','model','map','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','merge','find','body','update','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','List','updatedAt','DESC','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','type'];(function(_0x7908e8,_0x4361b0){var _0x32a798=function(_0x276027){while(--_0x276027){_0x7908e8['push'](_0x7908e8['shift']());}};_0x32a798(++_0x4361b0);}(_0xce5c,0x80));var _0xcce5=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0xce5c[_0x5c3ae9];return _0x3f5950;};'use strict';var emlformat=require(_0xcce5('0x0'));var rimraf=require(_0xcce5('0x1'));var zipdir=require(_0xcce5('0x2'));var jsonpatch=require(_0xcce5('0x3'));var rp=require(_0xcce5('0x4'));var moment=require(_0xcce5('0x5'));var BPromise=require(_0xcce5('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcce5('0x7'));var sox=require(_0xcce5('0x8'));var csv=require('to-csv');var ejs=require(_0xcce5('0x9'));var fs=require('fs');var fs_extra=require(_0xcce5('0xa'));var _=require(_0xcce5('0xb'));var squel=require(_0xcce5('0xc'));var crypto=require(_0xcce5('0xd'));var jsforce=require(_0xcce5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcce5('0xf'));var htmlToText=require(_0xcce5('0x10'));var juice=require('juice');var Redis=require(_0xcce5('0x11'));var authService=require(_0xcce5('0x12'));var qs=require(_0xcce5('0x13'));var as=require(_0xcce5('0x14'));var hardwareService=require(_0xcce5('0x15'));var logger=require(_0xcce5('0x16'))(_0xcce5('0x17'));var utils=require(_0xcce5('0x18'));var config=require(_0xcce5('0x19'));var licenseUtil=require(_0xcce5('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcce5('0x1b')](config[_0xcce5('0x1c')],{'host':_0xcce5('0x1d'),'port':0x18eb});var socket=require(_0xcce5('0x1e'))(new Redis(config[_0xcce5('0x1c')]));require(_0xcce5('0x1f'))[_0xcce5('0x20')](socket);var jayson=require(_0xcce5('0x21'));var client=jayson['client'][_0xcce5('0x22')]({'port':0x232b});function respondWithRpcPromise(_0xf91758,_0x24503a,_0x565e91,_0x111ed3){return new BPromise(function(_0x2d9074,_0x455e9e){var _0x1d3d02=_0x111ed3||client;return _0x1d3d02[_0xcce5('0x23')](_0xf91758,_0x565e91)['then'](function(_0x1ce067){logger[_0xcce5('0x24')](_0xcce5('0x25'),_0x24503a,_0xcce5('0x26'));logger[_0xcce5('0x27')](_0xcce5('0x28'),_0x24503a,'request\x20sent',JSON[_0xcce5('0x29')](_0x1ce067));if(_0x1ce067['error']){if(_0x1ce067[_0xcce5('0x2a')][_0xcce5('0x2b')]===0x1f4){logger[_0xcce5('0x2a')](_0xcce5('0x25'),_0x24503a,_0x1ce067[_0xcce5('0x2a')][_0xcce5('0x2c')]);return _0x455e9e(_0x1ce067[_0xcce5('0x2a')][_0xcce5('0x2c')]);}logger[_0xcce5('0x2a')](_0xcce5('0x25'),_0x24503a,_0x1ce067[_0xcce5('0x2a')]['message']);return _0x2d9074(_0x1ce067[_0xcce5('0x2a')][_0xcce5('0x2c')]);}else{logger[_0xcce5('0x24')](_0xcce5('0x25'),_0x24503a,_0xcce5('0x26'));_0x2d9074(_0x1ce067['result'][_0xcce5('0x2c')]);}})[_0xcce5('0x2d')](function(_0x46ab3d){logger[_0xcce5('0x2a')](_0xcce5('0x25'),_0x24503a,_0x46ab3d);_0x455e9e(_0x46ab3d);});});}function respondWithStatusCode(_0x405552,_0x5e0f04){_0x5e0f04=_0x5e0f04||0xcc;return function(_0x547886){if(_0x547886){return _0x405552[_0xcce5('0x2e')](_0x5e0f04);}return _0x405552[_0xcce5('0x2f')](_0x5e0f04)[_0xcce5('0x30')]();};}function respondWithResult(_0x336fc1,_0xd46ce4){_0xd46ce4=_0xd46ce4||0xc8;return function(_0x44d789){if(_0x44d789){return _0x336fc1[_0xcce5('0x2f')](_0xd46ce4)[_0xcce5('0x31')](_0x44d789);}};}function respondWithFilteredResult(_0x4c4f81,_0x4b0c00){return function(_0x5a08d9){if(_0x5a08d9){var _0x2c9fa2=typeof _0x4b0c00['offset']==='undefined'&&typeof _0x4b0c00['limit']===_0xcce5('0x32');var _0x170888=_0x5a08d9[_0xcce5('0x33')];var _0x4e1155=_0x2c9fa2?0x0:_0x4b0c00[_0xcce5('0x34')];var _0xfaa338=_0x2c9fa2?_0x5a08d9[_0xcce5('0x33')]:_0x4b0c00['offset']+_0x4b0c00[_0xcce5('0x35')];var _0x22cb02;if(_0xfaa338>=_0x170888){_0xfaa338=_0x170888;_0x22cb02=0xc8;}else{_0x22cb02=0xce;}_0x4c4f81['status'](_0x22cb02);return _0x4c4f81[_0xcce5('0x36')](_0xcce5('0x37'),_0x4e1155+'-'+_0xfaa338+'/'+_0x170888)[_0xcce5('0x31')](_0x5a08d9);}return null;};}function patchUpdates(_0xb6d365){return function(_0x1a1eeb){try{jsonpatch[_0xcce5('0x38')](_0x1a1eeb,_0xb6d365,!![]);}catch(_0x3f6a18){return BPromise[_0xcce5('0x39')](_0x3f6a18);}return _0x1a1eeb[_0xcce5('0x3a')]();};}function saveUpdates(_0x39c835,_0x1e96d5){return function(_0x309486){if(_0x309486){return _0x309486['update'](_0x39c835)[_0xcce5('0x3b')](function(_0x2d08ab){return _0x2d08ab;});}return null;};}function removeEntity(_0x10da03,_0x5dffcb){return function(_0x3a1cdc){if(_0x3a1cdc){return _0x3a1cdc['destroy']()['then'](function(){var _0x3ca274=_0x3a1cdc[_0xcce5('0x3c')]({'plain':!![]});var _0x3bab2c='MailAccounts';return db[_0xcce5('0x3d')][_0xcce5('0x3e')]({'where':{'type':_0x3bab2c,'resourceId':_0x3ca274['id']}})[_0xcce5('0x3b')](function(){return _0x3a1cdc;});})[_0xcce5('0x3b')](function(){_0x10da03[_0xcce5('0x2f')](0xcc)[_0xcce5('0x30')]();});}};}function handleEntityNotFound(_0x1d471c,_0x14aa77){return function(_0x453492){if(!_0x453492){_0x1d471c[_0xcce5('0x2e')](0x194);}return _0x453492;};}function handleError(_0x28435,_0x490066){_0x490066=_0x490066||0x1f4;return function(_0x22119e){logger[_0xcce5('0x2a')](_0x22119e[_0xcce5('0x3f')]);if(_0x22119e['name']){delete _0x22119e['name'];}_0x28435[_0xcce5('0x2f')](_0x490066)[_0xcce5('0x40')](_0x22119e);};}exports[_0xcce5('0x41')]=function(_0x3b6946,_0x9ffdf4){var _0x261ddd={'include':[{'model':db[_0xcce5('0x42')],'as':_0xcce5('0x43')},{'model':db[_0xcce5('0x44')],'as':_0xcce5('0x45')},{'model':db[_0xcce5('0x46')],'as':_0xcce5('0x47')}]},_0xcfd322={},_0xb5c9db={'count':0x0,'rows':[]};var _0x4bb66f=_['map'](db[_0xcce5('0x48')]['rawAttributes'],function(_0x194488){return{'name':_0x194488['fieldName'],'type':_0x194488[_0xcce5('0x49')][_0xcce5('0x4a')]};});_0xcfd322[_0xcce5('0x4b')]=_[_0xcce5('0x4c')](_0x4bb66f,_0xcce5('0x4d'));_0xcfd322[_0xcce5('0x4e')]=_['keys'](_0x3b6946['query']);_0xcfd322[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0xcfd322['model'],_0xcfd322['query']);_0x261ddd['attributes']=_[_0xcce5('0x50')](_0xcfd322[_0xcce5('0x4b')],qs[_0xcce5('0x51')](_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x51')]));_0x261ddd['attributes']=_0x261ddd['attributes'][_0xcce5('0x52')]?_0x261ddd[_0xcce5('0x53')]:_0xcfd322[_0xcce5('0x4b')];if(!_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x54')](_0xcce5('0x55'))){_0x261ddd['limit']=qs[_0xcce5('0x35')](_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x35')]);_0x261ddd[_0xcce5('0x34')]=qs[_0xcce5('0x34')](_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x34')]);}_0x261ddd['order']=qs['sort'](_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x56')]);_0x261ddd['where']=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x3b6946[_0xcce5('0x4e')],_0xcfd322['filters']),_0x4bb66f);if(_0x3b6946['query'][_0xcce5('0x58')]){_0x261ddd[_0xcce5('0x59')]=_['merge'](_0x261ddd['where'],{'$or':_[_0xcce5('0x4c')](_0x4bb66f,function(_0x22f05b){if(_0x22f05b[_0xcce5('0x49')]!==_0xcce5('0x5a')){var _0x6d7744={};_0x6d7744[_0x22f05b[_0xcce5('0x4d')]]={'$like':'%'+_0x3b6946['query'][_0xcce5('0x58')]+'%'};return _0x6d7744;}})});}_0x261ddd=_['merge']({},_0x261ddd,_0x3b6946[_0xcce5('0x5b')]);var _0x4a1187={'where':_0x261ddd[_0xcce5('0x59')]};return db[_0xcce5('0x48')][_0xcce5('0x33')](_0x4a1187)[_0xcce5('0x3b')](function(_0x140dea){_0xb5c9db[_0xcce5('0x33')]=_0x140dea;if(_0x3b6946[_0xcce5('0x4e')][_0xcce5('0x5c')]){_0x261ddd[_0xcce5('0x5d')]=[{'all':!![]}];}return db[_0xcce5('0x48')]['findAll'](_0x261ddd);})[_0xcce5('0x3b')](function(_0x27d81c){_0xb5c9db[_0xcce5('0x5e')]=_0x27d81c;return _0xb5c9db;})[_0xcce5('0x3b')](respondWithFilteredResult(_0x9ffdf4,_0x261ddd))[_0xcce5('0x2d')](handleError(_0x9ffdf4,null));};exports[_0xcce5('0x5f')]=function(_0x33548b,_0xc67ca5){var _0x457ffc={'raw':![],'where':{'id':_0x33548b[_0xcce5('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xcce5('0x43')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xcce5('0x46')],'as':_0xcce5('0x47')}]},_0x5993e8={};_0x5993e8[_0xcce5('0x4b')]=_[_0xcce5('0x61')](db[_0xcce5('0x48')][_0xcce5('0x62')]);_0x5993e8[_0xcce5('0x4e')]=_[_0xcce5('0x61')](_0x33548b['query']);_0x5993e8[_0xcce5('0x4f')]=_['intersection'](_0x5993e8['model'],_0x5993e8[_0xcce5('0x4e')]);_0x457ffc[_0xcce5('0x53')]=_[_0xcce5('0x50')](_0x5993e8[_0xcce5('0x4b')],qs[_0xcce5('0x51')](_0x33548b['query'][_0xcce5('0x51')]));_0x457ffc[_0xcce5('0x53')]=_0x457ffc[_0xcce5('0x53')][_0xcce5('0x52')]?_0x457ffc[_0xcce5('0x53')]:_0x5993e8['model'];if(_0x33548b[_0xcce5('0x4e')][_0xcce5('0x5c')]){_0x457ffc[_0xcce5('0x5d')]=[{'all':!![]}];}_0x457ffc=_[_0xcce5('0x63')]({},_0x457ffc,_0x33548b[_0xcce5('0x5b')]);return db[_0xcce5('0x48')][_0xcce5('0x64')](_0x457ffc)[_0xcce5('0x3b')](handleEntityNotFound(_0xc67ca5,null))[_0xcce5('0x3b')](respondWithResult(_0xc67ca5,null))[_0xcce5('0x2d')](handleError(_0xc67ca5,null));};exports['update']=function(_0xd11438,_0x1f7030){if(_0xd11438[_0xcce5('0x65')]['id']){delete _0xd11438['body']['id'];}return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0xd11438[_0xcce5('0x60')]['id']},'include':[{'model':db[_0xcce5('0x42')],'as':'Imap'},{'model':db[_0xcce5('0x44')],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcce5('0x3b')](handleEntityNotFound(_0x1f7030,null))[_0xcce5('0x3b')](saveUpdates(_0xd11438['body'],null))['then'](function(_0x55618c){if(_0x55618c&&_0xd11438[_0xcce5('0x65')]['Imap']){return db[_0xcce5('0x42')][_0xcce5('0x66')](_0xd11438['body'][_0xcce5('0x43')],{'where':{'MailAccountId':_0x55618c['id']}})[_0xcce5('0x3b')](function(){return _0x55618c;});}return _0x55618c;})[_0xcce5('0x3b')](function(_0x1578a3){if(_0x1578a3&&_0xd11438[_0xcce5('0x65')][_0xcce5('0x45')]){return db['MailServerOut']['update'](_0xd11438[_0xcce5('0x65')][_0xcce5('0x45')],{'where':{'MailAccountId':_0x1578a3['id']}})[_0xcce5('0x3b')](function(){return _0x1578a3;});}return _0x1578a3;})[_0xcce5('0x3b')](respondWithResult(_0x1f7030,null))['catch'](handleError(_0x1f7030,null));};exports[_0xcce5('0x67')]=function(_0x1cd4bd,_0x137c26){return db[_0xcce5('0x48')][_0xcce5('0x67')]()[_0xcce5('0x3b')](respondWithResult(_0x137c26,null))[_0xcce5('0x2d')](handleError(_0x137c26,null));};exports['addDisposition']=function(_0x483931,_0x2b5fb6,_0x325053){if(_0x483931[_0xcce5('0x65')]['id']){delete _0x483931['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x483931[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x2b5fb6,null))[_0xcce5('0x3b')](function(_0x2ed3ff){if(_0x2ed3ff){_0x483931[_0xcce5('0x65')][_0xcce5('0x68')]=_0x2ed3ff['id'];return db[_0xcce5('0x69')][_0xcce5('0x6a')](_0x483931[_0xcce5('0x65')]);}})[_0xcce5('0x3b')](respondWithResult(_0x2b5fb6,null))['catch'](handleError(_0x2b5fb6,null));};exports[_0xcce5('0x6b')]=function(_0x537431,_0x8f9433,_0x3f2f30){var _0x1c3666={'raw':![],'where':{}};var _0x4cd741={};var _0x2b2996={'count':0x0,'rows':[]};return db[_0xcce5('0x48')][_0xcce5('0x6c')]({'where':{'id':_0x537431[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x8f9433,null))[_0xcce5('0x3b')](function(_0x5713a9){if(_0x5713a9){_0x4cd741[_0xcce5('0x4b')]=_[_0xcce5('0x61')](db[_0xcce5('0x69')][_0xcce5('0x62')]);_0x4cd741[_0xcce5('0x4e')]=_[_0xcce5('0x61')](_0x537431[_0xcce5('0x4e')]);_0x4cd741[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0x4cd741[_0xcce5('0x4b')],_0x4cd741['query']);_0x1c3666[_0xcce5('0x53')]=_[_0xcce5('0x50')](_0x4cd741[_0xcce5('0x4b')],qs[_0xcce5('0x51')](_0x537431[_0xcce5('0x4e')]['fields']));_0x1c3666['attributes']=_0x1c3666[_0xcce5('0x53')][_0xcce5('0x52')]?_0x1c3666[_0xcce5('0x53')]:_0x4cd741['model'];if(!_0x537431[_0xcce5('0x4e')][_0xcce5('0x54')]('nolimit')){_0x1c3666[_0xcce5('0x35')]=qs[_0xcce5('0x35')](_0x537431['query'][_0xcce5('0x35')]);_0x1c3666['offset']=qs['offset'](_0x537431['query']['offset']);}_0x1c3666[_0xcce5('0x6d')]=qs[_0xcce5('0x56')](_0x537431[_0xcce5('0x4e')][_0xcce5('0x56')]);_0x1c3666[_0xcce5('0x59')]=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x537431[_0xcce5('0x4e')],_0x4cd741['filters']));_0x1c3666['where'][_0xcce5('0x68')]=_0x5713a9['id'];if(_0x537431[_0xcce5('0x4e')][_0xcce5('0x58')]){_0x1c3666[_0xcce5('0x59')]=_[_0xcce5('0x63')](_0x1c3666['where'],{'$or':_[_0xcce5('0x4c')](_0x1c3666[_0xcce5('0x53')],function(_0x28df37){var _0x11eb62={};_0x11eb62[_0x28df37]={'$like':'%'+_0x537431[_0xcce5('0x4e')][_0xcce5('0x58')]+'%'};return _0x11eb62;})});}_0x1c3666=_[_0xcce5('0x63')]({},_0x1c3666,_0x537431[_0xcce5('0x5b')]);return db[_0xcce5('0x69')][_0xcce5('0x33')]({'where':_0x1c3666['where']})[_0xcce5('0x3b')](function(_0x586d6f){_0x2b2996[_0xcce5('0x33')]=_0x586d6f;if(_0x537431[_0xcce5('0x4e')][_0xcce5('0x5c')]){_0x1c3666['include']=[{'all':!![]}];}return db[_0xcce5('0x69')][_0xcce5('0x6e')](_0x1c3666);})['then'](function(_0x17fe0a){_0x2b2996[_0xcce5('0x5e')]=_0x17fe0a;return _0x2b2996;});}})[_0xcce5('0x3b')](respondWithFilteredResult(_0x8f9433,_0x1c3666))[_0xcce5('0x2d')](handleError(_0x8f9433,null));};exports[_0xcce5('0x6f')]=function(_0x5d9c82,_0x5d58b6,_0x195b7f){return db[_0xcce5('0x48')]['find']({'where':{'id':_0x5d9c82['params']['id']}})['then'](handleEntityNotFound(_0x5d58b6,null))[_0xcce5('0x3b')](function(_0x2e8e6c){if(_0x2e8e6c){return _0x2e8e6c[_0xcce5('0x6f')](_0x5d9c82[_0xcce5('0x4e')][_0xcce5('0x70')]);}})[_0xcce5('0x3b')](respondWithStatusCode(_0x5d58b6,null))[_0xcce5('0x2d')](handleError(_0x5d58b6,null));};exports[_0xcce5('0x71')]=function(_0x3c6a09,_0xbe1799,_0x3daf02){if(_0x3c6a09[_0xcce5('0x65')]['id']){delete _0x3c6a09['body']['id'];}return db['MailAccount'][_0xcce5('0x64')]({'where':{'id':_0x3c6a09[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0xbe1799,null))[_0xcce5('0x3b')](function(_0x15e69f){if(_0x15e69f){_0x3c6a09[_0xcce5('0x65')][_0xcce5('0x68')]=_0x15e69f['id'];return db[_0xcce5('0x72')][_0xcce5('0x6a')](_0x3c6a09[_0xcce5('0x65')]);}})['then'](respondWithResult(_0xbe1799,null))[_0xcce5('0x2d')](handleError(_0xbe1799,null));};exports[_0xcce5('0x73')]=function(_0x35dc50,_0x35bded,_0x5cee47){var _0x240c2e={'raw':![],'where':{}};var _0x50e2c3={};var _0x339513={'count':0x0,'rows':[]};return db['MailAccount'][_0xcce5('0x6c')]({'where':{'id':_0x35dc50[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x35bded,null))[_0xcce5('0x3b')](function(_0x1bf5a8){if(_0x1bf5a8){_0x50e2c3['model']=_[_0xcce5('0x61')](db[_0xcce5('0x72')]['rawAttributes']);_0x50e2c3['query']=_[_0xcce5('0x61')](_0x35dc50[_0xcce5('0x4e')]);_0x50e2c3[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0x50e2c3['model'],_0x50e2c3[_0xcce5('0x4e')]);_0x240c2e['attributes']=_[_0xcce5('0x50')](_0x50e2c3[_0xcce5('0x4b')],qs['fields'](_0x35dc50[_0xcce5('0x4e')]['fields']));_0x240c2e[_0xcce5('0x53')]=_0x240c2e[_0xcce5('0x53')][_0xcce5('0x52')]?_0x240c2e[_0xcce5('0x53')]:_0x50e2c3[_0xcce5('0x4b')];if(!_0x35dc50[_0xcce5('0x4e')][_0xcce5('0x54')]('nolimit')){_0x240c2e[_0xcce5('0x35')]=qs['limit'](_0x35dc50['query'][_0xcce5('0x35')]);_0x240c2e[_0xcce5('0x34')]=qs[_0xcce5('0x34')](_0x35dc50[_0xcce5('0x4e')]['offset']);}_0x240c2e[_0xcce5('0x6d')]=qs[_0xcce5('0x56')](_0x35dc50[_0xcce5('0x4e')][_0xcce5('0x56')]);_0x240c2e['where']=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x35dc50[_0xcce5('0x4e')],_0x50e2c3[_0xcce5('0x4f')]));_0x240c2e[_0xcce5('0x59')][_0xcce5('0x68')]=_0x1bf5a8['id'];if(_0x35dc50['query'][_0xcce5('0x58')]){_0x240c2e['where']=_[_0xcce5('0x63')](_0x240c2e[_0xcce5('0x59')],{'$or':_[_0xcce5('0x4c')](_0x240c2e[_0xcce5('0x53')],function(_0x454b18){var _0x4d4037={};_0x4d4037[_0x454b18]={'$like':'%'+_0x35dc50[_0xcce5('0x4e')][_0xcce5('0x58')]+'%'};return _0x4d4037;})});}_0x240c2e=_[_0xcce5('0x63')]({},_0x240c2e,_0x35dc50[_0xcce5('0x5b')]);return db[_0xcce5('0x72')][_0xcce5('0x33')]({'where':_0x240c2e[_0xcce5('0x59')]})[_0xcce5('0x3b')](function(_0x30189d){_0x339513[_0xcce5('0x33')]=_0x30189d;if(_0x35dc50[_0xcce5('0x4e')]['includeAll']){_0x240c2e['include']=[{'all':!![]}];}return db[_0xcce5('0x72')][_0xcce5('0x6e')](_0x240c2e);})[_0xcce5('0x3b')](function(_0x390c39){_0x339513[_0xcce5('0x5e')]=_0x390c39;return _0x339513;});}})[_0xcce5('0x3b')](respondWithFilteredResult(_0x35bded,_0x240c2e))[_0xcce5('0x2d')](handleError(_0x35bded,null));};exports[_0xcce5('0x74')]=function(_0x528adf,_0x82d081,_0x10c4e6){return db[_0xcce5('0x48')]['find']({'where':{'id':_0x528adf[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x82d081,null))['then'](function(_0x2686e8){if(_0x2686e8){return _0x2686e8[_0xcce5('0x74')](_0x528adf['query'][_0xcce5('0x70')]);}})['then'](respondWithStatusCode(_0x82d081,null))[_0xcce5('0x2d')](handleError(_0x82d081,null));};exports['create']=function(_0x1ef018,_0x68f67){var _0x4d2bde={'name':_0x1ef018[_0xcce5('0x65')][_0xcce5('0x4d')],'key':_0x1ef018[_0xcce5('0x65')]['key'],'email':_0x1ef018[_0xcce5('0x65')][_0xcce5('0x75')],'ListId':_0x1ef018['body'][_0xcce5('0x76')],'active':!_[_0xcce5('0x77')](_0x1ef018['body'][_0xcce5('0x78')])?_0x1ef018[_0xcce5('0x65')][_0xcce5('0x78')]:!![],'description':_0x1ef018[_0xcce5('0x65')][_0xcce5('0x79')]||null,'Imap':{},'Smtp':{}};if(_[_0xcce5('0x77')](_0x1ef018[_0xcce5('0x65')][_0xcce5('0x7a')])){if(_0x1ef018[_0xcce5('0x65')][_0xcce5('0x7b')]){_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x7c')]=_0x4d2bde[_0xcce5('0x45')][_0xcce5('0x7c')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x7d')];_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x7e')]=_0x4d2bde[_0xcce5('0x45')][_0xcce5('0x7f')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x80')];}else{_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x81')]=_0x4d2bde[_0xcce5('0x45')]['authentication']=![];}_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x82')]=_0x1ef018['body'][_0xcce5('0x43')]['host'];_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x83')]=_0x1ef018[_0xcce5('0x65')]['Imap'][_0xcce5('0x83')];_0x4d2bde[_0xcce5('0x45')]['host']=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x45')][_0xcce5('0x82')];_0x4d2bde['Smtp'][_0xcce5('0x83')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x45')][_0xcce5('0x83')];}else{_0x4d2bde[_0xcce5('0x43')]['service']=_0x4d2bde[_0xcce5('0x45')][_0xcce5('0x84')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x7a')];_0x4d2bde['Imap'][_0xcce5('0x7c')]=_0x4d2bde[_0xcce5('0x45')][_0xcce5('0x7c')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x7d')];_0x4d2bde[_0xcce5('0x43')][_0xcce5('0x7e')]=_0x4d2bde[_0xcce5('0x45')][_0xcce5('0x7f')]=_0x1ef018[_0xcce5('0x65')][_0xcce5('0x80')];}return db[_0xcce5('0x48')][_0xcce5('0x6a')](_0x4d2bde,{'include':[{'model':db[_0xcce5('0x44')],'as':_0xcce5('0x45')},{'model':db[_0xcce5('0x42')],'as':'Imap'}]})['then'](function(_0x53887e){var _0xb611b6=_0x1ef018[_0xcce5('0x7c')][_0xcce5('0x3c')]({'plain':!![]});if(!_0xb611b6)throw new Error(_0xcce5('0x85'));if(_0xb611b6['role']===_0xcce5('0x7c')){var _0x16a67c=_0x53887e[_0xcce5('0x3c')]({'plain':!![]});return db[_0xcce5('0x86')][_0xcce5('0x64')]({'where':{'name':_0xcce5('0x87'),'userProfileId':_0xb611b6[_0xcce5('0x88')]},'raw':!![]})['then'](function(_0x596237){if(_0x596237&&_0x596237[_0xcce5('0x89')]===0x0){return db[_0xcce5('0x3d')][_0xcce5('0x6a')]({'name':_0x16a67c[_0xcce5('0x4d')],'resourceId':_0x16a67c['id'],'type':_0x596237['name'],'sectionId':_0x596237['id']},{})[_0xcce5('0x3b')](function(){return _0x53887e;});}else{return _0x53887e;}})[_0xcce5('0x2d')](function(_0x4962d5){logger[_0xcce5('0x2a')](_0xcce5('0x8a'),_0x4962d5);throw _0x4962d5;});}return _0x53887e;})[_0xcce5('0x3b')](respondWithResult(_0x68f67,0xc9))[_0xcce5('0x2d')](handleError(_0x68f67,null));};exports[_0xcce5('0x8b')]=function(_0x5740bd,_0xecd018,_0x37e279){return db[_0xcce5('0x48')]['findOne']({'where':{'id':_0x5740bd[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0xecd018,null))[_0xcce5('0x3b')](function(_0x3d1186){if(_0x3d1186){return _0x3d1186['getImap']();}return null;})[_0xcce5('0x3b')](respondWithResult(_0xecd018,null))['catch'](handleError(_0xecd018,null));};exports[_0xcce5('0x8c')]=function(_0x2ba6c2,_0x27ee49,_0x13f9f7){if(_0x2ba6c2[_0xcce5('0x65')]['id']){delete _0x2ba6c2[_0xcce5('0x65')]['id'];}return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0x2ba6c2[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x27ee49,null))[_0xcce5('0x3b')](function(_0x58e9f9){if(_0x58e9f9){_0x2ba6c2['body'][_0xcce5('0x68')]=_0x58e9f9['id'];return db[_0xcce5('0x42')][_0xcce5('0x6a')](_0x2ba6c2['body']);}})[_0xcce5('0x3b')](respondWithResult(_0x27ee49,null))[_0xcce5('0x2d')](handleError(_0x27ee49,null));};exports[_0xcce5('0x8d')]=function(_0x26328b,_0x33dc05,_0x780413){return db[_0xcce5('0x48')][_0xcce5('0x6c')]({'where':{'id':_0x26328b[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x33dc05,null))[_0xcce5('0x3b')](function(_0x56a166){if(_0x56a166){return _0x56a166[_0xcce5('0x8e')](null);}return null;})[_0xcce5('0x3b')](respondWithStatusCode(_0x33dc05,null))[_0xcce5('0x2d')](handleError(_0x33dc05,null));};exports[_0xcce5('0x8f')]=function(_0x2358ca,_0x81c577,_0xd09c44){return db[_0xcce5('0x48')]['findOne']({'where':{'id':_0x2358ca[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x81c577,null))[_0xcce5('0x3b')](function(_0x1b21a7){if(_0x1b21a7){return _0x1b21a7[_0xcce5('0x8f')]();}return null;})['then'](respondWithResult(_0x81c577,null))[_0xcce5('0x2d')](handleError(_0x81c577,null));};exports[_0xcce5('0x90')]=function(_0x505ef1,_0x1ddc29,_0x178644){if(_0x505ef1[_0xcce5('0x65')]['id']){delete _0x505ef1[_0xcce5('0x65')]['id'];}return db['MailAccount'][_0xcce5('0x64')]({'where':{'id':_0x505ef1[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x1ddc29,null))['then'](function(_0x47eda9){if(_0x47eda9){_0x505ef1['body']['MailAccountId']=_0x47eda9['id'];return db[_0xcce5('0x44')]['create'](_0x505ef1['body']);}})[_0xcce5('0x3b')](respondWithResult(_0x1ddc29,null))[_0xcce5('0x2d')](handleError(_0x1ddc29,null));};exports[_0xcce5('0x91')]=function(_0x56b451,_0x39b327,_0xdd19f9){return db[_0xcce5('0x48')][_0xcce5('0x6c')]({'where':{'id':_0x56b451[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x39b327,null))[_0xcce5('0x3b')](function(_0x204bdf){if(_0x204bdf){return _0x204bdf[_0xcce5('0x92')](null);}return null;})[_0xcce5('0x3b')](respondWithStatusCode(_0x39b327,null))[_0xcce5('0x2d')](handleError(_0x39b327,null));};exports[_0xcce5('0x93')]=function(_0x4d6302,_0x16ffb0,_0x2f54f7){return db['MailInteraction'][_0xcce5('0x64')]({'where':{'id':_0x4d6302['params']['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x16ffb0,null))[_0xcce5('0x3b')](function(_0x4a2715){if(_0x4a2715){return _0x4a2715[_0xcce5('0x93')](_0x4d6302[_0xcce5('0x65')][_0xcce5('0x70')],_[_0xcce5('0x94')](_0x4d6302[_0xcce5('0x65')],['ids','id'])||{});}})['then'](respondWithResult(_0x16ffb0,null))[_0xcce5('0x2d')](handleError(_0x16ffb0,null));};exports[_0xcce5('0x95')]=function(_0x45c1a4,_0x2bce81,_0x1336db){var _0x1c285c={'raw':![],'where':{}};var _0x2d1319={};var _0x4ff5ce={'count':0x0,'rows':[]};return db[_0xcce5('0x48')]['findOne']({'where':{'id':_0x45c1a4['params']['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x2bce81,null))[_0xcce5('0x3b')](function(_0x1df323){if(_0x1df323){_0x2d1319[_0xcce5('0x4b')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x2d1319[_0xcce5('0x4e')]=_[_0xcce5('0x61')](_0x45c1a4[_0xcce5('0x4e')]);_0x2d1319[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0x2d1319[_0xcce5('0x4b')],_0x2d1319[_0xcce5('0x4e')]);_0x1c285c[_0xcce5('0x53')]=_[_0xcce5('0x50')](_0x2d1319[_0xcce5('0x4b')],qs[_0xcce5('0x51')](_0x45c1a4[_0xcce5('0x4e')]['fields']));_0x1c285c['attributes']=_0x1c285c[_0xcce5('0x53')][_0xcce5('0x52')]?_0x1c285c[_0xcce5('0x53')]:_0x2d1319[_0xcce5('0x4b')];if(!_0x45c1a4[_0xcce5('0x4e')][_0xcce5('0x54')]('nolimit')){_0x1c285c[_0xcce5('0x35')]=qs[_0xcce5('0x35')](_0x45c1a4[_0xcce5('0x4e')]['limit']);_0x1c285c[_0xcce5('0x34')]=qs[_0xcce5('0x34')](_0x45c1a4[_0xcce5('0x4e')][_0xcce5('0x34')]);}_0x1c285c[_0xcce5('0x6d')]=qs[_0xcce5('0x56')](_0x45c1a4['query'][_0xcce5('0x56')]);_0x1c285c[_0xcce5('0x59')]=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x45c1a4['query'],_0x2d1319[_0xcce5('0x4f')]));_0x1c285c[_0xcce5('0x59')][_0xcce5('0x68')]=_0x1df323['id'];if(_0x45c1a4['query'][_0xcce5('0x58')]){_0x1c285c[_0xcce5('0x59')]=_[_0xcce5('0x63')](_0x1c285c[_0xcce5('0x59')],{'$or':_[_0xcce5('0x4c')](_0x1c285c[_0xcce5('0x53')],function(_0x3efee0){var _0x4c4c3d={};_0x4c4c3d[_0x3efee0]={'$like':'%'+_0x45c1a4['query'][_0xcce5('0x58')]+'%'};return _0x4c4c3d;})});}_0x1c285c=_['merge']({},_0x1c285c,_0x45c1a4[_0xcce5('0x5b')]);return db[_0xcce5('0x96')][_0xcce5('0x33')]({'where':_0x1c285c[_0xcce5('0x59')]})[_0xcce5('0x3b')](function(_0xef7a7f){_0x4ff5ce[_0xcce5('0x33')]=_0xef7a7f;if(_0x45c1a4[_0xcce5('0x4e')][_0xcce5('0x5c')]){_0x1c285c['include']=[{'model':db[_0xcce5('0x97')],'as':_0xcce5('0x98'),'required':![]},{'model':db[_0xcce5('0x99')],'as':_0xcce5('0x9a'),'attributes':[_0xcce5('0x4d'),_0xcce5('0x9b'),_0xcce5('0x9c')],'required':![]},{'model':db['Tag'],'as':_0xcce5('0x9d'),'attributes':['id','name',_0xcce5('0x9e')],'where':_0x45c1a4['query'][_0xcce5('0x9f')]?{'id':_0x45c1a4[_0xcce5('0x4e')][_0xcce5('0x9f')]}:undefined,'required':_0x45c1a4['query']['tag']?!![]:![]}];}return db[_0xcce5('0x96')][_0xcce5('0x6e')](_0x1c285c);})['then'](function(_0x55fc1a){_0x4ff5ce['rows']=_0x55fc1a;return _0x4ff5ce;});}})['then'](respondWithFilteredResult(_0x2bce81,_0x1c285c))[_0xcce5('0x2d')](handleError(_0x2bce81,null));};exports['addApplications']=function(_0x469363,_0x5988a3,_0x3a85a2){return db[_0xcce5('0x48')][_0xcce5('0x6c')]({'where':{'id':_0x469363[_0xcce5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5988a3,null))[_0xcce5('0x3b')](function(_0xd40284){if(_0xd40284){return db['sequelize'][_0xcce5('0xa0')](function(_0x48cdc8){return db['MailApplication'][_0xcce5('0x3e')]({'where':{'MailAccountId':_0x469363[_0xcce5('0x60')]['id']},'transaction':_0x48cdc8})['then'](function(_0x2714c7){var _0xdb897c=_[_0xcce5('0x4c')](_0x469363[_0xcce5('0x65')],function(_0x43604a){_0x43604a[_0xcce5('0x68')]=_0x469363['params']['id'];return _0x43604a;});return db[_0xcce5('0xa1')][_0xcce5('0xa2')](_0xdb897c,{'transaction':_0x48cdc8});});})[_0xcce5('0x3b')](function(){return db[_0xcce5('0xa1')][_0xcce5('0xa3')]({'where':{'MailAccountId':_0x469363[_0xcce5('0x60')]['id']},'order':'priority'});});}})[_0xcce5('0x3b')](respondWithResult(_0x5988a3,null))['catch'](handleError(_0x5988a3,null));};exports[_0xcce5('0xa4')]=function(_0x125163,_0x1ff428,_0x1721fc){var _0xbbe495={};var _0x442fb4={};var _0x3e8cb0;var _0x27ae14;return db[_0xcce5('0x48')]['findOne']({'where':{'id':_0x125163[_0xcce5('0x60')]['id']}})['then'](handleEntityNotFound(_0x1ff428,null))['then'](function(_0x3daee1){if(_0x3daee1){_0x3e8cb0=_0x3daee1;_0x442fb4['model']=_['keys'](db[_0xcce5('0xa1')][_0xcce5('0x62')]);_0x442fb4[_0xcce5('0x4e')]=_['keys'](_0x125163['query']);_0x442fb4['filters']=_[_0xcce5('0x50')](_0x442fb4['model'],_0x442fb4[_0xcce5('0x4e')]);_0xbbe495[_0xcce5('0x53')]=_[_0xcce5('0x50')](_0x442fb4[_0xcce5('0x4b')],qs['fields'](_0x125163['query'][_0xcce5('0x51')]));_0xbbe495[_0xcce5('0x53')]=_0xbbe495[_0xcce5('0x53')][_0xcce5('0x52')]?_0xbbe495[_0xcce5('0x53')]:_0x442fb4['model'];_0xbbe495[_0xcce5('0x6d')]=qs[_0xcce5('0x56')](_0x125163[_0xcce5('0x4e')]['sort']);_0xbbe495[_0xcce5('0x59')]=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x125163[_0xcce5('0x4e')],_0x442fb4[_0xcce5('0x4f')]));if(_0x125163[_0xcce5('0x4e')]['filter']){_0xbbe495['where']=_[_0xcce5('0x63')](_0xbbe495[_0xcce5('0x59')],{'$or':_['map'](_0xbbe495[_0xcce5('0x53')],function(_0x35c858){var _0x2d9c1a={};_0x2d9c1a[_0x35c858]={'$like':'%'+_0x125163[_0xcce5('0x4e')][_0xcce5('0x58')]+'%'};return _0x2d9c1a;})});}_0xbbe495=_[_0xcce5('0x63')]({},_0xbbe495,_0x125163[_0xcce5('0x5b')]);return _0x3e8cb0['getApplications'](_0xbbe495);}})[_0xcce5('0x3b')](function(_0x383ba6){if(_0x383ba6){_0x27ae14=_0x383ba6[_0xcce5('0x52')];if(!_0x125163[_0xcce5('0x4e')]['hasOwnProperty'](_0xcce5('0x55'))){_0xbbe495['limit']=qs[_0xcce5('0x35')](_0x125163['query'][_0xcce5('0x35')]);_0xbbe495[_0xcce5('0x34')]=qs[_0xcce5('0x34')](_0x125163[_0xcce5('0x4e')][_0xcce5('0x34')]);}return _0x3e8cb0[_0xcce5('0xa4')](_0xbbe495);}})[_0xcce5('0x3b')](function(_0x5ec74a){if(_0x5ec74a){return _0x5ec74a?{'count':_0x27ae14,'rows':_0x5ec74a}:null;}})[_0xcce5('0x3b')](respondWithResult(_0x1ff428,null))[_0xcce5('0x2d')](handleError(_0x1ff428,null));};exports['getMessages']=function(_0x1f2a3b,_0x142237,_0x502ea8){var _0x3a3445={'raw':!![],'where':{}};var _0x3ead4a={};var _0x54f950={'count':0x0,'rows':[]};return db[_0xcce5('0x48')]['findOne']({'where':{'id':_0x1f2a3b[_0xcce5('0x60')]['id']}})['then'](handleEntityNotFound(_0x142237,null))[_0xcce5('0x3b')](function(_0x52f878){if(_0x52f878){_0x3ead4a['model']=_[_0xcce5('0x61')](db[_0xcce5('0xa5')][_0xcce5('0x62')]);_0x3ead4a[_0xcce5('0x4e')]=_[_0xcce5('0x61')](_0x1f2a3b['query']);_0x3ead4a[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0x3ead4a['model'],_0x3ead4a[_0xcce5('0x4e')]);_0x3a3445['attributes']=_['intersection'](_0x3ead4a['model'],qs[_0xcce5('0x51')](_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0x51')]));_0x3a3445['attributes']=_0x3a3445[_0xcce5('0x53')][_0xcce5('0x52')]?_0x3a3445[_0xcce5('0x53')]:_0x3ead4a[_0xcce5('0x4b')];if(!_0x1f2a3b[_0xcce5('0x4e')]['hasOwnProperty'](_0xcce5('0x55'))){_0x3a3445[_0xcce5('0x35')]=qs[_0xcce5('0x35')](_0x1f2a3b['query'][_0xcce5('0x35')]);_0x3a3445[_0xcce5('0x34')]=qs['offset'](_0x1f2a3b['query']['offset']);}_0x3a3445[_0xcce5('0x6d')]=qs['sort'](_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0x56')]);_0x3a3445[_0xcce5('0x59')]=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x1f2a3b[_0xcce5('0x4e')],_0x3ead4a['filters']));_0x3a3445[_0xcce5('0x59')]['MailAccountId']=_0x52f878['id'];if(_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0x58')]){_0x3a3445[_0xcce5('0x59')]=_['merge'](_0x3a3445['where'],{'$or':_[_0xcce5('0x4c')](_0x3a3445[_0xcce5('0x53')],function(_0x52c48a){var _0x5a9dd7={};_0x5a9dd7[_0x52c48a]={'$like':'%'+_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0x58')]+'%'};return _0x5a9dd7;})});}if(_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0xa6')]){var _0xe79a96=_0x1f2a3b[_0xcce5('0x4e')]['$gte']['split'](',');var _0x3222e7={};_0x3222e7[_0xe79a96[0x0]]={'$gte':moment(_0xe79a96[0x1])[_0xcce5('0xa7')](_0xcce5('0xa8'))};_0x3a3445['where']=_['merge'](_0x3a3445[_0xcce5('0x59')],_0x3222e7);}_0x3a3445=_[_0xcce5('0x63')]({},_0x3a3445,_0x1f2a3b[_0xcce5('0x5b')]);return db[_0xcce5('0xa5')]['count']({'where':_0x3a3445[_0xcce5('0x59')]})['then'](function(_0x52ea60){_0x54f950[_0xcce5('0x33')]=_0x52ea60;if(_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0x5c')]){_0x3a3445['include']=[{'all':!![]}];}return db[_0xcce5('0xa5')][_0xcce5('0x6e')](_0x3a3445);})[_0xcce5('0x3b')](function(_0x1d9e65){if(_0x1f2a3b[_0xcce5('0x4e')][_0xcce5('0xa9')]===_0xcce5('0xaa')){for(var _0x5630ef=0x0;_0x5630ef<_0x1d9e65[_0xcce5('0x52')];_0x5630ef++){_0x1d9e65[_0x5630ef]['body']=juice(_0x1d9e65[_0x5630ef][_0xcce5('0x65')]);}}_0x54f950[_0xcce5('0x5e')]=_0x1d9e65;return _0x54f950;});}})[_0xcce5('0x3b')](respondWithFilteredResult(_0x142237,_0x3a3445))[_0xcce5('0x2d')](handleError(_0x142237,null));};exports[_0xcce5('0x40')]=function(_0x58fde1,_0x1c8a36,_0x1ac412){var _0x7aa18c,_0x5d0f89={},_0x5ec02d;if(_0x58fde1[_0xcce5('0x65')]['to']){_0x5ec02d=_0x58fde1[_0xcce5('0x65')]['to'][_0xcce5('0xab')](',')[0x0];}return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0x58fde1[_0xcce5('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xcce5('0xac'),'include':[{'model':db[_0xcce5('0x97')],'as':'Contacts','where':{'email':_0x5ec02d},'limit':0x1,'order':[[_0xcce5('0xad'),_0xcce5('0xae')]]}]},{'model':db[_0xcce5('0x44')],'as':_0xcce5('0x45'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1c8a36,null))[_0xcce5('0x3b')](function(_0x4c5447){if(_0x4c5447){_0x7aa18c=_0x4c5447;if(_0x4c5447[_0xcce5('0x45')]){if(_[_0xcce5('0x77')](_0x58fde1[_0xcce5('0x65')][_0xcce5('0xaf')])){_0x58fde1[_0xcce5('0x65')][_0xcce5('0xaf')]=util[_0xcce5('0xa7')](_0xcce5('0xb0'),_0x4c5447['name'],_0x4c5447[_0xcce5('0x75')]||_0x4c5447[_0xcce5('0x45')]['user']);}if(_0x58fde1[_0xcce5('0x65')]['attachments']&&_0x58fde1['body'][_0xcce5('0xb1')][_0xcce5('0x52')]){for(var _0x39df5b=0x0;_0x39df5b<_0x58fde1[_0xcce5('0x65')]['attachments'][_0xcce5('0x52')];_0x39df5b+=0x1){_0x58fde1[_0xcce5('0x65')]['attachments'][_0x39df5b]={'filename':_0x58fde1[_0xcce5('0x65')][_0xcce5('0xb1')][_0x39df5b][_0xcce5('0x4d')],'path':path['join'](config[_0xcce5('0xb2')],_0xcce5('0xb3'),_0x58fde1[_0xcce5('0x65')][_0xcce5('0xb1')][_0x39df5b][_0xcce5('0xb4')])};}}var _0xfb1898={'tls':{'rejectUnauthorized':![]}};if(_[_0xcce5('0x77')](_0x4c5447[_0xcce5('0x45')][_0xcce5('0x84')])){if(_0x4c5447[_0xcce5('0x45')][_0xcce5('0x81')]){_0xfb1898[_0xcce5('0xb5')]={'user':_0x4c5447[_0xcce5('0x45')][_0xcce5('0x7c')],'pass':_0x4c5447[_0xcce5('0x45')][_0xcce5('0x7f')]};}_0xfb1898[_0xcce5('0x82')]=_0x4c5447['Smtp'][_0xcce5('0x82')];_0xfb1898[_0xcce5('0x83')]=_0x4c5447[_0xcce5('0x45')][_0xcce5('0x83')];_0xfb1898[_0xcce5('0xb6')]=_0x4c5447[_0xcce5('0x45')][_0xcce5('0xb6')];}else{_0xfb1898[_0xcce5('0x84')]=_0x4c5447[_0xcce5('0x45')]['service'];_0xfb1898[_0xcce5('0xb5')]={'user':_0x4c5447[_0xcce5('0x45')][_0xcce5('0x7c')],'pass':_0x4c5447[_0xcce5('0x45')][_0xcce5('0x7f')]};}return respondWithRpcPromise(_0xcce5('0xb7'),_0xcce5('0xb8'),{'account':_0xfb1898,'message':_0x58fde1[_0xcce5('0x65')]});}else{throw new Error(_0xcce5('0xb9'));}}})[_0xcce5('0x3b')](function(_0x50bdff){if(_0x50bdff){_0x5d0f89=_0x50bdff;if(_0x7aa18c[_0xcce5('0xac')]){if(_0x7aa18c[_0xcce5('0xac')][_0xcce5('0xba')][_0xcce5('0x52')]){return _0x7aa18c[_0xcce5('0xac')]['Contacts'][0x0];}else{return db[_0xcce5('0x97')][_0xcce5('0x6a')](_[_0xcce5('0x1b')](_0x58fde1[_0xcce5('0x65')],{'firstName':_0x58fde1[_0xcce5('0x65')]['to'],'email':_0x58fde1['body']['to'],'phone':_0x58fde1[_0xcce5('0x65')]['to'],'ListId':_0x7aa18c[_0xcce5('0x76')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xcce5('0x3b')](function(_0x242a11){if(_0x242a11){var _0x2e98a5={'UserId':_0x58fde1[_0xcce5('0x7c')]['id'],'ContactId':_0x242a11['id'],'MailAccountId':_0x7aa18c['id'],'inReplyTo':_0x5d0f89[_0xcce5('0xbb')],'to':_0x58fde1[_0xcce5('0x65')][_0xcce5('0xaf')],'cc':_0x58fde1[_0xcce5('0x65')]['cc'],'subject':_0x58fde1['body'][_0xcce5('0xbc')],'attach':_0x58fde1[_0xcce5('0x65')][_0xcce5('0xbd')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xcce5('0xa8')),'lastMsgDirection':'out','Messages':[_['merge'](_0x58fde1['body'],{'messageId':_0x5d0f89[_0xcce5('0xbb')],'sentAt':moment()[_0xcce5('0xa7')](_0xcce5('0xa8')),'read':!![],'MailAccountId':_0x7aa18c['id'],'UserId':_0x58fde1[_0xcce5('0x7c')]['id'],'ContactId':_0x242a11['id']})]};if(_0x58fde1[_0xcce5('0x65')][_0xcce5('0xbe')]){_0x2e98a5=_[_0xcce5('0x63')](_0x2e98a5,_0x58fde1[_0xcce5('0x65')]['Interaction']);}return db[_0xcce5('0x96')][_0xcce5('0x6a')](_0x2e98a5,{'include':[{'model':db['MailMessage'],'as':_0xcce5('0xbf')}]});}})[_0xcce5('0x3b')](respondWithResult(_0x1c8a36,null))[_0xcce5('0x2d')](handleError(_0x1c8a36,null));};exports[_0xcce5('0xc0')]=function(_0x1a1627,_0x218885,_0x443ed1){return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0x1a1627['params']['id']},'include':[{'model':db[_0xcce5('0x44')],'as':_0xcce5('0x45'),'raw':!![]}]})[_0xcce5('0x3b')](handleEntityNotFound(_0x218885,null))[_0xcce5('0x3b')](function(_0x4e3ff2){if(_0x4e3ff2&&_0x4e3ff2[_0xcce5('0x45')]){var _0x2a92df={'id':_0x4e3ff2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4e3ff2['Smtp'][_0xcce5('0x84')]){_0x2a92df['service']=_0x4e3ff2['Smtp'][_0xcce5('0x84')];}else{_0x2a92df['host']=_0x4e3ff2[_0xcce5('0x45')][_0xcce5('0x82')];_0x2a92df[_0xcce5('0x83')]=_0x4e3ff2[_0xcce5('0x45')]['port'];_0x2a92df[_0xcce5('0xb6')]=_0x4e3ff2['Smtp']['secure'];}if(_0x4e3ff2[_0xcce5('0x45')][_0xcce5('0x81')]){_0x2a92df[_0xcce5('0xb5')]={'user':_0x4e3ff2[_0xcce5('0x45')]['user'],'pass':_0x4e3ff2[_0xcce5('0x45')][_0xcce5('0x7f')]};}return respondWithRpcPromise(_0xcce5('0xc1'),_0xcce5('0xc0'),{'account':_0x2a92df});}})[_0xcce5('0x3b')](respondWithResult(_0x218885,null))['catch'](handleError(_0x218885,null));};exports[_0xcce5('0x3e')]=function(_0x1beada,_0x20a3b4){return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0x1beada[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0x20a3b4,null))[_0xcce5('0x3b')](function(_0x3e6c97){if(_0x3e6c97&&_0x3e6c97[_0xcce5('0x84')]){throw new db[(_0xcce5('0xc2'))]['ValidationError'](_0xcce5('0xc3'));}return _0x3e6c97;})[_0xcce5('0x3b')](removeEntity(_0x20a3b4,null))[_0xcce5('0x2d')](handleError(_0x20a3b4,null));};exports[_0xcce5('0xc4')]=function(_0x52b72b,_0xca0c37,_0x14cd22){return db[_0xcce5('0x48')][_0xcce5('0x64')]({'where':{'id':_0x52b72b[_0xcce5('0x60')]['id']}})[_0xcce5('0x3b')](handleEntityNotFound(_0xca0c37,null))[_0xcce5('0x3b')](function(_0x20cb42){if(_0x20cb42){return _0x20cb42[_0xcce5('0xc4')](_0x52b72b['body'][_0xcce5('0x70')],_[_0xcce5('0x94')](_0x52b72b[_0xcce5('0x65')],[_0xcce5('0x70'),'id'])||{})[_0xcce5('0xc5')](function(_0x1a89dc){for(var _0x4cc588=0x0;_0x4cc588<_0x52b72b['body'][_0xcce5('0x70')]['length'];_0x4cc588+=0x1){socket[_0xcce5('0xc6')](_0xcce5('0xc7'),{'UserId':Number(_0x52b72b[_0xcce5('0x65')][_0xcce5('0x70')][_0x4cc588]),'MailAccountId':Number(_0x52b72b['params']['id'])});}return _0x1a89dc;});}})[_0xcce5('0x3b')](respondWithResult(_0xca0c37,null))[_0xcce5('0x2d')](handleError(_0xca0c37,null));};exports['removeAgents']=function(_0x5877cd,_0x30625b,_0x3d6417){return db['MailAccount'][_0xcce5('0x64')]({'where':{'id':_0x5877cd['params']['id']}})['then'](handleEntityNotFound(_0x30625b,null))['then'](function(_0x3589a1){if(_0x3589a1){return _0x3589a1['removeAgents'](_0x5877cd[_0xcce5('0x4e')][_0xcce5('0x70')])[_0xcce5('0x3b')](function(){if(_['isArray'](_0x5877cd['query'][_0xcce5('0x70')])){for(var _0x5d5cd3=0x0;_0x5d5cd3<_0x5877cd['query'][_0xcce5('0x70')][_0xcce5('0x52')];_0x5d5cd3+=0x1){socket[_0xcce5('0xc6')](_0xcce5('0xc8'),{'UserId':Number(_0x5877cd[_0xcce5('0x4e')][_0xcce5('0x70')][_0x5d5cd3]),'MailAccountId':Number(_0x5877cd[_0xcce5('0x60')]['id'])});}}else{socket[_0xcce5('0xc6')](_0xcce5('0xc8'),{'UserId':Number(_0x5877cd[_0xcce5('0x4e')][_0xcce5('0x70')]),'MailAccountId':Number(_0x5877cd[_0xcce5('0x60')]['id'])});}});}})[_0xcce5('0x3b')](respondWithStatusCode(_0x30625b,null))[_0xcce5('0x2d')](handleError(_0x30625b,null));};exports['getAgents']=function(_0x56c59e,_0xdd4cf4,_0x36f2ce){var _0x26de3f={};var _0x3f483d={};var _0x4c7c84;var _0xacacae;return db[_0xcce5('0x48')][_0xcce5('0x6c')]({'where':{'id':_0x56c59e[_0xcce5('0x60')]['id']}})['then'](handleEntityNotFound(_0xdd4cf4,null))[_0xcce5('0x3b')](function(_0x4e58a4){if(_0x4e58a4){_0x4c7c84=_0x4e58a4;_0x3f483d[_0xcce5('0x4b')]=_['keys'](db[_0xcce5('0x99')][_0xcce5('0x62')]);_0x3f483d[_0xcce5('0x4e')]=_[_0xcce5('0x61')](_0x56c59e[_0xcce5('0x4e')]);_0x3f483d[_0xcce5('0x4f')]=_[_0xcce5('0x50')](_0x3f483d[_0xcce5('0x4b')],_0x3f483d['query']);_0x26de3f[_0xcce5('0x53')]=_['intersection'](_0x3f483d[_0xcce5('0x4b')],qs[_0xcce5('0x51')](_0x56c59e[_0xcce5('0x4e')][_0xcce5('0x51')]));_0x26de3f[_0xcce5('0x53')]=_0x26de3f[_0xcce5('0x53')][_0xcce5('0x52')]?_0x26de3f[_0xcce5('0x53')]:_0x3f483d[_0xcce5('0x4b')];_0x26de3f['order']=qs[_0xcce5('0x56')](_0x56c59e[_0xcce5('0x4e')][_0xcce5('0x56')]);_0x26de3f[_0xcce5('0x59')]=qs[_0xcce5('0x4f')](_[_0xcce5('0x57')](_0x56c59e[_0xcce5('0x4e')],_0x3f483d[_0xcce5('0x4f')]));if(_0x56c59e['query']['filter']){_0x26de3f[_0xcce5('0x59')]=_[_0xcce5('0x63')](_0x26de3f[_0xcce5('0x59')],{'$or':_[_0xcce5('0x4c')](_0x26de3f[_0xcce5('0x53')],function(_0x268ffc){var _0x376721={};_0x376721[_0x268ffc]={'$like':'%'+_0x56c59e[_0xcce5('0x4e')][_0xcce5('0x58')]+'%'};return _0x376721;})});}_0x26de3f=_[_0xcce5('0x63')]({},_0x26de3f,_0x56c59e[_0xcce5('0x5b')]);return _0x4c7c84[_0xcce5('0xc9')](_0x26de3f);}})[_0xcce5('0x3b')](function(_0x5e5d51){if(_0x5e5d51){_0xacacae=_0x5e5d51[_0xcce5('0x52')];if(!_0x56c59e['query'][_0xcce5('0x54')](_0xcce5('0x55'))){_0x26de3f['limit']=qs['limit'](_0x56c59e[_0xcce5('0x4e')][_0xcce5('0x35')]);_0x26de3f[_0xcce5('0x34')]=qs[_0xcce5('0x34')](_0x56c59e[_0xcce5('0x4e')]['offset']);}return _0x4c7c84['getAgents'](_0x26de3f);}})[_0xcce5('0x3b')](function(_0x105fac){if(_0x105fac){return _0x105fac?{'count':_0xacacae,'rows':_0x105fac}:null;}})['then'](respondWithResult(_0xdd4cf4,null))[_0xcce5('0x2d')](handleError(_0xdd4cf4,null));}; \ No newline at end of file +var _0x8ee9=['attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','Imap','Pause','include','find','body','params','describe','catch','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','email','ListId','isNil','active','description','cservice','cuser','password','cpassword','authentication','host','port','service','user','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','from','format','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','User','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','keys','query','filters'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x8ee9,0x1f1));var _0x98ee=function(_0x37913d,_0xd641d8){_0x37913d=_0x37913d-0x0;var _0x5644e6=_0x8ee9[_0x37913d];return _0x5644e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x98ee('0x0'));var zipdir=require(_0x98ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98ee('0x2'));var moment=require('moment');var BPromise=require(_0x98ee('0x3'));var Mustache=require(_0x98ee('0x4'));var util=require(_0x98ee('0x5'));var path=require(_0x98ee('0x6'));var sox=require('sox');var csv=require(_0x98ee('0x7'));var ejs=require(_0x98ee('0x8'));var fs=require('fs');var fs_extra=require(_0x98ee('0x9'));var _=require('lodash');var squel=require(_0x98ee('0xa'));var crypto=require(_0x98ee('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98ee('0x7'));var querystring=require('querystring');var Papa=require(_0x98ee('0xc'));var htmlToText=require(_0x98ee('0xd'));var juice=require(_0x98ee('0xe'));var Redis=require(_0x98ee('0xf'));var authService=require(_0x98ee('0x10'));var qs=require(_0x98ee('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98ee('0x12'));var logger=require(_0x98ee('0x13'))(_0x98ee('0x14'));var utils=require('../../config/utils');var config=require(_0x98ee('0x15'));var licenseUtil=require(_0x98ee('0x16'));var db=require(_0x98ee('0x17'))['db'];config['redis']=_[_0x98ee('0x18')](config[_0x98ee('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x98ee('0x1a'))(new Redis(config[_0x98ee('0x19')]));require(_0x98ee('0x1b'))['register'](socket);var jayson=require(_0x98ee('0x1c'));var client=jayson[_0x98ee('0x1d')][_0x98ee('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x152e62,_0xcfde9,_0x140ac1,_0x7bf5d3){return new BPromise(function(_0x570475,_0x53d9bd){var _0x3adbc3=_0x7bf5d3||client;return _0x3adbc3[_0x98ee('0x1f')](_0x152e62,_0x140ac1)[_0x98ee('0x20')](function(_0x31c931){logger['info'](_0x98ee('0x21'),_0xcfde9,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xcfde9,_0x98ee('0x22'),JSON[_0x98ee('0x23')](_0x31c931));if(_0x31c931[_0x98ee('0x24')]){if(_0x31c931['error'][_0x98ee('0x25')]===0x1f4){logger[_0x98ee('0x24')](_0x98ee('0x21'),_0xcfde9,_0x31c931['error']['message']);return _0x53d9bd(_0x31c931[_0x98ee('0x24')][_0x98ee('0x26')]);}logger['error'](_0x98ee('0x21'),_0xcfde9,_0x31c931[_0x98ee('0x24')][_0x98ee('0x26')]);return _0x570475(_0x31c931['error']['message']);}else{logger[_0x98ee('0x27')](_0x98ee('0x21'),_0xcfde9,_0x98ee('0x22'));_0x570475(_0x31c931['result'][_0x98ee('0x26')]);}})['catch'](function(_0x3cefef){logger[_0x98ee('0x24')]('MailAccount,\x20%s,\x20%s',_0xcfde9,_0x3cefef);_0x53d9bd(_0x3cefef);});});}function respondWithStatusCode(_0x27b2bf,_0xe3c536){_0xe3c536=_0xe3c536||0xcc;return function(_0x48293d){if(_0x48293d){return _0x27b2bf[_0x98ee('0x28')](_0xe3c536);}return _0x27b2bf[_0x98ee('0x29')](_0xe3c536)['end']();};}function respondWithResult(_0x4e5bb7,_0x2b84f6){_0x2b84f6=_0x2b84f6||0xc8;return function(_0x3ef30c){if(_0x3ef30c){return _0x4e5bb7['status'](_0x2b84f6)[_0x98ee('0x2a')](_0x3ef30c);}};}function respondWithFilteredResult(_0x555a7f,_0x52de06){return function(_0x566a9f){if(_0x566a9f){var _0x580813=typeof _0x52de06[_0x98ee('0x2b')]===_0x98ee('0x2c')&&typeof _0x52de06[_0x98ee('0x2d')]==='undefined';var _0x578d1c=_0x566a9f[_0x98ee('0x2e')];var _0x13377b=_0x580813?0x0:_0x52de06['offset'];var _0x22bee2=_0x580813?_0x566a9f[_0x98ee('0x2e')]:_0x52de06['offset']+_0x52de06[_0x98ee('0x2d')];var _0x4c1e0b;if(_0x22bee2>=_0x578d1c){_0x22bee2=_0x578d1c;_0x4c1e0b=0xc8;}else{_0x4c1e0b=0xce;}_0x555a7f[_0x98ee('0x29')](_0x4c1e0b);return _0x555a7f['set'](_0x98ee('0x2f'),_0x13377b+'-'+_0x22bee2+'/'+_0x578d1c)[_0x98ee('0x2a')](_0x566a9f);}return null;};}function patchUpdates(_0x8987ab){return function(_0x3e3c0a){try{jsonpatch[_0x98ee('0x30')](_0x3e3c0a,_0x8987ab,!![]);}catch(_0x113322){return BPromise[_0x98ee('0x31')](_0x113322);}return _0x3e3c0a['save']();};}function saveUpdates(_0x28bb91,_0x160275){return function(_0x17cbc2){if(_0x17cbc2){return _0x17cbc2[_0x98ee('0x32')](_0x28bb91)[_0x98ee('0x20')](function(_0x32b864){return _0x32b864;});}return null;};}function removeEntity(_0x227a25,_0x7492a){return function(_0x57ac04){if(_0x57ac04){return _0x57ac04[_0x98ee('0x33')]()[_0x98ee('0x20')](function(){var _0x5677c5=_0x57ac04[_0x98ee('0x34')]({'plain':!![]});var _0x34f8e9=_0x98ee('0x35');return db[_0x98ee('0x36')]['destroy']({'where':{'type':_0x34f8e9,'resourceId':_0x5677c5['id']}})[_0x98ee('0x20')](function(){return _0x57ac04;});})[_0x98ee('0x20')](function(){_0x227a25[_0x98ee('0x29')](0xcc)[_0x98ee('0x37')]();});}};}function handleEntityNotFound(_0x21a3e2,_0x2827c7){return function(_0x43e347){if(!_0x43e347){_0x21a3e2[_0x98ee('0x28')](0x194);}return _0x43e347;};}function handleError(_0x42bb94,_0x4c48c5){_0x4c48c5=_0x4c48c5||0x1f4;return function(_0x2a84e4){logger[_0x98ee('0x24')](_0x2a84e4[_0x98ee('0x38')]);if(_0x2a84e4[_0x98ee('0x39')]){delete _0x2a84e4[_0x98ee('0x39')];}_0x42bb94[_0x98ee('0x29')](_0x4c48c5)[_0x98ee('0x3a')](_0x2a84e4);};}exports[_0x98ee('0x3b')]=function(_0x5e9130,_0x2decb0){var _0x2db935={'include':[{'model':db[_0x98ee('0x3c')],'as':'Imap'},{'model':db[_0x98ee('0x3d')],'as':_0x98ee('0x3e')},{'model':db['Pause'],'as':_0x98ee('0x3f')}]},_0x54bdd8={},_0x1fbf00={'count':0x0,'rows':[]};var _0x44f392=_[_0x98ee('0x40')](db[_0x98ee('0x41')]['rawAttributes'],function(_0x6cff0e){return{'name':_0x6cff0e[_0x98ee('0x42')],'type':_0x6cff0e[_0x98ee('0x43')][_0x98ee('0x44')]};});_0x54bdd8[_0x98ee('0x45')]=_[_0x98ee('0x40')](_0x44f392,_0x98ee('0x39'));_0x54bdd8['query']=_[_0x98ee('0x46')](_0x5e9130[_0x98ee('0x47')]);_0x54bdd8[_0x98ee('0x48')]=_['intersection'](_0x54bdd8[_0x98ee('0x45')],_0x54bdd8[_0x98ee('0x47')]);_0x2db935[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x54bdd8[_0x98ee('0x45')],qs[_0x98ee('0x4b')](_0x5e9130[_0x98ee('0x47')]['fields']));_0x2db935[_0x98ee('0x49')]=_0x2db935[_0x98ee('0x49')][_0x98ee('0x4c')]?_0x2db935['attributes']:_0x54bdd8['model'];if(!_0x5e9130[_0x98ee('0x47')]['hasOwnProperty'](_0x98ee('0x4d'))){_0x2db935['limit']=qs[_0x98ee('0x2d')](_0x5e9130['query']['limit']);_0x2db935['offset']=qs['offset'](_0x5e9130[_0x98ee('0x47')][_0x98ee('0x2b')]);}_0x2db935[_0x98ee('0x4e')]=qs[_0x98ee('0x4f')](_0x5e9130[_0x98ee('0x47')][_0x98ee('0x4f')]);_0x2db935[_0x98ee('0x50')]=qs['filters'](_['pick'](_0x5e9130[_0x98ee('0x47')],_0x54bdd8[_0x98ee('0x48')]),_0x44f392);if(_0x5e9130['query'][_0x98ee('0x51')]){_0x2db935['where']=_['merge'](_0x2db935[_0x98ee('0x50')],{'$or':_[_0x98ee('0x40')](_0x44f392,function(_0x348b88){if(_0x348b88[_0x98ee('0x43')]!=='VIRTUAL'){var _0x5ad51a={};_0x5ad51a[_0x348b88[_0x98ee('0x39')]]={'$like':'%'+_0x5e9130['query'][_0x98ee('0x51')]+'%'};return _0x5ad51a;}})});}_0x2db935=_[_0x98ee('0x52')]({},_0x2db935,_0x5e9130[_0x98ee('0x53')]);var _0x2d1af7={'where':_0x2db935[_0x98ee('0x50')]};return db[_0x98ee('0x41')]['count'](_0x2d1af7)[_0x98ee('0x20')](function(_0x3d6337){_0x1fbf00[_0x98ee('0x2e')]=_0x3d6337;if(_0x5e9130[_0x98ee('0x47')][_0x98ee('0x54')]){_0x2db935['include']=[{'all':!![]}];}return db[_0x98ee('0x41')][_0x98ee('0x55')](_0x2db935);})[_0x98ee('0x20')](function(_0x1e3095){_0x1fbf00[_0x98ee('0x56')]=_0x1e3095;return _0x1fbf00;})[_0x98ee('0x20')](respondWithFilteredResult(_0x2decb0,_0x2db935))['catch'](handleError(_0x2decb0,null));};exports[_0x98ee('0x57')]=function(_0x21f8f0,_0x454b64){var _0xc2aa11={'raw':![],'where':{'id':_0x21f8f0['params']['id']},'include':[{'model':db[_0x98ee('0x3c')],'as':_0x98ee('0x58')},{'model':db[_0x98ee('0x3d')],'as':_0x98ee('0x3e')},{'model':db[_0x98ee('0x59')],'as':_0x98ee('0x3f')}]},_0x4e5462={};_0x4e5462[_0x98ee('0x45')]=_[_0x98ee('0x46')](db[_0x98ee('0x41')]['rawAttributes']);_0x4e5462[_0x98ee('0x47')]=_[_0x98ee('0x46')](_0x21f8f0[_0x98ee('0x47')]);_0x4e5462[_0x98ee('0x48')]=_[_0x98ee('0x4a')](_0x4e5462[_0x98ee('0x45')],_0x4e5462['query']);_0xc2aa11[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x4e5462[_0x98ee('0x45')],qs[_0x98ee('0x4b')](_0x21f8f0['query'][_0x98ee('0x4b')]));_0xc2aa11[_0x98ee('0x49')]=_0xc2aa11['attributes'][_0x98ee('0x4c')]?_0xc2aa11[_0x98ee('0x49')]:_0x4e5462[_0x98ee('0x45')];if(_0x21f8f0[_0x98ee('0x47')][_0x98ee('0x54')]){_0xc2aa11[_0x98ee('0x5a')]=[{'all':!![]}];}_0xc2aa11=_[_0x98ee('0x52')]({},_0xc2aa11,_0x21f8f0[_0x98ee('0x53')]);return db[_0x98ee('0x41')][_0x98ee('0x5b')](_0xc2aa11)[_0x98ee('0x20')](handleEntityNotFound(_0x454b64,null))['then'](respondWithResult(_0x454b64,null))['catch'](handleError(_0x454b64,null));};exports['update']=function(_0x1b6780,_0x484b38){if(_0x1b6780[_0x98ee('0x5c')]['id']){delete _0x1b6780['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x1b6780[_0x98ee('0x5d')]['id']},'include':[{'model':db[_0x98ee('0x3c')],'as':_0x98ee('0x58')},{'model':db[_0x98ee('0x3d')],'as':_0x98ee('0x3e')},{'model':db[_0x98ee('0x59')],'as':_0x98ee('0x3f')}]})[_0x98ee('0x20')](handleEntityNotFound(_0x484b38,null))['then'](saveUpdates(_0x1b6780[_0x98ee('0x5c')],null))[_0x98ee('0x20')](function(_0x2531ca){if(_0x2531ca&&_0x1b6780[_0x98ee('0x5c')][_0x98ee('0x58')]){return db[_0x98ee('0x3c')][_0x98ee('0x32')](_0x1b6780[_0x98ee('0x5c')][_0x98ee('0x58')],{'where':{'MailAccountId':_0x2531ca['id']}})['then'](function(){return _0x2531ca;});}return _0x2531ca;})[_0x98ee('0x20')](function(_0x8c09d1){if(_0x8c09d1&&_0x1b6780[_0x98ee('0x5c')][_0x98ee('0x3e')]){return db[_0x98ee('0x3d')][_0x98ee('0x32')](_0x1b6780[_0x98ee('0x5c')][_0x98ee('0x3e')],{'where':{'MailAccountId':_0x8c09d1['id']}})[_0x98ee('0x20')](function(){return _0x8c09d1;});}return _0x8c09d1;})['then'](respondWithResult(_0x484b38,null))['catch'](handleError(_0x484b38,null));};exports['describe']=function(_0x1e8beb,_0x5d88d4){return db[_0x98ee('0x41')][_0x98ee('0x5e')]()[_0x98ee('0x20')](respondWithResult(_0x5d88d4,null))[_0x98ee('0x5f')](handleError(_0x5d88d4,null));};exports['addDisposition']=function(_0xe43e0e,_0x692a55,_0x505ed6){if(_0xe43e0e[_0x98ee('0x5c')]['id']){delete _0xe43e0e[_0x98ee('0x5c')]['id'];}return db[_0x98ee('0x41')][_0x98ee('0x5b')]({'where':{'id':_0xe43e0e[_0x98ee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x692a55,null))['then'](function(_0x300ad2){if(_0x300ad2){_0xe43e0e[_0x98ee('0x5c')][_0x98ee('0x60')]=_0x300ad2['id'];return db[_0x98ee('0x61')][_0x98ee('0x62')](_0xe43e0e[_0x98ee('0x5c')]);}})[_0x98ee('0x20')](respondWithResult(_0x692a55,null))[_0x98ee('0x5f')](handleError(_0x692a55,null));};exports[_0x98ee('0x63')]=function(_0x5f2f13,_0x3db297,_0x278704){var _0x482ec4={'raw':![],'where':{}};var _0x46c7d9={};var _0x46c092={'count':0x0,'rows':[]};return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x5f2f13[_0x98ee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3db297,null))[_0x98ee('0x20')](function(_0x5c5387){if(_0x5c5387){_0x46c7d9[_0x98ee('0x45')]=_[_0x98ee('0x46')](db[_0x98ee('0x61')]['rawAttributes']);_0x46c7d9[_0x98ee('0x47')]=_[_0x98ee('0x46')](_0x5f2f13[_0x98ee('0x47')]);_0x46c7d9[_0x98ee('0x48')]=_['intersection'](_0x46c7d9[_0x98ee('0x45')],_0x46c7d9[_0x98ee('0x47')]);_0x482ec4[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x46c7d9[_0x98ee('0x45')],qs['fields'](_0x5f2f13[_0x98ee('0x47')][_0x98ee('0x4b')]));_0x482ec4[_0x98ee('0x49')]=_0x482ec4['attributes']['length']?_0x482ec4[_0x98ee('0x49')]:_0x46c7d9[_0x98ee('0x45')];if(!_0x5f2f13['query'][_0x98ee('0x65')](_0x98ee('0x4d'))){_0x482ec4[_0x98ee('0x2d')]=qs[_0x98ee('0x2d')](_0x5f2f13[_0x98ee('0x47')]['limit']);_0x482ec4['offset']=qs[_0x98ee('0x2b')](_0x5f2f13[_0x98ee('0x47')][_0x98ee('0x2b')]);}_0x482ec4[_0x98ee('0x4e')]=qs[_0x98ee('0x4f')](_0x5f2f13['query'][_0x98ee('0x4f')]);_0x482ec4[_0x98ee('0x50')]=qs[_0x98ee('0x48')](_[_0x98ee('0x66')](_0x5f2f13[_0x98ee('0x47')],_0x46c7d9['filters']));_0x482ec4[_0x98ee('0x50')][_0x98ee('0x60')]=_0x5c5387['id'];if(_0x5f2f13[_0x98ee('0x47')][_0x98ee('0x51')]){_0x482ec4[_0x98ee('0x50')]=_[_0x98ee('0x52')](_0x482ec4[_0x98ee('0x50')],{'$or':_['map'](_0x482ec4['attributes'],function(_0x21727a){var _0x11b959={};_0x11b959[_0x21727a]={'$like':'%'+_0x5f2f13[_0x98ee('0x47')][_0x98ee('0x51')]+'%'};return _0x11b959;})});}_0x482ec4=_['merge']({},_0x482ec4,_0x5f2f13[_0x98ee('0x53')]);return db[_0x98ee('0x61')]['count']({'where':_0x482ec4[_0x98ee('0x50')]})[_0x98ee('0x20')](function(_0x1361d5){_0x46c092[_0x98ee('0x2e')]=_0x1361d5;if(_0x5f2f13['query'][_0x98ee('0x54')]){_0x482ec4[_0x98ee('0x5a')]=[{'all':!![]}];}return db[_0x98ee('0x61')][_0x98ee('0x55')](_0x482ec4);})[_0x98ee('0x20')](function(_0x3762c0){_0x46c092['rows']=_0x3762c0;return _0x46c092;});}})['then'](respondWithFilteredResult(_0x3db297,_0x482ec4))['catch'](handleError(_0x3db297,null));};exports[_0x98ee('0x67')]=function(_0x1d3891,_0x3dd1cc,_0x28f6d5){return db[_0x98ee('0x41')][_0x98ee('0x5b')]({'where':{'id':_0x1d3891[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x3dd1cc,null))['then'](function(_0x115c7b){if(_0x115c7b){return _0x115c7b[_0x98ee('0x67')](_0x1d3891[_0x98ee('0x47')][_0x98ee('0x68')]);}})['then'](respondWithStatusCode(_0x3dd1cc,null))[_0x98ee('0x5f')](handleError(_0x3dd1cc,null));};exports[_0x98ee('0x69')]=function(_0x1f57cb,_0x2719ea,_0x1c20aa){if(_0x1f57cb[_0x98ee('0x5c')]['id']){delete _0x1f57cb['body']['id'];}return db[_0x98ee('0x41')][_0x98ee('0x5b')]({'where':{'id':_0x1f57cb[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x2719ea,null))[_0x98ee('0x20')](function(_0x2ae5ed){if(_0x2ae5ed){_0x1f57cb[_0x98ee('0x5c')][_0x98ee('0x60')]=_0x2ae5ed['id'];return db[_0x98ee('0x6a')][_0x98ee('0x62')](_0x1f57cb[_0x98ee('0x5c')]);}})[_0x98ee('0x20')](respondWithResult(_0x2719ea,null))['catch'](handleError(_0x2719ea,null));};exports[_0x98ee('0x6b')]=function(_0x2c7bd9,_0x3a6899,_0x44d6ee){var _0x47daea={'raw':![],'where':{}};var _0x115a7c={};var _0x16ad5d={'count':0x0,'rows':[]};return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x2c7bd9[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x3a6899,null))[_0x98ee('0x20')](function(_0x578de8){if(_0x578de8){_0x115a7c[_0x98ee('0x45')]=_[_0x98ee('0x46')](db['CannedAnswer'][_0x98ee('0x6c')]);_0x115a7c[_0x98ee('0x47')]=_[_0x98ee('0x46')](_0x2c7bd9[_0x98ee('0x47')]);_0x115a7c['filters']=_[_0x98ee('0x4a')](_0x115a7c[_0x98ee('0x45')],_0x115a7c[_0x98ee('0x47')]);_0x47daea[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x115a7c['model'],qs[_0x98ee('0x4b')](_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x4b')]));_0x47daea[_0x98ee('0x49')]=_0x47daea[_0x98ee('0x49')]['length']?_0x47daea[_0x98ee('0x49')]:_0x115a7c[_0x98ee('0x45')];if(!_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x65')](_0x98ee('0x4d'))){_0x47daea['limit']=qs[_0x98ee('0x2d')](_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x2d')]);_0x47daea[_0x98ee('0x2b')]=qs[_0x98ee('0x2b')](_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x2b')]);}_0x47daea['order']=qs[_0x98ee('0x4f')](_0x2c7bd9['query']['sort']);_0x47daea[_0x98ee('0x50')]=qs['filters'](_['pick'](_0x2c7bd9[_0x98ee('0x47')],_0x115a7c['filters']));_0x47daea[_0x98ee('0x50')][_0x98ee('0x60')]=_0x578de8['id'];if(_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x51')]){_0x47daea[_0x98ee('0x50')]=_[_0x98ee('0x52')](_0x47daea[_0x98ee('0x50')],{'$or':_[_0x98ee('0x40')](_0x47daea[_0x98ee('0x49')],function(_0x48f144){var _0x3361ed={};_0x3361ed[_0x48f144]={'$like':'%'+_0x2c7bd9[_0x98ee('0x47')]['filter']+'%'};return _0x3361ed;})});}_0x47daea=_[_0x98ee('0x52')]({},_0x47daea,_0x2c7bd9[_0x98ee('0x53')]);return db[_0x98ee('0x6a')][_0x98ee('0x2e')]({'where':_0x47daea[_0x98ee('0x50')]})[_0x98ee('0x20')](function(_0x4313b4){_0x16ad5d['count']=_0x4313b4;if(_0x2c7bd9[_0x98ee('0x47')][_0x98ee('0x54')]){_0x47daea[_0x98ee('0x5a')]=[{'all':!![]}];}return db[_0x98ee('0x6a')]['findAll'](_0x47daea);})[_0x98ee('0x20')](function(_0x149d02){_0x16ad5d[_0x98ee('0x56')]=_0x149d02;return _0x16ad5d;});}})['then'](respondWithFilteredResult(_0x3a6899,_0x47daea))['catch'](handleError(_0x3a6899,null));};exports[_0x98ee('0x6d')]=function(_0x45e94f,_0x4ffe11,_0x1793cd){return db[_0x98ee('0x41')][_0x98ee('0x5b')]({'where':{'id':_0x45e94f[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x4ffe11,null))['then'](function(_0xd90929){if(_0xd90929){return _0xd90929[_0x98ee('0x6d')](_0x45e94f[_0x98ee('0x47')][_0x98ee('0x68')]);}})[_0x98ee('0x20')](respondWithStatusCode(_0x4ffe11,null))[_0x98ee('0x5f')](handleError(_0x4ffe11,null));};exports[_0x98ee('0x62')]=function(_0x74d8dd,_0xb2f58f){var _0x161f5e={'name':_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x39')],'key':_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x44')],'email':_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x6e')],'ListId':_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x6f')],'active':!_[_0x98ee('0x70')](_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x71')])?_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x71')]:!![],'description':_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0x98ee('0x70')](_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x73')])){if(_0x74d8dd['body']['cauthentication']){_0x161f5e[_0x98ee('0x58')]['user']=_0x161f5e[_0x98ee('0x3e')]['user']=_0x74d8dd['body'][_0x98ee('0x74')];_0x161f5e['Imap'][_0x98ee('0x75')]=_0x161f5e[_0x98ee('0x3e')]['pass']=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x76')];}else{_0x161f5e[_0x98ee('0x58')][_0x98ee('0x77')]=_0x161f5e[_0x98ee('0x3e')][_0x98ee('0x77')]=![];}_0x161f5e['Imap'][_0x98ee('0x78')]=_0x74d8dd['body']['Imap']['host'];_0x161f5e[_0x98ee('0x58')][_0x98ee('0x79')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x58')][_0x98ee('0x79')];_0x161f5e['Smtp'][_0x98ee('0x78')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x3e')][_0x98ee('0x78')];_0x161f5e[_0x98ee('0x3e')][_0x98ee('0x79')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x3e')][_0x98ee('0x79')];}else{_0x161f5e[_0x98ee('0x58')]['service']=_0x161f5e[_0x98ee('0x3e')][_0x98ee('0x7a')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x73')];_0x161f5e[_0x98ee('0x58')]['user']=_0x161f5e[_0x98ee('0x3e')][_0x98ee('0x7b')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x74')];_0x161f5e[_0x98ee('0x58')]['password']=_0x161f5e[_0x98ee('0x3e')][_0x98ee('0x7c')]=_0x74d8dd[_0x98ee('0x5c')][_0x98ee('0x76')];}return db[_0x98ee('0x41')]['create'](_0x161f5e,{'include':[{'model':db[_0x98ee('0x3d')],'as':'Smtp'},{'model':db[_0x98ee('0x3c')],'as':_0x98ee('0x58')}]})[_0x98ee('0x20')](function(_0x5e4151){var _0xf28780=_0x74d8dd[_0x98ee('0x7b')][_0x98ee('0x34')]({'plain':!![]});if(!_0xf28780)throw new Error(_0x98ee('0x7d'));if(_0xf28780['role']==='user'){var _0x3c1e0c=_0x5e4151[_0x98ee('0x34')]({'plain':!![]});return db[_0x98ee('0x7e')][_0x98ee('0x5b')]({'where':{'name':_0x98ee('0x35'),'userProfileId':_0xf28780[_0x98ee('0x7f')]},'raw':!![]})[_0x98ee('0x20')](function(_0x40fad9){if(_0x40fad9&&_0x40fad9[_0x98ee('0x80')]===0x0){return db[_0x98ee('0x36')][_0x98ee('0x62')]({'name':_0x3c1e0c[_0x98ee('0x39')],'resourceId':_0x3c1e0c['id'],'type':_0x40fad9['name'],'sectionId':_0x40fad9['id']},{})[_0x98ee('0x20')](function(){return _0x5e4151;});}else{return _0x5e4151;}})[_0x98ee('0x5f')](function(_0x504d90){logger[_0x98ee('0x24')](_0x98ee('0x81'),_0x504d90);throw _0x504d90;});}return _0x5e4151;})['then'](respondWithResult(_0xb2f58f,0xc9))[_0x98ee('0x5f')](handleError(_0xb2f58f,null));};exports['getImap']=function(_0x3d17d0,_0x2fdd98,_0x2d004f){return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x3d17d0[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x2fdd98,null))[_0x98ee('0x20')](function(_0x24d0e1){if(_0x24d0e1){return _0x24d0e1[_0x98ee('0x82')]();}return null;})[_0x98ee('0x20')](respondWithResult(_0x2fdd98,null))[_0x98ee('0x5f')](handleError(_0x2fdd98,null));};exports[_0x98ee('0x83')]=function(_0x166eb9,_0x29822c,_0x23f9df){if(_0x166eb9['body']['id']){delete _0x166eb9[_0x98ee('0x5c')]['id'];}return db['MailAccount'][_0x98ee('0x5b')]({'where':{'id':_0x166eb9[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x29822c,null))[_0x98ee('0x20')](function(_0x443e4c){if(_0x443e4c){_0x166eb9[_0x98ee('0x5c')][_0x98ee('0x60')]=_0x443e4c['id'];return db[_0x98ee('0x3c')][_0x98ee('0x62')](_0x166eb9['body']);}})[_0x98ee('0x20')](respondWithResult(_0x29822c,null))[_0x98ee('0x5f')](handleError(_0x29822c,null));};exports[_0x98ee('0x84')]=function(_0x2128a1,_0x34aaed,_0x388cf5){return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x2128a1['params']['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x34aaed,null))[_0x98ee('0x20')](function(_0x46334c){if(_0x46334c){return _0x46334c[_0x98ee('0x85')](null);}return null;})[_0x98ee('0x20')](respondWithStatusCode(_0x34aaed,null))[_0x98ee('0x5f')](handleError(_0x34aaed,null));};exports['getSmtp']=function(_0x48bb91,_0x2734ca,_0x755235){return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x48bb91[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x2734ca,null))[_0x98ee('0x20')](function(_0x474862){if(_0x474862){return _0x474862[_0x98ee('0x86')]();}return null;})[_0x98ee('0x20')](respondWithResult(_0x2734ca,null))['catch'](handleError(_0x2734ca,null));};exports[_0x98ee('0x87')]=function(_0x3c80e7,_0x514be4,_0x5dac41){if(_0x3c80e7[_0x98ee('0x5c')]['id']){delete _0x3c80e7[_0x98ee('0x5c')]['id'];}return db['MailAccount'][_0x98ee('0x5b')]({'where':{'id':_0x3c80e7[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x514be4,null))['then'](function(_0x29c620){if(_0x29c620){_0x3c80e7[_0x98ee('0x5c')][_0x98ee('0x60')]=_0x29c620['id'];return db[_0x98ee('0x3d')][_0x98ee('0x62')](_0x3c80e7['body']);}})[_0x98ee('0x20')](respondWithResult(_0x514be4,null))[_0x98ee('0x5f')](handleError(_0x514be4,null));};exports[_0x98ee('0x88')]=function(_0x21afa9,_0x3daeef,_0x534dac){return db[_0x98ee('0x41')]['findOne']({'where':{'id':_0x21afa9['params']['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x3daeef,null))[_0x98ee('0x20')](function(_0x584a00){if(_0x584a00){return _0x584a00[_0x98ee('0x89')](null);}return null;})[_0x98ee('0x20')](respondWithStatusCode(_0x3daeef,null))[_0x98ee('0x5f')](handleError(_0x3daeef,null));};exports[_0x98ee('0x8a')]=function(_0x5e601f,_0x75b073,_0x24267f){return db[_0x98ee('0x8b')][_0x98ee('0x5b')]({'where':{'id':_0x5e601f[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x75b073,null))[_0x98ee('0x20')](function(_0x3dab30){if(_0x3dab30){return _0x3dab30['addInteraction'](_0x5e601f[_0x98ee('0x5c')]['ids'],_[_0x98ee('0x8c')](_0x5e601f[_0x98ee('0x5c')],[_0x98ee('0x68'),'id'])||{});}})[_0x98ee('0x20')](respondWithResult(_0x75b073,null))['catch'](handleError(_0x75b073,null));};exports['getInteractions']=function(_0x3f5a87,_0x1713b2,_0x382898){var _0x3aed10={'raw':![],'where':{}};var _0x538fdc={};var _0xb57670={'count':0x0,'rows':[]};return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x3f5a87['params']['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x1713b2,null))[_0x98ee('0x20')](function(_0x1a85c0){if(_0x1a85c0){_0x538fdc['model']=_[_0x98ee('0x46')](db[_0x98ee('0x8b')][_0x98ee('0x6c')]);_0x538fdc[_0x98ee('0x47')]=_[_0x98ee('0x46')](_0x3f5a87['query']);_0x538fdc['filters']=_['intersection'](_0x538fdc['model'],_0x538fdc[_0x98ee('0x47')]);_0x3aed10[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x538fdc[_0x98ee('0x45')],qs[_0x98ee('0x4b')](_0x3f5a87['query']['fields']));_0x3aed10[_0x98ee('0x49')]=_0x3aed10[_0x98ee('0x49')][_0x98ee('0x4c')]?_0x3aed10['attributes']:_0x538fdc[_0x98ee('0x45')];if(!_0x3f5a87[_0x98ee('0x47')][_0x98ee('0x65')]('nolimit')){_0x3aed10[_0x98ee('0x2d')]=qs[_0x98ee('0x2d')](_0x3f5a87[_0x98ee('0x47')][_0x98ee('0x2d')]);_0x3aed10[_0x98ee('0x2b')]=qs[_0x98ee('0x2b')](_0x3f5a87['query'][_0x98ee('0x2b')]);}_0x3aed10['order']=qs[_0x98ee('0x4f')](_0x3f5a87[_0x98ee('0x47')][_0x98ee('0x4f')]);_0x3aed10[_0x98ee('0x50')]=qs[_0x98ee('0x48')](_['pick'](_0x3f5a87['query'],_0x538fdc[_0x98ee('0x48')]));_0x3aed10['where']['MailAccountId']=_0x1a85c0['id'];if(_0x3f5a87[_0x98ee('0x47')][_0x98ee('0x51')]){_0x3aed10[_0x98ee('0x50')]=_['merge'](_0x3aed10[_0x98ee('0x50')],{'$or':_[_0x98ee('0x40')](_0x3aed10[_0x98ee('0x49')],function(_0x988299){var _0x3662c1={};_0x3662c1[_0x988299]={'$like':'%'+_0x3f5a87[_0x98ee('0x47')][_0x98ee('0x51')]+'%'};return _0x3662c1;})});}_0x3aed10=_[_0x98ee('0x52')]({},_0x3aed10,_0x3f5a87['options']);return db[_0x98ee('0x8b')][_0x98ee('0x2e')]({'where':_0x3aed10[_0x98ee('0x50')]})[_0x98ee('0x20')](function(_0x75a7a){_0xb57670[_0x98ee('0x2e')]=_0x75a7a;if(_0x3f5a87['query'][_0x98ee('0x54')]){_0x3aed10[_0x98ee('0x5a')]=[{'model':db[_0x98ee('0x8d')],'as':_0x98ee('0x8e'),'required':![]},{'model':db['User'],'as':_0x98ee('0x8f'),'attributes':[_0x98ee('0x39'),_0x98ee('0x90'),_0x98ee('0x91')],'required':![]},{'model':db[_0x98ee('0x92')],'as':_0x98ee('0x93'),'attributes':['id',_0x98ee('0x39'),_0x98ee('0x94')],'where':_0x3f5a87['query']['tag']?{'id':_0x3f5a87['query']['tag']}:undefined,'required':_0x3f5a87['query'][_0x98ee('0x95')]?!![]:![]}];}return db[_0x98ee('0x8b')][_0x98ee('0x55')](_0x3aed10);})[_0x98ee('0x20')](function(_0x3c157a){_0xb57670[_0x98ee('0x56')]=_0x3c157a;return _0xb57670;});}})[_0x98ee('0x20')](respondWithFilteredResult(_0x1713b2,_0x3aed10))[_0x98ee('0x5f')](handleError(_0x1713b2,null));};exports[_0x98ee('0x96')]=function(_0x2edeb1,_0xe5a545,_0x14fe85){return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x2edeb1[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0xe5a545,null))[_0x98ee('0x20')](function(_0x19a06c){if(_0x19a06c){return db[_0x98ee('0x97')][_0x98ee('0x98')](function(_0xefb3fa){return db[_0x98ee('0x99')][_0x98ee('0x33')]({'where':{'MailAccountId':_0x2edeb1[_0x98ee('0x5d')]['id']},'transaction':_0xefb3fa})['then'](function(_0x2d1dc3){var _0x4e5a9d=_[_0x98ee('0x40')](_0x2edeb1['body'],function(_0x59b280){_0x59b280[_0x98ee('0x60')]=_0x2edeb1[_0x98ee('0x5d')]['id'];return _0x59b280;});return db[_0x98ee('0x99')][_0x98ee('0x9a')](_0x4e5a9d,{'transaction':_0xefb3fa});});})['then'](function(){return db[_0x98ee('0x99')]['findAndCountAll']({'where':{'MailAccountId':_0x2edeb1[_0x98ee('0x5d')]['id']},'order':'priority'});});}})[_0x98ee('0x20')](respondWithResult(_0xe5a545,null))['catch'](handleError(_0xe5a545,null));};exports[_0x98ee('0x9b')]=function(_0x237002,_0x504494,_0x280cbc){var _0x5abd3b={};var _0x2d8381={};var _0x217bce;var _0x5bddd1;return db['MailAccount'][_0x98ee('0x64')]({'where':{'id':_0x237002['params']['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x504494,null))[_0x98ee('0x20')](function(_0x466396){if(_0x466396){_0x217bce=_0x466396;_0x2d8381[_0x98ee('0x45')]=_[_0x98ee('0x46')](db[_0x98ee('0x99')][_0x98ee('0x6c')]);_0x2d8381[_0x98ee('0x47')]=_[_0x98ee('0x46')](_0x237002['query']);_0x2d8381['filters']=_[_0x98ee('0x4a')](_0x2d8381[_0x98ee('0x45')],_0x2d8381['query']);_0x5abd3b[_0x98ee('0x49')]=_['intersection'](_0x2d8381[_0x98ee('0x45')],qs['fields'](_0x237002['query'][_0x98ee('0x4b')]));_0x5abd3b[_0x98ee('0x49')]=_0x5abd3b[_0x98ee('0x49')][_0x98ee('0x4c')]?_0x5abd3b[_0x98ee('0x49')]:_0x2d8381[_0x98ee('0x45')];_0x5abd3b[_0x98ee('0x4e')]=qs[_0x98ee('0x4f')](_0x237002[_0x98ee('0x47')][_0x98ee('0x4f')]);_0x5abd3b[_0x98ee('0x50')]=qs[_0x98ee('0x48')](_[_0x98ee('0x66')](_0x237002['query'],_0x2d8381[_0x98ee('0x48')]));if(_0x237002[_0x98ee('0x47')]['filter']){_0x5abd3b[_0x98ee('0x50')]=_[_0x98ee('0x52')](_0x5abd3b[_0x98ee('0x50')],{'$or':_[_0x98ee('0x40')](_0x5abd3b[_0x98ee('0x49')],function(_0x5db853){var _0x2513db={};_0x2513db[_0x5db853]={'$like':'%'+_0x237002[_0x98ee('0x47')][_0x98ee('0x51')]+'%'};return _0x2513db;})});}_0x5abd3b=_['merge']({},_0x5abd3b,_0x237002[_0x98ee('0x53')]);return _0x217bce[_0x98ee('0x9b')](_0x5abd3b);}})[_0x98ee('0x20')](function(_0x2253c8){if(_0x2253c8){_0x5bddd1=_0x2253c8[_0x98ee('0x4c')];if(!_0x237002[_0x98ee('0x47')][_0x98ee('0x65')](_0x98ee('0x4d'))){_0x5abd3b[_0x98ee('0x2d')]=qs['limit'](_0x237002[_0x98ee('0x47')][_0x98ee('0x2d')]);_0x5abd3b['offset']=qs['offset'](_0x237002[_0x98ee('0x47')]['offset']);}return _0x217bce['getApplications'](_0x5abd3b);}})['then'](function(_0x4da877){if(_0x4da877){return _0x4da877?{'count':_0x5bddd1,'rows':_0x4da877}:null;}})['then'](respondWithResult(_0x504494,null))[_0x98ee('0x5f')](handleError(_0x504494,null));};exports[_0x98ee('0x9c')]=function(_0x39be96,_0x598cb3,_0x41445f){var _0x492e0f={'raw':!![],'where':{}};var _0x1d3802={};var _0x31bc41={'count':0x0,'rows':[]};return db[_0x98ee('0x41')][_0x98ee('0x64')]({'where':{'id':_0x39be96[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x598cb3,null))[_0x98ee('0x20')](function(_0xe28b7a){if(_0xe28b7a){_0x1d3802[_0x98ee('0x45')]=_[_0x98ee('0x46')](db[_0x98ee('0x9d')][_0x98ee('0x6c')]);_0x1d3802[_0x98ee('0x47')]=_['keys'](_0x39be96[_0x98ee('0x47')]);_0x1d3802[_0x98ee('0x48')]=_[_0x98ee('0x4a')](_0x1d3802['model'],_0x1d3802[_0x98ee('0x47')]);_0x492e0f[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x1d3802[_0x98ee('0x45')],qs[_0x98ee('0x4b')](_0x39be96[_0x98ee('0x47')]['fields']));_0x492e0f['attributes']=_0x492e0f['attributes'][_0x98ee('0x4c')]?_0x492e0f[_0x98ee('0x49')]:_0x1d3802[_0x98ee('0x45')];if(!_0x39be96[_0x98ee('0x47')]['hasOwnProperty'](_0x98ee('0x4d'))){_0x492e0f['limit']=qs['limit'](_0x39be96[_0x98ee('0x47')][_0x98ee('0x2d')]);_0x492e0f[_0x98ee('0x2b')]=qs[_0x98ee('0x2b')](_0x39be96['query'][_0x98ee('0x2b')]);}_0x492e0f[_0x98ee('0x4e')]=qs['sort'](_0x39be96[_0x98ee('0x47')][_0x98ee('0x4f')]);_0x492e0f[_0x98ee('0x50')]=qs[_0x98ee('0x48')](_[_0x98ee('0x66')](_0x39be96[_0x98ee('0x47')],_0x1d3802[_0x98ee('0x48')]));_0x492e0f[_0x98ee('0x50')][_0x98ee('0x60')]=_0xe28b7a['id'];if(_0x39be96[_0x98ee('0x47')][_0x98ee('0x51')]){_0x492e0f['where']=_['merge'](_0x492e0f['where'],{'$or':_[_0x98ee('0x40')](_0x492e0f[_0x98ee('0x49')],function(_0x11ec99){var _0x242bfa={};_0x242bfa[_0x11ec99]={'$like':'%'+_0x39be96[_0x98ee('0x47')][_0x98ee('0x51')]+'%'};return _0x242bfa;})});}if(_0x39be96[_0x98ee('0x47')]['$gte']){var _0x5af45e=_0x39be96[_0x98ee('0x47')][_0x98ee('0x9e')][_0x98ee('0x9f')](',');var _0x34d1af={};_0x34d1af[_0x5af45e[0x0]]={'$gte':moment(_0x5af45e[0x1])['format'](_0x98ee('0xa0'))};_0x492e0f[_0x98ee('0x50')]=_[_0x98ee('0x52')](_0x492e0f[_0x98ee('0x50')],_0x34d1af);}_0x492e0f=_[_0x98ee('0x52')]({},_0x492e0f,_0x39be96[_0x98ee('0x53')]);return db['MailMessage'][_0x98ee('0x2e')]({'where':_0x492e0f[_0x98ee('0x50')]})[_0x98ee('0x20')](function(_0x1e90e4){_0x31bc41[_0x98ee('0x2e')]=_0x1e90e4;if(_0x39be96['query'][_0x98ee('0x54')]){_0x492e0f['include']=[{'all':!![]}];}return db[_0x98ee('0x9d')]['findAll'](_0x492e0f);})[_0x98ee('0x20')](function(_0x38b12e){if(_0x39be96['query']['inlineCss']==='true'){for(var _0x3a4bab=0x0;_0x3a4bab<_0x38b12e['length'];_0x3a4bab++){_0x38b12e[_0x3a4bab][_0x98ee('0x5c')]=juice(_0x38b12e[_0x3a4bab]['body']);}}_0x31bc41['rows']=_0x38b12e;return _0x31bc41;});}})[_0x98ee('0x20')](respondWithFilteredResult(_0x598cb3,_0x492e0f))['catch'](handleError(_0x598cb3,null));};exports[_0x98ee('0x3a')]=function(_0x523543,_0x62520,_0x23dc24){var _0x59d86e,_0x482966={},_0x583fda;if(_0x523543[_0x98ee('0x5c')]['to']){_0x583fda=_0x523543['body']['to']['split'](',')[0x0];}return db[_0x98ee('0x41')][_0x98ee('0x5b')]({'where':{'id':_0x523543[_0x98ee('0x5d')]['id']},'include':[{'model':db[_0x98ee('0xa1')],'as':_0x98ee('0xa2'),'include':[{'model':db['CmContact'],'as':_0x98ee('0xa3'),'where':{'email':_0x583fda},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x62520,null))[_0x98ee('0x20')](function(_0x71f8fa){if(_0x71f8fa){_0x59d86e=_0x71f8fa;if(_0x71f8fa[_0x98ee('0x3e')]){if(_['isNil'](_0x523543['body'][_0x98ee('0xa4')])){_0x523543[_0x98ee('0x5c')][_0x98ee('0xa4')]=util[_0x98ee('0xa5')]('%s\x20<%s>',_0x71f8fa[_0x98ee('0x39')],_0x71f8fa[_0x98ee('0x6e')]||_0x71f8fa['Smtp'][_0x98ee('0x7b')]);}if(_0x523543['body'][_0x98ee('0xa6')]&&_0x523543['body'][_0x98ee('0xa6')][_0x98ee('0x4c')]){for(var _0x23ae14=0x0;_0x23ae14<_0x523543[_0x98ee('0x5c')][_0x98ee('0xa6')]['length'];_0x23ae14+=0x1){_0x523543[_0x98ee('0x5c')][_0x98ee('0xa6')][_0x23ae14]={'filename':_0x523543[_0x98ee('0x5c')][_0x98ee('0xa6')][_0x23ae14][_0x98ee('0x39')],'path':path[_0x98ee('0xa7')](config['root'],_0x98ee('0xa8'),_0x523543[_0x98ee('0x5c')]['attachments'][_0x23ae14][_0x98ee('0xa9')])};}}var _0x34bcf3={'tls':{'rejectUnauthorized':![]}};if(_[_0x98ee('0x70')](_0x71f8fa['Smtp']['service'])){if(_0x71f8fa[_0x98ee('0x3e')]['authentication']){_0x34bcf3[_0x98ee('0xaa')]={'user':_0x71f8fa[_0x98ee('0x3e')][_0x98ee('0x7b')],'pass':_0x71f8fa[_0x98ee('0x3e')]['pass']};}_0x34bcf3[_0x98ee('0x78')]=_0x71f8fa[_0x98ee('0x3e')][_0x98ee('0x78')];_0x34bcf3[_0x98ee('0x79')]=_0x71f8fa['Smtp'][_0x98ee('0x79')];_0x34bcf3[_0x98ee('0xab')]=_0x71f8fa[_0x98ee('0x3e')][_0x98ee('0xab')];}else{_0x34bcf3[_0x98ee('0x7a')]=_0x71f8fa[_0x98ee('0x3e')][_0x98ee('0x7a')];_0x34bcf3[_0x98ee('0xaa')]={'user':_0x71f8fa[_0x98ee('0x3e')]['user'],'pass':_0x71f8fa['Smtp'][_0x98ee('0x7c')]};}return respondWithRpcPromise(_0x98ee('0xac'),_0x98ee('0xad'),{'account':_0x34bcf3,'message':_0x523543[_0x98ee('0x5c')]});}else{throw new Error(_0x98ee('0xae'));}}})[_0x98ee('0x20')](function(_0x8af7b5){if(_0x8af7b5){_0x482966=_0x8af7b5;if(_0x59d86e[_0x98ee('0xa2')]){if(_0x59d86e[_0x98ee('0xa2')]['Contacts']['length']){return _0x59d86e[_0x98ee('0xa2')][_0x98ee('0xa3')][0x0];}else{return db[_0x98ee('0x8d')][_0x98ee('0x62')](_[_0x98ee('0x18')](_0x523543[_0x98ee('0x5c')],{'firstName':_0x523543['body']['to'],'email':_0x523543[_0x98ee('0x5c')]['to'],'phone':_0x523543[_0x98ee('0x5c')]['to'],'ListId':_0x59d86e[_0x98ee('0x6f')]}));}}else{throw new Error(_0x98ee('0xae'));}}})[_0x98ee('0x20')](function(_0x1915e4){if(_0x1915e4){var _0x2bbbaa={'UserId':_0x523543[_0x98ee('0x7b')]['id'],'ContactId':_0x1915e4['id'],'MailAccountId':_0x59d86e['id'],'inReplyTo':_0x482966[_0x98ee('0xaf')],'to':_0x523543[_0x98ee('0x5c')][_0x98ee('0xa4')],'cc':_0x523543['body']['cc'],'subject':_0x523543[_0x98ee('0x5c')][_0x98ee('0xb0')],'attach':_0x523543['body']['attach'],'firstMsgDirection':_0x98ee('0xb1'),'lastMsgAt':moment()[_0x98ee('0xa5')](_0x98ee('0xa0')),'lastMsgDirection':_0x98ee('0xb1'),'Messages':[_[_0x98ee('0x52')](_0x523543['body'],{'messageId':_0x482966[_0x98ee('0xaf')],'sentAt':moment()[_0x98ee('0xa5')](_0x98ee('0xa0')),'read':!![],'MailAccountId':_0x59d86e['id'],'UserId':_0x523543['user']['id'],'ContactId':_0x1915e4['id']})]};if(_0x523543[_0x98ee('0x5c')]['Interaction']){_0x2bbbaa=_['merge'](_0x2bbbaa,_0x523543['body']['Interaction']);}return db[_0x98ee('0x8b')][_0x98ee('0x62')](_0x2bbbaa,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0x98ee('0x20')](respondWithResult(_0x62520,null))[_0x98ee('0x5f')](handleError(_0x62520,null));};exports[_0x98ee('0xb2')]=function(_0x5963d4,_0x1662de,_0xa5310f){return db['MailAccount'][_0x98ee('0x5b')]({'where':{'id':_0x5963d4[_0x98ee('0x5d')]['id']},'include':[{'model':db[_0x98ee('0x3d')],'as':_0x98ee('0x3e'),'raw':!![]}]})[_0x98ee('0x20')](handleEntityNotFound(_0x1662de,null))['then'](function(_0x116c8a){if(_0x116c8a&&_0x116c8a[_0x98ee('0x3e')]){var _0x3c23e7={'id':_0x116c8a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x116c8a['Smtp'][_0x98ee('0x7a')]){_0x3c23e7['service']=_0x116c8a[_0x98ee('0x3e')][_0x98ee('0x7a')];}else{_0x3c23e7[_0x98ee('0x78')]=_0x116c8a[_0x98ee('0x3e')][_0x98ee('0x78')];_0x3c23e7[_0x98ee('0x79')]=_0x116c8a[_0x98ee('0x3e')]['port'];_0x3c23e7['secure']=_0x116c8a['Smtp']['secure'];}if(_0x116c8a['Smtp']['authentication']){_0x3c23e7[_0x98ee('0xaa')]={'user':_0x116c8a[_0x98ee('0x3e')][_0x98ee('0x7b')],'pass':_0x116c8a[_0x98ee('0x3e')][_0x98ee('0x7c')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x3c23e7});}})['then'](respondWithResult(_0x1662de,null))[_0x98ee('0x5f')](handleError(_0x1662de,null));};exports['destroy']=function(_0x2273b5,_0x42bf90){return db['MailAccount'][_0x98ee('0x5b')]({'where':{'id':_0x2273b5[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x42bf90,null))['then'](function(_0x572eed){if(_0x572eed&&_0x572eed['service']){throw new db[(_0x98ee('0xb3'))][(_0x98ee('0xb4'))](_0x98ee('0xb5'));}return _0x572eed;})[_0x98ee('0x20')](removeEntity(_0x42bf90,null))[_0x98ee('0x5f')](handleError(_0x42bf90,null));};exports[_0x98ee('0xb6')]=function(_0xfca593,_0x490ede,_0x10a49b){return db[_0x98ee('0x41')]['find']({'where':{'id':_0xfca593[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x490ede,null))[_0x98ee('0x20')](function(_0x3b8d8f){if(_0x3b8d8f){return _0x3b8d8f[_0x98ee('0xb6')](_0xfca593['body']['ids'],_[_0x98ee('0x8c')](_0xfca593[_0x98ee('0x5c')],[_0x98ee('0x68'),'id'])||{})[_0x98ee('0xb7')](function(_0x5d60c2){for(var _0x4a9643=0x0;_0x4a9643<_0xfca593[_0x98ee('0x5c')][_0x98ee('0x68')][_0x98ee('0x4c')];_0x4a9643+=0x1){socket[_0x98ee('0xb8')](_0x98ee('0xb9'),{'UserId':Number(_0xfca593[_0x98ee('0x5c')][_0x98ee('0x68')][_0x4a9643]),'MailAccountId':Number(_0xfca593[_0x98ee('0x5d')]['id'])});}return _0x5d60c2;});}})[_0x98ee('0x20')](respondWithResult(_0x490ede,null))[_0x98ee('0x5f')](handleError(_0x490ede,null));};exports['removeAgents']=function(_0x43c277,_0x3baeed,_0x567de3){return db['MailAccount'][_0x98ee('0x5b')]({'where':{'id':_0x43c277[_0x98ee('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3baeed,null))[_0x98ee('0x20')](function(_0x1cd28b){if(_0x1cd28b){return _0x1cd28b[_0x98ee('0xba')](_0x43c277[_0x98ee('0x47')]['ids'])['then'](function(){if(_['isArray'](_0x43c277[_0x98ee('0x47')]['ids'])){for(var _0x190f71=0x0;_0x190f71<_0x43c277[_0x98ee('0x47')][_0x98ee('0x68')][_0x98ee('0x4c')];_0x190f71+=0x1){socket[_0x98ee('0xb8')](_0x98ee('0xbb'),{'UserId':Number(_0x43c277[_0x98ee('0x47')][_0x98ee('0x68')][_0x190f71]),'MailAccountId':Number(_0x43c277['params']['id'])});}}else{socket[_0x98ee('0xb8')](_0x98ee('0xbb'),{'UserId':Number(_0x43c277['query']['ids']),'MailAccountId':Number(_0x43c277[_0x98ee('0x5d')]['id'])});}});}})[_0x98ee('0x20')](respondWithStatusCode(_0x3baeed,null))[_0x98ee('0x5f')](handleError(_0x3baeed,null));};exports['getAgents']=function(_0x1aa899,_0x264d47,_0x36072d){var _0x50d10f={};var _0x206d9e={};var _0x4470df;var _0x159d61;return db[_0x98ee('0x41')]['findOne']({'where':{'id':_0x1aa899[_0x98ee('0x5d')]['id']}})[_0x98ee('0x20')](handleEntityNotFound(_0x264d47,null))[_0x98ee('0x20')](function(_0x49d0a2){if(_0x49d0a2){_0x4470df=_0x49d0a2;_0x206d9e['model']=_[_0x98ee('0x46')](db[_0x98ee('0xbc')][_0x98ee('0x6c')]);_0x206d9e['query']=_['keys'](_0x1aa899[_0x98ee('0x47')]);_0x206d9e[_0x98ee('0x48')]=_[_0x98ee('0x4a')](_0x206d9e[_0x98ee('0x45')],_0x206d9e[_0x98ee('0x47')]);_0x50d10f[_0x98ee('0x49')]=_[_0x98ee('0x4a')](_0x206d9e['model'],qs[_0x98ee('0x4b')](_0x1aa899[_0x98ee('0x47')][_0x98ee('0x4b')]));_0x50d10f[_0x98ee('0x49')]=_0x50d10f[_0x98ee('0x49')]['length']?_0x50d10f[_0x98ee('0x49')]:_0x206d9e[_0x98ee('0x45')];_0x50d10f[_0x98ee('0x4e')]=qs[_0x98ee('0x4f')](_0x1aa899[_0x98ee('0x47')][_0x98ee('0x4f')]);_0x50d10f[_0x98ee('0x50')]=qs[_0x98ee('0x48')](_[_0x98ee('0x66')](_0x1aa899['query'],_0x206d9e[_0x98ee('0x48')]));if(_0x1aa899['query'][_0x98ee('0x51')]){_0x50d10f[_0x98ee('0x50')]=_['merge'](_0x50d10f[_0x98ee('0x50')],{'$or':_[_0x98ee('0x40')](_0x50d10f[_0x98ee('0x49')],function(_0x5115f4){var _0xfc772c={};_0xfc772c[_0x5115f4]={'$like':'%'+_0x1aa899[_0x98ee('0x47')][_0x98ee('0x51')]+'%'};return _0xfc772c;})});}_0x50d10f=_['merge']({},_0x50d10f,_0x1aa899['options']);return _0x4470df[_0x98ee('0xbd')](_0x50d10f);}})[_0x98ee('0x20')](function(_0x321459){if(_0x321459){_0x159d61=_0x321459[_0x98ee('0x4c')];if(!_0x1aa899['query'][_0x98ee('0x65')]('nolimit')){_0x50d10f[_0x98ee('0x2d')]=qs[_0x98ee('0x2d')](_0x1aa899['query'][_0x98ee('0x2d')]);_0x50d10f['offset']=qs['offset'](_0x1aa899[_0x98ee('0x47')][_0x98ee('0x2b')]);}return _0x4470df[_0x98ee('0xbd')](_0x50d10f);}})[_0x98ee('0x20')](function(_0x684f83){if(_0x684f83){return _0x684f83?{'count':_0x159d61,'rows':_0x684f83}:null;}})['then'](respondWithResult(_0x264d47,null))[_0x98ee('0x5f')](handleError(_0x264d47,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 2e8ffac..5c3bd4f 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 _0x66da=['../../mysqldb','MailAccount','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x3cc727,_0x251d2c){var _0x3def0c=function(_0x1d8758){while(--_0x1d8758){_0x3cc727['push'](_0x3cc727['shift']());}};_0x3def0c(++_0x251d2c);}(_0x66da,0x16f));var _0xa66d=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x66da[_0x145b3c];return _0x1b6e36;};'use strict';var EventEmitter=require(_0xa66d('0x0'));var MailAccount=require(_0xa66d('0x1'))['db'][_0xa66d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xa66d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17b831){return function(_0x950036,_0x1326e8,_0x436606){MailAccountEvents[_0xa66d('0x4')](_0x17b831+':'+_0x950036['id'],_0x950036);MailAccountEvents['emit'](_0x17b831,_0x950036);_0x436606(null);};}for(var e in events){if(events[_0xa66d('0x5')](e)){var event=events[e];MailAccount[_0xa66d('0x6')](e,emitEvent(event));}}module[_0xa66d('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x258c=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x258c,0x168));var _0xc258=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x258c[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc258('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc258('0x1')](0x0);var events={'afterCreate':_0xc258('0x2'),'afterUpdate':_0xc258('0x3'),'afterDestroy':_0xc258('0x4')};function emitEvent(_0x5eb02f){return function(_0x163cdc,_0x193b6d,_0x2130d0){MailAccountEvents[_0xc258('0x5')](_0x5eb02f+':'+_0x163cdc['id'],_0x163cdc);MailAccountEvents['emit'](_0x5eb02f,_0x163cdc);_0x2130d0(null);};}for(var e in events){if(events[_0xc258('0x6')](e)){var event=events[e];MailAccount[_0xc258('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6dc1de7..ba35548 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 _0x908e=['util','api','moment','request-promise','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash'];(function(_0x3aaec6,_0xfa366d){var _0x248f6b=function(_0x2bbf4d){while(--_0x2bbf4d){_0x3aaec6['push'](_0x3aaec6['shift']());}};_0x248f6b(++_0xfa366d);}(_0x908e,0x83));var _0xe908=function(_0x2db328,_0xf8e678){_0x2db328=_0x2db328-0x0;var _0x15b8b5=_0x908e[_0x2db328];return _0x15b8b5;};'use strict';var _=require(_0xe908('0x0'));var util=require(_0xe908('0x1'));var logger=require('../../config/logger')(_0xe908('0x2'));var moment=require(_0xe908('0x3'));var BPromise=require('bluebird');var rp=require(_0xe908('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe908('0x5'));var attributes=require(_0xe908('0x6'));module[_0xe908('0x7')]=function(_0x5174cc,_0x3a1695){return _0x5174cc[_0xe908('0x8')](_0xe908('0x9'),attributes,{'tableName':_0xe908('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b9f=['./mailAccount.attributes','exports','MailAccount','mail_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b9f,0xd0));var _0xf5b9=function(_0x472eec,_0x4a4c57){_0x472eec=_0x472eec-0x0;var _0x14206c=_0x5b9f[_0x472eec];return _0x14206c;};'use strict';var _=require('lodash');var util=require(_0xf5b9('0x0'));var logger=require(_0xf5b9('0x1'))('api');var moment=require(_0xf5b9('0x2'));var BPromise=require(_0xf5b9('0x3'));var rp=require(_0xf5b9('0x4'));var fs=require('fs');var path=require(_0xf5b9('0x5'));var rimraf=require(_0xf5b9('0x6'));var config=require(_0xf5b9('0x7'));var attributes=require(_0xf5b9('0x8'));module[_0xf5b9('0x9')]=function(_0x2d6200,_0x1fddac){return _0x2d6200['define'](_0xf5b9('0xa'),attributes,{'tableName':_0xf5b9('0xb'),'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 e0835f4..4ba8435 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 _0x895c=['mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','list','orderBy','applications','asc','autoclose','push','length','close','*,*,*,*','create','contact','generate','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','agent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','find','ShowMailAccount','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','ListId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil'];(function(_0x1cf7d8,_0x359279){var _0xddd51c=function(_0x27006f){while(--_0x27006f){_0x1cf7d8['push'](_0x1cf7d8['shift']());}};_0xddd51c(++_0x359279);}(_0x895c,0x109));var _0xc895=function(_0x27ddd3,_0x22fee7){_0x27ddd3=_0x27ddd3-0x0;var _0x304252=_0x895c[_0x27ddd3];return _0x304252;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc895('0x0'));var BPromise=require(_0xc895('0x1'));var rs=require(_0xc895('0x2'));var fs=require('fs');var Redis=require(_0xc895('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc895('0x4'));var logger=require(_0xc895('0x5'))(_0xc895('0x6'));var config=require(_0xc895('0x7'));var jayson=require(_0xc895('0x8'));var client=jayson[_0xc895('0x9')][_0xc895('0xa')]({'port':0x232c});config[_0xc895('0xb')]=_[_0xc895('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc895('0xd'))(new Redis(config[_0xc895('0xb')]));require('./mailAccount.socket')[_0xc895('0xe')](socket);function respondWithRpcPromise(_0x5cf5db,_0x4a00d5,_0x2b0a76){return new BPromise(function(_0x584bd5,_0x2c5476){return client[_0xc895('0xf')](_0x5cf5db,_0x2b0a76)[_0xc895('0x10')](function(_0x65a124){logger[_0xc895('0x11')](_0xc895('0x12'),_0x4a00d5,_0xc895('0x13'));logger[_0xc895('0x14')](_0xc895('0x15'),_0x4a00d5,_0xc895('0x13'),JSON[_0xc895('0x16')](_0x65a124));if(_0x65a124['error']){if(_0x65a124['error']['code']===0x1f4){logger[_0xc895('0x17')](_0xc895('0x12'),_0x4a00d5,_0x65a124[_0xc895('0x17')][_0xc895('0x18')]);return _0x2c5476(_0x65a124[_0xc895('0x17')][_0xc895('0x18')]);}logger['error'](_0xc895('0x12'),_0x4a00d5,_0x65a124[_0xc895('0x17')]['message']);return _0x584bd5(_0x65a124[_0xc895('0x17')][_0xc895('0x18')]);}else{logger[_0xc895('0x11')]('MailAccount,\x20%s,\x20%s',_0x4a00d5,_0xc895('0x13'));_0x584bd5(_0x65a124[_0xc895('0x19')][_0xc895('0x18')]);}})[_0xc895('0x1a')](function(_0x4d3f7f){logger['error']('MailAccount,\x20%s,\x20%s',_0x4a00d5,_0x4d3f7f);_0x2c5476(_0x4d3f7f);});});}exports[_0xc895('0x1b')]=function(_0x250b73){var _0x4e9fe8=this;return new Promise(function(_0x58b60b,_0x21d84d){return db[_0xc895('0x1c')][_0xc895('0x1d')]({'raw':_0x250b73[_0xc895('0x1e')]?_0x250b73[_0xc895('0x1e')][_0xc895('0x1f')]===undefined?!![]:![]:!![],'where':_0x250b73[_0xc895('0x1e')]?_0x250b73['options'][_0xc895('0x20')]||null:null,'attributes':_0x250b73['options']?_0x250b73[_0xc895('0x1e')][_0xc895('0x21')]||null:null,'limit':_0x250b73[_0xc895('0x1e')]?_0x250b73[_0xc895('0x1e')][_0xc895('0x22')]||null:null,'include':_0x250b73[_0xc895('0x1e')]?_0x250b73['options']['include']?_[_0xc895('0x23')](_0x250b73[_0xc895('0x1e')][_0xc895('0x24')],function(_0x2cb179){return{'model':db[_0x2cb179[_0xc895('0x25')]],'as':_0x2cb179['as'],'attributes':_0x2cb179[_0xc895('0x21')],'include':_0x2cb179[_0xc895('0x24')]?_[_0xc895('0x23')](_0x2cb179[_0xc895('0x24')],function(_0x4e238c){return{'model':db[_0x4e238c[_0xc895('0x25')]],'as':_0x4e238c['as'],'attributes':_0x4e238c[_0xc895('0x21')],'include':_0x4e238c['include']?_[_0xc895('0x23')](_0x4e238c[_0xc895('0x24')],function(_0x2ac0d3){return{'model':db[_0x2ac0d3[_0xc895('0x25')]],'as':_0x2ac0d3['as'],'attributes':_0x2ac0d3[_0xc895('0x21')]};}):[]};}):[]};}):[]:[]})[_0xc895('0x10')](function(_0x45fa69){logger[_0xc895('0x11')](_0xc895('0x1b'),_0x250b73);logger[_0xc895('0x14')](_0xc895('0x1b'),_0x250b73,JSON[_0xc895('0x16')](_0x45fa69));_0x58b60b(_0x45fa69);})[_0xc895('0x1a')](function(_0x5ae688){logger[_0xc895('0x17')](_0xc895('0x1b'),_0x5ae688['message'],_0x250b73);_0x21d84d(_0x4e9fe8[_0xc895('0x17')](0x1f4,_0x5ae688[_0xc895('0x18')]));});});};exports['ShowMailAccount']=function(_0x4d2f70){var _0x2e3fe4=this;return new Promise(function(_0x19199b,_0x2453c3){return db[_0xc895('0x1c')][_0xc895('0x26')]({'raw':_0x4d2f70['options']?_0x4d2f70[_0xc895('0x1e')][_0xc895('0x1f')]===undefined?!![]:![]:!![],'where':_0x4d2f70[_0xc895('0x1e')]?_0x4d2f70[_0xc895('0x1e')][_0xc895('0x20')]||null:null,'attributes':_0x4d2f70[_0xc895('0x1e')]?_0x4d2f70['options'][_0xc895('0x21')]||null:null,'include':_0x4d2f70[_0xc895('0x1e')]?_0x4d2f70['options'][_0xc895('0x24')]?_['map'](_0x4d2f70[_0xc895('0x1e')][_0xc895('0x24')],function(_0x454eae){return{'model':db[_0x454eae[_0xc895('0x25')]],'as':_0x454eae['as'],'attributes':_0x454eae[_0xc895('0x21')],'include':_0x454eae[_0xc895('0x24')]?_['map'](_0x454eae[_0xc895('0x24')],function(_0x2b44e1){return{'model':db[_0x2b44e1['model']],'as':_0x2b44e1['as'],'attributes':_0x2b44e1[_0xc895('0x21')],'include':_0x2b44e1[_0xc895('0x24')]?_[_0xc895('0x23')](_0x2b44e1['include'],function(_0x51d843){return{'model':db[_0x51d843['model']],'as':_0x51d843['as'],'attributes':_0x51d843[_0xc895('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x386704){logger['info'](_0xc895('0x27'),_0x4d2f70);logger[_0xc895('0x14')]('ShowMailAccount',_0x4d2f70,JSON['stringify'](_0x386704));_0x19199b(_0x386704);})[_0xc895('0x1a')](function(_0x346d72){logger[_0xc895('0x17')](_0xc895('0x27'),_0x346d72[_0xc895('0x18')],_0x4d2f70);_0x2453c3(_0x2e3fe4[_0xc895('0x17')](0x1f4,_0x346d72[_0xc895('0x18')]));});});};exports[_0xc895('0x28')]=function(_0x17edda){var _0x4ceab7=this;return new Promise(function(_0x299cc6,_0x559873){var _0x5f03a2={'body':_0x17edda['body'],'channel':_0xc895('0x29')};var _0x2f1b82=_[_0xc895('0x2a')](_[_0xc895('0x2b')](db[_0xc895('0x2c')][_0xc895('0x2d')]),[_0xc895('0x2e'),'updatedAt','CompanyId',_0xc895('0x2f')]);var _0x22f10b=![];if(_0x17edda[_0xc895('0x30')]['id']){delete _0x17edda[_0xc895('0x30')]['id'];}if(_['isNil'](_0x17edda[_0xc895('0x30')][_0xc895('0x31')])){return _0x559873(_0x4ceab7['error'](0x1f4,_0xc895('0x32')));}if(_['isNil'](_0x17edda[_0xc895('0x30')]['body'])||_0x17edda[_0xc895('0x30')][_0xc895('0x30')]===''){return _0x559873(_0x4ceab7[_0xc895('0x17')](0x1f4,_0xc895('0x33')));}if(_[_0xc895('0x34')](_0x17edda[_0xc895('0x30')][_0xc895('0x35')])){return _0x559873(_0x4ceab7[_0xc895('0x17')](0x1f4,_0xc895('0x36')+_0x2f1b82));}if(!_['includes'](_0x2f1b82,_0x17edda[_0xc895('0x30')][_0xc895('0x35')])){return _0x559873(_0x4ceab7[_0xc895('0x17')](0x1f4,_0xc895('0x37')+_0x2f1b82));}var _0x38f919={};_0x38f919[_0x17edda[_0xc895('0x30')]['mapKey']]=_0x17edda[_0xc895('0x30')]['from'];return db[_0xc895('0x1c')][_0xc895('0x26')]({'where':{'id':_0x17edda[_0xc895('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0xc895('0x39'),'include':[{'model':db[_0xc895('0x2c')],'as':_0xc895('0x3a'),'where':_0x38f919,'limit':0x1,'order':[[_0xc895('0x3b'),_0xc895('0x3c')]]}]},{'model':db[_0xc895('0x3d')],'as':_0xc895('0x3e')},{'model':db[_0xc895('0x3f')],'as':_0xc895('0x40')}]})[_0xc895('0x10')](function(_0xf55269){if(_0xf55269&&_0xf55269[_0xc895('0x39')]){var _0x1428b3=_0xf55269[_0xc895('0x41')]({'plain':!![]});_0x5f03a2[_0xc895('0x38')]=_[_0xc895('0x42')](_0x1428b3,[_0xc895('0x3e'),_0xc895('0x39')]);_0x5f03a2['applications']=_0x1428b3[_0xc895('0x3e')];_0x5f03a2[_0xc895('0x43')]=_0x1428b3[_0xc895('0x39')];_0x5f03a2['applications']=_[_0xc895('0x44')](_0x5f03a2[_0xc895('0x45')],['priority'],[_0xc895('0x46')]);if(_0x5f03a2[_0xc895('0x38')]&&_0x5f03a2[_0xc895('0x38')][_0xc895('0x47')]){_0x5f03a2[_0xc895('0x45')][_0xc895('0x48')]({'id':0x0,'priority':_0x5f03a2[_0xc895('0x45')][_0xc895('0x49')]+0x1,'app':_0xc895('0x4a'),'appdata':_0xc895('0x47'),'interval':_0xc895('0x4b')});}if(_0x5f03a2[_0xc895('0x38')][_0xc895('0x3e')]){delete _0x5f03a2[_0xc895('0x38')][_0xc895('0x3e')];}if(_0x5f03a2[_0xc895('0x38')][_0xc895('0x39')]){delete _0x5f03a2[_0xc895('0x38')][_0xc895('0x39')];}if(_0x1428b3['List']['Contacts'][_0xc895('0x49')]){return _0x1428b3['List']['Contacts'][0x0];}var _0x5a0176=_[_0xc895('0xc')](_0x17edda[_0xc895('0x30')],{'firstName':_0x17edda[_0xc895('0x30')][_0xc895('0x31')],'ListId':_0x1428b3['ListId']});_0x5a0176[_0x17edda[_0xc895('0x30')][_0xc895('0x35')]]=_0x17edda[_0xc895('0x30')][_0xc895('0x31')];return db[_0xc895('0x2c')][_0xc895('0x4c')](_0x5a0176);}else{throw new Error('List\x20not\x20found');}})[_0xc895('0x10')](function(_0x421a59){_0x5f03a2[_0xc895('0x4d')]=_0x421a59;if(_0x421a59){if(!_0x17edda['body'][_0xc895('0x18')]['messageId']){_0x17edda['body'][_0xc895('0x18')]['messageId']=rs[_0xc895('0x4e')]()+'\x20'+_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x31')];}var _0x386eaf={'ContactId':_0x421a59['id'],'MailAccountId':_0x17edda[_0xc895('0x38')]['id'],'inReplyTo':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x4f')],'to':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x31')],'cc':_0x17edda[_0xc895('0x30')][_0xc895('0x18')]['cc'],'subject':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x50')],'attach':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x51')],'lastMsgAt':moment()[_0xc895('0x52')](_0xc895('0x53')),'lastMsgDirection':'in'};return db[_0xc895('0x54')][_0xc895('0x26')]({'where':{'closed':![],'MailAccountId':_0x17edda[_0xc895('0x38')]['id']},'include':[{'model':db[_0xc895('0x55')],'as':_0xc895('0x56'),'attributes':[_0xc895('0x4f')],'where':{'messageId':_0x17edda[_0xc895('0x30')]['message'][_0xc895('0x57')]}}]})[_0xc895('0x10')](function(_0x391713){if(_0x391713){return[_0x391713,![]];}return db[_0xc895('0x54')][_0xc895('0x4c')](_0x386eaf)[_0xc895('0x10')](function(_0x4cfe51){return[_0x4cfe51,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xc895('0x58')](function(_0x19af00,_0x5bce66){if(_0x19af00){_0x22f10b=_0x5bce66;if(!_0x5bce66){return _0x19af00[_0xc895('0x59')]({'inReplyTo':_0x17edda[_0xc895('0x30')]['message']['messageId'],'to':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x31')],'cc':_0x17edda['body'][_0xc895('0x18')]['cc'],'subject':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x50')],'attach':_0x19af00[_0xc895('0x51')]?_0x19af00[_0xc895('0x51')]:_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x51')],'substatus':null,'substatusAt':moment()[_0xc895('0x52')](_0xc895('0x53')),'lastMsgAt':moment()['format'](_0xc895('0x53')),'lastMsgDirection':'in'});}else{return _0x19af00;}}})[_0xc895('0x10')](function(_0x588e89){_0x5f03a2[_0xc895('0x5a')]=_0x588e89[_0xc895('0x41')]({'plain':!![]});_0x5f03a2[_0xc895('0x5a')][_0xc895('0x5b')]=_0x22f10b;return db[_0xc895('0x55')][_0xc895('0x4c')]({'body':_0x17edda[_0xc895('0x30')]['body'],'MailAccountId':_0x17edda[_0xc895('0x38')]['id'],'MailInteractionId':_0x588e89['id'],'direction':'in','ContactId':_0x5f03a2[_0xc895('0x4d')]['id'],'messageId':_0x17edda['body']['message'][_0xc895('0x4f')],'from':_0x17edda[_0xc895('0x30')][_0xc895('0x18')]['from'],'to':_0x17edda['body'][_0xc895('0x18')]['to'],'cc':_0x17edda[_0xc895('0x30')][_0xc895('0x18')]['cc'],'subject':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x50')],'attach':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x51')],'Attachments':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x5c')],'originTo':_0x17edda[_0xc895('0x30')]['message']['originTo'],'originCc':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x5d')],'bcc':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x5e')],'ChatWebsiteId':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x5f')]||null,'originChannel':_0x17edda['body'][_0xc895('0x18')][_0xc895('0x60')]||'Email','ChatOfflineMessageId':_0x17edda[_0xc895('0x30')][_0xc895('0x18')][_0xc895('0x61')]||null},{'include':[{'model':db[_0xc895('0x62')],'as':_0xc895('0x63')}]});})['then'](function(_0x138719){_0x5f03a2[_0xc895('0x18')]=_0x138719;if(_0x5f03a2[_0xc895('0x5a')]['UserId']){return db[_0xc895('0x64')][_0xc895('0x26')]({'attributes':['id',_0xc895('0x65')],'where':{'id':_0x5f03a2[_0xc895('0x5a')][_0xc895('0x66')]}})[_0xc895('0x10')](function(_0x3395c5){if(_0x3395c5){_0x5f03a2[_0xc895('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc895('0x67'),'appdata':_0x3395c5[_0xc895('0x65')]+','+(_0x5f03a2[_0xc895('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0xc895('0x4b')});}return respondWithRpcPromise(_0xc895('0x68'),'startRouting',_0x5f03a2);});}return respondWithRpcPromise(_0xc895('0x68'),_0xc895('0x69'),_0x5f03a2);})['then'](function(_0x75d1c){_0x299cc6(_0x75d1c);})[_0xc895('0x1a')](function(_0x50d24a){_0x559873(_0x4ceab7[_0xc895('0x17')](0x1f4,_0x50d24a['message']));});});}; \ No newline at end of file +var _0x5b4a=['ChatOfflineMessageId','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','MailAccount','options','raw','where','attributes','limit','include','map','model','GetMailAccount','catch','ShowMailAccount','find','NotifyMailAccount','keys','rawAttributes','createdAt','updatedAt','CompanyId','body','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','account','CmList','CmContact','Contacts','MailApplication','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','defaults','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','update','interaction','MailMessage','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email'];(function(_0x2a9a31,_0x4eac39){var _0x4c5035=function(_0x1c6d84){while(--_0x1c6d84){_0x2a9a31['push'](_0x2a9a31['shift']());}};_0x4c5035(++_0x4eac39);}(_0x5b4a,0x70));var _0xa5b4=function(_0x5c094f,_0x5e752b){_0x5c094f=_0x5c094f-0x0;var _0x37b476=_0x5b4a[_0x5c094f];return _0x37b476;};'use strict';var _=require(_0xa5b4('0x0'));var util=require('util');var moment=require(_0xa5b4('0x1'));var BPromise=require(_0xa5b4('0x2'));var rs=require(_0xa5b4('0x3'));var fs=require('fs');var Redis=require(_0xa5b4('0x4'));var db=require(_0xa5b4('0x5'))['db'];var utils=require(_0xa5b4('0x6'));var logger=require(_0xa5b4('0x7'))('rpc');var config=require(_0xa5b4('0x8'));var jayson=require(_0xa5b4('0x9'));var client=jayson[_0xa5b4('0xa')][_0xa5b4('0xb')]({'port':0x232c});config[_0xa5b4('0xc')]=_['defaults'](config[_0xa5b4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5b4('0xd'))(new Redis(config[_0xa5b4('0xc')]));require('./mailAccount.socket')[_0xa5b4('0xe')](socket);function respondWithRpcPromise(_0x7eeb5a,_0xc207bc,_0x57cc64){return new BPromise(function(_0x3fedba,_0x23ed4b){return client[_0xa5b4('0xf')](_0x7eeb5a,_0x57cc64)[_0xa5b4('0x10')](function(_0x3e47fc){logger[_0xa5b4('0x11')](_0xa5b4('0x12'),_0xc207bc,'request\x20sent');logger[_0xa5b4('0x13')](_0xa5b4('0x14'),_0xc207bc,_0xa5b4('0x15'),JSON[_0xa5b4('0x16')](_0x3e47fc));if(_0x3e47fc[_0xa5b4('0x17')]){if(_0x3e47fc['error'][_0xa5b4('0x18')]===0x1f4){logger[_0xa5b4('0x17')](_0xa5b4('0x12'),_0xc207bc,_0x3e47fc[_0xa5b4('0x17')]['message']);return _0x23ed4b(_0x3e47fc[_0xa5b4('0x17')][_0xa5b4('0x19')]);}logger[_0xa5b4('0x17')](_0xa5b4('0x12'),_0xc207bc,_0x3e47fc['error'][_0xa5b4('0x19')]);return _0x3fedba(_0x3e47fc[_0xa5b4('0x17')]['message']);}else{logger[_0xa5b4('0x11')](_0xa5b4('0x12'),_0xc207bc,_0xa5b4('0x15'));_0x3fedba(_0x3e47fc[_0xa5b4('0x1a')][_0xa5b4('0x19')]);}})['catch'](function(_0x59ca3b){logger[_0xa5b4('0x17')]('MailAccount,\x20%s,\x20%s',_0xc207bc,_0x59ca3b);_0x23ed4b(_0x59ca3b);});});}exports['GetMailAccount']=function(_0x505bbc){var _0x2c4ada=this;return new Promise(function(_0x4a8172,_0x573953){return db[_0xa5b4('0x1b')]['findAll']({'raw':_0x505bbc[_0xa5b4('0x1c')]?_0x505bbc[_0xa5b4('0x1c')][_0xa5b4('0x1d')]===undefined?!![]:![]:!![],'where':_0x505bbc[_0xa5b4('0x1c')]?_0x505bbc['options'][_0xa5b4('0x1e')]||null:null,'attributes':_0x505bbc[_0xa5b4('0x1c')]?_0x505bbc[_0xa5b4('0x1c')][_0xa5b4('0x1f')]||null:null,'limit':_0x505bbc[_0xa5b4('0x1c')]?_0x505bbc['options'][_0xa5b4('0x20')]||null:null,'include':_0x505bbc['options']?_0x505bbc['options'][_0xa5b4('0x21')]?_[_0xa5b4('0x22')](_0x505bbc[_0xa5b4('0x1c')][_0xa5b4('0x21')],function(_0x4e3bab){return{'model':db[_0x4e3bab[_0xa5b4('0x23')]],'as':_0x4e3bab['as'],'attributes':_0x4e3bab[_0xa5b4('0x1f')],'include':_0x4e3bab[_0xa5b4('0x21')]?_[_0xa5b4('0x22')](_0x4e3bab[_0xa5b4('0x21')],function(_0x3417a8){return{'model':db[_0x3417a8[_0xa5b4('0x23')]],'as':_0x3417a8['as'],'attributes':_0x3417a8['attributes'],'include':_0x3417a8[_0xa5b4('0x21')]?_['map'](_0x3417a8[_0xa5b4('0x21')],function(_0x21a625){return{'model':db[_0x21a625['model']],'as':_0x21a625['as'],'attributes':_0x21a625[_0xa5b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa5b4('0x10')](function(_0xf53133){logger[_0xa5b4('0x11')]('GetMailAccount',_0x505bbc);logger[_0xa5b4('0x13')](_0xa5b4('0x24'),_0x505bbc,JSON['stringify'](_0xf53133));_0x4a8172(_0xf53133);})[_0xa5b4('0x25')](function(_0x2aaf5a){logger[_0xa5b4('0x17')]('GetMailAccount',_0x2aaf5a[_0xa5b4('0x19')],_0x505bbc);_0x573953(_0x2c4ada[_0xa5b4('0x17')](0x1f4,_0x2aaf5a['message']));});});};exports[_0xa5b4('0x26')]=function(_0x2dd033){var _0x5122f0=this;return new Promise(function(_0x15e3be,_0x48cdf6){return db[_0xa5b4('0x1b')][_0xa5b4('0x27')]({'raw':_0x2dd033[_0xa5b4('0x1c')]?_0x2dd033[_0xa5b4('0x1c')][_0xa5b4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2dd033[_0xa5b4('0x1c')]?_0x2dd033[_0xa5b4('0x1c')][_0xa5b4('0x1e')]||null:null,'attributes':_0x2dd033[_0xa5b4('0x1c')]?_0x2dd033[_0xa5b4('0x1c')][_0xa5b4('0x1f')]||null:null,'include':_0x2dd033[_0xa5b4('0x1c')]?_0x2dd033[_0xa5b4('0x1c')][_0xa5b4('0x21')]?_[_0xa5b4('0x22')](_0x2dd033[_0xa5b4('0x1c')][_0xa5b4('0x21')],function(_0x208047){return{'model':db[_0x208047[_0xa5b4('0x23')]],'as':_0x208047['as'],'attributes':_0x208047[_0xa5b4('0x1f')],'include':_0x208047[_0xa5b4('0x21')]?_[_0xa5b4('0x22')](_0x208047[_0xa5b4('0x21')],function(_0x394ea6){return{'model':db[_0x394ea6['model']],'as':_0x394ea6['as'],'attributes':_0x394ea6[_0xa5b4('0x1f')],'include':_0x394ea6['include']?_['map'](_0x394ea6[_0xa5b4('0x21')],function(_0xfae5aa){return{'model':db[_0xfae5aa[_0xa5b4('0x23')]],'as':_0xfae5aa['as'],'attributes':_0xfae5aa[_0xa5b4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa5b4('0x10')](function(_0x22d28a){logger[_0xa5b4('0x11')](_0xa5b4('0x26'),_0x2dd033);logger[_0xa5b4('0x13')](_0xa5b4('0x26'),_0x2dd033,JSON[_0xa5b4('0x16')](_0x22d28a));_0x15e3be(_0x22d28a);})[_0xa5b4('0x25')](function(_0x18150a){logger['error'](_0xa5b4('0x26'),_0x18150a[_0xa5b4('0x19')],_0x2dd033);_0x48cdf6(_0x5122f0['error'](0x1f4,_0x18150a['message']));});});};exports[_0xa5b4('0x28')]=function(_0x11c20e){var _0x25e64c=this;return new Promise(function(_0xf7c71b,_0x344bf6){var _0x4832b3={'body':_0x11c20e['body'],'channel':'mail'};var _0x32a65b=_['difference'](_[_0xa5b4('0x29')](db['CmContact'][_0xa5b4('0x2a')]),[_0xa5b4('0x2b'),_0xa5b4('0x2c'),_0xa5b4('0x2d'),'ListId']);var _0x168425=![];if(_0x11c20e[_0xa5b4('0x2e')]['id']){delete _0x11c20e[_0xa5b4('0x2e')]['id'];}if(_[_0xa5b4('0x2f')](_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x30')])){return _0x344bf6(_0x25e64c[_0xa5b4('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x2e')])||_0x11c20e[_0xa5b4('0x2e')]['body']===''){return _0x344bf6(_0x25e64c['error'](0x1f4,_0xa5b4('0x31')));}if(_[_0xa5b4('0x2f')](_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x32')])){return _0x344bf6(_0x25e64c[_0xa5b4('0x17')](0x1f4,_0xa5b4('0x33')+_0x32a65b));}if(!_[_0xa5b4('0x34')](_0x32a65b,_0x11c20e[_0xa5b4('0x2e')]['mapKey'])){return _0x344bf6(_0x25e64c[_0xa5b4('0x17')](0x1f4,_0xa5b4('0x35')+_0x32a65b));}var _0x37b36c={};_0x37b36c[_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x32')]]=_0x11c20e[_0xa5b4('0x2e')]['from'];return db['MailAccount'][_0xa5b4('0x27')]({'where':{'id':_0x11c20e[_0xa5b4('0x36')]['id']},'include':[{'model':db[_0xa5b4('0x37')],'as':'List','include':[{'model':db[_0xa5b4('0x38')],'as':_0xa5b4('0x39'),'where':_0x37b36c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xa5b4('0x3a')],'as':_0xa5b4('0x3b')},{'model':db[_0xa5b4('0x3c')],'as':_0xa5b4('0x3d')}]})[_0xa5b4('0x10')](function(_0x339907){if(_0x339907&&_0x339907[_0xa5b4('0x3e')]){var _0x3a0cae=_0x339907[_0xa5b4('0x3f')]({'plain':!![]});_0x4832b3[_0xa5b4('0x36')]=_[_0xa5b4('0x40')](_0x3a0cae,['Applications',_0xa5b4('0x3e')]);_0x4832b3[_0xa5b4('0x41')]=_0x3a0cae[_0xa5b4('0x3b')];_0x4832b3[_0xa5b4('0x42')]=_0x3a0cae[_0xa5b4('0x3e')];_0x4832b3[_0xa5b4('0x41')]=_[_0xa5b4('0x43')](_0x4832b3[_0xa5b4('0x41')],[_0xa5b4('0x44')],[_0xa5b4('0x45')]);if(_0x4832b3[_0xa5b4('0x36')]&&_0x4832b3[_0xa5b4('0x36')][_0xa5b4('0x46')]){_0x4832b3[_0xa5b4('0x41')][_0xa5b4('0x47')]({'id':0x0,'priority':_0x4832b3[_0xa5b4('0x41')][_0xa5b4('0x48')]+0x1,'app':'close','appdata':_0xa5b4('0x46'),'interval':_0xa5b4('0x49')});}if(_0x4832b3[_0xa5b4('0x36')][_0xa5b4('0x3b')]){delete _0x4832b3[_0xa5b4('0x36')][_0xa5b4('0x3b')];}if(_0x4832b3[_0xa5b4('0x36')]['List']){delete _0x4832b3[_0xa5b4('0x36')]['List'];}if(_0x3a0cae[_0xa5b4('0x3e')][_0xa5b4('0x39')][_0xa5b4('0x48')]){return _0x3a0cae[_0xa5b4('0x3e')]['Contacts'][0x0];}var _0x2b3f5b=_[_0xa5b4('0x4a')](_0x11c20e[_0xa5b4('0x2e')],{'firstName':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x30')],'ListId':_0x3a0cae[_0xa5b4('0x4b')]});_0x2b3f5b[_0x11c20e['body'][_0xa5b4('0x32')]]=_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x30')];return db[_0xa5b4('0x38')][_0xa5b4('0x4c')](_0x2b3f5b);}else{throw new Error(_0xa5b4('0x4d'));}})[_0xa5b4('0x10')](function(_0x4a338c){_0x4832b3[_0xa5b4('0x4e')]=_0x4a338c;if(_0x4a338c){if(!_0x11c20e['body'][_0xa5b4('0x19')][_0xa5b4('0x4f')]){_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x4f')]=rs[_0xa5b4('0x50')]()+'\x20'+_0x11c20e[_0xa5b4('0x2e')]['message'][_0xa5b4('0x30')];}var _0x41cc4a={'ContactId':_0x4a338c['id'],'MailAccountId':_0x11c20e[_0xa5b4('0x36')]['id'],'inReplyTo':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x4f')],'to':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x30')],'cc':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['cc'],'subject':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x51')],'attach':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x52')],'lastMsgAt':moment()[_0xa5b4('0x53')](_0xa5b4('0x54')),'lastMsgDirection':'in'};return db[_0xa5b4('0x55')][_0xa5b4('0x27')]({'where':{'closed':![],'MailAccountId':_0x11c20e[_0xa5b4('0x36')]['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['inReplyTo']}}]})['then'](function(_0x16dfa7){if(_0x16dfa7){return[_0x16dfa7,![]];}return db[_0xa5b4('0x55')][_0xa5b4('0x4c')](_0x41cc4a)[_0xa5b4('0x10')](function(_0x3ec319){return[_0x3ec319,!![]];});});}else{throw new Error(_0xa5b4('0x56'));}})['spread'](function(_0x50dd27,_0x55972e){if(_0x50dd27){_0x168425=_0x55972e;if(!_0x55972e){return _0x50dd27[_0xa5b4('0x57')]({'inReplyTo':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x4f')],'to':_0x11c20e['body'][_0xa5b4('0x19')][_0xa5b4('0x30')],'cc':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['cc'],'subject':_0x11c20e[_0xa5b4('0x2e')]['message'][_0xa5b4('0x51')],'attach':_0x50dd27[_0xa5b4('0x52')]?_0x50dd27['attach']:_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x52')],'substatus':null,'substatusAt':moment()[_0xa5b4('0x53')](_0xa5b4('0x54')),'lastMsgAt':moment()[_0xa5b4('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x50dd27;}}})[_0xa5b4('0x10')](function(_0x3a79de){_0x4832b3[_0xa5b4('0x58')]=_0x3a79de[_0xa5b4('0x3f')]({'plain':!![]});_0x4832b3['interaction']['created']=_0x168425;return db[_0xa5b4('0x59')][_0xa5b4('0x4c')]({'body':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x2e')],'MailAccountId':_0x11c20e['account']['id'],'MailInteractionId':_0x3a79de['id'],'direction':'in','ContactId':_0x4832b3[_0xa5b4('0x4e')]['id'],'messageId':_0x11c20e['body'][_0xa5b4('0x19')]['messageId'],'from':_0x11c20e[_0xa5b4('0x2e')]['message'][_0xa5b4('0x30')],'to':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['to'],'cc':_0x11c20e[_0xa5b4('0x2e')]['message']['cc'],'subject':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['subject'],'attach':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['attach'],'Attachments':_0x11c20e['body'][_0xa5b4('0x19')][_0xa5b4('0x5a')],'originTo':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')]['originTo'],'originCc':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x5b')],'bcc':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x5c')],'ChatWebsiteId':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x5d')]||null,'originChannel':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x5e')]||_0xa5b4('0x5f'),'ChatOfflineMessageId':_0x11c20e[_0xa5b4('0x2e')][_0xa5b4('0x19')][_0xa5b4('0x60')]||null},{'include':[{'model':db['Attachment'],'as':_0xa5b4('0x61')}]});})[_0xa5b4('0x10')](function(_0x57b36a){_0x4832b3[_0xa5b4('0x19')]=_0x57b36a;if(_0x4832b3[_0xa5b4('0x58')][_0xa5b4('0x62')]){return db['User'][_0xa5b4('0x27')]({'attributes':['id','name'],'where':{'id':_0x4832b3[_0xa5b4('0x58')][_0xa5b4('0x62')]}})[_0xa5b4('0x10')](function(_0x30a947){if(_0x30a947){_0x4832b3[_0xa5b4('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa5b4('0x63'),'appdata':_0x30a947[_0xa5b4('0x64')]+','+(_0x4832b3['account'][_0xa5b4('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa5b4('0x66'),_0xa5b4('0x67'),_0x4832b3);});}return respondWithRpcPromise(_0xa5b4('0x66'),_0xa5b4('0x67'),_0x4832b3);})[_0xa5b4('0x10')](function(_0x1ba33a){_0xf7c71b(_0x1ba33a);})[_0xa5b4('0x25')](function(_0x28c328){_0x344bf6(_0x25e64c[_0xa5b4('0x17')](0x1f4,_0x28c328[_0xa5b4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 70c2821..bfe63cd 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 _0xc7c7=['./mailAccount.events','remove','update','emit','removeListener','length'];(function(_0x38bd32,_0x59e86d){var _0x55f9c4=function(_0x145cbb){while(--_0x145cbb){_0x38bd32['push'](_0x38bd32['shift']());}};_0x55f9c4(++_0x59e86d);}(_0xc7c7,0x1d4));var _0x7c7c=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc7c7[_0x56482c];return _0x5aae7a;};'use strict';var MailAccountEvents=require(_0x7c7c('0x0'));var events=['save',_0x7c7c('0x1'),_0x7c7c('0x2')];function createListener(_0x4d1948,_0x363c45){return function(_0x4ee5bc){_0x363c45[_0x7c7c('0x3')](_0x4d1948,_0x4ee5bc);};}function removeListener(_0x31cbfd,_0x28d270){return function(){MailAccountEvents[_0x7c7c('0x4')](_0x31cbfd,_0x28d270);};}exports['register']=function(_0x1c3ff9){for(var _0x5d76fd=0x0,_0xe8fed9=events[_0x7c7c('0x5')];_0x5d76fd<_0xe8fed9;_0x5d76fd++){var _0x431a72=events[_0x5d76fd];var _0x3da0ed=createListener('mailAccount:'+_0x431a72,_0x1c3ff9);MailAccountEvents['on'](_0x431a72,_0x3da0ed);}}; \ No newline at end of file +var _0xb396=['remove','update','emit','removeListener','mailAccount:','./mailAccount.events','save'];(function(_0x5cb532,_0x1a8d65){var _0x3bcb0b=function(_0x2f9151){while(--_0x2f9151){_0x5cb532['push'](_0x5cb532['shift']());}};_0x3bcb0b(++_0x1a8d65);}(_0xb396,0x1e8));var _0x6b39=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb396[_0xa464c9];return _0x3d73c4;};'use strict';var MailAccountEvents=require(_0x6b39('0x0'));var events=[_0x6b39('0x1'),_0x6b39('0x2'),_0x6b39('0x3')];function createListener(_0x583ce5,_0x1dd64c){return function(_0x17a631){_0x1dd64c[_0x6b39('0x4')](_0x583ce5,_0x17a631);};}function removeListener(_0x3da3b4,_0x35b9b1){return function(){MailAccountEvents[_0x6b39('0x5')](_0x3da3b4,_0x35b9b1);};}exports['register']=function(_0x474aa8){for(var _0x48fbca=0x0,_0x3d5572=events['length'];_0x48fbca<_0x3d5572;_0x48fbca++){var _0x4b5ef5=events[_0x48fbca];var _0xa5a6e0=createListener(_0x6b39('0x6')+_0x4b5ef5,_0x474aa8);MailAccountEvents['on'](_0x4b5ef5,_0xa5a6e0);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2bd0fa0..f3f7acb 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 _0x5f61=['isAuthenticated','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5f61,0x82));var _0x15f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f61[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x15f6('0x0'));var util=require(_0x15f6('0x1'));var path=require(_0x15f6('0x2'));var timeout=require('connect-timeout');var express=require(_0x15f6('0x3'));var router=express[_0x15f6('0x4')]();var fs_extra=require(_0x15f6('0x5'));var auth=require(_0x15f6('0x6'));var interaction=require(_0x15f6('0x7'));var config=require(_0x15f6('0x8'));var controller=require(_0x15f6('0x9'));router[_0x15f6('0xa')](_0x15f6('0xb'),auth['isAuthenticated'](),controller[_0x15f6('0xc')]);router[_0x15f6('0xd')](_0x15f6('0xb'),auth[_0x15f6('0xe')](),controller[_0x15f6('0xf')]);router[_0x15f6('0x10')](_0x15f6('0xb'),auth[_0x15f6('0xe')](),controller[_0x15f6('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8404=['express','Router','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x8404,0x1d9));var _0x4840=function(_0x306c98,_0xb6a329){_0x306c98=_0x306c98-0x0;var _0x543c75=_0x8404[_0x306c98];return _0x543c75;};'use strict';var multer=require('multer');var util=require(_0x4840('0x0'));var path=require(_0x4840('0x1'));var timeout=require(_0x4840('0x2'));var express=require(_0x4840('0x3'));var router=express[_0x4840('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4840('0x5'));var interaction=require(_0x4840('0x6'));var config=require('../../config/environment');var controller=require(_0x4840('0x7'));router[_0x4840('0x8')](_0x4840('0x9'),auth[_0x4840('0xa')](),controller[_0x4840('0xb')]);router[_0x4840('0xc')](_0x4840('0x9'),auth['isAuthenticated'](),controller[_0x4840('0xd')]);router[_0x4840('0xe')](_0x4840('0x9'),auth['isAuthenticated'](),controller[_0x4840('0xf')]);module[_0x4840('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 749f4d1..1212f5f 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 _0x79f4=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x4e135d,_0x182e3d){var _0x169b48=function(_0x36b08d){while(--_0x36b08d){_0x4e135d['push'](_0x4e135d['shift']());}};_0x169b48(++_0x182e3d);}(_0x79f4,0x151));var _0x479f=function(_0x520510,_0x474ff0){_0x520510=_0x520510-0x0;var _0x8a0435=_0x79f4[_0x520510];return _0x8a0435;};'use strict';var Sequelize=require(_0x479f('0x0'));module[_0x479f('0x1')]={'priority':{'type':Sequelize[_0x479f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x479f('0x3')],'allowNull':![],'defaultValue':_0x479f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x479f('0x3')]},'interval':{'type':Sequelize[_0x479f('0x3')],'defaultValue':_0x479f('0x5')}}; \ No newline at end of file +var _0xb6c2=['STRING','*,*,*,*','exports','INTEGER','noop','TEXT'];(function(_0xf386d8,_0x1a1ba1){var _0x3ceb74=function(_0xdc38ed){while(--_0xdc38ed){_0xf386d8['push'](_0xf386d8['shift']());}};_0x3ceb74(++_0x1a1ba1);}(_0xb6c2,0x1b2));var _0x2b6c=function(_0x23c0b9,_0x3f7a80){_0x23c0b9=_0x23c0b9-0x0;var _0x537c93=_0xb6c2[_0x23c0b9];return _0x537c93;};'use strict';var Sequelize=require('sequelize');module[_0x2b6c('0x0')]={'priority':{'type':Sequelize[_0x2b6c('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2b6c('0x2')},'appdata':{'type':Sequelize[_0x2b6c('0x3')]()},'description':{'type':Sequelize[_0x2b6c('0x4')]},'interval':{'type':Sequelize[_0x2b6c('0x4')],'defaultValue':_0x2b6c('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 034b665..82a0f3c 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 _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x174d3e,_0x1507bc){var _0x43f2bc=function(_0xe106ae){while(--_0xe106ae){_0x174d3e['push'](_0x174d3e['shift']());}};_0x43f2bc(++_0x1507bc);}(_0xda3f,0xec));var _0xfda3=function(_0x540b05,_0x468fd2){_0x540b05=_0x540b05-0x0;var _0x425073=_0xda3f[_0x540b05];return _0x425073;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x330b36,_0x1986ad){var _0xea0540=function(_0x542b98){while(--_0x542b98){_0x330b36['push'](_0x330b36['shift']());}};_0xea0540(++_0x1986ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 683240e..ca677dc 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 _0x2145=['api','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2145,0xce));var _0x5214=function(_0x35da6e,_0x3301ef){_0x35da6e=_0x35da6e-0x0;var _0x444a7d=_0x2145[_0x35da6e];return _0x444a7d;};'use strict';var _=require(_0x5214('0x0'));var util=require('util');var logger=require(_0x5214('0x1'))(_0x5214('0x2'));var moment=require('moment');var BPromise=require(_0x5214('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5214('0x4'));var rimraf=require(_0x5214('0x5'));var config=require(_0x5214('0x6'));var attributes=require(_0x5214('0x7'));module[_0x5214('0x8')]=function(_0x254ec8,_0x1b12ff){return _0x254ec8['define'](_0x5214('0x9'),attributes,{'tableName':_0x5214('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5214('0xb'),'collate':_0x5214('0xc')});}; \ No newline at end of file +var _0x9506=['../../config/environment','./mailApplication.attributes','define','MailApplication','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9506,0xc5));var _0x6950=function(_0x46f45b,_0x10517f){_0x46f45b=_0x46f45b-0x0;var _0x2a42f8=_0x9506[_0x46f45b];return _0x2a42f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6950('0x0'))(_0x6950('0x1'));var moment=require(_0x6950('0x2'));var BPromise=require(_0x6950('0x3'));var rp=require(_0x6950('0x4'));var fs=require('fs');var path=require(_0x6950('0x5'));var rimraf=require(_0x6950('0x6'));var config=require(_0x6950('0x7'));var attributes=require(_0x6950('0x8'));module['exports']=function(_0x24d1ef,_0x54bc8c){return _0x24d1ef[_0x6950('0x9')](_0x6950('0xa'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6950('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 4785349..46c286e 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 _0x037e=['jayson/promise','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateMailApplication','MailApplication','body','options','where','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5b0c62,_0xfed3fc){var _0x34f3a3=function(_0x2e9655){while(--_0x2e9655){_0x5b0c62['push'](_0x5b0c62['shift']());}};_0x34f3a3(++_0xfed3fc);}(_0x037e,0x12c));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var moment=require(_0xe037('0x2'));var BPromise=require(_0xe037('0x3'));var rs=require(_0xe037('0x4'));var fs=require('fs');var Redis=require(_0xe037('0x5'));var db=require(_0xe037('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe037('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe037('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d6614,_0x85b1c0,_0x5d4079){return new BPromise(function(_0x6484f0,_0x2c6e68){return client[_0xe037('0x9')](_0x3d6614,_0x5d4079)[_0xe037('0xa')](function(_0x156497){logger['info'](_0xe037('0xb'),_0x85b1c0,_0xe037('0xc'));logger[_0xe037('0xd')](_0xe037('0xe'),_0x85b1c0,_0xe037('0xc'),JSON['stringify'](_0x156497));if(_0x156497[_0xe037('0xf')]){if(_0x156497[_0xe037('0xf')][_0xe037('0x10')]===0x1f4){logger[_0xe037('0xf')](_0xe037('0xb'),_0x85b1c0,_0x156497[_0xe037('0xf')][_0xe037('0x11')]);return _0x2c6e68(_0x156497['error']['message']);}logger[_0xe037('0xf')](_0xe037('0xb'),_0x85b1c0,_0x156497['error'][_0xe037('0x11')]);return _0x6484f0(_0x156497[_0xe037('0xf')][_0xe037('0x11')]);}else{logger['info'](_0xe037('0xb'),_0x85b1c0,'request\x20sent');_0x6484f0(_0x156497[_0xe037('0x12')][_0xe037('0x11')]);}})[_0xe037('0x13')](function(_0x3b2de8){logger[_0xe037('0xf')]('MailApplication,\x20%s,\x20%s',_0x85b1c0,_0x3b2de8);_0x2c6e68(_0x3b2de8);});});}exports[_0xe037('0x14')]=function(_0x270dad){var _0x2693e1=this;return new Promise(function(_0x29f0e8,_0xfe02a9){return db[_0xe037('0x15')]['update'](_0x270dad[_0xe037('0x16')],{'raw':_0x270dad['options']?_0x270dad[_0xe037('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x270dad[_0xe037('0x17')]?_0x270dad[_0xe037('0x17')][_0xe037('0x18')]||null:null,'attributes':_0x270dad[_0xe037('0x17')]?_0x270dad[_0xe037('0x17')][_0xe037('0x19')]||null:null,'limit':_0x270dad[_0xe037('0x17')]?_0x270dad[_0xe037('0x17')][_0xe037('0x1a')]||null:null})[_0xe037('0xa')](function(_0x4d5dfc){logger['info']('UpdateMailApplication',_0x270dad);logger[_0xe037('0xd')](_0xe037('0x14'),_0x270dad,JSON[_0xe037('0x1b')](_0x4d5dfc));_0x29f0e8(_0x4d5dfc);})[_0xe037('0x13')](function(_0x28752e){logger[_0xe037('0xf')](_0xe037('0x14'),_0x28752e[_0xe037('0x11')],_0x270dad);_0xfe02a9(_0x2693e1[_0xe037('0xf')](0x1f4,_0x28752e[_0xe037('0x11')]));});});}; \ No newline at end of file +var _0x57a1=['body','options','attributes','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update'];(function(_0x3967b2,_0x3a597e){var _0xc6d5ad=function(_0x71727b){while(--_0x71727b){_0x3967b2['push'](_0x3967b2['shift']());}};_0xc6d5ad(++_0x3a597e);}(_0x57a1,0x148));var _0x157a=function(_0x3d5798,_0x11a5a4){_0x3d5798=_0x3d5798-0x0;var _0x2f9b86=_0x57a1[_0x3d5798];return _0x2f9b86;};'use strict';var _=require(_0x157a('0x0'));var util=require('util');var moment=require(_0x157a('0x1'));var BPromise=require(_0x157a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x157a('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x157a('0x4'));var config=require(_0x157a('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x157a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5749f9,_0x502e20,_0x594895){return new BPromise(function(_0x15a145,_0x122c12){return client[_0x157a('0x7')](_0x5749f9,_0x594895)[_0x157a('0x8')](function(_0x1cb23){logger[_0x157a('0x9')](_0x157a('0xa'),_0x502e20,_0x157a('0xb'));logger[_0x157a('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x502e20,_0x157a('0xb'),JSON[_0x157a('0xd')](_0x1cb23));if(_0x1cb23[_0x157a('0xe')]){if(_0x1cb23['error'][_0x157a('0xf')]===0x1f4){logger[_0x157a('0xe')](_0x157a('0xa'),_0x502e20,_0x1cb23['error'][_0x157a('0x10')]);return _0x122c12(_0x1cb23[_0x157a('0xe')][_0x157a('0x10')]);}logger[_0x157a('0xe')]('MailApplication,\x20%s,\x20%s',_0x502e20,_0x1cb23[_0x157a('0xe')][_0x157a('0x10')]);return _0x15a145(_0x1cb23[_0x157a('0xe')][_0x157a('0x10')]);}else{logger['info'](_0x157a('0xa'),_0x502e20,'request\x20sent');_0x15a145(_0x1cb23[_0x157a('0x11')][_0x157a('0x10')]);}})[_0x157a('0x12')](function(_0x28af95){logger[_0x157a('0xe')]('MailApplication,\x20%s,\x20%s',_0x502e20,_0x28af95);_0x122c12(_0x28af95);});});}exports[_0x157a('0x13')]=function(_0x330656){var _0x3681f8=this;return new Promise(function(_0x198319,_0xa9079b){return db[_0x157a('0x14')][_0x157a('0x15')](_0x330656[_0x157a('0x16')],{'raw':_0x330656[_0x157a('0x17')]?_0x330656[_0x157a('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x330656[_0x157a('0x17')]?_0x330656[_0x157a('0x17')]['where']||null:null,'attributes':_0x330656[_0x157a('0x17')]?_0x330656['options'][_0x157a('0x18')]||null:null,'limit':_0x330656['options']?_0x330656['options']['limit']||null:null})[_0x157a('0x8')](function(_0x13e612){logger[_0x157a('0x9')](_0x157a('0x13'),_0x330656);logger['debug'](_0x157a('0x13'),_0x330656,JSON[_0x157a('0xd')](_0x13e612));_0x198319(_0x13e612);})[_0x157a('0x12')](function(_0x4f004b){logger['error'](_0x157a('0x13'),_0x4f004b[_0x157a('0x10')],_0x330656);_0xa9079b(_0x3681f8[_0x157a('0xe')](0x1f4,_0x4f004b[_0x157a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index e80f8aa..be61537 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 _0xb74d=['tracked','mail','mailinteraction:addtags','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags'];(function(_0xee3294,_0xea3e22){var _0x31f27e=function(_0xffe32){while(--_0xffe32){_0xee3294['push'](_0xee3294['shift']());}};_0x31f27e(++_0xea3e22);}(_0xb74d,0x1c2));var _0xdb74=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0xb74d[_0x81e39d];return _0x548fbb;};'use strict';var express=require(_0xdb74('0x0'));var router=express[_0xdb74('0x1')]();var auth=require(_0xdb74('0x2'));var interaction=require(_0xdb74('0x3'));var controller=require(_0xdb74('0x4'));router[_0xdb74('0x5')]('/',auth[_0xdb74('0x6')](),controller[_0xdb74('0x7')]);router[_0xdb74('0x5')](_0xdb74('0x8'),auth[_0xdb74('0x6')](),controller[_0xdb74('0x9')]);router['get'](_0xdb74('0xa'),auth[_0xdb74('0x6')](),controller[_0xdb74('0xb')]);router[_0xdb74('0x5')](_0xdb74('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xdb74('0x5')](_0xdb74('0xd'),auth[_0xdb74('0x6')](),controller[_0xdb74('0xe')]);router[_0xdb74('0xf')]('/',auth[_0xdb74('0x6')](),controller['create']);router[_0xdb74('0xf')](_0xdb74('0xc'),auth['isAuthenticated'](),controller[_0xdb74('0x10')]);router[_0xdb74('0xf')](_0xdb74('0x11'),auth[_0xdb74('0x6')](),interaction[_0xdb74('0x12')](_0xdb74('0x13'),_0xdb74('0x14')),controller['addTags']);router['put'](_0xdb74('0xa'),auth[_0xdb74('0x6')](),interaction[_0xdb74('0x12')]('mail','mailinteraction:update'),controller[_0xdb74('0x15')]);router[_0xdb74('0x16')](_0xdb74('0xa'),auth[_0xdb74('0x6')](),interaction[_0xdb74('0x12')]('mail',_0xdb74('0x17')),controller['destroy']);router[_0xdb74('0x16')](_0xdb74('0x11'),auth[_0xdb74('0x6')](),controller[_0xdb74('0x18')]);module[_0xdb74('0x19')]=router; \ No newline at end of file +var _0xd346=['delete','/:id/tags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy'];(function(_0x32f26d,_0x2c0b5d){var _0x5d9ddc=function(_0x1f0e26){while(--_0x1f0e26){_0x32f26d['push'](_0x32f26d['shift']());}};_0x5d9ddc(++_0x2c0b5d);}(_0xd346,0x16f));var _0x6d34=function(_0x3f08df,_0x96b6df){_0x3f08df=_0x3f08df-0x0;var _0x5728ba=_0xd346[_0x3f08df];return _0x5728ba;};'use strict';var express=require(_0x6d34('0x0'));var router=express[_0x6d34('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x6d34('0x2'));var controller=require(_0x6d34('0x3'));router[_0x6d34('0x4')]('/',auth[_0x6d34('0x5')](),controller['index']);router['get'](_0x6d34('0x6'),auth[_0x6d34('0x5')](),controller[_0x6d34('0x7')]);router[_0x6d34('0x4')](_0x6d34('0x8'),auth[_0x6d34('0x5')](),controller[_0x6d34('0x9')]);router['get'](_0x6d34('0xa'),auth[_0x6d34('0x5')](),controller[_0x6d34('0xb')]);router[_0x6d34('0x4')]('/:id/download',auth[_0x6d34('0x5')](),controller[_0x6d34('0xc')]);router[_0x6d34('0xd')]('/',auth[_0x6d34('0x5')](),controller[_0x6d34('0xe')]);router[_0x6d34('0xd')](_0x6d34('0xa'),auth[_0x6d34('0x5')](),controller[_0x6d34('0xf')]);router[_0x6d34('0xd')]('/:id/tags',auth[_0x6d34('0x5')](),interaction[_0x6d34('0x10')](_0x6d34('0x11'),_0x6d34('0x12')),controller[_0x6d34('0x13')]);router[_0x6d34('0x14')](_0x6d34('0x8'),auth[_0x6d34('0x5')](),interaction[_0x6d34('0x10')](_0x6d34('0x11'),_0x6d34('0x15')),controller[_0x6d34('0x16')]);router['delete'](_0x6d34('0x8'),auth['isAuthenticated'](),interaction['tracked'](_0x6d34('0x11'),_0x6d34('0x17')),controller[_0x6d34('0x18')]);router[_0x6d34('0x19')](_0x6d34('0x1a'),auth[_0x6d34('0x5')](),controller['removeTags']);module[_0x6d34('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 59763c5..a78cac6 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 _0x9ee6=['BOOLEAN','STRING','long','DATE','out','sequelize','iconv','exports'];(function(_0x2202d8,_0x1b49ef){var _0x1de8c0=function(_0x464e76){while(--_0x464e76){_0x2202d8['push'](_0x2202d8['shift']());}};_0x1de8c0(++_0x1b49ef);}(_0x9ee6,0x125));var _0x69ee=function(_0x54eab6,_0x5e262f){_0x54eab6=_0x54eab6-0x0;var _0x1e7435=_0x9ee6[_0x54eab6];return _0x1e7435;};'use strict';var Sequelize=require(_0x69ee('0x0'));var iconv=require(_0x69ee('0x1'));module[_0x69ee('0x2')]={'closed':{'type':Sequelize[_0x69ee('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x69ee('0x4')]},'secondDisposition':{'type':Sequelize[_0x69ee('0x4')]},'thirdDisposition':{'type':Sequelize[_0x69ee('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x69ee('0x4')](0x1fe)},'to':{'type':Sequelize[_0x69ee('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x69ee('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x69ee('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x69ee('0x6')]},'substatus':{'type':Sequelize[_0x69ee('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x69ee('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x69ee('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x69ee('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x69ee('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x06f2=['BOOLEAN','DATE','STRING','TEXT','ENUM','out','iconv','exports'];(function(_0x34ffc8,_0x21f656){var _0x527ee1=function(_0x5348e6){while(--_0x5348e6){_0x34ffc8['push'](_0x34ffc8['shift']());}};_0x527ee1(++_0x21f656);}(_0x06f2,0x96));var _0x206f=function(_0x4957e2,_0x2b97e7){_0x4957e2=_0x4957e2-0x0;var _0x2827c7=_0x06f2[_0x4957e2];return _0x2827c7;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x206f('0x0'));module[_0x206f('0x1')]={'closed':{'type':Sequelize[_0x206f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x206f('0x3')]},'disposition':{'type':Sequelize[_0x206f('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x206f('0x4')]},'note':{'type':Sequelize[_0x206f('0x4')]},'inReplyTo':{'type':Sequelize[_0x206f('0x4')](0x1fe)},'to':{'type':Sequelize[_0x206f('0x4')]},'cc':{'type':Sequelize[_0x206f('0x5')]('long')},'subject':{'type':Sequelize[_0x206f('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x206f('0x3')]},'substatus':{'type':Sequelize[_0x206f('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x206f('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x206f('0x6')]('in',_0x206f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x206f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x206f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x206f('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 3b7985d..1382c42 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 _0x0d0d=['Tags','findOne','out','plainBody','lastMsgText','trimStart','catch','index','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','value','having','`\x20=\x200','operator','length','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','MailInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','Setting','enableEmailPreview','push','all','rows','show','includeAll','include','merge','options','create','params','destroy','describe','addMessage','MailMessage','body','ids','omit','getMessages','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','addTags','emit','mailInteractionTags:save','removeTags','download','unix','server','files','join','root','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','mkdirSync','each','decode','headers','Bcc','bcc','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','util','path','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','update','then','end','error','stack','Users','map','fullname','TagIds','split','forEach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d0d,0xc3));var _0xd0d0=function(_0x31827e,_0x49681a){_0x31827e=_0x31827e-0x0;var _0x1fbf7a=_0x0d0d[_0x31827e];return _0x1fbf7a;};'use strict';var emlformat=require(_0xd0d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd0d0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xd0d0('0x2'));var path=require(_0xd0d0('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd0d0('0x4'));var juice=require(_0xd0d0('0x5'));var Redis=require(_0xd0d0('0x6'));var qs=require(_0xd0d0('0x7'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xd0d0('0x8'))(_0xd0d0('0x9'));var config=require(_0xd0d0('0xa'));var db=require(_0xd0d0('0xb'))['db'];var htmlEntities=require('html-entities');config[_0xd0d0('0xc')]=_['defaults'](config[_0xd0d0('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd0d0('0xd'))(new Redis(config[_0xd0d0('0xc')]));require(_0xd0d0('0xe'))[_0xd0d0('0xf')](socket);function respondWithStatusCode(_0x8682ed,_0x186c34){_0x186c34=_0x186c34||0xcc;return function(_0x206aff){if(_0x206aff){return _0x8682ed[_0xd0d0('0x10')](_0x186c34);}return _0x8682ed[_0xd0d0('0x11')](_0x186c34)['end']();};}function respondWithResult(_0x5e6072,_0xadcd1c){_0xadcd1c=_0xadcd1c||0xc8;return function(_0x3a09f6){if(_0x3a09f6){return _0x5e6072[_0xd0d0('0x11')](_0xadcd1c)[_0xd0d0('0x12')](_0x3a09f6);}};}function respondWithFilteredResult(_0x32c387,_0x56ff43){return function(_0x4696ce){if(_0x4696ce){var _0x30e611=typeof _0x56ff43[_0xd0d0('0x13')]===_0xd0d0('0x14')&&typeof _0x56ff43[_0xd0d0('0x15')]===_0xd0d0('0x14');var _0x109e07=_0x4696ce[_0xd0d0('0x16')];var _0x26c884=_0x30e611?0x0:_0x56ff43[_0xd0d0('0x13')];var _0x3bc74d=_0x30e611?_0x4696ce[_0xd0d0('0x16')]:_0x56ff43['offset']+_0x56ff43[_0xd0d0('0x15')];var _0x1f46e5;if(_0x3bc74d>=_0x109e07){_0x3bc74d=_0x109e07;_0x1f46e5=0xc8;}else{_0x1f46e5=0xce;}_0x32c387[_0xd0d0('0x11')](_0x1f46e5);return _0x32c387[_0xd0d0('0x17')]('Content-Range',_0x26c884+'-'+_0x3bc74d+'/'+_0x109e07)[_0xd0d0('0x12')](_0x4696ce);}return null;};}function saveUpdates(_0x43b80b){return function(_0x51b1c3){if(_0x51b1c3){return _0x51b1c3[_0xd0d0('0x18')](_0x43b80b)[_0xd0d0('0x19')](function(_0x3f9e30){return _0x3f9e30;});}return null;};}function removeEntity(_0x68f789){return function(_0x3bafa0){if(_0x3bafa0){return _0x3bafa0['destroy']()['then'](function(){_0x68f789[_0xd0d0('0x11')](0xcc)[_0xd0d0('0x1a')]();});}};}function handleEntityNotFound(_0x1d5560){return function(_0x569fe6){if(!_0x569fe6){_0x1d5560[_0xd0d0('0x10')](0x194);}return _0x569fe6;};}function handleError(_0x276d52,_0x8c7988){_0x8c7988=_0x8c7988||0x1f4;return function(_0x545f05){logger[_0xd0d0('0x1b')](_0x545f05[_0xd0d0('0x1c')]);if(_0x545f05['name']){delete _0x545f05['name'];}_0x276d52[_0xd0d0('0x11')](_0x8c7988)['send'](_0x545f05);};}function getInteractionUsers(_0x27c3ef,_0x3a7888){return new BPromise(function(_0x2e9418,_0x59ebda){try{if(_0x3a7888[_0x27c3ef['id']]){_0x27c3ef[_0xd0d0('0x1d')]=_[_0xd0d0('0x1e')](_0x3a7888[_0x27c3ef['id']],function(_0x4f31f2){return{'id':_0x4f31f2['id'],'fullname':_0x4f31f2[_0xd0d0('0x1f')]};});}}catch(_0x2e0030){_0x59ebda(_0x2e0030);}_0x2e9418(_0x27c3ef);});}function getInteractionTags(_0xdbd703,_0x25dd77){return new BPromise(function(_0x2899e5,_0x335ccd){try{if(_0xdbd703[_0xd0d0('0x20')]){_0xdbd703['Tags']=[];_0xdbd703['TagIds'][_0xd0d0('0x21')](',')[_0xd0d0('0x22')](function(_0x22f9bd){_0xdbd703[_0xd0d0('0x23')]['push'](_0x25dd77[_0x22f9bd]);});}delete _0xdbd703[_0xd0d0('0x20')];}catch(_0x54441f){_0x335ccd(_0x54441f);}_0x2899e5(_0xdbd703);});}function getLastMessageText(_0x5c43d7){return new BPromise(function(_0x3d3868,_0x292978){return db['MailMessage'][_0xd0d0('0x24')]({'where':{'$and':[{'MailInteractionId':_0x5c43d7['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd0d0('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd0d0('0x26')],'order':'-id','raw':!![]})['then'](function(_0x265fe5){if(_0x265fe5&&_0x265fe5[_0xd0d0('0x26')]){_0x5c43d7[_0xd0d0('0x27')]=_[_0xd0d0('0x28')](_0x265fe5[_0xd0d0('0x26')]);}_0x3d3868(_0x5c43d7);})[_0xd0d0('0x29')](function(_0x1ab597){_0x292978(_0x1ab597);});});}function updateMailInteraction(_0x2c71a6,_0x45a762,_0x38314b,_0x1bccdd){return new BPromise(function(_0x4a030c,_0x1a754e){return getInteractionUsers(_0x2c71a6,_0x38314b)['then'](function(_0x59d5b7){return getInteractionTags(_0x59d5b7,_0x45a762);})[_0xd0d0('0x19')](function(_0x452f46){if(_0x1bccdd){_0x4a030c(getLastMessageText(_0x452f46));}else{_0x4a030c(_0x452f46);}})['catch'](function(_0x4048ca){_0x1a754e(_0x4048ca);});});}exports[_0xd0d0('0x2a')]=function(_0x213da5,_0x3a2fc4){var _0x3d15ff={},_0x58d4ab={},_0xb8d33d={'count':0x0,'rows':[]};var _0x6be733=_[_0xd0d0('0x1e')](db['MailInteraction'][_0xd0d0('0x2b')],function(_0x2932de){return{'name':_0x2932de['fieldName'],'type':_0x2932de[_0xd0d0('0x2c')][_0xd0d0('0x2d')]};});_0x58d4ab[_0xd0d0('0x2e')]=_['map'](_0x6be733,_0xd0d0('0x2f'));_0x58d4ab[_0xd0d0('0x30')]=_[_0xd0d0('0x31')](_0x213da5[_0xd0d0('0x30')]);_0x58d4ab['filters']=_[_0xd0d0('0x32')](_0x58d4ab[_0xd0d0('0x2e')],_0x58d4ab[_0xd0d0('0x30')]);_0x3d15ff[_0xd0d0('0x33')]=_[_0xd0d0('0x32')](_0x58d4ab[_0xd0d0('0x2e')],qs[_0xd0d0('0x34')](_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x34')]));_0x3d15ff['attributes']=_0x3d15ff['attributes']['length']?_0x3d15ff[_0xd0d0('0x33')]:_0x58d4ab[_0xd0d0('0x2e')];if(!_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x35')](_0xd0d0('0x36'))){_0x3d15ff['limit']=qs['limit'](_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x15')]);_0x3d15ff[_0xd0d0('0x13')]=qs[_0xd0d0('0x13')](_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x13')]);}_0x3d15ff[_0xd0d0('0x37')]=qs[_0xd0d0('0x38')](_0x213da5['query'][_0xd0d0('0x38')]);_0x3d15ff[_0xd0d0('0x39')]=qs[_0xd0d0('0x3a')](_[_0xd0d0('0x3b')](_0x213da5[_0xd0d0('0x30')],_0x58d4ab[_0xd0d0('0x3a')]),_0x6be733);var _0x4fda12=[];var _0x15a4bb=squel[_0xd0d0('0x3c')]()[_0xd0d0('0x3d')]('id')['field'](_0xd0d0('0x2f'))[_0xd0d0('0x3d')](_0xd0d0('0x3e'))[_0xd0d0('0x3f')](_0xd0d0('0x40'));var _0x18a5fb=squel['select']()[_0xd0d0('0x3d')](_0xd0d0('0x41'))[_0xd0d0('0x3d')]('u.fullname')[_0xd0d0('0x3d')]('ui.MailInteractionId')['from'](_0xd0d0('0x42'),'ui')[_0xd0d0('0x43')](_0xd0d0('0x44'),'u',_0xd0d0('0x45'));var _0x230b6e=squel[_0xd0d0('0x3c')]()['from'](_0xd0d0('0x46'),'i')[_0xd0d0('0x43')](_0xd0d0('0x47'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xd0d0('0x44'),'o',_0xd0d0('0x48'))[_0xd0d0('0x43')](_0xd0d0('0x49'),'a',_0xd0d0('0x4a'))['left_join'](_0xd0d0('0x4b'),'me',_0xd0d0('0x4c'))['left_join'](_0xd0d0('0x4d'),'it',_0xd0d0('0x4e'))[_0xd0d0('0x43')](_0xd0d0('0x40'),'t',_0xd0d0('0x4f'));var _0x52a710=squel[_0xd0d0('0x50')]();var _0x4e2d02=[];var _0x5c3ed3=squel[_0xd0d0('0x50')]();var _0x2853e3;if(_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x51')]){_0x2853e3=as[_0xd0d0('0x52')](_0x213da5[_0xd0d0('0x30')]['search']);var _0x4cb2cb=_0x2853e3['sqlOperator'];for(var _0x495b22=0x0;_0x495b22<_0x2853e3[_0xd0d0('0x53')]['length'];_0x495b22++){var _0x57d0aa=_0x2853e3[_0xd0d0('0x53')][_0x495b22];var _0x4fc002='i';var _0x32f102=_['find'](_0x6be733,['name',_0x57d0aa[_0xd0d0('0x3d')]]);if(!_0x32f102){switch(_0x57d0aa[_0xd0d0('0x3d')]){case'unreadMessages':if(_0x57d0aa[_0xd0d0('0x54')]==0x1){_0x230b6e[_0xd0d0('0x55')]('`'+_0x57d0aa[_0xd0d0('0x3d')]+_0xd0d0('0x56'));}else{_0x230b6e[_0xd0d0('0x55')]('`'+_0x57d0aa[_0xd0d0('0x3d')]+'`\x20>\x200');}break;case'Contact':if(_0x57d0aa[_0xd0d0('0x57')]==='$substring'){if(_0x57d0aa['value'][_0xd0d0('0x21')]('\x20')[_0xd0d0('0x58')]>0x1){_0x52a710[_0x4cb2cb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x57d0aa[_0xd0d0('0x54')]),null);}else{var _0x1c51a8='%'+_0x57d0aa[_0xd0d0('0x54')]+'%';_0x52a710[_0x4cb2cb](_0xd0d0('0x59'),_0x1c51a8,_0x1c51a8,_0x1c51a8);}}else{_0x32f102=_[_0xd0d0('0x5a')](_0x6be733,[_0xd0d0('0x2f'),_0xd0d0('0x5b')]);_0x57d0aa[_0xd0d0('0x3d')]=_0xd0d0('0x5b');_0x3f80e4=as[_0xd0d0('0x5c')](_0x4fc002,_0x32f102[_0xd0d0('0x2c')],_0x57d0aa);_0x52a710[_0x4cb2cb](_0x3f80e4[_0xd0d0('0x5d')],_0x3f80e4[_0xd0d0('0x54')][_0xd0d0('0x5e')],_0x3f80e4[_0xd0d0('0x54')][_0xd0d0('0x1a')]);}break;case _0xd0d0('0x5f'):var _0x351d00=_0x57d0aa['value'][_0xd0d0('0x21')](',')[_0xd0d0('0x1e')](function(_0x466d4e){return Number(_0x466d4e);});_0x351d00[_0xd0d0('0x22')](function(_0x34f29c){_0x5c3ed3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x34f29c+',%');});_0x4e2d02=_[_0xd0d0('0x60')](_0x4e2d02,_0x351d00);break;case'User':if(_0x57d0aa['operator']===_0xd0d0('0x61')){_0x52a710[_0x4cb2cb](_0xd0d0('0x62'),'%'+_0x57d0aa[_0xd0d0('0x54')]+'%',null);}else{_0x32f102=_[_0xd0d0('0x5a')](_0x6be733,[_0xd0d0('0x2f'),'UserId']);_0x57d0aa[_0xd0d0('0x3d')]=_0xd0d0('0x63');_0x3f80e4=as[_0xd0d0('0x5c')](_0x4fc002,_0x32f102[_0xd0d0('0x2c')],_0x57d0aa);_0x52a710[_0x4cb2cb](_0x3f80e4[_0xd0d0('0x5d')],_0x3f80e4[_0xd0d0('0x54')][_0xd0d0('0x5e')],_0x3f80e4[_0xd0d0('0x54')][_0xd0d0('0x1a')]);}break;case _0xd0d0('0x26'):_0x3f80e4=as[_0xd0d0('0x5c')]('me',null,_0x57d0aa);_0x52a710[_0x4cb2cb](_0x3f80e4['text'],_0x3f80e4[_0xd0d0('0x54')]['start'],_0x3f80e4[_0xd0d0('0x54')][_0xd0d0('0x1a')]);break;}}else{var _0x3f80e4=as['buildExpression'](_0x4fc002,_0x32f102['type'],_0x57d0aa);_0x52a710[_0x4cb2cb](_0x3f80e4[_0xd0d0('0x5d')],_0x3f80e4[_0xd0d0('0x54')]['start'],_0x3f80e4['value'][_0xd0d0('0x1a')]);}}}else{var _0x4e315c=_(_0x213da5['query'])[_0xd0d0('0x31')]()[_0xd0d0('0x1e')](function(_0x12c1ba){return _[_0xd0d0('0x64')](_0x6be733,['name',_0x12c1ba])?_0x12c1ba:undefined;})[_0xd0d0('0x65')]()[_0xd0d0('0x54')]();if(!_[_0xd0d0('0x66')](_0x4e315c)){_0x4e315c[_0xd0d0('0x22')](function(_0x155a18){if(_0x155a18===_0xd0d0('0x67')){_0x230b6e[_0xd0d0('0x39')](_0xd0d0('0x68'),[][_0xd0d0('0x69')](_0x213da5[_0xd0d0('0x30')][_0x155a18]));}else if(_0x155a18===_0xd0d0('0x6a')){var _0x470eee=JSON[_0xd0d0('0x6b')](_0x213da5[_0xd0d0('0x30')][_0x155a18])[_0xd0d0('0x6c')];var _0x5a3f2b=JSON[_0xd0d0('0x6b')](_0x213da5[_0xd0d0('0x30')][_0x155a18])[_0xd0d0('0x6d')];_0x230b6e[_0xd0d0('0x39')](_0xd0d0('0x6e'),_0x470eee,_0x5a3f2b);}else{if(_0x213da5['query'][_0x155a18]===_0xd0d0('0x6f')){_0x230b6e['where']('i.'+_0x155a18+_0xd0d0('0x70'));}else{_0x230b6e[_0xd0d0('0x39')]('i.'+_0x155a18+'\x20=\x20?',_0x213da5[_0xd0d0('0x30')][_0x155a18]);}}});}if(_0x213da5['query'][_0xd0d0('0x71')]){if(_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x71')]==0x1){_0x230b6e[_0xd0d0('0x55')](_0xd0d0('0x72'));}else{_0x230b6e[_0xd0d0('0x55')](_0xd0d0('0x73'));}}if(_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x74')]){_0x4e2d02=_['isArray'](_0x213da5[_0xd0d0('0x30')]['tag'])?_0x213da5[_0xd0d0('0x30')]['tag']:new Array(_0x213da5['query'][_0xd0d0('0x74')]);_0x4e2d02['forEach'](function(_0x250228){_0x5c3ed3['or'](_0xd0d0('0x75'),'%,'+_0x250228+',%');});}if(_0x213da5['query'][_0xd0d0('0x76')]){var _0x82b3d9=_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x76')][_0xd0d0('0x77')]('\x5c','\x5c\x5c')[_0xd0d0('0x77')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x82b3d9)){_0x52a710['or'](_0xd0d0('0x78'),_0x82b3d9+'%');}else if(qs[_0xd0d0('0x79')](_0x82b3d9)){_0x52a710['or'](_0xd0d0('0x7a'),_0x82b3d9+'%');}else{_0x52a710['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd0d0('0x7b')](_0x82b3d9))['or'](_0xd0d0('0x7c'),qs[_0xd0d0('0x7b')](_0x82b3d9));}}}_0x230b6e[_0xd0d0('0x39')](_0x52a710);_0x230b6e[_0xd0d0('0x7d')](_0xd0d0('0x7e'));var _0x4b8440={'type':db[_0xd0d0('0x7f')][_0xd0d0('0x80')][_0xd0d0('0x81')],'raw':!![]};var _0x4528ef=_0x230b6e[_0xd0d0('0x82')]();_0x4528ef[_0xd0d0('0x3d')](_0xd0d0('0x7e'));_0x4528ef['field'](_0xd0d0('0x83'),'unreadMessages');if(_0x3d15ff[_0xd0d0('0x37')]){_0x3d15ff['order'][_0xd0d0('0x22')](function(_0x14d422){var _0x2b9dc5=_0x14d422[0x0]===_0xd0d0('0x84')?_0x14d422[0x0]:'i.'+_0x14d422[0x0];_0x230b6e[_0xd0d0('0x37')](_0x2b9dc5,_0x14d422[0x1]===_0xd0d0('0x85')?![]:!![]);});}if(!_[_0xd0d0('0x66')](_0x4e2d02)){_0x230b6e[_0xd0d0('0x55')](_0x5c3ed3);_0x4528ef[_0xd0d0('0x39')](_0xd0d0('0x86'),_0x4e2d02);}BPromise[_0xd0d0('0x87')]()[_0xd0d0('0x19')](function(){if(!_0x2853e3){if(_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x67')])return;_0x4528ef[_0xd0d0('0x39')](_0xd0d0('0x88'));_0x230b6e[_0xd0d0('0x39')](_0xd0d0('0x88'));return;}if(_0x213da5[_0xd0d0('0x89')][_0xd0d0('0x8a')]!=='agent')return;return _0x213da5[_0xd0d0('0x89')][_0xd0d0('0x8b')]({'attributes':['id'],'raw':!![]})[_0xd0d0('0x19')](function(_0x6156b4){if(_[_0xd0d0('0x66')](_0x6156b4)){_0x4528ef[_0xd0d0('0x39')]('i.MailAccountId\x20IS\x20NULL');_0x230b6e[_0xd0d0('0x39')](_0xd0d0('0x8c'));}else{_0x4528ef[_0xd0d0('0x39')](_0xd0d0('0x68'),_[_0xd0d0('0x1e')](_0x6156b4,'id'));_0x230b6e[_0xd0d0('0x39')](_0xd0d0('0x68'),_[_0xd0d0('0x1e')](_0x6156b4,'id'));}});})[_0xd0d0('0x19')](function(){if(_0x213da5[_0xd0d0('0x89')][_0xd0d0('0x8a')]==='agent'&&!_0x2853e3&&!_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x67')])return[];return db[_0xd0d0('0x8d')][_0xd0d0('0x30')](_0x4528ef['toString'](),_0x4b8440);})[_0xd0d0('0x19')](function(_0x189754){_0xb8d33d[_0xd0d0('0x16')]=_0x189754['length'];if(_0xb8d33d[_0xd0d0('0x16')]===0x0)return[];return db['sequelize'][_0xd0d0('0x30')](_0x15a4bb[_0xd0d0('0x8e')](),_0x4b8440)['then'](function(_0x315f61){_0x4fda12=_[_0xd0d0('0x8f')](_0x315f61,'id');_0x4b8440=_['merge'](_0x4b8440,{'model':db[_0xd0d0('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x213da5[_0xd0d0('0x30')][_0xd0d0('0x34')]){_0x3d15ff[_0xd0d0('0x33')][_0xd0d0('0x22')](function(_0xf5d847){_0x230b6e[_0xd0d0('0x3d')]('i.'+_0xf5d847);});}else{_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x83'),'unreadMessages');_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x91'),_0xd0d0('0x92'));_0x230b6e[_0xd0d0('0x3d')]('a.mandatoryDisposition',_0xd0d0('0x93'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x94'),_0xd0d0('0x84'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x7e'));_0x230b6e['field'](_0xd0d0('0x95'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x96'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x97'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x98'));_0x230b6e[_0xd0d0('0x3d')]('i.attach');_0x230b6e[_0xd0d0('0x3d')]('i.lastMsgAt');_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x99'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x9a'));_0x230b6e['field'](_0xd0d0('0x9b'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x9c'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x9d'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x9e'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0x9f'));_0x230b6e[_0xd0d0('0x3d')]('i.ContactId');_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xa0'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xa1'));_0x230b6e['field'](_0xd0d0('0xa2'),_0xd0d0('0xa3'));_0x230b6e['field'](_0xd0d0('0xa4'),_0xd0d0('0xa5'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xa6'),_0xd0d0('0xa7'));_0x230b6e[_0xd0d0('0x3d')]('c.phone',_0xd0d0('0xa8'));_0x230b6e[_0xd0d0('0x3d')]('c.mobile','Contact.mobile');_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xa9'),_0xd0d0('0xaa'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xab'),'Owner.fullname');_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xac'),_0xd0d0('0xad'));_0x230b6e[_0xd0d0('0x3d')](_0xd0d0('0xae'),_0xd0d0('0x20'));}if(_0x3d15ff['limit'])_0x230b6e[_0xd0d0('0x15')](_0x3d15ff[_0xd0d0('0x15')]);if(_0x3d15ff['offset'])_0x230b6e[_0xd0d0('0x13')](_0x3d15ff[_0xd0d0('0x13')]);return db[_0xd0d0('0x8d')][_0xd0d0('0x30')](_0x230b6e[_0xd0d0('0x8e')](),_0x4b8440);})['then'](function(_0x34a2a6){if(_0x34a2a6[_0xd0d0('0x58')]>0x0)_0x18a5fb['where'](_0xd0d0('0xaf'),_[_0xd0d0('0x1e')](_0x34a2a6,'id'));return db[_0xd0d0('0x8d')][_0xd0d0('0x30')](_0x18a5fb['toString'](),_0x4b8440)[_0xd0d0('0x19')](function(_0x52ce81){var _0x59b4cb=_['groupBy'](_0x52ce81,'MailInteractionId');var _0x4a2004=[];return db[_0xd0d0('0xb0')][_0xd0d0('0x24')]({'attributes':[_0xd0d0('0xb1')],'raw':!![]})[_0xd0d0('0x19')](function(_0x2f1cbd){var _0x553a5e=_0x2f1cbd['enableEmailPreview'];_0x34a2a6[_0xd0d0('0x22')](function(_0x2a0425){_0x4a2004[_0xd0d0('0xb2')](updateMailInteraction(_0x2a0425,_0x4fda12,_0x59b4cb,_0x553a5e));});return BPromise[_0xd0d0('0xb3')](_0x4a2004);});});});})[_0xd0d0('0x19')](function(_0x1f4181){_0xb8d33d[_0xd0d0('0xb4')]=_0x1f4181;return _0xb8d33d;})[_0xd0d0('0x19')](respondWithFilteredResult(_0x3a2fc4,_0x3d15ff))[_0xd0d0('0x29')](handleError(_0x3a2fc4,null));};exports[_0xd0d0('0xb5')]=function(_0x14afbf,_0x488090){var _0x17a691={'raw':![],'where':{'id':_0x14afbf['params']['id']}},_0x3af916={};_0x3af916[_0xd0d0('0x2e')]=_[_0xd0d0('0x31')](db[_0xd0d0('0x90')]['rawAttributes']);_0x3af916[_0xd0d0('0x30')]=_[_0xd0d0('0x31')](_0x14afbf[_0xd0d0('0x30')]);_0x3af916[_0xd0d0('0x3a')]=_[_0xd0d0('0x32')](_0x3af916[_0xd0d0('0x2e')],_0x3af916['query']);_0x17a691[_0xd0d0('0x33')]=_[_0xd0d0('0x32')](_0x3af916[_0xd0d0('0x2e')],qs[_0xd0d0('0x34')](_0x14afbf[_0xd0d0('0x30')][_0xd0d0('0x34')]));_0x17a691[_0xd0d0('0x33')]=_0x17a691[_0xd0d0('0x33')]['length']?_0x17a691[_0xd0d0('0x33')]:_0x3af916['model'];if(_0x14afbf[_0xd0d0('0x30')][_0xd0d0('0xb6')]){_0x17a691[_0xd0d0('0xb7')]=[{'all':!![]}];}_0x17a691=_[_0xd0d0('0xb8')]({},_0x17a691,_0x14afbf[_0xd0d0('0xb9')]);return db[_0xd0d0('0x90')]['find'](_0x17a691)[_0xd0d0('0x19')](handleEntityNotFound(_0x488090,null))['then'](respondWithResult(_0x488090,null))['catch'](handleError(_0x488090,null));};exports[_0xd0d0('0xba')]=function(_0x27b595,_0xac6ea9){return db[_0xd0d0('0x90')]['create'](_0x27b595['body'],{})['then'](respondWithResult(_0xac6ea9,0xc9))['catch'](handleError(_0xac6ea9,null));};exports[_0xd0d0('0x18')]=function(_0x44a7cb,_0xf0e0f9){if(_0x44a7cb['body']['id']){delete _0x44a7cb['body']['id'];}return db[_0xd0d0('0x90')]['find']({'where':{'id':_0x44a7cb[_0xd0d0('0xbb')]['id']}})[_0xd0d0('0x19')](handleEntityNotFound(_0xf0e0f9,null))[_0xd0d0('0x19')](saveUpdates(_0x44a7cb['body'],null))['then'](respondWithResult(_0xf0e0f9,null))[_0xd0d0('0x29')](handleError(_0xf0e0f9,null));};exports[_0xd0d0('0xbc')]=function(_0x3433b3,_0x2d7b21){return db[_0xd0d0('0x90')][_0xd0d0('0x5a')]({'where':{'id':_0x3433b3[_0xd0d0('0xbb')]['id']}})['then'](handleEntityNotFound(_0x2d7b21,null))[_0xd0d0('0x19')](removeEntity(_0x2d7b21,null))['catch'](handleError(_0x2d7b21,null));};exports[_0xd0d0('0xbd')]=function(_0x2422b0,_0x2c678f){return db[_0xd0d0('0x90')]['describe']()['then'](respondWithResult(_0x2c678f,null))['catch'](handleError(_0x2c678f,null));};exports[_0xd0d0('0xbe')]=function(_0x46b421,_0xfa11ff){return db[_0xd0d0('0xbf')]['find']({'where':{'id':_0x46b421[_0xd0d0('0xbb')]['id']}})[_0xd0d0('0x19')](handleEntityNotFound(_0xfa11ff,null))[_0xd0d0('0x19')](function(_0xd40de0){if(_0xd40de0){return _0xd40de0[_0xd0d0('0xbe')](_0x46b421[_0xd0d0('0xc0')][_0xd0d0('0xc1')],_[_0xd0d0('0xc2')](_0x46b421[_0xd0d0('0xc0')],[_0xd0d0('0xc1'),'id'])||{});}})[_0xd0d0('0x19')](respondWithResult(_0xfa11ff,null))[_0xd0d0('0x29')](handleError(_0xfa11ff,null));};exports[_0xd0d0('0xc3')]=function(_0x1dd336,_0x4a8fa1){var _0x4f6ee1={'raw':![],'where':{}};var _0x9e9f0c={};var _0x29abf1={'count':0x0,'rows':[]};return db[_0xd0d0('0x90')][_0xd0d0('0x24')]({'where':{'id':_0x1dd336[_0xd0d0('0xbb')]['id']}})[_0xd0d0('0x19')](handleEntityNotFound(_0x4a8fa1,null))[_0xd0d0('0x19')](function(_0x42a597){if(_0x42a597){_0x9e9f0c['model']=_['keys'](db[_0xd0d0('0xbf')][_0xd0d0('0x2b')]);_0x9e9f0c[_0xd0d0('0x30')]=_['keys'](_0x1dd336[_0xd0d0('0x30')]);_0x9e9f0c[_0xd0d0('0x3a')]=_[_0xd0d0('0x32')](_0x9e9f0c[_0xd0d0('0x2e')],_0x9e9f0c['query']);_0x4f6ee1[_0xd0d0('0x33')]=_[_0xd0d0('0x32')](_0x9e9f0c[_0xd0d0('0x2e')],qs[_0xd0d0('0x34')](_0x1dd336[_0xd0d0('0x30')]['fields']));_0x4f6ee1['attributes']=_0x4f6ee1[_0xd0d0('0x33')][_0xd0d0('0x58')]?_0x4f6ee1[_0xd0d0('0x33')]:_0x9e9f0c['model'];if(!_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x35')](_0xd0d0('0x36'))){_0x4f6ee1['limit']=qs[_0xd0d0('0x15')](_0x1dd336[_0xd0d0('0x30')]['limit']);_0x4f6ee1['offset']=qs[_0xd0d0('0x13')](_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x13')]);}_0x4f6ee1['order']=qs[_0xd0d0('0x38')](_0x1dd336['query'][_0xd0d0('0x38')]);_0x4f6ee1[_0xd0d0('0x39')]=qs['filters'](_['pick'](_0x1dd336['query'],_0x9e9f0c[_0xd0d0('0x3a')]));_0x4f6ee1[_0xd0d0('0x39')][_0xd0d0('0xc4')]=_0x42a597['id'];if(_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x76')]){_0x4f6ee1['where']=_[_0xd0d0('0xb8')](_0x4f6ee1[_0xd0d0('0x39')],{'$or':_['map'](_0x4f6ee1[_0xd0d0('0x33')],function(_0x383918){var _0xd083d0={};_0xd083d0[_0x383918]={'$like':'%'+_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x76')]+'%'};return _0xd083d0;})});}if(_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x6c')]){var _0x44e587=_0x1dd336[_0xd0d0('0x30')][_0xd0d0('0x6c')]['split'](',');var _0x214562={};_0x214562[_0x44e587[0x0]]={'$gte':moment(_0x44e587[0x1])['format'](_0xd0d0('0xc5'))};_0x4f6ee1[_0xd0d0('0x39')]=_[_0xd0d0('0xb8')](_0x4f6ee1[_0xd0d0('0x39')],_0x214562);}_0x4f6ee1=_['merge']({},_0x4f6ee1,_0x1dd336['options']);return db[_0xd0d0('0xbf')][_0xd0d0('0x16')]({'where':_0x4f6ee1[_0xd0d0('0x39')]})[_0xd0d0('0x19')](function(_0x15e73c){_0x29abf1[_0xd0d0('0x16')]=_0x15e73c;if(_0x1dd336['query']['includeAll']){_0x4f6ee1[_0xd0d0('0xb7')]=[{'all':!![]}];}return db[_0xd0d0('0xbf')][_0xd0d0('0xc6')](_0x4f6ee1);})['then'](function(_0x351bf2){if(_0x1dd336['query'][_0xd0d0('0xc7')]==='true'){for(var _0x7ed29b=0x0;_0x7ed29b<_0x351bf2[_0xd0d0('0x58')];_0x7ed29b++){_0x351bf2[_0x7ed29b][_0xd0d0('0xc0')]=juice(_0x351bf2[_0x7ed29b][_0xd0d0('0xc0')]);}}_0x29abf1[_0xd0d0('0xb4')]=_0x351bf2;return _0x29abf1;});}})[_0xd0d0('0x19')](respondWithFilteredResult(_0x4a8fa1,_0x4f6ee1))['catch'](handleError(_0x4a8fa1,null));};exports[_0xd0d0('0xc8')]=function(_0x3226fd,_0x3c7fa0){return db['MailInteraction'][_0xd0d0('0x5a')]({'where':{'id':_0x3226fd['params']['id']}})['then'](handleEntityNotFound(_0x3c7fa0,null))['then'](function(_0x287c01){if(_0x287c01){return _0x287c01['setTags'](_0x3226fd[_0xd0d0('0xc0')][_0xd0d0('0xc1')],_['omit'](_0x3226fd[_0xd0d0('0xc0')],['ids','id'])||{})['spread'](function(){return db[_0xd0d0('0x5f')][_0xd0d0('0xc6')]({'attributes':['id',_0xd0d0('0x2f'),'color'],'where':{'id':_0x3226fd[_0xd0d0('0xc0')][_0xd0d0('0xc1')]}});})['then'](function(_0x47ec77){socket[_0xd0d0('0xc9')](_0xd0d0('0xca'),{'id':Number(_0x3226fd[_0xd0d0('0xbb')]['id']),'tags':_0x47ec77||[]});return{'id':Number(_0x3226fd['params']['id']),'tags':_0x47ec77||[]};});}})[_0xd0d0('0x19')](respondWithResult(_0x3c7fa0,null))[_0xd0d0('0x29')](handleError(_0x3c7fa0,null));};exports[_0xd0d0('0xcb')]=function(_0x5b53f9,_0xce07a0){return db['MailInteraction'][_0xd0d0('0x5a')]({'where':{'id':_0x5b53f9['params']['id']}})[_0xd0d0('0x19')](handleEntityNotFound(_0xce07a0,null))[_0xd0d0('0x19')](function(_0x3ced78){if(_0x3ced78){return _0x3ced78[_0xd0d0('0xcb')](_0x5b53f9[_0xd0d0('0x30')][_0xd0d0('0xc1')]);}})[_0xd0d0('0x19')](respondWithStatusCode(_0xce07a0,null))['catch'](handleError(_0xce07a0,null));};exports[_0xd0d0('0xcc')]=function(_0x42b484,_0x34ca7c){var _0x2a0e63=moment()[_0xd0d0('0xcd')]()[_0xd0d0('0x8e')]();var _0x1f5239=path['join'](config['root'],_0xd0d0('0xce'),_0xd0d0('0xcf'),'tmp');var _0x1c1602=path[_0xd0d0('0xd0')](config[_0xd0d0('0xd1')],'server','files',_0xd0d0('0xd2'));var _0x9a695=path[_0xd0d0('0xd0')](_0x1f5239,_0x2a0e63);var _0xc07cd4=util[_0xd0d0('0xd3')](_0xd0d0('0xd4'),_0x42b484[_0xd0d0('0xbb')]['id'],_0x2a0e63);var _0x115151=path['join'](_0x1f5239,_0xc07cd4);var _0x3239aa=[];if(_0x42b484[_0xd0d0('0x30')][_0xd0d0('0xd2')]){_0x3239aa[_0xd0d0('0xb2')]({'model':db[_0xd0d0('0xd5')],'as':_0xd0d0('0xd6'),'raw':!![]});}var _0x3a9208=[{'model':db[_0xd0d0('0xbf')],'as':_0xd0d0('0xd7'),'attributes':['id',_0xd0d0('0xc0'),_0xd0d0('0x3f'),'to','cc','bcc',_0xd0d0('0xd8'),'createdAt'],'where':{'secret':![]},'order':qs[_0xd0d0('0x38')]('id'),'include':_0x3239aa}];return db[_0xd0d0('0x90')][_0xd0d0('0x5a')]({'where':{'id':_0x42b484[_0xd0d0('0xbb')]['id']},'include':_0x3a9208})[_0xd0d0('0x19')](handleEntityNotFound(_0x34ca7c,null))['then'](function(_0x54c875){if(_0x54c875&&_0x54c875[_0xd0d0('0xd7')]){var _0x2a22b1=_0x54c875[_0xd0d0('0xd9')]({'plain':!![]});fs[_0xd0d0('0xda')](_0x9a695);return BPromise[_0xd0d0('0xdb')](_0x2a22b1['Messages'],function(_0x33b9ee,_0x24f9a1){var _0x1b4907={'from':_0x33b9ee[_0xd0d0('0x3f')],'to':_0x33b9ee['to'],'subject':_0x33b9ee[_0xd0d0('0xd8')],'html':htmlEntities[_0xd0d0('0xdc')](_0x33b9ee[_0xd0d0('0xc0')]),'headers':{'Date':moment(_0x33b9ee[_0xd0d0('0x6a')])[_0xd0d0('0xd3')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x33b9ee['cc']){_0x1b4907[_0xd0d0('0xdd')]['Cc']=_0x33b9ee['cc'];}if(_0x33b9ee['bcc']){_0x1b4907['headers'][_0xd0d0('0xde')]=_0x33b9ee[_0xd0d0('0xdf')];}return new BPromise(function(_0x482904,_0x3fc7a8){if(_0x33b9ee[_0xd0d0('0xd6')]){for(var _0x3ab3bf=0x0;_0x3ab3bf<_0x33b9ee['Attachments']['length'];_0x3ab3bf++){var _0xb579c3=_0x33b9ee['Attachments'][_0x3ab3bf];var _0xe7b89b=path[_0xd0d0('0xd0')](_0x1c1602,_0xb579c3[_0xd0d0('0xe0')]);if(fs['existsSync'](_0xe7b89b)){_0x1b4907[_0xd0d0('0xd2')][_0xd0d0('0xb2')]({'name':_0xb579c3[_0xd0d0('0x2f')],'contentType':_0xb579c3[_0xd0d0('0x2c')],'data':fs[_0xd0d0('0xe1')](_0xe7b89b)});}}}emlformat[_0xd0d0('0xe2')](_0x1b4907,function(_0x622cac,_0x2bfe04){if(_0x622cac)return _0x3fc7a8(_0x622cac);fs[_0xd0d0('0xe3')](path['join'](_0x9a695,util[_0xd0d0('0xd3')](_0xd0d0('0xe4'),_0x24f9a1)),_0x2bfe04);return _0x482904(_0x2bfe04);});});})[_0xd0d0('0x19')](function(){return new BPromise(function(_0x2630fa,_0xf2a5c0){zipdir(_0x9a695,{'saveTo':_0x115151},function(_0x273071,_0x51675e){if(_0x273071)return _0xf2a5c0(_0x273071);return _0x2630fa(_0x51675e);});})[_0xd0d0('0x19')](function(){return new BPromise(function(_0x26c097,_0x5b24d){rimraf(_0x9a695,function(_0x3846f2){if(_0x3846f2)_0x5b24d(_0x3846f2);return _0x26c097();});});})['then'](function(){return _0x34ca7c['download'](_0x115151,_0xc07cd4,function(_0xb5ef19){if(!_0xb5ef19)fs[_0xd0d0('0xe5')](_0x115151);});});});}else{return _0x34ca7c[_0xd0d0('0x10')](0xc8);}})['catch'](handleError(_0x34ca7c,null));}; \ No newline at end of file +var _0xdc2b=['CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','order','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','isEmpty','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','all','show','params','rawAttributes','includeAll','options','create','body','describe','addMessage','ids','omit','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','true','setTags','spread','Tag','findAll','emit','unix','join','root','server','transcript-%d-%s.zip','attachments','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','download','unlinkSync','eml-format','rimraf','zip-dir','moment','util','lodash','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','update','then','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','MailInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','ui.MailInteractionId','from','user_has_mail_interactions','left_join','mail_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union'];(function(_0x29f438,_0x15d831){var _0x3d659e=function(_0x4595e8){while(--_0x4595e8){_0x29f438['push'](_0x29f438['shift']());}};_0x3d659e(++_0x15d831);}(_0xdc2b,0x7a));var _0xbdc2=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xdc2b[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require(_0xbdc2('0x0'));var rimraf=require(_0xbdc2('0x1'));var zipdir=require(_0xbdc2('0x2'));var moment=require(_0xbdc2('0x3'));var BPromise=require('bluebird');var util=require(_0xbdc2('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xbdc2('0x5'));var squel=require('squel');var juice=require(_0xbdc2('0x6'));var Redis=require(_0xbdc2('0x7'));var qs=require(_0xbdc2('0x8'));var as=require(_0xbdc2('0x9'));var logger=require(_0xbdc2('0xa'))(_0xbdc2('0xb'));var config=require(_0xbdc2('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xbdc2('0xd'));config[_0xbdc2('0xe')]=_[_0xbdc2('0xf')](config[_0xbdc2('0xe')],{'host':_0xbdc2('0x10'),'port':0x18eb});var socket=require(_0xbdc2('0x11'))(new Redis(config[_0xbdc2('0xe')]));require(_0xbdc2('0x12'))[_0xbdc2('0x13')](socket);function respondWithStatusCode(_0x3d02c9,_0x51be34){_0x51be34=_0x51be34||0xcc;return function(_0x4d2b0e){if(_0x4d2b0e){return _0x3d02c9[_0xbdc2('0x14')](_0x51be34);}return _0x3d02c9[_0xbdc2('0x15')](_0x51be34)[_0xbdc2('0x16')]();};}function respondWithResult(_0x181d98,_0x15237a){_0x15237a=_0x15237a||0xc8;return function(_0x3d2fd8){if(_0x3d2fd8){return _0x181d98[_0xbdc2('0x15')](_0x15237a)[_0xbdc2('0x17')](_0x3d2fd8);}};}function respondWithFilteredResult(_0x3a2ce1,_0xbd67b5){return function(_0x268c6b){if(_0x268c6b){var _0x2595b1=typeof _0xbd67b5[_0xbdc2('0x18')]==='undefined'&&typeof _0xbd67b5[_0xbdc2('0x19')]===_0xbdc2('0x1a');var _0x4549e3=_0x268c6b[_0xbdc2('0x1b')];var _0x1d4b51=_0x2595b1?0x0:_0xbd67b5[_0xbdc2('0x18')];var _0x3d8bda=_0x2595b1?_0x268c6b[_0xbdc2('0x1b')]:_0xbd67b5[_0xbdc2('0x18')]+_0xbd67b5[_0xbdc2('0x19')];var _0x40af03;if(_0x3d8bda>=_0x4549e3){_0x3d8bda=_0x4549e3;_0x40af03=0xc8;}else{_0x40af03=0xce;}_0x3a2ce1[_0xbdc2('0x15')](_0x40af03);return _0x3a2ce1['set']('Content-Range',_0x1d4b51+'-'+_0x3d8bda+'/'+_0x4549e3)[_0xbdc2('0x17')](_0x268c6b);}return null;};}function saveUpdates(_0x175b73){return function(_0x324983){if(_0x324983){return _0x324983[_0xbdc2('0x1c')](_0x175b73)[_0xbdc2('0x1d')](function(_0x58d51f){return _0x58d51f;});}return null;};}function removeEntity(_0x49fdc4){return function(_0xbabda9){if(_0xbabda9){return _0xbabda9['destroy']()[_0xbdc2('0x1d')](function(){_0x49fdc4[_0xbdc2('0x15')](0xcc)[_0xbdc2('0x16')]();});}};}function handleEntityNotFound(_0x2cc89b){return function(_0x3740dd){if(!_0x3740dd){_0x2cc89b[_0xbdc2('0x14')](0x194);}return _0x3740dd;};}function handleError(_0x6ea533,_0x45f86c){_0x45f86c=_0x45f86c||0x1f4;return function(_0x49fd93){logger[_0xbdc2('0x1e')](_0x49fd93['stack']);if(_0x49fd93[_0xbdc2('0x1f')]){delete _0x49fd93['name'];}_0x6ea533[_0xbdc2('0x15')](_0x45f86c)[_0xbdc2('0x20')](_0x49fd93);};}function getInteractionUsers(_0x56eb23,_0x320a9d){return new BPromise(function(_0x23529f,_0x556c82){try{if(_0x320a9d[_0x56eb23['id']]){_0x56eb23[_0xbdc2('0x21')]=_[_0xbdc2('0x22')](_0x320a9d[_0x56eb23['id']],function(_0x471a23){return{'id':_0x471a23['id'],'fullname':_0x471a23[_0xbdc2('0x23')]};});}}catch(_0x4e3c84){_0x556c82(_0x4e3c84);}_0x23529f(_0x56eb23);});}function getInteractionTags(_0x1a9b98,_0xa1dd33){return new BPromise(function(_0x595750,_0x3a50b2){try{if(_0x1a9b98[_0xbdc2('0x24')]){_0x1a9b98[_0xbdc2('0x25')]=[];_0x1a9b98['TagIds'][_0xbdc2('0x26')](',')[_0xbdc2('0x27')](function(_0x51db9b){_0x1a9b98[_0xbdc2('0x25')][_0xbdc2('0x28')](_0xa1dd33[_0x51db9b]);});}delete _0x1a9b98[_0xbdc2('0x24')];}catch(_0x431c8e){_0x3a50b2(_0x431c8e);}_0x595750(_0x1a9b98);});}function getLastMessageText(_0x182b9a){return new BPromise(function(_0x1439ae,_0x1c0810){return db[_0xbdc2('0x29')][_0xbdc2('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x182b9a['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbdc2('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xbdc2('0x2c')],'order':_0xbdc2('0x2d'),'raw':!![]})['then'](function(_0x2557a3){if(_0x2557a3&&_0x2557a3[_0xbdc2('0x2c')]){_0x182b9a[_0xbdc2('0x2e')]=_[_0xbdc2('0x2f')](_0x2557a3[_0xbdc2('0x2c')]);}_0x1439ae(_0x182b9a);})[_0xbdc2('0x30')](function(_0x187047){_0x1c0810(_0x187047);});});}function updateMailInteraction(_0x1c2518,_0x324459,_0x3bc8c6,_0x2de08d){return new BPromise(function(_0x59f2bb,_0x38f6bb){return getInteractionUsers(_0x1c2518,_0x3bc8c6)[_0xbdc2('0x1d')](function(_0x324c2c){return getInteractionTags(_0x324c2c,_0x324459);})[_0xbdc2('0x1d')](function(_0x8f9a1f){if(_0x2de08d){_0x59f2bb(getLastMessageText(_0x8f9a1f));}else{_0x59f2bb(_0x8f9a1f);}})['catch'](function(_0x7ad10a){_0x38f6bb(_0x7ad10a);});});}exports['index']=function(_0x38b866,_0x21264b){var _0x120641={},_0x21df7a={},_0x9a5723={'count':0x0,'rows':[]};var _0x36577e=_[_0xbdc2('0x22')](db[_0xbdc2('0x31')]['rawAttributes'],function(_0x918c50){return{'name':_0x918c50[_0xbdc2('0x32')],'type':_0x918c50[_0xbdc2('0x33')][_0xbdc2('0x34')]};});_0x21df7a[_0xbdc2('0x35')]=_[_0xbdc2('0x22')](_0x36577e,'name');_0x21df7a[_0xbdc2('0x36')]=_[_0xbdc2('0x37')](_0x38b866[_0xbdc2('0x36')]);_0x21df7a[_0xbdc2('0x38')]=_[_0xbdc2('0x39')](_0x21df7a['model'],_0x21df7a[_0xbdc2('0x36')]);_0x120641[_0xbdc2('0x3a')]=_[_0xbdc2('0x39')](_0x21df7a[_0xbdc2('0x35')],qs[_0xbdc2('0x3b')](_0x38b866[_0xbdc2('0x36')]['fields']));_0x120641['attributes']=_0x120641[_0xbdc2('0x3a')][_0xbdc2('0x3c')]?_0x120641[_0xbdc2('0x3a')]:_0x21df7a['model'];if(!_0x38b866[_0xbdc2('0x36')]['hasOwnProperty'](_0xbdc2('0x3d'))){_0x120641[_0xbdc2('0x19')]=qs[_0xbdc2('0x19')](_0x38b866['query']['limit']);_0x120641[_0xbdc2('0x18')]=qs['offset'](_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x18')]);}_0x120641['order']=qs[_0xbdc2('0x3e')](_0x38b866['query'][_0xbdc2('0x3e')]);_0x120641[_0xbdc2('0x3f')]=qs[_0xbdc2('0x38')](_[_0xbdc2('0x40')](_0x38b866[_0xbdc2('0x36')],_0x21df7a[_0xbdc2('0x38')]),_0x36577e);var _0x2fe346=[];var _0x2bcda3=squel['select']()[_0xbdc2('0x41')]('id')[_0xbdc2('0x41')](_0xbdc2('0x1f'))[_0xbdc2('0x41')](_0xbdc2('0x42'))['from'](_0xbdc2('0x43'));var _0x4a4393=squel[_0xbdc2('0x44')]()['field'](_0xbdc2('0x45'))[_0xbdc2('0x41')](_0xbdc2('0x46'))[_0xbdc2('0x41')](_0xbdc2('0x47'))[_0xbdc2('0x48')](_0xbdc2('0x49'),'ui')[_0xbdc2('0x4a')]('users','u','u.id\x20=\x20ui.UserId');var _0x58dc49=squel['select']()[_0xbdc2('0x48')](_0xbdc2('0x4b'),'i')[_0xbdc2('0x4a')](_0xbdc2('0x4c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xbdc2('0x4a')](_0xbdc2('0x4d'),'o',_0xbdc2('0x4e'))[_0xbdc2('0x4a')](_0xbdc2('0x4f'),'a',_0xbdc2('0x50'))[_0xbdc2('0x4a')](_0xbdc2('0x51'),'me',_0xbdc2('0x52'))[_0xbdc2('0x4a')](_0xbdc2('0x53'),'it',_0xbdc2('0x54'))[_0xbdc2('0x4a')](_0xbdc2('0x43'),'t','t.id\x20=\x20it.TagId');var _0x4478d8=squel[_0xbdc2('0x55')]();var _0x56bbe6=[];var _0x1e8220=squel[_0xbdc2('0x55')]();var _0x1b101c;if(_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x56')]){_0x1b101c=as['parseSearch'](_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x56')]);var _0x1d71c3=_0x1b101c[_0xbdc2('0x57')];for(var _0xff3f98=0x0;_0xff3f98<_0x1b101c[_0xbdc2('0x58')]['length'];_0xff3f98++){var _0x4f5cda=_0x1b101c[_0xbdc2('0x58')][_0xff3f98];var _0x4a8aa5='i';var _0x132cec=_[_0xbdc2('0x59')](_0x36577e,[_0xbdc2('0x1f'),_0x4f5cda[_0xbdc2('0x41')]]);if(!_0x132cec){switch(_0x4f5cda[_0xbdc2('0x41')]){case'unreadMessages':if(_0x4f5cda[_0xbdc2('0x5a')]==0x1){_0x58dc49[_0xbdc2('0x5b')]('`'+_0x4f5cda['field']+_0xbdc2('0x5c'));}else{_0x58dc49['having']('`'+_0x4f5cda[_0xbdc2('0x41')]+_0xbdc2('0x5d'));}break;case _0xbdc2('0x5e'):if(_0x4f5cda[_0xbdc2('0x5f')]===_0xbdc2('0x60')){if(_0x4f5cda[_0xbdc2('0x5a')][_0xbdc2('0x26')]('\x20')[_0xbdc2('0x3c')]>0x1){_0x4478d8[_0x1d71c3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbdc2('0x61')](_0x4f5cda[_0xbdc2('0x5a')]),null);}else{var _0x4bdcb8='%'+_0x4f5cda['value']+'%';_0x4478d8[_0x1d71c3](_0xbdc2('0x62'),_0x4bdcb8,_0x4bdcb8,_0x4bdcb8);}}else{_0x132cec=_['find'](_0x36577e,['name','ContactId']);_0x4f5cda['field']=_0xbdc2('0x63');_0x39cc73=as[_0xbdc2('0x64')](_0x4a8aa5,_0x132cec['type'],_0x4f5cda);_0x4478d8[_0x1d71c3](_0x39cc73[_0xbdc2('0x65')],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x66')],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x16')]);}break;case'Tag':var _0x76326=_0x4f5cda['value'][_0xbdc2('0x26')](',')['map'](function(_0x284001){return Number(_0x284001);});_0x76326[_0xbdc2('0x27')](function(_0x3430a2){_0x1e8220['or'](_0xbdc2('0x67'),'%,'+_0x3430a2+',%');});_0x56bbe6=_[_0xbdc2('0x68')](_0x56bbe6,_0x76326);break;case'User':if(_0x4f5cda[_0xbdc2('0x5f')]===_0xbdc2('0x60')){_0x4478d8[_0x1d71c3](_0xbdc2('0x69'),'%'+_0x4f5cda[_0xbdc2('0x5a')]+'%',null);}else{_0x132cec=_[_0xbdc2('0x59')](_0x36577e,[_0xbdc2('0x1f'),'UserId']);_0x4f5cda['field']=_0xbdc2('0x6a');_0x39cc73=as[_0xbdc2('0x64')](_0x4a8aa5,_0x132cec[_0xbdc2('0x33')],_0x4f5cda);_0x4478d8[_0x1d71c3](_0x39cc73['text'],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x66')],_0x39cc73['value'][_0xbdc2('0x16')]);}break;case'plainBody':_0x39cc73=as[_0xbdc2('0x64')]('me',null,_0x4f5cda);_0x4478d8[_0x1d71c3](_0x39cc73[_0xbdc2('0x65')],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x66')],_0x39cc73[_0xbdc2('0x5a')]['end']);break;}}else{var _0x39cc73=as['buildExpression'](_0x4a8aa5,_0x132cec['type'],_0x4f5cda);_0x4478d8[_0x1d71c3](_0x39cc73[_0xbdc2('0x65')],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x66')],_0x39cc73[_0xbdc2('0x5a')][_0xbdc2('0x16')]);}}}else{var _0x44db7a=_(_0x38b866['query'])[_0xbdc2('0x37')]()[_0xbdc2('0x22')](function(_0x71bbde){return _[_0xbdc2('0x6b')](_0x36577e,[_0xbdc2('0x1f'),_0x71bbde])?_0x71bbde:undefined;})[_0xbdc2('0x6c')]()[_0xbdc2('0x5a')]();if(!_['isEmpty'](_0x44db7a)){_0x44db7a[_0xbdc2('0x27')](function(_0xb43c8b){if(_0xb43c8b===_0xbdc2('0x6d')){_0x58dc49[_0xbdc2('0x3f')](_0xbdc2('0x6e'),[]['concat'](_0x38b866[_0xbdc2('0x36')][_0xb43c8b]));}else if(_0xb43c8b===_0xbdc2('0x6f')){var _0x59c66f=JSON[_0xbdc2('0x70')](_0x38b866[_0xbdc2('0x36')][_0xb43c8b])[_0xbdc2('0x71')];var _0x29a12f=JSON[_0xbdc2('0x70')](_0x38b866[_0xbdc2('0x36')][_0xb43c8b])['$lte'];_0x58dc49[_0xbdc2('0x3f')](_0xbdc2('0x72'),_0x59c66f,_0x29a12f);}else{if(_0x38b866[_0xbdc2('0x36')][_0xb43c8b]===_0xbdc2('0x73')){_0x58dc49[_0xbdc2('0x3f')]('i.'+_0xb43c8b+'\x20IS\x20NULL');}else{_0x58dc49[_0xbdc2('0x3f')]('i.'+_0xb43c8b+_0xbdc2('0x74'),_0x38b866[_0xbdc2('0x36')][_0xb43c8b]);}}});}if(_0x38b866['query'][_0xbdc2('0x75')]){if(_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x75')]==0x1){_0x58dc49[_0xbdc2('0x5b')](_0xbdc2('0x76'));}else{_0x58dc49[_0xbdc2('0x5b')](_0xbdc2('0x77'));}}if(_0x38b866[_0xbdc2('0x36')]['tag']){_0x56bbe6=_[_0xbdc2('0x78')](_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x79')])?_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x79')]:new Array(_0x38b866[_0xbdc2('0x36')]['tag']);_0x56bbe6[_0xbdc2('0x27')](function(_0x23cf9d){_0x1e8220['or'](_0xbdc2('0x67'),'%,'+_0x23cf9d+',%');});}if(_0x38b866['query']['filter']){var _0x143929=_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x7a')][_0xbdc2('0x7b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xbdc2('0x7c')](_0x143929)){_0x4478d8['or'](_0xbdc2('0x7d'),_0x143929+'%');}else if(qs['isEmail'](_0x143929)){_0x4478d8['or'](_0xbdc2('0x7e'),_0x143929+'%');}else{_0x4478d8['or'](_0xbdc2('0x7f'),qs['getFullTextValue'](_0x143929))['or'](_0xbdc2('0x80'),qs[_0xbdc2('0x61')](_0x143929));}}}_0x58dc49['where'](_0x4478d8);_0x58dc49[_0xbdc2('0x81')](_0xbdc2('0x82'));var _0x5f3bda={'type':db[_0xbdc2('0x83')][_0xbdc2('0x84')][_0xbdc2('0x85')],'raw':!![]};var _0x52b226=_0x58dc49[_0xbdc2('0x86')]();_0x52b226[_0xbdc2('0x41')](_0xbdc2('0x82'));_0x52b226[_0xbdc2('0x41')](_0xbdc2('0x87'),_0xbdc2('0x88'));if(_0x120641['order']){_0x120641['order'][_0xbdc2('0x27')](function(_0x4bc5df){var _0xb93577=_0x4bc5df[0x0]===_0xbdc2('0x89')?_0x4bc5df[0x0]:'i.'+_0x4bc5df[0x0];_0x58dc49[_0xbdc2('0x8a')](_0xb93577,_0x4bc5df[0x1]===_0xbdc2('0x8b')?![]:!![]);});}if(!_['isEmpty'](_0x56bbe6)){_0x58dc49[_0xbdc2('0x5b')](_0x1e8220);_0x52b226[_0xbdc2('0x3f')](_0xbdc2('0x8c'),_0x56bbe6);}BPromise[_0xbdc2('0x8d')]()['then'](function(){if(!_0x1b101c){if(_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x6d')])return;_0x52b226[_0xbdc2('0x3f')](_0xbdc2('0x8e'));_0x58dc49[_0xbdc2('0x3f')](_0xbdc2('0x8e'));return;}if(_0x38b866['user'][_0xbdc2('0x8f')]!==_0xbdc2('0x90'))return;return _0x38b866[_0xbdc2('0x91')][_0xbdc2('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2b7167){if(_[_0xbdc2('0x93')](_0x2b7167)){_0x52b226['where'](_0xbdc2('0x94'));_0x58dc49[_0xbdc2('0x3f')](_0xbdc2('0x94'));}else{_0x52b226['where'](_0xbdc2('0x6e'),_['map'](_0x2b7167,'id'));_0x58dc49[_0xbdc2('0x3f')](_0xbdc2('0x6e'),_[_0xbdc2('0x22')](_0x2b7167,'id'));}});})[_0xbdc2('0x1d')](function(){if(_0x38b866[_0xbdc2('0x91')][_0xbdc2('0x8f')]==='agent'&&!_0x1b101c&&!_0x38b866['query'][_0xbdc2('0x6d')])return[];return db[_0xbdc2('0x95')][_0xbdc2('0x36')](_0x52b226[_0xbdc2('0x96')](),_0x5f3bda);})[_0xbdc2('0x1d')](function(_0x2192df){_0x9a5723['count']=_0x2192df[_0xbdc2('0x3c')];if(_0x9a5723[_0xbdc2('0x1b')]===0x0)return[];return db[_0xbdc2('0x95')]['query'](_0x2bcda3['toString'](),_0x5f3bda)[_0xbdc2('0x1d')](function(_0x24880c){_0x2fe346=_['keyBy'](_0x24880c,'id');_0x5f3bda=_[_0xbdc2('0x97')](_0x5f3bda,{'model':db[_0xbdc2('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38b866[_0xbdc2('0x36')][_0xbdc2('0x3b')]){_0x120641[_0xbdc2('0x3a')][_0xbdc2('0x27')](function(_0x4fbaee){_0x58dc49[_0xbdc2('0x41')]('i.'+_0x4fbaee);});}else{_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x87'),_0xbdc2('0x88'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x98'),_0xbdc2('0x99'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x9a'),_0xbdc2('0x9b'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x9c'),_0xbdc2('0x89'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x82'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x9d'));_0x58dc49[_0xbdc2('0x41')]('i.updatedAt');_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x9e'));_0x58dc49['field']('i.closedAt');_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0x9f'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa0'));_0x58dc49['field'](_0xbdc2('0xa1'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa2'));_0x58dc49[_0xbdc2('0x41')]('i.disposition');_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa3'));_0x58dc49['field']('i.thirdDisposition');_0x58dc49[_0xbdc2('0x41')]('i.substatus');_0x58dc49[_0xbdc2('0x41')]('i.to');_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa4'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa5'));_0x58dc49['field']('i.UserId');_0x58dc49[_0xbdc2('0x41')]('c.firstName',_0xbdc2('0xa6'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa7'),_0xbdc2('0xa8'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xa9'),_0xbdc2('0xaa'));_0x58dc49[_0xbdc2('0x41')]('c.phone','Contact.phone');_0x58dc49[_0xbdc2('0x41')]('c.mobile','Contact.mobile');_0x58dc49['field'](_0xbdc2('0xab'),_0xbdc2('0xac'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xad'),_0xbdc2('0xae'));_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xaf'),'Owner.internal');_0x58dc49[_0xbdc2('0x41')](_0xbdc2('0xb0'),_0xbdc2('0x24'));}if(_0x120641[_0xbdc2('0x19')])_0x58dc49['limit'](_0x120641['limit']);if(_0x120641[_0xbdc2('0x18')])_0x58dc49['offset'](_0x120641['offset']);return db[_0xbdc2('0x95')]['query'](_0x58dc49['toString'](),_0x5f3bda);})[_0xbdc2('0x1d')](function(_0xd3db3c){if(_0xd3db3c[_0xbdc2('0x3c')]>0x0)_0x4a4393['where'](_0xbdc2('0xb1'),_[_0xbdc2('0x22')](_0xd3db3c,'id'));return db['sequelize']['query'](_0x4a4393[_0xbdc2('0x96')](),_0x5f3bda)[_0xbdc2('0x1d')](function(_0x151994){var _0x51f423=_['groupBy'](_0x151994,_0xbdc2('0xb2'));var _0x43fcbf=[];return db[_0xbdc2('0xb3')][_0xbdc2('0x2a')]({'attributes':[_0xbdc2('0xb4')],'raw':!![]})[_0xbdc2('0x1d')](function(_0x460969){var _0x1f95e7=_0x460969[_0xbdc2('0xb4')];_0xd3db3c[_0xbdc2('0x27')](function(_0x1c104f){_0x43fcbf[_0xbdc2('0x28')](updateMailInteraction(_0x1c104f,_0x2fe346,_0x51f423,_0x1f95e7));});return BPromise[_0xbdc2('0xb5')](_0x43fcbf);});});});})[_0xbdc2('0x1d')](function(_0x36b683){_0x9a5723['rows']=_0x36b683;return _0x9a5723;})[_0xbdc2('0x1d')](respondWithFilteredResult(_0x21264b,_0x120641))['catch'](handleError(_0x21264b,null));};exports[_0xbdc2('0xb6')]=function(_0x22c20f,_0x413215){var _0x1c0365={'raw':![],'where':{'id':_0x22c20f[_0xbdc2('0xb7')]['id']}},_0x50284d={};_0x50284d['model']=_[_0xbdc2('0x37')](db[_0xbdc2('0x31')][_0xbdc2('0xb8')]);_0x50284d['query']=_[_0xbdc2('0x37')](_0x22c20f[_0xbdc2('0x36')]);_0x50284d[_0xbdc2('0x38')]=_[_0xbdc2('0x39')](_0x50284d[_0xbdc2('0x35')],_0x50284d['query']);_0x1c0365[_0xbdc2('0x3a')]=_[_0xbdc2('0x39')](_0x50284d[_0xbdc2('0x35')],qs[_0xbdc2('0x3b')](_0x22c20f[_0xbdc2('0x36')][_0xbdc2('0x3b')]));_0x1c0365['attributes']=_0x1c0365[_0xbdc2('0x3a')][_0xbdc2('0x3c')]?_0x1c0365[_0xbdc2('0x3a')]:_0x50284d['model'];if(_0x22c20f['query'][_0xbdc2('0xb9')]){_0x1c0365['include']=[{'all':!![]}];}_0x1c0365=_['merge']({},_0x1c0365,_0x22c20f[_0xbdc2('0xba')]);return db['MailInteraction'][_0xbdc2('0x59')](_0x1c0365)[_0xbdc2('0x1d')](handleEntityNotFound(_0x413215,null))[_0xbdc2('0x1d')](respondWithResult(_0x413215,null))[_0xbdc2('0x30')](handleError(_0x413215,null));};exports[_0xbdc2('0xbb')]=function(_0x440abd,_0x1d544a){return db[_0xbdc2('0x31')][_0xbdc2('0xbb')](_0x440abd[_0xbdc2('0xbc')],{})['then'](respondWithResult(_0x1d544a,0xc9))[_0xbdc2('0x30')](handleError(_0x1d544a,null));};exports['update']=function(_0xa9db10,_0x3a1d83){if(_0xa9db10[_0xbdc2('0xbc')]['id']){delete _0xa9db10[_0xbdc2('0xbc')]['id'];}return db[_0xbdc2('0x31')]['find']({'where':{'id':_0xa9db10['params']['id']}})[_0xbdc2('0x1d')](handleEntityNotFound(_0x3a1d83,null))[_0xbdc2('0x1d')](saveUpdates(_0xa9db10[_0xbdc2('0xbc')],null))['then'](respondWithResult(_0x3a1d83,null))['catch'](handleError(_0x3a1d83,null));};exports['destroy']=function(_0x3bd490,_0x25f12c){return db[_0xbdc2('0x31')][_0xbdc2('0x59')]({'where':{'id':_0x3bd490[_0xbdc2('0xb7')]['id']}})['then'](handleEntityNotFound(_0x25f12c,null))[_0xbdc2('0x1d')](removeEntity(_0x25f12c,null))[_0xbdc2('0x30')](handleError(_0x25f12c,null));};exports[_0xbdc2('0xbd')]=function(_0x496616,_0x4b621e){return db['MailInteraction'][_0xbdc2('0xbd')]()[_0xbdc2('0x1d')](respondWithResult(_0x4b621e,null))[_0xbdc2('0x30')](handleError(_0x4b621e,null));};exports[_0xbdc2('0xbe')]=function(_0x1f3ffb,_0x53c0eb){return db[_0xbdc2('0x29')][_0xbdc2('0x59')]({'where':{'id':_0x1f3ffb[_0xbdc2('0xb7')]['id']}})[_0xbdc2('0x1d')](handleEntityNotFound(_0x53c0eb,null))[_0xbdc2('0x1d')](function(_0x367a74){if(_0x367a74){return _0x367a74['addMessage'](_0x1f3ffb[_0xbdc2('0xbc')][_0xbdc2('0xbf')],_[_0xbdc2('0xc0')](_0x1f3ffb[_0xbdc2('0xbc')],[_0xbdc2('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x53c0eb,null))[_0xbdc2('0x30')](handleError(_0x53c0eb,null));};exports[_0xbdc2('0xc1')]=function(_0x296d5b,_0x5adca9){var _0x2fb990={'raw':![],'where':{}};var _0x5e2000={};var _0x146cac={'count':0x0,'rows':[]};return db[_0xbdc2('0x31')][_0xbdc2('0x2a')]({'where':{'id':_0x296d5b['params']['id']}})[_0xbdc2('0x1d')](handleEntityNotFound(_0x5adca9,null))[_0xbdc2('0x1d')](function(_0x53984f){if(_0x53984f){_0x5e2000[_0xbdc2('0x35')]=_[_0xbdc2('0x37')](db[_0xbdc2('0x29')][_0xbdc2('0xb8')]);_0x5e2000[_0xbdc2('0x36')]=_[_0xbdc2('0x37')](_0x296d5b[_0xbdc2('0x36')]);_0x5e2000[_0xbdc2('0x38')]=_[_0xbdc2('0x39')](_0x5e2000[_0xbdc2('0x35')],_0x5e2000['query']);_0x2fb990['attributes']=_[_0xbdc2('0x39')](_0x5e2000[_0xbdc2('0x35')],qs[_0xbdc2('0x3b')](_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0x3b')]));_0x2fb990['attributes']=_0x2fb990[_0xbdc2('0x3a')][_0xbdc2('0x3c')]?_0x2fb990[_0xbdc2('0x3a')]:_0x5e2000[_0xbdc2('0x35')];if(!_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0xc2')](_0xbdc2('0x3d'))){_0x2fb990[_0xbdc2('0x19')]=qs['limit'](_0x296d5b['query'][_0xbdc2('0x19')]);_0x2fb990[_0xbdc2('0x18')]=qs[_0xbdc2('0x18')](_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0x18')]);}_0x2fb990[_0xbdc2('0x8a')]=qs[_0xbdc2('0x3e')](_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0x3e')]);_0x2fb990['where']=qs['filters'](_[_0xbdc2('0x40')](_0x296d5b['query'],_0x5e2000[_0xbdc2('0x38')]));_0x2fb990[_0xbdc2('0x3f')][_0xbdc2('0xb2')]=_0x53984f['id'];if(_0x296d5b['query'][_0xbdc2('0x7a')]){_0x2fb990[_0xbdc2('0x3f')]=_[_0xbdc2('0x97')](_0x2fb990[_0xbdc2('0x3f')],{'$or':_[_0xbdc2('0x22')](_0x2fb990['attributes'],function(_0x7a6b0e){var _0x1c721c={};_0x1c721c[_0x7a6b0e]={'$like':'%'+_0x296d5b[_0xbdc2('0x36')]['filter']+'%'};return _0x1c721c;})});}if(_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0x71')]){var _0x879a04=_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0x71')]['split'](',');var _0x3be6aa={};_0x3be6aa[_0x879a04[0x0]]={'$gte':moment(_0x879a04[0x1])[_0xbdc2('0xc3')](_0xbdc2('0xc4'))};_0x2fb990['where']=_[_0xbdc2('0x97')](_0x2fb990['where'],_0x3be6aa);}_0x2fb990=_[_0xbdc2('0x97')]({},_0x2fb990,_0x296d5b[_0xbdc2('0xba')]);return db['MailMessage']['count']({'where':_0x2fb990[_0xbdc2('0x3f')]})[_0xbdc2('0x1d')](function(_0xe126b7){_0x146cac[_0xbdc2('0x1b')]=_0xe126b7;if(_0x296d5b[_0xbdc2('0x36')][_0xbdc2('0xb9')]){_0x2fb990['include']=[{'all':!![]}];}return db[_0xbdc2('0x29')]['findAll'](_0x2fb990);})[_0xbdc2('0x1d')](function(_0x245089){if(_0x296d5b[_0xbdc2('0x36')]['inlineCss']===_0xbdc2('0xc5')){for(var _0x1c0a82=0x0;_0x1c0a82<_0x245089['length'];_0x1c0a82++){_0x245089[_0x1c0a82][_0xbdc2('0xbc')]=juice(_0x245089[_0x1c0a82][_0xbdc2('0xbc')]);}}_0x146cac['rows']=_0x245089;return _0x146cac;});}})['then'](respondWithFilteredResult(_0x5adca9,_0x2fb990))[_0xbdc2('0x30')](handleError(_0x5adca9,null));};exports['addTags']=function(_0x3d09ec,_0x5bf6b8){return db[_0xbdc2('0x31')][_0xbdc2('0x59')]({'where':{'id':_0x3d09ec[_0xbdc2('0xb7')]['id']}})[_0xbdc2('0x1d')](handleEntityNotFound(_0x5bf6b8,null))['then'](function(_0x4e6ac1){if(_0x4e6ac1){return _0x4e6ac1[_0xbdc2('0xc6')](_0x3d09ec[_0xbdc2('0xbc')]['ids'],_[_0xbdc2('0xc0')](_0x3d09ec[_0xbdc2('0xbc')],[_0xbdc2('0xbf'),'id'])||{})[_0xbdc2('0xc7')](function(){return db[_0xbdc2('0xc8')][_0xbdc2('0xc9')]({'attributes':['id',_0xbdc2('0x1f'),'color'],'where':{'id':_0x3d09ec[_0xbdc2('0xbc')][_0xbdc2('0xbf')]}});})[_0xbdc2('0x1d')](function(_0x5bc6d8){socket[_0xbdc2('0xca')]('mailInteractionTags:save',{'id':Number(_0x3d09ec[_0xbdc2('0xb7')]['id']),'tags':_0x5bc6d8||[]});return{'id':Number(_0x3d09ec['params']['id']),'tags':_0x5bc6d8||[]};});}})[_0xbdc2('0x1d')](respondWithResult(_0x5bf6b8,null))[_0xbdc2('0x30')](handleError(_0x5bf6b8,null));};exports['removeTags']=function(_0xe8a915,_0xbb7f68){return db[_0xbdc2('0x31')][_0xbdc2('0x59')]({'where':{'id':_0xe8a915[_0xbdc2('0xb7')]['id']}})['then'](handleEntityNotFound(_0xbb7f68,null))['then'](function(_0x59bcd1){if(_0x59bcd1){return _0x59bcd1['removeTags'](_0xe8a915[_0xbdc2('0x36')][_0xbdc2('0xbf')]);}})[_0xbdc2('0x1d')](respondWithStatusCode(_0xbb7f68,null))['catch'](handleError(_0xbb7f68,null));};exports['download']=function(_0x4c8572,_0x3a1bcf){var _0x210f3a=moment()[_0xbdc2('0xcb')]()[_0xbdc2('0x96')]();var _0x17b6e1=path[_0xbdc2('0xcc')](config['root'],'server','files','tmp');var _0x40c7d6=path['join'](config[_0xbdc2('0xcd')],_0xbdc2('0xce'),'files','attachments');var _0x52a938=path[_0xbdc2('0xcc')](_0x17b6e1,_0x210f3a);var _0x3b3ae5=util[_0xbdc2('0xc3')](_0xbdc2('0xcf'),_0x4c8572[_0xbdc2('0xb7')]['id'],_0x210f3a);var _0x181fd6=path[_0xbdc2('0xcc')](_0x17b6e1,_0x3b3ae5);var _0x349f6a=[];if(_0x4c8572[_0xbdc2('0x36')][_0xbdc2('0xd0')]){_0x349f6a[_0xbdc2('0x28')]({'model':db[_0xbdc2('0xd1')],'as':_0xbdc2('0xd2'),'raw':!![]});}var _0x4ae441=[{'model':db[_0xbdc2('0x29')],'as':_0xbdc2('0xd3'),'attributes':['id',_0xbdc2('0xbc'),_0xbdc2('0x48'),'to','cc',_0xbdc2('0xd4'),_0xbdc2('0xd5'),_0xbdc2('0x6f')],'where':{'secret':![]},'order':qs[_0xbdc2('0x3e')]('id'),'include':_0x349f6a}];return db['MailInteraction'][_0xbdc2('0x59')]({'where':{'id':_0x4c8572[_0xbdc2('0xb7')]['id']},'include':_0x4ae441})[_0xbdc2('0x1d')](handleEntityNotFound(_0x3a1bcf,null))['then'](function(_0x2e59e1){if(_0x2e59e1&&_0x2e59e1[_0xbdc2('0xd3')]){var _0x270fd0=_0x2e59e1[_0xbdc2('0xd6')]({'plain':!![]});fs[_0xbdc2('0xd7')](_0x52a938);return BPromise[_0xbdc2('0xd8')](_0x270fd0['Messages'],function(_0x1dedc2,_0x7df11b){var _0x3c5a81={'from':_0x1dedc2[_0xbdc2('0x48')],'to':_0x1dedc2['to'],'subject':_0x1dedc2[_0xbdc2('0xd5')],'html':htmlEntities[_0xbdc2('0xd9')](_0x1dedc2['body']),'headers':{'Date':moment(_0x1dedc2[_0xbdc2('0x6f')])[_0xbdc2('0xc3')](_0xbdc2('0xda'))},'attachments':[]};if(_0x1dedc2['cc']){_0x3c5a81[_0xbdc2('0xdb')]['Cc']=_0x1dedc2['cc'];}if(_0x1dedc2[_0xbdc2('0xd4')]){_0x3c5a81['headers'][_0xbdc2('0xdc')]=_0x1dedc2[_0xbdc2('0xd4')];}return new BPromise(function(_0x43658c,_0x142fbf){if(_0x1dedc2['Attachments']){for(var _0x35d8b8=0x0;_0x35d8b8<_0x1dedc2[_0xbdc2('0xd2')][_0xbdc2('0x3c')];_0x35d8b8++){var _0x4e7115=_0x1dedc2[_0xbdc2('0xd2')][_0x35d8b8];var _0x37229c=path[_0xbdc2('0xcc')](_0x40c7d6,_0x4e7115[_0xbdc2('0xdd')]);if(fs[_0xbdc2('0xde')](_0x37229c)){_0x3c5a81[_0xbdc2('0xd0')][_0xbdc2('0x28')]({'name':_0x4e7115[_0xbdc2('0x1f')],'contentType':_0x4e7115[_0xbdc2('0x33')],'data':fs['readFileSync'](_0x37229c)});}}}emlformat[_0xbdc2('0xdf')](_0x3c5a81,function(_0x2ff3d8,_0x3907f0){if(_0x2ff3d8)return _0x142fbf(_0x2ff3d8);fs[_0xbdc2('0xe0')](path[_0xbdc2('0xcc')](_0x52a938,util[_0xbdc2('0xc3')]('message%d.eml',_0x7df11b)),_0x3907f0);return _0x43658c(_0x3907f0);});});})['then'](function(){return new BPromise(function(_0x3b7597,_0x39318f){zipdir(_0x52a938,{'saveTo':_0x181fd6},function(_0x474c65,_0x238364){if(_0x474c65)return _0x39318f(_0x474c65);return _0x3b7597(_0x238364);});})[_0xbdc2('0x1d')](function(){return new BPromise(function(_0x5e6cd6,_0x33820a){rimraf(_0x52a938,function(_0x3a1263){if(_0x3a1263)_0x33820a(_0x3a1263);return _0x5e6cd6();});});})[_0xbdc2('0x1d')](function(){return _0x3a1bcf[_0xbdc2('0xe1')](_0x181fd6,_0x3b3ae5,function(_0x2f5c05){if(!_0x2f5c05)fs[_0xbdc2('0xe2')](_0x181fd6);});});});}else{return _0x3a1bcf[_0xbdc2('0x14')](0xc8);}})[_0xbdc2('0x30')](handleError(_0x3a1bcf,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index e5acb93..e14ce61 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 _0xdcca=['then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0xa9a382,_0xe7d141){var _0x3bb2a2=function(_0x5996cd){while(--_0x5996cd){_0xa9a382['push'](_0xa9a382['shift']());}};_0x3bb2a2(++_0xe7d141);}(_0xdcca,0xac));var _0xadcc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdcca[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xadcc('0x0'));var MailInteraction=require(_0xadcc('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xadcc('0x1'))['db'][_0xadcc('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xadcc('0x3')](0x0);var events={'afterCreate':_0xadcc('0x4'),'afterUpdate':_0xadcc('0x5'),'afterDestroy':_0xadcc('0x6')};function emitEvent(_0xc95f4b){return function(_0x26e720,_0x199fcf,_0xd79b44){_0x26e720[_0xadcc('0x7')]({'attributes':['id'],'raw':!![]})[_0xadcc('0x8')](function(_0xf2e0b){_0x26e720['setDataValue'](_0xadcc('0x9'),_0xf2e0b[_0xadcc('0xa')](function(_0x12081b){return{'id':_0x12081b['id']};}));return MailMessage[_0xadcc('0xb')]({'where':{'MailInteractionId':_0x26e720['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x218b0f){_0x26e720[_0xadcc('0xc')](_0xadcc('0xd'),_0x218b0f[_0xadcc('0xe')]);MailInteractionEvents[_0xadcc('0xf')](_0xc95f4b+':'+_0x26e720['id'],_0x26e720);MailInteractionEvents[_0xadcc('0xf')](_0xc95f4b,_0x26e720);_0xd79b44(null);})['catch'](_0xd79b44(null));};}for(var e in events){if(events[_0xadcc('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xadcc('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xed52=['setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','events','../../mysqldb','MailMessage','update','getUsers','then'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xed52,0x112));var _0x2ed5=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xed52[_0x139a3c];return _0x2b375b;};'use strict';var EventEmitter=require(_0x2ed5('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0x2ed5('0x1'))['db'][_0x2ed5('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2ed5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x289a7d){return function(_0x4fecb0,_0x5a9542,_0x534946){_0x4fecb0[_0x2ed5('0x4')]({'attributes':['id'],'raw':!![]})[_0x2ed5('0x5')](function(_0x2ad4d3){_0x4fecb0[_0x2ed5('0x6')](_0x2ed5('0x7'),_0x2ad4d3['map'](function(_0x4acf50){return{'id':_0x4acf50['id']};}));return MailMessage[_0x2ed5('0x8')]({'where':{'MailInteractionId':_0x4fecb0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2ed5('0x5')](function(_0x6836f7){_0x4fecb0[_0x2ed5('0x6')](_0x2ed5('0x9'),_0x6836f7[_0x2ed5('0xa')]);MailInteractionEvents[_0x2ed5('0xb')](_0x289a7d+':'+_0x4fecb0['id'],_0x4fecb0);MailInteractionEvents[_0x2ed5('0xb')](_0x289a7d,_0x4fecb0);_0x534946(null);})[_0x2ed5('0xc')](_0x534946(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x2ed5('0xd')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 1d2997c..acb0dcf 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 _0x06aa=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','get','MailMessage','update','then','catch','utf8mb4','util','../../config/logger'];(function(_0x23dca4,_0x9becfb){var _0x1ceec3=function(_0xf100b7){while(--_0xf100b7){_0x23dca4['push'](_0x23dca4['shift']());}};_0x1ceec3(++_0x9becfb);}(_0x06aa,0x1eb));var _0xa06a=function(_0x5417fe,_0x15de6b){_0x5417fe=_0x5417fe-0x0;var _0x49f253=_0x06aa[_0x5417fe];return _0x49f253;};'use strict';var _=require('lodash');var util=require(_0xa06a('0x0'));var logger=require(_0xa06a('0x1'))(_0xa06a('0x2'));var moment=require(_0xa06a('0x3'));var BPromise=require(_0xa06a('0x4'));var rp=require(_0xa06a('0x5'));var fs=require('fs');var path=require(_0xa06a('0x6'));var rimraf=require(_0xa06a('0x7'));var config=require(_0xa06a('0x8'));var attributes=require(_0xa06a('0x9'));module[_0xa06a('0xa')]=function(_0x179db7,_0x231834){return _0x179db7[_0xa06a('0xb')](_0xa06a('0xc'),attributes,{'tableName':_0xa06a('0xd'),'paranoid':![],'indexes':[{'name':_0xa06a('0xe'),'fields':['subject','to'],'type':_0xa06a('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x453da9,_0x28ef2f,_0x21ba16){if(_0x453da9[_0xa06a('0x10')]){_0x453da9[_0xa06a('0x11')]=moment()['format'](_0xa06a('0x12'));}if(_0x453da9[_0xa06a('0x13')]){_0x453da9[_0xa06a('0x14')]=moment()[_0xa06a('0x15')](_0xa06a('0x12'));}_0x21ba16(null,_0x28ef2f);},'beforeUpdate':function(_0x2cd245,_0xb5b9ae,_0x71cee0){if(_0x2cd245[_0xa06a('0x16')](_0xa06a('0x10'))){_0x2cd245[_0xa06a('0x11')]=_0x2cd245[_0xa06a('0x10')]?moment()[_0xa06a('0x15')](_0xa06a('0x12')):null;}if(_0x2cd245[_0xa06a('0x16')]('closed')){_0x2cd245[_0xa06a('0x14')]=moment()[_0xa06a('0x15')](_0xa06a('0x12'));_0x2cd245[_0xa06a('0x10')]=null;_0x2cd245[_0xa06a('0x11')]=null;}_0x71cee0(null,_0x2cd245);},'afterUpdate':function(_0x39160f,_0x5b2755,_0x4ee5bc){var _0x33f20a=_0x179db7['models'];var _0x4af9b2=_0x39160f[_0xa06a('0x17')]({'plain':!![]});if(_0x4af9b2[_0xa06a('0x13')]){return _0x33f20a[_0xa06a('0x18')][_0xa06a('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x4af9b2['id']}})[_0xa06a('0x1a')](function(){_0x4ee5bc();})[_0xa06a('0x1b')](function(_0x5a7b65){_0x4ee5bc(_0x5a7b65);});}else{_0x4ee5bc();}}},'charset':_0xa06a('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0da7=['request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatus','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x26a10d,_0xe5c001){var _0xf90201=function(_0x48535b){while(--_0x48535b){_0x26a10d['push'](_0x26a10d['shift']());}};_0xf90201(++_0xe5c001);}(_0x0da7,0x1b6));var _0x70da=function(_0x3d55a4,_0x57d61b){_0x3d55a4=_0x3d55a4-0x0;var _0x38c5c4=_0x0da7[_0x3d55a4];return _0x38c5c4;};'use strict';var _=require(_0x70da('0x0'));var util=require(_0x70da('0x1'));var logger=require(_0x70da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x70da('0x3'));var rp=require(_0x70da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70da('0x5'));var config=require('../../config/environment');var attributes=require(_0x70da('0x6'));module[_0x70da('0x7')]=function(_0x16f793,_0x3672ab){return _0x16f793[_0x70da('0x8')](_0x70da('0x9'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x70da('0xa'),'fields':[_0x70da('0xb'),'to'],'type':_0x70da('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c954e,_0x3471b0,_0x82e40a){if(_0x1c954e['substatus']){_0x1c954e[_0x70da('0xd')]=moment()[_0x70da('0xe')](_0x70da('0xf'));}if(_0x1c954e['closed']){_0x1c954e[_0x70da('0x10')]=moment()[_0x70da('0xe')](_0x70da('0xf'));}_0x82e40a(null,_0x3471b0);},'beforeUpdate':function(_0x3f471b,_0x539c0f,_0x3fd8b5){if(_0x3f471b[_0x70da('0x11')](_0x70da('0x12'))){_0x3f471b['substatusAt']=_0x3f471b['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3f471b[_0x70da('0x11')]('closed')){_0x3f471b[_0x70da('0x10')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3f471b['substatus']=null;_0x3f471b[_0x70da('0xd')]=null;}_0x3fd8b5(null,_0x3f471b);},'afterUpdate':function(_0x13e331,_0x4a4538,_0x58341c){var _0x1fd81e=_0x16f793[_0x70da('0x13')];var _0x58d288=_0x13e331[_0x70da('0x14')]({'plain':!![]});if(_0x58d288['closed']){return _0x1fd81e[_0x70da('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x58d288['id']}})[_0x70da('0x16')](function(){_0x58341c();})[_0x70da('0x17')](function(_0x41bd40){_0x58341c(_0x41bd40);});}else{_0x58341c();}}},'charset':_0x70da('0x18'),'collate':_0x70da('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 80247f9..626e02a 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 _0x8ec8=['error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where','attributes','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x96afb5,_0x324c09){var _0x4e1e19=function(_0x1343b4){while(--_0x1343b4){_0x96afb5['push'](_0x96afb5['shift']());}};_0x4e1e19(++_0x324c09);}(_0x8ec8,0xdf));var _0x88ec=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8ec8[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x88ec('0x0'));var moment=require(_0x88ec('0x1'));var BPromise=require(_0x88ec('0x2'));var rs=require(_0x88ec('0x3'));var fs=require('fs');var Redis=require(_0x88ec('0x4'));var db=require(_0x88ec('0x5'))['db'];var utils=require(_0x88ec('0x6'));var logger=require(_0x88ec('0x7'))(_0x88ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x88ec('0x9'));var client=jayson[_0x88ec('0xa')]['http']({'port':0x232a});config[_0x88ec('0xb')]=_['defaults'](config[_0x88ec('0xb')],{'host':_0x88ec('0xc'),'port':0x18eb});var socket=require(_0x88ec('0xd'))(new Redis(config[_0x88ec('0xb')]));require(_0x88ec('0xe'))[_0x88ec('0xf')](socket);function respondWithRpcPromise(_0x31d0c8,_0x2e0638,_0x11484e){return new BPromise(function(_0x406a9e,_0x1841b0){return client['request'](_0x31d0c8,_0x11484e)[_0x88ec('0x10')](function(_0x58528b){logger[_0x88ec('0x11')](_0x88ec('0x12'),_0x2e0638,_0x88ec('0x13'));logger[_0x88ec('0x14')](_0x88ec('0x15'),_0x2e0638,_0x88ec('0x13'),JSON[_0x88ec('0x16')](_0x58528b));if(_0x58528b[_0x88ec('0x17')]){if(_0x58528b[_0x88ec('0x17')][_0x88ec('0x18')]===0x1f4){logger[_0x88ec('0x17')](_0x88ec('0x12'),_0x2e0638,_0x58528b[_0x88ec('0x17')][_0x88ec('0x19')]);return _0x1841b0(_0x58528b['error'][_0x88ec('0x19')]);}logger[_0x88ec('0x17')](_0x88ec('0x12'),_0x2e0638,_0x58528b[_0x88ec('0x17')][_0x88ec('0x19')]);return _0x406a9e(_0x58528b[_0x88ec('0x17')]['message']);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x2e0638,_0x88ec('0x13'));_0x406a9e(_0x58528b[_0x88ec('0x1a')][_0x88ec('0x19')]);}})[_0x88ec('0x1b')](function(_0x384f5e){logger['error']('MailInteraction,\x20%s,\x20%s',_0x2e0638,_0x384f5e);_0x1841b0(_0x384f5e);});});}exports[_0x88ec('0x1c')]=function(_0x2ad072){var _0x125407=this;return new Promise(function(_0x2ed7e2,_0x374507){return db[_0x88ec('0x1d')]['update'](_0x2ad072[_0x88ec('0x1e')],{'raw':_0x2ad072[_0x88ec('0x1f')]?_0x2ad072[_0x88ec('0x1f')][_0x88ec('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ad072[_0x88ec('0x1f')]?_0x2ad072[_0x88ec('0x1f')][_0x88ec('0x21')]||null:null,'attributes':_0x2ad072[_0x88ec('0x1f')]?_0x2ad072[_0x88ec('0x1f')][_0x88ec('0x22')]||null:null,'limit':_0x2ad072[_0x88ec('0x1f')]?_0x2ad072[_0x88ec('0x1f')]['limit']||null:null})[_0x88ec('0x10')](function(_0x316439){logger[_0x88ec('0x11')]('UpdateMailInteraction',_0x2ad072);logger[_0x88ec('0x14')](_0x88ec('0x1c'),_0x2ad072,JSON[_0x88ec('0x16')](_0x316439));_0x2ed7e2(_0x316439);})[_0x88ec('0x1b')](function(_0x96a590){logger['error'](_0x88ec('0x1c'),_0x96a590[_0x88ec('0x19')],_0x2ad072);_0x374507(_0x125407[_0x88ec('0x17')](0x1f4,_0x96a590['message']));});});};exports[_0x88ec('0x23')]=function(_0x31179a){return new Promise(function(_0xb05373,_0x30e4a0){return db[_0x88ec('0x1d')][_0x88ec('0x24')]({'where':_0x31179a['options']?_0x31179a[_0x88ec('0x1f')]['where']||null:null})['then'](function(_0x4ad4d9){if(_0x4ad4d9){return _0x4ad4d9['addTags'](_0x31179a[_0x88ec('0x1e')][_0x88ec('0x25')],_[_0x88ec('0x26')](_0x31179a[_0x88ec('0x1e')],[_0x88ec('0x25'),'id'])||{});}})[_0x88ec('0x27')](function(_0x3683b4){logger[_0x88ec('0x11')]('AddTags',_0x31179a);logger[_0x88ec('0x14')](_0x88ec('0x28'),_0x31179a,JSON['stringify'](_0x3683b4));_0xb05373(_0x3683b4);})[_0x88ec('0x1b')](function(_0x566302){logger[_0x88ec('0x17')]('AddTags',_0x566302[_0x88ec('0x19')],_0x31179a);_0x30e4a0(_this[_0x88ec('0x17')](0x1f4,_0x566302[_0x88ec('0x19')]));});});}; \ No newline at end of file +var _0x4d4c=['AddTagsToMailInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','info','request\x20sent','debug','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit'];(function(_0x55de53,_0x5da3e7){var _0x362fbe=function(_0x3ed4fd){while(--_0x3ed4fd){_0x55de53['push'](_0x55de53['shift']());}};_0x362fbe(++_0x5da3e7);}(_0x4d4c,0x1f2));var _0xc4d4=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x4d4c[_0x199bc4];return _0x136ffb;};'use strict';var _=require(_0xc4d4('0x0'));var util=require('util');var moment=require(_0xc4d4('0x1'));var BPromise=require(_0xc4d4('0x2'));var rs=require(_0xc4d4('0x3'));var fs=require('fs');var Redis=require(_0xc4d4('0x4'));var db=require(_0xc4d4('0x5'))['db'];var utils=require(_0xc4d4('0x6'));var logger=require(_0xc4d4('0x7'))(_0xc4d4('0x8'));var config=require(_0xc4d4('0x9'));var jayson=require(_0xc4d4('0xa'));var client=jayson['client'][_0xc4d4('0xb')]({'port':0x232a});config[_0xc4d4('0xc')]=_['defaults'](config[_0xc4d4('0xc')],{'host':_0xc4d4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0xc4d4('0xe')](socket);function respondWithRpcPromise(_0x1917c3,_0x2e2ad7,_0x23c870){return new BPromise(function(_0x2583bc,_0x5a1555){return client[_0xc4d4('0xf')](_0x1917c3,_0x23c870)[_0xc4d4('0x10')](function(_0x10ed9c){logger[_0xc4d4('0x11')]('MailInteraction,\x20%s,\x20%s',_0x2e2ad7,_0xc4d4('0x12'));logger[_0xc4d4('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2e2ad7,_0xc4d4('0x12'),JSON[_0xc4d4('0x14')](_0x10ed9c));if(_0x10ed9c[_0xc4d4('0x15')]){if(_0x10ed9c[_0xc4d4('0x15')][_0xc4d4('0x16')]===0x1f4){logger[_0xc4d4('0x15')]('MailInteraction,\x20%s,\x20%s',_0x2e2ad7,_0x10ed9c['error']['message']);return _0x5a1555(_0x10ed9c['error'][_0xc4d4('0x17')]);}logger[_0xc4d4('0x15')]('MailInteraction,\x20%s,\x20%s',_0x2e2ad7,_0x10ed9c[_0xc4d4('0x15')][_0xc4d4('0x17')]);return _0x2583bc(_0x10ed9c[_0xc4d4('0x15')][_0xc4d4('0x17')]);}else{logger[_0xc4d4('0x11')](_0xc4d4('0x18'),_0x2e2ad7,_0xc4d4('0x12'));_0x2583bc(_0x10ed9c['result'][_0xc4d4('0x17')]);}})[_0xc4d4('0x19')](function(_0x5a5a36){logger[_0xc4d4('0x15')](_0xc4d4('0x18'),_0x2e2ad7,_0x5a5a36);_0x5a1555(_0x5a5a36);});});}exports[_0xc4d4('0x1a')]=function(_0x46d679){var _0x13e061=this;return new Promise(function(_0x4f803a,_0x465283){return db[_0xc4d4('0x1b')][_0xc4d4('0x1c')](_0x46d679[_0xc4d4('0x1d')],{'raw':_0x46d679[_0xc4d4('0x1e')]?_0x46d679[_0xc4d4('0x1e')][_0xc4d4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46d679[_0xc4d4('0x1e')]?_0x46d679['options'][_0xc4d4('0x20')]||null:null,'attributes':_0x46d679[_0xc4d4('0x1e')]?_0x46d679[_0xc4d4('0x1e')][_0xc4d4('0x21')]||null:null,'limit':_0x46d679['options']?_0x46d679['options'][_0xc4d4('0x22')]||null:null})['then'](function(_0x5ef1f3){logger['info'](_0xc4d4('0x1a'),_0x46d679);logger[_0xc4d4('0x13')](_0xc4d4('0x1a'),_0x46d679,JSON[_0xc4d4('0x14')](_0x5ef1f3));_0x4f803a(_0x5ef1f3);})[_0xc4d4('0x19')](function(_0x2c0f03){logger['error'](_0xc4d4('0x1a'),_0x2c0f03[_0xc4d4('0x17')],_0x46d679);_0x465283(_0x13e061[_0xc4d4('0x15')](0x1f4,_0x2c0f03[_0xc4d4('0x17')]));});});};exports[_0xc4d4('0x23')]=function(_0x5d9089){return new Promise(function(_0x4938bd,_0x4883e0){return db['MailInteraction'][_0xc4d4('0x24')]({'where':_0x5d9089['options']?_0x5d9089['options'][_0xc4d4('0x20')]||null:null})[_0xc4d4('0x10')](function(_0x2286b1){if(_0x2286b1){return _0x2286b1[_0xc4d4('0x25')](_0x5d9089[_0xc4d4('0x1d')][_0xc4d4('0x26')],_['omit'](_0x5d9089[_0xc4d4('0x1d')],[_0xc4d4('0x26'),'id'])||{});}})[_0xc4d4('0x27')](function(_0x4872f9){logger[_0xc4d4('0x11')]('AddTags',_0x5d9089);logger[_0xc4d4('0x13')](_0xc4d4('0x28'),_0x5d9089,JSON['stringify'](_0x4872f9));_0x4938bd(_0x4872f9);})[_0xc4d4('0x19')](function(_0x345d2a){logger[_0xc4d4('0x15')]('AddTags',_0x345d2a['message'],_0x5d9089);_0x4883e0(_this[_0xc4d4('0x15')](0x1f4,_0x345d2a[_0xc4d4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 57e2d30..ea21b08 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 _0x05e2=['mailInteraction:','./mailInteraction.events','update','emit','removeListener','length'];(function(_0x3cdeb4,_0x508c92){var _0x9c246d=function(_0x3a540a){while(--_0x3a540a){_0x3cdeb4['push'](_0x3cdeb4['shift']());}};_0x9c246d(++_0x508c92);}(_0x05e2,0xc7));var _0x205e=function(_0x2bf6be,_0x5b23f1){_0x2bf6be=_0x2bf6be-0x0;var _0x532ef4=_0x05e2[_0x2bf6be];return _0x532ef4;};'use strict';var MailInteractionEvents=require(_0x205e('0x0'));var events=['save','remove',_0x205e('0x1')];function createListener(_0x52c736,_0x13363a){return function(_0x335f75){_0x13363a[_0x205e('0x2')](_0x52c736,_0x335f75);};}function removeListener(_0x49cb9a,_0x3a07c0){return function(){MailInteractionEvents[_0x205e('0x3')](_0x49cb9a,_0x3a07c0);};}exports['register']=function(_0x5b4225){for(var _0x2aa875=0x0,_0x1fc9cb=events[_0x205e('0x4')];_0x2aa875<_0x1fc9cb;_0x2aa875++){var _0xc906e3=events[_0x2aa875];var _0x2c2650=createListener(_0x205e('0x5')+_0xc906e3,_0x5b4225);MailInteractionEvents['on'](_0xc906e3,_0x2c2650);}}; \ No newline at end of file +var _0xc4ca=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x3cfd75,_0x32ca5f){var _0xb4511a=function(_0x26a052){while(--_0x26a052){_0x3cfd75['push'](_0x3cfd75['shift']());}};_0xb4511a(++_0x32ca5f);}(_0xc4ca,0xc6));var _0xac4c=function(_0x2472d5,_0x876f14){_0x2472d5=_0x2472d5-0x0;var _0x39261c=_0xc4ca[_0x2472d5];return _0x39261c;};'use strict';var MailInteractionEvents=require(_0xac4c('0x0'));var events=[_0xac4c('0x1'),_0xac4c('0x2'),_0xac4c('0x3')];function createListener(_0x3f20bf,_0x36c773){return function(_0x3020cd){_0x36c773[_0xac4c('0x4')](_0x3f20bf,_0x3020cd);};}function removeListener(_0x4d4806,_0x4832e8){return function(){MailInteractionEvents[_0xac4c('0x5')](_0x4d4806,_0x4832e8);};}exports[_0xac4c('0x6')]=function(_0x47c05f){for(var _0x3fa41a=0x0,_0x123450=events[_0xac4c('0x7')];_0x3fa41a<_0x123450;_0x3fa41a++){var _0x18a3f5=events[_0x3fa41a];var _0x582990=createListener(_0xac4c('0x8')+_0x18a3f5,_0x47c05f);MailInteractionEvents['on'](_0x18a3f5,_0x582990);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 773d3ad..c62b8b2 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 _0x6a47=['reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','/describe','get','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','put','/:id/accept','accept'];(function(_0x5a9a68,_0x593abf){var _0xef63e3=function(_0x291790){while(--_0x291790){_0x5a9a68['push'](_0x5a9a68['shift']());}};_0xef63e3(++_0x593abf);}(_0x6a47,0x112));var _0x76a4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x6a47[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var path=require(_0x76a4('0x2'));var timeout=require(_0x76a4('0x3'));var express=require(_0x76a4('0x4'));var router=express['Router']();var fs_extra=require(_0x76a4('0x5'));var auth=require(_0x76a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76a4('0x7'));var controller=require(_0x76a4('0x8'));router['get']('/',auth[_0x76a4('0x9')](),controller[_0x76a4('0xa')]);router['get'](_0x76a4('0xb'),auth[_0x76a4('0x9')](),controller['describe']);router[_0x76a4('0xc')](_0x76a4('0xd'),auth[_0x76a4('0x9')](),controller['show']);router[_0x76a4('0xc')](_0x76a4('0xe'),auth[_0x76a4('0x9')](),controller[_0x76a4('0xf')]);router[_0x76a4('0x10')]('/',auth[_0x76a4('0x9')](),interaction[_0x76a4('0x11')](_0x76a4('0x12'),_0x76a4('0x13')),controller['create']);router[_0x76a4('0x14')](_0x76a4('0xd'),auth[_0x76a4('0x9')](),controller['update']);router[_0x76a4('0x14')](_0x76a4('0x15'),auth['isAuthenticated'](),controller[_0x76a4('0x16')]);router[_0x76a4('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x76a4('0x17')]);router[_0x76a4('0x18')]('/:id',auth[_0x76a4('0x9')](),controller[_0x76a4('0x19')]);module[_0x76a4('0x1a')]=router; \ No newline at end of file +var _0xdf96=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x3d869c,_0x1a903a){var _0x6855e2=function(_0x3b2b38){while(--_0x3b2b38){_0x3d869c['push'](_0x3d869c['shift']());}};_0x6855e2(++_0x1a903a);}(_0xdf96,0xfc));var _0x6df9=function(_0x4300f,_0x13c30a){_0x4300f=_0x4300f-0x0;var _0x3a3a5d=_0xdf96[_0x4300f];return _0x3a3a5d;};'use strict';var multer=require(_0x6df9('0x0'));var util=require(_0x6df9('0x1'));var path=require('path');var timeout=require(_0x6df9('0x2'));var express=require(_0x6df9('0x3'));var router=express['Router']();var fs_extra=require(_0x6df9('0x4'));var auth=require(_0x6df9('0x5'));var interaction=require(_0x6df9('0x6'));var config=require('../../config/environment');var controller=require(_0x6df9('0x7'));router[_0x6df9('0x8')]('/',auth[_0x6df9('0x9')](),controller[_0x6df9('0xa')]);router['get'](_0x6df9('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6df9('0x8')](_0x6df9('0xc'),auth[_0x6df9('0x9')](),controller['show']);router[_0x6df9('0x8')]('/:id/download',auth[_0x6df9('0x9')](),controller[_0x6df9('0xd')]);router[_0x6df9('0xe')]('/',auth[_0x6df9('0x9')](),interaction[_0x6df9('0xf')](_0x6df9('0x10'),_0x6df9('0x11')),controller[_0x6df9('0x12')]);router[_0x6df9('0x13')]('/:id',auth[_0x6df9('0x9')](),controller[_0x6df9('0x14')]);router[_0x6df9('0x13')](_0x6df9('0x15'),auth[_0x6df9('0x9')](),controller[_0x6df9('0x16')]);router[_0x6df9('0x13')](_0x6df9('0x17'),auth[_0x6df9('0x9')](),controller[_0x6df9('0x18')]);router[_0x6df9('0x19')]('/:id',auth[_0x6df9('0x9')](),controller[_0x6df9('0x1a')]);module[_0x6df9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b0ffc52..cb787d5 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 _0x8c26=['STRING','DATE','INTEGER','ENUM','Email','Chat','sequelize','lodash','exports','long','TEXT','medium','BOOLEAN','out'];(function(_0x4c2ea9,_0x2a2c51){var _0x2f8cc5=function(_0x525ad0){while(--_0x525ad0){_0x4c2ea9['push'](_0x4c2ea9['shift']());}};_0x2f8cc5(++_0x2a2c51);}(_0x8c26,0x1b8));var _0x68c2=function(_0x41e268,_0x11f1ed){_0x41e268=_0x41e268-0x0;var _0x1b8c3b=_0x8c26[_0x41e268];return _0x1b8c3b;};'use strict';var Sequelize=require(_0x68c2('0x0'));var _=require(_0x68c2('0x1'));module[_0x68c2('0x2')]={'body':{'type':Sequelize['TEXT'](_0x68c2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x68c2('0x4')](_0x68c2('0x5'))},'read':{'type':Sequelize[_0x68c2('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x68c2('0x7')),'defaultValue':_0x68c2('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x68c2('0x8')](0x1fe)},'from':{'type':Sequelize[_0x68c2('0x8')]},'to':{'type':Sequelize[_0x68c2('0x4')]('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x68c2('0x4')](_0x68c2('0x3'))},'subject':{'type':Sequelize[_0x68c2('0x4')]},'sentAt':{'type':Sequelize[_0x68c2('0x9')]},'attach':{'type':Sequelize[_0x68c2('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x68c2('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x68c2('0x9')]},'originTo':{'type':Sequelize[_0x68c2('0x4')]('long')},'originCc':{'type':Sequelize[_0x68c2('0x4')]('long')},'originChannel':{'type':Sequelize[_0x68c2('0xb')](_0x68c2('0xc'),_0x68c2('0xd')),'defaultValue':_0x68c2('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xc23c=['ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','exports','long','TEXT','BOOLEAN'];(function(_0x3845e6,_0x599875){var _0x1dfa93=function(_0x1677fc){while(--_0x1677fc){_0x3845e6['push'](_0x3845e6['shift']());}};_0x1dfa93(++_0x599875);}(_0xc23c,0x8b));var _0xcc23=function(_0x23db26,_0x5083b0){_0x23db26=_0x23db26-0x0;var _0x7d47a9=_0xc23c[_0x23db26];return _0x7d47a9;};'use strict';var Sequelize=require(_0xcc23('0x0'));var _=require('lodash');module[_0xcc23('0x1')]={'body':{'type':Sequelize['TEXT'](_0xcc23('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xcc23('0x3')]('medium')},'read':{'type':Sequelize[_0xcc23('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcc23('0x5')]('in',_0xcc23('0x6')),'defaultValue':_0xcc23('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcc23('0x7')](0x1fe)},'from':{'type':Sequelize[_0xcc23('0x7')]},'to':{'type':Sequelize[_0xcc23('0x3')](_0xcc23('0x2'))},'cc':{'type':Sequelize[_0xcc23('0x3')](_0xcc23('0x2'))},'bcc':{'type':Sequelize[_0xcc23('0x3')](_0xcc23('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xcc23('0x8')]},'attach':{'type':Sequelize[_0xcc23('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcc23('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcc23('0x8')]},'originTo':{'type':Sequelize[_0xcc23('0x3')](_0xcc23('0x2'))},'originCc':{'type':Sequelize[_0xcc23('0x3')](_0xcc23('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0xcc23('0xa'),_0xcc23('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8481780..ac33ab2 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 _0x7675=['server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Attachments','basename','existsSync','readFileSync','build','writeFileSync','eml-format','moment','lodash','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','count','update','end','sendStatus','send','index','map','MailMessage','rawAttributes','fieldName','key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','find','body','params','destroy','describe','create','secret','split','findOne','CmList','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','secure','authentication','auth','user','pass','attachments','length','root','List','CmContact','ListId','SendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','readAt','UserId','get','MailInteraction','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','agent','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','download','unix','toString','join'];(function(_0x930cf7,_0x368e48){var _0x151ce3=function(_0x5a3def){while(--_0x5a3def){_0x930cf7['push'](_0x930cf7['shift']());}};_0x151ce3(++_0x368e48);}(_0x7675,0x1e1));var _0x5767=function(_0x10f5b6,_0x29ccfe){_0x10f5b6=_0x10f5b6-0x0;var _0x49aef1=_0x7675[_0x10f5b6];return _0x49aef1;};'use strict';var emlformat=require(_0x5767('0x0'));var moment=require(_0x5767('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x5767('0x2'));var Redis=require('ioredis');var htmlToText=require(_0x5767('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x5767('0x4'))(_0x5767('0x5'));var interaction_log=require(_0x5767('0x4'))(_0x5767('0x6'));var config=require(_0x5767('0x7'));var db=require('../../mysqldb')['db'];config[_0x5767('0x8')]=_[_0x5767('0x9')](config[_0x5767('0x8')],{'host':_0x5767('0xa'),'port':0x18eb});var socket=require(_0x5767('0xb'))(new Redis(config['redis']));var htmlEntities=require(_0x5767('0xc'));require(_0x5767('0xd'))[_0x5767('0xe')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5767('0xf')][_0x5767('0x10')]({'port':0x232c});var client9003=jayson[_0x5767('0xf')][_0x5767('0x10')]({'port':0x232b});var client9002=jayson['client'][_0x5767('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x580551,_0x1db549,_0x4600e9,_0x14ca9e){return new BPromise(function(_0x39ded5,_0x1be7d1){var _0x11248d=_0x14ca9e||client;return _0x11248d[_0x5767('0x11')](_0x580551,_0x4600e9)[_0x5767('0x12')](function(_0x368089){logger['info']('MailMessage,\x20%s,\x20%s',_0x1db549,_0x5767('0x13'));logger[_0x5767('0x14')](_0x5767('0x15'),_0x1db549,_0x5767('0x13'),JSON[_0x5767('0x16')](_0x368089));if(_0x368089['error']){if(_0x368089[_0x5767('0x17')]['code']===0x1f4){logger[_0x5767('0x17')](_0x5767('0x18'),_0x1db549,_0x368089[_0x5767('0x17')]['message']);return _0x1be7d1(_0x368089[_0x5767('0x17')][_0x5767('0x19')]);}logger[_0x5767('0x17')]('MailMessage,\x20%s,\x20%s',_0x1db549,_0x368089[_0x5767('0x17')][_0x5767('0x19')]);return _0x39ded5(_0x368089[_0x5767('0x17')][_0x5767('0x19')]);}else{logger[_0x5767('0x1a')]('MailMessage,\x20%s,\x20%s',_0x1db549,'request\x20sent');_0x39ded5(_0x368089[_0x5767('0x1b')][_0x5767('0x19')]);}})[_0x5767('0x1c')](function(_0x16b990){logger[_0x5767('0x17')](_0x5767('0x18'),_0x1db549,_0x16b990);_0x1be7d1(_0x16b990);});});}function respondWithResult(_0x226080,_0xa4af23){_0xa4af23=_0xa4af23||0xc8;return function(_0x558b1e){if(_0x558b1e){return _0x226080[_0x5767('0x1d')](_0xa4af23)[_0x5767('0x1e')](_0x558b1e);}};}function respondWithFilteredResult(_0x3c452b,_0x4b4718){return function(_0x3a2f61){if(_0x3a2f61){var _0x429591=typeof _0x4b4718[_0x5767('0x1f')]===_0x5767('0x20')&&typeof _0x4b4718[_0x5767('0x21')]==='undefined';var _0x31701a=_0x3a2f61[_0x5767('0x22')];var _0x3c6b32=_0x429591?0x0:_0x4b4718[_0x5767('0x1f')];var _0x208420=_0x429591?_0x3a2f61[_0x5767('0x22')]:_0x4b4718['offset']+_0x4b4718[_0x5767('0x21')];var _0x3b38f9;if(_0x208420>=_0x31701a){_0x208420=_0x31701a;_0x3b38f9=0xc8;}else{_0x3b38f9=0xce;}_0x3c452b['status'](_0x3b38f9);return _0x3c452b['set']('Content-Range',_0x3c6b32+'-'+_0x208420+'/'+_0x31701a)[_0x5767('0x1e')](_0x3a2f61);}return null;};}function saveUpdates(_0x448434){return function(_0x21a86d){if(_0x21a86d){return _0x21a86d[_0x5767('0x23')](_0x448434)[_0x5767('0x12')](function(_0x19ea2a){return _0x19ea2a;});}return null;};}function removeEntity(_0x1af1ad){return function(_0x39bf0f){if(_0x39bf0f){return _0x39bf0f['destroy']()[_0x5767('0x12')](function(){_0x1af1ad[_0x5767('0x1d')](0xcc)[_0x5767('0x24')]();});}};}function handleEntityNotFound(_0x4991e3){return function(_0x5db4fc){if(!_0x5db4fc){_0x4991e3[_0x5767('0x25')](0x194);}return _0x5db4fc;};}function handleError(_0x4ae55e,_0x303323){_0x303323=_0x303323||0x1f4;return function(_0x370835){logger[_0x5767('0x17')](_0x370835['stack']);if(_0x370835['name']){delete _0x370835['name'];}_0x4ae55e[_0x5767('0x1d')](_0x303323)[_0x5767('0x26')](_0x370835);};}exports[_0x5767('0x27')]=function(_0x20a69e,_0x427b6e){var _0x57555e={},_0x3c753f={},_0x1c184c={'count':0x0,'rows':[]};var _0x46c089=_[_0x5767('0x28')](db[_0x5767('0x29')][_0x5767('0x2a')],function(_0x7845a1){return{'name':_0x7845a1[_0x5767('0x2b')],'type':_0x7845a1['type'][_0x5767('0x2c')]};});_0x3c753f['model']=_[_0x5767('0x28')](_0x46c089,_0x5767('0x2d'));_0x3c753f[_0x5767('0x2e')]=_[_0x5767('0x2f')](_0x20a69e[_0x5767('0x2e')]);_0x3c753f[_0x5767('0x30')]=_[_0x5767('0x31')](_0x3c753f[_0x5767('0x32')],_0x3c753f[_0x5767('0x2e')]);_0x57555e[_0x5767('0x33')]=_['intersection'](_0x3c753f[_0x5767('0x32')],qs[_0x5767('0x34')](_0x20a69e[_0x5767('0x2e')][_0x5767('0x34')]));_0x57555e[_0x5767('0x33')]=_0x57555e['attributes']['length']?_0x57555e[_0x5767('0x33')]:_0x3c753f[_0x5767('0x32')];if(!_0x20a69e[_0x5767('0x2e')][_0x5767('0x35')]('nolimit')){_0x57555e[_0x5767('0x21')]=qs[_0x5767('0x21')](_0x20a69e[_0x5767('0x2e')][_0x5767('0x21')]);_0x57555e[_0x5767('0x1f')]=qs[_0x5767('0x1f')](_0x20a69e[_0x5767('0x2e')]['offset']);}_0x57555e[_0x5767('0x36')]=qs[_0x5767('0x37')](_0x20a69e[_0x5767('0x2e')]['sort']);_0x57555e[_0x5767('0x38')]=qs[_0x5767('0x30')](_[_0x5767('0x39')](_0x20a69e['query'],_0x3c753f[_0x5767('0x30')]),_0x46c089);if(_0x20a69e[_0x5767('0x2e')][_0x5767('0x3a')]){_0x57555e['where']=_[_0x5767('0x3b')](_0x57555e[_0x5767('0x38')],{'$or':_[_0x5767('0x28')](_0x46c089,function(_0x4eb539){if(_0x4eb539[_0x5767('0x3c')]!==_0x5767('0x3d')){var _0x1047b0={};_0x1047b0[_0x4eb539[_0x5767('0x2d')]]={'$like':'%'+_0x20a69e[_0x5767('0x2e')][_0x5767('0x3a')]+'%'};return _0x1047b0;}})});}_0x57555e=_['merge']({},_0x57555e,_0x20a69e[_0x5767('0x3e')]);var _0x16ca61={'where':_0x57555e[_0x5767('0x38')]};return db[_0x5767('0x29')][_0x5767('0x22')](_0x16ca61)['then'](function(_0x5e155b){_0x1c184c[_0x5767('0x22')]=_0x5e155b;if(_0x20a69e['query'][_0x5767('0x3f')]){_0x57555e['include']=[{'all':!![]}];}return db[_0x5767('0x29')][_0x5767('0x40')](_0x57555e);})[_0x5767('0x12')](function(_0x1cee96){_0x1c184c[_0x5767('0x41')]=_0x1cee96;return _0x1c184c;})[_0x5767('0x12')](respondWithFilteredResult(_0x427b6e,_0x57555e))[_0x5767('0x1c')](handleError(_0x427b6e,null));};exports[_0x5767('0x42')]=function(_0x448bbf,_0x2c0b85){var _0x2635ee={'raw':!![],'where':{'id':_0x448bbf['params']['id']}},_0x2e3fb8={};_0x2e3fb8[_0x5767('0x32')]=_[_0x5767('0x2f')](db[_0x5767('0x29')][_0x5767('0x2a')]);_0x2e3fb8[_0x5767('0x2e')]=_['keys'](_0x448bbf['query']);_0x2e3fb8[_0x5767('0x30')]=_['intersection'](_0x2e3fb8[_0x5767('0x32')],_0x2e3fb8[_0x5767('0x2e')]);_0x2635ee['attributes']=_[_0x5767('0x31')](_0x2e3fb8[_0x5767('0x32')],qs[_0x5767('0x34')](_0x448bbf[_0x5767('0x2e')]['fields']));_0x2635ee[_0x5767('0x33')]=_0x2635ee[_0x5767('0x33')]['length']?_0x2635ee[_0x5767('0x33')]:_0x2e3fb8[_0x5767('0x32')];if(_0x448bbf[_0x5767('0x2e')][_0x5767('0x3f')]){_0x2635ee['include']=[{'all':!![]}];}_0x2635ee=_[_0x5767('0x3b')]({},_0x2635ee,_0x448bbf[_0x5767('0x3e')]);return db[_0x5767('0x29')][_0x5767('0x43')](_0x2635ee)['then'](handleEntityNotFound(_0x2c0b85,null))[_0x5767('0x12')](respondWithResult(_0x2c0b85,null))[_0x5767('0x1c')](handleError(_0x2c0b85,null));};exports[_0x5767('0x23')]=function(_0x52e85c,_0x52631d){if(_0x52e85c[_0x5767('0x44')]['id']){delete _0x52e85c[_0x5767('0x44')]['id'];}return db[_0x5767('0x29')][_0x5767('0x43')]({'where':{'id':_0x52e85c[_0x5767('0x45')]['id']}})[_0x5767('0x12')](handleEntityNotFound(_0x52631d,null))[_0x5767('0x12')](saveUpdates(_0x52e85c[_0x5767('0x44')],null))[_0x5767('0x12')](respondWithResult(_0x52631d,null))[_0x5767('0x1c')](handleError(_0x52631d,null));};exports[_0x5767('0x46')]=function(_0x5b429c,_0x30c174){return db['MailMessage']['find']({'where':{'id':_0x5b429c['params']['id']}})[_0x5767('0x12')](handleEntityNotFound(_0x30c174,null))['then'](removeEntity(_0x30c174,null))[_0x5767('0x1c')](handleError(_0x30c174,null));};exports[_0x5767('0x47')]=function(_0x53e7f1,_0x5a423e){return db['MailMessage'][_0x5767('0x47')]()[_0x5767('0x12')](respondWithResult(_0x5a423e,null))[_0x5767('0x1c')](handleError(_0x5a423e,null));};exports[_0x5767('0x48')]=function(_0x2c62d9,_0x192bd2){return db['MailMessage'][_0x5767('0x48')](_0x2c62d9[_0x5767('0x44')])['then'](function(_0x4e1b12){if(_0x4e1b12){if(_0x4e1b12['direction']==='out'&&!_0x4e1b12[_0x5767('0x49')]){var _0x2395ed,_0x559f52,_0x4d6961;if(_0x2c62d9[_0x5767('0x44')]['to']){_0x559f52=_0x2c62d9[_0x5767('0x44')]['to'][_0x5767('0x4a')](',')[0x0];}return db['MailAccount'][_0x5767('0x4b')]({'where':{'id':_0x4e1b12['MailAccountId']},'include':[{'model':db[_0x5767('0x4c')],'as':'List','include':[{'model':db['CmContact'],'as':_0x5767('0x4d'),'where':{'email':_0x559f52},'limit':0x1,'order':[[_0x5767('0x4e'),_0x5767('0x4f')]]}]},{'model':db[_0x5767('0x50')],'as':_0x5767('0x51'),'raw':!![]}]})['then'](function(_0x5ad9fd){_0x2395ed=_0x5ad9fd;if(_0x2395ed&&_0x2395ed[_0x5767('0x51')]){var _0x6ec58a={'tls':{'rejectUnauthorized':![]}};if(_[_0x5767('0x52')](_0x2395ed['Smtp'][_0x5767('0x53')])){_0x6ec58a[_0x5767('0x54')]=_0x2395ed[_0x5767('0x51')][_0x5767('0x54')];_0x6ec58a['port']=_0x2395ed[_0x5767('0x51')]['port'];_0x6ec58a[_0x5767('0x55')]=_0x2395ed[_0x5767('0x51')][_0x5767('0x55')];if(_0x2395ed[_0x5767('0x51')][_0x5767('0x56')]){_0x6ec58a[_0x5767('0x57')]={'user':_0x2395ed[_0x5767('0x51')][_0x5767('0x58')],'pass':_0x2395ed['Smtp'][_0x5767('0x59')]};}}else{_0x6ec58a[_0x5767('0x53')]=_0x2395ed[_0x5767('0x51')][_0x5767('0x53')];_0x6ec58a[_0x5767('0x57')]={'user':_0x2395ed[_0x5767('0x51')][_0x5767('0x58')],'pass':_0x2395ed[_0x5767('0x51')]['pass']};_0x6ec58a[_0x5767('0x55')]=_0x2395ed[_0x5767('0x51')][_0x5767('0x55')];}if(_0x2c62d9[_0x5767('0x44')]['attachments']&&_0x2c62d9['body'][_0x5767('0x5a')][_0x5767('0x5b')]){for(var _0x241f86=0x0;_0x241f86<_0x2c62d9[_0x5767('0x44')][_0x5767('0x5a')][_0x5767('0x5b')];_0x241f86+=0x1){_0x2c62d9[_0x5767('0x44')]['attachments'][_0x241f86]={'filename':_0x2c62d9[_0x5767('0x44')][_0x5767('0x5a')][_0x241f86]['name'],'path':path['join'](config[_0x5767('0x5c')],'server/files/attachments',_0x2c62d9[_0x5767('0x44')][_0x5767('0x5a')][_0x241f86]['basename'])};}}_0x4d6961={'account':_0x6ec58a,'message':_0x2c62d9[_0x5767('0x44')]};return;}})['then'](function(){if(_0x2395ed[_0x5767('0x5d')]){if(_0x2395ed[_0x5767('0x5d')][_0x5767('0x4d')][_0x5767('0x5b')]){return _0x2395ed[_0x5767('0x5d')][_0x5767('0x4d')][0x0];}else{return db[_0x5767('0x5e')][_0x5767('0x48')](_[_0x5767('0x9')](_0x2c62d9['body'],{'firstName':_0x2c62d9['body']['to'],'email':_0x2c62d9[_0x5767('0x44')]['to'],'phone':_0x2c62d9['body']['to'],'ListId':_0x2395ed[_0x5767('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x5767('0x12')](function(){if(_0x4d6961){return respondWithRpcPromise(_0x5767('0x60'),'sendMail',_0x4d6961,client9003)[_0x5767('0x12')](function(_0x4ca006){return _0x4e1b12[_0x5767('0x23')]({'read':!![],'messageId':_0x4ca006[_0x5767('0x61')],'sentAt':moment()['format'](_0x5767('0x62'))});})[_0x5767('0x1c')](function(_0x431a91){logger[_0x5767('0x17')]('%s',JSON[_0x5767('0x16')](_0x431a91));return _0x4e1b12;});}return _0x4e1b12;});}return _0x4e1b12;}})[_0x5767('0x12')](respondWithResult(_0x192bd2,0xc9))[_0x5767('0x1c')](handleError(_0x192bd2,null));};exports['accept']=function(_0x1c6e6a,_0xe0b8e3){var _0x37bd74={'agent':{},'channel':_0x5767('0x63')};if(_0x1c6e6a['body']['id']){delete _0x1c6e6a['body']['id'];}_0x1c6e6a['body'][_0x5767('0x64')]=!![];_0x1c6e6a[_0x5767('0x44')][_0x5767('0x65')]=moment()['format'](_0x5767('0x62'));_0x1c6e6a[_0x5767('0x44')][_0x5767('0x66')]=_0x1c6e6a['body'][_0x5767('0x66')]||_0x1c6e6a[_0x5767('0x58')]['id'];_0x37bd74['agent']['id']=_0x1c6e6a['body']['UserId'];return db[_0x5767('0x29')][_0x5767('0x43')]({'where':{'id':_0x1c6e6a[_0x5767('0x45')]['id'],'UserId':null}})[_0x5767('0x12')](handleEntityNotFound(_0xe0b8e3,null))['then'](saveUpdates(_0x1c6e6a['body'],null))[_0x5767('0x12')](function(_0xdda14a){if(_0xdda14a){_0x37bd74[_0x5767('0x19')]=_0xdda14a[_0x5767('0x67')]({'plain':!![]});return db[_0x5767('0x68')]['find']({'where':{'id':_0xdda14a['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xe0b8e3,null))[_0x5767('0x12')](function(_0xdd198a){if(_0xdd198a){return _0xdd198a['update']({'UserId':_0x1c6e6a[_0x5767('0x44')][_0x5767('0x66')],'read1stAt':_[_0x5767('0x52')](_0xdd198a[_0x5767('0x69')])?moment()[_0x5767('0x6a')](_0x5767('0x62')):undefined});}return null;})['then'](function(_0x5b33be){if(_0x5b33be){_0x37bd74[_0x5767('0x6b')]=_0x5b33be[_0x5767('0x67')]({'plain':!![]});interaction_log[_0x5767('0x1a')](_0x5767('0x6c'),_0x1c6e6a[_0x5767('0x58')]['id'],_0x1c6e6a[_0x5767('0x58')][_0x5767('0x2d')],_0x1c6e6a['user'][_0x5767('0x6d')],_0x37bd74[_0x5767('0x6b')]['id'],_0x1c6e6a['body']?JSON[_0x5767('0x16')](_0x1c6e6a[_0x5767('0x44')]):_0x5767('0x6e'));return respondWithRpcPromise(_0x5767('0x6f'),'acceptMessage',_0x37bd74);}return null;})['then'](function(_0x3e8d70){var _0x3b2acd=_0x5767('0x70')+_0x3e8d70[_0x5767('0x19')][_0x5767('0x71')];return db[_0x5767('0x72')]['query'](_0x3b2acd,{'type':db[_0x5767('0x73')][_0x5767('0x74')]['SELECT'],'raw':!![]})[_0x5767('0x12')](function(_0xc5cddc){return _0xc5cddc;});})[_0x5767('0x12')](function(_0x1215fb){if(_0x1215fb){_0x37bd74[_0x5767('0x19')][_0x5767('0x75')]=_0x1215fb[0x0];if(!_0x1c6e6a[_0x5767('0x44')]['UserId'])return;return db[_0x5767('0x76')][_0x5767('0x43')]({'where':{'id':_0x1c6e6a['body'][_0x5767('0x66')],'role':'agent'},'attributes':['id',_0x5767('0x2d'),_0x5767('0x77'),'email',_0x5767('0x78')],'raw':!![]});}return null;})[_0x5767('0x12')](function(_0x3c4990){if(!_0x3c4990)return null;_0x37bd74['message']['agent']=_0x3c4990;return _0x37bd74;})[_0x5767('0x12')](function(_0x20148e){if(_0x20148e){if(_0x1c6e6a[_0x5767('0x44')][_0x5767('0x79')]){_0x37bd74[_0x5767('0x19')][_0x5767('0x7a')]=util[_0x5767('0x6a')](_0x5767('0x7b'),_0x1c6e6a[_0x5767('0x58')]['name']);_0x37bd74[_0x5767('0x19')][_0x5767('0x7c')]=_0x37bd74[_0x5767('0x7c')];_0x37bd74[_0x5767('0x19')][_0x5767('0x7d')]=_0x37bd74[_0x5767('0x7c')];_0x37bd74[_0x5767('0x19')]['event']='accept';_0x37bd74[_0x5767('0x19')][_0x5767('0x44')]=htmlToText[_0x5767('0x7e')](_0x37bd74['message'][_0x5767('0x44')]);return respondWithRpcPromise(_0x5767('0x7f'),_0x5767('0x7f'),{'event':_0x5767('0x80'),'message':_0x37bd74[_0x5767('0x19')]},client9002)[_0x5767('0x12')](function(){return _0x37bd74;});}return _0x37bd74;}return null;})['then'](respondWithResult(_0xe0b8e3,null))[_0x5767('0x1c')](handleError(_0xe0b8e3,null));};exports[_0x5767('0x81')]=function(_0x3e3854,_0x44efa0){var _0x14a69b={'agent':{},'channel':_0x5767('0x63')};if(_0x3e3854[_0x5767('0x44')]['id']){delete _0x3e3854[_0x5767('0x44')]['id'];}_0x3e3854[_0x5767('0x44')][_0x5767('0x66')]=_0x3e3854[_0x5767('0x44')][_0x5767('0x66')]||_0x3e3854[_0x5767('0x58')]['id'];_0x14a69b[_0x5767('0x82')]['id']=_0x3e3854[_0x5767('0x44')][_0x5767('0x66')];return db[_0x5767('0x29')]['find']({'where':{'id':_0x3e3854[_0x5767('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44efa0,null))['then'](function(_0x4a54fd){if(_0x4a54fd){_0x14a69b[_0x5767('0x19')]=_0x4a54fd[_0x5767('0x67')]({'plain':!![]});return db[_0x5767('0x68')]['find']({'where':{'id':_0x4a54fd[_0x5767('0x83')]}});}return null;})[_0x5767('0x12')](handleEntityNotFound(_0x44efa0,null))[_0x5767('0x12')](function(_0x2a48d2){if(_0x2a48d2){_0x14a69b[_0x5767('0x6b')]=_0x2a48d2['get']({'plain':!![]});interaction_log[_0x5767('0x1a')](_0x5767('0x84'),_0x3e3854[_0x5767('0x58')]['id'],_0x3e3854[_0x5767('0x58')]['name'],_0x3e3854['user'][_0x5767('0x6d')],_0x14a69b['interaction']['id'],_0x3e3854[_0x5767('0x44')]?JSON[_0x5767('0x16')](_0x3e3854[_0x5767('0x44')]):_0x5767('0x6e'));return respondWithRpcPromise(_0x5767('0x85'),'rejectMessage',_0x14a69b);}return null;})[_0x5767('0x12')](function(_0x31e03f){var _0x456b47=_0x5767('0x70')+_0x31e03f[_0x5767('0x19')][_0x5767('0x71')];return db[_0x5767('0x72')][_0x5767('0x2e')](_0x456b47,{'type':db[_0x5767('0x73')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5767('0x12')](function(_0x1792b9){return _0x1792b9;});})['then'](function(_0x26945f){if(_0x26945f){_0x14a69b[_0x5767('0x19')]['contact']=_0x26945f[0x0];if(!_0x3e3854['body'][_0x5767('0x66')])return;return db['User'][_0x5767('0x43')]({'where':{'id':_0x3e3854[_0x5767('0x44')]['UserId'],'role':'agent'},'attributes':['id',_0x5767('0x2d'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5767('0x12')](function(_0x2e3d95){if(!_0x2e3d95)return null;_0x14a69b[_0x5767('0x19')][_0x5767('0x82')]=_0x2e3d95;return _0x14a69b;})[_0x5767('0x12')](function(_0x119ea9){if(_0x119ea9){_0x119ea9['message'][_0x5767('0x7a')]=util[_0x5767('0x6a')](_0x5767('0x7b'),_0x3e3854[_0x5767('0x58')][_0x5767('0x2d')]);_0x119ea9[_0x5767('0x19')]['channel']=_0x14a69b[_0x5767('0x7c')];_0x119ea9['message']['motionChannel']=_0x14a69b[_0x5767('0x7c')];_0x119ea9[_0x5767('0x19')][_0x5767('0x86')]=_0x5767('0x81');_0x119ea9[_0x5767('0x19')]['body']=htmlToText[_0x5767('0x7e')](_0x14a69b['message'][_0x5767('0x44')]);respondWithRpcPromise(_0x5767('0x7f'),_0x5767('0x7f'),{'event':'rejectmessage','message':_0x119ea9[_0x5767('0x19')]},client9002);return _0x14a69b;}return null;})['then'](respondWithResult(_0x44efa0,null))[_0x5767('0x1c')](handleError(_0x44efa0,null));};exports[_0x5767('0x87')]=function(_0x3cac89,_0x482924){var _0x2dc129=moment()[_0x5767('0x88')]()[_0x5767('0x89')]();var _0x47f2a0=path[_0x5767('0x8a')](config['root'],_0x5767('0x8b'),_0x5767('0x8c'),_0x5767('0x8d'));var _0x3adc77=path[_0x5767('0x8a')](config['root'],_0x5767('0x8b'),_0x5767('0x8c'),_0x5767('0x5a'));var _0x4e7b7c=util[_0x5767('0x6a')](_0x5767('0x8e'),_0x2dc129);return db['MailMessage'][_0x5767('0x43')]({'where':{'id':_0x3cac89[_0x5767('0x45')]['id']},'attributes':['id',_0x5767('0x44'),_0x5767('0x8f'),'to','cc',_0x5767('0x90'),_0x5767('0x91'),_0x5767('0x92')],'include':_0x3cac89[_0x5767('0x2e')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x5767('0x12')](handleEntityNotFound(_0x482924,null))[_0x5767('0x12')](function(_0x517c35){if(_0x517c35){var _0x1365bb=_0x517c35;var _0x3a5d39={'from':_0x1365bb[_0x5767('0x8f')],'to':_0x1365bb['to'],'subject':_0x1365bb['subject'],'html':htmlEntities[_0x5767('0x93')](_0x1365bb[_0x5767('0x44')]),'headers':{'Date':moment(_0x1365bb['createdAt'])[_0x5767('0x6a')](_0x5767('0x94'))},'attachments':[]};if(_0x517c35['cc']){_0x3a5d39['headers']['Cc']=_0x517c35['cc'];}if(_0x517c35[_0x5767('0x90')]){_0x3a5d39['headers']['Bcc']=_0x517c35[_0x5767('0x90')];}return new BPromise(function(_0x4bfd67,_0x4a1d02){if(_0x517c35[_0x5767('0x95')]){for(var _0x5672cb=0x0;_0x5672cb<_0x517c35[_0x5767('0x95')][_0x5767('0x5b')];_0x5672cb++){var _0x4f97d3=_0x517c35[_0x5767('0x95')][_0x5672cb];var _0x5757ef=path[_0x5767('0x8a')](_0x3adc77,_0x4f97d3[_0x5767('0x96')]);if(fs[_0x5767('0x97')](_0x5757ef)){_0x3a5d39[_0x5767('0x5a')]['push']({'name':_0x4f97d3[_0x5767('0x2d')],'contentType':_0x4f97d3[_0x5767('0x3c')],'data':fs[_0x5767('0x98')](_0x5757ef)});}}}emlformat[_0x5767('0x99')](_0x3a5d39,function(_0x4cefc5,_0x489813){if(_0x4cefc5)return _0x4a1d02(_0x4cefc5);fs[_0x5767('0x9a')](path[_0x5767('0x8a')](_0x47f2a0,_0x4e7b7c),_0x489813);return _0x4bfd67(_0x489813);});});}})[_0x5767('0x12')](function(_0x41ca8e){if(_0x41ca8e){return _0x482924[_0x5767('0x87')](path[_0x5767('0x8a')](_0x47f2a0,_0x4e7b7c),_0x4e7b7c,function(_0x4674d9){if(!_0x4674d9)fs['unlinkSync'](path[_0x5767('0x8a')](_0x47f2a0,_0x4e7b7c));});}})['catch'](handleError(_0x482924,null));}; \ No newline at end of file +var _0x0b0e=['null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','internal','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','subject','decode','headers','existsSync','push','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','client','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','body','create','direction','out','secret','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','MailInteraction','MailInteractionId','read1stAt','interaction','get','role'];(function(_0x267ab3,_0x25b50c){var _0x171538=function(_0x1efd6e){while(--_0x1efd6e){_0x267ab3['push'](_0x267ab3['shift']());}};_0x171538(++_0x25b50c);}(_0x0b0e,0x17d));var _0xe0b0=function(_0x374954,_0x18dc36){_0x374954=_0x374954-0x0;var _0x42073e=_0x0b0e[_0x374954];return _0x42073e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var moment=require(_0xe0b0('0x1'));var BPromise=require(_0xe0b0('0x2'));var util=require(_0xe0b0('0x3'));var path=require(_0xe0b0('0x4'));var fs=require('fs');var _=require(_0xe0b0('0x5'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0xe0b0('0x6'));var logger=require(_0xe0b0('0x7'))('api');var interaction_log=require(_0xe0b0('0x7'))(_0xe0b0('0x8'));var config=require(_0xe0b0('0x9'));var db=require(_0xe0b0('0xa'))['db'];config[_0xe0b0('0xb')]=_[_0xe0b0('0xc')](config[_0xe0b0('0xb')],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xb')]));var htmlEntities=require(_0xe0b0('0xf'));require(_0xe0b0('0x10'))[_0xe0b0('0x11')](socket);var jayson=require(_0xe0b0('0x12'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson['client'][_0xe0b0('0x13')]({'port':0x232b});var client9002=jayson[_0xe0b0('0x14')][_0xe0b0('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x1350db,_0x3543df,_0x4840db,_0x4ab1a2){return new BPromise(function(_0x5d46a8,_0x11e083){var _0xc89fda=_0x4ab1a2||client;return _0xc89fda['request'](_0x1350db,_0x4840db)[_0xe0b0('0x15')](function(_0x3f9d84){logger[_0xe0b0('0x16')](_0xe0b0('0x17'),_0x3543df,_0xe0b0('0x18'));logger[_0xe0b0('0x19')](_0xe0b0('0x1a'),_0x3543df,_0xe0b0('0x18'),JSON[_0xe0b0('0x1b')](_0x3f9d84));if(_0x3f9d84[_0xe0b0('0x1c')]){if(_0x3f9d84[_0xe0b0('0x1c')][_0xe0b0('0x1d')]===0x1f4){logger[_0xe0b0('0x1c')](_0xe0b0('0x17'),_0x3543df,_0x3f9d84[_0xe0b0('0x1c')][_0xe0b0('0x1e')]);return _0x11e083(_0x3f9d84[_0xe0b0('0x1c')][_0xe0b0('0x1e')]);}logger[_0xe0b0('0x1c')](_0xe0b0('0x17'),_0x3543df,_0x3f9d84[_0xe0b0('0x1c')][_0xe0b0('0x1e')]);return _0x5d46a8(_0x3f9d84[_0xe0b0('0x1c')][_0xe0b0('0x1e')]);}else{logger[_0xe0b0('0x16')](_0xe0b0('0x17'),_0x3543df,_0xe0b0('0x18'));_0x5d46a8(_0x3f9d84[_0xe0b0('0x1f')][_0xe0b0('0x1e')]);}})[_0xe0b0('0x20')](function(_0x56d15d){logger[_0xe0b0('0x1c')](_0xe0b0('0x17'),_0x3543df,_0x56d15d);_0x11e083(_0x56d15d);});});}function respondWithResult(_0x35a12c,_0x13d5ca){_0x13d5ca=_0x13d5ca||0xc8;return function(_0x4814e8){if(_0x4814e8){return _0x35a12c[_0xe0b0('0x21')](_0x13d5ca)[_0xe0b0('0x22')](_0x4814e8);}};}function respondWithFilteredResult(_0x1012eb,_0x59188a){return function(_0x480e40){if(_0x480e40){var _0x50361c=typeof _0x59188a[_0xe0b0('0x23')]===_0xe0b0('0x24')&&typeof _0x59188a['limit']===_0xe0b0('0x24');var _0x3f0778=_0x480e40[_0xe0b0('0x25')];var _0x317aec=_0x50361c?0x0:_0x59188a[_0xe0b0('0x23')];var _0x133055=_0x50361c?_0x480e40[_0xe0b0('0x25')]:_0x59188a[_0xe0b0('0x23')]+_0x59188a[_0xe0b0('0x26')];var _0x131e52;if(_0x133055>=_0x3f0778){_0x133055=_0x3f0778;_0x131e52=0xc8;}else{_0x131e52=0xce;}_0x1012eb[_0xe0b0('0x21')](_0x131e52);return _0x1012eb[_0xe0b0('0x27')](_0xe0b0('0x28'),_0x317aec+'-'+_0x133055+'/'+_0x3f0778)['json'](_0x480e40);}return null;};}function saveUpdates(_0x47aa6b){return function(_0x2be04f){if(_0x2be04f){return _0x2be04f[_0xe0b0('0x29')](_0x47aa6b)[_0xe0b0('0x15')](function(_0x14fbbf){return _0x14fbbf;});}return null;};}function removeEntity(_0x2b9cfc){return function(_0x4d10c4){if(_0x4d10c4){return _0x4d10c4[_0xe0b0('0x2a')]()[_0xe0b0('0x15')](function(){_0x2b9cfc[_0xe0b0('0x21')](0xcc)[_0xe0b0('0x2b')]();});}};}function handleEntityNotFound(_0x77b1a9){return function(_0x2ee08d){if(!_0x2ee08d){_0x77b1a9[_0xe0b0('0x2c')](0x194);}return _0x2ee08d;};}function handleError(_0x229c44,_0xa68672){_0xa68672=_0xa68672||0x1f4;return function(_0x5983f0){logger[_0xe0b0('0x1c')](_0x5983f0[_0xe0b0('0x2d')]);if(_0x5983f0[_0xe0b0('0x2e')]){delete _0x5983f0[_0xe0b0('0x2e')];}_0x229c44[_0xe0b0('0x21')](_0xa68672)[_0xe0b0('0x2f')](_0x5983f0);};}exports[_0xe0b0('0x30')]=function(_0xdcd57a,_0x352995){var _0x451379={},_0x13d9bd={},_0x3646d0={'count':0x0,'rows':[]};var _0x2efa7b=_[_0xe0b0('0x31')](db[_0xe0b0('0x32')]['rawAttributes'],function(_0x1ad698){return{'name':_0x1ad698[_0xe0b0('0x33')],'type':_0x1ad698['type'][_0xe0b0('0x34')]};});_0x13d9bd['model']=_['map'](_0x2efa7b,_0xe0b0('0x2e'));_0x13d9bd[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0xdcd57a[_0xe0b0('0x35')]);_0x13d9bd['filters']=_[_0xe0b0('0x37')](_0x13d9bd[_0xe0b0('0x38')],_0x13d9bd[_0xe0b0('0x35')]);_0x451379[_0xe0b0('0x39')]=_[_0xe0b0('0x37')](_0x13d9bd['model'],qs[_0xe0b0('0x3a')](_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x3a')]));_0x451379[_0xe0b0('0x39')]=_0x451379[_0xe0b0('0x39')][_0xe0b0('0x3b')]?_0x451379['attributes']:_0x13d9bd[_0xe0b0('0x38')];if(!_0xdcd57a['query'][_0xe0b0('0x3c')](_0xe0b0('0x3d'))){_0x451379[_0xe0b0('0x26')]=qs['limit'](_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x26')]);_0x451379[_0xe0b0('0x23')]=qs['offset'](_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x23')]);}_0x451379[_0xe0b0('0x3e')]=qs[_0xe0b0('0x3f')](_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x3f')]);_0x451379[_0xe0b0('0x40')]=qs[_0xe0b0('0x41')](_[_0xe0b0('0x42')](_0xdcd57a[_0xe0b0('0x35')],_0x13d9bd[_0xe0b0('0x41')]),_0x2efa7b);if(_0xdcd57a['query'][_0xe0b0('0x43')]){_0x451379[_0xe0b0('0x40')]=_[_0xe0b0('0x44')](_0x451379[_0xe0b0('0x40')],{'$or':_[_0xe0b0('0x31')](_0x2efa7b,function(_0x298d04){if(_0x298d04[_0xe0b0('0x45')]!==_0xe0b0('0x46')){var _0x376f2b={};_0x376f2b[_0x298d04[_0xe0b0('0x2e')]]={'$like':'%'+_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x43')]+'%'};return _0x376f2b;}})});}_0x451379=_[_0xe0b0('0x44')]({},_0x451379,_0xdcd57a[_0xe0b0('0x47')]);var _0x213b8d={'where':_0x451379['where']};return db[_0xe0b0('0x32')][_0xe0b0('0x25')](_0x213b8d)[_0xe0b0('0x15')](function(_0x4aae43){_0x3646d0['count']=_0x4aae43;if(_0xdcd57a[_0xe0b0('0x35')][_0xe0b0('0x48')]){_0x451379['include']=[{'all':!![]}];}return db[_0xe0b0('0x32')][_0xe0b0('0x49')](_0x451379);})['then'](function(_0x12f313){_0x3646d0[_0xe0b0('0x4a')]=_0x12f313;return _0x3646d0;})[_0xe0b0('0x15')](respondWithFilteredResult(_0x352995,_0x451379))[_0xe0b0('0x20')](handleError(_0x352995,null));};exports[_0xe0b0('0x4b')]=function(_0x1f8480,_0x15cd5a){var _0x56dd9a={'raw':!![],'where':{'id':_0x1f8480[_0xe0b0('0x4c')]['id']}},_0x36be25={};_0x36be25['model']=_[_0xe0b0('0x36')](db[_0xe0b0('0x32')]['rawAttributes']);_0x36be25['query']=_[_0xe0b0('0x36')](_0x1f8480[_0xe0b0('0x35')]);_0x36be25['filters']=_[_0xe0b0('0x37')](_0x36be25[_0xe0b0('0x38')],_0x36be25[_0xe0b0('0x35')]);_0x56dd9a[_0xe0b0('0x39')]=_[_0xe0b0('0x37')](_0x36be25[_0xe0b0('0x38')],qs[_0xe0b0('0x3a')](_0x1f8480[_0xe0b0('0x35')][_0xe0b0('0x3a')]));_0x56dd9a[_0xe0b0('0x39')]=_0x56dd9a[_0xe0b0('0x39')]['length']?_0x56dd9a[_0xe0b0('0x39')]:_0x36be25['model'];if(_0x1f8480[_0xe0b0('0x35')]['includeAll']){_0x56dd9a[_0xe0b0('0x4d')]=[{'all':!![]}];}_0x56dd9a=_[_0xe0b0('0x44')]({},_0x56dd9a,_0x1f8480['options']);return db[_0xe0b0('0x32')][_0xe0b0('0x4e')](_0x56dd9a)[_0xe0b0('0x15')](handleEntityNotFound(_0x15cd5a,null))[_0xe0b0('0x15')](respondWithResult(_0x15cd5a,null))[_0xe0b0('0x20')](handleError(_0x15cd5a,null));};exports[_0xe0b0('0x29')]=function(_0xcc2205,_0x184424){if(_0xcc2205['body']['id']){delete _0xcc2205[_0xe0b0('0x4f')]['id'];}return db['MailMessage']['find']({'where':{'id':_0xcc2205[_0xe0b0('0x4c')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x184424,null))[_0xe0b0('0x15')](saveUpdates(_0xcc2205[_0xe0b0('0x4f')],null))[_0xe0b0('0x15')](respondWithResult(_0x184424,null))['catch'](handleError(_0x184424,null));};exports['destroy']=function(_0x563a90,_0x5f2c86){return db[_0xe0b0('0x32')][_0xe0b0('0x4e')]({'where':{'id':_0x563a90[_0xe0b0('0x4c')]['id']}})[_0xe0b0('0x15')](handleEntityNotFound(_0x5f2c86,null))['then'](removeEntity(_0x5f2c86,null))[_0xe0b0('0x20')](handleError(_0x5f2c86,null));};exports['describe']=function(_0x2e6453,_0x2ae70d){return db[_0xe0b0('0x32')]['describe']()[_0xe0b0('0x15')](respondWithResult(_0x2ae70d,null))['catch'](handleError(_0x2ae70d,null));};exports['create']=function(_0x5d0932,_0x2b607){return db[_0xe0b0('0x32')][_0xe0b0('0x50')](_0x5d0932[_0xe0b0('0x4f')])['then'](function(_0x2ea3d9){if(_0x2ea3d9){if(_0x2ea3d9[_0xe0b0('0x51')]===_0xe0b0('0x52')&&!_0x2ea3d9[_0xe0b0('0x53')]){var _0x161d08,_0x1cba74,_0x3cfc51;if(_0x5d0932[_0xe0b0('0x4f')]['to']){_0x1cba74=_0x5d0932[_0xe0b0('0x4f')]['to']['split'](',')[0x0];}return db[_0xe0b0('0x54')][_0xe0b0('0x55')]({'where':{'id':_0x2ea3d9[_0xe0b0('0x56')]},'include':[{'model':db[_0xe0b0('0x57')],'as':_0xe0b0('0x58'),'include':[{'model':db[_0xe0b0('0x59')],'as':_0xe0b0('0x5a'),'where':{'email':_0x1cba74},'limit':0x1,'order':[[_0xe0b0('0x5b'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xe0b0('0x5c'),'raw':!![]}]})[_0xe0b0('0x15')](function(_0x3d14f1){_0x161d08=_0x3d14f1;if(_0x161d08&&_0x161d08[_0xe0b0('0x5c')]){var _0xc07af={'tls':{'rejectUnauthorized':![]}};if(_[_0xe0b0('0x5d')](_0x161d08['Smtp'][_0xe0b0('0x5e')])){_0xc07af[_0xe0b0('0x5f')]=_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x5f')];_0xc07af[_0xe0b0('0x60')]=_0x161d08[_0xe0b0('0x5c')]['port'];_0xc07af[_0xe0b0('0x61')]=_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x61')];if(_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x62')]){_0xc07af[_0xe0b0('0x63')]={'user':_0x161d08['Smtp'][_0xe0b0('0x64')],'pass':_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x65')]};}}else{_0xc07af[_0xe0b0('0x5e')]=_0x161d08[_0xe0b0('0x5c')]['service'];_0xc07af[_0xe0b0('0x63')]={'user':_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x64')],'pass':_0x161d08[_0xe0b0('0x5c')][_0xe0b0('0x65')]};_0xc07af['secure']=_0x161d08[_0xe0b0('0x5c')]['secure'];}if(_0x5d0932[_0xe0b0('0x4f')][_0xe0b0('0x66')]&&_0x5d0932[_0xe0b0('0x4f')][_0xe0b0('0x66')]['length']){for(var _0x48a87b=0x0;_0x48a87b<_0x5d0932['body'][_0xe0b0('0x66')][_0xe0b0('0x3b')];_0x48a87b+=0x1){_0x5d0932['body'][_0xe0b0('0x66')][_0x48a87b]={'filename':_0x5d0932['body'][_0xe0b0('0x66')][_0x48a87b][_0xe0b0('0x2e')],'path':path[_0xe0b0('0x67')](config[_0xe0b0('0x68')],_0xe0b0('0x69'),_0x5d0932[_0xe0b0('0x4f')][_0xe0b0('0x66')][_0x48a87b][_0xe0b0('0x6a')])};}}_0x3cfc51={'account':_0xc07af,'message':_0x5d0932[_0xe0b0('0x4f')]};return;}})[_0xe0b0('0x15')](function(){if(_0x161d08[_0xe0b0('0x58')]){if(_0x161d08[_0xe0b0('0x58')][_0xe0b0('0x5a')][_0xe0b0('0x3b')]){return _0x161d08[_0xe0b0('0x58')][_0xe0b0('0x5a')][0x0];}else{return db[_0xe0b0('0x59')]['create'](_[_0xe0b0('0xc')](_0x5d0932[_0xe0b0('0x4f')],{'firstName':_0x5d0932[_0xe0b0('0x4f')]['to'],'email':_0x5d0932[_0xe0b0('0x4f')]['to'],'phone':_0x5d0932['body']['to'],'ListId':_0x161d08[_0xe0b0('0x6b')]}));}}else{throw new Error(_0xe0b0('0x6c'));}})[_0xe0b0('0x15')](function(){if(_0x3cfc51){return respondWithRpcPromise(_0xe0b0('0x6d'),_0xe0b0('0x6e'),_0x3cfc51,client9003)[_0xe0b0('0x15')](function(_0x28382d){return _0x2ea3d9[_0xe0b0('0x29')]({'read':!![],'messageId':_0x28382d[_0xe0b0('0x6f')],'sentAt':moment()[_0xe0b0('0x70')](_0xe0b0('0x71'))});})[_0xe0b0('0x20')](function(_0x4a94b3){logger[_0xe0b0('0x1c')]('%s',JSON[_0xe0b0('0x1b')](_0x4a94b3));return _0x2ea3d9;});}return _0x2ea3d9;});}return _0x2ea3d9;}})[_0xe0b0('0x15')](respondWithResult(_0x2b607,0xc9))[_0xe0b0('0x20')](handleError(_0x2b607,null));};exports[_0xe0b0('0x72')]=function(_0xc0f0c5,_0x216221){var _0x134e69={'agent':{},'channel':_0xe0b0('0x73')};if(_0xc0f0c5[_0xe0b0('0x4f')]['id']){delete _0xc0f0c5['body']['id'];}_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x74')]=!![];_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x75')]=moment()[_0xe0b0('0x70')](_0xe0b0('0x71'));_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x76')]=_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x76')]||_0xc0f0c5[_0xe0b0('0x64')]['id'];_0x134e69[_0xe0b0('0x77')]['id']=_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x76')];return db['MailMessage'][_0xe0b0('0x4e')]({'where':{'id':_0xc0f0c5[_0xe0b0('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x216221,null))[_0xe0b0('0x15')](saveUpdates(_0xc0f0c5[_0xe0b0('0x4f')],null))[_0xe0b0('0x15')](function(_0x476c9b){if(_0x476c9b){_0x134e69[_0xe0b0('0x1e')]=_0x476c9b['get']({'plain':!![]});return db[_0xe0b0('0x78')][_0xe0b0('0x4e')]({'where':{'id':_0x476c9b[_0xe0b0('0x79')]}});}return null;})[_0xe0b0('0x15')](handleEntityNotFound(_0x216221,null))[_0xe0b0('0x15')](function(_0x14fc96){if(_0x14fc96){return _0x14fc96[_0xe0b0('0x29')]({'UserId':_0xc0f0c5['body'][_0xe0b0('0x76')],'read1stAt':_[_0xe0b0('0x5d')](_0x14fc96[_0xe0b0('0x7a')])?moment()[_0xe0b0('0x70')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe0b0('0x15')](function(_0x5a4348){if(_0x5a4348){_0x134e69[_0xe0b0('0x7b')]=_0x5a4348[_0xe0b0('0x7c')]({'plain':!![]});interaction_log[_0xe0b0('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc0f0c5['user']['id'],_0xc0f0c5[_0xe0b0('0x64')][_0xe0b0('0x2e')],_0xc0f0c5[_0xe0b0('0x64')][_0xe0b0('0x7d')],_0x134e69['interaction']['id'],_0xc0f0c5[_0xe0b0('0x4f')]?JSON[_0xe0b0('0x1b')](_0xc0f0c5[_0xe0b0('0x4f')]):_0xe0b0('0x7e'));return respondWithRpcPromise(_0xe0b0('0x7f'),'acceptMessage',_0x134e69);}return null;})[_0xe0b0('0x15')](function(_0x4a9be9){var _0x345677=_0xe0b0('0x80')+_0x4a9be9[_0xe0b0('0x1e')][_0xe0b0('0x81')];return db[_0xe0b0('0x82')]['query'](_0x345677,{'type':db[_0xe0b0('0x83')][_0xe0b0('0x84')][_0xe0b0('0x85')],'raw':!![]})[_0xe0b0('0x15')](function(_0x19dad7){return _0x19dad7;});})[_0xe0b0('0x15')](function(_0x415e2a){if(_0x415e2a){_0x134e69[_0xe0b0('0x1e')][_0xe0b0('0x86')]=_0x415e2a[0x0];if(!_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x76')])return;return db[_0xe0b0('0x87')][_0xe0b0('0x4e')]({'where':{'id':_0xc0f0c5[_0xe0b0('0x4f')][_0xe0b0('0x76')],'role':_0xe0b0('0x77')},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xe0b0('0x15')](function(_0x2623e8){if(!_0x2623e8)return null;_0x134e69[_0xe0b0('0x1e')][_0xe0b0('0x77')]=_0x2623e8;return _0x134e69;})['then'](function(_0x490b15){if(_0x490b15){if(_0xc0f0c5['body']['manual']){_0x134e69[_0xe0b0('0x1e')][_0xe0b0('0x88')]=util[_0xe0b0('0x70')](_0xe0b0('0x89'),_0xc0f0c5[_0xe0b0('0x64')][_0xe0b0('0x2e')]);_0x134e69[_0xe0b0('0x1e')]['channel']=_0x134e69[_0xe0b0('0x8a')];_0x134e69[_0xe0b0('0x1e')][_0xe0b0('0x8b')]=_0x134e69[_0xe0b0('0x8a')];_0x134e69['message'][_0xe0b0('0x8c')]=_0xe0b0('0x72');_0x134e69['message'][_0xe0b0('0x4f')]=htmlToText[_0xe0b0('0x8d')](_0x134e69[_0xe0b0('0x1e')][_0xe0b0('0x4f')]);return respondWithRpcPromise('EventManager',_0xe0b0('0x8e'),{'event':'acceptmessage','message':_0x134e69['message']},client9002)['then'](function(){return _0x134e69;});}return _0x134e69;}return null;})[_0xe0b0('0x15')](respondWithResult(_0x216221,null))[_0xe0b0('0x20')](handleError(_0x216221,null));};exports[_0xe0b0('0x8f')]=function(_0x507b51,_0x5321b8){var _0x15463e={'agent':{},'channel':'mail'};if(_0x507b51[_0xe0b0('0x4f')]['id']){delete _0x507b51[_0xe0b0('0x4f')]['id'];}_0x507b51[_0xe0b0('0x4f')][_0xe0b0('0x76')]=_0x507b51[_0xe0b0('0x4f')][_0xe0b0('0x76')]||_0x507b51[_0xe0b0('0x64')]['id'];_0x15463e['agent']['id']=_0x507b51['body'][_0xe0b0('0x76')];return db[_0xe0b0('0x32')][_0xe0b0('0x4e')]({'where':{'id':_0x507b51[_0xe0b0('0x4c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5321b8,null))[_0xe0b0('0x15')](function(_0x3c0b9e){if(_0x3c0b9e){_0x15463e['message']=_0x3c0b9e[_0xe0b0('0x7c')]({'plain':!![]});return db[_0xe0b0('0x78')][_0xe0b0('0x4e')]({'where':{'id':_0x3c0b9e[_0xe0b0('0x79')]}});}return null;})[_0xe0b0('0x15')](handleEntityNotFound(_0x5321b8,null))[_0xe0b0('0x15')](function(_0x5bea5c){if(_0x5bea5c){_0x15463e[_0xe0b0('0x7b')]=_0x5bea5c[_0xe0b0('0x7c')]({'plain':!![]});interaction_log[_0xe0b0('0x16')](_0xe0b0('0x90'),_0x507b51['user']['id'],_0x507b51[_0xe0b0('0x64')][_0xe0b0('0x2e')],_0x507b51[_0xe0b0('0x64')][_0xe0b0('0x7d')],_0x15463e[_0xe0b0('0x7b')]['id'],_0x507b51[_0xe0b0('0x4f')]?JSON['stringify'](_0x507b51[_0xe0b0('0x4f')]):_0xe0b0('0x7e'));return respondWithRpcPromise(_0xe0b0('0x91'),_0xe0b0('0x92'),_0x15463e);}return null;})[_0xe0b0('0x15')](function(_0x2dc1c0){var _0x5369a4=_0xe0b0('0x80')+_0x2dc1c0[_0xe0b0('0x1e')][_0xe0b0('0x81')];return db[_0xe0b0('0x82')][_0xe0b0('0x35')](_0x5369a4,{'type':db['Sequelize']['QueryTypes'][_0xe0b0('0x85')],'raw':!![]})[_0xe0b0('0x15')](function(_0x17d29d){return _0x17d29d;});})[_0xe0b0('0x15')](function(_0xae1a85){if(_0xae1a85){_0x15463e['message'][_0xe0b0('0x86')]=_0xae1a85[0x0];if(!_0x507b51['body']['UserId'])return;return db['User'][_0xe0b0('0x4e')]({'where':{'id':_0x507b51[_0xe0b0('0x4f')][_0xe0b0('0x76')],'role':_0xe0b0('0x77')},'attributes':['id',_0xe0b0('0x2e'),_0xe0b0('0x93'),_0xe0b0('0x94'),_0xe0b0('0x95')],'raw':!![]});}return null;})[_0xe0b0('0x15')](function(_0xb0e983){if(!_0xb0e983)return null;_0x15463e['message'][_0xe0b0('0x77')]=_0xb0e983;return _0x15463e;})[_0xe0b0('0x15')](function(_0x303267){if(_0x303267){_0x303267[_0xe0b0('0x1e')][_0xe0b0('0x88')]=util[_0xe0b0('0x70')](_0xe0b0('0x89'),_0x507b51[_0xe0b0('0x64')][_0xe0b0('0x2e')]);_0x303267[_0xe0b0('0x1e')][_0xe0b0('0x8a')]=_0x15463e['channel'];_0x303267[_0xe0b0('0x1e')]['motionChannel']=_0x15463e[_0xe0b0('0x8a')];_0x303267[_0xe0b0('0x1e')][_0xe0b0('0x8c')]=_0xe0b0('0x8f');_0x303267[_0xe0b0('0x1e')][_0xe0b0('0x4f')]=htmlToText['fromString'](_0x15463e[_0xe0b0('0x1e')][_0xe0b0('0x4f')]);respondWithRpcPromise('EventManager',_0xe0b0('0x8e'),{'event':'rejectmessage','message':_0x303267[_0xe0b0('0x1e')]},client9002);return _0x15463e;}return null;})[_0xe0b0('0x15')](respondWithResult(_0x5321b8,null))['catch'](handleError(_0x5321b8,null));};exports[_0xe0b0('0x96')]=function(_0x547d00,_0x19899d){var _0x215423=moment()[_0xe0b0('0x97')]()[_0xe0b0('0x98')]();var _0x6c3176=path[_0xe0b0('0x67')](config[_0xe0b0('0x68')],_0xe0b0('0x99'),_0xe0b0('0x9a'),_0xe0b0('0x9b'));var _0x5459b3=path[_0xe0b0('0x67')](config[_0xe0b0('0x68')],'server',_0xe0b0('0x9a'),_0xe0b0('0x66'));var _0x514b77=util[_0xe0b0('0x70')](_0xe0b0('0x9c'),_0x215423);return db[_0xe0b0('0x32')]['find']({'where':{'id':_0x547d00['params']['id']},'attributes':['id',_0xe0b0('0x4f'),_0xe0b0('0x9d'),'to','cc',_0xe0b0('0x9e'),'subject',_0xe0b0('0x9f')],'include':_0x547d00[_0xe0b0('0x35')]['attachments']?[{'model':db[_0xe0b0('0xa0')],'as':_0xe0b0('0xa1')}]:undefined})['then'](handleEntityNotFound(_0x19899d,null))[_0xe0b0('0x15')](function(_0x2ab866){if(_0x2ab866){var _0x456dd4=_0x2ab866;var _0x2d1ece={'from':_0x456dd4['from'],'to':_0x456dd4['to'],'subject':_0x456dd4[_0xe0b0('0xa2')],'html':htmlEntities[_0xe0b0('0xa3')](_0x456dd4[_0xe0b0('0x4f')]),'headers':{'Date':moment(_0x456dd4['createdAt'])[_0xe0b0('0x70')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2ab866['cc']){_0x2d1ece['headers']['Cc']=_0x2ab866['cc'];}if(_0x2ab866[_0xe0b0('0x9e')]){_0x2d1ece[_0xe0b0('0xa4')]['Bcc']=_0x2ab866[_0xe0b0('0x9e')];}return new BPromise(function(_0x6f27c7,_0x3ba26a){if(_0x2ab866[_0xe0b0('0xa1')]){for(var _0x30ad4d=0x0;_0x30ad4d<_0x2ab866[_0xe0b0('0xa1')]['length'];_0x30ad4d++){var _0xf314ab=_0x2ab866[_0xe0b0('0xa1')][_0x30ad4d];var _0x1a9d0a=path['join'](_0x5459b3,_0xf314ab[_0xe0b0('0x6a')]);if(fs[_0xe0b0('0xa5')](_0x1a9d0a)){_0x2d1ece[_0xe0b0('0x66')][_0xe0b0('0xa6')]({'name':_0xf314ab[_0xe0b0('0x2e')],'contentType':_0xf314ab['type'],'data':fs['readFileSync'](_0x1a9d0a)});}}}emlformat[_0xe0b0('0xa7')](_0x2d1ece,function(_0xe3cb9,_0x47f7ca){if(_0xe3cb9)return _0x3ba26a(_0xe3cb9);fs['writeFileSync'](path[_0xe0b0('0x67')](_0x6c3176,_0x514b77),_0x47f7ca);return _0x6f27c7(_0x47f7ca);});});}})[_0xe0b0('0x15')](function(_0x1b46ed){if(_0x1b46ed){return _0x19899d[_0xe0b0('0x96')](path[_0xe0b0('0x67')](_0x6c3176,_0x514b77),_0x514b77,function(_0x20722b){if(!_0x20722b)fs[_0xe0b0('0xa8')](path[_0xe0b0('0x67')](_0x6c3176,_0x514b77));});}})[_0xe0b0('0x20')](handleError(_0x19899d,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 7a9b918..6e63980 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 _0xc90f=['exports','events','../../mysqldb','MailMessage','save','update','emit','hasOwnProperty','hook'];(function(_0x51b60a,_0x400c69){var _0x254c26=function(_0x2b7dab){while(--_0x2b7dab){_0x51b60a['push'](_0x51b60a['shift']());}};_0x254c26(++_0x400c69);}(_0xc90f,0x1a8));var _0xfc90=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0xc90f[_0x1e3671];return _0x48d5f5;};'use strict';var EventEmitter=require(_0xfc90('0x0'));var MailMessage=require(_0xfc90('0x1'))['db'][_0xfc90('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc90('0x3'),'afterUpdate':_0xfc90('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3855d4){return function(_0x3142c6,_0x46571d,_0x5ab6fb){MailMessageEvents[_0xfc90('0x5')](_0x3855d4+':'+_0x3142c6['id'],_0x3142c6);MailMessageEvents[_0xfc90('0x5')](_0x3855d4,_0x3142c6);_0x5ab6fb(null);};}for(var e in events){if(events[_0xfc90('0x6')](e)){var event=events[e];MailMessage[_0xfc90('0x7')](e,emitEvent(event));}}module[_0xfc90('0x8')]=MailMessageEvents; \ No newline at end of file +var _0xc86b=['exports','events','../../mysqldb','MailMessage','update','remove','emit','hasOwnProperty'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0xc86b,0x1a9));var _0xbc86=function(_0x2c9d30,_0xb7653e){_0x2c9d30=_0x2c9d30-0x0;var _0x2ca878=_0xc86b[_0x2c9d30];return _0x2ca878;};'use strict';var EventEmitter=require(_0xbc86('0x0'));var MailMessage=require(_0xbc86('0x1'))['db'][_0xbc86('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc86('0x3'),'afterDestroy':_0xbc86('0x4')};function emitEvent(_0x3b10a4){return function(_0x3346c0,_0x36ebbd,_0x3d837b){MailMessageEvents['emit'](_0x3b10a4+':'+_0x3346c0['id'],_0x3346c0);MailMessageEvents[_0xbc86('0x5')](_0x3b10a4,_0x3346c0);_0x3d837b(null);};}for(var e in events){if(events[_0xbc86('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xbc86('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a23afdd..beb7d26 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 _0x6cac=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','plainBody','fromString','models','get','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4'];(function(_0x280efe,_0x1c7333){var _0x4808d1=function(_0x25534a){while(--_0x25534a){_0x280efe['push'](_0x280efe['shift']());}};_0x4808d1(++_0x1c7333);}(_0x6cac,0xc1));var _0xc6ca=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6cac[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc6ca('0x0'))('api');var moment=require(_0xc6ca('0x1'));var BPromise=require(_0xc6ca('0x2'));var rp=require(_0xc6ca('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xc6ca('0x4'));var rimraf=require('rimraf');var config=require(_0xc6ca('0x5'));var attributes=require(_0xc6ca('0x6'));module[_0xc6ca('0x7')]=function(_0x405012,_0x12aa0b){return _0x405012['define'](_0xc6ca('0x8'),attributes,{'tableName':_0xc6ca('0x9'),'paranoid':![],'indexes':[{'name':_0xc6ca('0xa'),'fields':[_0xc6ca('0xa')]},{'name':_0xc6ca('0xb'),'fields':['plainBody',_0xc6ca('0xc')],'type':_0xc6ca('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e99b0,_0x12e25d,_0x961117){if(_0x5e99b0['body']){_0x5e99b0[_0xc6ca('0xe')]=htmlToText[_0xc6ca('0xf')](_0x5e99b0['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x961117(null,_0x12e25d);},'afterCreate':function(_0x27c1c7,_0x57c243,_0x31cd7c){var _0x25b8c0=_0x405012[_0xc6ca('0x10')];var _0x4e9f8c=_0x27c1c7[_0xc6ca('0x11')]({'plain':!![]});if(_0x4e9f8c[_0xc6ca('0x12')]['toLowerCase']()==='in'||_0x4e9f8c[_0xc6ca('0x12')][_0xc6ca('0x13')]()==='out'&&!_0x4e9f8c[_0xc6ca('0x14')]&&!_[_0xc6ca('0x15')](_0x4e9f8c[_0xc6ca('0x16')])){_0x25b8c0[_0xc6ca('0x17')][_0xc6ca('0x18')]({'where':{'id':_0x4e9f8c[_0xc6ca('0x19')]}})[_0xc6ca('0x1a')](function(_0x489c6e){if(_0x489c6e){_0x489c6e[_0xc6ca('0x1b')]({'lastMsgAt':_0x4e9f8c['createdAt'],'lastMsgDirection':_0x4e9f8c['direction'][_0xc6ca('0x13')]()});}})[_0xc6ca('0x1c')](function(_0x3cd3ab){console[_0xc6ca('0x1d')](_0x3cd3ab);});}_0x31cd7c();}},'charset':_0xc6ca('0x1e'),'collate':_0xc6ca('0x1f')});}; \ No newline at end of file +var _0x262a=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','fromString','body','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','error','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x262a,0x14f));var _0xa262=function(_0x3feb8a,_0x47c784){_0x3feb8a=_0x3feb8a-0x0;var _0x4523ca=_0x262a[_0x3feb8a];return _0x4523ca;};'use strict';var _=require('lodash');var util=require(_0xa262('0x0'));var logger=require(_0xa262('0x1'))(_0xa262('0x2'));var moment=require(_0xa262('0x3'));var BPromise=require(_0xa262('0x4'));var rp=require(_0xa262('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xa262('0x6'));var rimraf=require(_0xa262('0x7'));var config=require(_0xa262('0x8'));var attributes=require(_0xa262('0x9'));module[_0xa262('0xa')]=function(_0x221eb7,_0x3b512b){return _0x221eb7[_0xa262('0xb')](_0xa262('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xa262('0xd'),'fields':[_0xa262('0xd')]},{'name':'fti_mail_messages','fields':[_0xa262('0xe'),_0xa262('0xf')],'type':_0xa262('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d2722,_0x1d70b9,_0x433d25){if(_0x3d2722['body']){_0x3d2722[_0xa262('0xe')]=htmlToText[_0xa262('0x11')](_0x3d2722[_0xa262('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x433d25(null,_0x1d70b9);},'afterCreate':function(_0x4fd0e3,_0x2e1346,_0x23e949){var _0x37206b=_0x221eb7[_0xa262('0x13')];var _0x1535db=_0x4fd0e3['get']({'plain':!![]});if(_0x1535db[_0xa262('0x14')][_0xa262('0x15')]()==='in'||_0x1535db[_0xa262('0x14')]['toLowerCase']()===_0xa262('0x16')&&!_0x1535db[_0xa262('0x17')]&&!_[_0xa262('0x18')](_0x1535db[_0xa262('0x19')])){_0x37206b[_0xa262('0x1a')][_0xa262('0x1b')]({'where':{'id':_0x1535db[_0xa262('0x1c')]}})['then'](function(_0x4e530f){if(_0x4e530f){_0x4e530f[_0xa262('0x1d')]({'lastMsgAt':_0x1535db['createdAt'],'lastMsgDirection':_0x1535db['direction']['toLowerCase']()});}})['catch'](function(_0x8e6f5c){console[_0xa262('0x1e')](_0x8e6f5c);});}_0x23e949();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 6ccb5c5..b5b229e 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(_0x5cf99f,_0x450e05){var _0xeedf3a=function(_0x21f600){while(--_0x21f600){_0x5cf99f['push'](_0x5cf99f['shift']());}};_0xeedf3a(++_0x450e05);}(_0xd914,0x17f));var _0x4d91=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0xd914[_0x2d9535];return _0xb4e710;};'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 _0x4024=['debug','stringify','error','code','message','info','catch','CreateMailMessage','MailMessage','create','body','options','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','MailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x181a3b,_0x1077da){var _0x407334=function(_0x5195d5){while(--_0x5195d5){_0x181a3b['push'](_0x181a3b['shift']());}};_0x407334(++_0x1077da);}(_0x4024,0x89));var _0x4402=function(_0x4956b6,_0x37a247){_0x4956b6=_0x4956b6-0x0;var _0x291eab=_0x4024[_0x4956b6];return _0x291eab;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')](_0x5cb0c5[_0x4402('0x17')],{'raw':_0x5cb0c5['options']?_0x5cb0c5[_0x4402('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x6f1f72){logger[_0x4402('0x12')](_0x4402('0x14'),_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x6f1f72));_0x4e0340(_0x6f1f72);})[_0x4402('0x13')](function(_0x6b1fc5){logger[_0x4402('0xf')]('CreateMailMessage',_0x6b1fc5[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459['error'](0x1f4,_0x6b1fc5[_0x4402('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 9fd5bd9..f4e5de2 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 _0x011f=['./mailMessage.events','save','remove','update','emit','length','mailMessage:'];(function(_0x41c9d1,_0x108af0){var _0x599f7a=function(_0x27f1cd){while(--_0x27f1cd){_0x41c9d1['push'](_0x41c9d1['shift']());}};_0x599f7a(++_0x108af0);}(_0x011f,0x11f));var _0xf011=function(_0x28f32c,_0x4cc342){_0x28f32c=_0x28f32c-0x0;var _0x355402=_0x011f[_0x28f32c];return _0x355402;};'use strict';var MailMessageEvents=require(_0xf011('0x0'));var events=[_0xf011('0x1'),_0xf011('0x2'),_0xf011('0x3')];function createListener(_0x2032e5,_0x194750){return function(_0x3522b7){_0x194750[_0xf011('0x4')](_0x2032e5,_0x3522b7);};}function removeListener(_0x18574c,_0x43a8fb){return function(){MailMessageEvents['removeListener'](_0x18574c,_0x43a8fb);};}exports['register']=function(_0x299757){for(var _0x69ad96=0x0,_0x351f02=events[_0xf011('0x5')];_0x69ad96<_0x351f02;_0x69ad96++){var _0x44d2a2=events[_0x69ad96];var _0x1a469a=createListener(_0xf011('0x6')+_0x44d2a2,_0x299757);MailMessageEvents['on'](_0x44d2a2,_0x1a469a);}}; \ No newline at end of file +var _0xfac4=['removeListener','length','mailMessage:','remove','update','emit'];(function(_0x46ecd9,_0x5ceec7){var _0xb90b1f=function(_0x5cadb5){while(--_0x5cadb5){_0x46ecd9['push'](_0x46ecd9['shift']());}};_0xb90b1f(++_0x5ceec7);}(_0xfac4,0xb1));var _0x4fac=function(_0x552ff8,_0x5130a6){_0x552ff8=_0x552ff8-0x0;var _0x5ce2f3=_0xfac4[_0x552ff8];return _0x5ce2f3;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x4fac('0x0'),_0x4fac('0x1')];function createListener(_0x1e9291,_0x14bb72){return function(_0x5e0f53){_0x14bb72[_0x4fac('0x2')](_0x1e9291,_0x5e0f53);};}function removeListener(_0x3429a1,_0x3bae72){return function(){MailMessageEvents[_0x4fac('0x3')](_0x3429a1,_0x3bae72);};}exports['register']=function(_0x2acd5c){for(var _0x19f6d8=0x0,_0x2c624e=events[_0x4fac('0x4')];_0x19f6d8<_0x2c624e;_0x19f6d8++){var _0x357d34=events[_0x19f6d8];var _0x3b5c0f=createListener(_0x4fac('0x5')+_0x357d34,_0x2acd5c);MailMessageEvents['on'](_0x357d34,_0x3b5c0f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 42a3bb4..2a846c2 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 _0x0fd0=['./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x675503,_0x5e8359){var _0x3400d2=function(_0x3044b8){while(--_0x3044b8){_0x675503['push'](_0x675503['shift']());}};_0x3400d2(++_0x5e8359);}(_0x0fd0,0x174));var _0x00fd=function(_0x1fa076,_0xee1092){_0x1fa076=_0x1fa076-0x0;var _0x340870=_0x0fd0[_0x1fa076];return _0x340870;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00fd('0x0'));var timeout=require(_0x00fd('0x1'));var express=require(_0x00fd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x00fd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x00fd('0x4'));var controller=require(_0x00fd('0x5'));router[_0x00fd('0x6')]('/',auth[_0x00fd('0x7')](),controller[_0x00fd('0x8')]);router[_0x00fd('0x6')](_0x00fd('0x9'),auth['isAuthenticated'](),controller[_0x00fd('0xa')]);router[_0x00fd('0x6')](_0x00fd('0xb'),auth['isAuthenticated'](),controller[_0x00fd('0xc')]);router[_0x00fd('0x6')](_0x00fd('0xd'),auth[_0x00fd('0x7')](),controller[_0x00fd('0xe')]);router[_0x00fd('0x6')](_0x00fd('0xf'),auth['isAuthenticated'](),controller[_0x00fd('0x10')]);router['get'](_0x00fd('0x11'),auth['isAuthenticated'](),controller[_0x00fd('0x12')]);router[_0x00fd('0x13')]('/',auth[_0x00fd('0x7')](),controller[_0x00fd('0x14')]);router[_0x00fd('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x00fd('0x15')]);router[_0x00fd('0x13')](_0x00fd('0x11'),auth['isAuthenticated'](),controller[_0x00fd('0x16')]);router[_0x00fd('0x17')](_0x00fd('0xb'),auth[_0x00fd('0x7')](),controller[_0x00fd('0x18')]);router[_0x00fd('0x19')](_0x00fd('0xb'),auth[_0x00fd('0x7')](),controller[_0x00fd('0x1a')]);router[_0x00fd('0x19')](_0x00fd('0xf'),auth[_0x00fd('0x7')](),controller[_0x00fd('0x1b')]);router['delete']('/:id/users',auth[_0x00fd('0x7')](),controller['removeAgents']);module[_0x00fd('0x1c')]=router; \ No newline at end of file +var _0x5356=['express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','get','/describe','describe','show','getMembers','/:id/teams','getTeams','post','/:id/users','addAgents','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x510c1b,_0x54fb96){var _0x590d85=function(_0x4d344f){while(--_0x4d344f){_0x510c1b['push'](_0x510c1b['shift']());}};_0x590d85(++_0x54fb96);}(_0x5356,0x83));var _0x6535=function(_0x117729,_0x31b82b){_0x117729=_0x117729-0x0;var _0x408658=_0x5356[_0x117729];return _0x408658;};'use strict';var multer=require(_0x6535('0x0'));var util=require(_0x6535('0x1'));var path=require(_0x6535('0x2'));var timeout=require(_0x6535('0x3'));var express=require(_0x6535('0x4'));var router=express[_0x6535('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6535('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6535('0x7'));var controller=require(_0x6535('0x8'));router['get']('/',auth[_0x6535('0x9')](),controller['index']);router[_0x6535('0xa')](_0x6535('0xb'),auth[_0x6535('0x9')](),controller[_0x6535('0xc')]);router[_0x6535('0xa')]('/:id',auth[_0x6535('0x9')](),controller[_0x6535('0xd')]);router[_0x6535('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0x6535('0xe')]);router[_0x6535('0xa')](_0x6535('0xf'),auth[_0x6535('0x9')](),controller[_0x6535('0x10')]);router['get']('/:id/users',auth[_0x6535('0x9')](),controller['getAgents']);router[_0x6535('0x11')]('/',auth[_0x6535('0x9')](),controller['create']);router['post'](_0x6535('0xf'),auth[_0x6535('0x9')](),controller['addTeams']);router['post'](_0x6535('0x12'),auth[_0x6535('0x9')](),controller[_0x6535('0x13')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6535('0x14')]);router[_0x6535('0x15')](_0x6535('0x16'),auth[_0x6535('0x9')](),controller[_0x6535('0x17')]);router[_0x6535('0x15')](_0x6535('0xf'),auth[_0x6535('0x9')](),controller[_0x6535('0x18')]);router[_0x6535('0x15')]('/:id/users',auth[_0x6535('0x9')](),controller[_0x6535('0x19')]);module[_0x6535('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index f9e0027..035312e 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 _0xf830=['beepall','roundrobin','exports','STRING','ENUM','rrmemory'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xf830,0xfe));var _0x0f83=function(_0x26f8de,_0xea5e13){_0x26f8de=_0x26f8de-0x0;var _0x192c08=_0xf830[_0x26f8de];return _0x192c08;};'use strict';var Sequelize=require('sequelize');module[_0x0f83('0x0')]={'name':{'type':Sequelize[_0x0f83('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0f83('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0f83('0x2')](_0x0f83('0x3'),_0x0f83('0x4'),_0x0f83('0x5'))}}; \ No newline at end of file +var _0x99b2=['sequelize','exports','name','STRING','rrmemory','beepall','roundrobin'];(function(_0x109628,_0xa46727){var _0x295b97=function(_0x26d5ba){while(--_0x26d5ba){_0x109628['push'](_0x109628['shift']());}};_0x295b97(++_0xa46727);}(_0x99b2,0xb6));var _0x299b=function(_0x21df50,_0x5651af){_0x21df50=_0x21df50-0x0;var _0x1c09f4=_0x99b2[_0x21df50];return _0x1c09f4;};'use strict';var Sequelize=require(_0x299b('0x0'));module[_0x299b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x299b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x299b('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x299b('0x4'),_0x299b('0x5'),_0x299b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0b1d06c..6be42ae 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 _0xaa49=['omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','merge','options','include','findAll','rows','params','rawAttributes','keys','includeAll','find','catch','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','order','filter','User','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','updatedAt','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents'];(function(_0xb7592d,_0x7ea141){var _0x4d8cc4=function(_0x1951f8){while(--_0x1951f8){_0xb7592d['push'](_0xb7592d['shift']());}};_0x4d8cc4(++_0x7ea141);}(_0xaa49,0x1be));var _0x9aa4=function(_0x35e8b1,_0x25039f){_0x35e8b1=_0x35e8b1-0x0;var _0x164581=_0xaa49[_0x35e8b1];return _0x164581;};'use strict';var emlformat=require(_0x9aa4('0x0'));var rimraf=require(_0x9aa4('0x1'));var zipdir=require(_0x9aa4('0x2'));var jsonpatch=require(_0x9aa4('0x3'));var rp=require(_0x9aa4('0x4'));var moment=require(_0x9aa4('0x5'));var BPromise=require(_0x9aa4('0x6'));var Mustache=require('mustache');var util=require(_0x9aa4('0x7'));var path=require(_0x9aa4('0x8'));var sox=require('sox');var csv=require(_0x9aa4('0x9'));var ejs=require(_0x9aa4('0xa'));var fs=require('fs');var fs_extra=require(_0x9aa4('0xb'));var _=require(_0x9aa4('0xc'));var squel=require(_0x9aa4('0xd'));var crypto=require('crypto');var jsforce=require(_0x9aa4('0xe'));var deskjs=require(_0x9aa4('0xf'));var toCsv=require(_0x9aa4('0x9'));var querystring=require('querystring');var Papa=require(_0x9aa4('0x10'));var Redis=require(_0x9aa4('0x11'));var authService=require(_0x9aa4('0x12'));var qs=require(_0x9aa4('0x13'));var as=require(_0x9aa4('0x14'));var hardwareService=require(_0x9aa4('0x15'));var logger=require(_0x9aa4('0x16'))(_0x9aa4('0x17'));var utils=require(_0x9aa4('0x18'));var config=require(_0x9aa4('0x19'));var licenseUtil=require(_0x9aa4('0x1a'));var db=require(_0x9aa4('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9aa4('0x1c'),'port':0x18eb});var socket=require(_0x9aa4('0x1d'))(new Redis(config[_0x9aa4('0x1e')]));require(_0x9aa4('0x1f'))[_0x9aa4('0x20')](socket);function respondWithStatusCode(_0x1f669a,_0x17ba83){_0x17ba83=_0x17ba83||0xcc;return function(_0x3975d4){if(_0x3975d4){return _0x1f669a[_0x9aa4('0x21')](_0x17ba83);}return _0x1f669a[_0x9aa4('0x22')](_0x17ba83)[_0x9aa4('0x23')]();};}function respondWithResult(_0x3c56a2,_0x2f1fcd){_0x2f1fcd=_0x2f1fcd||0xc8;return function(_0x3e2e4e){if(_0x3e2e4e){return _0x3c56a2[_0x9aa4('0x22')](_0x2f1fcd)[_0x9aa4('0x24')](_0x3e2e4e);}};}function respondWithFilteredResult(_0x38b346,_0x25408a){return function(_0x4b8806){if(_0x4b8806){var _0x2328a4=typeof _0x25408a[_0x9aa4('0x25')]===_0x9aa4('0x26')&&typeof _0x25408a[_0x9aa4('0x27')]===_0x9aa4('0x26');var _0x4b75e7=_0x4b8806[_0x9aa4('0x28')];var _0x5d8340=_0x2328a4?0x0:_0x25408a['offset'];var _0x1e65e5=_0x2328a4?_0x4b8806[_0x9aa4('0x28')]:_0x25408a[_0x9aa4('0x25')]+_0x25408a[_0x9aa4('0x27')];var _0x449ac2;if(_0x1e65e5>=_0x4b75e7){_0x1e65e5=_0x4b75e7;_0x449ac2=0xc8;}else{_0x449ac2=0xce;}_0x38b346[_0x9aa4('0x22')](_0x449ac2);return _0x38b346[_0x9aa4('0x29')](_0x9aa4('0x2a'),_0x5d8340+'-'+_0x1e65e5+'/'+_0x4b75e7)[_0x9aa4('0x24')](_0x4b8806);}return null;};}function patchUpdates(_0x467778){return function(_0x1d189f){try{jsonpatch[_0x9aa4('0x2b')](_0x1d189f,_0x467778,!![]);}catch(_0x539c33){return BPromise[_0x9aa4('0x2c')](_0x539c33);}return _0x1d189f[_0x9aa4('0x2d')]();};}function saveUpdates(_0x4b55b0,_0x186506){return function(_0x5c0f90){if(_0x5c0f90){return _0x5c0f90[_0x9aa4('0x2e')](_0x4b55b0)[_0x9aa4('0x2f')](function(_0x38ffc0){return _0x38ffc0;});}return null;};}function removeEntity(_0x46f256,_0x43fc8a){return function(_0x3ae9af){if(_0x3ae9af){return _0x3ae9af[_0x9aa4('0x30')]()['then'](function(){var _0x2ac59f=_0x3ae9af[_0x9aa4('0x31')]({'plain':!![]});var _0x5ef48b=_0x9aa4('0x32');return db[_0x9aa4('0x33')][_0x9aa4('0x30')]({'where':{'type':_0x5ef48b,'resourceId':_0x2ac59f['id']}})['then'](function(){return _0x3ae9af;});})[_0x9aa4('0x2f')](function(){_0x46f256[_0x9aa4('0x22')](0xcc)[_0x9aa4('0x23')]();});}};}function handleEntityNotFound(_0x2d624e,_0x42fe24){return function(_0x301ccd){if(!_0x301ccd){_0x2d624e[_0x9aa4('0x21')](0x194);}return _0x301ccd;};}function handleError(_0x4f29f2,_0x35c27a){_0x35c27a=_0x35c27a||0x1f4;return function(_0x14e06c){logger[_0x9aa4('0x34')](_0x14e06c[_0x9aa4('0x35')]);if(_0x14e06c[_0x9aa4('0x36')]){delete _0x14e06c[_0x9aa4('0x36')];}_0x4f29f2[_0x9aa4('0x22')](_0x35c27a)[_0x9aa4('0x37')](_0x14e06c);};}exports[_0x9aa4('0x38')]=function(_0x4701ee,_0x2a5043){var _0x1b752d={},_0x2eeddc={},_0x561297={'count':0x0,'rows':[]};var _0x17eb4a=_[_0x9aa4('0x39')](db[_0x9aa4('0x3a')]['rawAttributes'],function(_0x285dd9){return{'name':_0x285dd9['fieldName'],'type':_0x285dd9[_0x9aa4('0x3b')][_0x9aa4('0x3c')]};});_0x2eeddc[_0x9aa4('0x3d')]=_[_0x9aa4('0x39')](_0x17eb4a,_0x9aa4('0x36'));_0x2eeddc[_0x9aa4('0x3e')]=_['keys'](_0x4701ee[_0x9aa4('0x3e')]);_0x2eeddc[_0x9aa4('0x3f')]=_['intersection'](_0x2eeddc[_0x9aa4('0x3d')],_0x2eeddc['query']);_0x1b752d['attributes']=_[_0x9aa4('0x40')](_0x2eeddc[_0x9aa4('0x3d')],qs[_0x9aa4('0x41')](_0x4701ee[_0x9aa4('0x3e')][_0x9aa4('0x41')]));_0x1b752d['attributes']=_0x1b752d[_0x9aa4('0x42')][_0x9aa4('0x43')]?_0x1b752d['attributes']:_0x2eeddc[_0x9aa4('0x3d')];if(!_0x4701ee[_0x9aa4('0x3e')][_0x9aa4('0x44')](_0x9aa4('0x45'))){_0x1b752d['limit']=qs['limit'](_0x4701ee['query']['limit']);_0x1b752d[_0x9aa4('0x25')]=qs[_0x9aa4('0x25')](_0x4701ee[_0x9aa4('0x3e')]['offset']);}_0x1b752d['order']=qs[_0x9aa4('0x46')](_0x4701ee[_0x9aa4('0x3e')][_0x9aa4('0x46')]);_0x1b752d['where']=qs[_0x9aa4('0x3f')](_[_0x9aa4('0x47')](_0x4701ee['query'],_0x2eeddc[_0x9aa4('0x3f')]),_0x17eb4a);if(_0x4701ee['query']['filter']){_0x1b752d[_0x9aa4('0x48')]=_['merge'](_0x1b752d[_0x9aa4('0x48')],{'$or':_[_0x9aa4('0x39')](_0x17eb4a,function(_0xc10e35){if(_0xc10e35[_0x9aa4('0x3b')]!==_0x9aa4('0x49')){var _0x517a0a={};_0x517a0a[_0xc10e35['name']]={'$like':'%'+_0x4701ee[_0x9aa4('0x3e')]['filter']+'%'};return _0x517a0a;}})});}_0x1b752d=_[_0x9aa4('0x4a')]({},_0x1b752d,_0x4701ee[_0x9aa4('0x4b')]);var _0x2c2512={'where':_0x1b752d[_0x9aa4('0x48')]};return db[_0x9aa4('0x3a')][_0x9aa4('0x28')](_0x2c2512)[_0x9aa4('0x2f')](function(_0x3f2454){_0x561297[_0x9aa4('0x28')]=_0x3f2454;if(_0x4701ee[_0x9aa4('0x3e')]['includeAll']){_0x1b752d[_0x9aa4('0x4c')]=[{'all':!![]}];}return db[_0x9aa4('0x3a')][_0x9aa4('0x4d')](_0x1b752d);})[_0x9aa4('0x2f')](function(_0x5d4b63){_0x561297[_0x9aa4('0x4e')]=_0x5d4b63;return _0x561297;})[_0x9aa4('0x2f')](respondWithFilteredResult(_0x2a5043,_0x1b752d))['catch'](handleError(_0x2a5043,null));};exports['show']=function(_0x5a64f9,_0x63e647){var _0x984e93={'raw':!![],'where':{'id':_0x5a64f9[_0x9aa4('0x4f')]['id']}},_0x5ba8c4={};_0x5ba8c4[_0x9aa4('0x3d')]=_['keys'](db[_0x9aa4('0x3a')][_0x9aa4('0x50')]);_0x5ba8c4[_0x9aa4('0x3e')]=_[_0x9aa4('0x51')](_0x5a64f9[_0x9aa4('0x3e')]);_0x5ba8c4['filters']=_['intersection'](_0x5ba8c4[_0x9aa4('0x3d')],_0x5ba8c4[_0x9aa4('0x3e')]);_0x984e93[_0x9aa4('0x42')]=_[_0x9aa4('0x40')](_0x5ba8c4[_0x9aa4('0x3d')],qs[_0x9aa4('0x41')](_0x5a64f9[_0x9aa4('0x3e')][_0x9aa4('0x41')]));_0x984e93[_0x9aa4('0x42')]=_0x984e93['attributes'][_0x9aa4('0x43')]?_0x984e93[_0x9aa4('0x42')]:_0x5ba8c4[_0x9aa4('0x3d')];if(_0x5a64f9[_0x9aa4('0x3e')][_0x9aa4('0x52')]){_0x984e93[_0x9aa4('0x4c')]=[{'all':!![]}];}_0x984e93=_[_0x9aa4('0x4a')]({},_0x984e93,_0x5a64f9[_0x9aa4('0x4b')]);return db[_0x9aa4('0x3a')][_0x9aa4('0x53')](_0x984e93)[_0x9aa4('0x2f')](handleEntityNotFound(_0x63e647,null))[_0x9aa4('0x2f')](respondWithResult(_0x63e647,null))[_0x9aa4('0x54')](handleError(_0x63e647,null));};exports['create']=function(_0x2ef834,_0x2d00d4){return db['MailQueue'][_0x9aa4('0x55')](_0x2ef834['body'],{})[_0x9aa4('0x2f')](function(_0x3a6d08){var _0x4f4033=_0x2ef834[_0x9aa4('0x56')][_0x9aa4('0x31')]({'plain':!![]});if(!_0x4f4033)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f4033[_0x9aa4('0x57')]===_0x9aa4('0x56')){var _0x2457bb=_0x3a6d08[_0x9aa4('0x31')]({'plain':!![]});var _0x3f02a8=_0x9aa4('0x32');return db[_0x9aa4('0x58')]['find']({'where':{'name':_0x3f02a8,'userProfileId':_0x4f4033['userProfileId']},'raw':!![]})['then'](function(_0x2859b4){if(_0x2859b4&&_0x2859b4[_0x9aa4('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x2457bb[_0x9aa4('0x36')],'resourceId':_0x2457bb['id'],'type':_0x2859b4[_0x9aa4('0x36')],'sectionId':_0x2859b4['id']},{})[_0x9aa4('0x2f')](function(){return _0x3a6d08;});}else{return _0x3a6d08;}})[_0x9aa4('0x54')](function(_0xc293a1){logger['error'](_0x9aa4('0x5a'),_0xc293a1);throw _0xc293a1;});}return _0x3a6d08;})[_0x9aa4('0x2f')](respondWithResult(_0x2d00d4,0xc9))['catch'](handleError(_0x2d00d4,null));};exports[_0x9aa4('0x2e')]=function(_0x43f588,_0xff41af){if(_0x43f588[_0x9aa4('0x5b')]['id']){delete _0x43f588[_0x9aa4('0x5b')]['id'];}return db[_0x9aa4('0x3a')][_0x9aa4('0x53')]({'where':{'id':_0x43f588['params']['id']}})[_0x9aa4('0x2f')](handleEntityNotFound(_0xff41af,null))[_0x9aa4('0x2f')](saveUpdates(_0x43f588[_0x9aa4('0x5b')],null))[_0x9aa4('0x2f')](respondWithResult(_0xff41af,null))[_0x9aa4('0x54')](handleError(_0xff41af,null));};exports['destroy']=function(_0x243f4f,_0x245799){return db[_0x9aa4('0x3a')][_0x9aa4('0x53')]({'where':{'id':_0x243f4f[_0x9aa4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x245799,null))[_0x9aa4('0x2f')](removeEntity(_0x245799,null))[_0x9aa4('0x54')](handleError(_0x245799,null));};exports[_0x9aa4('0x5c')]=function(_0x344c1b,_0x1ee2a2){return db[_0x9aa4('0x3a')][_0x9aa4('0x5c')]()[_0x9aa4('0x2f')](respondWithResult(_0x1ee2a2,null))[_0x9aa4('0x54')](handleError(_0x1ee2a2,null));};exports[_0x9aa4('0x5d')]=function(_0x56e515,_0x5b9713,_0x41909){var _0x1ef356={'raw':!![],'where':{}},_0x316eaa={},_0x24a9fd;return db[_0x9aa4('0x3a')][_0x9aa4('0x5e')]({'where':{'id':_0x56e515[_0x9aa4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b9713,null))[_0x9aa4('0x2f')](function(_0x344171){if(_0x344171){_0x24a9fd=_0x344171['get']({'plain':!![]});_0x316eaa[_0x9aa4('0x3d')]=_[_0x9aa4('0x51')](db[_0x9aa4('0x5f')][_0x9aa4('0x50')]);_0x316eaa['query']=_[_0x9aa4('0x51')](_0x56e515[_0x9aa4('0x3e')]);_0x316eaa[_0x9aa4('0x3f')]=_[_0x9aa4('0x40')](_0x316eaa['model'],_0x316eaa[_0x9aa4('0x3e')]);_0x1ef356[_0x9aa4('0x42')]=_[_0x9aa4('0x40')](_0x316eaa[_0x9aa4('0x3d')],qs[_0x9aa4('0x41')](_0x56e515[_0x9aa4('0x3e')][_0x9aa4('0x41')]));_0x1ef356[_0x9aa4('0x42')]=_0x1ef356['attributes'][_0x9aa4('0x43')]?_0x1ef356[_0x9aa4('0x42')]:_0x316eaa['model'];if(!_0x56e515['query']['hasOwnProperty'](_0x9aa4('0x45'))){_0x1ef356[_0x9aa4('0x27')]=qs[_0x9aa4('0x27')](_0x56e515['query'][_0x9aa4('0x27')]);_0x1ef356['offset']=qs[_0x9aa4('0x25')](_0x56e515[_0x9aa4('0x3e')]['offset']);}_0x1ef356[_0x9aa4('0x60')]=qs[_0x9aa4('0x46')](_0x56e515[_0x9aa4('0x3e')][_0x9aa4('0x46')]);_0x1ef356['where']=qs[_0x9aa4('0x3f')](_[_0x9aa4('0x47')](_0x56e515[_0x9aa4('0x3e')],_0x316eaa[_0x9aa4('0x3f')]));_0x1ef356[_0x9aa4('0x48')]['MailQueueId']=_0x344171['id'];if(_0x56e515[_0x9aa4('0x3e')][_0x9aa4('0x61')]){_0x1ef356['where']=_[_0x9aa4('0x4a')](_0x1ef356['where'],{'$or':_[_0x9aa4('0x39')](_0x1ef356['attributes'],function(_0x2ed590){var _0x8bf8fa={};_0x8bf8fa[_0x2ed590]={'$like':'%'+_0x56e515[_0x9aa4('0x3e')][_0x9aa4('0x61')]+'%'};return _0x8bf8fa;})});}_0x1ef356=_[_0x9aa4('0x4a')]({},_0x1ef356,_0x56e515['options']);return db['UserMailQueue'][_0x9aa4('0x4d')](_0x1ef356);}})['then'](function(_0x31da24){if(_0x31da24){return db[_0x9aa4('0x62')][_0x9aa4('0x63')]({'where':{'id':_[_0x9aa4('0x39')](_0x31da24,_0x9aa4('0x64')),'role':_0x9aa4('0x65')},'attributes':['id','name',_0x9aa4('0x66'),'updatedAt',_0x9aa4('0x67')]});}})[_0x9aa4('0x2f')](function(_0x21ac10){if(_0x21ac10){return{'count':_0x21ac10[_0x9aa4('0x28')],'rows':_[_0x9aa4('0x39')](_0x21ac10['rows'],function(_0x58e337){return{'membername':_0x58e337[_0x9aa4('0x36')],'UserId':_0x58e337['id'],'queue_name':_0x24a9fd[_0x9aa4('0x36')],'MailQueueId':_0x24a9fd['id'],'interface':util[_0x9aa4('0x68')](_0x9aa4('0x69'),'SIP',_0x58e337[_0x9aa4('0x36')]),'penalty':0x0,'paused':_0x58e337[_0x9aa4('0x66')],'createdAt':_0x58e337[_0x9aa4('0x67')],'updatedAt':_0x58e337[_0x9aa4('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9aa4('0x2f')](respondWithFilteredResult(_0x5b9713,_0x1ef356))['catch'](handleError(_0x5b9713,null));};exports[_0x9aa4('0x6b')]=function(_0x256ed3,_0x38d811,_0x22d8bc){var _0x4c8552={};var _0x424b55={};var _0x4061e6;var _0x12a266;return db[_0x9aa4('0x3a')][_0x9aa4('0x5e')]({'where':{'id':_0x256ed3[_0x9aa4('0x4f')]['id']}})[_0x9aa4('0x2f')](handleEntityNotFound(_0x38d811,null))['then'](function(_0x19a7c7){if(_0x19a7c7){_0x4061e6=_0x19a7c7;_0x424b55[_0x9aa4('0x3d')]=_['keys'](db['Team'][_0x9aa4('0x50')]);_0x424b55[_0x9aa4('0x3e')]=_[_0x9aa4('0x51')](_0x256ed3['query']);_0x424b55[_0x9aa4('0x3f')]=_[_0x9aa4('0x40')](_0x424b55['model'],_0x424b55['query']);_0x4c8552[_0x9aa4('0x42')]=_[_0x9aa4('0x40')](_0x424b55['model'],qs[_0x9aa4('0x41')](_0x256ed3['query']['fields']));_0x4c8552[_0x9aa4('0x42')]=_0x4c8552[_0x9aa4('0x42')][_0x9aa4('0x43')]?_0x4c8552['attributes']:_0x424b55['model'];_0x4c8552['order']=qs[_0x9aa4('0x46')](_0x256ed3[_0x9aa4('0x3e')]['sort']);_0x4c8552[_0x9aa4('0x48')]=qs[_0x9aa4('0x3f')](_[_0x9aa4('0x47')](_0x256ed3[_0x9aa4('0x3e')],_0x424b55[_0x9aa4('0x3f')]));if(_0x256ed3[_0x9aa4('0x3e')]['filter']){_0x4c8552[_0x9aa4('0x48')]=_[_0x9aa4('0x4a')](_0x4c8552[_0x9aa4('0x48')],{'$or':_['map'](_0x4c8552['attributes'],function(_0x49bf1e){var _0xbcd839={};_0xbcd839[_0x49bf1e]={'$like':'%'+_0x256ed3[_0x9aa4('0x3e')][_0x9aa4('0x61')]+'%'};return _0xbcd839;})});}_0x4c8552=_[_0x9aa4('0x4a')]({},_0x4c8552,_0x256ed3['options']);return _0x4061e6[_0x9aa4('0x6b')](_0x4c8552);}})[_0x9aa4('0x2f')](function(_0x373500){if(_0x373500){_0x12a266=_0x373500['length'];if(!_0x256ed3[_0x9aa4('0x3e')]['hasOwnProperty']('nolimit')){_0x4c8552['limit']=qs[_0x9aa4('0x27')](_0x256ed3[_0x9aa4('0x3e')][_0x9aa4('0x27')]);_0x4c8552[_0x9aa4('0x25')]=qs[_0x9aa4('0x25')](_0x256ed3['query'][_0x9aa4('0x25')]);}return _0x4061e6[_0x9aa4('0x6b')](_0x4c8552);}})['then'](function(_0x545b66){if(_0x545b66){return _0x545b66?{'count':_0x12a266,'rows':_0x545b66}:null;}})[_0x9aa4('0x2f')](respondWithResult(_0x38d811,null))['catch'](handleError(_0x38d811,null));};exports[_0x9aa4('0x6c')]=function(_0x21fd45,_0x136941,_0x416d59){var _0x4105f7=_0x21fd45[_0x9aa4('0x5b')][_0x9aa4('0x6d')];return db[_0x9aa4('0x6e')][_0x9aa4('0x4d')]({'where':{'id':_0x4105f7},'attributes':['id'],'include':[{'model':db[_0x9aa4('0x62')],'as':_0x9aa4('0x6f'),'attributes':['id',_0x9aa4('0x36'),'online',_0x9aa4('0x70'),_0x9aa4('0x71')],'raw':!![]}]})[_0x9aa4('0x2f')](function(_0x56811f){if(_0x56811f){var _0xc6a56d=_['flatMap'](_0x56811f,function(_0x5c5912){var _0x498852=_0x5c5912[_0x9aa4('0x31')]({'plain':!![]});return _0x498852[_0x9aa4('0x6f')];});return db[_0x9aa4('0x3a')][_0x9aa4('0x53')]({'where':{'id':_0x21fd45[_0x9aa4('0x4f')]['id']}})[_0x9aa4('0x2f')](function(_0x3dc666){return db[_0x9aa4('0x72')][_0x9aa4('0x73')](function(_0x18a64c){return _0x3dc666[_0x9aa4('0x6c')](_0x4105f7,{'transaction':_0x18a64c})[_0x9aa4('0x2f')](function(){return BPromise[_0x9aa4('0x74')](_0xc6a56d,function(_0x2ad97c){return db['UserMailQueue'][_0x9aa4('0x75')]({'where':{'UserId':_0x2ad97c['id'],'MailQueueId':_0x21fd45[_0x9aa4('0x4f')]['id']},'transaction':_0x18a64c});});})['then'](function(){_0xc6a56d[_0x9aa4('0x76')](function(_0x2c4ab5){socket['emit'](_0x9aa4('0x77'),{'UserId':_0x2c4ab5['id'],'MailQueueId':_0x3dc666['id']});});});});});}})['then'](respondWithStatusCode(_0x136941,null))['catch'](handleError(_0x136941,null));};exports[_0x9aa4('0x78')]=function(_0x2d213d,_0x169245,_0x186a78){return db[_0x9aa4('0x6e')][_0x9aa4('0x4d')]({'where':{'id':_0x2d213d[_0x9aa4('0x3e')][_0x9aa4('0x6d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9aa4('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x169245,null))[_0x9aa4('0x2f')](function(_0x2e18f3){var _0x19bade=_['map'](_0x2e18f3,'id');var _0x35de49=[];var _0x3db95e=[];var _0x4f2bfa=squel[_0x9aa4('0x79')]();_0x4f2bfa[_0x9aa4('0x7a')](_0x9aa4('0x7b'))[_0x9aa4('0x7c')]('team_has_mail_queues','tq')[_0x9aa4('0x7d')]('user_has_teams','ut',_0x9aa4('0x7e'))['where']('MailQueueId\x20=\x20?',_0x2d213d[_0x9aa4('0x4f')]['id']);for(var _0x538be5=0x0;_0x538be5<_0x2e18f3[_0x9aa4('0x43')];_0x538be5+=0x1){let _0x24963d=_0x2e18f3[_0x538be5];for(var _0x2b25f6=0x0;_0x2b25f6<_0x24963d[_0x9aa4('0x6f')][_0x9aa4('0x43')];_0x2b25f6+=0x1){let _0x31133d=_0x24963d[_0x9aa4('0x6f')][_0x2b25f6];var _0x4caf40=_0x4f2bfa[_0x9aa4('0x7f')]();_0x4caf40[_0x9aa4('0x48')](_0x9aa4('0x80'),_0x31133d['id']);_0x3db95e['push'](db[_0x9aa4('0x72')][_0x9aa4('0x3e')](_0x4caf40[_0x9aa4('0x81')](),{'type':db[_0x9aa4('0x72')][_0x9aa4('0x82')][_0x9aa4('0x83')]})[_0x9aa4('0x2f')](function(_0xc6ecca){if(_0xc6ecca[_0x9aa4('0x43')]===0x1){return _0x31133d['id'];}else{var _0x3ed3f0=_[_0x9aa4('0x84')](_['map'](_0xc6ecca,_0x9aa4('0x85')),function(_0x432c1b){return _[_0x9aa4('0x86')](_0x19bade,_0x432c1b);});if(_0x3ed3f0){return _0x31133d['id'];}}}));}}return BPromise[_0x9aa4('0x87')](_0x3db95e)[_0x9aa4('0x2f')](function(_0x2fc894){_0x35de49=_(_0x35de49)['union'](_0x2fc894)[_0x9aa4('0x88')]()[_0x9aa4('0x89')]();return db[_0x9aa4('0x3a')][_0x9aa4('0x53')]({'where':{'id':_0x2d213d[_0x9aa4('0x4f')]['id']}})['then'](function(_0x416799){return db['sequelize']['transaction'](function(_0x5c8198){return _0x416799[_0x9aa4('0x78')](_0x2d213d[_0x9aa4('0x3e')][_0x9aa4('0x6d')],{'transaction':_0x5c8198})[_0x9aa4('0x2f')](function(){if(!_[_0x9aa4('0x8a')](_0x35de49)){return _0x416799[_0x9aa4('0x8b')](_0x35de49,{'transaction':_0x5c8198});}})[_0x9aa4('0x2f')](function(){_0x35de49[_0x9aa4('0x76')](function(_0x1806a2){socket[_0x9aa4('0x8c')]('userMailQueue:remove',{'UserId':_0x1806a2,'MailQueueId':_0x416799['id']});});});});});});})[_0x9aa4('0x2f')](respondWithStatusCode(_0x169245,null))[_0x9aa4('0x54')](handleError(_0x169245,null));};exports[_0x9aa4('0x8d')]=function(_0x2afd91,_0x53ed7c,_0x4c7f0d){return db[_0x9aa4('0x3a')]['find']({'where':{'id':_0x2afd91[_0x9aa4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x53ed7c,null))[_0x9aa4('0x2f')](function(_0x2a6f1a){if(_0x2a6f1a){return _0x2a6f1a[_0x9aa4('0x8d')](_0x2afd91['body'][_0x9aa4('0x6d')],_[_0x9aa4('0x8e')](_0x2afd91['body'],['ids','id'])||{})[_0x9aa4('0x8f')](function(_0x18d9ae){for(var _0x50ee8e=0x0;_0x50ee8e<_0x2afd91['body'][_0x9aa4('0x6d')][_0x9aa4('0x43')];_0x50ee8e+=0x1){socket['emit'](_0x9aa4('0x77'),{'UserId':Number(_0x2afd91[_0x9aa4('0x5b')][_0x9aa4('0x6d')][_0x50ee8e]),'MailQueueId':Number(_0x2afd91['params']['id'])});}return _0x18d9ae;});}})[_0x9aa4('0x2f')](respondWithResult(_0x53ed7c,null))[_0x9aa4('0x54')](handleError(_0x53ed7c,null));};exports[_0x9aa4('0x8b')]=function(_0xc61e0a,_0x450d1e,_0x570edd){return db['MailQueue'][_0x9aa4('0x53')]({'where':{'id':_0xc61e0a[_0x9aa4('0x4f')]['id']}})['then'](handleEntityNotFound(_0x450d1e,null))['then'](function(_0x2c56d3){if(_0x2c56d3){return _0x2c56d3[_0x9aa4('0x8b')](_0xc61e0a[_0x9aa4('0x3e')][_0x9aa4('0x6d')])[_0x9aa4('0x2f')](function(){if(_[_0x9aa4('0x90')](_0xc61e0a[_0x9aa4('0x3e')][_0x9aa4('0x6d')])){for(var _0x2a3740=0x0;_0x2a3740<_0xc61e0a[_0x9aa4('0x3e')][_0x9aa4('0x6d')][_0x9aa4('0x43')];_0x2a3740+=0x1){socket[_0x9aa4('0x8c')](_0x9aa4('0x91'),{'UserId':Number(_0xc61e0a[_0x9aa4('0x3e')]['ids'][_0x2a3740]),'MailQueueId':Number(_0xc61e0a[_0x9aa4('0x4f')]['id'])});}}else{socket[_0x9aa4('0x8c')](_0x9aa4('0x91'),{'UserId':Number(_0xc61e0a[_0x9aa4('0x3e')][_0x9aa4('0x6d')]),'MailQueueId':Number(_0xc61e0a[_0x9aa4('0x4f')]['id'])});}});}})[_0x9aa4('0x2f')](respondWithStatusCode(_0x450d1e,null))[_0x9aa4('0x54')](handleError(_0x450d1e,null));};exports[_0x9aa4('0x92')]=function(_0x580a8c,_0x3f6186,_0xe8da9e){var _0x2859b8={};var _0x3475a5={};var _0x1a0ca8;var _0x35fb64;return db[_0x9aa4('0x3a')]['findOne']({'where':{'id':_0x580a8c['params']['id']}})['then'](handleEntityNotFound(_0x3f6186,null))['then'](function(_0x56549f){if(_0x56549f){_0x1a0ca8=_0x56549f;_0x3475a5[_0x9aa4('0x3d')]=_[_0x9aa4('0x51')](db[_0x9aa4('0x62')][_0x9aa4('0x50')]);_0x3475a5['query']=_[_0x9aa4('0x51')](_0x580a8c['query']);_0x3475a5[_0x9aa4('0x3f')]=_[_0x9aa4('0x40')](_0x3475a5[_0x9aa4('0x3d')],_0x3475a5[_0x9aa4('0x3e')]);_0x2859b8['attributes']=_['intersection'](_0x3475a5[_0x9aa4('0x3d')],qs[_0x9aa4('0x41')](_0x580a8c[_0x9aa4('0x3e')]['fields']));_0x2859b8[_0x9aa4('0x42')]=_0x2859b8[_0x9aa4('0x42')][_0x9aa4('0x43')]?_0x2859b8[_0x9aa4('0x42')]:_0x3475a5[_0x9aa4('0x3d')];_0x2859b8[_0x9aa4('0x60')]=qs[_0x9aa4('0x46')](_0x580a8c['query'][_0x9aa4('0x46')]);_0x2859b8['where']=qs['filters'](_[_0x9aa4('0x47')](_0x580a8c[_0x9aa4('0x3e')],_0x3475a5[_0x9aa4('0x3f')]));if(_0x580a8c['query'][_0x9aa4('0x61')]){_0x2859b8[_0x9aa4('0x48')]=_[_0x9aa4('0x4a')](_0x2859b8[_0x9aa4('0x48')],{'$or':_['map'](_0x2859b8[_0x9aa4('0x42')],function(_0x33e2f0){var _0x31dfdd={};_0x31dfdd[_0x33e2f0]={'$like':'%'+_0x580a8c[_0x9aa4('0x3e')][_0x9aa4('0x61')]+'%'};return _0x31dfdd;})});}_0x2859b8=_[_0x9aa4('0x4a')]({},_0x2859b8,_0x580a8c[_0x9aa4('0x4b')]);return _0x1a0ca8[_0x9aa4('0x92')](_0x2859b8);}})['then'](function(_0x1b0357){if(_0x1b0357){_0x35fb64=_0x1b0357['length'];if(!_0x580a8c['query'][_0x9aa4('0x44')](_0x9aa4('0x45'))){_0x2859b8['limit']=qs['limit'](_0x580a8c[_0x9aa4('0x3e')]['limit']);_0x2859b8['offset']=qs[_0x9aa4('0x25')](_0x580a8c[_0x9aa4('0x3e')][_0x9aa4('0x25')]);}return _0x1a0ca8[_0x9aa4('0x92')](_0x2859b8);}})['then'](function(_0x2597d7){if(_0x2597d7){return _0x2597d7?{'count':_0x35fb64,'rows':_0x2597d7}:null;}})[_0x9aa4('0x2f')](respondWithResult(_0x3f6186,null))[_0x9aa4('0x54')](handleError(_0x3f6186,null));}; \ No newline at end of file +var _0x0155=['find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','User','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','set','apply','save','update','then','get','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','filter','where','merge','VIRTUAL','count','includeAll','findAll','params','fields','include','options'];(function(_0x55fba8,_0x427e0a){var _0x2fa99f=function(_0x2320cd){while(--_0x2320cd){_0x55fba8['push'](_0x55fba8['shift']());}};_0x2fa99f(++_0x427e0a);}(_0x0155,0x1da));var _0x5015=function(_0x6561e0,_0x487738){_0x6561e0=_0x6561e0-0x0;var _0x365a0e=_0x0155[_0x6561e0];return _0x365a0e;};'use strict';var emlformat=require(_0x5015('0x0'));var rimraf=require(_0x5015('0x1'));var zipdir=require(_0x5015('0x2'));var jsonpatch=require(_0x5015('0x3'));var rp=require(_0x5015('0x4'));var moment=require(_0x5015('0x5'));var BPromise=require(_0x5015('0x6'));var Mustache=require(_0x5015('0x7'));var util=require(_0x5015('0x8'));var path=require(_0x5015('0x9'));var sox=require(_0x5015('0xa'));var csv=require(_0x5015('0xb'));var ejs=require(_0x5015('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5015('0xd'));var squel=require(_0x5015('0xe'));var crypto=require(_0x5015('0xf'));var jsforce=require(_0x5015('0x10'));var deskjs=require(_0x5015('0x11'));var toCsv=require(_0x5015('0xb'));var querystring=require(_0x5015('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5015('0x13'));var qs=require(_0x5015('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5015('0x15'));var logger=require('../../config/logger')(_0x5015('0x16'));var utils=require(_0x5015('0x17'));var config=require(_0x5015('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5015('0x19'))['db'];config[_0x5015('0x1a')]=_[_0x5015('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5015('0x1c'))(new Redis(config[_0x5015('0x1a')]));require('./mailQueue.socket')[_0x5015('0x1d')](socket);function respondWithStatusCode(_0x25cf0f,_0x2288c8){_0x2288c8=_0x2288c8||0xcc;return function(_0x5e1261){if(_0x5e1261){return _0x25cf0f[_0x5015('0x1e')](_0x2288c8);}return _0x25cf0f['status'](_0x2288c8)[_0x5015('0x1f')]();};}function respondWithResult(_0x5863da,_0x55eadc){_0x55eadc=_0x55eadc||0xc8;return function(_0x4debc0){if(_0x4debc0){return _0x5863da[_0x5015('0x20')](_0x55eadc)[_0x5015('0x21')](_0x4debc0);}};}function respondWithFilteredResult(_0x366584,_0xab347d){return function(_0x29e5c1){if(_0x29e5c1){var _0x185f37=typeof _0xab347d[_0x5015('0x22')]===_0x5015('0x23')&&typeof _0xab347d[_0x5015('0x24')]===_0x5015('0x23');var _0x3e7ead=_0x29e5c1['count'];var _0xea4438=_0x185f37?0x0:_0xab347d['offset'];var _0x21836f=_0x185f37?_0x29e5c1['count']:_0xab347d[_0x5015('0x22')]+_0xab347d[_0x5015('0x24')];var _0x19d159;if(_0x21836f>=_0x3e7ead){_0x21836f=_0x3e7ead;_0x19d159=0xc8;}else{_0x19d159=0xce;}_0x366584['status'](_0x19d159);return _0x366584[_0x5015('0x25')]('Content-Range',_0xea4438+'-'+_0x21836f+'/'+_0x3e7ead)[_0x5015('0x21')](_0x29e5c1);}return null;};}function patchUpdates(_0x21985f){return function(_0x5cbcd3){try{jsonpatch[_0x5015('0x26')](_0x5cbcd3,_0x21985f,!![]);}catch(_0xb7f21d){return BPromise['reject'](_0xb7f21d);}return _0x5cbcd3[_0x5015('0x27')]();};}function saveUpdates(_0x498bcc,_0x3d468a){return function(_0x477fff){if(_0x477fff){return _0x477fff[_0x5015('0x28')](_0x498bcc)[_0x5015('0x29')](function(_0x1dd1cc){return _0x1dd1cc;});}return null;};}function removeEntity(_0x363a78,_0x49e1c0){return function(_0x3eea36){if(_0x3eea36){return _0x3eea36['destroy']()[_0x5015('0x29')](function(){var _0x3a2884=_0x3eea36[_0x5015('0x2a')]({'plain':!![]});var _0x4f4470=_0x5015('0x2b');return db[_0x5015('0x2c')]['destroy']({'where':{'type':_0x4f4470,'resourceId':_0x3a2884['id']}})[_0x5015('0x29')](function(){return _0x3eea36;});})[_0x5015('0x29')](function(){_0x363a78['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bef27,_0x105fda){return function(_0x464048){if(!_0x464048){_0x4bef27[_0x5015('0x1e')](0x194);}return _0x464048;};}function handleError(_0x380adf,_0x2a7ce4){_0x2a7ce4=_0x2a7ce4||0x1f4;return function(_0x5ef1c4){logger[_0x5015('0x2d')](_0x5ef1c4['stack']);if(_0x5ef1c4[_0x5015('0x2e')]){delete _0x5ef1c4[_0x5015('0x2e')];}_0x380adf['status'](_0x2a7ce4)[_0x5015('0x2f')](_0x5ef1c4);};}exports[_0x5015('0x30')]=function(_0x1b8e9b,_0x1b9f73){var _0xe7d49a={},_0x693d89={},_0x2caf78={'count':0x0,'rows':[]};var _0x48e17b=_[_0x5015('0x31')](db[_0x5015('0x32')][_0x5015('0x33')],function(_0x4c8c54){return{'name':_0x4c8c54['fieldName'],'type':_0x4c8c54[_0x5015('0x34')][_0x5015('0x35')]};});_0x693d89[_0x5015('0x36')]=_[_0x5015('0x31')](_0x48e17b,_0x5015('0x2e'));_0x693d89[_0x5015('0x37')]=_[_0x5015('0x38')](_0x1b8e9b[_0x5015('0x37')]);_0x693d89[_0x5015('0x39')]=_[_0x5015('0x3a')](_0x693d89['model'],_0x693d89[_0x5015('0x37')]);_0xe7d49a[_0x5015('0x3b')]=_[_0x5015('0x3a')](_0x693d89[_0x5015('0x36')],qs['fields'](_0x1b8e9b[_0x5015('0x37')]['fields']));_0xe7d49a['attributes']=_0xe7d49a[_0x5015('0x3b')][_0x5015('0x3c')]?_0xe7d49a[_0x5015('0x3b')]:_0x693d89[_0x5015('0x36')];if(!_0x1b8e9b[_0x5015('0x37')]['hasOwnProperty']('nolimit')){_0xe7d49a[_0x5015('0x24')]=qs[_0x5015('0x24')](_0x1b8e9b[_0x5015('0x37')][_0x5015('0x24')]);_0xe7d49a[_0x5015('0x22')]=qs[_0x5015('0x22')](_0x1b8e9b[_0x5015('0x37')][_0x5015('0x22')]);}_0xe7d49a[_0x5015('0x3d')]=qs['sort'](_0x1b8e9b[_0x5015('0x37')][_0x5015('0x3e')]);_0xe7d49a['where']=qs[_0x5015('0x39')](_['pick'](_0x1b8e9b[_0x5015('0x37')],_0x693d89[_0x5015('0x39')]),_0x48e17b);if(_0x1b8e9b['query'][_0x5015('0x3f')]){_0xe7d49a[_0x5015('0x40')]=_[_0x5015('0x41')](_0xe7d49a[_0x5015('0x40')],{'$or':_[_0x5015('0x31')](_0x48e17b,function(_0x16fd5c){if(_0x16fd5c[_0x5015('0x34')]!==_0x5015('0x42')){var _0x5b6fd6={};_0x5b6fd6[_0x16fd5c[_0x5015('0x2e')]]={'$like':'%'+_0x1b8e9b[_0x5015('0x37')][_0x5015('0x3f')]+'%'};return _0x5b6fd6;}})});}_0xe7d49a=_[_0x5015('0x41')]({},_0xe7d49a,_0x1b8e9b['options']);var _0x4dcd0a={'where':_0xe7d49a[_0x5015('0x40')]};return db[_0x5015('0x32')][_0x5015('0x43')](_0x4dcd0a)[_0x5015('0x29')](function(_0x1af1e8){_0x2caf78['count']=_0x1af1e8;if(_0x1b8e9b['query'][_0x5015('0x44')]){_0xe7d49a['include']=[{'all':!![]}];}return db[_0x5015('0x32')][_0x5015('0x45')](_0xe7d49a);})[_0x5015('0x29')](function(_0x106a81){_0x2caf78['rows']=_0x106a81;return _0x2caf78;})[_0x5015('0x29')](respondWithFilteredResult(_0x1b9f73,_0xe7d49a))['catch'](handleError(_0x1b9f73,null));};exports['show']=function(_0x1afb7b,_0x2714e7){var _0x785fcf={'raw':!![],'where':{'id':_0x1afb7b[_0x5015('0x46')]['id']}},_0x2474a3={};_0x2474a3[_0x5015('0x36')]=_[_0x5015('0x38')](db['MailQueue'][_0x5015('0x33')]);_0x2474a3[_0x5015('0x37')]=_['keys'](_0x1afb7b[_0x5015('0x37')]);_0x2474a3[_0x5015('0x39')]=_[_0x5015('0x3a')](_0x2474a3[_0x5015('0x36')],_0x2474a3[_0x5015('0x37')]);_0x785fcf['attributes']=_[_0x5015('0x3a')](_0x2474a3[_0x5015('0x36')],qs[_0x5015('0x47')](_0x1afb7b[_0x5015('0x37')][_0x5015('0x47')]));_0x785fcf['attributes']=_0x785fcf['attributes'][_0x5015('0x3c')]?_0x785fcf['attributes']:_0x2474a3['model'];if(_0x1afb7b[_0x5015('0x37')][_0x5015('0x44')]){_0x785fcf[_0x5015('0x48')]=[{'all':!![]}];}_0x785fcf=_[_0x5015('0x41')]({},_0x785fcf,_0x1afb7b[_0x5015('0x49')]);return db[_0x5015('0x32')][_0x5015('0x4a')](_0x785fcf)[_0x5015('0x29')](handleEntityNotFound(_0x2714e7,null))[_0x5015('0x29')](respondWithResult(_0x2714e7,null))[_0x5015('0x4b')](handleError(_0x2714e7,null));};exports['create']=function(_0x229d0c,_0x1e4f6d){return db['MailQueue'][_0x5015('0x4c')](_0x229d0c[_0x5015('0x4d')],{})[_0x5015('0x29')](function(_0x5c54c1){var _0x5c088f=_0x229d0c[_0x5015('0x4e')][_0x5015('0x2a')]({'plain':!![]});if(!_0x5c088f)throw new Error(_0x5015('0x4f'));if(_0x5c088f[_0x5015('0x50')]==='user'){var _0x11b205=_0x5c54c1[_0x5015('0x2a')]({'plain':!![]});var _0x2f21d6=_0x5015('0x2b');return db[_0x5015('0x51')][_0x5015('0x4a')]({'where':{'name':_0x2f21d6,'userProfileId':_0x5c088f['userProfileId']},'raw':!![]})[_0x5015('0x29')](function(_0x973127){if(_0x973127&&_0x973127[_0x5015('0x52')]===0x0){return db[_0x5015('0x2c')][_0x5015('0x4c')]({'name':_0x11b205[_0x5015('0x2e')],'resourceId':_0x11b205['id'],'type':_0x973127[_0x5015('0x2e')],'sectionId':_0x973127['id']},{})[_0x5015('0x29')](function(){return _0x5c54c1;});}else{return _0x5c54c1;}})['catch'](function(_0x5b4481){logger[_0x5015('0x2d')](_0x5015('0x53'),_0x5b4481);throw _0x5b4481;});}return _0x5c54c1;})[_0x5015('0x29')](respondWithResult(_0x1e4f6d,0xc9))['catch'](handleError(_0x1e4f6d,null));};exports['update']=function(_0xa3409,_0x544bd4){if(_0xa3409[_0x5015('0x4d')]['id']){delete _0xa3409[_0x5015('0x4d')]['id'];}return db[_0x5015('0x32')][_0x5015('0x4a')]({'where':{'id':_0xa3409[_0x5015('0x46')]['id']}})[_0x5015('0x29')](handleEntityNotFound(_0x544bd4,null))[_0x5015('0x29')](saveUpdates(_0xa3409[_0x5015('0x4d')],null))[_0x5015('0x29')](respondWithResult(_0x544bd4,null))['catch'](handleError(_0x544bd4,null));};exports['destroy']=function(_0x2760c3,_0x1fb367){return db[_0x5015('0x32')][_0x5015('0x4a')]({'where':{'id':_0x2760c3['params']['id']}})[_0x5015('0x29')](handleEntityNotFound(_0x1fb367,null))[_0x5015('0x29')](removeEntity(_0x1fb367,null))['catch'](handleError(_0x1fb367,null));};exports['describe']=function(_0x58ecec,_0x1a9281){return db[_0x5015('0x32')][_0x5015('0x54')]()[_0x5015('0x29')](respondWithResult(_0x1a9281,null))[_0x5015('0x4b')](handleError(_0x1a9281,null));};exports[_0x5015('0x55')]=function(_0x1bc44d,_0x641c92,_0x5a6284){var _0x4654d0={'raw':!![],'where':{}},_0x4e61ee={},_0x53c86f;return db['MailQueue'][_0x5015('0x56')]({'where':{'id':_0x1bc44d[_0x5015('0x46')]['id']}})[_0x5015('0x29')](handleEntityNotFound(_0x641c92,null))[_0x5015('0x29')](function(_0x384dee){if(_0x384dee){_0x53c86f=_0x384dee[_0x5015('0x2a')]({'plain':!![]});_0x4e61ee[_0x5015('0x36')]=_[_0x5015('0x38')](db[_0x5015('0x57')][_0x5015('0x33')]);_0x4e61ee[_0x5015('0x37')]=_[_0x5015('0x38')](_0x1bc44d[_0x5015('0x37')]);_0x4e61ee['filters']=_[_0x5015('0x3a')](_0x4e61ee[_0x5015('0x36')],_0x4e61ee[_0x5015('0x37')]);_0x4654d0[_0x5015('0x3b')]=_[_0x5015('0x3a')](_0x4e61ee['model'],qs[_0x5015('0x47')](_0x1bc44d['query'][_0x5015('0x47')]));_0x4654d0[_0x5015('0x3b')]=_0x4654d0['attributes'][_0x5015('0x3c')]?_0x4654d0[_0x5015('0x3b')]:_0x4e61ee['model'];if(!_0x1bc44d[_0x5015('0x37')][_0x5015('0x58')](_0x5015('0x59'))){_0x4654d0[_0x5015('0x24')]=qs[_0x5015('0x24')](_0x1bc44d[_0x5015('0x37')]['limit']);_0x4654d0['offset']=qs['offset'](_0x1bc44d['query'][_0x5015('0x22')]);}_0x4654d0[_0x5015('0x3d')]=qs['sort'](_0x1bc44d[_0x5015('0x37')]['sort']);_0x4654d0[_0x5015('0x40')]=qs[_0x5015('0x39')](_['pick'](_0x1bc44d['query'],_0x4e61ee[_0x5015('0x39')]));_0x4654d0[_0x5015('0x40')]['MailQueueId']=_0x384dee['id'];if(_0x1bc44d[_0x5015('0x37')][_0x5015('0x3f')]){_0x4654d0[_0x5015('0x40')]=_[_0x5015('0x41')](_0x4654d0[_0x5015('0x40')],{'$or':_['map'](_0x4654d0['attributes'],function(_0x13515f){var _0x2ac5b2={};_0x2ac5b2[_0x13515f]={'$like':'%'+_0x1bc44d['query'][_0x5015('0x3f')]+'%'};return _0x2ac5b2;})});}_0x4654d0=_[_0x5015('0x41')]({},_0x4654d0,_0x1bc44d[_0x5015('0x49')]);return db[_0x5015('0x57')][_0x5015('0x45')](_0x4654d0);}})['then'](function(_0x28ba2f){if(_0x28ba2f){return db[_0x5015('0x5a')]['findAndCountAll']({'where':{'id':_[_0x5015('0x31')](_0x28ba2f,_0x5015('0x5b')),'role':_0x5015('0x5c')},'attributes':['id',_0x5015('0x2e'),_0x5015('0x5d'),_0x5015('0x5e'),_0x5015('0x5f')]});}})[_0x5015('0x29')](function(_0x4d040b){if(_0x4d040b){return{'count':_0x4d040b[_0x5015('0x43')],'rows':_[_0x5015('0x31')](_0x4d040b['rows'],function(_0x506a3b){return{'membername':_0x506a3b[_0x5015('0x2e')],'UserId':_0x506a3b['id'],'queue_name':_0x53c86f[_0x5015('0x2e')],'MailQueueId':_0x53c86f['id'],'interface':util[_0x5015('0x60')]('%s/%s',_0x5015('0x61'),_0x506a3b[_0x5015('0x2e')]),'penalty':0x0,'paused':_0x506a3b[_0x5015('0x5d')],'createdAt':_0x506a3b[_0x5015('0x5f')],'updatedAt':_0x506a3b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5015('0x29')](respondWithFilteredResult(_0x641c92,_0x4654d0))[_0x5015('0x4b')](handleError(_0x641c92,null));};exports['getTeams']=function(_0x32fc43,_0x20d50d,_0x32dc86){var _0x35b9aa={};var _0x3d730e={};var _0x41902a;var _0x590c9d;return db[_0x5015('0x32')][_0x5015('0x56')]({'where':{'id':_0x32fc43[_0x5015('0x46')]['id']}})['then'](handleEntityNotFound(_0x20d50d,null))[_0x5015('0x29')](function(_0x2915b3){if(_0x2915b3){_0x41902a=_0x2915b3;_0x3d730e[_0x5015('0x36')]=_[_0x5015('0x38')](db['Team'][_0x5015('0x33')]);_0x3d730e['query']=_[_0x5015('0x38')](_0x32fc43['query']);_0x3d730e[_0x5015('0x39')]=_[_0x5015('0x3a')](_0x3d730e['model'],_0x3d730e[_0x5015('0x37')]);_0x35b9aa['attributes']=_[_0x5015('0x3a')](_0x3d730e[_0x5015('0x36')],qs[_0x5015('0x47')](_0x32fc43[_0x5015('0x37')][_0x5015('0x47')]));_0x35b9aa[_0x5015('0x3b')]=_0x35b9aa[_0x5015('0x3b')][_0x5015('0x3c')]?_0x35b9aa[_0x5015('0x3b')]:_0x3d730e[_0x5015('0x36')];_0x35b9aa[_0x5015('0x3d')]=qs[_0x5015('0x3e')](_0x32fc43[_0x5015('0x37')][_0x5015('0x3e')]);_0x35b9aa[_0x5015('0x40')]=qs[_0x5015('0x39')](_['pick'](_0x32fc43[_0x5015('0x37')],_0x3d730e['filters']));if(_0x32fc43['query']['filter']){_0x35b9aa['where']=_[_0x5015('0x41')](_0x35b9aa[_0x5015('0x40')],{'$or':_[_0x5015('0x31')](_0x35b9aa['attributes'],function(_0x58ce1b){var _0x10eba8={};_0x10eba8[_0x58ce1b]={'$like':'%'+_0x32fc43[_0x5015('0x37')][_0x5015('0x3f')]+'%'};return _0x10eba8;})});}_0x35b9aa=_[_0x5015('0x41')]({},_0x35b9aa,_0x32fc43[_0x5015('0x49')]);return _0x41902a[_0x5015('0x62')](_0x35b9aa);}})[_0x5015('0x29')](function(_0x172140){if(_0x172140){_0x590c9d=_0x172140['length'];if(!_0x32fc43['query']['hasOwnProperty']('nolimit')){_0x35b9aa[_0x5015('0x24')]=qs[_0x5015('0x24')](_0x32fc43['query'][_0x5015('0x24')]);_0x35b9aa[_0x5015('0x22')]=qs[_0x5015('0x22')](_0x32fc43[_0x5015('0x37')]['offset']);}return _0x41902a['getTeams'](_0x35b9aa);}})['then'](function(_0x174752){if(_0x174752){return _0x174752?{'count':_0x590c9d,'rows':_0x174752}:null;}})[_0x5015('0x29')](respondWithResult(_0x20d50d,null))[_0x5015('0x4b')](handleError(_0x20d50d,null));};exports[_0x5015('0x63')]=function(_0x2c01cd,_0x1c7ccb,_0xe35b8){var _0x445050=_0x2c01cd[_0x5015('0x4d')][_0x5015('0x64')];return db[_0x5015('0x65')][_0x5015('0x45')]({'where':{'id':_0x445050},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5015('0x66'),'attributes':['id',_0x5015('0x2e'),_0x5015('0x67'),_0x5015('0x68'),'interface'],'raw':!![]}]})['then'](function(_0x56963e){if(_0x56963e){var _0x146282=_[_0x5015('0x69')](_0x56963e,function(_0x3b6d1a){var _0x3682c4=_0x3b6d1a['get']({'plain':!![]});return _0x3682c4[_0x5015('0x66')];});return db['MailQueue'][_0x5015('0x4a')]({'where':{'id':_0x2c01cd[_0x5015('0x46')]['id']}})[_0x5015('0x29')](function(_0xad4425){return db[_0x5015('0x6a')][_0x5015('0x6b')](function(_0x3936fc){return _0xad4425[_0x5015('0x63')](_0x445050,{'transaction':_0x3936fc})[_0x5015('0x29')](function(){return BPromise[_0x5015('0x6c')](_0x146282,function(_0x27e5df){return db[_0x5015('0x57')][_0x5015('0x6d')]({'where':{'UserId':_0x27e5df['id'],'MailQueueId':_0x2c01cd['params']['id']},'transaction':_0x3936fc});});})[_0x5015('0x29')](function(){_0x146282[_0x5015('0x6e')](function(_0x1f3f36){socket[_0x5015('0x6f')](_0x5015('0x70'),{'UserId':_0x1f3f36['id'],'MailQueueId':_0xad4425['id']});});});});});}})['then'](respondWithStatusCode(_0x1c7ccb,null))[_0x5015('0x4b')](handleError(_0x1c7ccb,null));};exports[_0x5015('0x71')]=function(_0x490b6b,_0x2ef038,_0x32bd8e){return db[_0x5015('0x65')]['findAll']({'where':{'id':_0x490b6b[_0x5015('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5015('0x5a')],'as':_0x5015('0x66'),'attributes':['id'],'raw':!![]}]})[_0x5015('0x29')](handleEntityNotFound(_0x2ef038,null))[_0x5015('0x29')](function(_0xbaad88){var _0x1b6e39=_[_0x5015('0x31')](_0xbaad88,'id');var _0xac5246=[];var _0x4749ea=[];var _0x24bf4a=squel['select']();_0x24bf4a['field']('tq.TeamId')[_0x5015('0x72')](_0x5015('0x73'),'tq')[_0x5015('0x74')](_0x5015('0x75'),'ut',_0x5015('0x76'))[_0x5015('0x40')]('MailQueueId\x20=\x20?',_0x490b6b[_0x5015('0x46')]['id']);for(var _0x5b610c=0x0;_0x5b610c<_0xbaad88['length'];_0x5b610c+=0x1){let _0x352129=_0xbaad88[_0x5b610c];for(var _0x3e73a6=0x0;_0x3e73a6<_0x352129[_0x5015('0x66')][_0x5015('0x3c')];_0x3e73a6+=0x1){let _0x8f5422=_0x352129[_0x5015('0x66')][_0x3e73a6];var _0x294ebc=_0x24bf4a[_0x5015('0x77')]();_0x294ebc[_0x5015('0x40')](_0x5015('0x78'),_0x8f5422['id']);_0x4749ea[_0x5015('0x79')](db['sequelize'][_0x5015('0x37')](_0x294ebc[_0x5015('0x7a')](),{'type':db['sequelize']['QueryTypes'][_0x5015('0x7b')]})[_0x5015('0x29')](function(_0x1caa03){if(_0x1caa03[_0x5015('0x3c')]===0x1){return _0x8f5422['id'];}else{var _0x38a8c1=_[_0x5015('0x7c')](_['map'](_0x1caa03,_0x5015('0x7d')),function(_0x57a026){return _['includes'](_0x1b6e39,_0x57a026);});if(_0x38a8c1){return _0x8f5422['id'];}}}));}}return BPromise['all'](_0x4749ea)['then'](function(_0x1d25ac){_0xac5246=_(_0xac5246)[_0x5015('0x7e')](_0x1d25ac)['compact']()[_0x5015('0x7f')]();return db[_0x5015('0x32')][_0x5015('0x4a')]({'where':{'id':_0x490b6b[_0x5015('0x46')]['id']}})[_0x5015('0x29')](function(_0xc0fcd2){return db[_0x5015('0x6a')][_0x5015('0x6b')](function(_0x81661e){return _0xc0fcd2[_0x5015('0x71')](_0x490b6b[_0x5015('0x37')][_0x5015('0x64')],{'transaction':_0x81661e})[_0x5015('0x29')](function(){if(!_[_0x5015('0x80')](_0xac5246)){return _0xc0fcd2[_0x5015('0x81')](_0xac5246,{'transaction':_0x81661e});}})[_0x5015('0x29')](function(){_0xac5246[_0x5015('0x6e')](function(_0x56c3d3){socket[_0x5015('0x6f')]('userMailQueue:remove',{'UserId':_0x56c3d3,'MailQueueId':_0xc0fcd2['id']});});});});});});})[_0x5015('0x29')](respondWithStatusCode(_0x2ef038,null))['catch'](handleError(_0x2ef038,null));};exports[_0x5015('0x82')]=function(_0x149d34,_0xdfa8a3,_0x41aedc){return db[_0x5015('0x32')]['find']({'where':{'id':_0x149d34[_0x5015('0x46')]['id']}})[_0x5015('0x29')](handleEntityNotFound(_0xdfa8a3,null))[_0x5015('0x29')](function(_0x2fb829){if(_0x2fb829){return _0x2fb829['addAgents'](_0x149d34[_0x5015('0x4d')]['ids'],_[_0x5015('0x83')](_0x149d34[_0x5015('0x4d')],['ids','id'])||{})[_0x5015('0x84')](function(_0x57484d){for(var _0x27ea6e=0x0;_0x27ea6e<_0x149d34[_0x5015('0x4d')][_0x5015('0x64')][_0x5015('0x3c')];_0x27ea6e+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x149d34[_0x5015('0x4d')][_0x5015('0x64')][_0x27ea6e]),'MailQueueId':Number(_0x149d34[_0x5015('0x46')]['id'])});}return _0x57484d;});}})[_0x5015('0x29')](respondWithResult(_0xdfa8a3,null))[_0x5015('0x4b')](handleError(_0xdfa8a3,null));};exports['removeAgents']=function(_0x550a91,_0x215038,_0x4d9a28){return db[_0x5015('0x32')][_0x5015('0x4a')]({'where':{'id':_0x550a91[_0x5015('0x46')]['id']}})['then'](handleEntityNotFound(_0x215038,null))[_0x5015('0x29')](function(_0x4ed513){if(_0x4ed513){return _0x4ed513['removeAgents'](_0x550a91[_0x5015('0x37')][_0x5015('0x64')])[_0x5015('0x29')](function(){if(_[_0x5015('0x85')](_0x550a91[_0x5015('0x37')][_0x5015('0x64')])){for(var _0x110849=0x0;_0x110849<_0x550a91[_0x5015('0x37')][_0x5015('0x64')][_0x5015('0x3c')];_0x110849+=0x1){socket[_0x5015('0x6f')](_0x5015('0x86'),{'UserId':Number(_0x550a91[_0x5015('0x37')][_0x5015('0x64')][_0x110849]),'MailQueueId':Number(_0x550a91[_0x5015('0x46')]['id'])});}}else{socket['emit'](_0x5015('0x86'),{'UserId':Number(_0x550a91[_0x5015('0x37')][_0x5015('0x64')]),'MailQueueId':Number(_0x550a91['params']['id'])});}});}})['then'](respondWithStatusCode(_0x215038,null))[_0x5015('0x4b')](handleError(_0x215038,null));};exports[_0x5015('0x87')]=function(_0x1e87ae,_0x4f712f,_0x4de37c){var _0x490ac0={};var _0xcc50b9={};var _0x594020;var _0x30cdd9;return db['MailQueue'][_0x5015('0x56')]({'where':{'id':_0x1e87ae['params']['id']}})['then'](handleEntityNotFound(_0x4f712f,null))[_0x5015('0x29')](function(_0x58ca87){if(_0x58ca87){_0x594020=_0x58ca87;_0xcc50b9[_0x5015('0x36')]=_[_0x5015('0x38')](db[_0x5015('0x5a')]['rawAttributes']);_0xcc50b9[_0x5015('0x37')]=_[_0x5015('0x38')](_0x1e87ae['query']);_0xcc50b9[_0x5015('0x39')]=_[_0x5015('0x3a')](_0xcc50b9[_0x5015('0x36')],_0xcc50b9[_0x5015('0x37')]);_0x490ac0[_0x5015('0x3b')]=_['intersection'](_0xcc50b9[_0x5015('0x36')],qs[_0x5015('0x47')](_0x1e87ae[_0x5015('0x37')][_0x5015('0x47')]));_0x490ac0[_0x5015('0x3b')]=_0x490ac0[_0x5015('0x3b')][_0x5015('0x3c')]?_0x490ac0['attributes']:_0xcc50b9['model'];_0x490ac0[_0x5015('0x3d')]=qs[_0x5015('0x3e')](_0x1e87ae[_0x5015('0x37')]['sort']);_0x490ac0[_0x5015('0x40')]=qs[_0x5015('0x39')](_[_0x5015('0x88')](_0x1e87ae[_0x5015('0x37')],_0xcc50b9[_0x5015('0x39')]));if(_0x1e87ae[_0x5015('0x37')][_0x5015('0x3f')]){_0x490ac0[_0x5015('0x40')]=_['merge'](_0x490ac0[_0x5015('0x40')],{'$or':_[_0x5015('0x31')](_0x490ac0[_0x5015('0x3b')],function(_0xdedb8b){var _0x1e8049={};_0x1e8049[_0xdedb8b]={'$like':'%'+_0x1e87ae[_0x5015('0x37')]['filter']+'%'};return _0x1e8049;})});}_0x490ac0=_[_0x5015('0x41')]({},_0x490ac0,_0x1e87ae['options']);return _0x594020[_0x5015('0x87')](_0x490ac0);}})['then'](function(_0x63916e){if(_0x63916e){_0x30cdd9=_0x63916e[_0x5015('0x3c')];if(!_0x1e87ae[_0x5015('0x37')][_0x5015('0x58')](_0x5015('0x59'))){_0x490ac0[_0x5015('0x24')]=qs[_0x5015('0x24')](_0x1e87ae[_0x5015('0x37')][_0x5015('0x24')]);_0x490ac0[_0x5015('0x22')]=qs['offset'](_0x1e87ae[_0x5015('0x37')][_0x5015('0x22')]);}return _0x594020[_0x5015('0x87')](_0x490ac0);}})['then'](function(_0x4eb5e5){if(_0x4eb5e5){return _0x4eb5e5?{'count':_0x30cdd9,'rows':_0x4eb5e5}:null;}})[_0x5015('0x29')](respondWithResult(_0x4f712f,null))['catch'](handleError(_0x4f712f,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 4b91072..c684dcf 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 _0xf712=['hook','exports','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xf712,0x112));var _0x2f71=function(_0x5c900d,_0x4b044c){_0x5c900d=_0x5c900d-0x0;var _0x49e83e=_0xf712[_0x5c900d];return _0x49e83e;};'use strict';var EventEmitter=require(_0x2f71('0x0'));var MailQueue=require(_0x2f71('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2f71('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2f71('0x3')};function emitEvent(_0x3d0884){return function(_0x40f49f,_0x2a9fab,_0x365bd4){MailQueueEvents['emit'](_0x3d0884+':'+_0x40f49f['id'],_0x40f49f);MailQueueEvents[_0x2f71('0x4')](_0x3d0884,_0x40f49f);_0x365bd4(null);};}for(var e in events){if(events[_0x2f71('0x5')](e)){var event=events[e];MailQueue[_0x2f71('0x6')](e,emitEvent(event));}}module[_0x2f71('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xb8e0=['MailQueue','save','update','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0xc0b7f7,_0x3eb5e5){var _0x48ab14=function(_0x51d6a0){while(--_0x51d6a0){_0xc0b7f7['push'](_0xc0b7f7['shift']());}};_0x48ab14(++_0x3eb5e5);}(_0xb8e0,0xfb));var _0x0b8e=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0xb8e0[_0x364a36];return _0x5cd6fa;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x0b8e('0x0'))['db'][_0x0b8e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b8e('0x2'),'afterUpdate':_0x0b8e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x462c9f){return function(_0xca9cc,_0x3f2c9f,_0x2491b3){MailQueueEvents[_0x0b8e('0x4')](_0x462c9f+':'+_0xca9cc['id'],_0xca9cc);MailQueueEvents[_0x0b8e('0x4')](_0x462c9f,_0xca9cc);_0x2491b3(null);};}for(var e in events){if(events[_0x0b8e('0x5')](e)){var event=events[e];MailQueue[_0x0b8e('0x6')](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 d74f37b..9d65971 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 _0x2424=['../../config/environment','exports','define','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ea881,_0x45966e){var _0x27ef49=function(_0x1eea69){while(--_0x1eea69){_0x5ea881['push'](_0x5ea881['shift']());}};_0x27ef49(++_0x45966e);}(_0x2424,0xba));var _0x4242=function(_0x270c35,_0x55496e){_0x270c35=_0x270c35-0x0;var _0xd9024a=_0x2424[_0x270c35];return _0xd9024a;};'use strict';var _=require(_0x4242('0x0'));var util=require(_0x4242('0x1'));var logger=require(_0x4242('0x2'))(_0x4242('0x3'));var moment=require(_0x4242('0x4'));var BPromise=require(_0x4242('0x5'));var rp=require(_0x4242('0x6'));var fs=require('fs');var path=require(_0x4242('0x7'));var rimraf=require(_0x4242('0x8'));var config=require(_0x4242('0x9'));var attributes=require('./mailQueue.attributes');module[_0x4242('0xa')]=function(_0x134917,_0x1bbf5e){return _0x134917[_0x4242('0xb')]('MailQueue',attributes,{'tableName':_0x4242('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb1f=['exports','define','mail_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailQueue.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb1f,0xd4));var _0xfcb1=function(_0x2cd8ba,_0x3fda81){_0x2cd8ba=_0x2cd8ba-0x0;var _0x1171bc=_0xcb1f[_0x2cd8ba];return _0x1171bc;};'use strict';var _=require('lodash');var util=require(_0xfcb1('0x0'));var logger=require(_0xfcb1('0x1'))(_0xfcb1('0x2'));var moment=require('moment');var BPromise=require(_0xfcb1('0x3'));var rp=require(_0xfcb1('0x4'));var fs=require('fs');var path=require(_0xfcb1('0x5'));var rimraf=require(_0xfcb1('0x6'));var config=require('../../config/environment');var attributes=require(_0xfcb1('0x7'));module[_0xfcb1('0x8')]=function(_0x4aa9c5,_0x55590d){return _0x4aa9c5[_0xfcb1('0x9')]('MailQueue',attributes,{'tableName':_0xfcb1('0xa'),'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 def6c0f..3e674bd 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 _0x9064=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','limit','include','map','model','attributes','ShowMailQueue','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s'];(function(_0x55ecba,_0x3a94e1){var _0xfb6474=function(_0x5a690b){while(--_0x5a690b){_0x55ecba['push'](_0x55ecba['shift']());}};_0xfb6474(++_0x3a94e1);}(_0x9064,0x1e4));var _0x4906=function(_0x42c81a,_0x5ad5d6){_0x42c81a=_0x42c81a-0x0;var _0x5624a=_0x9064[_0x42c81a];return _0x5624a;};'use strict';var _=require(_0x4906('0x0'));var util=require(_0x4906('0x1'));var moment=require(_0x4906('0x2'));var BPromise=require(_0x4906('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4906('0x4'));var db=require(_0x4906('0x5'))['db'];var utils=require(_0x4906('0x6'));var logger=require(_0x4906('0x7'))(_0x4906('0x8'));var config=require(_0x4906('0x9'));var jayson=require(_0x4906('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4906('0xb')](config[_0x4906('0xc')],{'host':_0x4906('0xd'),'port':0x18eb});var socket=require(_0x4906('0xe'))(new Redis(config[_0x4906('0xc')]));require(_0x4906('0xf'))[_0x4906('0x10')](socket);function respondWithRpcPromise(_0x89d83,_0x63920c,_0x50f944){return new BPromise(function(_0x65e2b9,_0x1ce9d1){return client['request'](_0x89d83,_0x50f944)[_0x4906('0x11')](function(_0x325fa1){logger[_0x4906('0x12')](_0x4906('0x13'),_0x63920c,_0x4906('0x14'));logger[_0x4906('0x15')](_0x4906('0x16'),_0x63920c,_0x4906('0x14'),JSON[_0x4906('0x17')](_0x325fa1));if(_0x325fa1[_0x4906('0x18')]){if(_0x325fa1[_0x4906('0x18')][_0x4906('0x19')]===0x1f4){logger['error'](_0x4906('0x13'),_0x63920c,_0x325fa1['error'][_0x4906('0x1a')]);return _0x1ce9d1(_0x325fa1[_0x4906('0x18')][_0x4906('0x1a')]);}logger[_0x4906('0x18')](_0x4906('0x13'),_0x63920c,_0x325fa1[_0x4906('0x18')]['message']);return _0x65e2b9(_0x325fa1[_0x4906('0x18')]['message']);}else{logger['info'](_0x4906('0x13'),_0x63920c,_0x4906('0x14'));_0x65e2b9(_0x325fa1[_0x4906('0x1b')][_0x4906('0x1a')]);}})[_0x4906('0x1c')](function(_0x454ea3){logger['error'](_0x4906('0x13'),_0x63920c,_0x454ea3);_0x1ce9d1(_0x454ea3);});});}exports[_0x4906('0x1d')]=function(_0x37c718){var _0x59fe53=this;return new Promise(function(_0x5d1c08,_0x56431d){return db[_0x4906('0x1e')][_0x4906('0x1f')]({'raw':_0x37c718[_0x4906('0x20')]?_0x37c718[_0x4906('0x20')][_0x4906('0x21')]===undefined?!![]:![]:!![],'where':_0x37c718[_0x4906('0x20')]?_0x37c718[_0x4906('0x20')]['where']||null:null,'attributes':_0x37c718['options']?_0x37c718[_0x4906('0x20')]['attributes']||null:null,'limit':_0x37c718[_0x4906('0x20')]?_0x37c718['options'][_0x4906('0x22')]||null:null,'include':_0x37c718[_0x4906('0x20')]?_0x37c718['options'][_0x4906('0x23')]?_[_0x4906('0x24')](_0x37c718[_0x4906('0x20')]['include'],function(_0x97e433){return{'model':db[_0x97e433[_0x4906('0x25')]],'as':_0x97e433['as'],'attributes':_0x97e433['attributes'],'include':_0x97e433['include']?_[_0x4906('0x24')](_0x97e433[_0x4906('0x23')],function(_0x41b966){return{'model':db[_0x41b966['model']],'as':_0x41b966['as'],'attributes':_0x41b966[_0x4906('0x26')],'include':_0x41b966[_0x4906('0x23')]?_[_0x4906('0x24')](_0x41b966[_0x4906('0x23')],function(_0xce5234){return{'model':db[_0xce5234[_0x4906('0x25')]],'as':_0xce5234['as'],'attributes':_0xce5234['attributes']};}):[]};}):[]};}):[]:[]})[_0x4906('0x11')](function(_0x4c1d01){logger[_0x4906('0x12')](_0x4906('0x1d'),_0x37c718);logger[_0x4906('0x15')]('GetMailQueue',_0x37c718,JSON[_0x4906('0x17')](_0x4c1d01));_0x5d1c08(_0x4c1d01);})[_0x4906('0x1c')](function(_0xabc67a){logger[_0x4906('0x18')](_0x4906('0x1d'),_0xabc67a[_0x4906('0x1a')],_0x37c718);_0x56431d(_0x59fe53[_0x4906('0x18')](0x1f4,_0xabc67a['message']));});});};exports[_0x4906('0x27')]=function(_0x359606){var _0xfbf0f8=this;return new Promise(function(_0x5d1c80,_0x310188){return db[_0x4906('0x1e')][_0x4906('0x28')]({'raw':_0x359606['options']?_0x359606[_0x4906('0x20')][_0x4906('0x21')]===undefined?!![]:![]:!![],'where':_0x359606[_0x4906('0x20')]?_0x359606[_0x4906('0x20')][_0x4906('0x29')]||null:null,'attributes':_0x359606['options']?_0x359606[_0x4906('0x20')][_0x4906('0x26')]||null:null,'include':_0x359606['options']?_0x359606[_0x4906('0x20')][_0x4906('0x23')]?_[_0x4906('0x24')](_0x359606['options'][_0x4906('0x23')],function(_0xb6ba3c){return{'model':db[_0xb6ba3c[_0x4906('0x25')]],'as':_0xb6ba3c['as'],'attributes':_0xb6ba3c['attributes'],'include':_0xb6ba3c[_0x4906('0x23')]?_['map'](_0xb6ba3c['include'],function(_0x11dd15){return{'model':db[_0x11dd15[_0x4906('0x25')]],'as':_0x11dd15['as'],'attributes':_0x11dd15[_0x4906('0x26')],'include':_0x11dd15[_0x4906('0x23')]?_[_0x4906('0x24')](_0x11dd15['include'],function(_0x9ab103){return{'model':db[_0x9ab103[_0x4906('0x25')]],'as':_0x9ab103['as'],'attributes':_0x9ab103[_0x4906('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x589741){logger[_0x4906('0x12')](_0x4906('0x27'),_0x359606);logger['debug']('ShowMailQueue',_0x359606,JSON[_0x4906('0x17')](_0x589741));_0x5d1c80(_0x589741);})[_0x4906('0x1c')](function(_0x5d4699){logger[_0x4906('0x18')](_0x4906('0x27'),_0x5d4699[_0x4906('0x1a')],_0x359606);_0x310188(_0xfbf0f8[_0x4906('0x18')](0x1f4,_0x5d4699['message']));});});}; \ No newline at end of file +var _0x09dd=['then','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetMailQueue','findAll','options','raw','limit','include','map','model','attributes'];(function(_0x29abce,_0x5608ed){var _0x545c2c=function(_0x3f5a8f){while(--_0x3f5a8f){_0x29abce['push'](_0x29abce['shift']());}};_0x545c2c(++_0x5608ed);}(_0x09dd,0x81));var _0xd09d=function(_0x5e4a61,_0x403c59){_0x5e4a61=_0x5e4a61-0x0;var _0x1374aa=_0x09dd[_0x5e4a61];return _0x1374aa;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var moment=require(_0xd09d('0x2'));var BPromise=require(_0xd09d('0x3'));var rs=require(_0xd09d('0x4'));var fs=require('fs');var Redis=require(_0xd09d('0x5'));var db=require(_0xd09d('0x6'))['db'];var utils=require(_0xd09d('0x7'));var logger=require(_0xd09d('0x8'))(_0xd09d('0x9'));var config=require(_0xd09d('0xa'));var jayson=require(_0xd09d('0xb'));var client=jayson[_0xd09d('0xc')][_0xd09d('0xd')]({'port':0x232a});config['redis']=_[_0xd09d('0xe')](config[_0xd09d('0xf')],{'host':_0xd09d('0x10'),'port':0x18eb});var socket=require(_0xd09d('0x11'))(new Redis(config[_0xd09d('0xf')]));require(_0xd09d('0x12'))[_0xd09d('0x13')](socket);function respondWithRpcPromise(_0x47d9d8,_0x442411,_0x235b0d){return new BPromise(function(_0x22572f,_0x1f217a){return client[_0xd09d('0x14')](_0x47d9d8,_0x235b0d)['then'](function(_0x218411){logger[_0xd09d('0x15')](_0xd09d('0x16'),_0x442411,_0xd09d('0x17'));logger[_0xd09d('0x18')](_0xd09d('0x19'),_0x442411,_0xd09d('0x17'),JSON['stringify'](_0x218411));if(_0x218411[_0xd09d('0x1a')]){if(_0x218411['error']['code']===0x1f4){logger['error'](_0xd09d('0x16'),_0x442411,_0x218411[_0xd09d('0x1a')][_0xd09d('0x1b')]);return _0x1f217a(_0x218411[_0xd09d('0x1a')][_0xd09d('0x1b')]);}logger['error'](_0xd09d('0x16'),_0x442411,_0x218411[_0xd09d('0x1a')]['message']);return _0x22572f(_0x218411[_0xd09d('0x1a')]['message']);}else{logger[_0xd09d('0x15')](_0xd09d('0x16'),_0x442411,'request\x20sent');_0x22572f(_0x218411[_0xd09d('0x1c')][_0xd09d('0x1b')]);}})[_0xd09d('0x1d')](function(_0x2e82c1){logger['error'](_0xd09d('0x16'),_0x442411,_0x2e82c1);_0x1f217a(_0x2e82c1);});});}exports[_0xd09d('0x1e')]=function(_0x2b9c07){var _0x2cbc0c=this;return new Promise(function(_0x5d6f5d,_0x497858){return db['MailQueue'][_0xd09d('0x1f')]({'raw':_0x2b9c07[_0xd09d('0x20')]?_0x2b9c07['options'][_0xd09d('0x21')]===undefined?!![]:![]:!![],'where':_0x2b9c07['options']?_0x2b9c07['options']['where']||null:null,'attributes':_0x2b9c07[_0xd09d('0x20')]?_0x2b9c07[_0xd09d('0x20')]['attributes']||null:null,'limit':_0x2b9c07['options']?_0x2b9c07[_0xd09d('0x20')][_0xd09d('0x22')]||null:null,'include':_0x2b9c07[_0xd09d('0x20')]?_0x2b9c07[_0xd09d('0x20')][_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x2b9c07['options'][_0xd09d('0x23')],function(_0x498995){return{'model':db[_0x498995[_0xd09d('0x25')]],'as':_0x498995['as'],'attributes':_0x498995[_0xd09d('0x26')],'include':_0x498995[_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x498995[_0xd09d('0x23')],function(_0x37ead9){return{'model':db[_0x37ead9[_0xd09d('0x25')]],'as':_0x37ead9['as'],'attributes':_0x37ead9[_0xd09d('0x26')],'include':_0x37ead9[_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x37ead9[_0xd09d('0x23')],function(_0x3dfa3a){return{'model':db[_0x3dfa3a['model']],'as':_0x3dfa3a['as'],'attributes':_0x3dfa3a[_0xd09d('0x26')]};}):[]};}):[]};}):[]:[]})[_0xd09d('0x27')](function(_0x1ff591){logger[_0xd09d('0x15')](_0xd09d('0x1e'),_0x2b9c07);logger[_0xd09d('0x18')](_0xd09d('0x1e'),_0x2b9c07,JSON['stringify'](_0x1ff591));_0x5d6f5d(_0x1ff591);})[_0xd09d('0x1d')](function(_0x3f6ee9){logger['error']('GetMailQueue',_0x3f6ee9[_0xd09d('0x1b')],_0x2b9c07);_0x497858(_0x2cbc0c[_0xd09d('0x1a')](0x1f4,_0x3f6ee9[_0xd09d('0x1b')]));});});};exports[_0xd09d('0x28')]=function(_0x3ce1e){var _0x3538f2=this;return new Promise(function(_0x3d05de,_0x493536){return db['MailQueue'][_0xd09d('0x29')]({'raw':_0x3ce1e[_0xd09d('0x20')]?_0x3ce1e[_0xd09d('0x20')][_0xd09d('0x21')]===undefined?!![]:![]:!![],'where':_0x3ce1e[_0xd09d('0x20')]?_0x3ce1e['options']['where']||null:null,'attributes':_0x3ce1e['options']?_0x3ce1e[_0xd09d('0x20')]['attributes']||null:null,'include':_0x3ce1e['options']?_0x3ce1e[_0xd09d('0x20')][_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x3ce1e[_0xd09d('0x20')][_0xd09d('0x23')],function(_0x3d7543){return{'model':db[_0x3d7543['model']],'as':_0x3d7543['as'],'attributes':_0x3d7543[_0xd09d('0x26')],'include':_0x3d7543[_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x3d7543[_0xd09d('0x23')],function(_0x4d4e41){return{'model':db[_0x4d4e41[_0xd09d('0x25')]],'as':_0x4d4e41['as'],'attributes':_0x4d4e41[_0xd09d('0x26')],'include':_0x4d4e41[_0xd09d('0x23')]?_[_0xd09d('0x24')](_0x4d4e41[_0xd09d('0x23')],function(_0x15bbd5){return{'model':db[_0x15bbd5[_0xd09d('0x25')]],'as':_0x15bbd5['as'],'attributes':_0x15bbd5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd09d('0x27')](function(_0x33b505){logger[_0xd09d('0x15')](_0xd09d('0x28'),_0x3ce1e);logger[_0xd09d('0x18')]('ShowMailQueue',_0x3ce1e,JSON['stringify'](_0x33b505));_0x3d05de(_0x33b505);})[_0xd09d('0x1d')](function(_0x26d129){logger[_0xd09d('0x1a')](_0xd09d('0x28'),_0x26d129[_0xd09d('0x1b')],_0x3ce1e);_0x493536(_0x3538f2['error'](0x1f4,_0x26d129['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bcbf543..d3ccf50 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 _0xb846=['update','removeListener','register','mailQueue:','./mailQueue.events'];(function(_0x5a73bb,_0x3dd746){var _0x1b5818=function(_0x28bcc8){while(--_0x28bcc8){_0x5a73bb['push'](_0x5a73bb['shift']());}};_0x1b5818(++_0x3dd746);}(_0xb846,0x1d0));var _0x6b84=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb846[_0x122096];return _0x3d1966;};'use strict';var MailQueueEvents=require(_0x6b84('0x0'));var events=['save','remove',_0x6b84('0x1')];function createListener(_0x15847c,_0x374675){return function(_0x45ac0f){_0x374675['emit'](_0x15847c,_0x45ac0f);};}function removeListener(_0x53514b,_0xa68b33){return function(){MailQueueEvents[_0x6b84('0x2')](_0x53514b,_0xa68b33);};}exports[_0x6b84('0x3')]=function(_0x3448d0){for(var _0x31856c=0x0,_0x534d8e=events['length'];_0x31856c<_0x534d8e;_0x31856c++){var _0x1482bd=events[_0x31856c];var _0x5706dc=createListener(_0x6b84('0x4')+_0x1482bd,_0x3448d0);MailQueueEvents['on'](_0x1482bd,_0x5706dc);}}; \ No newline at end of file +var _0x4443=['mailQueue:','./mailQueue.events','remove','update','removeListener','register','length'];(function(_0xcaab23,_0x2796ea){var _0x585318=function(_0xa12397){while(--_0xa12397){_0xcaab23['push'](_0xcaab23['shift']());}};_0x585318(++_0x2796ea);}(_0x4443,0x71));var _0x3444=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4443[_0x8c43de];return _0xa6591b;};'use strict';var MailQueueEvents=require(_0x3444('0x0'));var events=['save',_0x3444('0x1'),_0x3444('0x2')];function createListener(_0x685140,_0x1cda68){return function(_0x3cfb39){_0x1cda68['emit'](_0x685140,_0x3cfb39);};}function removeListener(_0x409342,_0x36fd15){return function(){MailQueueEvents[_0x3444('0x3')](_0x409342,_0x36fd15);};}exports[_0x3444('0x4')]=function(_0x14077e){for(var _0x27cde9=0x0,_0x2b86a1=events[_0x3444('0x5')];_0x27cde9<_0x2b86a1;_0x27cde9++){var _0x5c699b=events[_0x27cde9];var _0x43735a=createListener(_0x3444('0x6')+_0x5c699b,_0x14077e);MailQueueEvents['on'](_0x5c699b,_0x43735a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b7de558..8d7b5e3 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 _0xac94=['post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','./mailQueueReport.controller','isAuthenticated','get','/describe','/:id','show'];(function(_0x429394,_0x36c93c){var _0x85a4cc=function(_0x4dd69b){while(--_0x4dd69b){_0x429394['push'](_0x429394['shift']());}};_0x85a4cc(++_0x36c93c);}(_0xac94,0xcd));var _0x4ac9=function(_0x22f7d4,_0xeabfbe){_0x22f7d4=_0x22f7d4-0x0;var _0xda08b0=_0xac94[_0x22f7d4];return _0xda08b0;};'use strict';var multer=require('multer');var util=require(_0x4ac9('0x0'));var path=require('path');var timeout=require(_0x4ac9('0x1'));var express=require('express');var router=express[_0x4ac9('0x2')]();var fs_extra=require(_0x4ac9('0x3'));var auth=require(_0x4ac9('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ac9('0x5'));router['get']('/',auth[_0x4ac9('0x6')](),controller['index']);router[_0x4ac9('0x7')](_0x4ac9('0x8'),auth[_0x4ac9('0x6')](),controller['describe']);router['get'](_0x4ac9('0x9'),auth[_0x4ac9('0x6')](),controller[_0x4ac9('0xa')]);router[_0x4ac9('0xb')]('/',auth[_0x4ac9('0x6')](),controller[_0x4ac9('0xc')]);router[_0x4ac9('0xd')]('/:id',auth[_0x4ac9('0x6')](),controller[_0x4ac9('0xe')]);router[_0x4ac9('0xf')](_0x4ac9('0x9'),auth[_0x4ac9('0x6')](),controller[_0x4ac9('0x10')]);module[_0x4ac9('0x11')]=router; \ No newline at end of file +var _0xc7f6=['describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','path','express','../../components/interaction/service','../../config/environment','index','get','/describe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc7f6,0x160));var _0x6c7f=function(_0x119ef5,_0x2dbaca){_0x119ef5=_0x119ef5-0x0;var _0x3bc985=_0xc7f6[_0x119ef5];return _0x3bc985;};'use strict';var multer=require(_0x6c7f('0x0'));var util=require('util');var path=require(_0x6c7f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c7f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6c7f('0x3'));var config=require(_0x6c7f('0x4'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6c7f('0x5')]);router[_0x6c7f('0x6')](_0x6c7f('0x7'),auth['isAuthenticated'](),controller[_0x6c7f('0x8')]);router[_0x6c7f('0x6')](_0x6c7f('0x9'),auth[_0x6c7f('0xa')](),controller['show']);router[_0x6c7f('0xb')]('/',auth[_0x6c7f('0xa')](),controller[_0x6c7f('0xc')]);router[_0x6c7f('0xd')]('/:id',auth[_0x6c7f('0xa')](),controller[_0x6c7f('0xe')]);router[_0x6c7f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6c7f('0x10')]);module[_0x6c7f('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index cdcba8b..78a6ae6 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 _0x8bb3=['moment','sequelize','exports','STRING','DATE'];(function(_0x592b42,_0x41dbe6){var _0x17667e=function(_0x3dfe13){while(--_0x3dfe13){_0x592b42['push'](_0x592b42['shift']());}};_0x17667e(++_0x41dbe6);}(_0x8bb3,0xf0));var _0x38bb=function(_0x2068d6,_0x1e6334){_0x2068d6=_0x2068d6-0x0;var _0x4887cf=_0x8bb3[_0x2068d6];return _0x4887cf;};'use strict';var moment=require(_0x38bb('0x0'));var Sequelize=require(_0x38bb('0x1'));module[_0x38bb('0x2')]={'uniqueid':{'type':Sequelize[_0x38bb('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x38bb('0x3')]},'joinAt':{'type':Sequelize[_0x38bb('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x38bb('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x38bb('0x3')]}}; \ No newline at end of file +var _0xf890=['exports','STRING','DATE','moment','sequelize'];(function(_0x3d0e15,_0xdb46ae){var _0x4723bc=function(_0x5a02d4){while(--_0x5a02d4){_0x3d0e15['push'](_0x3d0e15['shift']());}};_0x4723bc(++_0xdb46ae);}(_0xf890,0xa3));var _0x0f89=function(_0x4f49bf,_0x6d06a9){_0x4f49bf=_0x4f49bf-0x0;var _0x240456=_0xf890[_0x4f49bf];return _0x240456;};'use strict';var moment=require(_0x0f89('0x0'));var Sequelize=require(_0x0f89('0x1'));module[_0x0f89('0x2')]={'uniqueid':{'type':Sequelize[_0x0f89('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0f89('0x3')]},'joinAt':{'type':Sequelize[_0x0f89('0x4')]},'leaveAt':{'type':Sequelize[_0x0f89('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0f89('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 332c244..9b5a72c 100644 --- a/server/api/mailQueueReport/mailQueueReport.controller.js +++ b/server/api/mailQueueReport/mailQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['update','then','destroy','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','rows','catch','length','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x3737ae,_0xc15228){var _0x6f3379=function(_0x2c2032){while(--_0x2c2032){_0x3737ae['push'](_0x3737ae['shift']());}};_0x6f3379(++_0xc15228);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2936dc,_0x36fd02){_0x2936dc=_0x2936dc-0x0;var _0x403633=_0xd7d1[_0x2936dc];return _0x403633;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var licenseUtil=require(_0x1d7d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11b83f,_0x5ae1c9){_0x5ae1c9=_0x5ae1c9||0xcc;return function(_0x577e07){if(_0x577e07){return _0x11b83f[_0x1d7d('0x1c')](_0x5ae1c9);}return _0x11b83f[_0x1d7d('0x1d')](_0x5ae1c9)['end']();};}function respondWithResult(_0x55dba7,_0x1d3822){_0x1d3822=_0x1d3822||0xc8;return function(_0x334e78){if(_0x334e78){return _0x55dba7[_0x1d7d('0x1d')](_0x1d3822)[_0x1d7d('0x1e')](_0x334e78);}};}function respondWithFilteredResult(_0xeb05b3,_0x53423f){return function(_0x28adf3){if(_0x28adf3){var _0x1de6cc=typeof _0x53423f['offset']===_0x1d7d('0x1f')&&typeof _0x53423f[_0x1d7d('0x20')]===_0x1d7d('0x1f');var _0x47826a=_0x28adf3[_0x1d7d('0x21')];var _0x4db4f2=_0x1de6cc?0x0:_0x53423f[_0x1d7d('0x22')];var _0x191024=_0x1de6cc?_0x28adf3['count']:_0x53423f['offset']+_0x53423f[_0x1d7d('0x20')];var _0x1a5101;if(_0x191024>=_0x47826a){_0x191024=_0x47826a;_0x1a5101=0xc8;}else{_0x1a5101=0xce;}_0xeb05b3[_0x1d7d('0x1d')](_0x1a5101);return _0xeb05b3[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x4db4f2+'-'+_0x191024+'/'+_0x47826a)[_0x1d7d('0x1e')](_0x28adf3);}return null;};}function patchUpdates(_0x54d401){return function(_0x225f85){try{jsonpatch[_0x1d7d('0x25')](_0x225f85,_0x54d401,!![]);}catch(_0x3a93d0){return BPromise['reject'](_0x3a93d0);}return _0x225f85[_0x1d7d('0x26')]();};}function saveUpdates(_0x12c54b,_0x4a1cdc){return function(_0x5950bd){if(_0x5950bd){return _0x5950bd[_0x1d7d('0x27')](_0x12c54b)[_0x1d7d('0x28')](function(_0x3d631f){return _0x3d631f;});}return null;};}function removeEntity(_0x5097b8,_0x377653){return function(_0x106376){if(_0x106376){return _0x106376[_0x1d7d('0x29')]()[_0x1d7d('0x28')](function(){_0x5097b8['status'](0xcc)[_0x1d7d('0x2a')]();});}};}function handleEntityNotFound(_0x151198,_0x5c8257){return function(_0x57bbd8){if(!_0x57bbd8){_0x151198[_0x1d7d('0x1c')](0x194);}return _0x57bbd8;};}function handleError(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0x1f4;return function(_0x2d4de4){logger[_0x1d7d('0x2b')](_0x2d4de4[_0x1d7d('0x2c')]);if(_0x2d4de4[_0x1d7d('0x2d')]){delete _0x2d4de4['name'];}_0x52c618[_0x1d7d('0x1d')](_0x38c323)[_0x1d7d('0x2e')](_0x2d4de4);};}exports[_0x1d7d('0x2f')]=function(_0x58672c,_0x78adbe){var _0x1a935a={},_0x23ad85={},_0x482367={'count':0x0,'rows':[]};var _0x5aeb1f=_['map'](db[_0x1d7d('0x30')][_0x1d7d('0x31')],function(_0x559f19){return{'name':_0x559f19[_0x1d7d('0x32')],'type':_0x559f19[_0x1d7d('0x33')][_0x1d7d('0x34')]};});_0x23ad85[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x5aeb1f,_0x1d7d('0x2d'));_0x23ad85[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x58672c[_0x1d7d('0x37')]);_0x23ad85[_0x1d7d('0x39')]=_['intersection'](_0x23ad85['model'],_0x23ad85[_0x1d7d('0x37')]);_0x1a935a[_0x1d7d('0x3a')]=_[_0x1d7d('0x3b')](_0x23ad85[_0x1d7d('0x35')],qs[_0x1d7d('0x3c')](_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3c')]));_0x1a935a[_0x1d7d('0x3a')]=_0x1a935a[_0x1d7d('0x3a')]['length']?_0x1a935a[_0x1d7d('0x3a')]:_0x23ad85[_0x1d7d('0x35')];if(!_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3d')]('nolimit')){_0x1a935a['limit']=qs[_0x1d7d('0x20')](_0x58672c[_0x1d7d('0x37')]['limit']);_0x1a935a[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x58672c['query']['offset']);}_0x1a935a[_0x1d7d('0x3e')]=qs[_0x1d7d('0x3f')](_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x3f')]);_0x1a935a[_0x1d7d('0x40')]=qs[_0x1d7d('0x39')](_[_0x1d7d('0x41')](_0x58672c[_0x1d7d('0x37')],_0x23ad85[_0x1d7d('0x39')]),_0x5aeb1f);if(_0x58672c[_0x1d7d('0x37')]['filter']){_0x1a935a['where']=_['merge'](_0x1a935a['where'],{'$or':_[_0x1d7d('0x36')](_0x5aeb1f,function(_0x5e7e8b){if(_0x5e7e8b[_0x1d7d('0x33')]!==_0x1d7d('0x42')){var _0x3d7c65={};_0x3d7c65[_0x5e7e8b['name']]={'$like':'%'+_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x43')]+'%'};return _0x3d7c65;}})});}_0x1a935a=_[_0x1d7d('0x44')]({},_0x1a935a,_0x58672c['options']);var _0x1a6a8c={'where':_0x1a935a[_0x1d7d('0x40')]};return db[_0x1d7d('0x30')][_0x1d7d('0x21')](_0x1a6a8c)['then'](function(_0x1db8e8){_0x482367[_0x1d7d('0x21')]=_0x1db8e8;if(_0x58672c[_0x1d7d('0x37')][_0x1d7d('0x45')]){_0x1a935a['include']=[{'all':!![]}];}return db[_0x1d7d('0x30')]['findAll'](_0x1a935a);})[_0x1d7d('0x28')](function(_0x31b850){_0x482367[_0x1d7d('0x46')]=_0x31b850;return _0x482367;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x78adbe,_0x1a935a))[_0x1d7d('0x47')](handleError(_0x78adbe,null));};exports['show']=function(_0x59b8e7,_0x33582a){var _0xe57fa5={'raw':!![],'where':{'id':_0x59b8e7['params']['id']}},_0x1637fc={};_0x1637fc['model']=_[_0x1d7d('0x38')](db['MailQueueReport'][_0x1d7d('0x31')]);_0x1637fc[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x59b8e7[_0x1d7d('0x37')]);_0x1637fc[_0x1d7d('0x39')]=_[_0x1d7d('0x3b')](_0x1637fc[_0x1d7d('0x35')],_0x1637fc['query']);_0xe57fa5[_0x1d7d('0x3a')]=_[_0x1d7d('0x3b')](_0x1637fc['model'],qs[_0x1d7d('0x3c')](_0x59b8e7[_0x1d7d('0x37')][_0x1d7d('0x3c')]));_0xe57fa5[_0x1d7d('0x3a')]=_0xe57fa5[_0x1d7d('0x3a')][_0x1d7d('0x48')]?_0xe57fa5[_0x1d7d('0x3a')]:_0x1637fc[_0x1d7d('0x35')];if(_0x59b8e7[_0x1d7d('0x37')][_0x1d7d('0x45')]){_0xe57fa5[_0x1d7d('0x49')]=[{'all':!![]}];}_0xe57fa5=_[_0x1d7d('0x44')]({},_0xe57fa5,_0x59b8e7['options']);return db[_0x1d7d('0x30')]['find'](_0xe57fa5)[_0x1d7d('0x28')](handleEntityNotFound(_0x33582a,null))['then'](respondWithResult(_0x33582a,null))[_0x1d7d('0x47')](handleError(_0x33582a,null));};exports[_0x1d7d('0x4a')]=function(_0x7ebc25,_0xf25490){return db['MailQueueReport'][_0x1d7d('0x4a')](_0x7ebc25['body'],{})['then'](respondWithResult(_0xf25490,0xc9))[_0x1d7d('0x47')](handleError(_0xf25490,null));};exports['update']=function(_0x57e416,_0x3727be){if(_0x57e416[_0x1d7d('0x4b')]['id']){delete _0x57e416['body']['id'];}return db[_0x1d7d('0x30')][_0x1d7d('0x4c')]({'where':{'id':_0x57e416['params']['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3727be,null))[_0x1d7d('0x28')](saveUpdates(_0x57e416[_0x1d7d('0x4b')],null))[_0x1d7d('0x28')](respondWithResult(_0x3727be,null))['catch'](handleError(_0x3727be,null));};exports['destroy']=function(_0x3f73eb,_0x44d38d){return db[_0x1d7d('0x30')][_0x1d7d('0x4c')]({'where':{'id':_0x3f73eb[_0x1d7d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x44d38d,null))[_0x1d7d('0x28')](removeEntity(_0x44d38d,null))[_0x1d7d('0x47')](handleError(_0x44d38d,null));};exports[_0x1d7d('0x4e')]=function(_0x18a2d1,_0x471418){return db[_0x1d7d('0x30')][_0x1d7d('0x4e')]()[_0x1d7d('0x28')](respondWithResult(_0x471418,null))[_0x1d7d('0x47')](handleError(_0x471418,null));}; \ No newline at end of file +var _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','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','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0xc77758,_0x280638){var _0x164f6d=function(_0x41fc59){while(--_0x41fc59){_0xc77758['push'](_0xc77758['shift']());}};_0x164f6d(++_0x280638);}(_0x5b12,0xa3));var _0x25b1=function(_0x186884,_0x117d2c){_0x186884=_0x186884-0x0;var _0x2e48c1=_0x5b12[_0x186884];return _0x2e48c1;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['MailQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index ab3bfeb..9a43009 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 _0x96fc=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x3d632a,_0x48470d){var _0x4ff04a=function(_0x19cb9b){while(--_0x19cb9b){_0x3d632a['push'](_0x3d632a['shift']());}};_0x4ff04a(++_0x48470d);}(_0x96fc,0x1d1));var _0xc96f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x96fc[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xc96f('0x0'));var util=require(_0xc96f('0x1'));var logger=require(_0xc96f('0x2'))(_0xc96f('0x3'));var moment=require(_0xc96f('0x4'));var BPromise=require(_0xc96f('0x5'));var rp=require(_0xc96f('0x6'));var fs=require('fs');var path=require(_0xc96f('0x7'));var rimraf=require(_0xc96f('0x8'));var config=require(_0xc96f('0x9'));var attributes=require(_0xc96f('0xa'));module[_0xc96f('0xb')]=function(_0x3a3737,_0x3ec12e){return _0x3a3737['define'](_0xc96f('0xc'),attributes,{'tableName':_0xc96f('0xd'),'paranoid':![],'indexes':[{'name':_0xc96f('0xe'),'fields':[_0xc96f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ec3=['MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0ec3,0xab));var _0x30ec=function(_0x415f65,_0x3d9a70){_0x415f65=_0x415f65-0x0;var _0x4493a4=_0x0ec3[_0x415f65];return _0x4493a4;};'use strict';var _=require(_0x30ec('0x0'));var util=require(_0x30ec('0x1'));var logger=require(_0x30ec('0x2'))(_0x30ec('0x3'));var moment=require(_0x30ec('0x4'));var BPromise=require('bluebird');var rp=require(_0x30ec('0x5'));var fs=require('fs');var path=require(_0x30ec('0x6'));var rimraf=require(_0x30ec('0x7'));var config=require(_0x30ec('0x8'));var attributes=require(_0x30ec('0x9'));module['exports']=function(_0x629d39,_0x3ab2ea){return _0x629d39[_0x30ec('0xa')](_0x30ec('0xb'),attributes,{'tableName':_0x30ec('0xc'),'paranoid':![],'indexes':[{'name':_0x30ec('0xd'),'fields':[_0x30ec('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3e60a61..28fed38 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 _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x4bdda3,_0x25f960){var _0x3f8722=function(_0x341120){while(--_0x341120){_0x4bdda3['push'](_0x4bdda3['shift']());}};_0x3f8722(++_0x25f960);}(_0x2ef3,0xba));var _0x32ef=function(_0x23433c,_0x1829bc){_0x23433c=_0x23433c-0x0;var _0x1bb63f=_0x2ef3[_0x23433c];return _0x1bb63f;};'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')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('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(_0x59471b,_0x408ce2){var _0x365f41=function(_0x442bb8){while(--_0x442bb8){_0x59471b['push'](_0x59471b['shift']());}};_0x365f41(++_0x408ce2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'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 139fbb4..0f8ed14 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x547488,_0x4d9a05){var _0x3e61bc=function(_0x1a25aa){while(--_0x1a25aa){_0x547488['push'](_0x547488['shift']());}};_0x3e61bc(++_0x4d9a05);}(_0xedd9,0xfc));var _0x9edd=function(_0x5dd1d5,_0x439552){_0x5dd1d5=_0x5dd1d5-0x0;var _0x2bc98b=_0xedd9[_0x5dd1d5];return _0x2bc98b;};'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(_0x31d6ff,_0x1b2e7b){var _0x51aa7c=function(_0x587c54){while(--_0x587c54){_0x31d6ff['push'](_0x31d6ff['shift']());}};_0x51aa7c(++_0x1b2e7b);}(_0xe706,0xa3));var _0x6e70=function(_0x171ac7,_0x339c8d){_0x171ac7=_0x171ac7-0x0;var _0x94478d=_0xe706[_0x171ac7];return _0x94478d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 63f16b2..e78fce9 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 _0x76dc=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x76dc,0x1f2));var _0xc76d=function(_0x570e87,_0x9555a){_0x570e87=_0x570e87-0x0;var _0xc3f75=_0x76dc[_0x570e87];return _0xc3f75;};'use strict';var Sequelize=require(_0xc76d('0x0'));module[_0xc76d('0x1')]={'description':{'type':Sequelize[_0xc76d('0x2')]},'host':{'type':Sequelize[_0xc76d('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xc76d('0x2')]},'password':{'type':Sequelize[_0xc76d('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xc76d('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xc76d('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xc76d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xc76d('0x2')]}}; \ No newline at end of file +var _0x2b65=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2b65,0x131));var _0x52b6=function(_0xf4666e,_0x571140){_0xf4666e=_0xf4666e-0x0;var _0x1853f1=_0x2b65[_0xf4666e];return _0x1853f1;};'use strict';var Sequelize=require(_0x52b6('0x0'));module[_0x52b6('0x1')]={'description':{'type':Sequelize[_0x52b6('0x2')]},'host':{'type':Sequelize[_0x52b6('0x2')]},'authentication':{'type':Sequelize[_0x52b6('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x52b6('0x2')]},'password':{'type':Sequelize[_0x52b6('0x2')]},'port':{'type':Sequelize[_0x52b6('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x52b6('0x2')],'defaultValue':_0x52b6('0x5')},'connTimeout':{'type':Sequelize[_0x52b6('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x52b6('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x52b6('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index eae6190..c454802 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 _0x85f6=['MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0x85f6,0x1e2));var _0x685f=function(_0x2335a9,_0x42b299){_0x2335a9=_0x2335a9-0x0;var _0x1b42e1=_0x85f6[_0x2335a9];return _0x1b42e1;};'use strict';var _=require(_0x685f('0x0'));var util=require(_0x685f('0x1'));var logger=require('../../config/logger')(_0x685f('0x2'));var moment=require(_0x685f('0x3'));var BPromise=require(_0x685f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x685f('0x5'));var rimraf=require(_0x685f('0x6'));var config=require(_0x685f('0x7'));var attributes=require(_0x685f('0x8'));module[_0x685f('0x9')]=function(_0x367aa3,_0x1aa093){return _0x367aa3['define'](_0x685f('0xa'),attributes,{'tableName':_0x685f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3c5=['api','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb3c5,0x1cd));var _0x5b3c=function(_0xd02bb,_0x26e2d0){_0xd02bb=_0xd02bb-0x0;var _0x1cdf23=_0xb3c5[_0xd02bb];return _0x1cdf23;};'use strict';var _=require(_0x5b3c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5b3c('0x1'));var moment=require(_0x5b3c('0x2'));var BPromise=require('bluebird');var rp=require(_0x5b3c('0x3'));var fs=require('fs');var path=require(_0x5b3c('0x4'));var rimraf=require(_0x5b3c('0x5'));var config=require(_0x5b3c('0x6'));var attributes=require(_0x5b3c('0x7'));module[_0x5b3c('0x8')]=function(_0x1f620a,_0x1040b0){return _0x1f620a[_0x5b3c('0x9')](_0x5b3c('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index ff68270..f75c036 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 _0x7eb9=['attributes','limit','map','model','include','debug','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailServerIn','findAll','options','raw'];(function(_0x3c0174,_0x28f610){var _0x311e73=function(_0x3c6434){while(--_0x3c6434){_0x3c0174['push'](_0x3c0174['shift']());}};_0x311e73(++_0x28f610);}(_0x7eb9,0xd9));var _0x97eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7eb9[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x97eb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x97eb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97eb('0x2'));var db=require(_0x97eb('0x3'))['db'];var utils=require(_0x97eb('0x4'));var logger=require(_0x97eb('0x5'))('rpc');var config=require(_0x97eb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x97eb('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44595e,_0x4a8f26,_0x5227f4){return new BPromise(function(_0x429ed6,_0x5af402){return client[_0x97eb('0x8')](_0x44595e,_0x5227f4)[_0x97eb('0x9')](function(_0x10eba2){logger[_0x97eb('0xa')](_0x97eb('0xb'),_0x4a8f26,'request\x20sent');logger['debug'](_0x97eb('0xc'),_0x4a8f26,_0x97eb('0xd'),JSON[_0x97eb('0xe')](_0x10eba2));if(_0x10eba2[_0x97eb('0xf')]){if(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x10')]===0x1f4){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);return _0x5af402(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x10eba2['error'][_0x97eb('0x11')]);return _0x429ed6(_0x10eba2[_0x97eb('0xf')][_0x97eb('0x11')]);}else{logger['info'](_0x97eb('0xb'),_0x4a8f26,_0x97eb('0xd'));_0x429ed6(_0x10eba2[_0x97eb('0x12')]['message']);}})['catch'](function(_0x42efe3){logger[_0x97eb('0xf')](_0x97eb('0xb'),_0x4a8f26,_0x42efe3);_0x5af402(_0x42efe3);});});}exports[_0x97eb('0x13')]=function(_0x1f89bd){var _0xd36a5d=this;return new Promise(function(_0x5cdbe8,_0x156db9){return db['MailServerIn'][_0x97eb('0x14')]({'raw':_0x1f89bd['options']?_0x1f89bd[_0x97eb('0x15')][_0x97eb('0x16')]===undefined?!![]:![]:!![],'where':_0x1f89bd[_0x97eb('0x15')]?_0x1f89bd[_0x97eb('0x15')]['where']||null:null,'attributes':_0x1f89bd[_0x97eb('0x15')]?_0x1f89bd[_0x97eb('0x15')][_0x97eb('0x17')]||null:null,'limit':_0x1f89bd[_0x97eb('0x15')]?_0x1f89bd['options'][_0x97eb('0x18')]||null:null,'include':_0x1f89bd['options']?_0x1f89bd[_0x97eb('0x15')]['include']?_[_0x97eb('0x19')](_0x1f89bd['options']['include'],function(_0x4d59b9){return{'model':db[_0x4d59b9[_0x97eb('0x1a')]],'as':_0x4d59b9['as'],'attributes':_0x4d59b9['attributes'],'include':_0x4d59b9[_0x97eb('0x1b')]?_[_0x97eb('0x19')](_0x4d59b9[_0x97eb('0x1b')],function(_0x19822a){return{'model':db[_0x19822a[_0x97eb('0x1a')]],'as':_0x19822a['as'],'attributes':_0x19822a[_0x97eb('0x17')],'include':_0x19822a[_0x97eb('0x1b')]?_[_0x97eb('0x19')](_0x19822a[_0x97eb('0x1b')],function(_0x58f4ff){return{'model':db[_0x58f4ff[_0x97eb('0x1a')]],'as':_0x58f4ff['as'],'attributes':_0x58f4ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2be576){logger[_0x97eb('0xa')](_0x97eb('0x13'),_0x1f89bd);logger[_0x97eb('0x1c')]('GetMailServerIn',_0x1f89bd,JSON[_0x97eb('0xe')](_0x2be576));_0x5cdbe8(_0x2be576);})[_0x97eb('0x1d')](function(_0x480e3a){logger['error'](_0x97eb('0x13'),_0x480e3a['message'],_0x1f89bd);_0x156db9(_0xd36a5d[_0x97eb('0xf')](0x1f4,_0x480e3a[_0x97eb('0x11')]));});});}; \ No newline at end of file +var _0xeeaf=['stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x5db664,_0x31cfdb){var _0x14fb55=function(_0x535cae){while(--_0x535cae){_0x5db664['push'](_0x5db664['shift']());}};_0x14fb55(++_0x31cfdb);}(_0xeeaf,0x1bc));var _0xfeea=function(_0x2cb4c4,_0x300f19){_0x2cb4c4=_0x2cb4c4-0x0;var _0x6d93d2=_0xeeaf[_0x2cb4c4];return _0x6d93d2;};'use strict';var _=require(_0xfeea('0x0'));var util=require(_0xfeea('0x1'));var moment=require(_0xfeea('0x2'));var BPromise=require(_0xfeea('0x3'));var rs=require(_0xfeea('0x4'));var fs=require('fs');var Redis=require(_0xfeea('0x5'));var db=require(_0xfeea('0x6'))['db'];var utils=require(_0xfeea('0x7'));var logger=require('../../config/logger')(_0xfeea('0x8'));var config=require(_0xfeea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfeea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ee0c,_0x37f662,_0x4980ef){return new BPromise(function(_0x5e10ec,_0x5ef7c8){return client[_0xfeea('0xb')](_0x56ee0c,_0x4980ef)[_0xfeea('0xc')](function(_0x57db5d){logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));logger[_0xfeea('0x10')](_0xfeea('0x11'),_0x37f662,_0xfeea('0xf'),JSON[_0xfeea('0x12')](_0x57db5d));if(_0x57db5d[_0xfeea('0x13')]){if(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x14')]===0x1f4){logger[_0xfeea('0x13')]('MailServerIn,\x20%s,\x20%s',_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5ef7c8(_0x57db5d['error'][_0xfeea('0x15')]);}logger[_0xfeea('0x13')](_0xfeea('0xe'),_0x37f662,_0x57db5d['error'][_0xfeea('0x15')]);return _0x5e10ec(_0x57db5d[_0xfeea('0x13')][_0xfeea('0x15')]);}else{logger[_0xfeea('0xd')](_0xfeea('0xe'),_0x37f662,_0xfeea('0xf'));_0x5e10ec(_0x57db5d[_0xfeea('0x16')][_0xfeea('0x15')]);}})[_0xfeea('0x17')](function(_0x2a3668){logger[_0xfeea('0x13')]('MailServerIn,\x20%s,\x20%s',_0x37f662,_0x2a3668);_0x5ef7c8(_0x2a3668);});});}exports[_0xfeea('0x18')]=function(_0x4313fb){var _0x55abac=this;return new Promise(function(_0x5af1a8,_0x177f7c){return db[_0xfeea('0x19')]['findAll']({'raw':_0x4313fb[_0xfeea('0x1a')]?_0x4313fb[_0xfeea('0x1a')][_0xfeea('0x1b')]===undefined?!![]:![]:!![],'where':_0x4313fb[_0xfeea('0x1a')]?_0x4313fb[_0xfeea('0x1a')][_0xfeea('0x1c')]||null:null,'attributes':_0x4313fb[_0xfeea('0x1a')]?_0x4313fb[_0xfeea('0x1a')][_0xfeea('0x1d')]||null:null,'limit':_0x4313fb[_0xfeea('0x1a')]?_0x4313fb[_0xfeea('0x1a')]['limit']||null:null,'include':_0x4313fb[_0xfeea('0x1a')]?_0x4313fb[_0xfeea('0x1a')][_0xfeea('0x1e')]?_[_0xfeea('0x1f')](_0x4313fb[_0xfeea('0x1a')][_0xfeea('0x1e')],function(_0x49333d){return{'model':db[_0x49333d[_0xfeea('0x20')]],'as':_0x49333d['as'],'attributes':_0x49333d[_0xfeea('0x1d')],'include':_0x49333d['include']?_[_0xfeea('0x1f')](_0x49333d['include'],function(_0x27bf84){return{'model':db[_0x27bf84[_0xfeea('0x20')]],'as':_0x27bf84['as'],'attributes':_0x27bf84[_0xfeea('0x1d')],'include':_0x27bf84['include']?_[_0xfeea('0x1f')](_0x27bf84[_0xfeea('0x1e')],function(_0x951970){return{'model':db[_0x951970[_0xfeea('0x20')]],'as':_0x951970['as'],'attributes':_0x951970[_0xfeea('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfeea('0xc')](function(_0x15ee46){logger['info']('GetMailServerIn',_0x4313fb);logger[_0xfeea('0x10')]('GetMailServerIn',_0x4313fb,JSON[_0xfeea('0x12')](_0x15ee46));_0x5af1a8(_0x15ee46);})[_0xfeea('0x17')](function(_0x1a8860){logger['error'](_0xfeea('0x18'),_0x1a8860[_0xfeea('0x15')],_0x4313fb);_0x177f7c(_0x55abac[_0xfeea('0x13')](0x1f4,_0x1a8860[_0xfeea('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e2fb9f9..dae0ac8 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x1edc39,_0x257cb4){_0x1edc39=_0x1edc39-0x0;var _0x578c0e=_0x7a54[_0x1edc39];return _0x578c0e;};'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 f8929d2..fcb9185 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 _0x9a3d=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x3c957d,_0x40d8f3){var _0x46ab64=function(_0x470663){while(--_0x470663){_0x3c957d['push'](_0x3c957d['shift']());}};_0x46ab64(++_0x40d8f3);}(_0x9a3d,0x10c));var _0xd9a3=function(_0x2f192d,_0x2a9cce){_0x2f192d=_0x2f192d-0x0;var _0x4b4faf=_0x9a3d[_0x2f192d];return _0x4b4faf;};'use strict';var Sequelize=require(_0xd9a3('0x0'));module['exports']={'description':{'type':Sequelize[_0xd9a3('0x1')]},'host':{'type':Sequelize[_0xd9a3('0x1')]},'user':{'type':Sequelize[_0xd9a3('0x1')]},'pass':{'type':Sequelize[_0xd9a3('0x1')]},'port':{'type':Sequelize[_0xd9a3('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xd9a3('0x1')]},'authentication':{'type':Sequelize[_0xd9a3('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1eb4=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x1eb4,0x158));var _0x41eb=function(_0x1ff960,_0x1e3ce5){_0x1ff960=_0x1ff960-0x0;var _0x2a7e10=_0x1eb4[_0x1ff960];return _0x2a7e10;};'use strict';var Sequelize=require('sequelize');module[_0x41eb('0x0')]={'description':{'type':Sequelize[_0x41eb('0x1')]},'host':{'type':Sequelize[_0x41eb('0x1')]},'user':{'type':Sequelize[_0x41eb('0x1')]},'pass':{'type':Sequelize[_0x41eb('0x1')]},'port':{'type':Sequelize[_0x41eb('0x2')]},'secure':{'type':Sequelize[_0x41eb('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x41eb('0x1')]},'authentication':{'type':Sequelize[_0x41eb('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 7982d1e..322620a 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 _0x5bd9=['offset','undefined','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','then','include','MailServerOut','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x4489e6,_0x1e36cc){var _0x302d3c=function(_0x252541){while(--_0x252541){_0x4489e6['push'](_0x4489e6['shift']());}};_0x302d3c(++_0x1e36cc);}(_0x5bd9,0x108));var _0x95bd=function(_0x4f303a,_0x52bcd3){_0x4f303a=_0x4f303a-0x0;var _0x152561=_0x5bd9[_0x4f303a];return _0x152561;};'use strict';var emlformat=require(_0x95bd('0x0'));var rimraf=require(_0x95bd('0x1'));var zipdir=require(_0x95bd('0x2'));var jsonpatch=require(_0x95bd('0x3'));var rp=require('request-promise');var moment=require(_0x95bd('0x4'));var BPromise=require(_0x95bd('0x5'));var Mustache=require('mustache');var util=require(_0x95bd('0x6'));var path=require(_0x95bd('0x7'));var sox=require(_0x95bd('0x8'));var csv=require(_0x95bd('0x9'));var ejs=require(_0x95bd('0xa'));var fs=require('fs');var fs_extra=require(_0x95bd('0xb'));var _=require(_0x95bd('0xc'));var squel=require(_0x95bd('0xd'));var crypto=require(_0x95bd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x95bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x95bd('0x10'));var Papa=require(_0x95bd('0x11'));var Redis=require('ioredis');var authService=require(_0x95bd('0x12'));var qs=require(_0x95bd('0x13'));var as=require(_0x95bd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95bd('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x95bd('0x16'));var db=require(_0x95bd('0x17'))['db'];function respondWithStatusCode(_0x5ed84e,_0xc63b17){_0xc63b17=_0xc63b17||0xcc;return function(_0x2af710){if(_0x2af710){return _0x5ed84e[_0x95bd('0x18')](_0xc63b17);}return _0x5ed84e[_0x95bd('0x19')](_0xc63b17)[_0x95bd('0x1a')]();};}function respondWithResult(_0x53720a,_0x507157){_0x507157=_0x507157||0xc8;return function(_0x2466d0){if(_0x2466d0){return _0x53720a['status'](_0x507157)[_0x95bd('0x1b')](_0x2466d0);}};}function respondWithFilteredResult(_0x266213,_0x50a208){return function(_0x5e2f49){if(_0x5e2f49){var _0x56a295=typeof _0x50a208[_0x95bd('0x1c')]===_0x95bd('0x1d')&&typeof _0x50a208[_0x95bd('0x1e')]==='undefined';var _0x5af116=_0x5e2f49[_0x95bd('0x1f')];var _0x54db97=_0x56a295?0x0:_0x50a208[_0x95bd('0x1c')];var _0x401559=_0x56a295?_0x5e2f49[_0x95bd('0x1f')]:_0x50a208[_0x95bd('0x1c')]+_0x50a208[_0x95bd('0x1e')];var _0x2bcde3;if(_0x401559>=_0x5af116){_0x401559=_0x5af116;_0x2bcde3=0xc8;}else{_0x2bcde3=0xce;}_0x266213[_0x95bd('0x19')](_0x2bcde3);return _0x266213[_0x95bd('0x20')]('Content-Range',_0x54db97+'-'+_0x401559+'/'+_0x5af116)[_0x95bd('0x1b')](_0x5e2f49);}return null;};}function patchUpdates(_0x2e439e){return function(_0x36c797){try{jsonpatch[_0x95bd('0x21')](_0x36c797,_0x2e439e,!![]);}catch(_0x435db1){return BPromise[_0x95bd('0x22')](_0x435db1);}return _0x36c797[_0x95bd('0x23')]();};}function saveUpdates(_0x1e103d,_0x3974cb){return function(_0x1f58e4){if(_0x1f58e4){return _0x1f58e4[_0x95bd('0x24')](_0x1e103d)['then'](function(_0x20bbd1){return _0x20bbd1;});}return null;};}function removeEntity(_0x143891,_0x3ed6b9){return function(_0x3756b9){if(_0x3756b9){return _0x3756b9[_0x95bd('0x25')]()['then'](function(){_0x143891[_0x95bd('0x19')](0xcc)[_0x95bd('0x1a')]();});}};}function handleEntityNotFound(_0x42ccdc,_0x17f98e){return function(_0x30ede9){if(!_0x30ede9){_0x42ccdc[_0x95bd('0x18')](0x194);}return _0x30ede9;};}function handleError(_0xa9e166,_0x326b58){_0x326b58=_0x326b58||0x1f4;return function(_0x153b78){logger['error'](_0x153b78['stack']);if(_0x153b78[_0x95bd('0x26')]){delete _0x153b78['name'];}_0xa9e166[_0x95bd('0x19')](_0x326b58)[_0x95bd('0x27')](_0x153b78);};}exports[_0x95bd('0x28')]=function(_0x462c20,_0x307847){var _0x57673c={},_0x4c0ab1={},_0x5843c4={'count':0x0,'rows':[]};var _0x26b628=_[_0x95bd('0x29')](db['MailServerOut']['rawAttributes'],function(_0x3ea98c){return{'name':_0x3ea98c[_0x95bd('0x2a')],'type':_0x3ea98c['type'][_0x95bd('0x2b')]};});_0x4c0ab1['model']=_[_0x95bd('0x29')](_0x26b628,_0x95bd('0x26'));_0x4c0ab1[_0x95bd('0x2c')]=_[_0x95bd('0x2d')](_0x462c20[_0x95bd('0x2c')]);_0x4c0ab1[_0x95bd('0x2e')]=_[_0x95bd('0x2f')](_0x4c0ab1[_0x95bd('0x30')],_0x4c0ab1[_0x95bd('0x2c')]);_0x57673c['attributes']=_['intersection'](_0x4c0ab1[_0x95bd('0x30')],qs[_0x95bd('0x31')](_0x462c20['query'][_0x95bd('0x31')]));_0x57673c[_0x95bd('0x32')]=_0x57673c[_0x95bd('0x32')][_0x95bd('0x33')]?_0x57673c[_0x95bd('0x32')]:_0x4c0ab1[_0x95bd('0x30')];if(!_0x462c20[_0x95bd('0x2c')][_0x95bd('0x34')](_0x95bd('0x35'))){_0x57673c[_0x95bd('0x1e')]=qs[_0x95bd('0x1e')](_0x462c20[_0x95bd('0x2c')][_0x95bd('0x1e')]);_0x57673c[_0x95bd('0x1c')]=qs[_0x95bd('0x1c')](_0x462c20[_0x95bd('0x2c')][_0x95bd('0x1c')]);}_0x57673c[_0x95bd('0x36')]=qs[_0x95bd('0x37')](_0x462c20['query'][_0x95bd('0x37')]);_0x57673c[_0x95bd('0x38')]=qs['filters'](_['pick'](_0x462c20[_0x95bd('0x2c')],_0x4c0ab1[_0x95bd('0x2e')]),_0x26b628);if(_0x462c20[_0x95bd('0x2c')][_0x95bd('0x39')]){_0x57673c[_0x95bd('0x38')]=_[_0x95bd('0x3a')](_0x57673c[_0x95bd('0x38')],{'$or':_[_0x95bd('0x29')](_0x26b628,function(_0x4653c9){if(_0x4653c9[_0x95bd('0x3b')]!==_0x95bd('0x3c')){var _0x1ca534={};_0x1ca534[_0x4653c9[_0x95bd('0x26')]]={'$like':'%'+_0x462c20[_0x95bd('0x2c')][_0x95bd('0x39')]+'%'};return _0x1ca534;}})});}_0x57673c=_['merge']({},_0x57673c,_0x462c20[_0x95bd('0x3d')]);var _0x53b9ed={'where':_0x57673c[_0x95bd('0x38')]};return db['MailServerOut']['count'](_0x53b9ed)[_0x95bd('0x3e')](function(_0x4bf0b3){_0x5843c4[_0x95bd('0x1f')]=_0x4bf0b3;if(_0x462c20[_0x95bd('0x2c')]['includeAll']){_0x57673c[_0x95bd('0x3f')]=[{'all':!![]}];}return db[_0x95bd('0x40')]['findAll'](_0x57673c);})[_0x95bd('0x3e')](function(_0x29909e){_0x5843c4[_0x95bd('0x41')]=_0x29909e;return _0x5843c4;})[_0x95bd('0x3e')](respondWithFilteredResult(_0x307847,_0x57673c))['catch'](handleError(_0x307847,null));};exports[_0x95bd('0x42')]=function(_0x30d4c7,_0x56f686){var _0x34aab4={'raw':!![],'where':{'id':_0x30d4c7[_0x95bd('0x43')]['id']}},_0x5aa23e={};_0x5aa23e[_0x95bd('0x30')]=_[_0x95bd('0x2d')](db['MailServerOut'][_0x95bd('0x44')]);_0x5aa23e[_0x95bd('0x2c')]=_[_0x95bd('0x2d')](_0x30d4c7[_0x95bd('0x2c')]);_0x5aa23e['filters']=_[_0x95bd('0x2f')](_0x5aa23e[_0x95bd('0x30')],_0x5aa23e[_0x95bd('0x2c')]);_0x34aab4[_0x95bd('0x32')]=_[_0x95bd('0x2f')](_0x5aa23e['model'],qs[_0x95bd('0x31')](_0x30d4c7[_0x95bd('0x2c')][_0x95bd('0x31')]));_0x34aab4['attributes']=_0x34aab4['attributes'][_0x95bd('0x33')]?_0x34aab4['attributes']:_0x5aa23e[_0x95bd('0x30')];if(_0x30d4c7[_0x95bd('0x2c')]['includeAll']){_0x34aab4[_0x95bd('0x3f')]=[{'all':!![]}];}_0x34aab4=_['merge']({},_0x34aab4,_0x30d4c7[_0x95bd('0x3d')]);return db[_0x95bd('0x40')][_0x95bd('0x45')](_0x34aab4)[_0x95bd('0x3e')](handleEntityNotFound(_0x56f686,null))[_0x95bd('0x3e')](respondWithResult(_0x56f686,null))[_0x95bd('0x46')](handleError(_0x56f686,null));};exports['create']=function(_0xae48bd,_0x135472){return db[_0x95bd('0x40')][_0x95bd('0x47')](_0xae48bd[_0x95bd('0x48')],{})['then'](respondWithResult(_0x135472,0xc9))[_0x95bd('0x46')](handleError(_0x135472,null));};exports[_0x95bd('0x24')]=function(_0x5dddef,_0x5940ca){if(_0x5dddef[_0x95bd('0x48')]['id']){delete _0x5dddef[_0x95bd('0x48')]['id'];}return db[_0x95bd('0x40')][_0x95bd('0x45')]({'where':{'id':_0x5dddef['params']['id']}})['then'](handleEntityNotFound(_0x5940ca,null))[_0x95bd('0x3e')](saveUpdates(_0x5dddef[_0x95bd('0x48')],null))[_0x95bd('0x3e')](respondWithResult(_0x5940ca,null))['catch'](handleError(_0x5940ca,null));};exports['destroy']=function(_0x2a5805,_0x166322){return db[_0x95bd('0x40')][_0x95bd('0x45')]({'where':{'id':_0x2a5805[_0x95bd('0x43')]['id']}})['then'](handleEntityNotFound(_0x166322,null))[_0x95bd('0x3e')](removeEntity(_0x166322,null))[_0x95bd('0x46')](handleError(_0x166322,null));}; \ No newline at end of file +var _0xc143=['name','send','map','MailServerOut','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','error','stack'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc143,0xb0));var _0x3c14=function(_0x13a06a,_0x5498da){_0x13a06a=_0x13a06a-0x0;var _0xa61071=_0xc143[_0x13a06a];return _0xa61071;};'use strict';var emlformat=require(_0x3c14('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c14('0x1'));var jsonpatch=require(_0x3c14('0x2'));var rp=require('request-promise');var moment=require(_0x3c14('0x3'));var BPromise=require(_0x3c14('0x4'));var Mustache=require('mustache');var util=require(_0x3c14('0x5'));var path=require(_0x3c14('0x6'));var sox=require('sox');var csv=require(_0x3c14('0x7'));var ejs=require(_0x3c14('0x8'));var fs=require('fs');var fs_extra=require(_0x3c14('0x9'));var _=require(_0x3c14('0xa'));var squel=require(_0x3c14('0xb'));var crypto=require(_0x3c14('0xc'));var jsforce=require(_0x3c14('0xd'));var deskjs=require(_0x3c14('0xe'));var toCsv=require(_0x3c14('0x7'));var querystring=require(_0x3c14('0xf'));var Papa=require('papaparse');var Redis=require(_0x3c14('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3c14('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c14('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3c14('0x13'));var config=require(_0x3c14('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c14('0x15'))['db'];function respondWithStatusCode(_0x99d7a7,_0x27ee7c){_0x27ee7c=_0x27ee7c||0xcc;return function(_0x53bc24){if(_0x53bc24){return _0x99d7a7[_0x3c14('0x16')](_0x27ee7c);}return _0x99d7a7['status'](_0x27ee7c)[_0x3c14('0x17')]();};}function respondWithResult(_0xa8f1b4,_0x5a8622){_0x5a8622=_0x5a8622||0xc8;return function(_0x384ef4){if(_0x384ef4){return _0xa8f1b4[_0x3c14('0x18')](_0x5a8622)[_0x3c14('0x19')](_0x384ef4);}};}function respondWithFilteredResult(_0x9c6e7d,_0x1d783f){return function(_0x41a1bd){if(_0x41a1bd){var _0x3727e8=typeof _0x1d783f[_0x3c14('0x1a')]==='undefined'&&typeof _0x1d783f[_0x3c14('0x1b')]===_0x3c14('0x1c');var _0xf26f8a=_0x41a1bd[_0x3c14('0x1d')];var _0x4c3eaa=_0x3727e8?0x0:_0x1d783f[_0x3c14('0x1a')];var _0x15b0d5=_0x3727e8?_0x41a1bd[_0x3c14('0x1d')]:_0x1d783f[_0x3c14('0x1a')]+_0x1d783f[_0x3c14('0x1b')];var _0x41e3a8;if(_0x15b0d5>=_0xf26f8a){_0x15b0d5=_0xf26f8a;_0x41e3a8=0xc8;}else{_0x41e3a8=0xce;}_0x9c6e7d[_0x3c14('0x18')](_0x41e3a8);return _0x9c6e7d[_0x3c14('0x1e')](_0x3c14('0x1f'),_0x4c3eaa+'-'+_0x15b0d5+'/'+_0xf26f8a)[_0x3c14('0x19')](_0x41a1bd);}return null;};}function patchUpdates(_0xb1d65e){return function(_0x57cdc9){try{jsonpatch['apply'](_0x57cdc9,_0xb1d65e,!![]);}catch(_0x4a1092){return BPromise[_0x3c14('0x20')](_0x4a1092);}return _0x57cdc9['save']();};}function saveUpdates(_0x85ce97,_0x2b1bd9){return function(_0xeb86e8){if(_0xeb86e8){return _0xeb86e8['update'](_0x85ce97)[_0x3c14('0x21')](function(_0x46e309){return _0x46e309;});}return null;};}function removeEntity(_0x2b243d,_0x208cc4){return function(_0x176e86){if(_0x176e86){return _0x176e86[_0x3c14('0x22')]()[_0x3c14('0x21')](function(){_0x2b243d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa664,_0x2db9eb){return function(_0x47d578){if(!_0x47d578){_0x3fa664[_0x3c14('0x16')](0x194);}return _0x47d578;};}function handleError(_0x35cfb3,_0x38347c){_0x38347c=_0x38347c||0x1f4;return function(_0x186e9c){logger[_0x3c14('0x23')](_0x186e9c[_0x3c14('0x24')]);if(_0x186e9c[_0x3c14('0x25')]){delete _0x186e9c[_0x3c14('0x25')];}_0x35cfb3['status'](_0x38347c)[_0x3c14('0x26')](_0x186e9c);};}exports['index']=function(_0x3f87bf,_0x5e4190){var _0x1bbafe={},_0x492764={},_0x2c8d03={'count':0x0,'rows':[]};var _0x497a78=_[_0x3c14('0x27')](db[_0x3c14('0x28')]['rawAttributes'],function(_0x3b15c5){return{'name':_0x3b15c5[_0x3c14('0x29')],'type':_0x3b15c5[_0x3c14('0x2a')][_0x3c14('0x2b')]};});_0x492764['model']=_[_0x3c14('0x27')](_0x497a78,'name');_0x492764['query']=_[_0x3c14('0x2c')](_0x3f87bf[_0x3c14('0x2d')]);_0x492764[_0x3c14('0x2e')]=_[_0x3c14('0x2f')](_0x492764['model'],_0x492764['query']);_0x1bbafe[_0x3c14('0x30')]=_[_0x3c14('0x2f')](_0x492764['model'],qs[_0x3c14('0x31')](_0x3f87bf[_0x3c14('0x2d')][_0x3c14('0x31')]));_0x1bbafe[_0x3c14('0x30')]=_0x1bbafe[_0x3c14('0x30')][_0x3c14('0x32')]?_0x1bbafe[_0x3c14('0x30')]:_0x492764[_0x3c14('0x33')];if(!_0x3f87bf[_0x3c14('0x2d')][_0x3c14('0x34')](_0x3c14('0x35'))){_0x1bbafe[_0x3c14('0x1b')]=qs[_0x3c14('0x1b')](_0x3f87bf[_0x3c14('0x2d')][_0x3c14('0x1b')]);_0x1bbafe[_0x3c14('0x1a')]=qs['offset'](_0x3f87bf[_0x3c14('0x2d')][_0x3c14('0x1a')]);}_0x1bbafe[_0x3c14('0x36')]=qs[_0x3c14('0x37')](_0x3f87bf[_0x3c14('0x2d')][_0x3c14('0x37')]);_0x1bbafe[_0x3c14('0x38')]=qs[_0x3c14('0x2e')](_[_0x3c14('0x39')](_0x3f87bf[_0x3c14('0x2d')],_0x492764[_0x3c14('0x2e')]),_0x497a78);if(_0x3f87bf[_0x3c14('0x2d')]['filter']){_0x1bbafe[_0x3c14('0x38')]=_[_0x3c14('0x3a')](_0x1bbafe[_0x3c14('0x38')],{'$or':_[_0x3c14('0x27')](_0x497a78,function(_0x3b7279){if(_0x3b7279[_0x3c14('0x2a')]!==_0x3c14('0x3b')){var _0x505593={};_0x505593[_0x3b7279[_0x3c14('0x25')]]={'$like':'%'+_0x3f87bf[_0x3c14('0x2d')]['filter']+'%'};return _0x505593;}})});}_0x1bbafe=_[_0x3c14('0x3a')]({},_0x1bbafe,_0x3f87bf[_0x3c14('0x3c')]);var _0x38a801={'where':_0x1bbafe[_0x3c14('0x38')]};return db[_0x3c14('0x28')][_0x3c14('0x1d')](_0x38a801)[_0x3c14('0x21')](function(_0x2fab19){_0x2c8d03[_0x3c14('0x1d')]=_0x2fab19;if(_0x3f87bf['query']['includeAll']){_0x1bbafe[_0x3c14('0x3d')]=[{'all':!![]}];}return db[_0x3c14('0x28')][_0x3c14('0x3e')](_0x1bbafe);})[_0x3c14('0x21')](function(_0x44c7b7){_0x2c8d03[_0x3c14('0x3f')]=_0x44c7b7;return _0x2c8d03;})[_0x3c14('0x21')](respondWithFilteredResult(_0x5e4190,_0x1bbafe))[_0x3c14('0x40')](handleError(_0x5e4190,null));};exports[_0x3c14('0x41')]=function(_0x59781d,_0x555e29){var _0x399a0e={'raw':!![],'where':{'id':_0x59781d[_0x3c14('0x42')]['id']}},_0x4a3466={};_0x4a3466['model']=_[_0x3c14('0x2c')](db[_0x3c14('0x28')][_0x3c14('0x43')]);_0x4a3466['query']=_[_0x3c14('0x2c')](_0x59781d['query']);_0x4a3466[_0x3c14('0x2e')]=_[_0x3c14('0x2f')](_0x4a3466[_0x3c14('0x33')],_0x4a3466[_0x3c14('0x2d')]);_0x399a0e[_0x3c14('0x30')]=_['intersection'](_0x4a3466['model'],qs[_0x3c14('0x31')](_0x59781d[_0x3c14('0x2d')][_0x3c14('0x31')]));_0x399a0e[_0x3c14('0x30')]=_0x399a0e[_0x3c14('0x30')][_0x3c14('0x32')]?_0x399a0e[_0x3c14('0x30')]:_0x4a3466[_0x3c14('0x33')];if(_0x59781d['query']['includeAll']){_0x399a0e[_0x3c14('0x3d')]=[{'all':!![]}];}_0x399a0e=_[_0x3c14('0x3a')]({},_0x399a0e,_0x59781d['options']);return db['MailServerOut']['find'](_0x399a0e)[_0x3c14('0x21')](handleEntityNotFound(_0x555e29,null))['then'](respondWithResult(_0x555e29,null))[_0x3c14('0x40')](handleError(_0x555e29,null));};exports[_0x3c14('0x44')]=function(_0x53de93,_0x1bea26){return db[_0x3c14('0x28')]['create'](_0x53de93[_0x3c14('0x45')],{})[_0x3c14('0x21')](respondWithResult(_0x1bea26,0xc9))[_0x3c14('0x40')](handleError(_0x1bea26,null));};exports[_0x3c14('0x46')]=function(_0x447307,_0x525885){if(_0x447307[_0x3c14('0x45')]['id']){delete _0x447307[_0x3c14('0x45')]['id'];}return db[_0x3c14('0x28')]['find']({'where':{'id':_0x447307[_0x3c14('0x42')]['id']}})[_0x3c14('0x21')](handleEntityNotFound(_0x525885,null))[_0x3c14('0x21')](saveUpdates(_0x447307['body'],null))['then'](respondWithResult(_0x525885,null))[_0x3c14('0x40')](handleError(_0x525885,null));};exports[_0x3c14('0x22')]=function(_0x14dd8d,_0x923f0c){return db[_0x3c14('0x28')]['find']({'where':{'id':_0x14dd8d[_0x3c14('0x42')]['id']}})[_0x3c14('0x21')](handleEntityNotFound(_0x923f0c,null))['then'](removeEntity(_0x923f0c,null))[_0x3c14('0x40')](handleError(_0x923f0c,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 927236e..4427aed 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 _0x887d=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','api','bluebird'];(function(_0x2a9fc8,_0x19d0a5){var _0x1f9162=function(_0x211784){while(--_0x211784){_0x2a9fc8['push'](_0x2a9fc8['shift']());}};_0x1f9162(++_0x19d0a5);}(_0x887d,0x193));var _0xd887=function(_0x3111a4,_0x24f544){_0x3111a4=_0x3111a4-0x0;var _0x19df9d=_0x887d[_0x3111a4];return _0x19df9d;};'use strict';var _=require(_0xd887('0x0'));var util=require(_0xd887('0x1'));var logger=require('../../config/logger')(_0xd887('0x2'));var moment=require('moment');var BPromise=require(_0xd887('0x3'));var rp=require(_0xd887('0x4'));var fs=require('fs');var path=require(_0xd887('0x5'));var rimraf=require(_0xd887('0x6'));var config=require(_0xd887('0x7'));var attributes=require(_0xd887('0x8'));module[_0xd887('0x9')]=function(_0x1b4b62,_0xd65d19){return _0x1b4b62[_0xd887('0xa')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb32e=['define','MailServerOut','mail_servers_out','lodash','util','api','moment','rimraf','../../config/environment','exports'];(function(_0xcac8d3,_0x2bb3bb){var _0x2bd755=function(_0x1a75f6){while(--_0x1a75f6){_0xcac8d3['push'](_0xcac8d3['shift']());}};_0x2bd755(++_0x2bb3bb);}(_0xb32e,0x99));var _0xeb32=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb32e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xeb32('0x0'));var util=require(_0xeb32('0x1'));var logger=require('../../config/logger')(_0xeb32('0x2'));var moment=require(_0xeb32('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeb32('0x4'));var config=require(_0xeb32('0x5'));var attributes=require('./mailServerOut.attributes');module[_0xeb32('0x6')]=function(_0x2ba471,_0x3b57f7){return _0x2ba471[_0xeb32('0x7')](_0xeb32('0x8'),attributes,{'tableName':_0xeb32('0x9'),'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 62be77c..a3e0992 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x3a9f76,_0x4c65f6){_0x3a9f76=_0x3a9f76-0x0;var _0x2ff052=_0x7a54[_0x3a9f76];return _0x2ff052;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7a54,0x106));var _0x47a5=function(_0x21ac3a,_0x4de927){_0x21ac3a=_0x21ac3a-0x0;var _0xd6f1b2=_0x7a54[_0x21ac3a];return _0xd6f1b2;};'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 4707679..0f77a1b 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 _0x7ede=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','util','path'];(function(_0x52eaf7,_0x494faa){var _0x51e6f0=function(_0x1574c8){while(--_0x1574c8){_0x52eaf7['push'](_0x52eaf7['shift']());}};_0x51e6f0(++_0x494faa);}(_0x7ede,0x96));var _0xe7ed=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x7ede[_0xf2f332];return _0x56cce3;};'use strict';var multer=require('multer');var util=require(_0xe7ed('0x0'));var path=require(_0xe7ed('0x1'));var timeout=require(_0xe7ed('0x2'));var express=require(_0xe7ed('0x3'));var router=express[_0xe7ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ed('0x5'));var interaction=require(_0xe7ed('0x6'));var config=require('../../config/environment');var controller=require(_0xe7ed('0x7'));router[_0xe7ed('0x8')]('/',auth[_0xe7ed('0x9')](),controller[_0xe7ed('0xa')]);router[_0xe7ed('0x8')](_0xe7ed('0xb'),auth[_0xe7ed('0x9')](),controller[_0xe7ed('0xc')]);router[_0xe7ed('0x8')](_0xe7ed('0xd'),auth[_0xe7ed('0x9')](),controller['show']);router[_0xe7ed('0xe')]('/',auth[_0xe7ed('0x9')](),controller[_0xe7ed('0xf')]);router[_0xe7ed('0x10')](_0xe7ed('0xd'),auth[_0xe7ed('0x9')](),controller[_0xe7ed('0x11')]);router['delete'](_0xe7ed('0xd'),auth['isAuthenticated'](),controller[_0xe7ed('0x12')]);module['exports']=router; \ No newline at end of file +var _0x13a1=['./mailSubstatus.controller','get','/describe','describe','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x552c8d,_0x1b0083){var _0x1fb1cb=function(_0x5d281d){while(--_0x5d281d){_0x552c8d['push'](_0x552c8d['shift']());}};_0x1fb1cb(++_0x1b0083);}(_0x13a1,0x1f0));var _0x113a=function(_0x39d25f,_0x633fd6){_0x39d25f=_0x39d25f-0x0;var _0x4e6201=_0x13a1[_0x39d25f];return _0x4e6201;};'use strict';var multer=require(_0x113a('0x0'));var util=require(_0x113a('0x1'));var path=require(_0x113a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x113a('0x3')]();var fs_extra=require(_0x113a('0x4'));var auth=require(_0x113a('0x5'));var interaction=require(_0x113a('0x6'));var config=require(_0x113a('0x7'));var controller=require(_0x113a('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x113a('0x9')](_0x113a('0xa'),auth['isAuthenticated'](),controller[_0x113a('0xb')]);router['get'](_0x113a('0xc'),auth[_0x113a('0xd')](),controller['show']);router[_0x113a('0xe')]('/',auth[_0x113a('0xd')](),controller[_0x113a('0xf')]);router[_0x113a('0x10')](_0x113a('0xc'),auth[_0x113a('0xd')](),controller[_0x113a('0x11')]);router[_0x113a('0x12')](_0x113a('0xc'),auth[_0x113a('0xd')](),controller[_0x113a('0x13')]);module[_0x113a('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 409935f..7262cd3 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 _0xbacd=['STRING','sequelize','exports','name'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xbacd,0x1c5));var _0xdbac=function(_0x87b7e5,_0x6e278f){_0x87b7e5=_0x87b7e5-0x0;var _0x15ad9e=_0xbacd[_0x87b7e5];return _0x15ad9e;};'use strict';var Sequelize=require(_0xdbac('0x0'));module[_0xdbac('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xdbac('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdbac('0x3')]}}; \ No newline at end of file +var _0x4300=['sequelize'];(function(_0x233706,_0x1f6b12){var _0x20d133=function(_0x3ba0fb){while(--_0x3ba0fb){_0x233706['push'](_0x233706['shift']());}};_0x20d133(++_0x1f6b12);}(_0x4300,0x1a6));var _0x0430=function(_0x4120b9,_0x32663d){_0x4120b9=_0x4120b9-0x0;var _0x518563=_0x4300[_0x4120b9];return _0x518563;};'use strict';var Sequelize=require(_0x0430('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 315e09d..0fdce68 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 _0xdd49=['../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4fa5b7,_0x42a92d){var _0x578649=function(_0x2c38b1){while(--_0x2c38b1){_0x4fa5b7['push'](_0x4fa5b7['shift']());}};_0x578649(++_0x42a92d);}(_0xdd49,0x15c));var _0x9dd4=function(_0x4ef734,_0x5826d){_0x4ef734=_0x4ef734-0x0;var _0x33a7cb=_0xdd49[_0x4ef734];return _0x33a7cb;};'use strict';var emlformat=require(_0x9dd4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dd4('0x1'));var jsonpatch=require(_0x9dd4('0x2'));var rp=require('request-promise');var moment=require(_0x9dd4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9dd4('0x4'));var util=require(_0x9dd4('0x5'));var path=require(_0x9dd4('0x6'));var sox=require(_0x9dd4('0x7'));var csv=require(_0x9dd4('0x8'));var ejs=require(_0x9dd4('0x9'));var fs=require('fs');var fs_extra=require(_0x9dd4('0xa'));var _=require('lodash');var squel=require(_0x9dd4('0xb'));var crypto=require(_0x9dd4('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9dd4('0x8'));var querystring=require(_0x9dd4('0xd'));var Papa=require(_0x9dd4('0xe'));var Redis=require('ioredis');var authService=require(_0x9dd4('0xf'));var qs=require(_0x9dd4('0x10'));var as=require(_0x9dd4('0x11'));var hardwareService=require(_0x9dd4('0x12'));var logger=require(_0x9dd4('0x13'))(_0x9dd4('0x14'));var utils=require(_0x9dd4('0x15'));var config=require(_0x9dd4('0x16'));var licenseUtil=require(_0x9dd4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2691,_0x32b58e){_0x32b58e=_0x32b58e||0xcc;return function(_0x46a1e9){if(_0x46a1e9){return _0x1c2691[_0x9dd4('0x18')](_0x32b58e);}return _0x1c2691[_0x9dd4('0x19')](_0x32b58e)['end']();};}function respondWithResult(_0x14e54b,_0x30c719){_0x30c719=_0x30c719||0xc8;return function(_0x579c04){if(_0x579c04){return _0x14e54b[_0x9dd4('0x19')](_0x30c719)[_0x9dd4('0x1a')](_0x579c04);}};}function respondWithFilteredResult(_0xbad44a,_0x49bb0b){return function(_0x34459f){if(_0x34459f){var _0x2c8566=typeof _0x49bb0b['offset']===_0x9dd4('0x1b')&&typeof _0x49bb0b[_0x9dd4('0x1c')]===_0x9dd4('0x1b');var _0x463249=_0x34459f[_0x9dd4('0x1d')];var _0x53ad26=_0x2c8566?0x0:_0x49bb0b[_0x9dd4('0x1e')];var _0x5bf0a7=_0x2c8566?_0x34459f[_0x9dd4('0x1d')]:_0x49bb0b['offset']+_0x49bb0b[_0x9dd4('0x1c')];var _0x38d1a9;if(_0x5bf0a7>=_0x463249){_0x5bf0a7=_0x463249;_0x38d1a9=0xc8;}else{_0x38d1a9=0xce;}_0xbad44a['status'](_0x38d1a9);return _0xbad44a[_0x9dd4('0x1f')](_0x9dd4('0x20'),_0x53ad26+'-'+_0x5bf0a7+'/'+_0x463249)['json'](_0x34459f);}return null;};}function patchUpdates(_0x3f2533){return function(_0x5c3a29){try{jsonpatch[_0x9dd4('0x21')](_0x5c3a29,_0x3f2533,!![]);}catch(_0x2ee7e9){return BPromise[_0x9dd4('0x22')](_0x2ee7e9);}return _0x5c3a29[_0x9dd4('0x23')]();};}function saveUpdates(_0xa884e2,_0x15e6f2){return function(_0x36201c){if(_0x36201c){return _0x36201c[_0x9dd4('0x24')](_0xa884e2)[_0x9dd4('0x25')](function(_0x2f8aeb){return _0x2f8aeb;});}return null;};}function removeEntity(_0x573453,_0xd3b023){return function(_0x24a3e1){if(_0x24a3e1){return _0x24a3e1[_0x9dd4('0x26')]()[_0x9dd4('0x25')](function(){_0x573453['status'](0xcc)[_0x9dd4('0x27')]();});}};}function handleEntityNotFound(_0x1ed3d7,_0x43cc31){return function(_0xee4ebc){if(!_0xee4ebc){_0x1ed3d7[_0x9dd4('0x18')](0x194);}return _0xee4ebc;};}function handleError(_0x2c9eef,_0x22ac61){_0x22ac61=_0x22ac61||0x1f4;return function(_0x29fe2c){logger['error'](_0x29fe2c[_0x9dd4('0x28')]);if(_0x29fe2c['name']){delete _0x29fe2c[_0x9dd4('0x29')];}_0x2c9eef['status'](_0x22ac61)['send'](_0x29fe2c);};}exports[_0x9dd4('0x2a')]=function(_0xd7febf,_0x48fcfb){var _0x46424d={},_0x3e70f1={},_0x1113c8={'count':0x0,'rows':[]};var _0x1a3e8c=_[_0x9dd4('0x2b')](db[_0x9dd4('0x2c')][_0x9dd4('0x2d')],function(_0x30626d){return{'name':_0x30626d[_0x9dd4('0x2e')],'type':_0x30626d[_0x9dd4('0x2f')]['key']};});_0x3e70f1[_0x9dd4('0x30')]=_['map'](_0x1a3e8c,_0x9dd4('0x29'));_0x3e70f1[_0x9dd4('0x31')]=_[_0x9dd4('0x32')](_0xd7febf[_0x9dd4('0x31')]);_0x3e70f1[_0x9dd4('0x33')]=_[_0x9dd4('0x34')](_0x3e70f1[_0x9dd4('0x30')],_0x3e70f1['query']);_0x46424d['attributes']=_[_0x9dd4('0x34')](_0x3e70f1[_0x9dd4('0x30')],qs[_0x9dd4('0x35')](_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x35')]));_0x46424d[_0x9dd4('0x36')]=_0x46424d[_0x9dd4('0x36')][_0x9dd4('0x37')]?_0x46424d['attributes']:_0x3e70f1[_0x9dd4('0x30')];if(!_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x38')](_0x9dd4('0x39'))){_0x46424d[_0x9dd4('0x1c')]=qs[_0x9dd4('0x1c')](_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x1c')]);_0x46424d[_0x9dd4('0x1e')]=qs[_0x9dd4('0x1e')](_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x1e')]);}_0x46424d[_0x9dd4('0x3a')]=qs['sort'](_0xd7febf[_0x9dd4('0x31')]['sort']);_0x46424d[_0x9dd4('0x3b')]=qs[_0x9dd4('0x33')](_[_0x9dd4('0x3c')](_0xd7febf['query'],_0x3e70f1['filters']),_0x1a3e8c);if(_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x3d')]){_0x46424d[_0x9dd4('0x3b')]=_[_0x9dd4('0x3e')](_0x46424d['where'],{'$or':_['map'](_0x1a3e8c,function(_0x1039aa){if(_0x1039aa[_0x9dd4('0x2f')]!=='VIRTUAL'){var _0x3c5783={};_0x3c5783[_0x1039aa[_0x9dd4('0x29')]]={'$like':'%'+_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x3d')]+'%'};return _0x3c5783;}})});}_0x46424d=_[_0x9dd4('0x3e')]({},_0x46424d,_0xd7febf[_0x9dd4('0x3f')]);var _0x2ee2d8={'where':_0x46424d['where']};return db[_0x9dd4('0x2c')][_0x9dd4('0x1d')](_0x2ee2d8)[_0x9dd4('0x25')](function(_0x1ef15b){_0x1113c8[_0x9dd4('0x1d')]=_0x1ef15b;if(_0xd7febf[_0x9dd4('0x31')][_0x9dd4('0x40')]){_0x46424d[_0x9dd4('0x41')]=[{'all':!![]}];}return db[_0x9dd4('0x2c')][_0x9dd4('0x42')](_0x46424d);})[_0x9dd4('0x25')](function(_0x133849){_0x1113c8[_0x9dd4('0x43')]=_0x133849;return _0x1113c8;})[_0x9dd4('0x25')](respondWithFilteredResult(_0x48fcfb,_0x46424d))['catch'](handleError(_0x48fcfb,null));};exports['show']=function(_0xe1a2dd,_0x1df282){var _0x1aa873={'raw':!![],'where':{'id':_0xe1a2dd[_0x9dd4('0x44')]['id']}},_0x360984={};_0x360984[_0x9dd4('0x30')]=_[_0x9dd4('0x32')](db[_0x9dd4('0x2c')][_0x9dd4('0x2d')]);_0x360984[_0x9dd4('0x31')]=_[_0x9dd4('0x32')](_0xe1a2dd[_0x9dd4('0x31')]);_0x360984['filters']=_['intersection'](_0x360984[_0x9dd4('0x30')],_0x360984[_0x9dd4('0x31')]);_0x1aa873[_0x9dd4('0x36')]=_[_0x9dd4('0x34')](_0x360984['model'],qs[_0x9dd4('0x35')](_0xe1a2dd['query'][_0x9dd4('0x35')]));_0x1aa873['attributes']=_0x1aa873[_0x9dd4('0x36')][_0x9dd4('0x37')]?_0x1aa873[_0x9dd4('0x36')]:_0x360984[_0x9dd4('0x30')];if(_0xe1a2dd[_0x9dd4('0x31')][_0x9dd4('0x40')]){_0x1aa873['include']=[{'all':!![]}];}_0x1aa873=_[_0x9dd4('0x3e')]({},_0x1aa873,_0xe1a2dd[_0x9dd4('0x3f')]);return db[_0x9dd4('0x2c')][_0x9dd4('0x45')](_0x1aa873)[_0x9dd4('0x25')](handleEntityNotFound(_0x1df282,null))[_0x9dd4('0x25')](respondWithResult(_0x1df282,null))[_0x9dd4('0x46')](handleError(_0x1df282,null));};exports[_0x9dd4('0x47')]=function(_0x5d6dbe,_0x19a8c8){return db[_0x9dd4('0x2c')][_0x9dd4('0x47')](_0x5d6dbe[_0x9dd4('0x48')],{})[_0x9dd4('0x25')](respondWithResult(_0x19a8c8,0xc9))[_0x9dd4('0x46')](handleError(_0x19a8c8,null));};exports[_0x9dd4('0x24')]=function(_0x2835ca,_0x3c1a72){if(_0x2835ca['body']['id']){delete _0x2835ca[_0x9dd4('0x48')]['id'];}return db[_0x9dd4('0x2c')][_0x9dd4('0x45')]({'where':{'id':_0x2835ca['params']['id']}})['then'](handleEntityNotFound(_0x3c1a72,null))['then'](saveUpdates(_0x2835ca['body'],null))[_0x9dd4('0x25')](respondWithResult(_0x3c1a72,null))[_0x9dd4('0x46')](handleError(_0x3c1a72,null));};exports[_0x9dd4('0x26')]=function(_0x361f41,_0x534898){return db[_0x9dd4('0x2c')][_0x9dd4('0x45')]({'where':{'id':_0x361f41[_0x9dd4('0x44')]['id']}})['then'](handleEntityNotFound(_0x534898,null))[_0x9dd4('0x25')](removeEntity(_0x534898,null))['catch'](handleError(_0x534898,null));};exports['describe']=function(_0x5d8eca,_0x530c99){return db[_0x9dd4('0x2c')][_0x9dd4('0x49')]()[_0x9dd4('0x25')](respondWithResult(_0x530c99,null))[_0x9dd4('0x46')](handleError(_0x530c99,null));}; \ No newline at end of file +var _0x8331=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','count','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters','attributes','intersection'];(function(_0x5aa5d5,_0x443671){var _0x4afdee=function(_0x41d3a4){while(--_0x41d3a4){_0x5aa5d5['push'](_0x5aa5d5['shift']());}};_0x4afdee(++_0x443671);}(_0x8331,0x19f));var _0x1833=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0x8331[_0x31a938];return _0x1bf341;};'use strict';var emlformat=require(_0x1833('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1833('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1833('0x2'));var moment=require(_0x1833('0x3'));var BPromise=require(_0x1833('0x4'));var Mustache=require(_0x1833('0x5'));var util=require(_0x1833('0x6'));var path=require(_0x1833('0x7'));var sox=require(_0x1833('0x8'));var csv=require('to-csv');var ejs=require(_0x1833('0x9'));var fs=require('fs');var fs_extra=require(_0x1833('0xa'));var _=require(_0x1833('0xb'));var squel=require(_0x1833('0xc'));var crypto=require('crypto');var jsforce=require(_0x1833('0xd'));var deskjs=require(_0x1833('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1833('0xf'));var Papa=require(_0x1833('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1833('0x11'));var hardwareService=require(_0x1833('0x12'));var logger=require(_0x1833('0x13'))(_0x1833('0x14'));var utils=require('../../config/utils');var config=require(_0x1833('0x15'));var licenseUtil=require(_0x1833('0x16'));var db=require(_0x1833('0x17'))['db'];function respondWithStatusCode(_0x3801d3,_0x481120){_0x481120=_0x481120||0xcc;return function(_0x345684){if(_0x345684){return _0x3801d3['sendStatus'](_0x481120);}return _0x3801d3['status'](_0x481120)[_0x1833('0x18')]();};}function respondWithResult(_0x43742d,_0x552e04){_0x552e04=_0x552e04||0xc8;return function(_0x4534fc){if(_0x4534fc){return _0x43742d[_0x1833('0x19')](_0x552e04)[_0x1833('0x1a')](_0x4534fc);}};}function respondWithFilteredResult(_0x53f5d0,_0x47e7ab){return function(_0x3b2b5d){if(_0x3b2b5d){var _0x486a46=typeof _0x47e7ab[_0x1833('0x1b')]===_0x1833('0x1c')&&typeof _0x47e7ab['limit']===_0x1833('0x1c');var _0x146f5a=_0x3b2b5d['count'];var _0x287550=_0x486a46?0x0:_0x47e7ab['offset'];var _0xc1cab6=_0x486a46?_0x3b2b5d['count']:_0x47e7ab[_0x1833('0x1b')]+_0x47e7ab[_0x1833('0x1d')];var _0x1b9ce2;if(_0xc1cab6>=_0x146f5a){_0xc1cab6=_0x146f5a;_0x1b9ce2=0xc8;}else{_0x1b9ce2=0xce;}_0x53f5d0[_0x1833('0x19')](_0x1b9ce2);return _0x53f5d0[_0x1833('0x1e')](_0x1833('0x1f'),_0x287550+'-'+_0xc1cab6+'/'+_0x146f5a)[_0x1833('0x1a')](_0x3b2b5d);}return null;};}function patchUpdates(_0xd38468){return function(_0x496c6e){try{jsonpatch['apply'](_0x496c6e,_0xd38468,!![]);}catch(_0x3dd044){return BPromise[_0x1833('0x20')](_0x3dd044);}return _0x496c6e[_0x1833('0x21')]();};}function saveUpdates(_0x36f630,_0xd466ea){return function(_0x12d253){if(_0x12d253){return _0x12d253[_0x1833('0x22')](_0x36f630)[_0x1833('0x23')](function(_0x338300){return _0x338300;});}return null;};}function removeEntity(_0x564061,_0x8a85cc){return function(_0x36a386){if(_0x36a386){return _0x36a386[_0x1833('0x24')]()[_0x1833('0x23')](function(){_0x564061[_0x1833('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dccbd,_0x3f1ff1){return function(_0x51122b){if(!_0x51122b){_0x3dccbd[_0x1833('0x25')](0x194);}return _0x51122b;};}function handleError(_0x51c4aa,_0x4295ff){_0x4295ff=_0x4295ff||0x1f4;return function(_0x1a4d55){logger[_0x1833('0x26')](_0x1a4d55[_0x1833('0x27')]);if(_0x1a4d55['name']){delete _0x1a4d55['name'];}_0x51c4aa['status'](_0x4295ff)[_0x1833('0x28')](_0x1a4d55);};}exports[_0x1833('0x29')]=function(_0x9b21a8,_0x3014a0){var _0x2d47d0={},_0x55daaf={},_0x10aaea={'count':0x0,'rows':[]};var _0x2e99ca=_[_0x1833('0x2a')](db['MailSubstatus']['rawAttributes'],function(_0x3861fc){return{'name':_0x3861fc[_0x1833('0x2b')],'type':_0x3861fc[_0x1833('0x2c')][_0x1833('0x2d')]};});_0x55daaf[_0x1833('0x2e')]=_['map'](_0x2e99ca,_0x1833('0x2f'));_0x55daaf[_0x1833('0x30')]=_[_0x1833('0x31')](_0x9b21a8['query']);_0x55daaf[_0x1833('0x32')]=_['intersection'](_0x55daaf[_0x1833('0x2e')],_0x55daaf[_0x1833('0x30')]);_0x2d47d0[_0x1833('0x33')]=_[_0x1833('0x34')](_0x55daaf[_0x1833('0x2e')],qs['fields'](_0x9b21a8['query'][_0x1833('0x35')]));_0x2d47d0[_0x1833('0x33')]=_0x2d47d0[_0x1833('0x33')][_0x1833('0x36')]?_0x2d47d0[_0x1833('0x33')]:_0x55daaf[_0x1833('0x2e')];if(!_0x9b21a8[_0x1833('0x30')][_0x1833('0x37')]('nolimit')){_0x2d47d0[_0x1833('0x1d')]=qs[_0x1833('0x1d')](_0x9b21a8[_0x1833('0x30')][_0x1833('0x1d')]);_0x2d47d0[_0x1833('0x1b')]=qs[_0x1833('0x1b')](_0x9b21a8[_0x1833('0x30')][_0x1833('0x1b')]);}_0x2d47d0[_0x1833('0x38')]=qs[_0x1833('0x39')](_0x9b21a8[_0x1833('0x30')][_0x1833('0x39')]);_0x2d47d0[_0x1833('0x3a')]=qs['filters'](_[_0x1833('0x3b')](_0x9b21a8[_0x1833('0x30')],_0x55daaf[_0x1833('0x32')]),_0x2e99ca);if(_0x9b21a8['query'][_0x1833('0x3c')]){_0x2d47d0[_0x1833('0x3a')]=_[_0x1833('0x3d')](_0x2d47d0['where'],{'$or':_[_0x1833('0x2a')](_0x2e99ca,function(_0x2fe281){if(_0x2fe281[_0x1833('0x2c')]!==_0x1833('0x3e')){var _0x40b05e={};_0x40b05e[_0x2fe281[_0x1833('0x2f')]]={'$like':'%'+_0x9b21a8[_0x1833('0x30')][_0x1833('0x3c')]+'%'};return _0x40b05e;}})});}_0x2d47d0=_[_0x1833('0x3d')]({},_0x2d47d0,_0x9b21a8[_0x1833('0x3f')]);var _0x468cbc={'where':_0x2d47d0[_0x1833('0x3a')]};return db[_0x1833('0x40')]['count'](_0x468cbc)[_0x1833('0x23')](function(_0x39b038){_0x10aaea[_0x1833('0x41')]=_0x39b038;if(_0x9b21a8[_0x1833('0x30')]['includeAll']){_0x2d47d0[_0x1833('0x42')]=[{'all':!![]}];}return db[_0x1833('0x40')][_0x1833('0x43')](_0x2d47d0);})[_0x1833('0x23')](function(_0x555942){_0x10aaea[_0x1833('0x44')]=_0x555942;return _0x10aaea;})[_0x1833('0x23')](respondWithFilteredResult(_0x3014a0,_0x2d47d0))[_0x1833('0x45')](handleError(_0x3014a0,null));};exports[_0x1833('0x46')]=function(_0x14b5cd,_0x15d30e){var _0x2f0646={'raw':!![],'where':{'id':_0x14b5cd[_0x1833('0x47')]['id']}},_0x3984c7={};_0x3984c7[_0x1833('0x2e')]=_[_0x1833('0x31')](db[_0x1833('0x40')][_0x1833('0x48')]);_0x3984c7['query']=_[_0x1833('0x31')](_0x14b5cd[_0x1833('0x30')]);_0x3984c7[_0x1833('0x32')]=_['intersection'](_0x3984c7[_0x1833('0x2e')],_0x3984c7[_0x1833('0x30')]);_0x2f0646[_0x1833('0x33')]=_['intersection'](_0x3984c7[_0x1833('0x2e')],qs[_0x1833('0x35')](_0x14b5cd[_0x1833('0x30')][_0x1833('0x35')]));_0x2f0646[_0x1833('0x33')]=_0x2f0646[_0x1833('0x33')][_0x1833('0x36')]?_0x2f0646[_0x1833('0x33')]:_0x3984c7[_0x1833('0x2e')];if(_0x14b5cd[_0x1833('0x30')][_0x1833('0x49')]){_0x2f0646[_0x1833('0x42')]=[{'all':!![]}];}_0x2f0646=_[_0x1833('0x3d')]({},_0x2f0646,_0x14b5cd['options']);return db['MailSubstatus'][_0x1833('0x4a')](_0x2f0646)['then'](handleEntityNotFound(_0x15d30e,null))[_0x1833('0x23')](respondWithResult(_0x15d30e,null))[_0x1833('0x45')](handleError(_0x15d30e,null));};exports['create']=function(_0xfa7f86,_0x294c27){return db[_0x1833('0x40')][_0x1833('0x4b')](_0xfa7f86['body'],{})['then'](respondWithResult(_0x294c27,0xc9))[_0x1833('0x45')](handleError(_0x294c27,null));};exports[_0x1833('0x22')]=function(_0x25a784,_0x23baa6){if(_0x25a784[_0x1833('0x4c')]['id']){delete _0x25a784[_0x1833('0x4c')]['id'];}return db[_0x1833('0x40')][_0x1833('0x4a')]({'where':{'id':_0x25a784[_0x1833('0x47')]['id']}})[_0x1833('0x23')](handleEntityNotFound(_0x23baa6,null))[_0x1833('0x23')](saveUpdates(_0x25a784['body'],null))['then'](respondWithResult(_0x23baa6,null))['catch'](handleError(_0x23baa6,null));};exports['destroy']=function(_0x30f783,_0x5062f2){return db[_0x1833('0x40')]['find']({'where':{'id':_0x30f783[_0x1833('0x47')]['id']}})['then'](handleEntityNotFound(_0x5062f2,null))['then'](removeEntity(_0x5062f2,null))['catch'](handleError(_0x5062f2,null));};exports[_0x1833('0x4d')]=function(_0x57149b,_0x334020){return db[_0x1833('0x40')][_0x1833('0x4d')]()[_0x1833('0x23')](respondWithResult(_0x334020,null))[_0x1833('0x45')](handleError(_0x334020,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 466e3fc..fa6df90 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 _0x3509=['./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0x3509,0xd5));var _0x9350=function(_0x7aef09,_0x192202){_0x7aef09=_0x7aef09-0x0;var _0x224203=_0x3509[_0x7aef09];return _0x224203;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9350('0x0'));var moment=require(_0x9350('0x1'));var BPromise=require(_0x9350('0x2'));var rp=require(_0x9350('0x3'));var fs=require('fs');var path=require(_0x9350('0x4'));var rimraf=require(_0x9350('0x5'));var config=require(_0x9350('0x6'));var attributes=require(_0x9350('0x7'));module[_0x9350('0x8')]=function(_0x51092e,_0x3c880f){return _0x51092e['define'](_0x9350('0x9'),attributes,{'tableName':_0x9350('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdaf6=['MailSubstatus','mail_substatuses','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes','exports','define'];(function(_0x29b1cc,_0x16e524){var _0x53b8e8=function(_0x18c09b){while(--_0x18c09b){_0x29b1cc['push'](_0x29b1cc['shift']());}};_0x53b8e8(++_0x16e524);}(_0xdaf6,0x154));var _0x6daf=function(_0x223ace,_0x28a4f1){_0x223ace=_0x223ace-0x0;var _0x599ef9=_0xdaf6[_0x223ace];return _0x599ef9;};'use strict';var _=require(_0x6daf('0x0'));var util=require(_0x6daf('0x1'));var logger=require('../../config/logger')(_0x6daf('0x2'));var moment=require(_0x6daf('0x3'));var BPromise=require(_0x6daf('0x4'));var rp=require(_0x6daf('0x5'));var fs=require('fs');var path=require(_0x6daf('0x6'));var rimraf=require(_0x6daf('0x7'));var config=require('../../config/environment');var attributes=require(_0x6daf('0x8'));module[_0x6daf('0x9')]=function(_0x23cdc0,_0x43a968){return _0x23cdc0[_0x6daf('0xa')](_0x6daf('0xb'),attributes,{'tableName':_0x6daf('0xc'),'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 36c2c1d..f2fb5b4 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 _0x76d2=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x20f202,_0x56a0f6){var _0x5dc122=function(_0x529113){while(--_0x529113){_0x20f202['push'](_0x20f202['shift']());}};_0x5dc122(++_0x56a0f6);}(_0x76d2,0x162));var _0x276d=function(_0x53f97e,_0x3f5141){_0x53f97e=_0x53f97e-0x0;var _0x5e5193=_0x76d2[_0x53f97e];return _0x5e5193;};'use strict';var _=require(_0x276d('0x0'));var util=require(_0x276d('0x1'));var moment=require(_0x276d('0x2'));var BPromise=require(_0x276d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x276d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x276d('0x5'));var logger=require(_0x276d('0x6'))(_0x276d('0x7'));var config=require(_0x276d('0x8'));var jayson=require(_0x276d('0x9'));var client=jayson['client'][_0x276d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x647b3b,_0x352394,_0x3b6718){return new BPromise(function(_0x2a88ce,_0x487742){return client[_0x276d('0xb')](_0x647b3b,_0x3b6718)[_0x276d('0xc')](function(_0x5b757d){logger[_0x276d('0xd')](_0x276d('0xe'),_0x352394,_0x276d('0xf'));logger[_0x276d('0x10')](_0x276d('0x11'),_0x352394,_0x276d('0xf'),JSON[_0x276d('0x12')](_0x5b757d));if(_0x5b757d[_0x276d('0x13')]){if(_0x5b757d['error']['code']===0x1f4){logger[_0x276d('0x13')](_0x276d('0xe'),_0x352394,_0x5b757d[_0x276d('0x13')]['message']);return _0x487742(_0x5b757d[_0x276d('0x13')][_0x276d('0x14')]);}logger[_0x276d('0x13')](_0x276d('0xe'),_0x352394,_0x5b757d['error'][_0x276d('0x14')]);return _0x2a88ce(_0x5b757d['error']['message']);}else{logger[_0x276d('0xd')](_0x276d('0xe'),_0x352394,_0x276d('0xf'));_0x2a88ce(_0x5b757d[_0x276d('0x15')][_0x276d('0x14')]);}})[_0x276d('0x16')](function(_0x243e8c){logger[_0x276d('0x13')](_0x276d('0xe'),_0x352394,_0x243e8c);_0x487742(_0x243e8c);});});} \ No newline at end of file +var _0x375d=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x513ad4,_0x1b64ed){var _0x1243fa=function(_0x5e3e30){while(--_0x5e3e30){_0x513ad4['push'](_0x513ad4['shift']());}};_0x1243fa(++_0x1b64ed);}(_0x375d,0x193));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xd375('0x0'));var util=require(_0xd375('0x1'));var moment=require(_0xd375('0x2'));var BPromise=require(_0xd375('0x3'));var rs=require(_0xd375('0x4'));var fs=require('fs');var Redis=require(_0xd375('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd375('0x6'));var logger=require(_0xd375('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd375('0x8'));var client=jayson[_0xd375('0x9')][_0xd375('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x483709,_0x2cefc1,_0x2e119b){return new BPromise(function(_0x18f507,_0x11bdb8){return client[_0xd375('0xb')](_0x483709,_0x2e119b)['then'](function(_0x4d3ba6){logger[_0xd375('0xc')](_0xd375('0xd'),_0x2cefc1,'request\x20sent');logger[_0xd375('0xe')](_0xd375('0xf'),_0x2cefc1,_0xd375('0x10'),JSON['stringify'](_0x4d3ba6));if(_0x4d3ba6[_0xd375('0x11')]){if(_0x4d3ba6[_0xd375('0x11')][_0xd375('0x12')]===0x1f4){logger[_0xd375('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x2cefc1,_0x4d3ba6['error'][_0xd375('0x13')]);return _0x11bdb8(_0x4d3ba6[_0xd375('0x11')][_0xd375('0x13')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2cefc1,_0x4d3ba6[_0xd375('0x11')][_0xd375('0x13')]);return _0x18f507(_0x4d3ba6['error'][_0xd375('0x13')]);}else{logger[_0xd375('0xc')](_0xd375('0xd'),_0x2cefc1,_0xd375('0x10'));_0x18f507(_0x4d3ba6['result'][_0xd375('0x13')]);}})[_0xd375('0x14')](function(_0x153fed){logger[_0xd375('0x11')](_0xd375('0xd'),_0x2cefc1,_0x153fed);_0x11bdb8(_0x153fed);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 13cf850..ffe939d 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 _0xf311=['show','post','create','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','/describe','describe','get','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf311,0x1c7));var _0x1f31=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf311[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0x1f31('0x0'));var path=require(_0x1f31('0x1'));var timeout=require('connect-timeout');var express=require(_0x1f31('0x2'));var router=express[_0x1f31('0x3')]();var fs_extra=require(_0x1f31('0x4'));var auth=require(_0x1f31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f31('0x6'));var controller=require(_0x1f31('0x7'));router['get']('/',auth[_0x1f31('0x8')](),controller['index']);router['get'](_0x1f31('0x9'),auth['isAuthenticated'](),controller[_0x1f31('0xa')]);router[_0x1f31('0xb')](_0x1f31('0xc'),auth[_0x1f31('0x8')](),controller[_0x1f31('0xd')]);router[_0x1f31('0xe')]('/',auth[_0x1f31('0x8')](),controller[_0x1f31('0xf')]);router['put'](_0x1f31('0xc'),auth[_0x1f31('0x8')](),controller['update']);router['delete']('/:id',auth[_0x1f31('0x8')](),controller[_0x1f31('0x10')]);module[_0x1f31('0x11')]=router; \ No newline at end of file +var _0xdb5a=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0xdb5a,0x103));var _0xadb5=function(_0x74263e,_0x9fa05a){_0x74263e=_0x74263e-0x0;var _0x110503=_0xdb5a[_0x74263e];return _0x110503;};'use strict';var multer=require('multer');var util=require(_0xadb5('0x0'));var path=require(_0xadb5('0x1'));var timeout=require(_0xadb5('0x2'));var express=require(_0xadb5('0x3'));var router=express[_0xadb5('0x4')]();var fs_extra=require(_0xadb5('0x5'));var auth=require(_0xadb5('0x6'));var interaction=require(_0xadb5('0x7'));var config=require(_0xadb5('0x8'));var controller=require(_0xadb5('0x9'));router['get']('/',auth[_0xadb5('0xa')](),controller[_0xadb5('0xb')]);router[_0xadb5('0xc')](_0xadb5('0xd'),auth[_0xadb5('0xa')](),controller[_0xadb5('0xe')]);router[_0xadb5('0xc')](_0xadb5('0xf'),auth[_0xadb5('0xa')](),controller[_0xadb5('0x10')]);router[_0xadb5('0x11')]('/',auth[_0xadb5('0xa')](),controller['create']);router[_0xadb5('0x12')]('/:id',auth[_0xadb5('0xa')](),controller[_0xadb5('0x13')]);router[_0xadb5('0x14')]('/:id',auth[_0xadb5('0xa')](),controller[_0xadb5('0x15')]);module[_0xadb5('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 9119f1b..3509997 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x5da67d,_0x52437d){var _0x4fe8fa=function(_0x36e703){while(--_0x36e703){_0x5da67d['push'](_0x5da67d['shift']());}};_0x4fe8fa(++_0x52437d);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x4b84[_0x4dcc2d];return _0x1bbd79;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x5e5c64,_0x19b9fb){var _0x1bf287=function(_0x19fb98){while(--_0x19fb98){_0x5e5c64['push'](_0x5e5c64['shift']());}};_0x1bf287(++_0x19b9fb);}(_0x4b84,0x1cc));var _0x44b8=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0x4b84[_0x49ad79];return _0xa4e38a;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c1663cb..3b9b315 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 _0x8874=['limit','set','Content-Range','json','apply','reject','update','then','destroy','end','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','findAll','rows','catch','show','params','fields','include','options','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count'];(function(_0x26465f,_0x382bb8){var _0x45d340=function(_0x48996a){while(--_0x48996a){_0x26465f['push'](_0x26465f['shift']());}};_0x45d340(++_0x382bb8);}(_0x8874,0x1d1));var _0x4887=function(_0x19e385,_0x37eaa1){_0x19e385=_0x19e385-0x0;var _0x329b33=_0x8874[_0x19e385];return _0x329b33;};'use strict';var emlformat=require(_0x4887('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4887('0x1'));var jsonpatch=require(_0x4887('0x2'));var rp=require(_0x4887('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4887('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4887('0x5'));var ejs=require(_0x4887('0x6'));var fs=require('fs');var fs_extra=require(_0x4887('0x7'));var _=require('lodash');var squel=require(_0x4887('0x8'));var crypto=require(_0x4887('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4887('0xa'));var toCsv=require(_0x4887('0x5'));var querystring=require(_0x4887('0xb'));var Papa=require(_0x4887('0xc'));var Redis=require(_0x4887('0xd'));var authService=require(_0x4887('0xe'));var qs=require(_0x4887('0xf'));var as=require(_0x4887('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4887('0x11'))('api');var utils=require(_0x4887('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x4887('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee3de,_0x14e124){_0x14e124=_0x14e124||0xcc;return function(_0x5356b2){if(_0x5356b2){return _0x4ee3de[_0x4887('0x14')](_0x14e124);}return _0x4ee3de[_0x4887('0x15')](_0x14e124)['end']();};}function respondWithResult(_0xd79593,_0x115385){_0x115385=_0x115385||0xc8;return function(_0xeca2ef){if(_0xeca2ef){return _0xd79593[_0x4887('0x15')](_0x115385)['json'](_0xeca2ef);}};}function respondWithFilteredResult(_0x25cff7,_0x10c190){return function(_0x3278e7){if(_0x3278e7){var _0x4a261e=typeof _0x10c190[_0x4887('0x16')]==='undefined'&&typeof _0x10c190['limit']===_0x4887('0x17');var _0x4f18a7=_0x3278e7[_0x4887('0x18')];var _0xb2a58f=_0x4a261e?0x0:_0x10c190[_0x4887('0x16')];var _0xe8f5a0=_0x4a261e?_0x3278e7[_0x4887('0x18')]:_0x10c190[_0x4887('0x16')]+_0x10c190[_0x4887('0x19')];var _0x51cd28;if(_0xe8f5a0>=_0x4f18a7){_0xe8f5a0=_0x4f18a7;_0x51cd28=0xc8;}else{_0x51cd28=0xce;}_0x25cff7[_0x4887('0x15')](_0x51cd28);return _0x25cff7[_0x4887('0x1a')](_0x4887('0x1b'),_0xb2a58f+'-'+_0xe8f5a0+'/'+_0x4f18a7)[_0x4887('0x1c')](_0x3278e7);}return null;};}function patchUpdates(_0x1e4d5b){return function(_0x19e355){try{jsonpatch[_0x4887('0x1d')](_0x19e355,_0x1e4d5b,!![]);}catch(_0xea3083){return BPromise[_0x4887('0x1e')](_0xea3083);}return _0x19e355['save']();};}function saveUpdates(_0x384753,_0x2c3477){return function(_0x5376b2){if(_0x5376b2){return _0x5376b2[_0x4887('0x1f')](_0x384753)[_0x4887('0x20')](function(_0x4f23b9){return _0x4f23b9;});}return null;};}function removeEntity(_0x35ef92,_0x1510f8){return function(_0x5ae962){if(_0x5ae962){return _0x5ae962[_0x4887('0x21')]()[_0x4887('0x20')](function(){_0x35ef92[_0x4887('0x15')](0xcc)[_0x4887('0x22')]();});}};}function handleEntityNotFound(_0x3b08c1,_0x15c986){return function(_0x4a1036){if(!_0x4a1036){_0x3b08c1[_0x4887('0x14')](0x194);}return _0x4a1036;};}function handleError(_0x5b6ae1,_0x41a3a3){_0x41a3a3=_0x41a3a3||0x1f4;return function(_0x123794){logger['error'](_0x123794[_0x4887('0x23')]);if(_0x123794[_0x4887('0x24')]){delete _0x123794[_0x4887('0x24')];}_0x5b6ae1[_0x4887('0x15')](_0x41a3a3)[_0x4887('0x25')](_0x123794);};}exports[_0x4887('0x26')]=function(_0x3c96c9,_0x9be85b){var _0x469603={},_0x57ee10={},_0x4660b2={'count':0x0,'rows':[]};var _0x516e70=_[_0x4887('0x27')](db[_0x4887('0x28')][_0x4887('0x29')],function(_0x1402d7){return{'name':_0x1402d7[_0x4887('0x2a')],'type':_0x1402d7[_0x4887('0x2b')]['key']};});_0x57ee10['model']=_[_0x4887('0x27')](_0x516e70,_0x4887('0x24'));_0x57ee10['query']=_[_0x4887('0x2c')](_0x3c96c9[_0x4887('0x2d')]);_0x57ee10['filters']=_[_0x4887('0x2e')](_0x57ee10[_0x4887('0x2f')],_0x57ee10['query']);_0x469603[_0x4887('0x30')]=_[_0x4887('0x2e')](_0x57ee10[_0x4887('0x2f')],qs['fields'](_0x3c96c9[_0x4887('0x2d')]['fields']));_0x469603[_0x4887('0x30')]=_0x469603[_0x4887('0x30')][_0x4887('0x31')]?_0x469603[_0x4887('0x30')]:_0x57ee10[_0x4887('0x2f')];if(!_0x3c96c9['query'][_0x4887('0x32')](_0x4887('0x33'))){_0x469603[_0x4887('0x19')]=qs[_0x4887('0x19')](_0x3c96c9[_0x4887('0x2d')]['limit']);_0x469603[_0x4887('0x16')]=qs[_0x4887('0x16')](_0x3c96c9['query'][_0x4887('0x16')]);}_0x469603[_0x4887('0x34')]=qs['sort'](_0x3c96c9[_0x4887('0x2d')][_0x4887('0x35')]);_0x469603[_0x4887('0x36')]=qs[_0x4887('0x37')](_[_0x4887('0x38')](_0x3c96c9[_0x4887('0x2d')],_0x57ee10[_0x4887('0x37')]),_0x516e70);if(_0x3c96c9[_0x4887('0x2d')][_0x4887('0x39')]){_0x469603[_0x4887('0x36')]=_['merge'](_0x469603['where'],{'$or':_[_0x4887('0x27')](_0x516e70,function(_0x346b30){if(_0x346b30['type']!=='VIRTUAL'){var _0x3e1818={};_0x3e1818[_0x346b30['name']]={'$like':'%'+_0x3c96c9[_0x4887('0x2d')][_0x4887('0x39')]+'%'};return _0x3e1818;}})});}_0x469603=_['merge']({},_0x469603,_0x3c96c9['options']);var _0x1e5b94={'where':_0x469603['where']};return db['MailTransferReport'][_0x4887('0x18')](_0x1e5b94)[_0x4887('0x20')](function(_0x47d9bc){_0x4660b2[_0x4887('0x18')]=_0x47d9bc;if(_0x3c96c9[_0x4887('0x2d')][_0x4887('0x3a')]){_0x469603['include']=[{'all':!![]}];}return db[_0x4887('0x28')][_0x4887('0x3b')](_0x469603);})[_0x4887('0x20')](function(_0x28d2c4){_0x4660b2[_0x4887('0x3c')]=_0x28d2c4;return _0x4660b2;})[_0x4887('0x20')](respondWithFilteredResult(_0x9be85b,_0x469603))[_0x4887('0x3d')](handleError(_0x9be85b,null));};exports[_0x4887('0x3e')]=function(_0x3c371e,_0x2cf82b){var _0x3018d5={'raw':!![],'where':{'id':_0x3c371e[_0x4887('0x3f')]['id']}},_0xab92f5={};_0xab92f5[_0x4887('0x2f')]=_['keys'](db[_0x4887('0x28')]['rawAttributes']);_0xab92f5[_0x4887('0x2d')]=_['keys'](_0x3c371e[_0x4887('0x2d')]);_0xab92f5[_0x4887('0x37')]=_['intersection'](_0xab92f5['model'],_0xab92f5[_0x4887('0x2d')]);_0x3018d5[_0x4887('0x30')]=_['intersection'](_0xab92f5[_0x4887('0x2f')],qs['fields'](_0x3c371e[_0x4887('0x2d')][_0x4887('0x40')]));_0x3018d5[_0x4887('0x30')]=_0x3018d5[_0x4887('0x30')][_0x4887('0x31')]?_0x3018d5['attributes']:_0xab92f5['model'];if(_0x3c371e[_0x4887('0x2d')][_0x4887('0x3a')]){_0x3018d5[_0x4887('0x41')]=[{'all':!![]}];}_0x3018d5=_['merge']({},_0x3018d5,_0x3c371e[_0x4887('0x42')]);return db['MailTransferReport']['find'](_0x3018d5)[_0x4887('0x20')](handleEntityNotFound(_0x2cf82b,null))[_0x4887('0x20')](respondWithResult(_0x2cf82b,null))[_0x4887('0x3d')](handleError(_0x2cf82b,null));};exports['create']=function(_0x426e56,_0x1c1188){return db[_0x4887('0x28')]['create'](_0x426e56['body'],{})[_0x4887('0x20')](respondWithResult(_0x1c1188,0xc9))[_0x4887('0x3d')](handleError(_0x1c1188,null));};exports[_0x4887('0x1f')]=function(_0x2de630,_0x38de28){if(_0x2de630['body']['id']){delete _0x2de630[_0x4887('0x43')]['id'];}return db[_0x4887('0x28')][_0x4887('0x44')]({'where':{'id':_0x2de630[_0x4887('0x3f')]['id']}})[_0x4887('0x20')](handleEntityNotFound(_0x38de28,null))[_0x4887('0x20')](saveUpdates(_0x2de630[_0x4887('0x43')],null))['then'](respondWithResult(_0x38de28,null))[_0x4887('0x3d')](handleError(_0x38de28,null));};exports[_0x4887('0x21')]=function(_0xb791bb,_0x2b6329){return db[_0x4887('0x28')][_0x4887('0x44')]({'where':{'id':_0xb791bb['params']['id']}})[_0x4887('0x20')](handleEntityNotFound(_0x2b6329,null))[_0x4887('0x20')](removeEntity(_0x2b6329,null))[_0x4887('0x3d')](handleError(_0x2b6329,null));};exports[_0x4887('0x45')]=function(_0x17edb8,_0x5d4706){return db['MailTransferReport'][_0x4887('0x45')]()[_0x4887('0x20')](respondWithResult(_0x5d4706,null))[_0x4887('0x3d')](handleError(_0x5d4706,null));}; \ No newline at end of file +var _0x6493=['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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','MailTransferReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x9bcf8d,_0x4f807c){var _0x46fcb8=function(_0x633e25){while(--_0x633e25){_0x9bcf8d['push'](_0x9bcf8d['shift']());}};_0x46fcb8(++_0x4f807c);}(_0x6493,0x1d5));var _0x3649=function(_0x5a7f64,_0x347d57){_0x5a7f64=_0x5a7f64-0x0;var _0x3d30f1=_0x6493[_0x5a7f64];return _0x3d30f1;};'use strict';var emlformat=require(_0x3649('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3649('0x1'));var jsonpatch=require(_0x3649('0x2'));var rp=require('request-promise');var moment=require(_0x3649('0x3'));var BPromise=require(_0x3649('0x4'));var Mustache=require(_0x3649('0x5'));var util=require(_0x3649('0x6'));var path=require(_0x3649('0x7'));var sox=require(_0x3649('0x8'));var csv=require(_0x3649('0x9'));var ejs=require(_0x3649('0xa'));var fs=require('fs');var fs_extra=require(_0x3649('0xb'));var _=require(_0x3649('0xc'));var squel=require(_0x3649('0xd'));var crypto=require(_0x3649('0xe'));var jsforce=require(_0x3649('0xf'));var deskjs=require(_0x3649('0x10'));var toCsv=require(_0x3649('0x9'));var querystring=require(_0x3649('0x11'));var Papa=require(_0x3649('0x12'));var Redis=require(_0x3649('0x13'));var authService=require(_0x3649('0x14'));var qs=require(_0x3649('0x15'));var as=require(_0x3649('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3649('0x17'));var utils=require(_0x3649('0x18'));var config=require(_0x3649('0x19'));var licenseUtil=require(_0x3649('0x1a'));var db=require(_0x3649('0x1b'))['db'];function respondWithStatusCode(_0x19d399,_0x50fdba){_0x50fdba=_0x50fdba||0xcc;return function(_0x20ad3d){if(_0x20ad3d){return _0x19d399[_0x3649('0x1c')](_0x50fdba);}return _0x19d399['status'](_0x50fdba)[_0x3649('0x1d')]();};}function respondWithResult(_0x1f6308,_0x2a3ac0){_0x2a3ac0=_0x2a3ac0||0xc8;return function(_0x4fc7b8){if(_0x4fc7b8){return _0x1f6308[_0x3649('0x1e')](_0x2a3ac0)[_0x3649('0x1f')](_0x4fc7b8);}};}function respondWithFilteredResult(_0x390a3a,_0x4d0514){return function(_0x2a1bcb){if(_0x2a1bcb){var _0x2918d8=typeof _0x4d0514['offset']===_0x3649('0x20')&&typeof _0x4d0514['limit']===_0x3649('0x20');var _0x101e89=_0x2a1bcb[_0x3649('0x21')];var _0xa9b29d=_0x2918d8?0x0:_0x4d0514['offset'];var _0x53efbf=_0x2918d8?_0x2a1bcb['count']:_0x4d0514[_0x3649('0x22')]+_0x4d0514[_0x3649('0x23')];var _0x552790;if(_0x53efbf>=_0x101e89){_0x53efbf=_0x101e89;_0x552790=0xc8;}else{_0x552790=0xce;}_0x390a3a[_0x3649('0x1e')](_0x552790);return _0x390a3a[_0x3649('0x24')](_0x3649('0x25'),_0xa9b29d+'-'+_0x53efbf+'/'+_0x101e89)[_0x3649('0x1f')](_0x2a1bcb);}return null;};}function patchUpdates(_0x1485e6){return function(_0x457496){try{jsonpatch[_0x3649('0x26')](_0x457496,_0x1485e6,!![]);}catch(_0x582ac5){return BPromise[_0x3649('0x27')](_0x582ac5);}return _0x457496[_0x3649('0x28')]();};}function saveUpdates(_0x3e7c54,_0xaab025){return function(_0x4e4a63){if(_0x4e4a63){return _0x4e4a63[_0x3649('0x29')](_0x3e7c54)[_0x3649('0x2a')](function(_0x59af17){return _0x59af17;});}return null;};}function removeEntity(_0x394508,_0x27ed0e){return function(_0x2bc1b8){if(_0x2bc1b8){return _0x2bc1b8[_0x3649('0x2b')]()[_0x3649('0x2a')](function(){_0x394508['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x201f3e,_0x39da3b){return function(_0x1d4126){if(!_0x1d4126){_0x201f3e['sendStatus'](0x194);}return _0x1d4126;};}function handleError(_0x90943,_0x19d21e){_0x19d21e=_0x19d21e||0x1f4;return function(_0x29c63b){logger[_0x3649('0x2c')](_0x29c63b['stack']);if(_0x29c63b[_0x3649('0x2d')]){delete _0x29c63b[_0x3649('0x2d')];}_0x90943[_0x3649('0x1e')](_0x19d21e)[_0x3649('0x2e')](_0x29c63b);};}exports[_0x3649('0x2f')]=function(_0x292125,_0x155c6c){var _0x4527b1={},_0x573ad9={},_0x59e3fe={'count':0x0,'rows':[]};var _0x46d630=_[_0x3649('0x30')](db[_0x3649('0x31')][_0x3649('0x32')],function(_0x4214be){return{'name':_0x4214be['fieldName'],'type':_0x4214be['type'][_0x3649('0x33')]};});_0x573ad9[_0x3649('0x34')]=_[_0x3649('0x30')](_0x46d630,_0x3649('0x2d'));_0x573ad9[_0x3649('0x35')]=_['keys'](_0x292125[_0x3649('0x35')]);_0x573ad9[_0x3649('0x36')]=_[_0x3649('0x37')](_0x573ad9['model'],_0x573ad9[_0x3649('0x35')]);_0x4527b1[_0x3649('0x38')]=_['intersection'](_0x573ad9[_0x3649('0x34')],qs[_0x3649('0x39')](_0x292125[_0x3649('0x35')][_0x3649('0x39')]));_0x4527b1[_0x3649('0x38')]=_0x4527b1[_0x3649('0x38')][_0x3649('0x3a')]?_0x4527b1[_0x3649('0x38')]:_0x573ad9[_0x3649('0x34')];if(!_0x292125[_0x3649('0x35')]['hasOwnProperty']('nolimit')){_0x4527b1[_0x3649('0x23')]=qs['limit'](_0x292125[_0x3649('0x35')][_0x3649('0x23')]);_0x4527b1[_0x3649('0x22')]=qs[_0x3649('0x22')](_0x292125['query']['offset']);}_0x4527b1[_0x3649('0x3b')]=qs['sort'](_0x292125[_0x3649('0x35')][_0x3649('0x3c')]);_0x4527b1['where']=qs['filters'](_[_0x3649('0x3d')](_0x292125[_0x3649('0x35')],_0x573ad9[_0x3649('0x36')]),_0x46d630);if(_0x292125[_0x3649('0x35')][_0x3649('0x3e')]){_0x4527b1[_0x3649('0x3f')]=_[_0x3649('0x40')](_0x4527b1[_0x3649('0x3f')],{'$or':_[_0x3649('0x30')](_0x46d630,function(_0x28ae67){if(_0x28ae67[_0x3649('0x41')]!==_0x3649('0x42')){var _0x2f9642={};_0x2f9642[_0x28ae67[_0x3649('0x2d')]]={'$like':'%'+_0x292125[_0x3649('0x35')][_0x3649('0x3e')]+'%'};return _0x2f9642;}})});}_0x4527b1=_[_0x3649('0x40')]({},_0x4527b1,_0x292125[_0x3649('0x43')]);var _0x7dd689={'where':_0x4527b1[_0x3649('0x3f')]};return db[_0x3649('0x31')][_0x3649('0x21')](_0x7dd689)[_0x3649('0x2a')](function(_0x175875){_0x59e3fe[_0x3649('0x21')]=_0x175875;if(_0x292125['query'][_0x3649('0x44')]){_0x4527b1[_0x3649('0x45')]=[{'all':!![]}];}return db[_0x3649('0x31')][_0x3649('0x46')](_0x4527b1);})[_0x3649('0x2a')](function(_0x300744){_0x59e3fe[_0x3649('0x47')]=_0x300744;return _0x59e3fe;})[_0x3649('0x2a')](respondWithFilteredResult(_0x155c6c,_0x4527b1))[_0x3649('0x48')](handleError(_0x155c6c,null));};exports['show']=function(_0x34b469,_0x2d0561){var _0x5034f2={'raw':!![],'where':{'id':_0x34b469[_0x3649('0x49')]['id']}},_0x513893={};_0x513893[_0x3649('0x34')]=_[_0x3649('0x4a')](db['MailTransferReport'][_0x3649('0x32')]);_0x513893[_0x3649('0x35')]=_[_0x3649('0x4a')](_0x34b469[_0x3649('0x35')]);_0x513893['filters']=_[_0x3649('0x37')](_0x513893[_0x3649('0x34')],_0x513893[_0x3649('0x35')]);_0x5034f2['attributes']=_['intersection'](_0x513893[_0x3649('0x34')],qs[_0x3649('0x39')](_0x34b469[_0x3649('0x35')]['fields']));_0x5034f2['attributes']=_0x5034f2[_0x3649('0x38')][_0x3649('0x3a')]?_0x5034f2[_0x3649('0x38')]:_0x513893[_0x3649('0x34')];if(_0x34b469[_0x3649('0x35')]['includeAll']){_0x5034f2['include']=[{'all':!![]}];}_0x5034f2=_[_0x3649('0x40')]({},_0x5034f2,_0x34b469['options']);return db['MailTransferReport']['find'](_0x5034f2)['then'](handleEntityNotFound(_0x2d0561,null))[_0x3649('0x2a')](respondWithResult(_0x2d0561,null))[_0x3649('0x48')](handleError(_0x2d0561,null));};exports[_0x3649('0x4b')]=function(_0x27c870,_0x5ca328){return db[_0x3649('0x31')][_0x3649('0x4b')](_0x27c870['body'],{})[_0x3649('0x2a')](respondWithResult(_0x5ca328,0xc9))[_0x3649('0x48')](handleError(_0x5ca328,null));};exports[_0x3649('0x29')]=function(_0x268c2a,_0x21c198){if(_0x268c2a[_0x3649('0x4c')]['id']){delete _0x268c2a[_0x3649('0x4c')]['id'];}return db[_0x3649('0x31')][_0x3649('0x4d')]({'where':{'id':_0x268c2a[_0x3649('0x49')]['id']}})[_0x3649('0x2a')](handleEntityNotFound(_0x21c198,null))[_0x3649('0x2a')](saveUpdates(_0x268c2a[_0x3649('0x4c')],null))[_0x3649('0x2a')](respondWithResult(_0x21c198,null))[_0x3649('0x48')](handleError(_0x21c198,null));};exports[_0x3649('0x2b')]=function(_0x5d3a7e,_0x454685){return db[_0x3649('0x31')][_0x3649('0x4d')]({'where':{'id':_0x5d3a7e[_0x3649('0x49')]['id']}})[_0x3649('0x2a')](handleEntityNotFound(_0x454685,null))[_0x3649('0x2a')](removeEntity(_0x454685,null))['catch'](handleError(_0x454685,null));};exports[_0x3649('0x4e')]=function(_0x183dbb,_0x172998){return db[_0x3649('0x31')][_0x3649('0x4e')]()[_0x3649('0x2a')](respondWithResult(_0x172998,null))[_0x3649('0x48')](handleError(_0x172998,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1f5deff..bf169a2 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 _0x4ff6=['MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x417a79,_0x3c69bc){var _0x384ceb=function(_0x516c33){while(--_0x516c33){_0x417a79['push'](_0x417a79['shift']());}};_0x384ceb(++_0x3c69bc);}(_0x4ff6,0xd5));var _0x64ff=function(_0x2eacbc,_0x3b2899){_0x2eacbc=_0x2eacbc-0x0;var _0x1d3bfe=_0x4ff6[_0x2eacbc];return _0x1d3bfe;};'use strict';var _=require('lodash');var util=require(_0x64ff('0x0'));var logger=require(_0x64ff('0x1'))(_0x64ff('0x2'));var moment=require(_0x64ff('0x3'));var BPromise=require(_0x64ff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64ff('0x5'));var rimraf=require(_0x64ff('0x6'));var config=require(_0x64ff('0x7'));var attributes=require(_0x64ff('0x8'));module[_0x64ff('0x9')]=function(_0x34dacd,_0x37ad86){return _0x34dacd[_0x64ff('0xa')](_0x64ff('0xb'),attributes,{'tableName':_0x64ff('0xc'),'paranoid':![],'indexes':[{'name':_0x64ff('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa276=['MailTransferReport','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa276,0x9a));var _0x6a27=function(_0xdab13,_0xef72fd){_0xdab13=_0xdab13-0x0;var _0x157745=_0xa276[_0xdab13];return _0x157745;};'use strict';var _=require('lodash');var util=require(_0x6a27('0x0'));var logger=require(_0x6a27('0x1'))('api');var moment=require(_0x6a27('0x2'));var BPromise=require(_0x6a27('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a27('0x4'));var rimraf=require(_0x6a27('0x5'));var config=require(_0x6a27('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0x6a27('0x7')]=function(_0x321087,_0x41c595){return _0x321087['define'](_0x6a27('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8ee4872..52b83b4 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 _0xd1ca=['error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3cade1,_0x3f891e){var _0x500e37=function(_0x1e4550){while(--_0x1e4550){_0x3cade1['push'](_0x3cade1['shift']());}};_0x500e37(++_0x3f891e);}(_0xd1ca,0x1e6));var _0xad1c=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd1ca[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require(_0xad1c('0x5'))(_0xad1c('0x6'));var config=require(_0xad1c('0x7'));var jayson=require(_0xad1c('0x8'));var client=jayson[_0xad1c('0x9')][_0xad1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x588d94,_0x441ab9,_0x55f184){return new BPromise(function(_0x409cb3,_0x430fdc){return client[_0xad1c('0xb')](_0x588d94,_0x55f184)[_0xad1c('0xc')](function(_0x5c1149){logger[_0xad1c('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x441ab9,'request\x20sent');logger[_0xad1c('0xe')](_0xad1c('0xf'),_0x441ab9,_0xad1c('0x10'),JSON[_0xad1c('0x11')](_0x5c1149));if(_0x5c1149[_0xad1c('0x12')]){if(_0x5c1149[_0xad1c('0x12')][_0xad1c('0x13')]===0x1f4){logger[_0xad1c('0x12')](_0xad1c('0x14'),_0x441ab9,_0x5c1149[_0xad1c('0x12')][_0xad1c('0x15')]);return _0x430fdc(_0x5c1149[_0xad1c('0x12')][_0xad1c('0x15')]);}logger[_0xad1c('0x12')](_0xad1c('0x14'),_0x441ab9,_0x5c1149[_0xad1c('0x12')][_0xad1c('0x15')]);return _0x409cb3(_0x5c1149['error'][_0xad1c('0x15')]);}else{logger['info'](_0xad1c('0x14'),_0x441ab9,_0xad1c('0x10'));_0x409cb3(_0x5c1149[_0xad1c('0x16')][_0xad1c('0x15')]);}})[_0xad1c('0x17')](function(_0x531b82){logger[_0xad1c('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x441ab9,_0x531b82);_0x430fdc(_0x531b82);});});} \ No newline at end of file +var _0xc88b=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x175729,_0x34fa7a){var _0x47c587=function(_0x7f3abb){while(--_0x7f3abb){_0x175729['push'](_0x175729['shift']());}};_0x47c587(++_0x34fa7a);}(_0xc88b,0x67));var _0xbc88=function(_0x4623dc,_0x32e87a){_0x4623dc=_0x4623dc-0x0;var _0x22b100=_0xc88b[_0x4623dc];return _0x22b100;};'use strict';var _=require(_0xbc88('0x0'));var util=require(_0xbc88('0x1'));var moment=require(_0xbc88('0x2'));var BPromise=require(_0xbc88('0x3'));var rs=require(_0xbc88('0x4'));var fs=require('fs');var Redis=require(_0xbc88('0x5'));var db=require(_0xbc88('0x6'))['db'];var utils=require(_0xbc88('0x7'));var logger=require('../../config/logger')(_0xbc88('0x8'));var config=require(_0xbc88('0x9'));var jayson=require(_0xbc88('0xa'));var client=jayson[_0xbc88('0xb')][_0xbc88('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe9e6cd,_0x494128,_0x16172a){return new BPromise(function(_0x6bb5e,_0x38d895){return client[_0xbc88('0xd')](_0xe9e6cd,_0x16172a)['then'](function(_0x52cdf5){logger[_0xbc88('0xe')](_0xbc88('0xf'),_0x494128,'request\x20sent');logger['debug'](_0xbc88('0x10'),_0x494128,'request\x20sent',JSON[_0xbc88('0x11')](_0x52cdf5));if(_0x52cdf5['error']){if(_0x52cdf5[_0xbc88('0x12')]['code']===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x494128,_0x52cdf5[_0xbc88('0x12')]['message']);return _0x38d895(_0x52cdf5[_0xbc88('0x12')][_0xbc88('0x13')]);}logger[_0xbc88('0x12')](_0xbc88('0xf'),_0x494128,_0x52cdf5[_0xbc88('0x12')][_0xbc88('0x13')]);return _0x6bb5e(_0x52cdf5[_0xbc88('0x12')][_0xbc88('0x13')]);}else{logger[_0xbc88('0xe')](_0xbc88('0xf'),_0x494128,'request\x20sent');_0x6bb5e(_0x52cdf5[_0xbc88('0x14')][_0xbc88('0x13')]);}})[_0xbc88('0x15')](function(_0x13560c){logger[_0xbc88('0x12')](_0xbc88('0xf'),_0x494128,_0x13560c);_0x38d895(_0x13560c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 20b7734..8b02c13 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 _0xee5e=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','describe','/:id','show','create'];(function(_0xb75b85,_0x26edf5){var _0x14fddd=function(_0x47fbc4){while(--_0x47fbc4){_0xb75b85['push'](_0xb75b85['shift']());}};_0x14fddd(++_0x26edf5);}(_0xee5e,0x189));var _0xeee5=function(_0x73ffb9,_0x1fa938){_0x73ffb9=_0x73ffb9-0x0;var _0x1d49ca=_0xee5e[_0x73ffb9];return _0x1d49ca;};'use strict';var multer=require('multer');var util=require(_0xeee5('0x0'));var path=require(_0xeee5('0x1'));var timeout=require(_0xeee5('0x2'));var express=require(_0xeee5('0x3'));var router=express[_0xeee5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeee5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeee5('0x6'));var controller=require(_0xeee5('0x7'));router[_0xeee5('0x8')]('/',auth['isAuthenticated'](),controller[_0xeee5('0x9')]);router[_0xeee5('0x8')]('/describe',auth[_0xeee5('0xa')](),controller[_0xeee5('0xb')]);router[_0xeee5('0x8')](_0xeee5('0xc'),auth[_0xeee5('0xa')](),controller[_0xeee5('0xd')]);router['post']('/',auth[_0xeee5('0xa')](),controller[_0xeee5('0xe')]);router['put'](_0xeee5('0xc'),auth[_0xeee5('0xa')](),controller['update']);router['delete'](_0xeee5('0xc'),auth['isAuthenticated'](),controller[_0xeee5('0xf')]);module[_0xeee5('0x10')]=router; \ No newline at end of file +var _0x0f00=['describe','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0f00,0x15a));var _0x00f0=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x0f00[_0x5ac1e5];return _0x1bccc6;};'use strict';var multer=require(_0x00f0('0x0'));var util=require(_0x00f0('0x1'));var path=require(_0x00f0('0x2'));var timeout=require(_0x00f0('0x3'));var express=require(_0x00f0('0x4'));var router=express[_0x00f0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x00f0('0x6'));var interaction=require(_0x00f0('0x7'));var config=require(_0x00f0('0x8'));var controller=require(_0x00f0('0x9'));router[_0x00f0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x00f0('0xb')]);router['get'](_0x00f0('0xc'),auth[_0x00f0('0xd')](),controller[_0x00f0('0xe')]);router[_0x00f0('0xf')]('/',auth['isAuthenticated'](),controller[_0x00f0('0x10')]);router[_0x00f0('0x11')](_0x00f0('0xc'),auth[_0x00f0('0xd')](),controller[_0x00f0('0x12')]);router['delete'](_0x00f0('0xc'),auth[_0x00f0('0xd')](),controller[_0x00f0('0x13')]);module[_0x00f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b5bebe1..4e43a5c 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 _0x80c7=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x4233e9,_0xee347d){var _0x3f1067=function(_0x506292){while(--_0x506292){_0x4233e9['push'](_0x4233e9['shift']());}};_0x3f1067(++_0xee347d);}(_0x80c7,0x8d));var _0x780c=function(_0xd9ba9a,_0x463ecd){_0xd9ba9a=_0xd9ba9a-0x0;var _0x47f35d=_0x80c7[_0xd9ba9a];return _0x47f35d;};'use strict';var Sequelize=require(_0x780c('0x0'));var moment=require(_0x780c('0x1'));module[_0x780c('0x2')]={'channel':{'type':Sequelize[_0x780c('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x780c('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x780c('0x4')},'duration':{'type':Sequelize[_0x780c('0x5')]},'enterAt':{'type':Sequelize[_0x780c('0x6')]},'exitAt':{'type':Sequelize[_0x780c('0x6')],'set':function(_0x26db15){var _0x93f0bb=moment(_0x26db15);var _0x4170ef=moment(this[_0x780c('0x7')](_0x780c('0x8')));var _0x2d858f=_0x93f0bb[_0x780c('0x9')](_0x4170ef,'seconds');this[_0x780c('0xa')](_0x780c('0xb'),_0x26db15);this['setDataValue'](_0x780c('0xc'),_0x2d858f||null);}},'data1':{'type':Sequelize[_0x780c('0x3')],'comment':_0x780c('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x780c('0xe')},'data3':{'type':Sequelize[_0x780c('0x3')],'comment':_0x780c('0xf')},'data4':{'type':Sequelize[_0x780c('0x3')],'comment':_0x780c('0x10')},'data5':{'type':Sequelize[_0x780c('0x3')],'comment':_0x780c('0x11')},'role':{'type':Sequelize[_0x780c('0x3')]},'internal':{'type':Sequelize[_0x780c('0x5')]},'uniqueid':{'type':Sequelize[_0x780c('0x3')]}}; \ No newline at end of file +var _0xe186=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x3a4738,_0x406fb8){var _0x2d2663=function(_0xbac9f){while(--_0xbac9f){_0x3a4738['push'](_0x3a4738['shift']());}};_0x2d2663(++_0x406fb8);}(_0xe186,0x146));var _0x6e18=function(_0x1459f7,_0xc230db){_0x1459f7=_0x1459f7-0x0;var _0x467233=_0xe186[_0x1459f7];return _0x467233;};'use strict';var Sequelize=require(_0x6e18('0x0'));var moment=require(_0x6e18('0x1'));module['exports']={'channel':{'type':Sequelize[_0x6e18('0x2')]},'membername':{'type':Sequelize[_0x6e18('0x2')]},'interface':{'type':Sequelize[_0x6e18('0x2')]},'type':{'type':Sequelize[_0x6e18('0x2')],'defaultValue':_0x6e18('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6e18('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x6e18('0x5')],'set':function(_0x1bafb5){var _0x1b9e15=moment(_0x1bafb5);var _0x5a2ae3=moment(this['getDataValue'](_0x6e18('0x6')));var _0x508982=_0x1b9e15[_0x6e18('0x7')](_0x5a2ae3,_0x6e18('0x8'));this[_0x6e18('0x9')](_0x6e18('0xa'),_0x1bafb5);this[_0x6e18('0x9')](_0x6e18('0xb'),_0x508982||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6e18('0xc')},'data2':{'type':Sequelize[_0x6e18('0x2')],'comment':_0x6e18('0xd')},'data3':{'type':Sequelize[_0x6e18('0x2')],'comment':_0x6e18('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x6e18('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x6e18('0x10')},'role':{'type':Sequelize[_0x6e18('0x2')]},'internal':{'type':Sequelize[_0x6e18('0x4')]},'uniqueid':{'type':Sequelize[_0x6e18('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 339ebd4..5973675 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','MemberReport','fieldName','type','model','name','keys'];(function(_0x553f94,_0xba5cb9){var _0x2caa8f=function(_0x2e6fca){while(--_0x2e6fca){_0x553f94['push'](_0x553f94['shift']());}};_0x2caa8f(++_0xba5cb9);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'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('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0xa2687b,_0x5c0dfc){var _0x30990a=function(_0x4acc95){while(--_0x4acc95){_0xa2687b['push'](_0xa2687b['shift']());}};_0x30990a(++_0x5c0dfc);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index ec8b7da..e078774 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 _0x642a=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','MemberReport','report_member','membername_interface','lodash','util','api','moment'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x642a,0x18f));var _0xa642=function(_0x40efb4,_0x317695){_0x40efb4=_0x40efb4-0x0;var _0x4c7a8e=_0x642a[_0x40efb4];return _0x4c7a8e;};'use strict';var _=require(_0xa642('0x0'));var util=require(_0xa642('0x1'));var logger=require('../../config/logger')(_0xa642('0x2'));var moment=require(_0xa642('0x3'));var BPromise=require(_0xa642('0x4'));var rp=require(_0xa642('0x5'));var fs=require('fs');var path=require(_0xa642('0x6'));var rimraf=require(_0xa642('0x7'));var config=require(_0xa642('0x8'));var attributes=require(_0xa642('0x9'));module['exports']=function(_0x249d42,_0xa2a1fa){return _0x249d42['define'](_0xa642('0xa'),attributes,{'tableName':_0xa642('0xb'),'paranoid':![],'indexes':[{'name':_0xa642('0xc'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['moment','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','report_member','membername_interface','membername','lodash','util','../../config/logger','api'];(function(_0x1b640f,_0x215390){var _0x560770=function(_0x5335ba){while(--_0x5335ba){_0x1b640f['push'](_0x1b640f['shift']());}};_0x560770(++_0x215390);}(_0x5496,0x175));var _0x6549=function(_0x16af74,_0x38d999){_0x16af74=_0x16af74-0x0;var _0x2b6453=_0x5496[_0x16af74];return _0x2b6453;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('MemberReport',attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[{'name':_0x6549('0xb'),'fields':[_0x6549('0xc'),'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 339ed40..b8a9ffd 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 _0xaa48=['result','GetMemberReport','findAll','raw','options','where','attributes','limit','include','model','map','debug','catch','CreateMemberReport','MemberReport','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5b2128,_0x2192d9){var _0x478985=function(_0x159c5d){while(--_0x159c5d){_0x5b2128['push'](_0x5b2128['shift']());}};_0x478985(++_0x2192d9);}(_0xaa48,0x15a));var _0x8aa4=function(_0x8f5f71,_0x32099b){_0x8f5f71=_0x8f5f71-0x0;var _0x2082ff=_0xaa48[_0x8f5f71];return _0x2082ff;};'use strict';var _=require(_0x8aa4('0x0'));var util=require(_0x8aa4('0x1'));var moment=require(_0x8aa4('0x2'));var BPromise=require(_0x8aa4('0x3'));var rs=require(_0x8aa4('0x4'));var fs=require('fs');var Redis=require(_0x8aa4('0x5'));var db=require(_0x8aa4('0x6'))['db'];var utils=require(_0x8aa4('0x7'));var logger=require(_0x8aa4('0x8'))(_0x8aa4('0x9'));var config=require(_0x8aa4('0xa'));var jayson=require(_0x8aa4('0xb'));var client=jayson[_0x8aa4('0xc')][_0x8aa4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x17bf06,_0x111c1d,_0x37498b){return new BPromise(function(_0xa5c92e,_0x17b04d){return client['request'](_0x17bf06,_0x37498b)[_0x8aa4('0xe')](function(_0x1e7e28){logger['info'](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));logger['debug'](_0x8aa4('0x11'),_0x111c1d,_0x8aa4('0x10'),JSON[_0x8aa4('0x12')](_0x1e7e28));if(_0x1e7e28[_0x8aa4('0x13')]){if(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x14')]===0x1f4){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0x17b04d(_0x1e7e28['error']['message']);}logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);return _0xa5c92e(_0x1e7e28[_0x8aa4('0x13')][_0x8aa4('0x15')]);}else{logger[_0x8aa4('0x16')](_0x8aa4('0xf'),_0x111c1d,_0x8aa4('0x10'));_0xa5c92e(_0x1e7e28[_0x8aa4('0x17')]['message']);}})['catch'](function(_0x5d1819){logger[_0x8aa4('0x13')](_0x8aa4('0xf'),_0x111c1d,_0x5d1819);_0x17b04d(_0x5d1819);});});}exports[_0x8aa4('0x18')]=function(_0x37cc28){var _0x5313a6=this;return new Promise(function(_0xa765ce,_0x1659d3){return db['MemberReport'][_0x8aa4('0x19')]({'raw':_0x37cc28['options']?_0x37cc28['options'][_0x8aa4('0x1a')]===undefined?!![]:![]:!![],'where':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1c')]||null:null,'attributes':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1d')]||null:null,'limit':_0x37cc28['options']?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1e')]||null:null,'include':_0x37cc28[_0x8aa4('0x1b')]?_0x37cc28[_0x8aa4('0x1b')][_0x8aa4('0x1f')]?_['map'](_0x37cc28['options']['include'],function(_0x4984f9){return{'model':db[_0x4984f9[_0x8aa4('0x20')]],'as':_0x4984f9['as'],'attributes':_0x4984f9['attributes'],'include':_0x4984f9[_0x8aa4('0x1f')]?_[_0x8aa4('0x21')](_0x4984f9[_0x8aa4('0x1f')],function(_0x387434){return{'model':db[_0x387434['model']],'as':_0x387434['as'],'attributes':_0x387434['attributes'],'include':_0x387434[_0x8aa4('0x1f')]?_['map'](_0x387434[_0x8aa4('0x1f')],function(_0x4145ed){return{'model':db[_0x4145ed['model']],'as':_0x4145ed['as'],'attributes':_0x4145ed[_0x8aa4('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39ce27){logger['info'](_0x8aa4('0x18'),_0x37cc28);logger[_0x8aa4('0x22')](_0x8aa4('0x18'),_0x37cc28,JSON[_0x8aa4('0x12')](_0x39ce27));_0xa765ce(_0x39ce27);})[_0x8aa4('0x23')](function(_0x4ba8b8){logger['error']('GetMemberReport',_0x4ba8b8[_0x8aa4('0x15')],_0x37cc28);_0x1659d3(_0x5313a6[_0x8aa4('0x13')](0x1f4,_0x4ba8b8['message']));});});};exports[_0x8aa4('0x24')]=function(_0x1f452e){var _0x3e4595=this;return new Promise(function(_0x3633d1,_0x31443b){return db[_0x8aa4('0x25')]['create'](_0x1f452e[_0x8aa4('0x26')],{'raw':_0x1f452e['options']?_0x1f452e['options'][_0x8aa4('0x1a')]===undefined?!![]:![]:!![]})[_0x8aa4('0xe')](function(_0x1cecce){logger[_0x8aa4('0x16')](_0x8aa4('0x24'),_0x1f452e);logger['debug'](_0x8aa4('0x24'),_0x1f452e,JSON[_0x8aa4('0x12')](_0x1cecce));_0x3633d1(_0x1cecce);})[_0x8aa4('0x23')](function(_0x4ba360){logger['error']('CreateMemberReport',_0x4ba360['message'],_0x1f452e);_0x31443b(_0x3e4595[_0x8aa4('0x13')](0x1f4,_0x4ba360[_0x8aa4('0x15')]));});});};exports[_0x8aa4('0x27')]=function(_0x10d821){var _0x4e3eb0=this;return new Promise(function(_0x5e85a6,_0x1765b7){return db[_0x8aa4('0x25')][_0x8aa4('0x28')](_0x10d821[_0x8aa4('0x26')],{'raw':_0x10d821[_0x8aa4('0x1b')]?_0x10d821['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d821[_0x8aa4('0x1b')]?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1c')]||null:null,'attributes':_0x10d821['options']?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1d')]||null:null,'limit':_0x10d821['options']?_0x10d821[_0x8aa4('0x1b')][_0x8aa4('0x1e')]||null:null})[_0x8aa4('0xe')](function(_0x54c6d9){logger[_0x8aa4('0x16')]('UpdateMemberReport',_0x10d821);logger['debug'](_0x8aa4('0x27'),_0x10d821,JSON['stringify'](_0x54c6d9));_0x5e85a6(_0x54c6d9);})[_0x8aa4('0x23')](function(_0x29d058){logger['error'](_0x8aa4('0x27'),_0x29d058[_0x8aa4('0x15')],_0x10d821);_0x1765b7(_0x4e3eb0[_0x8aa4('0x13')](0x1f4,_0x29d058[_0x8aa4('0x15')]));});});}; \ No newline at end of file +var _0x2c8f=['result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateMemberReport','create','body','update','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x510478,_0x171d0a){var _0xdd2188=function(_0x22e957){while(--_0x22e957){_0x510478['push'](_0x510478['shift']());}};_0xdd2188(++_0x171d0a);}(_0x2c8f,0x192));var _0xf2c8=function(_0x15436f,_0x3b136a){_0x15436f=_0x15436f-0x0;var _0x23a31c=_0x2c8f[_0x15436f];return _0x23a31c;};'use strict';var _=require('lodash');var util=require(_0xf2c8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c8('0x1'));var db=require(_0xf2c8('0x2'))['db'];var utils=require(_0xf2c8('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf2c8('0x4'));var jayson=require(_0xf2c8('0x5'));var client=jayson[_0xf2c8('0x6')][_0xf2c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2785ee,_0x4eae22,_0x475616){return new BPromise(function(_0x28cc0d,_0x4e3109){return client[_0xf2c8('0x8')](_0x2785ee,_0x475616)[_0xf2c8('0x9')](function(_0x2112fc){logger['info'](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));logger[_0xf2c8('0xc')](_0xf2c8('0xd'),_0x4eae22,_0xf2c8('0xb'),JSON[_0xf2c8('0xe')](_0x2112fc));if(_0x2112fc[_0xf2c8('0xf')]){if(_0x2112fc[_0xf2c8('0xf')]['code']===0x1f4){logger[_0xf2c8('0xf')]('MemberReport,\x20%s,\x20%s',_0x4eae22,_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);return _0x4e3109(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x2112fc['error'][_0xf2c8('0x10')]);return _0x28cc0d(_0x2112fc[_0xf2c8('0xf')][_0xf2c8('0x10')]);}else{logger[_0xf2c8('0x11')](_0xf2c8('0xa'),_0x4eae22,_0xf2c8('0xb'));_0x28cc0d(_0x2112fc[_0xf2c8('0x12')]['message']);}})[_0xf2c8('0x13')](function(_0x3cbc33){logger[_0xf2c8('0xf')](_0xf2c8('0xa'),_0x4eae22,_0x3cbc33);_0x4e3109(_0x3cbc33);});});}exports[_0xf2c8('0x14')]=function(_0x52e9d0){var _0x49a07c=this;return new Promise(function(_0x104d9d,_0x290953){return db[_0xf2c8('0x15')][_0xf2c8('0x16')]({'raw':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![],'where':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options'][_0xf2c8('0x19')]||null:null,'attributes':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0['options']['attributes']||null:null,'limit':_0x52e9d0[_0xf2c8('0x17')]?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1a')]||null:null,'include':_0x52e9d0['options']?_0x52e9d0[_0xf2c8('0x17')][_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x52e9d0[_0xf2c8('0x17')]['include'],function(_0x17956f){return{'model':db[_0x17956f[_0xf2c8('0x1d')]],'as':_0x17956f['as'],'attributes':_0x17956f[_0xf2c8('0x1e')],'include':_0x17956f[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x17956f['include'],function(_0x93707c){return{'model':db[_0x93707c['model']],'as':_0x93707c['as'],'attributes':_0x93707c[_0xf2c8('0x1e')],'include':_0x93707c[_0xf2c8('0x1b')]?_[_0xf2c8('0x1c')](_0x93707c[_0xf2c8('0x1b')],function(_0x1d2e74){return{'model':db[_0x1d2e74[_0xf2c8('0x1d')]],'as':_0x1d2e74['as'],'attributes':_0x1d2e74[_0xf2c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf2c8('0x9')](function(_0x33f1b0){logger[_0xf2c8('0x11')](_0xf2c8('0x14'),_0x52e9d0);logger[_0xf2c8('0xc')](_0xf2c8('0x14'),_0x52e9d0,JSON['stringify'](_0x33f1b0));_0x104d9d(_0x33f1b0);})[_0xf2c8('0x13')](function(_0x5146e4){logger['error'](_0xf2c8('0x14'),_0x5146e4['message'],_0x52e9d0);_0x290953(_0x49a07c[_0xf2c8('0xf')](0x1f4,_0x5146e4[_0xf2c8('0x10')]));});});};exports[_0xf2c8('0x1f')]=function(_0x10c825){var _0x123b45=this;return new Promise(function(_0x12a547,_0x27a7dc){return db['MemberReport'][_0xf2c8('0x20')](_0x10c825[_0xf2c8('0x21')],{'raw':_0x10c825[_0xf2c8('0x17')]?_0x10c825[_0xf2c8('0x17')][_0xf2c8('0x18')]===undefined?!![]:![]:!![]})[_0xf2c8('0x9')](function(_0x5e0b43){logger[_0xf2c8('0x11')]('CreateMemberReport',_0x10c825);logger[_0xf2c8('0xc')]('CreateMemberReport',_0x10c825,JSON[_0xf2c8('0xe')](_0x5e0b43));_0x12a547(_0x5e0b43);})[_0xf2c8('0x13')](function(_0x8ea71a){logger[_0xf2c8('0xf')](_0xf2c8('0x1f'),_0x8ea71a['message'],_0x10c825);_0x27a7dc(_0x123b45[_0xf2c8('0xf')](0x1f4,_0x8ea71a[_0xf2c8('0x10')]));});});};exports['UpdateMemberReport']=function(_0x309232){var _0x23f6be=this;return new Promise(function(_0x4a24e8,_0x1935c7){return db[_0xf2c8('0x15')][_0xf2c8('0x22')](_0x309232[_0xf2c8('0x21')],{'raw':_0x309232[_0xf2c8('0x17')]?_0x309232['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')][_0xf2c8('0x19')]||null:null,'attributes':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')][_0xf2c8('0x1e')]||null:null,'limit':_0x309232[_0xf2c8('0x17')]?_0x309232[_0xf2c8('0x17')]['limit']||null:null})[_0xf2c8('0x9')](function(_0x4775c6){logger[_0xf2c8('0x11')]('UpdateMemberReport',_0x309232);logger['debug']('UpdateMemberReport',_0x309232,JSON['stringify'](_0x4775c6));_0x4a24e8(_0x4775c6);})[_0xf2c8('0x13')](function(_0x49ac22){logger[_0xf2c8('0xf')]('UpdateMemberReport',_0x49ac22[_0xf2c8('0x10')],_0x309232);_0x1935c7(_0x23f6be['error'](0x1f4,_0x49ac22['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d41ac14..29a1c2b 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 _0xec12=['get','index','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xec12,0x1bf));var _0x2ec1=function(_0x4619ec,_0x4b669d){_0x4619ec=_0x4619ec-0x0;var _0x39c28d=_0xec12[_0x4619ec];return _0x39c28d;};'use strict';var multer=require(_0x2ec1('0x0'));var util=require(_0x2ec1('0x1'));var path=require('path');var timeout=require(_0x2ec1('0x2'));var express=require(_0x2ec1('0x3'));var router=express[_0x2ec1('0x4')]();var fs_extra=require(_0x2ec1('0x5'));var auth=require(_0x2ec1('0x6'));var interaction=require(_0x2ec1('0x7'));var config=require(_0x2ec1('0x8'));var controller=require('./migration.controller');router[_0x2ec1('0x9')]('/',controller[_0x2ec1('0xa')]);module[_0x2ec1('0xb')]=router; \ No newline at end of file +var _0x2636=['Router','fs-extra','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x555800,_0x489d4c){var _0x27a4ef=function(_0x22b64e){while(--_0x22b64e){_0x555800['push'](_0x555800['shift']());}};_0x27a4ef(++_0x489d4c);}(_0x2636,0x1c0));var _0x6263=function(_0x1245ea,_0x4b7749){_0x1245ea=_0x1245ea-0x0;var _0x5e2df6=_0x2636[_0x1245ea];return _0x5e2df6;};'use strict';var multer=require(_0x6263('0x0'));var util=require(_0x6263('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6263('0x2')]();var fs_extra=require(_0x6263('0x3'));var auth=require(_0x6263('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6263('0x5'));var controller=require(_0x6263('0x6'));router[_0x6263('0x7')]('/',controller[_0x6263('0x8')]);module[_0x6263('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9d62448..ce9f09a 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 _0x9cf8=['exports','STRING','version','sequelize'];(function(_0x406038,_0x1a5499){var _0x3dabcc=function(_0x13e940){while(--_0x13e940){_0x406038['push'](_0x406038['shift']());}};_0x3dabcc(++_0x1a5499);}(_0x9cf8,0x1b3));var _0x89cf=function(_0x471743,_0x2ea228){_0x471743=_0x471743-0x0;var _0x1e99bd=_0x9cf8[_0x471743];return _0x1e99bd;};'use strict';var Sequelize=require(_0x89cf('0x0'));module[_0x89cf('0x1')]={'version':{'type':Sequelize[_0x89cf('0x2')],'unique':_0x89cf('0x3')}}; \ No newline at end of file +var _0xd067=['exports','STRING','version'];(function(_0x2455d4,_0x3c14db){var _0xe7f3ed=function(_0x24a929){while(--_0x24a929){_0x2455d4['push'](_0x2455d4['shift']());}};_0xe7f3ed(++_0x3c14db);}(_0xd067,0xe7));var _0x7d06=function(_0x2a70bc,_0x740f56){_0x2a70bc=_0x2a70bc-0x0;var _0x148794=_0xd067[_0x2a70bc];return _0x148794;};'use strict';var Sequelize=require('sequelize');module[_0x7d06('0x0')]={'version':{'type':Sequelize[_0x7d06('0x1')],'unique':_0x7d06('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 587e6ed..d4fa1de 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 _0x65e6=['length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','Migration','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x1f8182,_0x4e7309){var _0x5f25e5=function(_0x2e3a92){while(--_0x2e3a92){_0x1f8182['push'](_0x1f8182['shift']());}};_0x5f25e5(++_0x4e7309);}(_0x65e6,0x1eb));var _0x665e=function(_0x59f832,_0x25dda6){_0x59f832=_0x59f832-0x0;var _0x14f85f=_0x65e6[_0x59f832];return _0x14f85f;};'use strict';var emlformat=require(_0x665e('0x0'));var rimraf=require(_0x665e('0x1'));var zipdir=require(_0x665e('0x2'));var jsonpatch=require(_0x665e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x665e('0x4'));var Mustache=require('mustache');var util=require(_0x665e('0x5'));var path=require(_0x665e('0x6'));var sox=require(_0x665e('0x7'));var csv=require(_0x665e('0x8'));var ejs=require(_0x665e('0x9'));var fs=require('fs');var fs_extra=require(_0x665e('0xa'));var _=require('lodash');var squel=require(_0x665e('0xb'));var crypto=require(_0x665e('0xc'));var jsforce=require(_0x665e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x665e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x665e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x665e('0xf'));var as=require(_0x665e('0x10'));var hardwareService=require(_0x665e('0x11'));var logger=require('../../config/logger')(_0x665e('0x12'));var utils=require(_0x665e('0x13'));var config=require(_0x665e('0x14'));var licenseUtil=require(_0x665e('0x15'));var db=require(_0x665e('0x16'))['db'];function respondWithStatusCode(_0x28d7b2,_0x4e6d8b){_0x4e6d8b=_0x4e6d8b||0xcc;return function(_0x43f499){if(_0x43f499){return _0x28d7b2['sendStatus'](_0x4e6d8b);}return _0x28d7b2[_0x665e('0x17')](_0x4e6d8b)[_0x665e('0x18')]();};}function respondWithResult(_0x21165b,_0xd8aa33){_0xd8aa33=_0xd8aa33||0xc8;return function(_0x4ad143){if(_0x4ad143){return _0x21165b[_0x665e('0x17')](_0xd8aa33)[_0x665e('0x19')](_0x4ad143);}};}function respondWithFilteredResult(_0x157254,_0x2b061e){return function(_0x17b88d){if(_0x17b88d){var _0x2e49fe=typeof _0x2b061e[_0x665e('0x1a')]==='undefined'&&typeof _0x2b061e[_0x665e('0x1b')]==='undefined';var _0x22a5b9=_0x17b88d[_0x665e('0x1c')];var _0x325a98=_0x2e49fe?0x0:_0x2b061e[_0x665e('0x1a')];var _0x3f048c=_0x2e49fe?_0x17b88d[_0x665e('0x1c')]:_0x2b061e[_0x665e('0x1a')]+_0x2b061e[_0x665e('0x1b')];var _0x46464c;if(_0x3f048c>=_0x22a5b9){_0x3f048c=_0x22a5b9;_0x46464c=0xc8;}else{_0x46464c=0xce;}_0x157254[_0x665e('0x17')](_0x46464c);return _0x157254[_0x665e('0x1d')](_0x665e('0x1e'),_0x325a98+'-'+_0x3f048c+'/'+_0x22a5b9)[_0x665e('0x19')](_0x17b88d);}return null;};}function patchUpdates(_0x124ac4){return function(_0x1e9ad1){try{jsonpatch[_0x665e('0x1f')](_0x1e9ad1,_0x124ac4,!![]);}catch(_0x13fd07){return BPromise[_0x665e('0x20')](_0x13fd07);}return _0x1e9ad1[_0x665e('0x21')]();};}function saveUpdates(_0xc92afa,_0x2540a0){return function(_0x4f52b9){if(_0x4f52b9){return _0x4f52b9[_0x665e('0x22')](_0xc92afa)[_0x665e('0x23')](function(_0x5e4bd6){return _0x5e4bd6;});}return null;};}function removeEntity(_0x39e2fb,_0x169938){return function(_0x49bfa9){if(_0x49bfa9){return _0x49bfa9[_0x665e('0x24')]()[_0x665e('0x23')](function(){_0x39e2fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4b6de,_0x27e312){return function(_0x25137a){if(!_0x25137a){_0xf4b6de[_0x665e('0x25')](0x194);}return _0x25137a;};}function handleError(_0x1f2fa5,_0x122f4a){_0x122f4a=_0x122f4a||0x1f4;return function(_0x4388bb){logger['error'](_0x4388bb[_0x665e('0x26')]);if(_0x4388bb['name']){delete _0x4388bb[_0x665e('0x27')];}_0x1f2fa5['status'](_0x122f4a)[_0x665e('0x28')](_0x4388bb);};}exports[_0x665e('0x29')]=function(_0x1ae72b,_0x537d6a){var _0xda6c4a={},_0x4292d2={},_0x591782={'count':0x0,'rows':[]};var _0x39f69b=_[_0x665e('0x2a')](db['Migration']['rawAttributes'],function(_0x55bc5d){return{'name':_0x55bc5d[_0x665e('0x2b')],'type':_0x55bc5d[_0x665e('0x2c')][_0x665e('0x2d')]};});_0x4292d2['model']=_[_0x665e('0x2a')](_0x39f69b,_0x665e('0x27'));_0x4292d2[_0x665e('0x2e')]=_[_0x665e('0x2f')](_0x1ae72b[_0x665e('0x2e')]);_0x4292d2[_0x665e('0x30')]=_[_0x665e('0x31')](_0x4292d2[_0x665e('0x32')],_0x4292d2['query']);_0xda6c4a[_0x665e('0x33')]=_[_0x665e('0x31')](_0x4292d2[_0x665e('0x32')],qs[_0x665e('0x34')](_0x1ae72b[_0x665e('0x2e')][_0x665e('0x34')]));_0xda6c4a['attributes']=_0xda6c4a['attributes'][_0x665e('0x35')]?_0xda6c4a[_0x665e('0x33')]:_0x4292d2['model'];if(!_0x1ae72b[_0x665e('0x2e')][_0x665e('0x36')](_0x665e('0x37'))){_0xda6c4a['limit']=qs[_0x665e('0x1b')](_0x1ae72b['query'][_0x665e('0x1b')]);_0xda6c4a[_0x665e('0x1a')]=qs[_0x665e('0x1a')](_0x1ae72b[_0x665e('0x2e')][_0x665e('0x1a')]);}_0xda6c4a[_0x665e('0x38')]=qs['sort'](_0x1ae72b[_0x665e('0x2e')][_0x665e('0x39')]);_0xda6c4a['where']=qs['filters'](_['pick'](_0x1ae72b[_0x665e('0x2e')],_0x4292d2[_0x665e('0x30')]),_0x39f69b);if(_0x1ae72b[_0x665e('0x2e')][_0x665e('0x3a')]){_0xda6c4a[_0x665e('0x3b')]=_[_0x665e('0x3c')](_0xda6c4a[_0x665e('0x3b')],{'$or':_[_0x665e('0x2a')](_0x39f69b,function(_0x4f23ae){if(_0x4f23ae[_0x665e('0x2c')]!==_0x665e('0x3d')){var _0x572351={};_0x572351[_0x4f23ae['name']]={'$like':'%'+_0x1ae72b[_0x665e('0x2e')]['filter']+'%'};return _0x572351;}})});}_0xda6c4a=_[_0x665e('0x3c')]({},_0xda6c4a,_0x1ae72b[_0x665e('0x3e')]);var _0x3c50a6={'where':_0xda6c4a['where']};return db['Migration']['count'](_0x3c50a6)[_0x665e('0x23')](function(_0x5c95e6){_0x591782['count']=_0x5c95e6;if(_0x1ae72b['query'][_0x665e('0x3f')]){_0xda6c4a[_0x665e('0x40')]=[{'all':!![]}];}return db[_0x665e('0x41')][_0x665e('0x42')](_0xda6c4a);})[_0x665e('0x23')](function(_0x29922d){_0x591782['rows']=_0x29922d;return _0x591782;})['then'](respondWithFilteredResult(_0x537d6a,_0xda6c4a))[_0x665e('0x43')](handleError(_0x537d6a,null));}; \ No newline at end of file +var _0x4fb4=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1e0fd0,_0x59f0a4){var _0x23c29e=function(_0x3a7dc9){while(--_0x3a7dc9){_0x1e0fd0['push'](_0x1e0fd0['shift']());}};_0x23c29e(++_0x59f0a4);}(_0x4fb4,0xfc));var _0x44fb=function(_0x5e0d88,_0x531759){_0x5e0d88=_0x5e0d88-0x0;var _0x3b091b=_0x4fb4[_0x5e0d88];return _0x3b091b;};'use strict';var emlformat=require(_0x44fb('0x0'));var rimraf=require(_0x44fb('0x1'));var zipdir=require(_0x44fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x44fb('0x3'));var moment=require(_0x44fb('0x4'));var BPromise=require(_0x44fb('0x5'));var Mustache=require(_0x44fb('0x6'));var util=require(_0x44fb('0x7'));var path=require(_0x44fb('0x8'));var sox=require('sox');var csv=require(_0x44fb('0x9'));var ejs=require(_0x44fb('0xa'));var fs=require('fs');var fs_extra=require(_0x44fb('0xb'));var _=require(_0x44fb('0xc'));var squel=require(_0x44fb('0xd'));var crypto=require(_0x44fb('0xe'));var jsforce=require(_0x44fb('0xf'));var deskjs=require(_0x44fb('0x10'));var toCsv=require(_0x44fb('0x9'));var querystring=require(_0x44fb('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x44fb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x44fb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44fb('0x14'))(_0x44fb('0x15'));var utils=require(_0x44fb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x44fb('0x17'));var db=require(_0x44fb('0x18'))['db'];function respondWithStatusCode(_0x1ab80e,_0x1b4edf){_0x1b4edf=_0x1b4edf||0xcc;return function(_0x77c7f){if(_0x77c7f){return _0x1ab80e[_0x44fb('0x19')](_0x1b4edf);}return _0x1ab80e[_0x44fb('0x1a')](_0x1b4edf)[_0x44fb('0x1b')]();};}function respondWithResult(_0x5f52d7,_0x5001e5){_0x5001e5=_0x5001e5||0xc8;return function(_0x48d1e0){if(_0x48d1e0){return _0x5f52d7[_0x44fb('0x1a')](_0x5001e5)['json'](_0x48d1e0);}};}function respondWithFilteredResult(_0x5aeb6e,_0x399d1e){return function(_0x3d40ec){if(_0x3d40ec){var _0x140981=typeof _0x399d1e['offset']==='undefined'&&typeof _0x399d1e[_0x44fb('0x1c')]===_0x44fb('0x1d');var _0x2f478f=_0x3d40ec['count'];var _0x1b990b=_0x140981?0x0:_0x399d1e[_0x44fb('0x1e')];var _0xad42b0=_0x140981?_0x3d40ec[_0x44fb('0x1f')]:_0x399d1e['offset']+_0x399d1e[_0x44fb('0x1c')];var _0x5ee404;if(_0xad42b0>=_0x2f478f){_0xad42b0=_0x2f478f;_0x5ee404=0xc8;}else{_0x5ee404=0xce;}_0x5aeb6e['status'](_0x5ee404);return _0x5aeb6e[_0x44fb('0x20')](_0x44fb('0x21'),_0x1b990b+'-'+_0xad42b0+'/'+_0x2f478f)[_0x44fb('0x22')](_0x3d40ec);}return null;};}function patchUpdates(_0x1bd0b9){return function(_0x4ee963){try{jsonpatch[_0x44fb('0x23')](_0x4ee963,_0x1bd0b9,!![]);}catch(_0x293a04){return BPromise[_0x44fb('0x24')](_0x293a04);}return _0x4ee963[_0x44fb('0x25')]();};}function saveUpdates(_0x187f2d,_0x382d8f){return function(_0x432004){if(_0x432004){return _0x432004['update'](_0x187f2d)[_0x44fb('0x26')](function(_0xd570cc){return _0xd570cc;});}return null;};}function removeEntity(_0x267666,_0x453093){return function(_0x893fb8){if(_0x893fb8){return _0x893fb8['destroy']()[_0x44fb('0x26')](function(){_0x267666[_0x44fb('0x1a')](0xcc)[_0x44fb('0x1b')]();});}};}function handleEntityNotFound(_0x25b9cb,_0x4f722c){return function(_0x2f76da){if(!_0x2f76da){_0x25b9cb[_0x44fb('0x19')](0x194);}return _0x2f76da;};}function handleError(_0x109e2e,_0x32500e){_0x32500e=_0x32500e||0x1f4;return function(_0x4a5a3a){logger[_0x44fb('0x27')](_0x4a5a3a[_0x44fb('0x28')]);if(_0x4a5a3a['name']){delete _0x4a5a3a[_0x44fb('0x29')];}_0x109e2e['status'](_0x32500e)[_0x44fb('0x2a')](_0x4a5a3a);};}exports[_0x44fb('0x2b')]=function(_0x41451d,_0x7f4e92){var _0x8c2438={},_0xaa2dcc={},_0x34a137={'count':0x0,'rows':[]};var _0x59bb16=_[_0x44fb('0x2c')](db[_0x44fb('0x2d')][_0x44fb('0x2e')],function(_0x132681){return{'name':_0x132681[_0x44fb('0x2f')],'type':_0x132681[_0x44fb('0x30')][_0x44fb('0x31')]};});_0xaa2dcc[_0x44fb('0x32')]=_[_0x44fb('0x2c')](_0x59bb16,_0x44fb('0x29'));_0xaa2dcc[_0x44fb('0x33')]=_[_0x44fb('0x34')](_0x41451d[_0x44fb('0x33')]);_0xaa2dcc['filters']=_[_0x44fb('0x35')](_0xaa2dcc['model'],_0xaa2dcc[_0x44fb('0x33')]);_0x8c2438['attributes']=_[_0x44fb('0x35')](_0xaa2dcc[_0x44fb('0x32')],qs[_0x44fb('0x36')](_0x41451d['query'][_0x44fb('0x36')]));_0x8c2438[_0x44fb('0x37')]=_0x8c2438[_0x44fb('0x37')][_0x44fb('0x38')]?_0x8c2438['attributes']:_0xaa2dcc[_0x44fb('0x32')];if(!_0x41451d['query']['hasOwnProperty']('nolimit')){_0x8c2438[_0x44fb('0x1c')]=qs['limit'](_0x41451d[_0x44fb('0x33')][_0x44fb('0x1c')]);_0x8c2438[_0x44fb('0x1e')]=qs[_0x44fb('0x1e')](_0x41451d[_0x44fb('0x33')][_0x44fb('0x1e')]);}_0x8c2438['order']=qs[_0x44fb('0x39')](_0x41451d[_0x44fb('0x33')][_0x44fb('0x39')]);_0x8c2438[_0x44fb('0x3a')]=qs[_0x44fb('0x3b')](_['pick'](_0x41451d['query'],_0xaa2dcc[_0x44fb('0x3b')]),_0x59bb16);if(_0x41451d[_0x44fb('0x33')][_0x44fb('0x3c')]){_0x8c2438['where']=_[_0x44fb('0x3d')](_0x8c2438[_0x44fb('0x3a')],{'$or':_[_0x44fb('0x2c')](_0x59bb16,function(_0x9989fa){if(_0x9989fa[_0x44fb('0x30')]!==_0x44fb('0x3e')){var _0x1eed4c={};_0x1eed4c[_0x9989fa['name']]={'$like':'%'+_0x41451d[_0x44fb('0x33')][_0x44fb('0x3c')]+'%'};return _0x1eed4c;}})});}_0x8c2438=_['merge']({},_0x8c2438,_0x41451d[_0x44fb('0x3f')]);var _0x1f9a09={'where':_0x8c2438[_0x44fb('0x3a')]};return db['Migration'][_0x44fb('0x1f')](_0x1f9a09)[_0x44fb('0x26')](function(_0x4f1f3c){_0x34a137[_0x44fb('0x1f')]=_0x4f1f3c;if(_0x41451d[_0x44fb('0x33')][_0x44fb('0x40')]){_0x8c2438[_0x44fb('0x41')]=[{'all':!![]}];}return db[_0x44fb('0x2d')][_0x44fb('0x42')](_0x8c2438);})[_0x44fb('0x26')](function(_0x34fad8){_0x34a137['rows']=_0x34fad8;return _0x34a137;})['then'](respondWithFilteredResult(_0x7f4e92,_0x8c2438))[_0x44fb('0x43')](handleError(_0x7f4e92,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 288c466..d58b130 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 _0x5a2f=['Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports'];(function(_0x3c9911,_0x36fea0){var _0xaaed05=function(_0x197953){while(--_0x197953){_0x3c9911['push'](_0x3c9911['shift']());}};_0xaaed05(++_0x36fea0);}(_0x5a2f,0x161));var _0xf5a2=function(_0x3c462e,_0x150300){_0x3c462e=_0x3c462e-0x0;var _0x42ef20=_0x5a2f[_0x3c462e];return _0x42ef20;};'use strict';var _=require(_0xf5a2('0x0'));var util=require(_0xf5a2('0x1'));var logger=require(_0xf5a2('0x2'))(_0xf5a2('0x3'));var moment=require(_0xf5a2('0x4'));var BPromise=require(_0xf5a2('0x5'));var rp=require(_0xf5a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a2('0x7'));var config=require(_0xf5a2('0x8'));var attributes=require(_0xf5a2('0x9'));module[_0xf5a2('0xa')]=function(_0x1496d8,_0x29dc60){return _0x1496d8['define'](_0xf5a2('0xb'),attributes,{'tableName':_0xf5a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18dd=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x18dd,0x82));var _0xd18d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x18dd[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd18d('0x0'));var util=require(_0xd18d('0x1'));var logger=require(_0xd18d('0x2'))(_0xd18d('0x3'));var moment=require(_0xd18d('0x4'));var BPromise=require(_0xd18d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd18d('0x6'));var config=require(_0xd18d('0x7'));var attributes=require(_0xd18d('0x8'));module[_0xd18d('0x9')]=function(_0x4ab699,_0x11e0d9){return _0x4ab699[_0xd18d('0xa')](_0xd18d('0xb'),attributes,{'tableName':'migrations','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 7422e36..84e69ae 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 _0x132f=['jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x53b989,_0x24d6b7){var _0x4b7885=function(_0x403cb9){while(--_0x403cb9){_0x53b989['push'](_0x53b989['shift']());}};_0x4b7885(++_0x24d6b7);}(_0x132f,0x182));var _0xf132=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0x132f[_0x5d61b4];return _0x183fc5;};'use strict';var _=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var moment=require(_0xf132('0x2'));var BPromise=require(_0xf132('0x3'));var rs=require(_0xf132('0x4'));var fs=require('fs');var Redis=require(_0xf132('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf132('0x6'));var logger=require(_0xf132('0x7'))(_0xf132('0x8'));var config=require(_0xf132('0x9'));var jayson=require(_0xf132('0xa'));var client=jayson['client'][_0xf132('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x280c1f,_0x533464,_0xbbfdc7){return new BPromise(function(_0x58cdf9,_0x3eed92){return client[_0xf132('0xc')](_0x280c1f,_0xbbfdc7)[_0xf132('0xd')](function(_0xa89a67){logger[_0xf132('0xe')](_0xf132('0xf'),_0x533464,_0xf132('0x10'));logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x533464,_0xf132('0x10'),JSON[_0xf132('0x11')](_0xa89a67));if(_0xa89a67[_0xf132('0x12')]){if(_0xa89a67[_0xf132('0x12')][_0xf132('0x13')]===0x1f4){logger[_0xf132('0x12')](_0xf132('0xf'),_0x533464,_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);return _0x3eed92(_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);}logger[_0xf132('0x12')]('Migration,\x20%s,\x20%s',_0x533464,_0xa89a67[_0xf132('0x12')][_0xf132('0x14')]);return _0x58cdf9(_0xa89a67['error'][_0xf132('0x14')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x533464,_0xf132('0x10'));_0x58cdf9(_0xa89a67[_0xf132('0x15')][_0xf132('0x14')]);}})['catch'](function(_0x48686e){logger[_0xf132('0x12')](_0xf132('0xf'),_0x533464,_0x48686e);_0x3eed92(_0x48686e);});});} \ No newline at end of file +var _0x3c81=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x223558,_0x282847){var _0x555a1a=function(_0x54871e){while(--_0x54871e){_0x223558['push'](_0x223558['shift']());}};_0x555a1a(++_0x282847);}(_0x3c81,0x102));var _0x13c8=function(_0x3097f9,_0x19fce1){_0x3097f9=_0x3097f9-0x0;var _0x3a7ceb=_0x3c81[_0x3097f9];return _0x3a7ceb;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('Migration,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 5d17900..20fc7fe 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 _0xf963=['/:id','post','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','get'];(function(_0xd3d4f4,_0x1d4c10){var _0x3250b7=function(_0x9d2d2d){while(--_0x9d2d2d){_0xd3d4f4['push'](_0xd3d4f4['shift']());}};_0x3250b7(++_0x1d4c10);}(_0xf963,0x11d));var _0x3f96=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf963[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x3f96('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3f96('0x1'));var express=require(_0x3f96('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3f96('0x3'));var interaction=require(_0x3f96('0x4'));var config=require(_0x3f96('0x5'));var controller=require(_0x3f96('0x6'));router['get']('/',auth[_0x3f96('0x7')](),controller['index']);router[_0x3f96('0x8')](_0x3f96('0x9'),auth[_0x3f96('0x7')](),controller['show']);router[_0x3f96('0xa')]('/',auth[_0x3f96('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3f96('0xb')]);router[_0x3f96('0xc')](_0x3f96('0x9'),auth[_0x3f96('0x7')](),controller[_0x3f96('0xd')]);module['exports']=router; \ No newline at end of file +var _0xcb1a=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra'];(function(_0x469160,_0x36aa2a){var _0x557e91=function(_0x55f240){while(--_0x55f240){_0x469160['push'](_0x469160['shift']());}};_0x557e91(++_0x36aa2a);}(_0xcb1a,0xb6));var _0xacb1=function(_0x455999,_0x271919){_0x455999=_0x455999-0x0;var _0xd2fe43=_0xcb1a[_0x455999];return _0xd2fe43;};'use strict';var multer=require(_0xacb1('0x0'));var util=require(_0xacb1('0x1'));var path=require(_0xacb1('0x2'));var timeout=require(_0xacb1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xacb1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xacb1('0x5'));var config=require(_0xacb1('0x6'));var controller=require('./network.controller');router[_0xacb1('0x7')]('/',auth[_0xacb1('0x8')](),controller[_0xacb1('0x9')]);router[_0xacb1('0x7')](_0xacb1('0xa'),auth[_0xacb1('0x8')](),controller['show']);router[_0xacb1('0xb')]('/',auth[_0xacb1('0x8')](),controller[_0xacb1('0xc')]);router[_0xacb1('0xd')](_0xacb1('0xa'),auth[_0xacb1('0x8')](),controller[_0xacb1('0xe')]);router[_0xacb1('0xf')](_0xacb1('0xa'),auth[_0xacb1('0x8')](),controller[_0xacb1('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 a7e9078..d9c660d 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 _0x5684=['sequelize','exports','ENUM','localnet','stun','turn','STRING'];(function(_0x49c7d6,_0x14c743){var _0x40c24e=function(_0x5b4227){while(--_0x5b4227){_0x49c7d6['push'](_0x49c7d6['shift']());}};_0x40c24e(++_0x14c743);}(_0x5684,0xf5));var _0x4568=function(_0x4fb240,_0x476ddc){_0x4fb240=_0x4fb240-0x0;var _0x29177e=_0x5684[_0x4fb240];return _0x29177e;};'use strict';var Sequelize=require(_0x4568('0x0'));module[_0x4568('0x1')]={'type':{'type':Sequelize[_0x4568('0x2')](_0x4568('0x3'),'externip',_0x4568('0x4'),_0x4568('0x5'))},'value':{'type':Sequelize[_0x4568('0x6')]},'username':{'type':Sequelize[_0x4568('0x6')]},'password':{'type':Sequelize[_0x4568('0x6')]}}; \ No newline at end of file +var _0x9729=['STRING','sequelize','exports','externip','turn'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9729,0x13c));var _0x9972=function(_0x50ad8e,_0x5382c8){_0x50ad8e=_0x50ad8e-0x0;var _0x3bd3e8=_0x9729[_0x50ad8e];return _0x3bd3e8;};'use strict';var Sequelize=require(_0x9972('0x0'));module[_0x9972('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0x9972('0x2'),'stun',_0x9972('0x3'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9972('0x4')]},'password':{'type':Sequelize[_0x9972('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index a18e1d0..f61481e 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 _0xfb3c=['find','create','sequelize','transaction','body','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','readFileSync','toLowerCase','chan_sip.so','toUpperCase','STUN','server/files/templates/network.ejs','format','destroy','params','/etc/asterisk/sip_xcally_%s.conf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfb3c,0x1df));var _0xcfb3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfb3c[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0xcfb3('0x0'));var rimraf=require(_0xcfb3('0x1'));var zipdir=require(_0xcfb3('0x2'));var jsonpatch=require(_0xcfb3('0x3'));var rp=require('request-promise');var moment=require(_0xcfb3('0x4'));var BPromise=require(_0xcfb3('0x5'));var Mustache=require('mustache');var util=require(_0xcfb3('0x6'));var path=require(_0xcfb3('0x7'));var sox=require('sox');var csv=require(_0xcfb3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfb3('0x9'));var _=require(_0xcfb3('0xa'));var squel=require(_0xcfb3('0xb'));var crypto=require(_0xcfb3('0xc'));var jsforce=require(_0xcfb3('0xd'));var deskjs=require(_0xcfb3('0xe'));var toCsv=require(_0xcfb3('0x8'));var querystring=require(_0xcfb3('0xf'));var Papa=require(_0xcfb3('0x10'));var Redis=require('ioredis');var authService=require(_0xcfb3('0x11'));var qs=require(_0xcfb3('0x12'));var as=require(_0xcfb3('0x13'));var hardwareService=require(_0xcfb3('0x14'));var logger=require(_0xcfb3('0x15'))(_0xcfb3('0x16'));var utils=require(_0xcfb3('0x17'));var config=require(_0xcfb3('0x18'));var licenseUtil=require(_0xcfb3('0x19'));var db=require(_0xcfb3('0x1a'))['db'];var jayson=require(_0xcfb3('0x1b'));var client=jayson[_0xcfb3('0x1c')][_0xcfb3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x324797,_0x295bcd,_0x4b41a8,_0x406f11){return new BPromise(function(_0x419ebf,_0x10ed44){var _0x5d1c65=_0x406f11||client;return _0x5d1c65[_0xcfb3('0x1e')](_0x324797,_0x4b41a8)['then'](function(_0x32281e){logger[_0xcfb3('0x1f')]('Network,\x20%s,\x20%s',_0x295bcd,_0xcfb3('0x20'));logger[_0xcfb3('0x21')](_0xcfb3('0x22'),_0x295bcd,_0xcfb3('0x20'),JSON[_0xcfb3('0x23')](_0x32281e));if(_0x32281e['error']){if(_0x32281e[_0xcfb3('0x24')][_0xcfb3('0x25')]===0x1f4){logger[_0xcfb3('0x24')](_0xcfb3('0x26'),_0x295bcd,_0x32281e['error']['message']);return _0x10ed44(_0x32281e[_0xcfb3('0x24')][_0xcfb3('0x27')]);}logger[_0xcfb3('0x24')]('Network,\x20%s,\x20%s',_0x295bcd,_0x32281e['error'][_0xcfb3('0x27')]);return _0x419ebf(_0x32281e['error'][_0xcfb3('0x27')]);}else{logger[_0xcfb3('0x1f')](_0xcfb3('0x26'),_0x295bcd,'request\x20sent');_0x419ebf(_0x32281e[_0xcfb3('0x28')]['message']);}})['catch'](function(_0x522161){logger[_0xcfb3('0x24')](_0xcfb3('0x26'),_0x295bcd,_0x522161);_0x10ed44(_0x522161);});});}function respondWithStatusCode(_0x14ae25,_0x400724){_0x400724=_0x400724||0xcc;return function(_0x79baa6){if(_0x79baa6){return _0x14ae25['sendStatus'](_0x400724);}return _0x14ae25['status'](_0x400724)[_0xcfb3('0x29')]();};}function respondWithResult(_0x292762,_0x21f1c5){_0x21f1c5=_0x21f1c5||0xc8;return function(_0x2df6c5){if(_0x2df6c5){return _0x292762[_0xcfb3('0x2a')](_0x21f1c5)[_0xcfb3('0x2b')](_0x2df6c5);}};}function respondWithFilteredResult(_0x2a9f2d,_0x50a8b8){return function(_0x3d8b4a){if(_0x3d8b4a){var _0x417e24=typeof _0x50a8b8[_0xcfb3('0x2c')]==='undefined'&&typeof _0x50a8b8[_0xcfb3('0x2d')]===_0xcfb3('0x2e');var _0xee0366=_0x3d8b4a[_0xcfb3('0x2f')];var _0x44c118=_0x417e24?0x0:_0x50a8b8[_0xcfb3('0x2c')];var _0x12c6b9=_0x417e24?_0x3d8b4a['count']:_0x50a8b8[_0xcfb3('0x2c')]+_0x50a8b8[_0xcfb3('0x2d')];var _0x34e6ac;if(_0x12c6b9>=_0xee0366){_0x12c6b9=_0xee0366;_0x34e6ac=0xc8;}else{_0x34e6ac=0xce;}_0x2a9f2d[_0xcfb3('0x2a')](_0x34e6ac);return _0x2a9f2d['set'](_0xcfb3('0x30'),_0x44c118+'-'+_0x12c6b9+'/'+_0xee0366)[_0xcfb3('0x2b')](_0x3d8b4a);}return null;};}function patchUpdates(_0x22db21){return function(_0x35ccd7){try{jsonpatch[_0xcfb3('0x31')](_0x35ccd7,_0x22db21,!![]);}catch(_0xaea3a0){return BPromise[_0xcfb3('0x32')](_0xaea3a0);}return _0x35ccd7['save']();};}function saveUpdates(_0x1b5939,_0x471670){return function(_0x102b61){if(_0x102b61){return _0x102b61[_0xcfb3('0x33')](_0x1b5939)['then'](function(_0x345c83){return _0x345c83;});}return null;};}function removeEntity(_0x4787a4,_0x57d05c){return function(_0x320f9b){if(_0x320f9b){return _0x320f9b['destroy']()[_0xcfb3('0x34')](function(){_0x4787a4[_0xcfb3('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2928d0,_0x366a80){return function(_0x5449b6){if(!_0x5449b6){_0x2928d0[_0xcfb3('0x35')](0x194);}return _0x5449b6;};}function handleError(_0x32c897,_0x3dea16){_0x3dea16=_0x3dea16||0x1f4;return function(_0x29f666){logger['error'](_0x29f666[_0xcfb3('0x36')]);if(_0x29f666['name']){delete _0x29f666[_0xcfb3('0x37')];}_0x32c897['status'](_0x3dea16)[_0xcfb3('0x38')](_0x29f666);};}exports[_0xcfb3('0x39')]=function(_0x5ded87,_0x1f4dff){var _0x2c0859={},_0xf7d4b1={},_0x3d66f9={'count':0x0,'rows':[]};var _0x360822=_[_0xcfb3('0x3a')](db[_0xcfb3('0x3b')][_0xcfb3('0x3c')],function(_0x1e2a45){return{'name':_0x1e2a45[_0xcfb3('0x3d')],'type':_0x1e2a45[_0xcfb3('0x3e')][_0xcfb3('0x3f')]};});_0xf7d4b1['model']=_[_0xcfb3('0x3a')](_0x360822,'name');_0xf7d4b1[_0xcfb3('0x40')]=_[_0xcfb3('0x41')](_0x5ded87[_0xcfb3('0x40')]);_0xf7d4b1[_0xcfb3('0x42')]=_[_0xcfb3('0x43')](_0xf7d4b1[_0xcfb3('0x44')],_0xf7d4b1['query']);_0x2c0859[_0xcfb3('0x45')]=_[_0xcfb3('0x43')](_0xf7d4b1[_0xcfb3('0x44')],qs['fields'](_0x5ded87[_0xcfb3('0x40')][_0xcfb3('0x46')]));_0x2c0859[_0xcfb3('0x45')]=_0x2c0859['attributes'][_0xcfb3('0x47')]?_0x2c0859[_0xcfb3('0x45')]:_0xf7d4b1[_0xcfb3('0x44')];if(!_0x5ded87[_0xcfb3('0x40')]['hasOwnProperty'](_0xcfb3('0x48'))){_0x2c0859[_0xcfb3('0x2d')]=qs[_0xcfb3('0x2d')](_0x5ded87[_0xcfb3('0x40')]['limit']);_0x2c0859['offset']=qs[_0xcfb3('0x2c')](_0x5ded87[_0xcfb3('0x40')][_0xcfb3('0x2c')]);}_0x2c0859['order']=qs['sort'](_0x5ded87[_0xcfb3('0x40')][_0xcfb3('0x49')]);_0x2c0859[_0xcfb3('0x4a')]=qs[_0xcfb3('0x42')](_[_0xcfb3('0x4b')](_0x5ded87[_0xcfb3('0x40')],_0xf7d4b1[_0xcfb3('0x42')]),_0x360822);if(_0x5ded87[_0xcfb3('0x40')]['filter']){_0x2c0859[_0xcfb3('0x4a')]=_[_0xcfb3('0x4c')](_0x2c0859[_0xcfb3('0x4a')],{'$or':_[_0xcfb3('0x3a')](_0x360822,function(_0x3db243){if(_0x3db243['type']!==_0xcfb3('0x4d')){var _0x310c3c={};_0x310c3c[_0x3db243[_0xcfb3('0x37')]]={'$like':'%'+_0x5ded87['query'][_0xcfb3('0x4e')]+'%'};return _0x310c3c;}})});}_0x2c0859=_['merge']({},_0x2c0859,_0x5ded87['options']);var _0x49975d={'where':_0x2c0859['where']};return db[_0xcfb3('0x3b')]['count'](_0x49975d)['then'](function(_0x37d4d4){_0x3d66f9[_0xcfb3('0x2f')]=_0x37d4d4;if(_0x5ded87[_0xcfb3('0x40')][_0xcfb3('0x4f')]){_0x2c0859[_0xcfb3('0x50')]=[{'all':!![]}];}return db[_0xcfb3('0x3b')][_0xcfb3('0x51')](_0x2c0859);})['then'](function(_0x23e82c){_0x3d66f9[_0xcfb3('0x52')]=_0x23e82c;return _0x3d66f9;})[_0xcfb3('0x34')](respondWithFilteredResult(_0x1f4dff,_0x2c0859))[_0xcfb3('0x53')](handleError(_0x1f4dff,null));};exports[_0xcfb3('0x54')]=function(_0x278854,_0x1b4cf4){var _0x3cf6c3={'raw':!![],'where':{'id':_0x278854['params']['id']}},_0x1fb745={};_0x1fb745['model']=_['keys'](db[_0xcfb3('0x3b')][_0xcfb3('0x3c')]);_0x1fb745[_0xcfb3('0x40')]=_[_0xcfb3('0x41')](_0x278854[_0xcfb3('0x40')]);_0x1fb745['filters']=_[_0xcfb3('0x43')](_0x1fb745[_0xcfb3('0x44')],_0x1fb745[_0xcfb3('0x40')]);_0x3cf6c3[_0xcfb3('0x45')]=_[_0xcfb3('0x43')](_0x1fb745[_0xcfb3('0x44')],qs[_0xcfb3('0x46')](_0x278854[_0xcfb3('0x40')][_0xcfb3('0x46')]));_0x3cf6c3[_0xcfb3('0x45')]=_0x3cf6c3[_0xcfb3('0x45')][_0xcfb3('0x47')]?_0x3cf6c3[_0xcfb3('0x45')]:_0x1fb745['model'];if(_0x278854[_0xcfb3('0x40')][_0xcfb3('0x4f')]){_0x3cf6c3[_0xcfb3('0x50')]=[{'all':!![]}];}_0x3cf6c3=_[_0xcfb3('0x4c')]({},_0x3cf6c3,_0x278854[_0xcfb3('0x55')]);return db[_0xcfb3('0x3b')][_0xcfb3('0x56')](_0x3cf6c3)['then'](handleEntityNotFound(_0x1b4cf4,null))[_0xcfb3('0x34')](respondWithResult(_0x1b4cf4,null))[_0xcfb3('0x53')](handleError(_0x1b4cf4,null));};exports[_0xcfb3('0x57')]=function(_0x510d75,_0x13cc71,_0x217a10){var _0x2f83d3;return db[_0xcfb3('0x58')][_0xcfb3('0x59')](function(_0x46ef04){return db[_0xcfb3('0x3b')][_0xcfb3('0x57')](_0x510d75[_0xcfb3('0x5a')],{'raw':!![]})[_0xcfb3('0x34')](function(_0x25768c){_0x2f83d3=_0x25768c;return db['Network']['findAll']({'where':{'type':_0x510d75[_0xcfb3('0x5a')][_0xcfb3('0x3e')]},'raw':!![]});})[_0xcfb3('0x34')](function(_0x5e6c16){if(_0x2f83d3[_0xcfb3('0x3e')]['toUpperCase']()=='STUN'){var _0xe1705b=fs['readFileSync'](path['join'](config[_0xcfb3('0x5b')],_0xcfb3('0x5c')),'utf8');var _0x87557e=ejs[_0xcfb3('0x5d')](_0xe1705b,{'networks':_0x5e6c16||[]});fs[_0xcfb3('0x5e')](_0xcfb3('0x5f'),_0x87557e);return respondWithRpcPromise(_0xcfb3('0x60'),'create',{'module':_0xcfb3('0x61')});}else if(_0x2f83d3[_0xcfb3('0x3e')]['toUpperCase']()==_0xcfb3('0x62')){var _0x54d644=fs['readFileSync'](path[_0xcfb3('0x63')](config[_0xcfb3('0x5b')],_0xcfb3('0x64')),_0xcfb3('0x65'));var _0x17ec6f=ejs[_0xcfb3('0x5d')](_0x54d644,{'networks':_0x5e6c16||[]});fs[_0xcfb3('0x5e')](_0xcfb3('0x66'),_0x17ec6f);return respondWithRpcPromise(_0xcfb3('0x60'),'create',{'module':_0xcfb3('0x61')});}else{var _0x411c73=fs[_0xcfb3('0x67')](path[_0xcfb3('0x63')](config[_0xcfb3('0x5b')],'server/files/templates/network.ejs'),_0xcfb3('0x65'));var _0x4ed820=ejs['render'](_0x411c73,{'networks':_0x5e6c16||[]});fs[_0xcfb3('0x5e')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x510d75[_0xcfb3('0x5a')]['type'][_0xcfb3('0x68')]()),_0x4ed820);return respondWithRpcPromise(_0xcfb3('0x60'),'create',{'module':_0xcfb3('0x69')});}return null;})['then'](function(){return _0x2f83d3;});})[_0xcfb3('0x34')](respondWithResult(_0x13cc71,0xc9))['catch'](handleError(_0x13cc71,null));};exports[_0xcfb3('0x33')]=function(_0x4304a8,_0x43c551,_0x24a7a4){var _0x1d5edf;return db['sequelize'][_0xcfb3('0x59')](function(_0x2a6d9e){return db[_0xcfb3('0x3b')][_0xcfb3('0x56')]({'where':{'id':_0x4304a8['params']['id']}})[_0xcfb3('0x34')](handleEntityNotFound(_0x43c551,null))[_0xcfb3('0x34')](saveUpdates(_0x4304a8[_0xcfb3('0x5a')],null))['then'](function(_0x3e9f37){if(_0x3e9f37){_0x1d5edf=_0x3e9f37;return db['Network'][_0xcfb3('0x51')]({'where':{'type':_0x1d5edf[_0xcfb3('0x3e')]},'raw':!![]});}return null;})[_0xcfb3('0x34')](function(_0xafda8e){if(_0x1d5edf[_0xcfb3('0x3e')][_0xcfb3('0x6a')]()==_0xcfb3('0x6b')){var _0x7f72c5=fs[_0xcfb3('0x67')](path['join'](config[_0xcfb3('0x5b')],_0xcfb3('0x5c')),_0xcfb3('0x65'));var _0x1a8a48=ejs[_0xcfb3('0x5d')](_0x7f72c5,{'networks':_0xafda8e||[]});fs[_0xcfb3('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x1a8a48);return respondWithRpcPromise(_0xcfb3('0x60'),_0xcfb3('0x33'),{'module':_0xcfb3('0x61')});}else if(_0x1d5edf[_0xcfb3('0x3e')][_0xcfb3('0x6a')]()=='TURN'){var _0x55fdf0=fs[_0xcfb3('0x67')](path[_0xcfb3('0x63')](config['root'],_0xcfb3('0x64')),_0xcfb3('0x65'));var _0x5a9bbc=ejs[_0xcfb3('0x5d')](_0x55fdf0,{'networks':_0xafda8e||[]});fs[_0xcfb3('0x5e')](_0xcfb3('0x66'),_0x5a9bbc);return respondWithRpcPromise(_0xcfb3('0x60'),_0xcfb3('0x33'),{'module':_0xcfb3('0x61')});}else{var _0x236183=fs[_0xcfb3('0x67')](path[_0xcfb3('0x63')](config['root'],_0xcfb3('0x6c')),'utf8');var _0x24f7eb=ejs['render'](_0x236183,{'networks':_0xafda8e||[]});fs[_0xcfb3('0x5e')](util[_0xcfb3('0x6d')]('/etc/asterisk/sip_xcally_%s.conf',_0x4304a8[_0xcfb3('0x5a')][_0xcfb3('0x3e')][_0xcfb3('0x68')]()),_0x24f7eb);return respondWithRpcPromise('Reload','update',{'module':_0xcfb3('0x69')});}return null;})['then'](function(_0x57caaf){if(_0x57caaf){return _0x1d5edf;}return null;});})[_0xcfb3('0x34')](respondWithResult(_0x43c551,null))['catch'](handleError(_0x43c551,null));};exports[_0xcfb3('0x6e')]=function(_0xb711c2,_0xeb2a8a,_0x23b9e5){var _0x20d2a7;return db['Network'][_0xcfb3('0x56')]({'where':{'id':_0xb711c2[_0xcfb3('0x6f')]['id']}})[_0xcfb3('0x34')](function(_0xab7bb0){_0x20d2a7=_0xab7bb0;return _0xab7bb0;})['then'](handleEntityNotFound(_0xeb2a8a,null))[_0xcfb3('0x34')](removeEntity(_0xeb2a8a,null))[_0xcfb3('0x34')](function(){if(_0x20d2a7){return db[_0xcfb3('0x3b')][_0xcfb3('0x51')]({'where':{'type':_0x20d2a7[_0xcfb3('0x3e')]},'raw':!![]});}})[_0xcfb3('0x34')](function(_0x129e86){if(_0x20d2a7[_0xcfb3('0x3e')]['toUpperCase']()=='STUN'){var _0x5a7ea4=fs[_0xcfb3('0x67')](path[_0xcfb3('0x63')](config[_0xcfb3('0x5b')],_0xcfb3('0x5c')),_0xcfb3('0x65'));var _0x14f093=ejs[_0xcfb3('0x5d')](_0x5a7ea4,{'networks':_0x129e86||[]});fs[_0xcfb3('0x5e')](_0xcfb3('0x5f'),_0x14f093);return respondWithRpcPromise(_0xcfb3('0x60'),_0xcfb3('0x6e'),{'module':_0xcfb3('0x61')});}else if(_0x20d2a7['type'][_0xcfb3('0x6a')]()==_0xcfb3('0x62')){var _0x15c317=fs[_0xcfb3('0x67')](path[_0xcfb3('0x63')](config[_0xcfb3('0x5b')],_0xcfb3('0x64')),_0xcfb3('0x65'));var _0x9ed212=ejs[_0xcfb3('0x5d')](_0x15c317,{'networks':_0x129e86||[]});fs[_0xcfb3('0x5e')](_0xcfb3('0x66'),_0x9ed212);return respondWithRpcPromise(_0xcfb3('0x60'),_0xcfb3('0x6e'),{'module':_0xcfb3('0x61')});}else{var _0x3d7303=fs[_0xcfb3('0x67')](path['join'](config[_0xcfb3('0x5b')],'server/files/templates/network.ejs'),_0xcfb3('0x65'));var _0x1a68c1=ejs[_0xcfb3('0x5d')](_0x3d7303,{'networks':_0x129e86||[]});fs[_0xcfb3('0x5e')](util[_0xcfb3('0x6d')](_0xcfb3('0x70'),_0xb711c2[_0xcfb3('0x5a')]['type'][_0xcfb3('0x68')]()),_0x1a68c1);return respondWithRpcPromise(_0xcfb3('0x60'),'destroy',{'module':_0xcfb3('0x69')});}return null;})[_0xcfb3('0x53')](handleError(_0xeb2a8a,null));}; \ No newline at end of file +var _0xd3ed=['include','catch','show','rawAttributes','options','create','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','root','server/files/templates/turn_multiple.ejs','utf8','server/files/templates/network.ejs','format','chan_sip.so','update','find','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','Network','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x4dec3e,_0x354fd4){var _0x58748c=function(_0x265ac8){while(--_0x265ac8){_0x4dec3e['push'](_0x4dec3e['shift']());}};_0x58748c(++_0x354fd4);}(_0xd3ed,0x15f));var _0xdd3e=function(_0x193639,_0x1d4496){_0x193639=_0x193639-0x0;var _0x13b513=_0xd3ed[_0x193639];return _0x13b513;};'use strict';var emlformat=require(_0xdd3e('0x0'));var rimraf=require(_0xdd3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd3e('0x2'));var moment=require(_0xdd3e('0x3'));var BPromise=require(_0xdd3e('0x4'));var Mustache=require(_0xdd3e('0x5'));var util=require(_0xdd3e('0x6'));var path=require(_0xdd3e('0x7'));var sox=require(_0xdd3e('0x8'));var csv=require(_0xdd3e('0x9'));var ejs=require(_0xdd3e('0xa'));var fs=require('fs');var fs_extra=require(_0xdd3e('0xb'));var _=require(_0xdd3e('0xc'));var squel=require('squel');var crypto=require(_0xdd3e('0xd'));var jsforce=require(_0xdd3e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdd3e('0x9'));var querystring=require(_0xdd3e('0xf'));var Papa=require(_0xdd3e('0x10'));var Redis=require(_0xdd3e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdd3e('0x12'));var as=require(_0xdd3e('0x13'));var hardwareService=require(_0xdd3e('0x14'));var logger=require('../../config/logger')(_0xdd3e('0x15'));var utils=require(_0xdd3e('0x16'));var config=require(_0xdd3e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd3e('0x18'))['db'];var jayson=require(_0xdd3e('0x19'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2cab0a,_0x409187,_0x228f73,_0x5dd7a4){return new BPromise(function(_0xea49c2,_0x216c9a){var _0x28e02a=_0x5dd7a4||client;return _0x28e02a['request'](_0x2cab0a,_0x228f73)['then'](function(_0x5e49ee){logger[_0xdd3e('0x1a')]('Network,\x20%s,\x20%s',_0x409187,_0xdd3e('0x1b'));logger[_0xdd3e('0x1c')](_0xdd3e('0x1d'),_0x409187,'request\x20sent',JSON[_0xdd3e('0x1e')](_0x5e49ee));if(_0x5e49ee['error']){if(_0x5e49ee['error']['code']===0x1f4){logger[_0xdd3e('0x1f')]('Network,\x20%s,\x20%s',_0x409187,_0x5e49ee['error']['message']);return _0x216c9a(_0x5e49ee['error']['message']);}logger['error'](_0xdd3e('0x20'),_0x409187,_0x5e49ee[_0xdd3e('0x1f')][_0xdd3e('0x21')]);return _0xea49c2(_0x5e49ee[_0xdd3e('0x1f')][_0xdd3e('0x21')]);}else{logger[_0xdd3e('0x1a')](_0xdd3e('0x20'),_0x409187,_0xdd3e('0x1b'));_0xea49c2(_0x5e49ee['result'][_0xdd3e('0x21')]);}})['catch'](function(_0x58a81c){logger['error'](_0xdd3e('0x20'),_0x409187,_0x58a81c);_0x216c9a(_0x58a81c);});});}function respondWithStatusCode(_0xdefd4,_0x1e121b){_0x1e121b=_0x1e121b||0xcc;return function(_0x3ed16d){if(_0x3ed16d){return _0xdefd4[_0xdd3e('0x22')](_0x1e121b);}return _0xdefd4[_0xdd3e('0x23')](_0x1e121b)[_0xdd3e('0x24')]();};}function respondWithResult(_0x2ae679,_0x31630d){_0x31630d=_0x31630d||0xc8;return function(_0x2ef400){if(_0x2ef400){return _0x2ae679[_0xdd3e('0x23')](_0x31630d)[_0xdd3e('0x25')](_0x2ef400);}};}function respondWithFilteredResult(_0x8f222d,_0x1d0813){return function(_0x8d8d4d){if(_0x8d8d4d){var _0x57dee3=typeof _0x1d0813[_0xdd3e('0x26')]===_0xdd3e('0x27')&&typeof _0x1d0813[_0xdd3e('0x28')]===_0xdd3e('0x27');var _0x210e9c=_0x8d8d4d[_0xdd3e('0x29')];var _0x3ba5ba=_0x57dee3?0x0:_0x1d0813['offset'];var _0x57ab45=_0x57dee3?_0x8d8d4d[_0xdd3e('0x29')]:_0x1d0813[_0xdd3e('0x26')]+_0x1d0813[_0xdd3e('0x28')];var _0x46c1d4;if(_0x57ab45>=_0x210e9c){_0x57ab45=_0x210e9c;_0x46c1d4=0xc8;}else{_0x46c1d4=0xce;}_0x8f222d[_0xdd3e('0x23')](_0x46c1d4);return _0x8f222d[_0xdd3e('0x2a')](_0xdd3e('0x2b'),_0x3ba5ba+'-'+_0x57ab45+'/'+_0x210e9c)[_0xdd3e('0x25')](_0x8d8d4d);}return null;};}function patchUpdates(_0x5efc6f){return function(_0x27bd0d){try{jsonpatch[_0xdd3e('0x2c')](_0x27bd0d,_0x5efc6f,!![]);}catch(_0x4cdc5e){return BPromise[_0xdd3e('0x2d')](_0x4cdc5e);}return _0x27bd0d[_0xdd3e('0x2e')]();};}function saveUpdates(_0x11bfc3,_0x14aeda){return function(_0x34b211){if(_0x34b211){return _0x34b211['update'](_0x11bfc3)[_0xdd3e('0x2f')](function(_0x5110be){return _0x5110be;});}return null;};}function removeEntity(_0x26f81b,_0x3adb45){return function(_0x10454f){if(_0x10454f){return _0x10454f[_0xdd3e('0x30')]()[_0xdd3e('0x2f')](function(){_0x26f81b['status'](0xcc)[_0xdd3e('0x24')]();});}};}function handleEntityNotFound(_0x3b7a72,_0x951ce){return function(_0xa907fe){if(!_0xa907fe){_0x3b7a72[_0xdd3e('0x22')](0x194);}return _0xa907fe;};}function handleError(_0x233e01,_0x55c436){_0x55c436=_0x55c436||0x1f4;return function(_0x172ebb){logger[_0xdd3e('0x1f')](_0x172ebb[_0xdd3e('0x31')]);if(_0x172ebb[_0xdd3e('0x32')]){delete _0x172ebb[_0xdd3e('0x32')];}_0x233e01['status'](_0x55c436)[_0xdd3e('0x33')](_0x172ebb);};}exports[_0xdd3e('0x34')]=function(_0x27a736,_0x11d24d){var _0x295dde={},_0x3c9a8c={},_0x4a980b={'count':0x0,'rows':[]};var _0x1afb4b=_[_0xdd3e('0x35')](db[_0xdd3e('0x36')]['rawAttributes'],function(_0x391903){return{'name':_0x391903['fieldName'],'type':_0x391903[_0xdd3e('0x37')]['key']};});_0x3c9a8c['model']=_[_0xdd3e('0x35')](_0x1afb4b,_0xdd3e('0x32'));_0x3c9a8c[_0xdd3e('0x38')]=_[_0xdd3e('0x39')](_0x27a736['query']);_0x3c9a8c[_0xdd3e('0x3a')]=_[_0xdd3e('0x3b')](_0x3c9a8c[_0xdd3e('0x3c')],_0x3c9a8c[_0xdd3e('0x38')]);_0x295dde[_0xdd3e('0x3d')]=_['intersection'](_0x3c9a8c['model'],qs[_0xdd3e('0x3e')](_0x27a736[_0xdd3e('0x38')][_0xdd3e('0x3e')]));_0x295dde['attributes']=_0x295dde[_0xdd3e('0x3d')]['length']?_0x295dde[_0xdd3e('0x3d')]:_0x3c9a8c['model'];if(!_0x27a736[_0xdd3e('0x38')][_0xdd3e('0x3f')](_0xdd3e('0x40'))){_0x295dde[_0xdd3e('0x28')]=qs[_0xdd3e('0x28')](_0x27a736['query'][_0xdd3e('0x28')]);_0x295dde['offset']=qs[_0xdd3e('0x26')](_0x27a736[_0xdd3e('0x38')]['offset']);}_0x295dde[_0xdd3e('0x41')]=qs[_0xdd3e('0x42')](_0x27a736[_0xdd3e('0x38')]['sort']);_0x295dde[_0xdd3e('0x43')]=qs[_0xdd3e('0x3a')](_[_0xdd3e('0x44')](_0x27a736['query'],_0x3c9a8c[_0xdd3e('0x3a')]),_0x1afb4b);if(_0x27a736[_0xdd3e('0x38')][_0xdd3e('0x45')]){_0x295dde[_0xdd3e('0x43')]=_[_0xdd3e('0x46')](_0x295dde[_0xdd3e('0x43')],{'$or':_[_0xdd3e('0x35')](_0x1afb4b,function(_0x445ab6){if(_0x445ab6[_0xdd3e('0x37')]!==_0xdd3e('0x47')){var _0x138420={};_0x138420[_0x445ab6[_0xdd3e('0x32')]]={'$like':'%'+_0x27a736[_0xdd3e('0x38')][_0xdd3e('0x45')]+'%'};return _0x138420;}})});}_0x295dde=_['merge']({},_0x295dde,_0x27a736['options']);var _0x4a7dc3={'where':_0x295dde['where']};return db['Network'][_0xdd3e('0x29')](_0x4a7dc3)[_0xdd3e('0x2f')](function(_0x39678e){_0x4a980b['count']=_0x39678e;if(_0x27a736['query'][_0xdd3e('0x48')]){_0x295dde[_0xdd3e('0x49')]=[{'all':!![]}];}return db[_0xdd3e('0x36')]['findAll'](_0x295dde);})[_0xdd3e('0x2f')](function(_0x29bfbc){_0x4a980b['rows']=_0x29bfbc;return _0x4a980b;})[_0xdd3e('0x2f')](respondWithFilteredResult(_0x11d24d,_0x295dde))[_0xdd3e('0x4a')](handleError(_0x11d24d,null));};exports[_0xdd3e('0x4b')]=function(_0x35edee,_0x4f7157){var _0x526f99={'raw':!![],'where':{'id':_0x35edee['params']['id']}},_0x4a854d={};_0x4a854d['model']=_['keys'](db['Network'][_0xdd3e('0x4c')]);_0x4a854d[_0xdd3e('0x38')]=_[_0xdd3e('0x39')](_0x35edee[_0xdd3e('0x38')]);_0x4a854d['filters']=_[_0xdd3e('0x3b')](_0x4a854d[_0xdd3e('0x3c')],_0x4a854d[_0xdd3e('0x38')]);_0x526f99[_0xdd3e('0x3d')]=_['intersection'](_0x4a854d[_0xdd3e('0x3c')],qs[_0xdd3e('0x3e')](_0x35edee['query']['fields']));_0x526f99[_0xdd3e('0x3d')]=_0x526f99[_0xdd3e('0x3d')]['length']?_0x526f99[_0xdd3e('0x3d')]:_0x4a854d[_0xdd3e('0x3c')];if(_0x35edee[_0xdd3e('0x38')][_0xdd3e('0x48')]){_0x526f99[_0xdd3e('0x49')]=[{'all':!![]}];}_0x526f99=_[_0xdd3e('0x46')]({},_0x526f99,_0x35edee[_0xdd3e('0x4d')]);return db[_0xdd3e('0x36')]['find'](_0x526f99)['then'](handleEntityNotFound(_0x4f7157,null))[_0xdd3e('0x2f')](respondWithResult(_0x4f7157,null))[_0xdd3e('0x4a')](handleError(_0x4f7157,null));};exports[_0xdd3e('0x4e')]=function(_0x49bf38,_0x5f2f69,_0x7f707e){var _0x311950;return db[_0xdd3e('0x4f')][_0xdd3e('0x50')](function(_0x4d1a04){return db['Network'][_0xdd3e('0x4e')](_0x49bf38[_0xdd3e('0x51')],{'raw':!![]})[_0xdd3e('0x2f')](function(_0x513b5f){_0x311950=_0x513b5f;return db[_0xdd3e('0x36')][_0xdd3e('0x52')]({'where':{'type':_0x49bf38['body'][_0xdd3e('0x37')]},'raw':!![]});})[_0xdd3e('0x2f')](function(_0x4e7b70){if(_0x311950['type'][_0xdd3e('0x53')]()==_0xdd3e('0x54')){var _0x1ef161=fs[_0xdd3e('0x55')](path[_0xdd3e('0x56')](config['root'],_0xdd3e('0x57')),'utf8');var _0xc22c9b=ejs[_0xdd3e('0x58')](_0x1ef161,{'networks':_0x4e7b70||[]});fs[_0xdd3e('0x59')](_0xdd3e('0x5a'),_0xc22c9b);return respondWithRpcPromise(_0xdd3e('0x5b'),'create',{'module':_0xdd3e('0x5c')});}else if(_0x311950[_0xdd3e('0x37')][_0xdd3e('0x53')]()==_0xdd3e('0x5d')){var _0x1529b9=fs['readFileSync'](path[_0xdd3e('0x56')](config[_0xdd3e('0x5e')],_0xdd3e('0x5f')),_0xdd3e('0x60'));var _0x2b0444=ejs['render'](_0x1529b9,{'networks':_0x4e7b70||[]});fs[_0xdd3e('0x59')]('/etc/asterisk/turn_xcally.conf',_0x2b0444);return respondWithRpcPromise(_0xdd3e('0x5b'),_0xdd3e('0x4e'),{'module':_0xdd3e('0x5c')});}else{var _0x35fe97=fs[_0xdd3e('0x55')](path[_0xdd3e('0x56')](config[_0xdd3e('0x5e')],_0xdd3e('0x61')),_0xdd3e('0x60'));var _0xfaca63=ejs[_0xdd3e('0x58')](_0x35fe97,{'networks':_0x4e7b70||[]});fs[_0xdd3e('0x59')](util[_0xdd3e('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x49bf38[_0xdd3e('0x51')][_0xdd3e('0x37')]['toLowerCase']()),_0xfaca63);return respondWithRpcPromise(_0xdd3e('0x5b'),_0xdd3e('0x4e'),{'module':_0xdd3e('0x63')});}return null;})[_0xdd3e('0x2f')](function(){return _0x311950;});})[_0xdd3e('0x2f')](respondWithResult(_0x5f2f69,0xc9))['catch'](handleError(_0x5f2f69,null));};exports[_0xdd3e('0x64')]=function(_0x3cfd7f,_0x1abfce,_0x33edf6){var _0x2bd9c5;return db[_0xdd3e('0x4f')]['transaction'](function(_0x201129){return db[_0xdd3e('0x36')][_0xdd3e('0x65')]({'where':{'id':_0x3cfd7f['params']['id']}})[_0xdd3e('0x2f')](handleEntityNotFound(_0x1abfce,null))[_0xdd3e('0x2f')](saveUpdates(_0x3cfd7f[_0xdd3e('0x51')],null))['then'](function(_0x37d813){if(_0x37d813){_0x2bd9c5=_0x37d813;return db[_0xdd3e('0x36')]['findAll']({'where':{'type':_0x2bd9c5['type']},'raw':!![]});}return null;})[_0xdd3e('0x2f')](function(_0x85dcde){if(_0x2bd9c5[_0xdd3e('0x37')]['toUpperCase']()=='STUN'){var _0xd38693=fs['readFileSync'](path['join'](config[_0xdd3e('0x5e')],'server/files/templates/stun_multiple.ejs'),_0xdd3e('0x60'));var _0x3e6cd9=ejs[_0xdd3e('0x58')](_0xd38693,{'networks':_0x85dcde||[]});fs['writeFileSync'](_0xdd3e('0x5a'),_0x3e6cd9);return respondWithRpcPromise('Reload',_0xdd3e('0x64'),{'module':_0xdd3e('0x5c')});}else if(_0x2bd9c5['type'][_0xdd3e('0x53')]()=='TURN'){var _0x11cb62=fs['readFileSync'](path[_0xdd3e('0x56')](config[_0xdd3e('0x5e')],_0xdd3e('0x5f')),_0xdd3e('0x60'));var _0x2d7077=ejs[_0xdd3e('0x58')](_0x11cb62,{'networks':_0x85dcde||[]});fs[_0xdd3e('0x59')](_0xdd3e('0x66'),_0x2d7077);return respondWithRpcPromise(_0xdd3e('0x5b'),_0xdd3e('0x64'),{'module':_0xdd3e('0x5c')});}else{var _0x50b260=fs['readFileSync'](path[_0xdd3e('0x56')](config[_0xdd3e('0x5e')],'server/files/templates/network.ejs'),'utf8');var _0x6f20b4=ejs[_0xdd3e('0x58')](_0x50b260,{'networks':_0x85dcde||[]});fs['writeFileSync'](util[_0xdd3e('0x62')](_0xdd3e('0x67'),_0x3cfd7f[_0xdd3e('0x51')][_0xdd3e('0x37')][_0xdd3e('0x68')]()),_0x6f20b4);return respondWithRpcPromise(_0xdd3e('0x5b'),_0xdd3e('0x64'),{'module':_0xdd3e('0x63')});}return null;})[_0xdd3e('0x2f')](function(_0x1be454){if(_0x1be454){return _0x2bd9c5;}return null;});})[_0xdd3e('0x2f')](respondWithResult(_0x1abfce,null))[_0xdd3e('0x4a')](handleError(_0x1abfce,null));};exports[_0xdd3e('0x30')]=function(_0x3c40d0,_0x46e898,_0x1a19b9){var _0x527789;return db[_0xdd3e('0x36')][_0xdd3e('0x65')]({'where':{'id':_0x3c40d0[_0xdd3e('0x69')]['id']}})[_0xdd3e('0x2f')](function(_0x543587){_0x527789=_0x543587;return _0x543587;})['then'](handleEntityNotFound(_0x46e898,null))[_0xdd3e('0x2f')](removeEntity(_0x46e898,null))['then'](function(){if(_0x527789){return db['Network'][_0xdd3e('0x52')]({'where':{'type':_0x527789[_0xdd3e('0x37')]},'raw':!![]});}})[_0xdd3e('0x2f')](function(_0x3b32ff){if(_0x527789[_0xdd3e('0x37')][_0xdd3e('0x53')]()=='STUN'){var _0xe63e34=fs[_0xdd3e('0x55')](path[_0xdd3e('0x56')](config['root'],_0xdd3e('0x57')),_0xdd3e('0x60'));var _0x2588eb=ejs[_0xdd3e('0x58')](_0xe63e34,{'networks':_0x3b32ff||[]});fs[_0xdd3e('0x59')]('/etc/asterisk/stun_xcally.conf',_0x2588eb);return respondWithRpcPromise('Reload','destroy',{'module':'res_stun_monitor.so'});}else if(_0x527789[_0xdd3e('0x37')]['toUpperCase']()==_0xdd3e('0x5d')){var _0x309677=fs[_0xdd3e('0x55')](path['join'](config[_0xdd3e('0x5e')],_0xdd3e('0x5f')),'utf8');var _0x4ea757=ejs['render'](_0x309677,{'networks':_0x3b32ff||[]});fs['writeFileSync'](_0xdd3e('0x66'),_0x4ea757);return respondWithRpcPromise(_0xdd3e('0x5b'),'destroy',{'module':_0xdd3e('0x5c')});}else{var _0x39a26b=fs['readFileSync'](path[_0xdd3e('0x56')](config[_0xdd3e('0x5e')],'server/files/templates/network.ejs'),_0xdd3e('0x60'));var _0x31acef=ejs[_0xdd3e('0x58')](_0x39a26b,{'networks':_0x3b32ff||[]});fs[_0xdd3e('0x59')](util[_0xdd3e('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x3c40d0['body'][_0xdd3e('0x37')]['toLowerCase']()),_0x31acef);return respondWithRpcPromise('Reload',_0xdd3e('0x30'),{'module':_0xdd3e('0x63')});}return null;})[_0xdd3e('0x4a')](handleError(_0x46e898,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 8cd01f1..c759cb7 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 _0x2f68=['Network','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0x2f68,0x9a));var _0x82f6=function(_0x12a993,_0x303382){_0x12a993=_0x12a993-0x0;var _0x5dd475=_0x2f68[_0x12a993];return _0x5dd475;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var moment=require(_0x82f6('0x3'));var BPromise=require('bluebird');var rp=require(_0x82f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var attributes=require('./network.attributes');module[_0x82f6('0x7')]=function(_0x2c4302,_0x542737){return _0x2c4302['define'](_0x82f6('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd139=['rimraf','../../config/environment','./network.attributes','Network','lodash','util','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd139,0x14e));var _0x9d13=function(_0x1c5545,_0x53be36){_0x1c5545=_0x1c5545-0x0;var _0x203365=_0xd139[_0x1c5545];return _0x203365;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 36a0e8f..c2ea401 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x2795ed,_0x6d66ff){_0x2795ed=_0x2795ed-0x0;var _0x126d68=_0x7a54[_0x2795ed];return _0x126d68;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1d7ed7,_0x82bdc6){_0x1d7ed7=_0x1d7ed7-0x0;var _0x4d1e2c=_0x7a54[_0x1d7ed7];return _0x4d1e2c;};'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 45eb4b1..ed5e1f0 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 _0xd4d6=['post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','fs-extra','./openchannelAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xd4d6,0x142));var _0x6d4d=function(_0x141f49,_0x8fcf89){_0x141f49=_0x141f49-0x0;var _0x49aab3=_0xd4d6[_0x141f49];return _0x49aab3;};'use strict';var multer=require(_0x6d4d('0x0'));var util=require(_0x6d4d('0x1'));var path=require(_0x6d4d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6d4d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d4d('0x4'));router[_0x6d4d('0x5')]('/',auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x7')]);router[_0x6d4d('0x5')]('/describe',auth[_0x6d4d('0x6')](),controller['describe']);router[_0x6d4d('0x5')](_0x6d4d('0x8'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x9')]);router[_0x6d4d('0x5')](_0x6d4d('0xa'),auth[_0x6d4d('0x6')](),controller['getDispositions']);router[_0x6d4d('0x5')](_0x6d4d('0xb'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0xc')]);router[_0x6d4d('0x5')](_0x6d4d('0xd'),auth['isAuthenticated'](),controller[_0x6d4d('0xe')]);router[_0x6d4d('0x5')]('/:id/interactions',auth[_0x6d4d('0x6')](),controller[_0x6d4d('0xf')]);router[_0x6d4d('0x5')](_0x6d4d('0x10'),auth['isAuthenticated'](),controller[_0x6d4d('0x11')]);router[_0x6d4d('0x12')]('/',auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x13')]);router[_0x6d4d('0x12')](_0x6d4d('0xa'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x14')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6d4d('0x15')]);router[_0x6d4d('0x12')](_0x6d4d('0x16'),controller[_0x6d4d('0x17')]);router[_0x6d4d('0x12')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6d4d('0x18')]);router['post'](_0x6d4d('0x10'),auth[_0x6d4d('0x6')](),controller['addAgents']);router['post'](_0x6d4d('0x19'),auth[_0x6d4d('0x6')](),controller['send']);router[_0x6d4d('0x1a')](_0x6d4d('0x8'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x1b')]);router[_0x6d4d('0x1c')]('/:id',auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x1d')]);router[_0x6d4d('0x1c')](_0x6d4d('0xa'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x1e')]);router[_0x6d4d('0x1c')]('/:id/canned_answers',auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x1f')]);router[_0x6d4d('0x1c')](_0x6d4d('0x10'),auth[_0x6d4d('0x6')](),controller[_0x6d4d('0x20')]);module[_0x6d4d('0x21')]=router; \ No newline at end of file +var _0x6c8d=['removeAnswers','delete','removeAgents','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','/:id','destroy'];(function(_0x4eaf5f,_0x54e040){var _0xe32116=function(_0x568259){while(--_0x568259){_0x4eaf5f['push'](_0x4eaf5f['shift']());}};_0xe32116(++_0x54e040);}(_0x6c8d,0x185));var _0xd6c8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6c8d[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xd6c8('0x0'));var util=require('util');var path=require(_0xd6c8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd6c8('0x2')]();var fs_extra=require(_0xd6c8('0x3'));var auth=require(_0xd6c8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd6c8('0x5'));var controller=require(_0xd6c8('0x6'));router[_0xd6c8('0x7')]('/',auth['isAuthenticated'](),controller[_0xd6c8('0x8')]);router[_0xd6c8('0x7')](_0xd6c8('0x9'),auth[_0xd6c8('0xa')](),controller['describe']);router[_0xd6c8('0x7')]('/:id',auth[_0xd6c8('0xa')](),controller[_0xd6c8('0xb')]);router['get'](_0xd6c8('0xc'),auth['isAuthenticated'](),controller[_0xd6c8('0xd')]);router[_0xd6c8('0x7')](_0xd6c8('0xe'),auth[_0xd6c8('0xa')](),controller['getAnswers']);router[_0xd6c8('0x7')](_0xd6c8('0xf'),auth[_0xd6c8('0xa')](),controller['getApplications']);router['get'](_0xd6c8('0x10'),auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x11')]);router['get']('/:id/users',auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x12')]);router['post']('/',auth[_0xd6c8('0xa')](),controller['create']);router[_0xd6c8('0x13')](_0xd6c8('0xc'),auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x14')]);router[_0xd6c8('0x13')](_0xd6c8('0xe'),auth['isAuthenticated'](),controller[_0xd6c8('0x15')]);router[_0xd6c8('0x13')](_0xd6c8('0x16'),controller[_0xd6c8('0x17')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xd6c8('0x18')]);router[_0xd6c8('0x13')]('/:id/users',auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x19')]);router[_0xd6c8('0x13')](_0xd6c8('0x1a'),auth['isAuthenticated'](),controller[_0xd6c8('0x1b')]);router[_0xd6c8('0x1c')](_0xd6c8('0x1d'),auth[_0xd6c8('0xa')](),controller['update']);router['delete'](_0xd6c8('0x1d'),auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x1e')]);router['delete'](_0xd6c8('0xc'),auth[_0xd6c8('0xa')](),controller['removeDispositions']);router['delete'](_0xd6c8('0xe'),auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x1f')]);router[_0xd6c8('0x20')]('/:id/users',auth[_0xd6c8('0xa')](),controller[_0xd6c8('0x21')]);module[_0xd6c8('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3c521a6..1ce7805 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 _0xf156=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xf156,0x1be));var _0x6f15=function(_0x4cd47f,_0x14896b){_0x4cd47f=_0x4cd47f-0x0;var _0x10fd90=_0xf156[_0x4cd47f];return _0x10fd90;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6f15('0x0'));module[_0x6f15('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6f15('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6f15('0x3')]},'token':{'type':Sequelize[_0x6f15('0x3')],'defaultValue':function(){return rs[_0x6f15('0x4')]();}},'replyUri':{'type':Sequelize[_0x6f15('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6f15('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6f15('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6f15('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f15('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f15('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x6f15('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x6f15('0x6')],'defaultValue':![],'comment':_0x6f15('0x9'),'set':function(_0x470de2){if(!_0x470de2)this[_0x6f15('0xa')](_0x6f15('0xb'),null);this[_0x6f15('0xa')](_0x6f15('0xc'),_0x470de2);}}}; \ No newline at end of file +var _0x3cd9=['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','sequelize','exports','STRING','name','generate','TEXT'];(function(_0x50cead,_0x302fbd){var _0x2552d2=function(_0x45eed6){while(--_0x45eed6){_0x50cead['push'](_0x50cead['shift']());}};_0x2552d2(++_0x302fbd);}(_0x3cd9,0xba));var _0x93cd=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x3cd9[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require(_0x93cd('0x0'));var rs=require('randomstring');module[_0x93cd('0x1')]={'name':{'type':Sequelize[_0x93cd('0x2')],'unique':_0x93cd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x93cd('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x93cd('0x4')]();}},'replyUri':{'type':Sequelize[_0x93cd('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x93cd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x93cd('0x5')],'defaultValue':function(){return _0x93cd('0x6');}},'notificationSound':{'type':Sequelize[_0x93cd('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x93cd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x93cd('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x93cd('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x93cd('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x93cd('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x93cd('0x7')],'defaultValue':![],'comment':_0x93cd('0xa'),'set':function(_0x53c7e4){if(!_0x53c7e4)this[_0x93cd('0xb')]('mandatoryDispositionPauseId',null);this[_0x93cd('0xb')]('mandatoryDisposition',_0x53c7e4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 691d6d5..2518230 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 _0xbe64=['filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','fields','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','describe','addDisposition','getDispositions','Disposition','OpenchannelAccountId','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','CmContact','Contacts','updatedAt','OpenchannelApplication','account','applications','Applications','list','priority','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','unshift','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','transaction','getApplications','getInteractions','User','Owner','fullname','internal','Tags','color','tag','addAgents','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','CmList','DESC','defaults','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','name','send','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x268afe,_0x50bb60){var _0x288d0b=function(_0x5ec113){while(--_0x5ec113){_0x268afe['push'](_0x268afe['shift']());}};_0x288d0b(++_0x50bb60);}(_0xbe64,0x123));var _0x4be6=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xbe64[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require(_0x4be6('0x0'));var rimraf=require(_0x4be6('0x1'));var zipdir=require(_0x4be6('0x2'));var jsonpatch=require(_0x4be6('0x3'));var rp=require('request-promise');var moment=require(_0x4be6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4be6('0x5'));var util=require('util');var path=require(_0x4be6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4be6('0x7'));var _=require(_0x4be6('0x8'));var squel=require('squel');var crypto=require(_0x4be6('0x9'));var jsforce=require(_0x4be6('0xa'));var deskjs=require(_0x4be6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4be6('0xc'));var Papa=require(_0x4be6('0xd'));var Redis=require(_0x4be6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4be6('0xf'));var as=require(_0x4be6('0x10'));var hardwareService=require(_0x4be6('0x11'));var logger=require(_0x4be6('0x12'))(_0x4be6('0x13'));var utils=require(_0x4be6('0x14'));var config=require(_0x4be6('0x15'));var licenseUtil=require(_0x4be6('0x16'));var db=require(_0x4be6('0x17'))['db'];config['redis']=_['defaults'](config[_0x4be6('0x18')],{'host':_0x4be6('0x19'),'port':0x18eb});var socket=require(_0x4be6('0x1a'))(new Redis(config[_0x4be6('0x18')]));require(_0x4be6('0x1b'))[_0x4be6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4be6('0x1d')][_0x4be6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2e29dd,_0x564d2d,_0x2e199f,_0xf824ff){return new BPromise(function(_0x4d6ea4,_0x234fdb){var _0x9c663a=_0xf824ff||client;return _0x9c663a[_0x4be6('0x1f')](_0x2e29dd,_0x2e199f)['then'](function(_0x672d6f){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x564d2d,_0x4be6('0x20'));logger[_0x4be6('0x21')](_0x4be6('0x22'),_0x564d2d,_0x4be6('0x20'),JSON[_0x4be6('0x23')](_0x672d6f));if(_0x672d6f[_0x4be6('0x24')]){if(_0x672d6f[_0x4be6('0x24')]['code']===0x1f4){logger[_0x4be6('0x24')](_0x4be6('0x25'),_0x564d2d,_0x672d6f['error'][_0x4be6('0x26')]);return _0x234fdb(_0x672d6f[_0x4be6('0x24')][_0x4be6('0x26')]);}logger[_0x4be6('0x24')](_0x4be6('0x25'),_0x564d2d,_0x672d6f[_0x4be6('0x24')][_0x4be6('0x26')]);return _0x4d6ea4(_0x672d6f[_0x4be6('0x24')][_0x4be6('0x26')]);}else{logger[_0x4be6('0x27')](_0x4be6('0x25'),_0x564d2d,'request\x20sent');_0x4d6ea4(_0x672d6f[_0x4be6('0x28')][_0x4be6('0x26')]);}})[_0x4be6('0x29')](function(_0x43d5d2){logger[_0x4be6('0x24')](_0x4be6('0x25'),_0x564d2d,_0x43d5d2);_0x234fdb(_0x43d5d2);});});}function respondWithStatusCode(_0x497c31,_0x18fa90){_0x18fa90=_0x18fa90||0xcc;return function(_0x337e4d){if(_0x337e4d){return _0x497c31[_0x4be6('0x2a')](_0x18fa90);}return _0x497c31[_0x4be6('0x2b')](_0x18fa90)[_0x4be6('0x2c')]();};}function respondWithResult(_0x19fb17,_0x4c8c45){_0x4c8c45=_0x4c8c45||0xc8;return function(_0x10b1d5){if(_0x10b1d5){return _0x19fb17[_0x4be6('0x2b')](_0x4c8c45)['json'](_0x10b1d5);}};}function respondWithFilteredResult(_0x330bcc,_0x4defb8){return function(_0x53215f){if(_0x53215f){var _0x11faf6=typeof _0x4defb8[_0x4be6('0x2d')]===_0x4be6('0x2e')&&typeof _0x4defb8[_0x4be6('0x2f')]===_0x4be6('0x2e');var _0x2f43a0=_0x53215f[_0x4be6('0x30')];var _0x4eebd1=_0x11faf6?0x0:_0x4defb8['offset'];var _0x5ec290=_0x11faf6?_0x53215f[_0x4be6('0x30')]:_0x4defb8[_0x4be6('0x2d')]+_0x4defb8[_0x4be6('0x2f')];var _0x1d95d8;if(_0x5ec290>=_0x2f43a0){_0x5ec290=_0x2f43a0;_0x1d95d8=0xc8;}else{_0x1d95d8=0xce;}_0x330bcc['status'](_0x1d95d8);return _0x330bcc[_0x4be6('0x31')](_0x4be6('0x32'),_0x4eebd1+'-'+_0x5ec290+'/'+_0x2f43a0)['json'](_0x53215f);}return null;};}function patchUpdates(_0x570c24){return function(_0x5f32dc){try{jsonpatch['apply'](_0x5f32dc,_0x570c24,!![]);}catch(_0x47e977){return BPromise[_0x4be6('0x33')](_0x47e977);}return _0x5f32dc[_0x4be6('0x34')]();};}function saveUpdates(_0x2abe80,_0x1f283e){return function(_0x54b5e6){if(_0x54b5e6){return _0x54b5e6[_0x4be6('0x35')](_0x2abe80)[_0x4be6('0x36')](function(_0x3698ef){return _0x3698ef;});}return null;};}function removeEntity(_0x1789de,_0x19493a){return function(_0x4b0bc2){if(_0x4b0bc2){return _0x4b0bc2[_0x4be6('0x37')]()[_0x4be6('0x36')](function(){var _0x116ef0=_0x4b0bc2[_0x4be6('0x38')]({'plain':!![]});var _0x3cc0e7=_0x4be6('0x39');return db[_0x4be6('0x3a')][_0x4be6('0x37')]({'where':{'type':_0x3cc0e7,'resourceId':_0x116ef0['id']}})[_0x4be6('0x36')](function(){return _0x4b0bc2;});})['then'](function(){_0x1789de[_0x4be6('0x2b')](0xcc)[_0x4be6('0x2c')]();});}};}function handleEntityNotFound(_0x5411e7,_0xaeb3ed){return function(_0x235c85){if(!_0x235c85){_0x5411e7[_0x4be6('0x2a')](0x194);}return _0x235c85;};}function handleError(_0x467f12,_0x4c48b1){_0x4c48b1=_0x4c48b1||0x1f4;return function(_0x4236c7){logger[_0x4be6('0x24')](_0x4236c7['stack']);if(_0x4236c7[_0x4be6('0x3b')]){delete _0x4236c7[_0x4be6('0x3b')];}_0x467f12[_0x4be6('0x2b')](_0x4c48b1)[_0x4be6('0x3c')](_0x4236c7);};}exports['index']=function(_0x726630,_0xe05b85){var _0x49cbe3={'include':[{'model':db['Pause'],'as':_0x4be6('0x3d')}]},_0x1d07f9={},_0x361713={'count':0x0,'rows':[]};var _0x39ab43=_[_0x4be6('0x3e')](db['OpenchannelAccount'][_0x4be6('0x3f')],function(_0x110b51){return{'name':_0x110b51[_0x4be6('0x40')],'type':_0x110b51[_0x4be6('0x41')]['key']};});_0x1d07f9[_0x4be6('0x42')]=_['map'](_0x39ab43,'name');_0x1d07f9['query']=_[_0x4be6('0x43')](_0x726630[_0x4be6('0x44')]);_0x1d07f9['filters']=_[_0x4be6('0x45')](_0x1d07f9[_0x4be6('0x42')],_0x1d07f9['query']);_0x49cbe3[_0x4be6('0x46')]=_['intersection'](_0x1d07f9[_0x4be6('0x42')],qs['fields'](_0x726630[_0x4be6('0x44')]['fields']));_0x49cbe3[_0x4be6('0x46')]=_0x49cbe3[_0x4be6('0x46')][_0x4be6('0x47')]?_0x49cbe3[_0x4be6('0x46')]:_0x1d07f9[_0x4be6('0x42')];if(!_0x726630['query'][_0x4be6('0x48')](_0x4be6('0x49'))){_0x49cbe3[_0x4be6('0x2f')]=qs[_0x4be6('0x2f')](_0x726630[_0x4be6('0x44')][_0x4be6('0x2f')]);_0x49cbe3[_0x4be6('0x2d')]=qs[_0x4be6('0x2d')](_0x726630[_0x4be6('0x44')][_0x4be6('0x2d')]);}_0x49cbe3[_0x4be6('0x4a')]=qs[_0x4be6('0x4b')](_0x726630[_0x4be6('0x44')][_0x4be6('0x4b')]);_0x49cbe3[_0x4be6('0x4c')]=qs[_0x4be6('0x4d')](_[_0x4be6('0x4e')](_0x726630[_0x4be6('0x44')],_0x1d07f9[_0x4be6('0x4d')]),_0x39ab43);if(_0x726630[_0x4be6('0x44')][_0x4be6('0x4f')]){_0x49cbe3['where']=_[_0x4be6('0x50')](_0x49cbe3[_0x4be6('0x4c')],{'$or':_[_0x4be6('0x3e')](_0x39ab43,function(_0x19e094){if(_0x19e094[_0x4be6('0x41')]!==_0x4be6('0x51')){var _0x246526={};_0x246526[_0x19e094[_0x4be6('0x3b')]]={'$like':'%'+_0x726630[_0x4be6('0x44')][_0x4be6('0x4f')]+'%'};return _0x246526;}})});}_0x49cbe3=_[_0x4be6('0x50')]({},_0x49cbe3,_0x726630[_0x4be6('0x52')]);var _0xc8c4aa={'where':_0x49cbe3[_0x4be6('0x4c')]};return db[_0x4be6('0x53')][_0x4be6('0x30')](_0xc8c4aa)[_0x4be6('0x36')](function(_0x563547){_0x361713[_0x4be6('0x30')]=_0x563547;if(_0x726630['query'][_0x4be6('0x54')]){_0x49cbe3[_0x4be6('0x55')]=[{'all':!![]}];}return db[_0x4be6('0x53')][_0x4be6('0x56')](_0x49cbe3);})[_0x4be6('0x36')](function(_0x587f42){_0x361713[_0x4be6('0x57')]=_0x587f42;return _0x361713;})[_0x4be6('0x36')](respondWithFilteredResult(_0xe05b85,_0x49cbe3))[_0x4be6('0x29')](handleError(_0xe05b85,null));};exports[_0x4be6('0x58')]=function(_0x1104e6,_0x50d906){var _0x270441={'raw':![],'where':{'id':_0x1104e6[_0x4be6('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x11d778={};_0x11d778[_0x4be6('0x42')]=_['keys'](db['OpenchannelAccount'][_0x4be6('0x3f')]);_0x11d778[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x1104e6[_0x4be6('0x44')]);_0x11d778[_0x4be6('0x4d')]=_[_0x4be6('0x45')](_0x11d778[_0x4be6('0x42')],_0x11d778[_0x4be6('0x44')]);_0x270441[_0x4be6('0x46')]=_[_0x4be6('0x45')](_0x11d778[_0x4be6('0x42')],qs['fields'](_0x1104e6['query'][_0x4be6('0x5a')]));_0x270441['attributes']=_0x270441['attributes'][_0x4be6('0x47')]?_0x270441[_0x4be6('0x46')]:_0x11d778[_0x4be6('0x42')];if(_0x1104e6[_0x4be6('0x44')][_0x4be6('0x54')]){_0x270441[_0x4be6('0x55')]=[{'all':!![]}];}_0x270441=_['merge']({},_0x270441,_0x1104e6['options']);return db[_0x4be6('0x53')]['find'](_0x270441)[_0x4be6('0x36')](handleEntityNotFound(_0x50d906,null))[_0x4be6('0x36')](respondWithResult(_0x50d906,null))['catch'](handleError(_0x50d906,null));};exports[_0x4be6('0x5b')]=function(_0x41d132,_0x104919){return db['OpenchannelAccount'][_0x4be6('0x5b')](_0x41d132[_0x4be6('0x5c')],{})[_0x4be6('0x36')](function(_0x139a99){var _0x5b8ceb=_0x41d132[_0x4be6('0x5d')][_0x4be6('0x38')]({'plain':!![]});if(!_0x5b8ceb)throw new Error(_0x4be6('0x5e'));if(_0x5b8ceb[_0x4be6('0x5f')]===_0x4be6('0x5d')){var _0x40a400=_0x139a99[_0x4be6('0x38')]({'plain':!![]});var _0xb97995=_0x4be6('0x39');return db[_0x4be6('0x60')][_0x4be6('0x61')]({'where':{'name':_0xb97995,'userProfileId':_0x5b8ceb[_0x4be6('0x62')]},'raw':!![]})[_0x4be6('0x36')](function(_0xcec54e){if(_0xcec54e&&_0xcec54e[_0x4be6('0x63')]===0x0){return db[_0x4be6('0x3a')]['create']({'name':_0x40a400[_0x4be6('0x3b')],'resourceId':_0x40a400['id'],'type':_0xcec54e['name'],'sectionId':_0xcec54e['id']},{})['then'](function(){return _0x139a99;});}else{return _0x139a99;}})[_0x4be6('0x29')](function(_0x4932d3){logger[_0x4be6('0x24')](_0x4be6('0x64'),_0x4932d3);throw _0x4932d3;});}return _0x139a99;})[_0x4be6('0x36')](respondWithResult(_0x104919,0xc9))['catch'](handleError(_0x104919,null));};exports[_0x4be6('0x35')]=function(_0x53d6fd,_0x41d467){if(_0x53d6fd[_0x4be6('0x5c')]['id']){delete _0x53d6fd[_0x4be6('0x5c')]['id'];}return db[_0x4be6('0x53')]['find']({'where':{'id':_0x53d6fd[_0x4be6('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x4be6('0x3d')}]})[_0x4be6('0x36')](handleEntityNotFound(_0x41d467,null))['then'](saveUpdates(_0x53d6fd['body'],null))[_0x4be6('0x36')](respondWithResult(_0x41d467,null))['catch'](handleError(_0x41d467,null));};exports[_0x4be6('0x37')]=function(_0x700709,_0x1ff1e0){return db[_0x4be6('0x53')][_0x4be6('0x61')]({'where':{'id':_0x700709[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x1ff1e0,null))[_0x4be6('0x36')](removeEntity(_0x1ff1e0,null))[_0x4be6('0x29')](handleError(_0x1ff1e0,null));};exports['describe']=function(_0x2aa169,_0x4157c1){return db[_0x4be6('0x53')][_0x4be6('0x65')]()[_0x4be6('0x36')](respondWithResult(_0x4157c1,null))[_0x4be6('0x29')](handleError(_0x4157c1,null));};exports[_0x4be6('0x66')]=function(_0x519fb7,_0x1fe235,_0x55b6af){if(_0x519fb7[_0x4be6('0x5c')]['id']){delete _0x519fb7[_0x4be6('0x5c')]['id'];}return db['OpenchannelAccount'][_0x4be6('0x61')]({'where':{'id':_0x519fb7['params']['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x1fe235,null))[_0x4be6('0x36')](function(_0x2eff86){if(_0x2eff86){_0x519fb7[_0x4be6('0x5c')]['OpenchannelAccountId']=_0x2eff86['id'];return db['Disposition']['create'](_0x519fb7[_0x4be6('0x5c')]);}})[_0x4be6('0x36')](respondWithResult(_0x1fe235,null))[_0x4be6('0x29')](handleError(_0x1fe235,null));};exports[_0x4be6('0x67')]=function(_0x24da38,_0x5aeee1,_0x5619db){var _0x23cd8e={'raw':![],'where':{}};var _0x4b837c={};var _0x4eb37b={'count':0x0,'rows':[]};return db[_0x4be6('0x53')]['findOne']({'where':{'id':_0x24da38[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x5aeee1,null))[_0x4be6('0x36')](function(_0x4f1626){if(_0x4f1626){_0x4b837c[_0x4be6('0x42')]=_['keys'](db[_0x4be6('0x68')][_0x4be6('0x3f')]);_0x4b837c[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x24da38[_0x4be6('0x44')]);_0x4b837c[_0x4be6('0x4d')]=_[_0x4be6('0x45')](_0x4b837c[_0x4be6('0x42')],_0x4b837c[_0x4be6('0x44')]);_0x23cd8e[_0x4be6('0x46')]=_[_0x4be6('0x45')](_0x4b837c['model'],qs[_0x4be6('0x5a')](_0x24da38[_0x4be6('0x44')][_0x4be6('0x5a')]));_0x23cd8e[_0x4be6('0x46')]=_0x23cd8e[_0x4be6('0x46')][_0x4be6('0x47')]?_0x23cd8e[_0x4be6('0x46')]:_0x4b837c['model'];if(!_0x24da38[_0x4be6('0x44')][_0x4be6('0x48')](_0x4be6('0x49'))){_0x23cd8e[_0x4be6('0x2f')]=qs[_0x4be6('0x2f')](_0x24da38[_0x4be6('0x44')]['limit']);_0x23cd8e['offset']=qs[_0x4be6('0x2d')](_0x24da38[_0x4be6('0x44')][_0x4be6('0x2d')]);}_0x23cd8e[_0x4be6('0x4a')]=qs[_0x4be6('0x4b')](_0x24da38['query'][_0x4be6('0x4b')]);_0x23cd8e[_0x4be6('0x4c')]=qs['filters'](_[_0x4be6('0x4e')](_0x24da38['query'],_0x4b837c['filters']));_0x23cd8e['where'][_0x4be6('0x69')]=_0x4f1626['id'];if(_0x24da38['query']['filter']){_0x23cd8e[_0x4be6('0x4c')]=_[_0x4be6('0x50')](_0x23cd8e[_0x4be6('0x4c')],{'$or':_[_0x4be6('0x3e')](_0x23cd8e[_0x4be6('0x46')],function(_0x120537){var _0x5f3f24={};_0x5f3f24[_0x120537]={'$like':'%'+_0x24da38[_0x4be6('0x44')][_0x4be6('0x4f')]+'%'};return _0x5f3f24;})});}_0x23cd8e=_[_0x4be6('0x50')]({},_0x23cd8e,_0x24da38[_0x4be6('0x52')]);return db[_0x4be6('0x68')][_0x4be6('0x30')]({'where':_0x23cd8e[_0x4be6('0x4c')]})[_0x4be6('0x36')](function(_0x539efb){_0x4eb37b[_0x4be6('0x30')]=_0x539efb;if(_0x24da38[_0x4be6('0x44')]['includeAll']){_0x23cd8e['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x23cd8e);})[_0x4be6('0x36')](function(_0x3062ef){_0x4eb37b[_0x4be6('0x57')]=_0x3062ef;return _0x4eb37b;});}})[_0x4be6('0x36')](respondWithFilteredResult(_0x5aeee1,_0x23cd8e))[_0x4be6('0x29')](handleError(_0x5aeee1,null));};exports[_0x4be6('0x6a')]=function(_0x4ebc54,_0x2cb89b,_0x5d3a24){return db['OpenchannelAccount'][_0x4be6('0x61')]({'where':{'id':_0x4ebc54[_0x4be6('0x59')]['id']}})['then'](handleEntityNotFound(_0x2cb89b,null))[_0x4be6('0x36')](function(_0x1c8b89){if(_0x1c8b89){return _0x1c8b89['removeDispositions'](_0x4ebc54['query'][_0x4be6('0x6b')]);}})[_0x4be6('0x36')](respondWithStatusCode(_0x2cb89b,null))[_0x4be6('0x29')](handleError(_0x2cb89b,null));};exports[_0x4be6('0x6c')]=function(_0x12e1fb,_0x32555e,_0x2a01b3){if(_0x12e1fb[_0x4be6('0x5c')]['id']){delete _0x12e1fb[_0x4be6('0x5c')]['id'];}return db['OpenchannelAccount'][_0x4be6('0x61')]({'where':{'id':_0x12e1fb[_0x4be6('0x59')]['id']}})['then'](handleEntityNotFound(_0x32555e,null))[_0x4be6('0x36')](function(_0x2a945c){if(_0x2a945c){_0x12e1fb[_0x4be6('0x5c')][_0x4be6('0x69')]=_0x2a945c['id'];return db['CannedAnswer'][_0x4be6('0x5b')](_0x12e1fb[_0x4be6('0x5c')]);}})['then'](respondWithResult(_0x32555e,null))[_0x4be6('0x29')](handleError(_0x32555e,null));};exports[_0x4be6('0x6d')]=function(_0x3939cb,_0x1a33f7,_0x83bf3f){var _0x26649f={'raw':![],'where':{}};var _0x2a3961={};var _0x3efc9c={'count':0x0,'rows':[]};return db[_0x4be6('0x53')][_0x4be6('0x6e')]({'where':{'id':_0x3939cb[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x1a33f7,null))[_0x4be6('0x36')](function(_0x39a3cc){if(_0x39a3cc){_0x2a3961[_0x4be6('0x42')]=_[_0x4be6('0x43')](db[_0x4be6('0x6f')][_0x4be6('0x3f')]);_0x2a3961[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x3939cb['query']);_0x2a3961['filters']=_[_0x4be6('0x45')](_0x2a3961['model'],_0x2a3961[_0x4be6('0x44')]);_0x26649f[_0x4be6('0x46')]=_[_0x4be6('0x45')](_0x2a3961[_0x4be6('0x42')],qs[_0x4be6('0x5a')](_0x3939cb[_0x4be6('0x44')][_0x4be6('0x5a')]));_0x26649f[_0x4be6('0x46')]=_0x26649f[_0x4be6('0x46')][_0x4be6('0x47')]?_0x26649f[_0x4be6('0x46')]:_0x2a3961['model'];if(!_0x3939cb[_0x4be6('0x44')][_0x4be6('0x48')](_0x4be6('0x49'))){_0x26649f[_0x4be6('0x2f')]=qs[_0x4be6('0x2f')](_0x3939cb[_0x4be6('0x44')][_0x4be6('0x2f')]);_0x26649f[_0x4be6('0x2d')]=qs[_0x4be6('0x2d')](_0x3939cb[_0x4be6('0x44')][_0x4be6('0x2d')]);}_0x26649f[_0x4be6('0x4a')]=qs[_0x4be6('0x4b')](_0x3939cb['query'][_0x4be6('0x4b')]);_0x26649f['where']=qs[_0x4be6('0x4d')](_[_0x4be6('0x4e')](_0x3939cb[_0x4be6('0x44')],_0x2a3961[_0x4be6('0x4d')]));_0x26649f['where'][_0x4be6('0x69')]=_0x39a3cc['id'];if(_0x3939cb[_0x4be6('0x44')][_0x4be6('0x4f')]){_0x26649f[_0x4be6('0x4c')]=_[_0x4be6('0x50')](_0x26649f['where'],{'$or':_[_0x4be6('0x3e')](_0x26649f['attributes'],function(_0x2cf62c){var _0x3846a8={};_0x3846a8[_0x2cf62c]={'$like':'%'+_0x3939cb[_0x4be6('0x44')][_0x4be6('0x4f')]+'%'};return _0x3846a8;})});}_0x26649f=_['merge']({},_0x26649f,_0x3939cb['options']);return db['CannedAnswer']['count']({'where':_0x26649f[_0x4be6('0x4c')]})['then'](function(_0x3069ac){_0x3efc9c['count']=_0x3069ac;if(_0x3939cb['query']['includeAll']){_0x26649f['include']=[{'all':!![]}];}return db[_0x4be6('0x6f')][_0x4be6('0x56')](_0x26649f);})['then'](function(_0x56def4){_0x3efc9c[_0x4be6('0x57')]=_0x56def4;return _0x3efc9c;});}})[_0x4be6('0x36')](respondWithFilteredResult(_0x1a33f7,_0x26649f))[_0x4be6('0x29')](handleError(_0x1a33f7,null));};exports[_0x4be6('0x70')]=function(_0x5416fa,_0xe98587,_0x1a51dd){return db[_0x4be6('0x53')][_0x4be6('0x61')]({'where':{'id':_0x5416fa[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0xe98587,null))[_0x4be6('0x36')](function(_0x3cf0ac){if(_0x3cf0ac){return _0x3cf0ac['removeAnswers'](_0x5416fa[_0x4be6('0x44')][_0x4be6('0x6b')]);}})['then'](respondWithStatusCode(_0xe98587,null))['catch'](handleError(_0xe98587,null));};exports[_0x4be6('0x71')]=function(_0x292e28,_0x274eea,_0x3bbb49){var _0x58e406={'body':_0x292e28[_0x4be6('0x5c')],'channel':_0x4be6('0x72')};var _0x3a16d0=[];var _0x2588bf=[];var _0x4dd9db={};var _0x122f7c=![];return db['CmContact'][_0x4be6('0x65')]()[_0x4be6('0x36')](function(_0x45d5ec){if(!_0x45d5ec){throw new db['Sequelize']['ValidationError'](_0x4be6('0x73'));}_0x3a16d0=_[_0x4be6('0x74')](_[_0x4be6('0x43')](_0x45d5ec),['createdAt','updatedAt']);_0x2588bf=_[_0x4be6('0x74')](_[_0x4be6('0x43')](_0x45d5ec),[_0x4be6('0x75'),'updatedAt',_0x4be6('0x76'),_0x4be6('0x77')]);if(_0x292e28['body']['id']){delete _0x292e28[_0x4be6('0x5c')]['id'];}if(_[_0x4be6('0x78')](_0x292e28[_0x4be6('0x5c')]['from'])){throw new db[(_0x4be6('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x4be6('0x78')](_0x292e28[_0x4be6('0x5c')][_0x4be6('0x5c')])||_0x292e28['body'][_0x4be6('0x5c')]===''){throw new db[(_0x4be6('0x79'))]['ValidationError'](_0x4be6('0x7a'));}if(_[_0x4be6('0x78')](_0x292e28[_0x4be6('0x5c')][_0x4be6('0x7b')])){throw new db[(_0x4be6('0x79'))][(_0x4be6('0x7c'))](_0x4be6('0x7d')+_0x2588bf);}if(!_[_0x4be6('0x7e')](_0x2588bf,_0x292e28['body'][_0x4be6('0x7b')])){throw new db['Sequelize'][(_0x4be6('0x7c'))](_0x4be6('0x7f')+_0x2588bf);}_0x4dd9db[_0x292e28[_0x4be6('0x5c')]['mapKey']]=_0x292e28[_0x4be6('0x5c')][_0x4be6('0x80')];})['then'](function(){return db[_0x4be6('0x53')][_0x4be6('0x61')]({'where':{'id':_0x292e28['params']['id']},'include':[{'model':db['CmList'],'as':_0x4be6('0x81'),'include':[{'model':db[_0x4be6('0x82')],'as':_0x4be6('0x83'),'where':_0x4dd9db,'limit':0x1,'order':[[_0x4be6('0x84'),'DESC']]}]},{'model':db[_0x4be6('0x85')],'as':'Applications'}]});})[_0x4be6('0x36')](handleEntityNotFound(_0x274eea,null))[_0x4be6('0x36')](function(_0x28d9ee){if(_0x28d9ee&&_0x28d9ee[_0x4be6('0x81')]){_0x58e406[_0x4be6('0x86')]=_0x28d9ee;_0x58e406[_0x4be6('0x87')]=_0x28d9ee[_0x4be6('0x88')];_0x58e406[_0x4be6('0x89')]=_0x28d9ee['List'];_0x58e406['applications']=_['orderBy'](_0x58e406[_0x4be6('0x87')],[_0x4be6('0x8a')],[_0x4be6('0x8b')]);if(_0x58e406[_0x4be6('0x86')][_0x4be6('0x88')]){delete _0x58e406['account'][_0x4be6('0x88')];}if(_0x58e406[_0x4be6('0x86')]['List']&&_0x58e406[_0x4be6('0x86')][_0x4be6('0x81')][_0x4be6('0x83')][_0x4be6('0x47')]){return _0x58e406[_0x4be6('0x86')]['List']['Contacts'][0x0];}var _0x6e82cb=_['defaults'](_0x292e28[_0x4be6('0x5c')],{'firstName':_0x292e28[_0x4be6('0x5c')][_0x4be6('0x80')],'ListId':_0x28d9ee[_0x4be6('0x77')]});_0x6e82cb[_0x292e28['body'][_0x4be6('0x7b')]]=_0x292e28[_0x4be6('0x5c')]['from'];return db[_0x4be6('0x82')][_0x4be6('0x5b')](_0x6e82cb,{'fields':_0x3a16d0,'raw':!![]});}})['then'](handleEntityNotFound(_0x274eea,null))['then'](function(_0x728ae0){_0x58e406[_0x4be6('0x8c')]=_0x728ae0;if(_0x728ae0){var _0x2e31c0={'ContactId':_0x728ae0['id'],'OpenchannelAccountId':_0x292e28[_0x4be6('0x59')]['id'],'from':(_0x728ae0[_0x4be6('0x8d')]||'')+'\x20'+(_0x728ae0['lastName']||'')};var _0x4d63a2={'OpenchannelAccountId':_0x292e28['params']['id'],'closed':![]};if(_0x292e28[_0x4be6('0x5c')][_0x4be6('0x8e')]){_0x4d63a2[_0x4be6('0x8e')]=_0x292e28[_0x4be6('0x5c')][_0x4be6('0x8e')];return db[_0x4be6('0x8f')][_0x4be6('0x61')]({'where':_0x4d63a2})[_0x4be6('0x36')](function(_0x4289a){if(_0x4289a){return[_0x4289a,![]];}_0x2e31c0[_0x4be6('0x8e')]=_0x292e28[_0x4be6('0x5c')][_0x4be6('0x8e')];_0x2e31c0['externalUrl']=_0x292e28['body'][_0x4be6('0x90')];return db[_0x4be6('0x8f')]['create'](_0x2e31c0)['then'](function(_0x8f26f2){return[_0x8f26f2,!![]];});});}else{_0x4d63a2[_0x4be6('0x8e')]=null;}_0x4d63a2[_0x4be6('0x91')]=_0x728ae0['id'];return db['OpenchannelInteraction'][_0x4be6('0x61')]({'where':_0x4d63a2})[_0x4be6('0x36')](function(_0x2cd0a4){if(_0x2cd0a4){return[_0x2cd0a4,![]];}return db[_0x4be6('0x8f')][_0x4be6('0x5b')](_0x2e31c0)[_0x4be6('0x36')](function(_0x42e732){return[_0x42e732,!![]];});});}})[_0x4be6('0x92')](function(_0x9994a3,_0x5f54d8){if(_0x9994a3){_0x122f7c=_0x5f54d8;if(!_0x5f54d8){var _0x1be154={'from':(_0x58e406['contact'][_0x4be6('0x8d')]||'')+'\x20'+(_0x58e406[_0x4be6('0x8c')][_0x4be6('0x93')]||'')};if(_0x292e28[_0x4be6('0x5c')]['threadId']&&_0x292e28[_0x4be6('0x5c')][_0x4be6('0x94')]&&_0x292e28[_0x4be6('0x5c')][_0x4be6('0x8e')]!=_0x292e28['body'][_0x4be6('0x94')]){_0x1be154[_0x4be6('0x8e')]=_0x292e28[_0x4be6('0x5c')][_0x4be6('0x94')];}return _0x9994a3['update'](_0x1be154);}else{return _0x9994a3;}}})['then'](function(_0x3f42a9){_0x58e406[_0x4be6('0x95')]=_0x3f42a9[_0x4be6('0x38')]({'plain':!![]});_0x58e406[_0x4be6('0x95')][_0x4be6('0x96')]=_0x122f7c;if(_0x58e406[_0x4be6('0x95')]['created']){if(_0x58e406[_0x4be6('0x86')]['autoclose']){_0x58e406['applications']['push']({'id':0x0,'priority':_0x58e406[_0x4be6('0x87')][_0x4be6('0x47')]+0x1,'app':_0x4be6('0x97'),'appdata':_0x4be6('0x98'),'interval':_0x4be6('0x99')});}}return db[_0x4be6('0x9a')][_0x4be6('0x5b')]({'body':_0x292e28[_0x4be6('0x5c')][_0x4be6('0x5c')],'OpenchannelAccountId':_0x292e28[_0x4be6('0x59')]['id'],'OpenchannelInteractionId':_0x3f42a9['id'],'direction':'in','ContactId':_0x58e406[_0x4be6('0x8c')]['id'],'AttachmentId':_0x292e28[_0x4be6('0x5c')]['AttachmentId']});})['then'](function(_0x5686b1){_0x58e406[_0x4be6('0x26')]=_0x5686b1;if(_0x58e406[_0x4be6('0x95')]['UserId']){return db['User'][_0x4be6('0x61')]({'attributes':['id',_0x4be6('0x3b')],'where':{'id':_0x58e406['interaction']['UserId']}})[_0x4be6('0x36')](function(_0x30bb3d){if(_0x30bb3d){_0x58e406[_0x4be6('0x87')][_0x4be6('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x30bb3d[_0x4be6('0x3b')]+','+(_0x58e406[_0x4be6('0x86')][_0x4be6('0x9c')]||0xa),'interval':_0x4be6('0x99')});_0x58e406['forcedOwnership']=![];}return respondWithRpcPromise(_0x4be6('0x9d'),_0x4be6('0x9e'),_0x58e406);});}return respondWithRpcPromise('Start','startRouting',_0x58e406);})[_0x4be6('0x36')](function(_0x13db5b){respondWithRpcPromise('EventManager',_0x4be6('0x9f'),{'event':_0x4be6('0x71'),'message':_0x13db5b},client9002);return _0x13db5b;})[_0x4be6('0x36')](respondWithResult(_0x274eea,null))[_0x4be6('0x29')](handleError(_0x274eea,null));};exports['addApplications']=function(_0x47c41b,_0x5a0f8a,_0x3de0f8){return db['OpenchannelAccount'][_0x4be6('0x6e')]({'where':{'id':_0x47c41b['params']['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x5a0f8a,null))[_0x4be6('0x36')](function(_0x56d913){if(_0x56d913){return db[_0x4be6('0xa0')][_0x4be6('0xa1')](function(_0x5035dc){return db[_0x4be6('0x85')][_0x4be6('0x37')]({'where':{'OpenchannelAccountId':_0x47c41b[_0x4be6('0x59')]['id']},'transaction':_0x5035dc})[_0x4be6('0x36')](function(_0x122433){var _0x336359=_[_0x4be6('0x3e')](_0x47c41b[_0x4be6('0x5c')],function(_0x357609){_0x357609[_0x4be6('0x69')]=_0x47c41b[_0x4be6('0x59')]['id'];return _0x357609;});return db[_0x4be6('0x85')]['bulkCreate'](_0x336359,{'transaction':_0x5035dc});});})[_0x4be6('0x36')](function(){return db[_0x4be6('0x85')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x47c41b[_0x4be6('0x59')]['id']},'order':_0x4be6('0x8a')});});}})[_0x4be6('0x36')](respondWithResult(_0x5a0f8a,null))[_0x4be6('0x29')](handleError(_0x5a0f8a,null));};exports[_0x4be6('0xa2')]=function(_0x548042,_0x24c901,_0x5a6901){var _0x13c3c5={};var _0x1b999f={};var _0x4d8774;var _0x5705f5;return db['OpenchannelAccount'][_0x4be6('0x6e')]({'where':{'id':_0x548042[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x24c901,null))[_0x4be6('0x36')](function(_0xfdf499){if(_0xfdf499){_0x4d8774=_0xfdf499;_0x1b999f[_0x4be6('0x42')]=_[_0x4be6('0x43')](db[_0x4be6('0x85')]['rawAttributes']);_0x1b999f[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x548042[_0x4be6('0x44')]);_0x1b999f['filters']=_[_0x4be6('0x45')](_0x1b999f[_0x4be6('0x42')],_0x1b999f[_0x4be6('0x44')]);_0x13c3c5[_0x4be6('0x46')]=_['intersection'](_0x1b999f[_0x4be6('0x42')],qs['fields'](_0x548042['query'][_0x4be6('0x5a')]));_0x13c3c5[_0x4be6('0x46')]=_0x13c3c5[_0x4be6('0x46')][_0x4be6('0x47')]?_0x13c3c5[_0x4be6('0x46')]:_0x1b999f[_0x4be6('0x42')];_0x13c3c5[_0x4be6('0x4a')]=qs['sort'](_0x548042['query']['sort']);_0x13c3c5[_0x4be6('0x4c')]=qs[_0x4be6('0x4d')](_['pick'](_0x548042[_0x4be6('0x44')],_0x1b999f[_0x4be6('0x4d')]));if(_0x548042[_0x4be6('0x44')][_0x4be6('0x4f')]){_0x13c3c5[_0x4be6('0x4c')]=_[_0x4be6('0x50')](_0x13c3c5[_0x4be6('0x4c')],{'$or':_['map'](_0x13c3c5[_0x4be6('0x46')],function(_0x556653){var _0x3702bd={};_0x3702bd[_0x556653]={'$like':'%'+_0x548042[_0x4be6('0x44')][_0x4be6('0x4f')]+'%'};return _0x3702bd;})});}_0x13c3c5=_[_0x4be6('0x50')]({},_0x13c3c5,_0x548042[_0x4be6('0x52')]);return _0x4d8774['getApplications'](_0x13c3c5);}})[_0x4be6('0x36')](function(_0x232b4e){if(_0x232b4e){_0x5705f5=_0x232b4e[_0x4be6('0x47')];if(!_0x548042[_0x4be6('0x44')][_0x4be6('0x48')](_0x4be6('0x49'))){_0x13c3c5[_0x4be6('0x2f')]=qs[_0x4be6('0x2f')](_0x548042[_0x4be6('0x44')][_0x4be6('0x2f')]);_0x13c3c5[_0x4be6('0x2d')]=qs[_0x4be6('0x2d')](_0x548042[_0x4be6('0x44')][_0x4be6('0x2d')]);}return _0x4d8774['getApplications'](_0x13c3c5);}})[_0x4be6('0x36')](function(_0x2db7de){if(_0x2db7de){return _0x2db7de?{'count':_0x5705f5,'rows':_0x2db7de}:null;}})['then'](respondWithResult(_0x24c901,null))[_0x4be6('0x29')](handleError(_0x24c901,null));};exports[_0x4be6('0xa3')]=function(_0x4039d5,_0x4cd7e6,_0x2d90e6){var _0x5daffb={'raw':![],'where':{}};var _0x5b4e4c={};var _0x367fcd={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x4be6('0x6e')]({'where':{'id':_0x4039d5['params']['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x4cd7e6,null))[_0x4be6('0x36')](function(_0x51f45b){if(_0x51f45b){_0x5b4e4c['model']=_[_0x4be6('0x43')](db[_0x4be6('0x8f')][_0x4be6('0x3f')]);_0x5b4e4c[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x4039d5[_0x4be6('0x44')]);_0x5b4e4c[_0x4be6('0x4d')]=_[_0x4be6('0x45')](_0x5b4e4c[_0x4be6('0x42')],_0x5b4e4c[_0x4be6('0x44')]);_0x5daffb[_0x4be6('0x46')]=_['intersection'](_0x5b4e4c['model'],qs[_0x4be6('0x5a')](_0x4039d5[_0x4be6('0x44')]['fields']));_0x5daffb[_0x4be6('0x46')]=_0x5daffb[_0x4be6('0x46')][_0x4be6('0x47')]?_0x5daffb[_0x4be6('0x46')]:_0x5b4e4c['model'];if(!_0x4039d5[_0x4be6('0x44')][_0x4be6('0x48')](_0x4be6('0x49'))){_0x5daffb['limit']=qs[_0x4be6('0x2f')](_0x4039d5[_0x4be6('0x44')][_0x4be6('0x2f')]);_0x5daffb[_0x4be6('0x2d')]=qs[_0x4be6('0x2d')](_0x4039d5[_0x4be6('0x44')][_0x4be6('0x2d')]);}_0x5daffb[_0x4be6('0x4a')]=qs[_0x4be6('0x4b')](_0x4039d5[_0x4be6('0x44')][_0x4be6('0x4b')]);_0x5daffb[_0x4be6('0x4c')]=qs[_0x4be6('0x4d')](_[_0x4be6('0x4e')](_0x4039d5[_0x4be6('0x44')],_0x5b4e4c['filters']));_0x5daffb[_0x4be6('0x4c')][_0x4be6('0x69')]=_0x51f45b['id'];if(_0x4039d5[_0x4be6('0x44')][_0x4be6('0x4f')]){_0x5daffb[_0x4be6('0x4c')]=_[_0x4be6('0x50')](_0x5daffb[_0x4be6('0x4c')],{'$or':_[_0x4be6('0x3e')](_0x5daffb['attributes'],function(_0x5e8598){var _0x447635={};_0x447635[_0x5e8598]={'$like':'%'+_0x4039d5[_0x4be6('0x44')][_0x4be6('0x4f')]+'%'};return _0x447635;})});}_0x5daffb=_[_0x4be6('0x50')]({},_0x5daffb,_0x4039d5[_0x4be6('0x52')]);return db[_0x4be6('0x8f')]['count']({'where':_0x5daffb['where']})[_0x4be6('0x36')](function(_0x41e0a8){_0x367fcd['count']=_0x41e0a8;if(_0x4039d5[_0x4be6('0x44')]['includeAll']){_0x5daffb[_0x4be6('0x55')]=[{'model':db[_0x4be6('0x82')],'as':'Contact','required':![]},{'model':db[_0x4be6('0xa4')],'as':_0x4be6('0xa5'),'attributes':[_0x4be6('0x3b'),_0x4be6('0xa6'),_0x4be6('0xa7')],'required':![]},{'model':db['Tag'],'as':_0x4be6('0xa8'),'attributes':['id',_0x4be6('0x3b'),_0x4be6('0xa9')],'where':_0x4039d5['query'][_0x4be6('0xaa')]?{'id':_0x4039d5[_0x4be6('0x44')][_0x4be6('0xaa')]}:undefined,'required':_0x4039d5['query'][_0x4be6('0xaa')]?!![]:![]}];}return db[_0x4be6('0x8f')]['findAll'](_0x5daffb);})[_0x4be6('0x36')](function(_0xab8150){_0x367fcd[_0x4be6('0x57')]=_0xab8150;return _0x367fcd;});}})['then'](respondWithFilteredResult(_0x4cd7e6,_0x5daffb))[_0x4be6('0x29')](handleError(_0x4cd7e6,null));};exports['addAgents']=function(_0x4e2a11,_0x414dc9,_0x3ac8b8){return db[_0x4be6('0x53')]['find']({'where':{'id':_0x4e2a11[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x414dc9,null))[_0x4be6('0x36')](function(_0x2dae61){if(_0x2dae61){return _0x2dae61[_0x4be6('0xab')](_0x4e2a11[_0x4be6('0x5c')]['ids'],_['omit'](_0x4e2a11['body'],[_0x4be6('0x6b'),'id'])||{})['spread'](function(_0x5e13c6){for(var _0x2719a5=0x0;_0x2719a5<_0x4e2a11[_0x4be6('0x5c')][_0x4be6('0x6b')][_0x4be6('0x47')];_0x2719a5+=0x1){socket['emit'](_0x4be6('0xac'),{'UserId':Number(_0x4e2a11[_0x4be6('0x5c')]['ids'][_0x2719a5]),'OpenchannelAccountId':Number(_0x4e2a11[_0x4be6('0x59')]['id'])});}return _0x5e13c6;});}})['then'](respondWithResult(_0x414dc9,null))[_0x4be6('0x29')](handleError(_0x414dc9,null));};exports[_0x4be6('0xad')]=function(_0xb5e34,_0x360b25,_0x1799ca){return db[_0x4be6('0x53')]['find']({'where':{'id':_0xb5e34['params']['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x360b25,null))[_0x4be6('0x36')](function(_0x44de04){if(_0x44de04){return _0x44de04['removeAgents'](_0xb5e34[_0x4be6('0x44')][_0x4be6('0x6b')])[_0x4be6('0x36')](function(){if(_[_0x4be6('0xae')](_0xb5e34['query']['ids'])){for(var _0x80bbf1=0x0;_0x80bbf1<_0xb5e34[_0x4be6('0x44')][_0x4be6('0x6b')][_0x4be6('0x47')];_0x80bbf1+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xb5e34[_0x4be6('0x44')][_0x4be6('0x6b')][_0x80bbf1]),'OpenchannelAccountId':Number(_0xb5e34[_0x4be6('0x59')]['id'])});}}else{socket[_0x4be6('0xaf')](_0x4be6('0xb0'),{'UserId':Number(_0xb5e34['query'][_0x4be6('0x6b')]),'OpenchannelAccountId':Number(_0xb5e34[_0x4be6('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x360b25,null))['catch'](handleError(_0x360b25,null));};exports[_0x4be6('0xb1')]=function(_0x5a312f,_0x2302dd,_0x102aa4){var _0x56b397={};var _0x38eb55={};var _0x16de53;var _0xb17c0a;return db['OpenchannelAccount'][_0x4be6('0x6e')]({'where':{'id':_0x5a312f[_0x4be6('0x59')]['id']}})[_0x4be6('0x36')](handleEntityNotFound(_0x2302dd,null))[_0x4be6('0x36')](function(_0x43d2b6){if(_0x43d2b6){_0x16de53=_0x43d2b6;_0x38eb55['model']=_[_0x4be6('0x43')](db['User'][_0x4be6('0x3f')]);_0x38eb55[_0x4be6('0x44')]=_[_0x4be6('0x43')](_0x5a312f['query']);_0x38eb55[_0x4be6('0x4d')]=_[_0x4be6('0x45')](_0x38eb55['model'],_0x38eb55['query']);_0x56b397['attributes']=_[_0x4be6('0x45')](_0x38eb55[_0x4be6('0x42')],qs[_0x4be6('0x5a')](_0x5a312f[_0x4be6('0x44')][_0x4be6('0x5a')]));_0x56b397[_0x4be6('0x46')]=_0x56b397['attributes'][_0x4be6('0x47')]?_0x56b397[_0x4be6('0x46')]:_0x38eb55[_0x4be6('0x42')];_0x56b397[_0x4be6('0x4a')]=qs[_0x4be6('0x4b')](_0x5a312f['query'][_0x4be6('0x4b')]);_0x56b397[_0x4be6('0x4c')]=qs['filters'](_['pick'](_0x5a312f['query'],_0x38eb55[_0x4be6('0x4d')]));if(_0x5a312f[_0x4be6('0x44')]['filter']){_0x56b397['where']=_[_0x4be6('0x50')](_0x56b397[_0x4be6('0x4c')],{'$or':_['map'](_0x56b397[_0x4be6('0x46')],function(_0x325f61){var _0x49dd50={};_0x49dd50[_0x325f61]={'$like':'%'+_0x5a312f[_0x4be6('0x44')]['filter']+'%'};return _0x49dd50;})});}_0x56b397=_['merge']({},_0x56b397,_0x5a312f[_0x4be6('0x52')]);return _0x16de53['getAgents'](_0x56b397);}})[_0x4be6('0x36')](function(_0x2b8497){if(_0x2b8497){_0xb17c0a=_0x2b8497[_0x4be6('0x47')];if(!_0x5a312f[_0x4be6('0x44')]['hasOwnProperty'](_0x4be6('0x49'))){_0x56b397[_0x4be6('0x2f')]=qs[_0x4be6('0x2f')](_0x5a312f[_0x4be6('0x44')]['limit']);_0x56b397[_0x4be6('0x2d')]=qs[_0x4be6('0x2d')](_0x5a312f[_0x4be6('0x44')][_0x4be6('0x2d')]);}return _0x16de53[_0x4be6('0xb1')](_0x56b397);}})['then'](function(_0x374cc9){if(_0x374cc9){return _0x374cc9?{'count':_0xb17c0a,'rows':_0x374cc9}:null;}})[_0x4be6('0x36')](respondWithResult(_0x2302dd,null))['catch'](handleError(_0x2302dd,null));};exports[_0x4be6('0x3c')]=function(_0x2bc5b4,_0x4ede7e,_0x244048){var _0x524759,_0x45cd10,_0x1bc1e3;if(_[_0x4be6('0x78')](_0x2bc5b4[_0x4be6('0x5c')][_0x4be6('0x5c')])||_0x2bc5b4[_0x4be6('0x5c')][_0x4be6('0x5c')]===''){throw new db[(_0x4be6('0x79'))]['ValidationError'](_0x4be6('0x7a'));}if(_[_0x4be6('0x78')](_0x2bc5b4[_0x4be6('0x5c')]['to'])){}_0x524759=_0x2bc5b4[_0x4be6('0x5c')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2bc5b4[_0x4be6('0x59')]['id']}})['then'](handleEntityNotFound(_0x4ede7e,null))['then'](function(_0x285f01){if(_0x285f01){return db['OpenchannelAccount'][_0x4be6('0x61')]({'where':{'id':_0x285f01['id']},'include':[{'model':db[_0x4be6('0xb2')],'as':'List','include':[{'model':db[_0x4be6('0x82')],'as':_0x4be6('0x83'),'where':{[_0x285f01[_0x4be6('0x7b')]]:_0x524759},'limit':0x1,'order':[[_0x4be6('0x84'),_0x4be6('0xb3')]]}]}]})[_0x4be6('0x36')](handleEntityNotFound(_0x4ede7e,null))[_0x4be6('0x36')](function(_0x3078c7){if(_0x3078c7&&_0x3078c7[_0x4be6('0x81')]){_0x45cd10=_0x3078c7[_0x4be6('0x38')]({'plain':!![]});if(_0x45cd10[_0x4be6('0x81')]&&_0x45cd10[_0x4be6('0x81')][_0x4be6('0x83')][_0x4be6('0x47')]){return _0x45cd10[_0x4be6('0x81')]['Contacts'][0x0];}return db['CmContact'][_0x4be6('0x5b')](_[_0x4be6('0xb4')](_0x2bc5b4[_0x4be6('0x5c')],{'firstName':_0x524759,[_0x3078c7[_0x4be6('0x7b')]]:_0x524759,'phone':_0x524759,'ListId':_0x45cd10[_0x4be6('0x77')]}));}})['then'](handleEntityNotFound(_0x4ede7e,null))[_0x4be6('0x36')](function(_0x4cc8d0){if(_0x4cc8d0){_0x1bc1e3=_0x4cc8d0;return db[_0x4be6('0x8f')]['find']({'where':{'ContactId':_0x1bc1e3['id'],'closed':![],'OpenchannelAccountId':_0x45cd10['id']}})[_0x4be6('0x36')](function(_0x18f3e4){if(_0x18f3e4){return[_0x18f3e4,![]];}return db[_0x4be6('0x8f')]['create']({'UserId':_0x2bc5b4[_0x4be6('0x5d')]['id'],'ContactId':_0x1bc1e3['id'],'OpenchannelAccountId':_0x45cd10['id'],'lastMsgDirection':_0x4be6('0xb5'),'Messages':[_[_0x4be6('0x50')](_0x2bc5b4[_0x4be6('0x5c')],{'read':![],'body':_0x2bc5b4['body'][_0x4be6('0x5c')],'OpenchannelAccountId':_0x45cd10['id'],'UserId':_0x2bc5b4[_0x4be6('0x5d')]['id'],'ContactId':_0x1bc1e3['id']})]},{'include':[{'model':db[_0x4be6('0x9a')],'as':_0x4be6('0xb6')}]})[_0x4be6('0x36')](function(_0x563abc){return[_0x563abc,!![]];});});}})['spread'](function(_0x5dd367,_0x2e53a7){if(_0x2e53a7){return _0x5dd367;}return db['OpenchannelMessage'][_0x4be6('0x5b')](_[_0x4be6('0x50')](_0x2bc5b4[_0x4be6('0x5c')],{'read':![],'body':_0x2bc5b4[_0x4be6('0x5c')]['body'],'OpenchannelAccountId':_0x45cd10['id'],'OpenchannelInteractionId':_0x5dd367['id'],'UserId':_0x2bc5b4[_0x4be6('0x5d')]['id'],'ContactId':_0x1bc1e3['id']}))['then'](function(_0xec1bd2){_0x5dd367[_0x4be6('0xb7')][_0x4be6('0xb6')]=[];_0x5dd367['dataValues'][_0x4be6('0xb6')][_0x4be6('0xb8')](_0xec1bd2['dataValues']);return _0x5dd367;});});}})['then'](respondWithResult(_0x4ede7e,null))['catch'](handleError(_0x4ede7e,null));}; \ No newline at end of file +var _0x981c=['firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','autoclose','push','close','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','Tag','Tags','tag','addAgents','omit','removeAgents','isArray','userOpenchannelAccount:remove','emit','getAgents','send','CmContact','out','Messages','dataValues','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','describe','OpenchannelAccountId','Disposition','findOne','pick','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','List','Contacts','DESC','Applications','orderBy','applications','priority','account','contact'];(function(_0x5569ab,_0x314dca){var _0xedc112=function(_0x57659e){while(--_0x57659e){_0x5569ab['push'](_0x5569ab['shift']());}};_0xedc112(++_0x314dca);}(_0x981c,0x19c));var _0xc981=function(_0x5228de,_0x365161){_0x5228de=_0x5228de-0x0;var _0x31f868=_0x981c[_0x5228de];return _0x31f868;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc981('0x0'));var rp=require(_0xc981('0x1'));var moment=require(_0xc981('0x2'));var BPromise=require(_0xc981('0x3'));var Mustache=require(_0xc981('0x4'));var util=require('util');var path=require(_0xc981('0x5'));var sox=require(_0xc981('0x6'));var csv=require('to-csv');var ejs=require(_0xc981('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc981('0x8'));var squel=require(_0xc981('0x9'));var crypto=require(_0xc981('0xa'));var jsforce=require(_0xc981('0xb'));var deskjs=require(_0xc981('0xc'));var toCsv=require(_0xc981('0xd'));var querystring=require(_0xc981('0xe'));var Papa=require(_0xc981('0xf'));var Redis=require(_0xc981('0x10'));var authService=require(_0xc981('0x11'));var qs=require(_0xc981('0x12'));var as=require(_0xc981('0x13'));var hardwareService=require(_0xc981('0x14'));var logger=require('../../config/logger')(_0xc981('0x15'));var utils=require(_0xc981('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc981('0x17'));var db=require(_0xc981('0x18'))['db'];config[_0xc981('0x19')]=_[_0xc981('0x1a')](config[_0xc981('0x19')],{'host':_0xc981('0x1b'),'port':0x18eb});var socket=require(_0xc981('0x1c'))(new Redis(config[_0xc981('0x19')]));require('./openchannelAccount.socket')[_0xc981('0x1d')](socket);var jayson=require(_0xc981('0x1e'));var client=jayson[_0xc981('0x1f')][_0xc981('0x20')]({'port':0x232c});var client9002=jayson[_0xc981('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bb8e4,_0x11b7c6,_0x349c03,_0x4dc3d5){return new BPromise(function(_0x45195a,_0x1f5a95){var _0x278279=_0x4dc3d5||client;return _0x278279[_0xc981('0x21')](_0x5bb8e4,_0x349c03)[_0xc981('0x22')](function(_0x3f38fb){logger[_0xc981('0x23')](_0xc981('0x24'),_0x11b7c6,_0xc981('0x25'));logger[_0xc981('0x26')](_0xc981('0x27'),_0x11b7c6,_0xc981('0x25'),JSON[_0xc981('0x28')](_0x3f38fb));if(_0x3f38fb[_0xc981('0x29')]){if(_0x3f38fb['error'][_0xc981('0x2a')]===0x1f4){logger[_0xc981('0x29')](_0xc981('0x24'),_0x11b7c6,_0x3f38fb[_0xc981('0x29')][_0xc981('0x2b')]);return _0x1f5a95(_0x3f38fb['error'][_0xc981('0x2b')]);}logger[_0xc981('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x11b7c6,_0x3f38fb[_0xc981('0x29')][_0xc981('0x2b')]);return _0x45195a(_0x3f38fb[_0xc981('0x29')][_0xc981('0x2b')]);}else{logger[_0xc981('0x23')](_0xc981('0x24'),_0x11b7c6,'request\x20sent');_0x45195a(_0x3f38fb[_0xc981('0x2c')][_0xc981('0x2b')]);}})[_0xc981('0x2d')](function(_0x38df6e){logger[_0xc981('0x29')](_0xc981('0x24'),_0x11b7c6,_0x38df6e);_0x1f5a95(_0x38df6e);});});}function respondWithStatusCode(_0x361019,_0x21b5ae){_0x21b5ae=_0x21b5ae||0xcc;return function(_0x1c34a0){if(_0x1c34a0){return _0x361019[_0xc981('0x2e')](_0x21b5ae);}return _0x361019[_0xc981('0x2f')](_0x21b5ae)[_0xc981('0x30')]();};}function respondWithResult(_0x406759,_0x590b84){_0x590b84=_0x590b84||0xc8;return function(_0x2ccc1f){if(_0x2ccc1f){return _0x406759[_0xc981('0x2f')](_0x590b84)[_0xc981('0x31')](_0x2ccc1f);}};}function respondWithFilteredResult(_0x42b08c,_0x109918){return function(_0xe70376){if(_0xe70376){var _0xd76af2=typeof _0x109918[_0xc981('0x32')]===_0xc981('0x33')&&typeof _0x109918[_0xc981('0x34')]===_0xc981('0x33');var _0x5ef2f1=_0xe70376[_0xc981('0x35')];var _0x444df9=_0xd76af2?0x0:_0x109918[_0xc981('0x32')];var _0xe50231=_0xd76af2?_0xe70376[_0xc981('0x35')]:_0x109918[_0xc981('0x32')]+_0x109918['limit'];var _0xaa04f5;if(_0xe50231>=_0x5ef2f1){_0xe50231=_0x5ef2f1;_0xaa04f5=0xc8;}else{_0xaa04f5=0xce;}_0x42b08c[_0xc981('0x2f')](_0xaa04f5);return _0x42b08c[_0xc981('0x36')]('Content-Range',_0x444df9+'-'+_0xe50231+'/'+_0x5ef2f1)[_0xc981('0x31')](_0xe70376);}return null;};}function patchUpdates(_0x117142){return function(_0xf54196){try{jsonpatch['apply'](_0xf54196,_0x117142,!![]);}catch(_0x35441c){return BPromise['reject'](_0x35441c);}return _0xf54196[_0xc981('0x37')]();};}function saveUpdates(_0x319a6c,_0x15a6ae){return function(_0x484168){if(_0x484168){return _0x484168[_0xc981('0x38')](_0x319a6c)[_0xc981('0x22')](function(_0x280b26){return _0x280b26;});}return null;};}function removeEntity(_0x55f863,_0xbaefc1){return function(_0x424561){if(_0x424561){return _0x424561[_0xc981('0x39')]()[_0xc981('0x22')](function(){var _0x1d89f1=_0x424561[_0xc981('0x3a')]({'plain':!![]});var _0x2ba648=_0xc981('0x3b');return db[_0xc981('0x3c')]['destroy']({'where':{'type':_0x2ba648,'resourceId':_0x1d89f1['id']}})['then'](function(){return _0x424561;});})[_0xc981('0x22')](function(){_0x55f863[_0xc981('0x2f')](0xcc)[_0xc981('0x30')]();});}};}function handleEntityNotFound(_0x106983,_0x1091fd){return function(_0xe9fb5b){if(!_0xe9fb5b){_0x106983['sendStatus'](0x194);}return _0xe9fb5b;};}function handleError(_0xeb3309,_0x507248){_0x507248=_0x507248||0x1f4;return function(_0x130752){logger[_0xc981('0x29')](_0x130752[_0xc981('0x3d')]);if(_0x130752[_0xc981('0x3e')]){delete _0x130752['name'];}_0xeb3309[_0xc981('0x2f')](_0x507248)['send'](_0x130752);};}exports[_0xc981('0x3f')]=function(_0x5e458d,_0x55501b){var _0x336f7c={'include':[{'model':db[_0xc981('0x40')],'as':_0xc981('0x41')}]},_0x13a3b0={},_0x306b15={'count':0x0,'rows':[]};var _0x5f17cd=_[_0xc981('0x42')](db[_0xc981('0x43')][_0xc981('0x44')],function(_0x198df4){return{'name':_0x198df4[_0xc981('0x45')],'type':_0x198df4[_0xc981('0x46')][_0xc981('0x47')]};});_0x13a3b0['model']=_[_0xc981('0x42')](_0x5f17cd,_0xc981('0x3e'));_0x13a3b0['query']=_[_0xc981('0x48')](_0x5e458d[_0xc981('0x49')]);_0x13a3b0[_0xc981('0x4a')]=_['intersection'](_0x13a3b0[_0xc981('0x4b')],_0x13a3b0[_0xc981('0x49')]);_0x336f7c['attributes']=_[_0xc981('0x4c')](_0x13a3b0[_0xc981('0x4b')],qs['fields'](_0x5e458d[_0xc981('0x49')][_0xc981('0x4d')]));_0x336f7c[_0xc981('0x4e')]=_0x336f7c['attributes'][_0xc981('0x4f')]?_0x336f7c['attributes']:_0x13a3b0[_0xc981('0x4b')];if(!_0x5e458d[_0xc981('0x49')][_0xc981('0x50')]('nolimit')){_0x336f7c[_0xc981('0x34')]=qs[_0xc981('0x34')](_0x5e458d[_0xc981('0x49')][_0xc981('0x34')]);_0x336f7c[_0xc981('0x32')]=qs[_0xc981('0x32')](_0x5e458d[_0xc981('0x49')][_0xc981('0x32')]);}_0x336f7c[_0xc981('0x51')]=qs['sort'](_0x5e458d[_0xc981('0x49')][_0xc981('0x52')]);_0x336f7c[_0xc981('0x53')]=qs[_0xc981('0x4a')](_['pick'](_0x5e458d[_0xc981('0x49')],_0x13a3b0[_0xc981('0x4a')]),_0x5f17cd);if(_0x5e458d[_0xc981('0x49')][_0xc981('0x54')]){_0x336f7c[_0xc981('0x53')]=_[_0xc981('0x55')](_0x336f7c[_0xc981('0x53')],{'$or':_[_0xc981('0x42')](_0x5f17cd,function(_0x5ec07c){if(_0x5ec07c[_0xc981('0x46')]!=='VIRTUAL'){var _0x57b5eb={};_0x57b5eb[_0x5ec07c[_0xc981('0x3e')]]={'$like':'%'+_0x5e458d[_0xc981('0x49')][_0xc981('0x54')]+'%'};return _0x57b5eb;}})});}_0x336f7c=_['merge']({},_0x336f7c,_0x5e458d[_0xc981('0x56')]);var _0x51ff74={'where':_0x336f7c[_0xc981('0x53')]};return db['OpenchannelAccount'][_0xc981('0x35')](_0x51ff74)[_0xc981('0x22')](function(_0x673cb3){_0x306b15[_0xc981('0x35')]=_0x673cb3;if(_0x5e458d[_0xc981('0x49')][_0xc981('0x57')]){_0x336f7c[_0xc981('0x58')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x336f7c);})[_0xc981('0x22')](function(_0x43e590){_0x306b15['rows']=_0x43e590;return _0x306b15;})[_0xc981('0x22')](respondWithFilteredResult(_0x55501b,_0x336f7c))[_0xc981('0x2d')](handleError(_0x55501b,null));};exports[_0xc981('0x59')]=function(_0x1477f5,_0x4a4764){var _0x195923={'raw':![],'where':{'id':_0x1477f5['params']['id']},'include':[{'model':db[_0xc981('0x40')],'as':_0xc981('0x41')}]},_0x1d2bf6={};_0x1d2bf6[_0xc981('0x4b')]=_[_0xc981('0x48')](db[_0xc981('0x43')][_0xc981('0x44')]);_0x1d2bf6['query']=_[_0xc981('0x48')](_0x1477f5[_0xc981('0x49')]);_0x1d2bf6[_0xc981('0x4a')]=_['intersection'](_0x1d2bf6['model'],_0x1d2bf6[_0xc981('0x49')]);_0x195923[_0xc981('0x4e')]=_[_0xc981('0x4c')](_0x1d2bf6[_0xc981('0x4b')],qs[_0xc981('0x4d')](_0x1477f5[_0xc981('0x49')]['fields']));_0x195923[_0xc981('0x4e')]=_0x195923[_0xc981('0x4e')]['length']?_0x195923[_0xc981('0x4e')]:_0x1d2bf6[_0xc981('0x4b')];if(_0x1477f5[_0xc981('0x49')]['includeAll']){_0x195923[_0xc981('0x58')]=[{'all':!![]}];}_0x195923=_[_0xc981('0x55')]({},_0x195923,_0x1477f5[_0xc981('0x56')]);return db['OpenchannelAccount'][_0xc981('0x5a')](_0x195923)[_0xc981('0x22')](handleEntityNotFound(_0x4a4764,null))[_0xc981('0x22')](respondWithResult(_0x4a4764,null))['catch'](handleError(_0x4a4764,null));};exports[_0xc981('0x5b')]=function(_0x42067e,_0x983268){return db[_0xc981('0x43')][_0xc981('0x5b')](_0x42067e[_0xc981('0x5c')],{})[_0xc981('0x22')](function(_0x11304a){var _0x5cfe8f=_0x42067e[_0xc981('0x5d')][_0xc981('0x3a')]({'plain':!![]});if(!_0x5cfe8f)throw new Error(_0xc981('0x5e'));if(_0x5cfe8f[_0xc981('0x5f')]===_0xc981('0x5d')){var _0x1afd1b=_0x11304a[_0xc981('0x3a')]({'plain':!![]});var _0x5e668f=_0xc981('0x3b');return db[_0xc981('0x60')][_0xc981('0x5a')]({'where':{'name':_0x5e668f,'userProfileId':_0x5cfe8f[_0xc981('0x61')]},'raw':!![]})['then'](function(_0x42111d){if(_0x42111d&&_0x42111d['autoAssociation']===0x0){return db[_0xc981('0x3c')]['create']({'name':_0x1afd1b[_0xc981('0x3e')],'resourceId':_0x1afd1b['id'],'type':_0x42111d[_0xc981('0x3e')],'sectionId':_0x42111d['id']},{})[_0xc981('0x22')](function(){return _0x11304a;});}else{return _0x11304a;}})[_0xc981('0x2d')](function(_0x1d92b1){logger[_0xc981('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d92b1);throw _0x1d92b1;});}return _0x11304a;})[_0xc981('0x22')](respondWithResult(_0x983268,0xc9))[_0xc981('0x2d')](handleError(_0x983268,null));};exports['update']=function(_0x374628,_0x24bc9f){if(_0x374628['body']['id']){delete _0x374628[_0xc981('0x5c')]['id'];}return db['OpenchannelAccount'][_0xc981('0x5a')]({'where':{'id':_0x374628[_0xc981('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0xc981('0x41')}]})['then'](handleEntityNotFound(_0x24bc9f,null))[_0xc981('0x22')](saveUpdates(_0x374628['body'],null))[_0xc981('0x22')](respondWithResult(_0x24bc9f,null))[_0xc981('0x2d')](handleError(_0x24bc9f,null));};exports['destroy']=function(_0x255cd5,_0xe502c2){return db[_0xc981('0x43')][_0xc981('0x5a')]({'where':{'id':_0x255cd5[_0xc981('0x62')]['id']}})['then'](handleEntityNotFound(_0xe502c2,null))[_0xc981('0x22')](removeEntity(_0xe502c2,null))[_0xc981('0x2d')](handleError(_0xe502c2,null));};exports[_0xc981('0x63')]=function(_0x183544,_0x1b822b){return db['OpenchannelAccount'][_0xc981('0x63')]()[_0xc981('0x22')](respondWithResult(_0x1b822b,null))[_0xc981('0x2d')](handleError(_0x1b822b,null));};exports['addDisposition']=function(_0x26719d,_0xf15c94,_0x494c69){if(_0x26719d[_0xc981('0x5c')]['id']){delete _0x26719d['body']['id'];}return db[_0xc981('0x43')][_0xc981('0x5a')]({'where':{'id':_0x26719d[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0xf15c94,null))[_0xc981('0x22')](function(_0x1b3791){if(_0x1b3791){_0x26719d['body'][_0xc981('0x64')]=_0x1b3791['id'];return db[_0xc981('0x65')]['create'](_0x26719d[_0xc981('0x5c')]);}})[_0xc981('0x22')](respondWithResult(_0xf15c94,null))[_0xc981('0x2d')](handleError(_0xf15c94,null));};exports['getDispositions']=function(_0x26d323,_0x485fd9,_0x249fdb){var _0x30a0c8={'raw':![],'where':{}};var _0x4b042c={};var _0x23500b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc981('0x66')]({'where':{'id':_0x26d323[_0xc981('0x62')]['id']}})['then'](handleEntityNotFound(_0x485fd9,null))[_0xc981('0x22')](function(_0x629233){if(_0x629233){_0x4b042c[_0xc981('0x4b')]=_['keys'](db[_0xc981('0x65')][_0xc981('0x44')]);_0x4b042c[_0xc981('0x49')]=_['keys'](_0x26d323[_0xc981('0x49')]);_0x4b042c[_0xc981('0x4a')]=_[_0xc981('0x4c')](_0x4b042c[_0xc981('0x4b')],_0x4b042c[_0xc981('0x49')]);_0x30a0c8[_0xc981('0x4e')]=_[_0xc981('0x4c')](_0x4b042c['model'],qs[_0xc981('0x4d')](_0x26d323['query'][_0xc981('0x4d')]));_0x30a0c8[_0xc981('0x4e')]=_0x30a0c8[_0xc981('0x4e')][_0xc981('0x4f')]?_0x30a0c8[_0xc981('0x4e')]:_0x4b042c[_0xc981('0x4b')];if(!_0x26d323['query'][_0xc981('0x50')]('nolimit')){_0x30a0c8[_0xc981('0x34')]=qs[_0xc981('0x34')](_0x26d323[_0xc981('0x49')][_0xc981('0x34')]);_0x30a0c8['offset']=qs[_0xc981('0x32')](_0x26d323[_0xc981('0x49')][_0xc981('0x32')]);}_0x30a0c8['order']=qs[_0xc981('0x52')](_0x26d323['query'][_0xc981('0x52')]);_0x30a0c8['where']=qs[_0xc981('0x4a')](_[_0xc981('0x67')](_0x26d323[_0xc981('0x49')],_0x4b042c[_0xc981('0x4a')]));_0x30a0c8[_0xc981('0x53')][_0xc981('0x64')]=_0x629233['id'];if(_0x26d323[_0xc981('0x49')][_0xc981('0x54')]){_0x30a0c8[_0xc981('0x53')]=_[_0xc981('0x55')](_0x30a0c8[_0xc981('0x53')],{'$or':_[_0xc981('0x42')](_0x30a0c8['attributes'],function(_0x1b9c14){var _0x2436b3={};_0x2436b3[_0x1b9c14]={'$like':'%'+_0x26d323['query'][_0xc981('0x54')]+'%'};return _0x2436b3;})});}_0x30a0c8=_[_0xc981('0x55')]({},_0x30a0c8,_0x26d323['options']);return db[_0xc981('0x65')]['count']({'where':_0x30a0c8['where']})['then'](function(_0x13d41b){_0x23500b['count']=_0x13d41b;if(_0x26d323[_0xc981('0x49')][_0xc981('0x57')]){_0x30a0c8['include']=[{'all':!![]}];}return db[_0xc981('0x65')][_0xc981('0x68')](_0x30a0c8);})[_0xc981('0x22')](function(_0x1f025c){_0x23500b[_0xc981('0x69')]=_0x1f025c;return _0x23500b;});}})[_0xc981('0x22')](respondWithFilteredResult(_0x485fd9,_0x30a0c8))[_0xc981('0x2d')](handleError(_0x485fd9,null));};exports[_0xc981('0x6a')]=function(_0x372778,_0x391c3e,_0x1cfbc8){return db['OpenchannelAccount'][_0xc981('0x5a')]({'where':{'id':_0x372778[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x391c3e,null))[_0xc981('0x22')](function(_0x593603){if(_0x593603){return _0x593603[_0xc981('0x6a')](_0x372778['query'][_0xc981('0x6b')]);}})['then'](respondWithStatusCode(_0x391c3e,null))[_0xc981('0x2d')](handleError(_0x391c3e,null));};exports[_0xc981('0x6c')]=function(_0x391e3d,_0x3beceb,_0x375225){if(_0x391e3d['body']['id']){delete _0x391e3d[_0xc981('0x5c')]['id'];}return db[_0xc981('0x43')]['find']({'where':{'id':_0x391e3d[_0xc981('0x62')]['id']}})['then'](handleEntityNotFound(_0x3beceb,null))[_0xc981('0x22')](function(_0xcdf652){if(_0xcdf652){_0x391e3d[_0xc981('0x5c')][_0xc981('0x64')]=_0xcdf652['id'];return db[_0xc981('0x6d')]['create'](_0x391e3d['body']);}})[_0xc981('0x22')](respondWithResult(_0x3beceb,null))[_0xc981('0x2d')](handleError(_0x3beceb,null));};exports[_0xc981('0x6e')]=function(_0x587de0,_0x5568e8,_0x3f29e3){var _0x57e2b6={'raw':![],'where':{}};var _0x45e0e4={};var _0x2bd851={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc981('0x66')]({'where':{'id':_0x587de0[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x5568e8,null))[_0xc981('0x22')](function(_0x37c015){if(_0x37c015){_0x45e0e4[_0xc981('0x4b')]=_[_0xc981('0x48')](db['CannedAnswer'][_0xc981('0x44')]);_0x45e0e4['query']=_[_0xc981('0x48')](_0x587de0[_0xc981('0x49')]);_0x45e0e4[_0xc981('0x4a')]=_[_0xc981('0x4c')](_0x45e0e4[_0xc981('0x4b')],_0x45e0e4['query']);_0x57e2b6['attributes']=_[_0xc981('0x4c')](_0x45e0e4['model'],qs[_0xc981('0x4d')](_0x587de0[_0xc981('0x49')]['fields']));_0x57e2b6[_0xc981('0x4e')]=_0x57e2b6[_0xc981('0x4e')][_0xc981('0x4f')]?_0x57e2b6[_0xc981('0x4e')]:_0x45e0e4[_0xc981('0x4b')];if(!_0x587de0['query'][_0xc981('0x50')](_0xc981('0x6f'))){_0x57e2b6[_0xc981('0x34')]=qs[_0xc981('0x34')](_0x587de0[_0xc981('0x49')]['limit']);_0x57e2b6[_0xc981('0x32')]=qs[_0xc981('0x32')](_0x587de0[_0xc981('0x49')][_0xc981('0x32')]);}_0x57e2b6[_0xc981('0x51')]=qs['sort'](_0x587de0[_0xc981('0x49')][_0xc981('0x52')]);_0x57e2b6['where']=qs[_0xc981('0x4a')](_[_0xc981('0x67')](_0x587de0[_0xc981('0x49')],_0x45e0e4[_0xc981('0x4a')]));_0x57e2b6['where'][_0xc981('0x64')]=_0x37c015['id'];if(_0x587de0[_0xc981('0x49')][_0xc981('0x54')]){_0x57e2b6[_0xc981('0x53')]=_['merge'](_0x57e2b6[_0xc981('0x53')],{'$or':_[_0xc981('0x42')](_0x57e2b6[_0xc981('0x4e')],function(_0x149a4b){var _0x5f4714={};_0x5f4714[_0x149a4b]={'$like':'%'+_0x587de0[_0xc981('0x49')]['filter']+'%'};return _0x5f4714;})});}_0x57e2b6=_['merge']({},_0x57e2b6,_0x587de0['options']);return db[_0xc981('0x6d')][_0xc981('0x35')]({'where':_0x57e2b6[_0xc981('0x53')]})[_0xc981('0x22')](function(_0x288900){_0x2bd851[_0xc981('0x35')]=_0x288900;if(_0x587de0[_0xc981('0x49')][_0xc981('0x57')]){_0x57e2b6[_0xc981('0x58')]=[{'all':!![]}];}return db[_0xc981('0x6d')][_0xc981('0x68')](_0x57e2b6);})[_0xc981('0x22')](function(_0x32871b){_0x2bd851[_0xc981('0x69')]=_0x32871b;return _0x2bd851;});}})[_0xc981('0x22')](respondWithFilteredResult(_0x5568e8,_0x57e2b6))['catch'](handleError(_0x5568e8,null));};exports[_0xc981('0x70')]=function(_0x1dac08,_0x508c2a,_0x429b38){return db[_0xc981('0x43')][_0xc981('0x5a')]({'where':{'id':_0x1dac08[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x508c2a,null))[_0xc981('0x22')](function(_0x30b270){if(_0x30b270){return _0x30b270[_0xc981('0x70')](_0x1dac08[_0xc981('0x49')][_0xc981('0x6b')]);}})[_0xc981('0x22')](respondWithStatusCode(_0x508c2a,null))[_0xc981('0x2d')](handleError(_0x508c2a,null));};exports[_0xc981('0x71')]=function(_0x21909d,_0x20d54b,_0x207be2){var _0x442851={'body':_0x21909d[_0xc981('0x5c')],'channel':'openchannel'};var _0x413434=[];var _0x2cbd77=[];var _0x233509={};var _0x20c7c2=![];return db['CmContact'][_0xc981('0x63')]()[_0xc981('0x22')](function(_0x51ce6f){if(!_0x51ce6f){throw new db[(_0xc981('0x72'))][(_0xc981('0x73'))]('no\x20available\x20attributes');}_0x413434=_[_0xc981('0x74')](_['keys'](_0x51ce6f),['createdAt','updatedAt']);_0x2cbd77=_['difference'](_[_0xc981('0x48')](_0x51ce6f),[_0xc981('0x75'),_0xc981('0x76'),_0xc981('0x77'),_0xc981('0x78')]);if(_0x21909d[_0xc981('0x5c')]['id']){delete _0x21909d['body']['id'];}if(_[_0xc981('0x79')](_0x21909d[_0xc981('0x5c')]['from'])){throw new db[(_0xc981('0x72'))]['ValidationError'](_0xc981('0x7a'));}if(_[_0xc981('0x79')](_0x21909d[_0xc981('0x5c')][_0xc981('0x5c')])||_0x21909d[_0xc981('0x5c')][_0xc981('0x5c')]===''){throw new db['Sequelize'][(_0xc981('0x73'))](_0xc981('0x7b'));}if(_[_0xc981('0x79')](_0x21909d[_0xc981('0x5c')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbd77);}if(!_[_0xc981('0x7c')](_0x2cbd77,_0x21909d[_0xc981('0x5c')]['mapKey'])){throw new db[(_0xc981('0x72'))]['ValidationError'](_0xc981('0x7d')+_0x2cbd77);}_0x233509[_0x21909d[_0xc981('0x5c')][_0xc981('0x7e')]]=_0x21909d[_0xc981('0x5c')][_0xc981('0x7f')];})['then'](function(){return db[_0xc981('0x43')][_0xc981('0x5a')]({'where':{'id':_0x21909d['params']['id']},'include':[{'model':db['CmList'],'as':_0xc981('0x80'),'include':[{'model':db['CmContact'],'as':_0xc981('0x81'),'where':_0x233509,'limit':0x1,'order':[[_0xc981('0x76'),_0xc981('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':_0xc981('0x83')}]});})[_0xc981('0x22')](handleEntityNotFound(_0x20d54b,null))['then'](function(_0x1d0477){if(_0x1d0477&&_0x1d0477[_0xc981('0x80')]){_0x442851['account']=_0x1d0477;_0x442851['applications']=_0x1d0477[_0xc981('0x83')];_0x442851['list']=_0x1d0477['List'];_0x442851['applications']=_[_0xc981('0x84')](_0x442851[_0xc981('0x85')],[_0xc981('0x86')],['asc']);if(_0x442851[_0xc981('0x87')][_0xc981('0x83')]){delete _0x442851['account'][_0xc981('0x83')];}if(_0x442851[_0xc981('0x87')][_0xc981('0x80')]&&_0x442851[_0xc981('0x87')]['List'][_0xc981('0x81')][_0xc981('0x4f')]){return _0x442851['account'][_0xc981('0x80')][_0xc981('0x81')][0x0];}var _0x38263f=_[_0xc981('0x1a')](_0x21909d['body'],{'firstName':_0x21909d[_0xc981('0x5c')][_0xc981('0x7f')],'ListId':_0x1d0477[_0xc981('0x78')]});_0x38263f[_0x21909d[_0xc981('0x5c')][_0xc981('0x7e')]]=_0x21909d[_0xc981('0x5c')][_0xc981('0x7f')];return db['CmContact']['create'](_0x38263f,{'fields':_0x413434,'raw':!![]});}})[_0xc981('0x22')](handleEntityNotFound(_0x20d54b,null))['then'](function(_0x220434){_0x442851[_0xc981('0x88')]=_0x220434;if(_0x220434){var _0x3c0dcc={'ContactId':_0x220434['id'],'OpenchannelAccountId':_0x21909d[_0xc981('0x62')]['id'],'from':(_0x220434[_0xc981('0x89')]||'')+'\x20'+(_0x220434['lastName']||'')};var _0x4984a0={'OpenchannelAccountId':_0x21909d['params']['id'],'closed':![]};if(_0x21909d[_0xc981('0x5c')][_0xc981('0x8a')]){_0x4984a0[_0xc981('0x8a')]=_0x21909d[_0xc981('0x5c')][_0xc981('0x8a')];return db[_0xc981('0x8b')][_0xc981('0x5a')]({'where':_0x4984a0})[_0xc981('0x22')](function(_0x4a59b6){if(_0x4a59b6){return[_0x4a59b6,![]];}_0x3c0dcc[_0xc981('0x8a')]=_0x21909d['body'][_0xc981('0x8a')];_0x3c0dcc['externalUrl']=_0x21909d[_0xc981('0x5c')][_0xc981('0x8c')];return db[_0xc981('0x8b')]['create'](_0x3c0dcc)[_0xc981('0x22')](function(_0x28637a){return[_0x28637a,!![]];});});}else{_0x4984a0['threadId']=null;}_0x4984a0[_0xc981('0x8d')]=_0x220434['id'];return db[_0xc981('0x8b')][_0xc981('0x5a')]({'where':_0x4984a0})[_0xc981('0x22')](function(_0x26901c){if(_0x26901c){return[_0x26901c,![]];}return db['OpenchannelInteraction'][_0xc981('0x5b')](_0x3c0dcc)[_0xc981('0x22')](function(_0x34c096){return[_0x34c096,!![]];});});}})[_0xc981('0x8e')](function(_0x3f322c,_0x240371){if(_0x3f322c){_0x20c7c2=_0x240371;if(!_0x240371){var _0x158340={'from':(_0x442851[_0xc981('0x88')][_0xc981('0x89')]||'')+'\x20'+(_0x442851[_0xc981('0x88')][_0xc981('0x8f')]||'')};if(_0x21909d[_0xc981('0x5c')][_0xc981('0x8a')]&&_0x21909d['body']['messageId']&&_0x21909d[_0xc981('0x5c')][_0xc981('0x8a')]!=_0x21909d[_0xc981('0x5c')][_0xc981('0x90')]){_0x158340[_0xc981('0x8a')]=_0x21909d['body'][_0xc981('0x90')];}return _0x3f322c[_0xc981('0x38')](_0x158340);}else{return _0x3f322c;}}})[_0xc981('0x22')](function(_0x3fd9d7){_0x442851[_0xc981('0x91')]=_0x3fd9d7[_0xc981('0x3a')]({'plain':!![]});_0x442851[_0xc981('0x91')]['created']=_0x20c7c2;if(_0x442851[_0xc981('0x91')]['created']){if(_0x442851[_0xc981('0x87')][_0xc981('0x92')]){_0x442851['applications'][_0xc981('0x93')]({'id':0x0,'priority':_0x442851['applications'][_0xc981('0x4f')]+0x1,'app':_0xc981('0x94'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xc981('0x95')][_0xc981('0x5b')]({'body':_0x21909d['body'][_0xc981('0x5c')],'OpenchannelAccountId':_0x21909d['params']['id'],'OpenchannelInteractionId':_0x3fd9d7['id'],'direction':'in','ContactId':_0x442851['contact']['id'],'AttachmentId':_0x21909d[_0xc981('0x5c')][_0xc981('0x96')]});})[_0xc981('0x22')](function(_0xecb6ff){_0x442851[_0xc981('0x2b')]=_0xecb6ff;if(_0x442851[_0xc981('0x91')][_0xc981('0x97')]){return db[_0xc981('0x98')][_0xc981('0x5a')]({'attributes':['id',_0xc981('0x3e')],'where':{'id':_0x442851['interaction'][_0xc981('0x97')]}})[_0xc981('0x22')](function(_0x3070c2){if(_0x3070c2){_0x442851[_0xc981('0x85')][_0xc981('0x99')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3070c2['name']+','+(_0x442851[_0xc981('0x87')][_0xc981('0x9a')]||0xa),'interval':_0xc981('0x9b')});_0x442851[_0xc981('0x9c')]=![];}return respondWithRpcPromise(_0xc981('0x9d'),_0xc981('0x9e'),_0x442851);});}return respondWithRpcPromise(_0xc981('0x9d'),_0xc981('0x9e'),_0x442851);})['then'](function(_0x3ee066){respondWithRpcPromise(_0xc981('0x9f'),'EventManager',{'event':_0xc981('0x71'),'message':_0x3ee066},client9002);return _0x3ee066;})[_0xc981('0x22')](respondWithResult(_0x20d54b,null))[_0xc981('0x2d')](handleError(_0x20d54b,null));};exports[_0xc981('0xa0')]=function(_0x147648,_0x3edb65,_0x504c88){return db[_0xc981('0x43')][_0xc981('0x66')]({'where':{'id':_0x147648[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x3edb65,null))[_0xc981('0x22')](function(_0x2bb8bc){if(_0x2bb8bc){return db[_0xc981('0xa1')][_0xc981('0xa2')](function(_0x314644){return db[_0xc981('0xa3')]['destroy']({'where':{'OpenchannelAccountId':_0x147648['params']['id']},'transaction':_0x314644})[_0xc981('0x22')](function(_0x28dc84){var _0x547e83=_['map'](_0x147648['body'],function(_0xa0d7f6){_0xa0d7f6[_0xc981('0x64')]=_0x147648[_0xc981('0x62')]['id'];return _0xa0d7f6;});return db[_0xc981('0xa3')]['bulkCreate'](_0x547e83,{'transaction':_0x314644});});})[_0xc981('0x22')](function(){return db['OpenchannelApplication'][_0xc981('0xa4')]({'where':{'OpenchannelAccountId':_0x147648['params']['id']},'order':_0xc981('0x86')});});}})[_0xc981('0x22')](respondWithResult(_0x3edb65,null))[_0xc981('0x2d')](handleError(_0x3edb65,null));};exports['getApplications']=function(_0xcd1d10,_0xbbedb6,_0x5eb539){var _0x5d4ce6={};var _0x55e24d={};var _0x57e5d3;var _0x4bdfa2;return db[_0xc981('0x43')][_0xc981('0x66')]({'where':{'id':_0xcd1d10[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0xbbedb6,null))['then'](function(_0x5eab9b){if(_0x5eab9b){_0x57e5d3=_0x5eab9b;_0x55e24d[_0xc981('0x4b')]=_['keys'](db[_0xc981('0xa3')][_0xc981('0x44')]);_0x55e24d['query']=_[_0xc981('0x48')](_0xcd1d10[_0xc981('0x49')]);_0x55e24d[_0xc981('0x4a')]=_[_0xc981('0x4c')](_0x55e24d['model'],_0x55e24d['query']);_0x5d4ce6['attributes']=_[_0xc981('0x4c')](_0x55e24d[_0xc981('0x4b')],qs['fields'](_0xcd1d10[_0xc981('0x49')][_0xc981('0x4d')]));_0x5d4ce6[_0xc981('0x4e')]=_0x5d4ce6[_0xc981('0x4e')]['length']?_0x5d4ce6['attributes']:_0x55e24d[_0xc981('0x4b')];_0x5d4ce6['order']=qs[_0xc981('0x52')](_0xcd1d10['query'][_0xc981('0x52')]);_0x5d4ce6['where']=qs[_0xc981('0x4a')](_[_0xc981('0x67')](_0xcd1d10[_0xc981('0x49')],_0x55e24d['filters']));if(_0xcd1d10[_0xc981('0x49')][_0xc981('0x54')]){_0x5d4ce6[_0xc981('0x53')]=_[_0xc981('0x55')](_0x5d4ce6['where'],{'$or':_[_0xc981('0x42')](_0x5d4ce6[_0xc981('0x4e')],function(_0x24e5c5){var _0x27b10d={};_0x27b10d[_0x24e5c5]={'$like':'%'+_0xcd1d10[_0xc981('0x49')][_0xc981('0x54')]+'%'};return _0x27b10d;})});}_0x5d4ce6=_[_0xc981('0x55')]({},_0x5d4ce6,_0xcd1d10[_0xc981('0x56')]);return _0x57e5d3[_0xc981('0xa5')](_0x5d4ce6);}})['then'](function(_0xfa3c97){if(_0xfa3c97){_0x4bdfa2=_0xfa3c97[_0xc981('0x4f')];if(!_0xcd1d10[_0xc981('0x49')][_0xc981('0x50')](_0xc981('0x6f'))){_0x5d4ce6[_0xc981('0x34')]=qs[_0xc981('0x34')](_0xcd1d10[_0xc981('0x49')][_0xc981('0x34')]);_0x5d4ce6[_0xc981('0x32')]=qs[_0xc981('0x32')](_0xcd1d10[_0xc981('0x49')][_0xc981('0x32')]);}return _0x57e5d3[_0xc981('0xa5')](_0x5d4ce6);}})[_0xc981('0x22')](function(_0x218f90){if(_0x218f90){return _0x218f90?{'count':_0x4bdfa2,'rows':_0x218f90}:null;}})[_0xc981('0x22')](respondWithResult(_0xbbedb6,null))[_0xc981('0x2d')](handleError(_0xbbedb6,null));};exports[_0xc981('0xa6')]=function(_0xd3e2ae,_0x3acb90,_0x2f20da){var _0xd215c4={'raw':![],'where':{}};var _0x27276f={};var _0x4e19a9={'count':0x0,'rows':[]};return db[_0xc981('0x43')][_0xc981('0x66')]({'where':{'id':_0xd3e2ae[_0xc981('0x62')]['id']}})['then'](handleEntityNotFound(_0x3acb90,null))[_0xc981('0x22')](function(_0x554819){if(_0x554819){_0x27276f[_0xc981('0x4b')]=_[_0xc981('0x48')](db['OpenchannelInteraction'][_0xc981('0x44')]);_0x27276f['query']=_[_0xc981('0x48')](_0xd3e2ae[_0xc981('0x49')]);_0x27276f[_0xc981('0x4a')]=_[_0xc981('0x4c')](_0x27276f[_0xc981('0x4b')],_0x27276f[_0xc981('0x49')]);_0xd215c4[_0xc981('0x4e')]=_[_0xc981('0x4c')](_0x27276f['model'],qs[_0xc981('0x4d')](_0xd3e2ae[_0xc981('0x49')]['fields']));_0xd215c4['attributes']=_0xd215c4[_0xc981('0x4e')][_0xc981('0x4f')]?_0xd215c4['attributes']:_0x27276f[_0xc981('0x4b')];if(!_0xd3e2ae[_0xc981('0x49')]['hasOwnProperty'](_0xc981('0x6f'))){_0xd215c4[_0xc981('0x34')]=qs[_0xc981('0x34')](_0xd3e2ae[_0xc981('0x49')]['limit']);_0xd215c4['offset']=qs[_0xc981('0x32')](_0xd3e2ae[_0xc981('0x49')][_0xc981('0x32')]);}_0xd215c4['order']=qs[_0xc981('0x52')](_0xd3e2ae['query'][_0xc981('0x52')]);_0xd215c4[_0xc981('0x53')]=qs[_0xc981('0x4a')](_[_0xc981('0x67')](_0xd3e2ae[_0xc981('0x49')],_0x27276f[_0xc981('0x4a')]));_0xd215c4[_0xc981('0x53')][_0xc981('0x64')]=_0x554819['id'];if(_0xd3e2ae[_0xc981('0x49')][_0xc981('0x54')]){_0xd215c4[_0xc981('0x53')]=_['merge'](_0xd215c4[_0xc981('0x53')],{'$or':_[_0xc981('0x42')](_0xd215c4[_0xc981('0x4e')],function(_0x11b709){var _0x18c290={};_0x18c290[_0x11b709]={'$like':'%'+_0xd3e2ae['query'][_0xc981('0x54')]+'%'};return _0x18c290;})});}_0xd215c4=_['merge']({},_0xd215c4,_0xd3e2ae[_0xc981('0x56')]);return db[_0xc981('0x8b')][_0xc981('0x35')]({'where':_0xd215c4[_0xc981('0x53')]})[_0xc981('0x22')](function(_0x3ce64c){_0x4e19a9[_0xc981('0x35')]=_0x3ce64c;if(_0xd3e2ae[_0xc981('0x49')][_0xc981('0x57')]){_0xd215c4['include']=[{'model':db['CmContact'],'as':_0xc981('0xa7'),'required':![]},{'model':db[_0xc981('0x98')],'as':'Owner','attributes':[_0xc981('0x3e'),'fullname','internal'],'required':![]},{'model':db[_0xc981('0xa8')],'as':_0xc981('0xa9'),'attributes':['id',_0xc981('0x3e'),'color'],'where':_0xd3e2ae[_0xc981('0x49')][_0xc981('0xaa')]?{'id':_0xd3e2ae[_0xc981('0x49')]['tag']}:undefined,'required':_0xd3e2ae[_0xc981('0x49')]['tag']?!![]:![]}];}return db['OpenchannelInteraction'][_0xc981('0x68')](_0xd215c4);})[_0xc981('0x22')](function(_0x5936ba){_0x4e19a9[_0xc981('0x69')]=_0x5936ba;return _0x4e19a9;});}})[_0xc981('0x22')](respondWithFilteredResult(_0x3acb90,_0xd215c4))['catch'](handleError(_0x3acb90,null));};exports['addAgents']=function(_0x5f5d32,_0x3d8e28,_0xe6ebf8){return db[_0xc981('0x43')][_0xc981('0x5a')]({'where':{'id':_0x5f5d32['params']['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x3d8e28,null))[_0xc981('0x22')](function(_0x78539d){if(_0x78539d){return _0x78539d[_0xc981('0xab')](_0x5f5d32[_0xc981('0x5c')][_0xc981('0x6b')],_[_0xc981('0xac')](_0x5f5d32['body'],[_0xc981('0x6b'),'id'])||{})[_0xc981('0x8e')](function(_0x2491bb){for(var _0x3ddb00=0x0;_0x3ddb00<_0x5f5d32[_0xc981('0x5c')][_0xc981('0x6b')]['length'];_0x3ddb00+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x5f5d32[_0xc981('0x5c')][_0xc981('0x6b')][_0x3ddb00]),'OpenchannelAccountId':Number(_0x5f5d32[_0xc981('0x62')]['id'])});}return _0x2491bb;});}})['then'](respondWithResult(_0x3d8e28,null))[_0xc981('0x2d')](handleError(_0x3d8e28,null));};exports[_0xc981('0xad')]=function(_0x1e7fa8,_0x17d16f,_0xc5a0d1){return db[_0xc981('0x43')]['find']({'where':{'id':_0x1e7fa8[_0xc981('0x62')]['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x17d16f,null))[_0xc981('0x22')](function(_0x4ebc16){if(_0x4ebc16){return _0x4ebc16[_0xc981('0xad')](_0x1e7fa8[_0xc981('0x49')][_0xc981('0x6b')])[_0xc981('0x22')](function(){if(_[_0xc981('0xae')](_0x1e7fa8[_0xc981('0x49')][_0xc981('0x6b')])){for(var _0x30236d=0x0;_0x30236d<_0x1e7fa8['query']['ids']['length'];_0x30236d+=0x1){socket['emit'](_0xc981('0xaf'),{'UserId':Number(_0x1e7fa8[_0xc981('0x49')][_0xc981('0x6b')][_0x30236d]),'OpenchannelAccountId':Number(_0x1e7fa8[_0xc981('0x62')]['id'])});}}else{socket[_0xc981('0xb0')](_0xc981('0xaf'),{'UserId':Number(_0x1e7fa8[_0xc981('0x49')][_0xc981('0x6b')]),'OpenchannelAccountId':Number(_0x1e7fa8[_0xc981('0x62')]['id'])});}});}})[_0xc981('0x22')](respondWithStatusCode(_0x17d16f,null))[_0xc981('0x2d')](handleError(_0x17d16f,null));};exports['getAgents']=function(_0x440bae,_0x11a899,_0x52f6a5){var _0x206776={};var _0x2b7812={};var _0xf41131;var _0x385aca;return db[_0xc981('0x43')][_0xc981('0x66')]({'where':{'id':_0x440bae['params']['id']}})[_0xc981('0x22')](handleEntityNotFound(_0x11a899,null))[_0xc981('0x22')](function(_0x160c7d){if(_0x160c7d){_0xf41131=_0x160c7d;_0x2b7812['model']=_[_0xc981('0x48')](db[_0xc981('0x98')][_0xc981('0x44')]);_0x2b7812['query']=_[_0xc981('0x48')](_0x440bae[_0xc981('0x49')]);_0x2b7812[_0xc981('0x4a')]=_[_0xc981('0x4c')](_0x2b7812[_0xc981('0x4b')],_0x2b7812[_0xc981('0x49')]);_0x206776[_0xc981('0x4e')]=_[_0xc981('0x4c')](_0x2b7812[_0xc981('0x4b')],qs[_0xc981('0x4d')](_0x440bae[_0xc981('0x49')][_0xc981('0x4d')]));_0x206776['attributes']=_0x206776[_0xc981('0x4e')][_0xc981('0x4f')]?_0x206776[_0xc981('0x4e')]:_0x2b7812[_0xc981('0x4b')];_0x206776[_0xc981('0x51')]=qs[_0xc981('0x52')](_0x440bae[_0xc981('0x49')][_0xc981('0x52')]);_0x206776[_0xc981('0x53')]=qs[_0xc981('0x4a')](_[_0xc981('0x67')](_0x440bae[_0xc981('0x49')],_0x2b7812[_0xc981('0x4a')]));if(_0x440bae[_0xc981('0x49')][_0xc981('0x54')]){_0x206776[_0xc981('0x53')]=_[_0xc981('0x55')](_0x206776[_0xc981('0x53')],{'$or':_['map'](_0x206776[_0xc981('0x4e')],function(_0x462070){var _0x20bc56={};_0x20bc56[_0x462070]={'$like':'%'+_0x440bae[_0xc981('0x49')][_0xc981('0x54')]+'%'};return _0x20bc56;})});}_0x206776=_[_0xc981('0x55')]({},_0x206776,_0x440bae[_0xc981('0x56')]);return _0xf41131[_0xc981('0xb1')](_0x206776);}})[_0xc981('0x22')](function(_0x178550){if(_0x178550){_0x385aca=_0x178550['length'];if(!_0x440bae['query'][_0xc981('0x50')](_0xc981('0x6f'))){_0x206776[_0xc981('0x34')]=qs[_0xc981('0x34')](_0x440bae['query'][_0xc981('0x34')]);_0x206776[_0xc981('0x32')]=qs['offset'](_0x440bae[_0xc981('0x49')][_0xc981('0x32')]);}return _0xf41131[_0xc981('0xb1')](_0x206776);}})[_0xc981('0x22')](function(_0x5769d5){if(_0x5769d5){return _0x5769d5?{'count':_0x385aca,'rows':_0x5769d5}:null;}})[_0xc981('0x22')](respondWithResult(_0x11a899,null))[_0xc981('0x2d')](handleError(_0x11a899,null));};exports[_0xc981('0xb2')]=function(_0x39e45b,_0x3e7e87,_0x150fb0){var _0x13689d,_0x500f6d,_0x54863d;if(_[_0xc981('0x79')](_0x39e45b['body'][_0xc981('0x5c')])||_0x39e45b[_0xc981('0x5c')]['body']===''){throw new db[(_0xc981('0x72'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc981('0x79')](_0x39e45b[_0xc981('0x5c')]['to'])){}_0x13689d=_0x39e45b[_0xc981('0x5c')]['to'];return db[_0xc981('0x43')][_0xc981('0x66')]({'where':{'id':_0x39e45b[_0xc981('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e7e87,null))[_0xc981('0x22')](function(_0x33d74d){if(_0x33d74d){return db[_0xc981('0x43')]['find']({'where':{'id':_0x33d74d['id']},'include':[{'model':db['CmList'],'as':_0xc981('0x80'),'include':[{'model':db['CmContact'],'as':_0xc981('0x81'),'where':{[_0x33d74d['mapKey']]:_0x13689d},'limit':0x1,'order':[[_0xc981('0x76'),_0xc981('0x82')]]}]}]})['then'](handleEntityNotFound(_0x3e7e87,null))[_0xc981('0x22')](function(_0x27e337){if(_0x27e337&&_0x27e337[_0xc981('0x80')]){_0x500f6d=_0x27e337[_0xc981('0x3a')]({'plain':!![]});if(_0x500f6d[_0xc981('0x80')]&&_0x500f6d[_0xc981('0x80')][_0xc981('0x81')][_0xc981('0x4f')]){return _0x500f6d[_0xc981('0x80')][_0xc981('0x81')][0x0];}return db[_0xc981('0xb3')][_0xc981('0x5b')](_[_0xc981('0x1a')](_0x39e45b[_0xc981('0x5c')],{'firstName':_0x13689d,[_0x27e337['mapKey']]:_0x13689d,'phone':_0x13689d,'ListId':_0x500f6d[_0xc981('0x78')]}));}})[_0xc981('0x22')](handleEntityNotFound(_0x3e7e87,null))[_0xc981('0x22')](function(_0x53010f){if(_0x53010f){_0x54863d=_0x53010f;return db[_0xc981('0x8b')][_0xc981('0x5a')]({'where':{'ContactId':_0x54863d['id'],'closed':![],'OpenchannelAccountId':_0x500f6d['id']}})[_0xc981('0x22')](function(_0x51db86){if(_0x51db86){return[_0x51db86,![]];}return db['OpenchannelInteraction'][_0xc981('0x5b')]({'UserId':_0x39e45b[_0xc981('0x5d')]['id'],'ContactId':_0x54863d['id'],'OpenchannelAccountId':_0x500f6d['id'],'lastMsgDirection':_0xc981('0xb4'),'Messages':[_[_0xc981('0x55')](_0x39e45b[_0xc981('0x5c')],{'read':![],'body':_0x39e45b['body'][_0xc981('0x5c')],'OpenchannelAccountId':_0x500f6d['id'],'UserId':_0x39e45b[_0xc981('0x5d')]['id'],'ContactId':_0x54863d['id']})]},{'include':[{'model':db[_0xc981('0x95')],'as':_0xc981('0xb5')}]})['then'](function(_0x37d181){return[_0x37d181,!![]];});});}})['spread'](function(_0x29a064,_0x5b2741){if(_0x5b2741){return _0x29a064;}return db[_0xc981('0x95')][_0xc981('0x5b')](_[_0xc981('0x55')](_0x39e45b['body'],{'read':![],'body':_0x39e45b[_0xc981('0x5c')][_0xc981('0x5c')],'OpenchannelAccountId':_0x500f6d['id'],'OpenchannelInteractionId':_0x29a064['id'],'UserId':_0x39e45b['user']['id'],'ContactId':_0x54863d['id']}))[_0xc981('0x22')](function(_0x1bca63){_0x29a064[_0xc981('0xb6')][_0xc981('0xb5')]=[];_0x29a064['dataValues'][_0xc981('0xb5')][_0xc981('0x93')](_0x1bca63[_0xc981('0xb6')]);return _0x29a064;});});}})[_0xc981('0x22')](respondWithResult(_0x3e7e87,null))[_0xc981('0x2d')](handleError(_0x3e7e87,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index d259fe9..39049d5 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 _0x91a7=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit','hasOwnProperty','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x91a7,0xe7));var _0x791a=function(_0x2a7e6f,_0x3418c5){_0x2a7e6f=_0x2a7e6f-0x0;var _0x4e4167=_0x91a7[_0x2a7e6f];return _0x4e4167;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x791a('0x0'))['db'][_0x791a('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x791a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x791a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6392){return function(_0x535640,_0x50ab29,_0x32fe2b){OpenchannelAccountEvents[_0x791a('0x4')](_0x2f6392+':'+_0x535640['id'],_0x535640);OpenchannelAccountEvents['emit'](_0x2f6392,_0x535640);_0x32fe2b(null);};}for(var e in events){if(events[_0x791a('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x791a('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x70e0=['emit','events','../../mysqldb','OpenchannelAccount','update','remove'];(function(_0x4daeaa,_0x46072f){var _0x5ce99a=function(_0x2284f2){while(--_0x2284f2){_0x4daeaa['push'](_0x4daeaa['shift']());}};_0x5ce99a(++_0x46072f);}(_0x70e0,0x17b));var _0x070e=function(_0x53613f,_0x205a47){_0x53613f=_0x53613f-0x0;var _0x2e4284=_0x70e0[_0x53613f];return _0x2e4284;};'use strict';var EventEmitter=require(_0x070e('0x0'));var OpenchannelAccount=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){OpenchannelAccountEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);OpenchannelAccountEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8ef615f..65ac26d 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(_0xb38490,_0x40aff6){var _0x286dbb=function(_0x213395){while(--_0x213395){_0xb38490['push'](_0xb38490['shift']());}};_0x286dbb(++_0x40aff6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1b9443,_0x49ecca){var _0x474e87=function(_0x4c98f0){while(--_0x4c98f0){_0x1b9443['push'](_0x1b9443['shift']());}};_0x474e87(++_0x49ecca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 d3aa2ff..5664544 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 _0x1752=['client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42c282,_0x2c14c7){var _0x537c85=function(_0xfe799){while(--_0xfe799){_0x42c282['push'](_0x42c282['shift']());}};_0x537c85(++_0x2c14c7);}(_0x1752,0xa5));var _0x2175=function(_0x5f1091,_0x4ed3c3){_0x5f1091=_0x5f1091-0x0;var _0x28be0b=_0x1752[_0x5f1091];return _0x28be0b;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var moment=require(_0x2175('0x1'));var BPromise=require(_0x2175('0x2'));var rs=require(_0x2175('0x3'));var fs=require('fs');var Redis=require(_0x2175('0x4'));var db=require(_0x2175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2175('0x6'))(_0x2175('0x7'));var config=require(_0x2175('0x8'));var jayson=require(_0x2175('0x9'));var client=jayson[_0x2175('0xa')][_0x2175('0xb')]({'port':0x232a});config[_0x2175('0xc')]=_[_0x2175('0xd')](config[_0x2175('0xc')],{'host':_0x2175('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2175('0xc')]));require(_0x2175('0xf'))[_0x2175('0x10')](socket);function respondWithRpcPromise(_0x455803,_0x77e3fa,_0x4be8c8){return new BPromise(function(_0x5ad5ad,_0x5717b0){return client[_0x2175('0x11')](_0x455803,_0x4be8c8)['then'](function(_0x5e275f){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x77e3fa,_0x2175('0x12'));logger['debug'](_0x2175('0x13'),_0x77e3fa,_0x2175('0x12'),JSON['stringify'](_0x5e275f));if(_0x5e275f[_0x2175('0x14')]){if(_0x5e275f[_0x2175('0x14')][_0x2175('0x15')]===0x1f4){logger[_0x2175('0x14')](_0x2175('0x16'),_0x77e3fa,_0x5e275f[_0x2175('0x14')][_0x2175('0x17')]);return _0x5717b0(_0x5e275f[_0x2175('0x14')]['message']);}logger['error'](_0x2175('0x16'),_0x77e3fa,_0x5e275f[_0x2175('0x14')][_0x2175('0x17')]);return _0x5ad5ad(_0x5e275f['error']['message']);}else{logger['info'](_0x2175('0x16'),_0x77e3fa,_0x2175('0x12'));_0x5ad5ad(_0x5e275f['result']['message']);}})[_0x2175('0x18')](function(_0x3d6467){logger[_0x2175('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x77e3fa,_0x3d6467);_0x5717b0(_0x3d6467);});});} \ No newline at end of file +var _0xdb94=['randomstring','../../mysqldb','../../config/utils','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./openchannelAccount.socket','register','request','info','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x116682,_0x2da114){var _0xc05e6e=function(_0x2c5c16){while(--_0x2c5c16){_0x116682['push'](_0x116682['shift']());}};_0xc05e6e(++_0x2da114);}(_0xdb94,0xab));var _0x4db9=function(_0x1891df,_0x13f014){_0x1891df=_0x1891df-0x0;var _0x4547d6=_0xdb94[_0x1891df];return _0x4547d6;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});config['redis']=_[_0x4db9('0x9')](config['redis'],{'host':_0x4db9('0xa'),'port':0x18eb});var socket=require(_0x4db9('0xb'))(new Redis(config[_0x4db9('0xc')]));require(_0x4db9('0xd'))[_0x4db9('0xe')](socket);function respondWithRpcPromise(_0x242116,_0x45c0e4,_0xeb2168){return new BPromise(function(_0x26f3ae,_0x2bf991){return client[_0x4db9('0xf')](_0x242116,_0xeb2168)['then'](function(_0x451970){logger[_0x4db9('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,'request\x20sent');logger[_0x4db9('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45c0e4,'request\x20sent',JSON[_0x4db9('0x12')](_0x451970));if(_0x451970[_0x4db9('0x13')]){if(_0x451970['error'][_0x4db9('0x14')]===0x1f4){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x451970[_0x4db9('0x13')]['message']);return _0x2bf991(_0x451970['error'][_0x4db9('0x16')]);}logger[_0x4db9('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x45c0e4,_0x451970[_0x4db9('0x13')][_0x4db9('0x16')]);return _0x26f3ae(_0x451970['error']['message']);}else{logger[_0x4db9('0x10')](_0x4db9('0x15'),_0x45c0e4,_0x4db9('0x17'));_0x26f3ae(_0x451970[_0x4db9('0x18')][_0x4db9('0x16')]);}})['catch'](function(_0x3b1f87){logger[_0x4db9('0x13')](_0x4db9('0x15'),_0x45c0e4,_0x3b1f87);_0x2bf991(_0x3b1f87);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 923ed25..b944c5f 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 _0xaf5a=['save','update','emit','removeListener','length','openchannelAccount:'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xaf5a,0x144));var _0xaaf5=function(_0x1989e2,_0x5a3b47){_0x1989e2=_0x1989e2-0x0;var _0x218d38=_0xaf5a[_0x1989e2];return _0x218d38;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xaaf5('0x0'),'remove',_0xaaf5('0x1')];function createListener(_0x39130a,_0x2c0906){return function(_0x145946){_0x2c0906[_0xaaf5('0x2')](_0x39130a,_0x145946);};}function removeListener(_0x277e58,_0x2f9a11){return function(){OpenchannelAccountEvents[_0xaaf5('0x3')](_0x277e58,_0x2f9a11);};}exports['register']=function(_0x3b1281){for(var _0x5b9ec4=0x0,_0x39dfd9=events[_0xaaf5('0x4')];_0x5b9ec4<_0x39dfd9;_0x5b9ec4++){var _0x1160d2=events[_0x5b9ec4];var _0x2eee5e=createListener(_0xaaf5('0x5')+_0x1160d2,_0x3b1281);OpenchannelAccountEvents['on'](_0x1160d2,_0x2eee5e);}}; \ No newline at end of file +var _0xbbfa=['removeListener','register','openchannelAccount:','./openchannelAccount.events','remove','emit'];(function(_0x2f6618,_0x2c414a){var _0x365975=function(_0xa8df32){while(--_0xa8df32){_0x2f6618['push'](_0x2f6618['shift']());}};_0x365975(++_0x2c414a);}(_0xbbfa,0x1e9));var _0xabbf=function(_0xc41365,_0x35d774){_0xc41365=_0xc41365-0x0;var _0x388102=_0xbbfa[_0xc41365];return _0x388102;};'use strict';var OpenchannelAccountEvents=require(_0xabbf('0x0'));var events=['save',_0xabbf('0x1'),'update'];function createListener(_0x2948b3,_0x1ba4c4){return function(_0x33a780){_0x1ba4c4[_0xabbf('0x2')](_0x2948b3,_0x33a780);};}function removeListener(_0x30da1f,_0xfd2359){return function(){OpenchannelAccountEvents[_0xabbf('0x3')](_0x30da1f,_0xfd2359);};}exports[_0xabbf('0x4')]=function(_0x120840){for(var _0x7d0c02=0x0,_0x45b7d6=events['length'];_0x7d0c02<_0x45b7d6;_0x7d0c02++){var _0x5b471b=events[_0x7d0c02];var _0x536a4c=createListener(_0xabbf('0x5')+_0x5b471b,_0x120840);OpenchannelAccountEvents['on'](_0x5b471b,_0x536a4c);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 75790ad..20ada90 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 _0x6f61=['isAuthenticated','index','/:id','show','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./openchannelApplication.controller','get'];(function(_0x47d3b0,_0x402fa3){var _0x3b1b2d=function(_0x2d8f63){while(--_0x2d8f63){_0x47d3b0['push'](_0x47d3b0['shift']());}};_0x3b1b2d(++_0x402fa3);}(_0x6f61,0x68));var _0x16f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6f61[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x16f6('0x0'));var util=require('util');var path=require(_0x16f6('0x1'));var timeout=require('connect-timeout');var express=require(_0x16f6('0x2'));var router=express[_0x16f6('0x3')]();var fs_extra=require(_0x16f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x16f6('0x5'));var config=require('../../config/environment');var controller=require(_0x16f6('0x6'));router[_0x16f6('0x7')]('/',auth[_0x16f6('0x8')](),controller[_0x16f6('0x9')]);router[_0x16f6('0x7')](_0x16f6('0xa'),auth[_0x16f6('0x8')](),controller[_0x16f6('0xb')]);router['post']('/',auth[_0x16f6('0x8')](),controller['create']);router[_0x16f6('0xc')](_0x16f6('0xa'),auth[_0x16f6('0x8')](),controller['update']);router[_0x16f6('0xd')]('/:id',auth[_0x16f6('0x8')](),controller[_0x16f6('0xe')]);module[_0x16f6('0xf')]=router; \ No newline at end of file +var _0x3f94=['isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x591cfd,_0x501204){var _0x4d0100=function(_0xb9ff0c){while(--_0xb9ff0c){_0x591cfd['push'](_0x591cfd['shift']());}};_0x4d0100(++_0x501204);}(_0x3f94,0xd5));var _0x43f9=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x3f94[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0x43f9('0x0'));var util=require('util');var path=require(_0x43f9('0x1'));var timeout=require(_0x43f9('0x2'));var express=require(_0x43f9('0x3'));var router=express[_0x43f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x43f9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x43f9('0x6'));var controller=require('./openchannelApplication.controller');router[_0x43f9('0x7')]('/',auth[_0x43f9('0x8')](),controller['index']);router[_0x43f9('0x7')](_0x43f9('0x9'),auth[_0x43f9('0x8')](),controller[_0x43f9('0xa')]);router[_0x43f9('0xb')]('/',auth[_0x43f9('0x8')](),controller[_0x43f9('0xc')]);router['put']('/:id',auth[_0x43f9('0x8')](),controller[_0x43f9('0xd')]);router[_0x43f9('0xe')](_0x43f9('0x9'),auth[_0x43f9('0x8')](),controller[_0x43f9('0xf')]);module[_0x43f9('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 091e129..b70a2bf 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 _0x1841=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5f01a7,_0x9088ee){var _0x20092d=function(_0x58b72f){while(--_0x58b72f){_0x5f01a7['push'](_0x5f01a7['shift']());}};_0x20092d(++_0x9088ee);}(_0x1841,0x65));var _0x1184=function(_0x1e09e9,_0x31cb66){_0x1e09e9=_0x1e09e9-0x0;var _0x78b788=_0x1841[_0x1e09e9];return _0x78b788;};'use strict';var Sequelize=require(_0x1184('0x0'));module[_0x1184('0x1')]={'priority':{'type':Sequelize[_0x1184('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1184('0x3')],'allowNull':![],'defaultValue':_0x1184('0x4')},'appdata':{'type':Sequelize[_0x1184('0x5')]()},'description':{'type':Sequelize[_0x1184('0x3')]},'interval':{'type':Sequelize[_0x1184('0x3')],'defaultValue':_0x1184('0x6')}}; \ No newline at end of file +var _0xd3d8=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x4868db,_0x54be20){var _0x33de67=function(_0x62188d){while(--_0x62188d){_0x4868db['push'](_0x4868db['shift']());}};_0x33de67(++_0x54be20);}(_0xd3d8,0xa9));var _0x8d3d=function(_0xd57022,_0x1342d6){_0xd57022=_0xd57022-0x0;var _0x541170=_0xd3d8[_0xd57022];return _0x541170;};'use strict';var Sequelize=require('sequelize');module[_0x8d3d('0x0')]={'priority':{'type':Sequelize[_0x8d3d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8d3d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8d3d('0x3')]()},'description':{'type':Sequelize[_0x8d3d('0x2')]},'interval':{'type':Sequelize[_0x8d3d('0x2')],'defaultValue':_0x8d3d('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4c9dfb0..fe3be78 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 _0xd083=['where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','find','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xd083,0x18d));var _0x3d08=function(_0x5413f5,_0x3154c7){_0x5413f5=_0x5413f5-0x0;var _0x639288=_0xd083[_0x5413f5];return _0x639288;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d08('0x0'));var zipdir=require(_0x3d08('0x1'));var jsonpatch=require(_0x3d08('0x2'));var rp=require('request-promise');var moment=require(_0x3d08('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3d08('0x4'));var util=require(_0x3d08('0x5'));var path=require(_0x3d08('0x6'));var sox=require('sox');var csv=require(_0x3d08('0x7'));var ejs=require(_0x3d08('0x8'));var fs=require('fs');var fs_extra=require(_0x3d08('0x9'));var _=require('lodash');var squel=require(_0x3d08('0xa'));var crypto=require(_0x3d08('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3d08('0xc'));var toCsv=require(_0x3d08('0x7'));var querystring=require(_0x3d08('0xd'));var Papa=require(_0x3d08('0xe'));var Redis=require(_0x3d08('0xf'));var authService=require(_0x3d08('0x10'));var qs=require(_0x3d08('0x11'));var as=require(_0x3d08('0x12'));var hardwareService=require(_0x3d08('0x13'));var logger=require(_0x3d08('0x14'))('api');var utils=require(_0x3d08('0x15'));var config=require(_0x3d08('0x16'));var licenseUtil=require(_0x3d08('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e2e94,_0x118a52){_0x118a52=_0x118a52||0xcc;return function(_0x59150f){if(_0x59150f){return _0x1e2e94[_0x3d08('0x18')](_0x118a52);}return _0x1e2e94[_0x3d08('0x19')](_0x118a52)[_0x3d08('0x1a')]();};}function respondWithResult(_0x3e2fba,_0x3a51fe){_0x3a51fe=_0x3a51fe||0xc8;return function(_0x246ec9){if(_0x246ec9){return _0x3e2fba[_0x3d08('0x19')](_0x3a51fe)[_0x3d08('0x1b')](_0x246ec9);}};}function respondWithFilteredResult(_0x1622a6,_0x54cc3a){return function(_0x49d380){if(_0x49d380){var _0xb98aaf=typeof _0x54cc3a[_0x3d08('0x1c')]==='undefined'&&typeof _0x54cc3a[_0x3d08('0x1d')]==='undefined';var _0x4cba3a=_0x49d380[_0x3d08('0x1e')];var _0x189234=_0xb98aaf?0x0:_0x54cc3a[_0x3d08('0x1c')];var _0x484504=_0xb98aaf?_0x49d380[_0x3d08('0x1e')]:_0x54cc3a[_0x3d08('0x1c')]+_0x54cc3a[_0x3d08('0x1d')];var _0x44d40f;if(_0x484504>=_0x4cba3a){_0x484504=_0x4cba3a;_0x44d40f=0xc8;}else{_0x44d40f=0xce;}_0x1622a6[_0x3d08('0x19')](_0x44d40f);return _0x1622a6[_0x3d08('0x1f')](_0x3d08('0x20'),_0x189234+'-'+_0x484504+'/'+_0x4cba3a)[_0x3d08('0x1b')](_0x49d380);}return null;};}function patchUpdates(_0x5b499c){return function(_0x52a180){try{jsonpatch[_0x3d08('0x21')](_0x52a180,_0x5b499c,!![]);}catch(_0x44c764){return BPromise[_0x3d08('0x22')](_0x44c764);}return _0x52a180[_0x3d08('0x23')]();};}function saveUpdates(_0xadba4d,_0x3efe58){return function(_0x2fd6cf){if(_0x2fd6cf){return _0x2fd6cf[_0x3d08('0x24')](_0xadba4d)['then'](function(_0x31c0cf){return _0x31c0cf;});}return null;};}function removeEntity(_0x26d150,_0x38c508){return function(_0x122bfe){if(_0x122bfe){return _0x122bfe[_0x3d08('0x25')]()[_0x3d08('0x26')](function(){_0x26d150[_0x3d08('0x19')](0xcc)[_0x3d08('0x1a')]();});}};}function handleEntityNotFound(_0xf10fb9,_0x20fcef){return function(_0x1a8b95){if(!_0x1a8b95){_0xf10fb9[_0x3d08('0x18')](0x194);}return _0x1a8b95;};}function handleError(_0x250842,_0x391a29){_0x391a29=_0x391a29||0x1f4;return function(_0x4dc620){logger['error'](_0x4dc620[_0x3d08('0x27')]);if(_0x4dc620['name']){delete _0x4dc620[_0x3d08('0x28')];}_0x250842[_0x3d08('0x19')](_0x391a29)[_0x3d08('0x29')](_0x4dc620);};}exports[_0x3d08('0x2a')]=function(_0x440689,_0x141817){var _0x24781a={},_0x2ee14c={},_0x551e96={'count':0x0,'rows':[]};var _0x5834ad=_[_0x3d08('0x2b')](db[_0x3d08('0x2c')][_0x3d08('0x2d')],function(_0x1f7343){return{'name':_0x1f7343[_0x3d08('0x2e')],'type':_0x1f7343[_0x3d08('0x2f')][_0x3d08('0x30')]};});_0x2ee14c['model']=_[_0x3d08('0x2b')](_0x5834ad,_0x3d08('0x28'));_0x2ee14c[_0x3d08('0x31')]=_['keys'](_0x440689[_0x3d08('0x31')]);_0x2ee14c[_0x3d08('0x32')]=_[_0x3d08('0x33')](_0x2ee14c[_0x3d08('0x34')],_0x2ee14c[_0x3d08('0x31')]);_0x24781a[_0x3d08('0x35')]=_[_0x3d08('0x33')](_0x2ee14c[_0x3d08('0x34')],qs['fields'](_0x440689[_0x3d08('0x31')][_0x3d08('0x36')]));_0x24781a[_0x3d08('0x35')]=_0x24781a[_0x3d08('0x35')]['length']?_0x24781a[_0x3d08('0x35')]:_0x2ee14c[_0x3d08('0x34')];if(!_0x440689[_0x3d08('0x31')][_0x3d08('0x37')](_0x3d08('0x38'))){_0x24781a[_0x3d08('0x1d')]=qs['limit'](_0x440689[_0x3d08('0x31')][_0x3d08('0x1d')]);_0x24781a[_0x3d08('0x1c')]=qs[_0x3d08('0x1c')](_0x440689[_0x3d08('0x31')][_0x3d08('0x1c')]);}_0x24781a[_0x3d08('0x39')]=qs['sort'](_0x440689['query'][_0x3d08('0x3a')]);_0x24781a[_0x3d08('0x3b')]=qs['filters'](_['pick'](_0x440689[_0x3d08('0x31')],_0x2ee14c[_0x3d08('0x32')]),_0x5834ad);if(_0x440689['query'][_0x3d08('0x3c')]){_0x24781a[_0x3d08('0x3b')]=_[_0x3d08('0x3d')](_0x24781a[_0x3d08('0x3b')],{'$or':_[_0x3d08('0x2b')](_0x5834ad,function(_0x4bf9b3){if(_0x4bf9b3['type']!==_0x3d08('0x3e')){var _0x4d3003={};_0x4d3003[_0x4bf9b3[_0x3d08('0x28')]]={'$like':'%'+_0x440689[_0x3d08('0x31')][_0x3d08('0x3c')]+'%'};return _0x4d3003;}})});}_0x24781a=_['merge']({},_0x24781a,_0x440689[_0x3d08('0x3f')]);var _0xdded05={'where':_0x24781a[_0x3d08('0x3b')]};return db['OpenchannelApplication'][_0x3d08('0x1e')](_0xdded05)[_0x3d08('0x26')](function(_0x67839b){_0x551e96[_0x3d08('0x1e')]=_0x67839b;if(_0x440689[_0x3d08('0x31')][_0x3d08('0x40')]){_0x24781a[_0x3d08('0x41')]=[{'all':!![]}];}return db[_0x3d08('0x2c')][_0x3d08('0x42')](_0x24781a);})[_0x3d08('0x26')](function(_0x31f061){_0x551e96[_0x3d08('0x43')]=_0x31f061;return _0x551e96;})[_0x3d08('0x26')](respondWithFilteredResult(_0x141817,_0x24781a))[_0x3d08('0x44')](handleError(_0x141817,null));};exports[_0x3d08('0x45')]=function(_0xce62c,_0x238ec0){var _0xd46763={'raw':!![],'where':{'id':_0xce62c[_0x3d08('0x46')]['id']}},_0x2e7873={};_0x2e7873[_0x3d08('0x34')]=_['keys'](db[_0x3d08('0x2c')][_0x3d08('0x2d')]);_0x2e7873[_0x3d08('0x31')]=_[_0x3d08('0x47')](_0xce62c[_0x3d08('0x31')]);_0x2e7873['filters']=_[_0x3d08('0x33')](_0x2e7873[_0x3d08('0x34')],_0x2e7873[_0x3d08('0x31')]);_0xd46763[_0x3d08('0x35')]=_[_0x3d08('0x33')](_0x2e7873['model'],qs['fields'](_0xce62c[_0x3d08('0x31')]['fields']));_0xd46763['attributes']=_0xd46763[_0x3d08('0x35')][_0x3d08('0x48')]?_0xd46763[_0x3d08('0x35')]:_0x2e7873['model'];if(_0xce62c[_0x3d08('0x31')][_0x3d08('0x40')]){_0xd46763[_0x3d08('0x41')]=[{'all':!![]}];}_0xd46763=_[_0x3d08('0x3d')]({},_0xd46763,_0xce62c[_0x3d08('0x3f')]);return db[_0x3d08('0x2c')]['find'](_0xd46763)['then'](handleEntityNotFound(_0x238ec0,null))[_0x3d08('0x26')](respondWithResult(_0x238ec0,null))[_0x3d08('0x44')](handleError(_0x238ec0,null));};exports[_0x3d08('0x49')]=function(_0x359887,_0x537a36){return db['OpenchannelApplication'][_0x3d08('0x49')](_0x359887[_0x3d08('0x4a')],{})[_0x3d08('0x26')](respondWithResult(_0x537a36,0xc9))[_0x3d08('0x44')](handleError(_0x537a36,null));};exports[_0x3d08('0x24')]=function(_0x4d8040,_0x363bab){if(_0x4d8040['body']['id']){delete _0x4d8040[_0x3d08('0x4a')]['id'];}return db[_0x3d08('0x2c')]['find']({'where':{'id':_0x4d8040[_0x3d08('0x46')]['id']}})[_0x3d08('0x26')](handleEntityNotFound(_0x363bab,null))[_0x3d08('0x26')](saveUpdates(_0x4d8040['body'],null))['then'](respondWithResult(_0x363bab,null))[_0x3d08('0x44')](handleError(_0x363bab,null));};exports['destroy']=function(_0x275ff9,_0xcb9bf6){return db[_0x3d08('0x2c')][_0x3d08('0x4b')]({'where':{'id':_0x275ff9[_0x3d08('0x46')]['id']}})[_0x3d08('0x26')](handleEntityNotFound(_0xcb9bf6,null))[_0x3d08('0x26')](removeEntity(_0xcb9bf6,null))[_0x3d08('0x44')](handleError(_0xcb9bf6,null));}; \ No newline at end of file +var _0xe69a=['OpenchannelApplication','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','destroy','error','stack','name','send','index'];(function(_0x26a366,_0x3486c9){var _0x50f478=function(_0x8e3e25){while(--_0x8e3e25){_0x26a366['push'](_0x26a366['shift']());}};_0x50f478(++_0x3486c9);}(_0xe69a,0x18d));var _0xae69=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xe69a[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xae69('0x0'));var rimraf=require(_0xae69('0x1'));var zipdir=require(_0xae69('0x2'));var jsonpatch=require(_0xae69('0x3'));var rp=require(_0xae69('0x4'));var moment=require(_0xae69('0x5'));var BPromise=require(_0xae69('0x6'));var Mustache=require('mustache');var util=require(_0xae69('0x7'));var path=require(_0xae69('0x8'));var sox=require(_0xae69('0x9'));var csv=require('to-csv');var ejs=require(_0xae69('0xa'));var fs=require('fs');var fs_extra=require(_0xae69('0xb'));var _=require('lodash');var squel=require(_0xae69('0xc'));var crypto=require(_0xae69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xae69('0xe'));var toCsv=require(_0xae69('0xf'));var querystring=require(_0xae69('0x10'));var Papa=require('papaparse');var Redis=require(_0xae69('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae69('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae69('0x13'))(_0xae69('0x14'));var utils=require('../../config/utils');var config=require(_0xae69('0x15'));var licenseUtil=require(_0xae69('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25481b,_0x9dddf5){_0x9dddf5=_0x9dddf5||0xcc;return function(_0x2963fe){if(_0x2963fe){return _0x25481b[_0xae69('0x17')](_0x9dddf5);}return _0x25481b[_0xae69('0x18')](_0x9dddf5)[_0xae69('0x19')]();};}function respondWithResult(_0x312ad3,_0x24c3b0){_0x24c3b0=_0x24c3b0||0xc8;return function(_0x18fda9){if(_0x18fda9){return _0x312ad3[_0xae69('0x18')](_0x24c3b0)[_0xae69('0x1a')](_0x18fda9);}};}function respondWithFilteredResult(_0x25984d,_0x30ea46){return function(_0x1c5c23){if(_0x1c5c23){var _0x33606d=typeof _0x30ea46[_0xae69('0x1b')]===_0xae69('0x1c')&&typeof _0x30ea46['limit']===_0xae69('0x1c');var _0x291cc3=_0x1c5c23[_0xae69('0x1d')];var _0x5c693b=_0x33606d?0x0:_0x30ea46['offset'];var _0x5ed7ee=_0x33606d?_0x1c5c23[_0xae69('0x1d')]:_0x30ea46[_0xae69('0x1b')]+_0x30ea46[_0xae69('0x1e')];var _0x5ee64d;if(_0x5ed7ee>=_0x291cc3){_0x5ed7ee=_0x291cc3;_0x5ee64d=0xc8;}else{_0x5ee64d=0xce;}_0x25984d[_0xae69('0x18')](_0x5ee64d);return _0x25984d[_0xae69('0x1f')]('Content-Range',_0x5c693b+'-'+_0x5ed7ee+'/'+_0x291cc3)[_0xae69('0x1a')](_0x1c5c23);}return null;};}function patchUpdates(_0x35fe97){return function(_0x10c6ec){try{jsonpatch[_0xae69('0x20')](_0x10c6ec,_0x35fe97,!![]);}catch(_0x3a6497){return BPromise['reject'](_0x3a6497);}return _0x10c6ec[_0xae69('0x21')]();};}function saveUpdates(_0x4729e0,_0x3775d4){return function(_0xf7aaf7){if(_0xf7aaf7){return _0xf7aaf7['update'](_0x4729e0)[_0xae69('0x22')](function(_0x2d73b4){return _0x2d73b4;});}return null;};}function removeEntity(_0x42679b,_0x2bb3f2){return function(_0x1d23e8){if(_0x1d23e8){return _0x1d23e8[_0xae69('0x23')]()[_0xae69('0x22')](function(){_0x42679b[_0xae69('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa79425,_0x2e937e){return function(_0x10fb56){if(!_0x10fb56){_0xa79425['sendStatus'](0x194);}return _0x10fb56;};}function handleError(_0x419080,_0x548926){_0x548926=_0x548926||0x1f4;return function(_0x4f2ceb){logger[_0xae69('0x24')](_0x4f2ceb[_0xae69('0x25')]);if(_0x4f2ceb[_0xae69('0x26')]){delete _0x4f2ceb[_0xae69('0x26')];}_0x419080[_0xae69('0x18')](_0x548926)[_0xae69('0x27')](_0x4f2ceb);};}exports[_0xae69('0x28')]=function(_0xacc0b9,_0x30f910){var _0x2973f2={},_0x4425fd={},_0x5672ae={'count':0x0,'rows':[]};var _0x55e4a5=_['map'](db[_0xae69('0x29')]['rawAttributes'],function(_0x3d1abf){return{'name':_0x3d1abf[_0xae69('0x2a')],'type':_0x3d1abf[_0xae69('0x2b')][_0xae69('0x2c')]};});_0x4425fd['model']=_[_0xae69('0x2d')](_0x55e4a5,_0xae69('0x26'));_0x4425fd[_0xae69('0x2e')]=_[_0xae69('0x2f')](_0xacc0b9[_0xae69('0x2e')]);_0x4425fd['filters']=_[_0xae69('0x30')](_0x4425fd[_0xae69('0x31')],_0x4425fd[_0xae69('0x2e')]);_0x2973f2[_0xae69('0x32')]=_[_0xae69('0x30')](_0x4425fd['model'],qs[_0xae69('0x33')](_0xacc0b9[_0xae69('0x2e')][_0xae69('0x33')]));_0x2973f2['attributes']=_0x2973f2[_0xae69('0x32')][_0xae69('0x34')]?_0x2973f2['attributes']:_0x4425fd[_0xae69('0x31')];if(!_0xacc0b9['query']['hasOwnProperty'](_0xae69('0x35'))){_0x2973f2[_0xae69('0x1e')]=qs['limit'](_0xacc0b9[_0xae69('0x2e')]['limit']);_0x2973f2[_0xae69('0x1b')]=qs[_0xae69('0x1b')](_0xacc0b9[_0xae69('0x2e')][_0xae69('0x1b')]);}_0x2973f2[_0xae69('0x36')]=qs[_0xae69('0x37')](_0xacc0b9[_0xae69('0x2e')][_0xae69('0x37')]);_0x2973f2[_0xae69('0x38')]=qs[_0xae69('0x39')](_['pick'](_0xacc0b9[_0xae69('0x2e')],_0x4425fd[_0xae69('0x39')]),_0x55e4a5);if(_0xacc0b9[_0xae69('0x2e')][_0xae69('0x3a')]){_0x2973f2[_0xae69('0x38')]=_[_0xae69('0x3b')](_0x2973f2[_0xae69('0x38')],{'$or':_[_0xae69('0x2d')](_0x55e4a5,function(_0x4d2888){if(_0x4d2888[_0xae69('0x2b')]!==_0xae69('0x3c')){var _0x317ca5={};_0x317ca5[_0x4d2888['name']]={'$like':'%'+_0xacc0b9[_0xae69('0x2e')]['filter']+'%'};return _0x317ca5;}})});}_0x2973f2=_[_0xae69('0x3b')]({},_0x2973f2,_0xacc0b9[_0xae69('0x3d')]);var _0x641fc1={'where':_0x2973f2[_0xae69('0x38')]};return db[_0xae69('0x29')][_0xae69('0x1d')](_0x641fc1)[_0xae69('0x22')](function(_0x344285){_0x5672ae[_0xae69('0x1d')]=_0x344285;if(_0xacc0b9[_0xae69('0x2e')][_0xae69('0x3e')]){_0x2973f2[_0xae69('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x2973f2);})[_0xae69('0x22')](function(_0x5c2801){_0x5672ae[_0xae69('0x40')]=_0x5c2801;return _0x5672ae;})[_0xae69('0x22')](respondWithFilteredResult(_0x30f910,_0x2973f2))[_0xae69('0x41')](handleError(_0x30f910,null));};exports[_0xae69('0x42')]=function(_0x2ab72b,_0x225457){var _0x3209d1={'raw':!![],'where':{'id':_0x2ab72b[_0xae69('0x43')]['id']}},_0x5baa21={};_0x5baa21[_0xae69('0x31')]=_[_0xae69('0x2f')](db[_0xae69('0x29')][_0xae69('0x44')]);_0x5baa21[_0xae69('0x2e')]=_[_0xae69('0x2f')](_0x2ab72b[_0xae69('0x2e')]);_0x5baa21[_0xae69('0x39')]=_[_0xae69('0x30')](_0x5baa21[_0xae69('0x31')],_0x5baa21[_0xae69('0x2e')]);_0x3209d1[_0xae69('0x32')]=_[_0xae69('0x30')](_0x5baa21[_0xae69('0x31')],qs[_0xae69('0x33')](_0x2ab72b[_0xae69('0x2e')][_0xae69('0x33')]));_0x3209d1[_0xae69('0x32')]=_0x3209d1[_0xae69('0x32')][_0xae69('0x34')]?_0x3209d1[_0xae69('0x32')]:_0x5baa21[_0xae69('0x31')];if(_0x2ab72b[_0xae69('0x2e')][_0xae69('0x3e')]){_0x3209d1[_0xae69('0x3f')]=[{'all':!![]}];}_0x3209d1=_[_0xae69('0x3b')]({},_0x3209d1,_0x2ab72b[_0xae69('0x3d')]);return db[_0xae69('0x29')]['find'](_0x3209d1)[_0xae69('0x22')](handleEntityNotFound(_0x225457,null))[_0xae69('0x22')](respondWithResult(_0x225457,null))[_0xae69('0x41')](handleError(_0x225457,null));};exports[_0xae69('0x45')]=function(_0x2e0bfc,_0x3f5fa6){return db['OpenchannelApplication'][_0xae69('0x45')](_0x2e0bfc[_0xae69('0x46')],{})['then'](respondWithResult(_0x3f5fa6,0xc9))[_0xae69('0x41')](handleError(_0x3f5fa6,null));};exports[_0xae69('0x47')]=function(_0x250b78,_0x2c44e9){if(_0x250b78[_0xae69('0x46')]['id']){delete _0x250b78[_0xae69('0x46')]['id'];}return db[_0xae69('0x29')][_0xae69('0x48')]({'where':{'id':_0x250b78[_0xae69('0x43')]['id']}})[_0xae69('0x22')](handleEntityNotFound(_0x2c44e9,null))[_0xae69('0x22')](saveUpdates(_0x250b78[_0xae69('0x46')],null))['then'](respondWithResult(_0x2c44e9,null))[_0xae69('0x41')](handleError(_0x2c44e9,null));};exports[_0xae69('0x23')]=function(_0x227465,_0x4402d1){return db[_0xae69('0x29')][_0xae69('0x48')]({'where':{'id':_0x227465[_0xae69('0x43')]['id']}})[_0xae69('0x22')](handleEntityNotFound(_0x4402d1,null))[_0xae69('0x22')](removeEntity(_0x4402d1,null))[_0xae69('0x41')](handleError(_0x4402d1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 62aee98..a33af55 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 _0x0a76=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0x0a76,0x8f));var _0x60a7=function(_0x29d13f,_0x421cd5){_0x29d13f=_0x29d13f-0x0;var _0x55a873=_0x0a76[_0x29d13f];return _0x55a873;};'use strict';var _=require(_0x60a7('0x0'));var util=require(_0x60a7('0x1'));var logger=require(_0x60a7('0x2'))('api');var moment=require(_0x60a7('0x3'));var BPromise=require(_0x60a7('0x4'));var rp=require(_0x60a7('0x5'));var fs=require('fs');var path=require(_0x60a7('0x6'));var rimraf=require(_0x60a7('0x7'));var config=require(_0x60a7('0x8'));var attributes=require(_0x60a7('0x9'));module[_0x60a7('0xa')]=function(_0x4462e7,_0x32f54b){return _0x4462e7[_0x60a7('0xb')](_0x60a7('0xc'),attributes,{'tableName':_0x60a7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60a7('0xe'),'collate':_0x60a7('0xf')});}; \ No newline at end of file +var _0x6ab5=['bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports','utf8mb4','lodash','util','api','moment'];(function(_0x35b6b7,_0x3bae31){var _0x20a7a9=function(_0xbda1a7){while(--_0xbda1a7){_0x35b6b7['push'](_0x35b6b7['shift']());}};_0x20a7a9(++_0x3bae31);}(_0x6ab5,0x146));var _0x56ab=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x6ab5[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x56ab('0x0'));var util=require(_0x56ab('0x1'));var logger=require('../../config/logger')(_0x56ab('0x2'));var moment=require(_0x56ab('0x3'));var BPromise=require(_0x56ab('0x4'));var rp=require(_0x56ab('0x5'));var fs=require('fs');var path=require(_0x56ab('0x6'));var rimraf=require(_0x56ab('0x7'));var config=require('../../config/environment');var attributes=require(_0x56ab('0x8'));module[_0x56ab('0x9')]=function(_0x32651e,_0x14d2ab){return _0x32651e['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x56ab('0xa'),'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 ad242ba..357269b 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 _0xe8ea=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','catch'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xe8ea,0x1ef));var _0xae8e=function(_0x5da171,_0x149209){_0x5da171=_0x5da171-0x0;var _0x29bbb8=_0xe8ea[_0x5da171];return _0x29bbb8;};'use strict';var _=require(_0xae8e('0x0'));var util=require('util');var moment=require(_0xae8e('0x1'));var BPromise=require(_0xae8e('0x2'));var rs=require(_0xae8e('0x3'));var fs=require('fs');var Redis=require(_0xae8e('0x4'));var db=require(_0xae8e('0x5'))['db'];var utils=require(_0xae8e('0x6'));var logger=require(_0xae8e('0x7'))(_0xae8e('0x8'));var config=require(_0xae8e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xae8e('0xa')][_0xae8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x63319,_0x3215e5,_0x2a6fa3){return new BPromise(function(_0x10e12d,_0x455bd4){return client[_0xae8e('0xc')](_0x63319,_0x2a6fa3)[_0xae8e('0xd')](function(_0x253194){logger['info'](_0xae8e('0xe'),_0x3215e5,'request\x20sent');logger[_0xae8e('0xf')](_0xae8e('0x10'),_0x3215e5,_0xae8e('0x11'),JSON[_0xae8e('0x12')](_0x253194));if(_0x253194['error']){if(_0x253194['error'][_0xae8e('0x13')]===0x1f4){logger[_0xae8e('0x14')](_0xae8e('0xe'),_0x3215e5,_0x253194[_0xae8e('0x14')][_0xae8e('0x15')]);return _0x455bd4(_0x253194[_0xae8e('0x14')][_0xae8e('0x15')]);}logger[_0xae8e('0x14')](_0xae8e('0xe'),_0x3215e5,_0x253194['error'][_0xae8e('0x15')]);return _0x10e12d(_0x253194[_0xae8e('0x14')]['message']);}else{logger[_0xae8e('0x16')](_0xae8e('0xe'),_0x3215e5,_0xae8e('0x11'));_0x10e12d(_0x253194[_0xae8e('0x17')][_0xae8e('0x15')]);}})['catch'](function(_0x116e6e){logger[_0xae8e('0x14')](_0xae8e('0xe'),_0x3215e5,_0x116e6e);_0x455bd4(_0x116e6e);});});}exports[_0xae8e('0x18')]=function(_0xacb3d2){var _0x125f7c=this;return new Promise(function(_0x57a1b8,_0x13cf19){return db[_0xae8e('0x19')][_0xae8e('0x1a')](_0xacb3d2[_0xae8e('0x1b')],{'raw':_0xacb3d2['options']?_0xacb3d2[_0xae8e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xacb3d2['options']?_0xacb3d2[_0xae8e('0x1c')][_0xae8e('0x1d')]||null:null,'attributes':_0xacb3d2['options']?_0xacb3d2['options'][_0xae8e('0x1e')]||null:null,'limit':_0xacb3d2['options']?_0xacb3d2[_0xae8e('0x1c')][_0xae8e('0x1f')]||null:null})[_0xae8e('0xd')](function(_0x4d4b6d){logger[_0xae8e('0x16')]('UpdateOpenchannelApplication',_0xacb3d2);logger[_0xae8e('0xf')](_0xae8e('0x18'),_0xacb3d2,JSON[_0xae8e('0x12')](_0x4d4b6d));_0x57a1b8(_0x4d4b6d);})[_0xae8e('0x20')](function(_0x55c2c3){logger[_0xae8e('0x14')]('UpdateOpenchannelApplication',_0x55c2c3[_0xae8e('0x15')],_0xacb3d2);_0x13cf19(_0x125f7c[_0xae8e('0x14')](0x1f4,_0x55c2c3[_0xae8e('0x15')]));});});}; \ No newline at end of file +var _0x2e50=['limit','UpdateOpenchannelApplication','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','OpenchannelApplication','update','body','raw','options','where'];(function(_0x1b0692,_0x32283a){var _0x26642b=function(_0x2f63bc){while(--_0x2f63bc){_0x1b0692['push'](_0x1b0692['shift']());}};_0x26642b(++_0x32283a);}(_0x2e50,0x1df));var _0x02e5=function(_0x3b81eb,_0x175f32){_0x3b81eb=_0x3b81eb-0x0;var _0x149491=_0x2e50[_0x3b81eb];return _0x149491;};'use strict';var _=require(_0x02e5('0x0'));var util=require(_0x02e5('0x1'));var moment=require(_0x02e5('0x2'));var BPromise=require(_0x02e5('0x3'));var rs=require(_0x02e5('0x4'));var fs=require('fs');var Redis=require(_0x02e5('0x5'));var db=require(_0x02e5('0x6'))['db'];var utils=require(_0x02e5('0x7'));var logger=require(_0x02e5('0x8'))(_0x02e5('0x9'));var config=require(_0x02e5('0xa'));var jayson=require(_0x02e5('0xb'));var client=jayson[_0x02e5('0xc')][_0x02e5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x59f41d,_0x1679a5,_0x58c628){return new BPromise(function(_0x332b1b,_0x50862a){return client[_0x02e5('0xe')](_0x59f41d,_0x58c628)[_0x02e5('0xf')](function(_0x34df69){logger[_0x02e5('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x1679a5,'request\x20sent');logger[_0x02e5('0x11')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x1679a5,_0x02e5('0x12'),JSON[_0x02e5('0x13')](_0x34df69));if(_0x34df69[_0x02e5('0x14')]){if(_0x34df69[_0x02e5('0x14')][_0x02e5('0x15')]===0x1f4){logger[_0x02e5('0x14')]('OpenchannelApplication,\x20%s,\x20%s',_0x1679a5,_0x34df69[_0x02e5('0x14')]['message']);return _0x50862a(_0x34df69[_0x02e5('0x14')]['message']);}logger[_0x02e5('0x14')](_0x02e5('0x16'),_0x1679a5,_0x34df69[_0x02e5('0x14')][_0x02e5('0x17')]);return _0x332b1b(_0x34df69[_0x02e5('0x14')][_0x02e5('0x17')]);}else{logger['info'](_0x02e5('0x16'),_0x1679a5,_0x02e5('0x12'));_0x332b1b(_0x34df69[_0x02e5('0x18')]['message']);}})['catch'](function(_0x36fc71){logger['error'](_0x02e5('0x16'),_0x1679a5,_0x36fc71);_0x50862a(_0x36fc71);});});}exports['UpdateOpenchannelApplication']=function(_0x2a09da){var _0x499a1f=this;return new Promise(function(_0x211b36,_0x332fe5){return db[_0x02e5('0x19')][_0x02e5('0x1a')](_0x2a09da[_0x02e5('0x1b')],{'raw':_0x2a09da['options']?_0x2a09da['options'][_0x02e5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a09da[_0x02e5('0x1d')]?_0x2a09da[_0x02e5('0x1d')][_0x02e5('0x1e')]||null:null,'attributes':_0x2a09da[_0x02e5('0x1d')]?_0x2a09da[_0x02e5('0x1d')]['attributes']||null:null,'limit':_0x2a09da[_0x02e5('0x1d')]?_0x2a09da[_0x02e5('0x1d')][_0x02e5('0x1f')]||null:null})[_0x02e5('0xf')](function(_0x36806a){logger['info'](_0x02e5('0x20'),_0x2a09da);logger['debug']('UpdateOpenchannelApplication',_0x2a09da,JSON[_0x02e5('0x13')](_0x36806a));_0x211b36(_0x36806a);})[_0x02e5('0x21')](function(_0x556f1d){logger[_0x02e5('0x14')](_0x02e5('0x20'),_0x556f1d[_0x02e5('0x17')],_0x2a09da);_0x332fe5(_0x499a1f['error'](0x1f4,_0x556f1d[_0x02e5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a6469ba..7849db8 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 _0xb020=['show','/:id/messages','/:id/download','download','create','addMessage','post','/:id/tags','openchannel','addTags','put','/:id','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x11c6b8,_0x2950df){var _0x2fccbd=function(_0x47e176){while(--_0x47e176){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x2fccbd(++_0x2950df);}(_0xb020,0x124));var _0x0b02=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0xb020[_0x21205e];return _0x136ebb;};'use strict';var multer=require(_0x0b02('0x0'));var util=require('util');var path=require(_0x0b02('0x1'));var timeout=require(_0x0b02('0x2'));var express=require(_0x0b02('0x3'));var router=express[_0x0b02('0x4')]();var fs_extra=require(_0x0b02('0x5'));var auth=require(_0x0b02('0x6'));var interaction=require(_0x0b02('0x7'));var config=require('../../config/environment');var controller=require(_0x0b02('0x8'));router[_0x0b02('0x9')]('/',auth[_0x0b02('0xa')](),controller[_0x0b02('0xb')]);router[_0x0b02('0x9')](_0x0b02('0xc'),auth[_0x0b02('0xa')](),controller[_0x0b02('0xd')]);router[_0x0b02('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0b02('0xe')]);router[_0x0b02('0x9')](_0x0b02('0xf'),auth[_0x0b02('0xa')](),controller['getMessages']);router[_0x0b02('0x9')](_0x0b02('0x10'),auth[_0x0b02('0xa')](),controller[_0x0b02('0x11')]);router['post']('/',auth[_0x0b02('0xa')](),controller[_0x0b02('0x12')]);router['post'](_0x0b02('0xf'),auth[_0x0b02('0xa')](),controller[_0x0b02('0x13')]);router[_0x0b02('0x14')](_0x0b02('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x0b02('0x16'),'openchannelinteraction:addtags'),controller[_0x0b02('0x17')]);router[_0x0b02('0x18')](_0x0b02('0x19'),auth[_0x0b02('0xa')](),interaction[_0x0b02('0x1a')]('openchannel',_0x0b02('0x1b')),controller[_0x0b02('0x1c')]);router[_0x0b02('0x1d')]('/:id',auth[_0x0b02('0xa')](),interaction[_0x0b02('0x1a')](_0x0b02('0x16'),_0x0b02('0x1e')),controller[_0x0b02('0x1f')]);router[_0x0b02('0x1d')](_0x0b02('0x15'),auth['isAuthenticated'](),controller[_0x0b02('0x20')]);module[_0x0b02('0x21')]=router; \ No newline at end of file +var _0x2f12=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','/:id/messages','post','create','/:id/tags','openchannel','openchannelinteraction:addtags','put','tracked','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports'];(function(_0x4f27f4,_0xabb988){var _0x4bfdc2=function(_0x31735c){while(--_0x31735c){_0x4f27f4['push'](_0x4f27f4['shift']());}};_0x4bfdc2(++_0xabb988);}(_0x2f12,0xae));var _0x22f1=function(_0x362898,_0x5a3cef){_0x362898=_0x362898-0x0;var _0x21a4e8=_0x2f12[_0x362898];return _0x21a4e8;};'use strict';var multer=require('multer');var util=require(_0x22f1('0x0'));var path=require(_0x22f1('0x1'));var timeout=require(_0x22f1('0x2'));var express=require('express');var router=express[_0x22f1('0x3')]();var fs_extra=require(_0x22f1('0x4'));var auth=require(_0x22f1('0x5'));var interaction=require(_0x22f1('0x6'));var config=require(_0x22f1('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x22f1('0x8')]);router[_0x22f1('0x9')](_0x22f1('0xa'),auth[_0x22f1('0xb')](),controller['describe']);router[_0x22f1('0x9')](_0x22f1('0xc'),auth[_0x22f1('0xb')](),controller[_0x22f1('0xd')]);router[_0x22f1('0x9')](_0x22f1('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x22f1('0x9')]('/:id/download',auth[_0x22f1('0xb')](),controller['download']);router[_0x22f1('0xf')]('/',auth[_0x22f1('0xb')](),controller[_0x22f1('0x10')]);router[_0x22f1('0xf')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x22f1('0xf')](_0x22f1('0x11'),auth[_0x22f1('0xb')](),interaction['tracked'](_0x22f1('0x12'),_0x22f1('0x13')),controller['addTags']);router[_0x22f1('0x14')](_0x22f1('0xc'),auth['isAuthenticated'](),interaction[_0x22f1('0x15')](_0x22f1('0x12'),_0x22f1('0x16')),controller[_0x22f1('0x17')]);router[_0x22f1('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0x22f1('0x15')]('openchannel',_0x22f1('0x19')),controller[_0x22f1('0x1a')]);router[_0x22f1('0x18')](_0x22f1('0x11'),auth[_0x22f1('0xb')](),controller[_0x22f1('0x1b')]);module[_0x22f1('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 75719a8..3f10e58 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 _0x1247=['sequelize','exports','STRING','DATE','ENUM','out','BOOLEAN'];(function(_0x4d53bd,_0x324851){var _0x1c5c83=function(_0xd8e172){while(--_0xd8e172){_0x4d53bd['push'](_0x4d53bd['shift']());}};_0x1c5c83(++_0x324851);}(_0x1247,0xb6));var _0x7124=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x1247[_0x313c96];return _0x522f53;};'use strict';var Sequelize=require(_0x7124('0x0'));module[_0x7124('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7124('0x2')]},'secondDisposition':{'type':Sequelize[_0x7124('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7124('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7124('0x3')]},'threadId':{'type':Sequelize[_0x7124('0x2')]},'externalUrl':{'type':Sequelize[_0x7124('0x2')]},'lastMsgAt':{'type':Sequelize[_0x7124('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7124('0x4')]('in',_0x7124('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7124('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x7124('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xaf93=['BOOLEAN','sequelize','exports','STRING','DATE','ENUM','out'];(function(_0x209136,_0x39f191){var _0x3f6169=function(_0x55d212){while(--_0x55d212){_0x209136['push'](_0x209136['shift']());}};_0x3f6169(++_0x39f191);}(_0xaf93,0x151));var _0x3af9=function(_0x1be842,_0x6d41a1){_0x1be842=_0x1be842-0x0;var _0x635e94=_0xaf93[_0x1be842];return _0x635e94;};'use strict';var Sequelize=require(_0x3af9('0x0'));module[_0x3af9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3af9('0x2')]},'secondDisposition':{'type':Sequelize[_0x3af9('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3af9('0x2')]},'read1stAt':{'type':Sequelize[_0x3af9('0x3')]},'threadId':{'type':Sequelize[_0x3af9('0x2')]},'externalUrl':{'type':Sequelize[_0x3af9('0x2')]},'lastMsgAt':{'type':Sequelize[_0x3af9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3af9('0x4')]('in',_0x3af9('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x3af9('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 1a06b53..7c304cd 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 _0xa287=['secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closedAt','disposition','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','direction','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','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','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','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','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','start','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','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','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','createdAt'];(function(_0x3c4cae,_0x4f2faf){var _0x2011e7=function(_0x40ffa8){while(--_0x40ffa8){_0x3c4cae['push'](_0x3c4cae['shift']());}};_0x2011e7(++_0x4f2faf);}(_0xa287,0x116));var _0x7a28=function(_0x4f1b87,_0x260834){_0x4f1b87=_0x4f1b87-0x0;var _0x74718e=_0xa287[_0x4f1b87];return _0x74718e;};'use strict';var emlformat=require(_0x7a28('0x0'));var rimraf=require(_0x7a28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a28('0x2'));var moment=require(_0x7a28('0x3'));var BPromise=require(_0x7a28('0x4'));var Mustache=require(_0x7a28('0x5'));var util=require(_0x7a28('0x6'));var path=require(_0x7a28('0x7'));var sox=require(_0x7a28('0x8'));var csv=require(_0x7a28('0x9'));var ejs=require(_0x7a28('0xa'));var fs=require('fs');var fs_extra=require(_0x7a28('0xb'));var _=require(_0x7a28('0xc'));var squel=require('squel');var crypto=require(_0x7a28('0xd'));var jsforce=require(_0x7a28('0xe'));var deskjs=require(_0x7a28('0xf'));var toCsv=require(_0x7a28('0x9'));var querystring=require('querystring');var Papa=require(_0x7a28('0x10'));var Redis=require(_0x7a28('0x11'));var authService=require(_0x7a28('0x12'));var qs=require(_0x7a28('0x13'));var as=require(_0x7a28('0x14'));var pdf=require(_0x7a28('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a28('0x16'))('api');var utils=require(_0x7a28('0x17'));var config=require(_0x7a28('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a28('0x19'))['db'];config[_0x7a28('0x1a')]=_[_0x7a28('0x1b')](config[_0x7a28('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a28('0x1c'))(new Redis(config[_0x7a28('0x1a')]));require(_0x7a28('0x1d'))['register'](socket);function respondWithStatusCode(_0x1290b5,_0x270c82){_0x270c82=_0x270c82||0xcc;return function(_0x4ec819){if(_0x4ec819){return _0x1290b5[_0x7a28('0x1e')](_0x270c82);}return _0x1290b5[_0x7a28('0x1f')](_0x270c82)['end']();};}function respondWithResult(_0x39c0b9,_0x5c80e2){_0x5c80e2=_0x5c80e2||0xc8;return function(_0x1302e5){if(_0x1302e5){return _0x39c0b9[_0x7a28('0x1f')](_0x5c80e2)[_0x7a28('0x20')](_0x1302e5);}};}function respondWithFilteredResult(_0xe32576,_0x12d0fb){return function(_0x586b2b){if(_0x586b2b){var _0x51c88b=typeof _0x12d0fb['offset']==='undefined'&&typeof _0x12d0fb[_0x7a28('0x21')]===_0x7a28('0x22');var _0x5d0f3c=_0x586b2b[_0x7a28('0x23')];var _0x37bb6c=_0x51c88b?0x0:_0x12d0fb[_0x7a28('0x24')];var _0x3b1dcc=_0x51c88b?_0x586b2b[_0x7a28('0x23')]:_0x12d0fb['offset']+_0x12d0fb[_0x7a28('0x21')];var _0x47ccda;if(_0x3b1dcc>=_0x5d0f3c){_0x3b1dcc=_0x5d0f3c;_0x47ccda=0xc8;}else{_0x47ccda=0xce;}_0xe32576[_0x7a28('0x1f')](_0x47ccda);return _0xe32576['set'](_0x7a28('0x25'),_0x37bb6c+'-'+_0x3b1dcc+'/'+_0x5d0f3c)[_0x7a28('0x20')](_0x586b2b);}return null;};}function patchUpdates(_0x14dd15){return function(_0x265f22){try{jsonpatch['apply'](_0x265f22,_0x14dd15,!![]);}catch(_0x19935f){return BPromise[_0x7a28('0x26')](_0x19935f);}return _0x265f22[_0x7a28('0x27')]();};}function saveUpdates(_0x591f3e,_0x812c2b){return function(_0x392650){if(_0x392650){return _0x392650[_0x7a28('0x28')](_0x591f3e)[_0x7a28('0x29')](function(_0x2ddac2){return _0x2ddac2;});}return null;};}function removeEntity(_0x4d59d0,_0x30ef0f){return function(_0x39057a){if(_0x39057a){return _0x39057a[_0x7a28('0x2a')]()[_0x7a28('0x29')](function(){_0x4d59d0['status'](0xcc)[_0x7a28('0x2b')]();});}};}function handleEntityNotFound(_0x17a8b2,_0x2a335a){return function(_0x47b204){if(!_0x47b204){_0x17a8b2['sendStatus'](0x194);}return _0x47b204;};}function handleError(_0x33bebc,_0x42f148){_0x42f148=_0x42f148||0x1f4;return function(_0xab94d5){logger['error'](_0xab94d5[_0x7a28('0x2c')]);if(_0xab94d5[_0x7a28('0x2d')]){delete _0xab94d5[_0x7a28('0x2d')];}_0x33bebc[_0x7a28('0x1f')](_0x42f148)[_0x7a28('0x2e')](_0xab94d5);};}function getInteractionUsers(_0x5643fe,_0x2862a3){return new BPromise(function(_0x1f1962,_0x3b489f){try{if(_0x2862a3[_0x5643fe['id']]){_0x5643fe[_0x7a28('0x2f')]=_[_0x7a28('0x30')](_0x2862a3[_0x5643fe['id']],function(_0x5bee7a){return{'id':_0x5bee7a['id'],'fullname':_0x5bee7a[_0x7a28('0x31')]};});}}catch(_0x97c827){_0x3b489f(_0x97c827);}_0x1f1962(_0x5643fe);});}function getInteractionTags(_0x1ce2d0,_0x2724ef){return new BPromise(function(_0x3b664e,_0x4c08d3){try{if(_0x1ce2d0[_0x7a28('0x32')]){_0x1ce2d0[_0x7a28('0x33')]=[];_0x1ce2d0['TagIds']['split'](',')['forEach'](function(_0x5dbf90){_0x1ce2d0[_0x7a28('0x33')][_0x7a28('0x34')](_0x2724ef[_0x5dbf90]);});}delete _0x1ce2d0[_0x7a28('0x32')];}catch(_0x34c657){_0x4c08d3(_0x34c657);}_0x3b664e(_0x1ce2d0);});}function updateOpenchannelInteraction(_0x27ab10,_0x398f99,_0xf8d004){return new BPromise(function(_0x3e8e17,_0x1fbc22){return getInteractionUsers(_0x27ab10,_0xf8d004)[_0x7a28('0x29')](function(_0x31af18){return getInteractionTags(_0x31af18,_0x398f99);})[_0x7a28('0x29')](function(_0x45d82f){_0x3e8e17(_0x45d82f);})[_0x7a28('0x35')](function(_0x567277){_0x1fbc22(_0x567277);});});}exports[_0x7a28('0x36')]=function(_0x480acd,_0x21d469){var _0x19ea6d={},_0x3457eb={},_0x50de88={'count':0x0,'rows':[]};var _0x403372=_['map'](db[_0x7a28('0x37')][_0x7a28('0x38')],function(_0x1949f1){return{'name':_0x1949f1[_0x7a28('0x39')],'type':_0x1949f1[_0x7a28('0x3a')][_0x7a28('0x3b')]};});_0x3457eb['model']=_[_0x7a28('0x30')](_0x403372,_0x7a28('0x2d'));_0x3457eb[_0x7a28('0x3c')]=_[_0x7a28('0x3d')](_0x480acd[_0x7a28('0x3c')]);_0x3457eb[_0x7a28('0x3e')]=_['intersection'](_0x3457eb['model'],_0x3457eb[_0x7a28('0x3c')]);_0x19ea6d[_0x7a28('0x3f')]=_[_0x7a28('0x40')](_0x3457eb[_0x7a28('0x41')],qs[_0x7a28('0x42')](_0x480acd[_0x7a28('0x3c')][_0x7a28('0x42')]));_0x19ea6d['attributes']=_0x19ea6d[_0x7a28('0x3f')]['length']?_0x19ea6d[_0x7a28('0x3f')]:_0x3457eb[_0x7a28('0x41')];if(!_0x480acd[_0x7a28('0x3c')][_0x7a28('0x43')](_0x7a28('0x44'))){_0x19ea6d[_0x7a28('0x21')]=qs[_0x7a28('0x21')](_0x480acd[_0x7a28('0x3c')][_0x7a28('0x21')]);_0x19ea6d[_0x7a28('0x24')]=qs['offset'](_0x480acd[_0x7a28('0x3c')]['offset']);}_0x19ea6d[_0x7a28('0x45')]=qs[_0x7a28('0x46')](_0x480acd[_0x7a28('0x3c')][_0x7a28('0x46')]);_0x19ea6d[_0x7a28('0x47')]=qs[_0x7a28('0x3e')](_[_0x7a28('0x48')](_0x480acd[_0x7a28('0x3c')],_0x3457eb['filters']),_0x403372);var _0x1780ec=[];var _0xd98a67=squel['select']()[_0x7a28('0x49')]('id')['field'](_0x7a28('0x2d'))[_0x7a28('0x49')](_0x7a28('0x4a'))[_0x7a28('0x4b')](_0x7a28('0x4c'));var _0x1a856b=squel[_0x7a28('0x4d')]()['field']('u.id')['field'](_0x7a28('0x4e'))['field'](_0x7a28('0x4f'))[_0x7a28('0x4b')](_0x7a28('0x50'),'ui')[_0x7a28('0x51')](_0x7a28('0x52'),'u','u.id\x20=\x20ui.UserId');var _0x409c8a=squel[_0x7a28('0x4d')]()[_0x7a28('0x4b')](_0x7a28('0x53'),'i')[_0x7a28('0x51')](_0x7a28('0x54'),'c',_0x7a28('0x55'))['left_join'](_0x7a28('0x52'),'o',_0x7a28('0x56'))[_0x7a28('0x51')](_0x7a28('0x57'),'a',_0x7a28('0x58'))[_0x7a28('0x51')](_0x7a28('0x59'),'me',_0x7a28('0x5a'))['left_join'](_0x7a28('0x5b'),'it',_0x7a28('0x5c'))[_0x7a28('0x51')](_0x7a28('0x4c'),'t',_0x7a28('0x5d'));var _0x5efa48=squel['expr']();var _0x5852f2=[];var _0x506617=squel[_0x7a28('0x5e')]();var _0x353efd;if(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x5f')]){_0x353efd=as[_0x7a28('0x60')](_0x480acd[_0x7a28('0x3c')][_0x7a28('0x5f')]);var _0x33a958=_0x353efd[_0x7a28('0x61')];for(var _0x3875e1=0x0;_0x3875e1<_0x353efd[_0x7a28('0x62')][_0x7a28('0x63')];_0x3875e1++){var _0x7ce393=_0x353efd['conditions'][_0x3875e1];var _0x47a9fe='i';var _0x15a705=_[_0x7a28('0x64')](_0x403372,[_0x7a28('0x2d'),_0x7ce393[_0x7a28('0x49')]]);if(!_0x15a705){switch(_0x7ce393[_0x7a28('0x49')]){case _0x7a28('0x65'):if(_0x7ce393[_0x7a28('0x66')]==0x1){_0x409c8a[_0x7a28('0x67')]('`'+_0x7ce393[_0x7a28('0x49')]+'`\x20=\x200');}else{_0x409c8a[_0x7a28('0x67')]('`'+_0x7ce393[_0x7a28('0x49')]+_0x7a28('0x68'));}break;case _0x7a28('0x69'):if(_0x7ce393[_0x7a28('0x6a')]===_0x7a28('0x6b')){if(_0x7ce393['value'][_0x7a28('0x6c')]('\x20')[_0x7a28('0x63')]>0x1){_0x5efa48[_0x33a958](_0x7a28('0x6d'),qs[_0x7a28('0x6e')](_0x7ce393[_0x7a28('0x66')]),null);}else{var _0x345f3f='%'+_0x7ce393[_0x7a28('0x66')]+'%';_0x5efa48[_0x33a958](_0x7a28('0x6f'),_0x345f3f,_0x345f3f,_0x345f3f);}}else{_0x15a705=_[_0x7a28('0x64')](_0x403372,[_0x7a28('0x2d'),_0x7a28('0x70')]);_0x7ce393['field']='ContactId';_0x902abb=as[_0x7a28('0x71')](_0x47a9fe,_0x15a705[_0x7a28('0x3a')],_0x7ce393);_0x5efa48[_0x33a958](_0x902abb[_0x7a28('0x72')],_0x902abb[_0x7a28('0x66')]['start'],_0x902abb['value']['end']);}break;case _0x7a28('0x73'):var _0x1317c5=_0x7ce393[_0x7a28('0x66')][_0x7a28('0x6c')](',')[_0x7a28('0x30')](function(_0x1ac793){return Number(_0x1ac793);});_0x1317c5[_0x7a28('0x74')](function(_0x55e86a){_0x506617['or'](_0x7a28('0x75'),'%,'+_0x55e86a+',%');});_0x5852f2=_[_0x7a28('0x76')](_0x5852f2,_0x1317c5);break;case _0x7a28('0x77'):if(_0x7ce393['operator']===_0x7a28('0x6b')){_0x5efa48[_0x33a958](_0x7a28('0x78'),'%'+_0x7ce393[_0x7a28('0x66')]+'%',null);}else{_0x15a705=_['find'](_0x403372,[_0x7a28('0x2d'),_0x7a28('0x79')]);_0x7ce393[_0x7a28('0x49')]=_0x7a28('0x79');_0x902abb=as['buildExpression'](_0x47a9fe,_0x15a705[_0x7a28('0x3a')],_0x7ce393);_0x5efa48[_0x33a958](_0x902abb['text'],_0x902abb[_0x7a28('0x66')]['start'],_0x902abb[_0x7a28('0x66')][_0x7a28('0x2b')]);}break;case _0x7a28('0x7a'):_0x902abb=as[_0x7a28('0x71')]('me',null,_0x7ce393);_0x5efa48[_0x33a958](_0x902abb[_0x7a28('0x72')],_0x902abb[_0x7a28('0x66')][_0x7a28('0x7b')],_0x902abb[_0x7a28('0x66')][_0x7a28('0x2b')]);break;}}else{var _0x902abb=as['buildExpression'](_0x47a9fe,_0x15a705['type'],_0x7ce393);_0x5efa48[_0x33a958](_0x902abb[_0x7a28('0x72')],_0x902abb[_0x7a28('0x66')][_0x7a28('0x7b')],_0x902abb[_0x7a28('0x66')]['end']);}}}else{var _0x43b840=_(_0x480acd[_0x7a28('0x3c')])['keys']()[_0x7a28('0x30')](function(_0x33378d){return _[_0x7a28('0x7c')](_0x403372,[_0x7a28('0x2d'),_0x33378d])?_0x33378d:undefined;})[_0x7a28('0x7d')]()[_0x7a28('0x66')]();if(!_[_0x7a28('0x7e')](_0x43b840)){_0x43b840[_0x7a28('0x74')](function(_0x5283fe){if(_0x5283fe===_0x7a28('0x7f')){_0x409c8a['where'](_0x7a28('0x80'),[][_0x7a28('0x81')](_0x480acd[_0x7a28('0x3c')][_0x5283fe]));}else if(_0x5283fe==='createdAt'){var _0x40dfd9=JSON[_0x7a28('0x82')](_0x480acd['query'][_0x5283fe])[_0x7a28('0x83')];var _0x3c6792=JSON[_0x7a28('0x82')](_0x480acd[_0x7a28('0x3c')][_0x5283fe])[_0x7a28('0x84')];_0x409c8a['where'](_0x7a28('0x85'),_0x40dfd9,_0x3c6792);}else{if(_0x480acd[_0x7a28('0x3c')][_0x5283fe]==='null'){_0x409c8a[_0x7a28('0x47')]('i.'+_0x5283fe+_0x7a28('0x86'));}else{_0x409c8a['where']('i.'+_0x5283fe+'\x20=\x20?',_0x480acd[_0x7a28('0x3c')][_0x5283fe]);}}});}if(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x87')]){if(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x87')]==0x1){_0x409c8a[_0x7a28('0x67')](_0x7a28('0x88'));}else{_0x409c8a[_0x7a28('0x67')](_0x7a28('0x89'));}}if(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x8a')]){_0x5852f2=_[_0x7a28('0x8b')](_0x480acd['query']['tag'])?_0x480acd[_0x7a28('0x3c')][_0x7a28('0x8a')]:new Array(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x8a')]);_0x5852f2['forEach'](function(_0x252c84){_0x506617['or'](_0x7a28('0x75'),'%,'+_0x252c84+',%');});}if(_0x480acd[_0x7a28('0x3c')]['filter']){var _0xfdf7a9=_0x480acd[_0x7a28('0x3c')][_0x7a28('0x8c')][_0x7a28('0x8d')]('\x5c','\x5c\x5c')[_0x7a28('0x8d')](/'/g,'\x27\x27');if(qs[_0x7a28('0x8e')](_0xfdf7a9)){_0x5efa48['or'](_0x7a28('0x8f'),_0xfdf7a9+'%');}else{_0x5efa48['or'](_0x7a28('0x90'),qs[_0x7a28('0x6e')](_0xfdf7a9))['or'](_0x7a28('0x91'),_0xfdf7a9+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xfdf7a9+'%');}}}_0x409c8a[_0x7a28('0x47')](_0x5efa48);_0x409c8a[_0x7a28('0x92')](_0x7a28('0x93'));var _0x4eebec={'type':db[_0x7a28('0x94')][_0x7a28('0x95')]['SELECT'],'raw':!![]};var _0x37b438=_0x409c8a[_0x7a28('0x96')]();_0x37b438['field'](_0x7a28('0x93'));_0x37b438[_0x7a28('0x49')](_0x7a28('0x97'),'unreadMessages');if(_0x19ea6d[_0x7a28('0x45')]){_0x19ea6d['order'][_0x7a28('0x74')](function(_0x5e9ad1){var _0x439113=_0x5e9ad1[0x0]===_0x7a28('0x98')?_0x5e9ad1[0x0]:'i.'+_0x5e9ad1[0x0];_0x409c8a[_0x7a28('0x45')](_0x439113,_0x5e9ad1[0x1]===_0x7a28('0x99')?![]:!![]);});}if(!_[_0x7a28('0x7e')](_0x5852f2)){_0x409c8a[_0x7a28('0x67')](_0x506617);_0x37b438[_0x7a28('0x47')]('t.id\x20IN\x20?',_0x5852f2);}BPromise[_0x7a28('0x9a')]()['then'](function(){if(!_0x353efd){if(_0x480acd[_0x7a28('0x3c')]['OpenchannelAccountId'])return;_0x37b438[_0x7a28('0x47')](_0x7a28('0x9b'));_0x409c8a[_0x7a28('0x47')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x480acd[_0x7a28('0x9c')][_0x7a28('0x9d')]!==_0x7a28('0x9e'))return;return _0x480acd[_0x7a28('0x9c')][_0x7a28('0x9f')]({'attributes':['id'],'raw':!![]})[_0x7a28('0x29')](function(_0x3dacbb){if(_[_0x7a28('0x7e')](_0x3dacbb)){_0x37b438[_0x7a28('0x47')](_0x7a28('0xa0'));_0x409c8a[_0x7a28('0x47')](_0x7a28('0xa0'));}else{_0x37b438['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x7a28('0x30')](_0x3dacbb,'id'));_0x409c8a[_0x7a28('0x47')](_0x7a28('0x80'),_[_0x7a28('0x30')](_0x3dacbb,'id'));}});})[_0x7a28('0x29')](function(){if(_0x480acd[_0x7a28('0x9c')][_0x7a28('0x9d')]===_0x7a28('0x9e')&&!_0x353efd&&!_0x480acd[_0x7a28('0x3c')][_0x7a28('0x7f')])return[];return db[_0x7a28('0xa1')][_0x7a28('0x3c')](_0x37b438['toString'](),_0x4eebec);})['then'](function(_0x204d3a){_0x50de88['count']=_0x204d3a[_0x7a28('0x63')];if(_0x50de88[_0x7a28('0x23')]===0x0)return[];return db['sequelize'][_0x7a28('0x3c')](_0xd98a67[_0x7a28('0xa2')](),_0x4eebec)['then'](function(_0x56d1c5){_0x1780ec=_[_0x7a28('0xa3')](_0x56d1c5,'id');_0x4eebec=_[_0x7a28('0xa4')](_0x4eebec,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x480acd[_0x7a28('0x3c')][_0x7a28('0x42')]){_0x19ea6d[_0x7a28('0x3f')][_0x7a28('0x74')](function(_0x2c0580){_0x409c8a[_0x7a28('0x49')]('i.'+_0x2c0580);});}else{_0x409c8a[_0x7a28('0x49')](_0x7a28('0x97'),_0x7a28('0x65'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xa5'),_0x7a28('0xa6'));_0x409c8a[_0x7a28('0x49')]('a.mandatoryDisposition',_0x7a28('0xa7'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xa8'),_0x7a28('0x98'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xa9'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xaa'),_0x7a28('0xab'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xac'),_0x7a28('0xad'));_0x409c8a['field'](_0x7a28('0xae'),_0x7a28('0xaf'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xb0'),'Contact.phone');_0x409c8a[_0x7a28('0x49')](_0x7a28('0xb1'),_0x7a28('0xb2'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xb3'),_0x7a28('0xb4'));_0x409c8a['field'](_0x7a28('0xb5'),_0x7a28('0xb6'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xb7'),_0x7a28('0xb8'));_0x409c8a[_0x7a28('0x49')](_0x7a28('0xb9'),_0x7a28('0x32'));}if(_0x19ea6d[_0x7a28('0x21')])_0x409c8a['limit'](_0x19ea6d[_0x7a28('0x21')]);if(_0x19ea6d[_0x7a28('0x24')])_0x409c8a['offset'](_0x19ea6d[_0x7a28('0x24')]);return db['sequelize'][_0x7a28('0x3c')](_0x409c8a[_0x7a28('0xa2')](),_0x4eebec);})['then'](function(_0x46d6fe){if(_0x46d6fe[_0x7a28('0x63')]>0x0)_0x1a856b[_0x7a28('0x47')](_0x7a28('0xba'),_['map'](_0x46d6fe,'id'));return db['sequelize'][_0x7a28('0x3c')](_0x1a856b['toString'](),_0x4eebec)[_0x7a28('0x29')](function(_0x9f9ba2){var _0x331e6f=_[_0x7a28('0xbb')](_0x9f9ba2,_0x7a28('0xbc'));var _0x55974b=[];_0x46d6fe[_0x7a28('0x74')](function(_0x4c7e93){_0x55974b[_0x7a28('0x34')](updateOpenchannelInteraction(_0x4c7e93,_0x1780ec,_0x331e6f));});return BPromise[_0x7a28('0xbd')](_0x55974b);});});})[_0x7a28('0x29')](function(_0x2edc6b){_0x50de88[_0x7a28('0xbe')]=_0x2edc6b;return _0x50de88;})[_0x7a28('0x29')](respondWithFilteredResult(_0x21d469,_0x19ea6d))[_0x7a28('0x35')](handleError(_0x21d469,null));};exports[_0x7a28('0xbf')]=function(_0x53ce12,_0x521c80){var _0x4172a3={};if(_0x53ce12[_0x7a28('0x3c')][_0x7a28('0x3a')]&&_0x53ce12[_0x7a28('0x3c')][_0x7a28('0x3a')]===_0x7a28('0x4b')){_0x4172a3[_0x7a28('0x4b')]=_0x53ce12[_0x7a28('0xc0')]['id'];}else{_0x4172a3['id']=_0x53ce12[_0x7a28('0xc0')]['id'];}var _0x40f190={'raw':![],'where':_0x4172a3},_0x4310e7={};_0x4310e7['model']=_[_0x7a28('0x3d')](db[_0x7a28('0x37')][_0x7a28('0x38')]);_0x4310e7[_0x7a28('0x3c')]=_[_0x7a28('0x3d')](_0x53ce12[_0x7a28('0x3c')]);_0x4310e7[_0x7a28('0x3e')]=_[_0x7a28('0x40')](_0x4310e7[_0x7a28('0x41')],_0x4310e7[_0x7a28('0x3c')]);_0x40f190[_0x7a28('0x3f')]=_[_0x7a28('0x40')](_0x4310e7[_0x7a28('0x41')],qs[_0x7a28('0x42')](_0x53ce12[_0x7a28('0x3c')][_0x7a28('0x42')]));_0x40f190[_0x7a28('0x3f')]=_0x40f190[_0x7a28('0x3f')][_0x7a28('0x63')]?_0x40f190[_0x7a28('0x3f')]:_0x4310e7[_0x7a28('0x41')];if(_0x53ce12[_0x7a28('0x3c')][_0x7a28('0xc1')]){_0x40f190[_0x7a28('0xc2')]=[{'all':!![]}];}_0x40f190=_[_0x7a28('0xa4')]({},_0x40f190,_0x53ce12[_0x7a28('0xc3')]);return db['OpenchannelInteraction'][_0x7a28('0x64')](_0x40f190)[_0x7a28('0x29')](handleEntityNotFound(_0x521c80,null))['then'](respondWithResult(_0x521c80,null))[_0x7a28('0x35')](handleError(_0x521c80,null));};exports[_0x7a28('0xc4')]=function(_0x15e182,_0x5eaa27){return db[_0x7a28('0x37')]['create'](_0x15e182[_0x7a28('0x7a')],{})[_0x7a28('0x29')](respondWithResult(_0x5eaa27,0xc9))[_0x7a28('0x35')](handleError(_0x5eaa27,null));};exports['update']=function(_0x4a3281,_0x52c78f){if(_0x4a3281[_0x7a28('0x7a')]['id']){delete _0x4a3281[_0x7a28('0x7a')]['id'];}return db[_0x7a28('0x37')][_0x7a28('0x64')]({'where':{'id':_0x4a3281[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0x52c78f,null))[_0x7a28('0x29')](saveUpdates(_0x4a3281[_0x7a28('0x7a')],null))[_0x7a28('0x29')](respondWithResult(_0x52c78f,null))[_0x7a28('0x35')](handleError(_0x52c78f,null));};exports[_0x7a28('0x2a')]=function(_0x2685ba,_0x439558){return db['OpenchannelInteraction'][_0x7a28('0x64')]({'where':{'id':_0x2685ba[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0x439558,null))[_0x7a28('0x29')](removeEntity(_0x439558,null))[_0x7a28('0x35')](handleError(_0x439558,null));};exports[_0x7a28('0xc5')]=function(_0x405ae9,_0x40d2c1){return db['OpenchannelInteraction'][_0x7a28('0xc5')]()[_0x7a28('0x29')](respondWithResult(_0x40d2c1,null))['catch'](handleError(_0x40d2c1,null));};exports[_0x7a28('0xc6')]=function(_0xfe0366,_0x1a1a9a,_0x34d018){return db[_0x7a28('0xc7')][_0x7a28('0x64')]({'where':{'id':_0xfe0366[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0x1a1a9a,null))[_0x7a28('0x29')](function(_0x122527){if(_0x122527){return _0x122527[_0x7a28('0xc6')](_0xfe0366[_0x7a28('0x7a')][_0x7a28('0xc8')],_[_0x7a28('0xc9')](_0xfe0366[_0x7a28('0x7a')],['ids','id'])||{});}})[_0x7a28('0x29')](respondWithResult(_0x1a1a9a,null))[_0x7a28('0x35')](handleError(_0x1a1a9a,null));};exports[_0x7a28('0xca')]=function(_0xba74ba,_0x379e12,_0xf1cef6){var _0x82a91a={'raw':![],'where':{}};var _0x3fefa1={};var _0x29d970={'count':0x0,'rows':[]};return db[_0x7a28('0x37')][_0x7a28('0xcb')]({'where':{'id':_0xba74ba[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0x379e12,null))[_0x7a28('0x29')](function(_0x3c9643){if(_0x3c9643){_0x3fefa1[_0x7a28('0x41')]=_[_0x7a28('0x3d')](db[_0x7a28('0xc7')]['rawAttributes']);_0x3fefa1[_0x7a28('0x3c')]=_['keys'](_0xba74ba['query']);_0x3fefa1[_0x7a28('0x3e')]=_['intersection'](_0x3fefa1['model'],_0x3fefa1[_0x7a28('0x3c')]);_0x82a91a[_0x7a28('0x3f')]=_[_0x7a28('0x40')](_0x3fefa1[_0x7a28('0x41')],qs[_0x7a28('0x42')](_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x42')]));_0x82a91a['attributes']=_0x82a91a[_0x7a28('0x3f')][_0x7a28('0x63')]?_0x82a91a['attributes']:_0x3fefa1[_0x7a28('0x41')];if(!_0xba74ba['query'][_0x7a28('0x43')](_0x7a28('0x44'))){_0x82a91a[_0x7a28('0x21')]=qs[_0x7a28('0x21')](_0xba74ba[_0x7a28('0x3c')]['limit']);_0x82a91a[_0x7a28('0x24')]=qs['offset'](_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x24')]);}_0x82a91a[_0x7a28('0x45')]=qs['sort'](_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x46')]);_0x82a91a[_0x7a28('0x47')]=qs[_0x7a28('0x3e')](_[_0x7a28('0x48')](_0xba74ba[_0x7a28('0x3c')],_0x3fefa1['filters']));_0x82a91a[_0x7a28('0x47')][_0x7a28('0xbc')]=_0x3c9643['id'];if(_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x8c')]){_0x82a91a[_0x7a28('0x47')]=_[_0x7a28('0xa4')](_0x82a91a['where'],{'$or':_[_0x7a28('0x30')](_0x82a91a[_0x7a28('0x3f')],function(_0x25ec8b){var _0x569372={};_0x569372[_0x25ec8b]={'$like':'%'+_0xba74ba[_0x7a28('0x3c')]['filter']+'%'};return _0x569372;})});}if(_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x83')]){var _0x4d4212=_0xba74ba[_0x7a28('0x3c')][_0x7a28('0x83')][_0x7a28('0x6c')](',');var _0x5ad268={};_0x5ad268[_0x4d4212[0x0]]={'$gte':moment(_0x4d4212[0x1])[_0x7a28('0xcc')](_0x7a28('0xcd'))};_0x82a91a[_0x7a28('0x47')]=_[_0x7a28('0xa4')](_0x82a91a['where'],_0x5ad268);}_0x82a91a=_[_0x7a28('0xa4')]({},_0x82a91a,_0xba74ba[_0x7a28('0xc3')]);return db['OpenchannelMessage'][_0x7a28('0x23')]({'where':_0x82a91a[_0x7a28('0x47')]})[_0x7a28('0x29')](function(_0x2cba87){_0x29d970[_0x7a28('0x23')]=_0x2cba87;if(_0xba74ba[_0x7a28('0x3c')][_0x7a28('0xc1')]){_0x82a91a[_0x7a28('0xc2')]=[{'all':!![]}];}return db[_0x7a28('0xc7')][_0x7a28('0xce')](_0x82a91a);})[_0x7a28('0x29')](function(_0x110085){_0x29d970[_0x7a28('0xbe')]=_0x110085;return _0x29d970;});}})[_0x7a28('0x29')](respondWithFilteredResult(_0x379e12,_0x82a91a))[_0x7a28('0x35')](handleError(_0x379e12,null));};exports[_0x7a28('0xcf')]=function(_0x3fe265,_0x2b3eee,_0x1ac982){return db[_0x7a28('0x37')]['find']({'where':{'id':_0x3fe265[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0x2b3eee,null))[_0x7a28('0x29')](function(_0xb269d7){if(_0xb269d7){return _0xb269d7['setTags'](_0x3fe265[_0x7a28('0x7a')][_0x7a28('0xc8')],_[_0x7a28('0xc9')](_0x3fe265[_0x7a28('0x7a')],[_0x7a28('0xc8'),'id'])||{})[_0x7a28('0xd0')](function(){return db[_0x7a28('0x73')][_0x7a28('0xce')]({'attributes':['id',_0x7a28('0x2d'),'color'],'where':{'id':_0x3fe265['body'][_0x7a28('0xc8')]}});})['then'](function(_0x5a81a1){socket[_0x7a28('0xd1')]('openchannelInteractionTags:save',{'id':Number(_0x3fe265[_0x7a28('0xc0')]['id']),'tags':_0x5a81a1||[]});return{'id':Number(_0x3fe265['params']['id']),'tags':_0x5a81a1||[]};});}})[_0x7a28('0x29')](respondWithResult(_0x2b3eee,null))[_0x7a28('0x35')](handleError(_0x2b3eee,null));};exports[_0x7a28('0xd2')]=function(_0x1fdb76,_0xab4350,_0x5b61ad){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1fdb76[_0x7a28('0xc0')]['id']}})[_0x7a28('0x29')](handleEntityNotFound(_0xab4350,null))[_0x7a28('0x29')](function(_0x39d501){if(_0x39d501){return _0x39d501[_0x7a28('0xd2')](_0x1fdb76['query'][_0x7a28('0xc8')]);}})[_0x7a28('0x29')](respondWithStatusCode(_0xab4350,null))[_0x7a28('0x35')](handleError(_0xab4350,null));};exports[_0x7a28('0xd3')]=function(_0x7fa8f6,_0x1f408c){var _0x257099=moment()[_0x7a28('0xd4')]()[_0x7a28('0xa2')]();var _0xee8504=path[_0x7a28('0xd5')](config[_0x7a28('0xd6')],_0x7a28('0xd7'),'files',_0x7a28('0xd8'));var _0x24ffb2=path[_0x7a28('0xd5')](config[_0x7a28('0xd6')],_0x7a28('0xd7'),'files',_0x7a28('0xd9'));var _0x10b964=path[_0x7a28('0xd5')](_0xee8504,_0x257099);var _0x1cd599=util[_0x7a28('0xcc')](_0x7a28('0xda'),_0x7fa8f6[_0x7a28('0xc0')]['id'],_0x257099);var _0x337880=path[_0x7a28('0xd5')](_0xee8504,_0x1cd599);var _0x541a47=[];_0x541a47[_0x7a28('0x34')]({'model':db['User'],'as':_0x7a28('0x77'),'attributes':['id',_0x7a28('0x31')],'raw':!![]});_0x541a47[_0x7a28('0x34')]({'model':db['CmContact'],'as':_0x7a28('0x69'),'attributes':['id',_0x7a28('0xdb'),_0x7a28('0xdc')],'raw':!![]});if(_0x7fa8f6[_0x7a28('0x3c')]['attachments']){_0x541a47['push']({'model':db[_0x7a28('0xdd')],'as':_0x7a28('0xdd'),'raw':!![]});}var _0xecd199=[{'model':db[_0x7a28('0xc7')],'as':_0x7a28('0xde'),'attributes':['id',_0x7a28('0x7a'),_0x7a28('0xdf'),'direction',_0x7a28('0xe0'),'read'],'include':_0x541a47}];_0xecd199[_0x7a28('0x34')]({'model':db[_0x7a28('0xe1')],'as':_0x7a28('0xe2'),'attributes':['id',_0x7a28('0x2d')]});_0xecd199[_0x7a28('0x34')]({'model':db[_0x7a28('0x77')],'as':_0x7a28('0xe3'),'attributes':['id','fullname']});return db[_0x7a28('0x37')]['find']({'where':{'id':_0x7fa8f6['params']['id']},'include':_0xecd199})[_0x7a28('0x29')](handleEntityNotFound(_0x1f408c,null))[_0x7a28('0x29')](function(_0x5cc320){if(_0x5cc320){var _0xb9d4b7=_0x5cc320[_0x7a28('0xe4')]({'plain':!![]});fs[_0x7a28('0xe5')](_0x10b964);var _0x491275={'channel':_0x7a28('0xe6'),'account':_0xb9d4b7[_0x7a28('0xe2')]['name'],'agent':_0xb9d4b7[_0x7a28('0xe3')]?_0xb9d4b7['Owner'][_0x7a28('0x31')]:'N.A.','createdAt':moment(_0xb9d4b7[_0x7a28('0xdf')])[_0x7a28('0xcc')](_0x7a28('0xcd'))[_0x7a28('0xa2')](),'closedAt':_0xb9d4b7['closed']?moment(_0xb9d4b7[_0x7a28('0xe7')])[_0x7a28('0xcc')](_0x7a28('0xcd'))['toString']():'','disposition':_0xb9d4b7[_0x7a28('0xe8')],'visibility':_0xb9d4b7['threadId']?_0x7a28('0xe9'):_0x7a28('0xea'),'messages':_(_0xb9d4b7['Messages'])[_0x7a28('0x8c')]({'secret':![]})[_0x7a28('0x30')](function(_0x514c92){if(_0x514c92[_0x7a28('0xdd')]){var _0x3c3901=path['join'](_0x24ffb2,_0x514c92[_0x7a28('0xdd')][_0x7a28('0xeb')]);if(fs[_0x7a28('0xec')](_0x3c3901)){fs['createReadStream'](_0x3c3901)[_0x7a28('0xed')](fs[_0x7a28('0xee')](path[_0x7a28('0xd5')](_0x10b964,_0x514c92[_0x7a28('0xdd')]['basename'])));}}return{'date':moment(_0x514c92[_0x7a28('0xdf')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x514c92['direction']===_0x7a28('0xef')?_0x514c92[_0x7a28('0x77')]?_0x514c92['User'][_0x7a28('0x31')]:_0x7a28('0xf0'):_0x514c92[_0x7a28('0x69')][_0x7a28('0xdb')]+(_0x514c92[_0x7a28('0x69')][_0x7a28('0xdc')]?'\x20'+_0x514c92[_0x7a28('0x69')][_0x7a28('0xdc')]:''),'body':_0x514c92['Attachment']?_0x514c92['Attachment'][_0x7a28('0xeb')]:_0x514c92['body'],'direction':_0x514c92[_0x7a28('0xf1')]==='out'?'A':'C','secret':_0x514c92[_0x7a28('0xe0')],'read':_0x514c92[_0x7a28('0x87')],'attachment':_0x514c92[_0x7a28('0xdd')]};})['value']()};return ejs[_0x7a28('0xf2')](path[_0x7a28('0xd5')](config[_0x7a28('0xd6')],_0x7a28('0xd7'),_0x7a28('0xf3'),_0x7a28('0xf4')),{'interaction':_0x491275})[_0x7a28('0x29')](function(_0x185a4b){var _0x5cf670=path[_0x7a28('0xd5')](_0x10b964,_0x7a28('0xf5')+_0xb9d4b7['id']+'-'+_0x257099+_0x7a28('0xf6'));var _0x422080={'path':_0x5cf670,'channel':_0x7a28('0xe6'),'interactionId':_0xb9d4b7['id']};return pdf[_0x7a28('0xf7')](_0x185a4b,_0x422080);})[_0x7a28('0x29')](function(){return new BPromise(function(_0x3397db,_0x5310f9){zipdir(_0x10b964,{'saveTo':_0x337880},function(_0x58e488,_0x4edd34){if(_0x58e488)return _0x5310f9(_0x58e488);return _0x3397db(_0x4edd34);});})[_0x7a28('0x29')](function(){return new BPromise(function(_0x5eb6ab,_0x4cab6a){rimraf(_0x10b964,function(_0x2956b1){if(_0x2956b1)_0x4cab6a(_0x2956b1);return _0x5eb6ab();});});})[_0x7a28('0x29')](function(){return _0x1f408c[_0x7a28('0xd3')](_0x337880,_0x1cd599,function(_0x5c29a9){if(_0x5c29a9){console[_0x7a28('0xf8')](_0x7a28('0xf9'),_0x5c29a9);}else{fs[_0x7a28('0xfa')](_0x337880);}});});});}else{return _0x1f408c['sendStatus'](0xc8);}})[_0x7a28('0x35')](handleError(_0x1f408c,null));}; \ No newline at end of file +var _0x3655=['having','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','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','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','show','params','intersection','merge','options','create','destroy','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','Tag','findAll','emit','openchannelInteractionTags:save','removeTags','download','join','files','root','server','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Attachment','Messages','direction','secret','Account','Owner','get','Openchannel','N.A.','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','System','lastName','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../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','./openchannelInteraction.socket','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','then','error','stack','name','Users','fullname','Tags','TagIds','split','forEach','push','catch','index','map','OpenchannelInteraction','rawAttributes','type','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','`\x20=\x200'];(function(_0x2bf7d4,_0x28ff13){var _0x2345cb=function(_0xd2b46c){while(--_0xd2b46c){_0x2bf7d4['push'](_0x2bf7d4['shift']());}};_0x2345cb(++_0x28ff13);}(_0x3655,0x8d));var _0x5365=function(_0x3e36b6,_0x43de3b){_0x3e36b6=_0x3e36b6-0x0;var _0x4a3a36=_0x3655[_0x3e36b6];return _0x4a3a36;};'use strict';var emlformat=require(_0x5365('0x0'));var rimraf=require(_0x5365('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5365('0x2'));var rp=require('request-promise');var moment=require(_0x5365('0x3'));var BPromise=require(_0x5365('0x4'));var Mustache=require(_0x5365('0x5'));var util=require(_0x5365('0x6'));var path=require(_0x5365('0x7'));var sox=require(_0x5365('0x8'));var csv=require(_0x5365('0x9'));var ejs=require(_0x5365('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5365('0xb'));var squel=require('squel');var crypto=require(_0x5365('0xc'));var jsforce=require(_0x5365('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5365('0x9'));var querystring=require(_0x5365('0xe'));var Papa=require('papaparse');var Redis=require(_0x5365('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5365('0x10'));var as=require(_0x5365('0x11'));var pdf=require(_0x5365('0x12'));var hardwareService=require(_0x5365('0x13'));var logger=require(_0x5365('0x14'))(_0x5365('0x15'));var utils=require(_0x5365('0x16'));var config=require(_0x5365('0x17'));var licenseUtil=require(_0x5365('0x18'));var db=require(_0x5365('0x19'))['db'];config[_0x5365('0x1a')]=_[_0x5365('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5365('0x1c'))['register'](socket);function respondWithStatusCode(_0x4c2e1f,_0x281cb5){_0x281cb5=_0x281cb5||0xcc;return function(_0xabc3db){if(_0xabc3db){return _0x4c2e1f[_0x5365('0x1d')](_0x281cb5);}return _0x4c2e1f['status'](_0x281cb5)[_0x5365('0x1e')]();};}function respondWithResult(_0x12bd96,_0x505012){_0x505012=_0x505012||0xc8;return function(_0x1d257a){if(_0x1d257a){return _0x12bd96[_0x5365('0x1f')](_0x505012)[_0x5365('0x20')](_0x1d257a);}};}function respondWithFilteredResult(_0x4245f2,_0x423394){return function(_0x55c020){if(_0x55c020){var _0x1febf9=typeof _0x423394['offset']===_0x5365('0x21')&&typeof _0x423394[_0x5365('0x22')]==='undefined';var _0x219837=_0x55c020['count'];var _0x463d96=_0x1febf9?0x0:_0x423394[_0x5365('0x23')];var _0x57633a=_0x1febf9?_0x55c020[_0x5365('0x24')]:_0x423394['offset']+_0x423394[_0x5365('0x22')];var _0x1a665a;if(_0x57633a>=_0x219837){_0x57633a=_0x219837;_0x1a665a=0xc8;}else{_0x1a665a=0xce;}_0x4245f2[_0x5365('0x1f')](_0x1a665a);return _0x4245f2[_0x5365('0x25')](_0x5365('0x26'),_0x463d96+'-'+_0x57633a+'/'+_0x219837)[_0x5365('0x20')](_0x55c020);}return null;};}function patchUpdates(_0x59e012){return function(_0x1c1111){try{jsonpatch['apply'](_0x1c1111,_0x59e012,!![]);}catch(_0x2a71fc){return BPromise[_0x5365('0x27')](_0x2a71fc);}return _0x1c1111['save']();};}function saveUpdates(_0x3121e2,_0x3f7088){return function(_0x1a2821){if(_0x1a2821){return _0x1a2821['update'](_0x3121e2)[_0x5365('0x28')](function(_0x1d5fd7){return _0x1d5fd7;});}return null;};}function removeEntity(_0x57abfa,_0x2dd91a){return function(_0x587370){if(_0x587370){return _0x587370['destroy']()[_0x5365('0x28')](function(){_0x57abfa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f1c6b,_0x114095){return function(_0x43488d){if(!_0x43488d){_0x4f1c6b[_0x5365('0x1d')](0x194);}return _0x43488d;};}function handleError(_0x5833c7,_0x18efd1){_0x18efd1=_0x18efd1||0x1f4;return function(_0x24a76a){logger[_0x5365('0x29')](_0x24a76a[_0x5365('0x2a')]);if(_0x24a76a[_0x5365('0x2b')]){delete _0x24a76a['name'];}_0x5833c7[_0x5365('0x1f')](_0x18efd1)['send'](_0x24a76a);};}function getInteractionUsers(_0x5ece66,_0x5d8603){return new BPromise(function(_0x14b884,_0x338998){try{if(_0x5d8603[_0x5ece66['id']]){_0x5ece66[_0x5365('0x2c')]=_['map'](_0x5d8603[_0x5ece66['id']],function(_0x470c00){return{'id':_0x470c00['id'],'fullname':_0x470c00[_0x5365('0x2d')]};});}}catch(_0x3f09cf){_0x338998(_0x3f09cf);}_0x14b884(_0x5ece66);});}function getInteractionTags(_0x4b169d,_0x39fc16){return new BPromise(function(_0x15a464,_0x5a8153){try{if(_0x4b169d['TagIds']){_0x4b169d[_0x5365('0x2e')]=[];_0x4b169d[_0x5365('0x2f')][_0x5365('0x30')](',')[_0x5365('0x31')](function(_0x3b822e){_0x4b169d['Tags'][_0x5365('0x32')](_0x39fc16[_0x3b822e]);});}delete _0x4b169d['TagIds'];}catch(_0x4f7085){_0x5a8153(_0x4f7085);}_0x15a464(_0x4b169d);});}function updateOpenchannelInteraction(_0x474fbe,_0x1a350c,_0x5e7d5a){return new BPromise(function(_0x236117,_0x125d4b){return getInteractionUsers(_0x474fbe,_0x5e7d5a)[_0x5365('0x28')](function(_0x352aa0){return getInteractionTags(_0x352aa0,_0x1a350c);})[_0x5365('0x28')](function(_0x441d3b){_0x236117(_0x441d3b);})[_0x5365('0x33')](function(_0x3be2be){_0x125d4b(_0x3be2be);});});}exports[_0x5365('0x34')]=function(_0x51eb79,_0x4271b9){var _0x23e241={},_0x29ee5f={},_0x27e7bc={'count':0x0,'rows':[]};var _0x46af1c=_[_0x5365('0x35')](db[_0x5365('0x36')][_0x5365('0x37')],function(_0x6b15d9){return{'name':_0x6b15d9['fieldName'],'type':_0x6b15d9[_0x5365('0x38')]['key']};});_0x29ee5f[_0x5365('0x39')]=_[_0x5365('0x35')](_0x46af1c,'name');_0x29ee5f[_0x5365('0x3a')]=_['keys'](_0x51eb79[_0x5365('0x3a')]);_0x29ee5f[_0x5365('0x3b')]=_['intersection'](_0x29ee5f[_0x5365('0x39')],_0x29ee5f['query']);_0x23e241[_0x5365('0x3c')]=_['intersection'](_0x29ee5f[_0x5365('0x39')],qs[_0x5365('0x3d')](_0x51eb79[_0x5365('0x3a')]['fields']));_0x23e241[_0x5365('0x3c')]=_0x23e241[_0x5365('0x3c')]['length']?_0x23e241[_0x5365('0x3c')]:_0x29ee5f[_0x5365('0x39')];if(!_0x51eb79['query']['hasOwnProperty'](_0x5365('0x3e'))){_0x23e241['limit']=qs[_0x5365('0x22')](_0x51eb79[_0x5365('0x3a')][_0x5365('0x22')]);_0x23e241[_0x5365('0x23')]=qs[_0x5365('0x23')](_0x51eb79[_0x5365('0x3a')][_0x5365('0x23')]);}_0x23e241[_0x5365('0x3f')]=qs[_0x5365('0x40')](_0x51eb79[_0x5365('0x3a')][_0x5365('0x40')]);_0x23e241[_0x5365('0x41')]=qs[_0x5365('0x3b')](_[_0x5365('0x42')](_0x51eb79['query'],_0x29ee5f[_0x5365('0x3b')]),_0x46af1c);var _0x14d703=[];var _0x56f003=squel[_0x5365('0x43')]()[_0x5365('0x44')]('id')[_0x5365('0x44')]('name')[_0x5365('0x44')](_0x5365('0x45'))[_0x5365('0x46')](_0x5365('0x47'));var _0xb129cd=squel[_0x5365('0x43')]()[_0x5365('0x44')]('u.id')['field'](_0x5365('0x48'))[_0x5365('0x44')](_0x5365('0x49'))['from']('user_has_openchannel_interactions','ui')[_0x5365('0x4a')](_0x5365('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x1c7083=squel['select']()[_0x5365('0x46')](_0x5365('0x4c'),'i')[_0x5365('0x4a')](_0x5365('0x4d'),'c',_0x5365('0x4e'))[_0x5365('0x4a')](_0x5365('0x4b'),'o',_0x5365('0x4f'))[_0x5365('0x4a')]('openchannel_accounts','a',_0x5365('0x50'))['left_join'](_0x5365('0x51'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x5365('0x4a')]('openchannel_interaction_has_tags','it',_0x5365('0x52'))['left_join'](_0x5365('0x47'),'t','t.id\x20=\x20it.TagId');var _0x5ca9a2=squel['expr']();var _0x85de2a=[];var _0x3a2845=squel['expr']();var _0x903af8;if(_0x51eb79[_0x5365('0x3a')][_0x5365('0x53')]){_0x903af8=as[_0x5365('0x54')](_0x51eb79['query'][_0x5365('0x53')]);var _0x4e7cb7=_0x903af8[_0x5365('0x55')];for(var _0x1a35dd=0x0;_0x1a35dd<_0x903af8[_0x5365('0x56')][_0x5365('0x57')];_0x1a35dd++){var _0x579a80=_0x903af8[_0x5365('0x56')][_0x1a35dd];var _0x342f51='i';var _0x358b56=_['find'](_0x46af1c,['name',_0x579a80['field']]);if(!_0x358b56){switch(_0x579a80['field']){case _0x5365('0x58'):if(_0x579a80[_0x5365('0x59')]==0x1){_0x1c7083['having']('`'+_0x579a80[_0x5365('0x44')]+_0x5365('0x5a'));}else{_0x1c7083[_0x5365('0x5b')]('`'+_0x579a80[_0x5365('0x44')]+'`\x20>\x200');}break;case _0x5365('0x5c'):if(_0x579a80[_0x5365('0x5d')]===_0x5365('0x5e')){if(_0x579a80[_0x5365('0x59')][_0x5365('0x30')]('\x20')[_0x5365('0x57')]>0x1){_0x5ca9a2[_0x4e7cb7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5365('0x5f')](_0x579a80[_0x5365('0x59')]),null);}else{var _0x37351b='%'+_0x579a80[_0x5365('0x59')]+'%';_0x5ca9a2[_0x4e7cb7](_0x5365('0x60'),_0x37351b,_0x37351b,_0x37351b);}}else{_0x358b56=_[_0x5365('0x61')](_0x46af1c,[_0x5365('0x2b'),_0x5365('0x62')]);_0x579a80[_0x5365('0x44')]=_0x5365('0x62');_0xe34ab=as[_0x5365('0x63')](_0x342f51,_0x358b56['type'],_0x579a80);_0x5ca9a2[_0x4e7cb7](_0xe34ab[_0x5365('0x64')],_0xe34ab['value'][_0x5365('0x65')],_0xe34ab[_0x5365('0x59')]['end']);}break;case'Tag':var _0x514aa6=_0x579a80[_0x5365('0x59')][_0x5365('0x30')](',')['map'](function(_0x4ddc7f){return Number(_0x4ddc7f);});_0x514aa6[_0x5365('0x31')](function(_0x25393e){_0x3a2845['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25393e+',%');});_0x85de2a=_[_0x5365('0x66')](_0x85de2a,_0x514aa6);break;case'User':if(_0x579a80[_0x5365('0x5d')]===_0x5365('0x5e')){_0x5ca9a2[_0x4e7cb7](_0x5365('0x67'),'%'+_0x579a80[_0x5365('0x59')]+'%',null);}else{_0x358b56=_[_0x5365('0x61')](_0x46af1c,['name',_0x5365('0x68')]);_0x579a80[_0x5365('0x44')]='UserId';_0xe34ab=as[_0x5365('0x63')](_0x342f51,_0x358b56[_0x5365('0x38')],_0x579a80);_0x5ca9a2[_0x4e7cb7](_0xe34ab[_0x5365('0x64')],_0xe34ab[_0x5365('0x59')][_0x5365('0x65')],_0xe34ab[_0x5365('0x59')][_0x5365('0x1e')]);}break;case _0x5365('0x69'):_0xe34ab=as['buildExpression']('me',null,_0x579a80);_0x5ca9a2[_0x4e7cb7](_0xe34ab['text'],_0xe34ab[_0x5365('0x59')][_0x5365('0x65')],_0xe34ab[_0x5365('0x59')][_0x5365('0x1e')]);break;}}else{var _0xe34ab=as['buildExpression'](_0x342f51,_0x358b56[_0x5365('0x38')],_0x579a80);_0x5ca9a2[_0x4e7cb7](_0xe34ab['text'],_0xe34ab[_0x5365('0x59')][_0x5365('0x65')],_0xe34ab['value']['end']);}}}else{var _0x3a1faf=_(_0x51eb79['query'])[_0x5365('0x6a')]()['map'](function(_0x1b3942){return _[_0x5365('0x6b')](_0x46af1c,['name',_0x1b3942])?_0x1b3942:undefined;})[_0x5365('0x6c')]()[_0x5365('0x59')]();if(!_[_0x5365('0x6d')](_0x3a1faf)){_0x3a1faf[_0x5365('0x31')](function(_0x4c5759){if(_0x4c5759===_0x5365('0x6e')){_0x1c7083[_0x5365('0x41')](_0x5365('0x6f'),[][_0x5365('0x70')](_0x51eb79[_0x5365('0x3a')][_0x4c5759]));}else if(_0x4c5759===_0x5365('0x71')){var _0x289e14=JSON[_0x5365('0x72')](_0x51eb79[_0x5365('0x3a')][_0x4c5759])[_0x5365('0x73')];var _0x3510bf=JSON[_0x5365('0x72')](_0x51eb79['query'][_0x4c5759])[_0x5365('0x74')];_0x1c7083[_0x5365('0x41')](_0x5365('0x75'),_0x289e14,_0x3510bf);}else{if(_0x51eb79[_0x5365('0x3a')][_0x4c5759]===_0x5365('0x76')){_0x1c7083['where']('i.'+_0x4c5759+_0x5365('0x77'));}else{_0x1c7083[_0x5365('0x41')]('i.'+_0x4c5759+'\x20=\x20?',_0x51eb79[_0x5365('0x3a')][_0x4c5759]);}}});}if(_0x51eb79[_0x5365('0x3a')]['read']){if(_0x51eb79['query'][_0x5365('0x78')]==0x1){_0x1c7083['having'](_0x5365('0x79'));}else{_0x1c7083[_0x5365('0x5b')](_0x5365('0x7a'));}}if(_0x51eb79[_0x5365('0x3a')]['tag']){_0x85de2a=_[_0x5365('0x7b')](_0x51eb79['query'][_0x5365('0x7c')])?_0x51eb79[_0x5365('0x3a')][_0x5365('0x7c')]:new Array(_0x51eb79['query'][_0x5365('0x7c')]);_0x85de2a[_0x5365('0x31')](function(_0x172f10){_0x3a2845['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x172f10+',%');});}if(_0x51eb79[_0x5365('0x3a')][_0x5365('0x7d')]){var _0x2725f9=_0x51eb79[_0x5365('0x3a')][_0x5365('0x7d')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x5365('0x7e')](_0x2725f9)){_0x5ca9a2['or'](_0x5365('0x7f'),_0x2725f9+'%');}else{_0x5ca9a2['or'](_0x5365('0x80'),qs['getFullTextValue'](_0x2725f9))['or'](_0x5365('0x81'),_0x2725f9+'%')['or'](_0x5365('0x82'),_0x2725f9+'%');}}}_0x1c7083['where'](_0x5ca9a2);_0x1c7083[_0x5365('0x83')](_0x5365('0x84'));var _0x486cc6={'type':db['Sequelize']['QueryTypes'][_0x5365('0x85')],'raw':!![]};var _0x528926=_0x1c7083[_0x5365('0x86')]();_0x528926['field'](_0x5365('0x84'));_0x528926[_0x5365('0x44')](_0x5365('0x87'),_0x5365('0x58'));if(_0x23e241[_0x5365('0x3f')]){_0x23e241['order'][_0x5365('0x31')](function(_0x4edfb5){var _0x28fde1=_0x4edfb5[0x0]===_0x5365('0x88')?_0x4edfb5[0x0]:'i.'+_0x4edfb5[0x0];_0x1c7083['order'](_0x28fde1,_0x4edfb5[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5365('0x6d')](_0x85de2a)){_0x1c7083[_0x5365('0x5b')](_0x3a2845);_0x528926['where']('t.id\x20IN\x20?',_0x85de2a);}BPromise[_0x5365('0x89')]()[_0x5365('0x28')](function(){if(!_0x903af8){if(_0x51eb79['query'][_0x5365('0x6e')])return;_0x528926[_0x5365('0x41')](_0x5365('0x8a'));_0x1c7083['where'](_0x5365('0x8a'));return;}if(_0x51eb79[_0x5365('0x8b')]['role']!==_0x5365('0x8c'))return;return _0x51eb79[_0x5365('0x8b')][_0x5365('0x8d')]({'attributes':['id'],'raw':!![]})[_0x5365('0x28')](function(_0x35a895){if(_['isEmpty'](_0x35a895)){_0x528926[_0x5365('0x41')](_0x5365('0x8e'));_0x1c7083[_0x5365('0x41')](_0x5365('0x8e'));}else{_0x528926[_0x5365('0x41')](_0x5365('0x6f'),_[_0x5365('0x35')](_0x35a895,'id'));_0x1c7083['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0x5365('0x35')](_0x35a895,'id'));}});})['then'](function(){if(_0x51eb79['user'][_0x5365('0x8f')]===_0x5365('0x8c')&&!_0x903af8&&!_0x51eb79[_0x5365('0x3a')][_0x5365('0x6e')])return[];return db[_0x5365('0x90')]['query'](_0x528926['toString'](),_0x486cc6);})[_0x5365('0x28')](function(_0x46e9c3){_0x27e7bc['count']=_0x46e9c3[_0x5365('0x57')];if(_0x27e7bc[_0x5365('0x24')]===0x0)return[];return db[_0x5365('0x90')]['query'](_0x56f003['toString'](),_0x486cc6)[_0x5365('0x28')](function(_0x5959cd){_0x14d703=_['keyBy'](_0x5959cd,'id');_0x486cc6=_['merge'](_0x486cc6,{'model':db[_0x5365('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51eb79[_0x5365('0x3a')][_0x5365('0x3d')]){_0x23e241[_0x5365('0x3c')][_0x5365('0x31')](function(_0x485abf){_0x1c7083['field']('i.'+_0x485abf);});}else{_0x1c7083['field'](_0x5365('0x87'),_0x5365('0x58'));_0x1c7083[_0x5365('0x44')](_0x5365('0x91'),_0x5365('0x92'));_0x1c7083['field'](_0x5365('0x93'),_0x5365('0x94'));_0x1c7083['field'](_0x5365('0x95'),_0x5365('0x88'));_0x1c7083[_0x5365('0x44')]('i.*');_0x1c7083[_0x5365('0x44')](_0x5365('0x96'),'Contact.firstName');_0x1c7083[_0x5365('0x44')](_0x5365('0x97'),_0x5365('0x98'));_0x1c7083[_0x5365('0x44')](_0x5365('0x99'),'Contact.email');_0x1c7083[_0x5365('0x44')](_0x5365('0x9a'),'Contact.phone');_0x1c7083[_0x5365('0x44')](_0x5365('0x9b'),_0x5365('0x9c'));_0x1c7083[_0x5365('0x44')]('c.fax',_0x5365('0x9d'));_0x1c7083[_0x5365('0x44')]('o.fullname',_0x5365('0x9e'));_0x1c7083[_0x5365('0x44')](_0x5365('0x9f'),'Owner.internal');_0x1c7083[_0x5365('0x44')](_0x5365('0xa0'),_0x5365('0x2f'));}if(_0x23e241[_0x5365('0x22')])_0x1c7083[_0x5365('0x22')](_0x23e241[_0x5365('0x22')]);if(_0x23e241['offset'])_0x1c7083[_0x5365('0x23')](_0x23e241[_0x5365('0x23')]);return db[_0x5365('0x90')][_0x5365('0x3a')](_0x1c7083[_0x5365('0xa1')](),_0x486cc6);})[_0x5365('0x28')](function(_0x2a2ec6){if(_0x2a2ec6['length']>0x0)_0xb129cd[_0x5365('0x41')](_0x5365('0xa2'),_[_0x5365('0x35')](_0x2a2ec6,'id'));return db[_0x5365('0x90')]['query'](_0xb129cd[_0x5365('0xa1')](),_0x486cc6)[_0x5365('0x28')](function(_0x200b12){var _0x18ef17=_[_0x5365('0xa3')](_0x200b12,_0x5365('0xa4'));var _0x3f2a92=[];_0x2a2ec6['forEach'](function(_0x40fd67){_0x3f2a92[_0x5365('0x32')](updateOpenchannelInteraction(_0x40fd67,_0x14d703,_0x18ef17));});return BPromise[_0x5365('0xa5')](_0x3f2a92);});});})[_0x5365('0x28')](function(_0x2259d0){_0x27e7bc['rows']=_0x2259d0;return _0x27e7bc;})[_0x5365('0x28')](respondWithFilteredResult(_0x4271b9,_0x23e241))[_0x5365('0x33')](handleError(_0x4271b9,null));};exports[_0x5365('0xa6')]=function(_0xec9e0a,_0x5b887c){var _0x163e07={};if(_0xec9e0a[_0x5365('0x3a')][_0x5365('0x38')]&&_0xec9e0a['query'][_0x5365('0x38')]===_0x5365('0x46')){_0x163e07['from']=_0xec9e0a[_0x5365('0xa7')]['id'];}else{_0x163e07['id']=_0xec9e0a[_0x5365('0xa7')]['id'];}var _0x40e468={'raw':![],'where':_0x163e07},_0x144e8c={};_0x144e8c[_0x5365('0x39')]=_['keys'](db['OpenchannelInteraction'][_0x5365('0x37')]);_0x144e8c[_0x5365('0x3a')]=_[_0x5365('0x6a')](_0xec9e0a[_0x5365('0x3a')]);_0x144e8c[_0x5365('0x3b')]=_['intersection'](_0x144e8c[_0x5365('0x39')],_0x144e8c[_0x5365('0x3a')]);_0x40e468[_0x5365('0x3c')]=_[_0x5365('0xa8')](_0x144e8c['model'],qs[_0x5365('0x3d')](_0xec9e0a[_0x5365('0x3a')]['fields']));_0x40e468['attributes']=_0x40e468[_0x5365('0x3c')][_0x5365('0x57')]?_0x40e468[_0x5365('0x3c')]:_0x144e8c[_0x5365('0x39')];if(_0xec9e0a[_0x5365('0x3a')]['includeAll']){_0x40e468['include']=[{'all':!![]}];}_0x40e468=_[_0x5365('0xa9')]({},_0x40e468,_0xec9e0a[_0x5365('0xaa')]);return db[_0x5365('0x36')]['find'](_0x40e468)[_0x5365('0x28')](handleEntityNotFound(_0x5b887c,null))['then'](respondWithResult(_0x5b887c,null))[_0x5365('0x33')](handleError(_0x5b887c,null));};exports['create']=function(_0x27afe6,_0x2528d2){return db[_0x5365('0x36')][_0x5365('0xab')](_0x27afe6['body'],{})['then'](respondWithResult(_0x2528d2,0xc9))[_0x5365('0x33')](handleError(_0x2528d2,null));};exports['update']=function(_0x4543a5,_0x3bc037){if(_0x4543a5[_0x5365('0x69')]['id']){delete _0x4543a5['body']['id'];}return db[_0x5365('0x36')]['find']({'where':{'id':_0x4543a5[_0x5365('0xa7')]['id']}})['then'](handleEntityNotFound(_0x3bc037,null))[_0x5365('0x28')](saveUpdates(_0x4543a5['body'],null))[_0x5365('0x28')](respondWithResult(_0x3bc037,null))[_0x5365('0x33')](handleError(_0x3bc037,null));};exports[_0x5365('0xac')]=function(_0x42ea84,_0x57d6b8){return db[_0x5365('0x36')][_0x5365('0x61')]({'where':{'id':_0x42ea84[_0x5365('0xa7')]['id']}})[_0x5365('0x28')](handleEntityNotFound(_0x57d6b8,null))['then'](removeEntity(_0x57d6b8,null))[_0x5365('0x33')](handleError(_0x57d6b8,null));};exports[_0x5365('0xad')]=function(_0x5e4739,_0x150149){return db['OpenchannelInteraction'][_0x5365('0xad')]()['then'](respondWithResult(_0x150149,null))[_0x5365('0x33')](handleError(_0x150149,null));};exports[_0x5365('0xae')]=function(_0x537987,_0x218f1a,_0x6b474){return db['OpenchannelMessage'][_0x5365('0x61')]({'where':{'id':_0x537987[_0x5365('0xa7')]['id']}})[_0x5365('0x28')](handleEntityNotFound(_0x218f1a,null))[_0x5365('0x28')](function(_0x4081b0){if(_0x4081b0){return _0x4081b0['addMessage'](_0x537987[_0x5365('0x69')][_0x5365('0xaf')],_['omit'](_0x537987[_0x5365('0x69')],['ids','id'])||{});}})[_0x5365('0x28')](respondWithResult(_0x218f1a,null))[_0x5365('0x33')](handleError(_0x218f1a,null));};exports[_0x5365('0xb0')]=function(_0xacb600,_0x7d273,_0x24f65e){var _0x109a5c={'raw':![],'where':{}};var _0x3a5578={};var _0x33554c={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x5365('0xb1')]({'where':{'id':_0xacb600[_0x5365('0xa7')]['id']}})[_0x5365('0x28')](handleEntityNotFound(_0x7d273,null))['then'](function(_0x26e166){if(_0x26e166){_0x3a5578[_0x5365('0x39')]=_['keys'](db[_0x5365('0xb2')][_0x5365('0x37')]);_0x3a5578['query']=_[_0x5365('0x6a')](_0xacb600[_0x5365('0x3a')]);_0x3a5578[_0x5365('0x3b')]=_['intersection'](_0x3a5578['model'],_0x3a5578[_0x5365('0x3a')]);_0x109a5c[_0x5365('0x3c')]=_[_0x5365('0xa8')](_0x3a5578[_0x5365('0x39')],qs['fields'](_0xacb600['query'][_0x5365('0x3d')]));_0x109a5c[_0x5365('0x3c')]=_0x109a5c[_0x5365('0x3c')]['length']?_0x109a5c[_0x5365('0x3c')]:_0x3a5578[_0x5365('0x39')];if(!_0xacb600[_0x5365('0x3a')][_0x5365('0xb3')]('nolimit')){_0x109a5c[_0x5365('0x22')]=qs['limit'](_0xacb600[_0x5365('0x3a')]['limit']);_0x109a5c[_0x5365('0x23')]=qs[_0x5365('0x23')](_0xacb600[_0x5365('0x3a')]['offset']);}_0x109a5c[_0x5365('0x3f')]=qs['sort'](_0xacb600[_0x5365('0x3a')][_0x5365('0x40')]);_0x109a5c[_0x5365('0x41')]=qs[_0x5365('0x3b')](_['pick'](_0xacb600['query'],_0x3a5578[_0x5365('0x3b')]));_0x109a5c[_0x5365('0x41')][_0x5365('0xa4')]=_0x26e166['id'];if(_0xacb600[_0x5365('0x3a')]['filter']){_0x109a5c[_0x5365('0x41')]=_[_0x5365('0xa9')](_0x109a5c['where'],{'$or':_[_0x5365('0x35')](_0x109a5c['attributes'],function(_0xdc24ab){var _0x3d27bc={};_0x3d27bc[_0xdc24ab]={'$like':'%'+_0xacb600['query'][_0x5365('0x7d')]+'%'};return _0x3d27bc;})});}if(_0xacb600[_0x5365('0x3a')][_0x5365('0x73')]){var _0x51a71c=_0xacb600[_0x5365('0x3a')][_0x5365('0x73')][_0x5365('0x30')](',');var _0x2cdf4e={};_0x2cdf4e[_0x51a71c[0x0]]={'$gte':moment(_0x51a71c[0x1])[_0x5365('0xb4')](_0x5365('0xb5'))};_0x109a5c[_0x5365('0x41')]=_['merge'](_0x109a5c[_0x5365('0x41')],_0x2cdf4e);}_0x109a5c=_['merge']({},_0x109a5c,_0xacb600[_0x5365('0xaa')]);return db[_0x5365('0xb2')]['count']({'where':_0x109a5c[_0x5365('0x41')]})[_0x5365('0x28')](function(_0x1796f7){_0x33554c[_0x5365('0x24')]=_0x1796f7;if(_0xacb600[_0x5365('0x3a')][_0x5365('0xb6')]){_0x109a5c['include']=[{'all':!![]}];}return db[_0x5365('0xb2')]['findAll'](_0x109a5c);})['then'](function(_0x2df210){_0x33554c[_0x5365('0xb7')]=_0x2df210;return _0x33554c;});}})['then'](respondWithFilteredResult(_0x7d273,_0x109a5c))[_0x5365('0x33')](handleError(_0x7d273,null));};exports[_0x5365('0xb8')]=function(_0x49b855,_0x35a3a0,_0x1263f8){return db[_0x5365('0x36')]['find']({'where':{'id':_0x49b855[_0x5365('0xa7')]['id']}})[_0x5365('0x28')](handleEntityNotFound(_0x35a3a0,null))['then'](function(_0x439a2f){if(_0x439a2f){return _0x439a2f[_0x5365('0xb9')](_0x49b855[_0x5365('0x69')][_0x5365('0xaf')],_[_0x5365('0xba')](_0x49b855[_0x5365('0x69')],[_0x5365('0xaf'),'id'])||{})['spread'](function(){return db[_0x5365('0xbb')][_0x5365('0xbc')]({'attributes':['id','name',_0x5365('0x45')],'where':{'id':_0x49b855[_0x5365('0x69')][_0x5365('0xaf')]}});})[_0x5365('0x28')](function(_0x4a318a){socket[_0x5365('0xbd')](_0x5365('0xbe'),{'id':Number(_0x49b855['params']['id']),'tags':_0x4a318a||[]});return{'id':Number(_0x49b855['params']['id']),'tags':_0x4a318a||[]};});}})['then'](respondWithResult(_0x35a3a0,null))[_0x5365('0x33')](handleError(_0x35a3a0,null));};exports[_0x5365('0xbf')]=function(_0x1f9e59,_0x25ef02,_0x159cb7){return db['OpenchannelInteraction'][_0x5365('0x61')]({'where':{'id':_0x1f9e59[_0x5365('0xa7')]['id']}})[_0x5365('0x28')](handleEntityNotFound(_0x25ef02,null))[_0x5365('0x28')](function(_0x114fcc){if(_0x114fcc){return _0x114fcc[_0x5365('0xbf')](_0x1f9e59[_0x5365('0x3a')][_0x5365('0xaf')]);}})['then'](respondWithStatusCode(_0x25ef02,null))['catch'](handleError(_0x25ef02,null));};exports[_0x5365('0xc0')]=function(_0x5e94e4,_0xc00ef2){var _0x162bdd=moment()['unix']()[_0x5365('0xa1')]();var _0x29e0b0=path[_0x5365('0xc1')](config['root'],'server',_0x5365('0xc2'),'tmp');var _0x18b6f1=path[_0x5365('0xc1')](config[_0x5365('0xc3')],_0x5365('0xc4'),_0x5365('0xc2'),_0x5365('0xc5'));var _0x45b11f=path[_0x5365('0xc1')](_0x29e0b0,_0x162bdd);var _0x327fa3=util[_0x5365('0xb4')](_0x5365('0xc6'),_0x5e94e4[_0x5365('0xa7')]['id'],_0x162bdd);var _0x747ec=path[_0x5365('0xc1')](_0x29e0b0,_0x327fa3);var _0x28edb5=[];_0x28edb5[_0x5365('0x32')]({'model':db['User'],'as':_0x5365('0xc7'),'attributes':['id',_0x5365('0x2d')],'raw':!![]});_0x28edb5['push']({'model':db[_0x5365('0xc8')],'as':_0x5365('0x5c'),'attributes':['id',_0x5365('0xc9'),'lastName'],'raw':!![]});if(_0x5e94e4[_0x5365('0x3a')][_0x5365('0xc5')]){_0x28edb5[_0x5365('0x32')]({'model':db[_0x5365('0xca')],'as':_0x5365('0xca'),'raw':!![]});}var _0x499d5b=[{'model':db['OpenchannelMessage'],'as':_0x5365('0xcb'),'attributes':['id',_0x5365('0x69'),_0x5365('0x71'),_0x5365('0xcc'),_0x5365('0xcd'),_0x5365('0x78')],'include':_0x28edb5}];_0x499d5b[_0x5365('0x32')]({'model':db['OpenchannelAccount'],'as':_0x5365('0xce'),'attributes':['id',_0x5365('0x2b')]});_0x499d5b['push']({'model':db[_0x5365('0xc7')],'as':_0x5365('0xcf'),'attributes':['id',_0x5365('0x2d')]});return db[_0x5365('0x36')][_0x5365('0x61')]({'where':{'id':_0x5e94e4[_0x5365('0xa7')]['id']},'include':_0x499d5b})[_0x5365('0x28')](handleEntityNotFound(_0xc00ef2,null))[_0x5365('0x28')](function(_0x55e844){if(_0x55e844){var _0x381080=_0x55e844[_0x5365('0xd0')]({'plain':!![]});fs['mkdirSync'](_0x45b11f);var _0x421211={'channel':_0x5365('0xd1'),'account':_0x381080[_0x5365('0xce')]['name'],'agent':_0x381080[_0x5365('0xcf')]?_0x381080[_0x5365('0xcf')][_0x5365('0x2d')]:_0x5365('0xd2'),'createdAt':moment(_0x381080[_0x5365('0x71')])[_0x5365('0xb4')](_0x5365('0xb5'))[_0x5365('0xa1')](),'closedAt':_0x381080[_0x5365('0xd3')]?moment(_0x381080[_0x5365('0xd4')])[_0x5365('0xb4')](_0x5365('0xb5'))['toString']():'','disposition':_0x381080['disposition'],'visibility':_0x381080[_0x5365('0xd5')]?_0x5365('0xd6'):_0x5365('0xd7'),'messages':_(_0x381080[_0x5365('0xcb')])[_0x5365('0x7d')]({'secret':![]})[_0x5365('0x35')](function(_0x46c95a){if(_0x46c95a[_0x5365('0xca')]){var _0x2412ba=path['join'](_0x18b6f1,_0x46c95a[_0x5365('0xca')][_0x5365('0xd8')]);if(fs[_0x5365('0xd9')](_0x2412ba)){fs[_0x5365('0xda')](_0x2412ba)[_0x5365('0xdb')](fs[_0x5365('0xdc')](path[_0x5365('0xc1')](_0x45b11f,_0x46c95a[_0x5365('0xca')][_0x5365('0xd8')])));}}return{'date':moment(_0x46c95a[_0x5365('0x71')])[_0x5365('0xb4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5365('0xa1')](),'sender':_0x46c95a['direction']==='out'?_0x46c95a[_0x5365('0xc7')]?_0x46c95a[_0x5365('0xc7')][_0x5365('0x2d')]:_0x5365('0xdd'):_0x46c95a[_0x5365('0x5c')]['firstName']+(_0x46c95a[_0x5365('0x5c')][_0x5365('0xde')]?'\x20'+_0x46c95a[_0x5365('0x5c')][_0x5365('0xde')]:''),'body':_0x46c95a[_0x5365('0xca')]?_0x46c95a[_0x5365('0xca')][_0x5365('0xd8')]:_0x46c95a['body'],'direction':_0x46c95a[_0x5365('0xcc')]===_0x5365('0xdf')?'A':'C','secret':_0x46c95a[_0x5365('0xcd')],'read':_0x46c95a[_0x5365('0x78')],'attachment':_0x46c95a[_0x5365('0xca')]};})[_0x5365('0x59')]()};return ejs[_0x5365('0xe0')](path[_0x5365('0xc1')](config[_0x5365('0xc3')],_0x5365('0xc4'),_0x5365('0xe1'),_0x5365('0xe2')),{'interaction':_0x421211})[_0x5365('0x28')](function(_0x183b67){var _0x23ad9e=path['join'](_0x45b11f,'transcript-'+_0x381080['id']+'-'+_0x162bdd+_0x5365('0xe3'));var _0x66c71e={'path':_0x23ad9e,'channel':'Openchannel','interactionId':_0x381080['id']};return pdf[_0x5365('0xe4')](_0x183b67,_0x66c71e);})['then'](function(){return new BPromise(function(_0x2c6918,_0x1beced){zipdir(_0x45b11f,{'saveTo':_0x747ec},function(_0x4479dc,_0x230301){if(_0x4479dc)return _0x1beced(_0x4479dc);return _0x2c6918(_0x230301);});})[_0x5365('0x28')](function(){return new BPromise(function(_0xdb9881,_0x17e0ad){rimraf(_0x45b11f,function(_0x372556){if(_0x372556)_0x17e0ad(_0x372556);return _0xdb9881();});});})[_0x5365('0x28')](function(){return _0xc00ef2[_0x5365('0xc0')](_0x747ec,_0x327fa3,function(_0x2c2936){if(_0x2c2936){console[_0x5365('0xe5')](_0x5365('0xe6'),_0x2c2936);}else{fs[_0x5365('0xe7')](_0x747ec);}});});});}else{return _0xc00ef2[_0x5365('0x1d')](0xc8);}})[_0x5365('0x33')](handleError(_0xc00ef2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 6c05458..1762db1 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 _0x1497=['emit','catch','hook','exports','events','OpenchannelMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1497,0x154));var _0x7149=function(_0xb06fe,_0x3153b8){_0xb06fe=_0xb06fe-0x0;var _0x155968=_0x1497[_0xb06fe];return _0x155968;};'use strict';var EventEmitter=require(_0x7149('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x7149('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7149('0x2'),'afterUpdate':'update','afterDestroy':_0x7149('0x3')};function emitEvent(_0x27dc92){return function(_0x284f15,_0x599e6f,_0x22c023){_0x284f15[_0x7149('0x4')]({'attributes':['id'],'raw':!![]})[_0x7149('0x5')](function(_0x151999){_0x284f15[_0x7149('0x6')](_0x7149('0x7'),_0x151999[_0x7149('0x8')](function(_0x234051){return{'id':_0x234051['id']};}));return OpenchannelMessage[_0x7149('0x9')]({'where':{'OpenchannelInteractionId':_0x284f15['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7149('0x5')](function(_0xe9fe4c){_0x284f15[_0x7149('0x6')](_0x7149('0xa'),_0xe9fe4c[_0x7149('0xb')]);OpenchannelInteractionEvents[_0x7149('0xc')](_0x27dc92+':'+_0x284f15['id'],_0x284f15);OpenchannelInteractionEvents[_0x7149('0xc')](_0x27dc92,_0x284f15);_0x22c023(null);})[_0x7149('0xd')](_0x22c023(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x7149('0xe')](e,emitEvent(event));}}module[_0x7149('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x98c4=['save','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners'];(function(_0x1a89f8,_0x43a3f7){var _0x1e64cc=function(_0x528a1d){while(--_0x528a1d){_0x1a89f8['push'](_0x1a89f8['shift']());}};_0x1e64cc(++_0x43a3f7);}(_0x98c4,0x9b));var _0x498c=function(_0x2adb0c,_0x22b3c6){_0x2adb0c=_0x2adb0c-0x0;var _0x21b9d4=_0x98c4[_0x2adb0c];return _0x21b9d4;};'use strict';var EventEmitter=require(_0x498c('0x0'));var OpenchannelInteraction=require(_0x498c('0x1'))['db'][_0x498c('0x2')];var OpenchannelMessage=require(_0x498c('0x1'))['db'][_0x498c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x498c('0x4')](0x0);var events={'afterCreate':_0x498c('0x5'),'afterUpdate':'update','afterDestroy':_0x498c('0x6')};function emitEvent(_0x81f412){return function(_0x5b67f7,_0x1ceae9,_0x2ec44b){_0x5b67f7[_0x498c('0x7')]({'attributes':['id'],'raw':!![]})[_0x498c('0x8')](function(_0xf03b5d){_0x5b67f7['setDataValue'](_0x498c('0x9'),_0xf03b5d[_0x498c('0xa')](function(_0x4c677d){return{'id':_0x4c677d['id']};}));return OpenchannelMessage[_0x498c('0xb')]({'where':{'OpenchannelInteractionId':_0x5b67f7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x498c('0x8')](function(_0x110f27){_0x5b67f7['setDataValue'](_0x498c('0xc'),_0x110f27[_0x498c('0xd')]);OpenchannelInteractionEvents[_0x498c('0xe')](_0x81f412+':'+_0x5b67f7['id'],_0x5b67f7);OpenchannelInteractionEvents[_0x498c('0xe')](_0x81f412,_0x5b67f7);_0x2ec44b(null);})['catch'](_0x2ec44b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x498c('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 88a31b8..3ab1798 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 _0x10da=['closed','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0xb5bb25,_0x44b314){var _0x1558b3=function(_0x55577c){while(--_0x55577c){_0xb5bb25['push'](_0xb5bb25['shift']());}};_0x1558b3(++_0x44b314);}(_0x10da,0x71));var _0xa10d=function(_0x29f36b,_0x4e5387){_0x29f36b=_0x29f36b-0x0;var _0x4c686e=_0x10da[_0x29f36b];return _0x4c686e;};'use strict';var _=require(_0xa10d('0x0'));var util=require('util');var logger=require(_0xa10d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa10d('0x2'));var rp=require(_0xa10d('0x3'));var fs=require('fs');var path=require(_0xa10d('0x4'));var rimraf=require(_0xa10d('0x5'));var config=require(_0xa10d('0x6'));var attributes=require(_0xa10d('0x7'));module[_0xa10d('0x8')]=function(_0x49ba5f,_0x14dcdc){return _0x49ba5f[_0xa10d('0x9')](_0xa10d('0xa'),attributes,{'tableName':_0xa10d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa10d('0xc'),'collate':_0xa10d('0xd'),'hooks':{'beforeUpdate':function(_0x4924fe,_0x39f273,_0x1f46e8){if(_0x4924fe[_0xa10d('0xe')](_0xa10d('0xf'))){_0x4924fe['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1f46e8(null,_0x4924fe);}}});}; \ No newline at end of file +var _0xe58d=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format'];(function(_0x4a2499,_0x255c84){var _0x31af9a=function(_0x4df64b){while(--_0x4df64b){_0x4a2499['push'](_0x4a2499['shift']());}};_0x31af9a(++_0x255c84);}(_0xe58d,0xac));var _0xde58=function(_0x746739,_0x289561){_0x746739=_0x746739-0x0;var _0x4b7447=_0xe58d[_0x746739];return _0x4b7447;};'use strict';var _=require(_0xde58('0x0'));var util=require(_0xde58('0x1'));var logger=require(_0xde58('0x2'))(_0xde58('0x3'));var moment=require('moment');var BPromise=require(_0xde58('0x4'));var rp=require(_0xde58('0x5'));var fs=require('fs');var path=require(_0xde58('0x6'));var rimraf=require(_0xde58('0x7'));var config=require('../../config/environment');var attributes=require(_0xde58('0x8'));module[_0xde58('0x9')]=function(_0x51db32,_0x40553a){return _0x51db32[_0xde58('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0xde58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde58('0xc'),'collate':_0xde58('0xd'),'hooks':{'beforeUpdate':function(_0x6878ee,_0x2e80ac,_0x478766){if(_0x6878ee[_0xde58('0xe')](_0xde58('0xf'))){_0x6878ee[_0xde58('0x10')]=moment()[_0xde58('0x11')](_0xde58('0x12'));}_0x478766(null,_0x6878ee);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 835c9df..5b3f742 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 _0xeea4=['redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','options','where','attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xeea4,0x1d3));var _0x4eea=function(_0x5eeccf,_0x4f06b6){_0x5eeccf=_0x5eeccf-0x0;var _0x461f33=_0xeea4[_0x5eeccf];return _0x461f33;};'use strict';var _=require(_0x4eea('0x0'));var util=require('util');var moment=require(_0x4eea('0x1'));var BPromise=require(_0x4eea('0x2'));var rs=require(_0x4eea('0x3'));var fs=require('fs');var Redis=require(_0x4eea('0x4'));var db=require(_0x4eea('0x5'))['db'];var utils=require(_0x4eea('0x6'));var logger=require(_0x4eea('0x7'))(_0x4eea('0x8'));var config=require(_0x4eea('0x9'));var jayson=require(_0x4eea('0xa'));var client=jayson[_0x4eea('0xb')][_0x4eea('0xc')]({'port':0x232a});config[_0x4eea('0xd')]=_[_0x4eea('0xe')](config[_0x4eea('0xd')],{'host':_0x4eea('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4eea('0xd')]));require(_0x4eea('0x10'))[_0x4eea('0x11')](socket);function respondWithRpcPromise(_0x3cd186,_0x583d64,_0x352bf2){return new BPromise(function(_0xb7b65e,_0x8b73bf){return client[_0x4eea('0x12')](_0x3cd186,_0x352bf2)[_0x4eea('0x13')](function(_0x2a5ab3){logger[_0x4eea('0x14')](_0x4eea('0x15'),_0x583d64,_0x4eea('0x16'));logger[_0x4eea('0x17')](_0x4eea('0x18'),_0x583d64,_0x4eea('0x16'),JSON[_0x4eea('0x19')](_0x2a5ab3));if(_0x2a5ab3[_0x4eea('0x1a')]){if(_0x2a5ab3[_0x4eea('0x1a')]['code']===0x1f4){logger[_0x4eea('0x1a')]('OpenchannelInteraction,\x20%s,\x20%s',_0x583d64,_0x2a5ab3['error']['message']);return _0x8b73bf(_0x2a5ab3[_0x4eea('0x1a')][_0x4eea('0x1b')]);}logger[_0x4eea('0x1a')](_0x4eea('0x15'),_0x583d64,_0x2a5ab3['error']['message']);return _0xb7b65e(_0x2a5ab3[_0x4eea('0x1a')][_0x4eea('0x1b')]);}else{logger[_0x4eea('0x14')](_0x4eea('0x15'),_0x583d64,_0x4eea('0x16'));_0xb7b65e(_0x2a5ab3[_0x4eea('0x1c')]['message']);}})[_0x4eea('0x1d')](function(_0x30615f){logger[_0x4eea('0x1a')](_0x4eea('0x15'),_0x583d64,_0x30615f);_0x8b73bf(_0x30615f);});});}exports[_0x4eea('0x1e')]=function(_0x1c2183){var _0x461fd2=this;return new Promise(function(_0x2bde9c,_0x200392){return db['OpenchannelInteraction']['update'](_0x1c2183['body'],{'raw':_0x1c2183[_0x4eea('0x1f')]?_0x1c2183[_0x4eea('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c2183['options']?_0x1c2183['options'][_0x4eea('0x20')]||null:null,'attributes':_0x1c2183['options']?_0x1c2183['options'][_0x4eea('0x21')]||null:null,'limit':_0x1c2183[_0x4eea('0x1f')]?_0x1c2183[_0x4eea('0x1f')]['limit']||null:null})['then'](function(_0x3ee2fc){logger[_0x4eea('0x14')](_0x4eea('0x1e'),_0x1c2183);logger['debug']('UpdateOpenchannelInteraction',_0x1c2183,JSON['stringify'](_0x3ee2fc));_0x2bde9c(_0x3ee2fc);})[_0x4eea('0x1d')](function(_0x531df5){logger[_0x4eea('0x1a')](_0x4eea('0x1e'),_0x531df5[_0x4eea('0x1b')],_0x1c2183);_0x200392(_0x461fd2['error'](0x1f4,_0x531df5['message']));});});};exports[_0x4eea('0x22')]=function(_0x225a0d){return new Promise(function(_0x130ff6,_0x454300){return db[_0x4eea('0x23')][_0x4eea('0x24')]({'where':_0x225a0d['options']?_0x225a0d[_0x4eea('0x1f')][_0x4eea('0x20')]||null:null})[_0x4eea('0x13')](function(_0x49c1d2){if(_0x49c1d2){return _0x49c1d2['addTags'](_0x225a0d['body'][_0x4eea('0x25')],_['omit'](_0x225a0d['body'],[_0x4eea('0x25'),'id'])||{});}})[_0x4eea('0x26')](function(_0x3570e5){logger[_0x4eea('0x14')](_0x4eea('0x27'),_0x225a0d);logger[_0x4eea('0x17')](_0x4eea('0x27'),_0x225a0d,JSON[_0x4eea('0x19')](_0x3570e5));_0x130ff6(_0x3570e5);})[_0x4eea('0x1d')](function(_0x55f676){logger['error']('AddTags',_0x55f676[_0x4eea('0x1b')],_0x225a0d);_0x454300(_this[_0x4eea('0x1a')](0x1f4,_0x55f676[_0x4eea('0x1b')]));});});}; \ No newline at end of file +var _0xf350=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','AddTagsToOpenchannelInteraction','where','addTags','ids','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xcc1a45,_0x4bd15f){var _0x921012=function(_0x157ec4){while(--_0x157ec4){_0xcc1a45['push'](_0xcc1a45['shift']());}};_0x921012(++_0x4bd15f);}(_0xf350,0x73));var _0x0f35=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf350[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f35('0x0'));var BPromise=require(_0x0f35('0x1'));var rs=require(_0x0f35('0x2'));var fs=require('fs');var Redis=require(_0x0f35('0x3'));var db=require(_0x0f35('0x4'))['db'];var utils=require(_0x0f35('0x5'));var logger=require(_0x0f35('0x6'))(_0x0f35('0x7'));var config=require('../../config/environment');var jayson=require(_0x0f35('0x8'));var client=jayson[_0x0f35('0x9')][_0x0f35('0xa')]({'port':0x232a});config[_0x0f35('0xb')]=_[_0x0f35('0xc')](config[_0x0f35('0xb')],{'host':_0x0f35('0xd'),'port':0x18eb});var socket=require(_0x0f35('0xe'))(new Redis(config[_0x0f35('0xb')]));require(_0x0f35('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f3433,_0x24a190,_0x40f6fd){return new BPromise(function(_0x34f72c,_0x14866c){return client[_0x0f35('0x10')](_0x4f3433,_0x40f6fd)[_0x0f35('0x11')](function(_0x89cf3e){logger[_0x0f35('0x12')](_0x0f35('0x13'),_0x24a190,_0x0f35('0x14'));logger['debug'](_0x0f35('0x15'),_0x24a190,'request\x20sent',JSON[_0x0f35('0x16')](_0x89cf3e));if(_0x89cf3e[_0x0f35('0x17')]){if(_0x89cf3e[_0x0f35('0x17')][_0x0f35('0x18')]===0x1f4){logger['error'](_0x0f35('0x13'),_0x24a190,_0x89cf3e[_0x0f35('0x17')]['message']);return _0x14866c(_0x89cf3e[_0x0f35('0x17')][_0x0f35('0x19')]);}logger['error'](_0x0f35('0x13'),_0x24a190,_0x89cf3e[_0x0f35('0x17')][_0x0f35('0x19')]);return _0x34f72c(_0x89cf3e[_0x0f35('0x17')]['message']);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x24a190,'request\x20sent');_0x34f72c(_0x89cf3e[_0x0f35('0x1a')][_0x0f35('0x19')]);}})[_0x0f35('0x1b')](function(_0x6eb32a){logger[_0x0f35('0x17')](_0x0f35('0x13'),_0x24a190,_0x6eb32a);_0x14866c(_0x6eb32a);});});}exports[_0x0f35('0x1c')]=function(_0x450503){var _0x47c8b4=this;return new Promise(function(_0x4883e0,_0x2eb76f){return db[_0x0f35('0x1d')][_0x0f35('0x1e')](_0x450503[_0x0f35('0x1f')],{'raw':_0x450503[_0x0f35('0x20')]?_0x450503[_0x0f35('0x20')][_0x0f35('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450503[_0x0f35('0x20')]?_0x450503['options']['where']||null:null,'attributes':_0x450503[_0x0f35('0x20')]?_0x450503[_0x0f35('0x20')]['attributes']||null:null,'limit':_0x450503[_0x0f35('0x20')]?_0x450503[_0x0f35('0x20')][_0x0f35('0x22')]||null:null})[_0x0f35('0x11')](function(_0x39fdee){logger['info'](_0x0f35('0x1c'),_0x450503);logger['debug'](_0x0f35('0x1c'),_0x450503,JSON['stringify'](_0x39fdee));_0x4883e0(_0x39fdee);})['catch'](function(_0x4af1d5){logger[_0x0f35('0x17')](_0x0f35('0x1c'),_0x4af1d5['message'],_0x450503);_0x2eb76f(_0x47c8b4[_0x0f35('0x17')](0x1f4,_0x4af1d5[_0x0f35('0x19')]));});});};exports[_0x0f35('0x23')]=function(_0x3b9269){return new Promise(function(_0x3e292d,_0x55e2ff){return db[_0x0f35('0x1d')]['find']({'where':_0x3b9269[_0x0f35('0x20')]?_0x3b9269['options'][_0x0f35('0x24')]||null:null})['then'](function(_0x455db4){if(_0x455db4){return _0x455db4[_0x0f35('0x25')](_0x3b9269[_0x0f35('0x1f')][_0x0f35('0x26')],_['omit'](_0x3b9269[_0x0f35('0x1f')],[_0x0f35('0x26'),'id'])||{});}})[_0x0f35('0x27')](function(_0x51d8ca){logger[_0x0f35('0x12')](_0x0f35('0x28'),_0x3b9269);logger['debug']('AddTags',_0x3b9269,JSON['stringify'](_0x51d8ca));_0x3e292d(_0x51d8ca);})[_0x0f35('0x1b')](function(_0x5c1669){logger['error']('AddTags',_0x5c1669['message'],_0x3b9269);_0x55e2ff(_this[_0x0f35('0x17')](0x1f4,_0x5c1669[_0x0f35('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 6e4cf3d..bf1e306 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 _0xf94f=['remove','removeListener','register','length','./openchannelInteraction.events','save'];(function(_0x3c41d5,_0x41e024){var _0x3cd68b=function(_0x4935e2){while(--_0x4935e2){_0x3c41d5['push'](_0x3c41d5['shift']());}};_0x3cd68b(++_0x41e024);}(_0xf94f,0xee));var _0xff94=function(_0x591a7e,_0x261cb7){_0x591a7e=_0x591a7e-0x0;var _0x3a1ca2=_0xf94f[_0x591a7e];return _0x3a1ca2;};'use strict';var OpenchannelInteractionEvents=require(_0xff94('0x0'));var events=[_0xff94('0x1'),_0xff94('0x2'),'update'];function createListener(_0x76c6a8,_0x341d6d){return function(_0x57b629){_0x341d6d['emit'](_0x76c6a8,_0x57b629);};}function removeListener(_0x43f59e,_0x530bfe){return function(){OpenchannelInteractionEvents[_0xff94('0x3')](_0x43f59e,_0x530bfe);};}exports[_0xff94('0x4')]=function(_0x3a4138){for(var _0x143ce1=0x0,_0x1c683e=events[_0xff94('0x5')];_0x143ce1<_0x1c683e;_0x143ce1++){var _0x2726c9=events[_0x143ce1];var _0x1720c1=createListener('openchannelInteraction:'+_0x2726c9,_0x3a4138);OpenchannelInteractionEvents['on'](_0x2726c9,_0x1720c1);}}; \ No newline at end of file +var _0x202b=['removeListener','openchannelInteraction:','save','remove','update','emit'];(function(_0x2acddf,_0x1a612f){var _0x29462c=function(_0x341cb8){while(--_0x341cb8){_0x2acddf['push'](_0x2acddf['shift']());}};_0x29462c(++_0x1a612f);}(_0x202b,0xce));var _0xb202=function(_0x85e768,_0x3655c3){_0x85e768=_0x85e768-0x0;var _0x17c60d=_0x202b[_0x85e768];return _0x17c60d;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xb202('0x0'),_0xb202('0x1'),_0xb202('0x2')];function createListener(_0x27a6ab,_0xcbbc6b){return function(_0x28e72a){_0xcbbc6b[_0xb202('0x3')](_0x27a6ab,_0x28e72a);};}function removeListener(_0x2aa30a,_0x4bcffd){return function(){OpenchannelInteractionEvents[_0xb202('0x4')](_0x2aa30a,_0x4bcffd);};}exports['register']=function(_0x4cc987){for(var _0x412a34=0x0,_0x138721=events['length'];_0x412a34<_0x138721;_0x412a34++){var _0x37e6a8=events[_0x412a34];var _0x557d9a=createListener(_0xb202('0x5')+_0x37e6a8,_0x4cc987);OpenchannelInteractionEvents['on'](_0x37e6a8,_0x557d9a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3a8c69f..e24220b 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x7ca705,_0x4807c0){var _0x414b8c=function(_0x1fbd87){while(--_0x1fbd87){_0x7ca705['push'](_0x7ca705['shift']());}};_0x414b8c(++_0x4807c0);}(_0xedd9,0xfc));var _0x9edd=function(_0x77859f,_0x17407c){_0x77859f=_0x77859f-0x0;var _0x2b3772=_0xedd9[_0x77859f];return _0x2b3772;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x3e6b4e,_0x31ee41){var _0x5296af=function(_0x6c0396){while(--_0x6c0396){_0x3e6b4e['push'](_0x3e6b4e['shift']());}};_0x5296af(++_0x31ee41);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 65e3860..d63399e 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 _0xccde=['STRING','sequelize','TEXT','BOOLEAN','out','DATE'];(function(_0x30b62f,_0x25a621){var _0xde9352=function(_0x941701){while(--_0x941701){_0x30b62f['push'](_0x30b62f['shift']());}};_0xde9352(++_0x25a621);}(_0xccde,0x1e1));var _0xeccd=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xccde[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require(_0xeccd('0x0'));module['exports']={'body':{'type':Sequelize[_0xeccd('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xeccd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xeccd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xeccd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeccd('0x4')]},'providerName':{'type':Sequelize[_0xeccd('0x5')]},'providerResponse':{'type':Sequelize[_0xeccd('0x1')]}}; \ No newline at end of file +var _0x174b=['medium','BOOLEAN','ENUM','out','TEXT','sequelize'];(function(_0x33e98c,_0x4a48ea){var _0x1cea96=function(_0x573923){while(--_0x573923){_0x33e98c['push'](_0x33e98c['shift']());}};_0x1cea96(++_0x4a48ea);}(_0x174b,0x19d));var _0xb174=function(_0x4ee1a7,_0x2a0664){_0x4ee1a7=_0x4ee1a7-0x0;var _0x3afa84=_0x174b[_0x4ee1a7];return _0x3afa84;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb174('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb174('0x3')]('in',_0xb174('0x4')),'defaultValue':_0xb174('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb174('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index e9d497b..47e69af 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 _0x3805=['RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','name','filter','options','OpenchannelMessage','includeAll','include','findAll','rows','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x5b7d3c,_0x48f09f){var _0x2bed17=function(_0x56c967){while(--_0x56c967){_0x5b7d3c['push'](_0x5b7d3c['shift']());}};_0x2bed17(++_0x48f09f);}(_0x3805,0x111));var _0x5380=function(_0xa72cf,_0x24a05c){_0xa72cf=_0xa72cf-0x0;var _0x263735=_0x3805[_0xa72cf];return _0x263735;};'use strict';var emlformat=require(_0x5380('0x0'));var rimraf=require(_0x5380('0x1'));var zipdir=require(_0x5380('0x2'));var jsonpatch=require(_0x5380('0x3'));var rp=require(_0x5380('0x4'));var moment=require(_0x5380('0x5'));var BPromise=require(_0x5380('0x6'));var Mustache=require(_0x5380('0x7'));var util=require(_0x5380('0x8'));var path=require(_0x5380('0x9'));var sox=require(_0x5380('0xa'));var csv=require('to-csv');var ejs=require(_0x5380('0xb'));var fs=require('fs');var fs_extra=require(_0x5380('0xc'));var _=require(_0x5380('0xd'));var squel=require(_0x5380('0xe'));var crypto=require(_0x5380('0xf'));var jsforce=require(_0x5380('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5380('0x11'));var querystring=require(_0x5380('0x12'));var Papa=require(_0x5380('0x13'));var Redis=require(_0x5380('0x14'));var authService=require(_0x5380('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x5380('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5380('0x17'))('api');var utils=require(_0x5380('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5380('0x19'));var db=require(_0x5380('0x1a'))['db'];config[_0x5380('0x1b')]=_[_0x5380('0x1c')](config[_0x5380('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5380('0x1d'))(new Redis(config[_0x5380('0x1b')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5380('0x1e'));var client=jayson[_0x5380('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x5380('0x1f')][_0x5380('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x15b26e,_0x365aeb,_0x2d7d85,_0x528962){return new BPromise(function(_0x4e884d,_0x39f638){var _0x4942c7=_0x528962||client;return _0x4942c7[_0x5380('0x21')](_0x15b26e,_0x2d7d85)[_0x5380('0x22')](function(_0x10a1b4){logger[_0x5380('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x365aeb,_0x5380('0x24'));logger[_0x5380('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x365aeb,_0x5380('0x24'),JSON['stringify'](_0x10a1b4));if(_0x10a1b4[_0x5380('0x26')]){if(_0x10a1b4['error'][_0x5380('0x27')]===0x1f4){logger['error'](_0x5380('0x28'),_0x365aeb,_0x10a1b4[_0x5380('0x26')][_0x5380('0x29')]);return _0x39f638(_0x10a1b4[_0x5380('0x26')][_0x5380('0x29')]);}logger[_0x5380('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x365aeb,_0x10a1b4['error'][_0x5380('0x29')]);return _0x4e884d(_0x10a1b4[_0x5380('0x26')][_0x5380('0x29')]);}else{logger[_0x5380('0x23')](_0x5380('0x28'),_0x365aeb,_0x5380('0x24'));_0x4e884d(_0x10a1b4[_0x5380('0x2a')][_0x5380('0x29')]);}})[_0x5380('0x2b')](function(_0x219626){logger[_0x5380('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x365aeb,_0x219626);_0x39f638(_0x219626);});});}function respondWithStatusCode(_0x3787d1,_0x5e95e4){_0x5e95e4=_0x5e95e4||0xcc;return function(_0x2b1260){if(_0x2b1260){return _0x3787d1['sendStatus'](_0x5e95e4);}return _0x3787d1['status'](_0x5e95e4)[_0x5380('0x2c')]();};}function respondWithResult(_0x39b109,_0x272e10){_0x272e10=_0x272e10||0xc8;return function(_0x1bf7bd){if(_0x1bf7bd){return _0x39b109['status'](_0x272e10)['json'](_0x1bf7bd);}};}function respondWithFilteredResult(_0x58b891,_0x3e5f53){return function(_0x575313){if(_0x575313){var _0x46042d=typeof _0x3e5f53[_0x5380('0x2d')]===_0x5380('0x2e')&&typeof _0x3e5f53[_0x5380('0x2f')]==='undefined';var _0x1a9a05=_0x575313[_0x5380('0x30')];var _0x353fb3=_0x46042d?0x0:_0x3e5f53[_0x5380('0x2d')];var _0x170a7f=_0x46042d?_0x575313[_0x5380('0x30')]:_0x3e5f53[_0x5380('0x2d')]+_0x3e5f53['limit'];var _0xbff15d;if(_0x170a7f>=_0x1a9a05){_0x170a7f=_0x1a9a05;_0xbff15d=0xc8;}else{_0xbff15d=0xce;}_0x58b891[_0x5380('0x31')](_0xbff15d);return _0x58b891[_0x5380('0x32')](_0x5380('0x33'),_0x353fb3+'-'+_0x170a7f+'/'+_0x1a9a05)[_0x5380('0x34')](_0x575313);}return null;};}function patchUpdates(_0x44a418){return function(_0x57747f){try{jsonpatch[_0x5380('0x35')](_0x57747f,_0x44a418,!![]);}catch(_0x34b39e){return BPromise[_0x5380('0x36')](_0x34b39e);}return _0x57747f[_0x5380('0x37')]();};}function saveUpdates(_0x23af6c,_0x4465ae){return function(_0x5311f7){if(_0x5311f7){return _0x5311f7[_0x5380('0x38')](_0x23af6c)[_0x5380('0x22')](function(_0x2c2394){return _0x2c2394;});}return null;};}function removeEntity(_0x526e2e,_0x30c44a){return function(_0xb7d31d){if(_0xb7d31d){return _0xb7d31d[_0x5380('0x39')]()['then'](function(){_0x526e2e['status'](0xcc)[_0x5380('0x2c')]();});}};}function handleEntityNotFound(_0x86370c,_0x7e3669){return function(_0x4d435b){if(!_0x4d435b){_0x86370c[_0x5380('0x3a')](0x194);}return _0x4d435b;};}function handleError(_0x8babc0,_0x483050){_0x483050=_0x483050||0x1f4;return function(_0x556ec3){logger[_0x5380('0x26')](_0x556ec3[_0x5380('0x3b')]);if(_0x556ec3['name']){delete _0x556ec3['name'];}_0x8babc0[_0x5380('0x31')](_0x483050)[_0x5380('0x3c')](_0x556ec3);};}exports[_0x5380('0x3d')]=function(_0x872b92,_0x2e27eb){var _0x550a8a={},_0x25e7f2={},_0x239cd9={'count':0x0,'rows':[]};var _0x10a48f=_['map'](db['OpenchannelMessage'][_0x5380('0x3e')],function(_0x215310){return{'name':_0x215310[_0x5380('0x3f')],'type':_0x215310[_0x5380('0x40')]['key']};});_0x25e7f2[_0x5380('0x41')]=_[_0x5380('0x42')](_0x10a48f,'name');_0x25e7f2[_0x5380('0x43')]=_[_0x5380('0x44')](_0x872b92['query']);_0x25e7f2[_0x5380('0x45')]=_[_0x5380('0x46')](_0x25e7f2['model'],_0x25e7f2[_0x5380('0x43')]);_0x550a8a[_0x5380('0x47')]=_[_0x5380('0x46')](_0x25e7f2[_0x5380('0x41')],qs[_0x5380('0x48')](_0x872b92[_0x5380('0x43')][_0x5380('0x48')]));_0x550a8a[_0x5380('0x47')]=_0x550a8a[_0x5380('0x47')][_0x5380('0x49')]?_0x550a8a[_0x5380('0x47')]:_0x25e7f2['model'];if(!_0x872b92[_0x5380('0x43')][_0x5380('0x4a')](_0x5380('0x4b'))){_0x550a8a[_0x5380('0x2f')]=qs['limit'](_0x872b92[_0x5380('0x43')][_0x5380('0x2f')]);_0x550a8a['offset']=qs[_0x5380('0x2d')](_0x872b92[_0x5380('0x43')][_0x5380('0x2d')]);}_0x550a8a['order']=qs[_0x5380('0x4c')](_0x872b92[_0x5380('0x43')][_0x5380('0x4c')]);_0x550a8a['where']=qs[_0x5380('0x45')](_[_0x5380('0x4d')](_0x872b92['query'],_0x25e7f2[_0x5380('0x45')]),_0x10a48f);if(_0x872b92[_0x5380('0x43')]['filter']){_0x550a8a[_0x5380('0x4e')]=_[_0x5380('0x4f')](_0x550a8a[_0x5380('0x4e')],{'$or':_[_0x5380('0x42')](_0x10a48f,function(_0x266ae9){if(_0x266ae9[_0x5380('0x40')]!==_0x5380('0x50')){var _0x2e5f08={};_0x2e5f08[_0x266ae9[_0x5380('0x51')]]={'$like':'%'+_0x872b92[_0x5380('0x43')][_0x5380('0x52')]+'%'};return _0x2e5f08;}})});}_0x550a8a=_['merge']({},_0x550a8a,_0x872b92[_0x5380('0x53')]);var _0x1ea83a={'where':_0x550a8a[_0x5380('0x4e')]};return db[_0x5380('0x54')][_0x5380('0x30')](_0x1ea83a)[_0x5380('0x22')](function(_0x530746){_0x239cd9[_0x5380('0x30')]=_0x530746;if(_0x872b92[_0x5380('0x43')][_0x5380('0x55')]){_0x550a8a[_0x5380('0x56')]=[{'all':!![]}];}return db[_0x5380('0x54')][_0x5380('0x57')](_0x550a8a);})[_0x5380('0x22')](function(_0x52d3e8){_0x239cd9[_0x5380('0x58')]=_0x52d3e8;return _0x239cd9;})[_0x5380('0x22')](respondWithFilteredResult(_0x2e27eb,_0x550a8a))[_0x5380('0x2b')](handleError(_0x2e27eb,null));};exports['show']=function(_0x1473bb,_0x40aa3d){var _0x5d7559={'raw':!![],'where':{'id':_0x1473bb[_0x5380('0x59')]['id']}},_0x3df54e={};_0x3df54e[_0x5380('0x41')]=_['keys'](db[_0x5380('0x54')]['rawAttributes']);_0x3df54e[_0x5380('0x43')]=_[_0x5380('0x44')](_0x1473bb[_0x5380('0x43')]);_0x3df54e[_0x5380('0x45')]=_[_0x5380('0x46')](_0x3df54e[_0x5380('0x41')],_0x3df54e[_0x5380('0x43')]);_0x5d7559[_0x5380('0x47')]=_[_0x5380('0x46')](_0x3df54e['model'],qs[_0x5380('0x48')](_0x1473bb[_0x5380('0x43')]['fields']));_0x5d7559[_0x5380('0x47')]=_0x5d7559['attributes'][_0x5380('0x49')]?_0x5d7559[_0x5380('0x47')]:_0x3df54e[_0x5380('0x41')];if(_0x1473bb[_0x5380('0x43')][_0x5380('0x55')]){_0x5d7559[_0x5380('0x56')]=[{'all':!![]}];}_0x5d7559=_[_0x5380('0x4f')]({},_0x5d7559,_0x1473bb[_0x5380('0x53')]);return db[_0x5380('0x54')][_0x5380('0x5a')](_0x5d7559)[_0x5380('0x22')](handleEntityNotFound(_0x40aa3d,null))[_0x5380('0x22')](respondWithResult(_0x40aa3d,null))[_0x5380('0x2b')](handleError(_0x40aa3d,null));};exports[_0x5380('0x5b')]=function(_0x338501,_0x20c6c2){return db['OpenchannelMessage'][_0x5380('0x5b')](_0x338501[_0x5380('0x5c')],{})[_0x5380('0x22')](respondWithResult(_0x20c6c2,0xc9))[_0x5380('0x2b')](handleError(_0x20c6c2,null));};exports['update']=function(_0x3dedd5,_0x1cb578){if(_0x3dedd5['body']['id']){delete _0x3dedd5[_0x5380('0x5c')]['id'];}return db[_0x5380('0x54')]['find']({'where':{'id':_0x3dedd5['params']['id']}})[_0x5380('0x22')](handleEntityNotFound(_0x1cb578,null))[_0x5380('0x22')](saveUpdates(_0x3dedd5[_0x5380('0x5c')],null))[_0x5380('0x22')](respondWithResult(_0x1cb578,null))['catch'](handleError(_0x1cb578,null));};exports[_0x5380('0x39')]=function(_0x4118ec,_0x4f2281){return db['OpenchannelMessage']['find']({'where':{'id':_0x4118ec[_0x5380('0x59')]['id']}})[_0x5380('0x22')](handleEntityNotFound(_0x4f2281,null))[_0x5380('0x22')](removeEntity(_0x4f2281,null))[_0x5380('0x2b')](handleError(_0x4f2281,null));};exports[_0x5380('0x5d')]=function(_0x27863f,_0x46b94d){return db['OpenchannelMessage'][_0x5380('0x5d')]()[_0x5380('0x22')](respondWithResult(_0x46b94d,null))[_0x5380('0x2b')](handleError(_0x46b94d,null));};var interaction_log=require(_0x5380('0x17'))(_0x5380('0x5e'));exports[_0x5380('0x5f')]=function(_0x341769,_0x4d8e62,_0x1d560f){var _0xf81b76={'agent':{},'channel':_0x5380('0x60')};if(_0x341769['body']['id']){delete _0x341769[_0x5380('0x5c')]['id'];}_0x341769[_0x5380('0x5c')][_0x5380('0x61')]=!![];_0x341769[_0x5380('0x5c')][_0x5380('0x62')]=moment()[_0x5380('0x63')](_0x5380('0x64'));_0x341769[_0x5380('0x5c')][_0x5380('0x65')]=_0x341769[_0x5380('0x5c')]['UserId']||_0x341769[_0x5380('0x66')]['id'];_0xf81b76[_0x5380('0x67')]['id']=_0x341769[_0x5380('0x5c')][_0x5380('0x65')];return db[_0x5380('0x54')][_0x5380('0x5a')]({'where':{'id':_0x341769['params']['id'],'UserId':null}})[_0x5380('0x22')](handleEntityNotFound(_0x4d8e62,null))[_0x5380('0x22')](saveUpdates(_0x341769[_0x5380('0x5c')],null))[_0x5380('0x22')](function(_0x15ddc3){if(_0x15ddc3){_0xf81b76['message']=_0x15ddc3[_0x5380('0x68')]({'plain':!![]});return db[_0x5380('0x69')][_0x5380('0x5a')]({'where':{'id':_0x15ddc3['OpenchannelInteractionId']}});}return null;})[_0x5380('0x22')](handleEntityNotFound(_0x4d8e62,null))[_0x5380('0x22')](function(_0x170374){if(_0x170374){return _0x170374[_0x5380('0x38')]({'UserId':_0x341769[_0x5380('0x5c')][_0x5380('0x65')],'read1stAt':_[_0x5380('0x6a')](_0x170374[_0x5380('0x6b')])?moment()[_0x5380('0x63')](_0x5380('0x64')):undefined});}return null;})[_0x5380('0x22')](function(_0x38dab1){if(_0x38dab1){_0xf81b76[_0x5380('0x6c')]=_0x38dab1[_0x5380('0x68')]({'plain':!![]});interaction_log[_0x5380('0x23')](_0x5380('0x6d'),_0x341769[_0x5380('0x66')]['id'],_0x341769['user'][_0x5380('0x51')],_0x341769[_0x5380('0x66')][_0x5380('0x6e')],_0xf81b76[_0x5380('0x6c')]['id'],_0x341769[_0x5380('0x5c')]?JSON[_0x5380('0x6f')](_0x341769['body']):_0x5380('0x70'));return respondWithRpcPromise('AcceptMessage',_0x5380('0x71'),_0xf81b76);}return null;})[_0x5380('0x22')](function(_0x51fa89){var _0x3d7124=_0x5380('0x72')+_0x51fa89[_0x5380('0x29')][_0x5380('0x73')];return db[_0x5380('0x74')][_0x5380('0x43')](_0x3d7124,{'type':db[_0x5380('0x75')][_0x5380('0x76')][_0x5380('0x77')],'raw':!![]})[_0x5380('0x22')](function(_0x20cd19){return _0x20cd19;});})[_0x5380('0x22')](function(_0x270c5e){if(_0x270c5e){_0xf81b76[_0x5380('0x29')][_0x5380('0x78')]=_0x270c5e[0x0];if(!_0x341769[_0x5380('0x5c')][_0x5380('0x65')])return;return db['User']['find']({'where':{'id':_0x341769[_0x5380('0x5c')][_0x5380('0x65')],'role':_0x5380('0x67')},'attributes':['id',_0x5380('0x51'),_0x5380('0x79'),_0x5380('0x7a'),'internal'],'raw':!![]});}return null;})[_0x5380('0x22')](function(_0x541460){if(!_0x541460)return null;_0xf81b76[_0x5380('0x29')]['agent']=_0x541460;return _0xf81b76;})[_0x5380('0x22')](function(_0x1eec3a){if(_0x1eec3a){if(_0x341769['body']['manual']){_0xf81b76[_0x5380('0x29')][_0x5380('0x7b')]=util[_0x5380('0x63')](_0x5380('0x7c'),_0x341769[_0x5380('0x66')][_0x5380('0x51')]);_0xf81b76[_0x5380('0x29')]['channel']=_0xf81b76[_0x5380('0x7d')];_0xf81b76[_0x5380('0x29')][_0x5380('0x7e')]=_0xf81b76[_0x5380('0x7d')];_0xf81b76[_0x5380('0x29')][_0x5380('0x7f')]=_0x5380('0x5f');return respondWithRpcPromise(_0x5380('0x80'),'EventManager',{'event':_0x5380('0x81'),'message':_0xf81b76[_0x5380('0x29')]},client9002)[_0x5380('0x22')](function(){return _0xf81b76;});}return _0xf81b76;}return null;})[_0x5380('0x22')](respondWithResult(_0x4d8e62,null))[_0x5380('0x2b')](handleError(_0x4d8e62,null));};var interaction_log=require(_0x5380('0x17'))('openchannel-interactions');exports[_0x5380('0x36')]=function(_0x427d8d,_0x1f357c,_0x1cec1c){var _0xe4b04d={'agent':{},'channel':_0x5380('0x60')};if(_0x427d8d[_0x5380('0x5c')]['id']){delete _0x427d8d[_0x5380('0x5c')]['id'];}_0x427d8d[_0x5380('0x5c')][_0x5380('0x65')]=_0x427d8d[_0x5380('0x5c')][_0x5380('0x65')]||_0x427d8d['user']['id'];_0xe4b04d['agent']['id']=_0x427d8d[_0x5380('0x5c')][_0x5380('0x65')];return db['OpenchannelMessage'][_0x5380('0x5a')]({'where':{'id':_0x427d8d[_0x5380('0x59')]['id'],'UserId':null}})[_0x5380('0x22')](handleEntityNotFound(_0x1f357c,null))[_0x5380('0x22')](function(_0x5c885f){if(_0x5c885f){_0xe4b04d[_0x5380('0x29')]=_0x5c885f[_0x5380('0x68')]({'plain':!![]});return db[_0x5380('0x69')][_0x5380('0x5a')]({'where':{'id':_0x5c885f[_0x5380('0x82')]}});}return null;})[_0x5380('0x22')](handleEntityNotFound(_0x1f357c,null))[_0x5380('0x22')](function(_0x2ea711){if(_0x2ea711){_0xe4b04d[_0x5380('0x6c')]=_0x2ea711['get']({'plain':!![]});interaction_log[_0x5380('0x23')](_0x5380('0x83'),_0x427d8d[_0x5380('0x66')]['id'],_0x427d8d['user']['name'],_0x427d8d[_0x5380('0x66')]['role'],_0xe4b04d['interaction']['id'],_0x427d8d[_0x5380('0x5c')]?JSON['stringify'](_0x427d8d['body']):_0x5380('0x70'));return respondWithRpcPromise(_0x5380('0x84'),_0x5380('0x85'),_0xe4b04d);}return null;})[_0x5380('0x22')](function(_0x3110fa){var _0x328908=_0x5380('0x72')+_0x3110fa['message'][_0x5380('0x73')];return db[_0x5380('0x74')][_0x5380('0x43')](_0x328908,{'type':db[_0x5380('0x75')][_0x5380('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x108ebf){return _0x108ebf;});})['then'](function(_0x167652){if(_0x167652){_0xe4b04d[_0x5380('0x29')]['contact']=_0x167652[0x0];if(!_0x427d8d[_0x5380('0x5c')][_0x5380('0x65')])return;return db['User'][_0x5380('0x5a')]({'where':{'id':_0x427d8d[_0x5380('0x5c')]['UserId'],'role':'agent'},'attributes':['id',_0x5380('0x51'),'fullname',_0x5380('0x7a'),'internal'],'raw':!![]});}return null;})[_0x5380('0x22')](function(_0x5a19dc){if(!_0x5a19dc)return null;_0xe4b04d[_0x5380('0x29')][_0x5380('0x67')]=_0x5a19dc;return _0xe4b04d;})[_0x5380('0x22')](function(_0xb63c58){if(_0xb63c58){_0xb63c58['message'][_0x5380('0x7b')]=util[_0x5380('0x63')](_0x5380('0x7c'),_0x427d8d[_0x5380('0x66')]['name']);_0xb63c58[_0x5380('0x29')][_0x5380('0x7d')]=_0xe4b04d[_0x5380('0x7d')];_0xb63c58[_0x5380('0x29')]['motionChannel']=_0xe4b04d[_0x5380('0x7d')];_0xb63c58[_0x5380('0x29')][_0x5380('0x7f')]=_0x5380('0x36');respondWithRpcPromise(_0x5380('0x80'),'EventManager',{'event':_0x5380('0x86'),'message':_0xb63c58[_0x5380('0x29')]},client9002);return _0xe4b04d;}return null;})['then'](respondWithResult(_0x1f357c,null))[_0x5380('0x2b')](handleError(_0x1f357c,null));}; \ No newline at end of file +var _0xbe25=['message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','then','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','format','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','SELECT','fullname','rejectmessage','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x558f21,_0x435de6){var _0xc75c6a=function(_0x35918a){while(--_0x35918a){_0x558f21['push'](_0x558f21['shift']());}};_0xc75c6a(++_0x435de6);}(_0xbe25,0x1c9));var _0x5be2=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbe25[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0x5be2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5be2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5be2('0x2'));var moment=require(_0x5be2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5be2('0x4'));var util=require(_0x5be2('0x5'));var path=require(_0x5be2('0x6'));var sox=require(_0x5be2('0x7'));var csv=require(_0x5be2('0x8'));var ejs=require(_0x5be2('0x9'));var fs=require('fs');var fs_extra=require(_0x5be2('0xa'));var _=require(_0x5be2('0xb'));var squel=require('squel');var crypto=require(_0x5be2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5be2('0xd'));var toCsv=require(_0x5be2('0x8'));var querystring=require('querystring');var Papa=require(_0x5be2('0xe'));var Redis=require('ioredis');var authService=require(_0x5be2('0xf'));var qs=require(_0x5be2('0x10'));var as=require(_0x5be2('0x11'));var hardwareService=require(_0x5be2('0x12'));var logger=require(_0x5be2('0x13'))(_0x5be2('0x14'));var utils=require(_0x5be2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5be2('0x16')]=_[_0x5be2('0x17')](config[_0x5be2('0x16')],{'host':_0x5be2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5be2('0x16')]));require(_0x5be2('0x19'))[_0x5be2('0x1a')](socket);var jayson=require(_0x5be2('0x1b'));var client=jayson[_0x5be2('0x1c')][_0x5be2('0x1d')]({'port':0x232c});var client9002=jayson[_0x5be2('0x1c')][_0x5be2('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xe999fb,_0x35373e,_0x2b353b,_0x3c7be6){return new BPromise(function(_0x4aaa35,_0x42c029){var _0x16dcbb=_0x3c7be6||client;return _0x16dcbb[_0x5be2('0x1e')](_0xe999fb,_0x2b353b)['then'](function(_0x3268db){logger[_0x5be2('0x1f')](_0x5be2('0x20'),_0x35373e,'request\x20sent');logger[_0x5be2('0x21')](_0x5be2('0x22'),_0x35373e,_0x5be2('0x23'),JSON[_0x5be2('0x24')](_0x3268db));if(_0x3268db['error']){if(_0x3268db[_0x5be2('0x25')][_0x5be2('0x26')]===0x1f4){logger[_0x5be2('0x25')](_0x5be2('0x20'),_0x35373e,_0x3268db[_0x5be2('0x25')][_0x5be2('0x27')]);return _0x42c029(_0x3268db['error'][_0x5be2('0x27')]);}logger[_0x5be2('0x25')](_0x5be2('0x20'),_0x35373e,_0x3268db[_0x5be2('0x25')][_0x5be2('0x27')]);return _0x4aaa35(_0x3268db[_0x5be2('0x25')][_0x5be2('0x27')]);}else{logger[_0x5be2('0x1f')](_0x5be2('0x20'),_0x35373e,_0x5be2('0x23'));_0x4aaa35(_0x3268db[_0x5be2('0x28')][_0x5be2('0x27')]);}})[_0x5be2('0x29')](function(_0x3c9fd9){logger[_0x5be2('0x25')](_0x5be2('0x20'),_0x35373e,_0x3c9fd9);_0x42c029(_0x3c9fd9);});});}function respondWithStatusCode(_0xf2f283,_0x1e04a5){_0x1e04a5=_0x1e04a5||0xcc;return function(_0x303d15){if(_0x303d15){return _0xf2f283[_0x5be2('0x2a')](_0x1e04a5);}return _0xf2f283[_0x5be2('0x2b')](_0x1e04a5)[_0x5be2('0x2c')]();};}function respondWithResult(_0x4d92b7,_0x5428d1){_0x5428d1=_0x5428d1||0xc8;return function(_0x3c1ad7){if(_0x3c1ad7){return _0x4d92b7[_0x5be2('0x2b')](_0x5428d1)[_0x5be2('0x2d')](_0x3c1ad7);}};}function respondWithFilteredResult(_0x50c149,_0x39f099){return function(_0x34592b){if(_0x34592b){var _0x374215=typeof _0x39f099[_0x5be2('0x2e')]===_0x5be2('0x2f')&&typeof _0x39f099[_0x5be2('0x30')]===_0x5be2('0x2f');var _0x462b71=_0x34592b[_0x5be2('0x31')];var _0x4518a3=_0x374215?0x0:_0x39f099[_0x5be2('0x2e')];var _0x3bd8d0=_0x374215?_0x34592b[_0x5be2('0x31')]:_0x39f099[_0x5be2('0x2e')]+_0x39f099[_0x5be2('0x30')];var _0x1ce6d4;if(_0x3bd8d0>=_0x462b71){_0x3bd8d0=_0x462b71;_0x1ce6d4=0xc8;}else{_0x1ce6d4=0xce;}_0x50c149['status'](_0x1ce6d4);return _0x50c149['set']('Content-Range',_0x4518a3+'-'+_0x3bd8d0+'/'+_0x462b71)[_0x5be2('0x2d')](_0x34592b);}return null;};}function patchUpdates(_0x3e2494){return function(_0x2889d){try{jsonpatch[_0x5be2('0x32')](_0x2889d,_0x3e2494,!![]);}catch(_0x3660f2){return BPromise[_0x5be2('0x33')](_0x3660f2);}return _0x2889d['save']();};}function saveUpdates(_0x38c7a6,_0x32eb23){return function(_0x377e75){if(_0x377e75){return _0x377e75['update'](_0x38c7a6)[_0x5be2('0x34')](function(_0x4893f7){return _0x4893f7;});}return null;};}function removeEntity(_0x439561,_0x2232b4){return function(_0x3e0297){if(_0x3e0297){return _0x3e0297['destroy']()[_0x5be2('0x34')](function(){_0x439561['status'](0xcc)[_0x5be2('0x2c')]();});}};}function handleEntityNotFound(_0x3d3d40,_0xf837b6){return function(_0x127cea){if(!_0x127cea){_0x3d3d40['sendStatus'](0x194);}return _0x127cea;};}function handleError(_0x27446d,_0x477e6b){_0x477e6b=_0x477e6b||0x1f4;return function(_0x43b046){logger[_0x5be2('0x25')](_0x43b046['stack']);if(_0x43b046['name']){delete _0x43b046[_0x5be2('0x35')];}_0x27446d[_0x5be2('0x2b')](_0x477e6b)['send'](_0x43b046);};}exports[_0x5be2('0x36')]=function(_0x103955,_0x678d){var _0x5cfb8a={},_0x28daa5={},_0x475503={'count':0x0,'rows':[]};var _0x57c9f8=_[_0x5be2('0x37')](db['OpenchannelMessage'][_0x5be2('0x38')],function(_0x415ea3){return{'name':_0x415ea3[_0x5be2('0x39')],'type':_0x415ea3[_0x5be2('0x3a')]['key']};});_0x28daa5['model']=_[_0x5be2('0x37')](_0x57c9f8,_0x5be2('0x35'));_0x28daa5[_0x5be2('0x3b')]=_['keys'](_0x103955['query']);_0x28daa5[_0x5be2('0x3c')]=_[_0x5be2('0x3d')](_0x28daa5['model'],_0x28daa5['query']);_0x5cfb8a[_0x5be2('0x3e')]=_[_0x5be2('0x3d')](_0x28daa5[_0x5be2('0x3f')],qs[_0x5be2('0x40')](_0x103955[_0x5be2('0x3b')][_0x5be2('0x40')]));_0x5cfb8a[_0x5be2('0x3e')]=_0x5cfb8a[_0x5be2('0x3e')][_0x5be2('0x41')]?_0x5cfb8a['attributes']:_0x28daa5[_0x5be2('0x3f')];if(!_0x103955[_0x5be2('0x3b')]['hasOwnProperty'](_0x5be2('0x42'))){_0x5cfb8a[_0x5be2('0x30')]=qs[_0x5be2('0x30')](_0x103955[_0x5be2('0x3b')][_0x5be2('0x30')]);_0x5cfb8a[_0x5be2('0x2e')]=qs[_0x5be2('0x2e')](_0x103955['query'][_0x5be2('0x2e')]);}_0x5cfb8a[_0x5be2('0x43')]=qs[_0x5be2('0x44')](_0x103955[_0x5be2('0x3b')][_0x5be2('0x44')]);_0x5cfb8a[_0x5be2('0x45')]=qs['filters'](_[_0x5be2('0x46')](_0x103955[_0x5be2('0x3b')],_0x28daa5[_0x5be2('0x3c')]),_0x57c9f8);if(_0x103955[_0x5be2('0x3b')][_0x5be2('0x47')]){_0x5cfb8a['where']=_[_0x5be2('0x48')](_0x5cfb8a[_0x5be2('0x45')],{'$or':_[_0x5be2('0x37')](_0x57c9f8,function(_0x8899d2){if(_0x8899d2[_0x5be2('0x3a')]!=='VIRTUAL'){var _0x7e5ef3={};_0x7e5ef3[_0x8899d2['name']]={'$like':'%'+_0x103955[_0x5be2('0x3b')][_0x5be2('0x47')]+'%'};return _0x7e5ef3;}})});}_0x5cfb8a=_[_0x5be2('0x48')]({},_0x5cfb8a,_0x103955[_0x5be2('0x49')]);var _0x3ba85e={'where':_0x5cfb8a[_0x5be2('0x45')]};return db[_0x5be2('0x4a')]['count'](_0x3ba85e)['then'](function(_0x402c7d){_0x475503[_0x5be2('0x31')]=_0x402c7d;if(_0x103955['query'][_0x5be2('0x4b')]){_0x5cfb8a[_0x5be2('0x4c')]=[{'all':!![]}];}return db[_0x5be2('0x4a')][_0x5be2('0x4d')](_0x5cfb8a);})['then'](function(_0x45df44){_0x475503[_0x5be2('0x4e')]=_0x45df44;return _0x475503;})['then'](respondWithFilteredResult(_0x678d,_0x5cfb8a))['catch'](handleError(_0x678d,null));};exports[_0x5be2('0x4f')]=function(_0x13d0eb,_0x58aff4){var _0x14e3f0={'raw':!![],'where':{'id':_0x13d0eb[_0x5be2('0x50')]['id']}},_0x1471bd={};_0x1471bd[_0x5be2('0x3f')]=_[_0x5be2('0x51')](db[_0x5be2('0x4a')][_0x5be2('0x38')]);_0x1471bd['query']=_[_0x5be2('0x51')](_0x13d0eb[_0x5be2('0x3b')]);_0x1471bd['filters']=_[_0x5be2('0x3d')](_0x1471bd[_0x5be2('0x3f')],_0x1471bd['query']);_0x14e3f0['attributes']=_[_0x5be2('0x3d')](_0x1471bd[_0x5be2('0x3f')],qs[_0x5be2('0x40')](_0x13d0eb['query'][_0x5be2('0x40')]));_0x14e3f0[_0x5be2('0x3e')]=_0x14e3f0[_0x5be2('0x3e')]['length']?_0x14e3f0[_0x5be2('0x3e')]:_0x1471bd[_0x5be2('0x3f')];if(_0x13d0eb[_0x5be2('0x3b')][_0x5be2('0x4b')]){_0x14e3f0['include']=[{'all':!![]}];}_0x14e3f0=_[_0x5be2('0x48')]({},_0x14e3f0,_0x13d0eb[_0x5be2('0x49')]);return db[_0x5be2('0x4a')][_0x5be2('0x52')](_0x14e3f0)[_0x5be2('0x34')](handleEntityNotFound(_0x58aff4,null))[_0x5be2('0x34')](respondWithResult(_0x58aff4,null))['catch'](handleError(_0x58aff4,null));};exports[_0x5be2('0x53')]=function(_0x97431f,_0x1a82e1){return db[_0x5be2('0x4a')][_0x5be2('0x53')](_0x97431f[_0x5be2('0x54')],{})[_0x5be2('0x34')](respondWithResult(_0x1a82e1,0xc9))[_0x5be2('0x29')](handleError(_0x1a82e1,null));};exports['update']=function(_0x5b0bf0,_0x3c18ab){if(_0x5b0bf0['body']['id']){delete _0x5b0bf0[_0x5be2('0x54')]['id'];}return db[_0x5be2('0x4a')][_0x5be2('0x52')]({'where':{'id':_0x5b0bf0[_0x5be2('0x50')]['id']}})[_0x5be2('0x34')](handleEntityNotFound(_0x3c18ab,null))[_0x5be2('0x34')](saveUpdates(_0x5b0bf0[_0x5be2('0x54')],null))[_0x5be2('0x34')](respondWithResult(_0x3c18ab,null))['catch'](handleError(_0x3c18ab,null));};exports['destroy']=function(_0x21ce9f,_0x4b6926){return db[_0x5be2('0x4a')][_0x5be2('0x52')]({'where':{'id':_0x21ce9f[_0x5be2('0x50')]['id']}})[_0x5be2('0x34')](handleEntityNotFound(_0x4b6926,null))[_0x5be2('0x34')](removeEntity(_0x4b6926,null))['catch'](handleError(_0x4b6926,null));};exports[_0x5be2('0x55')]=function(_0x560424,_0x353f5b){return db['OpenchannelMessage'][_0x5be2('0x55')]()['then'](respondWithResult(_0x353f5b,null))[_0x5be2('0x29')](handleError(_0x353f5b,null));};var interaction_log=require(_0x5be2('0x13'))(_0x5be2('0x56'));exports[_0x5be2('0x57')]=function(_0x2a4306,_0x3ee435,_0x3b4d3c){var _0x565bb0={'agent':{},'channel':_0x5be2('0x58')};if(_0x2a4306[_0x5be2('0x54')]['id']){delete _0x2a4306[_0x5be2('0x54')]['id'];}_0x2a4306[_0x5be2('0x54')][_0x5be2('0x59')]=!![];_0x2a4306[_0x5be2('0x54')][_0x5be2('0x5a')]=moment()['format'](_0x5be2('0x5b'));_0x2a4306['body']['UserId']=_0x2a4306['body'][_0x5be2('0x5c')]||_0x2a4306[_0x5be2('0x5d')]['id'];_0x565bb0[_0x5be2('0x5e')]['id']=_0x2a4306['body']['UserId'];return db['OpenchannelMessage'][_0x5be2('0x52')]({'where':{'id':_0x2a4306[_0x5be2('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ee435,null))[_0x5be2('0x34')](saveUpdates(_0x2a4306[_0x5be2('0x54')],null))['then'](function(_0x186376){if(_0x186376){_0x565bb0[_0x5be2('0x27')]=_0x186376[_0x5be2('0x5f')]({'plain':!![]});return db[_0x5be2('0x60')]['find']({'where':{'id':_0x186376['OpenchannelInteractionId']}});}return null;})[_0x5be2('0x34')](handleEntityNotFound(_0x3ee435,null))[_0x5be2('0x34')](function(_0x789518){if(_0x789518){return _0x789518['update']({'UserId':_0x2a4306['body']['UserId'],'read1stAt':_[_0x5be2('0x61')](_0x789518[_0x5be2('0x62')])?moment()[_0x5be2('0x63')](_0x5be2('0x5b')):undefined});}return null;})['then'](function(_0x2b53e4){if(_0x2b53e4){_0x565bb0['interaction']=_0x2b53e4[_0x5be2('0x5f')]({'plain':!![]});interaction_log[_0x5be2('0x1f')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a4306['user']['id'],_0x2a4306[_0x5be2('0x5d')][_0x5be2('0x35')],_0x2a4306[_0x5be2('0x5d')]['role'],_0x565bb0[_0x5be2('0x64')]['id'],_0x2a4306[_0x5be2('0x54')]?JSON['stringify'](_0x2a4306[_0x5be2('0x54')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x565bb0);}return null;})['then'](function(_0x330cfa){var _0x4fe748=_0x5be2('0x65')+_0x330cfa[_0x5be2('0x27')][_0x5be2('0x66')];return db[_0x5be2('0x67')][_0x5be2('0x3b')](_0x4fe748,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5be2('0x34')](function(_0x104dca){return _0x104dca;});})[_0x5be2('0x34')](function(_0x42ff3f){if(_0x42ff3f){_0x565bb0['message'][_0x5be2('0x68')]=_0x42ff3f[0x0];if(!_0x2a4306[_0x5be2('0x54')]['UserId'])return;return db[_0x5be2('0x69')][_0x5be2('0x52')]({'where':{'id':_0x2a4306[_0x5be2('0x54')][_0x5be2('0x5c')],'role':_0x5be2('0x5e')},'attributes':['id',_0x5be2('0x35'),'fullname',_0x5be2('0x6a'),_0x5be2('0x6b')],'raw':!![]});}return null;})[_0x5be2('0x34')](function(_0x20dc8e){if(!_0x20dc8e)return null;_0x565bb0[_0x5be2('0x27')][_0x5be2('0x5e')]=_0x20dc8e;return _0x565bb0;})[_0x5be2('0x34')](function(_0x48eba3){if(_0x48eba3){if(_0x2a4306[_0x5be2('0x54')][_0x5be2('0x6c')]){_0x565bb0[_0x5be2('0x27')][_0x5be2('0x6d')]=util[_0x5be2('0x63')](_0x5be2('0x6e'),_0x2a4306[_0x5be2('0x5d')][_0x5be2('0x35')]);_0x565bb0[_0x5be2('0x27')][_0x5be2('0x6f')]=_0x565bb0[_0x5be2('0x6f')];_0x565bb0['message'][_0x5be2('0x70')]=_0x565bb0[_0x5be2('0x6f')];_0x565bb0[_0x5be2('0x27')][_0x5be2('0x71')]=_0x5be2('0x57');return respondWithRpcPromise(_0x5be2('0x72'),_0x5be2('0x72'),{'event':_0x5be2('0x73'),'message':_0x565bb0['message']},client9002)[_0x5be2('0x34')](function(){return _0x565bb0;});}return _0x565bb0;}return null;})[_0x5be2('0x34')](respondWithResult(_0x3ee435,null))['catch'](handleError(_0x3ee435,null));};var interaction_log=require(_0x5be2('0x13'))(_0x5be2('0x56'));exports[_0x5be2('0x33')]=function(_0x4ae50c,_0x5c79a9,_0x442744){var _0x274b7a={'agent':{},'channel':'openchannel'};if(_0x4ae50c[_0x5be2('0x54')]['id']){delete _0x4ae50c[_0x5be2('0x54')]['id'];}_0x4ae50c[_0x5be2('0x54')][_0x5be2('0x5c')]=_0x4ae50c[_0x5be2('0x54')][_0x5be2('0x5c')]||_0x4ae50c[_0x5be2('0x5d')]['id'];_0x274b7a[_0x5be2('0x5e')]['id']=_0x4ae50c[_0x5be2('0x54')][_0x5be2('0x5c')];return db[_0x5be2('0x4a')][_0x5be2('0x52')]({'where':{'id':_0x4ae50c[_0x5be2('0x50')]['id'],'UserId':null}})[_0x5be2('0x34')](handleEntityNotFound(_0x5c79a9,null))[_0x5be2('0x34')](function(_0x14c5a4){if(_0x14c5a4){_0x274b7a['message']=_0x14c5a4[_0x5be2('0x5f')]({'plain':!![]});return db[_0x5be2('0x60')][_0x5be2('0x52')]({'where':{'id':_0x14c5a4[_0x5be2('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x5c79a9,null))[_0x5be2('0x34')](function(_0xb8eed7){if(_0xb8eed7){_0x274b7a['interaction']=_0xb8eed7['get']({'plain':!![]});interaction_log['info'](_0x5be2('0x75'),_0x4ae50c['user']['id'],_0x4ae50c['user'][_0x5be2('0x35')],_0x4ae50c['user'][_0x5be2('0x76')],_0x274b7a['interaction']['id'],_0x4ae50c[_0x5be2('0x54')]?JSON[_0x5be2('0x24')](_0x4ae50c['body']):_0x5be2('0x77'));return respondWithRpcPromise('RejectMessage',_0x5be2('0x78'),_0x274b7a);}return null;})[_0x5be2('0x34')](function(_0x3310d){var _0x3045aa=_0x5be2('0x65')+_0x3310d['message'][_0x5be2('0x66')];return db[_0x5be2('0x67')][_0x5be2('0x3b')](_0x3045aa,{'type':db['Sequelize']['QueryTypes'][_0x5be2('0x79')],'raw':!![]})[_0x5be2('0x34')](function(_0x2264ed){return _0x2264ed;});})[_0x5be2('0x34')](function(_0x5d3e99){if(_0x5d3e99){_0x274b7a[_0x5be2('0x27')][_0x5be2('0x68')]=_0x5d3e99[0x0];if(!_0x4ae50c[_0x5be2('0x54')][_0x5be2('0x5c')])return;return db[_0x5be2('0x69')][_0x5be2('0x52')]({'where':{'id':_0x4ae50c[_0x5be2('0x54')][_0x5be2('0x5c')],'role':_0x5be2('0x5e')},'attributes':['id',_0x5be2('0x35'),_0x5be2('0x7a'),_0x5be2('0x6a'),_0x5be2('0x6b')],'raw':!![]});}return null;})[_0x5be2('0x34')](function(_0x4f37fa){if(!_0x4f37fa)return null;_0x274b7a[_0x5be2('0x27')][_0x5be2('0x5e')]=_0x4f37fa;return _0x274b7a;})[_0x5be2('0x34')](function(_0x5f37cb){if(_0x5f37cb){_0x5f37cb['message'][_0x5be2('0x6d')]=util[_0x5be2('0x63')]('SIP/%s',_0x4ae50c[_0x5be2('0x5d')][_0x5be2('0x35')]);_0x5f37cb[_0x5be2('0x27')][_0x5be2('0x6f')]=_0x274b7a[_0x5be2('0x6f')];_0x5f37cb['message']['motionChannel']=_0x274b7a[_0x5be2('0x6f')];_0x5f37cb['message'][_0x5be2('0x71')]='reject';respondWithRpcPromise(_0x5be2('0x72'),_0x5be2('0x72'),{'event':_0x5be2('0x7b'),'message':_0x5f37cb[_0x5be2('0x27')]},client9002);return _0x274b7a;}return null;})[_0x5be2('0x34')](respondWithResult(_0x5c79a9,null))[_0x5be2('0x29')](handleError(_0x5c79a9,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 127c5a8..aa9a1e5 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 _0x47c9=['save','update','remove','emit','hasOwnProperty','exports','events','OpenchannelMessage'];(function(_0x53153f,_0x5b9a80){var _0x381bc1=function(_0x4423dc){while(--_0x4423dc){_0x53153f['push'](_0x53153f['shift']());}};_0x381bc1(++_0x5b9a80);}(_0x47c9,0x1e6));var _0x947c=function(_0x257f58,_0x192df5){_0x257f58=_0x257f58-0x0;var _0x402d08=_0x47c9[_0x257f58];return _0x402d08;};'use strict';var EventEmitter=require(_0x947c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x947c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x947c('0x2'),'afterUpdate':_0x947c('0x3'),'afterDestroy':_0x947c('0x4')};function emitEvent(_0x23586f){return function(_0x214584,_0x36a079,_0x5c0119){OpenchannelMessageEvents[_0x947c('0x5')](_0x23586f+':'+_0x214584['id'],_0x214584);OpenchannelMessageEvents[_0x947c('0x5')](_0x23586f,_0x214584);_0x5c0119(null);};}for(var e in events){if(events[_0x947c('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x947c('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x6de1=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0x6de1,0x1a9));var _0x16de=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x6de1[_0x296809];return _0x18c0d3;};'use strict';var EventEmitter=require(_0x16de('0x0'));var OpenchannelMessage=require(_0x16de('0x1'))['db'][_0x16de('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x16de('0x3')](0x0);var events={'afterCreate':_0x16de('0x4'),'afterUpdate':_0x16de('0x5'),'afterDestroy':_0x16de('0x6')};function emitEvent(_0xee221d){return function(_0x2979d9,_0x4d8752,_0x3dbce2){OpenchannelMessageEvents[_0x16de('0x7')](_0xee221d+':'+_0x2979d9['id'],_0x2979d9);OpenchannelMessageEvents['emit'](_0xee221d,_0x2979d9);_0x3dbce2(null);};}for(var e in events){if(events[_0x16de('0x8')](e)){var event=events[e];OpenchannelMessage[_0x16de('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 6993d24..6b0fb2a 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 _0x4213=['describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch'];(function(_0x3be8b2,_0x26c3b4){var _0x47672e=function(_0x1633b6){while(--_0x1633b6){_0x3be8b2['push'](_0x3be8b2['shift']());}};_0x47672e(++_0x26c3b4);}(_0x4213,0x77));var _0x3421=function(_0x402565,_0x431efa){_0x402565=_0x402565-0x0;var _0x2ed987=_0x4213[_0x402565];return _0x2ed987;};'use strict';var _=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var logger=require(_0x3421('0x2'))(_0x3421('0x3'));var moment=require(_0x3421('0x4'));var BPromise=require(_0x3421('0x5'));var rp=require(_0x3421('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3421('0x7'));var config=require('../../config/environment');var attributes=require(_0x3421('0x8'));module[_0x3421('0x9')]=function(_0x2155f8,_0x2a04e0){return _0x2155f8['define'](_0x3421('0xa'),attributes,{'tableName':_0x3421('0xb'),'paranoid':![],'indexes':[{'name':_0x3421('0xc'),'fields':[_0x3421('0xd')],'type':_0x3421('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ddfce,_0x1f20cf,_0x58d511){var _0x4ff986=_0x2155f8[_0x3421('0xf')];var _0x4b9d24=_0x4ddfce[_0x3421('0x10')]({'plain':!![]});if(_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()==='in'||_0x4b9d24[_0x3421('0x11')][_0x3421('0x12')]()===_0x3421('0x13')&&!_0x4b9d24[_0x3421('0x14')]&&!_['isNil'](_0x4b9d24[_0x3421('0x15')])){_0x4ff986[_0x3421('0x16')][_0x3421('0x17')]({'where':{'id':_0x4b9d24[_0x3421('0x18')]}})[_0x3421('0x19')](function(_0x3f4672){if(_0x3f4672){_0x3f4672[_0x3421('0x1a')]({'lastMsgAt':_0x4b9d24['createdAt'],'lastMsgDirection':_0x4b9d24[_0x3421('0x11')]['toLowerCase']()});}})[_0x3421('0x1b')](function(_0x5257ad){console['error'](_0x5257ad);});}if(_0x4b9d24[_0x3421('0x11')]==='out'&&!_0x4b9d24[_0x3421('0x14')]){var _0x23694b;_0x4ff986['CmContact'][_0x3421('0x1c')]()[_0x3421('0x19')](function(_0x130d3c){return _0x4ff986[_0x3421('0x1d')][_0x3421('0x1e')]({'where':{'id':_0x4b9d24[_0x3421('0x1f')]},'include':[{'model':_0x4ff986[_0x3421('0x16')],'as':_0x3421('0x20'),'where':{'id':_0x4b9d24[_0x3421('0x18')]},'limit':0x1,'include':[{'model':_0x4ff986[_0x3421('0x21')],'as':_0x3421('0x22'),'attributes':_['keys'](_0x130d3c)}]}]});})[_0x3421('0x19')](function(_0x4b59a5){_0x23694b=_0x4b59a5['get']({'plain':!![]});if(_0x23694b&&_0x23694b['replyUri']){logger[_0x3421('0x23')](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x26')](_0x3421('0x27'),_0x4b9d24['id'],_0x23694b[_0x3421('0x28')]));if(_0x23694b[_0x3421('0x20')]&&_0x23694b[_0x3421('0x20')][_0x3421('0x29')]){_0x4b9d24[_0x3421('0x2a')]=_['omit'](_0x23694b['Interactions'][0x0],'Contact');_0x4b9d24[_0x3421('0x22')]=_0x23694b[_0x3421('0x20')][0x0][_0x3421('0x22')];}var _0x1f20cf={'method':'POST','uri':encodeURI(_0x23694b[_0x3421('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1f20cf['method']){case _0x3421('0x2b'):_0x1f20cf['qs']=_0x4b9d24;break;case'POST':_0x1f20cf[_0x3421('0xd')]=_0x4b9d24;break;}return rp(_0x1f20cf)[_0x3421('0x19')](function(_0x36d75f){logger[_0x3421('0x23')](_0x3421('0x24'),'afterCreate',util[_0x3421('0x26')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4b9d24['id'],_0x23694b['replyUri']));if(_0x36d75f[_0x3421('0xd')]['threadId']&&_0x36d75f['body'][_0x3421('0x2c')]!=_0x4b9d24['Interaction'][_0x3421('0x2c')]){return _0x4ff986['OpenchannelInteraction'][_0x3421('0x1a')]({'threadId':_0x36d75f[_0x3421('0xd')]['threadId']},{'logging':!![],'where':{'id':_0x4b9d24[_0x3421('0x2a')]['id']}});}else{return;}})[_0x3421('0x19')](function(){return _0x4ddfce[_0x3421('0x1a')]({'read':!![]});})['catch'](function(_0x3a89b6){logger['error'](_0x3421('0x24'),_0x3421('0x25'),util[_0x3421('0x2d')](_0x3a89b6,{'showHidden':![],'depth':null}));_0x58d511();});}else{_0x58d511();}})[_0x3421('0x2e')](function(){_0x58d511();});}else{_0x58d511();}}},'charset':_0x3421('0x2f'),'collate':_0x3421('0x30')});}; \ No newline at end of file +var _0x9354=['threadId','inspect','finally','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','Contact','POST','method','GET','body'];(function(_0x281562,_0x56179e){var _0x33698c=function(_0xfcc114){while(--_0xfcc114){_0x281562['push'](_0x281562['shift']());}};_0x33698c(++_0x56179e);}(_0x9354,0x96));var _0x4935=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x9354[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[{'name':_0x4935('0xc'),'fields':['body'],'type':_0x4935('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a44f,_0x2aac9a,_0x38de96){var _0xd5b117=_0x2d518a[_0x4935('0xe')];var _0x261462=_0x47a44f[_0x4935('0xf')]({'plain':!![]});if(_0x261462['direction']['toLowerCase']()==='in'||_0x261462[_0x4935('0x10')]['toLowerCase']()==='out'&&!_0x261462[_0x4935('0x11')]&&!_[_0x4935('0x12')](_0x261462[_0x4935('0x13')])){_0xd5b117[_0x4935('0x14')][_0x4935('0x15')]({'where':{'id':_0x261462[_0x4935('0x16')]}})[_0x4935('0x17')](function(_0x3a7c30){if(_0x3a7c30){_0x3a7c30[_0x4935('0x18')]({'lastMsgAt':_0x261462[_0x4935('0x19')],'lastMsgDirection':_0x261462[_0x4935('0x10')][_0x4935('0x1a')]()});}})[_0x4935('0x1b')](function(_0x3652c4){console[_0x4935('0x1c')](_0x3652c4);});}if(_0x261462[_0x4935('0x10')]==='out'&&!_0x261462[_0x4935('0x11')]){var _0x46526a;_0xd5b117[_0x4935('0x1d')][_0x4935('0x1e')]()[_0x4935('0x17')](function(_0x429ef3){return _0xd5b117['OpenchannelAccount'][_0x4935('0x1f')]({'where':{'id':_0x261462[_0x4935('0x20')]},'include':[{'model':_0xd5b117['OpenchannelInteraction'],'as':_0x4935('0x21'),'where':{'id':_0x261462[_0x4935('0x16')]},'limit':0x1,'include':[{'model':_0xd5b117[_0x4935('0x1d')],'as':'Contact','attributes':_['keys'](_0x429ef3)}]}]});})[_0x4935('0x17')](function(_0x6b849f){_0x46526a=_0x6b849f[_0x4935('0xf')]({'plain':!![]});if(_0x46526a&&_0x46526a[_0x4935('0x22')]){logger[_0x4935('0x23')](_0x4935('0x24'),_0x4935('0x25'),util[_0x4935('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x46526a[_0x4935('0x21')]&&_0x46526a[_0x4935('0x21')][_0x4935('0x27')]){_0x261462[_0x4935('0x28')]=_['omit'](_0x46526a['Interactions'][0x0],_0x4935('0x29'));_0x261462[_0x4935('0x29')]=_0x46526a[_0x4935('0x21')][0x0][_0x4935('0x29')];}var _0x2aac9a={'method':_0x4935('0x2a'),'uri':encodeURI(_0x46526a[_0x4935('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aac9a[_0x4935('0x2b')]){case _0x4935('0x2c'):_0x2aac9a['qs']=_0x261462;break;case _0x4935('0x2a'):_0x2aac9a[_0x4935('0x2d')]=_0x261462;break;}return rp(_0x2aac9a)[_0x4935('0x17')](function(_0x2c47ab){logger[_0x4935('0x23')](_0x4935('0x24'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x2c47ab[_0x4935('0x2d')]['threadId']&&_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]!=_0x261462[_0x4935('0x28')][_0x4935('0x2e')]){return _0xd5b117[_0x4935('0x14')][_0x4935('0x18')]({'threadId':_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]},{'logging':!![],'where':{'id':_0x261462['Interaction']['id']}});}else{return;}})[_0x4935('0x17')](function(){return _0x47a44f[_0x4935('0x18')]({'read':!![]});})['catch'](function(_0x48a289){logger[_0x4935('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x4935('0x25'),util[_0x4935('0x2f')](_0x48a289,{'showHidden':![],'depth':null}));_0x38de96();});}else{_0x38de96();}})[_0x4935('0x30')](function(){_0x38de96();});}else{_0x38de96();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ae48a64..ebd1efd 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x443f79,_0x33e446){var _0x3847e4=function(_0x42fa01){while(--_0x42fa01){_0x443f79['push'](_0x443f79['shift']());}};_0x3847e4(++_0x33e446);}(_0xdb28,0x106));var _0x8db2=function(_0x3027e8,_0x724cee){_0x3027e8=_0x3027e8-0x0;var _0x238609=_0xdb28[_0x3027e8];return _0x238609;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x335b77,_0x273122){var _0x27114a=function(_0x558285){while(--_0x558285){_0x335b77['push'](_0x335b77['shift']());}};_0x27114a(++_0x273122);}(_0xdb28,0x106));var _0x8db2=function(_0x1990f8,_0x3f3398){_0x1990f8=_0x1990f8-0x0;var _0x29e0c3=_0xdb28[_0x1990f8];return _0x29e0c3;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a0cab5c..ef78d7e 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 _0x2220=['remove','update','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save'];(function(_0x45c569,_0x255cd0){var _0x1cc195=function(_0x23248c){while(--_0x23248c){_0x45c569['push'](_0x45c569['shift']());}};_0x1cc195(++_0x255cd0);}(_0x2220,0x14e));var _0x0222=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2220[_0x5f0089];return _0x193892;};'use strict';var OpenchannelMessageEvents=require(_0x0222('0x0'));var events=[_0x0222('0x1'),_0x0222('0x2'),_0x0222('0x3')];function createListener(_0x2d16c1,_0x292cea){return function(_0x249a39){_0x292cea['emit'](_0x2d16c1,_0x249a39);};}function removeListener(_0x3fe1ab,_0x10d93d){return function(){OpenchannelMessageEvents[_0x0222('0x4')](_0x3fe1ab,_0x10d93d);};}exports[_0x0222('0x5')]=function(_0x39a320){for(var _0x47ae79=0x0,_0x2cf1d8=events[_0x0222('0x6')];_0x47ae79<_0x2cf1d8;_0x47ae79++){var _0x4e911b=events[_0x47ae79];var _0x33f1b9=createListener(_0x0222('0x7')+_0x4e911b,_0x39a320);OpenchannelMessageEvents['on'](_0x4e911b,_0x33f1b9);}}; \ No newline at end of file +var _0x3fe1=['remove','update','emit','removeListener','register','./openchannelMessage.events','save'];(function(_0x50efc6,_0x4d686e){var _0x9e1a58=function(_0x1b8213){while(--_0x1b8213){_0x50efc6['push'](_0x50efc6['shift']());}};_0x9e1a58(++_0x4d686e);}(_0x3fe1,0x19b));var _0x13fe=function(_0x1cd61f,_0x22e7af){_0x1cd61f=_0x1cd61f-0x0;var _0x27cee9=_0x3fe1[_0x1cd61f];return _0x27cee9;};'use strict';var OpenchannelMessageEvents=require(_0x13fe('0x0'));var events=[_0x13fe('0x1'),_0x13fe('0x2'),_0x13fe('0x3')];function createListener(_0x4c6c6b,_0xff09c8){return function(_0x4ff441){_0xff09c8[_0x13fe('0x4')](_0x4c6c6b,_0x4ff441);};}function removeListener(_0x40b575,_0x4510dd){return function(){OpenchannelMessageEvents[_0x13fe('0x5')](_0x40b575,_0x4510dd);};}exports[_0x13fe('0x6')]=function(_0x4c7d39){for(var _0x381740=0x0,_0x224e9b=events['length'];_0x381740<_0x224e9b;_0x381740++){var _0x597b1c=events[_0x381740];var _0x7d2df6=createListener('openchannelMessage:'+_0x597b1c,_0x4c7d39);OpenchannelMessageEvents['on'](_0x597b1c,_0x7d2df6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 041ac00..75ae47a 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 _0x7380=['get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','/describe','describe'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7380,0x1a5));var _0x0738=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x7380[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require(_0x0738('0x0'));var util=require(_0x0738('0x1'));var path=require(_0x0738('0x2'));var timeout=require('connect-timeout');var express=require(_0x0738('0x3'));var router=express[_0x0738('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0738('0x5'));var interaction=require(_0x0738('0x6'));var config=require(_0x0738('0x7'));var controller=require(_0x0738('0x8'));router['get']('/',auth[_0x0738('0x9')](),controller[_0x0738('0xa')]);router['get'](_0x0738('0xb'),auth[_0x0738('0x9')](),controller[_0x0738('0xc')]);router[_0x0738('0xd')](_0x0738('0xe'),auth['isAuthenticated'](),controller[_0x0738('0xf')]);router[_0x0738('0xd')](_0x0738('0x10'),auth[_0x0738('0x9')](),controller[_0x0738('0x11')]);router['get'](_0x0738('0x12'),auth[_0x0738('0x9')](),controller[_0x0738('0x13')]);router[_0x0738('0xd')](_0x0738('0x14'),auth['isAuthenticated'](),controller[_0x0738('0x15')]);router[_0x0738('0x16')]('/',auth[_0x0738('0x9')](),controller['create']);router[_0x0738('0x16')](_0x0738('0x12'),auth[_0x0738('0x9')](),controller['addTeams']);router[_0x0738('0x16')](_0x0738('0x14'),auth[_0x0738('0x9')](),controller[_0x0738('0x17')]);router[_0x0738('0x18')](_0x0738('0xe'),auth[_0x0738('0x9')](),controller[_0x0738('0x19')]);router[_0x0738('0x1a')]('/:id',auth[_0x0738('0x9')](),controller[_0x0738('0x1b')]);router[_0x0738('0x1a')]('/:id/teams',auth[_0x0738('0x9')](),controller[_0x0738('0x1c')]);router[_0x0738('0x1a')](_0x0738('0x14'),auth[_0x0738('0x9')](),controller[_0x0738('0x1d')]);module[_0x0738('0x1e')]=router; \ No newline at end of file +var _0x1de6=['/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','/:id','destroy','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./openchannelQueue.controller','isAuthenticated','get','/describe','show','/:id/members','getMembers'];(function(_0x93fa25,_0x7039e1){var _0x3e4876=function(_0x5a801f){while(--_0x5a801f){_0x93fa25['push'](_0x93fa25['shift']());}};_0x3e4876(++_0x7039e1);}(_0x1de6,0x143));var _0x61de=function(_0xef0ce4,_0x5c2cba){_0xef0ce4=_0xef0ce4-0x0;var _0x4193c3=_0x1de6[_0xef0ce4];return _0x4193c3;};'use strict';var multer=require(_0x61de('0x0'));var util=require(_0x61de('0x1'));var path=require(_0x61de('0x2'));var timeout=require(_0x61de('0x3'));var express=require(_0x61de('0x4'));var router=express[_0x61de('0x5')]();var fs_extra=require(_0x61de('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x61de('0x7'));var controller=require(_0x61de('0x8'));router['get']('/',auth[_0x61de('0x9')](),controller['index']);router[_0x61de('0xa')](_0x61de('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x61de('0xa')]('/:id',auth[_0x61de('0x9')](),controller[_0x61de('0xc')]);router[_0x61de('0xa')](_0x61de('0xd'),auth[_0x61de('0x9')](),controller[_0x61de('0xe')]);router[_0x61de('0xa')](_0x61de('0xf'),auth[_0x61de('0x9')](),controller[_0x61de('0x10')]);router[_0x61de('0xa')](_0x61de('0x11'),auth['isAuthenticated'](),controller[_0x61de('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x61de('0x13')]);router[_0x61de('0x14')](_0x61de('0xf'),auth[_0x61de('0x9')](),controller[_0x61de('0x15')]);router[_0x61de('0x14')](_0x61de('0x11'),auth[_0x61de('0x9')](),controller['addAgents']);router[_0x61de('0x16')]('/:id',auth[_0x61de('0x9')](),controller['update']);router['delete'](_0x61de('0x17'),auth[_0x61de('0x9')](),controller[_0x61de('0x18')]);router[_0x61de('0x19')](_0x61de('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x61de('0x19')]('/:id/users',auth[_0x61de('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 37ebc0e..d963b36 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 _0x0a6d=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','ENUM'];(function(_0x55d76f,_0x3ec4e8){var _0x27f726=function(_0x5ccf34){while(--_0x5ccf34){_0x55d76f['push'](_0x55d76f['shift']());}};_0x27f726(++_0x3ec4e8);}(_0x0a6d,0x65));var _0xd0a6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0a6d[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require(_0xd0a6('0x0'));module[_0xd0a6('0x1')]={'name':{'type':Sequelize[_0xd0a6('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd0a6('0x3')](_0xd0a6('0x4'),_0xd0a6('0x5'),_0xd0a6('0x6'))}}; \ No newline at end of file +var _0x76d3=['sequelize','exports','STRING','INTEGER','rrmemory','roundrobin'];(function(_0x1c166f,_0x829a61){var _0x245cf5=function(_0x1e6c6c){while(--_0x1e6c6c){_0x1c166f['push'](_0x1c166f['shift']());}};_0x245cf5(++_0x829a61);}(_0x76d3,0xc6));var _0x376d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x76d3[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x376d('0x0'));module[_0x376d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x376d('0x2')]},'timeout':{'type':Sequelize[_0x376d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x376d('0x4'),'beepall',_0x376d('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a914bef..7e3a4dc 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 _0x8ab7=['isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','undefined','offset','count','limit','set','json','apply','reject','save','then','destroy','get','OpenchannelQueues','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','OpenchannelQueue','findAll','rows','catch','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserOpenchannelQueue','hasOwnProperty','User','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','push','toString','QueryTypes','includes','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','ids','spread','emit','userOpenchannelQueue:save'];(function(_0x3bd0cb,_0x2df451){var _0x5a15ff=function(_0x1c3e50){while(--_0x1c3e50){_0x3bd0cb['push'](_0x3bd0cb['shift']());}};_0x5a15ff(++_0x2df451);}(_0x8ab7,0x88));var _0x78ab=function(_0x4bd01e,_0x50b5c6){_0x4bd01e=_0x4bd01e-0x0;var _0x361f19=_0x8ab7[_0x4bd01e];return _0x361f19;};'use strict';var emlformat=require(_0x78ab('0x0'));var rimraf=require(_0x78ab('0x1'));var zipdir=require(_0x78ab('0x2'));var jsonpatch=require(_0x78ab('0x3'));var rp=require(_0x78ab('0x4'));var moment=require(_0x78ab('0x5'));var BPromise=require(_0x78ab('0x6'));var Mustache=require(_0x78ab('0x7'));var util=require('util');var path=require(_0x78ab('0x8'));var sox=require('sox');var csv=require(_0x78ab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78ab('0xa'));var _=require('lodash');var squel=require(_0x78ab('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x78ab('0xc'));var toCsv=require(_0x78ab('0x9'));var querystring=require('querystring');var Papa=require(_0x78ab('0xd'));var Redis=require(_0x78ab('0xe'));var authService=require(_0x78ab('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x78ab('0x10'));var hardwareService=require(_0x78ab('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x78ab('0x12'));var db=require(_0x78ab('0x13'))['db'];config[_0x78ab('0x14')]=_[_0x78ab('0x15')](config[_0x78ab('0x14')],{'host':_0x78ab('0x16'),'port':0x18eb});var socket=require(_0x78ab('0x17'))(new Redis(config[_0x78ab('0x14')]));require(_0x78ab('0x18'))[_0x78ab('0x19')](socket);function respondWithStatusCode(_0x374491,_0x3bcfcc){_0x3bcfcc=_0x3bcfcc||0xcc;return function(_0x25eeb0){if(_0x25eeb0){return _0x374491[_0x78ab('0x1a')](_0x3bcfcc);}return _0x374491[_0x78ab('0x1b')](_0x3bcfcc)[_0x78ab('0x1c')]();};}function respondWithResult(_0x5200b5,_0x3c3056){_0x3c3056=_0x3c3056||0xc8;return function(_0x2668d7){if(_0x2668d7){return _0x5200b5['status'](_0x3c3056)['json'](_0x2668d7);}};}function respondWithFilteredResult(_0x45af2c,_0x5da3d1){return function(_0x7c6c39){if(_0x7c6c39){var _0x35e35c=typeof _0x5da3d1['offset']===_0x78ab('0x1d')&&typeof _0x5da3d1['limit']===_0x78ab('0x1d');var _0xacdf6=_0x7c6c39['count'];var _0xd25965=_0x35e35c?0x0:_0x5da3d1[_0x78ab('0x1e')];var _0x6fbcbe=_0x35e35c?_0x7c6c39[_0x78ab('0x1f')]:_0x5da3d1[_0x78ab('0x1e')]+_0x5da3d1[_0x78ab('0x20')];var _0x6944ed;if(_0x6fbcbe>=_0xacdf6){_0x6fbcbe=_0xacdf6;_0x6944ed=0xc8;}else{_0x6944ed=0xce;}_0x45af2c[_0x78ab('0x1b')](_0x6944ed);return _0x45af2c[_0x78ab('0x21')]('Content-Range',_0xd25965+'-'+_0x6fbcbe+'/'+_0xacdf6)[_0x78ab('0x22')](_0x7c6c39);}return null;};}function patchUpdates(_0xefd474){return function(_0x265c30){try{jsonpatch[_0x78ab('0x23')](_0x265c30,_0xefd474,!![]);}catch(_0x5d4567){return BPromise[_0x78ab('0x24')](_0x5d4567);}return _0x265c30[_0x78ab('0x25')]();};}function saveUpdates(_0x3f8cf3,_0xf83ea8){return function(_0x236578){if(_0x236578){return _0x236578['update'](_0x3f8cf3)[_0x78ab('0x26')](function(_0x1829bd){return _0x1829bd;});}return null;};}function removeEntity(_0x10fc27,_0x367af4){return function(_0x3a3fc2){if(_0x3a3fc2){return _0x3a3fc2[_0x78ab('0x27')]()[_0x78ab('0x26')](function(){var _0x20ef52=_0x3a3fc2[_0x78ab('0x28')]({'plain':!![]});var _0x3bd7a3=_0x78ab('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x3bd7a3,'resourceId':_0x20ef52['id']}})['then'](function(){return _0x3a3fc2;});})[_0x78ab('0x26')](function(){_0x10fc27[_0x78ab('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x349036,_0x24762e){return function(_0x3d1f99){if(!_0x3d1f99){_0x349036['sendStatus'](0x194);}return _0x3d1f99;};}function handleError(_0x399720,_0x4c1e0d){_0x4c1e0d=_0x4c1e0d||0x1f4;return function(_0x57becc){logger[_0x78ab('0x2a')](_0x57becc[_0x78ab('0x2b')]);if(_0x57becc[_0x78ab('0x2c')]){delete _0x57becc[_0x78ab('0x2c')];}_0x399720[_0x78ab('0x1b')](_0x4c1e0d)[_0x78ab('0x2d')](_0x57becc);};}exports['index']=function(_0xca292f,_0x16ec7c){var _0x5d99a7={},_0x105af1={},_0x1e1fdc={'count':0x0,'rows':[]};var _0x4689e4=_[_0x78ab('0x2e')](db['OpenchannelQueue'][_0x78ab('0x2f')],function(_0x3a7249){return{'name':_0x3a7249[_0x78ab('0x30')],'type':_0x3a7249[_0x78ab('0x31')][_0x78ab('0x32')]};});_0x105af1['model']=_[_0x78ab('0x2e')](_0x4689e4,_0x78ab('0x2c'));_0x105af1[_0x78ab('0x33')]=_[_0x78ab('0x34')](_0xca292f[_0x78ab('0x33')]);_0x105af1[_0x78ab('0x35')]=_[_0x78ab('0x36')](_0x105af1['model'],_0x105af1['query']);_0x5d99a7[_0x78ab('0x37')]=_[_0x78ab('0x36')](_0x105af1[_0x78ab('0x38')],qs[_0x78ab('0x39')](_0xca292f[_0x78ab('0x33')][_0x78ab('0x39')]));_0x5d99a7[_0x78ab('0x37')]=_0x5d99a7[_0x78ab('0x37')][_0x78ab('0x3a')]?_0x5d99a7[_0x78ab('0x37')]:_0x105af1[_0x78ab('0x38')];if(!_0xca292f[_0x78ab('0x33')]['hasOwnProperty'](_0x78ab('0x3b'))){_0x5d99a7[_0x78ab('0x20')]=qs[_0x78ab('0x20')](_0xca292f[_0x78ab('0x33')][_0x78ab('0x20')]);_0x5d99a7[_0x78ab('0x1e')]=qs['offset'](_0xca292f['query'][_0x78ab('0x1e')]);}_0x5d99a7[_0x78ab('0x3c')]=qs['sort'](_0xca292f[_0x78ab('0x33')][_0x78ab('0x3d')]);_0x5d99a7[_0x78ab('0x3e')]=qs[_0x78ab('0x35')](_[_0x78ab('0x3f')](_0xca292f[_0x78ab('0x33')],_0x105af1[_0x78ab('0x35')]),_0x4689e4);if(_0xca292f[_0x78ab('0x33')][_0x78ab('0x40')]){_0x5d99a7['where']=_[_0x78ab('0x41')](_0x5d99a7['where'],{'$or':_[_0x78ab('0x2e')](_0x4689e4,function(_0x5ee059){if(_0x5ee059[_0x78ab('0x31')]!==_0x78ab('0x42')){var _0x2e609c={};_0x2e609c[_0x5ee059[_0x78ab('0x2c')]]={'$like':'%'+_0xca292f['query'][_0x78ab('0x40')]+'%'};return _0x2e609c;}})});}_0x5d99a7=_[_0x78ab('0x41')]({},_0x5d99a7,_0xca292f['options']);var _0x581ef8={'where':_0x5d99a7['where']};return db['OpenchannelQueue'][_0x78ab('0x1f')](_0x581ef8)[_0x78ab('0x26')](function(_0x554ef2){_0x1e1fdc['count']=_0x554ef2;if(_0xca292f[_0x78ab('0x33')]['includeAll']){_0x5d99a7[_0x78ab('0x43')]=[{'all':!![]}];}return db[_0x78ab('0x44')][_0x78ab('0x45')](_0x5d99a7);})['then'](function(_0xde6ecf){_0x1e1fdc[_0x78ab('0x46')]=_0xde6ecf;return _0x1e1fdc;})[_0x78ab('0x26')](respondWithFilteredResult(_0x16ec7c,_0x5d99a7))[_0x78ab('0x47')](handleError(_0x16ec7c,null));};exports['show']=function(_0x12748f,_0xb9db0d){var _0x22602a={'raw':!![],'where':{'id':_0x12748f[_0x78ab('0x48')]['id']}},_0x48feda={};_0x48feda['model']=_['keys'](db[_0x78ab('0x44')]['rawAttributes']);_0x48feda[_0x78ab('0x33')]=_[_0x78ab('0x34')](_0x12748f['query']);_0x48feda[_0x78ab('0x35')]=_['intersection'](_0x48feda[_0x78ab('0x38')],_0x48feda['query']);_0x22602a[_0x78ab('0x37')]=_[_0x78ab('0x36')](_0x48feda[_0x78ab('0x38')],qs[_0x78ab('0x39')](_0x12748f['query']['fields']));_0x22602a[_0x78ab('0x37')]=_0x22602a['attributes'][_0x78ab('0x3a')]?_0x22602a['attributes']:_0x48feda[_0x78ab('0x38')];if(_0x12748f['query'][_0x78ab('0x49')]){_0x22602a[_0x78ab('0x43')]=[{'all':!![]}];}_0x22602a=_[_0x78ab('0x41')]({},_0x22602a,_0x12748f[_0x78ab('0x4a')]);return db[_0x78ab('0x44')][_0x78ab('0x4b')](_0x22602a)[_0x78ab('0x26')](handleEntityNotFound(_0xb9db0d,null))[_0x78ab('0x26')](respondWithResult(_0xb9db0d,null))[_0x78ab('0x47')](handleError(_0xb9db0d,null));};exports[_0x78ab('0x4c')]=function(_0x50c204,_0x151490){return db[_0x78ab('0x44')][_0x78ab('0x4c')](_0x50c204[_0x78ab('0x4d')],{})[_0x78ab('0x26')](function(_0x26a28d){var _0x375824=_0x50c204['user'][_0x78ab('0x28')]({'plain':!![]});if(!_0x375824)throw new Error(_0x78ab('0x4e'));if(_0x375824[_0x78ab('0x4f')]===_0x78ab('0x50')){var _0x2c11bc=_0x26a28d[_0x78ab('0x28')]({'plain':!![]});var _0x593e0e=_0x78ab('0x29');return db[_0x78ab('0x51')][_0x78ab('0x4b')]({'where':{'name':_0x593e0e,'userProfileId':_0x375824[_0x78ab('0x52')]},'raw':!![]})[_0x78ab('0x26')](function(_0x425ff8){if(_0x425ff8&&_0x425ff8[_0x78ab('0x53')]===0x0){return db[_0x78ab('0x54')][_0x78ab('0x4c')]({'name':_0x2c11bc[_0x78ab('0x2c')],'resourceId':_0x2c11bc['id'],'type':_0x425ff8[_0x78ab('0x2c')],'sectionId':_0x425ff8['id']},{})[_0x78ab('0x26')](function(){return _0x26a28d;});}else{return _0x26a28d;}})[_0x78ab('0x47')](function(_0x5be94c){logger[_0x78ab('0x2a')](_0x78ab('0x55'),_0x5be94c);throw _0x5be94c;});}return _0x26a28d;})[_0x78ab('0x26')](respondWithResult(_0x151490,0xc9))[_0x78ab('0x47')](handleError(_0x151490,null));};exports[_0x78ab('0x56')]=function(_0x212485,_0x480e42){if(_0x212485[_0x78ab('0x4d')]['id']){delete _0x212485[_0x78ab('0x4d')]['id'];}return db[_0x78ab('0x44')]['find']({'where':{'id':_0x212485[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x480e42,null))[_0x78ab('0x26')](saveUpdates(_0x212485[_0x78ab('0x4d')],null))[_0x78ab('0x26')](respondWithResult(_0x480e42,null))[_0x78ab('0x47')](handleError(_0x480e42,null));};exports[_0x78ab('0x27')]=function(_0x19d620,_0x568610){return db[_0x78ab('0x44')][_0x78ab('0x4b')]({'where':{'id':_0x19d620[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x568610,null))[_0x78ab('0x26')](removeEntity(_0x568610,null))[_0x78ab('0x47')](handleError(_0x568610,null));};exports['describe']=function(_0x33e064,_0x18dbf2){return db[_0x78ab('0x44')][_0x78ab('0x57')]()[_0x78ab('0x26')](respondWithResult(_0x18dbf2,null))[_0x78ab('0x47')](handleError(_0x18dbf2,null));};exports['getMembers']=function(_0x2f9a96,_0x153530,_0x3a7779){var _0x5c337f={'raw':!![],'where':{}},_0x7d00ff={},_0xf477ae;return db[_0x78ab('0x44')][_0x78ab('0x58')]({'where':{'id':_0x2f9a96[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x153530,null))[_0x78ab('0x26')](function(_0x36ae3b){if(_0x36ae3b){_0xf477ae=_0x36ae3b[_0x78ab('0x28')]({'plain':!![]});_0x7d00ff[_0x78ab('0x38')]=_[_0x78ab('0x34')](db[_0x78ab('0x59')]['rawAttributes']);_0x7d00ff[_0x78ab('0x33')]=_[_0x78ab('0x34')](_0x2f9a96['query']);_0x7d00ff[_0x78ab('0x35')]=_[_0x78ab('0x36')](_0x7d00ff[_0x78ab('0x38')],_0x7d00ff[_0x78ab('0x33')]);_0x5c337f['attributes']=_[_0x78ab('0x36')](_0x7d00ff[_0x78ab('0x38')],qs[_0x78ab('0x39')](_0x2f9a96[_0x78ab('0x33')]['fields']));_0x5c337f['attributes']=_0x5c337f[_0x78ab('0x37')][_0x78ab('0x3a')]?_0x5c337f['attributes']:_0x7d00ff[_0x78ab('0x38')];if(!_0x2f9a96[_0x78ab('0x33')][_0x78ab('0x5a')](_0x78ab('0x3b'))){_0x5c337f[_0x78ab('0x20')]=qs[_0x78ab('0x20')](_0x2f9a96[_0x78ab('0x33')][_0x78ab('0x20')]);_0x5c337f[_0x78ab('0x1e')]=qs[_0x78ab('0x1e')](_0x2f9a96[_0x78ab('0x33')]['offset']);}_0x5c337f[_0x78ab('0x3c')]=qs[_0x78ab('0x3d')](_0x2f9a96[_0x78ab('0x33')][_0x78ab('0x3d')]);_0x5c337f[_0x78ab('0x3e')]=qs[_0x78ab('0x35')](_[_0x78ab('0x3f')](_0x2f9a96[_0x78ab('0x33')],_0x7d00ff[_0x78ab('0x35')]));_0x5c337f[_0x78ab('0x3e')]['OpenchannelQueueId']=_0x36ae3b['id'];if(_0x2f9a96[_0x78ab('0x33')][_0x78ab('0x40')]){_0x5c337f[_0x78ab('0x3e')]=_[_0x78ab('0x41')](_0x5c337f[_0x78ab('0x3e')],{'$or':_[_0x78ab('0x2e')](_0x5c337f[_0x78ab('0x37')],function(_0x550ea1){var _0x174919={};_0x174919[_0x550ea1]={'$like':'%'+_0x2f9a96[_0x78ab('0x33')]['filter']+'%'};return _0x174919;})});}_0x5c337f=_['merge']({},_0x5c337f,_0x2f9a96[_0x78ab('0x4a')]);return db[_0x78ab('0x59')][_0x78ab('0x45')](_0x5c337f);}})[_0x78ab('0x26')](function(_0x17fa57){if(_0x17fa57){return db[_0x78ab('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x17fa57,'UserId'),'role':'agent'},'attributes':['id',_0x78ab('0x2c'),_0x78ab('0x5c'),_0x78ab('0x5d'),_0x78ab('0x5e')]});}})['then'](function(_0x282c6c){if(_0x282c6c){return{'count':_0x282c6c[_0x78ab('0x1f')],'rows':_[_0x78ab('0x2e')](_0x282c6c[_0x78ab('0x46')],function(_0x5346e1){return{'membername':_0x5346e1[_0x78ab('0x2c')],'UserId':_0x5346e1['id'],'queue_name':_0xf477ae[_0x78ab('0x2c')],'OpenchannelQueueId':_0xf477ae['id'],'interface':util[_0x78ab('0x5f')](_0x78ab('0x60'),_0x78ab('0x61'),_0x5346e1[_0x78ab('0x2c')]),'penalty':0x0,'paused':_0x5346e1['openchannelPause'],'createdAt':_0x5346e1[_0x78ab('0x5e')],'updatedAt':_0x5346e1[_0x78ab('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x78ab('0x26')](respondWithFilteredResult(_0x153530,_0x5c337f))[_0x78ab('0x47')](handleError(_0x153530,null));};exports[_0x78ab('0x62')]=function(_0x5c167a,_0x7d81ae,_0x152827){var _0x4e8550={};var _0x4d5ebe={};var _0x4a5102;var _0x245c2d;return db['OpenchannelQueue'][_0x78ab('0x58')]({'where':{'id':_0x5c167a[_0x78ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x7d81ae,null))['then'](function(_0x54b01a){if(_0x54b01a){_0x4a5102=_0x54b01a;_0x4d5ebe[_0x78ab('0x38')]=_[_0x78ab('0x34')](db['Team'][_0x78ab('0x2f')]);_0x4d5ebe['query']=_['keys'](_0x5c167a[_0x78ab('0x33')]);_0x4d5ebe[_0x78ab('0x35')]=_[_0x78ab('0x36')](_0x4d5ebe['model'],_0x4d5ebe[_0x78ab('0x33')]);_0x4e8550[_0x78ab('0x37')]=_[_0x78ab('0x36')](_0x4d5ebe[_0x78ab('0x38')],qs['fields'](_0x5c167a[_0x78ab('0x33')]['fields']));_0x4e8550[_0x78ab('0x37')]=_0x4e8550[_0x78ab('0x37')][_0x78ab('0x3a')]?_0x4e8550['attributes']:_0x4d5ebe[_0x78ab('0x38')];_0x4e8550[_0x78ab('0x3c')]=qs[_0x78ab('0x3d')](_0x5c167a['query'][_0x78ab('0x3d')]);_0x4e8550[_0x78ab('0x3e')]=qs[_0x78ab('0x35')](_[_0x78ab('0x3f')](_0x5c167a[_0x78ab('0x33')],_0x4d5ebe[_0x78ab('0x35')]));if(_0x5c167a['query'][_0x78ab('0x40')]){_0x4e8550[_0x78ab('0x3e')]=_[_0x78ab('0x41')](_0x4e8550[_0x78ab('0x3e')],{'$or':_[_0x78ab('0x2e')](_0x4e8550[_0x78ab('0x37')],function(_0x125400){var _0x3e420e={};_0x3e420e[_0x125400]={'$like':'%'+_0x5c167a[_0x78ab('0x33')][_0x78ab('0x40')]+'%'};return _0x3e420e;})});}_0x4e8550=_[_0x78ab('0x41')]({},_0x4e8550,_0x5c167a['options']);return _0x4a5102['getTeams'](_0x4e8550);}})['then'](function(_0x31fcb5){if(_0x31fcb5){_0x245c2d=_0x31fcb5[_0x78ab('0x3a')];if(!_0x5c167a[_0x78ab('0x33')][_0x78ab('0x5a')]('nolimit')){_0x4e8550[_0x78ab('0x20')]=qs[_0x78ab('0x20')](_0x5c167a[_0x78ab('0x33')][_0x78ab('0x20')]);_0x4e8550[_0x78ab('0x1e')]=qs[_0x78ab('0x1e')](_0x5c167a[_0x78ab('0x33')]['offset']);}return _0x4a5102[_0x78ab('0x62')](_0x4e8550);}})[_0x78ab('0x26')](function(_0xa2fbd2){if(_0xa2fbd2){return _0xa2fbd2?{'count':_0x245c2d,'rows':_0xa2fbd2}:null;}})['then'](respondWithResult(_0x7d81ae,null))[_0x78ab('0x47')](handleError(_0x7d81ae,null));};exports[_0x78ab('0x63')]=function(_0x38d6fd,_0x3bc4ec,_0x3add14){var _0x35674a=_0x38d6fd[_0x78ab('0x4d')]['ids'];return db[_0x78ab('0x64')][_0x78ab('0x45')]({'where':{'id':_0x35674a},'attributes':['id'],'include':[{'model':db[_0x78ab('0x5b')],'as':'Agents','attributes':['id',_0x78ab('0x2c'),_0x78ab('0x65'),_0x78ab('0x66'),'interface'],'raw':!![]}]})[_0x78ab('0x26')](function(_0x1a02a0){if(_0x1a02a0){var _0x4d7824=_[_0x78ab('0x67')](_0x1a02a0,function(_0x59305f){var _0x435a14=_0x59305f[_0x78ab('0x28')]({'plain':!![]});return _0x435a14['Agents'];});return db[_0x78ab('0x44')][_0x78ab('0x4b')]({'where':{'id':_0x38d6fd[_0x78ab('0x48')]['id']}})['then'](function(_0x5418c8){return db[_0x78ab('0x68')][_0x78ab('0x69')](function(_0x22d2f4){return _0x5418c8['addTeams'](_0x35674a,{'transaction':_0x22d2f4})[_0x78ab('0x26')](function(){return BPromise['each'](_0x4d7824,function(_0x49a6af){return db[_0x78ab('0x59')][_0x78ab('0x6a')]({'where':{'UserId':_0x49a6af['id'],'OpenchannelQueueId':_0x38d6fd['params']['id']},'transaction':_0x22d2f4});});})['then'](function(){_0x4d7824[_0x78ab('0x6b')](function(_0x226ada){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x226ada['id'],'OpenchannelQueueId':_0x5418c8['id']});});});});});}})[_0x78ab('0x26')](respondWithStatusCode(_0x3bc4ec,null))['catch'](handleError(_0x3bc4ec,null));};exports[_0x78ab('0x6c')]=function(_0x26d83e,_0x14aa5c,_0x9c91ac){return db[_0x78ab('0x64')][_0x78ab('0x45')]({'where':{'id':_0x26d83e[_0x78ab('0x33')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x78ab('0x26')](handleEntityNotFound(_0x14aa5c,null))[_0x78ab('0x26')](function(_0x5d6a99){var _0x5c1089=_[_0x78ab('0x2e')](_0x5d6a99,'id');var _0x13b58a=[];var _0x1dbf3a=[];var _0x498a50=squel[_0x78ab('0x6d')]();_0x498a50[_0x78ab('0x6e')](_0x78ab('0x6f'))[_0x78ab('0x70')]('team_has_openchannel_queues','tq')[_0x78ab('0x71')](_0x78ab('0x72'),'ut',_0x78ab('0x73'))[_0x78ab('0x3e')](_0x78ab('0x74'),_0x26d83e[_0x78ab('0x48')]['id']);for(var _0x559563=0x0;_0x559563<_0x5d6a99['length'];_0x559563+=0x1){let _0x1efb98=_0x5d6a99[_0x559563];for(var _0x116cac=0x0;_0x116cac<_0x1efb98['Agents'][_0x78ab('0x3a')];_0x116cac+=0x1){let _0x3344e3=_0x1efb98[_0x78ab('0x75')][_0x116cac];var _0x5e1b8e=_0x498a50['clone']();_0x5e1b8e[_0x78ab('0x3e')]('ut.UserId\x20=\x20?',_0x3344e3['id']);_0x1dbf3a[_0x78ab('0x76')](db[_0x78ab('0x68')]['query'](_0x5e1b8e[_0x78ab('0x77')](),{'type':db[_0x78ab('0x68')][_0x78ab('0x78')]['SELECT']})['then'](function(_0x387cde){if(_0x387cde[_0x78ab('0x3a')]===0x1){return _0x3344e3['id'];}else{var _0x114789=_['every'](_[_0x78ab('0x2e')](_0x387cde,'TeamId'),function(_0x1c1d06){return _[_0x78ab('0x79')](_0x5c1089,_0x1c1d06);});if(_0x114789){return _0x3344e3['id'];}}}));}}return BPromise['all'](_0x1dbf3a)[_0x78ab('0x26')](function(_0x42b551){_0x13b58a=_(_0x13b58a)[_0x78ab('0x7a')](_0x42b551)[_0x78ab('0x7b')]()[_0x78ab('0x7c')]();return db[_0x78ab('0x44')][_0x78ab('0x4b')]({'where':{'id':_0x26d83e[_0x78ab('0x48')]['id']}})['then'](function(_0x979ab4){return db[_0x78ab('0x68')][_0x78ab('0x69')](function(_0x569260){return _0x979ab4['removeTeams'](_0x26d83e[_0x78ab('0x33')]['ids'],{'transaction':_0x569260})[_0x78ab('0x26')](function(){if(!_['isEmpty'](_0x13b58a)){return _0x979ab4[_0x78ab('0x7d')](_0x13b58a,{'transaction':_0x569260});}})[_0x78ab('0x26')](function(){_0x13b58a['forEach'](function(_0x560dbd){socket['emit'](_0x78ab('0x7e'),{'UserId':_0x560dbd,'OpenchannelQueueId':_0x979ab4['id']});});});});});});})['then'](respondWithStatusCode(_0x14aa5c,null))[_0x78ab('0x47')](handleError(_0x14aa5c,null));};exports[_0x78ab('0x7f')]=function(_0x397c64,_0x51a918,_0x3d89d3){return db[_0x78ab('0x44')][_0x78ab('0x4b')]({'where':{'id':_0x397c64[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x51a918,null))[_0x78ab('0x26')](function(_0x114b0d){if(_0x114b0d){return _0x114b0d[_0x78ab('0x7f')](_0x397c64['body']['ids'],_['omit'](_0x397c64['body'],[_0x78ab('0x80'),'id'])||{})[_0x78ab('0x81')](function(_0x3583d0){for(var _0xff9a7f=0x0;_0xff9a7f<_0x397c64['body'][_0x78ab('0x80')][_0x78ab('0x3a')];_0xff9a7f+=0x1){socket[_0x78ab('0x82')](_0x78ab('0x83'),{'UserId':Number(_0x397c64[_0x78ab('0x4d')][_0x78ab('0x80')][_0xff9a7f]),'OpenchannelQueueId':Number(_0x397c64[_0x78ab('0x48')]['id'])});}return _0x3583d0;});}})['then'](respondWithResult(_0x51a918,null))['catch'](handleError(_0x51a918,null));};exports[_0x78ab('0x7d')]=function(_0x2aa236,_0x567e7d,_0x4ec5c8){return db[_0x78ab('0x44')][_0x78ab('0x4b')]({'where':{'id':_0x2aa236[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x567e7d,null))['then'](function(_0x16a08b){if(_0x16a08b){return _0x16a08b[_0x78ab('0x7d')](_0x2aa236[_0x78ab('0x33')][_0x78ab('0x80')])[_0x78ab('0x26')](function(){if(_[_0x78ab('0x84')](_0x2aa236['query'][_0x78ab('0x80')])){for(var _0x52b26d=0x0;_0x52b26d<_0x2aa236[_0x78ab('0x33')][_0x78ab('0x80')][_0x78ab('0x3a')];_0x52b26d+=0x1){socket[_0x78ab('0x82')](_0x78ab('0x7e'),{'UserId':Number(_0x2aa236[_0x78ab('0x33')]['ids'][_0x52b26d]),'OpenchannelQueueId':Number(_0x2aa236[_0x78ab('0x48')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2aa236['query'][_0x78ab('0x80')]),'OpenchannelQueueId':Number(_0x2aa236['params']['id'])});}});}})[_0x78ab('0x26')](respondWithStatusCode(_0x567e7d,null))[_0x78ab('0x47')](handleError(_0x567e7d,null));};exports[_0x78ab('0x85')]=function(_0x17f075,_0x5b19ae,_0xa8a9aa){var _0x245558={};var _0x215770={};var _0x5bcdee;var _0x1267c5;return db[_0x78ab('0x44')]['findOne']({'where':{'id':_0x17f075[_0x78ab('0x48')]['id']}})[_0x78ab('0x26')](handleEntityNotFound(_0x5b19ae,null))[_0x78ab('0x26')](function(_0x31ca09){if(_0x31ca09){_0x5bcdee=_0x31ca09;_0x215770['model']=_['keys'](db[_0x78ab('0x5b')]['rawAttributes']);_0x215770[_0x78ab('0x33')]=_[_0x78ab('0x34')](_0x17f075[_0x78ab('0x33')]);_0x215770[_0x78ab('0x35')]=_[_0x78ab('0x36')](_0x215770[_0x78ab('0x38')],_0x215770[_0x78ab('0x33')]);_0x245558[_0x78ab('0x37')]=_[_0x78ab('0x36')](_0x215770['model'],qs[_0x78ab('0x39')](_0x17f075['query'][_0x78ab('0x39')]));_0x245558[_0x78ab('0x37')]=_0x245558[_0x78ab('0x37')][_0x78ab('0x3a')]?_0x245558[_0x78ab('0x37')]:_0x215770[_0x78ab('0x38')];_0x245558[_0x78ab('0x3c')]=qs[_0x78ab('0x3d')](_0x17f075[_0x78ab('0x33')][_0x78ab('0x3d')]);_0x245558[_0x78ab('0x3e')]=qs[_0x78ab('0x35')](_[_0x78ab('0x3f')](_0x17f075['query'],_0x215770[_0x78ab('0x35')]));if(_0x17f075[_0x78ab('0x33')]['filter']){_0x245558[_0x78ab('0x3e')]=_['merge'](_0x245558[_0x78ab('0x3e')],{'$or':_[_0x78ab('0x2e')](_0x245558['attributes'],function(_0xf55a42){var _0x48aa31={};_0x48aa31[_0xf55a42]={'$like':'%'+_0x17f075[_0x78ab('0x33')][_0x78ab('0x40')]+'%'};return _0x48aa31;})});}_0x245558=_[_0x78ab('0x41')]({},_0x245558,_0x17f075[_0x78ab('0x4a')]);return _0x5bcdee[_0x78ab('0x85')](_0x245558);}})['then'](function(_0x4411ca){if(_0x4411ca){_0x1267c5=_0x4411ca[_0x78ab('0x3a')];if(!_0x17f075[_0x78ab('0x33')][_0x78ab('0x5a')](_0x78ab('0x3b'))){_0x245558[_0x78ab('0x20')]=qs[_0x78ab('0x20')](_0x17f075['query'][_0x78ab('0x20')]);_0x245558[_0x78ab('0x1e')]=qs[_0x78ab('0x1e')](_0x17f075[_0x78ab('0x33')][_0x78ab('0x1e')]);}return _0x5bcdee[_0x78ab('0x85')](_0x245558);}})[_0x78ab('0x26')](function(_0x58cff2){if(_0x58cff2){return _0x58cff2?{'count':_0x1267c5,'rows':_0x58cff2}:null;}})[_0x78ab('0x26')](respondWithResult(_0x5b19ae,null))[_0x78ab('0x47')](handleError(_0x5b19ae,null));}; \ No newline at end of file +var _0x0476=['userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','params','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','nolimit','OpenchannelQueueId','filter','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','union','value','transaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0476,0x95));var _0x6047=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x0476[_0x34a8c8];return _0x1fe6e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6047('0x0'));var zipdir=require(_0x6047('0x1'));var jsonpatch=require(_0x6047('0x2'));var rp=require('request-promise');var moment=require(_0x6047('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6047('0x4'));var path=require(_0x6047('0x5'));var sox=require(_0x6047('0x6'));var csv=require(_0x6047('0x7'));var ejs=require(_0x6047('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6047('0x9'));var squel=require('squel');var crypto=require(_0x6047('0xa'));var jsforce=require(_0x6047('0xb'));var deskjs=require(_0x6047('0xc'));var toCsv=require(_0x6047('0x7'));var querystring=require(_0x6047('0xd'));var Papa=require(_0x6047('0xe'));var Redis=require(_0x6047('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6047('0x10'));var as=require(_0x6047('0x11'));var hardwareService=require(_0x6047('0x12'));var logger=require('../../config/logger')(_0x6047('0x13'));var utils=require(_0x6047('0x14'));var config=require(_0x6047('0x15'));var licenseUtil=require(_0x6047('0x16'));var db=require(_0x6047('0x17'))['db'];config[_0x6047('0x18')]=_[_0x6047('0x19')](config['redis'],{'host':_0x6047('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6047('0x18')]));require(_0x6047('0x1b'))['register'](socket);function respondWithStatusCode(_0x38d2ba,_0x37067c){_0x37067c=_0x37067c||0xcc;return function(_0x2072b8){if(_0x2072b8){return _0x38d2ba['sendStatus'](_0x37067c);}return _0x38d2ba['status'](_0x37067c)[_0x6047('0x1c')]();};}function respondWithResult(_0x54a2e6,_0xd371f){_0xd371f=_0xd371f||0xc8;return function(_0x294d83){if(_0x294d83){return _0x54a2e6['status'](_0xd371f)[_0x6047('0x1d')](_0x294d83);}};}function respondWithFilteredResult(_0x260e7e,_0x170fa8){return function(_0x3e3fd3){if(_0x3e3fd3){var _0x5b0ac3=typeof _0x170fa8[_0x6047('0x1e')]===_0x6047('0x1f')&&typeof _0x170fa8[_0x6047('0x20')]===_0x6047('0x1f');var _0x2007e1=_0x3e3fd3[_0x6047('0x21')];var _0x25e8d9=_0x5b0ac3?0x0:_0x170fa8[_0x6047('0x1e')];var _0x58bfac=_0x5b0ac3?_0x3e3fd3['count']:_0x170fa8[_0x6047('0x1e')]+_0x170fa8[_0x6047('0x20')];var _0x3af644;if(_0x58bfac>=_0x2007e1){_0x58bfac=_0x2007e1;_0x3af644=0xc8;}else{_0x3af644=0xce;}_0x260e7e[_0x6047('0x22')](_0x3af644);return _0x260e7e['set'](_0x6047('0x23'),_0x25e8d9+'-'+_0x58bfac+'/'+_0x2007e1)[_0x6047('0x1d')](_0x3e3fd3);}return null;};}function patchUpdates(_0x1be3c1){return function(_0x39acf7){try{jsonpatch[_0x6047('0x24')](_0x39acf7,_0x1be3c1,!![]);}catch(_0x179000){return BPromise[_0x6047('0x25')](_0x179000);}return _0x39acf7[_0x6047('0x26')]();};}function saveUpdates(_0x2d58c6,_0x2e14c0){return function(_0x3b3754){if(_0x3b3754){return _0x3b3754['update'](_0x2d58c6)[_0x6047('0x27')](function(_0x4064b3){return _0x4064b3;});}return null;};}function removeEntity(_0xe34c7b,_0x13f386){return function(_0x244a54){if(_0x244a54){return _0x244a54[_0x6047('0x28')]()['then'](function(){var _0x4e08f1=_0x244a54[_0x6047('0x29')]({'plain':!![]});var _0x26542a=_0x6047('0x2a');return db[_0x6047('0x2b')][_0x6047('0x28')]({'where':{'type':_0x26542a,'resourceId':_0x4e08f1['id']}})['then'](function(){return _0x244a54;});})[_0x6047('0x27')](function(){_0xe34c7b[_0x6047('0x22')](0xcc)[_0x6047('0x1c')]();});}};}function handleEntityNotFound(_0xe6bf45,_0x519901){return function(_0x3c0f3c){if(!_0x3c0f3c){_0xe6bf45['sendStatus'](0x194);}return _0x3c0f3c;};}function handleError(_0x2d7dc3,_0x2b86dd){_0x2b86dd=_0x2b86dd||0x1f4;return function(_0x45e0e1){logger['error'](_0x45e0e1['stack']);if(_0x45e0e1[_0x6047('0x2c')]){delete _0x45e0e1[_0x6047('0x2c')];}_0x2d7dc3['status'](_0x2b86dd)[_0x6047('0x2d')](_0x45e0e1);};}exports[_0x6047('0x2e')]=function(_0x42f9a6,_0x172ae2){var _0x308423={},_0x8137bf={},_0x582dfd={'count':0x0,'rows':[]};var _0x12d209=_[_0x6047('0x2f')](db['OpenchannelQueue']['rawAttributes'],function(_0x27997e){return{'name':_0x27997e['fieldName'],'type':_0x27997e[_0x6047('0x30')][_0x6047('0x31')]};});_0x8137bf[_0x6047('0x32')]=_[_0x6047('0x2f')](_0x12d209,_0x6047('0x2c'));_0x8137bf[_0x6047('0x33')]=_[_0x6047('0x34')](_0x42f9a6['query']);_0x8137bf[_0x6047('0x35')]=_[_0x6047('0x36')](_0x8137bf['model'],_0x8137bf[_0x6047('0x33')]);_0x308423[_0x6047('0x37')]=_[_0x6047('0x36')](_0x8137bf[_0x6047('0x32')],qs[_0x6047('0x38')](_0x42f9a6[_0x6047('0x33')][_0x6047('0x38')]));_0x308423['attributes']=_0x308423[_0x6047('0x37')][_0x6047('0x39')]?_0x308423[_0x6047('0x37')]:_0x8137bf[_0x6047('0x32')];if(!_0x42f9a6['query'][_0x6047('0x3a')]('nolimit')){_0x308423[_0x6047('0x20')]=qs[_0x6047('0x20')](_0x42f9a6['query']['limit']);_0x308423[_0x6047('0x1e')]=qs[_0x6047('0x1e')](_0x42f9a6[_0x6047('0x33')]['offset']);}_0x308423[_0x6047('0x3b')]=qs[_0x6047('0x3c')](_0x42f9a6[_0x6047('0x33')]['sort']);_0x308423['where']=qs['filters'](_[_0x6047('0x3d')](_0x42f9a6[_0x6047('0x33')],_0x8137bf[_0x6047('0x35')]),_0x12d209);if(_0x42f9a6[_0x6047('0x33')]['filter']){_0x308423[_0x6047('0x3e')]=_['merge'](_0x308423['where'],{'$or':_[_0x6047('0x2f')](_0x12d209,function(_0x37f3c2){if(_0x37f3c2[_0x6047('0x30')]!==_0x6047('0x3f')){var _0x15b6ab={};_0x15b6ab[_0x37f3c2[_0x6047('0x2c')]]={'$like':'%'+_0x42f9a6[_0x6047('0x33')]['filter']+'%'};return _0x15b6ab;}})});}_0x308423=_['merge']({},_0x308423,_0x42f9a6[_0x6047('0x40')]);var _0x12d1f9={'where':_0x308423[_0x6047('0x3e')]};return db[_0x6047('0x41')][_0x6047('0x21')](_0x12d1f9)['then'](function(_0x4d20d5){_0x582dfd['count']=_0x4d20d5;if(_0x42f9a6[_0x6047('0x33')][_0x6047('0x42')]){_0x308423[_0x6047('0x43')]=[{'all':!![]}];}return db[_0x6047('0x41')][_0x6047('0x44')](_0x308423);})[_0x6047('0x27')](function(_0x1b900b){_0x582dfd[_0x6047('0x45')]=_0x1b900b;return _0x582dfd;})[_0x6047('0x27')](respondWithFilteredResult(_0x172ae2,_0x308423))[_0x6047('0x46')](handleError(_0x172ae2,null));};exports['show']=function(_0x1ca0c9,_0x59216e){var _0x255dad={'raw':!![],'where':{'id':_0x1ca0c9[_0x6047('0x47')]['id']}},_0x394f61={};_0x394f61[_0x6047('0x32')]=_[_0x6047('0x34')](db[_0x6047('0x41')]['rawAttributes']);_0x394f61[_0x6047('0x33')]=_[_0x6047('0x34')](_0x1ca0c9[_0x6047('0x33')]);_0x394f61[_0x6047('0x35')]=_[_0x6047('0x36')](_0x394f61[_0x6047('0x32')],_0x394f61[_0x6047('0x33')]);_0x255dad['attributes']=_[_0x6047('0x36')](_0x394f61[_0x6047('0x32')],qs['fields'](_0x1ca0c9[_0x6047('0x33')]['fields']));_0x255dad[_0x6047('0x37')]=_0x255dad['attributes'][_0x6047('0x39')]?_0x255dad['attributes']:_0x394f61[_0x6047('0x32')];if(_0x1ca0c9['query'][_0x6047('0x42')]){_0x255dad[_0x6047('0x43')]=[{'all':!![]}];}_0x255dad=_[_0x6047('0x48')]({},_0x255dad,_0x1ca0c9[_0x6047('0x40')]);return db[_0x6047('0x41')]['find'](_0x255dad)[_0x6047('0x27')](handleEntityNotFound(_0x59216e,null))[_0x6047('0x27')](respondWithResult(_0x59216e,null))[_0x6047('0x46')](handleError(_0x59216e,null));};exports[_0x6047('0x49')]=function(_0x253fae,_0x48c766){return db[_0x6047('0x41')][_0x6047('0x49')](_0x253fae['body'],{})['then'](function(_0x22d1fc){var _0x4e9445=_0x253fae[_0x6047('0x4a')][_0x6047('0x29')]({'plain':!![]});if(!_0x4e9445)throw new Error(_0x6047('0x4b'));if(_0x4e9445['role']===_0x6047('0x4a')){var _0x2d5872=_0x22d1fc['get']({'plain':!![]});var _0x4a403d='OpenchannelQueues';return db[_0x6047('0x4c')][_0x6047('0x4d')]({'where':{'name':_0x4a403d,'userProfileId':_0x4e9445[_0x6047('0x4e')]},'raw':!![]})[_0x6047('0x27')](function(_0x90765f){if(_0x90765f&&_0x90765f[_0x6047('0x4f')]===0x0){return db[_0x6047('0x2b')][_0x6047('0x49')]({'name':_0x2d5872[_0x6047('0x2c')],'resourceId':_0x2d5872['id'],'type':_0x90765f[_0x6047('0x2c')],'sectionId':_0x90765f['id']},{})[_0x6047('0x27')](function(){return _0x22d1fc;});}else{return _0x22d1fc;}})['catch'](function(_0x508673){logger[_0x6047('0x50')](_0x6047('0x51'),_0x508673);throw _0x508673;});}return _0x22d1fc;})[_0x6047('0x27')](respondWithResult(_0x48c766,0xc9))[_0x6047('0x46')](handleError(_0x48c766,null));};exports[_0x6047('0x52')]=function(_0x2abbbb,_0x3ff10d){if(_0x2abbbb[_0x6047('0x53')]['id']){delete _0x2abbbb[_0x6047('0x53')]['id'];}return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x2abbbb[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0x3ff10d,null))[_0x6047('0x27')](saveUpdates(_0x2abbbb[_0x6047('0x53')],null))[_0x6047('0x27')](respondWithResult(_0x3ff10d,null))[_0x6047('0x46')](handleError(_0x3ff10d,null));};exports[_0x6047('0x28')]=function(_0x375091,_0x2651eb){return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x375091[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0x2651eb,null))[_0x6047('0x27')](removeEntity(_0x2651eb,null))[_0x6047('0x46')](handleError(_0x2651eb,null));};exports[_0x6047('0x54')]=function(_0x407b82,_0x1240b9){return db[_0x6047('0x41')][_0x6047('0x54')]()['then'](respondWithResult(_0x1240b9,null))[_0x6047('0x46')](handleError(_0x1240b9,null));};exports[_0x6047('0x55')]=function(_0x20a066,_0xf7048c,_0x3085f0){var _0x36cd62={'raw':!![],'where':{}},_0x54c84c={},_0x1bbcb2;return db['OpenchannelQueue'][_0x6047('0x56')]({'where':{'id':_0x20a066[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0xf7048c,null))[_0x6047('0x27')](function(_0x30c6da){if(_0x30c6da){_0x1bbcb2=_0x30c6da[_0x6047('0x29')]({'plain':!![]});_0x54c84c[_0x6047('0x32')]=_[_0x6047('0x34')](db[_0x6047('0x57')][_0x6047('0x58')]);_0x54c84c[_0x6047('0x33')]=_[_0x6047('0x34')](_0x20a066['query']);_0x54c84c[_0x6047('0x35')]=_[_0x6047('0x36')](_0x54c84c['model'],_0x54c84c[_0x6047('0x33')]);_0x36cd62[_0x6047('0x37')]=_[_0x6047('0x36')](_0x54c84c[_0x6047('0x32')],qs[_0x6047('0x38')](_0x20a066[_0x6047('0x33')]['fields']));_0x36cd62[_0x6047('0x37')]=_0x36cd62['attributes'][_0x6047('0x39')]?_0x36cd62[_0x6047('0x37')]:_0x54c84c['model'];if(!_0x20a066[_0x6047('0x33')][_0x6047('0x3a')](_0x6047('0x59'))){_0x36cd62[_0x6047('0x20')]=qs[_0x6047('0x20')](_0x20a066[_0x6047('0x33')][_0x6047('0x20')]);_0x36cd62[_0x6047('0x1e')]=qs[_0x6047('0x1e')](_0x20a066[_0x6047('0x33')]['offset']);}_0x36cd62[_0x6047('0x3b')]=qs[_0x6047('0x3c')](_0x20a066[_0x6047('0x33')][_0x6047('0x3c')]);_0x36cd62[_0x6047('0x3e')]=qs['filters'](_['pick'](_0x20a066[_0x6047('0x33')],_0x54c84c['filters']));_0x36cd62[_0x6047('0x3e')][_0x6047('0x5a')]=_0x30c6da['id'];if(_0x20a066['query'][_0x6047('0x5b')]){_0x36cd62[_0x6047('0x3e')]=_[_0x6047('0x48')](_0x36cd62[_0x6047('0x3e')],{'$or':_[_0x6047('0x2f')](_0x36cd62[_0x6047('0x37')],function(_0x3a3d23){var _0x87e800={};_0x87e800[_0x3a3d23]={'$like':'%'+_0x20a066[_0x6047('0x33')][_0x6047('0x5b')]+'%'};return _0x87e800;})});}_0x36cd62=_[_0x6047('0x48')]({},_0x36cd62,_0x20a066['options']);return db['UserOpenchannelQueue'][_0x6047('0x44')](_0x36cd62);}})['then'](function(_0x3e71fb){if(_0x3e71fb){return db[_0x6047('0x5c')][_0x6047('0x5d')]({'where':{'id':_[_0x6047('0x2f')](_0x3e71fb,_0x6047('0x5e')),'role':'agent'},'attributes':['id',_0x6047('0x2c'),_0x6047('0x5f'),_0x6047('0x60'),_0x6047('0x61')]});}})[_0x6047('0x27')](function(_0x21cb3f){if(_0x21cb3f){return{'count':_0x21cb3f['count'],'rows':_['map'](_0x21cb3f[_0x6047('0x45')],function(_0x3a6960){return{'membername':_0x3a6960[_0x6047('0x2c')],'UserId':_0x3a6960['id'],'queue_name':_0x1bbcb2[_0x6047('0x2c')],'OpenchannelQueueId':_0x1bbcb2['id'],'interface':util[_0x6047('0x62')](_0x6047('0x63'),_0x6047('0x64'),_0x3a6960[_0x6047('0x2c')]),'penalty':0x0,'paused':_0x3a6960['openchannelPause'],'createdAt':_0x3a6960[_0x6047('0x61')],'updatedAt':_0x3a6960[_0x6047('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6047('0x27')](respondWithFilteredResult(_0xf7048c,_0x36cd62))[_0x6047('0x46')](handleError(_0xf7048c,null));};exports['getTeams']=function(_0x412a08,_0xc3ea5b,_0x45f8c5){var _0x1588b1={};var _0xdc573c={};var _0x2d6e1a;var _0xabf4d9;return db['OpenchannelQueue'][_0x6047('0x56')]({'where':{'id':_0x412a08[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0xc3ea5b,null))[_0x6047('0x27')](function(_0x4c5456){if(_0x4c5456){_0x2d6e1a=_0x4c5456;_0xdc573c[_0x6047('0x32')]=_[_0x6047('0x34')](db[_0x6047('0x65')][_0x6047('0x58')]);_0xdc573c[_0x6047('0x33')]=_['keys'](_0x412a08['query']);_0xdc573c[_0x6047('0x35')]=_[_0x6047('0x36')](_0xdc573c[_0x6047('0x32')],_0xdc573c['query']);_0x1588b1[_0x6047('0x37')]=_[_0x6047('0x36')](_0xdc573c[_0x6047('0x32')],qs['fields'](_0x412a08[_0x6047('0x33')][_0x6047('0x38')]));_0x1588b1['attributes']=_0x1588b1[_0x6047('0x37')][_0x6047('0x39')]?_0x1588b1[_0x6047('0x37')]:_0xdc573c[_0x6047('0x32')];_0x1588b1[_0x6047('0x3b')]=qs[_0x6047('0x3c')](_0x412a08[_0x6047('0x33')][_0x6047('0x3c')]);_0x1588b1[_0x6047('0x3e')]=qs[_0x6047('0x35')](_[_0x6047('0x3d')](_0x412a08[_0x6047('0x33')],_0xdc573c[_0x6047('0x35')]));if(_0x412a08['query'][_0x6047('0x5b')]){_0x1588b1[_0x6047('0x3e')]=_[_0x6047('0x48')](_0x1588b1['where'],{'$or':_[_0x6047('0x2f')](_0x1588b1[_0x6047('0x37')],function(_0xbc188b){var _0x379215={};_0x379215[_0xbc188b]={'$like':'%'+_0x412a08[_0x6047('0x33')][_0x6047('0x5b')]+'%'};return _0x379215;})});}_0x1588b1=_[_0x6047('0x48')]({},_0x1588b1,_0x412a08[_0x6047('0x40')]);return _0x2d6e1a[_0x6047('0x66')](_0x1588b1);}})['then'](function(_0x15ccd9){if(_0x15ccd9){_0xabf4d9=_0x15ccd9[_0x6047('0x39')];if(!_0x412a08[_0x6047('0x33')]['hasOwnProperty']('nolimit')){_0x1588b1['limit']=qs[_0x6047('0x20')](_0x412a08['query'][_0x6047('0x20')]);_0x1588b1['offset']=qs[_0x6047('0x1e')](_0x412a08[_0x6047('0x33')][_0x6047('0x1e')]);}return _0x2d6e1a[_0x6047('0x66')](_0x1588b1);}})[_0x6047('0x27')](function(_0x1b5c9c){if(_0x1b5c9c){return _0x1b5c9c?{'count':_0xabf4d9,'rows':_0x1b5c9c}:null;}})[_0x6047('0x27')](respondWithResult(_0xc3ea5b,null))[_0x6047('0x46')](handleError(_0xc3ea5b,null));};exports[_0x6047('0x67')]=function(_0x182f29,_0x5c54af,_0x3bef8c){var _0x1f59ee=_0x182f29[_0x6047('0x53')][_0x6047('0x68')];return db[_0x6047('0x65')][_0x6047('0x44')]({'where':{'id':_0x1f59ee},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6047('0x69'),'attributes':['id',_0x6047('0x2c'),_0x6047('0x6a'),_0x6047('0x6b'),_0x6047('0x6c')],'raw':!![]}]})['then'](function(_0x2468a1){if(_0x2468a1){var _0xb8f99f=_[_0x6047('0x6d')](_0x2468a1,function(_0x3106a5){var _0x212253=_0x3106a5[_0x6047('0x29')]({'plain':!![]});return _0x212253[_0x6047('0x69')];});return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x182f29[_0x6047('0x47')]['id']}})[_0x6047('0x27')](function(_0x1a4b03){return db[_0x6047('0x6e')]['transaction'](function(_0x32d18f){return _0x1a4b03[_0x6047('0x67')](_0x1f59ee,{'transaction':_0x32d18f})[_0x6047('0x27')](function(){return BPromise[_0x6047('0x6f')](_0xb8f99f,function(_0x4eb35b){return db[_0x6047('0x57')][_0x6047('0x70')]({'where':{'UserId':_0x4eb35b['id'],'OpenchannelQueueId':_0x182f29[_0x6047('0x47')]['id']},'transaction':_0x32d18f});});})['then'](function(){_0xb8f99f[_0x6047('0x71')](function(_0x15796e){socket[_0x6047('0x72')]('userOpenchannelQueue:save',{'UserId':_0x15796e['id'],'OpenchannelQueueId':_0x1a4b03['id']});});});});});}})[_0x6047('0x27')](respondWithStatusCode(_0x5c54af,null))[_0x6047('0x46')](handleError(_0x5c54af,null));};exports[_0x6047('0x73')]=function(_0x540e48,_0x2ca530,_0x52fc3d){return db[_0x6047('0x65')]['findAll']({'where':{'id':_0x540e48[_0x6047('0x33')][_0x6047('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6047('0x69'),'attributes':['id'],'raw':!![]}]})[_0x6047('0x27')](handleEntityNotFound(_0x2ca530,null))[_0x6047('0x27')](function(_0x57e115){var _0x168299=_[_0x6047('0x2f')](_0x57e115,'id');var _0x11a064=[];var _0x2b6db3=[];var _0x6dbb6b=squel[_0x6047('0x74')]();_0x6dbb6b['field'](_0x6047('0x75'))[_0x6047('0x76')]('team_has_openchannel_queues','tq')[_0x6047('0x77')](_0x6047('0x78'),'ut',_0x6047('0x79'))[_0x6047('0x3e')](_0x6047('0x7a'),_0x540e48[_0x6047('0x47')]['id']);for(var _0x1a77e3=0x0;_0x1a77e3<_0x57e115[_0x6047('0x39')];_0x1a77e3+=0x1){let _0x17ad0d=_0x57e115[_0x1a77e3];for(var _0x4c15d4=0x0;_0x4c15d4<_0x17ad0d[_0x6047('0x69')]['length'];_0x4c15d4+=0x1){let _0x1ee5cf=_0x17ad0d[_0x6047('0x69')][_0x4c15d4];var _0xa56ad9=_0x6dbb6b[_0x6047('0x7b')]();_0xa56ad9['where']('ut.UserId\x20=\x20?',_0x1ee5cf['id']);_0x2b6db3[_0x6047('0x7c')](db[_0x6047('0x6e')][_0x6047('0x33')](_0xa56ad9['toString'](),{'type':db[_0x6047('0x6e')][_0x6047('0x7d')][_0x6047('0x7e')]})[_0x6047('0x27')](function(_0x12afe1){if(_0x12afe1['length']===0x1){return _0x1ee5cf['id'];}else{var _0x29ad51=_[_0x6047('0x7f')](_['map'](_0x12afe1,_0x6047('0x80')),function(_0x24b7af){return _[_0x6047('0x81')](_0x168299,_0x24b7af);});if(_0x29ad51){return _0x1ee5cf['id'];}}}));}}return BPromise['all'](_0x2b6db3)['then'](function(_0x322ef2){_0x11a064=_(_0x11a064)[_0x6047('0x82')](_0x322ef2)['compact']()[_0x6047('0x83')]();return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x540e48[_0x6047('0x47')]['id']}})[_0x6047('0x27')](function(_0x3e8a45){return db['sequelize'][_0x6047('0x84')](function(_0xa29da8){return _0x3e8a45[_0x6047('0x73')](_0x540e48[_0x6047('0x33')][_0x6047('0x68')],{'transaction':_0xa29da8})[_0x6047('0x27')](function(){if(!_['isEmpty'](_0x11a064)){return _0x3e8a45['removeAgents'](_0x11a064,{'transaction':_0xa29da8});}})[_0x6047('0x27')](function(){_0x11a064[_0x6047('0x71')](function(_0x47ca97){socket[_0x6047('0x72')](_0x6047('0x85'),{'UserId':_0x47ca97,'OpenchannelQueueId':_0x3e8a45['id']});});});});});});})[_0x6047('0x27')](respondWithStatusCode(_0x2ca530,null))['catch'](handleError(_0x2ca530,null));};exports['addAgents']=function(_0x16c784,_0x212419,_0x33b15b){return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x16c784[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0x212419,null))[_0x6047('0x27')](function(_0x35b598){if(_0x35b598){return _0x35b598[_0x6047('0x86')](_0x16c784['body'][_0x6047('0x68')],_[_0x6047('0x87')](_0x16c784['body'],['ids','id'])||{})[_0x6047('0x88')](function(_0x2463a5){for(var _0x4aecf7=0x0;_0x4aecf7<_0x16c784[_0x6047('0x53')][_0x6047('0x68')][_0x6047('0x39')];_0x4aecf7+=0x1){socket[_0x6047('0x72')](_0x6047('0x89'),{'UserId':Number(_0x16c784[_0x6047('0x53')][_0x6047('0x68')][_0x4aecf7]),'OpenchannelQueueId':Number(_0x16c784['params']['id'])});}return _0x2463a5;});}})['then'](respondWithResult(_0x212419,null))[_0x6047('0x46')](handleError(_0x212419,null));};exports[_0x6047('0x8a')]=function(_0x14a82d,_0x933778,_0x5159c3){return db[_0x6047('0x41')][_0x6047('0x4d')]({'where':{'id':_0x14a82d['params']['id']}})[_0x6047('0x27')](handleEntityNotFound(_0x933778,null))['then'](function(_0x29ac60){if(_0x29ac60){return _0x29ac60['removeAgents'](_0x14a82d[_0x6047('0x33')][_0x6047('0x68')])[_0x6047('0x27')](function(){if(_[_0x6047('0x8b')](_0x14a82d['query'][_0x6047('0x68')])){for(var _0x23ff7d=0x0;_0x23ff7d<_0x14a82d[_0x6047('0x33')][_0x6047('0x68')][_0x6047('0x39')];_0x23ff7d+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x14a82d[_0x6047('0x33')][_0x6047('0x68')][_0x23ff7d]),'OpenchannelQueueId':Number(_0x14a82d[_0x6047('0x47')]['id'])});}}else{socket[_0x6047('0x72')](_0x6047('0x85'),{'UserId':Number(_0x14a82d[_0x6047('0x33')][_0x6047('0x68')]),'OpenchannelQueueId':Number(_0x14a82d[_0x6047('0x47')]['id'])});}});}})[_0x6047('0x27')](respondWithStatusCode(_0x933778,null))['catch'](handleError(_0x933778,null));};exports[_0x6047('0x8c')]=function(_0x2d33a1,_0x4f4fa6,_0x1537ee){var _0x83a450={};var _0x369cf7={};var _0x17828b;var _0x1cb80d;return db[_0x6047('0x41')][_0x6047('0x56')]({'where':{'id':_0x2d33a1[_0x6047('0x47')]['id']}})[_0x6047('0x27')](handleEntityNotFound(_0x4f4fa6,null))[_0x6047('0x27')](function(_0x39d3cb){if(_0x39d3cb){_0x17828b=_0x39d3cb;_0x369cf7[_0x6047('0x32')]=_[_0x6047('0x34')](db[_0x6047('0x5c')][_0x6047('0x58')]);_0x369cf7[_0x6047('0x33')]=_[_0x6047('0x34')](_0x2d33a1[_0x6047('0x33')]);_0x369cf7[_0x6047('0x35')]=_['intersection'](_0x369cf7['model'],_0x369cf7[_0x6047('0x33')]);_0x83a450['attributes']=_[_0x6047('0x36')](_0x369cf7[_0x6047('0x32')],qs[_0x6047('0x38')](_0x2d33a1[_0x6047('0x33')][_0x6047('0x38')]));_0x83a450[_0x6047('0x37')]=_0x83a450[_0x6047('0x37')]['length']?_0x83a450[_0x6047('0x37')]:_0x369cf7['model'];_0x83a450['order']=qs[_0x6047('0x3c')](_0x2d33a1['query'][_0x6047('0x3c')]);_0x83a450[_0x6047('0x3e')]=qs['filters'](_[_0x6047('0x3d')](_0x2d33a1[_0x6047('0x33')],_0x369cf7[_0x6047('0x35')]));if(_0x2d33a1['query']['filter']){_0x83a450['where']=_[_0x6047('0x48')](_0x83a450[_0x6047('0x3e')],{'$or':_[_0x6047('0x2f')](_0x83a450[_0x6047('0x37')],function(_0x3007db){var _0x4ae11e={};_0x4ae11e[_0x3007db]={'$like':'%'+_0x2d33a1['query'][_0x6047('0x5b')]+'%'};return _0x4ae11e;})});}_0x83a450=_[_0x6047('0x48')]({},_0x83a450,_0x2d33a1[_0x6047('0x40')]);return _0x17828b['getAgents'](_0x83a450);}})[_0x6047('0x27')](function(_0x7b655c){if(_0x7b655c){_0x1cb80d=_0x7b655c[_0x6047('0x39')];if(!_0x2d33a1['query'][_0x6047('0x3a')](_0x6047('0x59'))){_0x83a450[_0x6047('0x20')]=qs[_0x6047('0x20')](_0x2d33a1[_0x6047('0x33')][_0x6047('0x20')]);_0x83a450['offset']=qs[_0x6047('0x1e')](_0x2d33a1[_0x6047('0x33')][_0x6047('0x1e')]);}return _0x17828b['getAgents'](_0x83a450);}})['then'](function(_0x234271){if(_0x234271){return _0x234271?{'count':_0x1cb80d,'rows':_0x234271}:null;}})[_0x6047('0x27')](respondWithResult(_0x4f4fa6,null))['catch'](handleError(_0x4f4fa6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5ded1d2..d275c30 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 _0xe73c=['OpenchannelQueue','save','update','remove','emit','exports','events'];(function(_0x119f1c,_0x34e245){var _0x5833e2=function(_0x5d8295){while(--_0x5d8295){_0x119f1c['push'](_0x119f1c['shift']());}};_0x5833e2(++_0x34e245);}(_0xe73c,0x1e2));var _0xce73=function(_0x35fce1,_0x57933f){_0x35fce1=_0x35fce1-0x0;var _0x15e7c5=_0xe73c[_0x35fce1];return _0x15e7c5;};'use strict';var EventEmitter=require(_0xce73('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xce73('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce73('0x2'),'afterUpdate':_0xce73('0x3'),'afterDestroy':_0xce73('0x4')};function emitEvent(_0x5a4f87){return function(_0x37c421,_0xd07194,_0x199bfa){OpenchannelQueueEvents['emit'](_0x5a4f87+':'+_0x37c421['id'],_0x37c421);OpenchannelQueueEvents[_0xce73('0x5')](_0x5a4f87,_0x37c421);_0x199bfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xce73('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x152b=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x152b,0x6b));var _0xb152=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0x152b[_0x120bc2];return _0x454a41;};'use strict';var EventEmitter=require(_0xb152('0x0'));var OpenchannelQueue=require(_0xb152('0x1'))['db'][_0xb152('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xb152('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb152('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d4189){return function(_0x106030,_0x1e203b,_0xbb7941){OpenchannelQueueEvents['emit'](_0x5d4189+':'+_0x106030['id'],_0x106030);OpenchannelQueueEvents[_0xb152('0x5')](_0x5d4189,_0x106030);_0xbb7941(null);};}for(var e in events){if(events[_0xb152('0x6')](e)){var event=events[e];OpenchannelQueue[_0xb152('0x7')](e,emitEvent(event));}}module[_0xb152('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 0aeb10a..7e2bf18 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 _0x3084=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','define','OpenchannelQueue','openchannel_queues'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x3084,0x8c));var _0x4308=function(_0x2955b5,_0x1f827d){_0x2955b5=_0x2955b5-0x0;var _0x589cb8=_0x3084[_0x2955b5];return _0x589cb8;};'use strict';var _=require(_0x4308('0x0'));var util=require(_0x4308('0x1'));var logger=require(_0x4308('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4308('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4308('0x4'));var rimraf=require(_0x4308('0x5'));var config=require(_0x4308('0x6'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x25ce23,_0x119514){return _0x25ce23[_0x4308('0x7')](_0x4308('0x8'),attributes,{'tableName':_0x4308('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc2c=['../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x25682f,_0x15397d){var _0x31d484=function(_0x13fcda){while(--_0x13fcda){_0x25682f['push'](_0x25682f['shift']());}};_0x31d484(++_0x15397d);}(_0xfc2c,0x1de));var _0xcfc2=function(_0xd5a256,_0x50c914){_0xd5a256=_0xd5a256-0x0;var _0x589480=_0xfc2c[_0xd5a256];return _0x589480;};'use strict';var _=require(_0xcfc2('0x0'));var util=require('util');var logger=require(_0xcfc2('0x1'))('api');var moment=require(_0xcfc2('0x2'));var BPromise=require(_0xcfc2('0x3'));var rp=require(_0xcfc2('0x4'));var fs=require('fs');var path=require(_0xcfc2('0x5'));var rimraf=require('rimraf');var config=require(_0xcfc2('0x6'));var attributes=require(_0xcfc2('0x7'));module[_0xcfc2('0x8')]=function(_0x561b49,_0x4de919){return _0x561b49['define'](_0xcfc2('0x9'),attributes,{'tableName':_0xcfc2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 691e861..b814f00 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 _0xa53b=['OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetOpenchannelQueue','options','where','attributes','limit','include','map','model','catch','raw','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../config/logger','defaults','redis','./openchannelQueue.socket','request','then','info'];(function(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_0xa53b,0xd4));var _0xba53=function(_0x410913,_0x20c222){_0x410913=_0x410913-0x0;var _0x4ce4c5=_0xa53b[_0x410913];return _0x4ce4c5;};'use strict';var _=require(_0xba53('0x0'));var util=require(_0xba53('0x1'));var moment=require(_0xba53('0x2'));var BPromise=require(_0xba53('0x3'));var rs=require(_0xba53('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba53('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xba53('0x6')](config[_0xba53('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba53('0x7')]));require(_0xba53('0x8'))['register'](socket);function respondWithRpcPromise(_0x491338,_0x23f85f,_0x5858b2){return new BPromise(function(_0xa6b06d,_0x1d7c7e){return client[_0xba53('0x9')](_0x491338,_0x5858b2)[_0xba53('0xa')](function(_0x221d40){logger[_0xba53('0xb')](_0xba53('0xc'),_0x23f85f,_0xba53('0xd'));logger[_0xba53('0xe')](_0xba53('0xf'),_0x23f85f,_0xba53('0xd'),JSON[_0xba53('0x10')](_0x221d40));if(_0x221d40['error']){if(_0x221d40[_0xba53('0x11')][_0xba53('0x12')]===0x1f4){logger[_0xba53('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x23f85f,_0x221d40[_0xba53('0x11')][_0xba53('0x13')]);return _0x1d7c7e(_0x221d40[_0xba53('0x11')][_0xba53('0x13')]);}logger[_0xba53('0x11')](_0xba53('0xc'),_0x23f85f,_0x221d40['error']['message']);return _0xa6b06d(_0x221d40[_0xba53('0x11')][_0xba53('0x13')]);}else{logger[_0xba53('0xb')](_0xba53('0xc'),_0x23f85f,_0xba53('0xd'));_0xa6b06d(_0x221d40[_0xba53('0x14')][_0xba53('0x13')]);}})['catch'](function(_0x45c635){logger[_0xba53('0x11')](_0xba53('0xc'),_0x23f85f,_0x45c635);_0x1d7c7e(_0x45c635);});});}exports[_0xba53('0x15')]=function(_0x37baee){var _0x344786=this;return new Promise(function(_0x1b8d6f,_0xf6c213){return db['OpenchannelQueue']['findAll']({'raw':_0x37baee['options']?_0x37baee[_0xba53('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x37baee[_0xba53('0x16')]?_0x37baee[_0xba53('0x16')][_0xba53('0x17')]||null:null,'attributes':_0x37baee[_0xba53('0x16')]?_0x37baee[_0xba53('0x16')][_0xba53('0x18')]||null:null,'limit':_0x37baee['options']?_0x37baee[_0xba53('0x16')][_0xba53('0x19')]||null:null,'include':_0x37baee[_0xba53('0x16')]?_0x37baee['options'][_0xba53('0x1a')]?_[_0xba53('0x1b')](_0x37baee['options']['include'],function(_0x4feb46){return{'model':db[_0x4feb46[_0xba53('0x1c')]],'as':_0x4feb46['as'],'attributes':_0x4feb46['attributes'],'include':_0x4feb46['include']?_[_0xba53('0x1b')](_0x4feb46[_0xba53('0x1a')],function(_0x750d8e){return{'model':db[_0x750d8e['model']],'as':_0x750d8e['as'],'attributes':_0x750d8e['attributes'],'include':_0x750d8e[_0xba53('0x1a')]?_['map'](_0x750d8e[_0xba53('0x1a')],function(_0x50911e){return{'model':db[_0x50911e[_0xba53('0x1c')]],'as':_0x50911e['as'],'attributes':_0x50911e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10bf67){logger[_0xba53('0xb')](_0xba53('0x15'),_0x37baee);logger[_0xba53('0xe')]('GetOpenchannelQueue',_0x37baee,JSON[_0xba53('0x10')](_0x10bf67));_0x1b8d6f(_0x10bf67);})[_0xba53('0x1d')](function(_0x39c7c7){logger[_0xba53('0x11')](_0xba53('0x15'),_0x39c7c7[_0xba53('0x13')],_0x37baee);_0xf6c213(_0x344786[_0xba53('0x11')](0x1f4,_0x39c7c7[_0xba53('0x13')]));});});};exports['ShowOpenchannelQueue']=function(_0x545563){var _0x3f5a3b=this;return new Promise(function(_0x3fe316,_0x312f65){return db['OpenchannelQueue']['find']({'raw':_0x545563[_0xba53('0x16')]?_0x545563[_0xba53('0x16')][_0xba53('0x1e')]===undefined?!![]:![]:!![],'where':_0x545563[_0xba53('0x16')]?_0x545563['options'][_0xba53('0x17')]||null:null,'attributes':_0x545563['options']?_0x545563[_0xba53('0x16')][_0xba53('0x18')]||null:null,'include':_0x545563['options']?_0x545563[_0xba53('0x16')][_0xba53('0x1a')]?_['map'](_0x545563['options'][_0xba53('0x1a')],function(_0xd2c24a){return{'model':db[_0xd2c24a[_0xba53('0x1c')]],'as':_0xd2c24a['as'],'attributes':_0xd2c24a[_0xba53('0x18')],'include':_0xd2c24a[_0xba53('0x1a')]?_[_0xba53('0x1b')](_0xd2c24a['include'],function(_0x556f2f){return{'model':db[_0x556f2f[_0xba53('0x1c')]],'as':_0x556f2f['as'],'attributes':_0x556f2f[_0xba53('0x18')],'include':_0x556f2f['include']?_[_0xba53('0x1b')](_0x556f2f[_0xba53('0x1a')],function(_0x307bca){return{'model':db[_0x307bca['model']],'as':_0x307bca['as'],'attributes':_0x307bca[_0xba53('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4da3ce){logger[_0xba53('0xb')](_0xba53('0x1f'),_0x545563);logger[_0xba53('0xe')](_0xba53('0x1f'),_0x545563,JSON['stringify'](_0x4da3ce));_0x3fe316(_0x4da3ce);})[_0xba53('0x1d')](function(_0x22cfea){logger[_0xba53('0x11')](_0xba53('0x1f'),_0x22cfea[_0xba53('0x13')],_0x545563);_0x312f65(_0x3f5a3b['error'](0x1f4,_0x22cfea[_0xba53('0x13')]));});});}; \ No newline at end of file +var _0xdfcd=['ShowOpenchannelQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','OpenchannelQueue','findAll','options','raw','where','limit','include','model','attributes','map','GetOpenchannelQueue','stringify'];(function(_0x486d05,_0xc9cfa7){var _0x59b551=function(_0x9f1ca9){while(--_0x9f1ca9){_0x486d05['push'](_0x486d05['shift']());}};_0x59b551(++_0xc9cfa7);}(_0xdfcd,0x95));var _0xddfc=function(_0x2e34ad,_0x27e788){_0x2e34ad=_0x2e34ad-0x0;var _0x4861d2=_0xdfcd[_0x2e34ad];return _0x4861d2;};'use strict';var _=require(_0xddfc('0x0'));var util=require(_0xddfc('0x1'));var moment=require(_0xddfc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfc('0x3'));var db=require(_0xddfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xddfc('0x5'))(_0xddfc('0x6'));var config=require('../../config/environment');var jayson=require(_0xddfc('0x7'));var client=jayson[_0xddfc('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xddfc('0x9')],{'host':_0xddfc('0xa'),'port':0x18eb});var socket=require(_0xddfc('0xb'))(new Redis(config[_0xddfc('0x9')]));require(_0xddfc('0xc'))['register'](socket);function respondWithRpcPromise(_0x56c015,_0x4073d3,_0x295b21){return new BPromise(function(_0x557fa9,_0x55f30b){return client[_0xddfc('0xd')](_0x56c015,_0x295b21)[_0xddfc('0xe')](function(_0x5b6e71){logger[_0xddfc('0xf')](_0xddfc('0x10'),_0x4073d3,'request\x20sent');logger[_0xddfc('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4073d3,'request\x20sent',JSON['stringify'](_0x5b6e71));if(_0x5b6e71[_0xddfc('0x12')]){if(_0x5b6e71[_0xddfc('0x12')][_0xddfc('0x13')]===0x1f4){logger[_0xddfc('0x12')](_0xddfc('0x10'),_0x4073d3,_0x5b6e71[_0xddfc('0x12')][_0xddfc('0x14')]);return _0x55f30b(_0x5b6e71[_0xddfc('0x12')][_0xddfc('0x14')]);}logger[_0xddfc('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x4073d3,_0x5b6e71[_0xddfc('0x12')][_0xddfc('0x14')]);return _0x557fa9(_0x5b6e71[_0xddfc('0x12')][_0xddfc('0x14')]);}else{logger[_0xddfc('0xf')]('OpenchannelQueue,\x20%s,\x20%s',_0x4073d3,_0xddfc('0x15'));_0x557fa9(_0x5b6e71[_0xddfc('0x16')][_0xddfc('0x14')]);}})[_0xddfc('0x17')](function(_0x3cb103){logger['error'](_0xddfc('0x10'),_0x4073d3,_0x3cb103);_0x55f30b(_0x3cb103);});});}exports['GetOpenchannelQueue']=function(_0x59ab22){var _0x189b74=this;return new Promise(function(_0x5d5f4c,_0x125119){return db[_0xddfc('0x18')][_0xddfc('0x19')]({'raw':_0x59ab22[_0xddfc('0x1a')]?_0x59ab22[_0xddfc('0x1a')][_0xddfc('0x1b')]===undefined?!![]:![]:!![],'where':_0x59ab22[_0xddfc('0x1a')]?_0x59ab22[_0xddfc('0x1a')][_0xddfc('0x1c')]||null:null,'attributes':_0x59ab22['options']?_0x59ab22['options']['attributes']||null:null,'limit':_0x59ab22[_0xddfc('0x1a')]?_0x59ab22[_0xddfc('0x1a')][_0xddfc('0x1d')]||null:null,'include':_0x59ab22[_0xddfc('0x1a')]?_0x59ab22['options'][_0xddfc('0x1e')]?_['map'](_0x59ab22['options'][_0xddfc('0x1e')],function(_0xa49b41){return{'model':db[_0xa49b41[_0xddfc('0x1f')]],'as':_0xa49b41['as'],'attributes':_0xa49b41[_0xddfc('0x20')],'include':_0xa49b41[_0xddfc('0x1e')]?_[_0xddfc('0x21')](_0xa49b41[_0xddfc('0x1e')],function(_0x5aac4d){return{'model':db[_0x5aac4d[_0xddfc('0x1f')]],'as':_0x5aac4d['as'],'attributes':_0x5aac4d[_0xddfc('0x20')],'include':_0x5aac4d[_0xddfc('0x1e')]?_[_0xddfc('0x21')](_0x5aac4d[_0xddfc('0x1e')],function(_0x16b1c5){return{'model':db[_0x16b1c5[_0xddfc('0x1f')]],'as':_0x16b1c5['as'],'attributes':_0x16b1c5[_0xddfc('0x20')]};}):[]};}):[]};}):[]:[]})[_0xddfc('0xe')](function(_0x5b31ee){logger[_0xddfc('0xf')](_0xddfc('0x22'),_0x59ab22);logger[_0xddfc('0x11')]('GetOpenchannelQueue',_0x59ab22,JSON[_0xddfc('0x23')](_0x5b31ee));_0x5d5f4c(_0x5b31ee);})[_0xddfc('0x17')](function(_0x7a0b24){logger[_0xddfc('0x12')](_0xddfc('0x22'),_0x7a0b24['message'],_0x59ab22);_0x125119(_0x189b74[_0xddfc('0x12')](0x1f4,_0x7a0b24[_0xddfc('0x14')]));});});};exports[_0xddfc('0x24')]=function(_0x4cf71d){var _0x302c76=this;return new Promise(function(_0x1bfc8f,_0x1e1c9f){return db['OpenchannelQueue']['find']({'raw':_0x4cf71d[_0xddfc('0x1a')]?_0x4cf71d[_0xddfc('0x1a')][_0xddfc('0x1b')]===undefined?!![]:![]:!![],'where':_0x4cf71d[_0xddfc('0x1a')]?_0x4cf71d[_0xddfc('0x1a')]['where']||null:null,'attributes':_0x4cf71d[_0xddfc('0x1a')]?_0x4cf71d['options']['attributes']||null:null,'include':_0x4cf71d['options']?_0x4cf71d[_0xddfc('0x1a')][_0xddfc('0x1e')]?_[_0xddfc('0x21')](_0x4cf71d[_0xddfc('0x1a')][_0xddfc('0x1e')],function(_0x2b09b8){return{'model':db[_0x2b09b8[_0xddfc('0x1f')]],'as':_0x2b09b8['as'],'attributes':_0x2b09b8['attributes'],'include':_0x2b09b8[_0xddfc('0x1e')]?_['map'](_0x2b09b8['include'],function(_0x54021e){return{'model':db[_0x54021e[_0xddfc('0x1f')]],'as':_0x54021e['as'],'attributes':_0x54021e[_0xddfc('0x20')],'include':_0x54021e[_0xddfc('0x1e')]?_[_0xddfc('0x21')](_0x54021e[_0xddfc('0x1e')],function(_0x5cb19d){return{'model':db[_0x5cb19d[_0xddfc('0x1f')]],'as':_0x5cb19d['as'],'attributes':_0x5cb19d[_0xddfc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a1245){logger[_0xddfc('0xf')](_0xddfc('0x24'),_0x4cf71d);logger[_0xddfc('0x11')](_0xddfc('0x24'),_0x4cf71d,JSON[_0xddfc('0x23')](_0x1a1245));_0x1bfc8f(_0x1a1245);})[_0xddfc('0x17')](function(_0x5aca57){logger[_0xddfc('0x12')]('ShowOpenchannelQueue',_0x5aca57[_0xddfc('0x14')],_0x4cf71d);_0x1e1c9f(_0x302c76[_0xddfc('0x12')](0x1f4,_0x5aca57[_0xddfc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4c5887c..52bc5c2 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 _0xfdd2=['openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x141f74,_0x420286){var _0x3a462f=function(_0x4e0c27){while(--_0x4e0c27){_0x141f74['push'](_0x141f74['shift']());}};_0x3a462f(++_0x420286);}(_0xfdd2,0x1d5));var _0x2fdd=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0xfdd2[_0x5d289a];return _0x14bd5f;};'use strict';var OpenchannelQueueEvents=require(_0x2fdd('0x0'));var events=[_0x2fdd('0x1'),_0x2fdd('0x2'),_0x2fdd('0x3')];function createListener(_0x5ec3fa,_0x21504e){return function(_0x43c533){_0x21504e[_0x2fdd('0x4')](_0x5ec3fa,_0x43c533);};}function removeListener(_0x2e049f,_0x43e41f){return function(){OpenchannelQueueEvents[_0x2fdd('0x5')](_0x2e049f,_0x43e41f);};}exports[_0x2fdd('0x6')]=function(_0x46f51e){for(var _0x1f2035=0x0,_0x24870b=events[_0x2fdd('0x7')];_0x1f2035<_0x24870b;_0x1f2035++){var _0x1eb09e=events[_0x1f2035];var _0x488d79=createListener(_0x2fdd('0x8')+_0x1eb09e,_0x46f51e);OpenchannelQueueEvents['on'](_0x1eb09e,_0x488d79);}}; \ No newline at end of file +var _0xf0ae=['remove','removeListener','length','openchannelQueue:','save'];(function(_0x24d61f,_0x38cebb){var _0x29ae79=function(_0x5ae6b7){while(--_0x5ae6b7){_0x24d61f['push'](_0x24d61f['shift']());}};_0x29ae79(++_0x38cebb);}(_0xf0ae,0x14e));var _0xef0a=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xf0ae[_0x50007c];return _0x5c1ec7;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xef0a('0x0'),_0xef0a('0x1'),'update'];function createListener(_0x31b7d8,_0x288031){return function(_0x32d809){_0x288031['emit'](_0x31b7d8,_0x32d809);};}function removeListener(_0x204a3b,_0x1e8fdd){return function(){OpenchannelQueueEvents[_0xef0a('0x2')](_0x204a3b,_0x1e8fdd);};}exports['register']=function(_0x41ad25){for(var _0x1ecf1b=0x0,_0x2bc81e=events[_0xef0a('0x3')];_0x1ecf1b<_0x2bc81e;_0x1ecf1b++){var _0x47c779=events[_0x1ecf1b];var _0x2db868=createListener(_0xef0a('0x4')+_0x47c779,_0x41ad25);OpenchannelQueueEvents['on'](_0x47c779,_0x2db868);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 16dc86a..f6802e9 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 _0xd87e=['exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','create','delete','destroy'];(function(_0x1b3b90,_0x32b1a1){var _0x51c8ce=function(_0x3c1e0d){while(--_0x3c1e0d){_0x1b3b90['push'](_0x1b3b90['shift']());}};_0x51c8ce(++_0x32b1a1);}(_0xd87e,0x157));var _0xed87=function(_0x2f0f3c,_0x8a0355){_0x2f0f3c=_0x2f0f3c-0x0;var _0x50a809=_0xd87e[_0x2f0f3c];return _0x50a809;};'use strict';var multer=require(_0xed87('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xed87('0x1'));var express=require('express');var router=express[_0xed87('0x2')]();var fs_extra=require(_0xed87('0x3'));var auth=require(_0xed87('0x4'));var interaction=require(_0xed87('0x5'));var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router[_0xed87('0x8')]('/',auth['isAuthenticated'](),controller[_0xed87('0x9')]);router[_0xed87('0x8')]('/describe',auth[_0xed87('0xa')](),controller[_0xed87('0xb')]);router[_0xed87('0x8')](_0xed87('0xc'),auth['isAuthenticated'](),controller[_0xed87('0xd')]);router['post']('/',auth[_0xed87('0xa')](),controller[_0xed87('0xe')]);router['put'](_0xed87('0xc'),auth[_0xed87('0xa')](),controller['update']);router[_0xed87('0xf')](_0xed87('0xc'),auth[_0xed87('0xa')](),controller[_0xed87('0x10')]);module[_0xed87('0x11')]=router; \ No newline at end of file +var _0x1166=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x31198c,_0x1e9319){var _0x54bd4c=function(_0x547a87){while(--_0x547a87){_0x31198c['push'](_0x31198c['shift']());}};_0x54bd4c(++_0x1e9319);}(_0x1166,0x78));var _0x6116=function(_0x1b8ba0,_0x5259e3){_0x1b8ba0=_0x1b8ba0-0x0;var _0x158ad1=_0x1166[_0x1b8ba0];return _0x158ad1;};'use strict';var multer=require(_0x6116('0x0'));var util=require(_0x6116('0x1'));var path=require(_0x6116('0x2'));var timeout=require(_0x6116('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6116('0x4'));var interaction=require(_0x6116('0x5'));var config=require(_0x6116('0x6'));var controller=require(_0x6116('0x7'));router[_0x6116('0x8')]('/',auth[_0x6116('0x9')](),controller[_0x6116('0xa')]);router['get'](_0x6116('0xb'),auth[_0x6116('0x9')](),controller[_0x6116('0xc')]);router[_0x6116('0x8')](_0x6116('0xd'),auth[_0x6116('0x9')](),controller[_0x6116('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6116('0xf')]);router[_0x6116('0x10')](_0x6116('0xd'),auth[_0x6116('0x9')](),controller['update']);router[_0x6116('0x11')](_0x6116('0xd'),auth[_0x6116('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index de69fb8..4e97a17 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 _0x46fe=['DATE','moment','sequelize','exports','STRING'];(function(_0x3122a9,_0xedc0c1){var _0x26cd60=function(_0x2954d1){while(--_0x2954d1){_0x3122a9['push'](_0x3122a9['shift']());}};_0x26cd60(++_0xedc0c1);}(_0x46fe,0x1c3));var _0xe46f=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x46fe[_0xbb14db];return _0x36bed7;};'use strict';var moment=require(_0xe46f('0x0'));var Sequelize=require(_0xe46f('0x1'));module[_0xe46f('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe46f('0x3')]},'joinAt':{'type':Sequelize[_0xe46f('0x4')]},'leaveAt':{'type':Sequelize[_0xe46f('0x4')]},'acceptAt':{'type':Sequelize[_0xe46f('0x4')]},'exitAt':{'type':Sequelize[_0xe46f('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x903b=['STRING','DATE'];(function(_0x38271c,_0x592609){var _0x2cb30a=function(_0xe3e536){while(--_0xe3e536){_0x38271c['push'](_0x38271c['shift']());}};_0x2cb30a(++_0x592609);}(_0x903b,0x104));var _0xb903=function(_0x4f45bc,_0x3ea5f3){_0x4f45bc=_0x4f45bc-0x0;var _0x2c5112=_0x903b[_0x4f45bc];return _0x2c5112;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb903('0x0')]},'joinAt':{'type':Sequelize[_0xb903('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb903('0x1')]},'reason':{'type':Sequelize[_0xb903('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 6fb77c5..c320d12 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 _0xadab=['bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','OpenchannelQueueReport','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xadab,0x133));var _0xbada=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xadab[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0xbada('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbada('0x1'));var jsonpatch=require(_0xbada('0x2'));var rp=require(_0xbada('0x3'));var moment=require(_0xbada('0x4'));var BPromise=require(_0xbada('0x5'));var Mustache=require(_0xbada('0x6'));var util=require(_0xbada('0x7'));var path=require(_0xbada('0x8'));var sox=require(_0xbada('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbada('0xa'));var _=require(_0xbada('0xb'));var squel=require(_0xbada('0xc'));var crypto=require(_0xbada('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbada('0xe'));var toCsv=require(_0xbada('0xf'));var querystring=require(_0xbada('0x10'));var Papa=require(_0xbada('0x11'));var Redis=require(_0xbada('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbada('0x13'));var as=require(_0xbada('0x14'));var hardwareService=require(_0xbada('0x15'));var logger=require('../../config/logger')(_0xbada('0x16'));var utils=require('../../config/utils');var config=require(_0xbada('0x17'));var licenseUtil=require(_0xbada('0x18'));var db=require(_0xbada('0x19'))['db'];function respondWithStatusCode(_0x198a21,_0x589181){_0x589181=_0x589181||0xcc;return function(_0x120d5e){if(_0x120d5e){return _0x198a21[_0xbada('0x1a')](_0x589181);}return _0x198a21[_0xbada('0x1b')](_0x589181)[_0xbada('0x1c')]();};}function respondWithResult(_0x491e5c,_0x31877a){_0x31877a=_0x31877a||0xc8;return function(_0x475aa5){if(_0x475aa5){return _0x491e5c[_0xbada('0x1b')](_0x31877a)[_0xbada('0x1d')](_0x475aa5);}};}function respondWithFilteredResult(_0x2145aa,_0x41110e){return function(_0x5e5f13){if(_0x5e5f13){var _0x45a149=typeof _0x41110e[_0xbada('0x1e')]===_0xbada('0x1f')&&typeof _0x41110e[_0xbada('0x20')]==='undefined';var _0x3917b0=_0x5e5f13[_0xbada('0x21')];var _0x198f89=_0x45a149?0x0:_0x41110e[_0xbada('0x1e')];var _0x28b3c3=_0x45a149?_0x5e5f13['count']:_0x41110e[_0xbada('0x1e')]+_0x41110e[_0xbada('0x20')];var _0x4bcdd5;if(_0x28b3c3>=_0x3917b0){_0x28b3c3=_0x3917b0;_0x4bcdd5=0xc8;}else{_0x4bcdd5=0xce;}_0x2145aa[_0xbada('0x1b')](_0x4bcdd5);return _0x2145aa[_0xbada('0x22')](_0xbada('0x23'),_0x198f89+'-'+_0x28b3c3+'/'+_0x3917b0)[_0xbada('0x1d')](_0x5e5f13);}return null;};}function patchUpdates(_0x293c8a){return function(_0x28ea3d){try{jsonpatch[_0xbada('0x24')](_0x28ea3d,_0x293c8a,!![]);}catch(_0xf2ca5f){return BPromise[_0xbada('0x25')](_0xf2ca5f);}return _0x28ea3d[_0xbada('0x26')]();};}function saveUpdates(_0x43c152,_0x157b48){return function(_0x3207b9){if(_0x3207b9){return _0x3207b9[_0xbada('0x27')](_0x43c152)[_0xbada('0x28')](function(_0x19df1a){return _0x19df1a;});}return null;};}function removeEntity(_0x4dd945,_0x33bae7){return function(_0x2e486b){if(_0x2e486b){return _0x2e486b[_0xbada('0x29')]()[_0xbada('0x28')](function(){_0x4dd945[_0xbada('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34b197,_0x539431){return function(_0x5354c8){if(!_0x5354c8){_0x34b197['sendStatus'](0x194);}return _0x5354c8;};}function handleError(_0x1f7934,_0xe9358b){_0xe9358b=_0xe9358b||0x1f4;return function(_0xf652eb){logger['error'](_0xf652eb['stack']);if(_0xf652eb[_0xbada('0x2a')]){delete _0xf652eb[_0xbada('0x2a')];}_0x1f7934['status'](_0xe9358b)[_0xbada('0x2b')](_0xf652eb);};}exports['index']=function(_0x415c6b,_0x5a855c){var _0x4cf5d2={},_0x44e75c={},_0x2c85c7={'count':0x0,'rows':[]};var _0x464c55=_[_0xbada('0x2c')](db['OpenchannelQueueReport'][_0xbada('0x2d')],function(_0x4980f8){return{'name':_0x4980f8[_0xbada('0x2e')],'type':_0x4980f8[_0xbada('0x2f')][_0xbada('0x30')]};});_0x44e75c[_0xbada('0x31')]=_[_0xbada('0x2c')](_0x464c55,_0xbada('0x2a'));_0x44e75c['query']=_['keys'](_0x415c6b[_0xbada('0x32')]);_0x44e75c[_0xbada('0x33')]=_[_0xbada('0x34')](_0x44e75c[_0xbada('0x31')],_0x44e75c[_0xbada('0x32')]);_0x4cf5d2[_0xbada('0x35')]=_[_0xbada('0x34')](_0x44e75c[_0xbada('0x31')],qs[_0xbada('0x36')](_0x415c6b[_0xbada('0x32')][_0xbada('0x36')]));_0x4cf5d2[_0xbada('0x35')]=_0x4cf5d2[_0xbada('0x35')][_0xbada('0x37')]?_0x4cf5d2[_0xbada('0x35')]:_0x44e75c[_0xbada('0x31')];if(!_0x415c6b[_0xbada('0x32')][_0xbada('0x38')](_0xbada('0x39'))){_0x4cf5d2['limit']=qs[_0xbada('0x20')](_0x415c6b[_0xbada('0x32')][_0xbada('0x20')]);_0x4cf5d2[_0xbada('0x1e')]=qs['offset'](_0x415c6b[_0xbada('0x32')]['offset']);}_0x4cf5d2['order']=qs[_0xbada('0x3a')](_0x415c6b[_0xbada('0x32')][_0xbada('0x3a')]);_0x4cf5d2['where']=qs[_0xbada('0x33')](_[_0xbada('0x3b')](_0x415c6b[_0xbada('0x32')],_0x44e75c['filters']),_0x464c55);if(_0x415c6b[_0xbada('0x32')][_0xbada('0x3c')]){_0x4cf5d2[_0xbada('0x3d')]=_[_0xbada('0x3e')](_0x4cf5d2['where'],{'$or':_[_0xbada('0x2c')](_0x464c55,function(_0x490f3f){if(_0x490f3f[_0xbada('0x2f')]!==_0xbada('0x3f')){var _0x5b5950={};_0x5b5950[_0x490f3f[_0xbada('0x2a')]]={'$like':'%'+_0x415c6b[_0xbada('0x32')]['filter']+'%'};return _0x5b5950;}})});}_0x4cf5d2=_[_0xbada('0x3e')]({},_0x4cf5d2,_0x415c6b['options']);var _0x5a3dca={'where':_0x4cf5d2[_0xbada('0x3d')]};return db[_0xbada('0x40')][_0xbada('0x21')](_0x5a3dca)[_0xbada('0x28')](function(_0x2a3ae6){_0x2c85c7[_0xbada('0x21')]=_0x2a3ae6;if(_0x415c6b[_0xbada('0x32')]['includeAll']){_0x4cf5d2[_0xbada('0x41')]=[{'all':!![]}];}return db[_0xbada('0x40')][_0xbada('0x42')](_0x4cf5d2);})[_0xbada('0x28')](function(_0x329125){_0x2c85c7[_0xbada('0x43')]=_0x329125;return _0x2c85c7;})[_0xbada('0x28')](respondWithFilteredResult(_0x5a855c,_0x4cf5d2))[_0xbada('0x44')](handleError(_0x5a855c,null));};exports[_0xbada('0x45')]=function(_0x4ba6be,_0x83c1ba){var _0x12dec1={'raw':!![],'where':{'id':_0x4ba6be[_0xbada('0x46')]['id']}},_0xcb28af={};_0xcb28af[_0xbada('0x31')]=_[_0xbada('0x47')](db[_0xbada('0x40')][_0xbada('0x2d')]);_0xcb28af['query']=_[_0xbada('0x47')](_0x4ba6be[_0xbada('0x32')]);_0xcb28af[_0xbada('0x33')]=_['intersection'](_0xcb28af['model'],_0xcb28af['query']);_0x12dec1[_0xbada('0x35')]=_['intersection'](_0xcb28af[_0xbada('0x31')],qs[_0xbada('0x36')](_0x4ba6be[_0xbada('0x32')][_0xbada('0x36')]));_0x12dec1[_0xbada('0x35')]=_0x12dec1[_0xbada('0x35')]['length']?_0x12dec1['attributes']:_0xcb28af[_0xbada('0x31')];if(_0x4ba6be[_0xbada('0x32')][_0xbada('0x48')]){_0x12dec1[_0xbada('0x41')]=[{'all':!![]}];}_0x12dec1=_['merge']({},_0x12dec1,_0x4ba6be[_0xbada('0x49')]);return db['OpenchannelQueueReport'][_0xbada('0x4a')](_0x12dec1)[_0xbada('0x28')](handleEntityNotFound(_0x83c1ba,null))[_0xbada('0x28')](respondWithResult(_0x83c1ba,null))[_0xbada('0x44')](handleError(_0x83c1ba,null));};exports[_0xbada('0x4b')]=function(_0x4f88d9,_0x18a59e){return db[_0xbada('0x40')]['create'](_0x4f88d9[_0xbada('0x4c')],{})[_0xbada('0x28')](respondWithResult(_0x18a59e,0xc9))['catch'](handleError(_0x18a59e,null));};exports[_0xbada('0x27')]=function(_0x4a281a,_0x5ee117){if(_0x4a281a[_0xbada('0x4c')]['id']){delete _0x4a281a['body']['id'];}return db[_0xbada('0x40')][_0xbada('0x4a')]({'where':{'id':_0x4a281a[_0xbada('0x46')]['id']}})[_0xbada('0x28')](handleEntityNotFound(_0x5ee117,null))[_0xbada('0x28')](saveUpdates(_0x4a281a[_0xbada('0x4c')],null))[_0xbada('0x28')](respondWithResult(_0x5ee117,null))[_0xbada('0x44')](handleError(_0x5ee117,null));};exports['destroy']=function(_0xde9719,_0x4c39bb){return db['OpenchannelQueueReport'][_0xbada('0x4a')]({'where':{'id':_0xde9719['params']['id']}})[_0xbada('0x28')](handleEntityNotFound(_0x4c39bb,null))[_0xbada('0x28')](removeEntity(_0x4c39bb,null))[_0xbada('0x44')](handleError(_0x4c39bb,null));};exports[_0xbada('0x4d')]=function(_0x26cb8c,_0x383d91){return db[_0xbada('0x40')][_0xbada('0x4d')]()[_0xbada('0x28')](respondWithResult(_0x383d91,null))[_0xbada('0x44')](handleError(_0x383d91,null));}; \ No newline at end of file +var _0x114b=['intersection','fields','length','order','sort','where','filter','merge','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','catch','create','body','update','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','query','filters','model','attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x114b,0xab));var _0xb114=function(_0x4a94e0,_0x382da1){_0x4a94e0=_0x4a94e0-0x0;var _0x173576=_0x114b[_0x4a94e0];return _0x173576;};'use strict';var emlformat=require(_0xb114('0x0'));var rimraf=require(_0xb114('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb114('0x2'));var rp=require('request-promise');var moment=require(_0xb114('0x3'));var BPromise=require(_0xb114('0x4'));var Mustache=require(_0xb114('0x5'));var util=require(_0xb114('0x6'));var path=require(_0xb114('0x7'));var sox=require(_0xb114('0x8'));var csv=require('to-csv');var ejs=require(_0xb114('0x9'));var fs=require('fs');var fs_extra=require(_0xb114('0xa'));var _=require(_0xb114('0xb'));var squel=require(_0xb114('0xc'));var crypto=require(_0xb114('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb114('0xe'));var querystring=require(_0xb114('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb114('0x10'));var qs=require(_0xb114('0x11'));var as=require(_0xb114('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb114('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb114('0x14'));var licenseUtil=require(_0xb114('0x15'));var db=require(_0xb114('0x16'))['db'];function respondWithStatusCode(_0x392fcf,_0x2dbff0){_0x2dbff0=_0x2dbff0||0xcc;return function(_0x1b5273){if(_0x1b5273){return _0x392fcf[_0xb114('0x17')](_0x2dbff0);}return _0x392fcf['status'](_0x2dbff0)['end']();};}function respondWithResult(_0x196325,_0x3fe3cd){_0x3fe3cd=_0x3fe3cd||0xc8;return function(_0x15c6d9){if(_0x15c6d9){return _0x196325['status'](_0x3fe3cd)[_0xb114('0x18')](_0x15c6d9);}};}function respondWithFilteredResult(_0x5086e3,_0x547e25){return function(_0x203815){if(_0x203815){var _0x20f570=typeof _0x547e25[_0xb114('0x19')]==='undefined'&&typeof _0x547e25[_0xb114('0x1a')]===_0xb114('0x1b');var _0x546aff=_0x203815['count'];var _0x39ae4a=_0x20f570?0x0:_0x547e25[_0xb114('0x19')];var _0x3503f2=_0x20f570?_0x203815['count']:_0x547e25[_0xb114('0x19')]+_0x547e25[_0xb114('0x1a')];var _0x7912a5;if(_0x3503f2>=_0x546aff){_0x3503f2=_0x546aff;_0x7912a5=0xc8;}else{_0x7912a5=0xce;}_0x5086e3[_0xb114('0x1c')](_0x7912a5);return _0x5086e3[_0xb114('0x1d')](_0xb114('0x1e'),_0x39ae4a+'-'+_0x3503f2+'/'+_0x546aff)['json'](_0x203815);}return null;};}function patchUpdates(_0xe4d376){return function(_0x3eff0c){try{jsonpatch[_0xb114('0x1f')](_0x3eff0c,_0xe4d376,!![]);}catch(_0x22625d){return BPromise[_0xb114('0x20')](_0x22625d);}return _0x3eff0c[_0xb114('0x21')]();};}function saveUpdates(_0x184617,_0xa0db32){return function(_0x4258ff){if(_0x4258ff){return _0x4258ff['update'](_0x184617)[_0xb114('0x22')](function(_0x29da58){return _0x29da58;});}return null;};}function removeEntity(_0x1e2efd,_0x22a935){return function(_0x5cf3d9){if(_0x5cf3d9){return _0x5cf3d9[_0xb114('0x23')]()[_0xb114('0x22')](function(){_0x1e2efd[_0xb114('0x1c')](0xcc)[_0xb114('0x24')]();});}};}function handleEntityNotFound(_0x560c66,_0x36fd26){return function(_0x3ca1a9){if(!_0x3ca1a9){_0x560c66[_0xb114('0x17')](0x194);}return _0x3ca1a9;};}function handleError(_0x28035e,_0x10a75e){_0x10a75e=_0x10a75e||0x1f4;return function(_0x509efc){logger[_0xb114('0x25')](_0x509efc[_0xb114('0x26')]);if(_0x509efc['name']){delete _0x509efc[_0xb114('0x27')];}_0x28035e[_0xb114('0x1c')](_0x10a75e)[_0xb114('0x28')](_0x509efc);};}exports[_0xb114('0x29')]=function(_0x472312,_0x1ccf08){var _0x4582e1={},_0x480231={},_0x2c6d77={'count':0x0,'rows':[]};var _0x510896=_[_0xb114('0x2a')](db[_0xb114('0x2b')]['rawAttributes'],function(_0x2a3716){return{'name':_0x2a3716[_0xb114('0x2c')],'type':_0x2a3716[_0xb114('0x2d')][_0xb114('0x2e')]};});_0x480231['model']=_[_0xb114('0x2a')](_0x510896,_0xb114('0x27'));_0x480231[_0xb114('0x2f')]=_['keys'](_0x472312[_0xb114('0x2f')]);_0x480231[_0xb114('0x30')]=_['intersection'](_0x480231[_0xb114('0x31')],_0x480231[_0xb114('0x2f')]);_0x4582e1[_0xb114('0x32')]=_[_0xb114('0x33')](_0x480231[_0xb114('0x31')],qs['fields'](_0x472312['query'][_0xb114('0x34')]));_0x4582e1[_0xb114('0x32')]=_0x4582e1[_0xb114('0x32')][_0xb114('0x35')]?_0x4582e1['attributes']:_0x480231[_0xb114('0x31')];if(!_0x472312['query']['hasOwnProperty']('nolimit')){_0x4582e1['limit']=qs[_0xb114('0x1a')](_0x472312['query']['limit']);_0x4582e1[_0xb114('0x19')]=qs['offset'](_0x472312[_0xb114('0x2f')][_0xb114('0x19')]);}_0x4582e1[_0xb114('0x36')]=qs['sort'](_0x472312[_0xb114('0x2f')][_0xb114('0x37')]);_0x4582e1[_0xb114('0x38')]=qs[_0xb114('0x30')](_['pick'](_0x472312[_0xb114('0x2f')],_0x480231[_0xb114('0x30')]),_0x510896);if(_0x472312[_0xb114('0x2f')][_0xb114('0x39')]){_0x4582e1['where']=_[_0xb114('0x3a')](_0x4582e1['where'],{'$or':_['map'](_0x510896,function(_0x48643f){if(_0x48643f[_0xb114('0x2d')]!=='VIRTUAL'){var _0x536676={};_0x536676[_0x48643f[_0xb114('0x27')]]={'$like':'%'+_0x472312['query'][_0xb114('0x39')]+'%'};return _0x536676;}})});}_0x4582e1=_[_0xb114('0x3a')]({},_0x4582e1,_0x472312['options']);var _0x4a0d20={'where':_0x4582e1['where']};return db['OpenchannelQueueReport'][_0xb114('0x3b')](_0x4a0d20)[_0xb114('0x22')](function(_0x48c800){_0x2c6d77[_0xb114('0x3b')]=_0x48c800;if(_0x472312['query'][_0xb114('0x3c')]){_0x4582e1[_0xb114('0x3d')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb114('0x3e')](_0x4582e1);})['then'](function(_0x1ac7e2){_0x2c6d77[_0xb114('0x3f')]=_0x1ac7e2;return _0x2c6d77;})[_0xb114('0x22')](respondWithFilteredResult(_0x1ccf08,_0x4582e1))['catch'](handleError(_0x1ccf08,null));};exports[_0xb114('0x40')]=function(_0x162ee1,_0x43afe9){var _0x33cec0={'raw':!![],'where':{'id':_0x162ee1[_0xb114('0x41')]['id']}},_0x494633={};_0x494633[_0xb114('0x31')]=_[_0xb114('0x42')](db['OpenchannelQueueReport'][_0xb114('0x43')]);_0x494633[_0xb114('0x2f')]=_[_0xb114('0x42')](_0x162ee1[_0xb114('0x2f')]);_0x494633['filters']=_[_0xb114('0x33')](_0x494633[_0xb114('0x31')],_0x494633[_0xb114('0x2f')]);_0x33cec0[_0xb114('0x32')]=_[_0xb114('0x33')](_0x494633[_0xb114('0x31')],qs[_0xb114('0x34')](_0x162ee1[_0xb114('0x2f')][_0xb114('0x34')]));_0x33cec0[_0xb114('0x32')]=_0x33cec0[_0xb114('0x32')][_0xb114('0x35')]?_0x33cec0[_0xb114('0x32')]:_0x494633[_0xb114('0x31')];if(_0x162ee1['query'][_0xb114('0x3c')]){_0x33cec0[_0xb114('0x3d')]=[{'all':!![]}];}_0x33cec0=_[_0xb114('0x3a')]({},_0x33cec0,_0x162ee1['options']);return db[_0xb114('0x2b')]['find'](_0x33cec0)['then'](handleEntityNotFound(_0x43afe9,null))['then'](respondWithResult(_0x43afe9,null))[_0xb114('0x44')](handleError(_0x43afe9,null));};exports[_0xb114('0x45')]=function(_0x3aee07,_0x3acae6){return db[_0xb114('0x2b')][_0xb114('0x45')](_0x3aee07[_0xb114('0x46')],{})['then'](respondWithResult(_0x3acae6,0xc9))[_0xb114('0x44')](handleError(_0x3acae6,null));};exports[_0xb114('0x47')]=function(_0x5f11b9,_0x1e2a60){if(_0x5f11b9[_0xb114('0x46')]['id']){delete _0x5f11b9[_0xb114('0x46')]['id'];}return db[_0xb114('0x2b')]['find']({'where':{'id':_0x5f11b9[_0xb114('0x41')]['id']}})[_0xb114('0x22')](handleEntityNotFound(_0x1e2a60,null))[_0xb114('0x22')](saveUpdates(_0x5f11b9[_0xb114('0x46')],null))[_0xb114('0x22')](respondWithResult(_0x1e2a60,null))[_0xb114('0x44')](handleError(_0x1e2a60,null));};exports[_0xb114('0x23')]=function(_0x51d6cb,_0x1051f0){return db[_0xb114('0x2b')][_0xb114('0x48')]({'where':{'id':_0x51d6cb[_0xb114('0x41')]['id']}})[_0xb114('0x22')](handleEntityNotFound(_0x1051f0,null))['then'](removeEntity(_0x1051f0,null))[_0xb114('0x44')](handleError(_0x1051f0,null));};exports[_0xb114('0x49')]=function(_0x4903a0,_0xb235ce){return db[_0xb114('0x2b')][_0xb114('0x49')]()[_0xb114('0x22')](respondWithResult(_0xb235ce,null))[_0xb114('0x44')](handleError(_0xb235ce,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index efe987e..d923bcf 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 _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x250a58,_0x584f22){var _0x34eb85=function(_0x1d4f79){while(--_0x1d4f79){_0x250a58['push'](_0x250a58['shift']());}};_0x34eb85(++_0x584f22);}(_0x7a54,0x106));var _0x47a5=function(_0x493ae7,_0x1d33be){_0x493ae7=_0x493ae7-0x0;var _0xd89966=_0x7a54[_0x493ae7];return _0xd89966;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x5fc3[_0xd0b415];return _0x2bdf2c;};'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')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 7fefdef..9f13246 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 _0x160f=['stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3fc319,_0x5addd8){var _0x44bae9=function(_0x9653c3){while(--_0x9653c3){_0x3fc319['push'](_0x3fc319['shift']());}};_0x44bae9(++_0x5addd8);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')](_0x4b8185[_0xf160('0x19')],{'raw':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x40ccf0){logger[_0xf160('0xd')](_0xf160('0x16'),_0x4b8185);logger['debug'](_0xf160('0x16'),_0x4b8185,JSON[_0xf160('0x11')](_0x40ccf0));_0x1cf6ba(_0x40ccf0);})[_0xf160('0x15')](function(_0x36d0cb){logger[_0xf160('0x12')](_0xf160('0x16'),_0x36d0cb[_0xf160('0x14')],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0x36d0cb[_0xf160('0x14')]));});});};exports[_0xf160('0x1c')]=function(_0x305f6a){var _0x49bb5c=this;return new Promise(function(_0x578f7d,_0x42458c){return db[_0xf160('0x17')]['update'](_0x305f6a['body'],{'raw':_0x305f6a[_0xf160('0x1a')]?_0x305f6a[_0xf160('0x1a')][_0xf160('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x305f6a['options']?_0x305f6a[_0xf160('0x1a')][_0xf160('0x1d')]||null:null,'attributes':_0x305f6a[_0xf160('0x1a')]?_0x305f6a[_0xf160('0x1a')][_0xf160('0x1e')]||null:null,'limit':_0x305f6a[_0xf160('0x1a')]?_0x305f6a['options']['limit']||null:null})['then'](function(_0x26e7b9){logger[_0xf160('0xd')](_0xf160('0x1c'),_0x305f6a);logger[_0xf160('0x1f')](_0xf160('0x1c'),_0x305f6a,JSON['stringify'](_0x26e7b9));_0x578f7d(_0x26e7b9);})['catch'](function(_0x329d6b){logger['error']('UpdateOpenchannelQueueReport',_0x329d6b[_0xf160('0x14')],_0x305f6a);_0x42458c(_0x49bb5c[_0xf160('0x12')](0x1f4,_0x329d6b['message']));});});}; \ No newline at end of file +var _0x8580=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','where','attributes','limit','then','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','create','body','options','raw'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8580,0x1c7));var _0x0858=function(_0x232aff,_0x3de237){_0x232aff=_0x232aff-0x0;var _0x4cdb09=_0x8580[_0x232aff];return _0x4cdb09;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3515b4,_0x38e3f7,_0x4981a7){return new BPromise(function(_0x9c611c,_0x3ae92b){return client[_0x0858('0x8')](_0x3515b4,_0x4981a7)['then'](function(_0x4ceffb){logger[_0x0858('0x9')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x38e3f7,_0x0858('0xa'));logger[_0x0858('0xb')](_0x0858('0xc'),_0x38e3f7,_0x0858('0xa'),JSON[_0x0858('0xd')](_0x4ceffb));if(_0x4ceffb[_0x0858('0xe')]){if(_0x4ceffb[_0x0858('0xe')][_0x0858('0xf')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x38e3f7,_0x4ceffb[_0x0858('0xe')]['message']);return _0x3ae92b(_0x4ceffb['error']['message']);}logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x4ceffb['error'][_0x0858('0x11')]);return _0x9c611c(_0x4ceffb[_0x0858('0xe')][_0x0858('0x11')]);}else{logger[_0x0858('0x9')](_0x0858('0x10'),_0x38e3f7,_0x0858('0xa'));_0x9c611c(_0x4ceffb[_0x0858('0x12')][_0x0858('0x11')]);}})[_0x0858('0x13')](function(_0x39e967){logger[_0x0858('0xe')](_0x0858('0x10'),_0x38e3f7,_0x39e967);_0x3ae92b(_0x39e967);});});}exports['CreateOpenchannelQueueReport']=function(_0x2b73c2){var _0x4d376b=this;return new Promise(function(_0x284ebd,_0x37f90b){return db[_0x0858('0x14')][_0x0858('0x15')](_0x2b73c2[_0x0858('0x16')],{'raw':_0x2b73c2['options']?_0x2b73c2[_0x0858('0x17')][_0x0858('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1ea1a7){logger['info']('CreateOpenchannelQueueReport',_0x2b73c2);logger[_0x0858('0xb')](_0x0858('0x19'),_0x2b73c2,JSON[_0x0858('0xd')](_0x1ea1a7));_0x284ebd(_0x1ea1a7);})[_0x0858('0x13')](function(_0x29ac2b){logger['error'](_0x0858('0x19'),_0x29ac2b['message'],_0x2b73c2);_0x37f90b(_0x4d376b[_0x0858('0xe')](0x1f4,_0x29ac2b['message']));});});};exports[_0x0858('0x1a')]=function(_0x425745){var _0x32d21d=this;return new Promise(function(_0xdd5116,_0x4fe016){return db[_0x0858('0x14')][_0x0858('0x1b')](_0x425745[_0x0858('0x16')],{'raw':_0x425745[_0x0858('0x17')]?_0x425745[_0x0858('0x17')][_0x0858('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x425745[_0x0858('0x17')]?_0x425745[_0x0858('0x17')][_0x0858('0x1c')]||null:null,'attributes':_0x425745[_0x0858('0x17')]?_0x425745[_0x0858('0x17')][_0x0858('0x1d')]||null:null,'limit':_0x425745[_0x0858('0x17')]?_0x425745[_0x0858('0x17')][_0x0858('0x1e')]||null:null})[_0x0858('0x1f')](function(_0x2607c1){logger[_0x0858('0x9')]('UpdateOpenchannelQueueReport',_0x425745);logger[_0x0858('0xb')](_0x0858('0x1a'),_0x425745,JSON[_0x0858('0xd')](_0x2607c1));_0xdd5116(_0x2607c1);})[_0x0858('0x13')](function(_0xdcbd78){logger[_0x0858('0xe')](_0x0858('0x1a'),_0xdcbd78[_0x0858('0x11')],_0x425745);_0x4fe016(_0x32d21d['error'](0x1f4,_0xdcbd78[_0x0858('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index ce43881..658f766 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 _0x511d=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports'];(function(_0x1ffa67,_0x918d89){var _0x346b96=function(_0x236736){while(--_0x236736){_0x1ffa67['push'](_0x1ffa67['shift']());}};_0x346b96(++_0x918d89);}(_0x511d,0xbe));var _0xd511=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x511d[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0xd511('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd511('0x1'));var express=require(_0xd511('0x2'));var router=express[_0xd511('0x3')]();var fs_extra=require(_0xd511('0x4'));var auth=require(_0xd511('0x5'));var interaction=require(_0xd511('0x6'));var config=require(_0xd511('0x7'));var controller=require(_0xd511('0x8'));router[_0xd511('0x9')]('/',auth[_0xd511('0xa')](),controller['index']);router[_0xd511('0x9')]('/describe',auth[_0xd511('0xa')](),controller[_0xd511('0xb')]);router[_0xd511('0x9')](_0xd511('0xc'),auth[_0xd511('0xa')](),controller['show']);router[_0xd511('0xd')]('/',auth[_0xd511('0xa')](),controller[_0xd511('0xe')]);router[_0xd511('0xf')]('/:id',auth[_0xd511('0xa')](),controller['update']);router[_0xd511('0x10')](_0xd511('0xc'),auth[_0xd511('0xa')](),controller[_0xd511('0x11')]);module[_0xd511('0x12')]=router; \ No newline at end of file +var _0x99da=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update'];(function(_0x302135,_0x22357c){var _0xf9322a=function(_0x2d050f){while(--_0x2d050f){_0x302135['push'](_0x302135['shift']());}};_0xf9322a(++_0x22357c);}(_0x99da,0x100));var _0xa99d=function(_0x5e1f24,_0x442000){_0x5e1f24=_0x5e1f24-0x0;var _0x53823d=_0x99da[_0x5e1f24];return _0x53823d;};'use strict';var multer=require(_0xa99d('0x0'));var util=require(_0xa99d('0x1'));var path=require(_0xa99d('0x2'));var timeout=require(_0xa99d('0x3'));var express=require(_0xa99d('0x4'));var router=express[_0xa99d('0x5')]();var fs_extra=require(_0xa99d('0x6'));var auth=require(_0xa99d('0x7'));var interaction=require(_0xa99d('0x8'));var config=require(_0xa99d('0x9'));var controller=require(_0xa99d('0xa'));router[_0xa99d('0xb')]('/',auth[_0xa99d('0xc')](),controller['index']);router['get'](_0xa99d('0xd'),auth['isAuthenticated'](),controller[_0xa99d('0xe')]);router[_0xa99d('0xb')](_0xa99d('0xf'),auth[_0xa99d('0xc')](),controller[_0xa99d('0x10')]);router[_0xa99d('0x11')]('/',auth[_0xa99d('0xc')](),controller[_0xa99d('0x12')]);router['put'](_0xa99d('0xf'),auth[_0xa99d('0xc')](),controller[_0xa99d('0x13')]);router[_0xa99d('0x14')](_0xa99d('0xf'),auth[_0xa99d('0xc')](),controller[_0xa99d('0x15')]);module[_0xa99d('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index a313637..e24ae62 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xfd51a1,_0x18da20){var _0x2b166f=function(_0x1583cd){while(--_0x1583cd){_0xfd51a1['push'](_0xfd51a1['shift']());}};_0x2b166f(++_0x18da20);}(_0x00bb,0x1d8));var _0xb00b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x00bb[_0x618414];return _0x21c19a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x193f0a,_0xa0db18){_0x193f0a=_0x193f0a-0x0;var _0x14dc1b=_0xb43b[_0x193f0a];return _0x14dc1b;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index eac3025..6ce3502 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 _0xa4dd=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3a2787,_0x11e9bf){var _0x5e4bf1=function(_0x36bfb7){while(--_0x36bfb7){_0x3a2787['push'](_0x3a2787['shift']());}};_0x5e4bf1(++_0x11e9bf);}(_0xa4dd,0xd2));var _0xda4d=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xa4dd[_0xdf3db6];return _0x4b7a65;};'use strict';var emlformat=require(_0xda4d('0x0'));var rimraf=require(_0xda4d('0x1'));var zipdir=require(_0xda4d('0x2'));var jsonpatch=require(_0xda4d('0x3'));var rp=require(_0xda4d('0x4'));var moment=require(_0xda4d('0x5'));var BPromise=require(_0xda4d('0x6'));var Mustache=require(_0xda4d('0x7'));var util=require(_0xda4d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xda4d('0x9'));var ejs=require(_0xda4d('0xa'));var fs=require('fs');var fs_extra=require(_0xda4d('0xb'));var _=require(_0xda4d('0xc'));var squel=require(_0xda4d('0xd'));var crypto=require(_0xda4d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xda4d('0xf'));var toCsv=require(_0xda4d('0x9'));var querystring=require(_0xda4d('0x10'));var Papa=require(_0xda4d('0x11'));var Redis=require(_0xda4d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xda4d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda4d('0x14'));var logger=require('../../config/logger')(_0xda4d('0x15'));var utils=require(_0xda4d('0x16'));var config=require(_0xda4d('0x17'));var licenseUtil=require(_0xda4d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3defd5,_0x3d57cc){_0x3d57cc=_0x3d57cc||0xcc;return function(_0x3eea07){if(_0x3eea07){return _0x3defd5[_0xda4d('0x19')](_0x3d57cc);}return _0x3defd5[_0xda4d('0x1a')](_0x3d57cc)[_0xda4d('0x1b')]();};}function respondWithResult(_0x57f2b6,_0x3ad97b){_0x3ad97b=_0x3ad97b||0xc8;return function(_0x51065c){if(_0x51065c){return _0x57f2b6[_0xda4d('0x1a')](_0x3ad97b)[_0xda4d('0x1c')](_0x51065c);}};}function respondWithFilteredResult(_0x131d76,_0x4aa5d3){return function(_0x1cb22f){if(_0x1cb22f){var _0xf53a88=typeof _0x4aa5d3[_0xda4d('0x1d')]===_0xda4d('0x1e')&&typeof _0x4aa5d3['limit']===_0xda4d('0x1e');var _0x377d0b=_0x1cb22f['count'];var _0x4ba7bb=_0xf53a88?0x0:_0x4aa5d3[_0xda4d('0x1d')];var _0x539142=_0xf53a88?_0x1cb22f[_0xda4d('0x1f')]:_0x4aa5d3[_0xda4d('0x1d')]+_0x4aa5d3[_0xda4d('0x20')];var _0x505a73;if(_0x539142>=_0x377d0b){_0x539142=_0x377d0b;_0x505a73=0xc8;}else{_0x505a73=0xce;}_0x131d76['status'](_0x505a73);return _0x131d76[_0xda4d('0x21')](_0xda4d('0x22'),_0x4ba7bb+'-'+_0x539142+'/'+_0x377d0b)[_0xda4d('0x1c')](_0x1cb22f);}return null;};}function patchUpdates(_0x3de147){return function(_0x5d4bf0){try{jsonpatch[_0xda4d('0x23')](_0x5d4bf0,_0x3de147,!![]);}catch(_0x5d70da){return BPromise[_0xda4d('0x24')](_0x5d70da);}return _0x5d4bf0[_0xda4d('0x25')]();};}function saveUpdates(_0x16be1b,_0x504974){return function(_0x4eb93a){if(_0x4eb93a){return _0x4eb93a['update'](_0x16be1b)['then'](function(_0x5eda69){return _0x5eda69;});}return null;};}function removeEntity(_0x135926,_0x5bbacd){return function(_0x2d89e6){if(_0x2d89e6){return _0x2d89e6['destroy']()[_0xda4d('0x26')](function(){_0x135926['status'](0xcc)[_0xda4d('0x1b')]();});}};}function handleEntityNotFound(_0x41299a,_0x4036f8){return function(_0x48f13f){if(!_0x48f13f){_0x41299a['sendStatus'](0x194);}return _0x48f13f;};}function handleError(_0x380bb2,_0x5e6fcd){_0x5e6fcd=_0x5e6fcd||0x1f4;return function(_0x3e2b7d){logger[_0xda4d('0x27')](_0x3e2b7d[_0xda4d('0x28')]);if(_0x3e2b7d[_0xda4d('0x29')]){delete _0x3e2b7d['name'];}_0x380bb2[_0xda4d('0x1a')](_0x5e6fcd)[_0xda4d('0x2a')](_0x3e2b7d);};}exports[_0xda4d('0x2b')]=function(_0x2897ab,_0x4142b8){var _0x1c9aa8={},_0xd7d919={},_0x53cb07={'count':0x0,'rows':[]};var _0x473095=_[_0xda4d('0x2c')](db[_0xda4d('0x2d')][_0xda4d('0x2e')],function(_0xed1b6e){return{'name':_0xed1b6e[_0xda4d('0x2f')],'type':_0xed1b6e['type']['key']};});_0xd7d919[_0xda4d('0x30')]=_[_0xda4d('0x2c')](_0x473095,_0xda4d('0x29'));_0xd7d919[_0xda4d('0x31')]=_[_0xda4d('0x32')](_0x2897ab['query']);_0xd7d919[_0xda4d('0x33')]=_['intersection'](_0xd7d919[_0xda4d('0x30')],_0xd7d919[_0xda4d('0x31')]);_0x1c9aa8['attributes']=_[_0xda4d('0x34')](_0xd7d919[_0xda4d('0x30')],qs['fields'](_0x2897ab[_0xda4d('0x31')][_0xda4d('0x35')]));_0x1c9aa8['attributes']=_0x1c9aa8['attributes'][_0xda4d('0x36')]?_0x1c9aa8[_0xda4d('0x37')]:_0xd7d919[_0xda4d('0x30')];if(!_0x2897ab['query'][_0xda4d('0x38')](_0xda4d('0x39'))){_0x1c9aa8[_0xda4d('0x20')]=qs[_0xda4d('0x20')](_0x2897ab[_0xda4d('0x31')][_0xda4d('0x20')]);_0x1c9aa8[_0xda4d('0x1d')]=qs[_0xda4d('0x1d')](_0x2897ab['query'][_0xda4d('0x1d')]);}_0x1c9aa8[_0xda4d('0x3a')]=qs[_0xda4d('0x3b')](_0x2897ab[_0xda4d('0x31')][_0xda4d('0x3b')]);_0x1c9aa8[_0xda4d('0x3c')]=qs[_0xda4d('0x33')](_[_0xda4d('0x3d')](_0x2897ab[_0xda4d('0x31')],_0xd7d919['filters']),_0x473095);if(_0x2897ab['query'][_0xda4d('0x3e')]){_0x1c9aa8[_0xda4d('0x3c')]=_['merge'](_0x1c9aa8[_0xda4d('0x3c')],{'$or':_['map'](_0x473095,function(_0x1f50a0){if(_0x1f50a0[_0xda4d('0x3f')]!=='VIRTUAL'){var _0x588742={};_0x588742[_0x1f50a0[_0xda4d('0x29')]]={'$like':'%'+_0x2897ab[_0xda4d('0x31')][_0xda4d('0x3e')]+'%'};return _0x588742;}})});}_0x1c9aa8=_[_0xda4d('0x40')]({},_0x1c9aa8,_0x2897ab[_0xda4d('0x41')]);var _0x351e72={'where':_0x1c9aa8['where']};return db[_0xda4d('0x2d')][_0xda4d('0x1f')](_0x351e72)[_0xda4d('0x26')](function(_0x54e272){_0x53cb07[_0xda4d('0x1f')]=_0x54e272;if(_0x2897ab['query'][_0xda4d('0x42')]){_0x1c9aa8[_0xda4d('0x43')]=[{'all':!![]}];}return db[_0xda4d('0x2d')][_0xda4d('0x44')](_0x1c9aa8);})['then'](function(_0x242911){_0x53cb07['rows']=_0x242911;return _0x53cb07;})[_0xda4d('0x26')](respondWithFilteredResult(_0x4142b8,_0x1c9aa8))[_0xda4d('0x45')](handleError(_0x4142b8,null));};exports[_0xda4d('0x46')]=function(_0x2f4af3,_0x248419){var _0x31b5fa={'raw':!![],'where':{'id':_0x2f4af3[_0xda4d('0x47')]['id']}},_0x3a9e3d={};_0x3a9e3d[_0xda4d('0x30')]=_['keys'](db[_0xda4d('0x2d')]['rawAttributes']);_0x3a9e3d[_0xda4d('0x31')]=_[_0xda4d('0x32')](_0x2f4af3[_0xda4d('0x31')]);_0x3a9e3d[_0xda4d('0x33')]=_['intersection'](_0x3a9e3d[_0xda4d('0x30')],_0x3a9e3d[_0xda4d('0x31')]);_0x31b5fa[_0xda4d('0x37')]=_[_0xda4d('0x34')](_0x3a9e3d[_0xda4d('0x30')],qs[_0xda4d('0x35')](_0x2f4af3[_0xda4d('0x31')]['fields']));_0x31b5fa[_0xda4d('0x37')]=_0x31b5fa[_0xda4d('0x37')][_0xda4d('0x36')]?_0x31b5fa[_0xda4d('0x37')]:_0x3a9e3d[_0xda4d('0x30')];if(_0x2f4af3[_0xda4d('0x31')][_0xda4d('0x42')]){_0x31b5fa['include']=[{'all':!![]}];}_0x31b5fa=_[_0xda4d('0x40')]({},_0x31b5fa,_0x2f4af3[_0xda4d('0x41')]);return db[_0xda4d('0x2d')][_0xda4d('0x48')](_0x31b5fa)[_0xda4d('0x26')](handleEntityNotFound(_0x248419,null))[_0xda4d('0x26')](respondWithResult(_0x248419,null))[_0xda4d('0x45')](handleError(_0x248419,null));};exports[_0xda4d('0x49')]=function(_0x2b8a80,_0x5c5ea4){return db['OpenchannelTransferReport']['create'](_0x2b8a80[_0xda4d('0x4a')],{})['then'](respondWithResult(_0x5c5ea4,0xc9))[_0xda4d('0x45')](handleError(_0x5c5ea4,null));};exports['update']=function(_0x136e1f,_0x369671){if(_0x136e1f[_0xda4d('0x4a')]['id']){delete _0x136e1f[_0xda4d('0x4a')]['id'];}return db[_0xda4d('0x2d')][_0xda4d('0x48')]({'where':{'id':_0x136e1f[_0xda4d('0x47')]['id']}})[_0xda4d('0x26')](handleEntityNotFound(_0x369671,null))[_0xda4d('0x26')](saveUpdates(_0x136e1f[_0xda4d('0x4a')],null))[_0xda4d('0x26')](respondWithResult(_0x369671,null))['catch'](handleError(_0x369671,null));};exports[_0xda4d('0x4b')]=function(_0x4d11ff,_0x9feb55){return db[_0xda4d('0x2d')][_0xda4d('0x48')]({'where':{'id':_0x4d11ff[_0xda4d('0x47')]['id']}})['then'](handleEntityNotFound(_0x9feb55,null))[_0xda4d('0x26')](removeEntity(_0x9feb55,null))[_0xda4d('0x45')](handleError(_0x9feb55,null));};exports['describe']=function(_0x43ec79,_0x27300e){return db[_0xda4d('0x2d')][_0xda4d('0x4c')]()[_0xda4d('0x26')](respondWithResult(_0x27300e,null))[_0xda4d('0x45')](handleError(_0x27300e,null));}; \ No newline at end of file +var _0x6618=['intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','OpenchannelTransferReport','includeAll','rows','params','include','catch','body','find','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6618,0x141));var _0x8661=function(_0x537187,_0x1a9032){_0x537187=_0x537187-0x0;var _0x1cb496=_0x6618[_0x537187];return _0x1cb496;};'use strict';var emlformat=require(_0x8661('0x0'));var rimraf=require(_0x8661('0x1'));var zipdir=require(_0x8661('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8661('0x3'));var moment=require(_0x8661('0x4'));var BPromise=require(_0x8661('0x5'));var Mustache=require('mustache');var util=require(_0x8661('0x6'));var path=require(_0x8661('0x7'));var sox=require('sox');var csv=require(_0x8661('0x8'));var ejs=require(_0x8661('0x9'));var fs=require('fs');var fs_extra=require(_0x8661('0xa'));var _=require(_0x8661('0xb'));var squel=require(_0x8661('0xc'));var crypto=require(_0x8661('0xd'));var jsforce=require(_0x8661('0xe'));var deskjs=require(_0x8661('0xf'));var toCsv=require(_0x8661('0x8'));var querystring=require(_0x8661('0x10'));var Papa=require(_0x8661('0x11'));var Redis=require('ioredis');var authService=require(_0x8661('0x12'));var qs=require(_0x8661('0x13'));var as=require(_0x8661('0x14'));var hardwareService=require(_0x8661('0x15'));var logger=require(_0x8661('0x16'))('api');var utils=require(_0x8661('0x17'));var config=require(_0x8661('0x18'));var licenseUtil=require(_0x8661('0x19'));var db=require(_0x8661('0x1a'))['db'];function respondWithStatusCode(_0x14d4a6,_0x2d6f62){_0x2d6f62=_0x2d6f62||0xcc;return function(_0x54b028){if(_0x54b028){return _0x14d4a6[_0x8661('0x1b')](_0x2d6f62);}return _0x14d4a6[_0x8661('0x1c')](_0x2d6f62)[_0x8661('0x1d')]();};}function respondWithResult(_0x402fce,_0x5803fa){_0x5803fa=_0x5803fa||0xc8;return function(_0x46aec3){if(_0x46aec3){return _0x402fce[_0x8661('0x1c')](_0x5803fa)[_0x8661('0x1e')](_0x46aec3);}};}function respondWithFilteredResult(_0x50c188,_0x31805e){return function(_0x2f2341){if(_0x2f2341){var _0x388b65=typeof _0x31805e[_0x8661('0x1f')]===_0x8661('0x20')&&typeof _0x31805e[_0x8661('0x21')]===_0x8661('0x20');var _0x2c0e00=_0x2f2341[_0x8661('0x22')];var _0x1474a0=_0x388b65?0x0:_0x31805e[_0x8661('0x1f')];var _0x8faddc=_0x388b65?_0x2f2341[_0x8661('0x22')]:_0x31805e[_0x8661('0x1f')]+_0x31805e['limit'];var _0x17af0a;if(_0x8faddc>=_0x2c0e00){_0x8faddc=_0x2c0e00;_0x17af0a=0xc8;}else{_0x17af0a=0xce;}_0x50c188['status'](_0x17af0a);return _0x50c188['set']('Content-Range',_0x1474a0+'-'+_0x8faddc+'/'+_0x2c0e00)[_0x8661('0x1e')](_0x2f2341);}return null;};}function patchUpdates(_0x4d5eec){return function(_0x362a9e){try{jsonpatch[_0x8661('0x23')](_0x362a9e,_0x4d5eec,!![]);}catch(_0x2436ef){return BPromise[_0x8661('0x24')](_0x2436ef);}return _0x362a9e[_0x8661('0x25')]();};}function saveUpdates(_0xe98fd5,_0x1d9303){return function(_0x4f4b4f){if(_0x4f4b4f){return _0x4f4b4f[_0x8661('0x26')](_0xe98fd5)['then'](function(_0x14a707){return _0x14a707;});}return null;};}function removeEntity(_0x37f697,_0x313672){return function(_0x1a2ee1){if(_0x1a2ee1){return _0x1a2ee1[_0x8661('0x27')]()[_0x8661('0x28')](function(){_0x37f697[_0x8661('0x1c')](0xcc)[_0x8661('0x1d')]();});}};}function handleEntityNotFound(_0x11cfa9,_0x4b8990){return function(_0x2ca93a){if(!_0x2ca93a){_0x11cfa9['sendStatus'](0x194);}return _0x2ca93a;};}function handleError(_0x36a8de,_0x2efd6e){_0x2efd6e=_0x2efd6e||0x1f4;return function(_0x1fec7c){logger[_0x8661('0x29')](_0x1fec7c[_0x8661('0x2a')]);if(_0x1fec7c[_0x8661('0x2b')]){delete _0x1fec7c[_0x8661('0x2b')];}_0x36a8de[_0x8661('0x1c')](_0x2efd6e)[_0x8661('0x2c')](_0x1fec7c);};}exports[_0x8661('0x2d')]=function(_0x8f28bb,_0x3b4581){var _0x24c5d5={},_0x154287={},_0x4e3e37={'count':0x0,'rows':[]};var _0xb4bae1=_[_0x8661('0x2e')](db['OpenchannelTransferReport'][_0x8661('0x2f')],function(_0x4ebae5){return{'name':_0x4ebae5[_0x8661('0x30')],'type':_0x4ebae5[_0x8661('0x31')]['key']};});_0x154287[_0x8661('0x32')]=_['map'](_0xb4bae1,_0x8661('0x2b'));_0x154287[_0x8661('0x33')]=_[_0x8661('0x34')](_0x8f28bb[_0x8661('0x33')]);_0x154287[_0x8661('0x35')]=_[_0x8661('0x36')](_0x154287[_0x8661('0x32')],_0x154287[_0x8661('0x33')]);_0x24c5d5[_0x8661('0x37')]=_[_0x8661('0x36')](_0x154287['model'],qs[_0x8661('0x38')](_0x8f28bb[_0x8661('0x33')][_0x8661('0x38')]));_0x24c5d5['attributes']=_0x24c5d5[_0x8661('0x37')][_0x8661('0x39')]?_0x24c5d5[_0x8661('0x37')]:_0x154287['model'];if(!_0x8f28bb[_0x8661('0x33')]['hasOwnProperty'](_0x8661('0x3a'))){_0x24c5d5[_0x8661('0x21')]=qs['limit'](_0x8f28bb[_0x8661('0x33')][_0x8661('0x21')]);_0x24c5d5[_0x8661('0x1f')]=qs[_0x8661('0x1f')](_0x8f28bb['query'][_0x8661('0x1f')]);}_0x24c5d5[_0x8661('0x3b')]=qs[_0x8661('0x3c')](_0x8f28bb[_0x8661('0x33')][_0x8661('0x3c')]);_0x24c5d5['where']=qs[_0x8661('0x35')](_[_0x8661('0x3d')](_0x8f28bb['query'],_0x154287[_0x8661('0x35')]),_0xb4bae1);if(_0x8f28bb[_0x8661('0x33')][_0x8661('0x3e')]){_0x24c5d5[_0x8661('0x3f')]=_[_0x8661('0x40')](_0x24c5d5['where'],{'$or':_[_0x8661('0x2e')](_0xb4bae1,function(_0x447173){if(_0x447173[_0x8661('0x31')]!=='VIRTUAL'){var _0x58dadf={};_0x58dadf[_0x447173[_0x8661('0x2b')]]={'$like':'%'+_0x8f28bb[_0x8661('0x33')][_0x8661('0x3e')]+'%'};return _0x58dadf;}})});}_0x24c5d5=_[_0x8661('0x40')]({},_0x24c5d5,_0x8f28bb[_0x8661('0x41')]);var _0x2b1595={'where':_0x24c5d5[_0x8661('0x3f')]};return db[_0x8661('0x42')][_0x8661('0x22')](_0x2b1595)[_0x8661('0x28')](function(_0x4844c2){_0x4e3e37['count']=_0x4844c2;if(_0x8f28bb['query'][_0x8661('0x43')]){_0x24c5d5['include']=[{'all':!![]}];}return db[_0x8661('0x42')]['findAll'](_0x24c5d5);})['then'](function(_0x4ca207){_0x4e3e37[_0x8661('0x44')]=_0x4ca207;return _0x4e3e37;})['then'](respondWithFilteredResult(_0x3b4581,_0x24c5d5))['catch'](handleError(_0x3b4581,null));};exports['show']=function(_0x254eae,_0x2e2edc){var _0x493c9c={'raw':!![],'where':{'id':_0x254eae[_0x8661('0x45')]['id']}},_0x1f2f3f={};_0x1f2f3f['model']=_[_0x8661('0x34')](db[_0x8661('0x42')][_0x8661('0x2f')]);_0x1f2f3f[_0x8661('0x33')]=_[_0x8661('0x34')](_0x254eae[_0x8661('0x33')]);_0x1f2f3f[_0x8661('0x35')]=_[_0x8661('0x36')](_0x1f2f3f['model'],_0x1f2f3f[_0x8661('0x33')]);_0x493c9c['attributes']=_[_0x8661('0x36')](_0x1f2f3f['model'],qs[_0x8661('0x38')](_0x254eae[_0x8661('0x33')][_0x8661('0x38')]));_0x493c9c['attributes']=_0x493c9c['attributes']['length']?_0x493c9c['attributes']:_0x1f2f3f['model'];if(_0x254eae['query'][_0x8661('0x43')]){_0x493c9c[_0x8661('0x46')]=[{'all':!![]}];}_0x493c9c=_['merge']({},_0x493c9c,_0x254eae[_0x8661('0x41')]);return db['OpenchannelTransferReport']['find'](_0x493c9c)[_0x8661('0x28')](handleEntityNotFound(_0x2e2edc,null))['then'](respondWithResult(_0x2e2edc,null))[_0x8661('0x47')](handleError(_0x2e2edc,null));};exports['create']=function(_0x349d5a,_0x5b2b3c){return db[_0x8661('0x42')]['create'](_0x349d5a[_0x8661('0x48')],{})[_0x8661('0x28')](respondWithResult(_0x5b2b3c,0xc9))[_0x8661('0x47')](handleError(_0x5b2b3c,null));};exports['update']=function(_0x3fd8d0,_0x962661){if(_0x3fd8d0[_0x8661('0x48')]['id']){delete _0x3fd8d0[_0x8661('0x48')]['id'];}return db[_0x8661('0x42')]['find']({'where':{'id':_0x3fd8d0[_0x8661('0x45')]['id']}})[_0x8661('0x28')](handleEntityNotFound(_0x962661,null))[_0x8661('0x28')](saveUpdates(_0x3fd8d0[_0x8661('0x48')],null))[_0x8661('0x28')](respondWithResult(_0x962661,null))[_0x8661('0x47')](handleError(_0x962661,null));};exports['destroy']=function(_0x564d49,_0x45c0f1){return db['OpenchannelTransferReport'][_0x8661('0x49')]({'where':{'id':_0x564d49['params']['id']}})[_0x8661('0x28')](handleEntityNotFound(_0x45c0f1,null))[_0x8661('0x28')](removeEntity(_0x45c0f1,null))[_0x8661('0x47')](handleError(_0x45c0f1,null));};exports[_0x8661('0x4a')]=function(_0x4d722e,_0x1719d7){return db[_0x8661('0x42')][_0x8661('0x4a')]()['then'](respondWithResult(_0x1719d7,null))['catch'](handleError(_0x1719d7,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a2cc680..0dff34d 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 _0xb36a=['define','report_openchannel_transfer','uniqueid','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x5e7ee9,_0x4dbc4b){var _0xadb900=function(_0x5eecb3){while(--_0x5eecb3){_0x5e7ee9['push'](_0x5e7ee9['shift']());}};_0xadb900(++_0x4dbc4b);}(_0xb36a,0x100));var _0xab36=function(_0x411ce6,_0x4b3d2a){_0x411ce6=_0x411ce6-0x0;var _0x345706=_0xb36a[_0x411ce6];return _0x345706;};'use strict';var _=require(_0xab36('0x0'));var util=require('util');var logger=require(_0xab36('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xab36('0x2'));var fs=require('fs');var path=require(_0xab36('0x3'));var rimraf=require(_0xab36('0x4'));var config=require(_0xab36('0x5'));var attributes=require(_0xab36('0x6'));module[_0xab36('0x7')]=function(_0x135391,_0x88ebae){return _0x135391[_0xab36('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0xab36('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xab36('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe62a=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x2bc87,_0x470e69){var _0x26ab6d=function(_0x5b1ef2){while(--_0x5b1ef2){_0x2bc87['push'](_0x2bc87['shift']());}};_0x26ab6d(++_0x470e69);}(_0xe62a,0xad));var _0xae62=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe62a[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xae62('0x0'));var util=require(_0xae62('0x1'));var logger=require('../../config/logger')(_0xae62('0x2'));var moment=require(_0xae62('0x3'));var BPromise=require('bluebird');var rp=require(_0xae62('0x4'));var fs=require('fs');var path=require(_0xae62('0x5'));var rimraf=require(_0xae62('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0xae62('0x7')]=function(_0x3c3361,_0x4eb1b4){return _0x3c3361[_0xae62('0x8')](_0xae62('0x9'),attributes,{'tableName':_0xae62('0xa'),'paranoid':![],'indexes':[{'name':_0xae62('0xb'),'fields':[_0xae62('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 3bbb317..6f63823 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 _0x8375=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x87ac02,_0x101d77){var _0x507b4a=function(_0x2c754f){while(--_0x2c754f){_0x87ac02['push'](_0x87ac02['shift']());}};_0x507b4a(++_0x101d77);}(_0x8375,0xa8));var _0x5837=function(_0x9c805e,_0x5522b7){_0x9c805e=_0x9c805e-0x0;var _0x30ce73=_0x8375[_0x9c805e];return _0x30ce73;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var moment=require(_0x5837('0x2'));var BPromise=require('bluebird');var rs=require(_0x5837('0x3'));var fs=require('fs');var Redis=require(_0x5837('0x4'));var db=require(_0x5837('0x5'))['db'];var utils=require(_0x5837('0x6'));var logger=require(_0x5837('0x7'))(_0x5837('0x8'));var config=require('../../config/environment');var jayson=require(_0x5837('0x9'));var client=jayson[_0x5837('0xa')][_0x5837('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e383c,_0x3b11c3,_0x5bc421){return new BPromise(function(_0x508caf,_0x1e44c4){return client[_0x5837('0xc')](_0x2e383c,_0x5bc421)['then'](function(_0x24ca00){logger['info'](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));logger[_0x5837('0xf')](_0x5837('0x10'),_0x3b11c3,_0x5837('0xe'),JSON[_0x5837('0x11')](_0x24ca00));if(_0x24ca00['error']){if(_0x24ca00[_0x5837('0x12')][_0x5837('0x13')]===0x1f4){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')]['message']);return _0x1e44c4(_0x24ca00['error']['message']);}logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);return _0x508caf(_0x24ca00[_0x5837('0x12')][_0x5837('0x14')]);}else{logger[_0x5837('0x15')](_0x5837('0xd'),_0x3b11c3,_0x5837('0xe'));_0x508caf(_0x24ca00['result'][_0x5837('0x14')]);}})[_0x5837('0x16')](function(_0x57342d){logger[_0x5837('0x12')](_0x5837('0xd'),_0x3b11c3,_0x57342d);_0x1e44c4(_0x57342d);});});} \ No newline at end of file +var _0xaba6=['../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaba6,0xe2));var _0x6aba=function(_0x32bd11,_0x684ee3){_0x32bd11=_0x32bd11-0x0;var _0x319ad7=_0xaba6[_0x32bd11];return _0x319ad7;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e432bd9..6d242dc 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 _0xfdc4=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get','/:id','isAuthenticated','post','put','update','delete','destroy'];(function(_0x294c08,_0x2f22e6){var _0x3560e4=function(_0x224833){while(--_0x224833){_0x294c08['push'](_0x294c08['shift']());}};_0x3560e4(++_0x2f22e6);}(_0xfdc4,0x1ee));var _0x4fdc=function(_0x2921b3,_0x58c65d){_0x2921b3=_0x2921b3-0x0;var _0x120cb4=_0xfdc4[_0x2921b3];return _0x120cb4;};'use strict';var multer=require(_0x4fdc('0x0'));var util=require(_0x4fdc('0x1'));var path=require(_0x4fdc('0x2'));var timeout=require(_0x4fdc('0x3'));var express=require(_0x4fdc('0x4'));var router=express[_0x4fdc('0x5')]();var fs_extra=require(_0x4fdc('0x6'));var auth=require(_0x4fdc('0x7'));var interaction=require(_0x4fdc('0x8'));var config=require('../../config/environment');var controller=require(_0x4fdc('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4fdc('0xa')]);router[_0x4fdc('0xb')](_0x4fdc('0xc'),auth[_0x4fdc('0xd')](),controller['show']);router[_0x4fdc('0xe')]('/',auth[_0x4fdc('0xd')](),controller['create']);router[_0x4fdc('0xf')](_0x4fdc('0xc'),auth[_0x4fdc('0xd')](),controller[_0x4fdc('0x10')]);router[_0x4fdc('0x11')](_0x4fdc('0xc'),auth[_0x4fdc('0xd')](),controller[_0x4fdc('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9c61=['create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','index','/:id','show','post','isAuthenticated'];(function(_0x4ee2de,_0xcf82e4){var _0x4ac9ca=function(_0x42fe0a){while(--_0x42fe0a){_0x4ee2de['push'](_0x4ee2de['shift']());}};_0x4ac9ca(++_0xcf82e4);}(_0x9c61,0x1d1));var _0x19c6=function(_0x528342,_0x17a981){_0x528342=_0x528342-0x0;var _0x27dd91=_0x9c61[_0x528342];return _0x27dd91;};'use strict';var multer=require(_0x19c6('0x0'));var util=require(_0x19c6('0x1'));var path=require(_0x19c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x19c6('0x3'));var router=express[_0x19c6('0x4')]();var fs_extra=require(_0x19c6('0x5'));var auth=require(_0x19c6('0x6'));var interaction=require(_0x19c6('0x7'));var config=require('../../config/environment');var controller=require(_0x19c6('0x8'));router[_0x19c6('0x9')]('/',auth['isAuthenticated'](),controller[_0x19c6('0xa')]);router[_0x19c6('0x9')](_0x19c6('0xb'),auth['isAuthenticated'](),controller[_0x19c6('0xc')]);router[_0x19c6('0xd')]('/',auth[_0x19c6('0xe')](),controller[_0x19c6('0xf')]);router['put'](_0x19c6('0xb'),auth[_0x19c6('0xe')](),controller[_0x19c6('0x10')]);router[_0x19c6('0x11')](_0x19c6('0xb'),auth[_0x19c6('0xe')](),controller[_0x19c6('0x12')]);module[_0x19c6('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index a3144f4..302f5e9 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 _0xef83=['name','exports','STRING'];(function(_0x15aabc,_0x2e155a){var _0x51141d=function(_0x8221e4){while(--_0x8221e4){_0x15aabc['push'](_0x15aabc['shift']());}};_0x51141d(++_0x2e155a);}(_0xef83,0xa9));var _0x3ef8=function(_0x3ecee2,_0x1b289b){_0x3ecee2=_0x3ecee2-0x0;var _0x4f6236=_0xef83[_0x3ecee2];return _0x4f6236;};'use strict';var Sequelize=require('sequelize');module[_0x3ef8('0x0')]={'name':{'type':Sequelize[_0x3ef8('0x1')],'unique':_0x3ef8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3ef8('0x1')]}}; \ No newline at end of file +var _0xed23=['name','sequelize','exports'];(function(_0x45d879,_0x4e1f98){var _0x4241b9=function(_0x4e823d){while(--_0x4e823d){_0x45d879['push'](_0x45d879['shift']());}};_0x4241b9(++_0x4e1f98);}(_0xed23,0xb8));var _0x3ed2=function(_0xd67a7e,_0x2e55aa){_0xd67a7e=_0xd67a7e-0x0;var _0xd38386=_0xed23[_0xd67a7e];return _0xd38386;};'use strict';var Sequelize=require(_0x3ed2('0x0'));module[_0x3ed2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3ed2('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 3f93ba5..612a34d 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 _0xdc84=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Pauses','error','name','send','index','map','Pause','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','keys','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create'];(function(_0x48ae34,_0x1348b2){var _0x2da7bc=function(_0x3e7cd8){while(--_0x3e7cd8){_0x48ae34['push'](_0x48ae34['shift']());}};_0x2da7bc(++_0x1348b2);}(_0xdc84,0x1a1));var _0x4dc8=function(_0x1da8f5,_0xc052c4){_0x1da8f5=_0x1da8f5-0x0;var _0x2973a4=_0xdc84[_0x1da8f5];return _0x2973a4;};'use strict';var emlformat=require(_0x4dc8('0x0'));var rimraf=require(_0x4dc8('0x1'));var zipdir=require(_0x4dc8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4dc8('0x3'));var moment=require(_0x4dc8('0x4'));var BPromise=require(_0x4dc8('0x5'));var Mustache=require(_0x4dc8('0x6'));var util=require('util');var path=require(_0x4dc8('0x7'));var sox=require(_0x4dc8('0x8'));var csv=require(_0x4dc8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4dc8('0xa'));var _=require(_0x4dc8('0xb'));var squel=require(_0x4dc8('0xc'));var crypto=require(_0x4dc8('0xd'));var jsforce=require(_0x4dc8('0xe'));var deskjs=require(_0x4dc8('0xf'));var toCsv=require(_0x4dc8('0x9'));var querystring=require(_0x4dc8('0x10'));var Papa=require('papaparse');var Redis=require(_0x4dc8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4dc8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4dc8('0x13'))('api');var utils=require(_0x4dc8('0x14'));var config=require(_0x4dc8('0x15'));var licenseUtil=require(_0x4dc8('0x16'));var db=require(_0x4dc8('0x17'))['db'];function respondWithStatusCode(_0x3b1538,_0x33418b){_0x33418b=_0x33418b||0xcc;return function(_0x1461f1){if(_0x1461f1){return _0x3b1538[_0x4dc8('0x18')](_0x33418b);}return _0x3b1538['status'](_0x33418b)[_0x4dc8('0x19')]();};}function respondWithResult(_0x580afb,_0x275ffb){_0x275ffb=_0x275ffb||0xc8;return function(_0x337f46){if(_0x337f46){return _0x580afb[_0x4dc8('0x1a')](_0x275ffb)['json'](_0x337f46);}};}function respondWithFilteredResult(_0x28c458,_0x15eaac){return function(_0x3968f7){if(_0x3968f7){var _0x2c9ce1=typeof _0x15eaac[_0x4dc8('0x1b')]===_0x4dc8('0x1c')&&typeof _0x15eaac[_0x4dc8('0x1d')]==='undefined';var _0x321bca=_0x3968f7['count'];var _0x5d5454=_0x2c9ce1?0x0:_0x15eaac[_0x4dc8('0x1b')];var _0x2bd588=_0x2c9ce1?_0x3968f7[_0x4dc8('0x1e')]:_0x15eaac[_0x4dc8('0x1b')]+_0x15eaac[_0x4dc8('0x1d')];var _0x3c3a26;if(_0x2bd588>=_0x321bca){_0x2bd588=_0x321bca;_0x3c3a26=0xc8;}else{_0x3c3a26=0xce;}_0x28c458['status'](_0x3c3a26);return _0x28c458[_0x4dc8('0x1f')](_0x4dc8('0x20'),_0x5d5454+'-'+_0x2bd588+'/'+_0x321bca)[_0x4dc8('0x21')](_0x3968f7);}return null;};}function patchUpdates(_0x3ffdbd){return function(_0x490312){try{jsonpatch[_0x4dc8('0x22')](_0x490312,_0x3ffdbd,!![]);}catch(_0x1b2cad){return BPromise[_0x4dc8('0x23')](_0x1b2cad);}return _0x490312[_0x4dc8('0x24')]();};}function saveUpdates(_0x41acca,_0x55ad1f){return function(_0x1b49c9){if(_0x1b49c9){return _0x1b49c9[_0x4dc8('0x25')](_0x41acca)[_0x4dc8('0x26')](function(_0x240c34){return _0x240c34;});}return null;};}function removeEntity(_0x55d1ae,_0xbf4e99){return function(_0x347878){if(_0x347878){return _0x347878[_0x4dc8('0x27')]()[_0x4dc8('0x26')](function(){var _0x4996f5=_0x347878['get']({'plain':!![]});var _0x282e95=_0x4dc8('0x28');return db['UserProfileResource'][_0x4dc8('0x27')]({'where':{'type':_0x282e95,'resourceId':_0x4996f5['id']}})[_0x4dc8('0x26')](function(){return _0x347878;});})[_0x4dc8('0x26')](function(){_0x55d1ae[_0x4dc8('0x1a')](0xcc)[_0x4dc8('0x19')]();});}};}function handleEntityNotFound(_0x1682df,_0x13dfa5){return function(_0x47f8eb){if(!_0x47f8eb){_0x1682df[_0x4dc8('0x18')](0x194);}return _0x47f8eb;};}function handleError(_0x9e3475,_0x3e0527){_0x3e0527=_0x3e0527||0x1f4;return function(_0x26af6c){logger[_0x4dc8('0x29')](_0x26af6c['stack']);if(_0x26af6c[_0x4dc8('0x2a')]){delete _0x26af6c['name'];}_0x9e3475[_0x4dc8('0x1a')](_0x3e0527)[_0x4dc8('0x2b')](_0x26af6c);};}exports[_0x4dc8('0x2c')]=function(_0x4b44af,_0x2a71e0){var _0x186190={},_0x42ab9e={},_0x21c4e5={'count':0x0,'rows':[]};var _0xca6cea=_[_0x4dc8('0x2d')](db[_0x4dc8('0x2e')][_0x4dc8('0x2f')],function(_0x2bb7ef){return{'name':_0x2bb7ef[_0x4dc8('0x30')],'type':_0x2bb7ef['type']['key']};});_0x42ab9e['model']=_['map'](_0xca6cea,'name');_0x42ab9e[_0x4dc8('0x31')]=_['keys'](_0x4b44af[_0x4dc8('0x31')]);_0x42ab9e[_0x4dc8('0x32')]=_[_0x4dc8('0x33')](_0x42ab9e['model'],_0x42ab9e['query']);_0x186190[_0x4dc8('0x34')]=_[_0x4dc8('0x33')](_0x42ab9e[_0x4dc8('0x35')],qs['fields'](_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x36')]));_0x186190['attributes']=_0x186190[_0x4dc8('0x34')][_0x4dc8('0x37')]?_0x186190['attributes']:_0x42ab9e['model'];if(!_0x4b44af[_0x4dc8('0x31')]['hasOwnProperty']('nolimit')){_0x186190[_0x4dc8('0x1d')]=qs[_0x4dc8('0x1d')](_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x1d')]);_0x186190[_0x4dc8('0x1b')]=qs[_0x4dc8('0x1b')](_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x1b')]);}_0x186190[_0x4dc8('0x38')]=qs[_0x4dc8('0x39')](_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x39')]);_0x186190[_0x4dc8('0x3a')]=qs[_0x4dc8('0x32')](_[_0x4dc8('0x3b')](_0x4b44af[_0x4dc8('0x31')],_0x42ab9e[_0x4dc8('0x32')]),_0xca6cea);if(_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x3c')]){_0x186190[_0x4dc8('0x3a')]=_['merge'](_0x186190[_0x4dc8('0x3a')],{'$or':_['map'](_0xca6cea,function(_0x416bfe){if(_0x416bfe[_0x4dc8('0x3d')]!==_0x4dc8('0x3e')){var _0xf188ac={};_0xf188ac[_0x416bfe['name']]={'$like':'%'+_0x4b44af[_0x4dc8('0x31')]['filter']+'%'};return _0xf188ac;}})});}_0x186190=_[_0x4dc8('0x3f')]({},_0x186190,_0x4b44af[_0x4dc8('0x40')]);var _0x42fa80={'where':_0x186190['where']};return db[_0x4dc8('0x2e')]['count'](_0x42fa80)[_0x4dc8('0x26')](function(_0x4d8dab){_0x21c4e5['count']=_0x4d8dab;if(_0x4b44af[_0x4dc8('0x31')][_0x4dc8('0x41')]){_0x186190['include']=[{'all':!![]}];}return db[_0x4dc8('0x2e')][_0x4dc8('0x42')](_0x186190);})[_0x4dc8('0x26')](function(_0x49ab66){_0x21c4e5[_0x4dc8('0x43')]=_0x49ab66;return _0x21c4e5;})[_0x4dc8('0x26')](respondWithFilteredResult(_0x2a71e0,_0x186190))[_0x4dc8('0x44')](handleError(_0x2a71e0,null));};exports[_0x4dc8('0x45')]=function(_0x1af39d,_0x34f88e){var _0x10fb90={'raw':!![],'where':{'id':_0x1af39d['params']['id']}},_0x392daf={};_0x392daf['model']=_['keys'](db[_0x4dc8('0x2e')][_0x4dc8('0x2f')]);_0x392daf[_0x4dc8('0x31')]=_[_0x4dc8('0x46')](_0x1af39d[_0x4dc8('0x31')]);_0x392daf[_0x4dc8('0x32')]=_['intersection'](_0x392daf[_0x4dc8('0x35')],_0x392daf['query']);_0x10fb90[_0x4dc8('0x34')]=_[_0x4dc8('0x33')](_0x392daf[_0x4dc8('0x35')],qs[_0x4dc8('0x36')](_0x1af39d[_0x4dc8('0x31')]['fields']));_0x10fb90[_0x4dc8('0x34')]=_0x10fb90[_0x4dc8('0x34')][_0x4dc8('0x37')]?_0x10fb90[_0x4dc8('0x34')]:_0x392daf['model'];if(_0x1af39d[_0x4dc8('0x31')][_0x4dc8('0x41')]){_0x10fb90[_0x4dc8('0x47')]=[{'all':!![]}];}_0x10fb90=_[_0x4dc8('0x3f')]({},_0x10fb90,_0x1af39d[_0x4dc8('0x40')]);return db['Pause'][_0x4dc8('0x48')](_0x10fb90)['then'](handleEntityNotFound(_0x34f88e,null))['then'](respondWithResult(_0x34f88e,null))[_0x4dc8('0x44')](handleError(_0x34f88e,null));};exports['create']=function(_0x41a45a,_0x5640eb){return db[_0x4dc8('0x2e')]['create'](_0x41a45a[_0x4dc8('0x49')],{})[_0x4dc8('0x26')](function(_0x5baf54){var _0x4f7fac=_0x41a45a[_0x4dc8('0x4a')][_0x4dc8('0x4b')]({'plain':!![]});if(!_0x4f7fac)throw new Error(_0x4dc8('0x4c'));if(_0x4f7fac[_0x4dc8('0x4d')]===_0x4dc8('0x4a')){var _0x401d51=_0x5baf54['get']({'plain':!![]});var _0x394989='Pauses';return db[_0x4dc8('0x4e')][_0x4dc8('0x48')]({'where':{'name':_0x394989,'userProfileId':_0x4f7fac[_0x4dc8('0x4f')]},'raw':!![]})[_0x4dc8('0x26')](function(_0x3daaa3){if(_0x3daaa3&&_0x3daaa3['autoAssociation']===0x0){return db['UserProfileResource'][_0x4dc8('0x50')]({'name':_0x401d51[_0x4dc8('0x2a')],'resourceId':_0x401d51['id'],'type':_0x3daaa3['name'],'sectionId':_0x3daaa3['id']},{})['then'](function(){return _0x5baf54;});}else{return _0x5baf54;}})[_0x4dc8('0x44')](function(_0x5065e0){logger[_0x4dc8('0x29')](_0x4dc8('0x51'),_0x5065e0);throw _0x5065e0;});}return _0x5baf54;})[_0x4dc8('0x26')](respondWithResult(_0x5640eb,0xc9))[_0x4dc8('0x44')](handleError(_0x5640eb,null));};exports[_0x4dc8('0x25')]=function(_0x564fcd,_0x20a4c1){if(_0x564fcd[_0x4dc8('0x49')]['id']){delete _0x564fcd[_0x4dc8('0x49')]['id'];}return db[_0x4dc8('0x2e')][_0x4dc8('0x48')]({'where':{'id':_0x564fcd[_0x4dc8('0x52')]['id']}})[_0x4dc8('0x26')](handleEntityNotFound(_0x20a4c1,null))[_0x4dc8('0x26')](saveUpdates(_0x564fcd[_0x4dc8('0x49')],null))[_0x4dc8('0x26')](respondWithResult(_0x20a4c1,null))[_0x4dc8('0x44')](handleError(_0x20a4c1,null));};exports[_0x4dc8('0x27')]=function(_0xeb117b,_0x5172a0){return db[_0x4dc8('0x2e')][_0x4dc8('0x48')]({'where':{'id':_0xeb117b[_0x4dc8('0x52')]['id']}})[_0x4dc8('0x26')](handleEntityNotFound(_0x5172a0,null))['then'](removeEntity(_0x5172a0,null))['catch'](handleError(_0x5172a0,null));}; \ No newline at end of file +var _0xa9c2=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','UserProfileResource','end','error','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','Pause','findAll','rows','show','find','create'];(function(_0x505ca,_0x2beb30){var _0x590837=function(_0x394097){while(--_0x394097){_0x505ca['push'](_0x505ca['shift']());}};_0x590837(++_0x2beb30);}(_0xa9c2,0x1bc));var _0x2a9c=function(_0x5318d3,_0x6b949f){_0x5318d3=_0x5318d3-0x0;var _0x1a76f6=_0xa9c2[_0x5318d3];return _0x1a76f6;};'use strict';var emlformat=require(_0x2a9c('0x0'));var rimraf=require(_0x2a9c('0x1'));var zipdir=require(_0x2a9c('0x2'));var jsonpatch=require(_0x2a9c('0x3'));var rp=require(_0x2a9c('0x4'));var moment=require(_0x2a9c('0x5'));var BPromise=require(_0x2a9c('0x6'));var Mustache=require(_0x2a9c('0x7'));var util=require('util');var path=require(_0x2a9c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2a9c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2a9c('0xa'));var crypto=require(_0x2a9c('0xb'));var jsforce=require(_0x2a9c('0xc'));var deskjs=require(_0x2a9c('0xd'));var toCsv=require(_0x2a9c('0xe'));var querystring=require(_0x2a9c('0xf'));var Papa=require(_0x2a9c('0x10'));var Redis=require(_0x2a9c('0x11'));var authService=require(_0x2a9c('0x12'));var qs=require(_0x2a9c('0x13'));var as=require(_0x2a9c('0x14'));var hardwareService=require(_0x2a9c('0x15'));var logger=require(_0x2a9c('0x16'))(_0x2a9c('0x17'));var utils=require(_0x2a9c('0x18'));var config=require(_0x2a9c('0x19'));var licenseUtil=require(_0x2a9c('0x1a'));var db=require(_0x2a9c('0x1b'))['db'];function respondWithStatusCode(_0xd50793,_0x570fd5){_0x570fd5=_0x570fd5||0xcc;return function(_0x2d4b8c){if(_0x2d4b8c){return _0xd50793[_0x2a9c('0x1c')](_0x570fd5);}return _0xd50793[_0x2a9c('0x1d')](_0x570fd5)['end']();};}function respondWithResult(_0x330fb2,_0x5583fa){_0x5583fa=_0x5583fa||0xc8;return function(_0x5ecee8){if(_0x5ecee8){return _0x330fb2[_0x2a9c('0x1d')](_0x5583fa)['json'](_0x5ecee8);}};}function respondWithFilteredResult(_0x37685d,_0xcc95b9){return function(_0x45753b){if(_0x45753b){var _0x19dadf=typeof _0xcc95b9[_0x2a9c('0x1e')]===_0x2a9c('0x1f')&&typeof _0xcc95b9[_0x2a9c('0x20')]===_0x2a9c('0x1f');var _0x46ca8e=_0x45753b[_0x2a9c('0x21')];var _0x47ba50=_0x19dadf?0x0:_0xcc95b9[_0x2a9c('0x1e')];var _0x1f9bdd=_0x19dadf?_0x45753b['count']:_0xcc95b9[_0x2a9c('0x1e')]+_0xcc95b9['limit'];var _0x495bea;if(_0x1f9bdd>=_0x46ca8e){_0x1f9bdd=_0x46ca8e;_0x495bea=0xc8;}else{_0x495bea=0xce;}_0x37685d[_0x2a9c('0x1d')](_0x495bea);return _0x37685d[_0x2a9c('0x22')](_0x2a9c('0x23'),_0x47ba50+'-'+_0x1f9bdd+'/'+_0x46ca8e)[_0x2a9c('0x24')](_0x45753b);}return null;};}function patchUpdates(_0x1cb49a){return function(_0x2c55b0){try{jsonpatch[_0x2a9c('0x25')](_0x2c55b0,_0x1cb49a,!![]);}catch(_0x434095){return BPromise['reject'](_0x434095);}return _0x2c55b0[_0x2a9c('0x26')]();};}function saveUpdates(_0x690262,_0x14f8f5){return function(_0x482832){if(_0x482832){return _0x482832['update'](_0x690262)[_0x2a9c('0x27')](function(_0x4b3296){return _0x4b3296;});}return null;};}function removeEntity(_0x26c803,_0x1f8ecf){return function(_0x51ad55){if(_0x51ad55){return _0x51ad55[_0x2a9c('0x28')]()[_0x2a9c('0x27')](function(){var _0x129458=_0x51ad55[_0x2a9c('0x29')]({'plain':!![]});var _0x4bcd34='Pauses';return db[_0x2a9c('0x2a')][_0x2a9c('0x28')]({'where':{'type':_0x4bcd34,'resourceId':_0x129458['id']}})['then'](function(){return _0x51ad55;});})[_0x2a9c('0x27')](function(){_0x26c803[_0x2a9c('0x1d')](0xcc)[_0x2a9c('0x2b')]();});}};}function handleEntityNotFound(_0x7b51cc,_0x217199){return function(_0x51acba){if(!_0x51acba){_0x7b51cc['sendStatus'](0x194);}return _0x51acba;};}function handleError(_0x34b144,_0x11b6dd){_0x11b6dd=_0x11b6dd||0x1f4;return function(_0x13f1b5){logger[_0x2a9c('0x2c')](_0x13f1b5['stack']);if(_0x13f1b5[_0x2a9c('0x2d')]){delete _0x13f1b5[_0x2a9c('0x2d')];}_0x34b144['status'](_0x11b6dd)[_0x2a9c('0x2e')](_0x13f1b5);};}exports[_0x2a9c('0x2f')]=function(_0x3dc085,_0x35be74){var _0x351c5c={},_0x5a2e20={},_0x394f3a={'count':0x0,'rows':[]};var _0x33b666=_[_0x2a9c('0x30')](db['Pause'][_0x2a9c('0x31')],function(_0xf9bcda){return{'name':_0xf9bcda['fieldName'],'type':_0xf9bcda['type'][_0x2a9c('0x32')]};});_0x5a2e20[_0x2a9c('0x33')]=_[_0x2a9c('0x30')](_0x33b666,_0x2a9c('0x2d'));_0x5a2e20[_0x2a9c('0x34')]=_[_0x2a9c('0x35')](_0x3dc085[_0x2a9c('0x34')]);_0x5a2e20[_0x2a9c('0x36')]=_[_0x2a9c('0x37')](_0x5a2e20[_0x2a9c('0x33')],_0x5a2e20[_0x2a9c('0x34')]);_0x351c5c[_0x2a9c('0x38')]=_[_0x2a9c('0x37')](_0x5a2e20[_0x2a9c('0x33')],qs[_0x2a9c('0x39')](_0x3dc085[_0x2a9c('0x34')][_0x2a9c('0x39')]));_0x351c5c[_0x2a9c('0x38')]=_0x351c5c[_0x2a9c('0x38')][_0x2a9c('0x3a')]?_0x351c5c[_0x2a9c('0x38')]:_0x5a2e20[_0x2a9c('0x33')];if(!_0x3dc085[_0x2a9c('0x34')][_0x2a9c('0x3b')](_0x2a9c('0x3c'))){_0x351c5c['limit']=qs['limit'](_0x3dc085[_0x2a9c('0x34')]['limit']);_0x351c5c[_0x2a9c('0x1e')]=qs['offset'](_0x3dc085[_0x2a9c('0x34')][_0x2a9c('0x1e')]);}_0x351c5c[_0x2a9c('0x3d')]=qs[_0x2a9c('0x3e')](_0x3dc085['query']['sort']);_0x351c5c[_0x2a9c('0x3f')]=qs['filters'](_[_0x2a9c('0x40')](_0x3dc085[_0x2a9c('0x34')],_0x5a2e20['filters']),_0x33b666);if(_0x3dc085[_0x2a9c('0x34')]['filter']){_0x351c5c['where']=_[_0x2a9c('0x41')](_0x351c5c[_0x2a9c('0x3f')],{'$or':_['map'](_0x33b666,function(_0x319fc8){if(_0x319fc8[_0x2a9c('0x42')]!==_0x2a9c('0x43')){var _0x1a0b4b={};_0x1a0b4b[_0x319fc8[_0x2a9c('0x2d')]]={'$like':'%'+_0x3dc085[_0x2a9c('0x34')][_0x2a9c('0x44')]+'%'};return _0x1a0b4b;}})});}_0x351c5c=_[_0x2a9c('0x41')]({},_0x351c5c,_0x3dc085[_0x2a9c('0x45')]);var _0x442ff7={'where':_0x351c5c[_0x2a9c('0x3f')]};return db['Pause'][_0x2a9c('0x21')](_0x442ff7)['then'](function(_0x20d44a){_0x394f3a[_0x2a9c('0x21')]=_0x20d44a;if(_0x3dc085[_0x2a9c('0x34')][_0x2a9c('0x46')]){_0x351c5c[_0x2a9c('0x47')]=[{'all':!![]}];}return db[_0x2a9c('0x48')][_0x2a9c('0x49')](_0x351c5c);})[_0x2a9c('0x27')](function(_0x1fecd6){_0x394f3a[_0x2a9c('0x4a')]=_0x1fecd6;return _0x394f3a;})[_0x2a9c('0x27')](respondWithFilteredResult(_0x35be74,_0x351c5c))['catch'](handleError(_0x35be74,null));};exports[_0x2a9c('0x4b')]=function(_0x3d036d,_0xa168f6){var _0x44992e={'raw':!![],'where':{'id':_0x3d036d['params']['id']}},_0x26f18b={};_0x26f18b[_0x2a9c('0x33')]=_[_0x2a9c('0x35')](db[_0x2a9c('0x48')]['rawAttributes']);_0x26f18b[_0x2a9c('0x34')]=_[_0x2a9c('0x35')](_0x3d036d[_0x2a9c('0x34')]);_0x26f18b[_0x2a9c('0x36')]=_[_0x2a9c('0x37')](_0x26f18b[_0x2a9c('0x33')],_0x26f18b[_0x2a9c('0x34')]);_0x44992e['attributes']=_[_0x2a9c('0x37')](_0x26f18b[_0x2a9c('0x33')],qs[_0x2a9c('0x39')](_0x3d036d[_0x2a9c('0x34')]['fields']));_0x44992e['attributes']=_0x44992e[_0x2a9c('0x38')][_0x2a9c('0x3a')]?_0x44992e[_0x2a9c('0x38')]:_0x26f18b[_0x2a9c('0x33')];if(_0x3d036d[_0x2a9c('0x34')]['includeAll']){_0x44992e[_0x2a9c('0x47')]=[{'all':!![]}];}_0x44992e=_[_0x2a9c('0x41')]({},_0x44992e,_0x3d036d['options']);return db[_0x2a9c('0x48')][_0x2a9c('0x4c')](_0x44992e)['then'](handleEntityNotFound(_0xa168f6,null))[_0x2a9c('0x27')](respondWithResult(_0xa168f6,null))['catch'](handleError(_0xa168f6,null));};exports[_0x2a9c('0x4d')]=function(_0x224888,_0x3fc91b){return db[_0x2a9c('0x48')]['create'](_0x224888['body'],{})[_0x2a9c('0x27')](function(_0x3eeed4){var _0xfda4fc=_0x224888[_0x2a9c('0x4e')]['get']({'plain':!![]});if(!_0xfda4fc)throw new Error(_0x2a9c('0x4f'));if(_0xfda4fc[_0x2a9c('0x50')]===_0x2a9c('0x4e')){var _0x5844b6=_0x3eeed4[_0x2a9c('0x29')]({'plain':!![]});var _0x38c0bc='Pauses';return db[_0x2a9c('0x51')][_0x2a9c('0x4c')]({'where':{'name':_0x38c0bc,'userProfileId':_0xfda4fc['userProfileId']},'raw':!![]})[_0x2a9c('0x27')](function(_0x1b52f3){if(_0x1b52f3&&_0x1b52f3[_0x2a9c('0x52')]===0x0){return db[_0x2a9c('0x2a')][_0x2a9c('0x4d')]({'name':_0x5844b6[_0x2a9c('0x2d')],'resourceId':_0x5844b6['id'],'type':_0x1b52f3[_0x2a9c('0x2d')],'sectionId':_0x1b52f3['id']},{})['then'](function(){return _0x3eeed4;});}else{return _0x3eeed4;}})['catch'](function(_0x545dba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x545dba);throw _0x545dba;});}return _0x3eeed4;})[_0x2a9c('0x27')](respondWithResult(_0x3fc91b,0xc9))[_0x2a9c('0x53')](handleError(_0x3fc91b,null));};exports[_0x2a9c('0x54')]=function(_0x9b6e6c,_0x59cb49){if(_0x9b6e6c[_0x2a9c('0x55')]['id']){delete _0x9b6e6c['body']['id'];}return db[_0x2a9c('0x48')][_0x2a9c('0x4c')]({'where':{'id':_0x9b6e6c[_0x2a9c('0x56')]['id']}})[_0x2a9c('0x27')](handleEntityNotFound(_0x59cb49,null))['then'](saveUpdates(_0x9b6e6c['body'],null))[_0x2a9c('0x27')](respondWithResult(_0x59cb49,null))[_0x2a9c('0x53')](handleError(_0x59cb49,null));};exports[_0x2a9c('0x28')]=function(_0x47bd0c,_0x5f2bed){return db[_0x2a9c('0x48')][_0x2a9c('0x4c')]({'where':{'id':_0x47bd0c[_0x2a9c('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f2bed,null))[_0x2a9c('0x27')](removeEntity(_0x5f2bed,null))['catch'](handleError(_0x5f2bed,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 0c19d14..ea6fe77 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 _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x56901f,_0x24d3f4){var _0x594181=function(_0x273b59){while(--_0x273b59){_0x56901f['push'](_0x56901f['shift']());}};_0x594181(++_0x24d3f4);}(_0x326f,0xd1));var _0xf326=function(_0x4fa825,_0x1949a1){_0x4fa825=_0x4fa825-0x0;var _0x2c1249=_0x326f[_0x4fa825];return _0x2c1249;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5a08fb,_0x304c84){var _0xe493a7=function(_0x323c52){while(--_0x323c52){_0x5a08fb['push'](_0x5a08fb['shift']());}};_0xe493a7(++_0x304c84);}(_0x1cb9,0x14e));var _0x91cb=function(_0x56e046,_0x16fea1){_0x56e046=_0x56e046-0x0;var _0x1c046d=_0x1cb9[_0x56e046];return _0x1c046d;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 7a781ea..ac2383a 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(_0x36b596,_0x1dea47){var _0x2cd65a=function(_0x3d34e0){while(--_0x3d34e0){_0x36b596['push'](_0x36b596['shift']());}};_0x2cd65a(++_0x1dea47);}(_0x7a54,0x106));var _0x47a5=function(_0x295918,_0x40a4b7){_0x295918=_0x295918-0x0;var _0x1b7717=_0x7a54[_0x295918];return _0x1b7717;};'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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5b1b28,_0x454f47){var _0x543c75=function(_0x53bef3){while(--_0x53bef3){_0x5b1b28['push'](_0x5b1b28['shift']());}};_0x543c75(++_0x454f47);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a9e4a,_0x585df1){_0x4a9e4a=_0x4a9e4a-0x0;var _0xaa903e=_0xb10b[_0x4a9e4a];return _0xaa903e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 3f9dad7..3a2ad41 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 _0xed1f=['basename','originalname','now','extname','single','upload','post','webhookPost','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','diskStorage','server/files/plugins','replace','format'];(function(_0x1202c2,_0x144ad6){var _0x2e6be6=function(_0x3f852d){while(--_0x3f852d){_0x1202c2['push'](_0x1202c2['shift']());}};_0x2e6be6(++_0x144ad6);}(_0xed1f,0x6a));var _0xfed1=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xed1f[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')]('/',auth[_0xfed1('0xc')](),controller[_0xfed1('0xd')]);router[_0xfed1('0xb')](_0xfed1('0xe'),controller[_0xfed1('0xf')]);router[_0xfed1('0xb')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x10')]);router['get'](_0xfed1('0x11'),auth[_0xfed1('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xfed1('0x12')]({'destination':function(_0x48c338,_0x1c3f40,_0x234f4e){_0x234f4e(null,path['join'](config['root'],_0xfed1('0x13')));},'filename':function(_0xe84ba6,_0x569a6e,_0x17f4fe){_0x569a6e['originalname']=_0x569a6e['originalname'][_0xfed1('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17f4fe(null,util[_0xfed1('0x15')]('%s-%s%s',path[_0xfed1('0x16')](_0x569a6e['originalname'],path['extname'](_0x569a6e[_0xfed1('0x17')])),Date[_0xfed1('0x18')](),path[_0xfed1('0x19')](_0x569a6e[_0xfed1('0x17')])));}})});router['post']('/',upload[_0xfed1('0x1a')]('file'),controller[_0xfed1('0x1b')]);router[_0xfed1('0x1c')]('/webhook',controller[_0xfed1('0x1d')]);router[_0xfed1('0x1e')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfed1('0x1f')]('/:id',auth[_0xfed1('0xc')](),controller[_0xfed1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x9b67=['../../components/auth/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9b67,0xf6));var _0x79b6=function(_0x4f7283,_0x891516){_0x4f7283=_0x4f7283-0x0;var _0x2a3303=_0x9b67[_0x4f7283];return _0x2a3303;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),controller[_0x79b6('0xc')]);router['get'](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xe')]);router[_0x79b6('0x8')](_0x79b6('0xf'),auth['isAuthenticated'](),controller[_0x79b6('0x10')]);var upload=multer({'storage':multer[_0x79b6('0x11')]({'destination':function(_0x3f3b44,_0x301f13,_0x58a98b){_0x58a98b(null,path['join'](config[_0x79b6('0x12')],_0x79b6('0x13')));},'filename':function(_0x303cfb,_0x526727,_0xc05a77){_0x526727[_0x79b6('0x14')]=_0x526727[_0x79b6('0x14')][_0x79b6('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc05a77(null,util[_0x79b6('0x16')](_0x79b6('0x17'),path[_0x79b6('0x18')](_0x526727[_0x79b6('0x14')],path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])),Date[_0x79b6('0x1a')](),path[_0x79b6('0x19')](_0x526727[_0x79b6('0x14')])));}})});router['post']('/',upload[_0x79b6('0x1b')](_0x79b6('0x1c')),controller[_0x79b6('0x1d')]);router[_0x79b6('0x1e')](_0x79b6('0xb'),controller[_0x79b6('0x1f')]);router[_0x79b6('0x20')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x21')]);router[_0x79b6('0x22')](_0x79b6('0xd'),auth[_0x79b6('0x9')](),controller['delete']);module[_0x79b6('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index af3b456..56c51d3 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 _0x4783=['adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','ENUM','html','script','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x26cfe0,_0x200ce5){var _0x2cbf0c=function(_0x4501eb){while(--_0x4501eb){_0x26cfe0['push'](_0x26cfe0['shift']());}};_0x2cbf0c(++_0x200ce5);}(_0x4783,0x130));var _0x3478=function(_0x593f45,_0x6942dd){_0x593f45=_0x593f45-0x0;var _0x58b581=_0x4783[_0x593f45];return _0x58b581;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3478('0x0')](_0x3478('0x1'),_0x3478('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x3478('0x3')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3478('0x4')],'defaultValue':0x0,'comment':_0x3478('0x5')},'sidebar':{'type':Sequelize['ENUM'](_0x3478('0x6'),'agentOnly',_0x3478('0x7'),_0x3478('0x8')),'defaultValue':_0x3478('0x7'),'comment':_0x3478('0x9')},'icon':{'type':Sequelize[_0x3478('0x3')]},'adminUrl':{'type':Sequelize[_0x3478('0x3')]},'agentUrl':{'type':Sequelize[_0x3478('0x3')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x3478('0x3')]}}; \ No newline at end of file +var _0x5238=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x34b7e1,_0x146b4b){var _0x21dcf8=function(_0x28b5cc){while(--_0x28b5cc){_0x34b7e1['push'](_0x34b7e1['shift']());}};_0x21dcf8(++_0x146b4b);}(_0x5238,0x198));var _0x8523=function(_0x31ff97,_0x47a4f9){_0x31ff97=_0x31ff97-0x0;var _0x52fccc=_0x5238[_0x31ff97];return _0x52fccc;};'use strict';var Sequelize=require('sequelize');module[_0x8523('0x0')]={'name':{'type':Sequelize[_0x8523('0x1')]},'type':{'type':Sequelize[_0x8523('0x2')](_0x8523('0x3'),_0x8523('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x8523('0x5')]},'path':{'type':Sequelize[_0x8523('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x8523('0x6')],'defaultValue':0x0,'comment':_0x8523('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x8523('0x8'),_0x8523('0x9'),_0x8523('0xa'),_0x8523('0xb')),'defaultValue':_0x8523('0xa'),'comment':_0x8523('0xc')},'icon':{'type':Sequelize[_0x8523('0x1')]},'adminUrl':{'type':Sequelize[_0x8523('0x1')]},'agentUrl':{'type':Sequelize[_0x8523('0x1')]},'scriptName':{'type':Sequelize[_0x8523('0x1')]},'scriptPath':{'type':Sequelize[_0x8523('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d24a53c..818e974 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 _0x3817=['squel','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','Plugin','includeAll','include','findAll','rows','catch','show','length','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','role','Plugins','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','body','delete','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','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3817,0x149));var _0x7381=function(_0x5d477a,_0x2ab63e){_0x5d477a=_0x5d477a-0x0;var _0x4b033c=_0x3817[_0x5d477a];return _0x4b033c;};'use strict';var emlformat=require(_0x7381('0x0'));var rimraf=require(_0x7381('0x1'));var zipdir=require(_0x7381('0x2'));var jsonpatch=require(_0x7381('0x3'));var rp=require('request-promise');var moment=require(_0x7381('0x4'));var BPromise=require(_0x7381('0x5'));var Mustache=require('mustache');var util=require(_0x7381('0x6'));var path=require(_0x7381('0x7'));var sox=require('sox');var csv=require(_0x7381('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7381('0x9'));var _=require(_0x7381('0xa'));var squel=require(_0x7381('0xb'));var crypto=require(_0x7381('0xc'));var jsforce=require(_0x7381('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7381('0x8'));var querystring=require(_0x7381('0xe'));var Papa=require(_0x7381('0xf'));var extract=require(_0x7381('0x10'));var rimraf=require(_0x7381('0x1'));var archiver=require(_0x7381('0x11'));var Redis=require(_0x7381('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7381('0x13'));var as=require(_0x7381('0x14'));var hardwareService=require(_0x7381('0x15'));var logger=require('../../config/logger')(_0x7381('0x16'));var utils=require('../../config/utils');var config=require(_0x7381('0x17'));var licenseUtil=require(_0x7381('0x18'));var db=require(_0x7381('0x19'))['db'];config['redis']=_['defaults'](config[_0x7381('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7381('0x1b'))(new Redis(config[_0x7381('0x1a')]));require(_0x7381('0x1c'))[_0x7381('0x1d')](socket);function respondWithStatusCode(_0x4dcabc,_0x47f405){_0x47f405=_0x47f405||0xcc;return function(_0x5ed85f){if(_0x5ed85f){return _0x4dcabc['sendStatus'](_0x47f405);}return _0x4dcabc['status'](_0x47f405)[_0x7381('0x1e')]();};}function respondWithResult(_0x4f2e91,_0x2de0c6){_0x2de0c6=_0x2de0c6||0xc8;return function(_0x1bb63b){if(_0x1bb63b){return _0x4f2e91[_0x7381('0x1f')](_0x2de0c6)[_0x7381('0x20')](_0x1bb63b);}};}function respondWithFilteredResult(_0x160755,_0x29289c){return function(_0x143666){if(_0x143666){var _0x119553=typeof _0x29289c[_0x7381('0x21')]===_0x7381('0x22')&&typeof _0x29289c[_0x7381('0x23')]===_0x7381('0x22');var _0x2c35d1=_0x143666[_0x7381('0x24')];var _0x17728f=_0x119553?0x0:_0x29289c['offset'];var _0x267675=_0x119553?_0x143666[_0x7381('0x24')]:_0x29289c['offset']+_0x29289c[_0x7381('0x23')];var _0x77f71a;if(_0x267675>=_0x2c35d1){_0x267675=_0x2c35d1;_0x77f71a=0xc8;}else{_0x77f71a=0xce;}_0x160755[_0x7381('0x1f')](_0x77f71a);return _0x160755[_0x7381('0x25')](_0x7381('0x26'),_0x17728f+'-'+_0x267675+'/'+_0x2c35d1)['json'](_0x143666);}return null;};}function patchUpdates(_0x559c50){return function(_0x3bb4c0){try{jsonpatch[_0x7381('0x27')](_0x3bb4c0,_0x559c50,!![]);}catch(_0x13157a){return BPromise[_0x7381('0x28')](_0x13157a);}return _0x3bb4c0[_0x7381('0x29')]();};}function saveUpdates(_0xab9ac0,_0x28c924){return function(_0xce9ec8){if(_0xce9ec8){return _0xce9ec8[_0x7381('0x2a')](_0xab9ac0)[_0x7381('0x2b')](function(_0x2b176c){return _0x2b176c;});}return null;};}function removeEntity(_0x4f79ac,_0x48d981){return function(_0x3eaa03){if(_0x3eaa03){return _0x3eaa03['destroy']()['then'](function(){var _0x33316f=_0x3eaa03[_0x7381('0x2c')]({'plain':!![]});var _0x165446='Plugins';return db[_0x7381('0x2d')][_0x7381('0x2e')]({'where':{'type':_0x165446,'resourceId':_0x33316f['id']}})[_0x7381('0x2b')](function(){return _0x3eaa03;});})[_0x7381('0x2b')](function(){_0x4f79ac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x559789,_0x2368d9){return function(_0x23087d){if(!_0x23087d){_0x559789[_0x7381('0x2f')](0x194);}return _0x23087d;};}function handleError(_0x1aae98,_0x18106d){_0x18106d=_0x18106d||0x1f4;return function(_0x329e61){logger['error'](_0x329e61[_0x7381('0x30')]);if(_0x329e61['name']){delete _0x329e61[_0x7381('0x31')];}_0x1aae98[_0x7381('0x1f')](_0x18106d)[_0x7381('0x32')](_0x329e61);};}exports[_0x7381('0x33')]=function(_0x21e0b8,_0x3c0e90){var _0x50ae05={},_0x38ce93={},_0x4588a5={'count':0x0,'rows':[]};var _0x4f3762=_[_0x7381('0x34')](db['Plugin'][_0x7381('0x35')],function(_0x14d3e0){return{'name':_0x14d3e0[_0x7381('0x36')],'type':_0x14d3e0[_0x7381('0x37')][_0x7381('0x38')]};});_0x38ce93[_0x7381('0x39')]=_['map'](_0x4f3762,_0x7381('0x31'));_0x38ce93[_0x7381('0x3a')]=_[_0x7381('0x3b')](_0x21e0b8[_0x7381('0x3a')]);_0x38ce93['filters']=_['intersection'](_0x38ce93[_0x7381('0x39')],_0x38ce93[_0x7381('0x3a')]);_0x50ae05[_0x7381('0x3c')]=_[_0x7381('0x3d')](_0x38ce93[_0x7381('0x39')],qs[_0x7381('0x3e')](_0x21e0b8['query']['fields']));_0x50ae05[_0x7381('0x3c')]=_0x50ae05[_0x7381('0x3c')]['length']?_0x50ae05[_0x7381('0x3c')]:_0x38ce93[_0x7381('0x39')];if(!_0x21e0b8[_0x7381('0x3a')][_0x7381('0x3f')](_0x7381('0x40'))){_0x50ae05[_0x7381('0x23')]=qs[_0x7381('0x23')](_0x21e0b8['query'][_0x7381('0x23')]);_0x50ae05[_0x7381('0x21')]=qs[_0x7381('0x21')](_0x21e0b8['query'][_0x7381('0x21')]);}_0x50ae05['order']=qs[_0x7381('0x41')](_0x21e0b8[_0x7381('0x3a')]['sort']);_0x50ae05[_0x7381('0x42')]=qs[_0x7381('0x43')](_[_0x7381('0x44')](_0x21e0b8[_0x7381('0x3a')],_0x38ce93[_0x7381('0x43')]),_0x4f3762);if(_0x21e0b8[_0x7381('0x3a')][_0x7381('0x45')]){_0x50ae05[_0x7381('0x42')]=_['merge'](_0x50ae05[_0x7381('0x42')],{'$or':_[_0x7381('0x34')](_0x4f3762,function(_0x527c70){if(_0x527c70['type']!==_0x7381('0x46')){var _0x82686a={};_0x82686a[_0x527c70[_0x7381('0x31')]]={'$like':'%'+_0x21e0b8[_0x7381('0x3a')][_0x7381('0x45')]+'%'};return _0x82686a;}})});}_0x50ae05=_[_0x7381('0x47')]({},_0x50ae05,_0x21e0b8[_0x7381('0x48')]);var _0x119522={'where':_0x50ae05[_0x7381('0x42')]};return db[_0x7381('0x49')][_0x7381('0x24')](_0x119522)[_0x7381('0x2b')](function(_0x277f03){_0x4588a5[_0x7381('0x24')]=_0x277f03;if(_0x21e0b8[_0x7381('0x3a')][_0x7381('0x4a')]){_0x50ae05[_0x7381('0x4b')]=[{'all':!![]}];}return db[_0x7381('0x49')][_0x7381('0x4c')](_0x50ae05);})[_0x7381('0x2b')](function(_0x18c38c){_0x4588a5[_0x7381('0x4d')]=_0x18c38c;return _0x4588a5;})[_0x7381('0x2b')](respondWithFilteredResult(_0x3c0e90,_0x50ae05))[_0x7381('0x4e')](handleError(_0x3c0e90,null));};exports[_0x7381('0x4f')]=function(_0xc0e96c,_0x1e8609){var _0x28a94b={'raw':!![],'where':{'id':_0xc0e96c['params']['id']}},_0x4aceff={};_0x4aceff[_0x7381('0x39')]=_[_0x7381('0x3b')](db[_0x7381('0x49')][_0x7381('0x35')]);_0x4aceff[_0x7381('0x3a')]=_['keys'](_0xc0e96c['query']);_0x4aceff[_0x7381('0x43')]=_[_0x7381('0x3d')](_0x4aceff[_0x7381('0x39')],_0x4aceff['query']);_0x28a94b[_0x7381('0x3c')]=_[_0x7381('0x3d')](_0x4aceff['model'],qs[_0x7381('0x3e')](_0xc0e96c['query'][_0x7381('0x3e')]));_0x28a94b[_0x7381('0x3c')]=_0x28a94b[_0x7381('0x3c')][_0x7381('0x50')]?_0x28a94b['attributes']:_0x4aceff[_0x7381('0x39')];if(_0xc0e96c[_0x7381('0x3a')][_0x7381('0x4a')]){_0x28a94b[_0x7381('0x4b')]=[{'all':!![]}];}_0x28a94b=_[_0x7381('0x47')]({},_0x28a94b,_0xc0e96c[_0x7381('0x48')]);return db[_0x7381('0x49')][_0x7381('0x51')](_0x28a94b)['then'](handleEntityNotFound(_0x1e8609,null))['then'](respondWithResult(_0x1e8609,null))['catch'](handleError(_0x1e8609,null));};exports[_0x7381('0x52')]=function(_0x3091a4,_0x3ec19a,_0x37329d){return db[_0x7381('0x49')][_0x7381('0x51')]({'where':{'id':_0x3091a4[_0x7381('0x53')]['id']},'attributes':[_0x7381('0x31'),_0x7381('0x7')],'raw':!![]})[_0x7381('0x2b')](handleEntityNotFound(_0x3ec19a,null))[_0x7381('0x2b')](function(_0x1dc287){if(_0x1dc287){var _0x173727=path[_0x7381('0x54')](config[_0x7381('0x55')],_0x7381('0x56'),util[_0x7381('0x57')](_0x7381('0x58'),path[_0x7381('0x59')](_0x1dc287[_0x7381('0x7')])));var _0x5f5934=fs[_0x7381('0x5a')](_0x173727);var _0x3371a7=archiver(_0x7381('0x5b'),{'zlib':{'level':0x9}});_0x3371a7['on']('warning',function(_0x537e6c){if(_0x537e6c[_0x7381('0x5c')]==='ENOENT'){logger[_0x7381('0x5d')](_0x537e6c);}else{throw new db[(_0x7381('0x5e'))][(_0x7381('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3371a7['on']('error',function(_0x40d623){throw new db[(_0x7381('0x5e'))][(_0x7381('0x5f'))](_0x7381('0x60'));});_0x3371a7[_0x7381('0x61')](_0x5f5934);_0x3371a7[_0x7381('0x62')](_0x7381('0x63'),{'cwd':path[_0x7381('0x54')](config[_0x7381('0x55')],_0x7381('0x56'),path['dirname'](_0x1dc287[_0x7381('0x7')])),'ignore':[path[_0x7381('0x54')](path[_0x7381('0x59')](_0x1dc287[_0x7381('0x7')]),_0x7381('0x64')),path[_0x7381('0x54')](path[_0x7381('0x59')](_0x1dc287['path']),_0x7381('0x65'))],'nodir':!![]})[_0x7381('0x66')]();_0x5f5934['on'](_0x7381('0x67'),function(){if(!fs[_0x7381('0x68')](_0x173727)){throw new db['Sequelize'][(_0x7381('0x5f'))](_0x7381('0x69'));}return _0x3ec19a[_0x7381('0x52')](_0x173727,util[_0x7381('0x57')](_0x7381('0x58'),path[_0x7381('0x59')](_0x1dc287[_0x7381('0x7')])),function(_0x3e85c1){if(_0x3e85c1){throw new db['Sequelize']['Error'](_0x7381('0x6a'));}fs[_0x7381('0x6b')](_0x173727);logger[_0x7381('0x6c')]('Download\x20completed');logger[_0x7381('0x6c')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x3ec19a,null));};exports[_0x7381('0x6d')]=function(_0x3c0054,_0x1aa0a9,_0x5d3800){var _0x29c47b=path[_0x7381('0x59')](_0x3c0054[_0x7381('0x6e')][_0x7381('0x6f')],path[_0x7381('0x70')](_0x3c0054[_0x7381('0x6e')][_0x7381('0x6f')]));var _0x1035a2=path['join'](config[_0x7381('0x55')],_0x7381('0x56'),_0x3c0054[_0x7381('0x6e')][_0x7381('0x6f')]);var _0xf7c5e5=path[_0x7381('0x54')](config[_0x7381('0x55')],_0x7381('0x56'),_0x29c47b);logger[_0x7381('0x6c')]('Plugin\x20upload\x20filepath:\x20%s',_0x1035a2);logger[_0x7381('0x6c')]('Plugin\x20upload\x20destination:\x20%s',_0xf7c5e5);try{fs['chmodSync'](_0x1035a2,parseInt(_0x7381('0x71'),0x8));extract(_0x1035a2,{'dir':_0xf7c5e5},function(_0xf7e958){if(_0xf7e958){logger[_0x7381('0x5d')](_0xf7e958);handleError(_0xf7e958,!![]);};var _0x1eab10=fs[_0x7381('0x72')](_0xf7c5e5);if(_0x1eab10[_0x7381('0x50')]>0x1){removeReferences(_0x1035a2,_0xf7c5e5);logger[_0x7381('0x5d')](_0x7381('0x73'));return _0x5d3800(new Error(_0x7381('0x73')));}var _0x536bc7=fs[_0x7381('0x74')](path[_0x7381('0x54')](_0xf7c5e5,_0x1eab10[0x0]));if(_0x536bc7[_0x7381('0x75')]()){removeReferences(_0x1035a2,_0xf7c5e5);logger[_0x7381('0x5d')]('Invalid\x20plugin\x20structure');return _0x5d3800(new Error(_0x7381('0x73')));}if(_0x536bc7[_0x7381('0x76')]()){var _0x188c1a=fs[_0x7381('0x72')](path['join'](_0xf7c5e5,_0x1eab10[0x0]));if(_0x188c1a[_0x7381('0x50')]===0x0){removeReferences(_0x1035a2,_0xf7c5e5);logger[_0x7381('0x5d')](_0x7381('0x73'));return _0x5d3800(new Error('Invalid\x20plugin\x20structure'));}var _0x12a709=_0x188c1a[_0x7381('0x77')](function(_0x1b2aab){return _0x1b2aab===_0x7381('0x78');});if(!_0x12a709){return _0x5d3800(new Error(_0x7381('0x79')));}var _0x14f382=fs['readFileSync'](path[_0x7381('0x54')](_0xf7c5e5,_0x1eab10[0x0],_0x7381('0x78')));var _0x30ecd9=JSON[_0x7381('0x7a')](_0x14f382);if(_0x7381('0x22')==typeof _0x30ecd9['name']){return _0x5d3800(new Error(_0x7381('0x7b')));}if(_0x7381('0x22')==typeof _0x30ecd9[_0x7381('0x37')]){return _0x5d3800(new Error(_0x7381('0x7c')));}if(_0x7381('0x22')==typeof _0x30ecd9[_0x7381('0x7d')]){return _0x5d3800(new Error(_0x7381('0x7e')));}if('undefined'==typeof _0x30ecd9[_0x7381('0x7f')]){return _0x5d3800(new Error(_0x7381('0x80')));}if(_0x30ecd9['type']==='html'){if('undefined'==typeof _0x30ecd9['parameters'][_0x7381('0x81')]){return _0x5d3800(new Error(_0x7381('0x82')));}if('undefined'==typeof _0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')][_0x7381('0x83')]&&_0x7381('0x22')==typeof _0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')][_0x7381('0x84')]){return _0x5d3800(new Error(_0x7381('0x85')));}}else if(_0x30ecd9[_0x7381('0x37')]===_0x7381('0x86')){if(_0x7381('0x22')==typeof _0x30ecd9[_0x7381('0x7f')][_0x7381('0x87')]){return _0x5d3800(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x7381('0x22')==typeof _0x30ecd9['parameters'][_0x7381('0x88')]){return _0x5d3800(new Error(_0x7381('0x89')));}}else{return _0x5d3800(new Error(_0x7381('0x8a')));}var _0x5aac6d=_0x30ecd9['name'];var _0x351baa=_0x30ecd9[_0x7381('0x8b')];var _0x193a4d=_0x30ecd9[_0x7381('0x37')];var _0x3e11fa=_0x30ecd9[_0x7381('0x8c')]?_0x30ecd9[_0x7381('0x8c')]:_0x7381('0x8d');var _0x59cffc=_0x30ecd9[_0x7381('0x8e')]?_0x30ecd9['icon']:_0x7381('0x8f');var _0x5dea8e='';var _0x10c23b='';var _0x2c1f2c='';var _0x4b7cc1='';var _0x156c0c=_0x30ecd9['version'];if(_0x193a4d===_0x7381('0x90')){if(_0x7381('0x22')!=typeof _0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')][_0x7381('0x83')]){var _0x3e45db=_0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3e45db)){_0x5dea8e=path[_0x7381('0x54')](_0x7381('0x91'),_0x29c47b,_0x1eab10[0x0],_0x3e45db);}else{_0x5dea8e=_0x3e45db;}}else{logger[_0x7381('0x6c')](_0x7381('0x92'));}if(_0x7381('0x22')!=typeof _0x30ecd9[_0x7381('0x7f')]['views'][_0x7381('0x84')]){var _0x442bc7=_0x30ecd9[_0x7381('0x7f')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7381('0x93')](_0x442bc7)){_0x10c23b=path['join']('plugins',_0x29c47b,_0x1eab10[0x0],_0x442bc7);}else{_0x10c23b=_0x442bc7;}}else{logger[_0x7381('0x6c')](_0x7381('0x94'));}}else if(_0x193a4d===_0x7381('0x86')){_0x2c1f2c=_0x30ecd9[_0x7381('0x7f')]['scriptName'];_0x4b7cc1=_0x30ecd9[_0x7381('0x7f')]['scriptPath'];if(_0x7381('0x22')!=typeof _0x30ecd9[_0x7381('0x7f')]['views']){if(_0x7381('0x22')!=typeof _0x30ecd9[_0x7381('0x7f')]['views'][_0x7381('0x83')]){var _0x3e45db=_0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')][_0x7381('0x83')];if(!/^(f|ht)tps?:\/\//i[_0x7381('0x93')](_0x3e45db)){_0x5dea8e=path[_0x7381('0x54')](_0x7381('0x91'),_0x29c47b,_0x1eab10[0x0],_0x3e45db);}else{_0x5dea8e=_0x3e45db;}}if(_0x7381('0x22')!=typeof _0x30ecd9[_0x7381('0x7f')]['views']['agent']){var _0x442bc7=_0x30ecd9[_0x7381('0x7f')][_0x7381('0x81')][_0x7381('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x7381('0x93')](_0x442bc7)){_0x10c23b=path[_0x7381('0x54')](_0x7381('0x91'),_0x29c47b,_0x1eab10[0x0],_0x442bc7);}else{_0x10c23b=_0x442bc7;}}}}var _0xfe1520={'name':_0x5aac6d,'description':_0x351baa,'path':path[_0x7381('0x54')](_0x29c47b,_0x1eab10[0x0]),'type':_0x193a4d,'sidebar':_0x3e11fa,'icon':_0x59cffc,'adminUrl':_0x5dea8e,'agentUrl':_0x10c23b,'scriptName':_0x2c1f2c,'scriptPath':_0x4b7cc1,'version':_0x156c0c};removeReferences(_0x1035a2,null);return db[_0x7381('0x49')][_0x7381('0x95')](_0xfe1520)[_0x7381('0x2b')](function(_0x51f060){var _0x59d0ba={'role':_0x3c0054['body'][_0x7381('0x96')],'userProfileId':_0x3c0054['body']['userProfileId']};if(!_0x59d0ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59d0ba[_0x7381('0x96')]==='user'){var _0x495f19=_0x51f060[_0x7381('0x2c')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7381('0x97'),'userProfileId':_0x59d0ba['userProfileId']},'raw':!![]})[_0x7381('0x2b')](function(_0x1bf85b){if(_0x1bf85b&&_0x1bf85b['autoAssociation']===0x0){return db[_0x7381('0x2d')]['create']({'name':_0x495f19[_0x7381('0x31')],'resourceId':_0x495f19['id'],'type':_0x1bf85b['name'],'sectionId':_0x1bf85b['id']},{})[_0x7381('0x2b')](function(){return _0x51f060;});}else{return _0x51f060;}})[_0x7381('0x4e')](function(_0xe82a05){logger[_0x7381('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe82a05);throw _0xe82a05;});}return _0x51f060;})[_0x7381('0x2b')](respondWithResult(_0x1aa0a9,null))[_0x7381('0x4e')](handleError(_0x1aa0a9,null));}});}catch(_0x5c0e5e){_0x1aa0a9['status'](0x1f4)[_0x7381('0x32')](_0x5c0e5e);}};function removeReferences(_0x54dfce,_0x2c1ebc){try{if(_0x54dfce){fs[_0x7381('0x6b')](_0x54dfce);logger[_0x7381('0x6c')](_0x7381('0x98'));}if(_0x2c1ebc){rimraf(_0x2c1ebc,function(){});logger['info'](_0x7381('0x99'));}}catch(_0xf06caa){logger[_0x7381('0x5d')](_0xf06caa);}}exports[_0x7381('0x2a')]=function(_0x1be6f7,_0x15f8e3,_0x59b8a4){return db[_0x7381('0x49')]['find']({'where':{'id':_0x1be6f7[_0x7381('0x53')]['id']}})[_0x7381('0x2b')](handleEntityNotFound(_0x15f8e3,null))[_0x7381('0x2b')](saveUpdates(_0x1be6f7[_0x7381('0x9a')],null))[_0x7381('0x2b')](respondWithResult(_0x15f8e3,null))[_0x7381('0x4e')](handleError(_0x15f8e3,null));};exports[_0x7381('0x9b')]=function(_0x4013ce,_0x1ee323,_0x5dc72f){return db[_0x7381('0x49')][_0x7381('0x51')]({'where':{'id':_0x4013ce[_0x7381('0x53')]['id']}})[_0x7381('0x2b')](function(_0x1e1caa){if(_0x1e1caa){return _0x1e1caa[_0x7381('0x2e')]();}})[_0x7381('0x2b')](function(_0x3f8d3d){rimraf(path[_0x7381('0x54')](config[_0x7381('0x55')],_0x7381('0x56'),path['dirname'](_0x3f8d3d[_0x7381('0x7')])),function(){});return _0x3f8d3d;})[_0x7381('0x2b')](handleEntityNotFound(_0x1ee323,null))[_0x7381('0x2b')](respondWithStatusCode(_0x1ee323,null))[_0x7381('0x4e')](handleError(_0x1ee323,null));};exports['webhookGet']=function(_0x2f99a9,_0xc49288,_0x4618cb){return BPromise[_0x7381('0x9c')]()['then'](function(){if(!_0x2f99a9[_0x7381('0x3a')][_0x7381('0x7')]){throw new Error(_0x7381('0x9d'));}if(!_0x2f99a9['query'][_0x7381('0x9e')]){throw new Error(_0x7381('0x9f'));}var _0x3d0569=_0x2f99a9[_0x7381('0x3a')][_0x7381('0xa0')]?_0x2f99a9[_0x7381('0x3a')][_0x7381('0xa0')]+':'+_0x2f99a9[_0x7381('0x3a')][_0x7381('0x9e')]:_0x7381('0xa1')+_0x2f99a9[_0x7381('0x3a')][_0x7381('0x9e')];var _0x3a0ec0=_0x2f99a9[_0x7381('0x3a')][_0x7381('0x20')]?_0x2f99a9[_0x7381('0x3a')][_0x7381('0x20')]:!![];var _0x4ad83c=_0x2f99a9[_0x7381('0x3a')][_0x7381('0xa2')]?_0x2f99a9['query'][_0x7381('0xa2')]:null;var _0xaacacb={'method':_0x2f99a9[_0x7381('0xa3')],'uri':util[_0x7381('0x57')](_0x7381('0xa4'),_0x3d0569,_0x2f99a9[_0x7381('0x3a')][_0x7381('0x7')]),'json':_0x3a0ec0,'resolveWithFullResponse':!![],'encoding':_0x4ad83c,'qs':_0x2f99a9[_0x7381('0x3a')]};if(_0x2f99a9[_0x7381('0xa5')]){_0xaacacb[_0x7381('0xa5')]=_0x2f99a9[_0x7381('0xa5')];if(_0xaacacb[_0x7381('0xa5')][_0x7381('0xa6')]){delete _0xaacacb[_0x7381('0xa5')][_0x7381('0xa6')];}}if(_0xaacacb['headers'][_0x7381('0xa7')]){delete _0xaacacb[_0x7381('0xa5')][_0x7381('0xa7')];}return rp(_0xaacacb);})['then'](function(_0x4b6a86){if(_0x4b6a86){_0xc49288['set'](_0x4b6a86[_0x7381('0xa5')]);logger['info'](_0x4b6a86[_0x7381('0x9a')]);if(_[_0x7381('0xa8')](_0x2f99a9[_0x7381('0x3a')][_0x7381('0x7')],_0x7381('0x52'))&&_0x4b6a86[_0x7381('0xa9')]==0x1f4){return _0xc49288[_0x7381('0x2f')](_0x4b6a86[_0x7381('0xa9')]);}else{return _0xc49288[_0x7381('0x1f')](_0x4b6a86[_0x7381('0xa9')])[_0x7381('0x32')](_0x4b6a86[_0x7381('0x9a')]);}}else{return _0xc49288[_0x7381('0x2f')](0xc8);}})[_0x7381('0x4e')](handleError(_0xc49288,null));};exports['webhookPost']=function(_0x4c7677,_0x488f99,_0x123a46){return BPromise[_0x7381('0x9c')]()[_0x7381('0x2b')](function(){if(!_0x4c7677[_0x7381('0x3a')]['path']){throw new Error(_0x7381('0x9d'));}if(!_0x4c7677['query'][_0x7381('0x9e')]){throw new Error(_0x7381('0x9f'));}var _0x1ea45d=_0x4c7677['query']['hostname']?_0x4c7677[_0x7381('0x3a')]['hostname']+':'+_0x4c7677[_0x7381('0x3a')]['port']:_0x7381('0xa1')+_0x4c7677[_0x7381('0x3a')][_0x7381('0x9e')];var _0xab8497=_0x4c7677['query']['json']?_0x4c7677[_0x7381('0x3a')]['json']:!![];var _0x3cb0bb=_0x4c7677[_0x7381('0x3a')]['encoding']?_0x4c7677[_0x7381('0x3a')][_0x7381('0xa2')]:null;var _0xba2217={'method':_0x4c7677[_0x7381('0xa3')],'uri':util[_0x7381('0x57')](_0x7381('0xa4'),_0x1ea45d,_0x4c7677[_0x7381('0x3a')][_0x7381('0x7')]),'json':_0xab8497,'resolveWithFullResponse':!![],'encoding':_0x3cb0bb,'body':_0x4c7677['body']};if(_0x4c7677['headers']){_0xba2217[_0x7381('0xa5')]=_0x4c7677['headers'];if(_0xba2217[_0x7381('0xa5')][_0x7381('0xa6')]){delete _0xba2217[_0x7381('0xa5')]['content-length'];}}if(_0xba2217[_0x7381('0xa5')]['content-type']){delete _0xba2217[_0x7381('0xa5')][_0x7381('0xa7')];}return rp(_0xba2217);})['then'](function(_0x1a20fe){if(_0x1a20fe){_0x488f99[_0x7381('0x25')](_0x1a20fe[_0x7381('0xa5')]);logger[_0x7381('0x6c')](_0x1a20fe[_0x7381('0x9a')]);return _0x488f99[_0x7381('0x1f')](_0x1a20fe[_0x7381('0xa9')])['send'](_0x1a20fe[_0x7381('0x9a')]);}else{return _0x488f99[_0x7381('0x2f')](0xc8);}})[_0x7381('0x4e')](handleError(_0x488f99,null));}; \ No newline at end of file +var _0x8d36=['Error','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','views','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','sendStatus','webhookPost','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./plugin.socket','status','end','json','limit','undefined','offset','count','set','Content-Range','reject','save','then','destroy','get','Plugins','UserProfileResource','error','name','send','rawAttributes','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','filter','Plugin','includeAll','include','rows','catch','show','params','options','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive'];(function(_0x37ebd1,_0x2e39a7){var _0x19accb=function(_0x29df5b){while(--_0x29df5b){_0x37ebd1['push'](_0x37ebd1['shift']());}};_0x19accb(++_0x2e39a7);}(_0x8d36,0x19e));var _0x68d3=function(_0x34412f,_0x116bea){_0x34412f=_0x34412f-0x0;var _0x4b4b5a=_0x8d36[_0x34412f];return _0x4b4b5a;};'use strict';var emlformat=require(_0x68d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68d3('0x1'));var jsonpatch=require(_0x68d3('0x2'));var rp=require(_0x68d3('0x3'));var moment=require(_0x68d3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x68d3('0x5'));var util=require(_0x68d3('0x6'));var path=require(_0x68d3('0x7'));var sox=require(_0x68d3('0x8'));var csv=require(_0x68d3('0x9'));var ejs=require(_0x68d3('0xa'));var fs=require('fs');var fs_extra=require(_0x68d3('0xb'));var _=require(_0x68d3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x68d3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x68d3('0x9'));var querystring=require(_0x68d3('0xe'));var Papa=require('papaparse');var extract=require(_0x68d3('0xf'));var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x68d3('0x10'));var authService=require(_0x68d3('0x11'));var qs=require(_0x68d3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68d3('0x13'));var logger=require(_0x68d3('0x14'))(_0x68d3('0x15'));var utils=require(_0x68d3('0x16'));var config=require(_0x68d3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x68d3('0x18'))['db'];config['redis']=_[_0x68d3('0x19')](config[_0x68d3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x68d3('0x1b'))(new Redis(config[_0x68d3('0x1a')]));require(_0x68d3('0x1c'))['register'](socket);function respondWithStatusCode(_0x5f486a,_0x439797){_0x439797=_0x439797||0xcc;return function(_0x2824c0){if(_0x2824c0){return _0x5f486a['sendStatus'](_0x439797);}return _0x5f486a[_0x68d3('0x1d')](_0x439797)[_0x68d3('0x1e')]();};}function respondWithResult(_0x19f770,_0x19efdd){_0x19efdd=_0x19efdd||0xc8;return function(_0x4ff5eb){if(_0x4ff5eb){return _0x19f770[_0x68d3('0x1d')](_0x19efdd)[_0x68d3('0x1f')](_0x4ff5eb);}};}function respondWithFilteredResult(_0x3dcb0f,_0x5d1cb6){return function(_0x21ab35){if(_0x21ab35){var _0x339e3f=typeof _0x5d1cb6['offset']==='undefined'&&typeof _0x5d1cb6[_0x68d3('0x20')]===_0x68d3('0x21');var _0xa78c5a=_0x21ab35['count'];var _0xbbcd03=_0x339e3f?0x0:_0x5d1cb6[_0x68d3('0x22')];var _0x85abb5=_0x339e3f?_0x21ab35[_0x68d3('0x23')]:_0x5d1cb6[_0x68d3('0x22')]+_0x5d1cb6[_0x68d3('0x20')];var _0x1f7116;if(_0x85abb5>=_0xa78c5a){_0x85abb5=_0xa78c5a;_0x1f7116=0xc8;}else{_0x1f7116=0xce;}_0x3dcb0f[_0x68d3('0x1d')](_0x1f7116);return _0x3dcb0f[_0x68d3('0x24')](_0x68d3('0x25'),_0xbbcd03+'-'+_0x85abb5+'/'+_0xa78c5a)[_0x68d3('0x1f')](_0x21ab35);}return null;};}function patchUpdates(_0x13bc64){return function(_0x466423){try{jsonpatch['apply'](_0x466423,_0x13bc64,!![]);}catch(_0x167f85){return BPromise[_0x68d3('0x26')](_0x167f85);}return _0x466423[_0x68d3('0x27')]();};}function saveUpdates(_0x4aa6bc,_0x11d939){return function(_0x2ba338){if(_0x2ba338){return _0x2ba338['update'](_0x4aa6bc)[_0x68d3('0x28')](function(_0x31ad45){return _0x31ad45;});}return null;};}function removeEntity(_0x55fb41,_0x4d038c){return function(_0x520c97){if(_0x520c97){return _0x520c97[_0x68d3('0x29')]()[_0x68d3('0x28')](function(){var _0x5a1da9=_0x520c97[_0x68d3('0x2a')]({'plain':!![]});var _0x4f2606=_0x68d3('0x2b');return db[_0x68d3('0x2c')][_0x68d3('0x29')]({'where':{'type':_0x4f2606,'resourceId':_0x5a1da9['id']}})['then'](function(){return _0x520c97;});})[_0x68d3('0x28')](function(){_0x55fb41[_0x68d3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dfd4a,_0x49fa68){return function(_0x4228e3){if(!_0x4228e3){_0x2dfd4a['sendStatus'](0x194);}return _0x4228e3;};}function handleError(_0x47c3e2,_0x164ec){_0x164ec=_0x164ec||0x1f4;return function(_0xd55757){logger[_0x68d3('0x2d')](_0xd55757['stack']);if(_0xd55757[_0x68d3('0x2e')]){delete _0xd55757[_0x68d3('0x2e')];}_0x47c3e2[_0x68d3('0x1d')](_0x164ec)[_0x68d3('0x2f')](_0xd55757);};}exports['index']=function(_0x11f06a,_0x20fa20){var _0x27dff9={},_0x429230={},_0x189181={'count':0x0,'rows':[]};var _0x25fff7=_['map'](db['Plugin'][_0x68d3('0x30')],function(_0x5e6a37){return{'name':_0x5e6a37['fieldName'],'type':_0x5e6a37[_0x68d3('0x31')][_0x68d3('0x32')]};});_0x429230[_0x68d3('0x33')]=_[_0x68d3('0x34')](_0x25fff7,_0x68d3('0x2e'));_0x429230['query']=_[_0x68d3('0x35')](_0x11f06a[_0x68d3('0x36')]);_0x429230['filters']=_[_0x68d3('0x37')](_0x429230[_0x68d3('0x33')],_0x429230[_0x68d3('0x36')]);_0x27dff9['attributes']=_[_0x68d3('0x37')](_0x429230[_0x68d3('0x33')],qs[_0x68d3('0x38')](_0x11f06a[_0x68d3('0x36')][_0x68d3('0x38')]));_0x27dff9[_0x68d3('0x39')]=_0x27dff9[_0x68d3('0x39')][_0x68d3('0x3a')]?_0x27dff9['attributes']:_0x429230[_0x68d3('0x33')];if(!_0x11f06a['query'][_0x68d3('0x3b')](_0x68d3('0x3c'))){_0x27dff9[_0x68d3('0x20')]=qs[_0x68d3('0x20')](_0x11f06a['query'][_0x68d3('0x20')]);_0x27dff9[_0x68d3('0x22')]=qs[_0x68d3('0x22')](_0x11f06a[_0x68d3('0x36')][_0x68d3('0x22')]);}_0x27dff9[_0x68d3('0x3d')]=qs[_0x68d3('0x3e')](_0x11f06a[_0x68d3('0x36')][_0x68d3('0x3e')]);_0x27dff9['where']=qs[_0x68d3('0x3f')](_[_0x68d3('0x40')](_0x11f06a['query'],_0x429230[_0x68d3('0x3f')]),_0x25fff7);if(_0x11f06a[_0x68d3('0x36')]['filter']){_0x27dff9[_0x68d3('0x41')]=_[_0x68d3('0x42')](_0x27dff9[_0x68d3('0x41')],{'$or':_['map'](_0x25fff7,function(_0x1d6ba9){if(_0x1d6ba9[_0x68d3('0x31')]!=='VIRTUAL'){var _0x254c64={};_0x254c64[_0x1d6ba9[_0x68d3('0x2e')]]={'$like':'%'+_0x11f06a[_0x68d3('0x36')][_0x68d3('0x43')]+'%'};return _0x254c64;}})});}_0x27dff9=_['merge']({},_0x27dff9,_0x11f06a['options']);var _0x4c6f19={'where':_0x27dff9['where']};return db[_0x68d3('0x44')][_0x68d3('0x23')](_0x4c6f19)[_0x68d3('0x28')](function(_0x1843da){_0x189181[_0x68d3('0x23')]=_0x1843da;if(_0x11f06a[_0x68d3('0x36')][_0x68d3('0x45')]){_0x27dff9[_0x68d3('0x46')]=[{'all':!![]}];}return db[_0x68d3('0x44')]['findAll'](_0x27dff9);})['then'](function(_0x4b2cf3){_0x189181[_0x68d3('0x47')]=_0x4b2cf3;return _0x189181;})[_0x68d3('0x28')](respondWithFilteredResult(_0x20fa20,_0x27dff9))[_0x68d3('0x48')](handleError(_0x20fa20,null));};exports[_0x68d3('0x49')]=function(_0x54337b,_0x410768){var _0x37f396={'raw':!![],'where':{'id':_0x54337b[_0x68d3('0x4a')]['id']}},_0x39aa28={};_0x39aa28[_0x68d3('0x33')]=_[_0x68d3('0x35')](db[_0x68d3('0x44')][_0x68d3('0x30')]);_0x39aa28['query']=_[_0x68d3('0x35')](_0x54337b[_0x68d3('0x36')]);_0x39aa28[_0x68d3('0x3f')]=_['intersection'](_0x39aa28[_0x68d3('0x33')],_0x39aa28[_0x68d3('0x36')]);_0x37f396[_0x68d3('0x39')]=_[_0x68d3('0x37')](_0x39aa28[_0x68d3('0x33')],qs[_0x68d3('0x38')](_0x54337b[_0x68d3('0x36')][_0x68d3('0x38')]));_0x37f396[_0x68d3('0x39')]=_0x37f396[_0x68d3('0x39')][_0x68d3('0x3a')]?_0x37f396[_0x68d3('0x39')]:_0x39aa28[_0x68d3('0x33')];if(_0x54337b[_0x68d3('0x36')][_0x68d3('0x45')]){_0x37f396[_0x68d3('0x46')]=[{'all':!![]}];}_0x37f396=_[_0x68d3('0x42')]({},_0x37f396,_0x54337b[_0x68d3('0x4b')]);return db['Plugin'][_0x68d3('0x4c')](_0x37f396)['then'](handleEntityNotFound(_0x410768,null))[_0x68d3('0x28')](respondWithResult(_0x410768,null))[_0x68d3('0x48')](handleError(_0x410768,null));};exports['download']=function(_0x2d0e9b,_0x2ca6e2,_0x2f37a4){return db[_0x68d3('0x44')]['find']({'where':{'id':_0x2d0e9b[_0x68d3('0x4a')]['id']},'attributes':[_0x68d3('0x2e'),_0x68d3('0x7')],'raw':!![]})[_0x68d3('0x28')](handleEntityNotFound(_0x2ca6e2,null))[_0x68d3('0x28')](function(_0x314876){if(_0x314876){var _0x1a46ef=path[_0x68d3('0x4d')](config[_0x68d3('0x4e')],_0x68d3('0x4f'),util[_0x68d3('0x50')](_0x68d3('0x51'),path[_0x68d3('0x52')](_0x314876[_0x68d3('0x7')])));var _0x30a904=fs[_0x68d3('0x53')](_0x1a46ef);var _0x329874=archiver('zip',{'zlib':{'level':0x9}});_0x329874['on']('warning',function(_0x58ecf8){if(_0x58ecf8['code']===_0x68d3('0x54')){logger[_0x68d3('0x2d')](_0x58ecf8);}else{throw new db[(_0x68d3('0x55'))]['Error'](_0x68d3('0x56'));}});_0x329874['on']('error',function(_0x1f8cee){throw new db['Sequelize'][(_0x68d3('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x329874[_0x68d3('0x58')](_0x30a904);_0x329874[_0x68d3('0x59')](_0x68d3('0x5a'),{'cwd':path[_0x68d3('0x4d')](config[_0x68d3('0x4e')],_0x68d3('0x4f'),path[_0x68d3('0x5b')](_0x314876[_0x68d3('0x7')])),'ignore':[path[_0x68d3('0x4d')](path[_0x68d3('0x52')](_0x314876[_0x68d3('0x7')]),_0x68d3('0x5c')),path['join'](path[_0x68d3('0x52')](_0x314876[_0x68d3('0x7')]),_0x68d3('0x5d'))],'nodir':!![]})['finalize']();_0x30a904['on']('close',function(){if(!fs[_0x68d3('0x5e')](_0x1a46ef)){throw new db[(_0x68d3('0x55'))][(_0x68d3('0x57'))](_0x68d3('0x5f'));}return _0x2ca6e2[_0x68d3('0x60')](_0x1a46ef,util['format'](_0x68d3('0x51'),path[_0x68d3('0x52')](_0x314876[_0x68d3('0x7')])),function(_0x443f63){if(_0x443f63){throw new db[(_0x68d3('0x55'))]['Error'](_0x68d3('0x61'));}fs['unlinkSync'](_0x1a46ef);logger['info'](_0x68d3('0x62'));logger[_0x68d3('0x63')](_0x68d3('0x64'));});});}return null;})[_0x68d3('0x48')](handleError(_0x2ca6e2,null));};exports[_0x68d3('0x65')]=function(_0xcd54fb,_0x423f14,_0x54862e){var _0x374e53=path[_0x68d3('0x52')](_0xcd54fb[_0x68d3('0x66')]['filename'],path[_0x68d3('0x67')](_0xcd54fb[_0x68d3('0x66')]['filename']));var _0x4bf4d0=path['join'](config['root'],_0x68d3('0x4f'),_0xcd54fb[_0x68d3('0x66')]['filename']);var _0x3a1de4=path[_0x68d3('0x4d')](config['root'],'server/files/plugins',_0x374e53);logger['info'](_0x68d3('0x68'),_0x4bf4d0);logger['info'](_0x68d3('0x69'),_0x3a1de4);try{fs[_0x68d3('0x6a')](_0x4bf4d0,parseInt(_0x68d3('0x6b'),0x8));extract(_0x4bf4d0,{'dir':_0x3a1de4},function(_0x222636){if(_0x222636){logger['error'](_0x222636);handleError(_0x222636,!![]);};var _0x48f0f1=fs[_0x68d3('0x6c')](_0x3a1de4);if(_0x48f0f1[_0x68d3('0x3a')]>0x1){removeReferences(_0x4bf4d0,_0x3a1de4);logger[_0x68d3('0x2d')](_0x68d3('0x6d'));return _0x54862e(new Error(_0x68d3('0x6d')));}var _0x40e953=fs['lstatSync'](path[_0x68d3('0x4d')](_0x3a1de4,_0x48f0f1[0x0]));if(_0x40e953[_0x68d3('0x6e')]()){removeReferences(_0x4bf4d0,_0x3a1de4);logger[_0x68d3('0x2d')](_0x68d3('0x6d'));return _0x54862e(new Error(_0x68d3('0x6d')));}if(_0x40e953['isDirectory']()){var _0x3b273f=fs[_0x68d3('0x6c')](path[_0x68d3('0x4d')](_0x3a1de4,_0x48f0f1[0x0]));if(_0x3b273f[_0x68d3('0x3a')]===0x0){removeReferences(_0x4bf4d0,_0x3a1de4);logger['error'](_0x68d3('0x6d'));return _0x54862e(new Error(_0x68d3('0x6d')));}var _0x433a70=_0x3b273f['some'](function(_0x8aeaa1){return _0x8aeaa1===_0x68d3('0x6f');});if(!_0x433a70){return _0x54862e(new Error(_0x68d3('0x70')));}var _0x568557=fs[_0x68d3('0x71')](path[_0x68d3('0x4d')](_0x3a1de4,_0x48f0f1[0x0],'manifest.json'));var _0x46961e=JSON[_0x68d3('0x72')](_0x568557);if('undefined'==typeof _0x46961e['name']){return _0x54862e(new Error(_0x68d3('0x73')));}if(_0x68d3('0x21')==typeof _0x46961e['type']){return _0x54862e(new Error(_0x68d3('0x74')));}if(_0x68d3('0x21')==typeof _0x46961e['version']){return _0x54862e(new Error(_0x68d3('0x75')));}if('undefined'==typeof _0x46961e[_0x68d3('0x76')]){return _0x54862e(new Error(_0x68d3('0x77')));}if(_0x46961e[_0x68d3('0x31')]===_0x68d3('0x78')){if('undefined'==typeof _0x46961e[_0x68d3('0x76')]['views']){return _0x54862e(new Error(_0x68d3('0x79')));}if(_0x68d3('0x21')==typeof _0x46961e['parameters']['views'][_0x68d3('0x7a')]&&_0x68d3('0x21')==typeof _0x46961e[_0x68d3('0x76')]['views'][_0x68d3('0x7b')]){return _0x54862e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x46961e[_0x68d3('0x31')]===_0x68d3('0x7c')){if(_0x68d3('0x21')==typeof _0x46961e[_0x68d3('0x76')][_0x68d3('0x7d')]){return _0x54862e(new Error(_0x68d3('0x7e')));}if(_0x68d3('0x21')==typeof _0x46961e[_0x68d3('0x76')][_0x68d3('0x7f')]){return _0x54862e(new Error(_0x68d3('0x80')));}}else{return _0x54862e(new Error(_0x68d3('0x81')));}var _0x431a47=_0x46961e[_0x68d3('0x2e')];var _0x54307c=_0x46961e[_0x68d3('0x82')];var _0x153376=_0x46961e[_0x68d3('0x31')];var _0x3a22aa=_0x46961e[_0x68d3('0x83')]?_0x46961e[_0x68d3('0x83')]:_0x68d3('0x84');var _0x289093=_0x46961e[_0x68d3('0x85')]?_0x46961e[_0x68d3('0x85')]:_0x68d3('0x86');var _0x28c47c='';var _0x402438='';var _0x4c0762='';var _0x204269='';var _0x409462=_0x46961e[_0x68d3('0x87')];if(_0x153376===_0x68d3('0x78')){if(_0x68d3('0x21')!=typeof _0x46961e['parameters']['views'][_0x68d3('0x7a')]){var _0x172ada=_0x46961e[_0x68d3('0x76')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x68d3('0x88')](_0x172ada)){_0x28c47c=path[_0x68d3('0x4d')]('plugins',_0x374e53,_0x48f0f1[0x0],_0x172ada);}else{_0x28c47c=_0x172ada;}}else{logger['info'](_0x68d3('0x89'));}if(_0x68d3('0x21')!=typeof _0x46961e['parameters'][_0x68d3('0x8a')][_0x68d3('0x7b')]){var _0x45584a=_0x46961e['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x68d3('0x88')](_0x45584a)){_0x402438=path[_0x68d3('0x4d')](_0x68d3('0x8b'),_0x374e53,_0x48f0f1[0x0],_0x45584a);}else{_0x402438=_0x45584a;}}else{logger[_0x68d3('0x63')](_0x68d3('0x8c'));}}else if(_0x153376==='script'){_0x4c0762=_0x46961e[_0x68d3('0x76')]['scriptName'];_0x204269=_0x46961e[_0x68d3('0x76')][_0x68d3('0x7f')];if(_0x68d3('0x21')!=typeof _0x46961e[_0x68d3('0x76')][_0x68d3('0x8a')]){if(_0x68d3('0x21')!=typeof _0x46961e[_0x68d3('0x76')][_0x68d3('0x8a')][_0x68d3('0x7a')]){var _0x172ada=_0x46961e['parameters'][_0x68d3('0x8a')][_0x68d3('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x68d3('0x88')](_0x172ada)){_0x28c47c=path[_0x68d3('0x4d')](_0x68d3('0x8b'),_0x374e53,_0x48f0f1[0x0],_0x172ada);}else{_0x28c47c=_0x172ada;}}if(_0x68d3('0x21')!=typeof _0x46961e['parameters']['views'][_0x68d3('0x7b')]){var _0x45584a=_0x46961e[_0x68d3('0x76')][_0x68d3('0x8a')][_0x68d3('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x45584a)){_0x402438=path[_0x68d3('0x4d')](_0x68d3('0x8b'),_0x374e53,_0x48f0f1[0x0],_0x45584a);}else{_0x402438=_0x45584a;}}}}var _0x4e9012={'name':_0x431a47,'description':_0x54307c,'path':path[_0x68d3('0x4d')](_0x374e53,_0x48f0f1[0x0]),'type':_0x153376,'sidebar':_0x3a22aa,'icon':_0x289093,'adminUrl':_0x28c47c,'agentUrl':_0x402438,'scriptName':_0x4c0762,'scriptPath':_0x204269,'version':_0x409462};removeReferences(_0x4bf4d0,null);return db[_0x68d3('0x44')]['create'](_0x4e9012)[_0x68d3('0x28')](function(_0x49da70){var _0x275577={'role':_0xcd54fb[_0x68d3('0x8d')][_0x68d3('0x8e')],'userProfileId':_0xcd54fb[_0x68d3('0x8d')][_0x68d3('0x8f')]};if(!_0x275577)throw new Error(_0x68d3('0x90'));if(_0x275577[_0x68d3('0x8e')]===_0x68d3('0x91')){var _0x6b60d6=_0x49da70[_0x68d3('0x2a')]({'plain':!![]});return db[_0x68d3('0x92')][_0x68d3('0x4c')]({'where':{'name':_0x68d3('0x2b'),'userProfileId':_0x275577['userProfileId']},'raw':!![]})[_0x68d3('0x28')](function(_0x489a9b){if(_0x489a9b&&_0x489a9b[_0x68d3('0x93')]===0x0){return db[_0x68d3('0x2c')][_0x68d3('0x94')]({'name':_0x6b60d6['name'],'resourceId':_0x6b60d6['id'],'type':_0x489a9b['name'],'sectionId':_0x489a9b['id']},{})[_0x68d3('0x28')](function(){return _0x49da70;});}else{return _0x49da70;}})['catch'](function(_0x120ba1){logger[_0x68d3('0x2d')](_0x68d3('0x95'),_0x120ba1);throw _0x120ba1;});}return _0x49da70;})[_0x68d3('0x28')](respondWithResult(_0x423f14,null))[_0x68d3('0x48')](handleError(_0x423f14,null));}});}catch(_0x2242e2){_0x423f14[_0x68d3('0x1d')](0x1f4)[_0x68d3('0x2f')](_0x2242e2);}};function removeReferences(_0x2f213f,_0x16a4cf){try{if(_0x2f213f){fs[_0x68d3('0x96')](_0x2f213f);logger[_0x68d3('0x63')](_0x68d3('0x97'));}if(_0x16a4cf){rimraf(_0x16a4cf,function(){});logger[_0x68d3('0x63')]('Extracted\x20folder\x20removed');}}catch(_0x475599){logger[_0x68d3('0x2d')](_0x475599);}}exports['update']=function(_0x395811,_0x1785a2,_0x3f739b){return db[_0x68d3('0x44')][_0x68d3('0x4c')]({'where':{'id':_0x395811[_0x68d3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1785a2,null))['then'](saveUpdates(_0x395811[_0x68d3('0x8d')],null))[_0x68d3('0x28')](respondWithResult(_0x1785a2,null))[_0x68d3('0x48')](handleError(_0x1785a2,null));};exports['delete']=function(_0x553ad7,_0x1df43a,_0x36fb72){return db[_0x68d3('0x44')][_0x68d3('0x4c')]({'where':{'id':_0x553ad7[_0x68d3('0x4a')]['id']}})[_0x68d3('0x28')](function(_0x2b3a4c){if(_0x2b3a4c){return _0x2b3a4c[_0x68d3('0x29')]();}})['then'](function(_0x1602aa){rimraf(path[_0x68d3('0x4d')](config['root'],_0x68d3('0x4f'),path[_0x68d3('0x5b')](_0x1602aa['path'])),function(){});return _0x1602aa;})[_0x68d3('0x28')](handleEntityNotFound(_0x1df43a,null))[_0x68d3('0x28')](respondWithStatusCode(_0x1df43a,null))[_0x68d3('0x48')](handleError(_0x1df43a,null));};exports['webhookGet']=function(_0x28a5a9,_0x3d8e64,_0x41288f){return BPromise[_0x68d3('0x98')]()[_0x68d3('0x28')](function(){if(!_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x7')]){throw new Error(_0x68d3('0x99'));}if(!_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9a')]){throw new Error(_0x68d3('0x9b'));}var _0x2520c2=_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9c')]?_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9c')]+':'+_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9a')]:_0x68d3('0x9d')+_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9a')];var _0x197b4d=_0x28a5a9['query'][_0x68d3('0x1f')]?_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x1f')]:!![];var _0x490ab9=_0x28a5a9[_0x68d3('0x36')][_0x68d3('0x9e')]?_0x28a5a9['query'][_0x68d3('0x9e')]:null;var _0x4f02ef={'method':_0x28a5a9[_0x68d3('0x9f')],'uri':util[_0x68d3('0x50')](_0x68d3('0xa0'),_0x2520c2,_0x28a5a9['query'][_0x68d3('0x7')]),'json':_0x197b4d,'resolveWithFullResponse':!![],'encoding':_0x490ab9,'qs':_0x28a5a9['query']};if(_0x28a5a9['headers']){_0x4f02ef[_0x68d3('0xa1')]=_0x28a5a9[_0x68d3('0xa1')];if(_0x4f02ef[_0x68d3('0xa1')][_0x68d3('0xa2')]){delete _0x4f02ef['headers'][_0x68d3('0xa2')];}}if(_0x4f02ef['headers'][_0x68d3('0xa3')]){delete _0x4f02ef[_0x68d3('0xa1')][_0x68d3('0xa3')];}return rp(_0x4f02ef);})[_0x68d3('0x28')](function(_0x2e2fef){if(_0x2e2fef){_0x3d8e64[_0x68d3('0x24')](_0x2e2fef[_0x68d3('0xa1')]);logger[_0x68d3('0x63')](_0x2e2fef[_0x68d3('0x8d')]);if(_['endsWith'](_0x28a5a9['query'][_0x68d3('0x7')],_0x68d3('0x60'))&&_0x2e2fef[_0x68d3('0xa4')]==0x1f4){return _0x3d8e64['sendStatus'](_0x2e2fef[_0x68d3('0xa4')]);}else{return _0x3d8e64['status'](_0x2e2fef[_0x68d3('0xa4')])[_0x68d3('0x2f')](_0x2e2fef[_0x68d3('0x8d')]);}}else{return _0x3d8e64[_0x68d3('0xa5')](0xc8);}})[_0x68d3('0x48')](handleError(_0x3d8e64,null));};exports[_0x68d3('0xa6')]=function(_0x1af974,_0xd748ee,_0x4253d9){return BPromise[_0x68d3('0x98')]()[_0x68d3('0x28')](function(){if(!_0x1af974['query'][_0x68d3('0x7')]){throw new Error(_0x68d3('0x99'));}if(!_0x1af974[_0x68d3('0x36')][_0x68d3('0x9a')]){throw new Error(_0x68d3('0x9b'));}var _0x49b2a6=_0x1af974[_0x68d3('0x36')][_0x68d3('0x9c')]?_0x1af974[_0x68d3('0x36')][_0x68d3('0x9c')]+':'+_0x1af974[_0x68d3('0x36')][_0x68d3('0x9a')]:_0x68d3('0x9d')+_0x1af974[_0x68d3('0x36')][_0x68d3('0x9a')];var _0x405095=_0x1af974[_0x68d3('0x36')][_0x68d3('0x1f')]?_0x1af974['query'][_0x68d3('0x1f')]:!![];var _0x1fa028=_0x1af974[_0x68d3('0x36')][_0x68d3('0x9e')]?_0x1af974[_0x68d3('0x36')][_0x68d3('0x9e')]:null;var _0x40efb5={'method':_0x1af974['method'],'uri':util['format'](_0x68d3('0xa0'),_0x49b2a6,_0x1af974[_0x68d3('0x36')][_0x68d3('0x7')]),'json':_0x405095,'resolveWithFullResponse':!![],'encoding':_0x1fa028,'body':_0x1af974['body']};if(_0x1af974[_0x68d3('0xa1')]){_0x40efb5[_0x68d3('0xa1')]=_0x1af974[_0x68d3('0xa1')];if(_0x40efb5[_0x68d3('0xa1')][_0x68d3('0xa2')]){delete _0x40efb5[_0x68d3('0xa1')]['content-length'];}}if(_0x40efb5[_0x68d3('0xa1')][_0x68d3('0xa3')]){delete _0x40efb5[_0x68d3('0xa1')][_0x68d3('0xa3')];}return rp(_0x40efb5);})['then'](function(_0x15e842){if(_0x15e842){_0xd748ee[_0x68d3('0x24')](_0x15e842[_0x68d3('0xa1')]);logger[_0x68d3('0x63')](_0x15e842[_0x68d3('0x8d')]);return _0xd748ee[_0x68d3('0x1d')](_0x15e842['statusCode'])['send'](_0x15e842[_0x68d3('0x8d')]);}else{return _0xd748ee['sendStatus'](0xc8);}})['catch'](handleError(_0xd748ee,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b9b5759..8ed2c8b 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 _0x3831=['update','remove','hook','events','Plugin','setMaxListeners','save'];(function(_0x381d3c,_0x4bc7d0){var _0x12542e=function(_0xc3e0c7){while(--_0xc3e0c7){_0x381d3c['push'](_0x381d3c['shift']());}};_0x12542e(++_0x4bc7d0);}(_0x3831,0x14c));var _0x1383=function(_0x331298,_0x12341a){_0x331298=_0x331298-0x0;var _0x3824bc=_0x3831[_0x331298];return _0x3824bc;};'use strict';var EventEmitter=require(_0x1383('0x0'));var Plugin=require('../../mysqldb')['db'][_0x1383('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x1383('0x2')](0x0);var events={'afterCreate':_0x1383('0x3'),'afterUpdate':_0x1383('0x4'),'afterDestroy':_0x1383('0x5')};function emitEvent(_0x580d3d){return function(_0x2fdf72,_0x573874,_0x21ea2c){PluginEvents['emit'](_0x580d3d+':'+_0x2fdf72['id'],_0x2fdf72);PluginEvents['emit'](_0x580d3d,_0x2fdf72);_0x21ea2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x1383('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x8ac9=['remove','emit','exports','events','../../mysqldb','Plugin','update'];(function(_0x35aad3,_0x3a1fc3){var _0xc0041e=function(_0x3a91f7){while(--_0x3a91f7){_0x35aad3['push'](_0x35aad3['shift']());}};_0xc0041e(++_0x3a1fc3);}(_0x8ac9,0x199));var _0x98ac=function(_0x1686c3,_0x24662a){_0x1686c3=_0x1686c3-0x0;var _0x21cd2b=_0x8ac9[_0x1686c3];return _0x21cd2b;};'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 diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 5e7e2ff..a214ea5 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 _0x9fba=['moment','request-promise','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','../../config/logger','api'];(function(_0xb889b6,_0x35d962){var _0x4f2dc3=function(_0x4998bd){while(--_0x4998bd){_0xb889b6['push'](_0xb889b6['shift']());}};_0x4f2dc3(++_0x35d962);}(_0x9fba,0x11f));var _0xa9fb=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x9fba[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xa9fb('0x0'));var util=require('util');var logger=require(_0xa9fb('0x1'))(_0xa9fb('0x2'));var moment=require(_0xa9fb('0x3'));var BPromise=require('bluebird');var rp=require(_0xa9fb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa9fb('0x5'));var attributes=require(_0xa9fb('0x6'));module[_0xa9fb('0x7')]=function(_0x3b4548,_0xb8df13){return _0x3b4548[_0xa9fb('0x8')](_0xa9fb('0x9'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0830=['api','bluebird','request-promise','path','../../config/environment','exports','define','plugins','lodash','util'];(function(_0xeb9cb8,_0x439578){var _0x3b40aa=function(_0x483e97){while(--_0x483e97){_0xeb9cb8['push'](_0xeb9cb8['shift']());}};_0x3b40aa(++_0x439578);}(_0x0830,0xd0));var _0x0083=function(_0x2f85b3,_0x416a6f){_0x2f85b3=_0x2f85b3-0x0;var _0x99349d=_0x0830[_0x2f85b3];return _0x99349d;};'use strict';var _=require(_0x0083('0x0'));var util=require(_0x0083('0x1'));var logger=require('../../config/logger')(_0x0083('0x2'));var moment=require('moment');var BPromise=require(_0x0083('0x3'));var rp=require(_0x0083('0x4'));var fs=require('fs');var path=require(_0x0083('0x5'));var rimraf=require('rimraf');var config=require(_0x0083('0x6'));var attributes=require('./plugin.attributes');module[_0x0083('0x7')]=function(_0x2c47aa,_0x325a7a){return _0x2c47aa[_0x0083('0x8')]('Plugin',attributes,{'tableName':_0x0083('0x9'),'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 ba9ea6e..f67330c 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 _0xde55=['util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','Plugin','create','body','options','raw','CreatePlugin','stringify','lodash'];(function(_0x3befc8,_0x4099b0){var _0x1dad27=function(_0x14d0d5){while(--_0x14d0d5){_0x3befc8['push'](_0x3befc8['shift']());}};_0x1dad27(++_0x4099b0);}(_0xde55,0xd1));var _0x5de5=function(_0x3b0581,_0x6c5b36){_0x3b0581=_0x3b0581-0x0;var _0x4d39b2=_0xde55[_0x3b0581];return _0x4d39b2;};'use strict';var _=require(_0x5de5('0x0'));var util=require(_0x5de5('0x1'));var moment=require(_0x5de5('0x2'));var BPromise=require(_0x5de5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5de5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5de5('0x5'))(_0x5de5('0x6'));var config=require(_0x5de5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5de5('0x8')]({'port':0x232a});config[_0x5de5('0x9')]=_['defaults'](config[_0x5de5('0x9')],{'host':_0x5de5('0xa'),'port':0x18eb});var socket=require(_0x5de5('0xb'))(new Redis(config[_0x5de5('0x9')]));require(_0x5de5('0xc'))[_0x5de5('0xd')](socket);function respondWithRpcPromise(_0x125593,_0x39a928,_0x148d8b){return new BPromise(function(_0x5677d2,_0x3e9219){return client['request'](_0x125593,_0x148d8b)[_0x5de5('0xe')](function(_0x1b3ac8){logger[_0x5de5('0xf')](_0x5de5('0x10'),_0x39a928,_0x5de5('0x11'));logger[_0x5de5('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x39a928,'request\x20sent',JSON['stringify'](_0x1b3ac8));if(_0x1b3ac8[_0x5de5('0x13')]){if(_0x1b3ac8['error'][_0x5de5('0x14')]===0x1f4){logger[_0x5de5('0x13')](_0x5de5('0x10'),_0x39a928,_0x1b3ac8['error'][_0x5de5('0x15')]);return _0x3e9219(_0x1b3ac8[_0x5de5('0x13')][_0x5de5('0x15')]);}logger[_0x5de5('0x13')]('Plugin,\x20%s,\x20%s',_0x39a928,_0x1b3ac8['error'][_0x5de5('0x15')]);return _0x5677d2(_0x1b3ac8[_0x5de5('0x13')][_0x5de5('0x15')]);}else{logger[_0x5de5('0xf')]('Plugin,\x20%s,\x20%s',_0x39a928,_0x5de5('0x11'));_0x5677d2(_0x1b3ac8['result'][_0x5de5('0x15')]);}})[_0x5de5('0x16')](function(_0x1b2f12){logger[_0x5de5('0x13')](_0x5de5('0x10'),_0x39a928,_0x1b2f12);_0x3e9219(_0x1b2f12);});});}exports['CreatePlugin']=function(_0x2abaa7){var _0x4432a8=this;return new Promise(function(_0x431160,_0x29983c){return db[_0x5de5('0x17')][_0x5de5('0x18')](_0x2abaa7[_0x5de5('0x19')],{'raw':_0x2abaa7[_0x5de5('0x1a')]?_0x2abaa7['options'][_0x5de5('0x1b')]===undefined?!![]:![]:!![]})[_0x5de5('0xe')](function(_0x26753b){logger['info'](_0x5de5('0x1c'),_0x2abaa7);logger['debug']('CreatePlugin',_0x2abaa7,JSON[_0x5de5('0x1d')](_0x26753b));_0x431160(_0x26753b);})[_0x5de5('0x16')](function(_0x2ce1f6){logger[_0x5de5('0x13')]('CreatePlugin',_0x2ce1f6['message'],_0x2abaa7);_0x29983c(_0x4432a8[_0x5de5('0x13')](0x1f4,_0x2ce1f6[_0x5de5('0x15')]));});});}; \ No newline at end of file +var _0x6ade=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','create','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ade,0x15a));var _0xe6ad=function(_0x4029e8,_0x393ca2){_0x4029e8=_0x4029e8-0x0;var _0x11195c=_0x6ade[_0x4029e8];return _0x11195c;};'use strict';var _=require(_0xe6ad('0x0'));var util=require('util');var moment=require(_0xe6ad('0x1'));var BPromise=require(_0xe6ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6ad('0x3'));var db=require(_0xe6ad('0x4'))['db'];var utils=require(_0xe6ad('0x5'));var logger=require(_0xe6ad('0x6'))(_0xe6ad('0x7'));var config=require(_0xe6ad('0x8'));var jayson=require(_0xe6ad('0x9'));var client=jayson[_0xe6ad('0xa')][_0xe6ad('0xb')]({'port':0x232a});config[_0xe6ad('0xc')]=_['defaults'](config[_0xe6ad('0xc')],{'host':_0xe6ad('0xd'),'port':0x18eb});var socket=require(_0xe6ad('0xe'))(new Redis(config[_0xe6ad('0xc')]));require(_0xe6ad('0xf'))['register'](socket);function respondWithRpcPromise(_0x4c89c2,_0x2056af,_0x558fa6){return new BPromise(function(_0x2e4d2c,_0xe7a2ba){return client[_0xe6ad('0x10')](_0x4c89c2,_0x558fa6)[_0xe6ad('0x11')](function(_0x127d03){logger[_0xe6ad('0x12')](_0xe6ad('0x13'),_0x2056af,_0xe6ad('0x14'));logger[_0xe6ad('0x15')](_0xe6ad('0x16'),_0x2056af,_0xe6ad('0x14'),JSON[_0xe6ad('0x17')](_0x127d03));if(_0x127d03[_0xe6ad('0x18')]){if(_0x127d03[_0xe6ad('0x18')][_0xe6ad('0x19')]===0x1f4){logger['error'](_0xe6ad('0x13'),_0x2056af,_0x127d03[_0xe6ad('0x18')]['message']);return _0xe7a2ba(_0x127d03[_0xe6ad('0x18')][_0xe6ad('0x1a')]);}logger[_0xe6ad('0x18')](_0xe6ad('0x13'),_0x2056af,_0x127d03[_0xe6ad('0x18')][_0xe6ad('0x1a')]);return _0x2e4d2c(_0x127d03[_0xe6ad('0x18')][_0xe6ad('0x1a')]);}else{logger['info'](_0xe6ad('0x13'),_0x2056af,'request\x20sent');_0x2e4d2c(_0x127d03['result'][_0xe6ad('0x1a')]);}})[_0xe6ad('0x1b')](function(_0x3c6d1a){logger[_0xe6ad('0x18')](_0xe6ad('0x13'),_0x2056af,_0x3c6d1a);_0xe7a2ba(_0x3c6d1a);});});}exports[_0xe6ad('0x1c')]=function(_0x3d114b){var _0x14bce7=this;return new Promise(function(_0x4e8393,_0xcbd7ae){return db['Plugin'][_0xe6ad('0x1d')](_0x3d114b[_0xe6ad('0x1e')],{'raw':_0x3d114b[_0xe6ad('0x1f')]?_0x3d114b[_0xe6ad('0x1f')][_0xe6ad('0x20')]===undefined?!![]:![]:!![]})[_0xe6ad('0x11')](function(_0x1c0bcc){logger['info']('CreatePlugin',_0x3d114b);logger['debug'](_0xe6ad('0x1c'),_0x3d114b,JSON[_0xe6ad('0x17')](_0x1c0bcc));_0x4e8393(_0x1c0bcc);})[_0xe6ad('0x1b')](function(_0x3e1272){logger[_0xe6ad('0x18')](_0xe6ad('0x1c'),_0x3e1272[_0xe6ad('0x1a')],_0x3d114b);_0xcbd7ae(_0x14bce7[_0xe6ad('0x18')](0x1f4,_0x3e1272[_0xe6ad('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6e0649d..ea1f58f 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 _0xd6d9=['removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x4f5e7d,_0x4ba041){var _0x2224f2=function(_0xdfaee7){while(--_0xdfaee7){_0x4f5e7d['push'](_0x4f5e7d['shift']());}};_0x2224f2(++_0x4ba041);}(_0xd6d9,0xd4));var _0x9d6d=function(_0x5e9bae,_0x596ade){_0x5e9bae=_0x5e9bae-0x0;var _0x5eb7ad=_0xd6d9[_0x5e9bae];return _0x5eb7ad;};'use strict';var PluginEvents=require(_0x9d6d('0x0'));var events=[_0x9d6d('0x1'),_0x9d6d('0x2'),_0x9d6d('0x3')];function createListener(_0x5d729e,_0x3787f5){return function(_0x20a6dd){_0x3787f5['emit'](_0x5d729e,_0x20a6dd);};}function removeListener(_0x12f4f3,_0x20d79c){return function(){PluginEvents[_0x9d6d('0x4')](_0x12f4f3,_0x20d79c);};}exports[_0x9d6d('0x5')]=function(_0x11e833){for(var _0x5d4db8=0x0,_0xbb646=events[_0x9d6d('0x6')];_0x5d4db8<_0xbb646;_0x5d4db8++){var _0x133d37=events[_0x5d4db8];var _0x164ee5=createListener(_0x9d6d('0x7')+_0x133d37,_0x11e833);PluginEvents['on'](_0x133d37,_0x164ee5);}}; \ No newline at end of file +var _0xb2be=['update','emit','removeListener','register','length','plugin:'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xb2be,0x198));var _0xeb2b=function(_0x5a9fb9,_0xb126c4){_0x5a9fb9=_0x5a9fb9-0x0;var _0x110430=_0xb2be[_0x5a9fb9];return _0x110430;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0xeb2b('0x0')];function createListener(_0x1adc13,_0x15158a){return function(_0x3f2d2b){_0x15158a[_0xeb2b('0x1')](_0x1adc13,_0x3f2d2b);};}function removeListener(_0x3c975c,_0x31b3a4){return function(){PluginEvents[_0xeb2b('0x2')](_0x3c975c,_0x31b3a4);};}exports[_0xeb2b('0x3')]=function(_0xa47f4a){for(var _0x9b8aba=0x0,_0x15a942=events[_0xeb2b('0x4')];_0x9b8aba<_0x15a942;_0x9b8aba++){var _0xc52d74=events[_0x9b8aba];var _0x1a9f15=createListener(_0xeb2b('0x5')+_0xc52d74,_0xa47f4a);PluginEvents['on'](_0xc52d74,_0x1a9f15);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f471629..b736f6c 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(_0x5ee956,_0x507031){var _0xd81970=function(_0x3bc561){while(--_0x3bc561){_0x5ee956['push'](_0x5ee956['shift']());}};_0xd81970(++_0x507031);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x1f9807,_0x26211b){var _0x47181d=function(_0x453da0){while(--_0x453da0){_0x1f9807['push'](_0x1f9807['shift']());}};_0x47181d(++_0x26211b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 946b9e8..cbbbe4c 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 _0x96cc=['bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','lodash','../../config/logger','path','child_process','exec'];(function(_0x37d0b9,_0x1db60c){var _0x4425a9=function(_0x574e82){while(--_0x574e82){_0x37d0b9['push'](_0x37d0b9['shift']());}};_0x4425a9(++_0x1db60c);}(_0x96cc,0x16c));var _0xc96c=function(_0xc49b87,_0x9b1222){_0xc49b87=_0xc49b87-0x0;var _0x3c72c7=_0x96cc[_0xc49b87];return _0x3c72c7;};'use strict';var _=require(_0xc96c('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xc96c('0x1'))('api');var path=require(_0xc96c('0x2'));var exec=require(_0xc96c('0x3'))[_0xc96c('0x4')];var BPromise=require(_0xc96c('0x5'));function handleEntityNotFound(_0x71140d,_0x29b6f1){return function(_0x377e6c){if(!_0x377e6c){_0x71140d[_0xc96c('0x6')](0x194);;}return _0x377e6c;};}function respondWithResult(_0x3b7f45,_0x5142cd){_0x5142cd=_0x5142cd||0xc8;return function(_0x10b411){if(_0x10b411){return _0x3b7f45[_0xc96c('0x7')](_0x5142cd)[_0xc96c('0x8')](_0x10b411);}return null;};}function handleError(_0x86c1a8,_0x13363d){_0x13363d=_0x13363d||0x1f4;return function(_0x4c9f93){logger[_0xc96c('0x9')](_0x4c9f93['stack']);if(_0x4c9f93[_0xc96c('0xa')]){delete _0x4c9f93[_0xc96c('0xa')];}_0x86c1a8[_0xc96c('0x7')](_0x13363d)['send'](_0x4c9f93);};}function execChildProcess(){return new BPromise(function(_0x95ce8e,_0x4a91dd){exec(_0xc96c('0xb'),function(_0x559477,_0x18a1a6,_0x32f682){logger[_0xc96c('0xc')](_0x18a1a6);logger[_0xc96c('0xc')](_0x32f682);if(_0x559477){logger['error'](_0x559477);return _0x4a91dd(_0x559477);}return _0x95ce8e(_0x18a1a6);});});}exports[_0xc96c('0xd')]=function(_0x43fcaa,_0x1e7742){return pm2[_0xc96c('0xe')]()['then'](function(_0x35da94){if(_0x35da94){var _0xbed0c9=_[_0xc96c('0xf')](_0x35da94,function(_0x32e640){return _0x32e640[_0xc96c('0xa')]===_0xc96c('0x10')||_0x32e640[_0xc96c('0xa')]===_0xc96c('0x11');});return{'rows':_0xbed0c9,'count':_0xbed0c9[_0xc96c('0x12')]};}return null;})[_0xc96c('0x13')](respondWithResult(_0x1e7742,null))[_0xc96c('0x14')](handleError(_0x1e7742,null));};exports['show']=function(_0x509376,_0x406791){return pm2[_0xc96c('0x15')](_0x509376[_0xc96c('0x16')]['id'])[_0xc96c('0x13')](respondWithResult(_0x406791,null))['then'](handleEntityNotFound(_0x406791,null))[_0xc96c('0x14')](handleError(_0x406791,null));};exports[_0xc96c('0x17')]=function(_0x2a361c,_0x3c0864){if(_0x2a361c[_0xc96c('0x18')][_0xc96c('0xa')]&&_0x2a361c[_0xc96c('0x18')][_0xc96c('0x19')]){var _0x28d762=path[_0xc96c('0x1a')](__dirname,_0xc96c('0x1b'),_0x2a361c[_0xc96c('0x18')][_0xc96c('0x19')]);var _0x45edee=process[_0xc96c('0x1c')]();process[_0xc96c('0x1d')](path[_0xc96c('0x1e')](_0x28d762));return execChildProcess()['then'](function(_0xd63951){process[_0xc96c('0x1d')](_0x45edee);return pm2[_0xc96c('0x1f')]({'name':_0x2a361c[_0xc96c('0x18')][_0xc96c('0xa')],'script':_0x28d762});})[_0xc96c('0x13')](function(_0x40f23d){pm2[_0xc96c('0x20')]();return _0x40f23d[0x0];})[_0xc96c('0x13')](respondWithResult(_0x3c0864,0xc9))[_0xc96c('0x14')](handleError(_0x3c0864,null));}else{return _0x3c0864['status'](0x1f4)[_0xc96c('0x21')]({'message':_0xc96c('0x22')});}};exports[_0xc96c('0x23')]=function(_0x294fee,_0x58fab3){if(_0x294fee['body']['id']){delete _0x294fee[_0xc96c('0x18')]['id'];}var _0x12c293={'online':_0xc96c('0x24'),'stopped':_0xc96c('0x25')};if(_0x12c293[_0xc96c('0x26')](_0x294fee[_0xc96c('0x18')][_0xc96c('0x7')])){return pm2[_0x12c293[_0x294fee[_0xc96c('0x18')][_0xc96c('0x7')]]](_0x294fee[_0xc96c('0x16')]['id'])[_0xc96c('0x13')](respondWithResult(_0x58fab3,0xc8))[_0xc96c('0x14')](handleError(_0x58fab3,null));}else{return _0x58fab3[_0xc96c('0x7')](0x1f4)[_0xc96c('0x21')]({'message':'Unknown\x20status'});}};exports[_0xc96c('0x27')]=function(_0x53c994,_0x3f4b0e){if(_0x53c994[_0xc96c('0x18')]['id']){delete _0x53c994[_0xc96c('0x18')]['id'];}if(_0x53c994['params']['id']){return pm2[_0xc96c('0x28')](_0x53c994[_0xc96c('0x16')]['id'])[_0xc96c('0x13')](function(_0x26c5b7){pm2['dump']();return _0x26c5b7[0x0];})['then'](respondWithResult(_0x3f4b0e,null))[_0xc96c('0x14')](handleError(_0x3f4b0e,null));}else{return _0x3f4b0e[_0xc96c('0x7')](0x1f4)[_0xc96c('0x21')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xd8b0=['info','index','list','then','reject','express','motion2','length','show','describe','params','catch','body','script','join','dirname','chdir','start','update','restart','hasOwnProperty','Unknown\x20status','destroy','dump','Unknown\x20id','lodash','../../config/pm2','child_process','exec','bluebird','json','error','stack','name','status','send','npm\x20install'];(function(_0x3f9bbf,_0x197a82){var _0x555b03=function(_0x1ed120){while(--_0x1ed120){_0x3f9bbf['push'](_0x3f9bbf['shift']());}};_0x555b03(++_0x197a82);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var pm2=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var path=require('path');var exec=require(_0x0d8b('0x2'))[_0x0d8b('0x3')];var BPromise=require(_0x0d8b('0x4'));function handleEntityNotFound(_0x364286,_0x8196ed){return function(_0x577834){if(!_0x577834){_0x364286['sendStatus'](0x194);;}return _0x577834;};}function respondWithResult(_0x3f8b6f,_0x227c63){_0x227c63=_0x227c63||0xc8;return function(_0x39f43a){if(_0x39f43a){return _0x3f8b6f['status'](_0x227c63)[_0x0d8b('0x5')](_0x39f43a);}return null;};}function handleError(_0x284169,_0x58e4e2){_0x58e4e2=_0x58e4e2||0x1f4;return function(_0x129310){logger[_0x0d8b('0x6')](_0x129310[_0x0d8b('0x7')]);if(_0x129310[_0x0d8b('0x8')]){delete _0x129310[_0x0d8b('0x8')];}_0x284169[_0x0d8b('0x9')](_0x58e4e2)[_0x0d8b('0xa')](_0x129310);};}function execChildProcess(){return new BPromise(function(_0x28f87c,_0x48fa16){exec(_0x0d8b('0xb'),function(_0x4e0269,_0x4225c4,_0xc574a3){logger[_0x0d8b('0xc')](_0x4225c4);logger[_0x0d8b('0xc')](_0xc574a3);if(_0x4e0269){logger[_0x0d8b('0x6')](_0x4e0269);return _0x48fa16(_0x4e0269);}return _0x28f87c(_0x4225c4);});});}exports[_0x0d8b('0xd')]=function(_0x15dd0f,_0x31a8cc){return pm2[_0x0d8b('0xe')]()[_0x0d8b('0xf')](function(_0x5ad086){if(_0x5ad086){var _0xe65334=_[_0x0d8b('0x10')](_0x5ad086,function(_0x2d4e1c){return _0x2d4e1c['name']===_0x0d8b('0x11')||_0x2d4e1c[_0x0d8b('0x8')]===_0x0d8b('0x12');});return{'rows':_0xe65334,'count':_0xe65334[_0x0d8b('0x13')]};}return null;})[_0x0d8b('0xf')](respondWithResult(_0x31a8cc,null))['catch'](handleError(_0x31a8cc,null));};exports[_0x0d8b('0x14')]=function(_0x4586c2,_0x2fd0fc){return pm2[_0x0d8b('0x15')](_0x4586c2[_0x0d8b('0x16')]['id'])[_0x0d8b('0xf')](respondWithResult(_0x2fd0fc,null))[_0x0d8b('0xf')](handleEntityNotFound(_0x2fd0fc,null))[_0x0d8b('0x17')](handleError(_0x2fd0fc,null));};exports['create']=function(_0x27512e,_0x23d58f){if(_0x27512e[_0x0d8b('0x18')][_0x0d8b('0x8')]&&_0x27512e[_0x0d8b('0x18')][_0x0d8b('0x19')]){var _0x393beb=path[_0x0d8b('0x1a')](__dirname,'../../files/plugins',_0x27512e['body'][_0x0d8b('0x19')]);var _0x54a9a7=process['cwd']();process['chdir'](path[_0x0d8b('0x1b')](_0x393beb));return execChildProcess()[_0x0d8b('0xf')](function(_0x214778){process[_0x0d8b('0x1c')](_0x54a9a7);return pm2[_0x0d8b('0x1d')]({'name':_0x27512e[_0x0d8b('0x18')][_0x0d8b('0x8')],'script':_0x393beb});})[_0x0d8b('0xf')](function(_0x27b695){pm2['dump']();return _0x27b695[0x0];})[_0x0d8b('0xf')](respondWithResult(_0x23d58f,0xc9))[_0x0d8b('0x17')](handleError(_0x23d58f,null));}else{return _0x23d58f['status'](0x1f4)[_0x0d8b('0xa')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x0d8b('0x1e')]=function(_0x234bdd,_0xa2af02){if(_0x234bdd['body']['id']){delete _0x234bdd['body']['id'];}var _0x28f639={'online':_0x0d8b('0x1f'),'stopped':'stop'};if(_0x28f639[_0x0d8b('0x20')](_0x234bdd['body'][_0x0d8b('0x9')])){return pm2[_0x28f639[_0x234bdd['body'][_0x0d8b('0x9')]]](_0x234bdd['params']['id'])[_0x0d8b('0xf')](respondWithResult(_0xa2af02,0xc8))['catch'](handleError(_0xa2af02,null));}else{return _0xa2af02[_0x0d8b('0x9')](0x1f4)['send']({'message':_0x0d8b('0x21')});}};exports[_0x0d8b('0x22')]=function(_0x2c058d,_0x56120a){if(_0x2c058d['body']['id']){delete _0x2c058d['body']['id'];}if(_0x2c058d[_0x0d8b('0x16')]['id']){return pm2['delete'](_0x2c058d[_0x0d8b('0x16')]['id'])['then'](function(_0x5d05fc){pm2[_0x0d8b('0x23')]();return _0x5d05fc[0x0];})[_0x0d8b('0xf')](respondWithResult(_0x56120a,null))[_0x0d8b('0x17')](handleError(_0x56120a,null));}else{return _0x56120a[_0x0d8b('0x9')](0x1f4)[_0x0d8b('0xa')]({'message':_0x0d8b('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index ccd8126..479fb97 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 _0x2687=['/queues','getQueues','exports','express','Router','./realtime.controller','get'];(function(_0x830ef2,_0x46254c){var _0x36a710=function(_0x58f05e){while(--_0x58f05e){_0x830ef2['push'](_0x830ef2['shift']());}};_0x36a710(++_0x46254c);}(_0x2687,0x8f));var _0x7268=function(_0x1f9faf,_0x227808){_0x1f9faf=_0x1f9faf-0x0;var _0x13ab2c=_0x2687[_0x1f9faf];return _0x13ab2c;};'use strict';var express=require(_0x7268('0x0'));var router=express[_0x7268('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x7268('0x2'));router[_0x7268('0x3')](_0x7268('0x4'),auth['isAuthenticated'](),controller[_0x7268('0x5')]);module[_0x7268('0x6')]=router; \ No newline at end of file +var _0x3906=['./realtime.controller','/queues','isAuthenticated','exports','express','Router'];(function(_0x23fad2,_0x5a9ccd){var _0x4ffd05=function(_0x598d75){while(--_0x598d75){_0x23fad2['push'](_0x23fad2['shift']());}};_0x4ffd05(++_0x5a9ccd);}(_0x3906,0xd6));var _0x6390=function(_0x2566ea,_0x1fd4eb){_0x2566ea=_0x2566ea-0x0;var _0x15dda8=_0x3906[_0x2566ea];return _0x15dda8;};'use strict';var express=require(_0x6390('0x0'));var router=express[_0x6390('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x6390('0x2'));router['get'](_0x6390('0x3'),auth[_0x6390('0x4')](),controller['getQueues']);module[_0x6390('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8938657..315a731 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 _0x0a6b=['channel','includes','query','toLowerCase','Invalid\x20channel','startCase','Queue','map','rawAttributes','fieldName','key','getOptions','user','userProfileId','type','Queues','filter','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','outbound','push','pTalking','originated','message','dialMethod','Trunk','startProgressive','erlangCalls','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','paused','loggedInDb','find','rows','merge','pick','getAgents','online','getMembers','UserId','agents','User','findAll','agent','length','catch','util','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','set','Content-Range','json','error','stack','name','send','chat','sms','openchannel','voice','resolve','then'];(function(_0x1b303d,_0x23dad5){var _0x36d00f=function(_0x235dc3){while(--_0x235dc3){_0x1b303d['push'](_0x1b303d['shift']());}};_0x36d00f(++_0x23dad5);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1bb45d,_0xc82252){_0x1bb45d=_0x1bb45d-0x0;var _0x7d8175=_0x0a6b[_0x1bb45d];return _0x7d8175;};'use strict';var util=require(_0xb0a6('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0xb0a6('0x1'))('api');var db=require(_0xb0a6('0x2'))['db'];var client=jayson[_0xb0a6('0x3')][_0xb0a6('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xb0a6('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4cc3ae,_0xbbdf89){return function(_0x415e9e){if(_0x415e9e){var _0x5e2d2d=typeof _0xbbdf89[_0xb0a6('0x5')]===_0xb0a6('0x6')&&typeof _0xbbdf89[_0xb0a6('0x7')]==='undefined';var _0x47c553=_0x415e9e['count'];var _0x2ded05=_0x5e2d2d?0x0:_0xbbdf89[_0xb0a6('0x5')];var _0x34b835=_0x5e2d2d?_0x415e9e[_0xb0a6('0x8')]:_0xbbdf89['offset']+_0xbbdf89[_0xb0a6('0x7')];var _0x19b144;if(_0x34b835>=_0x47c553){_0x34b835=_0x47c553;_0x19b144=0xc8;}else{_0x19b144=0xce;}_0x4cc3ae['status'](_0x19b144);return _0x4cc3ae[_0xb0a6('0x9')](_0xb0a6('0xa'),_0x2ded05+'-'+_0x34b835+'/'+_0x47c553)[_0xb0a6('0xb')](_0x415e9e);}return null;};}function handleError(_0x2a5bb3,_0x471d0f){_0x471d0f=_0x471d0f||0x1f4;return function(_0x3e06df){logger[_0xb0a6('0xc')](_0x3e06df[_0xb0a6('0xd')]);if(_0x3e06df[_0xb0a6('0xe')]){delete _0x3e06df[_0xb0a6('0xe')];}_0x2a5bb3['status'](_0x471d0f)[_0xb0a6('0xf')](_0x3e06df);};}exports['getQueues']=function(_0x397c36,_0x5351ed){var _0x25582f=['mail',_0xb0a6('0x10'),_0xb0a6('0x11'),_0xb0a6('0x12'),'fax','whatsapp',_0xb0a6('0x13')];var _0x295b53={'count':0x0,'rows':[]},_0x59bc9c={},_0x18f994;Promise[_0xb0a6('0x14')]()[_0xb0a6('0x15')](function(){if(_0x397c36['query'][_0xb0a6('0x16')]){if(!_[_0xb0a6('0x17')](_0x25582f,_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x16')][_0xb0a6('0x19')]()))throw new Error(_0xb0a6('0x1a'));_0x18f994=_0x397c36['query'][_0xb0a6('0x16')][_0xb0a6('0x19')]();}var _0x2d0fca=_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x1c');var _0x10e56b=_[_0xb0a6('0x1d')](db[_0x2d0fca][_0xb0a6('0x1e')],function(_0x4b9a6c){return{'name':_0x4b9a6c[_0xb0a6('0x1f')],'type':_0x4b9a6c['type'][_0xb0a6('0x20')]};});_0x59bc9c=qs[_0xb0a6('0x21')](_0x10e56b,_0x397c36);if(_0x397c36['user']['role']===_0xb0a6('0x22')){var _0x14993f={'params':{'id':_0x397c36['user'][_0xb0a6('0x23')]},'query':{'section':_0x18f994===_0xb0a6('0x13')&&_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]==='outbound'?'QueueCampaigns':_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x25'),'type':_0x397c36[_0xb0a6('0x18')]['type'],'nolimit':!![],'sort':_0xb0a6('0xe'),'filter':_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x26')]}};return db[_0xb0a6('0x27')][_0xb0a6('0x28')](_0x14993f);}return db[_0x2d0fca][_0xb0a6('0x29')](_0x59bc9c);})[_0xb0a6('0x15')](function(_0x305661){_0x295b53[_0xb0a6('0x8')]=_0x305661['count'];var _0x12d683=_0x18f994===_0xb0a6('0x13')?client:routingClient;return _0x12d683[_0xb0a6('0x2a')](_['startCase'](_0x18f994)+_0xb0a6('0x25'),_0x397c36)['then'](function(_0x131e46){if(_0x131e46[_0xb0a6('0xc')])throw new Error(util[_0xb0a6('0x2b')](_0xb0a6('0x2c'),_0x18f994));var _0x816aa5=_0x131e46[_0xb0a6('0x2d')];var _0x3ead24=[_0xb0a6('0x2e'),_0xb0a6('0x2f'),_0xb0a6('0x30'),'talking','paused'];if(_0x18f994===_0xb0a6('0x13')&&_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]===_0xb0a6('0x31')){_0x3ead24[_0xb0a6('0x32')](_0xb0a6('0x33'),_0xb0a6('0x34'),_0xb0a6('0x35'),'dialActive',_0xb0a6('0x36'),_0xb0a6('0x37'),'startPredictive',_0xb0a6('0x38'),_0xb0a6('0x39'),'erlangCallToSecond','erlangAbandonmentRate',_0xb0a6('0x3a'),_0xb0a6('0x3b'),_0xb0a6('0x3c'),_0xb0a6('0x3d'),_0xb0a6('0x3e'),_0xb0a6('0x3f'),'predictiveIntervalAnsweredCalls',_0xb0a6('0x40'),'predictiveIntervalDroppedCallsCallersExit',_0xb0a6('0x41'),_0xb0a6('0x42'));}var _0x52e20d=_0x305661['rows']['map'](function(_0x3c4f52){var _0xd484f=_0x3c4f52[_0xb0a6('0x43')]({'plain':!![]});_0xd484f[_0xb0a6('0x44')]=0x0;_0xd484f[_0xb0a6('0x45')]=0x0;_0xd484f['loggedIn']=0x0;_0xd484f[_0xb0a6('0x2f')]=0x0;_0xd484f[_0xb0a6('0x44')]=0x0;_0xd484f[_0xb0a6('0x30')]=0x0;if(_0x18f994===_0xb0a6('0x13')){_0xd484f['talking']=0x0;if(_0x397c36[_0xb0a6('0x18')][_0xb0a6('0x24')]===_0xb0a6('0x31')){_0xd484f[_0xb0a6('0x33')]=0x0;_0xd484f[_0xb0a6('0x34')]=0x0;}}_0xd484f['agents']=[];var _0x53cdfa=_[_0xb0a6('0x46')](_0x816aa5[_0xb0a6('0x47')],['id',_0xd484f['id']]);if(_0x53cdfa)_[_0xb0a6('0x48')](_0xd484f,_[_0xb0a6('0x49')](_0x53cdfa,_0x3ead24));if(_0x18f994===_0xb0a6('0x13')){return _0x3c4f52[_0xb0a6('0x4a')]({'attributes':['id',_0xb0a6('0xe'),_0xb0a6('0x4b')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x1fe910){return _0x3c4f52[_0xb0a6('0x4c')]({'raw':!![]})[_0xb0a6('0x15')](function(_0x3014df){for(var _0x27f208=0x0;_0x27f208<_0x1fe910['length'];_0x27f208++){var _0x156a4b=_['find'](_0x3014df,[_0xb0a6('0x4d'),_0x1fe910[_0x27f208]['id']]);var _0x53a6d5={'id':_0x1fe910[_0x27f208]['id'],'name':_0x1fe910[_0x27f208][_0xb0a6('0xe')],'online':Boolean(_0x1fe910[_0x27f208]['online']),'paused':_0x156a4b?Boolean(_0x156a4b[_0xb0a6('0x44')]):![]};if(_0x53a6d5[_0xb0a6('0x4b')])_0xd484f[_0xb0a6('0x45')]++;if(_0x53a6d5[_0xb0a6('0x44')])_0xd484f[_0xb0a6('0x44')]++;_0xd484f[_0xb0a6('0x4e')][_0xb0a6('0x32')](_0x53a6d5);}return _0xd484f;});});}else{var _0x2937ef=_0xb0a6('0x4f')+_[_0xb0a6('0x1b')](_0x18f994)+_0xb0a6('0x1c');var _0x449c25=_0x18f994+'Pause';return db[_0x2937ef][_0xb0a6('0x50')]({'where':{[_[_0xb0a6('0x1b')](_0x18f994)+'QueueId']:_0x3c4f52['id']},'raw':!![]})[_0xb0a6('0x15')](function(_0x523794){return db[_0xb0a6('0x4f')][_0xb0a6('0x50')]({'attributes':['id',_0xb0a6('0xe'),'online',_0x449c25],'where':{'id':_[_0xb0a6('0x1d')](_0x523794,_0xb0a6('0x4d')),'role':_0xb0a6('0x51')},'raw':!![]});})[_0xb0a6('0x15')](function(_0x308532){for(var _0x2cb5f6=0x0;_0x2cb5f6<_0x308532[_0xb0a6('0x52')];_0x2cb5f6++){var _0x410886={'id':_0x308532[_0x2cb5f6]['id'],'name':_0x308532[_0x2cb5f6]['name'],'online':Boolean(_0x308532[_0x2cb5f6][_0xb0a6('0x4b')]),'paused':Boolean(_0x308532[_0x2cb5f6][_0x449c25])};if(_0x410886[_0xb0a6('0x4b')])_0xd484f[_0xb0a6('0x45')]++;if(_0x410886[_0xb0a6('0x44')])_0xd484f['paused']++;_0xd484f['agents']['push'](_0x410886);}return _0xd484f;});}});return Promise['all'](_0x52e20d);});})['then'](function(_0x5dd778){_0x295b53['rows']=_0x5dd778;return _0x295b53;})[_0xb0a6('0x15')](respondWithFilteredResult(_0x5351ed,_0x59bc9c))[_0xb0a6('0x53')](handleError(_0x5351ed,null));}; \ No newline at end of file +var _0xfdbd=['user','role','userProfileId','type','outbound','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','push','pTalking','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','paused','loggedInDb','originated','agents','find','pick','getAgents','online','getMembers','UserId','User','QueueId','findAll','agent','length','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','set','json','error','stack','name','getQueues','mail','chat','sms','openchannel','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','rawAttributes','fieldName','key'];(function(_0x398ea8,_0x3aac0b){var _0x5b2d05=function(_0xf8f6fe){while(--_0xf8f6fe){_0x398ea8['push'](_0x398ea8['shift']());}};_0x5b2d05(++_0x3aac0b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x43f552,_0x42808c){_0x43f552=_0x43f552-0x0;var _0x17911b=_0xfdbd[_0x43f552];return _0x17911b;};'use strict';var util=require(_0xdfdb('0x0'));var _=require(_0xdfdb('0x1'));var jayson=require(_0xdfdb('0x2'));var qs=require(_0xdfdb('0x3'));var logger=require(_0xdfdb('0x4'))(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var client=jayson[_0xdfdb('0x7')][_0xdfdb('0x8')]({'port':0x232a});var routingClient=jayson['client'][_0xdfdb('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x4a4a3f,_0x453ef6){return function(_0x41bd5e){if(_0x41bd5e){var _0x489f19=typeof _0x453ef6['offset']==='undefined'&&typeof _0x453ef6[_0xdfdb('0x9')]===_0xdfdb('0xa');var _0x47c629=_0x41bd5e[_0xdfdb('0xb')];var _0x444c19=_0x489f19?0x0:_0x453ef6[_0xdfdb('0xc')];var _0x27ddcd=_0x489f19?_0x41bd5e[_0xdfdb('0xb')]:_0x453ef6[_0xdfdb('0xc')]+_0x453ef6[_0xdfdb('0x9')];var _0x47dccc;if(_0x27ddcd>=_0x47c629){_0x27ddcd=_0x47c629;_0x47dccc=0xc8;}else{_0x47dccc=0xce;}_0x4a4a3f[_0xdfdb('0xd')](_0x47dccc);return _0x4a4a3f[_0xdfdb('0xe')]('Content-Range',_0x444c19+'-'+_0x27ddcd+'/'+_0x47c629)[_0xdfdb('0xf')](_0x41bd5e);}return null;};}function handleError(_0x33a706,_0x2bee3b){_0x2bee3b=_0x2bee3b||0x1f4;return function(_0x1918c1){logger[_0xdfdb('0x10')](_0x1918c1[_0xdfdb('0x11')]);if(_0x1918c1[_0xdfdb('0x12')]){delete _0x1918c1[_0xdfdb('0x12')];}_0x33a706['status'](_0x2bee3b)['send'](_0x1918c1);};}exports[_0xdfdb('0x13')]=function(_0x4b1ff7,_0x471ddc){var _0x9f3039=[_0xdfdb('0x14'),_0xdfdb('0x15'),_0xdfdb('0x16'),_0xdfdb('0x17'),'fax','whatsapp',_0xdfdb('0x18')];var _0x8b9193={'count':0x0,'rows':[]},_0x2c1070={},_0x55ab5a;Promise[_0xdfdb('0x19')]()[_0xdfdb('0x1a')](function(){if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')]){if(!_[_0xdfdb('0x1d')](_0x9f3039,_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]()))throw new Error('Invalid\x20channel');_0x55ab5a=_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]();}var _0x5cc70b=_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x2c7dd1=_['map'](db[_0x5cc70b][_0xdfdb('0x21')],function(_0x789bd2){return{'name':_0x789bd2[_0xdfdb('0x22')],'type':_0x789bd2['type'][_0xdfdb('0x23')]};});_0x2c1070=qs['getOptions'](_0x2c7dd1,_0x4b1ff7);if(_0x4b1ff7[_0xdfdb('0x24')][_0xdfdb('0x25')]===_0xdfdb('0x24')){var _0x2a560c={'params':{'id':_0x4b1ff7['user'][_0xdfdb('0x26')]},'query':{'section':_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')?_0xdfdb('0x29'):_['startCase'](_0x55ab5a)+_0xdfdb('0x2a'),'type':_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')],'nolimit':!![],'sort':'name','filter':_0x4b1ff7[_0xdfdb('0x1b')]['filter']}};return db[_0xdfdb('0x2b')][_0xdfdb('0x2c')](_0x2a560c);}return db[_0x5cc70b][_0xdfdb('0x2d')](_0x2c1070);})['then'](function(_0x5bc174){_0x8b9193[_0xdfdb('0xb')]=_0x5bc174[_0xdfdb('0xb')];var _0xedbb91=_0x55ab5a===_0xdfdb('0x18')?client:routingClient;return _0xedbb91[_0xdfdb('0x2e')](_[_0xdfdb('0x1f')](_0x55ab5a)+'Queues',_0x4b1ff7)[_0xdfdb('0x1a')](function(_0x364805){if(_0x364805[_0xdfdb('0x10')])throw new Error(util[_0xdfdb('0x2f')](_0xdfdb('0x30'),_0x55ab5a));var _0x157de8=_0x364805[_0xdfdb('0x31')];var _0x1ce036=[_0xdfdb('0x32'),_0xdfdb('0x33'),_0xdfdb('0x34'),'talking','paused'];if(_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7['query'][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x1ce036[_0xdfdb('0x35')](_0xdfdb('0x36'),'originated',_0xdfdb('0x37'),'dialActive',_0xdfdb('0x38'),_0xdfdb('0x39'),_0xdfdb('0x3a'),_0xdfdb('0x3b'),_0xdfdb('0x3c'),_0xdfdb('0x3d'),'erlangAbandonmentRate',_0xdfdb('0x3e'),_0xdfdb('0x3f'),'dialPredictiveIntervalMaxThreshold',_0xdfdb('0x40'),_0xdfdb('0x41'),_0xdfdb('0x42'),_0xdfdb('0x43'),_0xdfdb('0x44'),_0xdfdb('0x45'),_0xdfdb('0x46'),_0xdfdb('0x47'));}var _0x21f4c7=_0x5bc174[_0xdfdb('0x48')][_0xdfdb('0x49')](function(_0x5530d8){var _0x2defcc=_0x5530d8[_0xdfdb('0x4a')]({'plain':!![]});_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x4c')]=0x0;_0x2defcc[_0xdfdb('0x32')]=0x0;_0x2defcc[_0xdfdb('0x33')]=0x0;_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x34')]=0x0;if(_0x55ab5a==='voice'){_0x2defcc['talking']=0x0;if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x2defcc[_0xdfdb('0x36')]=0x0;_0x2defcc[_0xdfdb('0x4d')]=0x0;}}_0x2defcc[_0xdfdb('0x4e')]=[];var _0x3da4ca=_[_0xdfdb('0x4f')](_0x157de8[_0xdfdb('0x48')],['id',_0x2defcc['id']]);if(_0x3da4ca)_['merge'](_0x2defcc,_[_0xdfdb('0x50')](_0x3da4ca,_0x1ce036));if(_0x55ab5a===_0xdfdb('0x18')){return _0x5530d8[_0xdfdb('0x51')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x281cec){return _0x5530d8[_0xdfdb('0x53')]({'raw':!![]})[_0xdfdb('0x1a')](function(_0x3f95fe){for(var _0x431004=0x0;_0x431004<_0x281cec['length'];_0x431004++){var _0x1d7a3a=_[_0xdfdb('0x4f')](_0x3f95fe,[_0xdfdb('0x54'),_0x281cec[_0x431004]['id']]);var _0x5b4381={'id':_0x281cec[_0x431004]['id'],'name':_0x281cec[_0x431004][_0xdfdb('0x12')],'online':Boolean(_0x281cec[_0x431004]['online']),'paused':_0x1d7a3a?Boolean(_0x1d7a3a[_0xdfdb('0x4b')]):![]};if(_0x5b4381['online'])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x5b4381[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc[_0xdfdb('0x4e')]['push'](_0x5b4381);}return _0x2defcc;});});}else{var _0xfea790=_0xdfdb('0x55')+_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x25cc2f=_0x55ab5a+'Pause';return db[_0xfea790]['findAll']({'where':{[_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x56')]:_0x5530d8['id']},'raw':!![]})['then'](function(_0x2b0a8b){return db['User'][_0xdfdb('0x57')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52'),_0x25cc2f],'where':{'id':_[_0xdfdb('0x49')](_0x2b0a8b,_0xdfdb('0x54')),'role':_0xdfdb('0x58')},'raw':!![]});})[_0xdfdb('0x1a')](function(_0x11ce58){for(var _0x2ac36e=0x0;_0x2ac36e<_0x11ce58[_0xdfdb('0x59')];_0x2ac36e++){var _0x24f88a={'id':_0x11ce58[_0x2ac36e]['id'],'name':_0x11ce58[_0x2ac36e][_0xdfdb('0x12')],'online':Boolean(_0x11ce58[_0x2ac36e][_0xdfdb('0x52')]),'paused':Boolean(_0x11ce58[_0x2ac36e][_0x25cc2f])};if(_0x24f88a[_0xdfdb('0x52')])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x24f88a[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc['agents'][_0xdfdb('0x35')](_0x24f88a);}return _0x2defcc;});}});return Promise[_0xdfdb('0x5a')](_0x21f4c7);});})[_0xdfdb('0x1a')](function(_0x4bbb88){_0x8b9193[_0xdfdb('0x48')]=_0x4bbb88;return _0x8b9193;})[_0xdfdb('0x1a')](respondWithFilteredResult(_0x471ddc,_0x2c1070))[_0xdfdb('0x5b')](handleError(_0x471ddc,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index c9f2617..2d83851 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x30fc63,_0x456284){var _0x43d2ce=function(_0x1800a8){while(--_0x1800a8){_0x30fc63['push'](_0x30fc63['shift']());}};_0x43d2ce(++_0x456284);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ee969,_0x19696d){var _0x2d3186=function(_0x4300c3){while(--_0x4300c3){_0x1ee969['push'](_0x1ee969['shift']());}};_0x2d3186(++_0x19696d);}(_0xe706,0xa3));var _0x6e70=function(_0x5bc4e2,_0x427ff9){_0x5bc4e2=_0x5bc4e2-0x0;var _0x4c93f9=_0xe706[_0x5bc4e2];return _0x4c93f9;};'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 d4929ce..d1721af 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 _0xacd6=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xacd6,0xef));var _0x6acd=function(_0x46e523,_0xe6fccb){_0x46e523=_0x46e523-0x0;var _0x5da0ee=_0xacd6[_0x46e523];return _0x5da0ee;};'use strict';var Sequelize=require(_0x6acd('0x0'));module[_0x6acd('0x1')]={'state':{'type':Sequelize[_0x6acd('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6acd('0x3')]},'scheduledat':{'type':Sequelize[_0x6acd('0x4')]},'uniqueid':{'type':Sequelize[_0x6acd('0x3')]},'starttime':{'type':Sequelize[_0x6acd('0x4')]},'responsetime':{'type':Sequelize[_0x6acd('0x4')]},'ringtime':{'type':Sequelize[_0x6acd('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6acd('0x3')]},'campaigntype':{'type':Sequelize[_0x6acd('0x3')]},'membername':{'type':Sequelize[_0x6acd('0x3')]}}; \ No newline at end of file +var _0x13f5=['exports','INTEGER','STRING','sequelize'];(function(_0x12255b,_0xa4f858){var _0x124018=function(_0x369304){while(--_0x369304){_0x12255b['push'](_0x12255b['shift']());}};_0x124018(++_0xa4f858);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'state':{'type':Sequelize[_0x513f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x513f('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x513f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x513f('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x513f('0x3')]},'campaigntype':{'type':Sequelize[_0x513f('0x3')]},'membername':{'type':Sequelize[_0x513f('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index e97b085..22a1e73 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 _0x2f6a=['request-promise','path','rimraf','../../config/environment','define','ReportAgentPreview','report_agent_preview','../../config/logger','moment','bluebird'];(function(_0x30e6f1,_0x4e3162){var _0x450a05=function(_0xd2f594){while(--_0xd2f594){_0x30e6f1['push'](_0x30e6f1['shift']());}};_0x450a05(++_0x4e3162);}(_0x2f6a,0x179));var _0xa2f6=function(_0x1ced9a,_0x172f73){_0x1ced9a=_0x1ced9a-0x0;var _0x2b5b01=_0x2f6a[_0x1ced9a];return _0x2b5b01;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2f6('0x0'))('api');var moment=require(_0xa2f6('0x1'));var BPromise=require(_0xa2f6('0x2'));var rp=require(_0xa2f6('0x3'));var fs=require('fs');var path=require(_0xa2f6('0x4'));var rimraf=require(_0xa2f6('0x5'));var config=require(_0xa2f6('0x6'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x2c9f5e,_0xd938df){return _0x2c9f5e[_0xa2f6('0x7')](_0xa2f6('0x8'),attributes,{'tableName':_0xa2f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b1e=['../../config/logger','api','bluebird','request-promise','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0xed6261,_0x1f0ee2){var _0x4de7a5=function(_0x2783d6){while(--_0x2783d6){_0xed6261['push'](_0xed6261['shift']());}};_0x4de7a5(++_0x1f0ee2);}(_0x5b1e,0xb9));var _0xe5b1=function(_0x989d2e,_0x111ded){_0x989d2e=_0x989d2e-0x0;var _0xa7d0fc=_0x5b1e[_0x989d2e];return _0xa7d0fc;};'use strict';var _=require(_0xe5b1('0x0'));var util=require(_0xe5b1('0x1'));var logger=require(_0xe5b1('0x2'))(_0xe5b1('0x3'));var moment=require('moment');var BPromise=require(_0xe5b1('0x4'));var rp=require(_0xe5b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe5b1('0x6'));module[_0xe5b1('0x7')]=function(_0x4d1129,_0x414bd2){return _0x4d1129[_0xe5b1('0x8')](_0xe5b1('0x9'),attributes,{'tableName':_0xe5b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index af56581..1ddecc5 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 _0x03c9=['catch','ReportAgentPreview','body','options','raw','then','CreateReportAgentPreview','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x44fee6,_0x4afc8d){var _0x23662d=function(_0x59cd70){while(--_0x59cd70){_0x44fee6['push'](_0x44fee6['shift']());}};_0x23662d(++_0x4afc8d);}(_0x03c9,0x12a));var _0x903c=function(_0xdd8a33,_0x2c0287){_0xdd8a33=_0xdd8a33-0x0;var _0x32b071=_0x03c9[_0xdd8a33];return _0x32b071;};'use strict';var _=require(_0x903c('0x0'));var util=require(_0x903c('0x1'));var moment=require(_0x903c('0x2'));var BPromise=require(_0x903c('0x3'));var rs=require(_0x903c('0x4'));var fs=require('fs');var Redis=require(_0x903c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x903c('0x6'));var logger=require(_0x903c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x903c('0x8'));var client=jayson[_0x903c('0x9')][_0x903c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6e31ea,_0x77b3d9,_0x3f0325){return new BPromise(function(_0x11ca7b,_0x504693){return client[_0x903c('0xb')](_0x6e31ea,_0x3f0325)['then'](function(_0x3001b3){logger[_0x903c('0xc')](_0x903c('0xd'),_0x77b3d9,_0x903c('0xe'));logger['debug'](_0x903c('0xf'),_0x77b3d9,_0x903c('0xe'),JSON[_0x903c('0x10')](_0x3001b3));if(_0x3001b3['error']){if(_0x3001b3[_0x903c('0x11')][_0x903c('0x12')]===0x1f4){logger[_0x903c('0x11')](_0x903c('0xd'),_0x77b3d9,_0x3001b3[_0x903c('0x11')][_0x903c('0x13')]);return _0x504693(_0x3001b3[_0x903c('0x11')][_0x903c('0x13')]);}logger[_0x903c('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x77b3d9,_0x3001b3['error'][_0x903c('0x13')]);return _0x11ca7b(_0x3001b3[_0x903c('0x11')][_0x903c('0x13')]);}else{logger[_0x903c('0xc')](_0x903c('0xd'),_0x77b3d9,_0x903c('0xe'));_0x11ca7b(_0x3001b3[_0x903c('0x14')][_0x903c('0x13')]);}})[_0x903c('0x15')](function(_0x426b05){logger['error'](_0x903c('0xd'),_0x77b3d9,_0x426b05);_0x504693(_0x426b05);});});}exports['CreateReportAgentPreview']=function(_0x1a7b1d){var _0x3e007c=this;return new Promise(function(_0x509a17,_0x28c062){return db[_0x903c('0x16')]['create'](_0x1a7b1d[_0x903c('0x17')],{'raw':_0x1a7b1d[_0x903c('0x18')]?_0x1a7b1d[_0x903c('0x18')][_0x903c('0x19')]===undefined?!![]:![]:!![]})[_0x903c('0x1a')](function(_0x4f78f7){logger[_0x903c('0xc')](_0x903c('0x1b'),_0x1a7b1d);logger[_0x903c('0x1c')]('CreateReportAgentPreview',_0x1a7b1d,JSON['stringify'](_0x4f78f7));_0x509a17(_0x4f78f7);})[_0x903c('0x15')](function(_0x470dd3){logger[_0x903c('0x11')](_0x903c('0x1b'),_0x470dd3[_0x903c('0x13')],_0x1a7b1d);_0x28c062(_0x3e007c[_0x903c('0x11')](0x1f4,_0x470dd3['message']));});});}; \ No newline at end of file +var _0x3074=['http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x213173,_0x374b4e){var _0x1b93a2=function(_0x320ebe){while(--_0x320ebe){_0x213173['push'](_0x213173['shift']());}};_0x1b93a2(++_0x374b4e);}(_0x3074,0x1dd));var _0x4307=function(_0x355689,_0x3f4302){_0x355689=_0x355689-0x0;var _0x214e9f=_0x3074[_0x355689];return _0x214e9f;};'use strict';var _=require(_0x4307('0x0'));var util=require('util');var moment=require(_0x4307('0x1'));var BPromise=require(_0x4307('0x2'));var rs=require(_0x4307('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4307('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4307('0x5'))(_0x4307('0x6'));var config=require('../../config/environment');var jayson=require(_0x4307('0x7'));var client=jayson[_0x4307('0x8')][_0x4307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x590bda,_0x4336a5,_0x14e01d){return new BPromise(function(_0x11663f,_0x188961){return client[_0x4307('0xa')](_0x590bda,_0x14e01d)[_0x4307('0xb')](function(_0x29b4c0){logger[_0x4307('0xc')](_0x4307('0xd'),_0x4336a5,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4336a5,_0x4307('0xe'),JSON['stringify'](_0x29b4c0));if(_0x29b4c0[_0x4307('0xf')]){if(_0x29b4c0[_0x4307('0xf')][_0x4307('0x10')]===0x1f4){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x188961(_0x29b4c0[_0x4307('0xf')]['message']);}logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x29b4c0[_0x4307('0xf')][_0x4307('0x11')]);return _0x11663f(_0x29b4c0['error'][_0x4307('0x11')]);}else{logger['info'](_0x4307('0xd'),_0x4336a5,'request\x20sent');_0x11663f(_0x29b4c0[_0x4307('0x12')][_0x4307('0x11')]);}})[_0x4307('0x13')](function(_0x2686ee){logger[_0x4307('0xf')](_0x4307('0xd'),_0x4336a5,_0x2686ee);_0x188961(_0x2686ee);});});}exports[_0x4307('0x14')]=function(_0x493151){var _0x51bac6=this;return new Promise(function(_0x1840e2,_0x1c404f){return db[_0x4307('0x15')][_0x4307('0x16')](_0x493151[_0x4307('0x17')],{'raw':_0x493151[_0x4307('0x18')]?_0x493151[_0x4307('0x18')][_0x4307('0x19')]===undefined?!![]:![]:!![]})[_0x4307('0xb')](function(_0x567902){logger[_0x4307('0xc')]('CreateReportAgentPreview',_0x493151);logger[_0x4307('0x1a')]('CreateReportAgentPreview',_0x493151,JSON['stringify'](_0x567902));_0x1840e2(_0x567902);})[_0x4307('0x13')](function(_0x49a828){logger[_0x4307('0xf')]('CreateReportAgentPreview',_0x49a828[_0x4307('0x11')],_0x493151);_0x1c404f(_0x51bac6[_0x4307('0xf')](0x1f4,_0x49a828[_0x4307('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index dd9e1df..b6be19a 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 _0xac60=['/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','/agents','/telephones','/trunks','trunks','/campaigns','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','fax','/fax/queues/:id','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','get'];(function(_0x36dda1,_0x1e704a){var _0x3688fe=function(_0x1a33cf){while(--_0x1a33cf){_0x36dda1['push'](_0x36dda1['shift']());}};_0x3688fe(++_0x1e704a);}(_0xac60,0x188));var _0x0ac6=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xac60[_0x4dbaad];return _0x226c72;};'use strict';var multer=require('multer');var util=require(_0x0ac6('0x0'));var path=require('path');var express=require(_0x0ac6('0x1'));var router=express[_0x0ac6('0x2')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x0ac6('0x3')](_0x0ac6('0x4'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x6')]);router[_0x0ac6('0x3')](_0x0ac6('0x7'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x8')]);router[_0x0ac6('0x3')](_0x0ac6('0x9'),auth['isAuthenticated'](),controller[_0x0ac6('0xa')]);router[_0x0ac6('0x3')](_0x0ac6('0xb'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0xc')]);router['get'](_0x0ac6('0xd'),auth['isAuthenticated'](),controller[_0x0ac6('0xe')]);router[_0x0ac6('0x3')](_0x0ac6('0xf'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x10')]);router['get'](_0x0ac6('0x11'),auth['isAuthenticated'](),controller[_0x0ac6('0x12')]);router[_0x0ac6('0x3')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x0ac6('0x13')]);router[_0x0ac6('0x3')](_0x0ac6('0x14'),auth['isAuthenticated'](),controller['smsQueues']);router[_0x0ac6('0x3')]('/whatsapp/queues',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x15')]);router[_0x0ac6('0x3')]('/fax/queues',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x16')]);router['get'](_0x0ac6('0x17'),auth[_0x0ac6('0x5')](),controller['voiceQueuesPreview']);router[_0x0ac6('0x3')]('/voice/queues/channels',auth[_0x0ac6('0x5')](),controller['voiceQueuesChannels']);router[_0x0ac6('0x3')](_0x0ac6('0x18'),auth[_0x0ac6('0x5')](),controller['voiceQueuesChannel']);router[_0x0ac6('0x3')](_0x0ac6('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x0ac6('0x3')](_0x0ac6('0x1a'),auth[_0x0ac6('0x5')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x0ac6('0x1b'),auth['isAuthenticated'](),controller[_0x0ac6('0x1c')]);router[_0x0ac6('0x1d')](_0x0ac6('0x1b'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x1e')]);router[_0x0ac6('0x3')]('/outbound',auth['isAuthenticated'](),controller[_0x0ac6('0x1f')]);router[_0x0ac6('0x3')](_0x0ac6('0x20'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0x0ac6('0x21'),auth[_0x0ac6('0x5')](),controller['agents']);router[_0x0ac6('0x1d')]('/agents/:id/capacity',auth[_0x0ac6('0x5')](),controller['agentCapacity']);router[_0x0ac6('0x3')](_0x0ac6('0x22'),auth[_0x0ac6('0x5')](),controller['telephones']);router[_0x0ac6('0x3')](_0x0ac6('0x23'),auth['isAuthenticated'](),controller[_0x0ac6('0x24')]);router[_0x0ac6('0x3')](_0x0ac6('0x25'),auth[_0x0ac6('0x5')](),controller['campaigns']);router[_0x0ac6('0x3')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x0ac6('0x3')](_0x0ac6('0x26'),auth[_0x0ac6('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x0ac6('0x3')]('/mail/queues/waitinginteractions',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x27')]);router[_0x0ac6('0x3')](_0x0ac6('0x28'),auth[_0x0ac6('0x5')](),controller['openchannelQueuesWaitingInteractions']);router[_0x0ac6('0x3')](_0x0ac6('0x29'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x2a')]);router['get'](_0x0ac6('0x2b'),auth[_0x0ac6('0x5')](),controller['smsQueuesWaitingInteractions']);router[_0x0ac6('0x3')](_0x0ac6('0x2c'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x2d')]);router['get']('/fax/queues/waitinginteractions',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x2e')]);router[_0x0ac6('0x2f')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('mail'));router[_0x0ac6('0x3')]('/mail/queues/:id',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x30')]);router[_0x0ac6('0x2f')]('/chat/queues/:id/notify',auth[_0x0ac6('0x5')](),controller['queueNotify'](_0x0ac6('0x31')));router[_0x0ac6('0x3')](_0x0ac6('0x32'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x33')]);router['post'](_0x0ac6('0x34'),auth['isAuthenticated'](),controller[_0x0ac6('0x35')](_0x0ac6('0x36')));router[_0x0ac6('0x3')](_0x0ac6('0x37'),auth[_0x0ac6('0x5')](),controller['showFaxQueues']);router[_0x0ac6('0x2f')]('/openchannel/queues/:id/notify',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x35')](_0x0ac6('0x38')));router[_0x0ac6('0x3')]('/openchannel/queues/:id',auth[_0x0ac6('0x5')](),controller['showOpenchannelQueues']);router[_0x0ac6('0x2f')](_0x0ac6('0x39'),auth['isAuthenticated'](),controller[_0x0ac6('0x35')](_0x0ac6('0x3a')));router['post'](_0x0ac6('0x3b'),auth[_0x0ac6('0x5')](),controller['queueNotify'](_0x0ac6('0x3c')));router[_0x0ac6('0x3')]('/sms/queues/:id',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x3d')]);router[_0x0ac6('0x3')]('/whatsapp/queues/:id',auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x3e')]);router['post'](_0x0ac6('0x3f'),auth[_0x0ac6('0x5')](),controller[_0x0ac6('0x40')]);module[_0x0ac6('0x41')]=router; \ No newline at end of file +var _0xae41=['/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','post','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview'];(function(_0x798331,_0x5a62d1){var _0x46afad=function(_0x3419bc){while(--_0x3419bc){_0x798331['push'](_0x798331['shift']());}};_0x46afad(++_0x5a62d1);}(_0xae41,0x1ba));var _0x1ae4=function(_0x333005,_0x4eccf0){_0x333005=_0x333005-0x0;var _0x2c8516=_0xae41[_0x333005];return _0x2c8516;};'use strict';var multer=require(_0x1ae4('0x0'));var util=require(_0x1ae4('0x1'));var path=require(_0x1ae4('0x2'));var express=require(_0x1ae4('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x1ae4('0x4'));router[_0x1ae4('0x5')]('/voice/channels',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x7')]);router['get'](_0x1ae4('0x8'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x9')]);router['get'](_0x1ae4('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x1ae4('0x5')](_0x1ae4('0xb'),auth['isAuthenticated'](),controller[_0x1ae4('0xc')]);router[_0x1ae4('0x5')]('/chat/queues',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0xd')]);router[_0x1ae4('0x5')](_0x1ae4('0xe'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0xf')]);router[_0x1ae4('0x5')](_0x1ae4('0x10'),auth['isAuthenticated'](),controller[_0x1ae4('0x11')]);router['get']('/openchannel/queues',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x12')]);router['get'](_0x1ae4('0x13'),auth[_0x1ae4('0x6')](),controller['smsQueues']);router[_0x1ae4('0x5')](_0x1ae4('0x14'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x15')]);router['get'](_0x1ae4('0x16'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x17')]);router[_0x1ae4('0x5')](_0x1ae4('0x18'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x19')]);router[_0x1ae4('0x5')](_0x1ae4('0x1a'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x1b')]);router['get'](_0x1ae4('0x1c'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x1d')]);router[_0x1ae4('0x5')](_0x1ae4('0x1e'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0x1ae4('0x20')]);router[_0x1ae4('0x5')](_0x1ae4('0x21'),auth[_0x1ae4('0x6')](),controller['showVoiceQueues']);router[_0x1ae4('0x22')]('/voice/queues/:id',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x23')]);router[_0x1ae4('0x5')](_0x1ae4('0x24'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x25')]);router[_0x1ae4('0x5')]('/outbound/channels',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x26')]);router[_0x1ae4('0x5')](_0x1ae4('0x27'),auth['isAuthenticated'](),controller[_0x1ae4('0x28')]);router[_0x1ae4('0x22')](_0x1ae4('0x29'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x2a')]);router[_0x1ae4('0x5')]('/telephones',auth[_0x1ae4('0x6')](),controller['telephones']);router[_0x1ae4('0x5')](_0x1ae4('0x2b'),auth[_0x1ae4('0x6')](),controller['trunks']);router[_0x1ae4('0x5')]('/campaigns',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x2c')]);router[_0x1ae4('0x5')](_0x1ae4('0x2d'),auth['isAuthenticated'](),controller[_0x1ae4('0x2e')]);router[_0x1ae4('0x5')]('/chat/queues/waitinginteractions',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x2f')]);router[_0x1ae4('0x5')]('/mail/queues/waitinginteractions',auth[_0x1ae4('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x1ae4('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x30')]);router[_0x1ae4('0x5')](_0x1ae4('0x31'),auth[_0x1ae4('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x1ae4('0x32'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x33')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x34')]);router[_0x1ae4('0x5')]('/fax/queues/waitinginteractions',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x35')]);router['post'](_0x1ae4('0x36'),auth[_0x1ae4('0x6')](),controller['queueNotify']('mail'));router['get'](_0x1ae4('0x37'),auth['isAuthenticated'](),controller[_0x1ae4('0x38')]);router['post'](_0x1ae4('0x39'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x3a')](_0x1ae4('0x3b')));router[_0x1ae4('0x5')](_0x1ae4('0x3c'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x3d')]);router[_0x1ae4('0x3e')](_0x1ae4('0x3f'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x3a')]('fax'));router[_0x1ae4('0x5')]('/fax/queues/:id',auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x40')]);router[_0x1ae4('0x3e')](_0x1ae4('0x41'),auth[_0x1ae4('0x6')](),controller['queueNotify']('openchannel'));router[_0x1ae4('0x5')](_0x1ae4('0x42'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x43')]);router[_0x1ae4('0x3e')](_0x1ae4('0x44'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x3a')](_0x1ae4('0x45')));router[_0x1ae4('0x3e')](_0x1ae4('0x46'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x3a')]('whatsapp'));router[_0x1ae4('0x5')](_0x1ae4('0x47'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x48')]);router['get'](_0x1ae4('0x49'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x4a')]);router[_0x1ae4('0x3e')](_0x1ae4('0x4b'),auth[_0x1ae4('0x6')](),controller[_0x1ae4('0x4c')]);module[_0x1ae4('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 48d52f5..edac2af 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 _0x6aa7=['rows','find','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','value','indexOf','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','update','Interaction','queue','MessageId','InteractionId','From','TransferReport','create','Start','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','User','findOne','Agent\x20not\x20found','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','catch','status','json','sendStatus','name','send','isNil'];(function(_0x37806d,_0x12bcc7){var _0x447ed7=function(_0x48d5d0){while(--_0x48d5d0){_0x37806d['push'](_0x37806d['shift']());}};_0x447ed7(++_0x12bcc7);}(_0x6aa7,0x178));var _0x76aa=function(_0x89e7e4,_0x29da8c){_0x89e7e4=_0x89e7e4-0x0;var _0x419fe3=_0x6aa7[_0x89e7e4];return _0x419fe3;};'use strict';var BPromise=require(_0x76aa('0x0'));var moment=require('moment');var _=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var db=require(_0x76aa('0x3'))['db'];var logger=require(_0x76aa('0x4'))('api');var jayson=require(_0x76aa('0x5'));var amiClient=jayson[_0x76aa('0x6')][_0x76aa('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x76aa('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){var _0x266bd5=_0xa9b695?_0xa9b695:amiClient;return _0x266bd5[_0x76aa('0x8')](_0x32dee5,_0x36d12b)['then'](function(_0xcd99aa){if(_0xcd99aa[_0x76aa('0x9')]){if(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xa')]===0x1f4){return _0x3dae33(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}return _0x56d6bc(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}else{_0x56d6bc(_0xcd99aa[_0x76aa('0xc')]);}})[_0x76aa('0xd')](function(_0x5e5f47){_0x3dae33(_0x5e5f47);});});}function respondWithResult(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xc8;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0xe')](_0x5df49c)[_0x76aa('0xf')](_0x226536);}return _0x112c39[_0x76aa('0x10')](0x194);};}function handleError(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0x1f4;return function(_0x5f5b59){logger[_0x76aa('0x9')](_0x5f5b59['stack']);if(_0x5f5b59[_0x76aa('0x11')]){delete _0x5f5b59[_0x76aa('0x11')];}_0x10432c['status'](_0x4e309f)[_0x76aa('0x12')](_0x5f5b59);};}function findById(_0x550d9a){return function(_0x328381){if(!_['isNil'](_0x550d9a)&&!_[_0x76aa('0x13')](_0x328381)&&!_[_0x76aa('0x13')](_0x328381[_0x76aa('0x14')])){return _[_0x76aa('0x15')](_0x328381[_0x76aa('0x14')],function(_0x3ead3f){return _0x3ead3f['id']==_0x550d9a;});}return null;};}exports['voiceChannels']=function(_0x5d6202,_0x256636){return respondWithRpcPromise(_0x76aa('0x16'),_0x5d6202[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x256636,null))[_0x76aa('0xd')](handleError(_0x256636,null));};exports[_0x76aa('0x19')]=function(_0x19af92,_0x2eaf48){return respondWithRpcPromise(_0x76aa('0x1a'),_['merge'](_0x19af92[_0x76aa('0x17')],_0x19af92[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x2eaf48,null))['catch'](handleError(_0x2eaf48,null));};exports[_0x76aa('0x1c')]=function(_0x189cb6,_0x31252f){return respondWithRpcPromise(_0x76aa('0x1d'),_[_0x76aa('0x1e')](_0x189cb6[_0x76aa('0x17')],_0x189cb6[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x31252f,null))[_0x76aa('0xd')](handleError(_0x31252f,null));};exports[_0x76aa('0x1f')]=function(_0x37f1ab,_0x26b75e){return respondWithRpcPromise(_0x76aa('0x20'),_0x37f1ab['query'])[_0x76aa('0x18')](respondWithResult(_0x26b75e,null))[_0x76aa('0xd')](handleError(_0x26b75e,null));};exports[_0x76aa('0x21')]=function(_0x2e7ab4,_0xa1e6){return respondWithRpcPromise(_0x76aa('0x20'),_0x2e7ab4[_0x76aa('0x17')])[_0x76aa('0x18')](findById(_0x2e7ab4[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa1e6,null))['catch'](handleError(_0xa1e6,null));};exports[_0x76aa('0x22')]=function(_0x5a8030,_0x994550){return respondWithRpcPromise(_0x76aa('0x23'),_[_0x76aa('0x1e')](_0x5a8030[_0x76aa('0x24')],_0x5a8030[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x994550,null))[_0x76aa('0xd')](handleError(_0x994550,null));};exports[_0x76aa('0x25')]=function(_0x19fd4f,_0x3ea05a){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x76aa('0x1e')](_0x19fd4f[_0x76aa('0x17')],_0x19fd4f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x3ea05a,null))[_0x76aa('0xd')](handleError(_0x3ea05a,null));};exports[_0x76aa('0x26')]=function(_0x35a705,_0x4eb57a){return respondWithRpcPromise(_0x76aa('0x27'),_0x35a705[_0x76aa('0x17')])['then'](respondWithResult(_0x4eb57a,null))[_0x76aa('0xd')](handleError(_0x4eb57a,null));};exports['voiceQueuesChannel']=function(_0x2e2ba3,_0x4c90b6){return respondWithRpcPromise(_0x76aa('0x28'),_['merge'](_0x2e2ba3['query'],_0x2e2ba3[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x4c90b6,null))[_0x76aa('0xd')](handleError(_0x4c90b6,null));};exports[_0x76aa('0x29')]=function(_0x595a0f,_0x592596){return respondWithRpcPromise(_0x76aa('0x2a'),_[_0x76aa('0x1e')](_0x595a0f[_0x76aa('0x17')],_0x595a0f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x592596,null))['catch'](handleError(_0x592596,null));};exports[_0x76aa('0x2b')]=function(_0x5c77f1,_0x5086f5){return respondWithRpcPromise(_0x76aa('0x2c'),_[_0x76aa('0x1e')](_0x5c77f1[_0x76aa('0x17')],_0x5c77f1[_0x76aa('0x1b')]))['then'](respondWithResult(_0x5086f5,null))[_0x76aa('0xd')](handleError(_0x5086f5,null));};exports[_0x76aa('0x2d')]=function(_0x2eea79,_0x4e131a){return respondWithRpcPromise(_0x76aa('0x2e'),_0x2eea79[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x4e131a,null))[_0x76aa('0xd')](handleError(_0x4e131a,null));};exports[_0x76aa('0x2f')]=function(_0x982e62,_0x878903){return respondWithRpcPromise(_0x76aa('0x30'),_0x982e62[_0x76aa('0x17')])['then'](respondWithResult(_0x878903,null))[_0x76aa('0xd')](handleError(_0x878903,null));};exports[_0x76aa('0x31')]=function(_0x4a5a96,_0xa824e8){var _0x64612e;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96['query'])['then'](function(_0x153a47){_0x64612e=_0x153a47;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96[_0x76aa('0x17')],routingClient);})[_0x76aa('0x18')](function(_0x50599f){return _[_0x76aa('0x1e')]({},_0x50599f,_0x64612e);})[_0x76aa('0x18')](respondWithResult(_0xa824e8,null))[_0x76aa('0xd')](handleError(_0xa824e8,null));};exports[_0x76aa('0x33')]=function(_0x1138b5,_0x4aa2f3){if(_0x1138b5[_0x76aa('0x24')]&&_0x1138b5['body'][_0x76aa('0x34')]&&_0x1138b5['user']&&_0x1138b5['user']['name']){for(var _0x144f0a in _0x1138b5['body']['interaction']){if(_0x1138b5['body'][_0x76aa('0x34')][_0x76aa('0x35')](_0x144f0a)){db[_0x76aa('0x36')][_0x76aa('0x37')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5[_0x76aa('0x38')]['name'],'type':_0x76aa('0x39'),'exitAt':null,'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]&&_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]['length']?{'$notIn':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]}:{'$ne':null}}})['then'](function(_0x2d3441){var _0x5a984e=moment()[_0x76aa('0x3a')](_0x76aa('0x3b'));for(var _0x31930b=0x0,_0x18fd3e=_0x2d3441[_0x76aa('0x3c')];_0x31930b<_0x18fd3e;_0x31930b+=0x1){_0x2d3441[_0x31930b][_0x76aa('0x3d')]({'exitAt':_0x5a984e});}});for(var _0x2e229d=0x0;_0x2e229d<_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x76aa('0x3c')];_0x2e229d+=0x1){db['MemberReport'][_0x76aa('0x3e')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5['user'][_0x76aa('0x11')],'type':_0x76aa('0x39'),'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x2e229d],'exitAt':null},'defaults':{'channel':_0x144f0a,'membername':_0x1138b5['user']['name'],'interface':_[_0x76aa('0x13')](_0x1138b5['user'][_0x76aa('0x3f')])?util[_0x76aa('0x3a')](_0x76aa('0x40'),_0x1138b5[_0x76aa('0x38')][_0x76aa('0x11')]):_0x1138b5[_0x76aa('0x38')]['interface'],'type':'INTERACTION','enterAt':moment()[_0x76aa('0x3a')](_0x76aa('0x3b')),'role':_0x76aa('0x41'),'internal':_0x1138b5[_0x76aa('0x38')][_0x76aa('0x42')],'uniqueid':_0x1138b5[_0x76aa('0x24')]['interaction'][_0x144f0a][_0x2e229d]}});}}}}return respondWithRpcPromise(_0x76aa('0x43'),{'id':_0x1138b5[_0x76aa('0x1b')]['id'],'capacity':_0x1138b5[_0x76aa('0x24')]['capacity']},routingClient)[_0x76aa('0x18')](respondWithResult(_0x4aa2f3,null))['catch'](handleError(_0x4aa2f3,null));};exports[_0x76aa('0x44')]=function(_0x5e1d84,_0x339b0d){return respondWithRpcPromise(_0x76aa('0x45'),_0x5e1d84[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x339b0d,null))[_0x76aa('0xd')](handleError(_0x339b0d,null));};exports[_0x76aa('0x46')]=function(_0x953726,_0x4f2c2b){return respondWithRpcPromise(_0x76aa('0x47'),_0x953726['query'])[_0x76aa('0x18')](respondWithResult(_0x4f2c2b,null))[_0x76aa('0xd')](handleError(_0x4f2c2b,null));};exports[_0x76aa('0x48')]=function(_0x53be10,_0x3fa7ec){return respondWithRpcPromise(_0x76aa('0x49'),_0x53be10[_0x76aa('0x17')])['then'](respondWithResult(_0x3fa7ec,null))[_0x76aa('0xd')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x4a')]=function(_0x27fc84,_0x1fd2b6){return respondWithRpcPromise('ChatQueues',_0x27fc84[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1fd2b6,null))[_0x76aa('0xd')](handleError(_0x1fd2b6,null));};exports[_0x76aa('0x4b')]=function(_0x2027f8,_0xf7732){return respondWithRpcPromise('ChatQueues',_0x2027f8[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x2027f8[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xf7732,null))[_0x76aa('0xd')](handleError(_0xf7732,null));};exports[_0x76aa('0x4c')]=function(_0x37babe,_0x51893b){return respondWithRpcPromise('MailQueues',_0x37babe[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x51893b,null))['catch'](handleError(_0x51893b,null));};exports[_0x76aa('0x4d')]=function(_0x1e6f3c,_0x4f832d){return respondWithRpcPromise(_0x76aa('0x4e'),_0x1e6f3c[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x1e6f3c[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x4f832d,null))[_0x76aa('0xd')](handleError(_0x4f832d,null));};exports[_0x76aa('0x4f')]=function(_0x30573a,_0x69b1af){return respondWithRpcPromise('MailAccounts',_0x30573a[_0x76aa('0x17')],mailClient)['then'](respondWithResult(_0x69b1af,null))[_0x76aa('0xd')](handleError(_0x69b1af,null));};exports[_0x76aa('0x50')]=function(_0x2fef92,_0x16cc85){return respondWithRpcPromise(_0x76aa('0x51'),_0x2fef92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x16cc85,null))[_0x76aa('0xd')](handleError(_0x16cc85,null));};exports[_0x76aa('0x52')]=function(_0x5eceba,_0x267fcf){return respondWithRpcPromise(_0x76aa('0x51'),_0x5eceba[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x5eceba[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x267fcf,null))[_0x76aa('0xd')](handleError(_0x267fcf,null));};exports[_0x76aa('0x53')]=function(_0x5546b6,_0x364d05){return respondWithRpcPromise('SmsQueues',_0x5546b6[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x364d05,null))[_0x76aa('0xd')](handleError(_0x364d05,null));};exports[_0x76aa('0x54')]=function(_0x3a82fe,_0x234dc4){return respondWithRpcPromise(_0x76aa('0x55'),_0x3a82fe['query'],routingClient)[_0x76aa('0x18')](findById(_0x3a82fe[_0x76aa('0x1b')]['id']))['then'](respondWithResult(_0x234dc4,null))['catch'](handleError(_0x234dc4,null));};exports[_0x76aa('0x56')]=function(_0x13389d,_0x5295a7){return respondWithRpcPromise(_0x76aa('0x57'),_0x13389d[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5295a7,null))['catch'](handleError(_0x5295a7,null));};exports[_0x76aa('0x58')]=function(_0x47f733,_0xf31e1f){return respondWithRpcPromise(_0x76aa('0x57'),_0x47f733[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x47f733['params']['id']))['then'](respondWithResult(_0xf31e1f,null))[_0x76aa('0xd')](handleError(_0xf31e1f,null));};exports['faxQueues']=function(_0x2a8fd3,_0x28feb2){return respondWithRpcPromise(_0x76aa('0x59'),_0x2a8fd3[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x28feb2,null))[_0x76aa('0xd')](handleError(_0x28feb2,null));};exports[_0x76aa('0x5a')]=function(_0x223c92,_0xa19c1c){return respondWithRpcPromise('FaxQueues',_0x223c92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x223c92[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa19c1c,null))['catch'](handleError(_0xa19c1c,null));};exports['faxAccounts']=function(_0x557c11,_0x1a01ac){return respondWithRpcPromise('FaxAccounts',_0x557c11[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x1a01ac,null))[_0x76aa('0xd')](handleError(_0x1a01ac,null));};exports[_0x76aa('0x5b')]=function(_0x5754fa,_0x7eb34e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5754fa[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x7eb34e,null))[_0x76aa('0xd')](handleError(_0x7eb34e,null));};exports[_0x76aa('0x5c')]=function(_0x1037fb,_0x496e66){return respondWithRpcPromise(_0x76aa('0x5d'),_0x1037fb[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x496e66,null))[_0x76aa('0xd')](handleError(_0x496e66,null));};exports[_0x76aa('0x5e')]=function(_0x22432d,_0x1d9c6e){return respondWithRpcPromise(_0x76aa('0x5f'),_0x22432d['query'],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1d9c6e,null))[_0x76aa('0xd')](handleError(_0x1d9c6e,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x3c1b98,_0x215463){return respondWithRpcPromise(_0x76aa('0x5f'),_0x3c1b98[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](function(_0x51b101){if(_0x3c1b98[_0x76aa('0x17')]['type']!==undefined){var _0xdb821b=_(_0x51b101['rows'])['filter']([_0x3c1b98[_0x76aa('0x17')][_0x76aa('0x60')],_0x3c1b98['params']['id']])['map'](_0x76aa('0x61'))[_0x76aa('0x62')]()[_0x76aa('0x63')]();return _0x51b101['rows']['filter'](function(_0x17efc6){return _0xdb821b[_0x76aa('0x64')](_0x17efc6[_0x76aa('0x61')])>-0x1;});}else{return _0x51b101['rows'][_0x76aa('0x65')](function(_0x4c773a){return _0x4c773a[_0x76aa('0x61')]===parseInt(_0x3c1b98[_0x76aa('0x1b')]['id']);});}})[_0x76aa('0x18')](respondWithResult(_0x215463,null))[_0x76aa('0xd')](handleError(_0x215463,null));};exports[_0x76aa('0x66')]=function(_0x486d86,_0x5a79ba){return respondWithRpcPromise(_0x76aa('0x67'),_0x486d86[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5a79ba,null))['catch'](handleError(_0x5a79ba,null));};exports[_0x76aa('0x68')]=function(_0x3b6e44,_0x2ce07f){return respondWithRpcPromise(_0x76aa('0x69'),_0x3b6e44[_0x76aa('0x17')],routingClient)['then'](respondWithResult(_0x2ce07f,null))[_0x76aa('0xd')](handleError(_0x2ce07f,null));};exports['faxQueuesWaitingInteractions']=function(_0x213f7f,_0xca8769){return respondWithRpcPromise(_0x76aa('0x6a'),_0x213f7f[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0xca8769,null))[_0x76aa('0xd')](handleError(_0xca8769,null));};exports['queueNotify']=function(_0x555682){return function(_0x547411,_0x47dd29){var _0x490fa4,_0x2203c3;var _0x22f44f=_['capitalize'](_0x555682);var _0x5c2c91=_0x555682==='chat'?_0x76aa('0x6b'):_0x76aa('0x6c');return db[_0x22f44f+_0x76aa('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x547411['params']['id']}})[_0x76aa('0x18')](function(_0x45edd0){if(_[_0x76aa('0x13')](_0x45edd0)){throw new Error(_0x22f44f+_0x76aa('0x6e'));}_0x490fa4=_0x45edd0;return db[_0x22f44f+_0x76aa('0x6f')]['findOne']({'where':{'id':_0x547411['body'][_0x76aa('0x70')]},'include':[{'model':db[_0x22f44f+'Interaction'],'as':'Interaction'},{'model':db[_0x22f44f+_0x5c2c91],'as':'Account'}]});})[_0x76aa('0x18')](function(_0xbb1ccd){if(_['isNil'](_0xbb1ccd)){throw new Error(_0x22f44f+_0x76aa('0x71'));}_0x2203c3=_0xbb1ccd;return _0xbb1ccd[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x22063f={'uniqueid':_0x555682+'.'+_0x2203c3['id']+'.'+_0x2203c3[_0x76aa('0x73')]['id'],'FromUserId':_0x547411[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74')};_0x22063f[_0x22f44f+_0x76aa('0x75')]=_0x2203c3['id'];_0x22063f[_0x22f44f+_0x76aa('0x76')]=_0x2203c3[_0x76aa('0x73')]['id'];_0x22063f[_0x76aa('0x77')+_0x22f44f+_0x5c2c91+'Id']=_0x2203c3[_0x76aa('0x6c')]['id'];_0x22063f['To'+_0x22f44f+'QueueId']=_0x490fa4['id'];return db[_0x22f44f+_0x76aa('0x78')][_0x76aa('0x79')](_0x22063f);})['then'](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x555682,'interaction':_0x2203c3[_0x76aa('0x73')],'message':_0x2203c3,'account':_0x2203c3[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x490fa4[_0x76aa('0x11')]+','+(_0x2203c3[_0x76aa('0x6c')]['queueTransferTimeout']||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})[_0x76aa('0x18')](respondWithResult(_0x47dd29,null))[_0x76aa('0xd')](handleError(_0x47dd29,null));};};exports['agentNotify']=function(_0xae152a,_0x202acb){var _0x50a51f,_0x5aabe5;if(_['isNil'](_0xae152a[_0x76aa('0x24')][_0x76aa('0x7c')])){throw new Error(_0x76aa('0x7d'));}var _0x16643e=_0xae152a['body']['channel'];var _0x4a449c=_[_0x76aa('0x7e')](_0x16643e);var _0x59876c=_0x16643e===_0x76aa('0x7f')?_0x76aa('0x6b'):'Account';return db[_0x76aa('0x80')][_0x76aa('0x81')]({'raw':!![],'where':{'id':_0xae152a['params']['id'],'role':_0x76aa('0x41')}})[_0x76aa('0x18')](function(_0x41200c){if(_[_0x76aa('0x13')](_0x41200c)){throw new Error(_0x76aa('0x82'));}_0x50a51f=_0x41200c;return db[_0x4a449c+_0x76aa('0x6f')]['findOne']({'where':{'id':_0xae152a[_0x76aa('0x24')]['messageId']},'include':[{'model':db[_0x4a449c+'Interaction'],'as':'Interaction'},{'model':db[_0x4a449c+_0x59876c],'as':'Account'}]});})['then'](function(_0xb65e0b){if(_[_0x76aa('0x13')](_0xb65e0b)){throw new Error(_0x4a449c+_0x76aa('0x71'));}_0x5aabe5=_0xb65e0b;return _0xb65e0b[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x447103={'uniqueid':_0x16643e+'.'+_0x5aabe5['id']+'.'+_0x5aabe5[_0x76aa('0x73')]['id'],'FromUserId':_0xae152a[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74'),'ToUserId':_0x50a51f['id']};_0x447103[_0x4a449c+_0x76aa('0x75')]=_0x5aabe5['id'];_0x447103[_0x4a449c+'InteractionId']=_0x5aabe5[_0x76aa('0x73')]['id'];_0x447103[_0x76aa('0x77')+_0x4a449c+_0x59876c+'Id']=_0x5aabe5[_0x76aa('0x6c')]['id'];return db[_0x4a449c+_0x76aa('0x78')][_0x76aa('0x79')](_0x447103);})[_0x76aa('0x18')](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x16643e,'interaction':_0x5aabe5['Interaction'],'message':_0x5aabe5,'account':_0x5aabe5[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76aa('0x41'),'appdata':_0x50a51f['name']+','+(_0x5aabe5['Account'][_0x76aa('0x83')]||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})['then'](respondWithResult(_0x202acb,null))[_0x76aa('0xd')](handleError(_0x202acb,null));}; \ No newline at end of file +var _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0x2ddd29,_0x2317d9){var _0x2cda51=function(_0x18a30a){while(--_0x18a30a){_0x2ddd29['push'](_0x2ddd29['shift']());}};_0x2cda51(++_0x2317d9);}(_0x425d,0x1e0));var _0xd425=function(_0x2b28bb,_0x2b1ca7){_0x2b28bb=_0x2b28bb-0x0;var _0x1b4b59=_0x425d[_0x2b28bb];return _0x1b4b59;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5a4dc0b..b3c2897 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 _0xf539=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/run','run','post','create','put'];(function(_0x59dafa,_0x164c40){var _0x3a448e=function(_0x5081b3){while(--_0x5081b3){_0x59dafa['push'](_0x59dafa['shift']());}};_0x3a448e(++_0x164c40);}(_0xf539,0x9b));var _0x9f53=function(_0x471bbb,_0x41a163){_0x471bbb=_0x471bbb-0x0;var _0x2b6648=_0xf539[_0x471bbb];return _0x2b6648;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require(_0x9f53('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f53('0x3'));var router=express[_0x9f53('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9f53('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9f53('0x6'));var controller=require('./schedule.controller');router['get']('/',auth[_0x9f53('0x7')](),controller[_0x9f53('0x8')]);router[_0x9f53('0x9')](_0x9f53('0xa'),auth[_0x9f53('0x7')](),controller['show']);router['get'](_0x9f53('0xb'),auth[_0x9f53('0x7')](),controller[_0x9f53('0xc')]);router[_0x9f53('0xd')]('/',auth[_0x9f53('0x7')](),controller[_0x9f53('0xe')]);router[_0x9f53('0xf')](_0x9f53('0xa'),auth[_0x9f53('0x7')](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/:id',auth[_0x9f53('0x7')](),controller[_0x9f53('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd8bc=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/run','run','create','put','update','delete','destroy'];(function(_0x27dc9a,_0x1ae78f){var _0x2e37a2=function(_0x4b46ec){while(--_0x4b46ec){_0x27dc9a['push'](_0x27dc9a['shift']());}};_0x2e37a2(++_0x1ae78f);}(_0xd8bc,0x144));var _0xcd8b=function(_0x285d44,_0x278df3){_0x285d44=_0x285d44-0x0;var _0x178ba7=_0xd8bc[_0x285d44];return _0x178ba7;};'use strict';var multer=require('multer');var util=require(_0xcd8b('0x0'));var path=require(_0xcd8b('0x1'));var timeout=require(_0xcd8b('0x2'));var express=require(_0xcd8b('0x3'));var router=express[_0xcd8b('0x4')]();var fs_extra=require(_0xcd8b('0x5'));var auth=require(_0xcd8b('0x6'));var interaction=require(_0xcd8b('0x7'));var config=require(_0xcd8b('0x8'));var controller=require('./schedule.controller');router[_0xcd8b('0x9')]('/',auth[_0xcd8b('0xa')](),controller['index']);router[_0xcd8b('0x9')]('/:id',auth[_0xcd8b('0xa')](),controller['show']);router[_0xcd8b('0x9')](_0xcd8b('0xb'),auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xc')]);router['post']('/',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xd')]);router[_0xcd8b('0xe')]('/:id',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0xf')]);router[_0xcd8b('0x10')]('/:id',auth[_0xcd8b('0xa')](),controller[_0xcd8b('0x11')]);module[_0xcd8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2c95c2d..5880b39 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 _0x721e=['days','csv','pdf','xlsx','ENUM','custom','default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','weeks'];(function(_0x168964,_0x447798){var _0x303c22=function(_0x4d9997){while(--_0x4d9997){_0x168964['push'](_0x168964['shift']());}};_0x303c22(++_0x447798);}(_0x721e,0x81));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe721('0x0')]={'name':{'type':Sequelize[_0xe721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe721('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xe721('0x1')],'allowNull':![],'defaultValue':_0xe721('0x2')},'startAt':{'type':Sequelize[_0xe721('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xe721('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xe721('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters','months',_0xe721('0x5'),'days','hours','minutes'),'allowNull':![],'defaultValue':_0xe721('0x6')},'output':{'type':Sequelize['ENUM'](_0xe721('0x7'),_0xe721('0x8'),_0xe721('0x9')),'allowNull':![],'defaultValue':_0xe721('0x7')},'type':{'type':Sequelize[_0xe721('0xa')](_0xe721('0xb'),_0xe721('0xc')),'allowNull':![],'defaultValue':_0xe721('0xb')},'sendMail':{'type':Sequelize[_0xe721('0xd')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe721('0xe')]},'bcc':{'type':Sequelize[_0xe721('0xe')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6131=['csv','pdf','xlsx','default','custom','TEXT','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','minutes','days'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x6131,0xf6));var _0x1613=function(_0x386af4,_0x504421){_0x386af4=_0x386af4-0x0;var _0x1a5f2b=_0x6131[_0x386af4];return _0x1a5f2b;};'use strict';var Sequelize=require('sequelize');module[_0x1613('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1613('0x1')]},'active':{'type':Sequelize[_0x1613('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1613('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x1613('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1613('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x1613('0x5')](_0x1613('0x6'),_0x1613('0x7'),'months','weeks','days','hours',_0x1613('0x8')),'allowNull':![],'defaultValue':_0x1613('0x9')},'output':{'type':Sequelize[_0x1613('0x5')](_0x1613('0xa'),_0x1613('0xb'),_0x1613('0xc')),'allowNull':![],'defaultValue':_0x1613('0xa')},'type':{'type':Sequelize['ENUM']('custom',_0x1613('0xd')),'allowNull':![],'defaultValue':_0x1613('0xe')},'sendMail':{'type':Sequelize[_0x1613('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1613('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x1613('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x1613('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8093db6..d3d4c62 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 _0x5035=['apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','map','Schedule','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','keys','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x152999,_0x1dd83b){var _0x32ef67=function(_0xe8dc18){while(--_0xe8dc18){_0x152999['push'](_0x152999['shift']());}};_0x32ef67(++_0x1dd83b);}(_0x5035,0x8b));var _0x5503=function(_0xaf82b2,_0x2c08c9){_0xaf82b2=_0xaf82b2-0x0;var _0x6c633=_0x5035[_0xaf82b2];return _0x6c633;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5503('0x0'));var zipdir=require(_0x5503('0x1'));var jsonpatch=require(_0x5503('0x2'));var rp=require(_0x5503('0x3'));var moment=require(_0x5503('0x4'));var BPromise=require(_0x5503('0x5'));var Mustache=require(_0x5503('0x6'));var util=require('util');var path=require(_0x5503('0x7'));var sox=require('sox');var csv=require(_0x5503('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5503('0x9'));var _=require(_0x5503('0xa'));var squel=require(_0x5503('0xb'));var crypto=require(_0x5503('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5503('0x8'));var querystring=require(_0x5503('0xd'));var Papa=require(_0x5503('0xe'));var Redis=require(_0x5503('0xf'));var authService=require(_0x5503('0x10'));var qs=require(_0x5503('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5503('0x12'));var logger=require('../../config/logger')(_0x5503('0x13'));var utils=require('../../config/utils');var config=require(_0x5503('0x14'));var licenseUtil=require(_0x5503('0x15'));var db=require(_0x5503('0x16'))['db'];function respondWithStatusCode(_0x4adf3c,_0x1bb24d){_0x1bb24d=_0x1bb24d||0xcc;return function(_0x2ff340){if(_0x2ff340){return _0x4adf3c['sendStatus'](_0x1bb24d);}return _0x4adf3c[_0x5503('0x17')](_0x1bb24d)[_0x5503('0x18')]();};}function respondWithResult(_0x349251,_0x538e3b){_0x538e3b=_0x538e3b||0xc8;return function(_0x27e721){if(_0x27e721){return _0x349251[_0x5503('0x17')](_0x538e3b)['json'](_0x27e721);}};}function respondWithFilteredResult(_0x4f0066,_0x5aaeb3){return function(_0x1da94){if(_0x1da94){var _0x4b09b4=typeof _0x5aaeb3[_0x5503('0x19')]===_0x5503('0x1a')&&typeof _0x5aaeb3[_0x5503('0x1b')]==='undefined';var _0x35389b=_0x1da94[_0x5503('0x1c')];var _0x469647=_0x4b09b4?0x0:_0x5aaeb3[_0x5503('0x19')];var _0x3a941f=_0x4b09b4?_0x1da94['count']:_0x5aaeb3[_0x5503('0x19')]+_0x5aaeb3['limit'];var _0x217f48;if(_0x3a941f>=_0x35389b){_0x3a941f=_0x35389b;_0x217f48=0xc8;}else{_0x217f48=0xce;}_0x4f0066[_0x5503('0x17')](_0x217f48);return _0x4f0066[_0x5503('0x1d')](_0x5503('0x1e'),_0x469647+'-'+_0x3a941f+'/'+_0x35389b)['json'](_0x1da94);}return null;};}function patchUpdates(_0x524741){return function(_0x14a064){try{jsonpatch[_0x5503('0x1f')](_0x14a064,_0x524741,!![]);}catch(_0x7d9010){return BPromise[_0x5503('0x20')](_0x7d9010);}return _0x14a064[_0x5503('0x21')]();};}function saveUpdates(_0x107543,_0x485d07){return function(_0x482fc1){if(_0x482fc1){return _0x482fc1[_0x5503('0x22')](_0x107543)[_0x5503('0x23')](function(_0x51f149){return _0x51f149;});}return null;};}function removeEntity(_0x4bf286,_0x361b99){return function(_0x2880f4){if(_0x2880f4){return _0x2880f4[_0x5503('0x24')]()[_0x5503('0x23')](function(){var _0x29f781=_0x2880f4[_0x5503('0x25')]({'plain':!![]});var _0xc6cba2=_0x5503('0x26');return db[_0x5503('0x27')]['destroy']({'where':{'type':_0xc6cba2,'resourceId':_0x29f781['id']}})[_0x5503('0x23')](function(){return _0x2880f4;});})[_0x5503('0x23')](function(){_0x4bf286[_0x5503('0x17')](0xcc)[_0x5503('0x18')]();});}};}function handleEntityNotFound(_0x4f2d11,_0xc642b5){return function(_0x20c5e0){if(!_0x20c5e0){_0x4f2d11[_0x5503('0x28')](0x194);}return _0x20c5e0;};}function handleError(_0x4bea83,_0x3669d7){_0x3669d7=_0x3669d7||0x1f4;return function(_0xc3e2fe){logger['error'](_0xc3e2fe[_0x5503('0x29')]);if(_0xc3e2fe[_0x5503('0x2a')]){delete _0xc3e2fe[_0x5503('0x2a')];}_0x4bea83[_0x5503('0x17')](_0x3669d7)[_0x5503('0x2b')](_0xc3e2fe);};}exports[_0x5503('0x2c')]=function(_0x59ecca,_0x1f3056){var _0x5eea63={},_0x544a92={},_0x442561={'count':0x0,'rows':[]};var _0x585de1=_[_0x5503('0x2d')](db[_0x5503('0x2e')][_0x5503('0x2f')],function(_0xc1c59a){return{'name':_0xc1c59a['fieldName'],'type':_0xc1c59a[_0x5503('0x30')][_0x5503('0x31')]};});_0x544a92[_0x5503('0x32')]=_[_0x5503('0x2d')](_0x585de1,_0x5503('0x2a'));_0x544a92['query']=_['keys'](_0x59ecca[_0x5503('0x33')]);_0x544a92[_0x5503('0x34')]=_[_0x5503('0x35')](_0x544a92[_0x5503('0x32')],_0x544a92[_0x5503('0x33')]);_0x5eea63['attributes']=_[_0x5503('0x35')](_0x544a92[_0x5503('0x32')],qs[_0x5503('0x36')](_0x59ecca[_0x5503('0x33')][_0x5503('0x36')]));_0x5eea63[_0x5503('0x37')]=_0x5eea63['attributes'][_0x5503('0x38')]?_0x5eea63[_0x5503('0x37')]:_0x544a92['model'];if(!_0x59ecca[_0x5503('0x33')]['hasOwnProperty'](_0x5503('0x39'))){_0x5eea63[_0x5503('0x1b')]=qs[_0x5503('0x1b')](_0x59ecca[_0x5503('0x33')][_0x5503('0x1b')]);_0x5eea63[_0x5503('0x19')]=qs['offset'](_0x59ecca[_0x5503('0x33')][_0x5503('0x19')]);}_0x5eea63[_0x5503('0x3a')]=qs['sort'](_0x59ecca[_0x5503('0x33')][_0x5503('0x3b')]);_0x5eea63[_0x5503('0x3c')]=qs['filters'](_[_0x5503('0x3d')](_0x59ecca[_0x5503('0x33')],_0x544a92['filters']),_0x585de1);if(_0x59ecca['query'][_0x5503('0x3e')]){_0x5eea63[_0x5503('0x3c')]=_['merge'](_0x5eea63[_0x5503('0x3c')],{'$or':_['map'](_0x585de1,function(_0x352354){if(_0x352354[_0x5503('0x30')]!==_0x5503('0x3f')){var _0x5c61a7={};_0x5c61a7[_0x352354[_0x5503('0x2a')]]={'$like':'%'+_0x59ecca['query'][_0x5503('0x3e')]+'%'};return _0x5c61a7;}})});}_0x5eea63=_[_0x5503('0x40')]({},_0x5eea63,_0x59ecca['options']);var _0x3e1213={'where':_0x5eea63[_0x5503('0x3c')]};return db['Schedule'][_0x5503('0x1c')](_0x3e1213)[_0x5503('0x23')](function(_0x57bf5b){_0x442561[_0x5503('0x1c')]=_0x57bf5b;if(_0x59ecca[_0x5503('0x33')]['includeAll']){_0x5eea63['include']=[{'all':!![]}];}return db['Schedule'][_0x5503('0x41')](_0x5eea63);})[_0x5503('0x23')](function(_0x580c91){_0x442561[_0x5503('0x42')]=_0x580c91;return _0x442561;})['then'](respondWithFilteredResult(_0x1f3056,_0x5eea63))[_0x5503('0x43')](handleError(_0x1f3056,null));};exports[_0x5503('0x44')]=function(_0x4b6a44,_0x5e7cc5){var _0x3b873e={'raw':![],'where':{'id':_0x4b6a44[_0x5503('0x45')]['id']}},_0x9f24f5={};_0x9f24f5[_0x5503('0x32')]=_[_0x5503('0x46')](db[_0x5503('0x2e')]['rawAttributes']);_0x9f24f5['query']=_[_0x5503('0x46')](_0x4b6a44[_0x5503('0x33')]);_0x9f24f5['filters']=_[_0x5503('0x35')](_0x9f24f5[_0x5503('0x32')],_0x9f24f5['query']);_0x3b873e['attributes']=_[_0x5503('0x35')](_0x9f24f5[_0x5503('0x32')],qs[_0x5503('0x36')](_0x4b6a44[_0x5503('0x33')][_0x5503('0x36')]));_0x3b873e[_0x5503('0x37')]=_0x3b873e['attributes'][_0x5503('0x38')]?_0x3b873e['attributes']:_0x9f24f5[_0x5503('0x32')];if(_0x4b6a44['query']['includeAll']){_0x3b873e[_0x5503('0x47')]=[{'all':!![]}];}_0x3b873e=_[_0x5503('0x40')]({},_0x3b873e,_0x4b6a44[_0x5503('0x48')]);return db[_0x5503('0x2e')][_0x5503('0x49')](_0x3b873e)['then'](handleEntityNotFound(_0x5e7cc5,null))[_0x5503('0x23')](respondWithResult(_0x5e7cc5,null))['catch'](handleError(_0x5e7cc5,null));};exports['create']=function(_0x55439c,_0x25f670){return db[_0x5503('0x2e')][_0x5503('0x4a')](_0x55439c[_0x5503('0x4b')],{})[_0x5503('0x23')](function(_0x36590e){var _0x31ad50=_0x55439c['user'][_0x5503('0x25')]({'plain':!![]});if(!_0x31ad50)throw new Error(_0x5503('0x4c'));if(_0x31ad50[_0x5503('0x4d')]==='user'){var _0x21f520=_0x36590e['get']({'plain':!![]});var _0x98662f=_0x5503('0x26');return db[_0x5503('0x4e')][_0x5503('0x49')]({'where':{'name':_0x98662f,'userProfileId':_0x31ad50[_0x5503('0x4f')]},'raw':!![]})['then'](function(_0x1c0941){if(_0x1c0941&&_0x1c0941[_0x5503('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x21f520[_0x5503('0x2a')],'resourceId':_0x21f520['id'],'type':_0x1c0941[_0x5503('0x2a')],'sectionId':_0x1c0941['id']},{})['then'](function(){return _0x36590e;});}else{return _0x36590e;}})[_0x5503('0x43')](function(_0x2035b4){logger[_0x5503('0x51')](_0x5503('0x52'),_0x2035b4);throw _0x2035b4;});}return _0x36590e;})[_0x5503('0x23')](respondWithResult(_0x25f670,0xc9))['catch'](handleError(_0x25f670,null));};exports[_0x5503('0x22')]=function(_0x173b27,_0x498104){if(_0x173b27[_0x5503('0x4b')]['id']){delete _0x173b27[_0x5503('0x4b')]['id'];}return db['Schedule']['find']({'where':{'id':_0x173b27[_0x5503('0x45')]['id']}})[_0x5503('0x23')](handleEntityNotFound(_0x498104,null))['then'](saveUpdates(_0x173b27[_0x5503('0x4b')],null))[_0x5503('0x23')](respondWithResult(_0x498104,null))[_0x5503('0x43')](handleError(_0x498104,null));};exports[_0x5503('0x24')]=function(_0x2f196f,_0x1dca56){return db[_0x5503('0x2e')]['find']({'where':{'id':_0x2f196f[_0x5503('0x45')]['id']}})[_0x5503('0x23')](handleEntityNotFound(_0x1dca56,null))[_0x5503('0x23')](removeEntity(_0x1dca56,null))['catch'](handleError(_0x1dca56,null));};exports[_0x5503('0x53')]=function(_0x5ef358,_0x56e987,_0x33be0f){var _0x3b4998=require(_0x5503('0x54'));return db['Schedule'][_0x5503('0x49')]({'where':{'id':_0x5ef358[_0x5503('0x45')]['id']},'raw':!![]})[_0x5503('0x23')](handleEntityNotFound(_0x56e987,null))[_0x5503('0x23')](function(){_0x3b4998[_0x5503('0x53')](_0x5ef358['params']['id']);})[_0x5503('0x23')](respondWithStatusCode(_0x56e987,null))[_0x5503('0x43')](handleError(_0x56e987,null));}; \ No newline at end of file +var _0xf492=['query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','Schedule','includeAll','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xf492,0x78));var _0x2f49=function(_0x517f60,_0x240bb8){_0x517f60=_0x517f60-0x0;var _0x5598b0=_0xf492[_0x517f60];return _0x5598b0;};'use strict';var emlformat=require(_0x2f49('0x0'));var rimraf=require(_0x2f49('0x1'));var zipdir=require(_0x2f49('0x2'));var jsonpatch=require(_0x2f49('0x3'));var rp=require('request-promise');var moment=require(_0x2f49('0x4'));var BPromise=require(_0x2f49('0x5'));var Mustache=require(_0x2f49('0x6'));var util=require(_0x2f49('0x7'));var path=require(_0x2f49('0x8'));var sox=require('sox');var csv=require(_0x2f49('0x9'));var ejs=require(_0x2f49('0xa'));var fs=require('fs');var fs_extra=require(_0x2f49('0xb'));var _=require(_0x2f49('0xc'));var squel=require('squel');var crypto=require(_0x2f49('0xd'));var jsforce=require(_0x2f49('0xe'));var deskjs=require(_0x2f49('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2f49('0x10'));var Papa=require(_0x2f49('0x11'));var Redis=require('ioredis');var authService=require(_0x2f49('0x12'));var qs=require(_0x2f49('0x13'));var as=require(_0x2f49('0x14'));var hardwareService=require(_0x2f49('0x15'));var logger=require(_0x2f49('0x16'))(_0x2f49('0x17'));var utils=require(_0x2f49('0x18'));var config=require(_0x2f49('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f49('0x1a'))['db'];function respondWithStatusCode(_0x46684e,_0x54d9c1){_0x54d9c1=_0x54d9c1||0xcc;return function(_0x12b1f6){if(_0x12b1f6){return _0x46684e['sendStatus'](_0x54d9c1);}return _0x46684e[_0x2f49('0x1b')](_0x54d9c1)[_0x2f49('0x1c')]();};}function respondWithResult(_0x5f1492,_0x1b023c){_0x1b023c=_0x1b023c||0xc8;return function(_0x2786dc){if(_0x2786dc){return _0x5f1492[_0x2f49('0x1b')](_0x1b023c)[_0x2f49('0x1d')](_0x2786dc);}};}function respondWithFilteredResult(_0x422b03,_0x272014){return function(_0x4a69b7){if(_0x4a69b7){var _0x2d43ce=typeof _0x272014[_0x2f49('0x1e')]===_0x2f49('0x1f')&&typeof _0x272014[_0x2f49('0x20')]===_0x2f49('0x1f');var _0x11261c=_0x4a69b7['count'];var _0x5a9590=_0x2d43ce?0x0:_0x272014[_0x2f49('0x1e')];var _0x57dfb5=_0x2d43ce?_0x4a69b7[_0x2f49('0x21')]:_0x272014[_0x2f49('0x1e')]+_0x272014[_0x2f49('0x20')];var _0x5f519f;if(_0x57dfb5>=_0x11261c){_0x57dfb5=_0x11261c;_0x5f519f=0xc8;}else{_0x5f519f=0xce;}_0x422b03[_0x2f49('0x1b')](_0x5f519f);return _0x422b03[_0x2f49('0x22')]('Content-Range',_0x5a9590+'-'+_0x57dfb5+'/'+_0x11261c)['json'](_0x4a69b7);}return null;};}function patchUpdates(_0x3f86c7){return function(_0x10c4a5){try{jsonpatch['apply'](_0x10c4a5,_0x3f86c7,!![]);}catch(_0x29041c){return BPromise[_0x2f49('0x23')](_0x29041c);}return _0x10c4a5[_0x2f49('0x24')]();};}function saveUpdates(_0x2ecc4f,_0x3170bc){return function(_0x4d9875){if(_0x4d9875){return _0x4d9875[_0x2f49('0x25')](_0x2ecc4f)[_0x2f49('0x26')](function(_0x3f95ca){return _0x3f95ca;});}return null;};}function removeEntity(_0x16ded2,_0x1c1901){return function(_0x45b4b0){if(_0x45b4b0){return _0x45b4b0[_0x2f49('0x27')]()[_0x2f49('0x26')](function(){var _0xc8f063=_0x45b4b0[_0x2f49('0x28')]({'plain':!![]});var _0x5f3131=_0x2f49('0x29');return db[_0x2f49('0x2a')]['destroy']({'where':{'type':_0x5f3131,'resourceId':_0xc8f063['id']}})['then'](function(){return _0x45b4b0;});})['then'](function(){_0x16ded2[_0x2f49('0x1b')](0xcc)[_0x2f49('0x1c')]();});}};}function handleEntityNotFound(_0x574af1,_0x2d503a){return function(_0x23f169){if(!_0x23f169){_0x574af1['sendStatus'](0x194);}return _0x23f169;};}function handleError(_0x55b485,_0x2444fd){_0x2444fd=_0x2444fd||0x1f4;return function(_0x18b48a){logger[_0x2f49('0x2b')](_0x18b48a[_0x2f49('0x2c')]);if(_0x18b48a['name']){delete _0x18b48a[_0x2f49('0x2d')];}_0x55b485[_0x2f49('0x1b')](_0x2444fd)[_0x2f49('0x2e')](_0x18b48a);};}exports[_0x2f49('0x2f')]=function(_0x335f5c,_0x282610){var _0x499380={},_0x38cb7c={},_0x2e7ee9={'count':0x0,'rows':[]};var _0x1ccdb9=_[_0x2f49('0x30')](db['Schedule'][_0x2f49('0x31')],function(_0x20c1d9){return{'name':_0x20c1d9[_0x2f49('0x32')],'type':_0x20c1d9[_0x2f49('0x33')][_0x2f49('0x34')]};});_0x38cb7c[_0x2f49('0x35')]=_['map'](_0x1ccdb9,_0x2f49('0x2d'));_0x38cb7c[_0x2f49('0x36')]=_[_0x2f49('0x37')](_0x335f5c['query']);_0x38cb7c['filters']=_[_0x2f49('0x38')](_0x38cb7c[_0x2f49('0x35')],_0x38cb7c[_0x2f49('0x36')]);_0x499380['attributes']=_[_0x2f49('0x38')](_0x38cb7c[_0x2f49('0x35')],qs[_0x2f49('0x39')](_0x335f5c['query'][_0x2f49('0x39')]));_0x499380['attributes']=_0x499380[_0x2f49('0x3a')][_0x2f49('0x3b')]?_0x499380['attributes']:_0x38cb7c[_0x2f49('0x35')];if(!_0x335f5c['query'][_0x2f49('0x3c')]('nolimit')){_0x499380[_0x2f49('0x20')]=qs['limit'](_0x335f5c['query'][_0x2f49('0x20')]);_0x499380[_0x2f49('0x1e')]=qs[_0x2f49('0x1e')](_0x335f5c[_0x2f49('0x36')][_0x2f49('0x1e')]);}_0x499380[_0x2f49('0x3d')]=qs[_0x2f49('0x3e')](_0x335f5c[_0x2f49('0x36')][_0x2f49('0x3e')]);_0x499380['where']=qs[_0x2f49('0x3f')](_[_0x2f49('0x40')](_0x335f5c['query'],_0x38cb7c[_0x2f49('0x3f')]),_0x1ccdb9);if(_0x335f5c[_0x2f49('0x36')][_0x2f49('0x41')]){_0x499380[_0x2f49('0x42')]=_[_0x2f49('0x43')](_0x499380[_0x2f49('0x42')],{'$or':_['map'](_0x1ccdb9,function(_0xc349ff){if(_0xc349ff[_0x2f49('0x33')]!==_0x2f49('0x44')){var _0x55067f={};_0x55067f[_0xc349ff['name']]={'$like':'%'+_0x335f5c[_0x2f49('0x36')]['filter']+'%'};return _0x55067f;}})});}_0x499380=_[_0x2f49('0x43')]({},_0x499380,_0x335f5c[_0x2f49('0x45')]);var _0x1aee8c={'where':_0x499380['where']};return db[_0x2f49('0x46')][_0x2f49('0x21')](_0x1aee8c)[_0x2f49('0x26')](function(_0x3a5b1b){_0x2e7ee9['count']=_0x3a5b1b;if(_0x335f5c[_0x2f49('0x36')][_0x2f49('0x47')]){_0x499380[_0x2f49('0x48')]=[{'all':!![]}];}return db['Schedule'][_0x2f49('0x49')](_0x499380);})[_0x2f49('0x26')](function(_0x5387fb){_0x2e7ee9['rows']=_0x5387fb;return _0x2e7ee9;})[_0x2f49('0x26')](respondWithFilteredResult(_0x282610,_0x499380))[_0x2f49('0x4a')](handleError(_0x282610,null));};exports[_0x2f49('0x4b')]=function(_0x2db23a,_0x45d7ca){var _0x1984f3={'raw':![],'where':{'id':_0x2db23a[_0x2f49('0x4c')]['id']}},_0x34e693={};_0x34e693[_0x2f49('0x35')]=_[_0x2f49('0x37')](db[_0x2f49('0x46')]['rawAttributes']);_0x34e693[_0x2f49('0x36')]=_['keys'](_0x2db23a['query']);_0x34e693[_0x2f49('0x3f')]=_[_0x2f49('0x38')](_0x34e693[_0x2f49('0x35')],_0x34e693['query']);_0x1984f3[_0x2f49('0x3a')]=_['intersection'](_0x34e693[_0x2f49('0x35')],qs[_0x2f49('0x39')](_0x2db23a[_0x2f49('0x36')][_0x2f49('0x39')]));_0x1984f3[_0x2f49('0x3a')]=_0x1984f3[_0x2f49('0x3a')][_0x2f49('0x3b')]?_0x1984f3[_0x2f49('0x3a')]:_0x34e693[_0x2f49('0x35')];if(_0x2db23a['query']['includeAll']){_0x1984f3[_0x2f49('0x48')]=[{'all':!![]}];}_0x1984f3=_[_0x2f49('0x43')]({},_0x1984f3,_0x2db23a[_0x2f49('0x45')]);return db[_0x2f49('0x46')]['find'](_0x1984f3)[_0x2f49('0x26')](handleEntityNotFound(_0x45d7ca,null))[_0x2f49('0x26')](respondWithResult(_0x45d7ca,null))[_0x2f49('0x4a')](handleError(_0x45d7ca,null));};exports[_0x2f49('0x4d')]=function(_0x125b61,_0x20b9ba){return db[_0x2f49('0x46')][_0x2f49('0x4d')](_0x125b61[_0x2f49('0x4e')],{})[_0x2f49('0x26')](function(_0x1794f9){var _0x55f1b0=_0x125b61[_0x2f49('0x4f')][_0x2f49('0x28')]({'plain':!![]});if(!_0x55f1b0)throw new Error(_0x2f49('0x50'));if(_0x55f1b0[_0x2f49('0x51')]===_0x2f49('0x4f')){var _0x160f1e=_0x1794f9[_0x2f49('0x28')]({'plain':!![]});var _0x1f035a=_0x2f49('0x29');return db[_0x2f49('0x52')][_0x2f49('0x53')]({'where':{'name':_0x1f035a,'userProfileId':_0x55f1b0[_0x2f49('0x54')]},'raw':!![]})[_0x2f49('0x26')](function(_0x122104){if(_0x122104&&_0x122104['autoAssociation']===0x0){return db[_0x2f49('0x2a')][_0x2f49('0x4d')]({'name':_0x160f1e[_0x2f49('0x2d')],'resourceId':_0x160f1e['id'],'type':_0x122104[_0x2f49('0x2d')],'sectionId':_0x122104['id']},{})[_0x2f49('0x26')](function(){return _0x1794f9;});}else{return _0x1794f9;}})[_0x2f49('0x4a')](function(_0x2352c9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2352c9);throw _0x2352c9;});}return _0x1794f9;})[_0x2f49('0x26')](respondWithResult(_0x20b9ba,0xc9))['catch'](handleError(_0x20b9ba,null));};exports[_0x2f49('0x25')]=function(_0x1a4818,_0x462e20){if(_0x1a4818[_0x2f49('0x4e')]['id']){delete _0x1a4818[_0x2f49('0x4e')]['id'];}return db[_0x2f49('0x46')][_0x2f49('0x53')]({'where':{'id':_0x1a4818['params']['id']}})[_0x2f49('0x26')](handleEntityNotFound(_0x462e20,null))[_0x2f49('0x26')](saveUpdates(_0x1a4818[_0x2f49('0x4e')],null))[_0x2f49('0x26')](respondWithResult(_0x462e20,null))[_0x2f49('0x4a')](handleError(_0x462e20,null));};exports['destroy']=function(_0x321656,_0x30a99f){return db[_0x2f49('0x46')][_0x2f49('0x53')]({'where':{'id':_0x321656['params']['id']}})['then'](handleEntityNotFound(_0x30a99f,null))['then'](removeEntity(_0x30a99f,null))['catch'](handleError(_0x30a99f,null));};exports[_0x2f49('0x55')]=function(_0x504fcd,_0x5b816b,_0x1a1a1d){var _0x5cb1be=require(_0x2f49('0x56'));return db[_0x2f49('0x46')][_0x2f49('0x53')]({'where':{'id':_0x504fcd[_0x2f49('0x4c')]['id']},'raw':!![]})[_0x2f49('0x26')](handleEntityNotFound(_0x5b816b,null))[_0x2f49('0x26')](function(){_0x5cb1be[_0x2f49('0x55')](_0x504fcd[_0x2f49('0x4c')]['id']);})[_0x2f49('0x26')](respondWithStatusCode(_0x5b816b,null))[_0x2f49('0x4a')](handleError(_0x5b816b,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c9ce909..9d534d8 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 _0xa628=['util','../../config/logger','moment','bluebird','path','rimraf','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xa628,0x18b));var _0x8a62=function(_0x7de33e,_0x46a873){_0x7de33e=_0x7de33e-0x0;var _0x9b0f8=_0xa628[_0x7de33e];return _0x9b0f8;};'use strict';var _=require(_0x8a62('0x0'));var util=require(_0x8a62('0x1'));var logger=require(_0x8a62('0x2'))('api');var moment=require(_0x8a62('0x3'));var BPromise=require(_0x8a62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a62('0x5'));var rimraf=require(_0x8a62('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a62('0x7'));module[_0x8a62('0x8')]=function(_0x4115cd,_0x261070){return _0x4115cd[_0x8a62('0x9')](_0x8a62('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3ec=['request-promise','../../config/environment','./schedule.attributes','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x383d00,_0x4b4a54){var _0x290afc=function(_0x3bda18){while(--_0x3bda18){_0x383d00['push'](_0x383d00['shift']());}};_0x290afc(++_0x4b4a54);}(_0xc3ec,0x108));var _0xcc3e=function(_0x41c219,_0x1c6e7b){_0x41c219=_0x41c219-0x0;var _0x5564d6=_0xc3ec[_0x41c219];return _0x5564d6;};'use strict';var _=require(_0xcc3e('0x0'));var util=require(_0xcc3e('0x1'));var logger=require(_0xcc3e('0x2'))(_0xcc3e('0x3'));var moment=require(_0xcc3e('0x4'));var BPromise=require(_0xcc3e('0x5'));var rp=require(_0xcc3e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcc3e('0x7'));var attributes=require(_0xcc3e('0x8'));module['exports']=function(_0x68ce0d,_0x1df06b){return _0x68ce0d['define']('Schedule',attributes,{'tableName':_0xcc3e('0x9'),'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 826725e..911a825 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 _0x8082=['Schedule,\x20%s,\x20%s','debug','Schedule,\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','client','http','then','info'];(function(_0x8d9f0a,_0x282ce){var _0x1e5fa4=function(_0x129672){while(--_0x129672){_0x8d9f0a['push'](_0x8d9f0a['shift']());}};_0x1e5fa4(++_0x282ce);}(_0x8082,0xb2));var _0x2808=function(_0xe267f9,_0x5a15d4){_0xe267f9=_0xe267f9-0x0;var _0x24ea0f=_0x8082[_0xe267f9];return _0x24ea0f;};'use strict';var _=require(_0x2808('0x0'));var util=require(_0x2808('0x1'));var moment=require(_0x2808('0x2'));var BPromise=require('bluebird');var rs=require(_0x2808('0x3'));var fs=require('fs');var Redis=require(_0x2808('0x4'));var db=require(_0x2808('0x5'))['db'];var utils=require(_0x2808('0x6'));var logger=require('../../config/logger')(_0x2808('0x7'));var config=require(_0x2808('0x8'));var jayson=require(_0x2808('0x9'));var client=jayson[_0x2808('0xa')][_0x2808('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfd13d2,_0x397cc5,_0x5f398){return new BPromise(function(_0x1abf00,_0xdfd291){return client['request'](_0xfd13d2,_0x5f398)[_0x2808('0xc')](function(_0x42b7ca){logger[_0x2808('0xd')](_0x2808('0xe'),_0x397cc5,'request\x20sent');logger[_0x2808('0xf')](_0x2808('0x10'),_0x397cc5,'request\x20sent',JSON[_0x2808('0x11')](_0x42b7ca));if(_0x42b7ca[_0x2808('0x12')]){if(_0x42b7ca['error'][_0x2808('0x13')]===0x1f4){logger[_0x2808('0x12')](_0x2808('0xe'),_0x397cc5,_0x42b7ca[_0x2808('0x12')][_0x2808('0x14')]);return _0xdfd291(_0x42b7ca[_0x2808('0x12')][_0x2808('0x14')]);}logger['error'](_0x2808('0xe'),_0x397cc5,_0x42b7ca[_0x2808('0x12')]['message']);return _0x1abf00(_0x42b7ca[_0x2808('0x12')][_0x2808('0x14')]);}else{logger['info'](_0x2808('0xe'),_0x397cc5,_0x2808('0x15'));_0x1abf00(_0x42b7ca[_0x2808('0x16')][_0x2808('0x14')]);}})[_0x2808('0x17')](function(_0x3e13d2){logger['error'](_0x2808('0xe'),_0x397cc5,_0x3e13d2);_0xdfd291(_0x3e13d2);});});} \ No newline at end of file +var _0x887d=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x7ab91,_0xd79b85){var _0x1e2a6c=function(_0x1016c2){while(--_0x1016c2){_0x7ab91['push'](_0x7ab91['shift']());}};_0x1e2a6c(++_0xd79b85);}(_0x887d,0x12e));var _0xd887=function(_0x38563b,_0xce6b66){_0x38563b=_0x38563b-0x0;var _0x427ee5=_0x887d[_0x38563b];return _0x427ee5;};'use strict';var _=require(_0xd887('0x0'));var util=require(_0xd887('0x1'));var moment=require(_0xd887('0x2'));var BPromise=require(_0xd887('0x3'));var rs=require(_0xd887('0x4'));var fs=require('fs');var Redis=require(_0xd887('0x5'));var db=require(_0xd887('0x6'))['db'];var utils=require(_0xd887('0x7'));var logger=require('../../config/logger')(_0xd887('0x8'));var config=require(_0xd887('0x9'));var jayson=require(_0xd887('0xa'));var client=jayson[_0xd887('0xb')][_0xd887('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53aaac,_0x596237,_0x312a60){return new BPromise(function(_0x1785ae,_0x1dbed2){return client[_0xd887('0xd')](_0x53aaac,_0x312a60)[_0xd887('0xe')](function(_0x3d6fd6){logger[_0xd887('0xf')](_0xd887('0x10'),_0x596237,_0xd887('0x11'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x596237,_0xd887('0x11'),JSON['stringify'](_0x3d6fd6));if(_0x3d6fd6['error']){if(_0x3d6fd6['error'][_0xd887('0x12')]===0x1f4){logger[_0xd887('0x13')](_0xd887('0x10'),_0x596237,_0x3d6fd6[_0xd887('0x13')][_0xd887('0x14')]);return _0x1dbed2(_0x3d6fd6[_0xd887('0x13')][_0xd887('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x596237,_0x3d6fd6[_0xd887('0x13')][_0xd887('0x14')]);return _0x1785ae(_0x3d6fd6[_0xd887('0x13')]['message']);}else{logger[_0xd887('0xf')](_0xd887('0x10'),_0x596237,'request\x20sent');_0x1785ae(_0x3d6fd6[_0xd887('0x15')][_0xd887('0x14')]);}})[_0xd887('0x16')](function(_0x3d07f7){logger['error'](_0xd887('0x10'),_0x596237,_0x3d07f7);_0x1dbed2(_0x3d07f7);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 696e753..52d910e 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 _0x2964=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','show','/:id/download','download','create'];(function(_0x2cebda,_0x38d823){var _0x29eb8e=function(_0x2db8e8){while(--_0x2db8e8){_0x2cebda['push'](_0x2cebda['shift']());}};_0x29eb8e(++_0x38d823);}(_0x2964,0x8f));var _0x4296=function(_0x60f50f,_0x4370d5){_0x60f50f=_0x60f50f-0x0;var _0x4d83e9=_0x2964[_0x60f50f];return _0x4d83e9;};'use strict';var multer=require(_0x4296('0x0'));var util=require(_0x4296('0x1'));var path=require(_0x4296('0x2'));var timeout=require(_0x4296('0x3'));var express=require(_0x4296('0x4'));var router=express[_0x4296('0x5')]();var fs_extra=require(_0x4296('0x6'));var auth=require(_0x4296('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4296('0x8'));var controller=require(_0x4296('0x9'));router[_0x4296('0xa')]('/',auth[_0x4296('0xb')](),controller['index']);router[_0x4296('0xa')](_0x4296('0xc'),auth[_0x4296('0xb')](),controller[_0x4296('0xd')]);router[_0x4296('0xa')]('/:id',auth[_0x4296('0xb')](),controller[_0x4296('0xe')]);router[_0x4296('0xa')](_0x4296('0xf'),auth[_0x4296('0xb')](),controller[_0x4296('0x10')]);router['post']('/',auth[_0x4296('0xb')](),controller[_0x4296('0x11')]);router[_0x4296('0x12')](_0x4296('0x13'),auth[_0x4296('0xb')](),controller['update']);router[_0x4296('0x14')]('/:id',auth[_0x4296('0xb')](),controller[_0x4296('0x15')]);module[_0x4296('0x16')]=router; \ No newline at end of file +var _0x3ffb=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','download','post','create'];(function(_0x1f2055,_0x1e4f3f){var _0x42f42f=function(_0x2d3bcf){while(--_0x2d3bcf){_0x1f2055['push'](_0x1f2055['shift']());}};_0x42f42f(++_0x1e4f3f);}(_0x3ffb,0x1b5));var _0xb3ff=function(_0x37707c,_0x183b78){_0x37707c=_0x37707c-0x0;var _0x8fbb53=_0x3ffb[_0x37707c];return _0x8fbb53;};'use strict';var multer=require(_0xb3ff('0x0'));var util=require(_0xb3ff('0x1'));var path=require(_0xb3ff('0x2'));var timeout=require(_0xb3ff('0x3'));var express=require(_0xb3ff('0x4'));var router=express[_0xb3ff('0x5')]();var fs_extra=require(_0xb3ff('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb3ff('0x7'));var config=require(_0xb3ff('0x8'));var controller=require(_0xb3ff('0x9'));router['get']('/',auth[_0xb3ff('0xa')](),controller[_0xb3ff('0xb')]);router[_0xb3ff('0xc')](_0xb3ff('0xd'),auth[_0xb3ff('0xa')](),controller[_0xb3ff('0xe')]);router[_0xb3ff('0xc')](_0xb3ff('0xf'),auth[_0xb3ff('0xa')](),controller['show']);router[_0xb3ff('0xc')]('/:id/download',auth[_0xb3ff('0xa')](),controller[_0xb3ff('0x10')]);router[_0xb3ff('0x11')]('/',auth[_0xb3ff('0xa')](),controller[_0xb3ff('0x12')]);router[_0xb3ff('0x13')](_0xb3ff('0xf'),auth['isAuthenticated'](),controller[_0xb3ff('0x14')]);router[_0xb3ff('0x15')](_0xb3ff('0xf'),auth[_0xb3ff('0xa')](),controller[_0xb3ff('0x16')]);module[_0xb3ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 3ad49b5..aaf69af 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 _0x69d4=['../../config/environment','exports','VIRTUAL','value','getDataValue','STRING','replace','INTEGER','subtract','setDataValue','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','sequelize','moment'];(function(_0x5185c6,_0x4e7c65){var _0x1a9c19=function(_0x4b882b){while(--_0x4b882b){_0x5185c6['push'](_0x5185c6['shift']());}};_0x1a9c19(++_0x4e7c65);}(_0x69d4,0x83));var _0x469d=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x69d4[_0x2eb5bc];return _0x51c7b1;};'use strict';var Sequelize=require(_0x469d('0x0'));var moment=require(_0x469d('0x1'));var path=require('path');var config=require(_0x469d('0x2'));module[_0x469d('0x3')]={'format':{'type':Sequelize[_0x469d('0x4')],'get':function(){return this['getDataValue'](_0x469d('0x5'))?path['extname'](this[_0x469d('0x6')](_0x469d('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x469d('0x7')]},'channel':{'type':Sequelize[_0x469d('0x7')]},'value':{'type':Sequelize[_0x469d('0x7')],'set':function(_0xb15ca9){var _0x5129a8=_0xb15ca9[_0x469d('0x8')](/\\/g,'/');this['setDataValue'](_0x469d('0x5'),_0x5129a8);}},'rating':{'type':Sequelize[_0x469d('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x469d('0x9')],'set':function(_0x5f05c9){this['setDataValue']('startedAt',moment()[_0x469d('0xa')](_0x5f05c9,'ms'));this[_0x469d('0xb')]('closedAt',moment());this[_0x469d('0xb')](_0x469d('0xc'),_0x5f05c9);}},'startedAt':{'type':Sequelize[_0x469d('0xd')],'get':function(){return moment(this['getDataValue']('startedAt'))['format'](_0x469d('0xe'))[_0x469d('0xf')]();}},'closedAt':{'type':Sequelize[_0x469d('0xd')],'get':function(){return moment(this[_0x469d('0x6')](_0x469d('0x10')))[_0x469d('0x11')](_0x469d('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0x469d('0xd')],'get':function(){return moment(this[_0x469d('0x6')](_0x469d('0x12')))[_0x469d('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x469d('0xf')]();}},'updatedAt':{'type':Sequelize[_0x469d('0xd')],'get':function(){return moment(this[_0x469d('0x6')]('updatedAt'))[_0x469d('0x11')](_0x469d('0xe'))[_0x469d('0xf')]();}}}; \ No newline at end of file +var _0x3fce=['updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE'];(function(_0xa3120e,_0x1dfc30){var _0x559e2d=function(_0x3cdcbd){while(--_0x3cdcbd){_0xa3120e['push'](_0xa3120e['shift']());}};_0x559e2d(++_0x1dfc30);}(_0x3fce,0x121));var _0xe3fc=function(_0x2423d7,_0xe6ec57){_0x2423d7=_0x2423d7-0x0;var _0x151d17=_0x3fce[_0x2423d7];return _0x151d17;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe3fc('0x0'));var path=require(_0xe3fc('0x1'));var config=require(_0xe3fc('0x2'));module[_0xe3fc('0x3')]={'format':{'type':Sequelize[_0xe3fc('0x4')],'get':function(){return this[_0xe3fc('0x5')](_0xe3fc('0x6'))?path['extname'](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe3fc('0x7')]},'value':{'type':Sequelize[_0xe3fc('0x7')],'set':function(_0x523982){var _0x200715=_0x523982['replace'](/\\/g,'/');this[_0xe3fc('0x8')]('value',_0x200715);}},'rating':{'type':Sequelize[_0xe3fc('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe3fc('0x9')],'set':function(_0x1bb7be){this[_0xe3fc('0x8')](_0xe3fc('0xa'),moment()['subtract'](_0x1bb7be,'ms'));this['setDataValue'](_0xe3fc('0xb'),moment());this[_0xe3fc('0x8')](_0xe3fc('0xc'),_0x1bb7be);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe3fc('0x5')](_0xe3fc('0xa')))[_0xe3fc('0xd')](_0xe3fc('0xe'))[_0xe3fc('0xf')]();}},'closedAt':{'type':Sequelize[_0xe3fc('0x10')],'get':function(){return moment(this[_0xe3fc('0x5')]('closedAt'))[_0xe3fc('0xd')](_0xe3fc('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xe3fc('0x10')],'get':function(){return moment(this[_0xe3fc('0x5')]('createdAt'))[_0xe3fc('0xd')](_0xe3fc('0xe'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xe3fc('0x11')))[_0xe3fc('0xd')](_0xe3fc('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index cbc48ce..33603c1 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 _0x84ab=['describe','download','join','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','server/files/screen_recordings','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','type','key','model','differenceBy','map','format','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','ScreenRecording','rows','params','keys','intersection','find','catch','body','createdAt','value'];(function(_0x391dee,_0x58aefb){var _0x54853b=function(_0x3575ec){while(--_0x3575ec){_0x391dee['push'](_0x391dee['shift']());}};_0x54853b(++_0x58aefb);}(_0x84ab,0x12f));var _0xb84a=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x84ab[_0x5c2c7c];return _0xea7ffe;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x409df0,_0x19bdfa){return function(_0x3258a9){if(!_0x3258a9){_0x409df0[_0xb84a('0x16')](0x194);}return _0x3258a9;};}function handleError(_0x3ff0bc,_0x3b6805){_0x3b6805=_0x3b6805||0x1f4;return function(_0xd468c3){logger[_0xb84a('0x24')](_0xd468c3[_0xb84a('0x25')]);if(_0xd468c3[_0xb84a('0x26')]){delete _0xd468c3[_0xb84a('0x26')];}_0x3ff0bc[_0xb84a('0x17')](_0x3b6805)[_0xb84a('0x27')](_0xd468c3);};}exports['index']=function(_0x582954,_0x4608ce){var _0x2c30b0={},_0x4dab4e={},_0x1f690a={'count':0x0,'rows':[]};var _0x36b4f4=_['map'](db['ScreenRecording'][_0xb84a('0x28')],function(_0x8e9319){return{'name':_0x8e9319['fieldName'],'type':_0x8e9319[_0xb84a('0x29')][_0xb84a('0x2a')]};});_0x4dab4e[_0xb84a('0x2b')]=_[_0xb84a('0x2c')](_[_0xb84a('0x2d')](_0x36b4f4,_0xb84a('0x26')),[_0xb84a('0x2e')]);_0x4dab4e[_0xb84a('0x2f')]=_['keys'](_0x582954[_0xb84a('0x2f')]);_0x4dab4e['filters']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],_0x4dab4e[_0xb84a('0x2f')]);_0x2c30b0['attributes']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],qs[_0xb84a('0x30')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x2c30b0[_0xb84a('0x31')]=_0x2c30b0[_0xb84a('0x31')][_0xb84a('0x32')]?_0x2c30b0[_0xb84a('0x31')]:_0x4dab4e['model'];if(!_0x582954[_0xb84a('0x2f')][_0xb84a('0x33')](_0xb84a('0x34'))){_0x2c30b0[_0xb84a('0x1c')]=qs[_0xb84a('0x1c')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x2c30b0['offset']=qs[_0xb84a('0x1a')](_0x582954['query'][_0xb84a('0x1a')]);}_0x2c30b0[_0xb84a('0x35')]=qs[_0xb84a('0x36')](_0x582954['query']['sort']);_0x2c30b0[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_[_0xb84a('0x39')](_0x582954[_0xb84a('0x2f')],_0x4dab4e[_0xb84a('0x38')]),_0x36b4f4);if(_0x582954['query'][_0xb84a('0x3a')]){_0x2c30b0[_0xb84a('0x37')]=_['merge'](_0x2c30b0[_0xb84a('0x37')],{'$or':_[_0xb84a('0x2d')](_0x36b4f4,function(_0x19634b){if(_0x19634b[_0xb84a('0x29')]!=='VIRTUAL'){var _0x57a1a8={};_0x57a1a8[_0x19634b['name']]={'$like':'%'+_0x582954[_0xb84a('0x2f')][_0xb84a('0x3a')]+'%'};return _0x57a1a8;}})});}_0x2c30b0=_[_0xb84a('0x3b')]({},_0x2c30b0,_0x582954[_0xb84a('0x3c')]);var _0x55b0b8={'where':_0x2c30b0[_0xb84a('0x37')]};return db['ScreenRecording'][_0xb84a('0x1d')](_0x55b0b8)['then'](function(_0x48db18){_0x1f690a['count']=_0x48db18;if(_0x582954[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x2c30b0[_0xb84a('0x3e')]=[{'all':!![]}];}return db[_0xb84a('0x3f')]['findAll'](_0x2c30b0);})[_0xb84a('0x22')](function(_0x42f0b6){_0x1f690a[_0xb84a('0x40')]=_0x42f0b6;return _0x1f690a;})[_0xb84a('0x22')](respondWithFilteredResult(_0x4608ce,_0x2c30b0))['catch'](handleError(_0x4608ce,null));};exports['show']=function(_0x15a621,_0x1f3e04){var _0x541cc4={'raw':![],'where':{'id':_0x15a621[_0xb84a('0x41')]['id']}},_0x1045ee={};_0x1045ee[_0xb84a('0x2b')]=_[_0xb84a('0x42')](db[_0xb84a('0x3f')][_0xb84a('0x28')]);_0x1045ee[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x15a621[_0xb84a('0x2f')]);_0x1045ee[_0xb84a('0x38')]=_[_0xb84a('0x43')](_0x1045ee[_0xb84a('0x2b')],_0x1045ee[_0xb84a('0x2f')]);_0x541cc4[_0xb84a('0x31')]=_[_0xb84a('0x43')](_0x1045ee['model'],qs[_0xb84a('0x30')](_0x15a621[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x541cc4[_0xb84a('0x31')]=_0x541cc4[_0xb84a('0x31')][_0xb84a('0x32')]?_0x541cc4['attributes']:_0x1045ee[_0xb84a('0x2b')];if(_0x15a621['query'][_0xb84a('0x3d')]){_0x541cc4[_0xb84a('0x3e')]=[{'all':!![]}];}_0x541cc4=_[_0xb84a('0x3b')]({},_0x541cc4,_0x15a621[_0xb84a('0x3c')]);return db['ScreenRecording'][_0xb84a('0x44')](_0x541cc4)[_0xb84a('0x22')](handleEntityNotFound(_0x1f3e04,null))[_0xb84a('0x22')](respondWithResult(_0x1f3e04,null))['catch'](handleError(_0x1f3e04,null));};exports['create']=function(_0x385986,_0x10b0cc){return db[_0xb84a('0x3f')]['create'](_0x385986['body'],{})['then'](respondWithResult(_0x10b0cc,0xc9))[_0xb84a('0x45')](handleError(_0x10b0cc,null));};exports[_0xb84a('0x21')]=function(_0x38f329,_0x4476bc){if(_0x38f329[_0xb84a('0x46')]['id']){delete _0x38f329['body']['id'];}delete _0x38f329['body']['duration'];delete _0x38f329['body'][_0xb84a('0x47')];delete _0x38f329[_0xb84a('0x46')]['closedAt'];delete _0x38f329[_0xb84a('0x46')][_0xb84a('0x48')];return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x38f329[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](handleEntityNotFound(_0x4476bc,null))['then'](saveUpdates(_0x38f329['body'],null))[_0xb84a('0x22')](respondWithResult(_0x4476bc,null))['catch'](handleError(_0x4476bc,null));};exports[_0xb84a('0x49')]=function(_0x4d1a29,_0x575908){return db['ScreenRecording'][_0xb84a('0x49')]()[_0xb84a('0x22')](respondWithResult(_0x575908,null))[_0xb84a('0x45')](handleError(_0x575908,null));};exports[_0xb84a('0x4a')]=function(_0x33adfc,_0x46f7eb,_0x37ca26){var _0x29ff35=require('../../components/encryptor');var _0x5afdd0=![];var _0x4c5bdf={};if(_0x33adfc[_0xb84a('0x2f')][_0xb84a('0x29')]&&_0x33adfc['query'][_0xb84a('0x29')]==='uniqueid'){_0x4c5bdf['uniqueid']=_0x33adfc['params']['id'];}else{_0x4c5bdf['id']=_0x33adfc[_0xb84a('0x41')]['id'];}return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':_0x4c5bdf,'attributes':['id','value'],'raw':!![]})[_0xb84a('0x22')](handleEntityNotFound(_0x46f7eb,null))[_0xb84a('0x22')](function(_0x136d61){if(_0x136d61){var _0x505994=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x136d61[_0xb84a('0x48')]);var _0x47a8a2=util[_0xb84a('0x2e')]('%s.cypher',_0x505994);if(fs[_0xb84a('0x4c')](_0x47a8a2)){_0x5afdd0=!![];return _0x29ff35[_0xb84a('0x4d')](_0x47a8a2,_0x505994,config[_0xb84a('0x4e')][_0xb84a('0x4f')])['then'](function(){return _0x136d61;});}return _0x136d61;}})['then'](function(_0x4fc998){if(_0x4fc998){var _0x40b392=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x4fc998[_0xb84a('0x48')]);if(!fs[_0xb84a('0x4c')](_0x40b392)){throw new db[(_0xb84a('0x50'))]['ValidationError'](_0xb84a('0x51'));}if(_0x4fc998[_0xb84a('0x52')]){return _0x46f7eb['download'](_0x40b392,_0x4fc998[_0xb84a('0x52')]+path[_0xb84a('0x53')](_0x40b392),function(){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}else{return _0x46f7eb[_0xb84a('0x4a')](_0x40b392,function(_0x3bbc69){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}}})[_0xb84a('0x45')](function(_0x47c27f){if(_0x47c27f[_0xb84a('0x55')]===_0xb84a('0x51')){_0x46f7eb['status'](0x194)[_0xb84a('0x27')](_0xb84a('0x56'));}else{return handleError(_0x46f7eb,null);}});};exports[_0xb84a('0x23')]=function(_0x3e16d8,_0x347998){return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x3e16d8[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](function(_0x5dd660){if(_[_0xb84a('0x57')](_0x5dd660)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5dd660;})['then'](function(_0x19d635){var _0x5e11c8=path[_0xb84a('0x4b')](config['root'],_0xb84a('0x58'),_0x19d635[_0xb84a('0x48')]);logger['info'](_0xb84a('0x59'),_0x5e11c8);if(!_[_0xb84a('0x57')](_0x19d635[_0xb84a('0x48')])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}_0x5e11c8=_0x5e11c8+_0xb84a('0x5d');if(!_['isNil'](_0x19d635['value'])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}return _0x19d635;})['then'](function(_0x43031f){if(!_0x43031f)throw new InternalError();return _0x43031f[_0xb84a('0x23')]();})[_0xb84a('0x22')](function(){_0x347998[_0xb84a('0x17')](0xcc)['end']();})[_0xb84a('0x45')](handleError(_0x347998,null));}; \ No newline at end of file +var _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x3edac1,_0x21744b){var _0x30f80a=function(_0x279d0b){while(--_0x279d0b){_0x3edac1['push'](_0x3edac1['shift']());}};_0x30f80a(++_0x21744b);}(_0xbd50,0x196));var _0x0bd5=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0xbd50[_0x5f4902];return _0x743933;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 7509bd6..b131b55 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 _0xe596=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x286ab2,_0x96257f){var _0x5bd7d4=function(_0x49a464){while(--_0x49a464){_0x286ab2['push'](_0x286ab2['shift']());}};_0x5bd7d4(++_0x96257f);}(_0xe596,0x1ea));var _0x6e59=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe596[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x6e59('0x0'));var util=require(_0x6e59('0x1'));var logger=require(_0x6e59('0x2'))(_0x6e59('0x3'));var moment=require(_0x6e59('0x4'));var BPromise=require('bluebird');var rp=require(_0x6e59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e59('0x6'));var config=require(_0x6e59('0x7'));var attributes=require(_0x6e59('0x8'));module[_0x6e59('0x9')]=function(_0x3fef15,_0x567a9c){return _0x3fef15[_0x6e59('0xa')](_0x6e59('0xb'),attributes,{'tableName':_0x6e59('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x6e59('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda01=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xda01,0xff));var _0x1da0=function(_0x46cd60,_0x3a4833){_0x46cd60=_0x46cd60-0x0;var _0x3bcc43=_0xda01[_0x46cd60];return _0x3bcc43;};'use strict';var _=require(_0x1da0('0x0'));var util=require(_0x1da0('0x1'));var logger=require(_0x1da0('0x2'))(_0x1da0('0x3'));var moment=require('moment');var BPromise=require(_0x1da0('0x4'));var rp=require(_0x1da0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1da0('0x6'));var config=require(_0x1da0('0x7'));var attributes=require(_0x1da0('0x8'));module[_0x1da0('0x9')]=function(_0x47f57c,_0x2cfab3){return _0x47f57c[_0x1da0('0xa')](_0x1da0('0xb'),attributes,{'tableName':_0x1da0('0xc'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x1da0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f9663c9..91cbadd 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 _0xb7f5=['error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xb7f5,0x123));var _0x5b7f=function(_0x2141d4,_0x43f664){_0x2141d4=_0x2141d4-0x0;var _0x3f7976=_0xb7f5[_0x2141d4];return _0x3f7976;};'use strict';var _=require(_0x5b7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5b7f('0x1'));var rs=require(_0x5b7f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b7f('0x3'))['db'];var utils=require(_0x5b7f('0x4'));var logger=require(_0x5b7f('0x5'))(_0x5b7f('0x6'));var config=require(_0x5b7f('0x7'));var jayson=require(_0x5b7f('0x8'));var client=jayson[_0x5b7f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11055d,_0x22a60a,_0x38d724){return new BPromise(function(_0xfdd6df,_0x4bb883){return client[_0x5b7f('0xa')](_0x11055d,_0x38d724)['then'](function(_0x3bc252){logger[_0x5b7f('0xb')](_0x5b7f('0xc'),_0x22a60a,'request\x20sent');logger[_0x5b7f('0xd')](_0x5b7f('0xe'),_0x22a60a,_0x5b7f('0xf'),JSON[_0x5b7f('0x10')](_0x3bc252));if(_0x3bc252['error']){if(_0x3bc252[_0x5b7f('0x11')][_0x5b7f('0x12')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x22a60a,_0x3bc252['error'][_0x5b7f('0x13')]);return _0x4bb883(_0x3bc252[_0x5b7f('0x11')][_0x5b7f('0x13')]);}logger[_0x5b7f('0x11')](_0x5b7f('0xc'),_0x22a60a,_0x3bc252[_0x5b7f('0x11')][_0x5b7f('0x13')]);return _0xfdd6df(_0x3bc252[_0x5b7f('0x11')][_0x5b7f('0x13')]);}else{logger['info'](_0x5b7f('0xc'),_0x22a60a,_0x5b7f('0xf'));_0xfdd6df(_0x3bc252[_0x5b7f('0x14')][_0x5b7f('0x13')]);}})[_0x5b7f('0x15')](function(_0x152792){logger[_0x5b7f('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x22a60a,_0x152792);_0x4bb883(_0x152792);});});} \ No newline at end of file +var _0xef55=['rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15cedb,_0x571b65){var _0x4ff465=function(_0xd30afd){while(--_0xd30afd){_0x15cedb['push'](_0x15cedb['shift']());}};_0x4ff465(++_0x571b65);}(_0xef55,0xff));var _0x5ef5=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xef55[_0x4cc280];return _0x16ed24;};'use strict';var _=require('lodash');var util=require(_0x5ef5('0x0'));var moment=require('moment');var BPromise=require(_0x5ef5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ef5('0x2'))['db'];var utils=require(_0x5ef5('0x3'));var logger=require(_0x5ef5('0x4'))(_0x5ef5('0x5'));var config=require(_0x5ef5('0x6'));var jayson=require(_0x5ef5('0x7'));var client=jayson['client'][_0x5ef5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13c607,_0x136439,_0x3be2d9){return new BPromise(function(_0x11d89d,_0x1eb5db){return client[_0x5ef5('0x9')](_0x13c607,_0x3be2d9)[_0x5ef5('0xa')](function(_0x17c44b){logger[_0x5ef5('0xb')](_0x5ef5('0xc'),_0x136439,_0x5ef5('0xd'));logger[_0x5ef5('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x136439,_0x5ef5('0xd'),JSON[_0x5ef5('0xf')](_0x17c44b));if(_0x17c44b[_0x5ef5('0x10')]){if(_0x17c44b[_0x5ef5('0x10')][_0x5ef5('0x11')]===0x1f4){logger[_0x5ef5('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x136439,_0x17c44b[_0x5ef5('0x10')]['message']);return _0x1eb5db(_0x17c44b[_0x5ef5('0x10')]['message']);}logger[_0x5ef5('0x10')](_0x5ef5('0xc'),_0x136439,_0x17c44b['error'][_0x5ef5('0x12')]);return _0x11d89d(_0x17c44b[_0x5ef5('0x10')][_0x5ef5('0x12')]);}else{logger['info'](_0x5ef5('0xc'),_0x136439,_0x5ef5('0xd'));_0x11d89d(_0x17c44b[_0x5ef5('0x13')][_0x5ef5('0x12')]);}})['catch'](function(_0xeec3f1){logger[_0x5ef5('0x10')](_0x5ef5('0xc'),_0x136439,_0xeec3f1);_0x1eb5db(_0xeec3f1);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index d005abc..6a525bd 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 _0xc319=['fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','/:id/logo','getLogo','/:id/gdpr','/:id/preferred','/:id/favicon','diskStorage','join','format','logo','originalname','post','single','root','server/files/images/logos/','extname','/:id/logo_login','file','%s%s','preferred','favicon','addFavicon','isAuthenticated','update','exports','multer','path','express','Router'];(function(_0x27b423,_0x312583){var _0x5c11b8=function(_0x22a3b9){while(--_0x22a3b9){_0x27b423['push'](_0x27b423['shift']());}};_0x5c11b8(++_0x312583);}(_0xc319,0x15a));var _0x9c31=function(_0x50113e,_0x1e3ff6){_0x50113e=_0x50113e-0x0;var _0x39c647=_0xc319[_0x50113e];return _0x39c647;};'use strict';var multer=require(_0x9c31('0x0'));var util=require('util');var path=require(_0x9c31('0x1'));var timeout=require('connect-timeout');var express=require(_0x9c31('0x2'));var router=express[_0x9c31('0x3')]();var fs_extra=require(_0x9c31('0x4'));var auth=require(_0x9c31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c31('0x6'));var controller=require('./setting.controller');router[_0x9c31('0x7')]('/',auth['isAuthenticated'](),controller[_0x9c31('0x8')]);router['get']('/now',controller['getDate']);router['get'](_0x9c31('0x9'),controller[_0x9c31('0xa')]);router['get'](_0x9c31('0xb'),controller[_0x9c31('0xc')]);router[_0x9c31('0x7')]('/:id/logo_login',controller['getLogoLogin']);router[_0x9c31('0x7')](_0x9c31('0xd'),controller['gdpr']);router[_0x9c31('0x7')](_0x9c31('0xe'),controller['getPreferred']);router['get'](_0x9c31('0xf'),controller['getFavicon']);var upload=multer({'storage':multer[_0x9c31('0x10')]({'destination':function(_0x332cf3,_0x4b080f,_0x3b7755){_0x3b7755(null,path[_0x9c31('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5c2a77,_0xf2de7,_0x404b2e){_0x404b2e(null,util[_0x9c31('0x12')]('%s%s',_0x9c31('0x13'),path['extname'](_0xf2de7[_0x9c31('0x14')])));}})});router[_0x9c31('0x15')](_0x9c31('0xb'),upload[_0x9c31('0x16')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x9c31('0x10')]({'destination':function(_0x5f0c9c,_0x5796ac,_0x7e6ba4){_0x7e6ba4(null,path['join'](config[_0x9c31('0x17')],_0x9c31('0x18')));},'filename':function(_0x549990,_0x57369d,_0x46f509){_0x46f509(null,util[_0x9c31('0x12')]('%s%s','logologin',path[_0x9c31('0x19')](_0x57369d['originalname'])));}})});router[_0x9c31('0x15')](_0x9c31('0x1a'),upload['single'](_0x9c31('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27ef6d,_0x3c16d3,_0x494889){_0x494889(null,path[_0x9c31('0x11')](config['root'],'server/files/images/logos/'));},'filename':function(_0x6a49ad,_0x363b3d,_0x1d7b5b){_0x1d7b5b(null,util['format'](_0x9c31('0x1c'),_0x9c31('0x1d'),path[_0x9c31('0x19')](_0x363b3d[_0x9c31('0x14')])));}})});router[_0x9c31('0x15')]('/:id/preferred',upload[_0x9c31('0x16')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0x9c31('0x10')]({'destination':function(_0x2efd12,_0x231d2a,_0x42e4ea){_0x42e4ea(null,path[_0x9c31('0x11')](config[_0x9c31('0x17')],_0x9c31('0x18')));},'filename':function(_0x1e5aef,_0x5e99ab,_0xc42de4){_0xc42de4(null,util[_0x9c31('0x12')]('%s%s',_0x9c31('0x1e'),path['extname'](_0x5e99ab['originalname'])));}})});router[_0x9c31('0x15')](_0x9c31('0xf'),upload[_0x9c31('0x16')](_0x9c31('0x1b')),controller[_0x9c31('0x1f')]);router['put'](_0x9c31('0x9'),auth[_0x9c31('0x20')](),controller[_0x9c31('0x21')]);module[_0x9c31('0x22')]=router; \ No newline at end of file +var _0xf87a=['Router','fs-extra','../../components/interaction/service','./setting.controller','isAuthenticated','index','get','/now','getDate','/:id','show','getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','join','root','server/files/images/logos/','format','logo','extname','/:id/logo','single','file','diskStorage','%s%s','logologin','originalname','post','/:id/logo_login','addLogoLogin','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x575934,_0x4a6760){var _0x109a3d=function(_0x1c20a1){while(--_0x1c20a1){_0x575934['push'](_0x575934['shift']());}};_0x109a3d(++_0x4a6760);}(_0xf87a,0x17e));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xaf87('0x0'));var util=require(_0xaf87('0x1'));var path=require(_0xaf87('0x2'));var timeout=require(_0xaf87('0x3'));var express=require(_0xaf87('0x4'));var router=express[_0xaf87('0x5')]();var fs_extra=require(_0xaf87('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaf87('0x7'));var config=require('../../config/environment');var controller=require(_0xaf87('0x8'));router['get']('/',auth[_0xaf87('0x9')](),controller[_0xaf87('0xa')]);router[_0xaf87('0xb')](_0xaf87('0xc'),controller[_0xaf87('0xd')]);router[_0xaf87('0xb')](_0xaf87('0xe'),controller[_0xaf87('0xf')]);router[_0xaf87('0xb')]('/:id/logo',controller[_0xaf87('0x10')]);router[_0xaf87('0xb')]('/:id/logo_login',controller[_0xaf87('0x11')]);router['get']('/:id/gdpr',controller[_0xaf87('0x12')]);router[_0xaf87('0xb')](_0xaf87('0x13'),controller[_0xaf87('0x14')]);router[_0xaf87('0xb')](_0xaf87('0x15'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x569ef4,_0xe5d795,_0x38a491){_0x38a491(null,path[_0xaf87('0x16')](config[_0xaf87('0x17')],_0xaf87('0x18')));},'filename':function(_0x3d3b6f,_0x28bbd9,_0x8884fa){_0x8884fa(null,util[_0xaf87('0x19')]('%s%s',_0xaf87('0x1a'),path[_0xaf87('0x1b')](_0x28bbd9['originalname'])));}})});router['post'](_0xaf87('0x1c'),upload[_0xaf87('0x1d')](_0xaf87('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xaf87('0x1f')]({'destination':function(_0x1a23ae,_0x341721,_0x71ec4d){_0x71ec4d(null,path['join'](config[_0xaf87('0x17')],'server/files/images/logos/'));},'filename':function(_0x39512a,_0x27a4db,_0x564fbf){_0x564fbf(null,util[_0xaf87('0x19')](_0xaf87('0x20'),_0xaf87('0x21'),path['extname'](_0x27a4db[_0xaf87('0x22')])));}})});router[_0xaf87('0x23')](_0xaf87('0x24'),upload[_0xaf87('0x1d')]('file'),controller[_0xaf87('0x25')]);var upload=multer({'storage':multer[_0xaf87('0x1f')]({'destination':function(_0x4a4bcb,_0x58561d,_0x207b5a){_0x207b5a(null,path[_0xaf87('0x16')](config[_0xaf87('0x17')],_0xaf87('0x18')));},'filename':function(_0xbd5b2c,_0x2c893a,_0x620aa9){_0x620aa9(null,util[_0xaf87('0x19')](_0xaf87('0x20'),'preferred',path[_0xaf87('0x1b')](_0x2c893a[_0xaf87('0x22')])));}})});router[_0xaf87('0x23')](_0xaf87('0x13'),upload[_0xaf87('0x1d')]('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xaf87('0x1f')]({'destination':function(_0x23f223,_0x68f69f,_0x58c4ad){_0x58c4ad(null,path[_0xaf87('0x16')](config[_0xaf87('0x17')],_0xaf87('0x18')));},'filename':function(_0x2ad11c,_0x14696a,_0x2a8598){_0x2a8598(null,util[_0xaf87('0x19')](_0xaf87('0x20'),_0xaf87('0x26'),path[_0xaf87('0x1b')](_0x14696a[_0xaf87('0x22')])));}})});router[_0xaf87('0x23')](_0xaf87('0x15'),upload[_0xaf87('0x1d')](_0xaf87('0x1e')),controller[_0xaf87('0x27')]);router[_0xaf87('0x28')](_0xaf87('0xe'),auth['isAuthenticated'](),controller[_0xaf87('0x29')]);module[_0xaf87('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b5cabb0..8136603 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 _0x5c3f=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox'];(function(_0x47be30,_0x4db49a){var _0x5571d3=function(_0x42fb91){while(--_0x42fb91){_0x47be30['push'](_0x47be30['shift']());}};_0x5571d3(++_0x4db49a);}(_0x5c3f,0xdd));var _0xf5c3=function(_0x465292,_0x146b27){_0x465292=_0x465292-0x0;var _0x184534=_0x5c3f[_0x465292];return _0x184534;};'use strict';var Sequelize=require(_0xf5c3('0x0'));module[_0xf5c3('0x1')]={'min_internal':{'type':Sequelize[_0xf5c3('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5c3('0x2')](0xb),'unique':_0xf5c3('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5c3('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5c3('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xf5c3('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5c3('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5c3('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xf5c3('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xf5c3('0x4')]},'pageTitle':{'type':Sequelize[_0xf5c3('0x4')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xf5c3('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xf5c3('0x4')],'defaultValue':_0xf5c3('0x6')},'enableEmailPreview':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5c3('0x4')],'defaultValue':_0xf5c3('0x7')},'chatTimeout':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xf5c3('0x4')]},'defaultFavicon':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5c3('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5c3('0x4')]},'sentiment':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5c3('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5c3('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xf5c3('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5c3('0x2')](0x2)[_0xf5c3('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xf5c3('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5c3('0x2')](0x2)[_0xf5c3('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5c3('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5c3('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8085=['alternate','UNSIGNED','INTEGER','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x274f68,_0x554bd4){var _0x47ae73=function(_0x97ea72){while(--_0x97ea72){_0x274f68['push'](_0x274f68['shift']());}};_0x47ae73(++_0x554bd4);}(_0x8085,0x12f));var _0x5808=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0x8085[_0x3b231a];return _0x18d67a;};'use strict';var Sequelize=require('sequelize');module['exports']={'min_internal':{'type':Sequelize[_0x5808('0x0')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x5808('0x0')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5808('0x1')],'defaultValue':_0x5808('0x2')},'logo':{'type':Sequelize[_0x5808('0x1')]},'defaultLogo':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5808('0x1')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5808('0x1')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5808('0x1')]},'turnaddr':{'type':Sequelize[_0x5808('0x1')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x5808('0x1')]},'defaultPageTitle':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x5808('0x1')],'defaultValue':_0x5808('0x4')},'enableEmailPreview':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'split':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5808('0x1')],'defaultValue':_0x5808('0x5')},'chatTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5808('0x1')]},'defaultPreferred':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5808('0x1')]},'allowedLoginAttempts':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5808('0x1')]},'defaultFavicon':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5808('0x0')]},'transcribeRegion':{'type':Sequelize[_0x5808('0x1')]},'sentiment':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5808('0x0')]},'sentimentRegion':{'type':Sequelize[_0x5808('0x1')]},'language':{'type':Sequelize[_0x5808('0x1')]},'bucket':{'type':Sequelize[_0x5808('0x1')]},'googleSsoEnabled':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5808('0x3')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x5808('0x0')](0x2)[_0x5808('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x5808('0x0')](0x2)[_0x5808('0x6')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5808('0x0')](0x2)[_0x5808('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5808('0x0')](0x2)[_0x5808('0x6')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5808('0x0')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5808('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index e7878f7..3a0d122 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 _0x5e85=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','reject','update','destroy','sendStatus','stack','name','index','map','Setting','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','favicon','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x3adfce,_0x346df4){var _0x557153=function(_0x5cd1fc){while(--_0x5cd1fc){_0x3adfce['push'](_0x3adfce['shift']());}};_0x557153(++_0x346df4);}(_0x5e85,0x161));var _0x55e8=function(_0x2b21a7,_0x5d8fd8){_0x2b21a7=_0x2b21a7-0x0;var _0x2582cb=_0x5e85[_0x2b21a7];return _0x2582cb;};'use strict';var emlformat=require(_0x55e8('0x0'));var rimraf=require(_0x55e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x55e8('0x2'));var moment=require('moment');var BPromise=require(_0x55e8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x55e8('0x4'));var sox=require(_0x55e8('0x5'));var csv=require('to-csv');var ejs=require(_0x55e8('0x6'));var fs=require('fs');var fs_extra=require(_0x55e8('0x7'));var _=require(_0x55e8('0x8'));var squel=require(_0x55e8('0x9'));var crypto=require(_0x55e8('0xa'));var jsforce=require(_0x55e8('0xb'));var deskjs=require(_0x55e8('0xc'));var toCsv=require(_0x55e8('0xd'));var querystring=require(_0x55e8('0xe'));var Papa=require(_0x55e8('0xf'));var Redis=require(_0x55e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x55e8('0x11'));var as=require(_0x55e8('0x12'));var hardwareService=require(_0x55e8('0x13'));var logger=require(_0x55e8('0x14'))(_0x55e8('0x15'));var utils=require(_0x55e8('0x16'));var config=require(_0x55e8('0x17'));var licenseUtil=require(_0x55e8('0x18'));var db=require(_0x55e8('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x55e8('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57ab00,_0x45889e,_0x33c09b,_0xf1a1da){return new BPromise(function(_0x5a2cb8,_0x39a715){var _0x177b74=_0xf1a1da||client;return _0x177b74['request'](_0x57ab00,_0x33c09b)[_0x55e8('0x1b')](function(_0x2e9e16){logger[_0x55e8('0x1c')](_0x55e8('0x1d'),_0x45889e,'request\x20sent');logger[_0x55e8('0x1e')](_0x55e8('0x1f'),_0x45889e,_0x55e8('0x20'),JSON[_0x55e8('0x21')](_0x2e9e16));if(_0x2e9e16[_0x55e8('0x22')]){if(_0x2e9e16['error'][_0x55e8('0x23')]===0x1f4){logger[_0x55e8('0x22')](_0x55e8('0x1d'),_0x45889e,_0x2e9e16[_0x55e8('0x22')][_0x55e8('0x24')]);return _0x39a715(_0x2e9e16[_0x55e8('0x22')]['message']);}logger[_0x55e8('0x22')]('Setting,\x20%s,\x20%s',_0x45889e,_0x2e9e16['error']['message']);return _0x5a2cb8(_0x2e9e16[_0x55e8('0x22')][_0x55e8('0x24')]);}else{logger[_0x55e8('0x1c')](_0x55e8('0x1d'),_0x45889e,_0x55e8('0x20'));_0x5a2cb8(_0x2e9e16[_0x55e8('0x25')][_0x55e8('0x24')]);}})['catch'](function(_0x4a4be7){logger['error']('Setting,\x20%s,\x20%s',_0x45889e,_0x4a4be7);_0x39a715(_0x4a4be7);});});}function respondWithStatusCode(_0x3de897,_0x21225a){_0x21225a=_0x21225a||0xcc;return function(_0x13d48f){if(_0x13d48f){return _0x3de897['sendStatus'](_0x21225a);}return _0x3de897[_0x55e8('0x26')](_0x21225a)[_0x55e8('0x27')]();};}function respondWithResult(_0xd5b5af,_0x26b46a){_0x26b46a=_0x26b46a||0xc8;return function(_0x415032){if(_0x415032){return _0xd5b5af['status'](_0x26b46a)[_0x55e8('0x28')](_0x415032);}};}function respondWithFilteredResult(_0x58c56d,_0x39bee5){return function(_0x44d775){if(_0x44d775){var _0x3cf6f3=typeof _0x39bee5[_0x55e8('0x29')]===_0x55e8('0x2a')&&typeof _0x39bee5[_0x55e8('0x2b')]===_0x55e8('0x2a');var _0xdd6d7b=_0x44d775['count'];var _0x3be122=_0x3cf6f3?0x0:_0x39bee5[_0x55e8('0x29')];var _0x1954e3=_0x3cf6f3?_0x44d775[_0x55e8('0x2c')]:_0x39bee5['offset']+_0x39bee5[_0x55e8('0x2b')];var _0x4cbe52;if(_0x1954e3>=_0xdd6d7b){_0x1954e3=_0xdd6d7b;_0x4cbe52=0xc8;}else{_0x4cbe52=0xce;}_0x58c56d[_0x55e8('0x26')](_0x4cbe52);return _0x58c56d[_0x55e8('0x2d')]('Content-Range',_0x3be122+'-'+_0x1954e3+'/'+_0xdd6d7b)['json'](_0x44d775);}return null;};}function patchUpdates(_0x5b5526){return function(_0x57dd5b){try{jsonpatch['apply'](_0x57dd5b,_0x5b5526,!![]);}catch(_0x560d32){return BPromise[_0x55e8('0x2e')](_0x560d32);}return _0x57dd5b['save']();};}function saveUpdates(_0x3dcb78,_0x236496){return function(_0x3c3624){if(_0x3c3624){return _0x3c3624[_0x55e8('0x2f')](_0x3dcb78)[_0x55e8('0x1b')](function(_0x23d064){return _0x23d064;});}return null;};}function removeEntity(_0x1c2fd2,_0x2ecd40){return function(_0x3fd282){if(_0x3fd282){return _0x3fd282[_0x55e8('0x30')]()[_0x55e8('0x1b')](function(){_0x1c2fd2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec9db,_0x258c5f){return function(_0x44524c){if(!_0x44524c){_0x4ec9db[_0x55e8('0x31')](0x194);}return _0x44524c;};}function handleError(_0xb55b64,_0x5f9d36){_0x5f9d36=_0x5f9d36||0x1f4;return function(_0x3260ff){logger[_0x55e8('0x22')](_0x3260ff[_0x55e8('0x32')]);if(_0x3260ff[_0x55e8('0x33')]){delete _0x3260ff[_0x55e8('0x33')];}_0xb55b64[_0x55e8('0x26')](_0x5f9d36)['send'](_0x3260ff);};}exports[_0x55e8('0x34')]=function(_0x3fcfcb,_0x364ce3){var _0x5f0ad3={},_0x14556c={},_0x480129={'count':0x0,'rows':[]};var _0x2e1155=_[_0x55e8('0x35')](db[_0x55e8('0x36')][_0x55e8('0x37')],function(_0x481035){return{'name':_0x481035[_0x55e8('0x38')],'type':_0x481035[_0x55e8('0x39')]['key']};});_0x14556c[_0x55e8('0x3a')]=_[_0x55e8('0x35')](_0x2e1155,'name');_0x14556c['query']=_[_0x55e8('0x3b')](_0x3fcfcb['query']);_0x14556c[_0x55e8('0x3c')]=_[_0x55e8('0x3d')](_0x14556c[_0x55e8('0x3a')],_0x14556c[_0x55e8('0x3e')]);_0x5f0ad3[_0x55e8('0x3f')]=_[_0x55e8('0x3d')](_0x14556c[_0x55e8('0x3a')],qs['fields'](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x40')]));_0x5f0ad3[_0x55e8('0x3f')]=_0x5f0ad3['attributes'][_0x55e8('0x41')]?_0x5f0ad3[_0x55e8('0x3f')]:_0x14556c[_0x55e8('0x3a')];if(!_0x3fcfcb['query'][_0x55e8('0x42')]('nolimit')){_0x5f0ad3[_0x55e8('0x2b')]=qs[_0x55e8('0x2b')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x2b')]);_0x5f0ad3[_0x55e8('0x29')]=qs[_0x55e8('0x29')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x29')]);}_0x5f0ad3[_0x55e8('0x43')]=qs[_0x55e8('0x44')](_0x3fcfcb[_0x55e8('0x3e')][_0x55e8('0x44')]);_0x5f0ad3[_0x55e8('0x45')]=qs[_0x55e8('0x3c')](_[_0x55e8('0x46')](_0x3fcfcb[_0x55e8('0x3e')],_0x14556c[_0x55e8('0x3c')]),_0x2e1155);if(_0x3fcfcb[_0x55e8('0x3e')]['filter']){_0x5f0ad3[_0x55e8('0x45')]=_[_0x55e8('0x47')](_0x5f0ad3[_0x55e8('0x45')],{'$or':_[_0x55e8('0x35')](_0x2e1155,function(_0x2faae0){if(_0x2faae0[_0x55e8('0x39')]!==_0x55e8('0x48')){var _0x50e5b2={};_0x50e5b2[_0x2faae0['name']]={'$like':'%'+_0x3fcfcb['query']['filter']+'%'};return _0x50e5b2;}})});}_0x5f0ad3=_[_0x55e8('0x47')]({},_0x5f0ad3,_0x3fcfcb[_0x55e8('0x49')]);var _0x333e58={'where':_0x5f0ad3[_0x55e8('0x45')]};return db[_0x55e8('0x36')][_0x55e8('0x2c')](_0x333e58)[_0x55e8('0x1b')](function(_0x4a6969){_0x480129[_0x55e8('0x2c')]=_0x4a6969;if(_0x3fcfcb['query'][_0x55e8('0x4a')]){_0x5f0ad3['include']=[{'all':!![]}];}return db[_0x55e8('0x36')]['findAll'](_0x5f0ad3);})['then'](function(_0x23af0c){_0x480129[_0x55e8('0x4b')]=_0x23af0c;return _0x480129;})[_0x55e8('0x1b')](respondWithFilteredResult(_0x364ce3,_0x5f0ad3))[_0x55e8('0x4c')](handleError(_0x364ce3,null));};exports[_0x55e8('0x4d')]=function(_0x4d3628,_0x29a246){var _0x4c1e78={'raw':![],'where':{'id':_0x4d3628[_0x55e8('0x4e')]['id']}},_0x5e9fdc={};_0x5e9fdc[_0x55e8('0x3a')]=_[_0x55e8('0x3b')](db[_0x55e8('0x36')][_0x55e8('0x37')]);_0x5e9fdc['query']=_[_0x55e8('0x3b')](_0x4d3628[_0x55e8('0x3e')]);_0x5e9fdc[_0x55e8('0x3c')]=_[_0x55e8('0x3d')](_0x5e9fdc[_0x55e8('0x3a')],_0x5e9fdc[_0x55e8('0x3e')]);_0x4c1e78[_0x55e8('0x3f')]=_[_0x55e8('0x3d')](_0x5e9fdc[_0x55e8('0x3a')],qs['fields'](_0x4d3628[_0x55e8('0x3e')][_0x55e8('0x40')]));_0x4c1e78[_0x55e8('0x3f')]=_0x4c1e78[_0x55e8('0x3f')][_0x55e8('0x41')]?_0x4c1e78['attributes']:_0x5e9fdc['model'];if(_0x4d3628[_0x55e8('0x3e')][_0x55e8('0x4a')]){_0x4c1e78[_0x55e8('0x4f')]=[{'all':!![]}];}_0x4c1e78=_['merge']({},_0x4c1e78,_0x4d3628[_0x55e8('0x49')]);return db['Setting'][_0x55e8('0x50')](_0x4c1e78)[_0x55e8('0x1b')](handleEntityNotFound(_0x29a246,null))['then'](respondWithResult(_0x29a246,null))[_0x55e8('0x4c')](handleError(_0x29a246,null));};exports['update']=function(_0x3cd180,_0x269d17){if(_0x3cd180['body']['id']){delete _0x3cd180['body']['id'];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x3cd180[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x269d17,null))[_0x55e8('0x1b')](saveUpdates(_0x3cd180[_0x55e8('0x51')],null))[_0x55e8('0x1b')](respondWithResult(_0x269d17,null))[_0x55e8('0x4c')](handleError(_0x269d17,null));};exports[_0x55e8('0x52')]=function(_0x58fc8e,_0x36baa8,_0x19793e){if(_0x58fc8e['file']&&_0x58fc8e[_0x55e8('0x53')][_0x55e8('0x54')]){_0x58fc8e['body'][_0x55e8('0x55')]=_0x58fc8e[_0x55e8('0x53')][_0x55e8('0x54')];}return db[_0x55e8('0x36')]['find']({'where':{'id':_0x58fc8e['params']['id']}})['then'](handleEntityNotFound(_0x36baa8,null))[_0x55e8('0x1b')](saveUpdates(_0x58fc8e[_0x55e8('0x51')],null))['then'](respondWithResult(_0x36baa8,null))[_0x55e8('0x4c')](handleError(_0x36baa8,null));};exports[_0x55e8('0x56')]=function(_0x19c97c,_0x50f5e3,_0x3ded51){if(_0x19c97c[_0x55e8('0x53')]&&_0x19c97c[_0x55e8('0x53')][_0x55e8('0x54')]){_0x19c97c[_0x55e8('0x51')][_0x55e8('0x57')]=_0x19c97c['file'][_0x55e8('0x54')];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x19c97c['params']['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x50f5e3,null))[_0x55e8('0x1b')](saveUpdates(_0x19c97c['body'],null))['then'](respondWithResult(_0x50f5e3,null))[_0x55e8('0x4c')](handleError(_0x50f5e3,null));};var utilLicense=require('../../config/license/util');exports[_0x55e8('0x58')]=function(_0x12eb15,_0x52e250,_0x5ea1f5){var _0x27f6cf=_0x55e8('0x59');var _0x5413b4={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x7bd431){if(_0x7bd431){_0x5413b4=_0x7bd431;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x12eb15[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),'favicon',_0x55e8('0x5b'),_0x55e8('0x5c'),_0x55e8('0x5d'),_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x52e250,null))['then'](function(_0xdc1e34){if(_0xdc1e34){var _0x2feeaa=_0xdc1e34[_0x55e8('0x55')]&&fs['existsSync'](path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_['toLower'](_0xdc1e34['logo'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0xdc1e34[_0x55e8('0x55')])):path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0x55e8('0x62')));var _0x319dea=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x55'));if(_0xdc1e34[_0x319dea]||!_0x5413b4[_0x55e8('0x65')]){_0x2feeaa=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x27f6cf,_[_0x55e8('0x61')](_0x55e8('0x62')));}if(!fs[_0x55e8('0x66')](_0x2feeaa)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')](_0x55e8('0x55'))+_0x55e8('0x69'));}return _0x52e250[_0x55e8('0x6a')](_0x2feeaa);}})[_0x55e8('0x4c')](handleError(_0x52e250,null));};var utilLicense=require(_0x55e8('0x18'));exports[_0x55e8('0x6b')]=function(_0x137e2f,_0x35bd40,_0x3897df){var _0x586021=_0x55e8('0x59');var _0x4db8bc={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x56c627){if(_0x56c627){_0x4db8bc=_0x56c627;}return db['Setting'][_0x55e8('0x50')]({'where':{'id':_0x137e2f[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),_0x55e8('0x6d'),_0x55e8('0x5b'),_0x55e8('0x5c'),_0x55e8('0x5d'),_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x35bd40,null))[_0x55e8('0x1b')](function(_0x1d507e){if(_0x1d507e){var _0x3f119d=_0x1d507e[_0x55e8('0x57')]&&fs[_0x55e8('0x66')](path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x1d507e[_0x55e8('0x57')])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x1d507e[_0x55e8('0x57')])):path['join'](config['root'],_0x586021,_[_0x55e8('0x61')](_0x55e8('0x6e')));var _0x1c0195=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x57'));if(_0x1d507e[_0x1c0195]||!_0x4db8bc[_0x55e8('0x65')]){_0x3f119d=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x586021,_[_0x55e8('0x61')](_0x55e8('0x6e')));}if(!fs[_0x55e8('0x66')](_0x3f119d)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')]('loginLogo')+'\x20not\x20found');}return _0x35bd40[_0x55e8('0x6a')](_0x3f119d);}})[_0x55e8('0x4c')](handleError(_0x35bd40,null));};exports['gdpr']=function(_0x4c0ed5,_0x400916){return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x4c0ed5[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x6f')]})[_0x55e8('0x1b')](respondWithResult(_0x400916,null))[_0x55e8('0x4c')](handleError(_0x400916,null));};exports[_0x55e8('0x70')]=function(_0x1c7726,_0x10eb93,_0x499997){if(_0x1c7726[_0x55e8('0x53')]&&_0x1c7726[_0x55e8('0x53')][_0x55e8('0x54')]){_0x1c7726[_0x55e8('0x51')][_0x55e8('0x5a')]=_0x1c7726[_0x55e8('0x53')][_0x55e8('0x54')];}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x1c7726[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x10eb93,null))['then'](saveUpdates(_0x1c7726['body'],null))[_0x55e8('0x1b')](respondWithResult(_0x10eb93,null))[_0x55e8('0x4c')](handleError(_0x10eb93,null));};var utilLicense=require(_0x55e8('0x18'));exports[_0x55e8('0x71')]=function(_0x5ef2e9,_0x5de839,_0x2d8678){var _0x364f87=_0x55e8('0x59');var _0x44a9d5={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x551a78){if(_0x551a78){_0x44a9d5=_0x551a78;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x5ef2e9[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),_0x55e8('0x57'),_0x55e8('0x5a'),'favicon','defaultLogo',_0x55e8('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5de839,null))[_0x55e8('0x1b')](function(_0x370414){if(_0x370414){var _0x431f63=_0x370414[_0x55e8('0x5a')]&&fs[_0x55e8('0x66')](path['join'](config[_0x55e8('0x60')],_0x364f87,_[_0x55e8('0x61')](_0x370414['preferred'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x364f87,_['toLower'](_0x370414[_0x55e8('0x5a')])):path['join'](config['root'],_0x364f87,_['toLower']('default_preferred.png'));var _0x4b2083='default'+_[_0x55e8('0x64')](_0x55e8('0x5a'));if(_0x370414[_0x4b2083]||!_0x44a9d5[_0x55e8('0x65')]||!_0x44a9d5[_0x55e8('0x5a')]){_0x431f63=path['join'](config[_0x55e8('0x60')],_0x364f87,_[_0x55e8('0x61')](_0x55e8('0x72')));}if(!fs[_0x55e8('0x66')](_0x431f63)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_['upperFirst'](_0x55e8('0x5a'))+_0x55e8('0x69'));}return _0x5de839[_0x55e8('0x6a')](_0x431f63);}})[_0x55e8('0x4c')](handleError(_0x5de839,null));};exports[_0x55e8('0x73')]=function(_0x31ce11,_0x2df4dc,_0x5cab19){if(_0x31ce11[_0x55e8('0x53')]&&_0x31ce11[_0x55e8('0x53')][_0x55e8('0x54')]){_0x31ce11[_0x55e8('0x51')]['favicon']=_0x31ce11['file'][_0x55e8('0x54')];}return db[_0x55e8('0x36')]['find']({'where':{'id':_0x31ce11[_0x55e8('0x4e')]['id']}})[_0x55e8('0x1b')](handleEntityNotFound(_0x2df4dc,null))[_0x55e8('0x1b')](saveUpdates(_0x31ce11[_0x55e8('0x51')],null))[_0x55e8('0x1b')](respondWithResult(_0x2df4dc,null))['catch'](handleError(_0x2df4dc,null));};var utilLicense=require('../../config/license/util');exports[_0x55e8('0x74')]=function(_0x19f914,_0x50bc0f,_0x57cda2){var _0x51569f=_0x55e8('0x59');var _0x1efa23={'custom':![]};return utilLicense[_0x55e8('0x6c')]()[_0x55e8('0x1b')](function(_0x5a2387){if(_0x5a2387){_0x1efa23=_0x5a2387;}return db[_0x55e8('0x36')][_0x55e8('0x50')]({'where':{'id':_0x19f914[_0x55e8('0x4e')]['id']},'attributes':[_0x55e8('0x55'),'loginLogo',_0x55e8('0x5a'),_0x55e8('0x6d'),'defaultLogo',_0x55e8('0x5c'),'defaultPreferred',_0x55e8('0x5e')],'raw':!![]});})[_0x55e8('0x1b')](handleEntityNotFound(_0x50bc0f,null))[_0x55e8('0x1b')](function(_0x34adac){if(_0x34adac){var _0x99a62d=_0x34adac[_0x55e8('0x6d')]&&fs[_0x55e8('0x66')](path['join'](config[_0x55e8('0x60')],_0x51569f,_['toLower'](_0x34adac['favicon'])))?path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_[_0x55e8('0x61')](_0x34adac['favicon'])):path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_[_0x55e8('0x61')]('default_favicon.ico'));var _0x43c309=_0x55e8('0x63')+_[_0x55e8('0x64')](_0x55e8('0x6d'));if(_0x34adac[_0x43c309]||!_0x1efa23[_0x55e8('0x65')]){_0x99a62d=path[_0x55e8('0x5f')](config[_0x55e8('0x60')],_0x51569f,_['toLower'](_0x55e8('0x75')));}if(!fs[_0x55e8('0x66')](_0x99a62d)){throw new db[(_0x55e8('0x67'))][(_0x55e8('0x68'))](_[_0x55e8('0x64')](_0x55e8('0x6d'))+'\x20not\x20found');}return _0x50bc0f['download'](_0x99a62d);}})[_0x55e8('0x4c')](handleError(_0x50bc0f,null));};exports['getDate']=function(_0x271a70,_0x5b2a85){var _0x5b9484={'offset':moment()[_0x55e8('0x76')]()};_0x5b9484[_0x55e8('0x77')]=moment()['utcOffset'](_0x5b9484[_0x55e8('0x29')])[_0x55e8('0x78')](_0x55e8('0x79'));return _0x5b2a85['status'](0xc8)[_0x55e8('0x7a')](_0x5b9484);}; \ No newline at end of file +var _0x3379=['defaultFavicon','existsSync','join','toLower','root','default','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','upperFirst','gdpr','addPreferred','getPreferred','favicon','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','destroy','stack','name','send','index','map','Setting','fieldName','type','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','model','rawAttributes','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','defaultLogo','defaultLoginLogo'];(function(_0x106941,_0x4a1182){var _0x2a99d0=function(_0x2cde32){while(--_0x2cde32){_0x106941['push'](_0x106941['shift']());}};_0x2a99d0(++_0x4a1182);}(_0x3379,0x115));var _0x9337=function(_0x20d1c6,_0x3d734a){_0x20d1c6=_0x20d1c6-0x0;var _0x493d91=_0x3379[_0x20d1c6];return _0x493d91;};'use strict';var emlformat=require(_0x9337('0x0'));var rimraf=require(_0x9337('0x1'));var zipdir=require(_0x9337('0x2'));var jsonpatch=require(_0x9337('0x3'));var rp=require('request-promise');var moment=require(_0x9337('0x4'));var BPromise=require(_0x9337('0x5'));var Mustache=require(_0x9337('0x6'));var util=require(_0x9337('0x7'));var path=require('path');var sox=require(_0x9337('0x8'));var csv=require(_0x9337('0x9'));var ejs=require(_0x9337('0xa'));var fs=require('fs');var fs_extra=require(_0x9337('0xb'));var _=require('lodash');var squel=require(_0x9337('0xc'));var crypto=require('crypto');var jsforce=require(_0x9337('0xd'));var deskjs=require(_0x9337('0xe'));var toCsv=require(_0x9337('0x9'));var querystring=require(_0x9337('0xf'));var Papa=require(_0x9337('0x10'));var Redis=require('ioredis');var authService=require(_0x9337('0x11'));var qs=require(_0x9337('0x12'));var as=require(_0x9337('0x13'));var hardwareService=require(_0x9337('0x14'));var logger=require(_0x9337('0x15'))('api');var utils=require(_0x9337('0x16'));var config=require(_0x9337('0x17'));var licenseUtil=require(_0x9337('0x18'));var db=require(_0x9337('0x19'))['db'];var jayson=require(_0x9337('0x1a'));var client=jayson[_0x9337('0x1b')][_0x9337('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4f2fc4,_0x4dafd1,_0xa58254,_0xedb2b6){return new BPromise(function(_0x12f1f1,_0x14e7a0){var _0x4c246d=_0xedb2b6||client;return _0x4c246d['request'](_0x4f2fc4,_0xa58254)[_0x9337('0x1d')](function(_0x594b51){logger['info'](_0x9337('0x1e'),_0x4dafd1,_0x9337('0x1f'));logger[_0x9337('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x4dafd1,_0x9337('0x1f'),JSON[_0x9337('0x21')](_0x594b51));if(_0x594b51['error']){if(_0x594b51['error'][_0x9337('0x22')]===0x1f4){logger[_0x9337('0x23')]('Setting,\x20%s,\x20%s',_0x4dafd1,_0x594b51[_0x9337('0x23')][_0x9337('0x24')]);return _0x14e7a0(_0x594b51['error'][_0x9337('0x24')]);}logger[_0x9337('0x23')]('Setting,\x20%s,\x20%s',_0x4dafd1,_0x594b51[_0x9337('0x23')][_0x9337('0x24')]);return _0x12f1f1(_0x594b51['error']['message']);}else{logger[_0x9337('0x25')]('Setting,\x20%s,\x20%s',_0x4dafd1,_0x9337('0x1f'));_0x12f1f1(_0x594b51['result'][_0x9337('0x24')]);}})['catch'](function(_0x571446){logger[_0x9337('0x23')]('Setting,\x20%s,\x20%s',_0x4dafd1,_0x571446);_0x14e7a0(_0x571446);});});}function respondWithStatusCode(_0xe4b053,_0x543cfc){_0x543cfc=_0x543cfc||0xcc;return function(_0x1e8d80){if(_0x1e8d80){return _0xe4b053[_0x9337('0x26')](_0x543cfc);}return _0xe4b053[_0x9337('0x27')](_0x543cfc)[_0x9337('0x28')]();};}function respondWithResult(_0x125af7,_0xb49ff1){_0xb49ff1=_0xb49ff1||0xc8;return function(_0x523b64){if(_0x523b64){return _0x125af7['status'](_0xb49ff1)[_0x9337('0x29')](_0x523b64);}};}function respondWithFilteredResult(_0x3eb4c4,_0x2a87e7){return function(_0x178ed5){if(_0x178ed5){var _0x4ef25a=typeof _0x2a87e7[_0x9337('0x2a')]==='undefined'&&typeof _0x2a87e7[_0x9337('0x2b')]===_0x9337('0x2c');var _0x3916c0=_0x178ed5[_0x9337('0x2d')];var _0x4da717=_0x4ef25a?0x0:_0x2a87e7['offset'];var _0x33dc88=_0x4ef25a?_0x178ed5[_0x9337('0x2d')]:_0x2a87e7[_0x9337('0x2a')]+_0x2a87e7[_0x9337('0x2b')];var _0x1cd9e5;if(_0x33dc88>=_0x3916c0){_0x33dc88=_0x3916c0;_0x1cd9e5=0xc8;}else{_0x1cd9e5=0xce;}_0x3eb4c4['status'](_0x1cd9e5);return _0x3eb4c4[_0x9337('0x2e')]('Content-Range',_0x4da717+'-'+_0x33dc88+'/'+_0x3916c0)[_0x9337('0x29')](_0x178ed5);}return null;};}function patchUpdates(_0x4fa0e7){return function(_0x4d5c20){try{jsonpatch['apply'](_0x4d5c20,_0x4fa0e7,!![]);}catch(_0x5b67c3){return BPromise[_0x9337('0x2f')](_0x5b67c3);}return _0x4d5c20[_0x9337('0x30')]();};}function saveUpdates(_0xd4afec,_0x8ca74c){return function(_0x251dfb){if(_0x251dfb){return _0x251dfb['update'](_0xd4afec)['then'](function(_0x13f75f){return _0x13f75f;});}return null;};}function removeEntity(_0x1b2138,_0x2e709e){return function(_0x2bd238){if(_0x2bd238){return _0x2bd238[_0x9337('0x31')]()[_0x9337('0x1d')](function(){_0x1b2138['status'](0xcc)[_0x9337('0x28')]();});}};}function handleEntityNotFound(_0x21d3d9,_0x3ca9d2){return function(_0x5686e6){if(!_0x5686e6){_0x21d3d9[_0x9337('0x26')](0x194);}return _0x5686e6;};}function handleError(_0x55b529,_0x1ac3ef){_0x1ac3ef=_0x1ac3ef||0x1f4;return function(_0x268ed6){logger[_0x9337('0x23')](_0x268ed6[_0x9337('0x32')]);if(_0x268ed6[_0x9337('0x33')]){delete _0x268ed6[_0x9337('0x33')];}_0x55b529[_0x9337('0x27')](_0x1ac3ef)[_0x9337('0x34')](_0x268ed6);};}exports[_0x9337('0x35')]=function(_0x19b436,_0x1fbb16){var _0xfe1a77={},_0x27486f={},_0x4635da={'count':0x0,'rows':[]};var _0x4f6bd9=_[_0x9337('0x36')](db[_0x9337('0x37')]['rawAttributes'],function(_0x36d542){return{'name':_0x36d542[_0x9337('0x38')],'type':_0x36d542[_0x9337('0x39')][_0x9337('0x3a')]};});_0x27486f['model']=_[_0x9337('0x36')](_0x4f6bd9,'name');_0x27486f[_0x9337('0x3b')]=_[_0x9337('0x3c')](_0x19b436[_0x9337('0x3b')]);_0x27486f['filters']=_[_0x9337('0x3d')](_0x27486f['model'],_0x27486f['query']);_0xfe1a77[_0x9337('0x3e')]=_['intersection'](_0x27486f['model'],qs[_0x9337('0x3f')](_0x19b436['query'][_0x9337('0x3f')]));_0xfe1a77['attributes']=_0xfe1a77['attributes'][_0x9337('0x40')]?_0xfe1a77['attributes']:_0x27486f['model'];if(!_0x19b436['query'][_0x9337('0x41')](_0x9337('0x42'))){_0xfe1a77['limit']=qs[_0x9337('0x2b')](_0x19b436[_0x9337('0x3b')][_0x9337('0x2b')]);_0xfe1a77[_0x9337('0x2a')]=qs['offset'](_0x19b436[_0x9337('0x3b')][_0x9337('0x2a')]);}_0xfe1a77[_0x9337('0x43')]=qs[_0x9337('0x44')](_0x19b436[_0x9337('0x3b')][_0x9337('0x44')]);_0xfe1a77[_0x9337('0x45')]=qs[_0x9337('0x46')](_['pick'](_0x19b436[_0x9337('0x3b')],_0x27486f[_0x9337('0x46')]),_0x4f6bd9);if(_0x19b436[_0x9337('0x3b')][_0x9337('0x47')]){_0xfe1a77[_0x9337('0x45')]=_[_0x9337('0x48')](_0xfe1a77[_0x9337('0x45')],{'$or':_[_0x9337('0x36')](_0x4f6bd9,function(_0x59bea9){if(_0x59bea9['type']!==_0x9337('0x49')){var _0x20c473={};_0x20c473[_0x59bea9[_0x9337('0x33')]]={'$like':'%'+_0x19b436['query'][_0x9337('0x47')]+'%'};return _0x20c473;}})});}_0xfe1a77=_[_0x9337('0x48')]({},_0xfe1a77,_0x19b436[_0x9337('0x4a')]);var _0x351362={'where':_0xfe1a77[_0x9337('0x45')]};return db[_0x9337('0x37')]['count'](_0x351362)[_0x9337('0x1d')](function(_0x2bd7e7){_0x4635da['count']=_0x2bd7e7;if(_0x19b436['query'][_0x9337('0x4b')]){_0xfe1a77[_0x9337('0x4c')]=[{'all':!![]}];}return db[_0x9337('0x37')][_0x9337('0x4d')](_0xfe1a77);})[_0x9337('0x1d')](function(_0x56bfe7){_0x4635da[_0x9337('0x4e')]=_0x56bfe7;return _0x4635da;})[_0x9337('0x1d')](respondWithFilteredResult(_0x1fbb16,_0xfe1a77))[_0x9337('0x4f')](handleError(_0x1fbb16,null));};exports[_0x9337('0x50')]=function(_0x195acb,_0x3f88db){var _0x9f57ab={'raw':![],'where':{'id':_0x195acb[_0x9337('0x51')]['id']}},_0x32efcd={};_0x32efcd[_0x9337('0x52')]=_[_0x9337('0x3c')](db[_0x9337('0x37')][_0x9337('0x53')]);_0x32efcd[_0x9337('0x3b')]=_[_0x9337('0x3c')](_0x195acb['query']);_0x32efcd['filters']=_[_0x9337('0x3d')](_0x32efcd[_0x9337('0x52')],_0x32efcd['query']);_0x9f57ab[_0x9337('0x3e')]=_[_0x9337('0x3d')](_0x32efcd['model'],qs[_0x9337('0x3f')](_0x195acb[_0x9337('0x3b')][_0x9337('0x3f')]));_0x9f57ab[_0x9337('0x3e')]=_0x9f57ab[_0x9337('0x3e')][_0x9337('0x40')]?_0x9f57ab[_0x9337('0x3e')]:_0x32efcd[_0x9337('0x52')];if(_0x195acb[_0x9337('0x3b')]['includeAll']){_0x9f57ab[_0x9337('0x4c')]=[{'all':!![]}];}_0x9f57ab=_[_0x9337('0x48')]({},_0x9f57ab,_0x195acb['options']);return db[_0x9337('0x37')][_0x9337('0x54')](_0x9f57ab)[_0x9337('0x1d')](handleEntityNotFound(_0x3f88db,null))[_0x9337('0x1d')](respondWithResult(_0x3f88db,null))[_0x9337('0x4f')](handleError(_0x3f88db,null));};exports['update']=function(_0x5da12a,_0x428f3d){if(_0x5da12a[_0x9337('0x55')]['id']){delete _0x5da12a['body']['id'];}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x5da12a[_0x9337('0x51')]['id']}})[_0x9337('0x1d')](handleEntityNotFound(_0x428f3d,null))[_0x9337('0x1d')](saveUpdates(_0x5da12a[_0x9337('0x55')],null))['then'](respondWithResult(_0x428f3d,null))['catch'](handleError(_0x428f3d,null));};exports[_0x9337('0x56')]=function(_0x334298,_0x51c04c,_0x3fb577){if(_0x334298[_0x9337('0x57')]&&_0x334298['file'][_0x9337('0x58')]){_0x334298[_0x9337('0x55')][_0x9337('0x59')]=_0x334298[_0x9337('0x57')][_0x9337('0x58')];}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x334298[_0x9337('0x51')]['id']}})[_0x9337('0x1d')](handleEntityNotFound(_0x51c04c,null))[_0x9337('0x1d')](saveUpdates(_0x334298[_0x9337('0x55')],null))['then'](respondWithResult(_0x51c04c,null))['catch'](handleError(_0x51c04c,null));};exports[_0x9337('0x5a')]=function(_0x58d2fe,_0xe99814,_0x35a799){if(_0x58d2fe['file']&&_0x58d2fe[_0x9337('0x57')][_0x9337('0x58')]){_0x58d2fe[_0x9337('0x55')]['loginLogo']=_0x58d2fe[_0x9337('0x57')][_0x9337('0x58')];}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x58d2fe[_0x9337('0x51')]['id']}})['then'](handleEntityNotFound(_0xe99814,null))[_0x9337('0x1d')](saveUpdates(_0x58d2fe[_0x9337('0x55')],null))['then'](respondWithResult(_0xe99814,null))[_0x9337('0x4f')](handleError(_0xe99814,null));};var utilLicense=require(_0x9337('0x18'));exports[_0x9337('0x5b')]=function(_0x30b8c1,_0x5755ec,_0x26bece){var _0x484bdd=_0x9337('0x5c');var _0x4c38c9={'custom':![]};return utilLicense[_0x9337('0x5d')]()['then'](function(_0x8451a0){if(_0x8451a0){_0x4c38c9=_0x8451a0;}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x30b8c1[_0x9337('0x51')]['id']},'attributes':[_0x9337('0x59'),_0x9337('0x5e'),_0x9337('0x5f'),'favicon',_0x9337('0x60'),_0x9337('0x61'),'defaultPreferred',_0x9337('0x62')],'raw':!![]});})[_0x9337('0x1d')](handleEntityNotFound(_0x5755ec,null))[_0x9337('0x1d')](function(_0x4e9941){if(_0x4e9941){var _0x30e73e=_0x4e9941[_0x9337('0x59')]&&fs[_0x9337('0x63')](path[_0x9337('0x64')](config['root'],_0x484bdd,_[_0x9337('0x65')](_0x4e9941[_0x9337('0x59')])))?path['join'](config[_0x9337('0x66')],_0x484bdd,_[_0x9337('0x65')](_0x4e9941[_0x9337('0x59')])):path[_0x9337('0x64')](config[_0x9337('0x66')],_0x484bdd,_['toLower']('default_logo.svg'));var _0x5333d4=_0x9337('0x67')+_['upperFirst']('logo');if(_0x4e9941[_0x5333d4]||!_0x4c38c9[_0x9337('0x68')]){_0x30e73e=path[_0x9337('0x64')](config[_0x9337('0x66')],_0x484bdd,_['toLower'](_0x9337('0x69')));}if(!fs[_0x9337('0x63')](_0x30e73e)){throw new db[(_0x9337('0x6a'))][(_0x9337('0x6b'))](_['upperFirst']('logo')+_0x9337('0x6c'));}return _0x5755ec[_0x9337('0x6d')](_0x30e73e);}})[_0x9337('0x4f')](handleError(_0x5755ec,null));};var utilLicense=require(_0x9337('0x18'));exports[_0x9337('0x6e')]=function(_0x44397a,_0x2a04b2,_0x3b813f){var _0x24d3f4=_0x9337('0x5c');var _0x3938ad={'custom':![]};return utilLicense[_0x9337('0x5d')]()[_0x9337('0x1d')](function(_0xe20475){if(_0xe20475){_0x3938ad=_0xe20475;}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x44397a['params']['id']},'attributes':['logo',_0x9337('0x5e'),_0x9337('0x5f'),'favicon',_0x9337('0x60'),_0x9337('0x61'),_0x9337('0x6f'),_0x9337('0x62')],'raw':!![]});})[_0x9337('0x1d')](handleEntityNotFound(_0x2a04b2,null))[_0x9337('0x1d')](function(_0x105918){if(_0x105918){var _0x458c37=_0x105918['loginLogo']&&fs[_0x9337('0x63')](path[_0x9337('0x64')](config[_0x9337('0x66')],_0x24d3f4,_['toLower'](_0x105918['loginLogo'])))?path[_0x9337('0x64')](config['root'],_0x24d3f4,_[_0x9337('0x65')](_0x105918[_0x9337('0x5e')])):path[_0x9337('0x64')](config[_0x9337('0x66')],_0x24d3f4,_[_0x9337('0x65')](_0x9337('0x70')));var _0xe505f8=_0x9337('0x67')+_['upperFirst'](_0x9337('0x5e'));if(_0x105918[_0xe505f8]||!_0x3938ad['custom']){_0x458c37=path[_0x9337('0x64')](config[_0x9337('0x66')],_0x24d3f4,_[_0x9337('0x65')](_0x9337('0x70')));}if(!fs[_0x9337('0x63')](_0x458c37)){throw new db[(_0x9337('0x6a'))][(_0x9337('0x6b'))](_[_0x9337('0x71')](_0x9337('0x5e'))+_0x9337('0x6c'));}return _0x2a04b2[_0x9337('0x6d')](_0x458c37);}})[_0x9337('0x4f')](handleError(_0x2a04b2,null));};exports[_0x9337('0x72')]=function(_0x962f19,_0x53f09d){return db[_0x9337('0x37')]['find']({'where':{'id':_0x962f19[_0x9337('0x51')]['id']},'attributes':['securePassword']})[_0x9337('0x1d')](respondWithResult(_0x53f09d,null))['catch'](handleError(_0x53f09d,null));};exports[_0x9337('0x73')]=function(_0x43b3e9,_0x52dbb4,_0x394ef5){if(_0x43b3e9['file']&&_0x43b3e9[_0x9337('0x57')][_0x9337('0x58')]){_0x43b3e9['body'][_0x9337('0x5f')]=_0x43b3e9[_0x9337('0x57')][_0x9337('0x58')];}return db[_0x9337('0x37')][_0x9337('0x54')]({'where':{'id':_0x43b3e9[_0x9337('0x51')]['id']}})[_0x9337('0x1d')](handleEntityNotFound(_0x52dbb4,null))[_0x9337('0x1d')](saveUpdates(_0x43b3e9[_0x9337('0x55')],null))[_0x9337('0x1d')](respondWithResult(_0x52dbb4,null))[_0x9337('0x4f')](handleError(_0x52dbb4,null));};var utilLicense=require(_0x9337('0x18'));exports[_0x9337('0x74')]=function(_0x391d08,_0x12842b,_0x48f2f8){var _0x5df280=_0x9337('0x5c');var _0x2d87db={'custom':![]};return utilLicense[_0x9337('0x5d')]()[_0x9337('0x1d')](function(_0x877659){if(_0x877659){_0x2d87db=_0x877659;}return db['Setting'][_0x9337('0x54')]({'where':{'id':_0x391d08[_0x9337('0x51')]['id']},'attributes':[_0x9337('0x59'),'loginLogo',_0x9337('0x5f'),_0x9337('0x75'),'defaultLogo',_0x9337('0x61'),_0x9337('0x6f'),_0x9337('0x62')],'raw':!![]});})[_0x9337('0x1d')](handleEntityNotFound(_0x12842b,null))[_0x9337('0x1d')](function(_0x5bc048){if(_0x5bc048){var _0x587809=_0x5bc048[_0x9337('0x5f')]&&fs[_0x9337('0x63')](path[_0x9337('0x64')](config[_0x9337('0x66')],_0x5df280,_['toLower'](_0x5bc048[_0x9337('0x5f')])))?path[_0x9337('0x64')](config[_0x9337('0x66')],_0x5df280,_[_0x9337('0x65')](_0x5bc048[_0x9337('0x5f')])):path[_0x9337('0x64')](config[_0x9337('0x66')],_0x5df280,_[_0x9337('0x65')](_0x9337('0x76')));var _0x44c2cb=_0x9337('0x67')+_[_0x9337('0x71')](_0x9337('0x5f'));if(_0x5bc048[_0x44c2cb]||!_0x2d87db['custom']||!_0x2d87db[_0x9337('0x5f')]){_0x587809=path[_0x9337('0x64')](config['root'],_0x5df280,_[_0x9337('0x65')](_0x9337('0x76')));}if(!fs['existsSync'](_0x587809)){throw new db[(_0x9337('0x6a'))][(_0x9337('0x6b'))](_[_0x9337('0x71')](_0x9337('0x5f'))+_0x9337('0x6c'));}return _0x12842b[_0x9337('0x6d')](_0x587809);}})['catch'](handleError(_0x12842b,null));};exports[_0x9337('0x77')]=function(_0xe03534,_0x46b992,_0x29b382){if(_0xe03534['file']&&_0xe03534[_0x9337('0x57')][_0x9337('0x58')]){_0xe03534['body']['favicon']=_0xe03534[_0x9337('0x57')][_0x9337('0x58')];}return db[_0x9337('0x37')]['find']({'where':{'id':_0xe03534['params']['id']}})['then'](handleEntityNotFound(_0x46b992,null))[_0x9337('0x1d')](saveUpdates(_0xe03534[_0x9337('0x55')],null))[_0x9337('0x1d')](respondWithResult(_0x46b992,null))[_0x9337('0x4f')](handleError(_0x46b992,null));};var utilLicense=require(_0x9337('0x18'));exports['getFavicon']=function(_0x31cc1a,_0x328014,_0x1a66fa){var _0x2493fb=_0x9337('0x5c');var _0x47f5b9={'custom':![]};return utilLicense[_0x9337('0x5d')]()[_0x9337('0x1d')](function(_0xc6155a){if(_0xc6155a){_0x47f5b9=_0xc6155a;}return db['Setting']['find']({'where':{'id':_0x31cc1a[_0x9337('0x51')]['id']},'attributes':['logo',_0x9337('0x5e'),_0x9337('0x5f'),_0x9337('0x75'),_0x9337('0x60'),_0x9337('0x61'),_0x9337('0x6f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x328014,null))[_0x9337('0x1d')](function(_0x22317b){if(_0x22317b){var _0x467848=_0x22317b[_0x9337('0x75')]&&fs[_0x9337('0x63')](path[_0x9337('0x64')](config['root'],_0x2493fb,_[_0x9337('0x65')](_0x22317b[_0x9337('0x75')])))?path[_0x9337('0x64')](config['root'],_0x2493fb,_[_0x9337('0x65')](_0x22317b[_0x9337('0x75')])):path[_0x9337('0x64')](config['root'],_0x2493fb,_[_0x9337('0x65')]('default_favicon.ico'));var _0x19058d=_0x9337('0x67')+_[_0x9337('0x71')](_0x9337('0x75'));if(_0x22317b[_0x19058d]||!_0x47f5b9[_0x9337('0x68')]){_0x467848=path['join'](config[_0x9337('0x66')],_0x2493fb,_[_0x9337('0x65')](_0x9337('0x78')));}if(!fs[_0x9337('0x63')](_0x467848)){throw new db['Sequelize'][(_0x9337('0x6b'))](_[_0x9337('0x71')](_0x9337('0x75'))+_0x9337('0x6c'));}return _0x328014[_0x9337('0x6d')](_0x467848);}})[_0x9337('0x4f')](handleError(_0x328014,null));};exports[_0x9337('0x79')]=function(_0x4af44d,_0x5d5c53){var _0x2d970f={'offset':moment()['utcOffset']()};_0x2d970f[_0x9337('0x7a')]=moment()[_0x9337('0x7b')](_0x2d970f['offset'])['format'](_0x9337('0x7c'));return _0x5d5c53['status'](0xc8)['send'](_0x2d970f);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e7fe35f..693750a 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(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_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':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x55ca,0x126));var _0xa55c=function(_0xea98ab,_0x297344){_0xea98ab=_0xea98ab-0x0;var _0x39058e=_0x55ca[_0xea98ab];return _0x39058e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index ece0beb..a12ae1e 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 _0x82af=['jayson/promise','client','http','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','options','where','include','map','model','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x82af,0x18b));var _0xf82a=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x82af[_0x34f701];return _0x3e2429;};'use strict';var _=require(_0xf82a('0x0'));var util=require(_0xf82a('0x1'));var moment=require(_0xf82a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf82a('0x3'));var db=require(_0xf82a('0x4'))['db'];var utils=require(_0xf82a('0x5'));var logger=require(_0xf82a('0x6'))('rpc');var config=require(_0xf82a('0x7'));var jayson=require(_0xf82a('0x8'));var client=jayson[_0xf82a('0x9')][_0xf82a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93baca,_0x41ce26,_0x161333){return new BPromise(function(_0x51c713,_0x1d8ac1){return client['request'](_0x93baca,_0x161333)[_0xf82a('0xb')](function(_0x307328){logger['info'](_0xf82a('0xc'),_0x41ce26,_0xf82a('0xd'));logger[_0xf82a('0xe')](_0xf82a('0xf'),_0x41ce26,_0xf82a('0xd'),JSON[_0xf82a('0x10')](_0x307328));if(_0x307328[_0xf82a('0x11')]){if(_0x307328[_0xf82a('0x11')][_0xf82a('0x12')]===0x1f4){logger[_0xf82a('0x11')](_0xf82a('0xc'),_0x41ce26,_0x307328[_0xf82a('0x11')][_0xf82a('0x13')]);return _0x1d8ac1(_0x307328['error'][_0xf82a('0x13')]);}logger[_0xf82a('0x11')](_0xf82a('0xc'),_0x41ce26,_0x307328['error']['message']);return _0x51c713(_0x307328[_0xf82a('0x11')][_0xf82a('0x13')]);}else{logger[_0xf82a('0x14')]('Setting,\x20%s,\x20%s',_0x41ce26,_0xf82a('0xd'));_0x51c713(_0x307328[_0xf82a('0x15')]['message']);}})[_0xf82a('0x16')](function(_0x46ac36){logger[_0xf82a('0x11')](_0xf82a('0xc'),_0x41ce26,_0x46ac36);_0x1d8ac1(_0x46ac36);});});}exports[_0xf82a('0x17')]=function(_0x5de58a){var _0x4a5b02=this;return new Promise(function(_0x51472a,_0x4782d7){return db[_0xf82a('0x18')]['find']({'raw':_0x5de58a[_0xf82a('0x19')]?_0x5de58a[_0xf82a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5de58a['options']?_0x5de58a[_0xf82a('0x19')][_0xf82a('0x1a')]||null:null,'attributes':_0x5de58a['options']?_0x5de58a['options']['attributes']||null:null,'include':_0x5de58a[_0xf82a('0x19')]?_0x5de58a[_0xf82a('0x19')][_0xf82a('0x1b')]?_[_0xf82a('0x1c')](_0x5de58a[_0xf82a('0x19')][_0xf82a('0x1b')],function(_0xac2ff1){return{'model':db[_0xac2ff1[_0xf82a('0x1d')]],'as':_0xac2ff1['as'],'attributes':_0xac2ff1[_0xf82a('0x1e')],'include':_0xac2ff1[_0xf82a('0x1b')]?_['map'](_0xac2ff1[_0xf82a('0x1b')],function(_0x232d6f){return{'model':db[_0x232d6f['model']],'as':_0x232d6f['as'],'attributes':_0x232d6f[_0xf82a('0x1e')],'include':_0x232d6f[_0xf82a('0x1b')]?_[_0xf82a('0x1c')](_0x232d6f[_0xf82a('0x1b')],function(_0x43d3b0){return{'model':db[_0x43d3b0[_0xf82a('0x1d')]],'as':_0x43d3b0['as'],'attributes':_0x43d3b0['attributes']};}):[]};}):[]};}):[]:[]})[_0xf82a('0xb')](function(_0x22cfe6){logger[_0xf82a('0x14')](_0xf82a('0x17'),_0x5de58a);logger['debug'](_0xf82a('0x17'),_0x5de58a,JSON['stringify'](_0x22cfe6));_0x51472a(_0x22cfe6);})[_0xf82a('0x16')](function(_0x380006){logger[_0xf82a('0x11')](_0xf82a('0x17'),_0x380006[_0xf82a('0x13')],_0x5de58a);_0x4782d7(_0x4a5b02['error'](0x1f4,_0x380006['message']));});});}; \ No newline at end of file +var _0xbe86=['model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','where','include','map','attributes'];(function(_0x290a7c,_0x1d5fd4){var _0x61bbae=function(_0x126257){while(--_0x126257){_0x290a7c['push'](_0x290a7c['shift']());}};_0x61bbae(++_0x1d5fd4);}(_0xbe86,0xe8));var _0x6be8=function(_0x1bb889,_0x49c4b5){_0x1bb889=_0x1bb889-0x0;var _0xd8b76d=_0xbe86[_0x1bb889];return _0xd8b76d;};'use strict';var _=require(_0x6be8('0x0'));var util=require(_0x6be8('0x1'));var moment=require(_0x6be8('0x2'));var BPromise=require(_0x6be8('0x3'));var rs=require(_0x6be8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6be8('0x5'))['db'];var utils=require(_0x6be8('0x6'));var logger=require('../../config/logger')(_0x6be8('0x7'));var config=require(_0x6be8('0x8'));var jayson=require(_0x6be8('0x9'));var client=jayson[_0x6be8('0xa')][_0x6be8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1968d4,_0x175fdc,_0x4f9b2d){return new BPromise(function(_0x42eadc,_0x3f9e9b){return client[_0x6be8('0xc')](_0x1968d4,_0x4f9b2d)[_0x6be8('0xd')](function(_0x594bbc){logger[_0x6be8('0xe')](_0x6be8('0xf'),_0x175fdc,'request\x20sent');logger[_0x6be8('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x175fdc,_0x6be8('0x11'),JSON[_0x6be8('0x12')](_0x594bbc));if(_0x594bbc[_0x6be8('0x13')]){if(_0x594bbc['error'][_0x6be8('0x14')]===0x1f4){logger['error'](_0x6be8('0xf'),_0x175fdc,_0x594bbc[_0x6be8('0x13')]['message']);return _0x3f9e9b(_0x594bbc[_0x6be8('0x13')][_0x6be8('0x15')]);}logger['error'](_0x6be8('0xf'),_0x175fdc,_0x594bbc[_0x6be8('0x13')][_0x6be8('0x15')]);return _0x42eadc(_0x594bbc['error'][_0x6be8('0x15')]);}else{logger[_0x6be8('0xe')](_0x6be8('0xf'),_0x175fdc,_0x6be8('0x11'));_0x42eadc(_0x594bbc[_0x6be8('0x16')][_0x6be8('0x15')]);}})[_0x6be8('0x17')](function(_0x294124){logger[_0x6be8('0x13')]('Setting,\x20%s,\x20%s',_0x175fdc,_0x294124);_0x3f9e9b(_0x294124);});});}exports[_0x6be8('0x18')]=function(_0x31112d){var _0x5d3a7d=this;return new Promise(function(_0x1f9d25,_0x8c0f26){return db['Setting'][_0x6be8('0x19')]({'raw':_0x31112d['options']?_0x31112d[_0x6be8('0x1a')][_0x6be8('0x1b')]===undefined?!![]:![]:!![],'where':_0x31112d[_0x6be8('0x1a')]?_0x31112d[_0x6be8('0x1a')][_0x6be8('0x1c')]||null:null,'attributes':_0x31112d['options']?_0x31112d[_0x6be8('0x1a')]['attributes']||null:null,'include':_0x31112d[_0x6be8('0x1a')]?_0x31112d[_0x6be8('0x1a')][_0x6be8('0x1d')]?_[_0x6be8('0x1e')](_0x31112d[_0x6be8('0x1a')][_0x6be8('0x1d')],function(_0x63685b){return{'model':db[_0x63685b['model']],'as':_0x63685b['as'],'attributes':_0x63685b[_0x6be8('0x1f')],'include':_0x63685b['include']?_['map'](_0x63685b[_0x6be8('0x1d')],function(_0x5bd090){return{'model':db[_0x5bd090[_0x6be8('0x20')]],'as':_0x5bd090['as'],'attributes':_0x5bd090[_0x6be8('0x1f')],'include':_0x5bd090['include']?_[_0x6be8('0x1e')](_0x5bd090[_0x6be8('0x1d')],function(_0x49e6da){return{'model':db[_0x49e6da[_0x6be8('0x20')]],'as':_0x49e6da['as'],'attributes':_0x49e6da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54ad01){logger[_0x6be8('0xe')]('ShowSetting',_0x31112d);logger[_0x6be8('0x10')](_0x6be8('0x18'),_0x31112d,JSON[_0x6be8('0x12')](_0x54ad01));_0x1f9d25(_0x54ad01);})[_0x6be8('0x17')](function(_0x374320){logger[_0x6be8('0x13')]('ShowSetting',_0x374320[_0x6be8('0x15')],_0x31112d);_0x8c0f26(_0x5d3a7d[_0x6be8('0x13')](0x1f4,_0x374320[_0x6be8('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 820c47d..9e06150 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0xc69b69,_0x435fd6){var _0x2ccc54=function(_0x27f918){while(--_0x27f918){_0xc69b69['push'](_0xc69b69['shift']());}};_0x2ccc54(++_0x435fd6);}(_0xabce,0x103));var _0xeabc=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xabce[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x212265,_0x390c7a){_0x212265=_0x212265-0x0;var _0x16a620=_0xf494[_0x212265];return _0x16a620;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 7192475..987b848 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 _0x46b7=['plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','ENUM','twilio','skebby','connectel','clicksend'];(function(_0x459a95,_0x3ea176){var _0x2eed44=function(_0x3529f3){while(--_0x3529f3){_0x459a95['push'](_0x459a95['shift']());}};_0x2eed44(++_0x3ea176);}(_0x46b7,0x1f2));var _0x746b=function(_0x3e5f8b,_0x433ff4){_0x3e5f8b=_0x3e5f8b-0x0;var _0x15cf79=_0x46b7[_0x3e5f8b];return _0x15cf79;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x746b('0x0'));module[_0x746b('0x1')]={'name':{'type':Sequelize[_0x746b('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x746b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x746b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x746b('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x746b('0x2')]},'type':{'type':Sequelize[_0x746b('0x3')](_0x746b('0x4'),_0x746b('0x5'),_0x746b('0x6'),_0x746b('0x7'),_0x746b('0x8'),_0x746b('0x9'),_0x746b('0xa'),_0x746b('0xb'),_0x746b('0xc'),_0x746b('0xd'))},'accountSid':{'type':Sequelize[_0x746b('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x746b('0x2')]},'smsMethod':{'type':Sequelize[_0x746b('0x3')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x746b('0x2')]},'apiKey':{'type':Sequelize[_0x746b('0x2')]},'applicationId':{'type':Sequelize[_0x746b('0x2')]},'accountId':{'type':Sequelize[_0x746b('0x2')]},'senderString':{'type':Sequelize[_0x746b('0x2')]},'deliveryReport':{'type':Sequelize[_0x746b('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x746b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x746b('0xf')],'defaultValue':function(){return _0x746b('0x10');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x746b('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x746b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x746b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x746b('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x746b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x746b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x746b('0x11')],'comment':_0x746b('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x746b('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1ad41d){if(!_0x1ad41d)this[_0x746b('0x13')](_0x746b('0x14'),null);this[_0x746b('0x13')](_0x746b('0x15'),_0x1ad41d);}}}; \ No newline at end of file +var _0x8afd=['BOOLEAN','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','randomstring','exports','name','STRING','skebby','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','ENUM'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8afd,0x93));var _0xd8af=function(_0x15ba22,_0x4f9042){_0x15ba22=_0x15ba22-0x0;var _0x276129=_0x8afd[_0x15ba22];return _0x276129;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd8af('0x0'));module[_0xd8af('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd8af('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd8af('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xd8af('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xd8af('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0xd8af('0x4'),_0xd8af('0x5'),_0xd8af('0x6'),_0xd8af('0x7'),'clickatell',_0xd8af('0x8'),_0xd8af('0x9'),_0xd8af('0xa'),_0xd8af('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xd8af('0x3')]},'authToken':{'type':Sequelize[_0xd8af('0x3')]},'smsMethod':{'type':Sequelize[_0xd8af('0xc')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd8af('0x3')]},'apiKey':{'type':Sequelize[_0xd8af('0x3')]},'applicationId':{'type':Sequelize[_0xd8af('0x3')]},'accountId':{'type':Sequelize[_0xd8af('0x3')]},'senderString':{'type':Sequelize[_0xd8af('0x3')]},'deliveryReport':{'type':Sequelize[_0xd8af('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd8af('0xe');}},'notificationSound':{'type':Sequelize[_0xd8af('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd8af('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd8af('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd8af('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd8af('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd8af('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8af('0xf')],'comment':_0xd8af('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xd8af('0xd')],'defaultValue':![],'comment':_0xd8af('0x11'),'set':function(_0xd192d6){if(!_0xd192d6)this[_0xd8af('0x12')]('mandatoryDispositionPauseId',null);this[_0xd8af('0x12')](_0xd8af('0x13'),_0xd192d6);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ecdee88..806949b 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 _0x56c9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','getDispositions','Disposition','nolimit','sort','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','Applications','account','applications','asc','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','connectel','clicksend','plivo','MessageUUID','infobip','results','text','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','ValidationError','from\x20is\x20mandatory','isNil','Sequelize','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','CmContact','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','addApplications','transaction','SmsApplication','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','spread','dataValues','Messages','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','message_id','status_code','DELIVERED','groupName','intelepeer','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','fast-json-patch','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','find','create','body','user'];(function(_0x18bd7c,_0x521c1e){var _0x5ad9ec=function(_0x14733b){while(--_0x14733b){_0x18bd7c['push'](_0x18bd7c['shift']());}};_0x5ad9ec(++_0x521c1e);}(_0x56c9,0x169));var _0x956c=function(_0x13de96,_0x4f063a){_0x13de96=_0x13de96-0x0;var _0x1c46e0=_0x56c9[_0x13de96];return _0x1c46e0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x956c('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x956c('0x1'));var Mustache=require(_0x956c('0x2'));var util=require(_0x956c('0x3'));var path=require('path');var sox=require(_0x956c('0x4'));var csv=require(_0x956c('0x5'));var ejs=require(_0x956c('0x6'));var fs=require('fs');var fs_extra=require(_0x956c('0x7'));var _=require(_0x956c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x956c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x956c('0x5'));var querystring=require(_0x956c('0xa'));var Papa=require(_0x956c('0xb'));var Redis=require('ioredis');var authService=require(_0x956c('0xc'));var qs=require(_0x956c('0xd'));var as=require(_0x956c('0xe'));var hardwareService=require(_0x956c('0xf'));var logger=require(_0x956c('0x10'))(_0x956c('0x11'));var utils=require(_0x956c('0x12'));var config=require(_0x956c('0x13'));var licenseUtil=require(_0x956c('0x14'));var db=require(_0x956c('0x15'))['db'];config[_0x956c('0x16')]=_[_0x956c('0x17')](config[_0x956c('0x16')],{'host':_0x956c('0x18'),'port':0x18eb});var socket=require(_0x956c('0x19'))(new Redis(config[_0x956c('0x16')]));require('./smsAccount.socket')[_0x956c('0x1a')](socket);var jayson=require(_0x956c('0x1b'));var client=jayson[_0x956c('0x1c')][_0x956c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xca5643,_0x41c327,_0x1523be,_0x2ebb10){return new BPromise(function(_0x1810f1,_0x59ed13){var _0x3977d8=_0x2ebb10||client;return _0x3977d8[_0x956c('0x1e')](_0xca5643,_0x1523be)[_0x956c('0x1f')](function(_0x5c8bc){logger[_0x956c('0x20')](_0x956c('0x21'),_0x41c327,'request\x20sent');logger[_0x956c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x41c327,_0x956c('0x23'),JSON['stringify'](_0x5c8bc));if(_0x5c8bc['error']){if(_0x5c8bc[_0x956c('0x24')][_0x956c('0x25')]===0x1f4){logger['error'](_0x956c('0x21'),_0x41c327,_0x5c8bc[_0x956c('0x24')]['message']);return _0x59ed13(_0x5c8bc[_0x956c('0x24')][_0x956c('0x26')]);}logger[_0x956c('0x24')](_0x956c('0x21'),_0x41c327,_0x5c8bc[_0x956c('0x24')][_0x956c('0x26')]);return _0x1810f1(_0x5c8bc[_0x956c('0x24')][_0x956c('0x26')]);}else{logger[_0x956c('0x20')](_0x956c('0x21'),_0x41c327,_0x956c('0x23'));_0x1810f1(_0x5c8bc[_0x956c('0x27')]['message']);}})[_0x956c('0x28')](function(_0xf02f7f){logger[_0x956c('0x24')]('SmsAccount,\x20%s,\x20%s',_0x41c327,_0xf02f7f);_0x59ed13(_0xf02f7f);});});}function respondWithStatusCode(_0x429b44,_0x21ff82){_0x21ff82=_0x21ff82||0xcc;return function(_0x40d23c){if(_0x40d23c){return _0x429b44[_0x956c('0x29')](_0x21ff82);}return _0x429b44['status'](_0x21ff82)['end']();};}function respondWithResult(_0x507bdc,_0xfb9f52){_0xfb9f52=_0xfb9f52||0xc8;return function(_0x396648){if(_0x396648){return _0x507bdc['status'](_0xfb9f52)[_0x956c('0x2a')](_0x396648);}};}function respondWithFilteredResult(_0x1d3744,_0x3bc073){return function(_0x30e26e){if(_0x30e26e){var _0x47d452=typeof _0x3bc073[_0x956c('0x2b')]===_0x956c('0x2c')&&typeof _0x3bc073[_0x956c('0x2d')]===_0x956c('0x2c');var _0x22fdf0=_0x30e26e['count'];var _0x252c24=_0x47d452?0x0:_0x3bc073[_0x956c('0x2b')];var _0x356ab9=_0x47d452?_0x30e26e[_0x956c('0x2e')]:_0x3bc073[_0x956c('0x2b')]+_0x3bc073[_0x956c('0x2d')];var _0xc371b4;if(_0x356ab9>=_0x22fdf0){_0x356ab9=_0x22fdf0;_0xc371b4=0xc8;}else{_0xc371b4=0xce;}_0x1d3744[_0x956c('0x2f')](_0xc371b4);return _0x1d3744[_0x956c('0x30')](_0x956c('0x31'),_0x252c24+'-'+_0x356ab9+'/'+_0x22fdf0)[_0x956c('0x2a')](_0x30e26e);}return null;};}function patchUpdates(_0x1bf97d){return function(_0x34fca2){try{jsonpatch[_0x956c('0x32')](_0x34fca2,_0x1bf97d,!![]);}catch(_0x5b6705){return BPromise[_0x956c('0x33')](_0x5b6705);}return _0x34fca2[_0x956c('0x34')]();};}function saveUpdates(_0xf9d206,_0x49a1c2){return function(_0x4b9fd1){if(_0x4b9fd1){return _0x4b9fd1[_0x956c('0x35')](_0xf9d206)[_0x956c('0x1f')](function(_0x49d7f7){return _0x49d7f7;});}return null;};}function removeEntity(_0x53da53,_0x4b1fa4){return function(_0x363df2){if(_0x363df2){return _0x363df2[_0x956c('0x36')]()['then'](function(){var _0xc39bc9=_0x363df2[_0x956c('0x37')]({'plain':!![]});var _0x6bc213='SmsAccounts';return db[_0x956c('0x38')]['destroy']({'where':{'type':_0x6bc213,'resourceId':_0xc39bc9['id']}})[_0x956c('0x1f')](function(){return _0x363df2;});})['then'](function(){_0x53da53[_0x956c('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29b6cb,_0x316d80){return function(_0x5c7155){if(!_0x5c7155){_0x29b6cb[_0x956c('0x29')](0x194);}return _0x5c7155;};}function handleError(_0x34cb3a,_0x597504){_0x597504=_0x597504||0x1f4;return function(_0x32bca7){logger[_0x956c('0x24')](_0x32bca7['stack']);if(_0x32bca7[_0x956c('0x39')]){delete _0x32bca7[_0x956c('0x39')];}_0x34cb3a['status'](_0x597504)[_0x956c('0x3a')](_0x32bca7);};}exports[_0x956c('0x3b')]=function(_0x136f95,_0x4fdaa7){var _0x1a3173={'include':[{'model':db[_0x956c('0x3c')],'as':_0x956c('0x3d')}]},_0x1eebd1={},_0x37769f={'count':0x0,'rows':[]};var _0x1a6e00=_['map'](db[_0x956c('0x3e')][_0x956c('0x3f')],function(_0x2a75d5){return{'name':_0x2a75d5[_0x956c('0x40')],'type':_0x2a75d5[_0x956c('0x41')][_0x956c('0x42')]};});_0x1eebd1['model']=_[_0x956c('0x43')](_0x1a6e00,_0x956c('0x39'));_0x1eebd1['query']=_[_0x956c('0x44')](_0x136f95['query']);_0x1eebd1[_0x956c('0x45')]=_[_0x956c('0x46')](_0x1eebd1[_0x956c('0x47')],_0x1eebd1['query']);_0x1a3173[_0x956c('0x48')]=_[_0x956c('0x46')](_0x1eebd1[_0x956c('0x47')],qs['fields'](_0x136f95[_0x956c('0x49')][_0x956c('0x4a')]));_0x1a3173['attributes']=_0x1a3173[_0x956c('0x48')][_0x956c('0x4b')]?_0x1a3173['attributes']:_0x1eebd1[_0x956c('0x47')];if(!_0x136f95[_0x956c('0x49')][_0x956c('0x4c')]('nolimit')){_0x1a3173[_0x956c('0x2d')]=qs['limit'](_0x136f95['query'][_0x956c('0x2d')]);_0x1a3173[_0x956c('0x2b')]=qs[_0x956c('0x2b')](_0x136f95[_0x956c('0x49')][_0x956c('0x2b')]);}_0x1a3173[_0x956c('0x4d')]=qs['sort'](_0x136f95[_0x956c('0x49')]['sort']);_0x1a3173[_0x956c('0x4e')]=qs[_0x956c('0x45')](_[_0x956c('0x4f')](_0x136f95[_0x956c('0x49')],_0x1eebd1[_0x956c('0x45')]),_0x1a6e00);if(_0x136f95[_0x956c('0x49')]['filter']){_0x1a3173[_0x956c('0x4e')]=_[_0x956c('0x50')](_0x1a3173['where'],{'$or':_[_0x956c('0x43')](_0x1a6e00,function(_0x3e3781){if(_0x3e3781['type']!==_0x956c('0x51')){var _0x3d88f3={};_0x3d88f3[_0x3e3781[_0x956c('0x39')]]={'$like':'%'+_0x136f95[_0x956c('0x49')][_0x956c('0x52')]+'%'};return _0x3d88f3;}})});}_0x1a3173=_[_0x956c('0x50')]({},_0x1a3173,_0x136f95[_0x956c('0x53')]);var _0x3d954d={'where':_0x1a3173[_0x956c('0x4e')]};return db['SmsAccount'][_0x956c('0x2e')](_0x3d954d)[_0x956c('0x1f')](function(_0x40355f){_0x37769f[_0x956c('0x2e')]=_0x40355f;if(_0x136f95[_0x956c('0x49')][_0x956c('0x54')]){_0x1a3173[_0x956c('0x55')]=[{'all':!![]}];}return db['SmsAccount'][_0x956c('0x56')](_0x1a3173);})[_0x956c('0x1f')](function(_0x5f8cfc){_0x37769f[_0x956c('0x57')]=_0x5f8cfc;return _0x37769f;})[_0x956c('0x1f')](respondWithFilteredResult(_0x4fdaa7,_0x1a3173))[_0x956c('0x28')](handleError(_0x4fdaa7,null));};exports[_0x956c('0x58')]=function(_0x240730,_0x3680e3){var _0x402673={'raw':![],'where':{'id':_0x240730['params']['id']},'include':[{'model':db[_0x956c('0x3c')],'as':_0x956c('0x3d')}]},_0x72c92c={};_0x72c92c[_0x956c('0x47')]=_[_0x956c('0x44')](db[_0x956c('0x3e')][_0x956c('0x3f')]);_0x72c92c[_0x956c('0x49')]=_[_0x956c('0x44')](_0x240730[_0x956c('0x49')]);_0x72c92c[_0x956c('0x45')]=_['intersection'](_0x72c92c[_0x956c('0x47')],_0x72c92c['query']);_0x402673[_0x956c('0x48')]=_[_0x956c('0x46')](_0x72c92c['model'],qs[_0x956c('0x4a')](_0x240730[_0x956c('0x49')][_0x956c('0x4a')]));_0x402673[_0x956c('0x48')]=_0x402673[_0x956c('0x48')][_0x956c('0x4b')]?_0x402673[_0x956c('0x48')]:_0x72c92c[_0x956c('0x47')];if(_0x240730['query'][_0x956c('0x54')]){_0x402673['include']=[{'all':!![]}];}_0x402673=_[_0x956c('0x50')]({},_0x402673,_0x240730[_0x956c('0x53')]);return db[_0x956c('0x3e')][_0x956c('0x59')](_0x402673)[_0x956c('0x1f')](handleEntityNotFound(_0x3680e3,null))[_0x956c('0x1f')](respondWithResult(_0x3680e3,null))[_0x956c('0x28')](handleError(_0x3680e3,null));};exports[_0x956c('0x5a')]=function(_0x527310,_0x3e6024){return db[_0x956c('0x3e')][_0x956c('0x5a')](_0x527310[_0x956c('0x5b')],{})['then'](function(_0x5904a6){var _0xe4fdf1=_0x527310[_0x956c('0x5c')][_0x956c('0x37')]({'plain':!![]});if(!_0xe4fdf1)throw new Error(_0x956c('0x5d'));if(_0xe4fdf1[_0x956c('0x5e')]===_0x956c('0x5c')){var _0x538715=_0x5904a6[_0x956c('0x37')]({'plain':!![]});var _0x4cd826=_0x956c('0x5f');return db['UserProfileSection'][_0x956c('0x59')]({'where':{'name':_0x4cd826,'userProfileId':_0xe4fdf1[_0x956c('0x60')]},'raw':!![]})[_0x956c('0x1f')](function(_0x3b28ad){if(_0x3b28ad&&_0x3b28ad[_0x956c('0x61')]===0x0){return db[_0x956c('0x38')][_0x956c('0x5a')]({'name':_0x538715[_0x956c('0x39')],'resourceId':_0x538715['id'],'type':_0x3b28ad[_0x956c('0x39')],'sectionId':_0x3b28ad['id']},{})[_0x956c('0x1f')](function(){return _0x5904a6;});}else{return _0x5904a6;}})[_0x956c('0x28')](function(_0x10ed7a){logger[_0x956c('0x24')](_0x956c('0x62'),_0x10ed7a);throw _0x10ed7a;});}return _0x5904a6;})[_0x956c('0x1f')](respondWithResult(_0x3e6024,0xc9))[_0x956c('0x28')](handleError(_0x3e6024,null));};exports[_0x956c('0x35')]=function(_0x368360,_0x3d0c2e){if(_0x368360['body']['id']){delete _0x368360[_0x956c('0x5b')]['id'];}return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x368360[_0x956c('0x63')]['id']},'include':[{'model':db[_0x956c('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x956c('0x1f')](handleEntityNotFound(_0x3d0c2e,null))[_0x956c('0x1f')](saveUpdates(_0x368360[_0x956c('0x5b')],null))[_0x956c('0x1f')](respondWithResult(_0x3d0c2e,null))['catch'](handleError(_0x3d0c2e,null));};exports['destroy']=function(_0x1f2e3c,_0x5dc488){return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x1f2e3c['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x5dc488,null))[_0x956c('0x1f')](removeEntity(_0x5dc488,null))['catch'](handleError(_0x5dc488,null));};exports[_0x956c('0x64')]=function(_0x4babaa,_0x2f8edb){return db[_0x956c('0x3e')][_0x956c('0x64')]()[_0x956c('0x1f')](respondWithResult(_0x2f8edb,null))['catch'](handleError(_0x2f8edb,null));};exports['addDisposition']=function(_0x2dc916,_0x43aa29,_0x24b1a2){if(_0x2dc916[_0x956c('0x5b')]['id']){delete _0x2dc916[_0x956c('0x5b')]['id'];}return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x2dc916[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x43aa29,null))['then'](function(_0x2b51ea){if(_0x2b51ea){_0x2dc916['body'][_0x956c('0x65')]=_0x2b51ea['id'];return db['Disposition'][_0x956c('0x5a')](_0x2dc916['body']);}})['then'](respondWithResult(_0x43aa29,null))[_0x956c('0x28')](handleError(_0x43aa29,null));};exports[_0x956c('0x66')]=function(_0x1aab46,_0x53aef8,_0x2fc820){var _0x125eb8={'raw':![],'where':{}};var _0x2449db={};var _0x324076={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x1aab46['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x53aef8,null))[_0x956c('0x1f')](function(_0x34bcf2){if(_0x34bcf2){_0x2449db[_0x956c('0x47')]=_[_0x956c('0x44')](db[_0x956c('0x67')][_0x956c('0x3f')]);_0x2449db[_0x956c('0x49')]=_['keys'](_0x1aab46['query']);_0x2449db['filters']=_[_0x956c('0x46')](_0x2449db[_0x956c('0x47')],_0x2449db[_0x956c('0x49')]);_0x125eb8[_0x956c('0x48')]=_['intersection'](_0x2449db['model'],qs[_0x956c('0x4a')](_0x1aab46[_0x956c('0x49')][_0x956c('0x4a')]));_0x125eb8[_0x956c('0x48')]=_0x125eb8[_0x956c('0x48')]['length']?_0x125eb8[_0x956c('0x48')]:_0x2449db['model'];if(!_0x1aab46[_0x956c('0x49')][_0x956c('0x4c')](_0x956c('0x68'))){_0x125eb8[_0x956c('0x2d')]=qs[_0x956c('0x2d')](_0x1aab46['query']['limit']);_0x125eb8[_0x956c('0x2b')]=qs['offset'](_0x1aab46['query'][_0x956c('0x2b')]);}_0x125eb8[_0x956c('0x4d')]=qs[_0x956c('0x69')](_0x1aab46[_0x956c('0x49')][_0x956c('0x69')]);_0x125eb8[_0x956c('0x4e')]=qs[_0x956c('0x45')](_['pick'](_0x1aab46[_0x956c('0x49')],_0x2449db['filters']));_0x125eb8[_0x956c('0x4e')][_0x956c('0x65')]=_0x34bcf2['id'];if(_0x1aab46[_0x956c('0x49')][_0x956c('0x52')]){_0x125eb8[_0x956c('0x4e')]=_[_0x956c('0x50')](_0x125eb8['where'],{'$or':_[_0x956c('0x43')](_0x125eb8['attributes'],function(_0x3cf155){var _0x2f87e5={};_0x2f87e5[_0x3cf155]={'$like':'%'+_0x1aab46[_0x956c('0x49')][_0x956c('0x52')]+'%'};return _0x2f87e5;})});}_0x125eb8=_['merge']({},_0x125eb8,_0x1aab46['options']);return db[_0x956c('0x67')][_0x956c('0x2e')]({'where':_0x125eb8['where']})[_0x956c('0x1f')](function(_0x3e044c){_0x324076['count']=_0x3e044c;if(_0x1aab46[_0x956c('0x49')][_0x956c('0x54')]){_0x125eb8[_0x956c('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x956c('0x56')](_0x125eb8);})[_0x956c('0x1f')](function(_0x2340be){_0x324076[_0x956c('0x57')]=_0x2340be;return _0x324076;});}})[_0x956c('0x1f')](respondWithFilteredResult(_0x53aef8,_0x125eb8))[_0x956c('0x28')](handleError(_0x53aef8,null));};exports[_0x956c('0x6a')]=function(_0x4cabe3,_0x5b8a2c,_0x3f2edc){return db['SmsAccount'][_0x956c('0x59')]({'where':{'id':_0x4cabe3[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x5b8a2c,null))[_0x956c('0x1f')](function(_0x1ddf83){if(_0x1ddf83){return _0x1ddf83[_0x956c('0x6a')](_0x4cabe3['query'][_0x956c('0x6b')]);}})[_0x956c('0x1f')](respondWithStatusCode(_0x5b8a2c,null))[_0x956c('0x28')](handleError(_0x5b8a2c,null));};exports[_0x956c('0x6c')]=function(_0x5c2cfb,_0x595ecf,_0x328c73){if(_0x5c2cfb[_0x956c('0x5b')]['id']){delete _0x5c2cfb[_0x956c('0x5b')]['id'];}return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x5c2cfb[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x595ecf,null))['then'](function(_0x730671){if(_0x730671){_0x5c2cfb[_0x956c('0x5b')][_0x956c('0x65')]=_0x730671['id'];return db[_0x956c('0x6d')]['create'](_0x5c2cfb[_0x956c('0x5b')]);}})[_0x956c('0x1f')](respondWithResult(_0x595ecf,null))[_0x956c('0x28')](handleError(_0x595ecf,null));};exports['getAnswers']=function(_0x57c44d,_0x2f43ba,_0x3194c5){var _0x3123b2={'raw':![],'where':{}};var _0x3a7dc1={};var _0x4ea98e={'count':0x0,'rows':[]};return db['SmsAccount'][_0x956c('0x6e')]({'where':{'id':_0x57c44d[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x2f43ba,null))['then'](function(_0x2b78c4){if(_0x2b78c4){_0x3a7dc1[_0x956c('0x47')]=_['keys'](db['CannedAnswer'][_0x956c('0x3f')]);_0x3a7dc1['query']=_[_0x956c('0x44')](_0x57c44d[_0x956c('0x49')]);_0x3a7dc1['filters']=_[_0x956c('0x46')](_0x3a7dc1[_0x956c('0x47')],_0x3a7dc1[_0x956c('0x49')]);_0x3123b2[_0x956c('0x48')]=_[_0x956c('0x46')](_0x3a7dc1[_0x956c('0x47')],qs['fields'](_0x57c44d[_0x956c('0x49')][_0x956c('0x4a')]));_0x3123b2[_0x956c('0x48')]=_0x3123b2[_0x956c('0x48')][_0x956c('0x4b')]?_0x3123b2[_0x956c('0x48')]:_0x3a7dc1[_0x956c('0x47')];if(!_0x57c44d['query']['hasOwnProperty'](_0x956c('0x68'))){_0x3123b2[_0x956c('0x2d')]=qs[_0x956c('0x2d')](_0x57c44d[_0x956c('0x49')][_0x956c('0x2d')]);_0x3123b2['offset']=qs[_0x956c('0x2b')](_0x57c44d[_0x956c('0x49')][_0x956c('0x2b')]);}_0x3123b2['order']=qs[_0x956c('0x69')](_0x57c44d['query'][_0x956c('0x69')]);_0x3123b2[_0x956c('0x4e')]=qs['filters'](_[_0x956c('0x4f')](_0x57c44d[_0x956c('0x49')],_0x3a7dc1[_0x956c('0x45')]));_0x3123b2[_0x956c('0x4e')][_0x956c('0x65')]=_0x2b78c4['id'];if(_0x57c44d[_0x956c('0x49')][_0x956c('0x52')]){_0x3123b2['where']=_[_0x956c('0x50')](_0x3123b2[_0x956c('0x4e')],{'$or':_[_0x956c('0x43')](_0x3123b2[_0x956c('0x48')],function(_0x1582f7){var _0x1a4dd0={};_0x1a4dd0[_0x1582f7]={'$like':'%'+_0x57c44d['query'][_0x956c('0x52')]+'%'};return _0x1a4dd0;})});}_0x3123b2=_[_0x956c('0x50')]({},_0x3123b2,_0x57c44d[_0x956c('0x53')]);return db[_0x956c('0x6d')][_0x956c('0x2e')]({'where':_0x3123b2['where']})[_0x956c('0x1f')](function(_0x144097){_0x4ea98e['count']=_0x144097;if(_0x57c44d['query'][_0x956c('0x54')]){_0x3123b2[_0x956c('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3123b2);})[_0x956c('0x1f')](function(_0x3382f6){_0x4ea98e[_0x956c('0x57')]=_0x3382f6;return _0x4ea98e;});}})['then'](respondWithFilteredResult(_0x2f43ba,_0x3123b2))['catch'](handleError(_0x2f43ba,null));};exports[_0x956c('0x6f')]=function(_0x485e1f,_0x475ac4,_0x30f3b4){return db[_0x956c('0x3e')]['find']({'where':{'id':_0x485e1f['params']['id']}})['then'](handleEntityNotFound(_0x475ac4,null))[_0x956c('0x1f')](function(_0x5388e8){if(_0x5388e8){return _0x5388e8[_0x956c('0x6f')](_0x485e1f['query'][_0x956c('0x6b')]);}})[_0x956c('0x1f')](respondWithStatusCode(_0x475ac4,null))[_0x956c('0x28')](handleError(_0x475ac4,null));};exports[_0x956c('0x70')]=function(_0x57dba6,_0x56f4ef,_0x40f93c){var _0xa5128f={'channel':'sms'};var _0x41d34f=[];var _0x2c7fb5=[];var _0x571c0e={};return db['SmsAccount'][_0x956c('0x59')]({'where':{'id':_0x57dba6[_0x956c('0x63')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x956c('0x71')}]})[_0x956c('0x1f')](handleEntityNotFound(_0x56f4ef,null))[_0x956c('0x1f')](function(_0x29fc7a){_0xa5128f[_0x956c('0x72')]=_0x29fc7a;_0xa5128f[_0x956c('0x73')]=_['orderBy'](_0x29fc7a[_0x956c('0x71')],['priority'],[_0x956c('0x74')]);if(_0xa5128f[_0x956c('0x72')][_0x956c('0x71')]){delete _0xa5128f['account'][_0x956c('0x71')];}return db['CmContact']['describe']();})[_0x956c('0x1f')](function(_0x30ee3e){if(!_0x30ee3e){throw new db['Sequelize']['ValidationError'](_0x956c('0x75'));}_0x41d34f=_[_0x956c('0x76')](_[_0x956c('0x44')](_0x30ee3e),[_0x956c('0x77'),'updatedAt']);_0x2c7fb5=_[_0x956c('0x76')](_[_0x956c('0x44')](_0x30ee3e),[_0x956c('0x77'),_0x956c('0x78'),_0x956c('0x79'),'ListId']);_0xa5128f[_0x956c('0x5b')]={'mapKey':_0x956c('0x7a')};if(_0xa5128f[_0x956c('0x72')]['type']){switch(_0xa5128f[_0x956c('0x72')]['type']){case _0x956c('0x7b'):_0xa5128f['body'][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x7d')];_0xa5128f[_0x956c('0x5b')]['body']=_0x57dba6[_0x956c('0x5b')][_0x956c('0x7e')];_0xa5128f['body'][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x80')];break;case _0x956c('0x81'):_0xa5128f['body'][_0x956c('0x7c')]='+'+_0x57dba6[_0x956c('0x5b')][_0x956c('0x82')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')]=_0x57dba6['body']['text'];break;case _0x956c('0x83'):_0xa5128f[_0x956c('0x5b')]['from']=_0x57dba6[_0x956c('0x5b')][_0x956c('0x7c')];_0xa5128f[_0x956c('0x5b')]['body']=_0x57dba6[_0x956c('0x5b')][_0x956c('0x26')];break;case _0x956c('0x84'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x7c')];_0xa5128f['body']['body']=_0x57dba6[_0x956c('0x5b')][_0x956c('0x5b')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')]['message_id'];break;case _0x956c('0x85'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6['body']['From'];_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')]=_0x57dba6[_0x956c('0x5b')]['Text'];_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x86')];break;case _0x956c('0x87'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]='+'+_0x57dba6['body'][_0x956c('0x88')][0x0][_0x956c('0x7c')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')]=_0x57dba6[_0x956c('0x5b')]['results'][0x0][_0x956c('0x89')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x88')][0x0][_0x956c('0x7f')];break;case _0x956c('0x8a'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x8b')];_0xa5128f['body'][_0x956c('0x5b')]=_0x57dba6[_0x956c('0x5b')]['segmentedMessage'][_0x956c('0x26')];break;case _0x956c('0x8c'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x8d')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')]=_0x57dba6['body'][_0x956c('0x89')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x8e')];break;case _0x956c('0x8f'):_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')]=_0x57dba6[_0x956c('0x5b')][0x0][_0x956c('0x26')]['id'];_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][0x0][_0x956c('0x26')][_0x956c('0x7c')];_0xa5128f[_0x956c('0x5b')]['body']=_0x57dba6[_0x956c('0x5b')][0x0][_0x956c('0x26')][_0x956c('0x89')];break;case'intelepeer':_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')]=_0x57dba6[_0x956c('0x5b')][_0x956c('0x7c')];_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')]=_0x57dba6['body'][_0x956c('0x26')];_0xa5128f[_0x956c('0x5b')]['messageId']=_0x57dba6[_0x956c('0x5b')]['refid'];break;}}if(_0xa5128f[_0x956c('0x5b')]['id']){delete _0xa5128f[_0x956c('0x5b')]['id'];}if(_['isNil'](_0xa5128f['body'][_0x956c('0x7c')])){throw new db['Sequelize'][(_0x956c('0x90'))](_0x956c('0x91'));}if(_[_0x956c('0x92')](_0xa5128f[_0x956c('0x5b')]['body'])||_0xa5128f[_0x956c('0x5b')]['body']===''){throw new db[(_0x956c('0x93'))][(_0x956c('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x956c('0x92')](_0xa5128f['body'][_0x956c('0x94')])){throw new db[(_0x956c('0x93'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c7fb5);}if(!_[_0x956c('0x95')](_0x2c7fb5,_0xa5128f[_0x956c('0x5b')][_0x956c('0x94')])){throw new db[(_0x956c('0x93'))][(_0x956c('0x90'))](_0x956c('0x96')+_0x2c7fb5);}_0x571c0e[_0xa5128f[_0x956c('0x5b')][_0x956c('0x94')]]=_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')];return db[_0x956c('0x97')][_0x956c('0x59')]({'where':{'id':_0xa5128f[_0x956c('0x72')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x956c('0x98'),'where':_0x571c0e,'limit':0x1,'order':[[_0x956c('0x78'),_0x956c('0x99')]]}]});})['then'](handleEntityNotFound(_0x56f4ef,null))['then'](function(_0x3cdf94){if(_0x3cdf94){_0xa5128f[_0x956c('0x9a')]=_['omit'](_0x3cdf94,[_0x956c('0x98')]);if(_0x3cdf94['Contacts'][_0x956c('0x4b')]){return _0x3cdf94[_0x956c('0x98')][0x0];}var _0x408163=_[_0x956c('0x17')](_0xa5128f[_0x956c('0x5b')],{'firstName':_0xa5128f[_0x956c('0x5b')]['from'],'ListId':_0x3cdf94['id']});_0x408163[_0xa5128f[_0x956c('0x5b')][_0x956c('0x94')]]=_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')];return db[_0x956c('0x9b')][_0x956c('0x5a')](_0x408163,{'fields':_0x41d34f,'raw':!![]});}})['then'](handleEntityNotFound(_0x56f4ef,null))['then'](function(_0x48fb26){if(_0x48fb26){_0xa5128f[_0x956c('0x9c')]=_0x48fb26;var _0x312496={'ContactId':_0x48fb26['id'],'phone':_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')],'SmsAccountId':_0x57dba6['params']['id']};var _0x12f96c={'ContactId':_0x48fb26['id'],'SmsAccountId':_0x57dba6[_0x956c('0x63')]['id'],'closed':![]};return db[_0x956c('0x9d')][_0x956c('0x59')]({'where':_0x12f96c})[_0x956c('0x1f')](function(_0x3f5152){if(_0x3f5152){return[_0x3f5152,![]];}return db[_0x956c('0x9d')]['create'](_0x312496)[_0x956c('0x1f')](function(_0x59b56a){return[_0x59b56a,!![]];});});}})['spread'](function(_0x11f705,_0x80d2d1){_0xa5128f[_0x956c('0x9e')]=_0x11f705[_0x956c('0x37')]({'plain':!![]});_0xa5128f[_0x956c('0x9e')][_0x956c('0x9f')]=![];if(_0x80d2d1){if(_0xa5128f[_0x956c('0x72')][_0x956c('0xa0')]){_0xa5128f['applications'][_0x956c('0xa1')]({'id':0x0,'priority':_0xa5128f[_0x956c('0x73')][_0x956c('0x4b')]+0x1,'app':_0x956c('0xa2'),'appdata':_0x956c('0xa3'),'interval':_0x956c('0xa4')});}_0xa5128f[_0x956c('0x9e')][_0x956c('0x9f')]=!![];}return db[_0x956c('0xa5')][_0x956c('0x5a')]({'phone':_0xa5128f[_0x956c('0x5b')][_0x956c('0x7c')],'messageId':_0xa5128f[_0x956c('0x5b')][_0x956c('0x7f')],'body':_0xa5128f[_0x956c('0x5b')][_0x956c('0x5b')],'SmsAccountId':_0x57dba6[_0x956c('0x63')]['id'],'SmsInteractionId':_0x11f705['id'],'direction':'in','ContactId':_0x11f705[_0x956c('0xa6')],'AttachmentId':_0xa5128f['body']['AttachmentId']});})[_0x956c('0x1f')](function(_0xac6c06){_0xa5128f[_0x956c('0x26')]=_0xac6c06;if(_0xa5128f[_0x956c('0x9e')][_0x956c('0xa7')]){return db[_0x956c('0xa8')][_0x956c('0x59')]({'attributes':['id',_0x956c('0x39')],'where':{'id':_0xa5128f[_0x956c('0x9e')][_0x956c('0xa7')]}})[_0x956c('0x1f')](function(_0x508b2e){if(_0x508b2e){_0xa5128f['applications'][_0x956c('0xa9')]({'id':0x0,'priority':0x0,'app':_0x956c('0xaa'),'appdata':_0x508b2e[_0x956c('0x39')]+','+(_0xa5128f[_0x956c('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x956c('0xa4')});}return respondWithRpcPromise(_0x956c('0xab'),'startRouting',_0xa5128f);});}return respondWithRpcPromise(_0x956c('0xab'),_0x956c('0xac'),_0xa5128f);})[_0x956c('0x1f')](function(_0x12e11b){if(_0x12e11b){var _0x1210cf=0xc8;var _0xc7a28a=_0x956c('0xad');logger['info'](_0x956c('0xae'),_0xc7a28a,_0x1210cf,_0x956c('0xaf'));logger[_0x956c('0x22')](_0x956c('0xb0'),_0xc7a28a,_0x1210cf,_0x956c('0xaf'),JSON[_0x956c('0xb1')](_0x12e11b));if(_0xa5128f[_0x956c('0x72')][_0x956c('0x41')]===_0x956c('0x7b')){return _0x56f4ef[_0x956c('0x2f')](_0x1210cf)[_0x956c('0x30')](_0x956c('0xb2'),_0x956c('0xb3'))[_0x956c('0x3a')](_0x956c('0xb4'));}else{return _0x56f4ef[_0x956c('0x2f')](_0x1210cf)[_0x956c('0x2a')](_0x12e11b);}}})[_0x956c('0x28')](handleError(_0x56f4ef,null));};exports[_0x956c('0xb5')]=function(_0x12c19b,_0x50043a,_0x209072){return db[_0x956c('0x3e')][_0x956c('0x6e')]({'where':{'id':_0x12c19b[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x50043a,null))[_0x956c('0x1f')](function(_0x28d80a){if(_0x28d80a){return db['sequelize'][_0x956c('0xb6')](function(_0x575b9e){return db['SmsApplication'][_0x956c('0x36')]({'where':{'SmsAccountId':_0x12c19b[_0x956c('0x63')]['id']},'transaction':_0x575b9e})[_0x956c('0x1f')](function(_0x3c5ab5){var _0x5d0cc8=_[_0x956c('0x43')](_0x12c19b[_0x956c('0x5b')],function(_0x6415e8){_0x6415e8[_0x956c('0x65')]=_0x12c19b[_0x956c('0x63')]['id'];return _0x6415e8;});return db[_0x956c('0xb7')]['bulkCreate'](_0x5d0cc8,{'transaction':_0x575b9e});});})[_0x956c('0x1f')](function(){return db[_0x956c('0xb7')][_0x956c('0xb8')]({'where':{'SmsAccountId':_0x12c19b['params']['id']},'order':_0x956c('0xb9')});});}})['then'](respondWithResult(_0x50043a,null))[_0x956c('0x28')](handleError(_0x50043a,null));};exports['getApplications']=function(_0x1b339a,_0x18720e,_0x12a738){var _0x155228={};var _0x4e189c={};var _0x462817;var _0x2ab614;return db['SmsAccount'][_0x956c('0x6e')]({'where':{'id':_0x1b339a['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x18720e,null))[_0x956c('0x1f')](function(_0x20dbdd){if(_0x20dbdd){_0x462817=_0x20dbdd;_0x4e189c['model']=_[_0x956c('0x44')](db[_0x956c('0xb7')][_0x956c('0x3f')]);_0x4e189c['query']=_[_0x956c('0x44')](_0x1b339a[_0x956c('0x49')]);_0x4e189c[_0x956c('0x45')]=_[_0x956c('0x46')](_0x4e189c[_0x956c('0x47')],_0x4e189c[_0x956c('0x49')]);_0x155228[_0x956c('0x48')]=_['intersection'](_0x4e189c['model'],qs['fields'](_0x1b339a[_0x956c('0x49')][_0x956c('0x4a')]));_0x155228[_0x956c('0x48')]=_0x155228['attributes'][_0x956c('0x4b')]?_0x155228[_0x956c('0x48')]:_0x4e189c[_0x956c('0x47')];_0x155228[_0x956c('0x4d')]=qs[_0x956c('0x69')](_0x1b339a[_0x956c('0x49')][_0x956c('0x69')]);_0x155228[_0x956c('0x4e')]=qs['filters'](_[_0x956c('0x4f')](_0x1b339a['query'],_0x4e189c['filters']));if(_0x1b339a[_0x956c('0x49')]['filter']){_0x155228[_0x956c('0x4e')]=_[_0x956c('0x50')](_0x155228[_0x956c('0x4e')],{'$or':_['map'](_0x155228[_0x956c('0x48')],function(_0x107d95){var _0x1c7b2c={};_0x1c7b2c[_0x107d95]={'$like':'%'+_0x1b339a[_0x956c('0x49')][_0x956c('0x52')]+'%'};return _0x1c7b2c;})});}_0x155228=_[_0x956c('0x50')]({},_0x155228,_0x1b339a[_0x956c('0x53')]);return _0x462817['getApplications'](_0x155228);}})['then'](function(_0xe1abd5){if(_0xe1abd5){_0x2ab614=_0xe1abd5['length'];if(!_0x1b339a[_0x956c('0x49')][_0x956c('0x4c')](_0x956c('0x68'))){_0x155228['limit']=qs[_0x956c('0x2d')](_0x1b339a[_0x956c('0x49')][_0x956c('0x2d')]);_0x155228[_0x956c('0x2b')]=qs[_0x956c('0x2b')](_0x1b339a[_0x956c('0x49')][_0x956c('0x2b')]);}return _0x462817[_0x956c('0xba')](_0x155228);}})[_0x956c('0x1f')](function(_0x457c9c){if(_0x457c9c){return _0x457c9c?{'count':_0x2ab614,'rows':_0x457c9c}:null;}})[_0x956c('0x1f')](respondWithResult(_0x18720e,null))[_0x956c('0x28')](handleError(_0x18720e,null));};exports[_0x956c('0xbb')]=function(_0x27259f,_0x546ade,_0x16bfda){var _0x1c08b4={'raw':![],'where':{}};var _0x3e918d={};var _0x5ed650={'count':0x0,'rows':[]};return db[_0x956c('0x3e')][_0x956c('0x6e')]({'where':{'id':_0x27259f['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x546ade,null))[_0x956c('0x1f')](function(_0x2ce056){if(_0x2ce056){_0x3e918d[_0x956c('0x47')]=_[_0x956c('0x44')](db[_0x956c('0x9d')]['rawAttributes']);_0x3e918d['query']=_[_0x956c('0x44')](_0x27259f[_0x956c('0x49')]);_0x3e918d[_0x956c('0x45')]=_['intersection'](_0x3e918d['model'],_0x3e918d[_0x956c('0x49')]);_0x1c08b4[_0x956c('0x48')]=_['intersection'](_0x3e918d[_0x956c('0x47')],qs['fields'](_0x27259f[_0x956c('0x49')][_0x956c('0x4a')]));_0x1c08b4[_0x956c('0x48')]=_0x1c08b4[_0x956c('0x48')][_0x956c('0x4b')]?_0x1c08b4['attributes']:_0x3e918d[_0x956c('0x47')];if(!_0x27259f[_0x956c('0x49')]['hasOwnProperty'](_0x956c('0x68'))){_0x1c08b4['limit']=qs[_0x956c('0x2d')](_0x27259f[_0x956c('0x49')]['limit']);_0x1c08b4[_0x956c('0x2b')]=qs[_0x956c('0x2b')](_0x27259f[_0x956c('0x49')]['offset']);}_0x1c08b4[_0x956c('0x4d')]=qs['sort'](_0x27259f[_0x956c('0x49')]['sort']);_0x1c08b4[_0x956c('0x4e')]=qs['filters'](_['pick'](_0x27259f[_0x956c('0x49')],_0x3e918d[_0x956c('0x45')]));_0x1c08b4[_0x956c('0x4e')]['SmsAccountId']=_0x2ce056['id'];if(_0x27259f['query'][_0x956c('0x52')]){_0x1c08b4[_0x956c('0x4e')]=_[_0x956c('0x50')](_0x1c08b4[_0x956c('0x4e')],{'$or':_[_0x956c('0x43')](_0x1c08b4['attributes'],function(_0x3e7b6c){var _0x4bd63d={};_0x4bd63d[_0x3e7b6c]={'$like':'%'+_0x27259f[_0x956c('0x49')]['filter']+'%'};return _0x4bd63d;})});}_0x1c08b4=_[_0x956c('0x50')]({},_0x1c08b4,_0x27259f['options']);return db[_0x956c('0x9d')][_0x956c('0x2e')]({'where':_0x1c08b4[_0x956c('0x4e')]})[_0x956c('0x1f')](function(_0x157284){_0x5ed650[_0x956c('0x2e')]=_0x157284;if(_0x27259f[_0x956c('0x49')]['includeAll']){_0x1c08b4[_0x956c('0x55')]=[{'model':db['CmContact'],'as':_0x956c('0xbc'),'required':![]},{'model':db[_0x956c('0xa8')],'as':_0x956c('0xbd'),'attributes':[_0x956c('0x39'),_0x956c('0xbe'),_0x956c('0xbf')],'required':![]},{'model':db[_0x956c('0xc0')],'as':_0x956c('0xc1'),'attributes':['id','name','color'],'where':_0x27259f['query'][_0x956c('0xc2')]?{'id':_0x27259f[_0x956c('0x49')]['tag']}:undefined,'required':_0x27259f[_0x956c('0x49')][_0x956c('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x956c('0x56')](_0x1c08b4);})[_0x956c('0x1f')](function(_0x511997){_0x5ed650['rows']=_0x511997;return _0x5ed650;});}})[_0x956c('0x1f')](respondWithFilteredResult(_0x546ade,_0x1c08b4))[_0x956c('0x28')](handleError(_0x546ade,null));};exports[_0x956c('0x3a')]=function(_0x39728f,_0x2d3276,_0x3cebfd){var _0x502c06,_0x3a75d4,_0x17975c;if(_[_0x956c('0x92')](_0x39728f[_0x956c('0x5b')]['body'])||_0x39728f['body'][_0x956c('0x5b')]===''){throw new db[(_0x956c('0x93'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x956c('0x92')](_0x39728f[_0x956c('0x5b')]['to'])){throw new db['Sequelize'][(_0x956c('0x90'))](_0x956c('0xc3'));}_0x502c06=_0x39728f[_0x956c('0x5b')]['to'];return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x39728f[_0x956c('0x63')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x956c('0x9b')],'as':_0x956c('0x98'),'where':{'mobile':_0x502c06},'limit':0x1,'order':[[_0x956c('0x78'),_0x956c('0x99')]]}]}]})[_0x956c('0x1f')](handleEntityNotFound(_0x2d3276,null))[_0x956c('0x1f')](function(_0x7c3e53){if(_0x7c3e53&&_0x7c3e53['List']){_0x3a75d4=_0x7c3e53[_0x956c('0x37')]({'plain':!![]});if(_0x3a75d4[_0x956c('0xc4')]&&_0x3a75d4[_0x956c('0xc4')]['Contacts'][_0x956c('0x4b')]){return _0x3a75d4[_0x956c('0xc4')][_0x956c('0x98')][0x0];}return db['CmContact'][_0x956c('0x5a')](_['defaults'](_0x39728f['body'],{'firstName':_0x502c06,'mobile':_0x502c06,'phone':_0x502c06,'ListId':_0x3a75d4['ListId']}));}})[_0x956c('0x1f')](handleEntityNotFound(_0x2d3276,null))['then'](function(_0x5977cc){if(_0x5977cc){_0x17975c=_0x5977cc;return db[_0x956c('0x9d')][_0x956c('0x59')]({'where':{'ContactId':_0x17975c['id'],'closed':![],'SmsAccountId':_0x3a75d4['id']}})['then'](function(_0x3ad7e7){if(_0x3ad7e7){return[_0x3ad7e7,![]];}return db[_0x956c('0x9d')][_0x956c('0x5a')]({'UserId':_0x39728f['user']['id'],'ContactId':_0x17975c['id'],'SmsAccountId':_0x3a75d4['id'],'phone':_0x502c06,'firstMsgDirection':_0x956c('0xc5'),'Messages':[_['merge'](_0x39728f[_0x956c('0x5b')],{'read':![],'body':_0x39728f[_0x956c('0x5b')][_0x956c('0x5b')],'phone':_0x502c06,'SmsAccountId':_0x3a75d4['id'],'UserId':_0x39728f[_0x956c('0x5c')]['id'],'ContactId':_0x17975c['id']})]},{'include':[{'model':db[_0x956c('0xa5')],'as':'Messages'}]})[_0x956c('0x1f')](function(_0x2fe3c5){return[_0x2fe3c5,!![]];});});}})[_0x956c('0xc6')](function(_0x226b2e,_0xb9e29){if(_0xb9e29){return _0x226b2e;}return db[_0x956c('0xa5')]['create'](_['merge'](_0x39728f['body'],{'read':![],'body':_0x39728f[_0x956c('0x5b')][_0x956c('0x5b')],'phone':_0x502c06,'SmsAccountId':_0x3a75d4['id'],'SmsInteractionId':_0x226b2e['id'],'UserId':_0x39728f[_0x956c('0x5c')]['id'],'ContactId':_0x17975c['id']}))[_0x956c('0x1f')](function(_0x3250be){_0x226b2e[_0x956c('0xc7')][_0x956c('0xc8')]=[];_0x226b2e[_0x956c('0xc7')][_0x956c('0xc8')]['push'](_0x3250be['dataValues']);return _0x226b2e;});})[_0x956c('0x1f')](respondWithResult(_0x2d3276,null))[_0x956c('0x28')](handleError(_0x2d3276,null));};exports[_0x956c('0x2f')]=function(_0x5d9a32,_0x8b3b37,_0x5afcbb){if(_0x5d9a32['body']['id']){delete _0x5d9a32[_0x956c('0x5b')]['id'];}var _0x259bbe,_0x186263,_0x35cb75;return db[_0x956c('0x3e')]['find']({'where':{'id':_0x5d9a32['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x8b3b37,null))[_0x956c('0x1f')](function(_0x495a68){if(_0x495a68){_0x35cb75=_0x495a68;logger['debug'](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0xc9'),_0x495a68[_0x956c('0x41')],util['inspect'](_0x5d9a32['body'],{'showHidden':![],'depth':null}));switch(_0x495a68[_0x956c('0x41')]){case'skebby':if(_0x5d9a32[_0x956c('0x5b')][_0x956c('0xca')]&&_0x5d9a32[_0x956c('0x5b')]['status']){_0x186263=_0x5d9a32[_0x956c('0x5b')]['status'];return db[_0x956c('0xa5')][_0x956c('0x59')]({'where':{'messageId':_0x5d9a32[_0x956c('0x5b')][_0x956c('0xca')]}});}break;case _0x956c('0x83'):if(_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcb')]&&_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcc')]){_0x186263=_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcc')];return db[_0x956c('0xa5')]['find']({'where':{'messageId':_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcb')]}});}break;case _0x956c('0x84'):if(_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcd')]&&_0x5d9a32[_0x956c('0x5b')][_0x956c('0xce')]){_0x186263=_0x5d9a32['body'][_0x956c('0xce')];return db[_0x956c('0xa5')][_0x956c('0x59')]({'where':{'messageId':_0x5d9a32[_0x956c('0x5b')][_0x956c('0xcd')]}});}break;case _0x956c('0x87'):var _0x266267=_0x5d9a32[_0x956c('0x5b')]['results'][0x0];if(_0x266267['messageId']&&_0x266267[_0x956c('0x2f')]['groupName']===_0x956c('0xcf')){_0x186263=_0x266267[_0x956c('0x2f')][_0x956c('0xd0')];return db[_0x956c('0xa5')][_0x956c('0x59')]({'where':{'messageId':_0x266267[_0x956c('0x7f')]}});}break;case'clickatell':if(_0x5d9a32[_0x956c('0x5b')][_0x956c('0x7f')]&&_0x5d9a32[_0x956c('0x5b')][_0x956c('0x2f')]){_0x186263=_0x5d9a32[_0x956c('0x5b')][_0x956c('0x2f')];return db[_0x956c('0xa5')][_0x956c('0x59')]({'where':{'messageId':_0x5d9a32[_0x956c('0x5b')][_0x956c('0x7f')]}});}break;case'bandwidth':if(_0x5d9a32[_0x956c('0x5b')][0x0]['message']['id']){_0x186263=_0x5d9a32[_0x956c('0x5b')][0x0][_0x956c('0x41')];return db[_0x956c('0xa5')][_0x956c('0x59')]({'where':{'messageId':_0x5d9a32['body'][0x0][_0x956c('0x26')]['id']}});}break;case _0x956c('0xd1'):if(_0x5d9a32[_0x956c('0x5b')][_0x956c('0xd2')]&&_0x5d9a32[_0x956c('0x5b')][_0x956c('0x2f')]){_0x186263=_0x5d9a32[_0x956c('0x5b')][_0x956c('0x2f')];return db[_0x956c('0xa5')]['find']({'where':{'messageId':_0x5d9a32[_0x956c('0x5b')][_0x956c('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x8b3b37,null))[_0x956c('0x1f')](function(_0xaa805d){if(_0xaa805d){_0x259bbe=_0xaa805d;switch(_0x35cb75[_0x956c('0x41')]){case'skebby':if(_0x186263===_0x956c('0xcf')){return _0x259bbe[_0x956c('0x35')]({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x81'),util[_0x956c('0xd3')](_0x5d9a32[_0x956c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x956c('0x83'):if(_0x186263==='1'){return _0x259bbe['update']({'read':!![]});}else{logger['error'](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x81'),util[_0x956c('0xd3')](_0x5d9a32['body'],{'showHidden':![],'depth':null}));}break;case _0x956c('0x84'):if(!_0x5d9a32[_0x956c('0x5b')][_0x956c('0xd4')]&&_0x186263>=0xc8&&_0x186263<=0xce){return _0x259bbe['update']({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),'status',_0x956c('0x84'),util[_0x956c('0xd3')](_0x5d9a32['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x237262=_0x5d9a32[_0x956c('0x5b')]['results'][0x0];if(_0x237262[_0x956c('0x2f')]['groupName']===_0x956c('0xcf')){return _0x259bbe[_0x956c('0x35')]({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x87'),util['inspect'](_0x5d9a32[_0x956c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x956c('0x8c'):if(_0x186263=='DELIVERED_TO_GATEWAY'||_0x186263==_0x956c('0xd5')){return _0x259bbe[_0x956c('0x35')]({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x8c'),util['inspect'](_0x5d9a32[_0x956c('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x956c('0x8f'):if(_0x186263==_0x956c('0xd6')){return _0x259bbe[_0x956c('0x35')]({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x8f'),util[_0x956c('0xd3')](_0x5d9a32[_0x956c('0x5b')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x186263===_0x956c('0xd7')||_0x186263===_0x956c('0xd8')){return _0x259bbe['update']({'read':!![]});}else{logger[_0x956c('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x956c('0x2f'),_0x956c('0xd1'),util[_0x956c('0xd3')](_0x5d9a32['body'],{'showHidden':![],'depth':null}));}break;}return _0x259bbe;}})['then'](respondWithResult(_0x8b3b37,null))[_0x956c('0x28')](handleError(_0x8b3b37,null));};exports[_0x956c('0xd9')]=function(_0x3cea76,_0x5e16f6,_0x1265f4){var _0x42a4d9,_0x3509f8,_0x31454c;return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x3cea76['params']['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x5e16f6,null))['then'](function(_0x1943fa){if(_0x1943fa){_0x31454c=_0x1943fa;logger[_0x956c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x956c('0x2f'),'received\x20delivery\x20report\x20from',_0x1943fa[_0x956c('0x41')],util[_0x956c('0xd3')](_0x3cea76[_0x956c('0x49')],{'showHidden':![],'depth':null}));switch(_0x1943fa[_0x956c('0x41')]){case'csc':if(_0x3cea76[_0x956c('0x49')][_0x956c('0xda')]&&_0x3cea76[_0x956c('0x49')][_0x956c('0xdb')]){_0x3509f8=_0x3cea76[_0x956c('0x49')][_0x956c('0xdb')];return db['SmsMessage'][_0x956c('0x59')]({'where':{'messageId':_0x3cea76[_0x956c('0x49')]['message-id']}});}break;}}})[_0x956c('0x1f')](handleEntityNotFound(_0x5e16f6,null))[_0x956c('0x1f')](function(_0x4bdc08){if(_0x4bdc08){_0x42a4d9=_0x4bdc08;switch(_0x31454c[_0x956c('0x41')]){case'csc':if(_0x3509f8==='2'||_0x3509f8==='6'){return _0x42a4d9[_0x956c('0x35')]({'read':!![]});}else{logger[_0x956c('0x24')](_0x956c('0xae'),_0x956c('0x2f'),_0x956c('0x8a'),util[_0x956c('0xd3')](_0x3cea76[_0x956c('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x42a4d9;}})[_0x956c('0x1f')](respondWithResult(_0x5e16f6,null))['catch'](handleError(_0x5e16f6,null));};exports[_0x956c('0xdc')]=function(_0x58ff70,_0x1522ed,_0x79de02){return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x58ff70[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x1522ed,null))[_0x956c('0x1f')](function(_0x46a95f){if(_0x46a95f){return _0x46a95f[_0x956c('0xdc')](_0x58ff70[_0x956c('0x5b')][_0x956c('0x6b')],_[_0x956c('0xdd')](_0x58ff70[_0x956c('0x5b')],[_0x956c('0x6b'),'id'])||{})[_0x956c('0xc6')](function(_0x33cfcf){for(var _0x33a352=0x0;_0x33a352<_0x58ff70['body']['ids'][_0x956c('0x4b')];_0x33a352+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x58ff70[_0x956c('0x5b')][_0x956c('0x6b')][_0x33a352]),'SmsAccountId':Number(_0x58ff70[_0x956c('0x63')]['id'])});}return _0x33cfcf;});}})['then'](respondWithResult(_0x1522ed,null))[_0x956c('0x28')](handleError(_0x1522ed,null));};exports['removeAgents']=function(_0x4e2cb2,_0x2b3d0a,_0x1f39d9){return db[_0x956c('0x3e')][_0x956c('0x59')]({'where':{'id':_0x4e2cb2[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x2b3d0a,null))[_0x956c('0x1f')](function(_0x29d54e){if(_0x29d54e){return _0x29d54e[_0x956c('0xde')](_0x4e2cb2['query']['ids'])[_0x956c('0x1f')](function(){if(_[_0x956c('0xdf')](_0x4e2cb2['query'][_0x956c('0x6b')])){for(var _0x4c9ed1=0x0;_0x4c9ed1<_0x4e2cb2[_0x956c('0x49')][_0x956c('0x6b')]['length'];_0x4c9ed1+=0x1){socket[_0x956c('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x4e2cb2[_0x956c('0x49')][_0x956c('0x6b')][_0x4c9ed1]),'SmsAccountId':Number(_0x4e2cb2[_0x956c('0x63')]['id'])});}}else{socket[_0x956c('0xe0')](_0x956c('0xe1'),{'UserId':Number(_0x4e2cb2['query'][_0x956c('0x6b')]),'SmsAccountId':Number(_0x4e2cb2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2b3d0a,null))['catch'](handleError(_0x2b3d0a,null));};exports[_0x956c('0xe2')]=function(_0xa60287,_0x4a1439,_0x4fbe47){var _0x457789={};var _0x53c16b={};var _0x35e200;var _0x4ecad9;return db[_0x956c('0x3e')]['findOne']({'where':{'id':_0xa60287[_0x956c('0x63')]['id']}})[_0x956c('0x1f')](handleEntityNotFound(_0x4a1439,null))['then'](function(_0x348003){if(_0x348003){_0x35e200=_0x348003;_0x53c16b[_0x956c('0x47')]=_[_0x956c('0x44')](db[_0x956c('0xa8')]['rawAttributes']);_0x53c16b[_0x956c('0x49')]=_[_0x956c('0x44')](_0xa60287[_0x956c('0x49')]);_0x53c16b['filters']=_[_0x956c('0x46')](_0x53c16b[_0x956c('0x47')],_0x53c16b['query']);_0x457789[_0x956c('0x48')]=_[_0x956c('0x46')](_0x53c16b[_0x956c('0x47')],qs['fields'](_0xa60287[_0x956c('0x49')]['fields']));_0x457789[_0x956c('0x48')]=_0x457789['attributes'][_0x956c('0x4b')]?_0x457789['attributes']:_0x53c16b[_0x956c('0x47')];_0x457789['order']=qs[_0x956c('0x69')](_0xa60287[_0x956c('0x49')][_0x956c('0x69')]);_0x457789['where']=qs['filters'](_[_0x956c('0x4f')](_0xa60287['query'],_0x53c16b[_0x956c('0x45')]));if(_0xa60287[_0x956c('0x49')][_0x956c('0x52')]){_0x457789[_0x956c('0x4e')]=_[_0x956c('0x50')](_0x457789[_0x956c('0x4e')],{'$or':_[_0x956c('0x43')](_0x457789[_0x956c('0x48')],function(_0x4f2911){var _0x3344bb={};_0x3344bb[_0x4f2911]={'$like':'%'+_0xa60287[_0x956c('0x49')]['filter']+'%'};return _0x3344bb;})});}_0x457789=_[_0x956c('0x50')]({},_0x457789,_0xa60287[_0x956c('0x53')]);return _0x35e200['getAgents'](_0x457789);}})[_0x956c('0x1f')](function(_0x34674d){if(_0x34674d){_0x4ecad9=_0x34674d['length'];if(!_0xa60287[_0x956c('0x49')][_0x956c('0x4c')](_0x956c('0x68'))){_0x457789[_0x956c('0x2d')]=qs[_0x956c('0x2d')](_0xa60287['query'][_0x956c('0x2d')]);_0x457789['offset']=qs[_0x956c('0x2b')](_0xa60287['query'][_0x956c('0x2b')]);}return _0x35e200['getAgents'](_0x457789);}})['then'](function(_0x1d96e5){if(_0x1d96e5){return _0x1d96e5?{'count':_0x4ecad9,'rows':_0x1d96e5}:null;}})[_0x956c('0x1f')](respondWithResult(_0x4a1439,null))[_0x956c('0x28')](handleError(_0x4a1439,null));}; \ No newline at end of file +var _0x1e6e=['statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','save','update','then','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','order','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','hasOwnProperty','nolimit','sort','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','Body','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','messageId','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','omit','Contacts','contact','SmsInteraction','interaction','push','close','*,*,*,*','created','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','internal','Tags','color','tag','CmList','List','out','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','intelepeer','redif','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD'];(function(_0x36bd51,_0x1c4451){var _0x19ac56=function(_0x4cda9c){while(--_0x4cda9c){_0x36bd51['push'](_0x36bd51['shift']());}};_0x19ac56(++_0x1c4451);}(_0x1e6e,0x1bc));var _0xe1e6=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x1e6e[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0xe1e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe1e6('0x1'));var jsonpatch=require(_0xe1e6('0x2'));var rp=require('request-promise');var moment=require(_0xe1e6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe1e6('0x4'));var util=require(_0xe1e6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe1e6('0x6'));var ejs=require(_0xe1e6('0x7'));var fs=require('fs');var fs_extra=require(_0xe1e6('0x8'));var _=require(_0xe1e6('0x9'));var squel=require(_0xe1e6('0xa'));var crypto=require(_0xe1e6('0xb'));var jsforce=require(_0xe1e6('0xc'));var deskjs=require(_0xe1e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe1e6('0xe'));var Papa=require(_0xe1e6('0xf'));var Redis=require(_0xe1e6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe1e6('0x11'));var as=require(_0xe1e6('0x12'));var hardwareService=require(_0xe1e6('0x13'));var logger=require('../../config/logger')(_0xe1e6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe1e6('0x15'));var db=require('../../mysqldb')['db'];config[_0xe1e6('0x16')]=_[_0xe1e6('0x17')](config[_0xe1e6('0x16')],{'host':_0xe1e6('0x18'),'port':0x18eb});var socket=require(_0xe1e6('0x19'))(new Redis(config['redis']));require(_0xe1e6('0x1a'))[_0xe1e6('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe1e6('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x4ce49c,_0x5e1e8c,_0x59a85c,_0x13ceb2){return new BPromise(function(_0x2eeddf,_0x2d4fe3){var _0x658e40=_0x13ceb2||client;return _0x658e40[_0xe1e6('0x1d')](_0x4ce49c,_0x59a85c)['then'](function(_0x4aa308){logger[_0xe1e6('0x1e')](_0xe1e6('0x1f'),_0x5e1e8c,_0xe1e6('0x20'));logger[_0xe1e6('0x21')](_0xe1e6('0x22'),_0x5e1e8c,_0xe1e6('0x20'),JSON[_0xe1e6('0x23')](_0x4aa308));if(_0x4aa308[_0xe1e6('0x24')]){if(_0x4aa308[_0xe1e6('0x24')]['code']===0x1f4){logger['error'](_0xe1e6('0x1f'),_0x5e1e8c,_0x4aa308[_0xe1e6('0x24')][_0xe1e6('0x25')]);return _0x2d4fe3(_0x4aa308[_0xe1e6('0x24')][_0xe1e6('0x25')]);}logger[_0xe1e6('0x24')](_0xe1e6('0x1f'),_0x5e1e8c,_0x4aa308[_0xe1e6('0x24')][_0xe1e6('0x25')]);return _0x2eeddf(_0x4aa308['error'][_0xe1e6('0x25')]);}else{logger[_0xe1e6('0x1e')](_0xe1e6('0x1f'),_0x5e1e8c,_0xe1e6('0x20'));_0x2eeddf(_0x4aa308[_0xe1e6('0x26')][_0xe1e6('0x25')]);}})[_0xe1e6('0x27')](function(_0x5a262f){logger['error'](_0xe1e6('0x1f'),_0x5e1e8c,_0x5a262f);_0x2d4fe3(_0x5a262f);});});}function respondWithStatusCode(_0x43aca9,_0x122f09){_0x122f09=_0x122f09||0xcc;return function(_0xfe51fa){if(_0xfe51fa){return _0x43aca9[_0xe1e6('0x28')](_0x122f09);}return _0x43aca9[_0xe1e6('0x29')](_0x122f09)['end']();};}function respondWithResult(_0x8532ee,_0x40cd5a){_0x40cd5a=_0x40cd5a||0xc8;return function(_0x41db55){if(_0x41db55){return _0x8532ee['status'](_0x40cd5a)[_0xe1e6('0x2a')](_0x41db55);}};}function respondWithFilteredResult(_0x227175,_0x37d50e){return function(_0x97d53a){if(_0x97d53a){var _0x335cb9=typeof _0x37d50e[_0xe1e6('0x2b')]===_0xe1e6('0x2c')&&typeof _0x37d50e['limit']===_0xe1e6('0x2c');var _0x129698=_0x97d53a[_0xe1e6('0x2d')];var _0x59ebaf=_0x335cb9?0x0:_0x37d50e['offset'];var _0xbedfa6=_0x335cb9?_0x97d53a[_0xe1e6('0x2d')]:_0x37d50e['offset']+_0x37d50e[_0xe1e6('0x2e')];var _0x513dee;if(_0xbedfa6>=_0x129698){_0xbedfa6=_0x129698;_0x513dee=0xc8;}else{_0x513dee=0xce;}_0x227175['status'](_0x513dee);return _0x227175[_0xe1e6('0x2f')]('Content-Range',_0x59ebaf+'-'+_0xbedfa6+'/'+_0x129698)[_0xe1e6('0x2a')](_0x97d53a);}return null;};}function patchUpdates(_0x4b0c21){return function(_0x2e868f){try{jsonpatch['apply'](_0x2e868f,_0x4b0c21,!![]);}catch(_0x1cd541){return BPromise['reject'](_0x1cd541);}return _0x2e868f[_0xe1e6('0x30')]();};}function saveUpdates(_0x4b0701,_0xeec2b2){return function(_0x7dadcd){if(_0x7dadcd){return _0x7dadcd[_0xe1e6('0x31')](_0x4b0701)[_0xe1e6('0x32')](function(_0x5bc4dc){return _0x5bc4dc;});}return null;};}function removeEntity(_0xa42f79,_0x315a55){return function(_0x2f14e0){if(_0x2f14e0){return _0x2f14e0[_0xe1e6('0x33')]()[_0xe1e6('0x32')](function(){var _0x5e7751=_0x2f14e0[_0xe1e6('0x34')]({'plain':!![]});var _0x48c398=_0xe1e6('0x35');return db[_0xe1e6('0x36')][_0xe1e6('0x33')]({'where':{'type':_0x48c398,'resourceId':_0x5e7751['id']}})[_0xe1e6('0x32')](function(){return _0x2f14e0;});})[_0xe1e6('0x32')](function(){_0xa42f79[_0xe1e6('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x328ffe,_0x139dd1){return function(_0x193f86){if(!_0x193f86){_0x328ffe[_0xe1e6('0x28')](0x194);}return _0x193f86;};}function handleError(_0x7cb755,_0x384d9e){_0x384d9e=_0x384d9e||0x1f4;return function(_0x4920c4){logger[_0xe1e6('0x24')](_0x4920c4['stack']);if(_0x4920c4[_0xe1e6('0x37')]){delete _0x4920c4[_0xe1e6('0x37')];}_0x7cb755['status'](_0x384d9e)[_0xe1e6('0x38')](_0x4920c4);};}exports['index']=function(_0x54f22c,_0x2615e6){var _0x34d4fd={'include':[{'model':db[_0xe1e6('0x39')],'as':_0xe1e6('0x3a')}]},_0x382059={},_0x900502={'count':0x0,'rows':[]};var _0x49248b=_[_0xe1e6('0x3b')](db[_0xe1e6('0x3c')]['rawAttributes'],function(_0x131908){return{'name':_0x131908[_0xe1e6('0x3d')],'type':_0x131908[_0xe1e6('0x3e')][_0xe1e6('0x3f')]};});_0x382059[_0xe1e6('0x40')]=_[_0xe1e6('0x3b')](_0x49248b,_0xe1e6('0x37'));_0x382059[_0xe1e6('0x41')]=_[_0xe1e6('0x42')](_0x54f22c[_0xe1e6('0x41')]);_0x382059[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x382059[_0xe1e6('0x40')],_0x382059[_0xe1e6('0x41')]);_0x34d4fd['attributes']=_[_0xe1e6('0x44')](_0x382059[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x54f22c[_0xe1e6('0x41')][_0xe1e6('0x45')]));_0x34d4fd[_0xe1e6('0x46')]=_0x34d4fd[_0xe1e6('0x46')]['length']?_0x34d4fd[_0xe1e6('0x46')]:_0x382059['model'];if(!_0x54f22c['query']['hasOwnProperty']('nolimit')){_0x34d4fd[_0xe1e6('0x2e')]=qs[_0xe1e6('0x2e')](_0x54f22c[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x34d4fd[_0xe1e6('0x2b')]=qs[_0xe1e6('0x2b')](_0x54f22c[_0xe1e6('0x41')][_0xe1e6('0x2b')]);}_0x34d4fd[_0xe1e6('0x47')]=qs['sort'](_0x54f22c['query']['sort']);_0x34d4fd['where']=qs[_0xe1e6('0x43')](_['pick'](_0x54f22c[_0xe1e6('0x41')],_0x382059[_0xe1e6('0x43')]),_0x49248b);if(_0x54f22c[_0xe1e6('0x41')][_0xe1e6('0x48')]){_0x34d4fd[_0xe1e6('0x49')]=_['merge'](_0x34d4fd[_0xe1e6('0x49')],{'$or':_[_0xe1e6('0x3b')](_0x49248b,function(_0x2e1ad8){if(_0x2e1ad8[_0xe1e6('0x3e')]!==_0xe1e6('0x4a')){var _0xeed0f5={};_0xeed0f5[_0x2e1ad8['name']]={'$like':'%'+_0x54f22c[_0xe1e6('0x41')][_0xe1e6('0x48')]+'%'};return _0xeed0f5;}})});}_0x34d4fd=_[_0xe1e6('0x4b')]({},_0x34d4fd,_0x54f22c[_0xe1e6('0x4c')]);var _0x293d19={'where':_0x34d4fd[_0xe1e6('0x49')]};return db[_0xe1e6('0x3c')][_0xe1e6('0x2d')](_0x293d19)[_0xe1e6('0x32')](function(_0x9e9ffa){_0x900502['count']=_0x9e9ffa;if(_0x54f22c[_0xe1e6('0x41')]['includeAll']){_0x34d4fd[_0xe1e6('0x4d')]=[{'all':!![]}];}return db[_0xe1e6('0x3c')][_0xe1e6('0x4e')](_0x34d4fd);})[_0xe1e6('0x32')](function(_0x473075){_0x900502[_0xe1e6('0x4f')]=_0x473075;return _0x900502;})[_0xe1e6('0x32')](respondWithFilteredResult(_0x2615e6,_0x34d4fd))[_0xe1e6('0x27')](handleError(_0x2615e6,null));};exports[_0xe1e6('0x50')]=function(_0x130d99,_0x54a701){var _0x589069={'raw':![],'where':{'id':_0x130d99[_0xe1e6('0x51')]['id']},'include':[{'model':db[_0xe1e6('0x39')],'as':'mandatoryDispositionPause'}]},_0x26dafb={};_0x26dafb[_0xe1e6('0x40')]=_['keys'](db['SmsAccount'][_0xe1e6('0x52')]);_0x26dafb['query']=_[_0xe1e6('0x42')](_0x130d99[_0xe1e6('0x41')]);_0x26dafb[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x26dafb['model'],_0x26dafb[_0xe1e6('0x41')]);_0x589069[_0xe1e6('0x46')]=_[_0xe1e6('0x44')](_0x26dafb[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x130d99[_0xe1e6('0x41')][_0xe1e6('0x45')]));_0x589069[_0xe1e6('0x46')]=_0x589069[_0xe1e6('0x46')][_0xe1e6('0x53')]?_0x589069[_0xe1e6('0x46')]:_0x26dafb['model'];if(_0x130d99['query'][_0xe1e6('0x54')]){_0x589069['include']=[{'all':!![]}];}_0x589069=_[_0xe1e6('0x4b')]({},_0x589069,_0x130d99[_0xe1e6('0x4c')]);return db[_0xe1e6('0x3c')][_0xe1e6('0x55')](_0x589069)[_0xe1e6('0x32')](handleEntityNotFound(_0x54a701,null))['then'](respondWithResult(_0x54a701,null))['catch'](handleError(_0x54a701,null));};exports[_0xe1e6('0x56')]=function(_0x1c3089,_0x3e3085){return db[_0xe1e6('0x3c')][_0xe1e6('0x56')](_0x1c3089[_0xe1e6('0x57')],{})[_0xe1e6('0x32')](function(_0xc4595){var _0xcfe965=_0x1c3089[_0xe1e6('0x58')][_0xe1e6('0x34')]({'plain':!![]});if(!_0xcfe965)throw new Error(_0xe1e6('0x59'));if(_0xcfe965[_0xe1e6('0x5a')]==='user'){var _0x16da11=_0xc4595[_0xe1e6('0x34')]({'plain':!![]});var _0x2b6523=_0xe1e6('0x35');return db[_0xe1e6('0x5b')][_0xe1e6('0x55')]({'where':{'name':_0x2b6523,'userProfileId':_0xcfe965['userProfileId']},'raw':!![]})[_0xe1e6('0x32')](function(_0x3f78a3){if(_0x3f78a3&&_0x3f78a3['autoAssociation']===0x0){return db[_0xe1e6('0x36')][_0xe1e6('0x56')]({'name':_0x16da11['name'],'resourceId':_0x16da11['id'],'type':_0x3f78a3[_0xe1e6('0x37')],'sectionId':_0x3f78a3['id']},{})[_0xe1e6('0x32')](function(){return _0xc4595;});}else{return _0xc4595;}})[_0xe1e6('0x27')](function(_0x2a6e91){logger['error'](_0xe1e6('0x5c'),_0x2a6e91);throw _0x2a6e91;});}return _0xc4595;})['then'](respondWithResult(_0x3e3085,0xc9))[_0xe1e6('0x27')](handleError(_0x3e3085,null));};exports[_0xe1e6('0x31')]=function(_0xdf8425,_0x5317be){if(_0xdf8425['body']['id']){delete _0xdf8425[_0xe1e6('0x57')]['id'];}return db[_0xe1e6('0x3c')][_0xe1e6('0x55')]({'where':{'id':_0xdf8425[_0xe1e6('0x51')]['id']},'include':[{'model':db[_0xe1e6('0x39')],'as':_0xe1e6('0x3a')}]})['then'](handleEntityNotFound(_0x5317be,null))['then'](saveUpdates(_0xdf8425[_0xe1e6('0x57')],null))[_0xe1e6('0x32')](respondWithResult(_0x5317be,null))['catch'](handleError(_0x5317be,null));};exports[_0xe1e6('0x33')]=function(_0x4a16d9,_0x1c8dbf){return db[_0xe1e6('0x3c')][_0xe1e6('0x55')]({'where':{'id':_0x4a16d9[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x1c8dbf,null))[_0xe1e6('0x32')](removeEntity(_0x1c8dbf,null))['catch'](handleError(_0x1c8dbf,null));};exports[_0xe1e6('0x5d')]=function(_0x511084,_0x5acbff){return db[_0xe1e6('0x3c')][_0xe1e6('0x5d')]()[_0xe1e6('0x32')](respondWithResult(_0x5acbff,null))[_0xe1e6('0x27')](handleError(_0x5acbff,null));};exports[_0xe1e6('0x5e')]=function(_0x20aec0,_0x49fe17,_0x211a51){if(_0x20aec0['body']['id']){delete _0x20aec0[_0xe1e6('0x57')]['id'];}return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x20aec0[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x49fe17,null))['then'](function(_0x3dc005){if(_0x3dc005){_0x20aec0['body'][_0xe1e6('0x5f')]=_0x3dc005['id'];return db[_0xe1e6('0x60')][_0xe1e6('0x56')](_0x20aec0[_0xe1e6('0x57')]);}})[_0xe1e6('0x32')](respondWithResult(_0x49fe17,null))[_0xe1e6('0x27')](handleError(_0x49fe17,null));};exports['getDispositions']=function(_0x97b8eb,_0x5454a8,_0xb6b4cd){var _0x383d9={'raw':![],'where':{}};var _0x2a3e38={};var _0x543a4c={'count':0x0,'rows':[]};return db['SmsAccount'][_0xe1e6('0x61')]({'where':{'id':_0x97b8eb[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x5454a8,null))['then'](function(_0x23d917){if(_0x23d917){_0x2a3e38['model']=_['keys'](db[_0xe1e6('0x60')]['rawAttributes']);_0x2a3e38[_0xe1e6('0x41')]=_['keys'](_0x97b8eb[_0xe1e6('0x41')]);_0x2a3e38[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x2a3e38[_0xe1e6('0x40')],_0x2a3e38[_0xe1e6('0x41')]);_0x383d9[_0xe1e6('0x46')]=_[_0xe1e6('0x44')](_0x2a3e38[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x97b8eb['query'][_0xe1e6('0x45')]));_0x383d9[_0xe1e6('0x46')]=_0x383d9['attributes'][_0xe1e6('0x53')]?_0x383d9[_0xe1e6('0x46')]:_0x2a3e38[_0xe1e6('0x40')];if(!_0x97b8eb[_0xe1e6('0x41')][_0xe1e6('0x62')](_0xe1e6('0x63'))){_0x383d9[_0xe1e6('0x2e')]=qs[_0xe1e6('0x2e')](_0x97b8eb[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x383d9[_0xe1e6('0x2b')]=qs[_0xe1e6('0x2b')](_0x97b8eb[_0xe1e6('0x41')]['offset']);}_0x383d9['order']=qs[_0xe1e6('0x64')](_0x97b8eb[_0xe1e6('0x41')][_0xe1e6('0x64')]);_0x383d9[_0xe1e6('0x49')]=qs[_0xe1e6('0x43')](_[_0xe1e6('0x65')](_0x97b8eb[_0xe1e6('0x41')],_0x2a3e38[_0xe1e6('0x43')]));_0x383d9[_0xe1e6('0x49')][_0xe1e6('0x5f')]=_0x23d917['id'];if(_0x97b8eb[_0xe1e6('0x41')]['filter']){_0x383d9[_0xe1e6('0x49')]=_['merge'](_0x383d9[_0xe1e6('0x49')],{'$or':_[_0xe1e6('0x3b')](_0x383d9[_0xe1e6('0x46')],function(_0x29b58b){var _0x3b1c74={};_0x3b1c74[_0x29b58b]={'$like':'%'+_0x97b8eb['query'][_0xe1e6('0x48')]+'%'};return _0x3b1c74;})});}_0x383d9=_[_0xe1e6('0x4b')]({},_0x383d9,_0x97b8eb[_0xe1e6('0x4c')]);return db[_0xe1e6('0x60')]['count']({'where':_0x383d9['where']})['then'](function(_0x385413){_0x543a4c[_0xe1e6('0x2d')]=_0x385413;if(_0x97b8eb[_0xe1e6('0x41')][_0xe1e6('0x54')]){_0x383d9[_0xe1e6('0x4d')]=[{'all':!![]}];}return db[_0xe1e6('0x60')]['findAll'](_0x383d9);})[_0xe1e6('0x32')](function(_0x1ff0a3){_0x543a4c[_0xe1e6('0x4f')]=_0x1ff0a3;return _0x543a4c;});}})['then'](respondWithFilteredResult(_0x5454a8,_0x383d9))[_0xe1e6('0x27')](handleError(_0x5454a8,null));};exports[_0xe1e6('0x66')]=function(_0x2d29aa,_0x39df99,_0x31db70){return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x2d29aa[_0xe1e6('0x51')]['id']}})['then'](handleEntityNotFound(_0x39df99,null))[_0xe1e6('0x32')](function(_0x490651){if(_0x490651){return _0x490651[_0xe1e6('0x66')](_0x2d29aa['query'][_0xe1e6('0x67')]);}})[_0xe1e6('0x32')](respondWithStatusCode(_0x39df99,null))[_0xe1e6('0x27')](handleError(_0x39df99,null));};exports[_0xe1e6('0x68')]=function(_0x20ed5c,_0x150fba,_0x6691c2){if(_0x20ed5c[_0xe1e6('0x57')]['id']){delete _0x20ed5c[_0xe1e6('0x57')]['id'];}return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x20ed5c[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x150fba,null))[_0xe1e6('0x32')](function(_0x45e3fe){if(_0x45e3fe){_0x20ed5c[_0xe1e6('0x57')][_0xe1e6('0x5f')]=_0x45e3fe['id'];return db[_0xe1e6('0x69')][_0xe1e6('0x56')](_0x20ed5c[_0xe1e6('0x57')]);}})['then'](respondWithResult(_0x150fba,null))['catch'](handleError(_0x150fba,null));};exports['getAnswers']=function(_0x34df1b,_0x54b994,_0x1679a3){var _0x547cb2={'raw':![],'where':{}};var _0x1fdc4d={};var _0x5178bd={'count':0x0,'rows':[]};return db[_0xe1e6('0x3c')][_0xe1e6('0x61')]({'where':{'id':_0x34df1b['params']['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x54b994,null))[_0xe1e6('0x32')](function(_0x2fe0f5){if(_0x2fe0f5){_0x1fdc4d[_0xe1e6('0x40')]=_['keys'](db['CannedAnswer'][_0xe1e6('0x52')]);_0x1fdc4d[_0xe1e6('0x41')]=_[_0xe1e6('0x42')](_0x34df1b[_0xe1e6('0x41')]);_0x1fdc4d[_0xe1e6('0x43')]=_['intersection'](_0x1fdc4d[_0xe1e6('0x40')],_0x1fdc4d[_0xe1e6('0x41')]);_0x547cb2[_0xe1e6('0x46')]=_['intersection'](_0x1fdc4d[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x34df1b[_0xe1e6('0x41')][_0xe1e6('0x45')]));_0x547cb2[_0xe1e6('0x46')]=_0x547cb2[_0xe1e6('0x46')][_0xe1e6('0x53')]?_0x547cb2['attributes']:_0x1fdc4d['model'];if(!_0x34df1b[_0xe1e6('0x41')]['hasOwnProperty']('nolimit')){_0x547cb2[_0xe1e6('0x2e')]=qs[_0xe1e6('0x2e')](_0x34df1b[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x547cb2[_0xe1e6('0x2b')]=qs['offset'](_0x34df1b[_0xe1e6('0x41')][_0xe1e6('0x2b')]);}_0x547cb2['order']=qs[_0xe1e6('0x64')](_0x34df1b['query']['sort']);_0x547cb2[_0xe1e6('0x49')]=qs['filters'](_[_0xe1e6('0x65')](_0x34df1b[_0xe1e6('0x41')],_0x1fdc4d[_0xe1e6('0x43')]));_0x547cb2[_0xe1e6('0x49')][_0xe1e6('0x5f')]=_0x2fe0f5['id'];if(_0x34df1b[_0xe1e6('0x41')][_0xe1e6('0x48')]){_0x547cb2[_0xe1e6('0x49')]=_[_0xe1e6('0x4b')](_0x547cb2[_0xe1e6('0x49')],{'$or':_['map'](_0x547cb2[_0xe1e6('0x46')],function(_0x76d410){var _0x30d9e3={};_0x30d9e3[_0x76d410]={'$like':'%'+_0x34df1b[_0xe1e6('0x41')][_0xe1e6('0x48')]+'%'};return _0x30d9e3;})});}_0x547cb2=_[_0xe1e6('0x4b')]({},_0x547cb2,_0x34df1b[_0xe1e6('0x4c')]);return db[_0xe1e6('0x69')][_0xe1e6('0x2d')]({'where':_0x547cb2['where']})[_0xe1e6('0x32')](function(_0x1cd00a){_0x5178bd['count']=_0x1cd00a;if(_0x34df1b['query'][_0xe1e6('0x54')]){_0x547cb2[_0xe1e6('0x4d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe1e6('0x4e')](_0x547cb2);})[_0xe1e6('0x32')](function(_0x194a96){_0x5178bd['rows']=_0x194a96;return _0x5178bd;});}})[_0xe1e6('0x32')](respondWithFilteredResult(_0x54b994,_0x547cb2))[_0xe1e6('0x27')](handleError(_0x54b994,null));};exports[_0xe1e6('0x6a')]=function(_0x13db95,_0x693903,_0x160d83){return db[_0xe1e6('0x3c')][_0xe1e6('0x55')]({'where':{'id':_0x13db95[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x693903,null))[_0xe1e6('0x32')](function(_0x2440c1){if(_0x2440c1){return _0x2440c1['removeAnswers'](_0x13db95[_0xe1e6('0x41')][_0xe1e6('0x67')]);}})['then'](respondWithStatusCode(_0x693903,null))['catch'](handleError(_0x693903,null));};exports[_0xe1e6('0x6b')]=function(_0x1dc94c,_0x1d9da9,_0x20036d){var _0x30fc7e={'channel':_0xe1e6('0x6c')};var _0x2a0403=[];var _0x125c87=[];var _0x20ab29={};return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x1dc94c[_0xe1e6('0x51')]['id']},'include':[{'model':db[_0xe1e6('0x6d')],'as':_0xe1e6('0x6e')}]})[_0xe1e6('0x32')](handleEntityNotFound(_0x1d9da9,null))[_0xe1e6('0x32')](function(_0x5b3d27){_0x30fc7e[_0xe1e6('0x6f')]=_0x5b3d27;_0x30fc7e[_0xe1e6('0x70')]=_[_0xe1e6('0x71')](_0x5b3d27['Applications'],[_0xe1e6('0x72')],[_0xe1e6('0x73')]);if(_0x30fc7e[_0xe1e6('0x6f')]['Applications']){delete _0x30fc7e[_0xe1e6('0x6f')][_0xe1e6('0x6e')];}return db[_0xe1e6('0x74')][_0xe1e6('0x5d')]();})[_0xe1e6('0x32')](function(_0x1b26c1){if(!_0x1b26c1){throw new db[(_0xe1e6('0x75'))]['ValidationError'](_0xe1e6('0x76'));}_0x2a0403=_[_0xe1e6('0x77')](_['keys'](_0x1b26c1),['createdAt',_0xe1e6('0x78')]);_0x125c87=_[_0xe1e6('0x77')](_[_0xe1e6('0x42')](_0x1b26c1),[_0xe1e6('0x79'),_0xe1e6('0x78'),_0xe1e6('0x7a'),_0xe1e6('0x7b')]);_0x30fc7e['body']={'mapKey':'mobile'};if(_0x30fc7e['account'][_0xe1e6('0x3e')]){switch(_0x30fc7e[_0xe1e6('0x6f')][_0xe1e6('0x3e')]){case _0xe1e6('0x7c'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x7e')];_0x30fc7e[_0xe1e6('0x57')]['body']=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x7f')];_0x30fc7e['body']['messageId']=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x80')];break;case _0xe1e6('0x81'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]='+'+_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x82')];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x83')];break;case _0xe1e6('0x84'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c['body']['from'];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')]=_0x1dc94c[_0xe1e6('0x57')]['message'];break;case _0xe1e6('0x85'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')]['from'];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')]=_0x1dc94c['body'][_0xe1e6('0x57')];_0x30fc7e[_0xe1e6('0x57')]['messageId']=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x86')];break;case _0xe1e6('0x87'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x7e')];_0x30fc7e[_0xe1e6('0x57')]['body']=_0x1dc94c['body'][_0xe1e6('0x88')];_0x30fc7e[_0xe1e6('0x57')]['messageId']=_0x1dc94c['body'][_0xe1e6('0x89')];break;case'infobip':_0x30fc7e[_0xe1e6('0x57')]['from']='+'+_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x8a')][0x0][_0xe1e6('0x7d')];_0x30fc7e[_0xe1e6('0x57')]['body']=_0x1dc94c['body'][_0xe1e6('0x8a')][0x0][_0xe1e6('0x83')];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x8b')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x8a')][0x0][_0xe1e6('0x8b')];break;case _0xe1e6('0x8c'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x8d')];_0x30fc7e[_0xe1e6('0x57')]['body']=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x8e')][_0xe1e6('0x25')];break;case _0xe1e6('0x8f'):_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x90')];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x83')];_0x30fc7e[_0xe1e6('0x57')]['messageId']=_0x1dc94c[_0xe1e6('0x57')]['replyMessageId'];break;case _0xe1e6('0x91'):_0x30fc7e['body']['messageId']=_0x1dc94c['body'][0x0]['message']['id'];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c[_0xe1e6('0x57')][0x0][_0xe1e6('0x25')][_0xe1e6('0x7d')];_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')]=_0x1dc94c[_0xe1e6('0x57')][0x0][_0xe1e6('0x25')][_0xe1e6('0x83')];break;case'intelepeer':_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')]=_0x1dc94c['body'][_0xe1e6('0x7d')];_0x30fc7e['body'][_0xe1e6('0x57')]=_0x1dc94c[_0xe1e6('0x57')][_0xe1e6('0x25')];_0x30fc7e[_0xe1e6('0x57')]['messageId']=_0x1dc94c[_0xe1e6('0x57')]['refid'];break;}}if(_0x30fc7e[_0xe1e6('0x57')]['id']){delete _0x30fc7e[_0xe1e6('0x57')]['id'];}if(_['isNil'](_0x30fc7e['body']['from'])){throw new db[(_0xe1e6('0x75'))][(_0xe1e6('0x92'))](_0xe1e6('0x93'));}if(_[_0xe1e6('0x94')](_0x30fc7e['body'][_0xe1e6('0x57')])||_0x30fc7e[_0xe1e6('0x57')]['body']===''){throw new db[(_0xe1e6('0x75'))][(_0xe1e6('0x92'))](_0xe1e6('0x95'));}if(_['isNil'](_0x30fc7e['body'][_0xe1e6('0x96')])){throw new db[(_0xe1e6('0x75'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x125c87);}if(!_[_0xe1e6('0x97')](_0x125c87,_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x96')])){throw new db[(_0xe1e6('0x75'))][(_0xe1e6('0x92'))](_0xe1e6('0x98')+_0x125c87);}_0x20ab29[_0x30fc7e[_0xe1e6('0x57')]['mapKey']]=_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')];return db['CmList'][_0xe1e6('0x55')]({'where':{'id':_0x30fc7e['account'][_0xe1e6('0x7b')]},'include':[{'model':db[_0xe1e6('0x74')],'as':'Contacts','where':_0x20ab29,'limit':0x1,'order':[[_0xe1e6('0x78'),_0xe1e6('0x99')]]}]});})['then'](handleEntityNotFound(_0x1d9da9,null))[_0xe1e6('0x32')](function(_0x5a9add){if(_0x5a9add){_0x30fc7e['list']=_[_0xe1e6('0x9a')](_0x5a9add,[_0xe1e6('0x9b')]);if(_0x5a9add[_0xe1e6('0x9b')]['length']){return _0x5a9add['Contacts'][0x0];}var _0x449ce2=_[_0xe1e6('0x17')](_0x30fc7e[_0xe1e6('0x57')],{'firstName':_0x30fc7e[_0xe1e6('0x57')]['from'],'ListId':_0x5a9add['id']});_0x449ce2[_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x96')]]=_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x7d')];return db[_0xe1e6('0x74')]['create'](_0x449ce2,{'fields':_0x2a0403,'raw':!![]});}})[_0xe1e6('0x32')](handleEntityNotFound(_0x1d9da9,null))['then'](function(_0x56837b){if(_0x56837b){_0x30fc7e[_0xe1e6('0x9c')]=_0x56837b;var _0x58dcb6={'ContactId':_0x56837b['id'],'phone':_0x30fc7e['body'][_0xe1e6('0x7d')],'SmsAccountId':_0x1dc94c['params']['id']};var _0x32bc6f={'ContactId':_0x56837b['id'],'SmsAccountId':_0x1dc94c['params']['id'],'closed':![]};return db[_0xe1e6('0x9d')]['find']({'where':_0x32bc6f})[_0xe1e6('0x32')](function(_0x7c2572){if(_0x7c2572){return[_0x7c2572,![]];}return db[_0xe1e6('0x9d')]['create'](_0x58dcb6)['then'](function(_0x128de0){return[_0x128de0,!![]];});});}})['spread'](function(_0x3c05b2,_0x4361ac){_0x30fc7e[_0xe1e6('0x9e')]=_0x3c05b2[_0xe1e6('0x34')]({'plain':!![]});_0x30fc7e[_0xe1e6('0x9e')]['created']=![];if(_0x4361ac){if(_0x30fc7e[_0xe1e6('0x6f')]['autoclose']){_0x30fc7e[_0xe1e6('0x70')][_0xe1e6('0x9f')]({'id':0x0,'priority':_0x30fc7e['applications']['length']+0x1,'app':_0xe1e6('0xa0'),'appdata':'unmanaged','interval':_0xe1e6('0xa1')});}_0x30fc7e[_0xe1e6('0x9e')][_0xe1e6('0xa2')]=!![];}return db['SmsMessage'][_0xe1e6('0x56')]({'phone':_0x30fc7e[_0xe1e6('0x57')]['from'],'messageId':_0x30fc7e[_0xe1e6('0x57')]['messageId'],'body':_0x30fc7e[_0xe1e6('0x57')][_0xe1e6('0x57')],'SmsAccountId':_0x1dc94c['params']['id'],'SmsInteractionId':_0x3c05b2['id'],'direction':'in','ContactId':_0x3c05b2['ContactId'],'AttachmentId':_0x30fc7e['body']['AttachmentId']});})['then'](function(_0x56e137){_0x30fc7e['message']=_0x56e137;if(_0x30fc7e['interaction'][_0xe1e6('0xa3')]){return db[_0xe1e6('0xa4')]['find']({'attributes':['id',_0xe1e6('0x37')],'where':{'id':_0x30fc7e[_0xe1e6('0x9e')][_0xe1e6('0xa3')]}})[_0xe1e6('0x32')](function(_0x229935){if(_0x229935){_0x30fc7e[_0xe1e6('0x70')][_0xe1e6('0xa5')]({'id':0x0,'priority':0x0,'app':_0xe1e6('0xa6'),'appdata':_0x229935['name']+','+(_0x30fc7e[_0xe1e6('0x6f')][_0xe1e6('0xa7')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe1e6('0xa8'),_0xe1e6('0xa9'),_0x30fc7e);});}return respondWithRpcPromise(_0xe1e6('0xa8'),_0xe1e6('0xa9'),_0x30fc7e);})[_0xe1e6('0x32')](function(_0x4918f1){if(_0x4918f1){var _0x441f5f=0xc8;var _0x3860aa=_0xe1e6('0xaa');logger[_0xe1e6('0x1e')](_0xe1e6('0x22'),_0x3860aa,_0x441f5f,_0xe1e6('0xab'));logger[_0xe1e6('0x21')](_0xe1e6('0xac'),_0x3860aa,_0x441f5f,_0xe1e6('0xab'),JSON[_0xe1e6('0x23')](_0x4918f1));if(_0x30fc7e[_0xe1e6('0x6f')][_0xe1e6('0x3e')]==='twilio'){return _0x1d9da9[_0xe1e6('0x29')](_0x441f5f)[_0xe1e6('0x2f')](_0xe1e6('0xad'),_0xe1e6('0xae'))[_0xe1e6('0x38')]('\x0a');}else{return _0x1d9da9[_0xe1e6('0x29')](_0x441f5f)[_0xe1e6('0x2a')](_0x4918f1);}}})[_0xe1e6('0x27')](handleError(_0x1d9da9,null));};exports['addApplications']=function(_0x2ed027,_0x129999,_0x47f6ee){return db['SmsAccount'][_0xe1e6('0x61')]({'where':{'id':_0x2ed027[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x129999,null))[_0xe1e6('0x32')](function(_0x484403){if(_0x484403){return db['sequelize']['transaction'](function(_0x2a6294){return db[_0xe1e6('0x6d')][_0xe1e6('0x33')]({'where':{'SmsAccountId':_0x2ed027[_0xe1e6('0x51')]['id']},'transaction':_0x2a6294})[_0xe1e6('0x32')](function(_0x3c9624){var _0x6b6af8=_[_0xe1e6('0x3b')](_0x2ed027['body'],function(_0x17f615){_0x17f615[_0xe1e6('0x5f')]=_0x2ed027[_0xe1e6('0x51')]['id'];return _0x17f615;});return db[_0xe1e6('0x6d')][_0xe1e6('0xaf')](_0x6b6af8,{'transaction':_0x2a6294});});})[_0xe1e6('0x32')](function(){return db[_0xe1e6('0x6d')][_0xe1e6('0xb0')]({'where':{'SmsAccountId':_0x2ed027['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x129999,null))[_0xe1e6('0x27')](handleError(_0x129999,null));};exports[_0xe1e6('0xb1')]=function(_0x18fff2,_0x364f87,_0x5e179c){var _0x27debc={};var _0x244f80={};var _0x48582b;var _0x1b0068;return db[_0xe1e6('0x3c')][_0xe1e6('0x61')]({'where':{'id':_0x18fff2[_0xe1e6('0x51')]['id']}})['then'](handleEntityNotFound(_0x364f87,null))[_0xe1e6('0x32')](function(_0x1f5f25){if(_0x1f5f25){_0x48582b=_0x1f5f25;_0x244f80['model']=_[_0xe1e6('0x42')](db['SmsApplication'][_0xe1e6('0x52')]);_0x244f80[_0xe1e6('0x41')]=_['keys'](_0x18fff2[_0xe1e6('0x41')]);_0x244f80[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x244f80[_0xe1e6('0x40')],_0x244f80[_0xe1e6('0x41')]);_0x27debc[_0xe1e6('0x46')]=_[_0xe1e6('0x44')](_0x244f80[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x18fff2[_0xe1e6('0x41')][_0xe1e6('0x45')]));_0x27debc['attributes']=_0x27debc['attributes'][_0xe1e6('0x53')]?_0x27debc[_0xe1e6('0x46')]:_0x244f80[_0xe1e6('0x40')];_0x27debc['order']=qs['sort'](_0x18fff2['query'][_0xe1e6('0x64')]);_0x27debc[_0xe1e6('0x49')]=qs['filters'](_[_0xe1e6('0x65')](_0x18fff2[_0xe1e6('0x41')],_0x244f80[_0xe1e6('0x43')]));if(_0x18fff2[_0xe1e6('0x41')][_0xe1e6('0x48')]){_0x27debc['where']=_['merge'](_0x27debc['where'],{'$or':_[_0xe1e6('0x3b')](_0x27debc[_0xe1e6('0x46')],function(_0x35f1e7){var _0x222737={};_0x222737[_0x35f1e7]={'$like':'%'+_0x18fff2[_0xe1e6('0x41')][_0xe1e6('0x48')]+'%'};return _0x222737;})});}_0x27debc=_[_0xe1e6('0x4b')]({},_0x27debc,_0x18fff2['options']);return _0x48582b['getApplications'](_0x27debc);}})[_0xe1e6('0x32')](function(_0x392cd6){if(_0x392cd6){_0x1b0068=_0x392cd6[_0xe1e6('0x53')];if(!_0x18fff2[_0xe1e6('0x41')]['hasOwnProperty']('nolimit')){_0x27debc[_0xe1e6('0x2e')]=qs[_0xe1e6('0x2e')](_0x18fff2[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x27debc[_0xe1e6('0x2b')]=qs[_0xe1e6('0x2b')](_0x18fff2[_0xe1e6('0x41')][_0xe1e6('0x2b')]);}return _0x48582b[_0xe1e6('0xb1')](_0x27debc);}})[_0xe1e6('0x32')](function(_0x283c12){if(_0x283c12){return _0x283c12?{'count':_0x1b0068,'rows':_0x283c12}:null;}})[_0xe1e6('0x32')](respondWithResult(_0x364f87,null))['catch'](handleError(_0x364f87,null));};exports[_0xe1e6('0xb2')]=function(_0x2d1830,_0x43e02c,_0x1e7526){var _0x3ccd6a={'raw':![],'where':{}};var _0x1d751e={};var _0x584227={'count':0x0,'rows':[]};return db[_0xe1e6('0x3c')][_0xe1e6('0x61')]({'where':{'id':_0x2d1830[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x43e02c,null))[_0xe1e6('0x32')](function(_0x35c834){if(_0x35c834){_0x1d751e[_0xe1e6('0x40')]=_['keys'](db[_0xe1e6('0x9d')][_0xe1e6('0x52')]);_0x1d751e['query']=_[_0xe1e6('0x42')](_0x2d1830[_0xe1e6('0x41')]);_0x1d751e[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x1d751e[_0xe1e6('0x40')],_0x1d751e[_0xe1e6('0x41')]);_0x3ccd6a[_0xe1e6('0x46')]=_[_0xe1e6('0x44')](_0x1d751e[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0x45')]));_0x3ccd6a['attributes']=_0x3ccd6a['attributes'][_0xe1e6('0x53')]?_0x3ccd6a[_0xe1e6('0x46')]:_0x1d751e['model'];if(!_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0x62')](_0xe1e6('0x63'))){_0x3ccd6a['limit']=qs[_0xe1e6('0x2e')](_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x3ccd6a[_0xe1e6('0x2b')]=qs[_0xe1e6('0x2b')](_0x2d1830['query'][_0xe1e6('0x2b')]);}_0x3ccd6a[_0xe1e6('0x47')]=qs['sort'](_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0x64')]);_0x3ccd6a[_0xe1e6('0x49')]=qs[_0xe1e6('0x43')](_['pick'](_0x2d1830[_0xe1e6('0x41')],_0x1d751e[_0xe1e6('0x43')]));_0x3ccd6a[_0xe1e6('0x49')][_0xe1e6('0x5f')]=_0x35c834['id'];if(_0x2d1830['query'][_0xe1e6('0x48')]){_0x3ccd6a['where']=_[_0xe1e6('0x4b')](_0x3ccd6a[_0xe1e6('0x49')],{'$or':_[_0xe1e6('0x3b')](_0x3ccd6a[_0xe1e6('0x46')],function(_0x601f6e){var _0x2cb011={};_0x2cb011[_0x601f6e]={'$like':'%'+_0x2d1830['query'][_0xe1e6('0x48')]+'%'};return _0x2cb011;})});}_0x3ccd6a=_['merge']({},_0x3ccd6a,_0x2d1830[_0xe1e6('0x4c')]);return db[_0xe1e6('0x9d')]['count']({'where':_0x3ccd6a[_0xe1e6('0x49')]})[_0xe1e6('0x32')](function(_0x65bec9){_0x584227[_0xe1e6('0x2d')]=_0x65bec9;if(_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0x54')]){_0x3ccd6a[_0xe1e6('0x4d')]=[{'model':db[_0xe1e6('0x74')],'as':_0xe1e6('0xb3'),'required':![]},{'model':db[_0xe1e6('0xa4')],'as':_0xe1e6('0xb4'),'attributes':[_0xe1e6('0x37'),'fullname',_0xe1e6('0xb5')],'required':![]},{'model':db['Tag'],'as':_0xe1e6('0xb6'),'attributes':['id',_0xe1e6('0x37'),_0xe1e6('0xb7')],'where':_0x2d1830['query'][_0xe1e6('0xb8')]?{'id':_0x2d1830[_0xe1e6('0x41')][_0xe1e6('0xb8')]}:undefined,'required':_0x2d1830['query'][_0xe1e6('0xb8')]?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x3ccd6a);})[_0xe1e6('0x32')](function(_0x28c3e1){_0x584227['rows']=_0x28c3e1;return _0x584227;});}})['then'](respondWithFilteredResult(_0x43e02c,_0x3ccd6a))[_0xe1e6('0x27')](handleError(_0x43e02c,null));};exports[_0xe1e6('0x38')]=function(_0x57475c,_0x460f37,_0x3f6b37){var _0x3a2b0b,_0x56a6f5,_0x20550c;if(_['isNil'](_0x57475c[_0xe1e6('0x57')]['body'])||_0x57475c['body'][_0xe1e6('0x57')]===''){throw new db[(_0xe1e6('0x75'))][(_0xe1e6('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe1e6('0x94')](_0x57475c[_0xe1e6('0x57')]['to'])){throw new db['Sequelize'][(_0xe1e6('0x92'))]('to\x20is\x20mandatory');}_0x3a2b0b=_0x57475c[_0xe1e6('0x57')]['to'];return db[_0xe1e6('0x3c')][_0xe1e6('0x55')]({'where':{'id':_0x57475c[_0xe1e6('0x51')]['id']},'include':[{'model':db[_0xe1e6('0xb9')],'as':_0xe1e6('0xba'),'include':[{'model':db[_0xe1e6('0x74')],'as':_0xe1e6('0x9b'),'where':{'mobile':_0x3a2b0b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xe1e6('0x32')](handleEntityNotFound(_0x460f37,null))[_0xe1e6('0x32')](function(_0x3f6638){if(_0x3f6638&&_0x3f6638[_0xe1e6('0xba')]){_0x56a6f5=_0x3f6638['get']({'plain':!![]});if(_0x56a6f5[_0xe1e6('0xba')]&&_0x56a6f5['List'][_0xe1e6('0x9b')][_0xe1e6('0x53')]){return _0x56a6f5[_0xe1e6('0xba')][_0xe1e6('0x9b')][0x0];}return db['CmContact'][_0xe1e6('0x56')](_[_0xe1e6('0x17')](_0x57475c['body'],{'firstName':_0x3a2b0b,'mobile':_0x3a2b0b,'phone':_0x3a2b0b,'ListId':_0x56a6f5[_0xe1e6('0x7b')]}));}})[_0xe1e6('0x32')](handleEntityNotFound(_0x460f37,null))['then'](function(_0x571fb8){if(_0x571fb8){_0x20550c=_0x571fb8;return db[_0xe1e6('0x9d')][_0xe1e6('0x55')]({'where':{'ContactId':_0x20550c['id'],'closed':![],'SmsAccountId':_0x56a6f5['id']}})[_0xe1e6('0x32')](function(_0x5eb46a){if(_0x5eb46a){return[_0x5eb46a,![]];}return db[_0xe1e6('0x9d')]['create']({'UserId':_0x57475c[_0xe1e6('0x58')]['id'],'ContactId':_0x20550c['id'],'SmsAccountId':_0x56a6f5['id'],'phone':_0x3a2b0b,'firstMsgDirection':_0xe1e6('0xbb'),'Messages':[_[_0xe1e6('0x4b')](_0x57475c[_0xe1e6('0x57')],{'read':![],'body':_0x57475c[_0xe1e6('0x57')][_0xe1e6('0x57')],'phone':_0x3a2b0b,'SmsAccountId':_0x56a6f5['id'],'UserId':_0x57475c['user']['id'],'ContactId':_0x20550c['id']})]},{'include':[{'model':db[_0xe1e6('0xbc')],'as':_0xe1e6('0xbd')}]})['then'](function(_0x5d2664){return[_0x5d2664,!![]];});});}})[_0xe1e6('0xbe')](function(_0x5cbc3d,_0x2c1961){if(_0x2c1961){return _0x5cbc3d;}return db[_0xe1e6('0xbc')][_0xe1e6('0x56')](_['merge'](_0x57475c[_0xe1e6('0x57')],{'read':![],'body':_0x57475c[_0xe1e6('0x57')][_0xe1e6('0x57')],'phone':_0x3a2b0b,'SmsAccountId':_0x56a6f5['id'],'SmsInteractionId':_0x5cbc3d['id'],'UserId':_0x57475c[_0xe1e6('0x58')]['id'],'ContactId':_0x20550c['id']}))[_0xe1e6('0x32')](function(_0x191fab){_0x5cbc3d[_0xe1e6('0xbf')]['Messages']=[];_0x5cbc3d[_0xe1e6('0xbf')][_0xe1e6('0xbd')][_0xe1e6('0x9f')](_0x191fab[_0xe1e6('0xbf')]);return _0x5cbc3d;});})['then'](respondWithResult(_0x460f37,null))[_0xe1e6('0x27')](handleError(_0x460f37,null));};exports[_0xe1e6('0x29')]=function(_0x48580b,_0x1accaa,_0x556139){if(_0x48580b['body']['id']){delete _0x48580b[_0xe1e6('0x57')]['id'];}var _0x58ba21,_0x1b33cc,_0xc4efe8;return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x48580b['params']['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x1accaa,null))['then'](function(_0x2ec735){if(_0x2ec735){_0xc4efe8=_0x2ec735;logger[_0xe1e6('0x21')](_0xe1e6('0x22'),_0xe1e6('0x29'),_0xe1e6('0xc0'),_0x2ec735[_0xe1e6('0x3e')],util[_0xe1e6('0xc1')](_0x48580b[_0xe1e6('0x57')],{'showHidden':![],'depth':null}));switch(_0x2ec735[_0xe1e6('0x3e')]){case _0xe1e6('0x81'):if(_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc2')]&&_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x29')]){_0x1b33cc=_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x29')];return db[_0xe1e6('0xbc')][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b['body'][_0xe1e6('0xc2')]}});}break;case _0xe1e6('0x84'):if(_0x48580b['body'][_0xe1e6('0xc3')]&&_0x48580b['body']['statusInt']){_0x1b33cc=_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc4')];return db[_0xe1e6('0xbc')][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc3')]}});}break;case _0xe1e6('0x85'):if(_0x48580b[_0xe1e6('0x57')]['message_id']&&_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc5')]){_0x1b33cc=_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc5')];return db[_0xe1e6('0xbc')][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x86')]}});}break;case'infobip':var _0x5c1c23=_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x8a')][0x0];if(_0x5c1c23[_0xe1e6('0x8b')]&&_0x5c1c23[_0xe1e6('0x29')]['groupName']===_0xe1e6('0xc6')){_0x1b33cc=_0x5c1c23[_0xe1e6('0x29')][_0xe1e6('0xc7')];return db[_0xe1e6('0xbc')][_0xe1e6('0x55')]({'where':{'messageId':_0x5c1c23[_0xe1e6('0x8b')]}});}break;case'clickatell':if(_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x8b')]&&_0x48580b['body'][_0xe1e6('0x29')]){_0x1b33cc=_0x48580b['body'][_0xe1e6('0x29')];return db['SmsMessage'][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b['body'][_0xe1e6('0x8b')]}});}break;case _0xe1e6('0x91'):if(_0x48580b[_0xe1e6('0x57')][0x0][_0xe1e6('0x25')]['id']){_0x1b33cc=_0x48580b[_0xe1e6('0x57')][0x0][_0xe1e6('0x3e')];return db['SmsMessage'][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b['body'][0x0]['message']['id']}});}break;case _0xe1e6('0xc8'):if(_0x48580b[_0xe1e6('0x57')]['redif']&&_0x48580b['body'][_0xe1e6('0x29')]){_0x1b33cc=_0x48580b[_0xe1e6('0x57')]['status'];return db['SmsMessage'][_0xe1e6('0x55')]({'where':{'messageId':_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xc9')]}});}break;}}})[_0xe1e6('0x32')](handleEntityNotFound(_0x1accaa,null))[_0xe1e6('0x32')](function(_0x2ab4c3){if(_0x2ab4c3){_0x58ba21=_0x2ab4c3;switch(_0xc4efe8['type']){case _0xe1e6('0x81'):if(_0x1b33cc==='DELIVERED'){return _0x58ba21[_0xe1e6('0x31')]({'read':!![]});}else{logger[_0xe1e6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe1e6('0x29'),_0xe1e6('0x81'),util[_0xe1e6('0xc1')](_0x48580b[_0xe1e6('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0x84'):if(_0x1b33cc==='1'){return _0x58ba21[_0xe1e6('0x31')]({'read':!![]});}else{logger['error'](_0xe1e6('0x22'),'status',_0xe1e6('0x81'),util[_0xe1e6('0xc1')](_0x48580b['body'],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0x85'):if(!_0x48580b[_0xe1e6('0x57')][_0xe1e6('0xca')]&&_0x1b33cc>=0xc8&&_0x1b33cc<=0xce){return _0x58ba21[_0xe1e6('0x31')]({'read':!![]});}else{logger[_0xe1e6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe1e6('0x29'),_0xe1e6('0x85'),util[_0xe1e6('0xc1')](_0x48580b[_0xe1e6('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0xcb'):var _0x261e44=_0x48580b[_0xe1e6('0x57')][_0xe1e6('0x8a')][0x0];if(_0x261e44[_0xe1e6('0x29')]['groupName']===_0xe1e6('0xc6')){return _0x58ba21[_0xe1e6('0x31')]({'read':!![]});}else{logger[_0xe1e6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe1e6('0xcb'),util[_0xe1e6('0xc1')](_0x48580b['body'],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0x8f'):if(_0x1b33cc==_0xe1e6('0xcc')||_0x1b33cc==_0xe1e6('0xcd')){return _0x58ba21[_0xe1e6('0x31')]({'read':!![]});}else{logger[_0xe1e6('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe1e6('0x8f'),util['inspect'](_0x48580b[_0xe1e6('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0x91'):if(_0x1b33cc=='message-delivered'){return _0x58ba21['update']({'read':!![]});}else{logger[_0xe1e6('0x24')](_0xe1e6('0x22'),_0xe1e6('0x29'),_0xe1e6('0x91'),util['inspect'](_0x48580b[_0xe1e6('0x57')],{'showHidden':![],'depth':null}));}break;case _0xe1e6('0xc8'):if(_0x1b33cc===_0xe1e6('0xce')||_0x1b33cc==='ACCEPTD'){return _0x58ba21['update']({'read':!![]});}else{logger[_0xe1e6('0x24')](_0xe1e6('0x22'),_0xe1e6('0x29'),_0xe1e6('0xc8'),util[_0xe1e6('0xc1')](_0x48580b['body'],{'showHidden':![],'depth':null}));}break;}return _0x58ba21;}})[_0xe1e6('0x32')](respondWithResult(_0x1accaa,null))[_0xe1e6('0x27')](handleError(_0x1accaa,null));};exports[_0xe1e6('0xcf')]=function(_0x19b52d,_0x2383d2,_0x5cc4bf){var _0x6ed8f8,_0x1d9108,_0x2714a1;return db[_0xe1e6('0x3c')][_0xe1e6('0x55')]({'where':{'id':_0x19b52d[_0xe1e6('0x51')]['id']}})['then'](handleEntityNotFound(_0x2383d2,null))['then'](function(_0x5a7657){if(_0x5a7657){_0x2714a1=_0x5a7657;logger[_0xe1e6('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe1e6('0xc0'),_0x5a7657[_0xe1e6('0x3e')],util['inspect'](_0x19b52d[_0xe1e6('0x41')],{'showHidden':![],'depth':null}));switch(_0x5a7657[_0xe1e6('0x3e')]){case _0xe1e6('0x8c'):if(_0x19b52d[_0xe1e6('0x41')][_0xe1e6('0xd0')]&&_0x19b52d[_0xe1e6('0x41')][_0xe1e6('0xd1')]){_0x1d9108=_0x19b52d[_0xe1e6('0x41')][_0xe1e6('0xd1')];return db[_0xe1e6('0xbc')][_0xe1e6('0x55')]({'where':{'messageId':_0x19b52d[_0xe1e6('0x41')][_0xe1e6('0xd0')]}});}break;}}})[_0xe1e6('0x32')](handleEntityNotFound(_0x2383d2,null))[_0xe1e6('0x32')](function(_0x8931f1){if(_0x8931f1){_0x6ed8f8=_0x8931f1;switch(_0x2714a1[_0xe1e6('0x3e')]){case _0xe1e6('0x8c'):if(_0x1d9108==='2'||_0x1d9108==='6'){return _0x6ed8f8['update']({'read':!![]});}else{logger[_0xe1e6('0x24')](_0xe1e6('0x22'),'status','csc',util[_0xe1e6('0xc1')](_0x19b52d['query'],{'showHidden':![],'depth':null}));};break;}return _0x6ed8f8;}})[_0xe1e6('0x32')](respondWithResult(_0x2383d2,null))['catch'](handleError(_0x2383d2,null));};exports[_0xe1e6('0xd2')]=function(_0x37876a,_0x4d5790,_0x475bfa){return db[_0xe1e6('0x3c')]['find']({'where':{'id':_0x37876a[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x4d5790,null))[_0xe1e6('0x32')](function(_0x32f3b1){if(_0x32f3b1){return _0x32f3b1[_0xe1e6('0xd2')](_0x37876a[_0xe1e6('0x57')]['ids'],_[_0xe1e6('0x9a')](_0x37876a['body'],[_0xe1e6('0x67'),'id'])||{})[_0xe1e6('0xbe')](function(_0x284e1c){for(var _0x182eb1=0x0;_0x182eb1<_0x37876a['body'][_0xe1e6('0x67')][_0xe1e6('0x53')];_0x182eb1+=0x1){socket[_0xe1e6('0xd3')](_0xe1e6('0xd4'),{'UserId':Number(_0x37876a[_0xe1e6('0x57')][_0xe1e6('0x67')][_0x182eb1]),'SmsAccountId':Number(_0x37876a['params']['id'])});}return _0x284e1c;});}})['then'](respondWithResult(_0x4d5790,null))[_0xe1e6('0x27')](handleError(_0x4d5790,null));};exports[_0xe1e6('0xd5')]=function(_0x2dc6e2,_0x261db0,_0x9bac0c){return db['SmsAccount'][_0xe1e6('0x55')]({'where':{'id':_0x2dc6e2[_0xe1e6('0x51')]['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x261db0,null))['then'](function(_0x45483e){if(_0x45483e){return _0x45483e['removeAgents'](_0x2dc6e2[_0xe1e6('0x41')]['ids'])[_0xe1e6('0x32')](function(){if(_[_0xe1e6('0xd6')](_0x2dc6e2['query'][_0xe1e6('0x67')])){for(var _0x78e008=0x0;_0x78e008<_0x2dc6e2[_0xe1e6('0x41')][_0xe1e6('0x67')][_0xe1e6('0x53')];_0x78e008+=0x1){socket[_0xe1e6('0xd3')](_0xe1e6('0xd7'),{'UserId':Number(_0x2dc6e2[_0xe1e6('0x41')][_0xe1e6('0x67')][_0x78e008]),'SmsAccountId':Number(_0x2dc6e2[_0xe1e6('0x51')]['id'])});}}else{socket[_0xe1e6('0xd3')]('userSmsAccount:remove',{'UserId':Number(_0x2dc6e2['query'][_0xe1e6('0x67')]),'SmsAccountId':Number(_0x2dc6e2[_0xe1e6('0x51')]['id'])});}});}})[_0xe1e6('0x32')](respondWithStatusCode(_0x261db0,null))['catch'](handleError(_0x261db0,null));};exports['getAgents']=function(_0xb789b4,_0x3b72bc,_0x539c98){var _0x22164b={};var _0x554080={};var _0x18329d;var _0x14b9a1;return db['SmsAccount'][_0xe1e6('0x61')]({'where':{'id':_0xb789b4['params']['id']}})[_0xe1e6('0x32')](handleEntityNotFound(_0x3b72bc,null))['then'](function(_0x42a84e){if(_0x42a84e){_0x18329d=_0x42a84e;_0x554080[_0xe1e6('0x40')]=_[_0xe1e6('0x42')](db[_0xe1e6('0xa4')]['rawAttributes']);_0x554080[_0xe1e6('0x41')]=_[_0xe1e6('0x42')](_0xb789b4[_0xe1e6('0x41')]);_0x554080[_0xe1e6('0x43')]=_[_0xe1e6('0x44')](_0x554080[_0xe1e6('0x40')],_0x554080['query']);_0x22164b[_0xe1e6('0x46')]=_[_0xe1e6('0x44')](_0x554080[_0xe1e6('0x40')],qs[_0xe1e6('0x45')](_0xb789b4['query'][_0xe1e6('0x45')]));_0x22164b[_0xe1e6('0x46')]=_0x22164b[_0xe1e6('0x46')][_0xe1e6('0x53')]?_0x22164b['attributes']:_0x554080['model'];_0x22164b['order']=qs[_0xe1e6('0x64')](_0xb789b4[_0xe1e6('0x41')][_0xe1e6('0x64')]);_0x22164b[_0xe1e6('0x49')]=qs[_0xe1e6('0x43')](_[_0xe1e6('0x65')](_0xb789b4['query'],_0x554080[_0xe1e6('0x43')]));if(_0xb789b4[_0xe1e6('0x41')]['filter']){_0x22164b[_0xe1e6('0x49')]=_['merge'](_0x22164b[_0xe1e6('0x49')],{'$or':_[_0xe1e6('0x3b')](_0x22164b['attributes'],function(_0x45a3aa){var _0x117dbe={};_0x117dbe[_0x45a3aa]={'$like':'%'+_0xb789b4[_0xe1e6('0x41')][_0xe1e6('0x48')]+'%'};return _0x117dbe;})});}_0x22164b=_[_0xe1e6('0x4b')]({},_0x22164b,_0xb789b4[_0xe1e6('0x4c')]);return _0x18329d['getAgents'](_0x22164b);}})[_0xe1e6('0x32')](function(_0x328087){if(_0x328087){_0x14b9a1=_0x328087[_0xe1e6('0x53')];if(!_0xb789b4[_0xe1e6('0x41')]['hasOwnProperty'](_0xe1e6('0x63'))){_0x22164b[_0xe1e6('0x2e')]=qs[_0xe1e6('0x2e')](_0xb789b4[_0xe1e6('0x41')][_0xe1e6('0x2e')]);_0x22164b[_0xe1e6('0x2b')]=qs[_0xe1e6('0x2b')](_0xb789b4[_0xe1e6('0x41')][_0xe1e6('0x2b')]);}return _0x18329d[_0xe1e6('0xd8')](_0x22164b);}})[_0xe1e6('0x32')](function(_0x3e084c){if(_0x3e084c){return _0x3e084c?{'count':_0x14b9a1,'rows':_0x3e084c}:null;}})[_0xe1e6('0x32')](respondWithResult(_0x3b72bc,null))[_0xe1e6('0x27')](handleError(_0x3b72bc,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a7cece9..1b2ac55 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 _0xe8a3=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x12b9a5,_0x51e4c7){var _0x37a4e6=function(_0x2c64b6){while(--_0x2c64b6){_0x12b9a5['push'](_0x12b9a5['shift']());}};_0x37a4e6(++_0x51e4c7);}(_0xe8a3,0x16d));var _0x3e8a=function(_0x3d0e12,_0x41e165){_0x3d0e12=_0x3d0e12-0x0;var _0x22da51=_0xe8a3[_0x3d0e12];return _0x22da51;};'use strict';var EventEmitter=require(_0x3e8a('0x0'));var SmsAccount=require(_0x3e8a('0x1'))['db'][_0x3e8a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x3e8a('0x3')](0x0);var events={'afterCreate':_0x3e8a('0x4'),'afterUpdate':_0x3e8a('0x5'),'afterDestroy':_0x3e8a('0x6')};function emitEvent(_0x4c27b2){return function(_0x114607,_0x132e79,_0xee498f){SmsAccountEvents[_0x3e8a('0x7')](_0x4c27b2+':'+_0x114607['id'],_0x114607);SmsAccountEvents['emit'](_0x4c27b2,_0x114607);_0xee498f(null);};}for(var e in events){if(events[_0x3e8a('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x3e8a('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xb51d=['SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5bbdde,_0x80d988){var _0x4b9cb3=function(_0x5102a2){while(--_0x5102a2){_0x5bbdde['push'](_0x5bbdde['shift']());}};_0x4b9cb3(++_0x80d988);}(_0xb51d,0x6c));var _0xdb51=function(_0x11a063,_0x3166b3){_0x11a063=_0x11a063-0x0;var _0x5ca6e7=_0xb51d[_0x11a063];return _0x5ca6e7;};'use strict';var EventEmitter=require(_0xdb51('0x0'));var SmsAccount=require(_0xdb51('0x1'))['db'][_0xdb51('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xdb51('0x3')](0x0);var events={'afterCreate':_0xdb51('0x4'),'afterUpdate':'update','afterDestroy':_0xdb51('0x5')};function emitEvent(_0x24d760){return function(_0x91437,_0x386244,_0x4c4ca5){SmsAccountEvents[_0xdb51('0x6')](_0x24d760+':'+_0x91437['id'],_0x91437);SmsAccountEvents[_0xdb51('0x6')](_0x24d760,_0x91437);_0x4c4ca5(null);};}for(var e in events){if(events[_0xdb51('0x7')](e)){var event=events[e];SmsAccount[_0xdb51('0x8')](e,emitEvent(event));}}module[_0xdb51('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 52aabbe..2fc8acf 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 _0x2b44=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x6df724,_0x12971d){var _0x3a8cc0=function(_0x162799){while(--_0x162799){_0x6df724['push'](_0x6df724['shift']());}};_0x3a8cc0(++_0x12971d);}(_0x2b44,0xaa));var _0x42b4=function(_0x40746d,_0x38e58f){_0x40746d=_0x40746d-0x0;var _0x387bb6=_0x2b44[_0x40746d];return _0x387bb6;};'use strict';var _=require(_0x42b4('0x0'));var util=require(_0x42b4('0x1'));var logger=require(_0x42b4('0x2'))(_0x42b4('0x3'));var moment=require(_0x42b4('0x4'));var BPromise=require(_0x42b4('0x5'));var rp=require(_0x42b4('0x6'));var fs=require('fs');var path=require(_0x42b4('0x7'));var rimraf=require(_0x42b4('0x8'));var config=require(_0x42b4('0x9'));var attributes=require('./smsAccount.attributes');module[_0x42b4('0xa')]=function(_0x20f19e,_0x33f8a4){return _0x20f19e[_0x42b4('0xb')](_0x42b4('0xc'),attributes,{'tableName':_0x42b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3611=['../../config/environment','exports','define','sms_accounts','lodash','api','request-promise','path','rimraf'];(function(_0x5d8aa0,_0x384b55){var _0x5ee034=function(_0x53035e){while(--_0x53035e){_0x5d8aa0['push'](_0x5d8aa0['shift']());}};_0x5ee034(++_0x384b55);}(_0x3611,0x136));var _0x1361=function(_0xf550ef,_0xe91e1a){_0xf550ef=_0xf550ef-0x0;var _0x177d24=_0x3611[_0xf550ef];return _0x177d24;};'use strict';var _=require(_0x1361('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1361('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1361('0x2'));var fs=require('fs');var path=require(_0x1361('0x3'));var rimraf=require(_0x1361('0x4'));var config=require(_0x1361('0x5'));var attributes=require('./smsAccount.attributes');module[_0x1361('0x6')]=function(_0x304832,_0x5aa5dc){return _0x304832[_0x1361('0x7')]('SmsAccount',attributes,{'tableName':_0x1361('0x8'),'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 2f8bdea..04a9023 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 _0xdea2=['options','where','include','map','model','attributes','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','SmsAccount'];(function(_0x3ebcab,_0x482df2){var _0x4074d3=function(_0x43ec1a){while(--_0x43ec1a){_0x3ebcab['push'](_0x3ebcab['shift']());}};_0x4074d3(++_0x482df2);}(_0xdea2,0xe5));var _0x2dea=function(_0x7f1086,_0x434356){_0x7f1086=_0x7f1086-0x0;var _0x358a47=_0xdea2[_0x7f1086];return _0x358a47;};'use strict';var _=require(_0x2dea('0x0'));var util=require(_0x2dea('0x1'));var moment=require(_0x2dea('0x2'));var BPromise=require(_0x2dea('0x3'));var rs=require(_0x2dea('0x4'));var fs=require('fs');var Redis=require(_0x2dea('0x5'));var db=require(_0x2dea('0x6'))['db'];var utils=require(_0x2dea('0x7'));var logger=require(_0x2dea('0x8'))(_0x2dea('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2dea('0xa')][_0x2dea('0xb')]({'port':0x232a});config[_0x2dea('0xc')]=_[_0x2dea('0xd')](config[_0x2dea('0xc')],{'host':_0x2dea('0xe'),'port':0x18eb});var socket=require(_0x2dea('0xf'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x2dea('0x10')](socket);function respondWithRpcPromise(_0x159823,_0x1511be,_0x25dff0){return new BPromise(function(_0x41dc2f,_0x109c63){return client[_0x2dea('0x11')](_0x159823,_0x25dff0)[_0x2dea('0x12')](function(_0x59c740){logger[_0x2dea('0x13')]('SmsAccount,\x20%s,\x20%s',_0x1511be,_0x2dea('0x14'));logger[_0x2dea('0x15')](_0x2dea('0x16'),_0x1511be,_0x2dea('0x14'),JSON[_0x2dea('0x17')](_0x59c740));if(_0x59c740[_0x2dea('0x18')]){if(_0x59c740[_0x2dea('0x18')]['code']===0x1f4){logger['error'](_0x2dea('0x19'),_0x1511be,_0x59c740[_0x2dea('0x18')][_0x2dea('0x1a')]);return _0x109c63(_0x59c740[_0x2dea('0x18')]['message']);}logger[_0x2dea('0x18')](_0x2dea('0x19'),_0x1511be,_0x59c740['error'][_0x2dea('0x1a')]);return _0x41dc2f(_0x59c740[_0x2dea('0x18')][_0x2dea('0x1a')]);}else{logger['info'](_0x2dea('0x19'),_0x1511be,'request\x20sent');_0x41dc2f(_0x59c740[_0x2dea('0x1b')][_0x2dea('0x1a')]);}})[_0x2dea('0x1c')](function(_0x53cb7c){logger[_0x2dea('0x18')]('SmsAccount,\x20%s,\x20%s',_0x1511be,_0x53cb7c);_0x109c63(_0x53cb7c);});});}exports['ShowSmsAccount']=function(_0x52dcf3){var _0x443b43=this;return new Promise(function(_0x2eed02,_0x382a74){return db[_0x2dea('0x1d')]['find']({'raw':_0x52dcf3[_0x2dea('0x1e')]?_0x52dcf3[_0x2dea('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x52dcf3[_0x2dea('0x1e')]?_0x52dcf3['options'][_0x2dea('0x1f')]||null:null,'attributes':_0x52dcf3[_0x2dea('0x1e')]?_0x52dcf3[_0x2dea('0x1e')]['attributes']||null:null,'include':_0x52dcf3[_0x2dea('0x1e')]?_0x52dcf3['options'][_0x2dea('0x20')]?_[_0x2dea('0x21')](_0x52dcf3[_0x2dea('0x1e')][_0x2dea('0x20')],function(_0x41b9ae){return{'model':db[_0x41b9ae[_0x2dea('0x22')]],'as':_0x41b9ae['as'],'attributes':_0x41b9ae[_0x2dea('0x23')],'include':_0x41b9ae[_0x2dea('0x20')]?_[_0x2dea('0x21')](_0x41b9ae[_0x2dea('0x20')],function(_0x4e4266){return{'model':db[_0x4e4266[_0x2dea('0x22')]],'as':_0x4e4266['as'],'attributes':_0x4e4266[_0x2dea('0x23')],'include':_0x4e4266[_0x2dea('0x20')]?_[_0x2dea('0x21')](_0x4e4266[_0x2dea('0x20')],function(_0x29653a){return{'model':db[_0x29653a[_0x2dea('0x22')]],'as':_0x29653a['as'],'attributes':_0x29653a[_0x2dea('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2dea('0x12')](function(_0x128302){logger['info']('ShowSmsAccount',_0x52dcf3);logger[_0x2dea('0x15')]('ShowSmsAccount',_0x52dcf3,JSON['stringify'](_0x128302));_0x2eed02(_0x128302);})[_0x2dea('0x1c')](function(_0x1b034a){logger[_0x2dea('0x18')](_0x2dea('0x24'),_0x1b034a[_0x2dea('0x1a')],_0x52dcf3);_0x382a74(_0x443b43[_0x2dea('0x18')](0x1f4,_0x1b034a[_0x2dea('0x1a')]));});});}; \ No newline at end of file +var _0x82db=['error','code','message','SmsAccount,\x20%s,\x20%s','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d3af6,_0x51a040){var _0x51cff7=function(_0x3091cf){while(--_0x3091cf){_0x1d3af6['push'](_0x1d3af6['shift']());}};_0x51cff7(++_0x51a040);}(_0x82db,0xce));var _0xb82d=function(_0x43871f,_0x2551ae){_0x43871f=_0x43871f-0x0;var _0x485917=_0x82db[_0x43871f];return _0x485917;};'use strict';var _=require(_0xb82d('0x0'));var util=require(_0xb82d('0x1'));var moment=require(_0xb82d('0x2'));var BPromise=require(_0xb82d('0x3'));var rs=require(_0xb82d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb82d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb82d('0x6'))(_0xb82d('0x7'));var config=require(_0xb82d('0x8'));var jayson=require(_0xb82d('0x9'));var client=jayson[_0xb82d('0xa')]['http']({'port':0x232a});config[_0xb82d('0xb')]=_[_0xb82d('0xc')](config['redis'],{'host':_0xb82d('0xd'),'port':0x18eb});var socket=require(_0xb82d('0xe'))(new Redis(config[_0xb82d('0xb')]));require(_0xb82d('0xf'))[_0xb82d('0x10')](socket);function respondWithRpcPromise(_0x1e05b4,_0x2e54eb,_0xc3b232){return new BPromise(function(_0x164f41,_0x2e3ae6){return client[_0xb82d('0x11')](_0x1e05b4,_0xc3b232)['then'](function(_0x52057c){logger[_0xb82d('0x12')]('SmsAccount,\x20%s,\x20%s',_0x2e54eb,_0xb82d('0x13'));logger['debug'](_0xb82d('0x14'),_0x2e54eb,_0xb82d('0x13'),JSON[_0xb82d('0x15')](_0x52057c));if(_0x52057c[_0xb82d('0x16')]){if(_0x52057c[_0xb82d('0x16')][_0xb82d('0x17')]===0x1f4){logger[_0xb82d('0x16')]('SmsAccount,\x20%s,\x20%s',_0x2e54eb,_0x52057c[_0xb82d('0x16')][_0xb82d('0x18')]);return _0x2e3ae6(_0x52057c[_0xb82d('0x16')][_0xb82d('0x18')]);}logger[_0xb82d('0x16')](_0xb82d('0x19'),_0x2e54eb,_0x52057c[_0xb82d('0x16')][_0xb82d('0x18')]);return _0x164f41(_0x52057c['error'][_0xb82d('0x18')]);}else{logger[_0xb82d('0x12')](_0xb82d('0x19'),_0x2e54eb,_0xb82d('0x13'));_0x164f41(_0x52057c['result']['message']);}})[_0xb82d('0x1a')](function(_0x56670d){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2e54eb,_0x56670d);_0x2e3ae6(_0x56670d);});});}exports[_0xb82d('0x1b')]=function(_0x30430e){var _0x357130=this;return new Promise(function(_0x38b427,_0x1edfac){return db[_0xb82d('0x1c')][_0xb82d('0x1d')]({'raw':_0x30430e[_0xb82d('0x1e')]?_0x30430e[_0xb82d('0x1e')][_0xb82d('0x1f')]===undefined?!![]:![]:!![],'where':_0x30430e[_0xb82d('0x1e')]?_0x30430e[_0xb82d('0x1e')]['where']||null:null,'attributes':_0x30430e['options']?_0x30430e[_0xb82d('0x1e')][_0xb82d('0x20')]||null:null,'include':_0x30430e[_0xb82d('0x1e')]?_0x30430e[_0xb82d('0x1e')][_0xb82d('0x21')]?_[_0xb82d('0x22')](_0x30430e[_0xb82d('0x1e')][_0xb82d('0x21')],function(_0x41cc70){return{'model':db[_0x41cc70['model']],'as':_0x41cc70['as'],'attributes':_0x41cc70[_0xb82d('0x20')],'include':_0x41cc70['include']?_[_0xb82d('0x22')](_0x41cc70[_0xb82d('0x21')],function(_0x41d437){return{'model':db[_0x41d437[_0xb82d('0x23')]],'as':_0x41d437['as'],'attributes':_0x41d437[_0xb82d('0x20')],'include':_0x41d437[_0xb82d('0x21')]?_[_0xb82d('0x22')](_0x41d437['include'],function(_0x42a5f7){return{'model':db[_0x42a5f7[_0xb82d('0x23')]],'as':_0x42a5f7['as'],'attributes':_0x42a5f7[_0xb82d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb82d('0x24')](function(_0x4e88d0){logger['info'](_0xb82d('0x1b'),_0x30430e);logger[_0xb82d('0x25')](_0xb82d('0x1b'),_0x30430e,JSON[_0xb82d('0x15')](_0x4e88d0));_0x38b427(_0x4e88d0);})['catch'](function(_0x545a3d){logger[_0xb82d('0x16')]('ShowSmsAccount',_0x545a3d[_0xb82d('0x18')],_0x30430e);_0x1edfac(_0x357130['error'](0x1f4,_0x545a3d[_0xb82d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 96217a9..5730e6c 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 769d2c7..a363972 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x33da72,_0x53101c){var _0x437fb8=function(_0xf1e820){while(--_0xf1e820){_0x33da72['push'](_0x33da72['shift']());}};_0x437fb8(++_0x53101c);}(_0x55ca,0x126));var _0xa55c=function(_0x1defb2,_0x429099){_0x1defb2=_0x1defb2-0x0;var _0xad8973=_0x55ca[_0x1defb2];return _0xad8973;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0xd52290,_0x2ef3a3){var _0x3b66a4=function(_0x50a7a3){while(--_0x50a7a3){_0xd52290['push'](_0xd52290['shift']());}};_0x3b66a4(++_0x2ef3a3);}(_0x55ca,0x126));var _0xa55c=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0x55ca[_0x3cbe1c];return _0x5ee08b;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 1258873..d05b4b0 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 _0x80bd=['STRING','TEXT','*,*,*,*','INTEGER'];(function(_0x4ef402,_0x58c632){var _0x44b661=function(_0x70dfe3){while(--_0x70dfe3){_0x4ef402['push'](_0x4ef402['shift']());}};_0x44b661(++_0x58c632);}(_0x80bd,0x1bf));var _0xd80b=function(_0x1eb804,_0x351f0c){_0x1eb804=_0x1eb804-0x0;var _0x371c49=_0x80bd[_0x1eb804];return _0x371c49;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd80b('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xd80b('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd80b('0x2')]()},'description':{'type':Sequelize[_0xd80b('0x1')]},'interval':{'type':Sequelize[_0xd80b('0x1')],'defaultValue':_0xd80b('0x3')}}; \ No newline at end of file +var _0xd371=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0xe0ad97,_0x484d65){var _0x2b978e=function(_0x34af26){while(--_0x34af26){_0xe0ad97['push'](_0xe0ad97['shift']());}};_0x2b978e(++_0x484d65);}(_0xd371,0x101));var _0x1d37=function(_0x55ff21,_0x1540f0){_0x55ff21=_0x55ff21-0x0;var _0x4baf37=_0xd371[_0x55ff21];return _0x4baf37;};'use strict';var Sequelize=require(_0x1d37('0x0'));module[_0x1d37('0x1')]={'priority':{'type':Sequelize[_0x1d37('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1d37('0x3')],'allowNull':![],'defaultValue':_0x1d37('0x4')},'appdata':{'type':Sequelize[_0x1d37('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1d37('0x3')],'defaultValue':_0x1d37('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index f10af43..b949987 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 _0x77a0=['offset','set','json','apply','save','then','destroy','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count'];(function(_0x4f57e4,_0x18914d){var _0x4a584c=function(_0x312dcb){while(--_0x312dcb){_0x4f57e4['push'](_0x4f57e4['shift']());}};_0x4a584c(++_0x18914d);}(_0x77a0,0x1db));var _0x077a=function(_0x2c3a9a,_0x5c5c0d){_0x2c3a9a=_0x2c3a9a-0x0;var _0x5df4b0=_0x77a0[_0x2c3a9a];return _0x5df4b0;};'use strict';var emlformat=require(_0x077a('0x0'));var rimraf=require(_0x077a('0x1'));var zipdir=require(_0x077a('0x2'));var jsonpatch=require(_0x077a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x077a('0x4'));var Mustache=require(_0x077a('0x5'));var util=require(_0x077a('0x6'));var path=require('path');var sox=require(_0x077a('0x7'));var csv=require(_0x077a('0x8'));var ejs=require(_0x077a('0x9'));var fs=require('fs');var fs_extra=require(_0x077a('0xa'));var _=require(_0x077a('0xb'));var squel=require(_0x077a('0xc'));var crypto=require(_0x077a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x077a('0xe'));var toCsv=require(_0x077a('0x8'));var querystring=require(_0x077a('0xf'));var Papa=require(_0x077a('0x10'));var Redis=require(_0x077a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x077a('0x12'));var logger=require(_0x077a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x077a('0x14'));var licenseUtil=require(_0x077a('0x15'));var db=require(_0x077a('0x16'))['db'];function respondWithStatusCode(_0x50a980,_0x590bf2){_0x590bf2=_0x590bf2||0xcc;return function(_0x3ae723){if(_0x3ae723){return _0x50a980[_0x077a('0x17')](_0x590bf2);}return _0x50a980[_0x077a('0x18')](_0x590bf2)[_0x077a('0x19')]();};}function respondWithResult(_0x252434,_0x22584d){_0x22584d=_0x22584d||0xc8;return function(_0x916974){if(_0x916974){return _0x252434[_0x077a('0x18')](_0x22584d)['json'](_0x916974);}};}function respondWithFilteredResult(_0x1f4d2e,_0x26d9d1){return function(_0x4a923e){if(_0x4a923e){var _0x535a7b=typeof _0x26d9d1['offset']===_0x077a('0x1a')&&typeof _0x26d9d1[_0x077a('0x1b')]===_0x077a('0x1a');var _0x4913df=_0x4a923e[_0x077a('0x1c')];var _0x543fdf=_0x535a7b?0x0:_0x26d9d1[_0x077a('0x1d')];var _0x3e2c58=_0x535a7b?_0x4a923e['count']:_0x26d9d1[_0x077a('0x1d')]+_0x26d9d1[_0x077a('0x1b')];var _0x205739;if(_0x3e2c58>=_0x4913df){_0x3e2c58=_0x4913df;_0x205739=0xc8;}else{_0x205739=0xce;}_0x1f4d2e[_0x077a('0x18')](_0x205739);return _0x1f4d2e[_0x077a('0x1e')]('Content-Range',_0x543fdf+'-'+_0x3e2c58+'/'+_0x4913df)[_0x077a('0x1f')](_0x4a923e);}return null;};}function patchUpdates(_0x3ec5d7){return function(_0x1b73dc){try{jsonpatch[_0x077a('0x20')](_0x1b73dc,_0x3ec5d7,!![]);}catch(_0x140e12){return BPromise['reject'](_0x140e12);}return _0x1b73dc[_0x077a('0x21')]();};}function saveUpdates(_0x453e9b,_0x151cc0){return function(_0x594b2e){if(_0x594b2e){return _0x594b2e['update'](_0x453e9b)[_0x077a('0x22')](function(_0x1e3f99){return _0x1e3f99;});}return null;};}function removeEntity(_0x59f676,_0x1ef5de){return function(_0x3883c5){if(_0x3883c5){return _0x3883c5[_0x077a('0x23')]()[_0x077a('0x22')](function(){_0x59f676[_0x077a('0x18')](0xcc)[_0x077a('0x19')]();});}};}function handleEntityNotFound(_0x250cfe,_0x20a9c1){return function(_0x48adac){if(!_0x48adac){_0x250cfe[_0x077a('0x17')](0x194);}return _0x48adac;};}function handleError(_0x274029,_0x111a4b){_0x111a4b=_0x111a4b||0x1f4;return function(_0x5d9a25){logger[_0x077a('0x24')](_0x5d9a25['stack']);if(_0x5d9a25[_0x077a('0x25')]){delete _0x5d9a25[_0x077a('0x25')];}_0x274029[_0x077a('0x18')](_0x111a4b)[_0x077a('0x26')](_0x5d9a25);};}exports[_0x077a('0x27')]=function(_0x4609e2,_0x58a91b){var _0x1e26a9={},_0x514b24={},_0x3c9b1a={'count':0x0,'rows':[]};var _0x4e48dc=_[_0x077a('0x28')](db[_0x077a('0x29')][_0x077a('0x2a')],function(_0x105e57){return{'name':_0x105e57[_0x077a('0x2b')],'type':_0x105e57['type'][_0x077a('0x2c')]};});_0x514b24[_0x077a('0x2d')]=_[_0x077a('0x28')](_0x4e48dc,'name');_0x514b24['query']=_[_0x077a('0x2e')](_0x4609e2[_0x077a('0x2f')]);_0x514b24[_0x077a('0x30')]=_[_0x077a('0x31')](_0x514b24[_0x077a('0x2d')],_0x514b24[_0x077a('0x2f')]);_0x1e26a9[_0x077a('0x32')]=_[_0x077a('0x31')](_0x514b24[_0x077a('0x2d')],qs[_0x077a('0x33')](_0x4609e2['query'][_0x077a('0x33')]));_0x1e26a9[_0x077a('0x32')]=_0x1e26a9[_0x077a('0x32')][_0x077a('0x34')]?_0x1e26a9[_0x077a('0x32')]:_0x514b24[_0x077a('0x2d')];if(!_0x4609e2[_0x077a('0x2f')][_0x077a('0x35')](_0x077a('0x36'))){_0x1e26a9[_0x077a('0x1b')]=qs['limit'](_0x4609e2[_0x077a('0x2f')][_0x077a('0x1b')]);_0x1e26a9['offset']=qs[_0x077a('0x1d')](_0x4609e2[_0x077a('0x2f')]['offset']);}_0x1e26a9[_0x077a('0x37')]=qs['sort'](_0x4609e2[_0x077a('0x2f')][_0x077a('0x38')]);_0x1e26a9['where']=qs[_0x077a('0x30')](_['pick'](_0x4609e2[_0x077a('0x2f')],_0x514b24[_0x077a('0x30')]),_0x4e48dc);if(_0x4609e2[_0x077a('0x2f')]['filter']){_0x1e26a9[_0x077a('0x39')]=_[_0x077a('0x3a')](_0x1e26a9[_0x077a('0x39')],{'$or':_[_0x077a('0x28')](_0x4e48dc,function(_0x497ac4){if(_0x497ac4[_0x077a('0x3b')]!==_0x077a('0x3c')){var _0x4c5fbf={};_0x4c5fbf[_0x497ac4[_0x077a('0x25')]]={'$like':'%'+_0x4609e2['query'][_0x077a('0x3d')]+'%'};return _0x4c5fbf;}})});}_0x1e26a9=_['merge']({},_0x1e26a9,_0x4609e2[_0x077a('0x3e')]);var _0x51c4f3={'where':_0x1e26a9['where']};return db[_0x077a('0x29')][_0x077a('0x1c')](_0x51c4f3)[_0x077a('0x22')](function(_0x5dccfb){_0x3c9b1a[_0x077a('0x1c')]=_0x5dccfb;if(_0x4609e2[_0x077a('0x2f')][_0x077a('0x3f')]){_0x1e26a9[_0x077a('0x40')]=[{'all':!![]}];}return db[_0x077a('0x29')]['findAll'](_0x1e26a9);})[_0x077a('0x22')](function(_0x28a85f){_0x3c9b1a[_0x077a('0x41')]=_0x28a85f;return _0x3c9b1a;})[_0x077a('0x22')](respondWithFilteredResult(_0x58a91b,_0x1e26a9))[_0x077a('0x42')](handleError(_0x58a91b,null));};exports['show']=function(_0xcc594f,_0x5e01f6){var _0x430823={'raw':!![],'where':{'id':_0xcc594f[_0x077a('0x43')]['id']}},_0xde8525={};_0xde8525[_0x077a('0x2d')]=_[_0x077a('0x2e')](db[_0x077a('0x29')][_0x077a('0x2a')]);_0xde8525[_0x077a('0x2f')]=_[_0x077a('0x2e')](_0xcc594f[_0x077a('0x2f')]);_0xde8525[_0x077a('0x30')]=_[_0x077a('0x31')](_0xde8525[_0x077a('0x2d')],_0xde8525[_0x077a('0x2f')]);_0x430823[_0x077a('0x32')]=_['intersection'](_0xde8525['model'],qs[_0x077a('0x33')](_0xcc594f[_0x077a('0x2f')][_0x077a('0x33')]));_0x430823[_0x077a('0x32')]=_0x430823[_0x077a('0x32')][_0x077a('0x34')]?_0x430823['attributes']:_0xde8525[_0x077a('0x2d')];if(_0xcc594f['query'][_0x077a('0x3f')]){_0x430823[_0x077a('0x40')]=[{'all':!![]}];}_0x430823=_[_0x077a('0x3a')]({},_0x430823,_0xcc594f[_0x077a('0x3e')]);return db['SmsApplication'][_0x077a('0x44')](_0x430823)[_0x077a('0x22')](handleEntityNotFound(_0x5e01f6,null))[_0x077a('0x22')](respondWithResult(_0x5e01f6,null))[_0x077a('0x42')](handleError(_0x5e01f6,null));};exports[_0x077a('0x45')]=function(_0x37c9f7,_0x436722){return db[_0x077a('0x29')]['create'](_0x37c9f7['body'],{})[_0x077a('0x22')](respondWithResult(_0x436722,0xc9))[_0x077a('0x42')](handleError(_0x436722,null));};exports[_0x077a('0x46')]=function(_0x4195f7,_0x112f42){if(_0x4195f7[_0x077a('0x47')]['id']){delete _0x4195f7[_0x077a('0x47')]['id'];}return db[_0x077a('0x29')][_0x077a('0x44')]({'where':{'id':_0x4195f7['params']['id']}})[_0x077a('0x22')](handleEntityNotFound(_0x112f42,null))['then'](saveUpdates(_0x4195f7[_0x077a('0x47')],null))[_0x077a('0x22')](respondWithResult(_0x112f42,null))[_0x077a('0x42')](handleError(_0x112f42,null));};exports[_0x077a('0x23')]=function(_0x58e2c6,_0x5f1d3a){return db[_0x077a('0x29')]['find']({'where':{'id':_0x58e2c6[_0x077a('0x43')]['id']}})[_0x077a('0x22')](handleEntityNotFound(_0x5f1d3a,null))[_0x077a('0x22')](removeEntity(_0x5f1d3a,null))[_0x077a('0x42')](handleError(_0x5f1d3a,null));}; \ No newline at end of file +var _0xbd06=['destroy','stack','name','send','index','map','SmsApplication','rawAttributes','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','length','merge','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x3935fd,_0xf2d9f7){var _0x48508a=function(_0x5af419){while(--_0x5af419){_0x3935fd['push'](_0x3935fd['shift']());}};_0x48508a(++_0xf2d9f7);}(_0xbd06,0x1a0));var _0x6bd0=function(_0x575f38,_0x486b23){_0x575f38=_0x575f38-0x0;var _0x516782=_0xbd06[_0x575f38];return _0x516782;};'use strict';var emlformat=require(_0x6bd0('0x0'));var rimraf=require(_0x6bd0('0x1'));var zipdir=require(_0x6bd0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bd0('0x3'));var moment=require('moment');var BPromise=require(_0x6bd0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6bd0('0x5'));var sox=require(_0x6bd0('0x6'));var csv=require('to-csv');var ejs=require(_0x6bd0('0x7'));var fs=require('fs');var fs_extra=require(_0x6bd0('0x8'));var _=require(_0x6bd0('0x9'));var squel=require(_0x6bd0('0xa'));var crypto=require(_0x6bd0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6bd0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6bd0('0xd'));var Papa=require(_0x6bd0('0xe'));var Redis=require(_0x6bd0('0xf'));var authService=require(_0x6bd0('0x10'));var qs=require(_0x6bd0('0x11'));var as=require(_0x6bd0('0x12'));var hardwareService=require(_0x6bd0('0x13'));var logger=require(_0x6bd0('0x14'))('api');var utils=require(_0x6bd0('0x15'));var config=require(_0x6bd0('0x16'));var licenseUtil=require(_0x6bd0('0x17'));var db=require(_0x6bd0('0x18'))['db'];function respondWithStatusCode(_0x140e49,_0x4cf176){_0x4cf176=_0x4cf176||0xcc;return function(_0x36e9fc){if(_0x36e9fc){return _0x140e49[_0x6bd0('0x19')](_0x4cf176);}return _0x140e49[_0x6bd0('0x1a')](_0x4cf176)[_0x6bd0('0x1b')]();};}function respondWithResult(_0x29bff2,_0x45f82d){_0x45f82d=_0x45f82d||0xc8;return function(_0x2d3828){if(_0x2d3828){return _0x29bff2[_0x6bd0('0x1a')](_0x45f82d)[_0x6bd0('0x1c')](_0x2d3828);}};}function respondWithFilteredResult(_0x4e8bb4,_0x18e7ff){return function(_0x561fff){if(_0x561fff){var _0x4845b9=typeof _0x18e7ff['offset']===_0x6bd0('0x1d')&&typeof _0x18e7ff[_0x6bd0('0x1e')]===_0x6bd0('0x1d');var _0x2a045f=_0x561fff[_0x6bd0('0x1f')];var _0x298944=_0x4845b9?0x0:_0x18e7ff[_0x6bd0('0x20')];var _0x26a4dd=_0x4845b9?_0x561fff[_0x6bd0('0x1f')]:_0x18e7ff[_0x6bd0('0x20')]+_0x18e7ff[_0x6bd0('0x1e')];var _0x4326a3;if(_0x26a4dd>=_0x2a045f){_0x26a4dd=_0x2a045f;_0x4326a3=0xc8;}else{_0x4326a3=0xce;}_0x4e8bb4[_0x6bd0('0x1a')](_0x4326a3);return _0x4e8bb4[_0x6bd0('0x21')](_0x6bd0('0x22'),_0x298944+'-'+_0x26a4dd+'/'+_0x2a045f)[_0x6bd0('0x1c')](_0x561fff);}return null;};}function patchUpdates(_0x2cf759){return function(_0x1c4e5f){try{jsonpatch[_0x6bd0('0x23')](_0x1c4e5f,_0x2cf759,!![]);}catch(_0x2cbc30){return BPromise[_0x6bd0('0x24')](_0x2cbc30);}return _0x1c4e5f[_0x6bd0('0x25')]();};}function saveUpdates(_0x8aec88,_0x10661c){return function(_0x382b52){if(_0x382b52){return _0x382b52[_0x6bd0('0x26')](_0x8aec88)[_0x6bd0('0x27')](function(_0x43f3d4){return _0x43f3d4;});}return null;};}function removeEntity(_0x2a91d4,_0x268fe3){return function(_0x1bd86e){if(_0x1bd86e){return _0x1bd86e[_0x6bd0('0x28')]()[_0x6bd0('0x27')](function(){_0x2a91d4[_0x6bd0('0x1a')](0xcc)[_0x6bd0('0x1b')]();});}};}function handleEntityNotFound(_0x165cf8,_0x587681){return function(_0x72433c){if(!_0x72433c){_0x165cf8[_0x6bd0('0x19')](0x194);}return _0x72433c;};}function handleError(_0x2e33ec,_0x1b5a7d){_0x1b5a7d=_0x1b5a7d||0x1f4;return function(_0x2ee2f7){logger['error'](_0x2ee2f7[_0x6bd0('0x29')]);if(_0x2ee2f7['name']){delete _0x2ee2f7[_0x6bd0('0x2a')];}_0x2e33ec[_0x6bd0('0x1a')](_0x1b5a7d)[_0x6bd0('0x2b')](_0x2ee2f7);};}exports[_0x6bd0('0x2c')]=function(_0x38df2b,_0x4ce475){var _0x1480b3={},_0x36e481={},_0x293b16={'count':0x0,'rows':[]};var _0x3c4e29=_[_0x6bd0('0x2d')](db[_0x6bd0('0x2e')][_0x6bd0('0x2f')],function(_0x3af1a8){return{'name':_0x3af1a8['fieldName'],'type':_0x3af1a8['type'][_0x6bd0('0x30')]};});_0x36e481[_0x6bd0('0x31')]=_[_0x6bd0('0x2d')](_0x3c4e29,_0x6bd0('0x2a'));_0x36e481[_0x6bd0('0x32')]=_[_0x6bd0('0x33')](_0x38df2b[_0x6bd0('0x32')]);_0x36e481[_0x6bd0('0x34')]=_['intersection'](_0x36e481[_0x6bd0('0x31')],_0x36e481[_0x6bd0('0x32')]);_0x1480b3[_0x6bd0('0x35')]=_['intersection'](_0x36e481[_0x6bd0('0x31')],qs[_0x6bd0('0x36')](_0x38df2b[_0x6bd0('0x32')]['fields']));_0x1480b3[_0x6bd0('0x35')]=_0x1480b3[_0x6bd0('0x35')]['length']?_0x1480b3[_0x6bd0('0x35')]:_0x36e481[_0x6bd0('0x31')];if(!_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x37')]('nolimit')){_0x1480b3['limit']=qs['limit'](_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x1e')]);_0x1480b3['offset']=qs[_0x6bd0('0x20')](_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x20')]);}_0x1480b3[_0x6bd0('0x38')]=qs['sort'](_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x39')]);_0x1480b3[_0x6bd0('0x3a')]=qs['filters'](_['pick'](_0x38df2b[_0x6bd0('0x32')],_0x36e481[_0x6bd0('0x34')]),_0x3c4e29);if(_0x38df2b['query'][_0x6bd0('0x3b')]){_0x1480b3['where']=_['merge'](_0x1480b3[_0x6bd0('0x3a')],{'$or':_[_0x6bd0('0x2d')](_0x3c4e29,function(_0x201f92){if(_0x201f92[_0x6bd0('0x3c')]!==_0x6bd0('0x3d')){var _0x3423e6={};_0x3423e6[_0x201f92[_0x6bd0('0x2a')]]={'$like':'%'+_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x3b')]+'%'};return _0x3423e6;}})});}_0x1480b3=_['merge']({},_0x1480b3,_0x38df2b['options']);var _0x44057a={'where':_0x1480b3[_0x6bd0('0x3a')]};return db[_0x6bd0('0x2e')][_0x6bd0('0x1f')](_0x44057a)[_0x6bd0('0x27')](function(_0x524c71){_0x293b16[_0x6bd0('0x1f')]=_0x524c71;if(_0x38df2b[_0x6bd0('0x32')][_0x6bd0('0x3e')]){_0x1480b3[_0x6bd0('0x3f')]=[{'all':!![]}];}return db[_0x6bd0('0x2e')][_0x6bd0('0x40')](_0x1480b3);})[_0x6bd0('0x27')](function(_0x56b77a){_0x293b16[_0x6bd0('0x41')]=_0x56b77a;return _0x293b16;})[_0x6bd0('0x27')](respondWithFilteredResult(_0x4ce475,_0x1480b3))[_0x6bd0('0x42')](handleError(_0x4ce475,null));};exports[_0x6bd0('0x43')]=function(_0x3facb5,_0x43fec1){var _0x30c1d8={'raw':!![],'where':{'id':_0x3facb5[_0x6bd0('0x44')]['id']}},_0x9669c6={};_0x9669c6[_0x6bd0('0x31')]=_[_0x6bd0('0x33')](db[_0x6bd0('0x2e')][_0x6bd0('0x2f')]);_0x9669c6[_0x6bd0('0x32')]=_[_0x6bd0('0x33')](_0x3facb5['query']);_0x9669c6['filters']=_[_0x6bd0('0x45')](_0x9669c6['model'],_0x9669c6[_0x6bd0('0x32')]);_0x30c1d8['attributes']=_[_0x6bd0('0x45')](_0x9669c6[_0x6bd0('0x31')],qs[_0x6bd0('0x36')](_0x3facb5[_0x6bd0('0x32')][_0x6bd0('0x36')]));_0x30c1d8[_0x6bd0('0x35')]=_0x30c1d8['attributes'][_0x6bd0('0x46')]?_0x30c1d8[_0x6bd0('0x35')]:_0x9669c6['model'];if(_0x3facb5[_0x6bd0('0x32')][_0x6bd0('0x3e')]){_0x30c1d8[_0x6bd0('0x3f')]=[{'all':!![]}];}_0x30c1d8=_[_0x6bd0('0x47')]({},_0x30c1d8,_0x3facb5[_0x6bd0('0x48')]);return db['SmsApplication'][_0x6bd0('0x49')](_0x30c1d8)[_0x6bd0('0x27')](handleEntityNotFound(_0x43fec1,null))[_0x6bd0('0x27')](respondWithResult(_0x43fec1,null))[_0x6bd0('0x42')](handleError(_0x43fec1,null));};exports['create']=function(_0x4e6aeb,_0x4d2841){return db[_0x6bd0('0x2e')][_0x6bd0('0x4a')](_0x4e6aeb['body'],{})[_0x6bd0('0x27')](respondWithResult(_0x4d2841,0xc9))[_0x6bd0('0x42')](handleError(_0x4d2841,null));};exports[_0x6bd0('0x26')]=function(_0x42751,_0x1f6dd4){if(_0x42751[_0x6bd0('0x4b')]['id']){delete _0x42751[_0x6bd0('0x4b')]['id'];}return db['SmsApplication'][_0x6bd0('0x49')]({'where':{'id':_0x42751[_0x6bd0('0x44')]['id']}})[_0x6bd0('0x27')](handleEntityNotFound(_0x1f6dd4,null))[_0x6bd0('0x27')](saveUpdates(_0x42751['body'],null))[_0x6bd0('0x27')](respondWithResult(_0x1f6dd4,null))[_0x6bd0('0x42')](handleError(_0x1f6dd4,null));};exports[_0x6bd0('0x28')]=function(_0x4fbfa2,_0x347c5d){return db[_0x6bd0('0x2e')][_0x6bd0('0x49')]({'where':{'id':_0x4fbfa2[_0x6bd0('0x44')]['id']}})[_0x6bd0('0x27')](handleEntityNotFound(_0x347c5d,null))[_0x6bd0('0x27')](removeEntity(_0x347c5d,null))['catch'](handleError(_0x347c5d,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9287216..9261bcf 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 _0x1ab8=['sms_applications','utf8mb4','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','define'];(function(_0x397e05,_0x1e606c){var _0x192709=function(_0x203dda){while(--_0x203dda){_0x397e05['push'](_0x397e05['shift']());}};_0x192709(++_0x1e606c);}(_0x1ab8,0x1e2));var _0x81ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1ab8[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x81ab('0x0'));var util=require(_0x81ab('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x81ab('0x2'));var rp=require(_0x81ab('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x81ab('0x4'));var config=require(_0x81ab('0x5'));var attributes=require(_0x81ab('0x6'));module['exports']=function(_0x17654c,_0x1e6b80){return _0x17654c[_0x81ab('0x7')]('SmsApplication',attributes,{'tableName':_0x81ab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x81ab('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfa33=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x4104a8,_0x46f488){var _0x3ba2e8=function(_0x5ccb42){while(--_0x5ccb42){_0x4104a8['push'](_0x4104a8['shift']());}};_0x3ba2e8(++_0x46f488);}(_0xfa33,0x1cb));var _0x3fa3=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0xfa33[_0x34325b];return _0x3da348;};'use strict';var _=require(_0x3fa3('0x0'));var util=require('util');var logger=require(_0x3fa3('0x1'))(_0x3fa3('0x2'));var moment=require(_0x3fa3('0x3'));var BPromise=require(_0x3fa3('0x4'));var rp=require(_0x3fa3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3fa3('0x6'));var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x3fa3('0x7')]=function(_0x8a2e47,_0x53797a){return _0x8a2e47[_0x3fa3('0x8')]('SmsApplication',attributes,{'tableName':_0x3fa3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fa3('0xa'),'collate':_0x3fa3('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index fdd6683..f0dd3f7 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 _0x77e6=['client','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4dbd07,_0x2cda47){var _0x286c93=function(_0x249c90){while(--_0x249c90){_0x4dbd07['push'](_0x4dbd07['shift']());}};_0x286c93(++_0x2cda47);}(_0x77e6,0x1a6));var _0x677e=function(_0x3b6e6a,_0x57c4a3){_0x3b6e6a=_0x3b6e6a-0x0;var _0x15f8f3=_0x77e6[_0x3b6e6a];return _0x15f8f3;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('SmsApplication,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});} \ No newline at end of file +var _0xdbb9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird'];(function(_0x283b6e,_0x3b47aa){var _0x6aa2c9=function(_0x2080bd){while(--_0x2080bd){_0x283b6e['push'](_0x283b6e['shift']());}};_0x6aa2c9(++_0x3b47aa);}(_0xdbb9,0xf9));var _0x9dbb=function(_0xd96213,_0x4d0016){_0xd96213=_0xd96213-0x0;var _0x221669=_0xdbb9[_0xd96213];return _0x221669;};'use strict';var _=require('lodash');var util=require(_0x9dbb('0x0'));var moment=require(_0x9dbb('0x1'));var BPromise=require(_0x9dbb('0x2'));var rs=require(_0x9dbb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dbb('0x4'))['db'];var utils=require(_0x9dbb('0x5'));var logger=require(_0x9dbb('0x6'))(_0x9dbb('0x7'));var config=require(_0x9dbb('0x8'));var jayson=require(_0x9dbb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x523a5e,_0x28c5c0,_0x391970){return new BPromise(function(_0x203da3,_0x485819){return client['request'](_0x523a5e,_0x391970)[_0x9dbb('0xa')](function(_0x3b7ecc){logger[_0x9dbb('0xb')]('SmsApplication,\x20%s,\x20%s',_0x28c5c0,_0x9dbb('0xc'));logger[_0x9dbb('0xd')](_0x9dbb('0xe'),_0x28c5c0,_0x9dbb('0xc'),JSON['stringify'](_0x3b7ecc));if(_0x3b7ecc[_0x9dbb('0xf')]){if(_0x3b7ecc[_0x9dbb('0xf')][_0x9dbb('0x10')]===0x1f4){logger[_0x9dbb('0xf')](_0x9dbb('0x11'),_0x28c5c0,_0x3b7ecc[_0x9dbb('0xf')][_0x9dbb('0x12')]);return _0x485819(_0x3b7ecc[_0x9dbb('0xf')][_0x9dbb('0x12')]);}logger[_0x9dbb('0xf')](_0x9dbb('0x11'),_0x28c5c0,_0x3b7ecc[_0x9dbb('0xf')][_0x9dbb('0x12')]);return _0x203da3(_0x3b7ecc[_0x9dbb('0xf')][_0x9dbb('0x12')]);}else{logger[_0x9dbb('0xb')]('SmsApplication,\x20%s,\x20%s',_0x28c5c0,_0x9dbb('0xc'));_0x203da3(_0x3b7ecc[_0x9dbb('0x13')][_0x9dbb('0x12')]);}})[_0x9dbb('0x14')](function(_0x28e5bf){logger['error'](_0x9dbb('0x11'),_0x28c5c0,_0x28e5bf);_0x485819(_0x28e5bf);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index da89555..d793b77 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 _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x4e5276,_0x27ae2d){var _0x4a3c4d=function(_0x2f279a){while(--_0x2f279a){_0x4e5276['push'](_0x4e5276['shift']());}};_0x4a3c4d(++_0x27ae2d);}(_0x5eb8,0xb0));var _0x85eb=function(_0xf2726b,_0x87deb7){_0xf2726b=_0xf2726b-0x0;var _0xa61a5=_0x5eb8[_0xf2726b];return _0xa61a5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router; \ No newline at end of file +var _0xf7b4=['/describe','describe','/:id','show','getMessages','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x1b7a13,_0x3ee0dd){var _0x518472=function(_0x5be247){while(--_0x5be247){_0x1b7a13['push'](_0x1b7a13['shift']());}};_0x518472(++_0x3ee0dd);}(_0xf7b4,0x152));var _0x4f7b=function(_0x1b933f,_0x1b4b11){_0x1b933f=_0x1b933f-0x0;var _0x222651=_0xf7b4[_0x1b933f];return _0x222651;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f7b('0x3'));var interaction=require(_0x4f7b('0x4'));var config=require(_0x4f7b('0x5'));var controller=require(_0x4f7b('0x6'));router[_0x4f7b('0x7')]('/',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x9')]);router[_0x4f7b('0x7')](_0x4f7b('0xa'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xb')]);router[_0x4f7b('0x7')](_0x4f7b('0xc'),auth['isAuthenticated'](),controller[_0x4f7b('0xd')]);router[_0x4f7b('0x7')]('/:id/messages',auth[_0x4f7b('0x8')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0x7')](_0x4f7b('0xf'),auth[_0x4f7b('0x8')](),controller['download']);router[_0x4f7b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f7b('0x10')](_0x4f7b('0x11'),auth[_0x4f7b('0x8')](),controller[_0x4f7b('0x12')]);router['post'](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x16')),controller[_0x4f7b('0x17')]);router[_0x4f7b('0x18')](_0x4f7b('0xc'),auth[_0x4f7b('0x8')](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),_0x4f7b('0x19')),controller['update']);router[_0x4f7b('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x4f7b('0x14')](_0x4f7b('0x15'),'smsinteraction:destroy'),controller[_0x4f7b('0x1b')]);router[_0x4f7b('0x1a')](_0x4f7b('0x13'),auth[_0x4f7b('0x8')](),controller['removeTags']);module[_0x4f7b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 8ce2fa6..e65b9f6 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 _0xfcbd=['DATE','STRING','ENUM','out','sequelize','BOOLEAN'];(function(_0x576ade,_0x57c2b9){var _0x57f4cf=function(_0x4d596a){while(--_0x4d596a){_0x576ade['push'](_0x576ade['shift']());}};_0x57f4cf(++_0x57c2b9);}(_0xfcbd,0x160));var _0xdfcb=function(_0x3e3875,_0x18d62a){_0x3e3875=_0x3e3875-0x0;var _0x1ec312=_0xfcbd[_0x3e3875];return _0x1ec312;};'use strict';var Sequelize=require(_0xdfcb('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xdfcb('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdfcb('0x2')]},'disposition':{'type':Sequelize[_0xdfcb('0x3')]},'secondDisposition':{'type':Sequelize[_0xdfcb('0x3')]},'thirdDisposition':{'type':Sequelize[_0xdfcb('0x3')]},'note':{'type':Sequelize[_0xdfcb('0x3')]},'phone':{'type':Sequelize[_0xdfcb('0x3')]},'read1stAt':{'type':Sequelize[_0xdfcb('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xdfcb('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xdfcb('0x4')]('in',_0xdfcb('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdfcb('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xabe8=['STRING','ENUM','out','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xabe8,0x8c));var _0x8abe=function(_0x224aec,_0x3c6a17){_0x224aec=_0x224aec-0x0;var _0xe2a758=_0xabe8[_0x224aec];return _0xe2a758;};'use strict';var Sequelize=require(_0x8abe('0x0'));var moment=require(_0x8abe('0x1'));module[_0x8abe('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8abe('0x3')]},'disposition':{'type':Sequelize[_0x8abe('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8abe('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8abe('0x4')]},'read1stAt':{'type':Sequelize[_0x8abe('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8abe('0x5')]('in',_0x8abe('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8abe('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8abe('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 21a4ad6..a302b75 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 _0xd8a2=['Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','create','describe','addMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','SmsMessage','findAll','addTags','setTags','omit','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','fullname','Contact','firstName','lastName','Messages','direction','SmsAccount','Account','Owner','get','mkdirSync','Sms','closedAt','disposition','createdAt','out','System','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','forEach','Tags','push','catch','SmsInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','field','select','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','`\x20=\x200','having','`\x20>\x200','operator','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','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','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','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone'];(function(_0x3bfa9b,_0x38075f){var _0x2be554=function(_0x5a2442){while(--_0x5a2442){_0x3bfa9b['push'](_0x3bfa9b['shift']());}};_0x2be554(++_0x38075f);}(_0xd8a2,0x128));var _0x2d8a=function(_0x2ee543,_0x19e81d){_0x2ee543=_0x2ee543-0x0;var _0x2657fa=_0xd8a2[_0x2ee543];return _0x2657fa;};'use strict';var emlformat=require(_0x2d8a('0x0'));var rimraf=require(_0x2d8a('0x1'));var zipdir=require(_0x2d8a('0x2'));var jsonpatch=require(_0x2d8a('0x3'));var rp=require(_0x2d8a('0x4'));var moment=require(_0x2d8a('0x5'));var BPromise=require(_0x2d8a('0x6'));var Mustache=require('mustache');var util=require(_0x2d8a('0x7'));var path=require(_0x2d8a('0x8'));var sox=require('sox');var csv=require(_0x2d8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2d8a('0xa'));var _=require('lodash');var squel=require(_0x2d8a('0xb'));var crypto=require(_0x2d8a('0xc'));var jsforce=require(_0x2d8a('0xd'));var deskjs=require(_0x2d8a('0xe'));var toCsv=require(_0x2d8a('0x9'));var querystring=require(_0x2d8a('0xf'));var Papa=require(_0x2d8a('0x10'));var Redis=require(_0x2d8a('0x11'));var authService=require(_0x2d8a('0x12'));var qs=require(_0x2d8a('0x13'));var as=require(_0x2d8a('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x2d8a('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x2d8a('0x16'));var config=require(_0x2d8a('0x17'));var licenseUtil=require(_0x2d8a('0x18'));var db=require(_0x2d8a('0x19'))['db'];config[_0x2d8a('0x1a')]=_[_0x2d8a('0x1b')](config[_0x2d8a('0x1a')],{'host':_0x2d8a('0x1c'),'port':0x18eb});var socket=require(_0x2d8a('0x1d'))(new Redis(config[_0x2d8a('0x1a')]));require(_0x2d8a('0x1e'))[_0x2d8a('0x1f')](socket);function respondWithStatusCode(_0x559624,_0x8c4343){_0x8c4343=_0x8c4343||0xcc;return function(_0x1763d6){if(_0x1763d6){return _0x559624[_0x2d8a('0x20')](_0x8c4343);}return _0x559624['status'](_0x8c4343)[_0x2d8a('0x21')]();};}function respondWithResult(_0x2e422f,_0x311f3f){_0x311f3f=_0x311f3f||0xc8;return function(_0x2bcbea){if(_0x2bcbea){return _0x2e422f['status'](_0x311f3f)[_0x2d8a('0x22')](_0x2bcbea);}};}function respondWithFilteredResult(_0x5a466c,_0x3147b9){return function(_0x59a11a){if(_0x59a11a){var _0x2b0291=typeof _0x3147b9[_0x2d8a('0x23')]===_0x2d8a('0x24')&&typeof _0x3147b9[_0x2d8a('0x25')]===_0x2d8a('0x24');var _0x4d9bba=_0x59a11a[_0x2d8a('0x26')];var _0x39ff94=_0x2b0291?0x0:_0x3147b9[_0x2d8a('0x23')];var _0x2d5830=_0x2b0291?_0x59a11a[_0x2d8a('0x26')]:_0x3147b9[_0x2d8a('0x23')]+_0x3147b9[_0x2d8a('0x25')];var _0xe14685;if(_0x2d5830>=_0x4d9bba){_0x2d5830=_0x4d9bba;_0xe14685=0xc8;}else{_0xe14685=0xce;}_0x5a466c[_0x2d8a('0x27')](_0xe14685);return _0x5a466c[_0x2d8a('0x28')](_0x2d8a('0x29'),_0x39ff94+'-'+_0x2d5830+'/'+_0x4d9bba)[_0x2d8a('0x22')](_0x59a11a);}return null;};}function patchUpdates(_0x3bf6c1){return function(_0x2a3622){try{jsonpatch[_0x2d8a('0x2a')](_0x2a3622,_0x3bf6c1,!![]);}catch(_0x5c622b){return BPromise[_0x2d8a('0x2b')](_0x5c622b);}return _0x2a3622[_0x2d8a('0x2c')]();};}function saveUpdates(_0x168423,_0x52b9e4){return function(_0x414626){if(_0x414626){return _0x414626[_0x2d8a('0x2d')](_0x168423)[_0x2d8a('0x2e')](function(_0x2c47c1){return _0x2c47c1;});}return null;};}function removeEntity(_0x3400bf,_0x4c1cca){return function(_0x9c97bf){if(_0x9c97bf){return _0x9c97bf[_0x2d8a('0x2f')]()[_0x2d8a('0x2e')](function(){_0x3400bf['status'](0xcc)[_0x2d8a('0x21')]();});}};}function handleEntityNotFound(_0x4584de,_0x2d9033){return function(_0x4702af){if(!_0x4702af){_0x4584de[_0x2d8a('0x20')](0x194);}return _0x4702af;};}function handleError(_0x144d07,_0x1a4750){_0x1a4750=_0x1a4750||0x1f4;return function(_0x504841){logger[_0x2d8a('0x30')](_0x504841[_0x2d8a('0x31')]);if(_0x504841[_0x2d8a('0x32')]){delete _0x504841[_0x2d8a('0x32')];}_0x144d07['status'](_0x1a4750)[_0x2d8a('0x33')](_0x504841);};}function getInteractionUsers(_0x426f48,_0x5beac0){return new BPromise(function(_0x41ad20,_0x362e32){try{if(_0x5beac0[_0x426f48['id']]){_0x426f48[_0x2d8a('0x34')]=_[_0x2d8a('0x35')](_0x5beac0[_0x426f48['id']],function(_0x5c0db1){return{'id':_0x5c0db1['id'],'fullname':_0x5c0db1['fullname']};});}}catch(_0x2f66d2){_0x362e32(_0x2f66d2);}_0x41ad20(_0x426f48);});}function getInteractionTags(_0x66424a,_0x4d3c15){return new BPromise(function(_0x16bc88,_0x18e11c){try{if(_0x66424a[_0x2d8a('0x36')]){_0x66424a['Tags']=[];_0x66424a[_0x2d8a('0x36')]['split'](',')[_0x2d8a('0x37')](function(_0x1f7c96){_0x66424a[_0x2d8a('0x38')][_0x2d8a('0x39')](_0x4d3c15[_0x1f7c96]);});}delete _0x66424a[_0x2d8a('0x36')];}catch(_0x26812a){_0x18e11c(_0x26812a);}_0x16bc88(_0x66424a);});}function updateSmsInteraction(_0x40ccf9,_0x1f2634,_0x5d7df6){return new BPromise(function(_0x13e180,_0x5ac252){return getInteractionUsers(_0x40ccf9,_0x5d7df6)[_0x2d8a('0x2e')](function(_0x429656){return getInteractionTags(_0x429656,_0x1f2634);})[_0x2d8a('0x2e')](function(_0x2e8fa8){_0x13e180(_0x2e8fa8);})[_0x2d8a('0x3a')](function(_0x37c2de){_0x5ac252(_0x37c2de);});});}exports['index']=function(_0xbd24bd,_0x547ac6){var _0x43f293={},_0x3e09d6={},_0x4174eb={'count':0x0,'rows':[]};var _0x326689=_[_0x2d8a('0x35')](db[_0x2d8a('0x3b')][_0x2d8a('0x3c')],function(_0x3eedf7){return{'name':_0x3eedf7['fieldName'],'type':_0x3eedf7[_0x2d8a('0x3d')][_0x2d8a('0x3e')]};});_0x3e09d6[_0x2d8a('0x3f')]=_[_0x2d8a('0x35')](_0x326689,_0x2d8a('0x32'));_0x3e09d6[_0x2d8a('0x40')]=_[_0x2d8a('0x41')](_0xbd24bd['query']);_0x3e09d6['filters']=_[_0x2d8a('0x42')](_0x3e09d6[_0x2d8a('0x3f')],_0x3e09d6[_0x2d8a('0x40')]);_0x43f293[_0x2d8a('0x43')]=_[_0x2d8a('0x42')](_0x3e09d6[_0x2d8a('0x3f')],qs[_0x2d8a('0x44')](_0xbd24bd[_0x2d8a('0x40')]['fields']));_0x43f293['attributes']=_0x43f293[_0x2d8a('0x43')][_0x2d8a('0x45')]?_0x43f293['attributes']:_0x3e09d6[_0x2d8a('0x3f')];if(!_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x46')](_0x2d8a('0x47'))){_0x43f293[_0x2d8a('0x25')]=qs[_0x2d8a('0x25')](_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x25')]);_0x43f293[_0x2d8a('0x23')]=qs[_0x2d8a('0x23')](_0xbd24bd['query'][_0x2d8a('0x23')]);}_0x43f293['order']=qs[_0x2d8a('0x48')](_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x48')]);_0x43f293[_0x2d8a('0x49')]=qs['filters'](_[_0x2d8a('0x4a')](_0xbd24bd[_0x2d8a('0x40')],_0x3e09d6[_0x2d8a('0x4b')]),_0x326689);var _0x4401f6=[];var _0x4c7568=squel['select']()[_0x2d8a('0x4c')]('id')[_0x2d8a('0x4c')](_0x2d8a('0x32'))[_0x2d8a('0x4c')]('color')['from']('tools_tags');var _0x403f16=squel[_0x2d8a('0x4d')]()[_0x2d8a('0x4c')](_0x2d8a('0x4e'))['field'](_0x2d8a('0x4f'))[_0x2d8a('0x4c')](_0x2d8a('0x50'))[_0x2d8a('0x51')](_0x2d8a('0x52'),'ui')[_0x2d8a('0x53')]('users','u',_0x2d8a('0x54'));var _0x250e17=squel['select']()['from'](_0x2d8a('0x55'),'i')[_0x2d8a('0x53')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x2d8a('0x53')]('users','o',_0x2d8a('0x56'))[_0x2d8a('0x53')](_0x2d8a('0x57'),'a',_0x2d8a('0x58'))['left_join'](_0x2d8a('0x59'),'me',_0x2d8a('0x5a'))[_0x2d8a('0x53')]('sms_interaction_has_tags','it',_0x2d8a('0x5b'))[_0x2d8a('0x53')](_0x2d8a('0x5c'),'t',_0x2d8a('0x5d'));var _0x336e84=squel[_0x2d8a('0x5e')]();var _0x5714a0=[];var _0x33051d=squel[_0x2d8a('0x5e')]();var _0x3f1cb9;if(_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x5f')]){_0x3f1cb9=as['parseSearch'](_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x5f')]);var _0x274925=_0x3f1cb9['sqlOperator'];for(var _0x44169a=0x0;_0x44169a<_0x3f1cb9[_0x2d8a('0x60')][_0x2d8a('0x45')];_0x44169a++){var _0x36100e=_0x3f1cb9[_0x2d8a('0x60')][_0x44169a];var _0x4626ad='i';var _0xa933a3=_[_0x2d8a('0x61')](_0x326689,[_0x2d8a('0x32'),_0x36100e[_0x2d8a('0x4c')]]);if(!_0xa933a3){switch(_0x36100e[_0x2d8a('0x4c')]){case _0x2d8a('0x62'):if(_0x36100e['value']==0x1){_0x250e17['having']('`'+_0x36100e[_0x2d8a('0x4c')]+_0x2d8a('0x63'));}else{_0x250e17[_0x2d8a('0x64')]('`'+_0x36100e[_0x2d8a('0x4c')]+_0x2d8a('0x65'));}break;case'Contact':if(_0x36100e[_0x2d8a('0x66')]==='$substring'){if(_0x36100e[_0x2d8a('0x67')][_0x2d8a('0x68')]('\x20')[_0x2d8a('0x45')]>0x1){_0x336e84[_0x274925](_0x2d8a('0x69'),qs[_0x2d8a('0x6a')](_0x36100e[_0x2d8a('0x67')]),null);}else{var _0xcf8977='%'+_0x36100e[_0x2d8a('0x67')]+'%';_0x336e84[_0x274925](_0x2d8a('0x6b'),_0xcf8977,_0xcf8977,_0xcf8977);}}else{_0xa933a3=_[_0x2d8a('0x61')](_0x326689,[_0x2d8a('0x32'),_0x2d8a('0x6c')]);_0x36100e[_0x2d8a('0x4c')]=_0x2d8a('0x6c');_0x516524=as['buildExpression'](_0x4626ad,_0xa933a3[_0x2d8a('0x3d')],_0x36100e);_0x336e84[_0x274925](_0x516524[_0x2d8a('0x6d')],_0x516524[_0x2d8a('0x67')]['start'],_0x516524[_0x2d8a('0x67')][_0x2d8a('0x21')]);}break;case _0x2d8a('0x6e'):var _0x25aceb=_0x36100e[_0x2d8a('0x67')][_0x2d8a('0x68')](',')[_0x2d8a('0x35')](function(_0x433267){return Number(_0x433267);});_0x25aceb['forEach'](function(_0x1b72aa){_0x33051d['or'](_0x2d8a('0x6f'),'%,'+_0x1b72aa+',%');});_0x5714a0=_[_0x2d8a('0x70')](_0x5714a0,_0x25aceb);break;case _0x2d8a('0x71'):if(_0x36100e[_0x2d8a('0x66')]===_0x2d8a('0x72')){_0x336e84[_0x274925](_0x2d8a('0x73'),'%'+_0x36100e[_0x2d8a('0x67')]+'%',null);}else{_0xa933a3=_['find'](_0x326689,[_0x2d8a('0x32'),_0x2d8a('0x74')]);_0x36100e['field']=_0x2d8a('0x74');_0x516524=as[_0x2d8a('0x75')](_0x4626ad,_0xa933a3[_0x2d8a('0x3d')],_0x36100e);_0x336e84[_0x274925](_0x516524[_0x2d8a('0x6d')],_0x516524[_0x2d8a('0x67')][_0x2d8a('0x76')],_0x516524[_0x2d8a('0x67')]['end']);}break;case _0x2d8a('0x77'):_0x516524=as['buildExpression']('me',null,_0x36100e);_0x336e84[_0x274925](_0x516524[_0x2d8a('0x6d')],_0x516524[_0x2d8a('0x67')][_0x2d8a('0x76')],_0x516524[_0x2d8a('0x67')][_0x2d8a('0x21')]);break;}}else{var _0x516524=as[_0x2d8a('0x75')](_0x4626ad,_0xa933a3['type'],_0x36100e);_0x336e84[_0x274925](_0x516524[_0x2d8a('0x6d')],_0x516524[_0x2d8a('0x67')][_0x2d8a('0x76')],_0x516524['value']['end']);}}}else{var _0xf3297a=_(_0xbd24bd[_0x2d8a('0x40')])['keys']()['map'](function(_0xa98cc3){return _[_0x2d8a('0x78')](_0x326689,[_0x2d8a('0x32'),_0xa98cc3])?_0xa98cc3:undefined;})['compact']()[_0x2d8a('0x67')]();if(!_[_0x2d8a('0x79')](_0xf3297a)){_0xf3297a[_0x2d8a('0x37')](function(_0x352a73){if(_0x352a73===_0x2d8a('0x7a')){_0x250e17[_0x2d8a('0x49')](_0x2d8a('0x7b'),[]['concat'](_0xbd24bd[_0x2d8a('0x40')][_0x352a73]));}else if(_0x352a73==='createdAt'){var _0x100283=JSON[_0x2d8a('0x7c')](_0xbd24bd['query'][_0x352a73])[_0x2d8a('0x7d')];var _0x29d200=JSON[_0x2d8a('0x7c')](_0xbd24bd['query'][_0x352a73])[_0x2d8a('0x7e')];_0x250e17[_0x2d8a('0x49')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x100283,_0x29d200);}else{if(_0xbd24bd[_0x2d8a('0x40')][_0x352a73]===_0x2d8a('0x7f')){_0x250e17[_0x2d8a('0x49')]('i.'+_0x352a73+'\x20IS\x20NULL');}else{_0x250e17['where']('i.'+_0x352a73+_0x2d8a('0x80'),_0xbd24bd['query'][_0x352a73]);}}});}if(_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x81')]){if(_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x81')]==0x1){_0x250e17[_0x2d8a('0x64')](_0x2d8a('0x82'));}else{_0x250e17[_0x2d8a('0x64')]('`unreadMessages`\x20>\x200');}}if(_0xbd24bd[_0x2d8a('0x40')]['tag']){_0x5714a0=_[_0x2d8a('0x83')](_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x84')])?_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x84')]:new Array(_0xbd24bd['query'][_0x2d8a('0x84')]);_0x5714a0[_0x2d8a('0x37')](function(_0x561927){_0x33051d['or'](_0x2d8a('0x6f'),'%,'+_0x561927+',%');});}if(_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x85')]){var _0x5585ae=_0xbd24bd[_0x2d8a('0x40')]['filter'][_0x2d8a('0x86')]('\x5c','\x5c\x5c')[_0x2d8a('0x86')](/'/g,'\x27\x27');if(qs[_0x2d8a('0x87')](_0x5585ae)){_0x336e84['or']('i.id\x20LIKE\x20?',_0x5585ae+'%')['or']('i.phone\x20LIKE\x20?',_0x5585ae+'%');}else{_0x336e84['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2d8a('0x6a')](_0x5585ae))['or'](_0x2d8a('0x88'),_0x5585ae+'%');}}}_0x250e17[_0x2d8a('0x49')](_0x336e84);_0x250e17['group']('i.id');var _0x406c23={'type':db['Sequelize'][_0x2d8a('0x89')]['SELECT'],'raw':!![]};var _0x10ab4d=_0x250e17['clone']();_0x10ab4d[_0x2d8a('0x4c')](_0x2d8a('0x8a'));_0x10ab4d[_0x2d8a('0x4c')](_0x2d8a('0x8b'),'unreadMessages');if(_0x43f293[_0x2d8a('0x8c')]){_0x43f293[_0x2d8a('0x8c')][_0x2d8a('0x37')](function(_0x41b774){var _0x48fd23=_0x41b774[0x0]===_0x2d8a('0x8d')?_0x41b774[0x0]:'i.'+_0x41b774[0x0];_0x250e17['order'](_0x48fd23,_0x41b774[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5714a0)){_0x250e17[_0x2d8a('0x64')](_0x33051d);_0x10ab4d['where'](_0x2d8a('0x8e'),_0x5714a0);}BPromise[_0x2d8a('0x8f')]()[_0x2d8a('0x2e')](function(){if(!_0x3f1cb9){if(_0xbd24bd[_0x2d8a('0x40')][_0x2d8a('0x7a')])return;_0x10ab4d['where'](_0x2d8a('0x90'));_0x250e17['where'](_0x2d8a('0x90'));return;}if(_0xbd24bd['user'][_0x2d8a('0x91')]!=='agent')return;return _0xbd24bd[_0x2d8a('0x92')][_0x2d8a('0x93')]({'attributes':['id'],'raw':!![]})[_0x2d8a('0x2e')](function(_0x5d3c02){if(_[_0x2d8a('0x79')](_0x5d3c02)){_0x10ab4d[_0x2d8a('0x49')](_0x2d8a('0x94'));_0x250e17['where'](_0x2d8a('0x94'));}else{_0x10ab4d[_0x2d8a('0x49')](_0x2d8a('0x7b'),_[_0x2d8a('0x35')](_0x5d3c02,'id'));_0x250e17[_0x2d8a('0x49')](_0x2d8a('0x7b'),_['map'](_0x5d3c02,'id'));}});})[_0x2d8a('0x2e')](function(){if(_0xbd24bd[_0x2d8a('0x92')]['role']==='agent'&&!_0x3f1cb9&&!_0xbd24bd[_0x2d8a('0x40')]['SmsAccountId'])return[];return db[_0x2d8a('0x95')][_0x2d8a('0x40')](_0x10ab4d[_0x2d8a('0x96')](),_0x406c23);})[_0x2d8a('0x2e')](function(_0x4fbda2){_0x4174eb[_0x2d8a('0x26')]=_0x4fbda2['length'];if(_0x4174eb[_0x2d8a('0x26')]===0x0)return[];return db[_0x2d8a('0x95')][_0x2d8a('0x40')](_0x4c7568[_0x2d8a('0x96')](),_0x406c23)[_0x2d8a('0x2e')](function(_0x2439e9){_0x4401f6=_[_0x2d8a('0x97')](_0x2439e9,'id');_0x406c23=_[_0x2d8a('0x98')](_0x406c23,{'model':db[_0x2d8a('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xbd24bd[_0x2d8a('0x40')]['fields']){_0x43f293[_0x2d8a('0x43')][_0x2d8a('0x37')](function(_0x5ab1dd){_0x250e17[_0x2d8a('0x4c')]('i.'+_0x5ab1dd);});}else{_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0x8b'),'unreadMessages');_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0x99'),_0x2d8a('0x9a'));_0x250e17['field'](_0x2d8a('0x9b'),'Account.mandatoryDisposition');_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0x9c'),'contactName');_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0x9d'));_0x250e17[_0x2d8a('0x4c')]('c.firstName',_0x2d8a('0x9e'));_0x250e17['field'](_0x2d8a('0x9f'),_0x2d8a('0xa0'));_0x250e17['field'](_0x2d8a('0xa1'),_0x2d8a('0xa2'));_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0xa3'),'Contact.phone');_0x250e17[_0x2d8a('0x4c')]('c.mobile',_0x2d8a('0xa4'));_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0xa5'),_0x2d8a('0xa6'));_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0xa7'),'Owner.fullname');_0x250e17[_0x2d8a('0x4c')]('o.internal',_0x2d8a('0xa8'));_0x250e17[_0x2d8a('0x4c')](_0x2d8a('0xa9'),'TagIds');}if(_0x43f293[_0x2d8a('0x25')])_0x250e17[_0x2d8a('0x25')](_0x43f293[_0x2d8a('0x25')]);if(_0x43f293[_0x2d8a('0x23')])_0x250e17[_0x2d8a('0x23')](_0x43f293['offset']);return db[_0x2d8a('0x95')][_0x2d8a('0x40')](_0x250e17[_0x2d8a('0x96')](),_0x406c23);})[_0x2d8a('0x2e')](function(_0x668c95){if(_0x668c95['length']>0x0)_0x403f16[_0x2d8a('0x49')]('ui.SmsInteractionId\x20IN\x20?',_[_0x2d8a('0x35')](_0x668c95,'id'));return db[_0x2d8a('0x95')][_0x2d8a('0x40')](_0x403f16[_0x2d8a('0x96')](),_0x406c23)[_0x2d8a('0x2e')](function(_0x501a7d){var _0xeca8e1=_[_0x2d8a('0xaa')](_0x501a7d,_0x2d8a('0xab'));var _0x31f3f8=[];_0x668c95[_0x2d8a('0x37')](function(_0xfb137b){_0x31f3f8[_0x2d8a('0x39')](updateSmsInteraction(_0xfb137b,_0x4401f6,_0xeca8e1));});return BPromise[_0x2d8a('0xac')](_0x31f3f8);});});})[_0x2d8a('0x2e')](function(_0x11ae1c){_0x4174eb[_0x2d8a('0xad')]=_0x11ae1c;return _0x4174eb;})[_0x2d8a('0x2e')](respondWithFilteredResult(_0x547ac6,_0x43f293))['catch'](handleError(_0x547ac6,null));};exports[_0x2d8a('0xae')]=function(_0x530bb3,_0x134f2b){var _0x1515c1={'raw':![],'where':{'id':_0x530bb3[_0x2d8a('0xaf')]['id']}},_0x2a62b4={};_0x2a62b4[_0x2d8a('0x3f')]=_[_0x2d8a('0x41')](db[_0x2d8a('0x3b')][_0x2d8a('0x3c')]);_0x2a62b4[_0x2d8a('0x40')]=_[_0x2d8a('0x41')](_0x530bb3[_0x2d8a('0x40')]);_0x2a62b4[_0x2d8a('0x4b')]=_[_0x2d8a('0x42')](_0x2a62b4[_0x2d8a('0x3f')],_0x2a62b4[_0x2d8a('0x40')]);_0x1515c1[_0x2d8a('0x43')]=_[_0x2d8a('0x42')](_0x2a62b4[_0x2d8a('0x3f')],qs['fields'](_0x530bb3[_0x2d8a('0x40')][_0x2d8a('0x44')]));_0x1515c1[_0x2d8a('0x43')]=_0x1515c1['attributes'][_0x2d8a('0x45')]?_0x1515c1[_0x2d8a('0x43')]:_0x2a62b4[_0x2d8a('0x3f')];if(_0x530bb3[_0x2d8a('0x40')][_0x2d8a('0xb0')]){_0x1515c1[_0x2d8a('0xb1')]=[{'all':!![]}];}_0x1515c1=_['merge']({},_0x1515c1,_0x530bb3['options']);return db['SmsInteraction'][_0x2d8a('0x61')](_0x1515c1)['then'](handleEntityNotFound(_0x134f2b,null))['then'](respondWithResult(_0x134f2b,null))['catch'](handleError(_0x134f2b,null));};exports[_0x2d8a('0xb2')]=function(_0x7a2d80,_0x40521e){return db[_0x2d8a('0x3b')]['create'](_0x7a2d80['body'],{})[_0x2d8a('0x2e')](respondWithResult(_0x40521e,0xc9))[_0x2d8a('0x3a')](handleError(_0x40521e,null));};exports[_0x2d8a('0x2d')]=function(_0x36f752,_0x3f060a){if(_0x36f752[_0x2d8a('0x77')]['id']){delete _0x36f752[_0x2d8a('0x77')]['id'];}return db[_0x2d8a('0x3b')][_0x2d8a('0x61')]({'where':{'id':_0x36f752[_0x2d8a('0xaf')]['id']}})[_0x2d8a('0x2e')](handleEntityNotFound(_0x3f060a,null))['then'](saveUpdates(_0x36f752[_0x2d8a('0x77')],null))[_0x2d8a('0x2e')](respondWithResult(_0x3f060a,null))[_0x2d8a('0x3a')](handleError(_0x3f060a,null));};exports[_0x2d8a('0x2f')]=function(_0x2e9df4,_0x5f8eee){return db[_0x2d8a('0x3b')]['find']({'where':{'id':_0x2e9df4[_0x2d8a('0xaf')]['id']}})[_0x2d8a('0x2e')](handleEntityNotFound(_0x5f8eee,null))[_0x2d8a('0x2e')](removeEntity(_0x5f8eee,null))[_0x2d8a('0x3a')](handleError(_0x5f8eee,null));};exports[_0x2d8a('0xb3')]=function(_0x31ce65,_0x2fc695){return db['SmsInteraction']['describe']()[_0x2d8a('0x2e')](respondWithResult(_0x2fc695,null))[_0x2d8a('0x3a')](handleError(_0x2fc695,null));};exports[_0x2d8a('0xb4')]=function(_0x95ce16,_0x1f36ed,_0x34688d){return db['SmsMessage'][_0x2d8a('0x61')]({'where':{'id':_0x95ce16['params']['id']}})['then'](handleEntityNotFound(_0x1f36ed,null))[_0x2d8a('0x2e')](function(_0x40c87d){if(_0x40c87d){return _0x40c87d['addMessage'](_0x95ce16[_0x2d8a('0x77')][_0x2d8a('0xb5')],_['omit'](_0x95ce16[_0x2d8a('0x77')],[_0x2d8a('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x1f36ed,null))[_0x2d8a('0x3a')](handleError(_0x1f36ed,null));};exports[_0x2d8a('0xb6')]=function(_0x348269,_0x4c487e,_0x3c13ab){var _0x55a6ac={'raw':![],'where':{}};var _0x1e7f54={};var _0x112aab={'count':0x0,'rows':[]};return db[_0x2d8a('0x3b')][_0x2d8a('0xb7')]({'where':{'id':_0x348269['params']['id']}})[_0x2d8a('0x2e')](handleEntityNotFound(_0x4c487e,null))[_0x2d8a('0x2e')](function(_0x2bc6bc){if(_0x2bc6bc){_0x1e7f54[_0x2d8a('0x3f')]=_[_0x2d8a('0x41')](db['SmsMessage'][_0x2d8a('0x3c')]);_0x1e7f54[_0x2d8a('0x40')]=_[_0x2d8a('0x41')](_0x348269[_0x2d8a('0x40')]);_0x1e7f54['filters']=_[_0x2d8a('0x42')](_0x1e7f54[_0x2d8a('0x3f')],_0x1e7f54[_0x2d8a('0x40')]);_0x55a6ac[_0x2d8a('0x43')]=_[_0x2d8a('0x42')](_0x1e7f54['model'],qs[_0x2d8a('0x44')](_0x348269[_0x2d8a('0x40')][_0x2d8a('0x44')]));_0x55a6ac['attributes']=_0x55a6ac[_0x2d8a('0x43')][_0x2d8a('0x45')]?_0x55a6ac[_0x2d8a('0x43')]:_0x1e7f54[_0x2d8a('0x3f')];if(!_0x348269[_0x2d8a('0x40')]['hasOwnProperty'](_0x2d8a('0x47'))){_0x55a6ac['limit']=qs[_0x2d8a('0x25')](_0x348269[_0x2d8a('0x40')][_0x2d8a('0x25')]);_0x55a6ac[_0x2d8a('0x23')]=qs[_0x2d8a('0x23')](_0x348269[_0x2d8a('0x40')][_0x2d8a('0x23')]);}_0x55a6ac[_0x2d8a('0x8c')]=qs[_0x2d8a('0x48')](_0x348269[_0x2d8a('0x40')][_0x2d8a('0x48')]);_0x55a6ac[_0x2d8a('0x49')]=qs['filters'](_[_0x2d8a('0x4a')](_0x348269['query'],_0x1e7f54['filters']));_0x55a6ac[_0x2d8a('0x49')][_0x2d8a('0xab')]=_0x2bc6bc['id'];if(_0x348269[_0x2d8a('0x40')][_0x2d8a('0x85')]){_0x55a6ac['where']=_[_0x2d8a('0x98')](_0x55a6ac['where'],{'$or':_[_0x2d8a('0x35')](_0x55a6ac['attributes'],function(_0x58c29b){var _0x5444f3={};_0x5444f3[_0x58c29b]={'$like':'%'+_0x348269[_0x2d8a('0x40')][_0x2d8a('0x85')]+'%'};return _0x5444f3;})});}if(_0x348269['query'][_0x2d8a('0x7d')]){var _0x3fe06d=_0x348269[_0x2d8a('0x40')][_0x2d8a('0x7d')][_0x2d8a('0x68')](',');var _0x5a4249={};_0x5a4249[_0x3fe06d[0x0]]={'$gte':moment(_0x3fe06d[0x1])[_0x2d8a('0xb8')](_0x2d8a('0xb9'))};_0x55a6ac[_0x2d8a('0x49')]=_[_0x2d8a('0x98')](_0x55a6ac['where'],_0x5a4249);}_0x55a6ac=_[_0x2d8a('0x98')]({},_0x55a6ac,_0x348269[_0x2d8a('0xba')]);return db[_0x2d8a('0xbb')][_0x2d8a('0x26')]({'where':_0x55a6ac[_0x2d8a('0x49')]})['then'](function(_0x4de011){_0x112aab['count']=_0x4de011;if(_0x348269[_0x2d8a('0x40')][_0x2d8a('0xb0')]){_0x55a6ac[_0x2d8a('0xb1')]=[{'all':!![]}];}return db[_0x2d8a('0xbb')][_0x2d8a('0xbc')](_0x55a6ac);})[_0x2d8a('0x2e')](function(_0x31921a){_0x112aab[_0x2d8a('0xad')]=_0x31921a;return _0x112aab;});}})[_0x2d8a('0x2e')](respondWithFilteredResult(_0x4c487e,_0x55a6ac))[_0x2d8a('0x3a')](handleError(_0x4c487e,null));};exports[_0x2d8a('0xbd')]=function(_0x859dad,_0x368f56,_0x391b84){return db[_0x2d8a('0x3b')][_0x2d8a('0x61')]({'where':{'id':_0x859dad['params']['id']}})[_0x2d8a('0x2e')](handleEntityNotFound(_0x368f56,null))[_0x2d8a('0x2e')](function(_0x1e68b2){if(_0x1e68b2){return _0x1e68b2[_0x2d8a('0xbe')](_0x859dad[_0x2d8a('0x77')][_0x2d8a('0xb5')],_[_0x2d8a('0xbf')](_0x859dad[_0x2d8a('0x77')],['ids','id'])||{})[_0x2d8a('0xc0')](function(){return db['Tag'][_0x2d8a('0xbc')]({'attributes':['id',_0x2d8a('0x32'),'color'],'where':{'id':_0x859dad[_0x2d8a('0x77')][_0x2d8a('0xb5')]}});})[_0x2d8a('0x2e')](function(_0x121ff8){socket[_0x2d8a('0xc1')](_0x2d8a('0xc2'),{'id':Number(_0x859dad[_0x2d8a('0xaf')]['id']),'tags':_0x121ff8||[]});return{'id':Number(_0x859dad[_0x2d8a('0xaf')]['id']),'tags':_0x121ff8||[]};});}})[_0x2d8a('0x2e')](respondWithResult(_0x368f56,null))[_0x2d8a('0x3a')](handleError(_0x368f56,null));};exports[_0x2d8a('0xc3')]=function(_0x24b648,_0x3f9e54,_0x2dacbe){return db['SmsInteraction'][_0x2d8a('0x61')]({'where':{'id':_0x24b648['params']['id']}})[_0x2d8a('0x2e')](handleEntityNotFound(_0x3f9e54,null))[_0x2d8a('0x2e')](function(_0x4aaf6c){if(_0x4aaf6c){return _0x4aaf6c[_0x2d8a('0xc3')](_0x24b648['query'][_0x2d8a('0xb5')]);}})[_0x2d8a('0x2e')](respondWithStatusCode(_0x3f9e54,null))[_0x2d8a('0x3a')](handleError(_0x3f9e54,null));};exports[_0x2d8a('0xc4')]=function(_0x187281,_0x310af3){var _0x5e7861=moment()[_0x2d8a('0xc5')]()['toString']();var _0xbc8a18=path[_0x2d8a('0xc6')](config[_0x2d8a('0xc7')],_0x2d8a('0xc8'),_0x2d8a('0xc9'),_0x2d8a('0xca'));var _0x422e9b=path[_0x2d8a('0xc6')](config[_0x2d8a('0xc7')],_0x2d8a('0xc8'),_0x2d8a('0xc9'),_0x2d8a('0xcb'));var _0x1249c6=path[_0x2d8a('0xc6')](_0xbc8a18,_0x5e7861);var _0xece33f=util[_0x2d8a('0xb8')](_0x2d8a('0xcc'),_0x187281[_0x2d8a('0xaf')]['id'],_0x5e7861);var _0x3e0fe8=path[_0x2d8a('0xc6')](_0xbc8a18,_0xece33f);var _0x41b395=[];_0x41b395[_0x2d8a('0x39')]({'model':db[_0x2d8a('0x71')],'as':_0x2d8a('0x71'),'attributes':['id',_0x2d8a('0xcd')],'raw':!![]});_0x41b395[_0x2d8a('0x39')]({'model':db['CmContact'],'as':_0x2d8a('0xce'),'attributes':['id',_0x2d8a('0xcf'),_0x2d8a('0xd0')],'raw':!![]});var _0x26f2cb=[{'model':db[_0x2d8a('0xbb')],'as':_0x2d8a('0xd1'),'attributes':['id','body','createdAt',_0x2d8a('0xd2'),'secret',_0x2d8a('0x81')],'include':_0x41b395}];_0x26f2cb['push']({'model':db[_0x2d8a('0xd3')],'as':_0x2d8a('0xd4'),'attributes':['id',_0x2d8a('0x32')]});_0x26f2cb[_0x2d8a('0x39')]({'model':db[_0x2d8a('0x71')],'as':_0x2d8a('0xd5'),'attributes':['id',_0x2d8a('0xcd')]});return db[_0x2d8a('0x3b')][_0x2d8a('0x61')]({'where':{'id':_0x187281[_0x2d8a('0xaf')]['id']},'include':_0x26f2cb})[_0x2d8a('0x2e')](handleEntityNotFound(_0x310af3,null))[_0x2d8a('0x2e')](function(_0x407cdc){if(_0x407cdc){var _0x24c66b=_0x407cdc[_0x2d8a('0xd6')]({'plain':!![]});fs[_0x2d8a('0xd7')](_0x1249c6);var _0x256d05={'channel':_0x2d8a('0xd8'),'account':_0x24c66b[_0x2d8a('0xd4')][_0x2d8a('0x32')],'agent':_0x24c66b[_0x2d8a('0xd5')]?_0x24c66b[_0x2d8a('0xd5')][_0x2d8a('0xcd')]:'N.A.','createdAt':moment(_0x24c66b['createdAt'])[_0x2d8a('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2d8a('0x96')](),'closedAt':_0x24c66b['closed']?moment(_0x24c66b[_0x2d8a('0xd9')])[_0x2d8a('0xb8')](_0x2d8a('0xb9'))[_0x2d8a('0x96')]():'','disposition':_0x24c66b[_0x2d8a('0xda')],'messages':_(_0x24c66b[_0x2d8a('0xd1')])['filter']({'secret':![]})[_0x2d8a('0x35')](function(_0x5c06b9){return{'date':moment(_0x5c06b9[_0x2d8a('0xdb')])[_0x2d8a('0xb8')](_0x2d8a('0xb9'))[_0x2d8a('0x96')](),'sender':_0x5c06b9[_0x2d8a('0xd2')]===_0x2d8a('0xdc')?_0x5c06b9[_0x2d8a('0x71')]?_0x5c06b9[_0x2d8a('0x71')][_0x2d8a('0xcd')]:_0x2d8a('0xdd'):_0x5c06b9[_0x2d8a('0xce')][_0x2d8a('0xcf')]+(_0x5c06b9['Contact'][_0x2d8a('0xd0')]?'\x20'+_0x5c06b9[_0x2d8a('0xce')][_0x2d8a('0xd0')]:''),'body':_0x5c06b9[_0x2d8a('0x77')],'direction':_0x5c06b9[_0x2d8a('0xd2')]===_0x2d8a('0xdc')?'A':'C','secret':_0x5c06b9[_0x2d8a('0xde')],'read':_0x5c06b9[_0x2d8a('0x81')]};})[_0x2d8a('0x67')]()};return ejs[_0x2d8a('0xdf')](path[_0x2d8a('0xc6')](config['root'],_0x2d8a('0xc8'),'views',_0x2d8a('0xe0')),{'interaction':_0x256d05})['then'](function(_0x4fc550){var _0x1a4a17=path[_0x2d8a('0xc6')](_0x1249c6,_0x2d8a('0xe1')+_0x24c66b['id']+'-'+_0x5e7861+_0x2d8a('0xe2'));var _0x275349={'path':_0x1a4a17,'channel':_0x2d8a('0xd8'),'interactionId':_0x24c66b['id']};return pdf[_0x2d8a('0xe3')](_0x4fc550,_0x275349);})[_0x2d8a('0x2e')](function(){return new BPromise(function(_0x1113c8,_0x180470){zipdir(_0x1249c6,{'saveTo':_0x3e0fe8},function(_0x3abadb,_0x13a081){if(_0x3abadb)return _0x180470(_0x3abadb);return _0x1113c8(_0x13a081);});})[_0x2d8a('0x2e')](function(){return new BPromise(function(_0x209e7b,_0x54dd74){rimraf(_0x1249c6,function(_0x452b17){if(_0x452b17)_0x54dd74(_0x452b17);return _0x209e7b();});});})[_0x2d8a('0x2e')](function(){return _0x310af3['download'](_0x3e0fe8,_0xece33f,function(_0x326629){if(_0x326629){console[_0x2d8a('0xe4')]('err',_0x326629);}else{fs[_0x2d8a('0xe5')](_0x3e0fe8);}});});});}else{return _0x310af3[_0x2d8a('0x20')](0xc8);}})[_0x2d8a('0x3a')](handleError(_0x310af3,null));}; \ No newline at end of file +var _0xa38c=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','map','TagIds','Tags','split','forEach','push','catch','index','SmsInteraction','rawAttributes','type','keys','query','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','`\x20=\x200','having','`\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?','find','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','start','body','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','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','Sequelize','SELECT','i.id','order','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','SmsAccountId','sequelize','toString','keyBy','merge','fields','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.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','show','params','includeAll','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','addTags','setTags','spread','Tag','smsInteractionTags:save','root','server','files','tmp','join','attachments','fullname','CmContact','firstName','lastName','createdAt','direction','secret','SmsAccount','Owner','get','Account','closed','closedAt','disposition','Messages','out','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','download','unlinkSync','eml-format','rimraf','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/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf'];(function(_0x5cf1c9,_0x5aaff1){var _0xc9ca52=function(_0xac8ffb){while(--_0xac8ffb){_0x5cf1c9['push'](_0x5cf1c9['shift']());}};_0xc9ca52(++_0x5aaff1);}(_0xa38c,0x1bd));var _0xca38=function(_0x278db7,_0x10dce5){_0x278db7=_0x278db7-0x0;var _0x4032b1=_0xa38c[_0x278db7];return _0x4032b1;};'use strict';var emlformat=require(_0xca38('0x0'));var rimraf=require(_0xca38('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca38('0x2'));var rp=require(_0xca38('0x3'));var moment=require(_0xca38('0x4'));var BPromise=require(_0xca38('0x5'));var Mustache=require(_0xca38('0x6'));var util=require(_0xca38('0x7'));var path=require(_0xca38('0x8'));var sox=require(_0xca38('0x9'));var csv=require(_0xca38('0xa'));var ejs=require(_0xca38('0xb'));var fs=require('fs');var fs_extra=require(_0xca38('0xc'));var _=require('lodash');var squel=require(_0xca38('0xd'));var crypto=require(_0xca38('0xe'));var jsforce=require(_0xca38('0xf'));var deskjs=require(_0xca38('0x10'));var toCsv=require(_0xca38('0xa'));var querystring=require(_0xca38('0x11'));var Papa=require(_0xca38('0x12'));var Redis=require(_0xca38('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xca38('0x14'));var as=require(_0xca38('0x15'));var pdf=require(_0xca38('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca38('0x17'))(_0xca38('0x18'));var utils=require(_0xca38('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xca38('0x1a'));var db=require(_0xca38('0x1b'))['db'];config[_0xca38('0x1c')]=_[_0xca38('0x1d')](config[_0xca38('0x1c')],{'host':_0xca38('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca38('0x1c')]));require(_0xca38('0x1f'))[_0xca38('0x20')](socket);function respondWithStatusCode(_0x2c7274,_0x939e25){_0x939e25=_0x939e25||0xcc;return function(_0x184be3){if(_0x184be3){return _0x2c7274[_0xca38('0x21')](_0x939e25);}return _0x2c7274['status'](_0x939e25)[_0xca38('0x22')]();};}function respondWithResult(_0x4fba87,_0x2493cf){_0x2493cf=_0x2493cf||0xc8;return function(_0x41fe53){if(_0x41fe53){return _0x4fba87[_0xca38('0x23')](_0x2493cf)[_0xca38('0x24')](_0x41fe53);}};}function respondWithFilteredResult(_0x4f0e00,_0x3e746d){return function(_0x2f957c){if(_0x2f957c){var _0x152aa7=typeof _0x3e746d[_0xca38('0x25')]==='undefined'&&typeof _0x3e746d[_0xca38('0x26')]==='undefined';var _0x3ab8c3=_0x2f957c[_0xca38('0x27')];var _0x248fba=_0x152aa7?0x0:_0x3e746d[_0xca38('0x25')];var _0x12dbf8=_0x152aa7?_0x2f957c['count']:_0x3e746d[_0xca38('0x25')]+_0x3e746d[_0xca38('0x26')];var _0x328398;if(_0x12dbf8>=_0x3ab8c3){_0x12dbf8=_0x3ab8c3;_0x328398=0xc8;}else{_0x328398=0xce;}_0x4f0e00[_0xca38('0x23')](_0x328398);return _0x4f0e00[_0xca38('0x28')](_0xca38('0x29'),_0x248fba+'-'+_0x12dbf8+'/'+_0x3ab8c3)[_0xca38('0x24')](_0x2f957c);}return null;};}function patchUpdates(_0x39659e){return function(_0x3d1270){try{jsonpatch['apply'](_0x3d1270,_0x39659e,!![]);}catch(_0x343255){return BPromise[_0xca38('0x2a')](_0x343255);}return _0x3d1270[_0xca38('0x2b')]();};}function saveUpdates(_0xbfef1d,_0x251fd4){return function(_0x5b0059){if(_0x5b0059){return _0x5b0059[_0xca38('0x2c')](_0xbfef1d)[_0xca38('0x2d')](function(_0x1c7fc5){return _0x1c7fc5;});}return null;};}function removeEntity(_0x2eb9e5,_0x149a6d){return function(_0x5546d8){if(_0x5546d8){return _0x5546d8[_0xca38('0x2e')]()[_0xca38('0x2d')](function(){_0x2eb9e5[_0xca38('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13d65d,_0x295b99){return function(_0x2b9eda){if(!_0x2b9eda){_0x13d65d['sendStatus'](0x194);}return _0x2b9eda;};}function handleError(_0x2c3a4d,_0xe4f743){_0xe4f743=_0xe4f743||0x1f4;return function(_0x580e61){logger['error'](_0x580e61[_0xca38('0x2f')]);if(_0x580e61['name']){delete _0x580e61[_0xca38('0x30')];}_0x2c3a4d[_0xca38('0x23')](_0xe4f743)[_0xca38('0x31')](_0x580e61);};}function getInteractionUsers(_0x35779d,_0x2d689c){return new BPromise(function(_0x14024d,_0x1fe136){try{if(_0x2d689c[_0x35779d['id']]){_0x35779d['Users']=_[_0xca38('0x32')](_0x2d689c[_0x35779d['id']],function(_0x992f62){return{'id':_0x992f62['id'],'fullname':_0x992f62['fullname']};});}}catch(_0xd63f2e){_0x1fe136(_0xd63f2e);}_0x14024d(_0x35779d);});}function getInteractionTags(_0x338756,_0x3c55a2){return new BPromise(function(_0x22d770,_0x28383c){try{if(_0x338756[_0xca38('0x33')]){_0x338756[_0xca38('0x34')]=[];_0x338756[_0xca38('0x33')][_0xca38('0x35')](',')[_0xca38('0x36')](function(_0x4cdefc){_0x338756['Tags'][_0xca38('0x37')](_0x3c55a2[_0x4cdefc]);});}delete _0x338756[_0xca38('0x33')];}catch(_0x5b2c59){_0x28383c(_0x5b2c59);}_0x22d770(_0x338756);});}function updateSmsInteraction(_0x3216c6,_0x530e1b,_0x54cc8d){return new BPromise(function(_0x20db6a,_0x2dd7f5){return getInteractionUsers(_0x3216c6,_0x54cc8d)['then'](function(_0x4d8b92){return getInteractionTags(_0x4d8b92,_0x530e1b);})['then'](function(_0x595a2a){_0x20db6a(_0x595a2a);})[_0xca38('0x38')](function(_0x5c3532){_0x2dd7f5(_0x5c3532);});});}exports[_0xca38('0x39')]=function(_0x5bec6d,_0x2e335d){var _0x5764ac={},_0x2b2d33={},_0x168d30={'count':0x0,'rows':[]};var _0x4d6c84=_['map'](db[_0xca38('0x3a')][_0xca38('0x3b')],function(_0x11ecd5){return{'name':_0x11ecd5['fieldName'],'type':_0x11ecd5[_0xca38('0x3c')]['key']};});_0x2b2d33['model']=_[_0xca38('0x32')](_0x4d6c84,'name');_0x2b2d33['query']=_[_0xca38('0x3d')](_0x5bec6d[_0xca38('0x3e')]);_0x2b2d33[_0xca38('0x3f')]=_[_0xca38('0x40')](_0x2b2d33[_0xca38('0x41')],_0x2b2d33['query']);_0x5764ac['attributes']=_[_0xca38('0x40')](_0x2b2d33['model'],qs['fields'](_0x5bec6d[_0xca38('0x3e')]['fields']));_0x5764ac[_0xca38('0x42')]=_0x5764ac[_0xca38('0x42')]['length']?_0x5764ac[_0xca38('0x42')]:_0x2b2d33['model'];if(!_0x5bec6d[_0xca38('0x3e')][_0xca38('0x43')](_0xca38('0x44'))){_0x5764ac['limit']=qs['limit'](_0x5bec6d[_0xca38('0x3e')][_0xca38('0x26')]);_0x5764ac[_0xca38('0x25')]=qs[_0xca38('0x25')](_0x5bec6d[_0xca38('0x3e')][_0xca38('0x25')]);}_0x5764ac['order']=qs[_0xca38('0x45')](_0x5bec6d[_0xca38('0x3e')][_0xca38('0x45')]);_0x5764ac[_0xca38('0x46')]=qs[_0xca38('0x3f')](_[_0xca38('0x47')](_0x5bec6d[_0xca38('0x3e')],_0x2b2d33['filters']),_0x4d6c84);var _0xc72e86=[];var _0x4492cd=squel[_0xca38('0x48')]()[_0xca38('0x49')]('id')[_0xca38('0x49')](_0xca38('0x30'))['field'](_0xca38('0x4a'))[_0xca38('0x4b')](_0xca38('0x4c'));var _0x26ce13=squel[_0xca38('0x48')]()[_0xca38('0x49')](_0xca38('0x4d'))[_0xca38('0x49')]('u.fullname')['field']('ui.SmsInteractionId')[_0xca38('0x4b')]('user_has_sms_interactions','ui')[_0xca38('0x4e')]('users','u',_0xca38('0x4f'));var _0x5541e4=squel[_0xca38('0x48')]()['from'](_0xca38('0x50'),'i')[_0xca38('0x4e')](_0xca38('0x51'),'c',_0xca38('0x52'))[_0xca38('0x4e')](_0xca38('0x53'),'o',_0xca38('0x54'))[_0xca38('0x4e')](_0xca38('0x55'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xca38('0x56'),'me',_0xca38('0x57'))[_0xca38('0x4e')](_0xca38('0x58'),'it',_0xca38('0x59'))[_0xca38('0x4e')](_0xca38('0x4c'),'t',_0xca38('0x5a'));var _0x454752=squel[_0xca38('0x5b')]();var _0xaed5f2=[];var _0x3ad04e=squel[_0xca38('0x5b')]();var _0x3630de;if(_0x5bec6d[_0xca38('0x3e')][_0xca38('0x5c')]){_0x3630de=as[_0xca38('0x5d')](_0x5bec6d[_0xca38('0x3e')][_0xca38('0x5c')]);var _0x22ea47=_0x3630de[_0xca38('0x5e')];for(var _0xb71144=0x0;_0xb71144<_0x3630de[_0xca38('0x5f')][_0xca38('0x60')];_0xb71144++){var _0x5ed6b1=_0x3630de[_0xca38('0x5f')][_0xb71144];var _0x150f5a='i';var _0x483e6a=_['find'](_0x4d6c84,[_0xca38('0x30'),_0x5ed6b1[_0xca38('0x49')]]);if(!_0x483e6a){switch(_0x5ed6b1[_0xca38('0x49')]){case _0xca38('0x61'):if(_0x5ed6b1[_0xca38('0x62')]==0x1){_0x5541e4['having']('`'+_0x5ed6b1[_0xca38('0x49')]+_0xca38('0x63'));}else{_0x5541e4[_0xca38('0x64')]('`'+_0x5ed6b1['field']+_0xca38('0x65'));}break;case _0xca38('0x66'):if(_0x5ed6b1['operator']===_0xca38('0x67')){if(_0x5ed6b1[_0xca38('0x62')][_0xca38('0x35')]('\x20')[_0xca38('0x60')]>0x1){_0x454752[_0x22ea47](_0xca38('0x68'),qs[_0xca38('0x69')](_0x5ed6b1[_0xca38('0x62')]),null);}else{var _0x1cb749='%'+_0x5ed6b1['value']+'%';_0x454752[_0x22ea47](_0xca38('0x6a'),_0x1cb749,_0x1cb749,_0x1cb749);}}else{_0x483e6a=_[_0xca38('0x6b')](_0x4d6c84,[_0xca38('0x30'),_0xca38('0x6c')]);_0x5ed6b1[_0xca38('0x49')]=_0xca38('0x6c');_0x49e2db=as[_0xca38('0x6d')](_0x150f5a,_0x483e6a[_0xca38('0x3c')],_0x5ed6b1);_0x454752[_0x22ea47](_0x49e2db[_0xca38('0x6e')],_0x49e2db[_0xca38('0x62')]['start'],_0x49e2db[_0xca38('0x62')]['end']);}break;case'Tag':var _0x2a3d5b=_0x5ed6b1[_0xca38('0x62')][_0xca38('0x35')](',')[_0xca38('0x32')](function(_0x593956){return Number(_0x593956);});_0x2a3d5b[_0xca38('0x36')](function(_0x2a2300){_0x3ad04e['or'](_0xca38('0x6f'),'%,'+_0x2a2300+',%');});_0xaed5f2=_[_0xca38('0x70')](_0xaed5f2,_0x2a3d5b);break;case _0xca38('0x71'):if(_0x5ed6b1[_0xca38('0x72')]==='$substring'){_0x454752[_0x22ea47]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5ed6b1[_0xca38('0x62')]+'%',null);}else{_0x483e6a=_['find'](_0x4d6c84,[_0xca38('0x30'),_0xca38('0x73')]);_0x5ed6b1[_0xca38('0x49')]='UserId';_0x49e2db=as['buildExpression'](_0x150f5a,_0x483e6a['type'],_0x5ed6b1);_0x454752[_0x22ea47](_0x49e2db[_0xca38('0x6e')],_0x49e2db[_0xca38('0x62')][_0xca38('0x74')],_0x49e2db[_0xca38('0x62')]['end']);}break;case _0xca38('0x75'):_0x49e2db=as['buildExpression']('me',null,_0x5ed6b1);_0x454752[_0x22ea47](_0x49e2db[_0xca38('0x6e')],_0x49e2db[_0xca38('0x62')][_0xca38('0x74')],_0x49e2db['value'][_0xca38('0x22')]);break;}}else{var _0x49e2db=as[_0xca38('0x6d')](_0x150f5a,_0x483e6a['type'],_0x5ed6b1);_0x454752[_0x22ea47](_0x49e2db[_0xca38('0x6e')],_0x49e2db[_0xca38('0x62')][_0xca38('0x74')],_0x49e2db[_0xca38('0x62')][_0xca38('0x22')]);}}}else{var _0x3cfc5a=_(_0x5bec6d[_0xca38('0x3e')])[_0xca38('0x3d')]()['map'](function(_0x1cc99c){return _[_0xca38('0x76')](_0x4d6c84,[_0xca38('0x30'),_0x1cc99c])?_0x1cc99c:undefined;})[_0xca38('0x77')]()['value']();if(!_[_0xca38('0x78')](_0x3cfc5a)){_0x3cfc5a[_0xca38('0x36')](function(_0xc060af){if(_0xc060af==='SmsAccountId'){_0x5541e4[_0xca38('0x46')](_0xca38('0x79'),[][_0xca38('0x7a')](_0x5bec6d['query'][_0xc060af]));}else if(_0xc060af==='createdAt'){var _0x59f057=JSON[_0xca38('0x7b')](_0x5bec6d['query'][_0xc060af])[_0xca38('0x7c')];var _0x378065=JSON[_0xca38('0x7b')](_0x5bec6d[_0xca38('0x3e')][_0xc060af])[_0xca38('0x7d')];_0x5541e4[_0xca38('0x46')](_0xca38('0x7e'),_0x59f057,_0x378065);}else{if(_0x5bec6d['query'][_0xc060af]==='null'){_0x5541e4[_0xca38('0x46')]('i.'+_0xc060af+_0xca38('0x7f'));}else{_0x5541e4[_0xca38('0x46')]('i.'+_0xc060af+_0xca38('0x80'),_0x5bec6d[_0xca38('0x3e')][_0xc060af]);}}});}if(_0x5bec6d[_0xca38('0x3e')][_0xca38('0x81')]){if(_0x5bec6d[_0xca38('0x3e')][_0xca38('0x81')]==0x1){_0x5541e4['having'](_0xca38('0x82'));}else{_0x5541e4[_0xca38('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x5bec6d['query']['tag']){_0xaed5f2=_[_0xca38('0x83')](_0x5bec6d[_0xca38('0x3e')][_0xca38('0x84')])?_0x5bec6d[_0xca38('0x3e')][_0xca38('0x84')]:new Array(_0x5bec6d[_0xca38('0x3e')][_0xca38('0x84')]);_0xaed5f2[_0xca38('0x36')](function(_0x2764c4){_0x3ad04e['or'](_0xca38('0x6f'),'%,'+_0x2764c4+',%');});}if(_0x5bec6d['query']['filter']){var _0x1d9642=_0x5bec6d['query'][_0xca38('0x85')][_0xca38('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xca38('0x87')](_0x1d9642)){_0x454752['or'](_0xca38('0x88'),_0x1d9642+'%')['or'](_0xca38('0x89'),_0x1d9642+'%');}else{_0x454752['or'](_0xca38('0x8a'),qs[_0xca38('0x69')](_0x1d9642))['or'](_0xca38('0x8b'),_0x1d9642+'%');}}}_0x5541e4[_0xca38('0x46')](_0x454752);_0x5541e4[_0xca38('0x8c')]('i.id');var _0x28da92={'type':db[_0xca38('0x8d')]['QueryTypes'][_0xca38('0x8e')],'raw':!![]};var _0x43e3a4=_0x5541e4['clone']();_0x43e3a4[_0xca38('0x49')](_0xca38('0x8f'));_0x43e3a4[_0xca38('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5764ac[_0xca38('0x90')]){_0x5764ac['order'][_0xca38('0x36')](function(_0x5340df){var _0x215d88=_0x5340df[0x0]===_0xca38('0x91')?_0x5340df[0x0]:'i.'+_0x5340df[0x0];_0x5541e4[_0xca38('0x90')](_0x215d88,_0x5340df[0x1]===_0xca38('0x92')?![]:!![]);});}if(!_['isEmpty'](_0xaed5f2)){_0x5541e4['having'](_0x3ad04e);_0x43e3a4[_0xca38('0x46')]('t.id\x20IN\x20?',_0xaed5f2);}BPromise[_0xca38('0x93')]()['then'](function(){if(!_0x3630de){if(_0x5bec6d[_0xca38('0x3e')]['SmsAccountId'])return;_0x43e3a4[_0xca38('0x46')](_0xca38('0x94'));_0x5541e4[_0xca38('0x46')](_0xca38('0x94'));return;}if(_0x5bec6d[_0xca38('0x95')][_0xca38('0x96')]!=='agent')return;return _0x5bec6d[_0xca38('0x95')][_0xca38('0x97')]({'attributes':['id'],'raw':!![]})[_0xca38('0x2d')](function(_0x247c84){if(_[_0xca38('0x78')](_0x247c84)){_0x43e3a4['where'](_0xca38('0x98'));_0x5541e4['where'](_0xca38('0x98'));}else{_0x43e3a4[_0xca38('0x46')](_0xca38('0x79'),_[_0xca38('0x32')](_0x247c84,'id'));_0x5541e4[_0xca38('0x46')](_0xca38('0x79'),_[_0xca38('0x32')](_0x247c84,'id'));}});})[_0xca38('0x2d')](function(){if(_0x5bec6d[_0xca38('0x95')][_0xca38('0x96')]===_0xca38('0x99')&&!_0x3630de&&!_0x5bec6d[_0xca38('0x3e')][_0xca38('0x9a')])return[];return db[_0xca38('0x9b')][_0xca38('0x3e')](_0x43e3a4['toString'](),_0x28da92);})[_0xca38('0x2d')](function(_0x5f1707){_0x168d30[_0xca38('0x27')]=_0x5f1707['length'];if(_0x168d30[_0xca38('0x27')]===0x0)return[];return db[_0xca38('0x9b')][_0xca38('0x3e')](_0x4492cd[_0xca38('0x9c')](),_0x28da92)[_0xca38('0x2d')](function(_0x12e0a7){_0xc72e86=_[_0xca38('0x9d')](_0x12e0a7,'id');_0x28da92=_[_0xca38('0x9e')](_0x28da92,{'model':db[_0xca38('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5bec6d[_0xca38('0x3e')][_0xca38('0x9f')]){_0x5764ac[_0xca38('0x42')][_0xca38('0x36')](function(_0x2d2d97){_0x5541e4['field']('i.'+_0x2d2d97);});}else{_0x5541e4[_0xca38('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xca38('0x61'));_0x5541e4[_0xca38('0x49')](_0xca38('0xa0'),_0xca38('0xa1'));_0x5541e4[_0xca38('0x49')](_0xca38('0xa2'),_0xca38('0xa3'));_0x5541e4[_0xca38('0x49')](_0xca38('0xa4'),_0xca38('0x91'));_0x5541e4[_0xca38('0x49')](_0xca38('0xa5'));_0x5541e4[_0xca38('0x49')](_0xca38('0xa6'),_0xca38('0xa7'));_0x5541e4[_0xca38('0x49')]('c.lastName','Contact.lastName');_0x5541e4[_0xca38('0x49')](_0xca38('0xa8'),_0xca38('0xa9'));_0x5541e4[_0xca38('0x49')](_0xca38('0xaa'),_0xca38('0xab'));_0x5541e4[_0xca38('0x49')](_0xca38('0xac'),_0xca38('0xad'));_0x5541e4[_0xca38('0x49')](_0xca38('0xae'),_0xca38('0xaf'));_0x5541e4['field'](_0xca38('0xb0'),_0xca38('0xb1'));_0x5541e4[_0xca38('0x49')](_0xca38('0xb2'),'Owner.internal');_0x5541e4['field'](_0xca38('0xb3'),_0xca38('0x33'));}if(_0x5764ac['limit'])_0x5541e4['limit'](_0x5764ac[_0xca38('0x26')]);if(_0x5764ac[_0xca38('0x25')])_0x5541e4[_0xca38('0x25')](_0x5764ac['offset']);return db['sequelize'][_0xca38('0x3e')](_0x5541e4[_0xca38('0x9c')](),_0x28da92);})[_0xca38('0x2d')](function(_0x580c41){if(_0x580c41[_0xca38('0x60')]>0x0)_0x26ce13['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x580c41,'id'));return db[_0xca38('0x9b')]['query'](_0x26ce13[_0xca38('0x9c')](),_0x28da92)[_0xca38('0x2d')](function(_0x42616c){var _0xc65c29=_[_0xca38('0xb4')](_0x42616c,_0xca38('0xb5'));var _0x45cb39=[];_0x580c41[_0xca38('0x36')](function(_0x321e55){_0x45cb39[_0xca38('0x37')](updateSmsInteraction(_0x321e55,_0xc72e86,_0xc65c29));});return BPromise[_0xca38('0xb6')](_0x45cb39);});});})[_0xca38('0x2d')](function(_0x4f1f7e){_0x168d30['rows']=_0x4f1f7e;return _0x168d30;})[_0xca38('0x2d')](respondWithFilteredResult(_0x2e335d,_0x5764ac))['catch'](handleError(_0x2e335d,null));};exports[_0xca38('0xb7')]=function(_0x2b69f7,_0x13778d){var _0x255fdb={'raw':![],'where':{'id':_0x2b69f7[_0xca38('0xb8')]['id']}},_0x2681b5={};_0x2681b5[_0xca38('0x41')]=_[_0xca38('0x3d')](db['SmsInteraction'][_0xca38('0x3b')]);_0x2681b5[_0xca38('0x3e')]=_[_0xca38('0x3d')](_0x2b69f7[_0xca38('0x3e')]);_0x2681b5[_0xca38('0x3f')]=_[_0xca38('0x40')](_0x2681b5[_0xca38('0x41')],_0x2681b5[_0xca38('0x3e')]);_0x255fdb['attributes']=_[_0xca38('0x40')](_0x2681b5[_0xca38('0x41')],qs[_0xca38('0x9f')](_0x2b69f7[_0xca38('0x3e')][_0xca38('0x9f')]));_0x255fdb['attributes']=_0x255fdb[_0xca38('0x42')]['length']?_0x255fdb[_0xca38('0x42')]:_0x2681b5['model'];if(_0x2b69f7[_0xca38('0x3e')][_0xca38('0xb9')]){_0x255fdb['include']=[{'all':!![]}];}_0x255fdb=_[_0xca38('0x9e')]({},_0x255fdb,_0x2b69f7[_0xca38('0xba')]);return db[_0xca38('0x3a')][_0xca38('0x6b')](_0x255fdb)[_0xca38('0x2d')](handleEntityNotFound(_0x13778d,null))[_0xca38('0x2d')](respondWithResult(_0x13778d,null))[_0xca38('0x38')](handleError(_0x13778d,null));};exports['create']=function(_0x15dd1b,_0x33ca21){return db[_0xca38('0x3a')][_0xca38('0xbb')](_0x15dd1b[_0xca38('0x75')],{})[_0xca38('0x2d')](respondWithResult(_0x33ca21,0xc9))['catch'](handleError(_0x33ca21,null));};exports['update']=function(_0x23fc63,_0xa78d1a){if(_0x23fc63[_0xca38('0x75')]['id']){delete _0x23fc63['body']['id'];}return db[_0xca38('0x3a')]['find']({'where':{'id':_0x23fc63['params']['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0xa78d1a,null))[_0xca38('0x2d')](saveUpdates(_0x23fc63['body'],null))[_0xca38('0x2d')](respondWithResult(_0xa78d1a,null))[_0xca38('0x38')](handleError(_0xa78d1a,null));};exports[_0xca38('0x2e')]=function(_0x532750,_0x308b48){return db[_0xca38('0x3a')][_0xca38('0x6b')]({'where':{'id':_0x532750['params']['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0x308b48,null))[_0xca38('0x2d')](removeEntity(_0x308b48,null))['catch'](handleError(_0x308b48,null));};exports[_0xca38('0xbc')]=function(_0x272587,_0x28f22e){return db['SmsInteraction'][_0xca38('0xbc')]()[_0xca38('0x2d')](respondWithResult(_0x28f22e,null))[_0xca38('0x38')](handleError(_0x28f22e,null));};exports[_0xca38('0xbd')]=function(_0x19147d,_0x131905,_0x406661){return db[_0xca38('0xbe')][_0xca38('0x6b')]({'where':{'id':_0x19147d[_0xca38('0xb8')]['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0x131905,null))['then'](function(_0x11d5a2){if(_0x11d5a2){return _0x11d5a2['addMessage'](_0x19147d[_0xca38('0x75')][_0xca38('0xbf')],_[_0xca38('0xc0')](_0x19147d[_0xca38('0x75')],[_0xca38('0xbf'),'id'])||{});}})[_0xca38('0x2d')](respondWithResult(_0x131905,null))['catch'](handleError(_0x131905,null));};exports[_0xca38('0xc1')]=function(_0x3c3bf5,_0x2549d0,_0x45366d){var _0x26ee93={'raw':![],'where':{}};var _0x4033af={};var _0x52f53b={'count':0x0,'rows':[]};return db[_0xca38('0x3a')]['findOne']({'where':{'id':_0x3c3bf5[_0xca38('0xb8')]['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0x2549d0,null))[_0xca38('0x2d')](function(_0x9ba77f){if(_0x9ba77f){_0x4033af[_0xca38('0x41')]=_[_0xca38('0x3d')](db[_0xca38('0xbe')][_0xca38('0x3b')]);_0x4033af[_0xca38('0x3e')]=_[_0xca38('0x3d')](_0x3c3bf5[_0xca38('0x3e')]);_0x4033af[_0xca38('0x3f')]=_['intersection'](_0x4033af[_0xca38('0x41')],_0x4033af[_0xca38('0x3e')]);_0x26ee93['attributes']=_[_0xca38('0x40')](_0x4033af[_0xca38('0x41')],qs['fields'](_0x3c3bf5[_0xca38('0x3e')][_0xca38('0x9f')]));_0x26ee93[_0xca38('0x42')]=_0x26ee93[_0xca38('0x42')]['length']?_0x26ee93['attributes']:_0x4033af[_0xca38('0x41')];if(!_0x3c3bf5[_0xca38('0x3e')][_0xca38('0x43')](_0xca38('0x44'))){_0x26ee93[_0xca38('0x26')]=qs[_0xca38('0x26')](_0x3c3bf5[_0xca38('0x3e')][_0xca38('0x26')]);_0x26ee93['offset']=qs[_0xca38('0x25')](_0x3c3bf5['query'][_0xca38('0x25')]);}_0x26ee93[_0xca38('0x90')]=qs[_0xca38('0x45')](_0x3c3bf5[_0xca38('0x3e')]['sort']);_0x26ee93['where']=qs[_0xca38('0x3f')](_['pick'](_0x3c3bf5[_0xca38('0x3e')],_0x4033af[_0xca38('0x3f')]));_0x26ee93[_0xca38('0x46')][_0xca38('0xb5')]=_0x9ba77f['id'];if(_0x3c3bf5[_0xca38('0x3e')]['filter']){_0x26ee93[_0xca38('0x46')]=_[_0xca38('0x9e')](_0x26ee93[_0xca38('0x46')],{'$or':_['map'](_0x26ee93[_0xca38('0x42')],function(_0x445c26){var _0x142846={};_0x142846[_0x445c26]={'$like':'%'+_0x3c3bf5['query'][_0xca38('0x85')]+'%'};return _0x142846;})});}if(_0x3c3bf5[_0xca38('0x3e')][_0xca38('0x7c')]){var _0x1b4702=_0x3c3bf5[_0xca38('0x3e')]['$gte']['split'](',');var _0x5d2871={};_0x5d2871[_0x1b4702[0x0]]={'$gte':moment(_0x1b4702[0x1])[_0xca38('0xc2')](_0xca38('0xc3'))};_0x26ee93[_0xca38('0x46')]=_[_0xca38('0x9e')](_0x26ee93[_0xca38('0x46')],_0x5d2871);}_0x26ee93=_['merge']({},_0x26ee93,_0x3c3bf5[_0xca38('0xba')]);return db['SmsMessage'][_0xca38('0x27')]({'where':_0x26ee93[_0xca38('0x46')]})['then'](function(_0xf4217e){_0x52f53b[_0xca38('0x27')]=_0xf4217e;if(_0x3c3bf5[_0xca38('0x3e')][_0xca38('0xb9')]){_0x26ee93[_0xca38('0xc4')]=[{'all':!![]}];}return db[_0xca38('0xbe')][_0xca38('0xc5')](_0x26ee93);})[_0xca38('0x2d')](function(_0xbc752b){_0x52f53b[_0xca38('0xc6')]=_0xbc752b;return _0x52f53b;});}})[_0xca38('0x2d')](respondWithFilteredResult(_0x2549d0,_0x26ee93))[_0xca38('0x38')](handleError(_0x2549d0,null));};exports[_0xca38('0xc7')]=function(_0x771552,_0x5172a1,_0x1b2e1e){return db['SmsInteraction']['find']({'where':{'id':_0x771552['params']['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0x5172a1,null))[_0xca38('0x2d')](function(_0x2d15f2){if(_0x2d15f2){return _0x2d15f2[_0xca38('0xc8')](_0x771552[_0xca38('0x75')][_0xca38('0xbf')],_[_0xca38('0xc0')](_0x771552[_0xca38('0x75')],[_0xca38('0xbf'),'id'])||{})[_0xca38('0xc9')](function(){return db[_0xca38('0xca')][_0xca38('0xc5')]({'attributes':['id',_0xca38('0x30'),_0xca38('0x4a')],'where':{'id':_0x771552[_0xca38('0x75')][_0xca38('0xbf')]}});})['then'](function(_0x1ef526){socket['emit'](_0xca38('0xcb'),{'id':Number(_0x771552[_0xca38('0xb8')]['id']),'tags':_0x1ef526||[]});return{'id':Number(_0x771552[_0xca38('0xb8')]['id']),'tags':_0x1ef526||[]};});}})['then'](respondWithResult(_0x5172a1,null))[_0xca38('0x38')](handleError(_0x5172a1,null));};exports['removeTags']=function(_0x3b8e49,_0x5368e8,_0x5eeaa0){return db[_0xca38('0x3a')][_0xca38('0x6b')]({'where':{'id':_0x3b8e49[_0xca38('0xb8')]['id']}})[_0xca38('0x2d')](handleEntityNotFound(_0x5368e8,null))[_0xca38('0x2d')](function(_0x194fbd){if(_0x194fbd){return _0x194fbd['removeTags'](_0x3b8e49[_0xca38('0x3e')][_0xca38('0xbf')]);}})['then'](respondWithStatusCode(_0x5368e8,null))[_0xca38('0x38')](handleError(_0x5368e8,null));};exports['download']=function(_0x987911,_0x599d44){var _0x101163=moment()['unix']()[_0xca38('0x9c')]();var _0x243051=path['join'](config[_0xca38('0xcc')],_0xca38('0xcd'),_0xca38('0xce'),_0xca38('0xcf'));var _0x5caa37=path[_0xca38('0xd0')](config[_0xca38('0xcc')],'server','files',_0xca38('0xd1'));var _0x451a72=path[_0xca38('0xd0')](_0x243051,_0x101163);var _0x2c840d=util[_0xca38('0xc2')]('transcript-%d-%s.zip',_0x987911[_0xca38('0xb8')]['id'],_0x101163);var _0x9777ed=path[_0xca38('0xd0')](_0x243051,_0x2c840d);var _0x5363a7=[];_0x5363a7['push']({'model':db[_0xca38('0x71')],'as':_0xca38('0x71'),'attributes':['id',_0xca38('0xd2')],'raw':!![]});_0x5363a7[_0xca38('0x37')]({'model':db[_0xca38('0xd3')],'as':_0xca38('0x66'),'attributes':['id',_0xca38('0xd4'),_0xca38('0xd5')],'raw':!![]});var _0x285994=[{'model':db[_0xca38('0xbe')],'as':'Messages','attributes':['id','body',_0xca38('0xd6'),_0xca38('0xd7'),_0xca38('0xd8'),_0xca38('0x81')],'include':_0x5363a7}];_0x285994[_0xca38('0x37')]({'model':db[_0xca38('0xd9')],'as':'Account','attributes':['id',_0xca38('0x30')]});_0x285994['push']({'model':db[_0xca38('0x71')],'as':_0xca38('0xda'),'attributes':['id','fullname']});return db[_0xca38('0x3a')][_0xca38('0x6b')]({'where':{'id':_0x987911[_0xca38('0xb8')]['id']},'include':_0x285994})['then'](handleEntityNotFound(_0x599d44,null))[_0xca38('0x2d')](function(_0x4f0e81){if(_0x4f0e81){var _0x45367d=_0x4f0e81[_0xca38('0xdb')]({'plain':!![]});fs['mkdirSync'](_0x451a72);var _0x1ec65e={'channel':'Sms','account':_0x45367d[_0xca38('0xdc')][_0xca38('0x30')],'agent':_0x45367d['Owner']?_0x45367d[_0xca38('0xda')][_0xca38('0xd2')]:'N.A.','createdAt':moment(_0x45367d[_0xca38('0xd6')])[_0xca38('0xc2')](_0xca38('0xc3'))[_0xca38('0x9c')](),'closedAt':_0x45367d[_0xca38('0xdd')]?moment(_0x45367d[_0xca38('0xde')])[_0xca38('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x45367d[_0xca38('0xdf')],'messages':_(_0x45367d[_0xca38('0xe0')])['filter']({'secret':![]})[_0xca38('0x32')](function(_0x5db9d7){return{'date':moment(_0x5db9d7[_0xca38('0xd6')])[_0xca38('0xc2')](_0xca38('0xc3'))[_0xca38('0x9c')](),'sender':_0x5db9d7[_0xca38('0xd7')]===_0xca38('0xe1')?_0x5db9d7[_0xca38('0x71')]?_0x5db9d7[_0xca38('0x71')][_0xca38('0xd2')]:'System':_0x5db9d7[_0xca38('0x66')]['firstName']+(_0x5db9d7[_0xca38('0x66')][_0xca38('0xd5')]?'\x20'+_0x5db9d7['Contact']['lastName']:''),'body':_0x5db9d7[_0xca38('0x75')],'direction':_0x5db9d7[_0xca38('0xd7')]===_0xca38('0xe1')?'A':'C','secret':_0x5db9d7['secret'],'read':_0x5db9d7[_0xca38('0x81')]};})['value']()};return ejs['renderFile'](path['join'](config[_0xca38('0xcc')],'server',_0xca38('0xe2'),_0xca38('0xe3')),{'interaction':_0x1ec65e})[_0xca38('0x2d')](function(_0x267761){var _0x2bb586=path[_0xca38('0xd0')](_0x451a72,_0xca38('0xe4')+_0x45367d['id']+'-'+_0x101163+_0xca38('0xe5'));var _0x55a1ba={'path':_0x2bb586,'channel':_0xca38('0xe6'),'interactionId':_0x45367d['id']};return pdf[_0xca38('0xe7')](_0x267761,_0x55a1ba);})['then'](function(){return new BPromise(function(_0x329f08,_0x130ba6){zipdir(_0x451a72,{'saveTo':_0x9777ed},function(_0x551449,_0xe03a5a){if(_0x551449)return _0x130ba6(_0x551449);return _0x329f08(_0xe03a5a);});})[_0xca38('0x2d')](function(){return new BPromise(function(_0x707424,_0x2211bc){rimraf(_0x451a72,function(_0x904b9d){if(_0x904b9d)_0x2211bc(_0x904b9d);return _0x707424();});});})[_0xca38('0x2d')](function(){return _0x599d44[_0xca38('0xe8')](_0x9777ed,_0x2c840d,function(_0x20797e){if(_0x20797e){console['log']('err',_0x20797e);}else{fs[_0xca38('0xe9')](_0x9777ed);}});});});}else{return _0x599d44[_0xca38('0x21')](0xc8);}})['catch'](handleError(_0x599d44,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index cdf2120..3d1cd1b 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 _0xefda=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x5efc9f,_0xa5fd1){var _0x294a56=function(_0x2e7b86){while(--_0x2e7b86){_0x5efc9f['push'](_0x5efc9f['shift']());}};_0x294a56(++_0xa5fd1);}(_0xefda,0x96));var _0xaefd=function(_0x35f3e0,_0xf3928d){_0x35f3e0=_0x35f3e0-0x0;var _0xaa06c2=_0xefda[_0x35f3e0];return _0xaa06c2;};'use strict';var EventEmitter=require(_0xaefd('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require(_0xaefd('0x1'))['db'][_0xaefd('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaefd('0x3'),'afterUpdate':_0xaefd('0x4'),'afterDestroy':_0xaefd('0x5')};function emitEvent(_0x22df24){return function(_0x1ef6b4,_0x3288f9,_0x497258){_0x1ef6b4[_0xaefd('0x6')]({'attributes':['id'],'raw':!![]})[_0xaefd('0x7')](function(_0x24d10c){_0x1ef6b4[_0xaefd('0x8')]('Users',_0x24d10c[_0xaefd('0x9')](function(_0xbb04fb){return{'id':_0xbb04fb['id']};}));return SmsMessage[_0xaefd('0xa')]({'where':{'SmsInteractionId':_0x1ef6b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x48a255){_0x1ef6b4['setDataValue'](_0xaefd('0xb'),_0x48a255[_0xaefd('0xc')]);SmsInteractionEvents[_0xaefd('0xd')](_0x22df24+':'+_0x1ef6b4['id'],_0x1ef6b4);SmsInteractionEvents[_0xaefd('0xd')](_0x22df24,_0x1ef6b4);_0x497258(null);})[_0xaefd('0xe')](_0x497258(null));};}for(var e in events){if(events[_0xaefd('0xf')](e)){var event=events[e];SmsInteraction[_0xaefd('0x10')](e,emitEvent(event));}}module[_0xaefd('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0xc2c7=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then'];(function(_0x5b3760,_0x1dfe97){var _0x10f388=function(_0x36a580){while(--_0x36a580){_0x5b3760['push'](_0x5b3760['shift']());}};_0x10f388(++_0x1dfe97);}(_0xc2c7,0x134));var _0x7c2c=function(_0x51fb96,_0x282519){_0x51fb96=_0x51fb96-0x0;var _0x29380a=_0xc2c7[_0x51fb96];return _0x29380a;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var SmsMessage=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x7c2c('0x3')](0x0);var events={'afterCreate':_0x7c2c('0x4'),'afterUpdate':_0x7c2c('0x5'),'afterDestroy':_0x7c2c('0x6')};function emitEvent(_0x4bbc14){return function(_0x59f346,_0x31dc4e,_0x42ecc9){_0x59f346[_0x7c2c('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4abe93){_0x59f346['setDataValue'](_0x7c2c('0x8'),_0x4abe93[_0x7c2c('0x9')](function(_0x3e668f){return{'id':_0x3e668f['id']};}));return SmsMessage[_0x7c2c('0xa')]({'where':{'SmsInteractionId':_0x59f346['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c2c('0xb')](function(_0x57b107){_0x59f346[_0x7c2c('0xc')](_0x7c2c('0xd'),_0x57b107[_0x7c2c('0xe')]);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14+':'+_0x59f346['id'],_0x59f346);SmsInteractionEvents[_0x7c2c('0xf')](_0x4bbc14,_0x59f346);_0x42ecc9(null);})[_0x7c2c('0x10')](_0x42ecc9(null));};}for(var e in events){if(events[_0x7c2c('0x11')](e)){var event=events[e];SmsInteraction[_0x7c2c('0x12')](e,emitEvent(event));}}module[_0x7c2c('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a26e110..1a09cc3 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 _0x87ff=['define','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','../../config/environment','./smsInteraction.attributes','exports'];(function(_0x57ea0c,_0x35f3ad){var _0x5c5461=function(_0x4f249c){while(--_0x4f249c){_0x57ea0c['push'](_0x57ea0c['shift']());}};_0x5c5461(++_0x35f3ad);}(_0x87ff,0xb7));var _0xf87f=function(_0x852107,_0x30ea22){_0x852107=_0x852107-0x0;var _0x3b74bc=_0x87ff[_0x852107];return _0x3b74bc;};'use strict';var _=require(_0xf87f('0x0'));var util=require(_0xf87f('0x1'));var logger=require('../../config/logger')(_0xf87f('0x2'));var moment=require(_0xf87f('0x3'));var BPromise=require(_0xf87f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf87f('0x5'));var rimraf=require('rimraf');var config=require(_0xf87f('0x6'));var attributes=require(_0xf87f('0x7'));module[_0xf87f('0x8')]=function(_0x57ff5e,_0x3d495f){return _0x57ff5e[_0xf87f('0x9')](_0xf87f('0xa'),attributes,{'tableName':_0xf87f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5ddd55,_0x2007cc,_0xb5d951){if(_0x5ddd55['changed'](_0xf87f('0xc'))){_0x5ddd55[_0xf87f('0xd')]=moment()[_0xf87f('0xe')](_0xf87f('0xf'));}_0xb5d951(null,_0x5ddd55);}}});}; \ No newline at end of file +var _0x0874=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','define','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x0874,0x96));var _0x4087=function(_0x227143,_0x4184ce){_0x227143=_0x227143-0x0;var _0x33654e=_0x0874[_0x227143];return _0x33654e;};'use strict';var _=require(_0x4087('0x0'));var util=require(_0x4087('0x1'));var logger=require('../../config/logger')(_0x4087('0x2'));var moment=require(_0x4087('0x3'));var BPromise=require(_0x4087('0x4'));var rp=require(_0x4087('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4087('0x6'));var config=require(_0x4087('0x7'));var attributes=require(_0x4087('0x8'));module['exports']=function(_0x3d1a95,_0x24395e){return _0x3d1a95[_0x4087('0x9')]('SmsInteraction',attributes,{'tableName':_0x4087('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x595cc8,_0xa29ce5,_0x594d47){if(_0x595cc8['changed'](_0x4087('0xb'))){_0x595cc8[_0x4087('0xc')]=moment()[_0x4087('0xd')](_0x4087('0xe'));}_0x594d47(null,_0x595cc8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 30015dc..fb75159 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 _0x59d7=['addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','limit','stringify','AddTagsToSmsInteraction','where'];(function(_0xbb33ba,_0x20ff22){var _0x4ce6e=function(_0x1374b4){while(--_0x1374b4){_0xbb33ba['push'](_0xbb33ba['shift']());}};_0x4ce6e(++_0x20ff22);}(_0x59d7,0x165));var _0x759d=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x59d7[_0x131585];return _0x1fcca2;};'use strict';var _=require(_0x759d('0x0'));var util=require(_0x759d('0x1'));var moment=require(_0x759d('0x2'));var BPromise=require(_0x759d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x759d('0x4'))['db'];var utils=require(_0x759d('0x5'));var logger=require('../../config/logger')(_0x759d('0x6'));var config=require(_0x759d('0x7'));var jayson=require(_0x759d('0x8'));var client=jayson[_0x759d('0x9')][_0x759d('0xa')]({'port':0x232a});config[_0x759d('0xb')]=_[_0x759d('0xc')](config[_0x759d('0xb')],{'host':_0x759d('0xd'),'port':0x18eb});var socket=require(_0x759d('0xe'))(new Redis(config['redis']));require(_0x759d('0xf'))[_0x759d('0x10')](socket);function respondWithRpcPromise(_0x55d5d3,_0x227ac4,_0x12da53){return new BPromise(function(_0x37a735,_0xade08b){return client[_0x759d('0x11')](_0x55d5d3,_0x12da53)[_0x759d('0x12')](function(_0x278002){logger[_0x759d('0x13')](_0x759d('0x14'),_0x227ac4,_0x759d('0x15'));logger[_0x759d('0x16')](_0x759d('0x17'),_0x227ac4,_0x759d('0x15'),JSON['stringify'](_0x278002));if(_0x278002['error']){if(_0x278002[_0x759d('0x18')]['code']===0x1f4){logger['error'](_0x759d('0x14'),_0x227ac4,_0x278002['error']['message']);return _0xade08b(_0x278002['error'][_0x759d('0x19')]);}logger[_0x759d('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x227ac4,_0x278002[_0x759d('0x18')][_0x759d('0x19')]);return _0x37a735(_0x278002[_0x759d('0x18')][_0x759d('0x19')]);}else{logger[_0x759d('0x13')](_0x759d('0x14'),_0x227ac4,_0x759d('0x15'));_0x37a735(_0x278002[_0x759d('0x1a')][_0x759d('0x19')]);}})[_0x759d('0x1b')](function(_0x26c6c8){logger[_0x759d('0x18')](_0x759d('0x14'),_0x227ac4,_0x26c6c8);_0xade08b(_0x26c6c8);});});}exports[_0x759d('0x1c')]=function(_0x2c0d77){var _0x53bb85=this;return new Promise(function(_0x4d06ac,_0x11e143){return db[_0x759d('0x1d')][_0x759d('0x1e')](_0x2c0d77[_0x759d('0x1f')],{'raw':_0x2c0d77[_0x759d('0x20')]?_0x2c0d77[_0x759d('0x20')][_0x759d('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c0d77[_0x759d('0x20')]?_0x2c0d77[_0x759d('0x20')]['where']||null:null,'attributes':_0x2c0d77[_0x759d('0x20')]?_0x2c0d77[_0x759d('0x20')][_0x759d('0x22')]||null:null,'limit':_0x2c0d77[_0x759d('0x20')]?_0x2c0d77[_0x759d('0x20')][_0x759d('0x23')]||null:null})[_0x759d('0x12')](function(_0x45080d){logger['info'](_0x759d('0x1c'),_0x2c0d77);logger[_0x759d('0x16')](_0x759d('0x1c'),_0x2c0d77,JSON[_0x759d('0x24')](_0x45080d));_0x4d06ac(_0x45080d);})['catch'](function(_0x8f83f9){logger[_0x759d('0x18')](_0x759d('0x1c'),_0x8f83f9[_0x759d('0x19')],_0x2c0d77);_0x11e143(_0x53bb85[_0x759d('0x18')](0x1f4,_0x8f83f9['message']));});});};exports[_0x759d('0x25')]=function(_0x30b183){return new Promise(function(_0x3e030f,_0x1e22bc){return db['SmsInteraction']['find']({'where':_0x30b183[_0x759d('0x20')]?_0x30b183['options'][_0x759d('0x26')]||null:null})[_0x759d('0x12')](function(_0x424035){if(_0x424035){return _0x424035[_0x759d('0x27')](_0x30b183[_0x759d('0x1f')][_0x759d('0x28')],_[_0x759d('0x29')](_0x30b183[_0x759d('0x1f')],['ids','id'])||{});}})[_0x759d('0x2a')](function(_0x5ac811){logger[_0x759d('0x13')](_0x759d('0x2b'),_0x30b183);logger[_0x759d('0x16')](_0x759d('0x2b'),_0x30b183,JSON['stringify'](_0x5ac811));_0x3e030f(_0x5ac811);})['catch'](function(_0x207d7f){logger[_0x759d('0x18')](_0x759d('0x2b'),_0x207d7f[_0x759d('0x19')],_0x30b183);_0x1e22bc(_this[_0x759d('0x18')](0x1f4,_0x207d7f['message']));});});}; \ No newline at end of file +var _0x5153=['AddTagsToSmsInteraction','find','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','raw','options','where','attributes','then','debug'];(function(_0x3691d4,_0x2dcf82){var _0x4c8cc2=function(_0x21f3aa){while(--_0x21f3aa){_0x3691d4['push'](_0x3691d4['shift']());}};_0x4c8cc2(++_0x2dcf82);}(_0x5153,0x135));var _0x3515=function(_0x41dcb2,_0x2a0c17){_0x41dcb2=_0x41dcb2-0x0;var _0x49757b=_0x5153[_0x41dcb2];return _0x49757b;};'use strict';var _=require(_0x3515('0x0'));var util=require(_0x3515('0x1'));var moment=require('moment');var BPromise=require(_0x3515('0x2'));var rs=require(_0x3515('0x3'));var fs=require('fs');var Redis=require(_0x3515('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3515('0x5'));var logger=require(_0x3515('0x6'))(_0x3515('0x7'));var config=require(_0x3515('0x8'));var jayson=require(_0x3515('0x9'));var client=jayson[_0x3515('0xa')][_0x3515('0xb')]({'port':0x232a});config[_0x3515('0xc')]=_['defaults'](config['redis'],{'host':_0x3515('0xd'),'port':0x18eb});var socket=require(_0x3515('0xe'))(new Redis(config[_0x3515('0xc')]));require('./smsInteraction.socket')[_0x3515('0xf')](socket);function respondWithRpcPromise(_0x2a9c57,_0x5400bc,_0x4b4c6f){return new BPromise(function(_0x16f00f,_0x4d0302){return client['request'](_0x2a9c57,_0x4b4c6f)['then'](function(_0x395ec8){logger[_0x3515('0x10')](_0x3515('0x11'),_0x5400bc,_0x3515('0x12'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5400bc,_0x3515('0x12'),JSON[_0x3515('0x13')](_0x395ec8));if(_0x395ec8[_0x3515('0x14')]){if(_0x395ec8[_0x3515('0x14')]['code']===0x1f4){logger['error'](_0x3515('0x11'),_0x5400bc,_0x395ec8['error'][_0x3515('0x15')]);return _0x4d0302(_0x395ec8[_0x3515('0x14')][_0x3515('0x15')]);}logger[_0x3515('0x14')](_0x3515('0x11'),_0x5400bc,_0x395ec8['error']['message']);return _0x16f00f(_0x395ec8[_0x3515('0x14')][_0x3515('0x15')]);}else{logger['info'](_0x3515('0x11'),_0x5400bc,'request\x20sent');_0x16f00f(_0x395ec8[_0x3515('0x16')][_0x3515('0x15')]);}})[_0x3515('0x17')](function(_0x55d565){logger[_0x3515('0x14')](_0x3515('0x11'),_0x5400bc,_0x55d565);_0x4d0302(_0x55d565);});});}exports[_0x3515('0x18')]=function(_0x364c3f){var _0x4261b1=this;return new Promise(function(_0x1eb40a,_0x3f48d3){return db[_0x3515('0x19')]['update'](_0x364c3f[_0x3515('0x1a')],{'raw':_0x364c3f['options']?_0x364c3f['options'][_0x3515('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x364c3f[_0x3515('0x1c')]?_0x364c3f[_0x3515('0x1c')][_0x3515('0x1d')]||null:null,'attributes':_0x364c3f[_0x3515('0x1c')]?_0x364c3f[_0x3515('0x1c')][_0x3515('0x1e')]||null:null,'limit':_0x364c3f[_0x3515('0x1c')]?_0x364c3f[_0x3515('0x1c')]['limit']||null:null})[_0x3515('0x1f')](function(_0x5287f7){logger[_0x3515('0x10')](_0x3515('0x18'),_0x364c3f);logger[_0x3515('0x20')](_0x3515('0x18'),_0x364c3f,JSON[_0x3515('0x13')](_0x5287f7));_0x1eb40a(_0x5287f7);})[_0x3515('0x17')](function(_0x386ce6){logger[_0x3515('0x14')](_0x3515('0x18'),_0x386ce6[_0x3515('0x15')],_0x364c3f);_0x3f48d3(_0x4261b1[_0x3515('0x14')](0x1f4,_0x386ce6[_0x3515('0x15')]));});});};exports[_0x3515('0x21')]=function(_0x3ec669){return new Promise(function(_0x101c7d,_0x19dff2){return db[_0x3515('0x19')][_0x3515('0x22')]({'where':_0x3ec669[_0x3515('0x1c')]?_0x3ec669[_0x3515('0x1c')]['where']||null:null})[_0x3515('0x1f')](function(_0x628cf6){if(_0x628cf6){return _0x628cf6['addTags'](_0x3ec669[_0x3515('0x1a')][_0x3515('0x23')],_[_0x3515('0x24')](_0x3ec669[_0x3515('0x1a')],[_0x3515('0x23'),'id'])||{});}})['spread'](function(_0x18022a){logger['info'](_0x3515('0x25'),_0x3ec669);logger[_0x3515('0x20')](_0x3515('0x25'),_0x3ec669,JSON[_0x3515('0x13')](_0x18022a));_0x101c7d(_0x18022a);})[_0x3515('0x17')](function(_0x49ce85){logger[_0x3515('0x14')](_0x3515('0x25'),_0x49ce85[_0x3515('0x15')],_0x3ec669);_0x19dff2(_this[_0x3515('0x14')](0x1f4,_0x49ce85[_0x3515('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index d7e977d..4ec579c 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 _0xe277=['update','emit','removeListener','register','smsInteraction:','./smsInteraction.events','remove'];(function(_0x55511d,_0x346d78){var _0x475e58=function(_0x2363c7){while(--_0x2363c7){_0x55511d['push'](_0x55511d['shift']());}};_0x475e58(++_0x346d78);}(_0xe277,0xfa));var _0x7e27=function(_0x175698,_0x4969c7){_0x175698=_0x175698-0x0;var _0x50263f=_0xe277[_0x175698];return _0x50263f;};'use strict';var SmsInteractionEvents=require(_0x7e27('0x0'));var events=['save',_0x7e27('0x1'),_0x7e27('0x2')];function createListener(_0x4e4bf8,_0x181e98){return function(_0x27044e){_0x181e98[_0x7e27('0x3')](_0x4e4bf8,_0x27044e);};}function removeListener(_0x2a5991,_0x4e8ca1){return function(){SmsInteractionEvents[_0x7e27('0x4')](_0x2a5991,_0x4e8ca1);};}exports[_0x7e27('0x5')]=function(_0x4fdad6){for(var _0x2ae8a6=0x0,_0x574d17=events['length'];_0x2ae8a6<_0x574d17;_0x2ae8a6++){var _0xcfb5ae=events[_0x2ae8a6];var _0x24e646=createListener(_0x7e27('0x6')+_0xcfb5ae,_0x4fdad6);SmsInteractionEvents['on'](_0xcfb5ae,_0x24e646);}}; \ No newline at end of file +var _0x4512=['update','removeListener','register','smsInteraction:'];(function(_0x3c257f,_0x6d7dfd){var _0xc8098=function(_0x59e2e7){while(--_0x59e2e7){_0x3c257f['push'](_0x3c257f['shift']());}};_0xc8098(++_0x6d7dfd);}(_0x4512,0xdc));var _0x2451=function(_0x33cf66,_0x30e414){_0x33cf66=_0x33cf66-0x0;var _0x3a400b=_0x4512[_0x33cf66];return _0x3a400b;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove',_0x2451('0x0')];function createListener(_0x49624b,_0x37a996){return function(_0x3b3414){_0x37a996['emit'](_0x49624b,_0x3b3414);};}function removeListener(_0x13d5e8,_0x3502de){return function(){SmsInteractionEvents[_0x2451('0x1')](_0x13d5e8,_0x3502de);};}exports[_0x2451('0x2')]=function(_0xe9665a){for(var _0x4bdb11=0x0,_0x11a79b=events['length'];_0x4bdb11<_0x11a79b;_0x4bdb11++){var _0x392ba8=events[_0x4bdb11];var _0x54307c=createListener(_0x2451('0x3')+_0x392ba8,_0xe9665a);SmsInteractionEvents['on'](_0x392ba8,_0x54307c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b5010d4..6dac26f 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 _0x664b=['reject','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','smsmessage:create','create','/:id/status','update','put','/:id/accept','/:id/reject'];(function(_0x5f4a04,_0x23906f){var _0x28891c=function(_0x40c05d){while(--_0x40c05d){_0x5f4a04['push'](_0x5f4a04['shift']());}};_0x28891c(++_0x23906f);}(_0x664b,0xc0));var _0xb664=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x664b[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xb664('0x0'));var util=require(_0xb664('0x1'));var path=require(_0xb664('0x2'));var timeout=require(_0xb664('0x3'));var express=require(_0xb664('0x4'));var router=express[_0xb664('0x5')]();var fs_extra=require(_0xb664('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb664('0x7'));var config=require('../../config/environment');var controller=require(_0xb664('0x8'));router[_0xb664('0x9')]('/',auth[_0xb664('0xa')](),controller['index']);router[_0xb664('0x9')](_0xb664('0xb'),auth[_0xb664('0xa')](),controller[_0xb664('0xc')]);router[_0xb664('0x9')](_0xb664('0xd'),auth[_0xb664('0xa')](),controller[_0xb664('0xe')]);router[_0xb664('0xf')]('/',auth['isAuthenticated'](),interaction[_0xb664('0x10')]('sms',_0xb664('0x11')),controller[_0xb664('0x12')]);router[_0xb664('0xf')](_0xb664('0x13'),controller['status']);router['put'](_0xb664('0xd'),auth[_0xb664('0xa')](),controller[_0xb664('0x14')]);router[_0xb664('0x15')](_0xb664('0x16'),auth[_0xb664('0xa')](),controller['accept']);router['put'](_0xb664('0x17'),auth[_0xb664('0xa')](),controller[_0xb664('0x18')]);router[_0xb664('0x19')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb664('0x1a')]=router; \ No newline at end of file +var _0xc210=['post','tracked','sms','smsmessage:create','/:id/status','/:id','update','put','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x430f0f,_0x2e1277){var _0x456dad=function(_0x3421be){while(--_0x3421be){_0x430f0f['push'](_0x430f0f['shift']());}};_0x456dad(++_0x2e1277);}(_0xc210,0x7c));var _0x0c21=function(_0x23496e,_0x5c2620){_0x23496e=_0x23496e-0x0;var _0xd5128e=_0xc210[_0x23496e];return _0xd5128e;};'use strict';var multer=require(_0x0c21('0x0'));var util=require(_0x0c21('0x1'));var path=require('path');var timeout=require(_0x0c21('0x2'));var express=require(_0x0c21('0x3'));var router=express[_0x0c21('0x4')]();var fs_extra=require(_0x0c21('0x5'));var auth=require(_0x0c21('0x6'));var interaction=require(_0x0c21('0x7'));var config=require(_0x0c21('0x8'));var controller=require(_0x0c21('0x9'));router[_0x0c21('0xa')]('/',auth[_0x0c21('0xb')](),controller[_0x0c21('0xc')]);router[_0x0c21('0xa')](_0x0c21('0xd'),auth['isAuthenticated'](),controller[_0x0c21('0xe')]);router['get']('/:id',auth[_0x0c21('0xb')](),controller[_0x0c21('0xf')]);router[_0x0c21('0x10')]('/',auth[_0x0c21('0xb')](),interaction[_0x0c21('0x11')](_0x0c21('0x12'),_0x0c21('0x13')),controller['create']);router[_0x0c21('0x10')](_0x0c21('0x14'),controller['status']);router['put'](_0x0c21('0x15'),auth[_0x0c21('0xb')](),controller[_0x0c21('0x16')]);router[_0x0c21('0x17')]('/:id/accept',auth[_0x0c21('0xb')](),controller[_0x0c21('0x18')]);router[_0x0c21('0x17')](_0x0c21('0x19'),auth[_0x0c21('0xb')](),controller['reject']);router['delete'](_0x0c21('0x15'),auth[_0x0c21('0xb')](),controller[_0x0c21('0x1a')]);module[_0x0c21('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 8925d94..437110b 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 _0xc95e=['BOOLEAN','STRING','DATE','TEXT','sequelize','exports','medium'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xc95e,0x14d));var _0xec95=function(_0xed4f19,_0x13e9fa){_0xed4f19=_0xed4f19-0x0;var _0x4c457d=_0xc95e[_0xed4f19];return _0x4c457d;};'use strict';var Sequelize=require(_0xec95('0x0'));module[_0xec95('0x1')]={'body':{'type':Sequelize['TEXT'](_0xec95('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xec95('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xec95('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xec95('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xec95('0x4')]},'providerResponse':{'type':Sequelize[_0xec95('0x6')]}}; \ No newline at end of file +var _0x9d9d=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x23f7b6,_0x31a9e0){var _0x29c500=function(_0x1232f4){while(--_0x1232f4){_0x23f7b6['push'](_0x23f7b6['shift']());}};_0x29c500(++_0x31a9e0);}(_0x9d9d,0x129));var _0xd9d9=function(_0x56cb27,_0x55694b){_0x56cb27=_0x56cb27-0x0;var _0xb34bb=_0x9d9d[_0x56cb27];return _0xb34bb;};'use strict';var Sequelize=require('sequelize');module[_0xd9d9('0x0')]={'body':{'type':Sequelize[_0xd9d9('0x1')](_0xd9d9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd9d9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9d9('0x4')]('in','out'),'defaultValue':_0xd9d9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd9d9('0x6')](0xbe)},'phone':{'type':Sequelize[_0xd9d9('0x6')]},'readAt':{'type':Sequelize[_0xd9d9('0x7')]},'secret':{'type':Sequelize[_0xd9d9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd9d9('0x6')]},'providerResponse':{'type':Sequelize[_0xd9d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b67fec7..0ae863d 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 _0xf087=['client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','map','SmsMessage','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','params','describe','sms','read','UserId','agent','SmsInteraction','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','format','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','Status','plivio','groupName','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf087,0x101));var _0x7f08=function(_0x3f97af,_0x332428){_0x3f97af=_0x3f97af-0x0;var _0xdb6c3c=_0xf087[_0x3f97af];return _0xdb6c3c;};'use strict';var emlformat=require(_0x7f08('0x0'));var rimraf=require(_0x7f08('0x1'));var zipdir=require(_0x7f08('0x2'));var jsonpatch=require(_0x7f08('0x3'));var rp=require(_0x7f08('0x4'));var moment=require('moment');var BPromise=require(_0x7f08('0x5'));var Mustache=require('mustache');var util=require(_0x7f08('0x6'));var path=require(_0x7f08('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f08('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7f08('0x9'));var crypto=require('crypto');var jsforce=require(_0x7f08('0xa'));var deskjs=require(_0x7f08('0xb'));var toCsv=require(_0x7f08('0xc'));var querystring=require(_0x7f08('0xd'));var Papa=require('papaparse');var Redis=require(_0x7f08('0xe'));var authService=require(_0x7f08('0xf'));var qs=require(_0x7f08('0x10'));var as=require(_0x7f08('0x11'));var hardwareService=require(_0x7f08('0x12'));var logger=require(_0x7f08('0x13'))(_0x7f08('0x14'));var utils=require(_0x7f08('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7f08('0x16'));var db=require(_0x7f08('0x17'))['db'];config[_0x7f08('0x18')]=_[_0x7f08('0x19')](config['redis'],{'host':_0x7f08('0x1a'),'port':0x18eb});var socket=require(_0x7f08('0x1b'))(new Redis(config['redis']));require(_0x7f08('0x1c'))[_0x7f08('0x1d')](socket);var jayson=require(_0x7f08('0x1e'));var client=jayson[_0x7f08('0x1f')][_0x7f08('0x20')]({'port':0x232c});var client9002=jayson[_0x7f08('0x1f')][_0x7f08('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3bd864,_0x3a9e8e,_0x55b7af,_0x34bc7a){return new BPromise(function(_0x134c91,_0x18bbd7){var _0x23b33f=_0x34bc7a||client;return _0x23b33f[_0x7f08('0x21')](_0x3bd864,_0x55b7af)[_0x7f08('0x22')](function(_0x1098f1){logger['info'](_0x7f08('0x23'),_0x3a9e8e,_0x7f08('0x24'));logger[_0x7f08('0x25')](_0x7f08('0x26'),_0x3a9e8e,_0x7f08('0x24'),JSON[_0x7f08('0x27')](_0x1098f1));if(_0x1098f1['error']){if(_0x1098f1[_0x7f08('0x28')][_0x7f08('0x29')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x3a9e8e,_0x1098f1['error'][_0x7f08('0x2a')]);return _0x18bbd7(_0x1098f1[_0x7f08('0x28')]['message']);}logger[_0x7f08('0x28')](_0x7f08('0x23'),_0x3a9e8e,_0x1098f1[_0x7f08('0x28')]['message']);return _0x134c91(_0x1098f1[_0x7f08('0x28')][_0x7f08('0x2a')]);}else{logger[_0x7f08('0x2b')](_0x7f08('0x23'),_0x3a9e8e,_0x7f08('0x24'));_0x134c91(_0x1098f1['result'][_0x7f08('0x2a')]);}})['catch'](function(_0x3f41e5){logger[_0x7f08('0x28')](_0x7f08('0x23'),_0x3a9e8e,_0x3f41e5);_0x18bbd7(_0x3f41e5);});});}function respondWithStatusCode(_0x19e9e6,_0x4f86f7){_0x4f86f7=_0x4f86f7||0xcc;return function(_0x5a8738){if(_0x5a8738){return _0x19e9e6[_0x7f08('0x2c')](_0x4f86f7);}return _0x19e9e6[_0x7f08('0x2d')](_0x4f86f7)[_0x7f08('0x2e')]();};}function respondWithResult(_0x3e10b6,_0x3ea6a8){_0x3ea6a8=_0x3ea6a8||0xc8;return function(_0x60fa10){if(_0x60fa10){return _0x3e10b6[_0x7f08('0x2d')](_0x3ea6a8)[_0x7f08('0x2f')](_0x60fa10);}};}function respondWithFilteredResult(_0x600a59,_0x4b5c29){return function(_0xea0aa0){if(_0xea0aa0){var _0x3a409a=typeof _0x4b5c29[_0x7f08('0x30')]===_0x7f08('0x31')&&typeof _0x4b5c29[_0x7f08('0x32')]===_0x7f08('0x31');var _0xd828f0=_0xea0aa0[_0x7f08('0x33')];var _0x4d8175=_0x3a409a?0x0:_0x4b5c29[_0x7f08('0x30')];var _0x574b20=_0x3a409a?_0xea0aa0['count']:_0x4b5c29[_0x7f08('0x30')]+_0x4b5c29[_0x7f08('0x32')];var _0x18bb20;if(_0x574b20>=_0xd828f0){_0x574b20=_0xd828f0;_0x18bb20=0xc8;}else{_0x18bb20=0xce;}_0x600a59[_0x7f08('0x2d')](_0x18bb20);return _0x600a59[_0x7f08('0x34')](_0x7f08('0x35'),_0x4d8175+'-'+_0x574b20+'/'+_0xd828f0)[_0x7f08('0x2f')](_0xea0aa0);}return null;};}function patchUpdates(_0x20d1b2){return function(_0x22abb6){try{jsonpatch['apply'](_0x22abb6,_0x20d1b2,!![]);}catch(_0x330ed7){return BPromise[_0x7f08('0x36')](_0x330ed7);}return _0x22abb6[_0x7f08('0x37')]();};}function saveUpdates(_0x34d012,_0x2e0dc6){return function(_0x124acd){if(_0x124acd){return _0x124acd[_0x7f08('0x38')](_0x34d012)[_0x7f08('0x22')](function(_0x414a49){return _0x414a49;});}return null;};}function removeEntity(_0x3ff95c,_0x5d8910){return function(_0x46f602){if(_0x46f602){return _0x46f602[_0x7f08('0x39')]()[_0x7f08('0x22')](function(){_0x3ff95c[_0x7f08('0x2d')](0xcc)[_0x7f08('0x2e')]();});}};}function handleEntityNotFound(_0x3688c8,_0x50c6cf){return function(_0x472847){if(!_0x472847){_0x3688c8[_0x7f08('0x2c')](0x194);}return _0x472847;};}function handleError(_0x23285f,_0x27320e){_0x27320e=_0x27320e||0x1f4;return function(_0x282e4f){logger[_0x7f08('0x28')](_0x282e4f[_0x7f08('0x3a')]);if(_0x282e4f[_0x7f08('0x3b')]){delete _0x282e4f[_0x7f08('0x3b')];}_0x23285f[_0x7f08('0x2d')](_0x27320e)['send'](_0x282e4f);};}exports['index']=function(_0x2b3260,_0x1ad8fd){var _0x58ac4d={},_0x37c8f1={},_0x5d4666={'count':0x0,'rows':[]};var _0xda9b7c=_[_0x7f08('0x3c')](db[_0x7f08('0x3d')]['rawAttributes'],function(_0x164cb1){return{'name':_0x164cb1[_0x7f08('0x3e')],'type':_0x164cb1[_0x7f08('0x3f')][_0x7f08('0x40')]};});_0x37c8f1[_0x7f08('0x41')]=_[_0x7f08('0x3c')](_0xda9b7c,_0x7f08('0x3b'));_0x37c8f1[_0x7f08('0x42')]=_[_0x7f08('0x43')](_0x2b3260[_0x7f08('0x42')]);_0x37c8f1['filters']=_[_0x7f08('0x44')](_0x37c8f1['model'],_0x37c8f1['query']);_0x58ac4d[_0x7f08('0x45')]=_['intersection'](_0x37c8f1[_0x7f08('0x41')],qs[_0x7f08('0x46')](_0x2b3260[_0x7f08('0x42')][_0x7f08('0x46')]));_0x58ac4d[_0x7f08('0x45')]=_0x58ac4d['attributes'][_0x7f08('0x47')]?_0x58ac4d['attributes']:_0x37c8f1[_0x7f08('0x41')];if(!_0x2b3260[_0x7f08('0x42')][_0x7f08('0x48')](_0x7f08('0x49'))){_0x58ac4d[_0x7f08('0x32')]=qs[_0x7f08('0x32')](_0x2b3260['query'][_0x7f08('0x32')]);_0x58ac4d[_0x7f08('0x30')]=qs['offset'](_0x2b3260['query'][_0x7f08('0x30')]);}_0x58ac4d[_0x7f08('0x4a')]=qs[_0x7f08('0x4b')](_0x2b3260[_0x7f08('0x42')][_0x7f08('0x4b')]);_0x58ac4d[_0x7f08('0x4c')]=qs['filters'](_['pick'](_0x2b3260[_0x7f08('0x42')],_0x37c8f1[_0x7f08('0x4d')]),_0xda9b7c);if(_0x2b3260[_0x7f08('0x42')][_0x7f08('0x4e')]){_0x58ac4d[_0x7f08('0x4c')]=_[_0x7f08('0x4f')](_0x58ac4d[_0x7f08('0x4c')],{'$or':_[_0x7f08('0x3c')](_0xda9b7c,function(_0x3fc48f){if(_0x3fc48f['type']!==_0x7f08('0x50')){var _0x2fad7a={};_0x2fad7a[_0x3fc48f[_0x7f08('0x3b')]]={'$like':'%'+_0x2b3260[_0x7f08('0x42')]['filter']+'%'};return _0x2fad7a;}})});}_0x58ac4d=_[_0x7f08('0x4f')]({},_0x58ac4d,_0x2b3260[_0x7f08('0x51')]);var _0xdf948c={'where':_0x58ac4d[_0x7f08('0x4c')]};return db[_0x7f08('0x3d')]['count'](_0xdf948c)[_0x7f08('0x22')](function(_0x2cce81){_0x5d4666['count']=_0x2cce81;if(_0x2b3260[_0x7f08('0x42')][_0x7f08('0x52')]){_0x58ac4d[_0x7f08('0x53')]=[{'all':!![]}];}return db[_0x7f08('0x3d')][_0x7f08('0x54')](_0x58ac4d);})[_0x7f08('0x22')](function(_0x784516){_0x5d4666['rows']=_0x784516;return _0x5d4666;})[_0x7f08('0x22')](respondWithFilteredResult(_0x1ad8fd,_0x58ac4d))[_0x7f08('0x55')](handleError(_0x1ad8fd,null));};exports[_0x7f08('0x56')]=function(_0x35ea3a,_0x27fdb1){var _0x1eb30e={'raw':!![],'where':{'id':_0x35ea3a['params']['id']}},_0xf09f86={};_0xf09f86['model']=_[_0x7f08('0x43')](db[_0x7f08('0x3d')][_0x7f08('0x57')]);_0xf09f86[_0x7f08('0x42')]=_[_0x7f08('0x43')](_0x35ea3a['query']);_0xf09f86[_0x7f08('0x4d')]=_[_0x7f08('0x44')](_0xf09f86['model'],_0xf09f86[_0x7f08('0x42')]);_0x1eb30e[_0x7f08('0x45')]=_['intersection'](_0xf09f86[_0x7f08('0x41')],qs[_0x7f08('0x46')](_0x35ea3a[_0x7f08('0x42')][_0x7f08('0x46')]));_0x1eb30e[_0x7f08('0x45')]=_0x1eb30e[_0x7f08('0x45')]['length']?_0x1eb30e[_0x7f08('0x45')]:_0xf09f86[_0x7f08('0x41')];if(_0x35ea3a['query'][_0x7f08('0x52')]){_0x1eb30e[_0x7f08('0x53')]=[{'all':!![]}];}_0x1eb30e=_[_0x7f08('0x4f')]({},_0x1eb30e,_0x35ea3a['options']);return db[_0x7f08('0x3d')][_0x7f08('0x58')](_0x1eb30e)[_0x7f08('0x22')](handleEntityNotFound(_0x27fdb1,null))[_0x7f08('0x22')](respondWithResult(_0x27fdb1,null))['catch'](handleError(_0x27fdb1,null));};exports[_0x7f08('0x59')]=function(_0x5882b1,_0x3b2519){return db[_0x7f08('0x3d')]['create'](_0x5882b1[_0x7f08('0x5a')],{})[_0x7f08('0x22')](respondWithResult(_0x3b2519,0xc9))[_0x7f08('0x55')](handleError(_0x3b2519,null));};exports[_0x7f08('0x38')]=function(_0x1561e2,_0x300917){if(_0x1561e2[_0x7f08('0x5a')]['id']){delete _0x1561e2[_0x7f08('0x5a')]['id'];}return db[_0x7f08('0x3d')]['find']({'where':{'id':_0x1561e2[_0x7f08('0x5b')]['id']}})[_0x7f08('0x22')](handleEntityNotFound(_0x300917,null))[_0x7f08('0x22')](saveUpdates(_0x1561e2['body'],null))['then'](respondWithResult(_0x300917,null))['catch'](handleError(_0x300917,null));};exports[_0x7f08('0x39')]=function(_0x424530,_0x38e1a5){return db[_0x7f08('0x3d')][_0x7f08('0x58')]({'where':{'id':_0x424530[_0x7f08('0x5b')]['id']}})[_0x7f08('0x22')](handleEntityNotFound(_0x38e1a5,null))[_0x7f08('0x22')](removeEntity(_0x38e1a5,null))[_0x7f08('0x55')](handleError(_0x38e1a5,null));};exports[_0x7f08('0x5c')]=function(_0x6271a6,_0x5084b5){return db['SmsMessage'][_0x7f08('0x5c')]()[_0x7f08('0x22')](respondWithResult(_0x5084b5,null))[_0x7f08('0x55')](handleError(_0x5084b5,null));};var interaction_log=require(_0x7f08('0x13'))('sms-interactions');exports['accept']=function(_0x2fbf74,_0x35b567,_0x5efe31){var _0x426351={'agent':{},'channel':_0x7f08('0x5d')};if(_0x2fbf74[_0x7f08('0x5a')]['id']){delete _0x2fbf74['body']['id'];}_0x2fbf74[_0x7f08('0x5a')][_0x7f08('0x5e')]=!![];_0x2fbf74[_0x7f08('0x5a')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2fbf74[_0x7f08('0x5a')]['UserId']=_0x2fbf74[_0x7f08('0x5a')][_0x7f08('0x5f')]||_0x2fbf74['user']['id'];_0x426351[_0x7f08('0x60')]['id']=_0x2fbf74[_0x7f08('0x5a')][_0x7f08('0x5f')];return db[_0x7f08('0x3d')][_0x7f08('0x58')]({'where':{'id':_0x2fbf74[_0x7f08('0x5b')]['id'],'UserId':null}})[_0x7f08('0x22')](handleEntityNotFound(_0x35b567,null))[_0x7f08('0x22')](saveUpdates(_0x2fbf74[_0x7f08('0x5a')],null))['then'](function(_0x1dfa82){if(_0x1dfa82){_0x426351[_0x7f08('0x2a')]=_0x1dfa82['get']({'plain':!![]});return db[_0x7f08('0x61')][_0x7f08('0x58')]({'where':{'id':_0x1dfa82[_0x7f08('0x62')]}});}return null;})[_0x7f08('0x22')](handleEntityNotFound(_0x35b567,null))[_0x7f08('0x22')](function(_0x11dd9d){if(_0x11dd9d){return _0x11dd9d['update']({'UserId':_0x2fbf74[_0x7f08('0x5a')][_0x7f08('0x5f')],'read1stAt':_[_0x7f08('0x63')](_0x11dd9d['read1stAt'])?moment()['format'](_0x7f08('0x64')):undefined});}return null;})[_0x7f08('0x22')](function(_0x3ab1f9){if(_0x3ab1f9){_0x426351[_0x7f08('0x65')]=_0x3ab1f9[_0x7f08('0x66')]({'plain':!![]});interaction_log[_0x7f08('0x2b')](_0x7f08('0x67'),_0x2fbf74[_0x7f08('0x68')]['id'],_0x2fbf74[_0x7f08('0x68')][_0x7f08('0x3b')],_0x2fbf74[_0x7f08('0x68')][_0x7f08('0x69')],_0x426351[_0x7f08('0x65')]['id'],_0x2fbf74['body']?JSON[_0x7f08('0x27')](_0x2fbf74[_0x7f08('0x5a')]):_0x7f08('0x6a'));return respondWithRpcPromise(_0x7f08('0x6b'),_0x7f08('0x6c'),_0x426351);}return null;})['then'](function(_0x26031c){var _0x3bf44f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x26031c['message'][_0x7f08('0x6d')];return db[_0x7f08('0x6e')][_0x7f08('0x42')](_0x3bf44f,{'type':db['Sequelize'][_0x7f08('0x6f')]['SELECT'],'raw':!![]})[_0x7f08('0x22')](function(_0x5e9320){return _0x5e9320;});})[_0x7f08('0x22')](function(_0x38061f){if(_0x38061f){_0x426351['message'][_0x7f08('0x70')]=_0x38061f[0x0];if(!_0x2fbf74[_0x7f08('0x5a')][_0x7f08('0x5f')])return;return db[_0x7f08('0x71')][_0x7f08('0x58')]({'where':{'id':_0x2fbf74[_0x7f08('0x5a')]['UserId'],'role':_0x7f08('0x60')},'attributes':['id',_0x7f08('0x3b'),_0x7f08('0x72'),_0x7f08('0x73'),_0x7f08('0x74')],'raw':!![]});}return null;})[_0x7f08('0x22')](function(_0xf10d4f){if(!_0xf10d4f)return null;_0x426351[_0x7f08('0x2a')][_0x7f08('0x60')]=_0xf10d4f;return _0x426351;})[_0x7f08('0x22')](function(_0x246b8a){if(_0x246b8a){if(_0x2fbf74[_0x7f08('0x5a')]['manual']){_0x426351[_0x7f08('0x2a')][_0x7f08('0x75')]=util['format'](_0x7f08('0x76'),_0x2fbf74[_0x7f08('0x68')][_0x7f08('0x3b')]);_0x426351[_0x7f08('0x2a')][_0x7f08('0x77')]=_0x426351['channel'];_0x426351[_0x7f08('0x2a')][_0x7f08('0x78')]=_0x426351[_0x7f08('0x77')];_0x426351[_0x7f08('0x2a')][_0x7f08('0x79')]='accept';return respondWithRpcPromise(_0x7f08('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x426351[_0x7f08('0x2a')]},client9002)['then'](function(){return _0x426351;});}return _0x426351;}return null;})[_0x7f08('0x22')](respondWithResult(_0x35b567,null))[_0x7f08('0x55')](handleError(_0x35b567,null));};var interaction_log=require(_0x7f08('0x13'))('sms-interactions');exports[_0x7f08('0x36')]=function(_0x6b6d80,_0x2da1c6,_0x264d46){var _0x86ee1={'agent':{},'channel':_0x7f08('0x5d')};if(_0x6b6d80['body']['id']){delete _0x6b6d80[_0x7f08('0x5a')]['id'];}_0x6b6d80['body'][_0x7f08('0x5f')]=_0x6b6d80[_0x7f08('0x5a')][_0x7f08('0x5f')]||_0x6b6d80[_0x7f08('0x68')]['id'];_0x86ee1[_0x7f08('0x60')]['id']=_0x6b6d80[_0x7f08('0x5a')][_0x7f08('0x5f')];return db[_0x7f08('0x3d')]['find']({'where':{'id':_0x6b6d80[_0x7f08('0x5b')]['id'],'UserId':null}})[_0x7f08('0x22')](handleEntityNotFound(_0x2da1c6,null))['then'](function(_0xbd2ab1){if(_0xbd2ab1){_0x86ee1[_0x7f08('0x2a')]=_0xbd2ab1[_0x7f08('0x66')]({'plain':!![]});return db[_0x7f08('0x61')]['find']({'where':{'id':_0xbd2ab1['SmsInteractionId']}});}return null;})[_0x7f08('0x22')](handleEntityNotFound(_0x2da1c6,null))[_0x7f08('0x22')](function(_0x17dbf4){if(_0x17dbf4){_0x86ee1[_0x7f08('0x65')]=_0x17dbf4[_0x7f08('0x66')]({'plain':!![]});interaction_log[_0x7f08('0x2b')](_0x7f08('0x7b'),_0x6b6d80[_0x7f08('0x68')]['id'],_0x6b6d80['user'][_0x7f08('0x3b')],_0x6b6d80[_0x7f08('0x68')]['role'],_0x86ee1[_0x7f08('0x65')]['id'],_0x6b6d80[_0x7f08('0x5a')]?JSON[_0x7f08('0x27')](_0x6b6d80[_0x7f08('0x5a')]):_0x7f08('0x6a'));return respondWithRpcPromise(_0x7f08('0x7c'),_0x7f08('0x7d'),_0x86ee1);}return null;})[_0x7f08('0x22')](function(_0x10b01f){var _0x4d88e5=_0x7f08('0x7e')+_0x10b01f['message'][_0x7f08('0x6d')];return db['sequelize']['query'](_0x4d88e5,{'type':db[_0x7f08('0x7f')][_0x7f08('0x6f')][_0x7f08('0x80')],'raw':!![]})[_0x7f08('0x22')](function(_0x55ec23){return _0x55ec23;});})['then'](function(_0xb2e175){if(_0xb2e175){_0x86ee1[_0x7f08('0x2a')][_0x7f08('0x70')]=_0xb2e175[0x0];if(!_0x6b6d80[_0x7f08('0x5a')][_0x7f08('0x5f')])return;return db[_0x7f08('0x71')][_0x7f08('0x58')]({'where':{'id':_0x6b6d80[_0x7f08('0x5a')][_0x7f08('0x5f')],'role':_0x7f08('0x60')},'attributes':['id',_0x7f08('0x3b'),_0x7f08('0x72'),_0x7f08('0x73'),_0x7f08('0x74')],'raw':!![]});}return null;})[_0x7f08('0x22')](function(_0x58c669){if(!_0x58c669)return null;_0x86ee1[_0x7f08('0x2a')][_0x7f08('0x60')]=_0x58c669;return _0x86ee1;})[_0x7f08('0x22')](function(_0x5b83cb){if(_0x5b83cb){_0x5b83cb[_0x7f08('0x2a')][_0x7f08('0x75')]=util[_0x7f08('0x81')](_0x7f08('0x76'),_0x6b6d80[_0x7f08('0x68')][_0x7f08('0x3b')]);_0x5b83cb[_0x7f08('0x2a')][_0x7f08('0x77')]=_0x86ee1[_0x7f08('0x77')];_0x5b83cb[_0x7f08('0x2a')]['motionChannel']=_0x86ee1[_0x7f08('0x77')];_0x5b83cb[_0x7f08('0x2a')][_0x7f08('0x79')]=_0x7f08('0x36');respondWithRpcPromise(_0x7f08('0x7a'),_0x7f08('0x7a'),{'event':_0x7f08('0x82'),'message':_0x5b83cb['message']},client9002);return _0x86ee1;}return null;})[_0x7f08('0x22')](respondWithResult(_0x2da1c6,null))[_0x7f08('0x55')](handleError(_0x2da1c6,null));};exports[_0x7f08('0x2d')]=function(_0x540952,_0x1ee219,_0x22dad7){if(_0x540952[_0x7f08('0x5a')]['id']){delete _0x540952['body']['id'];}var _0xe66302;return db[_0x7f08('0x3d')]['find']({'where':{'id':_0x540952[_0x7f08('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1ee219,null))[_0x7f08('0x22')](function(_0x3154b5){if(_0x3154b5){_0xe66302=_0x3154b5;return db['SmsAccount']['find']({'where':{'id':_0x3154b5[_0x7f08('0x83')]}});}})[_0x7f08('0x22')](handleEntityNotFound(_0x1ee219,null))[_0x7f08('0x22')](function(_0xb8c846){if(_0xb8c846){logger['debug'](_0x7f08('0x26'),'status',_0x7f08('0x84'),_0xb8c846[_0x7f08('0x3f')],util[_0x7f08('0x85')](_0x540952[_0x7f08('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb8c846[_0x7f08('0x3f')]){case _0x7f08('0x86'):if(_0x540952[_0x7f08('0x5a')][_0x7f08('0x87')]&&_0x540952[_0x7f08('0x5a')][_0x7f08('0x87')]===_0xe66302[_0x7f08('0x88')]){return _0xe66302[_0x7f08('0x38')]({'read':!![]});}else{logger[_0x7f08('0x28')](_0x7f08('0x89'),_0x7f08('0x2d'),_0x7f08('0x86'),util[_0x7f08('0x85')](_0x540952[_0x7f08('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x540952[_0x7f08('0x5a')]['MessageUUID']&&_0x540952[_0x7f08('0x5a')][_0x7f08('0x8a')]===_0xe66302[_0x7f08('0x88')]&&_[_0x7f08('0x8b')](['sent','delivered'],_0x540952[_0x7f08('0x5a')][_0x7f08('0x8c')])>=0x0){return _0xe66302[_0x7f08('0x38')]({'read':!![]});}else{logger['error'](_0x7f08('0x89'),_0x7f08('0x2d'),_0x7f08('0x8d'),util[_0x7f08('0x85')](_0x540952[_0x7f08('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x107bff=_0x540952[_0x7f08('0x5a')]['results'][0x0];if(_0x107bff['status'][_0x7f08('0x8e')]==='DELIVERED'){return _0xe66302[_0x7f08('0x38')]({'read':!![]});}else{logger[_0x7f08('0x28')](_0x7f08('0x89'),'status',_0x7f08('0x8f'),util[_0x7f08('0x85')](_0x540952[_0x7f08('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0xe66302;}})[_0x7f08('0x22')](respondWithResult(_0x1ee219,null))[_0x7f08('0x55')](handleError(_0x1ee219,null));}; \ No newline at end of file +var _0xbd8e=['SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','plivio','results','DELIVERED','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','SmsMessage','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','options','find','create','body','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT','User','fullname','rejectmessage','SmsAccount','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId'];(function(_0x46a06a,_0x215ead){var _0x29142a=function(_0x31a8cf){while(--_0x31a8cf){_0x46a06a['push'](_0x46a06a['shift']());}};_0x29142a(++_0x215ead);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd8e[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xebd8('0x0'));var rimraf=require(_0xebd8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xebd8('0x2'));var moment=require('moment');var BPromise=require(_0xebd8('0x3'));var Mustache=require(_0xebd8('0x4'));var util=require(_0xebd8('0x5'));var path=require(_0xebd8('0x6'));var sox=require(_0xebd8('0x7'));var csv=require('to-csv');var ejs=require(_0xebd8('0x8'));var fs=require('fs');var fs_extra=require(_0xebd8('0x9'));var _=require(_0xebd8('0xa'));var squel=require(_0xebd8('0xb'));var crypto=require(_0xebd8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xebd8('0xd'));var toCsv=require(_0xebd8('0xe'));var querystring=require(_0xebd8('0xf'));var Papa=require(_0xebd8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xebd8('0x11'));var hardwareService=require(_0xebd8('0x12'));var logger=require(_0xebd8('0x13'))(_0xebd8('0x14'));var utils=require(_0xebd8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xebd8('0x16'));var db=require('../../mysqldb')['db'];config[_0xebd8('0x17')]=_[_0xebd8('0x18')](config['redis'],{'host':_0xebd8('0x19'),'port':0x18eb});var socket=require(_0xebd8('0x1a'))(new Redis(config[_0xebd8('0x17')]));require('./smsMessage.socket')[_0xebd8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xebd8('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0xebd8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x10d4eb,_0x2162ad,_0x358651,_0x3a84de){return new BPromise(function(_0x2b6ac4,_0x17853a){var _0x33ceac=_0x3a84de||client;return _0x33ceac[_0xebd8('0x1e')](_0x10d4eb,_0x358651)[_0xebd8('0x1f')](function(_0x22152a){logger[_0xebd8('0x20')](_0xebd8('0x21'),_0x2162ad,_0xebd8('0x22'));logger['debug'](_0xebd8('0x23'),_0x2162ad,_0xebd8('0x22'),JSON[_0xebd8('0x24')](_0x22152a));if(_0x22152a[_0xebd8('0x25')]){if(_0x22152a[_0xebd8('0x25')][_0xebd8('0x26')]===0x1f4){logger[_0xebd8('0x25')](_0xebd8('0x21'),_0x2162ad,_0x22152a[_0xebd8('0x25')]['message']);return _0x17853a(_0x22152a[_0xebd8('0x25')][_0xebd8('0x27')]);}logger[_0xebd8('0x25')](_0xebd8('0x21'),_0x2162ad,_0x22152a[_0xebd8('0x25')][_0xebd8('0x27')]);return _0x2b6ac4(_0x22152a[_0xebd8('0x25')][_0xebd8('0x27')]);}else{logger[_0xebd8('0x20')](_0xebd8('0x21'),_0x2162ad,_0xebd8('0x22'));_0x2b6ac4(_0x22152a[_0xebd8('0x28')][_0xebd8('0x27')]);}})['catch'](function(_0x3e1654){logger['error'](_0xebd8('0x21'),_0x2162ad,_0x3e1654);_0x17853a(_0x3e1654);});});}function respondWithStatusCode(_0x2758e6,_0x2aea80){_0x2aea80=_0x2aea80||0xcc;return function(_0xed6322){if(_0xed6322){return _0x2758e6['sendStatus'](_0x2aea80);}return _0x2758e6['status'](_0x2aea80)[_0xebd8('0x29')]();};}function respondWithResult(_0xe177c3,_0x1fd2b3){_0x1fd2b3=_0x1fd2b3||0xc8;return function(_0x16ddbd){if(_0x16ddbd){return _0xe177c3[_0xebd8('0x2a')](_0x1fd2b3)[_0xebd8('0x2b')](_0x16ddbd);}};}function respondWithFilteredResult(_0x427709,_0x5b0db9){return function(_0x5284df){if(_0x5284df){var _0x352a96=typeof _0x5b0db9['offset']===_0xebd8('0x2c')&&typeof _0x5b0db9['limit']===_0xebd8('0x2c');var _0x2830fe=_0x5284df['count'];var _0x197a05=_0x352a96?0x0:_0x5b0db9['offset'];var _0x1dc147=_0x352a96?_0x5284df[_0xebd8('0x2d')]:_0x5b0db9[_0xebd8('0x2e')]+_0x5b0db9['limit'];var _0x486879;if(_0x1dc147>=_0x2830fe){_0x1dc147=_0x2830fe;_0x486879=0xc8;}else{_0x486879=0xce;}_0x427709[_0xebd8('0x2a')](_0x486879);return _0x427709[_0xebd8('0x2f')](_0xebd8('0x30'),_0x197a05+'-'+_0x1dc147+'/'+_0x2830fe)['json'](_0x5284df);}return null;};}function patchUpdates(_0x101e00){return function(_0x7fa6dc){try{jsonpatch[_0xebd8('0x31')](_0x7fa6dc,_0x101e00,!![]);}catch(_0x18d79c){return BPromise[_0xebd8('0x32')](_0x18d79c);}return _0x7fa6dc[_0xebd8('0x33')]();};}function saveUpdates(_0x40a9ae,_0x1813f9){return function(_0x108180){if(_0x108180){return _0x108180[_0xebd8('0x34')](_0x40a9ae)[_0xebd8('0x1f')](function(_0x12e56b){return _0x12e56b;});}return null;};}function removeEntity(_0x3d2462,_0x2b5157){return function(_0x40d3fc){if(_0x40d3fc){return _0x40d3fc[_0xebd8('0x35')]()[_0xebd8('0x1f')](function(){_0x3d2462[_0xebd8('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d0c33,_0xdc24b5){return function(_0x575851){if(!_0x575851){_0x2d0c33[_0xebd8('0x36')](0x194);}return _0x575851;};}function handleError(_0x2a416a,_0x2cd4a0){_0x2cd4a0=_0x2cd4a0||0x1f4;return function(_0x500cef){logger[_0xebd8('0x25')](_0x500cef['stack']);if(_0x500cef[_0xebd8('0x37')]){delete _0x500cef[_0xebd8('0x37')];}_0x2a416a[_0xebd8('0x2a')](_0x2cd4a0)[_0xebd8('0x38')](_0x500cef);};}exports[_0xebd8('0x39')]=function(_0x132539,_0x3ceab1){var _0x2bf352={},_0x491cef={},_0x144ef4={'count':0x0,'rows':[]};var _0xbf2583=_['map'](db[_0xebd8('0x3a')]['rawAttributes'],function(_0x214275){return{'name':_0x214275[_0xebd8('0x3b')],'type':_0x214275[_0xebd8('0x3c')][_0xebd8('0x3d')]};});_0x491cef['model']=_[_0xebd8('0x3e')](_0xbf2583,_0xebd8('0x37'));_0x491cef[_0xebd8('0x3f')]=_['keys'](_0x132539[_0xebd8('0x3f')]);_0x491cef[_0xebd8('0x40')]=_[_0xebd8('0x41')](_0x491cef[_0xebd8('0x42')],_0x491cef[_0xebd8('0x3f')]);_0x2bf352[_0xebd8('0x43')]=_[_0xebd8('0x41')](_0x491cef[_0xebd8('0x42')],qs[_0xebd8('0x44')](_0x132539[_0xebd8('0x3f')][_0xebd8('0x44')]));_0x2bf352[_0xebd8('0x43')]=_0x2bf352['attributes'][_0xebd8('0x45')]?_0x2bf352[_0xebd8('0x43')]:_0x491cef['model'];if(!_0x132539[_0xebd8('0x3f')][_0xebd8('0x46')](_0xebd8('0x47'))){_0x2bf352['limit']=qs['limit'](_0x132539['query'][_0xebd8('0x48')]);_0x2bf352[_0xebd8('0x2e')]=qs[_0xebd8('0x2e')](_0x132539[_0xebd8('0x3f')]['offset']);}_0x2bf352['order']=qs[_0xebd8('0x49')](_0x132539['query']['sort']);_0x2bf352[_0xebd8('0x4a')]=qs[_0xebd8('0x40')](_[_0xebd8('0x4b')](_0x132539['query'],_0x491cef[_0xebd8('0x40')]),_0xbf2583);if(_0x132539[_0xebd8('0x3f')][_0xebd8('0x4c')]){_0x2bf352[_0xebd8('0x4a')]=_[_0xebd8('0x4d')](_0x2bf352['where'],{'$or':_['map'](_0xbf2583,function(_0x5ed662){if(_0x5ed662[_0xebd8('0x3c')]!==_0xebd8('0x4e')){var _0x566dcd={};_0x566dcd[_0x5ed662[_0xebd8('0x37')]]={'$like':'%'+_0x132539[_0xebd8('0x3f')][_0xebd8('0x4c')]+'%'};return _0x566dcd;}})});}_0x2bf352=_[_0xebd8('0x4d')]({},_0x2bf352,_0x132539['options']);var _0x31ad27={'where':_0x2bf352['where']};return db[_0xebd8('0x3a')][_0xebd8('0x2d')](_0x31ad27)[_0xebd8('0x1f')](function(_0x30851c){_0x144ef4[_0xebd8('0x2d')]=_0x30851c;if(_0x132539[_0xebd8('0x3f')][_0xebd8('0x4f')]){_0x2bf352['include']=[{'all':!![]}];}return db[_0xebd8('0x3a')][_0xebd8('0x50')](_0x2bf352);})[_0xebd8('0x1f')](function(_0x25b10d){_0x144ef4[_0xebd8('0x51')]=_0x25b10d;return _0x144ef4;})['then'](respondWithFilteredResult(_0x3ceab1,_0x2bf352))[_0xebd8('0x52')](handleError(_0x3ceab1,null));};exports[_0xebd8('0x53')]=function(_0x3713b7,_0x3d6f60){var _0x5da9b4={'raw':!![],'where':{'id':_0x3713b7[_0xebd8('0x54')]['id']}},_0x4ebd80={};_0x4ebd80[_0xebd8('0x42')]=_[_0xebd8('0x55')](db[_0xebd8('0x3a')][_0xebd8('0x56')]);_0x4ebd80[_0xebd8('0x3f')]=_[_0xebd8('0x55')](_0x3713b7[_0xebd8('0x3f')]);_0x4ebd80[_0xebd8('0x40')]=_['intersection'](_0x4ebd80['model'],_0x4ebd80[_0xebd8('0x3f')]);_0x5da9b4[_0xebd8('0x43')]=_[_0xebd8('0x41')](_0x4ebd80[_0xebd8('0x42')],qs['fields'](_0x3713b7['query'][_0xebd8('0x44')]));_0x5da9b4[_0xebd8('0x43')]=_0x5da9b4[_0xebd8('0x43')]['length']?_0x5da9b4['attributes']:_0x4ebd80[_0xebd8('0x42')];if(_0x3713b7[_0xebd8('0x3f')]['includeAll']){_0x5da9b4[_0xebd8('0x57')]=[{'all':!![]}];}_0x5da9b4=_['merge']({},_0x5da9b4,_0x3713b7[_0xebd8('0x58')]);return db[_0xebd8('0x3a')][_0xebd8('0x59')](_0x5da9b4)[_0xebd8('0x1f')](handleEntityNotFound(_0x3d6f60,null))[_0xebd8('0x1f')](respondWithResult(_0x3d6f60,null))['catch'](handleError(_0x3d6f60,null));};exports[_0xebd8('0x5a')]=function(_0x30bbeb,_0x279a1){return db[_0xebd8('0x3a')][_0xebd8('0x5a')](_0x30bbeb['body'],{})[_0xebd8('0x1f')](respondWithResult(_0x279a1,0xc9))['catch'](handleError(_0x279a1,null));};exports[_0xebd8('0x34')]=function(_0x282b5a,_0x54174b){if(_0x282b5a[_0xebd8('0x5b')]['id']){delete _0x282b5a[_0xebd8('0x5b')]['id'];}return db[_0xebd8('0x3a')]['find']({'where':{'id':_0x282b5a[_0xebd8('0x54')]['id']}})[_0xebd8('0x1f')](handleEntityNotFound(_0x54174b,null))[_0xebd8('0x1f')](saveUpdates(_0x282b5a[_0xebd8('0x5b')],null))[_0xebd8('0x1f')](respondWithResult(_0x54174b,null))[_0xebd8('0x52')](handleError(_0x54174b,null));};exports[_0xebd8('0x35')]=function(_0x553f3d,_0x461939){return db[_0xebd8('0x3a')]['find']({'where':{'id':_0x553f3d[_0xebd8('0x54')]['id']}})[_0xebd8('0x1f')](handleEntityNotFound(_0x461939,null))[_0xebd8('0x1f')](removeEntity(_0x461939,null))[_0xebd8('0x52')](handleError(_0x461939,null));};exports[_0xebd8('0x5c')]=function(_0x3d5349,_0x5ea8e8){return db[_0xebd8('0x3a')][_0xebd8('0x5c')]()[_0xebd8('0x1f')](respondWithResult(_0x5ea8e8,null))['catch'](handleError(_0x5ea8e8,null));};var interaction_log=require(_0xebd8('0x13'))(_0xebd8('0x5d'));exports[_0xebd8('0x5e')]=function(_0x347fdb,_0xbabeba,_0x48b768){var _0x4187d1={'agent':{},'channel':'sms'};if(_0x347fdb[_0xebd8('0x5b')]['id']){delete _0x347fdb[_0xebd8('0x5b')]['id'];}_0x347fdb['body'][_0xebd8('0x5f')]=!![];_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x60')]=moment()[_0xebd8('0x61')](_0xebd8('0x62'));_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')]=_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')]||_0x347fdb[_0xebd8('0x64')]['id'];_0x4187d1[_0xebd8('0x65')]['id']=_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')];return db['SmsMessage'][_0xebd8('0x59')]({'where':{'id':_0x347fdb['params']['id'],'UserId':null}})[_0xebd8('0x1f')](handleEntityNotFound(_0xbabeba,null))[_0xebd8('0x1f')](saveUpdates(_0x347fdb['body'],null))['then'](function(_0x3f26da){if(_0x3f26da){_0x4187d1['message']=_0x3f26da['get']({'plain':!![]});return db[_0xebd8('0x66')][_0xebd8('0x59')]({'where':{'id':_0x3f26da[_0xebd8('0x67')]}});}return null;})[_0xebd8('0x1f')](handleEntityNotFound(_0xbabeba,null))[_0xebd8('0x1f')](function(_0x3b42f1){if(_0x3b42f1){return _0x3b42f1[_0xebd8('0x34')]({'UserId':_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')],'read1stAt':_['isNil'](_0x3b42f1[_0xebd8('0x68')])?moment()[_0xebd8('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xebd8('0x1f')](function(_0x287653){if(_0x287653){_0x4187d1[_0xebd8('0x69')]=_0x287653['get']({'plain':!![]});interaction_log[_0xebd8('0x20')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x347fdb[_0xebd8('0x64')]['id'],_0x347fdb[_0xebd8('0x64')]['name'],_0x347fdb[_0xebd8('0x64')][_0xebd8('0x6a')],_0x4187d1[_0xebd8('0x69')]['id'],_0x347fdb['body']?JSON[_0xebd8('0x24')](_0x347fdb[_0xebd8('0x5b')]):_0xebd8('0x6b'));return respondWithRpcPromise(_0xebd8('0x6c'),'acceptMessage',_0x4187d1);}return null;})['then'](function(_0x2f7b1d){var _0x5259c9=_0xebd8('0x6d')+_0x2f7b1d[_0xebd8('0x27')]['ContactId'];return db[_0xebd8('0x6e')]['query'](_0x5259c9,{'type':db['Sequelize'][_0xebd8('0x6f')]['SELECT'],'raw':!![]})[_0xebd8('0x1f')](function(_0x3f0653){return _0x3f0653;});})['then'](function(_0x2fd3c4){if(_0x2fd3c4){_0x4187d1[_0xebd8('0x27')][_0xebd8('0x70')]=_0x2fd3c4[0x0];if(!_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')])return;return db['User']['find']({'where':{'id':_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x63')],'role':_0xebd8('0x65')},'attributes':['id','name','fullname',_0xebd8('0x71'),_0xebd8('0x72')],'raw':!![]});}return null;})['then'](function(_0x37cf2b){if(!_0x37cf2b)return null;_0x4187d1[_0xebd8('0x27')][_0xebd8('0x65')]=_0x37cf2b;return _0x4187d1;})[_0xebd8('0x1f')](function(_0xa88494){if(_0xa88494){if(_0x347fdb[_0xebd8('0x5b')][_0xebd8('0x73')]){_0x4187d1[_0xebd8('0x27')][_0xebd8('0x74')]=util[_0xebd8('0x61')](_0xebd8('0x75'),_0x347fdb[_0xebd8('0x64')][_0xebd8('0x37')]);_0x4187d1[_0xebd8('0x27')][_0xebd8('0x76')]=_0x4187d1[_0xebd8('0x76')];_0x4187d1[_0xebd8('0x27')]['motionChannel']=_0x4187d1['channel'];_0x4187d1[_0xebd8('0x27')][_0xebd8('0x77')]='accept';return respondWithRpcPromise('EventManager',_0xebd8('0x78'),{'event':_0xebd8('0x79'),'message':_0x4187d1[_0xebd8('0x27')]},client9002)[_0xebd8('0x1f')](function(){return _0x4187d1;});}return _0x4187d1;}return null;})['then'](respondWithResult(_0xbabeba,null))[_0xebd8('0x52')](handleError(_0xbabeba,null));};var interaction_log=require(_0xebd8('0x13'))('sms-interactions');exports[_0xebd8('0x32')]=function(_0x2fb579,_0x34c278,_0x1740f4){var _0x1fed65={'agent':{},'channel':'sms'};if(_0x2fb579[_0xebd8('0x5b')]['id']){delete _0x2fb579['body']['id'];}_0x2fb579[_0xebd8('0x5b')][_0xebd8('0x63')]=_0x2fb579[_0xebd8('0x5b')][_0xebd8('0x63')]||_0x2fb579[_0xebd8('0x64')]['id'];_0x1fed65['agent']['id']=_0x2fb579[_0xebd8('0x5b')][_0xebd8('0x63')];return db[_0xebd8('0x3a')][_0xebd8('0x59')]({'where':{'id':_0x2fb579['params']['id'],'UserId':null}})[_0xebd8('0x1f')](handleEntityNotFound(_0x34c278,null))['then'](function(_0x40ae77){if(_0x40ae77){_0x1fed65[_0xebd8('0x27')]=_0x40ae77[_0xebd8('0x7a')]({'plain':!![]});return db[_0xebd8('0x66')][_0xebd8('0x59')]({'where':{'id':_0x40ae77[_0xebd8('0x67')]}});}return null;})[_0xebd8('0x1f')](handleEntityNotFound(_0x34c278,null))['then'](function(_0x1bb832){if(_0x1bb832){_0x1fed65['interaction']=_0x1bb832[_0xebd8('0x7a')]({'plain':!![]});interaction_log[_0xebd8('0x20')](_0xebd8('0x7b'),_0x2fb579[_0xebd8('0x64')]['id'],_0x2fb579['user'][_0xebd8('0x37')],_0x2fb579[_0xebd8('0x64')][_0xebd8('0x6a')],_0x1fed65[_0xebd8('0x69')]['id'],_0x2fb579[_0xebd8('0x5b')]?JSON[_0xebd8('0x24')](_0x2fb579[_0xebd8('0x5b')]):_0xebd8('0x6b'));return respondWithRpcPromise(_0xebd8('0x7c'),'rejectMessage',_0x1fed65);}return null;})[_0xebd8('0x1f')](function(_0x4acd19){var _0x313e55=_0xebd8('0x6d')+_0x4acd19[_0xebd8('0x27')]['ContactId'];return db[_0xebd8('0x6e')][_0xebd8('0x3f')](_0x313e55,{'type':db['Sequelize'][_0xebd8('0x6f')][_0xebd8('0x7d')],'raw':!![]})['then'](function(_0x4e20f7){return _0x4e20f7;});})['then'](function(_0x20e538){if(_0x20e538){_0x1fed65['message'][_0xebd8('0x70')]=_0x20e538[0x0];if(!_0x2fb579['body'][_0xebd8('0x63')])return;return db[_0xebd8('0x7e')][_0xebd8('0x59')]({'where':{'id':_0x2fb579['body'][_0xebd8('0x63')],'role':'agent'},'attributes':['id',_0xebd8('0x37'),_0xebd8('0x7f'),_0xebd8('0x71'),_0xebd8('0x72')],'raw':!![]});}return null;})[_0xebd8('0x1f')](function(_0x331045){if(!_0x331045)return null;_0x1fed65[_0xebd8('0x27')][_0xebd8('0x65')]=_0x331045;return _0x1fed65;})[_0xebd8('0x1f')](function(_0x3d886d){if(_0x3d886d){_0x3d886d[_0xebd8('0x27')][_0xebd8('0x74')]=util[_0xebd8('0x61')](_0xebd8('0x75'),_0x2fb579[_0xebd8('0x64')][_0xebd8('0x37')]);_0x3d886d[_0xebd8('0x27')][_0xebd8('0x76')]=_0x1fed65[_0xebd8('0x76')];_0x3d886d[_0xebd8('0x27')]['motionChannel']=_0x1fed65[_0xebd8('0x76')];_0x3d886d[_0xebd8('0x27')][_0xebd8('0x77')]=_0xebd8('0x32');respondWithRpcPromise('EventManager','EventManager',{'event':_0xebd8('0x80'),'message':_0x3d886d[_0xebd8('0x27')]},client9002);return _0x1fed65;}return null;})[_0xebd8('0x1f')](respondWithResult(_0x34c278,null))['catch'](handleError(_0x34c278,null));};exports[_0xebd8('0x2a')]=function(_0x5cda43,_0x10aea6,_0x46112b){if(_0x5cda43[_0xebd8('0x5b')]['id']){delete _0x5cda43[_0xebd8('0x5b')]['id'];}var _0x148287;return db[_0xebd8('0x3a')]['find']({'where':{'id':_0x5cda43['params']['id']}})['then'](handleEntityNotFound(_0x10aea6,null))[_0xebd8('0x1f')](function(_0x338307){if(_0x338307){_0x148287=_0x338307;return db[_0xebd8('0x81')][_0xebd8('0x59')]({'where':{'id':_0x338307['SmsAccountId']}});}})[_0xebd8('0x1f')](handleEntityNotFound(_0x10aea6,null))['then'](function(_0x518887){if(_0x518887){logger[_0xebd8('0x82')](_0xebd8('0x23'),_0xebd8('0x2a'),_0xebd8('0x83'),_0x518887[_0xebd8('0x3c')],util[_0xebd8('0x84')](_0x5cda43[_0xebd8('0x5b')],{'showHidden':![],'depth':null}));switch(_0x518887['type']){case'twilio':if(_0x5cda43[_0xebd8('0x5b')]['MessageSid']&&_0x5cda43[_0xebd8('0x5b')][_0xebd8('0x85')]===_0x148287[_0xebd8('0x86')]){return _0x148287[_0xebd8('0x34')]({'read':!![]});}else{logger[_0xebd8('0x25')](_0xebd8('0x87'),_0xebd8('0x2a'),'twilio',util[_0xebd8('0x84')](_0x5cda43['body'],{'showHidden':![],'depth':null}));}break;case _0xebd8('0x88'):if(_0x5cda43['body'][_0xebd8('0x89')]&&_0x5cda43[_0xebd8('0x5b')][_0xebd8('0x89')]===_0x148287[_0xebd8('0x86')]&&_[_0xebd8('0x8a')]([_0xebd8('0x8b'),'delivered'],_0x5cda43[_0xebd8('0x5b')]['Status'])>=0x0){return _0x148287[_0xebd8('0x34')]({'read':!![]});}else{logger[_0xebd8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xebd8('0x8c'),util[_0xebd8('0x84')](_0x5cda43['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x389350=_0x5cda43[_0xebd8('0x5b')][_0xebd8('0x8d')][0x0];if(_0x389350[_0xebd8('0x2a')]['groupName']===_0xebd8('0x8e')){return _0x148287[_0xebd8('0x34')]({'read':!![]});}else{logger[_0xebd8('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0xebd8('0x84')](_0x5cda43[_0xebd8('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x148287;}})[_0xebd8('0x1f')](respondWithResult(_0x10aea6,null))[_0xebd8('0x52')](handleError(_0x10aea6,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5a6dc10..90acbbd 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 _0xf1ff=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage'];(function(_0x36c679,_0x4b97af){var _0x2f1c36=function(_0x4afd71){while(--_0x4afd71){_0x36c679['push'](_0x36c679['shift']());}};_0x2f1c36(++_0x4b97af);}(_0xf1ff,0x12f));var _0xff1f=function(_0x3034ce,_0x1421b6){_0x3034ce=_0x3034ce-0x0;var _0x4bc0e3=_0xf1ff[_0x3034ce];return _0x4bc0e3;};'use strict';var EventEmitter=require(_0xff1f('0x0'));var SmsMessage=require(_0xff1f('0x1'))['db'][_0xff1f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff1f('0x3'),'afterUpdate':_0xff1f('0x4'),'afterDestroy':_0xff1f('0x5')};function emitEvent(_0x6d845){return function(_0x30373e,_0x5d980d,_0x21409e){SmsMessageEvents[_0xff1f('0x6')](_0x6d845+':'+_0x30373e['id'],_0x30373e);SmsMessageEvents[_0xff1f('0x6')](_0x6d845,_0x30373e);_0x21409e(null);};}for(var e in events){if(events[_0xff1f('0x7')](e)){var event=events[e];SmsMessage[_0xff1f('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xfba4=['hasOwnProperty','exports','../../mysqldb','SmsMessage','setMaxListeners','emit'];(function(_0x1ad5f5,_0x2ab46c){var _0x1e6f51=function(_0x25bd1c){while(--_0x25bd1c){_0x1ad5f5['push'](_0x1ad5f5['shift']());}};_0x1e6f51(++_0x2ab46c);}(_0xfba4,0x170));var _0x4fba=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xfba4[_0xf79bae];return _0x5d2cb7;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x4fba('0x0'))['db'][_0x4fba('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4fba('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa5c6a8){return function(_0x32c93c,_0x55fdb6,_0x3043a3){SmsMessageEvents[_0x4fba('0x3')](_0xa5c6a8+':'+_0x32c93c['id'],_0x32c93c);SmsMessageEvents[_0x4fba('0x3')](_0xa5c6a8,_0x32c93c);_0x3043a3(null);};}for(var e in events){if(events[_0x4fba('0x4')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x4fba('0x5')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 2a551f5..05e16fb 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 _0xd8cc=['inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','phone','login?username=','username','GET','split','sms','user_key','total_sent','internal_order_id','deliveryReport','error','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','format','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','text','timestamp','keys','sort','createHash','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','secret','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','messages','/api/sms/messages/','/status?token=','token','sid','afterCreate'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xd8cc,0xc9));var _0xcd8c=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0xd8cc[_0x454e6d];return _0x4bc294;};'use strict';var _=require(_0xcd8c('0x0'));var util=require(_0xcd8c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcd8c('0x2'));var BPromise=require(_0xcd8c('0x3'));var rp=require(_0xcd8c('0x4'));var fs=require('fs');var path=require(_0xcd8c('0x5'));var rimraf=require('rimraf');var config=require(_0xcd8c('0x6'));var attributes=require(_0xcd8c('0x7'));module['exports']=function(_0x5776fc,_0x233d52){return _0x5776fc['define'](_0xcd8c('0x8'),attributes,{'tableName':_0xcd8c('0x9'),'paranoid':![],'indexes':[{'name':_0xcd8c('0xa'),'fields':[_0xcd8c('0xa')]},{'name':'fti_sms_messages','fields':[_0xcd8c('0xb')],'type':_0xcd8c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf32efa,_0x38bb83,_0x4ea038){var _0x2605e0=_0x5776fc[_0xcd8c('0xd')];var _0x3748a3=_0xf32efa[_0xcd8c('0xe')]({'plain':!![]});if(_0x3748a3[_0xcd8c('0xf')][_0xcd8c('0x10')]()==='in'||_0x3748a3[_0xcd8c('0xf')][_0xcd8c('0x10')]()===_0xcd8c('0x11')&&!_0x3748a3['secret']&&!_[_0xcd8c('0x12')](_0x3748a3['UserId'])){_0x2605e0[_0xcd8c('0x13')][_0xcd8c('0x14')]({'where':{'id':_0x3748a3[_0xcd8c('0x15')]}})['then'](function(_0xf0cb62){if(_0xf0cb62){_0xf0cb62[_0xcd8c('0x16')]({'lastMsgAt':_0x3748a3[_0xcd8c('0x17')],'lastMsgDirection':_0x3748a3[_0xcd8c('0xf')][_0xcd8c('0x10')]()});}})[_0xcd8c('0x18')](function(_0x13058b){console['error'](_0x13058b);});}if(_0x3748a3[_0xcd8c('0xf')]===_0xcd8c('0x11')&&!_0x3748a3[_0xcd8c('0x19')]){var _0x2f1180;_0x2605e0[_0xcd8c('0x1a')]['find']({'where':{'id':_0x3748a3[_0xcd8c('0x1b')]},'raw':!![]})[_0xcd8c('0x1c')](function(_0xd62d49){_0x2f1180=_0xd62d49;if(_0x2f1180&&_0x2f1180[_0xcd8c('0x1d')]){switch(_0x2f1180[_0xcd8c('0x1d')]){case _0xcd8c('0x1e'):var _0x1b2308=require('twilio');if(_0x2f1180[_0xcd8c('0x1f')]&&_0x2f1180[_0xcd8c('0x20')]&&_0x2f1180['phone']){var _0x5330ea=new _0x1b2308(_0x2f1180['accountSid'],_0x2f1180['authToken']);_0x5330ea[_0xcd8c('0x21')]['create']({'body':_0x3748a3['body'],'to':_0x3748a3['phone'],'from':_0x2f1180['phone'],'statusCallback':_0x2f1180['remote']+_0xcd8c('0x22')+_0x3748a3['id']+_0xcd8c('0x23')+_0x2f1180[_0xcd8c('0x24')]})['then'](function(_0x2e5711){if(_0x2e5711[_0xcd8c('0x25')]){return _0xf32efa[_0xcd8c('0x16')]({'messageId':_0x2e5711[_0xcd8c('0x25')]});}})[_0xcd8c('0x18')](function(_0x77ca04){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd8c('0x26'),_0xcd8c('0x1e'),util[_0xcd8c('0x27')](_0x77ca04,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcd8c('0x28'),_0xcd8c('0x26'),'twilio',_0xcd8c('0x29'));}break;case _0xcd8c('0x2a'):var _0x1a4573='https://api.skebby.it/API/v1.0/REST/';if(_0x2f1180['username']&&_0x2f1180[_0xcd8c('0x2b')]){var _0x5308ec={'recipient':[_0x3748a3['phone']],'message':_0x3748a3['body'],'message_type':_0x2f1180[_0xcd8c('0x2c')]};if(_0x2f1180[_0xcd8c('0x2c')]&&_0x2f1180[_0xcd8c('0x2c')]!=='SI'){_0x5308ec[_0xcd8c('0x2d')]=_0x2f1180[_0xcd8c('0x2e')];}var _0x52f35a={'url':_0x1a4573+_0xcd8c('0x2f')+_0x2f1180[_0xcd8c('0x30')]+'&password='+_0x2f1180[_0xcd8c('0x2b')],'method':_0xcd8c('0x31')};rp(_0x52f35a)[_0xcd8c('0x1c')](function(_0x529a3d){var _0x1eb1af=_0x529a3d[_0xcd8c('0x32')](';');var _0x4cdca6={'user_key':_0x1eb1af[0x0],'session_key':_0x1eb1af[0x1]};_0x52f35a={'url':_0x1a4573+_0xcd8c('0x33'),'method':'POST','headers':{'user_key':_0x4cdca6[_0xcd8c('0x34')],'Session_key':_0x4cdca6['session_key']},'json':!![],'body':_0x5308ec};return rp(_0x52f35a);})['then'](function(_0x32a0ca){if(_0x32a0ca[_0xcd8c('0x35')]>=0x1){var _0x3bad89={'messageId':_0x32a0ca[_0xcd8c('0x36')]};if(_0x2f1180['smsMethod']!=='GP'||!_0x2f1180[_0xcd8c('0x37')]){_0x3bad89['read']=!![];}return _0xf32efa[_0xcd8c('0x16')](_0x3bad89);}else{return logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),'skebby',util[_0xcd8c('0x27')](_0x32a0ca,{'showHidden':![],'depth':null}));}})['catch'](function(_0x197023){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcd8c('0x2a'),util['inspect'](_0x197023,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x2a'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcd8c('0x39'):if(_0x2f1180[_0xcd8c('0x20')]){var _0x486975={'recipient':_0x3748a3[_0xcd8c('0x2e')],'message':_0x3748a3[_0xcd8c('0xb')],'sender':_0x2f1180[_0xcd8c('0x3a')]||_0x2f1180[_0xcd8c('0x2e')],'authorization':_0x2f1180[_0xcd8c('0x20')]};var _0x38bb83={'method':_0xcd8c('0x3b'),'uri':_0xcd8c('0x3c'),'body':_0x486975,'json':!![]};rp(_0x38bb83)[_0xcd8c('0x1c')](function(_0x1d3d54){var _0x1d5be9={'messageId':_0x1d3d54[_0xcd8c('0x3d')]};if(!_0x2f1180[_0xcd8c('0x37')]){_0x1d5be9[_0xcd8c('0x3e')]=!![];}return _0xf32efa[_0xcd8c('0x16')](_0x1d5be9);})[_0xcd8c('0x18')](function(_0x4496ef){logger[_0xcd8c('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd8c('0x26'),_0xcd8c('0x39'),util[_0xcd8c('0x27')](_0x4496ef,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x39'),_0xcd8c('0x3f'));}break;case _0xcd8c('0x40'):if(_0x2f1180[_0xcd8c('0x30')]&&_0x2f1180['password']){var _0x486975={'messages':[{'source':_0xcd8c('0x41'),'to':_0x3748a3['phone'],'body':_0x3748a3[_0xcd8c('0xb')],'from':_0x2f1180['senderString']||_0x2f1180[_0xcd8c('0x2e')]}]};var _0x1493d3=util['format'](_0xcd8c('0x42'),_0x2f1180['username'],_0x2f1180[_0xcd8c('0x2b')]);var _0x38bb83={'method':_0xcd8c('0x3b'),'uri':_0xcd8c('0x43'),'body':_0x486975,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x1493d3)[_0xcd8c('0x44')](_0xcd8c('0x45')))},'json':!![]};rp(_0x38bb83)[_0xcd8c('0x1c')](function(_0x20b284){if(_0x20b284[_0xcd8c('0x46')]>=0xc8&&_0x20b284['http_code']<=0xce){if(_0x20b284[_0xcd8c('0x47')]&&_0x20b284[_0xcd8c('0x47')][_0xcd8c('0x48')]>0x0){var _0x1a6272=_['head'](_0x20b284[_0xcd8c('0x47')][_0xcd8c('0x21')]);var _0x39e9d5={'messageId':_0x1a6272[_0xcd8c('0x49')]};if(!_0x2f1180[_0xcd8c('0x37')]){_0x39e9d5[_0xcd8c('0x3e')]=!![];}return _0xf32efa[_0xcd8c('0x16')](_0x39e9d5);}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate','clickSend',util[_0xcd8c('0x27')](_0x20b284,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x4a'),util[_0xcd8c('0x27')](_0x20b284,{'showHidden':![],'depth':null}));}})[_0xcd8c('0x18')](function(_0x406ac2){logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate','clickSend',util['inspect'](_0x406ac2,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),'clickSend',_0xcd8c('0x4b'));}break;case'plivo':if(_0x2f1180[_0xcd8c('0x4c')]&&_0x2f1180['authToken']){var _0x486975={'dst':_0x3748a3[_0xcd8c('0x2e')],'text':_0x3748a3[_0xcd8c('0xb')],'src':_0x2f1180[_0xcd8c('0x3a')]||_0x2f1180['phone'],'url':_0x2f1180[_0xcd8c('0x4d')]+'/api/sms/messages/'+_0x3748a3['id']+'/status?token='+_0x2f1180[_0xcd8c('0x24')]};var _0x1493d3=util['format'](_0xcd8c('0x42'),_0x2f1180[_0xcd8c('0x4c')],_0x2f1180['authToken']);var _0x38bb83={'method':_0xcd8c('0x3b'),'uri':util['format'](_0xcd8c('0x4e'),_0x2f1180[_0xcd8c('0x4c')]),'body':_0x486975,'headers':{'Authorization':util[_0xcd8c('0x4f')](_0xcd8c('0x50'),new Buffer(_0x1493d3)[_0xcd8c('0x44')](_0xcd8c('0x45')))},'json':!![]};rp(_0x38bb83)[_0xcd8c('0x1c')](function(_0x29cc88){var _0x201da6={'messageId':_0x29cc88[_0xcd8c('0x51')][0x0]};return _0xf32efa[_0xcd8c('0x16')](_0x201da6);})[_0xcd8c('0x18')](function(_0x5c7113){logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x52'),util[_0xcd8c('0x27')](_0x5c7113,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd8c('0x26'),_0xcd8c('0x52'),_0xcd8c('0x53'));}break;case'infobip':if(_0x2f1180[_0xcd8c('0x30')]&&_0x2f1180[_0xcd8c('0x2b')]){if(_0x2f1180[_0xcd8c('0x54')]){var _0x1f954d={'method':_0xcd8c('0x3b'),'uri':_0x2f1180[_0xcd8c('0x54')]+_0xcd8c('0x55'),'body':{'username':_0x2f1180[_0xcd8c('0x30')],'password':_0x2f1180[_0xcd8c('0x2b')]},'json':!![]};return rp(_0x1f954d)[_0xcd8c('0x1c')](function(_0x1b04ed){var _0x190ad7={'method':_0xcd8c('0x3b'),'uri':_0x2f1180['baseUrl']+_0xcd8c('0x56'),'body':{'messages':[{'from':_0x2f1180[_0xcd8c('0x2e')],'destinations':[{'to':_0x3748a3[_0xcd8c('0x2e')]}],'text':_0x3748a3[_0xcd8c('0xb')],'notifyUrl':_0x2f1180[_0xcd8c('0x4d')]+_0xcd8c('0x22')+_0x3748a3['id']+'/status?token='+_0x2f1180[_0xcd8c('0x24')],'notifyContentType':_0xcd8c('0x57'),'callbackData':_0x2f1180['phone']+';'+_0x3748a3[_0xcd8c('0xb')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x1b04ed[_0xcd8c('0x24')]},'json':!![]};return rp(_0x190ad7)[_0xcd8c('0x1c')](function(_0xab466){if(_0xab466['messages']){var _0x51050e={'messageId':_0xab466[_0xcd8c('0x21')][0x0][_0xcd8c('0xa')]};if(!_0x2f1180[_0xcd8c('0x37')]){_0x51050e[_0xcd8c('0x3e')]=!![];}return _0xf32efa['update'](_0x51050e);}else{return logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate','infobip',util['inspect'](_0xab466,{'showHidden':![],'depth':null}));}});})[_0xcd8c('0x18')](function(_0x1e5f99){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcd8c('0x58'),util['inspect'](_0x1e5f99,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x58'),_0xcd8c('0x59'));}}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x58'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcd8c('0x5a'):var _0x2e076b=require(_0xcd8c('0x5b'));if(_0x2f1180[_0xcd8c('0x5c')]){var _0x41a134={};_0x41a134['login']=_0x2f1180[_0xcd8c('0x30')];_0x41a134[_0xcd8c('0x2e')]=_0x3748a3[_0xcd8c('0x2e')];_0x41a134[_0xcd8c('0x2d')]=_0x2f1180[_0xcd8c('0x2e')];_0x41a134[_0xcd8c('0x5d')]=_0x3748a3[_0xcd8c('0xb')];_0x41a134[_0xcd8c('0x5e')]=+new Date();var _0x274607='';var _0x24ce2e='';var _0x114846=Object[_0xcd8c('0x5f')](_0x41a134);_0x114846[_0xcd8c('0x60')]();for(var _0x1610e8=0x0;_0x1610e8<_0x114846['length'];_0x1610e8++){if(_0x274607!=''){_0x274607+='&';}_0x274607+=_0x114846[_0x1610e8]+'='+encodeURIComponent(_0x41a134[_0x114846[_0x1610e8]]);_0x24ce2e+=_0x41a134[_0x114846[_0x1610e8]];}_0x24ce2e+=_0x2f1180[_0xcd8c('0x5c')];_0x24ce2e=_0x2e076b[_0xcd8c('0x61')]('md5')[_0xcd8c('0x16')](_0x24ce2e)[_0xcd8c('0x62')]('hex');if(_0x274607!==''){_0x274607+='&';}_0x274607+=_0xcd8c('0x63')+_0x24ce2e;var _0x52f35a={'method':_0xcd8c('0x31'),'uri':_0x2f1180['baseUrl']+_0xcd8c('0x64')+_0x274607,'json':!![]};return rp(_0x52f35a)[_0xcd8c('0x1c')](function(_0x231a2f){var _0xd5d166=Object[_0xcd8c('0x5f')](_0x231a2f);if(_0x231a2f[_0xd5d166[0x0]][_0xcd8c('0x38')]&&parseInt(_0x231a2f[_0xd5d166[0x0]]['error'])===0x0){var _0x590db9={'messageId':_0x231a2f[_0xd5d166[0x0]][_0xcd8c('0x65')]};if(!_0x2f1180['deliveryReport']){_0x590db9[_0xcd8c('0x3e')]=!![];}return _0xf32efa['update'](_0x590db9);}else{return logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x5a'),util['inspect'](_0x231a2f[_0xcd8c('0x38')],{'showHidden':![],'depth':null}));}})[_0xcd8c('0x18')](function(_0x5cd8ca){return logger['error'](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x5a'),util['inspect'](_0x5cd8ca,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x5a'),_0xcd8c('0x66'));}break;case'clickatell':if(_0x2f1180[_0xcd8c('0x5c')]){var _0x44dcd6={'method':_0xcd8c('0x3b'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2f1180['apiKey']},'body':{'content':_0x3748a3[_0xcd8c('0xb')],'to':[_0x3748a3['phone']],'from':_0x2f1180['phone'],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x44dcd6)[_0xcd8c('0x1c')](function(_0x2a1198){if(!_0x2a1198['error']){var _0x13b018={'messageId':_0x2a1198['messages'][0x0]['apiMessageId']};if(!_0x2f1180[_0xcd8c('0x37')]){_0x13b018[_0xcd8c('0x3e')]=!![];}return _0xf32efa[_0xcd8c('0x16')](_0x13b018);}else{return logger['error'](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x67'),util[_0xcd8c('0x27')](_0x2a1198[_0xcd8c('0x38')],{'showHidden':![],'depth':null}));}})[_0xcd8c('0x18')](function(_0x5a8f88){return logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x67'),util[_0xcd8c('0x27')](_0x5a8f88,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x67'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x2f1180[_0xcd8c('0x30')]&&_0x2f1180['password']){var _0x1493d3=util[_0xcd8c('0x4f')](_0xcd8c('0x42'),_0x2f1180[_0xcd8c('0x30')],_0x2f1180['password']);var _0x38bb83={'method':_0xcd8c('0x3b'),'uri':_0xcd8c('0x68')+_0x2f1180[_0xcd8c('0x69')]+_0xcd8c('0x6a'),'body':{'to':[_0x3748a3[_0xcd8c('0x2e')]],'text':_0x3748a3[_0xcd8c('0xb')],'from':_0x2f1180['phone'],'applicationId':_0x2f1180[_0xcd8c('0x6b')]},'headers':{'Authorization':util[_0xcd8c('0x4f')](_0xcd8c('0x50'),new Buffer(_0x1493d3)[_0xcd8c('0x44')](_0xcd8c('0x45')))},'json':!![]};rp(_0x38bb83)[_0xcd8c('0x1c')](function(_0x2a9a45){if(_0x2a9a45['id']){var _0xe28473={'messageId':_0x2a9a45['id']};return _0xf32efa[_0xcd8c('0x16')](_0xe28473);}else{logger[_0xcd8c('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcd8c('0x26'),_0xcd8c('0x6c'),util['inspect'](_0x2a9a45,{'showHidden':![],'depth':null}));}})[_0xcd8c('0x18')](function(_0x3be654){logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x6c'),util[_0xcd8c('0x27')](_0x3be654,{'showHidden':![],'depth':null}));});}else{logger[_0xcd8c('0x38')](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x6c'),_0xcd8c('0x4b'));}break;case'intelepeer':if(_0x2f1180[_0xcd8c('0x5c')]){var _0x162f2f={};var _0x52f35a={'method':_0xcd8c('0x3b'),'uri':_0xcd8c('0x6d'),'headers':{'Authorization':_0xcd8c('0x6e')+_0x2f1180[_0xcd8c('0x5c')],'Content-Type':_0xcd8c('0x57')},'body':{'from':_0x2f1180['phone'],'to':_0x3748a3[_0xcd8c('0x2e')],'text':_0x3748a3[_0xcd8c('0xb')]},'json':!![]};return rp(_0x52f35a)[_0xcd8c('0x1c')](function(_0xad5d68){if(_0xad5d68[_0xcd8c('0x6f')]==0xca){_0x162f2f[_0xcd8c('0x70')]=_0xad5d68;var _0x315e46={'method':_0xcd8c('0x3b'),'uri':_0xcd8c('0x71'),'headers':{'Authorization':_0xcd8c('0x6e')+_0x2f1180[_0xcd8c('0x5c')],'Content-Type':_0xcd8c('0x57')},'body':{'refid':_0x162f2f[_0xcd8c('0x70')][_0xcd8c('0x72')]},'json':!![]};return rp(_0x315e46)[_0xcd8c('0x1c')](function(_0xfdee84){_0x162f2f[_0xcd8c('0x73')]=_0xfdee84;var _0x17baf9={'messageId':_0x162f2f[_0xcd8c('0x70')]['refid'],'read':!![]};return _0xf32efa['update'](_0x17baf9);});}else{return logger[_0xcd8c('0x38')](_0xcd8c('0x28'),'afterCreate',_0xcd8c('0x74'),util[_0xcd8c('0x27')](_0xad5d68,{'showHidden':![],'depth':null}));}})['catch'](function(_0x389724){return logger[_0xcd8c('0x38')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcd8c('0x74'),util[_0xcd8c('0x27')](_0x389724,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xcd8c('0x28'),_0xcd8c('0x26'),_0xcd8c('0x74'),'Token\x20not\x20received');}break;}}})[_0xcd8c('0x75')](function(){_0x4ea038();});}else{_0x4ea038();}}},'charset':_0xcd8c('0x76'),'collate':_0xcd8c('0x77')});}; \ No newline at end of file +var _0x1542=['hex','signature=','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','createdAt','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','phone','/status?token=','token','update','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','read','error','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x116));var _0x2154=function(_0x53b135,_0x3aa0d3){_0x53b135=_0x53b135-0x0;var _0x56e52f=_0x1542[_0x53b135];return _0x56e52f;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var logger=require(_0x2154('0x2'))(_0x2154('0x3'));var moment=require(_0x2154('0x4'));var BPromise=require('bluebird');var rp=require(_0x2154('0x5'));var fs=require('fs');var path=require(_0x2154('0x6'));var rimraf=require(_0x2154('0x7'));var config=require('../../config/environment');var attributes=require(_0x2154('0x8'));module[_0x2154('0x9')]=function(_0x5406f9,_0x13d9c2){return _0x5406f9[_0x2154('0xa')](_0x2154('0xb'),attributes,{'tableName':_0x2154('0xc'),'paranoid':![],'indexes':[{'name':_0x2154('0xd'),'fields':[_0x2154('0xd')]},{'name':_0x2154('0xe'),'fields':[_0x2154('0xf')],'type':_0x2154('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a5489,_0x4fcde5,_0xe2c6bd){var _0x388079=_0x5406f9[_0x2154('0x11')];var _0x5a4858=_0x1a5489['get']({'plain':!![]});if(_0x5a4858[_0x2154('0x12')][_0x2154('0x13')]()==='in'||_0x5a4858['direction'][_0x2154('0x13')]()===_0x2154('0x14')&&!_0x5a4858[_0x2154('0x15')]&&!_[_0x2154('0x16')](_0x5a4858[_0x2154('0x17')])){_0x388079[_0x2154('0x18')][_0x2154('0x19')]({'where':{'id':_0x5a4858['SmsInteractionId']}})['then'](function(_0x160517){if(_0x160517){_0x160517['update']({'lastMsgAt':_0x5a4858[_0x2154('0x1a')],'lastMsgDirection':_0x5a4858['direction']['toLowerCase']()});}})['catch'](function(_0x46c995){console['error'](_0x46c995);});}if(_0x5a4858[_0x2154('0x12')]==='out'&&!_0x5a4858[_0x2154('0x15')]){var _0x369ab6;_0x388079[_0x2154('0x1b')][_0x2154('0x1c')]({'where':{'id':_0x5a4858[_0x2154('0x1d')]},'raw':!![]})[_0x2154('0x1e')](function(_0x15c197){_0x369ab6=_0x15c197;if(_0x369ab6&&_0x369ab6[_0x2154('0x1f')]){switch(_0x369ab6[_0x2154('0x1f')]){case _0x2154('0x20'):var _0x50ed9b=require(_0x2154('0x20'));if(_0x369ab6[_0x2154('0x21')]&&_0x369ab6[_0x2154('0x22')]&&_0x369ab6['phone']){var _0x2af3dd=new _0x50ed9b(_0x369ab6[_0x2154('0x21')],_0x369ab6[_0x2154('0x22')]);_0x2af3dd[_0x2154('0x23')]['create']({'body':_0x5a4858[_0x2154('0xf')],'to':_0x5a4858[_0x2154('0x24')],'from':_0x369ab6[_0x2154('0x24')],'statusCallback':_0x369ab6['remote']+'/api/sms/messages/'+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]})[_0x2154('0x1e')](function(_0x4ef4f7){if(_0x4ef4f7['sid']){return _0x1a5489[_0x2154('0x27')]({'messageId':_0x4ef4f7[_0x2154('0x28')]});}})[_0x2154('0x29')](function(_0x3b4fa8){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),util['inspect'](_0x3b4fa8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2154('0x2c'):var _0xd780d=_0x2154('0x2d');if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x5cd152={'recipient':[_0x5a4858[_0x2154('0x24')]],'message':_0x5a4858[_0x2154('0xf')],'message_type':_0x369ab6[_0x2154('0x30')]};if(_0x369ab6[_0x2154('0x30')]&&_0x369ab6[_0x2154('0x30')]!=='SI'){_0x5cd152[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];}var _0x133f98={'url':_0xd780d+_0x2154('0x32')+_0x369ab6[_0x2154('0x2e')]+'&password='+_0x369ab6[_0x2154('0x2f')],'method':'GET'};rp(_0x133f98)['then'](function(_0x883503){var _0x106d3e=_0x883503[_0x2154('0x33')](';');var _0x5a701e={'user_key':_0x106d3e[0x0],'session_key':_0x106d3e[0x1]};_0x133f98={'url':_0xd780d+_0x2154('0x34'),'method':_0x2154('0x35'),'headers':{'user_key':_0x5a701e[_0x2154('0x36')],'Session_key':_0x5a701e[_0x2154('0x37')]},'json':!![],'body':_0x5cd152};return rp(_0x133f98);})[_0x2154('0x1e')](function(_0x3a252a){if(_0x3a252a[_0x2154('0x38')]>=0x1){var _0x3d38f3={'messageId':_0x3a252a['internal_order_id']};if(_0x369ab6[_0x2154('0x30')]!=='GP'||!_0x369ab6['deliveryReport']){_0x3d38f3[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x3d38f3);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',util['inspect'](_0x3a252a,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ff05a){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x2c'),util[_0x2154('0x3b')](_0x3ff05a,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',_0x2154('0x3c'));}break;case'connectel':if(_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'recipient':_0x5a4858[_0x2154('0x24')],'message':_0x5a4858[_0x2154('0xf')],'sender':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')],'authorization':_0x369ab6['authToken']};var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x3e'),'body':_0x2a1edb,'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x1a4167){var _0x12e7c5={'messageId':_0x1a4167[_0x2154('0x3f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x12e7c5[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x12e7c5);})['catch'](function(_0x5d77b0){logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x41'),util[_0x2154('0x3b')](_0x5d77b0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x2154('0x42'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x2a1edb={'messages':[{'source':_0x2154('0x43'),'to':_0x5a4858[_0x2154('0x24')],'body':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')]}]};var _0x61a813=util[_0x2154('0x44')]('%s:%s',_0x369ab6['username'],_0x369ab6[_0x2154('0x2f')]);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x45'),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x243dc0){if(_0x243dc0[_0x2154('0x48')]>=0xc8&&_0x243dc0[_0x2154('0x48')]<=0xce){if(_0x243dc0[_0x2154('0x49')]&&_0x243dc0['data']['queued_count']>0x0){var _0x4dbc52=_[_0x2154('0x4a')](_0x243dc0['data']['messages']);var _0x18f0ba={'messageId':_0x4dbc52[_0x2154('0x4b')]};if(!_0x369ab6[_0x2154('0x40')]){_0x18f0ba[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x18f0ba);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate','clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ab5aa){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),util[_0x2154('0x3b')](_0x3ab5aa,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x4d'):if(_0x369ab6[_0x2154('0x4e')]&&_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'dst':_0x5a4858['phone'],'text':_0x5a4858[_0x2154('0xf')],'src':_0x369ab6['senderString']||_0x369ab6['phone'],'url':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]};var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x4e')],_0x369ab6[_0x2154('0x22')]);var _0x4fcde5={'method':'POST','uri':util['format'](_0x2154('0x52'),_0x369ab6['authId']),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')]('Basic\x20%s',new Buffer(_0x61a813)[_0x2154('0x53')](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x3b948c){var _0xfa774b={'messageId':_0x3b948c[_0x2154('0x54')][0x0]};return _0x1a5489[_0x2154('0x27')](_0xfa774b);})[_0x2154('0x29')](function(_0x3a7f71){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4d'),util[_0x2154('0x3b')](_0x3a7f71,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x4d'),_0x2154('0x55'));}break;case _0x2154('0x56'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6['password']){if(_0x369ab6['baseUrl']){var _0x5a7f97={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x58'),'body':{'username':_0x369ab6[_0x2154('0x2e')],'password':_0x369ab6['password']},'json':!![]};return rp(_0x5a7f97)[_0x2154('0x1e')](function(_0x420702){var _0x186040={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x369ab6[_0x2154('0x24')],'destinations':[{'to':_0x5a4858['phone']}],'text':_0x5a4858[_0x2154('0xf')],'notifyUrl':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')],'notifyContentType':_0x2154('0x59'),'callbackData':_0x369ab6['phone']+';'+_0x5a4858[_0x2154('0xf')]}]},'headers':{'Authorization':_0x2154('0x5a')+_0x420702[_0x2154('0x26')]},'json':!![]};return rp(_0x186040)[_0x2154('0x1e')](function(_0xae4338){if(_0xae4338[_0x2154('0x23')]){var _0xc1c1a4={'messageId':_0xae4338['messages'][0x0][_0x2154('0xd')]};if(!_0x369ab6[_0x2154('0x40')]){_0xc1c1a4[_0x2154('0x39')]=!![];}return _0x1a5489['update'](_0xc1c1a4);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'infobip',util[_0x2154('0x3b')](_0xae4338,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x49c55a){return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x56'),util[_0x2154('0x3b')](_0x49c55a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),'afterCreate','infobip',_0x2154('0x5b'));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x5c'):var _0x5cdc86=require(_0x2154('0x5d'));if(_0x369ab6[_0x2154('0x5e')]){var _0xc1dd4f={};_0xc1dd4f[_0x2154('0x5f')]=_0x369ab6['username'];_0xc1dd4f[_0x2154('0x24')]=_0x5a4858['phone'];_0xc1dd4f[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];_0xc1dd4f['text']=_0x5a4858[_0x2154('0xf')];_0xc1dd4f[_0x2154('0x60')]=+new Date();var _0x3c148d='';var _0x5730bc='';var _0x5076bd=Object[_0x2154('0x61')](_0xc1dd4f);_0x5076bd[_0x2154('0x62')]();for(var _0x589c4a=0x0;_0x589c4a<_0x5076bd[_0x2154('0x63')];_0x589c4a++){if(_0x3c148d!=''){_0x3c148d+='&';}_0x3c148d+=_0x5076bd[_0x589c4a]+'='+encodeURIComponent(_0xc1dd4f[_0x5076bd[_0x589c4a]]);_0x5730bc+=_0xc1dd4f[_0x5076bd[_0x589c4a]];}_0x5730bc+=_0x369ab6[_0x2154('0x5e')];_0x5730bc=_0x5cdc86[_0x2154('0x64')](_0x2154('0x65'))[_0x2154('0x27')](_0x5730bc)[_0x2154('0x66')](_0x2154('0x67'));if(_0x3c148d!==''){_0x3c148d+='&';}_0x3c148d+=_0x2154('0x68')+_0x5730bc;var _0x133f98={'method':_0x2154('0x69'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x6a')+_0x3c148d,'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x305b09){var _0x170113=Object[_0x2154('0x61')](_0x305b09);if(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')]&&parseInt(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')])===0x0){var _0x106df9={'messageId':_0x305b09[_0x170113[0x0]]['id_sms']};if(!_0x369ab6[_0x2154('0x40')]){_0x106df9[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x106df9);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'csc',util['inspect'](_0x305b09['error'],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0xea4ecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'csc',util[_0x2154('0x3b')](_0xea4ecb,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x5c'),_0x2154('0x6b'));}break;case _0x2154('0x6c'):if(_0x369ab6[_0x2154('0x5e')]){var _0x50021b={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x369ab6['apiKey']},'body':{'content':_0x5a4858[_0x2154('0xf')],'to':[_0x5a4858[_0x2154('0x24')]],'from':_0x369ab6['phone'],'binary':![],'clientMessageId':_0x2154('0x6d'),'charset':_0x2154('0x6e')},'json':!![]};rp(_0x50021b)[_0x2154('0x1e')](function(_0x4eac49){if(!_0x4eac49[_0x2154('0x3a')]){var _0x380a61={'messageId':_0x4eac49['messages'][0x0][_0x2154('0x6f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x380a61[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x380a61);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),util[_0x2154('0x3b')](_0x4eac49[_0x2154('0x3a')],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x152691){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickatell',util[_0x2154('0x3b')](_0x152691,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),_0x2154('0x6b'));}break;case _0x2154('0x70'):if(_0x369ab6['username']&&_0x369ab6[_0x2154('0x2f')]){var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x2e')],_0x369ab6['password']);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x71')+_0x369ab6[_0x2154('0x72')]+'/messages','body':{'to':[_0x5a4858[_0x2154('0x24')]],'text':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6['phone'],'applicationId':_0x369ab6[_0x2154('0x73')]},'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x4c422c){if(_0x4c422c['id']){var _0x1feca3={'messageId':_0x4c422c['id']};return _0x1a5489['update'](_0x1feca3);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x4c422c,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x33ffb7){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x33ffb7,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x74'):if(_0x369ab6[_0x2154('0x5e')]){var _0x5f3da9={};var _0x133f98={'method':_0x2154('0x35'),'uri':_0x2154('0x75'),'headers':{'Authorization':_0x2154('0x76')+_0x369ab6[_0x2154('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x369ab6[_0x2154('0x24')],'to':_0x5a4858[_0x2154('0x24')],'text':_0x5a4858[_0x2154('0xf')]},'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x357414){if(_0x357414[_0x2154('0x77')]==0xca){_0x5f3da9[_0x2154('0x78')]=_0x357414;var _0x3a559e={'method':_0x2154('0x35'),'uri':_0x2154('0x79'),'headers':{'Authorization':'Bearer\x20'+_0x369ab6[_0x2154('0x5e')],'Content-Type':_0x2154('0x59')},'body':{'refid':_0x5f3da9[_0x2154('0x78')][_0x2154('0x7a')]},'json':!![]};return rp(_0x3a559e)[_0x2154('0x1e')](function(_0x405dd6){_0x5f3da9[_0x2154('0x7b')]=_0x405dd6;var _0x143be5={'messageId':_0x5f3da9[_0x2154('0x78')]['refid'],'read':!![]};return _0x1a5489[_0x2154('0x27')](_0x143be5);});}else{return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x357414,{'showHidden':![],'depth':null}));}})['catch'](function(_0x30cecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x30cecb,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),_0x2154('0x7c'));}break;}}})[_0x2154('0x7d')](function(){_0xe2c6bd();});}else{_0xe2c6bd();}}},'charset':_0x2154('0x7e'),'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 2622eee..998dacb 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 _0x020b=['create','body','options','raw','then','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x17a6c1,_0x3429ed){var _0x5a362e=function(_0x503f69){while(--_0x503f69){_0x17a6c1['push'](_0x17a6c1['shift']());}};_0x5a362e(++_0x3429ed);}(_0x020b,0xd7));var _0xb020=function(_0x3410af,_0x14c353){_0x3410af=_0x3410af-0x0;var _0x41b469=_0x020b[_0x3410af];return _0x41b469;};'use strict';var _=require(_0xb020('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb020('0x1'));var rs=require(_0xb020('0x2'));var fs=require('fs');var Redis=require(_0xb020('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb020('0x4'));var logger=require('../../config/logger')(_0xb020('0x5'));var config=require(_0xb020('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb020('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb020('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb020('0x9'))[_0xb020('0xa')](socket);function respondWithRpcPromise(_0x5e6bd7,_0x5a1b43,_0x4c2ff3){return new BPromise(function(_0x21d815,_0xe5d5f1){return client[_0xb020('0xb')](_0x5e6bd7,_0x4c2ff3)['then'](function(_0x2afdbe){logger[_0xb020('0xc')](_0xb020('0xd'),_0x5a1b43,'request\x20sent');logger[_0xb020('0xe')](_0xb020('0xf'),_0x5a1b43,_0xb020('0x10'),JSON[_0xb020('0x11')](_0x2afdbe));if(_0x2afdbe[_0xb020('0x12')]){if(_0x2afdbe[_0xb020('0x12')][_0xb020('0x13')]===0x1f4){logger[_0xb020('0x12')](_0xb020('0xd'),_0x5a1b43,_0x2afdbe[_0xb020('0x12')][_0xb020('0x14')]);return _0xe5d5f1(_0x2afdbe['error']['message']);}logger['error'](_0xb020('0xd'),_0x5a1b43,_0x2afdbe[_0xb020('0x12')]['message']);return _0x21d815(_0x2afdbe[_0xb020('0x12')][_0xb020('0x14')]);}else{logger['info'](_0xb020('0xd'),_0x5a1b43,'request\x20sent');_0x21d815(_0x2afdbe[_0xb020('0x15')][_0xb020('0x14')]);}})[_0xb020('0x16')](function(_0x5749de){logger['error'](_0xb020('0xd'),_0x5a1b43,_0x5749de);_0xe5d5f1(_0x5749de);});});}exports[_0xb020('0x17')]=function(_0x539d2f){var _0xf39fe5=this;return new Promise(function(_0x59c092,_0x450911){return db[_0xb020('0x18')][_0xb020('0x19')](_0x539d2f[_0xb020('0x1a')],{'raw':_0x539d2f['options']?_0x539d2f[_0xb020('0x1b')][_0xb020('0x1c')]===undefined?!![]:![]:!![]})[_0xb020('0x1d')](function(_0x3715ca){logger['info']('CreateSmsMessage',_0x539d2f);logger[_0xb020('0xe')]('CreateSmsMessage',_0x539d2f,JSON['stringify'](_0x3715ca));_0x59c092(_0x3715ca);})[_0xb020('0x16')](function(_0x249864){logger[_0xb020('0x12')](_0xb020('0x17'),_0x249864[_0xb020('0x14')],_0x539d2f);_0x450911(_0xf39fe5['error'](0x1f4,_0x249864['message']));});});}; \ No newline at end of file +var _0x2881=['client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','SmsMessage','create','body','raw','CreateSmsMessage','stringify','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3c9a65,_0x29e99f){var _0xc28d70=function(_0x7d7ea5){while(--_0x7d7ea5){_0x3c9a65['push'](_0x3c9a65['shift']());}};_0xc28d70(++_0x29e99f);}(_0x2881,0x1b6));var _0x1288=function(_0x8f634f,_0x101977){_0x8f634f=_0x8f634f-0x0;var _0x3ad063=_0x2881[_0x8f634f];return _0x3ad063;};'use strict';var _=require(_0x1288('0x0'));var util=require('util');var moment=require(_0x1288('0x1'));var BPromise=require(_0x1288('0x2'));var rs=require(_0x1288('0x3'));var fs=require('fs');var Redis=require(_0x1288('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1288('0x5'));var logger=require(_0x1288('0x6'))(_0x1288('0x7'));var config=require(_0x1288('0x8'));var jayson=require(_0x1288('0x9'));var client=jayson[_0x1288('0xa')]['http']({'port':0x232a});config[_0x1288('0xb')]=_[_0x1288('0xc')](config[_0x1288('0xb')],{'host':_0x1288('0xd'),'port':0x18eb});var socket=require(_0x1288('0xe'))(new Redis(config[_0x1288('0xb')]));require(_0x1288('0xf'))['register'](socket);function respondWithRpcPromise(_0x56835f,_0x53d492,_0x13aa1e){return new BPromise(function(_0x36a061,_0x4dddcc){return client[_0x1288('0x10')](_0x56835f,_0x13aa1e)[_0x1288('0x11')](function(_0x1910cb){logger[_0x1288('0x12')](_0x1288('0x13'),_0x53d492,'request\x20sent');logger[_0x1288('0x14')](_0x1288('0x15'),_0x53d492,'request\x20sent',JSON['stringify'](_0x1910cb));if(_0x1910cb[_0x1288('0x16')]){if(_0x1910cb[_0x1288('0x16')]['code']===0x1f4){logger[_0x1288('0x16')]('SmsMessage,\x20%s,\x20%s',_0x53d492,_0x1910cb[_0x1288('0x16')][_0x1288('0x17')]);return _0x4dddcc(_0x1910cb['error']['message']);}logger[_0x1288('0x16')](_0x1288('0x13'),_0x53d492,_0x1910cb[_0x1288('0x16')]['message']);return _0x36a061(_0x1910cb[_0x1288('0x16')][_0x1288('0x17')]);}else{logger[_0x1288('0x12')](_0x1288('0x13'),_0x53d492,_0x1288('0x18'));_0x36a061(_0x1910cb[_0x1288('0x19')][_0x1288('0x17')]);}})['catch'](function(_0x338ad3){logger[_0x1288('0x16')](_0x1288('0x13'),_0x53d492,_0x338ad3);_0x4dddcc(_0x338ad3);});});}exports['CreateSmsMessage']=function(_0x4f72d0){var _0x5c5163=this;return new Promise(function(_0x5e0644,_0x53cea4){return db[_0x1288('0x1a')][_0x1288('0x1b')](_0x4f72d0[_0x1288('0x1c')],{'raw':_0x4f72d0['options']?_0x4f72d0['options'][_0x1288('0x1d')]===undefined?!![]:![]:!![]})[_0x1288('0x11')](function(_0x1bd446){logger[_0x1288('0x12')](_0x1288('0x1e'),_0x4f72d0);logger[_0x1288('0x14')](_0x1288('0x1e'),_0x4f72d0,JSON[_0x1288('0x1f')](_0x1bd446));_0x5e0644(_0x1bd446);})['catch'](function(_0x40cdba){logger[_0x1288('0x16')]('CreateSmsMessage',_0x40cdba['message'],_0x4f72d0);_0x53cea4(_0x5c5163[_0x1288('0x16')](0x1f4,_0x40cdba[_0x1288('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index abdc763..0ddedc0 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 _0x09b9=['emit','removeListener','register','length','./smsMessage.events','save','update'];(function(_0x2ef25b,_0x317369){var _0x48df6f=function(_0x9818ce){while(--_0x9818ce){_0x2ef25b['push'](_0x2ef25b['shift']());}};_0x48df6f(++_0x317369);}(_0x09b9,0x193));var _0x909b=function(_0x3355cd,_0xf4ffb1){_0x3355cd=_0x3355cd-0x0;var _0x238e13=_0x09b9[_0x3355cd];return _0x238e13;};'use strict';var SmsMessageEvents=require(_0x909b('0x0'));var events=[_0x909b('0x1'),'remove',_0x909b('0x2')];function createListener(_0xee4da6,_0x3d9dfb){return function(_0x41607f){_0x3d9dfb[_0x909b('0x3')](_0xee4da6,_0x41607f);};}function removeListener(_0x5564c1,_0x5e7672){return function(){SmsMessageEvents[_0x909b('0x4')](_0x5564c1,_0x5e7672);};}exports[_0x909b('0x5')]=function(_0x1747fc){for(var _0x459c2c=0x0,_0x482b60=events[_0x909b('0x6')];_0x459c2c<_0x482b60;_0x459c2c++){var _0x153686=events[_0x459c2c];var _0x376159=createListener('smsMessage:'+_0x153686,_0x1747fc);SmsMessageEvents['on'](_0x153686,_0x376159);}}; \ No newline at end of file +var _0x07e6=['length','./smsMessage.events','remove','update','emit','removeListener','register'];(function(_0x5bc0e4,_0x42f5a4){var _0x2c6789=function(_0x1132fc){while(--_0x1132fc){_0x5bc0e4['push'](_0x5bc0e4['shift']());}};_0x2c6789(++_0x42f5a4);}(_0x07e6,0x8d));var _0x607e=function(_0x13ab80,_0x4a31bd){_0x13ab80=_0x13ab80-0x0;var _0x1273aa=_0x07e6[_0x13ab80];return _0x1273aa;};'use strict';var SmsMessageEvents=require(_0x607e('0x0'));var events=['save',_0x607e('0x1'),_0x607e('0x2')];function createListener(_0x4734a7,_0x2b9f7a){return function(_0x3c2110){_0x2b9f7a[_0x607e('0x3')](_0x4734a7,_0x3c2110);};}function removeListener(_0x45d03d,_0x5dfc33){return function(){SmsMessageEvents[_0x607e('0x4')](_0x45d03d,_0x5dfc33);};}exports[_0x607e('0x5')]=function(_0x2c4521){for(var _0x413b1c=0x0,_0x3b428b=events[_0x607e('0x6')];_0x413b1c<_0x3b428b;_0x413b1c++){var _0x16ae21=events[_0x413b1c];var _0x5c2879=createListener('smsMessage:'+_0x16ae21,_0x2c4521);SmsMessageEvents['on'](_0x16ae21,_0x5c2879);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 7ee6e5f..dcdfa84 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 _0x979a=['removeTeams','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getTeams','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0x979a,0x17c));var _0xa979=function(_0x3e01c8,_0x30ec78){_0x3e01c8=_0x3e01c8-0x0;var _0x2a6804=_0x979a[_0x3e01c8];return _0x2a6804;};'use strict';var multer=require(_0xa979('0x0'));var util=require('util');var path=require(_0xa979('0x1'));var timeout=require(_0xa979('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa979('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa979('0x4'));var config=require(_0xa979('0x5'));var controller=require(_0xa979('0x6'));router[_0xa979('0x7')]('/',auth[_0xa979('0x8')](),controller['index']);router[_0xa979('0x7')](_0xa979('0x9'),auth[_0xa979('0x8')](),controller[_0xa979('0xa')]);router[_0xa979('0x7')](_0xa979('0xb'),auth[_0xa979('0x8')](),controller[_0xa979('0xc')]);router['get'](_0xa979('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0xa979('0x7')]('/:id/teams',auth[_0xa979('0x8')](),controller[_0xa979('0xe')]);router[_0xa979('0x7')]('/:id/users',auth[_0xa979('0x8')](),controller[_0xa979('0xf')]);router[_0xa979('0x10')]('/',auth[_0xa979('0x8')](),controller[_0xa979('0x11')]);router[_0xa979('0x10')](_0xa979('0x12'),auth[_0xa979('0x8')](),controller[_0xa979('0x13')]);router['post']('/:id/users',auth[_0xa979('0x8')](),controller[_0xa979('0x14')]);router[_0xa979('0x15')](_0xa979('0xb'),auth[_0xa979('0x8')](),controller[_0xa979('0x16')]);router[_0xa979('0x17')](_0xa979('0xb'),auth[_0xa979('0x8')](),controller[_0xa979('0x18')]);router[_0xa979('0x17')]('/:id/teams',auth[_0xa979('0x8')](),controller[_0xa979('0x19')]);router[_0xa979('0x17')]('/:id/users',auth[_0xa979('0x8')](),controller['removeAgents']);module[_0xa979('0x1a')]=router; \ No newline at end of file +var _0x0229=['/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get'];(function(_0x331a82,_0x522233){var _0x53724c=function(_0x46c811){while(--_0x46c811){_0x331a82['push'](_0x331a82['shift']());}};_0x53724c(++_0x522233);}(_0x0229,0x1f4));var _0x9022=function(_0x4e970a,_0x515c02){_0x4e970a=_0x4e970a-0x0;var _0x50efa1=_0x0229[_0x4e970a];return _0x50efa1;};'use strict';var multer=require(_0x9022('0x0'));var util=require(_0x9022('0x1'));var path=require(_0x9022('0x2'));var timeout=require('connect-timeout');var express=require(_0x9022('0x3'));var router=express[_0x9022('0x4')]();var fs_extra=require(_0x9022('0x5'));var auth=require(_0x9022('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9022('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9022('0x8')]);router[_0x9022('0x9')](_0x9022('0xa'),auth[_0x9022('0xb')](),controller['describe']);router['get'](_0x9022('0xc'),auth['isAuthenticated'](),controller[_0x9022('0xd')]);router[_0x9022('0x9')]('/:id/members',auth[_0x9022('0xb')](),controller[_0x9022('0xe')]);router[_0x9022('0x9')](_0x9022('0xf'),auth['isAuthenticated'](),controller[_0x9022('0x10')]);router['get'](_0x9022('0x11'),auth['isAuthenticated'](),controller[_0x9022('0x12')]);router[_0x9022('0x13')]('/',auth[_0x9022('0xb')](),controller[_0x9022('0x14')]);router[_0x9022('0x13')](_0x9022('0xf'),auth[_0x9022('0xb')](),controller[_0x9022('0x15')]);router[_0x9022('0x13')]('/:id/users',auth[_0x9022('0xb')](),controller[_0x9022('0x16')]);router[_0x9022('0x17')]('/:id',auth[_0x9022('0xb')](),controller[_0x9022('0x18')]);router[_0x9022('0x19')](_0x9022('0xc'),auth[_0x9022('0xb')](),controller[_0x9022('0x1a')]);router[_0x9022('0x19')](_0x9022('0xf'),auth[_0x9022('0xb')](),controller[_0x9022('0x1b')]);router[_0x9022('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0x9022('0x1c')]);module[_0x9022('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index d943fd8..e0936ea 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 _0x3ccd=['beepall','sequelize','STRING','INTEGER','rrmemory'];(function(_0x3ac4a9,_0x111753){var _0x51c9e4=function(_0x2e9289){while(--_0x2e9289){_0x3ac4a9['push'](_0x3ac4a9['shift']());}};_0x51c9e4(++_0x111753);}(_0x3ccd,0x1eb));var _0xd3cc=function(_0x41941e,_0x1df32){_0x41941e=_0x41941e-0x0;var _0x4fb269=_0x3ccd[_0x41941e];return _0x4fb269;};'use strict';var Sequelize=require(_0xd3cc('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3cc('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd3cc('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd3cc('0x3'),_0xd3cc('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x3e8d=['roundrobin','sequelize','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x179b43,_0x509e24){var _0x4583af=function(_0x129aa3){while(--_0x129aa3){_0x179b43['push'](_0x179b43['shift']());}};_0x4583af(++_0x509e24);}(_0x3e8d,0xfd));var _0xd3e8=function(_0x59b931,_0x4ed887){_0x59b931=_0x59b931-0x0;var _0x5e76b0=_0x3e8d[_0x59b931];return _0x5e76b0;};'use strict';var Sequelize=require(_0xd3e8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xd3e8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd3e8('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd3e8('0x3')](_0xd3e8('0x4'),_0xd3e8('0x5'),_0xd3e8('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 29086e0..34b149c 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 _0x1256=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','SmsQueues','destroy','error','stack','name','send','index','map','SmsQueue','rawAttributes','keys','intersection','model','attributes','fields','query','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','find','params','describe','getMembers','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','smsPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','addAgents','spread','userSmsQueue:remove','getAgents','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x262f33,_0x156f74){var _0x5acba2=function(_0xcac4c7){while(--_0xcac4c7){_0x262f33['push'](_0x262f33['shift']());}};_0x5acba2(++_0x156f74);}(_0x1256,0x79));var _0x6125=function(_0x1d98f1,_0x1e7b1a){_0x1d98f1=_0x1d98f1-0x0;var _0x273bd=_0x1256[_0x1d98f1];return _0x273bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6125('0x0'));var rp=require(_0x6125('0x1'));var moment=require(_0x6125('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6125('0x3'));var util=require(_0x6125('0x4'));var path=require(_0x6125('0x5'));var sox=require(_0x6125('0x6'));var csv=require('to-csv');var ejs=require(_0x6125('0x7'));var fs=require('fs');var fs_extra=require(_0x6125('0x8'));var _=require(_0x6125('0x9'));var squel=require('squel');var crypto=require(_0x6125('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6125('0xb'));var toCsv=require(_0x6125('0xc'));var querystring=require(_0x6125('0xd'));var Papa=require('papaparse');var Redis=require(_0x6125('0xe'));var authService=require(_0x6125('0xf'));var qs=require(_0x6125('0x10'));var as=require(_0x6125('0x11'));var hardwareService=require(_0x6125('0x12'));var logger=require(_0x6125('0x13'))('api');var utils=require(_0x6125('0x14'));var config=require(_0x6125('0x15'));var licenseUtil=require(_0x6125('0x16'));var db=require(_0x6125('0x17'))['db'];config['redis']=_['defaults'](config[_0x6125('0x18')],{'host':_0x6125('0x19'),'port':0x18eb});var socket=require(_0x6125('0x1a'))(new Redis(config[_0x6125('0x18')]));require(_0x6125('0x1b'))['register'](socket);function respondWithStatusCode(_0x177e2c,_0x946b2c){_0x946b2c=_0x946b2c||0xcc;return function(_0x408345){if(_0x408345){return _0x177e2c[_0x6125('0x1c')](_0x946b2c);}return _0x177e2c[_0x6125('0x1d')](_0x946b2c)[_0x6125('0x1e')]();};}function respondWithResult(_0x3ae0e7,_0x2c6230){_0x2c6230=_0x2c6230||0xc8;return function(_0x1b5fa2){if(_0x1b5fa2){return _0x3ae0e7[_0x6125('0x1d')](_0x2c6230)[_0x6125('0x1f')](_0x1b5fa2);}};}function respondWithFilteredResult(_0x4334bd,_0x46acc6){return function(_0x2221a9){if(_0x2221a9){var _0x14924c=typeof _0x46acc6[_0x6125('0x20')]===_0x6125('0x21')&&typeof _0x46acc6[_0x6125('0x22')]==='undefined';var _0x3906d7=_0x2221a9[_0x6125('0x23')];var _0x20be3e=_0x14924c?0x0:_0x46acc6[_0x6125('0x20')];var _0x1ad4b1=_0x14924c?_0x2221a9['count']:_0x46acc6[_0x6125('0x20')]+_0x46acc6[_0x6125('0x22')];var _0x4d41ec;if(_0x1ad4b1>=_0x3906d7){_0x1ad4b1=_0x3906d7;_0x4d41ec=0xc8;}else{_0x4d41ec=0xce;}_0x4334bd[_0x6125('0x1d')](_0x4d41ec);return _0x4334bd[_0x6125('0x24')](_0x6125('0x25'),_0x20be3e+'-'+_0x1ad4b1+'/'+_0x3906d7)[_0x6125('0x1f')](_0x2221a9);}return null;};}function patchUpdates(_0x1c33d2){return function(_0x2c637a){try{jsonpatch[_0x6125('0x26')](_0x2c637a,_0x1c33d2,!![]);}catch(_0x32c9e2){return BPromise[_0x6125('0x27')](_0x32c9e2);}return _0x2c637a['save']();};}function saveUpdates(_0xe91bc5,_0x3c1918){return function(_0x5dffcc){if(_0x5dffcc){return _0x5dffcc[_0x6125('0x28')](_0xe91bc5)[_0x6125('0x29')](function(_0x152228){return _0x152228;});}return null;};}function removeEntity(_0x35757c,_0x238a56){return function(_0xde73d2){if(_0xde73d2){return _0xde73d2['destroy']()[_0x6125('0x29')](function(){var _0x717fb6=_0xde73d2[_0x6125('0x2a')]({'plain':!![]});var _0x2a51e4=_0x6125('0x2b');return db['UserProfileResource'][_0x6125('0x2c')]({'where':{'type':_0x2a51e4,'resourceId':_0x717fb6['id']}})[_0x6125('0x29')](function(){return _0xde73d2;});})[_0x6125('0x29')](function(){_0x35757c['status'](0xcc)[_0x6125('0x1e')]();});}};}function handleEntityNotFound(_0x5f4cf5,_0x12abb5){return function(_0x4ee0d5){if(!_0x4ee0d5){_0x5f4cf5[_0x6125('0x1c')](0x194);}return _0x4ee0d5;};}function handleError(_0x1d7855,_0x213277){_0x213277=_0x213277||0x1f4;return function(_0x204abb){logger[_0x6125('0x2d')](_0x204abb[_0x6125('0x2e')]);if(_0x204abb[_0x6125('0x2f')]){delete _0x204abb['name'];}_0x1d7855[_0x6125('0x1d')](_0x213277)[_0x6125('0x30')](_0x204abb);};}exports[_0x6125('0x31')]=function(_0x5d5905,_0x209c7b){var _0x353efb={},_0xf37c5e={},_0x249ec5={'count':0x0,'rows':[]};var _0x435dfb=_[_0x6125('0x32')](db[_0x6125('0x33')][_0x6125('0x34')],function(_0x20b90f){return{'name':_0x20b90f['fieldName'],'type':_0x20b90f['type']['key']};});_0xf37c5e['model']=_[_0x6125('0x32')](_0x435dfb,'name');_0xf37c5e['query']=_[_0x6125('0x35')](_0x5d5905['query']);_0xf37c5e['filters']=_[_0x6125('0x36')](_0xf37c5e[_0x6125('0x37')],_0xf37c5e['query']);_0x353efb[_0x6125('0x38')]=_[_0x6125('0x36')](_0xf37c5e[_0x6125('0x37')],qs[_0x6125('0x39')](_0x5d5905[_0x6125('0x3a')][_0x6125('0x39')]));_0x353efb['attributes']=_0x353efb[_0x6125('0x38')]['length']?_0x353efb['attributes']:_0xf37c5e['model'];if(!_0x5d5905[_0x6125('0x3a')][_0x6125('0x3b')]('nolimit')){_0x353efb[_0x6125('0x22')]=qs[_0x6125('0x22')](_0x5d5905['query']['limit']);_0x353efb[_0x6125('0x20')]=qs[_0x6125('0x20')](_0x5d5905['query']['offset']);}_0x353efb[_0x6125('0x3c')]=qs[_0x6125('0x3d')](_0x5d5905['query'][_0x6125('0x3d')]);_0x353efb[_0x6125('0x3e')]=qs[_0x6125('0x3f')](_[_0x6125('0x40')](_0x5d5905['query'],_0xf37c5e['filters']),_0x435dfb);if(_0x5d5905['query'][_0x6125('0x41')]){_0x353efb['where']=_['merge'](_0x353efb['where'],{'$or':_[_0x6125('0x32')](_0x435dfb,function(_0x1e7241){if(_0x1e7241[_0x6125('0x42')]!==_0x6125('0x43')){var _0x122075={};_0x122075[_0x1e7241[_0x6125('0x2f')]]={'$like':'%'+_0x5d5905['query']['filter']+'%'};return _0x122075;}})});}_0x353efb=_['merge']({},_0x353efb,_0x5d5905[_0x6125('0x44')]);var _0x245ffb={'where':_0x353efb[_0x6125('0x3e')]};return db[_0x6125('0x33')][_0x6125('0x23')](_0x245ffb)['then'](function(_0x279fa7){_0x249ec5[_0x6125('0x23')]=_0x279fa7;if(_0x5d5905[_0x6125('0x3a')][_0x6125('0x45')]){_0x353efb[_0x6125('0x46')]=[{'all':!![]}];}return db[_0x6125('0x33')][_0x6125('0x47')](_0x353efb);})['then'](function(_0x11e799){_0x249ec5[_0x6125('0x48')]=_0x11e799;return _0x249ec5;})[_0x6125('0x29')](respondWithFilteredResult(_0x209c7b,_0x353efb))[_0x6125('0x49')](handleError(_0x209c7b,null));};exports[_0x6125('0x4a')]=function(_0x29539e,_0x225e67){var _0x213627={'raw':!![],'where':{'id':_0x29539e['params']['id']}},_0x47d383={};_0x47d383[_0x6125('0x37')]=_[_0x6125('0x35')](db[_0x6125('0x33')]['rawAttributes']);_0x47d383[_0x6125('0x3a')]=_['keys'](_0x29539e[_0x6125('0x3a')]);_0x47d383[_0x6125('0x3f')]=_[_0x6125('0x36')](_0x47d383['model'],_0x47d383[_0x6125('0x3a')]);_0x213627[_0x6125('0x38')]=_['intersection'](_0x47d383['model'],qs[_0x6125('0x39')](_0x29539e['query']['fields']));_0x213627[_0x6125('0x38')]=_0x213627[_0x6125('0x38')][_0x6125('0x4b')]?_0x213627[_0x6125('0x38')]:_0x47d383[_0x6125('0x37')];if(_0x29539e['query'][_0x6125('0x45')]){_0x213627['include']=[{'all':!![]}];}_0x213627=_[_0x6125('0x4c')]({},_0x213627,_0x29539e[_0x6125('0x44')]);return db['SmsQueue']['find'](_0x213627)[_0x6125('0x29')](handleEntityNotFound(_0x225e67,null))['then'](respondWithResult(_0x225e67,null))[_0x6125('0x49')](handleError(_0x225e67,null));};exports['create']=function(_0x4501d6,_0x522bde){return db[_0x6125('0x33')]['create'](_0x4501d6[_0x6125('0x4d')],{})[_0x6125('0x29')](function(_0x49a3ca){var _0x21abc6=_0x4501d6[_0x6125('0x4e')][_0x6125('0x2a')]({'plain':!![]});if(!_0x21abc6)throw new Error(_0x6125('0x4f'));if(_0x21abc6['role']==='user'){var _0x43bd6f=_0x49a3ca[_0x6125('0x2a')]({'plain':!![]});var _0x1f90f4=_0x6125('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x1f90f4,'userProfileId':_0x21abc6[_0x6125('0x50')]},'raw':!![]})['then'](function(_0x10ff27){if(_0x10ff27&&_0x10ff27[_0x6125('0x51')]===0x0){return db[_0x6125('0x52')]['create']({'name':_0x43bd6f[_0x6125('0x2f')],'resourceId':_0x43bd6f['id'],'type':_0x10ff27['name'],'sectionId':_0x10ff27['id']},{})[_0x6125('0x29')](function(){return _0x49a3ca;});}else{return _0x49a3ca;}})['catch'](function(_0x704e0d){logger[_0x6125('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x704e0d);throw _0x704e0d;});}return _0x49a3ca;})[_0x6125('0x29')](respondWithResult(_0x522bde,0xc9))[_0x6125('0x49')](handleError(_0x522bde,null));};exports[_0x6125('0x28')]=function(_0x46ebcf,_0x144795){if(_0x46ebcf[_0x6125('0x4d')]['id']){delete _0x46ebcf['body']['id'];}return db[_0x6125('0x33')][_0x6125('0x53')]({'where':{'id':_0x46ebcf['params']['id']}})['then'](handleEntityNotFound(_0x144795,null))[_0x6125('0x29')](saveUpdates(_0x46ebcf[_0x6125('0x4d')],null))['then'](respondWithResult(_0x144795,null))[_0x6125('0x49')](handleError(_0x144795,null));};exports[_0x6125('0x2c')]=function(_0x19712e,_0x2e06c6){return db[_0x6125('0x33')]['find']({'where':{'id':_0x19712e[_0x6125('0x54')]['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x2e06c6,null))[_0x6125('0x29')](removeEntity(_0x2e06c6,null))[_0x6125('0x49')](handleError(_0x2e06c6,null));};exports['describe']=function(_0xbb3862,_0x2a64ff){return db[_0x6125('0x33')][_0x6125('0x55')]()[_0x6125('0x29')](respondWithResult(_0x2a64ff,null))[_0x6125('0x49')](handleError(_0x2a64ff,null));};exports[_0x6125('0x56')]=function(_0x2f276b,_0x1b0871,_0x6365a1){var _0x14a4d2={'raw':!![],'where':{}},_0x52866b={},_0x4637fe;return db['SmsQueue']['findOne']({'where':{'id':_0x2f276b[_0x6125('0x54')]['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x1b0871,null))[_0x6125('0x29')](function(_0x2761b3){if(_0x2761b3){_0x4637fe=_0x2761b3['get']({'plain':!![]});_0x52866b['model']=_['keys'](db[_0x6125('0x57')][_0x6125('0x34')]);_0x52866b[_0x6125('0x3a')]=_['keys'](_0x2f276b[_0x6125('0x3a')]);_0x52866b[_0x6125('0x3f')]=_[_0x6125('0x36')](_0x52866b[_0x6125('0x37')],_0x52866b[_0x6125('0x3a')]);_0x14a4d2[_0x6125('0x38')]=_['intersection'](_0x52866b[_0x6125('0x37')],qs[_0x6125('0x39')](_0x2f276b['query'][_0x6125('0x39')]));_0x14a4d2[_0x6125('0x38')]=_0x14a4d2[_0x6125('0x38')]['length']?_0x14a4d2[_0x6125('0x38')]:_0x52866b[_0x6125('0x37')];if(!_0x2f276b[_0x6125('0x3a')]['hasOwnProperty'](_0x6125('0x58'))){_0x14a4d2[_0x6125('0x22')]=qs[_0x6125('0x22')](_0x2f276b[_0x6125('0x3a')][_0x6125('0x22')]);_0x14a4d2[_0x6125('0x20')]=qs[_0x6125('0x20')](_0x2f276b['query'][_0x6125('0x20')]);}_0x14a4d2[_0x6125('0x3c')]=qs[_0x6125('0x3d')](_0x2f276b[_0x6125('0x3a')][_0x6125('0x3d')]);_0x14a4d2[_0x6125('0x3e')]=qs[_0x6125('0x3f')](_[_0x6125('0x40')](_0x2f276b[_0x6125('0x3a')],_0x52866b[_0x6125('0x3f')]));_0x14a4d2['where'][_0x6125('0x59')]=_0x2761b3['id'];if(_0x2f276b[_0x6125('0x3a')][_0x6125('0x41')]){_0x14a4d2[_0x6125('0x3e')]=_[_0x6125('0x4c')](_0x14a4d2['where'],{'$or':_[_0x6125('0x32')](_0x14a4d2[_0x6125('0x38')],function(_0x4fdd86){var _0x2af30f={};_0x2af30f[_0x4fdd86]={'$like':'%'+_0x2f276b['query'][_0x6125('0x41')]+'%'};return _0x2af30f;})});}_0x14a4d2=_['merge']({},_0x14a4d2,_0x2f276b[_0x6125('0x44')]);return db[_0x6125('0x57')][_0x6125('0x47')](_0x14a4d2);}})[_0x6125('0x29')](function(_0x2ff6f7){if(_0x2ff6f7){return db[_0x6125('0x5a')][_0x6125('0x5b')]({'where':{'id':_[_0x6125('0x32')](_0x2ff6f7,'UserId'),'role':'agent'},'attributes':['id','name',_0x6125('0x5c'),_0x6125('0x5d'),_0x6125('0x5e')]});}})[_0x6125('0x29')](function(_0x4e8e41){if(_0x4e8e41){return{'count':_0x4e8e41[_0x6125('0x23')],'rows':_['map'](_0x4e8e41[_0x6125('0x48')],function(_0x39d793){return{'membername':_0x39d793[_0x6125('0x2f')],'UserId':_0x39d793['id'],'queue_name':_0x4637fe[_0x6125('0x2f')],'SmsQueueId':_0x4637fe['id'],'interface':util[_0x6125('0x5f')](_0x6125('0x60'),_0x6125('0x61'),_0x39d793['name']),'penalty':0x0,'paused':_0x39d793[_0x6125('0x5c')],'createdAt':_0x39d793['createdAt'],'updatedAt':_0x39d793[_0x6125('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b0871,_0x14a4d2))[_0x6125('0x49')](handleError(_0x1b0871,null));};exports['getTeams']=function(_0x495b53,_0x1369d0,_0x3a3d47){var _0x20af4b={};var _0x3545b3={};var _0x4245e6;var _0x313d1b;return db[_0x6125('0x33')][_0x6125('0x62')]({'where':{'id':_0x495b53[_0x6125('0x54')]['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x1369d0,null))[_0x6125('0x29')](function(_0x5ace88){if(_0x5ace88){_0x4245e6=_0x5ace88;_0x3545b3[_0x6125('0x37')]=_[_0x6125('0x35')](db[_0x6125('0x63')][_0x6125('0x34')]);_0x3545b3[_0x6125('0x3a')]=_[_0x6125('0x35')](_0x495b53[_0x6125('0x3a')]);_0x3545b3['filters']=_['intersection'](_0x3545b3[_0x6125('0x37')],_0x3545b3[_0x6125('0x3a')]);_0x20af4b[_0x6125('0x38')]=_[_0x6125('0x36')](_0x3545b3[_0x6125('0x37')],qs[_0x6125('0x39')](_0x495b53[_0x6125('0x3a')][_0x6125('0x39')]));_0x20af4b['attributes']=_0x20af4b['attributes'][_0x6125('0x4b')]?_0x20af4b['attributes']:_0x3545b3[_0x6125('0x37')];_0x20af4b[_0x6125('0x3c')]=qs[_0x6125('0x3d')](_0x495b53[_0x6125('0x3a')][_0x6125('0x3d')]);_0x20af4b[_0x6125('0x3e')]=qs[_0x6125('0x3f')](_['pick'](_0x495b53[_0x6125('0x3a')],_0x3545b3[_0x6125('0x3f')]));if(_0x495b53[_0x6125('0x3a')]['filter']){_0x20af4b[_0x6125('0x3e')]=_['merge'](_0x20af4b[_0x6125('0x3e')],{'$or':_[_0x6125('0x32')](_0x20af4b[_0x6125('0x38')],function(_0x15a0de){var _0x5aceaf={};_0x5aceaf[_0x15a0de]={'$like':'%'+_0x495b53[_0x6125('0x3a')]['filter']+'%'};return _0x5aceaf;})});}_0x20af4b=_[_0x6125('0x4c')]({},_0x20af4b,_0x495b53[_0x6125('0x44')]);return _0x4245e6[_0x6125('0x64')](_0x20af4b);}})[_0x6125('0x29')](function(_0x2e22fe){if(_0x2e22fe){_0x313d1b=_0x2e22fe[_0x6125('0x4b')];if(!_0x495b53[_0x6125('0x3a')][_0x6125('0x3b')](_0x6125('0x58'))){_0x20af4b[_0x6125('0x22')]=qs[_0x6125('0x22')](_0x495b53['query'][_0x6125('0x22')]);_0x20af4b['offset']=qs[_0x6125('0x20')](_0x495b53[_0x6125('0x3a')]['offset']);}return _0x4245e6[_0x6125('0x64')](_0x20af4b);}})['then'](function(_0x2fc0c8){if(_0x2fc0c8){return _0x2fc0c8?{'count':_0x313d1b,'rows':_0x2fc0c8}:null;}})[_0x6125('0x29')](respondWithResult(_0x1369d0,null))[_0x6125('0x49')](handleError(_0x1369d0,null));};exports[_0x6125('0x65')]=function(_0x266119,_0x57eefa,_0x3a3013){var _0x417c12=_0x266119['body'][_0x6125('0x66')];return db[_0x6125('0x63')][_0x6125('0x47')]({'where':{'id':_0x417c12},'attributes':['id'],'include':[{'model':db[_0x6125('0x5a')],'as':_0x6125('0x67'),'attributes':['id',_0x6125('0x2f'),_0x6125('0x68'),_0x6125('0x69'),'interface'],'raw':!![]}]})[_0x6125('0x29')](function(_0x19935a){if(_0x19935a){var _0xa2061b=_[_0x6125('0x6a')](_0x19935a,function(_0xb71fc6){var _0x445fb4=_0xb71fc6[_0x6125('0x2a')]({'plain':!![]});return _0x445fb4[_0x6125('0x67')];});return db[_0x6125('0x33')][_0x6125('0x53')]({'where':{'id':_0x266119[_0x6125('0x54')]['id']}})[_0x6125('0x29')](function(_0x16de94){return db[_0x6125('0x6b')][_0x6125('0x6c')](function(_0xd47ef5){return _0x16de94[_0x6125('0x65')](_0x417c12,{'transaction':_0xd47ef5})[_0x6125('0x29')](function(){return BPromise[_0x6125('0x6d')](_0xa2061b,function(_0xe57cca){return db[_0x6125('0x57')]['findOrCreate']({'where':{'UserId':_0xe57cca['id'],'SmsQueueId':_0x266119['params']['id']},'transaction':_0xd47ef5});});})['then'](function(){_0xa2061b[_0x6125('0x6e')](function(_0x553d0b){socket[_0x6125('0x6f')](_0x6125('0x70'),{'UserId':_0x553d0b['id'],'SmsQueueId':_0x16de94['id']});});});});});}})[_0x6125('0x29')](respondWithStatusCode(_0x57eefa,null))['catch'](handleError(_0x57eefa,null));};exports[_0x6125('0x71')]=function(_0x341e7c,_0x2df637,_0x904e3a){return db['Team'][_0x6125('0x47')]({'where':{'id':_0x341e7c[_0x6125('0x3a')][_0x6125('0x66')]},'attributes':['id'],'include':[{'model':db[_0x6125('0x5a')],'as':_0x6125('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6125('0x29')](handleEntityNotFound(_0x2df637,null))[_0x6125('0x29')](function(_0x18a4c6){var _0x5366aa=_[_0x6125('0x32')](_0x18a4c6,'id');var _0x433642=[];var _0x521518=[];var _0x2527e5=squel[_0x6125('0x72')]();_0x2527e5['field'](_0x6125('0x73'))['from'](_0x6125('0x74'),'tq')[_0x6125('0x75')](_0x6125('0x76'),'ut',_0x6125('0x77'))['where']('SmsQueueId\x20=\x20?',_0x341e7c['params']['id']);for(var _0x45cbed=0x0;_0x45cbed<_0x18a4c6[_0x6125('0x4b')];_0x45cbed+=0x1){let _0x20252d=_0x18a4c6[_0x45cbed];for(var _0x1ca0f9=0x0;_0x1ca0f9<_0x20252d['Agents'][_0x6125('0x4b')];_0x1ca0f9+=0x1){let _0x3d2a0c=_0x20252d[_0x6125('0x67')][_0x1ca0f9];var _0x4cf961=_0x2527e5[_0x6125('0x78')]();_0x4cf961[_0x6125('0x3e')](_0x6125('0x79'),_0x3d2a0c['id']);_0x521518[_0x6125('0x7a')](db[_0x6125('0x6b')]['query'](_0x4cf961[_0x6125('0x7b')](),{'type':db['sequelize'][_0x6125('0x7c')][_0x6125('0x7d')]})[_0x6125('0x29')](function(_0x83ec9c){if(_0x83ec9c[_0x6125('0x4b')]===0x1){return _0x3d2a0c['id'];}else{var _0x2c9c34=_[_0x6125('0x7e')](_[_0x6125('0x32')](_0x83ec9c,_0x6125('0x7f')),function(_0x1ec2aa){return _['includes'](_0x5366aa,_0x1ec2aa);});if(_0x2c9c34){return _0x3d2a0c['id'];}}}));}}return BPromise[_0x6125('0x80')](_0x521518)['then'](function(_0x1332e2){_0x433642=_(_0x433642)[_0x6125('0x81')](_0x1332e2)['compact']()[_0x6125('0x82')]();return db[_0x6125('0x33')][_0x6125('0x53')]({'where':{'id':_0x341e7c['params']['id']}})['then'](function(_0x447bb8){return db['sequelize'][_0x6125('0x6c')](function(_0x1dadc6){return _0x447bb8['removeTeams'](_0x341e7c[_0x6125('0x3a')][_0x6125('0x66')],{'transaction':_0x1dadc6})[_0x6125('0x29')](function(){if(!_[_0x6125('0x83')](_0x433642)){return _0x447bb8[_0x6125('0x84')](_0x433642,{'transaction':_0x1dadc6});}})[_0x6125('0x29')](function(){_0x433642[_0x6125('0x6e')](function(_0x23604a){socket[_0x6125('0x6f')]('userSmsQueue:remove',{'UserId':_0x23604a,'SmsQueueId':_0x447bb8['id']});});});});});});})[_0x6125('0x29')](respondWithStatusCode(_0x2df637,null))[_0x6125('0x49')](handleError(_0x2df637,null));};exports[_0x6125('0x85')]=function(_0x2f7a03,_0x5db8e8,_0x2be656){return db[_0x6125('0x33')]['find']({'where':{'id':_0x2f7a03[_0x6125('0x54')]['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x5db8e8,null))[_0x6125('0x29')](function(_0xce46c3){if(_0xce46c3){return _0xce46c3[_0x6125('0x85')](_0x2f7a03['body'][_0x6125('0x66')],_['omit'](_0x2f7a03[_0x6125('0x4d')],[_0x6125('0x66'),'id'])||{})[_0x6125('0x86')](function(_0x2d0c2f){for(var _0x1b115e=0x0;_0x1b115e<_0x2f7a03[_0x6125('0x4d')][_0x6125('0x66')][_0x6125('0x4b')];_0x1b115e+=0x1){socket[_0x6125('0x6f')](_0x6125('0x70'),{'UserId':Number(_0x2f7a03[_0x6125('0x4d')][_0x6125('0x66')][_0x1b115e]),'SmsQueueId':Number(_0x2f7a03['params']['id'])});}return _0x2d0c2f;});}})[_0x6125('0x29')](respondWithResult(_0x5db8e8,null))[_0x6125('0x49')](handleError(_0x5db8e8,null));};exports['removeAgents']=function(_0x5850e5,_0x497593,_0x16289e){return db[_0x6125('0x33')][_0x6125('0x53')]({'where':{'id':_0x5850e5[_0x6125('0x54')]['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x497593,null))[_0x6125('0x29')](function(_0x2d373b){if(_0x2d373b){return _0x2d373b['removeAgents'](_0x5850e5[_0x6125('0x3a')]['ids'])['then'](function(){if(_['isArray'](_0x5850e5[_0x6125('0x3a')]['ids'])){for(var _0x435001=0x0;_0x435001<_0x5850e5[_0x6125('0x3a')][_0x6125('0x66')][_0x6125('0x4b')];_0x435001+=0x1){socket['emit'](_0x6125('0x87'),{'UserId':Number(_0x5850e5[_0x6125('0x3a')]['ids'][_0x435001]),'SmsQueueId':Number(_0x5850e5['params']['id'])});}}else{socket[_0x6125('0x6f')](_0x6125('0x87'),{'UserId':Number(_0x5850e5['query'][_0x6125('0x66')]),'SmsQueueId':Number(_0x5850e5[_0x6125('0x54')]['id'])});}});}})[_0x6125('0x29')](respondWithStatusCode(_0x497593,null))[_0x6125('0x49')](handleError(_0x497593,null));};exports[_0x6125('0x88')]=function(_0x3f2caa,_0x5e5932,_0x330c69){var _0x489bd1={};var _0x3485fa={};var _0x16df5f;var _0x50e093;return db[_0x6125('0x33')][_0x6125('0x62')]({'where':{'id':_0x3f2caa['params']['id']}})[_0x6125('0x29')](handleEntityNotFound(_0x5e5932,null))[_0x6125('0x29')](function(_0x171e87){if(_0x171e87){_0x16df5f=_0x171e87;_0x3485fa[_0x6125('0x37')]=_[_0x6125('0x35')](db['User'][_0x6125('0x34')]);_0x3485fa[_0x6125('0x3a')]=_[_0x6125('0x35')](_0x3f2caa[_0x6125('0x3a')]);_0x3485fa[_0x6125('0x3f')]=_[_0x6125('0x36')](_0x3485fa[_0x6125('0x37')],_0x3485fa['query']);_0x489bd1[_0x6125('0x38')]=_[_0x6125('0x36')](_0x3485fa[_0x6125('0x37')],qs[_0x6125('0x39')](_0x3f2caa[_0x6125('0x3a')][_0x6125('0x39')]));_0x489bd1[_0x6125('0x38')]=_0x489bd1[_0x6125('0x38')][_0x6125('0x4b')]?_0x489bd1['attributes']:_0x3485fa['model'];_0x489bd1[_0x6125('0x3c')]=qs[_0x6125('0x3d')](_0x3f2caa[_0x6125('0x3a')]['sort']);_0x489bd1[_0x6125('0x3e')]=qs[_0x6125('0x3f')](_[_0x6125('0x40')](_0x3f2caa[_0x6125('0x3a')],_0x3485fa[_0x6125('0x3f')]));if(_0x3f2caa[_0x6125('0x3a')][_0x6125('0x41')]){_0x489bd1['where']=_[_0x6125('0x4c')](_0x489bd1['where'],{'$or':_[_0x6125('0x32')](_0x489bd1[_0x6125('0x38')],function(_0x4fb2be){var _0x50f9fb={};_0x50f9fb[_0x4fb2be]={'$like':'%'+_0x3f2caa[_0x6125('0x3a')][_0x6125('0x41')]+'%'};return _0x50f9fb;})});}_0x489bd1=_[_0x6125('0x4c')]({},_0x489bd1,_0x3f2caa['options']);return _0x16df5f[_0x6125('0x88')](_0x489bd1);}})[_0x6125('0x29')](function(_0x32df73){if(_0x32df73){_0x50e093=_0x32df73[_0x6125('0x4b')];if(!_0x3f2caa['query'][_0x6125('0x3b')](_0x6125('0x58'))){_0x489bd1[_0x6125('0x22')]=qs['limit'](_0x3f2caa[_0x6125('0x3a')]['limit']);_0x489bd1['offset']=qs[_0x6125('0x20')](_0x3f2caa['query'][_0x6125('0x20')]);}return _0x16df5f[_0x6125('0x88')](_0x489bd1);}})[_0x6125('0x29')](function(_0x48c834){if(_0x48c834){return _0x48c834?{'count':_0x50e093,'rows':_0x48c834}:null;}})[_0x6125('0x29')](respondWithResult(_0x5e5932,null))[_0x6125('0x49')](handleError(_0x5e5932,null));}; \ No newline at end of file +var _0x8e8a=['moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','SmsQueues','UserProfileResource','destroy','end','error','name','send','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','UserSmsQueue','sort','SmsQueueId','findAll','findAndCountAll','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','findOne','getAgents','rimraf','zip-dir','fast-json-patch'];(function(_0xd734e6,_0x22bbf9){var _0x304feb=function(_0x254fa3){while(--_0x254fa3){_0xd734e6['push'](_0xd734e6['shift']());}};_0x304feb(++_0x22bbf9);}(_0x8e8a,0x8a));var _0xa8e8=function(_0x53c5fb,_0xdf9bcb){_0x53c5fb=_0x53c5fb-0x0;var _0x24ae46=_0x8e8a[_0x53c5fb];return _0x24ae46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8e8('0x0'));var zipdir=require(_0xa8e8('0x1'));var jsonpatch=require(_0xa8e8('0x2'));var rp=require('request-promise');var moment=require(_0xa8e8('0x3'));var BPromise=require(_0xa8e8('0x4'));var Mustache=require('mustache');var util=require(_0xa8e8('0x5'));var path=require('path');var sox=require(_0xa8e8('0x6'));var csv=require(_0xa8e8('0x7'));var ejs=require(_0xa8e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa8e8('0x9'));var crypto=require(_0xa8e8('0xa'));var jsforce=require(_0xa8e8('0xb'));var deskjs=require(_0xa8e8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa8e8('0xd'));var Papa=require(_0xa8e8('0xe'));var Redis=require(_0xa8e8('0xf'));var authService=require(_0xa8e8('0x10'));var qs=require(_0xa8e8('0x11'));var as=require(_0xa8e8('0x12'));var hardwareService=require(_0xa8e8('0x13'));var logger=require('../../config/logger')(_0xa8e8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa8e8('0x15'))['db'];config[_0xa8e8('0x16')]=_[_0xa8e8('0x17')](config[_0xa8e8('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8e8('0x18'))(new Redis(config['redis']));require(_0xa8e8('0x19'))[_0xa8e8('0x1a')](socket);function respondWithStatusCode(_0x3573b7,_0x57ac52){_0x57ac52=_0x57ac52||0xcc;return function(_0x52677d){if(_0x52677d){return _0x3573b7[_0xa8e8('0x1b')](_0x57ac52);}return _0x3573b7['status'](_0x57ac52)['end']();};}function respondWithResult(_0x3c86d8,_0x511e49){_0x511e49=_0x511e49||0xc8;return function(_0x1ec382){if(_0x1ec382){return _0x3c86d8[_0xa8e8('0x1c')](_0x511e49)['json'](_0x1ec382);}};}function respondWithFilteredResult(_0x25f288,_0x118f93){return function(_0x238174){if(_0x238174){var _0x2c358d=typeof _0x118f93['offset']===_0xa8e8('0x1d')&&typeof _0x118f93[_0xa8e8('0x1e')]===_0xa8e8('0x1d');var _0x40ac29=_0x238174['count'];var _0x39e0ad=_0x2c358d?0x0:_0x118f93['offset'];var _0x43b66a=_0x2c358d?_0x238174[_0xa8e8('0x1f')]:_0x118f93['offset']+_0x118f93[_0xa8e8('0x1e')];var _0x2983c9;if(_0x43b66a>=_0x40ac29){_0x43b66a=_0x40ac29;_0x2983c9=0xc8;}else{_0x2983c9=0xce;}_0x25f288[_0xa8e8('0x1c')](_0x2983c9);return _0x25f288[_0xa8e8('0x20')](_0xa8e8('0x21'),_0x39e0ad+'-'+_0x43b66a+'/'+_0x40ac29)[_0xa8e8('0x22')](_0x238174);}return null;};}function patchUpdates(_0x128be7){return function(_0x3b73fb){try{jsonpatch[_0xa8e8('0x23')](_0x3b73fb,_0x128be7,!![]);}catch(_0x1bc3a7){return BPromise[_0xa8e8('0x24')](_0x1bc3a7);}return _0x3b73fb['save']();};}function saveUpdates(_0xddeb85,_0x405373){return function(_0x155782){if(_0x155782){return _0x155782[_0xa8e8('0x25')](_0xddeb85)[_0xa8e8('0x26')](function(_0x5d250a){return _0x5d250a;});}return null;};}function removeEntity(_0x569a64,_0x378876){return function(_0x1df17e){if(_0x1df17e){return _0x1df17e['destroy']()[_0xa8e8('0x26')](function(){var _0xc8a958=_0x1df17e[_0xa8e8('0x27')]({'plain':!![]});var _0x51b770=_0xa8e8('0x28');return db[_0xa8e8('0x29')][_0xa8e8('0x2a')]({'where':{'type':_0x51b770,'resourceId':_0xc8a958['id']}})[_0xa8e8('0x26')](function(){return _0x1df17e;});})[_0xa8e8('0x26')](function(){_0x569a64[_0xa8e8('0x1c')](0xcc)[_0xa8e8('0x2b')]();});}};}function handleEntityNotFound(_0x58e2a8,_0x4c7379){return function(_0x5cfd67){if(!_0x5cfd67){_0x58e2a8[_0xa8e8('0x1b')](0x194);}return _0x5cfd67;};}function handleError(_0xc0c03b,_0x224ac0){_0x224ac0=_0x224ac0||0x1f4;return function(_0x2dd0a3){logger[_0xa8e8('0x2c')](_0x2dd0a3['stack']);if(_0x2dd0a3[_0xa8e8('0x2d')]){delete _0x2dd0a3['name'];}_0xc0c03b[_0xa8e8('0x1c')](_0x224ac0)[_0xa8e8('0x2e')](_0x2dd0a3);};}exports['index']=function(_0x280b40,_0x2d75df){var _0x96c297={},_0x38cdd1={},_0x5e1f70={'count':0x0,'rows':[]};var _0x4ef7dc=_[_0xa8e8('0x2f')](db[_0xa8e8('0x30')][_0xa8e8('0x31')],function(_0x385a0d){return{'name':_0x385a0d[_0xa8e8('0x32')],'type':_0x385a0d[_0xa8e8('0x33')][_0xa8e8('0x34')]};});_0x38cdd1[_0xa8e8('0x35')]=_['map'](_0x4ef7dc,_0xa8e8('0x2d'));_0x38cdd1[_0xa8e8('0x36')]=_[_0xa8e8('0x37')](_0x280b40[_0xa8e8('0x36')]);_0x38cdd1[_0xa8e8('0x38')]=_[_0xa8e8('0x39')](_0x38cdd1['model'],_0x38cdd1[_0xa8e8('0x36')]);_0x96c297['attributes']=_[_0xa8e8('0x39')](_0x38cdd1[_0xa8e8('0x35')],qs['fields'](_0x280b40['query'][_0xa8e8('0x3a')]));_0x96c297[_0xa8e8('0x3b')]=_0x96c297[_0xa8e8('0x3b')]['length']?_0x96c297[_0xa8e8('0x3b')]:_0x38cdd1[_0xa8e8('0x35')];if(!_0x280b40['query'][_0xa8e8('0x3c')](_0xa8e8('0x3d'))){_0x96c297['limit']=qs[_0xa8e8('0x1e')](_0x280b40[_0xa8e8('0x36')][_0xa8e8('0x1e')]);_0x96c297[_0xa8e8('0x3e')]=qs[_0xa8e8('0x3e')](_0x280b40[_0xa8e8('0x36')]['offset']);}_0x96c297[_0xa8e8('0x3f')]=qs['sort'](_0x280b40['query']['sort']);_0x96c297[_0xa8e8('0x40')]=qs[_0xa8e8('0x38')](_[_0xa8e8('0x41')](_0x280b40[_0xa8e8('0x36')],_0x38cdd1[_0xa8e8('0x38')]),_0x4ef7dc);if(_0x280b40[_0xa8e8('0x36')][_0xa8e8('0x42')]){_0x96c297[_0xa8e8('0x40')]=_[_0xa8e8('0x43')](_0x96c297[_0xa8e8('0x40')],{'$or':_['map'](_0x4ef7dc,function(_0x3b12fb){if(_0x3b12fb[_0xa8e8('0x33')]!==_0xa8e8('0x44')){var _0x491d4e={};_0x491d4e[_0x3b12fb[_0xa8e8('0x2d')]]={'$like':'%'+_0x280b40['query'][_0xa8e8('0x42')]+'%'};return _0x491d4e;}})});}_0x96c297=_[_0xa8e8('0x43')]({},_0x96c297,_0x280b40['options']);var _0x42dbbd={'where':_0x96c297['where']};return db['SmsQueue'][_0xa8e8('0x1f')](_0x42dbbd)['then'](function(_0x17065e){_0x5e1f70[_0xa8e8('0x1f')]=_0x17065e;if(_0x280b40['query'][_0xa8e8('0x45')]){_0x96c297[_0xa8e8('0x46')]=[{'all':!![]}];}return db[_0xa8e8('0x30')]['findAll'](_0x96c297);})[_0xa8e8('0x26')](function(_0x1a5949){_0x5e1f70[_0xa8e8('0x47')]=_0x1a5949;return _0x5e1f70;})[_0xa8e8('0x26')](respondWithFilteredResult(_0x2d75df,_0x96c297))[_0xa8e8('0x48')](handleError(_0x2d75df,null));};exports['show']=function(_0x2fe1d1,_0x2dd7eb){var _0x310316={'raw':!![],'where':{'id':_0x2fe1d1[_0xa8e8('0x49')]['id']}},_0x10432e={};_0x10432e[_0xa8e8('0x35')]=_[_0xa8e8('0x37')](db[_0xa8e8('0x30')]['rawAttributes']);_0x10432e[_0xa8e8('0x36')]=_[_0xa8e8('0x37')](_0x2fe1d1['query']);_0x10432e[_0xa8e8('0x38')]=_[_0xa8e8('0x39')](_0x10432e['model'],_0x10432e[_0xa8e8('0x36')]);_0x310316[_0xa8e8('0x3b')]=_[_0xa8e8('0x39')](_0x10432e['model'],qs[_0xa8e8('0x3a')](_0x2fe1d1[_0xa8e8('0x36')]['fields']));_0x310316[_0xa8e8('0x3b')]=_0x310316[_0xa8e8('0x3b')][_0xa8e8('0x4a')]?_0x310316[_0xa8e8('0x3b')]:_0x10432e['model'];if(_0x2fe1d1[_0xa8e8('0x36')][_0xa8e8('0x45')]){_0x310316[_0xa8e8('0x46')]=[{'all':!![]}];}_0x310316=_[_0xa8e8('0x43')]({},_0x310316,_0x2fe1d1[_0xa8e8('0x4b')]);return db[_0xa8e8('0x30')][_0xa8e8('0x4c')](_0x310316)[_0xa8e8('0x26')](handleEntityNotFound(_0x2dd7eb,null))[_0xa8e8('0x26')](respondWithResult(_0x2dd7eb,null))[_0xa8e8('0x48')](handleError(_0x2dd7eb,null));};exports[_0xa8e8('0x4d')]=function(_0x2a2770,_0x5537ca){return db[_0xa8e8('0x30')][_0xa8e8('0x4d')](_0x2a2770['body'],{})[_0xa8e8('0x26')](function(_0x5eb225){var _0x2e9c8e=_0x2a2770[_0xa8e8('0x4e')][_0xa8e8('0x27')]({'plain':!![]});if(!_0x2e9c8e)throw new Error(_0xa8e8('0x4f'));if(_0x2e9c8e['role']===_0xa8e8('0x4e')){var _0x2d2862=_0x5eb225[_0xa8e8('0x27')]({'plain':!![]});var _0x2522b7='SmsQueues';return db[_0xa8e8('0x50')][_0xa8e8('0x4c')]({'where':{'name':_0x2522b7,'userProfileId':_0x2e9c8e[_0xa8e8('0x51')]},'raw':!![]})[_0xa8e8('0x26')](function(_0x54e06b){if(_0x54e06b&&_0x54e06b[_0xa8e8('0x52')]===0x0){return db[_0xa8e8('0x29')][_0xa8e8('0x4d')]({'name':_0x2d2862[_0xa8e8('0x2d')],'resourceId':_0x2d2862['id'],'type':_0x54e06b['name'],'sectionId':_0x54e06b['id']},{})[_0xa8e8('0x26')](function(){return _0x5eb225;});}else{return _0x5eb225;}})[_0xa8e8('0x48')](function(_0x3e0894){logger[_0xa8e8('0x2c')](_0xa8e8('0x53'),_0x3e0894);throw _0x3e0894;});}return _0x5eb225;})['then'](respondWithResult(_0x5537ca,0xc9))[_0xa8e8('0x48')](handleError(_0x5537ca,null));};exports['update']=function(_0xe8c32a,_0x2e91f8){if(_0xe8c32a[_0xa8e8('0x54')]['id']){delete _0xe8c32a[_0xa8e8('0x54')]['id'];}return db['SmsQueue'][_0xa8e8('0x4c')]({'where':{'id':_0xe8c32a[_0xa8e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e91f8,null))[_0xa8e8('0x26')](saveUpdates(_0xe8c32a['body'],null))[_0xa8e8('0x26')](respondWithResult(_0x2e91f8,null))['catch'](handleError(_0x2e91f8,null));};exports['destroy']=function(_0x508ce0,_0x571bb4){return db['SmsQueue'][_0xa8e8('0x4c')]({'where':{'id':_0x508ce0['params']['id']}})[_0xa8e8('0x26')](handleEntityNotFound(_0x571bb4,null))['then'](removeEntity(_0x571bb4,null))[_0xa8e8('0x48')](handleError(_0x571bb4,null));};exports['describe']=function(_0x2d73da,_0x26bb98){return db[_0xa8e8('0x30')][_0xa8e8('0x55')]()['then'](respondWithResult(_0x26bb98,null))['catch'](handleError(_0x26bb98,null));};exports['getMembers']=function(_0x4115a4,_0x295c18,_0x207d61){var _0x297d0a={'raw':!![],'where':{}},_0x2480cb={},_0xe8be5f;return db[_0xa8e8('0x30')]['findOne']({'where':{'id':_0x4115a4[_0xa8e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x295c18,null))[_0xa8e8('0x26')](function(_0x14d66d){if(_0x14d66d){_0xe8be5f=_0x14d66d['get']({'plain':!![]});_0x2480cb[_0xa8e8('0x35')]=_[_0xa8e8('0x37')](db[_0xa8e8('0x56')][_0xa8e8('0x31')]);_0x2480cb[_0xa8e8('0x36')]=_[_0xa8e8('0x37')](_0x4115a4[_0xa8e8('0x36')]);_0x2480cb[_0xa8e8('0x38')]=_[_0xa8e8('0x39')](_0x2480cb[_0xa8e8('0x35')],_0x2480cb[_0xa8e8('0x36')]);_0x297d0a['attributes']=_[_0xa8e8('0x39')](_0x2480cb[_0xa8e8('0x35')],qs[_0xa8e8('0x3a')](_0x4115a4['query'][_0xa8e8('0x3a')]));_0x297d0a[_0xa8e8('0x3b')]=_0x297d0a[_0xa8e8('0x3b')][_0xa8e8('0x4a')]?_0x297d0a['attributes']:_0x2480cb[_0xa8e8('0x35')];if(!_0x4115a4[_0xa8e8('0x36')][_0xa8e8('0x3c')](_0xa8e8('0x3d'))){_0x297d0a['limit']=qs[_0xa8e8('0x1e')](_0x4115a4[_0xa8e8('0x36')][_0xa8e8('0x1e')]);_0x297d0a[_0xa8e8('0x3e')]=qs[_0xa8e8('0x3e')](_0x4115a4[_0xa8e8('0x36')]['offset']);}_0x297d0a['order']=qs[_0xa8e8('0x57')](_0x4115a4[_0xa8e8('0x36')]['sort']);_0x297d0a['where']=qs[_0xa8e8('0x38')](_[_0xa8e8('0x41')](_0x4115a4[_0xa8e8('0x36')],_0x2480cb[_0xa8e8('0x38')]));_0x297d0a['where'][_0xa8e8('0x58')]=_0x14d66d['id'];if(_0x4115a4[_0xa8e8('0x36')][_0xa8e8('0x42')]){_0x297d0a[_0xa8e8('0x40')]=_[_0xa8e8('0x43')](_0x297d0a[_0xa8e8('0x40')],{'$or':_[_0xa8e8('0x2f')](_0x297d0a[_0xa8e8('0x3b')],function(_0x33691b){var _0x570c5a={};_0x570c5a[_0x33691b]={'$like':'%'+_0x4115a4[_0xa8e8('0x36')]['filter']+'%'};return _0x570c5a;})});}_0x297d0a=_[_0xa8e8('0x43')]({},_0x297d0a,_0x4115a4[_0xa8e8('0x4b')]);return db[_0xa8e8('0x56')][_0xa8e8('0x59')](_0x297d0a);}})[_0xa8e8('0x26')](function(_0x3855ec){if(_0x3855ec){return db['User'][_0xa8e8('0x5a')]({'where':{'id':_[_0xa8e8('0x2f')](_0x3855ec,'UserId'),'role':_0xa8e8('0x5b')},'attributes':['id','name',_0xa8e8('0x5c'),_0xa8e8('0x5d'),_0xa8e8('0x5e')]});}})[_0xa8e8('0x26')](function(_0x4f61a6){if(_0x4f61a6){return{'count':_0x4f61a6[_0xa8e8('0x1f')],'rows':_[_0xa8e8('0x2f')](_0x4f61a6[_0xa8e8('0x47')],function(_0x30c6ba){return{'membername':_0x30c6ba[_0xa8e8('0x2d')],'UserId':_0x30c6ba['id'],'queue_name':_0xe8be5f[_0xa8e8('0x2d')],'SmsQueueId':_0xe8be5f['id'],'interface':util[_0xa8e8('0x5f')](_0xa8e8('0x60'),_0xa8e8('0x61'),_0x30c6ba['name']),'penalty':0x0,'paused':_0x30c6ba[_0xa8e8('0x5c')],'createdAt':_0x30c6ba[_0xa8e8('0x5e')],'updatedAt':_0x30c6ba[_0xa8e8('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x295c18,_0x297d0a))[_0xa8e8('0x48')](handleError(_0x295c18,null));};exports[_0xa8e8('0x62')]=function(_0x406fbc,_0x3a6d0a,_0x38e4b7){var _0x4861b0={};var _0xe0d0bf={};var _0x2336ba;var _0x3f2b26;return db[_0xa8e8('0x30')]['findOne']({'where':{'id':_0x406fbc[_0xa8e8('0x49')]['id']}})[_0xa8e8('0x26')](handleEntityNotFound(_0x3a6d0a,null))[_0xa8e8('0x26')](function(_0x2c01dd){if(_0x2c01dd){_0x2336ba=_0x2c01dd;_0xe0d0bf[_0xa8e8('0x35')]=_['keys'](db[_0xa8e8('0x63')][_0xa8e8('0x31')]);_0xe0d0bf[_0xa8e8('0x36')]=_['keys'](_0x406fbc[_0xa8e8('0x36')]);_0xe0d0bf['filters']=_[_0xa8e8('0x39')](_0xe0d0bf[_0xa8e8('0x35')],_0xe0d0bf[_0xa8e8('0x36')]);_0x4861b0[_0xa8e8('0x3b')]=_['intersection'](_0xe0d0bf[_0xa8e8('0x35')],qs['fields'](_0x406fbc[_0xa8e8('0x36')][_0xa8e8('0x3a')]));_0x4861b0[_0xa8e8('0x3b')]=_0x4861b0['attributes'][_0xa8e8('0x4a')]?_0x4861b0[_0xa8e8('0x3b')]:_0xe0d0bf[_0xa8e8('0x35')];_0x4861b0[_0xa8e8('0x3f')]=qs[_0xa8e8('0x57')](_0x406fbc['query']['sort']);_0x4861b0[_0xa8e8('0x40')]=qs[_0xa8e8('0x38')](_['pick'](_0x406fbc[_0xa8e8('0x36')],_0xe0d0bf[_0xa8e8('0x38')]));if(_0x406fbc['query'][_0xa8e8('0x42')]){_0x4861b0[_0xa8e8('0x40')]=_[_0xa8e8('0x43')](_0x4861b0['where'],{'$or':_[_0xa8e8('0x2f')](_0x4861b0[_0xa8e8('0x3b')],function(_0x433a74){var _0x358d3f={};_0x358d3f[_0x433a74]={'$like':'%'+_0x406fbc[_0xa8e8('0x36')][_0xa8e8('0x42')]+'%'};return _0x358d3f;})});}_0x4861b0=_[_0xa8e8('0x43')]({},_0x4861b0,_0x406fbc[_0xa8e8('0x4b')]);return _0x2336ba[_0xa8e8('0x62')](_0x4861b0);}})[_0xa8e8('0x26')](function(_0x4ad93f){if(_0x4ad93f){_0x3f2b26=_0x4ad93f[_0xa8e8('0x4a')];if(!_0x406fbc[_0xa8e8('0x36')][_0xa8e8('0x3c')]('nolimit')){_0x4861b0['limit']=qs[_0xa8e8('0x1e')](_0x406fbc[_0xa8e8('0x36')][_0xa8e8('0x1e')]);_0x4861b0['offset']=qs[_0xa8e8('0x3e')](_0x406fbc['query'][_0xa8e8('0x3e')]);}return _0x2336ba[_0xa8e8('0x62')](_0x4861b0);}})[_0xa8e8('0x26')](function(_0x3e2978){if(_0x3e2978){return _0x3e2978?{'count':_0x3f2b26,'rows':_0x3e2978}:null;}})[_0xa8e8('0x26')](respondWithResult(_0x3a6d0a,null))['catch'](handleError(_0x3a6d0a,null));};exports['addTeams']=function(_0x4c7657,_0x2f34e9,_0x5a5505){var _0x3c5f8a=_0x4c7657[_0xa8e8('0x54')][_0xa8e8('0x64')];return db[_0xa8e8('0x63')][_0xa8e8('0x59')]({'where':{'id':_0x3c5f8a},'attributes':['id'],'include':[{'model':db[_0xa8e8('0x65')],'as':_0xa8e8('0x66'),'attributes':['id',_0xa8e8('0x2d'),_0xa8e8('0x67'),_0xa8e8('0x68'),_0xa8e8('0x69')],'raw':!![]}]})['then'](function(_0x254999){if(_0x254999){var _0x3e07dd=_[_0xa8e8('0x6a')](_0x254999,function(_0x29379c){var _0x5cefe9=_0x29379c[_0xa8e8('0x27')]({'plain':!![]});return _0x5cefe9[_0xa8e8('0x66')];});return db[_0xa8e8('0x30')]['find']({'where':{'id':_0x4c7657[_0xa8e8('0x49')]['id']}})[_0xa8e8('0x26')](function(_0x20e996){return db[_0xa8e8('0x6b')]['transaction'](function(_0x3a816e){return _0x20e996[_0xa8e8('0x6c')](_0x3c5f8a,{'transaction':_0x3a816e})[_0xa8e8('0x26')](function(){return BPromise['each'](_0x3e07dd,function(_0x5ca80b){return db['UserSmsQueue'][_0xa8e8('0x6d')]({'where':{'UserId':_0x5ca80b['id'],'SmsQueueId':_0x4c7657[_0xa8e8('0x49')]['id']},'transaction':_0x3a816e});});})[_0xa8e8('0x26')](function(){_0x3e07dd[_0xa8e8('0x6e')](function(_0x32a9d1){socket[_0xa8e8('0x6f')](_0xa8e8('0x70'),{'UserId':_0x32a9d1['id'],'SmsQueueId':_0x20e996['id']});});});});});}})[_0xa8e8('0x26')](respondWithStatusCode(_0x2f34e9,null))[_0xa8e8('0x48')](handleError(_0x2f34e9,null));};exports['removeTeams']=function(_0x4ea908,_0x277a7f,_0x4bd6a2){return db[_0xa8e8('0x63')][_0xa8e8('0x59')]({'where':{'id':_0x4ea908[_0xa8e8('0x36')][_0xa8e8('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa8e8('0x66'),'attributes':['id'],'raw':!![]}]})[_0xa8e8('0x26')](handleEntityNotFound(_0x277a7f,null))[_0xa8e8('0x26')](function(_0x3e151a){var _0x3e5c4e=_[_0xa8e8('0x2f')](_0x3e151a,'id');var _0x5d1679=[];var _0x334641=[];var _0x18e5c0=squel[_0xa8e8('0x71')]();_0x18e5c0[_0xa8e8('0x72')](_0xa8e8('0x73'))['from']('team_has_sms_queues','tq')[_0xa8e8('0x74')](_0xa8e8('0x75'),'ut',_0xa8e8('0x76'))[_0xa8e8('0x40')]('SmsQueueId\x20=\x20?',_0x4ea908[_0xa8e8('0x49')]['id']);for(var _0x15e949=0x0;_0x15e949<_0x3e151a[_0xa8e8('0x4a')];_0x15e949+=0x1){let _0x53d294=_0x3e151a[_0x15e949];for(var _0x40a017=0x0;_0x40a017<_0x53d294[_0xa8e8('0x66')][_0xa8e8('0x4a')];_0x40a017+=0x1){let _0xc45b1a=_0x53d294[_0xa8e8('0x66')][_0x40a017];var _0x5a874b=_0x18e5c0[_0xa8e8('0x77')]();_0x5a874b[_0xa8e8('0x40')](_0xa8e8('0x78'),_0xc45b1a['id']);_0x334641[_0xa8e8('0x79')](db['sequelize'][_0xa8e8('0x36')](_0x5a874b[_0xa8e8('0x7a')](),{'type':db[_0xa8e8('0x6b')][_0xa8e8('0x7b')]['SELECT']})[_0xa8e8('0x26')](function(_0xd9aee5){if(_0xd9aee5[_0xa8e8('0x4a')]===0x1){return _0xc45b1a['id'];}else{var _0x1e78ac=_[_0xa8e8('0x7c')](_['map'](_0xd9aee5,_0xa8e8('0x7d')),function(_0xe914cf){return _[_0xa8e8('0x7e')](_0x3e5c4e,_0xe914cf);});if(_0x1e78ac){return _0xc45b1a['id'];}}}));}}return BPromise[_0xa8e8('0x7f')](_0x334641)[_0xa8e8('0x26')](function(_0x554c44){_0x5d1679=_(_0x5d1679)[_0xa8e8('0x80')](_0x554c44)[_0xa8e8('0x81')]()[_0xa8e8('0x82')]();return db[_0xa8e8('0x30')][_0xa8e8('0x4c')]({'where':{'id':_0x4ea908['params']['id']}})[_0xa8e8('0x26')](function(_0x256eaf){return db[_0xa8e8('0x6b')][_0xa8e8('0x83')](function(_0x39b291){return _0x256eaf[_0xa8e8('0x84')](_0x4ea908[_0xa8e8('0x36')][_0xa8e8('0x64')],{'transaction':_0x39b291})['then'](function(){if(!_['isEmpty'](_0x5d1679)){return _0x256eaf[_0xa8e8('0x85')](_0x5d1679,{'transaction':_0x39b291});}})[_0xa8e8('0x26')](function(){_0x5d1679[_0xa8e8('0x6e')](function(_0x4568ee){socket[_0xa8e8('0x6f')]('userSmsQueue:remove',{'UserId':_0x4568ee,'SmsQueueId':_0x256eaf['id']});});});});});});})[_0xa8e8('0x26')](respondWithStatusCode(_0x277a7f,null))[_0xa8e8('0x48')](handleError(_0x277a7f,null));};exports[_0xa8e8('0x86')]=function(_0x446540,_0x3eae54,_0x2cb43f){return db['SmsQueue'][_0xa8e8('0x4c')]({'where':{'id':_0x446540[_0xa8e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x3eae54,null))[_0xa8e8('0x26')](function(_0x56dc01){if(_0x56dc01){return _0x56dc01[_0xa8e8('0x86')](_0x446540[_0xa8e8('0x54')]['ids'],_[_0xa8e8('0x87')](_0x446540[_0xa8e8('0x54')],['ids','id'])||{})[_0xa8e8('0x88')](function(_0x2aad6d){for(var _0x4998ba=0x0;_0x4998ba<_0x446540['body'][_0xa8e8('0x64')][_0xa8e8('0x4a')];_0x4998ba+=0x1){socket[_0xa8e8('0x6f')](_0xa8e8('0x70'),{'UserId':Number(_0x446540[_0xa8e8('0x54')]['ids'][_0x4998ba]),'SmsQueueId':Number(_0x446540['params']['id'])});}return _0x2aad6d;});}})['then'](respondWithResult(_0x3eae54,null))[_0xa8e8('0x48')](handleError(_0x3eae54,null));};exports[_0xa8e8('0x85')]=function(_0x352368,_0x80f218,_0x1f3558){return db[_0xa8e8('0x30')][_0xa8e8('0x4c')]({'where':{'id':_0x352368[_0xa8e8('0x49')]['id']}})[_0xa8e8('0x26')](handleEntityNotFound(_0x80f218,null))[_0xa8e8('0x26')](function(_0x55d6e9){if(_0x55d6e9){return _0x55d6e9[_0xa8e8('0x85')](_0x352368[_0xa8e8('0x36')][_0xa8e8('0x64')])[_0xa8e8('0x26')](function(){if(_[_0xa8e8('0x89')](_0x352368[_0xa8e8('0x36')][_0xa8e8('0x64')])){for(var _0x42d741=0x0;_0x42d741<_0x352368[_0xa8e8('0x36')][_0xa8e8('0x64')][_0xa8e8('0x4a')];_0x42d741+=0x1){socket['emit'](_0xa8e8('0x8a'),{'UserId':Number(_0x352368[_0xa8e8('0x36')][_0xa8e8('0x64')][_0x42d741]),'SmsQueueId':Number(_0x352368['params']['id'])});}}else{socket[_0xa8e8('0x6f')]('userSmsQueue:remove',{'UserId':Number(_0x352368[_0xa8e8('0x36')][_0xa8e8('0x64')]),'SmsQueueId':Number(_0x352368[_0xa8e8('0x49')]['id'])});}});}})[_0xa8e8('0x26')](respondWithStatusCode(_0x80f218,null))[_0xa8e8('0x48')](handleError(_0x80f218,null));};exports['getAgents']=function(_0x4b3608,_0xc44a7a,_0x2243c2){var _0x541a91={};var _0x10b086={};var _0x4e326f;var _0x26c3ad;return db['SmsQueue'][_0xa8e8('0x8b')]({'where':{'id':_0x4b3608[_0xa8e8('0x49')]['id']}})[_0xa8e8('0x26')](handleEntityNotFound(_0xc44a7a,null))['then'](function(_0x2eb1a6){if(_0x2eb1a6){_0x4e326f=_0x2eb1a6;_0x10b086[_0xa8e8('0x35')]=_[_0xa8e8('0x37')](db[_0xa8e8('0x65')]['rawAttributes']);_0x10b086['query']=_[_0xa8e8('0x37')](_0x4b3608[_0xa8e8('0x36')]);_0x10b086[_0xa8e8('0x38')]=_['intersection'](_0x10b086[_0xa8e8('0x35')],_0x10b086[_0xa8e8('0x36')]);_0x541a91[_0xa8e8('0x3b')]=_[_0xa8e8('0x39')](_0x10b086[_0xa8e8('0x35')],qs[_0xa8e8('0x3a')](_0x4b3608[_0xa8e8('0x36')][_0xa8e8('0x3a')]));_0x541a91['attributes']=_0x541a91[_0xa8e8('0x3b')][_0xa8e8('0x4a')]?_0x541a91[_0xa8e8('0x3b')]:_0x10b086[_0xa8e8('0x35')];_0x541a91[_0xa8e8('0x3f')]=qs[_0xa8e8('0x57')](_0x4b3608[_0xa8e8('0x36')][_0xa8e8('0x57')]);_0x541a91['where']=qs['filters'](_[_0xa8e8('0x41')](_0x4b3608[_0xa8e8('0x36')],_0x10b086[_0xa8e8('0x38')]));if(_0x4b3608['query'][_0xa8e8('0x42')]){_0x541a91[_0xa8e8('0x40')]=_[_0xa8e8('0x43')](_0x541a91[_0xa8e8('0x40')],{'$or':_[_0xa8e8('0x2f')](_0x541a91[_0xa8e8('0x3b')],function(_0x13a1c1){var _0x5f1d10={};_0x5f1d10[_0x13a1c1]={'$like':'%'+_0x4b3608[_0xa8e8('0x36')][_0xa8e8('0x42')]+'%'};return _0x5f1d10;})});}_0x541a91=_['merge']({},_0x541a91,_0x4b3608[_0xa8e8('0x4b')]);return _0x4e326f[_0xa8e8('0x8c')](_0x541a91);}})[_0xa8e8('0x26')](function(_0x4692bf){if(_0x4692bf){_0x26c3ad=_0x4692bf['length'];if(!_0x4b3608[_0xa8e8('0x36')][_0xa8e8('0x3c')](_0xa8e8('0x3d'))){_0x541a91['limit']=qs[_0xa8e8('0x1e')](_0x4b3608[_0xa8e8('0x36')][_0xa8e8('0x1e')]);_0x541a91['offset']=qs['offset'](_0x4b3608[_0xa8e8('0x36')]['offset']);}return _0x4e326f[_0xa8e8('0x8c')](_0x541a91);}})[_0xa8e8('0x26')](function(_0x56f88b){if(_0x56f88b){return _0x56f88b?{'count':_0x26c3ad,'rows':_0x56f88b}:null;}})[_0xa8e8('0x26')](respondWithResult(_0xc44a7a,null))[_0xa8e8('0x48')](handleError(_0xc44a7a,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e63bcc3..497d5d3 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 _0x8a0c=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x2d90b3,_0x445065){var _0x2a26d0=function(_0x271134){while(--_0x271134){_0x2d90b3['push'](_0x2d90b3['shift']());}};_0x2a26d0(++_0x445065);}(_0x8a0c,0x7f));var _0xc8a0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8a0c[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xc8a0('0x0'))['db'][_0xc8a0('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc8a0('0x2')](0x0);var events={'afterCreate':_0xc8a0('0x3'),'afterUpdate':_0xc8a0('0x4'),'afterDestroy':_0xc8a0('0x5')};function emitEvent(_0x4135af){return function(_0x330e2e,_0x53ee8a,_0x2edd62){SmsQueueEvents[_0xc8a0('0x6')](_0x4135af+':'+_0x330e2e['id'],_0x330e2e);SmsQueueEvents['emit'](_0x4135af,_0x330e2e);_0x2edd62(null);};}for(var e in events){if(events[_0xc8a0('0x7')](e)){var event=events[e];SmsQueue[_0xc8a0('0x8')](e,emitEvent(event));}}module[_0xc8a0('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x1f6a=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x317569,_0x51c49e){var _0x520e49=function(_0x2100a3){while(--_0x2100a3){_0x317569['push'](_0x317569['shift']());}};_0x520e49(++_0x51c49e);}(_0x1f6a,0x184));var _0xa1f6=function(_0xf0285,_0x197b1d){_0xf0285=_0xf0285-0x0;var _0x29ee4a=_0x1f6a[_0xf0285];return _0x29ee4a;};'use strict';var EventEmitter=require(_0xa1f6('0x0'));var SmsQueue=require(_0xa1f6('0x1'))['db'][_0xa1f6('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa1f6('0x3')](0x0);var events={'afterCreate':_0xa1f6('0x4'),'afterUpdate':_0xa1f6('0x5'),'afterDestroy':_0xa1f6('0x6')};function emitEvent(_0x134d4c){return function(_0x2949ef,_0x3aaa4f,_0x573035){SmsQueueEvents[_0xa1f6('0x7')](_0x134d4c+':'+_0x2949ef['id'],_0x2949ef);SmsQueueEvents[_0xa1f6('0x7')](_0x134d4c,_0x2949ef);_0x573035(null);};}for(var e in events){if(events[_0xa1f6('0x8')](e)){var event=events[e];SmsQueue[_0xa1f6('0x9')](e,emitEvent(event));}}module[_0xa1f6('0xa')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0aac881..4187785 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 _0x2a2e=['define','SmsQueue','sms_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0x5f44b7,_0x2ee997){var _0x51cd4f=function(_0x227879){while(--_0x227879){_0x5f44b7['push'](_0x5f44b7['shift']());}};_0x51cd4f(++_0x2ee997);}(_0x2a2e,0x19a));var _0xe2a2=function(_0x277c37,_0x4c92ba){_0x277c37=_0x277c37-0x0;var _0x1ac05d=_0x2a2e[_0x277c37];return _0x1ac05d;};'use strict';var _=require('lodash');var util=require(_0xe2a2('0x0'));var logger=require(_0xe2a2('0x1'))(_0xe2a2('0x2'));var moment=require('moment');var BPromise=require(_0xe2a2('0x3'));var rp=require(_0xe2a2('0x4'));var fs=require('fs');var path=require(_0xe2a2('0x5'));var rimraf=require(_0xe2a2('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0xe2a2('0x7')]=function(_0x3c87e2,_0x4ce0c2){return _0x3c87e2[_0xe2a2('0x8')](_0xe2a2('0x9'),attributes,{'tableName':_0xe2a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d52=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x2151e9,_0x2b87dd){var _0x1f68dd=function(_0x341004){while(--_0x341004){_0x2151e9['push'](_0x2151e9['shift']());}};_0x1f68dd(++_0x2b87dd);}(_0x3d52,0x121));var _0x23d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23d5('0x0'));var util=require(_0x23d5('0x1'));var logger=require(_0x23d5('0x2'))(_0x23d5('0x3'));var moment=require(_0x23d5('0x4'));var BPromise=require(_0x23d5('0x5'));var rp=require(_0x23d5('0x6'));var fs=require('fs');var path=require(_0x23d5('0x7'));var rimraf=require(_0x23d5('0x8'));var config=require(_0x23d5('0x9'));var attributes=require('./smsQueue.attributes');module[_0x23d5('0xa')]=function(_0x377cb5,_0x1e2791){return _0x377cb5[_0x23d5('0xb')](_0x23d5('0xc'),attributes,{'tableName':_0x23d5('0xd'),'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 8795398..4901ae4 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 _0x96a3=['GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowSmsQueue','find','info','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SmsQueue,\x20%s,\x20%s','result','catch'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x96a3,0x111));var _0x396a=function(_0x47bcc6,_0x1ba370){_0x47bcc6=_0x47bcc6-0x0;var _0x43e370=_0x96a3[_0x47bcc6];return _0x43e370;};'use strict';var _=require(_0x396a('0x0'));var util=require(_0x396a('0x1'));var moment=require(_0x396a('0x2'));var BPromise=require(_0x396a('0x3'));var rs=require(_0x396a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x396a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x396a('0x6'));var jayson=require(_0x396a('0x7'));var client=jayson[_0x396a('0x8')][_0x396a('0x9')]({'port':0x232a});config[_0x396a('0xa')]=_[_0x396a('0xb')](config[_0x396a('0xa')],{'host':_0x396a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x396a('0xa')]));require(_0x396a('0xd'))['register'](socket);function respondWithRpcPromise(_0x33dcc0,_0x49c55f,_0x26b95a){return new BPromise(function(_0xa80c33,_0x4a52a1){return client['request'](_0x33dcc0,_0x26b95a)[_0x396a('0xe')](function(_0x14e755){logger['info']('SmsQueue,\x20%s,\x20%s',_0x49c55f,'request\x20sent');logger[_0x396a('0xf')](_0x396a('0x10'),_0x49c55f,_0x396a('0x11'),JSON['stringify'](_0x14e755));if(_0x14e755[_0x396a('0x12')]){if(_0x14e755['error']['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0x49c55f,_0x14e755['error'][_0x396a('0x13')]);return _0x4a52a1(_0x14e755[_0x396a('0x12')][_0x396a('0x13')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x49c55f,_0x14e755[_0x396a('0x12')][_0x396a('0x13')]);return _0xa80c33(_0x14e755['error'][_0x396a('0x13')]);}else{logger['info'](_0x396a('0x14'),_0x49c55f,_0x396a('0x11'));_0xa80c33(_0x14e755[_0x396a('0x15')]['message']);}})[_0x396a('0x16')](function(_0x19a886){logger[_0x396a('0x12')]('SmsQueue,\x20%s,\x20%s',_0x49c55f,_0x19a886);_0x4a52a1(_0x19a886);});});}exports[_0x396a('0x17')]=function(_0x2694ec){var _0x7549f7=this;return new Promise(function(_0x47a4b9,_0x138b0e){return db[_0x396a('0x18')]['findAll']({'raw':_0x2694ec[_0x396a('0x19')]?_0x2694ec[_0x396a('0x19')][_0x396a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2694ec[_0x396a('0x19')]?_0x2694ec[_0x396a('0x19')][_0x396a('0x1b')]||null:null,'attributes':_0x2694ec[_0x396a('0x19')]?_0x2694ec[_0x396a('0x19')][_0x396a('0x1c')]||null:null,'limit':_0x2694ec[_0x396a('0x19')]?_0x2694ec[_0x396a('0x19')][_0x396a('0x1d')]||null:null,'include':_0x2694ec[_0x396a('0x19')]?_0x2694ec[_0x396a('0x19')][_0x396a('0x1e')]?_['map'](_0x2694ec[_0x396a('0x19')]['include'],function(_0x91a88d){return{'model':db[_0x91a88d['model']],'as':_0x91a88d['as'],'attributes':_0x91a88d[_0x396a('0x1c')],'include':_0x91a88d[_0x396a('0x1e')]?_['map'](_0x91a88d[_0x396a('0x1e')],function(_0x1b3c71){return{'model':db[_0x1b3c71['model']],'as':_0x1b3c71['as'],'attributes':_0x1b3c71['attributes'],'include':_0x1b3c71[_0x396a('0x1e')]?_[_0x396a('0x1f')](_0x1b3c71[_0x396a('0x1e')],function(_0x114cea){return{'model':db[_0x114cea[_0x396a('0x20')]],'as':_0x114cea['as'],'attributes':_0x114cea['attributes']};}):[]};}):[]};}):[]:[]})[_0x396a('0xe')](function(_0x3b8a9f){logger['info'](_0x396a('0x17'),_0x2694ec);logger['debug']('GetSmsQueue',_0x2694ec,JSON[_0x396a('0x21')](_0x3b8a9f));_0x47a4b9(_0x3b8a9f);})['catch'](function(_0x56e60b){logger['error'](_0x396a('0x17'),_0x56e60b[_0x396a('0x13')],_0x2694ec);_0x138b0e(_0x7549f7[_0x396a('0x12')](0x1f4,_0x56e60b['message']));});});};exports[_0x396a('0x22')]=function(_0x442646){var _0x1e36e5=this;return new Promise(function(_0xbe2922,_0x5269e0){return db[_0x396a('0x18')][_0x396a('0x23')]({'raw':_0x442646[_0x396a('0x19')]?_0x442646['options'][_0x396a('0x1a')]===undefined?!![]:![]:!![],'where':_0x442646[_0x396a('0x19')]?_0x442646['options'][_0x396a('0x1b')]||null:null,'attributes':_0x442646[_0x396a('0x19')]?_0x442646[_0x396a('0x19')][_0x396a('0x1c')]||null:null,'include':_0x442646[_0x396a('0x19')]?_0x442646[_0x396a('0x19')][_0x396a('0x1e')]?_[_0x396a('0x1f')](_0x442646[_0x396a('0x19')][_0x396a('0x1e')],function(_0xeee247){return{'model':db[_0xeee247['model']],'as':_0xeee247['as'],'attributes':_0xeee247['attributes'],'include':_0xeee247[_0x396a('0x1e')]?_[_0x396a('0x1f')](_0xeee247[_0x396a('0x1e')],function(_0x4bce6d){return{'model':db[_0x4bce6d[_0x396a('0x20')]],'as':_0x4bce6d['as'],'attributes':_0x4bce6d[_0x396a('0x1c')],'include':_0x4bce6d[_0x396a('0x1e')]?_[_0x396a('0x1f')](_0x4bce6d['include'],function(_0x5419e3){return{'model':db[_0x5419e3['model']],'as':_0x5419e3['as'],'attributes':_0x5419e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x396a('0xe')](function(_0x26aeb8){logger[_0x396a('0x24')](_0x396a('0x22'),_0x442646);logger[_0x396a('0xf')](_0x396a('0x22'),_0x442646,JSON['stringify'](_0x26aeb8));_0xbe2922(_0x26aeb8);})['catch'](function(_0x16ef1a){logger['error']('ShowSmsQueue',_0x16ef1a['message'],_0x442646);_0x5269e0(_0x1e36e5[_0x396a('0x12')](0x1f4,_0x16ef1a[_0x396a('0x13')]));});});}; \ No newline at end of file +var _0xa6c0=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetSmsQueue','findAll','options','raw','attributes','include','map','model','stringify','ShowSmsQueue','SmsQueue','find','moment','randomstring','ioredis'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0xa6c0,0xe1));var _0x0a6c=function(_0x120ed9,_0x38aff2){_0x120ed9=_0x120ed9-0x0;var _0x54eb26=_0xa6c0[_0x120ed9];return _0x54eb26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0a6c('0x0'));var BPromise=require('bluebird');var rs=require(_0x0a6c('0x1'));var fs=require('fs');var Redis=require(_0x0a6c('0x2'));var db=require(_0x0a6c('0x3'))['db'];var utils=require(_0x0a6c('0x4'));var logger=require(_0x0a6c('0x5'))('rpc');var config=require(_0x0a6c('0x6'));var jayson=require(_0x0a6c('0x7'));var client=jayson[_0x0a6c('0x8')][_0x0a6c('0x9')]({'port':0x232a});config[_0x0a6c('0xa')]=_[_0x0a6c('0xb')](config[_0x0a6c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a6c('0xc'))(new Redis(config[_0x0a6c('0xa')]));require(_0x0a6c('0xd'))[_0x0a6c('0xe')](socket);function respondWithRpcPromise(_0x1efc13,_0x1109d7,_0x22863e){return new BPromise(function(_0x44eb93,_0x237322){return client['request'](_0x1efc13,_0x22863e)[_0x0a6c('0xf')](function(_0x19437e){logger['info'](_0x0a6c('0x10'),_0x1109d7,_0x0a6c('0x11'));logger[_0x0a6c('0x12')](_0x0a6c('0x13'),_0x1109d7,_0x0a6c('0x11'),JSON['stringify'](_0x19437e));if(_0x19437e[_0x0a6c('0x14')]){if(_0x19437e[_0x0a6c('0x14')][_0x0a6c('0x15')]===0x1f4){logger[_0x0a6c('0x14')]('SmsQueue,\x20%s,\x20%s',_0x1109d7,_0x19437e[_0x0a6c('0x14')][_0x0a6c('0x16')]);return _0x237322(_0x19437e[_0x0a6c('0x14')][_0x0a6c('0x16')]);}logger['error'](_0x0a6c('0x10'),_0x1109d7,_0x19437e[_0x0a6c('0x14')][_0x0a6c('0x16')]);return _0x44eb93(_0x19437e['error'][_0x0a6c('0x16')]);}else{logger[_0x0a6c('0x17')](_0x0a6c('0x10'),_0x1109d7,_0x0a6c('0x11'));_0x44eb93(_0x19437e[_0x0a6c('0x18')][_0x0a6c('0x16')]);}})[_0x0a6c('0x19')](function(_0x49ceca){logger[_0x0a6c('0x14')](_0x0a6c('0x10'),_0x1109d7,_0x49ceca);_0x237322(_0x49ceca);});});}exports[_0x0a6c('0x1a')]=function(_0x474fa4){var _0x44ba89=this;return new Promise(function(_0x39b486,_0x373cc3){return db['SmsQueue'][_0x0a6c('0x1b')]({'raw':_0x474fa4[_0x0a6c('0x1c')]?_0x474fa4[_0x0a6c('0x1c')][_0x0a6c('0x1d')]===undefined?!![]:![]:!![],'where':_0x474fa4[_0x0a6c('0x1c')]?_0x474fa4['options']['where']||null:null,'attributes':_0x474fa4[_0x0a6c('0x1c')]?_0x474fa4[_0x0a6c('0x1c')][_0x0a6c('0x1e')]||null:null,'limit':_0x474fa4[_0x0a6c('0x1c')]?_0x474fa4[_0x0a6c('0x1c')]['limit']||null:null,'include':_0x474fa4[_0x0a6c('0x1c')]?_0x474fa4['options'][_0x0a6c('0x1f')]?_[_0x0a6c('0x20')](_0x474fa4[_0x0a6c('0x1c')][_0x0a6c('0x1f')],function(_0x5bbf80){return{'model':db[_0x5bbf80['model']],'as':_0x5bbf80['as'],'attributes':_0x5bbf80['attributes'],'include':_0x5bbf80[_0x0a6c('0x1f')]?_['map'](_0x5bbf80[_0x0a6c('0x1f')],function(_0x1f46a1){return{'model':db[_0x1f46a1[_0x0a6c('0x21')]],'as':_0x1f46a1['as'],'attributes':_0x1f46a1[_0x0a6c('0x1e')],'include':_0x1f46a1[_0x0a6c('0x1f')]?_[_0x0a6c('0x20')](_0x1f46a1[_0x0a6c('0x1f')],function(_0x33f30d){return{'model':db[_0x33f30d['model']],'as':_0x33f30d['as'],'attributes':_0x33f30d[_0x0a6c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a6c('0xf')](function(_0x15a1d1){logger[_0x0a6c('0x17')](_0x0a6c('0x1a'),_0x474fa4);logger[_0x0a6c('0x12')](_0x0a6c('0x1a'),_0x474fa4,JSON[_0x0a6c('0x22')](_0x15a1d1));_0x39b486(_0x15a1d1);})[_0x0a6c('0x19')](function(_0x3bba59){logger['error'](_0x0a6c('0x1a'),_0x3bba59['message'],_0x474fa4);_0x373cc3(_0x44ba89[_0x0a6c('0x14')](0x1f4,_0x3bba59['message']));});});};exports[_0x0a6c('0x23')]=function(_0x5e0216){var _0x32e624=this;return new Promise(function(_0x148901,_0x8d793c){return db[_0x0a6c('0x24')][_0x0a6c('0x25')]({'raw':_0x5e0216[_0x0a6c('0x1c')]?_0x5e0216[_0x0a6c('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5e0216['options']?_0x5e0216['options']['where']||null:null,'attributes':_0x5e0216[_0x0a6c('0x1c')]?_0x5e0216[_0x0a6c('0x1c')][_0x0a6c('0x1e')]||null:null,'include':_0x5e0216[_0x0a6c('0x1c')]?_0x5e0216['options']['include']?_[_0x0a6c('0x20')](_0x5e0216[_0x0a6c('0x1c')][_0x0a6c('0x1f')],function(_0xd51dfc){return{'model':db[_0xd51dfc[_0x0a6c('0x21')]],'as':_0xd51dfc['as'],'attributes':_0xd51dfc[_0x0a6c('0x1e')],'include':_0xd51dfc[_0x0a6c('0x1f')]?_[_0x0a6c('0x20')](_0xd51dfc[_0x0a6c('0x1f')],function(_0x3f057b){return{'model':db[_0x3f057b['model']],'as':_0x3f057b['as'],'attributes':_0x3f057b[_0x0a6c('0x1e')],'include':_0x3f057b[_0x0a6c('0x1f')]?_[_0x0a6c('0x20')](_0x3f057b[_0x0a6c('0x1f')],function(_0x3a84d8){return{'model':db[_0x3a84d8[_0x0a6c('0x21')]],'as':_0x3a84d8['as'],'attributes':_0x3a84d8[_0x0a6c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a6c('0xf')](function(_0x22ff66){logger[_0x0a6c('0x17')]('ShowSmsQueue',_0x5e0216);logger[_0x0a6c('0x12')](_0x0a6c('0x23'),_0x5e0216,JSON[_0x0a6c('0x22')](_0x22ff66));_0x148901(_0x22ff66);})['catch'](function(_0x1efc0e){logger[_0x0a6c('0x14')]('ShowSmsQueue',_0x1efc0e[_0x0a6c('0x16')],_0x5e0216);_0x8d793c(_0x32e624[_0x0a6c('0x14')](0x1f4,_0x1efc0e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 74a2572..3b34619 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 _0x3ce9=['smsQueue:','./smsQueue.events','emit','removeListener','register'];(function(_0x464791,_0x42fe0f){var _0x341360=function(_0x18a082){while(--_0x18a082){_0x464791['push'](_0x464791['shift']());}};_0x341360(++_0x42fe0f);}(_0x3ce9,0xb0));var _0x93ce=function(_0x1224d7,_0x20b876){_0x1224d7=_0x1224d7-0x0;var _0x3441c3=_0x3ce9[_0x1224d7];return _0x3441c3;};'use strict';var SmsQueueEvents=require(_0x93ce('0x0'));var events=['save','remove','update'];function createListener(_0x16a3a7,_0x3d9a4e){return function(_0x1764e1){_0x3d9a4e[_0x93ce('0x1')](_0x16a3a7,_0x1764e1);};}function removeListener(_0x103ee5,_0x3b1fc8){return function(){SmsQueueEvents[_0x93ce('0x2')](_0x103ee5,_0x3b1fc8);};}exports[_0x93ce('0x3')]=function(_0x367661){for(var _0x5a280c=0x0,_0x3274df=events['length'];_0x5a280c<_0x3274df;_0x5a280c++){var _0x328da6=events[_0x5a280c];var _0x8626f0=createListener(_0x93ce('0x4')+_0x328da6,_0x367661);SmsQueueEvents['on'](_0x328da6,_0x8626f0);}}; \ No newline at end of file +var _0xe735=['removeListener','register','smsQueue:','./smsQueue.events','save','update','emit'];(function(_0x4ac64b,_0x4e7a20){var _0x3796e7=function(_0x5d0e54){while(--_0x5d0e54){_0x4ac64b['push'](_0x4ac64b['shift']());}};_0x3796e7(++_0x4e7a20);}(_0xe735,0x1d1));var _0x5e73=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0xe735[_0x52684f];return _0x4a55f0;};'use strict';var SmsQueueEvents=require(_0x5e73('0x0'));var events=[_0x5e73('0x1'),'remove',_0x5e73('0x2')];function createListener(_0x311684,_0x503863){return function(_0xb03d61){_0x503863[_0x5e73('0x3')](_0x311684,_0xb03d61);};}function removeListener(_0x1dfb22,_0x5be52b){return function(){SmsQueueEvents[_0x5e73('0x4')](_0x1dfb22,_0x5be52b);};}exports[_0x5e73('0x5')]=function(_0x19e58e){for(var _0xf95cb8=0x0,_0x487d1e=events['length'];_0xf95cb8<_0x487d1e;_0xf95cb8++){var _0x1e5a0f=events[_0xf95cb8];var _0x47b94d=createListener(_0x5e73('0x6')+_0x1e5a0f,_0x19e58e);SmsQueueEvents['on'](_0x1e5a0f,_0x47b94d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 118b35b..f0c9bfa 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 _0x81d4=['post','create','put','update','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x81d4,0x197));var _0x481d=function(_0x1460bc,_0x509d3b){_0x1460bc=_0x1460bc-0x0;var _0x1bb22c=_0x81d4[_0x1460bc];return _0x1bb22c;};'use strict';var multer=require('multer');var util=require(_0x481d('0x0'));var path=require(_0x481d('0x1'));var timeout=require('connect-timeout');var express=require(_0x481d('0x2'));var router=express[_0x481d('0x3')]();var fs_extra=require(_0x481d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x481d('0x5'));var controller=require(_0x481d('0x6'));router[_0x481d('0x7')]('/',auth['isAuthenticated'](),controller[_0x481d('0x8')]);router[_0x481d('0x7')](_0x481d('0x9'),auth[_0x481d('0xa')](),controller[_0x481d('0xb')]);router[_0x481d('0x7')]('/:id',auth[_0x481d('0xa')](),controller[_0x481d('0xc')]);router[_0x481d('0xd')]('/',auth['isAuthenticated'](),controller[_0x481d('0xe')]);router[_0x481d('0xf')]('/:id',auth[_0x481d('0xa')](),controller[_0x481d('0x10')]);router[_0x481d('0x11')](_0x481d('0x12'),auth[_0x481d('0xa')](),controller[_0x481d('0x13')]);module[_0x481d('0x14')]=router; \ No newline at end of file +var _0x1823=['index','get','/describe','describe','/:id','show','post','create','put','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated'];(function(_0x52b57f,_0xd150a6){var _0x3f296c=function(_0x53a5b0){while(--_0x53a5b0){_0x52b57f['push'](_0x52b57f['shift']());}};_0x3f296c(++_0xd150a6);}(_0x1823,0xe6));var _0x3182=function(_0x4dd321,_0x2171a5){_0x4dd321=_0x4dd321-0x0;var _0x38f1c4=_0x1823[_0x4dd321];return _0x38f1c4;};'use strict';var multer=require(_0x3182('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3182('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3182('0x2'));var auth=require(_0x3182('0x3'));var interaction=require(_0x3182('0x4'));var config=require(_0x3182('0x5'));var controller=require(_0x3182('0x6'));router['get']('/',auth[_0x3182('0x7')](),controller[_0x3182('0x8')]);router[_0x3182('0x9')](_0x3182('0xa'),auth['isAuthenticated'](),controller[_0x3182('0xb')]);router[_0x3182('0x9')](_0x3182('0xc'),auth[_0x3182('0x7')](),controller[_0x3182('0xd')]);router[_0x3182('0xe')]('/',auth['isAuthenticated'](),controller[_0x3182('0xf')]);router[_0x3182('0x10')](_0x3182('0xc'),auth[_0x3182('0x7')](),controller['update']);router['delete'](_0x3182('0xc'),auth[_0x3182('0x7')](),controller['destroy']);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 15f6c9a..7e22f1d 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 _0x3f9c=['exports','STRING','DATE','moment'];(function(_0x263552,_0x558ea4){var _0xf80fc=function(_0x4460ea){while(--_0x4460ea){_0x263552['push'](_0x263552['shift']());}};_0xf80fc(++_0x558ea4);}(_0x3f9c,0x1bb));var _0xc3f9=function(_0x2c47f1,_0x7cdc96){_0x2c47f1=_0x2c47f1-0x0;var _0x315384=_0x3f9c[_0x2c47f1];return _0x315384;};'use strict';var moment=require(_0xc3f9('0x0'));var Sequelize=require('sequelize');module[_0xc3f9('0x1')]={'uniqueid':{'type':Sequelize[_0xc3f9('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc3f9('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc3f9('0x3')]},'reason':{'type':Sequelize[_0xc3f9('0x2')]}}; \ No newline at end of file +var _0x07bf=['exports','STRING','DATE','moment','sequelize'];(function(_0x2ab2cd,_0x30e4ca){var _0x436bb7=function(_0x5836a8){while(--_0x5836a8){_0x2ab2cd['push'](_0x2ab2cd['shift']());}};_0x436bb7(++_0x30e4ca);}(_0x07bf,0x1ed));var _0xf07b=function(_0x57418a,_0xbaf53){_0x57418a=_0x57418a-0x0;var _0xbbd288=_0x07bf[_0x57418a];return _0xbbd288;};'use strict';var moment=require(_0xf07b('0x0'));var Sequelize=require(_0xf07b('0x1'));module[_0xf07b('0x2')]={'uniqueid':{'type':Sequelize[_0xf07b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf07b('0x3')]},'joinAt':{'type':Sequelize[_0xf07b('0x4')]},'leaveAt':{'type':Sequelize[_0xf07b('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf07b('0x4')]},'reason':{'type':Sequelize[_0xf07b('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index c356cc3..260536e 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 _0xfd5e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','index','SmsQueueReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','VIRTUAL','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x28eb4d,_0x4d1b11){var _0xfc6784=function(_0x1ae896){while(--_0x1ae896){_0x28eb4d['push'](_0x28eb4d['shift']());}};_0xfc6784(++_0x4d1b11);}(_0xfd5e,0x1a6));var _0xefd5=function(_0x57a9dc,_0xb5f9e1){_0x57a9dc=_0x57a9dc-0x0;var _0x40faf4=_0xfd5e[_0x57a9dc];return _0x40faf4;};'use strict';var emlformat=require(_0xefd5('0x0'));var rimraf=require(_0xefd5('0x1'));var zipdir=require(_0xefd5('0x2'));var jsonpatch=require(_0xefd5('0x3'));var rp=require(_0xefd5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xefd5('0x5'));var util=require(_0xefd5('0x6'));var path=require(_0xefd5('0x7'));var sox=require(_0xefd5('0x8'));var csv=require(_0xefd5('0x9'));var ejs=require(_0xefd5('0xa'));var fs=require('fs');var fs_extra=require(_0xefd5('0xb'));var _=require(_0xefd5('0xc'));var squel=require(_0xefd5('0xd'));var crypto=require(_0xefd5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xefd5('0x9'));var querystring=require(_0xefd5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xefd5('0x10'));var qs=require(_0xefd5('0x11'));var as=require(_0xefd5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefd5('0x13'))(_0xefd5('0x14'));var utils=require(_0xefd5('0x15'));var config=require(_0xefd5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xefd5('0x17'))['db'];function respondWithStatusCode(_0x3dafa6,_0x2df70e){_0x2df70e=_0x2df70e||0xcc;return function(_0x21122f){if(_0x21122f){return _0x3dafa6[_0xefd5('0x18')](_0x2df70e);}return _0x3dafa6[_0xefd5('0x19')](_0x2df70e)[_0xefd5('0x1a')]();};}function respondWithResult(_0x3246b6,_0x31e67f){_0x31e67f=_0x31e67f||0xc8;return function(_0x2857cf){if(_0x2857cf){return _0x3246b6[_0xefd5('0x19')](_0x31e67f)[_0xefd5('0x1b')](_0x2857cf);}};}function respondWithFilteredResult(_0x4a4128,_0x54cc55){return function(_0x577506){if(_0x577506){var _0x57e631=typeof _0x54cc55[_0xefd5('0x1c')]==='undefined'&&typeof _0x54cc55[_0xefd5('0x1d')]==='undefined';var _0x2ed759=_0x577506[_0xefd5('0x1e')];var _0x5e0f34=_0x57e631?0x0:_0x54cc55['offset'];var _0x33d9a5=_0x57e631?_0x577506['count']:_0x54cc55['offset']+_0x54cc55['limit'];var _0x83a3cf;if(_0x33d9a5>=_0x2ed759){_0x33d9a5=_0x2ed759;_0x83a3cf=0xc8;}else{_0x83a3cf=0xce;}_0x4a4128[_0xefd5('0x19')](_0x83a3cf);return _0x4a4128[_0xefd5('0x1f')](_0xefd5('0x20'),_0x5e0f34+'-'+_0x33d9a5+'/'+_0x2ed759)[_0xefd5('0x1b')](_0x577506);}return null;};}function patchUpdates(_0x5e3ebd){return function(_0x23a14e){try{jsonpatch['apply'](_0x23a14e,_0x5e3ebd,!![]);}catch(_0x220485){return BPromise[_0xefd5('0x21')](_0x220485);}return _0x23a14e[_0xefd5('0x22')]();};}function saveUpdates(_0x153dcc,_0x13e578){return function(_0x134410){if(_0x134410){return _0x134410[_0xefd5('0x23')](_0x153dcc)[_0xefd5('0x24')](function(_0x3f8a91){return _0x3f8a91;});}return null;};}function removeEntity(_0x143889,_0x199415){return function(_0x5f08de){if(_0x5f08de){return _0x5f08de[_0xefd5('0x25')]()[_0xefd5('0x24')](function(){_0x143889[_0xefd5('0x19')](0xcc)[_0xefd5('0x1a')]();});}};}function handleEntityNotFound(_0xcf84c8,_0x29816f){return function(_0x529aa9){if(!_0x529aa9){_0xcf84c8[_0xefd5('0x18')](0x194);}return _0x529aa9;};}function handleError(_0x2eee03,_0x2497f8){_0x2497f8=_0x2497f8||0x1f4;return function(_0x91b08e){logger[_0xefd5('0x26')](_0x91b08e['stack']);if(_0x91b08e[_0xefd5('0x27')]){delete _0x91b08e[_0xefd5('0x27')];}_0x2eee03[_0xefd5('0x19')](_0x2497f8)['send'](_0x91b08e);};}exports[_0xefd5('0x28')]=function(_0x10f959,_0x58e05f){var _0x40cf7d={},_0x31641b={},_0x676731={'count':0x0,'rows':[]};var _0xe64adb=_['map'](db[_0xefd5('0x29')][_0xefd5('0x2a')],function(_0x4cd9a7){return{'name':_0x4cd9a7[_0xefd5('0x2b')],'type':_0x4cd9a7['type']['key']};});_0x31641b[_0xefd5('0x2c')]=_['map'](_0xe64adb,_0xefd5('0x27'));_0x31641b[_0xefd5('0x2d')]=_[_0xefd5('0x2e')](_0x10f959[_0xefd5('0x2d')]);_0x31641b[_0xefd5('0x2f')]=_[_0xefd5('0x30')](_0x31641b[_0xefd5('0x2c')],_0x31641b[_0xefd5('0x2d')]);_0x40cf7d[_0xefd5('0x31')]=_[_0xefd5('0x30')](_0x31641b[_0xefd5('0x2c')],qs[_0xefd5('0x32')](_0x10f959[_0xefd5('0x2d')][_0xefd5('0x32')]));_0x40cf7d[_0xefd5('0x31')]=_0x40cf7d['attributes'][_0xefd5('0x33')]?_0x40cf7d[_0xefd5('0x31')]:_0x31641b[_0xefd5('0x2c')];if(!_0x10f959[_0xefd5('0x2d')][_0xefd5('0x34')](_0xefd5('0x35'))){_0x40cf7d['limit']=qs[_0xefd5('0x1d')](_0x10f959[_0xefd5('0x2d')][_0xefd5('0x1d')]);_0x40cf7d[_0xefd5('0x1c')]=qs[_0xefd5('0x1c')](_0x10f959['query']['offset']);}_0x40cf7d[_0xefd5('0x36')]=qs['sort'](_0x10f959[_0xefd5('0x2d')][_0xefd5('0x37')]);_0x40cf7d[_0xefd5('0x38')]=qs['filters'](_[_0xefd5('0x39')](_0x10f959[_0xefd5('0x2d')],_0x31641b['filters']),_0xe64adb);if(_0x10f959['query']['filter']){_0x40cf7d['where']=_['merge'](_0x40cf7d[_0xefd5('0x38')],{'$or':_[_0xefd5('0x3a')](_0xe64adb,function(_0x16651e){if(_0x16651e[_0xefd5('0x3b')]!==_0xefd5('0x3c')){var _0x5aab01={};_0x5aab01[_0x16651e[_0xefd5('0x27')]]={'$like':'%'+_0x10f959[_0xefd5('0x2d')]['filter']+'%'};return _0x5aab01;}})});}_0x40cf7d=_[_0xefd5('0x3d')]({},_0x40cf7d,_0x10f959[_0xefd5('0x3e')]);var _0x5ca351={'where':_0x40cf7d[_0xefd5('0x38')]};return db[_0xefd5('0x29')]['count'](_0x5ca351)['then'](function(_0x16c7e3){_0x676731[_0xefd5('0x1e')]=_0x16c7e3;if(_0x10f959[_0xefd5('0x2d')][_0xefd5('0x3f')]){_0x40cf7d[_0xefd5('0x40')]=[{'all':!![]}];}return db[_0xefd5('0x29')]['findAll'](_0x40cf7d);})['then'](function(_0x3fbc15){_0x676731[_0xefd5('0x41')]=_0x3fbc15;return _0x676731;})[_0xefd5('0x24')](respondWithFilteredResult(_0x58e05f,_0x40cf7d))['catch'](handleError(_0x58e05f,null));};exports[_0xefd5('0x42')]=function(_0x40b1dd,_0x512960){var _0x5a3ba0={'raw':!![],'where':{'id':_0x40b1dd[_0xefd5('0x43')]['id']}},_0x41ae70={};_0x41ae70[_0xefd5('0x2c')]=_[_0xefd5('0x2e')](db[_0xefd5('0x29')][_0xefd5('0x2a')]);_0x41ae70['query']=_[_0xefd5('0x2e')](_0x40b1dd['query']);_0x41ae70[_0xefd5('0x2f')]=_[_0xefd5('0x30')](_0x41ae70[_0xefd5('0x2c')],_0x41ae70[_0xefd5('0x2d')]);_0x5a3ba0[_0xefd5('0x31')]=_[_0xefd5('0x30')](_0x41ae70['model'],qs['fields'](_0x40b1dd[_0xefd5('0x2d')][_0xefd5('0x32')]));_0x5a3ba0[_0xefd5('0x31')]=_0x5a3ba0['attributes'][_0xefd5('0x33')]?_0x5a3ba0[_0xefd5('0x31')]:_0x41ae70['model'];if(_0x40b1dd[_0xefd5('0x2d')][_0xefd5('0x3f')]){_0x5a3ba0[_0xefd5('0x40')]=[{'all':!![]}];}_0x5a3ba0=_['merge']({},_0x5a3ba0,_0x40b1dd[_0xefd5('0x3e')]);return db[_0xefd5('0x29')][_0xefd5('0x44')](_0x5a3ba0)['then'](handleEntityNotFound(_0x512960,null))[_0xefd5('0x24')](respondWithResult(_0x512960,null))[_0xefd5('0x45')](handleError(_0x512960,null));};exports[_0xefd5('0x46')]=function(_0x30cff8,_0x3fb0a0){return db['SmsQueueReport']['create'](_0x30cff8[_0xefd5('0x47')],{})[_0xefd5('0x24')](respondWithResult(_0x3fb0a0,0xc9))['catch'](handleError(_0x3fb0a0,null));};exports[_0xefd5('0x23')]=function(_0x13e74b,_0x421416){if(_0x13e74b[_0xefd5('0x47')]['id']){delete _0x13e74b[_0xefd5('0x47')]['id'];}return db['SmsQueueReport'][_0xefd5('0x44')]({'where':{'id':_0x13e74b[_0xefd5('0x43')]['id']}})['then'](handleEntityNotFound(_0x421416,null))[_0xefd5('0x24')](saveUpdates(_0x13e74b[_0xefd5('0x47')],null))[_0xefd5('0x24')](respondWithResult(_0x421416,null))[_0xefd5('0x45')](handleError(_0x421416,null));};exports[_0xefd5('0x25')]=function(_0x5b2d50,_0x99563e){return db[_0xefd5('0x29')][_0xefd5('0x44')]({'where':{'id':_0x5b2d50[_0xefd5('0x43')]['id']}})[_0xefd5('0x24')](handleEntityNotFound(_0x99563e,null))[_0xefd5('0x24')](removeEntity(_0x99563e,null))[_0xefd5('0x45')](handleError(_0x99563e,null));};exports[_0xefd5('0x48')]=function(_0x2e5b09,_0x303eed){return db[_0xefd5('0x29')][_0xefd5('0x48')]()[_0xefd5('0x24')](respondWithResult(_0x303eed,null))['catch'](handleError(_0x303eed,null));}; \ No newline at end of file +var _0x583a=['find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','SmsQueueReport'];(function(_0x58b54c,_0x3263d8){var _0x55410b=function(_0x101c4c){while(--_0x101c4c){_0x58b54c['push'](_0x58b54c['shift']());}};_0x55410b(++_0x3263d8);}(_0x583a,0xef));var _0xa583=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x583a[_0x3dc68d];return _0xdf7f94;};'use strict';var emlformat=require(_0xa583('0x0'));var rimraf=require(_0xa583('0x1'));var zipdir=require(_0xa583('0x2'));var jsonpatch=require(_0xa583('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa583('0x4'));var util=require(_0xa583('0x5'));var path=require(_0xa583('0x6'));var sox=require(_0xa583('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa583('0x8'));var _=require(_0xa583('0x9'));var squel=require(_0xa583('0xa'));var crypto=require('crypto');var jsforce=require(_0xa583('0xb'));var deskjs=require(_0xa583('0xc'));var toCsv=require(_0xa583('0xd'));var querystring=require(_0xa583('0xe'));var Papa=require(_0xa583('0xf'));var Redis=require(_0xa583('0x10'));var authService=require(_0xa583('0x11'));var qs=require(_0xa583('0x12'));var as=require(_0xa583('0x13'));var hardwareService=require(_0xa583('0x14'));var logger=require(_0xa583('0x15'))('api');var utils=require(_0xa583('0x16'));var config=require(_0xa583('0x17'));var licenseUtil=require(_0xa583('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb1ec1d,_0x3f49be){_0x3f49be=_0x3f49be||0xcc;return function(_0x3c7ed1){if(_0x3c7ed1){return _0xb1ec1d[_0xa583('0x19')](_0x3f49be);}return _0xb1ec1d['status'](_0x3f49be)[_0xa583('0x1a')]();};}function respondWithResult(_0x1bd13f,_0x207205){_0x207205=_0x207205||0xc8;return function(_0x228556){if(_0x228556){return _0x1bd13f[_0xa583('0x1b')](_0x207205)['json'](_0x228556);}};}function respondWithFilteredResult(_0x427024,_0x3fb8c4){return function(_0x3dbb3f){if(_0x3dbb3f){var _0x3ac3b1=typeof _0x3fb8c4[_0xa583('0x1c')]===_0xa583('0x1d')&&typeof _0x3fb8c4[_0xa583('0x1e')]===_0xa583('0x1d');var _0x18ce24=_0x3dbb3f[_0xa583('0x1f')];var _0x15d5f3=_0x3ac3b1?0x0:_0x3fb8c4[_0xa583('0x1c')];var _0x488604=_0x3ac3b1?_0x3dbb3f['count']:_0x3fb8c4[_0xa583('0x1c')]+_0x3fb8c4[_0xa583('0x1e')];var _0x25d76b;if(_0x488604>=_0x18ce24){_0x488604=_0x18ce24;_0x25d76b=0xc8;}else{_0x25d76b=0xce;}_0x427024[_0xa583('0x1b')](_0x25d76b);return _0x427024[_0xa583('0x20')](_0xa583('0x21'),_0x15d5f3+'-'+_0x488604+'/'+_0x18ce24)[_0xa583('0x22')](_0x3dbb3f);}return null;};}function patchUpdates(_0x1678f9){return function(_0x7b7d90){try{jsonpatch[_0xa583('0x23')](_0x7b7d90,_0x1678f9,!![]);}catch(_0xb3832){return BPromise[_0xa583('0x24')](_0xb3832);}return _0x7b7d90['save']();};}function saveUpdates(_0x319ad5,_0x20d29d){return function(_0x95e85a){if(_0x95e85a){return _0x95e85a['update'](_0x319ad5)[_0xa583('0x25')](function(_0x44b8b5){return _0x44b8b5;});}return null;};}function removeEntity(_0x335f2b,_0x224a27){return function(_0x566a7e){if(_0x566a7e){return _0x566a7e[_0xa583('0x26')]()[_0xa583('0x25')](function(){_0x335f2b['status'](0xcc)[_0xa583('0x1a')]();});}};}function handleEntityNotFound(_0x224be7,_0xc3a91c){return function(_0x4035c6){if(!_0x4035c6){_0x224be7[_0xa583('0x19')](0x194);}return _0x4035c6;};}function handleError(_0x2f9227,_0x42c207){_0x42c207=_0x42c207||0x1f4;return function(_0x43f2c0){logger[_0xa583('0x27')](_0x43f2c0[_0xa583('0x28')]);if(_0x43f2c0[_0xa583('0x29')]){delete _0x43f2c0['name'];}_0x2f9227[_0xa583('0x1b')](_0x42c207)[_0xa583('0x2a')](_0x43f2c0);};}exports[_0xa583('0x2b')]=function(_0xf7329,_0x29f69b){var _0x251afc={},_0x158863={},_0x544720={'count':0x0,'rows':[]};var _0x4238ba=_['map'](db['SmsQueueReport'][_0xa583('0x2c')],function(_0x90aa42){return{'name':_0x90aa42[_0xa583('0x2d')],'type':_0x90aa42['type'][_0xa583('0x2e')]};});_0x158863[_0xa583('0x2f')]=_[_0xa583('0x30')](_0x4238ba,_0xa583('0x29'));_0x158863[_0xa583('0x31')]=_[_0xa583('0x32')](_0xf7329[_0xa583('0x31')]);_0x158863['filters']=_[_0xa583('0x33')](_0x158863['model'],_0x158863['query']);_0x251afc[_0xa583('0x34')]=_['intersection'](_0x158863[_0xa583('0x2f')],qs[_0xa583('0x35')](_0xf7329[_0xa583('0x31')][_0xa583('0x35')]));_0x251afc[_0xa583('0x34')]=_0x251afc['attributes'][_0xa583('0x36')]?_0x251afc[_0xa583('0x34')]:_0x158863['model'];if(!_0xf7329[_0xa583('0x31')][_0xa583('0x37')]('nolimit')){_0x251afc[_0xa583('0x1e')]=qs[_0xa583('0x1e')](_0xf7329[_0xa583('0x31')][_0xa583('0x1e')]);_0x251afc[_0xa583('0x1c')]=qs[_0xa583('0x1c')](_0xf7329[_0xa583('0x31')]['offset']);}_0x251afc[_0xa583('0x38')]=qs[_0xa583('0x39')](_0xf7329[_0xa583('0x31')][_0xa583('0x39')]);_0x251afc[_0xa583('0x3a')]=qs[_0xa583('0x3b')](_['pick'](_0xf7329[_0xa583('0x31')],_0x158863[_0xa583('0x3b')]),_0x4238ba);if(_0xf7329[_0xa583('0x31')][_0xa583('0x3c')]){_0x251afc[_0xa583('0x3a')]=_[_0xa583('0x3d')](_0x251afc['where'],{'$or':_[_0xa583('0x30')](_0x4238ba,function(_0x51d491){if(_0x51d491[_0xa583('0x3e')]!==_0xa583('0x3f')){var _0x3eba7a={};_0x3eba7a[_0x51d491[_0xa583('0x29')]]={'$like':'%'+_0xf7329['query']['filter']+'%'};return _0x3eba7a;}})});}_0x251afc=_[_0xa583('0x3d')]({},_0x251afc,_0xf7329[_0xa583('0x40')]);var _0x3797e4={'where':_0x251afc['where']};return db['SmsQueueReport']['count'](_0x3797e4)[_0xa583('0x25')](function(_0x272cc8){_0x544720[_0xa583('0x1f')]=_0x272cc8;if(_0xf7329[_0xa583('0x31')][_0xa583('0x41')]){_0x251afc[_0xa583('0x42')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xa583('0x43')](_0x251afc);})[_0xa583('0x25')](function(_0x1cae0f){_0x544720[_0xa583('0x44')]=_0x1cae0f;return _0x544720;})['then'](respondWithFilteredResult(_0x29f69b,_0x251afc))[_0xa583('0x45')](handleError(_0x29f69b,null));};exports[_0xa583('0x46')]=function(_0x8a4175,_0x4113d3){var _0x194b03={'raw':!![],'where':{'id':_0x8a4175[_0xa583('0x47')]['id']}},_0x375f3b={};_0x375f3b[_0xa583('0x2f')]=_[_0xa583('0x32')](db[_0xa583('0x48')][_0xa583('0x2c')]);_0x375f3b[_0xa583('0x31')]=_[_0xa583('0x32')](_0x8a4175[_0xa583('0x31')]);_0x375f3b['filters']=_[_0xa583('0x33')](_0x375f3b[_0xa583('0x2f')],_0x375f3b[_0xa583('0x31')]);_0x194b03['attributes']=_[_0xa583('0x33')](_0x375f3b[_0xa583('0x2f')],qs['fields'](_0x8a4175[_0xa583('0x31')][_0xa583('0x35')]));_0x194b03['attributes']=_0x194b03[_0xa583('0x34')][_0xa583('0x36')]?_0x194b03[_0xa583('0x34')]:_0x375f3b[_0xa583('0x2f')];if(_0x8a4175[_0xa583('0x31')][_0xa583('0x41')]){_0x194b03[_0xa583('0x42')]=[{'all':!![]}];}_0x194b03=_[_0xa583('0x3d')]({},_0x194b03,_0x8a4175['options']);return db['SmsQueueReport'][_0xa583('0x49')](_0x194b03)[_0xa583('0x25')](handleEntityNotFound(_0x4113d3,null))[_0xa583('0x25')](respondWithResult(_0x4113d3,null))[_0xa583('0x45')](handleError(_0x4113d3,null));};exports['create']=function(_0x54fb04,_0x5d9250){return db[_0xa583('0x48')][_0xa583('0x4a')](_0x54fb04[_0xa583('0x4b')],{})['then'](respondWithResult(_0x5d9250,0xc9))['catch'](handleError(_0x5d9250,null));};exports[_0xa583('0x4c')]=function(_0x46ee49,_0x1029df){if(_0x46ee49[_0xa583('0x4b')]['id']){delete _0x46ee49['body']['id'];}return db['SmsQueueReport'][_0xa583('0x49')]({'where':{'id':_0x46ee49[_0xa583('0x47')]['id']}})[_0xa583('0x25')](handleEntityNotFound(_0x1029df,null))[_0xa583('0x25')](saveUpdates(_0x46ee49[_0xa583('0x4b')],null))[_0xa583('0x25')](respondWithResult(_0x1029df,null))['catch'](handleError(_0x1029df,null));};exports['destroy']=function(_0x469c3e,_0xdd5dc3){return db['SmsQueueReport']['find']({'where':{'id':_0x469c3e[_0xa583('0x47')]['id']}})[_0xa583('0x25')](handleEntityNotFound(_0xdd5dc3,null))[_0xa583('0x25')](removeEntity(_0xdd5dc3,null))[_0xa583('0x45')](handleError(_0xdd5dc3,null));};exports[_0xa583('0x4d')]=function(_0x2b953e,_0x143ddc){return db[_0xa583('0x48')]['describe']()[_0xa583('0x25')](respondWithResult(_0x143ddc,null))[_0xa583('0x45')](handleError(_0x143ddc,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 3aeb8d6..7287318 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x598e9f,_0x198b0b){var _0x31b995=function(_0x26e251){while(--_0x26e251){_0x598e9f['push'](_0x598e9f['shift']());}};_0x31b995(++_0x198b0b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xb7e7[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x13ed6f,_0x515c3c){var _0x3b42dd=function(_0x570416){while(--_0x570416){_0x13ed6f['push'](_0x13ed6f['shift']());}};_0x3b42dd(++_0x515c3c);}(_0xe706,0xa3));var _0x6e70=function(_0x766080,_0x32d34a){_0x766080=_0x766080-0x0;var _0x27f3b5=_0xe706[_0x766080];return _0x27f3b5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 0e088a7..d897ea8 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 _0x9f15=['where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsQueueReport,\x20%s,\x20%s','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','update','raw'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9f15,0x1b0));var _0x59f1=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x9f15[_0x3ebb69];return _0x421e59;};'use strict';var _=require(_0x59f1('0x0'));var util=require(_0x59f1('0x1'));var moment=require(_0x59f1('0x2'));var BPromise=require('bluebird');var rs=require(_0x59f1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59f1('0x4'))['db'];var utils=require(_0x59f1('0x5'));var logger=require(_0x59f1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x59f1('0x7')][_0x59f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17604c,_0x198fb9,_0x15bb8d){return new BPromise(function(_0x17f88b,_0x37fa78){return client[_0x59f1('0x9')](_0x17604c,_0x15bb8d)[_0x59f1('0xa')](function(_0x28a779){logger[_0x59f1('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x198fb9,_0x59f1('0xc'));logger[_0x59f1('0xd')](_0x59f1('0xe'),_0x198fb9,'request\x20sent',JSON[_0x59f1('0xf')](_0x28a779));if(_0x28a779['error']){if(_0x28a779['error'][_0x59f1('0x10')]===0x1f4){logger[_0x59f1('0x11')](_0x59f1('0x12'),_0x198fb9,_0x28a779[_0x59f1('0x11')][_0x59f1('0x13')]);return _0x37fa78(_0x28a779['error'][_0x59f1('0x13')]);}logger[_0x59f1('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x198fb9,_0x28a779[_0x59f1('0x11')]['message']);return _0x17f88b(_0x28a779[_0x59f1('0x11')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x198fb9,_0x59f1('0xc'));_0x17f88b(_0x28a779[_0x59f1('0x14')][_0x59f1('0x13')]);}})[_0x59f1('0x15')](function(_0x53989b){logger[_0x59f1('0x11')](_0x59f1('0x12'),_0x198fb9,_0x53989b);_0x37fa78(_0x53989b);});});}exports[_0x59f1('0x16')]=function(_0x4ab3c7){var _0x5e2a5d=this;return new Promise(function(_0x151dfe,_0xde1628){return db[_0x59f1('0x17')][_0x59f1('0x18')](_0x4ab3c7[_0x59f1('0x19')],{'raw':_0x4ab3c7['options']?_0x4ab3c7[_0x59f1('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x59f1('0xa')](function(_0x562cdd){logger['info'](_0x59f1('0x16'),_0x4ab3c7);logger[_0x59f1('0xd')](_0x59f1('0x16'),_0x4ab3c7,JSON[_0x59f1('0xf')](_0x562cdd));_0x151dfe(_0x562cdd);})[_0x59f1('0x15')](function(_0xb75172){logger[_0x59f1('0x11')](_0x59f1('0x16'),_0xb75172[_0x59f1('0x13')],_0x4ab3c7);_0xde1628(_0x5e2a5d[_0x59f1('0x11')](0x1f4,_0xb75172[_0x59f1('0x13')]));});});};exports[_0x59f1('0x1b')]=function(_0x310340){var _0x104703=this;return new Promise(function(_0x577d9a,_0x19f5da){return db[_0x59f1('0x17')][_0x59f1('0x1c')](_0x310340[_0x59f1('0x19')],{'raw':_0x310340[_0x59f1('0x1a')]?_0x310340[_0x59f1('0x1a')][_0x59f1('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x310340['options']?_0x310340[_0x59f1('0x1a')][_0x59f1('0x1e')]||null:null,'attributes':_0x310340[_0x59f1('0x1a')]?_0x310340['options'][_0x59f1('0x1f')]||null:null,'limit':_0x310340['options']?_0x310340[_0x59f1('0x1a')][_0x59f1('0x20')]||null:null})[_0x59f1('0xa')](function(_0x51ddfb){logger['info']('UpdateSmsQueueReport',_0x310340);logger[_0x59f1('0xd')](_0x59f1('0x1b'),_0x310340,JSON[_0x59f1('0xf')](_0x51ddfb));_0x577d9a(_0x51ddfb);})[_0x59f1('0x15')](function(_0x4074aa){logger['error'](_0x59f1('0x1b'),_0x4074aa[_0x59f1('0x13')],_0x310340);_0x19f5da(_0x104703['error'](0x1f4,_0x4074aa['message']));});});}; \ No newline at end of file +var _0x672b=['../../config/environment','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateSmsQueueReport','create','options','raw','info','UpdateSmsQueueReport','SmsQueueReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x48e88d,_0xcfc6e5){var _0x38fdf4=function(_0xaa1c8d){while(--_0xaa1c8d){_0x48e88d['push'](_0x48e88d['shift']());}};_0x38fdf4(++_0xcfc6e5);}(_0x672b,0x1d8));var _0xb672=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x672b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb672('0x0'));var util=require(_0xb672('0x1'));var moment=require(_0xb672('0x2'));var BPromise=require(_0xb672('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb672('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb672('0x5'));var logger=require(_0xb672('0x6'))(_0xb672('0x7'));var config=require(_0xb672('0x8'));var jayson=require(_0xb672('0x9'));var client=jayson[_0xb672('0xa')][_0xb672('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e1e1,_0x90a971,_0x5a525f){return new BPromise(function(_0x4dd6ae,_0x5bfb3b){return client[_0xb672('0xc')](_0x13e1e1,_0x5a525f)[_0xb672('0xd')](function(_0x1d5e65){logger['info'](_0xb672('0xe'),_0x90a971,_0xb672('0xf'));logger[_0xb672('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x90a971,_0xb672('0xf'),JSON[_0xb672('0x11')](_0x1d5e65));if(_0x1d5e65[_0xb672('0x12')]){if(_0x1d5e65[_0xb672('0x12')][_0xb672('0x13')]===0x1f4){logger[_0xb672('0x12')](_0xb672('0xe'),_0x90a971,_0x1d5e65[_0xb672('0x12')][_0xb672('0x14')]);return _0x5bfb3b(_0x1d5e65[_0xb672('0x12')][_0xb672('0x14')]);}logger[_0xb672('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x90a971,_0x1d5e65[_0xb672('0x12')]['message']);return _0x4dd6ae(_0x1d5e65[_0xb672('0x12')][_0xb672('0x14')]);}else{logger['info'](_0xb672('0xe'),_0x90a971,_0xb672('0xf'));_0x4dd6ae(_0x1d5e65['result'][_0xb672('0x14')]);}})[_0xb672('0x15')](function(_0x57042e){logger[_0xb672('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x90a971,_0x57042e);_0x5bfb3b(_0x57042e);});});}exports[_0xb672('0x16')]=function(_0xb7660e){var _0xca8a96=this;return new Promise(function(_0x3b3645,_0x4a57cc){return db['SmsQueueReport'][_0xb672('0x17')](_0xb7660e['body'],{'raw':_0xb7660e[_0xb672('0x18')]?_0xb7660e[_0xb672('0x18')][_0xb672('0x19')]===undefined?!![]:![]:!![]})[_0xb672('0xd')](function(_0x2689c6){logger[_0xb672('0x1a')](_0xb672('0x16'),_0xb7660e);logger[_0xb672('0x10')](_0xb672('0x16'),_0xb7660e,JSON[_0xb672('0x11')](_0x2689c6));_0x3b3645(_0x2689c6);})[_0xb672('0x15')](function(_0x3e9859){logger[_0xb672('0x12')](_0xb672('0x16'),_0x3e9859[_0xb672('0x14')],_0xb7660e);_0x4a57cc(_0xca8a96[_0xb672('0x12')](0x1f4,_0x3e9859[_0xb672('0x14')]));});});};exports[_0xb672('0x1b')]=function(_0x2a21b0){var _0x121979=this;return new Promise(function(_0x54db39,_0x2a78dc){return db[_0xb672('0x1c')][_0xb672('0x1d')](_0x2a21b0['body'],{'raw':_0x2a21b0[_0xb672('0x18')]?_0x2a21b0[_0xb672('0x18')][_0xb672('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a21b0[_0xb672('0x18')]?_0x2a21b0[_0xb672('0x18')]['where']||null:null,'attributes':_0x2a21b0['options']?_0x2a21b0[_0xb672('0x18')][_0xb672('0x1e')]||null:null,'limit':_0x2a21b0[_0xb672('0x18')]?_0x2a21b0['options'][_0xb672('0x1f')]||null:null})[_0xb672('0xd')](function(_0xdb2fd3){logger['info'](_0xb672('0x1b'),_0x2a21b0);logger['debug'](_0xb672('0x1b'),_0x2a21b0,JSON[_0xb672('0x11')](_0xdb2fd3));_0x54db39(_0xdb2fd3);})[_0xb672('0x15')](function(_0x3df208){logger[_0xb672('0x12')](_0xb672('0x1b'),_0x3df208[_0xb672('0x14')],_0x2a21b0);_0x2a78dc(_0x121979[_0xb672('0x12')](0x1f4,_0x3df208[_0xb672('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index cc395f7..f083b40 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 _0x7217=['../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'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('0xf')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x10')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x13')]);module['exports']=router; \ No newline at end of file +var _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x3f4fb8,_0x1c6c0f){var _0x44048a=function(_0x1a5d25){while(--_0x1a5d25){_0x3f4fb8['push'](_0x3f4fb8['shift']());}};_0x44048a(++_0x1c6c0f);}(_0x56a4,0x11b));var _0x456a=function(_0x1c5f32,_0x1ac260){_0x1c5f32=_0x1c5f32-0x0;var _0x3bd1e8=_0x56a4[_0x1c5f32];return _0x3bd1e8;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 99d5c7d..41d42d0 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x54ef,0x112));var _0xf54e=function(_0x26462e,_0x25d303){_0x26462e=_0x26462e-0x0;var _0x26b91f=_0x54ef[_0x26462e];return _0x26b91f;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xee6416,_0x450cdf){var _0x17e92a=function(_0x2e39f6){while(--_0x2e39f6){_0xee6416['push'](_0xee6416['shift']());}};_0x17e92a(++_0x450cdf);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0xf3cd[_0x5cf1a1];return _0x52cbcc;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f001583..9b7adba 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 _0x51f7=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','save','update','destroy','then','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format'];(function(_0x645b40,_0x378959){var _0x1f6f74=function(_0x290152){while(--_0x290152){_0x645b40['push'](_0x645b40['shift']());}};_0x1f6f74(++_0x378959);}(_0x51f7,0x1bb));var _0x751f=function(_0x4295fd,_0x1f2573){_0x4295fd=_0x4295fd-0x0;var _0x96f34e=_0x51f7[_0x4295fd];return _0x96f34e;};'use strict';var emlformat=require(_0x751f('0x0'));var rimraf=require(_0x751f('0x1'));var zipdir=require(_0x751f('0x2'));var jsonpatch=require(_0x751f('0x3'));var rp=require(_0x751f('0x4'));var moment=require(_0x751f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x751f('0x6'));var util=require('util');var path=require(_0x751f('0x7'));var sox=require(_0x751f('0x8'));var csv=require(_0x751f('0x9'));var ejs=require(_0x751f('0xa'));var fs=require('fs');var fs_extra=require(_0x751f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x751f('0xc'));var jsforce=require(_0x751f('0xd'));var deskjs=require(_0x751f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x751f('0xf'));var Redis=require(_0x751f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x751f('0x11'));var as=require(_0x751f('0x12'));var hardwareService=require(_0x751f('0x13'));var logger=require(_0x751f('0x14'))(_0x751f('0x15'));var utils=require(_0x751f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xda13e7,_0x3159e8){_0x3159e8=_0x3159e8||0xcc;return function(_0x28462d){if(_0x28462d){return _0xda13e7[_0x751f('0x17')](_0x3159e8);}return _0xda13e7[_0x751f('0x18')](_0x3159e8)['end']();};}function respondWithResult(_0x524ca3,_0x420636){_0x420636=_0x420636||0xc8;return function(_0x1f0745){if(_0x1f0745){return _0x524ca3[_0x751f('0x18')](_0x420636)[_0x751f('0x19')](_0x1f0745);}};}function respondWithFilteredResult(_0x147b8a,_0x50b489){return function(_0x871616){if(_0x871616){var _0x32aa25=typeof _0x50b489['offset']===_0x751f('0x1a')&&typeof _0x50b489[_0x751f('0x1b')]==='undefined';var _0xe237e2=_0x871616[_0x751f('0x1c')];var _0x44c097=_0x32aa25?0x0:_0x50b489[_0x751f('0x1d')];var _0x7f509f=_0x32aa25?_0x871616[_0x751f('0x1c')]:_0x50b489[_0x751f('0x1d')]+_0x50b489[_0x751f('0x1b')];var _0x49db60;if(_0x7f509f>=_0xe237e2){_0x7f509f=_0xe237e2;_0x49db60=0xc8;}else{_0x49db60=0xce;}_0x147b8a[_0x751f('0x18')](_0x49db60);return _0x147b8a[_0x751f('0x1e')]('Content-Range',_0x44c097+'-'+_0x7f509f+'/'+_0xe237e2)[_0x751f('0x19')](_0x871616);}return null;};}function patchUpdates(_0x263a03){return function(_0x3484e6){try{jsonpatch['apply'](_0x3484e6,_0x263a03,!![]);}catch(_0x13d2ed){return BPromise['reject'](_0x13d2ed);}return _0x3484e6[_0x751f('0x1f')]();};}function saveUpdates(_0x53127c,_0x1de853){return function(_0x5bdc53){if(_0x5bdc53){return _0x5bdc53[_0x751f('0x20')](_0x53127c)['then'](function(_0x5936ae){return _0x5936ae;});}return null;};}function removeEntity(_0x5b0675,_0x2633bb){return function(_0x2f462c){if(_0x2f462c){return _0x2f462c[_0x751f('0x21')]()[_0x751f('0x22')](function(){_0x5b0675['status'](0xcc)[_0x751f('0x23')]();});}};}function handleEntityNotFound(_0x4116a7,_0x56dfd2){return function(_0x4850fc){if(!_0x4850fc){_0x4116a7['sendStatus'](0x194);}return _0x4850fc;};}function handleError(_0x40fbab,_0x9577d4){_0x9577d4=_0x9577d4||0x1f4;return function(_0x1494ae){logger[_0x751f('0x24')](_0x1494ae[_0x751f('0x25')]);if(_0x1494ae[_0x751f('0x26')]){delete _0x1494ae[_0x751f('0x26')];}_0x40fbab[_0x751f('0x18')](_0x9577d4)[_0x751f('0x27')](_0x1494ae);};}exports[_0x751f('0x28')]=function(_0x2a0c24,_0x3cb8bb){var _0x2dd12c={},_0x37a378={},_0x616de9={'count':0x0,'rows':[]};var _0x1c17cc=_[_0x751f('0x29')](db[_0x751f('0x2a')][_0x751f('0x2b')],function(_0x56fad1){return{'name':_0x56fad1[_0x751f('0x2c')],'type':_0x56fad1[_0x751f('0x2d')][_0x751f('0x2e')]};});_0x37a378[_0x751f('0x2f')]=_[_0x751f('0x29')](_0x1c17cc,'name');_0x37a378[_0x751f('0x30')]=_[_0x751f('0x31')](_0x2a0c24[_0x751f('0x30')]);_0x37a378[_0x751f('0x32')]=_[_0x751f('0x33')](_0x37a378[_0x751f('0x2f')],_0x37a378[_0x751f('0x30')]);_0x2dd12c[_0x751f('0x34')]=_[_0x751f('0x33')](_0x37a378[_0x751f('0x2f')],qs['fields'](_0x2a0c24[_0x751f('0x30')][_0x751f('0x35')]));_0x2dd12c[_0x751f('0x34')]=_0x2dd12c['attributes'][_0x751f('0x36')]?_0x2dd12c[_0x751f('0x34')]:_0x37a378[_0x751f('0x2f')];if(!_0x2a0c24[_0x751f('0x30')][_0x751f('0x37')]('nolimit')){_0x2dd12c[_0x751f('0x1b')]=qs[_0x751f('0x1b')](_0x2a0c24[_0x751f('0x30')][_0x751f('0x1b')]);_0x2dd12c[_0x751f('0x1d')]=qs[_0x751f('0x1d')](_0x2a0c24['query'][_0x751f('0x1d')]);}_0x2dd12c[_0x751f('0x38')]=qs[_0x751f('0x39')](_0x2a0c24[_0x751f('0x30')][_0x751f('0x39')]);_0x2dd12c[_0x751f('0x3a')]=qs['filters'](_[_0x751f('0x3b')](_0x2a0c24[_0x751f('0x30')],_0x37a378[_0x751f('0x32')]),_0x1c17cc);if(_0x2a0c24[_0x751f('0x30')]['filter']){_0x2dd12c[_0x751f('0x3a')]=_[_0x751f('0x3c')](_0x2dd12c[_0x751f('0x3a')],{'$or':_[_0x751f('0x29')](_0x1c17cc,function(_0xfaea85){if(_0xfaea85[_0x751f('0x2d')]!==_0x751f('0x3d')){var _0x550283={};_0x550283[_0xfaea85[_0x751f('0x26')]]={'$like':'%'+_0x2a0c24[_0x751f('0x30')][_0x751f('0x3e')]+'%'};return _0x550283;}})});}_0x2dd12c=_[_0x751f('0x3c')]({},_0x2dd12c,_0x2a0c24[_0x751f('0x3f')]);var _0x407a94={'where':_0x2dd12c[_0x751f('0x3a')]};return db[_0x751f('0x2a')][_0x751f('0x1c')](_0x407a94)[_0x751f('0x22')](function(_0x534823){_0x616de9[_0x751f('0x1c')]=_0x534823;if(_0x2a0c24[_0x751f('0x30')][_0x751f('0x40')]){_0x2dd12c[_0x751f('0x41')]=[{'all':!![]}];}return db[_0x751f('0x2a')][_0x751f('0x42')](_0x2dd12c);})[_0x751f('0x22')](function(_0x2c53dc){_0x616de9['rows']=_0x2c53dc;return _0x616de9;})[_0x751f('0x22')](respondWithFilteredResult(_0x3cb8bb,_0x2dd12c))[_0x751f('0x43')](handleError(_0x3cb8bb,null));};exports[_0x751f('0x44')]=function(_0x4103ab,_0xf25036){var _0x4ee161={'raw':!![],'where':{'id':_0x4103ab[_0x751f('0x45')]['id']}},_0x4fe061={};_0x4fe061[_0x751f('0x2f')]=_[_0x751f('0x31')](db['SmsTransferReport'][_0x751f('0x2b')]);_0x4fe061[_0x751f('0x30')]=_['keys'](_0x4103ab[_0x751f('0x30')]);_0x4fe061[_0x751f('0x32')]=_[_0x751f('0x33')](_0x4fe061['model'],_0x4fe061['query']);_0x4ee161[_0x751f('0x34')]=_[_0x751f('0x33')](_0x4fe061['model'],qs[_0x751f('0x35')](_0x4103ab['query'][_0x751f('0x35')]));_0x4ee161[_0x751f('0x34')]=_0x4ee161[_0x751f('0x34')]['length']?_0x4ee161[_0x751f('0x34')]:_0x4fe061['model'];if(_0x4103ab[_0x751f('0x30')][_0x751f('0x40')]){_0x4ee161[_0x751f('0x41')]=[{'all':!![]}];}_0x4ee161=_[_0x751f('0x3c')]({},_0x4ee161,_0x4103ab[_0x751f('0x3f')]);return db[_0x751f('0x2a')][_0x751f('0x46')](_0x4ee161)[_0x751f('0x22')](handleEntityNotFound(_0xf25036,null))[_0x751f('0x22')](respondWithResult(_0xf25036,null))[_0x751f('0x43')](handleError(_0xf25036,null));};exports[_0x751f('0x47')]=function(_0x28fb6f,_0x12dc97){return db[_0x751f('0x2a')][_0x751f('0x47')](_0x28fb6f[_0x751f('0x48')],{})[_0x751f('0x22')](respondWithResult(_0x12dc97,0xc9))['catch'](handleError(_0x12dc97,null));};exports[_0x751f('0x20')]=function(_0x3827f7,_0x4d417c){if(_0x3827f7[_0x751f('0x48')]['id']){delete _0x3827f7[_0x751f('0x48')]['id'];}return db[_0x751f('0x2a')]['find']({'where':{'id':_0x3827f7[_0x751f('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d417c,null))[_0x751f('0x22')](saveUpdates(_0x3827f7[_0x751f('0x48')],null))[_0x751f('0x22')](respondWithResult(_0x4d417c,null))['catch'](handleError(_0x4d417c,null));};exports[_0x751f('0x21')]=function(_0x20ca0a,_0x2140e5){return db[_0x751f('0x2a')][_0x751f('0x46')]({'where':{'id':_0x20ca0a[_0x751f('0x45')]['id']}})[_0x751f('0x22')](handleEntityNotFound(_0x2140e5,null))[_0x751f('0x22')](removeEntity(_0x2140e5,null))[_0x751f('0x43')](handleError(_0x2140e5,null));};exports[_0x751f('0x49')]=function(_0x470635,_0x5bf16c){return db[_0x751f('0x2a')]['describe']()[_0x751f('0x22')](respondWithResult(_0x5bf16c,null))[_0x751f('0x43')](handleError(_0x5bf16c,null));}; \ No newline at end of file +var _0xb2db=['end','json','offset','undefined','limit','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','fields','create','body','update','params','find','describe','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x6d0143,_0x3d7c30){var _0x29cb75=function(_0x3bfcf4){while(--_0x3bfcf4){_0x6d0143['push'](_0x6d0143['shift']());}};_0x29cb75(++_0x3d7c30);}(_0xb2db,0x10f));var _0xbb2d=function(_0x29f69a,_0x11f40a){_0x29f69a=_0x29f69a-0x0;var _0x50174f=_0xb2db[_0x29f69a];return _0x50174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb2d('0x0'));var jsonpatch=require(_0xbb2d('0x1'));var rp=require(_0xbb2d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbb2d('0x3'));var path=require(_0xbb2d('0x4'));var sox=require(_0xbb2d('0x5'));var csv=require(_0xbb2d('0x6'));var ejs=require(_0xbb2d('0x7'));var fs=require('fs');var fs_extra=require(_0xbb2d('0x8'));var _=require(_0xbb2d('0x9'));var squel=require(_0xbb2d('0xa'));var crypto=require(_0xbb2d('0xb'));var jsforce=require(_0xbb2d('0xc'));var deskjs=require(_0xbb2d('0xd'));var toCsv=require(_0xbb2d('0x6'));var querystring=require(_0xbb2d('0xe'));var Papa=require('papaparse');var Redis=require(_0xbb2d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbb2d('0x10'));var as=require(_0xbb2d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb2d('0x12'))(_0xbb2d('0x13'));var utils=require(_0xbb2d('0x14'));var config=require(_0xbb2d('0x15'));var licenseUtil=require(_0xbb2d('0x16'));var db=require(_0xbb2d('0x17'))['db'];function respondWithStatusCode(_0x4d5443,_0x47e449){_0x47e449=_0x47e449||0xcc;return function(_0x3ed4dd){if(_0x3ed4dd){return _0x4d5443['sendStatus'](_0x47e449);}return _0x4d5443[_0xbb2d('0x18')](_0x47e449)[_0xbb2d('0x19')]();};}function respondWithResult(_0x2e8f21,_0x5a4253){_0x5a4253=_0x5a4253||0xc8;return function(_0x4faf16){if(_0x4faf16){return _0x2e8f21['status'](_0x5a4253)[_0xbb2d('0x1a')](_0x4faf16);}};}function respondWithFilteredResult(_0x39e95c,_0x560f50){return function(_0x36bbdf){if(_0x36bbdf){var _0x2a91ca=typeof _0x560f50[_0xbb2d('0x1b')]===_0xbb2d('0x1c')&&typeof _0x560f50[_0xbb2d('0x1d')]===_0xbb2d('0x1c');var _0xd3bf2e=_0x36bbdf['count'];var _0x1343b2=_0x2a91ca?0x0:_0x560f50[_0xbb2d('0x1b')];var _0xa77d55=_0x2a91ca?_0x36bbdf['count']:_0x560f50['offset']+_0x560f50[_0xbb2d('0x1d')];var _0x32e0d9;if(_0xa77d55>=_0xd3bf2e){_0xa77d55=_0xd3bf2e;_0x32e0d9=0xc8;}else{_0x32e0d9=0xce;}_0x39e95c[_0xbb2d('0x18')](_0x32e0d9);return _0x39e95c['set']('Content-Range',_0x1343b2+'-'+_0xa77d55+'/'+_0xd3bf2e)['json'](_0x36bbdf);}return null;};}function patchUpdates(_0x51a8d0){return function(_0x359d06){try{jsonpatch[_0xbb2d('0x1e')](_0x359d06,_0x51a8d0,!![]);}catch(_0x135900){return BPromise[_0xbb2d('0x1f')](_0x135900);}return _0x359d06[_0xbb2d('0x20')]();};}function saveUpdates(_0x4a6675,_0x2f6e8a){return function(_0x16c94e){if(_0x16c94e){return _0x16c94e['update'](_0x4a6675)['then'](function(_0x4e4d9b){return _0x4e4d9b;});}return null;};}function removeEntity(_0x284e73,_0x5a81d3){return function(_0x2631f6){if(_0x2631f6){return _0x2631f6[_0xbb2d('0x21')]()[_0xbb2d('0x22')](function(){_0x284e73[_0xbb2d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20bce5,_0x2c9930){return function(_0x13aae3){if(!_0x13aae3){_0x20bce5[_0xbb2d('0x23')](0x194);}return _0x13aae3;};}function handleError(_0x4ec0e4,_0x48f6f1){_0x48f6f1=_0x48f6f1||0x1f4;return function(_0x26dcf1){logger[_0xbb2d('0x24')](_0x26dcf1['stack']);if(_0x26dcf1['name']){delete _0x26dcf1[_0xbb2d('0x25')];}_0x4ec0e4['status'](_0x48f6f1)[_0xbb2d('0x26')](_0x26dcf1);};}exports[_0xbb2d('0x27')]=function(_0x70a529,_0x26b6f7){var _0xa8d828={},_0x1fe5fd={},_0x4ac345={'count':0x0,'rows':[]};var _0x21e05d=_[_0xbb2d('0x28')](db[_0xbb2d('0x29')]['rawAttributes'],function(_0x4b74d4){return{'name':_0x4b74d4[_0xbb2d('0x2a')],'type':_0x4b74d4[_0xbb2d('0x2b')][_0xbb2d('0x2c')]};});_0x1fe5fd[_0xbb2d('0x2d')]=_[_0xbb2d('0x28')](_0x21e05d,_0xbb2d('0x25'));_0x1fe5fd[_0xbb2d('0x2e')]=_[_0xbb2d('0x2f')](_0x70a529['query']);_0x1fe5fd[_0xbb2d('0x30')]=_[_0xbb2d('0x31')](_0x1fe5fd[_0xbb2d('0x2d')],_0x1fe5fd[_0xbb2d('0x2e')]);_0xa8d828['attributes']=_[_0xbb2d('0x31')](_0x1fe5fd['model'],qs['fields'](_0x70a529[_0xbb2d('0x2e')]['fields']));_0xa8d828[_0xbb2d('0x32')]=_0xa8d828[_0xbb2d('0x32')][_0xbb2d('0x33')]?_0xa8d828[_0xbb2d('0x32')]:_0x1fe5fd[_0xbb2d('0x2d')];if(!_0x70a529[_0xbb2d('0x2e')][_0xbb2d('0x34')](_0xbb2d('0x35'))){_0xa8d828['limit']=qs[_0xbb2d('0x1d')](_0x70a529[_0xbb2d('0x2e')][_0xbb2d('0x1d')]);_0xa8d828['offset']=qs[_0xbb2d('0x1b')](_0x70a529[_0xbb2d('0x2e')][_0xbb2d('0x1b')]);}_0xa8d828['order']=qs['sort'](_0x70a529['query'][_0xbb2d('0x36')]);_0xa8d828[_0xbb2d('0x37')]=qs[_0xbb2d('0x30')](_[_0xbb2d('0x38')](_0x70a529[_0xbb2d('0x2e')],_0x1fe5fd[_0xbb2d('0x30')]),_0x21e05d);if(_0x70a529['query'][_0xbb2d('0x39')]){_0xa8d828[_0xbb2d('0x37')]=_['merge'](_0xa8d828[_0xbb2d('0x37')],{'$or':_['map'](_0x21e05d,function(_0x20ad4c){if(_0x20ad4c[_0xbb2d('0x2b')]!=='VIRTUAL'){var _0x3ff04c={};_0x3ff04c[_0x20ad4c[_0xbb2d('0x25')]]={'$like':'%'+_0x70a529['query']['filter']+'%'};return _0x3ff04c;}})});}_0xa8d828=_[_0xbb2d('0x3a')]({},_0xa8d828,_0x70a529[_0xbb2d('0x3b')]);var _0x552751={'where':_0xa8d828[_0xbb2d('0x37')]};return db[_0xbb2d('0x29')][_0xbb2d('0x3c')](_0x552751)['then'](function(_0x5d82d4){_0x4ac345[_0xbb2d('0x3c')]=_0x5d82d4;if(_0x70a529[_0xbb2d('0x2e')][_0xbb2d('0x3d')]){_0xa8d828[_0xbb2d('0x3e')]=[{'all':!![]}];}return db[_0xbb2d('0x29')][_0xbb2d('0x3f')](_0xa8d828);})[_0xbb2d('0x22')](function(_0x5af7f1){_0x4ac345[_0xbb2d('0x40')]=_0x5af7f1;return _0x4ac345;})[_0xbb2d('0x22')](respondWithFilteredResult(_0x26b6f7,_0xa8d828))[_0xbb2d('0x41')](handleError(_0x26b6f7,null));};exports[_0xbb2d('0x42')]=function(_0x3aac38,_0x4fb5c2){var _0x3116cc={'raw':!![],'where':{'id':_0x3aac38['params']['id']}},_0x438e6f={};_0x438e6f[_0xbb2d('0x2d')]=_[_0xbb2d('0x2f')](db[_0xbb2d('0x29')]['rawAttributes']);_0x438e6f[_0xbb2d('0x2e')]=_[_0xbb2d('0x2f')](_0x3aac38[_0xbb2d('0x2e')]);_0x438e6f['filters']=_['intersection'](_0x438e6f['model'],_0x438e6f[_0xbb2d('0x2e')]);_0x3116cc[_0xbb2d('0x32')]=_[_0xbb2d('0x31')](_0x438e6f[_0xbb2d('0x2d')],qs[_0xbb2d('0x43')](_0x3aac38[_0xbb2d('0x2e')][_0xbb2d('0x43')]));_0x3116cc[_0xbb2d('0x32')]=_0x3116cc['attributes'][_0xbb2d('0x33')]?_0x3116cc[_0xbb2d('0x32')]:_0x438e6f[_0xbb2d('0x2d')];if(_0x3aac38[_0xbb2d('0x2e')][_0xbb2d('0x3d')]){_0x3116cc[_0xbb2d('0x3e')]=[{'all':!![]}];}_0x3116cc=_[_0xbb2d('0x3a')]({},_0x3116cc,_0x3aac38[_0xbb2d('0x3b')]);return db['SmsTransferReport']['find'](_0x3116cc)[_0xbb2d('0x22')](handleEntityNotFound(_0x4fb5c2,null))['then'](respondWithResult(_0x4fb5c2,null))['catch'](handleError(_0x4fb5c2,null));};exports[_0xbb2d('0x44')]=function(_0x5f025d,_0x2afd72){return db[_0xbb2d('0x29')][_0xbb2d('0x44')](_0x5f025d[_0xbb2d('0x45')],{})[_0xbb2d('0x22')](respondWithResult(_0x2afd72,0xc9))[_0xbb2d('0x41')](handleError(_0x2afd72,null));};exports[_0xbb2d('0x46')]=function(_0x4233f0,_0x214587){if(_0x4233f0['body']['id']){delete _0x4233f0[_0xbb2d('0x45')]['id'];}return db[_0xbb2d('0x29')]['find']({'where':{'id':_0x4233f0[_0xbb2d('0x47')]['id']}})['then'](handleEntityNotFound(_0x214587,null))['then'](saveUpdates(_0x4233f0['body'],null))[_0xbb2d('0x22')](respondWithResult(_0x214587,null))[_0xbb2d('0x41')](handleError(_0x214587,null));};exports[_0xbb2d('0x21')]=function(_0x4c156e,_0x16a6d9){return db[_0xbb2d('0x29')][_0xbb2d('0x48')]({'where':{'id':_0x4c156e[_0xbb2d('0x47')]['id']}})[_0xbb2d('0x22')](handleEntityNotFound(_0x16a6d9,null))[_0xbb2d('0x22')](removeEntity(_0x16a6d9,null))[_0xbb2d('0x41')](handleError(_0x16a6d9,null));};exports[_0xbb2d('0x49')]=function(_0x1e3ae1,_0x3615d3){return db[_0xbb2d('0x29')][_0xbb2d('0x49')]()[_0xbb2d('0x22')](respondWithResult(_0x3615d3,null))[_0xbb2d('0x41')](handleError(_0x3615d3,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index b8fe0b5..a9f1c50 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 _0xfb68=['define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x1bbb25,_0x511a8f){var _0x3dd51f=function(_0x4932df){while(--_0x4932df){_0x1bbb25['push'](_0x1bbb25['shift']());}};_0x3dd51f(++_0x511a8f);}(_0xfb68,0x1d2));var _0x8fb6=function(_0x3fd85b,_0x5dbe9f){_0x3fd85b=_0x3fd85b-0x0;var _0x1f8822=_0xfb68[_0x3fd85b];return _0x1f8822;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var logger=require(_0x8fb6('0x2'))(_0x8fb6('0x3'));var moment=require(_0x8fb6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fb6('0x5'));var rimraf=require(_0x8fb6('0x6'));var config=require(_0x8fb6('0x7'));var attributes=require(_0x8fb6('0x8'));module[_0x8fb6('0x9')]=function(_0x50a6af,_0x93a0c9){return _0x50a6af[_0x8fb6('0xa')](_0x8fb6('0xb'),attributes,{'tableName':_0x8fb6('0xc'),'paranoid':![],'indexes':[{'name':_0x8fb6('0xd'),'fields':[_0x8fb6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4471=['rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x41df82,_0x4f3639){var _0x49ab12=function(_0x36ac38){while(--_0x36ac38){_0x41df82['push'](_0x41df82['shift']());}};_0x49ab12(++_0x4f3639);}(_0x4471,0x151));var _0x1447=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4471[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x1447('0x0'));var util=require(_0x1447('0x1'));var logger=require(_0x1447('0x2'))(_0x1447('0x3'));var moment=require(_0x1447('0x4'));var BPromise=require(_0x1447('0x5'));var rp=require(_0x1447('0x6'));var fs=require('fs');var path=require(_0x1447('0x7'));var rimraf=require(_0x1447('0x8'));var config=require(_0x1447('0x9'));var attributes=require(_0x1447('0xa'));module['exports']=function(_0x526d64,_0x325a0f){return _0x526d64[_0x1447('0xb')](_0x1447('0xc'),attributes,{'tableName':_0x1447('0xd'),'paranoid':![],'indexes':[{'name':_0x1447('0xe'),'fields':[_0x1447('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 0a318c1..e1fd957 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 _0xeedf=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring'];(function(_0x2ed016,_0x2d9eb3){var _0x5bb515=function(_0x45e0d1){while(--_0x45e0d1){_0x2ed016['push'](_0x2ed016['shift']());}};_0x5bb515(++_0x2d9eb3);}(_0xeedf,0x12c));var _0xfeed=function(_0x586eba,_0x3a4b9b){_0x586eba=_0x586eba-0x0;var _0x163e10=_0xeedf[_0x586eba];return _0x163e10;};'use strict';var _=require(_0xfeed('0x0'));var util=require(_0xfeed('0x1'));var moment=require(_0xfeed('0x2'));var BPromise=require('bluebird');var rs=require(_0xfeed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfeed('0x4'))['db'];var utils=require(_0xfeed('0x5'));var logger=require(_0xfeed('0x6'))(_0xfeed('0x7'));var config=require('../../config/environment');var jayson=require(_0xfeed('0x8'));var client=jayson[_0xfeed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19f2de,_0x52286c,_0x22fd66){return new BPromise(function(_0x5c147d,_0x124bdf){return client['request'](_0x19f2de,_0x22fd66)['then'](function(_0x5163e7){logger[_0xfeed('0xa')](_0xfeed('0xb'),_0x52286c,_0xfeed('0xc'));logger[_0xfeed('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x52286c,_0xfeed('0xc'),JSON[_0xfeed('0xe')](_0x5163e7));if(_0x5163e7[_0xfeed('0xf')]){if(_0x5163e7[_0xfeed('0xf')]['code']===0x1f4){logger['error'](_0xfeed('0xb'),_0x52286c,_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);return _0x124bdf(_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);}logger[_0xfeed('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x52286c,_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);return _0x5c147d(_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);}else{logger[_0xfeed('0xa')](_0xfeed('0xb'),_0x52286c,_0xfeed('0xc'));_0x5c147d(_0x5163e7[_0xfeed('0x11')][_0xfeed('0x10')]);}})[_0xfeed('0x12')](function(_0x17eb91){logger[_0xfeed('0xf')](_0xfeed('0xb'),_0x52286c,_0x17eb91);_0x124bdf(_0x17eb91);});});} \ No newline at end of file +var _0x5b7f=['../../config/environment','jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x43d809,_0x1a505f){var _0xd4f45a=function(_0x13a6f4){while(--_0x13a6f4){_0x43d809['push'](_0x43d809['shift']());}};_0xd4f45a(++_0x1a505f);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x14c914,_0x53e2b1){_0x14c914=_0x14c914-0x0;var _0x4c3d61=_0x5b7f[_0x14c914];return _0x4c3d61;};'use strict';var _=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var moment=require(_0xf5b7('0x2'));var BPromise=require(_0xf5b7('0x3'));var rs=require(_0xf5b7('0x4'));var fs=require('fs');var Redis=require(_0xf5b7('0x5'));var db=require(_0xf5b7('0x6'))['db'];var utils=require(_0xf5b7('0x7'));var logger=require(_0xf5b7('0x8'))(_0xf5b7('0x9'));var config=require(_0xf5b7('0xa'));var jayson=require(_0xf5b7('0xb'));var client=jayson[_0xf5b7('0xc')][_0xf5b7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d7c78,_0xd69bc,_0x3711ec){return new BPromise(function(_0x426253,_0x556cb0){return client['request'](_0x1d7c78,_0x3711ec)['then'](function(_0x31c6ea){logger[_0xf5b7('0xe')](_0xf5b7('0xf'),_0xd69bc,_0xf5b7('0x10'));logger[_0xf5b7('0x11')](_0xf5b7('0x12'),_0xd69bc,_0xf5b7('0x10'),JSON[_0xf5b7('0x13')](_0x31c6ea));if(_0x31c6ea[_0xf5b7('0x14')]){if(_0x31c6ea[_0xf5b7('0x14')][_0xf5b7('0x15')]===0x1f4){logger[_0xf5b7('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0xd69bc,_0x31c6ea[_0xf5b7('0x14')][_0xf5b7('0x16')]);return _0x556cb0(_0x31c6ea[_0xf5b7('0x14')][_0xf5b7('0x16')]);}logger[_0xf5b7('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0xd69bc,_0x31c6ea[_0xf5b7('0x14')]['message']);return _0x426253(_0x31c6ea['error']['message']);}else{logger['info'](_0xf5b7('0xf'),_0xd69bc,_0xf5b7('0x10'));_0x426253(_0x31c6ea[_0xf5b7('0x17')][_0xf5b7('0x16')]);}})[_0xf5b7('0x18')](function(_0x4cac90){logger[_0xf5b7('0x14')](_0xf5b7('0xf'),_0xd69bc,_0x4cac90);_0x556cb0(_0x4cac90);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 531ba14..a060e5f 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 _0x60a8=['../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','extname','file','create','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3d309c,_0x242f4c){var _0x241187=function(_0x594990){while(--_0x594990){_0x3d309c['push'](_0x3d309c['shift']());}};_0x241187(++_0x242f4c);}(_0x60a8,0x108));var _0x860a=function(_0x56d6a7,_0x12296a){_0x56d6a7=_0x56d6a7-0x0;var _0x105985=_0x60a8[_0x56d6a7];return _0x105985;};'use strict';var multer=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var path=require('path');var timeout=require(_0x860a('0x2'));var express=require('express');var router=express[_0x860a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x860a('0x4'));var interaction=require(_0x860a('0x5'));var config=require(_0x860a('0x6'));var controller=require(_0x860a('0x7'));router[_0x860a('0x8')]('/',auth[_0x860a('0x9')](),controller['index']);router[_0x860a('0x8')](_0x860a('0xa'),auth[_0x860a('0x9')](),controller[_0x860a('0xb')]);router[_0x860a('0x8')](_0x860a('0xc'),auth[_0x860a('0x9')](),controller[_0x860a('0xd')]);var upload=multer({'storage':multer[_0x860a('0xe')]({'destination':function(_0xc57719,_0x45f6fb,_0x2f9b23){_0x2f9b23(null,path[_0x860a('0xf')](config[_0x860a('0x10')],_0x860a('0x11')));},'filename':function(_0x5a688e,_0x480b6b,_0x95f5e7){_0x480b6b[_0x860a('0x12')]=_0x480b6b[_0x860a('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x95f5e7(null,util[_0x860a('0x13')](_0x860a('0x14'),path['basename'](_0x480b6b['originalname'],path[_0x860a('0x15')](_0x480b6b[_0x860a('0x12')])),Date['now'](),path[_0x860a('0x15')](_0x480b6b[_0x860a('0x12')])));}})});router['post']('/',upload['single'](_0x860a('0x16')),controller[_0x860a('0x17')]);router['put'](_0x860a('0xa'),auth[_0x860a('0x9')](),controller[_0x860a('0x18')]);router[_0x860a('0x19')](_0x860a('0xa'),auth[_0x860a('0x9')](),controller['delete']);module[_0x860a('0x1a')]=router; \ No newline at end of file +var _0xf9cb=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','download','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','post','file','create','put','delete'];(function(_0x4b54d8,_0x546d2c){var _0x52a4cb=function(_0x4479ae){while(--_0x4479ae){_0x4b54d8['push'](_0x4b54d8['shift']());}};_0x52a4cb(++_0x546d2c);}(_0xf9cb,0x1db));var _0xbf9c=function(_0x214a25,_0x15071d){_0x214a25=_0x214a25-0x0;var _0x405988=_0xf9cb[_0x214a25];return _0x405988;};'use strict';var multer=require(_0xbf9c('0x0'));var util=require('util');var path=require(_0xbf9c('0x1'));var timeout=require(_0xbf9c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbf9c('0x3'));var auth=require(_0xbf9c('0x4'));var interaction=require(_0xbf9c('0x5'));var config=require(_0xbf9c('0x6'));var controller=require('./sound.controller');router['get']('/',auth[_0xbf9c('0x7')](),controller[_0xbf9c('0x8')]);router[_0xbf9c('0x9')](_0xbf9c('0xa'),auth[_0xbf9c('0x7')](),controller[_0xbf9c('0xb')]);router[_0xbf9c('0x9')]('/:id/download',auth[_0xbf9c('0x7')](),controller[_0xbf9c('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa9693,_0x36de2f,_0x2de5ca){_0x2de5ca(null,path['join'](config['root'],_0xbf9c('0xd')));},'filename':function(_0x1a75ea,_0x11f627,_0x11572e){_0x11f627['originalname']=_0x11f627[_0xbf9c('0xe')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11572e(null,util[_0xbf9c('0xf')](_0xbf9c('0x10'),path[_0xbf9c('0x11')](_0x11f627['originalname'],path[_0xbf9c('0x12')](_0x11f627['originalname'])),Date[_0xbf9c('0x13')](),path[_0xbf9c('0x12')](_0x11f627[_0xbf9c('0xe')])));}})});router[_0xbf9c('0x14')]('/',upload['single'](_0xbf9c('0x15')),controller[_0xbf9c('0x16')]);router[_0xbf9c('0x17')]('/:id',auth[_0xbf9c('0x7')](),controller['update']);router['delete'](_0xbf9c('0xa'),auth[_0xbf9c('0x7')](),controller[_0xbf9c('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c237e0f..9f4432b 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 _0x6422=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x136b4c,_0xcf71fd){var _0x516bce=function(_0x2fbd1a){while(--_0x2fbd1a){_0x136b4c['push'](_0x136b4c['shift']());}};_0x516bce(++_0xcf71fd);}(_0x6422,0x163));var _0x2642=function(_0x52c253,_0x26da02){_0x52c253=_0x52c253-0x0;var _0x2f1e8d=_0x6422[_0x52c253];return _0x2f1e8d;};'use strict';var Sequelize=require(_0x2642('0x0'));module[_0x2642('0x1')]={'name':{'type':Sequelize[_0x2642('0x2')],'unique':_0x2642('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2642('0x2')]},'display_name':{'type':Sequelize[_0x2642('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x2642('0x4')]},'original_sampleCount':{'type':Sequelize[_0x2642('0x5')]},'original_channelCount':{'type':Sequelize[_0x2642('0x6')]},'original_bitRate':{'type':Sequelize[_0x2642('0x5')]},'original_sampleRate':{'type':Sequelize[_0x2642('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x2642('0x6')]},'converted_bitRate':{'type':Sequelize[_0x2642('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x2642('0x6')]}}; \ No newline at end of file +var _0x8206=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x5caee5,_0x14493e){var _0x1f2f40=function(_0x419a87){while(--_0x419a87){_0x5caee5['push'](_0x5caee5['shift']());}};_0x1f2f40(++_0x14493e);}(_0x8206,0x194));var _0x6820=function(_0x3b1fa6,_0x2f720c){_0x3b1fa6=_0x3b1fa6-0x0;var _0x3ad104=_0x8206[_0x3b1fa6];return _0x3ad104;};'use strict';var Sequelize=require(_0x6820('0x0'));module[_0x6820('0x1')]={'name':{'type':Sequelize[_0x6820('0x2')],'unique':_0x6820('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6820('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x6820('0x2')]},'original_format':{'type':Sequelize[_0x6820('0x2')]},'original_duration':{'type':Sequelize[_0x6820('0x4')]},'original_sampleCount':{'type':Sequelize[_0x6820('0x5')]},'original_channelCount':{'type':Sequelize[_0x6820('0x6')]},'original_bitRate':{'type':Sequelize[_0x6820('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x6820('0x2')]},'converted_duration':{'type':Sequelize[_0x6820('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6820('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x6820('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x6820('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index db68398..dfd459a 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 _0xdb8b=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','status','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','VIRTUAL','options','includeAll','include','Sound','findAll','rows','catch','show','params','find','download','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','ValidationError','join','format','%s.%s','create','basename','originalname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','delete','original_format'];(function(_0x4596c1,_0x40cf1a){var _0x1672ae=function(_0x4e3947){while(--_0x4e3947){_0x4596c1['push'](_0x4596c1['shift']());}};_0x1672ae(++_0x40cf1a);}(_0xdb8b,0x1f0));var _0xbdb8=function(_0x3bcdaf,_0x5b76d7){_0x3bcdaf=_0x3bcdaf-0x0;var _0x49b812=_0xdb8b[_0x3bcdaf];return _0x49b812;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdb8('0x0'));var zipdir=require(_0xbdb8('0x1'));var jsonpatch=require(_0xbdb8('0x2'));var rp=require(_0xbdb8('0x3'));var moment=require(_0xbdb8('0x4'));var BPromise=require(_0xbdb8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbdb8('0x6'));var sox=require(_0xbdb8('0x7'));var csv=require(_0xbdb8('0x8'));var ejs=require(_0xbdb8('0x9'));var fs=require('fs');var fs_extra=require(_0xbdb8('0xa'));var _=require(_0xbdb8('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdb8('0xc'));var toCsv=require(_0xbdb8('0x8'));var querystring=require('querystring');var Papa=require(_0xbdb8('0xd'));var Redis=require(_0xbdb8('0xe'));var authService=require(_0xbdb8('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdb8('0x10'))('api');var utils=require(_0xbdb8('0x11'));var config=require(_0xbdb8('0x12'));var licenseUtil=require(_0xbdb8('0x13'));var db=require(_0xbdb8('0x14'))['db'];function respondWithStatusCode(_0x2b15ed,_0x2441ba){_0x2441ba=_0x2441ba||0xcc;return function(_0x187eaa){if(_0x187eaa){return _0x2b15ed[_0xbdb8('0x15')](_0x2441ba);}return _0x2b15ed['status'](_0x2441ba)[_0xbdb8('0x16')]();};}function respondWithResult(_0x417ef0,_0x4c1a72){_0x4c1a72=_0x4c1a72||0xc8;return function(_0x1f2cfd){if(_0x1f2cfd){return _0x417ef0['status'](_0x4c1a72)['json'](_0x1f2cfd);}};}function respondWithFilteredResult(_0x15977e,_0x5d74a2){return function(_0x560172){if(_0x560172){var _0x29a34c=typeof _0x5d74a2['offset']===_0xbdb8('0x17')&&typeof _0x5d74a2[_0xbdb8('0x18')]==='undefined';var _0x550ce8=_0x560172[_0xbdb8('0x19')];var _0x9fe077=_0x29a34c?0x0:_0x5d74a2['offset'];var _0x155c9b=_0x29a34c?_0x560172[_0xbdb8('0x19')]:_0x5d74a2['offset']+_0x5d74a2[_0xbdb8('0x18')];var _0x4e2780;if(_0x155c9b>=_0x550ce8){_0x155c9b=_0x550ce8;_0x4e2780=0xc8;}else{_0x4e2780=0xce;}_0x15977e[_0xbdb8('0x1a')](_0x4e2780);return _0x15977e['set'](_0xbdb8('0x1b'),_0x9fe077+'-'+_0x155c9b+'/'+_0x550ce8)['json'](_0x560172);}return null;};}function patchUpdates(_0x4a59f5){return function(_0x4fc34c){try{jsonpatch[_0xbdb8('0x1c')](_0x4fc34c,_0x4a59f5,!![]);}catch(_0x1b4ed2){return BPromise[_0xbdb8('0x1d')](_0x1b4ed2);}return _0x4fc34c['save']();};}function saveUpdates(_0x5575ff,_0x311637){return function(_0x8bcc6e){if(_0x8bcc6e){return _0x8bcc6e[_0xbdb8('0x1e')](_0x5575ff)[_0xbdb8('0x1f')](function(_0x40bada){return _0x40bada;});}return null;};}function removeEntity(_0x5e1bee,_0x34d1da){return function(_0x91f709){if(_0x91f709){return _0x91f709['destroy']()[_0xbdb8('0x1f')](function(){var _0x212134=_0x91f709[_0xbdb8('0x20')]({'plain':!![]});var _0x2f4dd0='Sounds';return db[_0xbdb8('0x21')][_0xbdb8('0x22')]({'where':{'type':_0x2f4dd0,'resourceId':_0x212134['id']}})['then'](function(){return _0x91f709;});})['then'](function(){_0x5e1bee[_0xbdb8('0x1a')](0xcc)[_0xbdb8('0x16')]();});}};}function handleEntityNotFound(_0x5d452a,_0x440588){return function(_0x1bc9ec){if(!_0x1bc9ec){_0x5d452a[_0xbdb8('0x15')](0x194);}return _0x1bc9ec;};}function handleError(_0x3910bc,_0x4eb78){_0x4eb78=_0x4eb78||0x1f4;return function(_0x31d2ba){logger[_0xbdb8('0x23')](_0x31d2ba['stack']);if(_0x31d2ba[_0xbdb8('0x24')]){delete _0x31d2ba[_0xbdb8('0x24')];}_0x3910bc[_0xbdb8('0x1a')](_0x4eb78)[_0xbdb8('0x25')](_0x31d2ba);};}exports[_0xbdb8('0x26')]=function(_0x2e373f,_0x354407){var _0x720a31={},_0x3c41af={},_0x306df7={'count':0x0,'rows':[]};var _0x4965e9=_[_0xbdb8('0x27')](db['Sound'][_0xbdb8('0x28')],function(_0x22bf7d){return{'name':_0x22bf7d[_0xbdb8('0x29')],'type':_0x22bf7d[_0xbdb8('0x2a')][_0xbdb8('0x2b')]};});_0x3c41af['model']=_['map'](_0x4965e9,_0xbdb8('0x24'));_0x3c41af['query']=_[_0xbdb8('0x2c')](_0x2e373f[_0xbdb8('0x2d')]);_0x3c41af[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x3c41af[_0xbdb8('0x30')],_0x3c41af[_0xbdb8('0x2d')]);_0x720a31['attributes']=_[_0xbdb8('0x2f')](_0x3c41af[_0xbdb8('0x30')],qs['fields'](_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x31')]));_0x720a31[_0xbdb8('0x32')]=_0x720a31[_0xbdb8('0x32')][_0xbdb8('0x33')]?_0x720a31[_0xbdb8('0x32')]:_0x3c41af[_0xbdb8('0x30')];if(!_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x34')](_0xbdb8('0x35'))){_0x720a31[_0xbdb8('0x18')]=qs[_0xbdb8('0x18')](_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x18')]);_0x720a31[_0xbdb8('0x36')]=qs[_0xbdb8('0x36')](_0x2e373f['query'][_0xbdb8('0x36')]);}_0x720a31['order']=qs[_0xbdb8('0x37')](_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x37')]);_0x720a31[_0xbdb8('0x38')]=qs[_0xbdb8('0x2e')](_['pick'](_0x2e373f[_0xbdb8('0x2d')],_0x3c41af[_0xbdb8('0x2e')]),_0x4965e9);if(_0x2e373f['query'][_0xbdb8('0x39')]){_0x720a31[_0xbdb8('0x38')]=_[_0xbdb8('0x3a')](_0x720a31[_0xbdb8('0x38')],{'$or':_[_0xbdb8('0x27')](_0x4965e9,function(_0x46d6b6){if(_0x46d6b6[_0xbdb8('0x2a')]!==_0xbdb8('0x3b')){var _0x179867={};_0x179867[_0x46d6b6[_0xbdb8('0x24')]]={'$like':'%'+_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x39')]+'%'};return _0x179867;}})});}_0x720a31=_[_0xbdb8('0x3a')]({},_0x720a31,_0x2e373f[_0xbdb8('0x3c')]);var _0x331b9a={'where':_0x720a31['where']};return db['Sound']['count'](_0x331b9a)[_0xbdb8('0x1f')](function(_0x57258b){_0x306df7[_0xbdb8('0x19')]=_0x57258b;if(_0x2e373f[_0xbdb8('0x2d')][_0xbdb8('0x3d')]){_0x720a31[_0xbdb8('0x3e')]=[{'all':!![]}];}return db[_0xbdb8('0x3f')][_0xbdb8('0x40')](_0x720a31);})[_0xbdb8('0x1f')](function(_0x4083aa){_0x306df7[_0xbdb8('0x41')]=_0x4083aa;return _0x306df7;})[_0xbdb8('0x1f')](respondWithFilteredResult(_0x354407,_0x720a31))[_0xbdb8('0x42')](handleError(_0x354407,null));};exports[_0xbdb8('0x43')]=function(_0x322638,_0x2bb7aa){var _0x1fb376={'raw':!![],'where':{'id':_0x322638[_0xbdb8('0x44')]['id']}},_0x5a7bd8={};_0x5a7bd8['model']=_['keys'](db[_0xbdb8('0x3f')][_0xbdb8('0x28')]);_0x5a7bd8[_0xbdb8('0x2d')]=_['keys'](_0x322638['query']);_0x5a7bd8[_0xbdb8('0x2e')]=_[_0xbdb8('0x2f')](_0x5a7bd8[_0xbdb8('0x30')],_0x5a7bd8['query']);_0x1fb376['attributes']=_[_0xbdb8('0x2f')](_0x5a7bd8[_0xbdb8('0x30')],qs['fields'](_0x322638[_0xbdb8('0x2d')][_0xbdb8('0x31')]));_0x1fb376['attributes']=_0x1fb376['attributes'][_0xbdb8('0x33')]?_0x1fb376[_0xbdb8('0x32')]:_0x5a7bd8[_0xbdb8('0x30')];if(_0x322638[_0xbdb8('0x2d')][_0xbdb8('0x3d')]){_0x1fb376[_0xbdb8('0x3e')]=[{'all':!![]}];}_0x1fb376=_['merge']({},_0x1fb376,_0x322638[_0xbdb8('0x3c')]);return db[_0xbdb8('0x3f')][_0xbdb8('0x45')](_0x1fb376)[_0xbdb8('0x1f')](handleEntityNotFound(_0x2bb7aa,null))[_0xbdb8('0x1f')](respondWithResult(_0x2bb7aa,null))[_0xbdb8('0x42')](handleError(_0x2bb7aa,null));};exports[_0xbdb8('0x46')]=function(_0x4aaa7b,_0xd4c6c8,_0x83e759){return db[_0xbdb8('0x3f')][_0xbdb8('0x45')]({'where':{'id':_0x4aaa7b[_0xbdb8('0x44')]['id']},'attributes':[_0xbdb8('0x24'),_0xbdb8('0x47'),_0xbdb8('0x48')],'raw':!![]})[_0xbdb8('0x1f')](handleEntityNotFound(_0xd4c6c8,null))[_0xbdb8('0x1f')](function(_0x3c7cc5){if(_0x3c7cc5){if(!fs[_0xbdb8('0x49')](path['join'](config[_0xbdb8('0x4a')],_0xbdb8('0x4b'),_0x3c7cc5['save_name']+'.'+_0x3c7cc5[_0xbdb8('0x48')]))){throw new db[(_0xbdb8('0x4c'))][(_0xbdb8('0x4d'))]('Sound\x20not\x20found');}return _0xd4c6c8[_0xbdb8('0x46')](path[_0xbdb8('0x4e')](config[_0xbdb8('0x4a')],'server/files/sounds/converted',util[_0xbdb8('0x4f')](_0xbdb8('0x50'),_0x3c7cc5[_0xbdb8('0x47')],_0x3c7cc5[_0xbdb8('0x48')])),util[_0xbdb8('0x4f')]('%s.%s',_0x3c7cc5[_0xbdb8('0x24')],_0x3c7cc5['converted_format']));}return null;})['catch'](handleError(_0xd4c6c8,null));};exports[_0xbdb8('0x51')]=function(_0x47c15e,_0x5f50b3,_0xe19aa8){var _0x1f27c2={'name':path[_0xbdb8('0x52')](_0x47c15e['file'][_0xbdb8('0x53')],path['extname'](_0x47c15e[_0xbdb8('0x54')]['originalname'])),'save_name':path['basename'](_0x47c15e[_0xbdb8('0x54')]['filename'],path['extname'](_0x47c15e[_0xbdb8('0x54')][_0xbdb8('0x55')])),'original_format':path['extname'](_0x47c15e[_0xbdb8('0x54')][_0xbdb8('0x53')])[_0xbdb8('0x56')](0x1),'converted_format':_0xbdb8('0x57')};var _0x584ad4=path['join'](config[_0xbdb8('0x4a')],_0xbdb8('0x58'),_0x47c15e[_0xbdb8('0x54')][_0xbdb8('0x55')]);var _0x1158ea=path[_0xbdb8('0x4e')](config[_0xbdb8('0x4a')],_0xbdb8('0x4b'),util[_0xbdb8('0x4f')](_0xbdb8('0x50'),path[_0xbdb8('0x52')](_0x47c15e[_0xbdb8('0x54')][_0xbdb8('0x55')],path['extname'](_0x47c15e['file'][_0xbdb8('0x55')])),_0x1f27c2[_0xbdb8('0x48')]));logger[_0xbdb8('0x59')](_0xbdb8('0x5a'),_0x584ad4);logger[_0xbdb8('0x59')]('Sound\x20upload\x20destination:\x20%s',_0x1158ea);try{fs[_0xbdb8('0x5b')](_0x584ad4,parseInt(_0xbdb8('0x5c'),0x8));var _0x48da5b=sox[_0xbdb8('0x5d')](_0x584ad4,_0x1158ea,{'sampleRate':0x1f40,'format':_0xbdb8('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x48da5b['on'](_0xbdb8('0x23'),function(_0x598096){fs[_0xbdb8('0x5e')](_0x584ad4);_0x5f50b3[_0xbdb8('0x1a')](0x1f4)['send'](_0x598096);});_0x48da5b['on']('src',function(_0x55f6d4){_0x1f27c2[_0xbdb8('0x5f')]=isNaN(_0x55f6d4[_0xbdb8('0x60')])?null:_0x55f6d4[_0xbdb8('0x60')]*0x3e8;_0x1f27c2[_0xbdb8('0x61')]=isNaN(_0x55f6d4[_0xbdb8('0x62')])?null:_0x55f6d4[_0xbdb8('0x62')];_0x1f27c2['original_channelCount']=isNaN(_0x55f6d4[_0xbdb8('0x63')])?null:_0x55f6d4['channelCount'];_0x1f27c2[_0xbdb8('0x64')]=isNaN(_0x55f6d4[_0xbdb8('0x65')])?null:_0x55f6d4[_0xbdb8('0x65')];_0x1f27c2[_0xbdb8('0x66')]=isNaN(_0x55f6d4[_0xbdb8('0x67')])?null:_0x55f6d4[_0xbdb8('0x67')];});_0x48da5b['on'](_0xbdb8('0x68'),function(_0x55c2f6){_0x1f27c2[_0xbdb8('0x69')]=isNaN(_0x55c2f6[_0xbdb8('0x60')])?null:_0x55c2f6[_0xbdb8('0x60')]*0x3e8;_0x1f27c2[_0xbdb8('0x6a')]=isNaN(_0x55c2f6[_0xbdb8('0x62')])?null:_0x55c2f6[_0xbdb8('0x62')];_0x1f27c2[_0xbdb8('0x6b')]=isNaN(_0x55c2f6[_0xbdb8('0x63')])?null:_0x55c2f6[_0xbdb8('0x63')];_0x1f27c2[_0xbdb8('0x6c')]=isNaN(_0x55c2f6['bitRate'])?null:_0x55c2f6['bitRate'];_0x1f27c2[_0xbdb8('0x6d')]=isNaN(_0x55c2f6[_0xbdb8('0x67')])?null:_0x55c2f6[_0xbdb8('0x67')];});_0x48da5b['on']('end',function(){fs['chmodSync'](_0x1158ea,parseInt(_0xbdb8('0x5c'),0x8));return db[_0xbdb8('0x3f')][_0xbdb8('0x51')](_0x1f27c2)[_0xbdb8('0x1f')](function(_0x3e29c0){var _0x54092a={'role':_0x47c15e[_0xbdb8('0x6e')][_0xbdb8('0x6f')],'userProfileId':_0x47c15e[_0xbdb8('0x6e')]['userProfileId']};if(!_0x54092a)throw new Error(_0xbdb8('0x70'));if(_0x54092a['role']===_0xbdb8('0x71')){var _0x5b49ca=_0x3e29c0[_0xbdb8('0x20')]({'plain':!![]});return db[_0xbdb8('0x72')][_0xbdb8('0x45')]({'where':{'name':_0xbdb8('0x73'),'userProfileId':_0x54092a[_0xbdb8('0x74')]},'raw':!![]})[_0xbdb8('0x1f')](function(_0x160698){if(_0x160698&&_0x160698[_0xbdb8('0x75')]===0x0){return db[_0xbdb8('0x21')][_0xbdb8('0x51')]({'name':_0x5b49ca[_0xbdb8('0x24')],'resourceId':_0x5b49ca['id'],'type':_0x160698[_0xbdb8('0x24')],'sectionId':_0x160698['id']},{})[_0xbdb8('0x1f')](function(){return _0x3e29c0;});}else{return _0x3e29c0;}})[_0xbdb8('0x42')](function(_0x2883c1){logger[_0xbdb8('0x23')](_0xbdb8('0x76'),_0x2883c1);throw _0x2883c1;});}return _0x3e29c0;})['then'](respondWithResult(_0x5f50b3,null))['catch'](handleError(_0x5f50b3,null));});_0x48da5b[_0xbdb8('0x77')]();}catch(_0x2c7827){_0x5f50b3[_0xbdb8('0x1a')](0x1f4)[_0xbdb8('0x25')](_0x2c7827);}};exports[_0xbdb8('0x1e')]=function(_0xb10b07,_0x4d5489,_0x58c59d){return db[_0xbdb8('0x3f')]['find']({'where':{'id':_0xb10b07[_0xbdb8('0x44')]['id']}})[_0xbdb8('0x1f')](handleEntityNotFound(_0x4d5489,null))[_0xbdb8('0x1f')](saveUpdates(_[_0xbdb8('0x78')](_0xb10b07[_0xbdb8('0x6e')],['name',_0xbdb8('0x79')]),null))[_0xbdb8('0x1f')](respondWithResult(_0x4d5489,null))[_0xbdb8('0x42')](handleError(_0x4d5489,null));};exports[_0xbdb8('0x7a')]=function(_0x24bb66,_0x57cbd7,_0x131fc0){return db['Sound'][_0xbdb8('0x45')]({'where':{'id':_0x24bb66[_0xbdb8('0x44')]['id']}})[_0xbdb8('0x1f')](function(_0x36149f){if(_0x36149f){return _0x36149f[_0xbdb8('0x22')]();}})[_0xbdb8('0x1f')](function(_0x598513){var _0x235ca0=path['join'](config['root'],'server/files/sounds/original',util[_0xbdb8('0x4f')](_0xbdb8('0x50'),_0x598513[_0xbdb8('0x47')],_0x598513[_0xbdb8('0x7b')]));var _0x5528fc=path[_0xbdb8('0x4e')](config['root'],_0xbdb8('0x4b'),util[_0xbdb8('0x4f')](_0xbdb8('0x50'),_0x598513['save_name'],_0x598513[_0xbdb8('0x48')]));fs[_0xbdb8('0x5e')](_0x235ca0);fs[_0xbdb8('0x5e')](_0x5528fc);return _0x598513;})[_0xbdb8('0x1f')](function(_0x210520){if(_0x210520){return _0x57cbd7[_0xbdb8('0x1a')](0xcc)[_0xbdb8('0x16')]();}})['then'](handleEntityNotFound(_0x57cbd7,null))[_0xbdb8('0x42')](handleError(_0x57cbd7,null));}; \ No newline at end of file +var _0x8437=['original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','rimraf','fast-json-patch','request-promise','bluebird','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','index','map','Sound','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','send','src'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8437,0x119));var _0x7843=function(_0xc136d4,_0x4cf91f){_0xc136d4=_0xc136d4-0x0;var _0x49b6ee=_0x8437[_0xc136d4];return _0x49b6ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7843('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7843('0x1'));var rp=require(_0x7843('0x2'));var moment=require('moment');var BPromise=require(_0x7843('0x3'));var Mustache=require(_0x7843('0x4'));var util=require(_0x7843('0x5'));var path=require(_0x7843('0x6'));var sox=require(_0x7843('0x7'));var csv=require(_0x7843('0x8'));var ejs=require(_0x7843('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7843('0xa'));var squel=require(_0x7843('0xb'));var crypto=require('crypto');var jsforce=require(_0x7843('0xc'));var deskjs=require(_0x7843('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7843('0xe'));var Papa=require(_0x7843('0xf'));var Redis=require(_0x7843('0x10'));var authService=require(_0x7843('0x11'));var qs=require(_0x7843('0x12'));var as=require(_0x7843('0x13'));var hardwareService=require(_0x7843('0x14'));var logger=require('../../config/logger')(_0x7843('0x15'));var utils=require('../../config/utils');var config=require(_0x7843('0x16'));var licenseUtil=require(_0x7843('0x17'));var db=require(_0x7843('0x18'))['db'];function respondWithStatusCode(_0x17c9c2,_0x2c7013){_0x2c7013=_0x2c7013||0xcc;return function(_0x122470){if(_0x122470){return _0x17c9c2[_0x7843('0x19')](_0x2c7013);}return _0x17c9c2['status'](_0x2c7013)[_0x7843('0x1a')]();};}function respondWithResult(_0x2ea18e,_0x5249ff){_0x5249ff=_0x5249ff||0xc8;return function(_0x32046e){if(_0x32046e){return _0x2ea18e['status'](_0x5249ff)['json'](_0x32046e);}};}function respondWithFilteredResult(_0x46899c,_0x4654c0){return function(_0xa586ab){if(_0xa586ab){var _0x54a06c=typeof _0x4654c0['offset']===_0x7843('0x1b')&&typeof _0x4654c0[_0x7843('0x1c')]==='undefined';var _0x551d3c=_0xa586ab[_0x7843('0x1d')];var _0x4710df=_0x54a06c?0x0:_0x4654c0[_0x7843('0x1e')];var _0x3768ec=_0x54a06c?_0xa586ab[_0x7843('0x1d')]:_0x4654c0['offset']+_0x4654c0[_0x7843('0x1c')];var _0x969895;if(_0x3768ec>=_0x551d3c){_0x3768ec=_0x551d3c;_0x969895=0xc8;}else{_0x969895=0xce;}_0x46899c[_0x7843('0x1f')](_0x969895);return _0x46899c[_0x7843('0x20')](_0x7843('0x21'),_0x4710df+'-'+_0x3768ec+'/'+_0x551d3c)[_0x7843('0x22')](_0xa586ab);}return null;};}function patchUpdates(_0x4198d1){return function(_0x331281){try{jsonpatch[_0x7843('0x23')](_0x331281,_0x4198d1,!![]);}catch(_0x3df5a3){return BPromise[_0x7843('0x24')](_0x3df5a3);}return _0x331281[_0x7843('0x25')]();};}function saveUpdates(_0x4550a0,_0x10002a){return function(_0x4b1d99){if(_0x4b1d99){return _0x4b1d99[_0x7843('0x26')](_0x4550a0)[_0x7843('0x27')](function(_0x52cea3){return _0x52cea3;});}return null;};}function removeEntity(_0x343f47,_0x31249e){return function(_0x91d59a){if(_0x91d59a){return _0x91d59a[_0x7843('0x28')]()[_0x7843('0x27')](function(){var _0x48151a=_0x91d59a[_0x7843('0x29')]({'plain':!![]});var _0x305f46='Sounds';return db[_0x7843('0x2a')]['destroy']({'where':{'type':_0x305f46,'resourceId':_0x48151a['id']}})[_0x7843('0x27')](function(){return _0x91d59a;});})[_0x7843('0x27')](function(){_0x343f47[_0x7843('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48171d,_0x75b714){return function(_0x1bc4b5){if(!_0x1bc4b5){_0x48171d[_0x7843('0x19')](0x194);}return _0x1bc4b5;};}function handleError(_0x2bdea9,_0x591a7f){_0x591a7f=_0x591a7f||0x1f4;return function(_0x45fe7c){logger['error'](_0x45fe7c[_0x7843('0x2b')]);if(_0x45fe7c['name']){delete _0x45fe7c[_0x7843('0x2c')];}_0x2bdea9['status'](_0x591a7f)['send'](_0x45fe7c);};}exports[_0x7843('0x2d')]=function(_0x553c5d,_0x23c19a){var _0x305690={},_0xc2e6cf={},_0x70e503={'count':0x0,'rows':[]};var _0x5d2d85=_[_0x7843('0x2e')](db[_0x7843('0x2f')][_0x7843('0x30')],function(_0x576a70){return{'name':_0x576a70[_0x7843('0x31')],'type':_0x576a70[_0x7843('0x32')][_0x7843('0x33')]};});_0xc2e6cf['model']=_[_0x7843('0x2e')](_0x5d2d85,_0x7843('0x2c'));_0xc2e6cf[_0x7843('0x34')]=_[_0x7843('0x35')](_0x553c5d[_0x7843('0x34')]);_0xc2e6cf[_0x7843('0x36')]=_[_0x7843('0x37')](_0xc2e6cf[_0x7843('0x38')],_0xc2e6cf[_0x7843('0x34')]);_0x305690[_0x7843('0x39')]=_[_0x7843('0x37')](_0xc2e6cf[_0x7843('0x38')],qs[_0x7843('0x3a')](_0x553c5d[_0x7843('0x34')][_0x7843('0x3a')]));_0x305690['attributes']=_0x305690[_0x7843('0x39')][_0x7843('0x3b')]?_0x305690[_0x7843('0x39')]:_0xc2e6cf[_0x7843('0x38')];if(!_0x553c5d[_0x7843('0x34')][_0x7843('0x3c')]('nolimit')){_0x305690[_0x7843('0x1c')]=qs[_0x7843('0x1c')](_0x553c5d[_0x7843('0x34')][_0x7843('0x1c')]);_0x305690[_0x7843('0x1e')]=qs[_0x7843('0x1e')](_0x553c5d[_0x7843('0x34')][_0x7843('0x1e')]);}_0x305690[_0x7843('0x3d')]=qs[_0x7843('0x3e')](_0x553c5d[_0x7843('0x34')][_0x7843('0x3e')]);_0x305690[_0x7843('0x3f')]=qs[_0x7843('0x36')](_[_0x7843('0x40')](_0x553c5d[_0x7843('0x34')],_0xc2e6cf['filters']),_0x5d2d85);if(_0x553c5d['query'][_0x7843('0x41')]){_0x305690[_0x7843('0x3f')]=_[_0x7843('0x42')](_0x305690['where'],{'$or':_[_0x7843('0x2e')](_0x5d2d85,function(_0x50802d){if(_0x50802d[_0x7843('0x32')]!==_0x7843('0x43')){var _0x58871c={};_0x58871c[_0x50802d['name']]={'$like':'%'+_0x553c5d['query']['filter']+'%'};return _0x58871c;}})});}_0x305690=_[_0x7843('0x42')]({},_0x305690,_0x553c5d[_0x7843('0x44')]);var _0x24b11d={'where':_0x305690[_0x7843('0x3f')]};return db[_0x7843('0x2f')]['count'](_0x24b11d)[_0x7843('0x27')](function(_0x5d0fbc){_0x70e503[_0x7843('0x1d')]=_0x5d0fbc;if(_0x553c5d[_0x7843('0x34')]['includeAll']){_0x305690[_0x7843('0x45')]=[{'all':!![]}];}return db[_0x7843('0x2f')][_0x7843('0x46')](_0x305690);})[_0x7843('0x27')](function(_0x4c2e6e){_0x70e503[_0x7843('0x47')]=_0x4c2e6e;return _0x70e503;})[_0x7843('0x27')](respondWithFilteredResult(_0x23c19a,_0x305690))[_0x7843('0x48')](handleError(_0x23c19a,null));};exports[_0x7843('0x49')]=function(_0x26daf2,_0x669949){var _0xbc46e1={'raw':!![],'where':{'id':_0x26daf2[_0x7843('0x4a')]['id']}},_0x5a12c6={};_0x5a12c6[_0x7843('0x38')]=_[_0x7843('0x35')](db['Sound'][_0x7843('0x30')]);_0x5a12c6['query']=_[_0x7843('0x35')](_0x26daf2[_0x7843('0x34')]);_0x5a12c6['filters']=_[_0x7843('0x37')](_0x5a12c6['model'],_0x5a12c6[_0x7843('0x34')]);_0xbc46e1[_0x7843('0x39')]=_[_0x7843('0x37')](_0x5a12c6['model'],qs[_0x7843('0x3a')](_0x26daf2['query'][_0x7843('0x3a')]));_0xbc46e1[_0x7843('0x39')]=_0xbc46e1[_0x7843('0x39')][_0x7843('0x3b')]?_0xbc46e1[_0x7843('0x39')]:_0x5a12c6[_0x7843('0x38')];if(_0x26daf2[_0x7843('0x34')][_0x7843('0x4b')]){_0xbc46e1[_0x7843('0x45')]=[{'all':!![]}];}_0xbc46e1=_[_0x7843('0x42')]({},_0xbc46e1,_0x26daf2[_0x7843('0x44')]);return db['Sound'][_0x7843('0x4c')](_0xbc46e1)[_0x7843('0x27')](handleEntityNotFound(_0x669949,null))['then'](respondWithResult(_0x669949,null))[_0x7843('0x48')](handleError(_0x669949,null));};exports[_0x7843('0x4d')]=function(_0x2c6dfd,_0x4e3cca,_0x4f146c){return db[_0x7843('0x2f')][_0x7843('0x4c')]({'where':{'id':_0x2c6dfd[_0x7843('0x4a')]['id']},'attributes':[_0x7843('0x2c'),_0x7843('0x4e'),_0x7843('0x4f')],'raw':!![]})[_0x7843('0x27')](handleEntityNotFound(_0x4e3cca,null))[_0x7843('0x27')](function(_0x1f73a){if(_0x1f73a){if(!fs[_0x7843('0x50')](path[_0x7843('0x51')](config[_0x7843('0x52')],_0x7843('0x53'),_0x1f73a[_0x7843('0x4e')]+'.'+_0x1f73a[_0x7843('0x4f')]))){throw new db[(_0x7843('0x54'))][(_0x7843('0x55'))](_0x7843('0x56'));}return _0x4e3cca['download'](path[_0x7843('0x51')](config['root'],_0x7843('0x53'),util[_0x7843('0x57')](_0x7843('0x58'),_0x1f73a[_0x7843('0x4e')],_0x1f73a[_0x7843('0x4f')])),util[_0x7843('0x57')]('%s.%s',_0x1f73a['name'],_0x1f73a['converted_format']));}return null;})[_0x7843('0x48')](handleError(_0x4e3cca,null));};exports[_0x7843('0x59')]=function(_0x2fd655,_0x165157,_0x4805e2){var _0x438242={'name':path[_0x7843('0x5a')](_0x2fd655['file'][_0x7843('0x5b')],path[_0x7843('0x5c')](_0x2fd655[_0x7843('0x5d')][_0x7843('0x5b')])),'save_name':path['basename'](_0x2fd655[_0x7843('0x5d')][_0x7843('0x5e')],path[_0x7843('0x5c')](_0x2fd655[_0x7843('0x5d')]['filename'])),'original_format':path['extname'](_0x2fd655[_0x7843('0x5d')][_0x7843('0x5b')])[_0x7843('0x5f')](0x1),'converted_format':_0x7843('0x60')};var _0x16887c=path[_0x7843('0x51')](config[_0x7843('0x52')],_0x7843('0x61'),_0x2fd655[_0x7843('0x5d')]['filename']);var _0x5b5522=path['join'](config[_0x7843('0x52')],_0x7843('0x53'),util[_0x7843('0x57')](_0x7843('0x58'),path[_0x7843('0x5a')](_0x2fd655[_0x7843('0x5d')][_0x7843('0x5e')],path[_0x7843('0x5c')](_0x2fd655[_0x7843('0x5d')][_0x7843('0x5e')])),_0x438242['converted_format']));logger[_0x7843('0x62')](_0x7843('0x63'),_0x16887c);logger[_0x7843('0x62')](_0x7843('0x64'),_0x5b5522);try{fs[_0x7843('0x65')](_0x16887c,parseInt('0777',0x8));var _0x35d4c8=sox[_0x7843('0x66')](_0x16887c,_0x5b5522,{'sampleRate':0x1f40,'format':_0x7843('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35d4c8['on']('error',function(_0x4db722){fs[_0x7843('0x67')](_0x16887c);_0x165157[_0x7843('0x1f')](0x1f4)[_0x7843('0x68')](_0x4db722);});_0x35d4c8['on'](_0x7843('0x69'),function(_0x1be3b3){_0x438242[_0x7843('0x6a')]=isNaN(_0x1be3b3[_0x7843('0x6b')])?null:_0x1be3b3['duration']*0x3e8;_0x438242[_0x7843('0x6c')]=isNaN(_0x1be3b3[_0x7843('0x6d')])?null:_0x1be3b3[_0x7843('0x6d')];_0x438242[_0x7843('0x6e')]=isNaN(_0x1be3b3[_0x7843('0x6f')])?null:_0x1be3b3[_0x7843('0x6f')];_0x438242[_0x7843('0x70')]=isNaN(_0x1be3b3[_0x7843('0x71')])?null:_0x1be3b3['bitRate'];_0x438242[_0x7843('0x72')]=isNaN(_0x1be3b3[_0x7843('0x73')])?null:_0x1be3b3['sampleRate'];});_0x35d4c8['on']('dest',function(_0x1625d1){_0x438242[_0x7843('0x74')]=isNaN(_0x1625d1[_0x7843('0x6b')])?null:_0x1625d1['duration']*0x3e8;_0x438242[_0x7843('0x75')]=isNaN(_0x1625d1[_0x7843('0x6d')])?null:_0x1625d1[_0x7843('0x6d')];_0x438242[_0x7843('0x76')]=isNaN(_0x1625d1[_0x7843('0x6f')])?null:_0x1625d1[_0x7843('0x6f')];_0x438242['converted_bitRate']=isNaN(_0x1625d1[_0x7843('0x71')])?null:_0x1625d1[_0x7843('0x71')];_0x438242[_0x7843('0x77')]=isNaN(_0x1625d1[_0x7843('0x73')])?null:_0x1625d1[_0x7843('0x73')];});_0x35d4c8['on']('end',function(){fs[_0x7843('0x65')](_0x5b5522,parseInt('0777',0x8));return db[_0x7843('0x2f')][_0x7843('0x59')](_0x438242)[_0x7843('0x27')](function(_0x2e5fee){var _0x30006e={'role':_0x2fd655[_0x7843('0x78')][_0x7843('0x79')],'userProfileId':_0x2fd655[_0x7843('0x78')]['userProfileId']};if(!_0x30006e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30006e[_0x7843('0x79')]===_0x7843('0x7a')){var _0x255707=_0x2e5fee[_0x7843('0x29')]({'plain':!![]});return db[_0x7843('0x7b')][_0x7843('0x4c')]({'where':{'name':'Sounds','userProfileId':_0x30006e[_0x7843('0x7c')]},'raw':!![]})['then'](function(_0x91299f){if(_0x91299f&&_0x91299f[_0x7843('0x7d')]===0x0){return db[_0x7843('0x2a')][_0x7843('0x59')]({'name':_0x255707[_0x7843('0x2c')],'resourceId':_0x255707['id'],'type':_0x91299f[_0x7843('0x2c')],'sectionId':_0x91299f['id']},{})['then'](function(){return _0x2e5fee;});}else{return _0x2e5fee;}})[_0x7843('0x48')](function(_0x433d42){logger[_0x7843('0x7e')](_0x7843('0x7f'),_0x433d42);throw _0x433d42;});}return _0x2e5fee;})[_0x7843('0x27')](respondWithResult(_0x165157,null))['catch'](handleError(_0x165157,null));});_0x35d4c8[_0x7843('0x80')]();}catch(_0xef6c74){_0x165157['status'](0x1f4)['send'](_0xef6c74);}};exports[_0x7843('0x26')]=function(_0x5cfda0,_0x3a6904,_0xd38cac){return db[_0x7843('0x2f')]['find']({'where':{'id':_0x5cfda0[_0x7843('0x4a')]['id']}})[_0x7843('0x27')](handleEntityNotFound(_0x3a6904,null))[_0x7843('0x27')](saveUpdates(_['pick'](_0x5cfda0['body'],['name','description']),null))[_0x7843('0x27')](respondWithResult(_0x3a6904,null))[_0x7843('0x48')](handleError(_0x3a6904,null));};exports['delete']=function(_0x3cab76,_0x4f0567,_0x157658){return db[_0x7843('0x2f')][_0x7843('0x4c')]({'where':{'id':_0x3cab76[_0x7843('0x4a')]['id']}})[_0x7843('0x27')](function(_0x14c308){if(_0x14c308){return _0x14c308[_0x7843('0x28')]();}})[_0x7843('0x27')](function(_0x3e3f34){var _0x343f32=path['join'](config[_0x7843('0x52')],'server/files/sounds/original',util[_0x7843('0x57')]('%s.%s',_0x3e3f34[_0x7843('0x4e')],_0x3e3f34['original_format']));var _0x417508=path[_0x7843('0x51')](config['root'],'server/files/sounds/converted',util['format'](_0x7843('0x58'),_0x3e3f34[_0x7843('0x4e')],_0x3e3f34[_0x7843('0x4f')]));fs[_0x7843('0x67')](_0x343f32);fs[_0x7843('0x67')](_0x417508);return _0x3e3f34;})['then'](function(_0x4875a5){if(_0x4875a5){return _0x4f0567['status'](0xcc)[_0x7843('0x1a')]();}})[_0x7843('0x27')](handleEntityNotFound(_0x4f0567,null))['catch'](handleError(_0x4f0567,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index fe813a9..4ea825c 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 _0x64b1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds'];(function(_0x20025e,_0x44c8e1){var _0x4a5ac4=function(_0x359a69){while(--_0x359a69){_0x20025e['push'](_0x20025e['shift']());}};_0x4a5ac4(++_0x44c8e1);}(_0x64b1,0x1ce));var _0x164b=function(_0x961160,_0x183ca5){_0x961160=_0x961160-0x0;var _0x21a66b=_0x64b1[_0x961160];return _0x21a66b;};'use strict';var _=require(_0x164b('0x0'));var util=require(_0x164b('0x1'));var logger=require(_0x164b('0x2'))(_0x164b('0x3'));var moment=require(_0x164b('0x4'));var BPromise=require(_0x164b('0x5'));var rp=require(_0x164b('0x6'));var fs=require('fs');var path=require(_0x164b('0x7'));var rimraf=require(_0x164b('0x8'));var config=require(_0x164b('0x9'));var attributes=require(_0x164b('0xa'));module[_0x164b('0xb')]=function(_0x538681,_0x3e8ab8){return _0x538681[_0x164b('0xc')]('Sound',attributes,{'tableName':_0x164b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc991=['moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','tools_sounds','../../config/logger','api'];(function(_0x3b4493,_0x106e71){var _0x28fc72=function(_0x1c6ec5){while(--_0x1c6ec5){_0x3b4493['push'](_0x3b4493['shift']());}};_0x28fc72(++_0x106e71);}(_0xc991,0x1ed));var _0x1c99=function(_0x369d3e,_0x43476b){_0x369d3e=_0x369d3e-0x0;var _0x2dac71=_0xc991[_0x369d3e];return _0x2dac71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1c99('0x0'))(_0x1c99('0x1'));var moment=require(_0x1c99('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c99('0x3'));var fs=require('fs');var path=require(_0x1c99('0x4'));var rimraf=require(_0x1c99('0x5'));var config=require(_0x1c99('0x6'));var attributes=require(_0x1c99('0x7'));module[_0x1c99('0x8')]=function(_0x2aa2ce,_0x36fd5c){return _0x2aa2ce[_0x1c99('0x9')]('Sound',attributes,{'tableName':_0x1c99('0xa'),'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 b296558..bfeed43 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 _0xcbba=['Sound,\x20%s,\x20%s,\x20%s','stringify','error','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xcbba,0xdd));var _0xacbb=function(_0x48aa79,_0x328585){_0x48aa79=_0x48aa79-0x0;var _0x416d0c=_0xcbba[_0x48aa79];return _0x416d0c;};'use strict';var _=require(_0xacbb('0x0'));var util=require(_0xacbb('0x1'));var moment=require(_0xacbb('0x2'));var BPromise=require(_0xacbb('0x3'));var rs=require(_0xacbb('0x4'));var fs=require('fs');var Redis=require(_0xacbb('0x5'));var db=require(_0xacbb('0x6'))['db'];var utils=require(_0xacbb('0x7'));var logger=require(_0xacbb('0x8'))(_0xacbb('0x9'));var config=require('../../config/environment');var jayson=require(_0xacbb('0xa'));var client=jayson[_0xacbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc68606,_0x182e1b,_0x518a6e){return new BPromise(function(_0x5c7f24,_0x5235a4){return client[_0xacbb('0xc')](_0xc68606,_0x518a6e)[_0xacbb('0xd')](function(_0x38ce7f){logger[_0xacbb('0xe')]('Sound,\x20%s,\x20%s',_0x182e1b,_0xacbb('0xf'));logger[_0xacbb('0x10')](_0xacbb('0x11'),_0x182e1b,_0xacbb('0xf'),JSON[_0xacbb('0x12')](_0x38ce7f));if(_0x38ce7f[_0xacbb('0x13')]){if(_0x38ce7f[_0xacbb('0x13')]['code']===0x1f4){logger['error'](_0xacbb('0x14'),_0x182e1b,_0x38ce7f[_0xacbb('0x13')][_0xacbb('0x15')]);return _0x5235a4(_0x38ce7f[_0xacbb('0x13')]['message']);}logger['error'](_0xacbb('0x14'),_0x182e1b,_0x38ce7f[_0xacbb('0x13')][_0xacbb('0x15')]);return _0x5c7f24(_0x38ce7f['error'][_0xacbb('0x15')]);}else{logger[_0xacbb('0xe')]('Sound,\x20%s,\x20%s',_0x182e1b,_0xacbb('0xf'));_0x5c7f24(_0x38ce7f[_0xacbb('0x16')][_0xacbb('0x15')]);}})[_0xacbb('0x17')](function(_0xb3b0e){logger['error'](_0xacbb('0x14'),_0x182e1b,_0xb3b0e);_0x5235a4(_0xb3b0e);});});}exports[_0xacbb('0x18')]=function(_0x2f6ee9){var _0x3a8336=this;return new Promise(function(_0x5c81fb,_0x3153f6){return db[_0xacbb('0x19')][_0xacbb('0x1a')]({'raw':_0x2f6ee9[_0xacbb('0x1b')]?_0x2f6ee9['options'][_0xacbb('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f6ee9['options']?_0x2f6ee9[_0xacbb('0x1b')][_0xacbb('0x1d')]||null:null,'attributes':_0x2f6ee9[_0xacbb('0x1b')]?_0x2f6ee9['options'][_0xacbb('0x1e')]||null:null,'include':_0x2f6ee9[_0xacbb('0x1b')]?_0x2f6ee9[_0xacbb('0x1b')][_0xacbb('0x1f')]?_['map'](_0x2f6ee9[_0xacbb('0x1b')][_0xacbb('0x1f')],function(_0xee7721){return{'model':db[_0xee7721['model']],'as':_0xee7721['as'],'attributes':_0xee7721[_0xacbb('0x1e')],'include':_0xee7721[_0xacbb('0x1f')]?_[_0xacbb('0x20')](_0xee7721[_0xacbb('0x1f')],function(_0x4cbb9a){return{'model':db[_0x4cbb9a['model']],'as':_0x4cbb9a['as'],'attributes':_0x4cbb9a[_0xacbb('0x1e')],'include':_0x4cbb9a[_0xacbb('0x1f')]?_[_0xacbb('0x20')](_0x4cbb9a['include'],function(_0x14738c){return{'model':db[_0x14738c[_0xacbb('0x21')]],'as':_0x14738c['as'],'attributes':_0x14738c[_0xacbb('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x379b37){logger[_0xacbb('0xe')](_0xacbb('0x18'),_0x2f6ee9);logger[_0xacbb('0x10')](_0xacbb('0x18'),_0x2f6ee9,JSON['stringify'](_0x379b37));_0x5c81fb(_0x379b37);})[_0xacbb('0x17')](function(_0x4c179a){logger['error']('ShowSound',_0x4c179a[_0xacbb('0x15')],_0x2f6ee9);_0x3153f6(_0x3a8336[_0xacbb('0x13')](0x1f4,_0x4c179a[_0xacbb('0x15')]));});});}; \ No newline at end of file +var _0xfcaf=['debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','stringify','error','Sound,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowSound','Sound','find','options','raw','where','attributes','map','model','include'];(function(_0x578b69,_0x5c51bd){var _0x530e1e=function(_0x28cceb){while(--_0x28cceb){_0x578b69['push'](_0x578b69['shift']());}};_0x530e1e(++_0x5c51bd);}(_0xfcaf,0x7d));var _0xffca=function(_0x2eef8c,_0x15a03d){_0x2eef8c=_0x2eef8c-0x0;var _0x1bec99=_0xfcaf[_0x2eef8c];return _0x1bec99;};'use strict';var _=require('lodash');var util=require(_0xffca('0x0'));var moment=require('moment');var BPromise=require(_0xffca('0x1'));var rs=require(_0xffca('0x2'));var fs=require('fs');var Redis=require(_0xffca('0x3'));var db=require(_0xffca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xffca('0x5'))('rpc');var config=require(_0xffca('0x6'));var jayson=require(_0xffca('0x7'));var client=jayson[_0xffca('0x8')][_0xffca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2beded,_0x2e41fc,_0xf409b7){return new BPromise(function(_0x618d02,_0x163ab8){return client[_0xffca('0xa')](_0x2beded,_0xf409b7)[_0xffca('0xb')](function(_0x368412){logger[_0xffca('0xc')]('Sound,\x20%s,\x20%s',_0x2e41fc,'request\x20sent');logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x2e41fc,'request\x20sent',JSON[_0xffca('0xd')](_0x368412));if(_0x368412[_0xffca('0xe')]){if(_0x368412[_0xffca('0xe')]['code']===0x1f4){logger['error'](_0xffca('0xf'),_0x2e41fc,_0x368412[_0xffca('0xe')][_0xffca('0x10')]);return _0x163ab8(_0x368412[_0xffca('0xe')][_0xffca('0x10')]);}logger['error'](_0xffca('0xf'),_0x2e41fc,_0x368412['error'][_0xffca('0x10')]);return _0x618d02(_0x368412[_0xffca('0xe')]['message']);}else{logger['info'](_0xffca('0xf'),_0x2e41fc,_0xffca('0x11'));_0x618d02(_0x368412[_0xffca('0x12')][_0xffca('0x10')]);}})[_0xffca('0x13')](function(_0x5e8f4a){logger[_0xffca('0xe')](_0xffca('0xf'),_0x2e41fc,_0x5e8f4a);_0x163ab8(_0x5e8f4a);});});}exports[_0xffca('0x14')]=function(_0x3510ba){var _0xa3d807=this;return new Promise(function(_0x4d1280,_0x1da19c){return db[_0xffca('0x15')][_0xffca('0x16')]({'raw':_0x3510ba[_0xffca('0x17')]?_0x3510ba[_0xffca('0x17')][_0xffca('0x18')]===undefined?!![]:![]:!![],'where':_0x3510ba[_0xffca('0x17')]?_0x3510ba[_0xffca('0x17')][_0xffca('0x19')]||null:null,'attributes':_0x3510ba[_0xffca('0x17')]?_0x3510ba[_0xffca('0x17')][_0xffca('0x1a')]||null:null,'include':_0x3510ba['options']?_0x3510ba['options']['include']?_[_0xffca('0x1b')](_0x3510ba[_0xffca('0x17')]['include'],function(_0x6b0239){return{'model':db[_0x6b0239[_0xffca('0x1c')]],'as':_0x6b0239['as'],'attributes':_0x6b0239[_0xffca('0x1a')],'include':_0x6b0239[_0xffca('0x1d')]?_[_0xffca('0x1b')](_0x6b0239[_0xffca('0x1d')],function(_0x1e2d5f){return{'model':db[_0x1e2d5f[_0xffca('0x1c')]],'as':_0x1e2d5f['as'],'attributes':_0x1e2d5f[_0xffca('0x1a')],'include':_0x1e2d5f[_0xffca('0x1d')]?_[_0xffca('0x1b')](_0x1e2d5f[_0xffca('0x1d')],function(_0x352462){return{'model':db[_0x352462[_0xffca('0x1c')]],'as':_0x352462['as'],'attributes':_0x352462[_0xffca('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xffca('0xb')](function(_0x19b903){logger[_0xffca('0xc')]('ShowSound',_0x3510ba);logger[_0xffca('0x1e')](_0xffca('0x14'),_0x3510ba,JSON[_0xffca('0xd')](_0x19b903));_0x4d1280(_0x19b903);})['catch'](function(_0x44f483){logger[_0xffca('0xe')](_0xffca('0x14'),_0x44f483['message'],_0x3510ba);_0x1da19c(_0xa3d807[_0xffca('0xe')](0x1f4,_0x44f483['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index cfeba7d..2cae9be 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 _0x757a=['destroy','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x26553e,_0x12f73b){var _0x23cc0d=function(_0x207bc3){while(--_0x207bc3){_0x26553e['push'](_0x26553e['shift']());}};_0x23cc0d(++_0x12f73b);}(_0x757a,0xde));var _0xa757=function(_0x3c2fd8,_0x476f19){_0x3c2fd8=_0x3c2fd8-0x0;var _0x12272b=_0x757a[_0x3c2fd8];return _0x12272b;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0xb')]('/',auth[_0xa757('0x9')](),controller[_0xa757('0xc')]);router['put'](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);router[_0xa757('0xf')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0x10')]);module['exports']=router; \ No newline at end of file +var _0xbaf0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path'];(function(_0x1673f,_0x3e0c29){var _0x10ab63=function(_0x2c5ec8){while(--_0x2c5ec8){_0x1673f['push'](_0x1673f['shift']());}};_0x10ab63(++_0x3e0c29);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0xd')]('/',auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);module[_0x0baf('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e9afd41..4b12779 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 _0xde6c=['medium','ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x307086,_0x3bfe4e){var _0x699043=function(_0x1a7677){while(--_0x1a7677){_0x307086['push'](_0x307086['shift']());}};_0x699043(++_0x3bfe4e);}(_0xde6c,0x199));var _0xcde6=function(_0x3ad133,_0x377068){_0x3ad133=_0x3ad133-0x0;var _0x33b86a=_0xde6c[_0x3ad133];return _0x33b86a;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'uniqueid':{'type':Sequelize[_0xcde6('0x2')]},'body':{'type':Sequelize[_0xcde6('0x3')](_0xcde6('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xcde6('0x5')]('in',_0xcde6('0x6')),'defaultValue':_0xcde6('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xcde6('0x2')]},'providerResponse':{'type':Sequelize[_0xcde6('0x3')]}}; \ No newline at end of file +var _0xdbc6=['medium','out','sequelize','exports','STRING','TEXT'];(function(_0x3e19d5,_0x3995dc){var _0xbbb506=function(_0x10d84f){while(--_0x10d84f){_0x3e19d5['push'](_0x3e19d5['shift']());}};_0xbbb506(++_0x3995dc);}(_0xdbc6,0xe0));var _0x6dbc=function(_0x5b1897,_0x5ab175){_0x5b1897=_0x5b1897-0x0;var _0x2f1939=_0xdbc6[_0x5b1897];return _0x2f1939;};'use strict';var Sequelize=require(_0x6dbc('0x0'));module[_0x6dbc('0x1')]={'uniqueid':{'type':Sequelize[_0x6dbc('0x2')]},'body':{'type':Sequelize[_0x6dbc('0x3')](_0x6dbc('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6dbc('0x5')),'defaultValue':_0x6dbc('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6dbc('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 7051482..836ed60 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 _0xb683=['set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SquareMessage','rawAttributes','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','include','findAll','rows','catch','show','params','intersection','options','find','create','body','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb683,0x199));var _0x3b68=function(_0x5a001d,_0x591f45){_0x5a001d=_0x5a001d-0x0;var _0x3d0a81=_0xb683[_0x5a001d];return _0x3d0a81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b68('0x0'));var zipdir=require(_0x3b68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3b68('0x2'));var BPromise=require(_0x3b68('0x3'));var Mustache=require(_0x3b68('0x4'));var util=require(_0x3b68('0x5'));var path=require(_0x3b68('0x6'));var sox=require(_0x3b68('0x7'));var csv=require(_0x3b68('0x8'));var ejs=require(_0x3b68('0x9'));var fs=require('fs');var fs_extra=require(_0x3b68('0xa'));var _=require('lodash');var squel=require(_0x3b68('0xb'));var crypto=require(_0x3b68('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3b68('0xd'));var toCsv=require(_0x3b68('0x8'));var querystring=require(_0x3b68('0xe'));var Papa=require(_0x3b68('0xf'));var Redis=require(_0x3b68('0x10'));var authService=require(_0x3b68('0x11'));var qs=require(_0x3b68('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b68('0x13'))('api');var utils=require(_0x3b68('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3b68('0x15'))['db'];function respondWithStatusCode(_0x39d577,_0x4fecaf){_0x4fecaf=_0x4fecaf||0xcc;return function(_0x1d3e52){if(_0x1d3e52){return _0x39d577[_0x3b68('0x16')](_0x4fecaf);}return _0x39d577[_0x3b68('0x17')](_0x4fecaf)['end']();};}function respondWithResult(_0xad8deb,_0x5796ed){_0x5796ed=_0x5796ed||0xc8;return function(_0x4b3cde){if(_0x4b3cde){return _0xad8deb[_0x3b68('0x17')](_0x5796ed)[_0x3b68('0x18')](_0x4b3cde);}};}function respondWithFilteredResult(_0x544d9a,_0x423731){return function(_0x4b330f){if(_0x4b330f){var _0x32af3b=typeof _0x423731[_0x3b68('0x19')]===_0x3b68('0x1a')&&typeof _0x423731[_0x3b68('0x1b')]===_0x3b68('0x1a');var _0x4c141d=_0x4b330f[_0x3b68('0x1c')];var _0x1b3678=_0x32af3b?0x0:_0x423731[_0x3b68('0x19')];var _0x5921d2=_0x32af3b?_0x4b330f[_0x3b68('0x1c')]:_0x423731[_0x3b68('0x19')]+_0x423731['limit'];var _0x21d4d6;if(_0x5921d2>=_0x4c141d){_0x5921d2=_0x4c141d;_0x21d4d6=0xc8;}else{_0x21d4d6=0xce;}_0x544d9a[_0x3b68('0x17')](_0x21d4d6);return _0x544d9a[_0x3b68('0x1d')](_0x3b68('0x1e'),_0x1b3678+'-'+_0x5921d2+'/'+_0x4c141d)[_0x3b68('0x18')](_0x4b330f);}return null;};}function patchUpdates(_0x373be6){return function(_0x1c8519){try{jsonpatch[_0x3b68('0x1f')](_0x1c8519,_0x373be6,!![]);}catch(_0x489407){return BPromise[_0x3b68('0x20')](_0x489407);}return _0x1c8519[_0x3b68('0x21')]();};}function saveUpdates(_0x4f1acc,_0x2556ec){return function(_0x30de66){if(_0x30de66){return _0x30de66[_0x3b68('0x22')](_0x4f1acc)['then'](function(_0xed1ef2){return _0xed1ef2;});}return null;};}function removeEntity(_0x3bb587,_0x5d2976){return function(_0x58870e){if(_0x58870e){return _0x58870e[_0x3b68('0x23')]()[_0x3b68('0x24')](function(){_0x3bb587[_0x3b68('0x17')](0xcc)[_0x3b68('0x25')]();});}};}function handleEntityNotFound(_0x390b23,_0x53fb20){return function(_0x5547e3){if(!_0x5547e3){_0x390b23[_0x3b68('0x16')](0x194);}return _0x5547e3;};}function handleError(_0x2745db,_0x3858e7){_0x3858e7=_0x3858e7||0x1f4;return function(_0x4430bc){logger[_0x3b68('0x26')](_0x4430bc[_0x3b68('0x27')]);if(_0x4430bc[_0x3b68('0x28')]){delete _0x4430bc['name'];}_0x2745db[_0x3b68('0x17')](_0x3858e7)[_0x3b68('0x29')](_0x4430bc);};}exports[_0x3b68('0x2a')]=function(_0x206304,_0x5b87f3){var _0x2d63f7={},_0x16bf67={},_0x19f355={'count':0x0,'rows':[]};var _0x37c258=_[_0x3b68('0x2b')](db[_0x3b68('0x2c')][_0x3b68('0x2d')],function(_0x5011eb){return{'name':_0x5011eb['fieldName'],'type':_0x5011eb[_0x3b68('0x2e')][_0x3b68('0x2f')]};});_0x16bf67[_0x3b68('0x30')]=_[_0x3b68('0x2b')](_0x37c258,_0x3b68('0x28'));_0x16bf67[_0x3b68('0x31')]=_[_0x3b68('0x32')](_0x206304[_0x3b68('0x31')]);_0x16bf67['filters']=_['intersection'](_0x16bf67['model'],_0x16bf67[_0x3b68('0x31')]);_0x2d63f7['attributes']=_['intersection'](_0x16bf67[_0x3b68('0x30')],qs[_0x3b68('0x33')](_0x206304[_0x3b68('0x31')][_0x3b68('0x33')]));_0x2d63f7['attributes']=_0x2d63f7[_0x3b68('0x34')][_0x3b68('0x35')]?_0x2d63f7[_0x3b68('0x34')]:_0x16bf67['model'];if(!_0x206304[_0x3b68('0x31')][_0x3b68('0x36')](_0x3b68('0x37'))){_0x2d63f7[_0x3b68('0x1b')]=qs[_0x3b68('0x1b')](_0x206304['query'][_0x3b68('0x1b')]);_0x2d63f7[_0x3b68('0x19')]=qs[_0x3b68('0x19')](_0x206304[_0x3b68('0x31')]['offset']);}_0x2d63f7['order']=qs['sort'](_0x206304[_0x3b68('0x31')][_0x3b68('0x38')]);_0x2d63f7['where']=qs[_0x3b68('0x39')](_[_0x3b68('0x3a')](_0x206304['query'],_0x16bf67['filters']),_0x37c258);if(_0x206304[_0x3b68('0x31')][_0x3b68('0x3b')]){_0x2d63f7[_0x3b68('0x3c')]=_['merge'](_0x2d63f7[_0x3b68('0x3c')],{'$or':_[_0x3b68('0x2b')](_0x37c258,function(_0x2d815c){if(_0x2d815c[_0x3b68('0x2e')]!=='VIRTUAL'){var _0x545f6b={};_0x545f6b[_0x2d815c['name']]={'$like':'%'+_0x206304[_0x3b68('0x31')]['filter']+'%'};return _0x545f6b;}})});}_0x2d63f7=_[_0x3b68('0x3d')]({},_0x2d63f7,_0x206304['options']);var _0x4ecf53={'where':_0x2d63f7[_0x3b68('0x3c')]};return db[_0x3b68('0x2c')][_0x3b68('0x1c')](_0x4ecf53)['then'](function(_0x26e207){_0x19f355[_0x3b68('0x1c')]=_0x26e207;if(_0x206304[_0x3b68('0x31')]['includeAll']){_0x2d63f7[_0x3b68('0x3e')]=[{'all':!![]}];}return db[_0x3b68('0x2c')][_0x3b68('0x3f')](_0x2d63f7);})[_0x3b68('0x24')](function(_0x2d5f69){_0x19f355[_0x3b68('0x40')]=_0x2d5f69;return _0x19f355;})[_0x3b68('0x24')](respondWithFilteredResult(_0x5b87f3,_0x2d63f7))[_0x3b68('0x41')](handleError(_0x5b87f3,null));};exports[_0x3b68('0x42')]=function(_0x4b2f2b,_0x4d92cd){var _0x4d0745={'raw':!![],'where':{'id':_0x4b2f2b[_0x3b68('0x43')]['id']}},_0x48e971={};_0x48e971[_0x3b68('0x30')]=_[_0x3b68('0x32')](db[_0x3b68('0x2c')]['rawAttributes']);_0x48e971[_0x3b68('0x31')]=_[_0x3b68('0x32')](_0x4b2f2b[_0x3b68('0x31')]);_0x48e971[_0x3b68('0x39')]=_['intersection'](_0x48e971[_0x3b68('0x30')],_0x48e971[_0x3b68('0x31')]);_0x4d0745[_0x3b68('0x34')]=_[_0x3b68('0x44')](_0x48e971[_0x3b68('0x30')],qs[_0x3b68('0x33')](_0x4b2f2b['query'][_0x3b68('0x33')]));_0x4d0745[_0x3b68('0x34')]=_0x4d0745[_0x3b68('0x34')][_0x3b68('0x35')]?_0x4d0745['attributes']:_0x48e971[_0x3b68('0x30')];if(_0x4b2f2b[_0x3b68('0x31')]['includeAll']){_0x4d0745[_0x3b68('0x3e')]=[{'all':!![]}];}_0x4d0745=_[_0x3b68('0x3d')]({},_0x4d0745,_0x4b2f2b[_0x3b68('0x45')]);return db[_0x3b68('0x2c')][_0x3b68('0x46')](_0x4d0745)[_0x3b68('0x24')](handleEntityNotFound(_0x4d92cd,null))[_0x3b68('0x24')](respondWithResult(_0x4d92cd,null))[_0x3b68('0x41')](handleError(_0x4d92cd,null));};exports[_0x3b68('0x47')]=function(_0x34cb18,_0x2ae6ac){return db[_0x3b68('0x2c')][_0x3b68('0x47')](_0x34cb18[_0x3b68('0x48')],{})['then'](respondWithResult(_0x2ae6ac,0xc9))[_0x3b68('0x41')](handleError(_0x2ae6ac,null));};exports['update']=function(_0x3b83d3,_0x2d8357){if(_0x3b83d3[_0x3b68('0x48')]['id']){delete _0x3b83d3[_0x3b68('0x48')]['id'];}return db['SquareMessage'][_0x3b68('0x46')]({'where':{'id':_0x3b83d3[_0x3b68('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d8357,null))[_0x3b68('0x24')](saveUpdates(_0x3b83d3[_0x3b68('0x48')],null))[_0x3b68('0x24')](respondWithResult(_0x2d8357,null))['catch'](handleError(_0x2d8357,null));};exports['destroy']=function(_0x327d2a,_0x47e2e1){return db[_0x3b68('0x2c')][_0x3b68('0x46')]({'where':{'id':_0x327d2a[_0x3b68('0x43')]['id']}})[_0x3b68('0x24')](handleEntityNotFound(_0x47e2e1,null))[_0x3b68('0x24')](removeEntity(_0x47e2e1,null))[_0x3b68('0x41')](handleError(_0x47e2e1,null));}; \ No newline at end of file +var _0x33ad=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x49cc45,_0x1658e9){var _0x7943b8=function(_0x4db943){while(--_0x4db943){_0x49cc45['push'](_0x49cc45['shift']());}};_0x7943b8(++_0x1658e9);}(_0x33ad,0x74));var _0xd33a=function(_0x3fb364,_0x45dac7){_0x3fb364=_0x3fb364-0x0;var _0x4c9a41=_0x33ad[_0x3fb364];return _0x4c9a41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd33a('0x0'));var zipdir=require(_0xd33a('0x1'));var jsonpatch=require(_0xd33a('0x2'));var rp=require(_0xd33a('0x3'));var moment=require(_0xd33a('0x4'));var BPromise=require(_0xd33a('0x5'));var Mustache=require(_0xd33a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd33a('0x7'));var fs=require('fs');var fs_extra=require(_0xd33a('0x8'));var _=require(_0xd33a('0x9'));var squel=require(_0xd33a('0xa'));var crypto=require(_0xd33a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd33a('0xc'));var querystring=require(_0xd33a('0xd'));var Papa=require(_0xd33a('0xe'));var Redis=require('ioredis');var authService=require(_0xd33a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd33a('0x10'));var logger=require(_0xd33a('0x11'))(_0xd33a('0x12'));var utils=require(_0xd33a('0x13'));var config=require(_0xd33a('0x14'));var licenseUtil=require(_0xd33a('0x15'));var db=require(_0xd33a('0x16'))['db'];function respondWithStatusCode(_0x171f1f,_0x46e77e){_0x46e77e=_0x46e77e||0xcc;return function(_0x15e8fe){if(_0x15e8fe){return _0x171f1f[_0xd33a('0x17')](_0x46e77e);}return _0x171f1f[_0xd33a('0x18')](_0x46e77e)[_0xd33a('0x19')]();};}function respondWithResult(_0x752224,_0x49f102){_0x49f102=_0x49f102||0xc8;return function(_0x3bd9f6){if(_0x3bd9f6){return _0x752224['status'](_0x49f102)[_0xd33a('0x1a')](_0x3bd9f6);}};}function respondWithFilteredResult(_0x74c31b,_0x4c41a3){return function(_0x289dc5){if(_0x289dc5){var _0x29ab83=typeof _0x4c41a3[_0xd33a('0x1b')]==='undefined'&&typeof _0x4c41a3[_0xd33a('0x1c')]===_0xd33a('0x1d');var _0x105c3b=_0x289dc5[_0xd33a('0x1e')];var _0x3eb1f2=_0x29ab83?0x0:_0x4c41a3['offset'];var _0x5d680a=_0x29ab83?_0x289dc5[_0xd33a('0x1e')]:_0x4c41a3[_0xd33a('0x1b')]+_0x4c41a3[_0xd33a('0x1c')];var _0x174252;if(_0x5d680a>=_0x105c3b){_0x5d680a=_0x105c3b;_0x174252=0xc8;}else{_0x174252=0xce;}_0x74c31b['status'](_0x174252);return _0x74c31b['set'](_0xd33a('0x1f'),_0x3eb1f2+'-'+_0x5d680a+'/'+_0x105c3b)['json'](_0x289dc5);}return null;};}function patchUpdates(_0x51d5ad){return function(_0x1b4d42){try{jsonpatch[_0xd33a('0x20')](_0x1b4d42,_0x51d5ad,!![]);}catch(_0x5d93d4){return BPromise[_0xd33a('0x21')](_0x5d93d4);}return _0x1b4d42['save']();};}function saveUpdates(_0x1d3e45,_0x441853){return function(_0x4e6888){if(_0x4e6888){return _0x4e6888[_0xd33a('0x22')](_0x1d3e45)[_0xd33a('0x23')](function(_0x10070c){return _0x10070c;});}return null;};}function removeEntity(_0x40fd46,_0x24a570){return function(_0x431604){if(_0x431604){return _0x431604[_0xd33a('0x24')]()[_0xd33a('0x23')](function(){_0x40fd46[_0xd33a('0x18')](0xcc)[_0xd33a('0x19')]();});}};}function handleEntityNotFound(_0x345223,_0x38aca0){return function(_0x56a739){if(!_0x56a739){_0x345223['sendStatus'](0x194);}return _0x56a739;};}function handleError(_0x79a742,_0x31a67b){_0x31a67b=_0x31a67b||0x1f4;return function(_0x57d09f){logger[_0xd33a('0x25')](_0x57d09f[_0xd33a('0x26')]);if(_0x57d09f[_0xd33a('0x27')]){delete _0x57d09f['name'];}_0x79a742[_0xd33a('0x18')](_0x31a67b)['send'](_0x57d09f);};}exports[_0xd33a('0x28')]=function(_0x5df0de,_0x3c8cee){var _0x23f84c={},_0x43d423={},_0x41384c={'count':0x0,'rows':[]};var _0x46f020=_[_0xd33a('0x29')](db[_0xd33a('0x2a')][_0xd33a('0x2b')],function(_0x325c4f){return{'name':_0x325c4f[_0xd33a('0x2c')],'type':_0x325c4f['type'][_0xd33a('0x2d')]};});_0x43d423[_0xd33a('0x2e')]=_[_0xd33a('0x29')](_0x46f020,_0xd33a('0x27'));_0x43d423[_0xd33a('0x2f')]=_[_0xd33a('0x30')](_0x5df0de[_0xd33a('0x2f')]);_0x43d423[_0xd33a('0x31')]=_[_0xd33a('0x32')](_0x43d423[_0xd33a('0x2e')],_0x43d423[_0xd33a('0x2f')]);_0x23f84c[_0xd33a('0x33')]=_[_0xd33a('0x32')](_0x43d423[_0xd33a('0x2e')],qs[_0xd33a('0x34')](_0x5df0de[_0xd33a('0x2f')][_0xd33a('0x34')]));_0x23f84c[_0xd33a('0x33')]=_0x23f84c['attributes'][_0xd33a('0x35')]?_0x23f84c[_0xd33a('0x33')]:_0x43d423[_0xd33a('0x2e')];if(!_0x5df0de[_0xd33a('0x2f')][_0xd33a('0x36')]('nolimit')){_0x23f84c[_0xd33a('0x1c')]=qs['limit'](_0x5df0de['query'][_0xd33a('0x1c')]);_0x23f84c[_0xd33a('0x1b')]=qs[_0xd33a('0x1b')](_0x5df0de[_0xd33a('0x2f')][_0xd33a('0x1b')]);}_0x23f84c['order']=qs['sort'](_0x5df0de[_0xd33a('0x2f')]['sort']);_0x23f84c[_0xd33a('0x37')]=qs[_0xd33a('0x31')](_['pick'](_0x5df0de['query'],_0x43d423[_0xd33a('0x31')]),_0x46f020);if(_0x5df0de[_0xd33a('0x2f')]['filter']){_0x23f84c[_0xd33a('0x37')]=_[_0xd33a('0x38')](_0x23f84c[_0xd33a('0x37')],{'$or':_[_0xd33a('0x29')](_0x46f020,function(_0x1ceac3){if(_0x1ceac3['type']!==_0xd33a('0x39')){var _0x5f0a4c={};_0x5f0a4c[_0x1ceac3[_0xd33a('0x27')]]={'$like':'%'+_0x5df0de[_0xd33a('0x2f')][_0xd33a('0x3a')]+'%'};return _0x5f0a4c;}})});}_0x23f84c=_[_0xd33a('0x38')]({},_0x23f84c,_0x5df0de[_0xd33a('0x3b')]);var _0x3c73a3={'where':_0x23f84c[_0xd33a('0x37')]};return db['SquareMessage'][_0xd33a('0x1e')](_0x3c73a3)[_0xd33a('0x23')](function(_0x36cec6){_0x41384c[_0xd33a('0x1e')]=_0x36cec6;if(_0x5df0de[_0xd33a('0x2f')][_0xd33a('0x3c')]){_0x23f84c[_0xd33a('0x3d')]=[{'all':!![]}];}return db[_0xd33a('0x2a')][_0xd33a('0x3e')](_0x23f84c);})['then'](function(_0x5be473){_0x41384c[_0xd33a('0x3f')]=_0x5be473;return _0x41384c;})[_0xd33a('0x23')](respondWithFilteredResult(_0x3c8cee,_0x23f84c))[_0xd33a('0x40')](handleError(_0x3c8cee,null));};exports[_0xd33a('0x41')]=function(_0x2f0cd9,_0x4c599f){var _0x50f088={'raw':!![],'where':{'id':_0x2f0cd9[_0xd33a('0x42')]['id']}},_0x9c3d45={};_0x9c3d45[_0xd33a('0x2e')]=_[_0xd33a('0x30')](db[_0xd33a('0x2a')][_0xd33a('0x2b')]);_0x9c3d45[_0xd33a('0x2f')]=_['keys'](_0x2f0cd9[_0xd33a('0x2f')]);_0x9c3d45[_0xd33a('0x31')]=_[_0xd33a('0x32')](_0x9c3d45[_0xd33a('0x2e')],_0x9c3d45[_0xd33a('0x2f')]);_0x50f088[_0xd33a('0x33')]=_[_0xd33a('0x32')](_0x9c3d45['model'],qs[_0xd33a('0x34')](_0x2f0cd9[_0xd33a('0x2f')][_0xd33a('0x34')]));_0x50f088[_0xd33a('0x33')]=_0x50f088[_0xd33a('0x33')][_0xd33a('0x35')]?_0x50f088['attributes']:_0x9c3d45['model'];if(_0x2f0cd9[_0xd33a('0x2f')][_0xd33a('0x3c')]){_0x50f088['include']=[{'all':!![]}];}_0x50f088=_[_0xd33a('0x38')]({},_0x50f088,_0x2f0cd9[_0xd33a('0x3b')]);return db['SquareMessage']['find'](_0x50f088)['then'](handleEntityNotFound(_0x4c599f,null))[_0xd33a('0x23')](respondWithResult(_0x4c599f,null))[_0xd33a('0x40')](handleError(_0x4c599f,null));};exports[_0xd33a('0x43')]=function(_0x3e3a17,_0x4da318){return db['SquareMessage'][_0xd33a('0x43')](_0x3e3a17['body'],{})[_0xd33a('0x23')](respondWithResult(_0x4da318,0xc9))[_0xd33a('0x40')](handleError(_0x4da318,null));};exports[_0xd33a('0x22')]=function(_0x2db177,_0x11b328){if(_0x2db177[_0xd33a('0x44')]['id']){delete _0x2db177['body']['id'];}return db[_0xd33a('0x2a')][_0xd33a('0x45')]({'where':{'id':_0x2db177[_0xd33a('0x42')]['id']}})[_0xd33a('0x23')](handleEntityNotFound(_0x11b328,null))['then'](saveUpdates(_0x2db177[_0xd33a('0x44')],null))[_0xd33a('0x23')](respondWithResult(_0x11b328,null))[_0xd33a('0x40')](handleError(_0x11b328,null));};exports[_0xd33a('0x24')]=function(_0x290168,_0x4be3ea){return db[_0xd33a('0x2a')][_0xd33a('0x45')]({'where':{'id':_0x290168[_0xd33a('0x42')]['id']}})[_0xd33a('0x23')](handleEntityNotFound(_0x4be3ea,null))[_0xd33a('0x23')](removeEntity(_0x4be3ea,null))[_0xd33a('0x40')](handleError(_0x4be3ea,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 2956fbc..95cc758 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 _0x543e=['path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0x543e,0x1ac));var _0xe543=function(_0x9ddf37,_0x293505){_0x9ddf37=_0x9ddf37-0x0;var _0x29f5df=_0x543e[_0x9ddf37];return _0x29f5df;};'use strict';var _=require(_0xe543('0x0'));var util=require(_0xe543('0x1'));var logger=require(_0xe543('0x2'))(_0xe543('0x3'));var moment=require(_0xe543('0x4'));var BPromise=require(_0xe543('0x5'));var rp=require(_0xe543('0x6'));var fs=require('fs');var path=require(_0xe543('0x7'));var rimraf=require(_0xe543('0x8'));var config=require(_0xe543('0x9'));var attributes=require(_0xe543('0xa'));module[_0xe543('0xb')]=function(_0x2c9fe6,_0x1a6382){return _0x2c9fe6[_0xe543('0xc')](_0xe543('0xd'),attributes,{'tableName':_0xe543('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7aab=['SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareMessage.attributes','exports','define'];(function(_0x25db8d,_0x2b8c65){var _0x5782d9=function(_0x4cb19d){while(--_0x4cb19d){_0x25db8d['push'](_0x25db8d['shift']());}};_0x5782d9(++_0x2b8c65);}(_0x7aab,0x154));var _0xb7aa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7aab[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb7aa('0x0'));var util=require('util');var logger=require(_0xb7aa('0x1'))(_0xb7aa('0x2'));var moment=require(_0xb7aa('0x3'));var BPromise=require(_0xb7aa('0x4'));var rp=require(_0xb7aa('0x5'));var fs=require('fs');var path=require(_0xb7aa('0x6'));var rimraf=require(_0xb7aa('0x7'));var config=require('../../config/environment');var attributes=require(_0xb7aa('0x8'));module[_0xb7aa('0x9')]=function(_0x490543,_0x2496fa){return _0x490543[_0xb7aa('0xa')](_0xb7aa('0xb'),attributes,{'tableName':_0xb7aa('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 f163252..84184c0 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 _0x6c5a=['catch','CreateSquareMessage','SquareMessage','options','raw','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xb94bed,_0xe4f5f3){var _0xa2b01a=function(_0x2d0821){while(--_0x2d0821){_0xb94bed['push'](_0xb94bed['shift']());}};_0xa2b01a(++_0xe4f5f3);}(_0x6c5a,0x1e0));var _0xa6c5=function(_0xa45a13,_0x5870bb){_0xa45a13=_0xa45a13-0x0;var _0x2890bb=_0x6c5a[_0xa45a13];return _0x2890bb;};'use strict';var _=require(_0xa6c5('0x0'));var util=require(_0xa6c5('0x1'));var moment=require(_0xa6c5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa6c5('0x4'))(_0xa6c5('0x5'));var config=require(_0xa6c5('0x6'));var jayson=require(_0xa6c5('0x7'));var client=jayson['client'][_0xa6c5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fdc1a,_0x549302,_0x613a7d){return new BPromise(function(_0x549a73,_0x5309bb){return client[_0xa6c5('0x9')](_0x2fdc1a,_0x613a7d)[_0xa6c5('0xa')](function(_0x31671b){logger[_0xa6c5('0xb')](_0xa6c5('0xc'),_0x549302,_0xa6c5('0xd'));logger[_0xa6c5('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x549302,_0xa6c5('0xd'),JSON[_0xa6c5('0xf')](_0x31671b));if(_0x31671b[_0xa6c5('0x10')]){if(_0x31671b['error'][_0xa6c5('0x11')]===0x1f4){logger[_0xa6c5('0x10')](_0xa6c5('0xc'),_0x549302,_0x31671b['error']['message']);return _0x5309bb(_0x31671b['error'][_0xa6c5('0x12')]);}logger[_0xa6c5('0x10')](_0xa6c5('0xc'),_0x549302,_0x31671b[_0xa6c5('0x10')][_0xa6c5('0x12')]);return _0x549a73(_0x31671b[_0xa6c5('0x10')]['message']);}else{logger[_0xa6c5('0xb')](_0xa6c5('0xc'),_0x549302,_0xa6c5('0xd'));_0x549a73(_0x31671b[_0xa6c5('0x13')][_0xa6c5('0x12')]);}})[_0xa6c5('0x14')](function(_0x2b2b11){logger['error'](_0xa6c5('0xc'),_0x549302,_0x2b2b11);_0x5309bb(_0x2b2b11);});});}exports[_0xa6c5('0x15')]=function(_0x347215){var _0x56f0b1=this;return new Promise(function(_0x31d492,_0x1c477d){return db[_0xa6c5('0x16')]['create'](_0x347215['body'],{'raw':_0x347215['options']?_0x347215[_0xa6c5('0x17')][_0xa6c5('0x18')]===undefined?!![]:![]:!![]})[_0xa6c5('0xa')](function(_0x5638c4){logger[_0xa6c5('0xb')]('CreateSquareMessage',_0x347215);logger['debug'](_0xa6c5('0x15'),_0x347215,JSON[_0xa6c5('0xf')](_0x5638c4));_0x31d492(_0x5638c4);})[_0xa6c5('0x14')](function(_0x15fa63){logger['error'](_0xa6c5('0x15'),_0x15fa63[_0xa6c5('0x12')],_0x347215);_0x1c477d(_0x56f0b1[_0xa6c5('0x10')](0x1f4,_0x15fa63['message']));});});}; \ No newline at end of file +var _0x4455=['options','raw','then','CreateSquareMessage','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SquareMessage','create','body'];(function(_0x818e6c,_0x4f2b8f){var _0x5028c7=function(_0x1c8be2){while(--_0x1c8be2){_0x818e6c['push'](_0x818e6c['shift']());}};_0x5028c7(++_0x4f2b8f);}(_0x4455,0xcc));var _0x5445=function(_0x4b3d81,_0x544683){_0x4b3d81=_0x4b3d81-0x0;var _0x4e2244=_0x4455[_0x4b3d81];return _0x4e2244;};'use strict';var _=require(_0x5445('0x0'));var util=require(_0x5445('0x1'));var moment=require(_0x5445('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5445('0x3'))['db'];var utils=require(_0x5445('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5445('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5445('0x6')][_0x5445('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x251d70,_0xdb3f08,_0x21ed54){return new BPromise(function(_0x1a8511,_0xd9c24d){return client[_0x5445('0x8')](_0x251d70,_0x21ed54)['then'](function(_0x491116){logger[_0x5445('0x9')](_0x5445('0xa'),_0xdb3f08,_0x5445('0xb'));logger[_0x5445('0xc')](_0x5445('0xd'),_0xdb3f08,_0x5445('0xb'),JSON[_0x5445('0xe')](_0x491116));if(_0x491116['error']){if(_0x491116[_0x5445('0xf')]['code']===0x1f4){logger[_0x5445('0xf')](_0x5445('0xa'),_0xdb3f08,_0x491116[_0x5445('0xf')][_0x5445('0x10')]);return _0xd9c24d(_0x491116[_0x5445('0xf')]['message']);}logger['error'](_0x5445('0xa'),_0xdb3f08,_0x491116[_0x5445('0xf')][_0x5445('0x10')]);return _0x1a8511(_0x491116[_0x5445('0xf')][_0x5445('0x10')]);}else{logger['info'](_0x5445('0xa'),_0xdb3f08,_0x5445('0xb'));_0x1a8511(_0x491116['result'][_0x5445('0x10')]);}})[_0x5445('0x11')](function(_0x5579b0){logger[_0x5445('0xf')](_0x5445('0xa'),_0xdb3f08,_0x5579b0);_0xd9c24d(_0x5579b0);});});}exports['CreateSquareMessage']=function(_0x3cbedd){var _0x5b5dd0=this;return new Promise(function(_0x1bad20,_0x542ca1){return db[_0x5445('0x12')][_0x5445('0x13')](_0x3cbedd[_0x5445('0x14')],{'raw':_0x3cbedd[_0x5445('0x15')]?_0x3cbedd['options'][_0x5445('0x16')]===undefined?!![]:![]:!![]})[_0x5445('0x17')](function(_0x540355){logger['info'](_0x5445('0x18'),_0x3cbedd);logger['debug']('CreateSquareMessage',_0x3cbedd,JSON[_0x5445('0xe')](_0x540355));_0x1bad20(_0x540355);})['catch'](function(_0x38cd16){logger[_0x5445('0xf')]('CreateSquareMessage',_0x38cd16['message'],_0x3cbedd);_0x542ca1(_0x5b5dd0['error'](0x1f4,_0x38cd16[_0x5445('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index cce7f9e..ae2242f 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 _0x7a33=['index','get','/:id','isAuthenticated','show','/:id/test','15s','test','post','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller'];(function(_0x436095,_0x467c67){var _0x476a65=function(_0x468bb4){while(--_0x468bb4){_0x436095['push'](_0x436095['shift']());}};_0x476a65(++_0x467c67);}(_0x7a33,0x19b));var _0x37a3=function(_0x3e9fed,_0xd430d8){_0x3e9fed=_0x3e9fed-0x0;var _0x34c570=_0x7a33[_0x3e9fed];return _0x34c570;};'use strict';var multer=require(_0x37a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x37a3('0x1'));var express=require(_0x37a3('0x2'));var router=express['Router']();var fs_extra=require(_0x37a3('0x3'));var auth=require(_0x37a3('0x4'));var interaction=require(_0x37a3('0x5'));var config=require('../../config/environment');var controller=require(_0x37a3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x37a3('0x7')]);router[_0x37a3('0x8')](_0x37a3('0x9'),auth[_0x37a3('0xa')](),controller[_0x37a3('0xb')]);router[_0x37a3('0x8')](_0x37a3('0xc'),auth[_0x37a3('0xa')](),timeout(_0x37a3('0xd')),controller[_0x37a3('0xe')]);router[_0x37a3('0xf')]('/',auth[_0x37a3('0xa')](),controller['create']);router['put'](_0x37a3('0x9'),auth[_0x37a3('0xa')](),controller[_0x37a3('0x10')]);router[_0x37a3('0x11')](_0x37a3('0x9'),auth[_0x37a3('0xa')](),controller['destroy']);module[_0x37a3('0x12')]=router; \ No newline at end of file +var _0xa7d7=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1d4425,_0x318664){var _0x57e327=function(_0xa0ac52){while(--_0xa0ac52){_0x1d4425['push'](_0x1d4425['shift']());}};_0x57e327(++_0x318664);}(_0xa7d7,0xac));var _0x7a7d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa7d7[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x7a7d('0x0'));var util=require(_0x7a7d('0x1'));var path=require(_0x7a7d('0x2'));var timeout=require(_0x7a7d('0x3'));var express=require('express');var router=express[_0x7a7d('0x4')]();var fs_extra=require(_0x7a7d('0x5'));var auth=require(_0x7a7d('0x6'));var interaction=require(_0x7a7d('0x7'));var config=require(_0x7a7d('0x8'));var controller=require(_0x7a7d('0x9'));router[_0x7a7d('0xa')]('/',auth[_0x7a7d('0xb')](),controller[_0x7a7d('0xc')]);router[_0x7a7d('0xa')](_0x7a7d('0xd'),auth[_0x7a7d('0xb')](),controller[_0x7a7d('0xe')]);router[_0x7a7d('0xa')](_0x7a7d('0xf'),auth[_0x7a7d('0xb')](),timeout(_0x7a7d('0x10')),controller[_0x7a7d('0x11')]);router[_0x7a7d('0x12')]('/',auth[_0x7a7d('0xb')](),controller[_0x7a7d('0x13')]);router[_0x7a7d('0x14')](_0x7a7d('0xd'),auth[_0x7a7d('0xb')](),controller[_0x7a7d('0x15')]);router[_0x7a7d('0x16')](_0x7a7d('0xd'),auth[_0x7a7d('0xb')](),controller[_0x7a7d('0x17')]);module[_0x7a7d('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index cec4887..ac2a505 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 _0xb210=['STRING','sequelize','name'];(function(_0x4c29f9,_0x5bddd4){var _0x4e17b8=function(_0x12e055){while(--_0x12e055){_0x4c29f9['push'](_0x4c29f9['shift']());}};_0x4e17b8(++_0x5bddd4);}(_0xb210,0x190));var _0x0b21=function(_0x596130,_0x395e6a){_0x596130=_0x596130-0x0;var _0x56564c=_0xb210[_0x596130];return _0x56564c;};'use strict';var Sequelize=require(_0x0b21('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x0b21('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0b21('0x2')]},'description':{'type':Sequelize[_0x0b21('0x2')]}}; \ No newline at end of file +var _0x29f8=['name','sequelize','exports','STRING'];(function(_0x2e6dee,_0x1a61b0){var _0x47706=function(_0x365546){while(--_0x365546){_0x2e6dee['push'](_0x2e6dee['shift']());}};_0x47706(++_0x1a61b0);}(_0x29f8,0x1e9));var _0x829f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x29f8[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x829f('0x0'));module[_0x829f('0x1')]={'name':{'type':Sequelize[_0x829f('0x2')],'unique':_0x829f('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x829f('0x2')]},'description':{'type':Sequelize[_0x829f('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 039d31a..89defe2 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 _0x057f=['params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','ODBC','UserProfileResource','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','show'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x057f,0x115));var _0xf057=function(_0x4cc977,_0x2299f3){_0x4cc977=_0x4cc977-0x0;var _0x3885ac=_0x057f[_0x4cc977];return _0x3885ac;};'use strict';var emlformat=require(_0xf057('0x0'));var rimraf=require(_0xf057('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf057('0x2'));var rp=require(_0xf057('0x3'));var moment=require(_0xf057('0x4'));var BPromise=require(_0xf057('0x5'));var Mustache=require(_0xf057('0x6'));var util=require(_0xf057('0x7'));var path=require(_0xf057('0x8'));var sox=require(_0xf057('0x9'));var csv=require(_0xf057('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf057('0xb'));var _=require(_0xf057('0xc'));var squel=require(_0xf057('0xd'));var crypto=require(_0xf057('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf057('0xf'));var toCsv=require(_0xf057('0xa'));var querystring=require(_0xf057('0x10'));var Papa=require(_0xf057('0x11'));var Redis=require(_0xf057('0x12'));var authService=require(_0xf057('0x13'));var qs=require(_0xf057('0x14'));var as=require(_0xf057('0x15'));var hardwareService=require(_0xf057('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf057('0x17'));var config=require(_0xf057('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf057('0x19'))['db'];function respondWithStatusCode(_0x3a1ea6,_0x362f05){_0x362f05=_0x362f05||0xcc;return function(_0x2e8f78){if(_0x2e8f78){return _0x3a1ea6[_0xf057('0x1a')](_0x362f05);}return _0x3a1ea6[_0xf057('0x1b')](_0x362f05)[_0xf057('0x1c')]();};}function respondWithResult(_0x5643f2,_0x2c2cbd){_0x2c2cbd=_0x2c2cbd||0xc8;return function(_0xc05599){if(_0xc05599){return _0x5643f2[_0xf057('0x1b')](_0x2c2cbd)['json'](_0xc05599);}};}function respondWithFilteredResult(_0x248a3a,_0x5cf385){return function(_0x4ea671){if(_0x4ea671){var _0x541583=typeof _0x5cf385[_0xf057('0x1d')]===_0xf057('0x1e')&&typeof _0x5cf385[_0xf057('0x1f')]===_0xf057('0x1e');var _0x570dd1=_0x4ea671[_0xf057('0x20')];var _0x27f129=_0x541583?0x0:_0x5cf385[_0xf057('0x1d')];var _0xe5eb5c=_0x541583?_0x4ea671['count']:_0x5cf385[_0xf057('0x1d')]+_0x5cf385[_0xf057('0x1f')];var _0x514d86;if(_0xe5eb5c>=_0x570dd1){_0xe5eb5c=_0x570dd1;_0x514d86=0xc8;}else{_0x514d86=0xce;}_0x248a3a[_0xf057('0x1b')](_0x514d86);return _0x248a3a[_0xf057('0x21')](_0xf057('0x22'),_0x27f129+'-'+_0xe5eb5c+'/'+_0x570dd1)[_0xf057('0x23')](_0x4ea671);}return null;};}function patchUpdates(_0x586183){return function(_0x58c753){try{jsonpatch[_0xf057('0x24')](_0x58c753,_0x586183,!![]);}catch(_0xf017e3){return BPromise[_0xf057('0x25')](_0xf017e3);}return _0x58c753[_0xf057('0x26')]();};}function saveUpdates(_0x358f4f,_0x7b612d){return function(_0x2d34c1){if(_0x2d34c1){return _0x2d34c1[_0xf057('0x27')](_0x358f4f)['then'](function(_0x5352cf){return _0x5352cf;});}return null;};}function removeEntity(_0x48ec0f,_0x4d5fee){return function(_0xb2f764){if(_0xb2f764){return _0xb2f764[_0xf057('0x28')]()[_0xf057('0x29')](function(){var _0x492bae=_0xb2f764[_0xf057('0x2a')]({'plain':!![]});var _0x1ef580=_0xf057('0x2b');return db[_0xf057('0x2c')][_0xf057('0x28')]({'where':{'type':_0x1ef580,'resourceId':_0x492bae['id']}})[_0xf057('0x29')](function(){return _0xb2f764;});})[_0xf057('0x29')](function(){_0x48ec0f[_0xf057('0x1b')](0xcc)[_0xf057('0x1c')]();});}};}function handleEntityNotFound(_0x479310,_0x27833a){return function(_0x4da25f){if(!_0x4da25f){_0x479310['sendStatus'](0x194);}return _0x4da25f;};}function handleError(_0xb8169e,_0x7c2b42){_0x7c2b42=_0x7c2b42||0x1f4;return function(_0x5e458c){logger['error'](_0x5e458c[_0xf057('0x2d')]);if(_0x5e458c[_0xf057('0x2e')]){delete _0x5e458c[_0xf057('0x2e')];}_0xb8169e[_0xf057('0x1b')](_0x7c2b42)[_0xf057('0x2f')](_0x5e458c);};}exports['index']=function(_0x50b88d,_0xbc2484){var _0x391d29={},_0x10e557={},_0x1e8e31={'count':0x0,'rows':[]};var _0x4d6b8d=_[_0xf057('0x30')](db[_0xf057('0x31')][_0xf057('0x32')],function(_0x5013b2){return{'name':_0x5013b2[_0xf057('0x33')],'type':_0x5013b2[_0xf057('0x34')]['key']};});_0x10e557[_0xf057('0x35')]=_['map'](_0x4d6b8d,'name');_0x10e557['query']=_['keys'](_0x50b88d[_0xf057('0x36')]);_0x10e557['filters']=_[_0xf057('0x37')](_0x10e557[_0xf057('0x35')],_0x10e557['query']);_0x391d29[_0xf057('0x38')]=_[_0xf057('0x37')](_0x10e557['model'],qs[_0xf057('0x39')](_0x50b88d['query']['fields']));_0x391d29[_0xf057('0x38')]=_0x391d29[_0xf057('0x38')]['length']?_0x391d29[_0xf057('0x38')]:_0x10e557[_0xf057('0x35')];if(!_0x50b88d[_0xf057('0x36')][_0xf057('0x3a')](_0xf057('0x3b'))){_0x391d29[_0xf057('0x1f')]=qs[_0xf057('0x1f')](_0x50b88d[_0xf057('0x36')][_0xf057('0x1f')]);_0x391d29[_0xf057('0x1d')]=qs[_0xf057('0x1d')](_0x50b88d[_0xf057('0x36')][_0xf057('0x1d')]);}_0x391d29['order']=qs['sort'](_0x50b88d[_0xf057('0x36')][_0xf057('0x3c')]);_0x391d29[_0xf057('0x3d')]=qs[_0xf057('0x3e')](_['pick'](_0x50b88d['query'],_0x10e557[_0xf057('0x3e')]),_0x4d6b8d);if(_0x50b88d[_0xf057('0x36')]['filter']){_0x391d29['where']=_[_0xf057('0x3f')](_0x391d29[_0xf057('0x3d')],{'$or':_[_0xf057('0x30')](_0x4d6b8d,function(_0xf2235e){if(_0xf2235e[_0xf057('0x34')]!==_0xf057('0x40')){var _0x2c529e={};_0x2c529e[_0xf2235e[_0xf057('0x2e')]]={'$like':'%'+_0x50b88d[_0xf057('0x36')][_0xf057('0x41')]+'%'};return _0x2c529e;}})});}_0x391d29=_[_0xf057('0x3f')]({},_0x391d29,_0x50b88d[_0xf057('0x42')]);var _0x45e80b={'where':_0x391d29[_0xf057('0x3d')]};return db['SquareOdbc'][_0xf057('0x20')](_0x45e80b)[_0xf057('0x29')](function(_0x14aed1){_0x1e8e31[_0xf057('0x20')]=_0x14aed1;if(_0x50b88d['query'][_0xf057('0x43')]){_0x391d29[_0xf057('0x44')]=[{'all':!![]}];}return db[_0xf057('0x31')]['findAll'](_0x391d29);})[_0xf057('0x29')](function(_0x31c10e){_0x1e8e31[_0xf057('0x45')]=_0x31c10e;return _0x1e8e31;})[_0xf057('0x29')](respondWithFilteredResult(_0xbc2484,_0x391d29))['catch'](handleError(_0xbc2484,null));};exports[_0xf057('0x46')]=function(_0x35d70f,_0x2553eb){var _0x19f80a={'raw':!![],'where':{'id':_0x35d70f[_0xf057('0x47')]['id']}},_0x361748={};_0x361748[_0xf057('0x35')]=_[_0xf057('0x48')](db[_0xf057('0x31')]['rawAttributes']);_0x361748['query']=_[_0xf057('0x48')](_0x35d70f[_0xf057('0x36')]);_0x361748[_0xf057('0x3e')]=_[_0xf057('0x37')](_0x361748[_0xf057('0x35')],_0x361748['query']);_0x19f80a['attributes']=_['intersection'](_0x361748['model'],qs['fields'](_0x35d70f['query'][_0xf057('0x39')]));_0x19f80a[_0xf057('0x38')]=_0x19f80a[_0xf057('0x38')]['length']?_0x19f80a[_0xf057('0x38')]:_0x361748[_0xf057('0x35')];if(_0x35d70f[_0xf057('0x36')][_0xf057('0x43')]){_0x19f80a['include']=[{'all':!![]}];}_0x19f80a=_[_0xf057('0x3f')]({},_0x19f80a,_0x35d70f[_0xf057('0x42')]);return db['SquareOdbc'][_0xf057('0x49')](_0x19f80a)[_0xf057('0x29')](handleEntityNotFound(_0x2553eb,null))[_0xf057('0x29')](respondWithResult(_0x2553eb,null))[_0xf057('0x4a')](handleError(_0x2553eb,null));};exports[_0xf057('0x4b')]=function(_0x4d433f,_0x29052){return db[_0xf057('0x31')][_0xf057('0x4b')](_0x4d433f[_0xf057('0x4c')],{})[_0xf057('0x29')](function(_0x18b470){var _0x42d528=_0x4d433f[_0xf057('0x4d')][_0xf057('0x2a')]({'plain':!![]});if(!_0x42d528)throw new Error(_0xf057('0x4e'));if(_0x42d528['role']==='user'){var _0x12c576=_0x18b470[_0xf057('0x2a')]({'plain':!![]});var _0x5bf3e0=_0xf057('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x5bf3e0,'userProfileId':_0x42d528[_0xf057('0x4f')]},'raw':!![]})[_0xf057('0x29')](function(_0x3c4ce0){if(_0x3c4ce0&&_0x3c4ce0[_0xf057('0x50')]===0x0){return db[_0xf057('0x2c')][_0xf057('0x4b')]({'name':_0x12c576[_0xf057('0x2e')],'resourceId':_0x12c576['id'],'type':_0x3c4ce0['name'],'sectionId':_0x3c4ce0['id']},{})[_0xf057('0x29')](function(){return _0x18b470;});}else{return _0x18b470;}})['catch'](function(_0x5cacf4){logger['error'](_0xf057('0x51'),_0x5cacf4);throw _0x5cacf4;});}return _0x18b470;})['then'](respondWithResult(_0x29052,0xc9))[_0xf057('0x4a')](handleError(_0x29052,null));};exports['update']=function(_0xf80432,_0x3ea52c){if(_0xf80432['body']['id']){delete _0xf80432['body']['id'];}return db['SquareOdbc'][_0xf057('0x49')]({'where':{'id':_0xf80432['params']['id']}})[_0xf057('0x29')](handleEntityNotFound(_0x3ea52c,null))[_0xf057('0x29')](saveUpdates(_0xf80432[_0xf057('0x4c')],null))['then'](respondWithResult(_0x3ea52c,null))[_0xf057('0x4a')](handleError(_0x3ea52c,null));};exports[_0xf057('0x28')]=function(_0x4a02c1,_0x24b103){return db[_0xf057('0x31')]['find']({'where':{'id':_0x4a02c1[_0xf057('0x47')]['id']}})[_0xf057('0x29')](handleEntityNotFound(_0x24b103,null))[_0xf057('0x29')](removeEntity(_0x24b103,null))['catch'](handleError(_0x24b103,null));};exports[_0xf057('0x52')]=function(_0x1af3f1,_0x32a64c,_0x2b679c){var _0x236d02;return db['SquareOdbc'][_0xf057('0x49')]({'where':{'id':_0x1af3f1[_0xf057('0x47')]['id']},'attributes':['id',_0xf057('0x53')]})['then'](handleEntityNotFound(_0x32a64c,null))['then'](function(_0x1bc6c3){if(_0x1bc6c3){var _0x1a5603=require(_0xf057('0x54'))();_0x1a5603[_0xf057('0x55')](_0x1bc6c3[_0xf057('0x53')]);_0x1a5603[_0xf057('0x56')]();return _0x1bc6c3;}})[_0xf057('0x29')](respondWithResult(_0x32a64c,null))['catch'](handleError(_0x32a64c,null));}; \ No newline at end of file +var _0x96a0=['catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ODBC','error','stack','send','index','map','SquareOdbc','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','rawAttributes','find'];(function(_0x17782f,_0x398256){var _0x1b6f08=function(_0x274275){while(--_0x274275){_0x17782f['push'](_0x17782f['shift']());}};_0x1b6f08(++_0x398256);}(_0x96a0,0x12d));var _0x096a=function(_0xcc22ad,_0x515532){_0xcc22ad=_0xcc22ad-0x0;var _0x912d98=_0x96a0[_0xcc22ad];return _0x912d98;};'use strict';var emlformat=require(_0x096a('0x0'));var rimraf=require(_0x096a('0x1'));var zipdir=require(_0x096a('0x2'));var jsonpatch=require(_0x096a('0x3'));var rp=require(_0x096a('0x4'));var moment=require(_0x096a('0x5'));var BPromise=require(_0x096a('0x6'));var Mustache=require(_0x096a('0x7'));var util=require(_0x096a('0x8'));var path=require(_0x096a('0x9'));var sox=require(_0x096a('0xa'));var csv=require(_0x096a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x096a('0xc'));var _=require(_0x096a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x096a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x096a('0xb'));var querystring=require(_0x096a('0xf'));var Papa=require(_0x096a('0x10'));var Redis=require(_0x096a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x096a('0x12'));var as=require(_0x096a('0x13'));var hardwareService=require(_0x096a('0x14'));var logger=require(_0x096a('0x15'))(_0x096a('0x16'));var utils=require(_0x096a('0x17'));var config=require(_0x096a('0x18'));var licenseUtil=require(_0x096a('0x19'));var db=require(_0x096a('0x1a'))['db'];function respondWithStatusCode(_0x3deb65,_0x20e1e5){_0x20e1e5=_0x20e1e5||0xcc;return function(_0x21eecc){if(_0x21eecc){return _0x3deb65[_0x096a('0x1b')](_0x20e1e5);}return _0x3deb65[_0x096a('0x1c')](_0x20e1e5)[_0x096a('0x1d')]();};}function respondWithResult(_0x2175a4,_0x44f061){_0x44f061=_0x44f061||0xc8;return function(_0x427fc8){if(_0x427fc8){return _0x2175a4[_0x096a('0x1c')](_0x44f061)[_0x096a('0x1e')](_0x427fc8);}};}function respondWithFilteredResult(_0x6e3114,_0x419d68){return function(_0xff76cd){if(_0xff76cd){var _0x27ac75=typeof _0x419d68[_0x096a('0x1f')]===_0x096a('0x20')&&typeof _0x419d68[_0x096a('0x21')]==='undefined';var _0x5dd17d=_0xff76cd['count'];var _0x15024c=_0x27ac75?0x0:_0x419d68[_0x096a('0x1f')];var _0x2891e3=_0x27ac75?_0xff76cd[_0x096a('0x22')]:_0x419d68[_0x096a('0x1f')]+_0x419d68['limit'];var _0xea5d3e;if(_0x2891e3>=_0x5dd17d){_0x2891e3=_0x5dd17d;_0xea5d3e=0xc8;}else{_0xea5d3e=0xce;}_0x6e3114[_0x096a('0x1c')](_0xea5d3e);return _0x6e3114[_0x096a('0x23')](_0x096a('0x24'),_0x15024c+'-'+_0x2891e3+'/'+_0x5dd17d)['json'](_0xff76cd);}return null;};}function patchUpdates(_0x4364a1){return function(_0x4377be){try{jsonpatch[_0x096a('0x25')](_0x4377be,_0x4364a1,!![]);}catch(_0x55b6f7){return BPromise[_0x096a('0x26')](_0x55b6f7);}return _0x4377be[_0x096a('0x27')]();};}function saveUpdates(_0x5147f6,_0x3b44d1){return function(_0x43582e){if(_0x43582e){return _0x43582e[_0x096a('0x28')](_0x5147f6)[_0x096a('0x29')](function(_0xddf7d0){return _0xddf7d0;});}return null;};}function removeEntity(_0x414af1,_0x53dde2){return function(_0x56391f){if(_0x56391f){return _0x56391f[_0x096a('0x2a')]()[_0x096a('0x29')](function(){var _0x269a16=_0x56391f[_0x096a('0x2b')]({'plain':!![]});var _0x2c1f07=_0x096a('0x2c');return db['UserProfileResource'][_0x096a('0x2a')]({'where':{'type':_0x2c1f07,'resourceId':_0x269a16['id']}})[_0x096a('0x29')](function(){return _0x56391f;});})['then'](function(){_0x414af1[_0x096a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d09e5,_0x17783f){return function(_0x20938d){if(!_0x20938d){_0x2d09e5[_0x096a('0x1b')](0x194);}return _0x20938d;};}function handleError(_0x309437,_0x12a538){_0x12a538=_0x12a538||0x1f4;return function(_0x529b08){logger[_0x096a('0x2d')](_0x529b08[_0x096a('0x2e')]);if(_0x529b08['name']){delete _0x529b08['name'];}_0x309437[_0x096a('0x1c')](_0x12a538)[_0x096a('0x2f')](_0x529b08);};}exports[_0x096a('0x30')]=function(_0x25a930,_0x512901){var _0x5fe4b0={},_0x20cb27={},_0xed02a2={'count':0x0,'rows':[]};var _0x1f6619=_[_0x096a('0x31')](db[_0x096a('0x32')]['rawAttributes'],function(_0x2619ef){return{'name':_0x2619ef[_0x096a('0x33')],'type':_0x2619ef[_0x096a('0x34')][_0x096a('0x35')]};});_0x20cb27[_0x096a('0x36')]=_['map'](_0x1f6619,_0x096a('0x37'));_0x20cb27[_0x096a('0x38')]=_[_0x096a('0x39')](_0x25a930[_0x096a('0x38')]);_0x20cb27[_0x096a('0x3a')]=_[_0x096a('0x3b')](_0x20cb27[_0x096a('0x36')],_0x20cb27[_0x096a('0x38')]);_0x5fe4b0[_0x096a('0x3c')]=_[_0x096a('0x3b')](_0x20cb27['model'],qs[_0x096a('0x3d')](_0x25a930['query'][_0x096a('0x3d')]));_0x5fe4b0[_0x096a('0x3c')]=_0x5fe4b0['attributes'][_0x096a('0x3e')]?_0x5fe4b0[_0x096a('0x3c')]:_0x20cb27[_0x096a('0x36')];if(!_0x25a930[_0x096a('0x38')][_0x096a('0x3f')](_0x096a('0x40'))){_0x5fe4b0[_0x096a('0x21')]=qs[_0x096a('0x21')](_0x25a930['query'][_0x096a('0x21')]);_0x5fe4b0[_0x096a('0x1f')]=qs[_0x096a('0x1f')](_0x25a930['query'][_0x096a('0x1f')]);}_0x5fe4b0[_0x096a('0x41')]=qs[_0x096a('0x42')](_0x25a930[_0x096a('0x38')][_0x096a('0x42')]);_0x5fe4b0[_0x096a('0x43')]=qs['filters'](_[_0x096a('0x44')](_0x25a930[_0x096a('0x38')],_0x20cb27[_0x096a('0x3a')]),_0x1f6619);if(_0x25a930[_0x096a('0x38')]['filter']){_0x5fe4b0[_0x096a('0x43')]=_['merge'](_0x5fe4b0[_0x096a('0x43')],{'$or':_[_0x096a('0x31')](_0x1f6619,function(_0x277d84){if(_0x277d84[_0x096a('0x34')]!==_0x096a('0x45')){var _0x29d24f={};_0x29d24f[_0x277d84[_0x096a('0x37')]]={'$like':'%'+_0x25a930[_0x096a('0x38')][_0x096a('0x46')]+'%'};return _0x29d24f;}})});}_0x5fe4b0=_[_0x096a('0x47')]({},_0x5fe4b0,_0x25a930[_0x096a('0x48')]);var _0x4c43f4={'where':_0x5fe4b0[_0x096a('0x43')]};return db['SquareOdbc']['count'](_0x4c43f4)['then'](function(_0x5e2f55){_0xed02a2['count']=_0x5e2f55;if(_0x25a930[_0x096a('0x38')][_0x096a('0x49')]){_0x5fe4b0[_0x096a('0x4a')]=[{'all':!![]}];}return db[_0x096a('0x32')]['findAll'](_0x5fe4b0);})['then'](function(_0x5ecd1e){_0xed02a2[_0x096a('0x4b')]=_0x5ecd1e;return _0xed02a2;})['then'](respondWithFilteredResult(_0x512901,_0x5fe4b0))['catch'](handleError(_0x512901,null));};exports[_0x096a('0x4c')]=function(_0x6a5009,_0x52053e){var _0x40dd65={'raw':!![],'where':{'id':_0x6a5009['params']['id']}},_0x37f449={};_0x37f449[_0x096a('0x36')]=_['keys'](db['SquareOdbc'][_0x096a('0x4d')]);_0x37f449['query']=_['keys'](_0x6a5009[_0x096a('0x38')]);_0x37f449[_0x096a('0x3a')]=_[_0x096a('0x3b')](_0x37f449['model'],_0x37f449[_0x096a('0x38')]);_0x40dd65[_0x096a('0x3c')]=_[_0x096a('0x3b')](_0x37f449['model'],qs[_0x096a('0x3d')](_0x6a5009[_0x096a('0x38')][_0x096a('0x3d')]));_0x40dd65[_0x096a('0x3c')]=_0x40dd65['attributes']['length']?_0x40dd65[_0x096a('0x3c')]:_0x37f449[_0x096a('0x36')];if(_0x6a5009[_0x096a('0x38')][_0x096a('0x49')]){_0x40dd65[_0x096a('0x4a')]=[{'all':!![]}];}_0x40dd65=_[_0x096a('0x47')]({},_0x40dd65,_0x6a5009[_0x096a('0x48')]);return db[_0x096a('0x32')][_0x096a('0x4e')](_0x40dd65)['then'](handleEntityNotFound(_0x52053e,null))[_0x096a('0x29')](respondWithResult(_0x52053e,null))[_0x096a('0x4f')](handleError(_0x52053e,null));};exports['create']=function(_0xa82a8b,_0x50e73c){return db[_0x096a('0x32')]['create'](_0xa82a8b[_0x096a('0x50')],{})[_0x096a('0x29')](function(_0x3c6f81){var _0x214aa0=_0xa82a8b[_0x096a('0x51')][_0x096a('0x2b')]({'plain':!![]});if(!_0x214aa0)throw new Error(_0x096a('0x52'));if(_0x214aa0[_0x096a('0x53')]===_0x096a('0x51')){var _0x11a13b=_0x3c6f81['get']({'plain':!![]});var _0x2c24bc=_0x096a('0x2c');return db[_0x096a('0x54')][_0x096a('0x4e')]({'where':{'name':_0x2c24bc,'userProfileId':_0x214aa0['userProfileId']},'raw':!![]})[_0x096a('0x29')](function(_0x50a213){if(_0x50a213&&_0x50a213[_0x096a('0x55')]===0x0){return db[_0x096a('0x56')][_0x096a('0x57')]({'name':_0x11a13b['name'],'resourceId':_0x11a13b['id'],'type':_0x50a213[_0x096a('0x37')],'sectionId':_0x50a213['id']},{})[_0x096a('0x29')](function(){return _0x3c6f81;});}else{return _0x3c6f81;}})[_0x096a('0x4f')](function(_0x5361d9){logger['error'](_0x096a('0x58'),_0x5361d9);throw _0x5361d9;});}return _0x3c6f81;})[_0x096a('0x29')](respondWithResult(_0x50e73c,0xc9))[_0x096a('0x4f')](handleError(_0x50e73c,null));};exports['update']=function(_0x55bf69,_0x5d795e){if(_0x55bf69[_0x096a('0x50')]['id']){delete _0x55bf69[_0x096a('0x50')]['id'];}return db[_0x096a('0x32')][_0x096a('0x4e')]({'where':{'id':_0x55bf69[_0x096a('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d795e,null))[_0x096a('0x29')](saveUpdates(_0x55bf69[_0x096a('0x50')],null))[_0x096a('0x29')](respondWithResult(_0x5d795e,null))[_0x096a('0x4f')](handleError(_0x5d795e,null));};exports[_0x096a('0x2a')]=function(_0x58488e,_0x14de7a){return db[_0x096a('0x32')][_0x096a('0x4e')]({'where':{'id':_0x58488e[_0x096a('0x59')]['id']}})[_0x096a('0x29')](handleEntityNotFound(_0x14de7a,null))[_0x096a('0x29')](removeEntity(_0x14de7a,null))[_0x096a('0x4f')](handleError(_0x14de7a,null));};exports[_0x096a('0x5a')]=function(_0x889307,_0x5ee8d1,_0x245e43){var _0x19d7c9;return db[_0x096a('0x32')][_0x096a('0x4e')]({'where':{'id':_0x889307['params']['id']},'attributes':['id',_0x096a('0x5b')]})[_0x096a('0x29')](handleEntityNotFound(_0x5ee8d1,null))['then'](function(_0x3d599c){if(_0x3d599c){var _0x40dc75=require(_0x096a('0x5c'))();_0x40dc75[_0x096a('0x5d')](_0x3d599c[_0x096a('0x5b')]);_0x40dc75[_0x096a('0x5e')]();return _0x3d599c;}})['then'](respondWithResult(_0x5ee8d1,null))[_0x096a('0x4f')](handleError(_0x5ee8d1,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 6329c19..964a0a2 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 _0x92d4=['lodash','util','api','path','rimraf','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0x21e1d7,_0x165e4a){var _0x22067f=function(_0x12839c){while(--_0x12839c){_0x21e1d7['push'](_0x21e1d7['shift']());}};_0x22067f(++_0x165e4a);}(_0x92d4,0xe1));var _0x492d=function(_0x4cc410,_0x3fcf3c){_0x4cc410=_0x4cc410-0x0;var _0x2ddb6c=_0x92d4[_0x4cc410];return _0x2ddb6c;};'use strict';var _=require(_0x492d('0x0'));var util=require(_0x492d('0x1'));var logger=require('../../config/logger')(_0x492d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x492d('0x3'));var rimraf=require(_0x492d('0x4'));var config=require('../../config/environment');var attributes=require(_0x492d('0x5'));module[_0x492d('0x6')]=function(_0x3bcec4,_0x15b294){return _0x3bcec4['define'](_0x492d('0x7'),attributes,{'tableName':_0x492d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3417=['./squareOdbc.attributes','exports','square_odbc','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x18006e,_0x3e0553){var _0x2e6afe=function(_0x206dba){while(--_0x206dba){_0x18006e['push'](_0x18006e['shift']());}};_0x2e6afe(++_0x3e0553);}(_0x3417,0x16e));var _0x7341=function(_0x447b27,_0x8432b0){_0x447b27=_0x447b27-0x0;var _0x5abfc9=_0x3417[_0x447b27];return _0x5abfc9;};'use strict';var _=require(_0x7341('0x0'));var util=require(_0x7341('0x1'));var logger=require(_0x7341('0x2'))(_0x7341('0x3'));var moment=require('moment');var BPromise=require(_0x7341('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7341('0x5'));var rimraf=require(_0x7341('0x6'));var config=require(_0x7341('0x7'));var attributes=require(_0x7341('0x8'));module[_0x7341('0x9')]=function(_0x2d0683,_0x26af02){return _0x2d0683['define']('SquareOdbc',attributes,{'tableName':_0x7341('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 d1bdcfb..42fd415 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 _0x1107=['message','result','ShowSquareOdbc','SquareOdbc','find','options','where','include','map','attributes','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s'];(function(_0xb1c5d5,_0x3a2038){var _0x3766dc=function(_0x12344b){while(--_0x12344b){_0xb1c5d5['push'](_0xb1c5d5['shift']());}};_0x3766dc(++_0x3a2038);}(_0x1107,0x1d3));var _0x7110=function(_0x397dd0,_0x58a7a8){_0x397dd0=_0x397dd0-0x0;var _0x4188b2=_0x1107[_0x397dd0];return _0x4188b2;};'use strict';var _=require(_0x7110('0x0'));var util=require(_0x7110('0x1'));var moment=require(_0x7110('0x2'));var BPromise=require(_0x7110('0x3'));var rs=require(_0x7110('0x4'));var fs=require('fs');var Redis=require(_0x7110('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7110('0x6'));var logger=require(_0x7110('0x7'))(_0x7110('0x8'));var config=require(_0x7110('0x9'));var jayson=require(_0x7110('0xa'));var client=jayson[_0x7110('0xb')][_0x7110('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x585f44,_0x31af48,_0x40d5c7){return new BPromise(function(_0x4770d9,_0x147e39){return client[_0x7110('0xd')](_0x585f44,_0x40d5c7)[_0x7110('0xe')](function(_0x3d13ed){logger[_0x7110('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x31af48,_0x7110('0x10'));logger[_0x7110('0x11')](_0x7110('0x12'),_0x31af48,'request\x20sent',JSON[_0x7110('0x13')](_0x3d13ed));if(_0x3d13ed[_0x7110('0x14')]){if(_0x3d13ed[_0x7110('0x14')][_0x7110('0x15')]===0x1f4){logger['error'](_0x7110('0x16'),_0x31af48,_0x3d13ed['error'][_0x7110('0x17')]);return _0x147e39(_0x3d13ed[_0x7110('0x14')][_0x7110('0x17')]);}logger[_0x7110('0x14')](_0x7110('0x16'),_0x31af48,_0x3d13ed['error'][_0x7110('0x17')]);return _0x4770d9(_0x3d13ed[_0x7110('0x14')]['message']);}else{logger[_0x7110('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x31af48,_0x7110('0x10'));_0x4770d9(_0x3d13ed[_0x7110('0x18')][_0x7110('0x17')]);}})['catch'](function(_0x3fac64){logger[_0x7110('0x14')](_0x7110('0x16'),_0x31af48,_0x3fac64);_0x147e39(_0x3fac64);});});}exports[_0x7110('0x19')]=function(_0x4d0f30){var _0x4461f8=this;return new Promise(function(_0x5736bb,_0xfd2d5f){return db[_0x7110('0x1a')][_0x7110('0x1b')]({'raw':_0x4d0f30[_0x7110('0x1c')]?_0x4d0f30[_0x7110('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4d0f30[_0x7110('0x1c')]?_0x4d0f30[_0x7110('0x1c')][_0x7110('0x1d')]||null:null,'attributes':_0x4d0f30['options']?_0x4d0f30[_0x7110('0x1c')]['attributes']||null:null,'include':_0x4d0f30[_0x7110('0x1c')]?_0x4d0f30[_0x7110('0x1c')][_0x7110('0x1e')]?_[_0x7110('0x1f')](_0x4d0f30['options']['include'],function(_0x238eb5){return{'model':db[_0x238eb5['model']],'as':_0x238eb5['as'],'attributes':_0x238eb5[_0x7110('0x20')],'include':_0x238eb5[_0x7110('0x1e')]?_['map'](_0x238eb5['include'],function(_0xe0ad57){return{'model':db[_0xe0ad57[_0x7110('0x21')]],'as':_0xe0ad57['as'],'attributes':_0xe0ad57['attributes'],'include':_0xe0ad57['include']?_[_0x7110('0x1f')](_0xe0ad57['include'],function(_0x2595d4){return{'model':db[_0x2595d4[_0x7110('0x21')]],'as':_0x2595d4['as'],'attributes':_0x2595d4[_0x7110('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dd019){logger[_0x7110('0xf')]('ShowSquareOdbc',_0x4d0f30);logger['debug'](_0x7110('0x19'),_0x4d0f30,JSON[_0x7110('0x13')](_0x2dd019));_0x5736bb(_0x2dd019);})[_0x7110('0x22')](function(_0x5a54f2){logger['error'](_0x7110('0x19'),_0x5a54f2['message'],_0x4d0f30);_0xfd2d5f(_0x4461f8[_0x7110('0x14')](0x1f4,_0x5a54f2[_0x7110('0x17')]));});});}; \ No newline at end of file +var _0x3ecc=['../../config/environment','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','model','include','debug','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4a57fb,_0x474112){var _0x418c4f=function(_0x483351){while(--_0x483351){_0x4a57fb['push'](_0x4a57fb['shift']());}};_0x418c4f(++_0x474112);}(_0x3ecc,0x1ea));var _0xc3ec=function(_0x50a601,_0x271e65){_0x50a601=_0x50a601-0x0;var _0x39ea7c=_0x3ecc[_0x50a601];return _0x39ea7c;};'use strict';var _=require(_0xc3ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc3ec('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ec('0x2'));var db=require(_0xc3ec('0x3'))['db'];var utils=require(_0xc3ec('0x4'));var logger=require('../../config/logger')(_0xc3ec('0x5'));var config=require(_0xc3ec('0x6'));var jayson=require(_0xc3ec('0x7'));var client=jayson['client'][_0xc3ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398077,_0x29737a,_0x227beb){return new BPromise(function(_0x232169,_0x5e6d0c){return client[_0xc3ec('0x9')](_0x398077,_0x227beb)[_0xc3ec('0xa')](function(_0x19af14){logger[_0xc3ec('0xb')](_0xc3ec('0xc'),_0x29737a,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x29737a,_0xc3ec('0xd'),JSON[_0xc3ec('0xe')](_0x19af14));if(_0x19af14[_0xc3ec('0xf')]){if(_0x19af14['error'][_0xc3ec('0x10')]===0x1f4){logger[_0xc3ec('0xf')](_0xc3ec('0xc'),_0x29737a,_0x19af14[_0xc3ec('0xf')][_0xc3ec('0x11')]);return _0x5e6d0c(_0x19af14[_0xc3ec('0xf')][_0xc3ec('0x11')]);}logger[_0xc3ec('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x29737a,_0x19af14[_0xc3ec('0xf')][_0xc3ec('0x11')]);return _0x232169(_0x19af14[_0xc3ec('0xf')]['message']);}else{logger[_0xc3ec('0xb')](_0xc3ec('0xc'),_0x29737a,'request\x20sent');_0x232169(_0x19af14[_0xc3ec('0x12')][_0xc3ec('0x11')]);}})['catch'](function(_0x37f40f){logger['error'](_0xc3ec('0xc'),_0x29737a,_0x37f40f);_0x5e6d0c(_0x37f40f);});});}exports[_0xc3ec('0x13')]=function(_0x324a39){var _0x2d3a8f=this;return new Promise(function(_0x43fa72,_0x512891){return db[_0xc3ec('0x14')][_0xc3ec('0x15')]({'raw':_0x324a39[_0xc3ec('0x16')]?_0x324a39[_0xc3ec('0x16')][_0xc3ec('0x17')]===undefined?!![]:![]:!![],'where':_0x324a39[_0xc3ec('0x16')]?_0x324a39['options'][_0xc3ec('0x18')]||null:null,'attributes':_0x324a39[_0xc3ec('0x16')]?_0x324a39[_0xc3ec('0x16')][_0xc3ec('0x19')]||null:null,'include':_0x324a39[_0xc3ec('0x16')]?_0x324a39['options']['include']?_[_0xc3ec('0x1a')](_0x324a39['options']['include'],function(_0x129fce){return{'model':db[_0x129fce[_0xc3ec('0x1b')]],'as':_0x129fce['as'],'attributes':_0x129fce[_0xc3ec('0x19')],'include':_0x129fce[_0xc3ec('0x1c')]?_[_0xc3ec('0x1a')](_0x129fce['include'],function(_0x251af6){return{'model':db[_0x251af6[_0xc3ec('0x1b')]],'as':_0x251af6['as'],'attributes':_0x251af6[_0xc3ec('0x19')],'include':_0x251af6['include']?_[_0xc3ec('0x1a')](_0x251af6[_0xc3ec('0x1c')],function(_0x387ba5){return{'model':db[_0x387ba5[_0xc3ec('0x1b')]],'as':_0x387ba5['as'],'attributes':_0x387ba5[_0xc3ec('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f7e8){logger[_0xc3ec('0xb')](_0xc3ec('0x13'),_0x324a39);logger[_0xc3ec('0x1d')](_0xc3ec('0x13'),_0x324a39,JSON[_0xc3ec('0xe')](_0x29f7e8));_0x43fa72(_0x29f7e8);})[_0xc3ec('0x1e')](function(_0x11042f){logger[_0xc3ec('0xf')]('ShowSquareOdbc',_0x11042f[_0xc3ec('0x11')],_0x324a39);_0x512891(_0x2d3a8f[_0xc3ec('0xf')](0x1f4,_0x11042f[_0xc3ec('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 529ac9b..bf193c6 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 _0x2e54=['destroy','delete','removeUsers','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','/:id/users','post','create','addUsers','put','update'];(function(_0x3bd93d,_0x49393d){var _0x4c8680=function(_0x2f4fa6){while(--_0x2f4fa6){_0x3bd93d['push'](_0x3bd93d['shift']());}};_0x4c8680(++_0x49393d);}(_0x2e54,0xc1));var _0x42e5=function(_0xc7cbf,_0x2771e5){_0xc7cbf=_0xc7cbf-0x0;var _0x4d819b=_0x2e54[_0xc7cbf];return _0x4d819b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x42e5('0x0'));var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42e5('0x5'));var config=require(_0x42e5('0x6'));var controller=require(_0x42e5('0x7'));router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller['index']);router['get'](_0x42e5('0xa'),auth[_0x42e5('0x9')](),controller['show']);router[_0x42e5('0x8')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller['getUsers']);router[_0x42e5('0xc')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xd')]);router['post'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xe')]);router[_0x42e5('0xf')](_0x42e5('0xa'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router['delete'](_0x42e5('0xa'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x11')]);router[_0x42e5('0x12')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x13')]);module[_0x42e5('0x14')]=router; \ No newline at end of file +var _0xa282=['get','isAuthenticated','index','/:id','show','/:id/users','getUsers','create','post','addUsers','put','update','destroy','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0xa282,0x1f3));var _0x2a28=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xa282[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0x2a28('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2a28('0x1'));var express=require('express');var router=express[_0x2a28('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2a28('0x3'));var interaction=require(_0x2a28('0x4'));var config=require(_0x2a28('0x5'));var controller=require(_0x2a28('0x6'));router[_0x2a28('0x7')]('/',auth[_0x2a28('0x8')](),controller[_0x2a28('0x9')]);router[_0x2a28('0x7')](_0x2a28('0xa'),auth[_0x2a28('0x8')](),controller[_0x2a28('0xb')]);router[_0x2a28('0x7')](_0x2a28('0xc'),auth['isAuthenticated'](),controller[_0x2a28('0xd')]);router['post']('/',auth[_0x2a28('0x8')](),controller[_0x2a28('0xe')]);router[_0x2a28('0xf')](_0x2a28('0xc'),auth[_0x2a28('0x8')](),controller[_0x2a28('0x10')]);router[_0x2a28('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2a28('0x12')]);router['delete'](_0x2a28('0xa'),auth[_0x2a28('0x8')](),controller[_0x2a28('0x13')]);router[_0x2a28('0x14')](_0x2a28('0xc'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x2a28('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3fae17f..3b4baa1 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 _0x6dc0=['long','preproduction','getDataValue','toString','production','DATE','sequelize','exports','STRING','TEXT','BLOB'];(function(_0x441906,_0x10b76e){var _0x212ea4=function(_0x7ae94a){while(--_0x7ae94a){_0x441906['push'](_0x441906['shift']());}};_0x212ea4(++_0x10b76e);}(_0x6dc0,0xb6));var _0x06dc=function(_0x49a305,_0x16c7e9){_0x49a305=_0x49a305-0x0;var _0x2cc0c2=_0x6dc0[_0x49a305];return _0x2cc0c2;};'use strict';var Sequelize=require(_0x06dc('0x0'));module[_0x06dc('0x1')]={'name':{'type':Sequelize[_0x06dc('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x06dc('0x2')]},'notes':{'type':Sequelize[_0x06dc('0x3')]},'preproduction':{'type':Sequelize[_0x06dc('0x4')](_0x06dc('0x5')),'get':function(){if(this['getDataValue'](_0x06dc('0x6'))){return this[_0x06dc('0x7')]('preproduction')[_0x06dc('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x06dc('0x4')](_0x06dc('0x5')),'get':function(){if(this[_0x06dc('0x7')](_0x06dc('0x9'))){return this[_0x06dc('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x06dc('0xa')]},'publishedAt':{'type':Sequelize[_0x06dc('0xa')]}}; \ No newline at end of file +var _0xd065=['exports','STRING','name','TEXT','BLOB','long','getDataValue','utf8','toString','DATE','sequelize'];(function(_0xc02ac0,_0x2a1d58){var _0x504ffd=function(_0x4025bc){while(--_0x4025bc){_0xc02ac0['push'](_0xc02ac0['shift']());}};_0x504ffd(++_0x2a1d58);}(_0xd065,0xba));var _0x5d06=function(_0x53e580,_0x341c71){_0x53e580=_0x53e580-0x0;var _0x3f6dcb=_0xd065[_0x53e580];return _0x3f6dcb;};'use strict';var Sequelize=require(_0x5d06('0x0'));module[_0x5d06('0x1')]={'name':{'type':Sequelize[_0x5d06('0x2')],'unique':_0x5d06('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5d06('0x2')]},'notes':{'type':Sequelize[_0x5d06('0x4')]},'preproduction':{'type':Sequelize[_0x5d06('0x5')](_0x5d06('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x5d06('0x7')]('preproduction')['toString'](_0x5d06('0x8'));}}},'production':{'type':Sequelize[_0x5d06('0x5')](_0x5d06('0x6')),'get':function(){if(this[_0x5d06('0x7')]('production')){return this['getDataValue']('production')[_0x5d06('0x9')](_0x5d06('0x8'));}}},'savedAt':{'type':Sequelize[_0x5d06('0xa')]},'publishedAt':{'type':Sequelize[_0x5d06('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 6b2b8a2..472c500 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 _0xb6b2=['../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','save','destroy','then','get','SquareProjects','UserProfileResource','error','stack','name','index','SquareProject','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','type','options','findAll','catch','params','keys','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','emit','getUsers','findOne','User','pick','merge','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service'];(function(_0xedfe42,_0x4acff3){var _0xf06b4b=function(_0x3287fb){while(--_0x3287fb){_0xedfe42['push'](_0xedfe42['shift']());}};_0xf06b4b(++_0x4acff3);}(_0xb6b2,0x100));var _0x2b6b=function(_0x6015c8,_0x10610f){_0x6015c8=_0x6015c8-0x0;var _0x5703ef=_0xb6b2[_0x6015c8];return _0x5703ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2b6b('0x0'));var jsonpatch=require(_0x2b6b('0x1'));var rp=require(_0x2b6b('0x2'));var moment=require(_0x2b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2b6b('0x4'));var util=require(_0x2b6b('0x5'));var path=require(_0x2b6b('0x6'));var sox=require(_0x2b6b('0x7'));var csv=require(_0x2b6b('0x8'));var ejs=require(_0x2b6b('0x9'));var fs=require('fs');var fs_extra=require(_0x2b6b('0xa'));var _=require(_0x2b6b('0xb'));var squel=require(_0x2b6b('0xc'));var crypto=require(_0x2b6b('0xd'));var jsforce=require(_0x2b6b('0xe'));var deskjs=require(_0x2b6b('0xf'));var toCsv=require(_0x2b6b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b6b('0x10'));var qs=require(_0x2b6b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b6b('0x12'));var utils=require(_0x2b6b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2b6b('0x14'));var db=require(_0x2b6b('0x15'))['db'];config[_0x2b6b('0x16')]=_[_0x2b6b('0x17')](config[_0x2b6b('0x16')],{'host':_0x2b6b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b6b('0x16')]));require(_0x2b6b('0x19'))[_0x2b6b('0x1a')](socket);function respondWithStatusCode(_0x1f4d80,_0x34b682){_0x34b682=_0x34b682||0xcc;return function(_0x2f9db6){if(_0x2f9db6){return _0x1f4d80[_0x2b6b('0x1b')](_0x34b682);}return _0x1f4d80[_0x2b6b('0x1c')](_0x34b682)[_0x2b6b('0x1d')]();};}function respondWithResult(_0x201266,_0x468565){_0x468565=_0x468565||0xc8;return function(_0x5abd8d){if(_0x5abd8d){return _0x201266[_0x2b6b('0x1c')](_0x468565)['json'](_0x5abd8d);}};}function respondWithFilteredResult(_0x501596,_0x3a3697){return function(_0x33cd0e){if(_0x33cd0e){var _0x1b2253=typeof _0x3a3697[_0x2b6b('0x1e')]==='undefined'&&typeof _0x3a3697[_0x2b6b('0x1f')]==='undefined';var _0xa2cc8c=_0x33cd0e[_0x2b6b('0x20')];var _0x3c9e9a=_0x1b2253?0x0:_0x3a3697[_0x2b6b('0x1e')];var _0x53d660=_0x1b2253?_0x33cd0e[_0x2b6b('0x20')]:_0x3a3697['offset']+_0x3a3697[_0x2b6b('0x1f')];var _0x5a7da2;if(_0x53d660>=_0xa2cc8c){_0x53d660=_0xa2cc8c;_0x5a7da2=0xc8;}else{_0x5a7da2=0xce;}_0x501596[_0x2b6b('0x1c')](_0x5a7da2);return _0x501596[_0x2b6b('0x21')](_0x2b6b('0x22'),_0x3c9e9a+'-'+_0x53d660+'/'+_0xa2cc8c)[_0x2b6b('0x23')](_0x33cd0e);}return null;};}function patchUpdates(_0x50bd75){return function(_0xd5d73b){try{jsonpatch[_0x2b6b('0x24')](_0xd5d73b,_0x50bd75,!![]);}catch(_0x5b4e1a){return BPromise['reject'](_0x5b4e1a);}return _0xd5d73b[_0x2b6b('0x25')]();};}function saveUpdates(_0x27ca5b,_0x51721b){return function(_0x509233){if(_0x509233){return _0x509233['update'](_0x27ca5b)['then'](function(_0x1e9b99){return _0x1e9b99;});}return null;};}function removeEntity(_0x3b3c4c,_0x333e2d){return function(_0x482b5b){if(_0x482b5b){return _0x482b5b[_0x2b6b('0x26')]()[_0x2b6b('0x27')](function(){var _0x255935=_0x482b5b[_0x2b6b('0x28')]({'plain':!![]});var _0x150d45=_0x2b6b('0x29');return db[_0x2b6b('0x2a')][_0x2b6b('0x26')]({'where':{'type':_0x150d45,'resourceId':_0x255935['id']}})['then'](function(){return _0x482b5b;});})[_0x2b6b('0x27')](function(){_0x3b3c4c['status'](0xcc)[_0x2b6b('0x1d')]();});}};}function handleEntityNotFound(_0xc2154,_0x4eb9d6){return function(_0x4a3e49){if(!_0x4a3e49){_0xc2154['sendStatus'](0x194);}return _0x4a3e49;};}function handleError(_0x183f5a,_0x3ef966){_0x3ef966=_0x3ef966||0x1f4;return function(_0x561ef6){logger[_0x2b6b('0x2b')](_0x561ef6[_0x2b6b('0x2c')]);if(_0x561ef6[_0x2b6b('0x2d')]){delete _0x561ef6[_0x2b6b('0x2d')];}_0x183f5a[_0x2b6b('0x1c')](_0x3ef966)['send'](_0x561ef6);};}exports[_0x2b6b('0x2e')]=function(_0x385017,_0x6f4b95){var _0xff8d7c={},_0x477522={},_0x293298={'count':0x0,'rows':[]};var _0x2694f4=_['map'](db[_0x2b6b('0x2f')][_0x2b6b('0x30')],function(_0x79c178){return{'name':_0x79c178[_0x2b6b('0x31')],'type':_0x79c178['type'][_0x2b6b('0x32')]};});_0x477522[_0x2b6b('0x33')]=_[_0x2b6b('0x34')](_0x2694f4,_0x2b6b('0x2d'));_0x477522[_0x2b6b('0x35')]=_['keys'](_0x385017[_0x2b6b('0x35')]);_0x477522[_0x2b6b('0x36')]=_['intersection'](_0x477522['model'],_0x477522[_0x2b6b('0x35')]);_0xff8d7c[_0x2b6b('0x37')]=_[_0x2b6b('0x38')](_0x477522[_0x2b6b('0x33')],qs['fields'](_0x385017[_0x2b6b('0x35')][_0x2b6b('0x39')]));_0xff8d7c['attributes']=_0xff8d7c['attributes'][_0x2b6b('0x3a')]?_0xff8d7c[_0x2b6b('0x37')]:_0x477522['model'];if(!_0x385017[_0x2b6b('0x35')][_0x2b6b('0x3b')]('nolimit')){_0xff8d7c[_0x2b6b('0x1f')]=qs[_0x2b6b('0x1f')](_0x385017[_0x2b6b('0x35')][_0x2b6b('0x1f')]);_0xff8d7c['offset']=qs[_0x2b6b('0x1e')](_0x385017['query'][_0x2b6b('0x1e')]);}_0xff8d7c[_0x2b6b('0x3c')]=qs[_0x2b6b('0x3d')](_0x385017[_0x2b6b('0x35')][_0x2b6b('0x3d')]);_0xff8d7c[_0x2b6b('0x3e')]=qs[_0x2b6b('0x36')](_['pick'](_0x385017[_0x2b6b('0x35')],_0x477522[_0x2b6b('0x36')]),_0x2694f4);if(_0x385017[_0x2b6b('0x35')][_0x2b6b('0x3f')]){_0xff8d7c[_0x2b6b('0x3e')]=_['merge'](_0xff8d7c['where'],{'$or':_[_0x2b6b('0x34')](_0x2694f4,function(_0x2a077e){if(_0x2a077e[_0x2b6b('0x40')]!=='VIRTUAL'){var _0x5cfa88={};_0x5cfa88[_0x2a077e[_0x2b6b('0x2d')]]={'$like':'%'+_0x385017[_0x2b6b('0x35')][_0x2b6b('0x3f')]+'%'};return _0x5cfa88;}})});}_0xff8d7c=_['merge']({},_0xff8d7c,_0x385017[_0x2b6b('0x41')]);var _0x328613={'where':_0xff8d7c[_0x2b6b('0x3e')]};return db[_0x2b6b('0x2f')][_0x2b6b('0x20')](_0x328613)[_0x2b6b('0x27')](function(_0x4529cc){_0x293298[_0x2b6b('0x20')]=_0x4529cc;if(_0x385017[_0x2b6b('0x35')]['includeAll']){_0xff8d7c['include']=[{'all':!![]}];}return db[_0x2b6b('0x2f')][_0x2b6b('0x42')](_0xff8d7c);})['then'](function(_0x4554b3){_0x293298['rows']=_0x4554b3;return _0x293298;})[_0x2b6b('0x27')](respondWithFilteredResult(_0x6f4b95,_0xff8d7c))[_0x2b6b('0x43')](handleError(_0x6f4b95,null));};exports['show']=function(_0x485f7b,_0x326c64){var _0x318573={'raw':![],'where':{'id':_0x485f7b[_0x2b6b('0x44')]['id']}},_0x52ba0d={};_0x52ba0d[_0x2b6b('0x33')]=_[_0x2b6b('0x45')](db[_0x2b6b('0x2f')][_0x2b6b('0x30')]);_0x52ba0d['query']=_[_0x2b6b('0x45')](_0x485f7b[_0x2b6b('0x35')]);_0x52ba0d[_0x2b6b('0x36')]=_[_0x2b6b('0x38')](_0x52ba0d['model'],_0x52ba0d[_0x2b6b('0x35')]);_0x318573['attributes']=_['intersection'](_0x52ba0d['model'],qs['fields'](_0x485f7b[_0x2b6b('0x35')]['fields']));_0x318573['attributes']=_0x318573[_0x2b6b('0x37')][_0x2b6b('0x3a')]?_0x318573[_0x2b6b('0x37')]:_0x52ba0d[_0x2b6b('0x33')];if(_0x485f7b[_0x2b6b('0x35')][_0x2b6b('0x46')]){_0x318573[_0x2b6b('0x47')]=[{'all':!![]}];}_0x318573=_['merge']({},_0x318573,_0x485f7b[_0x2b6b('0x41')]);return db[_0x2b6b('0x2f')][_0x2b6b('0x48')](_0x318573)[_0x2b6b('0x27')](handleEntityNotFound(_0x326c64,null))[_0x2b6b('0x27')](respondWithResult(_0x326c64,null))[_0x2b6b('0x43')](handleError(_0x326c64,null));};exports[_0x2b6b('0x49')]=function(_0x3bb11a,_0x50f7ed){return db['SquareProject'][_0x2b6b('0x49')](_0x3bb11a[_0x2b6b('0x4a')],{})[_0x2b6b('0x27')](function(_0x56a35c){var _0x5f1353=_0x3bb11a[_0x2b6b('0x4b')][_0x2b6b('0x28')]({'plain':!![]});if(!_0x5f1353)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f1353[_0x2b6b('0x4c')]===_0x2b6b('0x4b')){var _0x4aa70b=_0x56a35c[_0x2b6b('0x28')]({'plain':!![]});var _0x361059='SquareProjects';return db[_0x2b6b('0x4d')]['find']({'where':{'name':_0x361059,'userProfileId':_0x5f1353[_0x2b6b('0x4e')]},'raw':!![]})[_0x2b6b('0x27')](function(_0x4a73b4){if(_0x4a73b4&&_0x4a73b4['autoAssociation']===0x0){return db[_0x2b6b('0x2a')][_0x2b6b('0x49')]({'name':_0x4aa70b[_0x2b6b('0x2d')],'resourceId':_0x4aa70b['id'],'type':_0x4a73b4[_0x2b6b('0x2d')],'sectionId':_0x4a73b4['id']},{})[_0x2b6b('0x27')](function(){return _0x56a35c;});}else{return _0x56a35c;}})[_0x2b6b('0x43')](function(_0x52e4d4){logger[_0x2b6b('0x2b')](_0x2b6b('0x4f'),_0x52e4d4);throw _0x52e4d4;});}return _0x56a35c;})[_0x2b6b('0x27')](respondWithResult(_0x50f7ed,0xc9))[_0x2b6b('0x43')](handleError(_0x50f7ed,null));};exports[_0x2b6b('0x50')]=function(_0x250f5d,_0x5d5dbb){if(_0x250f5d['body']['id']){delete _0x250f5d[_0x2b6b('0x4a')]['id'];}return db[_0x2b6b('0x2f')][_0x2b6b('0x48')]({'where':{'id':_0x250f5d[_0x2b6b('0x44')]['id']}})[_0x2b6b('0x27')](handleEntityNotFound(_0x5d5dbb,null))[_0x2b6b('0x27')](saveUpdates(_0x250f5d[_0x2b6b('0x4a')],null))[_0x2b6b('0x27')](respondWithResult(_0x5d5dbb,null))[_0x2b6b('0x43')](handleError(_0x5d5dbb,null));};exports[_0x2b6b('0x26')]=function(_0x5073f0,_0x1a92a8){return db[_0x2b6b('0x2f')][_0x2b6b('0x48')]({'where':{'id':_0x5073f0['params']['id']}})['then'](handleEntityNotFound(_0x1a92a8,null))[_0x2b6b('0x27')](removeEntity(_0x1a92a8,null))[_0x2b6b('0x43')](handleError(_0x1a92a8,null));};exports[_0x2b6b('0x51')]=function(_0x30abcb,_0x5cd9a7,_0xd9682c){return db[_0x2b6b('0x2f')]['find']({'where':{'id':_0x30abcb['params']['id']}})[_0x2b6b('0x27')](handleEntityNotFound(_0x5cd9a7,null))['then'](function(_0x33a4aa){if(_0x33a4aa){return _0x33a4aa[_0x2b6b('0x51')](_0x30abcb[_0x2b6b('0x4a')][_0x2b6b('0x52')],_[_0x2b6b('0x53')](_0x30abcb['body'],[_0x2b6b('0x52'),'id'])||{});}})[_0x2b6b('0x27')](respondWithResult(_0x5cd9a7,null))[_0x2b6b('0x43')](handleError(_0x5cd9a7,null));};exports[_0x2b6b('0x54')]=function(_0x1e71dc,_0x214114,_0x587bac){return db[_0x2b6b('0x2f')][_0x2b6b('0x48')]({'where':{'id':_0x1e71dc['params']['id']}})[_0x2b6b('0x27')](handleEntityNotFound(_0x214114,null))['then'](function(_0x2b33ff){if(_0x2b33ff){return _0x2b33ff['removeUsers'](_0x1e71dc['query'][_0x2b6b('0x52')])['then'](function(){if(_['isArray'](_0x1e71dc['query'][_0x2b6b('0x52')])){for(var _0x29b2ab=0x0;_0x29b2ab<_0x1e71dc[_0x2b6b('0x35')]['ids'][_0x2b6b('0x3a')];_0x29b2ab+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0x1e71dc[_0x2b6b('0x35')][_0x2b6b('0x52')][_0x29b2ab]),'SquareProjectId':Number(_0x1e71dc[_0x2b6b('0x44')]['id'])});}}else{socket[_0x2b6b('0x55')]('userSquareProject:remove',{'UserId':Number(_0x1e71dc[_0x2b6b('0x35')][_0x2b6b('0x52')]),'SquareProjectId':Number(_0x1e71dc[_0x2b6b('0x44')]['id'])});}});}})[_0x2b6b('0x27')](respondWithStatusCode(_0x214114,null))[_0x2b6b('0x43')](handleError(_0x214114,null));};exports[_0x2b6b('0x56')]=function(_0x31a8db,_0x2393c2,_0x347a96){var _0x330be1={};var _0x56af3d={};var _0x471daf;var _0x174c60;return db[_0x2b6b('0x2f')][_0x2b6b('0x57')]({'where':{'id':_0x31a8db[_0x2b6b('0x44')]['id']}})[_0x2b6b('0x27')](handleEntityNotFound(_0x2393c2,null))[_0x2b6b('0x27')](function(_0x38cb14){if(_0x38cb14){_0x471daf=_0x38cb14;_0x56af3d[_0x2b6b('0x33')]=_[_0x2b6b('0x45')](db[_0x2b6b('0x58')][_0x2b6b('0x30')]);_0x56af3d[_0x2b6b('0x35')]=_[_0x2b6b('0x45')](_0x31a8db[_0x2b6b('0x35')]);_0x56af3d[_0x2b6b('0x36')]=_['intersection'](_0x56af3d[_0x2b6b('0x33')],_0x56af3d[_0x2b6b('0x35')]);_0x330be1[_0x2b6b('0x37')]=_[_0x2b6b('0x38')](_0x56af3d[_0x2b6b('0x33')],qs[_0x2b6b('0x39')](_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x39')]));_0x330be1[_0x2b6b('0x37')]=_0x330be1[_0x2b6b('0x37')][_0x2b6b('0x3a')]?_0x330be1[_0x2b6b('0x37')]:_0x56af3d[_0x2b6b('0x33')];_0x330be1[_0x2b6b('0x3c')]=qs['sort'](_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x3d')]);_0x330be1[_0x2b6b('0x3e')]=qs['filters'](_[_0x2b6b('0x59')](_0x31a8db[_0x2b6b('0x35')],_0x56af3d['filters']));if(_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x3f')]){_0x330be1['where']=_[_0x2b6b('0x5a')](_0x330be1[_0x2b6b('0x3e')],{'$or':_[_0x2b6b('0x34')](_0x330be1[_0x2b6b('0x37')],function(_0x59ab8b){var _0x236bf0={};_0x236bf0[_0x59ab8b]={'$like':'%'+_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x3f')]+'%'};return _0x236bf0;})});}_0x330be1=_[_0x2b6b('0x5a')]({},_0x330be1,_0x31a8db[_0x2b6b('0x41')]);return _0x471daf[_0x2b6b('0x56')](_0x330be1);}})[_0x2b6b('0x27')](function(_0x1e968e){if(_0x1e968e){_0x174c60=_0x1e968e[_0x2b6b('0x3a')];if(!_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x3b')]('nolimit')){_0x330be1[_0x2b6b('0x1f')]=qs[_0x2b6b('0x1f')](_0x31a8db[_0x2b6b('0x35')][_0x2b6b('0x1f')]);_0x330be1[_0x2b6b('0x1e')]=qs[_0x2b6b('0x1e')](_0x31a8db['query'][_0x2b6b('0x1e')]);}return _0x471daf[_0x2b6b('0x56')](_0x330be1);}})[_0x2b6b('0x27')](function(_0x6add17){if(_0x6add17){return _0x6add17?{'count':_0x174c60,'rows':_0x6add17}:null;}})[_0x2b6b('0x27')](respondWithResult(_0x2393c2,null))[_0x2b6b('0x43')](handleError(_0x2393c2,null));}; \ No newline at end of file +var _0xa887=['addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','save','update','then','SquareProjects','destroy','error','stack','name','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x1977f1,_0x19ef5c){var _0x5185ce=function(_0x388d7c){while(--_0x388d7c){_0x1977f1['push'](_0x1977f1['shift']());}};_0x5185ce(++_0x19ef5c);}(_0xa887,0xc9));var _0x7a88=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa887[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x7a88('0x0'));var rimraf=require(_0x7a88('0x1'));var zipdir=require(_0x7a88('0x2'));var jsonpatch=require(_0x7a88('0x3'));var rp=require(_0x7a88('0x4'));var moment=require(_0x7a88('0x5'));var BPromise=require(_0x7a88('0x6'));var Mustache=require(_0x7a88('0x7'));var util=require(_0x7a88('0x8'));var path=require(_0x7a88('0x9'));var sox=require('sox');var csv=require(_0x7a88('0xa'));var ejs=require(_0x7a88('0xb'));var fs=require('fs');var fs_extra=require(_0x7a88('0xc'));var _=require('lodash');var squel=require(_0x7a88('0xd'));var crypto=require(_0x7a88('0xe'));var jsforce=require(_0x7a88('0xf'));var deskjs=require(_0x7a88('0x10'));var toCsv=require(_0x7a88('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7a88('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7a88('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a88('0x13'))(_0x7a88('0x14'));var utils=require(_0x7a88('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7a88('0x16'));var db=require(_0x7a88('0x17'))['db'];config[_0x7a88('0x18')]=_[_0x7a88('0x19')](config['redis'],{'host':_0x7a88('0x1a'),'port':0x18eb});var socket=require(_0x7a88('0x1b'))(new Redis(config[_0x7a88('0x18')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x473c5f,_0x29646d){_0x29646d=_0x29646d||0xcc;return function(_0x5c1f8e){if(_0x5c1f8e){return _0x473c5f[_0x7a88('0x1c')](_0x29646d);}return _0x473c5f['status'](_0x29646d)[_0x7a88('0x1d')]();};}function respondWithResult(_0x941570,_0x41e77d){_0x41e77d=_0x41e77d||0xc8;return function(_0x4f6558){if(_0x4f6558){return _0x941570[_0x7a88('0x1e')](_0x41e77d)[_0x7a88('0x1f')](_0x4f6558);}};}function respondWithFilteredResult(_0x3d4907,_0xe4c533){return function(_0x3e22d1){if(_0x3e22d1){var _0x3c4e1e=typeof _0xe4c533[_0x7a88('0x20')]==='undefined'&&typeof _0xe4c533[_0x7a88('0x21')]===_0x7a88('0x22');var _0x223ba2=_0x3e22d1[_0x7a88('0x23')];var _0x378e41=_0x3c4e1e?0x0:_0xe4c533[_0x7a88('0x20')];var _0x3a7175=_0x3c4e1e?_0x3e22d1[_0x7a88('0x23')]:_0xe4c533[_0x7a88('0x20')]+_0xe4c533[_0x7a88('0x21')];var _0x4b8da1;if(_0x3a7175>=_0x223ba2){_0x3a7175=_0x223ba2;_0x4b8da1=0xc8;}else{_0x4b8da1=0xce;}_0x3d4907[_0x7a88('0x1e')](_0x4b8da1);return _0x3d4907['set'](_0x7a88('0x24'),_0x378e41+'-'+_0x3a7175+'/'+_0x223ba2)[_0x7a88('0x1f')](_0x3e22d1);}return null;};}function patchUpdates(_0x2eea6f){return function(_0x1724dd){try{jsonpatch['apply'](_0x1724dd,_0x2eea6f,!![]);}catch(_0x183f30){return BPromise['reject'](_0x183f30);}return _0x1724dd[_0x7a88('0x25')]();};}function saveUpdates(_0x3d8a24,_0x59e729){return function(_0x2b1b43){if(_0x2b1b43){return _0x2b1b43[_0x7a88('0x26')](_0x3d8a24)[_0x7a88('0x27')](function(_0xf68142){return _0xf68142;});}return null;};}function removeEntity(_0x4d0c0c,_0x4a94a3){return function(_0x293447){if(_0x293447){return _0x293447['destroy']()[_0x7a88('0x27')](function(){var _0x5f457b=_0x293447['get']({'plain':!![]});var _0x85b863=_0x7a88('0x28');return db['UserProfileResource'][_0x7a88('0x29')]({'where':{'type':_0x85b863,'resourceId':_0x5f457b['id']}})[_0x7a88('0x27')](function(){return _0x293447;});})[_0x7a88('0x27')](function(){_0x4d0c0c[_0x7a88('0x1e')](0xcc)[_0x7a88('0x1d')]();});}};}function handleEntityNotFound(_0x7c5bd0,_0x456734){return function(_0x2eb455){if(!_0x2eb455){_0x7c5bd0[_0x7a88('0x1c')](0x194);}return _0x2eb455;};}function handleError(_0x1fd552,_0x2a46f6){_0x2a46f6=_0x2a46f6||0x1f4;return function(_0x2f08be){logger[_0x7a88('0x2a')](_0x2f08be[_0x7a88('0x2b')]);if(_0x2f08be[_0x7a88('0x2c')]){delete _0x2f08be[_0x7a88('0x2c')];}_0x1fd552[_0x7a88('0x1e')](_0x2a46f6)['send'](_0x2f08be);};}exports[_0x7a88('0x2d')]=function(_0x36867a,_0x37b313){var _0x4dd1b6={},_0x115308={},_0x18a37={'count':0x0,'rows':[]};var _0x47c5ad=_['map'](db['SquareProject'][_0x7a88('0x2e')],function(_0x3b885d){return{'name':_0x3b885d['fieldName'],'type':_0x3b885d['type'][_0x7a88('0x2f')]};});_0x115308[_0x7a88('0x30')]=_[_0x7a88('0x31')](_0x47c5ad,'name');_0x115308[_0x7a88('0x32')]=_[_0x7a88('0x33')](_0x36867a[_0x7a88('0x32')]);_0x115308[_0x7a88('0x34')]=_[_0x7a88('0x35')](_0x115308[_0x7a88('0x30')],_0x115308['query']);_0x4dd1b6[_0x7a88('0x36')]=_[_0x7a88('0x35')](_0x115308['model'],qs[_0x7a88('0x37')](_0x36867a[_0x7a88('0x32')][_0x7a88('0x37')]));_0x4dd1b6['attributes']=_0x4dd1b6[_0x7a88('0x36')]['length']?_0x4dd1b6[_0x7a88('0x36')]:_0x115308['model'];if(!_0x36867a[_0x7a88('0x32')][_0x7a88('0x38')](_0x7a88('0x39'))){_0x4dd1b6['limit']=qs[_0x7a88('0x21')](_0x36867a[_0x7a88('0x32')]['limit']);_0x4dd1b6[_0x7a88('0x20')]=qs[_0x7a88('0x20')](_0x36867a[_0x7a88('0x32')][_0x7a88('0x20')]);}_0x4dd1b6[_0x7a88('0x3a')]=qs['sort'](_0x36867a[_0x7a88('0x32')]['sort']);_0x4dd1b6[_0x7a88('0x3b')]=qs['filters'](_[_0x7a88('0x3c')](_0x36867a['query'],_0x115308[_0x7a88('0x34')]),_0x47c5ad);if(_0x36867a[_0x7a88('0x32')][_0x7a88('0x3d')]){_0x4dd1b6[_0x7a88('0x3b')]=_['merge'](_0x4dd1b6[_0x7a88('0x3b')],{'$or':_[_0x7a88('0x31')](_0x47c5ad,function(_0x3b4d9f){if(_0x3b4d9f['type']!==_0x7a88('0x3e')){var _0x4bd46f={};_0x4bd46f[_0x3b4d9f['name']]={'$like':'%'+_0x36867a['query'][_0x7a88('0x3d')]+'%'};return _0x4bd46f;}})});}_0x4dd1b6=_[_0x7a88('0x3f')]({},_0x4dd1b6,_0x36867a[_0x7a88('0x40')]);var _0x2eb8ed={'where':_0x4dd1b6[_0x7a88('0x3b')]};return db[_0x7a88('0x41')][_0x7a88('0x23')](_0x2eb8ed)[_0x7a88('0x27')](function(_0x2e8962){_0x18a37['count']=_0x2e8962;if(_0x36867a[_0x7a88('0x32')][_0x7a88('0x42')]){_0x4dd1b6[_0x7a88('0x43')]=[{'all':!![]}];}return db[_0x7a88('0x41')][_0x7a88('0x44')](_0x4dd1b6);})['then'](function(_0x2cd9ae){_0x18a37[_0x7a88('0x45')]=_0x2cd9ae;return _0x18a37;})[_0x7a88('0x27')](respondWithFilteredResult(_0x37b313,_0x4dd1b6))[_0x7a88('0x46')](handleError(_0x37b313,null));};exports[_0x7a88('0x47')]=function(_0x2d46e7,_0x100708){var _0x2f3d3e={'raw':![],'where':{'id':_0x2d46e7[_0x7a88('0x48')]['id']}},_0x1b9d2f={};_0x1b9d2f[_0x7a88('0x30')]=_[_0x7a88('0x33')](db['SquareProject'][_0x7a88('0x2e')]);_0x1b9d2f[_0x7a88('0x32')]=_[_0x7a88('0x33')](_0x2d46e7[_0x7a88('0x32')]);_0x1b9d2f['filters']=_[_0x7a88('0x35')](_0x1b9d2f['model'],_0x1b9d2f[_0x7a88('0x32')]);_0x2f3d3e[_0x7a88('0x36')]=_[_0x7a88('0x35')](_0x1b9d2f[_0x7a88('0x30')],qs[_0x7a88('0x37')](_0x2d46e7[_0x7a88('0x32')][_0x7a88('0x37')]));_0x2f3d3e[_0x7a88('0x36')]=_0x2f3d3e[_0x7a88('0x36')][_0x7a88('0x49')]?_0x2f3d3e[_0x7a88('0x36')]:_0x1b9d2f[_0x7a88('0x30')];if(_0x2d46e7[_0x7a88('0x32')][_0x7a88('0x42')]){_0x2f3d3e[_0x7a88('0x43')]=[{'all':!![]}];}_0x2f3d3e=_['merge']({},_0x2f3d3e,_0x2d46e7[_0x7a88('0x40')]);return db['SquareProject'][_0x7a88('0x4a')](_0x2f3d3e)[_0x7a88('0x27')](handleEntityNotFound(_0x100708,null))[_0x7a88('0x27')](respondWithResult(_0x100708,null))[_0x7a88('0x46')](handleError(_0x100708,null));};exports[_0x7a88('0x4b')]=function(_0x1c0868,_0x42cfc5){return db[_0x7a88('0x41')][_0x7a88('0x4b')](_0x1c0868[_0x7a88('0x4c')],{})['then'](function(_0x2ab3d5){var _0x3e5a78=_0x1c0868['user'][_0x7a88('0x4d')]({'plain':!![]});if(!_0x3e5a78)throw new Error(_0x7a88('0x4e'));if(_0x3e5a78['role']===_0x7a88('0x4f')){var _0x3423d2=_0x2ab3d5['get']({'plain':!![]});var _0x275d8a='SquareProjects';return db[_0x7a88('0x50')][_0x7a88('0x4a')]({'where':{'name':_0x275d8a,'userProfileId':_0x3e5a78[_0x7a88('0x51')]},'raw':!![]})[_0x7a88('0x27')](function(_0x1659e3){if(_0x1659e3&&_0x1659e3[_0x7a88('0x52')]===0x0){return db[_0x7a88('0x53')][_0x7a88('0x4b')]({'name':_0x3423d2[_0x7a88('0x2c')],'resourceId':_0x3423d2['id'],'type':_0x1659e3['name'],'sectionId':_0x1659e3['id']},{})[_0x7a88('0x27')](function(){return _0x2ab3d5;});}else{return _0x2ab3d5;}})['catch'](function(_0x42a2dc){logger[_0x7a88('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42a2dc);throw _0x42a2dc;});}return _0x2ab3d5;})[_0x7a88('0x27')](respondWithResult(_0x42cfc5,0xc9))[_0x7a88('0x46')](handleError(_0x42cfc5,null));};exports[_0x7a88('0x26')]=function(_0x30d875,_0x766120){if(_0x30d875[_0x7a88('0x4c')]['id']){delete _0x30d875[_0x7a88('0x4c')]['id'];}return db['SquareProject'][_0x7a88('0x4a')]({'where':{'id':_0x30d875[_0x7a88('0x48')]['id']}})[_0x7a88('0x27')](handleEntityNotFound(_0x766120,null))[_0x7a88('0x27')](saveUpdates(_0x30d875[_0x7a88('0x4c')],null))[_0x7a88('0x27')](respondWithResult(_0x766120,null))['catch'](handleError(_0x766120,null));};exports['destroy']=function(_0x2dd8c0,_0x1ff60d){return db[_0x7a88('0x41')][_0x7a88('0x4a')]({'where':{'id':_0x2dd8c0[_0x7a88('0x48')]['id']}})[_0x7a88('0x27')](handleEntityNotFound(_0x1ff60d,null))[_0x7a88('0x27')](removeEntity(_0x1ff60d,null))[_0x7a88('0x46')](handleError(_0x1ff60d,null));};exports[_0x7a88('0x54')]=function(_0x235609,_0x42620d,_0xbcbd60){return db[_0x7a88('0x41')][_0x7a88('0x4a')]({'where':{'id':_0x235609[_0x7a88('0x48')]['id']}})[_0x7a88('0x27')](handleEntityNotFound(_0x42620d,null))['then'](function(_0x3de944){if(_0x3de944){return _0x3de944[_0x7a88('0x54')](_0x235609[_0x7a88('0x4c')][_0x7a88('0x55')],_[_0x7a88('0x56')](_0x235609['body'],[_0x7a88('0x55'),'id'])||{});}})[_0x7a88('0x27')](respondWithResult(_0x42620d,null))[_0x7a88('0x46')](handleError(_0x42620d,null));};exports[_0x7a88('0x57')]=function(_0x30bb7c,_0x3df4c7,_0x28a048){return db['SquareProject']['find']({'where':{'id':_0x30bb7c[_0x7a88('0x48')]['id']}})[_0x7a88('0x27')](handleEntityNotFound(_0x3df4c7,null))[_0x7a88('0x27')](function(_0x58e368){if(_0x58e368){return _0x58e368['removeUsers'](_0x30bb7c['query'][_0x7a88('0x55')])[_0x7a88('0x27')](function(){if(_[_0x7a88('0x58')](_0x30bb7c['query'][_0x7a88('0x55')])){for(var _0x552ac5=0x0;_0x552ac5<_0x30bb7c[_0x7a88('0x32')][_0x7a88('0x55')][_0x7a88('0x49')];_0x552ac5+=0x1){socket[_0x7a88('0x59')](_0x7a88('0x5a'),{'UserId':Number(_0x30bb7c[_0x7a88('0x32')][_0x7a88('0x55')][_0x552ac5]),'SquareProjectId':Number(_0x30bb7c[_0x7a88('0x48')]['id'])});}}else{socket[_0x7a88('0x59')]('userSquareProject:remove',{'UserId':Number(_0x30bb7c['query']['ids']),'SquareProjectId':Number(_0x30bb7c[_0x7a88('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3df4c7,null))[_0x7a88('0x46')](handleError(_0x3df4c7,null));};exports[_0x7a88('0x5b')]=function(_0x308d9c,_0x290f89,_0x220c84){var _0x1140c2={};var _0x288c70={};var _0x176226;var _0x57d222;return db[_0x7a88('0x41')][_0x7a88('0x5c')]({'where':{'id':_0x308d9c[_0x7a88('0x48')]['id']}})[_0x7a88('0x27')](handleEntityNotFound(_0x290f89,null))[_0x7a88('0x27')](function(_0x139c25){if(_0x139c25){_0x176226=_0x139c25;_0x288c70[_0x7a88('0x30')]=_['keys'](db[_0x7a88('0x5d')]['rawAttributes']);_0x288c70[_0x7a88('0x32')]=_['keys'](_0x308d9c[_0x7a88('0x32')]);_0x288c70[_0x7a88('0x34')]=_[_0x7a88('0x35')](_0x288c70[_0x7a88('0x30')],_0x288c70['query']);_0x1140c2[_0x7a88('0x36')]=_[_0x7a88('0x35')](_0x288c70['model'],qs[_0x7a88('0x37')](_0x308d9c[_0x7a88('0x32')][_0x7a88('0x37')]));_0x1140c2['attributes']=_0x1140c2[_0x7a88('0x36')][_0x7a88('0x49')]?_0x1140c2[_0x7a88('0x36')]:_0x288c70[_0x7a88('0x30')];_0x1140c2[_0x7a88('0x3a')]=qs['sort'](_0x308d9c[_0x7a88('0x32')][_0x7a88('0x5e')]);_0x1140c2['where']=qs[_0x7a88('0x34')](_['pick'](_0x308d9c[_0x7a88('0x32')],_0x288c70[_0x7a88('0x34')]));if(_0x308d9c[_0x7a88('0x32')]['filter']){_0x1140c2[_0x7a88('0x3b')]=_[_0x7a88('0x3f')](_0x1140c2['where'],{'$or':_[_0x7a88('0x31')](_0x1140c2[_0x7a88('0x36')],function(_0x427109){var _0xa5df0={};_0xa5df0[_0x427109]={'$like':'%'+_0x308d9c['query']['filter']+'%'};return _0xa5df0;})});}_0x1140c2=_[_0x7a88('0x3f')]({},_0x1140c2,_0x308d9c[_0x7a88('0x40')]);return _0x176226[_0x7a88('0x5b')](_0x1140c2);}})['then'](function(_0x463d7c){if(_0x463d7c){_0x57d222=_0x463d7c['length'];if(!_0x308d9c[_0x7a88('0x32')]['hasOwnProperty']('nolimit')){_0x1140c2['limit']=qs[_0x7a88('0x21')](_0x308d9c[_0x7a88('0x32')][_0x7a88('0x21')]);_0x1140c2[_0x7a88('0x20')]=qs['offset'](_0x308d9c[_0x7a88('0x32')]['offset']);}return _0x176226[_0x7a88('0x5b')](_0x1140c2);}})[_0x7a88('0x27')](function(_0x2d27f2){if(_0x2d27f2){return _0x2d27f2?{'count':_0x57d222,'rows':_0x2d27f2}:null;}})['then'](respondWithResult(_0x290f89,null))[_0x7a88('0x46')](handleError(_0x290f89,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 0ae7922..ac5876e 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 _0xfda3=['hasOwnProperty','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x41620b,_0x11f14d){var _0x587fce=function(_0x43759e){while(--_0x43759e){_0x41620b['push'](_0x41620b['shift']());}};_0x587fce(++_0x11f14d);}(_0xfda3,0x1db));var _0x3fda=function(_0x45b6d4,_0xb7b511){_0x45b6d4=_0x45b6d4-0x0;var _0x368521=_0xfda3[_0x45b6d4];return _0x368521;};'use strict';var EventEmitter=require(_0x3fda('0x0'));var SquareProject=require(_0x3fda('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3fda('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fda('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41ad49){return function(_0x51bf4a,_0x5c729a,_0x3a7d11){SquareProjectEvents[_0x3fda('0x4')](_0x41ad49+':'+_0x51bf4a['id'],_0x51bf4a);SquareProjectEvents[_0x3fda('0x4')](_0x41ad49,_0x51bf4a);_0x3a7d11(null);};}for(var e in events){if(events[_0x3fda('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x4a02=['hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xd839e7,_0x4209e9){var _0xc3cf23=function(_0x16ace2){while(--_0x16ace2){_0xd839e7['push'](_0xd839e7['shift']());}};_0xc3cf23(++_0x4209e9);}(_0x4a02,0xd3));var _0x24a0=function(_0x3f3928,_0x3d719b){_0x3f3928=_0x3f3928-0x0;var _0x46d8ee=_0x4a02[_0x3f3928];return _0x46d8ee;};'use strict';var EventEmitter=require(_0x24a0('0x0'));var SquareProject=require(_0x24a0('0x1'))['db'][_0x24a0('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x24a0('0x3')](0x0);var events={'afterCreate':_0x24a0('0x4'),'afterUpdate':_0x24a0('0x5'),'afterDestroy':_0x24a0('0x6')};function emitEvent(_0xdc508c){return function(_0x57f328,_0x26dc47,_0x4f8884){SquareProjectEvents[_0x24a0('0x7')](_0xdc508c+':'+_0x57f328['id'],_0x57f328);SquareProjectEvents[_0x24a0('0x7')](_0xdc508c,_0x57f328);_0x4f8884(null);};}for(var e in events){if(events[_0x24a0('0x8')](e)){var event=events[e];SquareProject[_0x24a0('0x9')](e,emitEvent(event));}}module[_0x24a0('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 4d94071..e43102c 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 _0xa8ff=['api','moment','request-promise','path','rimraf','./squareProject.attributes','SquareProject','changed','savedAt','format','publishedAt','lodash','util','../../config/logger'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xa8ff,0x131));var _0xfa8f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa8ff[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xfa8f('0x0'));var util=require(_0xfa8f('0x1'));var logger=require(_0xfa8f('0x2'))(_0xfa8f('0x3'));var moment=require(_0xfa8f('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa8f('0x5'));var fs=require('fs');var path=require(_0xfa8f('0x6'));var rimraf=require(_0xfa8f('0x7'));var config=require('../../config/environment');var attributes=require(_0xfa8f('0x8'));module['exports']=function(_0x757e92,_0x4e5e9e){return _0x757e92['define'](_0xfa8f('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b1e31,_0x481299,_0x155055){if(_0x4b1e31[_0xfa8f('0xa')]('preproduction')){_0x4b1e31[_0xfa8f('0xb')]=moment()[_0xfa8f('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4b1e31[_0xfa8f('0xa')]('production')){_0x4b1e31[_0xfa8f('0xd')]=moment()[_0xfa8f('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x155055(null,_0x4b1e31);}}});}; \ No newline at end of file +var _0xb736=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment'];(function(_0x19f3ee,_0x109bba){var _0x4deb8d=function(_0x3a05a0){while(--_0x3a05a0){_0x19f3ee['push'](_0x19f3ee['shift']());}};_0x4deb8d(++_0x109bba);}(_0xb736,0x114));var _0x6b73=function(_0x9d424a,_0x15274c){_0x9d424a=_0x9d424a-0x0;var _0x214bfc=_0xb736[_0x9d424a];return _0x214bfc;};'use strict';var _=require(_0x6b73('0x0'));var util=require(_0x6b73('0x1'));var logger=require('../../config/logger')(_0x6b73('0x2'));var moment=require(_0x6b73('0x3'));var BPromise=require('bluebird');var rp=require(_0x6b73('0x4'));var fs=require('fs');var path=require(_0x6b73('0x5'));var rimraf=require(_0x6b73('0x6'));var config=require(_0x6b73('0x7'));var attributes=require(_0x6b73('0x8'));module[_0x6b73('0x9')]=function(_0x5d834f,_0x26343e){return _0x5d834f[_0x6b73('0xa')](_0x6b73('0xb'),attributes,{'tableName':_0x6b73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45a57f,_0x214563,_0x20f073){if(_0x45a57f[_0x6b73('0xd')](_0x6b73('0xe'))){_0x45a57f[_0x6b73('0xf')]=moment()[_0x6b73('0x10')](_0x6b73('0x11'));}if(_0x45a57f['changed'](_0x6b73('0x12'))){_0x45a57f[_0x6b73('0x13')]=moment()['format'](_0x6b73('0x11'));}_0x20f073(null,_0x45a57f);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1f50e9e..809a7ba 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 _0xe627=['rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xaf045d,_0x551309){var _0xe2e45e=function(_0x3d1099){while(--_0x3d1099){_0xaf045d['push'](_0xaf045d['shift']());}};_0xe2e45e(++_0x551309);}(_0xe627,0x1ac));var _0x7e62=function(_0x42e524,_0xcd5591){_0x42e524=_0x42e524-0x0;var _0x59e746=_0xe627[_0x42e524];return _0x59e746;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7e62('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e62('0x1'));var db=require(_0x7e62('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e62('0x3'))(_0x7e62('0x4'));var config=require('../../config/environment');var jayson=require(_0x7e62('0x5'));var client=jayson[_0x7e62('0x6')][_0x7e62('0x7')]({'port':0x232a});config[_0x7e62('0x8')]=_['defaults'](config[_0x7e62('0x8')],{'host':_0x7e62('0x9'),'port':0x18eb});var socket=require(_0x7e62('0xa'))(new Redis(config[_0x7e62('0x8')]));require(_0x7e62('0xb'))[_0x7e62('0xc')](socket);function respondWithRpcPromise(_0x2c6408,_0x33b8b3,_0x299aba){return new BPromise(function(_0x20eeb8,_0x41cdfa){return client[_0x7e62('0xd')](_0x2c6408,_0x299aba)['then'](function(_0xeebd3f){logger[_0x7e62('0xe')](_0x7e62('0xf'),_0x33b8b3,_0x7e62('0x10'));logger[_0x7e62('0x11')](_0x7e62('0x12'),_0x33b8b3,_0x7e62('0x10'),JSON[_0x7e62('0x13')](_0xeebd3f));if(_0xeebd3f['error']){if(_0xeebd3f[_0x7e62('0x14')][_0x7e62('0x15')]===0x1f4){logger[_0x7e62('0x14')](_0x7e62('0xf'),_0x33b8b3,_0xeebd3f['error']['message']);return _0x41cdfa(_0xeebd3f[_0x7e62('0x14')][_0x7e62('0x16')]);}logger[_0x7e62('0x14')](_0x7e62('0xf'),_0x33b8b3,_0xeebd3f[_0x7e62('0x14')][_0x7e62('0x16')]);return _0x20eeb8(_0xeebd3f['error'][_0x7e62('0x16')]);}else{logger[_0x7e62('0xe')](_0x7e62('0xf'),_0x33b8b3,_0x7e62('0x10'));_0x20eeb8(_0xeebd3f[_0x7e62('0x17')][_0x7e62('0x16')]);}})[_0x7e62('0x18')](function(_0x21a2f9){logger[_0x7e62('0x14')](_0x7e62('0xf'),_0x33b8b3,_0x21a2f9);_0x41cdfa(_0x21a2f9);});});}exports[_0x7e62('0x19')]=function(_0x11b00b){var _0x4fdeae=this;return new Promise(function(_0x53bf4e,_0x2b6425){return db[_0x7e62('0x1a')][_0x7e62('0x1b')]({'raw':_0x11b00b[_0x7e62('0x1c')]?_0x11b00b[_0x7e62('0x1c')][_0x7e62('0x1d')]===undefined?!![]:![]:!![],'where':_0x11b00b[_0x7e62('0x1c')]?_0x11b00b[_0x7e62('0x1c')][_0x7e62('0x1e')]||null:null,'attributes':_0x11b00b[_0x7e62('0x1c')]?_0x11b00b[_0x7e62('0x1c')][_0x7e62('0x1f')]||null:null,'include':_0x11b00b['options']?_0x11b00b[_0x7e62('0x1c')][_0x7e62('0x20')]?_[_0x7e62('0x21')](_0x11b00b[_0x7e62('0x1c')]['include'],function(_0x2b7568){return{'model':db[_0x2b7568[_0x7e62('0x22')]],'as':_0x2b7568['as'],'attributes':_0x2b7568[_0x7e62('0x1f')],'include':_0x2b7568['include']?_[_0x7e62('0x21')](_0x2b7568[_0x7e62('0x20')],function(_0x4f29c3){return{'model':db[_0x4f29c3[_0x7e62('0x22')]],'as':_0x4f29c3['as'],'attributes':_0x4f29c3['attributes'],'include':_0x4f29c3[_0x7e62('0x20')]?_['map'](_0x4f29c3[_0x7e62('0x20')],function(_0x1d8756){return{'model':db[_0x1d8756[_0x7e62('0x22')]],'as':_0x1d8756['as'],'attributes':_0x1d8756['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e62('0x23')](function(_0x5182bf){logger[_0x7e62('0xe')](_0x7e62('0x19'),_0x11b00b);logger[_0x7e62('0x11')]('ShowSquareProject',_0x11b00b,JSON['stringify'](_0x5182bf));_0x53bf4e(_0x5182bf);})[_0x7e62('0x18')](function(_0x561703){logger[_0x7e62('0x14')](_0x7e62('0x19'),_0x561703[_0x7e62('0x16')],_0x11b00b);_0x2b6425(_0x4fdeae[_0x7e62('0x14')](0x1f4,_0x561703[_0x7e62('0x16')]));});});}; \ No newline at end of file +var _0xc61b=['localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','result','ShowSquareProject','SquareProject','find','options','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2c5ca9,_0x9f654f){var _0x448662=function(_0x2573a8){while(--_0x2573a8){_0x2c5ca9['push'](_0x2c5ca9['shift']());}};_0x448662(++_0x9f654f);}(_0xc61b,0x18a));var _0xbc61=function(_0x46a5f2,_0x40780d){_0x46a5f2=_0x46a5f2-0x0;var _0xe2e610=_0xc61b[_0x46a5f2];return _0xe2e610;};'use strict';var _=require(_0xbc61('0x0'));var util=require(_0xbc61('0x1'));var moment=require(_0xbc61('0x2'));var BPromise=require(_0xbc61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc61('0x4'));var db=require(_0xbc61('0x5'))['db'];var utils=require(_0xbc61('0x6'));var logger=require('../../config/logger')(_0xbc61('0x7'));var config=require(_0xbc61('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbc61('0x9')][_0xbc61('0xa')]({'port':0x232a});config[_0xbc61('0xb')]=_[_0xbc61('0xc')](config['redis'],{'host':_0xbc61('0xd'),'port':0x18eb});var socket=require(_0xbc61('0xe'))(new Redis(config[_0xbc61('0xb')]));require(_0xbc61('0xf'))['register'](socket);function respondWithRpcPromise(_0x4cd537,_0x5295ca,_0xa02e55){return new BPromise(function(_0x1612e8,_0x114e3b){return client[_0xbc61('0x10')](_0x4cd537,_0xa02e55)[_0xbc61('0x11')](function(_0x3bbf8f){logger[_0xbc61('0x12')](_0xbc61('0x13'),_0x5295ca,_0xbc61('0x14'));logger[_0xbc61('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x5295ca,'request\x20sent',JSON[_0xbc61('0x16')](_0x3bbf8f));if(_0x3bbf8f['error']){if(_0x3bbf8f['error'][_0xbc61('0x17')]===0x1f4){logger['error'](_0xbc61('0x13'),_0x5295ca,_0x3bbf8f['error'][_0xbc61('0x18')]);return _0x114e3b(_0x3bbf8f[_0xbc61('0x19')][_0xbc61('0x18')]);}logger['error'](_0xbc61('0x13'),_0x5295ca,_0x3bbf8f[_0xbc61('0x19')][_0xbc61('0x18')]);return _0x1612e8(_0x3bbf8f['error'][_0xbc61('0x18')]);}else{logger['info'](_0xbc61('0x13'),_0x5295ca,'request\x20sent');_0x1612e8(_0x3bbf8f[_0xbc61('0x1a')][_0xbc61('0x18')]);}})['catch'](function(_0x20aed2){logger[_0xbc61('0x19')](_0xbc61('0x13'),_0x5295ca,_0x20aed2);_0x114e3b(_0x20aed2);});});}exports[_0xbc61('0x1b')]=function(_0x5309c6){var _0x20b9b2=this;return new Promise(function(_0x45e9dd,_0x49b113){return db[_0xbc61('0x1c')][_0xbc61('0x1d')]({'raw':_0x5309c6['options']?_0x5309c6[_0xbc61('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5309c6[_0xbc61('0x1e')]?_0x5309c6[_0xbc61('0x1e')][_0xbc61('0x1f')]||null:null,'attributes':_0x5309c6[_0xbc61('0x1e')]?_0x5309c6['options'][_0xbc61('0x20')]||null:null,'include':_0x5309c6[_0xbc61('0x1e')]?_0x5309c6['options'][_0xbc61('0x21')]?_['map'](_0x5309c6[_0xbc61('0x1e')]['include'],function(_0xd5677c){return{'model':db[_0xd5677c[_0xbc61('0x22')]],'as':_0xd5677c['as'],'attributes':_0xd5677c[_0xbc61('0x20')],'include':_0xd5677c['include']?_[_0xbc61('0x23')](_0xd5677c[_0xbc61('0x21')],function(_0x22864c){return{'model':db[_0x22864c[_0xbc61('0x22')]],'as':_0x22864c['as'],'attributes':_0x22864c[_0xbc61('0x20')],'include':_0x22864c[_0xbc61('0x21')]?_['map'](_0x22864c[_0xbc61('0x21')],function(_0x14dab5){return{'model':db[_0x14dab5['model']],'as':_0x14dab5['as'],'attributes':_0x14dab5[_0xbc61('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbc61('0x11')](function(_0x5b801f){logger[_0xbc61('0x12')](_0xbc61('0x1b'),_0x5309c6);logger[_0xbc61('0x15')]('ShowSquareProject',_0x5309c6,JSON[_0xbc61('0x16')](_0x5b801f));_0x45e9dd(_0x5b801f);})[_0xbc61('0x24')](function(_0x3e0d9d){logger[_0xbc61('0x19')]('ShowSquareProject',_0x3e0d9d[_0xbc61('0x18')],_0x5309c6);_0x49b113(_0x20b9b2['error'](0x1f4,_0x3e0d9d[_0xbc61('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 9537d4c..a2cfa64 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 _0xd8a1=['save','remove','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x158b06,_0x3a27ee){var _0x3d8263=function(_0x469d6b){while(--_0x469d6b){_0x158b06['push'](_0x158b06['shift']());}};_0x3d8263(++_0x3a27ee);}(_0xd8a1,0x1b7));var _0x1d8a=function(_0xf96bc3,_0x435f56){_0xf96bc3=_0xf96bc3-0x0;var _0x54e7a6=_0xd8a1[_0xf96bc3];return _0x54e7a6;};'use strict';var SquareProjectEvents=require(_0x1d8a('0x0'));var events=[_0x1d8a('0x1'),_0x1d8a('0x2'),'update'];function createListener(_0x51739a,_0x2e1c18){return function(_0x7e412){_0x2e1c18[_0x1d8a('0x3')](_0x51739a,_0x7e412);};}function removeListener(_0x46d30c,_0x3eef67){return function(){SquareProjectEvents[_0x1d8a('0x4')](_0x46d30c,_0x3eef67);};}exports[_0x1d8a('0x5')]=function(_0x5f455b){for(var _0x15b083=0x0,_0xacab33=events[_0x1d8a('0x6')];_0x15b083<_0xacab33;_0x15b083++){var _0x3c52a0=events[_0x15b083];var _0x271d8f=createListener(_0x1d8a('0x7')+_0x3c52a0,_0x5f455b);SquareProjectEvents['on'](_0x3c52a0,_0x271d8f);}}; \ No newline at end of file +var _0xb24a=['emit','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x17240d,_0x28057e){var _0x22cfb6=function(_0x3213da){while(--_0x3213da){_0x17240d['push'](_0x17240d['shift']());}};_0x22cfb6(++_0x28057e);}(_0xb24a,0xce));var _0xab24=function(_0xf93076,_0x1acb30){_0xf93076=_0xf93076-0x0;var _0x33d1da=_0xb24a[_0xf93076];return _0x33d1da;};'use strict';var SquareProjectEvents=require(_0xab24('0x0'));var events=[_0xab24('0x1'),_0xab24('0x2'),_0xab24('0x3')];function createListener(_0x441aa0,_0x1217c0){return function(_0xd10e41){_0x1217c0[_0xab24('0x4')](_0x441aa0,_0xd10e41);};}function removeListener(_0xe7826d,_0x5a6400){return function(){SquareProjectEvents['removeListener'](_0xe7826d,_0x5a6400);};}exports['register']=function(_0x4b504b){for(var _0x377b39=0x0,_0x71e1a=events[_0xab24('0x5')];_0x377b39<_0x71e1a;_0x377b39++){var _0x46ed22=events[_0x377b39];var _0x376577=createListener(_0xab24('0x6')+_0x46ed22,_0x4b504b);SquareProjectEvents['on'](_0x46ed22,_0x376577);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index aeadb54..deca4d9 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x5f4fdb,_0x59a7db){var _0x170fa7=function(_0x1cdd85){while(--_0x1cdd85){_0x5f4fdb['push'](_0x5f4fdb['shift']());}};_0x170fa7(++_0x59a7db);}(_0x5fc3,0xa8));var _0x35fc=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5fc3[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x46ca3d,_0x360bad){var _0x3c195e=function(_0x394f9c){while(--_0x394f9c){_0x46ca3d['push'](_0x46ca3d['shift']());}};_0x3c195e(++_0x360bad);}(_0x326f,0xd1));var _0xf326=function(_0x3ac328,_0x2a8069){_0x3ac328=_0x3ac328-0x0;var _0x318f45=_0x326f[_0x3ac328];return _0x318f45;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index aca8fa9..707c3b3 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 _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x3816d1,_0x12c81f){var _0x568910=function(_0x34e208){while(--_0x34e208){_0x3816d1['push'](_0x3816d1['shift']());}};_0x568910(++_0x12c81f);}(_0x814b,0x1a2));var _0xb814=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0x814b[_0x3d18af];return _0x2ef919;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}}; \ No newline at end of file +var _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3badca,_0x1425e6){_0x3badca=_0x3badca-0x0;var _0x5af642=_0x3eea[_0x3badca];return _0x5af642;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9464b65..0d05695 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 _0x3fef=['includeAll','include','findAll','rows','catch','show','params','options','find','create','update','body','../../components/encryptor','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','destroy','sendStatus','error','name','send','map','SquareRecording','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x32b122,_0x1ad490){var _0x4ad25a=function(_0x590ee6){while(--_0x590ee6){_0x32b122['push'](_0x32b122['shift']());}};_0x4ad25a(++_0x1ad490);}(_0x3fef,0x1a3));var _0xf3fe=function(_0x1ae27a,_0x102972){_0x1ae27a=_0x1ae27a-0x0;var _0x2afe9e=_0x3fef[_0x1ae27a];return _0x2afe9e;};'use strict';var emlformat=require(_0xf3fe('0x0'));var rimraf=require(_0xf3fe('0x1'));var zipdir=require(_0xf3fe('0x2'));var jsonpatch=require(_0xf3fe('0x3'));var rp=require(_0xf3fe('0x4'));var moment=require(_0xf3fe('0x5'));var BPromise=require(_0xf3fe('0x6'));var Mustache=require('mustache');var util=require(_0xf3fe('0x7'));var path=require(_0xf3fe('0x8'));var sox=require(_0xf3fe('0x9'));var csv=require(_0xf3fe('0xa'));var ejs=require(_0xf3fe('0xb'));var fs=require('fs');var fs_extra=require(_0xf3fe('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf3fe('0xd'));var jsforce=require(_0xf3fe('0xe'));var deskjs=require(_0xf3fe('0xf'));var toCsv=require(_0xf3fe('0xa'));var querystring=require(_0xf3fe('0x10'));var Papa=require(_0xf3fe('0x11'));var Redis=require('ioredis');var authService=require(_0xf3fe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf3fe('0x13'));var hardwareService=require(_0xf3fe('0x14'));var logger=require(_0xf3fe('0x15'))(_0xf3fe('0x16'));var utils=require(_0xf3fe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf3fe('0x18'));var db=require(_0xf3fe('0x19'))['db'];function respondWithStatusCode(_0x4b6f4b,_0x426e3f){_0x426e3f=_0x426e3f||0xcc;return function(_0x2fd482){if(_0x2fd482){return _0x4b6f4b['sendStatus'](_0x426e3f);}return _0x4b6f4b[_0xf3fe('0x1a')](_0x426e3f)[_0xf3fe('0x1b')]();};}function respondWithResult(_0x118c5e,_0x1efd0b){_0x1efd0b=_0x1efd0b||0xc8;return function(_0x51f5bf){if(_0x51f5bf){return _0x118c5e['status'](_0x1efd0b)['json'](_0x51f5bf);}};}function respondWithFilteredResult(_0x34cdab,_0x21f717){return function(_0xc622b7){if(_0xc622b7){var _0x1cc40a=typeof _0x21f717[_0xf3fe('0x1c')]===_0xf3fe('0x1d')&&typeof _0x21f717[_0xf3fe('0x1e')]===_0xf3fe('0x1d');var _0x4d4c3f=_0xc622b7[_0xf3fe('0x1f')];var _0x4d4f74=_0x1cc40a?0x0:_0x21f717[_0xf3fe('0x1c')];var _0x8bd7bc=_0x1cc40a?_0xc622b7[_0xf3fe('0x1f')]:_0x21f717[_0xf3fe('0x1c')]+_0x21f717[_0xf3fe('0x1e')];var _0x186340;if(_0x8bd7bc>=_0x4d4c3f){_0x8bd7bc=_0x4d4c3f;_0x186340=0xc8;}else{_0x186340=0xce;}_0x34cdab['status'](_0x186340);return _0x34cdab['set'](_0xf3fe('0x20'),_0x4d4f74+'-'+_0x8bd7bc+'/'+_0x4d4c3f)[_0xf3fe('0x21')](_0xc622b7);}return null;};}function patchUpdates(_0x3da80e){return function(_0xb63138){try{jsonpatch[_0xf3fe('0x22')](_0xb63138,_0x3da80e,!![]);}catch(_0x3e29c5){return BPromise[_0xf3fe('0x23')](_0x3e29c5);}return _0xb63138['save']();};}function saveUpdates(_0x5bec95,_0x27680a){return function(_0x5a4cd3){if(_0x5a4cd3){return _0x5a4cd3['update'](_0x5bec95)[_0xf3fe('0x24')](function(_0x10b630){return _0x10b630;});}return null;};}function removeEntity(_0x12c7af,_0xb28bea){return function(_0x3c935b){if(_0x3c935b){return _0x3c935b[_0xf3fe('0x25')]()['then'](function(){_0x12c7af[_0xf3fe('0x1a')](0xcc)[_0xf3fe('0x1b')]();});}};}function handleEntityNotFound(_0x59a0b1,_0x447df0){return function(_0x14fe20){if(!_0x14fe20){_0x59a0b1[_0xf3fe('0x26')](0x194);}return _0x14fe20;};}function handleError(_0x43539b,_0x505a1b){_0x505a1b=_0x505a1b||0x1f4;return function(_0xa7c077){logger[_0xf3fe('0x27')](_0xa7c077['stack']);if(_0xa7c077[_0xf3fe('0x28')]){delete _0xa7c077[_0xf3fe('0x28')];}_0x43539b[_0xf3fe('0x1a')](_0x505a1b)[_0xf3fe('0x29')](_0xa7c077);};}exports['index']=function(_0x5240b1,_0x3fc950){var _0x3f9185={},_0x10ea14={},_0x1aff0e={'count':0x0,'rows':[]};var _0x3d2621=_[_0xf3fe('0x2a')](db[_0xf3fe('0x2b')]['rawAttributes'],function(_0x30da3a){return{'name':_0x30da3a['fieldName'],'type':_0x30da3a[_0xf3fe('0x2c')]['key']};});_0x10ea14[_0xf3fe('0x2d')]=_[_0xf3fe('0x2a')](_0x3d2621,_0xf3fe('0x28'));_0x10ea14[_0xf3fe('0x2e')]=_[_0xf3fe('0x2f')](_0x5240b1[_0xf3fe('0x2e')]);_0x10ea14[_0xf3fe('0x30')]=_[_0xf3fe('0x31')](_0x10ea14[_0xf3fe('0x2d')],_0x10ea14['query']);_0x3f9185['attributes']=_[_0xf3fe('0x31')](_0x10ea14[_0xf3fe('0x2d')],qs[_0xf3fe('0x32')](_0x5240b1[_0xf3fe('0x2e')][_0xf3fe('0x32')]));_0x3f9185['attributes']=_0x3f9185[_0xf3fe('0x33')][_0xf3fe('0x34')]?_0x3f9185[_0xf3fe('0x33')]:_0x10ea14[_0xf3fe('0x2d')];if(!_0x5240b1[_0xf3fe('0x2e')][_0xf3fe('0x35')](_0xf3fe('0x36'))){_0x3f9185[_0xf3fe('0x1e')]=qs[_0xf3fe('0x1e')](_0x5240b1[_0xf3fe('0x2e')]['limit']);_0x3f9185[_0xf3fe('0x1c')]=qs[_0xf3fe('0x1c')](_0x5240b1[_0xf3fe('0x2e')]['offset']);}_0x3f9185['order']=qs[_0xf3fe('0x37')](_0x5240b1['query'][_0xf3fe('0x37')]);_0x3f9185[_0xf3fe('0x38')]=qs[_0xf3fe('0x30')](_[_0xf3fe('0x39')](_0x5240b1['query'],_0x10ea14['filters']),_0x3d2621);if(_0x5240b1[_0xf3fe('0x2e')][_0xf3fe('0x3a')]){_0x3f9185[_0xf3fe('0x38')]=_[_0xf3fe('0x3b')](_0x3f9185['where'],{'$or':_[_0xf3fe('0x2a')](_0x3d2621,function(_0xc18f59){if(_0xc18f59[_0xf3fe('0x2c')]!==_0xf3fe('0x3c')){var _0x148776={};_0x148776[_0xc18f59[_0xf3fe('0x28')]]={'$like':'%'+_0x5240b1[_0xf3fe('0x2e')][_0xf3fe('0x3a')]+'%'};return _0x148776;}})});}_0x3f9185=_[_0xf3fe('0x3b')]({},_0x3f9185,_0x5240b1['options']);var _0x907898={'where':_0x3f9185[_0xf3fe('0x38')]};return db[_0xf3fe('0x2b')][_0xf3fe('0x1f')](_0x907898)['then'](function(_0x4ef56c){_0x1aff0e[_0xf3fe('0x1f')]=_0x4ef56c;if(_0x5240b1[_0xf3fe('0x2e')][_0xf3fe('0x3d')]){_0x3f9185[_0xf3fe('0x3e')]=[{'all':!![]}];}return db[_0xf3fe('0x2b')][_0xf3fe('0x3f')](_0x3f9185);})[_0xf3fe('0x24')](function(_0x1ec9d7){_0x1aff0e[_0xf3fe('0x40')]=_0x1ec9d7;return _0x1aff0e;})[_0xf3fe('0x24')](respondWithFilteredResult(_0x3fc950,_0x3f9185))[_0xf3fe('0x41')](handleError(_0x3fc950,null));};exports[_0xf3fe('0x42')]=function(_0x36e15c,_0x25c0da){var _0x5735a1={'raw':!![],'where':{'id':_0x36e15c[_0xf3fe('0x43')]['id']}},_0x415217={};_0x415217[_0xf3fe('0x2d')]=_[_0xf3fe('0x2f')](db[_0xf3fe('0x2b')]['rawAttributes']);_0x415217[_0xf3fe('0x2e')]=_[_0xf3fe('0x2f')](_0x36e15c[_0xf3fe('0x2e')]);_0x415217[_0xf3fe('0x30')]=_[_0xf3fe('0x31')](_0x415217[_0xf3fe('0x2d')],_0x415217[_0xf3fe('0x2e')]);_0x5735a1[_0xf3fe('0x33')]=_[_0xf3fe('0x31')](_0x415217[_0xf3fe('0x2d')],qs[_0xf3fe('0x32')](_0x36e15c[_0xf3fe('0x2e')][_0xf3fe('0x32')]));_0x5735a1[_0xf3fe('0x33')]=_0x5735a1['attributes'][_0xf3fe('0x34')]?_0x5735a1['attributes']:_0x415217[_0xf3fe('0x2d')];if(_0x36e15c[_0xf3fe('0x2e')][_0xf3fe('0x3d')]){_0x5735a1['include']=[{'all':!![]}];}_0x5735a1=_[_0xf3fe('0x3b')]({},_0x5735a1,_0x36e15c[_0xf3fe('0x44')]);return db[_0xf3fe('0x2b')][_0xf3fe('0x45')](_0x5735a1)[_0xf3fe('0x24')](handleEntityNotFound(_0x25c0da,null))[_0xf3fe('0x24')](respondWithResult(_0x25c0da,null))[_0xf3fe('0x41')](handleError(_0x25c0da,null));};exports[_0xf3fe('0x46')]=function(_0x54371c,_0x67b890){return db[_0xf3fe('0x2b')][_0xf3fe('0x46')](_0x54371c['body'],{})[_0xf3fe('0x24')](respondWithResult(_0x67b890,0xc9))[_0xf3fe('0x41')](handleError(_0x67b890,null));};exports[_0xf3fe('0x47')]=function(_0x23e99e,_0x360262){if(_0x23e99e[_0xf3fe('0x48')]['id']){delete _0x23e99e[_0xf3fe('0x48')]['id'];}return db[_0xf3fe('0x2b')][_0xf3fe('0x45')]({'where':{'id':_0x23e99e['params']['id']}})[_0xf3fe('0x24')](handleEntityNotFound(_0x360262,null))[_0xf3fe('0x24')](saveUpdates(_0x23e99e[_0xf3fe('0x48')],null))[_0xf3fe('0x24')](respondWithResult(_0x360262,null))[_0xf3fe('0x41')](handleError(_0x360262,null));};exports['download']=function(_0x256eea,_0x26da3b,_0x237ea8){var _0x2406b6=require(_0xf3fe('0x49'));var _0xeba57f=![];var _0xba701e={};if(_0x256eea['query']['type']&&_0x256eea[_0xf3fe('0x2e')][_0xf3fe('0x2c')]===_0xf3fe('0x4a')){_0xba701e[_0xf3fe('0x4a')]=_0x256eea['params']['id'];}else{_0xba701e['id']=_0x256eea[_0xf3fe('0x43')]['id'];}return db[_0xf3fe('0x2b')][_0xf3fe('0x45')]({'where':_0xba701e,'attributes':['id','savePath',_0xf3fe('0x4b')],'raw':!![]})[_0xf3fe('0x24')](handleEntityNotFound(_0x26da3b,null))[_0xf3fe('0x24')](function(_0x1b35b9){if(_0x1b35b9){var _0xd2d892=_0x1b35b9[_0xf3fe('0x4c')];var _0x1ce50d=util['format'](_0xf3fe('0x4d'),_0xd2d892);if(fs[_0xf3fe('0x4e')](_0x1ce50d)){_0xeba57f=!![];return _0x2406b6[_0xf3fe('0x4f')](_0x1ce50d,_0xd2d892,config[_0xf3fe('0x50')]['recording'])[_0xf3fe('0x24')](function(){return _0x1b35b9;});}return _0x1b35b9;}})[_0xf3fe('0x24')](function(_0x1155ff){if(_0x1155ff){var _0x9f98e6=_0x1155ff['savePath'];if(!fs[_0xf3fe('0x4e')](_0x9f98e6)){throw new db[(_0xf3fe('0x51'))][(_0xf3fe('0x52'))](_0xf3fe('0x53'));}if(_0x1155ff[_0xf3fe('0x4b')]){return _0x26da3b[_0xf3fe('0x54')](_0x9f98e6,_0x1155ff['filename']+path[_0xf3fe('0x55')](_0x9f98e6),function(){if(_0xeba57f){fs[_0xf3fe('0x56')](_0x9f98e6);}});}else{return _0x26da3b[_0xf3fe('0x54')](_0x9f98e6,function(_0x4a525b){if(_0xeba57f){fs['unlink'](_0x9f98e6);}});}}})[_0xf3fe('0x41')](function(_0x5bc567){if(_0x5bc567[_0xf3fe('0x57')]===_0xf3fe('0x53')){_0x26da3b['status'](0x194)[_0xf3fe('0x29')](_0xf3fe('0x58'));}else{return handleError(_0x26da3b,null);}});};exports[_0xf3fe('0x25')]=function(_0x20fb7d,_0x101575){return db[_0xf3fe('0x2b')]['find']({'where':{'id':_0x20fb7d[_0xf3fe('0x43')]['id']}})['then'](function(_0x2e378a){if(_[_0xf3fe('0x59')](_0x2e378a)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2e378a;})[_0xf3fe('0x24')](function(_0x53916b){var _0x2aa5ed=_0x53916b[_0xf3fe('0x4c')];logger[_0xf3fe('0x5a')](_0xf3fe('0x5b'),_0x2aa5ed);if(!_[_0xf3fe('0x59')](_0x53916b[_0xf3fe('0x4c')])&&fs['existsSync'](_0x2aa5ed)){logger['info'](_0xf3fe('0x5c')+_0x2aa5ed+_0xf3fe('0x5d'));fs[_0xf3fe('0x5e')](_0x2aa5ed);}_0x2aa5ed=_0x2aa5ed+_0xf3fe('0x5f');if(!_[_0xf3fe('0x59')](_0x53916b['savePath'])&&fs[_0xf3fe('0x4e')](_0x2aa5ed)){logger['info'](_0xf3fe('0x5c')+_0x2aa5ed+_0xf3fe('0x5d'));fs[_0xf3fe('0x5e')](_0x2aa5ed);}return _0x53916b;})[_0xf3fe('0x24')](function(_0x561fe1){if(!_0x561fe1)throw new InternalError();return _0x561fe1[_0xf3fe('0x25')]();})[_0xf3fe('0x24')](function(){_0x101575[_0xf3fe('0x1a')](0xcc)[_0xf3fe('0x1b')]();})['catch'](handleError(_0x101575,null));}; \ No newline at end of file +var _0x08a7=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','type','key','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','length','include','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x08a7,0xff));var _0x708a=function(_0x3f34e4,_0x1b1d2e){_0x3f34e4=_0x3f34e4-0x0;var _0x4f176e=_0x08a7[_0x3f34e4];return _0x4f176e;};'use strict';var emlformat=require(_0x708a('0x0'));var rimraf=require(_0x708a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x708a('0x2'));var BPromise=require(_0x708a('0x3'));var Mustache=require(_0x708a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x708a('0x5'));var csv=require(_0x708a('0x6'));var ejs=require(_0x708a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x708a('0x8'));var jsforce=require(_0x708a('0x9'));var deskjs=require(_0x708a('0xa'));var toCsv=require(_0x708a('0x6'));var querystring=require(_0x708a('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x708a('0xc'));var as=require(_0x708a('0xd'));var hardwareService=require(_0x708a('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x708a('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x708a('0x10'));var db=require(_0x708a('0x11'))['db'];function respondWithStatusCode(_0x35eabc,_0x507c4f){_0x507c4f=_0x507c4f||0xcc;return function(_0x291333){if(_0x291333){return _0x35eabc[_0x708a('0x12')](_0x507c4f);}return _0x35eabc[_0x708a('0x13')](_0x507c4f)[_0x708a('0x14')]();};}function respondWithResult(_0x1870af,_0x5afddf){_0x5afddf=_0x5afddf||0xc8;return function(_0x51a269){if(_0x51a269){return _0x1870af['status'](_0x5afddf)[_0x708a('0x15')](_0x51a269);}};}function respondWithFilteredResult(_0x23e4e8,_0x38655d){return function(_0x45ef06){if(_0x45ef06){var _0x4b6c62=typeof _0x38655d[_0x708a('0x16')]===_0x708a('0x17')&&typeof _0x38655d[_0x708a('0x18')]===_0x708a('0x17');var _0x13dfab=_0x45ef06[_0x708a('0x19')];var _0x128bd6=_0x4b6c62?0x0:_0x38655d[_0x708a('0x16')];var _0x12071c=_0x4b6c62?_0x45ef06[_0x708a('0x19')]:_0x38655d[_0x708a('0x16')]+_0x38655d[_0x708a('0x18')];var _0x21f671;if(_0x12071c>=_0x13dfab){_0x12071c=_0x13dfab;_0x21f671=0xc8;}else{_0x21f671=0xce;}_0x23e4e8['status'](_0x21f671);return _0x23e4e8[_0x708a('0x1a')](_0x708a('0x1b'),_0x128bd6+'-'+_0x12071c+'/'+_0x13dfab)[_0x708a('0x15')](_0x45ef06);}return null;};}function patchUpdates(_0x363293){return function(_0x29a8df){try{jsonpatch[_0x708a('0x1c')](_0x29a8df,_0x363293,!![]);}catch(_0x2e18fc){return BPromise['reject'](_0x2e18fc);}return _0x29a8df[_0x708a('0x1d')]();};}function saveUpdates(_0x333480,_0x455de0){return function(_0x2ab501){if(_0x2ab501){return _0x2ab501[_0x708a('0x1e')](_0x333480)[_0x708a('0x1f')](function(_0x1a0240){return _0x1a0240;});}return null;};}function removeEntity(_0x3a5be6,_0x1e83c9){return function(_0x5f0021){if(_0x5f0021){return _0x5f0021[_0x708a('0x20')]()['then'](function(){_0x3a5be6[_0x708a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172915,_0x32272c){return function(_0x330b10){if(!_0x330b10){_0x172915['sendStatus'](0x194);}return _0x330b10;};}function handleError(_0x7533dd,_0x110e3d){_0x110e3d=_0x110e3d||0x1f4;return function(_0x4f2580){logger[_0x708a('0x21')](_0x4f2580[_0x708a('0x22')]);if(_0x4f2580['name']){delete _0x4f2580[_0x708a('0x23')];}_0x7533dd[_0x708a('0x13')](_0x110e3d)[_0x708a('0x24')](_0x4f2580);};}exports[_0x708a('0x25')]=function(_0x20eb9f,_0x487783){var _0x3afe4e={},_0x3c8684={},_0x1ddbab={'count':0x0,'rows':[]};var _0x1bbf12=_['map'](db[_0x708a('0x26')][_0x708a('0x27')],function(_0xcce2c7){return{'name':_0xcce2c7['fieldName'],'type':_0xcce2c7[_0x708a('0x28')][_0x708a('0x29')]};});_0x3c8684[_0x708a('0x2a')]=_[_0x708a('0x2b')](_0x1bbf12,_0x708a('0x23'));_0x3c8684[_0x708a('0x2c')]=_['keys'](_0x20eb9f[_0x708a('0x2c')]);_0x3c8684['filters']=_['intersection'](_0x3c8684[_0x708a('0x2a')],_0x3c8684[_0x708a('0x2c')]);_0x3afe4e[_0x708a('0x2d')]=_[_0x708a('0x2e')](_0x3c8684['model'],qs['fields'](_0x20eb9f[_0x708a('0x2c')][_0x708a('0x2f')]));_0x3afe4e[_0x708a('0x2d')]=_0x3afe4e[_0x708a('0x2d')]['length']?_0x3afe4e[_0x708a('0x2d')]:_0x3c8684[_0x708a('0x2a')];if(!_0x20eb9f[_0x708a('0x2c')][_0x708a('0x30')](_0x708a('0x31'))){_0x3afe4e['limit']=qs[_0x708a('0x18')](_0x20eb9f['query'][_0x708a('0x18')]);_0x3afe4e[_0x708a('0x16')]=qs['offset'](_0x20eb9f[_0x708a('0x2c')]['offset']);}_0x3afe4e['order']=qs[_0x708a('0x32')](_0x20eb9f[_0x708a('0x2c')][_0x708a('0x32')]);_0x3afe4e[_0x708a('0x33')]=qs[_0x708a('0x34')](_[_0x708a('0x35')](_0x20eb9f[_0x708a('0x2c')],_0x3c8684[_0x708a('0x34')]),_0x1bbf12);if(_0x20eb9f['query'][_0x708a('0x36')]){_0x3afe4e[_0x708a('0x33')]=_[_0x708a('0x37')](_0x3afe4e[_0x708a('0x33')],{'$or':_[_0x708a('0x2b')](_0x1bbf12,function(_0x1eaa19){if(_0x1eaa19[_0x708a('0x28')]!==_0x708a('0x38')){var _0x44043e={};_0x44043e[_0x1eaa19[_0x708a('0x23')]]={'$like':'%'+_0x20eb9f[_0x708a('0x2c')][_0x708a('0x36')]+'%'};return _0x44043e;}})});}_0x3afe4e=_[_0x708a('0x37')]({},_0x3afe4e,_0x20eb9f[_0x708a('0x39')]);var _0x20a2b0={'where':_0x3afe4e[_0x708a('0x33')]};return db[_0x708a('0x26')]['count'](_0x20a2b0)['then'](function(_0x4879c3){_0x1ddbab[_0x708a('0x19')]=_0x4879c3;if(_0x20eb9f[_0x708a('0x2c')][_0x708a('0x3a')]){_0x3afe4e['include']=[{'all':!![]}];}return db[_0x708a('0x26')]['findAll'](_0x3afe4e);})['then'](function(_0x2a26b8){_0x1ddbab[_0x708a('0x3b')]=_0x2a26b8;return _0x1ddbab;})[_0x708a('0x1f')](respondWithFilteredResult(_0x487783,_0x3afe4e))['catch'](handleError(_0x487783,null));};exports[_0x708a('0x3c')]=function(_0x21434c,_0x9cbbb7){var _0x2a9c32={'raw':!![],'where':{'id':_0x21434c[_0x708a('0x3d')]['id']}},_0x2e2d05={};_0x2e2d05['model']=_[_0x708a('0x3e')](db['SquareRecording']['rawAttributes']);_0x2e2d05[_0x708a('0x2c')]=_['keys'](_0x21434c['query']);_0x2e2d05[_0x708a('0x34')]=_[_0x708a('0x2e')](_0x2e2d05[_0x708a('0x2a')],_0x2e2d05[_0x708a('0x2c')]);_0x2a9c32[_0x708a('0x2d')]=_[_0x708a('0x2e')](_0x2e2d05[_0x708a('0x2a')],qs[_0x708a('0x2f')](_0x21434c[_0x708a('0x2c')][_0x708a('0x2f')]));_0x2a9c32[_0x708a('0x2d')]=_0x2a9c32['attributes'][_0x708a('0x3f')]?_0x2a9c32['attributes']:_0x2e2d05[_0x708a('0x2a')];if(_0x21434c[_0x708a('0x2c')][_0x708a('0x3a')]){_0x2a9c32[_0x708a('0x40')]=[{'all':!![]}];}_0x2a9c32=_['merge']({},_0x2a9c32,_0x21434c[_0x708a('0x39')]);return db[_0x708a('0x26')][_0x708a('0x41')](_0x2a9c32)[_0x708a('0x1f')](handleEntityNotFound(_0x9cbbb7,null))[_0x708a('0x1f')](respondWithResult(_0x9cbbb7,null))[_0x708a('0x42')](handleError(_0x9cbbb7,null));};exports[_0x708a('0x43')]=function(_0x4d30f6,_0x41868e){return db[_0x708a('0x26')][_0x708a('0x43')](_0x4d30f6[_0x708a('0x44')],{})[_0x708a('0x1f')](respondWithResult(_0x41868e,0xc9))[_0x708a('0x42')](handleError(_0x41868e,null));};exports[_0x708a('0x1e')]=function(_0x5deb3a,_0x33fd62){if(_0x5deb3a[_0x708a('0x44')]['id']){delete _0x5deb3a['body']['id'];}return db['SquareRecording'][_0x708a('0x41')]({'where':{'id':_0x5deb3a[_0x708a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x33fd62,null))[_0x708a('0x1f')](saveUpdates(_0x5deb3a['body'],null))[_0x708a('0x1f')](respondWithResult(_0x33fd62,null))[_0x708a('0x42')](handleError(_0x33fd62,null));};exports[_0x708a('0x45')]=function(_0x1ae41f,_0x379c8f,_0x1c28bc){var _0x57dba1=require(_0x708a('0x46'));var _0xdf2cb1=![];var _0xf325a5={};if(_0x1ae41f[_0x708a('0x2c')][_0x708a('0x28')]&&_0x1ae41f['query'][_0x708a('0x28')]===_0x708a('0x47')){_0xf325a5[_0x708a('0x47')]=_0x1ae41f[_0x708a('0x3d')]['id'];}else{_0xf325a5['id']=_0x1ae41f['params']['id'];}return db[_0x708a('0x26')][_0x708a('0x41')]({'where':_0xf325a5,'attributes':['id',_0x708a('0x48'),_0x708a('0x49')],'raw':!![]})[_0x708a('0x1f')](handleEntityNotFound(_0x379c8f,null))['then'](function(_0x22c004){if(_0x22c004){var _0x33f3f3=_0x22c004['savePath'];var _0x2eb66c=util[_0x708a('0x4a')](_0x708a('0x4b'),_0x33f3f3);if(fs[_0x708a('0x4c')](_0x2eb66c)){_0xdf2cb1=!![];return _0x57dba1[_0x708a('0x4d')](_0x2eb66c,_0x33f3f3,config[_0x708a('0x4e')][_0x708a('0x4f')])[_0x708a('0x1f')](function(){return _0x22c004;});}return _0x22c004;}})[_0x708a('0x1f')](function(_0x67d628){if(_0x67d628){var _0x57fd12=_0x67d628[_0x708a('0x48')];if(!fs[_0x708a('0x4c')](_0x57fd12)){throw new db[(_0x708a('0x50'))][(_0x708a('0x51'))]('SquareRecording\x20not\x20found');}if(_0x67d628[_0x708a('0x49')]){return _0x379c8f[_0x708a('0x45')](_0x57fd12,_0x67d628[_0x708a('0x49')]+path[_0x708a('0x52')](_0x57fd12),function(){if(_0xdf2cb1){fs['unlink'](_0x57fd12);}});}else{return _0x379c8f['download'](_0x57fd12,function(_0x5b0183){if(_0xdf2cb1){fs[_0x708a('0x53')](_0x57fd12);}});}}})['catch'](function(_0x584331){if(_0x584331['message']===_0x708a('0x54')){_0x379c8f[_0x708a('0x13')](0x194)[_0x708a('0x24')](_0x708a('0x55'));}else{return handleError(_0x379c8f,null);}});};exports['destroy']=function(_0x4588fc,_0x4b6141){return db[_0x708a('0x26')]['find']({'where':{'id':_0x4588fc[_0x708a('0x3d')]['id']}})[_0x708a('0x1f')](function(_0x15800c){if(_[_0x708a('0x56')](_0x15800c)){throw new ReferenceError(_0x708a('0x57'));}return _0x15800c;})[_0x708a('0x1f')](function(_0x1e704d){var _0x5ee0d1=_0x1e704d[_0x708a('0x48')];logger['info'](_0x708a('0x58'),_0x5ee0d1);if(!_[_0x708a('0x56')](_0x1e704d[_0x708a('0x48')])&&fs[_0x708a('0x4c')](_0x5ee0d1)){logger[_0x708a('0x59')](_0x708a('0x5a')+_0x5ee0d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x5ee0d1);}_0x5ee0d1=_0x5ee0d1+'.cypher';if(!_[_0x708a('0x56')](_0x1e704d[_0x708a('0x48')])&&fs[_0x708a('0x4c')](_0x5ee0d1)){logger[_0x708a('0x59')](_0x708a('0x5a')+_0x5ee0d1+_0x708a('0x5b'));fs['unlinkSync'](_0x5ee0d1);}return _0x1e704d;})['then'](function(_0x2006e9){if(!_0x2006e9)throw new InternalError();return _0x2006e9['destroy']();})[_0x708a('0x1f')](function(){_0x4b6141[_0x708a('0x13')](0xcc)[_0x708a('0x14')]();})[_0x708a('0x42')](handleError(_0x4b6141,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 5b5fe7c..589b5b2 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 _0x4dcb=['path','rimraf','../../config/environment','define','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4dcb,0x186));var _0xb4dc=function(_0x276a3f,_0x1329a6){_0x276a3f=_0x276a3f-0x0;var _0x225ad1=_0x4dcb[_0x276a3f];return _0x225ad1;};'use strict';var _=require('lodash');var util=require(_0xb4dc('0x0'));var logger=require(_0xb4dc('0x1'))(_0xb4dc('0x2'));var moment=require(_0xb4dc('0x3'));var BPromise=require(_0xb4dc('0x4'));var rp=require(_0xb4dc('0x5'));var fs=require('fs');var path=require(_0xb4dc('0x6'));var rimraf=require(_0xb4dc('0x7'));var config=require(_0xb4dc('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x244be0,_0x5be4d1){return _0x244be0[_0xb4dc('0x9')](_0xb4dc('0xa'),attributes,{'tableName':_0xb4dc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c2=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareRecording.attributes','exports','define'];(function(_0x37aff9,_0x3ef6b9){var _0xb51d90=function(_0x5cf561){while(--_0x5cf561){_0x37aff9['push'](_0x37aff9['shift']());}};_0xb51d90(++_0x3ef6b9);}(_0x26c2,0x1d6));var _0x226c=function(_0x111ef8,_0x56a6c2){_0x111ef8=_0x111ef8-0x0;var _0x4fd541=_0x26c2[_0x111ef8];return _0x4fd541;};'use strict';var _=require('lodash');var util=require(_0x226c('0x0'));var logger=require(_0x226c('0x1'))(_0x226c('0x2'));var moment=require(_0x226c('0x3'));var BPromise=require('bluebird');var rp=require(_0x226c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x226c('0x5'));var config=require(_0x226c('0x6'));var attributes=require(_0x226c('0x7'));module[_0x226c('0x8')]=function(_0x2a5393,_0x114e59){return _0x2a5393[_0x226c('0x9')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index a987ead..a3fcb1d 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 _0xbfc7=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSquareRecording','SquareRecording','create','options','raw','catch','util','moment','randomstring','ioredis'];(function(_0x59d3cf,_0x5216bc){var _0x211bde=function(_0x236a6e){while(--_0x236a6e){_0x59d3cf['push'](_0x59d3cf['shift']());}};_0x211bde(++_0x5216bc);}(_0xbfc7,0x140));var _0x7bfc=function(_0x2754b3,_0x5f31e0){_0x2754b3=_0x2754b3-0x0;var _0xd74fa6=_0xbfc7[_0x2754b3];return _0xd74fa6;};'use strict';var _=require('lodash');var util=require(_0x7bfc('0x0'));var moment=require(_0x7bfc('0x1'));var BPromise=require('bluebird');var rs=require(_0x7bfc('0x2'));var fs=require('fs');var Redis=require(_0x7bfc('0x3'));var db=require(_0x7bfc('0x4'))['db'];var utils=require(_0x7bfc('0x5'));var logger=require(_0x7bfc('0x6'))('rpc');var config=require(_0x7bfc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7bfc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375a7e,_0x19b68b,_0x2988c7){return new BPromise(function(_0x56b510,_0x2e6f31){return client[_0x7bfc('0x9')](_0x375a7e,_0x2988c7)[_0x7bfc('0xa')](function(_0x230dce){logger['info'](_0x7bfc('0xb'),_0x19b68b,_0x7bfc('0xc'));logger[_0x7bfc('0xd')](_0x7bfc('0xe'),_0x19b68b,'request\x20sent',JSON[_0x7bfc('0xf')](_0x230dce));if(_0x230dce[_0x7bfc('0x10')]){if(_0x230dce[_0x7bfc('0x10')][_0x7bfc('0x11')]===0x1f4){logger[_0x7bfc('0x10')](_0x7bfc('0xb'),_0x19b68b,_0x230dce[_0x7bfc('0x10')]['message']);return _0x2e6f31(_0x230dce[_0x7bfc('0x10')][_0x7bfc('0x12')]);}logger[_0x7bfc('0x10')](_0x7bfc('0xb'),_0x19b68b,_0x230dce[_0x7bfc('0x10')][_0x7bfc('0x12')]);return _0x56b510(_0x230dce[_0x7bfc('0x10')][_0x7bfc('0x12')]);}else{logger[_0x7bfc('0x13')](_0x7bfc('0xb'),_0x19b68b,_0x7bfc('0xc'));_0x56b510(_0x230dce[_0x7bfc('0x14')][_0x7bfc('0x12')]);}})['catch'](function(_0xbf4873){logger['error'](_0x7bfc('0xb'),_0x19b68b,_0xbf4873);_0x2e6f31(_0xbf4873);});});}exports[_0x7bfc('0x15')]=function(_0xe5346b){var _0x485042=this;return new Promise(function(_0x4cd654,_0x227df7){return db[_0x7bfc('0x16')][_0x7bfc('0x17')](_0xe5346b['body'],{'raw':_0xe5346b[_0x7bfc('0x18')]?_0xe5346b[_0x7bfc('0x18')][_0x7bfc('0x19')]===undefined?!![]:![]:!![]})[_0x7bfc('0xa')](function(_0x26cf02){logger[_0x7bfc('0x13')]('CreateSquareRecording',_0xe5346b);logger[_0x7bfc('0xd')](_0x7bfc('0x15'),_0xe5346b,JSON[_0x7bfc('0xf')](_0x26cf02));_0x4cd654(_0x26cf02);})[_0x7bfc('0x1a')](function(_0x38ad6c){logger[_0x7bfc('0x10')]('CreateSquareRecording',_0x38ad6c[_0x7bfc('0x12')],_0xe5346b);_0x227df7(_0x485042[_0x7bfc('0x10')](0x1f4,_0x38ad6c[_0x7bfc('0x12')]));});});}; \ No newline at end of file +var _0x06b4=['body','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','CreateSquareRecording','SquareRecording','create'];(function(_0x466ba0,_0x56c1f5){var _0x48595a=function(_0x21b0d3){while(--_0x21b0d3){_0x466ba0['push'](_0x466ba0['shift']());}};_0x48595a(++_0x56c1f5);}(_0x06b4,0x1d6));var _0x406b=function(_0x292016,_0x14ce83){_0x292016=_0x292016-0x0;var _0x16f9ac=_0x06b4[_0x292016];return _0x16f9ac;};'use strict';var _=require(_0x406b('0x0'));var util=require(_0x406b('0x1'));var moment=require(_0x406b('0x2'));var BPromise=require(_0x406b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x406b('0x4'));var db=require(_0x406b('0x5'))['db'];var utils=require(_0x406b('0x6'));var logger=require(_0x406b('0x7'))(_0x406b('0x8'));var config=require(_0x406b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x406b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5777ae,_0x4d917e,_0x31ff35){return new BPromise(function(_0x4e6bae,_0x30ff08){return client[_0x406b('0xb')](_0x5777ae,_0x31ff35)[_0x406b('0xc')](function(_0x15a2b1){logger['info'](_0x406b('0xd'),_0x4d917e,_0x406b('0xe'));logger[_0x406b('0xf')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4d917e,'request\x20sent',JSON[_0x406b('0x10')](_0x15a2b1));if(_0x15a2b1[_0x406b('0x11')]){if(_0x15a2b1['error']['code']===0x1f4){logger[_0x406b('0x11')](_0x406b('0xd'),_0x4d917e,_0x15a2b1[_0x406b('0x11')][_0x406b('0x12')]);return _0x30ff08(_0x15a2b1[_0x406b('0x11')][_0x406b('0x12')]);}logger[_0x406b('0x11')](_0x406b('0xd'),_0x4d917e,_0x15a2b1[_0x406b('0x11')]['message']);return _0x4e6bae(_0x15a2b1[_0x406b('0x11')][_0x406b('0x12')]);}else{logger[_0x406b('0x13')](_0x406b('0xd'),_0x4d917e,_0x406b('0xe'));_0x4e6bae(_0x15a2b1['result'][_0x406b('0x12')]);}})[_0x406b('0x14')](function(_0x10db7b){logger[_0x406b('0x11')](_0x406b('0xd'),_0x4d917e,_0x10db7b);_0x30ff08(_0x10db7b);});});}exports[_0x406b('0x15')]=function(_0x4db2d0){var _0x4329f9=this;return new Promise(function(_0x49c42e,_0x5890fd){return db[_0x406b('0x16')][_0x406b('0x17')](_0x4db2d0[_0x406b('0x18')],{'raw':_0x4db2d0['options']?_0x4db2d0['options'][_0x406b('0x19')]===undefined?!![]:![]:!![]})[_0x406b('0xc')](function(_0x2d2f25){logger['info'](_0x406b('0x15'),_0x4db2d0);logger[_0x406b('0xf')](_0x406b('0x15'),_0x4db2d0,JSON['stringify'](_0x2d2f25));_0x49c42e(_0x2d2f25);})[_0x406b('0x14')](function(_0x1078fc){logger['error'](_0x406b('0x15'),_0x1078fc[_0x406b('0x12')],_0x4db2d0);_0x5890fd(_0x4329f9[_0x406b('0x11')](0x1f4,_0x1078fc['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 070caa5..9341305 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 _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(_0x104857,_0x34844c){var _0x5c7d6d=function(_0x1aa95f){while(--_0x1aa95f){_0x104857['push'](_0x104857['shift']());}};_0x5c7d6d(++_0x34844c);}(_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('./squareReport.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 _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1f0c9e,_0x387f50){var _0x4ba930=function(_0x50645e){while(--_0x50645e){_0x1f0c9e['push'](_0x1f0c9e['shift']());}};_0x4ba930(++_0x387f50);}(_0xe706,0xa3));var _0x6e70=function(_0x5089ea,_0x3d8378){_0x5089ea=_0x5089ea-0x0;var _0xabe953=_0xe706[_0x5089ea];return _0xabe953;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1240d80..da1affd 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 _0x9782=['exports','STRING','DATE','sequelize'];(function(_0x4da11a,_0x46a6ba){var _0xb54d13=function(_0x54d29b){while(--_0x54d29b){_0x4da11a['push'](_0x4da11a['shift']());}};_0xb54d13(++_0x46a6ba);}(_0x9782,0x73));var _0x2978=function(_0x4904af,_0x4418bc){_0x4904af=_0x4904af-0x0;var _0x2a2f45=_0x9782[_0x4904af];return _0x2a2f45;};'use strict';var Sequelize=require(_0x2978('0x0'));module[_0x2978('0x1')]={'network':{'type':Sequelize[_0x2978('0x2')]},'network_script':{'type':Sequelize[_0x2978('0x2')]},'request':{'type':Sequelize[_0x2978('0x2')]},'channel':{'type':Sequelize[_0x2978('0x2')]},'language':{'type':Sequelize[_0x2978('0x2')]},'type':{'type':Sequelize[_0x2978('0x2')]},'uniqueid':{'type':Sequelize[_0x2978('0x2')]},'version':{'type':Sequelize[_0x2978('0x2')]},'callerid':{'type':Sequelize[_0x2978('0x2')]},'calleridname':{'type':Sequelize[_0x2978('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x2978('0x2')]},'callington':{'type':Sequelize[_0x2978('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x2978('0x2')]},'rdnis':{'type':Sequelize[_0x2978('0x2')]},'context':{'type':Sequelize[_0x2978('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x2978('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x2978('0x2')]},'project_name':{'type':Sequelize[_0x2978('0x2')]},'joinAt':{'type':Sequelize[_0x2978('0x3')]},'leaveAt':{'type':Sequelize[_0x2978('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbba8=['STRING','DATE','exports'];(function(_0x2df575,_0x12e29e){var _0x363837=function(_0x20aaa0){while(--_0x20aaa0){_0x2df575['push'](_0x2df575['shift']());}};_0x363837(++_0x12e29e);}(_0xbba8,0x197));var _0x8bba=function(_0x56fb3c,_0x3474f2){_0x56fb3c=_0x56fb3c-0x0;var _0x2261f8=_0xbba8[_0x56fb3c];return _0x2261f8;};'use strict';var Sequelize=require('sequelize');module[_0x8bba('0x0')]={'network':{'type':Sequelize[_0x8bba('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x8bba('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8bba('0x1')]},'uniqueid':{'type':Sequelize[_0x8bba('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8bba('0x1')]},'calleridname':{'type':Sequelize[_0x8bba('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x8bba('0x1')]},'callington':{'type':Sequelize[_0x8bba('0x1')]},'callingtns':{'type':Sequelize[_0x8bba('0x1')]},'dnid':{'type':Sequelize[_0x8bba('0x1')]},'rdnis':{'type':Sequelize[_0x8bba('0x1')]},'context':{'type':Sequelize[_0x8bba('0x1')]},'extension':{'type':Sequelize[_0x8bba('0x1')]},'priority':{'type':Sequelize[_0x8bba('0x1')]},'enhanced':{'type':Sequelize[_0x8bba('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x8bba('0x1')]},'project_name':{'type':Sequelize[_0x8bba('0x1')]},'joinAt':{'type':Sequelize[_0x8bba('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 5f0bb2e..73b92ab 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 _0xc1a5=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','findAll','catch','show','find','create','body','params','describe'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc1a5,0xe7));var _0x5c1a=function(_0x5defd2,_0x40632a){_0x5defd2=_0x5defd2-0x0;var _0x5d8b8c=_0xc1a5[_0x5defd2];return _0x5d8b8c;};'use strict';var emlformat=require(_0x5c1a('0x0'));var rimraf=require(_0x5c1a('0x1'));var zipdir=require(_0x5c1a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c1a('0x3'));var BPromise=require(_0x5c1a('0x4'));var Mustache=require(_0x5c1a('0x5'));var util=require(_0x5c1a('0x6'));var path=require(_0x5c1a('0x7'));var sox=require(_0x5c1a('0x8'));var csv=require(_0x5c1a('0x9'));var ejs=require(_0x5c1a('0xa'));var fs=require('fs');var fs_extra=require(_0x5c1a('0xb'));var _=require(_0x5c1a('0xc'));var squel=require(_0x5c1a('0xd'));var crypto=require(_0x5c1a('0xe'));var jsforce=require(_0x5c1a('0xf'));var deskjs=require(_0x5c1a('0x10'));var toCsv=require(_0x5c1a('0x9'));var querystring=require('querystring');var Papa=require(_0x5c1a('0x11'));var Redis=require('ioredis');var authService=require(_0x5c1a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5c1a('0x13'));var hardwareService=require(_0x5c1a('0x14'));var logger=require(_0x5c1a('0x15'))(_0x5c1a('0x16'));var utils=require(_0x5c1a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5c1a('0x18'));var db=require(_0x5c1a('0x19'))['db'];function respondWithStatusCode(_0x5f112a,_0x482600){_0x482600=_0x482600||0xcc;return function(_0x552b2b){if(_0x552b2b){return _0x5f112a[_0x5c1a('0x1a')](_0x482600);}return _0x5f112a['status'](_0x482600)[_0x5c1a('0x1b')]();};}function respondWithResult(_0x34a352,_0x3d1d1a){_0x3d1d1a=_0x3d1d1a||0xc8;return function(_0x3ee81a){if(_0x3ee81a){return _0x34a352[_0x5c1a('0x1c')](_0x3d1d1a)['json'](_0x3ee81a);}};}function respondWithFilteredResult(_0x3a2881,_0x211062){return function(_0x4a34c8){if(_0x4a34c8){var _0x559784=typeof _0x211062['offset']===_0x5c1a('0x1d')&&typeof _0x211062[_0x5c1a('0x1e')]===_0x5c1a('0x1d');var _0x3c7d91=_0x4a34c8[_0x5c1a('0x1f')];var _0x52f973=_0x559784?0x0:_0x211062[_0x5c1a('0x20')];var _0x60ce50=_0x559784?_0x4a34c8['count']:_0x211062['offset']+_0x211062['limit'];var _0x3427f8;if(_0x60ce50>=_0x3c7d91){_0x60ce50=_0x3c7d91;_0x3427f8=0xc8;}else{_0x3427f8=0xce;}_0x3a2881[_0x5c1a('0x1c')](_0x3427f8);return _0x3a2881['set'](_0x5c1a('0x21'),_0x52f973+'-'+_0x60ce50+'/'+_0x3c7d91)['json'](_0x4a34c8);}return null;};}function patchUpdates(_0x87de7e){return function(_0x292bdb){try{jsonpatch[_0x5c1a('0x22')](_0x292bdb,_0x87de7e,!![]);}catch(_0x553395){return BPromise['reject'](_0x553395);}return _0x292bdb[_0x5c1a('0x23')]();};}function saveUpdates(_0x4004f5,_0x7fae2b){return function(_0x127ecb){if(_0x127ecb){return _0x127ecb[_0x5c1a('0x24')](_0x4004f5)[_0x5c1a('0x25')](function(_0x288051){return _0x288051;});}return null;};}function removeEntity(_0x5ace42,_0x790c87){return function(_0x3c8f77){if(_0x3c8f77){return _0x3c8f77[_0x5c1a('0x26')]()[_0x5c1a('0x25')](function(){_0x5ace42[_0x5c1a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10bb06,_0x1562fc){return function(_0x1e9fd6){if(!_0x1e9fd6){_0x10bb06['sendStatus'](0x194);}return _0x1e9fd6;};}function handleError(_0x57c4bc,_0x54808e){_0x54808e=_0x54808e||0x1f4;return function(_0xc3142){logger[_0x5c1a('0x27')](_0xc3142[_0x5c1a('0x28')]);if(_0xc3142[_0x5c1a('0x29')]){delete _0xc3142[_0x5c1a('0x29')];}_0x57c4bc[_0x5c1a('0x1c')](_0x54808e)['send'](_0xc3142);};}exports[_0x5c1a('0x2a')]=function(_0x4b3a78,_0x10208f){var _0x12bc6c={},_0x588d2f={},_0x7a103b={'count':0x0,'rows':[]};var _0x399300=_['map'](db['SquareReport'][_0x5c1a('0x2b')],function(_0x538682){return{'name':_0x538682[_0x5c1a('0x2c')],'type':_0x538682[_0x5c1a('0x2d')][_0x5c1a('0x2e')]};});_0x588d2f[_0x5c1a('0x2f')]=_[_0x5c1a('0x30')](_0x399300,_0x5c1a('0x29'));_0x588d2f['query']=_[_0x5c1a('0x31')](_0x4b3a78[_0x5c1a('0x32')]);_0x588d2f[_0x5c1a('0x33')]=_[_0x5c1a('0x34')](_0x588d2f[_0x5c1a('0x2f')],_0x588d2f['query']);_0x12bc6c[_0x5c1a('0x35')]=_[_0x5c1a('0x34')](_0x588d2f[_0x5c1a('0x2f')],qs[_0x5c1a('0x36')](_0x4b3a78[_0x5c1a('0x32')]['fields']));_0x12bc6c['attributes']=_0x12bc6c[_0x5c1a('0x35')][_0x5c1a('0x37')]?_0x12bc6c['attributes']:_0x588d2f[_0x5c1a('0x2f')];if(!_0x4b3a78['query'][_0x5c1a('0x38')](_0x5c1a('0x39'))){_0x12bc6c[_0x5c1a('0x1e')]=qs[_0x5c1a('0x1e')](_0x4b3a78[_0x5c1a('0x32')][_0x5c1a('0x1e')]);_0x12bc6c[_0x5c1a('0x20')]=qs[_0x5c1a('0x20')](_0x4b3a78[_0x5c1a('0x32')][_0x5c1a('0x20')]);}_0x12bc6c[_0x5c1a('0x3a')]=qs[_0x5c1a('0x3b')](_0x4b3a78['query'][_0x5c1a('0x3b')]);_0x12bc6c[_0x5c1a('0x3c')]=qs[_0x5c1a('0x33')](_[_0x5c1a('0x3d')](_0x4b3a78['query'],_0x588d2f[_0x5c1a('0x33')]),_0x399300);if(_0x4b3a78[_0x5c1a('0x32')][_0x5c1a('0x3e')]){_0x12bc6c[_0x5c1a('0x3c')]=_[_0x5c1a('0x3f')](_0x12bc6c['where'],{'$or':_[_0x5c1a('0x30')](_0x399300,function(_0x19ca0f){if(_0x19ca0f[_0x5c1a('0x2d')]!==_0x5c1a('0x40')){var _0x10e253={};_0x10e253[_0x19ca0f[_0x5c1a('0x29')]]={'$like':'%'+_0x4b3a78[_0x5c1a('0x32')][_0x5c1a('0x3e')]+'%'};return _0x10e253;}})});}_0x12bc6c=_[_0x5c1a('0x3f')]({},_0x12bc6c,_0x4b3a78[_0x5c1a('0x41')]);var _0x5948ec={'where':_0x12bc6c['where']};return db[_0x5c1a('0x42')]['count'](_0x5948ec)[_0x5c1a('0x25')](function(_0x47ddf6){_0x7a103b[_0x5c1a('0x1f')]=_0x47ddf6;if(_0x4b3a78[_0x5c1a('0x32')][_0x5c1a('0x43')]){_0x12bc6c[_0x5c1a('0x44')]=[{'all':!![]}];}return db['SquareReport'][_0x5c1a('0x45')](_0x12bc6c);})[_0x5c1a('0x25')](function(_0x23bba7){_0x7a103b['rows']=_0x23bba7;return _0x7a103b;})[_0x5c1a('0x25')](respondWithFilteredResult(_0x10208f,_0x12bc6c))[_0x5c1a('0x46')](handleError(_0x10208f,null));};exports[_0x5c1a('0x47')]=function(_0x464212,_0xb97ca9){var _0x198d12={'raw':!![],'where':{'id':_0x464212['params']['id']}},_0x5e5298={};_0x5e5298[_0x5c1a('0x2f')]=_[_0x5c1a('0x31')](db[_0x5c1a('0x42')][_0x5c1a('0x2b')]);_0x5e5298['query']=_[_0x5c1a('0x31')](_0x464212[_0x5c1a('0x32')]);_0x5e5298[_0x5c1a('0x33')]=_[_0x5c1a('0x34')](_0x5e5298['model'],_0x5e5298[_0x5c1a('0x32')]);_0x198d12[_0x5c1a('0x35')]=_['intersection'](_0x5e5298[_0x5c1a('0x2f')],qs[_0x5c1a('0x36')](_0x464212[_0x5c1a('0x32')]['fields']));_0x198d12['attributes']=_0x198d12['attributes'][_0x5c1a('0x37')]?_0x198d12[_0x5c1a('0x35')]:_0x5e5298[_0x5c1a('0x2f')];if(_0x464212[_0x5c1a('0x32')][_0x5c1a('0x43')]){_0x198d12[_0x5c1a('0x44')]=[{'all':!![]}];}_0x198d12=_[_0x5c1a('0x3f')]({},_0x198d12,_0x464212['options']);return db['SquareReport'][_0x5c1a('0x48')](_0x198d12)[_0x5c1a('0x25')](handleEntityNotFound(_0xb97ca9,null))['then'](respondWithResult(_0xb97ca9,null))[_0x5c1a('0x46')](handleError(_0xb97ca9,null));};exports[_0x5c1a('0x49')]=function(_0x374789,_0x12a7c7){return db[_0x5c1a('0x42')]['create'](_0x374789[_0x5c1a('0x4a')],{})[_0x5c1a('0x25')](respondWithResult(_0x12a7c7,0xc9))[_0x5c1a('0x46')](handleError(_0x12a7c7,null));};exports[_0x5c1a('0x24')]=function(_0x5d4921,_0xcebd90){if(_0x5d4921[_0x5c1a('0x4a')]['id']){delete _0x5d4921[_0x5c1a('0x4a')]['id'];}return db[_0x5c1a('0x42')][_0x5c1a('0x48')]({'where':{'id':_0x5d4921[_0x5c1a('0x4b')]['id']}})['then'](handleEntityNotFound(_0xcebd90,null))[_0x5c1a('0x25')](saveUpdates(_0x5d4921[_0x5c1a('0x4a')],null))['then'](respondWithResult(_0xcebd90,null))[_0x5c1a('0x46')](handleError(_0xcebd90,null));};exports[_0x5c1a('0x26')]=function(_0x86ab35,_0x3a64b0){return db['SquareReport'][_0x5c1a('0x48')]({'where':{'id':_0x86ab35[_0x5c1a('0x4b')]['id']}})[_0x5c1a('0x25')](handleEntityNotFound(_0x3a64b0,null))[_0x5c1a('0x25')](removeEntity(_0x3a64b0,null))[_0x5c1a('0x46')](handleError(_0x3a64b0,null));};exports['describe']=function(_0x5e0351,_0x8d60e9){return db[_0x5c1a('0x42')][_0x5c1a('0x4c')]()['then'](respondWithResult(_0x8d60e9,null))[_0x5c1a('0x46')](handleError(_0x8d60e9,null));}; \ No newline at end of file +var _0xa753=['ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xa753,0xd6));var _0x3a75=function(_0x49e688,_0x5cbbe4){_0x49e688=_0x49e688-0x0;var _0x1ee5a9=_0xa753[_0x49e688];return _0x1ee5a9;};'use strict';var emlformat=require(_0x3a75('0x0'));var rimraf=require(_0x3a75('0x1'));var zipdir=require(_0x3a75('0x2'));var jsonpatch=require(_0x3a75('0x3'));var rp=require(_0x3a75('0x4'));var moment=require(_0x3a75('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a75('0x6'));var util=require(_0x3a75('0x7'));var path=require(_0x3a75('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a75('0x9'));var fs=require('fs');var fs_extra=require(_0x3a75('0xa'));var _=require(_0x3a75('0xb'));var squel=require(_0x3a75('0xc'));var crypto=require(_0x3a75('0xd'));var jsforce=require(_0x3a75('0xe'));var deskjs=require(_0x3a75('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3a75('0x10'));var Redis=require(_0x3a75('0x11'));var authService=require(_0x3a75('0x12'));var qs=require(_0x3a75('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a75('0x14'));var utils=require(_0x3a75('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3a75('0x16'));var db=require(_0x3a75('0x17'))['db'];function respondWithStatusCode(_0x265dcc,_0x39209e){_0x39209e=_0x39209e||0xcc;return function(_0x486585){if(_0x486585){return _0x265dcc[_0x3a75('0x18')](_0x39209e);}return _0x265dcc['status'](_0x39209e)['end']();};}function respondWithResult(_0x1ce491,_0xb53444){_0xb53444=_0xb53444||0xc8;return function(_0x48a712){if(_0x48a712){return _0x1ce491[_0x3a75('0x19')](_0xb53444)[_0x3a75('0x1a')](_0x48a712);}};}function respondWithFilteredResult(_0x2955ea,_0x2affe7){return function(_0x5aa7b0){if(_0x5aa7b0){var _0x292010=typeof _0x2affe7[_0x3a75('0x1b')]===_0x3a75('0x1c')&&typeof _0x2affe7[_0x3a75('0x1d')]===_0x3a75('0x1c');var _0x2d8ebe=_0x5aa7b0[_0x3a75('0x1e')];var _0x5a32de=_0x292010?0x0:_0x2affe7[_0x3a75('0x1b')];var _0x246033=_0x292010?_0x5aa7b0[_0x3a75('0x1e')]:_0x2affe7[_0x3a75('0x1b')]+_0x2affe7[_0x3a75('0x1d')];var _0x2a76bc;if(_0x246033>=_0x2d8ebe){_0x246033=_0x2d8ebe;_0x2a76bc=0xc8;}else{_0x2a76bc=0xce;}_0x2955ea['status'](_0x2a76bc);return _0x2955ea[_0x3a75('0x1f')](_0x3a75('0x20'),_0x5a32de+'-'+_0x246033+'/'+_0x2d8ebe)[_0x3a75('0x1a')](_0x5aa7b0);}return null;};}function patchUpdates(_0x3f7a59){return function(_0x42e5b3){try{jsonpatch['apply'](_0x42e5b3,_0x3f7a59,!![]);}catch(_0x801cc7){return BPromise[_0x3a75('0x21')](_0x801cc7);}return _0x42e5b3[_0x3a75('0x22')]();};}function saveUpdates(_0x100b29,_0x1a19a8){return function(_0x6bf574){if(_0x6bf574){return _0x6bf574[_0x3a75('0x23')](_0x100b29)[_0x3a75('0x24')](function(_0x4cb704){return _0x4cb704;});}return null;};}function removeEntity(_0x3da878,_0x425087){return function(_0x2c9e2f){if(_0x2c9e2f){return _0x2c9e2f[_0x3a75('0x25')]()['then'](function(){_0x3da878['status'](0xcc)[_0x3a75('0x26')]();});}};}function handleEntityNotFound(_0x2c4cc6,_0x23e3e1){return function(_0x53523d){if(!_0x53523d){_0x2c4cc6['sendStatus'](0x194);}return _0x53523d;};}function handleError(_0x602118,_0x46ae0f){_0x46ae0f=_0x46ae0f||0x1f4;return function(_0x182a71){logger['error'](_0x182a71[_0x3a75('0x27')]);if(_0x182a71[_0x3a75('0x28')]){delete _0x182a71[_0x3a75('0x28')];}_0x602118[_0x3a75('0x19')](_0x46ae0f)[_0x3a75('0x29')](_0x182a71);};}exports[_0x3a75('0x2a')]=function(_0xf309ab,_0x5aa5a5){var _0x446c1d={},_0x81531b={},_0x4b0256={'count':0x0,'rows':[]};var _0x1d1603=_['map'](db[_0x3a75('0x2b')][_0x3a75('0x2c')],function(_0x2a4cb0){return{'name':_0x2a4cb0[_0x3a75('0x2d')],'type':_0x2a4cb0[_0x3a75('0x2e')][_0x3a75('0x2f')]};});_0x81531b[_0x3a75('0x30')]=_[_0x3a75('0x31')](_0x1d1603,_0x3a75('0x28'));_0x81531b[_0x3a75('0x32')]=_['keys'](_0xf309ab['query']);_0x81531b[_0x3a75('0x33')]=_[_0x3a75('0x34')](_0x81531b[_0x3a75('0x30')],_0x81531b[_0x3a75('0x32')]);_0x446c1d[_0x3a75('0x35')]=_[_0x3a75('0x34')](_0x81531b[_0x3a75('0x30')],qs[_0x3a75('0x36')](_0xf309ab[_0x3a75('0x32')][_0x3a75('0x36')]));_0x446c1d[_0x3a75('0x35')]=_0x446c1d[_0x3a75('0x35')][_0x3a75('0x37')]?_0x446c1d[_0x3a75('0x35')]:_0x81531b[_0x3a75('0x30')];if(!_0xf309ab[_0x3a75('0x32')][_0x3a75('0x38')](_0x3a75('0x39'))){_0x446c1d[_0x3a75('0x1d')]=qs[_0x3a75('0x1d')](_0xf309ab[_0x3a75('0x32')][_0x3a75('0x1d')]);_0x446c1d['offset']=qs[_0x3a75('0x1b')](_0xf309ab[_0x3a75('0x32')][_0x3a75('0x1b')]);}_0x446c1d[_0x3a75('0x3a')]=qs[_0x3a75('0x3b')](_0xf309ab[_0x3a75('0x32')][_0x3a75('0x3b')]);_0x446c1d[_0x3a75('0x3c')]=qs[_0x3a75('0x33')](_['pick'](_0xf309ab[_0x3a75('0x32')],_0x81531b['filters']),_0x1d1603);if(_0xf309ab[_0x3a75('0x32')][_0x3a75('0x3d')]){_0x446c1d[_0x3a75('0x3c')]=_[_0x3a75('0x3e')](_0x446c1d[_0x3a75('0x3c')],{'$or':_[_0x3a75('0x31')](_0x1d1603,function(_0x5e7bf9){if(_0x5e7bf9[_0x3a75('0x2e')]!==_0x3a75('0x3f')){var _0x51a6de={};_0x51a6de[_0x5e7bf9['name']]={'$like':'%'+_0xf309ab[_0x3a75('0x32')][_0x3a75('0x3d')]+'%'};return _0x51a6de;}})});}_0x446c1d=_[_0x3a75('0x3e')]({},_0x446c1d,_0xf309ab[_0x3a75('0x40')]);var _0x3f143c={'where':_0x446c1d[_0x3a75('0x3c')]};return db[_0x3a75('0x2b')][_0x3a75('0x1e')](_0x3f143c)[_0x3a75('0x24')](function(_0x137734){_0x4b0256[_0x3a75('0x1e')]=_0x137734;if(_0xf309ab[_0x3a75('0x32')][_0x3a75('0x41')]){_0x446c1d[_0x3a75('0x42')]=[{'all':!![]}];}return db[_0x3a75('0x2b')][_0x3a75('0x43')](_0x446c1d);})['then'](function(_0xab3cf6){_0x4b0256[_0x3a75('0x44')]=_0xab3cf6;return _0x4b0256;})[_0x3a75('0x24')](respondWithFilteredResult(_0x5aa5a5,_0x446c1d))[_0x3a75('0x45')](handleError(_0x5aa5a5,null));};exports[_0x3a75('0x46')]=function(_0x65a2f5,_0x23ef85){var _0x5d8a71={'raw':!![],'where':{'id':_0x65a2f5[_0x3a75('0x47')]['id']}},_0x39061f={};_0x39061f['model']=_['keys'](db[_0x3a75('0x2b')][_0x3a75('0x2c')]);_0x39061f['query']=_[_0x3a75('0x48')](_0x65a2f5['query']);_0x39061f[_0x3a75('0x33')]=_[_0x3a75('0x34')](_0x39061f[_0x3a75('0x30')],_0x39061f[_0x3a75('0x32')]);_0x5d8a71[_0x3a75('0x35')]=_[_0x3a75('0x34')](_0x39061f[_0x3a75('0x30')],qs[_0x3a75('0x36')](_0x65a2f5[_0x3a75('0x32')][_0x3a75('0x36')]));_0x5d8a71[_0x3a75('0x35')]=_0x5d8a71[_0x3a75('0x35')][_0x3a75('0x37')]?_0x5d8a71[_0x3a75('0x35')]:_0x39061f[_0x3a75('0x30')];if(_0x65a2f5[_0x3a75('0x32')]['includeAll']){_0x5d8a71[_0x3a75('0x42')]=[{'all':!![]}];}_0x5d8a71=_[_0x3a75('0x3e')]({},_0x5d8a71,_0x65a2f5[_0x3a75('0x40')]);return db[_0x3a75('0x2b')][_0x3a75('0x49')](_0x5d8a71)['then'](handleEntityNotFound(_0x23ef85,null))[_0x3a75('0x24')](respondWithResult(_0x23ef85,null))[_0x3a75('0x45')](handleError(_0x23ef85,null));};exports[_0x3a75('0x4a')]=function(_0xb42523,_0x28daa5){return db[_0x3a75('0x2b')]['create'](_0xb42523[_0x3a75('0x4b')],{})[_0x3a75('0x24')](respondWithResult(_0x28daa5,0xc9))[_0x3a75('0x45')](handleError(_0x28daa5,null));};exports[_0x3a75('0x23')]=function(_0xec1bd8,_0x16fcad){if(_0xec1bd8[_0x3a75('0x4b')]['id']){delete _0xec1bd8[_0x3a75('0x4b')]['id'];}return db[_0x3a75('0x2b')]['find']({'where':{'id':_0xec1bd8[_0x3a75('0x47')]['id']}})['then'](handleEntityNotFound(_0x16fcad,null))['then'](saveUpdates(_0xec1bd8[_0x3a75('0x4b')],null))['then'](respondWithResult(_0x16fcad,null))['catch'](handleError(_0x16fcad,null));};exports['destroy']=function(_0x489119,_0x3f539c){return db[_0x3a75('0x2b')][_0x3a75('0x49')]({'where':{'id':_0x489119['params']['id']}})[_0x3a75('0x24')](handleEntityNotFound(_0x3f539c,null))[_0x3a75('0x24')](removeEntity(_0x3f539c,null))[_0x3a75('0x45')](handleError(_0x3f539c,null));};exports[_0x3a75('0x4c')]=function(_0x2f911b,_0x378e7d){return db[_0x3a75('0x2b')][_0x3a75('0x4c')]()[_0x3a75('0x24')](respondWithResult(_0x378e7d,null))['catch'](handleError(_0x378e7d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 7c54037..789ff29 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 _0x2204=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4b1eaf,_0x39bcdd){var _0x3bc4c8=function(_0x2f802c){while(--_0x2f802c){_0x4b1eaf['push'](_0x4b1eaf['shift']());}};_0x3bc4c8(++_0x39bcdd);}(_0x2204,0x1ac));var _0x4220=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2204[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4220('0x0'));var util=require('util');var logger=require(_0x4220('0x1'))(_0x4220('0x2'));var moment=require(_0x4220('0x3'));var BPromise=require(_0x4220('0x4'));var rp=require(_0x4220('0x5'));var fs=require('fs');var path=require(_0x4220('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4220('0x7'));module[_0x4220('0x8')]=function(_0x3b04fc,_0x597db1){return _0x3b04fc[_0x4220('0x9')](_0x4220('0xa'),attributes,{'tableName':_0x4220('0xb'),'paranoid':![],'indexes':[{'name':_0x4220('0xc'),'fields':['uniqueid',_0x4220('0xd')]},{'name':_0x4220('0xe'),'fields':[_0x4220('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x60ae=['rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x60ae,0x1da));var _0xe60a=function(_0x246568,_0x57af04){_0x246568=_0x246568-0x0;var _0x19b302=_0x60ae[_0x246568];return _0x19b302;};'use strict';var _=require(_0xe60a('0x0'));var util=require(_0xe60a('0x1'));var logger=require(_0xe60a('0x2'))(_0xe60a('0x3'));var moment=require(_0xe60a('0x4'));var BPromise=require('bluebird');var rp=require(_0xe60a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe60a('0x6'));var config=require(_0xe60a('0x7'));var attributes=require(_0xe60a('0x8'));module[_0xe60a('0x9')]=function(_0x13394c,_0x4b18b0){return _0x13394c[_0xe60a('0xa')](_0xe60a('0xb'),attributes,{'tableName':_0xe60a('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xe60a('0xd'),'project_name']},{'name':_0xe60a('0xe'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index dd46fee..7604e6a 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 _0x8528=['SquareReport','create','body','options','raw','then','debug','UpdateSquareReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8528,0x124));var _0x8852=function(_0x32e12a,_0x461fdf){_0x32e12a=_0x32e12a-0x0;var _0x3858cc=_0x8528[_0x32e12a];return _0x3858cc;};'use strict';var _=require('lodash');var util=require(_0x8852('0x0'));var moment=require(_0x8852('0x1'));var BPromise=require(_0x8852('0x2'));var rs=require(_0x8852('0x3'));var fs=require('fs');var Redis=require(_0x8852('0x4'));var db=require(_0x8852('0x5'))['db'];var utils=require(_0x8852('0x6'));var logger=require(_0x8852('0x7'))(_0x8852('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8852('0x9')][_0x8852('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575019,_0x300a80,_0x20c4f1){return new BPromise(function(_0x18c974,_0x93aea2){return client[_0x8852('0xb')](_0x575019,_0x20c4f1)['then'](function(_0x31422d){logger[_0x8852('0xc')](_0x8852('0xd'),_0x300a80,_0x8852('0xe'));logger['debug'](_0x8852('0xf'),_0x300a80,_0x8852('0xe'),JSON[_0x8852('0x10')](_0x31422d));if(_0x31422d[_0x8852('0x11')]){if(_0x31422d[_0x8852('0x11')][_0x8852('0x12')]===0x1f4){logger[_0x8852('0x11')](_0x8852('0xd'),_0x300a80,_0x31422d['error']['message']);return _0x93aea2(_0x31422d[_0x8852('0x11')][_0x8852('0x13')]);}logger[_0x8852('0x11')](_0x8852('0xd'),_0x300a80,_0x31422d[_0x8852('0x11')][_0x8852('0x13')]);return _0x18c974(_0x31422d['error'][_0x8852('0x13')]);}else{logger[_0x8852('0xc')](_0x8852('0xd'),_0x300a80,_0x8852('0xe'));_0x18c974(_0x31422d[_0x8852('0x14')][_0x8852('0x13')]);}})[_0x8852('0x15')](function(_0x20ad16){logger[_0x8852('0x11')](_0x8852('0xd'),_0x300a80,_0x20ad16);_0x93aea2(_0x20ad16);});});}exports[_0x8852('0x16')]=function(_0x52e622){var _0x2a2d0e=this;return new Promise(function(_0x5e6e1a,_0x150e9f){return db[_0x8852('0x17')][_0x8852('0x18')](_0x52e622[_0x8852('0x19')],{'raw':_0x52e622[_0x8852('0x1a')]?_0x52e622[_0x8852('0x1a')][_0x8852('0x1b')]===undefined?!![]:![]:!![]})[_0x8852('0x1c')](function(_0xe77bd3){logger[_0x8852('0xc')](_0x8852('0x16'),_0x52e622);logger[_0x8852('0x1d')](_0x8852('0x16'),_0x52e622,JSON[_0x8852('0x10')](_0xe77bd3));_0x5e6e1a(_0xe77bd3);})[_0x8852('0x15')](function(_0x1e32e2){logger[_0x8852('0x11')](_0x8852('0x16'),_0x1e32e2['message'],_0x52e622);_0x150e9f(_0x2a2d0e[_0x8852('0x11')](0x1f4,_0x1e32e2['message']));});});};exports[_0x8852('0x1e')]=function(_0x362448){var _0x2f6f65=this;return new Promise(function(_0x24b8e8,_0x1dfc12){return db[_0x8852('0x17')][_0x8852('0x1f')](_0x362448[_0x8852('0x19')],{'raw':_0x362448[_0x8852('0x1a')]?_0x362448[_0x8852('0x1a')][_0x8852('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x362448[_0x8852('0x1a')]?_0x362448[_0x8852('0x1a')][_0x8852('0x20')]||null:null,'attributes':_0x362448['options']?_0x362448[_0x8852('0x1a')][_0x8852('0x21')]||null:null,'limit':_0x362448[_0x8852('0x1a')]?_0x362448[_0x8852('0x1a')][_0x8852('0x22')]||null:null})[_0x8852('0x1c')](function(_0xadaa33){logger[_0x8852('0xc')](_0x8852('0x1e'),_0x362448);logger[_0x8852('0x1d')]('UpdateSquareReport',_0x362448,JSON[_0x8852('0x10')](_0xadaa33));_0x24b8e8(_0xadaa33);})['catch'](function(_0x38d09e){logger[_0x8852('0x11')]('UpdateSquareReport',_0x38d09e['message'],_0x362448);_0x1dfc12(_0x2f6f65[_0x8852('0x11')](0x1f4,_0x38d09e['message']));});});}; \ No newline at end of file +var _0xeaa6=['debug','UpdateSquareReport','update','where','attributes','limit','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xeaa6,0x6d));var _0x6eaa=function(_0x197302,_0x4df026){_0x197302=_0x197302-0x0;var _0x476e5b=_0xeaa6[_0x197302];return _0x476e5b;};'use strict';var _=require(_0x6eaa('0x0'));var util=require(_0x6eaa('0x1'));var moment=require(_0x6eaa('0x2'));var BPromise=require('bluebird');var rs=require(_0x6eaa('0x3'));var fs=require('fs');var Redis=require(_0x6eaa('0x4'));var db=require(_0x6eaa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eaa('0x6'))('rpc');var config=require(_0x6eaa('0x7'));var jayson=require(_0x6eaa('0x8'));var client=jayson[_0x6eaa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27ecfa,_0x27bcbc,_0x4f966d){return new BPromise(function(_0xa4be6b,_0x3f9ee4){return client[_0x6eaa('0xa')](_0x27ecfa,_0x4f966d)[_0x6eaa('0xb')](function(_0x3e37d9){logger['info'](_0x6eaa('0xc'),_0x27bcbc,_0x6eaa('0xd'));logger['debug'](_0x6eaa('0xe'),_0x27bcbc,'request\x20sent',JSON['stringify'](_0x3e37d9));if(_0x3e37d9[_0x6eaa('0xf')]){if(_0x3e37d9[_0x6eaa('0xf')][_0x6eaa('0x10')]===0x1f4){logger[_0x6eaa('0xf')]('SquareReport,\x20%s,\x20%s',_0x27bcbc,_0x3e37d9[_0x6eaa('0xf')][_0x6eaa('0x11')]);return _0x3f9ee4(_0x3e37d9[_0x6eaa('0xf')][_0x6eaa('0x11')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x27bcbc,_0x3e37d9[_0x6eaa('0xf')][_0x6eaa('0x11')]);return _0xa4be6b(_0x3e37d9[_0x6eaa('0xf')]['message']);}else{logger[_0x6eaa('0x12')]('SquareReport,\x20%s,\x20%s',_0x27bcbc,_0x6eaa('0xd'));_0xa4be6b(_0x3e37d9[_0x6eaa('0x13')][_0x6eaa('0x11')]);}})[_0x6eaa('0x14')](function(_0x5a8582){logger['error'](_0x6eaa('0xc'),_0x27bcbc,_0x5a8582);_0x3f9ee4(_0x5a8582);});});}exports[_0x6eaa('0x15')]=function(_0x5a6859){var _0x15ca9b=this;return new Promise(function(_0x1a2ce8,_0xd376c6){return db[_0x6eaa('0x16')][_0x6eaa('0x17')](_0x5a6859[_0x6eaa('0x18')],{'raw':_0x5a6859[_0x6eaa('0x19')]?_0x5a6859[_0x6eaa('0x19')][_0x6eaa('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x36ede3){logger['info'](_0x6eaa('0x15'),_0x5a6859);logger[_0x6eaa('0x1b')]('CreateSquareReport',_0x5a6859,JSON['stringify'](_0x36ede3));_0x1a2ce8(_0x36ede3);})['catch'](function(_0x1d4c53){logger[_0x6eaa('0xf')]('CreateSquareReport',_0x1d4c53[_0x6eaa('0x11')],_0x5a6859);_0xd376c6(_0x15ca9b['error'](0x1f4,_0x1d4c53[_0x6eaa('0x11')]));});});};exports[_0x6eaa('0x1c')]=function(_0x5b556e){var _0x38a7e7=this;return new Promise(function(_0x3e800f,_0x22cc13){return db[_0x6eaa('0x16')][_0x6eaa('0x1d')](_0x5b556e[_0x6eaa('0x18')],{'raw':_0x5b556e['options']?_0x5b556e['options'][_0x6eaa('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b556e[_0x6eaa('0x19')]?_0x5b556e[_0x6eaa('0x19')][_0x6eaa('0x1e')]||null:null,'attributes':_0x5b556e[_0x6eaa('0x19')]?_0x5b556e[_0x6eaa('0x19')][_0x6eaa('0x1f')]||null:null,'limit':_0x5b556e[_0x6eaa('0x19')]?_0x5b556e[_0x6eaa('0x19')][_0x6eaa('0x20')]||null:null})['then'](function(_0x235ea9){logger['info'](_0x6eaa('0x1c'),_0x5b556e);logger[_0x6eaa('0x1b')](_0x6eaa('0x1c'),_0x5b556e,JSON[_0x6eaa('0x21')](_0x235ea9));_0x3e800f(_0x235ea9);})['catch'](function(_0x438474){logger[_0x6eaa('0xf')](_0x6eaa('0x1c'),_0x438474['message'],_0x5b556e);_0x22cc13(_0x38a7e7[_0x6eaa('0xf')](0x1f4,_0x438474[_0x6eaa('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 00b4cfb..a68fa0c 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 _0xdb90=['post','create','put','delete','exports','multer','util','path','connect-timeout','fs-extra','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xdb90,0x191));var _0x0db9=function(_0x1956c9,_0x2ad6b4){_0x1956c9=_0x1956c9-0x0;var _0x499d4=_0xdb90[_0x1956c9];return _0x499d4;};'use strict';var multer=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var path=require(_0x0db9('0x2'));var timeout=require(_0x0db9('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0db9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0db9('0x5'));var controller=require(_0x0db9('0x6'));router['get']('/',auth[_0x0db9('0x7')](),controller['index']);router[_0x0db9('0x8')](_0x0db9('0x9'),auth['isAuthenticated'](),controller[_0x0db9('0xa')]);router['get'](_0x0db9('0xb'),auth['isAuthenticated'](),controller[_0x0db9('0xc')]);router[_0x0db9('0xd')]('/',auth['isAuthenticated'](),controller[_0x0db9('0xe')]);router[_0x0db9('0xf')](_0x0db9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0db9('0x10')](_0x0db9('0xb'),auth[_0x0db9('0x7')](),controller['destroy']);module[_0x0db9('0x11')]=router; \ No newline at end of file +var _0x8bd7=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id','post','create'];(function(_0x329617,_0x94fb5){var _0x1ad508=function(_0x1e0b8d){while(--_0x1e0b8d){_0x329617['push'](_0x329617['shift']());}};_0x1ad508(++_0x94fb5);}(_0x8bd7,0xd4));var _0x78bd=function(_0x261b16,_0x2d5770){_0x261b16=_0x261b16-0x0;var _0x179200=_0x8bd7[_0x261b16];return _0x179200;};'use strict';var multer=require(_0x78bd('0x0'));var util=require(_0x78bd('0x1'));var path=require(_0x78bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x78bd('0x3'));var router=express[_0x78bd('0x4')]();var fs_extra=require(_0x78bd('0x5'));var auth=require(_0x78bd('0x6'));var interaction=require(_0x78bd('0x7'));var config=require(_0x78bd('0x8'));var controller=require(_0x78bd('0x9'));router[_0x78bd('0xa')]('/',auth[_0x78bd('0xb')](),controller['index']);router['get']('/describe',auth[_0x78bd('0xb')](),controller[_0x78bd('0xc')]);router['get'](_0x78bd('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x78bd('0xe')]('/',auth['isAuthenticated'](),controller[_0x78bd('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x78bd('0x10')]);router[_0x78bd('0x11')](_0x78bd('0xd'),auth[_0x78bd('0xb')](),controller[_0x78bd('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 a1836de..2cdb284 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 _0x5005=['STRING','TEXT','sequelize'];(function(_0x16e515,_0x3ff09d){var _0x2ed0ef=function(_0x5b8ae8){while(--_0x5b8ae8){_0x16e515['push'](_0x16e515['shift']());}};_0x2ed0ef(++_0x3ff09d);}(_0x5005,0xd1));var _0x5500=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x5005[_0x334fea];return _0x3c5829;};'use strict';var Sequelize=require(_0x5500('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5500('0x1')]},'node':{'type':Sequelize[_0x5500('0x1')]},'application':{'type':Sequelize[_0x5500('0x1')]},'data':{'type':Sequelize[_0x5500('0x2')]},'project_name':{'type':Sequelize[_0x5500('0x1')]},'callerid':{'type':Sequelize[_0x5500('0x1')]}}; \ No newline at end of file +var _0x655a=['TEXT','sequelize','STRING'];(function(_0x2968a0,_0x4ed212){var _0x4c9199=function(_0x155a9b){while(--_0x155a9b){_0x2968a0['push'](_0x2968a0['shift']());}};_0x4c9199(++_0x4ed212);}(_0x655a,0x1f0));var _0xa655=function(_0x1a390b,_0x2e46ca){_0x1a390b=_0x1a390b-0x0;var _0x52b44e=_0x655a[_0x1a390b];return _0x52b44e;};'use strict';var Sequelize=require(_0xa655('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa655('0x1')]},'node':{'type':Sequelize[_0xa655('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xa655('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa655('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4c165b2..3faab5e 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 _0x8a9b=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','status','error','stack','name','index','map','SquareDetailsReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','params','catch','create','body','find','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x25e168,_0x4451f1){var _0x2bd496=function(_0x528f0d){while(--_0x528f0d){_0x25e168['push'](_0x25e168['shift']());}};_0x2bd496(++_0x4451f1);}(_0x8a9b,0x16b));var _0xb8a9=function(_0x4373fe,_0x3c3c6e){_0x4373fe=_0x4373fe-0x0;var _0x4d6e86=_0x8a9b[_0x4373fe];return _0x4d6e86;};'use strict';var emlformat=require(_0xb8a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb8a9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8a9('0x2'));var moment=require('moment');var BPromise=require(_0xb8a9('0x3'));var Mustache=require(_0xb8a9('0x4'));var util=require(_0xb8a9('0x5'));var path=require(_0xb8a9('0x6'));var sox=require(_0xb8a9('0x7'));var csv=require(_0xb8a9('0x8'));var ejs=require(_0xb8a9('0x9'));var fs=require('fs');var fs_extra=require(_0xb8a9('0xa'));var _=require(_0xb8a9('0xb'));var squel=require(_0xb8a9('0xc'));var crypto=require(_0xb8a9('0xd'));var jsforce=require(_0xb8a9('0xe'));var deskjs=require(_0xb8a9('0xf'));var toCsv=require(_0xb8a9('0x8'));var querystring=require(_0xb8a9('0x10'));var Papa=require('papaparse');var Redis=require(_0xb8a9('0x11'));var authService=require(_0xb8a9('0x12'));var qs=require(_0xb8a9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb8a9('0x14'));var logger=require(_0xb8a9('0x15'))(_0xb8a9('0x16'));var utils=require(_0xb8a9('0x17'));var config=require(_0xb8a9('0x18'));var licenseUtil=require(_0xb8a9('0x19'));var db=require(_0xb8a9('0x1a'))['db'];function respondWithStatusCode(_0x2b051d,_0x51d4b5){_0x51d4b5=_0x51d4b5||0xcc;return function(_0x21e9c7){if(_0x21e9c7){return _0x2b051d[_0xb8a9('0x1b')](_0x51d4b5);}return _0x2b051d['status'](_0x51d4b5)[_0xb8a9('0x1c')]();};}function respondWithResult(_0x5a761a,_0x2729fb){_0x2729fb=_0x2729fb||0xc8;return function(_0xaf2a00){if(_0xaf2a00){return _0x5a761a['status'](_0x2729fb)['json'](_0xaf2a00);}};}function respondWithFilteredResult(_0x4346e5,_0xca24cb){return function(_0x1befc5){if(_0x1befc5){var _0x5d0d48=typeof _0xca24cb['offset']===_0xb8a9('0x1d')&&typeof _0xca24cb[_0xb8a9('0x1e')]==='undefined';var _0x4f0f85=_0x1befc5[_0xb8a9('0x1f')];var _0x433cdd=_0x5d0d48?0x0:_0xca24cb['offset'];var _0x1ab662=_0x5d0d48?_0x1befc5[_0xb8a9('0x1f')]:_0xca24cb[_0xb8a9('0x20')]+_0xca24cb[_0xb8a9('0x1e')];var _0x5889df;if(_0x1ab662>=_0x4f0f85){_0x1ab662=_0x4f0f85;_0x5889df=0xc8;}else{_0x5889df=0xce;}_0x4346e5['status'](_0x5889df);return _0x4346e5[_0xb8a9('0x21')](_0xb8a9('0x22'),_0x433cdd+'-'+_0x1ab662+'/'+_0x4f0f85)[_0xb8a9('0x23')](_0x1befc5);}return null;};}function patchUpdates(_0x463c15){return function(_0x5ca6a7){try{jsonpatch[_0xb8a9('0x24')](_0x5ca6a7,_0x463c15,!![]);}catch(_0x337608){return BPromise[_0xb8a9('0x25')](_0x337608);}return _0x5ca6a7[_0xb8a9('0x26')]();};}function saveUpdates(_0x53c42b,_0x5612af){return function(_0x2183ab){if(_0x2183ab){return _0x2183ab[_0xb8a9('0x27')](_0x53c42b)[_0xb8a9('0x28')](function(_0x23bb42){return _0x23bb42;});}return null;};}function removeEntity(_0x1e522f,_0x201402){return function(_0x4776c1){if(_0x4776c1){return _0x4776c1['destroy']()[_0xb8a9('0x28')](function(){_0x1e522f[_0xb8a9('0x29')](0xcc)[_0xb8a9('0x1c')]();});}};}function handleEntityNotFound(_0x4db2a7,_0x14c05f){return function(_0x2fe779){if(!_0x2fe779){_0x4db2a7['sendStatus'](0x194);}return _0x2fe779;};}function handleError(_0x20ae3a,_0x119f23){_0x119f23=_0x119f23||0x1f4;return function(_0x5add0d){logger[_0xb8a9('0x2a')](_0x5add0d[_0xb8a9('0x2b')]);if(_0x5add0d['name']){delete _0x5add0d[_0xb8a9('0x2c')];}_0x20ae3a[_0xb8a9('0x29')](_0x119f23)['send'](_0x5add0d);};}exports[_0xb8a9('0x2d')]=function(_0x34af0a,_0x2ca5af){var _0x5bbf7c={},_0x10d2dc={},_0x2f5a8c={'count':0x0,'rows':[]};var _0x242b11=_[_0xb8a9('0x2e')](db[_0xb8a9('0x2f')]['rawAttributes'],function(_0x2c0337){return{'name':_0x2c0337[_0xb8a9('0x30')],'type':_0x2c0337[_0xb8a9('0x31')][_0xb8a9('0x32')]};});_0x10d2dc[_0xb8a9('0x33')]=_[_0xb8a9('0x2e')](_0x242b11,_0xb8a9('0x2c'));_0x10d2dc['query']=_[_0xb8a9('0x34')](_0x34af0a[_0xb8a9('0x35')]);_0x10d2dc[_0xb8a9('0x36')]=_[_0xb8a9('0x37')](_0x10d2dc[_0xb8a9('0x33')],_0x10d2dc[_0xb8a9('0x35')]);_0x5bbf7c[_0xb8a9('0x38')]=_[_0xb8a9('0x37')](_0x10d2dc['model'],qs[_0xb8a9('0x39')](_0x34af0a[_0xb8a9('0x35')]['fields']));_0x5bbf7c[_0xb8a9('0x38')]=_0x5bbf7c[_0xb8a9('0x38')][_0xb8a9('0x3a')]?_0x5bbf7c['attributes']:_0x10d2dc[_0xb8a9('0x33')];if(!_0x34af0a[_0xb8a9('0x35')][_0xb8a9('0x3b')](_0xb8a9('0x3c'))){_0x5bbf7c[_0xb8a9('0x1e')]=qs[_0xb8a9('0x1e')](_0x34af0a[_0xb8a9('0x35')][_0xb8a9('0x1e')]);_0x5bbf7c[_0xb8a9('0x20')]=qs[_0xb8a9('0x20')](_0x34af0a[_0xb8a9('0x35')][_0xb8a9('0x20')]);}_0x5bbf7c[_0xb8a9('0x3d')]=qs[_0xb8a9('0x3e')](_0x34af0a['query'][_0xb8a9('0x3e')]);_0x5bbf7c[_0xb8a9('0x3f')]=qs['filters'](_[_0xb8a9('0x40')](_0x34af0a[_0xb8a9('0x35')],_0x10d2dc[_0xb8a9('0x36')]),_0x242b11);if(_0x34af0a[_0xb8a9('0x35')][_0xb8a9('0x41')]){_0x5bbf7c[_0xb8a9('0x3f')]=_['merge'](_0x5bbf7c[_0xb8a9('0x3f')],{'$or':_[_0xb8a9('0x2e')](_0x242b11,function(_0x34546c){if(_0x34546c[_0xb8a9('0x31')]!=='VIRTUAL'){var _0x41a9a1={};_0x41a9a1[_0x34546c[_0xb8a9('0x2c')]]={'$like':'%'+_0x34af0a['query'][_0xb8a9('0x41')]+'%'};return _0x41a9a1;}})});}_0x5bbf7c=_[_0xb8a9('0x42')]({},_0x5bbf7c,_0x34af0a[_0xb8a9('0x43')]);var _0x3b6f4d={'where':_0x5bbf7c[_0xb8a9('0x3f')]};return db[_0xb8a9('0x2f')]['count'](_0x3b6f4d)[_0xb8a9('0x28')](function(_0x31b146){_0x2f5a8c['count']=_0x31b146;if(_0x34af0a[_0xb8a9('0x35')][_0xb8a9('0x44')]){_0x5bbf7c['include']=[{'all':!![]}];}return db[_0xb8a9('0x2f')]['findAll'](_0x5bbf7c);})[_0xb8a9('0x28')](function(_0x218892){_0x2f5a8c[_0xb8a9('0x45')]=_0x218892;return _0x2f5a8c;})[_0xb8a9('0x28')](respondWithFilteredResult(_0x2ca5af,_0x5bbf7c))['catch'](handleError(_0x2ca5af,null));};exports['show']=function(_0x191857,_0x25e424){var _0x49fd2d={'raw':!![],'where':{'id':_0x191857[_0xb8a9('0x46')]['id']}},_0x56d0bc={};_0x56d0bc[_0xb8a9('0x33')]=_[_0xb8a9('0x34')](db[_0xb8a9('0x2f')]['rawAttributes']);_0x56d0bc[_0xb8a9('0x35')]=_[_0xb8a9('0x34')](_0x191857[_0xb8a9('0x35')]);_0x56d0bc['filters']=_[_0xb8a9('0x37')](_0x56d0bc[_0xb8a9('0x33')],_0x56d0bc[_0xb8a9('0x35')]);_0x49fd2d['attributes']=_[_0xb8a9('0x37')](_0x56d0bc[_0xb8a9('0x33')],qs[_0xb8a9('0x39')](_0x191857[_0xb8a9('0x35')][_0xb8a9('0x39')]));_0x49fd2d['attributes']=_0x49fd2d['attributes'][_0xb8a9('0x3a')]?_0x49fd2d['attributes']:_0x56d0bc[_0xb8a9('0x33')];if(_0x191857['query']['includeAll']){_0x49fd2d['include']=[{'all':!![]}];}_0x49fd2d=_[_0xb8a9('0x42')]({},_0x49fd2d,_0x191857[_0xb8a9('0x43')]);return db[_0xb8a9('0x2f')]['find'](_0x49fd2d)[_0xb8a9('0x28')](handleEntityNotFound(_0x25e424,null))['then'](respondWithResult(_0x25e424,null))[_0xb8a9('0x47')](handleError(_0x25e424,null));};exports[_0xb8a9('0x48')]=function(_0x3c39ef,_0x137ff0){return db[_0xb8a9('0x2f')][_0xb8a9('0x48')](_0x3c39ef[_0xb8a9('0x49')],{})['then'](respondWithResult(_0x137ff0,0xc9))[_0xb8a9('0x47')](handleError(_0x137ff0,null));};exports[_0xb8a9('0x27')]=function(_0x58b6ef,_0x5b7284){if(_0x58b6ef[_0xb8a9('0x49')]['id']){delete _0x58b6ef[_0xb8a9('0x49')]['id'];}return db[_0xb8a9('0x2f')][_0xb8a9('0x4a')]({'where':{'id':_0x58b6ef[_0xb8a9('0x46')]['id']}})[_0xb8a9('0x28')](handleEntityNotFound(_0x5b7284,null))[_0xb8a9('0x28')](saveUpdates(_0x58b6ef[_0xb8a9('0x49')],null))['then'](respondWithResult(_0x5b7284,null))[_0xb8a9('0x47')](handleError(_0x5b7284,null));};exports[_0xb8a9('0x4b')]=function(_0x42ef03,_0x2add86){return db[_0xb8a9('0x2f')]['find']({'where':{'id':_0x42ef03[_0xb8a9('0x46')]['id']}})[_0xb8a9('0x28')](handleEntityNotFound(_0x2add86,null))[_0xb8a9('0x28')](removeEntity(_0x2add86,null))['catch'](handleError(_0x2add86,null));};exports[_0xb8a9('0x4c')]=function(_0x45abf9,_0x5c15e4){return db[_0xb8a9('0x2f')][_0xb8a9('0x4c')]()[_0xb8a9('0x28')](respondWithResult(_0x5c15e4,null))[_0xb8a9('0x47')](handleError(_0x5c15e4,null));}; \ No newline at end of file +var _0xff0d=['moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','reject','update','destroy','end','error','name','send','index','SquareDetailsReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','count','then','includeAll','findAll','rows','catch','show','length','include','merge','create','body','find','params','describe','request-promise'];(function(_0x2ee3cf,_0x5f444f){var _0x2cced2=function(_0x159a2d){while(--_0x159a2d){_0x2ee3cf['push'](_0x2ee3cf['shift']());}};_0x2cced2(++_0x5f444f);}(_0xff0d,0xda));var _0xdff0=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xff0d[_0x2080a3];return _0x8d7d17;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdff0('0x0'));var moment=require(_0xdff0('0x1'));var BPromise=require(_0xdff0('0x2'));var Mustache=require(_0xdff0('0x3'));var util=require('util');var path=require(_0xdff0('0x4'));var sox=require(_0xdff0('0x5'));var csv=require(_0xdff0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdff0('0x7'));var squel=require('squel');var crypto=require(_0xdff0('0x8'));var jsforce=require(_0xdff0('0x9'));var deskjs=require(_0xdff0('0xa'));var toCsv=require(_0xdff0('0x6'));var querystring=require(_0xdff0('0xb'));var Papa=require(_0xdff0('0xc'));var Redis=require(_0xdff0('0xd'));var authService=require(_0xdff0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xdff0('0xf'));var hardwareService=require(_0xdff0('0x10'));var logger=require(_0xdff0('0x11'))(_0xdff0('0x12'));var utils=require(_0xdff0('0x13'));var config=require(_0xdff0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdff0('0x15'))['db'];function respondWithStatusCode(_0x13dcdc,_0x3a33b4){_0x3a33b4=_0x3a33b4||0xcc;return function(_0x49f43c){if(_0x49f43c){return _0x13dcdc[_0xdff0('0x16')](_0x3a33b4);}return _0x13dcdc[_0xdff0('0x17')](_0x3a33b4)['end']();};}function respondWithResult(_0x56ff94,_0x4850dd){_0x4850dd=_0x4850dd||0xc8;return function(_0x1ce4ca){if(_0x1ce4ca){return _0x56ff94[_0xdff0('0x17')](_0x4850dd)[_0xdff0('0x18')](_0x1ce4ca);}};}function respondWithFilteredResult(_0x4a173a,_0x11b2c2){return function(_0x566041){if(_0x566041){var _0x286b2f=typeof _0x11b2c2[_0xdff0('0x19')]==='undefined'&&typeof _0x11b2c2['limit']==='undefined';var _0x5b29b7=_0x566041['count'];var _0x15194a=_0x286b2f?0x0:_0x11b2c2[_0xdff0('0x19')];var _0x1fdf69=_0x286b2f?_0x566041['count']:_0x11b2c2['offset']+_0x11b2c2['limit'];var _0x4f387f;if(_0x1fdf69>=_0x5b29b7){_0x1fdf69=_0x5b29b7;_0x4f387f=0xc8;}else{_0x4f387f=0xce;}_0x4a173a['status'](_0x4f387f);return _0x4a173a['set'](_0xdff0('0x1a'),_0x15194a+'-'+_0x1fdf69+'/'+_0x5b29b7)[_0xdff0('0x18')](_0x566041);}return null;};}function patchUpdates(_0xb48b46){return function(_0x290242){try{jsonpatch[_0xdff0('0x1b')](_0x290242,_0xb48b46,!![]);}catch(_0x327ac7){return BPromise[_0xdff0('0x1c')](_0x327ac7);}return _0x290242['save']();};}function saveUpdates(_0x120a9b,_0x29d65e){return function(_0x5c9c64){if(_0x5c9c64){return _0x5c9c64[_0xdff0('0x1d')](_0x120a9b)['then'](function(_0x3a0b07){return _0x3a0b07;});}return null;};}function removeEntity(_0x1f79f2,_0x177d4e){return function(_0x584125){if(_0x584125){return _0x584125[_0xdff0('0x1e')]()['then'](function(){_0x1f79f2[_0xdff0('0x17')](0xcc)[_0xdff0('0x1f')]();});}};}function handleEntityNotFound(_0x2fede1,_0x15d79c){return function(_0x59e707){if(!_0x59e707){_0x2fede1['sendStatus'](0x194);}return _0x59e707;};}function handleError(_0x27dca2,_0x45324b){_0x45324b=_0x45324b||0x1f4;return function(_0x1244a7){logger[_0xdff0('0x20')](_0x1244a7['stack']);if(_0x1244a7[_0xdff0('0x21')]){delete _0x1244a7['name'];}_0x27dca2['status'](_0x45324b)[_0xdff0('0x22')](_0x1244a7);};}exports[_0xdff0('0x23')]=function(_0x55ded5,_0x2d2251){var _0x567d37={},_0x3776bc={},_0x1df010={'count':0x0,'rows':[]};var _0x503550=_['map'](db[_0xdff0('0x24')][_0xdff0('0x25')],function(_0x3861a6){return{'name':_0x3861a6[_0xdff0('0x26')],'type':_0x3861a6[_0xdff0('0x27')][_0xdff0('0x28')]};});_0x3776bc['model']=_[_0xdff0('0x29')](_0x503550,'name');_0x3776bc[_0xdff0('0x2a')]=_[_0xdff0('0x2b')](_0x55ded5[_0xdff0('0x2a')]);_0x3776bc[_0xdff0('0x2c')]=_[_0xdff0('0x2d')](_0x3776bc['model'],_0x3776bc['query']);_0x567d37[_0xdff0('0x2e')]=_[_0xdff0('0x2d')](_0x3776bc[_0xdff0('0x2f')],qs['fields'](_0x55ded5[_0xdff0('0x2a')][_0xdff0('0x30')]));_0x567d37[_0xdff0('0x2e')]=_0x567d37['attributes']['length']?_0x567d37[_0xdff0('0x2e')]:_0x3776bc[_0xdff0('0x2f')];if(!_0x55ded5[_0xdff0('0x2a')]['hasOwnProperty'](_0xdff0('0x31'))){_0x567d37['limit']=qs['limit'](_0x55ded5['query'][_0xdff0('0x32')]);_0x567d37['offset']=qs[_0xdff0('0x19')](_0x55ded5[_0xdff0('0x2a')][_0xdff0('0x19')]);}_0x567d37[_0xdff0('0x33')]=qs[_0xdff0('0x34')](_0x55ded5[_0xdff0('0x2a')][_0xdff0('0x34')]);_0x567d37[_0xdff0('0x35')]=qs[_0xdff0('0x2c')](_[_0xdff0('0x36')](_0x55ded5[_0xdff0('0x2a')],_0x3776bc[_0xdff0('0x2c')]),_0x503550);if(_0x55ded5[_0xdff0('0x2a')][_0xdff0('0x37')]){_0x567d37[_0xdff0('0x35')]=_['merge'](_0x567d37[_0xdff0('0x35')],{'$or':_['map'](_0x503550,function(_0x22f2de){if(_0x22f2de[_0xdff0('0x27')]!==_0xdff0('0x38')){var _0x73765a={};_0x73765a[_0x22f2de[_0xdff0('0x21')]]={'$like':'%'+_0x55ded5['query'][_0xdff0('0x37')]+'%'};return _0x73765a;}})});}_0x567d37=_['merge']({},_0x567d37,_0x55ded5[_0xdff0('0x39')]);var _0x1fc066={'where':_0x567d37[_0xdff0('0x35')]};return db[_0xdff0('0x24')][_0xdff0('0x3a')](_0x1fc066)[_0xdff0('0x3b')](function(_0x5e8fb7){_0x1df010['count']=_0x5e8fb7;if(_0x55ded5[_0xdff0('0x2a')][_0xdff0('0x3c')]){_0x567d37['include']=[{'all':!![]}];}return db[_0xdff0('0x24')][_0xdff0('0x3d')](_0x567d37);})[_0xdff0('0x3b')](function(_0x140f86){_0x1df010[_0xdff0('0x3e')]=_0x140f86;return _0x1df010;})[_0xdff0('0x3b')](respondWithFilteredResult(_0x2d2251,_0x567d37))[_0xdff0('0x3f')](handleError(_0x2d2251,null));};exports[_0xdff0('0x40')]=function(_0x4a598c,_0x18b781){var _0x102618={'raw':!![],'where':{'id':_0x4a598c['params']['id']}},_0x51d6d7={};_0x51d6d7[_0xdff0('0x2f')]=_[_0xdff0('0x2b')](db[_0xdff0('0x24')]['rawAttributes']);_0x51d6d7[_0xdff0('0x2a')]=_[_0xdff0('0x2b')](_0x4a598c[_0xdff0('0x2a')]);_0x51d6d7[_0xdff0('0x2c')]=_['intersection'](_0x51d6d7['model'],_0x51d6d7[_0xdff0('0x2a')]);_0x102618[_0xdff0('0x2e')]=_[_0xdff0('0x2d')](_0x51d6d7[_0xdff0('0x2f')],qs[_0xdff0('0x30')](_0x4a598c[_0xdff0('0x2a')][_0xdff0('0x30')]));_0x102618['attributes']=_0x102618[_0xdff0('0x2e')][_0xdff0('0x41')]?_0x102618['attributes']:_0x51d6d7[_0xdff0('0x2f')];if(_0x4a598c[_0xdff0('0x2a')][_0xdff0('0x3c')]){_0x102618[_0xdff0('0x42')]=[{'all':!![]}];}_0x102618=_[_0xdff0('0x43')]({},_0x102618,_0x4a598c[_0xdff0('0x39')]);return db[_0xdff0('0x24')]['find'](_0x102618)[_0xdff0('0x3b')](handleEntityNotFound(_0x18b781,null))[_0xdff0('0x3b')](respondWithResult(_0x18b781,null))[_0xdff0('0x3f')](handleError(_0x18b781,null));};exports[_0xdff0('0x44')]=function(_0x4f197d,_0x277165){return db[_0xdff0('0x24')][_0xdff0('0x44')](_0x4f197d[_0xdff0('0x45')],{})[_0xdff0('0x3b')](respondWithResult(_0x277165,0xc9))[_0xdff0('0x3f')](handleError(_0x277165,null));};exports[_0xdff0('0x1d')]=function(_0x2e75b8,_0x2be9cc){if(_0x2e75b8[_0xdff0('0x45')]['id']){delete _0x2e75b8['body']['id'];}return db[_0xdff0('0x24')][_0xdff0('0x46')]({'where':{'id':_0x2e75b8[_0xdff0('0x47')]['id']}})[_0xdff0('0x3b')](handleEntityNotFound(_0x2be9cc,null))[_0xdff0('0x3b')](saveUpdates(_0x2e75b8['body'],null))[_0xdff0('0x3b')](respondWithResult(_0x2be9cc,null))['catch'](handleError(_0x2be9cc,null));};exports[_0xdff0('0x1e')]=function(_0x479dc4,_0x1a9c6b){return db[_0xdff0('0x24')]['find']({'where':{'id':_0x479dc4[_0xdff0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9c6b,null))[_0xdff0('0x3b')](removeEntity(_0x1a9c6b,null))[_0xdff0('0x3f')](handleError(_0x1a9c6b,null));};exports['describe']=function(_0x3ca58d,_0x4fe541){return db[_0xdff0('0x24')][_0xdff0('0x48')]()[_0xdff0('0x3b')](respondWithResult(_0x4fe541,null))[_0xdff0('0x3f')](handleError(_0x4fe541,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index ab9486a..ae42653 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 _0x4bef=['rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4bef,0x1e7));var _0xf4be=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x4bef[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xf4be('0x0'));var util=require(_0xf4be('0x1'));var logger=require('../../config/logger')(_0xf4be('0x2'));var moment=require(_0xf4be('0x3'));var BPromise=require(_0xf4be('0x4'));var rp=require(_0xf4be('0x5'));var fs=require('fs');var path=require(_0xf4be('0x6'));var rimraf=require(_0xf4be('0x7'));var config=require(_0xf4be('0x8'));var attributes=require(_0xf4be('0x9'));module['exports']=function(_0x458b8d,_0x3abf9){return _0x458b8d[_0xf4be('0xa')](_0xf4be('0xb'),attributes,{'tableName':_0xf4be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d9e=['path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5eab76,_0x29d3a7){var _0x58d159=function(_0x21f72a){while(--_0x21f72a){_0x5eab76['push'](_0x5eab76['shift']());}};_0x58d159(++_0x29d3a7);}(_0x1d9e,0xfe));var _0xe1d9=function(_0x4a5bf9,_0x226d91){_0x4a5bf9=_0x4a5bf9-0x0;var _0x1ef570=_0x1d9e[_0x4a5bf9];return _0x1ef570;};'use strict';var _=require(_0xe1d9('0x0'));var util=require(_0xe1d9('0x1'));var logger=require(_0xe1d9('0x2'))(_0xe1d9('0x3'));var moment=require(_0xe1d9('0x4'));var BPromise=require(_0xe1d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1d9('0x6'));var rimraf=require(_0xe1d9('0x7'));var config=require(_0xe1d9('0x8'));var attributes=require(_0xe1d9('0x9'));module['exports']=function(_0x1ece42,_0xb20a7b){return _0x1ece42[_0xe1d9('0xa')](_0xe1d9('0xb'),attributes,{'tableName':_0xe1d9('0xc'),'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 afd88ed..4b14c05 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 _0x937d=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x3e1183,_0x2f567e){var _0x4c656b=function(_0x5f25fa){while(--_0x5f25fa){_0x3e1183['push'](_0x3e1183['shift']());}};_0x4c656b(++_0x2f567e);}(_0x937d,0x1f4));var _0xd937=function(_0x19f1dd,_0x2d13c8){_0x19f1dd=_0x19f1dd-0x0;var _0x1d40ee=_0x937d[_0x19f1dd];return _0x1d40ee;};'use strict';var _=require(_0xd937('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd937('0x1'));var fs=require('fs');var Redis=require(_0xd937('0x2'));var db=require(_0xd937('0x3'))['db'];var utils=require(_0xd937('0x4'));var logger=require(_0xd937('0x5'))(_0xd937('0x6'));var config=require('../../config/environment');var jayson=require(_0xd937('0x7'));var client=jayson[_0xd937('0x8')][_0xd937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cd9,_0x2454f9,_0x4dc790){return new BPromise(function(_0x490b1d,_0x372dff){return client[_0xd937('0xa')](_0x4f6cd9,_0x4dc790)[_0xd937('0xb')](function(_0xa97338){logger[_0xd937('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xd937('0xd'));logger['debug'](_0xd937('0xe'),_0x2454f9,'request\x20sent',JSON[_0xd937('0xf')](_0xa97338));if(_0xa97338[_0xd937('0x10')]){if(_0xa97338[_0xd937('0x10')][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x372dff(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0x13'),_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x490b1d(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}else{logger['info'](_0xd937('0x13'),_0x2454f9,_0xd937('0xd'));_0x490b1d(_0xa97338[_0xd937('0x14')]['message']);}})[_0xd937('0x15')](function(_0x16d2ba){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0x16d2ba);_0x372dff(_0x16d2ba);});});}exports[_0xd937('0x16')]=function(_0x3d6b1c){var _0x1d1b8b=this;return new Promise(function(_0x1bd7ee,_0x26d5ca){return db[_0xd937('0x17')][_0xd937('0x18')](_0x3d6b1c[_0xd937('0x19')],{'raw':_0x3d6b1c[_0xd937('0x1a')]?_0x3d6b1c[_0xd937('0x1a')][_0xd937('0x1b')]===undefined?!![]:![]:!![]})[_0xd937('0xb')](function(_0x2c18ea){logger[_0xd937('0xc')](_0xd937('0x16'),_0x3d6b1c);logger[_0xd937('0x1c')](_0xd937('0x16'),_0x3d6b1c,JSON['stringify'](_0x2c18ea));_0x1bd7ee(_0x2c18ea);})[_0xd937('0x15')](function(_0x168f3e){logger[_0xd937('0x10')](_0xd937('0x16'),_0x168f3e[_0xd937('0x12')],_0x3d6b1c);_0x26d5ca(_0x1d1b8b[_0xd937('0x10')](0x1f4,_0x168f3e[_0xd937('0x12')]));});});}; \ No newline at end of file +var _0x5eb8=['CreateSquareDetailsReport','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','catch','SquareDetailsReport','create','body','options','raw','then'];(function(_0x3fdc6a,_0x4b1da1){var _0x378f0b=function(_0x39e172){while(--_0x39e172){_0x3fdc6a['push'](_0x3fdc6a['shift']());}};_0x378f0b(++_0x4b1da1);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0x5eb8[_0x5976f8];return _0x179715;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateSquareDetailsReport']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateSquareDetailsReport',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e5c1029..5a5d2b9 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 _0x5da2=['./system.controller','index','get','/process/:pid/kill','isAuthenticated','express','Router'];(function(_0x317b11,_0x598f5a){var _0x44e5b8=function(_0x4c7e88){while(--_0x4c7e88){_0x317b11['push'](_0x317b11['shift']());}};_0x44e5b8(++_0x598f5a);}(_0x5da2,0x10f));var _0x25da=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x5da2[_0x23b655];return _0x364b32;};'use strict';var express=require(_0x25da('0x0'));var router=express[_0x25da('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x25da('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x25da('0x3')]);router[_0x25da('0x4')](_0x25da('0x5'),auth[_0x25da('0x6')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0xf829=['index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','./system.controller','isAuthenticated'];(function(_0x9f1fb1,_0x4c7ade){var _0x45477d=function(_0x2d7b41){while(--_0x2d7b41){_0x9f1fb1['push'](_0x9f1fb1['shift']());}};_0x45477d(++_0x4c7ade);}(_0xf829,0x1b4));var _0x9f82=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xf829[_0x4854d6];return _0x3885c0;};'use strict';var express=require(_0x9f82('0x0'));var router=express[_0x9f82('0x1')]();var auth=require(_0x9f82('0x2'));var controller=require(_0x9f82('0x3'));router['get']('/',auth[_0x9f82('0x4')](),controller[_0x9f82('0x5')]);router['get'](_0x9f82('0x6'),auth[_0x9f82('0x4')](),controller[_0x9f82('0x7')]);module[_0x9f82('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6af8098..c1d6b9e 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 _0x2b56=['json','killProcess','format','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','getAllData','then'];(function(_0x1003cf,_0x5820ab){var _0xc48efb=function(_0x516cb0){while(--_0x516cb0){_0x1003cf['push'](_0x1003cf['shift']());}};_0xc48efb(++_0x5820ab);}(_0x2b56,0xa2));var _0x62b5=function(_0xf793f9,_0x43ecce){_0xf793f9=_0xf793f9-0x0;var _0x228435=_0x2b56[_0xf793f9];return _0x228435;};'use strict';var info=require(_0x62b5('0x0'));var exec=require(_0x62b5('0x1'))['exec'];var logger=require(_0x62b5('0x2'))(_0x62b5('0x3'));var util=require(_0x62b5('0x4'));var BPromise=require(_0x62b5('0x5'));var _=require(_0x62b5('0x6'));function handleError(_0x17d4d3,_0x30f54e,_0x3819a8){_0x30f54e=_0x30f54e||0x1f4;return function(_0x76cc2e){logger[_0x62b5('0x7')](_0x62b5('0x8'),_0x3819a8,_0x30f54e,util['inspect'](_0x76cc2e,{'showHidden':![],'depth':null}));delete _0x76cc2e[_0x62b5('0x9')];_0x17d4d3[_0x62b5('0xa')](_0x30f54e)['send'](_0x76cc2e);};}exports['index']=function(_0x10e307,_0x41e5f6){return info[_0x62b5('0xb')]()[_0x62b5('0xc')](function(_0x32172c){return _0x41e5f6[_0x62b5('0xa')](0xc8)[_0x62b5('0xd')](_0x32172c);})['catch'](function(_0x50b74e){return _0x41e5f6[_0x62b5('0xa')](0x1f4)[_0x62b5('0xd')](_0x50b74e);});};exports[_0x62b5('0xe')]=function(_0xf2b40f,_0x53297b){var _0x443c98=['components/import/cm'];return new BPromise(function(_0x5125a1,_0x136046){return exec(util[_0x62b5('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xf2b40f[_0x62b5('0x10')][_0x62b5('0x11')]),function(_0x3294af,_0x27e609,_0x410ebe){if(_0x3294af){return _0x136046(_0x3294af);}return _0x5125a1(_0x27e609);});})[_0x62b5('0xc')](function(_0x4a0b17){var _0xa750d4=![];var _0x529adb=_0x4a0b17[_0x62b5('0x12')](/\n/);for(var _0x3be040=0x0,_0x474a43=_0x443c98[_0x62b5('0x13')];_0x3be040<_0x474a43,_0xa750d4===![];_0x3be040+=0x1){if(_0x4a0b17[_0x62b5('0x14')](_0x443c98[_0x3be040])>=0x0){_0xa750d4=!![];}}if(!_0xa750d4){throw new Error(util[_0x62b5('0xf')](_0x62b5('0x15'),_0xf2b40f['params'][_0x62b5('0x11')]));}process['kill'](_0xf2b40f[_0x62b5('0x10')][_0x62b5('0x11')],_0x62b5('0x16'));return _0x53297b['status'](0xc8)['json']({'message':util[_0x62b5('0xf')](_0x62b5('0x17'),_0xf2b40f[_0x62b5('0x10')][_0x62b5('0x11')])});})[_0x62b5('0x18')](handleError(_0x53297b,null,'killProcess'));}; \ No newline at end of file +var _0x6681=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','catch','exec','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf'];(function(_0x36c527,_0x312a2c){var _0x2419a5=function(_0x5245cb){while(--_0x5245cb){_0x36c527['push'](_0x36c527['shift']());}};_0x2419a5(++_0x312a2c);}(_0x6681,0x81));var _0x1668=function(_0x420216,_0x418a5c){_0x420216=_0x420216-0x0;var _0xe875d=_0x6681[_0x420216];return _0xe875d;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x1668('0x0')];var logger=require('../../config/logger')('api');var util=require(_0x1668('0x1'));var BPromise=require(_0x1668('0x2'));var _=require('lodash');function handleError(_0x7674,_0x126e7c,_0x4be84b){_0x126e7c=_0x126e7c||0x1f4;return function(_0x39a355){logger[_0x1668('0x3')](_0x1668('0x4'),_0x4be84b,_0x126e7c,util[_0x1668('0x5')](_0x39a355,{'showHidden':![],'depth':null}));delete _0x39a355[_0x1668('0x6')];_0x7674[_0x1668('0x7')](_0x126e7c)[_0x1668('0x8')](_0x39a355);};}exports[_0x1668('0x9')]=function(_0x43e6be,_0x54f739){return info[_0x1668('0xa')]()[_0x1668('0xb')](function(_0x22966e){return _0x54f739['status'](0xc8)[_0x1668('0xc')](_0x22966e);})['catch'](function(_0xa287d2){return _0x54f739[_0x1668('0x7')](0x1f4)[_0x1668('0xc')](_0xa287d2);});};exports['killProcess']=function(_0x3d43f0,_0x34ade5){var _0x2e4547=[_0x1668('0xd')];return new BPromise(function(_0x407957,_0x3f20e7){return exec(util[_0x1668('0xe')](_0x1668('0xf'),_0x3d43f0[_0x1668('0x10')][_0x1668('0x11')]),function(_0x29514c,_0x2c7901,_0x3ffd77){if(_0x29514c){return _0x3f20e7(_0x29514c);}return _0x407957(_0x2c7901);});})[_0x1668('0xb')](function(_0x46b94b){var _0x1e2c32=![];var _0x206c78=_0x46b94b[_0x1668('0x12')](/\n/);for(var _0x48a6b9=0x0,_0x4134dc=_0x2e4547[_0x1668('0x13')];_0x48a6b9<_0x4134dc,_0x1e2c32===![];_0x48a6b9+=0x1){if(_0x46b94b[_0x1668('0x14')](_0x2e4547[_0x48a6b9])>=0x0){_0x1e2c32=!![];}}if(!_0x1e2c32){throw new Error(util[_0x1668('0xe')](_0x1668('0x15'),_0x3d43f0[_0x1668('0x10')][_0x1668('0x11')]));}process[_0x1668('0x16')](_0x3d43f0[_0x1668('0x10')][_0x1668('0x11')],_0x1668('0x17'));return _0x34ade5[_0x1668('0x7')](0xc8)[_0x1668('0xc')]({'message':util['format']('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3d43f0[_0x1668('0x10')]['pid'])});})[_0x1668('0x18')](handleError(_0x34ade5,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 1bfb933..2692941 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 _0x6038=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x6038,0x1f4));var _0x8603=function(_0x17e5e2,_0x1f7519){_0x17e5e2=_0x17e5e2-0x0;var _0x400144=_0x6038[_0x17e5e2];return _0x400144;};'use strict';var multer=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var path=require(_0x8603('0x2'));var timeout=require(_0x8603('0x3'));var express=require(_0x8603('0x4'));var router=express['Router']();var fs_extra=require(_0x8603('0x5'));var auth=require(_0x8603('0x6'));var interaction=require(_0x8603('0x7'));var config=require(_0x8603('0x8'));var controller=require(_0x8603('0x9'));router[_0x8603('0xa')]('/',auth[_0x8603('0xb')](),controller[_0x8603('0xc')]);router[_0x8603('0xa')](_0x8603('0xd'),auth[_0x8603('0xb')](),controller[_0x8603('0xe')]);router[_0x8603('0xf')]('/',auth[_0x8603('0xb')](),controller[_0x8603('0x10')]);router[_0x8603('0x11')](_0x8603('0xd'),auth[_0x8603('0xb')](),controller[_0x8603('0x12')]);router[_0x8603('0x13')](_0x8603('0xd'),auth[_0x8603('0xb')](),controller[_0x8603('0x14')]);module[_0x8603('0x15')]=router; \ No newline at end of file +var _0x1b7b=['index','/:id','show','create','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x48be34,_0x8923b4){var _0x5218bc=function(_0x51be28){while(--_0x51be28){_0x48be34['push'](_0x48be34['shift']());}};_0x5218bc(++_0x8923b4);}(_0x1b7b,0x104));var _0xb1b7=function(_0x53b3cc,_0x18c22f){_0x53b3cc=_0x53b3cc-0x0;var _0x28c9db=_0x1b7b[_0x53b3cc];return _0x28c9db;};'use strict';var multer=require(_0xb1b7('0x0'));var util=require(_0xb1b7('0x1'));var path=require(_0xb1b7('0x2'));var timeout=require(_0xb1b7('0x3'));var express=require('express');var router=express[_0xb1b7('0x4')]();var fs_extra=require(_0xb1b7('0x5'));var auth=require(_0xb1b7('0x6'));var interaction=require(_0xb1b7('0x7'));var config=require(_0xb1b7('0x8'));var controller=require('./tag.controller');router[_0xb1b7('0x9')]('/',auth['isAuthenticated'](),controller[_0xb1b7('0xa')]);router['get'](_0xb1b7('0xb'),auth['isAuthenticated'](),controller[_0xb1b7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb1b7('0xd')]);router['put'](_0xb1b7('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb1b7('0xe')](_0xb1b7('0xb'),auth[_0xb1b7('0xf')](),controller[_0xb1b7('0x10')]);module[_0xb1b7('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 f65c624..c7c46bf 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 _0xa902=['name','sequelize','exports','STRING'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0xa902,0x8d));var _0x2a90=function(_0x4d2e54,_0x165b2b){_0x4d2e54=_0x4d2e54-0x0;var _0x582a1d=_0xa902[_0x4d2e54];return _0x582a1d;};'use strict';var Sequelize=require(_0x2a90('0x0'));module[_0x2a90('0x1')]={'name':{'type':Sequelize[_0x2a90('0x2')],'unique':_0x2a90('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2a90('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x2a90('0x2')]}}; \ No newline at end of file +var _0x2884=['STRING','name','sequelize'];(function(_0x2fefdb,_0x26315f){var _0x2f14da=function(_0xb2c5ff){while(--_0xb2c5ff){_0x2fefdb['push'](_0x2fefdb['shift']());}};_0x2f14da(++_0x26315f);}(_0x2884,0x1eb));var _0x4288=function(_0x4d8fe1,_0x3ed474){_0x4d8fe1=_0x4d8fe1-0x0;var _0x46685e=_0x2884[_0x4d8fe1];return _0x46685e;};'use strict';var Sequelize=require(_0x4288('0x0'));module['exports']={'name':{'type':Sequelize[_0x4288('0x1')],'unique':_0x4288('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4288('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x4288('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f0eab3c..2a35cf9 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 _0x073e=['save','update','then','destroy','stack','name','send','index','Tag','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','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','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x326476,_0x2c4c0b){var _0x1c616c=function(_0x1bae8f){while(--_0x1bae8f){_0x326476['push'](_0x326476['shift']());}};_0x1c616c(++_0x2c4c0b);}(_0x073e,0x181));var _0xe073=function(_0xd63ab7,_0xb5bb72){_0xd63ab7=_0xd63ab7-0x0;var _0x1bad90=_0x073e[_0xd63ab7];return _0x1bad90;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){var _0x5e3b16=_0x4c76ef['get']({'plain':!![]});var _0x5c4137='Tags';return db['UserProfileResource'][_0xe073('0x26')]({'where':{'type':_0x5c4137,'resourceId':_0x5e3b16['id']}})[_0xe073('0x25')](function(){return _0x4c76ef;});})['then'](function(){_0x275aa8[_0xe073('0x1a')](0xcc)[_0xe073('0x19')]();});}};}function handleEntityNotFound(_0x436c34,_0x5a5b2b){return function(_0x10f5ba){if(!_0x10f5ba){_0x436c34['sendStatus'](0x194);}return _0x10f5ba;};}function handleError(_0x255d91,_0x2e5fac){_0x2e5fac=_0x2e5fac||0x1f4;return function(_0x599972){logger['error'](_0x599972[_0xe073('0x27')]);if(_0x599972[_0xe073('0x28')]){delete _0x599972[_0xe073('0x28')];}_0x255d91[_0xe073('0x1a')](_0x2e5fac)[_0xe073('0x29')](_0x599972);};}exports[_0xe073('0x2a')]=function(_0x4f60dd,_0x2a206a){var _0x5c04fe={},_0x1baa0a={},_0x1cdcb0={'count':0x0,'rows':[]};var _0x4a6884=_['map'](db[_0xe073('0x2b')]['rawAttributes'],function(_0x3f6564){return{'name':_0x3f6564[_0xe073('0x2c')],'type':_0x3f6564[_0xe073('0x2d')]['key']};});_0x1baa0a['model']=_[_0xe073('0x2e')](_0x4a6884,_0xe073('0x28'));_0x1baa0a['query']=_[_0xe073('0x2f')](_0x4f60dd[_0xe073('0x30')]);_0x1baa0a[_0xe073('0x31')]=_['intersection'](_0x1baa0a[_0xe073('0x32')],_0x1baa0a['query']);_0x5c04fe['attributes']=_[_0xe073('0x33')](_0x1baa0a[_0xe073('0x32')],qs[_0xe073('0x34')](_0x4f60dd['query'][_0xe073('0x34')]));_0x5c04fe[_0xe073('0x35')]=_0x5c04fe[_0xe073('0x35')]['length']?_0x5c04fe[_0xe073('0x35')]:_0x1baa0a[_0xe073('0x32')];if(!_0x4f60dd[_0xe073('0x30')][_0xe073('0x36')](_0xe073('0x37'))){_0x5c04fe[_0xe073('0x1e')]=qs['limit'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1e')]);_0x5c04fe[_0xe073('0x1c')]=qs['offset'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1c')]);}_0x5c04fe[_0xe073('0x38')]=qs[_0xe073('0x39')](_0x4f60dd[_0xe073('0x30')]['sort']);_0x5c04fe[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x4f60dd[_0xe073('0x30')],_0x1baa0a[_0xe073('0x31')]),_0x4a6884);if(_0x4f60dd[_0xe073('0x30')][_0xe073('0x3c')]){_0x5c04fe[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x5c04fe[_0xe073('0x3a')],{'$or':_[_0xe073('0x2e')](_0x4a6884,function(_0x3d29e5){if(_0x3d29e5[_0xe073('0x2d')]!==_0xe073('0x3e')){var _0x16be1a={};_0x16be1a[_0x3d29e5['name']]={'$like':'%'+_0x4f60dd[_0xe073('0x30')]['filter']+'%'};return _0x16be1a;}})});}_0x5c04fe=_[_0xe073('0x3d')]({},_0x5c04fe,_0x4f60dd[_0xe073('0x3f')]);var _0x5a4e19={'where':_0x5c04fe[_0xe073('0x3a')]};return db['Tag'][_0xe073('0x1d')](_0x5a4e19)[_0xe073('0x25')](function(_0x93852a){_0x1cdcb0[_0xe073('0x1d')]=_0x93852a;if(_0x4f60dd[_0xe073('0x30')]['includeAll']){_0x5c04fe[_0xe073('0x40')]=[{'all':!![]}];}return db['Tag'][_0xe073('0x41')](_0x5c04fe);})[_0xe073('0x25')](function(_0x125d1f){_0x1cdcb0[_0xe073('0x42')]=_0x125d1f;return _0x1cdcb0;})[_0xe073('0x25')](respondWithFilteredResult(_0x2a206a,_0x5c04fe))[_0xe073('0x43')](handleError(_0x2a206a,null));};exports[_0xe073('0x44')]=function(_0x2f4939,_0x1b50c5){var _0x2d3ffe={'raw':!![],'where':{'id':_0x2f4939['params']['id']}},_0x2c312b={};_0x2c312b['model']=_[_0xe073('0x2f')](db[_0xe073('0x2b')][_0xe073('0x45')]);_0x2c312b[_0xe073('0x30')]=_[_0xe073('0x2f')](_0x2f4939['query']);_0x2c312b[_0xe073('0x31')]=_[_0xe073('0x33')](_0x2c312b[_0xe073('0x32')],_0x2c312b[_0xe073('0x30')]);_0x2d3ffe[_0xe073('0x35')]=_['intersection'](_0x2c312b[_0xe073('0x32')],qs['fields'](_0x2f4939['query'][_0xe073('0x34')]));_0x2d3ffe[_0xe073('0x35')]=_0x2d3ffe['attributes']['length']?_0x2d3ffe[_0xe073('0x35')]:_0x2c312b[_0xe073('0x32')];if(_0x2f4939[_0xe073('0x30')][_0xe073('0x46')]){_0x2d3ffe[_0xe073('0x40')]=[{'all':!![]}];}_0x2d3ffe=_[_0xe073('0x3d')]({},_0x2d3ffe,_0x2f4939[_0xe073('0x3f')]);return db['Tag'][_0xe073('0x47')](_0x2d3ffe)['then'](handleEntityNotFound(_0x1b50c5,null))[_0xe073('0x25')](respondWithResult(_0x1b50c5,null))[_0xe073('0x43')](handleError(_0x1b50c5,null));};exports[_0xe073('0x48')]=function(_0x4e1f1d,_0x4d5bcd){return db[_0xe073('0x2b')][_0xe073('0x48')](_0x4e1f1d[_0xe073('0x49')],{})['then'](function(_0x151035){var _0x338557=_0x4e1f1d[_0xe073('0x4a')][_0xe073('0x4b')]({'plain':!![]});if(!_0x338557)throw new Error(_0xe073('0x4c'));if(_0x338557[_0xe073('0x4d')]===_0xe073('0x4a')){var _0x307541=_0x151035[_0xe073('0x4b')]({'plain':!![]});var _0x5626d4=_0xe073('0x4e');return db['UserProfileSection'][_0xe073('0x47')]({'where':{'name':_0x5626d4,'userProfileId':_0x338557['userProfileId']},'raw':!![]})[_0xe073('0x25')](function(_0x202687){if(_0x202687&&_0x202687[_0xe073('0x4f')]===0x0){return db[_0xe073('0x50')]['create']({'name':_0x307541[_0xe073('0x28')],'resourceId':_0x307541['id'],'type':_0x202687[_0xe073('0x28')],'sectionId':_0x202687['id']},{})[_0xe073('0x25')](function(){return _0x151035;});}else{return _0x151035;}})['catch'](function(_0x5503c2){logger[_0xe073('0x51')](_0xe073('0x52'),_0x5503c2);throw _0x5503c2;});}return _0x151035;})[_0xe073('0x25')](respondWithResult(_0x4d5bcd,0xc9))[_0xe073('0x43')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x24')]=function(_0x5212d5,_0x197c42){if(_0x5212d5[_0xe073('0x49')]['id']){delete _0x5212d5[_0xe073('0x49')]['id'];}return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x5212d5[_0xe073('0x53')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x197c42,null))[_0xe073('0x25')](saveUpdates(_0x5212d5[_0xe073('0x49')],null))[_0xe073('0x25')](respondWithResult(_0x197c42,null))['catch'](handleError(_0x197c42,null));};exports[_0xe073('0x26')]=function(_0x582007,_0x5825eb){return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x582007[_0xe073('0x53')]['id']}})['then'](handleEntityNotFound(_0x5825eb,null))[_0xe073('0x25')](removeEntity(_0x5825eb,null))[_0xe073('0x43')](handleError(_0x5825eb,null));}; \ No newline at end of file +var _0x8ce3=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','UserProfileResource','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x545a3a,_0x3123aa){var _0x5a5493=function(_0x4e6bce){while(--_0x4e6bce){_0x545a3a['push'](_0x545a3a['shift']());}};_0x5a5493(++_0x3123aa);}(_0x8ce3,0xc3));var _0x38ce=function(_0x3cc563,_0x1598d3){_0x3cc563=_0x3cc563-0x0;var _0x11c044=_0x8ce3[_0x3cc563];return _0x11c044;};'use strict';var emlformat=require(_0x38ce('0x0'));var rimraf=require(_0x38ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ce('0x2'));var rp=require(_0x38ce('0x3'));var moment=require(_0x38ce('0x4'));var BPromise=require(_0x38ce('0x5'));var Mustache=require(_0x38ce('0x6'));var util=require(_0x38ce('0x7'));var path=require(_0x38ce('0x8'));var sox=require(_0x38ce('0x9'));var csv=require('to-csv');var ejs=require(_0x38ce('0xa'));var fs=require('fs');var fs_extra=require(_0x38ce('0xb'));var _=require('lodash');var squel=require(_0x38ce('0xc'));var crypto=require(_0x38ce('0xd'));var jsforce=require(_0x38ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x38ce('0xf'));var querystring=require('querystring');var Papa=require(_0x38ce('0x10'));var Redis=require('ioredis');var authService=require(_0x38ce('0x11'));var qs=require(_0x38ce('0x12'));var as=require(_0x38ce('0x13'));var hardwareService=require(_0x38ce('0x14'));var logger=require(_0x38ce('0x15'))(_0x38ce('0x16'));var utils=require(_0x38ce('0x17'));var config=require(_0x38ce('0x18'));var licenseUtil=require(_0x38ce('0x19'));var db=require(_0x38ce('0x1a'))['db'];function respondWithStatusCode(_0x42e234,_0x3ef662){_0x3ef662=_0x3ef662||0xcc;return function(_0x28b554){if(_0x28b554){return _0x42e234[_0x38ce('0x1b')](_0x3ef662);}return _0x42e234[_0x38ce('0x1c')](_0x3ef662)[_0x38ce('0x1d')]();};}function respondWithResult(_0x56a09f,_0x48ba7c){_0x48ba7c=_0x48ba7c||0xc8;return function(_0x3c4d7f){if(_0x3c4d7f){return _0x56a09f[_0x38ce('0x1c')](_0x48ba7c)[_0x38ce('0x1e')](_0x3c4d7f);}};}function respondWithFilteredResult(_0x55be6a,_0x2f3b99){return function(_0x54fcd3){if(_0x54fcd3){var _0x2771ec=typeof _0x2f3b99[_0x38ce('0x1f')]==='undefined'&&typeof _0x2f3b99[_0x38ce('0x20')]===_0x38ce('0x21');var _0x1dfaba=_0x54fcd3['count'];var _0xe4099a=_0x2771ec?0x0:_0x2f3b99[_0x38ce('0x1f')];var _0x3df527=_0x2771ec?_0x54fcd3[_0x38ce('0x22')]:_0x2f3b99[_0x38ce('0x1f')]+_0x2f3b99[_0x38ce('0x20')];var _0x2d4218;if(_0x3df527>=_0x1dfaba){_0x3df527=_0x1dfaba;_0x2d4218=0xc8;}else{_0x2d4218=0xce;}_0x55be6a['status'](_0x2d4218);return _0x55be6a[_0x38ce('0x23')](_0x38ce('0x24'),_0xe4099a+'-'+_0x3df527+'/'+_0x1dfaba)[_0x38ce('0x1e')](_0x54fcd3);}return null;};}function patchUpdates(_0x303391){return function(_0x30b060){try{jsonpatch[_0x38ce('0x25')](_0x30b060,_0x303391,!![]);}catch(_0x323490){return BPromise[_0x38ce('0x26')](_0x323490);}return _0x30b060[_0x38ce('0x27')]();};}function saveUpdates(_0x3cf50b,_0x1aace7){return function(_0x580cf3){if(_0x580cf3){return _0x580cf3[_0x38ce('0x28')](_0x3cf50b)[_0x38ce('0x29')](function(_0xe40e9c){return _0xe40e9c;});}return null;};}function removeEntity(_0xcf5d9e,_0x4a56b0){return function(_0x2c85e6){if(_0x2c85e6){return _0x2c85e6[_0x38ce('0x2a')]()['then'](function(){var _0xe0af00=_0x2c85e6[_0x38ce('0x2b')]({'plain':!![]});var _0x43b479='Tags';return db['UserProfileResource'][_0x38ce('0x2a')]({'where':{'type':_0x43b479,'resourceId':_0xe0af00['id']}})[_0x38ce('0x29')](function(){return _0x2c85e6;});})[_0x38ce('0x29')](function(){_0xcf5d9e[_0x38ce('0x1c')](0xcc)[_0x38ce('0x1d')]();});}};}function handleEntityNotFound(_0x2a59fe,_0x13e2fc){return function(_0xce1f64){if(!_0xce1f64){_0x2a59fe[_0x38ce('0x1b')](0x194);}return _0xce1f64;};}function handleError(_0x4649be,_0xfc590a){_0xfc590a=_0xfc590a||0x1f4;return function(_0x381703){logger['error'](_0x381703[_0x38ce('0x2c')]);if(_0x381703[_0x38ce('0x2d')]){delete _0x381703['name'];}_0x4649be[_0x38ce('0x1c')](_0xfc590a)[_0x38ce('0x2e')](_0x381703);};}exports['index']=function(_0xd96d33,_0x282ee4){var _0x568d94={},_0x28d775={},_0x53f2c9={'count':0x0,'rows':[]};var _0x1aa8fb=_[_0x38ce('0x2f')](db[_0x38ce('0x30')][_0x38ce('0x31')],function(_0x444b93){return{'name':_0x444b93[_0x38ce('0x32')],'type':_0x444b93[_0x38ce('0x33')][_0x38ce('0x34')]};});_0x28d775['model']=_['map'](_0x1aa8fb,_0x38ce('0x2d'));_0x28d775[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xd96d33[_0x38ce('0x35')]);_0x28d775[_0x38ce('0x37')]=_['intersection'](_0x28d775[_0x38ce('0x38')],_0x28d775[_0x38ce('0x35')]);_0x568d94[_0x38ce('0x39')]=_[_0x38ce('0x3a')](_0x28d775[_0x38ce('0x38')],qs[_0x38ce('0x3b')](_0xd96d33[_0x38ce('0x35')]['fields']));_0x568d94[_0x38ce('0x39')]=_0x568d94[_0x38ce('0x39')]['length']?_0x568d94[_0x38ce('0x39')]:_0x28d775[_0x38ce('0x38')];if(!_0xd96d33[_0x38ce('0x35')][_0x38ce('0x3c')](_0x38ce('0x3d'))){_0x568d94[_0x38ce('0x20')]=qs[_0x38ce('0x20')](_0xd96d33[_0x38ce('0x35')]['limit']);_0x568d94[_0x38ce('0x1f')]=qs[_0x38ce('0x1f')](_0xd96d33[_0x38ce('0x35')][_0x38ce('0x1f')]);}_0x568d94['order']=qs[_0x38ce('0x3e')](_0xd96d33['query'][_0x38ce('0x3e')]);_0x568d94[_0x38ce('0x3f')]=qs[_0x38ce('0x37')](_[_0x38ce('0x40')](_0xd96d33[_0x38ce('0x35')],_0x28d775[_0x38ce('0x37')]),_0x1aa8fb);if(_0xd96d33['query'][_0x38ce('0x41')]){_0x568d94['where']=_[_0x38ce('0x42')](_0x568d94[_0x38ce('0x3f')],{'$or':_[_0x38ce('0x2f')](_0x1aa8fb,function(_0x37b738){if(_0x37b738[_0x38ce('0x33')]!==_0x38ce('0x43')){var _0x5209ee={};_0x5209ee[_0x37b738[_0x38ce('0x2d')]]={'$like':'%'+_0xd96d33[_0x38ce('0x35')][_0x38ce('0x41')]+'%'};return _0x5209ee;}})});}_0x568d94=_[_0x38ce('0x42')]({},_0x568d94,_0xd96d33[_0x38ce('0x44')]);var _0x467d3e={'where':_0x568d94['where']};return db['Tag'][_0x38ce('0x22')](_0x467d3e)[_0x38ce('0x29')](function(_0x174c86){_0x53f2c9[_0x38ce('0x22')]=_0x174c86;if(_0xd96d33[_0x38ce('0x35')][_0x38ce('0x45')]){_0x568d94[_0x38ce('0x46')]=[{'all':!![]}];}return db['Tag'][_0x38ce('0x47')](_0x568d94);})[_0x38ce('0x29')](function(_0x5a689b){_0x53f2c9[_0x38ce('0x48')]=_0x5a689b;return _0x53f2c9;})[_0x38ce('0x29')](respondWithFilteredResult(_0x282ee4,_0x568d94))[_0x38ce('0x49')](handleError(_0x282ee4,null));};exports['show']=function(_0xaf99ce,_0xd95bc8){var _0x33f6a6={'raw':!![],'where':{'id':_0xaf99ce[_0x38ce('0x4a')]['id']}},_0x981068={};_0x981068[_0x38ce('0x38')]=_['keys'](db[_0x38ce('0x30')][_0x38ce('0x31')]);_0x981068[_0x38ce('0x35')]=_[_0x38ce('0x36')](_0xaf99ce[_0x38ce('0x35')]);_0x981068[_0x38ce('0x37')]=_['intersection'](_0x981068[_0x38ce('0x38')],_0x981068[_0x38ce('0x35')]);_0x33f6a6['attributes']=_['intersection'](_0x981068['model'],qs[_0x38ce('0x3b')](_0xaf99ce[_0x38ce('0x35')]['fields']));_0x33f6a6['attributes']=_0x33f6a6[_0x38ce('0x39')]['length']?_0x33f6a6[_0x38ce('0x39')]:_0x981068['model'];if(_0xaf99ce[_0x38ce('0x35')][_0x38ce('0x45')]){_0x33f6a6['include']=[{'all':!![]}];}_0x33f6a6=_[_0x38ce('0x42')]({},_0x33f6a6,_0xaf99ce[_0x38ce('0x44')]);return db['Tag'][_0x38ce('0x4b')](_0x33f6a6)[_0x38ce('0x29')](handleEntityNotFound(_0xd95bc8,null))[_0x38ce('0x29')](respondWithResult(_0xd95bc8,null))[_0x38ce('0x49')](handleError(_0xd95bc8,null));};exports[_0x38ce('0x4c')]=function(_0x25a299,_0x58cc6f){return db[_0x38ce('0x30')][_0x38ce('0x4c')](_0x25a299['body'],{})[_0x38ce('0x29')](function(_0x316eec){var _0x429517=_0x25a299[_0x38ce('0x4d')][_0x38ce('0x2b')]({'plain':!![]});if(!_0x429517)throw new Error(_0x38ce('0x4e'));if(_0x429517[_0x38ce('0x4f')]==='user'){var _0x3e1522=_0x316eec[_0x38ce('0x2b')]({'plain':!![]});var _0x3f88df=_0x38ce('0x50');return db[_0x38ce('0x51')][_0x38ce('0x4b')]({'where':{'name':_0x3f88df,'userProfileId':_0x429517['userProfileId']},'raw':!![]})['then'](function(_0xc2c9d3){if(_0xc2c9d3&&_0xc2c9d3[_0x38ce('0x52')]===0x0){return db[_0x38ce('0x53')][_0x38ce('0x4c')]({'name':_0x3e1522[_0x38ce('0x2d')],'resourceId':_0x3e1522['id'],'type':_0xc2c9d3[_0x38ce('0x2d')],'sectionId':_0xc2c9d3['id']},{})['then'](function(){return _0x316eec;});}else{return _0x316eec;}})['catch'](function(_0x199c5b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x199c5b);throw _0x199c5b;});}return _0x316eec;})[_0x38ce('0x29')](respondWithResult(_0x58cc6f,0xc9))[_0x38ce('0x49')](handleError(_0x58cc6f,null));};exports[_0x38ce('0x28')]=function(_0xbe5626,_0xd031c0){if(_0xbe5626['body']['id']){delete _0xbe5626[_0x38ce('0x54')]['id'];}return db[_0x38ce('0x30')][_0x38ce('0x4b')]({'where':{'id':_0xbe5626[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0xd031c0,null))[_0x38ce('0x29')](saveUpdates(_0xbe5626[_0x38ce('0x54')],null))[_0x38ce('0x29')](respondWithResult(_0xd031c0,null))[_0x38ce('0x49')](handleError(_0xd031c0,null));};exports[_0x38ce('0x2a')]=function(_0x2db125,_0x56d63e){return db['Tag'][_0x38ce('0x4b')]({'where':{'id':_0x2db125[_0x38ce('0x4a')]['id']}})[_0x38ce('0x29')](handleEntityNotFound(_0x56d63e,null))[_0x38ce('0x29')](removeEntity(_0x56d63e,null))['catch'](handleError(_0x56d63e,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3c69c7e..d60f587 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 _0x426b=['./tag.attributes','define','Tag','tools_tags','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x261350,_0x40af7c){var _0x4a88d8=function(_0x90a038){while(--_0x90a038){_0x261350['push'](_0x261350['shift']());}};_0x4a88d8(++_0x40af7c);}(_0x426b,0x1d8));var _0xb426=function(_0x3fa9cc,_0x2172bc){_0x3fa9cc=_0x3fa9cc-0x0;var _0x3ade14=_0x426b[_0x3fa9cc];return _0x3ade14;};'use strict';var _=require(_0xb426('0x0'));var util=require(_0xb426('0x1'));var logger=require('../../config/logger')(_0xb426('0x2'));var moment=require(_0xb426('0x3'));var BPromise=require(_0xb426('0x4'));var rp=require(_0xb426('0x5'));var fs=require('fs');var path=require(_0xb426('0x6'));var rimraf=require('rimraf');var config=require(_0xb426('0x7'));var attributes=require(_0xb426('0x8'));module['exports']=function(_0x325bfd,_0x107e8b){return _0x325bfd[_0xb426('0x9')](_0xb426('0xa'),attributes,{'tableName':_0xb426('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2484=['define','Tag','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2484,0x1af));var _0x4248=function(_0x5815af,_0x361f0b){_0x5815af=_0x5815af-0x0;var _0x3f14cb=_0x2484[_0x5815af];return _0x3f14cb;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var logger=require(_0x4248('0x2'))(_0x4248('0x3'));var moment=require(_0x4248('0x4'));var BPromise=require(_0x4248('0x5'));var rp=require(_0x4248('0x6'));var fs=require('fs');var path=require(_0x4248('0x7'));var rimraf=require(_0x4248('0x8'));var config=require(_0x4248('0x9'));var attributes=require(_0x4248('0xa'));module['exports']=function(_0x31cb3d,_0x46c9ff){return _0x31cb3d[_0x4248('0xb')](_0x4248('0xc'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 18966d0..9f6c20d 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 _0x5178=['request','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5178,0x171));var _0x8517=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5178[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('Tag,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('Tag,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('Tag,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});} \ No newline at end of file +var _0x5636=['code','Tag,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5636,0x102));var _0x6563=function(_0x53d18e,_0xf080c7){_0x53d18e=_0x53d18e-0x0;var _0xb4cb39=_0x5636[_0x53d18e];return _0xb4cb39;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 4cf9859..0cff6fe 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(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var 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 6c9cbfa..623ec2f 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 _0xb7e7=['STRING','sequelize'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0xe2260f,_0x130693){var _0x432870=function(_0x47c503){while(--_0x47c503){_0xe2260f['push'](_0xe2260f['shift']());}};_0x432870(++_0x130693);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d6785,_0x492ea3){_0x3d6785=_0x3d6785-0x0;var _0x39a624=_0xb10b[_0x3d6785];return _0x39a624;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f0d873d..88706ba 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 _0x8862=['VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','addQueues','findOne','Queues','ids','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','upsert','isNil','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Fax','Whatsapp','UserVoiceQueueRt','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','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','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','Team','then','include','findAll','catch','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','params','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x8862,0x17a));var _0x2886=function(_0x543f48,_0x560f67){_0x543f48=_0x543f48-0x0;var _0x41f9f0=_0x8862[_0x543f48];return _0x41f9f0;};'use strict';var emlformat=require(_0x2886('0x0'));var rimraf=require(_0x2886('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2886('0x2'));var rp=require(_0x2886('0x3'));var moment=require(_0x2886('0x4'));var BPromise=require(_0x2886('0x5'));var Mustache=require(_0x2886('0x6'));var util=require(_0x2886('0x7'));var path=require('path');var sox=require(_0x2886('0x8'));var csv=require(_0x2886('0x9'));var ejs=require(_0x2886('0xa'));var fs=require('fs');var fs_extra=require(_0x2886('0xb'));var _=require(_0x2886('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2886('0xd'));var deskjs=require(_0x2886('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2886('0xf'));var Redis=require(_0x2886('0x10'));var authService=require(_0x2886('0x11'));var qs=require(_0x2886('0x12'));var as=require(_0x2886('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2886('0x14'))(_0x2886('0x15'));var utils=require(_0x2886('0x16'));var config=require(_0x2886('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2886('0x18'))['db'];config[_0x2886('0x19')]=_[_0x2886('0x1a')](config[_0x2886('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2886('0x19')]));require(_0x2886('0x1b'))[_0x2886('0x1c')](socket);function respondWithStatusCode(_0x42ff53,_0x58feed){_0x58feed=_0x58feed||0xcc;return function(_0x121e3a){if(_0x121e3a){return _0x42ff53[_0x2886('0x1d')](_0x58feed);}return _0x42ff53[_0x2886('0x1e')](_0x58feed)[_0x2886('0x1f')]();};}function respondWithResult(_0x34360a,_0x542cdf){_0x542cdf=_0x542cdf||0xc8;return function(_0x50b39b){if(_0x50b39b){return _0x34360a['status'](_0x542cdf)['json'](_0x50b39b);}};}function respondWithFilteredResult(_0x27e5de,_0xb06e56){return function(_0x243223){if(_0x243223){var _0x3dddc7=typeof _0xb06e56[_0x2886('0x20')]==='undefined'&&typeof _0xb06e56[_0x2886('0x21')]===_0x2886('0x22');var _0xf434c8=_0x243223['count'];var _0x5e4f45=_0x3dddc7?0x0:_0xb06e56[_0x2886('0x20')];var _0xf298c5=_0x3dddc7?_0x243223[_0x2886('0x23')]:_0xb06e56['offset']+_0xb06e56[_0x2886('0x21')];var _0x458323;if(_0xf298c5>=_0xf434c8){_0xf298c5=_0xf434c8;_0x458323=0xc8;}else{_0x458323=0xce;}_0x27e5de[_0x2886('0x1e')](_0x458323);return _0x27e5de[_0x2886('0x24')]('Content-Range',_0x5e4f45+'-'+_0xf298c5+'/'+_0xf434c8)[_0x2886('0x25')](_0x243223);}return null;};}function patchUpdates(_0x43a46a){return function(_0x4b25c0){try{jsonpatch[_0x2886('0x26')](_0x4b25c0,_0x43a46a,!![]);}catch(_0x469565){return BPromise[_0x2886('0x27')](_0x469565);}return _0x4b25c0[_0x2886('0x28')]();};}function saveUpdates(_0x5e2f11,_0x34e066){return function(_0x1d0340){if(_0x1d0340){return _0x1d0340[_0x2886('0x29')](_0x5e2f11)['then'](function(_0x276f9e){return _0x276f9e;});}return null;};}function handleEntityNotFound(_0x2c406a,_0x5db61c){return function(_0x42990e){if(!_0x42990e){_0x2c406a[_0x2886('0x1d')](0x194);}return _0x42990e;};}function handleError(_0x9d8e2f,_0xd6aa46){_0xd6aa46=_0xd6aa46||0x1f4;return function(_0x2a2556){logger[_0x2886('0x2a')](_0x2a2556[_0x2886('0x2b')]);if(_0x2a2556[_0x2886('0x2c')]){delete _0x2a2556[_0x2886('0x2c')];}_0x9d8e2f[_0x2886('0x1e')](_0xd6aa46)[_0x2886('0x2d')](_0x2a2556);};}exports[_0x2886('0x2e')]=function(_0x1689c2,_0x599e7f){var _0x5081b2={},_0x36aee4={},_0x2c29c4={'count':0x0,'rows':[]};var _0x329b28=_[_0x2886('0x2f')](db['Team'][_0x2886('0x30')],function(_0x21d6df){return{'name':_0x21d6df[_0x2886('0x31')],'type':_0x21d6df[_0x2886('0x32')][_0x2886('0x33')]};});_0x36aee4[_0x2886('0x34')]=_['map'](_0x329b28,_0x2886('0x2c'));_0x36aee4[_0x2886('0x35')]=_[_0x2886('0x36')](_0x1689c2[_0x2886('0x35')]);_0x36aee4['filters']=_[_0x2886('0x37')](_0x36aee4[_0x2886('0x34')],_0x36aee4[_0x2886('0x35')]);_0x5081b2[_0x2886('0x38')]=_['intersection'](_0x36aee4[_0x2886('0x34')],qs[_0x2886('0x39')](_0x1689c2[_0x2886('0x35')][_0x2886('0x39')]));_0x5081b2[_0x2886('0x38')]=_0x5081b2[_0x2886('0x38')][_0x2886('0x3a')]?_0x5081b2['attributes']:_0x36aee4['model'];if(!_0x1689c2[_0x2886('0x35')][_0x2886('0x3b')](_0x2886('0x3c'))){_0x5081b2[_0x2886('0x21')]=qs['limit'](_0x1689c2[_0x2886('0x35')][_0x2886('0x21')]);_0x5081b2['offset']=qs[_0x2886('0x20')](_0x1689c2['query'][_0x2886('0x20')]);}_0x5081b2['order']=qs[_0x2886('0x3d')](_0x1689c2[_0x2886('0x35')][_0x2886('0x3d')]);_0x5081b2[_0x2886('0x3e')]=qs[_0x2886('0x3f')](_[_0x2886('0x40')](_0x1689c2['query'],_0x36aee4['filters']),_0x329b28);if(_0x1689c2[_0x2886('0x35')][_0x2886('0x41')]){_0x5081b2[_0x2886('0x3e')]=_[_0x2886('0x42')](_0x5081b2[_0x2886('0x3e')],{'$or':_['map'](_0x329b28,function(_0x65aed7){if(_0x65aed7['type']!==_0x2886('0x43')){var _0x4f9e96={};_0x4f9e96[_0x65aed7[_0x2886('0x2c')]]={'$like':'%'+_0x1689c2[_0x2886('0x35')]['filter']+'%'};return _0x4f9e96;}})});}_0x5081b2=_[_0x2886('0x42')]({},_0x5081b2,_0x1689c2['options']);var _0x3f9eab={'where':_0x5081b2[_0x2886('0x3e')]};return db[_0x2886('0x44')][_0x2886('0x23')](_0x3f9eab)[_0x2886('0x45')](function(_0x5ede4c){_0x2c29c4[_0x2886('0x23')]=_0x5ede4c;if(_0x1689c2['query']['includeAll']){_0x5081b2[_0x2886('0x46')]=[{'all':!![]}];}return db[_0x2886('0x44')][_0x2886('0x47')](_0x5081b2);})[_0x2886('0x45')](function(_0x3b75d2){_0x2c29c4['rows']=_0x3b75d2;return _0x2c29c4;})['then'](respondWithFilteredResult(_0x599e7f,_0x5081b2))[_0x2886('0x48')](handleError(_0x599e7f,null));};exports['show']=function(_0x575da0,_0x6e9328){var _0x3d78d8={'raw':![],'where':{'id':_0x575da0['params']['id']}},_0x26bb51={};_0x26bb51['model']=_[_0x2886('0x36')](db[_0x2886('0x44')][_0x2886('0x30')]);_0x26bb51['query']=_[_0x2886('0x36')](_0x575da0['query']);_0x26bb51[_0x2886('0x3f')]=_[_0x2886('0x37')](_0x26bb51['model'],_0x26bb51['query']);_0x3d78d8[_0x2886('0x38')]=_[_0x2886('0x37')](_0x26bb51['model'],qs[_0x2886('0x39')](_0x575da0['query'][_0x2886('0x39')]));_0x3d78d8['attributes']=_0x3d78d8[_0x2886('0x38')][_0x2886('0x3a')]?_0x3d78d8['attributes']:_0x26bb51[_0x2886('0x34')];if(_0x575da0[_0x2886('0x35')][_0x2886('0x49')]){_0x3d78d8['include']=[{'all':!![]}];}_0x3d78d8=_['merge']({},_0x3d78d8,_0x575da0[_0x2886('0x4a')]);return db[_0x2886('0x44')][_0x2886('0x4b')](_0x3d78d8)[_0x2886('0x45')](handleEntityNotFound(_0x6e9328,null))[_0x2886('0x45')](respondWithResult(_0x6e9328,null))[_0x2886('0x48')](handleError(_0x6e9328,null));};exports[_0x2886('0x4c')]=function(_0xf25d26,_0x3f0b76){return db[_0x2886('0x44')][_0x2886('0x4c')](_0xf25d26['body'],{})[_0x2886('0x45')](function(_0x15c373){var _0x57a887=_0xf25d26[_0x2886('0x4d')]['get']({'plain':!![]});if(!_0x57a887)throw new Error(_0x2886('0x4e'));if(_0x57a887[_0x2886('0x4f')]==='user'){var _0x5b0787=_0x15c373[_0x2886('0x50')]({'plain':!![]});var _0x1a1766=_0x2886('0x51');return db[_0x2886('0x52')][_0x2886('0x4b')]({'where':{'name':_0x1a1766,'userProfileId':_0x57a887['userProfileId']},'raw':!![]})[_0x2886('0x45')](function(_0x32678e){if(_0x32678e&&_0x32678e[_0x2886('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b0787['name'],'resourceId':_0x5b0787['id'],'type':_0x32678e[_0x2886('0x2c')],'sectionId':_0x32678e['id']},{})[_0x2886('0x45')](function(){return _0x15c373;});}else{return _0x15c373;}})[_0x2886('0x48')](function(_0x545618){logger[_0x2886('0x2a')](_0x2886('0x54'),_0x545618);throw _0x545618;});}return _0x15c373;})[_0x2886('0x45')](respondWithResult(_0x3f0b76,0xc9))[_0x2886('0x48')](handleError(_0x3f0b76,null));};exports['update']=function(_0x1d89fb,_0x1ec5c4){if(_0x1d89fb['body']['id']){delete _0x1d89fb[_0x2886('0x55')]['id'];}return db[_0x2886('0x44')][_0x2886('0x4b')]({'where':{'id':_0x1d89fb['params']['id']}})[_0x2886('0x45')](handleEntityNotFound(_0x1ec5c4,null))[_0x2886('0x45')](saveUpdates(_0x1d89fb['body'],null))[_0x2886('0x45')](respondWithResult(_0x1ec5c4,null))[_0x2886('0x48')](handleError(_0x1ec5c4,null));};exports[_0x2886('0x56')]=function(_0x13daf6,_0x13b2d1){var _0x360728=_0x13daf6[_0x2886('0x57')]['id'];var _0x1fa4dc=[];return db[_0x2886('0x58')][_0x2886('0x59')](function(_0x33f81f){var _0x370e91=_0x2886('0x5a')+_0x360728;return db['sequelize'][_0x2886('0x35')](_0x370e91,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f})[_0x2886('0x45')](function(_0x25133a){_0x1fa4dc=_['map'](_0x25133a,function(_0x4d36a5){return Number(_0x4d36a5[_0x2886('0x5e')]);});})[_0x2886('0x45')](function(){var _0x1c38d3=_0x2886('0x5f')+_0x360728;return db[_0x2886('0x58')]['query'](_0x1c38d3,{'type':db[_0x2886('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x49d3a1){var _0x55856a=_[_0x2886('0x2f')](_0x49d3a1,function(_0x366822){return Number(_0x366822[_0x2886('0x60')]);});return db[_0x2886('0x61')][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'VoiceQueueId':{'$in':_0x55856a}},'transaction':_0x33f81f});})[_0x2886('0x45')](function(){var _0x5d40c8=_0x2886('0x62')+_0x360728;return db[_0x2886('0x58')]['query'](_0x5d40c8,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x1eae71){var _0x12a991=_[_0x2886('0x2f')](_0x1eae71,function(_0x28a7e4){return Number(_0x28a7e4[_0x2886('0x63')]);});return db[_0x2886('0x64')]['destroy']({'where':{'UserId':{'$in':_0x1fa4dc},'MailQueueId':{'$in':_0x12a991}},'transaction':_0x33f81f});})['then'](function(){var _0x36e77f=_0x2886('0x65')+_0x360728;return db['sequelize'][_0x2886('0x35')](_0x36e77f,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')]['SELECT'],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0xff45f4){var _0x55dbb4=_['map'](_0xff45f4,function(_0x58e884){return Number(_0x58e884[_0x2886('0x66')]);});return db['UserSmsQueue'][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'SmsQueueId':{'$in':_0x55dbb4}},'transaction':_0x33f81f});})['then'](function(){var _0x1076e0=_0x2886('0x67')+_0x360728;return db[_0x2886('0x58')][_0x2886('0x35')](_0x1076e0,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x3af34e){var _0x2ad62b=_[_0x2886('0x2f')](_0x3af34e,function(_0x23f03d){return Number(_0x23f03d[_0x2886('0x68')]);});return db[_0x2886('0x69')][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'ChatQueueId':{'$in':_0x2ad62b}},'transaction':_0x33f81f});})['then'](function(){var _0x2bfe39=_0x2886('0x6a')+_0x360728;return db['sequelize'][_0x2886('0x35')](_0x2bfe39,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x588fb4){var _0x5bf68f=_[_0x2886('0x2f')](_0x588fb4,function(_0x53c2e2){return Number(_0x53c2e2[_0x2886('0x6b')]);});return db[_0x2886('0x6c')][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'FaxQueueId':{'$in':_0x5bf68f}},'transaction':_0x33f81f});})[_0x2886('0x45')](function(){var _0x320735='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x360728;return db['sequelize']['query'](_0x320735,{'type':db['Sequelize']['QueryTypes'][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x5d68f7){var _0x69f4bc=_[_0x2886('0x2f')](_0x5d68f7,function(_0x1caf0c){return Number(_0x1caf0c[_0x2886('0x6d')]);});return db['UserOpenchannelQueue'][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'OpenchannelQueueId':{'$in':_0x69f4bc}},'transaction':_0x33f81f});})[_0x2886('0x45')](function(){var _0x23f384='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x360728;return db[_0x2886('0x58')][_0x2886('0x35')](_0x23f384,{'type':db[_0x2886('0x5b')][_0x2886('0x5c')][_0x2886('0x5d')],'raw':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x4b55ec){var _0x2e629e=_['map'](_0x4b55ec,function(_0x47eaa8){return Number(_0x47eaa8[_0x2886('0x6e')]);});return db[_0x2886('0x6f')]['destroy']({'where':{'UserId':{'$in':_0x1fa4dc},'WhatsappQueueId':{'$in':_0x2e629e}},'transaction':_0x33f81f});})[_0x2886('0x45')](function(){return db[_0x2886('0x70')][_0x2886('0x4b')]({'where':{'TeamId':_0x360728}});})[_0x2886('0x45')](function(_0x1c7348){if(_0x1c7348===null){return;}return db[_0x2886('0x71')][_0x2886('0x56')]({'where':{'UserId':{'$in':_0x1fa4dc},'VoicePrefixId':_0x1c7348['VoicePrefixId']},'transaction':_0x33f81f});})[_0x2886('0x45')](function(){return db[_0x2886('0x44')][_0x2886('0x56')]({'where':{'id':_0x360728},'cascade':!![],'transaction':_0x33f81f});})[_0x2886('0x45')](function(_0x2c0877){if(_0x2c0877===0x0){_0x13b2d1[_0x2886('0x1d')](0x194);}else{return db['UserProfileResource'][_0x2886('0x56')]({'where':{'type':_0x2886('0x51'),'resourceId':_0x360728},'cascade':!![],'transaction':_0x33f81f})[_0x2886('0x45')](function(){_0x13b2d1[_0x2886('0x1e')](0xcc)[_0x2886('0x1f')]();});}})['catch'](function(_0x15c07c){_0x13b2d1[_0x2886('0x1e')](0x1f4)[_0x2886('0x2d')](_0x15c07c);});});};exports[_0x2886('0x72')]=function(_0x56ee53,_0x244168,_0x23300e){return db['Team']['findOne']({'where':{'id':_0x56ee53['params']['id']}})[_0x2886('0x45')](handleEntityNotFound(_0x244168,null))[_0x2886('0x45')](function(_0xd3c200){if(!_0x56ee53[_0x2886('0x35')][_0x2886('0x73')]||!utils[_0x2886('0x74')](_0x56ee53[_0x2886('0x35')]['channel'])){throw new db[(_0x2886('0x5b'))][(_0x2886('0x75'))](_0x2886('0x76'));}var _0x1a62ee={};var _0x3cf99e={};_0x3cf99e['model']=_['keys'](db[_[_0x2886('0x77')](_0x56ee53['query']['channel'][_0x2886('0x78')]())+_0x2886('0x79')][_0x2886('0x30')]);_0x3cf99e[_0x2886('0x35')]=_[_0x2886('0x36')](_0x56ee53[_0x2886('0x35')]);_0x3cf99e[_0x2886('0x3f')]=_['intersection'](_0x3cf99e[_0x2886('0x34')],_0x3cf99e['query']);_0x1a62ee['attributes']=_[_0x2886('0x37')](_0x3cf99e[_0x2886('0x34')],qs[_0x2886('0x39')](_0x56ee53['query']['fields']));_0x1a62ee['attributes']=_0x1a62ee[_0x2886('0x38')][_0x2886('0x3a')]?_0x1a62ee[_0x2886('0x38')]:_0x3cf99e[_0x2886('0x34')];_0x1a62ee['limit']=qs['limit'](_0x56ee53['query']['limit']);_0x1a62ee[_0x2886('0x20')]=qs['offset'](_0x56ee53['query']['offset']);_0x1a62ee[_0x2886('0x7a')]=qs[_0x2886('0x3d')](_0x56ee53['query'][_0x2886('0x3d')]);_0x1a62ee[_0x2886('0x3e')]=qs[_0x2886('0x3f')](_[_0x2886('0x40')](_0x56ee53[_0x2886('0x35')],_0x3cf99e['filters']));_0x1a62ee=_['merge']({},_0x1a62ee,_0x56ee53[_0x2886('0x4a')]);return _0xd3c200['get'+_[_0x2886('0x77')](_0x56ee53['query'][_0x2886('0x73')][_0x2886('0x78')]())+'Queues'](_0x1a62ee);})[_0x2886('0x45')](respondWithResult(_0x244168,null))[_0x2886('0x48')](handleError(_0x244168,null));};exports[_0x2886('0x7b')]=function(_0x215f69,_0x209eb1,_0x4b280b){return db['Team'][_0x2886('0x7c')]({'where':{'id':_0x215f69['params']['id']}})[_0x2886('0x45')](function(_0x551dd2){if(_0x551dd2){if(!_0x215f69['body'][_0x2886('0x73')]||!utils[_0x2886('0x74')](_0x215f69[_0x2886('0x55')][_0x2886('0x73')])){throw new db[(_0x2886('0x5b'))][(_0x2886('0x75'))](_0x2886('0x76'));}return _0x551dd2['add'+_[_0x2886('0x77')](_0x215f69[_0x2886('0x55')][_0x2886('0x73')][_0x2886('0x78')]())+_0x2886('0x7d')](_0x215f69[_0x2886('0x55')][_0x2886('0x7e')]);}return null;})[_0x2886('0x45')](handleEntityNotFound(_0x209eb1,null))[_0x2886('0x45')](respondWithStatusCode(_0x209eb1,null))[_0x2886('0x48')](handleError(_0x209eb1,null));};exports['removeQueues']=function(_0x531c02,_0x40141e,_0x248751){return db[_0x2886('0x44')]['findOne']({'where':{'id':_0x531c02['params']['id']}})[_0x2886('0x45')](function(_0x334610){if(_0x334610){if(!_0x531c02[_0x2886('0x35')][_0x2886('0x73')]||!utils['isValidChannel'](_0x531c02['query'][_0x2886('0x73')])){throw new db[(_0x2886('0x5b'))][(_0x2886('0x75'))](_0x2886('0x76'));}return _0x334610[_0x2886('0x7f')+_[_0x2886('0x77')](_0x531c02[_0x2886('0x35')][_0x2886('0x73')][_0x2886('0x78')]())+_0x2886('0x7d')](_0x531c02['query']['ids']);}return null;})[_0x2886('0x45')](handleEntityNotFound(_0x40141e,null))[_0x2886('0x45')](respondWithStatusCode(_0x40141e,null))['catch'](handleError(_0x40141e,null));};exports[_0x2886('0x80')]=function(_0x175551,_0x1b2604){var _0x3eba09=_[_0x2886('0x81')](_0x175551[_0x2886('0x55')][_0x2886('0x7e')])?_0x175551['body'][_0x2886('0x7e')]:[_0x175551[_0x2886('0x55')]['ids']];var _0x3d7152=_0x175551[_0x2886('0x57')]['id'];return db[_0x2886('0x44')][_0x2886('0x4b')]({'where':{'id':_0x3d7152}})['then'](handleEntityNotFound(_0x1b2604,null))['then'](function(_0x9a54ca){if(_0x9a54ca){var _0x16642e=[_0x2886('0x82'),_0x2886('0x83'),_0x2886('0x84'),_0x2886('0x85'),'Fax',_0x2886('0x86'),'Whatsapp'];return db[_0x2886('0x58')][_0x2886('0x59')](function(_0x2b5014){var _0x70e4a=_[_0x2886('0x2f')](_0x16642e,function(_0x1c02d4){var _0xca80a2={'attributes':['id',_0x2886('0x2c')]};if(_0x1c02d4==='Voice'){_0xca80a2[_0x2886('0x87')]={'attributes':[_0x2886('0x88')]};}return _0x9a54ca[_0x2886('0x50')+_0x1c02d4+'Queues'](_0xca80a2)[_0x2886('0x45')](function(_0x4a5b32){var _0x14d049=_['map'](_0x4a5b32,function(_0x4273c5){var _0x5559ed=_[_0x2886('0x2f')](_0x3eba09,function(_0x373c2b){var _0x235dad={'where':{'UserId':_0x373c2b,[_0x1c02d4+_0x2886('0x89')]:_0x4273c5['id']},'transaction':_0x2b5014};if(_0x1c02d4===_0x2886('0x82')){_0x235dad[_0x2886('0x1a')]={'penalty':_0x4273c5[_0x2886('0x8a')][_0x2886('0x88')]};}return db[_0x2886('0x8b')+_0x1c02d4+_0x2886('0x79')][_0x2886('0x8c')](_0x235dad)[_0x2886('0x45')](function(){socket[_0x2886('0x8d')]('user'+_0x1c02d4+_0x2886('0x8e'),{'UserId':_0x373c2b,[_0x1c02d4+_0x2886('0x89')]:_0x4273c5['id']});if(_0x1c02d4!==_0x2886('0x82')){return;}return db[_0x2886('0x8b')][_0x2886('0x47')]({'where':{'id':_0x3eba09,'online':0x1},'attributes':['id',_0x2886('0x2c'),_0x2886('0x8f'),_0x2886('0x90'),_0x2886('0x91')],'raw':!![]})[_0x2886('0x45')](function(_0x1b1b41){var _0x5a165a=_[_0x2886('0x2f')](_0x1b1b41,function(_0x144630){return db['UserVoiceQueueRt'][_0x2886('0x92')]({'membername':_0x144630[_0x2886('0x2c')],'UserId':_0x144630['id'],'queue_name':_0x4273c5[_0x2886('0x2c')],'VoiceQueueId':_0x4273c5['id'],'interface':_[_0x2886('0x93')](_0x144630[_0x2886('0x91')])?util[_0x2886('0x94')](_0x2886('0x95'),_0x144630[_0x2886('0x2c')]):_0x144630[_0x2886('0x91')],'paused':_0x144630['voicePause']||![],'penalty':_0x4273c5[_0x2886('0x8a')]['penalty']},{'transaction':_0x2b5014});});return Promise[_0x2886('0x96')](_0x5a165a);});});});return Promise[_0x2886('0x96')](_0x5559ed);});return Promise[_0x2886('0x96')](_0x14d049);})[_0x2886('0x45')](function(){return db[_0x2886('0x70')][_0x2886('0x7c')]({'where':{'teamId':_0x3d7152}})['then'](function(_0x5ad578){if(_0x5ad578){var _0x2b3f59=_['map'](_0x3eba09,function(_0x55b6c6){db[_0x2886('0x71')][_0x2886('0x92')]({'UserId':_0x55b6c6,'VoicePrefixId':_0x5ad578[_0x2886('0x97')]});});return Promise[_0x2886('0x96')](_0x2b3f59);}});});});return Promise['all'](_0x70e4a)[_0x2886('0x45')](function(){return _0x9a54ca[_0x2886('0x80')](_0x3eba09,{'transaction':_0x2b5014})[_0x2886('0x98')](function(_0x453545){return _0x453545;});});});}})[_0x2886('0x45')](respondWithResult(_0x1b2604,null))[_0x2886('0x48')](handleError(_0x1b2604,null));};exports[_0x2886('0x99')]=function(_0x51eeaf,_0x4d0299){var _0x595192=_[_0x2886('0x81')](_0x51eeaf[_0x2886('0x35')][_0x2886('0x7e')])?_0x51eeaf[_0x2886('0x35')]['ids']:[_0x51eeaf[_0x2886('0x35')][_0x2886('0x7e')]];var _0x3f3df0=_0x51eeaf['params']['id'];return db[_0x2886('0x44')][_0x2886('0x4b')]({'where':{'id':_0x3f3df0}})[_0x2886('0x45')](handleEntityNotFound(_0x4d0299,null))[_0x2886('0x45')](function(_0x26c920){if(_0x26c920){var _0x1ac1af=[_0x2886('0x82'),_0x2886('0x83'),_0x2886('0x84'),_0x2886('0x85'),_0x2886('0x9a'),'Openchannel',_0x2886('0x9b')];return db[_0x2886('0x58')][_0x2886('0x59')](function(_0x2125ea){var _0x4c7575=_[_0x2886('0x2f')](_0x1ac1af,function(_0x27ab6d){var _0x1d0fc6={'attributes':['id',_0x2886('0x2c')]};return _0x26c920['get'+_0x27ab6d+_0x2886('0x7d')](_0x1d0fc6)[_0x2886('0x45')](function(_0x3d973e){var _0x5f3623=_[_0x2886('0x2f')](_0x3d973e,function(_0x56ff7c){return _0x56ff7c[_0x2886('0x99')](_0x595192,{'transaction':_0x2125ea})[_0x2886('0x45')](function(){var _0x25524b=_[_0x2886('0x2f')](_0x595192,function(_0x365938){socket[_0x2886('0x8d')](_0x2886('0x4d')+_0x27ab6d+'Queue:remove',{'UserId':Number(_0x365938),[_0x27ab6d+_0x2886('0x89')]:_0x56ff7c['id']});if(_0x27ab6d!==_0x2886('0x82')){return;}return db[_0x2886('0x9c')][_0x2886('0x56')]({'where':{'VoiceQueueId':_0x56ff7c['id'],'UserId':_0x365938},'transaction':_0x2125ea});});return Promise[_0x2886('0x96')](_0x25524b);});});return Promise['all'](_0x5f3623);});});return Promise[_0x2886('0x96')](_0x4c7575)[_0x2886('0x45')](function(){return _0x26c920[_0x2886('0x99')](_0x595192,{'transaction':_0x2125ea});})[_0x2886('0x45')](function(){return db['TeamVoicePrefix'][_0x2886('0x7c')]({'where':{'teamId':_0x3f3df0}})[_0x2886('0x45')](function(_0x57b8ba){if(_0x57b8ba){var _0x2aa00e=_[_0x2886('0x2f')](_0x595192,function(_0x5d36f1){db[_0x2886('0x71')]['destroy']({'where':{'UserId':_0x5d36f1,'VoicePrefixId':_0x57b8ba[_0x2886('0x97')]}});});return Promise[_0x2886('0x96')](_0x2aa00e);}});});});}})[_0x2886('0x45')](respondWithStatusCode(_0x4d0299,null))['catch'](handleError(_0x4d0299,null));};exports[_0x2886('0x9d')]=function(_0x33d716,_0xd15994,_0x5575e0){var _0x2fd56e={};var _0x31c18a={};var _0x57a5da;var _0x52fe4c;return db[_0x2886('0x44')][_0x2886('0x7c')]({'where':{'id':_0x33d716[_0x2886('0x57')]['id']}})[_0x2886('0x45')](handleEntityNotFound(_0xd15994,null))[_0x2886('0x45')](function(_0x130315){if(_0x130315){_0x57a5da=_0x130315;_0x31c18a[_0x2886('0x34')]=_[_0x2886('0x36')](db[_0x2886('0x8b')][_0x2886('0x30')]);_0x31c18a[_0x2886('0x35')]=_[_0x2886('0x36')](_0x33d716[_0x2886('0x35')]);_0x31c18a[_0x2886('0x3f')]=_['intersection'](_0x31c18a['model'],_0x31c18a[_0x2886('0x35')]);_0x2fd56e[_0x2886('0x38')]=_[_0x2886('0x37')](_0x31c18a[_0x2886('0x34')],qs[_0x2886('0x39')](_0x33d716['query'][_0x2886('0x39')]));_0x2fd56e[_0x2886('0x38')]=_0x2fd56e[_0x2886('0x38')]['length']?_0x2fd56e[_0x2886('0x38')]:_0x31c18a[_0x2886('0x34')];_0x2fd56e[_0x2886('0x7a')]=qs[_0x2886('0x3d')](_0x33d716[_0x2886('0x35')][_0x2886('0x3d')]);_0x2fd56e[_0x2886('0x3e')]=qs[_0x2886('0x3f')](_['pick'](_0x33d716[_0x2886('0x35')],_0x31c18a['filters']));if(_0x33d716[_0x2886('0x35')][_0x2886('0x41')]){_0x2fd56e[_0x2886('0x3e')]=_[_0x2886('0x42')](_0x2fd56e[_0x2886('0x3e')],{'$or':_['map'](_0x2fd56e[_0x2886('0x38')],function(_0x10ca84){var _0x5b1778={};_0x5b1778[_0x10ca84]={'$like':'%'+_0x33d716[_0x2886('0x35')]['filter']+'%'};return _0x5b1778;})});}_0x2fd56e=_[_0x2886('0x42')]({},_0x2fd56e,_0x33d716['options']);return _0x57a5da[_0x2886('0x9d')](_0x2fd56e);}})[_0x2886('0x45')](function(_0x136441){if(_0x136441){_0x52fe4c=_0x136441['length'];if(!_0x33d716[_0x2886('0x35')][_0x2886('0x3b')](_0x2886('0x3c'))){_0x2fd56e[_0x2886('0x21')]=qs[_0x2886('0x21')](_0x33d716['query'][_0x2886('0x21')]);_0x2fd56e[_0x2886('0x20')]=qs[_0x2886('0x20')](_0x33d716[_0x2886('0x35')][_0x2886('0x20')]);}return _0x57a5da[_0x2886('0x9d')](_0x2fd56e);}})[_0x2886('0x45')](function(_0x5d5ae0){if(_0x5d5ae0){return _0x5d5ae0?{'count':_0x52fe4c,'rows':_0x5d5ae0}:null;}})['then'](respondWithResult(_0xd15994,null))[_0x2886('0x48')](handleError(_0xd15994,null));}; \ No newline at end of file +var _0x9a45=['penalty','defaults','TeamVoiceQueue','User','Queue','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','UserVoicePrefix','spread','isArray','removeAgents','QueueId','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','save','update','then','error','send','index','map','Team','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','findOne','channel','isValidChannel','Unknown\x20channel','toLowerCase','order','capitalize','add','Queues','removeQueues','remove','addAgents','ids','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through'];(function(_0x2f435a,_0x48b44a){var _0x404977=function(_0x1dfc19){while(--_0x1dfc19){_0x2f435a['push'](_0x2f435a['shift']());}};_0x404977(++_0x48b44a);}(_0x9a45,0x1e0));var _0x59a4=function(_0x143ca3,_0x4edfac){_0x143ca3=_0x143ca3-0x0;var _0x2b37a4=_0x9a45[_0x143ca3];return _0x2b37a4;};'use strict';var emlformat=require(_0x59a4('0x0'));var rimraf=require(_0x59a4('0x1'));var zipdir=require(_0x59a4('0x2'));var jsonpatch=require(_0x59a4('0x3'));var rp=require(_0x59a4('0x4'));var moment=require(_0x59a4('0x5'));var BPromise=require(_0x59a4('0x6'));var Mustache=require('mustache');var util=require(_0x59a4('0x7'));var path=require(_0x59a4('0x8'));var sox=require('sox');var csv=require(_0x59a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59a4('0xa'));var _=require(_0x59a4('0xb'));var squel=require(_0x59a4('0xc'));var crypto=require(_0x59a4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x59a4('0xe'));var toCsv=require(_0x59a4('0x9'));var querystring=require(_0x59a4('0xf'));var Papa=require('papaparse');var Redis=require(_0x59a4('0x10'));var authService=require(_0x59a4('0x11'));var qs=require(_0x59a4('0x12'));var as=require(_0x59a4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59a4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x59a4('0x15'));var licenseUtil=require(_0x59a4('0x16'));var db=require(_0x59a4('0x17'))['db'];config['redis']=_['defaults'](config[_0x59a4('0x18')],{'host':_0x59a4('0x19'),'port':0x18eb});var socket=require(_0x59a4('0x1a'))(new Redis(config[_0x59a4('0x18')]));require(_0x59a4('0x1b'))['register'](socket);function respondWithStatusCode(_0x16dce0,_0x5be7c3){_0x5be7c3=_0x5be7c3||0xcc;return function(_0x3ad867){if(_0x3ad867){return _0x16dce0[_0x59a4('0x1c')](_0x5be7c3);}return _0x16dce0[_0x59a4('0x1d')](_0x5be7c3)[_0x59a4('0x1e')]();};}function respondWithResult(_0x4d3e4d,_0x216ab0){_0x216ab0=_0x216ab0||0xc8;return function(_0x4052b2){if(_0x4052b2){return _0x4d3e4d['status'](_0x216ab0)['json'](_0x4052b2);}};}function respondWithFilteredResult(_0x233102,_0x1c3234){return function(_0x5b0ea0){if(_0x5b0ea0){var _0x36fd2f=typeof _0x1c3234[_0x59a4('0x1f')]==='undefined'&&typeof _0x1c3234[_0x59a4('0x20')]===_0x59a4('0x21');var _0x47144e=_0x5b0ea0['count'];var _0x2b085e=_0x36fd2f?0x0:_0x1c3234[_0x59a4('0x1f')];var _0x12c059=_0x36fd2f?_0x5b0ea0[_0x59a4('0x22')]:_0x1c3234[_0x59a4('0x1f')]+_0x1c3234[_0x59a4('0x20')];var _0x4aa94a;if(_0x12c059>=_0x47144e){_0x12c059=_0x47144e;_0x4aa94a=0xc8;}else{_0x4aa94a=0xce;}_0x233102[_0x59a4('0x1d')](_0x4aa94a);return _0x233102[_0x59a4('0x23')](_0x59a4('0x24'),_0x2b085e+'-'+_0x12c059+'/'+_0x47144e)[_0x59a4('0x25')](_0x5b0ea0);}return null;};}function patchUpdates(_0x2a6e73){return function(_0x52797e){try{jsonpatch['apply'](_0x52797e,_0x2a6e73,!![]);}catch(_0x24941f){return BPromise['reject'](_0x24941f);}return _0x52797e[_0x59a4('0x26')]();};}function saveUpdates(_0x3fae52,_0x5a4dde){return function(_0x37c058){if(_0x37c058){return _0x37c058[_0x59a4('0x27')](_0x3fae52)[_0x59a4('0x28')](function(_0x349722){return _0x349722;});}return null;};}function handleEntityNotFound(_0x5d6fc9,_0x37e54b){return function(_0x295686){if(!_0x295686){_0x5d6fc9[_0x59a4('0x1c')](0x194);}return _0x295686;};}function handleError(_0x30e2d1,_0x3f6cbf){_0x3f6cbf=_0x3f6cbf||0x1f4;return function(_0x221cb2){logger[_0x59a4('0x29')](_0x221cb2['stack']);if(_0x221cb2['name']){delete _0x221cb2['name'];}_0x30e2d1[_0x59a4('0x1d')](_0x3f6cbf)[_0x59a4('0x2a')](_0x221cb2);};}exports[_0x59a4('0x2b')]=function(_0x25907c,_0x2abdbd){var _0x39cb6d={},_0x59b9fa={},_0x4baec3={'count':0x0,'rows':[]};var _0x42cb70=_[_0x59a4('0x2c')](db[_0x59a4('0x2d')]['rawAttributes'],function(_0x23a62c){return{'name':_0x23a62c[_0x59a4('0x2e')],'type':_0x23a62c[_0x59a4('0x2f')][_0x59a4('0x30')]};});_0x59b9fa['model']=_[_0x59a4('0x2c')](_0x42cb70,_0x59a4('0x31'));_0x59b9fa[_0x59a4('0x32')]=_['keys'](_0x25907c[_0x59a4('0x32')]);_0x59b9fa[_0x59a4('0x33')]=_[_0x59a4('0x34')](_0x59b9fa['model'],_0x59b9fa[_0x59a4('0x32')]);_0x39cb6d[_0x59a4('0x35')]=_[_0x59a4('0x34')](_0x59b9fa[_0x59a4('0x36')],qs[_0x59a4('0x37')](_0x25907c[_0x59a4('0x32')][_0x59a4('0x37')]));_0x39cb6d[_0x59a4('0x35')]=_0x39cb6d['attributes'][_0x59a4('0x38')]?_0x39cb6d[_0x59a4('0x35')]:_0x59b9fa[_0x59a4('0x36')];if(!_0x25907c[_0x59a4('0x32')][_0x59a4('0x39')](_0x59a4('0x3a'))){_0x39cb6d[_0x59a4('0x20')]=qs[_0x59a4('0x20')](_0x25907c[_0x59a4('0x32')][_0x59a4('0x20')]);_0x39cb6d['offset']=qs[_0x59a4('0x1f')](_0x25907c[_0x59a4('0x32')][_0x59a4('0x1f')]);}_0x39cb6d['order']=qs[_0x59a4('0x3b')](_0x25907c[_0x59a4('0x32')]['sort']);_0x39cb6d[_0x59a4('0x3c')]=qs[_0x59a4('0x33')](_[_0x59a4('0x3d')](_0x25907c[_0x59a4('0x32')],_0x59b9fa[_0x59a4('0x33')]),_0x42cb70);if(_0x25907c[_0x59a4('0x32')][_0x59a4('0x3e')]){_0x39cb6d[_0x59a4('0x3c')]=_[_0x59a4('0x3f')](_0x39cb6d[_0x59a4('0x3c')],{'$or':_[_0x59a4('0x2c')](_0x42cb70,function(_0x4ed838){if(_0x4ed838[_0x59a4('0x2f')]!==_0x59a4('0x40')){var _0x41e0c8={};_0x41e0c8[_0x4ed838['name']]={'$like':'%'+_0x25907c['query'][_0x59a4('0x3e')]+'%'};return _0x41e0c8;}})});}_0x39cb6d=_[_0x59a4('0x3f')]({},_0x39cb6d,_0x25907c[_0x59a4('0x41')]);var _0x35bbe9={'where':_0x39cb6d[_0x59a4('0x3c')]};return db[_0x59a4('0x2d')][_0x59a4('0x22')](_0x35bbe9)[_0x59a4('0x28')](function(_0x46c203){_0x4baec3['count']=_0x46c203;if(_0x25907c[_0x59a4('0x32')][_0x59a4('0x42')]){_0x39cb6d[_0x59a4('0x43')]=[{'all':!![]}];}return db['Team'][_0x59a4('0x44')](_0x39cb6d);})['then'](function(_0x469193){_0x4baec3[_0x59a4('0x45')]=_0x469193;return _0x4baec3;})[_0x59a4('0x28')](respondWithFilteredResult(_0x2abdbd,_0x39cb6d))[_0x59a4('0x46')](handleError(_0x2abdbd,null));};exports['show']=function(_0x3d64dd,_0x65e012){var _0x308b12={'raw':![],'where':{'id':_0x3d64dd[_0x59a4('0x47')]['id']}},_0xa91fcf={};_0xa91fcf[_0x59a4('0x36')]=_[_0x59a4('0x48')](db[_0x59a4('0x2d')][_0x59a4('0x49')]);_0xa91fcf[_0x59a4('0x32')]=_[_0x59a4('0x48')](_0x3d64dd[_0x59a4('0x32')]);_0xa91fcf['filters']=_[_0x59a4('0x34')](_0xa91fcf[_0x59a4('0x36')],_0xa91fcf[_0x59a4('0x32')]);_0x308b12[_0x59a4('0x35')]=_['intersection'](_0xa91fcf[_0x59a4('0x36')],qs[_0x59a4('0x37')](_0x3d64dd[_0x59a4('0x32')][_0x59a4('0x37')]));_0x308b12['attributes']=_0x308b12[_0x59a4('0x35')][_0x59a4('0x38')]?_0x308b12[_0x59a4('0x35')]:_0xa91fcf['model'];if(_0x3d64dd[_0x59a4('0x32')]['includeAll']){_0x308b12[_0x59a4('0x43')]=[{'all':!![]}];}_0x308b12=_[_0x59a4('0x3f')]({},_0x308b12,_0x3d64dd[_0x59a4('0x41')]);return db[_0x59a4('0x2d')][_0x59a4('0x4a')](_0x308b12)[_0x59a4('0x28')](handleEntityNotFound(_0x65e012,null))[_0x59a4('0x28')](respondWithResult(_0x65e012,null))[_0x59a4('0x46')](handleError(_0x65e012,null));};exports[_0x59a4('0x4b')]=function(_0x48c431,_0x3a233e){return db[_0x59a4('0x2d')][_0x59a4('0x4b')](_0x48c431[_0x59a4('0x4c')],{})[_0x59a4('0x28')](function(_0x1a715b){var _0x5cb7f7=_0x48c431[_0x59a4('0x4d')][_0x59a4('0x4e')]({'plain':!![]});if(!_0x5cb7f7)throw new Error(_0x59a4('0x4f'));if(_0x5cb7f7['role']===_0x59a4('0x4d')){var _0x57e4ca=_0x1a715b[_0x59a4('0x4e')]({'plain':!![]});var _0x50b5f5=_0x59a4('0x50');return db[_0x59a4('0x51')][_0x59a4('0x4a')]({'where':{'name':_0x50b5f5,'userProfileId':_0x5cb7f7[_0x59a4('0x52')]},'raw':!![]})[_0x59a4('0x28')](function(_0x2c18e3){if(_0x2c18e3&&_0x2c18e3[_0x59a4('0x53')]===0x0){return db['UserProfileResource'][_0x59a4('0x4b')]({'name':_0x57e4ca[_0x59a4('0x31')],'resourceId':_0x57e4ca['id'],'type':_0x2c18e3[_0x59a4('0x31')],'sectionId':_0x2c18e3['id']},{})[_0x59a4('0x28')](function(){return _0x1a715b;});}else{return _0x1a715b;}})[_0x59a4('0x46')](function(_0x489569){logger[_0x59a4('0x29')](_0x59a4('0x54'),_0x489569);throw _0x489569;});}return _0x1a715b;})[_0x59a4('0x28')](respondWithResult(_0x3a233e,0xc9))[_0x59a4('0x46')](handleError(_0x3a233e,null));};exports[_0x59a4('0x27')]=function(_0x3b7384,_0x2cc195){if(_0x3b7384[_0x59a4('0x4c')]['id']){delete _0x3b7384['body']['id'];}return db[_0x59a4('0x2d')][_0x59a4('0x4a')]({'where':{'id':_0x3b7384['params']['id']}})[_0x59a4('0x28')](handleEntityNotFound(_0x2cc195,null))[_0x59a4('0x28')](saveUpdates(_0x3b7384[_0x59a4('0x4c')],null))['then'](respondWithResult(_0x2cc195,null))[_0x59a4('0x46')](handleError(_0x2cc195,null));};exports['destroy']=function(_0x1da1f9,_0x1a78f2){var _0x4d2f5=_0x1da1f9['params']['id'];var _0x343de2=[];return db[_0x59a4('0x55')][_0x59a4('0x56')](function(_0x38b7e6){var _0x285115=_0x59a4('0x57')+_0x4d2f5;return db['sequelize']['query'](_0x285115,{'type':db[_0x59a4('0x58')]['QueryTypes'][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6})[_0x59a4('0x28')](function(_0x3cb01a){_0x343de2=_['map'](_0x3cb01a,function(_0x4813fc){return Number(_0x4813fc[_0x59a4('0x5a')]);});})[_0x59a4('0x28')](function(){var _0x3a2764=_0x59a4('0x5b')+_0x4d2f5;return db[_0x59a4('0x55')][_0x59a4('0x32')](_0x3a2764,{'type':db['Sequelize']['QueryTypes'][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x3c09c5){var _0x3865bb=_['map'](_0x3c09c5,function(_0x48e851){return Number(_0x48e851[_0x59a4('0x5c')]);});return db[_0x59a4('0x5d')][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'VoiceQueueId':{'$in':_0x3865bb}},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){var _0xbd0084=_0x59a4('0x5f')+_0x4d2f5;return db[_0x59a4('0x55')][_0x59a4('0x32')](_0xbd0084,{'type':db[_0x59a4('0x58')][_0x59a4('0x60')][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x485afb){var _0x8f1807=_[_0x59a4('0x2c')](_0x485afb,function(_0x1daac9){return Number(_0x1daac9['MailQueueId']);});return db['UserMailQueue'][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'MailQueueId':{'$in':_0x8f1807}},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){var _0x980bc1=_0x59a4('0x61')+_0x4d2f5;return db[_0x59a4('0x55')][_0x59a4('0x32')](_0x980bc1,{'type':db['Sequelize'][_0x59a4('0x60')][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x399c2c){var _0x2723af=_['map'](_0x399c2c,function(_0x316123){return Number(_0x316123[_0x59a4('0x62')]);});return db[_0x59a4('0x63')][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'SmsQueueId':{'$in':_0x2723af}},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){var _0x285d43=_0x59a4('0x64')+_0x4d2f5;return db['sequelize']['query'](_0x285d43,{'type':db['Sequelize'][_0x59a4('0x60')][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})['then'](function(_0x5307af){var _0x5ea929=_[_0x59a4('0x2c')](_0x5307af,function(_0x5f1994){return Number(_0x5f1994[_0x59a4('0x65')]);});return db[_0x59a4('0x66')][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'ChatQueueId':{'$in':_0x5ea929}},'transaction':_0x38b7e6});})['then'](function(){var _0x55d6d8='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4d2f5;return db[_0x59a4('0x55')][_0x59a4('0x32')](_0x55d6d8,{'type':db[_0x59a4('0x58')][_0x59a4('0x60')][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x2fb02b){var _0x26f8bc=_[_0x59a4('0x2c')](_0x2fb02b,function(_0x4833b7){return Number(_0x4833b7[_0x59a4('0x67')]);});return db[_0x59a4('0x68')][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'FaxQueueId':{'$in':_0x26f8bc}},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){var _0x5cbe41=_0x59a4('0x69')+_0x4d2f5;return db[_0x59a4('0x55')][_0x59a4('0x32')](_0x5cbe41,{'type':db[_0x59a4('0x58')][_0x59a4('0x60')][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x16ce84){var _0x35f6ce=_[_0x59a4('0x2c')](_0x16ce84,function(_0x577636){return Number(_0x577636[_0x59a4('0x6a')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x343de2},'OpenchannelQueueId':{'$in':_0x35f6ce}},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){var _0x5e2821=_0x59a4('0x6b')+_0x4d2f5;return db['sequelize'][_0x59a4('0x32')](_0x5e2821,{'type':db[_0x59a4('0x58')]['QueryTypes'][_0x59a4('0x59')],'raw':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x1dd40e){var _0x100857=_['map'](_0x1dd40e,function(_0x4c9e74){return Number(_0x4c9e74[_0x59a4('0x6c')]);});return db['UserWhatsappQueue'][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'WhatsappQueueId':{'$in':_0x100857}},'transaction':_0x38b7e6});})['then'](function(){return db[_0x59a4('0x6d')][_0x59a4('0x4a')]({'where':{'TeamId':_0x4d2f5}});})[_0x59a4('0x28')](function(_0x1e2ad8){if(_0x1e2ad8===null){return;}return db['UserVoicePrefix'][_0x59a4('0x5e')]({'where':{'UserId':{'$in':_0x343de2},'VoicePrefixId':_0x1e2ad8[_0x59a4('0x6e')]},'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(){return db[_0x59a4('0x2d')]['destroy']({'where':{'id':_0x4d2f5},'cascade':!![],'transaction':_0x38b7e6});})[_0x59a4('0x28')](function(_0x4ef0e2){if(_0x4ef0e2===0x0){_0x1a78f2[_0x59a4('0x1c')](0x194);}else{return db['UserProfileResource'][_0x59a4('0x5e')]({'where':{'type':_0x59a4('0x50'),'resourceId':_0x4d2f5},'cascade':!![],'transaction':_0x38b7e6})[_0x59a4('0x28')](function(){_0x1a78f2[_0x59a4('0x1d')](0xcc)['end']();});}})[_0x59a4('0x46')](function(_0x5b7a62){_0x1a78f2['status'](0x1f4)[_0x59a4('0x2a')](_0x5b7a62);});});};exports['getQueues']=function(_0x4a1910,_0x52714b,_0x11efa1){return db[_0x59a4('0x2d')][_0x59a4('0x6f')]({'where':{'id':_0x4a1910[_0x59a4('0x47')]['id']}})[_0x59a4('0x28')](handleEntityNotFound(_0x52714b,null))['then'](function(_0x7f3d9d){if(!_0x4a1910['query'][_0x59a4('0x70')]||!utils[_0x59a4('0x71')](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x70')])){throw new db[(_0x59a4('0x58'))]['ValidationError'](_0x59a4('0x72'));}var _0x57edb9={};var _0x1f3d1d={};_0x1f3d1d['model']=_['keys'](db[_['capitalize'](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x70')][_0x59a4('0x73')]())+'Queue'][_0x59a4('0x49')]);_0x1f3d1d['query']=_[_0x59a4('0x48')](_0x4a1910[_0x59a4('0x32')]);_0x1f3d1d[_0x59a4('0x33')]=_[_0x59a4('0x34')](_0x1f3d1d[_0x59a4('0x36')],_0x1f3d1d[_0x59a4('0x32')]);_0x57edb9[_0x59a4('0x35')]=_[_0x59a4('0x34')](_0x1f3d1d[_0x59a4('0x36')],qs['fields'](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x37')]));_0x57edb9['attributes']=_0x57edb9['attributes'][_0x59a4('0x38')]?_0x57edb9['attributes']:_0x1f3d1d['model'];_0x57edb9[_0x59a4('0x20')]=qs[_0x59a4('0x20')](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x20')]);_0x57edb9[_0x59a4('0x1f')]=qs['offset'](_0x4a1910['query'][_0x59a4('0x1f')]);_0x57edb9[_0x59a4('0x74')]=qs[_0x59a4('0x3b')](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x3b')]);_0x57edb9['where']=qs[_0x59a4('0x33')](_[_0x59a4('0x3d')](_0x4a1910[_0x59a4('0x32')],_0x1f3d1d[_0x59a4('0x33')]));_0x57edb9=_['merge']({},_0x57edb9,_0x4a1910[_0x59a4('0x41')]);return _0x7f3d9d[_0x59a4('0x4e')+_[_0x59a4('0x75')](_0x4a1910[_0x59a4('0x32')][_0x59a4('0x70')]['toLowerCase']())+'Queues'](_0x57edb9);})[_0x59a4('0x28')](respondWithResult(_0x52714b,null))[_0x59a4('0x46')](handleError(_0x52714b,null));};exports['addQueues']=function(_0x1a146c,_0x1e1633,_0x31597e){return db[_0x59a4('0x2d')][_0x59a4('0x6f')]({'where':{'id':_0x1a146c[_0x59a4('0x47')]['id']}})[_0x59a4('0x28')](function(_0x31e966){if(_0x31e966){if(!_0x1a146c['body'][_0x59a4('0x70')]||!utils['isValidChannel'](_0x1a146c[_0x59a4('0x4c')][_0x59a4('0x70')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x31e966[_0x59a4('0x76')+_[_0x59a4('0x75')](_0x1a146c[_0x59a4('0x4c')]['channel'][_0x59a4('0x73')]())+_0x59a4('0x77')](_0x1a146c[_0x59a4('0x4c')]['ids']);}return null;})[_0x59a4('0x28')](handleEntityNotFound(_0x1e1633,null))[_0x59a4('0x28')](respondWithStatusCode(_0x1e1633,null))[_0x59a4('0x46')](handleError(_0x1e1633,null));};exports[_0x59a4('0x78')]=function(_0x51142,_0x5f323b,_0x26fb90){return db[_0x59a4('0x2d')][_0x59a4('0x6f')]({'where':{'id':_0x51142[_0x59a4('0x47')]['id']}})[_0x59a4('0x28')](function(_0x35a422){if(_0x35a422){if(!_0x51142[_0x59a4('0x32')][_0x59a4('0x70')]||!utils['isValidChannel'](_0x51142['query']['channel'])){throw new db[(_0x59a4('0x58'))]['ValidationError'](_0x59a4('0x72'));}return _0x35a422[_0x59a4('0x79')+_[_0x59a4('0x75')](_0x51142['query'][_0x59a4('0x70')]['toLowerCase']())+'Queues'](_0x51142[_0x59a4('0x32')]['ids']);}return null;})[_0x59a4('0x28')](handleEntityNotFound(_0x5f323b,null))[_0x59a4('0x28')](respondWithStatusCode(_0x5f323b,null))['catch'](handleError(_0x5f323b,null));};exports[_0x59a4('0x7a')]=function(_0x1e342c,_0x53d1af){var _0x2e9988=_['isArray'](_0x1e342c[_0x59a4('0x4c')][_0x59a4('0x7b')])?_0x1e342c[_0x59a4('0x4c')]['ids']:[_0x1e342c[_0x59a4('0x4c')][_0x59a4('0x7b')]];var _0x3939de=_0x1e342c['params']['id'];return db[_0x59a4('0x2d')][_0x59a4('0x4a')]({'where':{'id':_0x3939de}})[_0x59a4('0x28')](handleEntityNotFound(_0x53d1af,null))[_0x59a4('0x28')](function(_0x108990){if(_0x108990){var _0x202e78=[_0x59a4('0x7c'),_0x59a4('0x7d'),_0x59a4('0x7e'),_0x59a4('0x7f'),_0x59a4('0x80'),_0x59a4('0x81'),_0x59a4('0x82')];return db[_0x59a4('0x55')][_0x59a4('0x56')](function(_0x41be5b){var _0x197b24=_[_0x59a4('0x2c')](_0x202e78,function(_0x38dc11){var _0x4083ff={'attributes':['id',_0x59a4('0x31')]};if(_0x38dc11===_0x59a4('0x7c')){_0x4083ff[_0x59a4('0x83')]={'attributes':[_0x59a4('0x84')]};}return _0x108990[_0x59a4('0x4e')+_0x38dc11+_0x59a4('0x77')](_0x4083ff)[_0x59a4('0x28')](function(_0x3b90f2){var _0x191c20=_[_0x59a4('0x2c')](_0x3b90f2,function(_0x24a84d){var _0x58560e=_[_0x59a4('0x2c')](_0x2e9988,function(_0x197240){var _0x52ed6f={'where':{'UserId':_0x197240,[_0x38dc11+'QueueId']:_0x24a84d['id']},'transaction':_0x41be5b};if(_0x38dc11===_0x59a4('0x7c')){_0x52ed6f[_0x59a4('0x85')]={'penalty':_0x24a84d[_0x59a4('0x86')][_0x59a4('0x84')]};}return db[_0x59a4('0x87')+_0x38dc11+_0x59a4('0x88')]['findOrCreate'](_0x52ed6f)[_0x59a4('0x28')](function(){socket[_0x59a4('0x89')]('user'+_0x38dc11+_0x59a4('0x8a'),{'UserId':_0x197240,[_0x38dc11+'QueueId']:_0x24a84d['id']});if(_0x38dc11!=='Voice'){return;}return db[_0x59a4('0x87')][_0x59a4('0x44')]({'where':{'id':_0x2e9988,'online':0x1},'attributes':['id',_0x59a4('0x31'),_0x59a4('0x8b'),_0x59a4('0x8c'),_0x59a4('0x8d')],'raw':!![]})['then'](function(_0x50c817){var _0xf2c741=_['map'](_0x50c817,function(_0x23e901){return db[_0x59a4('0x8e')][_0x59a4('0x8f')]({'membername':_0x23e901[_0x59a4('0x31')],'UserId':_0x23e901['id'],'queue_name':_0x24a84d[_0x59a4('0x31')],'VoiceQueueId':_0x24a84d['id'],'interface':_[_0x59a4('0x90')](_0x23e901[_0x59a4('0x8d')])?util['format'](_0x59a4('0x91'),_0x23e901['name']):_0x23e901[_0x59a4('0x8d')],'paused':_0x23e901['voicePause']||![],'penalty':_0x24a84d['TeamVoiceQueue'][_0x59a4('0x84')]},{'transaction':_0x41be5b});});return Promise[_0x59a4('0x92')](_0xf2c741);});});});return Promise[_0x59a4('0x92')](_0x58560e);});return Promise[_0x59a4('0x92')](_0x191c20);})[_0x59a4('0x28')](function(){return db[_0x59a4('0x6d')][_0x59a4('0x6f')]({'where':{'teamId':_0x3939de}})[_0x59a4('0x28')](function(_0x13b595){if(_0x13b595){var _0x38b82f=_['map'](_0x2e9988,function(_0x5bb02a){db[_0x59a4('0x93')]['upsert']({'UserId':_0x5bb02a,'VoicePrefixId':_0x13b595['VoicePrefixId']});});return Promise[_0x59a4('0x92')](_0x38b82f);}});});});return Promise['all'](_0x197b24)[_0x59a4('0x28')](function(){return _0x108990[_0x59a4('0x7a')](_0x2e9988,{'transaction':_0x41be5b})[_0x59a4('0x94')](function(_0x41d711){return _0x41d711;});});});}})['then'](respondWithResult(_0x53d1af,null))['catch'](handleError(_0x53d1af,null));};exports['removeAgents']=function(_0x4a648c,_0x2945e6){var _0x21509b=_[_0x59a4('0x95')](_0x4a648c[_0x59a4('0x32')][_0x59a4('0x7b')])?_0x4a648c[_0x59a4('0x32')][_0x59a4('0x7b')]:[_0x4a648c[_0x59a4('0x32')][_0x59a4('0x7b')]];var _0x538949=_0x4a648c[_0x59a4('0x47')]['id'];return db[_0x59a4('0x2d')][_0x59a4('0x4a')]({'where':{'id':_0x538949}})[_0x59a4('0x28')](handleEntityNotFound(_0x2945e6,null))['then'](function(_0x4a8147){if(_0x4a8147){var _0x553b8c=['Voice',_0x59a4('0x7d'),'Mail',_0x59a4('0x7f'),_0x59a4('0x80'),_0x59a4('0x81'),_0x59a4('0x82')];return db[_0x59a4('0x55')][_0x59a4('0x56')](function(_0x51ed39){var _0x4c46ca=_[_0x59a4('0x2c')](_0x553b8c,function(_0x353822){var _0x2cab6d={'attributes':['id','name']};return _0x4a8147['get'+_0x353822+_0x59a4('0x77')](_0x2cab6d)[_0x59a4('0x28')](function(_0x576878){var _0x37dc2e=_['map'](_0x576878,function(_0x29a18b){return _0x29a18b[_0x59a4('0x96')](_0x21509b,{'transaction':_0x51ed39})[_0x59a4('0x28')](function(){var _0x1fb652=_[_0x59a4('0x2c')](_0x21509b,function(_0x5341ad){socket[_0x59a4('0x89')]('user'+_0x353822+'Queue:remove',{'UserId':Number(_0x5341ad),[_0x353822+_0x59a4('0x97')]:_0x29a18b['id']});if(_0x353822!==_0x59a4('0x7c')){return;}return db[_0x59a4('0x8e')][_0x59a4('0x5e')]({'where':{'VoiceQueueId':_0x29a18b['id'],'UserId':_0x5341ad},'transaction':_0x51ed39});});return Promise[_0x59a4('0x92')](_0x1fb652);});});return Promise[_0x59a4('0x92')](_0x37dc2e);});});return Promise[_0x59a4('0x92')](_0x4c46ca)[_0x59a4('0x28')](function(){return _0x4a8147['removeAgents'](_0x21509b,{'transaction':_0x51ed39});})[_0x59a4('0x28')](function(){return db[_0x59a4('0x6d')][_0x59a4('0x6f')]({'where':{'teamId':_0x538949}})[_0x59a4('0x28')](function(_0x396b5b){if(_0x396b5b){var _0x164409=_[_0x59a4('0x2c')](_0x21509b,function(_0x214fe0){db[_0x59a4('0x93')][_0x59a4('0x5e')]({'where':{'UserId':_0x214fe0,'VoicePrefixId':_0x396b5b[_0x59a4('0x6e')]}});});return Promise[_0x59a4('0x92')](_0x164409);}});});});}})[_0x59a4('0x28')](respondWithStatusCode(_0x2945e6,null))[_0x59a4('0x46')](handleError(_0x2945e6,null));};exports['getAgents']=function(_0x4ed407,_0x10e4dc,_0xa4e524){var _0x4af3d5={};var _0x256d4c={};var _0xdd8e30;var _0x3f6017;return db['Team'][_0x59a4('0x6f')]({'where':{'id':_0x4ed407[_0x59a4('0x47')]['id']}})['then'](handleEntityNotFound(_0x10e4dc,null))['then'](function(_0x182326){if(_0x182326){_0xdd8e30=_0x182326;_0x256d4c[_0x59a4('0x36')]=_[_0x59a4('0x48')](db['User'][_0x59a4('0x49')]);_0x256d4c['query']=_[_0x59a4('0x48')](_0x4ed407[_0x59a4('0x32')]);_0x256d4c[_0x59a4('0x33')]=_[_0x59a4('0x34')](_0x256d4c[_0x59a4('0x36')],_0x256d4c[_0x59a4('0x32')]);_0x4af3d5[_0x59a4('0x35')]=_[_0x59a4('0x34')](_0x256d4c[_0x59a4('0x36')],qs[_0x59a4('0x37')](_0x4ed407[_0x59a4('0x32')][_0x59a4('0x37')]));_0x4af3d5[_0x59a4('0x35')]=_0x4af3d5[_0x59a4('0x35')][_0x59a4('0x38')]?_0x4af3d5[_0x59a4('0x35')]:_0x256d4c['model'];_0x4af3d5[_0x59a4('0x74')]=qs[_0x59a4('0x3b')](_0x4ed407[_0x59a4('0x32')][_0x59a4('0x3b')]);_0x4af3d5[_0x59a4('0x3c')]=qs[_0x59a4('0x33')](_[_0x59a4('0x3d')](_0x4ed407['query'],_0x256d4c['filters']));if(_0x4ed407[_0x59a4('0x32')][_0x59a4('0x3e')]){_0x4af3d5[_0x59a4('0x3c')]=_[_0x59a4('0x3f')](_0x4af3d5[_0x59a4('0x3c')],{'$or':_[_0x59a4('0x2c')](_0x4af3d5[_0x59a4('0x35')],function(_0x37fa54){var _0x1184ed={};_0x1184ed[_0x37fa54]={'$like':'%'+_0x4ed407[_0x59a4('0x32')][_0x59a4('0x3e')]+'%'};return _0x1184ed;})});}_0x4af3d5=_[_0x59a4('0x3f')]({},_0x4af3d5,_0x4ed407[_0x59a4('0x41')]);return _0xdd8e30[_0x59a4('0x98')](_0x4af3d5);}})[_0x59a4('0x28')](function(_0x32e3e8){if(_0x32e3e8){_0x3f6017=_0x32e3e8[_0x59a4('0x38')];if(!_0x4ed407[_0x59a4('0x32')][_0x59a4('0x39')](_0x59a4('0x3a'))){_0x4af3d5[_0x59a4('0x20')]=qs[_0x59a4('0x20')](_0x4ed407[_0x59a4('0x32')][_0x59a4('0x20')]);_0x4af3d5[_0x59a4('0x1f')]=qs[_0x59a4('0x1f')](_0x4ed407[_0x59a4('0x32')]['offset']);}return _0xdd8e30[_0x59a4('0x98')](_0x4af3d5);}})['then'](function(_0x286e76){if(_0x286e76){return _0x286e76?{'count':_0x3f6017,'rows':_0x286e76}:null;}})[_0x59a4('0x28')](respondWithResult(_0x10e4dc,null))[_0x59a4('0x46')](handleError(_0x10e4dc,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index af0c120..92107c7 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 _0xc455=['emit','hook','events','setMaxListeners','save','remove'];(function(_0x529472,_0x1ab233){var _0x5704df=function(_0x1e4685){while(--_0x1e4685){_0x529472['push'](_0x529472['shift']());}};_0x5704df(++_0x1ab233);}(_0xc455,0x68));var _0x5c45=function(_0x6afe10,_0x13bba1){_0x6afe10=_0x6afe10-0x0;var _0x535c01=_0xc455[_0x6afe10];return _0x535c01;};'use strict';var EventEmitter=require(_0x5c45('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x5c45('0x1')](0x0);var events={'afterCreate':_0x5c45('0x2'),'afterUpdate':'update','afterDestroy':_0x5c45('0x3')};function emitEvent(_0x673214){return function(_0x328fd4,_0x57c836,_0x586488){TeamEvents[_0x5c45('0x4')](_0x673214+':'+_0x328fd4['id'],_0x328fd4);TeamEvents[_0x5c45('0x4')](_0x673214,_0x328fd4);_0x586488(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x5c45('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xc7a4=['emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0xc7a4,0x1bb));var _0x4c7a=function(_0x6cba5b,_0x8a1354){_0x6cba5b=_0x6cba5b-0x0;var _0x4912ff=_0xc7a4[_0x6cba5b];return _0x4912ff;};'use strict';var EventEmitter=require(_0x4c7a('0x0'));var Team=require(_0x4c7a('0x1'))['db'][_0x4c7a('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4c7a('0x3')](0x0);var events={'afterCreate':_0x4c7a('0x4'),'afterUpdate':_0x4c7a('0x5'),'afterDestroy':_0x4c7a('0x6')};function emitEvent(_0x59f666){return function(_0x1c106c,_0x11ebd0,_0x422915){TeamEvents[_0x4c7a('0x7')](_0x59f666+':'+_0x1c106c['id'],_0x1c106c);TeamEvents[_0x4c7a('0x7')](_0x59f666,_0x1c106c);_0x422915(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4c7a('0x8')](e,emitEvent(event));}}module[_0x4c7a('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 4e57f4d..c999f5a 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 _0x2b0b=['request-promise','rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','util','../../config/logger','moment'];(function(_0x2e3556,_0x41dea7){var _0x41ba8f=function(_0x32b401){while(--_0x32b401){_0x2e3556['push'](_0x2e3556['shift']());}};_0x41ba8f(++_0x41dea7);}(_0x2b0b,0xee));var _0xb2b0=function(_0x3b4176,_0x1f7d50){_0x3b4176=_0x3b4176-0x0;var _0x230488=_0x2b0b[_0x3b4176];return _0x230488;};'use strict';var _=require(_0xb2b0('0x0'));var util=require(_0xb2b0('0x1'));var logger=require(_0xb2b0('0x2'))('api');var moment=require(_0xb2b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2b0('0x5'));var config=require(_0xb2b0('0x6'));var attributes=require(_0xb2b0('0x7'));module[_0xb2b0('0x8')]=function(_0x7c3fdf,_0x26a32a){return _0x7c3fdf[_0xb2b0('0x9')](_0xb2b0('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f83=['rimraf','exports','define','Team','teams','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x1f83,0x13d));var _0x31f8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1f83[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x31f8('0x0'));var util=require(_0x31f8('0x1'));var logger=require(_0x31f8('0x2'))('api');var moment=require(_0x31f8('0x3'));var BPromise=require(_0x31f8('0x4'));var rp=require(_0x31f8('0x5'));var fs=require('fs');var path=require(_0x31f8('0x6'));var rimraf=require(_0x31f8('0x7'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0x31f8('0x8')]=function(_0x58615d,_0xfd0a6f){return _0x58615d[_0x31f8('0x9')](_0x31f8('0xa'),attributes,{'tableName':_0x31f8('0xb'),'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 c264e56..1d68358 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 _0xa51d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','code','error','message','lodash','util','moment','bluebird'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa51d,0x15a));var _0xda51=function(_0x16051a,_0x5e4326){_0x16051a=_0x16051a-0x0;var _0x35d20d=_0xa51d[_0x16051a];return _0x35d20d;};'use strict';var _=require(_0xda51('0x0'));var util=require(_0xda51('0x1'));var moment=require(_0xda51('0x2'));var BPromise=require(_0xda51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda51('0x4'))['db'];var utils=require(_0xda51('0x5'));var logger=require(_0xda51('0x6'))(_0xda51('0x7'));var config=require('../../config/environment');var jayson=require(_0xda51('0x8'));var client=jayson[_0xda51('0x9')][_0xda51('0xa')]({'port':0x232a});config[_0xda51('0xb')]=_[_0xda51('0xc')](config['redis'],{'host':_0xda51('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda51('0xb')]));require(_0xda51('0xe'))[_0xda51('0xf')](socket);function respondWithRpcPromise(_0x5d78c9,_0x2ef0f1,_0x5ee350){return new BPromise(function(_0x310872,_0xc688c1){return client['request'](_0x5d78c9,_0x5ee350)[_0xda51('0x10')](function(_0x477c01){logger[_0xda51('0x11')](_0xda51('0x12'),_0x2ef0f1,_0xda51('0x13'));logger[_0xda51('0x14')](_0xda51('0x15'),_0x2ef0f1,_0xda51('0x13'),JSON['stringify'](_0x477c01));if(_0x477c01['error']){if(_0x477c01['error'][_0xda51('0x16')]===0x1f4){logger[_0xda51('0x17')](_0xda51('0x12'),_0x2ef0f1,_0x477c01[_0xda51('0x17')][_0xda51('0x18')]);return _0xc688c1(_0x477c01['error'][_0xda51('0x18')]);}logger[_0xda51('0x17')](_0xda51('0x12'),_0x2ef0f1,_0x477c01[_0xda51('0x17')][_0xda51('0x18')]);return _0x310872(_0x477c01[_0xda51('0x17')][_0xda51('0x18')]);}else{logger[_0xda51('0x11')](_0xda51('0x12'),_0x2ef0f1,'request\x20sent');_0x310872(_0x477c01['result'][_0xda51('0x18')]);}})['catch'](function(_0x294b63){logger[_0xda51('0x17')](_0xda51('0x12'),_0x2ef0f1,_0x294b63);_0xc688c1(_0x294b63);});});} \ No newline at end of file +var _0x6ef2=['../../config/logger','rpc','http','socket.io-emitter','redis','register','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Team,\x20%s,\x20%s','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1ed713,_0x36c260){var _0x25914c=function(_0x5aa16c){while(--_0x5aa16c){_0x1ed713['push'](_0x1ed713['shift']());}};_0x25914c(++_0x36c260);}(_0x6ef2,0x1c3));var _0x26ef=function(_0x47f6b4,_0x3cefc0){_0x47f6b4=_0x47f6b4-0x0;var _0x24943b=_0x6ef2[_0x47f6b4];return _0x24943b;};'use strict';var _=require('lodash');var util=require(_0x26ef('0x0'));var moment=require(_0x26ef('0x1'));var BPromise=require(_0x26ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26ef('0x3'))['db'];var utils=require(_0x26ef('0x4'));var logger=require(_0x26ef('0x5'))(_0x26ef('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x26ef('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x26ef('0x8'))(new Redis(config[_0x26ef('0x9')]));require('./team.socket')[_0x26ef('0xa')](socket);function respondWithRpcPromise(_0x28fd65,_0x14aeeb,_0x2ccda0){return new BPromise(function(_0xe51bb,_0x565336){return client[_0x26ef('0xb')](_0x28fd65,_0x2ccda0)[_0x26ef('0xc')](function(_0x4369d5){logger[_0x26ef('0xd')]('Team,\x20%s,\x20%s',_0x14aeeb,'request\x20sent');logger[_0x26ef('0xe')](_0x26ef('0xf'),_0x14aeeb,_0x26ef('0x10'),JSON[_0x26ef('0x11')](_0x4369d5));if(_0x4369d5[_0x26ef('0x12')]){if(_0x4369d5[_0x26ef('0x12')][_0x26ef('0x13')]===0x1f4){logger[_0x26ef('0x12')]('Team,\x20%s,\x20%s',_0x14aeeb,_0x4369d5[_0x26ef('0x12')][_0x26ef('0x14')]);return _0x565336(_0x4369d5[_0x26ef('0x12')]['message']);}logger[_0x26ef('0x12')]('Team,\x20%s,\x20%s',_0x14aeeb,_0x4369d5[_0x26ef('0x12')][_0x26ef('0x14')]);return _0xe51bb(_0x4369d5[_0x26ef('0x12')][_0x26ef('0x14')]);}else{logger[_0x26ef('0xd')](_0x26ef('0x15'),_0x14aeeb,'request\x20sent');_0xe51bb(_0x4369d5[_0x26ef('0x16')][_0x26ef('0x14')]);}})[_0x26ef('0x17')](function(_0x813c63){logger[_0x26ef('0x12')](_0x26ef('0x15'),_0x14aeeb,_0x813c63);_0x565336(_0x813c63);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e9888d6..94eb607 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 _0x409d=['save','remove','update','emit','length'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0x409d,0x195));var _0xd409=function(_0x1f180d,_0x1463c4){_0x1f180d=_0x1f180d-0x0;var _0x334e20=_0x409d[_0x1f180d];return _0x334e20;};'use strict';var TeamEvents=require('./team.events');var events=[_0xd409('0x0'),_0xd409('0x1'),_0xd409('0x2')];function createListener(_0xe51aea,_0x442e52){return function(_0x2561aa){_0x442e52[_0xd409('0x3')](_0xe51aea,_0x2561aa);};}function removeListener(_0x124489,_0x1d87ce){return function(){TeamEvents['removeListener'](_0x124489,_0x1d87ce);};}exports['register']=function(_0x324248){for(var _0x8e2df5=0x0,_0xe0a136=events[_0xd409('0x4')];_0x8e2df5<_0xe0a136;_0x8e2df5++){var _0x542dd1=events[_0x8e2df5];var _0x4ce196=createListener('team:'+_0x542dd1,_0x324248);TeamEvents['on'](_0x542dd1,_0x4ce196);}}; \ No newline at end of file +var _0x9265=['removeListener','team:','./team.events','update','emit'];(function(_0x3c033a,_0x2d8d4d){var _0x11a2ea=function(_0x18a886){while(--_0x18a886){_0x3c033a['push'](_0x3c033a['shift']());}};_0x11a2ea(++_0x2d8d4d);}(_0x9265,0x1dd));var _0x5926=function(_0xc69688,_0x21288b){_0xc69688=_0xc69688-0x0;var _0x14b677=_0x9265[_0xc69688];return _0x14b677;};'use strict';var TeamEvents=require(_0x5926('0x0'));var events=['save','remove',_0x5926('0x1')];function createListener(_0x686bb9,_0x6fc133){return function(_0x240fa7){_0x6fc133[_0x5926('0x2')](_0x686bb9,_0x240fa7);};}function removeListener(_0x2b04ec,_0x31d820){return function(){TeamEvents[_0x5926('0x3')](_0x2b04ec,_0x31d820);};}exports['register']=function(_0x16ceff){for(var _0xb2dc0e=0x0,_0x1412e6=events['length'];_0xb2dc0e<_0x1412e6;_0xb2dc0e++){var _0xf199be=events[_0xb2dc0e];var _0x3a1bd0=createListener(_0x5926('0x4')+_0xf199be,_0x16ceff);TeamEvents['on'](_0xf199be,_0x3a1bd0);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 7021f49..82faef5 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 _0xfe60=['INTEGER','exports'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x42acc0,_0x469364){_0x42acc0=_0x42acc0-0x0;var _0x1c32bf=_0xfe60[_0x42acc0];return _0x1c32bf;};'use strict';var Sequelize=require('sequelize');module[_0x0fe6('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0fe6('0x1')]}}; \ No newline at end of file +var _0x2413=['INTEGER','sequelize'];(function(_0x342583,_0x434d07){var _0x2f4c83=function(_0x521c10){while(--_0x521c10){_0x342583['push'](_0x342583['shift']());}};_0x2f4c83(++_0x434d07);}(_0x2413,0x1a1));var _0x3241=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2413[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x3241('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x3241('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6fe96fb..6756123 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 _0x6947=['./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x457cc1,_0xf8c452){var _0x3cab5a=function(_0x388acf){while(--_0x388acf){_0x457cc1['push'](_0x457cc1['shift']());}};_0x3cab5a(++_0xf8c452);}(_0x6947,0x72));var _0x7694=function(_0x3e1bf5,_0x592d75){_0x3e1bf5=_0x3e1bf5-0x0;var _0x365f07=_0x6947[_0x3e1bf5];return _0x365f07;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var logger=require('../../config/logger')(_0x7694('0x1'));var moment=require(_0x7694('0x2'));var BPromise=require(_0x7694('0x3'));var rp=require(_0x7694('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7694('0x5'));var attributes=require(_0x7694('0x6'));module[_0x7694('0x7')]=function(_0x5730,_0x36776b){return _0x5730[_0x7694('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0x7694('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8721=['bluebird','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x2236dc,_0x43c7f9){var _0x20583f=function(_0x293e36){while(--_0x293e36){_0x2236dc['push'](_0x2236dc['shift']());}};_0x20583f(++_0x43c7f9);}(_0x8721,0xd9));var _0x1872=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x8721[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var logger=require(_0x1872('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1872('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1872('0x4'));var attributes=require(_0x1872('0x5'));module[_0x1872('0x6')]=function(_0x47ca3a,_0x4befaf){return _0x47ca3a[_0x1872('0x7')](_0x1872('0x8'),attributes,{'tableName':_0x1872('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 47075be..36d0137 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(_0x578891,_0x5a6c98){var _0x4517b0=function(_0x2eeb04){while(--_0x2eeb04){_0x578891['push'](_0x578891['shift']());}};_0x4517b0(++_0x5a6c98);}(_0x70e0,0x17b));var _0x070e=function(_0x452a59,_0x4ac2b1){_0x452a59=_0x452a59-0x0;var _0x43ff97=_0x70e0[_0x452a59];return _0x43ff97;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3c36b2,_0x34fcd7){var _0x24e2a7=function(_0xbbef2e){while(--_0xbbef2e){_0x3c36b2['push'](_0x3c36b2['shift']());}};_0x24e2a7(++_0x34fcd7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index a5e0901..735d02b 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 _0xc599=['INTEGER','sequelize'];(function(_0x21cff8,_0x41ad74){var _0xcf40d1=function(_0x125715){while(--_0x125715){_0x21cff8['push'](_0x21cff8['shift']());}};_0xcf40d1(++_0x41ad74);}(_0xc599,0x71));var _0x9c59=function(_0x5c7ea7,_0x4f7d6f){_0x5c7ea7=_0x5c7ea7-0x0;var _0x4c3cf1=_0xc599[_0x5c7ea7];return _0x4c3cf1;};'use strict';var Sequelize=require(_0x9c59('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9c59('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x06fb=['exports','INTEGER','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x06fb,0xe9));var _0xb06f=function(_0x4222e4,_0x25096f){_0x4222e4=_0x4222e4-0x0;var _0x4bfa29=_0x06fb[_0x4222e4];return _0x4bfa29;};'use strict';var Sequelize=require(_0xb06f('0x0'));module[_0xb06f('0x1')]={'penalty':{'type':Sequelize[_0xb06f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 9ef4e6e..7540368 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 _0x7266=['rimraf','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','path'];(function(_0x3dd4e0,_0x31cbc9){var _0x43f834=function(_0xbb68e8){while(--_0xbb68e8){_0x3dd4e0['push'](_0x3dd4e0['shift']());}};_0x43f834(++_0x31cbc9);}(_0x7266,0xec));var _0x6726=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7266[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var logger=require(_0x6726('0x2'))(_0x6726('0x3'));var moment=require(_0x6726('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6726('0x5'));var rimraf=require(_0x6726('0x6'));var config=require('../../config/environment');var attributes=require('./teamVoiceQueue.attributes');module[_0x6726('0x7')]=function(_0x41c7c8,_0x1c2cfd){return _0x41c7c8[_0x6726('0x8')](_0x6726('0x9'),attributes,{'tableName':_0x6726('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc831=['request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x2abaf4,_0xd9b540){var _0x14e7ea=function(_0x5344f4){while(--_0x5344f4){_0x2abaf4['push'](_0x2abaf4['shift']());}};_0x14e7ea(++_0xd9b540);}(_0xc831,0x103));var _0x1c83=function(_0x524e24,_0x3afd1b){_0x524e24=_0x524e24-0x0;var _0x7edbaf=_0xc831[_0x524e24];return _0x7edbaf;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var logger=require(_0x1c83('0x1'))(_0x1c83('0x2'));var moment=require(_0x1c83('0x3'));var BPromise=require(_0x1c83('0x4'));var rp=require(_0x1c83('0x5'));var fs=require('fs');var path=require(_0x1c83('0x6'));var rimraf=require(_0x1c83('0x7'));var config=require(_0x1c83('0x8'));var attributes=require(_0x1c83('0x9'));module['exports']=function(_0x5682fb,_0x2f52ea){return _0x5682fb['define'](_0x1c83('0xa'),attributes,{'tableName':_0x1c83('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 06a0c6d..dcb1128 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 _0x01d5=['then','TeamVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','http','request'];(function(_0x27cc60,_0x4f0e0f){var _0x5508fb=function(_0x9d8259){while(--_0x9d8259){_0x27cc60['push'](_0x27cc60['shift']());}};_0x5508fb(++_0x4f0e0f);}(_0x01d5,0x10f));var _0x501d=function(_0x24277d,_0x3d8e28){_0x24277d=_0x24277d-0x0;var _0x2bd01c=_0x01d5[_0x24277d];return _0x2bd01c;};'use strict';var _=require(_0x501d('0x0'));var util=require(_0x501d('0x1'));var moment=require('moment');var BPromise=require(_0x501d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x501d('0x3'))['db'];var utils=require(_0x501d('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x501d('0x5'));var client=jayson[_0x501d('0x6')][_0x501d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x41a57f,_0x21ff2e,_0xeafff8){return new BPromise(function(_0x76f5c3,_0x2f5096){return client[_0x501d('0x8')](_0x41a57f,_0xeafff8)[_0x501d('0x9')](function(_0x3cb8fd){logger['info'](_0x501d('0xa'),_0x21ff2e,'request\x20sent');logger[_0x501d('0xb')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x21ff2e,_0x501d('0xc'),JSON[_0x501d('0xd')](_0x3cb8fd));if(_0x3cb8fd['error']){if(_0x3cb8fd[_0x501d('0xe')][_0x501d('0xf')]===0x1f4){logger['error'](_0x501d('0xa'),_0x21ff2e,_0x3cb8fd[_0x501d('0xe')][_0x501d('0x10')]);return _0x2f5096(_0x3cb8fd[_0x501d('0xe')][_0x501d('0x10')]);}logger[_0x501d('0xe')](_0x501d('0xa'),_0x21ff2e,_0x3cb8fd[_0x501d('0xe')]['message']);return _0x76f5c3(_0x3cb8fd[_0x501d('0xe')][_0x501d('0x10')]);}else{logger[_0x501d('0x11')](_0x501d('0xa'),_0x21ff2e,'request\x20sent');_0x76f5c3(_0x3cb8fd[_0x501d('0x12')][_0x501d('0x10')]);}})[_0x501d('0x13')](function(_0x4d4868){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x21ff2e,_0x4d4868);_0x2f5096(_0x4d4868);});});} \ No newline at end of file +var _0xd52d=['jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xbd7f64,_0x588e87){var _0x256016=function(_0x5ae79d){while(--_0x5ae79d){_0xbd7f64['push'](_0xbd7f64['shift']());}};_0x256016(++_0x588e87);}(_0xd52d,0x1c7));var _0xdd52=function(_0x5cc420,_0x29a67b){_0x5cc420=_0x5cc420-0x0;var _0x82f255=_0xd52d[_0x5cc420];return _0x82f255;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var moment=require(_0xdd52('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdd52('0x3'));var logger=require(_0xdd52('0x4'))(_0xdd52('0x5'));var config=require(_0xdd52('0x6'));var jayson=require(_0xdd52('0x7'));var client=jayson[_0xdd52('0x8')][_0xdd52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18d01d,_0x4ca1a2,_0x1b8b74){return new BPromise(function(_0x6ab1e3,_0x8a6170){return client[_0xdd52('0xa')](_0x18d01d,_0x1b8b74)[_0xdd52('0xb')](function(_0xb6616a){logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));logger[_0xdd52('0xf')](_0xdd52('0x10'),_0x4ca1a2,_0xdd52('0xe'),JSON[_0xdd52('0x11')](_0xb6616a));if(_0xb6616a['error']){if(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x13')]===0x1f4){logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);return _0x8a6170(_0xb6616a['error'][_0xdd52('0x14')]);}logger[_0xdd52('0x12')](_0xdd52('0xd'),_0x4ca1a2,_0xb6616a['error'][_0xdd52('0x14')]);return _0x6ab1e3(_0xb6616a[_0xdd52('0x12')][_0xdd52('0x14')]);}else{logger[_0xdd52('0xc')](_0xdd52('0xd'),_0x4ca1a2,_0xdd52('0xe'));_0x6ab1e3(_0xb6616a[_0xdd52('0x15')][_0xdd52('0x14')]);}})['catch'](function(_0x468c7a){logger['error'](_0xdd52('0xd'),_0x4ca1a2,_0x468c7a);_0x8a6170(_0x468c7a);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index deb833e..78b9c7c 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 _0x4efb=['../../components/interaction/service','./template.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x6e3cb3,_0x15636e){var _0x3879b0=function(_0x12aa65){while(--_0x12aa65){_0x6e3cb3['push'](_0x6e3cb3['shift']());}};_0x3879b0(++_0x15636e);}(_0x4efb,0xfa));var _0xb4ef=function(_0x19475f,_0x301709){_0x19475f=_0x19475f-0x0;var _0x37e9ed=_0x4efb[_0x19475f];return _0x37e9ed;};'use strict';var multer=require('multer');var util=require(_0xb4ef('0x0'));var path=require(_0xb4ef('0x1'));var timeout=require(_0xb4ef('0x2'));var express=require('express');var router=express[_0xb4ef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb4ef('0x4'));var interaction=require(_0xb4ef('0x5'));var config=require('../../config/environment');var controller=require(_0xb4ef('0x6'));router['get']('/',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0x8')]);router[_0xb4ef('0x9')](_0xb4ef('0xa'),auth[_0xb4ef('0x7')](),controller['show']);router[_0xb4ef('0xb')]('/',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0xc')]);router[_0xb4ef('0xd')](_0xb4ef('0xa'),auth[_0xb4ef('0x7')](),controller['update']);router[_0xb4ef('0xe')]('/:id',auth[_0xb4ef('0x7')](),controller[_0xb4ef('0xf')]);module[_0xb4ef('0x10')]=router; \ No newline at end of file +var _0xd386=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','put','update','delete'];(function(_0x12afec,_0x493b36){var _0x2dfe41=function(_0x40a150){while(--_0x40a150){_0x12afec['push'](_0x12afec['shift']());}};_0x2dfe41(++_0x493b36);}(_0xd386,0x10c));var _0x6d38=function(_0x86a91c,_0x4eb20c){_0x86a91c=_0x86a91c-0x0;var _0x899439=_0xd386[_0x86a91c];return _0x899439;};'use strict';var multer=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var path=require(_0x6d38('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d38('0x3'));var router=express[_0x6d38('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d38('0x5'));var interaction=require(_0x6d38('0x6'));var config=require(_0x6d38('0x7'));var controller=require(_0x6d38('0x8'));router['get']('/',auth[_0x6d38('0x9')](),controller[_0x6d38('0xa')]);router[_0x6d38('0xb')](_0x6d38('0xc'),auth[_0x6d38('0x9')](),controller[_0x6d38('0xd')]);router['post']('/',auth[_0x6d38('0x9')](),controller['create']);router[_0x6d38('0xe')]('/:id',auth[_0x6d38('0x9')](),controller[_0x6d38('0xf')]);router[_0x6d38('0x10')]('/:id',auth[_0x6d38('0x9')](),controller[_0x6d38('0x11')]);module[_0x6d38('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f00405a..d07c6e3 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 _0xad67=['STRING','TEXT','sequelize'];(function(_0x42fc7c,_0x3bf494){var _0x466300=function(_0x1e674b){while(--_0x1e674b){_0x42fc7c['push'](_0x42fc7c['shift']());}};_0x466300(++_0x3bf494);}(_0xad67,0xe3));var _0x7ad6=function(_0x40cff7,_0x5c3eb5){_0x40cff7=_0x40cff7-0x0;var _0x38006f=_0xad67[_0x40cff7];return _0x38006f;};'use strict';var Sequelize=require(_0x7ad6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ad6('0x1')]},'html':{'type':Sequelize[_0x7ad6('0x2')]}}; \ No newline at end of file +var _0xc2d8=['sequelize','STRING','TEXT'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xc2d8,0x1ec));var _0x8c2d=function(_0x1b5dc0,_0x11ec10){_0x1b5dc0=_0x1b5dc0-0x0;var _0x4b0980=_0xc2d8[_0x1b5dc0];return _0x4b0980;};'use strict';var Sequelize=require(_0x8c2d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8c2d('0x1')]},'html':{'type':Sequelize[_0x8c2d('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 9c4d570..87be5fa 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 _0x785f=['sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','keys','query','model','fields','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','filters','intersection','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','moment','mustache','util','path'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0x785f,0x1e6));var _0xf785=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x785f[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0xf785('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf785('0x1'));var rp=require('request-promise');var moment=require(_0xf785('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf785('0x3'));var util=require(_0xf785('0x4'));var path=require(_0xf785('0x5'));var sox=require(_0xf785('0x6'));var csv=require(_0xf785('0x7'));var ejs=require(_0xf785('0x8'));var fs=require('fs');var fs_extra=require(_0xf785('0x9'));var _=require(_0xf785('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf785('0xb'));var deskjs=require(_0xf785('0xc'));var toCsv=require(_0xf785('0x7'));var querystring=require(_0xf785('0xd'));var Papa=require(_0xf785('0xe'));var Redis=require(_0xf785('0xf'));var authService=require(_0xf785('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf785('0x11'))(_0xf785('0x12'));var utils=require(_0xf785('0x13'));var config=require(_0xf785('0x14'));var licenseUtil=require(_0xf785('0x15'));var db=require(_0xf785('0x16'))['db'];function respondWithStatusCode(_0x228b5f,_0x5a14b6){_0x5a14b6=_0x5a14b6||0xcc;return function(_0x32d62d){if(_0x32d62d){return _0x228b5f[_0xf785('0x17')](_0x5a14b6);}return _0x228b5f['status'](_0x5a14b6)['end']();};}function respondWithResult(_0x32ad13,_0x52785c){_0x52785c=_0x52785c||0xc8;return function(_0x332ef5){if(_0x332ef5){return _0x32ad13[_0xf785('0x18')](_0x52785c)[_0xf785('0x19')](_0x332ef5);}};}function respondWithFilteredResult(_0x3f2688,_0x80103d){return function(_0x413f6c){if(_0x413f6c){var _0x348285=typeof _0x80103d[_0xf785('0x1a')]===_0xf785('0x1b')&&typeof _0x80103d['limit']===_0xf785('0x1b');var _0x3e7a46=_0x413f6c[_0xf785('0x1c')];var _0x2508e2=_0x348285?0x0:_0x80103d[_0xf785('0x1a')];var _0x205ba4=_0x348285?_0x413f6c[_0xf785('0x1c')]:_0x80103d[_0xf785('0x1a')]+_0x80103d[_0xf785('0x1d')];var _0x43d08a;if(_0x205ba4>=_0x3e7a46){_0x205ba4=_0x3e7a46;_0x43d08a=0xc8;}else{_0x43d08a=0xce;}_0x3f2688['status'](_0x43d08a);return _0x3f2688[_0xf785('0x1e')]('Content-Range',_0x2508e2+'-'+_0x205ba4+'/'+_0x3e7a46)[_0xf785('0x19')](_0x413f6c);}return null;};}function patchUpdates(_0x1b6ed4){return function(_0x555185){try{jsonpatch[_0xf785('0x1f')](_0x555185,_0x1b6ed4,!![]);}catch(_0x46038c){return BPromise[_0xf785('0x20')](_0x46038c);}return _0x555185[_0xf785('0x21')]();};}function saveUpdates(_0x105239,_0x3ad7ce){return function(_0x4a254c){if(_0x4a254c){return _0x4a254c[_0xf785('0x22')](_0x105239)[_0xf785('0x23')](function(_0x2a1f0a){return _0x2a1f0a;});}return null;};}function removeEntity(_0x358a51,_0xa81a18){return function(_0x22cefc){if(_0x22cefc){return _0x22cefc[_0xf785('0x24')]()[_0xf785('0x23')](function(){var _0x5f327b=_0x22cefc['get']({'plain':!![]});var _0x5f1037='Templates';return db[_0xf785('0x25')][_0xf785('0x24')]({'where':{'type':_0x5f1037,'resourceId':_0x5f327b['id']}})['then'](function(){return _0x22cefc;});})[_0xf785('0x23')](function(){_0x358a51[_0xf785('0x18')](0xcc)[_0xf785('0x26')]();});}};}function handleEntityNotFound(_0x2c983d,_0x5a1aed){return function(_0x574922){if(!_0x574922){_0x2c983d[_0xf785('0x17')](0x194);}return _0x574922;};}function handleError(_0x19eed6,_0x172aac){_0x172aac=_0x172aac||0x1f4;return function(_0x94f5b4){logger[_0xf785('0x27')](_0x94f5b4[_0xf785('0x28')]);if(_0x94f5b4[_0xf785('0x29')]){delete _0x94f5b4[_0xf785('0x29')];}_0x19eed6[_0xf785('0x18')](_0x172aac)[_0xf785('0x2a')](_0x94f5b4);};}exports[_0xf785('0x2b')]=function(_0x261bd9,_0x3892a2){var _0x73aef3={},_0x459e1f={},_0x4b7832={'count':0x0,'rows':[]};var _0x4d2e95=_[_0xf785('0x2c')](db[_0xf785('0x2d')][_0xf785('0x2e')],function(_0x5b3b03){return{'name':_0x5b3b03[_0xf785('0x2f')],'type':_0x5b3b03[_0xf785('0x30')]['key']};});_0x459e1f['model']=_[_0xf785('0x2c')](_0x4d2e95,_0xf785('0x29'));_0x459e1f['query']=_[_0xf785('0x31')](_0x261bd9[_0xf785('0x32')]);_0x459e1f['filters']=_['intersection'](_0x459e1f[_0xf785('0x33')],_0x459e1f['query']);_0x73aef3['attributes']=_['intersection'](_0x459e1f[_0xf785('0x33')],qs[_0xf785('0x34')](_0x261bd9['query'][_0xf785('0x34')]));_0x73aef3[_0xf785('0x35')]=_0x73aef3[_0xf785('0x35')][_0xf785('0x36')]?_0x73aef3[_0xf785('0x35')]:_0x459e1f['model'];if(!_0x261bd9[_0xf785('0x32')]['hasOwnProperty']('nolimit')){_0x73aef3[_0xf785('0x1d')]=qs[_0xf785('0x1d')](_0x261bd9[_0xf785('0x32')]['limit']);_0x73aef3['offset']=qs[_0xf785('0x1a')](_0x261bd9[_0xf785('0x32')][_0xf785('0x1a')]);}_0x73aef3[_0xf785('0x37')]=qs[_0xf785('0x38')](_0x261bd9['query'][_0xf785('0x38')]);_0x73aef3['where']=qs['filters'](_[_0xf785('0x39')](_0x261bd9[_0xf785('0x32')],_0x459e1f['filters']),_0x4d2e95);if(_0x261bd9['query'][_0xf785('0x3a')]){_0x73aef3[_0xf785('0x3b')]=_[_0xf785('0x3c')](_0x73aef3[_0xf785('0x3b')],{'$or':_[_0xf785('0x2c')](_0x4d2e95,function(_0x4fe62e){if(_0x4fe62e[_0xf785('0x30')]!==_0xf785('0x3d')){var _0x165512={};_0x165512[_0x4fe62e[_0xf785('0x29')]]={'$like':'%'+_0x261bd9[_0xf785('0x32')][_0xf785('0x3a')]+'%'};return _0x165512;}})});}_0x73aef3=_[_0xf785('0x3c')]({},_0x73aef3,_0x261bd9[_0xf785('0x3e')]);var _0x36373f={'where':_0x73aef3[_0xf785('0x3b')]};return db[_0xf785('0x2d')][_0xf785('0x1c')](_0x36373f)['then'](function(_0x52d5f6){_0x4b7832[_0xf785('0x1c')]=_0x52d5f6;if(_0x261bd9[_0xf785('0x32')][_0xf785('0x3f')]){_0x73aef3['include']=[{'all':!![]}];}return db[_0xf785('0x2d')][_0xf785('0x40')](_0x73aef3);})['then'](function(_0x1d5f8d){_0x4b7832[_0xf785('0x41')]=_0x1d5f8d;return _0x4b7832;})[_0xf785('0x23')](respondWithFilteredResult(_0x3892a2,_0x73aef3))[_0xf785('0x42')](handleError(_0x3892a2,null));};exports[_0xf785('0x43')]=function(_0x3398e1,_0x35e0ca){var _0x27d8cd={'raw':!![],'where':{'id':_0x3398e1[_0xf785('0x44')]['id']}},_0x2b450e={};_0x2b450e['model']=_[_0xf785('0x31')](db[_0xf785('0x2d')][_0xf785('0x2e')]);_0x2b450e['query']=_[_0xf785('0x31')](_0x3398e1[_0xf785('0x32')]);_0x2b450e[_0xf785('0x45')]=_[_0xf785('0x46')](_0x2b450e[_0xf785('0x33')],_0x2b450e[_0xf785('0x32')]);_0x27d8cd[_0xf785('0x35')]=_[_0xf785('0x46')](_0x2b450e[_0xf785('0x33')],qs['fields'](_0x3398e1[_0xf785('0x32')][_0xf785('0x34')]));_0x27d8cd['attributes']=_0x27d8cd['attributes'][_0xf785('0x36')]?_0x27d8cd['attributes']:_0x2b450e[_0xf785('0x33')];if(_0x3398e1[_0xf785('0x32')][_0xf785('0x3f')]){_0x27d8cd['include']=[{'all':!![]}];}_0x27d8cd=_[_0xf785('0x3c')]({},_0x27d8cd,_0x3398e1[_0xf785('0x3e')]);return db[_0xf785('0x2d')][_0xf785('0x47')](_0x27d8cd)[_0xf785('0x23')](handleEntityNotFound(_0x35e0ca,null))['then'](respondWithResult(_0x35e0ca,null))[_0xf785('0x42')](handleError(_0x35e0ca,null));};exports['create']=function(_0x3d6d42,_0x24da93){return db[_0xf785('0x2d')]['create'](_0x3d6d42[_0xf785('0x48')],{})[_0xf785('0x23')](function(_0x484721){var _0x2e6f15=_0x3d6d42[_0xf785('0x49')][_0xf785('0x4a')]({'plain':!![]});if(!_0x2e6f15)throw new Error(_0xf785('0x4b'));if(_0x2e6f15[_0xf785('0x4c')]==='user'){var _0x5518c4=_0x484721[_0xf785('0x4a')]({'plain':!![]});var _0x1493c7=_0xf785('0x4d');return db[_0xf785('0x4e')][_0xf785('0x47')]({'where':{'name':_0x1493c7,'userProfileId':_0x2e6f15[_0xf785('0x4f')]},'raw':!![]})[_0xf785('0x23')](function(_0x3776a7){if(_0x3776a7&&_0x3776a7['autoAssociation']===0x0){return db['UserProfileResource'][_0xf785('0x50')]({'name':_0x5518c4['name'],'resourceId':_0x5518c4['id'],'type':_0x3776a7['name'],'sectionId':_0x3776a7['id']},{})[_0xf785('0x23')](function(){return _0x484721;});}else{return _0x484721;}})[_0xf785('0x42')](function(_0x4d146e){logger['error'](_0xf785('0x51'),_0x4d146e);throw _0x4d146e;});}return _0x484721;})['then'](respondWithResult(_0x24da93,0xc9))['catch'](handleError(_0x24da93,null));};exports[_0xf785('0x22')]=function(_0x27c099,_0x4a5a90){if(_0x27c099[_0xf785('0x48')]['id']){delete _0x27c099[_0xf785('0x48')]['id'];}return db['Template'][_0xf785('0x47')]({'where':{'id':_0x27c099['params']['id']}})['then'](handleEntityNotFound(_0x4a5a90,null))['then'](saveUpdates(_0x27c099[_0xf785('0x48')],null))['then'](respondWithResult(_0x4a5a90,null))[_0xf785('0x42')](handleError(_0x4a5a90,null));};exports[_0xf785('0x24')]=function(_0x3f29bb,_0x1c83e6){return db['Template'][_0xf785('0x47')]({'where':{'id':_0x3f29bb[_0xf785('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c83e6,null))[_0xf785('0x23')](removeEntity(_0x1c83e6,null))[_0xf785('0x42')](handleError(_0x1c83e6,null));}; \ No newline at end of file +var _0xeca0=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','Templates','UserProfileResource','then','error','stack','name','send','index','fieldName','type','key','map','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','Template','findAll','rows','catch','show','params','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x1a4d7f,_0x1c1d31){var _0x3b8213=function(_0x368ca4){while(--_0x368ca4){_0x1a4d7f['push'](_0x1a4d7f['shift']());}};_0x3b8213(++_0x1c1d31);}(_0xeca0,0x10e));var _0x0eca=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xeca0[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x0eca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0eca('0x1'));var rp=require(_0x0eca('0x2'));var moment=require(_0x0eca('0x3'));var BPromise=require(_0x0eca('0x4'));var Mustache=require(_0x0eca('0x5'));var util=require(_0x0eca('0x6'));var path=require(_0x0eca('0x7'));var sox=require(_0x0eca('0x8'));var csv=require(_0x0eca('0x9'));var ejs=require(_0x0eca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0eca('0xb'));var squel=require(_0x0eca('0xc'));var crypto=require(_0x0eca('0xd'));var jsforce=require(_0x0eca('0xe'));var deskjs=require(_0x0eca('0xf'));var toCsv=require(_0x0eca('0x9'));var querystring=require(_0x0eca('0x10'));var Papa=require(_0x0eca('0x11'));var Redis=require(_0x0eca('0x12'));var authService=require(_0x0eca('0x13'));var qs=require(_0x0eca('0x14'));var as=require(_0x0eca('0x15'));var hardwareService=require(_0x0eca('0x16'));var logger=require(_0x0eca('0x17'))(_0x0eca('0x18'));var utils=require(_0x0eca('0x19'));var config=require(_0x0eca('0x1a'));var licenseUtil=require(_0x0eca('0x1b'));var db=require(_0x0eca('0x1c'))['db'];function respondWithStatusCode(_0x1453f0,_0x4e214e){_0x4e214e=_0x4e214e||0xcc;return function(_0x55894d){if(_0x55894d){return _0x1453f0[_0x0eca('0x1d')](_0x4e214e);}return _0x1453f0[_0x0eca('0x1e')](_0x4e214e)[_0x0eca('0x1f')]();};}function respondWithResult(_0x3c9e27,_0x3bdf02){_0x3bdf02=_0x3bdf02||0xc8;return function(_0x222743){if(_0x222743){return _0x3c9e27['status'](_0x3bdf02)[_0x0eca('0x20')](_0x222743);}};}function respondWithFilteredResult(_0x449fdd,_0x2ea20c){return function(_0x1696d4){if(_0x1696d4){var _0x14dc11=typeof _0x2ea20c[_0x0eca('0x21')]===_0x0eca('0x22')&&typeof _0x2ea20c[_0x0eca('0x23')]===_0x0eca('0x22');var _0x57e2f1=_0x1696d4[_0x0eca('0x24')];var _0x30bb58=_0x14dc11?0x0:_0x2ea20c[_0x0eca('0x21')];var _0x12869d=_0x14dc11?_0x1696d4[_0x0eca('0x24')]:_0x2ea20c[_0x0eca('0x21')]+_0x2ea20c[_0x0eca('0x23')];var _0x54948d;if(_0x12869d>=_0x57e2f1){_0x12869d=_0x57e2f1;_0x54948d=0xc8;}else{_0x54948d=0xce;}_0x449fdd[_0x0eca('0x1e')](_0x54948d);return _0x449fdd[_0x0eca('0x25')](_0x0eca('0x26'),_0x30bb58+'-'+_0x12869d+'/'+_0x57e2f1)['json'](_0x1696d4);}return null;};}function patchUpdates(_0x31c224){return function(_0x103448){try{jsonpatch['apply'](_0x103448,_0x31c224,!![]);}catch(_0xfb1330){return BPromise['reject'](_0xfb1330);}return _0x103448[_0x0eca('0x27')]();};}function saveUpdates(_0x5d48ee,_0x4dd84e){return function(_0x558b9c){if(_0x558b9c){return _0x558b9c[_0x0eca('0x28')](_0x5d48ee)['then'](function(_0x48ee77){return _0x48ee77;});}return null;};}function removeEntity(_0x4b971d,_0x216bcc){return function(_0x2b2350){if(_0x2b2350){return _0x2b2350[_0x0eca('0x29')]()['then'](function(){var _0x259b4d=_0x2b2350['get']({'plain':!![]});var _0x4e3b9a=_0x0eca('0x2a');return db[_0x0eca('0x2b')][_0x0eca('0x29')]({'where':{'type':_0x4e3b9a,'resourceId':_0x259b4d['id']}})['then'](function(){return _0x2b2350;});})[_0x0eca('0x2c')](function(){_0x4b971d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14b9b7,_0x338c0f){return function(_0x41596f){if(!_0x41596f){_0x14b9b7[_0x0eca('0x1d')](0x194);}return _0x41596f;};}function handleError(_0x33562b,_0x49b6da){_0x49b6da=_0x49b6da||0x1f4;return function(_0x3048b2){logger[_0x0eca('0x2d')](_0x3048b2[_0x0eca('0x2e')]);if(_0x3048b2[_0x0eca('0x2f')]){delete _0x3048b2[_0x0eca('0x2f')];}_0x33562b[_0x0eca('0x1e')](_0x49b6da)[_0x0eca('0x30')](_0x3048b2);};}exports[_0x0eca('0x31')]=function(_0x59749e,_0xb470fe){var _0x5ae145={},_0x13919f={},_0x783f4e={'count':0x0,'rows':[]};var _0x805dd8=_['map'](db['Template']['rawAttributes'],function(_0x29c5ff){return{'name':_0x29c5ff[_0x0eca('0x32')],'type':_0x29c5ff[_0x0eca('0x33')][_0x0eca('0x34')]};});_0x13919f['model']=_[_0x0eca('0x35')](_0x805dd8,_0x0eca('0x2f'));_0x13919f['query']=_[_0x0eca('0x36')](_0x59749e['query']);_0x13919f['filters']=_[_0x0eca('0x37')](_0x13919f[_0x0eca('0x38')],_0x13919f[_0x0eca('0x39')]);_0x5ae145[_0x0eca('0x3a')]=_[_0x0eca('0x37')](_0x13919f[_0x0eca('0x38')],qs[_0x0eca('0x3b')](_0x59749e[_0x0eca('0x39')][_0x0eca('0x3b')]));_0x5ae145[_0x0eca('0x3a')]=_0x5ae145[_0x0eca('0x3a')][_0x0eca('0x3c')]?_0x5ae145[_0x0eca('0x3a')]:_0x13919f[_0x0eca('0x38')];if(!_0x59749e[_0x0eca('0x39')][_0x0eca('0x3d')]('nolimit')){_0x5ae145[_0x0eca('0x23')]=qs['limit'](_0x59749e[_0x0eca('0x39')][_0x0eca('0x23')]);_0x5ae145[_0x0eca('0x21')]=qs['offset'](_0x59749e['query'][_0x0eca('0x21')]);}_0x5ae145[_0x0eca('0x3e')]=qs['sort'](_0x59749e['query'][_0x0eca('0x3f')]);_0x5ae145[_0x0eca('0x40')]=qs[_0x0eca('0x41')](_[_0x0eca('0x42')](_0x59749e['query'],_0x13919f[_0x0eca('0x41')]),_0x805dd8);if(_0x59749e[_0x0eca('0x39')]['filter']){_0x5ae145[_0x0eca('0x40')]=_[_0x0eca('0x43')](_0x5ae145['where'],{'$or':_[_0x0eca('0x35')](_0x805dd8,function(_0x3910bc){if(_0x3910bc['type']!==_0x0eca('0x44')){var _0x7dac0b={};_0x7dac0b[_0x3910bc['name']]={'$like':'%'+_0x59749e[_0x0eca('0x39')][_0x0eca('0x45')]+'%'};return _0x7dac0b;}})});}_0x5ae145=_[_0x0eca('0x43')]({},_0x5ae145,_0x59749e[_0x0eca('0x46')]);var _0x38a930={'where':_0x5ae145[_0x0eca('0x40')]};return db['Template'][_0x0eca('0x24')](_0x38a930)[_0x0eca('0x2c')](function(_0x2a12a2){_0x783f4e[_0x0eca('0x24')]=_0x2a12a2;if(_0x59749e[_0x0eca('0x39')][_0x0eca('0x47')]){_0x5ae145['include']=[{'all':!![]}];}return db[_0x0eca('0x48')][_0x0eca('0x49')](_0x5ae145);})[_0x0eca('0x2c')](function(_0x307782){_0x783f4e[_0x0eca('0x4a')]=_0x307782;return _0x783f4e;})[_0x0eca('0x2c')](respondWithFilteredResult(_0xb470fe,_0x5ae145))[_0x0eca('0x4b')](handleError(_0xb470fe,null));};exports[_0x0eca('0x4c')]=function(_0x1f4b10,_0x296f6d){var _0x152180={'raw':!![],'where':{'id':_0x1f4b10[_0x0eca('0x4d')]['id']}},_0x434acd={};_0x434acd[_0x0eca('0x38')]=_[_0x0eca('0x36')](db[_0x0eca('0x48')][_0x0eca('0x4e')]);_0x434acd[_0x0eca('0x39')]=_[_0x0eca('0x36')](_0x1f4b10[_0x0eca('0x39')]);_0x434acd[_0x0eca('0x41')]=_['intersection'](_0x434acd[_0x0eca('0x38')],_0x434acd['query']);_0x152180[_0x0eca('0x3a')]=_[_0x0eca('0x37')](_0x434acd[_0x0eca('0x38')],qs[_0x0eca('0x3b')](_0x1f4b10[_0x0eca('0x39')][_0x0eca('0x3b')]));_0x152180[_0x0eca('0x3a')]=_0x152180[_0x0eca('0x3a')][_0x0eca('0x3c')]?_0x152180['attributes']:_0x434acd[_0x0eca('0x38')];if(_0x1f4b10[_0x0eca('0x39')][_0x0eca('0x47')]){_0x152180['include']=[{'all':!![]}];}_0x152180=_[_0x0eca('0x43')]({},_0x152180,_0x1f4b10['options']);return db[_0x0eca('0x48')][_0x0eca('0x4f')](_0x152180)[_0x0eca('0x2c')](handleEntityNotFound(_0x296f6d,null))['then'](respondWithResult(_0x296f6d,null))[_0x0eca('0x4b')](handleError(_0x296f6d,null));};exports['create']=function(_0x100ba7,_0x48d32f){return db[_0x0eca('0x48')][_0x0eca('0x50')](_0x100ba7['body'],{})[_0x0eca('0x2c')](function(_0x213e2d){var _0x1bb3bb=_0x100ba7['user'][_0x0eca('0x51')]({'plain':!![]});if(!_0x1bb3bb)throw new Error(_0x0eca('0x52'));if(_0x1bb3bb['role']===_0x0eca('0x53')){var _0x4bc849=_0x213e2d[_0x0eca('0x51')]({'plain':!![]});var _0x5508fe=_0x0eca('0x2a');return db[_0x0eca('0x54')][_0x0eca('0x4f')]({'where':{'name':_0x5508fe,'userProfileId':_0x1bb3bb[_0x0eca('0x55')]},'raw':!![]})[_0x0eca('0x2c')](function(_0x5a3a3a){if(_0x5a3a3a&&_0x5a3a3a[_0x0eca('0x56')]===0x0){return db[_0x0eca('0x2b')][_0x0eca('0x50')]({'name':_0x4bc849[_0x0eca('0x2f')],'resourceId':_0x4bc849['id'],'type':_0x5a3a3a[_0x0eca('0x2f')],'sectionId':_0x5a3a3a['id']},{})[_0x0eca('0x2c')](function(){return _0x213e2d;});}else{return _0x213e2d;}})[_0x0eca('0x4b')](function(_0x9d851e){logger[_0x0eca('0x2d')](_0x0eca('0x57'),_0x9d851e);throw _0x9d851e;});}return _0x213e2d;})[_0x0eca('0x2c')](respondWithResult(_0x48d32f,0xc9))[_0x0eca('0x4b')](handleError(_0x48d32f,null));};exports[_0x0eca('0x28')]=function(_0x47a432,_0x5f5245){if(_0x47a432[_0x0eca('0x58')]['id']){delete _0x47a432['body']['id'];}return db[_0x0eca('0x48')]['find']({'where':{'id':_0x47a432[_0x0eca('0x4d')]['id']}})[_0x0eca('0x2c')](handleEntityNotFound(_0x5f5245,null))[_0x0eca('0x2c')](saveUpdates(_0x47a432[_0x0eca('0x58')],null))['then'](respondWithResult(_0x5f5245,null))['catch'](handleError(_0x5f5245,null));};exports['destroy']=function(_0xf6c898,_0x14d93e){return db[_0x0eca('0x48')][_0x0eca('0x4f')]({'where':{'id':_0xf6c898[_0x0eca('0x4d')]['id']}})[_0x0eca('0x2c')](handleEntityNotFound(_0x14d93e,null))[_0x0eca('0x2c')](removeEntity(_0x14d93e,null))[_0x0eca('0x4b')](handleError(_0x14d93e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5dbbb16..644fd63 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 _0xc9cb=['define','tools_templates','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports'];(function(_0xe1b14b,_0x275799){var _0x21da52=function(_0x5232a7){while(--_0x5232a7){_0xe1b14b['push'](_0xe1b14b['shift']());}};_0x21da52(++_0x275799);}(_0xc9cb,0x120));var _0xbc9c=function(_0x106b05,_0xe96d94){_0x106b05=_0x106b05-0x0;var _0x5068b4=_0xc9cb[_0x106b05];return _0x5068b4;};'use strict';var _=require(_0xbc9c('0x0'));var util=require(_0xbc9c('0x1'));var logger=require(_0xbc9c('0x2'))(_0xbc9c('0x3'));var moment=require(_0xbc9c('0x4'));var BPromise=require('bluebird');var rp=require(_0xbc9c('0x5'));var fs=require('fs');var path=require(_0xbc9c('0x6'));var rimraf=require('rimraf');var config=require(_0xbc9c('0x7'));var attributes=require('./template.attributes');module[_0xbc9c('0x8')]=function(_0x4d29de,_0x19a548){return _0x4d29de[_0xbc9c('0x9')]('Template',attributes,{'tableName':_0xbc9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9322=['api','moment','bluebird','request-promise','./template.attributes','exports','define','Template','tools_templates','../../config/logger'];(function(_0x4cafb1,_0x2954df){var _0x5d0869=function(_0x43667a){while(--_0x43667a){_0x4cafb1['push'](_0x4cafb1['shift']());}};_0x5d0869(++_0x2954df);}(_0x9322,0x17b));var _0x2932=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9322[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2932('0x0'))(_0x2932('0x1'));var moment=require(_0x2932('0x2'));var BPromise=require(_0x2932('0x3'));var rp=require(_0x2932('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2932('0x5'));module[_0x2932('0x6')]=function(_0x2df9e4,_0x115069){return _0x2df9e4[_0x2932('0x7')](_0x2932('0x8'),attributes,{'tableName':_0x2932('0x9'),'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 3ed904e..eb64d61 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 _0x498b=['error','code','message','GetTemplate','Template','options','raw','where','attributes','include','map','model','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1dfa67,_0x5ab12a){var _0x2e7f5a=function(_0x2c5597){while(--_0x2c5597){_0x1dfa67['push'](_0x1dfa67['shift']());}};_0x2e7f5a(++_0x5ab12a);}(_0x498b,0x6d));var _0xb498=function(_0x3f272c,_0x46038b){_0x3f272c=_0x3f272c-0x0;var _0x3298e1=_0x498b[_0x3f272c];return _0x3298e1;};'use strict';var _=require(_0xb498('0x0'));var util=require('util');var moment=require(_0xb498('0x1'));var BPromise=require(_0xb498('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb498('0x3'));var db=require(_0xb498('0x4'))['db'];var utils=require(_0xb498('0x5'));var logger=require(_0xb498('0x6'))(_0xb498('0x7'));var config=require(_0xb498('0x8'));var jayson=require(_0xb498('0x9'));var client=jayson[_0xb498('0xa')][_0xb498('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52ef3b,_0x35449a,_0xc531f9){return new BPromise(function(_0x222953,_0x56bc3b){return client[_0xb498('0xc')](_0x52ef3b,_0xc531f9)[_0xb498('0xd')](function(_0x23f99e){logger[_0xb498('0xe')](_0xb498('0xf'),_0x35449a,_0xb498('0x10'));logger[_0xb498('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x35449a,_0xb498('0x10'),JSON[_0xb498('0x12')](_0x23f99e));if(_0x23f99e['error']){if(_0x23f99e[_0xb498('0x13')][_0xb498('0x14')]===0x1f4){logger['error'](_0xb498('0xf'),_0x35449a,_0x23f99e[_0xb498('0x13')][_0xb498('0x15')]);return _0x56bc3b(_0x23f99e['error'][_0xb498('0x15')]);}logger[_0xb498('0x13')](_0xb498('0xf'),_0x35449a,_0x23f99e['error'][_0xb498('0x15')]);return _0x222953(_0x23f99e[_0xb498('0x13')][_0xb498('0x15')]);}else{logger[_0xb498('0xe')]('Template,\x20%s,\x20%s',_0x35449a,'request\x20sent');_0x222953(_0x23f99e['result'][_0xb498('0x15')]);}})['catch'](function(_0xcce789){logger['error'](_0xb498('0xf'),_0x35449a,_0xcce789);_0x56bc3b(_0xcce789);});});}exports[_0xb498('0x16')]=function(_0x39a010){var _0x172272=this;return new Promise(function(_0x4c5f39,_0x2ffdd7){return db[_0xb498('0x17')]['findAll']({'raw':_0x39a010[_0xb498('0x18')]?_0x39a010[_0xb498('0x18')][_0xb498('0x19')]===undefined?!![]:![]:!![],'where':_0x39a010[_0xb498('0x18')]?_0x39a010[_0xb498('0x18')][_0xb498('0x1a')]||null:null,'attributes':_0x39a010['options']?_0x39a010[_0xb498('0x18')][_0xb498('0x1b')]||null:null,'limit':_0x39a010['options']?_0x39a010[_0xb498('0x18')]['limit']||null:null,'include':_0x39a010[_0xb498('0x18')]?_0x39a010['options'][_0xb498('0x1c')]?_[_0xb498('0x1d')](_0x39a010[_0xb498('0x18')][_0xb498('0x1c')],function(_0x1e3613){return{'model':db[_0x1e3613[_0xb498('0x1e')]],'as':_0x1e3613['as'],'attributes':_0x1e3613['attributes'],'include':_0x1e3613[_0xb498('0x1c')]?_[_0xb498('0x1d')](_0x1e3613['include'],function(_0x58355e){return{'model':db[_0x58355e[_0xb498('0x1e')]],'as':_0x58355e['as'],'attributes':_0x58355e['attributes'],'include':_0x58355e[_0xb498('0x1c')]?_[_0xb498('0x1d')](_0x58355e['include'],function(_0x14d67d){return{'model':db[_0x14d67d[_0xb498('0x1e')]],'as':_0x14d67d['as'],'attributes':_0x14d67d[_0xb498('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf499f8){logger['info'](_0xb498('0x16'),_0x39a010);logger[_0xb498('0x11')](_0xb498('0x16'),_0x39a010,JSON[_0xb498('0x12')](_0xf499f8));_0x4c5f39(_0xf499f8);})[_0xb498('0x1f')](function(_0x1cfce9){logger['error'](_0xb498('0x16'),_0x1cfce9[_0xb498('0x15')],_0x39a010);_0x2ffdd7(_0x172272[_0xb498('0x13')](0x1f4,_0x1cfce9[_0xb498('0x15')]));});});}; \ No newline at end of file +var _0x122d=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','options','raw','where','attributes','limit','include','model','map','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x122d,0x1ab));var _0xd122=function(_0x348e46,_0x5187dc){_0x348e46=_0x348e46-0x0;var _0x58b74f=_0x122d[_0x348e46];return _0x58b74f;};'use strict';var _=require(_0xd122('0x0'));var util=require(_0xd122('0x1'));var moment=require(_0xd122('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd122('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd122('0x4'));var logger=require(_0xd122('0x5'))(_0xd122('0x6'));var config=require(_0xd122('0x7'));var jayson=require(_0xd122('0x8'));var client=jayson[_0xd122('0x9')][_0xd122('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46f718,_0x1b3618,_0x4531e6){return new BPromise(function(_0x4ea200,_0x464548){return client[_0xd122('0xb')](_0x46f718,_0x4531e6)[_0xd122('0xc')](function(_0x23e74a){logger[_0xd122('0xd')](_0xd122('0xe'),_0x1b3618,_0xd122('0xf'));logger[_0xd122('0x10')](_0xd122('0x11'),_0x1b3618,_0xd122('0xf'),JSON[_0xd122('0x12')](_0x23e74a));if(_0x23e74a[_0xd122('0x13')]){if(_0x23e74a[_0xd122('0x13')]['code']===0x1f4){logger['error'](_0xd122('0xe'),_0x1b3618,_0x23e74a[_0xd122('0x13')][_0xd122('0x14')]);return _0x464548(_0x23e74a[_0xd122('0x13')]['message']);}logger['error'](_0xd122('0xe'),_0x1b3618,_0x23e74a[_0xd122('0x13')][_0xd122('0x14')]);return _0x4ea200(_0x23e74a[_0xd122('0x13')]['message']);}else{logger[_0xd122('0xd')]('Template,\x20%s,\x20%s',_0x1b3618,'request\x20sent');_0x4ea200(_0x23e74a[_0xd122('0x15')][_0xd122('0x14')]);}})[_0xd122('0x16')](function(_0x1e6e32){logger[_0xd122('0x13')]('Template,\x20%s,\x20%s',_0x1b3618,_0x1e6e32);_0x464548(_0x1e6e32);});});}exports[_0xd122('0x17')]=function(_0x3cc9ad){var _0x21076f=this;return new Promise(function(_0x41165c,_0x5e2c35){return db[_0xd122('0x18')]['findAll']({'raw':_0x3cc9ad[_0xd122('0x19')]?_0x3cc9ad[_0xd122('0x19')][_0xd122('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cc9ad[_0xd122('0x19')]?_0x3cc9ad[_0xd122('0x19')][_0xd122('0x1b')]||null:null,'attributes':_0x3cc9ad[_0xd122('0x19')]?_0x3cc9ad['options'][_0xd122('0x1c')]||null:null,'limit':_0x3cc9ad[_0xd122('0x19')]?_0x3cc9ad[_0xd122('0x19')][_0xd122('0x1d')]||null:null,'include':_0x3cc9ad[_0xd122('0x19')]?_0x3cc9ad[_0xd122('0x19')][_0xd122('0x1e')]?_['map'](_0x3cc9ad[_0xd122('0x19')]['include'],function(_0x261e75){return{'model':db[_0x261e75[_0xd122('0x1f')]],'as':_0x261e75['as'],'attributes':_0x261e75['attributes'],'include':_0x261e75['include']?_['map'](_0x261e75[_0xd122('0x1e')],function(_0x359c91){return{'model':db[_0x359c91[_0xd122('0x1f')]],'as':_0x359c91['as'],'attributes':_0x359c91[_0xd122('0x1c')],'include':_0x359c91['include']?_[_0xd122('0x20')](_0x359c91[_0xd122('0x1e')],function(_0x534377){return{'model':db[_0x534377[_0xd122('0x1f')]],'as':_0x534377['as'],'attributes':_0x534377[_0xd122('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd122('0xc')](function(_0x51889e){logger[_0xd122('0xd')]('GetTemplate',_0x3cc9ad);logger[_0xd122('0x10')](_0xd122('0x17'),_0x3cc9ad,JSON[_0xd122('0x12')](_0x51889e));_0x41165c(_0x51889e);})['catch'](function(_0x152b76){logger[_0xd122('0x13')](_0xd122('0x17'),_0x152b76[_0xd122('0x14')],_0x3cc9ad);_0x5e2c35(_0x21076f[_0xd122('0x13')](0x1f4,_0x152b76[_0xd122('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d2c4ca3..5ac9b22 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 _0x0d98=['addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions','post','addAllCondition'];(function(_0x1ebaae,_0x270f11){var _0x53b153=function(_0x138c71){while(--_0x138c71){_0x1ebaae['push'](_0x1ebaae['shift']());}};_0x53b153(++_0x270f11);}(_0x0d98,0x149));var _0x80d9=function(_0x5289bf,_0xffa15){_0x5289bf=_0x5289bf-0x0;var _0x23546c=_0x0d98[_0x5289bf];return _0x23546c;};'use strict';var multer=require(_0x80d9('0x0'));var util=require(_0x80d9('0x1'));var path=require(_0x80d9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x80d9('0x3'));var auth=require(_0x80d9('0x4'));var interaction=require(_0x80d9('0x5'));var config=require(_0x80d9('0x6'));var controller=require('./trigger.controller');router[_0x80d9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x80d9('0x8'),auth[_0x80d9('0x9')](),controller['show']);router['get'](_0x80d9('0xa'),auth[_0x80d9('0x9')](),controller['getAllConditions']);router['get'](_0x80d9('0xb'),auth[_0x80d9('0x9')](),controller['getAnyConditions']);router[_0x80d9('0x7')](_0x80d9('0xc'),auth[_0x80d9('0x9')](),controller[_0x80d9('0xd')]);router[_0x80d9('0xe')]('/',auth[_0x80d9('0x9')](),controller['create']);router[_0x80d9('0xe')](_0x80d9('0xa'),auth['isAuthenticated'](),controller[_0x80d9('0xf')]);router[_0x80d9('0xe')](_0x80d9('0xb'),auth['isAuthenticated'](),controller[_0x80d9('0x10')]);router['post'](_0x80d9('0xc'),auth[_0x80d9('0x9')](),controller[_0x80d9('0x11')]);router[_0x80d9('0x12')]('/:id',auth[_0x80d9('0x9')](),controller[_0x80d9('0x13')]);router[_0x80d9('0x14')](_0x80d9('0x8'),auth[_0x80d9('0x9')](),controller[_0x80d9('0x15')]);module[_0x80d9('0x16')]=router; \ No newline at end of file +var _0x7906=['/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','update','destroy','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x7906,0x15d));var _0x6790=function(_0x42d410,_0x10e719){_0x42d410=_0x42d410-0x0;var _0x933264=_0x7906[_0x42d410];return _0x933264;};'use strict';var multer=require(_0x6790('0x0'));var util=require(_0x6790('0x1'));var path=require(_0x6790('0x2'));var timeout=require('connect-timeout');var express=require(_0x6790('0x3'));var router=express['Router']();var fs_extra=require(_0x6790('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6790('0x5'));var config=require(_0x6790('0x6'));var controller=require(_0x6790('0x7'));router[_0x6790('0x8')]('/',auth[_0x6790('0x9')](),controller[_0x6790('0xa')]);router[_0x6790('0x8')](_0x6790('0xb'),auth[_0x6790('0x9')](),controller[_0x6790('0xc')]);router[_0x6790('0x8')](_0x6790('0xd'),auth[_0x6790('0x9')](),controller[_0x6790('0xe')]);router['get'](_0x6790('0xf'),auth[_0x6790('0x9')](),controller['getAnyConditions']);router[_0x6790('0x8')](_0x6790('0x10'),auth[_0x6790('0x9')](),controller[_0x6790('0x11')]);router[_0x6790('0x12')]('/',auth['isAuthenticated'](),controller[_0x6790('0x13')]);router[_0x6790('0x12')](_0x6790('0xd'),auth['isAuthenticated'](),controller[_0x6790('0x14')]);router['post'](_0x6790('0xf'),auth['isAuthenticated'](),controller[_0x6790('0x15')]);router['post'](_0x6790('0x10'),auth[_0x6790('0x9')](),controller[_0x6790('0x16')]);router[_0x6790('0x17')](_0x6790('0xb'),auth['isAuthenticated'](),controller[_0x6790('0x18')]);router['delete'](_0x6790('0xb'),auth['isAuthenticated'](),controller[_0x6790('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 4706851..a063848 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 _0xa949=['STRING','BOOLEAN','sequelize','exports'];(function(_0x25ad66,_0x46e4dc){var _0x141bc4=function(_0x3a7f8e){while(--_0x3a7f8e){_0x25ad66['push'](_0x25ad66['shift']());}};_0x141bc4(++_0x46e4dc);}(_0xa949,0x1ea));var _0x9a94=function(_0x38fc8a,_0x49359a){_0x38fc8a=_0x38fc8a-0x0;var _0x7993c5=_0xa949[_0x38fc8a];return _0x7993c5;};'use strict';var Sequelize=require(_0x9a94('0x0'));module[_0x9a94('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a94('0x2')]},'description':{'type':Sequelize[_0x9a94('0x2')]},'status':{'type':Sequelize[_0x9a94('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xdbcf=['sequelize','STRING','BOOLEAN'];(function(_0x5674e0,_0x4b021f){var _0x1c093a=function(_0x4a4a37){while(--_0x4a4a37){_0x5674e0['push'](_0x5674e0['shift']());}};_0x1c093a(++_0x4b021f);}(_0xdbcf,0x72));var _0xfdbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdbcf[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfdbc('0x0'));module['exports']={'name':{'type':Sequelize[_0xfdbc('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfdbc('0x1')]},'status':{'type':Sequelize[_0xfdbc('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 0153305..8b5c2af 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 _0xdefb=['autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','catch','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId'];(function(_0x2261cb,_0x501cf5){var _0x47da80=function(_0x487183){while(--_0x487183){_0x2261cb['push'](_0x2261cb['shift']());}};_0x47da80(++_0x501cf5);}(_0xdefb,0xc2));var _0xbdef=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0xdefb[_0x86c6cb];return _0x1b1592;};'use strict';var emlformat=require(_0xbdef('0x0'));var rimraf=require(_0xbdef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdef('0x2'));var rp=require(_0xbdef('0x3'));var moment=require(_0xbdef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbdef('0x5'));var util=require('util');var path=require(_0xbdef('0x6'));var sox=require(_0xbdef('0x7'));var csv=require(_0xbdef('0x8'));var ejs=require(_0xbdef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdef('0xa'));var squel=require(_0xbdef('0xb'));var crypto=require(_0xbdef('0xc'));var jsforce=require(_0xbdef('0xd'));var deskjs=require(_0xbdef('0xe'));var toCsv=require(_0xbdef('0x8'));var querystring=require(_0xbdef('0xf'));var Papa=require(_0xbdef('0x10'));var Redis=require('ioredis');var authService=require(_0xbdef('0x11'));var qs=require(_0xbdef('0x12'));var as=require(_0xbdef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdef('0x14'))(_0xbdef('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbdef('0x16'));var db=require(_0xbdef('0x17'))['db'];function respondWithStatusCode(_0x4ebbe0,_0x43fcb6){_0x43fcb6=_0x43fcb6||0xcc;return function(_0x5f06ab){if(_0x5f06ab){return _0x4ebbe0[_0xbdef('0x18')](_0x43fcb6);}return _0x4ebbe0[_0xbdef('0x19')](_0x43fcb6)[_0xbdef('0x1a')]();};}function respondWithResult(_0x14b003,_0x10884b){_0x10884b=_0x10884b||0xc8;return function(_0x196eab){if(_0x196eab){return _0x14b003['status'](_0x10884b)[_0xbdef('0x1b')](_0x196eab);}};}function respondWithFilteredResult(_0x1905ce,_0x5b708b){return function(_0x7cb423){if(_0x7cb423){var _0x26dd5a=typeof _0x5b708b[_0xbdef('0x1c')]===_0xbdef('0x1d')&&typeof _0x5b708b[_0xbdef('0x1e')]===_0xbdef('0x1d');var _0x5b0a79=_0x7cb423['count'];var _0x4dd6a1=_0x26dd5a?0x0:_0x5b708b[_0xbdef('0x1c')];var _0x531d9c=_0x26dd5a?_0x7cb423[_0xbdef('0x1f')]:_0x5b708b[_0xbdef('0x1c')]+_0x5b708b[_0xbdef('0x1e')];var _0x4a1328;if(_0x531d9c>=_0x5b0a79){_0x531d9c=_0x5b0a79;_0x4a1328=0xc8;}else{_0x4a1328=0xce;}_0x1905ce[_0xbdef('0x19')](_0x4a1328);return _0x1905ce[_0xbdef('0x20')](_0xbdef('0x21'),_0x4dd6a1+'-'+_0x531d9c+'/'+_0x5b0a79)[_0xbdef('0x1b')](_0x7cb423);}return null;};}function patchUpdates(_0x52639f){return function(_0x4ee479){try{jsonpatch['apply'](_0x4ee479,_0x52639f,!![]);}catch(_0xd02081){return BPromise['reject'](_0xd02081);}return _0x4ee479[_0xbdef('0x22')]();};}function saveUpdates(_0x4f407f,_0x479d8c){return function(_0x4e3624){if(_0x4e3624){return _0x4e3624['update'](_0x4f407f)['then'](function(_0x4a1def){return _0x4a1def;});}return null;};}function removeEntity(_0x2752ab,_0x55bb79){return function(_0x597fe0){if(_0x597fe0){return _0x597fe0['destroy']()[_0xbdef('0x23')](function(){var _0x26ab6b=_0x597fe0[_0xbdef('0x24')]({'plain':!![]});var _0x48625a='Triggers';return db[_0xbdef('0x25')][_0xbdef('0x26')]({'where':{'type':_0x48625a,'resourceId':_0x26ab6b['id']}})[_0xbdef('0x23')](function(){return _0x597fe0;});})[_0xbdef('0x23')](function(){_0x2752ab[_0xbdef('0x19')](0xcc)[_0xbdef('0x1a')]();});}};}function handleEntityNotFound(_0x596db8,_0x4429b9){return function(_0x58d6d4){if(!_0x58d6d4){_0x596db8[_0xbdef('0x18')](0x194);}return _0x58d6d4;};}function handleError(_0x3110ba,_0xc679af){_0xc679af=_0xc679af||0x1f4;return function(_0xec1421){logger[_0xbdef('0x27')](_0xec1421[_0xbdef('0x28')]);if(_0xec1421[_0xbdef('0x29')]){delete _0xec1421['name'];}_0x3110ba[_0xbdef('0x19')](_0xc679af)[_0xbdef('0x2a')](_0xec1421);};}exports[_0xbdef('0x2b')]=function(_0x57f2c5,_0x103679){var _0xe4ca3e={},_0x3ce04a={},_0x57cce3={'count':0x0,'rows':[]};var _0x3ca9ff=_[_0xbdef('0x2c')](db[_0xbdef('0x2d')][_0xbdef('0x2e')],function(_0x236367){return{'name':_0x236367[_0xbdef('0x2f')],'type':_0x236367['type'][_0xbdef('0x30')]};});_0x3ce04a[_0xbdef('0x31')]=_[_0xbdef('0x2c')](_0x3ca9ff,_0xbdef('0x29'));_0x3ce04a[_0xbdef('0x32')]=_[_0xbdef('0x33')](_0x57f2c5[_0xbdef('0x32')]);_0x3ce04a[_0xbdef('0x34')]=_[_0xbdef('0x35')](_0x3ce04a[_0xbdef('0x31')],_0x3ce04a[_0xbdef('0x32')]);_0xe4ca3e[_0xbdef('0x36')]=_['intersection'](_0x3ce04a[_0xbdef('0x31')],qs[_0xbdef('0x37')](_0x57f2c5[_0xbdef('0x32')][_0xbdef('0x37')]));_0xe4ca3e['attributes']=_0xe4ca3e[_0xbdef('0x36')]['length']?_0xe4ca3e[_0xbdef('0x36')]:_0x3ce04a[_0xbdef('0x31')];if(!_0x57f2c5[_0xbdef('0x32')][_0xbdef('0x38')](_0xbdef('0x39'))){_0xe4ca3e[_0xbdef('0x1e')]=qs[_0xbdef('0x1e')](_0x57f2c5['query']['limit']);_0xe4ca3e[_0xbdef('0x1c')]=qs['offset'](_0x57f2c5[_0xbdef('0x32')]['offset']);}_0xe4ca3e[_0xbdef('0x3a')]=qs[_0xbdef('0x3b')](_0x57f2c5[_0xbdef('0x32')][_0xbdef('0x3b')]);_0xe4ca3e[_0xbdef('0x3c')]=qs['filters'](_[_0xbdef('0x3d')](_0x57f2c5[_0xbdef('0x32')],_0x3ce04a[_0xbdef('0x34')]),_0x3ca9ff);if(_0x57f2c5[_0xbdef('0x32')][_0xbdef('0x3e')]){_0xe4ca3e[_0xbdef('0x3c')]=_[_0xbdef('0x3f')](_0xe4ca3e[_0xbdef('0x3c')],{'$or':_['map'](_0x3ca9ff,function(_0x398cb0){if(_0x398cb0[_0xbdef('0x40')]!=='VIRTUAL'){var _0x454ee4={};_0x454ee4[_0x398cb0[_0xbdef('0x29')]]={'$like':'%'+_0x57f2c5['query']['filter']+'%'};return _0x454ee4;}})});}_0xe4ca3e=_[_0xbdef('0x3f')]({},_0xe4ca3e,_0x57f2c5['options']);var _0x2a980b={'where':_0xe4ca3e[_0xbdef('0x3c')]};return db['Trigger'][_0xbdef('0x1f')](_0x2a980b)[_0xbdef('0x23')](function(_0x4365d9){_0x57cce3[_0xbdef('0x1f')]=_0x4365d9;if(_0x57f2c5[_0xbdef('0x32')][_0xbdef('0x41')]){_0xe4ca3e[_0xbdef('0x42')]=[{'all':!![]}];}return db[_0xbdef('0x2d')][_0xbdef('0x43')](_0xe4ca3e);})[_0xbdef('0x23')](function(_0x2bba07){_0x57cce3['rows']=_0x2bba07;return _0x57cce3;})[_0xbdef('0x23')](respondWithFilteredResult(_0x103679,_0xe4ca3e))[_0xbdef('0x44')](handleError(_0x103679,null));};exports['show']=function(_0x36fdf0,_0x526739){var _0x128015={'raw':![],'where':{'id':_0x36fdf0[_0xbdef('0x45')]['id']}},_0x11d1a3={};_0x11d1a3[_0xbdef('0x31')]=_['keys'](db['Trigger'][_0xbdef('0x2e')]);_0x11d1a3[_0xbdef('0x32')]=_[_0xbdef('0x33')](_0x36fdf0[_0xbdef('0x32')]);_0x11d1a3[_0xbdef('0x34')]=_[_0xbdef('0x35')](_0x11d1a3[_0xbdef('0x31')],_0x11d1a3['query']);_0x128015['attributes']=_[_0xbdef('0x35')](_0x11d1a3[_0xbdef('0x31')],qs[_0xbdef('0x37')](_0x36fdf0[_0xbdef('0x32')]['fields']));_0x128015['attributes']=_0x128015[_0xbdef('0x36')][_0xbdef('0x46')]?_0x128015['attributes']:_0x11d1a3[_0xbdef('0x31')];if(_0x36fdf0['query']['includeAll']){_0x128015[_0xbdef('0x42')]=[{'all':!![]}];}_0x128015=_[_0xbdef('0x3f')]({},_0x128015,_0x36fdf0[_0xbdef('0x47')]);return db[_0xbdef('0x2d')][_0xbdef('0x48')](_0x128015)[_0xbdef('0x23')](handleEntityNotFound(_0x526739,null))['then'](respondWithResult(_0x526739,null))[_0xbdef('0x44')](handleError(_0x526739,null));};exports['create']=function(_0x187475,_0x4eeec3){return db[_0xbdef('0x2d')][_0xbdef('0x49')](_0x187475[_0xbdef('0x4a')],{})[_0xbdef('0x23')](function(_0x326dfa){var _0x2ee076=_0x187475[_0xbdef('0x4b')][_0xbdef('0x24')]({'plain':!![]});if(!_0x2ee076)throw new Error(_0xbdef('0x4c'));if(_0x2ee076['role']===_0xbdef('0x4b')){var _0x436e0e=_0x326dfa[_0xbdef('0x24')]({'plain':!![]});var _0x3ff4c8='Triggers';return db[_0xbdef('0x4d')]['find']({'where':{'name':_0x3ff4c8,'userProfileId':_0x2ee076[_0xbdef('0x4e')]},'raw':!![]})['then'](function(_0x180c55){if(_0x180c55&&_0x180c55[_0xbdef('0x4f')]===0x0){return db['UserProfileResource'][_0xbdef('0x49')]({'name':_0x436e0e['name'],'resourceId':_0x436e0e['id'],'type':_0x180c55[_0xbdef('0x29')],'sectionId':_0x180c55['id']},{})[_0xbdef('0x23')](function(){return _0x326dfa;});}else{return _0x326dfa;}})[_0xbdef('0x44')](function(_0x40c7d6){logger[_0xbdef('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40c7d6);throw _0x40c7d6;});}return _0x326dfa;})[_0xbdef('0x23')](respondWithResult(_0x4eeec3,0xc9))[_0xbdef('0x44')](handleError(_0x4eeec3,null));};exports['update']=function(_0x1270ef,_0x5f5303){if(_0x1270ef[_0xbdef('0x4a')]['id']){delete _0x1270ef['body']['id'];}return db[_0xbdef('0x2d')][_0xbdef('0x48')]({'where':{'id':_0x1270ef[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x5f5303,null))[_0xbdef('0x23')](saveUpdates(_0x1270ef[_0xbdef('0x4a')],null))[_0xbdef('0x23')](respondWithResult(_0x5f5303,null))[_0xbdef('0x44')](handleError(_0x5f5303,null));};exports['destroy']=function(_0x2bcede,_0x38dbf7){return db[_0xbdef('0x2d')]['find']({'where':{'id':_0x2bcede[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x38dbf7,null))[_0xbdef('0x23')](removeEntity(_0x38dbf7,null))['catch'](handleError(_0x38dbf7,null));};exports[_0xbdef('0x50')]=function(_0x11b4fe,_0x205b9a,_0x3c9875){if(_0x11b4fe[_0xbdef('0x4a')]['id']){delete _0x11b4fe[_0xbdef('0x4a')]['id'];}return db[_0xbdef('0x2d')][_0xbdef('0x48')]({'where':{'id':_0x11b4fe[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x205b9a,null))['then'](function(_0x23206c){if(_0x23206c){_0x11b4fe[_0xbdef('0x4a')][_0xbdef('0x51')]=_0x23206c['id'];return db[_0xbdef('0x52')]['create'](_0x11b4fe[_0xbdef('0x4a')]);}})[_0xbdef('0x23')](respondWithResult(_0x205b9a,null))['catch'](handleError(_0x205b9a,null));};exports[_0xbdef('0x53')]=function(_0x595f7c,_0x4dc742,_0x12f131){if(_0x595f7c[_0xbdef('0x4a')]['id']){delete _0x595f7c[_0xbdef('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x595f7c[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x4dc742,null))[_0xbdef('0x23')](function(_0x3edf7f){if(_0x3edf7f){_0x595f7c['body'][_0xbdef('0x54')]=_0x3edf7f['id'];return db['Condition']['create'](_0x595f7c[_0xbdef('0x4a')]);}})[_0xbdef('0x23')](respondWithResult(_0x4dc742,null))['catch'](handleError(_0x4dc742,null));};exports[_0xbdef('0x55')]=function(_0x4b7cd7,_0x11deb8,_0x365961){var _0x2e2aea={};var _0x50b1c7={};var _0x138b72;var _0x4577a1;return db[_0xbdef('0x2d')][_0xbdef('0x56')]({'where':{'id':_0x4b7cd7[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x11deb8,null))[_0xbdef('0x23')](function(_0x5b39c8){if(_0x5b39c8){_0x138b72=_0x5b39c8;_0x50b1c7['model']=_[_0xbdef('0x33')](db[_0xbdef('0x52')][_0xbdef('0x2e')]);_0x50b1c7[_0xbdef('0x32')]=_[_0xbdef('0x33')](_0x4b7cd7[_0xbdef('0x32')]);_0x50b1c7[_0xbdef('0x34')]=_[_0xbdef('0x35')](_0x50b1c7[_0xbdef('0x31')],_0x50b1c7[_0xbdef('0x32')]);_0x2e2aea[_0xbdef('0x36')]=_[_0xbdef('0x35')](_0x50b1c7[_0xbdef('0x31')],qs[_0xbdef('0x37')](_0x4b7cd7['query']['fields']));_0x2e2aea[_0xbdef('0x36')]=_0x2e2aea[_0xbdef('0x36')][_0xbdef('0x46')]?_0x2e2aea[_0xbdef('0x36')]:_0x50b1c7['model'];_0x2e2aea[_0xbdef('0x3a')]=qs[_0xbdef('0x3b')](_0x4b7cd7[_0xbdef('0x32')]['sort']);_0x2e2aea[_0xbdef('0x3c')]=qs[_0xbdef('0x34')](_['pick'](_0x4b7cd7['query'],_0x50b1c7[_0xbdef('0x34')]));if(_0x4b7cd7['query'][_0xbdef('0x3e')]){_0x2e2aea[_0xbdef('0x3c')]=_[_0xbdef('0x3f')](_0x2e2aea[_0xbdef('0x3c')],{'$or':_['map'](_0x2e2aea[_0xbdef('0x36')],function(_0x3a32ad){var _0x3d74bb={};_0x3d74bb[_0x3a32ad]={'$like':'%'+_0x4b7cd7['query']['filter']+'%'};return _0x3d74bb;})});}_0x2e2aea=_[_0xbdef('0x3f')]({},_0x2e2aea,_0x4b7cd7[_0xbdef('0x47')]);return _0x138b72[_0xbdef('0x55')](_0x2e2aea);}})[_0xbdef('0x23')](function(_0x57dcfa){if(_0x57dcfa){_0x4577a1=_0x57dcfa[_0xbdef('0x46')];if(!_0x4b7cd7[_0xbdef('0x32')][_0xbdef('0x38')]('nolimit')){_0x2e2aea[_0xbdef('0x1e')]=qs[_0xbdef('0x1e')](_0x4b7cd7[_0xbdef('0x32')][_0xbdef('0x1e')]);_0x2e2aea[_0xbdef('0x1c')]=qs[_0xbdef('0x1c')](_0x4b7cd7['query']['offset']);}return _0x138b72['getAllConditions'](_0x2e2aea);}})['then'](function(_0x169764){if(_0x169764){return _0x169764?{'count':_0x4577a1,'rows':_0x169764}:null;}})[_0xbdef('0x23')](respondWithResult(_0x11deb8,null))[_0xbdef('0x44')](handleError(_0x11deb8,null));};exports[_0xbdef('0x57')]=function(_0x51de00,_0x35c9d2,_0x2e201b){var _0x4208ec={};var _0x4da93d={};var _0x4bb7a9;var _0x542dc4;return db[_0xbdef('0x2d')]['findOne']({'where':{'id':_0x51de00[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x35c9d2,null))[_0xbdef('0x23')](function(_0x1a73a6){if(_0x1a73a6){_0x4bb7a9=_0x1a73a6;_0x4da93d[_0xbdef('0x31')]=_['keys'](db['Condition'][_0xbdef('0x2e')]);_0x4da93d[_0xbdef('0x32')]=_[_0xbdef('0x33')](_0x51de00[_0xbdef('0x32')]);_0x4da93d['filters']=_['intersection'](_0x4da93d[_0xbdef('0x31')],_0x4da93d[_0xbdef('0x32')]);_0x4208ec[_0xbdef('0x36')]=_['intersection'](_0x4da93d[_0xbdef('0x31')],qs[_0xbdef('0x37')](_0x51de00[_0xbdef('0x32')]['fields']));_0x4208ec[_0xbdef('0x36')]=_0x4208ec[_0xbdef('0x36')]['length']?_0x4208ec[_0xbdef('0x36')]:_0x4da93d[_0xbdef('0x31')];_0x4208ec[_0xbdef('0x3a')]=qs['sort'](_0x51de00[_0xbdef('0x32')]['sort']);_0x4208ec[_0xbdef('0x3c')]=qs['filters'](_[_0xbdef('0x3d')](_0x51de00[_0xbdef('0x32')],_0x4da93d[_0xbdef('0x34')]));if(_0x51de00[_0xbdef('0x32')][_0xbdef('0x3e')]){_0x4208ec[_0xbdef('0x3c')]=_[_0xbdef('0x3f')](_0x4208ec[_0xbdef('0x3c')],{'$or':_['map'](_0x4208ec[_0xbdef('0x36')],function(_0x491fa6){var _0x57244a={};_0x57244a[_0x491fa6]={'$like':'%'+_0x51de00[_0xbdef('0x32')]['filter']+'%'};return _0x57244a;})});}_0x4208ec=_[_0xbdef('0x3f')]({},_0x4208ec,_0x51de00[_0xbdef('0x47')]);return _0x4bb7a9[_0xbdef('0x57')](_0x4208ec);}})[_0xbdef('0x23')](function(_0x212d1a){if(_0x212d1a){_0x542dc4=_0x212d1a[_0xbdef('0x46')];if(!_0x51de00[_0xbdef('0x32')][_0xbdef('0x38')]('nolimit')){_0x4208ec[_0xbdef('0x1e')]=qs[_0xbdef('0x1e')](_0x51de00['query']['limit']);_0x4208ec['offset']=qs[_0xbdef('0x1c')](_0x51de00[_0xbdef('0x32')]['offset']);}return _0x4bb7a9[_0xbdef('0x57')](_0x4208ec);}})['then'](function(_0x32f6d1){if(_0x32f6d1){return _0x32f6d1?{'count':_0x542dc4,'rows':_0x32f6d1}:null;}})['then'](respondWithResult(_0x35c9d2,null))[_0xbdef('0x44')](handleError(_0x35c9d2,null));};exports[_0xbdef('0x58')]=function(_0x44f8f5,_0x34cd0d,_0x18b321){if(_0x44f8f5['body']['id']){delete _0x44f8f5[_0xbdef('0x4a')]['id'];}return db[_0xbdef('0x2d')]['find']({'where':{'id':_0x44f8f5[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x34cd0d,null))[_0xbdef('0x23')](function(_0x27ec97){if(_0x27ec97){_0x44f8f5[_0xbdef('0x4a')]['TriggerId']=_0x27ec97['id'];return db[_0xbdef('0x59')]['create'](_0x44f8f5['body']);}})['then'](respondWithResult(_0x34cd0d,null))[_0xbdef('0x44')](handleError(_0x34cd0d,null));};exports[_0xbdef('0x5a')]=function(_0x5d0c4b,_0x411eb0,_0x1c8727){var _0x428eea={};var _0x2af701={};var _0x20a17d;var _0x498f5b;return db[_0xbdef('0x2d')][_0xbdef('0x56')]({'where':{'id':_0x5d0c4b[_0xbdef('0x45')]['id']}})[_0xbdef('0x23')](handleEntityNotFound(_0x411eb0,null))['then'](function(_0x2d1925){if(_0x2d1925){_0x20a17d=_0x2d1925;_0x2af701[_0xbdef('0x31')]=_[_0xbdef('0x33')](db[_0xbdef('0x59')][_0xbdef('0x2e')]);_0x2af701[_0xbdef('0x32')]=_[_0xbdef('0x33')](_0x5d0c4b[_0xbdef('0x32')]);_0x2af701['filters']=_[_0xbdef('0x35')](_0x2af701[_0xbdef('0x31')],_0x2af701[_0xbdef('0x32')]);_0x428eea[_0xbdef('0x36')]=_[_0xbdef('0x35')](_0x2af701[_0xbdef('0x31')],qs['fields'](_0x5d0c4b['query'][_0xbdef('0x37')]));_0x428eea[_0xbdef('0x36')]=_0x428eea[_0xbdef('0x36')][_0xbdef('0x46')]?_0x428eea[_0xbdef('0x36')]:_0x2af701[_0xbdef('0x31')];_0x428eea[_0xbdef('0x3a')]=qs[_0xbdef('0x3b')](_0x5d0c4b[_0xbdef('0x32')]['sort']);_0x428eea[_0xbdef('0x3c')]=qs[_0xbdef('0x34')](_[_0xbdef('0x3d')](_0x5d0c4b[_0xbdef('0x32')],_0x2af701['filters']));if(_0x5d0c4b['query'][_0xbdef('0x3e')]){_0x428eea[_0xbdef('0x3c')]=_[_0xbdef('0x3f')](_0x428eea[_0xbdef('0x3c')],{'$or':_[_0xbdef('0x2c')](_0x428eea['attributes'],function(_0x2c7d6e){var _0xab3dd0={};_0xab3dd0[_0x2c7d6e]={'$like':'%'+_0x5d0c4b['query'][_0xbdef('0x3e')]+'%'};return _0xab3dd0;})});}_0x428eea=_[_0xbdef('0x3f')]({},_0x428eea,_0x5d0c4b[_0xbdef('0x47')]);return _0x20a17d[_0xbdef('0x5a')](_0x428eea);}})['then'](function(_0x5ab5e9){if(_0x5ab5e9){_0x498f5b=_0x5ab5e9[_0xbdef('0x46')];if(!_0x5d0c4b[_0xbdef('0x32')]['hasOwnProperty'](_0xbdef('0x39'))){_0x428eea[_0xbdef('0x1e')]=qs[_0xbdef('0x1e')](_0x5d0c4b[_0xbdef('0x32')]['limit']);_0x428eea['offset']=qs[_0xbdef('0x1c')](_0x5d0c4b['query'][_0xbdef('0x1c')]);}return _0x20a17d['getActions'](_0x428eea);}})['then'](function(_0x186dc4){if(_0x186dc4){return _0x186dc4?{'count':_0x498f5b,'rows':_0x186dc4}:null;}})['then'](respondWithResult(_0x411eb0,null))[_0xbdef('0x44')](handleError(_0x411eb0,null));}; \ No newline at end of file +var _0xcda4=['show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','jsforce','desk.js','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','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','Trigger','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','catch'];(function(_0x107208,_0x3833d2){var _0x13924e=function(_0x14c02b){while(--_0x14c02b){_0x107208['push'](_0x107208['shift']());}};_0x13924e(++_0x3833d2);}(_0xcda4,0x172));var _0x4cda=function(_0x8ef351,_0x4ab1da){_0x8ef351=_0x8ef351-0x0;var _0x1f8965=_0xcda4[_0x8ef351];return _0x1f8965;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cda('0x0'));var zipdir=require(_0x4cda('0x1'));var jsonpatch=require(_0x4cda('0x2'));var rp=require('request-promise');var moment=require(_0x4cda('0x3'));var BPromise=require(_0x4cda('0x4'));var Mustache=require('mustache');var util=require(_0x4cda('0x5'));var path=require(_0x4cda('0x6'));var sox=require('sox');var csv=require(_0x4cda('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4cda('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4cda('0x9'));var deskjs=require(_0x4cda('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4cda('0xb'));var Redis=require('ioredis');var authService=require(_0x4cda('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4cda('0xd'));var hardwareService=require(_0x4cda('0xe'));var logger=require(_0x4cda('0xf'))(_0x4cda('0x10'));var utils=require(_0x4cda('0x11'));var config=require(_0x4cda('0x12'));var licenseUtil=require(_0x4cda('0x13'));var db=require(_0x4cda('0x14'))['db'];function respondWithStatusCode(_0x4284f4,_0x18d3e4){_0x18d3e4=_0x18d3e4||0xcc;return function(_0x13f741){if(_0x13f741){return _0x4284f4[_0x4cda('0x15')](_0x18d3e4);}return _0x4284f4[_0x4cda('0x16')](_0x18d3e4)[_0x4cda('0x17')]();};}function respondWithResult(_0x9e8985,_0x1de81c){_0x1de81c=_0x1de81c||0xc8;return function(_0x329e8a){if(_0x329e8a){return _0x9e8985[_0x4cda('0x16')](_0x1de81c)[_0x4cda('0x18')](_0x329e8a);}};}function respondWithFilteredResult(_0x56721f,_0x44a37f){return function(_0x4ee28e){if(_0x4ee28e){var _0x6e8fab=typeof _0x44a37f['offset']===_0x4cda('0x19')&&typeof _0x44a37f[_0x4cda('0x1a')]===_0x4cda('0x19');var _0x5e5eac=_0x4ee28e[_0x4cda('0x1b')];var _0x3520e9=_0x6e8fab?0x0:_0x44a37f[_0x4cda('0x1c')];var _0x571950=_0x6e8fab?_0x4ee28e[_0x4cda('0x1b')]:_0x44a37f[_0x4cda('0x1c')]+_0x44a37f[_0x4cda('0x1a')];var _0x230c75;if(_0x571950>=_0x5e5eac){_0x571950=_0x5e5eac;_0x230c75=0xc8;}else{_0x230c75=0xce;}_0x56721f[_0x4cda('0x16')](_0x230c75);return _0x56721f[_0x4cda('0x1d')](_0x4cda('0x1e'),_0x3520e9+'-'+_0x571950+'/'+_0x5e5eac)[_0x4cda('0x18')](_0x4ee28e);}return null;};}function patchUpdates(_0x32e987){return function(_0xf5c433){try{jsonpatch[_0x4cda('0x1f')](_0xf5c433,_0x32e987,!![]);}catch(_0x24206f){return BPromise['reject'](_0x24206f);}return _0xf5c433[_0x4cda('0x20')]();};}function saveUpdates(_0x1b8651,_0x349434){return function(_0x3cf918){if(_0x3cf918){return _0x3cf918[_0x4cda('0x21')](_0x1b8651)[_0x4cda('0x22')](function(_0x442912){return _0x442912;});}return null;};}function removeEntity(_0x1a0157,_0x518565){return function(_0x5af912){if(_0x5af912){return _0x5af912[_0x4cda('0x23')]()[_0x4cda('0x22')](function(){var _0x47931d=_0x5af912[_0x4cda('0x24')]({'plain':!![]});var _0x363963=_0x4cda('0x25');return db[_0x4cda('0x26')][_0x4cda('0x23')]({'where':{'type':_0x363963,'resourceId':_0x47931d['id']}})['then'](function(){return _0x5af912;});})[_0x4cda('0x22')](function(){_0x1a0157[_0x4cda('0x16')](0xcc)[_0x4cda('0x17')]();});}};}function handleEntityNotFound(_0xcac45d,_0x113680){return function(_0x1a5449){if(!_0x1a5449){_0xcac45d['sendStatus'](0x194);}return _0x1a5449;};}function handleError(_0x5d3711,_0x2df43f){_0x2df43f=_0x2df43f||0x1f4;return function(_0x3e2dc4){logger[_0x4cda('0x27')](_0x3e2dc4[_0x4cda('0x28')]);if(_0x3e2dc4[_0x4cda('0x29')]){delete _0x3e2dc4[_0x4cda('0x29')];}_0x5d3711[_0x4cda('0x16')](_0x2df43f)['send'](_0x3e2dc4);};}exports['index']=function(_0x22ae94,_0x403fe8){var _0x4d3d4b={},_0x3e5c2d={},_0x819c4={'count':0x0,'rows':[]};var _0x315203=_['map'](db[_0x4cda('0x2a')][_0x4cda('0x2b')],function(_0x540e96){return{'name':_0x540e96[_0x4cda('0x2c')],'type':_0x540e96['type'][_0x4cda('0x2d')]};});_0x3e5c2d[_0x4cda('0x2e')]=_['map'](_0x315203,_0x4cda('0x29'));_0x3e5c2d['query']=_[_0x4cda('0x2f')](_0x22ae94[_0x4cda('0x30')]);_0x3e5c2d[_0x4cda('0x31')]=_[_0x4cda('0x32')](_0x3e5c2d[_0x4cda('0x2e')],_0x3e5c2d[_0x4cda('0x30')]);_0x4d3d4b['attributes']=_[_0x4cda('0x32')](_0x3e5c2d['model'],qs[_0x4cda('0x33')](_0x22ae94[_0x4cda('0x30')][_0x4cda('0x33')]));_0x4d3d4b[_0x4cda('0x34')]=_0x4d3d4b[_0x4cda('0x34')][_0x4cda('0x35')]?_0x4d3d4b[_0x4cda('0x34')]:_0x3e5c2d[_0x4cda('0x2e')];if(!_0x22ae94[_0x4cda('0x30')][_0x4cda('0x36')](_0x4cda('0x37'))){_0x4d3d4b[_0x4cda('0x1a')]=qs[_0x4cda('0x1a')](_0x22ae94['query'][_0x4cda('0x1a')]);_0x4d3d4b[_0x4cda('0x1c')]=qs[_0x4cda('0x1c')](_0x22ae94['query'][_0x4cda('0x1c')]);}_0x4d3d4b[_0x4cda('0x38')]=qs['sort'](_0x22ae94['query'][_0x4cda('0x39')]);_0x4d3d4b[_0x4cda('0x3a')]=qs[_0x4cda('0x31')](_[_0x4cda('0x3b')](_0x22ae94[_0x4cda('0x30')],_0x3e5c2d[_0x4cda('0x31')]),_0x315203);if(_0x22ae94[_0x4cda('0x30')][_0x4cda('0x3c')]){_0x4d3d4b[_0x4cda('0x3a')]=_[_0x4cda('0x3d')](_0x4d3d4b[_0x4cda('0x3a')],{'$or':_[_0x4cda('0x3e')](_0x315203,function(_0xcf2f8b){if(_0xcf2f8b[_0x4cda('0x3f')]!=='VIRTUAL'){var _0x109901={};_0x109901[_0xcf2f8b['name']]={'$like':'%'+_0x22ae94[_0x4cda('0x30')][_0x4cda('0x3c')]+'%'};return _0x109901;}})});}_0x4d3d4b=_[_0x4cda('0x3d')]({},_0x4d3d4b,_0x22ae94[_0x4cda('0x40')]);var _0x131868={'where':_0x4d3d4b[_0x4cda('0x3a')]};return db['Trigger'][_0x4cda('0x1b')](_0x131868)[_0x4cda('0x22')](function(_0x2242c2){_0x819c4[_0x4cda('0x1b')]=_0x2242c2;if(_0x22ae94['query'][_0x4cda('0x41')]){_0x4d3d4b[_0x4cda('0x42')]=[{'all':!![]}];}return db[_0x4cda('0x2a')][_0x4cda('0x43')](_0x4d3d4b);})[_0x4cda('0x22')](function(_0x15712b){_0x819c4[_0x4cda('0x44')]=_0x15712b;return _0x819c4;})[_0x4cda('0x22')](respondWithFilteredResult(_0x403fe8,_0x4d3d4b))[_0x4cda('0x45')](handleError(_0x403fe8,null));};exports[_0x4cda('0x46')]=function(_0x3b0d24,_0x4e5499){var _0x135f0f={'raw':![],'where':{'id':_0x3b0d24[_0x4cda('0x47')]['id']}},_0x52997b={};_0x52997b['model']=_[_0x4cda('0x2f')](db[_0x4cda('0x2a')]['rawAttributes']);_0x52997b['query']=_[_0x4cda('0x2f')](_0x3b0d24[_0x4cda('0x30')]);_0x52997b['filters']=_[_0x4cda('0x32')](_0x52997b[_0x4cda('0x2e')],_0x52997b[_0x4cda('0x30')]);_0x135f0f[_0x4cda('0x34')]=_[_0x4cda('0x32')](_0x52997b[_0x4cda('0x2e')],qs[_0x4cda('0x33')](_0x3b0d24['query'][_0x4cda('0x33')]));_0x135f0f[_0x4cda('0x34')]=_0x135f0f['attributes'][_0x4cda('0x35')]?_0x135f0f[_0x4cda('0x34')]:_0x52997b[_0x4cda('0x2e')];if(_0x3b0d24['query'][_0x4cda('0x41')]){_0x135f0f['include']=[{'all':!![]}];}_0x135f0f=_[_0x4cda('0x3d')]({},_0x135f0f,_0x3b0d24[_0x4cda('0x40')]);return db[_0x4cda('0x2a')]['find'](_0x135f0f)[_0x4cda('0x22')](handleEntityNotFound(_0x4e5499,null))['then'](respondWithResult(_0x4e5499,null))['catch'](handleError(_0x4e5499,null));};exports[_0x4cda('0x48')]=function(_0x51ed66,_0x362fa0){return db['Trigger']['create'](_0x51ed66['body'],{})[_0x4cda('0x22')](function(_0x3a0b99){var _0x19bbf1=_0x51ed66[_0x4cda('0x49')][_0x4cda('0x24')]({'plain':!![]});if(!_0x19bbf1)throw new Error(_0x4cda('0x4a'));if(_0x19bbf1['role']===_0x4cda('0x49')){var _0x200240=_0x3a0b99['get']({'plain':!![]});var _0x3c89a2='Triggers';return db['UserProfileSection'][_0x4cda('0x4b')]({'where':{'name':_0x3c89a2,'userProfileId':_0x19bbf1['userProfileId']},'raw':!![]})[_0x4cda('0x22')](function(_0x4351cc){if(_0x4351cc&&_0x4351cc[_0x4cda('0x4c')]===0x0){return db[_0x4cda('0x26')][_0x4cda('0x48')]({'name':_0x200240['name'],'resourceId':_0x200240['id'],'type':_0x4351cc[_0x4cda('0x29')],'sectionId':_0x4351cc['id']},{})['then'](function(){return _0x3a0b99;});}else{return _0x3a0b99;}})[_0x4cda('0x45')](function(_0x179cae){logger[_0x4cda('0x27')](_0x4cda('0x4d'),_0x179cae);throw _0x179cae;});}return _0x3a0b99;})[_0x4cda('0x22')](respondWithResult(_0x362fa0,0xc9))[_0x4cda('0x45')](handleError(_0x362fa0,null));};exports['update']=function(_0x2ea58f,_0x34b8f3){if(_0x2ea58f['body']['id']){delete _0x2ea58f[_0x4cda('0x4e')]['id'];}return db['Trigger'][_0x4cda('0x4b')]({'where':{'id':_0x2ea58f[_0x4cda('0x47')]['id']}})[_0x4cda('0x22')](handleEntityNotFound(_0x34b8f3,null))[_0x4cda('0x22')](saveUpdates(_0x2ea58f['body'],null))[_0x4cda('0x22')](respondWithResult(_0x34b8f3,null))[_0x4cda('0x45')](handleError(_0x34b8f3,null));};exports[_0x4cda('0x23')]=function(_0xc92dd0,_0x3db413){return db[_0x4cda('0x2a')][_0x4cda('0x4b')]({'where':{'id':_0xc92dd0[_0x4cda('0x47')]['id']}})[_0x4cda('0x22')](handleEntityNotFound(_0x3db413,null))[_0x4cda('0x22')](removeEntity(_0x3db413,null))[_0x4cda('0x45')](handleError(_0x3db413,null));};exports[_0x4cda('0x4f')]=function(_0x145c24,_0x40e9e2,_0x351f8b){if(_0x145c24[_0x4cda('0x4e')]['id']){delete _0x145c24['body']['id'];}return db['Trigger'][_0x4cda('0x4b')]({'where':{'id':_0x145c24[_0x4cda('0x47')]['id']}})[_0x4cda('0x22')](handleEntityNotFound(_0x40e9e2,null))[_0x4cda('0x22')](function(_0x13bbc1){if(_0x13bbc1){_0x145c24[_0x4cda('0x4e')]['TriggerAllId']=_0x13bbc1['id'];return db[_0x4cda('0x50')][_0x4cda('0x48')](_0x145c24[_0x4cda('0x4e')]);}})[_0x4cda('0x22')](respondWithResult(_0x40e9e2,null))[_0x4cda('0x45')](handleError(_0x40e9e2,null));};exports['addAnyCondition']=function(_0xbc68f7,_0x5fe0b0,_0x5e4321){if(_0xbc68f7[_0x4cda('0x4e')]['id']){delete _0xbc68f7[_0x4cda('0x4e')]['id'];}return db[_0x4cda('0x2a')][_0x4cda('0x4b')]({'where':{'id':_0xbc68f7[_0x4cda('0x47')]['id']}})['then'](handleEntityNotFound(_0x5fe0b0,null))['then'](function(_0x49d29b){if(_0x49d29b){_0xbc68f7[_0x4cda('0x4e')][_0x4cda('0x51')]=_0x49d29b['id'];return db[_0x4cda('0x50')]['create'](_0xbc68f7[_0x4cda('0x4e')]);}})[_0x4cda('0x22')](respondWithResult(_0x5fe0b0,null))[_0x4cda('0x45')](handleError(_0x5fe0b0,null));};exports[_0x4cda('0x52')]=function(_0x413a43,_0x28b32d,_0x50c435){var _0x101417={};var _0x4a2813={};var _0x25404f;var _0x2fffbb;return db[_0x4cda('0x2a')]['findOne']({'where':{'id':_0x413a43[_0x4cda('0x47')]['id']}})['then'](handleEntityNotFound(_0x28b32d,null))[_0x4cda('0x22')](function(_0x20151b){if(_0x20151b){_0x25404f=_0x20151b;_0x4a2813['model']=_['keys'](db[_0x4cda('0x50')][_0x4cda('0x2b')]);_0x4a2813['query']=_[_0x4cda('0x2f')](_0x413a43[_0x4cda('0x30')]);_0x4a2813['filters']=_[_0x4cda('0x32')](_0x4a2813[_0x4cda('0x2e')],_0x4a2813['query']);_0x101417[_0x4cda('0x34')]=_[_0x4cda('0x32')](_0x4a2813[_0x4cda('0x2e')],qs[_0x4cda('0x33')](_0x413a43[_0x4cda('0x30')][_0x4cda('0x33')]));_0x101417['attributes']=_0x101417[_0x4cda('0x34')][_0x4cda('0x35')]?_0x101417[_0x4cda('0x34')]:_0x4a2813[_0x4cda('0x2e')];_0x101417[_0x4cda('0x38')]=qs[_0x4cda('0x39')](_0x413a43[_0x4cda('0x30')][_0x4cda('0x39')]);_0x101417[_0x4cda('0x3a')]=qs[_0x4cda('0x31')](_[_0x4cda('0x3b')](_0x413a43[_0x4cda('0x30')],_0x4a2813['filters']));if(_0x413a43[_0x4cda('0x30')]['filter']){_0x101417[_0x4cda('0x3a')]=_[_0x4cda('0x3d')](_0x101417[_0x4cda('0x3a')],{'$or':_['map'](_0x101417[_0x4cda('0x34')],function(_0x2de362){var _0x54b2f3={};_0x54b2f3[_0x2de362]={'$like':'%'+_0x413a43[_0x4cda('0x30')][_0x4cda('0x3c')]+'%'};return _0x54b2f3;})});}_0x101417=_['merge']({},_0x101417,_0x413a43['options']);return _0x25404f['getAllConditions'](_0x101417);}})[_0x4cda('0x22')](function(_0x436a2e){if(_0x436a2e){_0x2fffbb=_0x436a2e[_0x4cda('0x35')];if(!_0x413a43[_0x4cda('0x30')][_0x4cda('0x36')]('nolimit')){_0x101417[_0x4cda('0x1a')]=qs['limit'](_0x413a43[_0x4cda('0x30')][_0x4cda('0x1a')]);_0x101417[_0x4cda('0x1c')]=qs[_0x4cda('0x1c')](_0x413a43[_0x4cda('0x30')][_0x4cda('0x1c')]);}return _0x25404f['getAllConditions'](_0x101417);}})['then'](function(_0x48061b){if(_0x48061b){return _0x48061b?{'count':_0x2fffbb,'rows':_0x48061b}:null;}})[_0x4cda('0x22')](respondWithResult(_0x28b32d,null))[_0x4cda('0x45')](handleError(_0x28b32d,null));};exports['getAnyConditions']=function(_0x2b4ef1,_0x5003e9,_0x183ff2){var _0x46354c={};var _0x581697={};var _0x1c041b;var _0x4b6563;return db[_0x4cda('0x2a')][_0x4cda('0x53')]({'where':{'id':_0x2b4ef1[_0x4cda('0x47')]['id']}})[_0x4cda('0x22')](handleEntityNotFound(_0x5003e9,null))[_0x4cda('0x22')](function(_0x276739){if(_0x276739){_0x1c041b=_0x276739;_0x581697['model']=_['keys'](db[_0x4cda('0x50')][_0x4cda('0x2b')]);_0x581697[_0x4cda('0x30')]=_[_0x4cda('0x2f')](_0x2b4ef1[_0x4cda('0x30')]);_0x581697['filters']=_[_0x4cda('0x32')](_0x581697[_0x4cda('0x2e')],_0x581697[_0x4cda('0x30')]);_0x46354c[_0x4cda('0x34')]=_[_0x4cda('0x32')](_0x581697['model'],qs[_0x4cda('0x33')](_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x33')]));_0x46354c[_0x4cda('0x34')]=_0x46354c['attributes']['length']?_0x46354c[_0x4cda('0x34')]:_0x581697[_0x4cda('0x2e')];_0x46354c[_0x4cda('0x38')]=qs[_0x4cda('0x39')](_0x2b4ef1[_0x4cda('0x30')]['sort']);_0x46354c[_0x4cda('0x3a')]=qs['filters'](_[_0x4cda('0x3b')](_0x2b4ef1[_0x4cda('0x30')],_0x581697[_0x4cda('0x31')]));if(_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x3c')]){_0x46354c[_0x4cda('0x3a')]=_[_0x4cda('0x3d')](_0x46354c[_0x4cda('0x3a')],{'$or':_[_0x4cda('0x3e')](_0x46354c[_0x4cda('0x34')],function(_0x47663e){var _0x56aa64={};_0x56aa64[_0x47663e]={'$like':'%'+_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x3c')]+'%'};return _0x56aa64;})});}_0x46354c=_['merge']({},_0x46354c,_0x2b4ef1['options']);return _0x1c041b[_0x4cda('0x54')](_0x46354c);}})['then'](function(_0x2684d3){if(_0x2684d3){_0x4b6563=_0x2684d3[_0x4cda('0x35')];if(!_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x36')]('nolimit')){_0x46354c[_0x4cda('0x1a')]=qs[_0x4cda('0x1a')](_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x1a')]);_0x46354c['offset']=qs['offset'](_0x2b4ef1[_0x4cda('0x30')][_0x4cda('0x1c')]);}return _0x1c041b[_0x4cda('0x54')](_0x46354c);}})['then'](function(_0x554408){if(_0x554408){return _0x554408?{'count':_0x4b6563,'rows':_0x554408}:null;}})['then'](respondWithResult(_0x5003e9,null))[_0x4cda('0x45')](handleError(_0x5003e9,null));};exports[_0x4cda('0x55')]=function(_0x32003a,_0x1b6c46,_0x14103f){if(_0x32003a['body']['id']){delete _0x32003a[_0x4cda('0x4e')]['id'];}return db[_0x4cda('0x2a')][_0x4cda('0x4b')]({'where':{'id':_0x32003a[_0x4cda('0x47')]['id']}})[_0x4cda('0x22')](handleEntityNotFound(_0x1b6c46,null))[_0x4cda('0x22')](function(_0x510703){if(_0x510703){_0x32003a[_0x4cda('0x4e')]['TriggerId']=_0x510703['id'];return db[_0x4cda('0x56')][_0x4cda('0x48')](_0x32003a['body']);}})[_0x4cda('0x22')](respondWithResult(_0x1b6c46,null))[_0x4cda('0x45')](handleError(_0x1b6c46,null));};exports[_0x4cda('0x57')]=function(_0x1fb083,_0x126904,_0x1360ca){var _0x5ba720={};var _0x3e420b={};var _0x564123;var _0x9ef95;return db[_0x4cda('0x2a')][_0x4cda('0x53')]({'where':{'id':_0x1fb083[_0x4cda('0x47')]['id']}})['then'](handleEntityNotFound(_0x126904,null))[_0x4cda('0x22')](function(_0x31808c){if(_0x31808c){_0x564123=_0x31808c;_0x3e420b[_0x4cda('0x2e')]=_[_0x4cda('0x2f')](db[_0x4cda('0x56')][_0x4cda('0x2b')]);_0x3e420b[_0x4cda('0x30')]=_['keys'](_0x1fb083[_0x4cda('0x30')]);_0x3e420b[_0x4cda('0x31')]=_[_0x4cda('0x32')](_0x3e420b[_0x4cda('0x2e')],_0x3e420b['query']);_0x5ba720[_0x4cda('0x34')]=_[_0x4cda('0x32')](_0x3e420b[_0x4cda('0x2e')],qs['fields'](_0x1fb083[_0x4cda('0x30')][_0x4cda('0x33')]));_0x5ba720['attributes']=_0x5ba720[_0x4cda('0x34')][_0x4cda('0x35')]?_0x5ba720['attributes']:_0x3e420b[_0x4cda('0x2e')];_0x5ba720[_0x4cda('0x38')]=qs[_0x4cda('0x39')](_0x1fb083['query']['sort']);_0x5ba720[_0x4cda('0x3a')]=qs[_0x4cda('0x31')](_['pick'](_0x1fb083[_0x4cda('0x30')],_0x3e420b[_0x4cda('0x31')]));if(_0x1fb083[_0x4cda('0x30')][_0x4cda('0x3c')]){_0x5ba720[_0x4cda('0x3a')]=_[_0x4cda('0x3d')](_0x5ba720['where'],{'$or':_[_0x4cda('0x3e')](_0x5ba720[_0x4cda('0x34')],function(_0x56dde4){var _0x1ef25f={};_0x1ef25f[_0x56dde4]={'$like':'%'+_0x1fb083['query'][_0x4cda('0x3c')]+'%'};return _0x1ef25f;})});}_0x5ba720=_['merge']({},_0x5ba720,_0x1fb083[_0x4cda('0x40')]);return _0x564123[_0x4cda('0x57')](_0x5ba720);}})[_0x4cda('0x22')](function(_0x4049b9){if(_0x4049b9){_0x9ef95=_0x4049b9[_0x4cda('0x35')];if(!_0x1fb083[_0x4cda('0x30')][_0x4cda('0x36')](_0x4cda('0x37'))){_0x5ba720[_0x4cda('0x1a')]=qs[_0x4cda('0x1a')](_0x1fb083[_0x4cda('0x30')]['limit']);_0x5ba720['offset']=qs[_0x4cda('0x1c')](_0x1fb083[_0x4cda('0x30')][_0x4cda('0x1c')]);}return _0x564123[_0x4cda('0x57')](_0x5ba720);}})[_0x4cda('0x22')](function(_0x17cf34){if(_0x17cf34){return _0x17cf34?{'count':_0x9ef95,'rows':_0x17cf34}:null;}})[_0x4cda('0x22')](respondWithResult(_0x126904,null))[_0x4cda('0x45')](handleError(_0x126904,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 08eea5e..0f61bdf 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 _0x1ac2=['path','rimraf','../../config/environment','./trigger.attributes','define','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x1ac2,0xfd));var _0x21ac=function(_0x216e72,_0x5cd161){_0x216e72=_0x216e72-0x0;var _0x2ff28d=_0x1ac2[_0x216e72];return _0x2ff28d;};'use strict';var _=require(_0x21ac('0x0'));var util=require(_0x21ac('0x1'));var logger=require(_0x21ac('0x2'))(_0x21ac('0x3'));var moment=require(_0x21ac('0x4'));var BPromise=require(_0x21ac('0x5'));var rp=require(_0x21ac('0x6'));var fs=require('fs');var path=require(_0x21ac('0x7'));var rimraf=require(_0x21ac('0x8'));var config=require(_0x21ac('0x9'));var attributes=require(_0x21ac('0xa'));module['exports']=function(_0x3d9cc8,_0x142e2e){return _0x3d9cc8[_0x21ac('0xb')]('Trigger',attributes,{'tableName':_0x21ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a80=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','../../config/logger'];(function(_0x4695e2,_0x3d5f15){var _0x160563=function(_0x5df0a2){while(--_0x5df0a2){_0x4695e2['push'](_0x4695e2['shift']());}};_0x160563(++_0x3d5f15);}(_0x4a80,0xbe));var _0x04a8=function(_0x231a42,_0x39f4db){_0x231a42=_0x231a42-0x0;var _0x3c2a56=_0x4a80[_0x231a42];return _0x3c2a56;};'use strict';var _=require(_0x04a8('0x0'));var util=require('util');var logger=require(_0x04a8('0x1'))(_0x04a8('0x2'));var moment=require('moment');var BPromise=require(_0x04a8('0x3'));var rp=require(_0x04a8('0x4'));var fs=require('fs');var path=require(_0x04a8('0x5'));var rimraf=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var attributes=require(_0x04a8('0x8'));module[_0x04a8('0x9')]=function(_0x353b43,_0x709eea){return _0x353b43[_0x04a8('0xa')]('Trigger',attributes,{'tableName':_0x04a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 96945cf..86d3031 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 _0xe870=['limit','include','map','ShowTrigger','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes'];(function(_0x27111f,_0x3a1f29){var _0x3f933c=function(_0x488325){while(--_0x488325){_0x27111f['push'](_0x27111f['shift']());}};_0x3f933c(++_0x3a1f29);}(_0xe870,0x91));var _0x0e87=function(_0x53ad58,_0x292e6c){_0x53ad58=_0x53ad58-0x0;var _0x14c18c=_0xe870[_0x53ad58];return _0x14c18c;};'use strict';var _=require('lodash');var util=require(_0x0e87('0x0'));var moment=require(_0x0e87('0x1'));var BPromise=require(_0x0e87('0x2'));var rs=require(_0x0e87('0x3'));var fs=require('fs');var Redis=require(_0x0e87('0x4'));var db=require(_0x0e87('0x5'))['db'];var utils=require(_0x0e87('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0e87('0x7'));var jayson=require(_0x0e87('0x8'));var client=jayson[_0x0e87('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x111b53,_0x141727,_0x1f3b1f){return new BPromise(function(_0x505732,_0xa5b856){return client[_0x0e87('0xa')](_0x111b53,_0x1f3b1f)[_0x0e87('0xb')](function(_0x18a9b){logger[_0x0e87('0xc')]('Trigger,\x20%s,\x20%s',_0x141727,'request\x20sent');logger[_0x0e87('0xd')](_0x0e87('0xe'),_0x141727,_0x0e87('0xf'),JSON[_0x0e87('0x10')](_0x18a9b));if(_0x18a9b['error']){if(_0x18a9b['error'][_0x0e87('0x11')]===0x1f4){logger[_0x0e87('0x12')](_0x0e87('0x13'),_0x141727,_0x18a9b['error']['message']);return _0xa5b856(_0x18a9b[_0x0e87('0x12')]['message']);}logger[_0x0e87('0x12')](_0x0e87('0x13'),_0x141727,_0x18a9b[_0x0e87('0x12')][_0x0e87('0x14')]);return _0x505732(_0x18a9b[_0x0e87('0x12')][_0x0e87('0x14')]);}else{logger[_0x0e87('0xc')](_0x0e87('0x13'),_0x141727,'request\x20sent');_0x505732(_0x18a9b[_0x0e87('0x15')][_0x0e87('0x14')]);}})[_0x0e87('0x16')](function(_0x5efa1c){logger[_0x0e87('0x12')](_0x0e87('0x13'),_0x141727,_0x5efa1c);_0xa5b856(_0x5efa1c);});});}exports[_0x0e87('0x17')]=function(_0x3ac7dc){var _0x479d26=this;return new Promise(function(_0x1182be,_0xba2069){return db[_0x0e87('0x18')][_0x0e87('0x19')]({'raw':_0x3ac7dc[_0x0e87('0x1a')]?_0x3ac7dc['options'][_0x0e87('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ac7dc[_0x0e87('0x1a')]?_0x3ac7dc[_0x0e87('0x1a')][_0x0e87('0x1c')]||null:null,'attributes':_0x3ac7dc[_0x0e87('0x1a')]?_0x3ac7dc['options'][_0x0e87('0x1d')]||null:null,'limit':_0x3ac7dc[_0x0e87('0x1a')]?_0x3ac7dc[_0x0e87('0x1a')][_0x0e87('0x1e')]||null:null,'include':_0x3ac7dc[_0x0e87('0x1a')]?_0x3ac7dc['options'][_0x0e87('0x1f')]?_[_0x0e87('0x20')](_0x3ac7dc['options'][_0x0e87('0x1f')],function(_0x5b64c4){return{'model':db[_0x5b64c4['model']],'as':_0x5b64c4['as'],'attributes':_0x5b64c4[_0x0e87('0x1d')],'include':_0x5b64c4[_0x0e87('0x1f')]?_['map'](_0x5b64c4[_0x0e87('0x1f')],function(_0x3cc527){return{'model':db[_0x3cc527['model']],'as':_0x3cc527['as'],'attributes':_0x3cc527[_0x0e87('0x1d')],'include':_0x3cc527[_0x0e87('0x1f')]?_[_0x0e87('0x20')](_0x3cc527[_0x0e87('0x1f')],function(_0x27e0af){return{'model':db[_0x27e0af['model']],'as':_0x27e0af['as'],'attributes':_0x27e0af[_0x0e87('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0e87('0xb')](function(_0x4be2e3){logger[_0x0e87('0xc')](_0x0e87('0x17'),_0x3ac7dc);logger[_0x0e87('0xd')]('GetTrigger',_0x3ac7dc,JSON[_0x0e87('0x10')](_0x4be2e3));_0x1182be(_0x4be2e3);})[_0x0e87('0x16')](function(_0x440415){logger['error'](_0x0e87('0x17'),_0x440415[_0x0e87('0x14')],_0x3ac7dc);_0xba2069(_0x479d26['error'](0x1f4,_0x440415['message']));});});};exports[_0x0e87('0x21')]=function(_0x58a012){var _0x39b2f3=this;return new Promise(function(_0x2c7fde,_0x477993){return db[_0x0e87('0x18')]['find']({'raw':_0x58a012['options']?_0x58a012[_0x0e87('0x1a')][_0x0e87('0x1b')]===undefined?!![]:![]:!![],'where':_0x58a012[_0x0e87('0x1a')]?_0x58a012[_0x0e87('0x1a')][_0x0e87('0x1c')]||null:null,'attributes':_0x58a012[_0x0e87('0x1a')]?_0x58a012[_0x0e87('0x1a')][_0x0e87('0x1d')]||null:null,'include':_0x58a012[_0x0e87('0x1a')]?_0x58a012['options'][_0x0e87('0x1f')]?_['map'](_0x58a012[_0x0e87('0x1a')][_0x0e87('0x1f')],function(_0x55fe6a){return{'model':db[_0x55fe6a['model']],'as':_0x55fe6a['as'],'attributes':_0x55fe6a['attributes'],'include':_0x55fe6a['include']?_['map'](_0x55fe6a[_0x0e87('0x1f')],function(_0x42bab3){return{'model':db[_0x42bab3[_0x0e87('0x22')]],'as':_0x42bab3['as'],'attributes':_0x42bab3[_0x0e87('0x1d')],'include':_0x42bab3['include']?_['map'](_0x42bab3['include'],function(_0x2c842d){return{'model':db[_0x2c842d[_0x0e87('0x22')]],'as':_0x2c842d['as'],'attributes':_0x2c842d[_0x0e87('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0e87('0xb')](function(_0x41460c){logger['info']('ShowTrigger',_0x58a012);logger[_0x0e87('0xd')](_0x0e87('0x21'),_0x58a012,JSON[_0x0e87('0x10')](_0x41460c));_0x2c7fde(_0x41460c);})['catch'](function(_0x174fe2){logger[_0x0e87('0x12')]('ShowTrigger',_0x174fe2[_0x0e87('0x14')],_0x58a012);_0x477993(_0x39b2f3[_0x0e87('0x12')](0x1f4,_0x174fe2[_0x0e87('0x14')]));});});}; \ No newline at end of file +var _0xd8a9=['info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','Trigger,\x20%s,\x20%s','message','GetTrigger','Trigger','options','raw','where','attributes','limit','map','include','model','ShowTrigger','find','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0xd8a9,0x11d));var _0x9d8a=function(_0x582a23,_0x1a835f){_0x582a23=_0x582a23-0x0;var _0x30f2e7=_0xd8a9[_0x582a23];return _0x30f2e7;};'use strict';var _=require(_0x9d8a('0x0'));var util=require(_0x9d8a('0x1'));var moment=require(_0x9d8a('0x2'));var BPromise=require(_0x9d8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d8a('0x4'));var db=require(_0x9d8a('0x5'))['db'];var utils=require(_0x9d8a('0x6'));var logger=require(_0x9d8a('0x7'))('rpc');var config=require(_0x9d8a('0x8'));var jayson=require(_0x9d8a('0x9'));var client=jayson[_0x9d8a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e981a,_0x20a2e2,_0x820d9e){return new BPromise(function(_0x3cd5df,_0x4ef31c){return client['request'](_0x4e981a,_0x820d9e)[_0x9d8a('0xb')](function(_0x4692a4){logger[_0x9d8a('0xc')]('Trigger,\x20%s,\x20%s',_0x20a2e2,_0x9d8a('0xd'));logger['debug'](_0x9d8a('0xe'),_0x20a2e2,'request\x20sent',JSON['stringify'](_0x4692a4));if(_0x4692a4[_0x9d8a('0xf')]){if(_0x4692a4[_0x9d8a('0xf')]['code']===0x1f4){logger[_0x9d8a('0xf')](_0x9d8a('0x10'),_0x20a2e2,_0x4692a4['error'][_0x9d8a('0x11')]);return _0x4ef31c(_0x4692a4[_0x9d8a('0xf')]['message']);}logger[_0x9d8a('0xf')](_0x9d8a('0x10'),_0x20a2e2,_0x4692a4[_0x9d8a('0xf')]['message']);return _0x3cd5df(_0x4692a4[_0x9d8a('0xf')][_0x9d8a('0x11')]);}else{logger[_0x9d8a('0xc')](_0x9d8a('0x10'),_0x20a2e2,_0x9d8a('0xd'));_0x3cd5df(_0x4692a4['result']['message']);}})['catch'](function(_0x483169){logger[_0x9d8a('0xf')](_0x9d8a('0x10'),_0x20a2e2,_0x483169);_0x4ef31c(_0x483169);});});}exports[_0x9d8a('0x12')]=function(_0x273365){var _0x2dff39=this;return new Promise(function(_0x1ff751,_0x18a993){return db[_0x9d8a('0x13')]['findAll']({'raw':_0x273365[_0x9d8a('0x14')]?_0x273365['options'][_0x9d8a('0x15')]===undefined?!![]:![]:!![],'where':_0x273365[_0x9d8a('0x14')]?_0x273365['options'][_0x9d8a('0x16')]||null:null,'attributes':_0x273365[_0x9d8a('0x14')]?_0x273365[_0x9d8a('0x14')][_0x9d8a('0x17')]||null:null,'limit':_0x273365[_0x9d8a('0x14')]?_0x273365[_0x9d8a('0x14')][_0x9d8a('0x18')]||null:null,'include':_0x273365[_0x9d8a('0x14')]?_0x273365[_0x9d8a('0x14')]['include']?_[_0x9d8a('0x19')](_0x273365[_0x9d8a('0x14')][_0x9d8a('0x1a')],function(_0x939539){return{'model':db[_0x939539[_0x9d8a('0x1b')]],'as':_0x939539['as'],'attributes':_0x939539['attributes'],'include':_0x939539[_0x9d8a('0x1a')]?_[_0x9d8a('0x19')](_0x939539[_0x9d8a('0x1a')],function(_0x7588af){return{'model':db[_0x7588af[_0x9d8a('0x1b')]],'as':_0x7588af['as'],'attributes':_0x7588af[_0x9d8a('0x17')],'include':_0x7588af['include']?_['map'](_0x7588af['include'],function(_0x424c74){return{'model':db[_0x424c74[_0x9d8a('0x1b')]],'as':_0x424c74['as'],'attributes':_0x424c74[_0x9d8a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x9d8a('0xb')](function(_0x55694e){logger[_0x9d8a('0xc')]('GetTrigger',_0x273365);logger['debug']('GetTrigger',_0x273365,JSON['stringify'](_0x55694e));_0x1ff751(_0x55694e);})['catch'](function(_0x3cb42d){logger['error'](_0x9d8a('0x12'),_0x3cb42d[_0x9d8a('0x11')],_0x273365);_0x18a993(_0x2dff39['error'](0x1f4,_0x3cb42d[_0x9d8a('0x11')]));});});};exports[_0x9d8a('0x1c')]=function(_0x2f3e05){var _0x3fe88d=this;return new Promise(function(_0x313c4a,_0x282853){return db[_0x9d8a('0x13')][_0x9d8a('0x1d')]({'raw':_0x2f3e05[_0x9d8a('0x14')]?_0x2f3e05[_0x9d8a('0x14')][_0x9d8a('0x15')]===undefined?!![]:![]:!![],'where':_0x2f3e05[_0x9d8a('0x14')]?_0x2f3e05[_0x9d8a('0x14')][_0x9d8a('0x16')]||null:null,'attributes':_0x2f3e05[_0x9d8a('0x14')]?_0x2f3e05[_0x9d8a('0x14')][_0x9d8a('0x17')]||null:null,'include':_0x2f3e05[_0x9d8a('0x14')]?_0x2f3e05[_0x9d8a('0x14')]['include']?_[_0x9d8a('0x19')](_0x2f3e05[_0x9d8a('0x14')][_0x9d8a('0x1a')],function(_0xc94c9b){return{'model':db[_0xc94c9b[_0x9d8a('0x1b')]],'as':_0xc94c9b['as'],'attributes':_0xc94c9b[_0x9d8a('0x17')],'include':_0xc94c9b[_0x9d8a('0x1a')]?_[_0x9d8a('0x19')](_0xc94c9b[_0x9d8a('0x1a')],function(_0x4150b0){return{'model':db[_0x4150b0[_0x9d8a('0x1b')]],'as':_0x4150b0['as'],'attributes':_0x4150b0[_0x9d8a('0x17')],'include':_0x4150b0[_0x9d8a('0x1a')]?_[_0x9d8a('0x19')](_0x4150b0[_0x9d8a('0x1a')],function(_0x487e36){return{'model':db[_0x487e36[_0x9d8a('0x1b')]],'as':_0x487e36['as'],'attributes':_0x487e36['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d8a('0xb')](function(_0x37c682){logger['info'](_0x9d8a('0x1c'),_0x2f3e05);logger[_0x9d8a('0x1e')](_0x9d8a('0x1c'),_0x2f3e05,JSON[_0x9d8a('0x1f')](_0x37c682));_0x313c4a(_0x37c682);})[_0x9d8a('0x20')](function(_0x593371){logger['error']('ShowTrigger',_0x593371[_0x9d8a('0x11')],_0x2f3e05);_0x282853(_0x3fe88d[_0x9d8a('0xf')](0x1f4,_0x593371['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b8f0753..d473f81 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 _0x9972=['show','post','/:id/clone','clone','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9972,0x103));var _0x2997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9972[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x2997('0x0'));var util=require(_0x2997('0x1'));var path=require(_0x2997('0x2'));var timeout=require(_0x2997('0x3'));var express=require('express');var router=express[_0x2997('0x4')]();var fs_extra=require(_0x2997('0x5'));var auth=require(_0x2997('0x6'));var interaction=require(_0x2997('0x7'));var config=require(_0x2997('0x8'));var controller=require(_0x2997('0x9'));router[_0x2997('0xa')]('/',auth[_0x2997('0xb')](),controller[_0x2997('0xc')]);router[_0x2997('0xa')](_0x2997('0xd'),auth[_0x2997('0xb')](),controller[_0x2997('0xe')]);router[_0x2997('0xf')](_0x2997('0x10'),auth[_0x2997('0xb')](),controller[_0x2997('0x11')]);router['post']('/',auth[_0x2997('0xb')](),controller['create']);router[_0x2997('0x12')]('/:id',auth[_0x2997('0xb')](),controller['update']);router[_0x2997('0x13')]('/:id',auth[_0x2997('0xb')](),controller['destroy']);module[_0x2997('0x14')]=router; \ No newline at end of file +var _0x28e6=['post','/:id/clone','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x28e6,0xee));var _0x628e=function(_0x4d8de3,_0x23f6eb){_0x4d8de3=_0x4d8de3-0x0;var _0x5b9e6f=_0x28e6[_0x4d8de3];return _0x5b9e6f;};'use strict';var multer=require(_0x628e('0x0'));var util=require(_0x628e('0x1'));var path=require(_0x628e('0x2'));var timeout=require(_0x628e('0x3'));var express=require(_0x628e('0x4'));var router=express[_0x628e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x628e('0x6'));var config=require(_0x628e('0x7'));var controller=require(_0x628e('0x8'));router[_0x628e('0x9')]('/',auth[_0x628e('0xa')](),controller[_0x628e('0xb')]);router['get'](_0x628e('0xc'),auth[_0x628e('0xa')](),controller[_0x628e('0xd')]);router[_0x628e('0xe')](_0x628e('0xf'),auth[_0x628e('0xa')](),controller['clone']);router[_0x628e('0xe')]('/',auth['isAuthenticated'](),controller[_0x628e('0x10')]);router[_0x628e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x628e('0x12')]);router[_0x628e('0x13')](_0x628e('0xc'),auth[_0x628e('0xa')](),controller['destroy']);module[_0x628e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 7a9349b..ad7d4e7 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 _0xd3fd=['name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','getDataValue','transport','split','rfc2833','inband','auto','yes','nonat','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','join','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING'];(function(_0x12b83d,_0x4bcec7){var _0x1fd39d=function(_0x449185){while(--_0x449185){_0x12b83d['push'](_0x12b83d['shift']());}};_0x1fd39d(++_0x4bcec7);}(_0xd3fd,0x175));var _0xdd3f=function(_0x27d487,_0x5205ea){_0x27d487=_0x27d487-0x0;var _0x548af4=_0xd3fd[_0x27d487];return _0x548af4;};'use strict';var Sequelize=require(_0xdd3f('0x0'));module[_0xdd3f('0x1')]={'name':{'type':Sequelize[_0xdd3f('0x2')],'allowNull':![],'unique':_0xdd3f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x5'),_0xdd3f('0x6'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdd3f('0x7')},'callingpres':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x8'),_0xdd3f('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0xdd3f('0xa'),_0xdd3f('0xb'),'PROHIB_FAILED_SCREEN',_0xdd3f('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xdd3f('0x2')]},'secret':{'type':Sequelize[_0xdd3f('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xdd3f('0x2')]},'transport':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':'udp','set':function(_0x1a1e5e){this[_0xdd3f('0xd')]('transport',_0x1a1e5e?_0x1a1e5e['join'](','):null);},'get':function(){return this[_0xdd3f('0xe')](_0xdd3f('0xf'))?this['getDataValue'](_0xdd3f('0xf'))[_0xdd3f('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x11'),'info','shortinfo',_0xdd3f('0x12'),_0xdd3f('0x13')),'defaultValue':_0xdd3f('0x11')},'directmedia':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no',_0xdd3f('0x15'),_0xdd3f('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdd3f('0x2')]},'directmediadeny':{'type':Sequelize[_0xdd3f('0x2')]},'nat':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':_0xdd3f('0x17'),'set':function(_0x512bc7){this[_0xdd3f('0xd')](_0xdd3f('0x18'),_0x512bc7?_0x512bc7['join'](','):null);},'get':function(){return this[_0xdd3f('0xe')](_0xdd3f('0x18'))?this[_0xdd3f('0xe')](_0xdd3f('0x18'))[_0xdd3f('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xdd3f('0x2')]},'namedcallgroup':{'type':Sequelize[_0xdd3f('0x2')]},'pickupgroup':{'type':Sequelize[_0xdd3f('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':_0xdd3f('0x19')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdd3f('0x1a'),'set':function(_0x5edded){this[_0xdd3f('0xd')](_0xdd3f('0x1b'),_0x5edded?_0x5edded[_0xdd3f('0x1c')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xdd3f('0xe')](_0xdd3f('0x1b'))?this[_0xdd3f('0xe')]('allow')[_0xdd3f('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'insecure':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':_0xdd3f('0x1d'),'set':function(_0x9e8d1){this['setDataValue'](_0xdd3f('0x1e'),_0x9e8d1?_0x9e8d1['join'](','):null);},'get':function(){return this[_0xdd3f('0xe')](_0xdd3f('0x1e'))?this['getDataValue']('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdd3f('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdd3f('0x4')]('yes','no',_0xdd3f('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no')},'useclientcode':{'type':Sequelize[_0xdd3f('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':_0xdd3f('0x20')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no'),'defaultValue':_0xdd3f('0x14')},'busylevel':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xdd3f('0x2')]},'template':{'type':Sequelize[_0xdd3f('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no',_0xdd3f('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'mailbox':{'type':Sequelize[_0xdd3f('0x2')]},'session_timers':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x23'),_0xdd3f('0x24'),_0xdd3f('0x25'))},'session_expires':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xdd3f('0x26'),_0xdd3f('0x27')),'defaultValue':_0xdd3f('0x27')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xdd3f('0x2')]},'fromdomain':{'type':Sequelize[_0xdd3f('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdd3f('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no'),'defaultValue':_0xdd3f('0x14')},'keepalive':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xdd3f('0x2')]},'defaultuser':{'type':Sequelize[_0xdd3f('0x2')]},'rtptimeout':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no',_0xdd3f('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xdd3f('0x2')]},'timert1':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'timerb':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xdd3f('0x2')]},'contactdeny':{'type':Sequelize[_0xdd3f('0x2')]},'contactacl':{'type':Sequelize[_0xdd3f('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xdd3f('0x2')]},'use_q850_reason':{'type':Sequelize[_0xdd3f('0x2')]},'maxforwards':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'encryption':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'force_avp':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'icesupport':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0xdd3f('0x29'))},'dtlsrekey':{'type':Sequelize[_0xdd3f('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0xdd3f('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xdd3f('0x2')]},'dtlscafile':{'type':Sequelize[_0xdd3f('0x2')]},'dtlscapath':{'type':Sequelize[_0xdd3f('0x2')]},'dtlssetup':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x2a'),_0xdd3f('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdd3f('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0xdd3f('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdd3f('0x2')]},'recordofffeature':{'type':Sequelize[_0xdd3f('0x2')]},'call_limit':{'type':Sequelize[_0xdd3f('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xdd3f('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xdd3f('0x4')](_0xdd3f('0x14'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xdd3f('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xdd3f('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':_0xdd3f('0x2c')},'canreinvite':{'type':Sequelize[_0xdd3f('0x4')]('yes','no',_0xdd3f('0x15'),_0xdd3f('0x16'),_0xdd3f('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xdd3f('0x2')]},'otherFields':{'type':Sequelize[_0xdd3f('0x2')]},'active':{'type':Sequelize[_0xdd3f('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xdd3f('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1cc5=['update','outgoing','force_rport,comedia','setDataValue','nat','allow','ulaw;alaw;gsm','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','\x22\x22\x20<>','refuse','originate','INTEGER','uac','uas','pai','fingerprint','certificate','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','inband','yes','nonat'];(function(_0x1700ee,_0x41933a){var _0x1f7a31=function(_0x330a3b){while(--_0x330a3b){_0x1700ee['push'](_0x1700ee['shift']());}};_0x1f7a31(++_0x41933a);}(_0x1cc5,0xb2));var _0x51cc=function(_0x279f32,_0x19a015){_0x279f32=_0x279f32-0x0;var _0x42e7d1=_0x1cc5[_0x279f32];return _0x42e7d1;};'use strict';var Sequelize=require(_0x51cc('0x0'));module[_0x51cc('0x1')]={'name':{'type':Sequelize[_0x51cc('0x2')],'allowNull':![],'unique':_0x51cc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x51cc('0x4'),_0x51cc('0x5')),'allowNull':![],'defaultValue':_0x51cc('0x6')},'context':{'type':Sequelize[_0x51cc('0x2')],'allowNull':![],'defaultValue':_0x51cc('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x51cc('0x8'),_0x51cc('0x9'),_0x51cc('0xa'),_0x51cc('0xb'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x51cc('0xc'),_0x51cc('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x51cc('0x2')]},'secret':{'type':Sequelize[_0x51cc('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x51cc('0x2')]},'transport':{'type':Sequelize[_0x51cc('0x2')],'defaultValue':_0x51cc('0xe'),'set':function(_0x4b4602){this['setDataValue'](_0x51cc('0xf'),_0x4b4602?_0x4b4602[_0x51cc('0x10')](','):null);},'get':function(){return this[_0x51cc('0x11')](_0x51cc('0xf'))?this[_0x51cc('0x11')](_0x51cc('0xf'))[_0x51cc('0x12')](','):null;},'comment':_0x51cc('0x13')},'dtmfmode':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x15'),_0x51cc('0x16'),'shortinfo',_0x51cc('0x17'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no',_0x51cc('0x19'),_0x51cc('0x1a'),_0x51cc('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x51cc('0x2')]},'directmediadeny':{'type':Sequelize[_0x51cc('0x2')]},'nat':{'type':Sequelize[_0x51cc('0x2')],'defaultValue':_0x51cc('0x1c'),'set':function(_0x28ba5d){this[_0x51cc('0x1d')](_0x51cc('0x1e'),_0x28ba5d?_0x28ba5d[_0x51cc('0x10')](','):null);},'get':function(){return this[_0x51cc('0x11')](_0x51cc('0x1e'))?this['getDataValue'](_0x51cc('0x1e'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x51cc('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x51cc('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x51cc('0x2')]},'language':{'type':Sequelize[_0x51cc('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x51cc('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x51cc('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x51cc('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5ef10a){this[_0x51cc('0x1d')](_0x51cc('0x1f'),_0x5ef10a?_0x5ef10a[_0x51cc('0x10')](';'):_0x51cc('0x20'));},'get':function(){return this[_0x51cc('0x11')](_0x51cc('0x1f'))?this['getDataValue'](_0x51cc('0x1f'))[_0x51cc('0x12')](';'):null;},'comment':_0x51cc('0x21')},'autoframing':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x51cc('0x22'),'set':function(_0x4c065e){this[_0x51cc('0x1d')](_0x51cc('0x23'),_0x4c065e?_0x4c065e[_0x51cc('0x10')](','):null);},'get':function(){return this[_0x51cc('0x11')]('insecure')?this['getDataValue'](_0x51cc('0x23'))[_0x51cc('0x12')](','):null;},'comment':_0x51cc('0x24')},'trustrpid':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no',_0x51cc('0x25'))},'promiscredir':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x51cc('0x2')]},'callerid':{'type':Sequelize[_0x51cc('0x2')],'defaultValue':_0x51cc('0x26')},'amaflags':{'type':Sequelize[_0x51cc('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no'),'defaultValue':_0x51cc('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x51cc('0x14')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x51cc('0x2')]},'template':{'type':Sequelize[_0x51cc('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'mailbox':{'type':Sequelize[_0x51cc('0x2')]},'session_timers':{'type':Sequelize[_0x51cc('0x14')]('accept',_0x51cc('0x27'),_0x51cc('0x28'))},'session_expires':{'type':Sequelize[_0x51cc('0x29')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x2a'),_0x51cc('0x2b')),'defaultValue':_0x51cc('0x2b')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x51cc('0x2')]},'fromuser':{'type':Sequelize[_0x51cc('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no'),'defaultValue':_0x51cc('0x18')},'keepalive':{'type':Sequelize[_0x51cc('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x51cc('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x51cc('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x51cc('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x51cc('0x29')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x51cc('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x51cc('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x51cc('0x29')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x51cc('0x2')]},'contactacl':{'type':Sequelize[_0x51cc('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x51cc('0x29')](0xb)},'encryption':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no')},'force_avp':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'icesupport':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no',_0x51cc('0x2d'),_0x51cc('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x51cc('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x51cc('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x51cc('0x2')]},'dtlscipher':{'type':Sequelize[_0x51cc('0x2')]},'dtlscafile':{'type':Sequelize[_0x51cc('0x2')]},'dtlscapath':{'type':Sequelize[_0x51cc('0x2')]},'dtlssetup':{'type':Sequelize[_0x51cc('0x14')]('active',_0x51cc('0x2f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x51cc('0x2')]},'usereqphone':{'type':Sequelize[_0x51cc('0x14')](_0x51cc('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x51cc('0x2')]},'recordofffeature':{'type':Sequelize[_0x51cc('0x2')]},'call_limit':{'type':Sequelize[_0x51cc('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x51cc('0x18'),'no')},'vmexten':{'type':Sequelize[_0x51cc('0x2')]},'mohinterpret':{'type':Sequelize[_0x51cc('0x2')]},'mohsuggest':{'type':Sequelize[_0x51cc('0x2')]},'parkinglot':{'type':Sequelize[_0x51cc('0x2')]},'description':{'type':Sequelize[_0x51cc('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x51cc('0x30')},'canreinvite':{'type':Sequelize[_0x51cc('0x14')]('yes','no',_0x51cc('0x19'),'update',_0x51cc('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x51cc('0x2')]},'active':{'type':Sequelize[_0x51cc('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x51cc('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 4760b8e..cd4fd2f 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 _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\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','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x81bd,0x7c));var _0xd81b=function(_0x40e41e,_0x3d30e7){_0x40e41e=_0x40e41e-0x0;var _0x18b70c=_0x81bd[_0x40e41e];return _0x18b70c;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file +var _0x9f62=['updatedAt','body','create','user','role','UserProfileSection','autoAssociation','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','render','/etc/asterisk/sip_xcally_trunks.conf','Reload','server/files/templates/registry.ejs','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','get','Trunks','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','params','clone','find','omit','createdAt'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0x9f62,0x154));var _0x29f6=function(_0xe2cd35,_0x50c2de){_0xe2cd35=_0xe2cd35-0x0;var _0x7184e1=_0x9f62[_0xe2cd35];return _0x7184e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x29f6('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x55cf4,_0x189344,_0x11a1fd,_0x17de6e){return new BPromise(function(_0x156c96,_0x35d2e2){var _0x2418ee=_0x17de6e||client;return _0x2418ee[_0x29f6('0x14')](_0x55cf4,_0x11a1fd)[_0x29f6('0x15')](function(_0x28d314){logger[_0x29f6('0x16')](_0x29f6('0x17'),_0x189344,_0x29f6('0x18'));logger[_0x29f6('0x19')](_0x29f6('0x1a'),_0x189344,_0x29f6('0x18'),JSON['stringify'](_0x28d314));if(_0x28d314['error']){if(_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){logger[_0x29f6('0x1b')]('Trunk,\x20%s,\x20%s',_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x35d2e2(_0x28d314['error'][_0x29f6('0x1d')]);}logger[_0x29f6('0x1b')](_0x29f6('0x17'),_0x189344,_0x28d314[_0x29f6('0x1b')][_0x29f6('0x1d')]);return _0x156c96(_0x28d314[_0x29f6('0x1b')]['message']);}else{logger[_0x29f6('0x16')]('Trunk,\x20%s,\x20%s',_0x189344,'request\x20sent');_0x156c96(_0x28d314[_0x29f6('0x1e')][_0x29f6('0x1d')]);}})[_0x29f6('0x1f')](function(_0xafb5dd){logger['error'](_0x29f6('0x17'),_0x189344,_0xafb5dd);_0x35d2e2(_0xafb5dd);});});}function respondWithStatusCode(_0x49f67d,_0xd4179c){_0xd4179c=_0xd4179c||0xcc;return function(_0xcce041){if(_0xcce041){return _0x49f67d[_0x29f6('0x20')](_0xd4179c);}return _0x49f67d[_0x29f6('0x21')](_0xd4179c)['end']();};}function respondWithResult(_0x4290a2,_0x4d494f){_0x4d494f=_0x4d494f||0xc8;return function(_0x47c385){if(_0x47c385){return _0x4290a2[_0x29f6('0x21')](_0x4d494f)[_0x29f6('0x22')](_0x47c385);}};}function respondWithFilteredResult(_0x2519ac,_0x342038){return function(_0x84ccb7){if(_0x84ccb7){var _0x4333bc=typeof _0x342038[_0x29f6('0x23')]==='undefined'&&typeof _0x342038[_0x29f6('0x24')]===_0x29f6('0x25');var _0x1ab8d8=_0x84ccb7[_0x29f6('0x26')];var _0xda0a63=_0x4333bc?0x0:_0x342038[_0x29f6('0x23')];var _0x3790f5=_0x4333bc?_0x84ccb7[_0x29f6('0x26')]:_0x342038[_0x29f6('0x23')]+_0x342038[_0x29f6('0x24')];var _0x2915bc;if(_0x3790f5>=_0x1ab8d8){_0x3790f5=_0x1ab8d8;_0x2915bc=0xc8;}else{_0x2915bc=0xce;}_0x2519ac[_0x29f6('0x21')](_0x2915bc);return _0x2519ac[_0x29f6('0x27')](_0x29f6('0x28'),_0xda0a63+'-'+_0x3790f5+'/'+_0x1ab8d8)[_0x29f6('0x22')](_0x84ccb7);}return null;};}function patchUpdates(_0x218931){return function(_0x3a7249){try{jsonpatch['apply'](_0x3a7249,_0x218931,!![]);}catch(_0x5582d3){return BPromise[_0x29f6('0x29')](_0x5582d3);}return _0x3a7249['save']();};}function saveUpdates(_0x341071,_0xc8d2c5){return function(_0x1e1bb6){if(_0x1e1bb6){return _0x1e1bb6[_0x29f6('0x2a')](_0x341071)['then'](function(_0x53e11f){return _0x53e11f;});}return null;};}function removeEntity(_0x1bde69,_0xa6377c){return function(_0x2edc2e){if(_0x2edc2e){return _0x2edc2e[_0x29f6('0x2b')]()[_0x29f6('0x15')](function(){var _0x20bc5e=_0x2edc2e[_0x29f6('0x2c')]({'plain':!![]});var _0x1c3f0f=_0x29f6('0x2d');return db[_0x29f6('0x2e')][_0x29f6('0x2b')]({'where':{'type':_0x1c3f0f,'resourceId':_0x20bc5e['id']}})[_0x29f6('0x15')](function(){return _0x2edc2e;});})[_0x29f6('0x15')](function(){_0x1bde69[_0x29f6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e31dd,_0x206beb){return function(_0x44cf19){if(!_0x44cf19){_0x5e31dd[_0x29f6('0x20')](0x194);}return _0x44cf19;};}function handleError(_0x5416dc,_0x3e1e25){_0x3e1e25=_0x3e1e25||0x1f4;return function(_0x749b9d){logger[_0x29f6('0x1b')](_0x749b9d[_0x29f6('0x2f')]);if(_0x749b9d[_0x29f6('0x30')]){delete _0x749b9d['name'];}_0x5416dc[_0x29f6('0x21')](_0x3e1e25)[_0x29f6('0x31')](_0x749b9d);};}exports[_0x29f6('0x32')]=function(_0x1b51cc,_0x4f5fe1){var _0x30d747={},_0x2a09e8={},_0x14b392={'count':0x0,'rows':[]};var _0x105557=_['map'](db['Trunk'][_0x29f6('0x33')],function(_0x4bfc80){return{'name':_0x4bfc80[_0x29f6('0x34')],'type':_0x4bfc80['type'][_0x29f6('0x35')]};});_0x2a09e8['model']=_[_0x29f6('0x36')](_0x105557,_0x29f6('0x30'));_0x2a09e8['query']=_[_0x29f6('0x37')](_0x1b51cc['query']);_0x2a09e8[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x2a09e8['model'],_0x2a09e8[_0x29f6('0x3a')]);_0x30d747[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2a09e8[_0x29f6('0x3c')],qs['fields'](_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x3d')]));_0x30d747[_0x29f6('0x3b')]=_0x30d747[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x30d747['attributes']:_0x2a09e8[_0x29f6('0x3c')];if(!_0x1b51cc['query'][_0x29f6('0x3f')]('nolimit')){_0x30d747[_0x29f6('0x24')]=qs[_0x29f6('0x24')](_0x1b51cc['query'][_0x29f6('0x24')]);_0x30d747[_0x29f6('0x23')]=qs[_0x29f6('0x23')](_0x1b51cc[_0x29f6('0x3a')]['offset']);}_0x30d747[_0x29f6('0x40')]=qs[_0x29f6('0x41')](_0x1b51cc[_0x29f6('0x3a')]['sort']);_0x30d747[_0x29f6('0x42')]=qs['filters'](_[_0x29f6('0x43')](_0x1b51cc['query'],_0x2a09e8['filters']),_0x105557);if(_0x1b51cc['query'][_0x29f6('0x44')]){_0x30d747[_0x29f6('0x42')]=_[_0x29f6('0x45')](_0x30d747[_0x29f6('0x42')],{'$or':_[_0x29f6('0x36')](_0x105557,function(_0x270842){if(_0x270842[_0x29f6('0x46')]!==_0x29f6('0x47')){var _0x352119={};_0x352119[_0x270842[_0x29f6('0x30')]]={'$like':'%'+_0x1b51cc['query']['filter']+'%'};return _0x352119;}})});}_0x30d747=_[_0x29f6('0x45')]({},_0x30d747,_0x1b51cc[_0x29f6('0x48')]);var _0x7a65c0={'where':_0x30d747[_0x29f6('0x42')]};return db['Trunk'][_0x29f6('0x26')](_0x7a65c0)[_0x29f6('0x15')](function(_0x532df5){_0x14b392[_0x29f6('0x26')]=_0x532df5;if(_0x1b51cc[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x30d747[_0x29f6('0x4a')]=[{'all':!![]}];}return db[_0x29f6('0x4b')][_0x29f6('0x4c')](_0x30d747);})[_0x29f6('0x15')](function(_0x1f03b6){_0x14b392[_0x29f6('0x4d')]=_0x1f03b6;return _0x14b392;})[_0x29f6('0x15')](respondWithFilteredResult(_0x4f5fe1,_0x30d747))[_0x29f6('0x1f')](handleError(_0x4f5fe1,null));};exports[_0x29f6('0x4e')]=function(_0x58ea69,_0x416c24){var _0x463551={'raw':![],'where':{'id':_0x58ea69[_0x29f6('0x4f')]['id']}},_0x335ec1={};_0x335ec1[_0x29f6('0x3c')]=_['keys'](db[_0x29f6('0x4b')]['rawAttributes']);_0x335ec1['query']=_[_0x29f6('0x37')](_0x58ea69[_0x29f6('0x3a')]);_0x335ec1[_0x29f6('0x38')]=_[_0x29f6('0x39')](_0x335ec1[_0x29f6('0x3c')],_0x335ec1['query']);_0x463551[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x335ec1['model'],qs[_0x29f6('0x3d')](_0x58ea69['query'][_0x29f6('0x3d')]));_0x463551[_0x29f6('0x3b')]=_0x463551[_0x29f6('0x3b')][_0x29f6('0x3e')]?_0x463551['attributes']:_0x335ec1[_0x29f6('0x3c')];if(_0x58ea69[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x463551[_0x29f6('0x4a')]=[{'all':!![]}];}_0x463551=_[_0x29f6('0x45')]({},_0x463551,_0x58ea69[_0x29f6('0x48')]);return db[_0x29f6('0x4b')]['find'](_0x463551)[_0x29f6('0x15')](handleEntityNotFound(_0x416c24,null))[_0x29f6('0x15')](respondWithResult(_0x416c24,null))[_0x29f6('0x1f')](handleError(_0x416c24,null));};exports[_0x29f6('0x50')]=function(_0x36e52c,_0x1ac20d){var _0x37c3c1={'where':{'id':_0x36e52c[_0x29f6('0x4f')]['id']}},_0x2f356d={};_0x2f356d[_0x29f6('0x3c')]=_['keys'](db['Trunk'][_0x29f6('0x33')]);_0x37c3c1[_0x29f6('0x3b')]=_[_0x29f6('0x39')](_0x2f356d['model'],qs[_0x29f6('0x3d')](_0x36e52c['query']['fields']));_0x37c3c1[_0x29f6('0x3b')]=_0x37c3c1[_0x29f6('0x3b')]['length']?_0x37c3c1['attributes']:_0x2f356d[_0x29f6('0x3c')];if(_0x36e52c[_0x29f6('0x3a')][_0x29f6('0x49')]){_0x37c3c1['include']=[{'all':!![]}];}_0x37c3c1=_[_0x29f6('0x45')]({},_0x37c3c1,_0x36e52c[_0x29f6('0x48')]);return db[_0x29f6('0x4b')][_0x29f6('0x51')](_0x37c3c1)[_0x29f6('0x15')](handleEntityNotFound(_0x1ac20d,null))[_0x29f6('0x15')](function(_0x7700da){if(_0x7700da){var _0x33b1d7=_0x7700da[_0x29f6('0x2c')]({'plain':!![]});_0x33b1d7=qs[_0x29f6('0x52')](_0x33b1d7,['id',_0x29f6('0x53'),_0x29f6('0x54')]);_0x36e52c[_0x29f6('0x55')]=_['omit'](_0x36e52c['body'],['id',_0x29f6('0x53'),'updatedAt']);return db[_0x29f6('0x4b')][_0x29f6('0x56')](_[_0x29f6('0x45')](_0x33b1d7,_0x36e52c[_0x29f6('0x55')]),{'include':_0x36e52c[_0x29f6('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x29f6('0x15')](function(_0x38d684){var _0x2f694e=_0x36e52c[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x2f694e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f694e[_0x29f6('0x58')]==='user'){var _0x51b9dc=_0x38d684[_0x29f6('0x2c')]({'plain':!![]});var _0x336b8e='Trunks';return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':_0x336b8e,'userProfileId':_0x2f694e['userProfileId']},'raw':!![]})[_0x29f6('0x15')](function(_0x2ba44c){if(_0x2ba44c&&_0x2ba44c[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')][_0x29f6('0x56')]({'name':_0x51b9dc[_0x29f6('0x30')],'resourceId':_0x51b9dc['id'],'type':_0x2ba44c[_0x29f6('0x30')],'sectionId':_0x2ba44c['id']},{})['then'](function(){return _0x38d684;});}else{return _0x38d684;}})[_0x29f6('0x1f')](function(_0x50ddd6){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50ddd6);throw _0x50ddd6;});}return _0x38d684;});}})['then'](respondWithResult(_0x1ac20d,0xc9))[_0x29f6('0x1f')](handleError(_0x1ac20d,null));};exports[_0x29f6('0x56')]=function(_0x195887,_0x536b0c,_0x6ae738){var _0x373cf6;return db[_0x29f6('0x4b')]['create'](_0x195887[_0x29f6('0x55')],{'raw':!![]})[_0x29f6('0x15')](function(_0x66a7bb){_0x373cf6=_0x66a7bb;return db[_0x29f6('0x4b')][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x6587f3){var _0x41c1b9=fs['readFileSync'](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x1636f1=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],'server/files/templates/registry.ejs'),_0x29f6('0x5e'));var _0x1ca187=ejs['render'](_0x41c1b9,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1ca187);if(_0x373cf6[_0x29f6('0x61')]){var _0x5a383f=ejs['render'](_0x1636f1,{'trunks':_0x6587f3||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x5a383f);}})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x29f6('0x63')});})[_0x29f6('0x15')](function(){var _0x144c76=_0x195887[_0x29f6('0x57')][_0x29f6('0x2c')]({'plain':!![]});if(!_0x144c76)throw new Error(_0x29f6('0x64'));if(_0x144c76[_0x29f6('0x58')]==='user'){var _0x11ef85=_0x373cf6[_0x29f6('0x2c')]({'plain':!![]});return db[_0x29f6('0x59')][_0x29f6('0x51')]({'where':{'name':'Trunks','userProfileId':_0x144c76[_0x29f6('0x65')]},'raw':!![]})[_0x29f6('0x15')](function(_0x32a862){if(_0x32a862&&_0x32a862[_0x29f6('0x5a')]===0x0){return db[_0x29f6('0x2e')]['create']({'name':_0x11ef85[_0x29f6('0x30')],'resourceId':_0x11ef85['id'],'type':_0x32a862[_0x29f6('0x30')],'sectionId':_0x32a862['id']},{})[_0x29f6('0x15')](function(){return _0x373cf6;});}else{return _0x373cf6;}})[_0x29f6('0x1f')](function(_0x4273a3){logger[_0x29f6('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4273a3);throw _0x4273a3;});}return _0x373cf6;})[_0x29f6('0x15')](respondWithResult(_0x536b0c,0xc9))['catch'](handleError(_0x536b0c,null));};exports['update']=function(_0x4f9907,_0x842ae3,_0x5bcf90){var _0x425da2;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x4f9907[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x842ae3,null))[_0x29f6('0x15')](saveUpdates(_0x4f9907[_0x29f6('0x55')],null))['then'](function(_0x3a23f3){if(_0x3a23f3){_0x425da2=_0x3a23f3;return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});}})[_0x29f6('0x15')](function(_0x32fa77){if(_0x32fa77){var _0x1d6e32=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0xe14459=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0xa31c7d=ejs[_0x29f6('0x66')](_0x1d6e32,{'trunks':_0x32fa77||[]});fs['writeFileSync'](_0x29f6('0x67'),_0xa31c7d);var _0x57b9fb=ejs[_0x29f6('0x66')](_0xe14459,{'trunks':_0x32fa77||[]});fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x57b9fb);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2a'),{'module':_0x29f6('0x63')});}return null;})[_0x29f6('0x15')](function(_0x4203f1){if(_0x4203f1){return _0x425da2;}})[_0x29f6('0x15')](respondWithResult(_0x842ae3,null))[_0x29f6('0x1f')](handleError(_0x842ae3,null));};exports['destroy']=function(_0x1d61ff,_0x4c0acc,_0x16bb3c){var _0x144d8c;return db[_0x29f6('0x4b')][_0x29f6('0x51')]({'where':{'id':_0x1d61ff[_0x29f6('0x4f')]['id']}})[_0x29f6('0x15')](handleEntityNotFound(_0x4c0acc,null))[_0x29f6('0x15')](removeEntity(_0x4c0acc,null))[_0x29f6('0x15')](function(){return db['Trunk'][_0x29f6('0x4c')]({'raw':!![]});})[_0x29f6('0x15')](function(_0x4e185f){var _0x4bb53f=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x5d')),_0x29f6('0x5e'));var _0x906098=fs[_0x29f6('0x5f')](path[_0x29f6('0x5b')](config[_0x29f6('0x5c')],_0x29f6('0x69')),_0x29f6('0x5e'));var _0x3f51fa=ejs['render'](_0x4bb53f,{'trunks':_0x4e185f});var _0x4b9631=ejs[_0x29f6('0x66')](_0x906098,{'trunks':_0x4e185f});fs[_0x29f6('0x60')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3f51fa);fs[_0x29f6('0x60')](_0x29f6('0x62'),_0x4b9631);return respondWithRpcPromise(_0x29f6('0x68'),_0x29f6('0x2b'),{'module':_0x29f6('0x63')});})[_0x29f6('0x1f')](handleError(_0x4c0acc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9ef300a..216efb4 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 _0x19e7=['./trunk.attributes','exports','Trunk','tools_trunks','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4c70ee,_0x473881){var _0x27c11f=function(_0x3676c1){while(--_0x3676c1){_0x4c70ee['push'](_0x4c70ee['shift']());}};_0x27c11f(++_0x473881);}(_0x19e7,0xc4));var _0x719e=function(_0x40e885,_0x578298){_0x40e885=_0x40e885-0x0;var _0xe3d727=_0x19e7[_0x40e885];return _0xe3d727;};'use strict';var _=require('lodash');var util=require(_0x719e('0x0'));var logger=require(_0x719e('0x1'))(_0x719e('0x2'));var moment=require(_0x719e('0x3'));var BPromise=require('bluebird');var rp=require(_0x719e('0x4'));var fs=require('fs');var path=require(_0x719e('0x5'));var rimraf=require(_0x719e('0x6'));var config=require(_0x719e('0x7'));var attributes=require(_0x719e('0x8'));module[_0x719e('0x9')]=function(_0x3a4a20,_0x1b7f0){return _0x3a4a20['define'](_0x719e('0xa'),attributes,{'tableName':_0x719e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2268=['rimraf','../../config/environment','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5f4e56,_0x592e0a){var _0x5ad71b=function(_0x5433db){while(--_0x5433db){_0x5f4e56['push'](_0x5f4e56['shift']());}};_0x5ad71b(++_0x592e0a);}(_0x2268,0xc6));var _0x8226=function(_0x17c7db,_0x3ee800){_0x17c7db=_0x17c7db-0x0;var _0xf31dda=_0x2268[_0x17c7db];return _0xf31dda;};'use strict';var _=require(_0x8226('0x0'));var util=require(_0x8226('0x1'));var logger=require(_0x8226('0x2'))(_0x8226('0x3'));var moment=require(_0x8226('0x4'));var BPromise=require('bluebird');var rp=require(_0x8226('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8226('0x6'));var config=require(_0x8226('0x7'));var attributes=require('./trunk.attributes');module[_0x8226('0x8')]=function(_0x1140be,_0x3707ea){return _0x1140be[_0x8226('0x9')](_0x8226('0xa'),attributes,{'tableName':_0x8226('0xb'),'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 83a5a39..9d201d3 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 _0x7a34=['code','Trunk,\x20%s,\x20%s','message','result','catch','options','raw','attributes','limit','include','model','map','GetTrunk','ShowTrunk','Trunk','find','moment','bluebird','ioredis','../../mysqldb','rpc','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x3bafae,_0x44ab3d){var _0x44a8b5=function(_0x37a7c4){while(--_0x37a7c4){_0x3bafae['push'](_0x3bafae['shift']());}};_0x44a8b5(++_0x44ab3d);}(_0x7a34,0xa6));var _0x47a3=function(_0x496a7e,_0x11537e){_0x496a7e=_0x496a7e-0x0;var _0xb10022=_0x7a34[_0x496a7e];return _0xb10022;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x47a3('0x0'));var BPromise=require(_0x47a3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47a3('0x2'));var db=require(_0x47a3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x47a3('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x47a3('0x5')][_0x47a3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x43c8c0,_0x3b645e,_0x47c1ed){return new BPromise(function(_0x40f788,_0x47ec91){return client[_0x47a3('0x7')](_0x43c8c0,_0x47c1ed)[_0x47a3('0x8')](function(_0x34531a){logger[_0x47a3('0x9')]('Trunk,\x20%s,\x20%s',_0x3b645e,_0x47a3('0xa'));logger[_0x47a3('0xb')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3b645e,_0x47a3('0xa'),JSON[_0x47a3('0xc')](_0x34531a));if(_0x34531a['error']){if(_0x34531a[_0x47a3('0xd')][_0x47a3('0xe')]===0x1f4){logger[_0x47a3('0xd')](_0x47a3('0xf'),_0x3b645e,_0x34531a[_0x47a3('0xd')][_0x47a3('0x10')]);return _0x47ec91(_0x34531a[_0x47a3('0xd')][_0x47a3('0x10')]);}logger[_0x47a3('0xd')](_0x47a3('0xf'),_0x3b645e,_0x34531a['error'][_0x47a3('0x10')]);return _0x40f788(_0x34531a[_0x47a3('0xd')][_0x47a3('0x10')]);}else{logger[_0x47a3('0x9')](_0x47a3('0xf'),_0x3b645e,'request\x20sent');_0x40f788(_0x34531a[_0x47a3('0x11')][_0x47a3('0x10')]);}})[_0x47a3('0x12')](function(_0x544d15){logger[_0x47a3('0xd')](_0x47a3('0xf'),_0x3b645e,_0x544d15);_0x47ec91(_0x544d15);});});}exports['GetTrunk']=function(_0x3ccb16){var _0xb1453f=this;return new Promise(function(_0x277b51,_0x23e56e){return db['Trunk']['findAll']({'raw':_0x3ccb16[_0x47a3('0x13')]?_0x3ccb16[_0x47a3('0x13')][_0x47a3('0x14')]===undefined?!![]:![]:!![],'where':_0x3ccb16[_0x47a3('0x13')]?_0x3ccb16[_0x47a3('0x13')]['where']||null:null,'attributes':_0x3ccb16[_0x47a3('0x13')]?_0x3ccb16[_0x47a3('0x13')][_0x47a3('0x15')]||null:null,'limit':_0x3ccb16[_0x47a3('0x13')]?_0x3ccb16['options'][_0x47a3('0x16')]||null:null,'include':_0x3ccb16[_0x47a3('0x13')]?_0x3ccb16['options'][_0x47a3('0x17')]?_['map'](_0x3ccb16['options']['include'],function(_0x24e311){return{'model':db[_0x24e311[_0x47a3('0x18')]],'as':_0x24e311['as'],'attributes':_0x24e311['attributes'],'include':_0x24e311['include']?_[_0x47a3('0x19')](_0x24e311[_0x47a3('0x17')],function(_0x431a93){return{'model':db[_0x431a93['model']],'as':_0x431a93['as'],'attributes':_0x431a93[_0x47a3('0x15')],'include':_0x431a93[_0x47a3('0x17')]?_['map'](_0x431a93[_0x47a3('0x17')],function(_0x2f7702){return{'model':db[_0x2f7702['model']],'as':_0x2f7702['as'],'attributes':_0x2f7702['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dba1e){logger['info'](_0x47a3('0x1a'),_0x3ccb16);logger[_0x47a3('0xb')]('GetTrunk',_0x3ccb16,JSON['stringify'](_0x1dba1e));_0x277b51(_0x1dba1e);})['catch'](function(_0x55f5a6){logger['error'](_0x47a3('0x1a'),_0x55f5a6['message'],_0x3ccb16);_0x23e56e(_0xb1453f['error'](0x1f4,_0x55f5a6['message']));});});};exports[_0x47a3('0x1b')]=function(_0x44f679){var _0x301021=this;return new Promise(function(_0x16f8ec,_0xa064a9){return db[_0x47a3('0x1c')][_0x47a3('0x1d')]({'raw':_0x44f679['options']?_0x44f679[_0x47a3('0x13')][_0x47a3('0x14')]===undefined?!![]:![]:!![],'where':_0x44f679['options']?_0x44f679[_0x47a3('0x13')]['where']||null:null,'attributes':_0x44f679[_0x47a3('0x13')]?_0x44f679[_0x47a3('0x13')][_0x47a3('0x15')]||null:null,'include':_0x44f679[_0x47a3('0x13')]?_0x44f679[_0x47a3('0x13')]['include']?_[_0x47a3('0x19')](_0x44f679[_0x47a3('0x13')][_0x47a3('0x17')],function(_0x5b750f){return{'model':db[_0x5b750f[_0x47a3('0x18')]],'as':_0x5b750f['as'],'attributes':_0x5b750f[_0x47a3('0x15')],'include':_0x5b750f['include']?_[_0x47a3('0x19')](_0x5b750f[_0x47a3('0x17')],function(_0x42d1fd){return{'model':db[_0x42d1fd[_0x47a3('0x18')]],'as':_0x42d1fd['as'],'attributes':_0x42d1fd[_0x47a3('0x15')],'include':_0x42d1fd[_0x47a3('0x17')]?_['map'](_0x42d1fd[_0x47a3('0x17')],function(_0x344143){return{'model':db[_0x344143[_0x47a3('0x18')]],'as':_0x344143['as'],'attributes':_0x344143[_0x47a3('0x15')]};}):[]};}):[]};}):[]:[]})[_0x47a3('0x8')](function(_0x1cdfa8){logger[_0x47a3('0x9')](_0x47a3('0x1b'),_0x44f679);logger[_0x47a3('0xb')](_0x47a3('0x1b'),_0x44f679,JSON['stringify'](_0x1cdfa8));_0x16f8ec(_0x1cdfa8);})[_0x47a3('0x12')](function(_0x2389c6){logger[_0x47a3('0xd')](_0x47a3('0x1b'),_0x2389c6['message'],_0x44f679);_0xa064a9(_0x301021[_0x47a3('0xd')](0x1f4,_0x2389c6[_0x47a3('0x10')]));});});}; \ No newline at end of file +var _0x8477=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','map','find','model','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x31295c,_0x29ab4b){var _0x1d1357=function(_0x1ca60a){while(--_0x1ca60a){_0x31295c['push'](_0x31295c['shift']());}};_0x1d1357(++_0x29ab4b);}(_0x8477,0xcb));var _0x7847=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x8477[_0x4d21ff];return _0x22b554;};'use strict';var _=require(_0x7847('0x0'));var util=require(_0x7847('0x1'));var moment=require(_0x7847('0x2'));var BPromise=require(_0x7847('0x3'));var rs=require(_0x7847('0x4'));var fs=require('fs');var Redis=require(_0x7847('0x5'));var db=require(_0x7847('0x6'))['db'];var utils=require(_0x7847('0x7'));var logger=require(_0x7847('0x8'))('rpc');var config=require(_0x7847('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7847('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c089b,_0x29739b,_0x3f3947){return new BPromise(function(_0x21ee86,_0xb2eaf0){return client[_0x7847('0xb')](_0x2c089b,_0x3f3947)[_0x7847('0xc')](function(_0x191d88){logger[_0x7847('0xd')](_0x7847('0xe'),_0x29739b,_0x7847('0xf'));logger[_0x7847('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x29739b,_0x7847('0xf'),JSON[_0x7847('0x11')](_0x191d88));if(_0x191d88[_0x7847('0x12')]){if(_0x191d88[_0x7847('0x12')][_0x7847('0x13')]===0x1f4){logger[_0x7847('0x12')](_0x7847('0xe'),_0x29739b,_0x191d88['error']['message']);return _0xb2eaf0(_0x191d88['error']['message']);}logger['error'](_0x7847('0xe'),_0x29739b,_0x191d88['error'][_0x7847('0x14')]);return _0x21ee86(_0x191d88['error'][_0x7847('0x14')]);}else{logger[_0x7847('0xd')](_0x7847('0xe'),_0x29739b,_0x7847('0xf'));_0x21ee86(_0x191d88[_0x7847('0x15')][_0x7847('0x14')]);}})[_0x7847('0x16')](function(_0x306870){logger['error'](_0x7847('0xe'),_0x29739b,_0x306870);_0xb2eaf0(_0x306870);});});}exports[_0x7847('0x17')]=function(_0x46481f){var _0x17c293=this;return new Promise(function(_0x1d0f07,_0x36fbbc){return db[_0x7847('0x18')]['findAll']({'raw':_0x46481f['options']?_0x46481f[_0x7847('0x19')][_0x7847('0x1a')]===undefined?!![]:![]:!![],'where':_0x46481f['options']?_0x46481f[_0x7847('0x19')][_0x7847('0x1b')]||null:null,'attributes':_0x46481f[_0x7847('0x19')]?_0x46481f[_0x7847('0x19')][_0x7847('0x1c')]||null:null,'limit':_0x46481f['options']?_0x46481f[_0x7847('0x19')][_0x7847('0x1d')]||null:null,'include':_0x46481f['options']?_0x46481f[_0x7847('0x19')][_0x7847('0x1e')]?_[_0x7847('0x1f')](_0x46481f['options'][_0x7847('0x1e')],function(_0x150af5){return{'model':db[_0x150af5['model']],'as':_0x150af5['as'],'attributes':_0x150af5[_0x7847('0x1c')],'include':_0x150af5['include']?_[_0x7847('0x1f')](_0x150af5[_0x7847('0x1e')],function(_0x49d3b7){return{'model':db[_0x49d3b7['model']],'as':_0x49d3b7['as'],'attributes':_0x49d3b7[_0x7847('0x1c')],'include':_0x49d3b7[_0x7847('0x1e')]?_[_0x7847('0x1f')](_0x49d3b7[_0x7847('0x1e')],function(_0xb9da0c){return{'model':db[_0xb9da0c['model']],'as':_0xb9da0c['as'],'attributes':_0xb9da0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7847('0xc')](function(_0x100d0a){logger[_0x7847('0xd')](_0x7847('0x17'),_0x46481f);logger['debug'](_0x7847('0x17'),_0x46481f,JSON[_0x7847('0x11')](_0x100d0a));_0x1d0f07(_0x100d0a);})[_0x7847('0x16')](function(_0x586115){logger[_0x7847('0x12')](_0x7847('0x17'),_0x586115[_0x7847('0x14')],_0x46481f);_0x36fbbc(_0x17c293[_0x7847('0x12')](0x1f4,_0x586115[_0x7847('0x14')]));});});};exports['ShowTrunk']=function(_0xbf2117){var _0x2818c9=this;return new Promise(function(_0x56145a,_0xc2e171){return db[_0x7847('0x18')][_0x7847('0x20')]({'raw':_0xbf2117[_0x7847('0x19')]?_0xbf2117[_0x7847('0x19')][_0x7847('0x1a')]===undefined?!![]:![]:!![],'where':_0xbf2117[_0x7847('0x19')]?_0xbf2117[_0x7847('0x19')][_0x7847('0x1b')]||null:null,'attributes':_0xbf2117['options']?_0xbf2117['options'][_0x7847('0x1c')]||null:null,'include':_0xbf2117[_0x7847('0x19')]?_0xbf2117[_0x7847('0x19')][_0x7847('0x1e')]?_[_0x7847('0x1f')](_0xbf2117[_0x7847('0x19')][_0x7847('0x1e')],function(_0x3d7365){return{'model':db[_0x3d7365[_0x7847('0x21')]],'as':_0x3d7365['as'],'attributes':_0x3d7365['attributes'],'include':_0x3d7365[_0x7847('0x1e')]?_[_0x7847('0x1f')](_0x3d7365[_0x7847('0x1e')],function(_0x120bec){return{'model':db[_0x120bec[_0x7847('0x21')]],'as':_0x120bec['as'],'attributes':_0x120bec[_0x7847('0x1c')],'include':_0x120bec[_0x7847('0x1e')]?_['map'](_0x120bec[_0x7847('0x1e')],function(_0x19016c){return{'model':db[_0x19016c['model']],'as':_0x19016c['as'],'attributes':_0x19016c[_0x7847('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7847('0xc')](function(_0x506502){logger['info'](_0x7847('0x22'),_0xbf2117);logger[_0x7847('0x10')](_0x7847('0x22'),_0xbf2117,JSON[_0x7847('0x11')](_0x506502));_0x56145a(_0x506502);})[_0x7847('0x16')](function(_0x310f5d){logger[_0x7847('0x12')](_0x7847('0x22'),_0x310f5d[_0x7847('0x14')],_0xbf2117);_0xc2e171(_0x2818c9['error'](0x1f4,_0x310f5d[_0x7847('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 53dca8b..317111e 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 _0x6ac5=['removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','diskStorage','server/files/images/','format','%s-%s','now','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','put','update','/:id/password','changePassword','delete','removeQueues','destroy'];(function(_0x227cce,_0x46477b){var _0x339dfb=function(_0x43ef09){while(--_0x43ef09){_0x227cce['push'](_0x227cce['shift']());}};_0x339dfb(++_0x46477b);}(_0x6ac5,0x83));var _0x56ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ac5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x56ac('0x0'));var util=require(_0x56ac('0x1'));var path=require(_0x56ac('0x2'));var timeout=require(_0x56ac('0x3'));var express=require(_0x56ac('0x4'));var router=express['Router']();var fs_extra=require(_0x56ac('0x5'));var auth=require(_0x56ac('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x56ac('0x7'));router[_0x56ac('0x8')]('/',auth[_0x56ac('0x9')](),controller[_0x56ac('0xa')]);router[_0x56ac('0x8')](_0x56ac('0xb'),auth[_0x56ac('0x9')](),controller[_0x56ac('0xc')]);router[_0x56ac('0x8')](_0x56ac('0xd'),auth[_0x56ac('0x9')](),controller['whoami']);router['get'](_0x56ac('0xe'),auth[_0x56ac('0x9')](),controller[_0x56ac('0xf')]);router[_0x56ac('0x8')](_0x56ac('0x10'),auth[_0x56ac('0x9')](),controller['show']);router['get'](_0x56ac('0x11'),controller[_0x56ac('0x12')]);router[_0x56ac('0x8')](_0x56ac('0x13'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x14')]);router[_0x56ac('0x8')](_0x56ac('0x15'),auth['isAuthenticated'](),controller['getContacts']);router[_0x56ac('0x8')](_0x56ac('0x16'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x17')]);router['get'](_0x56ac('0x18'),auth[_0x56ac('0x9')](),controller['getVoiceQueuesRt']);router[_0x56ac('0x8')](_0x56ac('0x19'),auth['isAuthenticated'](),controller[_0x56ac('0x1a')]);router[_0x56ac('0x8')](_0x56ac('0x1b'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x56ac('0x9')](),controller[_0x56ac('0x1d')]);router['get']('/:id/chat/interactions',auth[_0x56ac('0x9')](),controller['getChatInteractions']);router[_0x56ac('0x8')](_0x56ac('0x1e'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x1f')]);router[_0x56ac('0x8')](_0x56ac('0x20'),auth['isAuthenticated'](),controller[_0x56ac('0x21')]);router['get'](_0x56ac('0x22'),auth[_0x56ac('0x9')](),controller['getSmsInteractions']);router[_0x56ac('0x8')](_0x56ac('0x23'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x24')]);router[_0x56ac('0x8')](_0x56ac('0x25'),auth['isAuthenticated'](),controller[_0x56ac('0x26')]);router[_0x56ac('0x8')](_0x56ac('0x27'),auth['isAuthenticated'](),controller[_0x56ac('0x28')]);router[_0x56ac('0x8')](_0x56ac('0x29'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x2a')]);router[_0x56ac('0x8')](_0x56ac('0x2b'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x2c')]);router[_0x56ac('0x8')]('/:id/prefixes',auth[_0x56ac('0x9')](),controller[_0x56ac('0x2d')]);router['get']('/:id/fax_accounts',auth[_0x56ac('0x9')](),controller['getFaxAccounts']);router['get'](_0x56ac('0x2e'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x2f')]);router[_0x56ac('0x8')](_0x56ac('0x30'),auth[_0x56ac('0x9')](),controller['getOpenchannelAccounts']);router[_0x56ac('0x8')](_0x56ac('0x31'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x32')]);router[_0x56ac('0x8')](_0x56ac('0x33'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x34')]);router[_0x56ac('0x8')]('/:id/whatsapp_accounts',auth[_0x56ac('0x9')](),controller[_0x56ac('0x35')]);router[_0x56ac('0x8')](_0x56ac('0x36'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x37')]);router[_0x56ac('0x8')](_0x56ac('0x38'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x39')]);router['get'](_0x56ac('0x3a'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x3b')]);router[_0x56ac('0x3c')](_0x56ac('0x15'),auth['isAuthenticated'](),controller[_0x56ac('0x3d')]);router[_0x56ac('0x3c')]('/',auth[_0x56ac('0x9')](),controller[_0x56ac('0x3e')]);router[_0x56ac('0x3c')](_0x56ac('0x3f'),auth[_0x56ac('0x9')](),controller['bulkCreate']);router[_0x56ac('0x3c')](_0x56ac('0x16'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x40')]);var upload=multer({'storage':multer[_0x56ac('0x41')]({'destination':function(_0xe7bed7,_0x2fb8fb,_0x55da07){_0x55da07(null,path['join'](config['root'],_0x56ac('0x42')));},'filename':function(_0x4b6244,_0xb25b10,_0x455a42){_0x455a42(null,util[_0x56ac('0x43')](_0x56ac('0x44'),Date[_0x56ac('0x45')](),_0xb25b10['originalname']));}})});router[_0x56ac('0x3c')]('/:id/avatar',upload[_0x56ac('0x46')]('file'),controller[_0x56ac('0x47')]);router['post'](_0x56ac('0x48'),auth[_0x56ac('0x9')](),controller['login']);router[_0x56ac('0x3c')](_0x56ac('0x49'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x4a')]);router[_0x56ac('0x3c')](_0x56ac('0x4b'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x4c')]);router[_0x56ac('0x3c')](_0x56ac('0x4d'),auth[_0x56ac('0x9')](),controller['unpause']);router['post'](_0x56ac('0x27'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x4e')]);router[_0x56ac('0x3c')](_0x56ac('0x4f'),auth['isAuthenticated'](),controller[_0x56ac('0x50')]);router[_0x56ac('0x3c')](_0x56ac('0x51'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x52')]);router[_0x56ac('0x3c')]('/:id/fax_interactions',auth[_0x56ac('0x9')](),controller[_0x56ac('0x53')]);router[_0x56ac('0x3c')](_0x56ac('0x54'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x56ac('0x3c')](_0x56ac('0x55'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x56ac('0x3c')]('/:id/whatsapp_interactions',auth[_0x56ac('0x9')](),controller[_0x56ac('0x56')]);router[_0x56ac('0x3c')](_0x56ac('0x57'),auth['isAuthenticated'](),controller[_0x56ac('0x58')]);router[_0x56ac('0x3c')](_0x56ac('0x2e'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x59')]);router[_0x56ac('0x3c')](_0x56ac('0x30'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x5a')]);router[_0x56ac('0x3c')](_0x56ac('0x31'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x5b')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router['post']('/:id/whatsapp_accounts',auth[_0x56ac('0x9')](),controller[_0x56ac('0x5c')]);router[_0x56ac('0x3c')](_0x56ac('0x36'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x5d')]);router[_0x56ac('0x3c')](_0x56ac('0x3a'),auth[_0x56ac('0x9')](),controller['createApiKey']);router[_0x56ac('0x5e')](_0x56ac('0x10'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x5f')]);router[_0x56ac('0x5e')](_0x56ac('0x60'),auth['isAuthenticated'](),controller[_0x56ac('0x61')]);router[_0x56ac('0x62')](_0x56ac('0x16'),auth['isAuthenticated'](),controller[_0x56ac('0x63')]);router['delete'](_0x56ac('0x27'),auth[_0x56ac('0x9')](),controller['removeTeams']);router[_0x56ac('0x62')]('/:id',auth[_0x56ac('0x9')](),controller[_0x56ac('0x64')]);router[_0x56ac('0x62')](_0x56ac('0x4f'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x65')]);router['delete'](_0x56ac('0x51'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x66')]);router[_0x56ac('0x62')]('/:id/fax_interactions',auth[_0x56ac('0x9')](),controller[_0x56ac('0x67')]);router['delete']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x56ac('0x68')]);router['delete'](_0x56ac('0x55'),auth[_0x56ac('0x9')](),controller['removeOpenchannelInteractions']);router['delete'](_0x56ac('0x69'),auth['isAuthenticated'](),controller[_0x56ac('0x6a')]);router['delete'](_0x56ac('0x57'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x6b')]);router['delete'](_0x56ac('0x2e'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x6c')]);router[_0x56ac('0x62')](_0x56ac('0x30'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x6d')]);router[_0x56ac('0x62')](_0x56ac('0x31'),auth['isAuthenticated'](),controller[_0x56ac('0x6e')]);router[_0x56ac('0x62')](_0x56ac('0x33'),auth[_0x56ac('0x9')](),controller[_0x56ac('0x6f')]);router[_0x56ac('0x62')](_0x56ac('0x70'),auth['isAuthenticated'](),controller[_0x56ac('0x71')]);router[_0x56ac('0x62')]('/:id/square_projects',auth[_0x56ac('0x9')](),controller[_0x56ac('0x72')]);router[_0x56ac('0x62')]('/:id/api_key',auth[_0x56ac('0x9')](),controller[_0x56ac('0x73')]);module['exports']=router; \ No newline at end of file +var _0x096a=['/:id/api_key','getApiKey','addContacts','create','post','/create_many','bulkCreate','diskStorage','join','root','format','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','update','changePassword','removeQueues','delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','/:id/whatsapp_accounts','removeWhatsappAccounts','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls'];(function(_0x16e05a,_0x51eaa8){var _0x179f32=function(_0x57f92e){while(--_0x57f92e){_0x16e05a['push'](_0x16e05a['shift']());}};_0x179f32(++_0x51eaa8);}(_0x096a,0x18f));var _0xa096=function(_0x35f44f,_0xb06f68){_0x35f44f=_0x35f44f-0x0;var _0x236797=_0x096a[_0x35f44f];return _0x236797;};'use strict';var multer=require(_0xa096('0x0'));var util=require(_0xa096('0x1'));var path=require(_0xa096('0x2'));var timeout=require('connect-timeout');var express=require(_0xa096('0x3'));var router=express[_0xa096('0x4')]();var fs_extra=require(_0xa096('0x5'));var auth=require(_0xa096('0x6'));var interaction=require(_0xa096('0x7'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0xa096('0x8')]('/',auth[_0xa096('0x9')](),controller[_0xa096('0xa')]);router[_0xa096('0x8')](_0xa096('0xb'),auth[_0xa096('0x9')](),controller[_0xa096('0xc')]);router[_0xa096('0x8')](_0xa096('0xd'),auth[_0xa096('0x9')](),controller[_0xa096('0xe')]);router[_0xa096('0x8')](_0xa096('0xf'),auth['isAuthenticated'](),controller['getPresence']);router[_0xa096('0x8')](_0xa096('0x10'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa096('0x11'),controller[_0xa096('0x12')]);router['get'](_0xa096('0x13'),auth[_0xa096('0x9')](),controller[_0xa096('0x14')]);router[_0xa096('0x8')](_0xa096('0x15'),auth[_0xa096('0x9')](),controller[_0xa096('0x16')]);router[_0xa096('0x8')](_0xa096('0x17'),auth[_0xa096('0x9')](),controller[_0xa096('0x18')]);router[_0xa096('0x8')]('/:id/queues_rt',auth[_0xa096('0x9')](),controller[_0xa096('0x19')]);router[_0xa096('0x8')](_0xa096('0x1a'),auth[_0xa096('0x9')](),controller[_0xa096('0x1b')]);router[_0xa096('0x8')](_0xa096('0x1c'),auth['isAuthenticated'](),controller[_0xa096('0x1d')]);router['get'](_0xa096('0x1e'),auth['isAuthenticated'](),controller[_0xa096('0x1f')]);router[_0xa096('0x8')]('/:id/chat/interactions',auth[_0xa096('0x9')](),controller[_0xa096('0x20')]);router[_0xa096('0x8')](_0xa096('0x21'),auth[_0xa096('0x9')](),controller[_0xa096('0x22')]);router[_0xa096('0x8')]('/:id/mail/interactions',auth[_0xa096('0x9')](),controller[_0xa096('0x23')]);router['get'](_0xa096('0x24'),auth['isAuthenticated'](),controller[_0xa096('0x25')]);router[_0xa096('0x8')](_0xa096('0x26'),auth[_0xa096('0x9')](),controller[_0xa096('0x27')]);router[_0xa096('0x8')](_0xa096('0x28'),auth[_0xa096('0x9')](),controller[_0xa096('0x29')]);router[_0xa096('0x8')](_0xa096('0x2a'),auth[_0xa096('0x9')](),controller[_0xa096('0x2b')]);router[_0xa096('0x8')](_0xa096('0x2c'),auth[_0xa096('0x9')](),controller['getLists']);router[_0xa096('0x8')](_0xa096('0x2d'),auth[_0xa096('0x9')](),controller[_0xa096('0x2e')]);router[_0xa096('0x8')]('/:id/prefixes',auth[_0xa096('0x9')](),controller['getVoicePrefixes']);router[_0xa096('0x8')](_0xa096('0x2f'),auth[_0xa096('0x9')](),controller['getFaxAccounts']);router[_0xa096('0x8')](_0xa096('0x30'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xa096('0x8')](_0xa096('0x31'),auth[_0xa096('0x9')](),controller[_0xa096('0x32')]);router[_0xa096('0x8')](_0xa096('0x33'),auth[_0xa096('0x9')](),controller['getSmsAccounts']);router[_0xa096('0x8')](_0xa096('0x34'),auth[_0xa096('0x9')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0xa096('0x9')](),controller['getWhatsappAccounts']);router[_0xa096('0x8')](_0xa096('0x35'),auth[_0xa096('0x9')](),controller[_0xa096('0x36')]);router[_0xa096('0x8')](_0xa096('0x37'),auth[_0xa096('0x9')](),controller[_0xa096('0x38')]);router[_0xa096('0x8')](_0xa096('0x39'),auth['isAuthenticated'](),controller[_0xa096('0x3a')]);router['post'](_0xa096('0x15'),auth[_0xa096('0x9')](),controller[_0xa096('0x3b')]);router['post']('/',auth[_0xa096('0x9')](),controller[_0xa096('0x3c')]);router[_0xa096('0x3d')](_0xa096('0x3e'),auth[_0xa096('0x9')](),controller[_0xa096('0x3f')]);router[_0xa096('0x3d')](_0xa096('0x17'),auth[_0xa096('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0xa096('0x40')]({'destination':function(_0x473adf,_0x21e525,_0xaf7d17){_0xaf7d17(null,path[_0xa096('0x41')](config[_0xa096('0x42')],'server/files/images/'));},'filename':function(_0x37dc57,_0x30a0ab,_0x2839f4){_0x2839f4(null,util[_0xa096('0x43')]('%s-%s',Date[_0xa096('0x44')](),_0x30a0ab[_0xa096('0x45')]));}})});router[_0xa096('0x3d')](_0xa096('0x11'),upload[_0xa096('0x46')](_0xa096('0x47')),controller[_0xa096('0x48')]);router[_0xa096('0x3d')](_0xa096('0x49'),auth[_0xa096('0x9')](),controller[_0xa096('0x4a')]);router[_0xa096('0x3d')](_0xa096('0x4b'),auth[_0xa096('0x9')](),controller[_0xa096('0x4c')]);router[_0xa096('0x3d')](_0xa096('0x4d'),auth['isAuthenticated'](),controller[_0xa096('0x4e')]);router[_0xa096('0x3d')](_0xa096('0x4f'),auth[_0xa096('0x9')](),controller[_0xa096('0x50')]);router[_0xa096('0x3d')](_0xa096('0x2a'),auth['isAuthenticated'](),controller[_0xa096('0x51')]);router[_0xa096('0x3d')](_0xa096('0x52'),auth[_0xa096('0x9')](),controller[_0xa096('0x53')]);router[_0xa096('0x3d')]('/:id/mail_interactions',auth[_0xa096('0x9')](),controller[_0xa096('0x54')]);router[_0xa096('0x3d')](_0xa096('0x55'),auth[_0xa096('0x9')](),controller[_0xa096('0x56')]);router['post'](_0xa096('0x57'),auth[_0xa096('0x9')](),controller[_0xa096('0x58')]);router['post']('/:id/openchannel_interactions',auth[_0xa096('0x9')](),controller[_0xa096('0x59')]);router['post'](_0xa096('0x5a'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post'](_0xa096('0x2f'),auth[_0xa096('0x9')](),controller[_0xa096('0x5b')]);router[_0xa096('0x3d')](_0xa096('0x30'),auth['isAuthenticated'](),controller[_0xa096('0x5c')]);router[_0xa096('0x3d')]('/:id/openchannel_accounts',auth[_0xa096('0x9')](),controller[_0xa096('0x5d')]);router[_0xa096('0x3d')](_0xa096('0x33'),auth[_0xa096('0x9')](),controller[_0xa096('0x5e')]);router[_0xa096('0x3d')](_0xa096('0x34'),auth[_0xa096('0x9')](),controller[_0xa096('0x5f')]);router[_0xa096('0x3d')]('/:id/whatsapp_accounts',auth[_0xa096('0x9')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0xa096('0x9')](),controller[_0xa096('0x60')]);router[_0xa096('0x3d')](_0xa096('0x39'),auth[_0xa096('0x9')](),controller['createApiKey']);router['put'](_0xa096('0x10'),auth[_0xa096('0x9')](),controller[_0xa096('0x61')]);router['put']('/:id/password',auth['isAuthenticated'](),controller[_0xa096('0x62')]);router['delete'](_0xa096('0x17'),auth[_0xa096('0x9')](),controller[_0xa096('0x63')]);router[_0xa096('0x64')](_0xa096('0x2a'),auth[_0xa096('0x9')](),controller['removeTeams']);router[_0xa096('0x64')](_0xa096('0x10'),auth['isAuthenticated'](),controller[_0xa096('0x65')]);router[_0xa096('0x64')](_0xa096('0x52'),auth[_0xa096('0x9')](),controller[_0xa096('0x66')]);router[_0xa096('0x64')](_0xa096('0x67'),auth[_0xa096('0x9')](),controller[_0xa096('0x68')]);router['delete'](_0xa096('0x55'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xa096('0x64')](_0xa096('0x57'),auth[_0xa096('0x9')](),controller[_0xa096('0x69')]);router[_0xa096('0x64')](_0xa096('0x6a'),auth[_0xa096('0x9')](),controller['removeOpenchannelInteractions']);router[_0xa096('0x64')](_0xa096('0x5a'),auth[_0xa096('0x9')](),controller[_0xa096('0x6b')]);router[_0xa096('0x64')](_0xa096('0x2f'),auth['isAuthenticated'](),controller[_0xa096('0x6c')]);router[_0xa096('0x64')](_0xa096('0x30'),auth[_0xa096('0x9')](),controller[_0xa096('0x6d')]);router[_0xa096('0x64')](_0xa096('0x31'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0xa096('0x64')]('/:id/sms_accounts',auth[_0xa096('0x9')](),controller[_0xa096('0x6e')]);router[_0xa096('0x64')](_0xa096('0x34'),auth[_0xa096('0x9')](),controller['removeChatWebsites']);router[_0xa096('0x64')](_0xa096('0x6f'),auth[_0xa096('0x9')](),controller[_0xa096('0x70')]);router[_0xa096('0x64')](_0xa096('0x35'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0xa096('0x64')]('/:id/api_key',auth[_0xa096('0x9')](),controller['removeApiKey']);module[_0xa096('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 97928f8..f8e4ae5 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 _0xf072=['\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','user','agent','local','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','nonat','update,nonat','get','isArray','udp','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','avpf','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','sequelize','moment','util','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format'];(function(_0x1f3280,_0xec6845){var _0x50770f=function(_0x3edb5b){while(--_0x3edb5b){_0x1f3280['push'](_0x1f3280['shift']());}};_0x50770f(++_0xec6845);}(_0xf072,0x1cf));var _0x2f07=function(_0x37a672,_0x46fa15){_0x37a672=_0x37a672-0x0;var _0x3bf17d=_0xf072[_0x37a672];return _0x3bf17d;};'use strict';var Sequelize=require(_0x2f07('0x0'));var moment=require(_0x2f07('0x1'));var util=require(_0x2f07('0x2'));var _=require('lodash');module[_0x2f07('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2f07('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x432696){this[_0x2f07('0x5')]('name',_0x432696);this[_0x2f07('0x5')](_0x2f07('0x6'),_0x432696);},'comment':_0x2f07('0x7')},'fullname':{'type':Sequelize[_0x2f07('0x8')],'allowNull':![],'set':function(_0x235418){this[_0x2f07('0x5')](_0x2f07('0x9'),_0x235418);this[_0x2f07('0x5')](_0x2f07('0xa'),util[_0x2f07('0xb')](_0x2f07('0xc'),_0x235418,this[_0x2f07('0xd')](_0x2f07('0xe'))));}},'alias':{'type':Sequelize[_0x2f07('0x8')]},'email':{'type':Sequelize[_0x2f07('0x8')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0xdb2783){if(_0xdb2783){this[_0x2f07('0x5')](_0x2f07('0xf'),_0xdb2783[_0x2f07('0x10')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x2f07('0x11'),_0x2f07('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x2f07('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2f07('0x8')],'defaultValue':_0x2f07('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x2f07('0xe'),'set':function(_0x443fdc){this[_0x2f07('0x5')](_0x2f07('0xe'),_0x443fdc);this[_0x2f07('0x5')](_0x2f07('0x14'),_0x443fdc);this['setDataValue'](_0x2f07('0xa'),util['format'](_0x2f07('0xc'),this[_0x2f07('0xd')](_0x2f07('0x9')),_0x443fdc));}},'salt':{'type':Sequelize[_0x2f07('0x8')]},'phone':{'type':Sequelize[_0x2f07('0x8')]},'mobile':{'type':Sequelize[_0x2f07('0x8')]},'address':{'type':Sequelize[_0x2f07('0x8')]},'zipcode':{'type':Sequelize[_0x2f07('0x8')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2f07('0x8')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2f07('0x16')]},'voicePause':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x2f07('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2f07('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2f07('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2f07('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x2f07('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x1b'),_0x2f07('0x11'),_0x2f07('0x1c')),'allowNull':!![],'defaultValue':_0x2f07('0x1b')},'context':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x1d'),_0x2f07('0x1e'),'ALLOWED_FAILED_SCREEN',_0x2f07('0x1f'),_0x2f07('0x20'),_0x2f07('0x21'),'PROHIB_FAILED_SCREEN',_0x2f07('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![],'defaultValue':'udp','set':function(_0x1decd1){this['setDataValue'](_0x2f07('0x23'),_0x1decd1?_0x1decd1[_0x2f07('0x24')](','):null);},'get':function(){return this[_0x2f07('0xd')](_0x2f07('0x23'))?this[_0x2f07('0xd')](_0x2f07('0x23'))[_0x2f07('0x25')](','):null;},'comment':_0x2f07('0x26')},'dtmfmode':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x27'),_0x2f07('0x28'),_0x2f07('0x29'),_0x2f07('0x2a'),_0x2f07('0x2b')),'allowNull':!![],'defaultValue':_0x2f07('0x27')},'directmedia':{'type':Sequelize[_0x2f07('0x1a')]('yes','no','nonat',_0x2f07('0x2c'),_0x2f07('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x2f07('0x2e'),'set':function(_0x1d4e68){this[_0x2f07('0x5')](_0x2f07('0x2f'),_0x1d4e68?_0x1d4e68[_0x2f07('0x24')](','):null);},'get':function(){return this['getDataValue'](_0x2f07('0x2f'))?this['getDataValue'](_0x2f07('0x2f'))['split'](','):null;},'comment':_0x2f07('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2f07('0x8')]},'namedpickupgroup':{'type':Sequelize[_0x2f07('0x8')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2f07('0x8')]},'disallow':{'type':Sequelize[_0x2f07('0x8')],'allowNull':![],'defaultValue':_0x2f07('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2f07('0x32'),'set':function(_0x185ef8){this[_0x2f07('0x5')](_0x2f07('0x33'),_0x185ef8?_0x185ef8[_0x2f07('0x24')](';'):_0x2f07('0x32'));},'get':function(){return this[_0x2f07('0xd')](_0x2f07('0x33'))?this['getDataValue'](_0x2f07('0x33'))[_0x2f07('0x25')](';'):null;},'comment':_0x2f07('0x34')},'autoframing':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![],'set':function(_0x5129c){this['setDataValue'](_0x2f07('0x36'),_0x5129c?_0x5129c[_0x2f07('0x24')](','):null);},'get':function(){return this[_0x2f07('0xd')](_0x2f07('0x36'))?this[_0x2f07('0xd')](_0x2f07('0x36'))['split'](','):null;},'comment':_0x2f07('0x37')},'trustrpid':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2f07('0x35'),'no',_0x2f07('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2f07('0x35'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![],'defaultValue':_0x2f07('0x39')},'amaflags':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![],'defaultValue':_0x2f07('0x35')},'busylevel':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x2f07('0x35'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'template':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2f07('0x1a')]('yes','no',_0x2f07('0x3a')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x3b'),_0x2f07('0x3c'),_0x2f07('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x3e'),_0x2f07('0x3f')),'allowNull':!![],'defaultValue':_0x2f07('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':_0x2f07('0x35')},'keepalive':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no','fingerprint',_0x2f07('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x2f07('0x41'),_0x2f07('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2f07('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2f07('0x1a')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no',_0x2f07('0x43'),_0x2f07('0x2c'),_0x2f07('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2f07('0x8')]},'resetPasswordExpires':{'type':Sequelize[_0x2f07('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0,'set':function(_0x590816){this['setDataValue']('showWebBar',_0x590816);var _0x5439ae=this[_0x2f07('0x45')]({'plain':!![]});switch(_0x590816){case 0x0:case 0x1:var _0x50015e=_0x5439ae[_0x2f07('0x23')]?_[_0x2f07('0x46')](_0x5439ae[_0x2f07('0x23')])?_0x5439ae[_0x2f07('0x23')]['join']():_0x5439ae[_0x2f07('0x23')]:_0x2f07('0x47');if(_0x50015e===_0x2f07('0x48')){_0x50015e=_0x2f07('0x47');}this['setDataValue'](_0x2f07('0x23'),_0x50015e);this[_0x2f07('0x5')](_0x2f07('0x49'),'no');this[_0x2f07('0x5')]('avpf',null);this[_0x2f07('0x5')](_0x2f07('0x4a'),null);this[_0x2f07('0x5')](_0x2f07('0x4b'),null);this['setDataValue'](_0x2f07('0x4c'),null);this['setDataValue'](_0x2f07('0x4d'),null);this[_0x2f07('0x5')](_0x2f07('0x4e'),null);this[_0x2f07('0x5')]('dtlscertfile',null);this[_0x2f07('0x5')](_0x2f07('0x4f'),null);this['setDataValue'](_0x2f07('0x50'),'no');break;case 0x2:this[_0x2f07('0x5')]('transport',_0x2f07('0x48'));this[_0x2f07('0x5')](_0x2f07('0x49'),'yes');this['setDataValue'](_0x2f07('0x51'),_0x2f07('0x35'));this['setDataValue'](_0x2f07('0x4a'),_0x2f07('0x35'));this[_0x2f07('0x5')](_0x2f07('0x4b'),_0x2f07('0x35'));this[_0x2f07('0x5')](_0x2f07('0x4c'),_0x2f07('0x35'));this['setDataValue']('dtlsverify','no');this['setDataValue']('dtlssetup','actpass');this['setDataValue']('dtlscertfile',_0x5439ae[_0x2f07('0x52')]||_0x2f07('0x53'));this[_0x2f07('0x5')](_0x2f07('0x4f'),_0x5439ae['dtlsprivatekey']||_0x2f07('0x54'));this[_0x2f07('0x5')](_0x2f07('0x50'),_0x2f07('0x35'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x4a9255){this[_0x2f07('0x5')]('permissions',_0x4a9255?_0x4a9255['join'](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x2f07('0x55')](this[_0x2f07('0xd')](_0x2f07('0x56'))['split'](','),function(_0x250212){return parseInt(_0x250212,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2f07('0x8')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2f07('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2f07('0x8')]},'phoneBarUnconditional':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2f07('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2f07('0x1a')](_0x2f07('0x35'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2f07('0x8')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2f07('0x57')],'get':function(){return this[_0x2f07('0xd')]('phoneBarEnableScreenRecordingByAgent')?this[_0x2f07('0xd')](_0x2f07('0x58')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2f07('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![],'set':function(_0x45d083){if(typeof _0x45d083===_0x2f07('0x59')){var _0x598346=_0x45d083==='1'?!![]:_0x45d083==='0'?![]:_0x45d083===_0x2f07('0x5a')?!![]:_0x45d083===_0x2f07('0x5b')?![]:![];this['setDataValue'](_0x2f07('0x5c'),_0x598346);}else{this[_0x2f07('0x5')](_0x2f07('0x5c'),_0x45d083);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3c364b){this[_0x2f07('0x5')]('blocked',_0x3c364b);if(_0x3c364b===!![]){this[_0x2f07('0x5')]('blockedAt',moment());this[_0x2f07('0x5')](_0x2f07('0x5d'),0x0);}else{this[_0x2f07('0x5')](_0x2f07('0x5e'),null);}}},'blockedAt':{'type':Sequelize[_0x2f07('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2f07('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2f07('0x18')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2f07('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0b78=['passive','actpass','update','update,nonat','showWebBar','get','wss','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','encryption','avpf','dtlsenable','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','moment','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','internal','email','toLowerCase','ENUM','agent','telephone','local','INTEGER','\x22%s\x22\x20<%s>','getDataValue','fullname','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','nat','join','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','uac','uas','fingerprint','active'];(function(_0x3de9e8,_0x41a90c){var _0x417cde=function(_0x3ab97b){while(--_0x3ab97b){_0x3de9e8['push'](_0x3de9e8['shift']());}};_0x417cde(++_0x41a90c);}(_0x0b78,0x1d6));var _0x80b7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0b78[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var _=require(_0x80b7('0x2'));module['exports']={'name':{'type':Sequelize[_0x80b7('0x3')],'allowNull':![],'unique':_0x80b7('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4ad62b){this['setDataValue']('name',_0x4ad62b);this[_0x80b7('0x5')](_0x80b7('0x6'),_0x4ad62b);},'comment':_0x80b7('0x7')},'fullname':{'type':Sequelize[_0x80b7('0x3')],'allowNull':![],'set':function(_0x33bdd8){this[_0x80b7('0x5')]('fullname',_0x33bdd8);this[_0x80b7('0x5')](_0x80b7('0x8'),util[_0x80b7('0x9')]('\x22%s\x22\x20<%s>',_0x33bdd8,this['getDataValue'](_0x80b7('0xa'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x80b7('0x3')],'allowNull':![],'unique':_0x80b7('0xb'),'validate':{'isEmail':!![]},'set':function(_0x47910c){if(_0x47910c){this[_0x80b7('0x5')](_0x80b7('0xb'),_0x47910c[_0x80b7('0xc')]());}}},'role':{'type':Sequelize[_0x80b7('0xd')]('admin','user',_0x80b7('0xe'),_0x80b7('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x80b7('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x80b7('0x3')],'defaultValue':_0x80b7('0x10')},'internal':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':![],'unique':_0x80b7('0xa'),'set':function(_0x32cecc){this[_0x80b7('0x5')]('internal',_0x32cecc);this['setDataValue']('accountcode',_0x32cecc);this['setDataValue'](_0x80b7('0x8'),util[_0x80b7('0x9')](_0x80b7('0x12'),this[_0x80b7('0x13')](_0x80b7('0x14')),_0x32cecc));}},'salt':{'type':Sequelize[_0x80b7('0x3')]},'phone':{'type':Sequelize[_0x80b7('0x3')]},'mobile':{'type':Sequelize[_0x80b7('0x3')]},'address':{'type':Sequelize[_0x80b7('0x3')]},'zipcode':{'type':Sequelize[_0x80b7('0x3')]},'userpic':{'type':Sequelize[_0x80b7('0x3')]},'city':{'type':Sequelize[_0x80b7('0x3')]},'country':{'type':Sequelize[_0x80b7('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x80b7('0x15')]},'voicePause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x80b7('0x3')],'defaultValue':_0x80b7('0x17')},'lastPauseAt':{'type':Sequelize[_0x80b7('0x15')]},'chatCapacity':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x80b7('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x80b7('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![],'defaultValue':_0x80b7('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x80b7('0x11')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x19'),'user',_0x80b7('0x1a')),'allowNull':!![],'defaultValue':_0x80b7('0x19')},'context':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![],'defaultValue':_0x80b7('0x1b')},'callingpres':{'type':Sequelize[_0x80b7('0xd')]('ALLOWED_NOT_SCREENED',_0x80b7('0x1c'),_0x80b7('0x1d'),_0x80b7('0x1e'),_0x80b7('0x1f'),_0x80b7('0x20'),_0x80b7('0x21'),_0x80b7('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![],'defaultValue':_0x80b7('0x23'),'set':function(_0x1dfde6){this[_0x80b7('0x5')](_0x80b7('0x24'),_0x1dfde6?_0x1dfde6['join'](','):null);},'get':function(){return this[_0x80b7('0x13')](_0x80b7('0x24'))?this[_0x80b7('0x13')]('transport')[_0x80b7('0x25')](','):null;},'comment':_0x80b7('0x26')},'dtmfmode':{'type':Sequelize[_0x80b7('0xd')]('rfc2833',_0x80b7('0x27'),_0x80b7('0x28'),_0x80b7('0x29'),_0x80b7('0x2a')),'allowNull':!![],'defaultValue':_0x80b7('0x2b')},'directmedia':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no',_0x80b7('0x2d'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3d33fa){this[_0x80b7('0x5')](_0x80b7('0x2e'),_0x3d33fa?_0x3d33fa[_0x80b7('0x2f')](','):null);},'get':function(){return this['getDataValue'](_0x80b7('0x2e'))?this[_0x80b7('0x13')]('nat')[_0x80b7('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x80b7('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x80b7('0x3')]},'language':{'type':Sequelize[_0x80b7('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x80b7('0x3')]},'disallow':{'type':Sequelize[_0x80b7('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x80b7('0x30'),'set':function(_0x4f50ca){this[_0x80b7('0x5')](_0x80b7('0x31'),_0x4f50ca?_0x4f50ca['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x80b7('0x13')](_0x80b7('0x31'))?this[_0x80b7('0x13')]('allow')[_0x80b7('0x25')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x80b7('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![],'set':function(_0x1b1b68){this[_0x80b7('0x5')](_0x80b7('0x32'),_0x1b1b68?_0x1b1b68[_0x80b7('0x2f')](','):null);},'get':function(){return this[_0x80b7('0x13')](_0x80b7('0x32'))?this[_0x80b7('0x13')](_0x80b7('0x32'))[_0x80b7('0x25')](','):null;},'comment':_0x80b7('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no',_0x80b7('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x80b7('0x2c')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x80b7('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x80b7('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no',_0x80b7('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x36'),_0x80b7('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x80b7('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x80b7('0x2c')},'keepalive':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x80b7('0xd')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no',_0x80b7('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x39'),_0x80b7('0x3a'),_0x80b7('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x80b7('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no',_0x80b7('0x2d'),_0x80b7('0x3c'),_0x80b7('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x80b7('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x80b7('0x15')]},'passwordResetAt':{'type':Sequelize[_0x80b7('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0,'set':function(_0x148e8c){this[_0x80b7('0x5')](_0x80b7('0x3e'),_0x148e8c);var _0x35171f=this[_0x80b7('0x3f')]({'plain':!![]});switch(_0x148e8c){case 0x0:case 0x1:var _0x350570=_0x35171f['transport']?_['isArray'](_0x35171f[_0x80b7('0x24')])?_0x35171f[_0x80b7('0x24')][_0x80b7('0x2f')]():_0x35171f['transport']:_0x80b7('0x23');if(_0x350570===_0x80b7('0x40')){_0x350570=_0x80b7('0x23');}this[_0x80b7('0x5')]('transport',_0x350570);this[_0x80b7('0x5')]('encryption','no');this['setDataValue']('avpf',null);this[_0x80b7('0x5')](_0x80b7('0x41'),null);this[_0x80b7('0x5')](_0x80b7('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x80b7('0x5')](_0x80b7('0x43'),null);this['setDataValue'](_0x80b7('0x44'),null);this['setDataValue'](_0x80b7('0x45'),null);this['setDataValue'](_0x80b7('0x46'),null);this[_0x80b7('0x5')]('rtcp_mux','no');break;case 0x2:this[_0x80b7('0x5')](_0x80b7('0x24'),_0x80b7('0x40'));this['setDataValue'](_0x80b7('0x47'),_0x80b7('0x2c'));this['setDataValue'](_0x80b7('0x48'),_0x80b7('0x2c'));this['setDataValue']('force_avp',_0x80b7('0x2c'));this[_0x80b7('0x5')]('icesupport',_0x80b7('0x2c'));this['setDataValue'](_0x80b7('0x49'),_0x80b7('0x2c'));this[_0x80b7('0x5')](_0x80b7('0x43'),'no');this[_0x80b7('0x5')](_0x80b7('0x44'),_0x80b7('0x3b'));this[_0x80b7('0x5')](_0x80b7('0x45'),_0x35171f[_0x80b7('0x45')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue']('dtlsprivatekey',_0x35171f['dtlsprivatekey']||_0x80b7('0x4a'));this[_0x80b7('0x5')](_0x80b7('0x4b'),_0x80b7('0x2c'));break;default:}}},'permissions':{'type':Sequelize[_0x80b7('0x4c')],'set':function(_0x276631){this[_0x80b7('0x5')](_0x80b7('0x4d'),_0x276631?_0x276631['join'](','):[]);},'get':function(){return this[_0x80b7('0x13')](_0x80b7('0x4d'))?_[_0x80b7('0x4e')](this[_0x80b7('0x13')]('permissions')[_0x80b7('0x25')](','),function(_0x56a7f3){return parseInt(_0x56a7f3,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x80b7('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x80b7('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x80b7('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x80b7('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x80b7('0xd')](_0x80b7('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x80b7('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x80b7('0x4f')],'get':function(){return this['getDataValue'](_0x80b7('0x50'))?this[_0x80b7('0x13')](_0x80b7('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x80b7('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x80b7('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![],'set':function(_0x33f4a1){if(typeof _0x33f4a1===_0x80b7('0x51')){var _0x5068f5=_0x33f4a1==='1'?!![]:_0x33f4a1==='0'?![]:_0x33f4a1===_0x80b7('0x52')?!![]:_0x33f4a1===_0x80b7('0x53')?![]:![];this[_0x80b7('0x5')](_0x80b7('0x54'),_0x5068f5);}else{this[_0x80b7('0x5')](_0x80b7('0x54'),_0x33f4a1);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x26b2dc){this[_0x80b7('0x5')]('blocked',_0x26b2dc);if(_0x26b2dc===!![]){this[_0x80b7('0x5')]('blockedAt',moment());this[_0x80b7('0x5')](_0x80b7('0x55'),0x0);}else{this[_0x80b7('0x5')](_0x80b7('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0x80b7('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x80b7('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x80b7('0x11')](0x5)[_0x80b7('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x80b7('0x16')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index e00958c..e8d2a42 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 _0x2a07=['removeAgent','TeamVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lt','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','firstName','lastName','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','isEmpty','inbound','lower','col','toString','asc','desc','substring','orderBy','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','includes','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','key','password','getOptions','includeAll','include','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','mail','openchannel','all','params','model','differenceBy','keys','query','filters','intersection','fields','merge','options','true','fax','body','describe','addContacts','omit','ids','Setting','validatePasswordPattern','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','106','108','100','111','114','115','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','each','some','compact','changePassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','securePassword','previousPasswords','validatePasswordHistory','passwordHistoryLimit','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','penalty','UserVoiceQueueRt','removeQueues','Queues','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','existsSync','root','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','CmContact','sort','where','pick','filter','getContacts','CmList','List','Tag','tag','hasOwnProperty','nolimit','Unknown\x20role','Queue','getVoiceQueuesRt','ChatGroup','order','getGroups','VoiceRecording','ScreenRecording','UserId','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','intrf','user:forcelogout','headers','x-forwarded-for','remoteAddress','connection','socket','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','type','unpause','mailPause','chatPause','faxPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','whatsapp','%s%s','Pause','getTeams','Team','addTeams','Voice','setDataValue','getMailQueues','getSmsQueues','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','flatten','transaction','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Chat','Whatsapp'];(function(_0x2a1112,_0x836bfa){var _0x1d6504=function(_0x33f2b5){while(--_0x33f2b5){_0x2a1112['push'](_0x2a1112['shift']());}};_0x1d6504(++_0x836bfa);}(_0x2a07,0x74));var _0x72a0=function(_0x38e730,_0x2e63b6){_0x38e730=_0x38e730-0x0;var _0x29b82e=_0x2a07[_0x38e730];return _0x29b82e;};'use strict';var moment=require(_0x72a0('0x0'));var BPromise=require(_0x72a0('0x1'));var util=require(_0x72a0('0x2'));var path=require(_0x72a0('0x3'));var fs=require('fs');var _=require(_0x72a0('0x4'));var squel=require('squel');var jayson=require(_0x72a0('0x5'));var Redis=require(_0x72a0('0x6'));var authService=require(_0x72a0('0x7'));var qs=require(_0x72a0('0x8'));var logger=require(_0x72a0('0x9'))(_0x72a0('0xa'));var utils=require(_0x72a0('0xb'));var config=require(_0x72a0('0xc'));var licenseUtil=require(_0x72a0('0xd'));var db=require(_0x72a0('0xe'))['db'];var socket=require(_0x72a0('0xf'))(new Redis(config[_0x72a0('0x10')]));require(_0x72a0('0x11'))[_0x72a0('0x12')](socket);config[_0x72a0('0x10')]=_[_0x72a0('0x13')](config['redis'],{'host':_0x72a0('0x14'),'port':0x18eb});var client=jayson[_0x72a0('0x15')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x46fb8a,_0x194488,_0x1b85b1,_0x44d7cf){return new BPromise(function(_0x975c27,_0x516c08){var _0x130797=_0x44d7cf||client;return _0x130797[_0x72a0('0x16')](_0x46fb8a,_0x1b85b1)[_0x72a0('0x17')](function(_0xf91a82){logger[_0x72a0('0x18')](_0x72a0('0x19'),_0x194488,_0x72a0('0x1a'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x194488,_0x72a0('0x1a'),JSON[_0x72a0('0x1b')](_0xf91a82));if(_0xf91a82[_0x72a0('0x1c')]){if(_0xf91a82[_0x72a0('0x1c')][_0x72a0('0x1d')]===0x1f4){logger[_0x72a0('0x1c')]('User,\x20%s,\x20%s',_0x194488,_0xf91a82[_0x72a0('0x1c')][_0x72a0('0x1e')]);return _0x516c08(_0xf91a82[_0x72a0('0x1c')][_0x72a0('0x1e')]);}logger[_0x72a0('0x1c')]('User,\x20%s,\x20%s',_0x194488,_0xf91a82[_0x72a0('0x1c')][_0x72a0('0x1e')]);return _0x975c27(_0xf91a82[_0x72a0('0x1c')]['message']);}else{logger[_0x72a0('0x18')](_0x72a0('0x19'),_0x194488,_0x72a0('0x1a'));_0x975c27(_0xf91a82[_0x72a0('0x1f')]['message']);}})[_0x72a0('0x20')](function(_0x5b8f2c){logger[_0x72a0('0x1c')](_0x72a0('0x19'),_0x194488,_0x5b8f2c);_0x516c08(_0x5b8f2c);});});}function respondWithStatusCode(_0xde058c,_0x5c7479){_0x5c7479=_0x5c7479||0xcc;return function(_0x35da77){if(_0x35da77){return _0xde058c[_0x72a0('0x21')](_0x5c7479);}return _0xde058c[_0x72a0('0x22')](_0x5c7479)[_0x72a0('0x23')]();};}function respondWithResult(_0x5d6145,_0x38a7ba){_0x38a7ba=_0x38a7ba||0xc8;return function(_0x390464){if(_0x390464){return _0x5d6145[_0x72a0('0x22')](_0x38a7ba)[_0x72a0('0x24')](_0x390464);}};}function respondWithFilteredResult(_0x3022b0,_0x174b1b){return function(_0x5c4daf){if(_0x5c4daf){var _0x4dd1a6=typeof _0x174b1b[_0x72a0('0x25')]===_0x72a0('0x26')&&typeof _0x174b1b[_0x72a0('0x27')]===_0x72a0('0x26');var _0xf5cb49=_0x5c4daf[_0x72a0('0x28')];var _0xa5bda0=_0x4dd1a6?0x0:_0x174b1b[_0x72a0('0x25')];var _0xee99e2=_0x4dd1a6?_0x5c4daf[_0x72a0('0x28')]:_0x174b1b['offset']+_0x174b1b[_0x72a0('0x27')];var _0x553641;if(_0xee99e2>=_0xf5cb49){_0xee99e2=_0xf5cb49;_0x553641=0xc8;}else{_0x553641=0xce;}_0x3022b0[_0x72a0('0x22')](_0x553641);return _0x3022b0[_0x72a0('0x29')](_0x72a0('0x2a'),_0xa5bda0+'-'+_0xee99e2+'/'+_0xf5cb49)[_0x72a0('0x24')](_0x5c4daf);}return null;};}function saveUpdates(_0x432179){return function(_0x12eda2){if(_0x12eda2){return _0x12eda2[_0x72a0('0x2b')](_0x432179)[_0x72a0('0x17')](function(_0x4ba037){return _0x4ba037;});}return null;};}function removeEntity(_0x41efc1){return function(_0x17e955){if(_0x17e955){return _0x17e955[_0x72a0('0x2c')]()[_0x72a0('0x17')](function(){var _0x13c04=_0x17e955[_0x72a0('0x2d')]({'plain':!![]});if(_0x13c04[_0x72a0('0x2e')]==='admin')return;var _0x30878e=[{'name':_0x72a0('0x2f'),'value':_0x72a0('0x30'),'ignore':!![]},{'name':_0x72a0('0x31'),'value':_0x72a0('0x32'),'ignore':![]},{'name':_0x72a0('0x33'),'value':_0x72a0('0x34'),'ignore':![]}];var _0x313287=_(_0x30878e)['filter'](_0x72a0('0x35'))[_0x72a0('0x36')](_0x72a0('0x37'))['value']();if(_[_0x72a0('0x38')](_0x313287,_0x13c04['role'])){return;}var _0x4b2b44=_[_0x72a0('0x39')](_0x30878e,[_0x72a0('0x37'),_0x13c04[_0x72a0('0x2e')]])[_0x72a0('0x3a')];return db[_0x72a0('0x3b')][_0x72a0('0x2c')]({'where':{'type':_0x4b2b44,'resourceId':_0x13c04['id']}})[_0x72a0('0x17')](function(){return _0x17e955;});})[_0x72a0('0x17')](function(){_0x41efc1[_0x72a0('0x22')](0xcc)[_0x72a0('0x23')]();});}};}function handleEntityNotFound(_0x3ff191){return function(_0x5b6326){if(!_0x5b6326){_0x3ff191[_0x72a0('0x21')](0x194);}return _0x5b6326;};}function handleError(_0x5eb8f1,_0x1d0fa8){_0x1d0fa8=_0x1d0fa8||0x1f4;return function(_0x13c251){logger[_0x72a0('0x1c')](_0x13c251[_0x72a0('0x3c')]);if(_0x13c251[_0x72a0('0x3a')]){delete _0x13c251[_0x72a0('0x3a')];}_0x5eb8f1[_0x72a0('0x22')](_0x1d0fa8)[_0x72a0('0x3d')](_0x13c251);};}exports[_0x72a0('0x3e')]=function(_0x4c1f43,_0x4a973a){var _0x41cfc3={},_0x1d9403={'count':0x0,'rows':[]};var _0x332051=_(db[_0x72a0('0x3f')][_0x72a0('0x40')])['map'](function(_0x3bdd4e){return{'name':_0x3bdd4e[_0x72a0('0x41')],'type':_0x3bdd4e['type'][_0x72a0('0x42')]};})['filter'](function(_0x582c84){return!_['includes']([_0x72a0('0x43'),'salt'],_0x582c84[_0x72a0('0x3a')]);})[_0x72a0('0x37')]();_0x41cfc3=qs[_0x72a0('0x44')](_0x332051,_0x4c1f43);var _0x1d0827={'where':_0x41cfc3['where']};return db['User']['count'](_0x1d0827)['then'](function(_0x106828){_0x1d9403[_0x72a0('0x28')]=_0x106828;if(_0x4c1f43['query'][_0x72a0('0x45')]){_0x41cfc3[_0x72a0('0x46')]=[{'all':!![]}];}if(!_['includes'](_0x41cfc3[_0x72a0('0x47')],'id')){_0x41cfc3[_0x72a0('0x47')][_0x72a0('0x48')]('id');}return db[_0x72a0('0x3f')][_0x72a0('0x49')](_0x41cfc3);})[_0x72a0('0x17')](function(_0x50eb7f){_0x1d9403[_0x72a0('0x4a')]=_0x50eb7f;if(_0x4c1f43['query'][_0x72a0('0x4b')]==='true'){var _0x2266e4=[];for(var _0x3bd306=0x0;_0x3bd306<_0x1d9403['rows'][_0x72a0('0x4c')];_0x3bd306++){_0x2266e4['push'](get_open_tabs(_0x72a0('0x4d'),_0x1d9403[_0x72a0('0x4a')][_0x3bd306][_0x72a0('0x4e')]));_0x2266e4['push'](get_open_tabs(_0x72a0('0x4f'),_0x1d9403[_0x72a0('0x4a')][_0x3bd306][_0x72a0('0x4e')]));_0x2266e4['push'](get_open_tabs('fax',_0x1d9403[_0x72a0('0x4a')][_0x3bd306]['dataValues']));_0x2266e4[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x50'),_0x1d9403[_0x72a0('0x4a')][_0x3bd306][_0x72a0('0x4e')]));_0x2266e4[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x51'),_0x1d9403[_0x72a0('0x4a')][_0x3bd306][_0x72a0('0x4e')]));_0x2266e4[_0x72a0('0x48')](get_open_tabs('whatsapp',_0x1d9403[_0x72a0('0x4a')][_0x3bd306][_0x72a0('0x4e')]));}return BPromise[_0x72a0('0x52')](_0x2266e4)[_0x72a0('0x17')](function(_0x3a669d){return _0x1d9403;});}else{return _0x1d9403;}})[_0x72a0('0x17')](respondWithFilteredResult(_0x4a973a,_0x41cfc3))[_0x72a0('0x20')](handleError(_0x4a973a,null));};exports['show']=function(_0x4f9091,_0x409095){var _0x2161a3={'raw':![],'where':{'id':_0x4f9091[_0x72a0('0x53')]['id']}},_0xe38fb3={};_0xe38fb3[_0x72a0('0x54')]=_[_0x72a0('0x55')](_[_0x72a0('0x56')](db[_0x72a0('0x3f')][_0x72a0('0x40')]),[_0x72a0('0x43'),'salt']);_0xe38fb3[_0x72a0('0x57')]=_[_0x72a0('0x56')](_0x4f9091[_0x72a0('0x57')]);_0xe38fb3[_0x72a0('0x58')]=_[_0x72a0('0x59')](_0xe38fb3['model'],_0xe38fb3[_0x72a0('0x57')]);_0x2161a3['attributes']=_['intersection'](_0xe38fb3[_0x72a0('0x54')],qs[_0x72a0('0x5a')](_0x4f9091[_0x72a0('0x57')][_0x72a0('0x5a')]));_0x2161a3[_0x72a0('0x47')]=_0x2161a3['attributes'][_0x72a0('0x4c')]?_0x2161a3[_0x72a0('0x47')]:_0xe38fb3['model'];if(_0x4f9091['query'][_0x72a0('0x45')]){_0x2161a3[_0x72a0('0x46')]=[{'all':!![]}];}_0x2161a3=_[_0x72a0('0x5b')]({},_0x2161a3,_0x4f9091[_0x72a0('0x5c')]);if(!_[_0x72a0('0x38')](_0x2161a3[_0x72a0('0x47')],'id')){_0x2161a3[_0x72a0('0x47')][_0x72a0('0x48')]('id');}return db['User'][_0x72a0('0x39')](_0x2161a3)['then'](handleEntityNotFound(_0x409095,null))['then'](function(_0x591dbc){var _0x1f30e0=[];values=_0x591dbc;if(_0x4f9091[_0x72a0('0x57')]['openTabs']===_0x72a0('0x5d')){_0x1f30e0['push'](get_open_tabs(_0x72a0('0x4d'),_0x591dbc['dataValues']));_0x1f30e0['push'](get_open_tabs(_0x72a0('0x4f'),_0x591dbc[_0x72a0('0x4e')]));_0x1f30e0['push'](get_open_tabs(_0x72a0('0x51'),_0x591dbc['dataValues']));_0x1f30e0[_0x72a0('0x48')](get_open_tabs('whatsapp',_0x591dbc['dataValues']));_0x1f30e0[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x5e'),_0x591dbc[_0x72a0('0x4e')]));_0x1f30e0['push'](get_open_tabs('mail',_0x591dbc[_0x72a0('0x4e')]));return BPromise['all'](_0x1f30e0);}else{return values;}})[_0x72a0('0x17')](function(_0x36d604){return values;})[_0x72a0('0x17')](respondWithResult(_0x409095,null))[_0x72a0('0x20')](handleError(_0x409095,null));};exports[_0x72a0('0x2b')]=function(_0x2628dd,_0x41f7f6){if(_0x2628dd[_0x72a0('0x5f')]['id']){delete _0x2628dd[_0x72a0('0x5f')]['id'];}delete _0x2628dd[_0x72a0('0x5f')][_0x72a0('0x2e')];return db[_0x72a0('0x3f')]['find']({'where':{'id':_0x2628dd[_0x72a0('0x53')]['id']}})['then'](handleEntityNotFound(_0x41f7f6,null))['then'](saveUpdates(_0x2628dd['body'],null))['then'](respondWithResult(_0x41f7f6,null))[_0x72a0('0x20')](handleError(_0x41f7f6,null));};exports[_0x72a0('0x60')]=function(_0xc805a7,_0x4a2f94){return db[_0x72a0('0x3f')]['describe']()[_0x72a0('0x17')](respondWithResult(_0x4a2f94,null))[_0x72a0('0x20')](handleError(_0x4a2f94,null));};exports['addContacts']=function(_0xea9337,_0x24e211){return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0xea9337['params']['id']}})[_0x72a0('0x17')](handleEntityNotFound(_0x24e211,null))['then'](function(_0x29fc67){if(_0x29fc67){return _0x29fc67[_0x72a0('0x61')](_0xea9337[_0x72a0('0x5f')]['ids'],_[_0x72a0('0x62')](_0xea9337[_0x72a0('0x5f')],[_0x72a0('0x63'),'id'])||{});}})[_0x72a0('0x17')](respondWithResult(_0x24e211,null))[_0x72a0('0x20')](handleError(_0x24e211,null));};function validateUser(_0x599e4c){return new BPromise(function(_0x5707e9,_0xa65d14){if(_0x599e4c['internal'])return _0x5707e9(_0x599e4c);return db[_0x72a0('0x64')]['findById'](0x1)[_0x72a0('0x17')](function(_0xd9ae1a){if(_0xd9ae1a['securePassword'])authService[_0x72a0('0x65')](_0x599e4c[_0x72a0('0x43')]);db[_0x72a0('0x3f')]['max'](_0x72a0('0x66'))['then'](function(_0x2ea1bb){if(_[_0x72a0('0x67')](_0x2ea1bb)){_0x599e4c['internal']=_0xd9ae1a[_0x72a0('0x68')]||0x1;return;}if(_['isNil'](_0xd9ae1a['min_internal'])||_0xd9ae1a['min_internal']===_0x2ea1bb){_0x599e4c[_0x72a0('0x66')]=_0x2ea1bb+0x1;return;}if(_0xd9ae1a['min_internal']>_0x2ea1bb){_0x599e4c[_0x72a0('0x66')]=_0xd9ae1a['min_internal'];return;}return db[_0x72a0('0x69')][_0x72a0('0x57')](_0x72a0('0x6a'),{'type':db['sequelize'][_0x72a0('0x6b')][_0x72a0('0x6c')]})[_0x72a0('0x17')](function(_0x28551a){if(_0x28551a&&_0x28551a[_0x72a0('0x4c')]){for(var _0x58ef97=0x0,_0x54e925=_0x28551a[_0x72a0('0x4c')];_0x58ef97<_0x54e925&&_[_0x72a0('0x67')](_0x599e4c[_0x72a0('0x66')]);_0x58ef97++){if(_0xd9ae1a['min_internal']<=_0x28551a[_0x58ef97][_0x72a0('0x6d')]){_0x599e4c[_0x72a0('0x66')]=_0x28551a[_0x58ef97]['from'];}else if(_0xd9ae1a[_0x72a0('0x68')]>_0x28551a[_0x58ef97]['from']&&_0xd9ae1a[_0x72a0('0x68')]<=_0x28551a[_0x58ef97]['to']){_0x599e4c[_0x72a0('0x66')]=_0xd9ae1a[_0x72a0('0x68')];}}}if(_[_0x72a0('0x67')](_0x599e4c[_0x72a0('0x66')])){_0x599e4c[_0x72a0('0x66')]=_0x2ea1bb+0x1;}return _0x5707e9(_0x599e4c);});});})[_0x72a0('0x20')](function(_0x5e3e81){_0xa65d14(_0x5e3e81);});});}function updateUser(_0x5b0dfd){return new BPromise(function(_0x5676e3,_0x1ab2db){try{if(_0x5b0dfd[_0x72a0('0x6e')]){_0x5b0dfd[_0x72a0('0x6f')]=_0x5b0dfd[_0x72a0('0x66')];_0x5b0dfd[_0x72a0('0x70')]={'mailbox':_0x5b0dfd[_0x72a0('0x66')],'password':_0x5b0dfd['password'],'fullname':_0x5b0dfd[_0x72a0('0x71')],'email':_0x5b0dfd[_0x72a0('0x72')]};}if(_0x5b0dfd[_0x72a0('0x2e')]===_0x72a0('0x32')){if(!_0x5b0dfd[_0x72a0('0x73')])_0x5b0dfd[_0x72a0('0x73')]=[_0x72a0('0x74'),'102',_0x72a0('0x75'),_0x72a0('0x76'),_0x72a0('0x77'),_0x72a0('0x78'),_0x72a0('0x79'),_0x72a0('0x7a'),'107',_0x72a0('0x7b'),'109',_0x72a0('0x7c'),_0x72a0('0x7d'),_0x72a0('0x7e'),_0x72a0('0x7f')];}_0x5676e3(_0x5b0dfd);}catch(_0xed6c1b){_0x1ab2db(_0xed6c1b);}});}exports['create']=function(_0x361f8f,_0x46a306){if(_0x361f8f['user'][_0x72a0('0x2e')]===_0x72a0('0x32'))throw new Error(_0x72a0('0x80'));if(_0x361f8f[_0x72a0('0x5f')]['role']===_0x72a0('0x30')&&_0x361f8f[_0x72a0('0x30')][_0x72a0('0x2e')]!==_0x72a0('0x81')){throw new Error(_0x72a0('0x82'));}if(_0x361f8f[_0x72a0('0x5f')][_0x72a0('0x2e')]===_0x72a0('0x81')&&_0x361f8f[_0x72a0('0x30')][_0x72a0('0x2e')]!==_0x72a0('0x81')){throw new Error(_0x72a0('0x83'));}return licenseUtil['checkUserLimits']([_0x361f8f[_0x72a0('0x5f')]])[_0x72a0('0x17')](function(){return validateUser(_0x361f8f[_0x72a0('0x5f')]);})[_0x72a0('0x17')](function(_0xada6ad){return updateUser(_0xada6ad)[_0x72a0('0x17')](function(_0x20281b){if(_0x20281b[_0x72a0('0x2e')]==='admin'){_0x20281b[_0x72a0('0x84')]=_0x361f8f['user']['settingsEnabled'];delete _0x20281b[_0x72a0('0x85')];}return _0x20281b;});})['then'](function(_0x5b9fed){return db[_0x72a0('0x3f')]['create'](_0x5b9fed,{'include':[{'model':db[_0x72a0('0x70')],'as':_0x72a0('0x70')}]});})[_0x72a0('0x17')](function(_0x599a97){if(_0x361f8f[_0x72a0('0x5f')][_0x72a0('0x2e')]===_0x72a0('0x30'))return _0x599a97;if(_0x361f8f[_0x72a0('0x30')][_0x72a0('0x2e')]!=='user')return _0x599a97;return db[_0x72a0('0x86')][_0x72a0('0x39')]({'where':{'name':_0x599a97[_0x72a0('0x2e')]==='agent'?_0x72a0('0x31'):_0x72a0('0x33'),'userProfileId':_0x361f8f[_0x72a0('0x30')]['userProfileId']},'raw':!![]})[_0x72a0('0x17')](function(_0x23b959){if(!_0x23b959||_0x23b959[_0x72a0('0x87')]!=0x0)return _0x599a97;return db[_0x72a0('0x3b')][_0x72a0('0x88')]({'name':_0x599a97[_0x72a0('0x3a')],'resourceId':_0x599a97['id'],'type':_0x23b959[_0x72a0('0x3a')],'sectionId':_0x23b959['id']},{})[_0x72a0('0x17')](function(){return _0x599a97;});})[_0x72a0('0x20')](function(_0x5ca360){logger[_0x72a0('0x1c')](_0x72a0('0x89'),_0x5ca360);throw _0x5ca360;});})[_0x72a0('0x17')](respondWithResult(_0x46a306,0xc9))[_0x72a0('0x20')](handleError(_0x46a306,null));};exports[_0x72a0('0x8a')]=function(_0x5b72b7,_0x311dcd){var _0x2c72fd=_0x5b72b7[_0x72a0('0x5f')];var _0x4124e7=[];if(_0x5b72b7['user'][_0x72a0('0x2e')]===_0x72a0('0x32'))throw new Error(_0x72a0('0x80'));if(_['some'](_0x2c72fd,['role',_0x72a0('0x30')])&&_0x5b72b7[_0x72a0('0x30')][_0x72a0('0x2e')]!==_0x72a0('0x81')){throw new Error(_0x72a0('0x82'));}if(_['some'](_0x2c72fd,['role','admin'])&&_0x5b72b7[_0x72a0('0x30')]['role']!==_0x72a0('0x81')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x2c72fd)['then'](function(){return validateUser(_0x2c72fd[0x0]);})['then'](function(){for(var _0x33c9dd=0x1;_0x33c9dd<_0x2c72fd[_0x72a0('0x4c')];_0x33c9dd++){var _0x153802=_0x2c72fd[_0x33c9dd-0x1][_0x72a0('0x66')];if(!_0x2c72fd[_0x33c9dd]['internal'])_0x2c72fd[_0x33c9dd][_0x72a0('0x66')]=_0x153802+0x1;_0x4124e7[_0x72a0('0x48')](validateUser(_0x2c72fd[_0x33c9dd]));}return BPromise['all'](_0x4124e7);})[_0x72a0('0x17')](function(){_0x4124e7=[];for(var _0x5c30f9=0x0;_0x5c30f9<_0x2c72fd['length'];_0x5c30f9++){_0x4124e7[_0x72a0('0x48')](updateUser(_0x2c72fd[_0x5c30f9]));}return BPromise[_0x72a0('0x52')](_0x4124e7);})[_0x72a0('0x17')](function(){return BPromise[_0x72a0('0x8b')](_0x2c72fd,function(_0x5e1638){return db['User'][_0x72a0('0x88')](_0x5e1638,{'include':[{'model':db[_0x72a0('0x70')],'as':_0x72a0('0x70')}]})[_0x72a0('0x17')](function(_0x2ac5b0){_0x5e1638['id']=_0x2ac5b0['id'];return _0x5e1638;});});})[_0x72a0('0x17')](function(_0x5d0b4c){if(_0x5b72b7['body'][_0x72a0('0x2e')]===_0x72a0('0x30'))return _0x5d0b4c;if(_0x5b72b7['user'][_0x72a0('0x2e')]!==_0x72a0('0x30'))return _0x5d0b4c;var _0xec7717=_[_0x72a0('0x8c')](_0x5d0b4c,function(_0x328c84){return _0x328c84[_0x72a0('0x2e')]===_0x72a0('0x32')||_0x328c84['role']===_0x72a0('0x34');});if(!_0xec7717)return _0x5d0b4c;return db[_0x72a0('0x86')][_0x72a0('0x49')]({'where':{'name':{'$or':['Agents',_0x72a0('0x33')]},'userProfileId':_0x5b72b7[_0x72a0('0x30')][_0x72a0('0x85')]},'raw':!![]})[_0x72a0('0x17')](function(_0x249e5c){if(_['isEmpty'](_0x249e5c)||!_[_0x72a0('0x8c')](_0x249e5c,[_0x72a0('0x87'),0x0]))return _0x5d0b4c;_0x4124e7=[];var _0x1f6d7d=_(_0x249e5c)[_0x72a0('0x36')](function(_0xfe62a1){if(_0xfe62a1[_0x72a0('0x87')]===0x1)return;return _0xfe62a1['name']===_0x72a0('0x31')?_0x72a0('0x32'):_0x72a0('0x34');})[_0x72a0('0x8d')]()[_0x72a0('0x37')]();for(var _0x3ada9c=0x0;_0x3ada9c<_0x5d0b4c[_0x72a0('0x4c')];_0x3ada9c++){if(!_[_0x72a0('0x38')](_0x1f6d7d,_0x5d0b4c[_0x3ada9c][_0x72a0('0x2e')]))return;var _0x49b0e8=_0x5d0b4c[_0x3ada9c][_0x72a0('0x2e')]==='agent'?_0x72a0('0x31'):_0x72a0('0x33');_0x4124e7[_0x72a0('0x48')](db[_0x72a0('0x3b')][_0x72a0('0x88')]({'name':_0x5d0b4c[_0x3ada9c][_0x72a0('0x3a')],'resourceId':_0x5d0b4c[_0x3ada9c]['id'],'type':_0x49b0e8,'sectionId':_['find'](_0x249e5c,['name',_0x49b0e8])['id']},{}));}return BPromise[_0x72a0('0x52')](_0x4124e7);});})[_0x72a0('0x17')](respondWithResult(_0x311dcd,0xc9))[_0x72a0('0x20')](handleError(_0x311dcd,null));};exports[_0x72a0('0x8e')]=function(_0x453201,_0x3657e2){if(_0x453201[_0x72a0('0x5f')]['id']){delete _0x453201[_0x72a0('0x5f')]['id'];}return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x453201[_0x72a0('0x53')]['id']}})[_0x72a0('0x17')](function(_0x1fb03c){if(!_0x1fb03c)return null;if(_0x1fb03c['id']===_0x453201[_0x72a0('0x30')]['id']){if(!_0x453201[_0x72a0('0x5f')]['oldPassword']||!_0x453201[_0x72a0('0x5f')]['newPassword']){throw new db[(_0x72a0('0x8f'))]['ValidationError'](_0x72a0('0x90'));}if(!_0x1fb03c['authenticate'](_0x453201[_0x72a0('0x5f')][_0x72a0('0x91')])){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0x93'));}if(_0x453201[_0x72a0('0x5f')]['oldPassword']===_0x453201[_0x72a0('0x5f')]['newPassword']){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0x94'));}}else if(_0x453201[_0x72a0('0x30')][_0x72a0('0x2e')]===_0x72a0('0x81')){if(!_0x453201['body'][_0x72a0('0x95')]){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0x96'));}}else if(_0x453201[_0x72a0('0x30')][_0x72a0('0x2e')]===_0x72a0('0x30')){if(!_0x453201[_0x72a0('0x5f')][_0x72a0('0x95')]){throw new db['Sequelize'][(_0x72a0('0x92'))](_0x72a0('0x96'));}if(_0x1fb03c[_0x72a0('0x2e')]!==_0x72a0('0x32')){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0x80'));}}else{throw new db[(_0x72a0('0x8f'))]['ValidationError']('Unauthorized');}return _0x1fb03c;})['then'](handleEntityNotFound(_0x3657e2,null))['then'](function(_0x528f71){return db['Setting'][_0x72a0('0x97')]({'attributes':['id','securePassword',_0x72a0('0x98'),'passwordHistoryLimit']})[_0x72a0('0x17')](function(_0x4f2632){if(_0x4f2632[_0x72a0('0x99')])authService[_0x72a0('0x65')](_0x453201['body'][_0x72a0('0x95')]);if(!_0x4f2632['enforcePasswordHistory']||!_0x528f71[_0x72a0('0x9a')])return _0x528f71;authService[_0x72a0('0x9b')](_0x453201['body'][_0x72a0('0x95')],_0x528f71['previousPasswords'],_0x4f2632[_0x72a0('0x9c')]);return _0x528f71;})[_0x72a0('0x17')](saveUpdates({'password':_0x453201[_0x72a0('0x5f')][_0x72a0('0x95')],'passwordResetAt':_0x453201['user']['id']==_0x453201[_0x72a0('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x453201[_0x72a0('0x5f')][_0x72a0('0x95')],_0x528f71[_0x72a0('0x9a')])},null));})[_0x72a0('0x17')](respondWithResult(_0x3657e2,null))[_0x72a0('0x20')](handleError(_0x3657e2,null));};exports[_0x72a0('0x9d')]=function(_0x495e78,_0x38fb73){var _0x308f02=_0x495e78['body'][_0x72a0('0x9e')];return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x495e78[_0x72a0('0x53')]['id']},'attributes':['id','name',_0x72a0('0x2e'),_0x72a0('0x9f'),_0x72a0('0xa0'),_0x72a0('0xa1'),_0x72a0('0xa2')]})[_0x72a0('0x17')](handleEntityNotFound(_0x38fb73,null))['then'](function(_0x404c03){if(_0x404c03){if(!utils[_0x72a0('0xa3')](_0x308f02)){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0xa4'));}return _0x404c03['add'+_[_0x72a0('0xa5')](_0x308f02[_0x72a0('0xa6')]())+'Queues'](_0x495e78[_0x72a0('0x5f')][_0x72a0('0x63')],{'penalty':_0x495e78[_0x72a0('0x5f')]['penalty']||0x0})['spread'](function(_0x418c52){for(var _0x4592d1=0x0;_0x4592d1<_0x495e78[_0x72a0('0x5f')]['ids']['length'];_0x4592d1+=0x1){var _0x1beace={'UserId':Number(_0x495e78['params']['id'])};_0x1beace[_[_0x72a0('0xa5')](_0x308f02[_0x72a0('0xa6')]())+_0x72a0('0xa7')]=Number(_0x495e78[_0x72a0('0x5f')][_0x72a0('0x63')][_0x4592d1]);socket[_0x72a0('0xa8')]('user'+_[_0x72a0('0xa5')](_0x308f02[_0x72a0('0xa6')]())+_0x72a0('0xa9'),_0x1beace);}return _0x418c52;})[_0x72a0('0x17')](function(){if(_0x308f02===_0x72a0('0xaa')){return db[_0x72a0('0xab')][_0x72a0('0x49')]({'where':{'id':_0x495e78[_0x72a0('0x5f')][_0x72a0('0x63')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x72a0('0x17')](function(_0x1f5df8){var _0x1e17dc=_0x404c03[_0x72a0('0x2d')]({'plain':!![]});var _0x1473cf=[];if(_0x308f02===_0x72a0('0xaa')&&_0x1e17dc[_0x72a0('0x2e')]==='agent'&&_0x1e17dc[_0x72a0('0x9f')]){for(var _0x37d831=0x0;_0x37d831<_0x1f5df8['length'];_0x37d831+=0x1){_0x1473cf[_0x72a0('0x48')]({'membername':_0x1e17dc[_0x72a0('0x3a')],'UserId':_0x1e17dc['id'],'queue_name':_0x1f5df8[_0x37d831][_0x72a0('0x3a')],'VoiceQueueId':_0x1f5df8[_0x37d831]['id'],'interface':_[_0x72a0('0x67')](_0x1e17dc[_0x72a0('0xa2')])?util[_0x72a0('0xac')](_0x72a0('0xad'),_0x1e17dc[_0x72a0('0x3a')]):_0x1e17dc[_0x72a0('0xa2')],'paused':_0x1e17dc[_0x72a0('0xa1')]||![],'penalty':_0x495e78[_0x72a0('0x5f')][_0x72a0('0xae')]||0x0});}return BPromise['each'](_0x1473cf,function(_0xff9f7f){return db[_0x72a0('0xaf')]['upsert'](_0xff9f7f);});}return _0x404c03;});}})[_0x72a0('0x17')](respondWithStatusCode(_0x38fb73,null))[_0x72a0('0x20')](handleError(_0x38fb73,null));};exports[_0x72a0('0xb0')]=function(_0x4d2227,_0x34552b){var _0x468b61;return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x4d2227[_0x72a0('0x53')]['id']},'attributes':['id',_0x72a0('0x3a'),'role']})[_0x72a0('0x17')](handleEntityNotFound(_0x34552b,null))[_0x72a0('0x17')](function(_0x4d4dc6){if(_0x4d4dc6){_0x468b61=_0x4d4dc6;if(!_0x4d2227[_0x72a0('0x57')]['channel']||!utils['isValidChannel'](_0x4d2227['query']['channel'])){throw new db[(_0x72a0('0x8f'))][(_0x72a0('0x92'))](_0x72a0('0xa4'));}return _0x4d4dc6['remove'+_[_0x72a0('0xa5')](_0x4d2227['query'][_0x72a0('0x9e')]['toLowerCase']())+_0x72a0('0xb1')](_0x4d2227[_0x72a0('0x57')]['ids']);}})['then'](function(_0x5aa326){if(_[_0x72a0('0xb2')](_0x4d2227['query'][_0x72a0('0x63')])){for(var _0x127b9f=0x0;_0x127b9f<_0x4d2227[_0x72a0('0x57')][_0x72a0('0x63')][_0x72a0('0x4c')];_0x127b9f+=0x1){var _0x4f5fc={'UserId':Number(_0x4d2227[_0x72a0('0x53')]['id'])};_0x4f5fc[_[_0x72a0('0xa5')](_0x4d2227[_0x72a0('0x57')]['channel'][_0x72a0('0xa6')]())+_0x72a0('0xa7')]=Number(_0x4d2227[_0x72a0('0x57')][_0x72a0('0x63')][_0x127b9f]);socket[_0x72a0('0xa8')](_0x72a0('0x30')+_[_0x72a0('0xa5')](_0x4d2227[_0x72a0('0x57')]['channel'][_0x72a0('0xa6')]())+_0x72a0('0xb3'),_0x4f5fc);}}else{var _0x4f5fc={'UserId':Number(_0x4d2227['params']['id'])};_0x4f5fc[_[_0x72a0('0xa5')](_0x4d2227[_0x72a0('0x57')][_0x72a0('0x9e')]['toLowerCase']())+_0x72a0('0xa7')]=Number(_0x4d2227[_0x72a0('0x57')][_0x72a0('0x63')]);socket[_0x72a0('0xa8')](_0x72a0('0x30')+_[_0x72a0('0xa5')](_0x4d2227[_0x72a0('0x57')]['channel'][_0x72a0('0xa6')]())+'Queue:remove',_0x4f5fc);}return _0x5aa326;})[_0x72a0('0x17')](function(){if(_0x4d2227[_0x72a0('0x57')][_0x72a0('0x9e')]==='voice'){return db[_0x72a0('0xaf')]['destroy']({'where':{'UserId':_0x4d2227[_0x72a0('0x53')]['id'],'VoiceQueueId':_0x4d2227[_0x72a0('0x57')][_0x72a0('0x63')]},'individualHooks':!![]})[_0x72a0('0x17')](function(){return _0x468b61;});}return _0x468b61;})[_0x72a0('0x17')](respondWithStatusCode(_0x34552b,null))['catch'](handleError(_0x34552b,null));};exports[_0x72a0('0xb4')]=function(_0x2f37eb,_0x5eca23){_0x2f37eb[_0x72a0('0x5f')][_0x72a0('0xb5')]=_0x2f37eb[_0x72a0('0xb6')][_0x72a0('0xb7')];return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x2f37eb['params']['id']}})[_0x72a0('0x17')](handleEntityNotFound(_0x5eca23,null))[_0x72a0('0x17')](saveUpdates(_0x2f37eb[_0x72a0('0x5f')],null))[_0x72a0('0x17')](respondWithResult(_0x5eca23,null))[_0x72a0('0x20')](handleError(_0x5eca23,null));};exports[_0x72a0('0xb8')]=function(_0x1292a8,_0x197b61){var _0x51c6fe=path[_0x72a0('0xb9')](config['root'],_0x72a0('0xba'));return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x1292a8[_0x72a0('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x72a0('0x17')](handleEntityNotFound(_0x197b61,null))[_0x72a0('0x17')](function(_0x56344f){if(_0x56344f){if(_['isNil'](_0x56344f[_0x72a0('0xb5')])){return _0x197b61['download'](_0x51c6fe);}else{if(!fs[_0x72a0('0xbb')](path[_0x72a0('0xb9')](config[_0x72a0('0xbc')],_0x72a0('0xbd'),_0x56344f[_0x72a0('0xb5')]))){return _0x197b61[_0x72a0('0xbe')](_0x51c6fe);}return _0x197b61[_0x72a0('0xbe')](path[_0x72a0('0xb9')](config['root'],_0x72a0('0xbd'),_0x56344f[_0x72a0('0xb5')]));}}})[_0x72a0('0x20')](handleError(_0x197b61,null));};exports[_0x72a0('0xbf')]=function(_0x378586,_0x4e5279){return db[_0x72a0('0x3f')][_0x72a0('0x39')]({'where':{'id':_0x378586[_0x72a0('0x53')]['id']},'attributes':['id']})[_0x72a0('0x17')](handleEntityNotFound(_0x4e5279,null))[_0x72a0('0x17')](function(_0x112e00){var _0x1522ba=[];values=_0x112e00[_0x72a0('0x4e')];_0x1522ba[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x4d'),_0x112e00[_0x72a0('0x4e')]));_0x1522ba[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x4f'),_0x112e00['dataValues']));_0x1522ba[_0x72a0('0x48')](get_open_tabs('openchannel',_0x112e00[_0x72a0('0x4e')]));_0x1522ba[_0x72a0('0x48')](get_open_tabs('whatsapp',_0x112e00[_0x72a0('0x4e')]));_0x1522ba[_0x72a0('0x48')](get_open_tabs('fax',_0x112e00[_0x72a0('0x4e')]));_0x1522ba[_0x72a0('0x48')](get_open_tabs(_0x72a0('0x50'),_0x112e00[_0x72a0('0x4e')]));return BPromise[_0x72a0('0x52')](_0x1522ba);})[_0x72a0('0x17')](function(_0x56f1a6){var _0x23273e=[];if(_0x56f1a6){for(var _0x3b543f=0x0;_0x3b543f=_0x1b07a7){_0x35eec3=_0x1b07a7;_0x541bc9=0xc8;}else{_0x541bc9=0xce;}_0x59cd8e[_0x1126('0x1d')](_0x541bc9);return _0x59cd8e[_0x1126('0x24')]('Content-Range',_0x38119d+'-'+_0x35eec3+'/'+_0x1b07a7)[_0x1126('0x1f')](_0x4b57ab);}return null;};}function saveUpdates(_0x23d2bc){return function(_0x4a334a){if(_0x4a334a){return _0x4a334a[_0x1126('0x25')](_0x23d2bc)['then'](function(_0xc62460){return _0xc62460;});}return null;};}function removeEntity(_0x4bd50b){return function(_0x771bb8){if(_0x771bb8){return _0x771bb8['destroy']()[_0x1126('0x13')](function(){var _0x5f2611=_0x771bb8['get']({'plain':!![]});if(_0x5f2611['role']===_0x1126('0x26'))return;var _0xa8906d=[{'name':_0x1126('0x27'),'value':'user','ignore':!![]},{'name':_0x1126('0x28'),'value':_0x1126('0x29'),'ignore':![]},{'name':'Telephones','value':_0x1126('0x2a'),'ignore':![]}];var _0x1e80aa=_(_0xa8906d)[_0x1126('0x2b')](_0x1126('0x2c'))['map']('value')[_0x1126('0x2d')]();if(_[_0x1126('0x2e')](_0x1e80aa,_0x5f2611[_0x1126('0x2f')])){return;}var _0x2c67eb=_['find'](_0xa8906d,[_0x1126('0x2d'),_0x5f2611[_0x1126('0x2f')]])[_0x1126('0x30')];return db[_0x1126('0x31')][_0x1126('0x32')]({'where':{'type':_0x2c67eb,'resourceId':_0x5f2611['id']}})['then'](function(){return _0x771bb8;});})[_0x1126('0x13')](function(){_0x4bd50b[_0x1126('0x1d')](0xcc)[_0x1126('0x1e')]();});}};}function handleEntityNotFound(_0x42e773){return function(_0x5c019d){if(!_0x5c019d){_0x42e773['sendStatus'](0x194);}return _0x5c019d;};}function handleError(_0x22827a,_0x31d07c){_0x31d07c=_0x31d07c||0x1f4;return function(_0x511e6b){logger[_0x1126('0x19')](_0x511e6b[_0x1126('0x33')]);if(_0x511e6b[_0x1126('0x30')]){delete _0x511e6b['name'];}_0x22827a['status'](_0x31d07c)[_0x1126('0x34')](_0x511e6b);};}exports[_0x1126('0x35')]=function(_0x3aa08f,_0x156554){var _0x4a202e={},_0x428d3d={'count':0x0,'rows':[]};var _0x4965d0=_(db[_0x1126('0x36')][_0x1126('0x37')])[_0x1126('0x38')](function(_0x1ea702){return{'name':_0x1ea702[_0x1126('0x39')],'type':_0x1ea702['type'][_0x1126('0x3a')]};})[_0x1126('0x2b')](function(_0x2939a9){return!_[_0x1126('0x2e')]([_0x1126('0x3b'),_0x1126('0x3c')],_0x2939a9[_0x1126('0x30')]);})['value']();_0x4a202e=qs[_0x1126('0x3d')](_0x4965d0,_0x3aa08f);var _0x154c28={'where':_0x4a202e[_0x1126('0x3e')]};return db[_0x1126('0x36')][_0x1126('0x23')](_0x154c28)['then'](function(_0x5bdf1a){_0x428d3d[_0x1126('0x23')]=_0x5bdf1a;if(_0x3aa08f[_0x1126('0x3f')][_0x1126('0x40')]){_0x4a202e[_0x1126('0x41')]=[{'all':!![]}];}if(!_[_0x1126('0x2e')](_0x4a202e[_0x1126('0x42')],'id')){_0x4a202e['attributes']['push']('id');}return db['User'][_0x1126('0x43')](_0x4a202e);})['then'](function(_0xf84005){_0x428d3d[_0x1126('0x44')]=_0xf84005;if(_0x3aa08f[_0x1126('0x3f')][_0x1126('0x45')]==='true'){var _0x4c94bb=[];for(var _0x353042=0x0;_0x353042<_0x428d3d[_0x1126('0x44')][_0x1126('0x46')];_0x353042++){_0x4c94bb['push'](get_open_tabs(_0x1126('0x47'),_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x49'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x4a'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs('mail',_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb['push'](get_open_tabs(_0x1126('0x4b'),_0x428d3d['rows'][_0x353042][_0x1126('0x48')]));_0x4c94bb[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4d'),_0x428d3d[_0x1126('0x44')][_0x353042][_0x1126('0x48')]));}return BPromise['all'](_0x4c94bb)[_0x1126('0x13')](function(_0x512f60){return _0x428d3d;});}else{return _0x428d3d;}})['then'](respondWithFilteredResult(_0x156554,_0x4a202e))[_0x1126('0x1b')](handleError(_0x156554,null));};exports[_0x1126('0x4e')]=function(_0x575f79,_0x5f6d73){var _0x1ffa2b={'raw':![],'where':{'id':_0x575f79[_0x1126('0x4f')]['id']}},_0x518e0a={};_0x518e0a[_0x1126('0x50')]=_[_0x1126('0x51')](_['keys'](db[_0x1126('0x36')][_0x1126('0x37')]),[_0x1126('0x3b'),_0x1126('0x3c')]);_0x518e0a[_0x1126('0x3f')]=_[_0x1126('0x52')](_0x575f79[_0x1126('0x3f')]);_0x518e0a[_0x1126('0x53')]=_['intersection'](_0x518e0a[_0x1126('0x50')],_0x518e0a['query']);_0x1ffa2b[_0x1126('0x42')]=_[_0x1126('0x54')](_0x518e0a['model'],qs['fields'](_0x575f79[_0x1126('0x3f')][_0x1126('0x55')]));_0x1ffa2b[_0x1126('0x42')]=_0x1ffa2b['attributes'][_0x1126('0x46')]?_0x1ffa2b[_0x1126('0x42')]:_0x518e0a[_0x1126('0x50')];if(_0x575f79[_0x1126('0x3f')]['includeAll']){_0x1ffa2b[_0x1126('0x41')]=[{'all':!![]}];}_0x1ffa2b=_[_0x1126('0x56')]({},_0x1ffa2b,_0x575f79['options']);if(!_['includes'](_0x1ffa2b['attributes'],'id')){_0x1ffa2b['attributes'][_0x1126('0x4c')]('id');}return db[_0x1126('0x36')]['find'](_0x1ffa2b)[_0x1126('0x13')](handleEntityNotFound(_0x5f6d73,null))[_0x1126('0x13')](function(_0x38093e){var _0x38f521=[];values=_0x38093e;if(_0x575f79[_0x1126('0x3f')]['openTabs']===_0x1126('0x57')){_0x38f521[_0x1126('0x4c')](get_open_tabs('chat',_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs(_0x1126('0x49'),_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('openchannel',_0x38093e[_0x1126('0x48')]));_0x38f521['push'](get_open_tabs(_0x1126('0x4d'),_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('fax',_0x38093e[_0x1126('0x48')]));_0x38f521[_0x1126('0x4c')](get_open_tabs('mail',_0x38093e[_0x1126('0x48')]));return BPromise[_0x1126('0x58')](_0x38f521);}else{return values;}})[_0x1126('0x13')](function(_0x5a5340){return values;})[_0x1126('0x13')](respondWithResult(_0x5f6d73,null))[_0x1126('0x1b')](handleError(_0x5f6d73,null));};exports[_0x1126('0x25')]=function(_0x308ee4,_0x128c94){if(_0x308ee4[_0x1126('0x59')]['id']){delete _0x308ee4[_0x1126('0x59')]['id'];}delete _0x308ee4[_0x1126('0x59')]['role'];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x308ee4[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x128c94,null))[_0x1126('0x13')](saveUpdates(_0x308ee4['body'],null))[_0x1126('0x13')](respondWithResult(_0x128c94,null))[_0x1126('0x1b')](handleError(_0x128c94,null));};exports['describe']=function(_0x3767e4,_0x5246aa){return db[_0x1126('0x36')][_0x1126('0x5b')]()['then'](respondWithResult(_0x5246aa,null))[_0x1126('0x1b')](handleError(_0x5246aa,null));};exports[_0x1126('0x5c')]=function(_0x375b76,_0x592960){return db[_0x1126('0x36')]['find']({'where':{'id':_0x375b76['params']['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x592960,null))[_0x1126('0x13')](function(_0x130f26){if(_0x130f26){return _0x130f26[_0x1126('0x5c')](_0x375b76[_0x1126('0x59')][_0x1126('0x5d')],_[_0x1126('0x5e')](_0x375b76['body'],[_0x1126('0x5d'),'id'])||{});}})[_0x1126('0x13')](respondWithResult(_0x592960,null))[_0x1126('0x1b')](handleError(_0x592960,null));};function validateUser(_0xc39c36){return new BPromise(function(_0x3f87aa,_0x3cd788){if(_0xc39c36['internal'])return _0x3f87aa(_0xc39c36);return db['Setting'][_0x1126('0x5f')](0x1)[_0x1126('0x13')](function(_0x4bf2b3){if(_0x4bf2b3['securePassword'])authService['validatePasswordPattern'](_0xc39c36['password']);db[_0x1126('0x36')][_0x1126('0x60')](_0x1126('0x61'))['then'](function(_0x30e32f){if(_[_0x1126('0x62')](_0x30e32f)){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')]||0x1;return;}if(_[_0x1126('0x62')](_0x4bf2b3[_0x1126('0x63')])||_0x4bf2b3[_0x1126('0x63')]===_0x30e32f){_0xc39c36['internal']=_0x30e32f+0x1;return;}if(_0x4bf2b3[_0x1126('0x63')]>_0x30e32f){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')];return;}return db[_0x1126('0x64')][_0x1126('0x3f')]('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['sequelize'][_0x1126('0x65')][_0x1126('0x66')]})['then'](function(_0x3bf25d){if(_0x3bf25d&&_0x3bf25d[_0x1126('0x46')]){for(var _0x366675=0x0,_0x6a41c0=_0x3bf25d[_0x1126('0x46')];_0x366675<_0x6a41c0&&_[_0x1126('0x62')](_0xc39c36[_0x1126('0x61')]);_0x366675++){if(_0x4bf2b3[_0x1126('0x63')]<=_0x3bf25d[_0x366675][_0x1126('0x67')]){_0xc39c36[_0x1126('0x61')]=_0x3bf25d[_0x366675][_0x1126('0x67')];}else if(_0x4bf2b3[_0x1126('0x63')]>_0x3bf25d[_0x366675][_0x1126('0x67')]&&_0x4bf2b3['min_internal']<=_0x3bf25d[_0x366675]['to']){_0xc39c36[_0x1126('0x61')]=_0x4bf2b3[_0x1126('0x63')];}}}if(_[_0x1126('0x62')](_0xc39c36['internal'])){_0xc39c36['internal']=_0x30e32f+0x1;}return _0x3f87aa(_0xc39c36);});});})[_0x1126('0x1b')](function(_0xa4e8d4){_0x3cd788(_0xa4e8d4);});});}function updateUser(_0x1998f2){return new BPromise(function(_0x3bfeb8,_0x51929e){try{if(_0x1998f2['voicemail']){_0x1998f2['mailbox']=_0x1998f2[_0x1126('0x61')];_0x1998f2[_0x1126('0x68')]={'mailbox':_0x1998f2[_0x1126('0x61')],'password':_0x1998f2[_0x1126('0x3b')],'fullname':_0x1998f2['fullname'],'email':_0x1998f2[_0x1126('0x69')]};}if(_0x1998f2['role']===_0x1126('0x29')){if(!_0x1998f2[_0x1126('0x6a')])_0x1998f2[_0x1126('0x6a')]=[_0x1126('0x6b'),_0x1126('0x6c'),_0x1126('0x6d'),_0x1126('0x6e'),'110',_0x1126('0x6f'),'105',_0x1126('0x70'),_0x1126('0x71'),'108',_0x1126('0x72'),_0x1126('0x73'),'111',_0x1126('0x74'),_0x1126('0x75')];}_0x3bfeb8(_0x1998f2);}catch(_0x4b1d04){_0x51929e(_0x4b1d04);}});}exports['create']=function(_0xb21659,_0xa27290){if(_0xb21659[_0x1126('0x76')]['role']==='agent')throw new Error('Unauthorized');if(_0xb21659[_0x1126('0x59')]['role']==='user'&&_0xb21659[_0x1126('0x76')]['role']!==_0x1126('0x26')){throw new Error(_0x1126('0x77'));}if(_0xb21659['body'][_0x1126('0x2f')]===_0x1126('0x26')&&_0xb21659[_0x1126('0x76')][_0x1126('0x2f')]!==_0x1126('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x1126('0x78')]([_0xb21659[_0x1126('0x59')]])['then'](function(){return validateUser(_0xb21659[_0x1126('0x59')]);})[_0x1126('0x13')](function(_0x2c0908){return updateUser(_0x2c0908)[_0x1126('0x13')](function(_0x2598a7){if(_0x2598a7[_0x1126('0x2f')]===_0x1126('0x26')){_0x2598a7[_0x1126('0x79')]=_0xb21659[_0x1126('0x76')][_0x1126('0x79')];delete _0x2598a7[_0x1126('0x7a')];}return _0x2598a7;});})[_0x1126('0x13')](function(_0x2010a9){return db[_0x1126('0x36')][_0x1126('0x7b')](_0x2010a9,{'include':[{'model':db[_0x1126('0x68')],'as':'VoiceMail'}]});})[_0x1126('0x13')](function(_0x20c91f){if(_0xb21659[_0x1126('0x59')][_0x1126('0x2f')]===_0x1126('0x76'))return _0x20c91f;if(_0xb21659['user'][_0x1126('0x2f')]!=='user')return _0x20c91f;return db['UserProfileSection'][_0x1126('0x5a')]({'where':{'name':_0x20c91f[_0x1126('0x2f')]==='agent'?'Agents':_0x1126('0x7c'),'userProfileId':_0xb21659[_0x1126('0x76')][_0x1126('0x7a')]},'raw':!![]})[_0x1126('0x13')](function(_0x1a60b9){if(!_0x1a60b9||_0x1a60b9[_0x1126('0x7d')]!=0x0)return _0x20c91f;return db[_0x1126('0x31')][_0x1126('0x7b')]({'name':_0x20c91f[_0x1126('0x30')],'resourceId':_0x20c91f['id'],'type':_0x1a60b9['name'],'sectionId':_0x1a60b9['id']},{})[_0x1126('0x13')](function(){return _0x20c91f;});})[_0x1126('0x1b')](function(_0x3178f5){logger[_0x1126('0x19')](_0x1126('0x7e'),_0x3178f5);throw _0x3178f5;});})[_0x1126('0x13')](respondWithResult(_0xa27290,0xc9))['catch'](handleError(_0xa27290,null));};exports[_0x1126('0x7f')]=function(_0x2cc4c8,_0x194b3c){var _0x37c8bb=_0x2cc4c8[_0x1126('0x59')];var _0x1796eb=[];if(_0x2cc4c8[_0x1126('0x76')][_0x1126('0x2f')]===_0x1126('0x29'))throw new Error(_0x1126('0x80'));if(_['some'](_0x37c8bb,['role',_0x1126('0x76')])&&_0x2cc4c8['user'][_0x1126('0x2f')]!=='admin'){throw new Error(_0x1126('0x77'));}if(_['some'](_0x37c8bb,[_0x1126('0x2f'),'admin'])&&_0x2cc4c8['user']['role']!==_0x1126('0x26')){throw new Error(_0x1126('0x81'));}return licenseUtil['checkUserLimits'](_0x37c8bb)['then'](function(){return validateUser(_0x37c8bb[0x0]);})[_0x1126('0x13')](function(){for(var _0xe2f82d=0x1;_0xe2f82d<_0x37c8bb[_0x1126('0x46')];_0xe2f82d++){var _0x5dfb8f=_0x37c8bb[_0xe2f82d-0x1]['internal'];if(!_0x37c8bb[_0xe2f82d][_0x1126('0x61')])_0x37c8bb[_0xe2f82d]['internal']=_0x5dfb8f+0x1;_0x1796eb[_0x1126('0x4c')](validateUser(_0x37c8bb[_0xe2f82d]));}return BPromise[_0x1126('0x58')](_0x1796eb);})[_0x1126('0x13')](function(){_0x1796eb=[];for(var _0x29922a=0x0;_0x29922a<_0x37c8bb[_0x1126('0x46')];_0x29922a++){_0x1796eb['push'](updateUser(_0x37c8bb[_0x29922a]));}return BPromise['all'](_0x1796eb);})[_0x1126('0x13')](function(){return BPromise[_0x1126('0x82')](_0x37c8bb,function(_0xfc9fb4){return db[_0x1126('0x36')][_0x1126('0x7b')](_0xfc9fb4,{'include':[{'model':db[_0x1126('0x68')],'as':_0x1126('0x68')}]})[_0x1126('0x13')](function(_0x324a37){_0xfc9fb4['id']=_0x324a37['id'];return _0xfc9fb4;});});})[_0x1126('0x13')](function(_0x1a6641){if(_0x2cc4c8['body'][_0x1126('0x2f')]==='user')return _0x1a6641;if(_0x2cc4c8[_0x1126('0x76')]['role']!==_0x1126('0x76'))return _0x1a6641;var _0x25a678=_[_0x1126('0x83')](_0x1a6641,function(_0x300253){return _0x300253['role']===_0x1126('0x29')||_0x300253[_0x1126('0x2f')]==='telephone';});if(!_0x25a678)return _0x1a6641;return db['UserProfileSection'][_0x1126('0x43')]({'where':{'name':{'$or':[_0x1126('0x28'),_0x1126('0x7c')]},'userProfileId':_0x2cc4c8['user'][_0x1126('0x7a')]},'raw':!![]})['then'](function(_0x144cb4){if(_[_0x1126('0x84')](_0x144cb4)||!_['some'](_0x144cb4,[_0x1126('0x7d'),0x0]))return _0x1a6641;_0x1796eb=[];var _0x315192=_(_0x144cb4)[_0x1126('0x38')](function(_0x34df7d){if(_0x34df7d[_0x1126('0x7d')]===0x1)return;return _0x34df7d['name']===_0x1126('0x28')?_0x1126('0x29'):_0x1126('0x2a');})['compact']()['value']();for(var _0x55b45e=0x0;_0x55b45e<_0x1a6641[_0x1126('0x46')];_0x55b45e++){if(!_[_0x1126('0x2e')](_0x315192,_0x1a6641[_0x55b45e][_0x1126('0x2f')]))return;var _0x2a1b22=_0x1a6641[_0x55b45e]['role']===_0x1126('0x29')?_0x1126('0x28'):_0x1126('0x7c');_0x1796eb[_0x1126('0x4c')](db[_0x1126('0x31')]['create']({'name':_0x1a6641[_0x55b45e][_0x1126('0x30')],'resourceId':_0x1a6641[_0x55b45e]['id'],'type':_0x2a1b22,'sectionId':_[_0x1126('0x5a')](_0x144cb4,['name',_0x2a1b22])['id']},{}));}return BPromise[_0x1126('0x58')](_0x1796eb);});})['then'](respondWithResult(_0x194b3c,0xc9))['catch'](handleError(_0x194b3c,null));};exports[_0x1126('0x85')]=function(_0x5e106e,_0x1e763){if(_0x5e106e[_0x1126('0x59')]['id']){delete _0x5e106e[_0x1126('0x59')]['id'];}return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x5e106e[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](function(_0xdc07fc){if(!_0xdc07fc)return null;if(_0xdc07fc['id']===_0x5e106e[_0x1126('0x76')]['id']){if(!_0x5e106e['body'][_0x1126('0x86')]||!_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db[(_0x1126('0x88'))]['ValidationError'](_0x1126('0x89'));}if(!_0xdc07fc[_0x1126('0x8a')](_0x5e106e[_0x1126('0x59')][_0x1126('0x86')])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x5e106e[_0x1126('0x59')]['oldPassword']===_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db['Sequelize']['ValidationError'](_0x1126('0x8b'));}}else if(_0x5e106e[_0x1126('0x76')]['role']===_0x1126('0x26')){if(!_0x5e106e[_0x1126('0x59')]['newPassword']){throw new db[(_0x1126('0x88'))]['ValidationError'](_0x1126('0x8c'));}}else if(_0x5e106e[_0x1126('0x76')][_0x1126('0x2f')]==='user'){if(!_0x5e106e[_0x1126('0x59')][_0x1126('0x87')]){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x8c'));}if(_0xdc07fc[_0x1126('0x2f')]!==_0x1126('0x29')){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x80'));}}else{throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))](_0x1126('0x80'));}return _0xdc07fc;})[_0x1126('0x13')](handleEntityNotFound(_0x1e763,null))[_0x1126('0x13')](function(_0xc4cc17){return db[_0x1126('0x8e')]['findOne']({'attributes':['id',_0x1126('0x8f'),_0x1126('0x90'),'passwordHistoryLimit']})['then'](function(_0xd6de57){if(_0xd6de57[_0x1126('0x8f')])authService[_0x1126('0x91')](_0x5e106e[_0x1126('0x59')]['newPassword']);if(!_0xd6de57[_0x1126('0x90')]||!_0xc4cc17[_0x1126('0x92')])return _0xc4cc17;authService['validatePasswordHistory'](_0x5e106e[_0x1126('0x59')]['newPassword'],_0xc4cc17[_0x1126('0x92')],_0xd6de57[_0x1126('0x93')]);return _0xc4cc17;})['then'](saveUpdates({'password':_0x5e106e['body'][_0x1126('0x87')],'passwordResetAt':_0x5e106e['user']['id']==_0x5e106e['params']['id']?moment():null,'previousPasswords':authService[_0x1126('0x94')](_0x5e106e[_0x1126('0x59')][_0x1126('0x87')],_0xc4cc17[_0x1126('0x92')])},null));})['then'](respondWithResult(_0x1e763,null))['catch'](handleError(_0x1e763,null));};exports['addQueues']=function(_0x207b77,_0x183bf8){var _0x52487b=_0x207b77[_0x1126('0x59')][_0x1126('0x95')];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x207b77[_0x1126('0x4f')]['id']},'attributes':['id',_0x1126('0x30'),_0x1126('0x2f'),_0x1126('0x96'),_0x1126('0x97'),_0x1126('0x98'),_0x1126('0x99')]})['then'](handleEntityNotFound(_0x183bf8,null))[_0x1126('0x13')](function(_0x559430){if(_0x559430){if(!utils[_0x1126('0x9a')](_0x52487b)){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))]('Unknown\x20channel');}return _0x559430[_0x1126('0x9b')+_[_0x1126('0x9c')](_0x52487b[_0x1126('0x9d')]())+'Queues'](_0x207b77[_0x1126('0x59')][_0x1126('0x5d')],{'penalty':_0x207b77[_0x1126('0x59')][_0x1126('0x9e')]||0x0})[_0x1126('0x9f')](function(_0x589d0c){for(var _0x520371=0x0;_0x520371<_0x207b77[_0x1126('0x59')][_0x1126('0x5d')][_0x1126('0x46')];_0x520371+=0x1){var _0x2a7f87={'UserId':Number(_0x207b77[_0x1126('0x4f')]['id'])};_0x2a7f87[_[_0x1126('0x9c')](_0x52487b[_0x1126('0x9d')]())+_0x1126('0xa0')]=Number(_0x207b77[_0x1126('0x59')][_0x1126('0x5d')][_0x520371]);socket[_0x1126('0xa1')]('user'+_['capitalize'](_0x52487b[_0x1126('0x9d')]())+_0x1126('0xa2'),_0x2a7f87);}return _0x589d0c;})[_0x1126('0x13')](function(){if(_0x52487b==='voice'){return db['VoiceQueue'][_0x1126('0x43')]({'where':{'id':_0x207b77[_0x1126('0x59')][_0x1126('0x5d')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x1126('0x13')](function(_0x1cbd6c){var _0x5a28f9=_0x559430[_0x1126('0xa3')]({'plain':!![]});var _0x4411dc=[];if(_0x52487b===_0x1126('0xa4')&&_0x5a28f9[_0x1126('0x2f')]===_0x1126('0x29')&&_0x5a28f9['online']){for(var _0x346c68=0x0;_0x346c68<_0x1cbd6c[_0x1126('0x46')];_0x346c68+=0x1){_0x4411dc['push']({'membername':_0x5a28f9['name'],'UserId':_0x5a28f9['id'],'queue_name':_0x1cbd6c[_0x346c68]['name'],'VoiceQueueId':_0x1cbd6c[_0x346c68]['id'],'interface':_[_0x1126('0x62')](_0x5a28f9[_0x1126('0x99')])?util[_0x1126('0xa5')](_0x1126('0xa6'),_0x5a28f9[_0x1126('0x30')]):_0x5a28f9['interface'],'paused':_0x5a28f9[_0x1126('0x98')]||![],'penalty':_0x207b77['body'][_0x1126('0x9e')]||0x0});}return BPromise[_0x1126('0x82')](_0x4411dc,function(_0x4e4915){return db['UserVoiceQueueRt'][_0x1126('0xa7')](_0x4e4915);});}return _0x559430;});}})[_0x1126('0x13')](respondWithStatusCode(_0x183bf8,null))['catch'](handleError(_0x183bf8,null));};exports['removeQueues']=function(_0x8bd0dc,_0x278a51){var _0x19cd9d;return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x8bd0dc[_0x1126('0x4f')]['id']},'attributes':['id',_0x1126('0x30'),_0x1126('0x2f')]})[_0x1126('0x13')](handleEntityNotFound(_0x278a51,null))[_0x1126('0x13')](function(_0x47ab6e){if(_0x47ab6e){_0x19cd9d=_0x47ab6e;if(!_0x8bd0dc['query'][_0x1126('0x95')]||!utils[_0x1126('0x9a')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')])){throw new db[(_0x1126('0x88'))][(_0x1126('0x8d'))]('Unknown\x20channel');}return _0x47ab6e['remove'+_[_0x1126('0x9c')](_0x8bd0dc['query']['channel'][_0x1126('0x9d')]())+_0x1126('0xa8')](_0x8bd0dc['query'][_0x1126('0x5d')]);}})[_0x1126('0x13')](function(_0x29c95f){if(_[_0x1126('0xa9')](_0x8bd0dc['query'][_0x1126('0x5d')])){for(var _0x2ea320=0x0;_0x2ea320<_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x5d')][_0x1126('0x46')];_0x2ea320+=0x1){var _0x232529={'UserId':Number(_0x8bd0dc[_0x1126('0x4f')]['id'])};_0x232529[_['capitalize'](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')][_0x1126('0x9d')]())+_0x1126('0xa0')]=Number(_0x8bd0dc['query'][_0x1126('0x5d')][_0x2ea320]);socket[_0x1126('0xa1')]('user'+_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]['toLowerCase']())+_0x1126('0xaa'),_0x232529);}}else{var _0x232529={'UserId':Number(_0x8bd0dc[_0x1126('0x4f')]['id'])};_0x232529[_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]['toLowerCase']())+_0x1126('0xa0')]=Number(_0x8bd0dc[_0x1126('0x3f')]['ids']);socket[_0x1126('0xa1')](_0x1126('0x76')+_[_0x1126('0x9c')](_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')][_0x1126('0x9d')]())+'Queue:remove',_0x232529);}return _0x29c95f;})['then'](function(){if(_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x95')]===_0x1126('0xa4')){return db[_0x1126('0xab')][_0x1126('0x32')]({'where':{'UserId':_0x8bd0dc[_0x1126('0x4f')]['id'],'VoiceQueueId':_0x8bd0dc[_0x1126('0x3f')][_0x1126('0x5d')]},'individualHooks':!![]})[_0x1126('0x13')](function(){return _0x19cd9d;});}return _0x19cd9d;})[_0x1126('0x13')](respondWithStatusCode(_0x278a51,null))[_0x1126('0x1b')](handleError(_0x278a51,null));};exports[_0x1126('0xac')]=function(_0x13fdfd,_0x3aa4d5){_0x13fdfd[_0x1126('0x59')][_0x1126('0xad')]=_0x13fdfd[_0x1126('0xae')][_0x1126('0xaf')];return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x13fdfd[_0x1126('0x4f')]['id']}})[_0x1126('0x13')](handleEntityNotFound(_0x3aa4d5,null))[_0x1126('0x13')](saveUpdates(_0x13fdfd[_0x1126('0x59')],null))[_0x1126('0x13')](respondWithResult(_0x3aa4d5,null))['catch'](handleError(_0x3aa4d5,null));};exports[_0x1126('0xb0')]=function(_0x593386,_0x30f4d5){var _0x442f1c=path[_0x1126('0xb1')](config['root'],_0x1126('0xb2'));return db['User'][_0x1126('0x5a')]({'where':{'id':_0x593386[_0x1126('0x4f')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x1126('0x13')](handleEntityNotFound(_0x30f4d5,null))[_0x1126('0x13')](function(_0x2bea69){if(_0x2bea69){if(_[_0x1126('0x62')](_0x2bea69[_0x1126('0xad')])){return _0x30f4d5[_0x1126('0xb3')](_0x442f1c);}else{if(!fs[_0x1126('0xb4')](path[_0x1126('0xb1')](config[_0x1126('0xb5')],'server/files/images/',_0x2bea69[_0x1126('0xad')]))){return _0x30f4d5[_0x1126('0xb3')](_0x442f1c);}return _0x30f4d5[_0x1126('0xb3')](path[_0x1126('0xb1')](config['root'],'server/files/images/',_0x2bea69['userpic']));}}})['catch'](handleError(_0x30f4d5,null));};exports[_0x1126('0xb6')]=function(_0x4f62a1,_0x2fe211){return db[_0x1126('0x36')][_0x1126('0x5a')]({'where':{'id':_0x4f62a1[_0x1126('0x4f')]['id']},'attributes':['id']})[_0x1126('0x13')](handleEntityNotFound(_0x2fe211,null))[_0x1126('0x13')](function(_0x53b685){var _0x3f2e98=[];values=_0x53b685['dataValues'];_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x47'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x49'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4b'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4d'),_0x53b685['dataValues']));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0x4a'),_0x53b685[_0x1126('0x48')]));_0x3f2e98[_0x1126('0x4c')](get_open_tabs(_0x1126('0xb7'),_0x53b685[_0x1126('0x48')]));return BPromise[_0x1126('0x58')](_0x3f2e98);})['then'](function(_0x54a11c){var _0x5d7a22=[];if(_0x54a11c){for(var _0x1b77c0=0x0;_0x1b77c0=_0xec1eff['agents']){throw new Error(_0xa55d('0x54'));}})[_0xa55d('0x25')](function(){if(_0x53c5d7){return db['UserVoiceQueueRt'][_0xa55d('0x4e')]({'where':{'membername':_0x53c5d7[_0xa55d('0x2c')]},'individualHooks':!![]});}})[_0xa55d('0x25')](function(){if(_0x53c5d7){return _0x53c5d7[_0xa55d('0x55')]({'raw':!![]});}})[_0xa55d('0x25')](function(_0x161a21){if(_0x53c5d7){if(_0x161a21){var _0xed9fe4=[];_0x5112c8=_0x161a21;if(_0x5112c8[_0xa55d('0x32')]){for(var _0x5114f2=0x0;_0x5114f2<_0x5112c8[_0xa55d('0x32')];_0x5114f2++){_0xed9fe4[_0xa55d('0x36')](db[_0xa55d('0x30')]['upsert']({'membername':_0x53c5d7[_0xa55d('0x2c')],'UserId':_0x53c5d7['id'],'queue_name':_0x5112c8[_0x5114f2][_0xa55d('0x2c')],'VoiceQueueId':_0x5112c8[_0x5114f2]['id'],'interface':_0x11d8e0,'paused':_0x53c5d7[_0xa55d('0x4f')]||![],'penalty':_0x5112c8[_0x5114f2]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0xed9fe4);}}}})['then'](function(){if(_0x53c5d7){return db['MemberReport']['findAll']({'where':{'membername':_0x53c5d7[_0xa55d('0x2c')],'exitAt':null}});}})[_0xa55d('0x25')](function(_0x552d9d){if(_0x53c5d7){if(_0x552d9d&&_0x552d9d[_0xa55d('0x32')]){var _0x455c67=[];_0x552d9d[_0xa55d('0x4b')](function(_0x1f88e4){_0x455c67['push'](_0x1f88e4['update']({'exitAt':moment()[_0xa55d('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa55d('0x4c')](_0x455c67);}}})[_0xa55d('0x25')](function(_0x3ec77c){if(_0x53c5d7){var _0x4948d2=[];var _0x36192a=[];var _0x486601=utils['getChannels']();var _0x2d9104={'membername':_0x53c5d7[_0xa55d('0x2c')],'interface':_0x11d8e0,'enterAt':moment()[_0xa55d('0x33')](_0xa55d('0x38')),'role':_0x53c5d7[_0xa55d('0x2d')],'internal':_0x53c5d7['internal']};_0x486601[_0xa55d('0x4b')](function(_0x29cbbc){_0x4948d2[_0xa55d('0x36')](_['merge']({'channel':_0x29cbbc,'type':_0xa55d('0x56'),'data1':'callysquare','data2':_0x11d8e0},_0x2d9104));if(_0x53c5d7[_0xa55d('0x4f')]){_0x36192a[_0xa55d('0x36')](_[_0xa55d('0x57')]({'channel':_0x29cbbc,'type':_0xa55d('0x31'),'data1':_0xa55d('0x58')},_0x2d9104));}});return db['MemberReport'][_0xa55d('0x3c')](_0x4948d2[_0xa55d('0x59')](_0x36192a),{'individualHooks':!![]});}})['then'](function(){if(_0x53c5d7){return _0x53c5d7[_0xa55d('0x3d')]({'online':!![],'lastLoginAt':moment()[_0xa55d('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x53c5d7['loginInPause']||![],'mailPause':_0x53c5d7[_0xa55d('0x4f')]||![],'chatPause':_0x53c5d7[_0xa55d('0x4f')]||![],'faxPause':_0x53c5d7[_0xa55d('0x4f')]||![],'smsPause':_0x53c5d7[_0xa55d('0x4f')]||![],'openchannelPause':_0x53c5d7[_0xa55d('0x4f')]||![],'pauseType':_0x53c5d7['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xa55d('0x33')](_0xa55d('0x38')),'interface':_0x11d8e0});}})[_0xa55d('0x25')](function(_0x54db46){_0xefdd9e(_0x54db46);})[_0xa55d('0x1c')](function(_0x57fc91){_0x21e6be(_0x5164fa['error'](0x1f4,_0x57fc91[_0xa55d('0x1b')]));});});}; \ No newline at end of file +var _0x038c=['LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','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','GetUser','User','options','raw','attributes','limit','include','map','model','debug','catch','ShowUser','find','where','name','role','internal','interface','update','MemberReport','findAll','PAUSE','getChannels','forEach','push','isNil','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','body','type','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','findOne','destroy','length','all'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x038c,0x19e));var _0xc038=function(_0x2732ab,_0x53ffd5){_0x2732ab=_0x2732ab-0x0;var _0x42f6cf=_0x038c[_0x2732ab];return _0x42f6cf;};'use strict';var _=require(_0xc038('0x0'));var util=require(_0xc038('0x1'));var moment=require(_0xc038('0x2'));var BPromise=require(_0xc038('0x3'));var rs=require(_0xc038('0x4'));var fs=require('fs');var Redis=require(_0xc038('0x5'));var db=require(_0xc038('0x6'))['db'];var utils=require(_0xc038('0x7'));var logger=require(_0xc038('0x8'))(_0xc038('0x9'));var config=require(_0xc038('0xa'));var jayson=require(_0xc038('0xb'));var client=jayson[_0xc038('0xc')][_0xc038('0xd')]({'port':0x232a});config[_0xc038('0xe')]=_[_0xc038('0xf')](config['redis'],{'host':_0xc038('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc038('0x11'))[_0xc038('0x12')](socket);function respondWithRpcPromise(_0xd9ba19,_0x2755f1,_0x4a5ad9){return new BPromise(function(_0x50f61e,_0x189245){return client[_0xc038('0x13')](_0xd9ba19,_0x4a5ad9)[_0xc038('0x14')](function(_0x4c10a5){logger[_0xc038('0x15')]('User,\x20%s,\x20%s',_0x2755f1,_0xc038('0x16'));logger['debug'](_0xc038('0x17'),_0x2755f1,_0xc038('0x16'),JSON[_0xc038('0x18')](_0x4c10a5));if(_0x4c10a5[_0xc038('0x19')]){if(_0x4c10a5[_0xc038('0x19')][_0xc038('0x1a')]===0x1f4){logger[_0xc038('0x19')](_0xc038('0x1b'),_0x2755f1,_0x4c10a5[_0xc038('0x19')][_0xc038('0x1c')]);return _0x189245(_0x4c10a5[_0xc038('0x19')]['message']);}logger['error'](_0xc038('0x1b'),_0x2755f1,_0x4c10a5['error'][_0xc038('0x1c')]);return _0x50f61e(_0x4c10a5[_0xc038('0x19')][_0xc038('0x1c')]);}else{logger[_0xc038('0x15')](_0xc038('0x1b'),_0x2755f1,_0xc038('0x16'));_0x50f61e(_0x4c10a5[_0xc038('0x1d')][_0xc038('0x1c')]);}})['catch'](function(_0x3909b3){logger['error'](_0xc038('0x1b'),_0x2755f1,_0x3909b3);_0x189245(_0x3909b3);});});}exports[_0xc038('0x1e')]=function(_0x3378cf){var _0x278df9=this;return new Promise(function(_0x20a5ea,_0x3cd28c){return db[_0xc038('0x1f')]['findAll']({'raw':_0x3378cf['options']?_0x3378cf[_0xc038('0x20')][_0xc038('0x21')]===undefined?!![]:![]:!![],'where':_0x3378cf[_0xc038('0x20')]?_0x3378cf[_0xc038('0x20')]['where']||null:null,'attributes':_0x3378cf[_0xc038('0x20')]?_0x3378cf['options'][_0xc038('0x22')]||null:null,'limit':_0x3378cf[_0xc038('0x20')]?_0x3378cf[_0xc038('0x20')][_0xc038('0x23')]||null:null,'include':_0x3378cf[_0xc038('0x20')]?_0x3378cf[_0xc038('0x20')][_0xc038('0x24')]?_[_0xc038('0x25')](_0x3378cf[_0xc038('0x20')][_0xc038('0x24')],function(_0xce4291){return{'model':db[_0xce4291[_0xc038('0x26')]],'as':_0xce4291['as'],'attributes':_0xce4291[_0xc038('0x22')],'include':_0xce4291[_0xc038('0x24')]?_[_0xc038('0x25')](_0xce4291[_0xc038('0x24')],function(_0x4fb603){return{'model':db[_0x4fb603[_0xc038('0x26')]],'as':_0x4fb603['as'],'attributes':_0x4fb603['attributes'],'include':_0x4fb603[_0xc038('0x24')]?_[_0xc038('0x25')](_0x4fb603[_0xc038('0x24')],function(_0x138cf0){return{'model':db[_0x138cf0[_0xc038('0x26')]],'as':_0x138cf0['as'],'attributes':_0x138cf0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc038('0x14')](function(_0xcdedfb){logger[_0xc038('0x15')](_0xc038('0x1e'),_0x3378cf);logger[_0xc038('0x27')]('GetUser',_0x3378cf,JSON['stringify'](_0xcdedfb));_0x20a5ea(_0xcdedfb);})[_0xc038('0x28')](function(_0x6a51ab){logger['error'](_0xc038('0x1e'),_0x6a51ab[_0xc038('0x1c')],_0x3378cf);_0x3cd28c(_0x278df9[_0xc038('0x19')](0x1f4,_0x6a51ab[_0xc038('0x1c')]));});});};exports[_0xc038('0x29')]=function(_0x2a9e77){var _0x370e6c=this;return new Promise(function(_0x53a46c,_0x4a4328){return db[_0xc038('0x1f')][_0xc038('0x2a')]({'raw':_0x2a9e77[_0xc038('0x20')]?_0x2a9e77[_0xc038('0x20')][_0xc038('0x21')]===undefined?!![]:![]:!![],'where':_0x2a9e77['options']?_0x2a9e77[_0xc038('0x20')][_0xc038('0x2b')]||null:null,'attributes':_0x2a9e77[_0xc038('0x20')]?_0x2a9e77['options'][_0xc038('0x22')]||null:null,'include':_0x2a9e77[_0xc038('0x20')]?_0x2a9e77[_0xc038('0x20')]['include']?_['map'](_0x2a9e77['options']['include'],function(_0x19bf5d){return{'model':db[_0x19bf5d[_0xc038('0x26')]],'as':_0x19bf5d['as'],'attributes':_0x19bf5d[_0xc038('0x22')],'include':_0x19bf5d[_0xc038('0x24')]?_[_0xc038('0x25')](_0x19bf5d[_0xc038('0x24')],function(_0x3ea4bc){return{'model':db[_0x3ea4bc[_0xc038('0x26')]],'as':_0x3ea4bc['as'],'attributes':_0x3ea4bc[_0xc038('0x22')],'include':_0x3ea4bc[_0xc038('0x24')]?_[_0xc038('0x25')](_0x3ea4bc['include'],function(_0x28a075){return{'model':db[_0x28a075[_0xc038('0x26')]],'as':_0x28a075['as'],'attributes':_0x28a075['attributes']};}):[]};}):[]};}):[]:[]})[_0xc038('0x14')](function(_0x2d6c53){logger['info'](_0xc038('0x29'),_0x2a9e77);logger[_0xc038('0x27')](_0xc038('0x29'),_0x2a9e77,JSON[_0xc038('0x18')](_0x2d6c53));_0x53a46c(_0x2d6c53);})['catch'](function(_0x1ef839){logger[_0xc038('0x19')]('ShowUser',_0x1ef839[_0xc038('0x1c')],_0x2a9e77);_0x4a4328(_0x370e6c[_0xc038('0x19')](0x1f4,_0x1ef839[_0xc038('0x1c')]));});});};exports['PauseUser']=function(_0x3cd25d){var _0x36b8cc=this;return new Promise(function(_0x33c984,_0x5c716e){var _0x40f0b4;return db[_0xc038('0x1f')][_0xc038('0x2a')]({'where':_0x3cd25d[_0xc038('0x20')][_0xc038('0x2b')]||{},'attributes':['id',_0xc038('0x2c'),_0xc038('0x2d'),_0xc038('0x2e'),_0xc038('0x2f')]})['then'](function(_0x41b762){if(_0x41b762){_0x40f0b4=_0x41b762;return db['UserVoiceQueueRt'][_0xc038('0x30')]({'paused':0x1},{'where':{'UserId':_0x40f0b4['id']},'individualHooks':!![]});}})['then'](function(){if(_0x40f0b4){return db[_0xc038('0x31')][_0xc038('0x32')]({'where':{'membername':_0x40f0b4[_0xc038('0x2c')],'type':_0xc038('0x33'),'exitAt':null}});}})[_0xc038('0x14')](function(_0xa986d6){if(_0x40f0b4){if(_0xa986d6&&_0xa986d6['length']){var _0x3c2514=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5285f4=0x0,_0x4e16ab=_0xa986d6['length'];_0x5285f4<_0x4e16ab;_0x5285f4++){_0xa986d6[_0x5285f4]['updateAttributes']({'exitAt':_0x3c2514});}}}})[_0xc038('0x14')](function(){if(_0x40f0b4){var _0x36daac=[];var _0xfb8622=utils[_0xc038('0x34')]();_0xfb8622[_0xc038('0x35')](function(_0x42a2b2){_0x36daac[_0xc038('0x36')]({'channel':_0x42a2b2,'membername':_0x40f0b4['name'],'interface':_[_0xc038('0x37')](_0x40f0b4[_0xc038('0x2f')])?util['format'](_0xc038('0x38'),_0x40f0b4[_0xc038('0x2c')]):_0x40f0b4[_0xc038('0x2f')],'type':_0xc038('0x33'),'enterAt':moment()[_0xc038('0x39')](_0xc038('0x3a')),'data1':_0x3cd25d[_0xc038('0x3b')][_0xc038('0x3c')]||'DEFAULT\x20PAUSE','role':_0x40f0b4[_0xc038('0x2d')],'internal':_0x40f0b4[_0xc038('0x2e')],'uniqueid':_0x3cd25d[_0xc038('0x3b')]['uniqueid']||null});});return db[_0xc038('0x31')][_0xc038('0x3d')](_0x36daac,{'individualHooks':!![]});}})[_0xc038('0x14')](function(){if(_0x40f0b4){return _0x40f0b4['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3cd25d[_0xc038('0x3b')][_0xc038('0x3c')]||_0xc038('0x3e'),'lastPauseAt':moment()['format'](_0xc038('0x3a'))});}})[_0xc038('0x14')](function(_0xd8d2ea){_0x33c984(_0xd8d2ea);})[_0xc038('0x28')](function(_0x39e983){_0x5c716e(_0x36b8cc[_0xc038('0x19')](0x1f4,_0x39e983[_0xc038('0x1c')]));});});};exports[_0xc038('0x3f')]=function(_0x6faca3){var _0x26f3ce=this;return new Promise(function(_0x49b4db,_0x2a83f9){var _0x284107;return db[_0xc038('0x1f')]['findOne']({'where':_0x6faca3[_0xc038('0x20')][_0xc038('0x2b')]||{},'attributes':['id',_0xc038('0x2c')]})[_0xc038('0x14')](function(_0x534c85){if(_0x534c85){_0x284107=_0x534c85;if(_0x6faca3[_0xc038('0x3b')][_0xc038('0x40')]&&!utils[_0xc038('0x41')](_0x6faca3[_0xc038('0x3b')][_0xc038('0x40')])){throw new Error(_0xc038('0x42'));}switch(_0x6faca3[_0xc038('0x3b')][_0xc038('0x40')]){case _0xc038('0x43'):return db['UserVoiceQueueRt'][_0xc038('0x30')]({'paused':0x0},{'where':{'UserId':_0x284107['id']}})[_0xc038('0x14')](function(){return db[_0xc038('0x31')][_0xc038('0x2a')]({'where':{'channel':_0x6faca3[_0xc038('0x3b')][_0xc038('0x40')],'membername':_0x284107[_0xc038('0x2c')],'type':_0xc038('0x33'),'exitAt':null}});})[_0xc038('0x14')](function(_0x317314){if(_0x317314){return _0x317314['update']({'exitAt':moment()[_0xc038('0x39')](_0xc038('0x3a')),'data2':_0xc038('0x44')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x284107[_0xc038('0x30')]({'voicePause':![]});});case _0xc038('0x45'):case _0xc038('0x46'):case _0xc038('0x47'):case _0xc038('0x48'):case _0xc038('0x49'):case _0xc038('0x4a'):return db[_0xc038('0x31')][_0xc038('0x2a')]({'where':{'channel':_0x6faca3['body']['channel'],'membername':_0x284107[_0xc038('0x2c')],'type':_0xc038('0x33'),'exitAt':null}})[_0xc038('0x14')](function(_0xe41bd2){return _0xe41bd2[_0xc038('0x30')]({'exitAt':moment()[_0xc038('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});})[_0xc038('0x14')](function(){var _0x158a39={};_[_0xc038('0x4b')](_0x158a39,util[_0xc038('0x39')](_0xc038('0x4c'),_0x6faca3['body'][_0xc038('0x40')],'Pause'),![]);return _0x284107[_0xc038('0x30')](_0x158a39);});default:return db['UserVoiceQueueRt'][_0xc038('0x30')]({'paused':0x0},{'where':{'UserId':_0x284107['id']}})['then'](function(){return db[_0xc038('0x31')][_0xc038('0x32')]({'where':{'membername':_0x284107['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x1f4473){var _0x151f36=[];_0x1f4473[_0xc038('0x35')](function(_0x9a4cd7){_0x151f36[_0xc038('0x36')](_0x9a4cd7[_0xc038('0x30')]({'exitAt':moment()['format'](_0xc038('0x3a')),'data2':_0xc038('0x44')}));});return BPromise['all'](_0x151f36);})[_0xc038('0x14')](function(){return _0x284107[_0xc038('0x30')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xc038('0x14')](function(_0x28857a){_0x49b4db(_0x28857a);})[_0xc038('0x28')](function(_0x19bea6){_0x2a83f9(_0x26f3ce['error'](0x1f4,_0x19bea6[_0xc038('0x1c')]));});});};exports['LogoutUser']=function(_0x2dd6da){var _0x272fed=this;return new Promise(function(_0x45ec19,_0x32a2e0){var _0x49f8a2;return db[_0xc038('0x1f')][_0xc038('0x4d')]({'where':_0x2dd6da['options'][_0xc038('0x2b')]||{},'attributes':['id',_0xc038('0x2c')]})[_0xc038('0x14')](function(_0xb3dbda){if(_0xb3dbda){_0x49f8a2=_0xb3dbda;return db['UserVoiceQueueRt'][_0xc038('0x4e')]({'where':{'membername':_0x49f8a2[_0xc038('0x2c')]},'individualHooks':!![]});}})[_0xc038('0x14')](function(){if(_0x49f8a2){return db['MemberReport'][_0xc038('0x32')]({'where':{'membername':_0x49f8a2['name'],'exitAt':null}});}})[_0xc038('0x14')](function(_0xc6e298){if(_0x49f8a2){if(_0xc6e298&&_0xc6e298[_0xc038('0x4f')]){var _0x60e26f=[];_0xc6e298[_0xc038('0x35')](function(_0x5105f9){_0x60e26f['push'](_0x5105f9[_0xc038('0x30')]({'exitAt':moment()[_0xc038('0x39')](_0xc038('0x3a'))}));});return BPromise[_0xc038('0x50')](_0x60e26f);}}})['then'](function(){if(_0x49f8a2){return _0x49f8a2[_0xc038('0x30')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0xd25ed1){_0x45ec19(_0xd25ed1);})[_0xc038('0x28')](function(_0x4b6fd3){_0x32a2e0(_0x272fed['error'](0x1f4,_0x4b6fd3[_0xc038('0x1c')]));});});};exports[_0xc038('0x51')]=function(_0x41a3c4){var _0x9098ca=this;return new Promise(function(_0x10a009,_0x54cb25){var _0x25b956;var _0x3bad4b;var _0x301c74;var _0x48281c;return db[_0xc038('0x1f')]['findOne']({'where':_0x41a3c4[_0xc038('0x20')]['where']||{},'attributes':['id',_0xc038('0x2c'),'role',_0xc038('0x52'),_0xc038('0x53'),_0xc038('0x2e'),_0xc038('0x54'),_0xc038('0x2f')]})[_0xc038('0x14')](function(_0x4c96ad){if(_0x4c96ad){_0x25b956=_0x4c96ad;_0x48281c=_0x41a3c4[_0xc038('0x3b')][_0xc038('0x2f')]?_0x41a3c4['body'][_0xc038('0x2f')]:util[_0xc038('0x39')](_0xc038('0x38'),_0x25b956[_0xc038('0x2c')]);return db[_0xc038('0x1f')][_0xc038('0x55')]({'where':{'role':_0xc038('0x56'),'online':!![],'id':{'$ne':_0x25b956['id']}}});}})[_0xc038('0x14')](function(_0x37cf24){if(_0x37cf24){_0x301c74=_0x37cf24;return require(_0xc038('0x57'))[_0xc038('0x58')]();}})[_0xc038('0x14')](function(_0x5641b7){if(_0x5641b7&&_0x5641b7['agents']&&_0x301c74>=_0x5641b7[_0xc038('0x59')]){throw new Error(_0xc038('0x5a'));}})[_0xc038('0x14')](function(){if(_0x25b956){return db[_0xc038('0x5b')]['destroy']({'where':{'membername':_0x25b956['name']},'individualHooks':!![]});}})[_0xc038('0x14')](function(){if(_0x25b956){return _0x25b956[_0xc038('0x5c')]({'raw':!![]});}})[_0xc038('0x14')](function(_0xe77eb8){if(_0x25b956){if(_0xe77eb8){var _0x4de1bd=[];_0x3bad4b=_0xe77eb8;if(_0x3bad4b[_0xc038('0x4f')]){for(var _0x2fb596=0x0;_0x2fb596<_0x3bad4b[_0xc038('0x4f')];_0x2fb596++){_0x4de1bd['push'](db[_0xc038('0x5b')][_0xc038('0x5d')]({'membername':_0x25b956[_0xc038('0x2c')],'UserId':_0x25b956['id'],'queue_name':_0x3bad4b[_0x2fb596][_0xc038('0x2c')],'VoiceQueueId':_0x3bad4b[_0x2fb596]['id'],'interface':_0x48281c,'paused':_0x25b956[_0xc038('0x54')]||![],'penalty':_0x3bad4b[_0x2fb596]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x4de1bd);}}}})[_0xc038('0x14')](function(){if(_0x25b956){return db['MemberReport'][_0xc038('0x32')]({'where':{'membername':_0x25b956[_0xc038('0x2c')],'exitAt':null}});}})[_0xc038('0x14')](function(_0x15cad5){if(_0x25b956){if(_0x15cad5&&_0x15cad5['length']){var _0x2c11ef=[];_0x15cad5['forEach'](function(_0x47d9c8){_0x2c11ef[_0xc038('0x36')](_0x47d9c8[_0xc038('0x30')]({'exitAt':moment()[_0xc038('0x39')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc038('0x50')](_0x2c11ef);}}})[_0xc038('0x14')](function(_0x274e01){if(_0x25b956){var _0x28880b=[];var _0x29e468=[];var _0xf59fe5=utils[_0xc038('0x34')]();var _0x2fec5={'membername':_0x25b956['name'],'interface':_0x48281c,'enterAt':moment()[_0xc038('0x39')](_0xc038('0x3a')),'role':_0x25b956[_0xc038('0x2d')],'internal':_0x25b956[_0xc038('0x2e')]};_0xf59fe5[_0xc038('0x35')](function(_0x47a4f4){_0x28880b[_0xc038('0x36')](_[_0xc038('0x5e')]({'channel':_0x47a4f4,'type':_0xc038('0x5f'),'data1':_0xc038('0x60'),'data2':_0x48281c},_0x2fec5));if(_0x25b956[_0xc038('0x54')]){_0x29e468[_0xc038('0x36')](_[_0xc038('0x5e')]({'channel':_0x47a4f4,'type':_0xc038('0x33'),'data1':_0xc038('0x61')},_0x2fec5));}});return db[_0xc038('0x31')][_0xc038('0x3d')](_0x28880b[_0xc038('0x62')](_0x29e468),{'individualHooks':!![]});}})[_0xc038('0x14')](function(){if(_0x25b956){return _0x25b956['update']({'online':!![],'lastLoginAt':moment()[_0xc038('0x39')](_0xc038('0x3a')),'voicePause':_0x25b956['loginInPause']||![],'mailPause':_0x25b956['loginInPause']||![],'chatPause':_0x25b956[_0xc038('0x54')]||![],'faxPause':_0x25b956['loginInPause']||![],'smsPause':_0x25b956[_0xc038('0x54')]||![],'openchannelPause':_0x25b956[_0xc038('0x54')]||![],'pauseType':_0x25b956[_0xc038('0x54')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xc038('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x48281c});}})[_0xc038('0x14')](function(_0x227878){_0x10a009(_0x227878);})[_0xc038('0x28')](function(_0x112621){_0x54cb25(_0x9098ca[_0xc038('0x19')](0x1f4,_0x112621[_0xc038('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index bc422cc..ddebc21 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 _0x92e0=['emit','removeListener','user:','./user.events','save','remove'];(function(_0x2aa3ed,_0x21bb61){var _0x4e0881=function(_0x581164){while(--_0x581164){_0x2aa3ed['push'](_0x2aa3ed['shift']());}};_0x4e0881(++_0x21bb61);}(_0x92e0,0x81));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x092e('0x0'));var events=[_0x092e('0x1'),_0x092e('0x2'),'update'];function createListener(_0x447d4b,_0x5ad9d4){return function(_0x5d55e6){_0x5ad9d4[_0x092e('0x3')](_0x447d4b,_0x5d55e6);};}function removeListener(_0x3dd949,_0x5a985b){return function(){UserEvents[_0x092e('0x4')](_0x3dd949,_0x5a985b);};}exports['register']=function(_0x575c20){for(var _0x1ebb03=0x0,_0x489422=events['length'];_0x1ebb03<_0x489422;_0x1ebb03++){var _0x5eff61=events[_0x1ebb03];var _0x43f3d7=createListener(_0x092e('0x5')+_0x5eff61,_0x575c20);UserEvents['on'](_0x5eff61,_0x43f3d7);}}; \ No newline at end of file +var _0x70de=['emit','removeListener','register','length','./user.events','remove','update'];(function(_0x2c7243,_0xd666e2){var _0x40f4a8=function(_0x228b8a){while(--_0x228b8a){_0x2c7243['push'](_0x2c7243['shift']());}};_0x40f4a8(++_0xd666e2);}(_0x70de,0x1d9));var _0xe70d=function(_0x1d291d,_0x17314a){_0x1d291d=_0x1d291d-0x0;var _0x44cc4e=_0x70de[_0x1d291d];return _0x44cc4e;};'use strict';var UserEvents=require(_0xe70d('0x0'));var events=['save',_0xe70d('0x1'),_0xe70d('0x2')];function createListener(_0x1667e5,_0xa6534c){return function(_0x576b3e){_0xa6534c[_0xe70d('0x3')](_0x1667e5,_0x576b3e);};}function removeListener(_0xcd46e5,_0x5857e9){return function(){UserEvents[_0xe70d('0x4')](_0xcd46e5,_0x5857e9);};}exports[_0xe70d('0x5')]=function(_0xfbdada){for(var _0x2afe6e=0x0,_0x2d727c=events[_0xe70d('0x6')];_0x2afe6e<_0x2d727c;_0x2afe6e++){var _0xf57904=events[_0x2afe6e];var _0x2d4f86=createListener('user:'+_0xf57904,_0xfbdada);UserEvents['on'](_0xf57904,_0x2d4f86);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 1242211..cb606c9 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5770cf,_0x48563e){var _0x2b6cdc=function(_0x3368ee){while(--_0x3368ee){_0x5770cf['push'](_0x5770cf['shift']());}};_0x2b6cdc(++_0x48563e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index fde8f12..82d2ffb 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 _0x1618=['INTEGER','sequelize','exports'];(function(_0x2760e1,_0x5b60a5){var _0x2151ca=function(_0x23b4db){while(--_0x23b4db){_0x2760e1['push'](_0x2760e1['shift']());}};_0x2151ca(++_0x5b60a5);}(_0x1618,0x7f));var _0x8161=function(_0x49c5b7,_0x26d3b1){_0x49c5b7=_0x49c5b7-0x0;var _0x2b35d7=_0x1618[_0x49c5b7];return _0x2b35d7;};'use strict';var Sequelize=require(_0x8161('0x0'));module[_0x8161('0x1')]={'penalty':{'type':Sequelize[_0x8161('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd4c6=['INTEGER','sequelize','exports'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xd4c6,0x85));var _0x6d4c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd4c6[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6d4c('0x0'));module[_0x6d4c('0x1')]={'penalty':{'type':Sequelize[_0x6d4c('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 f740074..69436db 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 _0xb513=['./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','moment','request-promise','path','../../config/environment'];(function(_0x572264,_0x1d4a78){var _0x10aa87=function(_0x346945){while(--_0x346945){_0x572264['push'](_0x572264['shift']());}};_0x10aa87(++_0x1d4a78);}(_0xb513,0x139));var _0x3b51=function(_0x4efd3d,_0x2b9694){_0x4efd3d=_0x4efd3d-0x0;var _0x1293f2=_0xb513[_0x4efd3d];return _0x1293f2;};'use strict';var _=require(_0x3b51('0x0'));var util=require(_0x3b51('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3b51('0x2'));var BPromise=require('bluebird');var rp=require(_0x3b51('0x3'));var fs=require('fs');var path=require(_0x3b51('0x4'));var rimraf=require('rimraf');var config=require(_0x3b51('0x5'));var attributes=require(_0x3b51('0x6'));module[_0x3b51('0x7')]=function(_0x309db5,_0x2e29ec){return _0x309db5[_0x3b51('0x8')](_0x3b51('0x9'),attributes,{'tableName':_0x3b51('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd639=['request-promise','path','rimraf','../../config/environment','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x4d5648,_0x1bf525){var _0xa659a=function(_0x3194d0){while(--_0x3194d0){_0x4d5648['push'](_0x4d5648['shift']());}};_0xa659a(++_0x1bf525);}(_0xd639,0x127));var _0x9d63=function(_0x3afd15,_0x481f3d){_0x3afd15=_0x3afd15-0x0;var _0x31b3b8=_0xd639[_0x3afd15];return _0x31b3b8;};'use strict';var _=require('lodash');var util=require(_0x9d63('0x0'));var logger=require(_0x9d63('0x1'))(_0x9d63('0x2'));var moment=require(_0x9d63('0x3'));var BPromise=require(_0x9d63('0x4'));var rp=require(_0x9d63('0x5'));var fs=require('fs');var path=require(_0x9d63('0x6'));var rimraf=require(_0x9d63('0x7'));var config=require(_0x9d63('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x9d63('0x9')]=function(_0x5533de,_0x4e203c){return _0x5533de['define'](_0x9d63('0xa'),attributes,{'tableName':_0x9d63('0xb'),'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 b0a13ab..81be99b 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 _0x0392=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x0392,0x198));var _0x2039=function(_0x1c05c0,_0x38e872){_0x1c05c0=_0x1c05c0-0x0;var _0x4b8d87=_0x0392[_0x1c05c0];return _0x4b8d87;};'use strict';var _=require(_0x2039('0x0'));var util=require(_0x2039('0x1'));var moment=require(_0x2039('0x2'));var BPromise=require(_0x2039('0x3'));var rs=require(_0x2039('0x4'));var fs=require('fs');var Redis=require(_0x2039('0x5'));var db=require(_0x2039('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2039('0x7'))(_0x2039('0x8'));var config=require(_0x2039('0x9'));var jayson=require(_0x2039('0xa'));var client=jayson[_0x2039('0xb')][_0x2039('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46e37f,_0x53ee7f,_0x442e09){return new BPromise(function(_0x1a1287,_0x286cf2){return client[_0x2039('0xd')](_0x46e37f,_0x442e09)[_0x2039('0xe')](function(_0x3ad04e){logger[_0x2039('0xf')](_0x2039('0x10'),_0x53ee7f,'request\x20sent');logger[_0x2039('0x11')](_0x2039('0x12'),_0x53ee7f,_0x2039('0x13'),JSON[_0x2039('0x14')](_0x3ad04e));if(_0x3ad04e[_0x2039('0x15')]){if(_0x3ad04e[_0x2039('0x15')][_0x2039('0x16')]===0x1f4){logger[_0x2039('0x15')](_0x2039('0x10'),_0x53ee7f,_0x3ad04e['error'][_0x2039('0x17')]);return _0x286cf2(_0x3ad04e[_0x2039('0x15')][_0x2039('0x17')]);}logger[_0x2039('0x15')](_0x2039('0x10'),_0x53ee7f,_0x3ad04e['error'][_0x2039('0x17')]);return _0x1a1287(_0x3ad04e[_0x2039('0x15')][_0x2039('0x17')]);}else{logger[_0x2039('0xf')](_0x2039('0x10'),_0x53ee7f,_0x2039('0x13'));_0x1a1287(_0x3ad04e[_0x2039('0x18')][_0x2039('0x17')]);}})[_0x2039('0x19')](function(_0x5d6a8b){logger['error'](_0x2039('0x10'),_0x53ee7f,_0x5d6a8b);_0x286cf2(_0x5d6a8b);});});} \ No newline at end of file +var _0x8138=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x264302,_0xa3ec2){var _0x2da967=function(_0x11fd9e){while(--_0x11fd9e){_0x264302['push'](_0x264302['shift']());}};_0x2da967(++_0xa3ec2);}(_0x8138,0x8c));var _0x8813=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x8138[_0x4907de];return _0x482054;};'use strict';var _=require(_0x8813('0x0'));var util=require(_0x8813('0x1'));var moment=require(_0x8813('0x2'));var BPromise=require(_0x8813('0x3'));var rs=require(_0x8813('0x4'));var fs=require('fs');var Redis=require(_0x8813('0x5'));var db=require(_0x8813('0x6'))['db'];var utils=require(_0x8813('0x7'));var logger=require('../../config/logger')(_0x8813('0x8'));var config=require(_0x8813('0x9'));var jayson=require(_0x8813('0xa'));var client=jayson['client'][_0x8813('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57af3e,_0x22fc38,_0x111e56){return new BPromise(function(_0x2cd9c9,_0x38673c){return client[_0x8813('0xc')](_0x57af3e,_0x111e56)[_0x8813('0xd')](function(_0x4cbf02){logger[_0x8813('0xe')](_0x8813('0xf'),_0x22fc38,_0x8813('0x10'));logger[_0x8813('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x22fc38,_0x8813('0x10'),JSON[_0x8813('0x12')](_0x4cbf02));if(_0x4cbf02[_0x8813('0x13')]){if(_0x4cbf02[_0x8813('0x13')][_0x8813('0x14')]===0x1f4){logger[_0x8813('0x13')](_0x8813('0xf'),_0x22fc38,_0x4cbf02[_0x8813('0x13')][_0x8813('0x15')]);return _0x38673c(_0x4cbf02[_0x8813('0x13')][_0x8813('0x15')]);}logger['error'](_0x8813('0xf'),_0x22fc38,_0x4cbf02['error'][_0x8813('0x15')]);return _0x2cd9c9(_0x4cbf02['error'][_0x8813('0x15')]);}else{logger[_0x8813('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x22fc38,'request\x20sent');_0x2cd9c9(_0x4cbf02[_0x8813('0x16')][_0x8813('0x15')]);}})[_0x8813('0x17')](function(_0x5d7b0d){logger[_0x8813('0x13')](_0x8813('0xf'),_0x22fc38,_0x5d7b0d);_0x38673c(_0x5d7b0d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 53a9942..cba1461 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bfca7,_0x189098){var _0x4641fd=function(_0x23b55b){while(--_0x23b55b){_0x3bfca7['push'](_0x3bfca7['shift']());}};_0x4641fd(++_0x189098);}(_0xe706,0xa3));var _0x6e70=function(_0x51cf44,_0x2b04e1){_0x51cf44=_0x51cf44-0x0;var _0xb4dbd6=_0xe706[_0x51cf44];return _0xb4dbd6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x36fabd,_0x4b2de8){var _0x47f56e=function(_0x41d5f8){while(--_0x41d5f8){_0x36fabd['push'](_0x36fabd['shift']());}};_0x47f56e(++_0x4b2de8);}(_0xe706,0xa3));var _0x6e70=function(_0xe2cbd3,_0x678694){_0xe2cbd3=_0xe2cbd3-0x0;var _0x5155e3=_0xe706[_0xe2cbd3];return _0x5155e3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index dc03e95..89d2472 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 _0xb9f2=['INTEGER','exports'];(function(_0x38a122,_0x3dfe36){var _0xd9d833=function(_0x177923){while(--_0x177923){_0x38a122['push'](_0x38a122['shift']());}};_0xd9d833(++_0x3dfe36);}(_0xb9f2,0xed));var _0x2b9f=function(_0x3c0322,_0xd4d908){_0x3c0322=_0x3c0322-0x0;var _0x3eae92=_0xb9f2[_0x3c0322];return _0x3eae92;};'use strict';var Sequelize=require('sequelize');module[_0x2b9f('0x0')]={'penalty':{'type':Sequelize[_0x2b9f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2b9f('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1119=['exports','INTEGER','STRING','sequelize'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x1119,0x1cb));var _0x9111=function(_0x305551,_0x868339){_0x305551=_0x305551-0x0;var _0x115ce2=_0x1119[_0x305551];return _0x115ce2;};'use strict';var Sequelize=require(_0x9111('0x0'));module[_0x9111('0x1')]={'penalty':{'type':Sequelize[_0x9111('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9111('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 86cd4af..a2fc894 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 _0x9d26=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x292a32,_0x27e2a1){var _0x541f81=function(_0x544b54){while(--_0x544b54){_0x292a32['push'](_0x292a32['shift']());}};_0x541f81(++_0x27e2a1);}(_0x9d26,0xdc));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x69d2('0x0'));var util=require('util');var logger=require(_0x69d2('0x1'))(_0x69d2('0x2'));var moment=require(_0x69d2('0x3'));var BPromise=require(_0x69d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x69d2('0x5'));var rimraf=require(_0x69d2('0x6'));var config=require(_0x69d2('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0x69d2('0x8')]=function(_0xb9decb,_0x5a5fef){return _0xb9decb[_0x69d2('0x9')](_0x69d2('0xa'),attributes,{'tableName':_0x69d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf15e=['bluebird','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment'];(function(_0x4650f5,_0x4a2322){var _0x5cbc5d=function(_0x3bf8d4){while(--_0x3bf8d4){_0x4650f5['push'](_0x4650f5['shift']());}};_0x5cbc5d(++_0x4a2322);}(_0xf15e,0x128));var _0xef15=function(_0x52d8cd,_0x170f4c){_0x52d8cd=_0x52d8cd-0x0;var _0x475d12=_0xf15e[_0x52d8cd];return _0x475d12;};'use strict';var _=require(_0xef15('0x0'));var util=require(_0xef15('0x1'));var logger=require(_0xef15('0x2'))('api');var moment=require(_0xef15('0x3'));var BPromise=require(_0xef15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef15('0x5'));var attributes=require(_0xef15('0x6'));module['exports']=function(_0x6d7f26,_0x3c4208){return _0x6d7f26[_0xef15('0x7')](_0xef15('0x8'),attributes,{'tableName':_0xef15('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 4044450..7a7dd10 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 _0xb0a4=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x4744aa,_0x17b548){var _0x13c713=function(_0x187399){while(--_0x187399){_0x4744aa['push'](_0x4744aa['shift']());}};_0x13c713(++_0x17b548);}(_0xb0a4,0x131));var _0x4b0a=function(_0x4b94cc,_0x1d1b3f){_0x4b94cc=_0x4b94cc-0x0;var _0x49b82d=_0xb0a4[_0x4b94cc];return _0x49b82d;};'use strict';var _=require(_0x4b0a('0x0'));var util=require(_0x4b0a('0x1'));var moment=require(_0x4b0a('0x2'));var BPromise=require(_0x4b0a('0x3'));var rs=require(_0x4b0a('0x4'));var fs=require('fs');var Redis=require(_0x4b0a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b0a('0x6'))(_0x4b0a('0x7'));var config=require(_0x4b0a('0x8'));var jayson=require(_0x4b0a('0x9'));var client=jayson[_0x4b0a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cafd2,_0xb8764c,_0x152b24){return new BPromise(function(_0x3d7919,_0x5cb92c){return client[_0x4b0a('0xb')](_0x4cafd2,_0x152b24)[_0x4b0a('0xc')](function(_0x2fc07a){logger['info'](_0x4b0a('0xd'),_0xb8764c,_0x4b0a('0xe'));logger['debug'](_0x4b0a('0xf'),_0xb8764c,'request\x20sent',JSON['stringify'](_0x2fc07a));if(_0x2fc07a[_0x4b0a('0x10')]){if(_0x2fc07a[_0x4b0a('0x10')][_0x4b0a('0x11')]===0x1f4){logger[_0x4b0a('0x10')](_0x4b0a('0xd'),_0xb8764c,_0x2fc07a[_0x4b0a('0x10')]['message']);return _0x5cb92c(_0x2fc07a[_0x4b0a('0x10')]['message']);}logger[_0x4b0a('0x10')](_0x4b0a('0xd'),_0xb8764c,_0x2fc07a[_0x4b0a('0x10')]['message']);return _0x3d7919(_0x2fc07a[_0x4b0a('0x10')][_0x4b0a('0x12')]);}else{logger[_0x4b0a('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0xb8764c,_0x4b0a('0xe'));_0x3d7919(_0x2fc07a[_0x4b0a('0x14')]['message']);}})[_0x4b0a('0x15')](function(_0x4e5f35){logger[_0x4b0a('0x10')](_0x4b0a('0xd'),_0xb8764c,_0x4e5f35);_0x5cb92c(_0x4e5f35);});});} \ No newline at end of file +var _0x4a9d=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40bf1f,_0x4fa0b9){var _0x6f9a8f=function(_0x1b860a){while(--_0x1b860a){_0x40bf1f['push'](_0x40bf1f['shift']());}};_0x6f9a8f(++_0x4fa0b9);}(_0x4a9d,0xff));var _0xd4a9=function(_0x50c53c,_0x265fe2){_0x50c53c=_0x50c53c-0x0;var _0x2ddb02=_0x4a9d[_0x50c53c];return _0x2ddb02;};'use strict';var _=require(_0xd4a9('0x0'));var util=require(_0xd4a9('0x1'));var moment=require(_0xd4a9('0x2'));var BPromise=require(_0xd4a9('0x3'));var rs=require(_0xd4a9('0x4'));var fs=require('fs');var Redis=require(_0xd4a9('0x5'));var db=require(_0xd4a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4a9('0x7'))('rpc');var config=require(_0xd4a9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd4a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1da15a,_0x47f51,_0x14068b){return new BPromise(function(_0x3e2853,_0x587f59){return client[_0xd4a9('0xa')](_0x1da15a,_0x14068b)[_0xd4a9('0xb')](function(_0x3a23d7){logger[_0xd4a9('0xc')](_0xd4a9('0xd'),_0x47f51,_0xd4a9('0xe'));logger[_0xd4a9('0xf')](_0xd4a9('0x10'),_0x47f51,_0xd4a9('0xe'),JSON[_0xd4a9('0x11')](_0x3a23d7));if(_0x3a23d7[_0xd4a9('0x12')]){if(_0x3a23d7[_0xd4a9('0x12')][_0xd4a9('0x13')]===0x1f4){logger[_0xd4a9('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x47f51,_0x3a23d7[_0xd4a9('0x12')][_0xd4a9('0x14')]);return _0x587f59(_0x3a23d7[_0xd4a9('0x12')][_0xd4a9('0x14')]);}logger[_0xd4a9('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x47f51,_0x3a23d7[_0xd4a9('0x12')][_0xd4a9('0x14')]);return _0x3e2853(_0x3a23d7[_0xd4a9('0x12')][_0xd4a9('0x14')]);}else{logger[_0xd4a9('0xc')](_0xd4a9('0xd'),_0x47f51,'request\x20sent');_0x3e2853(_0x3a23d7[_0xd4a9('0x15')][_0xd4a9('0x14')]);}})[_0xd4a9('0x16')](function(_0x1e8193){logger[_0xd4a9('0x12')](_0xd4a9('0xd'),_0x47f51,_0x1e8193);_0x587f59(_0x1e8193);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 20ddc71..53d1b4f 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(_0x32a424,_0x25624c){var _0x3ceb2c=function(_0x22a616){while(--_0x22a616){_0x32a424['push'](_0x32a424['shift']());}};_0x3ceb2c(++_0x25624c);}(_0x70e0,0x17b));var _0x070e=function(_0xcbda4b,_0x4a4277){_0xcbda4b=_0xcbda4b-0x0;var _0x133092=_0x70e0[_0xcbda4b];return _0x133092;};'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(_0x5cdae6,_0x50e1fc){var _0x18e71d=function(_0x31948e){while(--_0x31948e){_0x5cdae6['push'](_0x5cdae6['shift']());}};_0x18e71d(++_0x50e1fc);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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 71432a1..1d3aa25 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 _0x9829=['INTEGER','sequelize','exports'];(function(_0x36f308,_0x1c233f){var _0x19c448=function(_0x28d96e){while(--_0x28d96e){_0x36f308['push'](_0x36f308['shift']());}};_0x19c448(++_0x1c233f);}(_0x9829,0xc4));var _0x9982=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9829[_0x2b7764];return _0x848dcb;};'use strict';var Sequelize=require(_0x9982('0x0'));module[_0x9982('0x1')]={'penalty':{'type':Sequelize[_0x9982('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa8f0=['sequelize','exports','INTEGER'];(function(_0x2b4d26,_0x279b45){var _0x1b5a40=function(_0x42837d){while(--_0x42837d){_0x2b4d26['push'](_0x2b4d26['shift']());}};_0x1b5a40(++_0x279b45);}(_0xa8f0,0x123));var _0x0a8f=function(_0x2c90c1,_0x446eda){_0x2c90c1=_0x2c90c1-0x0;var _0xcb55d4=_0xa8f0[_0x2c90c1];return _0xcb55d4;};'use strict';var Sequelize=require(_0x0a8f('0x0'));module[_0x0a8f('0x1')]={'penalty':{'type':Sequelize[_0x0a8f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f6e08c5..6167fd6 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 _0x1db5=['rimraf','./userMailQueue.attributes','exports','define','user_has_mail_queues','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x24aaac,_0x46adfb){var _0x6b27b2=function(_0xae0d3d){while(--_0xae0d3d){_0x24aaac['push'](_0x24aaac['shift']());}};_0x6b27b2(++_0x46adfb);}(_0x1db5,0x165));var _0x51db=function(_0x115a4a,_0x1cd10e){_0x115a4a=_0x115a4a-0x0;var _0x3ea3c3=_0x1db5[_0x115a4a];return _0x3ea3c3;};'use strict';var _=require(_0x51db('0x0'));var util=require(_0x51db('0x1'));var logger=require(_0x51db('0x2'))(_0x51db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x51db('0x4'));var fs=require('fs');var path=require(_0x51db('0x5'));var rimraf=require(_0x51db('0x6'));var config=require('../../config/environment');var attributes=require(_0x51db('0x7'));module[_0x51db('0x8')]=function(_0x4d327c,_0x35e141){return _0x4d327c[_0x51db('0x9')]('UserMailQueue',attributes,{'tableName':_0x51db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x25ff=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./userMailQueue.attributes'];(function(_0x2d50be,_0x4e2d7c){var _0x2d3545=function(_0x51a02c){while(--_0x51a02c){_0x2d50be['push'](_0x2d50be['shift']());}};_0x2d3545(++_0x4e2d7c);}(_0x25ff,0x1e5));var _0xf25f=function(_0x58ab66,_0x323669){_0x58ab66=_0x58ab66-0x0;var _0x1d9b1b=_0x25ff[_0x58ab66];return _0x1d9b1b;};'use strict';var _=require(_0xf25f('0x0'));var util=require(_0xf25f('0x1'));var logger=require(_0xf25f('0x2'))(_0xf25f('0x3'));var moment=require(_0xf25f('0x4'));var BPromise=require(_0xf25f('0x5'));var rp=require(_0xf25f('0x6'));var fs=require('fs');var path=require(_0xf25f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf25f('0x8'));module[_0xf25f('0x9')]=function(_0x4e0b2f,_0x7cc9fd){return _0x4e0b2f[_0xf25f('0xa')](_0xf25f('0xb'),attributes,{'tableName':_0xf25f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 95ee5da..ad37fb4 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 _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4137c8,_0x5edf1c){var _0xa2b619=function(_0x225226){while(--_0x225226){_0x4137c8['push'](_0x4137c8['shift']());}};_0xa2b619(++_0x5edf1c);}(_0x6aa7,0x178));var _0x76aa=function(_0x27f76a,_0x9d84a5){_0x27f76a=_0x27f76a-0x0;var _0x13e7e4=_0x6aa7[_0x27f76a];return _0x13e7e4;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file +var _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x44dbe3,_0x4f625c){var _0xdfe79b=function(_0x4cb13f){while(--_0x4cb13f){_0x44dbe3['push'](_0x44dbe3['shift']());}};_0xdfe79b(++_0x4f625c);}(_0x3e74,0x175));var _0x43e7=function(_0x4790df,_0x48b668){_0x4790df=_0x4790df-0x0;var _0x14e1a4=_0x3e74[_0x4790df];return _0x14e1a4;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 0fab5d0..cc23d63 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 _0xae96=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','sendUserNotification','multer','util','path','connect-timeout','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xae96,0x19d));var _0x6ae9=function(_0x39f7ed,_0x461b18){_0x39f7ed=_0x39f7ed-0x0;var _0x115b2a=_0xae96[_0x39f7ed];return _0x115b2a;};'use strict';var multer=require(_0x6ae9('0x0'));var util=require(_0x6ae9('0x1'));var path=require(_0x6ae9('0x2'));var timeout=require(_0x6ae9('0x3'));var express=require('express');var router=express[_0x6ae9('0x4')]();var fs_extra=require(_0x6ae9('0x5'));var auth=require(_0x6ae9('0x6'));var interaction=require(_0x6ae9('0x7'));var config=require(_0x6ae9('0x8'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x6ae9('0x9')](),controller[_0x6ae9('0xa')]);module['exports']=router; \ No newline at end of file +var _0x7cd4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0x7cd4,0xd1));var _0x47cd=function(_0x1f5ea4,_0x24be3e){_0x1f5ea4=_0x1f5ea4-0x0;var _0x502c71=_0x7cd4[_0x1f5ea4];return _0x502c71;};'use strict';var multer=require(_0x47cd('0x0'));var util=require(_0x47cd('0x1'));var path=require(_0x47cd('0x2'));var timeout=require(_0x47cd('0x3'));var express=require(_0x47cd('0x4'));var router=express[_0x47cd('0x5')]();var fs_extra=require(_0x47cd('0x6'));var auth=require(_0x47cd('0x7'));var interaction=require(_0x47cd('0x8'));var config=require(_0x47cd('0x9'));var controller=require(_0x47cd('0xa'));router[_0x47cd('0xb')]('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0x47cd('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index a23a077..0cebedb 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 _0x09d1=['STRING','sequelize','exports','TEXT'];(function(_0x2ff624,_0x124531){var _0x16d566=function(_0x1ad28a){while(--_0x1ad28a){_0x2ff624['push'](_0x2ff624['shift']());}};_0x16d566(++_0x124531);}(_0x09d1,0x85));var _0x109d=function(_0x8c1165,_0xa76fde){_0x8c1165=_0x8c1165-0x0;var _0x756e38=_0x09d1[_0x8c1165];return _0x756e38;};'use strict';var Sequelize=require(_0x109d('0x0'));module[_0x109d('0x1')]={'body':{'type':Sequelize[_0x109d('0x2')]},'senderName':{'type':Sequelize[_0x109d('0x3')]},'recipientsId':{'type':Sequelize[_0x109d('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x2aa3=['BOOLEAN','exports','STRING','TEXT'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x2aa3,0x151));var _0x32aa=function(_0x176f6e,_0x5b1fba){_0x176f6e=_0x176f6e-0x0;var _0x190a18=_0x2aa3[_0x176f6e];return _0x190a18;};'use strict';var Sequelize=require('sequelize');module[_0x32aa('0x0')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x32aa('0x1')]},'recipientsId':{'type':Sequelize[_0x32aa('0x2')]},'recipientsDescription':{'type':Sequelize[_0x32aa('0x1')]},'beep':{'type':Sequelize[_0x32aa('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6ef55a7..3724e17 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 _0x379f=['destroy','name','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase','User','queue','replace','Queue','ids','push','all','union','flatten','findOne','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./userNotification.socket','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update','then'];(function(_0x24bd05,_0x1e9f80){var _0x142073=function(_0x2f413e){while(--_0x2f413e){_0x24bd05['push'](_0x24bd05['shift']());}};_0x142073(++_0x1e9f80);}(_0x379f,0xa0));var _0xf379=function(_0x342c9c,_0x1052a7){_0x342c9c=_0x342c9c-0x0;var _0x9f2ed6=_0x379f[_0x342c9c];return _0x9f2ed6;};'use strict';var emlformat=require(_0xf379('0x0'));var rimraf=require(_0xf379('0x1'));var zipdir=require(_0xf379('0x2'));var jsonpatch=require(_0xf379('0x3'));var rp=require(_0xf379('0x4'));var moment=require(_0xf379('0x5'));var BPromise=require(_0xf379('0x6'));var Mustache=require(_0xf379('0x7'));var util=require(_0xf379('0x8'));var path=require(_0xf379('0x9'));var sox=require(_0xf379('0xa'));var csv=require(_0xf379('0xb'));var ejs=require(_0xf379('0xc'));var fs=require('fs');var fs_extra=require(_0xf379('0xd'));var _=require(_0xf379('0xe'));var squel=require('squel');var crypto=require(_0xf379('0xf'));var jsforce=require(_0xf379('0x10'));var deskjs=require(_0xf379('0x11'));var toCsv=require('to-csv');var querystring=require(_0xf379('0x12'));var Papa=require('papaparse');var Redis=require(_0xf379('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf379('0x14'));var as=require(_0xf379('0x15'));var hardwareService=require(_0xf379('0x16'));var logger=require('../../config/logger')(_0xf379('0x17'));var utils=require(_0xf379('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf379('0x19'));var db=require(_0xf379('0x1a'))['db'];config[_0xf379('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf379('0x1b')]));require(_0xf379('0x1c'))['register'](socket);function respondWithStatusCode(_0x559fa7,_0x51615e){_0x51615e=_0x51615e||0xcc;return function(_0x1da492){if(_0x1da492){return _0x559fa7[_0xf379('0x1d')](_0x51615e);}return _0x559fa7['status'](_0x51615e)[_0xf379('0x1e')]();};}function respondWithResult(_0x4a229a,_0x460147){_0x460147=_0x460147||0xc8;return function(_0x3a33ae){if(_0x3a33ae){return _0x4a229a[_0xf379('0x1f')](_0x460147)[_0xf379('0x20')](_0x3a33ae);}};}function respondWithFilteredResult(_0x5e6ad8,_0x917271){return function(_0x59d0d7){if(_0x59d0d7){var _0x47de70=typeof _0x917271['offset']===_0xf379('0x21')&&typeof _0x917271[_0xf379('0x22')]==='undefined';var _0x1cf787=_0x59d0d7[_0xf379('0x23')];var _0x46a6d0=_0x47de70?0x0:_0x917271[_0xf379('0x24')];var _0x2555f1=_0x47de70?_0x59d0d7[_0xf379('0x23')]:_0x917271[_0xf379('0x24')]+_0x917271['limit'];var _0x524883;if(_0x2555f1>=_0x1cf787){_0x2555f1=_0x1cf787;_0x524883=0xc8;}else{_0x524883=0xce;}_0x5e6ad8['status'](_0x524883);return _0x5e6ad8[_0xf379('0x25')]('Content-Range',_0x46a6d0+'-'+_0x2555f1+'/'+_0x1cf787)[_0xf379('0x20')](_0x59d0d7);}return null;};}function patchUpdates(_0x492dee){return function(_0x5e64f0){try{jsonpatch[_0xf379('0x26')](_0x5e64f0,_0x492dee,!![]);}catch(_0x1a25bc){return BPromise['reject'](_0x1a25bc);}return _0x5e64f0[_0xf379('0x27')]();};}function saveUpdates(_0x382dfa,_0x22638f){return function(_0x1888dd){if(_0x1888dd){return _0x1888dd[_0xf379('0x28')](_0x382dfa)[_0xf379('0x29')](function(_0x2a5ead){return _0x2a5ead;});}return null;};}function removeEntity(_0x529d72,_0x2016e2){return function(_0x1d080a){if(_0x1d080a){return _0x1d080a[_0xf379('0x2a')]()['then'](function(){_0x529d72[_0xf379('0x1f')](0xcc)[_0xf379('0x1e')]();});}};}function handleEntityNotFound(_0x2e6bd1,_0x234c0c){return function(_0x44cada){if(!_0x44cada){_0x2e6bd1[_0xf379('0x1d')](0x194);}return _0x44cada;};}function handleError(_0x4ad856,_0x1cef1f){_0x1cef1f=_0x1cef1f||0x1f4;return function(_0x94cced){logger['error'](_0x94cced['stack']);if(_0x94cced[_0xf379('0x2b')]){delete _0x94cced[_0xf379('0x2b')];}_0x4ad856['status'](_0x1cef1f)['send'](_0x94cced);};}exports['sendUserNotification']=function(_0x12c64f,_0x312bb9,_0x7c21cf){if(!_0x12c64f[_0xf379('0x2c')][_0xf379('0x2d')](_0xf379('0x2e'))&&!_0x12c64f['body'][_0xf379('0x2d')](_0xf379('0x2f'))){throw new db['Sequelize']['ValidationError'](_0xf379('0x30'));}else{if(_0x12c64f['body'][_0xf379('0x2d')]('TemplateId')&&!_0x12c64f['body']['hasOwnProperty'](_0xf379('0x31'))){throw new db[(_0xf379('0x32'))][(_0xf379('0x33'))](_0xf379('0x34'));}if(!_0x12c64f[_0xf379('0x2c')][_0xf379('0x2d')]('recipients')){throw new db[(_0xf379('0x32'))][(_0xf379('0x33'))](_0xf379('0x35'));}else{try{var _0x251f2a=JSON[_0xf379('0x36')](_0x12c64f[_0xf379('0x2c')][_0xf379('0x37')]);}catch(_0x5e2c3a){logger['error'](_0x5e2c3a);throw new db[(_0xf379('0x32'))][(_0xf379('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x25b1b0=[_0xf379('0x38'),'faxqueue',_0xf379('0x39'),_0xf379('0x3a'),_0xf379('0x3b'),_0xf379('0x3c'),_0xf379('0x3d'),_0xf379('0x3e'),'user'];if(_['some'](_0x251f2a,function(_0x2e17f8){return!_[_0xf379('0x3f')](_0x25b1b0,_0x2e17f8[_0xf379('0x40')][_0xf379('0x41')]());})){throw new db[(_0xf379('0x32'))][(_0xf379('0x33'))](_0xf379('0x42'));}}}var _0x1108ed={};_0x1108ed[_0xf379('0x43')]=_0x12c64f['body'][_0xf379('0x2d')](_0xf379('0x43'))?_0x12c64f['body']['senderName']:_0x12c64f[_0xf379('0x44')][_0xf379('0x45')];_0x1108ed[_0xf379('0x46')]=_[_0xf379('0x47')](_0x12c64f[_0xf379('0x2c')]['recipientsDescription'])?null:_0x12c64f[_0xf379('0x2c')][_0xf379('0x46')];_0x1108ed[_0xf379('0x48')]=_0x12c64f[_0xf379('0x2c')]['beep']||![];_0x1108ed[_0xf379('0x49')]=_0x12c64f[_0xf379('0x44')]['id'];return getContent(_0x12c64f[_0xf379('0x2c')])['then'](function(_0x2997c1){_0x1108ed[_0xf379('0x2c')]=_0x2997c1;return getRecipients(_0x251f2a);})[_0xf379('0x29')](function(_0x2059d4){_0x1108ed[_0xf379('0x4a')]=_['sortBy'](_0x2059d4)[_0xf379('0x4b')](',');return db[_0xf379('0x4c')][_0xf379('0x4d')](function(_0x49754c){return db[_0xf379('0x4e')][_0xf379('0x4f')](_0x1108ed,{'raw':!![],'transaction':_0x49754c})[_0xf379('0x29')](function(_0x1a4bad){var _0xcb465d={'sender':_0x1108ed[_0xf379('0x43')],'description':_0x1108ed[_0xf379('0x46')],'content':_0x1108ed[_0xf379('0x2c')],'beep':_0x1108ed[_0xf379('0x48')]};_0x2059d4['forEach'](function(_0x52d21f){_0xcb465d[_0xf379('0x50')]=_0x52d21f;socket[_0xf379('0x51')](_0xf379('0x52'),_0xcb465d);});return _0x1a4bad;});});})[_0xf379('0x29')](respondWithResult(_0x312bb9,0xc9))[_0xf379('0x53')](handleError(_0x312bb9,null));};function getContent(_0x78199d){return new BPromise(function(_0x4addf0,_0x344c5b){if(_0x78199d['text']){_0x4addf0(_0x78199d[_0xf379('0x2e')]);return;}return db['Template']['findOne']({'attributes':[_0xf379('0x54')],'where':{'id':_0x78199d['TemplateId']},'raw':!![]})['then'](function(_0x46ecd2){if(!_0x46ecd2)throw new db[(_0xf379('0x32'))][(_0xf379('0x33'))](_0xf379('0x55'));var _0x76e9a4=Mustache[_0xf379('0x56')](_0x46ecd2[_0xf379('0x54')],_0x78199d[_0xf379('0x31')]);_0x4addf0(_0x76e9a4);})[_0xf379('0x53')](function(_0x1b1757){_0x344c5b(_0x1b1757);});});}function getRecipients(_0x22d128){return new BPromise(function(_0x40dff5,_0x2427e4){var _0xff3a5c=[];var _0x244744=[];_0x22d128[_0xf379('0x57')](function(_0x3124a6){var _0x2fb85b=_[_0xf379('0x58')](_0x3124a6[_0xf379('0x40')][_0xf379('0x41')]());if(_0x2fb85b===_0xf379('0x59')){_0xff3a5c=_['union'](_0xff3a5c,_0x3124a6['ids']);}else{if(_[_0xf379('0x3f')](_0x2fb85b,_0xf379('0x5a')))_0x2fb85b=_0x2fb85b[_0xf379('0x5b')](_0xf379('0x5a'),_0xf379('0x5c'));_0x3124a6[_0xf379('0x5d')]['forEach'](function(_0x41ba7f){_0x244744[_0xf379('0x5e')](getAgents(_0x2fb85b,_0x41ba7f));});}});return BPromise[_0xf379('0x5f')](_0x244744)[_0xf379('0x29')](function(_0xacbdc7){_0xff3a5c=_[_0xf379('0x60')](_0xff3a5c,_[_0xf379('0x61')](_0xacbdc7));_0x40dff5(_0xff3a5c);})[_0xf379('0x53')](function(_0x7ac1be){_0x2427e4(_0x7ac1be);});});}function getAgents(_0x56665c,_0x2663fc){return new BPromise(function(_0x4fd7c6,_0xb0db0e){return db[_0x56665c][_0xf379('0x62')]({'where':{'id':_0x2663fc}})[_0xf379('0x29')](function(_0x10103e){return _0x10103e[_0xf379('0x63')]({'attributes':['id'],'raw':!![]})[_0xf379('0x29')](function(_0x13ad3d){var _0x28d217=_[_0xf379('0x64')](_0x13ad3d,'id');_0x4fd7c6(_0x28d217);});})[_0xf379('0x53')](function(_0x1c8f70){_0xb0db0e(_0x1c8f70);});});} \ No newline at end of file +var _0xcb4c=['sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','then','destroy','error','name','sendUserNotification','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','hasOwnProperty','TemplateId','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','voicequeue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','render','view','User','union','queue','Queue','ids','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','register'];(function(_0x1ce0b6,_0x8450c){var _0x55d879=function(_0x50abd5){while(--_0x50abd5){_0x1ce0b6['push'](_0x1ce0b6['shift']());}};_0x55d879(++_0x8450c);}(_0xcb4c,0x9d));var _0xccb4=function(_0x2f1e49,_0x1648b6){_0x2f1e49=_0x2f1e49-0x0;var _0x15a889=_0xcb4c[_0x2f1e49];return _0x15a889;};'use strict';var emlformat=require(_0xccb4('0x0'));var rimraf=require(_0xccb4('0x1'));var zipdir=require(_0xccb4('0x2'));var jsonpatch=require(_0xccb4('0x3'));var rp=require(_0xccb4('0x4'));var moment=require('moment');var BPromise=require(_0xccb4('0x5'));var Mustache=require('mustache');var util=require(_0xccb4('0x6'));var path=require(_0xccb4('0x7'));var sox=require(_0xccb4('0x8'));var csv=require(_0xccb4('0x9'));var ejs=require(_0xccb4('0xa'));var fs=require('fs');var fs_extra=require(_0xccb4('0xb'));var _=require(_0xccb4('0xc'));var squel=require(_0xccb4('0xd'));var crypto=require(_0xccb4('0xe'));var jsforce=require(_0xccb4('0xf'));var deskjs=require(_0xccb4('0x10'));var toCsv=require('to-csv');var querystring=require(_0xccb4('0x11'));var Papa=require(_0xccb4('0x12'));var Redis=require(_0xccb4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xccb4('0x14'));var as=require(_0xccb4('0x15'));var hardwareService=require(_0xccb4('0x16'));var logger=require(_0xccb4('0x17'))('api');var utils=require(_0xccb4('0x18'));var config=require(_0xccb4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xccb4('0x1a'))['db'];config[_0xccb4('0x1b')]=_['defaults'](config[_0xccb4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xccb4('0x1c'))(new Redis(config['redis']));require(_0xccb4('0x1d'))[_0xccb4('0x1e')](socket);function respondWithStatusCode(_0x546e01,_0x40e844){_0x40e844=_0x40e844||0xcc;return function(_0x455381){if(_0x455381){return _0x546e01[_0xccb4('0x1f')](_0x40e844);}return _0x546e01[_0xccb4('0x20')](_0x40e844)[_0xccb4('0x21')]();};}function respondWithResult(_0x3ddfd2,_0x3eae9a){_0x3eae9a=_0x3eae9a||0xc8;return function(_0x259f4d){if(_0x259f4d){return _0x3ddfd2['status'](_0x3eae9a)[_0xccb4('0x22')](_0x259f4d);}};}function respondWithFilteredResult(_0x30c72c,_0x4157d8){return function(_0x1f16fb){if(_0x1f16fb){var _0x4d35fa=typeof _0x4157d8[_0xccb4('0x23')]===_0xccb4('0x24')&&typeof _0x4157d8['limit']===_0xccb4('0x24');var _0x4d8587=_0x1f16fb['count'];var _0x3cad15=_0x4d35fa?0x0:_0x4157d8['offset'];var _0x5c10c7=_0x4d35fa?_0x1f16fb['count']:_0x4157d8[_0xccb4('0x23')]+_0x4157d8[_0xccb4('0x25')];var _0x4b9578;if(_0x5c10c7>=_0x4d8587){_0x5c10c7=_0x4d8587;_0x4b9578=0xc8;}else{_0x4b9578=0xce;}_0x30c72c[_0xccb4('0x20')](_0x4b9578);return _0x30c72c[_0xccb4('0x26')](_0xccb4('0x27'),_0x3cad15+'-'+_0x5c10c7+'/'+_0x4d8587)[_0xccb4('0x22')](_0x1f16fb);}return null;};}function patchUpdates(_0x2facbf){return function(_0x21a492){try{jsonpatch[_0xccb4('0x28')](_0x21a492,_0x2facbf,!![]);}catch(_0x27303b){return BPromise['reject'](_0x27303b);}return _0x21a492['save']();};}function saveUpdates(_0x44a737,_0x33b526){return function(_0x4a35fa){if(_0x4a35fa){return _0x4a35fa['update'](_0x44a737)[_0xccb4('0x29')](function(_0x362f4f){return _0x362f4f;});}return null;};}function removeEntity(_0x448842,_0x45fc4e){return function(_0x3eb794){if(_0x3eb794){return _0x3eb794[_0xccb4('0x2a')]()['then'](function(){_0x448842[_0xccb4('0x20')](0xcc)[_0xccb4('0x21')]();});}};}function handleEntityNotFound(_0xa5d2be,_0x10fc0e){return function(_0x5b60d3){if(!_0x5b60d3){_0xa5d2be[_0xccb4('0x1f')](0x194);}return _0x5b60d3;};}function handleError(_0xa88c83,_0x104f30){_0x104f30=_0x104f30||0x1f4;return function(_0x279a82){logger[_0xccb4('0x2b')](_0x279a82['stack']);if(_0x279a82[_0xccb4('0x2c')]){delete _0x279a82[_0xccb4('0x2c')];}_0xa88c83[_0xccb4('0x20')](_0x104f30)['send'](_0x279a82);};}exports[_0xccb4('0x2d')]=function(_0x3be9f3,_0xf13d88,_0x11f331){if(!_0x3be9f3['body']['hasOwnProperty']('text')&&!_0x3be9f3['body']['hasOwnProperty']('TemplateId')){throw new db[(_0xccb4('0x2e'))][(_0xccb4('0x2f'))](_0xccb4('0x30'));}else{if(_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x32')](_0xccb4('0x33'))&&!_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x32')]('view')){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x3be9f3[_0xccb4('0x31')]['hasOwnProperty'](_0xccb4('0x34'))){throw new db[(_0xccb4('0x2e'))][(_0xccb4('0x2f'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x1f8016=JSON[_0xccb4('0x35')](_0x3be9f3[_0xccb4('0x31')]['recipients']);}catch(_0x28dbc2){logger['error'](_0x28dbc2);throw new db['Sequelize'][(_0xccb4('0x2f'))](_0xccb4('0x36'));}var _0x2a218d=[_0xccb4('0x37'),_0xccb4('0x38'),'mailqueue',_0xccb4('0x39'),'smsqueue',_0xccb4('0x3a'),'whatsappqueue','team',_0xccb4('0x3b')];if(_[_0xccb4('0x3c')](_0x1f8016,function(_0x1bcc00){return!_[_0xccb4('0x3d')](_0x2a218d,_0x1bcc00[_0xccb4('0x3e')][_0xccb4('0x3f')]());})){throw new db[(_0xccb4('0x2e'))][(_0xccb4('0x2f'))](_0xccb4('0x40'));}}}var _0x3c8965={};_0x3c8965[_0xccb4('0x41')]=_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x32')]('senderName')?_0x3be9f3['body']['senderName']:_0x3be9f3[_0xccb4('0x3b')][_0xccb4('0x42')];_0x3c8965[_0xccb4('0x43')]=_['isEmpty'](_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x43')])?null:_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x43')];_0x3c8965[_0xccb4('0x44')]=_0x3be9f3[_0xccb4('0x31')][_0xccb4('0x44')]||![];_0x3c8965['SenderId']=_0x3be9f3['user']['id'];return getContent(_0x3be9f3['body'])[_0xccb4('0x29')](function(_0xb2defb){_0x3c8965[_0xccb4('0x31')]=_0xb2defb;return getRecipients(_0x1f8016);})['then'](function(_0x5e9d0e){_0x3c8965['recipientsId']=_[_0xccb4('0x45')](_0x5e9d0e)['join'](',');return db[_0xccb4('0x46')][_0xccb4('0x47')](function(_0x164ba5){return db[_0xccb4('0x48')][_0xccb4('0x49')](_0x3c8965,{'raw':!![],'transaction':_0x164ba5})[_0xccb4('0x29')](function(_0x4baaee){var _0x28d8b1={'sender':_0x3c8965['senderName'],'description':_0x3c8965[_0xccb4('0x43')],'content':_0x3c8965[_0xccb4('0x31')],'beep':_0x3c8965['beep']};_0x5e9d0e[_0xccb4('0x4a')](function(_0x2f7e8c){_0x28d8b1[_0xccb4('0x4b')]=_0x2f7e8c;socket[_0xccb4('0x4c')](_0xccb4('0x4d'),_0x28d8b1);});return _0x4baaee;});});})[_0xccb4('0x29')](respondWithResult(_0xf13d88,0xc9))[_0xccb4('0x4e')](handleError(_0xf13d88,null));};function getContent(_0x1248c1){return new BPromise(function(_0x5ad3dd,_0x41a75e){if(_0x1248c1['text']){_0x5ad3dd(_0x1248c1[_0xccb4('0x4f')]);return;}return db[_0xccb4('0x50')][_0xccb4('0x51')]({'attributes':['html'],'where':{'id':_0x1248c1[_0xccb4('0x33')]},'raw':!![]})[_0xccb4('0x29')](function(_0x3e6906){if(!_0x3e6906)throw new db[(_0xccb4('0x2e'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x38837=Mustache[_0xccb4('0x52')](_0x3e6906['html'],_0x1248c1[_0xccb4('0x53')]);_0x5ad3dd(_0x38837);})['catch'](function(_0x12ca55){_0x41a75e(_0x12ca55);});});}function getRecipients(_0x4d8b4a){return new BPromise(function(_0x3b102e,_0x1fbb58){var _0x13452b=[];var _0x5eb0ce=[];_0x4d8b4a[_0xccb4('0x4a')](function(_0x18f208){var _0x1b9744=_['startCase'](_0x18f208[_0xccb4('0x3e')][_0xccb4('0x3f')]());if(_0x1b9744===_0xccb4('0x54')){_0x13452b=_[_0xccb4('0x55')](_0x13452b,_0x18f208['ids']);}else{if(_['includes'](_0x1b9744,'queue'))_0x1b9744=_0x1b9744['replace'](_0xccb4('0x56'),_0xccb4('0x57'));_0x18f208[_0xccb4('0x58')][_0xccb4('0x4a')](function(_0x274c84){_0x5eb0ce[_0xccb4('0x59')](getAgents(_0x1b9744,_0x274c84));});}});return BPromise[_0xccb4('0x5a')](_0x5eb0ce)[_0xccb4('0x29')](function(_0x6a1450){_0x13452b=_[_0xccb4('0x55')](_0x13452b,_[_0xccb4('0x5b')](_0x6a1450));_0x3b102e(_0x13452b);})[_0xccb4('0x4e')](function(_0x38aec1){_0x1fbb58(_0x38aec1);});});}function getAgents(_0x4fb110,_0x252d76){return new BPromise(function(_0x8e8593,_0x7cb15d){return db[_0x4fb110][_0xccb4('0x51')]({'where':{'id':_0x252d76}})[_0xccb4('0x29')](function(_0x4faf57){return _0x4faf57[_0xccb4('0x5c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1bd190){var _0x2c028c=_[_0xccb4('0x5d')](_0x1bd190,'id');_0x8e8593(_0x2c028c);});})[_0xccb4('0x4e')](function(_0x3791d6){_0x7cb15d(_0x3791d6);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index b9a6a63..ac5cb05 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 _0x673c=['remove','emit','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x673c,0x16c));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xc673('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xc673('0x1')](0x0);var events={'afterCreate':_0xc673('0x2'),'afterUpdate':_0xc673('0x3'),'afterDestroy':_0xc673('0x4')};function emitEvent(_0x5df66f){return function(_0x4bb873,_0x10746a,_0x88b7e5){UserNotificationEvents[_0xc673('0x5')](_0x5df66f+':'+_0x4bb873['id'],_0x4bb873);UserNotificationEvents[_0xc673('0x5')](_0x5df66f,_0x4bb873);_0x88b7e5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xc673('0x6')](e,emitEvent(event));}}module[_0xc673('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x4ede=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification'];(function(_0x3dc089,_0x5ccb0d){var _0x34d9d3=function(_0x4556bf){while(--_0x4556bf){_0x3dc089['push'](_0x3dc089['shift']());}};_0x34d9d3(++_0x5ccb0d);}(_0x4ede,0x1e1));var _0xe4ed=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4ede[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0xe4ed('0x0'));var UserNotification=require(_0xe4ed('0x1'))['db'][_0xe4ed('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe4ed('0x3')](0x0);var events={'afterCreate':_0xe4ed('0x4'),'afterUpdate':_0xe4ed('0x5'),'afterDestroy':_0xe4ed('0x6')};function emitEvent(_0x226dab){return function(_0xad4437,_0x1c47b3,_0x59c637){UserNotificationEvents[_0xe4ed('0x7')](_0x226dab+':'+_0xad4437['id'],_0xad4437);UserNotificationEvents[_0xe4ed('0x7')](_0x226dab,_0xad4437);_0x59c637(null);};}for(var e in events){if(events[_0xe4ed('0x8')](e)){var event=events[e];UserNotification[_0xe4ed('0x9')](e,emitEvent(event));}}module[_0xe4ed('0xa')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index b4eff3c..d34b05e 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 _0x2114=['UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','rimraf','../../config/environment','./userNotification.attributes','define'];(function(_0x4e5abf,_0x201a03){var _0x54d474=function(_0x22edd1){while(--_0x22edd1){_0x4e5abf['push'](_0x4e5abf['shift']());}};_0x54d474(++_0x201a03);}(_0x2114,0x1ed));var _0x4211=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x2114[_0x4d0df6];return _0x4e2615;};'use strict';var _=require(_0x4211('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4211('0x1'));var moment=require(_0x4211('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4211('0x3'));var config=require(_0x4211('0x4'));var attributes=require(_0x4211('0x5'));module['exports']=function(_0x3daf1c,_0x49ab0f){return _0x3daf1c[_0x4211('0x6')](_0x4211('0x7'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4211('0x8'),'collate':_0x4211('0x9')});}; \ No newline at end of file +var _0x5149=['request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird'];(function(_0x2c5043,_0x414462){var _0x486461=function(_0x2b230e){while(--_0x2b230e){_0x2c5043['push'](_0x2c5043['shift']());}};_0x486461(++_0x414462);}(_0x5149,0xd4));var _0x9514=function(_0x21ae69,_0x502734){_0x21ae69=_0x21ae69-0x0;var _0x113688=_0x5149[_0x21ae69];return _0x113688;};'use strict';var _=require(_0x9514('0x0'));var util=require('util');var logger=require(_0x9514('0x1'))('api');var moment=require(_0x9514('0x2'));var BPromise=require(_0x9514('0x3'));var rp=require(_0x9514('0x4'));var fs=require('fs');var path=require(_0x9514('0x5'));var rimraf=require(_0x9514('0x6'));var config=require('../../config/environment');var attributes=require(_0x9514('0x7'));module[_0x9514('0x8')]=function(_0x582776,_0x3d453a){return _0x582776[_0x9514('0x9')](_0x9514('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9514('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index caf1031..26ac06d 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 _0x0cc8=['message','result','catch','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c4fb0,_0x5f29c1){var _0x4880b1=function(_0x41fb42){while(--_0x41fb42){_0x1c4fb0['push'](_0x1c4fb0['shift']());}};_0x4880b1(++_0x5f29c1);}(_0x0cc8,0x1f1));var _0x80cc=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x0cc8[_0x466af7];return _0x348c96;};'use strict';var _=require('lodash');var util=require(_0x80cc('0x0'));var moment=require('moment');var BPromise=require(_0x80cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x80cc('0x2'));var logger=require(_0x80cc('0x3'))(_0x80cc('0x4'));var config=require(_0x80cc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x80cc('0x6')][_0x80cc('0x7')]({'port':0x232a});config['redis']=_[_0x80cc('0x8')](config[_0x80cc('0x9')],{'host':_0x80cc('0xa'),'port':0x18eb});var socket=require(_0x80cc('0xb'))(new Redis(config[_0x80cc('0x9')]));require(_0x80cc('0xc'))[_0x80cc('0xd')](socket);function respondWithRpcPromise(_0x382a5a,_0x5186df,_0x371531){return new BPromise(function(_0x1bfcd9,_0x2e2a30){return client[_0x80cc('0xe')](_0x382a5a,_0x371531)['then'](function(_0x4648a9){logger[_0x80cc('0xf')](_0x80cc('0x10'),_0x5186df,_0x80cc('0x11'));logger[_0x80cc('0x12')](_0x80cc('0x13'),_0x5186df,_0x80cc('0x11'),JSON[_0x80cc('0x14')](_0x4648a9));if(_0x4648a9[_0x80cc('0x15')]){if(_0x4648a9[_0x80cc('0x15')][_0x80cc('0x16')]===0x1f4){logger[_0x80cc('0x15')](_0x80cc('0x10'),_0x5186df,_0x4648a9[_0x80cc('0x15')][_0x80cc('0x17')]);return _0x2e2a30(_0x4648a9[_0x80cc('0x15')]['message']);}logger[_0x80cc('0x15')](_0x80cc('0x10'),_0x5186df,_0x4648a9[_0x80cc('0x15')]['message']);return _0x1bfcd9(_0x4648a9[_0x80cc('0x15')][_0x80cc('0x17')]);}else{logger[_0x80cc('0xf')]('UserNotification,\x20%s,\x20%s',_0x5186df,_0x80cc('0x11'));_0x1bfcd9(_0x4648a9[_0x80cc('0x18')]['message']);}})[_0x80cc('0x19')](function(_0x6776a8){logger[_0x80cc('0x15')](_0x80cc('0x10'),_0x5186df,_0x6776a8);_0x2e2a30(_0x6776a8);});});} \ No newline at end of file +var _0x44c9=['../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x44c9,0xb8));var _0x944c=function(_0x457d50,_0x3b9d36){_0x457d50=_0x457d50-0x0;var _0x26e448=_0x44c9[_0x457d50];return _0x26e448;};'use strict';var _=require(_0x944c('0x0'));var util=require('util');var moment=require(_0x944c('0x1'));var BPromise=require(_0x944c('0x2'));var rs=require(_0x944c('0x3'));var fs=require('fs');var Redis=require(_0x944c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x944c('0x5'))(_0x944c('0x6'));var config=require(_0x944c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x944c('0x8')][_0x944c('0x9')]({'port':0x232a});config[_0x944c('0xa')]=_['defaults'](config[_0x944c('0xa')],{'host':_0x944c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x944c('0xc'))[_0x944c('0xd')](socket);function respondWithRpcPromise(_0x49c403,_0x2e1aef,_0x4c8aef){return new BPromise(function(_0x3f760b,_0x316639){return client[_0x944c('0xe')](_0x49c403,_0x4c8aef)[_0x944c('0xf')](function(_0x4071dd){logger['info'](_0x944c('0x10'),_0x2e1aef,_0x944c('0x11'));logger[_0x944c('0x12')](_0x944c('0x13'),_0x2e1aef,'request\x20sent',JSON[_0x944c('0x14')](_0x4071dd));if(_0x4071dd[_0x944c('0x15')]){if(_0x4071dd[_0x944c('0x15')][_0x944c('0x16')]===0x1f4){logger[_0x944c('0x15')](_0x944c('0x10'),_0x2e1aef,_0x4071dd[_0x944c('0x15')][_0x944c('0x17')]);return _0x316639(_0x4071dd[_0x944c('0x15')][_0x944c('0x17')]);}logger[_0x944c('0x15')]('UserNotification,\x20%s,\x20%s',_0x2e1aef,_0x4071dd['error'][_0x944c('0x17')]);return _0x3f760b(_0x4071dd[_0x944c('0x15')][_0x944c('0x17')]);}else{logger[_0x944c('0x18')](_0x944c('0x10'),_0x2e1aef,_0x944c('0x11'));_0x3f760b(_0x4071dd[_0x944c('0x19')]['message']);}})[_0x944c('0x1a')](function(_0x2406eb){logger[_0x944c('0x15')](_0x944c('0x10'),_0x2e1aef,_0x2406eb);_0x316639(_0x2406eb);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ded9f6b..8f811dd 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 _0x94fd=['register','length','userNotification:','./userNotification.events','save','remove','update','emit','removeListener'];(function(_0x13594e,_0x6f0ed0){var _0x1a4f42=function(_0x30b064){while(--_0x30b064){_0x13594e['push'](_0x13594e['shift']());}};_0x1a4f42(++_0x6f0ed0);}(_0x94fd,0xd2));var _0xd94f=function(_0x46b24f,_0x5f18b2){_0x46b24f=_0x46b24f-0x0;var _0x4c5fab=_0x94fd[_0x46b24f];return _0x4c5fab;};'use strict';var UserNotificationEvents=require(_0xd94f('0x0'));var events=[_0xd94f('0x1'),_0xd94f('0x2'),_0xd94f('0x3')];function createListener(_0x479e55,_0xfa4842){return function(_0x54936b){_0xfa4842[_0xd94f('0x4')](_0x479e55,_0x54936b);};}function removeListener(_0x128a93,_0x46894a){return function(){UserNotificationEvents[_0xd94f('0x5')](_0x128a93,_0x46894a);};}exports[_0xd94f('0x6')]=function(_0x3fb6c0){for(var _0xae26f8=0x0,_0x23eddd=events[_0xd94f('0x7')];_0xae26f8<_0x23eddd;_0xae26f8++){var _0x56cc33=events[_0xae26f8];var _0x59c68d=createListener(_0xd94f('0x8')+_0x56cc33,_0x3fb6c0);UserNotificationEvents['on'](_0x56cc33,_0x59c68d);}}; \ No newline at end of file +var _0x56be=['update','emit','register','userNotification:','./userNotification.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56be,0x18a));var _0xe56b=function(_0x27212d,_0x4b4095){_0x27212d=_0x27212d-0x0;var _0x5ea1ee=_0x56be[_0x27212d];return _0x5ea1ee;};'use strict';var UserNotificationEvents=require(_0xe56b('0x0'));var events=[_0xe56b('0x1'),'remove',_0xe56b('0x2')];function createListener(_0xbde174,_0x527041){return function(_0x137b68){_0x527041[_0xe56b('0x3')](_0xbde174,_0x137b68);};}function removeListener(_0x1bd8d7,_0x52ab57){return function(){UserNotificationEvents['removeListener'](_0x1bd8d7,_0x52ab57);};}exports[_0xe56b('0x4')]=function(_0x3d63c3){for(var _0x20b3a9=0x0,_0x30ff6d=events['length'];_0x20b3a9<_0x30ff6d;_0x20b3a9++){var _0x332b62=events[_0x20b3a9];var _0x50126b=createListener(_0xe56b('0x5')+_0x332b62,_0x3d63c3);UserNotificationEvents['on'](_0x332b62,_0x50126b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4d5d9b4..e5a8cd0 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x46931a,_0x2b9a90){var _0x34dd4a=function(_0x59a73e){while(--_0x59a73e){_0x46931a['push'](_0x46931a['shift']());}};_0x34dd4a(++_0x2b9a90);}(_0xe706,0xa3));var _0x6e70=function(_0x515d8d,_0x5a7b53){_0x515d8d=_0x515d8d-0x0;var _0x296990=_0xe706[_0x515d8d];return _0x296990;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2c2954,_0x3cadf4){var _0x1e834e=function(_0x9f157e){while(--_0x9f157e){_0x2c2954['push'](_0x2c2954['shift']());}};_0x1e834e(++_0x3cadf4);}(_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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f47bd87..c0cfb79 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 _0xafa5=['INTEGER','exports'];(function(_0x50161b,_0x3eeb18){var _0x1f742e=function(_0x34115c){while(--_0x34115c){_0x50161b['push'](_0x50161b['shift']());}};_0x1f742e(++_0x3eeb18);}(_0xafa5,0x1af));var _0x5afa=function(_0x4e5631,_0xa25467){_0x4e5631=_0x4e5631-0x0;var _0x558d32=_0xafa5[_0x4e5631];return _0x558d32;};'use strict';var Sequelize=require('sequelize');module[_0x5afa('0x0')]={'penalty':{'type':Sequelize[_0x5afa('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe781=['INTEGER','sequelize','exports'];(function(_0x149c40,_0x5119f3){var _0x562d08=function(_0x5e8db7){while(--_0x5e8db7){_0x149c40['push'](_0x149c40['shift']());}};_0x562d08(++_0x5119f3);}(_0xe781,0x88));var _0x1e78=function(_0x2e6747,_0x3db877){_0x2e6747=_0x2e6747-0x0;var _0x154a35=_0xe781[_0x2e6747];return _0x154a35;};'use strict';var Sequelize=require(_0x1e78('0x0'));module[_0x1e78('0x1')]={'penalty':{'type':Sequelize[_0x1e78('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 79dec10..8dc1993 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 _0xdd4d=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues'];(function(_0x4e2172,_0x2ef388){var _0x28a9fc=function(_0x1d96e1){while(--_0x1d96e1){_0x4e2172['push'](_0x4e2172['shift']());}};_0x28a9fc(++_0x2ef388);}(_0xdd4d,0x9c));var _0xddd4=function(_0x2d37c6,_0x47e971){_0x2d37c6=_0x2d37c6-0x0;var _0x4ec33f=_0xdd4d[_0x2d37c6];return _0x4ec33f;};'use strict';var _=require(_0xddd4('0x0'));var util=require(_0xddd4('0x1'));var logger=require(_0xddd4('0x2'))(_0xddd4('0x3'));var moment=require('moment');var BPromise=require(_0xddd4('0x4'));var rp=require(_0xddd4('0x5'));var fs=require('fs');var path=require(_0xddd4('0x6'));var rimraf=require(_0xddd4('0x7'));var config=require(_0xddd4('0x8'));var attributes=require(_0xddd4('0x9'));module[_0xddd4('0xa')]=function(_0xcae5d8,_0x20f629){return _0xcae5d8['define'](_0xddd4('0xb'),attributes,{'tableName':_0xddd4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35c3=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x35c3,0x104));var _0x335c=function(_0x45c15f,_0x421ba9){_0x45c15f=_0x45c15f-0x0;var _0x363a0e=_0x35c3[_0x45c15f];return _0x363a0e;};'use strict';var _=require('lodash');var util=require(_0x335c('0x0'));var logger=require(_0x335c('0x1'))('api');var moment=require(_0x335c('0x2'));var BPromise=require(_0x335c('0x3'));var rp=require(_0x335c('0x4'));var fs=require('fs');var path=require(_0x335c('0x5'));var rimraf=require(_0x335c('0x6'));var config=require(_0x335c('0x7'));var attributes=require(_0x335c('0x8'));module[_0x335c('0x9')]=function(_0x57b7df,_0x985e87){return _0x57b7df['define']('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 651af13..d232afb 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 _0x5e11=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x380349,_0x4de984){var _0x180a34=function(_0x32aec3){while(--_0x32aec3){_0x380349['push'](_0x380349['shift']());}};_0x180a34(++_0x4de984);}(_0x5e11,0x1a8));var _0x15e1=function(_0x16cb03,_0x43ea58){_0x16cb03=_0x16cb03-0x0;var _0x10944e=_0x5e11[_0x16cb03];return _0x10944e;};'use strict';var _=require(_0x15e1('0x0'));var util=require(_0x15e1('0x1'));var moment=require(_0x15e1('0x2'));var BPromise=require(_0x15e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15e1('0x4'));var db=require(_0x15e1('0x5'))['db'];var utils=require(_0x15e1('0x6'));var logger=require(_0x15e1('0x7'))('rpc');var config=require(_0x15e1('0x8'));var jayson=require(_0x15e1('0x9'));var client=jayson[_0x15e1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x188ed2,_0x57f212,_0x2deacf){return new BPromise(function(_0x3e62a7,_0x5c2fcd){return client[_0x15e1('0xb')](_0x188ed2,_0x2deacf)[_0x15e1('0xc')](function(_0x239323){logger[_0x15e1('0xd')](_0x15e1('0xe'),_0x57f212,_0x15e1('0xf'));logger[_0x15e1('0x10')](_0x15e1('0x11'),_0x57f212,_0x15e1('0xf'),JSON[_0x15e1('0x12')](_0x239323));if(_0x239323['error']){if(_0x239323[_0x15e1('0x13')][_0x15e1('0x14')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x57f212,_0x239323[_0x15e1('0x13')]['message']);return _0x5c2fcd(_0x239323[_0x15e1('0x13')][_0x15e1('0x15')]);}logger[_0x15e1('0x13')](_0x15e1('0xe'),_0x57f212,_0x239323[_0x15e1('0x13')][_0x15e1('0x15')]);return _0x3e62a7(_0x239323[_0x15e1('0x13')][_0x15e1('0x15')]);}else{logger['info'](_0x15e1('0xe'),_0x57f212,_0x15e1('0xf'));_0x3e62a7(_0x239323[_0x15e1('0x16')][_0x15e1('0x15')]);}})['catch'](function(_0xd851cd){logger['error'](_0x15e1('0xe'),_0x57f212,_0xd851cd);_0x5c2fcd(_0xd851cd);});});} \ No newline at end of file +var _0x2522=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x312440,_0x10c4aa){var _0x145314=function(_0x508530){while(--_0x508530){_0x312440['push'](_0x312440['shift']());}};_0x145314(++_0x10c4aa);}(_0x2522,0x155));var _0x2252=function(_0x11f588,_0x299d31){_0x11f588=_0x11f588-0x0;var _0x4b1fbd=_0x2522[_0x11f588];return _0x4b1fbd;};'use strict';var _=require(_0x2252('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2252('0x1'));var rs=require(_0x2252('0x2'));var fs=require('fs');var Redis=require(_0x2252('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2252('0x4'))(_0x2252('0x5'));var config=require(_0x2252('0x6'));var jayson=require(_0x2252('0x7'));var client=jayson['client'][_0x2252('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47e736,_0x3500f5,_0x3d3c82){return new BPromise(function(_0x1c9bcd,_0x40d544){return client[_0x2252('0x9')](_0x47e736,_0x3d3c82)['then'](function(_0x22b4e8){logger[_0x2252('0xa')](_0x2252('0xb'),_0x3500f5,_0x2252('0xc'));logger[_0x2252('0xd')](_0x2252('0xe'),_0x3500f5,_0x2252('0xc'),JSON['stringify'](_0x22b4e8));if(_0x22b4e8[_0x2252('0xf')]){if(_0x22b4e8[_0x2252('0xf')]['code']===0x1f4){logger[_0x2252('0xf')](_0x2252('0xb'),_0x3500f5,_0x22b4e8[_0x2252('0xf')][_0x2252('0x10')]);return _0x40d544(_0x22b4e8['error'][_0x2252('0x10')]);}logger['error'](_0x2252('0xb'),_0x3500f5,_0x22b4e8[_0x2252('0xf')]['message']);return _0x1c9bcd(_0x22b4e8['error']['message']);}else{logger[_0x2252('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3500f5,_0x2252('0xc'));_0x1c9bcd(_0x22b4e8[_0x2252('0x11')][_0x2252('0x10')]);}})[_0x2252('0x12')](function(_0x4a51dd){logger[_0x2252('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x3500f5,_0x4a51dd);_0x40d544(_0x4a51dd);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a4507c5..cfc9544 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 _0xd83a=['/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addResources','put','/:id','update','delete','destroy','removeSections','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x51cac9,_0x22d722){var _0x3ad793=function(_0x26148b){while(--_0x26148b){_0x51cac9['push'](_0x51cac9['shift']());}};_0x3ad793(++_0x22d722);}(_0xd83a,0xc2));var _0xad83=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0xd83a[_0x33bc64];return _0x3fdd34;};'use strict';var multer=require(_0xad83('0x0'));var util=require(_0xad83('0x1'));var path=require(_0xad83('0x2'));var timeout=require('connect-timeout');var express=require(_0xad83('0x3'));var router=express[_0xad83('0x4')]();var fs_extra=require(_0xad83('0x5'));var auth=require(_0xad83('0x6'));var interaction=require(_0xad83('0x7'));var config=require(_0xad83('0x8'));var controller=require(_0xad83('0x9'));router[_0xad83('0xa')]('/',auth[_0xad83('0xb')](),controller[_0xad83('0xc')]);router[_0xad83('0xa')](_0xad83('0xd'),auth[_0xad83('0xb')](),controller[_0xad83('0xe')]);router[_0xad83('0xa')]('/:id',auth[_0xad83('0xb')](),controller[_0xad83('0xf')]);router['get'](_0xad83('0x10'),auth[_0xad83('0xb')](),controller['getSections']);router[_0xad83('0xa')](_0xad83('0x11'),auth[_0xad83('0xb')](),controller[_0xad83('0x12')]);router[_0xad83('0x13')]('/',auth[_0xad83('0xb')](),controller[_0xad83('0x14')]);router[_0xad83('0x13')](_0xad83('0x15'),auth[_0xad83('0xb')](),controller[_0xad83('0x16')]);router[_0xad83('0x13')](_0xad83('0x10'),auth[_0xad83('0xb')](),controller['addSections']);router[_0xad83('0x13')](_0xad83('0x11'),auth[_0xad83('0xb')](),controller[_0xad83('0x17')]);router[_0xad83('0x18')](_0xad83('0x19'),auth[_0xad83('0xb')](),controller[_0xad83('0x1a')]);router[_0xad83('0x1b')](_0xad83('0x19'),auth[_0xad83('0xb')](),controller[_0xad83('0x1c')]);router[_0xad83('0x1b')](_0xad83('0x10'),auth[_0xad83('0xb')](),controller[_0xad83('0x1d')]);router['delete'](_0xad83('0x11'),auth[_0xad83('0xb')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0x0ab2=['./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id','getSections','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addResources','update','delete','destroy','removeSections','removeResources','exports','path','express','Router','../../components/interaction/service'];(function(_0x4314a8,_0x125608){var _0x30290b=function(_0x2519cd){while(--_0x2519cd){_0x4314a8['push'](_0x4314a8['shift']());}};_0x30290b(++_0x125608);}(_0x0ab2,0x92));var _0x20ab=function(_0x79aa12,_0x23aa17){_0x79aa12=_0x79aa12-0x0;var _0x4b7ba0=_0x0ab2[_0x79aa12];return _0x4b7ba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x20ab('0x0'));var timeout=require('connect-timeout');var express=require(_0x20ab('0x1'));var router=express[_0x20ab('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x20ab('0x3'));var config=require('../../config/environment');var controller=require(_0x20ab('0x4'));router['get']('/',auth[_0x20ab('0x5')](),controller[_0x20ab('0x6')]);router[_0x20ab('0x7')](_0x20ab('0x8'),auth[_0x20ab('0x5')](),controller[_0x20ab('0x9')]);router[_0x20ab('0x7')](_0x20ab('0xa'),auth[_0x20ab('0x5')](),controller['show']);router['get']('/:id/sections',auth['isAuthenticated'](),controller[_0x20ab('0xb')]);router[_0x20ab('0x7')](_0x20ab('0xc'),auth[_0x20ab('0x5')](),controller['getResources']);router[_0x20ab('0xd')]('/',auth['isAuthenticated'](),controller[_0x20ab('0xe')]);router['post'](_0x20ab('0xf'),auth['isAuthenticated'](),controller[_0x20ab('0x10')]);router[_0x20ab('0xd')](_0x20ab('0x11'),auth[_0x20ab('0x5')](),controller['addSections']);router[_0x20ab('0xd')](_0x20ab('0xc'),auth[_0x20ab('0x5')](),controller[_0x20ab('0x12')]);router['put'](_0x20ab('0xa'),auth[_0x20ab('0x5')](),controller[_0x20ab('0x13')]);router[_0x20ab('0x14')]('/:id',auth[_0x20ab('0x5')](),controller[_0x20ab('0x15')]);router[_0x20ab('0x14')](_0x20ab('0x11'),auth[_0x20ab('0x5')](),controller[_0x20ab('0x16')]);router['delete']('/:id/resources',auth[_0x20ab('0x5')](),controller[_0x20ab('0x17')]);module[_0x20ab('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a420820..37e3c86 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 _0xada8=['name','setDataValue','join','crudPermissions','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xada8,0xe7));var _0x8ada=function(_0x389b89,_0x6bc558){_0x389b89=_0x389b89-0x0;var _0x52e96a=_0xada8[_0x389b89];return _0x52e96a;};'use strict';var Sequelize=require(_0x8ada('0x0'));module[_0x8ada('0x1')]={'name':{'type':Sequelize[_0x8ada('0x2')],'allowNull':![],'unique':_0x8ada('0x3')},'crudPermissions':{'type':Sequelize[_0x8ada('0x2')],'set':function(_0x544e7f){this[_0x8ada('0x4')]('crudPermissions',_0x544e7f?_0x544e7f[_0x8ada('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x8ada('0x6'))?this['getDataValue'](_0x8ada('0x6'))[_0x8ada('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8ada('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8ada('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x82f2=['name','crudPermissions','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x57461f,_0x1a00f3){var _0x9c4b9e=function(_0x3bff4e){while(--_0x3bff4e){_0x57461f['push'](_0x57461f['shift']());}};_0x9c4b9e(++_0x1a00f3);}(_0x82f2,0xad));var _0x282f=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x82f2[_0x1762b4];return _0x29beda;};'use strict';var Sequelize=require('sequelize');module[_0x282f('0x0')]={'name':{'type':Sequelize[_0x282f('0x1')],'allowNull':![],'unique':_0x282f('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x20907f){this['setDataValue'](_0x282f('0x3'),_0x20907f?_0x20907f['join'](''):[]);},'get':function(){return this[_0x282f('0x4')](_0x282f('0x3'))?this[_0x282f('0x4')](_0x282f('0x3'))[_0x282f('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x282f('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x282f('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x282f('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x282f('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x282f('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x282f('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x282f('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 b57ef59..72b1307 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 _0x7b77=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','describe','each','push','ids','getSections','includes','isEmpty','subsections','enabled','forEach','resourceId','Plugin','addResources','userProfileId','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','status','json','undefined','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfile','rawAttributes','type','key','model','keys','query','intersection','attributes','fields'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7b77,0x179));var _0x77b7=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0x7b77[_0xd511d];return _0x3f148e;};'use strict';var emlformat=require(_0x77b7('0x0'));var rimraf=require(_0x77b7('0x1'));var zipdir=require(_0x77b7('0x2'));var jsonpatch=require(_0x77b7('0x3'));var rp=require('request-promise');var moment=require(_0x77b7('0x4'));var BPromise=require(_0x77b7('0x5'));var Mustache=require(_0x77b7('0x6'));var util=require('util');var path=require(_0x77b7('0x7'));var sox=require(_0x77b7('0x8'));var csv=require(_0x77b7('0x9'));var ejs=require(_0x77b7('0xa'));var fs=require('fs');var fs_extra=require(_0x77b7('0xb'));var _=require(_0x77b7('0xc'));var squel=require('squel');var crypto=require(_0x77b7('0xd'));var jsforce=require(_0x77b7('0xe'));var deskjs=require(_0x77b7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x77b7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x77b7('0x11'));var as=require(_0x77b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x77b7('0x13'))(_0x77b7('0x14'));var utils=require(_0x77b7('0x15'));var config=require(_0x77b7('0x16'));var licenseUtil=require(_0x77b7('0x17'));var db=require(_0x77b7('0x18'))['db'];config[_0x77b7('0x19')]=_['defaults'](config[_0x77b7('0x19')],{'host':_0x77b7('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x77b7('0x1b')](socket);function respondWithStatusCode(_0x3ff53e,_0x2ab6d7){_0x2ab6d7=_0x2ab6d7||0xcc;return function(_0x33b713){if(_0x33b713){return _0x3ff53e[_0x77b7('0x1c')](_0x2ab6d7);}return _0x3ff53e[_0x77b7('0x1d')](_0x2ab6d7)['end']();};}function respondWithResult(_0x19d460,_0x253543){_0x253543=_0x253543||0xc8;return function(_0x3cb44b){if(_0x3cb44b){return _0x19d460[_0x77b7('0x1d')](_0x253543)[_0x77b7('0x1e')](_0x3cb44b);}};}function respondWithFilteredResult(_0x25f361,_0x1b1910){return function(_0x12caf0){if(_0x12caf0){var _0x286046=typeof _0x1b1910['offset']==='undefined'&&typeof _0x1b1910['limit']===_0x77b7('0x1f');var _0x5eff52=_0x12caf0['count'];var _0x52983f=_0x286046?0x0:_0x1b1910['offset'];var _0x3e16d6=_0x286046?_0x12caf0['count']:_0x1b1910[_0x77b7('0x20')]+_0x1b1910['limit'];var _0x2107d7;if(_0x3e16d6>=_0x5eff52){_0x3e16d6=_0x5eff52;_0x2107d7=0xc8;}else{_0x2107d7=0xce;}_0x25f361['status'](_0x2107d7);return _0x25f361[_0x77b7('0x21')]('Content-Range',_0x52983f+'-'+_0x3e16d6+'/'+_0x5eff52)[_0x77b7('0x1e')](_0x12caf0);}return null;};}function patchUpdates(_0x1bdcdf){return function(_0xbe2efc){try{jsonpatch[_0x77b7('0x22')](_0xbe2efc,_0x1bdcdf,!![]);}catch(_0x289463){return BPromise[_0x77b7('0x23')](_0x289463);}return _0xbe2efc[_0x77b7('0x24')]();};}function saveUpdates(_0x69c147,_0x39d097){return function(_0x32551a){if(_0x32551a){return _0x32551a[_0x77b7('0x25')](_0x69c147)[_0x77b7('0x26')](function(_0x29c2aa){return _0x29c2aa;});}return null;};}function removeEntity(_0x320a62,_0x43ff37){return function(_0x359b23){if(_0x359b23){return _0x359b23[_0x77b7('0x27')]()[_0x77b7('0x26')](function(){_0x320a62['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38a988,_0x22c56d){return function(_0x3cae5a){if(!_0x3cae5a){_0x38a988['sendStatus'](0x194);}return _0x3cae5a;};}function handleError(_0x1e10a0,_0x3f18f7){_0x3f18f7=_0x3f18f7||0x1f4;return function(_0x20de87){logger[_0x77b7('0x28')](_0x20de87[_0x77b7('0x29')]);if(_0x20de87[_0x77b7('0x2a')]){delete _0x20de87[_0x77b7('0x2a')];}_0x1e10a0[_0x77b7('0x1d')](_0x3f18f7)[_0x77b7('0x2b')](_0x20de87);};}exports['index']=function(_0x2afbf5,_0x25335b){var _0x23aa7e={},_0x3f21dd={},_0x2e87e6={'count':0x0,'rows':[]};var _0x3f63a=_[_0x77b7('0x2c')](db[_0x77b7('0x2d')][_0x77b7('0x2e')],function(_0x3119f6){return{'name':_0x3119f6['fieldName'],'type':_0x3119f6[_0x77b7('0x2f')][_0x77b7('0x30')]};});_0x3f21dd[_0x77b7('0x31')]=_['map'](_0x3f63a,_0x77b7('0x2a'));_0x3f21dd['query']=_[_0x77b7('0x32')](_0x2afbf5[_0x77b7('0x33')]);_0x3f21dd['filters']=_[_0x77b7('0x34')](_0x3f21dd['model'],_0x3f21dd[_0x77b7('0x33')]);_0x23aa7e[_0x77b7('0x35')]=_[_0x77b7('0x34')](_0x3f21dd['model'],qs[_0x77b7('0x36')](_0x2afbf5[_0x77b7('0x33')][_0x77b7('0x36')]));_0x23aa7e[_0x77b7('0x35')]=_0x23aa7e[_0x77b7('0x35')][_0x77b7('0x37')]?_0x23aa7e[_0x77b7('0x35')]:_0x3f21dd[_0x77b7('0x31')];if(!_0x2afbf5[_0x77b7('0x33')][_0x77b7('0x38')](_0x77b7('0x39'))){_0x23aa7e[_0x77b7('0x3a')]=qs[_0x77b7('0x3a')](_0x2afbf5['query'][_0x77b7('0x3a')]);_0x23aa7e[_0x77b7('0x20')]=qs[_0x77b7('0x20')](_0x2afbf5['query']['offset']);}_0x23aa7e[_0x77b7('0x3b')]=qs[_0x77b7('0x3c')](_0x2afbf5[_0x77b7('0x33')][_0x77b7('0x3c')]);_0x23aa7e[_0x77b7('0x3d')]=qs[_0x77b7('0x3e')](_[_0x77b7('0x3f')](_0x2afbf5[_0x77b7('0x33')],_0x3f21dd[_0x77b7('0x3e')]),_0x3f63a);if(_0x2afbf5[_0x77b7('0x33')][_0x77b7('0x40')]){_0x23aa7e[_0x77b7('0x3d')]=_[_0x77b7('0x41')](_0x23aa7e[_0x77b7('0x3d')],{'$or':_[_0x77b7('0x2c')](_0x3f63a,function(_0x47380c){if(_0x47380c[_0x77b7('0x2f')]!==_0x77b7('0x42')){var _0x28ad61={};_0x28ad61[_0x47380c[_0x77b7('0x2a')]]={'$like':'%'+_0x2afbf5[_0x77b7('0x33')]['filter']+'%'};return _0x28ad61;}})});}_0x23aa7e=_[_0x77b7('0x41')]({},_0x23aa7e,_0x2afbf5[_0x77b7('0x43')]);var _0x518b16={'where':_0x23aa7e[_0x77b7('0x3d')]};return db['UserProfile'][_0x77b7('0x44')](_0x518b16)[_0x77b7('0x26')](function(_0x5a2918){_0x2e87e6[_0x77b7('0x44')]=_0x5a2918;if(_0x2afbf5['query']['includeAll']){_0x23aa7e[_0x77b7('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x77b7('0x46')](_0x23aa7e);})['then'](function(_0x20bf51){_0x2e87e6[_0x77b7('0x47')]=_0x20bf51;return _0x2e87e6;})[_0x77b7('0x26')](respondWithFilteredResult(_0x25335b,_0x23aa7e))[_0x77b7('0x48')](handleError(_0x25335b,null));};exports[_0x77b7('0x49')]=function(_0x47019a,_0x56e827){var _0x21ef70={'raw':![],'where':{'id':_0x47019a[_0x77b7('0x4a')]['id']}},_0x36407b={};_0x36407b[_0x77b7('0x31')]=_[_0x77b7('0x32')](db[_0x77b7('0x2d')][_0x77b7('0x2e')]);_0x36407b[_0x77b7('0x33')]=_['keys'](_0x47019a[_0x77b7('0x33')]);_0x36407b['filters']=_[_0x77b7('0x34')](_0x36407b['model'],_0x36407b[_0x77b7('0x33')]);_0x21ef70[_0x77b7('0x35')]=_[_0x77b7('0x34')](_0x36407b[_0x77b7('0x31')],qs[_0x77b7('0x36')](_0x47019a[_0x77b7('0x33')][_0x77b7('0x36')]));_0x21ef70['attributes']=_0x21ef70[_0x77b7('0x35')][_0x77b7('0x37')]?_0x21ef70['attributes']:_0x36407b['model'];if(_0x47019a[_0x77b7('0x33')]['includeAll']){_0x21ef70[_0x77b7('0x45')]=[{'all':!![]}];}_0x21ef70=_[_0x77b7('0x41')]({},_0x21ef70,_0x47019a[_0x77b7('0x43')]);return db[_0x77b7('0x2d')][_0x77b7('0x4b')](_0x21ef70)[_0x77b7('0x26')](handleEntityNotFound(_0x56e827,null))[_0x77b7('0x26')](respondWithResult(_0x56e827,null))[_0x77b7('0x48')](handleError(_0x56e827,null));};exports[_0x77b7('0x4c')]=function(_0x334004,_0x328b06){return db[_0x77b7('0x2d')][_0x77b7('0x4c')](_0x334004[_0x77b7('0x4d')],{})[_0x77b7('0x26')](respondWithResult(_0x328b06,0xc9))['catch'](handleError(_0x328b06,null));};exports[_0x77b7('0x4e')]=function(_0x59a29d,_0x2da729){var _0x4ffde2={'where':{'id':_0x59a29d[_0x77b7('0x4a')]['id']}},_0x37ba6b={};_0x37ba6b[_0x77b7('0x31')]=_[_0x77b7('0x32')](db['UserProfile'][_0x77b7('0x2e')]);_0x4ffde2['attributes']=_[_0x77b7('0x34')](_0x37ba6b[_0x77b7('0x31')],qs['fields'](_0x59a29d['query']['fields']));_0x4ffde2[_0x77b7('0x35')]=_0x4ffde2['attributes'][_0x77b7('0x37')]?_0x4ffde2[_0x77b7('0x35')]:_0x37ba6b[_0x77b7('0x31')];if(_0x59a29d[_0x77b7('0x33')]['includeAll']){_0x4ffde2[_0x77b7('0x45')]=[{'all':!![]}];}_0x4ffde2=_[_0x77b7('0x41')]({},_0x4ffde2,_0x59a29d[_0x77b7('0x43')]);return db[_0x77b7('0x2d')]['find'](_0x4ffde2)[_0x77b7('0x26')](handleEntityNotFound(_0x2da729,null))[_0x77b7('0x26')](function(_0x55870a){if(_0x55870a){var _0x7a0214=_0x55870a[_0x77b7('0x4f')]({'plain':!![]});_0x7a0214=qs[_0x77b7('0x50')](_0x7a0214,['id',_0x77b7('0x51'),_0x77b7('0x52'),_0x77b7('0x53')]);_0x59a29d[_0x77b7('0x4d')]=_['omit'](_0x59a29d[_0x77b7('0x4d')],['id',_0x77b7('0x51'),'updatedAt']);return db[_0x77b7('0x54')][_0x77b7('0x55')](function(_0x102a52){return db[_0x77b7('0x2d')]['create'](_['merge'](_0x7a0214,_0x59a29d[_0x77b7('0x4d')]),{'include':_0x59a29d[_0x77b7('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x102a52})['then'](function(_0x2f89ed){var _0x97ff42=_0x2f89ed[_0x77b7('0x4f')]({'plain':!![]});return db[_0x77b7('0x56')][_0x77b7('0x46')]({'where':{'userProfileId':_0x59a29d[_0x77b7('0x4a')]['id']},'raw':!![]})[_0x77b7('0x26')](function(_0x42e266){if(_0x42e266){return BPromise['each'](_0x42e266,function(_0x5aa315){return new BPromise(function(_0x1e2a0f,_0xb4bfdd){if(_0x5aa315[_0x77b7('0x57')]===null||_0x5aa315[_0x77b7('0x57')]===0x1)_0x1e2a0f(null);return db[_0x77b7('0x58')]['findAll']({'where':{'sectionId':_0x5aa315['id']},'raw':!![]})['then'](function(_0x642f7a){var _0x1323fc=_['map'](_0x642f7a,function(_0x2a9c4a){return qs['omit'](_0x2a9c4a,['id',_0x77b7('0x51'),_0x77b7('0x52'),_0x77b7('0x59')]);});_0x1e2a0f(_0x1323fc);})[_0x77b7('0x48')](function(_0x136fb5){_0xb4bfdd(_0x136fb5);});})[_0x77b7('0x26')](function(_0x325208){var _0x1f590e=qs[_0x77b7('0x50')](_0x5aa315,['id',_0x77b7('0x51'),_0x77b7('0x52')]);_0x1f590e['userProfileId']=_0x97ff42['id'];if(_0x325208)_0x1f590e[_0x77b7('0x5a')]=_0x325208;return _0x1f590e;})[_0x77b7('0x26')](function(_0x2c8edf){return db[_0x77b7('0x56')][_0x77b7('0x4c')](_0x2c8edf,{'include':[{'model':db[_0x77b7('0x58')],'as':_0x77b7('0x5a')}],'raw':!![],'transaction':_0x102a52});});})['then'](function(){return _0x97ff42;});}});});});}})[_0x77b7('0x26')](respondWithResult(_0x2da729,0xc9))[_0x77b7('0x48')](handleError(_0x2da729,null));};exports[_0x77b7('0x25')]=function(_0x3843d4,_0x421ddf){if(_0x3843d4[_0x77b7('0x4d')]['id']){delete _0x3843d4[_0x77b7('0x4d')]['id'];}return db[_0x77b7('0x2d')][_0x77b7('0x4b')]({'where':{'id':_0x3843d4[_0x77b7('0x4a')]['id']}})[_0x77b7('0x26')](handleEntityNotFound(_0x421ddf,null))[_0x77b7('0x26')](saveUpdates(_0x3843d4[_0x77b7('0x4d')],null))[_0x77b7('0x26')](respondWithResult(_0x421ddf,null))[_0x77b7('0x48')](handleError(_0x421ddf,null));};exports[_0x77b7('0x27')]=function(_0xd0b9a5,_0x8d8a48){return db[_0x77b7('0x2d')][_0x77b7('0x4b')]({'where':{'id':_0xd0b9a5['params']['id']}})['then'](handleEntityNotFound(_0x8d8a48,null))[_0x77b7('0x26')](removeEntity(_0x8d8a48,null))[_0x77b7('0x48')](handleError(_0x8d8a48,null));};exports[_0x77b7('0x5b')]=function(_0x8b52b2,_0x2aac2e){return db[_0x77b7('0x2d')][_0x77b7('0x5b')]()['then'](respondWithResult(_0x2aac2e,null))[_0x77b7('0x48')](handleError(_0x2aac2e,null));};exports['addSections']=function(_0x1fe9b0,_0xd55cb4){var _0x2d1706=_0x1fe9b0[_0x77b7('0x4d')];return db[_0x77b7('0x2d')]['find']({'where':{'id':_0x1fe9b0[_0x77b7('0x4a')]['id']}})[_0x77b7('0x26')](handleEntityNotFound(_0xd55cb4,null))['then'](function(_0x30ba6d){if(_0x30ba6d){return db[_0x77b7('0x54')]['transaction'](function(_0x5c2302){return db[_0x77b7('0x56')]['destroy']({'where':{'userProfileId':_0x1fe9b0[_0x77b7('0x4a')]['id'],'sectionId':_['map'](_0x2d1706,function(_0x5a367a){return _0x5a367a[_0x77b7('0x59')];})},'transaction':_0x5c2302})[_0x77b7('0x26')](function(){var _0x123885=_['map'](_0x2d1706,function(_0x12ad69){_0x12ad69['userProfileId']=_0x1fe9b0[_0x77b7('0x4a')]['id'];return _0x12ad69;});var _0x2122dd=[];return BPromise[_0x77b7('0x5c')](_0x123885,function(_0x131cc3){return db['UserProfileSection']['create'](_0x131cc3,{'include':[{'model':db[_0x77b7('0x58')],'as':_0x77b7('0x5a')}],'raw':!![],'transaction':_0x5c2302})[_0x77b7('0x26')](function(_0x2b32c7){_0x2122dd[_0x77b7('0x5d')](_0x2b32c7[_0x77b7('0x4f')]({'plain':!![]}));});})[_0x77b7('0x26')](function(){return _0x2122dd;});});});}})[_0x77b7('0x26')](function(_0x2f43ab){return _0x2f43ab;})[_0x77b7('0x26')](respondWithResult(_0xd55cb4,null))[_0x77b7('0x48')](handleError(_0xd55cb4,null));};exports['removeSections']=function(_0xd45e15,_0x5bca0e){var _0x48ce5b;return db['UserProfile']['find']({'where':{'id':_0xd45e15[_0x77b7('0x4a')]['id']},'attributes':['id',_0x77b7('0x2a')]})[_0x77b7('0x26')](handleEntityNotFound(_0x5bca0e,null))[_0x77b7('0x26')](function(_0x3632b5){if(_0x3632b5){_0x48ce5b=_0x3632b5;return db[_0x77b7('0x56')][_0x77b7('0x27')]({'where':{'userProfileId':_0xd45e15['params']['id'],'sectionId':_0xd45e15['query'][_0x77b7('0x5e')]}});}})[_0x77b7('0x26')](function(){return _0x48ce5b;})[_0x77b7('0x26')](respondWithStatusCode(_0x5bca0e,null))[_0x77b7('0x48')](handleError(_0x5bca0e,null));};exports[_0x77b7('0x5f')]=function(_0x2cb15f,_0x1d5816){var _0x33fff0=[];var _0x7c3d57=[];return db[_0x77b7('0x56')]['findAll']({'where':{'userProfileId':_0x2cb15f[_0x77b7('0x4a')]['id']},'raw':!![]})[_0x77b7('0x26')](function(_0x1380de){_0x33fff0=_[_0x77b7('0x40')](_0x1380de,function(_0x26de0c){return _0x26de0c['enabled']===0x1||_[_0x77b7('0x60')]([0x3eb,0x709],_0x26de0c[_0x77b7('0x59')]);});if(!_[_0x77b7('0x61')](_0x33fff0)){return _['map'](_0x33fff0,function(_0x4fd6ce){return _0x4fd6ce[_0x77b7('0x59')];});}else{return;}})['then'](function(_0x2ea612){if(_0x2ea612)_0x7c3d57=_0x2ea612;if(_[_0x77b7('0x60')](_0x7c3d57,0x64)){var _0x5473f1=_['find'](_0x33fff0,{'sectionId':0x64});return hasDefaultDashboard(_0x5473f1)['then'](function(_0x55226c){return _[_0x77b7('0x2c')](_0x33fff0,function(_0x1e6538){if(_0x1e6538['sectionId']===0x64){_0x1e6538[_0x77b7('0x62')]=_0x55226c;}return _0x1e6538;});});}else{return;}})['then'](function(_0x5d5827){if(_0x5d5827)_0x33fff0=_0x5d5827;if(_[_0x77b7('0x60')](_0x7c3d57,0x3eb)){var _0x56dc2a=_[_0x77b7('0x4b')](_0x33fff0,{'sectionId':0x3eb});return getCustomDashboards(_0x56dc2a)['then'](function(_0x55ad5d){return _[_0x77b7('0x2c')](_0x33fff0,function(_0xb6e933){if(_0x56dc2a[_0x77b7('0x63')]){if(_0xb6e933[_0x77b7('0x59')]===0x3eb){_0xb6e933['subsections']=_0x55ad5d;}}else{if(_0xb6e933['sectionId']===0x64){_0xb6e933['subsections']=_0x55ad5d;}}return _0xb6e933;});});}else{return;}})[_0x77b7('0x26')](function(_0x747001){if(_0x747001)_0x33fff0=_0x747001;if(_[_0x77b7('0x60')](_0x7c3d57,0x709)){var _0x2b4cb2=_[_0x77b7('0x4b')](_0x33fff0,{'sectionId':0x709});return getPlugins(_0x2b4cb2)[_0x77b7('0x26')](function(_0x1e388a){if(_0x2b4cb2[_0x77b7('0x63')]){return _[_0x77b7('0x2c')](_0x33fff0,function(_0x94bea0){if(_0x94bea0['sectionId']===0x709){_0x94bea0['subsections']=_0x1e388a;}return _0x94bea0;});}else{var _0x312fe7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1e388a};var _0x342ea8=_[_0x77b7('0x2c')](_0x33fff0);_0x342ea8[_0x77b7('0x5d')](_0x312fe7);return _0x342ea8;}});}else{return;}})[_0x77b7('0x26')](function(_0x411810){if(_0x411810)_0x33fff0=_0x411810;return _[_0x77b7('0x40')](_0x33fff0,[_0x77b7('0x63'),0x1]);})[_0x77b7('0x26')](respondWithResult(_0x1d5816,null))[_0x77b7('0x48')](handleError(_0x1d5816,null));};function hasDefaultDashboard(_0x48bcd7){var _0x11d7cc=[0x65];return new BPromise(function(_0x1de38d,_0x541a90){try{if(_0x48bcd7[_0x77b7('0x57')]){_0x1de38d(_0x11d7cc);}else{return db[_0x77b7('0x58')]['findOne']({'where':{'sectionId':_0x48bcd7['id']},'raw':!![]})[_0x77b7('0x26')](function(_0x4ba5bd){_0x4ba5bd?_0x1de38d(_0x11d7cc):_0x1de38d();});}}catch(_0x183514){_0x541a90(_0x183514);}});}function getCustomDashboards(_0x3602b6){var _0x22cdf4=[];return new BPromise(function(_0x2fe679,_0x5ed358){try{if(_0x3602b6[_0x77b7('0x57')]){return db['Dashboard'][_0x77b7('0x46')]({'raw':!![]})[_0x77b7('0x26')](function(_0x7c7d65){_0x7c7d65[_0x77b7('0x64')](function(_0x34417f){_0x22cdf4[_0x77b7('0x5d')](_0x34417f['id']+0x1869f);});_0x2fe679(_0x22cdf4);});}else{return db[_0x77b7('0x58')][_0x77b7('0x46')]({'where':{'sectionId':_0x3602b6['id']},'raw':!![]})[_0x77b7('0x26')](function(_0x5d7b12){_0x5d7b12[_0x77b7('0x64')](function(_0x326b13){_0x22cdf4[_0x77b7('0x5d')](_0x326b13[_0x77b7('0x65')]+0x1869f);});_0x2fe679(_0x22cdf4);});}}catch(_0x1fb696){_0x5ed358(_0x1fb696);}});}function getPlugins(_0x450778){var _0x4e5883=[];return new BPromise(function(_0x58415f,_0x2f2c61){try{if(_0x450778[_0x77b7('0x57')]){return db[_0x77b7('0x66')]['findAll']({'raw':!![]})[_0x77b7('0x26')](function(_0x5cccd9){_0x5cccd9[_0x77b7('0x64')](function(_0x23cbe4){_0x4e5883[_0x77b7('0x5d')](_0x23cbe4['id']+0x15b38);});_0x58415f(_0x4e5883);});}else{return db[_0x77b7('0x58')][_0x77b7('0x46')]({'where':{'sectionId':_0x450778['id']},'raw':!![]})['then'](function(_0x389f7e){_0x389f7e['forEach'](function(_0x2a489d){_0x4e5883[_0x77b7('0x5d')](_0x2a489d[_0x77b7('0x65')]+0x15b38);});_0x58415f(_0x4e5883);});}}catch(_0x2558fd){_0x2f2c61(_0x2558fd);}});}exports[_0x77b7('0x67')]=function(_0x15d8b1,_0x4f6605){return db[_0x77b7('0x2d')]['find']({'where':{'id':_0x15d8b1[_0x77b7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f6605,null))[_0x77b7('0x26')](function(_0x4ef089){if(_0x4ef089){return db[_0x77b7('0x54')]['transaction'](function(_0xeb67c7){return db['UserProfileSection'][_0x77b7('0x46')]({'where':{'userProfileId':_0x15d8b1[_0x77b7('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x77b7('0x26')](function(_0x47ea75){if(_0x47ea75){return db[_0x77b7('0x56')][_0x77b7('0x27')]({'where':{'userProfileId':_0x15d8b1[_0x77b7('0x4a')]['id'],'id':_[_0x77b7('0x2c')](_0x47ea75,function(_0x58f41e){return _0x58f41e['id'];})},'transaction':_0xeb67c7});}})[_0x77b7('0x26')](function(_0x290314){var _0x163f99=_['map'](_0x15d8b1[_0x77b7('0x4d')],function(_0x42ae2c){_0x42ae2c[_0x77b7('0x68')]=_0x15d8b1[_0x77b7('0x4a')]['id'];return _0x42ae2c;});return db[_0x77b7('0x56')]['bulkCreate'](_0x163f99,{'raw':!![],'transaction':_0xeb67c7});})[_0x77b7('0x26')](function(_0x26a480){var _0x324fd3=_[_0x77b7('0x40')](_[_0x77b7('0x2c')](_0x26a480,function(_0x194513){return _0x194513['get']({'plain':!![]});}),{'includeAll':![]});if(_0x324fd3){return db[_0x77b7('0x56')][_0x77b7('0x46')]({'where':{'userProfileId':_0x15d8b1[_0x77b7('0x4a')]['id'],'sectionId':_['map'](_0x324fd3,function(_0x2faaf7){return _0x2faaf7['sectionId'];})},'attributes':['id',_0x77b7('0x59')],'raw':!![]})[_0x77b7('0x26')](function(_0x1c3ae6){var _0x4866ac=_[_0x77b7('0x2c')](_0x15d8b1[_0x77b7('0x4d')],function(_0x18006e){_0x18006e['userProfileId']=_0x15d8b1[_0x77b7('0x4a')]['id'];return _0x18006e;});return db['UserProfileResource']['bulkCreate'](_0x4866ac,{'raw':!![],'transaction':_0xeb67c7});});}})['catch'](handleError(_0x4f6605,null));});}})['then'](function(_0x29c73d){var _0x6d9991=_[_0x77b7('0x2c')](_0x29c73d,function(_0x166915){return _0x166915[_0x77b7('0x4f')]({'plain':!![]});});})[_0x77b7('0x26')](respondWithResult(_0x4f6605,null))[_0x77b7('0x48')](handleError(_0x4f6605,null));};exports['removeResources']=function(_0x3848bb,_0x479b92,_0xab3a2d){return db[_0x77b7('0x2d')][_0x77b7('0x4b')]({'where':{'id':_0x3848bb['params']['id']}})['then'](handleEntityNotFound(_0x479b92,null))[_0x77b7('0x26')](function(_0x5b8e22){if(_0x5b8e22){return _0x5b8e22['removeResources'](_0x3848bb[_0x77b7('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x479b92,null))[_0x77b7('0x48')](handleError(_0x479b92,null));};exports[_0x77b7('0x69')]=function(_0x16fdb7,_0x5f489c){var _0x183338={};if(!_0x16fdb7[_0x77b7('0x33')]['section'])throw new Error(_0x77b7('0x6a'));if(!_0x16fdb7[_0x77b7('0x33')][_0x77b7('0x38')](_0x77b7('0x39'))){_0x183338[_0x77b7('0x3a')]=qs['limit'](_0x16fdb7[_0x77b7('0x33')][_0x77b7('0x3a')]);_0x183338['offset']=qs[_0x77b7('0x20')](_0x16fdb7['query'][_0x77b7('0x20')]);}return db[_0x77b7('0x2d')][_0x77b7('0x4b')]({'where':{'id':_0x16fdb7[_0x77b7('0x4a')]['id']}})[_0x77b7('0x26')](function(_0x52be83){if(!_0x52be83)throw new Error(_0x77b7('0x6b')+_0x16fdb7['params']['id']);return db[_0x77b7('0x2d')][_0x77b7('0x69')](_0x16fdb7);})[_0x77b7('0x26')](respondWithFilteredResult(_0x5f489c,_0x183338))[_0x77b7('0x48')](handleError(_0x5f489c,null));}; \ No newline at end of file +var _0x1219=['omit','Resources','UserProfileSection','describe','addSections','sequelize','sectionId','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','resourceId','Plugin','forEach','userProfileId','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','map','UserProfile','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','keys','include','find','create','body','clone','params','rawAttributes','get','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1219,0x17c));var _0x9121=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1219[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9121('0x0'));var rimraf=require(_0x9121('0x1'));var zipdir=require(_0x9121('0x2'));var jsonpatch=require(_0x9121('0x3'));var rp=require(_0x9121('0x4'));var moment=require('moment');var BPromise=require(_0x9121('0x5'));var Mustache=require('mustache');var util=require(_0x9121('0x6'));var path=require(_0x9121('0x7'));var sox=require(_0x9121('0x8'));var csv=require(_0x9121('0x9'));var ejs=require(_0x9121('0xa'));var fs=require('fs');var fs_extra=require(_0x9121('0xb'));var _=require(_0x9121('0xc'));var squel=require(_0x9121('0xd'));var crypto=require(_0x9121('0xe'));var jsforce=require(_0x9121('0xf'));var deskjs=require(_0x9121('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9121('0x11'));var Papa=require(_0x9121('0x12'));var Redis=require(_0x9121('0x13'));var authService=require(_0x9121('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9121('0x15'));var hardwareService=require(_0x9121('0x16'));var logger=require(_0x9121('0x17'))(_0x9121('0x18'));var utils=require(_0x9121('0x19'));var config=require(_0x9121('0x1a'));var licenseUtil=require(_0x9121('0x1b'));var db=require(_0x9121('0x1c'))['db'];config[_0x9121('0x1d')]=_[_0x9121('0x1e')](config[_0x9121('0x1d')],{'host':_0x9121('0x1f'),'port':0x18eb});var socket=require(_0x9121('0x20'))(new Redis(config[_0x9121('0x1d')]));require(_0x9121('0x21'))['register'](socket);function respondWithStatusCode(_0x106fe1,_0x1cd06f){_0x1cd06f=_0x1cd06f||0xcc;return function(_0xa59bd9){if(_0xa59bd9){return _0x106fe1[_0x9121('0x22')](_0x1cd06f);}return _0x106fe1[_0x9121('0x23')](_0x1cd06f)[_0x9121('0x24')]();};}function respondWithResult(_0x49c6aa,_0x5994f1){_0x5994f1=_0x5994f1||0xc8;return function(_0x21551c){if(_0x21551c){return _0x49c6aa[_0x9121('0x23')](_0x5994f1)[_0x9121('0x25')](_0x21551c);}};}function respondWithFilteredResult(_0xb8873a,_0x50fa49){return function(_0x5bc064){if(_0x5bc064){var _0xd91482=typeof _0x50fa49[_0x9121('0x26')]==='undefined'&&typeof _0x50fa49[_0x9121('0x27')]===_0x9121('0x28');var _0x88b2e4=_0x5bc064[_0x9121('0x29')];var _0x49e516=_0xd91482?0x0:_0x50fa49[_0x9121('0x26')];var _0x49c910=_0xd91482?_0x5bc064[_0x9121('0x29')]:_0x50fa49[_0x9121('0x26')]+_0x50fa49[_0x9121('0x27')];var _0x1e1d2a;if(_0x49c910>=_0x88b2e4){_0x49c910=_0x88b2e4;_0x1e1d2a=0xc8;}else{_0x1e1d2a=0xce;}_0xb8873a[_0x9121('0x23')](_0x1e1d2a);return _0xb8873a[_0x9121('0x2a')]('Content-Range',_0x49e516+'-'+_0x49c910+'/'+_0x88b2e4)[_0x9121('0x25')](_0x5bc064);}return null;};}function patchUpdates(_0xefb0a5){return function(_0x19479a){try{jsonpatch[_0x9121('0x2b')](_0x19479a,_0xefb0a5,!![]);}catch(_0x5a6cd1){return BPromise['reject'](_0x5a6cd1);}return _0x19479a[_0x9121('0x2c')]();};}function saveUpdates(_0x29b864,_0x12ffb3){return function(_0x5d3ed2){if(_0x5d3ed2){return _0x5d3ed2[_0x9121('0x2d')](_0x29b864)[_0x9121('0x2e')](function(_0x59b142){return _0x59b142;});}return null;};}function removeEntity(_0x31f5ff,_0x449317){return function(_0x405d45){if(_0x405d45){return _0x405d45[_0x9121('0x2f')]()[_0x9121('0x2e')](function(){_0x31f5ff[_0x9121('0x23')](0xcc)[_0x9121('0x24')]();});}};}function handleEntityNotFound(_0x2b840c,_0x16326b){return function(_0x3f6f5f){if(!_0x3f6f5f){_0x2b840c[_0x9121('0x22')](0x194);}return _0x3f6f5f;};}function handleError(_0xc15261,_0x2a69e2){_0x2a69e2=_0x2a69e2||0x1f4;return function(_0x71b6cf){logger[_0x9121('0x30')](_0x71b6cf[_0x9121('0x31')]);if(_0x71b6cf[_0x9121('0x32')]){delete _0x71b6cf['name'];}_0xc15261['status'](_0x2a69e2)[_0x9121('0x33')](_0x71b6cf);};}exports['index']=function(_0x3b4144,_0x23b1ed){var _0x541ba2={},_0x473cd3={},_0xaa36ea={'count':0x0,'rows':[]};var _0xd38da=_[_0x9121('0x34')](db[_0x9121('0x35')]['rawAttributes'],function(_0x53e433){return{'name':_0x53e433['fieldName'],'type':_0x53e433[_0x9121('0x36')][_0x9121('0x37')]};});_0x473cd3['model']=_[_0x9121('0x34')](_0xd38da,_0x9121('0x32'));_0x473cd3[_0x9121('0x38')]=_['keys'](_0x3b4144[_0x9121('0x38')]);_0x473cd3[_0x9121('0x39')]=_[_0x9121('0x3a')](_0x473cd3[_0x9121('0x3b')],_0x473cd3[_0x9121('0x38')]);_0x541ba2[_0x9121('0x3c')]=_[_0x9121('0x3a')](_0x473cd3[_0x9121('0x3b')],qs[_0x9121('0x3d')](_0x3b4144[_0x9121('0x38')][_0x9121('0x3d')]));_0x541ba2['attributes']=_0x541ba2[_0x9121('0x3c')][_0x9121('0x3e')]?_0x541ba2[_0x9121('0x3c')]:_0x473cd3[_0x9121('0x3b')];if(!_0x3b4144[_0x9121('0x38')][_0x9121('0x3f')]('nolimit')){_0x541ba2['limit']=qs['limit'](_0x3b4144[_0x9121('0x38')][_0x9121('0x27')]);_0x541ba2[_0x9121('0x26')]=qs[_0x9121('0x26')](_0x3b4144['query']['offset']);}_0x541ba2[_0x9121('0x40')]=qs[_0x9121('0x41')](_0x3b4144[_0x9121('0x38')][_0x9121('0x41')]);_0x541ba2['where']=qs[_0x9121('0x39')](_[_0x9121('0x42')](_0x3b4144[_0x9121('0x38')],_0x473cd3['filters']),_0xd38da);if(_0x3b4144[_0x9121('0x38')][_0x9121('0x43')]){_0x541ba2[_0x9121('0x44')]=_['merge'](_0x541ba2[_0x9121('0x44')],{'$or':_['map'](_0xd38da,function(_0x2e8c48){if(_0x2e8c48[_0x9121('0x36')]!==_0x9121('0x45')){var _0x3432ae={};_0x3432ae[_0x2e8c48[_0x9121('0x32')]]={'$like':'%'+_0x3b4144[_0x9121('0x38')]['filter']+'%'};return _0x3432ae;}})});}_0x541ba2=_[_0x9121('0x46')]({},_0x541ba2,_0x3b4144[_0x9121('0x47')]);var _0x158cec={'where':_0x541ba2[_0x9121('0x44')]};return db['UserProfile'][_0x9121('0x29')](_0x158cec)['then'](function(_0x533628){_0xaa36ea[_0x9121('0x29')]=_0x533628;if(_0x3b4144['query'][_0x9121('0x48')]){_0x541ba2['include']=[{'all':!![]}];}return db['UserProfile'][_0x9121('0x49')](_0x541ba2);})['then'](function(_0x24e009){_0xaa36ea['rows']=_0x24e009;return _0xaa36ea;})[_0x9121('0x2e')](respondWithFilteredResult(_0x23b1ed,_0x541ba2))[_0x9121('0x4a')](handleError(_0x23b1ed,null));};exports[_0x9121('0x4b')]=function(_0x15c70a,_0x3c86c8){var _0x3c44e8={'raw':![],'where':{'id':_0x15c70a['params']['id']}},_0x4070ac={};_0x4070ac[_0x9121('0x3b')]=_[_0x9121('0x4c')](db[_0x9121('0x35')]['rawAttributes']);_0x4070ac[_0x9121('0x38')]=_[_0x9121('0x4c')](_0x15c70a[_0x9121('0x38')]);_0x4070ac[_0x9121('0x39')]=_[_0x9121('0x3a')](_0x4070ac[_0x9121('0x3b')],_0x4070ac[_0x9121('0x38')]);_0x3c44e8[_0x9121('0x3c')]=_[_0x9121('0x3a')](_0x4070ac['model'],qs[_0x9121('0x3d')](_0x15c70a[_0x9121('0x38')][_0x9121('0x3d')]));_0x3c44e8[_0x9121('0x3c')]=_0x3c44e8[_0x9121('0x3c')][_0x9121('0x3e')]?_0x3c44e8[_0x9121('0x3c')]:_0x4070ac[_0x9121('0x3b')];if(_0x15c70a[_0x9121('0x38')]['includeAll']){_0x3c44e8[_0x9121('0x4d')]=[{'all':!![]}];}_0x3c44e8=_[_0x9121('0x46')]({},_0x3c44e8,_0x15c70a[_0x9121('0x47')]);return db['UserProfile'][_0x9121('0x4e')](_0x3c44e8)[_0x9121('0x2e')](handleEntityNotFound(_0x3c86c8,null))[_0x9121('0x2e')](respondWithResult(_0x3c86c8,null))[_0x9121('0x4a')](handleError(_0x3c86c8,null));};exports[_0x9121('0x4f')]=function(_0x471de8,_0x31164a){return db[_0x9121('0x35')]['create'](_0x471de8[_0x9121('0x50')],{})[_0x9121('0x2e')](respondWithResult(_0x31164a,0xc9))['catch'](handleError(_0x31164a,null));};exports[_0x9121('0x51')]=function(_0x12edbf,_0x4c67cc){var _0x5c833b={'where':{'id':_0x12edbf[_0x9121('0x52')]['id']}},_0x5af6a5={};_0x5af6a5['model']=_[_0x9121('0x4c')](db[_0x9121('0x35')][_0x9121('0x53')]);_0x5c833b[_0x9121('0x3c')]=_['intersection'](_0x5af6a5[_0x9121('0x3b')],qs['fields'](_0x12edbf[_0x9121('0x38')][_0x9121('0x3d')]));_0x5c833b[_0x9121('0x3c')]=_0x5c833b[_0x9121('0x3c')][_0x9121('0x3e')]?_0x5c833b[_0x9121('0x3c')]:_0x5af6a5['model'];if(_0x12edbf['query']['includeAll']){_0x5c833b[_0x9121('0x4d')]=[{'all':!![]}];}_0x5c833b=_[_0x9121('0x46')]({},_0x5c833b,_0x12edbf[_0x9121('0x47')]);return db[_0x9121('0x35')][_0x9121('0x4e')](_0x5c833b)[_0x9121('0x2e')](handleEntityNotFound(_0x4c67cc,null))[_0x9121('0x2e')](function(_0x25a053){if(_0x25a053){var _0x392fae=_0x25a053[_0x9121('0x54')]({'plain':!![]});_0x392fae=qs['omit'](_0x392fae,['id',_0x9121('0x55'),_0x9121('0x56'),_0x9121('0x57')]);_0x12edbf[_0x9121('0x50')]=_['omit'](_0x12edbf[_0x9121('0x50')],['id',_0x9121('0x55'),'updatedAt']);return db['sequelize'][_0x9121('0x58')](function(_0x1d2f47){return db[_0x9121('0x35')]['create'](_['merge'](_0x392fae,_0x12edbf[_0x9121('0x50')]),{'include':_0x12edbf[_0x9121('0x38')][_0x9121('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x1d2f47})['then'](function(_0x356276){var _0x21b28a=_0x356276[_0x9121('0x54')]({'plain':!![]});return db['UserProfileSection'][_0x9121('0x49')]({'where':{'userProfileId':_0x12edbf[_0x9121('0x52')]['id']},'raw':!![]})[_0x9121('0x2e')](function(_0x1955ad){if(_0x1955ad){return BPromise[_0x9121('0x59')](_0x1955ad,function(_0x6ac408){return new BPromise(function(_0x418ec8,_0x39b180){if(_0x6ac408[_0x9121('0x5a')]===null||_0x6ac408[_0x9121('0x5a')]===0x1)_0x418ec8(null);return db[_0x9121('0x5b')]['findAll']({'where':{'sectionId':_0x6ac408['id']},'raw':!![]})[_0x9121('0x2e')](function(_0x452517){var _0x1333f4=_[_0x9121('0x34')](_0x452517,function(_0x4e4806){return qs[_0x9121('0x5c')](_0x4e4806,['id','createdAt',_0x9121('0x56'),'sectionId']);});_0x418ec8(_0x1333f4);})[_0x9121('0x4a')](function(_0x121009){_0x39b180(_0x121009);});})['then'](function(_0x24066f){var _0x27208d=qs['omit'](_0x6ac408,['id',_0x9121('0x55'),_0x9121('0x56')]);_0x27208d['userProfileId']=_0x21b28a['id'];if(_0x24066f)_0x27208d[_0x9121('0x5d')]=_0x24066f;return _0x27208d;})[_0x9121('0x2e')](function(_0x52b303){return db[_0x9121('0x5e')][_0x9121('0x4f')](_0x52b303,{'include':[{'model':db[_0x9121('0x5b')],'as':_0x9121('0x5d')}],'raw':!![],'transaction':_0x1d2f47});});})['then'](function(){return _0x21b28a;});}});});});}})['then'](respondWithResult(_0x4c67cc,0xc9))[_0x9121('0x4a')](handleError(_0x4c67cc,null));};exports[_0x9121('0x2d')]=function(_0x2ff306,_0xc0dbb2){if(_0x2ff306[_0x9121('0x50')]['id']){delete _0x2ff306['body']['id'];}return db[_0x9121('0x35')][_0x9121('0x4e')]({'where':{'id':_0x2ff306[_0x9121('0x52')]['id']}})['then'](handleEntityNotFound(_0xc0dbb2,null))[_0x9121('0x2e')](saveUpdates(_0x2ff306[_0x9121('0x50')],null))[_0x9121('0x2e')](respondWithResult(_0xc0dbb2,null))[_0x9121('0x4a')](handleError(_0xc0dbb2,null));};exports['destroy']=function(_0x30ec33,_0x5dddad){return db['UserProfile']['find']({'where':{'id':_0x30ec33[_0x9121('0x52')]['id']}})[_0x9121('0x2e')](handleEntityNotFound(_0x5dddad,null))[_0x9121('0x2e')](removeEntity(_0x5dddad,null))[_0x9121('0x4a')](handleError(_0x5dddad,null));};exports[_0x9121('0x5f')]=function(_0x1d07c1,_0x3cffef){return db[_0x9121('0x35')][_0x9121('0x5f')]()[_0x9121('0x2e')](respondWithResult(_0x3cffef,null))[_0x9121('0x4a')](handleError(_0x3cffef,null));};exports[_0x9121('0x60')]=function(_0x73ae63,_0x421bfb){var _0x4e83d5=_0x73ae63[_0x9121('0x50')];return db[_0x9121('0x35')]['find']({'where':{'id':_0x73ae63[_0x9121('0x52')]['id']}})[_0x9121('0x2e')](handleEntityNotFound(_0x421bfb,null))[_0x9121('0x2e')](function(_0x27227e){if(_0x27227e){return db[_0x9121('0x61')][_0x9121('0x58')](function(_0x225dd0){return db[_0x9121('0x5e')][_0x9121('0x2f')]({'where':{'userProfileId':_0x73ae63[_0x9121('0x52')]['id'],'sectionId':_['map'](_0x4e83d5,function(_0x136ca7){return _0x136ca7[_0x9121('0x62')];})},'transaction':_0x225dd0})[_0x9121('0x2e')](function(){var _0x359995=_[_0x9121('0x34')](_0x4e83d5,function(_0x43a427){_0x43a427['userProfileId']=_0x73ae63[_0x9121('0x52')]['id'];return _0x43a427;});var _0x13113d=[];return BPromise[_0x9121('0x59')](_0x359995,function(_0x53b18c){return db[_0x9121('0x5e')]['create'](_0x53b18c,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x225dd0})['then'](function(_0x232064){_0x13113d[_0x9121('0x63')](_0x232064[_0x9121('0x54')]({'plain':!![]}));});})[_0x9121('0x2e')](function(){return _0x13113d;});});});}})[_0x9121('0x2e')](function(_0x2b4e5c){return _0x2b4e5c;})[_0x9121('0x2e')](respondWithResult(_0x421bfb,null))[_0x9121('0x4a')](handleError(_0x421bfb,null));};exports[_0x9121('0x64')]=function(_0x44d3f7,_0x147d49){var _0x2ea7b1;return db[_0x9121('0x35')][_0x9121('0x4e')]({'where':{'id':_0x44d3f7[_0x9121('0x52')]['id']},'attributes':['id',_0x9121('0x32')]})[_0x9121('0x2e')](handleEntityNotFound(_0x147d49,null))[_0x9121('0x2e')](function(_0x55a0b7){if(_0x55a0b7){_0x2ea7b1=_0x55a0b7;return db[_0x9121('0x5e')][_0x9121('0x2f')]({'where':{'userProfileId':_0x44d3f7[_0x9121('0x52')]['id'],'sectionId':_0x44d3f7[_0x9121('0x38')]['ids']}});}})[_0x9121('0x2e')](function(){return _0x2ea7b1;})[_0x9121('0x2e')](respondWithStatusCode(_0x147d49,null))[_0x9121('0x4a')](handleError(_0x147d49,null));};exports[_0x9121('0x65')]=function(_0x428ecb,_0x18d30c){var _0x34d270=[];var _0x4db4b3=[];return db[_0x9121('0x5e')]['findAll']({'where':{'userProfileId':_0x428ecb['params']['id']},'raw':!![]})[_0x9121('0x2e')](function(_0x212415){_0x34d270=_[_0x9121('0x43')](_0x212415,function(_0x4538ef){return _0x4538ef[_0x9121('0x66')]===0x1||_[_0x9121('0x67')]([0x3eb,0x709],_0x4538ef[_0x9121('0x62')]);});if(!_[_0x9121('0x68')](_0x34d270)){return _['map'](_0x34d270,function(_0xba9b1f){return _0xba9b1f[_0x9121('0x62')];});}else{return;}})[_0x9121('0x2e')](function(_0xd39747){if(_0xd39747)_0x4db4b3=_0xd39747;if(_[_0x9121('0x67')](_0x4db4b3,0x64)){var _0x34592c=_[_0x9121('0x4e')](_0x34d270,{'sectionId':0x64});return hasDefaultDashboard(_0x34592c)[_0x9121('0x2e')](function(_0x436a31){return _['map'](_0x34d270,function(_0x58be5f){if(_0x58be5f[_0x9121('0x62')]===0x64){_0x58be5f[_0x9121('0x69')]=_0x436a31;}return _0x58be5f;});});}else{return;}})['then'](function(_0x56bfc8){if(_0x56bfc8)_0x34d270=_0x56bfc8;if(_[_0x9121('0x67')](_0x4db4b3,0x3eb)){var _0x35a0a4=_['find'](_0x34d270,{'sectionId':0x3eb});return getCustomDashboards(_0x35a0a4)['then'](function(_0x3bea20){return _[_0x9121('0x34')](_0x34d270,function(_0x20b09d){if(_0x35a0a4[_0x9121('0x66')]){if(_0x20b09d['sectionId']===0x3eb){_0x20b09d[_0x9121('0x69')]=_0x3bea20;}}else{if(_0x20b09d[_0x9121('0x62')]===0x64){_0x20b09d[_0x9121('0x69')]=_0x3bea20;}}return _0x20b09d;});});}else{return;}})[_0x9121('0x2e')](function(_0x4b08c6){if(_0x4b08c6)_0x34d270=_0x4b08c6;if(_[_0x9121('0x67')](_0x4db4b3,0x709)){var _0x2a34cf=_[_0x9121('0x4e')](_0x34d270,{'sectionId':0x709});return getPlugins(_0x2a34cf)[_0x9121('0x2e')](function(_0xa6c08c){if(_0x2a34cf[_0x9121('0x66')]){return _[_0x9121('0x34')](_0x34d270,function(_0x33e282){if(_0x33e282[_0x9121('0x62')]===0x709){_0x33e282['subsections']=_0xa6c08c;}return _0x33e282;});}else{var _0x353b65={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa6c08c};var _0x167adf=_[_0x9121('0x34')](_0x34d270);_0x167adf[_0x9121('0x63')](_0x353b65);return _0x167adf;}});}else{return;}})[_0x9121('0x2e')](function(_0x2ac2d5){if(_0x2ac2d5)_0x34d270=_0x2ac2d5;return _['filter'](_0x34d270,[_0x9121('0x66'),0x1]);})['then'](respondWithResult(_0x18d30c,null))['catch'](handleError(_0x18d30c,null));};function hasDefaultDashboard(_0x2b62af){var _0x5dabad=[0x65];return new BPromise(function(_0x769ce7,_0xda3bbe){try{if(_0x2b62af[_0x9121('0x5a')]){_0x769ce7(_0x5dabad);}else{return db['UserProfileResource'][_0x9121('0x6a')]({'where':{'sectionId':_0x2b62af['id']},'raw':!![]})[_0x9121('0x2e')](function(_0x2a50ff){_0x2a50ff?_0x769ce7(_0x5dabad):_0x769ce7();});}}catch(_0x1ccfd2){_0xda3bbe(_0x1ccfd2);}});}function getCustomDashboards(_0x29e5ed){var _0x22485d=[];return new BPromise(function(_0x14aa3f,_0x2956fa){try{if(_0x29e5ed[_0x9121('0x5a')]){return db['Dashboard'][_0x9121('0x49')]({'raw':!![]})['then'](function(_0x5d36ce){_0x5d36ce['forEach'](function(_0x2bffd3){_0x22485d['push'](_0x2bffd3['id']+0x1869f);});_0x14aa3f(_0x22485d);});}else{return db[_0x9121('0x5b')][_0x9121('0x49')]({'where':{'sectionId':_0x29e5ed['id']},'raw':!![]})['then'](function(_0x4ad2e6){_0x4ad2e6['forEach'](function(_0x3c8e86){_0x22485d[_0x9121('0x63')](_0x3c8e86[_0x9121('0x6b')]+0x1869f);});_0x14aa3f(_0x22485d);});}}catch(_0x493af0){_0x2956fa(_0x493af0);}});}function getPlugins(_0x2e08f9){var _0x1d5bfa=[];return new BPromise(function(_0x17afd0,_0x12160d){try{if(_0x2e08f9[_0x9121('0x5a')]){return db[_0x9121('0x6c')]['findAll']({'raw':!![]})[_0x9121('0x2e')](function(_0x2fad72){_0x2fad72[_0x9121('0x6d')](function(_0x4fb0da){_0x1d5bfa[_0x9121('0x63')](_0x4fb0da['id']+0x15b38);});_0x17afd0(_0x1d5bfa);});}else{return db['UserProfileResource'][_0x9121('0x49')]({'where':{'sectionId':_0x2e08f9['id']},'raw':!![]})[_0x9121('0x2e')](function(_0x1c8ef2){_0x1c8ef2[_0x9121('0x6d')](function(_0x59d36a){_0x1d5bfa['push'](_0x59d36a['resourceId']+0x15b38);});_0x17afd0(_0x1d5bfa);});}}catch(_0x70af0){_0x12160d(_0x70af0);}});}exports['addResources']=function(_0x6478fb,_0x27edf1){return db[_0x9121('0x35')][_0x9121('0x4e')]({'where':{'id':_0x6478fb['params']['id']}})['then'](handleEntityNotFound(_0x27edf1,null))[_0x9121('0x2e')](function(_0x1ea5c1){if(_0x1ea5c1){return db[_0x9121('0x61')]['transaction'](function(_0x56da30){return db[_0x9121('0x5e')][_0x9121('0x49')]({'where':{'userProfileId':_0x6478fb['params']['id']},'attributes':['id'],'raw':!![]})[_0x9121('0x2e')](function(_0x375512){if(_0x375512){return db[_0x9121('0x5e')][_0x9121('0x2f')]({'where':{'userProfileId':_0x6478fb[_0x9121('0x52')]['id'],'id':_[_0x9121('0x34')](_0x375512,function(_0x1f374d){return _0x1f374d['id'];})},'transaction':_0x56da30});}})[_0x9121('0x2e')](function(_0x5b9034){var _0x2caa7f=_[_0x9121('0x34')](_0x6478fb['body'],function(_0xf31072){_0xf31072[_0x9121('0x6e')]=_0x6478fb[_0x9121('0x52')]['id'];return _0xf31072;});return db[_0x9121('0x5e')][_0x9121('0x6f')](_0x2caa7f,{'raw':!![],'transaction':_0x56da30});})['then'](function(_0x52721e){var _0x1d5e5b=_['filter'](_[_0x9121('0x34')](_0x52721e,function(_0x4845a6){return _0x4845a6[_0x9121('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x1d5e5b){return db['UserProfileSection'][_0x9121('0x49')]({'where':{'userProfileId':_0x6478fb[_0x9121('0x52')]['id'],'sectionId':_[_0x9121('0x34')](_0x1d5e5b,function(_0x455692){return _0x455692[_0x9121('0x62')];})},'attributes':['id',_0x9121('0x62')],'raw':!![]})[_0x9121('0x2e')](function(_0x26f2c8){var _0x38d995=_['map'](_0x6478fb[_0x9121('0x50')],function(_0x4e2781){_0x4e2781[_0x9121('0x6e')]=_0x6478fb[_0x9121('0x52')]['id'];return _0x4e2781;});return db[_0x9121('0x5b')][_0x9121('0x6f')](_0x38d995,{'raw':!![],'transaction':_0x56da30});});}})[_0x9121('0x4a')](handleError(_0x27edf1,null));});}})['then'](function(_0x24ac48){var _0x56ac2a=_[_0x9121('0x34')](_0x24ac48,function(_0x216aaf){return _0x216aaf['get']({'plain':!![]});});})[_0x9121('0x2e')](respondWithResult(_0x27edf1,null))[_0x9121('0x4a')](handleError(_0x27edf1,null));};exports[_0x9121('0x70')]=function(_0x163ec0,_0x39a808,_0x131056){return db['UserProfile']['find']({'where':{'id':_0x163ec0['params']['id']}})[_0x9121('0x2e')](handleEntityNotFound(_0x39a808,null))[_0x9121('0x2e')](function(_0x230ac4){if(_0x230ac4){return _0x230ac4[_0x9121('0x70')](_0x163ec0[_0x9121('0x38')][_0x9121('0x71')]);}})[_0x9121('0x2e')](respondWithStatusCode(_0x39a808,null))[_0x9121('0x4a')](handleError(_0x39a808,null));};exports[_0x9121('0x72')]=function(_0x6b5980,_0x286ef4){var _0x499d6f={};if(!_0x6b5980[_0x9121('0x38')][_0x9121('0x73')])throw new Error(_0x9121('0x74'));if(!_0x6b5980[_0x9121('0x38')][_0x9121('0x3f')](_0x9121('0x75'))){_0x499d6f[_0x9121('0x27')]=qs[_0x9121('0x27')](_0x6b5980['query']['limit']);_0x499d6f[_0x9121('0x26')]=qs[_0x9121('0x26')](_0x6b5980['query'][_0x9121('0x26')]);}return db[_0x9121('0x35')]['find']({'where':{'id':_0x6b5980[_0x9121('0x52')]['id']}})[_0x9121('0x2e')](function(_0x3267b9){if(!_0x3267b9)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x6b5980[_0x9121('0x52')]['id']);return db[_0x9121('0x35')]['getResources'](_0x6b5980);})[_0x9121('0x2e')](respondWithFilteredResult(_0x286ef4,_0x499d6f))[_0x9121('0x4a')](handleError(_0x286ef4,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9f5668c..1e6e4cb 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 _0x77d4=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x593bee,_0x2505b3){var _0x423cae=function(_0x179a33){while(--_0x179a33){_0x593bee['push'](_0x593bee['shift']());}};_0x423cae(++_0x2505b3);}(_0x77d4,0x108));var _0x477d=function(_0x1c4e6b,_0x5f4e07){_0x1c4e6b=_0x1c4e6b-0x0;var _0x1b2aac=_0x77d4[_0x1c4e6b];return _0x1b2aac;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x477d('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x477d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x477d('0x2'),'afterDestroy':_0x477d('0x3')};function emitEvent(_0x53637c){return function(_0x53e1b8,_0x16213f,_0xf3cde0){UserProfileEvents[_0x477d('0x4')](_0x53637c+':'+_0x53e1b8['id'],_0x53e1b8);UserProfileEvents[_0x477d('0x4')](_0x53637c,_0x53e1b8);_0xf3cde0(null);};}for(var e in events){if(events[_0x477d('0x5')](e)){var event=events[e];UserProfile[_0x477d('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x0272=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x0272,0x15a));var _0x2027=function(_0x4ed616,_0x56b1a1){_0x4ed616=_0x4ed616-0x0;var _0x19dba7=_0x0272[_0x4ed616];return _0x19dba7;};'use strict';var EventEmitter=require(_0x2027('0x0'));var UserProfile=require(_0x2027('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x2027('0x2')](0x0);var events={'afterCreate':_0x2027('0x3'),'afterUpdate':_0x2027('0x4'),'afterDestroy':_0x2027('0x5')};function emitEvent(_0x2072a8){return function(_0x2ec914,_0x5844b7,_0x4f3d33){UserProfileEvents[_0x2027('0x6')](_0x2072a8+':'+_0x2ec914['id'],_0x2ec914);UserProfileEvents[_0x2027('0x6')](_0x2072a8,_0x2ec914);_0x4f3d33(null);};}for(var e in events){if(events[_0x2027('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 5e23000..891480f 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 _0x4745=['smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','QueueCampaigns','users','telephones','User','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','charAt','QueryTypes','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','user_profiles','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','params','union','autoAssociation','length','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','filters','merge','key','VIRTUAL','find','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','tag','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','all','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','then','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','lists','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','outboundroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','parentSections','Agents','name','membername','agent','Telephones','role','telephone','VoiceQueues','inbound','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','mailqueues','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount'];(function(_0x51c72e,_0x4501d5){var _0x3bdb71=function(_0x24431e){while(--_0x24431e){_0x51c72e['push'](_0x51c72e['shift']());}};_0x3bdb71(++_0x4501d5);}(_0x4745,0x1e7));var _0x5474=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x4745[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x5474('0x0'));var attributes=require(_0x5474('0x1'));var qs=require(_0x5474('0x2'));var squel=require(_0x5474('0x3'));module[_0x5474('0x4')]=function(_0xa40879){var _0x4bd69d=_0xa40879[_0x5474('0x5')];function _0x28d8aa(_0x39fb9b,_0x45a895){return new Promise(function(_0x34f89b,_0x4e7ce7){if(!_0x45a895)return _0x34f89b(null);var _0x3d1e1=_0x45a895[_0x5474('0x6')]?{[_0x45a895['filter'][_0x5474('0x7')]]:_0x45a895['filter'][_0x5474('0x8')]}:undefined;return _0x4bd69d[_0x39fb9b][_0x5474('0x9')]({'where':_0x3d1e1,'raw':!![]})['then'](function(_0xf876f8){_0x45a895[_0x5474('0xa')]=_[_0x5474('0xb')](_0xf876f8,'id');_0x34f89b(_0x45a895);})[_0x5474('0xc')](function(_0x4444dd){_0x4e7ce7(_0x4444dd);});});}function _0x40c4a8(_0x3f729f,_0x2fc637){return new Promise(function(_0x48fc51,_0x38dadb){var _0x2bb3c1=_0x3f729f[_0x5474('0x6')]?{[_0x3f729f[_0x5474('0x6')][_0x5474('0x7')]]:_0x3f729f[_0x5474('0x6')][_0x5474('0x8')]}:undefined;return _0x4bd69d[_0x3f729f[_0x5474('0xd')]][_0x5474('0x9')]({'where':_0x2bb3c1,'raw':!![]})['then'](function(_0xb828fe){_0x2fc637[_0x5474('0xa')]=_[_0x5474('0xb')](_0xb828fe,function(_0x1790eb){return _0x1790eb['name'];});_0x48fc51(_0x2fc637);})['catch'](function(_0x50b949){_0x38dadb(_0x50b949);});});}function _0x50eb42(_0x32f0e4,_0x172bcb,_0x2da774){if(!_0x172bcb)return Promise['resolve'](null);return new Promise(function(_0x3da004,_0x2be746){return _0x4bd69d['UserProfileResource'][_0x5474('0x9')]({'where':{'sectionId':_0x172bcb['id']},'raw':!![]})[_0x5474('0xe')](function(_0x18b0fe){if(_0x32f0e4[_0x5474('0x7')]&&_0x32f0e4[_0x5474('0x7')]!=='id'){_0x172bcb['associatedResources']=_[_0x5474('0xb')](_0x18b0fe,function(_0x5f31a9){return _0x5f31a9[_0x32f0e4[_0x5474('0x7')]];});}else{if(_0x2da774===_0x5474('0xf')){_0x172bcb['associatedResources']=_['map'](_0x18b0fe,function(_0x563539){return{'id':_0x563539[_0x5474('0x10')],'type':_0x563539[_0x5474('0x11')]};});}else{_0x172bcb[_0x5474('0xa')]=_[_0x5474('0xb')](_0x18b0fe,function(_0x36b389){return _0x36b389[_0x5474('0x10')];});}}_0x3da004(_0x172bcb);})[_0x5474('0xc')](function(_0x1e512d){_0x2be746(_0x1e512d);});});}function _0x219be1(_0x9c80cc,_0x542d1f){var _0x5f065d={'parentSections':[]};switch(_0x9c80cc[_0x5474('0x12')]()){case _0x5474('0x13'):_0x5f065d[_0x5474('0x14')]='SquareProject';break;case _0x5474('0x15'):_0x5f065d['childModel']=_0x5474('0x16');break;case _0x5474('0x17'):_0x5f065d['childModel']=_0x5474('0x18');_0x5f065d['parentSections']=[{'name':_0x5474('0x19'),'field':'name','foreignKey':_0x5474('0x1a')}];break;case _0x5474('0x1b'):_0x5f065d[_0x5474('0x14')]='JscriptyProject';break;case _0x5474('0x1c'):_0x5f065d[_0x5474('0x14')]='CmContact';_0x5f065d['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x5474('0x1d'):_0x5f065d[_0x5474('0x14')]='CmList';break;case _0x5474('0x1e'):_0x5f065d['childModel']=_0x5474('0x1f');break;case'globalcustomfields':_0x5f065d[_0x5474('0x14')]='CmCustomField';break;case _0x5474('0x20'):_0x5f065d['childModel']=_0x5474('0x21');break;case _0x5474('0x22'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x23');break;case'faxqueues':_0x5f065d['childModel']=_0x5474('0x24');break;case _0x5474('0x25'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x26');break;case'inboundroutes':case'internalroutes':case _0x5474('0x27'):_0x5f065d[_0x5474('0x14')]='VoiceExtension';break;case _0x5474('0x28'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x29');break;case _0x5474('0x2a'):_0x5f065d['childModel']=_0x5474('0x2b');break;case _0x5474('0x2c'):_0x5f065d[_0x5474('0x14')]='VoiceRecording';_0x5f065d[_0x5474('0x2d')]=[{'name':_0x5474('0x2e'),'field':_0x5474('0x2f'),'foreignKey':_0x5474('0x30'),'model':'User','filter':{'field':'role','value':[_0x5474('0x31')]}},{'name':_0x5474('0x32'),'field':_0x5474('0x2f'),'foreignKey':_0x5474('0x30'),'model':'User','filter':{'field':_0x5474('0x33'),'value':[_0x5474('0x34')]}},{'name':_0x5474('0x35'),'field':_0x5474('0x2f'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':'type','value':[_0x5474('0x36')]}},{'name':'QueueCampaigns','field':_0x5474('0x2f'),'foreignKey':_0x5474('0x37'),'model':_0x5474('0x38'),'filter':{'field':_0x5474('0x11'),'value':[_0x5474('0x39')]}}];break;case _0x5474('0x3a'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x3b');break;case _0x5474('0x3c'):_0x5f065d['childModel']=_0x5474('0x3d');break;case _0x5474('0x3e'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x3f');break;case'ivrcampaigns':_0x5f065d[_0x5474('0x14')]='Campaign';break;case _0x5474('0x40'):_0x5f065d[_0x5474('0x14')]='MailQueue';break;case _0x5474('0x41'):_0x5f065d[_0x5474('0x14')]='MailAccount';break;case _0x5474('0x42'):_0x5f065d[_0x5474('0x14')]='MailSubstatus';break;case _0x5474('0x43'):_0x5f065d['childModel']=_0x5474('0x44');break;case _0x5474('0x45'):_0x5f065d['childModel']=_0x5474('0x46');break;case _0x5474('0x47'):_0x5f065d[_0x5474('0x14')]='SmsQueue';break;case _0x5474('0x48'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x49');break;case _0x5474('0x4a'):_0x5f065d['childModel']='WhatsappQueue';break;case _0x5474('0x4b'):_0x5f065d['childModel']=_0x5474('0x4c');break;case _0x5474('0x4d'):_0x5f065d['childModel']=_0x5474('0x4e');break;case _0x5474('0x4f'):case'queuecampaigns':_0x5f065d[_0x5474('0x14')]=_0x5474('0x38');if(_0x542d1f){_0x5f065d['parentSections']=[{'name':'VoiceQueues'},{'name':_0x5474('0x50')}];}break;case _0x5474('0x51'):case'agents':case _0x5474('0x52'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x53');if(_0x542d1f){_0x5f065d[_0x5474('0x2d')]=[{'name':'Users','filter':{'field':_0x5474('0x33'),'value':[_0x5474('0x54'),'user']},'ignore':!![]},{'name':_0x5474('0x2e')},{'name':_0x5474('0x32')}];}break;case _0x5474('0x55'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x56');break;case _0x5474('0x57'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x58');break;case _0x5474('0x59'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x5a');break;case _0x5474('0x5b'):_0x5f065d['childModel']=_0x5474('0x5c');break;case _0x5474('0x5d'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x5e');break;case'zohoaccounts':_0x5f065d[_0x5474('0x14')]=_0x5474('0x5f');break;case _0x5474('0x60'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x53');break;case _0x5474('0x61'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x62');break;case _0x5474('0x63'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x64');break;case _0x5474('0x65'):_0x5f065d[_0x5474('0x14')]='Dashboard';break;case'intervals':_0x5f065d['childModel']=_0x5474('0x66');break;case _0x5474('0x67'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x68');break;case _0x5474('0x69'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6a');break;case _0x5474('0x6b'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6c');break;case'tags':_0x5f065d[_0x5474('0x14')]=_0x5474('0x6d');break;case _0x5474('0x6e'):_0x5f065d[_0x5474('0x14')]=_0x5474('0x6f');break;case _0x5474('0x70'):_0x5f065d['childModel']='Trigger';break;case _0x5474('0x71'):_0x5f065d['childModel']=_0x5474('0x72');break;case _0x5474('0x73'):_0x5f065d[_0x5474('0x14')]='Variable';break;case _0x5474('0x74'):_0x5f065d['childModel']=_0x5474('0x75');break;case _0x5474('0x76'):_0x5f065d[_0x5474('0x14')]=_0x5474('0xf');_0x5f065d[_0x5474('0x2d')]=[{'name':_0x5474('0x77'),'field':'id','foreignKey':_0x5474('0x78')}];break;case'metrics':_0x5f065d['childModel']=_0x5474('0x79');break;}return _0x5f065d;}function _0x42d6ba(_0x5d2aa1,_0x191401){var _0x282a17=_0x5d2aa1[_0x5474('0x7a')](0x0)['toUpperCase']()+_0x5d2aa1['slice'](0x1);var _0x27e27d={'type':_0x4bd69d['Sequelize'][_0x5474('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x121951,_0x438290){var _0x142edd=squel['select']()['field'](_0x5474('0x7c')+_0x282a17+_0x5474('0x7d'),'id')['field'](_0x5474('0x7e'))[_0x5474('0x7f')](_0x5474('0x80')+_0x5d2aa1+_0x5474('0x81'),'ui')[_0x5474('0x82')](_0x5474('0x83'),_0x191401['id']);return _0x4bd69d['sequelize'][_0x5474('0x84')](_0x142edd[_0x5474('0x85')](),_0x27e27d)['then'](function(_0x3ad815){_0x191401[_0x282a17+_0x5474('0x86')]=_0x3ad815;_0x121951(_0x3ad815);})['catch'](function(_0x495737){_0x438290(_0x495737);});});}return _0xa40879[_0x5474('0x87')]('UserProfile',attributes,{'tableName':_0x5474('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x13cda3){var _0x458805={'raw':![],'where':{}};var _0x173dad={};var _0xaa0f67={'count':0x0,'rows':[]};var _0x2a9f70=_0x13cda3['query']['section'];var _0x1cbdc5=_0x13cda3[_0x5474('0x84')][_0x5474('0x89')]||![];var _0x2eb32e=_0x219be1(_0x2a9f70,_0x1cbdc5);if(!_0x2eb32e[_0x5474('0x14')])throw new Error(_0x5474('0x8a')+_0x2a9f70+'\x27');var _0x200b78=[{'name':_0x2a9f70}];if(!_[_0x5474('0x8b')](_0x2eb32e[_0x5474('0x2d')]))_0x200b78=_0x2eb32e[_0x5474('0x2d')];var _0x59e85e=[];for(var _0x38e08f=0x0;_0x38e08f<_0x200b78['length'];_0x38e08f++){_0x59e85e[_0x5474('0x8c')](_0x4bd69d[_0x5474('0x8d')]['find']({'where':{'userProfileId':_0x13cda3[_0x5474('0x8e')]['id'],'name':_0x200b78[_0x38e08f]['name']},'raw':!![]}));}return Promise['all'](_0x59e85e)[_0x5474('0xe')](function(_0x593672){var _0x526b3c=_[_0x5474('0x6')](_0x593672,function(_0x18a99a){return _0x18a99a?_0x18a99a:undefined;});var _0x2f4d1e=_[_0x5474('0x6')](_0x200b78,['ignore',!![]]);var _0x25a24e=_[_0x5474('0x8b')](_0x526b3c)&&_[_0x5474('0x8b')](_0x2f4d1e)?null:_[_0x5474('0x8f')](_0x2f4d1e,_0x526b3c);if(!_0x25a24e)return null;var _0x1920a3=[];for(var _0x1a5ac0=0x0;_0x1a5ac0<_0x25a24e['length'];_0x1a5ac0++){var _0x4131bb=_['find'](_0x200b78,function(_0x198eb8){return _0x25a24e[_0x1a5ac0]?_0x198eb8[_0x5474('0x2f')]===_0x25a24e[_0x1a5ac0]['name']:null;});if(_0x4131bb){if(_0x25a24e[_0x1a5ac0]['ignore']){_0x1920a3[_0x5474('0x8c')](_0x28d8aa(_0x2eb32e[_0x5474('0x14')],_0x25a24e[_0x1a5ac0]));}else{if(!_0x25a24e[_0x1a5ac0][_0x5474('0x90')]){_0x1920a3[_0x5474('0x8c')](_0x50eb42(_0x4131bb,_0x25a24e[_0x1a5ac0],_0x2eb32e[_0x5474('0x14')]));}else{if(_0x4131bb[_0x5474('0xd')]){_0x1920a3[_0x5474('0x8c')](_0x40c4a8(_0x4131bb,_0x25a24e[_0x1a5ac0]));}}}}}return Promise['all'](_0x1920a3);})['then'](function(_0x28823e){var _0x10cff3=_0x28823e;var _0x41b119=null;if(_0x10cff3){_0x41b119=_0x10cff3[_0x5474('0x91')]===0x1?_0x10cff3[0x0]:null;}if(!_0x41b119&&!_0x10cff3)return _0xaa0f67;var _0xa69efe=_0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0x92')];_0x173dad[_0x5474('0xd')]=_[_0x5474('0x93')](_0xa69efe);_0x173dad['query']=_['keys'](_0x13cda3['query']);_0x173dad['filters']=_[_0x5474('0x94')](_0x173dad['model'],_0x173dad[_0x5474('0x84')]);_0x458805[_0x5474('0x95')]=_[_0x5474('0x94')](_0x173dad[_0x5474('0xd')],qs[_0x5474('0x96')](_0x13cda3[_0x5474('0x84')]['fields']));_0x458805[_0x5474('0x95')]=_0x458805[_0x5474('0x95')][_0x5474('0x91')]?_0x458805['attributes']:_0x173dad[_0x5474('0xd')];if(!_0x13cda3[_0x5474('0x84')][_0x5474('0x97')]('nolimit')){_0x458805[_0x5474('0x98')]=qs[_0x5474('0x98')](_0x13cda3[_0x5474('0x84')][_0x5474('0x98')]);_0x458805[_0x5474('0x99')]=qs[_0x5474('0x99')](_0x13cda3[_0x5474('0x84')]['offset']);}_0x458805[_0x5474('0x9a')]=qs[_0x5474('0x9b')](_0x13cda3[_0x5474('0x84')][_0x5474('0x9b')]);_0x458805[_0x5474('0x82')]=qs['filters'](_[_0x5474('0x9c')](_0x13cda3[_0x5474('0x84')],_0x173dad[_0x5474('0x9d')]));if(_0x13cda3[_0x5474('0x84')][_0x5474('0x6')]){_0x458805['where']=_[_0x5474('0x9e')](_0x458805[_0x5474('0x82')],{'$or':_[_0x5474('0xb')](_0xa69efe,function(_0x2a3746){if(_0x2a3746[_0x5474('0x11')][_0x5474('0x9f')]!==_0x5474('0xa0')){var _0x38a640={};_0x38a640[_0x2a3746[_0x5474('0x7')]]={'$like':'%'+_0x13cda3['query']['filter']+'%'};return _0x38a640;}})});}var _0x14deb4=[];var _0x1c8148=null;var _0x15fb33={};if(_0x41b119){_0x1c8148=_[_0x5474('0xa1')](_0x200b78,[_0x5474('0x2f'),_0x41b119[_0x5474('0x2f')]]);if(_0x1c8148['field']){_0x15fb33={};if(_0x2eb32e[_0x5474('0x14')]==='AnalyticExtractedReport'){_0x15fb33[_0x1c8148[_0x5474('0xa2')]]=_[_0x5474('0xb')](_0x41b119[_0x5474('0xa')],'id');}else{_0x15fb33[_0x1c8148['foreignKey']]=_0x41b119[_0x5474('0xa')];}_0x14deb4[_0x5474('0x8c')](_0x15fb33);}else{_0x458805[_0x5474('0x82')]['id']=_0x41b119['associatedResources'];}}else{for(var _0x21f6e6=0x0;_0x21f6e6<_0x10cff3[_0x5474('0x91')];_0x21f6e6++){_0x1c8148=_[_0x5474('0xa1')](_0x200b78,['name',_0x10cff3[_0x21f6e6]['name']]);if(_0x1c8148['field']){_0x15fb33={};_0x15fb33[_0x1c8148[_0x5474('0xa2')]]=_0x10cff3[_0x21f6e6][_0x5474('0xa')];_0x14deb4[_0x5474('0x8c')](_0x15fb33);}else{if(!_0x458805[_0x5474('0x82')]['id'])_0x458805[_0x5474('0x82')]['id']=[];_0x10cff3[_0x21f6e6][_0x5474('0xa')][_0x5474('0xa3')](function(_0x5362cc){_0x458805[_0x5474('0x82')]['id'][_0x5474('0x8c')](_0x5362cc);});}}}if(!_[_0x5474('0x8b')](_0x14deb4)){_0x458805[_0x5474('0x82')]=_[_0x5474('0x9e')](_0x458805[_0x5474('0x82')],{'$and':{'$or':_0x14deb4}});}_0x458805=_[_0x5474('0x9e')]({},_0x458805,_0x13cda3[_0x5474('0xa4')]);if(_0x41b119&&!_0x41b119[_0x5474('0x90')]&&_0x2eb32e[_0x5474('0x14')]===_0x5474('0xf')){if(_0x13cda3[_0x5474('0x84')][_0x5474('0xa5')]){_0x458805[_0x5474('0xa6')]=[{'all':!![]}];}return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0x9')](_0x458805)[_0x5474('0xe')](function(_0x19aa83){var _0x1de17a=[];_0x19aa83[_0x5474('0xa3')](function(_0x5994f5){var _0xbd8403;switch(_0x5994f5[_0x5474('0xa7')]){case _0x5474('0xa8'):_0xbd8403=_['find'](_0x41b119['associatedResources'],function(_0x20c3ed){return _0x20c3ed['id']===_0x5994f5['reportId']&&_0x20c3ed[_0x5474('0x11')]===_0x5474('0xa9');});break;case _0x5474('0xaa'):_0xbd8403=_[_0x5474('0xa1')](_0x41b119[_0x5474('0xa')],function(_0x67b1a9){return _0x67b1a9['id']===_0x5994f5[_0x5474('0x78')]&&_0x67b1a9[_0x5474('0x11')]===_0x5474('0xab');});break;}if(_0xbd8403)_0x1de17a[_0x5474('0x8c')](_0x5994f5);});_0xaa0f67[_0x5474('0xac')]=_0x1de17a['length'];_0xaa0f67[_0x5474('0xad')]=_0x1de17a;return _0xaa0f67;});}else{return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]][_0x5474('0xac')]({'where':_0x458805[_0x5474('0x82')]})[_0x5474('0xe')](function(_0x2f8c7b){_0xaa0f67['count']=_0x2f8c7b;if(_0x13cda3[_0x5474('0x84')]['includeAll']){if(_0x2eb32e[_0x5474('0x14')]==='CmContact'){_0x458805[_0x5474('0xa6')]=[{'model':_0x4bd69d[_0x5474('0x6d')],'as':_0x5474('0xae'),'attributes':['id',_0x5474('0x2f'),_0x5474('0xaf')],'required':_0x13cda3[_0x5474('0x84')][_0x5474('0xb0')]?!![]:![]},{'model':_0x4bd69d[_0x5474('0x6d')],'as':'ThroughTags','attributes':['id','name',_0x5474('0xaf')],'through':_0x13cda3['query'][_0x5474('0xb0')]?{'attributes':[],'where':{'TagId':_0x13cda3['query']['tag']||undefined}}:{},'required':_0x13cda3[_0x5474('0x84')][_0x5474('0xb0')]?!![]:![]}];}else{_0x458805[_0x5474('0xa6')]=[{'all':!![]}];}}return _0x4bd69d[_0x2eb32e[_0x5474('0x14')]]['findAll'](_0x458805);})[_0x5474('0xe')](function(_0x22e42d){_0xaa0f67['rows']=_0x22e42d;if(_0x2a9f70===_0x5474('0x2e')&&_0x13cda3[_0x5474('0x84')][_0x5474('0xb1')]===_0x5474('0xb2')){var _0x5ec2a3=[];for(var _0x28b73f=0x0;_0x28b73f<_0xaa0f67[_0x5474('0xad')][_0x5474('0x91')];_0x28b73f++){_0x5ec2a3['push'](_0x42d6ba(_0x5474('0xb3'),_0xaa0f67['rows'][_0x28b73f]['dataValues']));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb4'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb6'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb7'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba(_0x5474('0xb8'),_0xaa0f67[_0x5474('0xad')][_0x28b73f][_0x5474('0xb5')]));_0x5ec2a3[_0x5474('0x8c')](_0x42d6ba('whatsapp',_0xaa0f67['rows'][_0x28b73f][_0x5474('0xb5')]));}return Promise[_0x5474('0xb9')](_0x5ec2a3)[_0x5474('0xe')](function(){return _0xaa0f67;});}return _0xaa0f67;});}});}}});}; \ No newline at end of file +var _0xdf55=['VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','users','telephones','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','isEmpty','length','push','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','then','catch','value','model','associatedResources','name','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings'];(function(_0xc193fc,_0x446e3a){var _0x3a5ab8=function(_0x212bce){while(--_0x212bce){_0xc193fc['push'](_0xc193fc['shift']());}};_0x3a5ab8(++_0x446e3a);}(_0xdf55,0x83));var _0x5df5=function(_0x3a0f3e,_0x52601f){_0x3a0f3e=_0x3a0f3e-0x0;var _0x300e5a=_0xdf55[_0x3a0f3e];return _0x300e5a;};'use strict';var _=require(_0x5df5('0x0'));var attributes=require(_0x5df5('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x5df5('0x2'));module[_0x5df5('0x3')]=function(_0x538c78){var _0x3f503b=_0x538c78[_0x5df5('0x4')];function _0x381a4c(_0x521007,_0x289af4){return new Promise(function(_0x417341,_0x27ec86){if(!_0x289af4)return _0x417341(null);var _0x476e21=_0x289af4[_0x5df5('0x5')]?{[_0x289af4[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x289af4[_0x5df5('0x5')]['value']}:undefined;return _0x3f503b[_0x521007][_0x5df5('0x7')]({'where':_0x476e21,'raw':!![]})[_0x5df5('0x8')](function(_0x41941e){_0x289af4['associatedResources']=_['map'](_0x41941e,'id');_0x417341(_0x289af4);})[_0x5df5('0x9')](function(_0x4e80bd){_0x27ec86(_0x4e80bd);});});}function _0x45ad13(_0x3cd0c0,_0x491350){return new Promise(function(_0x59d273,_0x40322d){var _0xba664a=_0x3cd0c0[_0x5df5('0x5')]?{[_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0xa')]}:undefined;return _0x3f503b[_0x3cd0c0[_0x5df5('0xb')]][_0x5df5('0x7')]({'where':_0xba664a,'raw':!![]})[_0x5df5('0x8')](function(_0x555d3f){_0x491350[_0x5df5('0xc')]=_['map'](_0x555d3f,function(_0x13eb03){return _0x13eb03[_0x5df5('0xd')];});_0x59d273(_0x491350);})[_0x5df5('0x9')](function(_0x3657c8){_0x40322d(_0x3657c8);});});}function _0x282d53(_0x4e74c4,_0x27b3fb,_0x457205){if(!_0x27b3fb)return Promise['resolve'](null);return new Promise(function(_0x9a52c9,_0x45813f){return _0x3f503b[_0x5df5('0xe')][_0x5df5('0x7')]({'where':{'sectionId':_0x27b3fb['id']},'raw':!![]})[_0x5df5('0x8')](function(_0x4b499d){if(_0x4e74c4['field']&&_0x4e74c4[_0x5df5('0x6')]!=='id'){_0x27b3fb['associatedResources']=_[_0x5df5('0xf')](_0x4b499d,function(_0x40a8f5){return _0x40a8f5[_0x4e74c4[_0x5df5('0x6')]];});}else{if(_0x457205===_0x5df5('0x10')){_0x27b3fb[_0x5df5('0xc')]=_['map'](_0x4b499d,function(_0x1d6474){return{'id':_0x1d6474[_0x5df5('0x11')],'type':_0x1d6474[_0x5df5('0x12')]};});}else{_0x27b3fb[_0x5df5('0xc')]=_[_0x5df5('0xf')](_0x4b499d,function(_0x382999){return _0x382999['resourceId'];});}}_0x9a52c9(_0x27b3fb);})[_0x5df5('0x9')](function(_0x2e862d){_0x45813f(_0x2e862d);});});}function _0x8742a7(_0x446bba,_0x5ca542){var _0x4358ba={'parentSections':[]};switch(_0x446bba[_0x5df5('0x13')]()){case _0x5df5('0x14'):_0x4358ba['childModel']='SquareProject';break;case'odbc':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x16');break;case _0x5df5('0x17'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x18');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x1a'),'field':_0x5df5('0xd'),'foreignKey':'projectName'}];break;case _0x5df5('0x1b'):_0x4358ba['childModel']=_0x5df5('0x1c');break;case _0x5df5('0x1d'):_0x4358ba['childModel']=_0x5df5('0x1e');_0x4358ba['parentSections']=[{'name':_0x5df5('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x5df5('0x20'):_0x4358ba['childModel']=_0x5df5('0x21');break;case'companies':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x22');break;case _0x5df5('0x23'):_0x4358ba['childModel']=_0x5df5('0x24');break;case _0x5df5('0x25'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x26');break;case _0x5df5('0x27'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x28');break;case'faxqueues':_0x4358ba['childModel']=_0x5df5('0x29');break;case _0x5df5('0x2a'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2b');break;case _0x5df5('0x2c'):case _0x5df5('0x2d'):case'outboundroutes':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2e');break;case _0x5df5('0x2f'):_0x4358ba[_0x5df5('0x15')]='VoiceContext';break;case _0x5df5('0x30'):_0x4358ba['childModel']=_0x5df5('0x31');break;case _0x5df5('0x32'):_0x4358ba['childModel']=_0x5df5('0x33');_0x4358ba['parentSections']=[{'name':_0x5df5('0x34'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':_0x5df5('0x36'),'filter':{'field':'role','value':[_0x5df5('0x37')]}},{'name':_0x5df5('0x38'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':'User','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x3a')]}},{'name':_0x5df5('0x3b'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x3c'),'model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['inbound']}},{'name':_0x5df5('0x3e'),'field':_0x5df5('0xd'),'foreignKey':'queue','model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['outbound']}}];break;case _0x5df5('0x3f'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x40');break;case _0x5df5('0x41'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x42');break;case _0x5df5('0x43'):_0x4358ba[_0x5df5('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x4358ba[_0x5df5('0x15')]='Campaign';break;case _0x5df5('0x44'):_0x4358ba[_0x5df5('0x15')]='MailQueue';break;case _0x5df5('0x45'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x46');break;case _0x5df5('0x47'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x48');break;case _0x5df5('0x49'):_0x4358ba[_0x5df5('0x15')]='OpenchannelQueue';break;case _0x5df5('0x4a'):_0x4358ba['childModel']=_0x5df5('0x4b');break;case _0x5df5('0x4c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x4d');break;case _0x5df5('0x4e'):_0x4358ba['childModel']=_0x5df5('0x4f');break;case _0x5df5('0x50'):_0x4358ba[_0x5df5('0x15')]='WhatsappQueue';break;case _0x5df5('0x51'):_0x4358ba[_0x5df5('0x15')]='WhatsappAccount';break;case _0x5df5('0x52'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x53');break;case _0x5df5('0x54'):case'queuecampaigns':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x3d');if(_0x5ca542){_0x4358ba['parentSections']=[{'name':_0x5df5('0x3b')},{'name':_0x5df5('0x3e')}];}break;case _0x5df5('0x55'):case'agents':case _0x5df5('0x56'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');if(_0x5ca542){_0x4358ba[_0x5df5('0x19')]=[{'name':'Users','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x57'),_0x5df5('0x58')]},'ignore':!![]},{'name':_0x5df5('0x34')},{'name':_0x5df5('0x38')}];}break;case'zendeskaccounts':_0x4358ba['childModel']=_0x5df5('0x59');break;case'salesforceaccounts':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5a');break;case _0x5df5('0x5b'):_0x4358ba[_0x5df5('0x15')]='FreshdeskAccount';break;case _0x5df5('0x5c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5d');break;case _0x5df5('0x5e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5f');break;case'zohoaccounts':_0x4358ba[_0x5df5('0x15')]='ZohoAccount';break;case _0x5df5('0x60'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');break;case'cannedanswers':_0x4358ba[_0x5df5('0x15')]='CannedAnswer';break;case _0x5df5('0x61'):_0x4358ba['childModel']=_0x5df5('0x62');break;case _0x5df5('0x63'):_0x4358ba[_0x5df5('0x15')]='Dashboard';break;case _0x5df5('0x64'):_0x4358ba[_0x5df5('0x15')]='Interval';break;case _0x5df5('0x65'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x66');break;case _0x5df5('0x67'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x68');break;case _0x5df5('0x69'):_0x4358ba['childModel']=_0x5df5('0x6a');break;case'tags':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6b');break;case _0x5df5('0x6c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6d');break;case _0x5df5('0x6e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6f');break;case'trunks':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x70');break;case _0x5df5('0x71'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x72');break;case'plugins':_0x4358ba[_0x5df5('0x15')]='Plugin';break;case'extractedreports':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x10');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x73'),'field':'id','foreignKey':_0x5df5('0x74')}];break;case _0x5df5('0x75'):_0x4358ba['childModel']=_0x5df5('0x76');break;}return _0x4358ba;}function _0xac9e68(_0x533996,_0x5b3375){var _0x7fdce7=_0x533996[_0x5df5('0x77')](0x0)[_0x5df5('0x78')]()+_0x533996[_0x5df5('0x79')](0x1);var _0x8cc729={'type':_0x3f503b[_0x5df5('0x7a')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x5b9dd8,_0x2236bd){var _0x43fccb=squel['select']()[_0x5df5('0x6')](_0x5df5('0x7b')+_0x7fdce7+_0x5df5('0x7c'),'id')[_0x5df5('0x6')](_0x5df5('0x7d'))[_0x5df5('0x7e')](_0x5df5('0x7f')+_0x533996+_0x5df5('0x80'),'ui')[_0x5df5('0x81')]('ui.UserId\x20=\x20?',_0x5b3375['id']);return _0x3f503b[_0x5df5('0x82')][_0x5df5('0x83')](_0x43fccb[_0x5df5('0x84')](),_0x8cc729)[_0x5df5('0x8')](function(_0x2fc9b4){_0x5b3375[_0x7fdce7+_0x5df5('0x85')]=_0x2fc9b4;_0x5b9dd8(_0x2fc9b4);})[_0x5df5('0x9')](function(_0x457fb4){_0x2236bd(_0x457fb4);});});}return _0x538c78[_0x5df5('0x86')](_0x5df5('0x87'),attributes,{'tableName':_0x5df5('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b0289){var _0x4e782b={'raw':![],'where':{}};var _0x209780={};var _0x260980={'count':0x0,'rows':[]};var _0x5b6a79=_0x3b0289[_0x5df5('0x83')][_0x5df5('0x89')];var _0xbcea82=_0x3b0289[_0x5df5('0x83')]['mergeResources']||![];var _0x1ea684=_0x8742a7(_0x5b6a79,_0xbcea82);if(!_0x1ea684[_0x5df5('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x5b6a79+'\x27');var _0x54e677=[{'name':_0x5b6a79}];if(!_[_0x5df5('0x8a')](_0x1ea684[_0x5df5('0x19')]))_0x54e677=_0x1ea684[_0x5df5('0x19')];var _0x542ed5=[];for(var _0x4edb86=0x0;_0x4edb86<_0x54e677[_0x5df5('0x8b')];_0x4edb86++){_0x542ed5[_0x5df5('0x8c')](_0x3f503b['UserProfileSection'][_0x5df5('0x8d')]({'where':{'userProfileId':_0x3b0289[_0x5df5('0x8e')]['id'],'name':_0x54e677[_0x4edb86][_0x5df5('0xd')]},'raw':!![]}));}return Promise[_0x5df5('0x8f')](_0x542ed5)[_0x5df5('0x8')](function(_0x52b7ec){var _0x9674a7=_[_0x5df5('0x5')](_0x52b7ec,function(_0x1daf21){return _0x1daf21?_0x1daf21:undefined;});var _0x2398b3=_['filter'](_0x54e677,[_0x5df5('0x90'),!![]]);var _0x577955=_[_0x5df5('0x8a')](_0x9674a7)&&_[_0x5df5('0x8a')](_0x2398b3)?null:_['union'](_0x2398b3,_0x9674a7);if(!_0x577955)return null;var _0x1dc6b1=[];for(var _0x5ed4a6=0x0;_0x5ed4a6<_0x577955[_0x5df5('0x8b')];_0x5ed4a6++){var _0x4fff11=_[_0x5df5('0x8d')](_0x54e677,function(_0x3b8aaf){return _0x577955[_0x5ed4a6]?_0x3b8aaf[_0x5df5('0xd')]===_0x577955[_0x5ed4a6][_0x5df5('0xd')]:null;});if(_0x4fff11){if(_0x577955[_0x5ed4a6][_0x5df5('0x90')]){_0x1dc6b1[_0x5df5('0x8c')](_0x381a4c(_0x1ea684['childModel'],_0x577955[_0x5ed4a6]));}else{if(!_0x577955[_0x5ed4a6][_0x5df5('0x91')]){_0x1dc6b1[_0x5df5('0x8c')](_0x282d53(_0x4fff11,_0x577955[_0x5ed4a6],_0x1ea684[_0x5df5('0x15')]));}else{if(_0x4fff11['model']){_0x1dc6b1[_0x5df5('0x8c')](_0x45ad13(_0x4fff11,_0x577955[_0x5ed4a6]));}}}}}return Promise[_0x5df5('0x8f')](_0x1dc6b1);})[_0x5df5('0x8')](function(_0x1e2a3b){var _0x382f60=_0x1e2a3b;var _0x6e375f=null;if(_0x382f60){_0x6e375f=_0x382f60['length']===0x1?_0x382f60[0x0]:null;}if(!_0x6e375f&&!_0x382f60)return _0x260980;var _0x482ac5=_0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x92')];_0x209780[_0x5df5('0xb')]=_[_0x5df5('0x93')](_0x482ac5);_0x209780[_0x5df5('0x83')]=_['keys'](_0x3b0289[_0x5df5('0x83')]);_0x209780[_0x5df5('0x94')]=_[_0x5df5('0x95')](_0x209780['model'],_0x209780[_0x5df5('0x83')]);_0x4e782b[_0x5df5('0x96')]=_[_0x5df5('0x95')](_0x209780[_0x5df5('0xb')],qs[_0x5df5('0x97')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x97')]));_0x4e782b[_0x5df5('0x96')]=_0x4e782b[_0x5df5('0x96')]['length']?_0x4e782b[_0x5df5('0x96')]:_0x209780[_0x5df5('0xb')];if(!_0x3b0289[_0x5df5('0x83')]['hasOwnProperty'](_0x5df5('0x98'))){_0x4e782b[_0x5df5('0x99')]=qs['limit'](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x99')]);_0x4e782b[_0x5df5('0x9a')]=qs['offset'](_0x3b0289[_0x5df5('0x83')]['offset']);}_0x4e782b[_0x5df5('0x9b')]=qs[_0x5df5('0x9c')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x9c')]);_0x4e782b[_0x5df5('0x81')]=qs[_0x5df5('0x94')](_['pick'](_0x3b0289[_0x5df5('0x83')],_0x209780[_0x5df5('0x94')]));if(_0x3b0289['query'][_0x5df5('0x5')]){_0x4e782b['where']=_['merge'](_0x4e782b[_0x5df5('0x81')],{'$or':_['map'](_0x482ac5,function(_0x22dfa8){if(_0x22dfa8[_0x5df5('0x12')][_0x5df5('0x9d')]!==_0x5df5('0x9e')){var _0x453238={};_0x453238[_0x22dfa8[_0x5df5('0x6')]]={'$like':'%'+_0x3b0289['query'][_0x5df5('0x5')]+'%'};return _0x453238;}})});}var _0x36d635=[];var _0x68cbcc=null;var _0x58afa3={};if(_0x6e375f){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x6e375f['name']]);if(_0x68cbcc[_0x5df5('0x6')]){_0x58afa3={};if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x10')){_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_[_0x5df5('0xf')](_0x6e375f['associatedResources'],'id');}else{_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x6e375f['associatedResources'];}_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{_0x4e782b['where']['id']=_0x6e375f[_0x5df5('0xc')];}}else{for(var _0x168289=0x0;_0x168289<_0x382f60[_0x5df5('0x8b')];_0x168289++){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x382f60[_0x168289]['name']]);if(_0x68cbcc['field']){_0x58afa3={};_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x382f60[_0x168289][_0x5df5('0xc')];_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{if(!_0x4e782b[_0x5df5('0x81')]['id'])_0x4e782b[_0x5df5('0x81')]['id']=[];_0x382f60[_0x168289]['associatedResources'][_0x5df5('0xa0')](function(_0xdceef4){_0x4e782b[_0x5df5('0x81')]['id'][_0x5df5('0x8c')](_0xdceef4);});}}}if(!_[_0x5df5('0x8a')](_0x36d635)){_0x4e782b[_0x5df5('0x81')]=_[_0x5df5('0xa1')](_0x4e782b[_0x5df5('0x81')],{'$and':{'$or':_0x36d635}});}_0x4e782b=_[_0x5df5('0xa1')]({},_0x4e782b,_0x3b0289[_0x5df5('0xa2')]);if(_0x6e375f&&!_0x6e375f[_0x5df5('0x91')]&&_0x1ea684['childModel']==='AnalyticExtractedReport'){if(_0x3b0289['query'][_0x5df5('0xa3')]){_0x4e782b[_0x5df5('0xa4')]=[{'all':!![]}];}return _0x3f503b[_0x1ea684['childModel']][_0x5df5('0x7')](_0x4e782b)[_0x5df5('0x8')](function(_0x1e1d34){var _0xc91201=[];_0x1e1d34[_0x5df5('0xa0')](function(_0x26bbe0){var _0x36d8ee;switch(_0x26bbe0['reportType']){case _0x5df5('0xa5'):_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x1fc3c4){return _0x1fc3c4['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x1fc3c4[_0x5df5('0x12')]===_0x5df5('0xa6');});break;case'custom':_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x2ed5b9){return _0x2ed5b9['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x2ed5b9[_0x5df5('0x12')]===_0x5df5('0xa7');});break;}if(_0x36d8ee)_0xc91201[_0x5df5('0x8c')](_0x26bbe0);});_0x260980[_0x5df5('0xa8')]=_0xc91201['length'];_0x260980[_0x5df5('0xa9')]=_0xc91201;return _0x260980;});}else{return _0x3f503b[_0x1ea684[_0x5df5('0x15')]]['count']({'where':_0x4e782b[_0x5df5('0x81')]})[_0x5df5('0x8')](function(_0x25a2e9){_0x260980[_0x5df5('0xa8')]=_0x25a2e9;if(_0x3b0289[_0x5df5('0x83')]['includeAll']){if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x1e')){_0x4e782b[_0x5df5('0xa4')]=[{'model':_0x3f503b['Tag'],'as':'Tags','attributes':['id',_0x5df5('0xd'),_0x5df5('0xaa')],'required':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]?!![]:![]},{'model':_0x3f503b[_0x5df5('0x6b')],'as':_0x5df5('0xac'),'attributes':['id','name','color'],'through':_0x3b0289['query'][_0x5df5('0xab')]?{'attributes':[],'where':{'TagId':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]||undefined}}:{},'required':_0x3b0289['query'][_0x5df5('0xab')]?!![]:![]}];}else{_0x4e782b['include']=[{'all':!![]}];}}return _0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x7')](_0x4e782b);})['then'](function(_0x18281b){_0x260980[_0x5df5('0xa9')]=_0x18281b;if(_0x5b6a79==='Agents'&&_0x3b0289[_0x5df5('0x83')][_0x5df5('0xad')]===_0x5df5('0xae')){var _0x9fffdb=[];for(var _0x5372c8=0x0;_0x5372c8<_0x260980['rows'][_0x5df5('0x8b')];_0x5372c8++){_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xaf'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb1'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb['push'](_0xac9e68(_0x5df5('0xb2'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb3'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb4'),_0x260980[_0x5df5('0xa9')][_0x5372c8]['dataValues']));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb5'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));}return Promise[_0x5df5('0x8f')](_0x9fffdb)['then'](function(){return _0x260980;});}return _0x260980;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 7003cb0..a9600e0 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 _0x4bd3=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','lodash','moment','bluebird'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4bd3,0x174));var _0x34bd=function(_0x1922c2,_0x216b80){_0x1922c2=_0x1922c2-0x0;var _0x1d37f6=_0x4bd3[_0x1922c2];return _0x1d37f6;};'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});config[_0x34bd('0x8')]=_[_0x34bd('0x9')](config['redis'],{'host':_0x34bd('0xa'),'port':0x18eb});var socket=require(_0x34bd('0xb'))(new Redis(config[_0x34bd('0x8')]));require(_0x34bd('0xc'))[_0x34bd('0xd')](socket);function respondWithRpcPromise(_0x36a463,_0x4db0ba,_0x4102c1){return new BPromise(function(_0x45322f,_0x282ea6){return client[_0x34bd('0xe')](_0x36a463,_0x4102c1)['then'](function(_0x4a8622){logger[_0x34bd('0xf')]('UserProfile,\x20%s,\x20%s',_0x4db0ba,'request\x20sent');logger[_0x34bd('0x10')](_0x34bd('0x11'),_0x4db0ba,_0x34bd('0x12'),JSON[_0x34bd('0x13')](_0x4a8622));if(_0x4a8622[_0x34bd('0x14')]){if(_0x4a8622[_0x34bd('0x14')][_0x34bd('0x15')]===0x1f4){logger[_0x34bd('0x14')](_0x34bd('0x16'),_0x4db0ba,_0x4a8622['error'][_0x34bd('0x17')]);return _0x282ea6(_0x4a8622['error']['message']);}logger[_0x34bd('0x14')](_0x34bd('0x16'),_0x4db0ba,_0x4a8622[_0x34bd('0x14')][_0x34bd('0x17')]);return _0x45322f(_0x4a8622[_0x34bd('0x14')][_0x34bd('0x17')]);}else{logger[_0x34bd('0xf')](_0x34bd('0x16'),_0x4db0ba,_0x34bd('0x12'));_0x45322f(_0x4a8622[_0x34bd('0x18')][_0x34bd('0x17')]);}})['catch'](function(_0x10b977){logger[_0x34bd('0x14')](_0x34bd('0x16'),_0x4db0ba,_0x10b977);_0x282ea6(_0x10b977);});});} \ No newline at end of file +var _0x414f=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./userProfile.socket','register','request'];(function(_0x310e02,_0x472a9d){var _0x5c9ef2=function(_0x393a18){while(--_0x393a18){_0x310e02['push'](_0x310e02['shift']());}};_0x5c9ef2(++_0x472a9d);}(_0x414f,0x13f));var _0xf414=function(_0x127728,_0x11c9c5){_0x127728=_0x127728-0x0;var _0x3b6cfe=_0x414f[_0x127728];return _0x3b6cfe;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var moment=require(_0xf414('0x1'));var BPromise=require(_0xf414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf414('0x3'));var db=require(_0xf414('0x4'))['db'];var utils=require(_0xf414('0x5'));var logger=require(_0xf414('0x6'))(_0xf414('0x7'));var config=require(_0xf414('0x8'));var jayson=require(_0xf414('0x9'));var client=jayson['client'][_0xf414('0xa')]({'port':0x232a});config['redis']=_[_0xf414('0xb')](config[_0xf414('0xc')],{'host':_0xf414('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf414('0xe'))[_0xf414('0xf')](socket);function respondWithRpcPromise(_0xd6df1d,_0x33c5d9,_0x18c8b3){return new BPromise(function(_0x44648f,_0x192c0a){return client[_0xf414('0x10')](_0xd6df1d,_0x18c8b3)['then'](function(_0x5d2ff0){logger[_0xf414('0x11')](_0xf414('0x12'),_0x33c5d9,_0xf414('0x13'));logger[_0xf414('0x14')](_0xf414('0x15'),_0x33c5d9,'request\x20sent',JSON[_0xf414('0x16')](_0x5d2ff0));if(_0x5d2ff0[_0xf414('0x17')]){if(_0x5d2ff0[_0xf414('0x17')][_0xf414('0x18')]===0x1f4){logger[_0xf414('0x17')]('UserProfile,\x20%s,\x20%s',_0x33c5d9,_0x5d2ff0[_0xf414('0x17')][_0xf414('0x19')]);return _0x192c0a(_0x5d2ff0[_0xf414('0x17')][_0xf414('0x19')]);}logger[_0xf414('0x17')](_0xf414('0x12'),_0x33c5d9,_0x5d2ff0[_0xf414('0x17')][_0xf414('0x19')]);return _0x44648f(_0x5d2ff0['error'][_0xf414('0x19')]);}else{logger[_0xf414('0x11')](_0xf414('0x12'),_0x33c5d9,_0xf414('0x13'));_0x44648f(_0x5d2ff0[_0xf414('0x1a')]['message']);}})[_0xf414('0x1b')](function(_0x4b813f){logger['error'](_0xf414('0x12'),_0x33c5d9,_0x4b813f);_0x192c0a(_0x4b813f);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index c0f4a92..766a9d0 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 _0x3b5f=['length','userProfile:','./userProfile.events','save','remove','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b5f,0x6a));var _0xf3b5=function(_0x2eba34,_0x40e37f){_0x2eba34=_0x2eba34-0x0;var _0x3b5863=_0x3b5f[_0x2eba34];return _0x3b5863;};'use strict';var UserProfileEvents=require(_0xf3b5('0x0'));var events=[_0xf3b5('0x1'),_0xf3b5('0x2'),'update'];function createListener(_0xd8363b,_0x78afc0){return function(_0x429b50){_0x78afc0[_0xf3b5('0x3')](_0xd8363b,_0x429b50);};}function removeListener(_0x26d3d2,_0x3ec583){return function(){UserProfileEvents[_0xf3b5('0x4')](_0x26d3d2,_0x3ec583);};}exports[_0xf3b5('0x5')]=function(_0x5996b1){for(var _0x2bee91=0x0,_0x20d653=events[_0xf3b5('0x6')];_0x2bee91<_0x20d653;_0x2bee91++){var _0x20e99b=events[_0x2bee91];var _0x4ccdb6=createListener(_0xf3b5('0x7')+_0x20e99b,_0x5996b1);UserProfileEvents['on'](_0x20e99b,_0x4ccdb6);}}; \ No newline at end of file +var _0xe60c=['userProfile:','./userProfile.events','remove','update','register'];(function(_0x4b92e9,_0x2f6330){var _0x3de0be=function(_0x784dce){while(--_0x784dce){_0x4b92e9['push'](_0x4b92e9['shift']());}};_0x3de0be(++_0x2f6330);}(_0xe60c,0x1cd));var _0xce60=function(_0x543c51,_0xff0084){_0x543c51=_0x543c51-0x0;var _0x360555=_0xe60c[_0x543c51];return _0x360555;};'use strict';var UserProfileEvents=require(_0xce60('0x0'));var events=['save',_0xce60('0x1'),_0xce60('0x2')];function createListener(_0x1daaea,_0x11fc5e){return function(_0x1850a8){_0x11fc5e['emit'](_0x1daaea,_0x1850a8);};}function removeListener(_0x420b37,_0x21728c){return function(){UserProfileEvents['removeListener'](_0x420b37,_0x21728c);};}exports[_0xce60('0x3')]=function(_0x55242f){for(var _0xb538ae=0x0,_0x367d2e=events['length'];_0xb538ae<_0x367d2e;_0xb538ae++){var _0xd7a16f=events[_0xb538ae];var _0x12bd05=createListener(_0xce60('0x4')+_0xd7a16f,_0x55242f);UserProfileEvents['on'](_0xd7a16f,_0x12bd05);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2282783..8daa7cf 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 _0xcd5f=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3ac62d,_0x1cb3c8){var _0x56cf32=function(_0x3e69f9){while(--_0x3e69f9){_0x3ac62d['push'](_0x3ac62d['shift']());}};_0x56cf32(++_0x1cb3c8);}(_0xcd5f,0x116));var _0xfcd5=function(_0x3e7bd9,_0x385d07){_0x3e7bd9=_0x3e7bd9-0x0;var _0x44ddc2=_0xcd5f[_0x3e7bd9];return _0x44ddc2;};'use strict';var multer=require('multer');var util=require(_0xfcd5('0x0'));var path=require(_0xfcd5('0x1'));var timeout=require(_0xfcd5('0x2'));var express=require(_0xfcd5('0x3'));var router=express[_0xfcd5('0x4')]();var fs_extra=require(_0xfcd5('0x5'));var auth=require(_0xfcd5('0x6'));var interaction=require(_0xfcd5('0x7'));var config=require(_0xfcd5('0x8'));var controller=require('./userProfileResource.controller');router[_0xfcd5('0x9')]('/',auth[_0xfcd5('0xa')](),controller[_0xfcd5('0xb')]);router[_0xfcd5('0x9')](_0xfcd5('0xc'),auth[_0xfcd5('0xa')](),controller[_0xfcd5('0xd')]);router[_0xfcd5('0x9')](_0xfcd5('0xe'),auth[_0xfcd5('0xa')](),controller[_0xfcd5('0xf')]);router[_0xfcd5('0x10')]('/',auth[_0xfcd5('0xa')](),controller['create']);router[_0xfcd5('0x11')](_0xfcd5('0xe'),auth[_0xfcd5('0xa')](),controller[_0xfcd5('0x12')]);router[_0xfcd5('0x13')](_0xfcd5('0xe'),auth[_0xfcd5('0xa')](),controller[_0xfcd5('0x14')]);module[_0xfcd5('0x15')]=router; \ No newline at end of file +var _0xe3ac=['isAuthenticated','describe','/:id','show','post','put','update','exports','path','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe'];(function(_0x4f5f1f,_0x59fe82){var _0x4fde01=function(_0x5e962f){while(--_0x5e962f){_0x4f5f1f['push'](_0x4f5f1f['shift']());}};_0x4fde01(++_0x59fe82);}(_0xe3ac,0x8f));var _0xce3a=function(_0x4b7193,_0xa7cec8){_0x4b7193=_0x4b7193-0x0;var _0x20cf87=_0xe3ac[_0x4b7193];return _0x20cf87;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce3a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xce3a('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xce3a('0x2'));var config=require(_0xce3a('0x3'));var controller=require(_0xce3a('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xce3a('0x5')](_0xce3a('0x6'),auth[_0xce3a('0x7')](),controller[_0xce3a('0x8')]);router[_0xce3a('0x5')](_0xce3a('0x9'),auth[_0xce3a('0x7')](),controller[_0xce3a('0xa')]);router[_0xce3a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce3a('0xc')](_0xce3a('0x9'),auth[_0xce3a('0x7')](),controller[_0xce3a('0xd')]);router['delete'](_0xce3a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xce3a('0xe')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b7fab6f..16605d2 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 _0xbd7a=['exports','STRING','sequelize'];(function(_0x2db461,_0x1dba5c){var _0x58db06=function(_0x5572ef){while(--_0x5572ef){_0x2db461['push'](_0x2db461['shift']());}};_0x58db06(++_0x1dba5c);}(_0xbd7a,0xb6));var _0xabd7=function(_0x4ccad7,_0x2daf62){_0x4ccad7=_0x4ccad7-0x0;var _0x3a1bc0=_0xbd7a[_0x4ccad7];return _0x3a1bc0;};'use strict';var Sequelize=require(_0xabd7('0x0'));module[_0xabd7('0x1')]={'name':{'type':Sequelize[_0xabd7('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xabd7('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xecec=['STRING','INTEGER','sequelize','exports'];(function(_0x50f876,_0x5e179a){var _0x3dc20a=function(_0xe13626){while(--_0xe13626){_0x50f876['push'](_0x50f876['shift']());}};_0x3dc20a(++_0x5e179a);}(_0xecec,0xa6));var _0xcece=function(_0x38c55f,_0x33673d){_0x38c55f=_0x38c55f-0x0;var _0x940897=_0xecec[_0x38c55f];return _0x940897;};'use strict';var Sequelize=require(_0xcece('0x0'));module[_0xcece('0x1')]={'name':{'type':Sequelize[_0xcece('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcece('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xcece('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 f76d5b8..8cc2eb2 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 _0x1a85=['describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x58f3be,_0x27087e){var _0x20a4f3=function(_0x5327ab){while(--_0x5327ab){_0x58f3be['push'](_0x58f3be['shift']());}};_0x20a4f3(++_0x27087e);}(_0x1a85,0x178));var _0x51a8=function(_0x3d474e,_0x431f54){_0x3d474e=_0x3d474e-0x0;var _0x30b3e3=_0x1a85[_0x3d474e];return _0x30b3e3;};'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 hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file +var _0x6d38=['findAll','rows','show','keys','filters','intersection','create','catch','body','find','params','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','UserProfileResource','rawAttributes','type','key','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0x6d38,0x1ef));var _0x86d3=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6d38[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];function respondWithStatusCode(_0x7d4d2e,_0x440a55){_0x440a55=_0x440a55||0xcc;return function(_0x26d64c){if(_0x26d64c){return _0x7d4d2e[_0x86d3('0x14')](_0x440a55);}return _0x7d4d2e[_0x86d3('0x15')](_0x440a55)[_0x86d3('0x16')]();};}function respondWithResult(_0x12ef4a,_0x5ce2ff){_0x5ce2ff=_0x5ce2ff||0xc8;return function(_0x1c1ba8){if(_0x1c1ba8){return _0x12ef4a[_0x86d3('0x15')](_0x5ce2ff)[_0x86d3('0x17')](_0x1c1ba8);}};}function respondWithFilteredResult(_0x207f6f,_0x1ea535){return function(_0x34fb3b){if(_0x34fb3b){var _0x1ff008=typeof _0x1ea535[_0x86d3('0x18')]==='undefined'&&typeof _0x1ea535[_0x86d3('0x19')]===_0x86d3('0x1a');var _0x431b3f=_0x34fb3b[_0x86d3('0x1b')];var _0x46feec=_0x1ff008?0x0:_0x1ea535[_0x86d3('0x18')];var _0x33e459=_0x1ff008?_0x34fb3b[_0x86d3('0x1b')]:_0x1ea535[_0x86d3('0x18')]+_0x1ea535['limit'];var _0x191ba5;if(_0x33e459>=_0x431b3f){_0x33e459=_0x431b3f;_0x191ba5=0xc8;}else{_0x191ba5=0xce;}_0x207f6f['status'](_0x191ba5);return _0x207f6f[_0x86d3('0x1c')]('Content-Range',_0x46feec+'-'+_0x33e459+'/'+_0x431b3f)['json'](_0x34fb3b);}return null;};}function patchUpdates(_0x41486a){return function(_0x1edb6d){try{jsonpatch[_0x86d3('0x1d')](_0x1edb6d,_0x41486a,!![]);}catch(_0x1720ae){return BPromise['reject'](_0x1720ae);}return _0x1edb6d[_0x86d3('0x1e')]();};}function saveUpdates(_0x55e1c3,_0x36e0fa){return function(_0x3fdf67){if(_0x3fdf67){return _0x3fdf67[_0x86d3('0x1f')](_0x55e1c3)['then'](function(_0x39d819){return _0x39d819;});}return null;};}function removeEntity(_0x72b3d4,_0x1fa4ac){return function(_0x4bf5b8){if(_0x4bf5b8){return _0x4bf5b8['destroy']()[_0x86d3('0x20')](function(){_0x72b3d4['status'](0xcc)[_0x86d3('0x16')]();});}};}function handleEntityNotFound(_0x1bea5e,_0x3dfecd){return function(_0x3c5fe4){if(!_0x3c5fe4){_0x1bea5e['sendStatus'](0x194);}return _0x3c5fe4;};}function handleError(_0x481077,_0x3359e4){_0x3359e4=_0x3359e4||0x1f4;return function(_0x611764){logger['error'](_0x611764[_0x86d3('0x21')]);if(_0x611764['name']){delete _0x611764[_0x86d3('0x22')];}_0x481077[_0x86d3('0x15')](_0x3359e4)[_0x86d3('0x23')](_0x611764);};}exports[_0x86d3('0x24')]=function(_0x11a6fd,_0x14c9ff){var _0x1f203e={},_0x35d708={},_0x303f13={'count':0x0,'rows':[]};var _0x44dacf=_[_0x86d3('0x25')](db[_0x86d3('0x26')][_0x86d3('0x27')],function(_0x28c25e){return{'name':_0x28c25e['fieldName'],'type':_0x28c25e[_0x86d3('0x28')][_0x86d3('0x29')]};});_0x35d708[_0x86d3('0x2a')]=_[_0x86d3('0x25')](_0x44dacf,_0x86d3('0x22'));_0x35d708[_0x86d3('0x2b')]=_['keys'](_0x11a6fd[_0x86d3('0x2b')]);_0x35d708['filters']=_['intersection'](_0x35d708[_0x86d3('0x2a')],_0x35d708[_0x86d3('0x2b')]);_0x1f203e[_0x86d3('0x2c')]=_['intersection'](_0x35d708[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x11a6fd['query'][_0x86d3('0x2d')]));_0x1f203e[_0x86d3('0x2c')]=_0x1f203e[_0x86d3('0x2c')][_0x86d3('0x2e')]?_0x1f203e[_0x86d3('0x2c')]:_0x35d708[_0x86d3('0x2a')];if(!_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x2f')]('nolimit')){_0x1f203e['limit']=qs['limit'](_0x11a6fd[_0x86d3('0x2b')]['limit']);_0x1f203e[_0x86d3('0x18')]=qs['offset'](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x18')]);}_0x1f203e[_0x86d3('0x30')]=qs[_0x86d3('0x31')](_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x31')]);_0x1f203e[_0x86d3('0x32')]=qs['filters'](_[_0x86d3('0x33')](_0x11a6fd[_0x86d3('0x2b')],_0x35d708['filters']),_0x44dacf);if(_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]){_0x1f203e[_0x86d3('0x32')]=_[_0x86d3('0x35')](_0x1f203e['where'],{'$or':_[_0x86d3('0x25')](_0x44dacf,function(_0x42ac0d){if(_0x42ac0d[_0x86d3('0x28')]!=='VIRTUAL'){var _0x5762ca={};_0x5762ca[_0x42ac0d[_0x86d3('0x22')]]={'$like':'%'+_0x11a6fd[_0x86d3('0x2b')][_0x86d3('0x34')]+'%'};return _0x5762ca;}})});}_0x1f203e=_[_0x86d3('0x35')]({},_0x1f203e,_0x11a6fd[_0x86d3('0x36')]);var _0x3666fc={'where':_0x1f203e[_0x86d3('0x32')]};return db['UserProfileResource'][_0x86d3('0x1b')](_0x3666fc)[_0x86d3('0x20')](function(_0x2bdc67){_0x303f13[_0x86d3('0x1b')]=_0x2bdc67;if(_0x11a6fd['query'][_0x86d3('0x37')]){_0x1f203e[_0x86d3('0x38')]=[{'all':!![]}];}return db[_0x86d3('0x26')][_0x86d3('0x39')](_0x1f203e);})['then'](function(_0x587747){_0x303f13[_0x86d3('0x3a')]=_0x587747;return _0x303f13;})['then'](respondWithFilteredResult(_0x14c9ff,_0x1f203e))['catch'](handleError(_0x14c9ff,null));};exports[_0x86d3('0x3b')]=function(_0x1385fc,_0x43490a){var _0x35d6fe={'raw':![],'where':{'id':_0x1385fc['params']['id']}},_0x23ef72={};_0x23ef72[_0x86d3('0x2a')]=_[_0x86d3('0x3c')](db[_0x86d3('0x26')]['rawAttributes']);_0x23ef72[_0x86d3('0x2b')]=_[_0x86d3('0x3c')](_0x1385fc['query']);_0x23ef72[_0x86d3('0x3d')]=_[_0x86d3('0x3e')](_0x23ef72['model'],_0x23ef72['query']);_0x35d6fe['attributes']=_[_0x86d3('0x3e')](_0x23ef72[_0x86d3('0x2a')],qs[_0x86d3('0x2d')](_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x2d')]));_0x35d6fe[_0x86d3('0x2c')]=_0x35d6fe['attributes'][_0x86d3('0x2e')]?_0x35d6fe[_0x86d3('0x2c')]:_0x23ef72['model'];if(_0x1385fc[_0x86d3('0x2b')][_0x86d3('0x37')]){_0x35d6fe[_0x86d3('0x38')]=[{'all':!![]}];}_0x35d6fe=_[_0x86d3('0x35')]({},_0x35d6fe,_0x1385fc[_0x86d3('0x36')]);return db[_0x86d3('0x26')]['find'](_0x35d6fe)[_0x86d3('0x20')](handleEntityNotFound(_0x43490a,null))[_0x86d3('0x20')](respondWithResult(_0x43490a,null))['catch'](handleError(_0x43490a,null));};exports[_0x86d3('0x3f')]=function(_0x412d0e,_0xd20863){return db[_0x86d3('0x26')][_0x86d3('0x3f')](_0x412d0e['body'],{})[_0x86d3('0x20')](respondWithResult(_0xd20863,0xc9))[_0x86d3('0x40')](handleError(_0xd20863,null));};exports[_0x86d3('0x1f')]=function(_0x14fa58,_0x369b75){if(_0x14fa58[_0x86d3('0x41')]['id']){delete _0x14fa58[_0x86d3('0x41')]['id'];}return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x14fa58[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x369b75,null))[_0x86d3('0x20')](saveUpdates(_0x14fa58['body'],null))[_0x86d3('0x20')](respondWithResult(_0x369b75,null))[_0x86d3('0x40')](handleError(_0x369b75,null));};exports['destroy']=function(_0x43290d,_0x23a6ee){return db[_0x86d3('0x26')][_0x86d3('0x42')]({'where':{'id':_0x43290d[_0x86d3('0x43')]['id']}})[_0x86d3('0x20')](handleEntityNotFound(_0x23a6ee,null))['then'](removeEntity(_0x23a6ee,null))['catch'](handleError(_0x23a6ee,null));};exports['describe']=function(_0x5bedc6,_0x159253){return db[_0x86d3('0x26')][_0x86d3('0x44')]()[_0x86d3('0x20')](respondWithResult(_0x159253,null))[_0x86d3('0x40')](handleError(_0x159253,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f3b8c94..3623cd7 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 _0x4c7f=['util','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x4c7f,0x9a));var _0xf4c7=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x4c7f[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require(_0xf4c7('0x0'));var logger=require('../../config/logger')(_0xf4c7('0x1'));var moment=require(_0xf4c7('0x2'));var BPromise=require('bluebird');var rp=require(_0xf4c7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4c7('0x4'));var config=require(_0xf4c7('0x5'));var attributes=require(_0xf4c7('0x6'));module[_0xf4c7('0x7')]=function(_0x437c21,_0xf6eb8){return _0x437c21[_0xf4c7('0x8')](_0xf4c7('0x9'),attributes,{'tableName':_0xf4c7('0xa'),'paranoid':![],'indexes':[{'name':_0xf4c7('0xb'),'fields':[_0xf4c7('0xc'),_0xf4c7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7ba=['rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','resourceId','sectionId','util','../../config/logger','api','moment'];(function(_0x3b8f69,_0x3b684f){var _0x157bf6=function(_0x15843a){while(--_0x15843a){_0x3b8f69['push'](_0x3b8f69['shift']());}};_0x157bf6(++_0x3b684f);}(_0xb7ba,0x1d0));var _0xab7b=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0xb7ba[_0x3cea78];return _0x33b66b;};'use strict';var _=require('lodash');var util=require(_0xab7b('0x0'));var logger=require(_0xab7b('0x1'))(_0xab7b('0x2'));var moment=require(_0xab7b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xab7b('0x4'));var config=require(_0xab7b('0x5'));var attributes=require(_0xab7b('0x6'));module[_0xab7b('0x7')]=function(_0x38a456,_0x32aec3){return _0x38a456[_0xab7b('0x8')](_0xab7b('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xab7b('0xa'),_0xab7b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 3d35728..ebdad63 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 _0x2217=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','client'];(function(_0x398183,_0x278555){var _0x46ebe1=function(_0x5eff7d){while(--_0x5eff7d){_0x398183['push'](_0x398183['shift']());}};_0x46ebe1(++_0x278555);}(_0x2217,0x133));var _0x7221=function(_0x474320,_0x13afbf){_0x474320=_0x474320-0x0;var _0x6a1c64=_0x2217[_0x474320];return _0x6a1c64;};'use strict';var _=require(_0x7221('0x0'));var util=require(_0x7221('0x1'));var moment=require(_0x7221('0x2'));var BPromise=require(_0x7221('0x3'));var rs=require(_0x7221('0x4'));var fs=require('fs');var Redis=require(_0x7221('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7221('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7221('0x7')][_0x7221('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ac1b1,_0x116859,_0xf8636d){return new BPromise(function(_0x3ff5d1,_0x43dff8){return client[_0x7221('0x9')](_0x5ac1b1,_0xf8636d)[_0x7221('0xa')](function(_0x3d0dbf){logger[_0x7221('0xb')](_0x7221('0xc'),_0x116859,'request\x20sent');logger['debug'](_0x7221('0xd'),_0x116859,_0x7221('0xe'),JSON[_0x7221('0xf')](_0x3d0dbf));if(_0x3d0dbf[_0x7221('0x10')]){if(_0x3d0dbf[_0x7221('0x10')][_0x7221('0x11')]===0x1f4){logger[_0x7221('0x10')](_0x7221('0xc'),_0x116859,_0x3d0dbf['error'][_0x7221('0x12')]);return _0x43dff8(_0x3d0dbf[_0x7221('0x10')][_0x7221('0x12')]);}logger[_0x7221('0x10')](_0x7221('0xc'),_0x116859,_0x3d0dbf[_0x7221('0x10')]['message']);return _0x3ff5d1(_0x3d0dbf[_0x7221('0x10')]['message']);}else{logger['info'](_0x7221('0xc'),_0x116859,'request\x20sent');_0x3ff5d1(_0x3d0dbf[_0x7221('0x13')][_0x7221('0x12')]);}})[_0x7221('0x14')](function(_0x10077f){logger[_0x7221('0x10')](_0x7221('0xc'),_0x116859,_0x10077f);_0x43dff8(_0x10077f);});});} \ No newline at end of file +var _0xef24=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x158930,_0x153dbc){var _0x21347c=function(_0x4b8c23){while(--_0x4b8c23){_0x158930['push'](_0x158930['shift']());}};_0x21347c(++_0x153dbc);}(_0xef24,0x188));var _0x4ef2=function(_0x326947,_0x22848b){_0x326947=_0x326947-0x0;var _0xe1274d=_0xef24[_0x326947];return _0xe1274d;};'use strict';var _=require(_0x4ef2('0x0'));var util=require(_0x4ef2('0x1'));var moment=require(_0x4ef2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ef2('0x3'));var db=require(_0x4ef2('0x4'))['db'];var utils=require(_0x4ef2('0x5'));var logger=require(_0x4ef2('0x6'))(_0x4ef2('0x7'));var config=require(_0x4ef2('0x8'));var jayson=require(_0x4ef2('0x9'));var client=jayson['client'][_0x4ef2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70af2b,_0x3fd759,_0x1d91aa){return new BPromise(function(_0x4579ae,_0x4dd019){return client[_0x4ef2('0xb')](_0x70af2b,_0x1d91aa)[_0x4ef2('0xc')](function(_0x316d15){logger[_0x4ef2('0xd')](_0x4ef2('0xe'),_0x3fd759,_0x4ef2('0xf'));logger[_0x4ef2('0x10')](_0x4ef2('0x11'),_0x3fd759,_0x4ef2('0xf'),JSON[_0x4ef2('0x12')](_0x316d15));if(_0x316d15['error']){if(_0x316d15['error'][_0x4ef2('0x13')]===0x1f4){logger[_0x4ef2('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x3fd759,_0x316d15[_0x4ef2('0x14')][_0x4ef2('0x15')]);return _0x4dd019(_0x316d15[_0x4ef2('0x14')][_0x4ef2('0x15')]);}logger['error'](_0x4ef2('0xe'),_0x3fd759,_0x316d15['error'][_0x4ef2('0x15')]);return _0x4579ae(_0x316d15[_0x4ef2('0x14')]['message']);}else{logger[_0x4ef2('0xd')](_0x4ef2('0xe'),_0x3fd759,_0x4ef2('0xf'));_0x4579ae(_0x316d15[_0x4ef2('0x16')][_0x4ef2('0x15')]);}})[_0x4ef2('0x17')](function(_0x504388){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3fd759,_0x504388);_0x4dd019(_0x504388);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1dac4d2..462fd9d 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 _0x4983=['./userProfileSection.controller','get','isAuthenticated','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3c7c2d,_0x27ba0e){var _0x17d095=function(_0x48fa0e){while(--_0x48fa0e){_0x3c7c2d['push'](_0x3c7c2d['shift']());}};_0x17d095(++_0x27ba0e);}(_0x4983,0x1b0));var _0x3498=function(_0x45efab,_0x1d1e61){_0x45efab=_0x45efab-0x0;var _0x13ea33=_0x4983[_0x45efab];return _0x13ea33;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3498('0x0'));var timeout=require(_0x3498('0x1'));var express=require(_0x3498('0x2'));var router=express[_0x3498('0x3')]();var fs_extra=require(_0x3498('0x4'));var auth=require(_0x3498('0x5'));var interaction=require(_0x3498('0x6'));var config=require(_0x3498('0x7'));var controller=require(_0x3498('0x8'));router[_0x3498('0x9')]('/',auth[_0x3498('0xa')](),controller['index']);router[_0x3498('0x9')](_0x3498('0xb'),auth[_0x3498('0xa')](),controller[_0x3498('0xc')]);router['get']('/:id',auth[_0x3498('0xa')](),controller[_0x3498('0xd')]);router[_0x3498('0xe')]('/',auth[_0x3498('0xa')](),controller[_0x3498('0xf')]);router[_0x3498('0x10')]('/:id',auth[_0x3498('0xa')](),controller[_0x3498('0x11')]);router[_0x3498('0x12')](_0x3498('0x13'),auth[_0x3498('0xa')](),controller[_0x3498('0x14')]);module[_0x3498('0x15')]=router; \ No newline at end of file +var _0xb368=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0xb4788,_0x1efb8d){var _0xd49d21=function(_0x2b2a2b){while(--_0x2b2a2b){_0xb4788['push'](_0xb4788['shift']());}};_0xd49d21(++_0x1efb8d);}(_0xb368,0x19f));var _0x8b36=function(_0x551588,_0x42e3e3){_0x551588=_0x551588-0x0;var _0x3c700e=_0xb368[_0x551588];return _0x3c700e;};'use strict';var multer=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var path=require('path');var timeout=require(_0x8b36('0x2'));var express=require(_0x8b36('0x3'));var router=express[_0x8b36('0x4')]();var fs_extra=require(_0x8b36('0x5'));var auth=require(_0x8b36('0x6'));var interaction=require(_0x8b36('0x7'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x8b36('0x8')]('/',auth[_0x8b36('0x9')](),controller['index']);router[_0x8b36('0x8')](_0x8b36('0xa'),auth[_0x8b36('0x9')](),controller[_0x8b36('0xb')]);router[_0x8b36('0x8')](_0x8b36('0xc'),auth[_0x8b36('0x9')](),controller[_0x8b36('0xd')]);router[_0x8b36('0xe')]('/',auth[_0x8b36('0x9')](),controller[_0x8b36('0xf')]);router[_0x8b36('0x10')](_0x8b36('0xc'),auth[_0x8b36('0x9')](),controller[_0x8b36('0x11')]);router[_0x8b36('0x12')]('/:id',auth[_0x8b36('0x9')](),controller[_0x8b36('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9c34be4..3e9edeb 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 _0x3266=['getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions'];(function(_0x5303b9,_0x5c548){var _0x455125=function(_0x24ad74){while(--_0x24ad74){_0x5303b9['push'](_0x5303b9['shift']());}};_0x455125(++_0x5c548);}(_0x3266,0x6a));var _0x6326=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x3266[_0x36c6eb];return _0x30675b;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x6326('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x6326('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x6326('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x6326('0x2')],'set':function(_0x265264){this['setDataValue'](_0x6326('0x5'),_0x265264?_0x265264['join'](''):[]);},'get':function(){return this[_0x6326('0x6')](_0x6326('0x5'))?this[_0x6326('0x6')]('crudPermissions')[_0x6326('0x7')](''):[];}}}; \ No newline at end of file +var _0xa5fa=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x4bdfc6,_0x4c2991){var _0x5091d0=function(_0x16cdc1){while(--_0x16cdc1){_0x4bdfc6['push'](_0x4bdfc6['shift']());}};_0x5091d0(++_0x4c2991);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x40c0dd,_0x171ea5){_0x40c0dd=_0x40c0dd-0x0;var _0x2d4984=_0xa5fa[_0x40c0dd];return _0x2d4984;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'name':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa5f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa5f('0x1')],'set':function(_0x4d1c8b){this[_0xaa5f('0x4')](_0xaa5f('0x5'),_0x4d1c8b?_0x4d1c8b[_0xaa5f('0x6')](''):[]);},'get':function(){return this[_0xaa5f('0x7')](_0xaa5f('0x5'))?this[_0xaa5f('0x7')](_0xaa5f('0x5'))[_0xaa5f('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index cfe682c..603c595 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 _0xec21=['error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0xec21,0x75));var _0x1ec2=function(_0xacf8c,_0x1d484b){_0xacf8c=_0xacf8c-0x0;var _0x21fd7b=_0xec21[_0xacf8c];return _0x21fd7b;};'use strict';var emlformat=require(_0x1ec2('0x0'));var rimraf=require(_0x1ec2('0x1'));var zipdir=require(_0x1ec2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ec2('0x3'));var moment=require(_0x1ec2('0x4'));var BPromise=require(_0x1ec2('0x5'));var Mustache=require(_0x1ec2('0x6'));var util=require(_0x1ec2('0x7'));var path=require(_0x1ec2('0x8'));var sox=require(_0x1ec2('0x9'));var csv=require(_0x1ec2('0xa'));var ejs=require(_0x1ec2('0xb'));var fs=require('fs');var fs_extra=require(_0x1ec2('0xc'));var _=require(_0x1ec2('0xd'));var squel=require('squel');var crypto=require(_0x1ec2('0xe'));var jsforce=require(_0x1ec2('0xf'));var deskjs=require(_0x1ec2('0x10'));var toCsv=require(_0x1ec2('0xa'));var querystring=require(_0x1ec2('0x11'));var Papa=require('papaparse');var Redis=require(_0x1ec2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1ec2('0x13'));var as=require(_0x1ec2('0x14'));var hardwareService=require(_0x1ec2('0x15'));var logger=require('../../config/logger')(_0x1ec2('0x16'));var utils=require(_0x1ec2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1ec2('0x18'));var db=require(_0x1ec2('0x19'))['db'];function respondWithStatusCode(_0x4b30ee,_0x269960){_0x269960=_0x269960||0xcc;return function(_0x165f33){if(_0x165f33){return _0x4b30ee[_0x1ec2('0x1a')](_0x269960);}return _0x4b30ee[_0x1ec2('0x1b')](_0x269960)[_0x1ec2('0x1c')]();};}function respondWithResult(_0x1d7de9,_0x244bc4){_0x244bc4=_0x244bc4||0xc8;return function(_0x47017b){if(_0x47017b){return _0x1d7de9[_0x1ec2('0x1b')](_0x244bc4)['json'](_0x47017b);}};}function respondWithFilteredResult(_0x302668,_0x1dd630){return function(_0x1dfcdf){if(_0x1dfcdf){var _0x5d024c=typeof _0x1dd630[_0x1ec2('0x1d')]===_0x1ec2('0x1e')&&typeof _0x1dd630[_0x1ec2('0x1f')]===_0x1ec2('0x1e');var _0x285b10=_0x1dfcdf[_0x1ec2('0x20')];var _0x256fc0=_0x5d024c?0x0:_0x1dd630[_0x1ec2('0x1d')];var _0x1f53b4=_0x5d024c?_0x1dfcdf[_0x1ec2('0x20')]:_0x1dd630[_0x1ec2('0x1d')]+_0x1dd630[_0x1ec2('0x1f')];var _0x413ad8;if(_0x1f53b4>=_0x285b10){_0x1f53b4=_0x285b10;_0x413ad8=0xc8;}else{_0x413ad8=0xce;}_0x302668[_0x1ec2('0x1b')](_0x413ad8);return _0x302668[_0x1ec2('0x21')](_0x1ec2('0x22'),_0x256fc0+'-'+_0x1f53b4+'/'+_0x285b10)[_0x1ec2('0x23')](_0x1dfcdf);}return null;};}function patchUpdates(_0x2af758){return function(_0x381032){try{jsonpatch[_0x1ec2('0x24')](_0x381032,_0x2af758,!![]);}catch(_0x3cf249){return BPromise['reject'](_0x3cf249);}return _0x381032[_0x1ec2('0x25')]();};}function saveUpdates(_0x5a98a2,_0x1d1ca4){return function(_0x14ecf3){if(_0x14ecf3){return _0x14ecf3[_0x1ec2('0x26')](_0x5a98a2)['then'](function(_0x40a9c7){return _0x40a9c7;});}return null;};}function removeEntity(_0xa71108,_0x2ded56){return function(_0x2afbea){if(_0x2afbea){return _0x2afbea[_0x1ec2('0x27')]()[_0x1ec2('0x28')](function(){_0xa71108[_0x1ec2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x622153,_0x41f45c){return function(_0x16850b){if(!_0x16850b){_0x622153[_0x1ec2('0x1a')](0x194);}return _0x16850b;};}function handleError(_0xf02acd,_0x570e56){_0x570e56=_0x570e56||0x1f4;return function(_0x4f0de0){logger[_0x1ec2('0x29')](_0x4f0de0[_0x1ec2('0x2a')]);if(_0x4f0de0[_0x1ec2('0x2b')]){delete _0x4f0de0['name'];}_0xf02acd[_0x1ec2('0x1b')](_0x570e56)[_0x1ec2('0x2c')](_0x4f0de0);};}exports[_0x1ec2('0x2d')]=function(_0x100283,_0x147497){var _0x5cf65c={},_0x164afb={},_0xc42523={'count':0x0,'rows':[]};var _0x450d43=_[_0x1ec2('0x2e')](db[_0x1ec2('0x2f')][_0x1ec2('0x30')],function(_0x1f47d6){return{'name':_0x1f47d6[_0x1ec2('0x31')],'type':_0x1f47d6[_0x1ec2('0x32')][_0x1ec2('0x33')]};});_0x164afb[_0x1ec2('0x34')]=_[_0x1ec2('0x2e')](_0x450d43,'name');_0x164afb[_0x1ec2('0x35')]=_[_0x1ec2('0x36')](_0x100283[_0x1ec2('0x35')]);_0x164afb['filters']=_[_0x1ec2('0x37')](_0x164afb[_0x1ec2('0x34')],_0x164afb[_0x1ec2('0x35')]);_0x5cf65c[_0x1ec2('0x38')]=_[_0x1ec2('0x37')](_0x164afb[_0x1ec2('0x34')],qs['fields'](_0x100283['query'][_0x1ec2('0x39')]));_0x5cf65c[_0x1ec2('0x38')]=_0x5cf65c[_0x1ec2('0x38')][_0x1ec2('0x3a')]?_0x5cf65c['attributes']:_0x164afb['model'];if(!_0x100283['query'][_0x1ec2('0x3b')](_0x1ec2('0x3c'))){_0x5cf65c[_0x1ec2('0x1f')]=qs[_0x1ec2('0x1f')](_0x100283[_0x1ec2('0x35')]['limit']);_0x5cf65c[_0x1ec2('0x1d')]=qs[_0x1ec2('0x1d')](_0x100283[_0x1ec2('0x35')]['offset']);}_0x5cf65c[_0x1ec2('0x3d')]=qs[_0x1ec2('0x3e')](_0x100283['query'][_0x1ec2('0x3e')]);_0x5cf65c[_0x1ec2('0x3f')]=qs[_0x1ec2('0x40')](_['pick'](_0x100283['query'],_0x164afb[_0x1ec2('0x40')]),_0x450d43);if(_0x100283[_0x1ec2('0x35')][_0x1ec2('0x41')]){_0x5cf65c[_0x1ec2('0x3f')]=_[_0x1ec2('0x42')](_0x5cf65c[_0x1ec2('0x3f')],{'$or':_[_0x1ec2('0x2e')](_0x450d43,function(_0x408ae2){if(_0x408ae2['type']!==_0x1ec2('0x43')){var _0x50a494={};_0x50a494[_0x408ae2['name']]={'$like':'%'+_0x100283[_0x1ec2('0x35')]['filter']+'%'};return _0x50a494;}})});}_0x5cf65c=_[_0x1ec2('0x42')]({},_0x5cf65c,_0x100283[_0x1ec2('0x44')]);var _0x1b3378={'where':_0x5cf65c[_0x1ec2('0x3f')]};return db[_0x1ec2('0x2f')][_0x1ec2('0x20')](_0x1b3378)[_0x1ec2('0x28')](function(_0x4a7fec){_0xc42523[_0x1ec2('0x20')]=_0x4a7fec;if(_0x100283[_0x1ec2('0x35')][_0x1ec2('0x45')]){_0x5cf65c[_0x1ec2('0x46')]=[{'all':!![]}];}return db[_0x1ec2('0x2f')]['findAll'](_0x5cf65c);})['then'](function(_0xae11f3){_0xc42523[_0x1ec2('0x47')]=_0xae11f3;return _0xc42523;})[_0x1ec2('0x28')](respondWithFilteredResult(_0x147497,_0x5cf65c))[_0x1ec2('0x48')](handleError(_0x147497,null));};exports[_0x1ec2('0x49')]=function(_0xe9bb71,_0x436706){var _0xa40194={'raw':![],'where':{'id':_0xe9bb71[_0x1ec2('0x4a')]['id']}},_0x361516={};_0x361516[_0x1ec2('0x34')]=_[_0x1ec2('0x36')](db[_0x1ec2('0x2f')][_0x1ec2('0x30')]);_0x361516[_0x1ec2('0x35')]=_[_0x1ec2('0x36')](_0xe9bb71[_0x1ec2('0x35')]);_0x361516[_0x1ec2('0x40')]=_[_0x1ec2('0x37')](_0x361516[_0x1ec2('0x34')],_0x361516[_0x1ec2('0x35')]);_0xa40194['attributes']=_[_0x1ec2('0x37')](_0x361516[_0x1ec2('0x34')],qs[_0x1ec2('0x39')](_0xe9bb71['query'][_0x1ec2('0x39')]));_0xa40194['attributes']=_0xa40194[_0x1ec2('0x38')][_0x1ec2('0x3a')]?_0xa40194[_0x1ec2('0x38')]:_0x361516[_0x1ec2('0x34')];if(_0xe9bb71[_0x1ec2('0x35')][_0x1ec2('0x45')]){_0xa40194[_0x1ec2('0x46')]=[{'all':!![]}];}_0xa40194=_[_0x1ec2('0x42')]({},_0xa40194,_0xe9bb71[_0x1ec2('0x44')]);return db[_0x1ec2('0x2f')]['find'](_0xa40194)[_0x1ec2('0x28')](handleEntityNotFound(_0x436706,null))[_0x1ec2('0x28')](respondWithResult(_0x436706,null))[_0x1ec2('0x48')](handleError(_0x436706,null));};exports[_0x1ec2('0x4b')]=function(_0x5e8ed7,_0x4d554a){return db['UserProfileSection'][_0x1ec2('0x4b')](_0x5e8ed7['body'],{})[_0x1ec2('0x28')](respondWithResult(_0x4d554a,0xc9))['catch'](handleError(_0x4d554a,null));};exports[_0x1ec2('0x26')]=function(_0x3e8004,_0x47ce07){if(_0x3e8004[_0x1ec2('0x4c')]['id']){delete _0x3e8004['body']['id'];}return db[_0x1ec2('0x2f')][_0x1ec2('0x4d')]({'where':{'id':_0x3e8004[_0x1ec2('0x4a')]['id']}})[_0x1ec2('0x28')](handleEntityNotFound(_0x47ce07,null))[_0x1ec2('0x28')](saveUpdates(_0x3e8004['body'],null))['then'](respondWithResult(_0x47ce07,null))[_0x1ec2('0x48')](handleError(_0x47ce07,null));};exports[_0x1ec2('0x27')]=function(_0x23a239,_0x22ac55){return db[_0x1ec2('0x2f')][_0x1ec2('0x4d')]({'where':{'id':_0x23a239['params']['id']}})[_0x1ec2('0x28')](handleEntityNotFound(_0x22ac55,null))[_0x1ec2('0x28')](removeEntity(_0x22ac55,null))[_0x1ec2('0x48')](handleError(_0x22ac55,null));};exports['describe']=function(_0x51b7d4,_0x266056){return db[_0x1ec2('0x2f')][_0x1ec2('0x4e')]()[_0x1ec2('0x28')](respondWithResult(_0x266056,null))[_0x1ec2('0x48')](handleError(_0x266056,null));}; \ No newline at end of file +var _0xf1e3=['offset','undefined','limit','count','apply','reject','save','update','then','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','fields','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x1a0917,_0x1d0ff7){var _0x356c70=function(_0x477490){while(--_0x477490){_0x1a0917['push'](_0x1a0917['shift']());}};_0x356c70(++_0x1d0ff7);}(_0xf1e3,0xc1));var _0x3f1e=function(_0x2c7dc6,_0x3c4ce0){_0x2c7dc6=_0x2c7dc6-0x0;var _0x10002b=_0xf1e3[_0x2c7dc6];return _0x10002b;};'use strict';var emlformat=require(_0x3f1e('0x0'));var rimraf=require(_0x3f1e('0x1'));var zipdir=require(_0x3f1e('0x2'));var jsonpatch=require(_0x3f1e('0x3'));var rp=require('request-promise');var moment=require(_0x3f1e('0x4'));var BPromise=require(_0x3f1e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3f1e('0x6'));var sox=require(_0x3f1e('0x7'));var csv=require(_0x3f1e('0x8'));var ejs=require(_0x3f1e('0x9'));var fs=require('fs');var fs_extra=require(_0x3f1e('0xa'));var _=require(_0x3f1e('0xb'));var squel=require('squel');var crypto=require(_0x3f1e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f1e('0xd'));var toCsv=require(_0x3f1e('0x8'));var querystring=require(_0x3f1e('0xe'));var Papa=require('papaparse');var Redis=require(_0x3f1e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3f1e('0x10'));var as=require(_0x3f1e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f1e('0x12'))(_0x3f1e('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3f1e('0x14'));var db=require(_0x3f1e('0x15'))['db'];function respondWithStatusCode(_0x3da3d0,_0x21e7f8){_0x21e7f8=_0x21e7f8||0xcc;return function(_0x2834e6){if(_0x2834e6){return _0x3da3d0[_0x3f1e('0x16')](_0x21e7f8);}return _0x3da3d0['status'](_0x21e7f8)[_0x3f1e('0x17')]();};}function respondWithResult(_0x490332,_0x36285f){_0x36285f=_0x36285f||0xc8;return function(_0x212543){if(_0x212543){return _0x490332[_0x3f1e('0x18')](_0x36285f)[_0x3f1e('0x19')](_0x212543);}};}function respondWithFilteredResult(_0x271557,_0x2cb541){return function(_0x2898bb){if(_0x2898bb){var _0x3aa54a=typeof _0x2cb541[_0x3f1e('0x1a')]===_0x3f1e('0x1b')&&typeof _0x2cb541[_0x3f1e('0x1c')]===_0x3f1e('0x1b');var _0x24265d=_0x2898bb[_0x3f1e('0x1d')];var _0x1762c6=_0x3aa54a?0x0:_0x2cb541[_0x3f1e('0x1a')];var _0x38e99b=_0x3aa54a?_0x2898bb[_0x3f1e('0x1d')]:_0x2cb541[_0x3f1e('0x1a')]+_0x2cb541[_0x3f1e('0x1c')];var _0x1ec6e9;if(_0x38e99b>=_0x24265d){_0x38e99b=_0x24265d;_0x1ec6e9=0xc8;}else{_0x1ec6e9=0xce;}_0x271557[_0x3f1e('0x18')](_0x1ec6e9);return _0x271557['set']('Content-Range',_0x1762c6+'-'+_0x38e99b+'/'+_0x24265d)[_0x3f1e('0x19')](_0x2898bb);}return null;};}function patchUpdates(_0x5d53d3){return function(_0x4c30f7){try{jsonpatch[_0x3f1e('0x1e')](_0x4c30f7,_0x5d53d3,!![]);}catch(_0x54b4d5){return BPromise[_0x3f1e('0x1f')](_0x54b4d5);}return _0x4c30f7[_0x3f1e('0x20')]();};}function saveUpdates(_0x29215a,_0x2a143c){return function(_0x6a01f2){if(_0x6a01f2){return _0x6a01f2[_0x3f1e('0x21')](_0x29215a)['then'](function(_0x1de076){return _0x1de076;});}return null;};}function removeEntity(_0x5f3e64,_0x1a54a5){return function(_0x55dfa1){if(_0x55dfa1){return _0x55dfa1['destroy']()[_0x3f1e('0x22')](function(){_0x5f3e64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f8107,_0x51f93e){return function(_0x12efcc){if(!_0x12efcc){_0x1f8107[_0x3f1e('0x16')](0x194);}return _0x12efcc;};}function handleError(_0x4b2457,_0x43756b){_0x43756b=_0x43756b||0x1f4;return function(_0x14bc8b){logger['error'](_0x14bc8b[_0x3f1e('0x23')]);if(_0x14bc8b[_0x3f1e('0x24')]){delete _0x14bc8b[_0x3f1e('0x24')];}_0x4b2457['status'](_0x43756b)[_0x3f1e('0x25')](_0x14bc8b);};}exports[_0x3f1e('0x26')]=function(_0x4ff5c7,_0x30bcc7){var _0x3c84cc={},_0x4fd9c4={},_0x3ae026={'count':0x0,'rows':[]};var _0x5946f7=_[_0x3f1e('0x27')](db[_0x3f1e('0x28')][_0x3f1e('0x29')],function(_0x3ec0ac){return{'name':_0x3ec0ac[_0x3f1e('0x2a')],'type':_0x3ec0ac[_0x3f1e('0x2b')]['key']};});_0x4fd9c4[_0x3f1e('0x2c')]=_[_0x3f1e('0x27')](_0x5946f7,'name');_0x4fd9c4[_0x3f1e('0x2d')]=_[_0x3f1e('0x2e')](_0x4ff5c7[_0x3f1e('0x2d')]);_0x4fd9c4[_0x3f1e('0x2f')]=_[_0x3f1e('0x30')](_0x4fd9c4[_0x3f1e('0x2c')],_0x4fd9c4[_0x3f1e('0x2d')]);_0x3c84cc['attributes']=_[_0x3f1e('0x30')](_0x4fd9c4[_0x3f1e('0x2c')],qs['fields'](_0x4ff5c7[_0x3f1e('0x2d')]['fields']));_0x3c84cc['attributes']=_0x3c84cc[_0x3f1e('0x31')]['length']?_0x3c84cc[_0x3f1e('0x31')]:_0x4fd9c4[_0x3f1e('0x2c')];if(!_0x4ff5c7['query'][_0x3f1e('0x32')](_0x3f1e('0x33'))){_0x3c84cc[_0x3f1e('0x1c')]=qs[_0x3f1e('0x1c')](_0x4ff5c7[_0x3f1e('0x2d')][_0x3f1e('0x1c')]);_0x3c84cc[_0x3f1e('0x1a')]=qs[_0x3f1e('0x1a')](_0x4ff5c7['query']['offset']);}_0x3c84cc[_0x3f1e('0x34')]=qs[_0x3f1e('0x35')](_0x4ff5c7[_0x3f1e('0x2d')]['sort']);_0x3c84cc[_0x3f1e('0x36')]=qs[_0x3f1e('0x2f')](_[_0x3f1e('0x37')](_0x4ff5c7[_0x3f1e('0x2d')],_0x4fd9c4[_0x3f1e('0x2f')]),_0x5946f7);if(_0x4ff5c7[_0x3f1e('0x2d')][_0x3f1e('0x38')]){_0x3c84cc[_0x3f1e('0x36')]=_['merge'](_0x3c84cc[_0x3f1e('0x36')],{'$or':_[_0x3f1e('0x27')](_0x5946f7,function(_0x59e73a){if(_0x59e73a[_0x3f1e('0x2b')]!==_0x3f1e('0x39')){var _0x5063f1={};_0x5063f1[_0x59e73a[_0x3f1e('0x24')]]={'$like':'%'+_0x4ff5c7[_0x3f1e('0x2d')][_0x3f1e('0x38')]+'%'};return _0x5063f1;}})});}_0x3c84cc=_[_0x3f1e('0x3a')]({},_0x3c84cc,_0x4ff5c7[_0x3f1e('0x3b')]);var _0x144589={'where':_0x3c84cc['where']};return db[_0x3f1e('0x28')][_0x3f1e('0x1d')](_0x144589)[_0x3f1e('0x22')](function(_0x568cb9){_0x3ae026[_0x3f1e('0x1d')]=_0x568cb9;if(_0x4ff5c7[_0x3f1e('0x2d')][_0x3f1e('0x3c')]){_0x3c84cc[_0x3f1e('0x3d')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x3c84cc);})[_0x3f1e('0x22')](function(_0x582f19){_0x3ae026[_0x3f1e('0x3e')]=_0x582f19;return _0x3ae026;})['then'](respondWithFilteredResult(_0x30bcc7,_0x3c84cc))[_0x3f1e('0x3f')](handleError(_0x30bcc7,null));};exports[_0x3f1e('0x40')]=function(_0x2eb66d,_0x9d6a3f){var _0x50988b={'raw':![],'where':{'id':_0x2eb66d[_0x3f1e('0x41')]['id']}},_0x4d7911={};_0x4d7911[_0x3f1e('0x2c')]=_[_0x3f1e('0x2e')](db['UserProfileSection'][_0x3f1e('0x29')]);_0x4d7911[_0x3f1e('0x2d')]=_['keys'](_0x2eb66d[_0x3f1e('0x2d')]);_0x4d7911[_0x3f1e('0x2f')]=_['intersection'](_0x4d7911[_0x3f1e('0x2c')],_0x4d7911['query']);_0x50988b[_0x3f1e('0x31')]=_[_0x3f1e('0x30')](_0x4d7911[_0x3f1e('0x2c')],qs[_0x3f1e('0x42')](_0x2eb66d[_0x3f1e('0x2d')][_0x3f1e('0x42')]));_0x50988b[_0x3f1e('0x31')]=_0x50988b[_0x3f1e('0x31')][_0x3f1e('0x43')]?_0x50988b[_0x3f1e('0x31')]:_0x4d7911[_0x3f1e('0x2c')];if(_0x2eb66d['query'][_0x3f1e('0x3c')]){_0x50988b[_0x3f1e('0x3d')]=[{'all':!![]}];}_0x50988b=_['merge']({},_0x50988b,_0x2eb66d[_0x3f1e('0x3b')]);return db['UserProfileSection']['find'](_0x50988b)['then'](handleEntityNotFound(_0x9d6a3f,null))[_0x3f1e('0x22')](respondWithResult(_0x9d6a3f,null))[_0x3f1e('0x3f')](handleError(_0x9d6a3f,null));};exports[_0x3f1e('0x44')]=function(_0x48e56d,_0x374f9a){return db[_0x3f1e('0x28')][_0x3f1e('0x44')](_0x48e56d[_0x3f1e('0x45')],{})[_0x3f1e('0x22')](respondWithResult(_0x374f9a,0xc9))['catch'](handleError(_0x374f9a,null));};exports[_0x3f1e('0x21')]=function(_0x5e53b9,_0x3dc4ba){if(_0x5e53b9[_0x3f1e('0x45')]['id']){delete _0x5e53b9[_0x3f1e('0x45')]['id'];}return db[_0x3f1e('0x28')][_0x3f1e('0x46')]({'where':{'id':_0x5e53b9['params']['id']}})[_0x3f1e('0x22')](handleEntityNotFound(_0x3dc4ba,null))[_0x3f1e('0x22')](saveUpdates(_0x5e53b9[_0x3f1e('0x45')],null))[_0x3f1e('0x22')](respondWithResult(_0x3dc4ba,null))['catch'](handleError(_0x3dc4ba,null));};exports[_0x3f1e('0x47')]=function(_0x17e386,_0x15bcf2){return db['UserProfileSection'][_0x3f1e('0x46')]({'where':{'id':_0x17e386[_0x3f1e('0x41')]['id']}})[_0x3f1e('0x22')](handleEntityNotFound(_0x15bcf2,null))[_0x3f1e('0x22')](removeEntity(_0x15bcf2,null))[_0x3f1e('0x3f')](handleError(_0x15bcf2,null));};exports[_0x3f1e('0x48')]=function(_0xe5cf2b,_0x21dd06){return db[_0x3f1e('0x28')][_0x3f1e('0x48')]()[_0x3f1e('0x22')](respondWithResult(_0x21dd06,null))[_0x3f1e('0x3f')](handleError(_0x21dd06,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d1e1649..0d72ed5 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 _0x2186=['sectionId','userProfileId','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','user_profile_has_sections','compositeIndex'];(function(_0x2a3eed,_0x5776f0){var _0x351829=function(_0x4f87d4){while(--_0x4f87d4){_0x2a3eed['push'](_0x2a3eed['shift']());}};_0x351829(++_0x5776f0);}(_0x2186,0x1ca));var _0x6218=function(_0x105d88,_0x227987){_0x105d88=_0x105d88-0x0;var _0x23c877=_0x2186[_0x105d88];return _0x23c877;};'use strict';var _=require(_0x6218('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6218('0x1'));var BPromise=require(_0x6218('0x2'));var rp=require(_0x6218('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6218('0x4'));var config=require(_0x6218('0x5'));var attributes=require(_0x6218('0x6'));module[_0x6218('0x7')]=function(_0x1cc08f,_0x4cf11b){return _0x1cc08f['define']('UserProfileSection',attributes,{'tableName':_0x6218('0x8'),'paranoid':![],'indexes':[{'name':_0x6218('0x9'),'fields':[_0x6218('0xa'),_0x6218('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1df0=['define','user_profile_has_sections','sectionId','userProfileId','../../config/logger','api','moment','bluebird','path','../../config/environment','./userProfileSection.attributes'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x1df0,0x7d));var _0x01df=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x1df0[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x01df('0x0'))(_0x01df('0x1'));var moment=require(_0x01df('0x2'));var BPromise=require(_0x01df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01df('0x4'));var rimraf=require('rimraf');var config=require(_0x01df('0x5'));var attributes=require(_0x01df('0x6'));module['exports']=function(_0x1f4446,_0x45851a){return _0x1f4446[_0x01df('0x7')]('UserProfileSection',attributes,{'tableName':_0x01df('0x8'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x01df('0x9'),_0x01df('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 725fe8a..4a13b54 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 _0xe303=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x20fee6,_0x1f1f18){var _0x26a0f3=function(_0x231b28){while(--_0x231b28){_0x20fee6['push'](_0x20fee6['shift']());}};_0x26a0f3(++_0x1f1f18);}(_0xe303,0x11b));var _0x3e30=function(_0x16a6c9,_0x201cc8){_0x16a6c9=_0x16a6c9-0x0;var _0x1a104e=_0xe303[_0x16a6c9];return _0x1a104e;};'use strict';var _=require(_0x3e30('0x0'));var util=require(_0x3e30('0x1'));var moment=require('moment');var BPromise=require(_0x3e30('0x2'));var rs=require(_0x3e30('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e30('0x4'))['db'];var utils=require(_0x3e30('0x5'));var logger=require(_0x3e30('0x6'))(_0x3e30('0x7'));var config=require(_0x3e30('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48f6ce,_0x21bf5c,_0x28af0a){return new BPromise(function(_0x59eb90,_0x14e603){return client[_0x3e30('0xa')](_0x48f6ce,_0x28af0a)[_0x3e30('0xb')](function(_0x1d5e9d){logger[_0x3e30('0xc')](_0x3e30('0xd'),_0x21bf5c,_0x3e30('0xe'));logger['debug'](_0x3e30('0xf'),_0x21bf5c,'request\x20sent',JSON[_0x3e30('0x10')](_0x1d5e9d));if(_0x1d5e9d[_0x3e30('0x11')]){if(_0x1d5e9d[_0x3e30('0x11')][_0x3e30('0x12')]===0x1f4){logger[_0x3e30('0x11')](_0x3e30('0xd'),_0x21bf5c,_0x1d5e9d[_0x3e30('0x11')][_0x3e30('0x13')]);return _0x14e603(_0x1d5e9d['error'][_0x3e30('0x13')]);}logger[_0x3e30('0x11')](_0x3e30('0xd'),_0x21bf5c,_0x1d5e9d['error']['message']);return _0x59eb90(_0x1d5e9d[_0x3e30('0x11')][_0x3e30('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x21bf5c,'request\x20sent');_0x59eb90(_0x1d5e9d['result'][_0x3e30('0x13')]);}})[_0x3e30('0x14')](function(_0x1f6816){logger[_0x3e30('0x11')](_0x3e30('0xd'),_0x21bf5c,_0x1f6816);_0x14e603(_0x1f6816);});});} \ No newline at end of file +var _0x737f=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','UserProfileSection,\x20%s,\x20%s','message'];(function(_0x527a53,_0x3265d6){var _0x2332f5=function(_0x3b2d90){while(--_0x3b2d90){_0x527a53['push'](_0x527a53['shift']());}};_0x2332f5(++_0x3265d6);}(_0x737f,0x79));var _0xf737=function(_0x22f4ce,_0x5bbbed){_0x22f4ce=_0x22f4ce-0x0;var _0x3ab0ac=_0x737f[_0x22f4ce];return _0x3ab0ac;};'use strict';var _=require(_0xf737('0x0'));var util=require(_0xf737('0x1'));var moment=require('moment');var BPromise=require(_0xf737('0x2'));var rs=require(_0xf737('0x3'));var fs=require('fs');var Redis=require(_0xf737('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf737('0x5'));var logger=require(_0xf737('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf737('0x7'));var client=jayson[_0xf737('0x8')][_0xf737('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d7553,_0x1e974d,_0x10ec1a){return new BPromise(function(_0x3dd151,_0x57351d){return client[_0xf737('0xa')](_0x2d7553,_0x10ec1a)[_0xf737('0xb')](function(_0x75652d){logger[_0xf737('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x1e974d,_0xf737('0xd'));logger['debug'](_0xf737('0xe'),_0x1e974d,_0xf737('0xd'),JSON['stringify'](_0x75652d));if(_0x75652d[_0xf737('0xf')]){if(_0x75652d['error'][_0xf737('0x10')]===0x1f4){logger[_0xf737('0xf')](_0xf737('0x11'),_0x1e974d,_0x75652d[_0xf737('0xf')][_0xf737('0x12')]);return _0x57351d(_0x75652d['error'][_0xf737('0x12')]);}logger[_0xf737('0xf')](_0xf737('0x11'),_0x1e974d,_0x75652d[_0xf737('0xf')][_0xf737('0x12')]);return _0x3dd151(_0x75652d[_0xf737('0xf')][_0xf737('0x12')]);}else{logger[_0xf737('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x1e974d,_0xf737('0xd'));_0x3dd151(_0x75652d[_0xf737('0x13')][_0xf737('0x12')]);}})['catch'](function(_0x1f2e0f){logger[_0xf737('0xf')](_0xf737('0x11'),_0x1e974d,_0x1f2e0f);_0x57351d(_0x1f2e0f);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e10817e..540450d 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x6ec633,_0x72aaa){var _0x121d1a=function(_0x43ae46){while(--_0x43ae46){_0x6ec633['push'](_0x6ec633['shift']());}};_0x121d1a(++_0x72aaa);}(_0xe706,0xa3));var _0x6e70=function(_0x36e8e4,_0x213a61){_0x36e8e4=_0x36e8e4-0x0;var _0x491ac7=_0xe706[_0x36e8e4];return _0x491ac7;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10427a,_0x1dfe34){var _0x45e8e2=function(_0x3f5fca){while(--_0x3f5fca){_0x10427a['push'](_0x10427a['shift']());}};_0x45e8e2(++_0x1dfe34);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 29d9591..5b9fc8f 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 _0x23e3=['sequelize'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x23e3,0x120));var _0x323e=function(_0xbd77e7,_0x470a8e){_0xbd77e7=_0xbd77e7-0x0;var _0x37b1bc=_0x23e3[_0xbd77e7];return _0x37b1bc;};'use strict';var Sequelize=require(_0x323e('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb275=['INTEGER','exports'];(function(_0xe8f68f,_0x32e7c3){var _0x15a1d9=function(_0x972d0e){while(--_0x972d0e){_0xe8f68f['push'](_0xe8f68f['shift']());}};_0x15a1d9(++_0x32e7c3);}(_0xb275,0xbf));var _0x5b27=function(_0x3494dc,_0x588fb7){_0x3494dc=_0x3494dc-0x0;var _0x5a480b=_0xb275[_0x3494dc];return _0x5a480b;};'use strict';var Sequelize=require('sequelize');module[_0x5b27('0x0')]={'penalty':{'type':Sequelize[_0x5b27('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 0b32846..09e8e37 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 _0x41d0=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util'];(function(_0x49f3ea,_0x399a85){var _0x3ca709=function(_0x1051f8){while(--_0x1051f8){_0x49f3ea['push'](_0x49f3ea['shift']());}};_0x3ca709(++_0x399a85);}(_0x41d0,0x1c6));var _0x041d=function(_0x5abc1e,_0x8715e7){_0x5abc1e=_0x5abc1e-0x0;var _0x3423d1=_0x41d0[_0x5abc1e];return _0x3423d1;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var logger=require(_0x041d('0x2'))(_0x041d('0x3'));var moment=require('moment');var BPromise=require(_0x041d('0x4'));var rp=require(_0x041d('0x5'));var fs=require('fs');var path=require(_0x041d('0x6'));var rimraf=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var attributes=require(_0x041d('0x9'));module[_0x041d('0xa')]=function(_0x14907f,_0x196419){return _0x14907f['define'](_0x041d('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe785=['util','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x47cf71,_0x17a070){var _0x34cbed=function(_0x308a56){while(--_0x308a56){_0x47cf71['push'](_0x47cf71['shift']());}};_0x34cbed(++_0x17a070);}(_0xe785,0x128));var _0x5e78=function(_0x2e17ee,_0x2ca16d){_0x2e17ee=_0x2e17ee-0x0;var _0x3155ba=_0xe785[_0x2e17ee];return _0x3155ba;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var logger=require('../../config/logger')(_0x5e78('0x2'));var moment=require(_0x5e78('0x3'));var BPromise=require(_0x5e78('0x4'));var rp=require(_0x5e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e78('0x6'));var attributes=require(_0x5e78('0x7'));module[_0x5e78('0x8')]=function(_0x135552,_0x502114){return _0x135552['define'](_0x5e78('0x9'),attributes,{'tableName':_0x5e78('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index c56bb8d..f614584 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 _0x0c38=['jayson/promise','http','request','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','rpc'];(function(_0xfe94d1,_0x4b57d9){var _0x568bb3=function(_0xd5094f){while(--_0xd5094f){_0xfe94d1['push'](_0xfe94d1['shift']());}};_0x568bb3(++_0x4b57d9);}(_0x0c38,0x108));var _0x80c3=function(_0x4404d3,_0x5d0c9e){_0x4404d3=_0x4404d3-0x0;var _0xf263db=_0x0c38[_0x4404d3];return _0xf263db;};'use strict';var _=require(_0x80c3('0x0'));var util=require('util');var moment=require(_0x80c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x80c3('0x2'));var fs=require('fs');var Redis=require(_0x80c3('0x3'));var db=require(_0x80c3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x80c3('0x5'));var config=require('../../config/environment');var jayson=require(_0x80c3('0x6'));var client=jayson['client'][_0x80c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28a6b5,_0x6178fd,_0x1b493c){return new BPromise(function(_0x2f1292,_0x5cee53){return client[_0x80c3('0x8')](_0x28a6b5,_0x1b493c)['then'](function(_0x30ae78){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x6178fd,_0x80c3('0x9'));logger[_0x80c3('0xa')](_0x80c3('0xb'),_0x6178fd,_0x80c3('0x9'),JSON[_0x80c3('0xc')](_0x30ae78));if(_0x30ae78[_0x80c3('0xd')]){if(_0x30ae78['error'][_0x80c3('0xe')]===0x1f4){logger[_0x80c3('0xd')](_0x80c3('0xf'),_0x6178fd,_0x30ae78['error']['message']);return _0x5cee53(_0x30ae78['error'][_0x80c3('0x10')]);}logger['error'](_0x80c3('0xf'),_0x6178fd,_0x30ae78[_0x80c3('0xd')][_0x80c3('0x10')]);return _0x2f1292(_0x30ae78['error'][_0x80c3('0x10')]);}else{logger[_0x80c3('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x6178fd,_0x80c3('0x9'));_0x2f1292(_0x30ae78['result'][_0x80c3('0x10')]);}})['catch'](function(_0x2e6c0c){logger[_0x80c3('0xd')](_0x80c3('0xf'),_0x6178fd,_0x2e6c0c);_0x5cee53(_0x2e6c0c);});});} \ No newline at end of file +var _0xa92f=['rpc','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4b1c6f,_0x53e3a6){var _0x27528c=function(_0x5b9727){while(--_0x5b9727){_0x4b1c6f['push'](_0x4b1c6f['shift']());}};_0x27528c(++_0x53e3a6);}(_0xa92f,0x1ae));var _0xfa92=function(_0x3a3a5c,_0x389c78){_0x3a3a5c=_0x3a3a5c-0x0;var _0x305a51=_0xa92f[_0x3a3a5c];return _0x305a51;};'use strict';var _=require(_0xfa92('0x0'));var util=require(_0xfa92('0x1'));var moment=require('moment');var BPromise=require(_0xfa92('0x2'));var rs=require(_0xfa92('0x3'));var fs=require('fs');var Redis=require(_0xfa92('0x4'));var db=require(_0xfa92('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa92('0x6'))(_0xfa92('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa92('0x8')][_0xfa92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe77c7,_0x4adb72,_0x16002e){return new BPromise(function(_0x4d30ca,_0x590588){return client[_0xfa92('0xa')](_0xbe77c7,_0x16002e)[_0xfa92('0xb')](function(_0x394ecc){logger[_0xfa92('0xc')](_0xfa92('0xd'),_0x4adb72,_0xfa92('0xe'));logger[_0xfa92('0xf')](_0xfa92('0x10'),_0x4adb72,_0xfa92('0xe'),JSON[_0xfa92('0x11')](_0x394ecc));if(_0x394ecc['error']){if(_0x394ecc[_0xfa92('0x12')][_0xfa92('0x13')]===0x1f4){logger['error'](_0xfa92('0xd'),_0x4adb72,_0x394ecc[_0xfa92('0x12')]['message']);return _0x590588(_0x394ecc[_0xfa92('0x12')][_0xfa92('0x14')]);}logger[_0xfa92('0x12')](_0xfa92('0xd'),_0x4adb72,_0x394ecc[_0xfa92('0x12')][_0xfa92('0x14')]);return _0x4d30ca(_0x394ecc[_0xfa92('0x12')][_0xfa92('0x14')]);}else{logger[_0xfa92('0xc')](_0xfa92('0xd'),_0x4adb72,_0xfa92('0xe'));_0x4d30ca(_0x394ecc[_0xfa92('0x15')]['message']);}})[_0xfa92('0x16')](function(_0x51354e){logger[_0xfa92('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x4adb72,_0x51354e);_0x590588(_0x51354e);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 059278e..eaed521 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 _0xa703=['INTEGER','sequelize','exports'];(function(_0x3fde1b,_0x74520e){var _0x4803b5=function(_0x24c25b){while(--_0x24c25b){_0x3fde1b['push'](_0x3fde1b['shift']());}};_0x4803b5(++_0x74520e);}(_0xa703,0x100));var _0x3a70=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa703[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x3a70('0x0'));module[_0x3a70('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x3a70('0x2')]}}; \ No newline at end of file +var _0x1eec=['sequelize','exports','INTEGER'];(function(_0x5c1345,_0x40116e){var _0x1c070d=function(_0x1e862f){while(--_0x1e862f){_0x5c1345['push'](_0x5c1345['shift']());}};_0x1c070d(++_0x40116e);}(_0x1eec,0x12c));var _0xc1ee=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1eec[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xc1ee('0x0'));module[_0xc1ee('0x1')]={'UserId':{'type':Sequelize[_0xc1ee('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xc1ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6066b9e..743e0b4 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(_0x41c506,_0x29e48e){var _0x2df5b2=function(_0x181020){while(--_0x181020){_0x41c506['push'](_0x41c506['shift']());}};_0x2df5b2(++_0x29e48e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x2e094d,_0x377413){var _0x51367a=function(_0x218fea){while(--_0x218fea){_0x2e094d['push'](_0x2e094d['shift']());}};_0x51367a(++_0x377413);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 636818b..87acd0e 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x225838,_0x29b914){var _0x1da96b=function(_0x3e54b3){while(--_0x3e54b3){_0x225838['push'](_0x225838['shift']());}};_0x1da96b(++_0x29b914);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x583046,_0x17b2c7){var _0x5ae886=function(_0x502f35){while(--_0x502f35){_0x583046['push'](_0x583046['shift']());}};_0x5ae886(++_0x17b2c7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0xcb91[_0x4d8dc3];return _0x9b03d9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a34db87..bf446f4 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 _0xe685=['exports','INTEGER'];(function(_0x339eaa,_0xbc2f72){var _0x4985b6=function(_0x10e65b){while(--_0x10e65b){_0x339eaa['push'](_0x339eaa['shift']());}};_0x4985b6(++_0xbc2f72);}(_0xe685,0xe0));var _0x5e68=function(_0x29aad5,_0x546465){_0x29aad5=_0x29aad5-0x0;var _0x2e0e48=_0xe685[_0x29aad5];return _0x2e0e48;};'use strict';var Sequelize=require('sequelize');module[_0x5e68('0x0')]={'penalty':{'type':Sequelize[_0x5e68('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d44=['sequelize','exports'];(function(_0x317202,_0x195636){var _0x305c84=function(_0x3ac493){while(--_0x3ac493){_0x317202['push'](_0x317202['shift']());}};_0x305c84(++_0x195636);}(_0x2d44,0x1c4));var _0x42d4=function(_0x559656,_0x4539b1){_0x559656=_0x559656-0x0;var _0x5aa76f=_0x2d44[_0x559656];return _0x5aa76f;};'use strict';var Sequelize=require(_0x42d4('0x0'));module[_0x42d4('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index ce74ddb..0d67309 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 _0x85f0=['bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash','util','api','moment'];(function(_0x4b28ea,_0x5f21c1){var _0x42d341=function(_0x34fe39){while(--_0x34fe39){_0x4b28ea['push'](_0x4b28ea['shift']());}};_0x42d341(++_0x5f21c1);}(_0x85f0,0xc2));var _0x085f=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x85f0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x085f('0x0'));var util=require(_0x085f('0x1'));var logger=require('../../config/logger')(_0x085f('0x2'));var moment=require(_0x085f('0x3'));var BPromise=require(_0x085f('0x4'));var rp=require(_0x085f('0x5'));var fs=require('fs');var path=require(_0x085f('0x6'));var rimraf=require('rimraf');var config=require(_0x085f('0x7'));var attributes=require(_0x085f('0x8'));module['exports']=function(_0x5bac28,_0x2de638){return _0x5bac28[_0x085f('0x9')]('UserVoiceQueue',attributes,{'tableName':_0x085f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ac=['user_has_voice_queues','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue'];(function(_0x55756a,_0x4b5148){var _0x47490a=function(_0x40db5e){while(--_0x40db5e){_0x55756a['push'](_0x55756a['shift']());}};_0x47490a(++_0x4b5148);}(_0xa6ac,0x91));var _0xca6a=function(_0x511324,_0x5b2951){_0x511324=_0x511324-0x0;var _0x493eb2=_0xa6ac[_0x511324];return _0x493eb2;};'use strict';var _=require(_0xca6a('0x0'));var util=require(_0xca6a('0x1'));var logger=require('../../config/logger')(_0xca6a('0x2'));var moment=require(_0xca6a('0x3'));var BPromise=require(_0xca6a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca6a('0x5'));var config=require(_0xca6a('0x6'));var attributes=require(_0xca6a('0x7'));module[_0xca6a('0x8')]=function(_0x7c2543,_0x480660){return _0x7c2543[_0xca6a('0x9')](_0xca6a('0xa'),attributes,{'tableName':_0xca6a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 9c6fe4f..6b4ae59 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 _0x2c78=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then'];(function(_0x5b5f9e,_0x49318d){var _0x5cc7d6=function(_0x33c811){while(--_0x33c811){_0x5b5f9e['push'](_0x5b5f9e['shift']());}};_0x5cc7d6(++_0x49318d);}(_0x2c78,0x1ed));var _0x82c7=function(_0x56ea12,_0x304238){_0x56ea12=_0x56ea12-0x0;var _0x4b9883=_0x2c78[_0x56ea12];return _0x4b9883;};'use strict';var _=require(_0x82c7('0x0'));var util=require(_0x82c7('0x1'));var moment=require(_0x82c7('0x2'));var BPromise=require(_0x82c7('0x3'));var rs=require(_0x82c7('0x4'));var fs=require('fs');var Redis=require(_0x82c7('0x5'));var db=require(_0x82c7('0x6'))['db'];var utils=require(_0x82c7('0x7'));var logger=require(_0x82c7('0x8'))(_0x82c7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x82c7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a5941,_0x308e67,_0x2b55f5){return new BPromise(function(_0x14bbdc,_0x1e8639){return client[_0x82c7('0xb')](_0x3a5941,_0x2b55f5)[_0x82c7('0xc')](function(_0x12743e){logger[_0x82c7('0xd')](_0x82c7('0xe'),_0x308e67,_0x82c7('0xf'));logger[_0x82c7('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x308e67,_0x82c7('0xf'),JSON['stringify'](_0x12743e));if(_0x12743e[_0x82c7('0x11')]){if(_0x12743e[_0x82c7('0x11')][_0x82c7('0x12')]===0x1f4){logger[_0x82c7('0x11')](_0x82c7('0xe'),_0x308e67,_0x12743e['error'][_0x82c7('0x13')]);return _0x1e8639(_0x12743e[_0x82c7('0x11')]['message']);}logger[_0x82c7('0x11')](_0x82c7('0xe'),_0x308e67,_0x12743e[_0x82c7('0x11')][_0x82c7('0x13')]);return _0x14bbdc(_0x12743e['error']['message']);}else{logger[_0x82c7('0xd')](_0x82c7('0xe'),_0x308e67,'request\x20sent');_0x14bbdc(_0x12743e[_0x82c7('0x14')][_0x82c7('0x13')]);}})[_0x82c7('0x15')](function(_0x54a2e4){logger[_0x82c7('0x11')](_0x82c7('0xe'),_0x308e67,_0x54a2e4);_0x1e8639(_0x54a2e4);});});} \ No newline at end of file +var _0x3b61=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x492c14,_0x481f47){var _0x5a998a=function(_0x564641){while(--_0x564641){_0x492c14['push'](_0x492c14['shift']());}};_0x5a998a(++_0x481f47);}(_0x3b61,0xa2));var _0x13b6=function(_0x302b72,_0x483f35){_0x302b72=_0x302b72-0x0;var _0x48aa64=_0x3b61[_0x302b72];return _0x48aa64;};'use strict';var _=require('lodash');var util=require(_0x13b6('0x0'));var moment=require(_0x13b6('0x1'));var BPromise=require(_0x13b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13b6('0x3'));var db=require(_0x13b6('0x4'))['db'];var utils=require(_0x13b6('0x5'));var logger=require(_0x13b6('0x6'))(_0x13b6('0x7'));var config=require(_0x13b6('0x8'));var jayson=require(_0x13b6('0x9'));var client=jayson[_0x13b6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b4114,_0x4d95d3,_0x42267c){return new BPromise(function(_0x454f26,_0x94f88e){return client[_0x13b6('0xb')](_0x4b4114,_0x42267c)[_0x13b6('0xc')](function(_0xa9291e){logger[_0x13b6('0xd')](_0x13b6('0xe'),_0x4d95d3,_0x13b6('0xf'));logger[_0x13b6('0x10')](_0x13b6('0x11'),_0x4d95d3,_0x13b6('0xf'),JSON[_0x13b6('0x12')](_0xa9291e));if(_0xa9291e['error']){if(_0xa9291e['error']['code']===0x1f4){logger[_0x13b6('0x13')](_0x13b6('0xe'),_0x4d95d3,_0xa9291e['error']['message']);return _0x94f88e(_0xa9291e[_0x13b6('0x13')]['message']);}logger[_0x13b6('0x13')](_0x13b6('0xe'),_0x4d95d3,_0xa9291e['error'][_0x13b6('0x14')]);return _0x454f26(_0xa9291e[_0x13b6('0x13')][_0x13b6('0x14')]);}else{logger[_0x13b6('0xd')](_0x13b6('0xe'),_0x4d95d3,_0x13b6('0xf'));_0x454f26(_0xa9291e[_0x13b6('0x15')][_0x13b6('0x14')]);}})[_0x13b6('0x16')](function(_0x3f52ba){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4d95d3,_0x3f52ba);_0x94f88e(_0x3f52ba);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index c744256..5319b79 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xa132e6,_0x2a7b2b){var _0x227160=function(_0x28238f){while(--_0x28238f){_0xa132e6['push'](_0xa132e6['shift']());}};_0x227160(++_0x2a7b2b);}(_0x70e0,0x17b));var _0x070e=function(_0x266c05,_0x26d39){_0x266c05=_0x266c05-0x0;var _0x51cc6f=_0x70e0[_0x266c05];return _0x51cc6f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 39f0fe6..9e6ed9c 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 _0x2929=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x2929,0xd8));var _0x9292=function(_0x1dcaa2,_0x20ec72){_0x1dcaa2=_0x1dcaa2-0x0;var _0x4d6003=_0x2929[_0x1dcaa2];return _0x4d6003;};'use strict';var Sequelize=require(_0x9292('0x0'));module[_0x9292('0x1')]={'uniqueid':{'type':Sequelize[_0x9292('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9292('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x9292('0x3')},'UserId':{'type':Sequelize[_0x9292('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9292('0x4')],'allowNull':![],'unique':_0x9292('0x5'),'comment':_0x9292('0x3')},'VoiceQueueId':{'type':Sequelize[_0x9292('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9292('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9292('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9292('0x3')}}; \ No newline at end of file +var _0xba46=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x474374,_0x3df5d2){var _0x697ac0=function(_0x58aace){while(--_0x58aace){_0x474374['push'](_0x474374['shift']());}};_0x697ac0(++_0x3df5d2);}(_0xba46,0x141));var _0x6ba4=function(_0x189947,_0x1952b9){_0x189947=_0x189947-0x0;var _0x1f041f=_0xba46[_0x189947];return _0x1f041f;};'use strict';var Sequelize=require(_0x6ba4('0x0'));module[_0x6ba4('0x1')]={'uniqueid':{'type':Sequelize[_0x6ba4('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6ba4('0x3')},'membername':{'type':Sequelize[_0x6ba4('0x4')],'allowNull':![],'comment':_0x6ba4('0x3')},'UserId':{'type':Sequelize[_0x6ba4('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6ba4('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x6ba4('0x3')},'VoiceQueueId':{'type':Sequelize[_0x6ba4('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x6ba4('0x4')],'allowNull':![],'unique':_0x6ba4('0x5'),'comment':_0x6ba4('0x3')},'penalty':{'type':Sequelize[_0x6ba4('0x2')](0xb),'defaultValue':0x0,'comment':_0x6ba4('0x3')},'paused':{'type':Sequelize[_0x6ba4('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index a0f9d8e..79bb663 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 _0x52fd=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x49b95a,_0x18dbb1){var _0xff05b4=function(_0x19b701){while(--_0x19b701){_0x49b95a['push'](_0x49b95a['shift']());}};_0xff05b4(++_0x18dbb1);}(_0x52fd,0x132));var _0xd52f=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x52fd[_0xaa1b3e];return _0x454d7d;};'use strict';var EventEmitter=require(_0xd52f('0x0'));var UserVoiceQueueRt=require(_0xd52f('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd52f('0x2')](0x0);var events={'afterCreate':_0xd52f('0x3'),'afterUpdate':'update','afterDestroy':_0xd52f('0x4')};function emitEvent(_0x5ec875){return function(_0x1718a9,_0x5212f5,_0x39aded){UserVoiceQueueRtEvents[_0xd52f('0x5')](_0x5ec875+':'+_0x1718a9['id'],_0x1718a9);UserVoiceQueueRtEvents[_0xd52f('0x5')](_0x5ec875,_0x1718a9);_0x39aded(null);};}for(var e in events){if(events[_0xd52f('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xd52f('0x7')](e,emitEvent(event));}}module[_0xd52f('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x27d8=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x51d8bd,_0x80a49){var _0x54bd7b=function(_0xe61811){while(--_0xe61811){_0x51d8bd['push'](_0x51d8bd['shift']());}};_0x54bd7b(++_0x80a49);}(_0x27d8,0x1d1));var _0x827d=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x27d8[_0x4a3898];return _0x25ceb0;};'use strict';var EventEmitter=require(_0x827d('0x0'));var UserVoiceQueueRt=require(_0x827d('0x1'))['db'][_0x827d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x827d('0x3'),'afterUpdate':'update','afterDestroy':_0x827d('0x4')};function emitEvent(_0x539866){return function(_0x42baf9,_0x3eec50,_0x30f2c9){UserVoiceQueueRtEvents[_0x827d('0x5')](_0x539866+':'+_0x42baf9['id'],_0x42baf9);UserVoiceQueueRtEvents['emit'](_0x539866,_0x42baf9);_0x30f2c9(null);};}for(var e in events){if(events[_0x827d('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x827d('0x7')](e,emitEvent(event));}}module[_0x827d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index f7c6376..d4982df 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 _0x3999=['exports','define','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x52a3dd,_0x180319){var _0x4b4130=function(_0x2fa641){while(--_0x2fa641){_0x52a3dd['push'](_0x52a3dd['shift']());}};_0x4b4130(++_0x180319);}(_0x3999,0x188));var _0x9399=function(_0x4be698,_0x3d7a6d){_0x4be698=_0x4be698-0x0;var _0x92dc01=_0x3999[_0x4be698];return _0x92dc01;};'use strict';var _=require('lodash');var util=require(_0x9399('0x0'));var logger=require(_0x9399('0x1'))(_0x9399('0x2'));var moment=require('moment');var BPromise=require(_0x9399('0x3'));var rp=require(_0x9399('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9399('0x5'));var config=require(_0x9399('0x6'));var attributes=require(_0x9399('0x7'));module[_0x9399('0x8')]=function(_0x5ec21d,_0x157fcb){return _0x5ec21d[_0x9399('0x9')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7da=['request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird'];(function(_0x171823,_0xe4c96a){var _0x2b80bb=function(_0x555272){while(--_0x555272){_0x171823['push'](_0x171823['shift']());}};_0x2b80bb(++_0xe4c96a);}(_0xa7da,0xb1));var _0xaa7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7da[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7d('0x0'));var util=require(_0xaa7d('0x1'));var logger=require(_0xaa7d('0x2'))(_0xaa7d('0x3'));var moment=require('moment');var BPromise=require(_0xaa7d('0x4'));var rp=require(_0xaa7d('0x5'));var fs=require('fs');var path=require(_0xaa7d('0x6'));var rimraf=require(_0xaa7d('0x7'));var config=require(_0xaa7d('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xaa7d('0x9')]=function(_0x2a522e,_0x484b3c){return _0x2a522e[_0xaa7d('0xa')](_0xaa7d('0xb'),attributes,{'tableName':_0xaa7d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 8b1ba22..524bc56 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 _0xac34=['client','http','redis','defaults','localhost','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','sequelize','`paused`\x20=\x201,\x201,\x20null','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2648f0,_0x59fce1){var _0x5f1cf7=function(_0x14e76f){while(--_0x14e76f){_0x2648f0['push'](_0x2648f0['shift']());}};_0x5f1cf7(++_0x59fce1);}(_0xac34,0x177));var _0x4ac3=function(_0x383825,_0x9eac88){_0x383825=_0x383825-0x0;var _0x4a0e28=_0xac34[_0x383825];return _0x4a0e28;};'use strict';var _=require('lodash');var util=require(_0x4ac3('0x0'));var moment=require(_0x4ac3('0x1'));var BPromise=require(_0x4ac3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ac3('0x3'));var db=require(_0x4ac3('0x4'))['db'];var utils=require(_0x4ac3('0x5'));var logger=require(_0x4ac3('0x6'))(_0x4ac3('0x7'));var config=require(_0x4ac3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4ac3('0x9')][_0x4ac3('0xa')]({'port':0x232a});config[_0x4ac3('0xb')]=_[_0x4ac3('0xc')](config['redis'],{'host':_0x4ac3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ac3('0xb')]));require('./userVoiceQueueRt.socket')[_0x4ac3('0xe')](socket);function respondWithRpcPromise(_0x38e087,_0x3fb6b4,_0xeaa72d){return new BPromise(function(_0x406c45,_0x54b445){return client[_0x4ac3('0xf')](_0x38e087,_0xeaa72d)[_0x4ac3('0x10')](function(_0x25eac2){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3fb6b4,_0x4ac3('0x11'));logger[_0x4ac3('0x12')](_0x4ac3('0x13'),_0x3fb6b4,_0x4ac3('0x11'),JSON[_0x4ac3('0x14')](_0x25eac2));if(_0x25eac2[_0x4ac3('0x15')]){if(_0x25eac2['error']['code']===0x1f4){logger[_0x4ac3('0x15')](_0x4ac3('0x16'),_0x3fb6b4,_0x25eac2[_0x4ac3('0x15')][_0x4ac3('0x17')]);return _0x54b445(_0x25eac2[_0x4ac3('0x15')][_0x4ac3('0x17')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3fb6b4,_0x25eac2[_0x4ac3('0x15')]['message']);return _0x406c45(_0x25eac2[_0x4ac3('0x15')][_0x4ac3('0x17')]);}else{logger[_0x4ac3('0x18')](_0x4ac3('0x16'),_0x3fb6b4,'request\x20sent');_0x406c45(_0x25eac2['result'][_0x4ac3('0x17')]);}})[_0x4ac3('0x19')](function(_0x57221b){logger[_0x4ac3('0x15')](_0x4ac3('0x16'),_0x3fb6b4,_0x57221b);_0x54b445(_0x57221b);});});}exports[_0x4ac3('0x1a')]=function(_0x3e50ad){var _0x54ce92=this;return new Promise(function(_0x57520f,_0x17abad){return db[_0x4ac3('0x1b')][_0x4ac3('0x1c')]({'raw':_0x3e50ad['options']?_0x3e50ad['options'][_0x4ac3('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e50ad['options']?_0x3e50ad['options']['where']||null:null,'attributes':[[db[_0x4ac3('0x1e')]['fn']('COUNT',db[_0x4ac3('0x1e')]['fn']('IF',db[_0x4ac3('0x1e')]['literal'](_0x4ac3('0x1f')))),'outboundQueuePauses']]})[_0x4ac3('0x10')](function(_0x59af94){logger[_0x4ac3('0x18')](_0x4ac3('0x1a'),_0x3e50ad);logger[_0x4ac3('0x12')](_0x4ac3('0x1a'),_0x3e50ad,JSON['stringify'](_0x59af94));_0x57520f(_0x59af94);})[_0x4ac3('0x19')](function(_0x711f9e){logger[_0x4ac3('0x15')](_0x4ac3('0x1a'),_0x711f9e[_0x4ac3('0x17')],_0x3e50ad);_0x17abad(_0x54ce92[_0x4ac3('0x15')](0x1f4,_0x711f9e[_0x4ac3('0x17')]));});});}; \ No newline at end of file +var _0xfa64=['UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa64,0x79));var _0x4fa6=function(_0x429e87,_0x566979){_0x429e87=_0x429e87-0x0;var _0x217aed=_0xfa64[_0x429e87];return _0x217aed;};'use strict';var _=require(_0x4fa6('0x0'));var util=require(_0x4fa6('0x1'));var moment=require(_0x4fa6('0x2'));var BPromise=require(_0x4fa6('0x3'));var rs=require(_0x4fa6('0x4'));var fs=require('fs');var Redis=require(_0x4fa6('0x5'));var db=require(_0x4fa6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fa6('0x7'))(_0x4fa6('0x8'));var config=require(_0x4fa6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4fa6('0xa')]({'port':0x232a});config[_0x4fa6('0xb')]=_[_0x4fa6('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4fa6('0xd'))(new Redis(config[_0x4fa6('0xb')]));require(_0x4fa6('0xe'))['register'](socket);function respondWithRpcPromise(_0x286bf1,_0x257134,_0x133cbf){return new BPromise(function(_0x3893d3,_0x59501f){return client[_0x4fa6('0xf')](_0x286bf1,_0x133cbf)['then'](function(_0x251b50){logger[_0x4fa6('0x10')](_0x4fa6('0x11'),_0x257134,_0x4fa6('0x12'));logger[_0x4fa6('0x13')](_0x4fa6('0x14'),_0x257134,_0x4fa6('0x12'),JSON[_0x4fa6('0x15')](_0x251b50));if(_0x251b50[_0x4fa6('0x16')]){if(_0x251b50['error'][_0x4fa6('0x17')]===0x1f4){logger[_0x4fa6('0x16')](_0x4fa6('0x11'),_0x257134,_0x251b50['error']['message']);return _0x59501f(_0x251b50[_0x4fa6('0x16')][_0x4fa6('0x18')]);}logger[_0x4fa6('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x257134,_0x251b50['error'][_0x4fa6('0x18')]);return _0x3893d3(_0x251b50[_0x4fa6('0x16')][_0x4fa6('0x18')]);}else{logger['info'](_0x4fa6('0x11'),_0x257134,_0x4fa6('0x12'));_0x3893d3(_0x251b50[_0x4fa6('0x19')]['message']);}})['catch'](function(_0x57df45){logger[_0x4fa6('0x16')](_0x4fa6('0x11'),_0x257134,_0x57df45);_0x59501f(_0x57df45);});});}exports[_0x4fa6('0x1a')]=function(_0x55ec2a){var _0x15e13e=this;return new Promise(function(_0x2c693e,_0x1bb42e){return db[_0x4fa6('0x1b')]['findAll']({'raw':_0x55ec2a[_0x4fa6('0x1c')]?_0x55ec2a[_0x4fa6('0x1c')][_0x4fa6('0x1d')]===undefined?!![]:![]:!![],'where':_0x55ec2a[_0x4fa6('0x1c')]?_0x55ec2a[_0x4fa6('0x1c')][_0x4fa6('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x4fa6('0x1f'),db[_0x4fa6('0x20')]['fn']('IF',db[_0x4fa6('0x20')][_0x4fa6('0x21')](_0x4fa6('0x22')))),'outboundQueuePauses']]})[_0x4fa6('0x23')](function(_0x2e459a){logger['info']('GetVoiceQueueRtPauses',_0x55ec2a);logger['debug']('GetVoiceQueueRtPauses',_0x55ec2a,JSON['stringify'](_0x2e459a));_0x2c693e(_0x2e459a);})[_0x4fa6('0x24')](function(_0xa585a2){logger[_0x4fa6('0x16')]('GetVoiceQueueRtPauses',_0xa585a2['message'],_0x55ec2a);_0x1bb42e(_0x15e13e['error'](0x1f4,_0xa585a2[_0x4fa6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 96f0b9b..9e1cbfb 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 _0xc627=['length','save','remove','update','emit','removeListener','register'];(function(_0x4c35fd,_0x47fad2){var _0x44f3ae=function(_0x4b1397){while(--_0x4b1397){_0x4c35fd['push'](_0x4c35fd['shift']());}};_0x44f3ae(++_0x47fad2);}(_0xc627,0x14a));var _0x7c62=function(_0x3900da,_0x4ed642){_0x3900da=_0x3900da-0x0;var _0x3d1325=_0xc627[_0x3900da];return _0x3d1325;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x7c62('0x0'),_0x7c62('0x1'),_0x7c62('0x2')];function createListener(_0x55c85f,_0x311a10){return function(_0x1e7490){_0x311a10[_0x7c62('0x3')](_0x55c85f,_0x1e7490);};}function removeListener(_0x313d80,_0x121766){return function(){UserVoiceQueueRtEvents[_0x7c62('0x4')](_0x313d80,_0x121766);};}exports[_0x7c62('0x5')]=function(_0x448f4b){for(var _0x25a5c8=0x0,_0x43f964=events[_0x7c62('0x6')];_0x25a5c8<_0x43f964;_0x25a5c8++){var _0x29705f=events[_0x25a5c8];var _0x58c31c=createListener('userVoiceQueueRt:'+_0x29705f,_0x448f4b);UserVoiceQueueRtEvents['on'](_0x29705f,_0x58c31c);}}; \ No newline at end of file +var _0xf105=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x8d9800,_0x4d44f1){var _0x2d1ffc=function(_0x4cc533){while(--_0x4cc533){_0x8d9800['push'](_0x8d9800['shift']());}};_0x2d1ffc(++_0x4d44f1);}(_0xf105,0x1b0));var _0x5f10=function(_0x259bd0,_0x1d8f9f){_0x259bd0=_0x259bd0-0x0;var _0x8991db=_0xf105[_0x259bd0];return _0x8991db;};'use strict';var UserVoiceQueueRtEvents=require(_0x5f10('0x0'));var events=[_0x5f10('0x1'),_0x5f10('0x2'),_0x5f10('0x3')];function createListener(_0x187d7d,_0x3aa72f){return function(_0x5601d6){_0x3aa72f[_0x5f10('0x4')](_0x187d7d,_0x5601d6);};}function removeListener(_0x5a7fe7,_0x2c0393){return function(){UserVoiceQueueRtEvents[_0x5f10('0x5')](_0x5a7fe7,_0x2c0393);};}exports[_0x5f10('0x6')]=function(_0x1b7489){for(var _0x46b6f2=0x0,_0x2871bb=events[_0x5f10('0x7')];_0x46b6f2<_0x2871bb;_0x46b6f2++){var _0x445aa4=events[_0x46b6f2];var _0x509e76=createListener(_0x5f10('0x8')+_0x445aa4,_0x1b7489);UserVoiceQueueRtEvents['on'](_0x445aa4,_0x509e76);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3185824..cef7d60 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x47a762,_0x176107){var _0x3389d5=function(_0x44635b){while(--_0x44635b){_0x47a762['push'](_0x47a762['shift']());}};_0x3389d5(++_0x176107);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x49b153,_0x194075){var _0x127ef2=function(_0x2338e1){while(--_0x2338e1){_0x49b153['push'](_0x49b153['shift']());}};_0x127ef2(++_0x194075);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 2fff9ed..12a7bd2 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 _0xca4b=['INTEGER','exports'];(function(_0x7d93c6,_0x5bd016){var _0x1cd2fd=function(_0x55a2c0){while(--_0x55a2c0){_0x7d93c6['push'](_0x7d93c6['shift']());}};_0x1cd2fd(++_0x5bd016);}(_0xca4b,0x151));var _0xbca4=function(_0x3621d7,_0x277986){_0x3621d7=_0x3621d7-0x0;var _0x5beb90=_0xca4b[_0x3621d7];return _0x5beb90;};'use strict';var Sequelize=require('sequelize');module[_0xbca4('0x0')]={'penalty':{'type':Sequelize[_0xbca4('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34f9=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34f9,0x158));var _0x934f=function(_0x38b46d,_0x1a836c){_0x38b46d=_0x38b46d-0x0;var _0x283611=_0x34f9[_0x38b46d];return _0x283611;};'use strict';var Sequelize=require(_0x934f('0x0'));module[_0x934f('0x1')]={'penalty':{'type':Sequelize[_0x934f('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 990557d..796c9bb 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 _0x0c11=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x0c11,0xfc));var _0x10c1=function(_0x56740a,_0x568894){_0x56740a=_0x56740a-0x0;var _0x257144=_0x0c11[_0x56740a];return _0x257144;};'use strict';var _=require(_0x10c1('0x0'));var util=require(_0x10c1('0x1'));var logger=require(_0x10c1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x10c1('0x3'));var rp=require(_0x10c1('0x4'));var fs=require('fs');var path=require(_0x10c1('0x5'));var rimraf=require(_0x10c1('0x6'));var config=require(_0x10c1('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x10c1('0x8')]=function(_0x1d80c3,_0x3426ad){return _0x1d80c3[_0x10c1('0x9')](_0x10c1('0xa'),attributes,{'tableName':_0x10c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9499=['define','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./userWhatsappQueue.attributes','exports'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x9499,0xff));var _0x9949=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9499[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x9949('0x0'));var util=require(_0x9949('0x1'));var logger=require(_0x9949('0x2'))(_0x9949('0x3'));var moment=require(_0x9949('0x4'));var BPromise=require('bluebird');var rp=require(_0x9949('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9949('0x6'));var config=require('../../config/environment');var attributes=require(_0x9949('0x7'));module[_0x9949('0x8')]=function(_0x29ae70,_0x5bb4b4){return _0x29ae70[_0x9949('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x9949('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 ee690f0..ec21233 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 _0x7be9=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3c7b7d,_0x834e6a){var _0x159f7b=function(_0x24e24a){while(--_0x24e24a){_0x3c7b7d['push'](_0x3c7b7d['shift']());}};_0x159f7b(++_0x834e6a);}(_0x7be9,0x79));var _0x97be=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x7be9[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x97be('0x0'));var util=require(_0x97be('0x1'));var moment=require(_0x97be('0x2'));var BPromise=require('bluebird');var rs=require(_0x97be('0x3'));var fs=require('fs');var Redis=require(_0x97be('0x4'));var db=require(_0x97be('0x5'))['db'];var utils=require(_0x97be('0x6'));var logger=require(_0x97be('0x7'))('rpc');var config=require(_0x97be('0x8'));var jayson=require(_0x97be('0x9'));var client=jayson['client'][_0x97be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15c6f9,_0x4fb7c8,_0x14343d){return new BPromise(function(_0x25fcbf,_0x2c1bcb){return client[_0x97be('0xb')](_0x15c6f9,_0x14343d)[_0x97be('0xc')](function(_0x26b081){logger[_0x97be('0xd')](_0x97be('0xe'),_0x4fb7c8,'request\x20sent');logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4fb7c8,'request\x20sent',JSON[_0x97be('0xf')](_0x26b081));if(_0x26b081[_0x97be('0x10')]){if(_0x26b081['error']['code']===0x1f4){logger[_0x97be('0x10')](_0x97be('0xe'),_0x4fb7c8,_0x26b081['error'][_0x97be('0x11')]);return _0x2c1bcb(_0x26b081['error']['message']);}logger[_0x97be('0x10')](_0x97be('0xe'),_0x4fb7c8,_0x26b081['error'][_0x97be('0x11')]);return _0x25fcbf(_0x26b081[_0x97be('0x10')][_0x97be('0x11')]);}else{logger[_0x97be('0xd')](_0x97be('0xe'),_0x4fb7c8,'request\x20sent');_0x25fcbf(_0x26b081[_0x97be('0x12')][_0x97be('0x11')]);}})[_0x97be('0x13')](function(_0x4eac61){logger[_0x97be('0x10')](_0x97be('0xe'),_0x4fb7c8,_0x4eac61);_0x2c1bcb(_0x4eac61);});});} \ No newline at end of file +var _0x50c1=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2902a9,_0x152740){var _0x4f88b6=function(_0x3b2603){while(--_0x3b2603){_0x2902a9['push'](_0x2902a9['shift']());}};_0x4f88b6(++_0x152740);}(_0x50c1,0x17b));var _0x150c=function(_0x2e9fa5,_0x8c9c6a){_0x2e9fa5=_0x2e9fa5-0x0;var _0x1a9012=_0x50c1[_0x2e9fa5];return _0x1a9012;};'use strict';var _=require(_0x150c('0x0'));var util=require(_0x150c('0x1'));var moment=require('moment');var BPromise=require(_0x150c('0x2'));var rs=require(_0x150c('0x3'));var fs=require('fs');var Redis=require(_0x150c('0x4'));var db=require(_0x150c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x150c('0x6'))(_0x150c('0x7'));var config=require(_0x150c('0x8'));var jayson=require(_0x150c('0x9'));var client=jayson['client'][_0x150c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b366d,_0x499666,_0x224df1){return new BPromise(function(_0x4285a1,_0x16a82a){return client[_0x150c('0xb')](_0x4b366d,_0x224df1)[_0x150c('0xc')](function(_0x2d8468){logger[_0x150c('0xd')](_0x150c('0xe'),_0x499666,_0x150c('0xf'));logger[_0x150c('0x10')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x499666,_0x150c('0xf'),JSON[_0x150c('0x11')](_0x2d8468));if(_0x2d8468[_0x150c('0x12')]){if(_0x2d8468[_0x150c('0x12')]['code']===0x1f4){logger[_0x150c('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x499666,_0x2d8468[_0x150c('0x12')]['message']);return _0x16a82a(_0x2d8468[_0x150c('0x12')]['message']);}logger[_0x150c('0x12')](_0x150c('0xe'),_0x499666,_0x2d8468['error'][_0x150c('0x13')]);return _0x4285a1(_0x2d8468[_0x150c('0x12')]['message']);}else{logger[_0x150c('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x499666,_0x150c('0xf'));_0x4285a1(_0x2d8468[_0x150c('0x14')][_0x150c('0x13')]);}})[_0x150c('0x15')](function(_0x5f55b9){logger[_0x150c('0x12')](_0x150c('0xe'),_0x499666,_0x5f55b9);_0x16a82a(_0x5f55b9);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3ad5224..c488509 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 _0x394e=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','update'];(function(_0xd72931,_0x100083){var _0x1c4577=function(_0x43dcd2){while(--_0x43dcd2){_0xd72931['push'](_0xd72931['shift']());}};_0x1c4577(++_0x100083);}(_0x394e,0x88));var _0xe394=function(_0x486e6f,_0x395450){_0x486e6f=_0x486e6f-0x0;var _0x104212=_0x394e[_0x486e6f];return _0x104212;};'use strict';var multer=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var path=require('path');var timeout=require(_0xe394('0x2'));var express=require(_0xe394('0x3'));var router=express[_0xe394('0x4')]();var fs_extra=require(_0xe394('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var controller=require(_0xe394('0x8'));router[_0xe394('0x9')]('/',auth[_0xe394('0xa')](),controller[_0xe394('0xb')]);router[_0xe394('0x9')](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0xd')]);router[_0xe394('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0xf')]);router[_0xe394('0x10')](_0xe394('0xc'),auth[_0xe394('0xa')](),controller[_0xe394('0x11')]);module[_0xe394('0x12')]=router; \ No newline at end of file +var _0xc298=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc298,0x143));var _0x8c29=function(_0x492970,_0x397fdb){_0x492970=_0x492970-0x0;var _0x53f562=_0xc298[_0x492970];return _0x53f562;};'use strict';var multer=require('multer');var util=require(_0x8c29('0x0'));var path=require(_0x8c29('0x1'));var timeout=require(_0x8c29('0x2'));var express=require(_0x8c29('0x3'));var router=express[_0x8c29('0x4')]();var fs_extra=require(_0x8c29('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var controller=require(_0x8c29('0x8'));router[_0x8c29('0x9')]('/',auth[_0x8c29('0xa')](),controller['index']);router[_0x8c29('0x9')](_0x8c29('0xb'),auth[_0x8c29('0xa')](),controller[_0x8c29('0xc')]);router[_0x8c29('0xd')]('/',auth[_0x8c29('0xa')](),controller['create']);router['put']('/:id',auth[_0x8c29('0xa')](),controller[_0x8c29('0xe')]);router[_0x8c29('0xf')](_0x8c29('0xb'),auth[_0x8c29('0xa')](),controller[_0x8c29('0x10')]);module[_0x8c29('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 1ecbffb..2bf2e8b 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 _0x3584=['STRING','name'];(function(_0x4446ab,_0x411c2a){var _0x23e20c=function(_0x315612){while(--_0x315612){_0x4446ab['push'](_0x4446ab['shift']());}};_0x23e20c(++_0x411c2a);}(_0x3584,0xba));var _0x4358=function(_0x19185a,_0x3d8850){_0x19185a=_0x19185a-0x0;var _0x21a15c=_0x3584[_0x19185a];return _0x21a15c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4358('0x0')],'unique':_0x4358('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4358('0x0')]}}; \ No newline at end of file +var _0xc698=['exports','STRING','sequelize'];(function(_0x1c5393,_0x5f417b){var _0x2baa76=function(_0x1ed2b7){while(--_0x1ed2b7){_0x1c5393['push'](_0x1c5393['shift']());}};_0x2baa76(++_0x5f417b);}(_0xc698,0x116));var _0x8c69=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xc698[_0x36bfe3];return _0x9b0436;};'use strict';var Sequelize=require(_0x8c69('0x0'));module[_0x8c69('0x1')]={'name':{'type':Sequelize[_0x8c69('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8c69('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0d6cd64..5540fde 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 _0xf5cc=['sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','Variable','type','key','map','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','catch','params','rawAttributes','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2761ff,_0xa65668){var _0x5c15cf=function(_0x55e155){while(--_0x55e155){_0x2761ff['push'](_0x2761ff['shift']());}};_0x5c15cf(++_0xa65668);}(_0xf5cc,0x184));var _0xcf5c=function(_0x58efa6,_0x2c00bd){_0x58efa6=_0x58efa6-0x0;var _0x5d643c=_0xf5cc[_0x58efa6];return _0x5d643c;};'use strict';var emlformat=require(_0xcf5c('0x0'));var rimraf=require(_0xcf5c('0x1'));var zipdir=require(_0xcf5c('0x2'));var jsonpatch=require(_0xcf5c('0x3'));var rp=require('request-promise');var moment=require(_0xcf5c('0x4'));var BPromise=require(_0xcf5c('0x5'));var Mustache=require(_0xcf5c('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcf5c('0x7'));var csv=require(_0xcf5c('0x8'));var ejs=require(_0xcf5c('0x9'));var fs=require('fs');var fs_extra=require(_0xcf5c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf5c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf5c('0x8'));var querystring=require(_0xcf5c('0xc'));var Papa=require(_0xcf5c('0xd'));var Redis=require(_0xcf5c('0xe'));var authService=require(_0xcf5c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcf5c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf5c('0x11'))('api');var utils=require(_0xcf5c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xcf5c('0x13'));var db=require(_0xcf5c('0x14'))['db'];function respondWithStatusCode(_0x3b1f86,_0x3d4f13){_0x3d4f13=_0x3d4f13||0xcc;return function(_0x4b2c2c){if(_0x4b2c2c){return _0x3b1f86[_0xcf5c('0x15')](_0x3d4f13);}return _0x3b1f86['status'](_0x3d4f13)[_0xcf5c('0x16')]();};}function respondWithResult(_0x3090d7,_0x2b8e30){_0x2b8e30=_0x2b8e30||0xc8;return function(_0x53bfdd){if(_0x53bfdd){return _0x3090d7[_0xcf5c('0x17')](_0x2b8e30)[_0xcf5c('0x18')](_0x53bfdd);}};}function respondWithFilteredResult(_0x50be5d,_0x5995db){return function(_0x59dba9){if(_0x59dba9){var _0x57ef79=typeof _0x5995db['offset']===_0xcf5c('0x19')&&typeof _0x5995db[_0xcf5c('0x1a')]===_0xcf5c('0x19');var _0x1f3232=_0x59dba9[_0xcf5c('0x1b')];var _0x5d23f7=_0x57ef79?0x0:_0x5995db[_0xcf5c('0x1c')];var _0x29f3d5=_0x57ef79?_0x59dba9[_0xcf5c('0x1b')]:_0x5995db[_0xcf5c('0x1c')]+_0x5995db[_0xcf5c('0x1a')];var _0x531352;if(_0x29f3d5>=_0x1f3232){_0x29f3d5=_0x1f3232;_0x531352=0xc8;}else{_0x531352=0xce;}_0x50be5d[_0xcf5c('0x17')](_0x531352);return _0x50be5d['set'](_0xcf5c('0x1d'),_0x5d23f7+'-'+_0x29f3d5+'/'+_0x1f3232)[_0xcf5c('0x18')](_0x59dba9);}return null;};}function patchUpdates(_0x4f07d0){return function(_0x44d4b9){try{jsonpatch[_0xcf5c('0x1e')](_0x44d4b9,_0x4f07d0,!![]);}catch(_0xb67212){return BPromise[_0xcf5c('0x1f')](_0xb67212);}return _0x44d4b9[_0xcf5c('0x20')]();};}function saveUpdates(_0x1816e3,_0x35b317){return function(_0xc447bc){if(_0xc447bc){return _0xc447bc[_0xcf5c('0x21')](_0x1816e3)[_0xcf5c('0x22')](function(_0x33f202){return _0x33f202;});}return null;};}function removeEntity(_0x1a575e,_0x541b6b){return function(_0x400da2){if(_0x400da2){return _0x400da2[_0xcf5c('0x23')]()[_0xcf5c('0x22')](function(){var _0x3cc6c2=_0x400da2[_0xcf5c('0x24')]({'plain':!![]});var _0x3c0194=_0xcf5c('0x25');return db[_0xcf5c('0x26')][_0xcf5c('0x23')]({'where':{'type':_0x3c0194,'resourceId':_0x3cc6c2['id']}})[_0xcf5c('0x22')](function(){return _0x400da2;});})[_0xcf5c('0x22')](function(){_0x1a575e['status'](0xcc)[_0xcf5c('0x16')]();});}};}function handleEntityNotFound(_0x34f62d,_0x593d48){return function(_0x13abf0){if(!_0x13abf0){_0x34f62d['sendStatus'](0x194);}return _0x13abf0;};}function handleError(_0x595096,_0xbdc619){_0xbdc619=_0xbdc619||0x1f4;return function(_0x5dd5a4){logger[_0xcf5c('0x27')](_0x5dd5a4[_0xcf5c('0x28')]);if(_0x5dd5a4[_0xcf5c('0x29')]){delete _0x5dd5a4[_0xcf5c('0x29')];}_0x595096['status'](_0xbdc619)[_0xcf5c('0x2a')](_0x5dd5a4);};}exports[_0xcf5c('0x2b')]=function(_0x17ebe,_0x34d5b9){var _0x4ec0e1={},_0x519251={},_0x3c5e6b={'count':0x0,'rows':[]};var _0x4068cc=_['map'](db[_0xcf5c('0x2c')]['rawAttributes'],function(_0x1be6bf){return{'name':_0x1be6bf['fieldName'],'type':_0x1be6bf[_0xcf5c('0x2d')][_0xcf5c('0x2e')]};});_0x519251['model']=_[_0xcf5c('0x2f')](_0x4068cc,_0xcf5c('0x29'));_0x519251[_0xcf5c('0x30')]=_[_0xcf5c('0x31')](_0x17ebe[_0xcf5c('0x30')]);_0x519251[_0xcf5c('0x32')]=_[_0xcf5c('0x33')](_0x519251[_0xcf5c('0x34')],_0x519251[_0xcf5c('0x30')]);_0x4ec0e1[_0xcf5c('0x35')]=_[_0xcf5c('0x33')](_0x519251['model'],qs[_0xcf5c('0x36')](_0x17ebe[_0xcf5c('0x30')][_0xcf5c('0x36')]));_0x4ec0e1[_0xcf5c('0x35')]=_0x4ec0e1[_0xcf5c('0x35')]['length']?_0x4ec0e1[_0xcf5c('0x35')]:_0x519251[_0xcf5c('0x34')];if(!_0x17ebe[_0xcf5c('0x30')]['hasOwnProperty'](_0xcf5c('0x37'))){_0x4ec0e1[_0xcf5c('0x1a')]=qs['limit'](_0x17ebe[_0xcf5c('0x30')][_0xcf5c('0x1a')]);_0x4ec0e1['offset']=qs[_0xcf5c('0x1c')](_0x17ebe[_0xcf5c('0x30')][_0xcf5c('0x1c')]);}_0x4ec0e1[_0xcf5c('0x38')]=qs[_0xcf5c('0x39')](_0x17ebe[_0xcf5c('0x30')][_0xcf5c('0x39')]);_0x4ec0e1['where']=qs['filters'](_[_0xcf5c('0x3a')](_0x17ebe['query'],_0x519251[_0xcf5c('0x32')]),_0x4068cc);if(_0x17ebe[_0xcf5c('0x30')]['filter']){_0x4ec0e1[_0xcf5c('0x3b')]=_[_0xcf5c('0x3c')](_0x4ec0e1[_0xcf5c('0x3b')],{'$or':_[_0xcf5c('0x2f')](_0x4068cc,function(_0x3cbe35){if(_0x3cbe35[_0xcf5c('0x2d')]!=='VIRTUAL'){var _0x176865={};_0x176865[_0x3cbe35[_0xcf5c('0x29')]]={'$like':'%'+_0x17ebe[_0xcf5c('0x30')][_0xcf5c('0x3d')]+'%'};return _0x176865;}})});}_0x4ec0e1=_[_0xcf5c('0x3c')]({},_0x4ec0e1,_0x17ebe[_0xcf5c('0x3e')]);var _0x34fa3d={'where':_0x4ec0e1[_0xcf5c('0x3b')]};return db[_0xcf5c('0x2c')][_0xcf5c('0x1b')](_0x34fa3d)['then'](function(_0x399ff5){_0x3c5e6b[_0xcf5c('0x1b')]=_0x399ff5;if(_0x17ebe['query'][_0xcf5c('0x3f')]){_0x4ec0e1[_0xcf5c('0x40')]=[{'all':!![]}];}return db['Variable'][_0xcf5c('0x41')](_0x4ec0e1);})['then'](function(_0x52d747){_0x3c5e6b['rows']=_0x52d747;return _0x3c5e6b;})[_0xcf5c('0x22')](respondWithFilteredResult(_0x34d5b9,_0x4ec0e1))[_0xcf5c('0x42')](handleError(_0x34d5b9,null));};exports['show']=function(_0xe6baa5,_0x291b1b){var _0x2eb955={'raw':!![],'where':{'id':_0xe6baa5[_0xcf5c('0x43')]['id']}},_0x1a1002={};_0x1a1002[_0xcf5c('0x34')]=_[_0xcf5c('0x31')](db[_0xcf5c('0x2c')][_0xcf5c('0x44')]);_0x1a1002[_0xcf5c('0x30')]=_[_0xcf5c('0x31')](_0xe6baa5[_0xcf5c('0x30')]);_0x1a1002[_0xcf5c('0x32')]=_[_0xcf5c('0x33')](_0x1a1002[_0xcf5c('0x34')],_0x1a1002[_0xcf5c('0x30')]);_0x2eb955['attributes']=_[_0xcf5c('0x33')](_0x1a1002[_0xcf5c('0x34')],qs['fields'](_0xe6baa5[_0xcf5c('0x30')][_0xcf5c('0x36')]));_0x2eb955[_0xcf5c('0x35')]=_0x2eb955['attributes'][_0xcf5c('0x45')]?_0x2eb955['attributes']:_0x1a1002[_0xcf5c('0x34')];if(_0xe6baa5[_0xcf5c('0x30')][_0xcf5c('0x3f')]){_0x2eb955[_0xcf5c('0x40')]=[{'all':!![]}];}_0x2eb955=_[_0xcf5c('0x3c')]({},_0x2eb955,_0xe6baa5[_0xcf5c('0x3e')]);return db['Variable']['find'](_0x2eb955)[_0xcf5c('0x22')](handleEntityNotFound(_0x291b1b,null))['then'](respondWithResult(_0x291b1b,null))['catch'](handleError(_0x291b1b,null));};exports['create']=function(_0x4e0fe1,_0x48cf48){return db[_0xcf5c('0x2c')][_0xcf5c('0x46')](_0x4e0fe1[_0xcf5c('0x47')],{})[_0xcf5c('0x22')](function(_0x4e86c0){var _0x12da2e=_0x4e0fe1[_0xcf5c('0x48')][_0xcf5c('0x24')]({'plain':!![]});if(!_0x12da2e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12da2e[_0xcf5c('0x49')]===_0xcf5c('0x48')){var _0x2db95c=_0x4e86c0[_0xcf5c('0x24')]({'plain':!![]});var _0x43020d=_0xcf5c('0x25');return db[_0xcf5c('0x4a')][_0xcf5c('0x4b')]({'where':{'name':_0x43020d,'userProfileId':_0x12da2e[_0xcf5c('0x4c')]},'raw':!![]})[_0xcf5c('0x22')](function(_0x43c233){if(_0x43c233&&_0x43c233[_0xcf5c('0x4d')]===0x0){return db[_0xcf5c('0x26')][_0xcf5c('0x46')]({'name':_0x2db95c[_0xcf5c('0x29')],'resourceId':_0x2db95c['id'],'type':_0x43c233[_0xcf5c('0x29')],'sectionId':_0x43c233['id']},{})[_0xcf5c('0x22')](function(){return _0x4e86c0;});}else{return _0x4e86c0;}})[_0xcf5c('0x42')](function(_0x171915){logger['error'](_0xcf5c('0x4e'),_0x171915);throw _0x171915;});}return _0x4e86c0;})[_0xcf5c('0x22')](respondWithResult(_0x48cf48,0xc9))[_0xcf5c('0x42')](handleError(_0x48cf48,null));};exports[_0xcf5c('0x21')]=function(_0x524386,_0x39de5f){if(_0x524386['body']['id']){delete _0x524386[_0xcf5c('0x47')]['id'];}return db[_0xcf5c('0x2c')]['find']({'where':{'id':_0x524386['params']['id']}})[_0xcf5c('0x22')](handleEntityNotFound(_0x39de5f,null))[_0xcf5c('0x22')](saveUpdates(_0x524386['body'],null))[_0xcf5c('0x22')](respondWithResult(_0x39de5f,null))[_0xcf5c('0x42')](handleError(_0x39de5f,null));};exports['destroy']=function(_0x27330c,_0x26a95d){return db['Variable'][_0xcf5c('0x4b')]({'where':{'id':_0x27330c[_0xcf5c('0x43')]['id']}})[_0xcf5c('0x22')](handleEntityNotFound(_0x26a95d,null))[_0xcf5c('0x22')](removeEntity(_0x26a95d,null))[_0xcf5c('0x42')](handleError(_0x26a95d,null));}; \ No newline at end of file +var _0x8ed7=['rows','show','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','reject','save','destroy','get','Variables','UserProfileResource','then','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x5b10f8,_0x4555b4){var _0x2995ce=function(_0x4dc6fd){while(--_0x4dc6fd){_0x5b10f8['push'](_0x5b10f8['shift']());}};_0x2995ce(++_0x4555b4);}(_0x8ed7,0x106));var _0x78ed=function(_0x20723d,_0x3b2ded){_0x20723d=_0x20723d-0x0;var _0x3e7b01=_0x8ed7[_0x20723d];return _0x3e7b01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78ed('0x0'));var zipdir=require(_0x78ed('0x1'));var jsonpatch=require(_0x78ed('0x2'));var rp=require('request-promise');var moment=require(_0x78ed('0x3'));var BPromise=require(_0x78ed('0x4'));var Mustache=require(_0x78ed('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x78ed('0x6'));var ejs=require(_0x78ed('0x7'));var fs=require('fs');var fs_extra=require(_0x78ed('0x8'));var _=require('lodash');var squel=require(_0x78ed('0x9'));var crypto=require(_0x78ed('0xa'));var jsforce=require(_0x78ed('0xb'));var deskjs=require(_0x78ed('0xc'));var toCsv=require(_0x78ed('0x6'));var querystring=require(_0x78ed('0xd'));var Papa=require('papaparse');var Redis=require(_0x78ed('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x78ed('0xf'));var hardwareService=require(_0x78ed('0x10'));var logger=require(_0x78ed('0x11'))(_0x78ed('0x12'));var utils=require(_0x78ed('0x13'));var config=require(_0x78ed('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x78ed('0x15'))['db'];function respondWithStatusCode(_0x395eae,_0xdfc03a){_0xdfc03a=_0xdfc03a||0xcc;return function(_0x533810){if(_0x533810){return _0x395eae[_0x78ed('0x16')](_0xdfc03a);}return _0x395eae[_0x78ed('0x17')](_0xdfc03a)[_0x78ed('0x18')]();};}function respondWithResult(_0x393d6d,_0x5c062b){_0x5c062b=_0x5c062b||0xc8;return function(_0x3031ee){if(_0x3031ee){return _0x393d6d[_0x78ed('0x17')](_0x5c062b)[_0x78ed('0x19')](_0x3031ee);}};}function respondWithFilteredResult(_0x37ac28,_0x3d638a){return function(_0x58e0db){if(_0x58e0db){var _0x6eb3eb=typeof _0x3d638a['offset']==='undefined'&&typeof _0x3d638a['limit']===_0x78ed('0x1a');var _0xb30111=_0x58e0db['count'];var _0x15457e=_0x6eb3eb?0x0:_0x3d638a[_0x78ed('0x1b')];var _0x109d4c=_0x6eb3eb?_0x58e0db[_0x78ed('0x1c')]:_0x3d638a[_0x78ed('0x1b')]+_0x3d638a[_0x78ed('0x1d')];var _0x580e96;if(_0x109d4c>=_0xb30111){_0x109d4c=_0xb30111;_0x580e96=0xc8;}else{_0x580e96=0xce;}_0x37ac28[_0x78ed('0x17')](_0x580e96);return _0x37ac28[_0x78ed('0x1e')]('Content-Range',_0x15457e+'-'+_0x109d4c+'/'+_0xb30111)[_0x78ed('0x19')](_0x58e0db);}return null;};}function patchUpdates(_0x264f60){return function(_0x5d8d19){try{jsonpatch['apply'](_0x5d8d19,_0x264f60,!![]);}catch(_0x2f66b4){return BPromise[_0x78ed('0x1f')](_0x2f66b4);}return _0x5d8d19[_0x78ed('0x20')]();};}function saveUpdates(_0x124d48,_0x560a0f){return function(_0x8953bf){if(_0x8953bf){return _0x8953bf['update'](_0x124d48)['then'](function(_0x37e20c){return _0x37e20c;});}return null;};}function removeEntity(_0x3e8439,_0x56e86d){return function(_0x15747f){if(_0x15747f){return _0x15747f[_0x78ed('0x21')]()['then'](function(){var _0xedba45=_0x15747f[_0x78ed('0x22')]({'plain':!![]});var _0x3d5973=_0x78ed('0x23');return db[_0x78ed('0x24')][_0x78ed('0x21')]({'where':{'type':_0x3d5973,'resourceId':_0xedba45['id']}})['then'](function(){return _0x15747f;});})[_0x78ed('0x25')](function(){_0x3e8439[_0x78ed('0x17')](0xcc)[_0x78ed('0x18')]();});}};}function handleEntityNotFound(_0x3ff23c,_0x335392){return function(_0xa47f93){if(!_0xa47f93){_0x3ff23c['sendStatus'](0x194);}return _0xa47f93;};}function handleError(_0x10f6ca,_0x1ad8f5){_0x1ad8f5=_0x1ad8f5||0x1f4;return function(_0x13c24d){logger[_0x78ed('0x26')](_0x13c24d[_0x78ed('0x27')]);if(_0x13c24d[_0x78ed('0x28')]){delete _0x13c24d[_0x78ed('0x28')];}_0x10f6ca[_0x78ed('0x17')](_0x1ad8f5)[_0x78ed('0x29')](_0x13c24d);};}exports[_0x78ed('0x2a')]=function(_0x3ba882,_0x5369d2){var _0x15a2c3={},_0x1e41c9={},_0x2ffbbe={'count':0x0,'rows':[]};var _0x1127bc=_[_0x78ed('0x2b')](db[_0x78ed('0x2c')][_0x78ed('0x2d')],function(_0x51a8cd){return{'name':_0x51a8cd[_0x78ed('0x2e')],'type':_0x51a8cd[_0x78ed('0x2f')][_0x78ed('0x30')]};});_0x1e41c9['model']=_[_0x78ed('0x2b')](_0x1127bc,'name');_0x1e41c9[_0x78ed('0x31')]=_[_0x78ed('0x32')](_0x3ba882['query']);_0x1e41c9[_0x78ed('0x33')]=_[_0x78ed('0x34')](_0x1e41c9[_0x78ed('0x35')],_0x1e41c9[_0x78ed('0x31')]);_0x15a2c3[_0x78ed('0x36')]=_['intersection'](_0x1e41c9[_0x78ed('0x35')],qs[_0x78ed('0x37')](_0x3ba882[_0x78ed('0x31')][_0x78ed('0x37')]));_0x15a2c3[_0x78ed('0x36')]=_0x15a2c3[_0x78ed('0x36')][_0x78ed('0x38')]?_0x15a2c3['attributes']:_0x1e41c9[_0x78ed('0x35')];if(!_0x3ba882[_0x78ed('0x31')][_0x78ed('0x39')](_0x78ed('0x3a'))){_0x15a2c3[_0x78ed('0x1d')]=qs[_0x78ed('0x1d')](_0x3ba882['query'][_0x78ed('0x1d')]);_0x15a2c3[_0x78ed('0x1b')]=qs[_0x78ed('0x1b')](_0x3ba882[_0x78ed('0x31')][_0x78ed('0x1b')]);}_0x15a2c3[_0x78ed('0x3b')]=qs[_0x78ed('0x3c')](_0x3ba882[_0x78ed('0x31')][_0x78ed('0x3c')]);_0x15a2c3[_0x78ed('0x3d')]=qs[_0x78ed('0x33')](_[_0x78ed('0x3e')](_0x3ba882[_0x78ed('0x31')],_0x1e41c9[_0x78ed('0x33')]),_0x1127bc);if(_0x3ba882[_0x78ed('0x31')]['filter']){_0x15a2c3[_0x78ed('0x3d')]=_[_0x78ed('0x3f')](_0x15a2c3['where'],{'$or':_[_0x78ed('0x2b')](_0x1127bc,function(_0x2e39f8){if(_0x2e39f8['type']!==_0x78ed('0x40')){var _0x22eb2b={};_0x22eb2b[_0x2e39f8[_0x78ed('0x28')]]={'$like':'%'+_0x3ba882[_0x78ed('0x31')][_0x78ed('0x41')]+'%'};return _0x22eb2b;}})});}_0x15a2c3=_[_0x78ed('0x3f')]({},_0x15a2c3,_0x3ba882[_0x78ed('0x42')]);var _0x52af1e={'where':_0x15a2c3[_0x78ed('0x3d')]};return db[_0x78ed('0x2c')][_0x78ed('0x1c')](_0x52af1e)[_0x78ed('0x25')](function(_0x2abf8e){_0x2ffbbe[_0x78ed('0x1c')]=_0x2abf8e;if(_0x3ba882['query'][_0x78ed('0x43')]){_0x15a2c3[_0x78ed('0x44')]=[{'all':!![]}];}return db[_0x78ed('0x2c')][_0x78ed('0x45')](_0x15a2c3);})[_0x78ed('0x25')](function(_0x131ee5){_0x2ffbbe[_0x78ed('0x46')]=_0x131ee5;return _0x2ffbbe;})['then'](respondWithFilteredResult(_0x5369d2,_0x15a2c3))['catch'](handleError(_0x5369d2,null));};exports[_0x78ed('0x47')]=function(_0x2ab2f4,_0x46534e){var _0x4988e2={'raw':!![],'where':{'id':_0x2ab2f4['params']['id']}},_0x134926={};_0x134926[_0x78ed('0x35')]=_[_0x78ed('0x32')](db['Variable'][_0x78ed('0x2d')]);_0x134926['query']=_['keys'](_0x2ab2f4[_0x78ed('0x31')]);_0x134926['filters']=_[_0x78ed('0x34')](_0x134926[_0x78ed('0x35')],_0x134926[_0x78ed('0x31')]);_0x4988e2[_0x78ed('0x36')]=_[_0x78ed('0x34')](_0x134926['model'],qs['fields'](_0x2ab2f4[_0x78ed('0x31')][_0x78ed('0x37')]));_0x4988e2[_0x78ed('0x36')]=_0x4988e2[_0x78ed('0x36')][_0x78ed('0x38')]?_0x4988e2[_0x78ed('0x36')]:_0x134926[_0x78ed('0x35')];if(_0x2ab2f4[_0x78ed('0x31')][_0x78ed('0x43')]){_0x4988e2['include']=[{'all':!![]}];}_0x4988e2=_[_0x78ed('0x3f')]({},_0x4988e2,_0x2ab2f4[_0x78ed('0x42')]);return db['Variable'][_0x78ed('0x48')](_0x4988e2)[_0x78ed('0x25')](handleEntityNotFound(_0x46534e,null))[_0x78ed('0x25')](respondWithResult(_0x46534e,null))[_0x78ed('0x49')](handleError(_0x46534e,null));};exports[_0x78ed('0x4a')]=function(_0x290295,_0x35547a){return db[_0x78ed('0x2c')][_0x78ed('0x4a')](_0x290295['body'],{})['then'](function(_0x59022f){var _0x313429=_0x290295[_0x78ed('0x4b')]['get']({'plain':!![]});if(!_0x313429)throw new Error(_0x78ed('0x4c'));if(_0x313429[_0x78ed('0x4d')]===_0x78ed('0x4b')){var _0x30c9cb=_0x59022f[_0x78ed('0x22')]({'plain':!![]});var _0x22438e=_0x78ed('0x23');return db[_0x78ed('0x4e')][_0x78ed('0x48')]({'where':{'name':_0x22438e,'userProfileId':_0x313429[_0x78ed('0x4f')]},'raw':!![]})[_0x78ed('0x25')](function(_0x1789f9){if(_0x1789f9&&_0x1789f9[_0x78ed('0x50')]===0x0){return db[_0x78ed('0x24')][_0x78ed('0x4a')]({'name':_0x30c9cb[_0x78ed('0x28')],'resourceId':_0x30c9cb['id'],'type':_0x1789f9['name'],'sectionId':_0x1789f9['id']},{})[_0x78ed('0x25')](function(){return _0x59022f;});}else{return _0x59022f;}})['catch'](function(_0x441eaf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x441eaf);throw _0x441eaf;});}return _0x59022f;})[_0x78ed('0x25')](respondWithResult(_0x35547a,0xc9))[_0x78ed('0x49')](handleError(_0x35547a,null));};exports['update']=function(_0x59431f,_0x1e7a7a){if(_0x59431f[_0x78ed('0x51')]['id']){delete _0x59431f[_0x78ed('0x51')]['id'];}return db[_0x78ed('0x2c')][_0x78ed('0x48')]({'where':{'id':_0x59431f['params']['id']}})[_0x78ed('0x25')](handleEntityNotFound(_0x1e7a7a,null))[_0x78ed('0x25')](saveUpdates(_0x59431f[_0x78ed('0x51')],null))[_0x78ed('0x25')](respondWithResult(_0x1e7a7a,null))[_0x78ed('0x49')](handleError(_0x1e7a7a,null));};exports[_0x78ed('0x21')]=function(_0x3b06c2,_0x4da9a5){return db['Variable'][_0x78ed('0x48')]({'where':{'id':_0x3b06c2[_0x78ed('0x52')]['id']}})['then'](handleEntityNotFound(_0x4da9a5,null))[_0x78ed('0x25')](removeEntity(_0x4da9a5,null))['catch'](handleError(_0x4da9a5,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 1330b3e..2cfa931 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 _0x3872=['Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports'];(function(_0x458e3e,_0x576c7f){var _0x4bb0ee=function(_0x1ae0b1){while(--_0x1ae0b1){_0x458e3e['push'](_0x458e3e['shift']());}};_0x4bb0ee(++_0x576c7f);}(_0x3872,0x1e2));var _0x2387=function(_0x4f74cf,_0x1da689){_0x4f74cf=_0x4f74cf-0x0;var _0x377f9b=_0x3872[_0x4f74cf];return _0x377f9b;};'use strict';var _=require(_0x2387('0x0'));var util=require(_0x2387('0x1'));var logger=require(_0x2387('0x2'))(_0x2387('0x3'));var moment=require('moment');var BPromise=require(_0x2387('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2387('0x5'));var config=require(_0x2387('0x6'));var attributes=require('./variable.attributes');module[_0x2387('0x7')]=function(_0x1ed9a6,_0x832b83){return _0x1ed9a6['define'](_0x2387('0x8'),attributes,{'tableName':_0x2387('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4139=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define'];(function(_0x14341f,_0x18a9d1){var _0x4422c4=function(_0x524b61){while(--_0x524b61){_0x14341f['push'](_0x14341f['shift']());}};_0x4422c4(++_0x18a9d1);}(_0x4139,0x118));var _0x9413=function(_0xbdc648,_0xf1bf9d){_0xbdc648=_0xbdc648-0x0;var _0x43e537=_0x4139[_0xbdc648];return _0x43e537;};'use strict';var _=require(_0x9413('0x0'));var util=require('util');var logger=require(_0x9413('0x1'))(_0x9413('0x2'));var moment=require('moment');var BPromise=require(_0x9413('0x3'));var rp=require(_0x9413('0x4'));var fs=require('fs');var path=require(_0x9413('0x5'));var rimraf=require(_0x9413('0x6'));var config=require(_0x9413('0x7'));var attributes=require(_0x9413('0x8'));module['exports']=function(_0x3c452e,_0x4435c5){return _0x3c452e[_0x9413('0x9')]('Variable',attributes,{'tableName':'tools_variables','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 093ea7b..a9d1bd3 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x2370db,_0x592999){var _0x47585c=function(_0xb6899e){while(--_0xb6899e){_0x2370db['push'](_0x2370db['shift']());}};_0x47585c(++_0x592999);}(_0x1cb9,0x14e));var _0x91cb=function(_0x27d445,_0x3a00e3){_0x27d445=_0x27d445-0x0;var _0x1f95c3=_0x1cb9[_0x27d445];return _0x1f95c3;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x7fbe=['stringify','error','code','message','result','catch','Variable','find','options','where','attributes','include','map','model','info','ShowVariable','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x4e4d6a,_0x9dbefd){var _0x58193f=function(_0x1d15b4){while(--_0x1d15b4){_0x4e4d6a['push'](_0x4e4d6a['shift']());}};_0x58193f(++_0x9dbefd);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5d9eaa,_0x167a02){_0x5d9eaa=_0x5d9eaa-0x0;var _0x15db37=_0x7fbe[_0x5d9eaa];return _0x15db37;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}exports['ShowVariable']=function(_0x293a47){var _0x546463=this;return new Promise(function(_0x1e77fd,_0x4708f7){return db[_0xe7fb('0x18')][_0xe7fb('0x19')]({'raw':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x293a47[_0xe7fb('0x1a')]?_0x293a47['options'][_0xe7fb('0x1b')]||null:null,'attributes':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1c')]||null:null,'include':_0x293a47['options']?_0x293a47[_0xe7fb('0x1a')][_0xe7fb('0x1d')]?_[_0xe7fb('0x1e')](_0x293a47['options'][_0xe7fb('0x1d')],function(_0x469ead){return{'model':db[_0x469ead['model']],'as':_0x469ead['as'],'attributes':_0x469ead['attributes'],'include':_0x469ead['include']?_[_0xe7fb('0x1e')](_0x469ead['include'],function(_0x49b219){return{'model':db[_0x49b219[_0xe7fb('0x1f')]],'as':_0x49b219['as'],'attributes':_0x49b219[_0xe7fb('0x1c')],'include':_0x49b219[_0xe7fb('0x1d')]?_['map'](_0x49b219[_0xe7fb('0x1d')],function(_0x2b69c4){return{'model':db[_0x2b69c4[_0xe7fb('0x1f')]],'as':_0x2b69c4['as'],'attributes':_0x2b69c4[_0xe7fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe7fb('0xd')](function(_0x16237a){logger[_0xe7fb('0x20')]('ShowVariable',_0x293a47);logger['debug'](_0xe7fb('0x21'),_0x293a47,JSON[_0xe7fb('0x12')](_0x16237a));_0x1e77fd(_0x16237a);})[_0xe7fb('0x17')](function(_0x4fd290){logger[_0xe7fb('0x13')](_0xe7fb('0x21'),_0x4fd290[_0xe7fb('0x15')],_0x293a47);_0x4708f7(_0x546463[_0xe7fb('0x13')](0x1f4,_0x4fd290[_0xe7fb('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 887663a..2dfebb8 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 _0x079d=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset'];(function(_0x24be76,_0x39b3ad){var _0x1f2131=function(_0x134af3){while(--_0x134af3){_0x24be76['push'](_0x24be76['shift']());}};_0x1f2131(++_0x39b3ad);}(_0x079d,0x15e));var _0xd079=function(_0x5df6db,_0x58aed6){_0x5df6db=_0x5df6db-0x0;var _0x2b5ef2=_0x079d[_0x5df6db];return _0x2b5ef2;};'use strict';var express=require(_0xd079('0x0'));var router=express[_0xd079('0x1')]();var auth=require(_0xd079('0x2'));var controller=require(_0xd079('0x3'));router[_0xd079('0x4')]('/',controller['index']);router[_0xd079('0x4')](_0xd079('0x5'),auth[_0xd079('0x6')](),auth[_0xd079('0x7')](),controller[_0xd079('0x8')]);router[_0xd079('0x4')](_0xd079('0x9'),auth[_0xd079('0x6')](),auth[_0xd079('0x7')](),controller[_0xd079('0xa')]);router[_0xd079('0x4')](_0xd079('0xb'),auth[_0xd079('0x6')](),auth[_0xd079('0x7')](),controller[_0xd079('0xc')]);router[_0xd079('0x4')](_0xd079('0xd'),auth[_0xd079('0x6')](),controller[_0xd079('0xe')]);router[_0xd079('0x4')](_0xd079('0xf'),controller[_0xd079('0x10')]);module[_0xd079('0x11')]=router; \ No newline at end of file +var _0x505b=['index','fetch','canUpdate','reset','/pull','isAuthenticated','pull','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x505b,0x1db));var _0xb505=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x505b[_0x4a9fb1];return _0x348672;};'use strict';var express=require(_0xb505('0x0'));var router=express[_0xb505('0x1')]();var auth=require(_0xb505('0x2'));var controller=require(_0xb505('0x3'));router[_0xb505('0x4')]('/',controller[_0xb505('0x5')]);router[_0xb505('0x4')]('/fetch',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xb505('0x6')]);router[_0xb505('0x4')]('/reset',auth['isAuthenticated'](),auth[_0xb505('0x7')](),controller[_0xb505('0x8')]);router['get'](_0xb505('0x9'),auth[_0xb505('0xa')](),auth['canUpdate'](),controller[_0xb505('0xb')]);router['get']('/restart',auth['isAuthenticated'](),controller[_0xb505('0xc')]);router[_0xb505('0x4')](_0xb505('0xd'),controller[_0xb505('0xe')]);module[_0xb505('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cce3fd2..73b9a00 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 _0xb87f=['master','error','info','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','join','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','root','index','exports','query','latest','fetch','tags','status','json'];(function(_0x1554d6,_0x58d1f4){var _0x38c42c=function(_0x56cb90){while(--_0x56cb90){_0x1554d6['push'](_0x1554d6['shift']());}};_0x38c42c(++_0x58d1f4);}(_0xb87f,0x13d));var _0xfb87=function(_0x49536b,_0x2abe5d){_0x49536b=_0x49536b-0x0;var _0x30de59=_0xb87f[_0x49536b];return _0x30de59;};'use strict';var Umzug=require(_0xfb87('0x0'));var path=require(_0xfb87('0x1'));var fs=require('fs');var _=require(_0xfb87('0x2'));var pkginfo=require('pkginfo')(module,_0xfb87('0x3'));var compareVersions=require(_0xfb87('0x4'));var exec=require(_0xfb87('0x5'))[_0xfb87('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0xfb87('0x7'));var pm2=require('../../config/pm2');var logger=require(_0xfb87('0x8'))(_0xfb87('0x9'));var git=require('simple-git')(config[_0xfb87('0xa')]);exports[_0xfb87('0xb')]=function(_0x1519b9,_0x65d6fc){var _0x4865ce={'current':module[_0xfb87('0xc')][_0xfb87('0x3')],'phonebar':0x2};if(_0x1519b9['query']&&_0x1519b9[_0xfb87('0xd')][_0xfb87('0xe')]){return git[_0xfb87('0xf')]()[_0xfb87('0x10')](function(_0x2ce73e,_0x11a975){_0x4865ce['latest']=(_0x2ce73e?module['exports'][_0xfb87('0x3')]:_0x11a975[_0xfb87('0xe')])||'2.0.0';return _0x65d6fc[_0xfb87('0x11')](0xc8)['json'](_0x4865ce);});}else{return _0x65d6fc[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')](_0x4865ce);}};exports['fetch']=function(_0x4f261a,_0x4a6442){return git[_0xfb87('0xf')](['origin',_0xfb87('0x13')],function(_0x13a663){if(_0x13a663){logger[_0xfb87('0x14')](_0x13a663);return _0x4a6442['status'](0x1f4)[_0xfb87('0x12')](_0x13a663);}logger[_0xfb87('0x15')]('git\x20fetch');return _0x4a6442[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':_0xfb87('0x16')});});};exports[_0xfb87('0x17')]=function(_0x48e784,_0x23f218){return git[_0xfb87('0x17')](['--hard','FETCH_HEAD'],function(_0x120346){if(_0x120346){logger[_0xfb87('0x14')](_0x120346);return _0x23f218[_0xfb87('0x11')](0x1f4)[_0xfb87('0x12')](_0x120346);}logger[_0xfb87('0x15')](_0xfb87('0x18'));return _0x23f218[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':'git\x20reset\x20--hard'});});};exports[_0xfb87('0x19')]=function(_0x4eab48,_0x4512f7){exec(_0xfb87('0x1a'),function(_0x331693,_0x35916f,_0x38e292){logger['info'](_0x35916f);logger[_0xfb87('0x15')](_0x38e292);if(_0x331693){logger['error'](_0x331693);return _0x4512f7[_0xfb87('0x11')](0x1f4)[_0xfb87('0x12')](_0x331693);}return _0x4512f7['status'](0xc8)['json']({'output':_0x35916f});});};exports[_0xfb87('0x1b')]=function(_0x104d35,_0x422ea8){return pm2[_0xfb87('0x1b')](_0xfb87('0x1c'))[_0xfb87('0x1d')](function(_0x3ca9d8){logger['info'](_0xfb87('0x1e'),_0x3ca9d8);return _0x422ea8[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':_0xfb87('0x1f')});})[_0xfb87('0x20')](function(_0x3a3b5e){logger[_0xfb87('0x14')](_0x3a3b5e);return _0x422ea8[_0xfb87('0x11')](0x1f4)['json'](_0x3a3b5e);});};exports[_0xfb87('0x21')]=function(_0x1d0fce,_0x2b4882){var _0x5f4fae=fs['readdirSync'](path['join'](config[_0xfb87('0xa')],'server',_0xfb87('0x21')));var _0x5c53ec=[];for(var _0x41f6f0=0x0;_0x41f6f0<_0x5f4fae['length'];_0x41f6f0++){var _0x3ae881=_0x5f4fae[_0x41f6f0]['replace'](_0xfb87('0x22'),'');if(compareVersions(module[_0xfb87('0xc')][_0xfb87('0x3')],_0x3ae881)===-0x1){_0x5c53ec[_0xfb87('0x23')](_0x3ae881);}}if(_0x5c53ec[_0xfb87('0x24')]){var _0x116850=_0x5c53ec[_0xfb87('0x25')](compareVersions);var _0x3d0d66=new Umzug({'storage':_0xfb87('0x26'),'storageOptions':{'model':db[_0xfb87('0x27')],'modelName':_0xfb87('0x27'),'columnName':_0xfb87('0x3')},'migrations':{'params':[db[_0xfb87('0x26')][_0xfb87('0x28')](),db['sequelize'][_0xfb87('0x29')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],_0xfb87('0x2a'),_0xfb87('0x21')),'pattern':/\.js$/}});_0x3d0d66['up']({'migrations':_[_0xfb87('0x2b')](_0x116850,function(_0x11887e){return _0x11887e+_0xfb87('0x22');})})[_0xfb87('0x1d')](function(){return _0x2b4882[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':_0xfb87('0x2c')+module[_0xfb87('0xc')][_0xfb87('0x3')]+_0xfb87('0x2d')+_['last'](_0x116850),'migrations':_[_0xfb87('0x2e')](_0x116850)});})[_0xfb87('0x20')](function(_0x5565a4){if(_0x5565a4 instanceof db[_0xfb87('0x26')]['UniqueConstraintError']){return _0x2b4882[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':_0xfb87('0x2f')});}else{return _0x2b4882[_0xfb87('0x11')](0x1f4)['json'](_0x5565a4);}});}else{return _0x2b4882[_0xfb87('0x11')](0xc8)[_0xfb87('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xb3ed=['last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','version','query','fetch','tags','latest','exports','2.0.0','status','json','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','readdirSync','join','server','length','replace','push','sort','Migration','sequelize','getQueryInterface','constructor','root','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20'];(function(_0x2a9836,_0x43db2f){var _0x3dc3b6=function(_0x10dbfa){while(--_0x10dbfa){_0x2a9836['push'](_0x2a9836['shift']());}};_0x3dc3b6(++_0x43db2f);}(_0xb3ed,0x1e0));var _0xdb3e=function(_0x41bb67,_0x53611c){_0x41bb67=_0x41bb67-0x0;var _0x427f74=_0xb3ed[_0x41bb67];return _0x427f74;};'use strict';var Umzug=require(_0xdb3e('0x0'));var path=require(_0xdb3e('0x1'));var fs=require('fs');var _=require(_0xdb3e('0x2'));var pkginfo=require(_0xdb3e('0x3'))(module,'version');var compareVersions=require(_0xdb3e('0x4'));var exec=require('child_process')['exec'];var db=require(_0xdb3e('0x5'))['db'];var config=require(_0xdb3e('0x6'));var pm2=require(_0xdb3e('0x7'));var logger=require(_0xdb3e('0x8'))(_0xdb3e('0x9'));var git=require('simple-git')(config['root']);exports['index']=function(_0x1abf61,_0x4a85ba){var _0x3f35b2={'current':module['exports'][_0xdb3e('0xa')],'phonebar':0x2};if(_0x1abf61[_0xdb3e('0xb')]&&_0x1abf61[_0xdb3e('0xb')]['latest']){return git[_0xdb3e('0xc')]()[_0xdb3e('0xd')](function(_0x5b02d3,_0xbce947){_0x3f35b2[_0xdb3e('0xe')]=(_0x5b02d3?module[_0xdb3e('0xf')][_0xdb3e('0xa')]:_0xbce947[_0xdb3e('0xe')])||_0xdb3e('0x10');return _0x4a85ba[_0xdb3e('0x11')](0xc8)[_0xdb3e('0x12')](_0x3f35b2);});}else{return _0x4a85ba['status'](0xc8)[_0xdb3e('0x12')](_0x3f35b2);}};exports['fetch']=function(_0x2d6e28,_0x1b8cd0){return git[_0xdb3e('0xc')](['origin',_0xdb3e('0x13')],function(_0x51a2d1){if(_0x51a2d1){logger['error'](_0x51a2d1);return _0x1b8cd0['status'](0x1f4)[_0xdb3e('0x12')](_0x51a2d1);}logger[_0xdb3e('0x14')](_0xdb3e('0x15'));return _0x1b8cd0['status'](0xc8)[_0xdb3e('0x12')]({'output':_0xdb3e('0x16')});});};exports[_0xdb3e('0x17')]=function(_0x59615c,_0x254db8){return git[_0xdb3e('0x17')]([_0xdb3e('0x18'),'FETCH_HEAD'],function(_0x420a41){if(_0x420a41){logger[_0xdb3e('0x19')](_0x420a41);return _0x254db8[_0xdb3e('0x11')](0x1f4)[_0xdb3e('0x12')](_0x420a41);}logger[_0xdb3e('0x14')](_0xdb3e('0x1a'));return _0x254db8[_0xdb3e('0x11')](0xc8)[_0xdb3e('0x12')]({'output':_0xdb3e('0x1b')});});};exports['pull']=function(_0x7bdc20,_0x3f351f){exec(_0xdb3e('0x1c'),function(_0x130385,_0x27311d,_0x433713){logger[_0xdb3e('0x14')](_0x27311d);logger[_0xdb3e('0x14')](_0x433713);if(_0x130385){logger['error'](_0x130385);return _0x3f351f[_0xdb3e('0x11')](0x1f4)[_0xdb3e('0x12')](_0x130385);}return _0x3f351f[_0xdb3e('0x11')](0xc8)[_0xdb3e('0x12')]({'output':_0x27311d});});};exports[_0xdb3e('0x1d')]=function(_0x481b4c,_0x146122){return pm2[_0xdb3e('0x1d')](_0xdb3e('0x1e'))[_0xdb3e('0x1f')](function(_0x345fb6){logger['info'](_0xdb3e('0x20'),_0x345fb6);return _0x146122['status'](0xc8)[_0xdb3e('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0xdb3e('0x21')](function(_0xe24083){logger['error'](_0xe24083);return _0x146122[_0xdb3e('0x11')](0x1f4)[_0xdb3e('0x12')](_0xe24083);});};exports['migrations']=function(_0x235261,_0x45a1e6){var _0x2dd9cc=fs[_0xdb3e('0x22')](path[_0xdb3e('0x23')](config['root'],_0xdb3e('0x24'),'migrations'));var _0x48b661=[];for(var _0x46d9ab=0x0;_0x46d9ab<_0x2dd9cc[_0xdb3e('0x25')];_0x46d9ab++){var _0x12d4fe=_0x2dd9cc[_0x46d9ab][_0xdb3e('0x26')]('.js','');if(compareVersions(module[_0xdb3e('0xf')][_0xdb3e('0xa')],_0x12d4fe)===-0x1){_0x48b661[_0xdb3e('0x27')](_0x12d4fe);}}if(_0x48b661[_0xdb3e('0x25')]){var _0x1ed351=_0x48b661[_0xdb3e('0x28')](compareVersions);var _0x5ee2a5=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xdb3e('0x29')],'modelName':'Migration','columnName':_0xdb3e('0xa')},'migrations':{'params':[db[_0xdb3e('0x2a')][_0xdb3e('0x2b')](),db[_0xdb3e('0x2a')][_0xdb3e('0x2c')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xdb3e('0x23')](config[_0xdb3e('0x2d')],_0xdb3e('0x24'),'migrations'),'pattern':/\.js$/}});_0x5ee2a5['up']({'migrations':_[_0xdb3e('0x2e')](_0x1ed351,function(_0x483ed1){return _0x483ed1+_0xdb3e('0x2f');})})['then'](function(){return _0x45a1e6[_0xdb3e('0x11')](0xc8)['json']({'output':_0xdb3e('0x30')+module['exports'][_0xdb3e('0xa')]+_0xdb3e('0x31')+_[_0xdb3e('0x32')](_0x1ed351),'migrations':_[_0xdb3e('0x23')](_0x1ed351)});})['catch'](function(_0x530a56){if(_0x530a56 instanceof db[_0xdb3e('0x2a')][_0xdb3e('0x33')]){return _0x45a1e6[_0xdb3e('0x11')](0xc8)[_0xdb3e('0x12')]({'output':_0xdb3e('0x34')});}else{return _0x45a1e6[_0xdb3e('0x11')](0x1f4)[_0xdb3e('0x12')](_0x530a56);}});}else{return _0x45a1e6[_0xdb3e('0x11')](0xc8)[_0xdb3e('0x12')]({'output':_0xdb3e('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 35f70d6..fc9a0d1 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 _0x0d1d=['index','get','describe','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated'];(function(_0xd4d4a4,_0x105953){var _0x54e830=function(_0x7a9fbb){while(--_0x7a9fbb){_0xd4d4a4['push'](_0xd4d4a4['shift']());}};_0x54e830(++_0x105953);}(_0x0d1d,0xb3));var _0xd0d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0d1d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd0d1('0x0'));var path=require(_0xd0d1('0x1'));var timeout=require(_0xd0d1('0x2'));var express=require(_0xd0d1('0x3'));var router=express[_0xd0d1('0x4')]();var fs_extra=require(_0xd0d1('0x5'));var auth=require(_0xd0d1('0x6'));var interaction=require(_0xd0d1('0x7'));var config=require('../../config/environment');var controller=require(_0xd0d1('0x8'));router['get']('/',auth[_0xd0d1('0x9')](),controller[_0xd0d1('0xa')]);router[_0xd0d1('0xb')]('/describe',auth[_0xd0d1('0x9')](),controller[_0xd0d1('0xc')]);router[_0xd0d1('0xb')](_0xd0d1('0xd'),auth[_0xd0d1('0x9')](),controller[_0xd0d1('0xe')]);router['post']('/',auth[_0xd0d1('0x9')](),controller[_0xd0d1('0xf')]);router[_0xd0d1('0x10')](_0xd0d1('0xd'),auth[_0xd0d1('0x9')](),controller[_0xd0d1('0x11')]);router[_0xd0d1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd0d1('0x13')]);module[_0xd0d1('0x14')]=router; \ No newline at end of file +var _0xa0b8=['/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe'];(function(_0xfdaaa6,_0x16f6cb){var _0xde5cf9=function(_0xcc0819){while(--_0xcc0819){_0xfdaaa6['push'](_0xfdaaa6['shift']());}};_0xde5cf9(++_0x16f6cb);}(_0xa0b8,0x133));var _0x8a0b=function(_0x4e029f,_0x177074){_0x4e029f=_0x4e029f-0x0;var _0x135b7e=_0xa0b8[_0x4e029f];return _0x135b7e;};'use strict';var multer=require(_0x8a0b('0x0'));var util=require('util');var path=require(_0x8a0b('0x1'));var timeout=require(_0x8a0b('0x2'));var express=require(_0x8a0b('0x3'));var router=express[_0x8a0b('0x4')]();var fs_extra=require(_0x8a0b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8a0b('0x6'));var config=require(_0x8a0b('0x7'));var controller=require(_0x8a0b('0x8'));router[_0x8a0b('0x9')]('/',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xb')]);router[_0x8a0b('0x9')]('/describe',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xc')]);router[_0x8a0b('0x9')](_0x8a0b('0xd'),auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xe')]);router['post']('/',auth[_0x8a0b('0xa')](),controller[_0x8a0b('0xf')]);router[_0x8a0b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8a0b('0x11')]);router[_0x8a0b('0x12')](_0x8a0b('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8a0b('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 f44ec67..d7a1741 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 _0xe1e3=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x10e956,_0xd5fcf0){var _0x3312a0=function(_0x11d25){while(--_0x11d25){_0x10e956['push'](_0x10e956['shift']());}};_0x3312a0(++_0xd5fcf0);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x55b2b4,_0x19cd47){_0x55b2b4=_0x55b2b4-0x0;var _0x55cdf4=_0xe1e3[_0x55b2b4];return _0x55cdf4;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e1e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3e1e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3e1e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3e1e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3e1e('0x5')]},'agentacw':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3e1e('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3e1e('0x5')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3e1e('0x2')]},'connectedlinename':{'type':Sequelize[_0x3e1e('0x2')]},'language':{'type':Sequelize[_0x3e1e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3e1e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x3e1e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x3e1e('0x2')]},'destlanguage':{'type':Sequelize[_0x3e1e('0x2')]},'destaccountcode':{'type':Sequelize[_0x3e1e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e1e('0x2')]},'destuniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x3e1e('0x2')]},'transfer':{'type':Sequelize[_0x3e1e('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x3e1e('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3e1e('0x2')]},'agententerreason':{'type':Sequelize[_0x3e1e('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa8b1=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x162232,_0x4f7f03){var _0x598128=function(_0x589a01){while(--_0x589a01){_0x162232['push'](_0x162232['shift']());}};_0x598128(++_0x4f7f03);}(_0xa8b1,0x182));var _0x1a8b=function(_0x320903,_0x4a2a3c){_0x320903=_0x320903-0x0;var _0x57bda3=_0xa8b1[_0x320903];return _0x57bda3;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module[_0x1a8b('0x1')]={'type':{'type':Sequelize[_0x1a8b('0x2')]},'uniqueid':{'type':Sequelize[_0x1a8b('0x2')]},'calleridnum':{'type':Sequelize[_0x1a8b('0x2')]},'calleridname':{'type':Sequelize[_0x1a8b('0x2')]},'queue':{'type':Sequelize[_0x1a8b('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentconnectAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x1a8b('0x3')]},'agentdumpAt':{'type':Sequelize[_0x1a8b('0x3')]},'holdtime':{'type':Sequelize[_0x1a8b('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1a8b('0x4')]},'agentacw':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1a8b('0x4')]},'reason':{'type':Sequelize[_0x1a8b('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1a8b('0x2')]},'channelstate':{'type':Sequelize[_0x1a8b('0x4')]},'channelstatedesc':{'type':Sequelize[_0x1a8b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x1a8b('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1a8b('0x2')]},'accountcode':{'type':Sequelize[_0x1a8b('0x2')]},'context':{'type':Sequelize[_0x1a8b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1a8b('0x2')]},'destchannelstate':{'type':Sequelize[_0x1a8b('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x1a8b('0x2')]},'destcalleridname':{'type':Sequelize[_0x1a8b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x1a8b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x1a8b('0x2')]},'destlanguage':{'type':Sequelize[_0x1a8b('0x2')]},'destaccountcode':{'type':Sequelize[_0x1a8b('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x1a8b('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x1a8b('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x1a8b('0x2')]},'transfer':{'type':Sequelize[_0x1a8b('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1a8b('0x2')],'comment':_0x1a8b('0x6')},'transferexten':{'type':Sequelize[_0x1a8b('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x1a8b('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 37022d0..e0d7909 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(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 8043a30..e4d200a 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 _0x383d=['define','VoiceAgentReport','report_agent','uniqueid','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports'];(function(_0x5b2bb0,_0x1bdc31){var _0x3ceee7=function(_0x5b1251){while(--_0x5b1251){_0x5b2bb0['push'](_0x5b2bb0['shift']());}};_0x3ceee7(++_0x1bdc31);}(_0x383d,0x86));var _0xd383=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x383d[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd383('0x0'))(_0xd383('0x1'));var moment=require(_0xd383('0x2'));var BPromise=require('bluebird');var rp=require(_0xd383('0x3'));var fs=require('fs');var path=require(_0xd383('0x4'));var rimraf=require(_0xd383('0x5'));var config=require(_0xd383('0x6'));var attributes=require(_0xd383('0x7'));module[_0xd383('0x8')]=function(_0x5a0b1d,_0xc64e9b){return _0x5a0b1d[_0xd383('0x9')](_0xd383('0xa'),attributes,{'tableName':_0xd383('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd383('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x165d=['request-promise','rimraf','../../config/environment','define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56fb74,_0x12439a){var _0x211592=function(_0xce3ed4){while(--_0xce3ed4){_0x56fb74['push'](_0x56fb74['shift']());}};_0x211592(++_0x12439a);}(_0x165d,0x14a));var _0xd165=function(_0x2f4ce1,_0x49bbd2){_0x2f4ce1=_0x2f4ce1-0x0;var _0x57c054=_0x165d[_0x2f4ce1];return _0x57c054;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var BPromise=require(_0xd165('0x5'));var rp=require(_0xd165('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x5435f9,_0x42d256){return _0x5435f9[_0xd165('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd165('0xa'),_0xd165('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 62d3813..6faeee0 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 _0x3b84=['client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','body','options','raw','then','debug','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b49b9,_0x20e26a){var _0xfc87a6=function(_0x1121f7){while(--_0x1121f7){_0x3b49b9['push'](_0x3b49b9['shift']());}};_0xfc87a6(++_0x20e26a);}(_0x3b84,0x182));var _0x43b8=function(_0x4d9825,_0x5dc4fc){_0x4d9825=_0x4d9825-0x0;var _0x14eb4a=_0x3b84[_0x4d9825];return _0x14eb4a;};'use strict';var _=require(_0x43b8('0x0'));var util=require(_0x43b8('0x1'));var moment=require(_0x43b8('0x2'));var BPromise=require('bluebird');var rs=require(_0x43b8('0x3'));var fs=require('fs');var Redis=require(_0x43b8('0x4'));var db=require(_0x43b8('0x5'))['db'];var utils=require(_0x43b8('0x6'));var logger=require(_0x43b8('0x7'))(_0x43b8('0x8'));var config=require(_0x43b8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x43b8('0xa')][_0x43b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3954fd,_0xe1164d,_0x3409db){return new BPromise(function(_0x2600d3,_0xb8f41a){return client[_0x43b8('0xc')](_0x3954fd,_0x3409db)['then'](function(_0xbe779e){logger[_0x43b8('0xd')](_0x43b8('0xe'),_0xe1164d,_0x43b8('0xf'));logger['debug'](_0x43b8('0x10'),_0xe1164d,_0x43b8('0xf'),JSON[_0x43b8('0x11')](_0xbe779e));if(_0xbe779e[_0x43b8('0x12')]){if(_0xbe779e[_0x43b8('0x12')][_0x43b8('0x13')]===0x1f4){logger[_0x43b8('0x12')](_0x43b8('0xe'),_0xe1164d,_0xbe779e['error'][_0x43b8('0x14')]);return _0xb8f41a(_0xbe779e['error'][_0x43b8('0x14')]);}logger['error'](_0x43b8('0xe'),_0xe1164d,_0xbe779e[_0x43b8('0x12')][_0x43b8('0x14')]);return _0x2600d3(_0xbe779e[_0x43b8('0x12')][_0x43b8('0x14')]);}else{logger[_0x43b8('0xd')](_0x43b8('0xe'),_0xe1164d,_0x43b8('0xf'));_0x2600d3(_0xbe779e[_0x43b8('0x15')][_0x43b8('0x14')]);}})[_0x43b8('0x16')](function(_0x145102){logger[_0x43b8('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xe1164d,_0x145102);_0xb8f41a(_0x145102);});});}exports['CreateVoiceAgentReport']=function(_0x5b3658){var _0x34e5f6=this;return new Promise(function(_0xd05cc6,_0x21f803){return db[_0x43b8('0x17')][_0x43b8('0x18')](_0x5b3658[_0x43b8('0x19')],{'raw':_0x5b3658['options']?_0x5b3658[_0x43b8('0x1a')][_0x43b8('0x1b')]===undefined?!![]:![]:!![]})[_0x43b8('0x1c')](function(_0x537394){logger[_0x43b8('0xd')]('CreateVoiceAgentReport',_0x5b3658);logger[_0x43b8('0x1d')](_0x43b8('0x1e'),_0x5b3658,JSON[_0x43b8('0x11')](_0x537394));_0xd05cc6(_0x537394);})['catch'](function(_0x37e3d9){logger[_0x43b8('0x12')](_0x43b8('0x1e'),_0x37e3d9['message'],_0x5b3658);_0x21f803(_0x34e5f6[_0x43b8('0x12')](0x1f4,_0x37e3d9[_0x43b8('0x14')]));});});};exports[_0x43b8('0x1f')]=function(_0xdca9c1){var _0x531b41=this;return new Promise(function(_0x5203d2,_0x65cf71){return db[_0x43b8('0x17')][_0x43b8('0x20')](_0xdca9c1[_0x43b8('0x19')],{'raw':_0xdca9c1['options']?_0xdca9c1['options'][_0x43b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdca9c1[_0x43b8('0x1a')]?_0xdca9c1[_0x43b8('0x1a')][_0x43b8('0x21')]||null:null,'attributes':_0xdca9c1[_0x43b8('0x1a')]?_0xdca9c1[_0x43b8('0x1a')][_0x43b8('0x22')]||null:null,'limit':_0xdca9c1[_0x43b8('0x1a')]?_0xdca9c1[_0x43b8('0x1a')][_0x43b8('0x23')]||null:null})[_0x43b8('0x1c')](function(_0x3073ef){logger[_0x43b8('0xd')](_0x43b8('0x1f'),_0xdca9c1);logger['debug'](_0x43b8('0x1f'),_0xdca9c1,JSON['stringify'](_0x3073ef));_0x5203d2(_0x3073ef);})[_0x43b8('0x16')](function(_0x92c37b){logger[_0x43b8('0x12')](_0x43b8('0x1f'),_0x92c37b['message'],_0xdca9c1);_0x65cf71(_0x531b41[_0x43b8('0x12')](0x1f4,_0x92c37b[_0x43b8('0x14')]));});});}; \ No newline at end of file +var _0x61bc=['create','body','raw','UpdateVoiceAgentReport','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x127921,_0x55cab9){var _0x1b2555=function(_0x18ccad){while(--_0x18ccad){_0x127921['push'](_0x127921['shift']());}};_0x1b2555(++_0x55cab9);}(_0x61bc,0xd4));var _0xc61b=function(_0x592230,_0x2f7a31){_0x592230=_0x592230-0x0;var _0x45e73e=_0x61bc[_0x592230];return _0x45e73e;};'use strict';var _=require(_0xc61b('0x0'));var util=require(_0xc61b('0x1'));var moment=require(_0xc61b('0x2'));var BPromise=require(_0xc61b('0x3'));var rs=require(_0xc61b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc61b('0x5'))['db'];var utils=require(_0xc61b('0x6'));var logger=require(_0xc61b('0x7'))('rpc');var config=require(_0xc61b('0x8'));var jayson=require(_0xc61b('0x9'));var client=jayson['client'][_0xc61b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20ffb5,_0x4d47d5,_0x2751a3){return new BPromise(function(_0x26aa04,_0x416880){return client[_0xc61b('0xb')](_0x20ffb5,_0x2751a3)[_0xc61b('0xc')](function(_0xf9c7a7){logger[_0xc61b('0xd')](_0xc61b('0xe'),_0x4d47d5,_0xc61b('0xf'));logger[_0xc61b('0x10')](_0xc61b('0x11'),_0x4d47d5,'request\x20sent',JSON[_0xc61b('0x12')](_0xf9c7a7));if(_0xf9c7a7[_0xc61b('0x13')]){if(_0xf9c7a7[_0xc61b('0x13')][_0xc61b('0x14')]===0x1f4){logger[_0xc61b('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x4d47d5,_0xf9c7a7['error']['message']);return _0x416880(_0xf9c7a7['error'][_0xc61b('0x15')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4d47d5,_0xf9c7a7[_0xc61b('0x13')]['message']);return _0x26aa04(_0xf9c7a7[_0xc61b('0x13')]['message']);}else{logger[_0xc61b('0xd')](_0xc61b('0xe'),_0x4d47d5,'request\x20sent');_0x26aa04(_0xf9c7a7[_0xc61b('0x16')]['message']);}})[_0xc61b('0x17')](function(_0x10016b){logger[_0xc61b('0x13')](_0xc61b('0xe'),_0x4d47d5,_0x10016b);_0x416880(_0x10016b);});});}exports[_0xc61b('0x18')]=function(_0x31b0cc){var _0x339249=this;return new Promise(function(_0x82380b,_0x3a3b62){return db[_0xc61b('0x19')][_0xc61b('0x1a')](_0x31b0cc[_0xc61b('0x1b')],{'raw':_0x31b0cc['options']?_0x31b0cc['options'][_0xc61b('0x1c')]===undefined?!![]:![]:!![]})[_0xc61b('0xc')](function(_0x59c953){logger['info'](_0xc61b('0x18'),_0x31b0cc);logger[_0xc61b('0x10')]('CreateVoiceAgentReport',_0x31b0cc,JSON[_0xc61b('0x12')](_0x59c953));_0x82380b(_0x59c953);})[_0xc61b('0x17')](function(_0x217b1e){logger[_0xc61b('0x13')](_0xc61b('0x18'),_0x217b1e[_0xc61b('0x15')],_0x31b0cc);_0x3a3b62(_0x339249['error'](0x1f4,_0x217b1e['message']));});});};exports[_0xc61b('0x1d')]=function(_0x2773ef){var _0x9bcfd4=this;return new Promise(function(_0x36c85a,_0x56dbca){return db[_0xc61b('0x19')][_0xc61b('0x1e')](_0x2773ef[_0xc61b('0x1b')],{'raw':_0x2773ef[_0xc61b('0x1f')]?_0x2773ef[_0xc61b('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2773ef[_0xc61b('0x1f')]?_0x2773ef[_0xc61b('0x1f')][_0xc61b('0x20')]||null:null,'attributes':_0x2773ef['options']?_0x2773ef[_0xc61b('0x1f')][_0xc61b('0x21')]||null:null,'limit':_0x2773ef[_0xc61b('0x1f')]?_0x2773ef[_0xc61b('0x1f')]['limit']||null:null})[_0xc61b('0xc')](function(_0x19fa48){logger[_0xc61b('0xd')]('UpdateVoiceAgentReport',_0x2773ef);logger['debug'](_0xc61b('0x1d'),_0x2773ef,JSON[_0xc61b('0x12')](_0x19fa48));_0x36c85a(_0x19fa48);})[_0xc61b('0x17')](function(_0x5dbd07){logger['error'](_0xc61b('0x1d'),_0x5dbd07[_0xc61b('0x15')],_0x2773ef);_0x56dbca(_0x9bcfd4[_0xc61b('0x13')](0x1f4,_0x5dbd07[_0xc61b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 6c8a383..41a71b5 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 _0xcca7=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x19115e,_0x507bab){var _0x45bbd4=function(_0x1308bf){while(--_0x1308bf){_0x19115e['push'](_0x19115e['shift']());}};_0x45bbd4(++_0x507bab);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1a1ebc,_0x142e7e){_0x1a1ebc=_0x1a1ebc-0x0;var _0x1932fc=_0xcca7[_0x1a1ebc];return _0x1932fc;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require(_0x7cca('0x2'));var timeout=require(_0x7cca('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require(_0x7cca('0x7'));router[_0x7cca('0x8')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xa')]);router['get']('/describe',auth[_0x7cca('0x9')](),controller[_0x7cca('0xb')]);router[_0x7cca('0x8')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x9')](),controller[_0x7cca('0xf')]);router[_0x7cca('0x10')]('/:id',auth[_0x7cca('0x9')](),controller[_0x7cca('0x11')]);router[_0x7cca('0x12')](_0x7cca('0xc'),auth[_0x7cca('0x9')](),controller['destroy']);module[_0x7cca('0x13')]=router; \ No newline at end of file +var _0xd67b=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy'];(function(_0x4c9236,_0x5cecc3){var _0x3c3f6f=function(_0x1da20f){while(--_0x1da20f){_0x4c9236['push'](_0x4c9236['shift']());}};_0x3c3f6f(++_0x5cecc3);}(_0xd67b,0x133));var _0xbd67=function(_0x459f80,_0x930c2b){_0x459f80=_0x459f80-0x0;var _0x3b20e4=_0xd67b[_0x459f80];return _0x3b20e4;};'use strict';var multer=require('multer');var util=require(_0xbd67('0x0'));var path=require('path');var timeout=require(_0xbd67('0x1'));var express=require(_0xbd67('0x2'));var router=express[_0xbd67('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd67('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbd67('0x5'));var controller=require('./voiceCallReport.controller');router[_0xbd67('0x6')]('/',auth[_0xbd67('0x7')](),controller[_0xbd67('0x8')]);router[_0xbd67('0x6')](_0xbd67('0x9'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xa')]);router[_0xbd67('0x6')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0xc')]);router[_0xbd67('0xd')]('/',auth[_0xbd67('0x7')](),controller['create']);router['put'](_0xbd67('0xb'),auth['isAuthenticated'](),controller[_0xbd67('0xe')]);router[_0xbd67('0xf')](_0xbd67('0xb'),auth[_0xbd67('0x7')](),controller[_0xbd67('0x10')]);module[_0xbd67('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e856e31..04ef49a 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 _0x110f=['outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','internal','inbound-fax'];(function(_0x1840a4,_0x2edd45){var _0x26b335=function(_0x13bb78){while(--_0x13bb78){_0x1840a4['push'](_0x1840a4['shift']());}};_0x26b335(++_0x2edd45);}(_0x110f,0x1e6));var _0xf110=function(_0x298c31,_0xec37e2){_0x298c31=_0x298c31-0x0;var _0x524d0d=_0x110f[_0x298c31];return _0x524d0d;};'use strict';var Sequelize=require(_0xf110('0x0'));module[_0xf110('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound',_0xf110('0x2'),'outbound',_0xf110('0x3'),_0xf110('0x4'),_0xf110('0x5'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf110('0x6')]},'source':{'type':Sequelize[_0xf110('0x6')]},'destination':{'type':Sequelize[_0xf110('0x6')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf110('0x6')]},'channel':{'type':Sequelize[_0xf110('0x6')]},'destinationchannel':{'type':Sequelize[_0xf110('0x6')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xf110('0x7')]},'starttime':{'type':Sequelize[_0xf110('0x8')]},'systemanswertime':{'type':Sequelize[_0xf110('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf110('0x8')]},'duration':{'type':Sequelize[_0xf110('0x9')]},'billableseconds':{'type':Sequelize[_0xf110('0x9')]},'mohtime':{'type':Sequelize[_0xf110('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf110('0x6')]},'userfield':{'type':Sequelize[_0xf110('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xf110('0x6')]},'userThirdDisposition':{'type':Sequelize[_0xf110('0x6')]},'note':{'type':Sequelize[_0xf110('0x6')]},'prefix':{'type':Sequelize[_0xf110('0x6')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xf110('0x6')]}}; \ No newline at end of file +var _0xb114=['internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','sequelize','STRING','ENUM'];(function(_0x3dea7d,_0x2cd4ea){var _0x53919a=function(_0x1554e2){while(--_0x1554e2){_0x3dea7d['push'](_0x3dea7d['shift']());}};_0x53919a(++_0x2cd4ea);}(_0xb114,0x11f));var _0x4b11=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb114[_0x556bb1];return _0x45455f;};'use strict';var Sequelize=require(_0x4b11('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4b11('0x1')]},'type':{'type':Sequelize[_0x4b11('0x2')]('inbound',_0x4b11('0x3'),_0x4b11('0x4'),_0x4b11('0x5'),_0x4b11('0x6'),_0x4b11('0x7'))},'tag':{'type':Sequelize[_0x4b11('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x4b11('0x1')]},'destination':{'type':Sequelize[_0x4b11('0x1')]},'destinationcontext':{'type':Sequelize[_0x4b11('0x1')]},'callerid':{'type':Sequelize[_0x4b11('0x1')]},'channel':{'type':Sequelize[_0x4b11('0x1')]},'destinationchannel':{'type':Sequelize[_0x4b11('0x1')]},'lastapplication':{'type':Sequelize[_0x4b11('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x4b11('0x8')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x4b11('0x8')]},'endtime':{'type':Sequelize[_0x4b11('0x8')]},'duration':{'type':Sequelize[_0x4b11('0x9')]},'billableseconds':{'type':Sequelize[_0x4b11('0x9')]},'mohtime':{'type':Sequelize[_0x4b11('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4b11('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x4b11('0x1')]},'userDisposition':{'type':Sequelize[_0x4b11('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x4b11('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x4b11('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x4b11('0x9')]},'sipcallid':{'type':Sequelize[_0x4b11('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b745783..57ca1df 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2a436d,_0x512231){_0x2a436d=_0x2a436d-0x0;var _0xd5ceda=_0x5f2f[_0x2a436d];return _0xd5ceda;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _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(_0x9ed1e2,_0x28db08){var _0x469145=function(_0x3a6e3b){while(--_0x3a6e3b){_0x9ed1e2['push'](_0x9ed1e2['shift']());}};_0x469145(++_0x28db08);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0x0b0e[_0x5ecff9];return _0x5e1415;};'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 616e5b8..4e16baa 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 _0x6c24=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x3cdcd4,_0x97f05e){var _0x238dcd=function(_0x2e3795){while(--_0x2e3795){_0x3cdcd4['push'](_0x3cdcd4['shift']());}};_0x238dcd(++_0x97f05e);}(_0x6c24,0x1cb));var _0x46c2=function(_0x1a86c9,_0x5b7341){_0x1a86c9=_0x1a86c9-0x0;var _0x2a0324=_0x6c24[_0x1a86c9];return _0x2a0324;};'use strict';var _=require(_0x46c2('0x0'));var util=require(_0x46c2('0x1'));var logger=require(_0x46c2('0x2'))(_0x46c2('0x3'));var moment=require(_0x46c2('0x4'));var BPromise=require(_0x46c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46c2('0x6'));var rimraf=require(_0x46c2('0x7'));var config=require(_0x46c2('0x8'));var attributes=require('./voiceCallReport.attributes');module[_0x46c2('0x9')]=function(_0x14fd76,_0x2fb27c){return _0x14fd76[_0x46c2('0xa')](_0x46c2('0xb'),attributes,{'tableName':_0x46c2('0xc'),'paranoid':![],'indexes':[{'fields':[_0x46c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b6d=['request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x57c9c7,_0xb70a91){var _0x48ad8b=function(_0x51af55){while(--_0x51af55){_0x57c9c7['push'](_0x57c9c7['shift']());}};_0x48ad8b(++_0xb70a91);}(_0x2b6d,0xe8));var _0xd2b6=function(_0x365947,_0x39d24e){_0x365947=_0x365947-0x0;var _0x102722=_0x2b6d[_0x365947];return _0x102722;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var logger=require(_0xd2b6('0x2'))(_0xd2b6('0x3'));var moment=require(_0xd2b6('0x4'));var BPromise=require(_0xd2b6('0x5'));var rp=require(_0xd2b6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2b6('0x7'));var config=require(_0xd2b6('0x8'));var attributes=require(_0xd2b6('0x9'));module[_0xd2b6('0xa')]=function(_0x2475ba,_0x938ad0){return _0x2475ba[_0xd2b6('0xb')]('VoiceCallReport',attributes,{'tableName':_0xd2b6('0xc'),'paranoid':![],'indexes':[{'fields':[_0xd2b6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 9e8ff90..9e769c4 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 _0xfaba=['info','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include','attributes','model','map','then','debug','CreateVoiceCallReport','UpdateVoiceCallReport','body','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0xfaba,0x1b2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xafab('0x0'));var util=require(_0xafab('0x1'));var moment=require('moment');var BPromise=require(_0xafab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafab('0x3'))['db'];var utils=require(_0xafab('0x4'));var logger=require(_0xafab('0x5'))('rpc');var config=require(_0xafab('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xafab('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x225f22,_0x59bf2a,_0x41e93a){return new BPromise(function(_0x37237f,_0x13290c){return client['request'](_0x225f22,_0x41e93a)['then'](function(_0xb816af){logger[_0xafab('0x8')]('VoiceCallReport,\x20%s,\x20%s',_0x59bf2a,_0xafab('0x9'));logger['debug'](_0xafab('0xa'),_0x59bf2a,_0xafab('0x9'),JSON[_0xafab('0xb')](_0xb816af));if(_0xb816af['error']){if(_0xb816af[_0xafab('0xc')][_0xafab('0xd')]===0x1f4){logger[_0xafab('0xc')](_0xafab('0xe'),_0x59bf2a,_0xb816af[_0xafab('0xc')][_0xafab('0xf')]);return _0x13290c(_0xb816af[_0xafab('0xc')][_0xafab('0xf')]);}logger[_0xafab('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x59bf2a,_0xb816af[_0xafab('0xc')]['message']);return _0x37237f(_0xb816af['error'][_0xafab('0xf')]);}else{logger[_0xafab('0x8')](_0xafab('0xe'),_0x59bf2a,_0xafab('0x9'));_0x37237f(_0xb816af[_0xafab('0x10')]['message']);}})[_0xafab('0x11')](function(_0x2f3483){logger[_0xafab('0xc')](_0xafab('0xe'),_0x59bf2a,_0x2f3483);_0x13290c(_0x2f3483);});});}exports[_0xafab('0x12')]=function(_0x550fb7){var _0x5bf27c=this;return new Promise(function(_0x271686,_0xc6068e){return db[_0xafab('0x13')][_0xafab('0x14')]({'raw':_0x550fb7[_0xafab('0x15')]?_0x550fb7[_0xafab('0x15')][_0xafab('0x16')]===undefined?!![]:![]:!![],'where':_0x550fb7['options']?_0x550fb7['options'][_0xafab('0x17')]||null:null,'attributes':_0x550fb7['options']?_0x550fb7['options']['attributes']||null:null,'limit':_0x550fb7[_0xafab('0x15')]?_0x550fb7[_0xafab('0x15')][_0xafab('0x18')]||null:null,'include':_0x550fb7[_0xafab('0x15')]?_0x550fb7[_0xafab('0x15')][_0xafab('0x19')]?_['map'](_0x550fb7[_0xafab('0x15')][_0xafab('0x19')],function(_0x2a8c11){return{'model':db[_0x2a8c11['model']],'as':_0x2a8c11['as'],'attributes':_0x2a8c11[_0xafab('0x1a')],'include':_0x2a8c11[_0xafab('0x19')]?_['map'](_0x2a8c11['include'],function(_0x1cf7ee){return{'model':db[_0x1cf7ee[_0xafab('0x1b')]],'as':_0x1cf7ee['as'],'attributes':_0x1cf7ee['attributes'],'include':_0x1cf7ee['include']?_[_0xafab('0x1c')](_0x1cf7ee[_0xafab('0x19')],function(_0x2ad889){return{'model':db[_0x2ad889[_0xafab('0x1b')]],'as':_0x2ad889['as'],'attributes':_0x2ad889['attributes']};}):[]};}):[]};}):[]:[]})[_0xafab('0x1d')](function(_0x187695){logger[_0xafab('0x8')](_0xafab('0x12'),_0x550fb7);logger[_0xafab('0x1e')]('GetVoiceCallReport',_0x550fb7,JSON['stringify'](_0x187695));_0x271686(_0x187695);})[_0xafab('0x11')](function(_0x5ddab3){logger['error'](_0xafab('0x12'),_0x5ddab3['message'],_0x550fb7);_0xc6068e(_0x5bf27c[_0xafab('0xc')](0x1f4,_0x5ddab3[_0xafab('0xf')]));});});};exports[_0xafab('0x1f')]=function(_0x365fd6){var _0x33dab8=this;return new Promise(function(_0x244e0f,_0x4cba88){return db[_0xafab('0x13')]['create'](_0x365fd6['body'],{'raw':_0x365fd6[_0xafab('0x15')]?_0x365fd6[_0xafab('0x15')][_0xafab('0x16')]===undefined?!![]:![]:!![]})[_0xafab('0x1d')](function(_0x986cfc){logger['info']('CreateVoiceCallReport',_0x365fd6);logger[_0xafab('0x1e')](_0xafab('0x1f'),_0x365fd6,JSON[_0xafab('0xb')](_0x986cfc));_0x244e0f(_0x986cfc);})[_0xafab('0x11')](function(_0x262d7f){logger[_0xafab('0xc')](_0xafab('0x1f'),_0x262d7f[_0xafab('0xf')],_0x365fd6);_0x4cba88(_0x33dab8['error'](0x1f4,_0x262d7f[_0xafab('0xf')]));});});};exports[_0xafab('0x20')]=function(_0x251a2f){var _0x43fe1c=this;return new Promise(function(_0x5d0235,_0xd55529){return db[_0xafab('0x13')]['update'](_0x251a2f[_0xafab('0x21')],{'raw':_0x251a2f[_0xafab('0x15')]?_0x251a2f[_0xafab('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251a2f[_0xafab('0x15')]?_0x251a2f[_0xafab('0x15')][_0xafab('0x17')]||null:null,'attributes':_0x251a2f['options']?_0x251a2f['options'][_0xafab('0x1a')]||null:null,'limit':_0x251a2f[_0xafab('0x15')]?_0x251a2f['options'][_0xafab('0x18')]||null:null})[_0xafab('0x1d')](function(_0x203a67){logger[_0xafab('0x8')](_0xafab('0x20'),_0x251a2f);logger[_0xafab('0x1e')]('UpdateVoiceCallReport',_0x251a2f,JSON[_0xafab('0xb')](_0x203a67));_0x5d0235(_0x203a67);})[_0xafab('0x11')](function(_0xe064a6){logger[_0xafab('0xc')]('UpdateVoiceCallReport',_0xe064a6[_0xafab('0xf')],_0x251a2f);_0xd55529(_0x43fe1c[_0xafab('0xc')](0x1f4,_0xe064a6[_0xafab('0xf')]));});});}; \ No newline at end of file +var _0xdd60=['catch','GetVoiceCallReport','findAll','options','raw','where','limit','map','include','attributes','model','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceCallReport,\x20%s,\x20%s'];(function(_0x4c0146,_0x18032a){var _0x5a3b78=function(_0x235498){while(--_0x235498){_0x4c0146['push'](_0x4c0146['shift']());}};_0x5a3b78(++_0x18032a);}(_0xdd60,0x15d));var _0x0dd6=function(_0x4ec272,_0x2a42f7){_0x4ec272=_0x4ec272-0x0;var _0x44a7d9=_0xdd60[_0x4ec272];return _0x44a7d9;};'use strict';var _=require('lodash');var util=require(_0x0dd6('0x0'));var moment=require(_0x0dd6('0x1'));var BPromise=require(_0x0dd6('0x2'));var rs=require(_0x0dd6('0x3'));var fs=require('fs');var Redis=require(_0x0dd6('0x4'));var db=require(_0x0dd6('0x5'))['db'];var utils=require(_0x0dd6('0x6'));var logger=require(_0x0dd6('0x7'))('rpc');var config=require(_0x0dd6('0x8'));var jayson=require(_0x0dd6('0x9'));var client=jayson['client'][_0x0dd6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d199,_0x2c234b,_0x1c2588){return new BPromise(function(_0x4b911a,_0xfb49da){return client[_0x0dd6('0xb')](_0x36d199,_0x1c2588)[_0x0dd6('0xc')](function(_0x30513a){logger[_0x0dd6('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x2c234b,_0x0dd6('0xe'));logger[_0x0dd6('0xf')](_0x0dd6('0x10'),_0x2c234b,_0x0dd6('0xe'),JSON[_0x0dd6('0x11')](_0x30513a));if(_0x30513a[_0x0dd6('0x12')]){if(_0x30513a['error']['code']===0x1f4){logger[_0x0dd6('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2c234b,_0x30513a[_0x0dd6('0x12')][_0x0dd6('0x13')]);return _0xfb49da(_0x30513a[_0x0dd6('0x12')]['message']);}logger[_0x0dd6('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2c234b,_0x30513a['error']['message']);return _0x4b911a(_0x30513a[_0x0dd6('0x12')][_0x0dd6('0x13')]);}else{logger['info'](_0x0dd6('0x14'),_0x2c234b,_0x0dd6('0xe'));_0x4b911a(_0x30513a['result'][_0x0dd6('0x13')]);}})[_0x0dd6('0x15')](function(_0x56d7cf){logger[_0x0dd6('0x12')](_0x0dd6('0x14'),_0x2c234b,_0x56d7cf);_0xfb49da(_0x56d7cf);});});}exports[_0x0dd6('0x16')]=function(_0x703894){var _0x127258=this;return new Promise(function(_0x2ce97d,_0x447f61){return db['VoiceCallReport'][_0x0dd6('0x17')]({'raw':_0x703894[_0x0dd6('0x18')]?_0x703894['options'][_0x0dd6('0x19')]===undefined?!![]:![]:!![],'where':_0x703894['options']?_0x703894[_0x0dd6('0x18')][_0x0dd6('0x1a')]||null:null,'attributes':_0x703894['options']?_0x703894['options']['attributes']||null:null,'limit':_0x703894[_0x0dd6('0x18')]?_0x703894[_0x0dd6('0x18')][_0x0dd6('0x1b')]||null:null,'include':_0x703894[_0x0dd6('0x18')]?_0x703894[_0x0dd6('0x18')]['include']?_[_0x0dd6('0x1c')](_0x703894[_0x0dd6('0x18')][_0x0dd6('0x1d')],function(_0x27eba1){return{'model':db[_0x27eba1['model']],'as':_0x27eba1['as'],'attributes':_0x27eba1[_0x0dd6('0x1e')],'include':_0x27eba1[_0x0dd6('0x1d')]?_['map'](_0x27eba1[_0x0dd6('0x1d')],function(_0x53df92){return{'model':db[_0x53df92[_0x0dd6('0x1f')]],'as':_0x53df92['as'],'attributes':_0x53df92[_0x0dd6('0x1e')],'include':_0x53df92[_0x0dd6('0x1d')]?_['map'](_0x53df92[_0x0dd6('0x1d')],function(_0x456a48){return{'model':db[_0x456a48[_0x0dd6('0x1f')]],'as':_0x456a48['as'],'attributes':_0x456a48[_0x0dd6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0dd6('0xc')](function(_0x52d95e){logger[_0x0dd6('0xd')](_0x0dd6('0x16'),_0x703894);logger[_0x0dd6('0xf')]('GetVoiceCallReport',_0x703894,JSON[_0x0dd6('0x11')](_0x52d95e));_0x2ce97d(_0x52d95e);})['catch'](function(_0x26eb2f){logger['error'](_0x0dd6('0x16'),_0x26eb2f[_0x0dd6('0x13')],_0x703894);_0x447f61(_0x127258[_0x0dd6('0x12')](0x1f4,_0x26eb2f[_0x0dd6('0x13')]));});});};exports[_0x0dd6('0x20')]=function(_0x5f372a){var _0x21cfae=this;return new Promise(function(_0x4b589d,_0x35e310){return db[_0x0dd6('0x21')][_0x0dd6('0x22')](_0x5f372a[_0x0dd6('0x23')],{'raw':_0x5f372a[_0x0dd6('0x18')]?_0x5f372a[_0x0dd6('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x540417){logger[_0x0dd6('0xd')](_0x0dd6('0x20'),_0x5f372a);logger[_0x0dd6('0xf')](_0x0dd6('0x20'),_0x5f372a,JSON[_0x0dd6('0x11')](_0x540417));_0x4b589d(_0x540417);})['catch'](function(_0x2d51ba){logger[_0x0dd6('0x12')](_0x0dd6('0x20'),_0x2d51ba['message'],_0x5f372a);_0x35e310(_0x21cfae[_0x0dd6('0x12')](0x1f4,_0x2d51ba[_0x0dd6('0x13')]));});});};exports[_0x0dd6('0x24')]=function(_0x36447b){var _0x2782b6=this;return new Promise(function(_0x2780dc,_0x344f78){return db[_0x0dd6('0x21')]['update'](_0x36447b[_0x0dd6('0x23')],{'raw':_0x36447b[_0x0dd6('0x18')]?_0x36447b[_0x0dd6('0x18')][_0x0dd6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36447b[_0x0dd6('0x18')]?_0x36447b[_0x0dd6('0x18')][_0x0dd6('0x1a')]||null:null,'attributes':_0x36447b[_0x0dd6('0x18')]?_0x36447b[_0x0dd6('0x18')]['attributes']||null:null,'limit':_0x36447b[_0x0dd6('0x18')]?_0x36447b[_0x0dd6('0x18')]['limit']||null:null})[_0x0dd6('0xc')](function(_0xaad977){logger['info']('UpdateVoiceCallReport',_0x36447b);logger[_0x0dd6('0xf')](_0x0dd6('0x24'),_0x36447b,JSON[_0x0dd6('0x11')](_0xaad977));_0x2780dc(_0xaad977);})[_0x0dd6('0x15')](function(_0x13e5e1){logger[_0x0dd6('0x12')](_0x0dd6('0x24'),_0x13e5e1['message'],_0x36447b);_0x344f78(_0x2782b6[_0x0dd6('0x12')](0x1f4,_0x13e5e1[_0x0dd6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3371e71..6c53837 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 _0x4861=['fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x858c06,_0x34df72){var _0x4b648d=function(_0x1f7b30){while(--_0x1f7b30){_0x858c06['push'](_0x858c06['shift']());}};_0x4b648d(++_0x34df72);}(_0x4861,0x186));var _0x1486=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4861[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1486('0x0'));var util=require(_0x1486('0x1'));var path=require(_0x1486('0x2'));var timeout=require(_0x1486('0x3'));var express=require(_0x1486('0x4'));var router=express[_0x1486('0x5')]();var fs_extra=require(_0x1486('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1486('0x7'));var config=require(_0x1486('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x1486('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1486('0xa'),auth[_0x1486('0xb')](),controller[_0x1486('0xc')]);router[_0x1486('0xd')]('/',auth[_0x1486('0xb')](),controller['create']);router[_0x1486('0xe')](_0x1486('0xa'),auth[_0x1486('0xb')](),controller[_0x1486('0xf')]);router[_0x1486('0x10')]('/:id',auth[_0x1486('0xb')](),controller['destroy']);module[_0x1486('0x11')]=router; \ No newline at end of file +var _0xc13a=['Router','../../components/interaction/service','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','util','path','connect-timeout'];(function(_0x25e95b,_0x7830aa){var _0x142b49=function(_0x4b3fbc){while(--_0x4b3fbc){_0x25e95b['push'](_0x25e95b['shift']());}};_0x142b49(++_0x7830aa);}(_0xc13a,0xb8));var _0xac13=function(_0x1efd72,_0x4100fc){_0x1efd72=_0x1efd72-0x0;var _0xd030a6=_0xc13a[_0x1efd72];return _0xd030a6;};'use strict';var multer=require('multer');var util=require(_0xac13('0x0'));var path=require(_0xac13('0x1'));var timeout=require(_0xac13('0x2'));var express=require('express');var router=express[_0xac13('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac13('0x4'));var config=require('../../config/environment');var controller=require(_0xac13('0x5'));router[_0xac13('0x6')]('/',auth[_0xac13('0x7')](),controller[_0xac13('0x8')]);router['get'](_0xac13('0x9'),auth['isAuthenticated'](),controller[_0xac13('0xa')]);router[_0xac13('0xb')]('/',auth[_0xac13('0x7')](),controller[_0xac13('0xc')]);router[_0xac13('0xd')](_0xac13('0x9'),auth[_0xac13('0x7')](),controller[_0xac13('0xe')]);router[_0xac13('0xf')](_0xac13('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xac13('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 03300a4..7b6372c 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 _0x777c=['STRING','name','setDataValue','join','getDataValue','options','split','BOOLEAN','sequelize','exports'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x777c,0x18e));var _0xc777=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x777c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc777('0x0'));module[_0xc777('0x1')]={'name':{'type':Sequelize[_0xc777('0x2')]},'prefix':{'type':Sequelize[_0xc777('0x2')],'unique':_0xc777('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc777('0x2')],'set':function(_0x3f02cd){this[_0xc777('0x4')]('options',_0x3f02cd?_0x3f02cd[_0xc777('0x5')](''):[]);},'get':function(){return this[_0xc777('0x6')](_0xc777('0x7'))?this[_0xc777('0x6')](_0xc777('0x7'))[_0xc777('0x8')](''):[];}},'auth':{'type':Sequelize[_0xc777('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0xc777('0x2')]},'record':{'type':Sequelize[_0xc777('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc777('0x2')]},'description':{'type':Sequelize[_0xc777('0x2')]}}; \ No newline at end of file +var _0x1469=['exports','STRING','setDataValue','options','join','split','BOOLEAN','sequelize'];(function(_0xdaccb0,_0x1ac368){var _0x86b3f3=function(_0x55235b){while(--_0x55235b){_0xdaccb0['push'](_0xdaccb0['shift']());}};_0x86b3f3(++_0x1ac368);}(_0x1469,0xef));var _0x9146=function(_0x290461,_0x55ce4b){_0x290461=_0x290461-0x0;var _0x297766=_0x1469[_0x290461];return _0x297766;};'use strict';var Sequelize=require(_0x9146('0x0'));module[_0x9146('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x9146('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x9146('0x2')],'set':function(_0x2f7789){this[_0x9146('0x3')](_0x9146('0x4'),_0x2f7789?_0x2f7789[_0x9146('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x9146('0x4'))?this['getDataValue']('options')[_0x9146('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x9146('0x2')]},'record':{'type':Sequelize[_0x9146('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9146('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 1d60914..7e947be 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 _0xafe6=['merge','VIRTUAL','options','include','findAll','catch','show','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','end','error','stack','name','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3d66d4,_0x553651){var _0x6a4cfa=function(_0x1526dc){while(--_0x1526dc){_0x3d66d4['push'](_0x3d66d4['shift']());}};_0x6a4cfa(++_0x553651);}(_0xafe6,0xac));var _0x6afe=function(_0x35d26c,_0x23c521){_0x35d26c=_0x35d26c-0x0;var _0x587fde=_0xafe6[_0x35d26c];return _0x587fde;};'use strict';var emlformat=require(_0x6afe('0x0'));var rimraf=require(_0x6afe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6afe('0x2'));var moment=require(_0x6afe('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6afe('0x4'));var path=require(_0x6afe('0x5'));var sox=require(_0x6afe('0x6'));var csv=require(_0x6afe('0x7'));var ejs=require(_0x6afe('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6afe('0x9'));var squel=require(_0x6afe('0xa'));var crypto=require(_0x6afe('0xb'));var jsforce=require(_0x6afe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6afe('0x7'));var querystring=require(_0x6afe('0xd'));var Papa=require(_0x6afe('0xe'));var Redis=require(_0x6afe('0xf'));var authService=require(_0x6afe('0x10'));var qs=require(_0x6afe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6afe('0x12'))(_0x6afe('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6afe('0x14'));var db=require(_0x6afe('0x15'))['db'];function respondWithStatusCode(_0x3e75b5,_0x15ea76){_0x15ea76=_0x15ea76||0xcc;return function(_0x1abd61){if(_0x1abd61){return _0x3e75b5[_0x6afe('0x16')](_0x15ea76);}return _0x3e75b5[_0x6afe('0x17')](_0x15ea76)['end']();};}function respondWithResult(_0x31940b,_0x4061bd){_0x4061bd=_0x4061bd||0xc8;return function(_0x473fc9){if(_0x473fc9){return _0x31940b[_0x6afe('0x17')](_0x4061bd)[_0x6afe('0x18')](_0x473fc9);}};}function respondWithFilteredResult(_0x2d3e7d,_0x94ca1){return function(_0x4deb5b){if(_0x4deb5b){var _0x311b1e=typeof _0x94ca1['offset']==='undefined'&&typeof _0x94ca1[_0x6afe('0x19')]===_0x6afe('0x1a');var _0x393967=_0x4deb5b[_0x6afe('0x1b')];var _0x1bc331=_0x311b1e?0x0:_0x94ca1[_0x6afe('0x1c')];var _0x3699e8=_0x311b1e?_0x4deb5b[_0x6afe('0x1b')]:_0x94ca1['offset']+_0x94ca1['limit'];var _0x450069;if(_0x3699e8>=_0x393967){_0x3699e8=_0x393967;_0x450069=0xc8;}else{_0x450069=0xce;}_0x2d3e7d[_0x6afe('0x17')](_0x450069);return _0x2d3e7d[_0x6afe('0x1d')]('Content-Range',_0x1bc331+'-'+_0x3699e8+'/'+_0x393967)['json'](_0x4deb5b);}return null;};}function patchUpdates(_0x4227f0){return function(_0x18ee9f){try{jsonpatch[_0x6afe('0x1e')](_0x18ee9f,_0x4227f0,!![]);}catch(_0x2d1dd9){return BPromise[_0x6afe('0x1f')](_0x2d1dd9);}return _0x18ee9f[_0x6afe('0x20')]();};}function saveUpdates(_0x1f3436,_0x42e461){return function(_0x2ef577){if(_0x2ef577){return _0x2ef577[_0x6afe('0x21')](_0x1f3436)[_0x6afe('0x22')](function(_0x1af882){return _0x1af882;});}return null;};}function removeEntity(_0x397439,_0x23fc00){return function(_0x93d444){if(_0x93d444){return _0x93d444['destroy']()['then'](function(){var _0x160601=_0x93d444['get']({'plain':!![]});var _0x4b0399=_0x6afe('0x23');return db[_0x6afe('0x24')][_0x6afe('0x25')]({'where':{'type':_0x4b0399,'resourceId':_0x160601['id']}})[_0x6afe('0x22')](function(){return _0x93d444;});})[_0x6afe('0x22')](function(){_0x397439[_0x6afe('0x17')](0xcc)[_0x6afe('0x26')]();});}};}function handleEntityNotFound(_0x10fc9e,_0x338ab8){return function(_0x2c6ac3){if(!_0x2c6ac3){_0x10fc9e[_0x6afe('0x16')](0x194);}return _0x2c6ac3;};}function handleError(_0x1ef7fa,_0x1323c0){_0x1323c0=_0x1323c0||0x1f4;return function(_0x56e480){logger[_0x6afe('0x27')](_0x56e480[_0x6afe('0x28')]);if(_0x56e480[_0x6afe('0x29')]){delete _0x56e480['name'];}_0x1ef7fa[_0x6afe('0x17')](_0x1323c0)['send'](_0x56e480);};}exports[_0x6afe('0x2a')]=function(_0x395c3e,_0x48138c){var _0x5ac797={},_0x14af12={},_0x613477={'count':0x0,'rows':[]};var _0xe6f98f=_[_0x6afe('0x2b')](db[_0x6afe('0x2c')][_0x6afe('0x2d')],function(_0x2c1511){return{'name':_0x2c1511[_0x6afe('0x2e')],'type':_0x2c1511[_0x6afe('0x2f')][_0x6afe('0x30')]};});_0x14af12[_0x6afe('0x31')]=_[_0x6afe('0x2b')](_0xe6f98f,_0x6afe('0x29'));_0x14af12[_0x6afe('0x32')]=_[_0x6afe('0x33')](_0x395c3e[_0x6afe('0x32')]);_0x14af12[_0x6afe('0x34')]=_[_0x6afe('0x35')](_0x14af12[_0x6afe('0x31')],_0x14af12[_0x6afe('0x32')]);_0x5ac797[_0x6afe('0x36')]=_['intersection'](_0x14af12['model'],qs[_0x6afe('0x37')](_0x395c3e[_0x6afe('0x32')][_0x6afe('0x37')]));_0x5ac797[_0x6afe('0x36')]=_0x5ac797[_0x6afe('0x36')]['length']?_0x5ac797[_0x6afe('0x36')]:_0x14af12['model'];if(!_0x395c3e['query'][_0x6afe('0x38')](_0x6afe('0x39'))){_0x5ac797[_0x6afe('0x19')]=qs[_0x6afe('0x19')](_0x395c3e['query']['limit']);_0x5ac797[_0x6afe('0x1c')]=qs[_0x6afe('0x1c')](_0x395c3e[_0x6afe('0x32')]['offset']);}_0x5ac797[_0x6afe('0x3a')]=qs[_0x6afe('0x3b')](_0x395c3e[_0x6afe('0x32')][_0x6afe('0x3b')]);_0x5ac797[_0x6afe('0x3c')]=qs[_0x6afe('0x34')](_[_0x6afe('0x3d')](_0x395c3e['query'],_0x14af12[_0x6afe('0x34')]),_0xe6f98f);if(_0x395c3e[_0x6afe('0x32')]['filter']){_0x5ac797['where']=_[_0x6afe('0x3e')](_0x5ac797['where'],{'$or':_[_0x6afe('0x2b')](_0xe6f98f,function(_0x152367){if(_0x152367[_0x6afe('0x2f')]!==_0x6afe('0x3f')){var _0x25de47={};_0x25de47[_0x152367[_0x6afe('0x29')]]={'$like':'%'+_0x395c3e[_0x6afe('0x32')]['filter']+'%'};return _0x25de47;}})});}_0x5ac797=_['merge']({},_0x5ac797,_0x395c3e[_0x6afe('0x40')]);var _0x7bbec2={'where':_0x5ac797[_0x6afe('0x3c')]};return db['VoiceChanSpy']['count'](_0x7bbec2)[_0x6afe('0x22')](function(_0x59d18c){_0x613477[_0x6afe('0x1b')]=_0x59d18c;if(_0x395c3e['query']['includeAll']){_0x5ac797[_0x6afe('0x41')]=[{'all':!![]}];}return db[_0x6afe('0x2c')][_0x6afe('0x42')](_0x5ac797);})['then'](function(_0x1b4a28){_0x613477['rows']=_0x1b4a28;return _0x613477;})['then'](respondWithFilteredResult(_0x48138c,_0x5ac797))[_0x6afe('0x43')](handleError(_0x48138c,null));};exports[_0x6afe('0x44')]=function(_0x2e21c2,_0x18bba4){var _0x185b96={'raw':![],'where':{'id':_0x2e21c2['params']['id']}},_0x544282={};_0x544282[_0x6afe('0x31')]=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x544282[_0x6afe('0x32')]=_[_0x6afe('0x33')](_0x2e21c2[_0x6afe('0x32')]);_0x544282[_0x6afe('0x34')]=_['intersection'](_0x544282[_0x6afe('0x31')],_0x544282[_0x6afe('0x32')]);_0x185b96[_0x6afe('0x36')]=_[_0x6afe('0x35')](_0x544282[_0x6afe('0x31')],qs[_0x6afe('0x37')](_0x2e21c2[_0x6afe('0x32')][_0x6afe('0x37')]));_0x185b96[_0x6afe('0x36')]=_0x185b96['attributes']['length']?_0x185b96[_0x6afe('0x36')]:_0x544282[_0x6afe('0x31')];if(_0x2e21c2[_0x6afe('0x32')]['includeAll']){_0x185b96['include']=[{'all':!![]}];}_0x185b96=_['merge']({},_0x185b96,_0x2e21c2[_0x6afe('0x40')]);return db['VoiceChanSpy'][_0x6afe('0x45')](_0x185b96)[_0x6afe('0x22')](handleEntityNotFound(_0x18bba4,null))['then'](respondWithResult(_0x18bba4,null))[_0x6afe('0x43')](handleError(_0x18bba4,null));};exports[_0x6afe('0x46')]=function(_0x2ba25a,_0x4ed252){return db['VoiceChanSpy'][_0x6afe('0x46')](_0x2ba25a['body'],{})[_0x6afe('0x22')](function(_0x4ada00){var _0x4576e8=_0x2ba25a[_0x6afe('0x47')][_0x6afe('0x48')]({'plain':!![]});if(!_0x4576e8)throw new Error(_0x6afe('0x49'));if(_0x4576e8[_0x6afe('0x4a')]===_0x6afe('0x47')){var _0x54c1e3=_0x4ada00[_0x6afe('0x48')]({'plain':!![]});var _0x912c80=_0x6afe('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x912c80,'userProfileId':_0x4576e8['userProfileId']},'raw':!![]})[_0x6afe('0x22')](function(_0x2b03df){if(_0x2b03df&&_0x2b03df['autoAssociation']===0x0){return db[_0x6afe('0x24')][_0x6afe('0x46')]({'name':_0x54c1e3['name'],'resourceId':_0x54c1e3['id'],'type':_0x2b03df['name'],'sectionId':_0x2b03df['id']},{})[_0x6afe('0x22')](function(){return _0x4ada00;});}else{return _0x4ada00;}})[_0x6afe('0x43')](function(_0x1b2cf7){logger['error'](_0x6afe('0x4b'),_0x1b2cf7);throw _0x1b2cf7;});}return _0x4ada00;})[_0x6afe('0x22')](respondWithResult(_0x4ed252,0xc9))[_0x6afe('0x43')](handleError(_0x4ed252,null));};exports['update']=function(_0xe0f161,_0x2b59ec){if(_0xe0f161[_0x6afe('0x4c')]['id']){delete _0xe0f161[_0x6afe('0x4c')]['id'];}return db[_0x6afe('0x2c')][_0x6afe('0x45')]({'where':{'id':_0xe0f161[_0x6afe('0x4d')]['id']}})[_0x6afe('0x22')](handleEntityNotFound(_0x2b59ec,null))[_0x6afe('0x22')](saveUpdates(_0xe0f161[_0x6afe('0x4c')],null))['then'](respondWithResult(_0x2b59ec,null))['catch'](handleError(_0x2b59ec,null));};exports['destroy']=function(_0x5a8ef4,_0x2841e6){return db[_0x6afe('0x2c')][_0x6afe('0x45')]({'where':{'id':_0x5a8ef4[_0x6afe('0x4d')]['id']}})[_0x6afe('0x22')](handleEntityNotFound(_0x2841e6,null))[_0x6afe('0x22')](removeEntity(_0x2841e6,null))[_0x6afe('0x43')](handleError(_0x2841e6,null));}; \ No newline at end of file +var _0xe28e=['stack','name','send','index','map','VoiceChanSpy','fieldName','key','model','query','keys','attributes','intersection','fields','limit','order','sort','where','filters','pick','VIRTUAL','merge','include','catch','show','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error'];(function(_0x393f62,_0x4dfe05){var _0xdd72e0=function(_0x4d4922){while(--_0x4d4922){_0x393f62['push'](_0x393f62['shift']());}};_0xdd72e0(++_0x4dfe05);}(_0xe28e,0x1ba));var _0xee28=function(_0x540ac4,_0x27fb55){_0x540ac4=_0x540ac4-0x0;var _0x261ad1=_0xe28e[_0x540ac4];return _0x261ad1;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){var _0x3acfc9=_0x1519ae[_0xee28('0x28')]({'plain':!![]});var _0x95d917=_0xee28('0x29');return db[_0xee28('0x2a')][_0xee28('0x26')]({'where':{'type':_0x95d917,'resourceId':_0x3acfc9['id']}})['then'](function(){return _0x1519ae;});})[_0xee28('0x27')](function(){_0x17d8e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54528b,_0x587aac){return function(_0x51eae7){if(!_0x51eae7){_0x54528b[_0xee28('0x1a')](0x194);}return _0x51eae7;};}function handleError(_0x884e7d,_0x3b64ad){_0x3b64ad=_0x3b64ad||0x1f4;return function(_0x469889){logger[_0xee28('0x2b')](_0x469889[_0xee28('0x2c')]);if(_0x469889[_0xee28('0x2d')]){delete _0x469889['name'];}_0x884e7d[_0xee28('0x1c')](_0x3b64ad)[_0xee28('0x2e')](_0x469889);};}exports[_0xee28('0x2f')]=function(_0x49644a,_0x14f7c4){var _0x2890ad={},_0x213e45={},_0xf0b169={'count':0x0,'rows':[]};var _0x1421bc=_[_0xee28('0x30')](db[_0xee28('0x31')]['rawAttributes'],function(_0x15f294){return{'name':_0x15f294[_0xee28('0x32')],'type':_0x15f294['type'][_0xee28('0x33')]};});_0x213e45[_0xee28('0x34')]=_[_0xee28('0x30')](_0x1421bc,_0xee28('0x2d'));_0x213e45[_0xee28('0x35')]=_[_0xee28('0x36')](_0x49644a[_0xee28('0x35')]);_0x213e45['filters']=_['intersection'](_0x213e45['model'],_0x213e45[_0xee28('0x35')]);_0x2890ad[_0xee28('0x37')]=_[_0xee28('0x38')](_0x213e45[_0xee28('0x34')],qs[_0xee28('0x39')](_0x49644a[_0xee28('0x35')]['fields']));_0x2890ad[_0xee28('0x37')]=_0x2890ad[_0xee28('0x37')]['length']?_0x2890ad['attributes']:_0x213e45[_0xee28('0x34')];if(!_0x49644a[_0xee28('0x35')]['hasOwnProperty']('nolimit')){_0x2890ad[_0xee28('0x3a')]=qs[_0xee28('0x3a')](_0x49644a['query'][_0xee28('0x3a')]);_0x2890ad[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x49644a[_0xee28('0x35')][_0xee28('0x1d')]);}_0x2890ad[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_0x49644a[_0xee28('0x35')][_0xee28('0x3c')]);_0x2890ad[_0xee28('0x3d')]=qs[_0xee28('0x3e')](_[_0xee28('0x3f')](_0x49644a['query'],_0x213e45[_0xee28('0x3e')]),_0x1421bc);if(_0x49644a['query']['filter']){_0x2890ad[_0xee28('0x3d')]=_['merge'](_0x2890ad[_0xee28('0x3d')],{'$or':_['map'](_0x1421bc,function(_0x2b73d9){if(_0x2b73d9['type']!==_0xee28('0x40')){var _0x211345={};_0x211345[_0x2b73d9[_0xee28('0x2d')]]={'$like':'%'+_0x49644a[_0xee28('0x35')]['filter']+'%'};return _0x211345;}})});}_0x2890ad=_[_0xee28('0x41')]({},_0x2890ad,_0x49644a['options']);var _0x45ed94={'where':_0x2890ad[_0xee28('0x3d')]};return db[_0xee28('0x31')][_0xee28('0x1f')](_0x45ed94)[_0xee28('0x27')](function(_0x2e046e){_0xf0b169[_0xee28('0x1f')]=_0x2e046e;if(_0x49644a['query']['includeAll']){_0x2890ad[_0xee28('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x2890ad);})[_0xee28('0x27')](function(_0x14bd8d){_0xf0b169['rows']=_0x14bd8d;return _0xf0b169;})[_0xee28('0x27')](respondWithFilteredResult(_0x14f7c4,_0x2890ad))[_0xee28('0x43')](handleError(_0x14f7c4,null));};exports[_0xee28('0x44')]=function(_0x24cfaa,_0x460c61){var _0x2351f7={'raw':![],'where':{'id':_0x24cfaa['params']['id']}},_0x1735a9={};_0x1735a9[_0xee28('0x34')]=_[_0xee28('0x36')](db[_0xee28('0x31')][_0xee28('0x45')]);_0x1735a9[_0xee28('0x35')]=_['keys'](_0x24cfaa[_0xee28('0x35')]);_0x1735a9[_0xee28('0x3e')]=_['intersection'](_0x1735a9[_0xee28('0x34')],_0x1735a9[_0xee28('0x35')]);_0x2351f7[_0xee28('0x37')]=_[_0xee28('0x38')](_0x1735a9[_0xee28('0x34')],qs[_0xee28('0x39')](_0x24cfaa['query'][_0xee28('0x39')]));_0x2351f7['attributes']=_0x2351f7['attributes'][_0xee28('0x46')]?_0x2351f7[_0xee28('0x37')]:_0x1735a9['model'];if(_0x24cfaa[_0xee28('0x35')][_0xee28('0x47')]){_0x2351f7[_0xee28('0x42')]=[{'all':!![]}];}_0x2351f7=_['merge']({},_0x2351f7,_0x24cfaa['options']);return db[_0xee28('0x31')][_0xee28('0x48')](_0x2351f7)[_0xee28('0x27')](handleEntityNotFound(_0x460c61,null))[_0xee28('0x27')](respondWithResult(_0x460c61,null))[_0xee28('0x43')](handleError(_0x460c61,null));};exports[_0xee28('0x49')]=function(_0x2574c5,_0x2b5f36){return db[_0xee28('0x31')][_0xee28('0x49')](_0x2574c5['body'],{})[_0xee28('0x27')](function(_0x5e174f){var _0x21a66a=_0x2574c5[_0xee28('0x4a')][_0xee28('0x28')]({'plain':!![]});if(!_0x21a66a)throw new Error(_0xee28('0x4b'));if(_0x21a66a[_0xee28('0x4c')]==='user'){var _0x5247fe=_0x5e174f['get']({'plain':!![]});var _0x1b15a4='ChanSpies';return db['UserProfileSection'][_0xee28('0x48')]({'where':{'name':_0x1b15a4,'userProfileId':_0x21a66a['userProfileId']},'raw':!![]})[_0xee28('0x27')](function(_0x1f6754){if(_0x1f6754&&_0x1f6754[_0xee28('0x4d')]===0x0){return db[_0xee28('0x2a')][_0xee28('0x49')]({'name':_0x5247fe[_0xee28('0x2d')],'resourceId':_0x5247fe['id'],'type':_0x1f6754[_0xee28('0x2d')],'sectionId':_0x1f6754['id']},{})[_0xee28('0x27')](function(){return _0x5e174f;});}else{return _0x5e174f;}})[_0xee28('0x43')](function(_0x10d393){logger['error'](_0xee28('0x4e'),_0x10d393);throw _0x10d393;});}return _0x5e174f;})[_0xee28('0x27')](respondWithResult(_0x2b5f36,0xc9))[_0xee28('0x43')](handleError(_0x2b5f36,null));};exports['update']=function(_0x5b9ced,_0x57d865){if(_0x5b9ced['body']['id']){delete _0x5b9ced[_0xee28('0x4f')]['id'];}return db[_0xee28('0x31')][_0xee28('0x48')]({'where':{'id':_0x5b9ced['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x57d865,null))[_0xee28('0x27')](saveUpdates(_0x5b9ced[_0xee28('0x4f')],null))[_0xee28('0x27')](respondWithResult(_0x57d865,null))[_0xee28('0x43')](handleError(_0x57d865,null));};exports['destroy']=function(_0x2a5da9,_0x1c6696){return db[_0xee28('0x31')]['find']({'where':{'id':_0x2a5da9[_0xee28('0x50')]['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x1c6696,null))[_0xee28('0x27')](removeEntity(_0x1c6696,null))[_0xee28('0x43')](handleError(_0x1c6696,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 28cbddd..61bd247 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 _0x599f=['destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','MixMonitor','recordingFormat','merge','Authenticate','password','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch'];(function(_0x4aa9b4,_0x56be72){var _0x124e50=function(_0x40349f){while(--_0x40349f){_0x4aa9b4['push'](_0x4aa9b4['shift']());}};_0x124e50(++_0x56be72);}(_0x599f,0x181));var _0xf599=function(_0x1dee7b,_0x3c62c1){_0x1dee7b=_0x1dee7b-0x0;var _0x5ec899=_0x599f[_0x1dee7b];return _0x5ec899;};'use strict';var _=require(_0xf599('0x0'));var util=require('util');var BPromise=require(_0xf599('0x1'));var attributes=require(_0xf599('0x2'));var getUserApplications=function(_0x4b14a5,_0x6a5bc8,_0x245d56){var _0x594293=0x1;var _0x4f9e98=[];var _0x3c8f7e={'context':_0x6a5bc8[_0xf599('0x3')]||'from-sip','exten':util[_0xf599('0x4')](_0xf599('0x5'),_0x4b14a5[_0xf599('0x6')],_0x245d56),'type':_0xf599('0x7'),'isApp':![],'ChanSpyId':_0x4b14a5['id'],'UserId':_0x6a5bc8['id']};_0x4f9e98['push'](_['merge']({'app':'Set','appdata':util['format']('CDR(type)=%s','chanspy'),'priority':_0x594293++},_0x3c8f7e));if(_0x4b14a5['record']){_0x4f9e98[_0xf599('0x8')](_['merge']({'app':_0xf599('0x9'),'appdata':util[_0xf599('0x4')]('${UNIQUEID}.%s,a',_0x4b14a5[_0xf599('0xa')]),'priority':_0x594293++},_0x3c8f7e));}if(_0x4b14a5['auth']){_0x4f9e98[_0xf599('0x8')](_[_0xf599('0xb')]({'app':_0xf599('0xc'),'appdata':_0x4b14a5[_0xf599('0xd')],'priority':_0x594293++},_0x3c8f7e));}_0x4f9e98[_0xf599('0x8')](_['merge']({'app':'ChanSpy','appdata':util[_0xf599('0x4')]('SIP/%s,%s',_0x6a5bc8[_0xf599('0xe')],_0x4b14a5['options']?_0x4b14a5[_0xf599('0xf')][_0xf599('0x10')](''):''),'priority':_0x594293++},_0x3c8f7e));if(_0x4b14a5['record']){_0x4f9e98[_0xf599('0x8')](_[_0xf599('0xb')]({'app':_0xf599('0x11'),'priority':_0x594293++},_0x3c8f7e));}return _0x4f9e98;};var getChanSpyApplications=function(_0x5eebc6,_0x37f3e4){var _0x55226e=[];for(var _0xa125aa=0x0,_0x3cb451=0x1;_0xa125aa<_0x37f3e4[_0xf599('0x12')];_0xa125aa++,_0x3cb451=0x1){_0x55226e=_0x55226e[_0xf599('0x13')](getUserApplications(_0x5eebc6,_0x37f3e4[_0xa125aa],_0x37f3e4[_0xa125aa][_0xf599('0x14')]));if(_0x37f3e4[_0xa125aa][_0xf599('0x14')]!=_0x37f3e4[_0xa125aa][_0xf599('0xe')]){_0x55226e=_0x55226e[_0xf599('0x13')](getUserApplications(_0x5eebc6,_0x37f3e4[_0xa125aa],_0x37f3e4[_0xa125aa][_0xf599('0xe')]));}}return _0x55226e;};var getChanSpyPromise=function(_0x5c4752,_0x386701){return new BPromise(function(_0xe66593,_0x4ad3c9){return _0x5c4752['User'][_0xf599('0x15')]({'attributes':['id','name',_0xf599('0x14')],'where':{'role':_0xf599('0x16'),'chanspy':!![]},'raw':!![]})[_0xf599('0x17')](function(_0x44e295){if(_0x44e295){return _0xe66593(getChanSpyApplications(_0x386701,_0x44e295));}return _0xe66593([]);})['catch'](function(_0x3d64a2){_0x4ad3c9(_0x3d64a2);});});};module[_0xf599('0x18')]=function(_0x337c1f,_0xc7da4){var _0x26a29c=_0x337c1f['models'];return _0x337c1f[_0xf599('0x19')](_0xf599('0x1a'),attributes,{'tableName':_0xf599('0x1b'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x18b811,_0x3e2ec7,_0x427d29){return getChanSpyPromise(_0x26a29c,_0x18b811)[_0xf599('0x17')](function(_0x5e25e9){if(_0x5e25e9&&_0x5e25e9[_0xf599('0x12')]){return _0x26a29c[_0xf599('0x1c')][_0xf599('0x1d')](_0x5e25e9);}})[_0xf599('0x17')](function(){_0x427d29();})[_0xf599('0x1e')](function(_0x31ff2e){_0x427d29(_0x31ff2e);});},'afterUpdate':function(_0x54d94a,_0x116d95,_0x559240){return _0x26a29c['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x54d94a['id']}})[_0xf599('0x17')](function(){return getChanSpyPromise(_0x26a29c,_0x54d94a);})['then'](function(_0x12562c){if(_0x12562c&&_0x12562c[_0xf599('0x12')]){return _0x26a29c[_0xf599('0x1c')][_0xf599('0x1d')](_0x12562c);}})[_0xf599('0x17')](function(){_0x559240();})[_0xf599('0x1e')](function(_0x107669){_0x559240(_0x107669);});},'afterDestroy':function(_0x541379,_0x4a876d,_0xf54296){return _0x26a29c[_0xf599('0x1c')][_0xf599('0x1f')]({'where':{'ChanSpyId':_0x541379['id']}})[_0xf599('0x17')](function(){_0xf54296();})[_0xf599('0x1e')](function(_0x102304){_0xf54296(_0x102304);});}}});}; \ No newline at end of file +var _0xe632=['auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','exports','models','VoiceChanSpy','VoiceExtension','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x582333,_0x4c6187){var _0x1c0c27=function(_0x1876ff){while(--_0x1876ff){_0x582333['push'](_0x582333['shift']());}};_0x1c0c27(++_0x4c6187);}(_0xe632,0x1c1));var _0x2e63=function(_0x3dc5e5,_0x4f0af9){_0x3dc5e5=_0x3dc5e5-0x0;var _0x3ec9a8=_0xe632[_0x3dc5e5];return _0x3ec9a8;};'use strict';var _=require(_0x2e63('0x0'));var util=require(_0x2e63('0x1'));var BPromise=require(_0x2e63('0x2'));var attributes=require(_0x2e63('0x3'));var getUserApplications=function(_0x24d677,_0x5dd7c5,_0x3f7ff2){var _0x4c194d=0x1;var _0x2af908=[];var _0x29b183={'context':_0x5dd7c5[_0x2e63('0x4')]||_0x2e63('0x5'),'exten':util[_0x2e63('0x6')](_0x2e63('0x7'),_0x24d677[_0x2e63('0x8')],_0x3f7ff2),'type':_0x2e63('0x9'),'isApp':![],'ChanSpyId':_0x24d677['id'],'UserId':_0x5dd7c5['id']};_0x2af908[_0x2e63('0xa')](_[_0x2e63('0xb')]({'app':_0x2e63('0xc'),'appdata':util[_0x2e63('0x6')](_0x2e63('0xd'),_0x2e63('0xe')),'priority':_0x4c194d++},_0x29b183));if(_0x24d677[_0x2e63('0xf')]){_0x2af908[_0x2e63('0xa')](_[_0x2e63('0xb')]({'app':_0x2e63('0x10'),'appdata':util[_0x2e63('0x6')](_0x2e63('0x11'),_0x24d677[_0x2e63('0x12')]),'priority':_0x4c194d++},_0x29b183));}if(_0x24d677[_0x2e63('0x13')]){_0x2af908[_0x2e63('0xa')](_[_0x2e63('0xb')]({'app':_0x2e63('0x14'),'appdata':_0x24d677['password'],'priority':_0x4c194d++},_0x29b183));}_0x2af908['push'](_[_0x2e63('0xb')]({'app':_0x2e63('0x15'),'appdata':util['format'](_0x2e63('0x16'),_0x5dd7c5[_0x2e63('0x17')],_0x24d677['options']?_0x24d677[_0x2e63('0x18')][_0x2e63('0x19')](''):''),'priority':_0x4c194d++},_0x29b183));if(_0x24d677[_0x2e63('0xf')]){_0x2af908[_0x2e63('0xa')](_['merge']({'app':_0x2e63('0x1a'),'priority':_0x4c194d++},_0x29b183));}return _0x2af908;};var getChanSpyApplications=function(_0x347e06,_0x588757){var _0x2e93fd=[];for(var _0x5d2155=0x0,_0x4125da=0x1;_0x5d2155<_0x588757[_0x2e63('0x1b')];_0x5d2155++,_0x4125da=0x1){_0x2e93fd=_0x2e93fd[_0x2e63('0x1c')](getUserApplications(_0x347e06,_0x588757[_0x5d2155],_0x588757[_0x5d2155]['internal']));if(_0x588757[_0x5d2155][_0x2e63('0x1d')]!=_0x588757[_0x5d2155]['name']){_0x2e93fd=_0x2e93fd[_0x2e63('0x1c')](getUserApplications(_0x347e06,_0x588757[_0x5d2155],_0x588757[_0x5d2155][_0x2e63('0x17')]));}}return _0x2e93fd;};var getChanSpyPromise=function(_0x670a70,_0x54d554){return new BPromise(function(_0x2a559d,_0x933e90){return _0x670a70[_0x2e63('0x1e')]['findAll']({'attributes':['id','name',_0x2e63('0x1d')],'where':{'role':_0x2e63('0x1f'),'chanspy':!![]},'raw':!![]})[_0x2e63('0x20')](function(_0x34d074){if(_0x34d074){return _0x2a559d(getChanSpyApplications(_0x54d554,_0x34d074));}return _0x2a559d([]);})[_0x2e63('0x21')](function(_0x2be308){_0x933e90(_0x2be308);});});};module[_0x2e63('0x22')]=function(_0xfb5a39,_0x50ca73){var _0x180cd3=_0xfb5a39[_0x2e63('0x23')];return _0xfb5a39['define'](_0x2e63('0x24'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x23cceb,_0x10fd66,_0x29da64){return getChanSpyPromise(_0x180cd3,_0x23cceb)['then'](function(_0x11d6d6){if(_0x11d6d6&&_0x11d6d6[_0x2e63('0x1b')]){return _0x180cd3[_0x2e63('0x25')]['bulkCreate'](_0x11d6d6);}})['then'](function(){_0x29da64();})[_0x2e63('0x21')](function(_0x5d3faf){_0x29da64(_0x5d3faf);});},'afterUpdate':function(_0x1b9df1,_0x2c1012,_0x5ac503){return _0x180cd3[_0x2e63('0x25')]['destroy']({'where':{'ChanSpyId':_0x1b9df1['id']}})[_0x2e63('0x20')](function(){return getChanSpyPromise(_0x180cd3,_0x1b9df1);})['then'](function(_0x2a5923){if(_0x2a5923&&_0x2a5923[_0x2e63('0x1b')]){return _0x180cd3[_0x2e63('0x25')][_0x2e63('0x26')](_0x2a5923);}})[_0x2e63('0x20')](function(){_0x5ac503();})[_0x2e63('0x21')](function(_0x437bd3){_0x5ac503(_0x437bd3);});},'afterDestroy':function(_0x146e6a,_0x327349,_0x418b6e){return _0x180cd3[_0x2e63('0x25')]['destroy']({'where':{'ChanSpyId':_0x146e6a['id']}})['then'](function(){_0x418b6e();})[_0x2e63('0x21')](function(_0x588aee){_0x418b6e(_0x588aee);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index bbc02a5..6c20291 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 _0x4058=['request','then','info','request\x20sent','debug','stringify','VoiceChanSpy,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4058,0x129));var _0x8405=function(_0x3d9d8e,_0x3c4e28){_0x3d9d8e=_0x3d9d8e-0x0;var _0x406245=_0x4058[_0x3d9d8e];return _0x406245;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9bf6,_0x1322e5,_0x1cb061){return new BPromise(function(_0x479c97,_0x16d810){return client[_0x8405('0xb')](_0x3d9bf6,_0x1cb061)[_0x8405('0xc')](function(_0x53bd7c){logger[_0x8405('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'));logger[_0x8405('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'),JSON[_0x8405('0x10')](_0x53bd7c));if(_0x53bd7c['error']){if(_0x53bd7c['error']['code']===0x1f4){logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c['error']['message']);return _0x16d810(_0x53bd7c['error']['message']);}logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c[_0x8405('0x12')]['message']);return _0x479c97(_0x53bd7c[_0x8405('0x12')][_0x8405('0x13')]);}else{logger[_0x8405('0xd')](_0x8405('0x11'),_0x1322e5,'request\x20sent');_0x479c97(_0x53bd7c[_0x8405('0x14')][_0x8405('0x13')]);}})[_0x8405('0x15')](function(_0x30cef7){logger[_0x8405('0x12')](_0x8405('0x11'),_0x1322e5,_0x30cef7);_0x16d810(_0x30cef7);});});} \ No newline at end of file +var _0x1152=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x555815,_0x1b83eb){var _0x4cbf9e=function(_0x16e75c){while(--_0x16e75c){_0x555815['push'](_0x555815['shift']());}};_0x4cbf9e(++_0x1b83eb);}(_0x1152,0x182));var _0x2115=function(_0x4b281a,_0x1733de){_0x4b281a=_0x4b281a-0x0;var _0x3149a7=_0x1152[_0x4b281a];return _0x3149a7;};'use strict';var _=require(_0x2115('0x0'));var util=require(_0x2115('0x1'));var moment=require(_0x2115('0x2'));var BPromise=require(_0x2115('0x3'));var rs=require(_0x2115('0x4'));var fs=require('fs');var Redis=require(_0x2115('0x5'));var db=require(_0x2115('0x6'))['db'];var utils=require(_0x2115('0x7'));var logger=require('../../config/logger')(_0x2115('0x8'));var config=require('../../config/environment');var jayson=require(_0x2115('0x9'));var client=jayson[_0x2115('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x564071,_0x54cdd0,_0x5dbb85){return new BPromise(function(_0x5df6db,_0x158711){return client[_0x2115('0xb')](_0x564071,_0x5dbb85)[_0x2115('0xc')](function(_0x5156f2){logger[_0x2115('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x54cdd0,'request\x20sent');logger[_0x2115('0xe')](_0x2115('0xf'),_0x54cdd0,_0x2115('0x10'),JSON['stringify'](_0x5156f2));if(_0x5156f2[_0x2115('0x11')]){if(_0x5156f2['error'][_0x2115('0x12')]===0x1f4){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x158711(_0x5156f2['error'][_0x2115('0x14')]);}logger['error'](_0x2115('0x13'),_0x54cdd0,_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);return _0x5df6db(_0x5156f2[_0x2115('0x11')][_0x2115('0x14')]);}else{logger[_0x2115('0xd')](_0x2115('0x13'),_0x54cdd0,'request\x20sent');_0x5df6db(_0x5156f2[_0x2115('0x15')][_0x2115('0x14')]);}})[_0x2115('0x16')](function(_0x184c05){logger[_0x2115('0x11')](_0x2115('0x13'),_0x54cdd0,_0x184c05);_0x158711(_0x184c05);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index be7c6e2..9763fe8 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 _0x3324=['../../config/environment','./voiceContext.controller','index','get','/:id','isAuthenticated','show','create','put','update','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3324,0xfa));var _0x4332=function(_0x5b791c,_0x3acbce){_0x5b791c=_0x5b791c-0x0;var _0x504eed=_0x3324[_0x5b791c];return _0x504eed;};'use strict';var multer=require(_0x4332('0x0'));var util=require('util');var path=require(_0x4332('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4332('0x2')]();var fs_extra=require(_0x4332('0x3'));var auth=require(_0x4332('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4332('0x5'));var controller=require(_0x4332('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4332('0x7')]);router[_0x4332('0x8')](_0x4332('0x9'),auth[_0x4332('0xa')](),controller[_0x4332('0xb')]);router['post']('/',auth[_0x4332('0xa')](),controller[_0x4332('0xc')]);router[_0x4332('0xd')](_0x4332('0x9'),auth['isAuthenticated'](),controller[_0x4332('0xe')]);router['delete'](_0x4332('0x9'),auth[_0x4332('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x24fa=['update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','post','create','put','/:id'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x24fa,0xe7));var _0xa24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fa[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa24f('0x0'));var util=require(_0xa24f('0x1'));var path=require(_0xa24f('0x2'));var timeout=require(_0xa24f('0x3'));var express=require(_0xa24f('0x4'));var router=express['Router']();var fs_extra=require(_0xa24f('0x5'));var auth=require(_0xa24f('0x6'));var interaction=require(_0xa24f('0x7'));var config=require(_0xa24f('0x8'));var controller=require(_0xa24f('0x9'));router[_0xa24f('0xa')]('/',auth[_0xa24f('0xb')](),controller['index']);router['get']('/:id',auth[_0xa24f('0xb')](),controller['show']);router[_0xa24f('0xc')]('/',auth[_0xa24f('0xb')](),controller[_0xa24f('0xd')]);router[_0xa24f('0xe')](_0xa24f('0xf'),auth['isAuthenticated'](),controller[_0xa24f('0x10')]);router['delete']('/:id',auth[_0xa24f('0xb')](),controller[_0xa24f('0x11')]);module[_0xa24f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e33334b..a69f530 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 _0xe79a=['sequelize','exports','STRING'];(function(_0x2d162b,_0x58b777){var _0x438256=function(_0x2d6999){while(--_0x2d6999){_0x2d162b['push'](_0x2d162b['shift']());}};_0x438256(++_0x58b777);}(_0xe79a,0x9c));var _0xae79=function(_0x51c0f2,_0x371fef){_0x51c0f2=_0x51c0f2-0x0;var _0x2a4fad=_0xe79a[_0x51c0f2];return _0x2a4fad;};'use strict';var Sequelize=require(_0xae79('0x0'));module[_0xae79('0x1')]={'name':{'type':Sequelize[_0xae79('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xae79('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1e95=['exports','name','STRING','BOOLEAN','sequelize'];(function(_0x32f82d,_0x3f2255){var _0x56304c=function(_0x501af2){while(--_0x501af2){_0x32f82d['push'](_0x32f82d['shift']());}};_0x56304c(++_0x3f2255);}(_0x1e95,0x1c1));var _0x51e9=function(_0x4b97b8,_0xcaa58){_0x4b97b8=_0x4b97b8-0x0;var _0x532ac0=_0x1e95[_0x4b97b8];return _0x532ac0;};'use strict';var Sequelize=require(_0x51e9('0x0'));module[_0x51e9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x51e9('0x2')},'description':{'type':Sequelize[_0x51e9('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x51e9('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 598ebc2..648bc22 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 _0xe234=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','then','send','index','map','VoiceContext','rawAttributes','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xe234,0x135));var _0x4e23=function(_0xdc36cc,_0x1bf6b5){_0xdc36cc=_0xdc36cc-0x0;var _0x43afc4=_0xe234[_0xdc36cc];return _0x43afc4;};'use strict';var emlformat=require(_0x4e23('0x0'));var rimraf=require(_0x4e23('0x1'));var zipdir=require(_0x4e23('0x2'));var jsonpatch=require(_0x4e23('0x3'));var rp=require(_0x4e23('0x4'));var moment=require('moment');var BPromise=require(_0x4e23('0x5'));var Mustache=require(_0x4e23('0x6'));var util=require(_0x4e23('0x7'));var path=require(_0x4e23('0x8'));var sox=require(_0x4e23('0x9'));var csv=require('to-csv');var ejs=require(_0x4e23('0xa'));var fs=require('fs');var fs_extra=require(_0x4e23('0xb'));var _=require(_0x4e23('0xc'));var squel=require(_0x4e23('0xd'));var crypto=require(_0x4e23('0xe'));var jsforce=require(_0x4e23('0xf'));var deskjs=require(_0x4e23('0x10'));var toCsv=require(_0x4e23('0x11'));var querystring=require('querystring');var Papa=require(_0x4e23('0x12'));var Redis=require(_0x4e23('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4e23('0x14'));var as=require(_0x4e23('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e23('0x16'));var utils=require(_0x4e23('0x17'));var config=require(_0x4e23('0x18'));var licenseUtil=require(_0x4e23('0x19'));var db=require(_0x4e23('0x1a'))['db'];var jayson=require(_0x4e23('0x1b'));var client=jayson[_0x4e23('0x1c')][_0x4e23('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2544cc,_0x2a93e9,_0x1ef03b,_0x16718a){return new BPromise(function(_0x44e572,_0xee10f6){var _0x400184=_0x16718a||client;return _0x400184[_0x4e23('0x1e')](_0x2544cc,_0x1ef03b)['then'](function(_0x53ee91){logger[_0x4e23('0x1f')](_0x4e23('0x20'),_0x2a93e9,_0x4e23('0x21'));logger[_0x4e23('0x22')](_0x4e23('0x23'),_0x2a93e9,'request\x20sent',JSON[_0x4e23('0x24')](_0x53ee91));if(_0x53ee91[_0x4e23('0x25')]){if(_0x53ee91[_0x4e23('0x25')][_0x4e23('0x26')]===0x1f4){logger[_0x4e23('0x25')](_0x4e23('0x20'),_0x2a93e9,_0x53ee91['error'][_0x4e23('0x27')]);return _0xee10f6(_0x53ee91['error'][_0x4e23('0x27')]);}logger[_0x4e23('0x25')](_0x4e23('0x20'),_0x2a93e9,_0x53ee91[_0x4e23('0x25')][_0x4e23('0x27')]);return _0x44e572(_0x53ee91['error']['message']);}else{logger['info'](_0x4e23('0x20'),_0x2a93e9,_0x4e23('0x21'));_0x44e572(_0x53ee91[_0x4e23('0x28')][_0x4e23('0x27')]);}})['catch'](function(_0x1681ef){logger[_0x4e23('0x25')](_0x4e23('0x20'),_0x2a93e9,_0x1681ef);_0xee10f6(_0x1681ef);});});}function respondWithStatusCode(_0x233c0a,_0x2311b8){_0x2311b8=_0x2311b8||0xcc;return function(_0x2f972e){if(_0x2f972e){return _0x233c0a[_0x4e23('0x29')](_0x2311b8);}return _0x233c0a[_0x4e23('0x2a')](_0x2311b8)[_0x4e23('0x2b')]();};}function respondWithResult(_0x59de35,_0x169c27){_0x169c27=_0x169c27||0xc8;return function(_0x4057ef){if(_0x4057ef){return _0x59de35[_0x4e23('0x2a')](_0x169c27)[_0x4e23('0x2c')](_0x4057ef);}};}function respondWithFilteredResult(_0x4de29a,_0x4f20e7){return function(_0x3ea06f){if(_0x3ea06f){var _0x3eab03=typeof _0x4f20e7[_0x4e23('0x2d')]==='undefined'&&typeof _0x4f20e7[_0x4e23('0x2e')]==='undefined';var _0x16c147=_0x3ea06f[_0x4e23('0x2f')];var _0x9b982a=_0x3eab03?0x0:_0x4f20e7[_0x4e23('0x2d')];var _0x5e0c68=_0x3eab03?_0x3ea06f[_0x4e23('0x2f')]:_0x4f20e7['offset']+_0x4f20e7[_0x4e23('0x2e')];var _0x36613d;if(_0x5e0c68>=_0x16c147){_0x5e0c68=_0x16c147;_0x36613d=0xc8;}else{_0x36613d=0xce;}_0x4de29a['status'](_0x36613d);return _0x4de29a[_0x4e23('0x30')]('Content-Range',_0x9b982a+'-'+_0x5e0c68+'/'+_0x16c147)[_0x4e23('0x2c')](_0x3ea06f);}return null;};}function patchUpdates(_0x57240b){return function(_0x5e9275){try{jsonpatch[_0x4e23('0x31')](_0x5e9275,_0x57240b,!![]);}catch(_0x19f829){return BPromise[_0x4e23('0x32')](_0x19f829);}return _0x5e9275[_0x4e23('0x33')]();};}function saveUpdates(_0x3a105c,_0x7b43f9){return function(_0x1fe69d){if(_0x1fe69d){return _0x1fe69d[_0x4e23('0x34')](_0x3a105c)['then'](function(_0x55dee6){return _0x55dee6;});}return null;};}function removeEntity(_0x4c0c9c,_0x55e4ca){return function(_0x1f3d77){if(_0x1f3d77){return _0x1f3d77[_0x4e23('0x35')]()['then'](function(){var _0x5bf2b6=_0x1f3d77[_0x4e23('0x36')]({'plain':!![]});var _0x189887=_0x4e23('0x37');return db[_0x4e23('0x38')][_0x4e23('0x35')]({'where':{'type':_0x189887,'resourceId':_0x5bf2b6['id']}})[_0x4e23('0x39')](function(){return _0x1f3d77;});})[_0x4e23('0x39')](function(){_0x4c0c9c[_0x4e23('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1512,_0x57de0e){return function(_0x5ce591){if(!_0x5ce591){_0x5d1512[_0x4e23('0x29')](0x194);}return _0x5ce591;};}function handleError(_0x3517bc,_0x2acf99){_0x2acf99=_0x2acf99||0x1f4;return function(_0xd85194){logger[_0x4e23('0x25')](_0xd85194['stack']);if(_0xd85194['name']){delete _0xd85194['name'];}_0x3517bc['status'](_0x2acf99)[_0x4e23('0x3a')](_0xd85194);};}exports[_0x4e23('0x3b')]=function(_0x178ade,_0x157930){var _0x2a06c5={},_0x54a14a={},_0x8585f1={'count':0x0,'rows':[]};var _0x58eb3c=_[_0x4e23('0x3c')](db[_0x4e23('0x3d')][_0x4e23('0x3e')],function(_0x9f550d){return{'name':_0x9f550d['fieldName'],'type':_0x9f550d[_0x4e23('0x3f')][_0x4e23('0x40')]};});_0x54a14a['model']=_[_0x4e23('0x3c')](_0x58eb3c,_0x4e23('0x41'));_0x54a14a[_0x4e23('0x42')]=_[_0x4e23('0x43')](_0x178ade[_0x4e23('0x42')]);_0x54a14a[_0x4e23('0x44')]=_[_0x4e23('0x45')](_0x54a14a['model'],_0x54a14a[_0x4e23('0x42')]);_0x2a06c5[_0x4e23('0x46')]=_[_0x4e23('0x45')](_0x54a14a[_0x4e23('0x47')],qs['fields'](_0x178ade[_0x4e23('0x42')][_0x4e23('0x48')]));_0x2a06c5[_0x4e23('0x46')]=_0x2a06c5[_0x4e23('0x46')][_0x4e23('0x49')]?_0x2a06c5[_0x4e23('0x46')]:_0x54a14a[_0x4e23('0x47')];if(!_0x178ade['query'][_0x4e23('0x4a')](_0x4e23('0x4b'))){_0x2a06c5[_0x4e23('0x2e')]=qs[_0x4e23('0x2e')](_0x178ade['query']['limit']);_0x2a06c5[_0x4e23('0x2d')]=qs[_0x4e23('0x2d')](_0x178ade[_0x4e23('0x42')][_0x4e23('0x2d')]);}_0x2a06c5['order']=qs[_0x4e23('0x4c')](_0x178ade['query'][_0x4e23('0x4c')]);_0x2a06c5[_0x4e23('0x4d')]=qs[_0x4e23('0x44')](_[_0x4e23('0x4e')](_0x178ade['query'],_0x54a14a[_0x4e23('0x44')]),_0x58eb3c);if(_0x178ade[_0x4e23('0x42')][_0x4e23('0x4f')]){_0x2a06c5[_0x4e23('0x4d')]=_[_0x4e23('0x50')](_0x2a06c5['where'],{'$or':_[_0x4e23('0x3c')](_0x58eb3c,function(_0x41a490){if(_0x41a490[_0x4e23('0x3f')]!==_0x4e23('0x51')){var _0x1b023b={};_0x1b023b[_0x41a490[_0x4e23('0x41')]]={'$like':'%'+_0x178ade[_0x4e23('0x42')][_0x4e23('0x4f')]+'%'};return _0x1b023b;}})});}_0x2a06c5=_[_0x4e23('0x50')]({},_0x2a06c5,_0x178ade[_0x4e23('0x52')]);var _0x47b29c={'where':_0x2a06c5[_0x4e23('0x4d')]};return db[_0x4e23('0x3d')][_0x4e23('0x2f')](_0x47b29c)[_0x4e23('0x39')](function(_0x7665b5){_0x8585f1[_0x4e23('0x2f')]=_0x7665b5;if(_0x178ade[_0x4e23('0x42')][_0x4e23('0x53')]){_0x2a06c5[_0x4e23('0x54')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x2a06c5);})[_0x4e23('0x39')](function(_0xa10af5){_0x8585f1[_0x4e23('0x55')]=_0xa10af5;return _0x8585f1;})[_0x4e23('0x39')](respondWithFilteredResult(_0x157930,_0x2a06c5))[_0x4e23('0x56')](handleError(_0x157930,null));};exports[_0x4e23('0x57')]=function(_0x15b1da,_0x30412a){var _0x494f9d={'raw':![],'where':{'id':_0x15b1da[_0x4e23('0x58')]['id']}},_0x332e47={};_0x332e47[_0x4e23('0x47')]=_[_0x4e23('0x43')](db['VoiceContext'][_0x4e23('0x3e')]);_0x332e47['query']=_['keys'](_0x15b1da[_0x4e23('0x42')]);_0x332e47[_0x4e23('0x44')]=_[_0x4e23('0x45')](_0x332e47[_0x4e23('0x47')],_0x332e47['query']);_0x494f9d[_0x4e23('0x46')]=_[_0x4e23('0x45')](_0x332e47['model'],qs[_0x4e23('0x48')](_0x15b1da['query'][_0x4e23('0x48')]));_0x494f9d['attributes']=_0x494f9d[_0x4e23('0x46')]['length']?_0x494f9d[_0x4e23('0x46')]:_0x332e47[_0x4e23('0x47')];if(_0x15b1da[_0x4e23('0x42')][_0x4e23('0x53')]){_0x494f9d[_0x4e23('0x54')]=[{'all':!![]}];}_0x494f9d=_[_0x4e23('0x50')]({},_0x494f9d,_0x15b1da[_0x4e23('0x52')]);return db[_0x4e23('0x3d')][_0x4e23('0x59')](_0x494f9d)['then'](handleEntityNotFound(_0x30412a,null))[_0x4e23('0x39')](respondWithResult(_0x30412a,null))[_0x4e23('0x56')](handleError(_0x30412a,null));};exports[_0x4e23('0x5a')]=function(_0x3b1cb1,_0x2c05ae,_0x2d4e36){var _0x17b22f;return db[_0x4e23('0x3d')][_0x4e23('0x5a')](_0x3b1cb1[_0x4e23('0x5b')],{'raw':!![]})['then'](function(_0x11d1ce){_0x17b22f=_0x11d1ce;return db[_0x4e23('0x3d')]['findAll']({'raw':!![]});})[_0x4e23('0x39')](function(_0x37b4dd){var _0x2bf604=fs['readFileSync'](path['join'](config[_0x4e23('0x5c')],'server/files/templates/context.ejs'),_0x4e23('0x5d'));var _0x30ecb4=ejs[_0x4e23('0x5e')](_0x2bf604,{'contexts':_0x37b4dd||[]});fs[_0x4e23('0x5f')](_0x4e23('0x60'),_0x30ecb4);})[_0x4e23('0x39')](function(){return respondWithRpcPromise(_0x4e23('0x61'),_0x4e23('0x5a'),{'module':_0x4e23('0x62')});})['then'](function(){var _0x3ffd8c=_0x3b1cb1[_0x4e23('0x63')][_0x4e23('0x36')]({'plain':!![]});if(!_0x3ffd8c)throw new Error(_0x4e23('0x64'));if(_0x3ffd8c[_0x4e23('0x65')]===_0x4e23('0x63')){var _0x2abffd=_0x17b22f['get']({'plain':!![]});return db[_0x4e23('0x66')][_0x4e23('0x59')]({'where':{'name':_0x4e23('0x37'),'userProfileId':_0x3ffd8c[_0x4e23('0x67')]},'raw':!![]})['then'](function(_0x2d4fef){if(_0x2d4fef&&_0x2d4fef[_0x4e23('0x68')]===0x0){return db[_0x4e23('0x38')][_0x4e23('0x5a')]({'name':_0x2abffd[_0x4e23('0x41')],'resourceId':_0x2abffd['id'],'type':_0x2d4fef['name'],'sectionId':_0x2d4fef['id']},{})['then'](function(){return _0x17b22f;});}else{return _0x17b22f;}})[_0x4e23('0x56')](function(_0x4edc5f){logger['error'](_0x4e23('0x69'),_0x4edc5f);throw _0x4edc5f;});}return _0x17b22f;})['then'](respondWithResult(_0x2c05ae,0xc9))[_0x4e23('0x56')](handleError(_0x2c05ae,null));};exports[_0x4e23('0x34')]=function(_0x5f0f76,_0x4db3ae,_0x111f61){var _0x5c0dc1;return db[_0x4e23('0x3d')]['find']({'where':{'id':_0x5f0f76[_0x4e23('0x58')]['id']}})[_0x4e23('0x39')](handleEntityNotFound(_0x4db3ae,null))[_0x4e23('0x39')](saveUpdates(_0x5f0f76['body'],null))[_0x4e23('0x39')](function(_0x453dc8){if(_0x453dc8){_0x5c0dc1=_0x453dc8;return db[_0x4e23('0x3d')][_0x4e23('0x6a')]({'raw':!![]});}})['then'](function(_0x1267d3){var _0x40b2c2=fs[_0x4e23('0x6b')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x4e23('0x5d'));var _0x4ae5ac=ejs[_0x4e23('0x5e')](_0x40b2c2,{'contexts':_0x1267d3||[]});fs[_0x4e23('0x5f')](_0x4e23('0x60'),_0x4ae5ac);})['then'](function(){return respondWithRpcPromise(_0x4e23('0x61'),_0x4e23('0x34'),{'module':_0x4e23('0x62')});})['then'](function(){return _0x5c0dc1;})[_0x4e23('0x39')](respondWithResult(_0x4db3ae,null))[_0x4e23('0x56')](handleError(_0x4db3ae,null));};exports[_0x4e23('0x35')]=function(_0x2eff33,_0x4cc169,_0x576cca){var _0x5baecd;return db[_0x4e23('0x3d')][_0x4e23('0x59')]({'where':{'id':_0x2eff33[_0x4e23('0x58')]['id']}})[_0x4e23('0x39')](handleEntityNotFound(_0x4cc169,null))[_0x4e23('0x39')](removeEntity(_0x4cc169,null))[_0x4e23('0x39')](function(){return db[_0x4e23('0x3d')][_0x4e23('0x6a')]({'raw':!![]});})['then'](function(_0x3d10af){var _0x508939=fs[_0x4e23('0x6b')](path['join'](config[_0x4e23('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x4bb175=ejs[_0x4e23('0x5e')](_0x508939,{'contexts':_0x3d10af});fs[_0x4e23('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4bb175);return respondWithRpcPromise(_0x4e23('0x61'),'destroy',{'module':_0x4e23('0x62')});})[_0x4e23('0x56')](handleError(_0x4cc169,null));}; \ No newline at end of file +var _0xc215=['catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','include','find','create','readFileSync','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','server/files/templates/context.ejs','chan_sip.so','params','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message'];(function(_0x1d7791,_0x2a291f){var _0x2293f8=function(_0x464734){while(--_0x464734){_0x1d7791['push'](_0x1d7791['shift']());}};_0x2293f8(++_0x2a291f);}(_0xc215,0x1ed));var _0x5c21=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc215[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x5c21('0x0'));var rimraf=require(_0x5c21('0x1'));var zipdir=require(_0x5c21('0x2'));var jsonpatch=require(_0x5c21('0x3'));var rp=require(_0x5c21('0x4'));var moment=require(_0x5c21('0x5'));var BPromise=require(_0x5c21('0x6'));var Mustache=require(_0x5c21('0x7'));var util=require(_0x5c21('0x8'));var path=require('path');var sox=require(_0x5c21('0x9'));var csv=require('to-csv');var ejs=require(_0x5c21('0xa'));var fs=require('fs');var fs_extra=require(_0x5c21('0xb'));var _=require(_0x5c21('0xc'));var squel=require(_0x5c21('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c21('0xe'));var toCsv=require(_0x5c21('0xf'));var querystring=require(_0x5c21('0x10'));var Papa=require(_0x5c21('0x11'));var Redis=require(_0x5c21('0x12'));var authService=require(_0x5c21('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5c21('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c21('0x15'))('api');var utils=require(_0x5c21('0x16'));var config=require(_0x5c21('0x17'));var licenseUtil=require(_0x5c21('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5c21('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x56a1f3,_0x5aa343,_0x35d049,_0x4efe48){return new BPromise(function(_0x1eb260,_0x487a04){var _0x92d4ac=_0x4efe48||client;return _0x92d4ac[_0x5c21('0x1a')](_0x56a1f3,_0x35d049)[_0x5c21('0x1b')](function(_0x976602){logger[_0x5c21('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x5aa343,_0x5c21('0x1d'));logger[_0x5c21('0x1e')](_0x5c21('0x1f'),_0x5aa343,_0x5c21('0x1d'),JSON[_0x5c21('0x20')](_0x976602));if(_0x976602[_0x5c21('0x21')]){if(_0x976602[_0x5c21('0x21')][_0x5c21('0x22')]===0x1f4){logger[_0x5c21('0x21')](_0x5c21('0x23'),_0x5aa343,_0x976602['error'][_0x5c21('0x24')]);return _0x487a04(_0x976602['error']['message']);}logger[_0x5c21('0x21')](_0x5c21('0x23'),_0x5aa343,_0x976602[_0x5c21('0x21')][_0x5c21('0x24')]);return _0x1eb260(_0x976602[_0x5c21('0x21')][_0x5c21('0x24')]);}else{logger['info'](_0x5c21('0x23'),_0x5aa343,_0x5c21('0x1d'));_0x1eb260(_0x976602['result'][_0x5c21('0x24')]);}})[_0x5c21('0x25')](function(_0x52134c){logger['error'](_0x5c21('0x23'),_0x5aa343,_0x52134c);_0x487a04(_0x52134c);});});}function respondWithStatusCode(_0x2a9040,_0x5543e9){_0x5543e9=_0x5543e9||0xcc;return function(_0x233631){if(_0x233631){return _0x2a9040[_0x5c21('0x26')](_0x5543e9);}return _0x2a9040[_0x5c21('0x27')](_0x5543e9)[_0x5c21('0x28')]();};}function respondWithResult(_0x1be5de,_0x58ad5c){_0x58ad5c=_0x58ad5c||0xc8;return function(_0x3f308f){if(_0x3f308f){return _0x1be5de[_0x5c21('0x27')](_0x58ad5c)['json'](_0x3f308f);}};}function respondWithFilteredResult(_0x4a7186,_0x4e70c5){return function(_0x2dc40b){if(_0x2dc40b){var _0x35ffbb=typeof _0x4e70c5['offset']===_0x5c21('0x29')&&typeof _0x4e70c5[_0x5c21('0x2a')]===_0x5c21('0x29');var _0x1b37cb=_0x2dc40b[_0x5c21('0x2b')];var _0x369ead=_0x35ffbb?0x0:_0x4e70c5[_0x5c21('0x2c')];var _0x447a6c=_0x35ffbb?_0x2dc40b[_0x5c21('0x2b')]:_0x4e70c5[_0x5c21('0x2c')]+_0x4e70c5['limit'];var _0x27c3fe;if(_0x447a6c>=_0x1b37cb){_0x447a6c=_0x1b37cb;_0x27c3fe=0xc8;}else{_0x27c3fe=0xce;}_0x4a7186[_0x5c21('0x27')](_0x27c3fe);return _0x4a7186['set'](_0x5c21('0x2d'),_0x369ead+'-'+_0x447a6c+'/'+_0x1b37cb)[_0x5c21('0x2e')](_0x2dc40b);}return null;};}function patchUpdates(_0x57e8ba){return function(_0x269cf9){try{jsonpatch[_0x5c21('0x2f')](_0x269cf9,_0x57e8ba,!![]);}catch(_0x514455){return BPromise[_0x5c21('0x30')](_0x514455);}return _0x269cf9[_0x5c21('0x31')]();};}function saveUpdates(_0xfeec82,_0x4a72b5){return function(_0x274337){if(_0x274337){return _0x274337[_0x5c21('0x32')](_0xfeec82)[_0x5c21('0x1b')](function(_0x487795){return _0x487795;});}return null;};}function removeEntity(_0x27a48d,_0x580b9e){return function(_0x55dc4b){if(_0x55dc4b){return _0x55dc4b[_0x5c21('0x33')]()[_0x5c21('0x1b')](function(){var _0x37b729=_0x55dc4b[_0x5c21('0x34')]({'plain':!![]});var _0x552a5d=_0x5c21('0x35');return db[_0x5c21('0x36')][_0x5c21('0x33')]({'where':{'type':_0x552a5d,'resourceId':_0x37b729['id']}})[_0x5c21('0x1b')](function(){return _0x55dc4b;});})[_0x5c21('0x1b')](function(){_0x27a48d[_0x5c21('0x27')](0xcc)[_0x5c21('0x28')]();});}};}function handleEntityNotFound(_0x28e889,_0x395f92){return function(_0x513c50){if(!_0x513c50){_0x28e889[_0x5c21('0x26')](0x194);}return _0x513c50;};}function handleError(_0x38cc7a,_0x320ede){_0x320ede=_0x320ede||0x1f4;return function(_0x201764){logger[_0x5c21('0x21')](_0x201764[_0x5c21('0x37')]);if(_0x201764[_0x5c21('0x38')]){delete _0x201764[_0x5c21('0x38')];}_0x38cc7a['status'](_0x320ede)[_0x5c21('0x39')](_0x201764);};}exports[_0x5c21('0x3a')]=function(_0x4246df,_0x1b2c90){var _0x46151e={},_0x4fb4d6={},_0x2109b1={'count':0x0,'rows':[]};var _0x2f6da8=_[_0x5c21('0x3b')](db[_0x5c21('0x3c')]['rawAttributes'],function(_0x8fcba6){return{'name':_0x8fcba6[_0x5c21('0x3d')],'type':_0x8fcba6['type'][_0x5c21('0x3e')]};});_0x4fb4d6[_0x5c21('0x3f')]=_[_0x5c21('0x3b')](_0x2f6da8,_0x5c21('0x38'));_0x4fb4d6['query']=_[_0x5c21('0x40')](_0x4246df[_0x5c21('0x41')]);_0x4fb4d6[_0x5c21('0x42')]=_[_0x5c21('0x43')](_0x4fb4d6['model'],_0x4fb4d6[_0x5c21('0x41')]);_0x46151e['attributes']=_[_0x5c21('0x43')](_0x4fb4d6[_0x5c21('0x3f')],qs[_0x5c21('0x44')](_0x4246df[_0x5c21('0x41')][_0x5c21('0x44')]));_0x46151e[_0x5c21('0x45')]=_0x46151e[_0x5c21('0x45')][_0x5c21('0x46')]?_0x46151e[_0x5c21('0x45')]:_0x4fb4d6['model'];if(!_0x4246df[_0x5c21('0x41')]['hasOwnProperty']('nolimit')){_0x46151e[_0x5c21('0x2a')]=qs[_0x5c21('0x2a')](_0x4246df['query'][_0x5c21('0x2a')]);_0x46151e[_0x5c21('0x2c')]=qs['offset'](_0x4246df[_0x5c21('0x41')]['offset']);}_0x46151e[_0x5c21('0x47')]=qs[_0x5c21('0x48')](_0x4246df[_0x5c21('0x41')][_0x5c21('0x48')]);_0x46151e[_0x5c21('0x49')]=qs[_0x5c21('0x42')](_[_0x5c21('0x4a')](_0x4246df[_0x5c21('0x41')],_0x4fb4d6[_0x5c21('0x42')]),_0x2f6da8);if(_0x4246df[_0x5c21('0x41')][_0x5c21('0x4b')]){_0x46151e['where']=_[_0x5c21('0x4c')](_0x46151e[_0x5c21('0x49')],{'$or':_[_0x5c21('0x3b')](_0x2f6da8,function(_0x5ef797){if(_0x5ef797[_0x5c21('0x4d')]!==_0x5c21('0x4e')){var _0x455e4c={};_0x455e4c[_0x5ef797[_0x5c21('0x38')]]={'$like':'%'+_0x4246df[_0x5c21('0x41')][_0x5c21('0x4b')]+'%'};return _0x455e4c;}})});}_0x46151e=_[_0x5c21('0x4c')]({},_0x46151e,_0x4246df[_0x5c21('0x4f')]);var _0x378b2a={'where':_0x46151e['where']};return db[_0x5c21('0x3c')][_0x5c21('0x2b')](_0x378b2a)[_0x5c21('0x1b')](function(_0x2a3f0e){_0x2109b1[_0x5c21('0x2b')]=_0x2a3f0e;if(_0x4246df[_0x5c21('0x41')][_0x5c21('0x50')]){_0x46151e['include']=[{'all':!![]}];}return db[_0x5c21('0x3c')][_0x5c21('0x51')](_0x46151e);})[_0x5c21('0x1b')](function(_0x4ec455){_0x2109b1[_0x5c21('0x52')]=_0x4ec455;return _0x2109b1;})['then'](respondWithFilteredResult(_0x1b2c90,_0x46151e))['catch'](handleError(_0x1b2c90,null));};exports[_0x5c21('0x53')]=function(_0x26ee7f,_0x23ec14){var _0x53a87d={'raw':![],'where':{'id':_0x26ee7f['params']['id']}},_0x579869={};_0x579869[_0x5c21('0x3f')]=_[_0x5c21('0x40')](db[_0x5c21('0x3c')][_0x5c21('0x54')]);_0x579869[_0x5c21('0x41')]=_['keys'](_0x26ee7f[_0x5c21('0x41')]);_0x579869['filters']=_[_0x5c21('0x43')](_0x579869['model'],_0x579869[_0x5c21('0x41')]);_0x53a87d[_0x5c21('0x45')]=_[_0x5c21('0x43')](_0x579869[_0x5c21('0x3f')],qs[_0x5c21('0x44')](_0x26ee7f[_0x5c21('0x41')][_0x5c21('0x44')]));_0x53a87d[_0x5c21('0x45')]=_0x53a87d['attributes'][_0x5c21('0x46')]?_0x53a87d[_0x5c21('0x45')]:_0x579869[_0x5c21('0x3f')];if(_0x26ee7f['query'][_0x5c21('0x50')]){_0x53a87d[_0x5c21('0x55')]=[{'all':!![]}];}_0x53a87d=_[_0x5c21('0x4c')]({},_0x53a87d,_0x26ee7f[_0x5c21('0x4f')]);return db[_0x5c21('0x3c')][_0x5c21('0x56')](_0x53a87d)[_0x5c21('0x1b')](handleEntityNotFound(_0x23ec14,null))['then'](respondWithResult(_0x23ec14,null))[_0x5c21('0x25')](handleError(_0x23ec14,null));};exports[_0x5c21('0x57')]=function(_0x33b0c2,_0x5b2d09,_0x29571f){var _0x2f1307;return db[_0x5c21('0x3c')][_0x5c21('0x57')](_0x33b0c2['body'],{'raw':!![]})[_0x5c21('0x1b')](function(_0x435e4e){_0x2f1307=_0x435e4e;return db[_0x5c21('0x3c')][_0x5c21('0x51')]({'raw':!![]});})[_0x5c21('0x1b')](function(_0x4d660c){var _0xdfec86=fs[_0x5c21('0x58')](path['join'](config[_0x5c21('0x59')],'server/files/templates/context.ejs'),_0x5c21('0x5a'));var _0x82c87a=ejs[_0x5c21('0x5b')](_0xdfec86,{'contexts':_0x4d660c||[]});fs[_0x5c21('0x5c')](_0x5c21('0x5d'),_0x82c87a);})[_0x5c21('0x1b')](function(){return respondWithRpcPromise(_0x5c21('0x5e'),_0x5c21('0x57'),{'module':'chan_sip.so'});})[_0x5c21('0x1b')](function(){var _0x126c1a=_0x33b0c2[_0x5c21('0x5f')][_0x5c21('0x34')]({'plain':!![]});if(!_0x126c1a)throw new Error(_0x5c21('0x60'));if(_0x126c1a['role']==='user'){var _0x369a29=_0x2f1307[_0x5c21('0x34')]({'plain':!![]});return db[_0x5c21('0x61')][_0x5c21('0x56')]({'where':{'name':'Contexts','userProfileId':_0x126c1a[_0x5c21('0x62')]},'raw':!![]})[_0x5c21('0x1b')](function(_0x4b6233){if(_0x4b6233&&_0x4b6233[_0x5c21('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x369a29[_0x5c21('0x38')],'resourceId':_0x369a29['id'],'type':_0x4b6233[_0x5c21('0x38')],'sectionId':_0x4b6233['id']},{})[_0x5c21('0x1b')](function(){return _0x2f1307;});}else{return _0x2f1307;}})[_0x5c21('0x25')](function(_0xf106d5){logger[_0x5c21('0x21')](_0x5c21('0x64'),_0xf106d5);throw _0xf106d5;});}return _0x2f1307;})['then'](respondWithResult(_0x5b2d09,0xc9))[_0x5c21('0x25')](handleError(_0x5b2d09,null));};exports['update']=function(_0x111fe9,_0x448dd6,_0x122cb3){var _0x24ed30;return db[_0x5c21('0x3c')][_0x5c21('0x56')]({'where':{'id':_0x111fe9['params']['id']}})['then'](handleEntityNotFound(_0x448dd6,null))[_0x5c21('0x1b')](saveUpdates(_0x111fe9[_0x5c21('0x65')],null))[_0x5c21('0x1b')](function(_0x1cfa5e){if(_0x1cfa5e){_0x24ed30=_0x1cfa5e;return db[_0x5c21('0x3c')]['findAll']({'raw':!![]});}})[_0x5c21('0x1b')](function(_0x46ecd4){var _0x85498=fs[_0x5c21('0x58')](path[_0x5c21('0x66')](config['root'],_0x5c21('0x67')),_0x5c21('0x5a'));var _0x480936=ejs[_0x5c21('0x5b')](_0x85498,{'contexts':_0x46ecd4||[]});fs[_0x5c21('0x5c')](_0x5c21('0x5d'),_0x480936);})[_0x5c21('0x1b')](function(){return respondWithRpcPromise(_0x5c21('0x5e'),_0x5c21('0x32'),{'module':_0x5c21('0x68')});})[_0x5c21('0x1b')](function(){return _0x24ed30;})['then'](respondWithResult(_0x448dd6,null))[_0x5c21('0x25')](handleError(_0x448dd6,null));};exports[_0x5c21('0x33')]=function(_0x342d8d,_0x2f48bb,_0x20ae34){var _0x46a08b;return db[_0x5c21('0x3c')][_0x5c21('0x56')]({'where':{'id':_0x342d8d[_0x5c21('0x69')]['id']}})[_0x5c21('0x1b')](handleEntityNotFound(_0x2f48bb,null))[_0x5c21('0x1b')](removeEntity(_0x2f48bb,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x1d568f){var _0x2bfe38=fs[_0x5c21('0x58')](path[_0x5c21('0x66')](config['root'],_0x5c21('0x67')),_0x5c21('0x5a'));var _0x2cc791=ejs[_0x5c21('0x5b')](_0x2bfe38,{'contexts':_0x1d568f});fs[_0x5c21('0x5c')](_0x5c21('0x5d'),_0x2cc791);return respondWithRpcPromise(_0x5c21('0x5e'),_0x5c21('0x33'),{'module':_0x5c21('0x68')});})[_0x5c21('0x25')](handleError(_0x2f48bb,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index c7542d7..0f99f5a 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 _0x91d3=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util'];(function(_0x26328b,_0xf07ddc){var _0x1dc1cd=function(_0x4ace1c){while(--_0x4ace1c){_0x26328b['push'](_0x26328b['shift']());}};_0x1dc1cd(++_0xf07ddc);}(_0x91d3,0x113));var _0x391d=function(_0x3ab342,_0x50a50b){_0x3ab342=_0x3ab342-0x0;var _0x2a3b0d=_0x91d3[_0x3ab342];return _0x2a3b0d;};'use strict';var _=require('lodash');var util=require(_0x391d('0x0'));var logger=require(_0x391d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x391d('0x2'));var rp=require(_0x391d('0x3'));var fs=require('fs');var path=require(_0x391d('0x4'));var rimraf=require(_0x391d('0x5'));var config=require(_0x391d('0x6'));var attributes=require(_0x391d('0x7'));module[_0x391d('0x8')]=function(_0x16101f,_0x13fe66){return _0x16101f[_0x391d('0x9')](_0x391d('0xa'),attributes,{'tableName':_0x391d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a3e=['voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./voiceContext.attributes','VoiceContext'];(function(_0x462da6,_0x515fa3){var _0x21580d=function(_0xc9d2fd){while(--_0xc9d2fd){_0x462da6['push'](_0x462da6['shift']());}};_0x21580d(++_0x515fa3);}(_0x0a3e,0x79));var _0xe0a3=function(_0xee9801,_0xea781f){_0xee9801=_0xee9801-0x0;var _0x21f88a=_0x0a3e[_0xee9801];return _0x21f88a;};'use strict';var _=require(_0xe0a3('0x0'));var util=require('util');var logger=require(_0xe0a3('0x1'))(_0xe0a3('0x2'));var moment=require(_0xe0a3('0x3'));var BPromise=require(_0xe0a3('0x4'));var rp=require(_0xe0a3('0x5'));var fs=require('fs');var path=require(_0xe0a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe0a3('0x7'));module['exports']=function(_0x4745d9,_0x56c082){return _0x4745d9['define'](_0xe0a3('0x8'),attributes,{'tableName':_0xe0a3('0x9'),'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 9d96796..1cbe0e5 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 _0x4e65=['request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s'];(function(_0x231202,_0x16f687){var _0x11968e=function(_0x29eab2){while(--_0x29eab2){_0x231202['push'](_0x231202['shift']());}};_0x11968e(++_0x16f687);}(_0x4e65,0xc4));var _0x54e6=function(_0x48d7ce,_0x205566){_0x48d7ce=_0x48d7ce-0x0;var _0x3ee5d6=_0x4e65[_0x48d7ce];return _0x3ee5d6;};'use strict';var _=require('lodash');var util=require(_0x54e6('0x0'));var moment=require(_0x54e6('0x1'));var BPromise=require(_0x54e6('0x2'));var rs=require(_0x54e6('0x3'));var fs=require('fs');var Redis=require(_0x54e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x54e6('0x5'))(_0x54e6('0x6'));var config=require(_0x54e6('0x7'));var jayson=require(_0x54e6('0x8'));var client=jayson[_0x54e6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c9f97,_0x5d437f,_0x256560){return new BPromise(function(_0x1a2191,_0x2bf501){return client[_0x54e6('0xa')](_0x3c9f97,_0x256560)['then'](function(_0x2aa46c){logger[_0x54e6('0xb')](_0x54e6('0xc'),_0x5d437f,_0x54e6('0xd'));logger[_0x54e6('0xe')](_0x54e6('0xf'),_0x5d437f,'request\x20sent',JSON[_0x54e6('0x10')](_0x2aa46c));if(_0x2aa46c['error']){if(_0x2aa46c[_0x54e6('0x11')]['code']===0x1f4){logger[_0x54e6('0x11')](_0x54e6('0xc'),_0x5d437f,_0x2aa46c['error'][_0x54e6('0x12')]);return _0x2bf501(_0x2aa46c['error'][_0x54e6('0x12')]);}logger[_0x54e6('0x11')](_0x54e6('0xc'),_0x5d437f,_0x2aa46c[_0x54e6('0x11')][_0x54e6('0x12')]);return _0x1a2191(_0x2aa46c[_0x54e6('0x11')]['message']);}else{logger[_0x54e6('0xb')](_0x54e6('0xc'),_0x5d437f,_0x54e6('0xd'));_0x1a2191(_0x2aa46c['result']['message']);}})['catch'](function(_0x43e643){logger[_0x54e6('0x11')]('VoiceContext,\x20%s,\x20%s',_0x5d437f,_0x43e643);_0x2bf501(_0x43e643);});});} \ No newline at end of file +var _0xf1f9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x874b3e,_0x5beddc){var _0x34580a=function(_0x3faa76){while(--_0x3faa76){_0x874b3e['push'](_0x874b3e['shift']());}};_0x34580a(++_0x5beddc);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x4511b1,_0x45a31c){_0x4511b1=_0x4511b1-0x0;var _0x38fec=_0xf1f9[_0x4511b1];return _0x38fec;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a512aef..c044c27 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 _0x9cff=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','util','path','connect-timeout','Router','fs-extra'];(function(_0x49795f,_0x1f7f56){var _0x297ce1=function(_0x1ed926){while(--_0x1ed926){_0x49795f['push'](_0x49795f['shift']());}};_0x297ce1(++_0x1f7f56);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x5f122a,_0x15d1a3){_0x5f122a=_0x5f122a-0x0;var _0x48dd77=_0x9cff[_0x5f122a];return _0x48dd77;};'use strict';var multer=require('multer');var util=require(_0xf9cf('0x0'));var path=require(_0xf9cf('0x1'));var timeout=require(_0xf9cf('0x2'));var express=require('express');var router=express[_0xf9cf('0x3')]();var fs_extra=require(_0xf9cf('0x4'));var auth=require(_0xf9cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x6'));var controller=require(_0xf9cf('0x7'));router[_0xf9cf('0x8')]('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0x8')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0x8')](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0xe')]);router[_0xf9cf('0xf')]('/',auth['isAuthenticated'](),controller[_0xf9cf('0x10')]);router['put']('/:id',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0x11')]);router['delete'](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0439=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','/describe','get','show','create','put','update','delete','destroy'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0x0439,0xdd));var _0x9043=function(_0x46a7ab,_0x39f289){_0x46a7ab=_0x46a7ab-0x0;var _0x1b8196=_0x0439[_0x46a7ab];return _0x1b8196;};'use strict';var multer=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var path=require(_0x9043('0x2'));var timeout=require(_0x9043('0x3'));var express=require(_0x9043('0x4'));var router=express[_0x9043('0x5')]();var fs_extra=require(_0x9043('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9043('0x7'));var config=require(_0x9043('0x8'));var controller=require(_0x9043('0x9'));router['get']('/',auth[_0x9043('0xa')](),controller['index']);router['get'](_0x9043('0xb'),auth[_0x9043('0xa')](),controller['describe']);router[_0x9043('0xc')]('/:id',auth[_0x9043('0xa')](),controller[_0x9043('0xd')]);router['post']('/',auth[_0x9043('0xa')](),controller[_0x9043('0xe')]);router[_0x9043('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9043('0x10')]);router[_0x9043('0x11')]('/:id',auth[_0x9043('0xa')](),controller[_0x9043('0x12')]);module[_0x9043('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 68cab80..8188894 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 _0x34e8=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0xf77a5,_0x1f23e8){var _0x5eda71=function(_0x4a43a0){while(--_0x4a43a0){_0xf77a5['push'](_0xf77a5['shift']());}};_0x5eda71(++_0x1f23e8);}(_0x34e8,0x12c));var _0x834e=function(_0x2dd575,_0x347aa6){_0x2dd575=_0x2dd575-0x0;var _0x436321=_0x34e8[_0x2dd575];return _0x436321;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'privilege':{'type':Sequelize[_0x834e('0x2')]},'channel':{'type':Sequelize[_0x834e('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'calleridnum':{'type':Sequelize[_0x834e('0x2')]},'calleridname':{'type':Sequelize[_0x834e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'connectedlinename':{'type':Sequelize[_0x834e('0x2')]},'language':{'type':Sequelize[_0x834e('0x2')]},'accountcode':{'type':Sequelize[_0x834e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x834e('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x834e('0x2')]},'linkedid':{'type':Sequelize[_0x834e('0x2')]},'destchannel':{'type':Sequelize[_0x834e('0x2')]},'destchannelstate':{'type':Sequelize[_0x834e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x834e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x834e('0x2')]},'destcalleridname':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x834e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x834e('0x2')]},'destlanguage':{'type':Sequelize[_0x834e('0x2')]},'destaccountcode':{'type':Sequelize[_0x834e('0x2')]},'destcontext':{'type':Sequelize[_0x834e('0x2')]},'destexten':{'type':Sequelize[_0x834e('0x2')]},'destpriority':{'type':Sequelize[_0x834e('0x3')]},'destuniqueid':{'type':Sequelize[_0x834e('0x2')]},'destlinkedid':{'type':Sequelize[_0x834e('0x2')]},'dialstring':{'type':Sequelize[_0x834e('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x834e('0x4')]},'answertime':{'type':Sequelize[_0x834e('0x4')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x834e('0x2')],'comment':_0x834e('0x5')},'routeId':{'type':Sequelize[_0x834e('0x3')]},'duration':{'type':Sequelize[_0x834e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x834e('0x3')]}}; \ No newline at end of file +var _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xe14d,0x1ee));var _0xde14=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0xe14d[_0x20c9b2];return _0x2c6030;};'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 e7cd1c4..8377623 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 _0xc32e=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','apply','reject','save','update','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','VoiceDialReport','then','includeAll','include','rows','catch','show','params','keys','find','create','body','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc32e,0x196));var _0xec32=function(_0x5c5d8d,_0x50b216){_0x5c5d8d=_0x5c5d8d-0x0;var _0x423521=_0xc32e[_0x5c5d8d];return _0x423521;};'use strict';var emlformat=require(_0xec32('0x0'));var rimraf=require(_0xec32('0x1'));var zipdir=require(_0xec32('0x2'));var jsonpatch=require(_0xec32('0x3'));var rp=require(_0xec32('0x4'));var moment=require(_0xec32('0x5'));var BPromise=require(_0xec32('0x6'));var Mustache=require(_0xec32('0x7'));var util=require(_0xec32('0x8'));var path=require(_0xec32('0x9'));var sox=require(_0xec32('0xa'));var csv=require(_0xec32('0xb'));var ejs=require(_0xec32('0xc'));var fs=require('fs');var fs_extra=require(_0xec32('0xd'));var _=require('lodash');var squel=require(_0xec32('0xe'));var crypto=require('crypto');var jsforce=require(_0xec32('0xf'));var deskjs=require(_0xec32('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec32('0x11'));var Redis=require(_0xec32('0x12'));var authService=require(_0xec32('0x13'));var qs=require(_0xec32('0x14'));var as=require(_0xec32('0x15'));var hardwareService=require(_0xec32('0x16'));var logger=require(_0xec32('0x17'))(_0xec32('0x18'));var utils=require(_0xec32('0x19'));var config=require(_0xec32('0x1a'));var licenseUtil=require(_0xec32('0x1b'));var db=require(_0xec32('0x1c'))['db'];function respondWithStatusCode(_0x2b3797,_0x1019af){_0x1019af=_0x1019af||0xcc;return function(_0x8bbf86){if(_0x8bbf86){return _0x2b3797[_0xec32('0x1d')](_0x1019af);}return _0x2b3797['status'](_0x1019af)[_0xec32('0x1e')]();};}function respondWithResult(_0xa10031,_0x2aa86a){_0x2aa86a=_0x2aa86a||0xc8;return function(_0x1eaeb5){if(_0x1eaeb5){return _0xa10031[_0xec32('0x1f')](_0x2aa86a)[_0xec32('0x20')](_0x1eaeb5);}};}function respondWithFilteredResult(_0x8c49db,_0x5973dc){return function(_0x36b9b3){if(_0x36b9b3){var _0x1f02f9=typeof _0x5973dc['offset']===_0xec32('0x21')&&typeof _0x5973dc[_0xec32('0x22')]===_0xec32('0x21');var _0x53f9ef=_0x36b9b3[_0xec32('0x23')];var _0x58b471=_0x1f02f9?0x0:_0x5973dc[_0xec32('0x24')];var _0x7783d2=_0x1f02f9?_0x36b9b3[_0xec32('0x23')]:_0x5973dc[_0xec32('0x24')]+_0x5973dc[_0xec32('0x22')];var _0x2bd452;if(_0x7783d2>=_0x53f9ef){_0x7783d2=_0x53f9ef;_0x2bd452=0xc8;}else{_0x2bd452=0xce;}_0x8c49db[_0xec32('0x1f')](_0x2bd452);return _0x8c49db['set']('Content-Range',_0x58b471+'-'+_0x7783d2+'/'+_0x53f9ef)['json'](_0x36b9b3);}return null;};}function patchUpdates(_0x5cea1f){return function(_0x183339){try{jsonpatch[_0xec32('0x25')](_0x183339,_0x5cea1f,!![]);}catch(_0x5d4808){return BPromise[_0xec32('0x26')](_0x5d4808);}return _0x183339[_0xec32('0x27')]();};}function saveUpdates(_0x55e41d,_0x1a00c8){return function(_0x327040){if(_0x327040){return _0x327040[_0xec32('0x28')](_0x55e41d)['then'](function(_0x2b4b5a){return _0x2b4b5a;});}return null;};}function removeEntity(_0x332ce1,_0x5777fc){return function(_0x1cd3e2){if(_0x1cd3e2){return _0x1cd3e2['destroy']()['then'](function(){_0x332ce1[_0xec32('0x1f')](0xcc)[_0xec32('0x1e')]();});}};}function handleEntityNotFound(_0x2a1ef8,_0x52522a){return function(_0x13c052){if(!_0x13c052){_0x2a1ef8[_0xec32('0x1d')](0x194);}return _0x13c052;};}function handleError(_0x1308d2,_0x55cbc8){_0x55cbc8=_0x55cbc8||0x1f4;return function(_0x4be645){logger[_0xec32('0x29')](_0x4be645[_0xec32('0x2a')]);if(_0x4be645[_0xec32('0x2b')]){delete _0x4be645[_0xec32('0x2b')];}_0x1308d2[_0xec32('0x1f')](_0x55cbc8)[_0xec32('0x2c')](_0x4be645);};}exports[_0xec32('0x2d')]=function(_0x36ca7a,_0x39e6f8){var _0xf595dc={},_0x1186ed={},_0x159af4={'count':0x0,'rows':[]};var _0xc9a1ee=_[_0xec32('0x2e')](db['VoiceDialReport'][_0xec32('0x2f')],function(_0x1d7238){return{'name':_0x1d7238[_0xec32('0x30')],'type':_0x1d7238['type'][_0xec32('0x31')]};});_0x1186ed[_0xec32('0x32')]=_[_0xec32('0x2e')](_0xc9a1ee,_0xec32('0x2b'));_0x1186ed[_0xec32('0x33')]=_['keys'](_0x36ca7a['query']);_0x1186ed['filters']=_[_0xec32('0x34')](_0x1186ed[_0xec32('0x32')],_0x1186ed[_0xec32('0x33')]);_0xf595dc['attributes']=_[_0xec32('0x34')](_0x1186ed[_0xec32('0x32')],qs[_0xec32('0x35')](_0x36ca7a[_0xec32('0x33')][_0xec32('0x35')]));_0xf595dc[_0xec32('0x36')]=_0xf595dc[_0xec32('0x36')][_0xec32('0x37')]?_0xf595dc[_0xec32('0x36')]:_0x1186ed[_0xec32('0x32')];if(!_0x36ca7a[_0xec32('0x33')]['hasOwnProperty'](_0xec32('0x38'))){_0xf595dc[_0xec32('0x22')]=qs[_0xec32('0x22')](_0x36ca7a[_0xec32('0x33')][_0xec32('0x22')]);_0xf595dc['offset']=qs['offset'](_0x36ca7a[_0xec32('0x33')]['offset']);}_0xf595dc[_0xec32('0x39')]=qs[_0xec32('0x3a')](_0x36ca7a[_0xec32('0x33')][_0xec32('0x3a')]);_0xf595dc[_0xec32('0x3b')]=qs[_0xec32('0x3c')](_[_0xec32('0x3d')](_0x36ca7a['query'],_0x1186ed[_0xec32('0x3c')]),_0xc9a1ee);if(_0x36ca7a['query']['filter']){_0xf595dc['where']=_[_0xec32('0x3e')](_0xf595dc['where'],{'$or':_['map'](_0xc9a1ee,function(_0x187f80){if(_0x187f80[_0xec32('0x3f')]!==_0xec32('0x40')){var _0x12590a={};_0x12590a[_0x187f80[_0xec32('0x2b')]]={'$like':'%'+_0x36ca7a[_0xec32('0x33')][_0xec32('0x41')]+'%'};return _0x12590a;}})});}_0xf595dc=_['merge']({},_0xf595dc,_0x36ca7a[_0xec32('0x42')]);var _0x17233f={'where':_0xf595dc[_0xec32('0x3b')]};return db[_0xec32('0x43')]['count'](_0x17233f)[_0xec32('0x44')](function(_0x52ef81){_0x159af4[_0xec32('0x23')]=_0x52ef81;if(_0x36ca7a[_0xec32('0x33')][_0xec32('0x45')]){_0xf595dc[_0xec32('0x46')]=[{'all':!![]}];}return db[_0xec32('0x43')]['findAll'](_0xf595dc);})[_0xec32('0x44')](function(_0x5cb344){_0x159af4[_0xec32('0x47')]=_0x5cb344;return _0x159af4;})['then'](respondWithFilteredResult(_0x39e6f8,_0xf595dc))[_0xec32('0x48')](handleError(_0x39e6f8,null));};exports[_0xec32('0x49')]=function(_0x28f64f,_0x189882){var _0x169a35={'raw':!![],'where':{'id':_0x28f64f[_0xec32('0x4a')]['id']}},_0x320445={};_0x320445[_0xec32('0x32')]=_['keys'](db[_0xec32('0x43')][_0xec32('0x2f')]);_0x320445[_0xec32('0x33')]=_[_0xec32('0x4b')](_0x28f64f[_0xec32('0x33')]);_0x320445[_0xec32('0x3c')]=_['intersection'](_0x320445[_0xec32('0x32')],_0x320445[_0xec32('0x33')]);_0x169a35[_0xec32('0x36')]=_[_0xec32('0x34')](_0x320445[_0xec32('0x32')],qs[_0xec32('0x35')](_0x28f64f[_0xec32('0x33')]['fields']));_0x169a35[_0xec32('0x36')]=_0x169a35[_0xec32('0x36')][_0xec32('0x37')]?_0x169a35[_0xec32('0x36')]:_0x320445['model'];if(_0x28f64f['query'][_0xec32('0x45')]){_0x169a35[_0xec32('0x46')]=[{'all':!![]}];}_0x169a35=_['merge']({},_0x169a35,_0x28f64f[_0xec32('0x42')]);return db[_0xec32('0x43')][_0xec32('0x4c')](_0x169a35)[_0xec32('0x44')](handleEntityNotFound(_0x189882,null))[_0xec32('0x44')](respondWithResult(_0x189882,null))['catch'](handleError(_0x189882,null));};exports['create']=function(_0x18f6eb,_0x47e4fe){return db[_0xec32('0x43')][_0xec32('0x4d')](_0x18f6eb[_0xec32('0x4e')],{})[_0xec32('0x44')](respondWithResult(_0x47e4fe,0xc9))[_0xec32('0x48')](handleError(_0x47e4fe,null));};exports['update']=function(_0x48d818,_0x16facf){if(_0x48d818['body']['id']){delete _0x48d818[_0xec32('0x4e')]['id'];}return db[_0xec32('0x43')][_0xec32('0x4c')]({'where':{'id':_0x48d818[_0xec32('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16facf,null))[_0xec32('0x44')](saveUpdates(_0x48d818[_0xec32('0x4e')],null))['then'](respondWithResult(_0x16facf,null))[_0xec32('0x48')](handleError(_0x16facf,null));};exports[_0xec32('0x4f')]=function(_0x581eb4,_0x343c89){return db[_0xec32('0x43')][_0xec32('0x4c')]({'where':{'id':_0x581eb4[_0xec32('0x4a')]['id']}})['then'](handleEntityNotFound(_0x343c89,null))[_0xec32('0x44')](removeEntity(_0x343c89,null))[_0xec32('0x48')](handleError(_0x343c89,null));};exports[_0xec32('0x50')]=function(_0x55b603,_0x1ee3ca){return db[_0xec32('0x43')][_0xec32('0x50')]()[_0xec32('0x44')](respondWithResult(_0x1ee3ca,null))[_0xec32('0x48')](handleError(_0x1ee3ca,null));}; \ No newline at end of file +var _0x6b0d=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus'];(function(_0x2e353f,_0x15d70a){var _0x4b0700=function(_0x2140ee){while(--_0x2140ee){_0x2e353f['push'](_0x2e353f['shift']());}};_0x4b0700(++_0x15d70a);}(_0x6b0d,0x107));var _0xd6b0=function(_0x2f51bf,_0x5b0b7d){_0x2f51bf=_0x2f51bf-0x0;var _0x587c13=_0x6b0d[_0x2f51bf];return _0x587c13;};'use strict';var emlformat=require(_0xd6b0('0x0'));var rimraf=require(_0xd6b0('0x1'));var zipdir=require(_0xd6b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6b0('0x3'));var moment=require(_0xd6b0('0x4'));var BPromise=require(_0xd6b0('0x5'));var Mustache=require(_0xd6b0('0x6'));var util=require('util');var path=require(_0xd6b0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd6b0('0x8'));var fs=require('fs');var fs_extra=require(_0xd6b0('0x9'));var _=require(_0xd6b0('0xa'));var squel=require('squel');var crypto=require(_0xd6b0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd6b0('0xc'));var toCsv=require(_0xd6b0('0xd'));var querystring=require(_0xd6b0('0xe'));var Papa=require('papaparse');var Redis=require(_0xd6b0('0xf'));var authService=require(_0xd6b0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6b0('0x11'))(_0xd6b0('0x12'));var utils=require(_0xd6b0('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58df7a,_0x1feac0){_0x1feac0=_0x1feac0||0xcc;return function(_0x4881a7){if(_0x4881a7){return _0x58df7a[_0xd6b0('0x14')](_0x1feac0);}return _0x58df7a['status'](_0x1feac0)[_0xd6b0('0x15')]();};}function respondWithResult(_0x10718a,_0x516e1f){_0x516e1f=_0x516e1f||0xc8;return function(_0x19cd03){if(_0x19cd03){return _0x10718a['status'](_0x516e1f)[_0xd6b0('0x16')](_0x19cd03);}};}function respondWithFilteredResult(_0x2e1524,_0x1d1371){return function(_0x41f7f9){if(_0x41f7f9){var _0x56f5e2=typeof _0x1d1371[_0xd6b0('0x17')]===_0xd6b0('0x18')&&typeof _0x1d1371[_0xd6b0('0x19')]===_0xd6b0('0x18');var _0x17f053=_0x41f7f9['count'];var _0xdd406d=_0x56f5e2?0x0:_0x1d1371['offset'];var _0x432a41=_0x56f5e2?_0x41f7f9[_0xd6b0('0x1a')]:_0x1d1371[_0xd6b0('0x17')]+_0x1d1371[_0xd6b0('0x19')];var _0x36e26d;if(_0x432a41>=_0x17f053){_0x432a41=_0x17f053;_0x36e26d=0xc8;}else{_0x36e26d=0xce;}_0x2e1524[_0xd6b0('0x1b')](_0x36e26d);return _0x2e1524[_0xd6b0('0x1c')](_0xd6b0('0x1d'),_0xdd406d+'-'+_0x432a41+'/'+_0x17f053)['json'](_0x41f7f9);}return null;};}function patchUpdates(_0x45a1bb){return function(_0x28614d){try{jsonpatch[_0xd6b0('0x1e')](_0x28614d,_0x45a1bb,!![]);}catch(_0x428651){return BPromise[_0xd6b0('0x1f')](_0x428651);}return _0x28614d[_0xd6b0('0x20')]();};}function saveUpdates(_0x3d225e,_0x11c79d){return function(_0x1f3adc){if(_0x1f3adc){return _0x1f3adc[_0xd6b0('0x21')](_0x3d225e)[_0xd6b0('0x22')](function(_0x2856d5){return _0x2856d5;});}return null;};}function removeEntity(_0x5931de,_0x4acf57){return function(_0x526abc){if(_0x526abc){return _0x526abc[_0xd6b0('0x23')]()[_0xd6b0('0x22')](function(){_0x5931de[_0xd6b0('0x1b')](0xcc)[_0xd6b0('0x15')]();});}};}function handleEntityNotFound(_0x4a2997,_0x917202){return function(_0x2bafa0){if(!_0x2bafa0){_0x4a2997[_0xd6b0('0x14')](0x194);}return _0x2bafa0;};}function handleError(_0x59adcb,_0x4bb6f7){_0x4bb6f7=_0x4bb6f7||0x1f4;return function(_0x4dce6f){logger[_0xd6b0('0x24')](_0x4dce6f['stack']);if(_0x4dce6f[_0xd6b0('0x25')]){delete _0x4dce6f[_0xd6b0('0x25')];}_0x59adcb[_0xd6b0('0x1b')](_0x4bb6f7)['send'](_0x4dce6f);};}exports[_0xd6b0('0x26')]=function(_0x17c7ac,_0x2480c5){var _0x3ff71c={},_0xb677cb={},_0x15de40={'count':0x0,'rows':[]};var _0xcd01b=_[_0xd6b0('0x27')](db[_0xd6b0('0x28')]['rawAttributes'],function(_0x48d397){return{'name':_0x48d397[_0xd6b0('0x29')],'type':_0x48d397[_0xd6b0('0x2a')][_0xd6b0('0x2b')]};});_0xb677cb[_0xd6b0('0x2c')]=_['map'](_0xcd01b,_0xd6b0('0x25'));_0xb677cb[_0xd6b0('0x2d')]=_[_0xd6b0('0x2e')](_0x17c7ac[_0xd6b0('0x2d')]);_0xb677cb[_0xd6b0('0x2f')]=_[_0xd6b0('0x30')](_0xb677cb[_0xd6b0('0x2c')],_0xb677cb[_0xd6b0('0x2d')]);_0x3ff71c['attributes']=_[_0xd6b0('0x30')](_0xb677cb[_0xd6b0('0x2c')],qs[_0xd6b0('0x31')](_0x17c7ac[_0xd6b0('0x2d')]['fields']));_0x3ff71c[_0xd6b0('0x32')]=_0x3ff71c['attributes'][_0xd6b0('0x33')]?_0x3ff71c['attributes']:_0xb677cb[_0xd6b0('0x2c')];if(!_0x17c7ac[_0xd6b0('0x2d')]['hasOwnProperty'](_0xd6b0('0x34'))){_0x3ff71c[_0xd6b0('0x19')]=qs['limit'](_0x17c7ac[_0xd6b0('0x2d')][_0xd6b0('0x19')]);_0x3ff71c['offset']=qs['offset'](_0x17c7ac['query']['offset']);}_0x3ff71c['order']=qs[_0xd6b0('0x35')](_0x17c7ac[_0xd6b0('0x2d')][_0xd6b0('0x35')]);_0x3ff71c[_0xd6b0('0x36')]=qs[_0xd6b0('0x2f')](_[_0xd6b0('0x37')](_0x17c7ac['query'],_0xb677cb[_0xd6b0('0x2f')]),_0xcd01b);if(_0x17c7ac[_0xd6b0('0x2d')][_0xd6b0('0x38')]){_0x3ff71c['where']=_[_0xd6b0('0x39')](_0x3ff71c[_0xd6b0('0x36')],{'$or':_['map'](_0xcd01b,function(_0x5113c4){if(_0x5113c4[_0xd6b0('0x2a')]!=='VIRTUAL'){var _0x1277a1={};_0x1277a1[_0x5113c4[_0xd6b0('0x25')]]={'$like':'%'+_0x17c7ac['query'][_0xd6b0('0x38')]+'%'};return _0x1277a1;}})});}_0x3ff71c=_[_0xd6b0('0x39')]({},_0x3ff71c,_0x17c7ac[_0xd6b0('0x3a')]);var _0x304854={'where':_0x3ff71c[_0xd6b0('0x36')]};return db[_0xd6b0('0x28')][_0xd6b0('0x1a')](_0x304854)[_0xd6b0('0x22')](function(_0x18752b){_0x15de40[_0xd6b0('0x1a')]=_0x18752b;if(_0x17c7ac[_0xd6b0('0x2d')][_0xd6b0('0x3b')]){_0x3ff71c[_0xd6b0('0x3c')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xd6b0('0x3d')](_0x3ff71c);})['then'](function(_0x1ec041){_0x15de40[_0xd6b0('0x3e')]=_0x1ec041;return _0x15de40;})[_0xd6b0('0x22')](respondWithFilteredResult(_0x2480c5,_0x3ff71c))[_0xd6b0('0x3f')](handleError(_0x2480c5,null));};exports[_0xd6b0('0x40')]=function(_0x241efd,_0xc00c1d){var _0x4862a7={'raw':!![],'where':{'id':_0x241efd[_0xd6b0('0x41')]['id']}},_0x2d024d={};_0x2d024d[_0xd6b0('0x2c')]=_[_0xd6b0('0x2e')](db[_0xd6b0('0x28')][_0xd6b0('0x42')]);_0x2d024d[_0xd6b0('0x2d')]=_[_0xd6b0('0x2e')](_0x241efd[_0xd6b0('0x2d')]);_0x2d024d[_0xd6b0('0x2f')]=_[_0xd6b0('0x30')](_0x2d024d[_0xd6b0('0x2c')],_0x2d024d[_0xd6b0('0x2d')]);_0x4862a7[_0xd6b0('0x32')]=_[_0xd6b0('0x30')](_0x2d024d['model'],qs['fields'](_0x241efd[_0xd6b0('0x2d')]['fields']));_0x4862a7[_0xd6b0('0x32')]=_0x4862a7['attributes'][_0xd6b0('0x33')]?_0x4862a7['attributes']:_0x2d024d[_0xd6b0('0x2c')];if(_0x241efd['query'][_0xd6b0('0x3b')]){_0x4862a7[_0xd6b0('0x3c')]=[{'all':!![]}];}_0x4862a7=_['merge']({},_0x4862a7,_0x241efd[_0xd6b0('0x3a')]);return db['VoiceDialReport'][_0xd6b0('0x43')](_0x4862a7)[_0xd6b0('0x22')](handleEntityNotFound(_0xc00c1d,null))[_0xd6b0('0x22')](respondWithResult(_0xc00c1d,null))[_0xd6b0('0x3f')](handleError(_0xc00c1d,null));};exports['create']=function(_0x1895e9,_0xc186b2){return db[_0xd6b0('0x28')][_0xd6b0('0x44')](_0x1895e9[_0xd6b0('0x45')],{})[_0xd6b0('0x22')](respondWithResult(_0xc186b2,0xc9))[_0xd6b0('0x3f')](handleError(_0xc186b2,null));};exports[_0xd6b0('0x21')]=function(_0x5bec7d,_0x1fcf1c){if(_0x5bec7d[_0xd6b0('0x45')]['id']){delete _0x5bec7d[_0xd6b0('0x45')]['id'];}return db['VoiceDialReport'][_0xd6b0('0x43')]({'where':{'id':_0x5bec7d['params']['id']}})[_0xd6b0('0x22')](handleEntityNotFound(_0x1fcf1c,null))['then'](saveUpdates(_0x5bec7d[_0xd6b0('0x45')],null))[_0xd6b0('0x22')](respondWithResult(_0x1fcf1c,null))[_0xd6b0('0x3f')](handleError(_0x1fcf1c,null));};exports[_0xd6b0('0x23')]=function(_0x12cbe1,_0x3c4c4c){return db[_0xd6b0('0x28')][_0xd6b0('0x43')]({'where':{'id':_0x12cbe1['params']['id']}})['then'](handleEntityNotFound(_0x3c4c4c,null))[_0xd6b0('0x22')](removeEntity(_0x3c4c4c,null))['catch'](handleError(_0x3c4c4c,null));};exports[_0xd6b0('0x46')]=function(_0x2d99b6,_0x5b8f53){return db[_0xd6b0('0x28')][_0xd6b0('0x46')]()[_0xd6b0('0x22')](respondWithResult(_0x5b8f53,null))[_0xd6b0('0x3f')](handleError(_0x5b8f53,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 41288f3..cf3c987 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 _0x4b68=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_dial','uniqueid','lodash','util'];(function(_0x48736b,_0x15ab78){var _0x144d7f=function(_0x34e2eb){while(--_0x34e2eb){_0x48736b['push'](_0x48736b['shift']());}};_0x144d7f(++_0x15ab78);}(_0x4b68,0x129));var _0x84b6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4b68[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var logger=require(_0x84b6('0x2'))(_0x84b6('0x3'));var moment=require(_0x84b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x84b6('0x5'));var fs=require('fs');var path=require(_0x84b6('0x6'));var rimraf=require(_0x84b6('0x7'));var config=require(_0x84b6('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x84b6('0x9')]=function(_0x2a0007,_0x539956){return _0x2a0007[_0x84b6('0xa')]('VoiceDialReport',attributes,{'tableName':_0x84b6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x84b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6efc=['request-promise','rimraf','./voiceDialReport.attributes','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x597ad8,_0x445297){var _0x121515=function(_0x36f992){while(--_0x36f992){_0x597ad8['push'](_0x597ad8['shift']());}};_0x121515(++_0x445297);}(_0x6efc,0xec));var _0xc6ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6efc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc6ef('0x0'));var util=require(_0xc6ef('0x1'));var logger=require(_0xc6ef('0x2'))(_0xc6ef('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6ef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6ef('0x5'));var config=require('../../config/environment');var attributes=require(_0xc6ef('0x6'));module['exports']=function(_0x3f0506,_0x315b00){return _0x3f0506[_0xc6ef('0x7')](_0xc6ef('0x8'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xc6ef('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index ce59a93..f2924d1 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 _0x7f57=['code','message','VoiceDialReport,\x20%s,\x20%s','info','CreateVoiceDialReport','create','options','raw','catch','UpdateVoiceDialReport','VoiceDialReport','update','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57e331,_0x335f51){var _0x407f52=function(_0x2cf0f){while(--_0x2cf0f){_0x57e331['push'](_0x57e331['shift']());}};_0x407f52(++_0x335f51);}(_0x7f57,0x12e));var _0x77f5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7f57[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x77f5('0x0'));var moment=require(_0x77f5('0x1'));var BPromise=require('bluebird');var rs=require(_0x77f5('0x2'));var fs=require('fs');var Redis=require(_0x77f5('0x3'));var db=require(_0x77f5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x77f5('0x5'))(_0x77f5('0x6'));var config=require(_0x77f5('0x7'));var jayson=require(_0x77f5('0x8'));var client=jayson[_0x77f5('0x9')][_0x77f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b40ae,_0x11795f,_0x1d3999){return new BPromise(function(_0x28e0ef,_0x38d4c3){return client[_0x77f5('0xb')](_0x1b40ae,_0x1d3999)[_0x77f5('0xc')](function(_0x4e1b97){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x11795f,_0x77f5('0xd'));logger[_0x77f5('0xe')](_0x77f5('0xf'),_0x11795f,_0x77f5('0xd'),JSON[_0x77f5('0x10')](_0x4e1b97));if(_0x4e1b97[_0x77f5('0x11')]){if(_0x4e1b97['error'][_0x77f5('0x12')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x11795f,_0x4e1b97[_0x77f5('0x11')][_0x77f5('0x13')]);return _0x38d4c3(_0x4e1b97[_0x77f5('0x11')][_0x77f5('0x13')]);}logger[_0x77f5('0x11')](_0x77f5('0x14'),_0x11795f,_0x4e1b97[_0x77f5('0x11')][_0x77f5('0x13')]);return _0x28e0ef(_0x4e1b97[_0x77f5('0x11')][_0x77f5('0x13')]);}else{logger[_0x77f5('0x15')](_0x77f5('0x14'),_0x11795f,'request\x20sent');_0x28e0ef(_0x4e1b97['result'][_0x77f5('0x13')]);}})['catch'](function(_0x30898a){logger[_0x77f5('0x11')](_0x77f5('0x14'),_0x11795f,_0x30898a);_0x38d4c3(_0x30898a);});});}exports[_0x77f5('0x16')]=function(_0x2b5cfc){var _0x163585=this;return new Promise(function(_0x2366b7,_0x9f32d6){return db['VoiceDialReport'][_0x77f5('0x17')](_0x2b5cfc['body'],{'raw':_0x2b5cfc[_0x77f5('0x18')]?_0x2b5cfc[_0x77f5('0x18')][_0x77f5('0x19')]===undefined?!![]:![]:!![]})[_0x77f5('0xc')](function(_0x5091c1){logger[_0x77f5('0x15')](_0x77f5('0x16'),_0x2b5cfc);logger[_0x77f5('0xe')](_0x77f5('0x16'),_0x2b5cfc,JSON[_0x77f5('0x10')](_0x5091c1));_0x2366b7(_0x5091c1);})[_0x77f5('0x1a')](function(_0x520756){logger['error'](_0x77f5('0x16'),_0x520756[_0x77f5('0x13')],_0x2b5cfc);_0x9f32d6(_0x163585[_0x77f5('0x11')](0x1f4,_0x520756[_0x77f5('0x13')]));});});};exports[_0x77f5('0x1b')]=function(_0x4f6394){var _0x6dfde5=this;return new Promise(function(_0x5906ab,_0xab4b0){return db[_0x77f5('0x1c')][_0x77f5('0x1d')](_0x4f6394['body'],{'raw':_0x4f6394[_0x77f5('0x18')]?_0x4f6394[_0x77f5('0x18')][_0x77f5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6394[_0x77f5('0x18')]?_0x4f6394[_0x77f5('0x18')]['where']||null:null,'attributes':_0x4f6394['options']?_0x4f6394['options'][_0x77f5('0x1e')]||null:null,'limit':_0x4f6394[_0x77f5('0x18')]?_0x4f6394[_0x77f5('0x18')][_0x77f5('0x1f')]||null:null})[_0x77f5('0xc')](function(_0x526158){logger[_0x77f5('0x15')](_0x77f5('0x1b'),_0x4f6394);logger[_0x77f5('0xe')](_0x77f5('0x1b'),_0x4f6394,JSON[_0x77f5('0x10')](_0x526158));_0x5906ab(_0x526158);})[_0x77f5('0x1a')](function(_0x2e4aef){logger[_0x77f5('0x11')](_0x77f5('0x1b'),_0x2e4aef[_0x77f5('0x13')],_0x4f6394);_0xab4b0(_0x6dfde5[_0x77f5('0x11')](0x1f4,_0x2e4aef[_0x77f5('0x13')]));});});}; \ No newline at end of file +var _0x1b02=['stringify','UpdateVoiceDialReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceDialReport','create','body','options','raw','then','CreateVoiceDialReport'];(function(_0x59d86f,_0x325be6){var _0x1c23aa=function(_0x86322c){while(--_0x86322c){_0x59d86f['push'](_0x59d86f['shift']());}};_0x1c23aa(++_0x325be6);}(_0x1b02,0x19d));var _0x21b0=function(_0x40fb1a,_0xc40248){_0x40fb1a=_0x40fb1a-0x0;var _0x5a7770=_0x1b02[_0x40fb1a];return _0x5a7770;};'use strict';var _=require('lodash');var util=require(_0x21b0('0x0'));var moment=require(_0x21b0('0x1'));var BPromise=require(_0x21b0('0x2'));var rs=require(_0x21b0('0x3'));var fs=require('fs');var Redis=require(_0x21b0('0x4'));var db=require(_0x21b0('0x5'))['db'];var utils=require(_0x21b0('0x6'));var logger=require(_0x21b0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x21b0('0x8'));var client=jayson[_0x21b0('0x9')][_0x21b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ff489,_0x53a8d3,_0x1ec981){return new BPromise(function(_0x5ec366,_0x27e347){return client[_0x21b0('0xb')](_0x2ff489,_0x1ec981)['then'](function(_0xaa456f){logger[_0x21b0('0xc')](_0x21b0('0xd'),_0x53a8d3,_0x21b0('0xe'));logger[_0x21b0('0xf')](_0x21b0('0x10'),_0x53a8d3,_0x21b0('0xe'),JSON['stringify'](_0xaa456f));if(_0xaa456f['error']){if(_0xaa456f[_0x21b0('0x11')][_0x21b0('0x12')]===0x1f4){logger['error'](_0x21b0('0xd'),_0x53a8d3,_0xaa456f[_0x21b0('0x11')][_0x21b0('0x13')]);return _0x27e347(_0xaa456f['error'][_0x21b0('0x13')]);}logger[_0x21b0('0x11')](_0x21b0('0xd'),_0x53a8d3,_0xaa456f[_0x21b0('0x11')][_0x21b0('0x13')]);return _0x5ec366(_0xaa456f[_0x21b0('0x11')][_0x21b0('0x13')]);}else{logger[_0x21b0('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x53a8d3,_0x21b0('0xe'));_0x5ec366(_0xaa456f[_0x21b0('0x14')][_0x21b0('0x13')]);}})[_0x21b0('0x15')](function(_0x23d5e5){logger[_0x21b0('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x53a8d3,_0x23d5e5);_0x27e347(_0x23d5e5);});});}exports['CreateVoiceDialReport']=function(_0x5a195a){var _0x4f8c88=this;return new Promise(function(_0x1052ce,_0x45f25b){return db[_0x21b0('0x16')][_0x21b0('0x17')](_0x5a195a[_0x21b0('0x18')],{'raw':_0x5a195a[_0x21b0('0x19')]?_0x5a195a[_0x21b0('0x19')][_0x21b0('0x1a')]===undefined?!![]:![]:!![]})[_0x21b0('0x1b')](function(_0x188fea){logger[_0x21b0('0xc')]('CreateVoiceDialReport',_0x5a195a);logger[_0x21b0('0xf')](_0x21b0('0x1c'),_0x5a195a,JSON[_0x21b0('0x1d')](_0x188fea));_0x1052ce(_0x188fea);})[_0x21b0('0x15')](function(_0x4935ee){logger['error'](_0x21b0('0x1c'),_0x4935ee[_0x21b0('0x13')],_0x5a195a);_0x45f25b(_0x4f8c88[_0x21b0('0x11')](0x1f4,_0x4935ee[_0x21b0('0x13')]));});});};exports[_0x21b0('0x1e')]=function(_0x16321b){var _0x5cca5c=this;return new Promise(function(_0x38f7a0,_0x21da6){return db[_0x21b0('0x16')][_0x21b0('0x1f')](_0x16321b[_0x21b0('0x18')],{'raw':_0x16321b[_0x21b0('0x19')]?_0x16321b[_0x21b0('0x19')][_0x21b0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16321b[_0x21b0('0x19')]?_0x16321b['options'][_0x21b0('0x20')]||null:null,'attributes':_0x16321b[_0x21b0('0x19')]?_0x16321b[_0x21b0('0x19')][_0x21b0('0x21')]||null:null,'limit':_0x16321b[_0x21b0('0x19')]?_0x16321b[_0x21b0('0x19')]['limit']||null:null})[_0x21b0('0x1b')](function(_0x1c714a){logger[_0x21b0('0xc')](_0x21b0('0x1e'),_0x16321b);logger[_0x21b0('0xf')](_0x21b0('0x1e'),_0x16321b,JSON[_0x21b0('0x1d')](_0x1c714a));_0x38f7a0(_0x1c714a);})['catch'](function(_0x30ba64){logger[_0x21b0('0x11')](_0x21b0('0x1e'),_0x30ba64['message'],_0x16321b);_0x21da6(_0x5cca5c[_0x21b0('0x11')](0x1f4,_0x30ba64[_0x21b0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 7fb80ae..39459e0 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 _0x9b21=['post','create','/:id/applications','addApplications','destroy','exports','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3d89ce,_0x5d5e4b){var _0x494a2e=function(_0x1222b8){while(--_0x1222b8){_0x3d89ce['push'](_0x3d89ce['shift']());}};_0x494a2e(++_0x5d5e4b);}(_0x9b21,0x166));var _0x19b2=function(_0x3ceb11,_0x1a5b55){_0x3ceb11=_0x3ceb11-0x0;var _0x540ffd=_0x9b21[_0x3ceb11];return _0x540ffd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x19b2('0x0'));var router=express[_0x19b2('0x1')]();var fs_extra=require(_0x19b2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x19b2('0x3'));var config=require(_0x19b2('0x4'));var controller=require('./voiceExtension.controller');router[_0x19b2('0x5')]('/',auth[_0x19b2('0x6')](),controller[_0x19b2('0x7')]);router[_0x19b2('0x5')](_0x19b2('0x8'),auth[_0x19b2('0x6')](),controller[_0x19b2('0x9')]);router[_0x19b2('0xa')]('/',auth[_0x19b2('0x6')](),controller[_0x19b2('0xb')]);router['post'](_0x19b2('0xc'),auth[_0x19b2('0x6')](),controller[_0x19b2('0xd')]);router['put'](_0x19b2('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x19b2('0x8'),auth[_0x19b2('0x6')](),controller[_0x19b2('0xe')]);module[_0x19b2('0xf')]=router; \ No newline at end of file +var _0x026f=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','put','delete','destroy'];(function(_0x2889b8,_0x2880f9){var _0x405982=function(_0x46ac7d){while(--_0x46ac7d){_0x2889b8['push'](_0x2889b8['shift']());}};_0x405982(++_0x2880f9);}(_0x026f,0xf8));var _0xf026=function(_0x893149,_0x5d1513){_0x893149=_0x893149-0x0;var _0x12ac2d=_0x026f[_0x893149];return _0x12ac2d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf026('0x0'));var timeout=require(_0xf026('0x1'));var express=require(_0xf026('0x2'));var router=express[_0xf026('0x3')]();var fs_extra=require(_0xf026('0x4'));var auth=require(_0xf026('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xf026('0x6')]('/',auth[_0xf026('0x7')](),controller[_0xf026('0x8')]);router[_0xf026('0x6')](_0xf026('0x9'),auth[_0xf026('0x7')](),controller[_0xf026('0xa')]);router[_0xf026('0xb')]('/',auth[_0xf026('0x7')](),controller[_0xf026('0xc')]);router[_0xf026('0xb')](_0xf026('0xd'),auth[_0xf026('0x7')](),controller[_0xf026('0xe')]);router[_0xf026('0xf')](_0xf026('0x9'),auth[_0xf026('0x7')](),controller['update']);router[_0xf026('0x10')]('/:id',auth[_0xf026('0x7')](),controller[_0xf026('0x11')]);module[_0xf026('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index f87dca4..57510a8 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 _0x31d2=['any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','outbound-fax'];(function(_0x42ca27,_0x368dce){var _0x166d47=function(_0x26424f){while(--_0x26424f){_0x42ca27['push'](_0x42ca27['shift']());}};_0x166d47(++_0x368dce);}(_0x31d2,0x7f));var _0x231d=function(_0x36d467,_0x43c993){_0x36d467=_0x36d467-0x0;var _0xe2be38=_0x31d2[_0x36d467];return _0xe2be38;};'use strict';var Sequelize=require(_0x231d('0x0'));module[_0x231d('0x1')]={'context':{'type':Sequelize[_0x231d('0x2')],'allowNull':![],'unique':_0x231d('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x231d('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x231d('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x231d('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x231d('0x4')](_0x231d('0x5'),_0x231d('0x6'),_0x231d('0x7'),'inbound-fax',_0x231d('0x8'),'system',_0x231d('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x231d('0x2')]},'interval':{'type':Sequelize[_0x231d('0x2')],'allowNull':![],'defaultValue':_0x231d('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x231d('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x231d('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x231d('0xc')]},'recordingFormat':{'type':Sequelize[_0x231d('0x2')],'defaultValue':_0x231d('0xd')},'answer':{'type':Sequelize[_0x231d('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x231d('0xe')],'get':function(_0x3bf4e0){return this[_0x231d('0xf')](_0x231d('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x2a0e=['ENUM','outbound','inbound-fax','outbound-fax','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x2a0e,0xb0));var _0xe2a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2a0e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe2a0('0x0'));module['exports']={'context':{'type':Sequelize[_0xe2a0('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe2a0('0x1')],'allowNull':![],'unique':_0xe2a0('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xe2a0('0x2')},'tag':{'type':Sequelize[_0xe2a0('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xe2a0('0x1')],'allowNull':![],'defaultValue':_0xe2a0('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe2a0('0x4')]('inbound',_0xe2a0('0x5'),'internal',_0xe2a0('0x6'),_0xe2a0('0x7'),'system',_0xe2a0('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xe2a0('0x1')]},'interval':{'type':Sequelize[_0xe2a0('0x1')],'allowNull':![],'defaultValue':_0xe2a0('0x9')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xe2a0('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe2a0('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xe2a0('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xe2a0('0xb')]},'recordingFormat':{'type':Sequelize[_0xe2a0('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xe2a0('0xc')],'get':function(_0x122cb7){return this[_0xe2a0('0xd')](_0xe2a0('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 04f15c1..219872c 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 _0xb30c=['value','includes','type','find','UserProfileResource','destroy','sendStatus','error','stack','name','send','VoiceExtension','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','outbound','startsWith','exten','concat','get','user','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','update','description','recordingFormat','addApplications','sequelize','transaction','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','undefined','count','offset','set','Content-Range','then','InboundRoutes','internal','filter','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb30c,0x1dd));var _0xcb30=function(_0x272712,_0x5238ec){_0x272712=_0x272712-0x0;var _0x53544c=_0xb30c[_0x272712];return _0x53544c;};'use strict';var _=require(_0xcb30('0x0'));var Redis=require('ioredis');var qs=require(_0xcb30('0x1'));var logger=require(_0xcb30('0x2'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xcb30('0x3')]=_[_0xcb30('0x4')](config[_0xcb30('0x3')],{'host':_0xcb30('0x5'),'port':0x18eb});var socket=require(_0xcb30('0x6'))(new Redis(config[_0xcb30('0x3')]));require(_0xcb30('0x7'))['register'](socket);function respondWithStatusCode(_0xe382ee,_0x4d56c5){_0x4d56c5=_0x4d56c5||0xcc;return function(_0x4619b0){if(_0x4619b0){return _0xe382ee['sendStatus'](_0x4d56c5);}return _0xe382ee[_0xcb30('0x8')](_0x4d56c5)[_0xcb30('0x9')]();};}function respondWithResult(_0x4f6242,_0x414c9e){_0x414c9e=_0x414c9e||0xc8;return function(_0x34a3de){if(_0x34a3de){return _0x4f6242[_0xcb30('0x8')](_0x414c9e)[_0xcb30('0xa')](_0x34a3de);}};}function respondWithFilteredResult(_0x5a6602,_0x5ebf3b){return function(_0x4d4b74){if(_0x4d4b74){var _0xba1f66=typeof _0x5ebf3b['offset']===_0xcb30('0xb')&&typeof _0x5ebf3b['limit']===_0xcb30('0xb');var _0xa9e033=_0x4d4b74[_0xcb30('0xc')];var _0x30e8ff=_0xba1f66?0x0:_0x5ebf3b['offset'];var _0x23da64=_0xba1f66?_0x4d4b74[_0xcb30('0xc')]:_0x5ebf3b[_0xcb30('0xd')]+_0x5ebf3b['limit'];var _0x345a6c;if(_0x23da64>=_0xa9e033){_0x23da64=_0xa9e033;_0x345a6c=0xc8;}else{_0x345a6c=0xce;}_0x5a6602['status'](_0x345a6c);return _0x5a6602[_0xcb30('0xe')](_0xcb30('0xf'),_0x30e8ff+'-'+_0x23da64+'/'+_0xa9e033)[_0xcb30('0xa')](_0x4d4b74);}return null;};}function removeEntity(_0x550e84){return function(_0x4f8395){if(_0x4f8395){return _0x4f8395['destroy']()[_0xcb30('0x10')](function(){var _0x2ea2c9=_0x4f8395['get']({'plain':!![]});var _0x37b158=[{'name':_0xcb30('0x11'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xcb30('0x12'),'ignore':![]}];var _0xaf2bc0=_(_0x37b158)[_0xcb30('0x13')]('ignore')[_0xcb30('0x14')](_0xcb30('0x15'))[_0xcb30('0x15')]();if(_[_0xcb30('0x16')](_0xaf2bc0,_0x2ea2c9[_0xcb30('0x17')])){return;}var _0x5bfa68=_[_0xcb30('0x18')](_0x37b158,[_0xcb30('0x15'),_0x2ea2c9[_0xcb30('0x17')]])['name'];return db[_0xcb30('0x19')][_0xcb30('0x1a')]({'where':{'type':_0x5bfa68,'resourceId':_0x2ea2c9['id']}})[_0xcb30('0x10')](function(){return _0x4f8395;});})[_0xcb30('0x10')](function(){_0x550e84[_0xcb30('0x8')](0xcc)[_0xcb30('0x9')]();});}};}function handleEntityNotFound(_0x19fcbf){return function(_0x53b456){if(!_0x53b456){_0x19fcbf[_0xcb30('0x1b')](0x194);}return _0x53b456;};}function handleError(_0x2df731,_0x57602b){_0x57602b=_0x57602b||0x1f4;return function(_0x3540b3){logger[_0xcb30('0x1c')](_0x3540b3[_0xcb30('0x1d')]);if(_0x3540b3[_0xcb30('0x1e')]){delete _0x3540b3[_0xcb30('0x1e')];}_0x2df731[_0xcb30('0x8')](_0x57602b)[_0xcb30('0x1f')](_0x3540b3);};}exports['index']=function(_0x134986,_0x4356e0){var _0x406d83={},_0x3cfd51={},_0x1d802a={'count':0x0,'rows':[]};var _0xacf8b=_['map'](db[_0xcb30('0x20')][_0xcb30('0x21')],function(_0x456e01){return{'name':_0x456e01['fieldName'],'type':_0x456e01[_0xcb30('0x17')][_0xcb30('0x22')]};});_0x3cfd51['model']=_['map'](_0xacf8b,_0xcb30('0x1e'));_0x3cfd51['query']=_[_0xcb30('0x23')](_0x134986[_0xcb30('0x24')]);_0x3cfd51[_0xcb30('0x25')]=_[_0xcb30('0x26')](_0x3cfd51['model'],_0x3cfd51[_0xcb30('0x24')]);_0x406d83[_0xcb30('0x27')]=_[_0xcb30('0x26')](_0x3cfd51[_0xcb30('0x28')],qs[_0xcb30('0x29')](_0x134986[_0xcb30('0x24')][_0xcb30('0x29')]));_0x406d83[_0xcb30('0x27')]=_0x406d83[_0xcb30('0x27')][_0xcb30('0x2a')]?_0x406d83[_0xcb30('0x27')]:_0x3cfd51['model'];if(!_0x134986[_0xcb30('0x24')][_0xcb30('0x2b')](_0xcb30('0x2c'))){_0x406d83['limit']=qs['limit'](_0x134986[_0xcb30('0x24')][_0xcb30('0x2d')]);_0x406d83[_0xcb30('0xd')]=qs[_0xcb30('0xd')](_0x134986[_0xcb30('0x24')][_0xcb30('0xd')]);}_0x406d83['order']=qs[_0xcb30('0x2e')](_0x134986['query']['sort']);_0x406d83[_0xcb30('0x2f')]=qs[_0xcb30('0x25')](_['pick'](_0x134986[_0xcb30('0x24')],_0x3cfd51[_0xcb30('0x25')]),_0xacf8b);if(_0x134986[_0xcb30('0x24')][_0xcb30('0x13')]){_0x406d83[_0xcb30('0x2f')]=_[_0xcb30('0x30')](_0x406d83['where'],{'$or':_['map'](_0xacf8b,function(_0x59c90c){if(_0x59c90c['type']!==_0xcb30('0x31')){var _0x3efd34={};_0x3efd34[_0x59c90c[_0xcb30('0x1e')]]={'$like':'%'+_0x134986[_0xcb30('0x24')][_0xcb30('0x13')]+'%'};return _0x3efd34;}})});}_0x406d83=_['merge']({},_0x406d83,_0x134986[_0xcb30('0x32')]);var _0x2c65a0={'where':_0x406d83[_0xcb30('0x2f')]};return db[_0xcb30('0x20')][_0xcb30('0xc')](_0x2c65a0)[_0xcb30('0x10')](function(_0x4bbcc0){_0x1d802a[_0xcb30('0xc')]=_0x4bbcc0;if(_0x134986[_0xcb30('0x24')]['includeAll']){_0x406d83[_0xcb30('0x33')]=[{'all':!![]}];}return db[_0xcb30('0x20')][_0xcb30('0x34')](_0x406d83);})[_0xcb30('0x10')](function(_0x3edeaa){_0x1d802a[_0xcb30('0x35')]=_0x3edeaa;return _0x1d802a;})[_0xcb30('0x10')](respondWithFilteredResult(_0x4356e0,_0x406d83))[_0xcb30('0x36')](handleError(_0x4356e0,null));};exports[_0xcb30('0x37')]=function(_0x1433db,_0x2907f2){var _0x1441c6={'raw':![],'where':{'id':_0x1433db[_0xcb30('0x38')]['id']}},_0x48fd33={};_0x48fd33[_0xcb30('0x28')]=_[_0xcb30('0x23')](db[_0xcb30('0x20')][_0xcb30('0x21')]);_0x48fd33['query']=_[_0xcb30('0x23')](_0x1433db[_0xcb30('0x24')]);_0x48fd33['filters']=_[_0xcb30('0x26')](_0x48fd33[_0xcb30('0x28')],_0x48fd33[_0xcb30('0x24')]);_0x1441c6[_0xcb30('0x27')]=_[_0xcb30('0x26')](_0x48fd33[_0xcb30('0x28')],qs['fields'](_0x1433db['query'][_0xcb30('0x29')]));_0x1441c6[_0xcb30('0x27')]=_0x1441c6[_0xcb30('0x27')]['length']?_0x1441c6['attributes']:_0x48fd33['model'];if(_0x1433db[_0xcb30('0x24')][_0xcb30('0x39')]){_0x1441c6[_0xcb30('0x33')]=[{'all':!![]}];}_0x1441c6=_[_0xcb30('0x30')]({},_0x1441c6,_0x1433db[_0xcb30('0x32')]);return db[_0xcb30('0x20')][_0xcb30('0x18')](_0x1441c6)[_0xcb30('0x10')](handleEntityNotFound(_0x2907f2,null))[_0xcb30('0x10')](respondWithResult(_0x2907f2,null))['catch'](handleError(_0x2907f2,null));};exports[_0xcb30('0x1a')]=function(_0x15af6,_0x2d9693){return db[_0xcb30('0x20')]['find']({'where':{'id':_0x15af6[_0xcb30('0x38')]['id']}})[_0xcb30('0x10')](handleEntityNotFound(_0x2d9693,null))[_0xcb30('0x10')](removeEntity(_0x2d9693,null))[_0xcb30('0x36')](handleError(_0x2d9693,null));};exports[_0xcb30('0x3a')]=function(_0x2d4b69,_0x1aafd3){if(_0x2d4b69[_0xcb30('0x3b')][_0xcb30('0x17')]===_0xcb30('0x3c')&&!_[_0xcb30('0x3d')](_0x2d4b69[_0xcb30('0x3b')]['exten'],'_')){_0x2d4b69[_0xcb30('0x3b')][_0xcb30('0x3e')]='_'[_0xcb30('0x3f')](_0x2d4b69[_0xcb30('0x3b')][_0xcb30('0x3e')]);}return db[_0xcb30('0x20')][_0xcb30('0x3a')](_0x2d4b69[_0xcb30('0x3b')],{'raw':![]})[_0xcb30('0x10')](function(_0x537dec){var _0x274306=_0x2d4b69['user'][_0xcb30('0x40')]({'plain':!![]});if(!_0x274306)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274306['role']===_0xcb30('0x41')){var _0x3e021a=_0x537dec[_0xcb30('0x40')]({'plain':!![]});var _0x2b2d49=[{'name':_0xcb30('0x11'),'value':'inbound'},{'name':_0xcb30('0x42'),'value':_0xcb30('0x3c')},{'name':'InternalRoutes','value':_0xcb30('0x12')}];var _0xcf7543=_['find'](_0x2b2d49,['value',_0x3e021a[_0xcb30('0x17')]])[_0xcb30('0x1e')];return db[_0xcb30('0x43')][_0xcb30('0x18')]({'where':{'name':_0xcf7543,'userProfileId':_0x274306[_0xcb30('0x44')]},'raw':!![]})[_0xcb30('0x10')](function(_0x5a53d8){if(_0x5a53d8&&_0x5a53d8[_0xcb30('0x45')]===0x0){return db[_0xcb30('0x19')][_0xcb30('0x3a')]({'name':_0x3e021a[_0xcb30('0x1e')],'resourceId':_0x3e021a['id'],'type':_0x5a53d8[_0xcb30('0x1e')],'sectionId':_0x5a53d8['id']},{})['then'](function(){return _0x537dec;});}else{return _0x537dec;}})[_0xcb30('0x36')](function(_0x1943ab){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1943ab);throw _0x1943ab;});}return _0x537dec;})[_0xcb30('0x10')](respondWithResult(_0x1aafd3,0xc9))[_0xcb30('0x36')](handleError(_0x1aafd3,null));};exports['update']=function(_0x52dfaa,_0x10170d){if(_0x52dfaa[_0xcb30('0x3b')]['id']){delete _0x52dfaa[_0xcb30('0x3b')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x52dfaa[_0xcb30('0x38')]['id']}})['then'](handleEntityNotFound(_0x10170d,null))['then'](function(_0x3b2e53){if(_0x3b2e53){return db['VoiceExtension'][_0xcb30('0x46')](_['pick'](_0x52dfaa[_0xcb30('0x3b')],['exten','context',_0xcb30('0x47'),_0xcb30('0x48'),'cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x3b2e53['context'],'exten':_0x3b2e53[_0xcb30('0x3e')]},'individualHooks':!![]})[_0xcb30('0x10')](function(_0x1da604){return _0x1da604;});}return null;})['then'](respondWithStatusCode(_0x10170d,null))[_0xcb30('0x36')](handleError(_0x10170d,null));};exports[_0xcb30('0x49')]=function(_0x33f43d,_0x188267){return db[_0xcb30('0x20')]['findOne']({'where':{'id':_0x33f43d['params']['id']}})[_0xcb30('0x10')](function(_0x27e65f){if(_0x27e65f){return db[_0xcb30('0x4a')][_0xcb30('0x4b')](function(_0x525a1c){return db[_0xcb30('0x20')][_0xcb30('0x1a')]({'where':{'VoiceExtensionId':_0x33f43d[_0xcb30('0x38')]['id']},'transaction':_0x525a1c})['then'](function(){var _0x52cd3e=_[_0xcb30('0x14')](_0x33f43d[_0xcb30('0x3b')],function(_0x2981a4){_0x2981a4[_0xcb30('0x4c')]=_0x33f43d[_0xcb30('0x38')]['id'];_0x2981a4[_0xcb30('0x4d')]=!![];return _0x2981a4;});return _0x27e65f[_0xcb30('0x4e')](_0x52cd3e);})[_0xcb30('0x10')](function(_0x39ec76){console['log'](_0xcb30('0x4f'),_0x39ec76);return db[_0xcb30('0x20')][_0xcb30('0x50')](_0x39ec76,{'transaction':_0x525a1c});});})['then'](function(){return db['VoiceExtension'][_0xcb30('0x51')]({'where':{'isApp':!![],'VoiceExtensionId':_0x33f43d[_0xcb30('0x38')]['id']},'order':_0xcb30('0x52')});});}})[_0xcb30('0x10')](respondWithResult(_0x188267,null))[_0xcb30('0x36')](handleError(_0x188267,null));}; \ No newline at end of file +var _0x4517=['user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','mandatoryDisposition','alias','context','sequelize','transaction','isApp','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','cast(priority\x20as\x20unsigned)','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','map','value','includes','type','find','name','error','stack','VoiceExtension','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','includeAll','include','catch','keys','rawAttributes','merge','params','create','startsWith','body','exten','role'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4517,0x112));var _0x7451=function(_0xd22ca7,_0x51482d){_0xd22ca7=_0xd22ca7-0x0;var _0x50d67b=_0x4517[_0xd22ca7];return _0x50d67b;};'use strict';var _=require('lodash');var Redis=require(_0x7451('0x0'));var qs=require(_0x7451('0x1'));var logger=require('../../config/logger')(_0x7451('0x2'));var config=require(_0x7451('0x3'));var db=require(_0x7451('0x4'))['db'];config[_0x7451('0x5')]=_[_0x7451('0x6')](config[_0x7451('0x5')],{'host':_0x7451('0x7'),'port':0x18eb});var socket=require(_0x7451('0x8'))(new Redis(config[_0x7451('0x5')]));require(_0x7451('0x9'))[_0x7451('0xa')](socket);function respondWithStatusCode(_0x1bfc08,_0x26306e){_0x26306e=_0x26306e||0xcc;return function(_0x443b80){if(_0x443b80){return _0x1bfc08[_0x7451('0xb')](_0x26306e);}return _0x1bfc08[_0x7451('0xc')](_0x26306e)[_0x7451('0xd')]();};}function respondWithResult(_0x4b7888,_0x29f2e1){_0x29f2e1=_0x29f2e1||0xc8;return function(_0xc586c3){if(_0xc586c3){return _0x4b7888[_0x7451('0xc')](_0x29f2e1)[_0x7451('0xe')](_0xc586c3);}};}function respondWithFilteredResult(_0x323ba5,_0x1de697){return function(_0x2cc708){if(_0x2cc708){var _0x4aab85=typeof _0x1de697['offset']===_0x7451('0xf')&&typeof _0x1de697['limit']===_0x7451('0xf');var _0x2cb40b=_0x2cc708['count'];var _0x7cb990=_0x4aab85?0x0:_0x1de697[_0x7451('0x10')];var _0x4dbe5b=_0x4aab85?_0x2cc708[_0x7451('0x11')]:_0x1de697[_0x7451('0x10')]+_0x1de697[_0x7451('0x12')];var _0x187e87;if(_0x4dbe5b>=_0x2cb40b){_0x4dbe5b=_0x2cb40b;_0x187e87=0xc8;}else{_0x187e87=0xce;}_0x323ba5['status'](_0x187e87);return _0x323ba5[_0x7451('0x13')](_0x7451('0x14'),_0x7cb990+'-'+_0x4dbe5b+'/'+_0x2cb40b)[_0x7451('0xe')](_0x2cc708);}return null;};}function removeEntity(_0x58c0cd){return function(_0x4c9e54){if(_0x4c9e54){return _0x4c9e54[_0x7451('0x15')]()[_0x7451('0x16')](function(){var _0x508229=_0x4c9e54[_0x7451('0x17')]({'plain':!![]});var _0x3fd8fd=[{'name':_0x7451('0x18'),'value':_0x7451('0x19'),'ignore':![]},{'name':_0x7451('0x1a'),'value':_0x7451('0x1b'),'ignore':![]},{'name':'InternalRoutes','value':_0x7451('0x1c'),'ignore':![]}];var _0x32e250=_(_0x3fd8fd)[_0x7451('0x1d')]('ignore')[_0x7451('0x1e')](_0x7451('0x1f'))[_0x7451('0x1f')]();if(_[_0x7451('0x20')](_0x32e250,_0x508229[_0x7451('0x21')])){return;}var _0x293e29=_[_0x7451('0x22')](_0x3fd8fd,['value',_0x508229[_0x7451('0x21')]])[_0x7451('0x23')];return db['UserProfileResource'][_0x7451('0x15')]({'where':{'type':_0x293e29,'resourceId':_0x508229['id']}})[_0x7451('0x16')](function(){return _0x4c9e54;});})[_0x7451('0x16')](function(){_0x58c0cd['status'](0xcc)[_0x7451('0xd')]();});}};}function handleEntityNotFound(_0x21dd67){return function(_0x21cc22){if(!_0x21cc22){_0x21dd67[_0x7451('0xb')](0x194);}return _0x21cc22;};}function handleError(_0x37bc47,_0x4650a5){_0x4650a5=_0x4650a5||0x1f4;return function(_0x3c56f1){logger[_0x7451('0x24')](_0x3c56f1[_0x7451('0x25')]);if(_0x3c56f1['name']){delete _0x3c56f1[_0x7451('0x23')];}_0x37bc47[_0x7451('0xc')](_0x4650a5)['send'](_0x3c56f1);};}exports['index']=function(_0xcc793e,_0x1edcf2){var _0x248d83={},_0x467757={},_0x30ef36={'count':0x0,'rows':[]};var _0x19547e=_['map'](db[_0x7451('0x26')]['rawAttributes'],function(_0x1b960f){return{'name':_0x1b960f[_0x7451('0x27')],'type':_0x1b960f['type'][_0x7451('0x28')]};});_0x467757[_0x7451('0x29')]=_[_0x7451('0x1e')](_0x19547e,_0x7451('0x23'));_0x467757[_0x7451('0x2a')]=_['keys'](_0xcc793e[_0x7451('0x2a')]);_0x467757[_0x7451('0x2b')]=_[_0x7451('0x2c')](_0x467757['model'],_0x467757[_0x7451('0x2a')]);_0x248d83[_0x7451('0x2d')]=_['intersection'](_0x467757['model'],qs[_0x7451('0x2e')](_0xcc793e[_0x7451('0x2a')]['fields']));_0x248d83['attributes']=_0x248d83[_0x7451('0x2d')][_0x7451('0x2f')]?_0x248d83[_0x7451('0x2d')]:_0x467757[_0x7451('0x29')];if(!_0xcc793e[_0x7451('0x2a')][_0x7451('0x30')](_0x7451('0x31'))){_0x248d83[_0x7451('0x12')]=qs['limit'](_0xcc793e[_0x7451('0x2a')][_0x7451('0x12')]);_0x248d83['offset']=qs[_0x7451('0x10')](_0xcc793e[_0x7451('0x2a')][_0x7451('0x10')]);}_0x248d83[_0x7451('0x32')]=qs[_0x7451('0x33')](_0xcc793e[_0x7451('0x2a')]['sort']);_0x248d83[_0x7451('0x34')]=qs[_0x7451('0x2b')](_['pick'](_0xcc793e[_0x7451('0x2a')],_0x467757[_0x7451('0x2b')]),_0x19547e);if(_0xcc793e['query']['filter']){_0x248d83['where']=_['merge'](_0x248d83['where'],{'$or':_[_0x7451('0x1e')](_0x19547e,function(_0x3bac33){if(_0x3bac33[_0x7451('0x21')]!==_0x7451('0x35')){var _0x298cc6={};_0x298cc6[_0x3bac33['name']]={'$like':'%'+_0xcc793e['query']['filter']+'%'};return _0x298cc6;}})});}_0x248d83=_['merge']({},_0x248d83,_0xcc793e['options']);var _0x35b102={'where':_0x248d83[_0x7451('0x34')]};return db[_0x7451('0x26')][_0x7451('0x11')](_0x35b102)[_0x7451('0x16')](function(_0xfa0b5a){_0x30ef36[_0x7451('0x11')]=_0xfa0b5a;if(_0xcc793e[_0x7451('0x2a')][_0x7451('0x36')]){_0x248d83[_0x7451('0x37')]=[{'all':!![]}];}return db[_0x7451('0x26')]['findAll'](_0x248d83);})['then'](function(_0x169d18){_0x30ef36['rows']=_0x169d18;return _0x30ef36;})[_0x7451('0x16')](respondWithFilteredResult(_0x1edcf2,_0x248d83))[_0x7451('0x38')](handleError(_0x1edcf2,null));};exports['show']=function(_0x5eedf1,_0x1f5bf3){var _0x53af12={'raw':![],'where':{'id':_0x5eedf1['params']['id']}},_0x2e805f={};_0x2e805f[_0x7451('0x29')]=_[_0x7451('0x39')](db['VoiceExtension'][_0x7451('0x3a')]);_0x2e805f['query']=_[_0x7451('0x39')](_0x5eedf1[_0x7451('0x2a')]);_0x2e805f[_0x7451('0x2b')]=_[_0x7451('0x2c')](_0x2e805f[_0x7451('0x29')],_0x2e805f[_0x7451('0x2a')]);_0x53af12[_0x7451('0x2d')]=_[_0x7451('0x2c')](_0x2e805f[_0x7451('0x29')],qs[_0x7451('0x2e')](_0x5eedf1[_0x7451('0x2a')][_0x7451('0x2e')]));_0x53af12[_0x7451('0x2d')]=_0x53af12[_0x7451('0x2d')]['length']?_0x53af12[_0x7451('0x2d')]:_0x2e805f[_0x7451('0x29')];if(_0x5eedf1[_0x7451('0x2a')][_0x7451('0x36')]){_0x53af12['include']=[{'all':!![]}];}_0x53af12=_[_0x7451('0x3b')]({},_0x53af12,_0x5eedf1['options']);return db['VoiceExtension']['find'](_0x53af12)['then'](handleEntityNotFound(_0x1f5bf3,null))['then'](respondWithResult(_0x1f5bf3,null))[_0x7451('0x38')](handleError(_0x1f5bf3,null));};exports[_0x7451('0x15')]=function(_0x2b4bea,_0x489d7d){return db[_0x7451('0x26')][_0x7451('0x22')]({'where':{'id':_0x2b4bea[_0x7451('0x3c')]['id']}})[_0x7451('0x16')](handleEntityNotFound(_0x489d7d,null))[_0x7451('0x16')](removeEntity(_0x489d7d,null))[_0x7451('0x38')](handleError(_0x489d7d,null));};exports[_0x7451('0x3d')]=function(_0x875a40,_0x14e7dc){if(_0x875a40['body']['type']==='outbound'&&!_[_0x7451('0x3e')](_0x875a40[_0x7451('0x3f')][_0x7451('0x40')],'_')){_0x875a40['body']['exten']='_'['concat'](_0x875a40[_0x7451('0x3f')]['exten']);}return db['VoiceExtension'][_0x7451('0x3d')](_0x875a40[_0x7451('0x3f')],{'raw':![]})[_0x7451('0x16')](function(_0x1f505b){var _0x24e028=_0x875a40['user'][_0x7451('0x17')]({'plain':!![]});if(!_0x24e028)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24e028[_0x7451('0x41')]===_0x7451('0x42')){var _0x8a9cf1=_0x1f505b[_0x7451('0x17')]({'plain':!![]});var _0x123d8f=[{'name':_0x7451('0x18'),'value':_0x7451('0x19')},{'name':_0x7451('0x1a'),'value':_0x7451('0x1b')},{'name':'InternalRoutes','value':'internal'}];var _0x73dd28=_[_0x7451('0x22')](_0x123d8f,['value',_0x8a9cf1['type']])['name'];return db[_0x7451('0x43')][_0x7451('0x22')]({'where':{'name':_0x73dd28,'userProfileId':_0x24e028[_0x7451('0x44')]},'raw':!![]})[_0x7451('0x16')](function(_0x2e4f1f){if(_0x2e4f1f&&_0x2e4f1f[_0x7451('0x45')]===0x0){return db['UserProfileResource'][_0x7451('0x3d')]({'name':_0x8a9cf1['name'],'resourceId':_0x8a9cf1['id'],'type':_0x2e4f1f['name'],'sectionId':_0x2e4f1f['id']},{})['then'](function(){return _0x1f505b;});}else{return _0x1f505b;}})[_0x7451('0x38')](function(_0x3db1fe){logger[_0x7451('0x24')](_0x7451('0x46'),_0x3db1fe);throw _0x3db1fe;});}return _0x1f505b;})[_0x7451('0x16')](respondWithResult(_0x14e7dc,0xc9))[_0x7451('0x38')](handleError(_0x14e7dc,null));};exports[_0x7451('0x47')]=function(_0x49f320,_0x1566e5){if(_0x49f320[_0x7451('0x3f')]['id']){delete _0x49f320[_0x7451('0x3f')]['id'];}return db[_0x7451('0x26')][_0x7451('0x22')]({'where':{'id':_0x49f320[_0x7451('0x3c')]['id']}})[_0x7451('0x16')](handleEntityNotFound(_0x1566e5,null))['then'](function(_0xace3c9){if(_0xace3c9){return db[_0x7451('0x26')][_0x7451('0x47')](_[_0x7451('0x48')](_0x49f320[_0x7451('0x3f')],[_0x7451('0x40'),'context',_0x7451('0x49'),'recordingFormat','cutdigits',_0x7451('0x4a'),_0x7451('0x4b')]),{'where':{'context':_0xace3c9[_0x7451('0x4c')],'exten':_0xace3c9[_0x7451('0x40')]},'individualHooks':!![]})[_0x7451('0x16')](function(_0x286e2f){return _0x286e2f;});}return null;})['then'](respondWithStatusCode(_0x1566e5,null))[_0x7451('0x38')](handleError(_0x1566e5,null));};exports['addApplications']=function(_0x31df11,_0x436433){return db['VoiceExtension']['findOne']({'where':{'id':_0x31df11['params']['id']}})['then'](function(_0x124c4c){if(_0x124c4c){return db[_0x7451('0x4d')][_0x7451('0x4e')](function(_0x14b741){return db[_0x7451('0x26')][_0x7451('0x15')]({'where':{'VoiceExtensionId':_0x31df11['params']['id']},'transaction':_0x14b741})[_0x7451('0x16')](function(){var _0x49a1c9=_[_0x7451('0x1e')](_0x31df11[_0x7451('0x3f')],function(_0x184574){_0x184574['VoiceExtensionId']=_0x31df11['params']['id'];_0x184574[_0x7451('0x4f')]=!![];return _0x184574;});return _0x124c4c[_0x7451('0x50')](_0x49a1c9);})[_0x7451('0x16')](function(_0x446786){console[_0x7451('0x51')](_0x7451('0x52'),_0x446786);return db[_0x7451('0x26')][_0x7451('0x53')](_0x446786,{'transaction':_0x14b741});});})[_0x7451('0x16')](function(){return db[_0x7451('0x26')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x31df11['params']['id']},'order':_0x7451('0x54')});});}})[_0x7451('0x16')](respondWithResult(_0x436433,null))[_0x7451('0x38')](handleError(_0x436433,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2858f88..fed7ecc 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 _0x8d4b=['hook','exports','events','VoiceExtension','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x8d4b,0x89));var _0xb8d4=function(_0x4a53ba,_0x4b5633){_0x4a53ba=_0x4a53ba-0x0;var _0x570ea4=_0x8d4b[_0x4a53ba];return _0x570ea4;};'use strict';var EventEmitter=require(_0xb8d4('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xb8d4('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb8d4('0x2')](0x0);var events={'afterCreate':_0xb8d4('0x3'),'afterUpdate':_0xb8d4('0x4'),'afterDestroy':_0xb8d4('0x5')};function emitEvent(_0x272948){return function(_0x399902,_0x3e2bd5,_0xd14180){VoiceExtensionEvents['emit'](_0x272948+':'+_0x399902['id'],_0x399902);VoiceExtensionEvents['emit'](_0x272948,_0x399902);_0xd14180(null);};}for(var e in events){if(events[_0xb8d4('0x6')](e)){var event=events[e];VoiceExtension[_0xb8d4('0x7')](e,emitEvent(event));}}module[_0xb8d4('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x1a0c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','VoiceExtension'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x1a0c,0xdf));var _0xc1a0=function(_0x512f8c,_0x3545c1){_0x512f8c=_0x512f8c-0x0;var _0x2099f8=_0x1a0c[_0x512f8c];return _0x2099f8;};'use strict';var EventEmitter=require(_0xc1a0('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xc1a0('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc1a0('0x2')](0x0);var events={'afterCreate':_0xc1a0('0x3'),'afterUpdate':_0xc1a0('0x4'),'afterDestroy':_0xc1a0('0x5')};function emitEvent(_0xe96607){return function(_0x40941c,_0x433ad8,_0x25f538){VoiceExtensionEvents['emit'](_0xe96607+':'+_0x40941c['id'],_0x40941c);VoiceExtensionEvents[_0xc1a0('0x6')](_0xe96607,_0x40941c);_0x25f538(null);};}for(var e in events){if(events[_0xc1a0('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xc1a0('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 1ccb609..10759dd 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 _0xba6c=['trunk','param','split','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','define','then','Hangup','lodash','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','url','length','name'];(function(_0x143b60,_0x33fa87){var _0x80c85=function(_0x7e5922){while(--_0x7e5922){_0x143b60['push'](_0x143b60['shift']());}};_0x80c85(++_0x33fa87);}(_0xba6c,0x113));var _0xcba6=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0xba6c[_0x470b0a];return _0x4463f6;};'use strict';var _=require(_0xcba6('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xcba6('0x1')]=function(_0x1f7f77){var _0x1994bd=_0x1f7f77[_0xcba6('0x2')];function _0x3030b5(_0x3e9fb9){var _0x2b34a3=0x2;var _0x5c911d=[{'type':_0x3e9fb9['type'],'app':_0xcba6('0x3'),'appdata':_0xcba6('0x4')+_0x3e9fb9[_0xcba6('0x5')],'context':_0x3e9fb9[_0xcba6('0x6')],'exten':_0x3e9fb9[_0xcba6('0x7')],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']},{'type':_0x3e9fb9[_0xcba6('0x5')],'app':_0x3e9fb9[_0xcba6('0x8')]?_0xcba6('0x3'):_0xcba6('0x9'),'appdata':_0x3e9fb9[_0xcba6('0x8')]?_0xcba6('0xa')+_0x3e9fb9['alias']:_0xcba6('0xb'),'context':_0x3e9fb9[_0xcba6('0x6')],'exten':_0x3e9fb9[_0xcba6('0x7')],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']}];if(_0x3e9fb9[_0xcba6('0x5')]==='inbound'){_0x5c911d[_0xcba6('0xc')]({'type':'inbound','app':_0xcba6('0x3'),'appdata':_0xcba6('0xd')+_0x3e9fb9['id'],'context':_0x3e9fb9['context'],'exten':_0x3e9fb9[_0xcba6('0x7')],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']});}_0x5c911d['push']({'type':_0x3e9fb9[_0xcba6('0x5')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3e9fb9['context'],'exten':_0x3e9fb9[_0xcba6('0x7')],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']},{'type':_0x3e9fb9[_0xcba6('0x5')],'app':_0xcba6('0x3'),'appdata':_0xcba6('0xe'),'context':_0x3e9fb9[_0xcba6('0x6')],'exten':_0x3e9fb9['exten'],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']},{'type':_0x3e9fb9[_0xcba6('0x5')],'app':'Set','appdata':_0xcba6('0xf'),'context':_0x3e9fb9[_0xcba6('0x6')],'exten':_0x3e9fb9['exten'],'priority':_0x2b34a3++,'VoiceExtensionId':_0x3e9fb9['id']});return _0x5c911d;}function _0xd80373(_0x6dcfae){var _0x1885e8=0x2;var _0x53ad04=[{'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x11'),'context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':'outbound','app':_0x6dcfae[_0xcba6('0x8')]?'Set':'NoOp','appdata':_0x6dcfae['alias']?'CDR(routeAlias)='+_0x6dcfae[_0xcba6('0x8')]:'No\x20alias\x20set','context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':'Set','appdata':_0xcba6('0x12')+(_0x6dcfae[_0xcba6('0x13')]?_0xcba6('0x14')+_0x6dcfae['cutdigits']+'}':_0xcba6('0x15')),'context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':'outbound','app':_0xcba6('0x3'),'appdata':_0xcba6('0xd')+_0x6dcfae['id'],'context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':'outbound','app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1885e8+0x2)+_0xcba6('0x16')+(_0x1885e8+0x1)+')','context':_0x6dcfae['context'],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':'Set','appdata':_0x6dcfae['cutdigits']?_0xcba6('0x17')+_0x6dcfae['cutdigits']+'}':_0xcba6('0x18'),'context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x19'),'context':_0x6dcfae['context'],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0xf'),'context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x1a')+_0x6dcfae['id'],'context':_0x6dcfae['context'],'exten':_0x6dcfae['exten'],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']}];if(_0x6dcfae[_0xcba6('0x1b')](_0xcba6('0x1c'))&&_0x6dcfae['recordingFormat']!==_0xcba6('0x1d')){_0x53ad04[_0xcba6('0xc')]({'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x1e'),'context':_0x6dcfae['context'],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']},{'type':_0xcba6('0x10'),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x1f')+_0x6dcfae[_0xcba6('0x1c')]||'wav','context':_0x6dcfae[_0xcba6('0x6')],'exten':_0x6dcfae[_0xcba6('0x7')],'priority':_0x1885e8++,'VoiceExtensionId':_0x6dcfae['id']});}return _0x53ad04;}function _0x264b33(_0x19f4ee,_0x374a59){var _0x77256c=[{'name':'trunk','param':0x0},{'name':_0xcba6('0x20'),'param':0x1},{'name':_0xcba6('0x21'),'param':0x2},{'name':_0xcba6('0x22'),'param':0x3}];var _0x1b45bf={};var _0x30d6fc=_0x374a59['split'](',');var _0x4af697=[];for(var _0x483e67=0x0;_0x483e67<_0x77256c[_0xcba6('0x23')];_0x483e67++){switch(_0x77256c[_0x483e67][_0xcba6('0x24')]){case'trunk':_0x1b45bf[_0xcba6('0x25')]=_0x30d6fc[_0x77256c[_0x483e67][_0xcba6('0x26')]][_0xcba6('0x27')]('/')[0x1];_0x1b45bf[_0xcba6('0x28')]=_0x30d6fc[_0x77256c[_0x483e67][_0xcba6('0x26')]][_0xcba6('0x27')]('/')[0x2];_0x1b45bf[_0xcba6('0x29')]=_0x1b45bf[_0xcba6('0x28')]?_0x1b45bf[_0xcba6('0x28')][_0xcba6('0x27')]('$')[0x0]:undefined;_0x1b45bf[_0xcba6('0x28')]=_0x19f4ee[_0xcba6('0x13')]?(_0x1b45bf[_0xcba6('0x29')]||'')+'${EXTEN:'+_0x19f4ee[_0xcba6('0x13')]+'}':(_0x1b45bf[_0xcba6('0x29')]||'')+'${EXTEN}';_0x4af697[_0x77256c[_0x483e67][_0xcba6('0x26')]]=['SIP',_0x1b45bf[_0xcba6('0x25')],_0x1b45bf[_0xcba6('0x28')]][_0xcba6('0x2a')]('/');break;case _0xcba6('0x21'):_0x1b45bf[_0xcba6('0x21')]=_0x30d6fc[_0x77256c[_0x483e67][_0xcba6('0x26')]];if(_0x19f4ee[_0xcba6('0x1c')]!==_0xcba6('0x1d')){if(_0x1b45bf[_0xcba6('0x21')][_0xcba6('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x1b45bf['options']+=_0xcba6('0x2c');}}else{_0x1b45bf['options']=_0x1b45bf['options'][_0xcba6('0x2d')](_0xcba6('0x2c'),'');}_0x4af697[_0x77256c[_0x483e67]['param']]=_0x1b45bf['options'];break;default:_0x4af697[_0x77256c[_0x483e67]['param']]=_0x30d6fc[_0x77256c[_0x483e67][_0xcba6('0x26')]];}}return _0x4af697[_0xcba6('0x2a')](',');}function _0x1387db(_0x55a92d,_0x2fe276,_0x4d302f){return new Promise(function(_0x14568c,_0x2ca4cc){var _0x217ced=[];if(_[_0xcba6('0x2e')](_0x2fe276))return _0x14568c(_0x217ced);_0x1994bd['Interval'][_0xcba6('0x2f')]({'attributes':['id',_0xcba6('0x30'),_0xcba6('0x31')],'raw':!![]})['then'](function(_0x339fef){for(var _0x33fba7=0x0,_0x1eb5f3=0x0;_0x33fba7<_0x2fe276[_0xcba6('0x23')];_0x33fba7++,_0x1eb5f3=0x0){var _0x2dd71d=_0x2fe276[_0x33fba7];var _0x491d4c=[];var _0xc5c69b=[];delete _0x2dd71d['id'];if(_0x2dd71d[_0xcba6('0x30')]!=='*,*,*,*'){_0x2dd71d[_0xcba6('0x32')]=[_0x2dd71d['interval']];}else{_0x2dd71d['intervals']=_0x2dd71d['IntervalId']?_[_0xcba6('0x33')](_['filter'](_0x339fef,{'IntervalId':_0x2dd71d[_0xcba6('0x31')]}),'interval'):[];}_0x2dd71d[_0xcba6('0x6')]=_0x55a92d['context'];_0x2dd71d[_0xcba6('0x7')]=_0x55a92d[_0xcba6('0x7')];if(_0x2dd71d[_0xcba6('0x5')])_0x2dd71d[_0xcba6('0x5')]=_0x2dd71d['type'][_0xcba6('0x34')]();if(_0x55a92d[_0xcba6('0x5')]===_0xcba6('0x10')){if(_0x2dd71d[_0xcba6('0x1b')](_0xcba6('0x35'))&&_0x2dd71d[_0xcba6('0x35')]&&_0x2dd71d[_0xcba6('0x35')]!=='--'){_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d[_0xcba6('0x5')][_0xcba6('0x34')](),'app':'Set','appdata':_0xcba6('0x36')+_0x2dd71d[_0xcba6('0x35')],'context':_0x55a92d['context'],'exten':_0x55a92d[_0xcba6('0x7')],'priority':_0x2dd71d[_0xcba6('0x32')]['length']+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});}_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d['type'][_0xcba6('0x34')](),'app':_0xcba6('0x37'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x2dd71d[_0xcba6('0x38')]?'Set(CALLERID(all)='+_0x2dd71d[_0xcba6('0x38')]+')':_0xcba6('0x39')),'context':_0x55a92d[_0xcba6('0x6')],'exten':_0x55a92d[_0xcba6('0x7')],'priority':_0x2dd71d['intervals'][_0xcba6('0x23')]+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});}else{if(_0x2dd71d['hasOwnProperty'](_0xcba6('0x3a'))){if([_0xcba6('0x3b'),_0xcba6('0x3c')][_0xcba6('0x3d')](_0x2dd71d[_0xcba6('0x3e')][_0xcba6('0x34')]())&&_0x2dd71d[_0xcba6('0x3f')]!=='custom'){if(_0x2dd71d['answer']){_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d[_0xcba6('0x5')][_0xcba6('0x34')](),'app':'ExecIf','appdata':_0xcba6('0x40'),'context':_0x55a92d[_0xcba6('0x6')],'exten':_0x55a92d['exten'],'priority':_0x2dd71d[_0xcba6('0x32')]['length']+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d[_0xcba6('0x5')][_0xcba6('0x34')](),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x41'),'context':_0x55a92d['context'],'exten':_0x55a92d[_0xcba6('0x7')],'priority':_0x2dd71d['intervals'][_0xcba6('0x23')]+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});}else{_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d[_0xcba6('0x5')][_0xcba6('0x34')](),'app':_0xcba6('0x37'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55a92d['context'],'exten':_0x55a92d[_0xcba6('0x7')],'priority':_0x2dd71d[_0xcba6('0x32')][_0xcba6('0x23')]+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});_0x491d4c[_0xcba6('0xc')]({'type':_0x2dd71d[_0xcba6('0x5')]['toLowerCase'](),'app':_0xcba6('0x3'),'appdata':_0xcba6('0x42'),'context':_0x55a92d[_0xcba6('0x6')],'exten':_0x55a92d[_0xcba6('0x7')],'priority':_0x2dd71d['intervals'][_0xcba6('0x23')]+_0x4d302f+_0x1eb5f3++,'VoiceExtensionId':_0x55a92d['id']});}}}}for(var _0x464a38=0x0;_0x464a38<_0x2dd71d[_0xcba6('0x32')][_0xcba6('0x23')];_0x464a38++){var _0xac8f78=_0x4d302f+_0x2dd71d[_0xcba6('0x32')][_0xcba6('0x23')];var _0x5406a8=_0x464a38===_0x2dd71d[_0xcba6('0x32')][_0xcba6('0x23')]-0x1?_0x4d302f+_0x491d4c[_0xcba6('0x23')]+_0xc5c69b['length']+0x2:_0x4d302f+_0x464a38+0x1;_0x491d4c[_0xcba6('0x43')](_0x464a38,0x0,{'type':_0x55a92d[_0xcba6('0x5')],'app':_0xcba6('0x44'),'appdata':_0x2dd71d['intervals'][_0x464a38]+'?'+_0x55a92d[_0xcba6('0x6')]+_0xcba6('0x45')+_0xac8f78+':'+_0x55a92d[_0xcba6('0x6')]+_0xcba6('0x45')+_0x5406a8,'exten':_0x55a92d[_0xcba6('0x7')],'context':_0x55a92d[_0xcba6('0x6')],'priority':_0x4d302f+_0x464a38,'VoiceExtensionId':_0x55a92d['id']});}if(_0x2dd71d[_0xcba6('0x3f')]===_0xcba6('0x46'))_0x2dd71d[_0xcba6('0x47')]=_0x264b33(_0x55a92d,_0x2dd71d['appdata']);_0x2dd71d['priority']=_0x491d4c[_0xcba6('0x23')]?_[_0xcba6('0x48')](_0x491d4c)['priority']+0x1:_0x4d302f;_0x217ced=_[_0xcba6('0x49')](_0x217ced,_0x491d4c,[_0x2dd71d],_0xc5c69b);_0x4d302f=_['last'](_0x217ced)[_0xcba6('0x4a')]+0x1;}return _0x14568c(_0x217ced);})['catch'](function(_0x4179ce){_0x2ca4cc(_0x4179ce);});});}return _0x1f7f77[_0xcba6('0x4b')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3a4ab0){var _0x573b46=this['get']({'plain':!![]});var _0xae5d35=_0x573b46[_0xcba6('0x5')]==='outbound'?_0xd80373(_0x573b46):_0x3030b5(_0x573b46);return _0x1387db(_0x573b46,_0x3a4ab0,_[_0xcba6('0x48')](_0xae5d35)[_0xcba6('0x4a')]+0x1)[_0xcba6('0x4c')](function(_0x7072c8){var _0x44781c=_[_0xcba6('0x49')](_0xae5d35,_0x7072c8);_0x44781c[_0xcba6('0xc')]({'type':_0x573b46[_0xcba6('0x5')],'app':_0xcba6('0x4d'),'exten':_0x573b46['exten'],'context':_0x573b46[_0xcba6('0x6')],'priority':_['last'](_0x44781c)[_0xcba6('0x4a')]+0x1,'VoiceExtensionId':_0x573b46['id']});return _0x44781c;});}}});}; \ No newline at end of file +var _0xea2f=['interval','IntervalId','then','length','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','playback','includes','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','inbound','CDR(routeid)=','push','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','split','name','param','phone','prefix','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xea2f,0x6d));var _0xfea2=function(_0x1d94d9,_0x4a29f0){_0x1d94d9=_0x1d94d9-0x0;var _0x2e4e26=_0xea2f[_0x1d94d9];return _0x2e4e26;};'use strict';var _=require(_0xfea2('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xfea2('0x1')]=function(_0x19862d){var _0x485ff3=_0x19862d[_0xfea2('0x2')];function _0x12a721(_0x1d5fb9){var _0x56af29=0x2;var _0x53fb77=[{'type':_0x1d5fb9[_0xfea2('0x3')],'app':_0xfea2('0x4'),'appdata':_0xfea2('0x5')+_0x1d5fb9[_0xfea2('0x3')],'context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9[_0xfea2('0x7')],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']},{'type':_0x1d5fb9[_0xfea2('0x3')],'app':_0x1d5fb9[_0xfea2('0x8')]?_0xfea2('0x4'):_0xfea2('0x9'),'appdata':_0x1d5fb9[_0xfea2('0x8')]?'CDR(routeAlias)='+_0x1d5fb9['alias']:_0xfea2('0xa'),'context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9['exten'],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']}];if(_0x1d5fb9[_0xfea2('0x3')]===_0xfea2('0xb')){_0x53fb77['push']({'type':_0xfea2('0xb'),'app':_0xfea2('0x4'),'appdata':_0xfea2('0xc')+_0x1d5fb9['id'],'context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9[_0xfea2('0x7')],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']});}_0x53fb77[_0xfea2('0xd')]({'type':_0x1d5fb9[_0xfea2('0x3')],'app':_0xfea2('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9['exten'],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']},{'type':_0x1d5fb9['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9[_0xfea2('0x7')],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']},{'type':_0x1d5fb9['type'],'app':_0xfea2('0x4'),'appdata':_0xfea2('0xe'),'context':_0x1d5fb9[_0xfea2('0x6')],'exten':_0x1d5fb9[_0xfea2('0x7')],'priority':_0x56af29++,'VoiceExtensionId':_0x1d5fb9['id']});return _0x53fb77;}function _0x533b0d(_0x1a6e69){var _0x533160=0x2;var _0x2e7413=[{'type':_0xfea2('0xf'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':'outbound','app':_0x1a6e69['alias']?_0xfea2('0x4'):'NoOp','appdata':_0x1a6e69[_0xfea2('0x8')]?'CDR(routeAlias)='+_0x1a6e69[_0xfea2('0x8')]:_0xfea2('0xa'),'context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':_0xfea2('0x4'),'appdata':_0xfea2('0x10')+(_0x1a6e69[_0xfea2('0x11')]?_0xfea2('0x12')+_0x1a6e69['cutdigits']+'}':_0xfea2('0x13')),'context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':_0xfea2('0x4'),'appdata':_0xfea2('0xc')+_0x1a6e69['id'],'context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':_0xfea2('0x14'),'appdata':_0xfea2('0x15')+(_0x533160+0x2)+_0xfea2('0x16')+(_0x533160+0x1)+')','context':_0x1a6e69['context'],'exten':_0x1a6e69['exten'],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':_0xfea2('0x4'),'appdata':_0x1a6e69[_0xfea2('0x11')]?_0xfea2('0x17')+_0x1a6e69['cutdigits']+'}':_0xfea2('0x18'),'context':_0x1a6e69['context'],'exten':_0x1a6e69['exten'],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':'Set','appdata':_0xfea2('0x19'),'context':_0x1a6e69[_0xfea2('0x6')],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':'outbound','app':_0xfea2('0x4'),'appdata':_0xfea2('0x1a'),'context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':_0xfea2('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':_0xfea2('0xf'),'app':'Set','appdata':'outboundrouteid='+_0x1a6e69['id'],'context':_0x1a6e69[_0xfea2('0x6')],'exten':_0x1a6e69['exten'],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']}];if(_0x1a6e69[_0xfea2('0x1b')](_0xfea2('0x1c'))&&_0x1a6e69[_0xfea2('0x1c')]!==_0xfea2('0x1d')){_0x2e7413[_0xfea2('0xd')]({'type':_0xfea2('0xf'),'app':_0xfea2('0x4'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1a6e69[_0xfea2('0x6')],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']},{'type':'outbound','app':_0xfea2('0x4'),'appdata':_0xfea2('0x1e')+_0x1a6e69['recordingFormat']||'wav','context':_0x1a6e69['context'],'exten':_0x1a6e69[_0xfea2('0x7')],'priority':_0x533160++,'VoiceExtensionId':_0x1a6e69['id']});}return _0x2e7413;}function _0x4db1d1(_0x13f361,_0x2f4305){var _0x2e0ded=[{'name':_0xfea2('0x1f'),'param':0x0},{'name':_0xfea2('0x20'),'param':0x1},{'name':_0xfea2('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x5ce929={};var _0x22f10a=_0x2f4305[_0xfea2('0x22')](',');var _0x3263db=[];for(var _0x1ac9c4=0x0;_0x1ac9c4<_0x2e0ded['length'];_0x1ac9c4++){switch(_0x2e0ded[_0x1ac9c4][_0xfea2('0x23')]){case _0xfea2('0x1f'):_0x5ce929['trunk']=_0x22f10a[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]][_0xfea2('0x22')]('/')[0x1];_0x5ce929['phone']=_0x22f10a[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]]['split']('/')[0x2];_0x5ce929['prefix']=_0x5ce929[_0xfea2('0x25')]?_0x5ce929[_0xfea2('0x25')][_0xfea2('0x22')]('$')[0x0]:undefined;_0x5ce929[_0xfea2('0x25')]=_0x13f361[_0xfea2('0x11')]?(_0x5ce929[_0xfea2('0x26')]||'')+'${EXTEN:'+_0x13f361[_0xfea2('0x11')]+'}':(_0x5ce929[_0xfea2('0x26')]||'')+_0xfea2('0x13');_0x3263db[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]]=['SIP',_0x5ce929[_0xfea2('0x1f')],_0x5ce929['phone']][_0xfea2('0x27')]('/');break;case _0xfea2('0x21'):_0x5ce929[_0xfea2('0x21')]=_0x22f10a[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]];if(_0x13f361[_0xfea2('0x1c')]!==_0xfea2('0x1d')){if(_0x5ce929[_0xfea2('0x21')]['indexOf'](_0xfea2('0x28'))<0x0){_0x5ce929['options']+=_0xfea2('0x28');}}else{_0x5ce929[_0xfea2('0x21')]=_0x5ce929[_0xfea2('0x21')][_0xfea2('0x29')](_0xfea2('0x28'),'');}_0x3263db[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]]=_0x5ce929['options'];break;default:_0x3263db[_0x2e0ded[_0x1ac9c4]['param']]=_0x22f10a[_0x2e0ded[_0x1ac9c4][_0xfea2('0x24')]];}}return _0x3263db[_0xfea2('0x27')](',');}function _0x6421bb(_0x4b8037,_0x2b6545,_0x13c48d){return new Promise(function(_0x426687,_0x7d44eb){var _0x50500e=[];if(_[_0xfea2('0x2a')](_0x2b6545))return _0x426687(_0x50500e);_0x485ff3[_0xfea2('0x2b')][_0xfea2('0x2c')]({'attributes':['id',_0xfea2('0x2d'),_0xfea2('0x2e')],'raw':!![]})[_0xfea2('0x2f')](function(_0x59ef1d){for(var _0x1ef55b=0x0,_0x3bcd24=0x0;_0x1ef55b<_0x2b6545[_0xfea2('0x30')];_0x1ef55b++,_0x3bcd24=0x0){var _0x24388b=_0x2b6545[_0x1ef55b];var _0x581517=[];var _0x1c60e1=[];delete _0x24388b['id'];if(_0x24388b[_0xfea2('0x2d')]!=='*,*,*,*'){_0x24388b[_0xfea2('0x31')]=[_0x24388b['interval']];}else{_0x24388b[_0xfea2('0x31')]=_0x24388b[_0xfea2('0x2e')]?_[_0xfea2('0x32')](_[_0xfea2('0x33')](_0x59ef1d,{'IntervalId':_0x24388b[_0xfea2('0x2e')]}),_0xfea2('0x2d')):[];}_0x24388b['context']=_0x4b8037[_0xfea2('0x6')];_0x24388b[_0xfea2('0x7')]=_0x4b8037[_0xfea2('0x7')];if(_0x24388b[_0xfea2('0x3')])_0x24388b[_0xfea2('0x3')]=_0x24388b[_0xfea2('0x3')][_0xfea2('0x34')]();if(_0x4b8037[_0xfea2('0x3')]===_0xfea2('0xf')){if(_0x24388b[_0xfea2('0x1b')](_0xfea2('0x35'))&&_0x24388b[_0xfea2('0x35')]&&_0x24388b[_0xfea2('0x35')]!=='--'){_0x581517['push']({'type':_0x24388b[_0xfea2('0x3')][_0xfea2('0x34')](),'app':_0xfea2('0x4'),'appdata':_0xfea2('0x36')+_0x24388b['tag'],'context':_0x4b8037[_0xfea2('0x6')],'exten':_0x4b8037[_0xfea2('0x7')],'priority':_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});}_0x581517[_0xfea2('0xd')]({'type':_0x24388b['type'][_0xfea2('0x34')](),'app':_0xfea2('0x14'),'appdata':_0xfea2('0x37')+(_0x24388b[_0xfea2('0x38')]?'Set(CALLERID(all)='+_0x24388b[_0xfea2('0x38')]+')':'NoOp(No\x20number\x20available)'),'context':_0x4b8037[_0xfea2('0x6')],'exten':_0x4b8037[_0xfea2('0x7')],'priority':_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});}else{if(_0x24388b['hasOwnProperty']('answer')){if(['queue',_0xfea2('0x39')][_0xfea2('0x3a')](_0x24388b['app'][_0xfea2('0x34')]())&&_0x24388b['appType']!==_0xfea2('0x3b')){if(_0x24388b[_0xfea2('0x3c')]){_0x581517[_0xfea2('0xd')]({'type':_0x24388b[_0xfea2('0x3')][_0xfea2('0x34')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4b8037[_0xfea2('0x6')],'exten':_0x4b8037[_0xfea2('0x7')],'priority':_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});_0x581517['push']({'type':_0x24388b['type']['toLowerCase'](),'app':_0xfea2('0x4'),'appdata':_0xfea2('0x3d'),'context':_0x4b8037[_0xfea2('0x6')],'exten':_0x4b8037[_0xfea2('0x7')],'priority':_0x24388b['intervals'][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});}else{_0x581517[_0xfea2('0xd')]({'type':_0x24388b[_0xfea2('0x3')][_0xfea2('0x34')](),'app':'ExecIf','appdata':_0xfea2('0x3e'),'context':_0x4b8037['context'],'exten':_0x4b8037[_0xfea2('0x7')],'priority':_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});_0x581517[_0xfea2('0xd')]({'type':_0x24388b[_0xfea2('0x3')][_0xfea2('0x34')](),'app':'Set','appdata':_0xfea2('0x3f'),'context':_0x4b8037[_0xfea2('0x6')],'exten':_0x4b8037['exten'],'priority':_0x24388b['intervals'][_0xfea2('0x30')]+_0x13c48d+_0x3bcd24++,'VoiceExtensionId':_0x4b8037['id']});}}}}for(var _0x19f032=0x0;_0x19f032<_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')];_0x19f032++){var _0x2289b9=_0x13c48d+_0x24388b[_0xfea2('0x31')][_0xfea2('0x30')];var _0x2613b5=_0x19f032===_0x24388b['intervals'][_0xfea2('0x30')]-0x1?_0x13c48d+_0x581517['length']+_0x1c60e1[_0xfea2('0x30')]+0x2:_0x13c48d+_0x19f032+0x1;_0x581517['splice'](_0x19f032,0x0,{'type':_0x4b8037['type'],'app':_0xfea2('0x40'),'appdata':_0x24388b['intervals'][_0x19f032]+'?'+_0x4b8037['context']+_0xfea2('0x41')+_0x2289b9+':'+_0x4b8037[_0xfea2('0x6')]+',${EXTEN},'+_0x2613b5,'exten':_0x4b8037[_0xfea2('0x7')],'context':_0x4b8037[_0xfea2('0x6')],'priority':_0x13c48d+_0x19f032,'VoiceExtensionId':_0x4b8037['id']});}if(_0x24388b[_0xfea2('0x42')]===_0xfea2('0x43'))_0x24388b[_0xfea2('0x44')]=_0x4db1d1(_0x4b8037,_0x24388b[_0xfea2('0x44')]);_0x24388b[_0xfea2('0x45')]=_0x581517[_0xfea2('0x30')]?_[_0xfea2('0x46')](_0x581517)[_0xfea2('0x45')]+0x1:_0x13c48d;_0x50500e=_[_0xfea2('0x47')](_0x50500e,_0x581517,[_0x24388b],_0x1c60e1);_0x13c48d=_['last'](_0x50500e)[_0xfea2('0x45')]+0x1;}return _0x426687(_0x50500e);})[_0xfea2('0x48')](function(_0x1a73c6){_0x7d44eb(_0x1a73c6);});});}return _0x19862d[_0xfea2('0x49')](_0xfea2('0x4a'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xa6148){var _0x4d6497=this[_0xfea2('0x4b')]({'plain':!![]});var _0x1e2d8b=_0x4d6497[_0xfea2('0x3')]===_0xfea2('0xf')?_0x533b0d(_0x4d6497):_0x12a721(_0x4d6497);return _0x6421bb(_0x4d6497,_0xa6148,_[_0xfea2('0x46')](_0x1e2d8b)[_0xfea2('0x45')]+0x1)['then'](function(_0x12bc8c){var _0x18a4a3=_[_0xfea2('0x47')](_0x1e2d8b,_0x12bc8c);_0x18a4a3[_0xfea2('0xd')]({'type':_0x4d6497['type'],'app':_0xfea2('0x4c'),'exten':_0x4d6497[_0xfea2('0x7')],'context':_0x4d6497[_0xfea2('0x6')],'priority':_[_0xfea2('0x46')](_0x18a4a3)[_0xfea2('0x45')]+0x1,'VoiceExtensionId':_0x4d6497['id']});return _0x18a4a3;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 47e7326..b0d3bfe 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 _0x4813=['message','result','VoiceExtension','findAll','options','raw','where','limit','map','include','attributes','model','GetVoiceExtension','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x52e8c9,_0x391d4a){var _0x15e9de=function(_0x1037d7){while(--_0x1037d7){_0x52e8c9['push'](_0x52e8c9['shift']());}};_0x15e9de(++_0x391d4a);}(_0x4813,0x14e));var _0x3481=function(_0x21792b,_0x41f923){_0x21792b=_0x21792b-0x0;var _0x2e33f3=_0x4813[_0x21792b];return _0x2e33f3;};'use strict';var _=require(_0x3481('0x0'));var util=require(_0x3481('0x1'));var moment=require(_0x3481('0x2'));var BPromise=require(_0x3481('0x3'));var rs=require(_0x3481('0x4'));var fs=require('fs');var Redis=require(_0x3481('0x5'));var db=require(_0x3481('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3481('0x7'))(_0x3481('0x8'));var config=require(_0x3481('0x9'));var jayson=require(_0x3481('0xa'));var client=jayson[_0x3481('0xb')]['http']({'port':0x232a});config['redis']=_[_0x3481('0xc')](config['redis'],{'host':_0x3481('0xd'),'port':0x18eb});var socket=require(_0x3481('0xe'))(new Redis(config[_0x3481('0xf')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x52e455,_0x3da272,_0x4ab043){return new BPromise(function(_0x4da46b,_0x2a079d){return client[_0x3481('0x10')](_0x52e455,_0x4ab043)[_0x3481('0x11')](function(_0x3aff58){logger[_0x3481('0x12')](_0x3481('0x13'),_0x3da272,_0x3481('0x14'));logger[_0x3481('0x15')](_0x3481('0x16'),_0x3da272,_0x3481('0x14'),JSON[_0x3481('0x17')](_0x3aff58));if(_0x3aff58[_0x3481('0x18')]){if(_0x3aff58['error'][_0x3481('0x19')]===0x1f4){logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x3aff58[_0x3481('0x18')][_0x3481('0x1a')]);return _0x2a079d(_0x3aff58[_0x3481('0x18')]['message']);}logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x3aff58['error']['message']);return _0x4da46b(_0x3aff58['error']['message']);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x3da272,_0x3481('0x14'));_0x4da46b(_0x3aff58[_0x3481('0x1b')]['message']);}})['catch'](function(_0x11c6b3){logger[_0x3481('0x18')](_0x3481('0x13'),_0x3da272,_0x11c6b3);_0x2a079d(_0x11c6b3);});});}exports['GetVoiceExtension']=function(_0x47a669){var _0x154be5=this;return new Promise(function(_0x3862eb,_0x1e0aa0){return db[_0x3481('0x1c')][_0x3481('0x1d')]({'raw':_0x47a669[_0x3481('0x1e')]?_0x47a669['options'][_0x3481('0x1f')]===undefined?!![]:![]:!![],'where':_0x47a669[_0x3481('0x1e')]?_0x47a669[_0x3481('0x1e')][_0x3481('0x20')]||null:null,'attributes':_0x47a669['options']?_0x47a669[_0x3481('0x1e')]['attributes']||null:null,'limit':_0x47a669[_0x3481('0x1e')]?_0x47a669[_0x3481('0x1e')][_0x3481('0x21')]||null:null,'include':_0x47a669[_0x3481('0x1e')]?_0x47a669['options']['include']?_[_0x3481('0x22')](_0x47a669[_0x3481('0x1e')][_0x3481('0x23')],function(_0x405816){return{'model':db[_0x405816['model']],'as':_0x405816['as'],'attributes':_0x405816[_0x3481('0x24')],'include':_0x405816[_0x3481('0x23')]?_[_0x3481('0x22')](_0x405816[_0x3481('0x23')],function(_0xe79636){return{'model':db[_0xe79636[_0x3481('0x25')]],'as':_0xe79636['as'],'attributes':_0xe79636[_0x3481('0x24')],'include':_0xe79636[_0x3481('0x23')]?_[_0x3481('0x22')](_0xe79636[_0x3481('0x23')],function(_0x4a20d5){return{'model':db[_0x4a20d5[_0x3481('0x25')]],'as':_0x4a20d5['as'],'attributes':_0x4a20d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x3481('0x11')](function(_0x1f079a){logger[_0x3481('0x12')]('GetVoiceExtension',_0x47a669);logger[_0x3481('0x15')](_0x3481('0x26'),_0x47a669,JSON[_0x3481('0x17')](_0x1f079a));_0x3862eb(_0x1f079a);})[_0x3481('0x27')](function(_0x3e217b){logger['error'](_0x3481('0x26'),_0x3e217b[_0x3481('0x1a')],_0x47a669);_0x1e0aa0(_0x154be5[_0x3481('0x18')](0x1f4,_0x3e217b[_0x3481('0x1a')]));});});}; \ No newline at end of file +var _0x9865=['result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','include','map','model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./voiceExtension.socket','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x44ad08,_0x4e513b){var _0x5776e8=function(_0x1649cc){while(--_0x1649cc){_0x44ad08['push'](_0x44ad08['shift']());}};_0x5776e8(++_0x4e513b);}(_0x9865,0x1ba));var _0x5986=function(_0x1c4920,_0x1fb0c2){_0x1c4920=_0x1c4920-0x0;var _0x549263=_0x9865[_0x1c4920];return _0x549263;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var moment=require(_0x5986('0x2'));var BPromise=require(_0x5986('0x3'));var rs=require(_0x5986('0x4'));var fs=require('fs');var Redis=require(_0x5986('0x5'));var db=require(_0x5986('0x6'))['db'];var utils=require(_0x5986('0x7'));var logger=require(_0x5986('0x8'))(_0x5986('0x9'));var config=require('../../config/environment');var jayson=require(_0x5986('0xa'));var client=jayson[_0x5986('0xb')][_0x5986('0xc')]({'port':0x232a});config[_0x5986('0xd')]=_['defaults'](config['redis'],{'host':_0x5986('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5986('0xd')]));require(_0x5986('0xf'))[_0x5986('0x10')](socket);function respondWithRpcPromise(_0x19cd00,_0x128930,_0x557355){return new BPromise(function(_0xb63bb4,_0x2570ee){return client[_0x5986('0x11')](_0x19cd00,_0x557355)['then'](function(_0x4cc196){logger[_0x5986('0x12')](_0x5986('0x13'),_0x128930,_0x5986('0x14'));logger[_0x5986('0x15')](_0x5986('0x16'),_0x128930,'request\x20sent',JSON['stringify'](_0x4cc196));if(_0x4cc196[_0x5986('0x17')]){if(_0x4cc196['error'][_0x5986('0x18')]===0x1f4){logger[_0x5986('0x17')](_0x5986('0x13'),_0x128930,_0x4cc196[_0x5986('0x17')][_0x5986('0x19')]);return _0x2570ee(_0x4cc196['error']['message']);}logger[_0x5986('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x128930,_0x4cc196[_0x5986('0x17')][_0x5986('0x19')]);return _0xb63bb4(_0x4cc196[_0x5986('0x17')][_0x5986('0x19')]);}else{logger[_0x5986('0x12')](_0x5986('0x13'),_0x128930,_0x5986('0x14'));_0xb63bb4(_0x4cc196[_0x5986('0x1a')][_0x5986('0x19')]);}})[_0x5986('0x1b')](function(_0x4be330){logger['error'](_0x5986('0x13'),_0x128930,_0x4be330);_0x2570ee(_0x4be330);});});}exports[_0x5986('0x1c')]=function(_0x505c25){var _0x2dadf9=this;return new Promise(function(_0xb75f57,_0x40446c){return db[_0x5986('0x1d')][_0x5986('0x1e')]({'raw':_0x505c25[_0x5986('0x1f')]?_0x505c25[_0x5986('0x1f')][_0x5986('0x20')]===undefined?!![]:![]:!![],'where':_0x505c25[_0x5986('0x1f')]?_0x505c25[_0x5986('0x1f')][_0x5986('0x21')]||null:null,'attributes':_0x505c25['options']?_0x505c25[_0x5986('0x1f')]['attributes']||null:null,'limit':_0x505c25[_0x5986('0x1f')]?_0x505c25['options']['limit']||null:null,'include':_0x505c25[_0x5986('0x1f')]?_0x505c25['options'][_0x5986('0x22')]?_[_0x5986('0x23')](_0x505c25['options'][_0x5986('0x22')],function(_0x3b705d){return{'model':db[_0x3b705d[_0x5986('0x24')]],'as':_0x3b705d['as'],'attributes':_0x3b705d[_0x5986('0x25')],'include':_0x3b705d[_0x5986('0x22')]?_[_0x5986('0x23')](_0x3b705d[_0x5986('0x22')],function(_0x492bce){return{'model':db[_0x492bce[_0x5986('0x24')]],'as':_0x492bce['as'],'attributes':_0x492bce[_0x5986('0x25')],'include':_0x492bce[_0x5986('0x22')]?_[_0x5986('0x23')](_0x492bce['include'],function(_0x1b9b20){return{'model':db[_0x1b9b20['model']],'as':_0x1b9b20['as'],'attributes':_0x1b9b20['attributes']};}):[]};}):[]};}):[]:[]})[_0x5986('0x26')](function(_0x32c72c){logger['info'](_0x5986('0x1c'),_0x505c25);logger['debug'](_0x5986('0x1c'),_0x505c25,JSON['stringify'](_0x32c72c));_0xb75f57(_0x32c72c);})['catch'](function(_0x2fb3e0){logger[_0x5986('0x17')]('GetVoiceExtension',_0x2fb3e0[_0x5986('0x19')],_0x505c25);_0x40446c(_0x2dadf9[_0x5986('0x17')](0x1f4,_0x2fb3e0[_0x5986('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a69fcdd..cd03a52 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 _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x249793,_0x1c8b9d){_0x249793=_0x249793-0x0;var _0x5e96be=_0x1cb9[_0x249793];return _0x5e96be;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x37713c,_0x1a9ce6){var _0x4df967=function(_0x1650b2){while(--_0x1650b2){_0x37713c['push'](_0x37713c['shift']());}};_0x4df967(++_0x1a9ce6);}(_0x4975,0x86));var _0x5497=function(_0x2f8023,_0x18829f){_0x2f8023=_0x2f8023-0x0;var _0x51e9e2=_0x4975[_0x2f8023];return _0x51e9e2;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 6401808..30527b1 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 _0x4c60=['exports','multer','util','path','connect-timeout','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','put','update','destroy'];(function(_0xf53676,_0x56a42c){var _0x540776=function(_0x1ca75a){while(--_0x1ca75a){_0xf53676['push'](_0xf53676['shift']());}};_0x540776(++_0x56a42c);}(_0x4c60,0xc1));var _0x04c6=function(_0x1e11b6,_0x186dd9){_0x1e11b6=_0x1e11b6-0x0;var _0x58ce33=_0x4c60[_0x1e11b6];return _0x58ce33;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['show']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x04c6('0xc')]('/:id',auth[_0x04c6('0x7')](),controller[_0x04c6('0xd')]);router['delete'](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xe')]);module[_0x04c6('0xf')]=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(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x3e24,0x167));var _0x43e2=function(_0x11500e,_0x457be0){_0x11500e=_0x11500e-0x0;var _0x135e1a=_0x3e24[_0x11500e];return _0x135e1a;};'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 b28086b..af35413 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 _0x4636=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x4636,0x1c1));var _0x6463=function(_0x2121e6,_0x11f8b3){_0x2121e6=_0x2121e6-0x0;var _0x48c4b4=_0x4636[_0x2121e6];return _0x48c4b4;};'use strict';var Sequelize=require(_0x6463('0x0'));module[_0x6463('0x1')]={'customer_id':{'type':Sequelize[_0x6463('0x2')]},'context':{'type':Sequelize[_0x6463('0x2')],'defaultValue':_0x6463('0x3'),'unique':_0x6463('0x4')},'mailbox':{'type':Sequelize[_0x6463('0x2')],'defaultValue':'','allowNull':![],'unique':_0x6463('0x4')},'password':{'type':Sequelize[_0x6463('0x2')]},'fullname':{'type':Sequelize[_0x6463('0x2')]},'email':{'type':Sequelize[_0x6463('0x2')],'validate':{'isEmail':!![]},'set':function(_0x227084){this[_0x6463('0x5')](_0x6463('0x6'),typeof _0x227084===_0x6463('0x7')&&_0x227084[_0x6463('0x8')]()?_0x227084['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x6463('0x2')],'defaultValue':_0x6463('0x9')},'attach':{'type':Sequelize['ENUM'](_0x6463('0xa'),'no'),'defaultValue':_0x6463('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x6463('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x6463('0x2')]},'callback':{'type':Sequelize[_0x6463('0x2')]},'review':{'type':Sequelize[_0x6463('0xb')](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6463('0xb')](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6463('0xb')](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6463('0xb')](_0x6463('0xa'),'no'),'defaultValue':_0x6463('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6463('0xb')](_0x6463('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x6463('0xa'),'no'),'defaultValue':_0x6463('0xa'),'allowNull':![]},'stamp':{'type':_0x6463('0xc')},'emailsubject':{'type':Sequelize[_0x6463('0x2')]},'emailbody':{'type':Sequelize[_0x6463('0x2')]},'maxsecs':{'type':Sequelize[_0x6463('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6463('0xe')],'get':function(){return this[_0x6463('0xf')](_0x6463('0x10'))+'\x20-\x20'+this['getDataValue'](_0x6463('0x11'));}}}; \ No newline at end of file +var _0xd989=['setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x2780ce,_0xf9b4d7){var _0x3081c8=function(_0x3f5246){while(--_0x3f5246){_0x2780ce['push'](_0x2780ce['shift']());}};_0x3081c8(++_0xf9b4d7);}(_0xd989,0x9e));var _0x9d98=function(_0x44f630,_0xcdd7f8){_0x44f630=_0x44f630-0x0;var _0x3633ef=_0xd989[_0x44f630];return _0x3633ef;};'use strict';var Sequelize=require('sequelize');module[_0x9d98('0x0')]={'customer_id':{'type':Sequelize[_0x9d98('0x1')]},'context':{'type':Sequelize[_0x9d98('0x1')],'defaultValue':_0x9d98('0x2'),'unique':_0x9d98('0x3')},'mailbox':{'type':Sequelize[_0x9d98('0x1')],'defaultValue':'','allowNull':![],'unique':_0x9d98('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x15afeb){this[_0x9d98('0x4')](_0x9d98('0x5'),typeof _0x15afeb==='string'&&_0x15afeb[_0x9d98('0x6')]()?_0x15afeb[_0x9d98('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x9d98('0x1')],'defaultValue':_0x9d98('0x7')},'attach':{'type':Sequelize[_0x9d98('0x8')](_0x9d98('0x9'),'no'),'defaultValue':_0x9d98('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x9d98('0x9'),'no'),'defaultValue':_0x9d98('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9d98('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x9d98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9d98('0x8')](_0x9d98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9d98('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x9d98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9d98('0x8')](_0x9d98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x9d98('0x9'),'no'),'defaultValue':_0x9d98('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9d98('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x9d98('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9d98('0x8')]('yes','no'),'defaultValue':_0x9d98('0x9'),'allowNull':![]},'stamp':{'type':_0x9d98('0xb')},'emailsubject':{'type':Sequelize[_0x9d98('0x1')]},'emailbody':{'type':Sequelize[_0x9d98('0x1')]},'maxsecs':{'type':Sequelize[_0x9d98('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9d98('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9d98('0xd')],'get':function(){return this[_0x9d98('0xe')](_0x9d98('0xf'))+_0x9d98('0x10')+this['getDataValue'](_0x9d98('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 937c67d..8230c1e 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 _0x4024=['limit','count','Content-Range','apply','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xa88482,_0x5d0260){var _0x1b1b8c=function(_0x437a29){while(--_0x437a29){_0xa88482['push'](_0xa88482['shift']());}};_0x1b1b8c(++_0x5d0260);}(_0x4024,0x89));var _0x4402=function(_0x4d825c,_0x13d778){_0x4d825c=_0x4d825c-0x0;var _0x1c2767=_0x4024[_0x4d825c];return _0x1c2767;};'use strict';var emlformat=require(_0x4402('0x0'));var rimraf=require(_0x4402('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4402('0x2'));var rp=require(_0x4402('0x3'));var moment=require('moment');var BPromise=require(_0x4402('0x4'));var Mustache=require('mustache');var util=require(_0x4402('0x5'));var path=require(_0x4402('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4402('0x7'));var fs=require('fs');var fs_extra=require(_0x4402('0x8'));var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xe'));var logger=require('../../config/logger')(_0x4402('0xf'));var utils=require(_0x4402('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x4402('0x11'));var db=require(_0x4402('0x12'))['db'];function respondWithStatusCode(_0xa819e9,_0x4c9032){_0x4c9032=_0x4c9032||0xcc;return function(_0x7e4475){if(_0x7e4475){return _0xa819e9[_0x4402('0x13')](_0x4c9032);}return _0xa819e9[_0x4402('0x14')](_0x4c9032)[_0x4402('0x15')]();};}function respondWithResult(_0x248ad9,_0x31710c){_0x31710c=_0x31710c||0xc8;return function(_0x18c7a8){if(_0x18c7a8){return _0x248ad9[_0x4402('0x14')](_0x31710c)[_0x4402('0x16')](_0x18c7a8);}};}function respondWithFilteredResult(_0x263a57,_0x375166){return function(_0xc03f65){if(_0xc03f65){var _0x2a2ce8=typeof _0x375166[_0x4402('0x17')]===_0x4402('0x18')&&typeof _0x375166[_0x4402('0x19')]===_0x4402('0x18');var _0x25e88b=_0xc03f65[_0x4402('0x1a')];var _0x231382=_0x2a2ce8?0x0:_0x375166['offset'];var _0x494389=_0x2a2ce8?_0xc03f65[_0x4402('0x1a')]:_0x375166[_0x4402('0x17')]+_0x375166['limit'];var _0x756962;if(_0x494389>=_0x25e88b){_0x494389=_0x25e88b;_0x756962=0xc8;}else{_0x756962=0xce;}_0x263a57[_0x4402('0x14')](_0x756962);return _0x263a57['set'](_0x4402('0x1b'),_0x231382+'-'+_0x494389+'/'+_0x25e88b)['json'](_0xc03f65);}return null;};}function patchUpdates(_0x55cc8c){return function(_0x1b9599){try{jsonpatch[_0x4402('0x1c')](_0x1b9599,_0x55cc8c,!![]);}catch(_0x28f44b){return BPromise['reject'](_0x28f44b);}return _0x1b9599[_0x4402('0x1d')]();};}function saveUpdates(_0x57a25e,_0x47ab54){return function(_0x6f1f72){if(_0x6f1f72){return _0x6f1f72[_0x4402('0x1e')](_0x57a25e)[_0x4402('0x1f')](function(_0xc583b){return _0xc583b;});}return null;};}function removeEntity(_0x258d10,_0x2e6fee){return function(_0x289a3e){if(_0x289a3e){return _0x289a3e[_0x4402('0x20')]()[_0x4402('0x1f')](function(){var _0x4d6846=_0x289a3e[_0x4402('0x21')]({'plain':!![]});var _0x4e1c04=_0x4402('0x22');return db[_0x4402('0x23')][_0x4402('0x20')]({'where':{'type':_0x4e1c04,'resourceId':_0x4d6846['id']}})[_0x4402('0x1f')](function(){return _0x289a3e;});})['then'](function(){_0x258d10[_0x4402('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59d52f,_0x1be54d){return function(_0x395e49){if(!_0x395e49){_0x59d52f[_0x4402('0x13')](0x194);}return _0x395e49;};}function handleError(_0xabf61b,_0x3eb796){_0x3eb796=_0x3eb796||0x1f4;return function(_0x514e41){logger[_0x4402('0x24')](_0x514e41['stack']);if(_0x514e41[_0x4402('0x25')]){delete _0x514e41[_0x4402('0x25')];}_0xabf61b[_0x4402('0x14')](_0x3eb796)['send'](_0x514e41);};}exports[_0x4402('0x26')]=function(_0x6c87f6,_0x316239){var _0x3f4bcb={},_0x2526d1={},_0x605702={'count':0x0,'rows':[]};var _0x1189b8=_[_0x4402('0x27')](db[_0x4402('0x28')][_0x4402('0x29')],function(_0xcea26b){return{'name':_0xcea26b['fieldName'],'type':_0xcea26b[_0x4402('0x2a')]['key']};});_0x2526d1[_0x4402('0x2b')]=_['map'](_0x1189b8,_0x4402('0x25'));_0x2526d1[_0x4402('0x2c')]=_[_0x4402('0x2d')](_0x6c87f6[_0x4402('0x2c')]);_0x2526d1[_0x4402('0x2e')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],_0x2526d1[_0x4402('0x2c')]);_0x3f4bcb[_0x4402('0x2f')]=_['intersection'](_0x2526d1[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x6c87f6['query'][_0x4402('0x30')]));_0x3f4bcb[_0x4402('0x2f')]=_0x3f4bcb[_0x4402('0x2f')][_0x4402('0x31')]?_0x3f4bcb[_0x4402('0x2f')]:_0x2526d1[_0x4402('0x2b')];if(!_0x6c87f6[_0x4402('0x2c')][_0x4402('0x32')](_0x4402('0x33'))){_0x3f4bcb['limit']=qs[_0x4402('0x19')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x19')]);_0x3f4bcb['offset']=qs[_0x4402('0x17')](_0x6c87f6[_0x4402('0x2c')]['offset']);}_0x3f4bcb['order']=qs[_0x4402('0x34')](_0x6c87f6[_0x4402('0x2c')][_0x4402('0x34')]);_0x3f4bcb[_0x4402('0x35')]=qs['filters'](_['pick'](_0x6c87f6['query'],_0x2526d1[_0x4402('0x2e')]),_0x1189b8);if(_0x6c87f6[_0x4402('0x2c')][_0x4402('0x36')]){_0x3f4bcb[_0x4402('0x35')]=_['merge'](_0x3f4bcb[_0x4402('0x35')],{'$or':_[_0x4402('0x27')](_0x1189b8,function(_0x35f877){if(_0x35f877['type']!==_0x4402('0x37')){var _0x5aca7b={};_0x5aca7b[_0x35f877[_0x4402('0x25')]]={'$like':'%'+_0x6c87f6[_0x4402('0x2c')]['filter']+'%'};return _0x5aca7b;}})});}_0x3f4bcb=_[_0x4402('0x38')]({},_0x3f4bcb,_0x6c87f6['options']);var _0x423628={'where':_0x3f4bcb[_0x4402('0x35')]};return db['VoiceMail'][_0x4402('0x1a')](_0x423628)[_0x4402('0x1f')](function(_0x250f09){_0x605702[_0x4402('0x1a')]=_0x250f09;if(_0x6c87f6['query']['includeAll']){_0x3f4bcb[_0x4402('0x39')]=[{'all':!![]}];}return db['VoiceMail'][_0x4402('0x3a')](_0x3f4bcb);})[_0x4402('0x1f')](function(_0xb9cf85){_0x605702[_0x4402('0x3b')]=_0xb9cf85;return _0x605702;})[_0x4402('0x1f')](respondWithFilteredResult(_0x316239,_0x3f4bcb))[_0x4402('0x3c')](handleError(_0x316239,null));};exports[_0x4402('0x3d')]=function(_0x390169,_0x1f9b3e){var _0x42812b={'raw':!![],'where':{'id':_0x390169[_0x4402('0x3e')]['id']}},_0x486e43={};_0x486e43[_0x4402('0x2b')]=_['keys'](db[_0x4402('0x28')][_0x4402('0x29')]);_0x486e43['query']=_[_0x4402('0x2d')](_0x390169[_0x4402('0x2c')]);_0x486e43[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],_0x486e43['query']);_0x42812b[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x486e43[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x390169[_0x4402('0x2c')][_0x4402('0x30')]));_0x42812b[_0x4402('0x2f')]=_0x42812b[_0x4402('0x2f')][_0x4402('0x31')]?_0x42812b[_0x4402('0x2f')]:_0x486e43[_0x4402('0x2b')];if(_0x390169['query'][_0x4402('0x40')]){_0x42812b['include']=[{'all':!![]}];}_0x42812b=_[_0x4402('0x38')]({},_0x42812b,_0x390169[_0x4402('0x41')]);return db['VoiceMail'][_0x4402('0x42')](_0x42812b)[_0x4402('0x1f')](handleEntityNotFound(_0x1f9b3e,null))[_0x4402('0x1f')](respondWithResult(_0x1f9b3e,null))[_0x4402('0x3c')](handleError(_0x1f9b3e,null));};exports[_0x4402('0x43')]=function(_0x2503eb,_0x5b094b){return db[_0x4402('0x28')][_0x4402('0x43')](_0x2503eb[_0x4402('0x44')],{})[_0x4402('0x1f')](function(_0x2b2ed3){var _0x24d51c=_0x2503eb[_0x4402('0x45')][_0x4402('0x21')]({'plain':!![]});if(!_0x24d51c)throw new Error(_0x4402('0x46'));if(_0x24d51c['role']==='user'){var _0x5ab12b=_0x2b2ed3['get']({'plain':!![]});var _0x257010=_0x4402('0x22');return db[_0x4402('0x47')][_0x4402('0x42')]({'where':{'name':_0x257010,'userProfileId':_0x24d51c['userProfileId']},'raw':!![]})[_0x4402('0x1f')](function(_0x12d6de){if(_0x12d6de&&_0x12d6de[_0x4402('0x48')]===0x0){return db[_0x4402('0x23')][_0x4402('0x43')]({'name':_0x5ab12b[_0x4402('0x25')],'resourceId':_0x5ab12b['id'],'type':_0x12d6de[_0x4402('0x25')],'sectionId':_0x12d6de['id']},{})['then'](function(){return _0x2b2ed3;});}else{return _0x2b2ed3;}})[_0x4402('0x3c')](function(_0x2a8085){logger[_0x4402('0x24')](_0x4402('0x49'),_0x2a8085);throw _0x2a8085;});}return _0x2b2ed3;})[_0x4402('0x1f')](respondWithResult(_0x5b094b,0xc9))[_0x4402('0x3c')](handleError(_0x5b094b,null));};exports['update']=function(_0xe8a8e9,_0x642ab4){if(_0xe8a8e9[_0x4402('0x44')]['id']){delete _0xe8a8e9[_0x4402('0x44')]['id'];}return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0xe8a8e9[_0x4402('0x3e')]['id']}})['then'](handleEntityNotFound(_0x642ab4,null))['then'](saveUpdates(_0xe8a8e9[_0x4402('0x44')],null))[_0x4402('0x1f')](respondWithResult(_0x642ab4,null))[_0x4402('0x3c')](handleError(_0x642ab4,null));};exports['destroy']=function(_0x5a076a,_0x258926){return db[_0x4402('0x28')][_0x4402('0x42')]({'where':{'id':_0x5a076a[_0x4402('0x3e')]['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x258926,null))[_0x4402('0x1f')](removeEntity(_0x258926,null))[_0x4402('0x3c')](handleError(_0x258926,null));};exports[_0x4402('0x4a')]=function(_0x394ac9,_0x3f2599,_0x353679){return db[_0x4402('0x28')][_0x4402('0x4b')]({'where':{'id':_0x394ac9['params']['id']}})[_0x4402('0x1f')](handleEntityNotFound(_0x3f2599,null))['then'](function(_0xe4530a){var _0x55922e;var _0x3fb9f0={},_0x1e5891={};_0x1e5891[_0x4402('0x2b')]=_[_0x4402('0x2d')](db[_0x4402('0x4c')][_0x4402('0x29')]);_0x1e5891['query']=_[_0x4402('0x2d')](_0x394ac9[_0x4402('0x2c')]);_0x1e5891[_0x4402('0x2e')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],_0x1e5891['query']);_0x3fb9f0[_0x4402('0x2f')]=_[_0x4402('0x3f')](_0x1e5891[_0x4402('0x2b')],qs[_0x4402('0x30')](_0x394ac9[_0x4402('0x2c')][_0x4402('0x30')]));_0x3fb9f0[_0x4402('0x2f')]=_0x3fb9f0[_0x4402('0x2f')]['length']?_0x3fb9f0[_0x4402('0x2f')]:_0x1e5891[_0x4402('0x2b')];if(!_0x394ac9['query'][_0x4402('0x32')](_0x4402('0x33'))){_0x3fb9f0['limit']=qs['limit'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x19')]);_0x3fb9f0[_0x4402('0x17')]=qs['offset'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x17')]);}_0x3fb9f0[_0x4402('0x4d')]=qs['sort'](_0x394ac9[_0x4402('0x2c')][_0x4402('0x34')]);_0x3fb9f0[_0x4402('0x35')]=qs['filters'](_[_0x4402('0x4e')](_0x394ac9[_0x4402('0x2c')],_0x1e5891['filters']));if(_0x394ac9['query'][_0x4402('0x36')]){_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'$or':_['map'](_0x3fb9f0['attributes'],function(_0x432c2e){var _0x42cdd6={};_0x42cdd6[_0x432c2e]={'$like':'%'+_0x394ac9[_0x4402('0x2c')][_0x4402('0x36')]+'%'};return _0x42cdd6;})});}_0x3fb9f0['where']=_[_0x4402('0x38')](_0x3fb9f0[_0x4402('0x35')],{'mailboxuser':_0xe4530a[_0x4402('0x4f')]});_0x3fb9f0=_[_0x4402('0x38')]({},_0x3fb9f0,_0x394ac9[_0x4402('0x41')]);return db[_0x4402('0x4c')][_0x4402('0x50')](_0x3fb9f0)['then'](respondWithFilteredResult(_0x3f2599,_0x3fb9f0));})[_0x4402('0x3c')](handleError(_0x3f2599,null));}; \ No newline at end of file +var _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4d9825,_0x5abdbc){var _0x204124=function(_0x2b6948){while(--_0x2b6948){_0x4d9825['push'](_0x4d9825['shift']());}};_0x204124(++_0x5abdbc);}(_0xae60,0x1c7));var _0x0ae6=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xae60[_0x59ee6f];return _0x4c0979;};'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(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c37334c..4dd523c 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 _0x9799=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment'];(function(_0x5adfc7,_0x38711c){var _0xa00a99=function(_0x2dfcb7){while(--_0x2dfcb7){_0x5adfc7['push'](_0x5adfc7['shift']());}};_0xa00a99(++_0x38711c);}(_0x9799,0x171));var _0x9979=function(_0x34c22e,_0x154d09){_0x34c22e=_0x34c22e-0x0;var _0x31de10=_0x9799[_0x34c22e];return _0x31de10;};'use strict';var _=require(_0x9979('0x0'));var util=require(_0x9979('0x1'));var logger=require(_0x9979('0x2'))(_0x9979('0x3'));var moment=require(_0x9979('0x4'));var BPromise=require(_0x9979('0x5'));var rp=require(_0x9979('0x6'));var fs=require('fs');var path=require(_0x9979('0x7'));var rimraf=require(_0x9979('0x8'));var config=require(_0x9979('0x9'));var attributes=require(_0x9979('0xa'));module[_0x9979('0xb')]=function(_0xaf7322,_0x47e2e6){return _0xaf7322[_0x9979('0xc')](_0x9979('0xd'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x9979('0xe'),'fields':[_0x9979('0xf'),_0x9979('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdea=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox','lodash','util','../../config/logger','moment'];(function(_0x283544,_0x43c431){var _0x4199dc=function(_0x976fb){while(--_0x976fb){_0x283544['push'](_0x283544['shift']());}};_0x4199dc(++_0x43c431);}(_0xfdea,0x7a));var _0xafde=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xfdea[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xafde('0x0'));var util=require(_0xafde('0x1'));var logger=require(_0xafde('0x2'))('api');var moment=require(_0xafde('0x3'));var BPromise=require(_0xafde('0x4'));var rp=require(_0xafde('0x5'));var fs=require('fs');var path=require(_0xafde('0x6'));var rimraf=require(_0xafde('0x7'));var config=require(_0xafde('0x8'));var attributes=require(_0xafde('0x9'));module[_0xafde('0xa')]=function(_0x370647,_0x354f4d){return _0x370647[_0xafde('0xb')](_0xafde('0xc'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xafde('0xd'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index c780724..fc77eb6 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 _0x2fef=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fef,0xbe));var _0xf2fe=function(_0x25ffd4,_0x16b31d){_0x25ffd4=_0x25ffd4-0x0;var _0x414452=_0x2fef[_0x25ffd4];return _0x414452;};'use strict';var _=require(_0xf2fe('0x0'));var util=require(_0xf2fe('0x1'));var moment=require(_0xf2fe('0x2'));var BPromise=require(_0xf2fe('0x3'));var rs=require(_0xf2fe('0x4'));var fs=require('fs');var Redis=require(_0xf2fe('0x5'));var db=require(_0xf2fe('0x6'))['db'];var utils=require(_0xf2fe('0x7'));var logger=require(_0xf2fe('0x8'))(_0xf2fe('0x9'));var config=require(_0xf2fe('0xa'));var jayson=require(_0xf2fe('0xb'));var client=jayson[_0xf2fe('0xc')][_0xf2fe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x473628,_0x4415c6,_0x1b743e){return new BPromise(function(_0x14be57,_0x180cfa){return client[_0xf2fe('0xe')](_0x473628,_0x1b743e)['then'](function(_0x101697){logger[_0xf2fe('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4415c6,_0xf2fe('0x10'));logger[_0xf2fe('0x11')](_0xf2fe('0x12'),_0x4415c6,_0xf2fe('0x10'),JSON[_0xf2fe('0x13')](_0x101697));if(_0x101697[_0xf2fe('0x14')]){if(_0x101697[_0xf2fe('0x14')][_0xf2fe('0x15')]===0x1f4){logger[_0xf2fe('0x14')](_0xf2fe('0x16'),_0x4415c6,_0x101697['error']['message']);return _0x180cfa(_0x101697[_0xf2fe('0x14')]['message']);}logger[_0xf2fe('0x14')](_0xf2fe('0x16'),_0x4415c6,_0x101697[_0xf2fe('0x14')][_0xf2fe('0x17')]);return _0x14be57(_0x101697['error'][_0xf2fe('0x17')]);}else{logger[_0xf2fe('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4415c6,'request\x20sent');_0x14be57(_0x101697[_0xf2fe('0x18')][_0xf2fe('0x17')]);}})[_0xf2fe('0x19')](function(_0x3522c2){logger[_0xf2fe('0x14')]('VoiceMail,\x20%s,\x20%s',_0x4415c6,_0x3522c2);_0x180cfa(_0x3522c2);});});} \ No newline at end of file +var _0x7f82=['request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5e6ca3,_0x2f4f32){var _0x49f185=function(_0x154938){while(--_0x154938){_0x5e6ca3['push'](_0x5e6ca3['shift']());}};_0x49f185(++_0x2f4f32);}(_0x7f82,0x64));var _0x27f8=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x7f82[_0x30cc1a];return _0xb3f18f;};'use strict';var _=require(_0x27f8('0x0'));var util=require(_0x27f8('0x1'));var moment=require(_0x27f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x27f8('0x3'));var fs=require('fs');var Redis=require(_0x27f8('0x4'));var db=require(_0x27f8('0x5'))['db'];var utils=require(_0x27f8('0x6'));var logger=require(_0x27f8('0x7'))('rpc');var config=require(_0x27f8('0x8'));var jayson=require(_0x27f8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e21ed,_0x2966fb,_0x5d9b48){return new BPromise(function(_0x530160,_0x38c283){return client[_0x27f8('0xa')](_0x4e21ed,_0x5d9b48)[_0x27f8('0xb')](function(_0x2c38c1){logger[_0x27f8('0xc')](_0x27f8('0xd'),_0x2966fb,_0x27f8('0xe'));logger[_0x27f8('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2966fb,'request\x20sent',JSON[_0x27f8('0x10')](_0x2c38c1));if(_0x2c38c1[_0x27f8('0x11')]){if(_0x2c38c1[_0x27f8('0x11')][_0x27f8('0x12')]===0x1f4){logger['error'](_0x27f8('0xd'),_0x2966fb,_0x2c38c1[_0x27f8('0x11')][_0x27f8('0x13')]);return _0x38c283(_0x2c38c1[_0x27f8('0x11')]['message']);}logger[_0x27f8('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2966fb,_0x2c38c1[_0x27f8('0x11')][_0x27f8('0x13')]);return _0x530160(_0x2c38c1['error'][_0x27f8('0x13')]);}else{logger[_0x27f8('0xc')](_0x27f8('0xd'),_0x2966fb,_0x27f8('0xe'));_0x530160(_0x2c38c1[_0x27f8('0x14')][_0x27f8('0x13')]);}})[_0x27f8('0x15')](function(_0x405071){logger[_0x27f8('0x11')](_0x27f8('0xd'),_0x2966fb,_0x405071);_0x38c283(_0x405071);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f6844c2..0b0e069 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 _0x706c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','path'];(function(_0x5a8aa3,_0x2294d5){var _0x5d0458=function(_0x62d096){while(--_0x62d096){_0x5a8aa3['push'](_0x5a8aa3['shift']());}};_0x5d0458(++_0x2294d5);}(_0x706c,0x97));var _0xc706=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x706c[_0x146484];return _0x4c7aa3;};'use strict';var multer=require(_0xc706('0x0'));var util=require(_0xc706('0x1'));var path=require(_0xc706('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc706('0x3')]();var fs_extra=require(_0xc706('0x4'));var auth=require(_0xc706('0x5'));var interaction=require(_0xc706('0x6'));var config=require(_0xc706('0x7'));var controller=require(_0xc706('0x8'));router[_0xc706('0x9')]('/',auth[_0xc706('0xa')](),controller[_0xc706('0xb')]);router[_0xc706('0x9')](_0xc706('0xc'),auth['isAuthenticated'](),controller[_0xc706('0xd')]);router[_0xc706('0x9')](_0xc706('0xe'),auth['isAuthenticated'](),controller[_0xc706('0xf')]);router[_0xc706('0x10')]('/',auth[_0xc706('0xa')](),controller[_0xc706('0x11')]);router[_0xc706('0x12')](_0xc706('0xc'),auth[_0xc706('0xa')](),controller[_0xc706('0x13')]);router[_0xc706('0x14')](_0xc706('0xc'),auth[_0xc706('0xa')](),controller['destroy']);module[_0xc706('0x15')]=router; \ No newline at end of file +var _0x957f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','put','update','/:id','destroy','util','path','connect-timeout','express'];(function(_0xca19df,_0xda79a5){var _0x512318=function(_0x530920){while(--_0x530920){_0xca19df['push'](_0xca19df['shift']());}};_0x512318(++_0xda79a5);}(_0x957f,0x1e2));var _0xf957=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x957f[_0x4da356];return _0x321b07;};'use strict';var multer=require('multer');var util=require(_0xf957('0x0'));var path=require(_0xf957('0x1'));var timeout=require(_0xf957('0x2'));var express=require(_0xf957('0x3'));var router=express['Router']();var fs_extra=require(_0xf957('0x4'));var auth=require(_0xf957('0x5'));var interaction=require(_0xf957('0x6'));var config=require(_0xf957('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xf957('0x8')]('/',auth[_0xf957('0x9')](),controller[_0xf957('0xa')]);router[_0xf957('0x8')]('/:id',auth[_0xf957('0x9')](),controller[_0xf957('0xb')]);router[_0xf957('0x8')](_0xf957('0xc'),auth[_0xf957('0x9')](),controller[_0xf957('0xd')]);router['post']('/',auth[_0xf957('0x9')](),controller['create']);router[_0xf957('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf957('0xf')]);router['delete'](_0xf957('0x10'),auth[_0xf957('0x9')](),controller[_0xf957('0x11')]);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 ca3425a..9a7ab9b 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 _0x9718=['exports','getDataValue','INTEGER','STRING','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x9718,0x77));var _0x8971=function(_0x274296,_0x2f326d){_0x274296=_0x274296-0x0;var _0x9693f=_0x9718[_0x274296];return _0x9693f;};'use strict';var Sequelize=require(_0x8971('0x0'));module[_0x8971('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x515724){return this[_0x8971('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8971('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x8971('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8971('0x4')],'defaultValue':''},'stamp':{'type':_0x8971('0x6'),'defaultValue':Sequelize['literal'](_0x8971('0x7'))}}; \ No newline at end of file +var _0x6be6=['getDataValue','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL'];(function(_0x3fe900,_0x25850c){var _0x7f3260=function(_0x4668fc){while(--_0x4668fc){_0x3fe900['push'](_0x3fe900['shift']());}};_0x7f3260(++_0x25850c);}(_0x6be6,0x1a6));var _0x66be=function(_0x329459,_0x2c043d){_0x329459=_0x329459-0x0;var _0x5c5178=_0x6be6[_0x329459];return _0x5c5178;};'use strict';var Sequelize=require('sequelize');module[_0x66be('0x0')]={'name':{'type':Sequelize[_0x66be('0x1')],'get':function(_0x26fe5e){return this[_0x66be('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x66be('0x4')](_0x66be('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x66be('0x3')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x66be('0x6')](_0x66be('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 1d7ed84..196c46b 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 _0x77b8=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','VoiceMailMessage','rows','catch','show','params','find','update','body','msg_id','recording','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy'];(function(_0x4eec59,_0x17cd41){var _0x549b73=function(_0x45e850){while(--_0x45e850){_0x4eec59['push'](_0x4eec59['shift']());}};_0x549b73(++_0x17cd41);}(_0x77b8,0x1b1));var _0x877b=function(_0x30b744,_0x52a74b){_0x30b744=_0x30b744-0x0;var _0x5abad5=_0x77b8[_0x30b744];return _0x5abad5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x877b('0x0'));var moment=require(_0x877b('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x877b('0x2'));var path=require(_0x877b('0x3'));var sox=require(_0x877b('0x4'));var csv=require(_0x877b('0x5'));var ejs=require(_0x877b('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x877b('0x7'));var squel=require(_0x877b('0x8'));var crypto=require(_0x877b('0x9'));var jsforce=require(_0x877b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x877b('0x5'));var querystring=require(_0x877b('0xb'));var Papa=require(_0x877b('0xc'));var Redis=require(_0x877b('0xd'));var authService=require(_0x877b('0xe'));var qs=require(_0x877b('0xf'));var as=require(_0x877b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x877b('0x11'))('api');var utils=require(_0x877b('0x12'));var config=require(_0x877b('0x13'));var licenseUtil=require(_0x877b('0x14'));var db=require(_0x877b('0x15'))['db'];function respondWithStatusCode(_0x4bdd2b,_0xf4ffa3){_0xf4ffa3=_0xf4ffa3||0xcc;return function(_0x4a7ac4){if(_0x4a7ac4){return _0x4bdd2b[_0x877b('0x16')](_0xf4ffa3);}return _0x4bdd2b[_0x877b('0x17')](_0xf4ffa3)['end']();};}function respondWithResult(_0x22e159,_0x7a36df){_0x7a36df=_0x7a36df||0xc8;return function(_0x2fe788){if(_0x2fe788){return _0x22e159[_0x877b('0x17')](_0x7a36df)[_0x877b('0x18')](_0x2fe788);}};}function respondWithFilteredResult(_0x4c0f01,_0x26d987){return function(_0x40fec2){if(_0x40fec2){var _0x57a3e7=typeof _0x26d987[_0x877b('0x19')]===_0x877b('0x1a')&&typeof _0x26d987[_0x877b('0x1b')]==='undefined';var _0x4624f2=_0x40fec2['count'];var _0x5cc26d=_0x57a3e7?0x0:_0x26d987[_0x877b('0x19')];var _0x45dd36=_0x57a3e7?_0x40fec2[_0x877b('0x1c')]:_0x26d987[_0x877b('0x19')]+_0x26d987[_0x877b('0x1b')];var _0x41dd0b;if(_0x45dd36>=_0x4624f2){_0x45dd36=_0x4624f2;_0x41dd0b=0xc8;}else{_0x41dd0b=0xce;}_0x4c0f01['status'](_0x41dd0b);return _0x4c0f01[_0x877b('0x1d')](_0x877b('0x1e'),_0x5cc26d+'-'+_0x45dd36+'/'+_0x4624f2)[_0x877b('0x18')](_0x40fec2);}return null;};}function patchUpdates(_0x43168c){return function(_0xa7edd4){try{jsonpatch[_0x877b('0x1f')](_0xa7edd4,_0x43168c,!![]);}catch(_0x213818){return BPromise['reject'](_0x213818);}return _0xa7edd4[_0x877b('0x20')]();};}function saveUpdates(_0xecd58a,_0x10d720){return function(_0x202159){if(_0x202159){return _0x202159['update'](_0xecd58a)[_0x877b('0x21')](function(_0x2db64c){return _0x2db64c;});}return null;};}function removeEntity(_0x25a7c0,_0xfa234e){return function(_0x1fd506){if(_0x1fd506){return _0x1fd506[_0x877b('0x22')]()[_0x877b('0x21')](function(){_0x25a7c0[_0x877b('0x17')](0xcc)[_0x877b('0x23')]();});}};}function handleEntityNotFound(_0x276362,_0x2399bc){return function(_0x424779){if(!_0x424779){_0x276362['sendStatus'](0x194);}return _0x424779;};}function handleError(_0x3bbe9b,_0x45144a){_0x45144a=_0x45144a||0x1f4;return function(_0x473f9e){logger[_0x877b('0x24')](_0x473f9e[_0x877b('0x25')]);if(_0x473f9e[_0x877b('0x26')]){delete _0x473f9e[_0x877b('0x26')];}_0x3bbe9b[_0x877b('0x17')](_0x45144a)[_0x877b('0x27')](_0x473f9e);};}exports['index']=function(_0x19f6de,_0x14dea1){var _0x1813ab={},_0x14de57={},_0x14e140={'count':0x0,'rows':[]};var _0x7cc273=_[_0x877b('0x28')](db['VoiceMailMessage'][_0x877b('0x29')],function(_0x5a8057){return{'name':_0x5a8057[_0x877b('0x2a')],'type':_0x5a8057[_0x877b('0x2b')][_0x877b('0x2c')]};});_0x14de57[_0x877b('0x2d')]=_[_0x877b('0x2e')](_['map'](_0x7cc273,_0x877b('0x26')),['name']);_0x14de57[_0x877b('0x2f')]=_[_0x877b('0x30')](_0x19f6de[_0x877b('0x2f')]);_0x14de57[_0x877b('0x31')]=_[_0x877b('0x32')](_0x14de57['model'],_0x14de57['query']);_0x1813ab[_0x877b('0x33')]=_[_0x877b('0x32')](_0x14de57[_0x877b('0x2d')],qs[_0x877b('0x34')](_0x19f6de[_0x877b('0x2f')][_0x877b('0x34')]));_0x1813ab[_0x877b('0x33')]=_0x1813ab[_0x877b('0x33')][_0x877b('0x35')]?_0x1813ab['attributes']:_0x14de57['model'];if(!_0x19f6de[_0x877b('0x2f')][_0x877b('0x36')](_0x877b('0x37'))){_0x1813ab[_0x877b('0x1b')]=qs[_0x877b('0x1b')](_0x19f6de['query'][_0x877b('0x1b')]);_0x1813ab[_0x877b('0x19')]=qs[_0x877b('0x19')](_0x19f6de[_0x877b('0x2f')][_0x877b('0x19')]);}_0x1813ab['order']=qs[_0x877b('0x38')](_0x19f6de[_0x877b('0x2f')]['sort']);_0x1813ab['where']=qs['filters'](_[_0x877b('0x39')](_0x19f6de['query'],_0x14de57[_0x877b('0x31')]),_0x7cc273);if(_0x19f6de[_0x877b('0x2f')]['filter']){_0x1813ab['where']=_[_0x877b('0x3a')](_0x1813ab[_0x877b('0x3b')],{'$or':_[_0x877b('0x28')](_0x7cc273,function(_0x4813e8){if(_0x4813e8['type']!==_0x877b('0x3c')){var _0x25082f={};_0x25082f[_0x4813e8[_0x877b('0x26')]]={'$like':'%'+_0x19f6de[_0x877b('0x2f')][_0x877b('0x3d')]+'%'};return _0x25082f;}})});}_0x1813ab=_[_0x877b('0x3a')]({},_0x1813ab,_0x19f6de[_0x877b('0x3e')]);var _0x397217={'where':_0x1813ab[_0x877b('0x3b')]};return db['VoiceMailMessage']['count'](_0x397217)[_0x877b('0x21')](function(_0x31161f){_0x14e140['count']=_0x31161f;if(_0x19f6de[_0x877b('0x2f')][_0x877b('0x3f')]){_0x1813ab[_0x877b('0x40')]=[{'all':!![]}];}return db[_0x877b('0x41')]['findAll'](_0x1813ab);})[_0x877b('0x21')](function(_0x4b0af9){_0x14e140[_0x877b('0x42')]=_0x4b0af9;return _0x14e140;})[_0x877b('0x21')](respondWithFilteredResult(_0x14dea1,_0x1813ab))[_0x877b('0x43')](handleError(_0x14dea1,null));};exports[_0x877b('0x44')]=function(_0x56781d,_0x2ba124){var _0x47954a={'raw':!![],'where':{'id':_0x56781d[_0x877b('0x45')]['id']}},_0x5488ca={};_0x5488ca['model']=_['keys'](db['VoiceMailMessage'][_0x877b('0x29')]);_0x5488ca[_0x877b('0x2f')]=_['keys'](_0x56781d[_0x877b('0x2f')]);_0x5488ca['filters']=_['intersection'](_0x5488ca[_0x877b('0x2d')],_0x5488ca['query']);_0x47954a[_0x877b('0x33')]=_['intersection'](_0x5488ca[_0x877b('0x2d')],qs['fields'](_0x56781d[_0x877b('0x2f')][_0x877b('0x34')]));_0x47954a[_0x877b('0x33')]=_0x47954a[_0x877b('0x33')]['length']?_0x47954a[_0x877b('0x33')]:_0x5488ca[_0x877b('0x2d')];if(_0x56781d[_0x877b('0x2f')][_0x877b('0x3f')]){_0x47954a[_0x877b('0x40')]=[{'all':!![]}];}_0x47954a=_[_0x877b('0x3a')]({},_0x47954a,_0x56781d[_0x877b('0x3e')]);return db[_0x877b('0x41')][_0x877b('0x46')](_0x47954a)[_0x877b('0x21')](handleEntityNotFound(_0x2ba124,null))[_0x877b('0x21')](respondWithResult(_0x2ba124,null))[_0x877b('0x43')](handleError(_0x2ba124,null));};exports['create']=function(_0x1321b1,_0x4cda13){return db[_0x877b('0x41')]['create'](_0x1321b1['body'],{})[_0x877b('0x21')](respondWithResult(_0x4cda13,0xc9))[_0x877b('0x43')](handleError(_0x4cda13,null));};exports[_0x877b('0x47')]=function(_0x57bfc3,_0x1d23d4){if(_0x57bfc3[_0x877b('0x48')]['id']){delete _0x57bfc3[_0x877b('0x48')]['id'];}return db[_0x877b('0x41')][_0x877b('0x46')]({'where':{'id':_0x57bfc3[_0x877b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d23d4,null))[_0x877b('0x21')](saveUpdates(_0x57bfc3['body'],null))[_0x877b('0x21')](respondWithResult(_0x1d23d4,null))['catch'](handleError(_0x1d23d4,null));};exports[_0x877b('0x22')]=function(_0x2feac2,_0x5ce7ba){return db[_0x877b('0x41')][_0x877b('0x46')]({'where':{'id':_0x2feac2[_0x877b('0x45')]['id']}})[_0x877b('0x21')](handleEntityNotFound(_0x5ce7ba,null))[_0x877b('0x21')](removeEntity(_0x5ce7ba,null))['catch'](handleError(_0x5ce7ba,null));};exports['download']=function(_0xbda91b,_0x476b98,_0x303a32){return db[_0x877b('0x41')]['find']({'where':{'id':_0xbda91b[_0x877b('0x45')]['id']},'attributes':['id','recording',_0x877b('0x49')]})['then'](handleEntityNotFound(_0x476b98,null))[_0x877b('0x21')](function(_0x3835cf){if(_0x3835cf){if(!_0x3835cf[_0x877b('0x4a')]){throw new db['Sequelize']['ValidationError'](_0x877b('0x4b'));}var _0x3e7e69={'Content-Type':_0x877b('0x4c'),'Content-Disposition':_0x877b('0x4d')};if(_0x3835cf[_0x877b('0x49')]){_0x3e7e69[_0x877b('0x4e')]='attachment;\x20filename=\x22'+_0x3835cf['msg_id']+_0x877b('0x4f');}_0x476b98[_0x877b('0x1d')](_0x3e7e69);return _0x476b98[_0x877b('0x27')](new Buffer(_0x3835cf['recording']));}})[_0x877b('0x43')](handleError(_0x476b98,null));}; \ No newline at end of file +var _0x410c=['recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','VoiceMailMessage','includeAll','findAll','rows','catch','show','params','fields','include','create','body','find','download'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x410c,0x161));var _0xc410=function(_0x525793,_0x271eb6){_0x525793=_0x525793-0x0;var _0x24fefb=_0x410c[_0x525793];return _0x24fefb;};'use strict';var emlformat=require(_0xc410('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc410('0x1'));var jsonpatch=require(_0xc410('0x2'));var rp=require(_0xc410('0x3'));var moment=require(_0xc410('0x4'));var BPromise=require(_0xc410('0x5'));var Mustache=require(_0xc410('0x6'));var util=require(_0xc410('0x7'));var path=require(_0xc410('0x8'));var sox=require(_0xc410('0x9'));var csv=require(_0xc410('0xa'));var ejs=require(_0xc410('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc410('0xc'));var squel=require('squel');var crypto=require(_0xc410('0xd'));var jsforce=require(_0xc410('0xe'));var deskjs=require(_0xc410('0xf'));var toCsv=require(_0xc410('0xa'));var querystring=require('querystring');var Papa=require(_0xc410('0x10'));var Redis=require(_0xc410('0x11'));var authService=require(_0xc410('0x12'));var qs=require(_0xc410('0x13'));var as=require(_0xc410('0x14'));var hardwareService=require(_0xc410('0x15'));var logger=require('../../config/logger')(_0xc410('0x16'));var utils=require(_0xc410('0x17'));var config=require(_0xc410('0x18'));var licenseUtil=require(_0xc410('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c17d3,_0x140b75){_0x140b75=_0x140b75||0xcc;return function(_0x3774e7){if(_0x3774e7){return _0x5c17d3[_0xc410('0x1a')](_0x140b75);}return _0x5c17d3[_0xc410('0x1b')](_0x140b75)[_0xc410('0x1c')]();};}function respondWithResult(_0x20464c,_0x1b68b5){_0x1b68b5=_0x1b68b5||0xc8;return function(_0x609b88){if(_0x609b88){return _0x20464c[_0xc410('0x1b')](_0x1b68b5)['json'](_0x609b88);}};}function respondWithFilteredResult(_0x558d79,_0x4a479b){return function(_0x1c67fc){if(_0x1c67fc){var _0x4cdade=typeof _0x4a479b[_0xc410('0x1d')]===_0xc410('0x1e')&&typeof _0x4a479b['limit']===_0xc410('0x1e');var _0x57fb32=_0x1c67fc[_0xc410('0x1f')];var _0x35ea8c=_0x4cdade?0x0:_0x4a479b[_0xc410('0x1d')];var _0x387a0c=_0x4cdade?_0x1c67fc['count']:_0x4a479b[_0xc410('0x1d')]+_0x4a479b[_0xc410('0x20')];var _0x36ba3a;if(_0x387a0c>=_0x57fb32){_0x387a0c=_0x57fb32;_0x36ba3a=0xc8;}else{_0x36ba3a=0xce;}_0x558d79['status'](_0x36ba3a);return _0x558d79[_0xc410('0x21')](_0xc410('0x22'),_0x35ea8c+'-'+_0x387a0c+'/'+_0x57fb32)['json'](_0x1c67fc);}return null;};}function patchUpdates(_0xaeb808){return function(_0x25ebbf){try{jsonpatch[_0xc410('0x23')](_0x25ebbf,_0xaeb808,!![]);}catch(_0x577063){return BPromise[_0xc410('0x24')](_0x577063);}return _0x25ebbf[_0xc410('0x25')]();};}function saveUpdates(_0x421904,_0x4f4602){return function(_0x1aceb3){if(_0x1aceb3){return _0x1aceb3[_0xc410('0x26')](_0x421904)[_0xc410('0x27')](function(_0x152997){return _0x152997;});}return null;};}function removeEntity(_0x158adf,_0x310580){return function(_0x3b86e1){if(_0x3b86e1){return _0x3b86e1[_0xc410('0x28')]()[_0xc410('0x27')](function(){_0x158adf[_0xc410('0x1b')](0xcc)[_0xc410('0x1c')]();});}};}function handleEntityNotFound(_0x343241,_0x232a13){return function(_0x32a236){if(!_0x32a236){_0x343241[_0xc410('0x1a')](0x194);}return _0x32a236;};}function handleError(_0x1598d3,_0x165653){_0x165653=_0x165653||0x1f4;return function(_0x5425cf){logger[_0xc410('0x29')](_0x5425cf[_0xc410('0x2a')]);if(_0x5425cf[_0xc410('0x2b')]){delete _0x5425cf[_0xc410('0x2b')];}_0x1598d3[_0xc410('0x1b')](_0x165653)['send'](_0x5425cf);};}exports[_0xc410('0x2c')]=function(_0x634549,_0x5bcce6){var _0xa1b2ab={},_0x8d2fae={},_0x3d1963={'count':0x0,'rows':[]};var _0x3eb28=_[_0xc410('0x2d')](db['VoiceMailMessage'][_0xc410('0x2e')],function(_0x594e6){return{'name':_0x594e6[_0xc410('0x2f')],'type':_0x594e6[_0xc410('0x30')][_0xc410('0x31')]};});_0x8d2fae['model']=_['differenceBy'](_[_0xc410('0x2d')](_0x3eb28,_0xc410('0x2b')),[_0xc410('0x2b')]);_0x8d2fae[_0xc410('0x32')]=_[_0xc410('0x33')](_0x634549['query']);_0x8d2fae['filters']=_[_0xc410('0x34')](_0x8d2fae[_0xc410('0x35')],_0x8d2fae[_0xc410('0x32')]);_0xa1b2ab['attributes']=_[_0xc410('0x34')](_0x8d2fae['model'],qs['fields'](_0x634549[_0xc410('0x32')]['fields']));_0xa1b2ab[_0xc410('0x36')]=_0xa1b2ab['attributes'][_0xc410('0x37')]?_0xa1b2ab[_0xc410('0x36')]:_0x8d2fae[_0xc410('0x35')];if(!_0x634549[_0xc410('0x32')]['hasOwnProperty']('nolimit')){_0xa1b2ab[_0xc410('0x20')]=qs[_0xc410('0x20')](_0x634549['query'][_0xc410('0x20')]);_0xa1b2ab['offset']=qs['offset'](_0x634549[_0xc410('0x32')][_0xc410('0x1d')]);}_0xa1b2ab[_0xc410('0x38')]=qs[_0xc410('0x39')](_0x634549[_0xc410('0x32')][_0xc410('0x39')]);_0xa1b2ab[_0xc410('0x3a')]=qs[_0xc410('0x3b')](_[_0xc410('0x3c')](_0x634549[_0xc410('0x32')],_0x8d2fae[_0xc410('0x3b')]),_0x3eb28);if(_0x634549[_0xc410('0x32')]['filter']){_0xa1b2ab[_0xc410('0x3a')]=_[_0xc410('0x3d')](_0xa1b2ab['where'],{'$or':_[_0xc410('0x2d')](_0x3eb28,function(_0x323be1){if(_0x323be1[_0xc410('0x30')]!==_0xc410('0x3e')){var _0x1f3254={};_0x1f3254[_0x323be1[_0xc410('0x2b')]]={'$like':'%'+_0x634549[_0xc410('0x32')][_0xc410('0x3f')]+'%'};return _0x1f3254;}})});}_0xa1b2ab=_[_0xc410('0x3d')]({},_0xa1b2ab,_0x634549['options']);var _0x1cb257={'where':_0xa1b2ab[_0xc410('0x3a')]};return db[_0xc410('0x40')][_0xc410('0x1f')](_0x1cb257)['then'](function(_0x1f1da2){_0x3d1963['count']=_0x1f1da2;if(_0x634549[_0xc410('0x32')][_0xc410('0x41')]){_0xa1b2ab['include']=[{'all':!![]}];}return db[_0xc410('0x40')][_0xc410('0x42')](_0xa1b2ab);})[_0xc410('0x27')](function(_0x3ab784){_0x3d1963[_0xc410('0x43')]=_0x3ab784;return _0x3d1963;})[_0xc410('0x27')](respondWithFilteredResult(_0x5bcce6,_0xa1b2ab))[_0xc410('0x44')](handleError(_0x5bcce6,null));};exports[_0xc410('0x45')]=function(_0x397481,_0xf2a950){var _0x54c864={'raw':!![],'where':{'id':_0x397481[_0xc410('0x46')]['id']}},_0x39a179={};_0x39a179[_0xc410('0x35')]=_[_0xc410('0x33')](db['VoiceMailMessage']['rawAttributes']);_0x39a179[_0xc410('0x32')]=_[_0xc410('0x33')](_0x397481['query']);_0x39a179[_0xc410('0x3b')]=_['intersection'](_0x39a179[_0xc410('0x35')],_0x39a179[_0xc410('0x32')]);_0x54c864[_0xc410('0x36')]=_[_0xc410('0x34')](_0x39a179[_0xc410('0x35')],qs[_0xc410('0x47')](_0x397481[_0xc410('0x32')]['fields']));_0x54c864['attributes']=_0x54c864[_0xc410('0x36')]['length']?_0x54c864[_0xc410('0x36')]:_0x39a179[_0xc410('0x35')];if(_0x397481[_0xc410('0x32')][_0xc410('0x41')]){_0x54c864[_0xc410('0x48')]=[{'all':!![]}];}_0x54c864=_['merge']({},_0x54c864,_0x397481['options']);return db[_0xc410('0x40')]['find'](_0x54c864)[_0xc410('0x27')](handleEntityNotFound(_0xf2a950,null))['then'](respondWithResult(_0xf2a950,null))['catch'](handleError(_0xf2a950,null));};exports[_0xc410('0x49')]=function(_0x28475e,_0x3bfae5){return db[_0xc410('0x40')][_0xc410('0x49')](_0x28475e['body'],{})[_0xc410('0x27')](respondWithResult(_0x3bfae5,0xc9))[_0xc410('0x44')](handleError(_0x3bfae5,null));};exports[_0xc410('0x26')]=function(_0x38c41f,_0x399ecb){if(_0x38c41f[_0xc410('0x4a')]['id']){delete _0x38c41f[_0xc410('0x4a')]['id'];}return db[_0xc410('0x40')]['find']({'where':{'id':_0x38c41f[_0xc410('0x46')]['id']}})[_0xc410('0x27')](handleEntityNotFound(_0x399ecb,null))[_0xc410('0x27')](saveUpdates(_0x38c41f[_0xc410('0x4a')],null))[_0xc410('0x27')](respondWithResult(_0x399ecb,null))['catch'](handleError(_0x399ecb,null));};exports[_0xc410('0x28')]=function(_0x229bf1,_0x714e6d){return db['VoiceMailMessage'][_0xc410('0x4b')]({'where':{'id':_0x229bf1[_0xc410('0x46')]['id']}})[_0xc410('0x27')](handleEntityNotFound(_0x714e6d,null))[_0xc410('0x27')](removeEntity(_0x714e6d,null))[_0xc410('0x44')](handleError(_0x714e6d,null));};exports[_0xc410('0x4c')]=function(_0x2d14d9,_0x3e16b3,_0x2a691d){return db[_0xc410('0x40')]['find']({'where':{'id':_0x2d14d9[_0xc410('0x46')]['id']},'attributes':['id',_0xc410('0x4d'),_0xc410('0x4e')]})[_0xc410('0x27')](handleEntityNotFound(_0x3e16b3,null))[_0xc410('0x27')](function(_0x58d9ae){if(_0x58d9ae){if(!_0x58d9ae[_0xc410('0x4d')]){throw new db['Sequelize'][(_0xc410('0x4f'))](_0xc410('0x50'));}var _0x229ca6={'Content-Type':'audio/wav','Content-Disposition':_0xc410('0x51')};if(_0x58d9ae[_0xc410('0x4e')]){_0x229ca6[_0xc410('0x52')]=_0xc410('0x53')+_0x58d9ae[_0xc410('0x4e')]+_0xc410('0x54');}_0x3e16b3['set'](_0x229ca6);return _0x3e16b3[_0xc410('0x55')](new Buffer(_0x58d9ae[_0xc410('0x4d')]));}})[_0xc410('0x44')](handleError(_0x3e16b3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6a378af..1ece55d 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 _0x3220=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','path','rimraf','./voiceMailMessage.attributes'];(function(_0x400df6,_0x3d3c27){var _0x360cd4=function(_0x59eb89){while(--_0x59eb89){_0x400df6['push'](_0x400df6['shift']());}};_0x360cd4(++_0x3d3c27);}(_0x3220,0x161));var _0x0322=function(_0x37de6e,_0x79a5ed){_0x37de6e=_0x37de6e-0x0;var _0x1e1132=_0x3220[_0x37de6e];return _0x1e1132;};'use strict';var _=require(_0x0322('0x0'));var util=require(_0x0322('0x1'));var logger=require(_0x0322('0x2'))('api');var moment=require(_0x0322('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0322('0x4'));var rimraf=require(_0x0322('0x5'));var config=require('../../config/environment');var attributes=require(_0x0322('0x6'));module[_0x0322('0x7')]=function(_0x4ff4f3,_0x26d7cb){return _0x4ff4f3[_0x0322('0x8')](_0x0322('0x9'),attributes,{'tableName':_0x0322('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x0322('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x91bf=['VoiceMailMessage','voice_voicemail_messages','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x91bf,0x1ba));var _0xf91b=function(_0x13f0e2,_0x1ca008){_0x13f0e2=_0x13f0e2-0x0;var _0x37b564=_0x91bf[_0x13f0e2];return _0x37b564;};'use strict';var _=require(_0xf91b('0x0'));var util=require('util');var logger=require(_0xf91b('0x1'))(_0xf91b('0x2'));var moment=require(_0xf91b('0x3'));var BPromise=require('bluebird');var rp=require(_0xf91b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf91b('0x5'));var attributes=require(_0xf91b('0x6'));module[_0xf91b('0x7')]=function(_0xbae226,_0x3151e1){return _0xbae226[_0xf91b('0x8')](_0xf91b('0x9'),attributes,{'tableName':_0xf91b('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5aebdf9..1fd7f50 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 _0xfd50=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x8a14f1,_0x137b10){var _0x41ff11=function(_0x35f522){while(--_0x35f522){_0x8a14f1['push'](_0x8a14f1['shift']());}};_0x41ff11(++_0x137b10);}(_0xfd50,0x111));var _0x0fd5=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xfd50[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0fd5('0x0'));var BPromise=require('bluebird');var rs=require(_0x0fd5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fd5('0x2'))['db'];var utils=require(_0x0fd5('0x3'));var logger=require(_0x0fd5('0x4'))(_0x0fd5('0x5'));var config=require(_0x0fd5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0fd5('0x7')][_0x0fd5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3615bb,_0x2ed0d4,_0x4157de){return new BPromise(function(_0x870699,_0x10f707){return client[_0x0fd5('0x9')](_0x3615bb,_0x4157de)[_0x0fd5('0xa')](function(_0x594377){logger[_0x0fd5('0xb')](_0x0fd5('0xc'),_0x2ed0d4,_0x0fd5('0xd'));logger[_0x0fd5('0xe')](_0x0fd5('0xf'),_0x2ed0d4,_0x0fd5('0xd'),JSON[_0x0fd5('0x10')](_0x594377));if(_0x594377[_0x0fd5('0x11')]){if(_0x594377['error'][_0x0fd5('0x12')]===0x1f4){logger['error'](_0x0fd5('0xc'),_0x2ed0d4,_0x594377[_0x0fd5('0x11')][_0x0fd5('0x13')]);return _0x10f707(_0x594377[_0x0fd5('0x11')]['message']);}logger[_0x0fd5('0x11')](_0x0fd5('0xc'),_0x2ed0d4,_0x594377[_0x0fd5('0x11')][_0x0fd5('0x13')]);return _0x870699(_0x594377[_0x0fd5('0x11')]['message']);}else{logger[_0x0fd5('0xb')](_0x0fd5('0xc'),_0x2ed0d4,_0x0fd5('0xd'));_0x870699(_0x594377['result']['message']);}})[_0x0fd5('0x14')](function(_0x5cc00e){logger[_0x0fd5('0x11')](_0x0fd5('0xc'),_0x2ed0d4,_0x5cc00e);_0x10f707(_0x5cc00e);});});} \ No newline at end of file +var _0xec08=['error','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1b622a,_0x38d3be){var _0x844677=function(_0x45b1cb){while(--_0x45b1cb){_0x1b622a['push'](_0x1b622a['shift']());}};_0x844677(++_0x38d3be);}(_0xec08,0xed));var _0x8ec0=function(_0x12e1ef,_0x4f8b9c){_0x12e1ef=_0x12e1ef-0x0;var _0x9bb985=_0xec08[_0x12e1ef];return _0x9bb985;};'use strict';var _=require('lodash');var util=require(_0x8ec0('0x0'));var moment=require(_0x8ec0('0x1'));var BPromise=require(_0x8ec0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ec0('0x3'))['db'];var utils=require(_0x8ec0('0x4'));var logger=require(_0x8ec0('0x5'))(_0x8ec0('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec0('0x7'));var client=jayson[_0x8ec0('0x8')][_0x8ec0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4554ee,_0x36d1e3,_0x50fd6c){return new BPromise(function(_0x5609ba,_0x54be5d){return client['request'](_0x4554ee,_0x50fd6c)[_0x8ec0('0xa')](function(_0x35fcd5){logger['info'](_0x8ec0('0xb'),_0x36d1e3,_0x8ec0('0xc'));logger[_0x8ec0('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x36d1e3,_0x8ec0('0xc'),JSON[_0x8ec0('0xe')](_0x35fcd5));if(_0x35fcd5[_0x8ec0('0xf')]){if(_0x35fcd5[_0x8ec0('0xf')]['code']===0x1f4){logger[_0x8ec0('0xf')](_0x8ec0('0xb'),_0x36d1e3,_0x35fcd5['error'][_0x8ec0('0x10')]);return _0x54be5d(_0x35fcd5[_0x8ec0('0xf')][_0x8ec0('0x10')]);}logger[_0x8ec0('0xf')](_0x8ec0('0xb'),_0x36d1e3,_0x35fcd5[_0x8ec0('0xf')][_0x8ec0('0x10')]);return _0x5609ba(_0x35fcd5[_0x8ec0('0xf')][_0x8ec0('0x10')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x36d1e3,_0x8ec0('0xc'));_0x5609ba(_0x35fcd5[_0x8ec0('0x11')]['message']);}})['catch'](function(_0x47aee8){logger[_0x8ec0('0xf')](_0x8ec0('0xb'),_0x36d1e3,_0x47aee8);_0x54be5d(_0x47aee8);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 7ee0572..001bc12 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 _0x4772=['delete','destroy','/:id/sounds/:id2','removeSound','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','/:id/sounds','getSounds','create','post'];(function(_0x4c5953,_0x1c192f){var _0x243c8a=function(_0x540016){while(--_0x540016){_0x4c5953['push'](_0x4c5953['shift']());}};_0x243c8a(++_0x1c192f);}(_0x4772,0x1e9));var _0x2477=function(_0x397c67,_0x460b61){_0x397c67=_0x397c67-0x0;var _0x45647c=_0x4772[_0x397c67];return _0x45647c;};'use strict';var multer=require('multer');var util=require(_0x2477('0x0'));var path=require(_0x2477('0x1'));var timeout=require(_0x2477('0x2'));var express=require(_0x2477('0x3'));var router=express[_0x2477('0x4')]();var fs_extra=require(_0x2477('0x5'));var auth=require(_0x2477('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2477('0x7'));var controller=require(_0x2477('0x8'));router['get']('/',auth[_0x2477('0x9')](),controller[_0x2477('0xa')]);router[_0x2477('0xb')](_0x2477('0xc'),auth[_0x2477('0x9')](),controller['show']);router[_0x2477('0xb')](_0x2477('0xd'),auth[_0x2477('0x9')](),controller[_0x2477('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2477('0xf')]);router[_0x2477('0x10')](_0x2477('0xd'),auth[_0x2477('0x9')](),controller['addSound']);router['put'](_0x2477('0xc'),auth[_0x2477('0x9')](),controller['update']);router[_0x2477('0x11')]('/:id',auth[_0x2477('0x9')](),controller[_0x2477('0x12')]);router[_0x2477('0x11')](_0x2477('0x13'),auth[_0x2477('0x9')](),controller[_0x2477('0x14')]);module[_0x2477('0x15')]=router; \ No newline at end of file +var _0x655a=['put','/:id','update','delete','/:id/sounds/:id2','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound'];(function(_0x353bc0,_0x14d747){var _0x1606f6=function(_0x363f40){while(--_0x363f40){_0x353bc0['push'](_0x353bc0['shift']());}};_0x1606f6(++_0x14d747);}(_0x655a,0x1d4));var _0xa655=function(_0xd51765,_0x380989){_0xd51765=_0xd51765-0x0;var _0x271a76=_0x655a[_0xd51765];return _0x271a76;};'use strict';var multer=require('multer');var util=require(_0xa655('0x0'));var path=require('path');var timeout=require(_0xa655('0x1'));var express=require(_0xa655('0x2'));var router=express[_0xa655('0x3')]();var fs_extra=require(_0xa655('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa655('0x5'));var config=require('../../config/environment');var controller=require(_0xa655('0x6'));router[_0xa655('0x7')]('/',auth[_0xa655('0x8')](),controller[_0xa655('0x9')]);router[_0xa655('0x7')]('/:id',auth[_0xa655('0x8')](),controller[_0xa655('0xa')]);router[_0xa655('0x7')](_0xa655('0xb'),auth['isAuthenticated'](),controller[_0xa655('0xc')]);router[_0xa655('0xd')]('/',auth['isAuthenticated'](),controller[_0xa655('0xe')]);router['post']('/:id/sounds',auth[_0xa655('0x8')](),controller[_0xa655('0xf')]);router[_0xa655('0x10')](_0xa655('0x11'),auth[_0xa655('0x8')](),controller[_0xa655('0x12')]);router[_0xa655('0x13')](_0xa655('0x11'),auth[_0xa655('0x8')](),controller['destroy']);router[_0xa655('0x13')](_0xa655('0x14'),auth['isAuthenticated'](),controller['removeSound']);module[_0xa655('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index ed83d50..c3908e5 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 _0x8b49=['STRING','name','ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha'];(function(_0x2374b5,_0x3d6a32){var _0x59b67c=function(_0x584bee){while(--_0x584bee){_0x2374b5['push'](_0x2374b5['shift']());}};_0x59b67c(++_0x3d6a32);}(_0x8b49,0x129));var _0x98b4=function(_0xe59cff,_0x1a7dbe){_0xe59cff=_0xe59cff-0x0;var _0x26e8c1=_0x8b49[_0xe59cff];return _0x26e8c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x98b4('0x0')],'allowNull':![],'unique':_0x98b4('0x1')},'mode':{'type':Sequelize[_0x98b4('0x2')]('custom',_0x98b4('0x3'),_0x98b4('0x4'),_0x98b4('0x5'),_0x98b4('0x6'),_0x98b4('0x7')),'allowNull':!![],'defaultValue':_0x98b4('0x3')},'directory':{'type':Sequelize[_0x98b4('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0x98b4('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x98b4('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x98b4('0x0')],'allowNull':!![],'defaultValue':_0x98b4('0x8')},'format':{'type':Sequelize[_0x98b4('0x0')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2a30=['STRING','mp3nb','quietmp3nb','quietmp3','mp3','files','alpha','TIMESTAMP','BOOLEAN','exports'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x2a30,0x153));var _0x02a3=function(_0x5d47a4,_0xe293a2){_0x5d47a4=_0x5d47a4-0x0;var _0x458778=_0x2a30[_0x5d47a4];return _0x458778;};'use strict';var Sequelize=require('sequelize');module[_0x02a3('0x0')]={'name':{'type':Sequelize[_0x02a3('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM']('custom','files',_0x02a3('0x2'),_0x02a3('0x3'),_0x02a3('0x4'),_0x02a3('0x5')),'allowNull':!![],'defaultValue':_0x02a3('0x6')},'directory':{'type':Sequelize[_0x02a3('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x02a3('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x02a3('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x02a3('0x7')},'format':{'type':Sequelize[_0x02a3('0x1')],'allowNull':!![]},'stamp':{'type':_0x02a3('0x8')},'defaultEntry':{'type':Sequelize[_0x02a3('0x9')],'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 67fd1c1..697f836 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 _0x5188=['undefined','limit','count','set','Content-Range','apply','save','update','destroy','MusicOnHolds','UserProfileResource','then','end','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','show','params','includeAll','include','find','catch','create','transaction','body','mode','files','directory','join','root','server/files/moh','mkdirSync','user','role','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','rmdirSync','ValidationError','message','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','Sequelize','removeSound','sequelize','id2','createdAt','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset'];(function(_0x48eddc,_0x5729b2){var _0xc8e91f=function(_0x1df926){while(--_0x1df926){_0x48eddc['push'](_0x48eddc['shift']());}};_0xc8e91f(++_0x5729b2);}(_0x5188,0x135));var _0x8518=function(_0xa66b3c,_0x1fc809){_0xa66b3c=_0xa66b3c-0x0;var _0x176640=_0x5188[_0xa66b3c];return _0x176640;};'use strict';var emlformat=require(_0x8518('0x0'));var rimraf=require(_0x8518('0x1'));var zipdir=require(_0x8518('0x2'));var jsonpatch=require(_0x8518('0x3'));var rp=require(_0x8518('0x4'));var moment=require(_0x8518('0x5'));var BPromise=require(_0x8518('0x6'));var Mustache=require('mustache');var util=require(_0x8518('0x7'));var path=require(_0x8518('0x8'));var sox=require(_0x8518('0x9'));var csv=require(_0x8518('0xa'));var ejs=require(_0x8518('0xb'));var fs=require('fs');var fs_extra=require(_0x8518('0xc'));var _=require(_0x8518('0xd'));var squel=require(_0x8518('0xe'));var crypto=require('crypto');var jsforce=require(_0x8518('0xf'));var deskjs=require(_0x8518('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8518('0x11'));var Papa=require('papaparse');var Redis=require(_0x8518('0x12'));var authService=require(_0x8518('0x13'));var qs=require(_0x8518('0x14'));var as=require(_0x8518('0x15'));var hardwareService=require(_0x8518('0x16'));var logger=require(_0x8518('0x17'))('api');var utils=require(_0x8518('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8518('0x19'))['db'];function respondWithStatusCode(_0xe6c9ba,_0x24c0d6){_0x24c0d6=_0x24c0d6||0xcc;return function(_0x4957a7){if(_0x4957a7){return _0xe6c9ba[_0x8518('0x1a')](_0x24c0d6);}return _0xe6c9ba[_0x8518('0x1b')](_0x24c0d6)['end']();};}function respondWithResult(_0x2a1b97,_0x41aefd){_0x41aefd=_0x41aefd||0xc8;return function(_0x2ed837){if(_0x2ed837){return _0x2a1b97[_0x8518('0x1b')](_0x41aefd)[_0x8518('0x1c')](_0x2ed837);}};}function respondWithFilteredResult(_0x2be346,_0x181185){return function(_0x55aea7){if(_0x55aea7){var _0x4c9b8d=typeof _0x181185[_0x8518('0x1d')]===_0x8518('0x1e')&&typeof _0x181185[_0x8518('0x1f')]===_0x8518('0x1e');var _0xf725fe=_0x55aea7[_0x8518('0x20')];var _0x41c57f=_0x4c9b8d?0x0:_0x181185[_0x8518('0x1d')];var _0x287b4d=_0x4c9b8d?_0x55aea7[_0x8518('0x20')]:_0x181185['offset']+_0x181185[_0x8518('0x1f')];var _0x757fdf;if(_0x287b4d>=_0xf725fe){_0x287b4d=_0xf725fe;_0x757fdf=0xc8;}else{_0x757fdf=0xce;}_0x2be346['status'](_0x757fdf);return _0x2be346[_0x8518('0x21')](_0x8518('0x22'),_0x41c57f+'-'+_0x287b4d+'/'+_0xf725fe)[_0x8518('0x1c')](_0x55aea7);}return null;};}function patchUpdates(_0x39e0aa){return function(_0xdf3eb9){try{jsonpatch[_0x8518('0x23')](_0xdf3eb9,_0x39e0aa,!![]);}catch(_0x4f2315){return BPromise['reject'](_0x4f2315);}return _0xdf3eb9[_0x8518('0x24')]();};}function saveUpdates(_0x69f9ec,_0xe1bc6a){return function(_0x45bdb8){if(_0x45bdb8){return _0x45bdb8[_0x8518('0x25')](_0x69f9ec)['then'](function(_0x2605ed){return _0x2605ed;});}return null;};}function removeEntity(_0xa13a4e,_0x4569f4){return function(_0x5409f1){if(_0x5409f1){return _0x5409f1[_0x8518('0x26')]()['then'](function(){var _0x468711=_0x5409f1['get']({'plain':!![]});var _0x40c29f=_0x8518('0x27');return db[_0x8518('0x28')][_0x8518('0x26')]({'where':{'type':_0x40c29f,'resourceId':_0x468711['id']}})[_0x8518('0x29')](function(){return _0x5409f1;});})[_0x8518('0x29')](function(){_0xa13a4e['status'](0xcc)[_0x8518('0x2a')]();});}};}function handleEntityNotFound(_0x5b5887,_0x46505a){return function(_0x494e33){if(!_0x494e33){_0x5b5887['sendStatus'](0x194);}return _0x494e33;};}function handleError(_0x3dbdc4,_0x1c5b36){_0x1c5b36=_0x1c5b36||0x1f4;return function(_0x2a51ba){logger['error'](_0x2a51ba[_0x8518('0x2b')]);if(_0x2a51ba[_0x8518('0x2c')]){delete _0x2a51ba['name'];}_0x3dbdc4[_0x8518('0x1b')](_0x1c5b36)[_0x8518('0x2d')](_0x2a51ba);};}exports[_0x8518('0x2e')]=function(_0x453641,_0xfc21f8){var _0x34a41c={},_0x5a0cd8={},_0x59d4e5={'count':0x0,'rows':[]};var _0x4efbda=_[_0x8518('0x2f')](db[_0x8518('0x30')][_0x8518('0x31')],function(_0x18bcaa){return{'name':_0x18bcaa[_0x8518('0x32')],'type':_0x18bcaa[_0x8518('0x33')]['key']};});_0x5a0cd8[_0x8518('0x34')]=_[_0x8518('0x2f')](_0x4efbda,_0x8518('0x2c'));_0x5a0cd8[_0x8518('0x35')]=_[_0x8518('0x36')](_0x453641[_0x8518('0x35')]);_0x5a0cd8['filters']=_[_0x8518('0x37')](_0x5a0cd8['model'],_0x5a0cd8[_0x8518('0x35')]);_0x34a41c[_0x8518('0x38')]=_[_0x8518('0x37')](_0x5a0cd8['model'],qs[_0x8518('0x39')](_0x453641[_0x8518('0x35')][_0x8518('0x39')]));_0x34a41c[_0x8518('0x38')]=_0x34a41c['attributes'][_0x8518('0x3a')]?_0x34a41c['attributes']:_0x5a0cd8['model'];if(!_0x453641[_0x8518('0x35')]['hasOwnProperty'](_0x8518('0x3b'))){_0x34a41c[_0x8518('0x1f')]=qs[_0x8518('0x1f')](_0x453641[_0x8518('0x35')][_0x8518('0x1f')]);_0x34a41c[_0x8518('0x1d')]=qs[_0x8518('0x1d')](_0x453641[_0x8518('0x35')][_0x8518('0x1d')]);}_0x34a41c[_0x8518('0x3c')]=qs[_0x8518('0x3d')](_0x453641[_0x8518('0x35')]['sort']);delete _0x453641['query']['sort'];_0x34a41c[_0x8518('0x3e')]=qs[_0x8518('0x3f')](_[_0x8518('0x40')](_0x453641[_0x8518('0x35')],_0x5a0cd8[_0x8518('0x3f')]),_0x4efbda);if(_0x453641[_0x8518('0x35')][_0x8518('0x41')]){_0x34a41c[_0x8518('0x3e')]=_['merge'](_0x34a41c[_0x8518('0x3e')],{'$or':_['map'](_0x4efbda,function(_0x222166){if(_0x222166[_0x8518('0x33')]!==_0x8518('0x42')){var _0x45d538={};_0x45d538[_0x222166[_0x8518('0x2c')]]={'$like':'%'+_0x453641[_0x8518('0x35')][_0x8518('0x41')]+'%'};return _0x45d538;}})});}_0x34a41c=_[_0x8518('0x43')]({},_0x34a41c,_0x453641[_0x8518('0x44')]);var _0x33c7b5={'where':_0x34a41c[_0x8518('0x3e')]};return db['VoiceMusicOnHold'][_0x8518('0x20')](_0x33c7b5)[_0x8518('0x29')](function(_0x41ec74){_0x59d4e5['count']=_0x41ec74;if(_0x453641[_0x8518('0x35')]['includeAll']){_0x34a41c['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x8518('0x45')](_0x34a41c);})[_0x8518('0x29')](function(_0xb7df7a){_0x59d4e5['rows']=_0xb7df7a;return _0x59d4e5;})['then'](respondWithFilteredResult(_0xfc21f8,_0x34a41c))['catch'](handleError(_0xfc21f8,null));};exports[_0x8518('0x46')]=function(_0x1dc2cf,_0x5d5bd1){var _0x1ea7db={'raw':![],'where':{'id':_0x1dc2cf[_0x8518('0x47')]['id']}},_0x597aa2={};_0x597aa2['model']=_[_0x8518('0x36')](db[_0x8518('0x30')][_0x8518('0x31')]);_0x597aa2[_0x8518('0x35')]=_[_0x8518('0x36')](_0x1dc2cf['query']);_0x597aa2[_0x8518('0x3f')]=_[_0x8518('0x37')](_0x597aa2[_0x8518('0x34')],_0x597aa2[_0x8518('0x35')]);_0x1ea7db['attributes']=_[_0x8518('0x37')](_0x597aa2[_0x8518('0x34')],qs[_0x8518('0x39')](_0x1dc2cf[_0x8518('0x35')][_0x8518('0x39')]));_0x1ea7db[_0x8518('0x38')]=_0x1ea7db[_0x8518('0x38')]['length']?_0x1ea7db[_0x8518('0x38')]:_0x597aa2[_0x8518('0x34')];if(_0x1dc2cf[_0x8518('0x35')][_0x8518('0x48')]){_0x1ea7db[_0x8518('0x49')]=[{'all':!![]}];}_0x1ea7db=_[_0x8518('0x43')]({},_0x1ea7db,_0x1dc2cf[_0x8518('0x44')]);return db['VoiceMusicOnHold'][_0x8518('0x4a')](_0x1ea7db)[_0x8518('0x29')](handleEntityNotFound(_0x5d5bd1,null))[_0x8518('0x29')](respondWithResult(_0x5d5bd1,null))[_0x8518('0x4b')](handleError(_0x5d5bd1,null));};exports[_0x8518('0x25')]=function(_0x39849d,_0x16c3f8){if(_0x39849d['body']['id']){delete _0x39849d['body']['id'];}return db[_0x8518('0x30')]['find']({'where':{'id':_0x39849d[_0x8518('0x47')]['id']}})[_0x8518('0x29')](handleEntityNotFound(_0x16c3f8,null))[_0x8518('0x29')](saveUpdates(_0x39849d['body'],null))[_0x8518('0x29')](respondWithResult(_0x16c3f8,null))[_0x8518('0x4b')](handleError(_0x16c3f8,null));};exports[_0x8518('0x4c')]=function(_0x24d8ea,_0x5d3bfb,_0x4e8627){return db['sequelize'][_0x8518('0x4d')](function(_0x1e7819){if(_0x24d8ea[_0x8518('0x4e')][_0x8518('0x4f')]===_0x8518('0x50')){_0x24d8ea['body'][_0x8518('0x51')]=path[_0x8518('0x52')](config[_0x8518('0x53')],_0x8518('0x54'),_0x24d8ea[_0x8518('0x4e')][_0x8518('0x2c')]);}return db[_0x8518('0x30')][_0x8518('0x4c')](_0x24d8ea['body'],{'transaction':_0x1e7819})[_0x8518('0x29')](function(_0x27d81e){if(_0x24d8ea['body'][_0x8518('0x4f')]===_0x8518('0x50')){fs[_0x8518('0x55')](_0x27d81e['directory'],parseInt('0777',0x8));}var _0x55dadb=_0x24d8ea[_0x8518('0x56')]['get']({'plain':!![]});if(!_0x55dadb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55dadb[_0x8518('0x57')]===_0x8518('0x56')){var _0x34adbf=_0x27d81e[_0x8518('0x58')]({'plain':!![]});return db[_0x8518('0x59')][_0x8518('0x4a')]({'where':{'name':_0x8518('0x27'),'userProfileId':_0x55dadb[_0x8518('0x5a')]},'raw':!![]})['then'](function(_0x2c85b0){if(_0x2c85b0&&_0x2c85b0[_0x8518('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x34adbf[_0x8518('0x2c')],'resourceId':_0x34adbf['id'],'type':_0x2c85b0[_0x8518('0x2c')],'sectionId':_0x2c85b0['id']},{})[_0x8518('0x29')](function(){return _0x27d81e;});}else{return _0x27d81e;}})[_0x8518('0x4b')](function(_0x48328a){logger[_0x8518('0x5c')](_0x8518('0x5d'),_0x48328a);});}return _0x27d81e;});})['then'](respondWithResult(_0x5d3bfb,0xc9))[_0x8518('0x4b')](handleError(_0x5d3bfb,null));};exports[_0x8518('0x26')]=function(_0x1732e9,_0x69a0e2,_0x3fc643){var _0x15b711;return db[_0x8518('0x30')][_0x8518('0x4a')]({'where':{'id':_0x1732e9[_0x8518('0x47')]['id']}})['then'](function(_0x5677f2){if(_0x5677f2){return db['sequelize'][_0x8518('0x4d')](function(_0x34c837){return _0x5677f2[_0x8518('0x26')]({'transaction':_0x34c837,'raw':!![]})[_0x8518('0x29')](function(_0x4ccf71){if(_0x4ccf71[_0x8518('0x51')]){fs['readdirSync'](_0x4ccf71[_0x8518('0x51')])['forEach'](function(_0x3e35bf){fs[_0x8518('0x5e')](path[_0x8518('0x52')](_0x4ccf71[_0x8518('0x51')],_0x3e35bf));});fs[_0x8518('0x5f')](_0x4ccf71[_0x8518('0x51')]);}return _0x4ccf71;});})[_0x8518('0x4b')](function(_0x502a34){throw new db['Sequelize'][(_0x8518('0x60'))](_0x502a34[_0x8518('0x61')]);});}})[_0x8518('0x29')](handleEntityNotFound(_0x69a0e2,null))[_0x8518('0x29')](removeEntity(_0x69a0e2,null))[_0x8518('0x4b')](handleError(_0x69a0e2,null));};exports['addSound']=function(_0x20dd56,_0x38fb42,_0x161154){return db['sequelize']['transaction'](function(_0x447e34){var _0x1bd8a8;return db[_0x8518('0x30')][_0x8518('0x4a')]({'where':{'id':_0x20dd56[_0x8518('0x47')]['id']}})[_0x8518('0x29')](function(_0x26873d){if(_0x26873d){_0x1bd8a8=_0x26873d;return _0x26873d['addSound'](_0x20dd56[_0x8518('0x4e')]['id'],{'transaction':_0x447e34});}})[_0x8518('0x29')](function(_0x537aef){if(_0x537aef){return db[_0x8518('0x62')][_0x8518('0x63')]({'where':{'id':_0x20dd56[_0x8518('0x4e')]['id']},'attributes':['id',_0x8518('0x2c'),_0x8518('0x64'),_0x8518('0x65'),'createdAt'],'raw':!![]});}})[_0x8518('0x29')](function(_0x42ac79){if(_0x42ac79){var _0x3f86f9=path[_0x8518('0x52')](config[_0x8518('0x53')],_0x8518('0x66'),util[_0x8518('0x67')](_0x8518('0x68'),path[_0x8518('0x69')](_0x42ac79[_0x8518('0x64')],path[_0x8518('0x6a')](_0x42ac79[_0x8518('0x64')])),_0x42ac79['converted_format']));var _0x30a2fa=path[_0x8518('0x52')](config[_0x8518('0x53')],_0x8518('0x54'),_0x1bd8a8[_0x8518('0x2c')],util[_0x8518('0x67')](_0x8518('0x68'),_0x42ac79[_0x8518('0x2c')],_0x42ac79[_0x8518('0x65')]));fs['symlinkSync'](_0x3f86f9,_0x30a2fa);return _0x42ac79;}})[_0x8518('0x4b')](function(_0x2a26fa){throw new db[(_0x8518('0x6b'))][(_0x8518('0x60'))](_0x2a26fa[_0x8518('0x61')]);});})[_0x8518('0x29')](handleEntityNotFound(_0x38fb42,null))[_0x8518('0x29')](respondWithResult(_0x38fb42,0xc9))[_0x8518('0x4b')](handleError(_0x38fb42,null));};exports[_0x8518('0x6c')]=function(_0x366e6c,_0x329294,_0x1c3d7d){return db[_0x8518('0x6d')][_0x8518('0x4d')](function(_0xda070f){var _0x3c1b9a;return db[_0x8518('0x30')][_0x8518('0x63')]({'where':{'id':_0x366e6c[_0x8518('0x47')]['id']}})[_0x8518('0x29')](handleEntityNotFound(_0x329294,null))[_0x8518('0x29')](function(_0x146db0){if(_0x146db0){_0x3c1b9a=_0x146db0;return _0x146db0['removeSound'](_0x366e6c[_0x8518('0x47')][_0x8518('0x6e')]);}})[_0x8518('0x29')](function(_0x3bafd4){if(_0x3bafd4){return db[_0x8518('0x62')]['findOne']({'where':{'id':_0x366e6c[_0x8518('0x47')][_0x8518('0x6e')]},'attributes':['id',_0x8518('0x2c'),_0x8518('0x64'),'converted_format',_0x8518('0x6f')],'raw':!![]});}})[_0x8518('0x29')](function(_0x28b5da){if(_0x28b5da){fs[_0x8518('0x5e')](path['join'](_0x3c1b9a[_0x8518('0x51')],util['format'](_0x8518('0x68'),_0x28b5da[_0x8518('0x2c')],_0x28b5da[_0x8518('0x65')])));return _0x28b5da;}})[_0x8518('0x4b')](function(_0x218089){throw new db[(_0x8518('0x6b'))][(_0x8518('0x60'))](_0x218089[_0x8518('0x61')]);});})[_0x8518('0x29')](handleEntityNotFound(_0x329294,null))[_0x8518('0x29')](respondWithStatusCode(_0x329294,0xcc))['catch'](handleError(_0x329294,null));};exports['getSounds']=function(_0x44dd26,_0x2a5862,_0x5c9ba8){var _0x28df15={};var _0x534e6e={};var _0x4dcccb;var _0xc40458;return db[_0x8518('0x30')][_0x8518('0x63')]({'where':{'id':_0x44dd26[_0x8518('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a5862,null))[_0x8518('0x29')](function(_0x1574e4){if(_0x1574e4){_0x4dcccb=_0x1574e4;_0x534e6e['model']=_[_0x8518('0x36')](db[_0x8518('0x62')][_0x8518('0x31')]);_0x534e6e[_0x8518('0x35')]=_[_0x8518('0x36')](_0x44dd26[_0x8518('0x35')]);_0x534e6e[_0x8518('0x3f')]=_[_0x8518('0x37')](_0x534e6e[_0x8518('0x34')],_0x534e6e[_0x8518('0x35')]);_0x28df15['attributes']=_[_0x8518('0x37')](_0x534e6e[_0x8518('0x34')],qs[_0x8518('0x39')](_0x44dd26['query']['fields']));_0x28df15[_0x8518('0x38')]=_0x28df15['attributes'][_0x8518('0x3a')]?_0x28df15[_0x8518('0x38')]:_0x534e6e['model'];_0x28df15[_0x8518('0x3c')]=qs[_0x8518('0x3d')](_0x44dd26[_0x8518('0x35')]['sort']);_0x28df15['where']=qs[_0x8518('0x3f')](_[_0x8518('0x40')](_0x44dd26[_0x8518('0x35')],_0x534e6e[_0x8518('0x3f')]));if(_0x44dd26[_0x8518('0x35')]['filter']){_0x28df15[_0x8518('0x3e')]=_['merge'](_0x28df15[_0x8518('0x3e')],{'$or':_[_0x8518('0x2f')](_0x28df15[_0x8518('0x38')],function(_0x26b9a5){var _0x21cf64={};_0x21cf64[_0x26b9a5]={'$like':'%'+_0x44dd26[_0x8518('0x35')]['filter']+'%'};return _0x21cf64;})});}_0x28df15=_[_0x8518('0x43')]({},_0x28df15,_0x44dd26[_0x8518('0x44')]);return _0x4dcccb[_0x8518('0x70')](_0x28df15);}})['then'](function(_0x16f263){if(_0x16f263){_0xc40458=_0x16f263[_0x8518('0x3a')];if(!_0x44dd26[_0x8518('0x35')]['hasOwnProperty'](_0x8518('0x3b'))){_0x28df15['limit']=qs[_0x8518('0x1f')](_0x44dd26[_0x8518('0x35')][_0x8518('0x1f')]);_0x28df15[_0x8518('0x1d')]=qs[_0x8518('0x1d')](_0x44dd26[_0x8518('0x35')]['offset']);}return _0x4dcccb[_0x8518('0x70')](_0x28df15);}})[_0x8518('0x29')](function(_0x2d8395){if(_0x2d8395){return _0x2d8395?{'count':_0xc40458,'rows':_0x2d8395}:null;}})['then'](respondWithResult(_0x2a5862,null))[_0x8518('0x4b')](handleError(_0x2a5862,null));}; \ No newline at end of file +var _0xbee2=['Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','body','find','sequelize','transaction','mode','files','directory','join','root','create','mkdirSync','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','symlinkSync','removeSound','id2','ValidationError','getSounds','order','pick','hasOwnProperty','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','offset','count'];(function(_0x5d13a2,_0x30962d){var _0x2e5eb1=function(_0x3920e2){while(--_0x3920e2){_0x5d13a2['push'](_0x5d13a2['shift']());}};_0x2e5eb1(++_0x30962d);}(_0xbee2,0x1a3));var _0x2bee=function(_0x295f7f,_0x561913){_0x295f7f=_0x295f7f-0x0;var _0x5cd7ab=_0xbee2[_0x295f7f];return _0x5cd7ab;};'use strict';var emlformat=require(_0x2bee('0x0'));var rimraf=require(_0x2bee('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2bee('0x2'));var moment=require(_0x2bee('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2bee('0x4'));var path=require(_0x2bee('0x5'));var sox=require(_0x2bee('0x6'));var csv=require(_0x2bee('0x7'));var ejs=require(_0x2bee('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bee('0x9'));var squel=require(_0x2bee('0xa'));var crypto=require(_0x2bee('0xb'));var jsforce=require(_0x2bee('0xc'));var deskjs=require(_0x2bee('0xd'));var toCsv=require(_0x2bee('0x7'));var querystring=require(_0x2bee('0xe'));var Papa=require(_0x2bee('0xf'));var Redis=require(_0x2bee('0x10'));var authService=require(_0x2bee('0x11'));var qs=require(_0x2bee('0x12'));var as=require(_0x2bee('0x13'));var hardwareService=require(_0x2bee('0x14'));var logger=require(_0x2bee('0x15'))(_0x2bee('0x16'));var utils=require(_0x2bee('0x17'));var config=require(_0x2bee('0x18'));var licenseUtil=require(_0x2bee('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x231a3f,_0x21e786){_0x21e786=_0x21e786||0xcc;return function(_0x283ec0){if(_0x283ec0){return _0x231a3f['sendStatus'](_0x21e786);}return _0x231a3f[_0x2bee('0x1a')](_0x21e786)[_0x2bee('0x1b')]();};}function respondWithResult(_0x20b9f5,_0x4fcb27){_0x4fcb27=_0x4fcb27||0xc8;return function(_0x5dd875){if(_0x5dd875){return _0x20b9f5[_0x2bee('0x1a')](_0x4fcb27)[_0x2bee('0x1c')](_0x5dd875);}};}function respondWithFilteredResult(_0x2ed8f0,_0x4ab981){return function(_0x28b71d){if(_0x28b71d){var _0x1a7204=typeof _0x4ab981['offset']===_0x2bee('0x1d')&&typeof _0x4ab981[_0x2bee('0x1e')]===_0x2bee('0x1d');var _0x4c82a5=_0x28b71d['count'];var _0x25b163=_0x1a7204?0x0:_0x4ab981[_0x2bee('0x1f')];var _0x44a4a2=_0x1a7204?_0x28b71d[_0x2bee('0x20')]:_0x4ab981['offset']+_0x4ab981['limit'];var _0x293a31;if(_0x44a4a2>=_0x4c82a5){_0x44a4a2=_0x4c82a5;_0x293a31=0xc8;}else{_0x293a31=0xce;}_0x2ed8f0[_0x2bee('0x1a')](_0x293a31);return _0x2ed8f0['set'](_0x2bee('0x21'),_0x25b163+'-'+_0x44a4a2+'/'+_0x4c82a5)[_0x2bee('0x1c')](_0x28b71d);}return null;};}function patchUpdates(_0x4e54df){return function(_0x4360e4){try{jsonpatch['apply'](_0x4360e4,_0x4e54df,!![]);}catch(_0x1130cc){return BPromise[_0x2bee('0x22')](_0x1130cc);}return _0x4360e4[_0x2bee('0x23')]();};}function saveUpdates(_0x191729,_0x34f663){return function(_0x3928a6){if(_0x3928a6){return _0x3928a6[_0x2bee('0x24')](_0x191729)[_0x2bee('0x25')](function(_0x5c0d60){return _0x5c0d60;});}return null;};}function removeEntity(_0x407ecd,_0x29ba5b){return function(_0x471e7d){if(_0x471e7d){return _0x471e7d[_0x2bee('0x26')]()[_0x2bee('0x25')](function(){var _0x460f43=_0x471e7d[_0x2bee('0x27')]({'plain':!![]});var _0x38506f=_0x2bee('0x28');return db[_0x2bee('0x29')][_0x2bee('0x26')]({'where':{'type':_0x38506f,'resourceId':_0x460f43['id']}})[_0x2bee('0x25')](function(){return _0x471e7d;});})[_0x2bee('0x25')](function(){_0x407ecd[_0x2bee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ae14,_0x135348){return function(_0x3529e7){if(!_0x3529e7){_0x29ae14[_0x2bee('0x2a')](0x194);}return _0x3529e7;};}function handleError(_0x4bd526,_0x191749){_0x191749=_0x191749||0x1f4;return function(_0x17f99c){logger[_0x2bee('0x2b')](_0x17f99c[_0x2bee('0x2c')]);if(_0x17f99c[_0x2bee('0x2d')]){delete _0x17f99c[_0x2bee('0x2d')];}_0x4bd526[_0x2bee('0x1a')](_0x191749)[_0x2bee('0x2e')](_0x17f99c);};}exports[_0x2bee('0x2f')]=function(_0x2f7ae4,_0x7ad457){var _0x5e9c00={},_0x1ec544={},_0x577961={'count':0x0,'rows':[]};var _0x2fcb13=_[_0x2bee('0x30')](db[_0x2bee('0x31')][_0x2bee('0x32')],function(_0x1119b3){return{'name':_0x1119b3[_0x2bee('0x33')],'type':_0x1119b3[_0x2bee('0x34')]['key']};});_0x1ec544[_0x2bee('0x35')]=_[_0x2bee('0x30')](_0x2fcb13,_0x2bee('0x2d'));_0x1ec544['query']=_[_0x2bee('0x36')](_0x2f7ae4[_0x2bee('0x37')]);_0x1ec544[_0x2bee('0x38')]=_[_0x2bee('0x39')](_0x1ec544[_0x2bee('0x35')],_0x1ec544[_0x2bee('0x37')]);_0x5e9c00[_0x2bee('0x3a')]=_[_0x2bee('0x39')](_0x1ec544[_0x2bee('0x35')],qs[_0x2bee('0x3b')](_0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x3b')]));_0x5e9c00[_0x2bee('0x3a')]=_0x5e9c00[_0x2bee('0x3a')][_0x2bee('0x3c')]?_0x5e9c00['attributes']:_0x1ec544['model'];if(!_0x2f7ae4[_0x2bee('0x37')]['hasOwnProperty'](_0x2bee('0x3d'))){_0x5e9c00[_0x2bee('0x1e')]=qs[_0x2bee('0x1e')](_0x2f7ae4[_0x2bee('0x37')]['limit']);_0x5e9c00['offset']=qs[_0x2bee('0x1f')](_0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x1f')]);}_0x5e9c00['order']=qs[_0x2bee('0x3e')](_0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x3e')]);delete _0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x3e')];_0x5e9c00[_0x2bee('0x3f')]=qs[_0x2bee('0x38')](_['pick'](_0x2f7ae4['query'],_0x1ec544['filters']),_0x2fcb13);if(_0x2f7ae4[_0x2bee('0x37')]['filter']){_0x5e9c00[_0x2bee('0x3f')]=_[_0x2bee('0x40')](_0x5e9c00[_0x2bee('0x3f')],{'$or':_[_0x2bee('0x30')](_0x2fcb13,function(_0x1f13aa){if(_0x1f13aa['type']!==_0x2bee('0x41')){var _0x36d849={};_0x36d849[_0x1f13aa[_0x2bee('0x2d')]]={'$like':'%'+_0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x42')]+'%'};return _0x36d849;}})});}_0x5e9c00=_[_0x2bee('0x40')]({},_0x5e9c00,_0x2f7ae4[_0x2bee('0x43')]);var _0x4f68db={'where':_0x5e9c00[_0x2bee('0x3f')]};return db[_0x2bee('0x31')][_0x2bee('0x20')](_0x4f68db)[_0x2bee('0x25')](function(_0x695a9){_0x577961[_0x2bee('0x20')]=_0x695a9;if(_0x2f7ae4[_0x2bee('0x37')][_0x2bee('0x44')]){_0x5e9c00['include']=[{'all':!![]}];}return db[_0x2bee('0x31')][_0x2bee('0x45')](_0x5e9c00);})[_0x2bee('0x25')](function(_0x27eb65){_0x577961['rows']=_0x27eb65;return _0x577961;})[_0x2bee('0x25')](respondWithFilteredResult(_0x7ad457,_0x5e9c00))[_0x2bee('0x46')](handleError(_0x7ad457,null));};exports[_0x2bee('0x47')]=function(_0x3fbf14,_0x6983ab){var _0x430481={'raw':![],'where':{'id':_0x3fbf14[_0x2bee('0x48')]['id']}},_0x2d5f5d={};_0x2d5f5d[_0x2bee('0x35')]=_[_0x2bee('0x36')](db['VoiceMusicOnHold'][_0x2bee('0x32')]);_0x2d5f5d['query']=_[_0x2bee('0x36')](_0x3fbf14['query']);_0x2d5f5d[_0x2bee('0x38')]=_[_0x2bee('0x39')](_0x2d5f5d[_0x2bee('0x35')],_0x2d5f5d['query']);_0x430481[_0x2bee('0x3a')]=_[_0x2bee('0x39')](_0x2d5f5d['model'],qs[_0x2bee('0x3b')](_0x3fbf14[_0x2bee('0x37')][_0x2bee('0x3b')]));_0x430481['attributes']=_0x430481[_0x2bee('0x3a')][_0x2bee('0x3c')]?_0x430481[_0x2bee('0x3a')]:_0x2d5f5d[_0x2bee('0x35')];if(_0x3fbf14['query'][_0x2bee('0x44')]){_0x430481[_0x2bee('0x49')]=[{'all':!![]}];}_0x430481=_[_0x2bee('0x40')]({},_0x430481,_0x3fbf14[_0x2bee('0x43')]);return db[_0x2bee('0x31')]['find'](_0x430481)[_0x2bee('0x25')](handleEntityNotFound(_0x6983ab,null))[_0x2bee('0x25')](respondWithResult(_0x6983ab,null))[_0x2bee('0x46')](handleError(_0x6983ab,null));};exports['update']=function(_0x54c91f,_0x23bfda){if(_0x54c91f[_0x2bee('0x4a')]['id']){delete _0x54c91f[_0x2bee('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x2bee('0x4b')]({'where':{'id':_0x54c91f[_0x2bee('0x48')]['id']}})[_0x2bee('0x25')](handleEntityNotFound(_0x23bfda,null))[_0x2bee('0x25')](saveUpdates(_0x54c91f[_0x2bee('0x4a')],null))[_0x2bee('0x25')](respondWithResult(_0x23bfda,null))['catch'](handleError(_0x23bfda,null));};exports['create']=function(_0x414e80,_0x92dc7c,_0x4f1b50){return db[_0x2bee('0x4c')][_0x2bee('0x4d')](function(_0x16b771){if(_0x414e80[_0x2bee('0x4a')][_0x2bee('0x4e')]===_0x2bee('0x4f')){_0x414e80['body'][_0x2bee('0x50')]=path[_0x2bee('0x51')](config[_0x2bee('0x52')],'server/files/moh',_0x414e80[_0x2bee('0x4a')][_0x2bee('0x2d')]);}return db[_0x2bee('0x31')][_0x2bee('0x53')](_0x414e80[_0x2bee('0x4a')],{'transaction':_0x16b771})['then'](function(_0x53c358){if(_0x414e80[_0x2bee('0x4a')][_0x2bee('0x4e')]===_0x2bee('0x4f')){fs[_0x2bee('0x54')](_0x53c358['directory'],parseInt('0777',0x8));}var _0x334c15=_0x414e80[_0x2bee('0x55')][_0x2bee('0x27')]({'plain':!![]});if(!_0x334c15)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x334c15[_0x2bee('0x56')]===_0x2bee('0x55')){var _0x58c5d3=_0x53c358[_0x2bee('0x27')]({'plain':!![]});return db[_0x2bee('0x57')][_0x2bee('0x4b')]({'where':{'name':_0x2bee('0x28'),'userProfileId':_0x334c15[_0x2bee('0x58')]},'raw':!![]})[_0x2bee('0x25')](function(_0x3ab967){if(_0x3ab967&&_0x3ab967[_0x2bee('0x59')]===0x0){return db[_0x2bee('0x29')]['create']({'name':_0x58c5d3[_0x2bee('0x2d')],'resourceId':_0x58c5d3['id'],'type':_0x3ab967['name'],'sectionId':_0x3ab967['id']},{})['then'](function(){return _0x53c358;});}else{return _0x53c358;}})['catch'](function(_0x5bf6d0){logger[_0x2bee('0x2b')](_0x2bee('0x5a'),_0x5bf6d0);});}return _0x53c358;});})[_0x2bee('0x25')](respondWithResult(_0x92dc7c,0xc9))[_0x2bee('0x46')](handleError(_0x92dc7c,null));};exports['destroy']=function(_0x2086f3,_0x4c51bd,_0xd8b257){var _0x29120e;return db[_0x2bee('0x31')]['find']({'where':{'id':_0x2086f3['params']['id']}})[_0x2bee('0x25')](function(_0x5ed3e1){if(_0x5ed3e1){return db[_0x2bee('0x4c')][_0x2bee('0x4d')](function(_0x551790){return _0x5ed3e1['destroy']({'transaction':_0x551790,'raw':!![]})[_0x2bee('0x25')](function(_0x20cb36){if(_0x20cb36[_0x2bee('0x50')]){fs[_0x2bee('0x5b')](_0x20cb36['directory'])[_0x2bee('0x5c')](function(_0x469dc6){fs[_0x2bee('0x5d')](path[_0x2bee('0x51')](_0x20cb36[_0x2bee('0x50')],_0x469dc6));});fs['rmdirSync'](_0x20cb36[_0x2bee('0x50')]);}return _0x20cb36;});})[_0x2bee('0x46')](function(_0x91a86d){throw new db[(_0x2bee('0x5e'))]['ValidationError'](_0x91a86d[_0x2bee('0x5f')]);});}})['then'](handleEntityNotFound(_0x4c51bd,null))['then'](removeEntity(_0x4c51bd,null))[_0x2bee('0x46')](handleError(_0x4c51bd,null));};exports[_0x2bee('0x60')]=function(_0x194194,_0xbe20e4,_0x53468f){return db[_0x2bee('0x4c')][_0x2bee('0x4d')](function(_0x5a76fc){var _0x2baf22;return db[_0x2bee('0x31')][_0x2bee('0x4b')]({'where':{'id':_0x194194[_0x2bee('0x48')]['id']}})[_0x2bee('0x25')](function(_0x101a46){if(_0x101a46){_0x2baf22=_0x101a46;return _0x101a46[_0x2bee('0x60')](_0x194194['body']['id'],{'transaction':_0x5a76fc});}})[_0x2bee('0x25')](function(_0xb9d5b1){if(_0xb9d5b1){return db[_0x2bee('0x61')][_0x2bee('0x62')]({'where':{'id':_0x194194[_0x2bee('0x4a')]['id']},'attributes':['id',_0x2bee('0x2d'),_0x2bee('0x63'),_0x2bee('0x64'),_0x2bee('0x65')],'raw':!![]});}})['then'](function(_0x4891c5){if(_0x4891c5){var _0x1dbfb7=path[_0x2bee('0x51')](config[_0x2bee('0x52')],_0x2bee('0x66'),util[_0x2bee('0x67')](_0x2bee('0x68'),path['basename'](_0x4891c5['save_name'],path['extname'](_0x4891c5[_0x2bee('0x63')])),_0x4891c5[_0x2bee('0x64')]));var _0x25dcf9=path[_0x2bee('0x51')](config[_0x2bee('0x52')],'server/files/moh',_0x2baf22['name'],util[_0x2bee('0x67')](_0x2bee('0x68'),_0x4891c5['name'],_0x4891c5[_0x2bee('0x64')]));fs[_0x2bee('0x69')](_0x1dbfb7,_0x25dcf9);return _0x4891c5;}})[_0x2bee('0x46')](function(_0x1f9d69){throw new db[(_0x2bee('0x5e'))]['ValidationError'](_0x1f9d69[_0x2bee('0x5f')]);});})['then'](handleEntityNotFound(_0xbe20e4,null))[_0x2bee('0x25')](respondWithResult(_0xbe20e4,0xc9))[_0x2bee('0x46')](handleError(_0xbe20e4,null));};exports[_0x2bee('0x6a')]=function(_0x431543,_0x5f14d3,_0x4e52ed){return db['sequelize'][_0x2bee('0x4d')](function(_0x52e62f){var _0x2388d6;return db[_0x2bee('0x31')][_0x2bee('0x62')]({'where':{'id':_0x431543[_0x2bee('0x48')]['id']}})[_0x2bee('0x25')](handleEntityNotFound(_0x5f14d3,null))[_0x2bee('0x25')](function(_0x418240){if(_0x418240){_0x2388d6=_0x418240;return _0x418240[_0x2bee('0x6a')](_0x431543[_0x2bee('0x48')][_0x2bee('0x6b')]);}})[_0x2bee('0x25')](function(_0xb18ab4){if(_0xb18ab4){return db[_0x2bee('0x61')][_0x2bee('0x62')]({'where':{'id':_0x431543[_0x2bee('0x48')][_0x2bee('0x6b')]},'attributes':['id',_0x2bee('0x2d'),_0x2bee('0x63'),_0x2bee('0x64'),_0x2bee('0x65')],'raw':!![]});}})['then'](function(_0x1b491d){if(_0x1b491d){fs[_0x2bee('0x5d')](path['join'](_0x2388d6[_0x2bee('0x50')],util[_0x2bee('0x67')]('%s.%s',_0x1b491d[_0x2bee('0x2d')],_0x1b491d[_0x2bee('0x64')])));return _0x1b491d;}})[_0x2bee('0x46')](function(_0x5c73b9){throw new db['Sequelize'][(_0x2bee('0x6c'))](_0x5c73b9[_0x2bee('0x5f')]);});})['then'](handleEntityNotFound(_0x5f14d3,null))[_0x2bee('0x25')](respondWithStatusCode(_0x5f14d3,0xcc))[_0x2bee('0x46')](handleError(_0x5f14d3,null));};exports[_0x2bee('0x6d')]=function(_0x55878f,_0x59fe39,_0x1c6979){var _0x36a971={};var _0x201f78={};var _0x4c35b8;var _0x131a00;return db['VoiceMusicOnHold'][_0x2bee('0x62')]({'where':{'id':_0x55878f[_0x2bee('0x48')]['id']}})[_0x2bee('0x25')](handleEntityNotFound(_0x59fe39,null))[_0x2bee('0x25')](function(_0x36fc67){if(_0x36fc67){_0x4c35b8=_0x36fc67;_0x201f78[_0x2bee('0x35')]=_[_0x2bee('0x36')](db[_0x2bee('0x61')][_0x2bee('0x32')]);_0x201f78[_0x2bee('0x37')]=_['keys'](_0x55878f[_0x2bee('0x37')]);_0x201f78[_0x2bee('0x38')]=_[_0x2bee('0x39')](_0x201f78[_0x2bee('0x35')],_0x201f78['query']);_0x36a971[_0x2bee('0x3a')]=_[_0x2bee('0x39')](_0x201f78['model'],qs['fields'](_0x55878f[_0x2bee('0x37')][_0x2bee('0x3b')]));_0x36a971[_0x2bee('0x3a')]=_0x36a971[_0x2bee('0x3a')][_0x2bee('0x3c')]?_0x36a971[_0x2bee('0x3a')]:_0x201f78[_0x2bee('0x35')];_0x36a971[_0x2bee('0x6e')]=qs[_0x2bee('0x3e')](_0x55878f[_0x2bee('0x37')]['sort']);_0x36a971['where']=qs[_0x2bee('0x38')](_[_0x2bee('0x6f')](_0x55878f['query'],_0x201f78[_0x2bee('0x38')]));if(_0x55878f[_0x2bee('0x37')][_0x2bee('0x42')]){_0x36a971[_0x2bee('0x3f')]=_['merge'](_0x36a971['where'],{'$or':_[_0x2bee('0x30')](_0x36a971[_0x2bee('0x3a')],function(_0x6e8baa){var _0x486115={};_0x486115[_0x6e8baa]={'$like':'%'+_0x55878f[_0x2bee('0x37')]['filter']+'%'};return _0x486115;})});}_0x36a971=_['merge']({},_0x36a971,_0x55878f[_0x2bee('0x43')]);return _0x4c35b8[_0x2bee('0x6d')](_0x36a971);}})[_0x2bee('0x25')](function(_0x42565d){if(_0x42565d){_0x131a00=_0x42565d['length'];if(!_0x55878f[_0x2bee('0x37')][_0x2bee('0x70')]('nolimit')){_0x36a971[_0x2bee('0x1e')]=qs[_0x2bee('0x1e')](_0x55878f[_0x2bee('0x37')][_0x2bee('0x1e')]);_0x36a971[_0x2bee('0x1f')]=qs[_0x2bee('0x1f')](_0x55878f[_0x2bee('0x37')][_0x2bee('0x1f')]);}return _0x4c35b8[_0x2bee('0x6d')](_0x36a971);}})[_0x2bee('0x25')](function(_0x31a2db){if(_0x31a2db){return _0x31a2db?{'count':_0x131a00,'rows':_0x31a2db}:null;}})['then'](respondWithResult(_0x59fe39,null))[_0x2bee('0x46')](handleError(_0x59fe39,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 93399e6..88f3f37 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 _0xad4b=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold','lodash'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xad4b,0xd0));var _0xbad4=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xad4b[_0x381589];return _0x2a075d;};'use strict';var _=require(_0xbad4('0x0'));var util=require(_0xbad4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbad4('0x2'));var BPromise=require(_0xbad4('0x3'));var rp=require(_0xbad4('0x4'));var fs=require('fs');var path=require(_0xbad4('0x5'));var rimraf=require(_0xbad4('0x6'));var config=require(_0xbad4('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xbad4('0x8')]=function(_0x4ab4c9,_0x3b2c88){return _0x4ab4c9[_0xbad4('0x9')](_0xbad4('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8750=['lodash','../../config/logger','api','moment','request-promise','path','exports','define','voice_musiconhold'];(function(_0xcf6b99,_0xb91137){var _0x385b7f=function(_0x328780){while(--_0x328780){_0xcf6b99['push'](_0xcf6b99['shift']());}};_0x385b7f(++_0xb91137);}(_0x8750,0x90));var _0x0875=function(_0x57ba2a,_0x310ba9){_0x57ba2a=_0x57ba2a-0x0;var _0x305871=_0x8750[_0x57ba2a];return _0x305871;};'use strict';var _=require(_0x0875('0x0'));var util=require('util');var logger=require(_0x0875('0x1'))(_0x0875('0x2'));var moment=require(_0x0875('0x3'));var BPromise=require('bluebird');var rp=require(_0x0875('0x4'));var fs=require('fs');var path=require(_0x0875('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x0875('0x6')]=function(_0xfceebe,_0x11c3ef){return _0xfceebe[_0x0875('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0x0875('0x8'),'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 4b8a88a..6f06706 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3586cf,_0x524b8a){var _0x95c436=function(_0x1cb2b5){while(--_0x1cb2b5){_0x3586cf['push'](_0x3586cf['shift']());}};_0x95c436(++_0x524b8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xd71d46,_0x3ffc5f){var _0x449a01=function(_0x532ef4){while(--_0x532ef4){_0xd71d46['push'](_0xd71d46['shift']());}};_0x449a01(++_0x3ffc5f);}(_0x70e0,0x17b));var _0x070e=function(_0x5cc535,_0x199078){_0x5cc535=_0x5cc535-0x0;var _0x785b65=_0x70e0[_0x5cc535];return _0x785b65;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2b17c64..c92b6ac 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 _0xcddd=['../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','/:id','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','addTeams','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x7ecbe4,_0x4fd8d4){var _0x5873c2=function(_0x411026){while(--_0x411026){_0x7ecbe4['push'](_0x7ecbe4['shift']());}};_0x5873c2(++_0x4fd8d4);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x17814d,_0x4ec055){_0x17814d=_0x17814d-0x0;var _0x479b2f=_0xcddd[_0x17814d];return _0x479b2f;};'use strict';var multer=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var path=require(_0xdcdd('0x2'));var timeout=require(_0xdcdd('0x3'));var express=require(_0xdcdd('0x4'));var router=express[_0xdcdd('0x5')]();var fs_extra=require(_0xdcdd('0x6'));var auth=require(_0xdcdd('0x7'));var interaction=require(_0xdcdd('0x8'));var config=require(_0xdcdd('0x9'));var controller=require(_0xdcdd('0xa'));router[_0xdcdd('0xb')]('/',auth['isAuthenticated'](),controller[_0xdcdd('0xc')]);router[_0xdcdd('0xb')]('/describe',auth[_0xdcdd('0xd')](),controller['describe']);router[_0xdcdd('0xb')](_0xdcdd('0xe'),auth[_0xdcdd('0xd')](),controller['show']);router[_0xdcdd('0xb')]('/:id/users',auth[_0xdcdd('0xd')](),controller[_0xdcdd('0xf')]);router['get'](_0xdcdd('0x10'),auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x11')]);router[_0xdcdd('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdcdd('0x12')](_0xdcdd('0x13'),auth['isAuthenticated'](),controller[_0xdcdd('0x14')]);router[_0xdcdd('0x12')](_0xdcdd('0x10'),auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x15')]);router['put'](_0xdcdd('0xe'),auth[_0xdcdd('0xd')](),controller['update']);router[_0xdcdd('0x16')](_0xdcdd('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xdcdd('0x16')]('/:id/users',auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x17')]);router[_0xdcdd('0x16')](_0xdcdd('0x10'),auth[_0xdcdd('0xd')](),controller[_0xdcdd('0x18')]);module['exports']=router; \ No newline at end of file +var _0xb43b=['getTeams','post','/:id/teams','addTeams','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents'];(function(_0x446a9d,_0x914894){var _0x543c55=function(_0x2fa2e1){while(--_0x2fa2e1){_0x446a9d['push'](_0x446a9d['shift']());}};_0x543c55(++_0x914894);}(_0xb43b,0xbf));var _0xbb43=function(_0x191bdf,_0x4dd219){_0x191bdf=_0x191bdf-0x0;var _0x19d2e8=_0xb43b[_0x191bdf];return _0x19d2e8;};'use strict';var multer=require(_0xbb43('0x0'));var util=require('util');var path=require(_0xbb43('0x1'));var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require(_0xbb43('0x5'));var auth=require(_0xbb43('0x6'));var interaction=require(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var controller=require(_0xbb43('0x9'));router[_0xbb43('0xa')]('/',auth[_0xbb43('0xb')](),controller['index']);router[_0xbb43('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xbb43('0xc')]);router[_0xbb43('0xa')](_0xbb43('0xd'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xe')]);router['get'](_0xbb43('0xf'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0xa')]('/:id/teams',auth[_0xbb43('0xb')](),controller[_0xbb43('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbb43('0x12')]('/:id/users',auth[_0xbb43('0xb')](),controller['addAgents']);router[_0xbb43('0x12')](_0xbb43('0x13'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth[_0xbb43('0xb')](),controller['update']);router[_0xbb43('0x16')](_0xbb43('0xd'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x17')]);router[_0xbb43('0x16')](_0xbb43('0xf'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x18')]);router[_0xbb43('0x16')](_0xbb43('0x13'),auth[_0xbb43('0xb')](),controller['removeTeams']);module[_0xbb43('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index dbc9702..dd37886 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 _0x108b=['name','VIRTUAL','system-','getDataValue','INTEGER','STRING'];(function(_0x43355d,_0x5909e3){var _0x263e7c=function(_0x3a5efe){while(--_0x3a5efe){_0x43355d['push'](_0x43355d['shift']());}};_0x263e7c(++_0x5909e3);}(_0x108b,0x155));var _0xb108=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x108b[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb108('0x0')],'allowNull':![],'unique':_0xb108('0x1')},'prefix':{'type':Sequelize[_0xb108('0x2')],'get':function(_0xe34b61){return _0xb108('0x3')+this[_0xb108('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0xb108('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xb108('0x5')]}}; \ No newline at end of file +var _0x6f00=['getDataValue','name','STRING','sequelize'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x6f00,0x67));var _0x06f0=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x6f00[_0x11a55c];return _0x26c390;};'use strict';var Sequelize=require(_0x06f0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3805ba){return'system-'+this[_0x06f0('0x1')](_0x06f0('0x2'))+'-';}},'description':{'type':Sequelize[_0x06f0('0x3')]},'callerIdAll':{'type':Sequelize[_0x06f0('0x3')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index d73d749..55a1893 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 _0x7708=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','bulkCreate','prefix','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','body','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','getAgents','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','select','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','userVoicePrefix:remove','eml-format','rimraf','fast-json-patch','util','path','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/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','VoicePrefixes','status','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x7708,0x188));var _0x8770=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x7708[_0xb99421];return _0x4b3ec7;};'use strict';var emlformat=require(_0x8770('0x0'));var rimraf=require(_0x8770('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8770('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8770('0x3'));var path=require(_0x8770('0x4'));var sox=require('sox');var csv=require(_0x8770('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8770('0x6'));var _=require(_0x8770('0x7'));var squel=require(_0x8770('0x8'));var crypto=require(_0x8770('0x9'));var jsforce=require(_0x8770('0xa'));var deskjs=require(_0x8770('0xb'));var toCsv=require(_0x8770('0x5'));var querystring=require('querystring');var Papa=require(_0x8770('0xc'));var Redis=require(_0x8770('0xd'));var authService=require(_0x8770('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8770('0xf'));var hardwareService=require(_0x8770('0x10'));var logger=require(_0x8770('0x11'))(_0x8770('0x12'));var utils=require('../../config/utils');var config=require(_0x8770('0x13'));var licenseUtil=require(_0x8770('0x14'));var db=require(_0x8770('0x15'))['db'];config['redis']=_[_0x8770('0x16')](config[_0x8770('0x17')],{'host':_0x8770('0x18'),'port':0x18eb});var socket=require(_0x8770('0x19'))(new Redis(config[_0x8770('0x17')]));require(_0x8770('0x1a'))[_0x8770('0x1b')](socket);function respondWithStatusCode(_0x12439f,_0x5514b5){_0x5514b5=_0x5514b5||0xcc;return function(_0x1d15d6){if(_0x1d15d6){return _0x12439f[_0x8770('0x1c')](_0x5514b5);}return _0x12439f['status'](_0x5514b5)[_0x8770('0x1d')]();};}function respondWithResult(_0x52254f,_0x1c8ab6){_0x1c8ab6=_0x1c8ab6||0xc8;return function(_0x526e9b){if(_0x526e9b){return _0x52254f['status'](_0x1c8ab6)['json'](_0x526e9b);}};}function respondWithFilteredResult(_0x155e83,_0x3b459a){return function(_0x17b634){if(_0x17b634){var _0xe0d611=typeof _0x3b459a['offset']==='undefined'&&typeof _0x3b459a[_0x8770('0x1e')]===_0x8770('0x1f');var _0x26cbcd=_0x17b634[_0x8770('0x20')];var _0x4d2c7e=_0xe0d611?0x0:_0x3b459a['offset'];var _0x3e1fe7=_0xe0d611?_0x17b634[_0x8770('0x20')]:_0x3b459a[_0x8770('0x21')]+_0x3b459a[_0x8770('0x1e')];var _0x582048;if(_0x3e1fe7>=_0x26cbcd){_0x3e1fe7=_0x26cbcd;_0x582048=0xc8;}else{_0x582048=0xce;}_0x155e83['status'](_0x582048);return _0x155e83[_0x8770('0x22')](_0x8770('0x23'),_0x4d2c7e+'-'+_0x3e1fe7+'/'+_0x26cbcd)[_0x8770('0x24')](_0x17b634);}return null;};}function patchUpdates(_0x2918a7){return function(_0x2760b2){try{jsonpatch[_0x8770('0x25')](_0x2760b2,_0x2918a7,!![]);}catch(_0x5819dc){return BPromise[_0x8770('0x26')](_0x5819dc);}return _0x2760b2[_0x8770('0x27')]();};}function saveUpdates(_0x4274dd,_0x2515c5){return function(_0x51cdb5){if(_0x51cdb5){return _0x51cdb5[_0x8770('0x28')](_0x4274dd)['then'](function(_0x7b4755){return _0x7b4755;});}return null;};}function removeEntity(_0x453804,_0x473d31){return function(_0x2b5f62){if(_0x2b5f62){return _0x2b5f62[_0x8770('0x29')]()[_0x8770('0x2a')](function(){var _0x293f53=_0x2b5f62[_0x8770('0x2b')]({'plain':!![]});var _0xb3f4aa=_0x8770('0x2c');return db['UserProfileResource'][_0x8770('0x29')]({'where':{'type':_0xb3f4aa,'resourceId':_0x293f53['id']}})[_0x8770('0x2a')](function(){return _0x2b5f62;});})[_0x8770('0x2a')](function(){_0x453804[_0x8770('0x2d')](0xcc)[_0x8770('0x1d')]();});}};}function handleEntityNotFound(_0x200a82,_0x5ae7b8){return function(_0x4b284b){if(!_0x4b284b){_0x200a82[_0x8770('0x1c')](0x194);}return _0x4b284b;};}function handleError(_0x11de6e,_0x22f0b0){_0x22f0b0=_0x22f0b0||0x1f4;return function(_0x365080){logger[_0x8770('0x2e')](_0x365080['stack']);if(_0x365080['name']){delete _0x365080[_0x8770('0x2f')];}_0x11de6e[_0x8770('0x2d')](_0x22f0b0)[_0x8770('0x30')](_0x365080);};}exports[_0x8770('0x31')]=function(_0x5cb4ec,_0x2f4e44){var _0x501741={},_0x5743cb={},_0x20095d={'count':0x0,'rows':[]};var _0x4f8182=_[_0x8770('0x32')](db[_0x8770('0x33')][_0x8770('0x34')],function(_0x3ae4a9){return{'name':_0x3ae4a9[_0x8770('0x35')],'type':_0x3ae4a9[_0x8770('0x36')][_0x8770('0x37')]};});_0x5743cb[_0x8770('0x38')]=_[_0x8770('0x32')](_0x4f8182,'name');_0x5743cb[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x5cb4ec[_0x8770('0x39')]);_0x5743cb['filters']=_['intersection'](_0x5743cb[_0x8770('0x38')],_0x5743cb[_0x8770('0x39')]);_0x501741[_0x8770('0x3b')]=_['intersection'](_0x5743cb[_0x8770('0x38')],qs['fields'](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3c')]));_0x501741[_0x8770('0x3b')]=_0x501741[_0x8770('0x3b')][_0x8770('0x3d')]?_0x501741[_0x8770('0x3b')]:_0x5743cb[_0x8770('0x38')];if(!_0x5cb4ec[_0x8770('0x39')][_0x8770('0x3e')](_0x8770('0x3f'))){_0x501741['limit']=qs[_0x8770('0x1e')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x1e')]);_0x501741['offset']=qs[_0x8770('0x21')](_0x5cb4ec[_0x8770('0x39')][_0x8770('0x21')]);}_0x501741[_0x8770('0x40')]=qs[_0x8770('0x41')](_0x5cb4ec[_0x8770('0x39')]['sort']);_0x501741[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0x5cb4ec['query'],_0x5743cb[_0x8770('0x44')]),_0x4f8182);if(_0x5cb4ec[_0x8770('0x39')][_0x8770('0x45')]){_0x501741['where']=_[_0x8770('0x46')](_0x501741[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x4f8182,function(_0x94343f){if(_0x94343f[_0x8770('0x36')]!==_0x8770('0x47')){var _0x5b4fdd={};_0x5b4fdd[_0x94343f[_0x8770('0x2f')]]={'$like':'%'+_0x5cb4ec['query']['filter']+'%'};return _0x5b4fdd;}})});}_0x501741=_[_0x8770('0x46')]({},_0x501741,_0x5cb4ec[_0x8770('0x48')]);var _0x2e4bda={'where':_0x501741[_0x8770('0x42')]};return db[_0x8770('0x33')]['count'](_0x2e4bda)[_0x8770('0x2a')](function(_0x26ae1b){_0x20095d['count']=_0x26ae1b;if(_0x5cb4ec[_0x8770('0x39')]['includeAll']){_0x501741[_0x8770('0x49')]=[{'all':!![]}];}return db[_0x8770('0x33')][_0x8770('0x4a')](_0x501741);})[_0x8770('0x2a')](function(_0x29dae5){_0x20095d[_0x8770('0x4b')]=_0x29dae5;return _0x20095d;})[_0x8770('0x2a')](respondWithFilteredResult(_0x2f4e44,_0x501741))[_0x8770('0x4c')](handleError(_0x2f4e44,null));};exports[_0x8770('0x4d')]=function(_0x120bc4,_0x3192fc){var _0x5c1818={'raw':![],'where':{'id':_0x120bc4[_0x8770('0x4e')]['id']}},_0x92e802={};_0x92e802[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x33')][_0x8770('0x34')]);_0x92e802['query']=_[_0x8770('0x3a')](_0x120bc4[_0x8770('0x39')]);_0x92e802[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x92e802[_0x8770('0x38')],_0x92e802[_0x8770('0x39')]);_0x5c1818[_0x8770('0x3b')]=_[_0x8770('0x4f')](_0x92e802['model'],qs[_0x8770('0x3c')](_0x120bc4[_0x8770('0x39')][_0x8770('0x3c')]));_0x5c1818[_0x8770('0x3b')]=_0x5c1818[_0x8770('0x3b')]['length']?_0x5c1818['attributes']:_0x92e802[_0x8770('0x38')];if(_0x120bc4['query'][_0x8770('0x50')]){_0x5c1818['include']=[{'all':!![]}];}_0x5c1818=_['merge']({},_0x5c1818,_0x120bc4[_0x8770('0x48')]);return db[_0x8770('0x33')][_0x8770('0x51')](_0x5c1818)[_0x8770('0x2a')](handleEntityNotFound(_0x3192fc,null))['then'](respondWithResult(_0x3192fc,null))[_0x8770('0x4c')](handleError(_0x3192fc,null));};exports[_0x8770('0x29')]=function(_0x598aaa,_0x4d8bde){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x598aaa[_0x8770('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d8bde,null))[_0x8770('0x2a')](removeEntity(_0x4d8bde,null))['catch'](handleError(_0x4d8bde,null));};exports[_0x8770('0x52')]=function(_0x3841bb,_0x39cdb4){return db['VoicePrefix'][_0x8770('0x52')]()['then'](respondWithResult(_0x39cdb4,null))['catch'](handleError(_0x39cdb4,null));};exports['create']=function(_0x242361,_0x42ea2d){var _0x416e7b;return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1df5cd){return db['VoicePrefix'][_0x8770('0x55')](_0x242361['body'],{'transaction':_0x1df5cd})[_0x8770('0x2a')](function(_0x3bcccc){_0x416e7b=_0x3bcccc[_0x8770('0x2b')]({'plain':!![]});return db[_0x8770('0x56')]['find']({'where':{'id':_0x416e7b[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x4c0a3f){return createVoicePrefixExtensions(_0x416e7b,_0x4c0a3f,_0x1df5cd);});});})['then'](function(){var _0x552cab=_0x242361['user'][_0x8770('0x2b')]({'plain':!![]});if(!_0x552cab)throw new Error(_0x8770('0x58'));if(_0x552cab['role']===_0x8770('0x59')){var _0x38b68f=_0x416e7b;return db[_0x8770('0x5a')][_0x8770('0x51')]({'where':{'name':_0x8770('0x2c'),'userProfileId':_0x552cab[_0x8770('0x5b')]},'raw':!![]})[_0x8770('0x2a')](function(_0xc2f9d9){if(_0xc2f9d9&&_0xc2f9d9[_0x8770('0x5c')]===0x0){return db[_0x8770('0x5d')][_0x8770('0x55')]({'name':_0x38b68f['name'],'resourceId':_0x38b68f['id'],'type':_0xc2f9d9[_0x8770('0x2f')],'sectionId':_0xc2f9d9['id']},{})[_0x8770('0x2a')](function(){return _0x416e7b;});}else{return _0x416e7b;}})[_0x8770('0x4c')](function(_0x593b06){logger[_0x8770('0x2e')](_0x8770('0x5e'),_0x593b06);throw _0x593b06;});}return _0x416e7b;})[_0x8770('0x2a')](respondWithResult(_0x42ea2d,null))['catch'](handleError(_0x42ea2d,null));};function Extension(_0x2aecc0,_0xbe9c4c,_0x5b1548,_0x3a2070){this['context']=_0x8770('0x5f');this[_0x8770('0x60')]=_0x2aecc0;this['app']=_0x5b1548;this[_0x8770('0x36')]=_0x8770('0x61');this[_0x8770('0x62')]=_0x8770('0x63');this[_0x8770('0x64')]=_0xbe9c4c;this[_0x8770('0x65')]=_0x3a2070;}function createVoicePrefixExtensions(_0x36606f,_0x39c69b,_0x535041){return new BPromise(function(_0x1a67b5,_0x18a31d){var _0x5cd7a1=new Extension(formatPrefixName(_0x36606f['prefix']),0x1,_0x8770('0x66'),'Voice\x20Prefix');_0x5cd7a1[_0x8770('0x67')]=_0x36606f['id'];return db[_0x8770('0x56')]['create'](_0x5cd7a1,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x339d70){var _0x4419cb=_0x339d70[_0x8770('0x2b')]({'plain':!![]});var _0x2c6044=_[_0x8770('0x32')](addVoicePrefixExtensions(_0x36606f,_0x39c69b),function(_0x28f71b){_0x28f71b[_0x8770('0x57')]=_0x4419cb['id'];_0x28f71b[_0x8770('0x67')]=_0x36606f['id'];return _0x28f71b;});return db[_0x8770('0x56')][_0x8770('0x68')](_0x2c6044,{'transaction':_0x535041})[_0x8770('0x2a')](function(_0x1dcb75){if(!_0x1dcb75){return _0x18a31d('Extensions\x20creation\x20failed');}else{return _0x1a67b5(_0x1dcb75);}})[_0x8770('0x4c')](function(_0x1a3cae){return _0x18a31d(_0x1a3cae);});});;});};function addVoicePrefixExtensions(_0x31c098,_0x219473){var _0x45d1cb=[];var _0x6c24f7=formatPrefixName(_0x31c098[_0x8770('0x69')]);_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x2,_0x8770('0x6b'),'CDR(prefix)='+_0x31c098[_0x8770('0x2f')]));if(_0x31c098[_0x8770('0x6c')]){_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x3,'Set',_0x8770('0x6d')+_0x31c098[_0x8770('0x6c')]));}else{_0x45d1cb['push'](new Extension(_0x6c24f7,0x3,_0x8770('0x66'),_0x8770('0x6e')));}_0x45d1cb[_0x8770('0x6a')](new Extension(_0x6c24f7,0x4,_0x8770('0x6f'),_0x219473[_0x8770('0x70')]+','+'${EXTEN:'+(0x8+_0x31c098[_0x8770('0x2f')]['length'])+'}'+','+0x1));return _0x45d1cb;}function formatPrefixName(_0x2a45c8){var _0x43a87c='_';for(var _0x272862=0x0;_0x272862<_0x2a45c8[_0x8770('0x3d')];_0x272862++){if(_0x2a45c8[_0x8770('0x71')](_0x272862)=='-'){_0x43a87c+=_0x2a45c8[_0x8770('0x71')](_0x272862);}else{_0x43a87c+='['+_0x2a45c8[_0x8770('0x71')](_0x272862)+']';}}_0x43a87c+='.';return _0x43a87c;}exports[_0x8770('0x28')]=function(_0x896947,_0x54c34c,_0x15b77c){var _0x3fca1c=_0x896947[_0x8770('0x72')];_0x3fca1c[_0x8770('0x69')]=_0x8770('0x73')+_0x3fca1c[_0x8770('0x2f')]+'-';return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x3ad340){return db['VoicePrefix']['update'](_0x3fca1c,{'where':{'id':_0x3fca1c['id']},'transaction':_0x3ad340})[_0x8770('0x2a')](function(){return db['VoiceExtension'][_0x8770('0x29')]({'where':{'VoicePrefixId':_0x3fca1c['id']},'transaction':_0x3ad340})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x3fca1c[_0x8770('0x57')]},'raw':!![]})[_0x8770('0x2a')](function(_0x405272){return createVoicePrefixExtensions(_0x3fca1c,_0x405272,_0x3ad340);});});});})[_0x8770('0x2a')](function(){return db[_0x8770('0x33')][_0x8770('0x74')](_0x3fca1c['id']);})[_0x8770('0x2a')](respondWithResult(_0x54c34c,null))[_0x8770('0x4c')](handleError(_0x54c34c,null));};exports[_0x8770('0x75')]=function(_0x2eebb9,_0x1bbd08,_0x1ef47a){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x2eebb9[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x1bbd08,null))['then'](function(_0x304539){if(_0x304539){return _0x304539[_0x8770('0x75')](_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')],_[_0x8770('0x77')](_0x2eebb9[_0x8770('0x72')],[_0x8770('0x76'),'id'])||{})[_0x8770('0x78')](function(_0x2ab10c){for(var _0x2669df=0x0;_0x2669df<_0x2eebb9[_0x8770('0x72')][_0x8770('0x76')][_0x8770('0x3d')];_0x2669df+=0x1){socket['emit'](_0x8770('0x79'),{'UserId':Number(_0x2eebb9['body'][_0x8770('0x76')][_0x2669df]),'VoicePrefixId':Number(_0x2eebb9[_0x8770('0x4e')]['id'])});}return _0x2ab10c;});}})['then'](respondWithResult(_0x1bbd08,null))[_0x8770('0x4c')](handleError(_0x1bbd08,null));};exports[_0x8770('0x7a')]=function(_0x3ebea6,_0x3b1a55,_0x1b3b5d){return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x3ebea6['params']['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x3b1a55,null))[_0x8770('0x2a')](function(_0xf5ef52){if(_0xf5ef52){return _0xf5ef52['removeAgents'](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])[_0x8770('0x2a')](function(){if(_[_0x8770('0x7b')](_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')])){for(var _0x45c5be=0x0;_0x45c5be<_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x8770('0x3d')];_0x45c5be+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6[_0x8770('0x39')][_0x8770('0x76')][_0x45c5be]),'VoicePrefixId':Number(_0x3ebea6[_0x8770('0x4e')]['id'])});}}else{socket[_0x8770('0x7c')]('userVoicePrefix:remove',{'UserId':Number(_0x3ebea6['query'][_0x8770('0x76')]),'VoicePrefixId':Number(_0x3ebea6['params']['id'])});}});}})[_0x8770('0x2a')](respondWithStatusCode(_0x3b1a55,null))['catch'](handleError(_0x3b1a55,null));};exports[_0x8770('0x7d')]=function(_0xb6193a,_0x41344a,_0x54dfea){var _0x16bef8={};var _0x4925f8={};var _0x5b2f00;var _0x15abe5;return db[_0x8770('0x33')]['findOne']({'where':{'id':_0xb6193a[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0x41344a,null))['then'](function(_0x344a1c){if(_0x344a1c){_0x5b2f00=_0x344a1c;_0x4925f8['model']=_[_0x8770('0x3a')](db['User']['rawAttributes']);_0x4925f8[_0x8770('0x39')]=_[_0x8770('0x3a')](_0xb6193a['query']);_0x4925f8['filters']=_[_0x8770('0x4f')](_0x4925f8[_0x8770('0x38')],_0x4925f8[_0x8770('0x39')]);_0x16bef8[_0x8770('0x3b')]=_['intersection'](_0x4925f8[_0x8770('0x38')],qs[_0x8770('0x3c')](_0xb6193a['query'][_0x8770('0x3c')]));_0x16bef8[_0x8770('0x3b')]=_0x16bef8[_0x8770('0x3b')]['length']?_0x16bef8[_0x8770('0x3b')]:_0x4925f8['model'];_0x16bef8[_0x8770('0x40')]=qs['sort'](_0xb6193a[_0x8770('0x39')][_0x8770('0x41')]);_0x16bef8[_0x8770('0x42')]=qs['filters'](_[_0x8770('0x43')](_0xb6193a['query'],_0x4925f8[_0x8770('0x44')]));if(_0xb6193a['query'][_0x8770('0x45')]){_0x16bef8[_0x8770('0x42')]=_[_0x8770('0x46')](_0x16bef8[_0x8770('0x42')],{'$or':_['map'](_0x16bef8[_0x8770('0x3b')],function(_0x4a699b){var _0x4478d0={};_0x4478d0[_0x4a699b]={'$like':'%'+_0xb6193a[_0x8770('0x39')][_0x8770('0x45')]+'%'};return _0x4478d0;})});}_0x16bef8=_[_0x8770('0x46')]({},_0x16bef8,_0xb6193a[_0x8770('0x48')]);return _0x5b2f00['getAgents'](_0x16bef8);}})[_0x8770('0x2a')](function(_0x5dcc26){if(_0x5dcc26){_0x15abe5=_0x5dcc26[_0x8770('0x3d')];if(!_0xb6193a[_0x8770('0x39')][_0x8770('0x3e')]('nolimit')){_0x16bef8['limit']=qs['limit'](_0xb6193a[_0x8770('0x39')][_0x8770('0x1e')]);_0x16bef8['offset']=qs[_0x8770('0x21')](_0xb6193a[_0x8770('0x39')][_0x8770('0x21')]);}return _0x5b2f00[_0x8770('0x7d')](_0x16bef8);}})[_0x8770('0x2a')](function(_0x541502){if(_0x541502){return _0x541502?{'count':_0x15abe5,'rows':_0x541502}:null;}})[_0x8770('0x2a')](respondWithResult(_0x41344a,null))['catch'](handleError(_0x41344a,null));};exports[_0x8770('0x7e')]=function(_0x1e2964,_0xb0bc70,_0x97f28){var _0x225353={};var _0x459715={};var _0x2c0dc3;var _0x47ee22;return db['VoicePrefix'][_0x8770('0x7f')]({'where':{'id':_0x1e2964[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](handleEntityNotFound(_0xb0bc70,null))[_0x8770('0x2a')](function(_0x5b9da7){if(_0x5b9da7){_0x2c0dc3=_0x5b9da7;_0x459715[_0x8770('0x38')]=_[_0x8770('0x3a')](db[_0x8770('0x80')]['rawAttributes']);_0x459715[_0x8770('0x39')]=_[_0x8770('0x3a')](_0x1e2964[_0x8770('0x39')]);_0x459715[_0x8770('0x44')]=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],_0x459715[_0x8770('0x39')]);_0x225353['attributes']=_[_0x8770('0x4f')](_0x459715[_0x8770('0x38')],qs[_0x8770('0x3c')](_0x1e2964[_0x8770('0x39')][_0x8770('0x3c')]));_0x225353[_0x8770('0x3b')]=_0x225353[_0x8770('0x3b')][_0x8770('0x3d')]?_0x225353[_0x8770('0x3b')]:_0x459715[_0x8770('0x38')];_0x225353['order']=qs[_0x8770('0x41')](_0x1e2964[_0x8770('0x39')][_0x8770('0x41')]);_0x225353['where']=qs['filters'](_[_0x8770('0x43')](_0x1e2964[_0x8770('0x39')],_0x459715[_0x8770('0x44')]));if(_0x1e2964[_0x8770('0x39')][_0x8770('0x45')]){_0x225353[_0x8770('0x42')]=_[_0x8770('0x46')](_0x225353[_0x8770('0x42')],{'$or':_[_0x8770('0x32')](_0x225353[_0x8770('0x3b')],function(_0x1e8091){var _0x19f98a={};_0x19f98a[_0x1e8091]={'$like':'%'+_0x1e2964[_0x8770('0x39')]['filter']+'%'};return _0x19f98a;})});}_0x225353=_[_0x8770('0x46')]({},_0x225353,_0x1e2964[_0x8770('0x48')]);return _0x2c0dc3[_0x8770('0x7e')](_0x225353);}})[_0x8770('0x2a')](function(_0x1703b8){if(_0x1703b8){_0x47ee22=_0x1703b8['length'];if(!_0x1e2964[_0x8770('0x39')]['hasOwnProperty'](_0x8770('0x3f'))){_0x225353[_0x8770('0x1e')]=qs[_0x8770('0x1e')](_0x1e2964[_0x8770('0x39')][_0x8770('0x1e')]);_0x225353[_0x8770('0x21')]=qs[_0x8770('0x21')](_0x1e2964[_0x8770('0x39')]['offset']);}return _0x2c0dc3['getTeams'](_0x225353);}})['then'](function(_0x1e16f5){if(_0x1e16f5){return _0x1e16f5?{'count':_0x47ee22,'rows':_0x1e16f5}:null;}})[_0x8770('0x2a')](respondWithResult(_0xb0bc70,null))[_0x8770('0x4c')](handleError(_0xb0bc70,null));};exports[_0x8770('0x81')]=function(_0x58e7d1,_0x2696c9,_0x1a6fef){var _0x16056d=_0x58e7d1[_0x8770('0x72')][_0x8770('0x76')];var _0x3d7f89;return db[_0x8770('0x80')][_0x8770('0x4a')]({'where':{'id':_0x16056d},'attributes':['id'],'include':[{'model':db[_0x8770('0x82')],'as':_0x8770('0x83'),'attributes':['id','name',_0x8770('0x84'),_0x8770('0x85'),'interface'],'raw':!![]}]})[_0x8770('0x2a')](function(_0x3f6b63){if(_0x3f6b63){_0x3d7f89=_0x3f6b63;var _0x503fa9=_[_0x8770('0x86')](_0x3f6b63,function(_0x1a1496){var _0x56b6cb=_0x1a1496[_0x8770('0x2b')]({'plain':!![]});return _0x56b6cb[_0x8770('0x83')];});return db[_0x8770('0x33')]['find']({'where':{'id':_0x58e7d1[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x3272d9){return db[_0x8770('0x53')]['transaction'](function(_0x1b9673){return _0x3272d9[_0x8770('0x81')](_0x16056d,{'transaction':_0x1b9673})['then'](function(){return BPromise[_0x8770('0x87')](_0x3d7f89,function(_0x3b4c87){return db['TeamVoicePrefix'][_0x8770('0x88')]({'TeamId':_0x3b4c87['id'],'VoicePrefixId':_0x58e7d1[_0x8770('0x4e')]['id']},{'transaction':_0x1b9673});});})[_0x8770('0x2a')](function(){return BPromise[_0x8770('0x87')](_0x503fa9,function(_0x21b355){return db['UserVoicePrefix'][_0x8770('0x89')]({'where':{'UserId':_0x21b355['id'],'VoicePrefixId':_0x58e7d1['params']['id']},'transaction':_0x1b9673});});})['then'](function(){_0x503fa9[_0x8770('0x8a')](function(_0x355360){socket[_0x8770('0x7c')](_0x8770('0x79'),{'UserId':_0x355360['id'],'VoicePrefixId':_0x3272d9['id']});});});});});}})['then'](respondWithStatusCode(_0x2696c9,null))[_0x8770('0x4c')](handleError(_0x2696c9,null));};exports['removeTeams']=function(_0x4a723c,_0x479d58,_0x59cc6e){return db[_0x8770('0x80')]['findAll']({'where':{'id':_0x4a723c[_0x8770('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8770('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x479d58,null))[_0x8770('0x2a')](function(_0x11891f){var _0x445dee=_['map'](_0x11891f,'id');var _0x568b87=[];var _0x458762=[];var _0x3bd770=squel[_0x8770('0x8b')]();_0x3bd770[_0x8770('0x8c')](_0x8770('0x8d'))['from'](_0x8770('0x8e'),'tq')[_0x8770('0x8f')](_0x8770('0x90'),'ut',_0x8770('0x91'))[_0x8770('0x42')](_0x8770('0x92'),_0x4a723c[_0x8770('0x4e')]['id']);for(var _0x38238a=0x0;_0x38238a<_0x11891f[_0x8770('0x3d')];_0x38238a+=0x1){let _0x6de941=_0x11891f[_0x38238a];for(var _0x592fef=0x0;_0x592fef<_0x6de941[_0x8770('0x83')][_0x8770('0x3d')];_0x592fef+=0x1){let _0x49c415=_0x6de941[_0x8770('0x83')][_0x592fef];var _0x3bb644=_0x3bd770[_0x8770('0x93')]();_0x3bb644['where'](_0x8770('0x94'),_0x49c415['id']);_0x458762['push'](db[_0x8770('0x53')][_0x8770('0x39')](_0x3bb644[_0x8770('0x95')](),{'type':db['sequelize'][_0x8770('0x96')][_0x8770('0x97')]})[_0x8770('0x2a')](function(_0x5ded0a){if(_0x5ded0a['length']===0x1){return _0x49c415['id'];}else{var _0x36f842=_[_0x8770('0x98')](_[_0x8770('0x32')](_0x5ded0a,_0x8770('0x99')),function(_0x30b589){return _[_0x8770('0x9a')](_0x445dee,_0x30b589);});if(_0x36f842){return _0x49c415['id'];}}}));}}return BPromise[_0x8770('0x9b')](_0x458762)[_0x8770('0x2a')](function(_0x377cfb){_0x568b87=_(_0x568b87)[_0x8770('0x9c')](_0x377cfb)[_0x8770('0x9d')]()[_0x8770('0x9e')]();return db[_0x8770('0x33')][_0x8770('0x51')]({'where':{'id':_0x4a723c[_0x8770('0x4e')]['id']}})[_0x8770('0x2a')](function(_0x4cadd5){return db[_0x8770('0x53')][_0x8770('0x54')](function(_0x1ac69f){return _0x4cadd5[_0x8770('0x9f')](_0x4a723c['query'][_0x8770('0x76')],{'transaction':_0x1ac69f})['then'](function(){if(!_[_0x8770('0xa0')](_0x568b87)){return _0x4cadd5[_0x8770('0x7a')](_0x568b87,{'transaction':_0x1ac69f});}})['then'](function(){_0x568b87['forEach'](function(_0x4203d2){socket[_0x8770('0x7c')](_0x8770('0xa1'),{'UserId':_0x4203d2,'VoicePrefixId':_0x4cadd5['id']});});});});});});})['then'](respondWithStatusCode(_0x479d58,null))[_0x8770('0x4c')](handleError(_0x479d58,null));}; \ No newline at end of file +var _0x7d25=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoicePrefix','includeAll','findAll','catch','show','include','find','describe','transaction','create','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','context','app','system','description','appdata','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','NoOp','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','params','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','User','getTeams','findOne','addTeams','Agents','online','interface','each','upsert','forEach','removeTeams','Team','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x3a88c9,_0x55a942){var _0x2885a4=function(_0x2f4dbe){while(--_0x2f4dbe){_0x3a88c9['push'](_0x3a88c9['shift']());}};_0x2885a4(++_0x55a942);}(_0x7d25,0x8a));var _0x57d2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x7d25[_0x599f41];return _0x2e4d58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];config[_0x57d2('0x17')]=_[_0x57d2('0x18')](config[_0x57d2('0x17')],{'host':_0x57d2('0x19'),'port':0x18eb});var socket=require(_0x57d2('0x1a'))(new Redis(config[_0x57d2('0x17')]));require(_0x57d2('0x1b'))[_0x57d2('0x1c')](socket);function respondWithStatusCode(_0x5382d9,_0x5b940e){_0x5b940e=_0x5b940e||0xcc;return function(_0x6fad35){if(_0x6fad35){return _0x5382d9[_0x57d2('0x1d')](_0x5b940e);}return _0x5382d9['status'](_0x5b940e)[_0x57d2('0x1e')]();};}function respondWithResult(_0x319489,_0x4bb8f7){_0x4bb8f7=_0x4bb8f7||0xc8;return function(_0x3e12c6){if(_0x3e12c6){return _0x319489['status'](_0x4bb8f7)[_0x57d2('0x1f')](_0x3e12c6);}};}function respondWithFilteredResult(_0x4b4fe0,_0x2ab5f0){return function(_0x7d4cf1){if(_0x7d4cf1){var _0x2ecfdf=typeof _0x2ab5f0['offset']==='undefined'&&typeof _0x2ab5f0[_0x57d2('0x20')]===_0x57d2('0x21');var _0x2662cd=_0x7d4cf1[_0x57d2('0x22')];var _0x5b1b9d=_0x2ecfdf?0x0:_0x2ab5f0[_0x57d2('0x23')];var _0xcf924f=_0x2ecfdf?_0x7d4cf1['count']:_0x2ab5f0['offset']+_0x2ab5f0[_0x57d2('0x20')];var _0x326d49;if(_0xcf924f>=_0x2662cd){_0xcf924f=_0x2662cd;_0x326d49=0xc8;}else{_0x326d49=0xce;}_0x4b4fe0[_0x57d2('0x24')](_0x326d49);return _0x4b4fe0[_0x57d2('0x25')](_0x57d2('0x26'),_0x5b1b9d+'-'+_0xcf924f+'/'+_0x2662cd)[_0x57d2('0x1f')](_0x7d4cf1);}return null;};}function patchUpdates(_0x32c7c8){return function(_0x31d2cf){try{jsonpatch[_0x57d2('0x27')](_0x31d2cf,_0x32c7c8,!![]);}catch(_0x26718e){return BPromise[_0x57d2('0x28')](_0x26718e);}return _0x31d2cf[_0x57d2('0x29')]();};}function saveUpdates(_0x12ff19,_0x473df2){return function(_0x5327ea){if(_0x5327ea){return _0x5327ea[_0x57d2('0x2a')](_0x12ff19)[_0x57d2('0x2b')](function(_0x3c7de8){return _0x3c7de8;});}return null;};}function removeEntity(_0x452d5e,_0x4363b3){return function(_0x5058be){if(_0x5058be){return _0x5058be[_0x57d2('0x2c')]()[_0x57d2('0x2b')](function(){var _0x995928=_0x5058be[_0x57d2('0x2d')]({'plain':!![]});var _0x18d500=_0x57d2('0x2e');return db[_0x57d2('0x2f')]['destroy']({'where':{'type':_0x18d500,'resourceId':_0x995928['id']}})[_0x57d2('0x2b')](function(){return _0x5058be;});})[_0x57d2('0x2b')](function(){_0x452d5e[_0x57d2('0x24')](0xcc)[_0x57d2('0x1e')]();});}};}function handleEntityNotFound(_0x1957a6,_0x7c33f3){return function(_0x1dd6cb){if(!_0x1dd6cb){_0x1957a6[_0x57d2('0x1d')](0x194);}return _0x1dd6cb;};}function handleError(_0x1d2bdb,_0x2cf9d9){_0x2cf9d9=_0x2cf9d9||0x1f4;return function(_0x574589){logger[_0x57d2('0x30')](_0x574589[_0x57d2('0x31')]);if(_0x574589[_0x57d2('0x32')]){delete _0x574589[_0x57d2('0x32')];}_0x1d2bdb['status'](_0x2cf9d9)[_0x57d2('0x33')](_0x574589);};}exports[_0x57d2('0x34')]=function(_0x21152e,_0x290c2d){var _0xb3051c={},_0x40f3f2={},_0x3cbc4b={'count':0x0,'rows':[]};var _0x36c0d7=_[_0x57d2('0x35')](db['VoicePrefix'][_0x57d2('0x36')],function(_0x213c99){return{'name':_0x213c99['fieldName'],'type':_0x213c99[_0x57d2('0x37')][_0x57d2('0x38')]};});_0x40f3f2['model']=_[_0x57d2('0x35')](_0x36c0d7,_0x57d2('0x32'));_0x40f3f2[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x21152e[_0x57d2('0x39')]);_0x40f3f2['filters']=_['intersection'](_0x40f3f2['model'],_0x40f3f2['query']);_0xb3051c[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x40f3f2[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x21152e[_0x57d2('0x39')]['fields']));_0xb3051c[_0x57d2('0x3b')]=_0xb3051c['attributes'][_0x57d2('0x3f')]?_0xb3051c[_0x57d2('0x3b')]:_0x40f3f2[_0x57d2('0x3d')];if(!_0x21152e['query'][_0x57d2('0x40')](_0x57d2('0x41'))){_0xb3051c['limit']=qs[_0x57d2('0x20')](_0x21152e[_0x57d2('0x39')][_0x57d2('0x20')]);_0xb3051c[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x21152e[_0x57d2('0x39')]['offset']);}_0xb3051c[_0x57d2('0x42')]=qs['sort'](_0x21152e[_0x57d2('0x39')][_0x57d2('0x43')]);_0xb3051c[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x21152e['query'],_0x40f3f2[_0x57d2('0x45')]),_0x36c0d7);if(_0x21152e[_0x57d2('0x39')]['filter']){_0xb3051c[_0x57d2('0x44')]=_[_0x57d2('0x47')](_0xb3051c[_0x57d2('0x44')],{'$or':_['map'](_0x36c0d7,function(_0x226e56){if(_0x226e56[_0x57d2('0x37')]!==_0x57d2('0x48')){var _0x3281c9={};_0x3281c9[_0x226e56['name']]={'$like':'%'+_0x21152e['query'][_0x57d2('0x49')]+'%'};return _0x3281c9;}})});}_0xb3051c=_[_0x57d2('0x47')]({},_0xb3051c,_0x21152e[_0x57d2('0x4a')]);var _0x5795e7={'where':_0xb3051c['where']};return db[_0x57d2('0x4b')]['count'](_0x5795e7)[_0x57d2('0x2b')](function(_0x1bb8ad){_0x3cbc4b[_0x57d2('0x22')]=_0x1bb8ad;if(_0x21152e[_0x57d2('0x39')][_0x57d2('0x4c')]){_0xb3051c['include']=[{'all':!![]}];}return db[_0x57d2('0x4b')][_0x57d2('0x4d')](_0xb3051c);})['then'](function(_0x775f8c){_0x3cbc4b['rows']=_0x775f8c;return _0x3cbc4b;})[_0x57d2('0x2b')](respondWithFilteredResult(_0x290c2d,_0xb3051c))[_0x57d2('0x4e')](handleError(_0x290c2d,null));};exports[_0x57d2('0x4f')]=function(_0x323273,_0x58aa4e){var _0x541772={'raw':![],'where':{'id':_0x323273['params']['id']}},_0x3d8256={};_0x3d8256['model']=_[_0x57d2('0x3a')](db['VoicePrefix']['rawAttributes']);_0x3d8256[_0x57d2('0x39')]=_['keys'](_0x323273[_0x57d2('0x39')]);_0x3d8256['filters']=_[_0x57d2('0x3c')](_0x3d8256['model'],_0x3d8256['query']);_0x541772[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x3d8256[_0x57d2('0x3d')],qs[_0x57d2('0x3e')](_0x323273[_0x57d2('0x39')][_0x57d2('0x3e')]));_0x541772['attributes']=_0x541772[_0x57d2('0x3b')][_0x57d2('0x3f')]?_0x541772[_0x57d2('0x3b')]:_0x3d8256[_0x57d2('0x3d')];if(_0x323273[_0x57d2('0x39')][_0x57d2('0x4c')]){_0x541772[_0x57d2('0x50')]=[{'all':!![]}];}_0x541772=_[_0x57d2('0x47')]({},_0x541772,_0x323273['options']);return db[_0x57d2('0x4b')][_0x57d2('0x51')](_0x541772)['then'](handleEntityNotFound(_0x58aa4e,null))[_0x57d2('0x2b')](respondWithResult(_0x58aa4e,null))['catch'](handleError(_0x58aa4e,null));};exports['destroy']=function(_0x1a1dc7,_0x31f404){return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x1a1dc7['params']['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x31f404,null))[_0x57d2('0x2b')](removeEntity(_0x31f404,null))['catch'](handleError(_0x31f404,null));};exports['describe']=function(_0xd7c79f,_0xb02f43){return db[_0x57d2('0x4b')][_0x57d2('0x52')]()[_0x57d2('0x2b')](respondWithResult(_0xb02f43,null))[_0x57d2('0x4e')](handleError(_0xb02f43,null));};exports['create']=function(_0x4b377f,_0x5a5edb){var _0x30482c;return db['sequelize'][_0x57d2('0x53')](function(_0x2ef710){return db['VoicePrefix'][_0x57d2('0x54')](_0x4b377f[_0x57d2('0x55')],{'transaction':_0x2ef710})[_0x57d2('0x2b')](function(_0x557f79){_0x30482c=_0x557f79[_0x57d2('0x2d')]({'plain':!![]});return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x30482c[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x2e90eb){return createVoicePrefixExtensions(_0x30482c,_0x2e90eb,_0x2ef710);});});})[_0x57d2('0x2b')](function(){var _0x2b93c4=_0x4b377f[_0x57d2('0x58')]['get']({'plain':!![]});if(!_0x2b93c4)throw new Error(_0x57d2('0x59'));if(_0x2b93c4[_0x57d2('0x5a')]===_0x57d2('0x58')){var _0x5e3289=_0x30482c;return db[_0x57d2('0x5b')][_0x57d2('0x51')]({'where':{'name':_0x57d2('0x2e'),'userProfileId':_0x2b93c4['userProfileId']},'raw':!![]})['then'](function(_0x56ddfd){if(_0x56ddfd&&_0x56ddfd[_0x57d2('0x5c')]===0x0){return db['UserProfileResource'][_0x57d2('0x54')]({'name':_0x5e3289['name'],'resourceId':_0x5e3289['id'],'type':_0x56ddfd[_0x57d2('0x32')],'sectionId':_0x56ddfd['id']},{})['then'](function(){return _0x30482c;});}else{return _0x30482c;}})[_0x57d2('0x4e')](function(_0x430f85){logger[_0x57d2('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x430f85);throw _0x430f85;});}return _0x30482c;})['then'](respondWithResult(_0x5a5edb,null))[_0x57d2('0x4e')](handleError(_0x5a5edb,null));};function Extension(_0x2c1710,_0x3b57fa,_0x227a02,_0x3e5d71){this[_0x57d2('0x5d')]='from-sip';this['exten']=_0x2c1710;this[_0x57d2('0x5e')]=_0x227a02;this[_0x57d2('0x37')]=_0x57d2('0x5f');this[_0x57d2('0x60')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3b57fa;this[_0x57d2('0x61')]=_0x3e5d71;}function createVoicePrefixExtensions(_0x301e43,_0x4f6b8a,_0xad397){return new BPromise(function(_0x28fcdb,_0x15e3b6){var _0x472e5d=new Extension(formatPrefixName(_0x301e43['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x472e5d['VoicePrefixId']=_0x301e43['id'];return db[_0x57d2('0x56')][_0x57d2('0x54')](_0x472e5d,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0xa57b70){var _0xd13626=_0xa57b70[_0x57d2('0x2d')]({'plain':!![]});var _0x2737ab=_['map'](addVoicePrefixExtensions(_0x301e43,_0x4f6b8a),function(_0x35808a){_0x35808a['VoiceExtensionId']=_0xd13626['id'];_0x35808a[_0x57d2('0x62')]=_0x301e43['id'];return _0x35808a;});return db['VoiceExtension'][_0x57d2('0x63')](_0x2737ab,{'transaction':_0xad397})[_0x57d2('0x2b')](function(_0x453e6c){if(!_0x453e6c){return _0x15e3b6(_0x57d2('0x64'));}else{return _0x28fcdb(_0x453e6c);}})[_0x57d2('0x4e')](function(_0x145370){return _0x15e3b6(_0x145370);});});;});};function addVoicePrefixExtensions(_0x5e697c,_0x2a481c){var _0x24d3bf=[];var _0x27b27a=formatPrefixName(_0x5e697c[_0x57d2('0x65')]);_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x2,_0x57d2('0x67'),_0x57d2('0x68')+_0x5e697c[_0x57d2('0x32')]));if(_0x5e697c[_0x57d2('0x69')]){_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x67'),'PREFIX-CALLERIDALL='+_0x5e697c['callerIdAll']));}else{_0x24d3bf['push'](new Extension(_0x27b27a,0x3,_0x57d2('0x6a'),'No\x20callerid\x20available'));}_0x24d3bf[_0x57d2('0x66')](new Extension(_0x27b27a,0x4,_0x57d2('0x6b'),_0x2a481c['context']+','+_0x57d2('0x6c')+(0x8+_0x5e697c[_0x57d2('0x32')][_0x57d2('0x3f')])+'}'+','+0x1));return _0x24d3bf;}function formatPrefixName(_0x13741f){var _0x5eb7a3='_';for(var _0x3afeb9=0x0;_0x3afeb9<_0x13741f[_0x57d2('0x3f')];_0x3afeb9++){if(_0x13741f['charAt'](_0x3afeb9)=='-'){_0x5eb7a3+=_0x13741f['charAt'](_0x3afeb9);}else{_0x5eb7a3+='['+_0x13741f[_0x57d2('0x6d')](_0x3afeb9)+']';}}_0x5eb7a3+='.';return _0x5eb7a3;}exports[_0x57d2('0x2a')]=function(_0x481c6b,_0x46c7de,_0x5a1283){var _0x360ee0=_0x481c6b[_0x57d2('0x55')];_0x360ee0[_0x57d2('0x65')]=_0x57d2('0x6e')+_0x360ee0[_0x57d2('0x32')]+'-';return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x3bec6f){return db[_0x57d2('0x4b')][_0x57d2('0x2a')](_0x360ee0,{'where':{'id':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db['VoiceExtension'][_0x57d2('0x2c')]({'where':{'VoicePrefixId':_0x360ee0['id']},'transaction':_0x3bec6f})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x56')][_0x57d2('0x51')]({'where':{'id':_0x360ee0[_0x57d2('0x57')]},'raw':!![]})[_0x57d2('0x2b')](function(_0x42666b){return createVoicePrefixExtensions(_0x360ee0,_0x42666b,_0x3bec6f);});});});})[_0x57d2('0x2b')](function(){return db[_0x57d2('0x4b')][_0x57d2('0x70')](_0x360ee0['id']);})[_0x57d2('0x2b')](respondWithResult(_0x46c7de,null))[_0x57d2('0x4e')](handleError(_0x46c7de,null));};exports[_0x57d2('0x71')]=function(_0x26da1b,_0x1bf74a,_0x144229){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x26da1b[_0x57d2('0x72')]['id']}})['then'](handleEntityNotFound(_0x1bf74a,null))[_0x57d2('0x2b')](function(_0x17b3c1){if(_0x17b3c1){return _0x17b3c1[_0x57d2('0x71')](_0x26da1b[_0x57d2('0x55')]['ids'],_[_0x57d2('0x73')](_0x26da1b['body'],['ids','id'])||{})[_0x57d2('0x74')](function(_0x4f30e8){for(var _0x282457=0x0;_0x282457<_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x57d2('0x3f')];_0x282457+=0x1){socket['emit'](_0x57d2('0x76'),{'UserId':Number(_0x26da1b[_0x57d2('0x55')][_0x57d2('0x75')][_0x282457]),'VoicePrefixId':Number(_0x26da1b[_0x57d2('0x72')]['id'])});}return _0x4f30e8;});}})[_0x57d2('0x2b')](respondWithResult(_0x1bf74a,null))[_0x57d2('0x4e')](handleError(_0x1bf74a,null));};exports[_0x57d2('0x77')]=function(_0x41ca89,_0x1d147f,_0x261850){return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x41ca89[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x1d147f,null))[_0x57d2('0x2b')](function(_0x468990){if(_0x468990){return _0x468990[_0x57d2('0x77')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])[_0x57d2('0x2b')](function(){if(_[_0x57d2('0x78')](_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')])){for(var _0x54edaf=0x0;_0x54edaf<_0x41ca89['query'][_0x57d2('0x75')][_0x57d2('0x3f')];_0x54edaf+=0x1){socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')]['ids'][_0x54edaf]),'VoicePrefixId':Number(_0x41ca89['params']['id'])});}}else{socket[_0x57d2('0x79')](_0x57d2('0x7a'),{'UserId':Number(_0x41ca89[_0x57d2('0x39')][_0x57d2('0x75')]),'VoicePrefixId':Number(_0x41ca89[_0x57d2('0x72')]['id'])});}});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x1d147f,null))['catch'](handleError(_0x1d147f,null));};exports[_0x57d2('0x7b')]=function(_0x2f5625,_0x5bb7cd,_0x4913c0){var _0x5ac6ee={};var _0x5b3cc6={};var _0xa557d6;var _0x4a7e00;return db[_0x57d2('0x4b')]['findOne']({'where':{'id':_0x2f5625[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x5bb7cd,null))[_0x57d2('0x2b')](function(_0x1dbe31){if(_0x1dbe31){_0xa557d6=_0x1dbe31;_0x5b3cc6[_0x57d2('0x3d')]=_['keys'](db[_0x57d2('0x7c')][_0x57d2('0x36')]);_0x5b3cc6[_0x57d2('0x39')]=_['keys'](_0x2f5625[_0x57d2('0x39')]);_0x5b3cc6[_0x57d2('0x45')]=_[_0x57d2('0x3c')](_0x5b3cc6[_0x57d2('0x3d')],_0x5b3cc6[_0x57d2('0x39')]);_0x5ac6ee[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x5b3cc6['model'],qs['fields'](_0x2f5625['query'][_0x57d2('0x3e')]));_0x5ac6ee[_0x57d2('0x3b')]=_0x5ac6ee[_0x57d2('0x3b')]['length']?_0x5ac6ee[_0x57d2('0x3b')]:_0x5b3cc6[_0x57d2('0x3d')];_0x5ac6ee[_0x57d2('0x42')]=qs[_0x57d2('0x43')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x43')]);_0x5ac6ee[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_['pick'](_0x2f5625[_0x57d2('0x39')],_0x5b3cc6[_0x57d2('0x45')]));if(_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]){_0x5ac6ee['where']=_['merge'](_0x5ac6ee[_0x57d2('0x44')],{'$or':_['map'](_0x5ac6ee[_0x57d2('0x3b')],function(_0x598d62){var _0x3a35d7={};_0x3a35d7[_0x598d62]={'$like':'%'+_0x2f5625[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x3a35d7;})});}_0x5ac6ee=_['merge']({},_0x5ac6ee,_0x2f5625[_0x57d2('0x4a')]);return _0xa557d6['getAgents'](_0x5ac6ee);}})[_0x57d2('0x2b')](function(_0xe71357){if(_0xe71357){_0x4a7e00=_0xe71357[_0x57d2('0x3f')];if(!_0x2f5625[_0x57d2('0x39')][_0x57d2('0x40')](_0x57d2('0x41'))){_0x5ac6ee[_0x57d2('0x20')]=qs[_0x57d2('0x20')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x20')]);_0x5ac6ee[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x2f5625[_0x57d2('0x39')][_0x57d2('0x23')]);}return _0xa557d6[_0x57d2('0x7b')](_0x5ac6ee);}})['then'](function(_0x3a7d89){if(_0x3a7d89){return _0x3a7d89?{'count':_0x4a7e00,'rows':_0x3a7d89}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x5bb7cd,null))[_0x57d2('0x4e')](handleError(_0x5bb7cd,null));};exports[_0x57d2('0x7d')]=function(_0x4d83cf,_0x93bc52,_0x362b77){var _0x2728ba={};var _0x4f6585={};var _0x34f39a;var _0x1a90cb;return db[_0x57d2('0x4b')][_0x57d2('0x7e')]({'where':{'id':_0x4d83cf[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](handleEntityNotFound(_0x93bc52,null))[_0x57d2('0x2b')](function(_0x1ba236){if(_0x1ba236){_0x34f39a=_0x1ba236;_0x4f6585[_0x57d2('0x3d')]=_[_0x57d2('0x3a')](db['Team']['rawAttributes']);_0x4f6585[_0x57d2('0x39')]=_[_0x57d2('0x3a')](_0x4d83cf[_0x57d2('0x39')]);_0x4f6585[_0x57d2('0x45')]=_['intersection'](_0x4f6585[_0x57d2('0x3d')],_0x4f6585[_0x57d2('0x39')]);_0x2728ba[_0x57d2('0x3b')]=_[_0x57d2('0x3c')](_0x4f6585[_0x57d2('0x3d')],qs['fields'](_0x4d83cf['query']['fields']));_0x2728ba['attributes']=_0x2728ba['attributes'][_0x57d2('0x3f')]?_0x2728ba['attributes']:_0x4f6585[_0x57d2('0x3d')];_0x2728ba[_0x57d2('0x42')]=qs['sort'](_0x4d83cf[_0x57d2('0x39')]['sort']);_0x2728ba[_0x57d2('0x44')]=qs[_0x57d2('0x45')](_[_0x57d2('0x46')](_0x4d83cf[_0x57d2('0x39')],_0x4f6585['filters']));if(_0x4d83cf[_0x57d2('0x39')]['filter']){_0x2728ba['where']=_[_0x57d2('0x47')](_0x2728ba[_0x57d2('0x44')],{'$or':_[_0x57d2('0x35')](_0x2728ba[_0x57d2('0x3b')],function(_0x127224){var _0x47ee55={};_0x47ee55[_0x127224]={'$like':'%'+_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x49')]+'%'};return _0x47ee55;})});}_0x2728ba=_[_0x57d2('0x47')]({},_0x2728ba,_0x4d83cf[_0x57d2('0x4a')]);return _0x34f39a[_0x57d2('0x7d')](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x4773a4){if(_0x4773a4){_0x1a90cb=_0x4773a4[_0x57d2('0x3f')];if(!_0x4d83cf['query']['hasOwnProperty'](_0x57d2('0x41'))){_0x2728ba['limit']=qs[_0x57d2('0x20')](_0x4d83cf[_0x57d2('0x39')][_0x57d2('0x20')]);_0x2728ba[_0x57d2('0x23')]=qs[_0x57d2('0x23')](_0x4d83cf['query'][_0x57d2('0x23')]);}return _0x34f39a['getTeams'](_0x2728ba);}})[_0x57d2('0x2b')](function(_0x888a75){if(_0x888a75){return _0x888a75?{'count':_0x1a90cb,'rows':_0x888a75}:null;}})[_0x57d2('0x2b')](respondWithResult(_0x93bc52,null))[_0x57d2('0x4e')](handleError(_0x93bc52,null));};exports[_0x57d2('0x7f')]=function(_0x37608b,_0x5cb4b6,_0xa4b4fd){var _0x3c9d18=_0x37608b[_0x57d2('0x55')][_0x57d2('0x75')];var _0x55f7df;return db['Team']['findAll']({'where':{'id':_0x3c9d18},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id',_0x57d2('0x32'),_0x57d2('0x81'),'voicePause',_0x57d2('0x82')],'raw':!![]}]})[_0x57d2('0x2b')](function(_0x178706){if(_0x178706){_0x55f7df=_0x178706;var _0xa92185=_['flatMap'](_0x178706,function(_0x3865c7){var _0x1d9c66=_0x3865c7[_0x57d2('0x2d')]({'plain':!![]});return _0x1d9c66[_0x57d2('0x80')];});return db['VoicePrefix'][_0x57d2('0x51')]({'where':{'id':_0x37608b['params']['id']}})['then'](function(_0x5a4689){return db[_0x57d2('0x6f')][_0x57d2('0x53')](function(_0x488dcd){return _0x5a4689['addTeams'](_0x3c9d18,{'transaction':_0x488dcd})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0x55f7df,function(_0x23a448){return db['TeamVoicePrefix'][_0x57d2('0x84')]({'TeamId':_0x23a448['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},{'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){return BPromise[_0x57d2('0x83')](_0xa92185,function(_0xa269b5){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0xa269b5['id'],'VoicePrefixId':_0x37608b[_0x57d2('0x72')]['id']},'transaction':_0x488dcd});});})[_0x57d2('0x2b')](function(){_0xa92185[_0x57d2('0x85')](function(_0x434389){socket['emit'](_0x57d2('0x76'),{'UserId':_0x434389['id'],'VoicePrefixId':_0x5a4689['id']});});});});});}})[_0x57d2('0x2b')](respondWithStatusCode(_0x5cb4b6,null))['catch'](handleError(_0x5cb4b6,null));};exports[_0x57d2('0x86')]=function(_0x29b37c,_0x531b42,_0x120e28){return db[_0x57d2('0x87')][_0x57d2('0x4d')]({'where':{'id':_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')]},'attributes':['id'],'include':[{'model':db[_0x57d2('0x7c')],'as':_0x57d2('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x531b42,null))[_0x57d2('0x2b')](function(_0x2809c1){var _0x5444bf=_[_0x57d2('0x35')](_0x2809c1,'id');var _0x3da7ba=[];var _0x2fc3b5=[];var _0x41ba89=squel['select']();_0x41ba89[_0x57d2('0x88')]('tq.TeamId')[_0x57d2('0x89')](_0x57d2('0x8a'),'tq')[_0x57d2('0x8b')](_0x57d2('0x8c'),'ut',_0x57d2('0x8d'))[_0x57d2('0x44')](_0x57d2('0x8e'),_0x29b37c[_0x57d2('0x72')]['id']);for(var _0x112218=0x0;_0x112218<_0x2809c1[_0x57d2('0x3f')];_0x112218+=0x1){let _0x57314b=_0x2809c1[_0x112218];for(var _0x3acffd=0x0;_0x3acffd<_0x57314b[_0x57d2('0x80')]['length'];_0x3acffd+=0x1){let _0x447051=_0x57314b[_0x57d2('0x80')][_0x3acffd];var _0x511494=_0x41ba89[_0x57d2('0x8f')]();_0x511494[_0x57d2('0x44')](_0x57d2('0x90'),_0x447051['id']);_0x2fc3b5[_0x57d2('0x66')](db['sequelize'][_0x57d2('0x39')](_0x511494[_0x57d2('0x91')](),{'type':db['sequelize'][_0x57d2('0x92')][_0x57d2('0x93')]})[_0x57d2('0x2b')](function(_0x13aec4){if(_0x13aec4[_0x57d2('0x3f')]===0x1){return _0x447051['id'];}else{var _0x4e3497=_[_0x57d2('0x94')](_[_0x57d2('0x35')](_0x13aec4,'TeamId'),function(_0xb122b9){return _[_0x57d2('0x95')](_0x5444bf,_0xb122b9);});if(_0x4e3497){return _0x447051['id'];}}}));}}return BPromise[_0x57d2('0x96')](_0x2fc3b5)['then'](function(_0xdc5333){_0x3da7ba=_(_0x3da7ba)[_0x57d2('0x97')](_0xdc5333)['compact']()[_0x57d2('0x98')]();return db[_0x57d2('0x4b')][_0x57d2('0x51')]({'where':{'id':_0x29b37c[_0x57d2('0x72')]['id']}})[_0x57d2('0x2b')](function(_0x456ed3){return db['sequelize'][_0x57d2('0x53')](function(_0x376cea){return _0x456ed3[_0x57d2('0x86')](_0x29b37c[_0x57d2('0x39')][_0x57d2('0x75')],{'transaction':_0x376cea})[_0x57d2('0x2b')](function(){if(!_[_0x57d2('0x99')](_0x3da7ba)){return _0x456ed3[_0x57d2('0x77')](_0x3da7ba,{'transaction':_0x376cea});}})[_0x57d2('0x2b')](function(){_0x3da7ba['forEach'](function(_0x5b7f18){socket[_0x57d2('0x79')]('userVoicePrefix:remove',{'UserId':_0x5b7f18,'VoicePrefixId':_0x456ed3['id']});});});});});});})[_0x57d2('0x2b')](respondWithStatusCode(_0x531b42,null))['catch'](handleError(_0x531b42,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index b06437e..d3a4add 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 _0xe33b=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5c4235,_0x426a46){var _0x60b1c5=function(_0xabd743){while(--_0xabd743){_0x5c4235['push'](_0x5c4235['shift']());}};_0x60b1c5(++_0x426a46);}(_0xe33b,0x1ad));var _0xbe33=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xe33b[_0x2aecb2];return _0x3ebb80;};'use strict';var EventEmitter=require(_0xbe33('0x0'));var VoicePrefix=require(_0xbe33('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xbe33('0x2')](0x0);var events={'afterCreate':_0xbe33('0x3'),'afterUpdate':_0xbe33('0x4'),'afterDestroy':_0xbe33('0x5')};function emitEvent(_0x583443){return function(_0x1f1008,_0x1bc1de,_0x2833bf){VoicePrefixEvents['emit'](_0x583443+':'+_0x1f1008['id'],_0x1f1008);VoicePrefixEvents['emit'](_0x583443,_0x1f1008);_0x2833bf(null);};}for(var e in events){if(events[_0xbe33('0x6')](e)){var event=events[e];VoicePrefix[_0xbe33('0x7')](e,emitEvent(event));}}module[_0xbe33('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x476d=['hook','exports','../../mysqldb','setMaxListeners','update','remove','hasOwnProperty'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x476d,0x18a));var _0xd476=function(_0x4e4710,_0x1610cf){_0x4e4710=_0x4e4710-0x0;var _0x439987=_0x476d[_0x4e4710];return _0x439987;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xd476('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xd476('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd476('0x2'),'afterDestroy':_0xd476('0x3')};function emitEvent(_0x431a3c){return function(_0x4203e8,_0x40a847,_0x316327){VoicePrefixEvents['emit'](_0x431a3c+':'+_0x4203e8['id'],_0x4203e8);VoicePrefixEvents['emit'](_0x431a3c,_0x4203e8);_0x316327(null);};}for(var e in events){if(events[_0xd476('0x4')](e)){var event=events[e];VoicePrefix[_0xd476('0x5')](e,emitEvent(event));}}module[_0xd476('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 001a315..a763107 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 _0xf17d=['api','bluebird','request-promise','path','./voicePrefix.attributes','define','voice_prefixes','lodash','../../config/logger'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xf17d,0xb2));var _0xdf17=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf17d[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xdf17('0x0'));var util=require('util');var logger=require(_0xdf17('0x1'))(_0xdf17('0x2'));var moment=require('moment');var BPromise=require(_0xdf17('0x3'));var rp=require(_0xdf17('0x4'));var fs=require('fs');var path=require(_0xdf17('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf17('0x6'));module['exports']=function(_0x274990,_0x46b6a2){return _0x274990[_0xdf17('0x7')]('VoicePrefix',attributes,{'tableName':_0xdf17('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['VoicePrefix','voice_prefixes','util','../../config/logger','moment','bluebird','path','../../config/environment','./voicePrefix.attributes','define'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x2dae,0xf2));var _0xe2da=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x2dae[_0x397cfb];return _0x15fed9;};'use strict';var _=require('lodash');var util=require(_0xe2da('0x0'));var logger=require(_0xe2da('0x1'))('api');var moment=require(_0xe2da('0x2'));var BPromise=require(_0xe2da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2da('0x4'));var rimraf=require('rimraf');var config=require(_0xe2da('0x5'));var attributes=require(_0xe2da('0x6'));module['exports']=function(_0x51c17f,_0x48b3ca){return _0x51c17f[_0xe2da('0x7')](_0xe2da('0x8'),attributes,{'tableName':_0xe2da('0x9'),'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 05c74d8..5fd5be6 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 _0xde1a=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5eb7cd,_0x1a35d5){var _0x311f24=function(_0x333453){while(--_0x333453){_0x5eb7cd['push'](_0x5eb7cd['shift']());}};_0x311f24(++_0x1a35d5);}(_0xde1a,0xfd));var _0xade1=function(_0x462ea1,_0x308b03){_0x462ea1=_0x462ea1-0x0;var _0x29baa1=_0xde1a[_0x462ea1];return _0x29baa1;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var moment=require(_0xade1('0x1'));var BPromise=require(_0xade1('0x2'));var rs=require(_0xade1('0x3'));var fs=require('fs');var Redis=require(_0xade1('0x4'));var db=require(_0xade1('0x5'))['db'];var utils=require(_0xade1('0x6'));var logger=require(_0xade1('0x7'))('rpc');var config=require(_0xade1('0x8'));var jayson=require(_0xade1('0x9'));var client=jayson[_0xade1('0xa')][_0xade1('0xb')]({'port':0x232a});config[_0xade1('0xc')]=_[_0xade1('0xd')](config['redis'],{'host':_0xade1('0xe'),'port':0x18eb});var socket=require(_0xade1('0xf'))(new Redis(config[_0xade1('0xc')]));require(_0xade1('0x10'))[_0xade1('0x11')](socket);function respondWithRpcPromise(_0x2b3854,_0x3ebc61,_0x12eb7f){return new BPromise(function(_0x5add3c,_0x5c44fa){return client[_0xade1('0x12')](_0x2b3854,_0x12eb7f)['then'](function(_0x1d71a8){logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,'request\x20sent');logger[_0xade1('0x15')](_0xade1('0x16'),_0x3ebc61,_0xade1('0x17'),JSON[_0xade1('0x18')](_0x1d71a8));if(_0x1d71a8[_0xade1('0x19')]){if(_0x1d71a8[_0xade1('0x19')]['code']===0x1f4){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5c44fa(_0x1d71a8[_0xade1('0x19')]['message']);}logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x1d71a8[_0xade1('0x19')][_0xade1('0x1a')]);return _0x5add3c(_0x1d71a8[_0xade1('0x19')]['message']);}else{logger[_0xade1('0x13')](_0xade1('0x14'),_0x3ebc61,_0xade1('0x17'));_0x5add3c(_0x1d71a8[_0xade1('0x1b')][_0xade1('0x1a')]);}})[_0xade1('0x1c')](function(_0x39a360){logger[_0xade1('0x19')](_0xade1('0x14'),_0x3ebc61,_0x39a360);_0x5c44fa(_0x39a360);});});} \ No newline at end of file +var _0xc359=['./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','localhost','socket.io-emitter'];(function(_0x8eacaa,_0x3ad4c7){var _0x2b86dc=function(_0x5c453f){while(--_0x5c453f){_0x8eacaa['push'](_0x8eacaa['shift']());}};_0x2b86dc(++_0x3ad4c7);}(_0xc359,0x1d9));var _0x9c35=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0xc359[_0x1cec84];return _0x12b7d3;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var moment=require('moment');var BPromise=require(_0x9c35('0x1'));var rs=require(_0x9c35('0x2'));var fs=require('fs');var Redis=require(_0x9c35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c35('0x4'));var logger=require('../../config/logger')(_0x9c35('0x5'));var config=require('../../config/environment');var jayson=require(_0x9c35('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9c35('0x7')],{'host':_0x9c35('0x8'),'port':0x18eb});var socket=require(_0x9c35('0x9'))(new Redis(config[_0x9c35('0x7')]));require(_0x9c35('0xa'))[_0x9c35('0xb')](socket);function respondWithRpcPromise(_0x56d3fb,_0x21df9a,_0x467add){return new BPromise(function(_0x500420,_0x4e3834){return client['request'](_0x56d3fb,_0x467add)[_0x9c35('0xc')](function(_0x4d012f){logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));logger['debug'](_0x9c35('0x10'),_0x21df9a,_0x9c35('0xf'),JSON[_0x9c35('0x11')](_0x4d012f));if(_0x4d012f[_0x9c35('0x12')]){if(_0x4d012f[_0x9c35('0x12')]['code']===0x1f4){logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x4e3834(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}logger[_0x9c35('0x12')](_0x9c35('0xe'),_0x21df9a,_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);return _0x500420(_0x4d012f[_0x9c35('0x12')][_0x9c35('0x13')]);}else{logger[_0x9c35('0xd')](_0x9c35('0xe'),_0x21df9a,_0x9c35('0xf'));_0x500420(_0x4d012f['result'][_0x9c35('0x13')]);}})[_0x9c35('0x14')](function(_0x26911d){logger[_0x9c35('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x21df9a,_0x26911d);_0x4e3834(_0x26911d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c45f893..fc97afc 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 _0x3f19=['length','voicePrefix:','./voicePrefix.events','emit','register'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3f19,0xc0));var _0x93f1=function(_0x37065a,_0xd1f059){_0x37065a=_0x37065a-0x0;var _0x293d11=_0x3f19[_0x37065a];return _0x293d11;};'use strict';var VoicePrefixEvents=require(_0x93f1('0x0'));var events=['save','remove','update'];function createListener(_0x33bddc,_0x4d1cac){return function(_0x452cf9){_0x4d1cac[_0x93f1('0x1')](_0x33bddc,_0x452cf9);};}function removeListener(_0x3bd3fa,_0x2057aa){return function(){VoicePrefixEvents['removeListener'](_0x3bd3fa,_0x2057aa);};}exports[_0x93f1('0x2')]=function(_0x522769){for(var _0x999026=0x0,_0x425c6f=events[_0x93f1('0x3')];_0x999026<_0x425c6f;_0x999026++){var _0xdaa92=events[_0x999026];var _0x5d7374=createListener(_0x93f1('0x4')+_0xdaa92,_0x522769);VoicePrefixEvents['on'](_0xdaa92,_0x5d7374);}}; \ No newline at end of file +var _0x1789=['register','voicePrefix:','./voicePrefix.events','save','remove','emit'];(function(_0x174c76,_0x4224c9){var _0x228b84=function(_0x3752e5){while(--_0x3752e5){_0x174c76['push'](_0x174c76['shift']());}};_0x228b84(++_0x4224c9);}(_0x1789,0x92));var _0x9178=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0x1789[_0x5b64a1];return _0x4b6f55;};'use strict';var VoicePrefixEvents=require(_0x9178('0x0'));var events=[_0x9178('0x1'),_0x9178('0x2'),'update'];function createListener(_0xf9cb5d,_0xe7c1){return function(_0x3e7033){_0xe7c1[_0x9178('0x3')](_0xf9cb5d,_0x3e7033);};}function removeListener(_0x45af56,_0x5911d4){return function(){VoicePrefixEvents['removeListener'](_0x45af56,_0x5911d4);};}exports[_0x9178('0x4')]=function(_0x30f085){for(var _0x10a9fc=0x0,_0x1f00a8=events['length'];_0x10a9fc<_0x1f00a8;_0x10a9fc++){var _0x1001b0=events[_0x10a9fc];var _0x333b8b=createListener(_0x9178('0x5')+_0x1001b0,_0x30f085);VoicePrefixEvents['on'](_0x1001b0,_0x333b8b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2789d40..d258fce 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 _0xc904=['../../components/interaction/service','./voiceQueue.controller','get','index','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperBlacks','/:id/users','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','/:id/lists','addBlackLists','put','/:id','update','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3f2163,_0x339b4c){var _0x4d284d=function(_0x53bb84){while(--_0x53bb84){_0x3f2163['push'](_0x3f2163['shift']());}};_0x4d284d(++_0x339b4c);}(_0xc904,0x69));var _0x4c90=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xc904[_0x1e3c16];return _0x47a0c9;};'use strict';var multer=require(_0x4c90('0x0'));var util=require('util');var path=require(_0x4c90('0x1'));var timeout=require(_0x4c90('0x2'));var express=require(_0x4c90('0x3'));var router=express['Router']();var fs_extra=require(_0x4c90('0x4'));var auth=require(_0x4c90('0x5'));var interaction=require(_0x4c90('0x6'));var config=require('../../config/environment');var controller=require(_0x4c90('0x7'));router[_0x4c90('0x8')]('/',auth['isAuthenticated'](),controller[_0x4c90('0x9')]);router['get']('/:id',auth[_0x4c90('0xa')](),controller['show']);router[_0x4c90('0x8')](_0x4c90('0xb'),auth[_0x4c90('0xa')](),controller[_0x4c90('0xc')]);router[_0x4c90('0x8')](_0x4c90('0xd'),auth[_0x4c90('0xa')](),controller['getHopperHistories']);router[_0x4c90('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x4c90('0x8')]('/:id/hopper_black',auth[_0x4c90('0xa')](),controller[_0x4c90('0xe')]);router[_0x4c90('0x8')]('/:id/teams',auth[_0x4c90('0xa')](),controller['getTeams']);router[_0x4c90('0x8')](_0x4c90('0xf'),auth[_0x4c90('0xa')](),controller['getAgents']);router['get']('/:id/members',auth[_0x4c90('0xa')](),controller[_0x4c90('0x10')]);router[_0x4c90('0x8')]('/:id/lists',auth[_0x4c90('0xa')](),controller[_0x4c90('0x11')]);router[_0x4c90('0x8')](_0x4c90('0x12'),auth[_0x4c90('0xa')](),controller[_0x4c90('0x13')]);router[_0x4c90('0x14')]('/',auth[_0x4c90('0xa')](),controller[_0x4c90('0x15')]);router[_0x4c90('0x14')](_0x4c90('0x16'),auth['isAuthenticated'](),controller[_0x4c90('0x17')]);router[_0x4c90('0x14')](_0x4c90('0x18'),auth[_0x4c90('0xa')](),controller[_0x4c90('0x19')]);router[_0x4c90('0x14')]('/:id/users',auth[_0x4c90('0xa')](),controller['addAgents']);router[_0x4c90('0x14')](_0x4c90('0x1a'),auth['isAuthenticated'](),controller['addLists']);router[_0x4c90('0x14')]('/:id/blacklists',auth[_0x4c90('0xa')](),controller[_0x4c90('0x1b')]);router[_0x4c90('0x1c')](_0x4c90('0x1d'),auth[_0x4c90('0xa')](),controller[_0x4c90('0x1e')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4c90('0x1f')]);router[_0x4c90('0x20')](_0x4c90('0x18'),auth['isAuthenticated'](),controller[_0x4c90('0x21')]);router[_0x4c90('0x20')]('/:id/users',auth[_0x4c90('0xa')](),controller[_0x4c90('0x22')]);router[_0x4c90('0x20')](_0x4c90('0x1a'),auth[_0x4c90('0xa')](),controller[_0x4c90('0x23')]);router[_0x4c90('0x20')](_0x4c90('0x12'),auth[_0x4c90('0xa')](),controller[_0x4c90('0x24')]);module['exports']=router; \ No newline at end of file +var _0x82d4=['delete','destroy','removeTeams','/:id/users','removeAgents','removeLists','removeBlackLists','multer','util','path','express','Router','fs-extra','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','clone','addAgents','addLists','/:id/blacklists','addBlackLists','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x82d4,0xa7));var _0x482d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x82d4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x482d('0x0'));var util=require(_0x482d('0x1'));var path=require(_0x482d('0x2'));var timeout=require('connect-timeout');var express=require(_0x482d('0x3'));var router=express[_0x482d('0x4')]();var fs_extra=require(_0x482d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x482d('0x6'));var controller=require(_0x482d('0x7'));router[_0x482d('0x8')]('/',auth[_0x482d('0x9')](),controller[_0x482d('0xa')]);router[_0x482d('0x8')](_0x482d('0xb'),auth['isAuthenticated'](),controller[_0x482d('0xc')]);router[_0x482d('0x8')](_0x482d('0xd'),auth[_0x482d('0x9')](),controller['getHoppers']);router[_0x482d('0x8')](_0x482d('0xe'),auth[_0x482d('0x9')](),controller[_0x482d('0xf')]);router[_0x482d('0x8')]('/:id/hopper_finals',auth[_0x482d('0x9')](),controller[_0x482d('0x10')]);router[_0x482d('0x8')](_0x482d('0x11'),auth['isAuthenticated'](),controller[_0x482d('0x12')]);router[_0x482d('0x8')](_0x482d('0x13'),auth[_0x482d('0x9')](),controller[_0x482d('0x14')]);router[_0x482d('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x482d('0x15')]);router['get'](_0x482d('0x16'),auth[_0x482d('0x9')](),controller[_0x482d('0x17')]);router[_0x482d('0x8')](_0x482d('0x18'),auth[_0x482d('0x9')](),controller[_0x482d('0x19')]);router[_0x482d('0x8')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0x482d('0x1a')]('/',auth[_0x482d('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x482d('0x9')](),controller[_0x482d('0x1b')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x482d('0x1c')]);router['post'](_0x482d('0x18'),auth['isAuthenticated'](),controller[_0x482d('0x1d')]);router[_0x482d('0x1a')](_0x482d('0x1e'),auth[_0x482d('0x9')](),controller[_0x482d('0x1f')]);router[_0x482d('0x20')]('/:id',auth[_0x482d('0x9')](),controller['update']);router[_0x482d('0x21')](_0x482d('0xb'),auth[_0x482d('0x9')](),controller[_0x482d('0x22')]);router[_0x482d('0x21')](_0x482d('0x13'),auth[_0x482d('0x9')](),controller[_0x482d('0x23')]);router[_0x482d('0x21')](_0x482d('0x24'),auth[_0x482d('0x9')](),controller[_0x482d('0x25')]);router[_0x482d('0x21')](_0x482d('0x18'),auth[_0x482d('0x9')](),controller[_0x482d('0x26')]);router[_0x482d('0x21')]('/:id/blacklists',auth[_0x482d('0x9')](),controller[_0x482d('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 246cb28..2d94ed9 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 _0xf611=['Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#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)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','exports','STRING','name','inbound','default','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','TEXT','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0xe36770,_0x5652ad){var _0x545cef=function(_0x54eda3){while(--_0x54eda3){_0xe36770['push'](_0xe36770['shift']());}};_0x545cef(++_0x5652ad);}(_0xf611,0x7b));var _0x1f61=function(_0xf93b08,_0x2559d7){_0xf93b08=_0xf93b08-0x0;var _0x12f72e=_0xf611[_0xf93b08];return _0x12f72e;};'use strict';var Sequelize=require('sequelize');module[_0x1f61('0x0')]={'name':{'type':Sequelize[_0x1f61('0x1')],'allowNull':![],'unique':_0x1f61('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':_0x1f61('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x1f61('0x4')},'announce':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x1f61('0x5'),_0x1f61('0x6'),_0x1f61('0x7'),_0x1f61('0x8'),'linear',_0x1f61('0x9'),_0x1f61('0xa')),'allowNull':![],'defaultValue':_0x1f61('0xb'),'set':function(_0x47f426){this[_0x1f61('0xc')](_0x1f61('0xd'),_0x47f426?_0x47f426:'rrmemory');},'get':function(){var _0x5c4358=this[_0x1f61('0xe')](_0x1f61('0xf'));var _0x3b7368=this[_0x1f61('0xe')](_0x1f61('0x10'));var _0x4011a3=this[_0x1f61('0xe')](_0x1f61('0xd'));if(_0x5c4358==='inbound'){return _0x4011a3;}if(_0x3b7368===_0x1f61('0x11')&&_0x4011a3===_0x1f61('0x8')||_0x3b7368===_0x1f61('0x11')&&_0x4011a3===_0x1f61('0x12')){return _0x4011a3;}if(_0x3b7368===_0x1f61('0x13')||_0x3b7368===_0x1f61('0x14')||_0x3b7368===_0x1f61('0x15')){return _0x4011a3;}return null;}},'servicelevel':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1f61('0x16')](0xb)},'timeout':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1f61('0x1')]},'weight':{'type':Sequelize[_0x1f61('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':_0x1f61('0x18')},'autopause':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no',_0x1f61('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1f61('0x17')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1f61('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x1f61('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x18'),'no'),'defaultValue':_0x1f61('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x1f61('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1f61('0x17')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x1f61('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1f61('0x1')]},'queue_youarenext':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1f61('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1f61('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x1f61('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0x1f61('0x1')]},'queue_less_than':{'type':Sequelize[_0x1f61('0x1')]},'periodic_announce':{'type':Sequelize[_0x1f61('0x1a')],'set':function(_0x5c7b84){this['setDataValue'](_0x1f61('0x1b'),_0x5c7b84?_0x5c7b84['join'](','):[]);},'get':function(){return this[_0x1f61('0xe')](_0x1f61('0x1b'))?this[_0x1f61('0xe')](_0x1f61('0x1b'))[_0x1f61('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':_0x1f61('0x18'),'set':function(_0x44cb76){this['setDataValue'](_0x1f61('0x1d'),_0x44cb76?_0x44cb76[_0x1f61('0x1e')](','):undefined);},'get':function(){return this['getDataValue'](_0x1f61('0x1d'))?this[_0x1f61('0xe')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':'no','set':function(_0x2d6264){this['setDataValue'](_0x1f61('0x1f'),_0x2d6264?_0x2d6264[_0x1f61('0x1e')](','):undefined);},'get':function(){return this[_0x1f61('0xe')]('leavewhenempty')?this[_0x1f61('0xe')](_0x1f61('0x1f'))[_0x1f61('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x1f61('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x1f61('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x1f61('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x1f61('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x1f61('0x20')],'defaultValue':0x0,'set':function(_0xa8129e){this['setDataValue'](_0x1f61('0x21'),_0xa8129e);if(_0xa8129e){if(this[_0x1f61('0xe')](_0x1f61('0x22'))<0x2){this[_0x1f61('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x1f61('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1f61('0x20')],'defaultValue':0x0,'comment':_0x1f61('0x23')},'dialMethod':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x24'),_0x1f61('0x13'),_0x1f61('0x15'),_0x1f61('0x14'),_0x1f61('0x11')),'defaultValue':_0x1f61('0x13'),'comment':_0x1f61('0x25')},'dialLimitChannel':{'type':Sequelize[_0x1f61('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1f61('0x16')](0x4)[_0x1f61('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1f61('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x28'),_0x1f61('0x29')),'defaultValue':_0x1f61('0x29'),'comment':_0x1f61('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1f61('0x2b')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1f61('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1f61('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1f61('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':_0x1f61('0x2e'),'comment':_0x1f61('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x30')},'dialQueueProject':{'type':Sequelize[_0x1f61('0x1')],'comment':_0x1f61('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1f61('0x16')](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1f61('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x1f61('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x38'),'never',_0x1f61('0x39')),'defaultValue':_0x1f61('0x38')},'dialAMDActive':{'type':Sequelize[_0x1f61('0x20')],'defaultValue':0x0,'comment':_0x1f61('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1f61('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1f61('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f61('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1f61('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1f61('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1f61('0x16')](0x9)[_0x1f61('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1f61('0x3f')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1f61('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x1f61('0x20')],'defaultValue':0x0,'comment':_0x1f61('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1f61('0x17')](_0x1f61('0x42'),_0x1f61('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x1f61('0x1')],'comment':_0x1f61('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1f61('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1f61('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x47')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1f61('0x4a')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1f61('0x16')](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1f61('0x16')](0x3)[_0x1f61('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1f61('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1f61('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1f61('0x16')],'allowNull':!![],'comment':_0x1f61('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x1f61('0x20')],'defaultValue':![],'comment':_0x1f61('0x4e'),'set':function(_0x318338){if(!_0x318338)this[_0x1f61('0xc')](_0x1f61('0x4f'),null);this[_0x1f61('0xc')]('mandatoryDisposition',_0x318338);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1f61('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1f61('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x3cd8=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','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)','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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','joinempty','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x3cd8,0x150));var _0x83cd=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x3cd8[_0x408e38];return _0x426b0e;};'use strict';var Sequelize=require(_0x83cd('0x0'));module[_0x83cd('0x1')]={'name':{'type':Sequelize[_0x83cd('0x2')],'allowNull':![],'unique':_0x83cd('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x5'),_0x83cd('0x6')),'allowNull':![],'defaultValue':_0x83cd('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x83cd('0x7')},'announce':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x83cd('0x4')]('rr',_0x83cd('0x8'),_0x83cd('0x9'),_0x83cd('0xa'),_0x83cd('0xb'),_0x83cd('0xc'),_0x83cd('0xd'),_0x83cd('0xe'),_0x83cd('0xf')),'allowNull':![],'defaultValue':_0x83cd('0x8'),'set':function(_0x43b349){this[_0x83cd('0x10')](_0x83cd('0x11'),_0x43b349?_0x43b349:_0x83cd('0xc'));},'get':function(){var _0x1f05f1=this[_0x83cd('0x12')](_0x83cd('0x13'));var _0x147878=this['getDataValue'](_0x83cd('0x14'));var _0x43ee4a=this[_0x83cd('0x12')](_0x83cd('0x11'));if(_0x1f05f1===_0x83cd('0x5')){return _0x43ee4a;}if(_0x147878===_0x83cd('0x15')&&_0x43ee4a===_0x83cd('0xc')||_0x147878===_0x83cd('0x15')&&_0x43ee4a==='roundrobin'){return _0x43ee4a;}if(_0x147878===_0x83cd('0x16')||_0x147878===_0x83cd('0x17')||_0x147878===_0x83cd('0x18')){return _0x43ee4a;}return null;}},'servicelevel':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x83cd('0x19')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x83cd('0x2')]},'weight':{'type':Sequelize[_0x83cd('0x19')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no'),'defaultValue':_0x83cd('0x1a')},'autopause':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x83cd('0x19')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x83cd('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x83cd('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x83cd('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x83cd('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x83cd('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x83cd('0x1a'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no',_0x83cd('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0x83cd('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x83cd('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x83cd('0x2')]},'queue_youarenext':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x83cd('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x83cd('0x2')]},'queue_quantity1':{'type':Sequelize[_0x83cd('0x2')]},'queue_quantity2':{'type':Sequelize[_0x83cd('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x83cd('0x2')]},'queue_less_than':{'type':Sequelize[_0x83cd('0x2')]},'periodic_announce':{'type':Sequelize[_0x83cd('0x1c')],'set':function(_0x4fb8f9){this[_0x83cd('0x10')](_0x83cd('0x1d'),_0x4fb8f9?_0x4fb8f9['join'](','):[]);},'get':function(){return this[_0x83cd('0x12')](_0x83cd('0x1d'))?this['getDataValue']('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':_0x83cd('0x1a'),'set':function(_0x4a5120){this[_0x83cd('0x10')](_0x83cd('0x1e'),_0x4a5120?_0x4a5120[_0x83cd('0x1f')](','):undefined);},'get':function(){return this[_0x83cd('0x12')](_0x83cd('0x1e'))?this[_0x83cd('0x12')](_0x83cd('0x1e'))[_0x83cd('0x20')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':'no','set':function(_0xa84623){this[_0x83cd('0x10')]('leavewhenempty',_0xa84623?_0xa84623[_0x83cd('0x1f')](','):undefined);},'get':function(){return this[_0x83cd('0x12')](_0x83cd('0x21'))?this[_0x83cd('0x12')]('leavewhenempty')['split'](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x83cd('0x2')]},'description':{'type':Sequelize[_0x83cd('0x2')]},'acw':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':0x0,'set':function(_0x2c87aa){this['setDataValue'](_0x83cd('0x23'),_0x2c87aa);if(_0x2c87aa){if(this[_0x83cd('0x12')](_0x83cd('0x24'))<0x2){this['setDataValue'](_0x83cd('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x83cd('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x83cd('0x25'),_0x83cd('0x16'),'power',_0x83cd('0x17'),_0x83cd('0x15')),'defaultValue':_0x83cd('0x16'),'comment':_0x83cd('0x26')},'dialLimitChannel':{'type':Sequelize[_0x83cd('0x19')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83cd('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x83cd('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x83cd('0x29')},'dialPowerLevel':{'type':Sequelize[_0x83cd('0x2a')](0x2)[_0x83cd('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x2b'),'dropRate'),'defaultValue':_0x83cd('0x2c'),'comment':_0x83cd('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x83cd('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x83cd('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x83cd('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x83cd('0x19')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':_0x83cd('0x2f'),'comment':_0x83cd('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x83cd('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x83cd('0x2')],'comment':_0x83cd('0x31')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x83cd('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x83cd('0x36')},'dialTimezone':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x83cd('0x4')]('always','never',_0x83cd('0x37')),'defaultValue':_0x83cd('0x38')},'dialAMDActive':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x83cd('0x19')](0x9)[_0x83cd('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x83cd('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x83cd('0x19')](0x9)[_0x83cd('0x28')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x83cd('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x83cd('0x19')](0x9)[_0x83cd('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x83cd('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x83cd('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x83cd('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x83cd('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x83cd('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x83cd('0x19')](0x9)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x83cd('0x19')](0x5)[_0x83cd('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x83cd('0x19')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x83cd('0x19')](0x5)[_0x83cd('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x83cd('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':0x0,'comment':_0x83cd('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x83cd('0x4')](_0x83cd('0x40'),'ASC'),'defaultValue':_0x83cd('0x40')},'dialQueueProject2':{'type':Sequelize[_0x83cd('0x2')],'comment':_0x83cd('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x83cd('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x83cd('0x41')},'dialCutDigit':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x83cd('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x83cd('0x19')](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x44')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x83cd('0x19')](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x83cd('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x83cd('0x19')](0x5)[_0x83cd('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x83cd('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x83cd('0x19')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x83cd('0x22')],'defaultValue':![],'comment':_0x83cd('0x4c'),'set':function(_0x4b875c){if(!_0x4b875c)this[_0x83cd('0x10')]('mandatoryDispositionPauseId',null);this[_0x83cd('0x10')](_0x83cd('0x4d'),_0x4b875c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x83cd('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x83cd('0x19')](0x3)[_0x83cd('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 18babe7..15ad6cb 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 _0x8e2f=['VoiceQueue','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','VoiceQueues','outbound','UserProfileSection','getHoppers','findOne','CmHopper','nolimit','order','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','union','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','userVoiceQueue:save','isEmpty','isArray','getAgents','getMembers','getLists','CmList','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','NOW()','ContactId','CmListId','ListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','inbound','QueueCampaigns','filter','ignore','map','value','find','type','name','UserProfileResource','stack','send','index','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','pick','merge','where','VIRTUAL'];(function(_0x31bdca,_0x373a5e){var _0xb62c71=function(_0x12d50d){while(--_0x12d50d){_0x31bdca['push'](_0x31bdca['shift']());}};_0xb62c71(++_0x373a5e);}(_0x8e2f,0x73));var _0xf8e2=function(_0x560629,_0x1d093c){_0x560629=_0x560629-0x0;var _0x143d59=_0x8e2f[_0x560629];return _0x143d59;};'use strict';var emlformat=require(_0xf8e2('0x0'));var rimraf=require(_0xf8e2('0x1'));var zipdir=require(_0xf8e2('0x2'));var jsonpatch=require(_0xf8e2('0x3'));var rp=require(_0xf8e2('0x4'));var moment=require('moment');var BPromise=require(_0xf8e2('0x5'));var Mustache=require(_0xf8e2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf8e2('0x7'));var csv=require(_0xf8e2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf8e2('0x9'));var _=require(_0xf8e2('0xa'));var squel=require(_0xf8e2('0xb'));var crypto=require(_0xf8e2('0xc'));var jsforce=require(_0xf8e2('0xd'));var deskjs=require(_0xf8e2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8e2('0xf'));var Papa=require(_0xf8e2('0x10'));var Redis=require(_0xf8e2('0x11'));var authService=require(_0xf8e2('0x12'));var qs=require(_0xf8e2('0x13'));var as=require(_0xf8e2('0x14'));var hardwareService=require(_0xf8e2('0x15'));var logger=require('../../config/logger')(_0xf8e2('0x16'));var utils=require(_0xf8e2('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf8e2('0x18'));var db=require(_0xf8e2('0x19'))['db'];config[_0xf8e2('0x1a')]=_['defaults'](config[_0xf8e2('0x1a')],{'host':_0xf8e2('0x1b'),'port':0x18eb});var socket=require(_0xf8e2('0x1c'))(new Redis(config[_0xf8e2('0x1a')]));require(_0xf8e2('0x1d'))[_0xf8e2('0x1e')](socket);function respondWithStatusCode(_0xdcc1cc,_0x8f9647){_0x8f9647=_0x8f9647||0xcc;return function(_0x38f83f){if(_0x38f83f){return _0xdcc1cc[_0xf8e2('0x1f')](_0x8f9647);}return _0xdcc1cc['status'](_0x8f9647)[_0xf8e2('0x20')]();};}function respondWithResult(_0x55976c,_0x52f457){_0x52f457=_0x52f457||0xc8;return function(_0x2a76bc){if(_0x2a76bc){return _0x55976c[_0xf8e2('0x21')](_0x52f457)[_0xf8e2('0x22')](_0x2a76bc);}};}function respondWithFilteredResult(_0xcd7ce,_0x1c7cce){return function(_0x5ae753){if(_0x5ae753){var _0x107dd0=typeof _0x1c7cce['offset']===_0xf8e2('0x23')&&typeof _0x1c7cce[_0xf8e2('0x24')]===_0xf8e2('0x23');var _0x57ce7c=_0x5ae753[_0xf8e2('0x25')];var _0x5b03cc=_0x107dd0?0x0:_0x1c7cce[_0xf8e2('0x26')];var _0x1c7b2c=_0x107dd0?_0x5ae753[_0xf8e2('0x25')]:_0x1c7cce[_0xf8e2('0x26')]+_0x1c7cce[_0xf8e2('0x24')];var _0x10ec27;if(_0x1c7b2c>=_0x57ce7c){_0x1c7b2c=_0x57ce7c;_0x10ec27=0xc8;}else{_0x10ec27=0xce;}_0xcd7ce[_0xf8e2('0x21')](_0x10ec27);return _0xcd7ce[_0xf8e2('0x27')](_0xf8e2('0x28'),_0x5b03cc+'-'+_0x1c7b2c+'/'+_0x57ce7c)[_0xf8e2('0x22')](_0x5ae753);}return null;};}function patchUpdates(_0x1b4756){return function(_0xcaf3bb){try{jsonpatch[_0xf8e2('0x29')](_0xcaf3bb,_0x1b4756,!![]);}catch(_0x39d10b){return BPromise[_0xf8e2('0x2a')](_0x39d10b);}return _0xcaf3bb[_0xf8e2('0x2b')]();};}function saveUpdates(_0x4d1795,_0x5ee358){return function(_0x14ea86){if(_0x14ea86){return _0x14ea86[_0xf8e2('0x2c')](_0x4d1795)[_0xf8e2('0x2d')](function(_0x17ecb9){return _0x17ecb9;});}return null;};}function removeEntity(_0x110027,_0xc183ba){return function(_0x47ea92){if(_0x47ea92){return _0x47ea92[_0xf8e2('0x2e')]()[_0xf8e2('0x2d')](function(){var _0x2a5698=_0x47ea92['get']({'plain':!![]});var _0x4a537e=[{'name':'VoiceQueues','value':_0xf8e2('0x2f'),'ignore':![]},{'name':_0xf8e2('0x30'),'value':'outbound','ignore':![]}];var _0x1e1e64=_(_0x4a537e)[_0xf8e2('0x31')](_0xf8e2('0x32'))[_0xf8e2('0x33')](_0xf8e2('0x34'))[_0xf8e2('0x34')]();if(_['includes'](_0x1e1e64,_0x2a5698['type'])){return;}var _0x328f93=_[_0xf8e2('0x35')](_0x4a537e,['value',_0x2a5698[_0xf8e2('0x36')]])[_0xf8e2('0x37')];return db[_0xf8e2('0x38')][_0xf8e2('0x2e')]({'where':{'type':_0x328f93,'resourceId':_0x2a5698['id']}})[_0xf8e2('0x2d')](function(){return _0x47ea92;});})[_0xf8e2('0x2d')](function(){_0x110027[_0xf8e2('0x21')](0xcc)[_0xf8e2('0x20')]();});}};}function handleEntityNotFound(_0x1f2610,_0x517793){return function(_0x1dc08c){if(!_0x1dc08c){_0x1f2610[_0xf8e2('0x1f')](0x194);}return _0x1dc08c;};}function handleError(_0x1c8ef5,_0x17f1c8){_0x17f1c8=_0x17f1c8||0x1f4;return function(_0x245610){logger['error'](_0x245610[_0xf8e2('0x39')]);if(_0x245610[_0xf8e2('0x37')]){delete _0x245610[_0xf8e2('0x37')];}_0x1c8ef5[_0xf8e2('0x21')](_0x17f1c8)[_0xf8e2('0x3a')](_0x245610);};}exports[_0xf8e2('0x3b')]=function(_0x434039,_0x42d243){var _0x2f8d34={},_0x140394={},_0x3b6d83={'count':0x0,'rows':[]};var _0x4e9b17=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x36b472){return{'name':_0x36b472[_0xf8e2('0x3c')],'type':_0x36b472[_0xf8e2('0x36')]['key']};});_0x140394['model']=_[_0xf8e2('0x33')](_0x4e9b17,_0xf8e2('0x37'));_0x140394[_0xf8e2('0x3d')]=_[_0xf8e2('0x3e')](_0x434039[_0xf8e2('0x3d')]);_0x140394['filters']=_[_0xf8e2('0x3f')](_0x140394[_0xf8e2('0x40')],_0x140394['query']);_0x2f8d34[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x140394[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x434039[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x2f8d34[_0xf8e2('0x41')]=_0x2f8d34['attributes'][_0xf8e2('0x43')]?_0x2f8d34[_0xf8e2('0x41')]:_0x140394[_0xf8e2('0x40')];if(!_0x434039[_0xf8e2('0x3d')][_0xf8e2('0x44')]('nolimit')){_0x2f8d34[_0xf8e2('0x24')]=qs['limit'](_0x434039['query']['limit']);_0x2f8d34[_0xf8e2('0x26')]=qs['offset'](_0x434039[_0xf8e2('0x3d')]['offset']);}_0x2f8d34['order']=qs[_0xf8e2('0x45')](_0x434039[_0xf8e2('0x3d')][_0xf8e2('0x45')]);_0x2f8d34['where']=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0x434039[_0xf8e2('0x3d')],_0x140394[_0xf8e2('0x46')]),_0x4e9b17);if(_0x434039['query']['filter']){_0x2f8d34['where']=_[_0xf8e2('0x48')](_0x2f8d34[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x4e9b17,function(_0x158f30){if(_0x158f30[_0xf8e2('0x36')]!==_0xf8e2('0x4a')){var _0x285b50={};_0x285b50[_0x158f30[_0xf8e2('0x37')]]={'$like':'%'+_0x434039[_0xf8e2('0x3d')][_0xf8e2('0x31')]+'%'};return _0x285b50;}})});}_0x2f8d34=_[_0xf8e2('0x48')]({},_0x2f8d34,_0x434039['options']);var _0x2e43e7={'where':_0x2f8d34[_0xf8e2('0x49')]};return db[_0xf8e2('0x4b')]['count'](_0x2e43e7)[_0xf8e2('0x2d')](function(_0x5f255b){_0x3b6d83['count']=_0x5f255b;if(_0x434039[_0xf8e2('0x3d')]['includeAll']){_0x2f8d34[_0xf8e2('0x4c')]=[{'all':!![]}];}return db[_0xf8e2('0x4b')][_0xf8e2('0x4d')](_0x2f8d34);})[_0xf8e2('0x2d')](function(_0x15a362){_0x3b6d83[_0xf8e2('0x4e')]=_0x15a362;return _0x3b6d83;})[_0xf8e2('0x2d')](respondWithFilteredResult(_0x42d243,_0x2f8d34))[_0xf8e2('0x4f')](handleError(_0x42d243,null));};exports[_0xf8e2('0x50')]=function(_0x23630a,_0x5f21d4){var _0x1bd2f7={'raw':![],'where':{'id':_0x23630a[_0xf8e2('0x51')]['id']}},_0x2fa81e={};_0x2fa81e[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db[_0xf8e2('0x4b')][_0xf8e2('0x52')]);_0x2fa81e[_0xf8e2('0x3d')]=_[_0xf8e2('0x3e')](_0x23630a[_0xf8e2('0x3d')]);_0x2fa81e[_0xf8e2('0x46')]=_['intersection'](_0x2fa81e[_0xf8e2('0x40')],_0x2fa81e[_0xf8e2('0x3d')]);_0x1bd2f7[_0xf8e2('0x41')]=_['intersection'](_0x2fa81e[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x23630a[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x1bd2f7['attributes']=_0x1bd2f7[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x1bd2f7['attributes']:_0x2fa81e['model'];if(_0x23630a[_0xf8e2('0x3d')][_0xf8e2('0x53')]){_0x1bd2f7[_0xf8e2('0x4c')]=[{'all':!![]}];}_0x1bd2f7=_['merge']({},_0x1bd2f7,_0x23630a[_0xf8e2('0x54')]);return db[_0xf8e2('0x4b')][_0xf8e2('0x35')](_0x1bd2f7)[_0xf8e2('0x2d')](handleEntityNotFound(_0x5f21d4,null))[_0xf8e2('0x2d')](respondWithResult(_0x5f21d4,null))[_0xf8e2('0x4f')](handleError(_0x5f21d4,null));};exports[_0xf8e2('0x55')]=function(_0x3118a7,_0x3e4ad0){return db[_0xf8e2('0x4b')][_0xf8e2('0x55')](_0x3118a7[_0xf8e2('0x56')],{})['then'](function(_0xc5cc47){var _0x126515=_0x3118a7[_0xf8e2('0x57')][_0xf8e2('0x58')]({'plain':!![]});if(!_0x126515)throw new Error(_0xf8e2('0x59'));if(_0x126515[_0xf8e2('0x5a')]===_0xf8e2('0x57')){var _0x3fc233=_0xc5cc47[_0xf8e2('0x58')]({'plain':!![]});var _0x1c3798=[{'name':'VoiceQueues','value':_0xf8e2('0x2f')},{'name':_0xf8e2('0x30'),'value':'outbound'}];var _0x554952=_[_0xf8e2('0x35')](_0x1c3798,[_0xf8e2('0x34'),_0x3fc233[_0xf8e2('0x36')]])[_0xf8e2('0x37')];return db['UserProfileSection'][_0xf8e2('0x35')]({'where':{'name':_0x554952,'userProfileId':_0x126515[_0xf8e2('0x5b')]},'raw':!![]})['then'](function(_0x509fd4){if(_0x509fd4&&_0x509fd4[_0xf8e2('0x5c')]===0x0){return db['UserProfileResource'][_0xf8e2('0x55')]({'name':_0x3fc233[_0xf8e2('0x37')],'resourceId':_0x3fc233['id'],'type':_0x509fd4[_0xf8e2('0x37')],'sectionId':_0x509fd4['id']},{})[_0xf8e2('0x2d')](function(){return _0xc5cc47;});}else{return _0xc5cc47;}})[_0xf8e2('0x4f')](function(_0x467fb8){logger[_0xf8e2('0x5d')](_0xf8e2('0x5e'),_0x467fb8);throw _0x467fb8;});}return _0xc5cc47;})['then'](respondWithResult(_0x3e4ad0,0xc9))[_0xf8e2('0x4f')](handleError(_0x3e4ad0,null));};exports[_0xf8e2('0x5f')]=function(_0x42e342,_0x44d3ed){var _0xd51987={'where':{'id':_0x42e342[_0xf8e2('0x51')]['id']}},_0x2fdb97={};_0x2fdb97[_0xf8e2('0x40')]=_['keys'](db[_0xf8e2('0x4b')][_0xf8e2('0x52')]);_0xd51987['attributes']=_[_0xf8e2('0x3f')](_0x2fdb97[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x42e342[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0xd51987[_0xf8e2('0x41')]=_0xd51987['attributes'][_0xf8e2('0x43')]?_0xd51987[_0xf8e2('0x41')]:_0x2fdb97['model'];if(_0x42e342[_0xf8e2('0x3d')]['includeAll']){_0xd51987[_0xf8e2('0x4c')]=[{'all':!![]}];}_0xd51987=_['merge']({},_0xd51987,_0x42e342['options']);return db[_0xf8e2('0x4b')]['find'](_0xd51987)[_0xf8e2('0x2d')](handleEntityNotFound(_0x44d3ed,null))['then'](function(_0x38cf8a){if(_0x38cf8a){var _0x1b86a4=_0x38cf8a[_0xf8e2('0x58')]({'plain':!![]});_0x1b86a4=qs[_0xf8e2('0x60')](_0x1b86a4,['id',_0xf8e2('0x61'),_0xf8e2('0x62')]);_0x42e342[_0xf8e2('0x56')]=_['omit'](_0x42e342[_0xf8e2('0x56')],['id',_0xf8e2('0x61'),'updatedAt']);return db[_0xf8e2('0x4b')][_0xf8e2('0x55')](_[_0xf8e2('0x48')](_0x1b86a4,_0x42e342[_0xf8e2('0x56')]),{'include':_0x42e342['query'][_0xf8e2('0x53')]?[{'all':!![]}]:undefined})[_0xf8e2('0x2d')](function(_0x63dbbe){var _0xc23bf5=_0x42e342[_0xf8e2('0x57')][_0xf8e2('0x58')]({'plain':!![]});if(!_0xc23bf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc23bf5[_0xf8e2('0x5a')]===_0xf8e2('0x57')){var _0x6cbf57=_0x63dbbe[_0xf8e2('0x58')]({'plain':!![]});var _0x16af30=[{'name':_0xf8e2('0x63'),'value':_0xf8e2('0x2f')},{'name':_0xf8e2('0x30'),'value':_0xf8e2('0x64')}];var _0x3dfeb8=_[_0xf8e2('0x35')](_0x16af30,[_0xf8e2('0x34'),_0x6cbf57[_0xf8e2('0x36')]])[_0xf8e2('0x37')];return db[_0xf8e2('0x65')][_0xf8e2('0x35')]({'where':{'name':_0x3dfeb8,'userProfileId':_0xc23bf5['userProfileId']},'raw':!![]})[_0xf8e2('0x2d')](function(_0x574fbd){if(_0x574fbd&&_0x574fbd[_0xf8e2('0x5c')]===0x0){return db[_0xf8e2('0x38')]['create']({'name':_0x6cbf57[_0xf8e2('0x37')],'resourceId':_0x6cbf57['id'],'type':_0x574fbd[_0xf8e2('0x37')],'sectionId':_0x574fbd['id']},{})[_0xf8e2('0x2d')](function(){return _0x63dbbe;});}else{return _0x63dbbe;}})['catch'](function(_0x5d8300){logger[_0xf8e2('0x5d')](_0xf8e2('0x5e'),_0x5d8300);throw _0x5d8300;});}return _0x63dbbe;});}})[_0xf8e2('0x2d')](respondWithResult(_0x44d3ed,0xc9))['catch'](handleError(_0x44d3ed,null));};exports[_0xf8e2('0x2c')]=function(_0x1215de,_0xfb18fd){if(_0x1215de[_0xf8e2('0x56')]['id']){delete _0x1215de[_0xf8e2('0x56')]['id'];}return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x1215de[_0xf8e2('0x51')]['id']}})['then'](handleEntityNotFound(_0xfb18fd,null))[_0xf8e2('0x2d')](saveUpdates(_0x1215de[_0xf8e2('0x56')],null))['then'](respondWithResult(_0xfb18fd,null))[_0xf8e2('0x4f')](handleError(_0xfb18fd,null));};exports['destroy']=function(_0x4a4384,_0x2efab5){return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x4a4384['params']['id']}})['then'](handleEntityNotFound(_0x2efab5,null))[_0xf8e2('0x2d')](removeEntity(_0x2efab5,null))[_0xf8e2('0x4f')](handleError(_0x2efab5,null));};exports[_0xf8e2('0x66')]=function(_0xde5bb7,_0x14478d,_0x3cd218){var _0x29060a={'raw':![],'where':{}};var _0x4457f0={};var _0x3a0a05={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xf8e2('0x67')]({'where':{'id':_0xde5bb7[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x14478d,null))[_0xf8e2('0x2d')](function(_0x2ed249){if(_0x2ed249){_0x4457f0[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db[_0xf8e2('0x68')][_0xf8e2('0x52')]);_0x4457f0[_0xf8e2('0x3d')]=_[_0xf8e2('0x3e')](_0xde5bb7[_0xf8e2('0x3d')]);_0x4457f0[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x4457f0[_0xf8e2('0x40')],_0x4457f0['query']);_0x29060a[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x4457f0[_0xf8e2('0x40')],qs['fields'](_0xde5bb7['query'][_0xf8e2('0x42')]));_0x29060a[_0xf8e2('0x41')]=_0x29060a[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x29060a[_0xf8e2('0x41')]:_0x4457f0['model'];if(!_0xde5bb7[_0xf8e2('0x3d')][_0xf8e2('0x44')](_0xf8e2('0x69'))){_0x29060a['limit']=qs['limit'](_0xde5bb7['query'][_0xf8e2('0x24')]);_0x29060a[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0xde5bb7[_0xf8e2('0x3d')]['offset']);}_0x29060a[_0xf8e2('0x6a')]=qs[_0xf8e2('0x45')](_0xde5bb7[_0xf8e2('0x3d')][_0xf8e2('0x45')]);_0x29060a[_0xf8e2('0x49')]=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0xde5bb7[_0xf8e2('0x3d')],_0x4457f0[_0xf8e2('0x46')]));_0x29060a[_0xf8e2('0x49')][_0xf8e2('0x6b')]=_0x2ed249['id'];if(_0xde5bb7['query']['filter']){_0x29060a[_0xf8e2('0x49')]=_[_0xf8e2('0x48')](_0x29060a['where'],{'$or':_['map'](_0x29060a[_0xf8e2('0x41')],function(_0x38be7c){var _0x25caad={};_0x25caad[_0x38be7c]={'$like':'%'+_0xde5bb7['query'][_0xf8e2('0x31')]+'%'};return _0x25caad;})});}_0x29060a=_[_0xf8e2('0x48')]({},_0x29060a,_0xde5bb7[_0xf8e2('0x54')]);return db[_0xf8e2('0x68')]['count']({'where':_0x29060a[_0xf8e2('0x49')]})[_0xf8e2('0x2d')](function(_0x505dfe){_0x3a0a05['count']=_0x505dfe;if(_0xde5bb7['query']['includeAll']){_0x29060a['include']=[{'all':!![]}];}return db[_0xf8e2('0x68')]['findAll'](_0x29060a);})['then'](function(_0x3fa43f){_0x3a0a05['rows']=_0x3fa43f;return _0x3a0a05;});}})[_0xf8e2('0x2d')](respondWithFilteredResult(_0x14478d,_0x29060a))['catch'](handleError(_0x14478d,null));};exports['getHopperHistories']=function(_0x38def9,_0x4479b5,_0x166d9c){var _0x2083ca={'raw':!![],'where':{}};var _0x5775c5={};var _0x51b0b1={'count':0x0,'rows':[]};return db[_0xf8e2('0x4b')][_0xf8e2('0x67')]({'where':{'id':_0x38def9[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x4479b5,null))[_0xf8e2('0x2d')](function(_0x21f04f){if(_0x21f04f){_0x5775c5[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db['CmHopperHistory'][_0xf8e2('0x52')]);_0x5775c5['query']=_['keys'](_0x38def9['query']);_0x5775c5[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x5775c5['model'],_0x5775c5[_0xf8e2('0x3d')]);_0x2083ca['attributes']=_[_0xf8e2('0x3f')](_0x5775c5['model'],qs[_0xf8e2('0x42')](_0x38def9[_0xf8e2('0x3d')]['fields']));_0x2083ca[_0xf8e2('0x41')]=_0x2083ca[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x2083ca[_0xf8e2('0x41')]:_0x5775c5['model'];if(!_0x38def9[_0xf8e2('0x3d')]['hasOwnProperty']('nolimit')){_0x2083ca[_0xf8e2('0x24')]=qs[_0xf8e2('0x24')](_0x38def9[_0xf8e2('0x3d')][_0xf8e2('0x24')]);_0x2083ca[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x38def9[_0xf8e2('0x3d')][_0xf8e2('0x26')]);}_0x2083ca[_0xf8e2('0x6a')]=qs[_0xf8e2('0x45')](_0x38def9[_0xf8e2('0x3d')][_0xf8e2('0x45')]);_0x2083ca[_0xf8e2('0x49')]=qs['filters'](_[_0xf8e2('0x47')](_0x38def9[_0xf8e2('0x3d')],_0x5775c5[_0xf8e2('0x46')]));_0x2083ca[_0xf8e2('0x49')]['VoiceQueueId']=_0x21f04f['id'];if(_0x38def9[_0xf8e2('0x3d')]['filter']){_0x2083ca['where']=_[_0xf8e2('0x48')](_0x2083ca[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x2083ca['attributes'],function(_0x419f09){var _0x277b80={};_0x277b80[_0x419f09]={'$like':'%'+_0x38def9['query']['filter']+'%'};return _0x277b80;})});}_0x2083ca=_[_0xf8e2('0x48')]({},_0x2083ca,_0x38def9['options']);return db['CmHopperHistory'][_0xf8e2('0x25')]({'where':_0x2083ca[_0xf8e2('0x49')]})[_0xf8e2('0x2d')](function(_0x4bc074){_0x51b0b1[_0xf8e2('0x25')]=_0x4bc074;if(_0x38def9['query'][_0xf8e2('0x53')]){_0x2083ca[_0xf8e2('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf8e2('0x4d')](_0x2083ca);})[_0xf8e2('0x2d')](function(_0x3de7e1){_0x51b0b1[_0xf8e2('0x4e')]=_0x3de7e1;return _0x51b0b1;});}})[_0xf8e2('0x2d')](respondWithFilteredResult(_0x4479b5,_0x2083ca))[_0xf8e2('0x4f')](handleError(_0x4479b5,null));};exports[_0xf8e2('0x6c')]=function(_0x5830e0,_0x322679,_0x520b5b){var _0x41da4a={'raw':!![],'where':{}};var _0x18534b={};var _0x3cd628={'count':0x0,'rows':[]};return db[_0xf8e2('0x4b')]['findOne']({'where':{'id':_0x5830e0[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x322679,null))[_0xf8e2('0x2d')](function(_0x3da710){if(_0x3da710){_0x18534b[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db[_0xf8e2('0x6d')]['rawAttributes']);_0x18534b['query']=_['keys'](_0x5830e0['query']);_0x18534b[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x18534b[_0xf8e2('0x40')],_0x18534b['query']);_0x41da4a[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x18534b[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x5830e0[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x41da4a['attributes']=_0x41da4a[_0xf8e2('0x41')]['length']?_0x41da4a[_0xf8e2('0x41')]:_0x18534b[_0xf8e2('0x40')];if(!_0x5830e0[_0xf8e2('0x3d')][_0xf8e2('0x44')]('nolimit')){_0x41da4a[_0xf8e2('0x24')]=qs['limit'](_0x5830e0['query']['limit']);_0x41da4a[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x5830e0['query'][_0xf8e2('0x26')]);}_0x41da4a[_0xf8e2('0x6a')]=qs[_0xf8e2('0x45')](_0x5830e0[_0xf8e2('0x3d')][_0xf8e2('0x45')]);_0x41da4a[_0xf8e2('0x49')]=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0x5830e0[_0xf8e2('0x3d')],_0x18534b[_0xf8e2('0x46')]));_0x41da4a['where']['VoiceQueueId']=_0x3da710['id'];if(_0x5830e0['query']['filter']){_0x41da4a[_0xf8e2('0x49')]=_['merge'](_0x41da4a[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x41da4a[_0xf8e2('0x41')],function(_0x2adf40){var _0x3d2fd0={};_0x3d2fd0[_0x2adf40]={'$like':'%'+_0x5830e0[_0xf8e2('0x3d')]['filter']+'%'};return _0x3d2fd0;})});}_0x41da4a=_[_0xf8e2('0x48')]({},_0x41da4a,_0x5830e0['options']);return db['CmHopperFinal'][_0xf8e2('0x25')]({'where':_0x41da4a[_0xf8e2('0x49')]})[_0xf8e2('0x2d')](function(_0x4680e9){_0x3cd628[_0xf8e2('0x25')]=_0x4680e9;if(_0x5830e0[_0xf8e2('0x3d')][_0xf8e2('0x53')]){_0x41da4a[_0xf8e2('0x4c')]=[{'all':!![]}];}return db[_0xf8e2('0x6d')][_0xf8e2('0x4d')](_0x41da4a);})[_0xf8e2('0x2d')](function(_0x13b9ed){_0x3cd628['rows']=_0x13b9ed;return _0x3cd628;});}})[_0xf8e2('0x2d')](respondWithFilteredResult(_0x322679,_0x41da4a))[_0xf8e2('0x4f')](handleError(_0x322679,null));};exports[_0xf8e2('0x6e')]=function(_0x548ece,_0x5ced80,_0xb9fb77){var _0x2f7d1a={'raw':!![],'where':{}};var _0x50b79f={};var _0x4b3c8c={'count':0x0,'rows':[]};return db[_0xf8e2('0x4b')][_0xf8e2('0x67')]({'where':{'id':_0x548ece[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x5ced80,null))[_0xf8e2('0x2d')](function(_0x903a14){if(_0x903a14){_0x50b79f['model']=_['keys'](db[_0xf8e2('0x6f')][_0xf8e2('0x52')]);_0x50b79f['query']=_[_0xf8e2('0x3e')](_0x548ece[_0xf8e2('0x3d')]);_0x50b79f['filters']=_[_0xf8e2('0x3f')](_0x50b79f[_0xf8e2('0x40')],_0x50b79f[_0xf8e2('0x3d')]);_0x2f7d1a[_0xf8e2('0x41')]=_['intersection'](_0x50b79f['model'],qs['fields'](_0x548ece[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x2f7d1a[_0xf8e2('0x41')]=_0x2f7d1a[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x2f7d1a[_0xf8e2('0x41')]:_0x50b79f[_0xf8e2('0x40')];if(!_0x548ece[_0xf8e2('0x3d')][_0xf8e2('0x44')](_0xf8e2('0x69'))){_0x2f7d1a[_0xf8e2('0x24')]=qs[_0xf8e2('0x24')](_0x548ece[_0xf8e2('0x3d')]['limit']);_0x2f7d1a[_0xf8e2('0x26')]=qs['offset'](_0x548ece['query'][_0xf8e2('0x26')]);}_0x2f7d1a[_0xf8e2('0x6a')]=qs[_0xf8e2('0x45')](_0x548ece['query'][_0xf8e2('0x45')]);_0x2f7d1a[_0xf8e2('0x49')]=qs['filters'](_[_0xf8e2('0x47')](_0x548ece[_0xf8e2('0x3d')],_0x50b79f[_0xf8e2('0x46')]));_0x2f7d1a['where'][_0xf8e2('0x6b')]=_0x903a14['id'];if(_0x548ece['query'][_0xf8e2('0x31')]){_0x2f7d1a[_0xf8e2('0x49')]=_[_0xf8e2('0x48')](_0x2f7d1a['where'],{'$or':_[_0xf8e2('0x33')](_0x2f7d1a[_0xf8e2('0x41')],function(_0x29080a){var _0x1386a9={};_0x1386a9[_0x29080a]={'$like':'%'+_0x548ece['query'][_0xf8e2('0x31')]+'%'};return _0x1386a9;})});}_0x2f7d1a=_[_0xf8e2('0x48')]({},_0x2f7d1a,_0x548ece[_0xf8e2('0x54')]);return db[_0xf8e2('0x6f')]['count']({'where':_0x2f7d1a[_0xf8e2('0x49')]})[_0xf8e2('0x2d')](function(_0x5a6ff2){_0x4b3c8c[_0xf8e2('0x25')]=_0x5a6ff2;if(_0x548ece[_0xf8e2('0x3d')][_0xf8e2('0x53')]){_0x2f7d1a['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xf8e2('0x4d')](_0x2f7d1a);})[_0xf8e2('0x2d')](function(_0x43ba5b){_0x4b3c8c[_0xf8e2('0x4e')]=_0x43ba5b;return _0x4b3c8c;});}})[_0xf8e2('0x2d')](respondWithFilteredResult(_0x5ced80,_0x2f7d1a))[_0xf8e2('0x4f')](handleError(_0x5ced80,null));};exports[_0xf8e2('0x70')]=function(_0x15db6d,_0x470bbe,_0xe97351){var _0x358065={};var _0x4d59e2={};var _0x1b2a11;var _0x2987a8;return db['VoiceQueue'][_0xf8e2('0x67')]({'where':{'id':_0x15db6d[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x470bbe,null))[_0xf8e2('0x2d')](function(_0x5a7916){if(_0x5a7916){_0x1b2a11=_0x5a7916;_0x4d59e2[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db[_0xf8e2('0x71')][_0xf8e2('0x52')]);_0x4d59e2[_0xf8e2('0x3d')]=_[_0xf8e2('0x3e')](_0x15db6d[_0xf8e2('0x3d')]);_0x4d59e2['filters']=_['intersection'](_0x4d59e2[_0xf8e2('0x40')],_0x4d59e2['query']);_0x358065[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x4d59e2[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x15db6d['query'][_0xf8e2('0x42')]));_0x358065[_0xf8e2('0x41')]=_0x358065[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x358065[_0xf8e2('0x41')]:_0x4d59e2[_0xf8e2('0x40')];_0x358065['order']=qs[_0xf8e2('0x45')](_0x15db6d[_0xf8e2('0x3d')]['sort']);_0x358065[_0xf8e2('0x49')]=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0x15db6d['query'],_0x4d59e2[_0xf8e2('0x46')]));if(_0x15db6d[_0xf8e2('0x3d')][_0xf8e2('0x31')]){_0x358065['where']=_['merge'](_0x358065['where'],{'$or':_[_0xf8e2('0x33')](_0x358065[_0xf8e2('0x41')],function(_0x18c07b){var _0x16f2a6={};_0x16f2a6[_0x18c07b]={'$like':'%'+_0x15db6d[_0xf8e2('0x3d')]['filter']+'%'};return _0x16f2a6;})});}_0x358065=_['merge']({},_0x358065,_0x15db6d[_0xf8e2('0x54')]);return _0x1b2a11[_0xf8e2('0x70')](_0x358065);}})[_0xf8e2('0x2d')](function(_0x1f1dd7){if(_0x1f1dd7){_0x2987a8=_0x1f1dd7[_0xf8e2('0x43')];if(!_0x15db6d['query'][_0xf8e2('0x44')](_0xf8e2('0x69'))){_0x358065[_0xf8e2('0x24')]=qs[_0xf8e2('0x24')](_0x15db6d[_0xf8e2('0x3d')]['limit']);_0x358065[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x15db6d[_0xf8e2('0x3d')]['offset']);}return _0x1b2a11[_0xf8e2('0x70')](_0x358065);}})[_0xf8e2('0x2d')](function(_0x84a13f){if(_0x84a13f){return _0x84a13f?{'count':_0x2987a8,'rows':_0x84a13f}:null;}})[_0xf8e2('0x2d')](respondWithResult(_0x470bbe,null))[_0xf8e2('0x4f')](handleError(_0x470bbe,null));};exports[_0xf8e2('0x72')]=function(_0x39d4ee,_0x592e12,_0x58ccd0){var _0x1f63c4=_0x39d4ee[_0xf8e2('0x56')][_0xf8e2('0x73')];var _0x39ed18=_['map'](_0x1f63c4,'id');return db['Team']['findAll']({'where':{'id':_0x39ed18},'attributes':['id'],'include':[{'model':db[_0xf8e2('0x74')],'as':_0xf8e2('0x75'),'attributes':['id',_0xf8e2('0x37'),_0xf8e2('0x76'),_0xf8e2('0x77'),_0xf8e2('0x78')],'raw':!![]}]})[_0xf8e2('0x2d')](function(_0x1e8d1d){if(_0x1e8d1d){var _0x49cc82=_[_0xf8e2('0x79')](_0x1e8d1d,function(_0x523003){var _0x41d7ec=_0x523003['get']({'plain':!![]});_0x41d7ec['Agents'][_0xf8e2('0x7a')](function(_0x49f189){_0x49f189[_0xf8e2('0x7b')]=_[_0xf8e2('0x35')](_0x1f63c4,{'id':_0x41d7ec['id']})['penalty'];});return _0x41d7ec[_0xf8e2('0x75')];});return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x39d4ee[_0xf8e2('0x51')]['id']}})['then'](function(_0x52bcbc){return db['sequelize'][_0xf8e2('0x7c')](function(_0x5aed56){return _0x52bcbc[_0xf8e2('0x72')](_0x39ed18,{'transaction':_0x5aed56})[_0xf8e2('0x2d')](function(){return BPromise[_0xf8e2('0x7d')](_0x1f63c4,function(_0x1f12b8){return db[_0xf8e2('0x7e')][_0xf8e2('0x7f')]({'TeamId':_0x1f12b8['id'],'VoiceQueueId':_0x39d4ee[_0xf8e2('0x51')]['id'],'penalty':_0x1f12b8['penalty']},{'transaction':_0x5aed56});});})[_0xf8e2('0x2d')](function(){return BPromise[_0xf8e2('0x7d')](_0x49cc82,function(_0x5ac158){return db[_0xf8e2('0x80')][_0xf8e2('0x81')]({'where':{'UserId':_0x5ac158['id'],'VoiceQueueId':_0x39d4ee['params']['id']},'defaults':{'penalty':_0x5ac158[_0xf8e2('0x7b')]},'transaction':_0x5aed56});});})[_0xf8e2('0x2d')](function(){return BPromise[_0xf8e2('0x7d')](_['filter'](_0x49cc82,{'online':!![]}),function(_0x4e27a7){return db[_0xf8e2('0x82')][_0xf8e2('0x7f')]({'membername':_0x4e27a7[_0xf8e2('0x37')],'UserId':_0x4e27a7['id'],'queue_name':_0x52bcbc[_0xf8e2('0x37')],'VoiceQueueId':_0x52bcbc['id'],'interface':_[_0xf8e2('0x83')](_0x4e27a7[_0xf8e2('0x78')])?util[_0xf8e2('0x84')](_0xf8e2('0x85'),_0x4e27a7[_0xf8e2('0x37')]):_0x4e27a7['interface'],'paused':_0x4e27a7[_0xf8e2('0x77')]||![],'penalty':_0x4e27a7[_0xf8e2('0x7b')]},{'transaction':_0x5aed56});});})[_0xf8e2('0x2d')](function(){_0x49cc82[_0xf8e2('0x7a')](function(_0x2be846){socket[_0xf8e2('0x86')]('userVoiceQueue:save',{'UserId':_0x2be846['id'],'VoiceQueueId':_0x52bcbc['id']});});});});});}})[_0xf8e2('0x2d')](respondWithStatusCode(_0x592e12,null))['catch'](handleError(_0x592e12,null));};exports[_0xf8e2('0x87')]=function(_0x44ef94,_0x3f46e3,_0x133007){return db['Team'][_0xf8e2('0x4d')]({'where':{'id':_0x44ef94['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf8e2('0x2d')](handleEntityNotFound(_0x3f46e3,null))[_0xf8e2('0x2d')](function(_0x360cc9){var _0x5f2159=_['map'](_0x360cc9,'id');var _0x3b49d2=[];var _0x5088ed=[];var _0x172101=squel[_0xf8e2('0x88')]();_0x172101[_0xf8e2('0x89')](_0xf8e2('0x8a'))[_0xf8e2('0x8b')]('team_has_voice_queues','tq')[_0xf8e2('0x8c')](_0xf8e2('0x8d'),'ut',_0xf8e2('0x8e'))[_0xf8e2('0x49')]('VoiceQueueId\x20=\x20?',_0x44ef94[_0xf8e2('0x51')]['id']);for(var _0x48f82c=0x0;_0x48f82c<_0x360cc9[_0xf8e2('0x43')];_0x48f82c+=0x1){let _0xf33443=_0x360cc9[_0x48f82c];for(var _0x59aa3e=0x0;_0x59aa3e<_0xf33443[_0xf8e2('0x75')][_0xf8e2('0x43')];_0x59aa3e+=0x1){let _0x118c12=_0xf33443[_0xf8e2('0x75')][_0x59aa3e];var _0x356a4d=_0x172101[_0xf8e2('0x5f')]();_0x356a4d[_0xf8e2('0x49')](_0xf8e2('0x8f'),_0x118c12['id']);_0x5088ed[_0xf8e2('0x90')](db[_0xf8e2('0x91')][_0xf8e2('0x3d')](_0x356a4d[_0xf8e2('0x92')](),{'type':db[_0xf8e2('0x91')]['QueryTypes'][_0xf8e2('0x93')]})[_0xf8e2('0x2d')](function(_0x1778ba){if(_0x1778ba[_0xf8e2('0x43')]===0x1){return _0x118c12['id'];}else{var _0x4208b8=_[_0xf8e2('0x94')](_[_0xf8e2('0x33')](_0x1778ba,_0xf8e2('0x95')),function(_0x5e577d){return _['includes'](_0x5f2159,_0x5e577d);});if(_0x4208b8){return _0x118c12['id'];}}}));}}return BPromise[_0xf8e2('0x96')](_0x5088ed)['then'](function(_0x4ee3c4){_0x3b49d2=_(_0x3b49d2)[_0xf8e2('0x97')](_0x4ee3c4)['compact']()['value']();return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x44ef94[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](function(_0x30ee23){return db[_0xf8e2('0x91')][_0xf8e2('0x7c')](function(_0x594d70){return _0x30ee23['removeTeams'](_0x44ef94['query']['ids'],{'transaction':_0x594d70})[_0xf8e2('0x2d')](function(){if(!_['isEmpty'](_0x3b49d2)){return _0x30ee23[_0xf8e2('0x98')](_0x3b49d2,{'transaction':_0x594d70})[_0xf8e2('0x2d')](function(){return db['UserVoiceQueueRt'][_0xf8e2('0x2e')]({'where':{'VoiceQueueId':_0x44ef94['params']['id'],'UserId':_0x3b49d2},'transaction':_0x594d70});});}})[_0xf8e2('0x2d')](function(){_0x3b49d2[_0xf8e2('0x7a')](function(_0x2b7e55){socket[_0xf8e2('0x86')](_0xf8e2('0x99'),{'UserId':_0x2b7e55,'VoiceQueueId':_0x30ee23['id']});});});});});});})[_0xf8e2('0x2d')](respondWithStatusCode(_0x3f46e3,null))[_0xf8e2('0x4f')](handleError(_0x3f46e3,null));};exports['addAgents']=function(_0x17f1e0,_0x1186df,_0x46240b){var _0x2f2a4a,_0xf3499e;return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x17f1e0[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x1186df,null))['then'](function(_0x4a76f7){if(_0x4a76f7){_0xf3499e=_0x4a76f7;return _0x4a76f7[_0xf8e2('0x9a')](_0x17f1e0['body']['ids'],_[_0xf8e2('0x60')](_0x17f1e0['body'],[_0xf8e2('0x9b'),'id'])||{})[_0xf8e2('0x9c')](function(_0x110140){for(var _0x4b8a65=0x0;_0x4b8a65<_0x17f1e0[_0xf8e2('0x56')][_0xf8e2('0x9b')][_0xf8e2('0x43')];_0x4b8a65+=0x1){socket[_0xf8e2('0x86')](_0xf8e2('0x9d'),{'UserId':Number(_0x17f1e0[_0xf8e2('0x56')]['ids'][_0x4b8a65]),'VoiceQueueId':Number(_0x17f1e0[_0xf8e2('0x51')]['id'])});}return _0x110140;});}})[_0xf8e2('0x2d')](function(_0x10435a){_0x2f2a4a=_0x10435a||[];if(_0xf3499e){return db[_0xf8e2('0x74')][_0xf8e2('0x4d')]({'where':{'id':_0x17f1e0[_0xf8e2('0x56')][_0xf8e2('0x9b')]},'attributes':['id',_0xf8e2('0x37'),_0xf8e2('0x76'),_0xf8e2('0x77'),'interface'],'raw':!![]});}})[_0xf8e2('0x2d')](function(_0x206441){if(!_[_0xf8e2('0x9e')](_0x206441)){var _0x31e900=[];for(var _0x390c41=0x0;_0x390c41<_0x206441['length'];_0x390c41++){if(_0x206441[_0x390c41][_0xf8e2('0x76')]){_0x31e900[_0xf8e2('0x90')](db[_0xf8e2('0x82')][_0xf8e2('0x7f')]({'membername':_0x206441[_0x390c41][_0xf8e2('0x37')],'UserId':_0x206441[_0x390c41]['id'],'queue_name':_0xf3499e[_0xf8e2('0x37')],'VoiceQueueId':_0xf3499e['id'],'interface':_['isNil'](_0x206441[_0x390c41]['interface'])?util['format'](_0xf8e2('0x85'),_0x206441[_0x390c41]['name']):_0x206441[_0x390c41][_0xf8e2('0x78')],'paused':_0x206441[_0x390c41][_0xf8e2('0x77')]||![],'penalty':_0x17f1e0[_0xf8e2('0x56')][_0xf8e2('0x7b')]||0x0}));}}return BPromise['all'](_0x31e900);}})[_0xf8e2('0x2d')](function(){return _0x2f2a4a;})[_0xf8e2('0x2d')](respondWithResult(_0x1186df,null))[_0xf8e2('0x4f')](handleError(_0x1186df,null));};exports[_0xf8e2('0x98')]=function(_0x3bd020,_0x4ece26,_0x15082e){return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x3bd020[_0xf8e2('0x51')]['id']}})['then'](handleEntityNotFound(_0x4ece26,null))[_0xf8e2('0x2d')](function(_0x5826fc){if(_0x5826fc){return _0x5826fc[_0xf8e2('0x98')](_0x3bd020[_0xf8e2('0x3d')][_0xf8e2('0x9b')])[_0xf8e2('0x2d')](function(){if(_[_0xf8e2('0x9f')](_0x3bd020[_0xf8e2('0x3d')]['ids'])){for(var _0x4b0c18=0x0;_0x4b0c18<_0x3bd020[_0xf8e2('0x3d')][_0xf8e2('0x9b')][_0xf8e2('0x43')];_0x4b0c18+=0x1){socket[_0xf8e2('0x86')](_0xf8e2('0x99'),{'UserId':Number(_0x3bd020[_0xf8e2('0x3d')][_0xf8e2('0x9b')][_0x4b0c18]),'VoiceQueueId':Number(_0x3bd020[_0xf8e2('0x51')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x3bd020['query'][_0xf8e2('0x9b')]),'VoiceQueueId':Number(_0x3bd020['params']['id'])});}});}})['then'](function(_0x55861a){return db[_0xf8e2('0x82')][_0xf8e2('0x2e')]({'where':{'VoiceQueueId':_0x3bd020[_0xf8e2('0x51')]['id'],'UserId':_0x3bd020[_0xf8e2('0x3d')][_0xf8e2('0x9b')]}})[_0xf8e2('0x2d')](function(){return _0x55861a;});})[_0xf8e2('0x2d')](respondWithStatusCode(_0x4ece26,null))['catch'](handleError(_0x4ece26,null));};exports[_0xf8e2('0xa0')]=function(_0x155c8b,_0x5c025f,_0x29dee8){var _0x2e898b={};var _0x10295d={};var _0x1c4f76;var _0x59660e;return db[_0xf8e2('0x4b')][_0xf8e2('0x67')]({'where':{'id':_0x155c8b[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x5c025f,null))['then'](function(_0x236d6f){if(_0x236d6f){_0x1c4f76=_0x236d6f;_0x10295d[_0xf8e2('0x40')]=_[_0xf8e2('0x3e')](db['User'][_0xf8e2('0x52')]);_0x10295d[_0xf8e2('0x3d')]=_['keys'](_0x155c8b['query']);_0x10295d[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x10295d['model'],_0x10295d['query']);_0x2e898b[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x10295d['model'],qs['fields'](_0x155c8b[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x2e898b[_0xf8e2('0x41')]=_0x2e898b[_0xf8e2('0x41')]['length']?_0x2e898b['attributes']:_0x10295d[_0xf8e2('0x40')];_0x2e898b[_0xf8e2('0x6a')]=qs['sort'](_0x155c8b[_0xf8e2('0x3d')][_0xf8e2('0x45')]);_0x2e898b[_0xf8e2('0x49')]=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0x155c8b[_0xf8e2('0x3d')],_0x10295d['filters']));if(_0x155c8b[_0xf8e2('0x3d')][_0xf8e2('0x31')]){_0x2e898b[_0xf8e2('0x49')]=_[_0xf8e2('0x48')](_0x2e898b[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x2e898b[_0xf8e2('0x41')],function(_0x47a888){var _0x1f9fd7={};_0x1f9fd7[_0x47a888]={'$like':'%'+_0x155c8b[_0xf8e2('0x3d')]['filter']+'%'};return _0x1f9fd7;})});}_0x2e898b=_[_0xf8e2('0x48')]({},_0x2e898b,_0x155c8b[_0xf8e2('0x54')]);return _0x1c4f76[_0xf8e2('0xa0')](_0x2e898b);}})[_0xf8e2('0x2d')](function(_0x2653b0){if(_0x2653b0){_0x59660e=_0x2653b0[_0xf8e2('0x43')];if(!_0x155c8b[_0xf8e2('0x3d')][_0xf8e2('0x44')]('nolimit')){_0x2e898b[_0xf8e2('0x24')]=qs[_0xf8e2('0x24')](_0x155c8b['query']['limit']);_0x2e898b[_0xf8e2('0x26')]=qs['offset'](_0x155c8b['query'][_0xf8e2('0x26')]);}return _0x1c4f76[_0xf8e2('0xa0')](_0x2e898b);}})[_0xf8e2('0x2d')](function(_0x1b7427){if(_0x1b7427){return _0x1b7427?{'count':_0x59660e,'rows':_0x1b7427}:null;}})[_0xf8e2('0x2d')](respondWithResult(_0x5c025f,null))[_0xf8e2('0x4f')](handleError(_0x5c025f,null));};exports[_0xf8e2('0xa1')]=function(_0x3e07cf,_0x14318b,_0x1a0c53){var _0x44e5a2={};var _0x39f636={};var _0x33a8d0;var _0x523608;return db[_0xf8e2('0x4b')][_0xf8e2('0x67')]({'where':{'id':_0x3e07cf[_0xf8e2('0x51')]['id']}})['then'](handleEntityNotFound(_0x14318b,null))[_0xf8e2('0x2d')](function(_0x21ed1b){if(_0x21ed1b){_0x33a8d0=_0x21ed1b;_0x39f636[_0xf8e2('0x40')]=_['keys'](db[_0xf8e2('0x82')]['rawAttributes']);_0x39f636['query']=_[_0xf8e2('0x3e')](_0x3e07cf['query']);_0x39f636[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x39f636[_0xf8e2('0x40')],_0x39f636[_0xf8e2('0x3d')]);_0x44e5a2[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x39f636['model'],qs['fields'](_0x3e07cf[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x44e5a2[_0xf8e2('0x41')]=_0x44e5a2[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x44e5a2[_0xf8e2('0x41')]:_0x39f636[_0xf8e2('0x40')];_0x44e5a2[_0xf8e2('0x6a')]=qs[_0xf8e2('0x45')](_0x3e07cf[_0xf8e2('0x3d')]['sort']);_0x44e5a2[_0xf8e2('0x49')]=qs['filters'](_[_0xf8e2('0x47')](_0x3e07cf[_0xf8e2('0x3d')],_0x39f636[_0xf8e2('0x46')]));if(_0x3e07cf[_0xf8e2('0x3d')]['filter']){_0x44e5a2[_0xf8e2('0x49')]=_['merge'](_0x44e5a2[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x44e5a2[_0xf8e2('0x41')],function(_0x2245f1){var _0x48483e={};_0x48483e[_0x2245f1]={'$like':'%'+_0x3e07cf['query']['filter']+'%'};return _0x48483e;})});}_0x44e5a2=_[_0xf8e2('0x48')]({},_0x44e5a2,_0x3e07cf['options']);return _0x33a8d0[_0xf8e2('0xa1')](_0x44e5a2);}})[_0xf8e2('0x2d')](function(_0x6241b3){if(_0x6241b3){_0x523608=_0x6241b3[_0xf8e2('0x43')];if(!_0x3e07cf[_0xf8e2('0x3d')][_0xf8e2('0x44')](_0xf8e2('0x69'))){_0x44e5a2['limit']=qs[_0xf8e2('0x24')](_0x3e07cf[_0xf8e2('0x3d')][_0xf8e2('0x24')]);_0x44e5a2[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x3e07cf[_0xf8e2('0x3d')][_0xf8e2('0x26')]);}return _0x33a8d0[_0xf8e2('0xa1')](_0x44e5a2);}})['then'](function(_0x1bf03a){return _0x1bf03a?{'count':_0x523608,'rows':_0x1bf03a}:null;})[_0xf8e2('0x2d')](respondWithResult(_0x14318b,null))[_0xf8e2('0x4f')](handleError(_0x14318b,null));};exports[_0xf8e2('0xa2')]=function(_0x32cf6a,_0x13c61d,_0x5812f5){var _0x1e0d26={};var _0x313d5c={};var _0x1d208d;var _0x240450;return db[_0xf8e2('0x4b')]['findOne']({'where':{'id':_0x32cf6a[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x13c61d,null))[_0xf8e2('0x2d')](function(_0x53c82b){if(_0x53c82b){_0x1d208d=_0x53c82b;_0x313d5c[_0xf8e2('0x40')]=_['keys'](db[_0xf8e2('0xa3')][_0xf8e2('0x52')]);_0x313d5c[_0xf8e2('0x3d')]=_['keys'](_0x32cf6a[_0xf8e2('0x3d')]);_0x313d5c[_0xf8e2('0x46')]=_[_0xf8e2('0x3f')](_0x313d5c[_0xf8e2('0x40')],_0x313d5c[_0xf8e2('0x3d')]);_0x1e0d26[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x313d5c[_0xf8e2('0x40')],qs['fields'](_0x32cf6a[_0xf8e2('0x3d')][_0xf8e2('0x42')]));_0x1e0d26[_0xf8e2('0x41')]=_0x1e0d26['attributes'][_0xf8e2('0x43')]?_0x1e0d26['attributes']:_0x313d5c['model'];_0x1e0d26[_0xf8e2('0x6a')]=qs['sort'](_0x32cf6a[_0xf8e2('0x3d')]['sort']);_0x1e0d26[_0xf8e2('0x49')]=qs[_0xf8e2('0x46')](_[_0xf8e2('0x47')](_0x32cf6a[_0xf8e2('0x3d')],_0x313d5c[_0xf8e2('0x46')]));if(_0x32cf6a['query']['filter']){_0x1e0d26[_0xf8e2('0x49')]=_[_0xf8e2('0x48')](_0x1e0d26[_0xf8e2('0x49')],{'$or':_[_0xf8e2('0x33')](_0x1e0d26['attributes'],function(_0x3e9bef){var _0x54a2f={};_0x54a2f[_0x3e9bef]={'$like':'%'+_0x32cf6a['query'][_0xf8e2('0x31')]+'%'};return _0x54a2f;})});}_0x1e0d26=_[_0xf8e2('0x48')]({},_0x1e0d26,_0x32cf6a[_0xf8e2('0x54')]);return _0x1d208d[_0xf8e2('0xa2')](_0x1e0d26);}})[_0xf8e2('0x2d')](function(_0x34c4f8){if(_0x34c4f8){_0x240450=_0x34c4f8[_0xf8e2('0x43')];if(!_0x32cf6a['query']['hasOwnProperty'](_0xf8e2('0x69'))){_0x1e0d26[_0xf8e2('0x24')]=qs['limit'](_0x32cf6a[_0xf8e2('0x3d')]['limit']);_0x1e0d26[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x32cf6a[_0xf8e2('0x3d')][_0xf8e2('0x26')]);}return _0x1d208d[_0xf8e2('0xa2')](_0x1e0d26);}})[_0xf8e2('0x2d')](function(_0x5ad55a){if(_0x5ad55a){return _0x5ad55a?{'count':_0x240450,'rows':_0x5ad55a}:null;}})[_0xf8e2('0x2d')](respondWithResult(_0x13c61d,null))[_0xf8e2('0x4f')](handleError(_0x13c61d,null));};exports['addLists']=function(_0x4bec77,_0x5a28d7,_0x400a2d){var _0x41f02a,_0x93e83a;return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0x4bec77[_0xf8e2('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a28d7,null))['then'](function(_0x3bf535){if(_0x3bf535){_0x93e83a=_0x3bf535;return _0x3bf535['addLists'](_0x4bec77['body']['ids'],_[_0xf8e2('0x60')](_0x4bec77['body'],[_0xf8e2('0x9b'),'id'])||{});}return null;})[_0xf8e2('0x9c')](function(_0x4179c2){var _0x81ede1;_0x41f02a=_0x4179c2||[];var _0x57bbe7=[];if(_0x4179c2){for(var _0x1c6bb7=0x0;_0x1c6bb7<_0x4179c2['length'];_0x1c6bb7+=0x1){var _0x5e2a8b=_0x4179c2[_0x1c6bb7][_0xf8e2('0x58')]({'plain':!![]});_0x93e83a['dialCheckDuplicateType']=_0x4bec77[_0xf8e2('0x56')][_0xf8e2('0xa4')]?_0x4bec77['body'][_0xf8e2('0xa4')]:_0x93e83a[_0xf8e2('0xa4')];switch(_0x93e83a[_0xf8e2('0xa4')]){case _0xf8e2('0xa5'):_0x81ede1=squel[_0xf8e2('0xa6')]()[_0xf8e2('0xa7')](_0xf8e2('0xa8'))[_0xf8e2('0xa9')]([_0xf8e2('0xaa'),_0xf8e2('0xab'),'ContactId','ListId',_0xf8e2('0x6b'),_0xf8e2('0x61'),_0xf8e2('0x62')],squel[_0xf8e2('0x88')]()[_0xf8e2('0x89')](_0xf8e2('0xaa'),_0xf8e2('0xaa'))['field'](_0xf8e2('0xac'),_0xf8e2('0xab'))['field']('id',_0xf8e2('0xad'))[_0xf8e2('0x89')](_0x5e2a8b[_0xf8e2('0xae')][_0xf8e2('0x92')](),_0xf8e2('0xaf'))[_0xf8e2('0x89')](_0x4bec77[_0xf8e2('0x51')]['id'][_0xf8e2('0x92')](),_0xf8e2('0x6b'))['field'](_0xf8e2('0xac'),_0xf8e2('0x61'))[_0xf8e2('0x89')](_0xf8e2('0xac'),_0xf8e2('0x62'))[_0xf8e2('0x8b')](_0xf8e2('0xb0'))[_0xf8e2('0x49')]('deletedAt\x20IS\x20NULL')[_0xf8e2('0x49')](_0xf8e2('0xb1'),_0x5e2a8b['CmListId'][_0xf8e2('0x92')]())[_0xf8e2('0x49')](_0xf8e2('0xb2'))[_0xf8e2('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf8e2('0x88')]()['field'](_0xf8e2('0xb3'))['from'](_0xf8e2('0xb4'))['where'](_0xf8e2('0xb5'),_0x4bec77[_0xf8e2('0x51')]['id'][_0xf8e2('0x92')]()))[_0xf8e2('0x49')](_0xf8e2('0xb6'),squel[_0xf8e2('0x88')]()[_0xf8e2('0x89')](_0xf8e2('0xb7'))[_0xf8e2('0x8b')](_0xf8e2('0xa8'))[_0xf8e2('0x49')]('VoiceQueueId\x20=\x20?',_0x4bec77[_0xf8e2('0x51')]['id'][_0xf8e2('0x92')]())))[_0xf8e2('0x92')]();break;case'onlyIfOpen':_0x81ede1=squel[_0xf8e2('0xa6')]()[_0xf8e2('0xa7')](_0xf8e2('0xa8'))[_0xf8e2('0xa9')]([_0xf8e2('0xaa'),_0xf8e2('0xab'),_0xf8e2('0xad'),_0xf8e2('0xaf'),_0xf8e2('0x6b'),'createdAt','updatedAt'],squel['select']()[_0xf8e2('0x89')](_0xf8e2('0xaa'),_0xf8e2('0xaa'))['field'](_0xf8e2('0xac'),_0xf8e2('0xab'))[_0xf8e2('0x89')]('id','ContactId')['field'](_0x5e2a8b[_0xf8e2('0xae')][_0xf8e2('0x92')](),_0xf8e2('0xaf'))['field'](_0x4bec77['params']['id'][_0xf8e2('0x92')](),'VoiceQueueId')[_0xf8e2('0x89')](_0xf8e2('0xac'),_0xf8e2('0x61'))[_0xf8e2('0x89')](_0xf8e2('0xac'),_0xf8e2('0x62'))['from'](_0xf8e2('0xb0'))[_0xf8e2('0x49')](_0xf8e2('0xb8'))[_0xf8e2('0x49')](_0xf8e2('0xb1'),_0x5e2a8b['CmListId'][_0xf8e2('0x92')]())['where'](_0xf8e2('0xb2'))[_0xf8e2('0x49')](_0xf8e2('0xb6'),squel[_0xf8e2('0x88')]()[_0xf8e2('0x89')](_0xf8e2('0xb7'))[_0xf8e2('0x8b')](_0xf8e2('0xa8'))[_0xf8e2('0x49')]('VoiceQueueId\x20=\x20?',_0x4bec77['params']['id'][_0xf8e2('0x92')]())))[_0xf8e2('0x92')]();break;default:_0x81ede1=squel[_0xf8e2('0xa6')]()[_0xf8e2('0xa7')](_0xf8e2('0xa8'))['fromQuery'](['phone','scheduledAt',_0xf8e2('0xad'),'ListId',_0xf8e2('0x6b'),_0xf8e2('0x61'),_0xf8e2('0x62')],squel[_0xf8e2('0x88')]()[_0xf8e2('0x89')](_0xf8e2('0xaa'),_0xf8e2('0xaa'))['field']('NOW()',_0xf8e2('0xab'))[_0xf8e2('0x89')]('id',_0xf8e2('0xad'))[_0xf8e2('0x89')](_0x5e2a8b['CmListId'][_0xf8e2('0x92')](),'ListId')[_0xf8e2('0x89')](_0x4bec77[_0xf8e2('0x51')]['id'][_0xf8e2('0x92')](),_0xf8e2('0x6b'))[_0xf8e2('0x89')](_0xf8e2('0xac'),'createdAt')[_0xf8e2('0x89')]('NOW()',_0xf8e2('0x62'))[_0xf8e2('0x8b')](_0xf8e2('0xb0'))[_0xf8e2('0x49')]('deletedAt\x20IS\x20NULL')[_0xf8e2('0x49')](_0xf8e2('0xb1'),_0x5e2a8b[_0xf8e2('0xae')]['toString']())[_0xf8e2('0x49')](_0xf8e2('0xb2')))['toString']();}_0x57bbe7[_0xf8e2('0x90')](db[_0xf8e2('0x91')][_0xf8e2('0x3d')](_0x81ede1));}return BPromise[_0xf8e2('0x96')](_0x57bbe7);}})[_0xf8e2('0x2d')](function(){return _0x41f02a;})['then'](respondWithResult(_0x5a28d7,null))['catch'](handleError(_0x5a28d7,null));};exports[_0xf8e2('0xb9')]=function(_0xc35613,_0x44b3b6,_0x51ae8e){return db[_0xf8e2('0x4b')][_0xf8e2('0x35')]({'where':{'id':_0xc35613[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x44b3b6,null))[_0xf8e2('0x2d')](function(_0x3e3384){if(_0x3e3384){return _0x3e3384[_0xf8e2('0xb9')](_0xc35613[_0xf8e2('0x3d')]['ids']);}})['then'](function(_0x786c41){if(_0x786c41){return db[_0xf8e2('0x68')][_0xf8e2('0x2e')]({'where':{'ListId':_0xc35613[_0xf8e2('0x3d')][_0xf8e2('0x9b')],'VoiceQueueId':_0xc35613[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](function(){return _0x786c41;});}})[_0xf8e2('0x2d')](respondWithStatusCode(_0x44b3b6,null))[_0xf8e2('0x4f')](handleError(_0x44b3b6,null));};exports[_0xf8e2('0xba')]=function(_0x494854,_0x492de8,_0x4364dc){var _0x2aa759={};var _0x2d6b30={};var _0x249758;var _0x3bf873;return db['VoiceQueue'][_0xf8e2('0x67')]({'where':{'id':_0x494854[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x492de8,null))[_0xf8e2('0x2d')](function(_0x20fbfc){if(_0x20fbfc){_0x249758=_0x20fbfc;_0x2d6b30[_0xf8e2('0x40')]=_['keys'](db[_0xf8e2('0xa3')][_0xf8e2('0x52')]);_0x2d6b30['query']=_[_0xf8e2('0x3e')](_0x494854[_0xf8e2('0x3d')]);_0x2d6b30['filters']=_['intersection'](_0x2d6b30[_0xf8e2('0x40')],_0x2d6b30[_0xf8e2('0x3d')]);_0x2aa759[_0xf8e2('0x41')]=_[_0xf8e2('0x3f')](_0x2d6b30[_0xf8e2('0x40')],qs[_0xf8e2('0x42')](_0x494854['query'][_0xf8e2('0x42')]));_0x2aa759[_0xf8e2('0x41')]=_0x2aa759[_0xf8e2('0x41')][_0xf8e2('0x43')]?_0x2aa759[_0xf8e2('0x41')]:_0x2d6b30['model'];_0x2aa759['order']=qs[_0xf8e2('0x45')](_0x494854[_0xf8e2('0x3d')]['sort']);_0x2aa759[_0xf8e2('0x49')]=qs['filters'](_[_0xf8e2('0x47')](_0x494854[_0xf8e2('0x3d')],_0x2d6b30[_0xf8e2('0x46')]));if(_0x494854[_0xf8e2('0x3d')][_0xf8e2('0x31')]){_0x2aa759[_0xf8e2('0x49')]=_[_0xf8e2('0x48')](_0x2aa759['where'],{'$or':_[_0xf8e2('0x33')](_0x2aa759[_0xf8e2('0x41')],function(_0x10efde){var _0x5e2a5c={};_0x5e2a5c[_0x10efde]={'$like':'%'+_0x494854[_0xf8e2('0x3d')][_0xf8e2('0x31')]+'%'};return _0x5e2a5c;})});}_0x2aa759=_[_0xf8e2('0x48')]({},_0x2aa759,_0x494854[_0xf8e2('0x54')]);return _0x249758[_0xf8e2('0xba')](_0x2aa759);}})['then'](function(_0x15ac93){if(_0x15ac93){_0x3bf873=_0x15ac93[_0xf8e2('0x43')];if(!_0x494854['query'][_0xf8e2('0x44')]('nolimit')){_0x2aa759[_0xf8e2('0x24')]=qs[_0xf8e2('0x24')](_0x494854['query'][_0xf8e2('0x24')]);_0x2aa759[_0xf8e2('0x26')]=qs[_0xf8e2('0x26')](_0x494854[_0xf8e2('0x3d')][_0xf8e2('0x26')]);}return _0x249758[_0xf8e2('0xba')](_0x2aa759);}})[_0xf8e2('0x2d')](function(_0x2b5c0c){if(_0x2b5c0c){return _0x2b5c0c?{'count':_0x3bf873,'rows':_0x2b5c0c}:null;}})['then'](respondWithResult(_0x492de8,null))['catch'](handleError(_0x492de8,null));};exports[_0xf8e2('0xbb')]=function(_0x11afa2,_0x113bcd,_0x38314b){var _0x30860f,_0x29e9ec;return db[_0xf8e2('0x4b')]['find']({'where':{'id':_0x11afa2['params']['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x113bcd,null))[_0xf8e2('0x2d')](function(_0xf8b941){if(_0xf8b941){_0x29e9ec=_0xf8b941;return _0xf8b941[_0xf8e2('0xbb')](_0x11afa2[_0xf8e2('0x56')]['ids'],_[_0xf8e2('0x60')](_0x11afa2[_0xf8e2('0x56')],['ids','id'])||{});}return null;})[_0xf8e2('0x9c')](function(_0xe5df81){var _0x315af0;_0x30860f=_0xe5df81||[];var _0x2ba804=[];if(_0xe5df81){for(var _0x437683=0x0;_0x437683<_0xe5df81[_0xf8e2('0x43')];_0x437683+=0x1){var _0x26a4e9=_0xe5df81[_0x437683]['get']({'plain':!![]});_0x315af0=squel[_0xf8e2('0xa6')]()[_0xf8e2('0xa7')](_0xf8e2('0xbc'))[_0xf8e2('0xa9')](['phone',_0xf8e2('0xad'),'ListId',_0xf8e2('0x6b'),_0xf8e2('0x61'),_0xf8e2('0x62')],squel['select']()[_0xf8e2('0x89')]('phone','phone')[_0xf8e2('0x89')]('id',_0xf8e2('0xad'))[_0xf8e2('0x89')](_0x26a4e9[_0xf8e2('0xae')][_0xf8e2('0x92')](),_0xf8e2('0xaf'))[_0xf8e2('0x89')](_0x11afa2[_0xf8e2('0x51')]['id']['toString'](),_0xf8e2('0x6b'))[_0xf8e2('0x89')]('NOW()',_0xf8e2('0x61'))[_0xf8e2('0x89')](_0xf8e2('0xac'),'updatedAt')['from'](_0xf8e2('0xb0'))[_0xf8e2('0x49')](_0xf8e2('0xb8'))['where'](_0xf8e2('0xb1'),_0x26a4e9['CmListId'][_0xf8e2('0x92')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf8e2('0x92')]();_0x2ba804[_0xf8e2('0x90')](db[_0xf8e2('0x91')][_0xf8e2('0x3d')](_0x315af0));}return BPromise[_0xf8e2('0x96')](_0x2ba804);}})[_0xf8e2('0x2d')](function(){return _0x30860f;})[_0xf8e2('0x2d')](respondWithResult(_0x113bcd,null))[_0xf8e2('0x4f')](handleError(_0x113bcd,null));};exports['removeBlackLists']=function(_0x3d9ec4,_0x29e65e,_0x3b6bba){return db[_0xf8e2('0x4b')]['find']({'where':{'id':_0x3d9ec4[_0xf8e2('0x51')]['id']}})[_0xf8e2('0x2d')](handleEntityNotFound(_0x29e65e,null))[_0xf8e2('0x2d')](function(_0x8efc1c){if(_0x8efc1c){return _0x8efc1c[_0xf8e2('0xbd')](_0x3d9ec4['query'][_0xf8e2('0x9b')]);}})['then'](function(_0x173760){if(_0x173760){return db[_0xf8e2('0x6f')]['destroy']({'where':{'ListId':_0x3d9ec4[_0xf8e2('0x3d')][_0xf8e2('0x9b')],'VoiceQueueId':_0x3d9ec4['params']['id']}})['then'](function(){return _0x173760;});}})['then'](respondWithStatusCode(_0x29e65e,null))[_0xf8e2('0x4f')](handleError(_0x29e65e,null));}; \ No newline at end of file +var _0x0d7e=['select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','ids','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','updatedAt','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','ListId','phone\x20IS\x20NOT\x20NULL','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','status','end','limit','undefined','count','set','Content-Range','json','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','options','includeAll','findAll','catch','include','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','omit','createdAt','destroy','params','getHoppers','CmHopper','pick','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','VoiceQueueId','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams'];(function(_0x2a5740,_0x559005){var _0x411239=function(_0x3f2ff9){while(--_0x3f2ff9){_0x2a5740['push'](_0x2a5740['shift']());}};_0x411239(++_0x559005);}(_0x0d7e,0x1ab));var _0xe0d7=function(_0x366d3e,_0x3ec550){_0x366d3e=_0x366d3e-0x0;var _0x1671db=_0x0d7e[_0x366d3e];return _0x1671db;};'use strict';var emlformat=require(_0xe0d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0d7('0x1'));var jsonpatch=require(_0xe0d7('0x2'));var rp=require(_0xe0d7('0x3'));var moment=require(_0xe0d7('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe0d7('0x5'));var path=require(_0xe0d7('0x6'));var sox=require(_0xe0d7('0x7'));var csv=require('to-csv');var ejs=require(_0xe0d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe0d7('0x9'));var jsforce=require(_0xe0d7('0xa'));var deskjs=require(_0xe0d7('0xb'));var toCsv=require(_0xe0d7('0xc'));var querystring=require(_0xe0d7('0xd'));var Papa=require(_0xe0d7('0xe'));var Redis=require(_0xe0d7('0xf'));var authService=require(_0xe0d7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe0d7('0x11'));var hardwareService=require(_0xe0d7('0x12'));var logger=require(_0xe0d7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe0d7('0x14'));var licenseUtil=require(_0xe0d7('0x15'));var db=require(_0xe0d7('0x16'))['db'];config['redis']=_[_0xe0d7('0x17')](config[_0xe0d7('0x18')],{'host':_0xe0d7('0x19'),'port':0x18eb});var socket=require(_0xe0d7('0x1a'))(new Redis(config['redis']));require(_0xe0d7('0x1b'))['register'](socket);function respondWithStatusCode(_0x5ed5e9,_0x1b60d7){_0x1b60d7=_0x1b60d7||0xcc;return function(_0x25ccc6){if(_0x25ccc6){return _0x5ed5e9['sendStatus'](_0x1b60d7);}return _0x5ed5e9[_0xe0d7('0x1c')](_0x1b60d7)[_0xe0d7('0x1d')]();};}function respondWithResult(_0x13edd4,_0x584855){_0x584855=_0x584855||0xc8;return function(_0x19f96d){if(_0x19f96d){return _0x13edd4[_0xe0d7('0x1c')](_0x584855)['json'](_0x19f96d);}};}function respondWithFilteredResult(_0x4c323d,_0x10b596){return function(_0x46877e){if(_0x46877e){var _0x1c972a=typeof _0x10b596['offset']==='undefined'&&typeof _0x10b596[_0xe0d7('0x1e')]===_0xe0d7('0x1f');var _0x2d5f98=_0x46877e[_0xe0d7('0x20')];var _0x4a51f7=_0x1c972a?0x0:_0x10b596['offset'];var _0x2411b8=_0x1c972a?_0x46877e['count']:_0x10b596['offset']+_0x10b596[_0xe0d7('0x1e')];var _0x4e212b;if(_0x2411b8>=_0x2d5f98){_0x2411b8=_0x2d5f98;_0x4e212b=0xc8;}else{_0x4e212b=0xce;}_0x4c323d['status'](_0x4e212b);return _0x4c323d[_0xe0d7('0x21')](_0xe0d7('0x22'),_0x4a51f7+'-'+_0x2411b8+'/'+_0x2d5f98)[_0xe0d7('0x23')](_0x46877e);}return null;};}function patchUpdates(_0x538333){return function(_0x2b5997){try{jsonpatch['apply'](_0x2b5997,_0x538333,!![]);}catch(_0x590d60){return BPromise[_0xe0d7('0x24')](_0x590d60);}return _0x2b5997[_0xe0d7('0x25')]();};}function saveUpdates(_0x2fc161,_0x47f457){return function(_0x5e44bf){if(_0x5e44bf){return _0x5e44bf[_0xe0d7('0x26')](_0x2fc161)[_0xe0d7('0x27')](function(_0x1cdddc){return _0x1cdddc;});}return null;};}function removeEntity(_0x19fe56,_0x350fdd){return function(_0x11ca82){if(_0x11ca82){return _0x11ca82['destroy']()['then'](function(){var _0x1d7997=_0x11ca82[_0xe0d7('0x28')]({'plain':!![]});var _0x56e299=[{'name':_0xe0d7('0x29'),'value':_0xe0d7('0x2a'),'ignore':![]},{'name':_0xe0d7('0x2b'),'value':_0xe0d7('0x2c'),'ignore':![]}];var _0x37ef05=_(_0x56e299)[_0xe0d7('0x2d')](_0xe0d7('0x2e'))[_0xe0d7('0x2f')]('value')[_0xe0d7('0x30')]();if(_[_0xe0d7('0x31')](_0x37ef05,_0x1d7997[_0xe0d7('0x32')])){return;}var _0x1f2d35=_[_0xe0d7('0x33')](_0x56e299,[_0xe0d7('0x30'),_0x1d7997[_0xe0d7('0x32')]])['name'];return db[_0xe0d7('0x34')]['destroy']({'where':{'type':_0x1f2d35,'resourceId':_0x1d7997['id']}})['then'](function(){return _0x11ca82;});})[_0xe0d7('0x27')](function(){_0x19fe56['status'](0xcc)[_0xe0d7('0x1d')]();});}};}function handleEntityNotFound(_0x2d6dac,_0x10e9b1){return function(_0x5566f2){if(!_0x5566f2){_0x2d6dac['sendStatus'](0x194);}return _0x5566f2;};}function handleError(_0x27baef,_0x166558){_0x166558=_0x166558||0x1f4;return function(_0x114423){logger[_0xe0d7('0x35')](_0x114423[_0xe0d7('0x36')]);if(_0x114423['name']){delete _0x114423['name'];}_0x27baef[_0xe0d7('0x1c')](_0x166558)[_0xe0d7('0x37')](_0x114423);};}exports[_0xe0d7('0x38')]=function(_0x265198,_0x273785){var _0x28812e={},_0x42d98d={},_0xf742d2={'count':0x0,'rows':[]};var _0x1695a8=_[_0xe0d7('0x2f')](db[_0xe0d7('0x39')][_0xe0d7('0x3a')],function(_0x10c657){return{'name':_0x10c657[_0xe0d7('0x3b')],'type':_0x10c657[_0xe0d7('0x32')][_0xe0d7('0x3c')]};});_0x42d98d['model']=_[_0xe0d7('0x2f')](_0x1695a8,_0xe0d7('0x3d'));_0x42d98d['query']=_[_0xe0d7('0x3e')](_0x265198[_0xe0d7('0x3f')]);_0x42d98d[_0xe0d7('0x40')]=_[_0xe0d7('0x41')](_0x42d98d[_0xe0d7('0x42')],_0x42d98d[_0xe0d7('0x3f')]);_0x28812e[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x42d98d['model'],qs['fields'](_0x265198['query'][_0xe0d7('0x44')]));_0x28812e[_0xe0d7('0x43')]=_0x28812e[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x28812e[_0xe0d7('0x43')]:_0x42d98d[_0xe0d7('0x42')];if(!_0x265198[_0xe0d7('0x3f')][_0xe0d7('0x46')](_0xe0d7('0x47'))){_0x28812e[_0xe0d7('0x1e')]=qs[_0xe0d7('0x1e')](_0x265198['query'][_0xe0d7('0x1e')]);_0x28812e[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x265198[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}_0x28812e[_0xe0d7('0x49')]=qs['sort'](_0x265198['query'][_0xe0d7('0x4a')]);_0x28812e[_0xe0d7('0x4b')]=qs[_0xe0d7('0x40')](_['pick'](_0x265198[_0xe0d7('0x3f')],_0x42d98d['filters']),_0x1695a8);if(_0x265198[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x28812e[_0xe0d7('0x4b')]=_[_0xe0d7('0x4c')](_0x28812e[_0xe0d7('0x4b')],{'$or':_[_0xe0d7('0x2f')](_0x1695a8,function(_0x55fa8d){if(_0x55fa8d[_0xe0d7('0x32')]!=='VIRTUAL'){var _0x319299={};_0x319299[_0x55fa8d['name']]={'$like':'%'+_0x265198['query'][_0xe0d7('0x2d')]+'%'};return _0x319299;}})});}_0x28812e=_[_0xe0d7('0x4c')]({},_0x28812e,_0x265198[_0xe0d7('0x4d')]);var _0x326414={'where':_0x28812e['where']};return db[_0xe0d7('0x39')]['count'](_0x326414)[_0xe0d7('0x27')](function(_0x5f22cf){_0xf742d2[_0xe0d7('0x20')]=_0x5f22cf;if(_0x265198[_0xe0d7('0x3f')][_0xe0d7('0x4e')]){_0x28812e['include']=[{'all':!![]}];}return db[_0xe0d7('0x39')][_0xe0d7('0x4f')](_0x28812e);})[_0xe0d7('0x27')](function(_0x481755){_0xf742d2['rows']=_0x481755;return _0xf742d2;})[_0xe0d7('0x27')](respondWithFilteredResult(_0x273785,_0x28812e))[_0xe0d7('0x50')](handleError(_0x273785,null));};exports['show']=function(_0x171665,_0x3535e3){var _0x3a81b2={'raw':![],'where':{'id':_0x171665['params']['id']}},_0xa1d2bd={};_0xa1d2bd[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x39')][_0xe0d7('0x3a')]);_0xa1d2bd['query']=_[_0xe0d7('0x3e')](_0x171665[_0xe0d7('0x3f')]);_0xa1d2bd[_0xe0d7('0x40')]=_[_0xe0d7('0x41')](_0xa1d2bd[_0xe0d7('0x42')],_0xa1d2bd[_0xe0d7('0x3f')]);_0x3a81b2[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0xa1d2bd[_0xe0d7('0x42')],qs[_0xe0d7('0x44')](_0x171665[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x3a81b2[_0xe0d7('0x43')]=_0x3a81b2[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x3a81b2[_0xe0d7('0x43')]:_0xa1d2bd[_0xe0d7('0x42')];if(_0x171665[_0xe0d7('0x3f')][_0xe0d7('0x4e')]){_0x3a81b2[_0xe0d7('0x51')]=[{'all':!![]}];}_0x3a81b2=_[_0xe0d7('0x4c')]({},_0x3a81b2,_0x171665[_0xe0d7('0x4d')]);return db[_0xe0d7('0x39')][_0xe0d7('0x33')](_0x3a81b2)[_0xe0d7('0x27')](handleEntityNotFound(_0x3535e3,null))[_0xe0d7('0x27')](respondWithResult(_0x3535e3,null))[_0xe0d7('0x50')](handleError(_0x3535e3,null));};exports[_0xe0d7('0x52')]=function(_0x1b16f0,_0xb44451){return db['VoiceQueue']['create'](_0x1b16f0[_0xe0d7('0x53')],{})[_0xe0d7('0x27')](function(_0x589e25){var _0x36bcb5=_0x1b16f0[_0xe0d7('0x54')][_0xe0d7('0x28')]({'plain':!![]});if(!_0x36bcb5)throw new Error(_0xe0d7('0x55'));if(_0x36bcb5[_0xe0d7('0x56')]===_0xe0d7('0x54')){var _0x31d626=_0x589e25[_0xe0d7('0x28')]({'plain':!![]});var _0x3249bd=[{'name':_0xe0d7('0x29'),'value':_0xe0d7('0x2a')},{'name':_0xe0d7('0x2b'),'value':'outbound'}];var _0x5a1c66=_[_0xe0d7('0x33')](_0x3249bd,['value',_0x31d626['type']])[_0xe0d7('0x3d')];return db[_0xe0d7('0x57')][_0xe0d7('0x33')]({'where':{'name':_0x5a1c66,'userProfileId':_0x36bcb5[_0xe0d7('0x58')]},'raw':!![]})[_0xe0d7('0x27')](function(_0x261eac){if(_0x261eac&&_0x261eac[_0xe0d7('0x59')]===0x0){return db[_0xe0d7('0x34')][_0xe0d7('0x52')]({'name':_0x31d626['name'],'resourceId':_0x31d626['id'],'type':_0x261eac['name'],'sectionId':_0x261eac['id']},{})[_0xe0d7('0x27')](function(){return _0x589e25;});}else{return _0x589e25;}})[_0xe0d7('0x50')](function(_0x46108b){logger[_0xe0d7('0x35')](_0xe0d7('0x5a'),_0x46108b);throw _0x46108b;});}return _0x589e25;})[_0xe0d7('0x27')](respondWithResult(_0xb44451,0xc9))[_0xe0d7('0x50')](handleError(_0xb44451,null));};exports[_0xe0d7('0x5b')]=function(_0x36c6ff,_0x3f9421){var _0x52c5e4={'where':{'id':_0x36c6ff['params']['id']}},_0x3615a8={};_0x3615a8['model']=_[_0xe0d7('0x3e')](db[_0xe0d7('0x39')][_0xe0d7('0x3a')]);_0x52c5e4[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x3615a8[_0xe0d7('0x42')],qs['fields'](_0x36c6ff[_0xe0d7('0x3f')]['fields']));_0x52c5e4[_0xe0d7('0x43')]=_0x52c5e4['attributes'][_0xe0d7('0x45')]?_0x52c5e4[_0xe0d7('0x43')]:_0x3615a8[_0xe0d7('0x42')];if(_0x36c6ff[_0xe0d7('0x3f')][_0xe0d7('0x4e')]){_0x52c5e4[_0xe0d7('0x51')]=[{'all':!![]}];}_0x52c5e4=_[_0xe0d7('0x4c')]({},_0x52c5e4,_0x36c6ff[_0xe0d7('0x4d')]);return db[_0xe0d7('0x39')][_0xe0d7('0x33')](_0x52c5e4)[_0xe0d7('0x27')](handleEntityNotFound(_0x3f9421,null))['then'](function(_0x54b6e3){if(_0x54b6e3){var _0x4b0e96=_0x54b6e3[_0xe0d7('0x28')]({'plain':!![]});_0x4b0e96=qs[_0xe0d7('0x5c')](_0x4b0e96,['id',_0xe0d7('0x5d'),'updatedAt']);_0x36c6ff['body']=_[_0xe0d7('0x5c')](_0x36c6ff[_0xe0d7('0x53')],['id',_0xe0d7('0x5d'),'updatedAt']);return db[_0xe0d7('0x39')][_0xe0d7('0x52')](_['merge'](_0x4b0e96,_0x36c6ff[_0xe0d7('0x53')]),{'include':_0x36c6ff[_0xe0d7('0x3f')]['includeAll']?[{'all':!![]}]:undefined})[_0xe0d7('0x27')](function(_0xf4e636){var _0x293e2b=_0x36c6ff[_0xe0d7('0x54')][_0xe0d7('0x28')]({'plain':!![]});if(!_0x293e2b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293e2b[_0xe0d7('0x56')]==='user'){var _0x14cd46=_0xf4e636[_0xe0d7('0x28')]({'plain':!![]});var _0xab7a9a=[{'name':'VoiceQueues','value':_0xe0d7('0x2a')},{'name':_0xe0d7('0x2b'),'value':'outbound'}];var _0x3ed6b5=_[_0xe0d7('0x33')](_0xab7a9a,[_0xe0d7('0x30'),_0x14cd46[_0xe0d7('0x32')]])[_0xe0d7('0x3d')];return db[_0xe0d7('0x57')][_0xe0d7('0x33')]({'where':{'name':_0x3ed6b5,'userProfileId':_0x293e2b['userProfileId']},'raw':!![]})['then'](function(_0xc4e95d){if(_0xc4e95d&&_0xc4e95d[_0xe0d7('0x59')]===0x0){return db[_0xe0d7('0x34')][_0xe0d7('0x52')]({'name':_0x14cd46[_0xe0d7('0x3d')],'resourceId':_0x14cd46['id'],'type':_0xc4e95d['name'],'sectionId':_0xc4e95d['id']},{})['then'](function(){return _0xf4e636;});}else{return _0xf4e636;}})['catch'](function(_0x114541){logger[_0xe0d7('0x35')](_0xe0d7('0x5a'),_0x114541);throw _0x114541;});}return _0xf4e636;});}})['then'](respondWithResult(_0x3f9421,0xc9))[_0xe0d7('0x50')](handleError(_0x3f9421,null));};exports['update']=function(_0x61f22d,_0x3c6f3e){if(_0x61f22d['body']['id']){delete _0x61f22d['body']['id'];}return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0x61f22d['params']['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x3c6f3e,null))[_0xe0d7('0x27')](saveUpdates(_0x61f22d[_0xe0d7('0x53')],null))[_0xe0d7('0x27')](respondWithResult(_0x3c6f3e,null))[_0xe0d7('0x50')](handleError(_0x3c6f3e,null));};exports[_0xe0d7('0x5e')]=function(_0x355ed1,_0x3b98ef){return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0x355ed1[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x3b98ef,null))['then'](removeEntity(_0x3b98ef,null))[_0xe0d7('0x50')](handleError(_0x3b98ef,null));};exports[_0xe0d7('0x60')]=function(_0x21c36c,_0x35149b,_0x678cc8){var _0x530f37={'raw':![],'where':{}};var _0x1d110f={};var _0xf7ab95={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x21c36c[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x35149b,null))[_0xe0d7('0x27')](function(_0x44e07e){if(_0x44e07e){_0x1d110f[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x61')]['rawAttributes']);_0x1d110f[_0xe0d7('0x3f')]=_['keys'](_0x21c36c[_0xe0d7('0x3f')]);_0x1d110f['filters']=_['intersection'](_0x1d110f[_0xe0d7('0x42')],_0x1d110f[_0xe0d7('0x3f')]);_0x530f37[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x1d110f[_0xe0d7('0x42')],qs[_0xe0d7('0x44')](_0x21c36c[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x530f37['attributes']=_0x530f37['attributes'][_0xe0d7('0x45')]?_0x530f37[_0xe0d7('0x43')]:_0x1d110f[_0xe0d7('0x42')];if(!_0x21c36c[_0xe0d7('0x3f')][_0xe0d7('0x46')](_0xe0d7('0x47'))){_0x530f37[_0xe0d7('0x1e')]=qs[_0xe0d7('0x1e')](_0x21c36c['query']['limit']);_0x530f37['offset']=qs['offset'](_0x21c36c[_0xe0d7('0x3f')]['offset']);}_0x530f37[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x21c36c['query']['sort']);_0x530f37[_0xe0d7('0x4b')]=qs[_0xe0d7('0x40')](_[_0xe0d7('0x62')](_0x21c36c[_0xe0d7('0x3f')],_0x1d110f['filters']));_0x530f37[_0xe0d7('0x4b')]['VoiceQueueId']=_0x44e07e['id'];if(_0x21c36c[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x530f37['where']=_[_0xe0d7('0x4c')](_0x530f37[_0xe0d7('0x4b')],{'$or':_[_0xe0d7('0x2f')](_0x530f37[_0xe0d7('0x43')],function(_0x25792c){var _0x420801={};_0x420801[_0x25792c]={'$like':'%'+_0x21c36c[_0xe0d7('0x3f')]['filter']+'%'};return _0x420801;})});}_0x530f37=_['merge']({},_0x530f37,_0x21c36c[_0xe0d7('0x4d')]);return db[_0xe0d7('0x61')][_0xe0d7('0x20')]({'where':_0x530f37['where']})['then'](function(_0x3c29ae){_0xf7ab95[_0xe0d7('0x20')]=_0x3c29ae;if(_0x21c36c['query'][_0xe0d7('0x4e')]){_0x530f37[_0xe0d7('0x51')]=[{'all':!![]}];}return db[_0xe0d7('0x61')]['findAll'](_0x530f37);})[_0xe0d7('0x27')](function(_0x298879){_0xf7ab95[_0xe0d7('0x63')]=_0x298879;return _0xf7ab95;});}})[_0xe0d7('0x27')](respondWithFilteredResult(_0x35149b,_0x530f37))['catch'](handleError(_0x35149b,null));};exports[_0xe0d7('0x64')]=function(_0x5eeefb,_0x41d288,_0x36be68){var _0x9d9b2={'raw':!![],'where':{}};var _0x58651d={};var _0x62da08={'count':0x0,'rows':[]};return db[_0xe0d7('0x39')][_0xe0d7('0x65')]({'where':{'id':_0x5eeefb[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x41d288,null))[_0xe0d7('0x27')](function(_0x3dd680){if(_0x3dd680){_0x58651d['model']=_[_0xe0d7('0x3e')](db['CmHopperHistory']['rawAttributes']);_0x58651d['query']=_['keys'](_0x5eeefb[_0xe0d7('0x3f')]);_0x58651d['filters']=_[_0xe0d7('0x41')](_0x58651d[_0xe0d7('0x42')],_0x58651d[_0xe0d7('0x3f')]);_0x9d9b2[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x58651d[_0xe0d7('0x42')],qs[_0xe0d7('0x44')](_0x5eeefb['query'][_0xe0d7('0x44')]));_0x9d9b2[_0xe0d7('0x43')]=_0x9d9b2[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x9d9b2['attributes']:_0x58651d[_0xe0d7('0x42')];if(!_0x5eeefb[_0xe0d7('0x3f')][_0xe0d7('0x46')](_0xe0d7('0x47'))){_0x9d9b2[_0xe0d7('0x1e')]=qs[_0xe0d7('0x1e')](_0x5eeefb[_0xe0d7('0x3f')][_0xe0d7('0x1e')]);_0x9d9b2['offset']=qs['offset'](_0x5eeefb[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}_0x9d9b2[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x5eeefb[_0xe0d7('0x3f')]['sort']);_0x9d9b2[_0xe0d7('0x4b')]=qs['filters'](_[_0xe0d7('0x62')](_0x5eeefb[_0xe0d7('0x3f')],_0x58651d[_0xe0d7('0x40')]));_0x9d9b2['where']['VoiceQueueId']=_0x3dd680['id'];if(_0x5eeefb[_0xe0d7('0x3f')]['filter']){_0x9d9b2['where']=_[_0xe0d7('0x4c')](_0x9d9b2[_0xe0d7('0x4b')],{'$or':_[_0xe0d7('0x2f')](_0x9d9b2[_0xe0d7('0x43')],function(_0x34d8cd){var _0x1f41c0={};_0x1f41c0[_0x34d8cd]={'$like':'%'+_0x5eeefb[_0xe0d7('0x3f')][_0xe0d7('0x2d')]+'%'};return _0x1f41c0;})});}_0x9d9b2=_[_0xe0d7('0x4c')]({},_0x9d9b2,_0x5eeefb[_0xe0d7('0x4d')]);return db[_0xe0d7('0x66')][_0xe0d7('0x20')]({'where':_0x9d9b2[_0xe0d7('0x4b')]})[_0xe0d7('0x27')](function(_0x3aa19f){_0x62da08[_0xe0d7('0x20')]=_0x3aa19f;if(_0x5eeefb[_0xe0d7('0x3f')][_0xe0d7('0x4e')]){_0x9d9b2[_0xe0d7('0x51')]=[{'all':!![]}];}return db[_0xe0d7('0x66')][_0xe0d7('0x4f')](_0x9d9b2);})[_0xe0d7('0x27')](function(_0xeb9bfd){_0x62da08[_0xe0d7('0x63')]=_0xeb9bfd;return _0x62da08;});}})['then'](respondWithFilteredResult(_0x41d288,_0x9d9b2))[_0xe0d7('0x50')](handleError(_0x41d288,null));};exports[_0xe0d7('0x67')]=function(_0x5bd6ae,_0x3e9d2d,_0x32781a){var _0x1a05b4={'raw':!![],'where':{}};var _0x39b616={};var _0x4923c9={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5bd6ae[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x3e9d2d,null))[_0xe0d7('0x27')](function(_0x588d7d){if(_0x588d7d){_0x39b616[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x68')][_0xe0d7('0x3a')]);_0x39b616['query']=_['keys'](_0x5bd6ae['query']);_0x39b616[_0xe0d7('0x40')]=_['intersection'](_0x39b616[_0xe0d7('0x42')],_0x39b616[_0xe0d7('0x3f')]);_0x1a05b4[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x39b616[_0xe0d7('0x42')],qs[_0xe0d7('0x44')](_0x5bd6ae[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x1a05b4[_0xe0d7('0x43')]=_0x1a05b4[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x1a05b4[_0xe0d7('0x43')]:_0x39b616[_0xe0d7('0x42')];if(!_0x5bd6ae['query'][_0xe0d7('0x46')](_0xe0d7('0x47'))){_0x1a05b4[_0xe0d7('0x1e')]=qs['limit'](_0x5bd6ae[_0xe0d7('0x3f')]['limit']);_0x1a05b4[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x5bd6ae[_0xe0d7('0x3f')]['offset']);}_0x1a05b4['order']=qs[_0xe0d7('0x4a')](_0x5bd6ae[_0xe0d7('0x3f')][_0xe0d7('0x4a')]);_0x1a05b4[_0xe0d7('0x4b')]=qs[_0xe0d7('0x40')](_[_0xe0d7('0x62')](_0x5bd6ae['query'],_0x39b616[_0xe0d7('0x40')]));_0x1a05b4[_0xe0d7('0x4b')][_0xe0d7('0x69')]=_0x588d7d['id'];if(_0x5bd6ae['query']['filter']){_0x1a05b4['where']=_[_0xe0d7('0x4c')](_0x1a05b4['where'],{'$or':_[_0xe0d7('0x2f')](_0x1a05b4[_0xe0d7('0x43')],function(_0xff7a15){var _0x444af2={};_0x444af2[_0xff7a15]={'$like':'%'+_0x5bd6ae[_0xe0d7('0x3f')]['filter']+'%'};return _0x444af2;})});}_0x1a05b4=_[_0xe0d7('0x4c')]({},_0x1a05b4,_0x5bd6ae[_0xe0d7('0x4d')]);return db[_0xe0d7('0x68')][_0xe0d7('0x20')]({'where':_0x1a05b4['where']})['then'](function(_0x15d2f5){_0x4923c9[_0xe0d7('0x20')]=_0x15d2f5;if(_0x5bd6ae['query']['includeAll']){_0x1a05b4['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xe0d7('0x4f')](_0x1a05b4);})[_0xe0d7('0x27')](function(_0x322834){_0x4923c9[_0xe0d7('0x63')]=_0x322834;return _0x4923c9;});}})[_0xe0d7('0x27')](respondWithFilteredResult(_0x3e9d2d,_0x1a05b4))[_0xe0d7('0x50')](handleError(_0x3e9d2d,null));};exports['getHopperBlacks']=function(_0x5783cd,_0x1e0d77,_0x3444ed){var _0x15c7ef={'raw':!![],'where':{}};var _0x296eb1={};var _0x2988f4={'count':0x0,'rows':[]};return db[_0xe0d7('0x39')][_0xe0d7('0x65')]({'where':{'id':_0x5783cd['params']['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x1e0d77,null))[_0xe0d7('0x27')](function(_0xab32b4){if(_0xab32b4){_0x296eb1[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db['CmHopperBlack'][_0xe0d7('0x3a')]);_0x296eb1[_0xe0d7('0x3f')]=_[_0xe0d7('0x3e')](_0x5783cd['query']);_0x296eb1['filters']=_[_0xe0d7('0x41')](_0x296eb1[_0xe0d7('0x42')],_0x296eb1[_0xe0d7('0x3f')]);_0x15c7ef[_0xe0d7('0x43')]=_['intersection'](_0x296eb1['model'],qs[_0xe0d7('0x44')](_0x5783cd[_0xe0d7('0x3f')]['fields']));_0x15c7ef[_0xe0d7('0x43')]=_0x15c7ef[_0xe0d7('0x43')]['length']?_0x15c7ef[_0xe0d7('0x43')]:_0x296eb1[_0xe0d7('0x42')];if(!_0x5783cd['query']['hasOwnProperty'](_0xe0d7('0x47'))){_0x15c7ef['limit']=qs['limit'](_0x5783cd[_0xe0d7('0x3f')][_0xe0d7('0x1e')]);_0x15c7ef['offset']=qs[_0xe0d7('0x48')](_0x5783cd[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}_0x15c7ef[_0xe0d7('0x49')]=qs['sort'](_0x5783cd[_0xe0d7('0x3f')]['sort']);_0x15c7ef[_0xe0d7('0x4b')]=qs[_0xe0d7('0x40')](_[_0xe0d7('0x62')](_0x5783cd[_0xe0d7('0x3f')],_0x296eb1[_0xe0d7('0x40')]));_0x15c7ef[_0xe0d7('0x4b')][_0xe0d7('0x69')]=_0xab32b4['id'];if(_0x5783cd[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x15c7ef[_0xe0d7('0x4b')]=_[_0xe0d7('0x4c')](_0x15c7ef[_0xe0d7('0x4b')],{'$or':_[_0xe0d7('0x2f')](_0x15c7ef['attributes'],function(_0x1f21a6){var _0x298fd7={};_0x298fd7[_0x1f21a6]={'$like':'%'+_0x5783cd[_0xe0d7('0x3f')][_0xe0d7('0x2d')]+'%'};return _0x298fd7;})});}_0x15c7ef=_['merge']({},_0x15c7ef,_0x5783cd[_0xe0d7('0x4d')]);return db['CmHopperBlack'][_0xe0d7('0x20')]({'where':_0x15c7ef['where']})[_0xe0d7('0x27')](function(_0x312e50){_0x2988f4[_0xe0d7('0x20')]=_0x312e50;if(_0x5783cd['query']['includeAll']){_0x15c7ef[_0xe0d7('0x51')]=[{'all':!![]}];}return db[_0xe0d7('0x6a')]['findAll'](_0x15c7ef);})[_0xe0d7('0x27')](function(_0x4b39e5){_0x2988f4[_0xe0d7('0x63')]=_0x4b39e5;return _0x2988f4;});}})[_0xe0d7('0x27')](respondWithFilteredResult(_0x1e0d77,_0x15c7ef))[_0xe0d7('0x50')](handleError(_0x1e0d77,null));};exports[_0xe0d7('0x6b')]=function(_0x22de18,_0x541aef,_0x2ff1d4){var _0x3110f5={};var _0x547d47={};var _0x5c04a9;var _0x590c9b;return db[_0xe0d7('0x39')][_0xe0d7('0x65')]({'where':{'id':_0x22de18[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x541aef,null))['then'](function(_0x5a46eb){if(_0x5a46eb){_0x5c04a9=_0x5a46eb;_0x547d47[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x6c')][_0xe0d7('0x3a')]);_0x547d47[_0xe0d7('0x3f')]=_[_0xe0d7('0x3e')](_0x22de18[_0xe0d7('0x3f')]);_0x547d47[_0xe0d7('0x40')]=_[_0xe0d7('0x41')](_0x547d47[_0xe0d7('0x42')],_0x547d47[_0xe0d7('0x3f')]);_0x3110f5[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x547d47['model'],qs[_0xe0d7('0x44')](_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x3110f5[_0xe0d7('0x43')]=_0x3110f5[_0xe0d7('0x43')]['length']?_0x3110f5[_0xe0d7('0x43')]:_0x547d47[_0xe0d7('0x42')];_0x3110f5[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x22de18[_0xe0d7('0x3f')]['sort']);_0x3110f5[_0xe0d7('0x4b')]=qs['filters'](_['pick'](_0x22de18[_0xe0d7('0x3f')],_0x547d47['filters']));if(_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x3110f5[_0xe0d7('0x4b')]=_[_0xe0d7('0x4c')](_0x3110f5[_0xe0d7('0x4b')],{'$or':_['map'](_0x3110f5[_0xe0d7('0x43')],function(_0x1bb6f1){var _0x4814a6={};_0x4814a6[_0x1bb6f1]={'$like':'%'+_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x2d')]+'%'};return _0x4814a6;})});}_0x3110f5=_[_0xe0d7('0x4c')]({},_0x3110f5,_0x22de18[_0xe0d7('0x4d')]);return _0x5c04a9[_0xe0d7('0x6b')](_0x3110f5);}})[_0xe0d7('0x27')](function(_0x36fb27){if(_0x36fb27){_0x590c9b=_0x36fb27['length'];if(!_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x46')]('nolimit')){_0x3110f5[_0xe0d7('0x1e')]=qs[_0xe0d7('0x1e')](_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x1e')]);_0x3110f5[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x22de18[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}return _0x5c04a9[_0xe0d7('0x6b')](_0x3110f5);}})[_0xe0d7('0x27')](function(_0x1f0600){if(_0x1f0600){return _0x1f0600?{'count':_0x590c9b,'rows':_0x1f0600}:null;}})[_0xe0d7('0x27')](respondWithResult(_0x541aef,null))[_0xe0d7('0x50')](handleError(_0x541aef,null));};exports[_0xe0d7('0x6d')]=function(_0x3ac15d,_0x1cf5ed,_0x20d91c){var _0x57021d=_0x3ac15d['body'][_0xe0d7('0x6e')];var _0x187f54=_['map'](_0x57021d,'id');return db[_0xe0d7('0x6c')]['findAll']({'where':{'id':_0x187f54},'attributes':['id'],'include':[{'model':db[_0xe0d7('0x6f')],'as':_0xe0d7('0x70'),'attributes':['id',_0xe0d7('0x3d'),_0xe0d7('0x71'),_0xe0d7('0x72'),_0xe0d7('0x73')],'raw':!![]}]})[_0xe0d7('0x27')](function(_0x135276){if(_0x135276){var _0x384439=_['flatMap'](_0x135276,function(_0x541cbd){var _0x51f1da=_0x541cbd['get']({'plain':!![]});_0x51f1da['Agents'][_0xe0d7('0x74')](function(_0x49b8e9){_0x49b8e9['penalty']=_[_0xe0d7('0x33')](_0x57021d,{'id':_0x51f1da['id']})[_0xe0d7('0x75')];});return _0x51f1da[_0xe0d7('0x70')];});return db[_0xe0d7('0x39')]['find']({'where':{'id':_0x3ac15d[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](function(_0x5b7a80){return db['sequelize'][_0xe0d7('0x76')](function(_0x8f4f76){return _0x5b7a80[_0xe0d7('0x6d')](_0x187f54,{'transaction':_0x8f4f76})[_0xe0d7('0x27')](function(){return BPromise[_0xe0d7('0x77')](_0x57021d,function(_0x26c2c9){return db[_0xe0d7('0x78')][_0xe0d7('0x79')]({'TeamId':_0x26c2c9['id'],'VoiceQueueId':_0x3ac15d[_0xe0d7('0x5f')]['id'],'penalty':_0x26c2c9[_0xe0d7('0x75')]},{'transaction':_0x8f4f76});});})[_0xe0d7('0x27')](function(){return BPromise[_0xe0d7('0x77')](_0x384439,function(_0x2ab480){return db[_0xe0d7('0x7a')][_0xe0d7('0x7b')]({'where':{'UserId':_0x2ab480['id'],'VoiceQueueId':_0x3ac15d[_0xe0d7('0x5f')]['id']},'defaults':{'penalty':_0x2ab480[_0xe0d7('0x75')]},'transaction':_0x8f4f76});});})[_0xe0d7('0x27')](function(){return BPromise[_0xe0d7('0x77')](_[_0xe0d7('0x2d')](_0x384439,{'online':!![]}),function(_0x22b17c){return db[_0xe0d7('0x7c')]['upsert']({'membername':_0x22b17c[_0xe0d7('0x3d')],'UserId':_0x22b17c['id'],'queue_name':_0x5b7a80[_0xe0d7('0x3d')],'VoiceQueueId':_0x5b7a80['id'],'interface':_[_0xe0d7('0x7d')](_0x22b17c[_0xe0d7('0x73')])?util[_0xe0d7('0x7e')](_0xe0d7('0x7f'),_0x22b17c['name']):_0x22b17c[_0xe0d7('0x73')],'paused':_0x22b17c[_0xe0d7('0x72')]||![],'penalty':_0x22b17c['penalty']},{'transaction':_0x8f4f76});});})['then'](function(){_0x384439['forEach'](function(_0x7e2e35){socket[_0xe0d7('0x80')](_0xe0d7('0x81'),{'UserId':_0x7e2e35['id'],'VoiceQueueId':_0x5b7a80['id']});});});});});}})[_0xe0d7('0x27')](respondWithStatusCode(_0x1cf5ed,null))['catch'](handleError(_0x1cf5ed,null));};exports[_0xe0d7('0x82')]=function(_0x52350c,_0x3544a4,_0x127723){return db['Team']['findAll']({'where':{'id':_0x52350c[_0xe0d7('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe0d7('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe0d7('0x27')](handleEntityNotFound(_0x3544a4,null))[_0xe0d7('0x27')](function(_0x5b6bb8){var _0x45f549=_[_0xe0d7('0x2f')](_0x5b6bb8,'id');var _0x2adfaa=[];var _0x5c5844=[];var _0x36e990=squel[_0xe0d7('0x83')]();_0x36e990[_0xe0d7('0x84')](_0xe0d7('0x85'))[_0xe0d7('0x86')](_0xe0d7('0x87'),'tq')[_0xe0d7('0x88')](_0xe0d7('0x89'),'ut',_0xe0d7('0x8a'))['where']('VoiceQueueId\x20=\x20?',_0x52350c['params']['id']);for(var _0x476950=0x0;_0x476950<_0x5b6bb8[_0xe0d7('0x45')];_0x476950+=0x1){let _0x29e69d=_0x5b6bb8[_0x476950];for(var _0x53c6e1=0x0;_0x53c6e1<_0x29e69d[_0xe0d7('0x70')][_0xe0d7('0x45')];_0x53c6e1+=0x1){let _0x5a09f7=_0x29e69d[_0xe0d7('0x70')][_0x53c6e1];var _0x4e1412=_0x36e990[_0xe0d7('0x5b')]();_0x4e1412[_0xe0d7('0x4b')](_0xe0d7('0x8b'),_0x5a09f7['id']);_0x5c5844[_0xe0d7('0x8c')](db[_0xe0d7('0x8d')][_0xe0d7('0x3f')](_0x4e1412['toString'](),{'type':db['sequelize'][_0xe0d7('0x8e')][_0xe0d7('0x8f')]})['then'](function(_0x24697d){if(_0x24697d[_0xe0d7('0x45')]===0x1){return _0x5a09f7['id'];}else{var _0xff5530=_['every'](_[_0xe0d7('0x2f')](_0x24697d,_0xe0d7('0x90')),function(_0x1b026e){return _[_0xe0d7('0x31')](_0x45f549,_0x1b026e);});if(_0xff5530){return _0x5a09f7['id'];}}}));}}return BPromise[_0xe0d7('0x91')](_0x5c5844)[_0xe0d7('0x27')](function(_0x4b4651){_0x2adfaa=_(_0x2adfaa)[_0xe0d7('0x92')](_0x4b4651)[_0xe0d7('0x93')]()['value']();return db['VoiceQueue'][_0xe0d7('0x33')]({'where':{'id':_0x52350c[_0xe0d7('0x5f')]['id']}})['then'](function(_0x3a54c3){return db[_0xe0d7('0x8d')]['transaction'](function(_0xe62b9c){return _0x3a54c3['removeTeams'](_0x52350c[_0xe0d7('0x3f')]['ids'],{'transaction':_0xe62b9c})['then'](function(){if(!_[_0xe0d7('0x94')](_0x2adfaa)){return _0x3a54c3[_0xe0d7('0x95')](_0x2adfaa,{'transaction':_0xe62b9c})['then'](function(){return db[_0xe0d7('0x7c')][_0xe0d7('0x5e')]({'where':{'VoiceQueueId':_0x52350c['params']['id'],'UserId':_0x2adfaa},'transaction':_0xe62b9c});});}})[_0xe0d7('0x27')](function(){_0x2adfaa[_0xe0d7('0x74')](function(_0x33d4e7){socket[_0xe0d7('0x80')](_0xe0d7('0x96'),{'UserId':_0x33d4e7,'VoiceQueueId':_0x3a54c3['id']});});});});});});})[_0xe0d7('0x27')](respondWithStatusCode(_0x3544a4,null))[_0xe0d7('0x50')](handleError(_0x3544a4,null));};exports[_0xe0d7('0x97')]=function(_0x18a7f9,_0x231519,_0x3037fc){var _0x52a690,_0x20e71d;return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0x18a7f9[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x231519,null))[_0xe0d7('0x27')](function(_0x26b9d7){if(_0x26b9d7){_0x20e71d=_0x26b9d7;return _0x26b9d7[_0xe0d7('0x97')](_0x18a7f9[_0xe0d7('0x53')][_0xe0d7('0x98')],_[_0xe0d7('0x5c')](_0x18a7f9[_0xe0d7('0x53')],[_0xe0d7('0x98'),'id'])||{})[_0xe0d7('0x99')](function(_0x3caf7c){for(var _0x28cfad=0x0;_0x28cfad<_0x18a7f9[_0xe0d7('0x53')][_0xe0d7('0x98')][_0xe0d7('0x45')];_0x28cfad+=0x1){socket[_0xe0d7('0x80')](_0xe0d7('0x81'),{'UserId':Number(_0x18a7f9[_0xe0d7('0x53')][_0xe0d7('0x98')][_0x28cfad]),'VoiceQueueId':Number(_0x18a7f9[_0xe0d7('0x5f')]['id'])});}return _0x3caf7c;});}})['then'](function(_0x43e833){_0x52a690=_0x43e833||[];if(_0x20e71d){return db[_0xe0d7('0x6f')][_0xe0d7('0x4f')]({'where':{'id':_0x18a7f9['body'][_0xe0d7('0x98')]},'attributes':['id',_0xe0d7('0x3d'),_0xe0d7('0x71'),'voicePause',_0xe0d7('0x73')],'raw':!![]});}})['then'](function(_0x36958a){if(!_[_0xe0d7('0x94')](_0x36958a)){var _0x5c5b26=[];for(var _0x4ae093=0x0;_0x4ae093<_0x36958a[_0xe0d7('0x45')];_0x4ae093++){if(_0x36958a[_0x4ae093][_0xe0d7('0x71')]){_0x5c5b26[_0xe0d7('0x8c')](db[_0xe0d7('0x7c')]['upsert']({'membername':_0x36958a[_0x4ae093]['name'],'UserId':_0x36958a[_0x4ae093]['id'],'queue_name':_0x20e71d[_0xe0d7('0x3d')],'VoiceQueueId':_0x20e71d['id'],'interface':_[_0xe0d7('0x7d')](_0x36958a[_0x4ae093]['interface'])?util[_0xe0d7('0x7e')](_0xe0d7('0x7f'),_0x36958a[_0x4ae093][_0xe0d7('0x3d')]):_0x36958a[_0x4ae093]['interface'],'paused':_0x36958a[_0x4ae093][_0xe0d7('0x72')]||![],'penalty':_0x18a7f9['body']['penalty']||0x0}));}}return BPromise[_0xe0d7('0x91')](_0x5c5b26);}})[_0xe0d7('0x27')](function(){return _0x52a690;})[_0xe0d7('0x27')](respondWithResult(_0x231519,null))['catch'](handleError(_0x231519,null));};exports[_0xe0d7('0x95')]=function(_0x4da3f6,_0x5bc81a,_0x153fb7){return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0x4da3f6[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x5bc81a,null))[_0xe0d7('0x27')](function(_0x103070){if(_0x103070){return _0x103070['removeAgents'](_0x4da3f6['query']['ids'])[_0xe0d7('0x27')](function(){if(_[_0xe0d7('0x9a')](_0x4da3f6[_0xe0d7('0x3f')][_0xe0d7('0x98')])){for(var _0x25525c=0x0;_0x25525c<_0x4da3f6[_0xe0d7('0x3f')]['ids'][_0xe0d7('0x45')];_0x25525c+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x4da3f6['query'][_0xe0d7('0x98')][_0x25525c]),'VoiceQueueId':Number(_0x4da3f6['params']['id'])});}}else{socket['emit'](_0xe0d7('0x96'),{'UserId':Number(_0x4da3f6['query'][_0xe0d7('0x98')]),'VoiceQueueId':Number(_0x4da3f6['params']['id'])});}});}})[_0xe0d7('0x27')](function(_0x20a59a){return db[_0xe0d7('0x7c')][_0xe0d7('0x5e')]({'where':{'VoiceQueueId':_0x4da3f6['params']['id'],'UserId':_0x4da3f6['query']['ids']}})['then'](function(){return _0x20a59a;});})['then'](respondWithStatusCode(_0x5bc81a,null))[_0xe0d7('0x50')](handleError(_0x5bc81a,null));};exports[_0xe0d7('0x9b')]=function(_0x73474a,_0x4da8fc,_0x1525cb){var _0x2be227={};var _0x19c53a={};var _0x19d2fc;var _0x3920dd;return db[_0xe0d7('0x39')][_0xe0d7('0x65')]({'where':{'id':_0x73474a[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x4da8fc,null))[_0xe0d7('0x27')](function(_0x598438){if(_0x598438){_0x19d2fc=_0x598438;_0x19c53a[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x6f')][_0xe0d7('0x3a')]);_0x19c53a[_0xe0d7('0x3f')]=_[_0xe0d7('0x3e')](_0x73474a['query']);_0x19c53a[_0xe0d7('0x40')]=_[_0xe0d7('0x41')](_0x19c53a[_0xe0d7('0x42')],_0x19c53a[_0xe0d7('0x3f')]);_0x2be227[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x19c53a[_0xe0d7('0x42')],qs['fields'](_0x73474a['query'][_0xe0d7('0x44')]));_0x2be227[_0xe0d7('0x43')]=_0x2be227[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x2be227['attributes']:_0x19c53a[_0xe0d7('0x42')];_0x2be227[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x73474a[_0xe0d7('0x3f')]['sort']);_0x2be227[_0xe0d7('0x4b')]=qs[_0xe0d7('0x40')](_[_0xe0d7('0x62')](_0x73474a[_0xe0d7('0x3f')],_0x19c53a[_0xe0d7('0x40')]));if(_0x73474a[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x2be227['where']=_['merge'](_0x2be227[_0xe0d7('0x4b')],{'$or':_['map'](_0x2be227['attributes'],function(_0x463b48){var _0x5697d1={};_0x5697d1[_0x463b48]={'$like':'%'+_0x73474a[_0xe0d7('0x3f')][_0xe0d7('0x2d')]+'%'};return _0x5697d1;})});}_0x2be227=_[_0xe0d7('0x4c')]({},_0x2be227,_0x73474a['options']);return _0x19d2fc[_0xe0d7('0x9b')](_0x2be227);}})['then'](function(_0x4d4216){if(_0x4d4216){_0x3920dd=_0x4d4216[_0xe0d7('0x45')];if(!_0x73474a[_0xe0d7('0x3f')][_0xe0d7('0x46')]('nolimit')){_0x2be227['limit']=qs['limit'](_0x73474a[_0xe0d7('0x3f')][_0xe0d7('0x1e')]);_0x2be227[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x73474a[_0xe0d7('0x3f')]['offset']);}return _0x19d2fc[_0xe0d7('0x9b')](_0x2be227);}})['then'](function(_0x2ad03b){if(_0x2ad03b){return _0x2ad03b?{'count':_0x3920dd,'rows':_0x2ad03b}:null;}})[_0xe0d7('0x27')](respondWithResult(_0x4da8fc,null))['catch'](handleError(_0x4da8fc,null));};exports[_0xe0d7('0x9c')]=function(_0x446248,_0xae5917,_0x373626){var _0x3b17bc={};var _0x5ccdff={};var _0x4ba7f4;var _0xcd73b0;return db[_0xe0d7('0x39')]['findOne']({'where':{'id':_0x446248[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0xae5917,null))[_0xe0d7('0x27')](function(_0x568c47){if(_0x568c47){_0x4ba7f4=_0x568c47;_0x5ccdff[_0xe0d7('0x42')]=_['keys'](db[_0xe0d7('0x7c')]['rawAttributes']);_0x5ccdff[_0xe0d7('0x3f')]=_[_0xe0d7('0x3e')](_0x446248['query']);_0x5ccdff['filters']=_[_0xe0d7('0x41')](_0x5ccdff[_0xe0d7('0x42')],_0x5ccdff['query']);_0x3b17bc[_0xe0d7('0x43')]=_['intersection'](_0x5ccdff[_0xe0d7('0x42')],qs['fields'](_0x446248[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x3b17bc[_0xe0d7('0x43')]=_0x3b17bc[_0xe0d7('0x43')]['length']?_0x3b17bc[_0xe0d7('0x43')]:_0x5ccdff[_0xe0d7('0x42')];_0x3b17bc[_0xe0d7('0x49')]=qs['sort'](_0x446248[_0xe0d7('0x3f')][_0xe0d7('0x4a')]);_0x3b17bc['where']=qs[_0xe0d7('0x40')](_[_0xe0d7('0x62')](_0x446248[_0xe0d7('0x3f')],_0x5ccdff['filters']));if(_0x446248['query']['filter']){_0x3b17bc[_0xe0d7('0x4b')]=_[_0xe0d7('0x4c')](_0x3b17bc[_0xe0d7('0x4b')],{'$or':_[_0xe0d7('0x2f')](_0x3b17bc['attributes'],function(_0x598987){var _0x22f0c3={};_0x22f0c3[_0x598987]={'$like':'%'+_0x446248[_0xe0d7('0x3f')][_0xe0d7('0x2d')]+'%'};return _0x22f0c3;})});}_0x3b17bc=_[_0xe0d7('0x4c')]({},_0x3b17bc,_0x446248[_0xe0d7('0x4d')]);return _0x4ba7f4[_0xe0d7('0x9c')](_0x3b17bc);}})[_0xe0d7('0x27')](function(_0x18c618){if(_0x18c618){_0xcd73b0=_0x18c618[_0xe0d7('0x45')];if(!_0x446248[_0xe0d7('0x3f')]['hasOwnProperty'](_0xe0d7('0x47'))){_0x3b17bc['limit']=qs[_0xe0d7('0x1e')](_0x446248[_0xe0d7('0x3f')]['limit']);_0x3b17bc[_0xe0d7('0x48')]=qs['offset'](_0x446248[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}return _0x4ba7f4[_0xe0d7('0x9c')](_0x3b17bc);}})[_0xe0d7('0x27')](function(_0x4e51f8){return _0x4e51f8?{'count':_0xcd73b0,'rows':_0x4e51f8}:null;})[_0xe0d7('0x27')](respondWithResult(_0xae5917,null))[_0xe0d7('0x50')](handleError(_0xae5917,null));};exports['getLists']=function(_0x386e92,_0x1f7b6b,_0x1acd0a){var _0x34eba7={};var _0xa6446e={};var _0x2154be;var _0xe17950;return db[_0xe0d7('0x39')][_0xe0d7('0x65')]({'where':{'id':_0x386e92[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x1f7b6b,null))[_0xe0d7('0x27')](function(_0x3e2726){if(_0x3e2726){_0x2154be=_0x3e2726;_0xa6446e[_0xe0d7('0x42')]=_[_0xe0d7('0x3e')](db[_0xe0d7('0x9d')][_0xe0d7('0x3a')]);_0xa6446e['query']=_[_0xe0d7('0x3e')](_0x386e92['query']);_0xa6446e['filters']=_['intersection'](_0xa6446e['model'],_0xa6446e['query']);_0x34eba7[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0xa6446e[_0xe0d7('0x42')],qs['fields'](_0x386e92[_0xe0d7('0x3f')][_0xe0d7('0x44')]));_0x34eba7[_0xe0d7('0x43')]=_0x34eba7[_0xe0d7('0x43')][_0xe0d7('0x45')]?_0x34eba7[_0xe0d7('0x43')]:_0xa6446e[_0xe0d7('0x42')];_0x34eba7[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x386e92['query'][_0xe0d7('0x4a')]);_0x34eba7[_0xe0d7('0x4b')]=qs['filters'](_[_0xe0d7('0x62')](_0x386e92[_0xe0d7('0x3f')],_0xa6446e['filters']));if(_0x386e92[_0xe0d7('0x3f')][_0xe0d7('0x2d')]){_0x34eba7[_0xe0d7('0x4b')]=_['merge'](_0x34eba7['where'],{'$or':_[_0xe0d7('0x2f')](_0x34eba7[_0xe0d7('0x43')],function(_0x356380){var _0x217e35={};_0x217e35[_0x356380]={'$like':'%'+_0x386e92[_0xe0d7('0x3f')]['filter']+'%'};return _0x217e35;})});}_0x34eba7=_[_0xe0d7('0x4c')]({},_0x34eba7,_0x386e92[_0xe0d7('0x4d')]);return _0x2154be[_0xe0d7('0x9e')](_0x34eba7);}})[_0xe0d7('0x27')](function(_0x13ae74){if(_0x13ae74){_0xe17950=_0x13ae74[_0xe0d7('0x45')];if(!_0x386e92[_0xe0d7('0x3f')]['hasOwnProperty'](_0xe0d7('0x47'))){_0x34eba7['limit']=qs[_0xe0d7('0x1e')](_0x386e92['query'][_0xe0d7('0x1e')]);_0x34eba7[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x386e92[_0xe0d7('0x3f')]['offset']);}return _0x2154be[_0xe0d7('0x9e')](_0x34eba7);}})['then'](function(_0x352461){if(_0x352461){return _0x352461?{'count':_0xe17950,'rows':_0x352461}:null;}})[_0xe0d7('0x27')](respondWithResult(_0x1f7b6b,null))[_0xe0d7('0x50')](handleError(_0x1f7b6b,null));};exports[_0xe0d7('0x9f')]=function(_0x5c0ef8,_0xa8f583,_0x4ea8e4){var _0x2127ce,_0x292791;return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0x5c0ef8[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0xa8f583,null))['then'](function(_0x49bfaa){if(_0x49bfaa){_0x292791=_0x49bfaa;return _0x49bfaa[_0xe0d7('0x9f')](_0x5c0ef8[_0xe0d7('0x53')]['ids'],_[_0xe0d7('0x5c')](_0x5c0ef8[_0xe0d7('0x53')],['ids','id'])||{});}return null;})[_0xe0d7('0x99')](function(_0x5ee921){var _0x3314eb;_0x2127ce=_0x5ee921||[];var _0xae3617=[];if(_0x5ee921){for(var _0xd3f60a=0x0;_0xd3f60a<_0x5ee921[_0xe0d7('0x45')];_0xd3f60a+=0x1){var _0x579537=_0x5ee921[_0xd3f60a][_0xe0d7('0x28')]({'plain':!![]});_0x292791[_0xe0d7('0xa0')]=_0x5c0ef8['body']['dialCheckDuplicateType']?_0x5c0ef8[_0xe0d7('0x53')][_0xe0d7('0xa0')]:_0x292791[_0xe0d7('0xa0')];switch(_0x292791[_0xe0d7('0xa0')]){case _0xe0d7('0xa1'):_0x3314eb=squel[_0xe0d7('0xa2')]()['into']('cm_hopper')[_0xe0d7('0xa3')]([_0xe0d7('0xa4'),_0xe0d7('0xa5'),_0xe0d7('0xa6'),'ListId','VoiceQueueId',_0xe0d7('0x5d'),_0xe0d7('0xa7')],squel[_0xe0d7('0x83')]()[_0xe0d7('0x84')](_0xe0d7('0xa4'),_0xe0d7('0xa4'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),'scheduledAt')[_0xe0d7('0x84')]('id',_0xe0d7('0xa6'))[_0xe0d7('0x84')](_0x579537['CmListId'][_0xe0d7('0xa9')](),'ListId')[_0xe0d7('0x84')](_0x5c0ef8[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')](),_0xe0d7('0x69'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),_0xe0d7('0x5d'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),_0xe0d7('0xa7'))[_0xe0d7('0x86')](_0xe0d7('0xaa'))['where'](_0xe0d7('0xab'))['where'](_0xe0d7('0xac'),_0x579537[_0xe0d7('0xad')][_0xe0d7('0xa9')]())[_0xe0d7('0x4b')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xe0d7('0x83')]()[_0xe0d7('0x84')]('COALESCE(calleridnum,\x27\x27)')[_0xe0d7('0x86')]('cm_hopper_final')[_0xe0d7('0x4b')](_0xe0d7('0xae'),_0x5c0ef8[_0xe0d7('0x5f')]['id']['toString']()))['where'](_0xe0d7('0xaf'),squel[_0xe0d7('0x83')]()['field'](_0xe0d7('0xb0'))[_0xe0d7('0x86')](_0xe0d7('0xb1'))[_0xe0d7('0x4b')]('VoiceQueueId\x20=\x20?',_0x5c0ef8[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')]())))[_0xe0d7('0xa9')]();break;case'onlyIfOpen':_0x3314eb=squel['insert']()['into'](_0xe0d7('0xb1'))[_0xe0d7('0xa3')]([_0xe0d7('0xa4'),_0xe0d7('0xa5'),_0xe0d7('0xa6'),_0xe0d7('0xb2'),_0xe0d7('0x69'),'createdAt',_0xe0d7('0xa7')],squel[_0xe0d7('0x83')]()[_0xe0d7('0x84')](_0xe0d7('0xa4'),_0xe0d7('0xa4'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),'scheduledAt')[_0xe0d7('0x84')]('id','ContactId')[_0xe0d7('0x84')](_0x579537[_0xe0d7('0xad')]['toString'](),_0xe0d7('0xb2'))[_0xe0d7('0x84')](_0x5c0ef8[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')](),_0xe0d7('0x69'))['field']('NOW()',_0xe0d7('0x5d'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),_0xe0d7('0xa7'))[_0xe0d7('0x86')](_0xe0d7('0xaa'))['where'](_0xe0d7('0xab'))[_0xe0d7('0x4b')]('ListId\x20=\x20?',_0x579537['CmListId'][_0xe0d7('0xa9')]())[_0xe0d7('0x4b')](_0xe0d7('0xb3'))[_0xe0d7('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xe0d7('0x84')](_0xe0d7('0xb0'))[_0xe0d7('0x86')]('cm_hopper')[_0xe0d7('0x4b')](_0xe0d7('0xae'),_0x5c0ef8[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')]())))[_0xe0d7('0xa9')]();break;default:_0x3314eb=squel[_0xe0d7('0xa2')]()[_0xe0d7('0xb4')](_0xe0d7('0xb1'))[_0xe0d7('0xa3')]([_0xe0d7('0xa4'),_0xe0d7('0xa5'),_0xe0d7('0xa6'),_0xe0d7('0xb2'),_0xe0d7('0x69'),_0xe0d7('0x5d'),_0xe0d7('0xa7')],squel['select']()[_0xe0d7('0x84')](_0xe0d7('0xa4'),_0xe0d7('0xa4'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),_0xe0d7('0xa5'))[_0xe0d7('0x84')]('id',_0xe0d7('0xa6'))[_0xe0d7('0x84')](_0x579537[_0xe0d7('0xad')][_0xe0d7('0xa9')](),_0xe0d7('0xb2'))[_0xe0d7('0x84')](_0x5c0ef8[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')](),_0xe0d7('0x69'))[_0xe0d7('0x84')]('NOW()',_0xe0d7('0x5d'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),_0xe0d7('0xa7'))[_0xe0d7('0x86')]('cm_contacts')[_0xe0d7('0x4b')](_0xe0d7('0xab'))['where'](_0xe0d7('0xac'),_0x579537[_0xe0d7('0xad')][_0xe0d7('0xa9')]())[_0xe0d7('0x4b')](_0xe0d7('0xb3')))['toString']();}_0xae3617[_0xe0d7('0x8c')](db['sequelize'][_0xe0d7('0x3f')](_0x3314eb));}return BPromise['all'](_0xae3617);}})[_0xe0d7('0x27')](function(){return _0x2127ce;})[_0xe0d7('0x27')](respondWithResult(_0xa8f583,null))['catch'](handleError(_0xa8f583,null));};exports[_0xe0d7('0xb5')]=function(_0x485eb7,_0x460fd1,_0x4498ae){return db['VoiceQueue'][_0xe0d7('0x33')]({'where':{'id':_0x485eb7[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x460fd1,null))[_0xe0d7('0x27')](function(_0xec8f40){if(_0xec8f40){return _0xec8f40[_0xe0d7('0xb5')](_0x485eb7['query'][_0xe0d7('0x98')]);}})[_0xe0d7('0x27')](function(_0x4b0d31){if(_0x4b0d31){return db[_0xe0d7('0x61')][_0xe0d7('0x5e')]({'where':{'ListId':_0x485eb7[_0xe0d7('0x3f')]['ids'],'VoiceQueueId':_0x485eb7['params']['id']}})[_0xe0d7('0x27')](function(){return _0x4b0d31;});}})['then'](respondWithStatusCode(_0x460fd1,null))[_0xe0d7('0x50')](handleError(_0x460fd1,null));};exports[_0xe0d7('0xb6')]=function(_0x54b517,_0x94069a,_0xa6708c){var _0xe1eb47={};var _0x10c519={};var _0x157238;var _0x4e3de6;return db[_0xe0d7('0x39')]['findOne']({'where':{'id':_0x54b517[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x94069a,null))[_0xe0d7('0x27')](function(_0x32e08e){if(_0x32e08e){_0x157238=_0x32e08e;_0x10c519[_0xe0d7('0x42')]=_['keys'](db[_0xe0d7('0x9d')][_0xe0d7('0x3a')]);_0x10c519[_0xe0d7('0x3f')]=_[_0xe0d7('0x3e')](_0x54b517[_0xe0d7('0x3f')]);_0x10c519[_0xe0d7('0x40')]=_[_0xe0d7('0x41')](_0x10c519[_0xe0d7('0x42')],_0x10c519[_0xe0d7('0x3f')]);_0xe1eb47[_0xe0d7('0x43')]=_[_0xe0d7('0x41')](_0x10c519['model'],qs[_0xe0d7('0x44')](_0x54b517[_0xe0d7('0x3f')]['fields']));_0xe1eb47[_0xe0d7('0x43')]=_0xe1eb47['attributes'][_0xe0d7('0x45')]?_0xe1eb47[_0xe0d7('0x43')]:_0x10c519[_0xe0d7('0x42')];_0xe1eb47[_0xe0d7('0x49')]=qs[_0xe0d7('0x4a')](_0x54b517[_0xe0d7('0x3f')][_0xe0d7('0x4a')]);_0xe1eb47[_0xe0d7('0x4b')]=qs['filters'](_['pick'](_0x54b517[_0xe0d7('0x3f')],_0x10c519[_0xe0d7('0x40')]));if(_0x54b517[_0xe0d7('0x3f')]['filter']){_0xe1eb47[_0xe0d7('0x4b')]=_['merge'](_0xe1eb47['where'],{'$or':_['map'](_0xe1eb47[_0xe0d7('0x43')],function(_0x3de300){var _0x2a52ad={};_0x2a52ad[_0x3de300]={'$like':'%'+_0x54b517['query']['filter']+'%'};return _0x2a52ad;})});}_0xe1eb47=_['merge']({},_0xe1eb47,_0x54b517['options']);return _0x157238[_0xe0d7('0xb6')](_0xe1eb47);}})[_0xe0d7('0x27')](function(_0x2d3694){if(_0x2d3694){_0x4e3de6=_0x2d3694[_0xe0d7('0x45')];if(!_0x54b517['query'][_0xe0d7('0x46')]('nolimit')){_0xe1eb47['limit']=qs['limit'](_0x54b517[_0xe0d7('0x3f')][_0xe0d7('0x1e')]);_0xe1eb47[_0xe0d7('0x48')]=qs[_0xe0d7('0x48')](_0x54b517[_0xe0d7('0x3f')][_0xe0d7('0x48')]);}return _0x157238[_0xe0d7('0xb6')](_0xe1eb47);}})[_0xe0d7('0x27')](function(_0x2af2f6){if(_0x2af2f6){return _0x2af2f6?{'count':_0x4e3de6,'rows':_0x2af2f6}:null;}})[_0xe0d7('0x27')](respondWithResult(_0x94069a,null))[_0xe0d7('0x50')](handleError(_0x94069a,null));};exports[_0xe0d7('0xb7')]=function(_0x3ad64e,_0x1b0009,_0x2981b1){var _0x50f02c,_0x1b9bc4;return db[_0xe0d7('0x39')]['find']({'where':{'id':_0x3ad64e[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](handleEntityNotFound(_0x1b0009,null))['then'](function(_0x4425e7){if(_0x4425e7){_0x1b9bc4=_0x4425e7;return _0x4425e7[_0xe0d7('0xb7')](_0x3ad64e[_0xe0d7('0x53')][_0xe0d7('0x98')],_[_0xe0d7('0x5c')](_0x3ad64e['body'],[_0xe0d7('0x98'),'id'])||{});}return null;})[_0xe0d7('0x99')](function(_0x2218e4){var _0x5b3791;_0x50f02c=_0x2218e4||[];var _0x43bd70=[];if(_0x2218e4){for(var _0x479d55=0x0;_0x479d55<_0x2218e4[_0xe0d7('0x45')];_0x479d55+=0x1){var _0x3eace9=_0x2218e4[_0x479d55][_0xe0d7('0x28')]({'plain':!![]});_0x5b3791=squel[_0xe0d7('0xa2')]()['into'](_0xe0d7('0xb8'))[_0xe0d7('0xa3')](['phone','ContactId','ListId',_0xe0d7('0x69'),_0xe0d7('0x5d'),_0xe0d7('0xa7')],squel[_0xe0d7('0x83')]()[_0xe0d7('0x84')](_0xe0d7('0xa4'),_0xe0d7('0xa4'))[_0xe0d7('0x84')]('id',_0xe0d7('0xa6'))[_0xe0d7('0x84')](_0x3eace9[_0xe0d7('0xad')][_0xe0d7('0xa9')](),'ListId')[_0xe0d7('0x84')](_0x3ad64e[_0xe0d7('0x5f')]['id'][_0xe0d7('0xa9')](),'VoiceQueueId')['field']('NOW()',_0xe0d7('0x5d'))[_0xe0d7('0x84')](_0xe0d7('0xa8'),'updatedAt')['from'](_0xe0d7('0xaa'))[_0xe0d7('0x4b')](_0xe0d7('0xab'))[_0xe0d7('0x4b')](_0xe0d7('0xac'),_0x3eace9[_0xe0d7('0xad')][_0xe0d7('0xa9')]())[_0xe0d7('0x4b')](_0xe0d7('0xb3')))['toString']();_0x43bd70[_0xe0d7('0x8c')](db[_0xe0d7('0x8d')][_0xe0d7('0x3f')](_0x5b3791));}return BPromise['all'](_0x43bd70);}})[_0xe0d7('0x27')](function(){return _0x50f02c;})['then'](respondWithResult(_0x1b0009,null))[_0xe0d7('0x50')](handleError(_0x1b0009,null));};exports[_0xe0d7('0xb9')]=function(_0xa48ec4,_0x348fd1,_0xe460df){return db[_0xe0d7('0x39')][_0xe0d7('0x33')]({'where':{'id':_0xa48ec4[_0xe0d7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x348fd1,null))['then'](function(_0x54e473){if(_0x54e473){return _0x54e473[_0xe0d7('0xb9')](_0xa48ec4[_0xe0d7('0x3f')][_0xe0d7('0x98')]);}})[_0xe0d7('0x27')](function(_0x516c06){if(_0x516c06){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0xa48ec4[_0xe0d7('0x3f')][_0xe0d7('0x98')],'VoiceQueueId':_0xa48ec4[_0xe0d7('0x5f')]['id']}})[_0xe0d7('0x27')](function(){return _0x516c06;});}})[_0xe0d7('0x27')](respondWithStatusCode(_0x348fd1,null))['catch'](handleError(_0x348fd1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index c52c5df..be2ed3a 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 _0xff04=['../../mysqldb','VoiceQueue','save','emit','hasOwnProperty'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xff04,0xe1));var _0x4ff0=function(_0x1669c6,_0x5bc495){_0x1669c6=_0x1669c6-0x0;var _0x1f4b4e=_0xff04[_0x1669c6];return _0x1f4b4e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4ff0('0x0'))['db'][_0x4ff0('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4ff0('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f9ea9){return function(_0x43bf50,_0x41a0ae,_0x3f758b){VoiceQueueEvents[_0x4ff0('0x3')](_0x4f9ea9+':'+_0x43bf50['id'],_0x43bf50);VoiceQueueEvents[_0x4ff0('0x3')](_0x4f9ea9,_0x43bf50);_0x3f758b(null);};}for(var e in events){if(events[_0x4ff0('0x4')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x10bc=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x10bc,0xd7));var _0xc10b=function(_0x586d33,_0x393c5c){_0x586d33=_0x586d33-0x0;var _0xb351cb=_0x10bc[_0x586d33];return _0xb351cb;};'use strict';var EventEmitter=require(_0xc10b('0x0'));var VoiceQueue=require(_0xc10b('0x1'))['db'][_0xc10b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc10b('0x3')](0x0);var events={'afterCreate':_0xc10b('0x4'),'afterUpdate':_0xc10b('0x5'),'afterDestroy':_0xc10b('0x6')};function emitEvent(_0x1b80b9){return function(_0x3c243d,_0x56bc33,_0x5d0864){VoiceQueueEvents['emit'](_0x1b80b9+':'+_0x3c243d['id'],_0x3c243d);VoiceQueueEvents[_0xc10b('0x7')](_0x1b80b9,_0x3c243d);_0x5d0864(null);};}for(var e in events){if(events[_0xc10b('0x8')](e)){var event=events[e];VoiceQueue[_0xc10b('0x9')](e,emitEvent(event));}}module[_0xc10b('0xa')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 6932511..5aede54 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2e014c,_0x66095f){var _0xf0e847=function(_0x5089f4){while(--_0x5089f4){_0x2e014c['push'](_0x2e014c['shift']());}};_0xf0e847(++_0x66095f);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b28fd,_0x5f4ad9){_0x3b28fd=_0x3b28fd-0x0;var _0xf00b1a=_0xedd9[_0x3b28fd];return _0xf00b1a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x55ca,0x126));var _0xa55c=function(_0x3a23d3,_0x4088d8){_0x3a23d3=_0x3a23d3-0x0;var _0x10803b=_0x55ca[_0x3a23d3];return _0x10803b;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 83c3538..a56fb0c 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 _0x5196=['register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','model','map','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x5196,0x1b2));var _0x6519=function(_0x423a8b,_0x51e94d){_0x423a8b=_0x423a8b-0x0;var _0x448968=_0x5196[_0x423a8b];return _0x448968;};'use strict';var _=require(_0x6519('0x0'));var util=require(_0x6519('0x1'));var moment=require(_0x6519('0x2'));var BPromise=require(_0x6519('0x3'));var rs=require(_0x6519('0x4'));var fs=require('fs');var Redis=require(_0x6519('0x5'));var db=require(_0x6519('0x6'))['db'];var utils=require(_0x6519('0x7'));var logger=require(_0x6519('0x8'))(_0x6519('0x9'));var config=require(_0x6519('0xa'));var jayson=require(_0x6519('0xb'));var client=jayson['client'][_0x6519('0xc')]({'port':0x232a});config[_0x6519('0xd')]=_['defaults'](config[_0x6519('0xd')],{'host':_0x6519('0xe'),'port':0x18eb});var socket=require(_0x6519('0xf'))(new Redis(config['redis']));require(_0x6519('0x10'))[_0x6519('0x11')](socket);function respondWithRpcPromise(_0x576b29,_0x51cc72,_0x1bc0b3){return new BPromise(function(_0x354aa9,_0x364c68){return client[_0x6519('0x12')](_0x576b29,_0x1bc0b3)[_0x6519('0x13')](function(_0x243be8){logger[_0x6519('0x14')](_0x6519('0x15'),_0x51cc72,_0x6519('0x16'));logger[_0x6519('0x17')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x51cc72,_0x6519('0x16'),JSON[_0x6519('0x18')](_0x243be8));if(_0x243be8[_0x6519('0x19')]){if(_0x243be8[_0x6519('0x19')]['code']===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x51cc72,_0x243be8['error'][_0x6519('0x1a')]);return _0x364c68(_0x243be8['error'][_0x6519('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x51cc72,_0x243be8[_0x6519('0x19')][_0x6519('0x1a')]);return _0x354aa9(_0x243be8[_0x6519('0x19')]['message']);}else{logger[_0x6519('0x14')](_0x6519('0x15'),_0x51cc72,_0x6519('0x16'));_0x354aa9(_0x243be8[_0x6519('0x1b')][_0x6519('0x1a')]);}})[_0x6519('0x1c')](function(_0x4dc29d){logger['error'](_0x6519('0x15'),_0x51cc72,_0x4dc29d);_0x364c68(_0x4dc29d);});});}exports[_0x6519('0x1d')]=function(_0x2812f3){var _0x579fc1=this;return new Promise(function(_0x9ecdb1,_0xe396dd){return db[_0x6519('0x1e')]['findAll']({'raw':_0x2812f3[_0x6519('0x1f')]?_0x2812f3[_0x6519('0x1f')][_0x6519('0x20')]===undefined?!![]:![]:!![],'where':_0x2812f3['options']?_0x2812f3[_0x6519('0x1f')][_0x6519('0x21')]||null:null,'attributes':_0x2812f3[_0x6519('0x1f')]?_0x2812f3['options'][_0x6519('0x22')]||null:null,'limit':_0x2812f3['options']?_0x2812f3[_0x6519('0x1f')][_0x6519('0x23')]||null:null,'include':_0x2812f3[_0x6519('0x1f')]?_0x2812f3[_0x6519('0x1f')][_0x6519('0x24')]?_['map'](_0x2812f3[_0x6519('0x1f')][_0x6519('0x24')],function(_0x45a76d){return{'model':db[_0x45a76d[_0x6519('0x25')]],'as':_0x45a76d['as'],'attributes':_0x45a76d['attributes'],'include':_0x45a76d['include']?_[_0x6519('0x26')](_0x45a76d[_0x6519('0x24')],function(_0x27478e){return{'model':db[_0x27478e[_0x6519('0x25')]],'as':_0x27478e['as'],'attributes':_0x27478e[_0x6519('0x22')],'include':_0x27478e[_0x6519('0x24')]?_['map'](_0x27478e['include'],function(_0x1131b1){return{'model':db[_0x1131b1[_0x6519('0x25')]],'as':_0x1131b1['as'],'attributes':_0x1131b1['attributes']};}):[]};}):[]};}):[]:[]})[_0x6519('0x13')](function(_0xf8981d){logger[_0x6519('0x14')](_0x6519('0x1d'),_0x2812f3);logger[_0x6519('0x17')](_0x6519('0x1d'),_0x2812f3,JSON['stringify'](_0xf8981d));_0x9ecdb1(_0xf8981d);})[_0x6519('0x1c')](function(_0x13b930){logger[_0x6519('0x19')](_0x6519('0x1d'),_0x13b930['message'],_0x2812f3);_0xe396dd(_0x579fc1[_0x6519('0x19')](0x1f4,_0x13b930[_0x6519('0x1a')]));});});};exports[_0x6519('0x27')]=function(_0x5d592f){var _0x3ab903=this;return new Promise(function(_0xb907b3,_0x5fef05){return db['VoiceQueue'][_0x6519('0x28')]({'raw':_0x5d592f[_0x6519('0x1f')]?_0x5d592f[_0x6519('0x1f')][_0x6519('0x20')]===undefined?!![]:![]:!![],'where':_0x5d592f[_0x6519('0x1f')]?_0x5d592f[_0x6519('0x1f')][_0x6519('0x21')]||null:null,'attributes':_0x5d592f[_0x6519('0x1f')]?_0x5d592f[_0x6519('0x1f')][_0x6519('0x22')]||null:null,'include':_0x5d592f[_0x6519('0x1f')]?_0x5d592f[_0x6519('0x1f')]['include']?_[_0x6519('0x26')](_0x5d592f[_0x6519('0x1f')][_0x6519('0x24')],function(_0x41a67e){return{'model':db[_0x41a67e['model']],'as':_0x41a67e['as'],'attributes':_0x41a67e['attributes'],'include':_0x41a67e[_0x6519('0x24')]?_[_0x6519('0x26')](_0x41a67e[_0x6519('0x24')],function(_0x4427db){return{'model':db[_0x4427db[_0x6519('0x25')]],'as':_0x4427db['as'],'attributes':_0x4427db['attributes'],'include':_0x4427db['include']?_[_0x6519('0x26')](_0x4427db['include'],function(_0x5aab30){return{'model':db[_0x5aab30[_0x6519('0x25')]],'as':_0x5aab30['as'],'attributes':_0x5aab30[_0x6519('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4959a5){logger[_0x6519('0x14')](_0x6519('0x27'),_0x5d592f);logger[_0x6519('0x17')](_0x6519('0x27'),_0x5d592f,JSON[_0x6519('0x18')](_0x4959a5));_0xb907b3(_0x4959a5);})[_0x6519('0x1c')](function(_0xaaeda8){logger[_0x6519('0x19')]('ShowVoiceQueue',_0xaaeda8['message'],_0x5d592f);_0x5fef05(_0x3ab903[_0x6519('0x19')](0x1f4,_0xaaeda8[_0x6519('0x1a')]));});});}; \ No newline at end of file +var _0x2381=['register','request','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','include','model','map','attributes','then','ShowVoiceQueue','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./voiceQueue.socket'];(function(_0x16eb1f,_0x52ebeb){var _0x33574f=function(_0x332432){while(--_0x332432){_0x16eb1f['push'](_0x16eb1f['shift']());}};_0x33574f(++_0x52ebeb);}(_0x2381,0xb4));var _0x1238=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x2381[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x1238('0x0'));var util=require(_0x1238('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1238('0x2'));var fs=require('fs');var Redis=require(_0x1238('0x3'));var db=require(_0x1238('0x4'))['db'];var utils=require(_0x1238('0x5'));var logger=require(_0x1238('0x6'))(_0x1238('0x7'));var config=require(_0x1238('0x8'));var jayson=require(_0x1238('0x9'));var client=jayson['client'][_0x1238('0xa')]({'port':0x232a});config[_0x1238('0xb')]=_['defaults'](config[_0x1238('0xb')],{'host':_0x1238('0xc'),'port':0x18eb});var socket=require(_0x1238('0xd'))(new Redis(config[_0x1238('0xb')]));require(_0x1238('0xe'))[_0x1238('0xf')](socket);function respondWithRpcPromise(_0x5db618,_0x174184,_0x20e70d){return new BPromise(function(_0x4901e5,_0x5948ed){return client[_0x1238('0x10')](_0x5db618,_0x20e70d)['then'](function(_0x185655){logger[_0x1238('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x174184,_0x1238('0x12'));logger[_0x1238('0x13')](_0x1238('0x14'),_0x174184,'request\x20sent',JSON['stringify'](_0x185655));if(_0x185655[_0x1238('0x15')]){if(_0x185655[_0x1238('0x15')][_0x1238('0x16')]===0x1f4){logger[_0x1238('0x15')](_0x1238('0x17'),_0x174184,_0x185655[_0x1238('0x15')][_0x1238('0x18')]);return _0x5948ed(_0x185655[_0x1238('0x15')]['message']);}logger[_0x1238('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x174184,_0x185655[_0x1238('0x15')]['message']);return _0x4901e5(_0x185655[_0x1238('0x15')][_0x1238('0x18')]);}else{logger[_0x1238('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x174184,'request\x20sent');_0x4901e5(_0x185655[_0x1238('0x19')][_0x1238('0x18')]);}})[_0x1238('0x1a')](function(_0x52bbad){logger[_0x1238('0x15')](_0x1238('0x17'),_0x174184,_0x52bbad);_0x5948ed(_0x52bbad);});});}exports[_0x1238('0x1b')]=function(_0x1afea6){var _0x5a28d5=this;return new Promise(function(_0x56dd8e,_0xee912c){return db[_0x1238('0x1c')][_0x1238('0x1d')]({'raw':_0x1afea6[_0x1238('0x1e')]?_0x1afea6[_0x1238('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1afea6[_0x1238('0x1e')]?_0x1afea6['options'][_0x1238('0x1f')]||null:null,'attributes':_0x1afea6['options']?_0x1afea6['options']['attributes']||null:null,'limit':_0x1afea6['options']?_0x1afea6[_0x1238('0x1e')]['limit']||null:null,'include':_0x1afea6[_0x1238('0x1e')]?_0x1afea6[_0x1238('0x1e')][_0x1238('0x20')]?_['map'](_0x1afea6[_0x1238('0x1e')][_0x1238('0x20')],function(_0x512f3f){return{'model':db[_0x512f3f[_0x1238('0x21')]],'as':_0x512f3f['as'],'attributes':_0x512f3f['attributes'],'include':_0x512f3f['include']?_[_0x1238('0x22')](_0x512f3f['include'],function(_0x42a639){return{'model':db[_0x42a639['model']],'as':_0x42a639['as'],'attributes':_0x42a639['attributes'],'include':_0x42a639[_0x1238('0x20')]?_[_0x1238('0x22')](_0x42a639['include'],function(_0x34fd43){return{'model':db[_0x34fd43['model']],'as':_0x34fd43['as'],'attributes':_0x34fd43[_0x1238('0x23')]};}):[]};}):[]};}):[]:[]})[_0x1238('0x24')](function(_0x170430){logger['info'](_0x1238('0x1b'),_0x1afea6);logger[_0x1238('0x13')](_0x1238('0x1b'),_0x1afea6,JSON['stringify'](_0x170430));_0x56dd8e(_0x170430);})[_0x1238('0x1a')](function(_0x44966a){logger[_0x1238('0x15')](_0x1238('0x1b'),_0x44966a[_0x1238('0x18')],_0x1afea6);_0xee912c(_0x5a28d5[_0x1238('0x15')](0x1f4,_0x44966a['message']));});});};exports[_0x1238('0x25')]=function(_0x53995f){var _0x55957d=this;return new Promise(function(_0x42bd06,_0x359d4c){return db[_0x1238('0x1c')][_0x1238('0x26')]({'raw':_0x53995f['options']?_0x53995f[_0x1238('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x53995f[_0x1238('0x1e')]?_0x53995f[_0x1238('0x1e')][_0x1238('0x1f')]||null:null,'attributes':_0x53995f[_0x1238('0x1e')]?_0x53995f['options'][_0x1238('0x23')]||null:null,'include':_0x53995f[_0x1238('0x1e')]?_0x53995f[_0x1238('0x1e')]['include']?_[_0x1238('0x22')](_0x53995f['options'][_0x1238('0x20')],function(_0x5a6edf){return{'model':db[_0x5a6edf[_0x1238('0x21')]],'as':_0x5a6edf['as'],'attributes':_0x5a6edf[_0x1238('0x23')],'include':_0x5a6edf[_0x1238('0x20')]?_[_0x1238('0x22')](_0x5a6edf['include'],function(_0xb7ec96){return{'model':db[_0xb7ec96[_0x1238('0x21')]],'as':_0xb7ec96['as'],'attributes':_0xb7ec96['attributes'],'include':_0xb7ec96[_0x1238('0x20')]?_[_0x1238('0x22')](_0xb7ec96['include'],function(_0xddfa66){return{'model':db[_0xddfa66[_0x1238('0x21')]],'as':_0xddfa66['as'],'attributes':_0xddfa66['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ecdd7){logger['info']('ShowVoiceQueue',_0x53995f);logger['debug']('ShowVoiceQueue',_0x53995f,JSON['stringify'](_0x2ecdd7));_0x42bd06(_0x2ecdd7);})[_0x1238('0x1a')](function(_0x5df554){logger[_0x1238('0x15')](_0x1238('0x25'),_0x5df554[_0x1238('0x18')],_0x53995f);_0x359d4c(_0x55957d[_0x1238('0x15')](0x1f4,_0x5df554[_0x1238('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7d6cd8b..2b1f94a 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 _0x7f30=['emit','removeListener','register','voiceQueue:','save','remove','update'];(function(_0x32efcb,_0x55523f){var _0x1dae88=function(_0x11c606){while(--_0x11c606){_0x32efcb['push'](_0x32efcb['shift']());}};_0x1dae88(++_0x55523f);}(_0x7f30,0x1d2));var _0x07f3=function(_0x428ba5,_0x36585a){_0x428ba5=_0x428ba5-0x0;var _0x262af7=_0x7f30[_0x428ba5];return _0x262af7;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x07f3('0x0'),_0x07f3('0x1'),_0x07f3('0x2')];function createListener(_0x4c8e15,_0x47a671){return function(_0x210017){_0x47a671[_0x07f3('0x3')](_0x4c8e15,_0x210017);};}function removeListener(_0x3289ff,_0x9b334a){return function(){VoiceQueueEvents[_0x07f3('0x4')](_0x3289ff,_0x9b334a);};}exports[_0x07f3('0x5')]=function(_0xb02014){for(var _0x4506b6=0x0,_0x26ef81=events['length'];_0x4506b6<_0x26ef81;_0x4506b6++){var _0x47f575=events[_0x4506b6];var _0x53c017=createListener(_0x07f3('0x6')+_0x47f575,_0xb02014);VoiceQueueEvents['on'](_0x47f575,_0x53c017);}}; \ No newline at end of file +var _0x3771=['save','remove','update','register','length','voiceQueue:'];(function(_0x36187f,_0x1db304){var _0x373dcd=function(_0x308ebc){while(--_0x308ebc){_0x36187f['push'](_0x36187f['shift']());}};_0x373dcd(++_0x1db304);}(_0x3771,0x1d4));var _0x1377=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x3771[_0xf50820];return _0x2a9b10;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x1377('0x0'),_0x1377('0x1'),_0x1377('0x2')];function createListener(_0x351da5,_0x194125){return function(_0x3b5dea){_0x194125['emit'](_0x351da5,_0x3b5dea);};}function removeListener(_0x5640c5,_0x15fb9c){return function(){VoiceQueueEvents['removeListener'](_0x5640c5,_0x15fb9c);};}exports[_0x1377('0x3')]=function(_0x225f49){for(var _0x2ca02c=0x0,_0x248b11=events[_0x1377('0x4')];_0x2ca02c<_0x248b11;_0x2ca02c++){var _0x52a6cb=events[_0x2ca02c];var _0x93bd6f=createListener(_0x1377('0x5')+_0x52a6cb,_0x225f49);VoiceQueueEvents['on'](_0x52a6cb,_0x93bd6f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index b3b020a..6fec979 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 _0x9b42=['show','post','create','put','update','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','get','/:id'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9b42,0x156));var _0x29b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9b42[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x29b4('0x0'));var util=require(_0x29b4('0x1'));var path=require(_0x29b4('0x2'));var timeout=require('connect-timeout');var express=require(_0x29b4('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x29b4('0x4'));var interaction=require(_0x29b4('0x5'));var config=require(_0x29b4('0x6'));var controller=require(_0x29b4('0x7'));router['get']('/',auth[_0x29b4('0x8')](),controller[_0x29b4('0x9')]);router['get'](_0x29b4('0xa'),auth[_0x29b4('0x8')](),controller['describe']);router['get'](_0x29b4('0xb'),auth[_0x29b4('0x8')](),controller[_0x29b4('0xc')]);router[_0x29b4('0xd')](_0x29b4('0xe'),auth[_0x29b4('0x8')](),controller[_0x29b4('0xf')]);router[_0x29b4('0x10')]('/',auth['isAuthenticated'](),controller[_0x29b4('0x11')]);router[_0x29b4('0x12')](_0x29b4('0xe'),auth[_0x29b4('0x8')](),controller[_0x29b4('0x13')]);router['delete'](_0x29b4('0xe'),auth[_0x29b4('0x8')](),controller[_0x29b4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xcdd8=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','/:id','update','delete','multer','path','express'];(function(_0x120bce,_0x4cf698){var _0x3c65dd=function(_0x62df12){while(--_0x62df12){_0x120bce['push'](_0x120bce['shift']());}};_0x3c65dd(++_0x4cf698);}(_0xcdd8,0xd9));var _0x8cdd=function(_0xb28d5d,_0xe27fa1){_0xb28d5d=_0xb28d5d-0x0;var _0x34b087=_0xcdd8[_0xb28d5d];return _0x34b087;};'use strict';var multer=require(_0x8cdd('0x0'));var util=require('util');var path=require(_0x8cdd('0x1'));var timeout=require('connect-timeout');var express=require(_0x8cdd('0x2'));var router=express['Router']();var fs_extra=require(_0x8cdd('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8cdd('0x4'));var config=require(_0x8cdd('0x5'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth[_0x8cdd('0x6')](),controller[_0x8cdd('0x7')]);router[_0x8cdd('0x8')](_0x8cdd('0x9'),auth['isAuthenticated'](),controller[_0x8cdd('0xa')]);router['get'](_0x8cdd('0xb'),auth[_0x8cdd('0x6')](),controller[_0x8cdd('0xc')]);router[_0x8cdd('0x8')]('/:id',auth[_0x8cdd('0x6')](),controller[_0x8cdd('0xd')]);router[_0x8cdd('0xe')]('/',auth['isAuthenticated'](),controller[_0x8cdd('0xf')]);router[_0x8cdd('0x10')](_0x8cdd('0x11'),auth[_0x8cdd('0x6')](),controller[_0x8cdd('0x12')]);router[_0x8cdd('0x13')](_0x8cdd('0x11'),auth[_0x8cdd('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index b5e9cd8..0144c9f 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 _0xc84c=['INTEGER','DATE','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','holdtime'];(function(_0x20effb,_0xad39fd){var _0x4e9dd2=function(_0x4048e3){while(--_0x4048e3){_0x20effb['push'](_0x20effb['shift']());}};_0x4e9dd2(++_0xad39fd);}(_0xc84c,0x1ef));var _0xcc84=function(_0x35f4f6,_0x29131d){_0x35f4f6=_0x35f4f6-0x0;var _0x516d9f=_0xc84c[_0x35f4f6];return _0x516d9f;};'use strict';var Sequelize=require(_0xcc84('0x0'));var moment=require(_0xcc84('0x1'));module[_0xcc84('0x2')]={'type':{'type':Sequelize[_0xcc84('0x3')]},'uniqueid':{'type':Sequelize[_0xcc84('0x3')]},'calleridnum':{'type':Sequelize[_0xcc84('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xcc84('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x6c7189){var _0x184421=moment(_0x6c7189);var _0x38fde8=moment(this['getDataValue'](_0xcc84('0x4')))['format'](_0xcc84('0x5'));var _0x6c55d=_0x184421['diff'](_0x38fde8,'seconds');this[_0xcc84('0x6')](_0xcc84('0x7'),_0x6c7189);this[_0xcc84('0x6')](_0xcc84('0x8'),_0x6c55d||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xcc84('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xcc84('0xa')]},'queuecallercomplete':{'type':Sequelize[_0xcc84('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xcc84('0xa')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xcc84('0xa')]},'queuecallerexitreason':{'type':Sequelize[_0xcc84('0x3')],'comment':_0xcc84('0xc')},'originalposition':{'type':Sequelize[_0xcc84('0x9')]},'channel':{'type':Sequelize[_0xcc84('0x3')]},'connectedlinenum':{'type':Sequelize[_0xcc84('0x3')]},'connectedlinename':{'type':Sequelize[_0xcc84('0x3')]},'accountcode':{'type':Sequelize[_0xcc84('0x3')]},'context':{'type':Sequelize[_0xcc84('0x3')]},'exten':{'type':Sequelize[_0xcc84('0x3')]},'priority':{'type':Sequelize[_0xcc84('0x3')]},'holdtime':{'type':Sequelize[_0xcc84('0x9')]},'mohtime':{'type':Sequelize[_0xcc84('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xcc84('0x3')]},'transfer':{'type':Sequelize[_0xcc84('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xcc84('0x3')],'comment':_0xcc84('0xd')},'transferexten':{'type':Sequelize[_0xcc84('0x3')]},'transferuniqueid':{'type':Sequelize[_0xcc84('0x3')]},'disposition':{'type':Sequelize[_0xcc84('0x3')]},'secondDisposition':{'type':Sequelize[_0xcc84('0x3')]},'thirdDisposition':{'type':Sequelize[_0xcc84('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xcc84('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe8c5=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment'];(function(_0x304c6b,_0x204f45){var _0x4ce340=function(_0x5dbd5e){while(--_0x5dbd5e){_0x304c6b['push'](_0x304c6b['shift']());}};_0x4ce340(++_0x204f45);}(_0xe8c5,0x110));var _0x5e8c=function(_0x273dcd,_0x511b91){_0x273dcd=_0x273dcd-0x0;var _0x1e82e5=_0xe8c5[_0x273dcd];return _0x1e82e5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5e8c('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5e8c('0x1')]},'calleridnum':{'type':Sequelize[_0x5e8c('0x1')]},'calleridname':{'type':Sequelize[_0x5e8c('0x1')]},'queue':{'type':Sequelize[_0x5e8c('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x5e8c('0x2')],'set':function(_0x6e577b){var _0x3a7468=moment(_0x6e577b);var _0x4b25ff=moment(this[_0x5e8c('0x3')](_0x5e8c('0x4')))[_0x5e8c('0x5')](_0x5e8c('0x6'));var _0x1269dc=_0x3a7468[_0x5e8c('0x7')](_0x4b25ff,'seconds');this['setDataValue']('queuecallerleaveAt',_0x6e577b);this[_0x5e8c('0x8')](_0x5e8c('0x9'),_0x1269dc||null);}},'position':{'type':Sequelize[_0x5e8c('0xa')]},'count':{'type':Sequelize[_0x5e8c('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x5e8c('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5e8c('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x5e8c('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5e8c('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5e8c('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x5e8c('0x1')],'comment':_0x5e8c('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x5e8c('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5e8c('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5e8c('0x1')]},'context':{'type':Sequelize[_0x5e8c('0x1')]},'exten':{'type':Sequelize[_0x5e8c('0x1')]},'priority':{'type':Sequelize[_0x5e8c('0x1')]},'holdtime':{'type':Sequelize[_0x5e8c('0xa')]},'mohtime':{'type':Sequelize[_0x5e8c('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x5e8c('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5e8c('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5e8c('0x1')]},'secondDisposition':{'type':Sequelize[_0x5e8c('0x1')]},'thirdDisposition':{'type':Sequelize[_0x5e8c('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x5e8c('0xa')],'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 cfd8ca0..3ebb309 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 _0xe26f=['../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','find','create','body','params','destroy','describe','options','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','desk.js','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe26f,0xe8));var _0xfe26=function(_0x410b0a,_0x5865e4){_0x410b0a=_0x410b0a-0x0;var _0x4a60c4=_0xe26f[_0x410b0a];return _0x4a60c4;};'use strict';var emlformat=require(_0xfe26('0x0'));var rimraf=require(_0xfe26('0x1'));var zipdir=require(_0xfe26('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe26('0x3'));var moment=require(_0xfe26('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe26('0x5'));var util=require(_0xfe26('0x6'));var path=require('path');var sox=require(_0xfe26('0x7'));var csv=require(_0xfe26('0x8'));var ejs=require(_0xfe26('0x9'));var fs=require('fs');var fs_extra=require(_0xfe26('0xa'));var _=require('lodash');var squel=require(_0xfe26('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe26('0xc'));var toCsv=require(_0xfe26('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe26('0xd'));var authService=require(_0xfe26('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe26('0xf'))(_0xfe26('0x10'));var utils=require(_0xfe26('0x11'));var config=require(_0xfe26('0x12'));var licenseUtil=require(_0xfe26('0x13'));var db=require(_0xfe26('0x14'))['db'];config[_0xfe26('0x15')]=_['defaults'](config[_0xfe26('0x15')],{'host':_0xfe26('0x16'),'port':0x18eb});var socket=require(_0xfe26('0x17'))(new Redis(config['redis']));require(_0xfe26('0x18'))[_0xfe26('0x19')](socket);function respondWithStatusCode(_0x4cb110,_0x5bf334){_0x5bf334=_0x5bf334||0xcc;return function(_0x2a684b){if(_0x2a684b){return _0x4cb110['sendStatus'](_0x5bf334);}return _0x4cb110[_0xfe26('0x1a')](_0x5bf334)[_0xfe26('0x1b')]();};}function respondWithResult(_0x3d69f6,_0x559f08){_0x559f08=_0x559f08||0xc8;return function(_0x1a82e9){if(_0x1a82e9){return _0x3d69f6[_0xfe26('0x1a')](_0x559f08)[_0xfe26('0x1c')](_0x1a82e9);}};}function respondWithFilteredResult(_0x33c9b9,_0x125ccb){return function(_0x57f736){if(_0x57f736){var _0xc68fa0=typeof _0x125ccb[_0xfe26('0x1d')]===_0xfe26('0x1e')&&typeof _0x125ccb['limit']===_0xfe26('0x1e');var _0x440dbe=_0x57f736[_0xfe26('0x1f')];var _0x43dd11=_0xc68fa0?0x0:_0x125ccb['offset'];var _0x56d8bb=_0xc68fa0?_0x57f736[_0xfe26('0x1f')]:_0x125ccb[_0xfe26('0x1d')]+_0x125ccb[_0xfe26('0x20')];var _0x2c5e36;if(_0x56d8bb>=_0x440dbe){_0x56d8bb=_0x440dbe;_0x2c5e36=0xc8;}else{_0x2c5e36=0xce;}_0x33c9b9['status'](_0x2c5e36);return _0x33c9b9[_0xfe26('0x21')](_0xfe26('0x22'),_0x43dd11+'-'+_0x56d8bb+'/'+_0x440dbe)[_0xfe26('0x1c')](_0x57f736);}return null;};}function patchUpdates(_0x238c54){return function(_0x69a6b7){try{jsonpatch['apply'](_0x69a6b7,_0x238c54,!![]);}catch(_0x2221c4){return BPromise[_0xfe26('0x23')](_0x2221c4);}return _0x69a6b7[_0xfe26('0x24')]();};}function saveUpdates(_0x20fdf1,_0x3d6896){return function(_0x29189f){if(_0x29189f){return _0x29189f[_0xfe26('0x25')](_0x20fdf1)[_0xfe26('0x26')](function(_0x5acc28){return _0x5acc28;});}return null;};}function removeEntity(_0x10e755,_0x1e0e6a){return function(_0x5555b7){if(_0x5555b7){return _0x5555b7['destroy']()[_0xfe26('0x26')](function(){_0x10e755['status'](0xcc)[_0xfe26('0x1b')]();});}};}function handleEntityNotFound(_0x217a99,_0x39ebf9){return function(_0x1a3eaa){if(!_0x1a3eaa){_0x217a99[_0xfe26('0x27')](0x194);}return _0x1a3eaa;};}function handleError(_0x1e201c,_0x53b6ae){_0x53b6ae=_0x53b6ae||0x1f4;return function(_0x238f83){logger[_0xfe26('0x28')](_0x238f83[_0xfe26('0x29')]);if(_0x238f83[_0xfe26('0x2a')]){delete _0x238f83[_0xfe26('0x2a')];}_0x1e201c[_0xfe26('0x1a')](_0x53b6ae)[_0xfe26('0x2b')](_0x238f83);};}exports[_0xfe26('0x2c')]=function(_0x4b814c,_0x355c6a){var _0x4d0b03={},_0x19473c={},_0x357089={'count':0x0,'rows':[]};var _0x1e9183=_[_0xfe26('0x2d')](db[_0xfe26('0x2e')][_0xfe26('0x2f')],function(_0x3e2cf8){return{'name':_0x3e2cf8[_0xfe26('0x30')],'type':_0x3e2cf8[_0xfe26('0x31')][_0xfe26('0x32')]};});_0x19473c[_0xfe26('0x33')]=_[_0xfe26('0x2d')](_0x1e9183,_0xfe26('0x2a'));_0x19473c[_0xfe26('0x34')]=_[_0xfe26('0x35')](_0x4b814c[_0xfe26('0x34')]);_0x19473c[_0xfe26('0x36')]=_[_0xfe26('0x37')](_0x19473c[_0xfe26('0x33')],_0x19473c[_0xfe26('0x34')]);_0x4d0b03['attributes']=_[_0xfe26('0x37')](_0x19473c[_0xfe26('0x33')],qs[_0xfe26('0x38')](_0x4b814c[_0xfe26('0x34')][_0xfe26('0x38')]));_0x4d0b03[_0xfe26('0x39')]=_0x4d0b03[_0xfe26('0x39')][_0xfe26('0x3a')]?_0x4d0b03[_0xfe26('0x39')]:_0x19473c[_0xfe26('0x33')];if(!_0x4b814c[_0xfe26('0x34')][_0xfe26('0x3b')](_0xfe26('0x3c'))){_0x4d0b03[_0xfe26('0x20')]=qs[_0xfe26('0x20')](_0x4b814c[_0xfe26('0x34')][_0xfe26('0x20')]);_0x4d0b03[_0xfe26('0x1d')]=qs[_0xfe26('0x1d')](_0x4b814c['query'][_0xfe26('0x1d')]);}_0x4d0b03[_0xfe26('0x3d')]=qs[_0xfe26('0x3e')](_0x4b814c[_0xfe26('0x34')]['sort']);_0x4d0b03[_0xfe26('0x3f')]=qs[_0xfe26('0x36')](_[_0xfe26('0x40')](_0x4b814c[_0xfe26('0x34')],_0x19473c['filters']),_0x1e9183);if(_0x4b814c[_0xfe26('0x34')]['filter']){_0x4d0b03[_0xfe26('0x3f')]=_[_0xfe26('0x41')](_0x4d0b03[_0xfe26('0x3f')],{'$or':_[_0xfe26('0x2d')](_0x1e9183,function(_0x532a98){if(_0x532a98[_0xfe26('0x31')]!==_0xfe26('0x42')){var _0x171b3b={};_0x171b3b[_0x532a98[_0xfe26('0x2a')]]={'$like':'%'+_0x4b814c['query'][_0xfe26('0x43')]+'%'};return _0x171b3b;}})});}_0x4d0b03=_['merge']({},_0x4d0b03,_0x4b814c['options']);var _0x52c6a6={'where':_0x4d0b03[_0xfe26('0x3f')]};return db[_0xfe26('0x2e')][_0xfe26('0x1f')](_0x52c6a6)['then'](function(_0x3cfd0b){_0x357089[_0xfe26('0x1f')]=_0x3cfd0b;if(_0x4b814c[_0xfe26('0x34')][_0xfe26('0x44')]){_0x4d0b03['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x4d0b03);})['then'](function(_0x584c84){_0x357089[_0xfe26('0x45')]=_0x584c84;return _0x357089;})['then'](respondWithFilteredResult(_0x355c6a,_0x4d0b03))[_0xfe26('0x46')](handleError(_0x355c6a,null));};exports[_0xfe26('0x47')]=function(_0x428014,_0x4b433a){var _0x384320={'raw':![],'where':{'id':_0x428014['params']['id']}},_0x4c3583={};_0x4c3583[_0xfe26('0x33')]=_[_0xfe26('0x35')](db[_0xfe26('0x2e')][_0xfe26('0x2f')]);_0x4c3583[_0xfe26('0x34')]=_[_0xfe26('0x35')](_0x428014['query']);_0x4c3583[_0xfe26('0x36')]=_['intersection'](_0x4c3583[_0xfe26('0x33')],_0x4c3583['query']);_0x384320[_0xfe26('0x39')]=_[_0xfe26('0x37')](_0x4c3583[_0xfe26('0x33')],qs[_0xfe26('0x38')](_0x428014['query']['fields']));_0x384320['attributes']=_0x384320[_0xfe26('0x39')][_0xfe26('0x3a')]?_0x384320[_0xfe26('0x39')]:_0x4c3583[_0xfe26('0x33')];if(_0x428014['query']['includeAll']){_0x384320[_0xfe26('0x48')]=[{'all':!![]}];}_0x384320=_[_0xfe26('0x41')]({},_0x384320,_0x428014['options']);return db['VoiceQueueReport'][_0xfe26('0x49')](_0x384320)[_0xfe26('0x26')](handleEntityNotFound(_0x4b433a,null))[_0xfe26('0x26')](respondWithResult(_0x4b433a,null))[_0xfe26('0x46')](handleError(_0x4b433a,null));};exports['create']=function(_0x56019d,_0x5f55a5){return db[_0xfe26('0x2e')][_0xfe26('0x4a')](_0x56019d['body'],{})[_0xfe26('0x26')](respondWithResult(_0x5f55a5,0xc9))[_0xfe26('0x46')](handleError(_0x5f55a5,null));};exports[_0xfe26('0x25')]=function(_0x5ab726,_0x34b21e){if(_0x5ab726[_0xfe26('0x4b')]['id']){delete _0x5ab726[_0xfe26('0x4b')]['id'];}return db[_0xfe26('0x2e')][_0xfe26('0x49')]({'where':{'id':_0x5ab726[_0xfe26('0x4c')]['id']}})[_0xfe26('0x26')](handleEntityNotFound(_0x34b21e,null))['then'](saveUpdates(_0x5ab726[_0xfe26('0x4b')],null))[_0xfe26('0x26')](respondWithResult(_0x34b21e,null))[_0xfe26('0x46')](handleError(_0x34b21e,null));};exports[_0xfe26('0x4d')]=function(_0x288780,_0x167e4b){return db[_0xfe26('0x2e')][_0xfe26('0x49')]({'where':{'id':_0x288780[_0xfe26('0x4c')]['id']}})[_0xfe26('0x26')](handleEntityNotFound(_0x167e4b,null))[_0xfe26('0x26')](removeEntity(_0x167e4b,null))['catch'](handleError(_0x167e4b,null));};exports[_0xfe26('0x4e')]=function(_0x401d35,_0x1b8e17){return db[_0xfe26('0x2e')][_0xfe26('0x4e')]()['then'](respondWithResult(_0x1b8e17,null))[_0xfe26('0x46')](handleError(_0x1b8e17,null));};exports['getVoiceQueuesReport']=function(_0x1a020f,_0xc07545){var _0x37e0dc={},_0x1e0a6d={},_0x4e5461={'count':0x0,'rows':[]};_0x1e0a6d[_0xfe26('0x33')]=_[_0xfe26('0x35')](db['VoiceQueueReport'][_0xfe26('0x2f')]);_0x1e0a6d[_0xfe26('0x34')]=_[_0xfe26('0x35')](_0x1a020f[_0xfe26('0x34')]);_0x1e0a6d[_0xfe26('0x36')]=_[_0xfe26('0x37')](_0x1e0a6d['model'],_0x1e0a6d[_0xfe26('0x34')]);_0x37e0dc[_0xfe26('0x39')]=_[_0xfe26('0x37')](_0x1e0a6d[_0xfe26('0x33')],qs[_0xfe26('0x38')](_0x1a020f['query'][_0xfe26('0x38')]));_0x37e0dc['attributes']=_0x37e0dc[_0xfe26('0x39')]['length']?_0x37e0dc[_0xfe26('0x39')]:_0x1e0a6d['model'];if(!_0x1a020f[_0xfe26('0x34')][_0xfe26('0x3b')](_0xfe26('0x3c'))){_0x37e0dc[_0xfe26('0x20')]=qs['limit'](_0x1a020f['query'][_0xfe26('0x20')]);_0x37e0dc[_0xfe26('0x1d')]=qs[_0xfe26('0x1d')](_0x1a020f[_0xfe26('0x34')][_0xfe26('0x1d')]);}_0x37e0dc[_0xfe26('0x3d')]=qs[_0xfe26('0x3e')](_0x1a020f['query']['sort']);_0x37e0dc[_0xfe26('0x3f')]=qs['filters'](_[_0xfe26('0x40')](_0x1a020f[_0xfe26('0x34')],_0x1e0a6d[_0xfe26('0x36')]));if(_0x1a020f[_0xfe26('0x34')][_0xfe26('0x43')]){_0x37e0dc[_0xfe26('0x3f')]=_[_0xfe26('0x41')](_0x37e0dc[_0xfe26('0x3f')],{'$or':_[_0xfe26('0x2d')](_0x37e0dc[_0xfe26('0x39')],function(_0x562f2e){var _0x46528b={};_0x46528b[_0x562f2e]={'$like':'%'+_0x1a020f['query'][_0xfe26('0x43')]+'%'};return _0x46528b;})});}_0x37e0dc=_[_0xfe26('0x41')]({},_0x37e0dc,_0x1a020f[_0xfe26('0x4f')]);var _0x462861={'where':_0x37e0dc[_0xfe26('0x3f')]};return db[_0xfe26('0x2e')][_0xfe26('0x1f')](_0x462861)[_0xfe26('0x26')](function(_0x52260d){_0x4e5461[_0xfe26('0x1f')]=_0x52260d;if(_0x1a020f[_0xfe26('0x34')][_0xfe26('0x44')]){_0x37e0dc[_0xfe26('0x48')]=[{'all':!![]}];}return db[_0xfe26('0x2e')][_0xfe26('0x50')](_0x37e0dc);})[_0xfe26('0x26')](function(_0x3a52a6){_0x4e5461[_0xfe26('0x45')]=_0x3a52a6;return _0x4e5461;})['then'](respondWithFilteredResult(_0xc07545,_0x37e0dc,_0xfe26('0x51')))[_0xfe26('0x46')](handleError(_0xc07545,null,_0xfe26('0x51')));}; \ No newline at end of file +var _0x5a3b=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','VoiceQueueReport','findAll','rows','find','catch','create','body','update','params','describe','getVoiceQueuesReport','eml-format','rimraf','request-promise','moment','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','map','keys','query','intersection','model'];(function(_0x189c84,_0x2ab024){var _0x196a7e=function(_0x320e50){while(--_0x320e50){_0x189c84['push'](_0x189c84['shift']());}};_0x196a7e(++_0x2ab024);}(_0x5a3b,0x158));var _0xb5a3=function(_0x5b9738,_0x464160){_0x5b9738=_0x5b9738-0x0;var _0x50bf04=_0x5a3b[_0x5b9738];return _0x50bf04;};'use strict';var emlformat=require(_0xb5a3('0x0'));var rimraf=require(_0xb5a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb5a3('0x2'));var moment=require(_0xb5a3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb5a3('0x4'));var path=require(_0xb5a3('0x5'));var sox=require(_0xb5a3('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5a3('0x7'));var _=require('lodash');var squel=require(_0xb5a3('0x8'));var crypto=require(_0xb5a3('0x9'));var jsforce=require(_0xb5a3('0xa'));var deskjs=require(_0xb5a3('0xb'));var toCsv=require(_0xb5a3('0xc'));var querystring=require('querystring');var Papa=require(_0xb5a3('0xd'));var Redis=require(_0xb5a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb5a3('0xf'));var as=require(_0xb5a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5a3('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xb5a3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5a3('0x13'))['db'];config['redis']=_[_0xb5a3('0x14')](config[_0xb5a3('0x15')],{'host':_0xb5a3('0x16'),'port':0x18eb});var socket=require(_0xb5a3('0x17'))(new Redis(config[_0xb5a3('0x15')]));require(_0xb5a3('0x18'))[_0xb5a3('0x19')](socket);function respondWithStatusCode(_0x11bf0c,_0x3d65dc){_0x3d65dc=_0x3d65dc||0xcc;return function(_0x3da910){if(_0x3da910){return _0x11bf0c['sendStatus'](_0x3d65dc);}return _0x11bf0c[_0xb5a3('0x1a')](_0x3d65dc)[_0xb5a3('0x1b')]();};}function respondWithResult(_0x19d0dd,_0x376fdd){_0x376fdd=_0x376fdd||0xc8;return function(_0x321d67){if(_0x321d67){return _0x19d0dd['status'](_0x376fdd)[_0xb5a3('0x1c')](_0x321d67);}};}function respondWithFilteredResult(_0x35f824,_0x20d311){return function(_0x494a8d){if(_0x494a8d){var _0x2422f6=typeof _0x20d311[_0xb5a3('0x1d')]===_0xb5a3('0x1e')&&typeof _0x20d311[_0xb5a3('0x1f')]===_0xb5a3('0x1e');var _0x3d3e85=_0x494a8d[_0xb5a3('0x20')];var _0x2f517e=_0x2422f6?0x0:_0x20d311[_0xb5a3('0x1d')];var _0x422db8=_0x2422f6?_0x494a8d[_0xb5a3('0x20')]:_0x20d311[_0xb5a3('0x1d')]+_0x20d311[_0xb5a3('0x1f')];var _0x2becae;if(_0x422db8>=_0x3d3e85){_0x422db8=_0x3d3e85;_0x2becae=0xc8;}else{_0x2becae=0xce;}_0x35f824[_0xb5a3('0x1a')](_0x2becae);return _0x35f824[_0xb5a3('0x21')]('Content-Range',_0x2f517e+'-'+_0x422db8+'/'+_0x3d3e85)['json'](_0x494a8d);}return null;};}function patchUpdates(_0x49d745){return function(_0x37e375){try{jsonpatch[_0xb5a3('0x22')](_0x37e375,_0x49d745,!![]);}catch(_0x439eb9){return BPromise[_0xb5a3('0x23')](_0x439eb9);}return _0x37e375['save']();};}function saveUpdates(_0x18e6a4,_0x4995e9){return function(_0x22372f){if(_0x22372f){return _0x22372f['update'](_0x18e6a4)['then'](function(_0x1497c7){return _0x1497c7;});}return null;};}function removeEntity(_0x5037a3,_0x32e72f){return function(_0x52786a){if(_0x52786a){return _0x52786a[_0xb5a3('0x24')]()['then'](function(){_0x5037a3[_0xb5a3('0x1a')](0xcc)[_0xb5a3('0x1b')]();});}};}function handleEntityNotFound(_0x5135c7,_0x21028a){return function(_0x4cd583){if(!_0x4cd583){_0x5135c7[_0xb5a3('0x25')](0x194);}return _0x4cd583;};}function handleError(_0x19c45a,_0x399110){_0x399110=_0x399110||0x1f4;return function(_0x20d07b){logger[_0xb5a3('0x26')](_0x20d07b[_0xb5a3('0x27')]);if(_0x20d07b[_0xb5a3('0x28')]){delete _0x20d07b[_0xb5a3('0x28')];}_0x19c45a[_0xb5a3('0x1a')](_0x399110)['send'](_0x20d07b);};}exports[_0xb5a3('0x29')]=function(_0xc6e63b,_0x1ec8cd){var _0x4e831a={},_0x29152f={},_0x1dac41={'count':0x0,'rows':[]};var _0x1b2667=_['map'](db['VoiceQueueReport'][_0xb5a3('0x2a')],function(_0x4377cd){return{'name':_0x4377cd[_0xb5a3('0x2b')],'type':_0x4377cd[_0xb5a3('0x2c')][_0xb5a3('0x2d')]};});_0x29152f['model']=_[_0xb5a3('0x2e')](_0x1b2667,_0xb5a3('0x28'));_0x29152f['query']=_[_0xb5a3('0x2f')](_0xc6e63b[_0xb5a3('0x30')]);_0x29152f['filters']=_[_0xb5a3('0x31')](_0x29152f[_0xb5a3('0x32')],_0x29152f['query']);_0x4e831a[_0xb5a3('0x33')]=_['intersection'](_0x29152f[_0xb5a3('0x32')],qs[_0xb5a3('0x34')](_0xc6e63b[_0xb5a3('0x30')][_0xb5a3('0x34')]));_0x4e831a[_0xb5a3('0x33')]=_0x4e831a[_0xb5a3('0x33')][_0xb5a3('0x35')]?_0x4e831a[_0xb5a3('0x33')]:_0x29152f[_0xb5a3('0x32')];if(!_0xc6e63b[_0xb5a3('0x30')][_0xb5a3('0x36')](_0xb5a3('0x37'))){_0x4e831a[_0xb5a3('0x1f')]=qs[_0xb5a3('0x1f')](_0xc6e63b['query'][_0xb5a3('0x1f')]);_0x4e831a[_0xb5a3('0x1d')]=qs['offset'](_0xc6e63b[_0xb5a3('0x30')][_0xb5a3('0x1d')]);}_0x4e831a[_0xb5a3('0x38')]=qs[_0xb5a3('0x39')](_0xc6e63b[_0xb5a3('0x30')][_0xb5a3('0x39')]);_0x4e831a[_0xb5a3('0x3a')]=qs[_0xb5a3('0x3b')](_[_0xb5a3('0x3c')](_0xc6e63b[_0xb5a3('0x30')],_0x29152f['filters']),_0x1b2667);if(_0xc6e63b['query'][_0xb5a3('0x3d')]){_0x4e831a['where']=_[_0xb5a3('0x3e')](_0x4e831a[_0xb5a3('0x3a')],{'$or':_['map'](_0x1b2667,function(_0x4b5909){if(_0x4b5909[_0xb5a3('0x2c')]!==_0xb5a3('0x3f')){var _0x6ccd56={};_0x6ccd56[_0x4b5909[_0xb5a3('0x28')]]={'$like':'%'+_0xc6e63b[_0xb5a3('0x30')]['filter']+'%'};return _0x6ccd56;}})});}_0x4e831a=_[_0xb5a3('0x3e')]({},_0x4e831a,_0xc6e63b[_0xb5a3('0x40')]);var _0x347cd0={'where':_0x4e831a[_0xb5a3('0x3a')]};return db['VoiceQueueReport'][_0xb5a3('0x20')](_0x347cd0)[_0xb5a3('0x41')](function(_0x49371e){_0x1dac41[_0xb5a3('0x20')]=_0x49371e;if(_0xc6e63b[_0xb5a3('0x30')][_0xb5a3('0x42')]){_0x4e831a[_0xb5a3('0x43')]=[{'all':!![]}];}return db[_0xb5a3('0x44')][_0xb5a3('0x45')](_0x4e831a);})['then'](function(_0x5c3405){_0x1dac41[_0xb5a3('0x46')]=_0x5c3405;return _0x1dac41;})[_0xb5a3('0x41')](respondWithFilteredResult(_0x1ec8cd,_0x4e831a))['catch'](handleError(_0x1ec8cd,null));};exports['show']=function(_0x171812,_0x21759f){var _0x415864={'raw':![],'where':{'id':_0x171812['params']['id']}},_0x45b672={};_0x45b672[_0xb5a3('0x32')]=_['keys'](db['VoiceQueueReport'][_0xb5a3('0x2a')]);_0x45b672[_0xb5a3('0x30')]=_['keys'](_0x171812[_0xb5a3('0x30')]);_0x45b672[_0xb5a3('0x3b')]=_['intersection'](_0x45b672[_0xb5a3('0x32')],_0x45b672[_0xb5a3('0x30')]);_0x415864['attributes']=_['intersection'](_0x45b672[_0xb5a3('0x32')],qs['fields'](_0x171812['query'][_0xb5a3('0x34')]));_0x415864[_0xb5a3('0x33')]=_0x415864[_0xb5a3('0x33')]['length']?_0x415864['attributes']:_0x45b672[_0xb5a3('0x32')];if(_0x171812[_0xb5a3('0x30')][_0xb5a3('0x42')]){_0x415864[_0xb5a3('0x43')]=[{'all':!![]}];}_0x415864=_[_0xb5a3('0x3e')]({},_0x415864,_0x171812[_0xb5a3('0x40')]);return db['VoiceQueueReport'][_0xb5a3('0x47')](_0x415864)['then'](handleEntityNotFound(_0x21759f,null))[_0xb5a3('0x41')](respondWithResult(_0x21759f,null))[_0xb5a3('0x48')](handleError(_0x21759f,null));};exports[_0xb5a3('0x49')]=function(_0xc0605e,_0x521a47){return db[_0xb5a3('0x44')][_0xb5a3('0x49')](_0xc0605e[_0xb5a3('0x4a')],{})['then'](respondWithResult(_0x521a47,0xc9))['catch'](handleError(_0x521a47,null));};exports[_0xb5a3('0x4b')]=function(_0x5e735a,_0x55d565){if(_0x5e735a[_0xb5a3('0x4a')]['id']){delete _0x5e735a['body']['id'];}return db[_0xb5a3('0x44')][_0xb5a3('0x47')]({'where':{'id':_0x5e735a['params']['id']}})[_0xb5a3('0x41')](handleEntityNotFound(_0x55d565,null))[_0xb5a3('0x41')](saveUpdates(_0x5e735a[_0xb5a3('0x4a')],null))[_0xb5a3('0x41')](respondWithResult(_0x55d565,null))['catch'](handleError(_0x55d565,null));};exports[_0xb5a3('0x24')]=function(_0x370ab1,_0x3eb519){return db['VoiceQueueReport'][_0xb5a3('0x47')]({'where':{'id':_0x370ab1[_0xb5a3('0x4c')]['id']}})[_0xb5a3('0x41')](handleEntityNotFound(_0x3eb519,null))[_0xb5a3('0x41')](removeEntity(_0x3eb519,null))[_0xb5a3('0x48')](handleError(_0x3eb519,null));};exports[_0xb5a3('0x4d')]=function(_0x23d4ef,_0x53bf76){return db[_0xb5a3('0x44')][_0xb5a3('0x4d')]()[_0xb5a3('0x41')](respondWithResult(_0x53bf76,null))[_0xb5a3('0x48')](handleError(_0x53bf76,null));};exports['getVoiceQueuesReport']=function(_0x5dae64,_0x30264f){var _0x14b516={},_0x44f23e={},_0x5a38d7={'count':0x0,'rows':[]};_0x44f23e[_0xb5a3('0x32')]=_[_0xb5a3('0x2f')](db[_0xb5a3('0x44')][_0xb5a3('0x2a')]);_0x44f23e[_0xb5a3('0x30')]=_['keys'](_0x5dae64[_0xb5a3('0x30')]);_0x44f23e['filters']=_['intersection'](_0x44f23e['model'],_0x44f23e[_0xb5a3('0x30')]);_0x14b516[_0xb5a3('0x33')]=_[_0xb5a3('0x31')](_0x44f23e[_0xb5a3('0x32')],qs[_0xb5a3('0x34')](_0x5dae64[_0xb5a3('0x30')]['fields']));_0x14b516['attributes']=_0x14b516[_0xb5a3('0x33')][_0xb5a3('0x35')]?_0x14b516[_0xb5a3('0x33')]:_0x44f23e['model'];if(!_0x5dae64['query'][_0xb5a3('0x36')](_0xb5a3('0x37'))){_0x14b516[_0xb5a3('0x1f')]=qs[_0xb5a3('0x1f')](_0x5dae64[_0xb5a3('0x30')][_0xb5a3('0x1f')]);_0x14b516[_0xb5a3('0x1d')]=qs[_0xb5a3('0x1d')](_0x5dae64[_0xb5a3('0x30')][_0xb5a3('0x1d')]);}_0x14b516[_0xb5a3('0x38')]=qs[_0xb5a3('0x39')](_0x5dae64[_0xb5a3('0x30')][_0xb5a3('0x39')]);_0x14b516[_0xb5a3('0x3a')]=qs[_0xb5a3('0x3b')](_[_0xb5a3('0x3c')](_0x5dae64['query'],_0x44f23e[_0xb5a3('0x3b')]));if(_0x5dae64[_0xb5a3('0x30')]['filter']){_0x14b516[_0xb5a3('0x3a')]=_['merge'](_0x14b516['where'],{'$or':_[_0xb5a3('0x2e')](_0x14b516['attributes'],function(_0x25817f){var _0x8b04d1={};_0x8b04d1[_0x25817f]={'$like':'%'+_0x5dae64[_0xb5a3('0x30')][_0xb5a3('0x3d')]+'%'};return _0x8b04d1;})});}_0x14b516=_['merge']({},_0x14b516,_0x5dae64[_0xb5a3('0x40')]);var _0x495221={'where':_0x14b516['where']};return db[_0xb5a3('0x44')][_0xb5a3('0x20')](_0x495221)[_0xb5a3('0x41')](function(_0x1faece){_0x5a38d7['count']=_0x1faece;if(_0x5dae64[_0xb5a3('0x30')][_0xb5a3('0x42')]){_0x14b516[_0xb5a3('0x43')]=[{'all':!![]}];}return db[_0xb5a3('0x44')][_0xb5a3('0x45')](_0x14b516);})['then'](function(_0x56078){_0x5a38d7['rows']=_0x56078;return _0x5a38d7;})[_0xb5a3('0x41')](respondWithFilteredResult(_0x30264f,_0x14b516,_0xb5a3('0x4e')))['catch'](handleError(_0x30264f,null,_0xb5a3('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f5ee738..0a9a272 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 _0x5dee=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x5dee,0x116));var _0xe5de=function(_0x399d8b,_0x3efc33){_0x399d8b=_0x399d8b-0x0;var _0x20d7e6=_0x5dee[_0x399d8b];return _0x20d7e6;};'use strict';var EventEmitter=require(_0xe5de('0x0'));var VoiceQueueReport=require(_0xe5de('0x1'))['db'][_0xe5de('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe5de('0x3')](0x0);var events={'afterCreate':_0xe5de('0x4'),'afterUpdate':_0xe5de('0x5'),'afterDestroy':_0xe5de('0x6')};function emitEvent(_0x2c0515){return function(_0x3cc6b9,_0x36ce93,_0x24d8d8){VoiceQueueReportEvents['emit'](_0x2c0515+':'+_0x3cc6b9['id'],_0x3cc6b9);VoiceQueueReportEvents[_0xe5de('0x7')](_0x2c0515,_0x3cc6b9);_0x24d8d8(null);};}for(var e in events){if(events[_0xe5de('0x8')](e)){var event=events[e];VoiceQueueReport[_0xe5de('0x9')](e,emitEvent(event));}}module[_0xe5de('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xa6eb=['VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x4307ea,_0x56a454){var _0x7a921f=function(_0x3f721f){while(--_0x3f721f){_0x4307ea['push'](_0x4307ea['shift']());}};_0x7a921f(++_0x56a454);}(_0xa6eb,0x1af));var _0xba6e=function(_0x1604c4,_0x1696d2){_0x1604c4=_0x1604c4-0x0;var _0xe3ae19=_0xa6eb[_0x1604c4];return _0xe3ae19;};'use strict';var EventEmitter=require(_0xba6e('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xba6e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xba6e('0x2')](0x0);var events={'afterCreate':_0xba6e('0x3'),'afterUpdate':_0xba6e('0x4'),'afterDestroy':_0xba6e('0x5')};function emitEvent(_0x4211c7){return function(_0x2ce4d8,_0x1a6d04,_0x330bcd){VoiceQueueReportEvents[_0xba6e('0x6')](_0x4211c7+':'+_0x2ce4d8['id'],_0x2ce4d8);VoiceQueueReportEvents['emit'](_0x4211c7,_0x2ce4d8);_0x330bcd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xba6e('0x7')](e,emitEvent(event));}}module[_0xba6e('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 1a5be54..3bc62d0 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 _0x5b35=['exports','VoiceQueueReport','report_queue','calleridnum','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0xec04df,_0x21215a){var _0x31a23b=function(_0xf4bc36){while(--_0xf4bc36){_0xec04df['push'](_0xec04df['shift']());}};_0x31a23b(++_0x21215a);}(_0x5b35,0x164));var _0x55b3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5b35[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x55b3('0x0'));var util=require('util');var logger=require(_0x55b3('0x1'))(_0x55b3('0x2'));var moment=require(_0x55b3('0x3'));var BPromise=require(_0x55b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x55b3('0x5'));var config=require(_0x55b3('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x55b3('0x7')]=function(_0x559981,_0x475d2f){return _0x559981['define'](_0x55b3('0x8'),attributes,{'tableName':_0x55b3('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x55b3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0b4=['lodash','api','moment','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x3ac47c,_0x154c4f){var _0x278385=function(_0x240565){while(--_0x240565){_0x3ac47c['push'](_0x3ac47c['shift']());}};_0x278385(++_0x154c4f);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x3eb6f2,_0x40dd89){_0x3eb6f2=_0x3eb6f2-0x0;var _0x4cc889=_0xb0b4[_0x3eb6f2];return _0x4cc889;};'use strict';var _=require(_0x4b0b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4b0b('0x1'));var moment=require(_0x4b0b('0x2'));var BPromise=require('bluebird');var rp=require(_0x4b0b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b0b('0x4'));var config=require(_0x4b0b('0x5'));var attributes=require(_0x4b0b('0x6'));module[_0x4b0b('0x7')]=function(_0x2df812,_0x384b4d){return _0x2df812[_0x4b0b('0x8')](_0x4b0b('0x9'),attributes,{'tableName':_0x4b0b('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4b0b('0xb')]},{'fields':[_0x4b0b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index bfd7f87..05e8997 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 _0xa33a=['message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','stringify','error','VoiceQueueReport,\x20%s,\x20%s'];(function(_0xa529fb,_0xc03d24){var _0x505b4d=function(_0x375e54){while(--_0x375e54){_0xa529fb['push'](_0xa529fb['shift']());}};_0x505b4d(++_0xc03d24);}(_0xa33a,0x1d6));var _0xaa33=function(_0x2c5421,_0x152f57){_0x2c5421=_0x2c5421-0x0;var _0x54fd56=_0xa33a[_0x2c5421];return _0x54fd56;};'use strict';var _=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var moment=require(_0xaa33('0x2'));var BPromise=require(_0xaa33('0x3'));var rs=require(_0xaa33('0x4'));var fs=require('fs');var Redis=require(_0xaa33('0x5'));var db=require(_0xaa33('0x6'))['db'];var utils=require(_0xaa33('0x7'));var logger=require(_0xaa33('0x8'))(_0xaa33('0x9'));var config=require(_0xaa33('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa33('0xb')]({'port':0x232a});config[_0xaa33('0xc')]=_[_0xaa33('0xd')](config[_0xaa33('0xc')],{'host':_0xaa33('0xe'),'port':0x18eb});var socket=require(_0xaa33('0xf'))(new Redis(config['redis']));require(_0xaa33('0x10'))[_0xaa33('0x11')](socket);function respondWithRpcPromise(_0x3013cc,_0x714a76,_0x3cee20){return new BPromise(function(_0x212aa3,_0x9790cb){return client[_0xaa33('0x12')](_0x3013cc,_0x3cee20)[_0xaa33('0x13')](function(_0xe91140){logger[_0xaa33('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x714a76,'request\x20sent');logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x714a76,_0xaa33('0x15'),JSON[_0xaa33('0x16')](_0xe91140));if(_0xe91140[_0xaa33('0x17')]){if(_0xe91140[_0xaa33('0x17')]['code']===0x1f4){logger[_0xaa33('0x17')](_0xaa33('0x18'),_0x714a76,_0xe91140[_0xaa33('0x17')][_0xaa33('0x19')]);return _0x9790cb(_0xe91140[_0xaa33('0x17')][_0xaa33('0x19')]);}logger[_0xaa33('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x714a76,_0xe91140[_0xaa33('0x17')]['message']);return _0x212aa3(_0xe91140[_0xaa33('0x17')][_0xaa33('0x19')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x714a76,_0xaa33('0x15'));_0x212aa3(_0xe91140[_0xaa33('0x1a')][_0xaa33('0x19')]);}})[_0xaa33('0x1b')](function(_0x4b80c4){logger[_0xaa33('0x17')](_0xaa33('0x18'),_0x714a76,_0x4b80c4);_0x9790cb(_0x4b80c4);});});}exports[_0xaa33('0x1c')]=function(_0x2a0984){var _0x5136ab=this;return new Promise(function(_0x1db31e,_0x4e5c73){return db[_0xaa33('0x1d')][_0xaa33('0x1e')]({'raw':_0x2a0984[_0xaa33('0x1f')]?_0x2a0984[_0xaa33('0x1f')][_0xaa33('0x20')]===undefined?!![]:![]:!![],'where':_0x2a0984[_0xaa33('0x1f')]?_0x2a0984['options'][_0xaa33('0x21')]||null:null,'attributes':_0x2a0984['options']?_0x2a0984[_0xaa33('0x1f')][_0xaa33('0x22')]||null:null,'limit':_0x2a0984['options']?_0x2a0984[_0xaa33('0x1f')][_0xaa33('0x23')]||null:null,'include':_0x2a0984[_0xaa33('0x1f')]?_0x2a0984[_0xaa33('0x1f')][_0xaa33('0x24')]?_[_0xaa33('0x25')](_0x2a0984[_0xaa33('0x1f')]['include'],function(_0x268595){return{'model':db[_0x268595[_0xaa33('0x26')]],'as':_0x268595['as'],'attributes':_0x268595[_0xaa33('0x22')],'include':_0x268595[_0xaa33('0x24')]?_[_0xaa33('0x25')](_0x268595[_0xaa33('0x24')],function(_0x6c4b16){return{'model':db[_0x6c4b16['model']],'as':_0x6c4b16['as'],'attributes':_0x6c4b16['attributes'],'include':_0x6c4b16[_0xaa33('0x24')]?_[_0xaa33('0x25')](_0x6c4b16[_0xaa33('0x24')],function(_0x272ad6){return{'model':db[_0x272ad6[_0xaa33('0x26')]],'as':_0x272ad6['as'],'attributes':_0x272ad6[_0xaa33('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaa33('0x13')](function(_0x355013){logger['info'](_0xaa33('0x1c'),_0x2a0984);logger[_0xaa33('0x27')](_0xaa33('0x1c'),_0x2a0984,JSON['stringify'](_0x355013));_0x1db31e(_0x355013);})[_0xaa33('0x1b')](function(_0x580838){logger[_0xaa33('0x17')](_0xaa33('0x1c'),_0x580838[_0xaa33('0x19')],_0x2a0984);_0x4e5c73(_0x5136ab[_0xaa33('0x17')](0x1f4,_0x580838[_0xaa33('0x19')]));});});};exports[_0xaa33('0x28')]=function(_0x11abcf){var _0x523147=this;return new Promise(function(_0x84a2b,_0x56ae47){return db['VoiceQueueReport'][_0xaa33('0x29')](_0x11abcf['body'],{'raw':_0x11abcf[_0xaa33('0x1f')]?_0x11abcf[_0xaa33('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xaa33('0x13')](function(_0x551ef4){logger['info'](_0xaa33('0x28'),_0x11abcf);logger[_0xaa33('0x27')]('CreateVoiceQueueReport',_0x11abcf,JSON[_0xaa33('0x16')](_0x551ef4));_0x84a2b(_0x551ef4);})[_0xaa33('0x1b')](function(_0x3bde3a){logger['error'](_0xaa33('0x28'),_0x3bde3a[_0xaa33('0x19')],_0x11abcf);_0x56ae47(_0x523147[_0xaa33('0x17')](0x1f4,_0x3bde3a[_0xaa33('0x19')]));});});};exports[_0xaa33('0x2a')]=function(_0x4ab589){var _0x5bbee8=this;return new Promise(function(_0x594d48,_0x577674){return db['VoiceQueueReport'][_0xaa33('0x2b')](_0x4ab589[_0xaa33('0x2c')],{'raw':_0x4ab589[_0xaa33('0x1f')]?_0x4ab589[_0xaa33('0x1f')][_0xaa33('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ab589[_0xaa33('0x1f')]?_0x4ab589[_0xaa33('0x1f')][_0xaa33('0x21')]||null:null,'attributes':_0x4ab589['options']?_0x4ab589[_0xaa33('0x1f')][_0xaa33('0x22')]||null:null,'limit':_0x4ab589[_0xaa33('0x1f')]?_0x4ab589[_0xaa33('0x1f')][_0xaa33('0x23')]||null:null})[_0xaa33('0x13')](function(_0x3b019b){logger[_0xaa33('0x14')]('UpdateVoiceQueueReport',_0x4ab589);logger[_0xaa33('0x27')](_0xaa33('0x2a'),_0x4ab589,JSON['stringify'](_0x3b019b));_0x594d48(_0x3b019b);})[_0xaa33('0x1b')](function(_0x1db513){logger['error'](_0xaa33('0x2a'),_0x1db513[_0xaa33('0x19')],_0x4ab589);_0x577674(_0x5bbee8[_0xaa33('0x17')](0x1f4,_0x1db513[_0xaa33('0x19')]));});});}; \ No newline at end of file +var _0xa2ef=['register','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','attributes','limit','map','model','include','then','debug','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket'];(function(_0xebfa09,_0x51b4ce){var _0x92c679=function(_0x212065){while(--_0x212065){_0xebfa09['push'](_0xebfa09['shift']());}};_0x92c679(++_0x51b4ce);}(_0xa2ef,0x162));var _0xfa2e=function(_0x2d195c,_0x149dfe){_0x2d195c=_0x2d195c-0x0;var _0x421536=_0xa2ef[_0x2d195c];return _0x421536;};'use strict';var _=require(_0xfa2e('0x0'));var util=require(_0xfa2e('0x1'));var moment=require(_0xfa2e('0x2'));var BPromise=require('bluebird');var rs=require(_0xfa2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfa2e('0x4'))['db'];var utils=require(_0xfa2e('0x5'));var logger=require('../../config/logger')(_0xfa2e('0x6'));var config=require(_0xfa2e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfa2e('0x8')][_0xfa2e('0x9')]({'port':0x232a});config['redis']=_[_0xfa2e('0xa')](config[_0xfa2e('0xb')],{'host':_0xfa2e('0xc'),'port':0x18eb});var socket=require(_0xfa2e('0xd'))(new Redis(config[_0xfa2e('0xb')]));require(_0xfa2e('0xe'))[_0xfa2e('0xf')](socket);function respondWithRpcPromise(_0x17defb,_0x34a44a,_0x2c5fde){return new BPromise(function(_0x120572,_0x21bed4){return client['request'](_0x17defb,_0x2c5fde)['then'](function(_0x210212){logger['info'](_0xfa2e('0x10'),_0x34a44a,'request\x20sent');logger['debug'](_0xfa2e('0x11'),_0x34a44a,_0xfa2e('0x12'),JSON[_0xfa2e('0x13')](_0x210212));if(_0x210212[_0xfa2e('0x14')]){if(_0x210212[_0xfa2e('0x14')][_0xfa2e('0x15')]===0x1f4){logger[_0xfa2e('0x14')](_0xfa2e('0x10'),_0x34a44a,_0x210212[_0xfa2e('0x14')][_0xfa2e('0x16')]);return _0x21bed4(_0x210212[_0xfa2e('0x14')][_0xfa2e('0x16')]);}logger['error'](_0xfa2e('0x10'),_0x34a44a,_0x210212['error'][_0xfa2e('0x16')]);return _0x120572(_0x210212['error']['message']);}else{logger[_0xfa2e('0x17')](_0xfa2e('0x10'),_0x34a44a,'request\x20sent');_0x120572(_0x210212[_0xfa2e('0x18')][_0xfa2e('0x16')]);}})[_0xfa2e('0x19')](function(_0xe67cdf){logger[_0xfa2e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x34a44a,_0xe67cdf);_0x21bed4(_0xe67cdf);});});}exports[_0xfa2e('0x1a')]=function(_0x4ad4a8){var _0x2730aa=this;return new Promise(function(_0x1e5eb2,_0x178413){return db[_0xfa2e('0x1b')]['findAll']({'raw':_0x4ad4a8[_0xfa2e('0x1c')]?_0x4ad4a8[_0xfa2e('0x1c')][_0xfa2e('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ad4a8[_0xfa2e('0x1c')]?_0x4ad4a8[_0xfa2e('0x1c')]['where']||null:null,'attributes':_0x4ad4a8['options']?_0x4ad4a8[_0xfa2e('0x1c')][_0xfa2e('0x1e')]||null:null,'limit':_0x4ad4a8[_0xfa2e('0x1c')]?_0x4ad4a8[_0xfa2e('0x1c')][_0xfa2e('0x1f')]||null:null,'include':_0x4ad4a8[_0xfa2e('0x1c')]?_0x4ad4a8[_0xfa2e('0x1c')]['include']?_[_0xfa2e('0x20')](_0x4ad4a8[_0xfa2e('0x1c')]['include'],function(_0x17e9d6){return{'model':db[_0x17e9d6[_0xfa2e('0x21')]],'as':_0x17e9d6['as'],'attributes':_0x17e9d6[_0xfa2e('0x1e')],'include':_0x17e9d6['include']?_[_0xfa2e('0x20')](_0x17e9d6['include'],function(_0x5d76a7){return{'model':db[_0x5d76a7[_0xfa2e('0x21')]],'as':_0x5d76a7['as'],'attributes':_0x5d76a7['attributes'],'include':_0x5d76a7[_0xfa2e('0x22')]?_[_0xfa2e('0x20')](_0x5d76a7[_0xfa2e('0x22')],function(_0x56e4a1){return{'model':db[_0x56e4a1[_0xfa2e('0x21')]],'as':_0x56e4a1['as'],'attributes':_0x56e4a1[_0xfa2e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfa2e('0x23')](function(_0x55f7d1){logger[_0xfa2e('0x17')](_0xfa2e('0x1a'),_0x4ad4a8);logger[_0xfa2e('0x24')]('GetVoiceQueueReport',_0x4ad4a8,JSON[_0xfa2e('0x13')](_0x55f7d1));_0x1e5eb2(_0x55f7d1);})[_0xfa2e('0x19')](function(_0x38f10d){logger[_0xfa2e('0x14')](_0xfa2e('0x1a'),_0x38f10d[_0xfa2e('0x16')],_0x4ad4a8);_0x178413(_0x2730aa['error'](0x1f4,_0x38f10d[_0xfa2e('0x16')]));});});};exports[_0xfa2e('0x25')]=function(_0xc65157){var _0xc1e194=this;return new Promise(function(_0x53817d,_0x5a400b){return db[_0xfa2e('0x1b')]['create'](_0xc65157['body'],{'raw':_0xc65157[_0xfa2e('0x1c')]?_0xc65157['options'][_0xfa2e('0x1d')]===undefined?!![]:![]:!![]})[_0xfa2e('0x23')](function(_0x50109d){logger['info'](_0xfa2e('0x25'),_0xc65157);logger[_0xfa2e('0x24')](_0xfa2e('0x25'),_0xc65157,JSON['stringify'](_0x50109d));_0x53817d(_0x50109d);})[_0xfa2e('0x19')](function(_0x5eb07e){logger[_0xfa2e('0x14')](_0xfa2e('0x25'),_0x5eb07e[_0xfa2e('0x16')],_0xc65157);_0x5a400b(_0xc1e194[_0xfa2e('0x14')](0x1f4,_0x5eb07e[_0xfa2e('0x16')]));});});};exports[_0xfa2e('0x26')]=function(_0x41e52c){var _0x49a53b=this;return new Promise(function(_0x291358,_0x615c99){return db[_0xfa2e('0x1b')][_0xfa2e('0x27')](_0x41e52c['body'],{'raw':_0x41e52c[_0xfa2e('0x1c')]?_0x41e52c[_0xfa2e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41e52c[_0xfa2e('0x1c')]?_0x41e52c[_0xfa2e('0x1c')][_0xfa2e('0x28')]||null:null,'attributes':_0x41e52c[_0xfa2e('0x1c')]?_0x41e52c[_0xfa2e('0x1c')]['attributes']||null:null,'limit':_0x41e52c[_0xfa2e('0x1c')]?_0x41e52c[_0xfa2e('0x1c')][_0xfa2e('0x1f')]||null:null})[_0xfa2e('0x23')](function(_0x4014b3){logger[_0xfa2e('0x17')](_0xfa2e('0x26'),_0x41e52c);logger[_0xfa2e('0x24')](_0xfa2e('0x26'),_0x41e52c,JSON['stringify'](_0x4014b3));_0x291358(_0x4014b3);})[_0xfa2e('0x19')](function(_0x2dfebd){logger[_0xfa2e('0x14')](_0xfa2e('0x26'),_0x2dfebd[_0xfa2e('0x16')],_0x41e52c);_0x615c99(_0x49a53b['error'](0x1f4,_0x2dfebd['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 4e6d170..a0b031e 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 _0xf767=['remove','update','emit','removeListener','length','voiceQueueReport:','save'];(function(_0x6f3945,_0x3f1a6d){var _0x2bf1dd=function(_0x872475){while(--_0x872475){_0x6f3945['push'](_0x6f3945['shift']());}};_0x2bf1dd(++_0x3f1a6d);}(_0xf767,0x76));var _0x7f76=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0xf767[_0x12a2a6];return _0x1754ae;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x7f76('0x0'),_0x7f76('0x1'),_0x7f76('0x2')];function createListener(_0x23f0c3,_0x90398d){return function(_0x5d215a){_0x90398d[_0x7f76('0x3')](_0x23f0c3,_0x5d215a);};}function removeListener(_0x2aa5e1,_0x40ba50){return function(){VoiceQueueReportEvents[_0x7f76('0x4')](_0x2aa5e1,_0x40ba50);};}exports['register']=function(_0x23c243){for(var _0x2f2588=0x0,_0x45ddcc=events[_0x7f76('0x5')];_0x2f2588<_0x45ddcc;_0x2f2588++){var _0x1fc46c=events[_0x2f2588];var _0x5acfee=createListener(_0x7f76('0x6')+_0x1fc46c,_0x23c243);VoiceQueueReportEvents['on'](_0x1fc46c,_0x5acfee);}}; \ No newline at end of file +var _0x522b=['removeListener','register','length','./voiceQueueReport.events','save','update','emit'];(function(_0x30c2ac,_0x39311b){var _0x2195e3=function(_0x33ddc2){while(--_0x33ddc2){_0x30c2ac['push'](_0x30c2ac['shift']());}};_0x2195e3(++_0x39311b);}(_0x522b,0x1c3));var _0xb522=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0x522b[_0x23f8c8];return _0x3dc718;};'use strict';var VoiceQueueReportEvents=require(_0xb522('0x0'));var events=[_0xb522('0x1'),'remove',_0xb522('0x2')];function createListener(_0x54310f,_0x4a9709){return function(_0x3519a9){_0x4a9709[_0xb522('0x3')](_0x54310f,_0x3519a9);};}function removeListener(_0x52cd65,_0x335c92){return function(){VoiceQueueReportEvents[_0xb522('0x4')](_0x52cd65,_0x335c92);};}exports[_0xb522('0x5')]=function(_0x2fca5b){for(var _0x47bd53=0x0,_0x55a5f0=events[_0xb522('0x6')];_0x47bd53<_0x55a5f0;_0x47bd53++){var _0x2f289f=events[_0x47bd53];var _0x5a5cd3=createListener('voiceQueueReport:'+_0x2f289f,_0x2fca5b);VoiceQueueReportEvents['on'](_0x2f289f,_0x5a5cd3);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index eab6ced..25d1655 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 _0xf141=['delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x919220,_0x13d552){var _0x398c4b=function(_0x41bb15){while(--_0x41bb15){_0x919220['push'](_0x919220['shift']());}};_0x398c4b(++_0x13d552);}(_0xf141,0xec));var _0x1f14=function(_0x2ced02,_0x29cc8f){_0x2ced02=_0x2ced02-0x0;var _0x31f3e4=_0xf141[_0x2ced02];return _0x31f3e4;};'use strict';var multer=require(_0x1f14('0x0'));var util=require(_0x1f14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1f14('0x2'));var router=express[_0x1f14('0x3')]();var fs_extra=require(_0x1f14('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f14('0x5'));var config=require(_0x1f14('0x6'));var controller=require(_0x1f14('0x7'));router[_0x1f14('0x8')]('/',auth[_0x1f14('0x9')](),controller['index']);router['get'](_0x1f14('0xa'),auth['isAuthenticated'](),controller[_0x1f14('0xb')]);router[_0x1f14('0xc')]('/',auth[_0x1f14('0x9')](),controller[_0x1f14('0xd')]);router[_0x1f14('0xe')](_0x1f14('0xa'),auth['isAuthenticated'](),controller[_0x1f14('0xf')]);router[_0x1f14('0x10')]('/:id',auth[_0x1f14('0x9')](),controller['destroy']);module[_0x1f14('0x11')]=router; \ No newline at end of file +var _0xed1c=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','update','delete','destroy','exports','multer','util'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xed1c,0xf5));var _0xced1=function(_0x33f80f,_0xbc2c7){_0x33f80f=_0x33f80f-0x0;var _0x290d0c=_0xed1c[_0x33f80f];return _0x290d0c;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require(_0xced1('0x2'));var timeout=require(_0xced1('0x3'));var express=require(_0xced1('0x4'));var router=express[_0xced1('0x5')]();var fs_extra=require(_0xced1('0x6'));var auth=require(_0xced1('0x7'));var interaction=require(_0xced1('0x8'));var config=require(_0xced1('0x9'));var controller=require('./voiceQueuesLog.controller');router[_0xced1('0xa')]('/',auth[_0xced1('0xb')](),controller['index']);router[_0xced1('0xa')](_0xced1('0xc'),auth['isAuthenticated'](),controller[_0xced1('0xd')]);router[_0xced1('0xe')]('/',auth[_0xced1('0xb')](),controller['create']);router['put'](_0xced1('0xc'),auth[_0xced1('0xb')](),controller[_0xced1('0xf')]);router[_0xced1('0x10')](_0xced1('0xc'),auth['isAuthenticated'](),controller[_0xced1('0x11')]);module[_0xced1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 0ade4ef..0dba8ab 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 _0x8110=['YYYY-MM-DD\x20HH:mm:ss','moment','STRING','format'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x8110,0x185));var _0x0811=function(_0x30a6d8,_0x4aeae3){_0x30a6d8=_0x30a6d8-0x0;var _0x1c2b86=_0x8110[_0x30a6d8];return _0x1c2b86;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0811('0x0'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0811('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x0811('0x2')](_0x0811('0x3'))}}; \ No newline at end of file +var _0x9fc3=['moment','exports','STRING','DATE','format','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9fc3,0xcb));var _0x39fc=function(_0x4bf9a5,_0x256a4f){_0x4bf9a5=_0x4bf9a5-0x0;var _0x35efcd=_0x9fc3[_0x4bf9a5];return _0x35efcd;};'use strict';var Sequelize=require(_0x39fc('0x0'));var moment=require(_0x39fc('0x1'));module[_0x39fc('0x2')]={'time':{'type':Sequelize[_0x39fc('0x3')]},'callid':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x39fc('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x39fc('0x4')],'allowNull':![],'defaultValue':moment()[_0x39fc('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c1b34a9..80af1dd 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 _0x3f9a=['send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','stack','name'];(function(_0x2882cf,_0x1209ca){var _0x1c5c4e=function(_0x115151){while(--_0x115151){_0x2882cf['push'](_0x2882cf['shift']());}};_0x1c5c4e(++_0x1209ca);}(_0x3f9a,0x69));var _0xa3f9=function(_0x33a6e9,_0x307cbe){_0x33a6e9=_0x33a6e9-0x0;var _0x2830fe=_0x3f9a[_0x33a6e9];return _0x2830fe;};'use strict';var emlformat=require(_0xa3f9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa3f9('0x1'));var rp=require('request-promise');var moment=require(_0xa3f9('0x2'));var BPromise=require(_0xa3f9('0x3'));var Mustache=require(_0xa3f9('0x4'));var util=require(_0xa3f9('0x5'));var path=require('path');var sox=require(_0xa3f9('0x6'));var csv=require(_0xa3f9('0x7'));var ejs=require(_0xa3f9('0x8'));var fs=require('fs');var fs_extra=require(_0xa3f9('0x9'));var _=require('lodash');var squel=require(_0xa3f9('0xa'));var crypto=require(_0xa3f9('0xb'));var jsforce=require(_0xa3f9('0xc'));var deskjs=require(_0xa3f9('0xd'));var toCsv=require(_0xa3f9('0x7'));var querystring=require(_0xa3f9('0xe'));var Papa=require(_0xa3f9('0xf'));var Redis=require(_0xa3f9('0x10'));var authService=require(_0xa3f9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3f9('0x12'))(_0xa3f9('0x13'));var utils=require(_0xa3f9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa3f9('0x15'));var db=require(_0xa3f9('0x16'))['db'];function respondWithStatusCode(_0x3333a7,_0x16d94a){_0x16d94a=_0x16d94a||0xcc;return function(_0x199c6e){if(_0x199c6e){return _0x3333a7[_0xa3f9('0x17')](_0x16d94a);}return _0x3333a7[_0xa3f9('0x18')](_0x16d94a)[_0xa3f9('0x19')]();};}function respondWithResult(_0x26dbe6,_0xdef01f){_0xdef01f=_0xdef01f||0xc8;return function(_0x3fe573){if(_0x3fe573){return _0x26dbe6[_0xa3f9('0x18')](_0xdef01f)[_0xa3f9('0x1a')](_0x3fe573);}};}function respondWithFilteredResult(_0x225002,_0x211ae3){return function(_0x2e503d){if(_0x2e503d){var _0x2395f4=typeof _0x211ae3[_0xa3f9('0x1b')]==='undefined'&&typeof _0x211ae3[_0xa3f9('0x1c')]===_0xa3f9('0x1d');var _0x256093=_0x2e503d['count'];var _0x347280=_0x2395f4?0x0:_0x211ae3[_0xa3f9('0x1b')];var _0x5818d0=_0x2395f4?_0x2e503d[_0xa3f9('0x1e')]:_0x211ae3[_0xa3f9('0x1b')]+_0x211ae3[_0xa3f9('0x1c')];var _0x55aed3;if(_0x5818d0>=_0x256093){_0x5818d0=_0x256093;_0x55aed3=0xc8;}else{_0x55aed3=0xce;}_0x225002['status'](_0x55aed3);return _0x225002[_0xa3f9('0x1f')]('Content-Range',_0x347280+'-'+_0x5818d0+'/'+_0x256093)[_0xa3f9('0x1a')](_0x2e503d);}return null;};}function patchUpdates(_0x509260){return function(_0x8e4c0){try{jsonpatch[_0xa3f9('0x20')](_0x8e4c0,_0x509260,!![]);}catch(_0x5197d4){return BPromise[_0xa3f9('0x21')](_0x5197d4);}return _0x8e4c0[_0xa3f9('0x22')]();};}function saveUpdates(_0x48cf88,_0x2ccda4){return function(_0x15a6de){if(_0x15a6de){return _0x15a6de[_0xa3f9('0x23')](_0x48cf88)[_0xa3f9('0x24')](function(_0x5a74fc){return _0x5a74fc;});}return null;};}function removeEntity(_0x40c470,_0x198f21){return function(_0x304988){if(_0x304988){return _0x304988['destroy']()['then'](function(){_0x40c470[_0xa3f9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2cd5,_0xb434bc){return function(_0x2ece59){if(!_0x2ece59){_0x3b2cd5['sendStatus'](0x194);}return _0x2ece59;};}function handleError(_0x2d6b30,_0x1788b7){_0x1788b7=_0x1788b7||0x1f4;return function(_0x5ec474){logger['error'](_0x5ec474[_0xa3f9('0x25')]);if(_0x5ec474[_0xa3f9('0x26')]){delete _0x5ec474[_0xa3f9('0x26')];}_0x2d6b30['status'](_0x1788b7)[_0xa3f9('0x27')](_0x5ec474);};}exports[_0xa3f9('0x28')]=function(_0x4462cf,_0x15fd60){var _0x3fd7d0={},_0x339149={},_0x1f32cc={'count':0x0,'rows':[]};var _0x40ea72=_[_0xa3f9('0x29')](db[_0xa3f9('0x2a')][_0xa3f9('0x2b')],function(_0x325e4a){return{'name':_0x325e4a[_0xa3f9('0x2c')],'type':_0x325e4a[_0xa3f9('0x2d')]['key']};});_0x339149[_0xa3f9('0x2e')]=_[_0xa3f9('0x29')](_0x40ea72,'name');_0x339149[_0xa3f9('0x2f')]=_[_0xa3f9('0x30')](_0x4462cf[_0xa3f9('0x2f')]);_0x339149['filters']=_[_0xa3f9('0x31')](_0x339149[_0xa3f9('0x2e')],_0x339149[_0xa3f9('0x2f')]);_0x3fd7d0['attributes']=_[_0xa3f9('0x31')](_0x339149[_0xa3f9('0x2e')],qs['fields'](_0x4462cf[_0xa3f9('0x2f')][_0xa3f9('0x32')]));_0x3fd7d0[_0xa3f9('0x33')]=_0x3fd7d0[_0xa3f9('0x33')]['length']?_0x3fd7d0[_0xa3f9('0x33')]:_0x339149[_0xa3f9('0x2e')];if(!_0x4462cf[_0xa3f9('0x2f')]['hasOwnProperty'](_0xa3f9('0x34'))){_0x3fd7d0[_0xa3f9('0x1c')]=qs[_0xa3f9('0x1c')](_0x4462cf[_0xa3f9('0x2f')]['limit']);_0x3fd7d0['offset']=qs[_0xa3f9('0x1b')](_0x4462cf['query'][_0xa3f9('0x1b')]);}_0x3fd7d0[_0xa3f9('0x35')]=qs[_0xa3f9('0x36')](_0x4462cf['query'][_0xa3f9('0x36')]);_0x3fd7d0[_0xa3f9('0x37')]=qs[_0xa3f9('0x38')](_[_0xa3f9('0x39')](_0x4462cf[_0xa3f9('0x2f')],_0x339149[_0xa3f9('0x38')]),_0x40ea72);if(_0x4462cf[_0xa3f9('0x2f')][_0xa3f9('0x3a')]){_0x3fd7d0[_0xa3f9('0x37')]=_[_0xa3f9('0x3b')](_0x3fd7d0[_0xa3f9('0x37')],{'$or':_[_0xa3f9('0x29')](_0x40ea72,function(_0x46d838){if(_0x46d838['type']!=='VIRTUAL'){var _0x5a31bf={};_0x5a31bf[_0x46d838[_0xa3f9('0x26')]]={'$like':'%'+_0x4462cf[_0xa3f9('0x2f')][_0xa3f9('0x3a')]+'%'};return _0x5a31bf;}})});}_0x3fd7d0=_[_0xa3f9('0x3b')]({},_0x3fd7d0,_0x4462cf[_0xa3f9('0x3c')]);var _0x572a97={'where':_0x3fd7d0['where']};return db[_0xa3f9('0x2a')][_0xa3f9('0x1e')](_0x572a97)[_0xa3f9('0x24')](function(_0x18f6d1){_0x1f32cc[_0xa3f9('0x1e')]=_0x18f6d1;if(_0x4462cf[_0xa3f9('0x2f')][_0xa3f9('0x3d')]){_0x3fd7d0[_0xa3f9('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xa3f9('0x3f')](_0x3fd7d0);})[_0xa3f9('0x24')](function(_0x14d8d5){_0x1f32cc[_0xa3f9('0x40')]=_0x14d8d5;return _0x1f32cc;})[_0xa3f9('0x24')](respondWithFilteredResult(_0x15fd60,_0x3fd7d0))[_0xa3f9('0x41')](handleError(_0x15fd60,null));};exports[_0xa3f9('0x42')]=function(_0x2defbc,_0x1c8db4){var _0x38b2f7={'raw':!![],'where':{'id':_0x2defbc['params']['id']}},_0x353140={};_0x353140[_0xa3f9('0x2e')]=_[_0xa3f9('0x30')](db[_0xa3f9('0x2a')][_0xa3f9('0x2b')]);_0x353140['query']=_[_0xa3f9('0x30')](_0x2defbc['query']);_0x353140[_0xa3f9('0x38')]=_[_0xa3f9('0x31')](_0x353140[_0xa3f9('0x2e')],_0x353140[_0xa3f9('0x2f')]);_0x38b2f7[_0xa3f9('0x33')]=_['intersection'](_0x353140[_0xa3f9('0x2e')],qs[_0xa3f9('0x32')](_0x2defbc['query'][_0xa3f9('0x32')]));_0x38b2f7['attributes']=_0x38b2f7[_0xa3f9('0x33')]['length']?_0x38b2f7[_0xa3f9('0x33')]:_0x353140['model'];if(_0x2defbc['query'][_0xa3f9('0x3d')]){_0x38b2f7['include']=[{'all':!![]}];}_0x38b2f7=_[_0xa3f9('0x3b')]({},_0x38b2f7,_0x2defbc[_0xa3f9('0x3c')]);return db['VoiceQueuesLog'][_0xa3f9('0x43')](_0x38b2f7)[_0xa3f9('0x24')](handleEntityNotFound(_0x1c8db4,null))[_0xa3f9('0x24')](respondWithResult(_0x1c8db4,null))[_0xa3f9('0x41')](handleError(_0x1c8db4,null));};exports[_0xa3f9('0x44')]=function(_0x5d4091,_0x17c3e3){return db[_0xa3f9('0x2a')][_0xa3f9('0x44')](_0x5d4091[_0xa3f9('0x45')],{})[_0xa3f9('0x24')](respondWithResult(_0x17c3e3,0xc9))['catch'](handleError(_0x17c3e3,null));};exports[_0xa3f9('0x23')]=function(_0x245019,_0x41af7d){if(_0x245019['body']['id']){delete _0x245019[_0xa3f9('0x45')]['id'];}return db[_0xa3f9('0x2a')][_0xa3f9('0x43')]({'where':{'id':_0x245019[_0xa3f9('0x46')]['id']}})[_0xa3f9('0x24')](handleEntityNotFound(_0x41af7d,null))['then'](saveUpdates(_0x245019[_0xa3f9('0x45')],null))['then'](respondWithResult(_0x41af7d,null))[_0xa3f9('0x41')](handleError(_0x41af7d,null));};exports[_0xa3f9('0x47')]=function(_0x4298cc,_0x4ccb4c){return db['VoiceQueuesLog'][_0xa3f9('0x43')]({'where':{'id':_0x4298cc['params']['id']}})[_0xa3f9('0x24')](handleEntityNotFound(_0x4ccb4c,null))[_0xa3f9('0x24')](removeEntity(_0x4ccb4c,null))[_0xa3f9('0x41')](handleError(_0x4ccb4c,null));}; \ No newline at end of file +var _0x8af2=['sendStatus','error','name','send','VoiceQueuesLog','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','offset','count','limit','set','json','apply','reject','save','update','then','destroy'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x8af2,0x10c));var _0x28af=function(_0x4b1434,_0x1fa900){_0x4b1434=_0x4b1434-0x0;var _0x9870da=_0x8af2[_0x4b1434];return _0x9870da;};'use strict';var emlformat=require(_0x28af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28af('0x1'));var jsonpatch=require(_0x28af('0x2'));var rp=require(_0x28af('0x3'));var moment=require('moment');var BPromise=require(_0x28af('0x4'));var Mustache=require(_0x28af('0x5'));var util=require(_0x28af('0x6'));var path=require('path');var sox=require(_0x28af('0x7'));var csv=require(_0x28af('0x8'));var ejs=require(_0x28af('0x9'));var fs=require('fs');var fs_extra=require(_0x28af('0xa'));var _=require(_0x28af('0xb'));var squel=require(_0x28af('0xc'));var crypto=require(_0x28af('0xd'));var jsforce=require(_0x28af('0xe'));var deskjs=require(_0x28af('0xf'));var toCsv=require(_0x28af('0x8'));var querystring=require(_0x28af('0x10'));var Papa=require(_0x28af('0x11'));var Redis=require('ioredis');var authService=require(_0x28af('0x12'));var qs=require(_0x28af('0x13'));var as=require(_0x28af('0x14'));var hardwareService=require(_0x28af('0x15'));var logger=require('../../config/logger')(_0x28af('0x16'));var utils=require(_0x28af('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x28af('0x18'));var db=require(_0x28af('0x19'))['db'];function respondWithStatusCode(_0x44a8d3,_0x3f1f03){_0x3f1f03=_0x3f1f03||0xcc;return function(_0x552713){if(_0x552713){return _0x44a8d3['sendStatus'](_0x3f1f03);}return _0x44a8d3[_0x28af('0x1a')](_0x3f1f03)[_0x28af('0x1b')]();};}function respondWithResult(_0x226676,_0x5b02ec){_0x5b02ec=_0x5b02ec||0xc8;return function(_0x1ac58a){if(_0x1ac58a){return _0x226676[_0x28af('0x1a')](_0x5b02ec)['json'](_0x1ac58a);}};}function respondWithFilteredResult(_0x5f311b,_0x3b91cf){return function(_0xeeca22){if(_0xeeca22){var _0x1ab980=typeof _0x3b91cf['offset']==='undefined'&&typeof _0x3b91cf['limit']===_0x28af('0x1c');var _0x541853=_0xeeca22['count'];var _0x2b93f4=_0x1ab980?0x0:_0x3b91cf[_0x28af('0x1d')];var _0x26dae1=_0x1ab980?_0xeeca22[_0x28af('0x1e')]:_0x3b91cf[_0x28af('0x1d')]+_0x3b91cf[_0x28af('0x1f')];var _0x199ec0;if(_0x26dae1>=_0x541853){_0x26dae1=_0x541853;_0x199ec0=0xc8;}else{_0x199ec0=0xce;}_0x5f311b['status'](_0x199ec0);return _0x5f311b[_0x28af('0x20')]('Content-Range',_0x2b93f4+'-'+_0x26dae1+'/'+_0x541853)[_0x28af('0x21')](_0xeeca22);}return null;};}function patchUpdates(_0x3334e7){return function(_0x2db2e9){try{jsonpatch[_0x28af('0x22')](_0x2db2e9,_0x3334e7,!![]);}catch(_0x3dc92c){return BPromise[_0x28af('0x23')](_0x3dc92c);}return _0x2db2e9[_0x28af('0x24')]();};}function saveUpdates(_0x4b38fe,_0x3eb3e){return function(_0x2a8517){if(_0x2a8517){return _0x2a8517[_0x28af('0x25')](_0x4b38fe)[_0x28af('0x26')](function(_0xd6c3a8){return _0xd6c3a8;});}return null;};}function removeEntity(_0x7b4b3a,_0x19efbc){return function(_0x55e9f7){if(_0x55e9f7){return _0x55e9f7[_0x28af('0x27')]()['then'](function(){_0x7b4b3a[_0x28af('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5db955,_0x38a3ea){return function(_0x58e169){if(!_0x58e169){_0x5db955[_0x28af('0x28')](0x194);}return _0x58e169;};}function handleError(_0x1171a1,_0x24a7a9){_0x24a7a9=_0x24a7a9||0x1f4;return function(_0x139ca4){logger[_0x28af('0x29')](_0x139ca4['stack']);if(_0x139ca4[_0x28af('0x2a')]){delete _0x139ca4[_0x28af('0x2a')];}_0x1171a1[_0x28af('0x1a')](_0x24a7a9)[_0x28af('0x2b')](_0x139ca4);};}exports['index']=function(_0x275c79,_0x8184e1){var _0x3e406e={},_0x574ef3={},_0x120fc5={'count':0x0,'rows':[]};var _0x141b5d=_['map'](db[_0x28af('0x2c')][_0x28af('0x2d')],function(_0x9b0e5e){return{'name':_0x9b0e5e['fieldName'],'type':_0x9b0e5e[_0x28af('0x2e')][_0x28af('0x2f')]};});_0x574ef3[_0x28af('0x30')]=_[_0x28af('0x31')](_0x141b5d,_0x28af('0x2a'));_0x574ef3['query']=_[_0x28af('0x32')](_0x275c79[_0x28af('0x33')]);_0x574ef3[_0x28af('0x34')]=_[_0x28af('0x35')](_0x574ef3[_0x28af('0x30')],_0x574ef3[_0x28af('0x33')]);_0x3e406e['attributes']=_['intersection'](_0x574ef3['model'],qs[_0x28af('0x36')](_0x275c79[_0x28af('0x33')][_0x28af('0x36')]));_0x3e406e[_0x28af('0x37')]=_0x3e406e[_0x28af('0x37')][_0x28af('0x38')]?_0x3e406e[_0x28af('0x37')]:_0x574ef3[_0x28af('0x30')];if(!_0x275c79[_0x28af('0x33')][_0x28af('0x39')](_0x28af('0x3a'))){_0x3e406e['limit']=qs['limit'](_0x275c79[_0x28af('0x33')][_0x28af('0x1f')]);_0x3e406e[_0x28af('0x1d')]=qs[_0x28af('0x1d')](_0x275c79[_0x28af('0x33')][_0x28af('0x1d')]);}_0x3e406e[_0x28af('0x3b')]=qs[_0x28af('0x3c')](_0x275c79['query'][_0x28af('0x3c')]);_0x3e406e[_0x28af('0x3d')]=qs[_0x28af('0x34')](_[_0x28af('0x3e')](_0x275c79[_0x28af('0x33')],_0x574ef3[_0x28af('0x34')]),_0x141b5d);if(_0x275c79[_0x28af('0x33')][_0x28af('0x3f')]){_0x3e406e[_0x28af('0x3d')]=_[_0x28af('0x40')](_0x3e406e['where'],{'$or':_[_0x28af('0x31')](_0x141b5d,function(_0x17b67a){if(_0x17b67a[_0x28af('0x2e')]!==_0x28af('0x41')){var _0x456403={};_0x456403[_0x17b67a[_0x28af('0x2a')]]={'$like':'%'+_0x275c79[_0x28af('0x33')][_0x28af('0x3f')]+'%'};return _0x456403;}})});}_0x3e406e=_['merge']({},_0x3e406e,_0x275c79[_0x28af('0x42')]);var _0x1d8a00={'where':_0x3e406e['where']};return db[_0x28af('0x2c')][_0x28af('0x1e')](_0x1d8a00)[_0x28af('0x26')](function(_0x509c79){_0x120fc5[_0x28af('0x1e')]=_0x509c79;if(_0x275c79['query'][_0x28af('0x43')]){_0x3e406e[_0x28af('0x44')]=[{'all':!![]}];}return db[_0x28af('0x2c')][_0x28af('0x45')](_0x3e406e);})['then'](function(_0x5993cf){_0x120fc5[_0x28af('0x46')]=_0x5993cf;return _0x120fc5;})[_0x28af('0x26')](respondWithFilteredResult(_0x8184e1,_0x3e406e))[_0x28af('0x47')](handleError(_0x8184e1,null));};exports[_0x28af('0x48')]=function(_0x206a72,_0x10fd4a){var _0x1b89b5={'raw':!![],'where':{'id':_0x206a72[_0x28af('0x49')]['id']}},_0x13291e={};_0x13291e[_0x28af('0x30')]=_[_0x28af('0x32')](db[_0x28af('0x2c')][_0x28af('0x2d')]);_0x13291e['query']=_[_0x28af('0x32')](_0x206a72[_0x28af('0x33')]);_0x13291e[_0x28af('0x34')]=_[_0x28af('0x35')](_0x13291e[_0x28af('0x30')],_0x13291e[_0x28af('0x33')]);_0x1b89b5[_0x28af('0x37')]=_[_0x28af('0x35')](_0x13291e['model'],qs['fields'](_0x206a72[_0x28af('0x33')][_0x28af('0x36')]));_0x1b89b5[_0x28af('0x37')]=_0x1b89b5[_0x28af('0x37')][_0x28af('0x38')]?_0x1b89b5[_0x28af('0x37')]:_0x13291e[_0x28af('0x30')];if(_0x206a72[_0x28af('0x33')][_0x28af('0x43')]){_0x1b89b5[_0x28af('0x44')]=[{'all':!![]}];}_0x1b89b5=_['merge']({},_0x1b89b5,_0x206a72['options']);return db[_0x28af('0x2c')]['find'](_0x1b89b5)[_0x28af('0x26')](handleEntityNotFound(_0x10fd4a,null))['then'](respondWithResult(_0x10fd4a,null))[_0x28af('0x47')](handleError(_0x10fd4a,null));};exports['create']=function(_0x30ca8b,_0x1417a0){return db[_0x28af('0x2c')][_0x28af('0x4a')](_0x30ca8b['body'],{})[_0x28af('0x26')](respondWithResult(_0x1417a0,0xc9))[_0x28af('0x47')](handleError(_0x1417a0,null));};exports[_0x28af('0x25')]=function(_0x17b27,_0x5a85cf){if(_0x17b27[_0x28af('0x4b')]['id']){delete _0x17b27[_0x28af('0x4b')]['id'];}return db[_0x28af('0x2c')]['find']({'where':{'id':_0x17b27[_0x28af('0x49')]['id']}})['then'](handleEntityNotFound(_0x5a85cf,null))[_0x28af('0x26')](saveUpdates(_0x17b27[_0x28af('0x4b')],null))['then'](respondWithResult(_0x5a85cf,null))['catch'](handleError(_0x5a85cf,null));};exports['destroy']=function(_0xfc8f0a,_0x224aca){return db['VoiceQueuesLog'][_0x28af('0x4c')]({'where':{'id':_0xfc8f0a[_0x28af('0x49')]['id']}})[_0x28af('0x26')](handleEntityNotFound(_0x224aca,null))[_0x28af('0x26')](removeEntity(_0x224aca,null))[_0x28af('0x47')](handleError(_0x224aca,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 27190c6..882d00a 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 _0x5e87=['voice_queues_log','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x2506b0,_0x3039de){var _0x57109c=function(_0x4bacf2){while(--_0x4bacf2){_0x2506b0['push'](_0x2506b0['shift']());}};_0x57109c(++_0x3039de);}(_0x5e87,0x1da));var _0x75e8=function(_0x2777a2,_0x1f37fa){_0x2777a2=_0x2777a2-0x0;var _0x4a2974=_0x5e87[_0x2777a2];return _0x4a2974;};'use strict';var _=require('lodash');var util=require(_0x75e8('0x0'));var logger=require(_0x75e8('0x1'))('api');var moment=require(_0x75e8('0x2'));var BPromise=require(_0x75e8('0x3'));var rp=require(_0x75e8('0x4'));var fs=require('fs');var path=require(_0x75e8('0x5'));var rimraf=require('rimraf');var config=require(_0x75e8('0x6'));var attributes=require('./voiceQueuesLog.attributes');module[_0x75e8('0x7')]=function(_0x3f6843,_0x29f9d3){return _0x3f6843[_0x75e8('0x8')](_0x75e8('0x9'),attributes,{'tableName':_0x75e8('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x26fc=['event','dtm','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log'];(function(_0x455bee,_0x826332){var _0x1d8e99=function(_0x3b2788){while(--_0x3b2788){_0x455bee['push'](_0x455bee['shift']());}};_0x1d8e99(++_0x826332);}(_0x26fc,0x160));var _0xc26f=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x26fc[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xc26f('0x0'));var util=require(_0xc26f('0x1'));var logger=require('../../config/logger')(_0xc26f('0x2'));var moment=require(_0xc26f('0x3'));var BPromise=require('bluebird');var rp=require(_0xc26f('0x4'));var fs=require('fs');var path=require(_0xc26f('0x5'));var rimraf=require(_0xc26f('0x6'));var config=require(_0xc26f('0x7'));var attributes=require(_0xc26f('0x8'));module['exports']=function(_0x13bc51,_0x2dd854){return _0x13bc51[_0xc26f('0x9')](_0xc26f('0xa'),attributes,{'tableName':_0xc26f('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xc26f('0xc'),_0xc26f('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 86d148f..514c1ee 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 _0x2516=['../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x30b170,_0x157942){var _0x9dc389=function(_0x444cca){while(--_0x444cca){_0x30b170['push'](_0x30b170['shift']());}};_0x9dc389(++_0x157942);}(_0x2516,0x16f));var _0x6251=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x2516[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x6251('0x0'));var util=require(_0x6251('0x1'));var moment=require(_0x6251('0x2'));var BPromise=require(_0x6251('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6251('0x4'));var db=require(_0x6251('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6251('0x6'));var config=require(_0x6251('0x7'));var jayson=require(_0x6251('0x8'));var client=jayson[_0x6251('0x9')][_0x6251('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e47fa,_0x3eabad,_0x5e40ee){return new BPromise(function(_0x108394,_0x1030d0){return client['request'](_0x1e47fa,_0x5e40ee)[_0x6251('0xb')](function(_0x83c921){logger[_0x6251('0xc')](_0x6251('0xd'),_0x3eabad,_0x6251('0xe'));logger['debug'](_0x6251('0xf'),_0x3eabad,_0x6251('0xe'),JSON[_0x6251('0x10')](_0x83c921));if(_0x83c921[_0x6251('0x11')]){if(_0x83c921[_0x6251('0x11')][_0x6251('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x3eabad,_0x83c921['error'][_0x6251('0x13')]);return _0x1030d0(_0x83c921[_0x6251('0x11')][_0x6251('0x13')]);}logger[_0x6251('0x11')](_0x6251('0xd'),_0x3eabad,_0x83c921['error'][_0x6251('0x13')]);return _0x108394(_0x83c921['error'][_0x6251('0x13')]);}else{logger[_0x6251('0xc')](_0x6251('0xd'),_0x3eabad,_0x6251('0xe'));_0x108394(_0x83c921[_0x6251('0x14')][_0x6251('0x13')]);}})[_0x6251('0x15')](function(_0x26e789){logger['error'](_0x6251('0xd'),_0x3eabad,_0x26e789);_0x1030d0(_0x26e789);});});} \ No newline at end of file +var _0x9aa8=['rpc','../../config/environment','client','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x9aa8,0xb6));var _0x89aa=function(_0x53a0b8,_0x2a1b7e){_0x53a0b8=_0x53a0b8-0x0;var _0x4bdc30=_0x9aa8[_0x53a0b8];return _0x4bdc30;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x89aa('0x0'));var BPromise=require(_0x89aa('0x1'));var rs=require(_0x89aa('0x2'));var fs=require('fs');var Redis=require(_0x89aa('0x3'));var db=require(_0x89aa('0x4'))['db'];var utils=require(_0x89aa('0x5'));var logger=require(_0x89aa('0x6'))(_0x89aa('0x7'));var config=require(_0x89aa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x89aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46be72,_0x2a7ead,_0x304b10){return new BPromise(function(_0x4110df,_0x66d91e){return client['request'](_0x46be72,_0x304b10)[_0x89aa('0xa')](function(_0x549368){logger[_0x89aa('0xb')](_0x89aa('0xc'),_0x2a7ead,_0x89aa('0xd'));logger['debug'](_0x89aa('0xe'),_0x2a7ead,_0x89aa('0xd'),JSON[_0x89aa('0xf')](_0x549368));if(_0x549368[_0x89aa('0x10')]){if(_0x549368['error'][_0x89aa('0x11')]===0x1f4){logger[_0x89aa('0x10')](_0x89aa('0xc'),_0x2a7ead,_0x549368[_0x89aa('0x10')][_0x89aa('0x12')]);return _0x66d91e(_0x549368['error'][_0x89aa('0x12')]);}logger[_0x89aa('0x10')](_0x89aa('0xc'),_0x2a7ead,_0x549368[_0x89aa('0x10')][_0x89aa('0x12')]);return _0x4110df(_0x549368[_0x89aa('0x10')][_0x89aa('0x12')]);}else{logger['info'](_0x89aa('0xc'),_0x2a7ead,_0x89aa('0xd'));_0x4110df(_0x549368[_0x89aa('0x13')][_0x89aa('0x12')]);}})[_0x89aa('0x14')](function(_0x123901){logger[_0x89aa('0x10')](_0x89aa('0xc'),_0x2a7ead,_0x123901);_0x66d91e(_0x123901);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 9c59e1a..4709520 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 _0x7bc9=['path','Router','./voiceRecording.controller','get','index','/describe','isAuthenticated','show','/:id/download','download','downloads','/:id/transcribe','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x627b1b,_0x462114){var _0x2fd022=function(_0x2059c5){while(--_0x2059c5){_0x627b1b['push'](_0x627b1b['shift']());}};_0x2fd022(++_0x462114);}(_0x7bc9,0x1a0));var _0x97bc=function(_0x3c7507,_0x5e4044){_0x3c7507=_0x3c7507-0x0;var _0x5aa305=_0x7bc9[_0x3c7507];return _0x5aa305;};'use strict';var multer=require(_0x97bc('0x0'));var util=require(_0x97bc('0x1'));var path=require(_0x97bc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x97bc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97bc('0x4'));router[_0x97bc('0x5')]('/',auth['isAuthenticated'](),controller[_0x97bc('0x6')]);router[_0x97bc('0x5')](_0x97bc('0x7'),auth[_0x97bc('0x8')](),controller['describe']);router['get']('/:id',auth[_0x97bc('0x8')](),controller[_0x97bc('0x9')]);router[_0x97bc('0x5')](_0x97bc('0xa'),auth[_0x97bc('0x8')](),controller[_0x97bc('0xb')]);router[_0x97bc('0x5')]('/:id/downloads',controller[_0x97bc('0xc')]);router[_0x97bc('0x5')](_0x97bc('0xd'),auth[_0x97bc('0x8')](),controller['downloadTranscribe']);router[_0x97bc('0xe')]('/',auth[_0x97bc('0x8')](),controller[_0x97bc('0xf')]);router[_0x97bc('0xe')]('/:id/transcribe',auth[_0x97bc('0x8')](),controller['runTranscribe']);router[_0x97bc('0x10')](_0x97bc('0x11'),auth['isAuthenticated'](),controller[_0x97bc('0x12')]);router[_0x97bc('0x13')](_0x97bc('0x11'),auth['isAuthenticated'](),controller[_0x97bc('0x14')]);module[_0x97bc('0x15')]=router; \ No newline at end of file +var _0x61be=['downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','isAuthenticated','get','/:id','show','/:id/download','download','/:id/downloads'];(function(_0x32f658,_0x3112b5){var _0x398f70=function(_0x5ca945){while(--_0x5ca945){_0x32f658['push'](_0x32f658['shift']());}};_0x398f70(++_0x3112b5);}(_0x61be,0x6d));var _0xe61b=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0x61be[_0x303064];return _0x5a1d3d;};'use strict';var multer=require(_0xe61b('0x0'));var util=require(_0xe61b('0x1'));var path=require(_0xe61b('0x2'));var timeout=require('connect-timeout');var express=require(_0xe61b('0x3'));var router=express[_0xe61b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe61b('0x5'));var config=require(_0xe61b('0x6'));var controller=require(_0xe61b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe61b('0x8')]);router['get']('/describe',auth[_0xe61b('0x9')](),controller['describe']);router[_0xe61b('0xa')](_0xe61b('0xb'),auth[_0xe61b('0x9')](),controller[_0xe61b('0xc')]);router[_0xe61b('0xa')](_0xe61b('0xd'),auth[_0xe61b('0x9')](),controller[_0xe61b('0xe')]);router[_0xe61b('0xa')](_0xe61b('0xf'),controller[_0xe61b('0x10')]);router['get'](_0xe61b('0x11'),auth[_0xe61b('0x9')](),controller[_0xe61b('0x12')]);router[_0xe61b('0x13')]('/',auth[_0xe61b('0x9')](),controller[_0xe61b('0x14')]);router[_0xe61b('0x13')]('/:id/transcribe',auth[_0xe61b('0x9')](),controller[_0xe61b('0x15')]);router[_0xe61b('0x16')](_0xe61b('0xb'),auth[_0xe61b('0x9')](),controller[_0xe61b('0x17')]);router[_0xe61b('0x18')](_0xe61b('0xb'),auth[_0xe61b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 02ccf63..e0e1a90 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(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 6211897..e737525 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 _0x1e7c=['Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','fileText','/server/files/transcribes/transcribe_','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','sequelize','$and','push','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2'];(function(_0x2b9879,_0x16f66f){var _0x21bc51=function(_0x36d21a){while(--_0x36d21a){_0x2b9879['push'](_0x2b9879['shift']());}};_0x21bc51(++_0x16f66f);}(_0x1e7c,0x12d));var _0xc1e7=function(_0x471600,_0x1b4715){_0x471600=_0x471600-0x0;var _0x449ef0=_0x1e7c[_0x471600];return _0x449ef0;};'use strict';var emlformat=require(_0xc1e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e7('0x1'));var rp=require(_0xc1e7('0x2'));var moment=require(_0xc1e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc1e7('0x4'));var util=require('util');var path=require(_0xc1e7('0x5'));var sox=require(_0xc1e7('0x6'));var csv=require(_0xc1e7('0x7'));var ejs=require(_0xc1e7('0x8'));var fs=require('fs');var fs_extra=require(_0xc1e7('0x9'));var _=require(_0xc1e7('0xa'));var squel=require(_0xc1e7('0xb'));var crypto=require(_0xc1e7('0xc'));var jsforce=require(_0xc1e7('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc1e7('0xe'));var Papa=require(_0xc1e7('0xf'));var AWS=require(_0xc1e7('0x10'));var uuidv4=require(_0xc1e7('0x11'));var Redis=require('ioredis');var authService=require(_0xc1e7('0x12'));var qs=require(_0xc1e7('0x13'));var as=require(_0xc1e7('0x14'));var hardwareService=require(_0xc1e7('0x15'));var logger=require(_0xc1e7('0x16'))(_0xc1e7('0x17'));var utils=require(_0xc1e7('0x18'));var config=require(_0xc1e7('0x19'));var licenseUtil=require(_0xc1e7('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a125,_0x1aa4ac){_0x1aa4ac=_0x1aa4ac||0xcc;return function(_0x3c29a9){if(_0x3c29a9){return _0x18a125[_0xc1e7('0x1b')](_0x1aa4ac);}return _0x18a125['status'](_0x1aa4ac)[_0xc1e7('0x1c')]();};}function respondWithResult(_0x56d654,_0x3b3cf6){_0x3b3cf6=_0x3b3cf6||0xc8;return function(_0x1ee25a){if(_0x1ee25a){return _0x56d654['status'](_0x3b3cf6)[_0xc1e7('0x1d')](_0x1ee25a);}};}function respondWithFilteredResult(_0xe9f5ef,_0xcc5cd2){return function(_0x1f6f94){if(_0x1f6f94){var _0x27af14=typeof _0xcc5cd2[_0xc1e7('0x1e')]===_0xc1e7('0x1f')&&typeof _0xcc5cd2['limit']==='undefined';var _0x459657=_0x1f6f94[_0xc1e7('0x20')];var _0x2de36f=_0x27af14?0x0:_0xcc5cd2[_0xc1e7('0x1e')];var _0x4f1741=_0x27af14?_0x1f6f94['count']:_0xcc5cd2[_0xc1e7('0x1e')]+_0xcc5cd2[_0xc1e7('0x21')];var _0x476013;if(_0x4f1741>=_0x459657){_0x4f1741=_0x459657;_0x476013=0xc8;}else{_0x476013=0xce;}_0xe9f5ef[_0xc1e7('0x22')](_0x476013);return _0xe9f5ef['set'](_0xc1e7('0x23'),_0x2de36f+'-'+_0x4f1741+'/'+_0x459657)[_0xc1e7('0x1d')](_0x1f6f94);}return null;};}function patchUpdates(_0x2eaebd){return function(_0x3a3343){try{jsonpatch[_0xc1e7('0x24')](_0x3a3343,_0x2eaebd,!![]);}catch(_0x4ef610){return BPromise[_0xc1e7('0x25')](_0x4ef610);}return _0x3a3343[_0xc1e7('0x26')]();};}function saveUpdates(_0x2c4841,_0x57cb29){return function(_0x3cbafc){if(_0x3cbafc){return _0x3cbafc[_0xc1e7('0x27')](_0x2c4841)[_0xc1e7('0x28')](function(_0x46ee62){return _0x46ee62;});}return null;};}function removeEntity(_0x105f16,_0x5b8f83){return function(_0x5a31e2){if(_0x5a31e2){return _0x5a31e2[_0xc1e7('0x29')]()['then'](function(){_0x105f16[_0xc1e7('0x22')](0xcc)[_0xc1e7('0x1c')]();});}};}function handleEntityNotFound(_0xd39d00,_0x25bc5b){return function(_0x4f1ffa){if(!_0x4f1ffa){_0xd39d00[_0xc1e7('0x1b')](0x194);}return _0x4f1ffa;};}function handleError(_0x48ab25,_0x5f10be){_0x5f10be=_0x5f10be||0x1f4;return function(_0x55b2b0){logger[_0xc1e7('0x2a')](_0x55b2b0[_0xc1e7('0x2b')]);if(_0x55b2b0['name']){delete _0x55b2b0[_0xc1e7('0x2c')];}_0x48ab25['status'](_0x5f10be)[_0xc1e7('0x2d')](_0x55b2b0);};}exports[_0xc1e7('0x2e')]=function(_0x3f08a0,_0x5b7727){var _0x21fdfe={},_0x3d9097={},_0x963612={'count':0x0,'rows':[]};var _0x36cbc1=_[_0xc1e7('0x2f')](db[_0xc1e7('0x30')][_0xc1e7('0x31')],function(_0xa7aeb){return{'name':_0xa7aeb[_0xc1e7('0x32')],'type':_0xa7aeb[_0xc1e7('0x33')]['key']};});_0x3d9097[_0xc1e7('0x34')]=_[_0xc1e7('0x35')](_[_0xc1e7('0x2f')](_0x36cbc1,_0xc1e7('0x2c')),[_0xc1e7('0x36')]);_0x3d9097['query']=_[_0xc1e7('0x37')](_0x3f08a0[_0xc1e7('0x38')]);_0x3d9097[_0xc1e7('0x39')]=_[_0xc1e7('0x3a')](_0x3d9097['model'],_0x3d9097[_0xc1e7('0x38')]);_0x21fdfe[_0xc1e7('0x3b')]=_['intersection'](_0x3d9097[_0xc1e7('0x34')],qs[_0xc1e7('0x3c')](_0x3f08a0['query']['fields']));_0x21fdfe[_0xc1e7('0x3b')]=_0x21fdfe[_0xc1e7('0x3b')][_0xc1e7('0x3d')]?_0x21fdfe[_0xc1e7('0x3b')]:_0x3d9097[_0xc1e7('0x34')];if(!_0x3f08a0[_0xc1e7('0x38')]['hasOwnProperty'](_0xc1e7('0x3e'))){_0x21fdfe['limit']=qs[_0xc1e7('0x21')](_0x3f08a0['query'][_0xc1e7('0x21')]);_0x21fdfe[_0xc1e7('0x1e')]=qs[_0xc1e7('0x1e')](_0x3f08a0['query'][_0xc1e7('0x1e')]);}_0x21fdfe[_0xc1e7('0x3f')]=qs[_0xc1e7('0x40')](_0x3f08a0['query'][_0xc1e7('0x40')]);_0x21fdfe[_0xc1e7('0x41')]=qs['filters'](_[_0xc1e7('0x42')](_0x3f08a0[_0xc1e7('0x38')],_0x3d9097[_0xc1e7('0x39')]),_0x36cbc1);if(_0x3f08a0['query'][_0xc1e7('0x43')]){_0x21fdfe[_0xc1e7('0x41')]=_[_0xc1e7('0x44')](_0x21fdfe[_0xc1e7('0x41')],{'$or':_[_0xc1e7('0x2f')](_0x36cbc1,function(_0x431a67){if(_0x431a67[_0xc1e7('0x33')]!=='VIRTUAL'){var _0x94f51a={};_0x94f51a[_0x431a67['name']]={'$like':'%'+_0x3f08a0[_0xc1e7('0x38')][_0xc1e7('0x43')]+'%'};return _0x94f51a;}})});}_0x21fdfe=_[_0xc1e7('0x44')]({},_0x21fdfe,_0x3f08a0[_0xc1e7('0x45')]);var _0x1b4a70={'where':_0x21fdfe[_0xc1e7('0x41')]};return db[_0xc1e7('0x30')][_0xc1e7('0x20')](_0x1b4a70)[_0xc1e7('0x28')](function(_0x118513){_0x963612['count']=_0x118513;if(_0x3f08a0[_0xc1e7('0x38')][_0xc1e7('0x46')]){_0x21fdfe[_0xc1e7('0x47')]=[{'all':!![]}];}return db[_0xc1e7('0x30')][_0xc1e7('0x48')](_0x21fdfe);})[_0xc1e7('0x28')](function(_0x516fe3){_0x963612[_0xc1e7('0x49')]=_0x516fe3;return _0x963612;})['then'](respondWithFilteredResult(_0x5b7727,_0x21fdfe))[_0xc1e7('0x4a')](handleError(_0x5b7727,null));};exports[_0xc1e7('0x4b')]=function(_0x235565,_0x12f0a0){var _0x1a3676={'raw':![],'where':{'id':_0x235565[_0xc1e7('0x4c')]['id']}},_0xc6755c={};_0xc6755c[_0xc1e7('0x34')]=_[_0xc1e7('0x37')](db[_0xc1e7('0x30')][_0xc1e7('0x31')]);_0xc6755c[_0xc1e7('0x38')]=_[_0xc1e7('0x37')](_0x235565[_0xc1e7('0x38')]);_0xc6755c[_0xc1e7('0x39')]=_['intersection'](_0xc6755c[_0xc1e7('0x34')],_0xc6755c[_0xc1e7('0x38')]);_0x1a3676[_0xc1e7('0x3b')]=_[_0xc1e7('0x3a')](_0xc6755c['model'],qs[_0xc1e7('0x3c')](_0x235565[_0xc1e7('0x38')][_0xc1e7('0x3c')]));_0x1a3676[_0xc1e7('0x3b')]=_0x1a3676['attributes'][_0xc1e7('0x3d')]?_0x1a3676[_0xc1e7('0x3b')]:_0xc6755c[_0xc1e7('0x34')];if(_0x235565[_0xc1e7('0x38')][_0xc1e7('0x46')]){_0x1a3676[_0xc1e7('0x47')]=[{'all':!![]}];}_0x1a3676=_[_0xc1e7('0x44')]({},_0x1a3676,_0x235565[_0xc1e7('0x45')]);return db['VoiceRecording']['find'](_0x1a3676)[_0xc1e7('0x28')](handleEntityNotFound(_0x12f0a0,null))['then'](respondWithResult(_0x12f0a0,null))[_0xc1e7('0x4a')](handleError(_0x12f0a0,null));};exports['create']=function(_0x47771e,_0x430d4){return db[_0xc1e7('0x30')]['create'](_0x47771e['body'],{})[_0xc1e7('0x28')](respondWithResult(_0x430d4,0xc9))[_0xc1e7('0x4a')](handleError(_0x430d4,null));};exports['update']=function(_0x580872,_0x388801){if(_0x580872[_0xc1e7('0x4d')]['id']){delete _0x580872['body']['id'];}return db[_0xc1e7('0x30')][_0xc1e7('0x4e')]({'where':{'id':_0x580872[_0xc1e7('0x4c')]['id']}})[_0xc1e7('0x28')](handleEntityNotFound(_0x388801,null))[_0xc1e7('0x28')](saveUpdates(_0x580872['body'],null))[_0xc1e7('0x28')](respondWithResult(_0x388801,null))[_0xc1e7('0x4a')](handleError(_0x388801,null));};exports['describe']=function(_0xe455cc,_0x1b21f5){return db['VoiceRecording']['describe']()[_0xc1e7('0x28')](respondWithResult(_0x1b21f5,null))[_0xc1e7('0x4a')](handleError(_0x1b21f5,null));};exports[_0xc1e7('0x4f')]=function(_0x42f38e,_0x2972e8,_0x56246c){var _0xd0bcc2=require(_0xc1e7('0x50'));var _0xb297aa=![];var _0x5dda04={};if(_0x42f38e[_0xc1e7('0x38')][_0xc1e7('0x33')]&&_0x42f38e[_0xc1e7('0x38')][_0xc1e7('0x33')]==='uniqueid'){_0x5dda04[_0xc1e7('0x51')]=_0x42f38e[_0xc1e7('0x4c')]['id'];}else{_0x5dda04['id']=_0x42f38e['params']['id'];}return db[_0xc1e7('0x30')]['find']({'where':_0x5dda04,'attributes':['id',_0xc1e7('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x2972e8,null))['then'](function(_0x50d386){if(_0x50d386){var _0x37c144=_0x50d386[_0xc1e7('0x52')];var _0x492ead=util[_0xc1e7('0x36')](_0xc1e7('0x53'),_0x37c144);if(fs[_0xc1e7('0x54')](_0x492ead)){_0xb297aa=!![];return _0xd0bcc2[_0xc1e7('0x55')](_0x492ead,_0x37c144,config[_0xc1e7('0x56')][_0xc1e7('0x57')])[_0xc1e7('0x28')](function(){return _0x50d386;});}return _0x50d386;}})['then'](function(_0x38a9bd){if(_0x38a9bd){var _0x305d4f=_0x38a9bd[_0xc1e7('0x52')];if(!fs[_0xc1e7('0x54')](_0x305d4f)){throw new db[(_0xc1e7('0x58'))]['ValidationError'](_0xc1e7('0x59'));}if(_0x38a9bd[_0xc1e7('0x5a')]){return _0x2972e8[_0xc1e7('0x4f')](_0x305d4f,_0x38a9bd[_0xc1e7('0x5a')]+path[_0xc1e7('0x5b')](_0x305d4f),function(){if(_0xb297aa){fs[_0xc1e7('0x5c')](_0x305d4f);}});}else{return _0x2972e8[_0xc1e7('0x4f')](_0x305d4f,function(_0x1fd963){if(_0xb297aa){fs[_0xc1e7('0x5c')](_0x305d4f);}});}}})['catch'](function(_0x5e05b9){if(_0x5e05b9['message']===_0xc1e7('0x59')){_0x2972e8['status'](0x194)['send'](_0xc1e7('0x5d'));}else{return handleError(_0x2972e8,null);}});};exports['downloads']=function(_0x488481,_0x37da1b,_0x9fb3cd){var _0x1c7946=require(_0xc1e7('0x50'));var _0xc7a53a=![];var _0x3d52db={'$and':[db['sequelize'][_0xc1e7('0x41')](db[_0xc1e7('0x5e')]['fn']('MD5',db[_0xc1e7('0x5e')]['col'](_0xc1e7('0x51'))),_0x488481[_0xc1e7('0x38')]['token'])]};if(_0x488481[_0xc1e7('0x38')][_0xc1e7('0x33')]&&_0x488481[_0xc1e7('0x38')]['type']===_0xc1e7('0x51')){_0x3d52db['$and']['push']({'uniqueid':_0x488481[_0xc1e7('0x4c')]['id']});}else{_0x3d52db[_0xc1e7('0x5f')][_0xc1e7('0x60')]({'id':_0x488481[_0xc1e7('0x4c')]['id']});}return db[_0xc1e7('0x30')][_0xc1e7('0x4e')]({'where':_0x3d52db,'attributes':['id','value'],'raw':!![]})[_0xc1e7('0x28')](handleEntityNotFound(_0x37da1b,null))[_0xc1e7('0x28')](function(_0x10a265){if(_0x10a265){var _0x86f125=util['format'](_0xc1e7('0x53'),_0x10a265[_0xc1e7('0x52')]);if(fs[_0xc1e7('0x54')](_0x86f125)){_0xc7a53a=!![];return _0x1c7946['decryptFile'](_0x86f125,_0x10a265[_0xc1e7('0x52')],config[_0xc1e7('0x56')][_0xc1e7('0x57')])[_0xc1e7('0x28')](function(){return _0x10a265;});}return _0x10a265;}})['then'](function(_0x5486df){if(_0x5486df){if(!fs[_0xc1e7('0x54')](_0x5486df[_0xc1e7('0x52')])){throw new db[(_0xc1e7('0x58'))][(_0xc1e7('0x61'))](_0xc1e7('0x59'));}if(_0x5486df[_0xc1e7('0x5a')]){return _0x37da1b['download'](_0x5486df[_0xc1e7('0x52')],_0x5486df[_0xc1e7('0x5a')]+path[_0xc1e7('0x5b')](_0x5486df[_0xc1e7('0x52')]),function(){if(_0xc7a53a){fs[_0xc1e7('0x5c')](_0x5486df[_0xc1e7('0x52')]);}});}else{return _0x37da1b[_0xc1e7('0x4f')](_0x5486df[_0xc1e7('0x52')],function(_0x5f4bf7){if(_0xc7a53a){fs['unlink'](_0x5486df[_0xc1e7('0x52')]);}});}}})[_0xc1e7('0x4a')](handleError(_0x37da1b,null));};exports[_0xc1e7('0x29')]=function(_0x2e88c5,_0x49fb6a){return db[_0xc1e7('0x30')][_0xc1e7('0x4e')]({'where':{'id':_0x2e88c5[_0xc1e7('0x4c')]['id']}})[_0xc1e7('0x28')](function(_0x318ca2){if(_[_0xc1e7('0x62')](_0x318ca2)){throw new ReferenceError(_0xc1e7('0x63'));}return _0x318ca2;})[_0xc1e7('0x28')](function(_0x3c8b71){var _0x4c84b0=_0x3c8b71[_0xc1e7('0x52')];logger[_0xc1e7('0x64')](_0xc1e7('0x65'),_0x4c84b0);if(!_[_0xc1e7('0x62')](_0x3c8b71[_0xc1e7('0x52')])&&fs[_0xc1e7('0x54')](_0x4c84b0)){logger[_0xc1e7('0x64')](_0xc1e7('0x66')+_0x4c84b0+_0xc1e7('0x67'));fs['unlinkSync'](_0x4c84b0);}_0x4c84b0=_0x4c84b0+'.cypher';if(!_[_0xc1e7('0x62')](_0x3c8b71['value'])&&fs[_0xc1e7('0x54')](_0x4c84b0)){logger[_0xc1e7('0x64')](_0xc1e7('0x66')+_0x4c84b0+_0xc1e7('0x67'));fs[_0xc1e7('0x68')](_0x4c84b0);}return _0x3c8b71;})[_0xc1e7('0x28')](function(_0x378ff5){if(!_0x378ff5)throw new InternalError();return _0x378ff5[_0xc1e7('0x29')]();})['then'](function(){_0x49fb6a[_0xc1e7('0x22')](0xcc)[_0xc1e7('0x1c')]();})[_0xc1e7('0x4a')](handleError(_0x49fb6a,null));};function getBucketslist(_0xeb1143,_0x56339e,_0x28a0cd){return new Promise(function(_0x9a6c12,_0x47466a){var _0x30f922=new AWS['S3']({'accessKeyId':_0x56339e,'secretAccessKey':_0xeb1143,'region':_0x28a0cd});_0x30f922[_0xc1e7('0x69')]({},function(_0x257598,_0x4cd7c7){if(_0x257598){return _0x47466a(_0x257598);}else{return _0x9a6c12(_0x4cd7c7);}});});}function createBucket(_0x17993b,_0x4be326,_0x2cf281,_0x673824){return new Promise(function(_0x107637,_0x54afd7){var _0x4ea0ac=new AWS['S3']({'accessKeyId':_0x4be326,'secretAccessKey':_0x17993b,'region':_0x2cf281});_0x4ea0ac['createBucket']({'Bucket':_0x673824},function(_0x20ed37,_0x3b2a79){if(_0x20ed37){return _0x54afd7(_0x20ed37);}else{return _0x107637(_0x3b2a79);}});});}function uploadFile(_0x80c6e1,_0x18ae70,_0x532b96,_0x2eeba3,_0x598d3b,_0x408244){return new Promise(function(_0x2a716b,_0x3e85d1){var _0x49120a=new AWS['S3']({'accessKeyId':_0x18ae70,'secretAccessKey':_0x80c6e1,'region':_0x532b96});_0x49120a[_0xc1e7('0x6a')]({'Bucket':_0x2eeba3,'Key':_0x598d3b,'Body':_0x408244},function(_0x344396,_0x36b25a){if(_0x344396){return _0x3e85d1(_0x344396);}else{return _0x2a716b(_0x36b25a);}});});}function startTranscribe(_0x18bac3,_0x30d90b,_0x9f359a,_0x2433bf,_0x5ec723,_0x4a8167){return new Promise(function(_0x1ac232,_0x5b1bd4){var _0x63ac6f=new AWS[(_0xc1e7('0x6b'))]({'accessKeyId':_0x30d90b,'secretAccessKey':_0x18bac3,'region':_0x9f359a});_0x63ac6f['startTranscriptionJob']({'TranscriptionJobName':_0x2433bf,'LanguageCode':_0x5ec723,'Media':{'MediaFileUri':_0x4a8167}},function(_0x57063f,_0x535bbd){if(_0x57063f){return _0x5b1bd4(_0x57063f);}else{return _0x1ac232(_0x535bbd);}});});}function transcribe(_0x503044,_0x44d0dc,_0x2efd6b,_0x1348f5,_0x4a6923,_0x4f621c,_0x3a5a63){return new Promise(function(_0xdc96fa,_0x32b11e){var _0x20a621={};logger['info'](util[_0xc1e7('0x36')](_0xc1e7('0x6c'),_0x503044,_0x4a6923));return uploadFile(_0x44d0dc,_0x2efd6b,_0x1348f5,_0x4a6923,path[_0xc1e7('0x6d')](_0x4f621c),fs[_0xc1e7('0x6e')](_0x4f621c))[_0xc1e7('0x28')](function(_0x8ebd5e){logger[_0xc1e7('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x503044,_0x4a6923,_0x8ebd5e[_0xc1e7('0x6f')]));_0x20a621[_0xc1e7('0x70')]=_0x8ebd5e['Bucket'];_0x20a621[_0xc1e7('0x71')]=_0x8ebd5e[_0xc1e7('0x6f')];logger[_0xc1e7('0x64')](util[_0xc1e7('0x36')](_0xc1e7('0x72'),_0x503044));return startTranscribe(_0x44d0dc,_0x2efd6b,_0x1348f5,uuidv4(),_0x3a5a63,_0x8ebd5e[_0xc1e7('0x6f')]);})[_0xc1e7('0x28')](function(_0x47c9ed){logger['info'](util['format'](_0xc1e7('0x73'),_0x503044,_0x47c9ed['TranscriptionJob'][_0xc1e7('0x74')]));_0x20a621[_0xc1e7('0x75')]=_0x47c9ed[_0xc1e7('0x76')]['TranscriptionJobName'];_0x20a621[_0xc1e7('0x77')]=_0x47c9ed[_0xc1e7('0x76')][_0xc1e7('0x78')];return _0xdc96fa(_0x20a621);})['catch'](function(_0x35e373){return _0x32b11e(_0x35e373);});});}exports['runTranscribe']=function(_0x4b6477,_0x13c8ad,_0x23d740){var _0x297cb3;var _0x435082;var _0x2e74cc;var _0x432e01=require(_0xc1e7('0x50'));return db[_0xc1e7('0x30')][_0xc1e7('0x79')]({'where':{'id':_0x4b6477[_0xc1e7('0x4c')]['id']}})[_0xc1e7('0x28')](function(_0x416b93){if(_0x416b93){var _0x1d6cd5=util[_0xc1e7('0x36')](_0xc1e7('0x53'),_0x416b93[_0xc1e7('0x52')]);if(fs[_0xc1e7('0x54')](_0x1d6cd5)){cypher=!![];return _0x432e01[_0xc1e7('0x55')](_0x1d6cd5,_0x416b93[_0xc1e7('0x52')],config[_0xc1e7('0x56')][_0xc1e7('0x57')])[_0xc1e7('0x28')](function(){return _0x416b93;});}return _0x416b93;}})[_0xc1e7('0x28')](function(_0x23fbf0){if(!_0x23fbf0){throw new db['Sequelize']['ValidationError'](_0xc1e7('0x7a'));}_0x435082=_0x23fbf0;return db['Setting'][_0xc1e7('0x79')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x13c8ad,null))[_0xc1e7('0x28')](function(_0x54d714){if(_0x54d714){_0x297cb3=_0x54d714;if(!_0x297cb3[_0xc1e7('0x7b')]||!_0x297cb3[_0xc1e7('0x7c')]||!_0x297cb3['transcribeRegion']||!_0x297cb3[_0xc1e7('0x7d')]||!_0x297cb3[_0xc1e7('0x70')]){throw new db[(_0xc1e7('0x58'))]['ValidationError'](_0xc1e7('0x7e'));}if(_0x4b6477['body'][_0xc1e7('0x7f')]&&(!_0x297cb3[_0xc1e7('0x80')]||!_0x297cb3['sentimentAccountId']||!_0x297cb3['sentimentRegion']||!_0x297cb3[_0xc1e7('0x7d')]||!_0x297cb3[_0xc1e7('0x70')])){throw new db[(_0xc1e7('0x58'))][(_0xc1e7('0x61'))](_0xc1e7('0x81'));}return db[_0xc1e7('0x82')][_0xc1e7('0x79')]({'where':{'id':_0x297cb3[_0xc1e7('0x7c')]}});}})[_0xc1e7('0x28')](function(_0x45db9d){if(!_0x45db9d){throw new db[(_0xc1e7('0x58'))][(_0xc1e7('0x61'))](_0xc1e7('0x83'));}if(!_0x45db9d[_0xc1e7('0x84')]||!_0x45db9d[_0xc1e7('0x85')]){throw new db[(_0xc1e7('0x58'))][(_0xc1e7('0x61'))](_0xc1e7('0x86'));}_0x2e74cc=_0x45db9d;return getBucketslist(_0x2e74cc['data1'],_0x2e74cc['data2'],_0x297cb3['transcribeRegion']);})[_0xc1e7('0x28')](function(_0xc1cbb9){if(_0xc1cbb9&&_0xc1cbb9[_0xc1e7('0x87')]){var _0x44eb0f=_['find'](_0xc1cbb9[_0xc1e7('0x87')],function(_0x1d5f30){return _0x1d5f30[_0xc1e7('0x88')]===_0x297cb3[_0xc1e7('0x70')];});if(!_0x44eb0f){logger['info'](util['format'](_0xc1e7('0x89'),_0x4b6477[_0xc1e7('0x4c')]['id'],_0x297cb3['bucket']));return createBucket(_0x2e74cc[_0xc1e7('0x84')],_0x2e74cc[_0xc1e7('0x85')],_0x297cb3[_0xc1e7('0x8a')],_0x297cb3[_0xc1e7('0x70')]);}logger[_0xc1e7('0x64')](util['format'](_0xc1e7('0x8b'),_0x4b6477['params']['id'],_0x297cb3['bucket']));return;}})[_0xc1e7('0x28')](function(_0xb29f2c){if(_0x435082[_0xc1e7('0x77')]===_0xc1e7('0x8c')){return transcribe(_0x4b6477[_0xc1e7('0x4c')]['id'],_0x2e74cc['data1'],_0x2e74cc[_0xc1e7('0x85')],_0x297cb3[_0xc1e7('0x8a')],_0x297cb3[_0xc1e7('0x70')],_0x435082[_0xc1e7('0x52')],_0x297cb3[_0xc1e7('0x7d')]);}else{logger['info'](util[_0xc1e7('0x36')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4b6477[_0xc1e7('0x4c')]['id']));return{'transcribeStatus':_0xc1e7('0x8d')};}})['then'](function(_0x2c9620){if(_0x2c9620){_0x2c9620[_0xc1e7('0x8e')]=_0x4b6477[_0xc1e7('0x4d')][_0xc1e7('0x7f')];return _0x435082['updateAttributes'](_0x2c9620);}})['then'](respondWithResult(_0x13c8ad,null))[_0xc1e7('0x4a')](handleError(_0x13c8ad,null));};function writeFile(_0x30713a,_0x1425af){return new Promise(function(_0x48261c,_0x21511f){fs['writeFile'](_0x1425af,_0x30713a,function(_0x4548a9,_0x29cc24){if(_0x4548a9){return _0x21511f(_0x4548a9);}else{return _0x48261c(_0x29cc24);}});});}exports['downloadTranscribe']=function(_0x3f2014,_0x3236ae,_0x25a84a){return db[_0xc1e7('0x30')]['findOne']({'where':{'id':_0x3f2014[_0xc1e7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3236ae))[_0xc1e7('0x28')](function(_0x2895f3){if(_0x2895f3&&_0x2895f3['fileText']){var _0x21ba37=_0x2895f3[_0xc1e7('0x8f')];var _0x4ae372=config['root']+_0xc1e7('0x90')+_0x2895f3['id']+'.txt';if(fs[_0xc1e7('0x54')](_0x4ae372)){return _0x4ae372;}return writeFile(_0x21ba37,_0x4ae372)['then'](function(){return _0x4ae372;});}else{throw new db[(_0xc1e7('0x58'))][(_0xc1e7('0x61'))]('Transcript\x20not\x20available');}})[_0xc1e7('0x28')](function(_0x196332){return _0x3236ae[_0xc1e7('0x4f')](_0x196332);})[_0xc1e7('0x4a')](handleError(_0x3236ae));}; \ No newline at end of file +var _0xb008=['offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','map','VoiceRecording','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','download','../../components/encryptor','uniqueid','value','format','decryptFile','secrets','existsSync','ValidationError','filename','extname','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','Sequelize','unlink','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status'];(function(_0x2862f0,_0x26068e){var _0x158d61=function(_0xa9f848){while(--_0xa9f848){_0x2862f0['push'](_0x2862f0['shift']());}};_0x158d61(++_0x26068e);}(_0xb008,0x79));var _0x8b00=function(_0x22d626,_0xabca30){_0x22d626=_0x22d626-0x0;var _0x139c02=_0xb008[_0x22d626];return _0x139c02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b00('0x0'));var zipdir=require(_0x8b00('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b00('0x2'));var moment=require('moment');var BPromise=require(_0x8b00('0x3'));var Mustache=require('mustache');var util=require(_0x8b00('0x4'));var path=require(_0x8b00('0x5'));var sox=require(_0x8b00('0x6'));var csv=require(_0x8b00('0x7'));var ejs=require(_0x8b00('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8b00('0x9'));var crypto=require(_0x8b00('0xa'));var jsforce=require(_0x8b00('0xb'));var deskjs=require(_0x8b00('0xc'));var toCsv=require(_0x8b00('0x7'));var querystring=require(_0x8b00('0xd'));var Papa=require(_0x8b00('0xe'));var AWS=require(_0x8b00('0xf'));var uuidv4=require(_0x8b00('0x10'));var Redis=require(_0x8b00('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8b00('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b00('0x13'))('api');var utils=require(_0x8b00('0x14'));var config=require(_0x8b00('0x15'));var licenseUtil=require(_0x8b00('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18339b,_0x945b1c){_0x945b1c=_0x945b1c||0xcc;return function(_0x517af7){if(_0x517af7){return _0x18339b[_0x8b00('0x17')](_0x945b1c);}return _0x18339b['status'](_0x945b1c)[_0x8b00('0x18')]();};}function respondWithResult(_0x2b24d6,_0x2b5a76){_0x2b5a76=_0x2b5a76||0xc8;return function(_0x1858e8){if(_0x1858e8){return _0x2b24d6[_0x8b00('0x19')](_0x2b5a76)['json'](_0x1858e8);}};}function respondWithFilteredResult(_0x2dca56,_0x4610e5){return function(_0x2280fb){if(_0x2280fb){var _0x4f4217=typeof _0x4610e5[_0x8b00('0x1a')]===_0x8b00('0x1b')&&typeof _0x4610e5[_0x8b00('0x1c')]==='undefined';var _0x52145e=_0x2280fb[_0x8b00('0x1d')];var _0x4b3e63=_0x4f4217?0x0:_0x4610e5[_0x8b00('0x1a')];var _0x13ecb2=_0x4f4217?_0x2280fb[_0x8b00('0x1d')]:_0x4610e5[_0x8b00('0x1a')]+_0x4610e5[_0x8b00('0x1c')];var _0x3be33a;if(_0x13ecb2>=_0x52145e){_0x13ecb2=_0x52145e;_0x3be33a=0xc8;}else{_0x3be33a=0xce;}_0x2dca56[_0x8b00('0x19')](_0x3be33a);return _0x2dca56[_0x8b00('0x1e')](_0x8b00('0x1f'),_0x4b3e63+'-'+_0x13ecb2+'/'+_0x52145e)[_0x8b00('0x20')](_0x2280fb);}return null;};}function patchUpdates(_0x450394){return function(_0x1a7d03){try{jsonpatch['apply'](_0x1a7d03,_0x450394,!![]);}catch(_0x3123e6){return BPromise[_0x8b00('0x21')](_0x3123e6);}return _0x1a7d03[_0x8b00('0x22')]();};}function saveUpdates(_0x1e0c00,_0x41a340){return function(_0x9d51e5){if(_0x9d51e5){return _0x9d51e5[_0x8b00('0x23')](_0x1e0c00)['then'](function(_0x4baf5f){return _0x4baf5f;});}return null;};}function removeEntity(_0x3e1cf9,_0x14de89){return function(_0x2a2c3e){if(_0x2a2c3e){return _0x2a2c3e[_0x8b00('0x24')]()[_0x8b00('0x25')](function(){_0x3e1cf9[_0x8b00('0x19')](0xcc)[_0x8b00('0x18')]();});}};}function handleEntityNotFound(_0x9eb726,_0x4829f6){return function(_0x376746){if(!_0x376746){_0x9eb726[_0x8b00('0x17')](0x194);}return _0x376746;};}function handleError(_0x4c627b,_0x28fd4a){_0x28fd4a=_0x28fd4a||0x1f4;return function(_0x29ed79){logger['error'](_0x29ed79[_0x8b00('0x26')]);if(_0x29ed79[_0x8b00('0x27')]){delete _0x29ed79[_0x8b00('0x27')];}_0x4c627b[_0x8b00('0x19')](_0x28fd4a)[_0x8b00('0x28')](_0x29ed79);};}exports['index']=function(_0x19757f,_0x1f91c6){var _0x242240={},_0x590164={},_0x28f10d={'count':0x0,'rows':[]};var _0x504539=_[_0x8b00('0x29')](db[_0x8b00('0x2a')]['rawAttributes'],function(_0x34144e){return{'name':_0x34144e['fieldName'],'type':_0x34144e[_0x8b00('0x2b')][_0x8b00('0x2c')]};});_0x590164[_0x8b00('0x2d')]=_['differenceBy'](_[_0x8b00('0x29')](_0x504539,_0x8b00('0x27')),['format']);_0x590164[_0x8b00('0x2e')]=_[_0x8b00('0x2f')](_0x19757f['query']);_0x590164[_0x8b00('0x30')]=_[_0x8b00('0x31')](_0x590164[_0x8b00('0x2d')],_0x590164[_0x8b00('0x2e')]);_0x242240[_0x8b00('0x32')]=_[_0x8b00('0x31')](_0x590164[_0x8b00('0x2d')],qs[_0x8b00('0x33')](_0x19757f[_0x8b00('0x2e')][_0x8b00('0x33')]));_0x242240[_0x8b00('0x32')]=_0x242240['attributes'][_0x8b00('0x34')]?_0x242240[_0x8b00('0x32')]:_0x590164['model'];if(!_0x19757f[_0x8b00('0x2e')]['hasOwnProperty'](_0x8b00('0x35'))){_0x242240[_0x8b00('0x1c')]=qs[_0x8b00('0x1c')](_0x19757f[_0x8b00('0x2e')][_0x8b00('0x1c')]);_0x242240['offset']=qs[_0x8b00('0x1a')](_0x19757f['query'][_0x8b00('0x1a')]);}_0x242240[_0x8b00('0x36')]=qs[_0x8b00('0x37')](_0x19757f[_0x8b00('0x2e')][_0x8b00('0x37')]);_0x242240[_0x8b00('0x38')]=qs[_0x8b00('0x30')](_[_0x8b00('0x39')](_0x19757f[_0x8b00('0x2e')],_0x590164[_0x8b00('0x30')]),_0x504539);if(_0x19757f[_0x8b00('0x2e')]['filter']){_0x242240[_0x8b00('0x38')]=_['merge'](_0x242240[_0x8b00('0x38')],{'$or':_[_0x8b00('0x29')](_0x504539,function(_0x337c45){if(_0x337c45[_0x8b00('0x2b')]!==_0x8b00('0x3a')){var _0x1275a6={};_0x1275a6[_0x337c45[_0x8b00('0x27')]]={'$like':'%'+_0x19757f[_0x8b00('0x2e')]['filter']+'%'};return _0x1275a6;}})});}_0x242240=_[_0x8b00('0x3b')]({},_0x242240,_0x19757f[_0x8b00('0x3c')]);var _0x4984a3={'where':_0x242240[_0x8b00('0x38')]};return db['VoiceRecording'][_0x8b00('0x1d')](_0x4984a3)['then'](function(_0x464760){_0x28f10d['count']=_0x464760;if(_0x19757f[_0x8b00('0x2e')][_0x8b00('0x3d')]){_0x242240[_0x8b00('0x3e')]=[{'all':!![]}];}return db['VoiceRecording'][_0x8b00('0x3f')](_0x242240);})[_0x8b00('0x25')](function(_0x48ea5b){_0x28f10d[_0x8b00('0x40')]=_0x48ea5b;return _0x28f10d;})[_0x8b00('0x25')](respondWithFilteredResult(_0x1f91c6,_0x242240))[_0x8b00('0x41')](handleError(_0x1f91c6,null));};exports[_0x8b00('0x42')]=function(_0x5ba82a,_0x1bc03b){var _0x5246a8={'raw':![],'where':{'id':_0x5ba82a['params']['id']}},_0x1155fd={};_0x1155fd['model']=_[_0x8b00('0x2f')](db[_0x8b00('0x2a')][_0x8b00('0x43')]);_0x1155fd[_0x8b00('0x2e')]=_['keys'](_0x5ba82a[_0x8b00('0x2e')]);_0x1155fd[_0x8b00('0x30')]=_[_0x8b00('0x31')](_0x1155fd[_0x8b00('0x2d')],_0x1155fd[_0x8b00('0x2e')]);_0x5246a8[_0x8b00('0x32')]=_['intersection'](_0x1155fd[_0x8b00('0x2d')],qs[_0x8b00('0x33')](_0x5ba82a[_0x8b00('0x2e')][_0x8b00('0x33')]));_0x5246a8[_0x8b00('0x32')]=_0x5246a8[_0x8b00('0x32')][_0x8b00('0x34')]?_0x5246a8[_0x8b00('0x32')]:_0x1155fd[_0x8b00('0x2d')];if(_0x5ba82a['query'][_0x8b00('0x3d')]){_0x5246a8[_0x8b00('0x3e')]=[{'all':!![]}];}_0x5246a8=_[_0x8b00('0x3b')]({},_0x5246a8,_0x5ba82a[_0x8b00('0x3c')]);return db[_0x8b00('0x2a')]['find'](_0x5246a8)[_0x8b00('0x25')](handleEntityNotFound(_0x1bc03b,null))['then'](respondWithResult(_0x1bc03b,null))[_0x8b00('0x41')](handleError(_0x1bc03b,null));};exports[_0x8b00('0x44')]=function(_0x3c0e6c,_0x3e820a){return db['VoiceRecording']['create'](_0x3c0e6c['body'],{})[_0x8b00('0x25')](respondWithResult(_0x3e820a,0xc9))[_0x8b00('0x41')](handleError(_0x3e820a,null));};exports[_0x8b00('0x23')]=function(_0x425d82,_0x10e6ab){if(_0x425d82[_0x8b00('0x45')]['id']){delete _0x425d82['body']['id'];}return db[_0x8b00('0x2a')][_0x8b00('0x46')]({'where':{'id':_0x425d82[_0x8b00('0x47')]['id']}})[_0x8b00('0x25')](handleEntityNotFound(_0x10e6ab,null))['then'](saveUpdates(_0x425d82[_0x8b00('0x45')],null))['then'](respondWithResult(_0x10e6ab,null))['catch'](handleError(_0x10e6ab,null));};exports[_0x8b00('0x48')]=function(_0x1058f6,_0x3805e5){return db[_0x8b00('0x2a')][_0x8b00('0x48')]()[_0x8b00('0x25')](respondWithResult(_0x3805e5,null))['catch'](handleError(_0x3805e5,null));};exports[_0x8b00('0x49')]=function(_0x362555,_0x166d13,_0x3597de){var _0x400c52=require(_0x8b00('0x4a'));var _0x442929=![];var _0x28dad9={};if(_0x362555[_0x8b00('0x2e')][_0x8b00('0x2b')]&&_0x362555[_0x8b00('0x2e')][_0x8b00('0x2b')]===_0x8b00('0x4b')){_0x28dad9[_0x8b00('0x4b')]=_0x362555[_0x8b00('0x47')]['id'];}else{_0x28dad9['id']=_0x362555[_0x8b00('0x47')]['id'];}return db[_0x8b00('0x2a')][_0x8b00('0x46')]({'where':_0x28dad9,'attributes':['id',_0x8b00('0x4c')],'raw':!![]})[_0x8b00('0x25')](handleEntityNotFound(_0x166d13,null))['then'](function(_0x3a6ba3){if(_0x3a6ba3){var _0xdf34ad=_0x3a6ba3[_0x8b00('0x4c')];var _0x26e770=util[_0x8b00('0x4d')]('%s.cypher',_0xdf34ad);if(fs['existsSync'](_0x26e770)){_0x442929=!![];return _0x400c52[_0x8b00('0x4e')](_0x26e770,_0xdf34ad,config[_0x8b00('0x4f')]['recording'])[_0x8b00('0x25')](function(){return _0x3a6ba3;});}return _0x3a6ba3;}})['then'](function(_0x4f8e17){if(_0x4f8e17){var _0x7ed828=_0x4f8e17[_0x8b00('0x4c')];if(!fs[_0x8b00('0x50')](_0x7ed828)){throw new db['Sequelize'][(_0x8b00('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x4f8e17['filename']){return _0x166d13[_0x8b00('0x49')](_0x7ed828,_0x4f8e17[_0x8b00('0x52')]+path[_0x8b00('0x53')](_0x7ed828),function(){if(_0x442929){fs['unlink'](_0x7ed828);}});}else{return _0x166d13[_0x8b00('0x49')](_0x7ed828,function(_0x14aeb5){if(_0x442929){fs['unlink'](_0x7ed828);}});}}})[_0x8b00('0x41')](function(_0x11e333){if(_0x11e333['message']===_0x8b00('0x54')){_0x166d13['status'](0x194)[_0x8b00('0x28')]('Not\x20found');}else{return handleError(_0x166d13,null);}});};exports[_0x8b00('0x55')]=function(_0x56b2d7,_0x47e743,_0x5c4241){var _0x181300=require(_0x8b00('0x4a'));var _0x12cfaf=![];var _0x33232a={'$and':[db['sequelize'][_0x8b00('0x38')](db[_0x8b00('0x56')]['fn'](_0x8b00('0x57'),db[_0x8b00('0x56')]['col']('uniqueid')),_0x56b2d7['query'][_0x8b00('0x58')])]};if(_0x56b2d7[_0x8b00('0x2e')][_0x8b00('0x2b')]&&_0x56b2d7[_0x8b00('0x2e')][_0x8b00('0x2b')]===_0x8b00('0x4b')){_0x33232a['$and'][_0x8b00('0x59')]({'uniqueid':_0x56b2d7[_0x8b00('0x47')]['id']});}else{_0x33232a[_0x8b00('0x5a')]['push']({'id':_0x56b2d7['params']['id']});}return db['VoiceRecording'][_0x8b00('0x46')]({'where':_0x33232a,'attributes':['id',_0x8b00('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x47e743,null))[_0x8b00('0x25')](function(_0x422fb4){if(_0x422fb4){var _0xbef4f2=util[_0x8b00('0x4d')](_0x8b00('0x5b'),_0x422fb4[_0x8b00('0x4c')]);if(fs[_0x8b00('0x50')](_0xbef4f2)){_0x12cfaf=!![];return _0x181300[_0x8b00('0x4e')](_0xbef4f2,_0x422fb4[_0x8b00('0x4c')],config[_0x8b00('0x4f')]['recording'])[_0x8b00('0x25')](function(){return _0x422fb4;});}return _0x422fb4;}})[_0x8b00('0x25')](function(_0xb4379){if(_0xb4379){if(!fs[_0x8b00('0x50')](_0xb4379['value'])){throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))](_0x8b00('0x54'));}if(_0xb4379['filename']){return _0x47e743['download'](_0xb4379[_0x8b00('0x4c')],_0xb4379['filename']+path[_0x8b00('0x53')](_0xb4379[_0x8b00('0x4c')]),function(){if(_0x12cfaf){fs['unlink'](_0xb4379['value']);}});}else{return _0x47e743[_0x8b00('0x49')](_0xb4379['value'],function(_0x192dec){if(_0x12cfaf){fs[_0x8b00('0x5d')](_0xb4379[_0x8b00('0x4c')]);}});}}})[_0x8b00('0x41')](handleError(_0x47e743,null));};exports[_0x8b00('0x24')]=function(_0x3227bf,_0x3d6da0){return db[_0x8b00('0x2a')]['find']({'where':{'id':_0x3227bf[_0x8b00('0x47')]['id']}})[_0x8b00('0x25')](function(_0x54ccf6){if(_[_0x8b00('0x5e')](_0x54ccf6)){throw new ReferenceError(_0x8b00('0x5f'));}return _0x54ccf6;})[_0x8b00('0x25')](function(_0x4492b7){var _0x2e5f8a=_0x4492b7['value'];logger[_0x8b00('0x60')](_0x8b00('0x61'),_0x2e5f8a);if(!_['isNil'](_0x4492b7[_0x8b00('0x4c')])&&fs[_0x8b00('0x50')](_0x2e5f8a)){logger[_0x8b00('0x60')](_0x8b00('0x62')+_0x2e5f8a+_0x8b00('0x63'));fs['unlinkSync'](_0x2e5f8a);}_0x2e5f8a=_0x2e5f8a+_0x8b00('0x64');if(!_[_0x8b00('0x5e')](_0x4492b7[_0x8b00('0x4c')])&&fs[_0x8b00('0x50')](_0x2e5f8a)){logger[_0x8b00('0x60')](_0x8b00('0x62')+_0x2e5f8a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8b00('0x65')](_0x2e5f8a);}return _0x4492b7;})[_0x8b00('0x25')](function(_0x2a96d4){if(!_0x2a96d4)throw new InternalError();return _0x2a96d4[_0x8b00('0x24')]();})['then'](function(){_0x3d6da0[_0x8b00('0x19')](0xcc)[_0x8b00('0x18')]();})[_0x8b00('0x41')](handleError(_0x3d6da0,null));};function getBucketslist(_0x51fffa,_0x15846f,_0x3fdaf9){return new Promise(function(_0x5c47aa,_0x444170){var _0x4fe820=new AWS['S3']({'accessKeyId':_0x15846f,'secretAccessKey':_0x51fffa,'region':_0x3fdaf9});_0x4fe820['listBuckets']({},function(_0x4fd521,_0x2c8047){if(_0x4fd521){return _0x444170(_0x4fd521);}else{return _0x5c47aa(_0x2c8047);}});});}function createBucket(_0x3b76d0,_0xb97e97,_0x5ac087,_0x121a51){return new Promise(function(_0x2adb17,_0x91ea00){var _0x55fa3b=new AWS['S3']({'accessKeyId':_0xb97e97,'secretAccessKey':_0x3b76d0,'region':_0x5ac087});_0x55fa3b['createBucket']({'Bucket':_0x121a51},function(_0x276837,_0x520e2a){if(_0x276837){return _0x91ea00(_0x276837);}else{return _0x2adb17(_0x520e2a);}});});}function uploadFile(_0x3dc774,_0x31945f,_0x519a5c,_0x1fdcaa,_0x1a74a6,_0x4a5199){return new Promise(function(_0x2611ef,_0x3f3995){var _0x1c35e9=new AWS['S3']({'accessKeyId':_0x31945f,'secretAccessKey':_0x3dc774,'region':_0x519a5c});_0x1c35e9['upload']({'Bucket':_0x1fdcaa,'Key':_0x1a74a6,'Body':_0x4a5199},function(_0x121813,_0x3b379f){if(_0x121813){return _0x3f3995(_0x121813);}else{return _0x2611ef(_0x3b379f);}});});}function startTranscribe(_0x474e4c,_0x1e022d,_0x5896f4,_0x269ffb,_0xfeb098,_0x445580){return new Promise(function(_0x462a9a,_0x2acd7d){var _0x245c79=new AWS[(_0x8b00('0x66'))]({'accessKeyId':_0x1e022d,'secretAccessKey':_0x474e4c,'region':_0x5896f4});_0x245c79[_0x8b00('0x67')]({'TranscriptionJobName':_0x269ffb,'LanguageCode':_0xfeb098,'Media':{'MediaFileUri':_0x445580}},function(_0x5303f4,_0xc2836e){if(_0x5303f4){return _0x2acd7d(_0x5303f4);}else{return _0x462a9a(_0xc2836e);}});});}function transcribe(_0x332a8c,_0x2f38b3,_0xbbf272,_0x3963cc,_0x23a6a4,_0x577c08,_0x2a487f){return new Promise(function(_0x153c78,_0x1b133f){var _0x171c49={};logger[_0x8b00('0x60')](util[_0x8b00('0x4d')](_0x8b00('0x68'),_0x332a8c,_0x23a6a4));return uploadFile(_0x2f38b3,_0xbbf272,_0x3963cc,_0x23a6a4,path[_0x8b00('0x69')](_0x577c08),fs['readFileSync'](_0x577c08))[_0x8b00('0x25')](function(_0x8af8f8){logger['info'](util[_0x8b00('0x4d')](_0x8b00('0x6a'),_0x332a8c,_0x23a6a4,_0x8af8f8[_0x8b00('0x6b')]));_0x171c49['bucket']=_0x8af8f8[_0x8b00('0x6c')];_0x171c49[_0x8b00('0x6d')]=_0x8af8f8[_0x8b00('0x6b')];logger[_0x8b00('0x60')](util['format'](_0x8b00('0x6e'),_0x332a8c));return startTranscribe(_0x2f38b3,_0xbbf272,_0x3963cc,uuidv4(),_0x2a487f,_0x8af8f8['Location']);})[_0x8b00('0x25')](function(_0x12e1c9){logger['info'](util[_0x8b00('0x4d')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x332a8c,_0x12e1c9[_0x8b00('0x6f')][_0x8b00('0x70')]));_0x171c49[_0x8b00('0x71')]=_0x12e1c9[_0x8b00('0x6f')][_0x8b00('0x70')];_0x171c49[_0x8b00('0x72')]=_0x12e1c9[_0x8b00('0x6f')][_0x8b00('0x73')];return _0x153c78(_0x171c49);})[_0x8b00('0x41')](function(_0x139933){return _0x1b133f(_0x139933);});});}exports[_0x8b00('0x74')]=function(_0x1bb316,_0x38cff1,_0x53f29a){var _0x2a46c1;var _0x248a13;var _0x2cd749;var _0x2a0e3d=require('../../components/encryptor');return db['VoiceRecording'][_0x8b00('0x75')]({'where':{'id':_0x1bb316['params']['id']}})['then'](function(_0x480fe6){if(_0x480fe6){var _0x392883=util[_0x8b00('0x4d')]('%s.cypher',_0x480fe6['value']);if(fs[_0x8b00('0x50')](_0x392883)){cypher=!![];return _0x2a0e3d[_0x8b00('0x4e')](_0x392883,_0x480fe6['value'],config[_0x8b00('0x4f')][_0x8b00('0x76')])['then'](function(){return _0x480fe6;});}return _0x480fe6;}})[_0x8b00('0x25')](function(_0x3027f2){if(!_0x3027f2){throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))](_0x8b00('0x77'));}_0x248a13=_0x3027f2;return db[_0x8b00('0x78')][_0x8b00('0x75')]({'where':{'id':0x1}});})[_0x8b00('0x25')](handleEntityNotFound(_0x38cff1,null))[_0x8b00('0x25')](function(_0x577619){if(_0x577619){_0x2a46c1=_0x577619;if(!_0x2a46c1[_0x8b00('0x79')]||!_0x2a46c1[_0x8b00('0x7a')]||!_0x2a46c1[_0x8b00('0x7b')]||!_0x2a46c1['language']||!_0x2a46c1[_0x8b00('0x7c')]){throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))](_0x8b00('0x7d'));}if(_0x1bb316[_0x8b00('0x45')][_0x8b00('0x7e')]&&(!_0x2a46c1[_0x8b00('0x7f')]||!_0x2a46c1[_0x8b00('0x80')]||!_0x2a46c1[_0x8b00('0x81')]||!_0x2a46c1[_0x8b00('0x82')]||!_0x2a46c1[_0x8b00('0x7c')])){throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))](_0x8b00('0x83'));}return db['CloudProvider'][_0x8b00('0x75')]({'where':{'id':_0x2a46c1['transcribeAccountId']}});}})['then'](function(_0x58cecd){if(!_0x58cecd){throw new db[(_0x8b00('0x5c'))]['ValidationError'](_0x8b00('0x84'));}if(!_0x58cecd[_0x8b00('0x85')]||!_0x58cecd[_0x8b00('0x86')]){throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))]('Cloud\x20Provider\x20not\x20configured');}_0x2cd749=_0x58cecd;return getBucketslist(_0x2cd749[_0x8b00('0x85')],_0x2cd749['data2'],_0x2a46c1[_0x8b00('0x7b')]);})[_0x8b00('0x25')](function(_0x49f0ee){if(_0x49f0ee&&_0x49f0ee['Buckets']){var _0x7eef0c=_[_0x8b00('0x46')](_0x49f0ee[_0x8b00('0x87')],function(_0x52569b){return _0x52569b[_0x8b00('0x88')]===_0x2a46c1[_0x8b00('0x7c')];});if(!_0x7eef0c){logger[_0x8b00('0x60')](util[_0x8b00('0x4d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x1bb316[_0x8b00('0x47')]['id'],_0x2a46c1[_0x8b00('0x7c')]));return createBucket(_0x2cd749[_0x8b00('0x85')],_0x2cd749['data2'],_0x2a46c1['transcribeRegion'],_0x2a46c1['bucket']);}logger['info'](util[_0x8b00('0x4d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1bb316[_0x8b00('0x47')]['id'],_0x2a46c1[_0x8b00('0x7c')]));return;}})[_0x8b00('0x25')](function(_0x426a4c){if(_0x248a13[_0x8b00('0x72')]===_0x8b00('0x89')){return transcribe(_0x1bb316['params']['id'],_0x2cd749[_0x8b00('0x85')],_0x2cd749[_0x8b00('0x86')],_0x2a46c1['transcribeRegion'],_0x2a46c1[_0x8b00('0x7c')],_0x248a13[_0x8b00('0x4c')],_0x2a46c1['language']);}else{logger['info'](util[_0x8b00('0x4d')](_0x8b00('0x8a'),_0x1bb316[_0x8b00('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x8b00('0x25')](function(_0x2b608b){if(_0x2b608b){_0x2b608b[_0x8b00('0x8b')]=_0x1bb316['body'][_0x8b00('0x7e')];return _0x248a13[_0x8b00('0x8c')](_0x2b608b);}})[_0x8b00('0x25')](respondWithResult(_0x38cff1,null))[_0x8b00('0x41')](handleError(_0x38cff1,null));};function writeFile(_0x544049,_0x552e76){return new Promise(function(_0x5d7055,_0x15b8af){fs[_0x8b00('0x8d')](_0x552e76,_0x544049,function(_0x2f37b7,_0x52723b){if(_0x2f37b7){return _0x15b8af(_0x2f37b7);}else{return _0x5d7055(_0x52723b);}});});}exports[_0x8b00('0x8e')]=function(_0x1de324,_0x3579ef,_0x514eba){return db['VoiceRecording'][_0x8b00('0x75')]({'where':{'id':_0x1de324[_0x8b00('0x47')]['id']}})[_0x8b00('0x25')](handleEntityNotFound(_0x3579ef))[_0x8b00('0x25')](function(_0x368e2e){if(_0x368e2e&&_0x368e2e[_0x8b00('0x8f')]){var _0x4ca186=_0x368e2e[_0x8b00('0x8f')];var _0x36f158=config[_0x8b00('0x90')]+_0x8b00('0x91')+_0x368e2e['id']+_0x8b00('0x92');if(fs[_0x8b00('0x50')](_0x36f158)){return _0x36f158;}return writeFile(_0x4ca186,_0x36f158)[_0x8b00('0x25')](function(){return _0x36f158;});}else{throw new db[(_0x8b00('0x5c'))][(_0x8b00('0x51'))]('Transcript\x20not\x20available');}})[_0x8b00('0x25')](function(_0x26e3f2){return _0x3579ef[_0x8b00('0x49')](_0x26e3f2);})[_0x8b00('0x41')](handleError(_0x3579ef));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 5cda434..8d0a719 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 _0xbc6f=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','util','api','request-promise','rimraf','../../config/environment'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0xbc6f,0x166));var _0xfbc6=function(_0x2d321f,_0x196439){_0x2d321f=_0x2d321f-0x0;var _0x16744f=_0xbc6f[_0x2d321f];return _0x16744f;};'use strict';var _=require('lodash');var util=require(_0xfbc6('0x0'));var logger=require('../../config/logger')(_0xfbc6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfbc6('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc6('0x3'));var config=require(_0xfbc6('0x4'));var attributes=require(_0xfbc6('0x5'));module[_0xfbc6('0x6')]=function(_0xd637a8,_0x5a3181){return _0xd637a8[_0xfbc6('0x7')](_0xfbc6('0x8'),attributes,{'tableName':_0xfbc6('0x9'),'paranoid':![],'indexes':[{'name':_0xfbc6('0xa'),'fields':[_0xfbc6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3970=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceRecording','voice_recordings'];(function(_0xc930ac,_0x25f008){var _0x2fafae=function(_0x39e532){while(--_0x39e532){_0xc930ac['push'](_0xc930ac['shift']());}};_0x2fafae(++_0x25f008);}(_0x3970,0x1d4));var _0x0397=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x3970[_0x2338fa];return _0x42df9b;};'use strict';var _=require(_0x0397('0x0'));var util=require(_0x0397('0x1'));var logger=require('../../config/logger')(_0x0397('0x2'));var moment=require('moment');var BPromise=require(_0x0397('0x3'));var rp=require(_0x0397('0x4'));var fs=require('fs');var path=require(_0x0397('0x5'));var rimraf=require(_0x0397('0x6'));var config=require(_0x0397('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x0397('0x8')]=function(_0xc638c0,_0x15dbbe){return _0xc638c0[_0x0397('0x9')](_0x0397('0xa'),attributes,{'tableName':_0x0397('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 63d04b8..57ebde3 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 _0x0adf=['attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','body','options','where'];(function(_0x3f6af9,_0x553094){var _0x6cc311=function(_0x11a9a4){while(--_0x11a9a4){_0x3f6af9['push'](_0x3f6af9['shift']());}};_0x6cc311(++_0x553094);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x2055ed,_0x5eb92d){_0x2055ed=_0x2055ed-0x0;var _0x1e67fb=_0x0adf[_0x2055ed];return _0x1e67fb;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eca0e,_0x44cf37,_0x170574){return new BPromise(function(_0x41c99d,_0xa9a315){return client[_0xf0ad('0xb')](_0x2eca0e,_0x170574)[_0xf0ad('0xc')](function(_0x5bdf69){logger[_0xf0ad('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x44cf37,_0xf0ad('0xe'));logger[_0xf0ad('0xf')](_0xf0ad('0x10'),_0x44cf37,_0xf0ad('0xe'),JSON[_0xf0ad('0x11')](_0x5bdf69));if(_0x5bdf69['error']){if(_0x5bdf69['error'][_0xf0ad('0x12')]===0x1f4){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x5bdf69[_0xf0ad('0x13')]['message']);return _0xa9a315(_0x5bdf69[_0xf0ad('0x13')][_0xf0ad('0x15')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x44cf37,_0x5bdf69['error'][_0xf0ad('0x15')]);return _0x41c99d(_0x5bdf69['error'][_0xf0ad('0x15')]);}else{logger[_0xf0ad('0xd')](_0xf0ad('0x14'),_0x44cf37,_0xf0ad('0xe'));_0x41c99d(_0x5bdf69[_0xf0ad('0x16')]['message']);}})[_0xf0ad('0x17')](function(_0x285ab0){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x285ab0);_0xa9a315(_0x285ab0);});});}exports['UpdateVoiceRecording']=function(_0x4e9970){var _0x2466e8=this;return new Promise(function(_0x46fb20,_0x49f2ec){return db[_0xf0ad('0x18')][_0xf0ad('0x19')](_0x4e9970[_0xf0ad('0x1a')],{'raw':_0x4e9970[_0xf0ad('0x1b')]?_0x4e9970['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9970[_0xf0ad('0x1b')]?_0x4e9970[_0xf0ad('0x1b')][_0xf0ad('0x1c')]||null:null,'attributes':_0x4e9970[_0xf0ad('0x1b')]?_0x4e9970[_0xf0ad('0x1b')][_0xf0ad('0x1d')]||null:null,'limit':_0x4e9970['options']?_0x4e9970[_0xf0ad('0x1b')][_0xf0ad('0x1e')]||null:null})[_0xf0ad('0xc')](function(_0x3ece1e){logger[_0xf0ad('0xd')](_0xf0ad('0x1f'),_0x4e9970);logger[_0xf0ad('0xf')](_0xf0ad('0x1f'),_0x4e9970,JSON[_0xf0ad('0x11')](_0x3ece1e));_0x46fb20(_0x3ece1e);})[_0xf0ad('0x17')](function(_0x39b3e8){logger[_0xf0ad('0x13')](_0xf0ad('0x1f'),_0x39b3e8[_0xf0ad('0x15')],_0x4e9970);_0x49f2ec(_0x2466e8[_0xf0ad('0x13')](0x1f4,_0x39b3e8['message']));});});};exports[_0xf0ad('0x20')]=function(_0x1507a3){var _0x248794=this;return new Promise(function(_0x7377d7,_0x28c280){var _0x30f8ee=require('../../components/encryptor');var _0x2cbe00;return db[_0xf0ad('0x21')][_0xf0ad('0x22')]({'attributes':['id',_0xf0ad('0x23')],'where':{'id':0x1},'raw':!![]})[_0xf0ad('0xc')](function(_0x1ac25c){_0x2cbe00=_0x1ac25c;return db[_0xf0ad('0x18')][_0xf0ad('0x24')](_0x1507a3[_0xf0ad('0x1a')]);})[_0xf0ad('0xc')](function(_0x2d1b2f){if(_0x2cbe00['callRecordingEncryption']&&fs[_0xf0ad('0x25')](_0x2d1b2f['value'])){var _0x83f211=util['format'](_0xf0ad('0x26'),_0x2d1b2f[_0xf0ad('0x27')]);return _0x30f8ee[_0xf0ad('0x28')](_0x2d1b2f[_0xf0ad('0x27')],_0x83f211,config[_0xf0ad('0x29')][_0xf0ad('0x2a')])[_0xf0ad('0xc')](function(){fs[_0xf0ad('0x2b')](_0x2d1b2f['value']);logger['info'](_0xf0ad('0x2c'));return _0x2d1b2f;});}return _0x2d1b2f;})[_0xf0ad('0xc')](function(_0xd608bf){logger[_0xf0ad('0xd')]('CreateVoiceRecording',_0x1507a3);logger[_0xf0ad('0xf')]('CreateVoiceRecording',_0x1507a3,JSON[_0xf0ad('0x11')](_0xd608bf));_0x7377d7(_0xd608bf);})['catch'](function(_0x4136b9){logger['error'](_0xf0ad('0x20'),_0x4136b9[_0xf0ad('0x15')],_0x1507a3);_0x28c280(_0x248794[_0xf0ad('0x13')](0x1f4,_0x4136b9[_0xf0ad('0x15')]));});});}; \ No newline at end of file +var _0x77e6=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','VoiceRecording','update','options','raw','attributes','limit','UpdateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x77e6,0x1a6));var _0x677e=function(_0x242c98,_0x2dd853){_0x242c98=_0x242c98-0x0;var _0x184a6a=_0x77e6[_0x242c98];return _0x184a6a;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var moment=require(_0x677e('0x2'));var BPromise=require(_0x677e('0x3'));var rs=require(_0x677e('0x4'));var fs=require('fs');var Redis=require(_0x677e('0x5'));var db=require(_0x677e('0x6'))['db'];var utils=require(_0x677e('0x7'));var logger=require('../../config/logger')(_0x677e('0x8'));var config=require(_0x677e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x677e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40d314,_0x4d1a57,_0x5a5dd3){return new BPromise(function(_0x2eb40c,_0x4c519f){return client[_0x677e('0xb')](_0x40d314,_0x5a5dd3)[_0x677e('0xc')](function(_0x552931){logger[_0x677e('0xd')]('VoiceRecording,\x20%s,\x20%s',_0x4d1a57,_0x677e('0xe'));logger[_0x677e('0xf')](_0x677e('0x10'),_0x4d1a57,_0x677e('0xe'),JSON[_0x677e('0x11')](_0x552931));if(_0x552931[_0x677e('0x12')]){if(_0x552931[_0x677e('0x12')][_0x677e('0x13')]===0x1f4){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x552931[_0x677e('0x12')][_0x677e('0x15')]);return _0x4c519f(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4d1a57,_0x552931['error'][_0x677e('0x15')]);return _0x2eb40c(_0x552931[_0x677e('0x12')][_0x677e('0x15')]);}else{logger[_0x677e('0xd')](_0x677e('0x14'),_0x4d1a57,_0x677e('0xe'));_0x2eb40c(_0x552931[_0x677e('0x16')][_0x677e('0x15')]);}})[_0x677e('0x17')](function(_0x32d306){logger[_0x677e('0x12')](_0x677e('0x14'),_0x4d1a57,_0x32d306);_0x4c519f(_0x32d306);});});}exports['UpdateVoiceRecording']=function(_0x1c5124){var _0x2ef2bf=this;return new Promise(function(_0x385b06,_0x221b6d){return db[_0x677e('0x18')][_0x677e('0x19')](_0x1c5124['body'],{'raw':_0x1c5124[_0x677e('0x1a')]?_0x1c5124['options'][_0x677e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')]['where']||null:null,'attributes':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1c')]||null:null,'limit':_0x1c5124[_0x677e('0x1a')]?_0x1c5124[_0x677e('0x1a')][_0x677e('0x1d')]||null:null})[_0x677e('0xc')](function(_0x52ee8b){logger['info']('UpdateVoiceRecording',_0x1c5124);logger[_0x677e('0xf')](_0x677e('0x1e'),_0x1c5124,JSON[_0x677e('0x11')](_0x52ee8b));_0x385b06(_0x52ee8b);})[_0x677e('0x17')](function(_0x424e5d){logger[_0x677e('0x12')](_0x677e('0x1e'),_0x424e5d[_0x677e('0x15')],_0x1c5124);_0x221b6d(_0x2ef2bf[_0x677e('0x12')](0x1f4,_0x424e5d[_0x677e('0x15')]));});});};exports['CreateVoiceRecording']=function(_0x5f0ba2){var _0x3d3370=this;return new Promise(function(_0x184f68,_0x4d9e0b){var _0x51e39d=require(_0x677e('0x1f'));var _0xf6b3ad;return db[_0x677e('0x20')][_0x677e('0x21')]({'attributes':['id',_0x677e('0x22')],'where':{'id':0x1},'raw':!![]})['then'](function(_0xcd4646){_0xf6b3ad=_0xcd4646;return db[_0x677e('0x18')][_0x677e('0x23')](_0x5f0ba2[_0x677e('0x24')]);})[_0x677e('0xc')](function(_0x2bd6fb){if(_0xf6b3ad[_0x677e('0x22')]&&fs[_0x677e('0x25')](_0x2bd6fb[_0x677e('0x26')])){var _0x4c5113=util[_0x677e('0x27')](_0x677e('0x28'),_0x2bd6fb[_0x677e('0x26')]);return _0x51e39d[_0x677e('0x29')](_0x2bd6fb[_0x677e('0x26')],_0x4c5113,config[_0x677e('0x2a')][_0x677e('0x2b')])[_0x677e('0xc')](function(){fs[_0x677e('0x2c')](_0x2bd6fb[_0x677e('0x26')]);logger['info'](_0x677e('0x2d'));return _0x2bd6fb;});}return _0x2bd6fb;})[_0x677e('0xc')](function(_0x2b6f24){logger[_0x677e('0xd')](_0x677e('0x2e'),_0x5f0ba2);logger[_0x677e('0xf')]('CreateVoiceRecording',_0x5f0ba2,JSON[_0x677e('0x11')](_0x2b6f24));_0x184f68(_0x2b6f24);})[_0x677e('0x17')](function(_0x2d0bc0){logger['error'](_0x677e('0x2e'),_0x2d0bc0[_0x677e('0x15')],_0x5f0ba2);_0x4d9e0b(_0x3d3370[_0x677e('0x12')](0x1f4,_0x2d0bc0[_0x677e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index efc255c..b79df46 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 _0x4917=['show','post','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x3c04d7,_0x472801){var _0x2fb24=function(_0x335b91){while(--_0x335b91){_0x3c04d7['push'](_0x3c04d7['shift']());}};_0x2fb24(++_0x472801);}(_0x4917,0xd3));var _0x7491=function(_0x136936,_0x5395a1){_0x136936=_0x136936-0x0;var _0x3df7ec=_0x4917[_0x136936];return _0x3df7ec;};'use strict';var multer=require(_0x7491('0x0'));var util=require('util');var path=require(_0x7491('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7491('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7491('0x3'));var interaction=require(_0x7491('0x4'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x7491('0x5')]('/',auth[_0x7491('0x6')](),controller[_0x7491('0x7')]);router[_0x7491('0x5')]('/describe',auth['isAuthenticated'](),controller[_0x7491('0x8')]);router['get'](_0x7491('0x9'),auth['isAuthenticated'](),controller[_0x7491('0xa')]);router[_0x7491('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7491('0xc')](_0x7491('0x9'),auth['isAuthenticated'](),controller[_0x7491('0xd')]);router[_0x7491('0xe')](_0x7491('0x9'),auth[_0x7491('0x6')](),controller[_0x7491('0xf')]);module[_0x7491('0x10')]=router; \ No newline at end of file +var _0xd1d2=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x462074,_0x2a2af8){var _0x2f5968=function(_0x4e5704){while(--_0x4e5704){_0x462074['push'](_0x462074['shift']());}};_0x2f5968(++_0x2a2af8);}(_0xd1d2,0xf4));var _0x2d1d=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0xd1d2[_0xc0d9bc];return _0x32ff73;};'use strict';var multer=require('multer');var util=require(_0x2d1d('0x0'));var path=require(_0x2d1d('0x1'));var timeout=require(_0x2d1d('0x2'));var express=require('express');var router=express[_0x2d1d('0x3')]();var fs_extra=require(_0x2d1d('0x4'));var auth=require(_0x2d1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2d1d('0x6'));var controller=require(_0x2d1d('0x7'));router[_0x2d1d('0x8')]('/',auth[_0x2d1d('0x9')](),controller[_0x2d1d('0xa')]);router['get'](_0x2d1d('0xb'),auth[_0x2d1d('0x9')](),controller[_0x2d1d('0xc')]);router[_0x2d1d('0x8')](_0x2d1d('0xd'),auth[_0x2d1d('0x9')](),controller[_0x2d1d('0xe')]);router[_0x2d1d('0xf')]('/',auth['isAuthenticated'](),controller[_0x2d1d('0x10')]);router[_0x2d1d('0x11')](_0x2d1d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x2d1d('0x12')](_0x2d1d('0xd'),auth[_0x2d1d('0x9')](),controller[_0x2d1d('0x13')]);module[_0x2d1d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 129005e..ffddde4 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 _0x539e=['blind','attended','STRING','Yes','moment','ENUM'];(function(_0x40a6cf,_0x598a82){var _0x1d24cd=function(_0x1a2bbc){while(--_0x1a2bbc){_0x40a6cf['push'](_0x40a6cf['shift']());}};_0x1d24cd(++_0x598a82);}(_0x539e,0xb2));var _0xe539=function(_0x2a3bf8,_0x2f0d96){_0x2a3bf8=_0x2a3bf8-0x0;var _0x49063d=_0x539e[_0x2a3bf8];return _0x49063d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe539('0x0'));module['exports']={'type':{'type':Sequelize[_0xe539('0x1')](_0xe539('0x2'),_0xe539('0x3'))},'result':{'type':Sequelize[_0xe539('0x4')]},'transfererchannel':{'type':Sequelize[_0xe539('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xe539('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xe539('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xe539('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xe539('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0xe539('0x4')]},'transfereechannel':{'type':Sequelize[_0xe539('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xe539('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xe539('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xe539('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xe539('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xe539('0x4')]},'transfereeexten':{'type':Sequelize[_0xe539('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xe539('0x4')]},'isexternal':{'type':Sequelize[_0xe539('0x1')](_0xe539('0x5'),'No')},'context':{'type':Sequelize[_0xe539('0x4')]},'extension':{'type':Sequelize[_0xe539('0x4')]}}; \ No newline at end of file +var _0x6b2c=['STRING','sequelize','exports','ENUM'];(function(_0xadcfdc,_0x4bd341){var _0x119c5e=function(_0x38f458){while(--_0x38f458){_0xadcfdc['push'](_0xadcfdc['shift']());}};_0x119c5e(++_0x4bd341);}(_0x6b2c,0xf9));var _0xc6b2=function(_0x13653b,_0x52bc7e){_0x13653b=_0x13653b-0x0;var _0x3f7f0c=_0x6b2c[_0x13653b];return _0x3f7f0c;};'use strict';var Sequelize=require(_0xc6b2('0x0'));var moment=require('moment');module[_0xc6b2('0x1')]={'type':{'type':Sequelize[_0xc6b2('0x2')]('blind','attended')},'result':{'type':Sequelize[_0xc6b2('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xc6b2('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xc6b2('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xc6b2('0x3')]},'transferercontext':{'type':Sequelize[_0xc6b2('0x3')]},'transfererexten':{'type':Sequelize[_0xc6b2('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xc6b2('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xc6b2('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xc6b2('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xc6b2('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xc6b2('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xc6b2('0x3')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0xc6b2('0x3')]},'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 99b0e39..aa4b629 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 _0xc276=['find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include'];(function(_0x2f086b,_0x5333f7){var _0x330112=function(_0x9b07d9){while(--_0x9b07d9){_0x2f086b['push'](_0x2f086b['shift']());}};_0x330112(++_0x5333f7);}(_0xc276,0x1de));var _0x6c27=function(_0x4a4902,_0xef5be1){_0x4a4902=_0x4a4902-0x0;var _0x31b76a=_0xc276[_0x4a4902];return _0x31b76a;};'use strict';var emlformat=require(_0x6c27('0x0'));var rimraf=require(_0x6c27('0x1'));var zipdir=require(_0x6c27('0x2'));var jsonpatch=require(_0x6c27('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6c27('0x4'));var Mustache=require(_0x6c27('0x5'));var util=require('util');var path=require(_0x6c27('0x6'));var sox=require(_0x6c27('0x7'));var csv=require(_0x6c27('0x8'));var ejs=require(_0x6c27('0x9'));var fs=require('fs');var fs_extra=require(_0x6c27('0xa'));var _=require(_0x6c27('0xb'));var squel=require(_0x6c27('0xc'));var crypto=require(_0x6c27('0xd'));var jsforce=require(_0x6c27('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6c27('0x8'));var querystring=require(_0x6c27('0xf'));var Papa=require(_0x6c27('0x10'));var Redis=require(_0x6c27('0x11'));var authService=require(_0x6c27('0x12'));var qs=require(_0x6c27('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c27('0x14'));var logger=require(_0x6c27('0x15'))(_0x6c27('0x16'));var utils=require(_0x6c27('0x17'));var config=require(_0x6c27('0x18'));var licenseUtil=require(_0x6c27('0x19'));var db=require(_0x6c27('0x1a'))['db'];function respondWithStatusCode(_0x5dc967,_0x3a9e41){_0x3a9e41=_0x3a9e41||0xcc;return function(_0x4d9e40){if(_0x4d9e40){return _0x5dc967[_0x6c27('0x1b')](_0x3a9e41);}return _0x5dc967[_0x6c27('0x1c')](_0x3a9e41)['end']();};}function respondWithResult(_0x49f013,_0x4ff7ea){_0x4ff7ea=_0x4ff7ea||0xc8;return function(_0x41d51b){if(_0x41d51b){return _0x49f013[_0x6c27('0x1c')](_0x4ff7ea)[_0x6c27('0x1d')](_0x41d51b);}};}function respondWithFilteredResult(_0x4aa1a7,_0x160105){return function(_0x3bb668){if(_0x3bb668){var _0x49dd2c=typeof _0x160105['offset']==='undefined'&&typeof _0x160105[_0x6c27('0x1e')]===_0x6c27('0x1f');var _0x3de903=_0x3bb668['count'];var _0x34f5c4=_0x49dd2c?0x0:_0x160105[_0x6c27('0x20')];var _0x1f4f6b=_0x49dd2c?_0x3bb668[_0x6c27('0x21')]:_0x160105[_0x6c27('0x20')]+_0x160105[_0x6c27('0x1e')];var _0x47e149;if(_0x1f4f6b>=_0x3de903){_0x1f4f6b=_0x3de903;_0x47e149=0xc8;}else{_0x47e149=0xce;}_0x4aa1a7['status'](_0x47e149);return _0x4aa1a7['set'](_0x6c27('0x22'),_0x34f5c4+'-'+_0x1f4f6b+'/'+_0x3de903)['json'](_0x3bb668);}return null;};}function patchUpdates(_0x5e0d9e){return function(_0x1ee592){try{jsonpatch[_0x6c27('0x23')](_0x1ee592,_0x5e0d9e,!![]);}catch(_0x19cc10){return BPromise['reject'](_0x19cc10);}return _0x1ee592[_0x6c27('0x24')]();};}function saveUpdates(_0x472122,_0x1ccb6f){return function(_0x380e8e){if(_0x380e8e){return _0x380e8e[_0x6c27('0x25')](_0x472122)[_0x6c27('0x26')](function(_0x99179){return _0x99179;});}return null;};}function removeEntity(_0x3cc7a6,_0x273c54){return function(_0x3f0c2b){if(_0x3f0c2b){return _0x3f0c2b[_0x6c27('0x27')]()[_0x6c27('0x26')](function(){_0x3cc7a6[_0x6c27('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4563b6,_0x394a55){return function(_0x1e5d50){if(!_0x1e5d50){_0x4563b6[_0x6c27('0x1b')](0x194);}return _0x1e5d50;};}function handleError(_0x6d5db7,_0x4c3646){_0x4c3646=_0x4c3646||0x1f4;return function(_0x3644c9){logger[_0x6c27('0x28')](_0x3644c9[_0x6c27('0x29')]);if(_0x3644c9[_0x6c27('0x2a')]){delete _0x3644c9[_0x6c27('0x2a')];}_0x6d5db7['status'](_0x4c3646)[_0x6c27('0x2b')](_0x3644c9);};}exports[_0x6c27('0x2c')]=function(_0x29d660,_0x298e0c){var _0x4478cb={},_0x1044ff={},_0x20d00b={'count':0x0,'rows':[]};var _0x2043eb=_[_0x6c27('0x2d')](db[_0x6c27('0x2e')]['rawAttributes'],function(_0x185ff2){return{'name':_0x185ff2[_0x6c27('0x2f')],'type':_0x185ff2[_0x6c27('0x30')]['key']};});_0x1044ff[_0x6c27('0x31')]=_['map'](_0x2043eb,_0x6c27('0x2a'));_0x1044ff[_0x6c27('0x32')]=_['keys'](_0x29d660[_0x6c27('0x32')]);_0x1044ff[_0x6c27('0x33')]=_[_0x6c27('0x34')](_0x1044ff[_0x6c27('0x31')],_0x1044ff[_0x6c27('0x32')]);_0x4478cb[_0x6c27('0x35')]=_[_0x6c27('0x34')](_0x1044ff[_0x6c27('0x31')],qs[_0x6c27('0x36')](_0x29d660[_0x6c27('0x32')][_0x6c27('0x36')]));_0x4478cb[_0x6c27('0x35')]=_0x4478cb[_0x6c27('0x35')][_0x6c27('0x37')]?_0x4478cb[_0x6c27('0x35')]:_0x1044ff['model'];if(!_0x29d660[_0x6c27('0x32')][_0x6c27('0x38')](_0x6c27('0x39'))){_0x4478cb['limit']=qs[_0x6c27('0x1e')](_0x29d660[_0x6c27('0x32')]['limit']);_0x4478cb[_0x6c27('0x20')]=qs['offset'](_0x29d660[_0x6c27('0x32')][_0x6c27('0x20')]);}_0x4478cb[_0x6c27('0x3a')]=qs[_0x6c27('0x3b')](_0x29d660[_0x6c27('0x32')][_0x6c27('0x3b')]);_0x4478cb[_0x6c27('0x3c')]=qs[_0x6c27('0x33')](_[_0x6c27('0x3d')](_0x29d660[_0x6c27('0x32')],_0x1044ff['filters']),_0x2043eb);if(_0x29d660[_0x6c27('0x32')][_0x6c27('0x3e')]){_0x4478cb['where']=_[_0x6c27('0x3f')](_0x4478cb['where'],{'$or':_['map'](_0x2043eb,function(_0x4fe2b4){if(_0x4fe2b4[_0x6c27('0x30')]!==_0x6c27('0x40')){var _0x47e91a={};_0x47e91a[_0x4fe2b4['name']]={'$like':'%'+_0x29d660[_0x6c27('0x32')][_0x6c27('0x3e')]+'%'};return _0x47e91a;}})});}_0x4478cb=_[_0x6c27('0x3f')]({},_0x4478cb,_0x29d660[_0x6c27('0x41')]);var _0x3dc728={'where':_0x4478cb[_0x6c27('0x3c')]};return db[_0x6c27('0x2e')][_0x6c27('0x21')](_0x3dc728)['then'](function(_0x284751){_0x20d00b['count']=_0x284751;if(_0x29d660[_0x6c27('0x32')][_0x6c27('0x42')]){_0x4478cb['include']=[{'all':!![]}];}return db[_0x6c27('0x2e')][_0x6c27('0x43')](_0x4478cb);})['then'](function(_0x3fab07){_0x20d00b[_0x6c27('0x44')]=_0x3fab07;return _0x20d00b;})[_0x6c27('0x26')](respondWithFilteredResult(_0x298e0c,_0x4478cb))[_0x6c27('0x45')](handleError(_0x298e0c,null));};exports[_0x6c27('0x46')]=function(_0xda5346,_0x41bc9e){var _0x5adfe6={'raw':!![],'where':{'id':_0xda5346[_0x6c27('0x47')]['id']}},_0x293e3a={};_0x293e3a[_0x6c27('0x31')]=_[_0x6c27('0x48')](db[_0x6c27('0x2e')][_0x6c27('0x49')]);_0x293e3a['query']=_[_0x6c27('0x48')](_0xda5346[_0x6c27('0x32')]);_0x293e3a['filters']=_[_0x6c27('0x34')](_0x293e3a[_0x6c27('0x31')],_0x293e3a['query']);_0x5adfe6[_0x6c27('0x35')]=_[_0x6c27('0x34')](_0x293e3a['model'],qs[_0x6c27('0x36')](_0xda5346['query'][_0x6c27('0x36')]));_0x5adfe6[_0x6c27('0x35')]=_0x5adfe6[_0x6c27('0x35')]['length']?_0x5adfe6['attributes']:_0x293e3a[_0x6c27('0x31')];if(_0xda5346['query'][_0x6c27('0x42')]){_0x5adfe6[_0x6c27('0x4a')]=[{'all':!![]}];}_0x5adfe6=_[_0x6c27('0x3f')]({},_0x5adfe6,_0xda5346[_0x6c27('0x41')]);return db[_0x6c27('0x2e')][_0x6c27('0x4b')](_0x5adfe6)[_0x6c27('0x26')](handleEntityNotFound(_0x41bc9e,null))['then'](respondWithResult(_0x41bc9e,null))['catch'](handleError(_0x41bc9e,null));};exports['create']=function(_0x4c5788,_0x5eb744){return db[_0x6c27('0x2e')][_0x6c27('0x4c')](_0x4c5788[_0x6c27('0x4d')],{})[_0x6c27('0x26')](respondWithResult(_0x5eb744,0xc9))['catch'](handleError(_0x5eb744,null));};exports[_0x6c27('0x25')]=function(_0x2e464c,_0x39d4d6){if(_0x2e464c[_0x6c27('0x4d')]['id']){delete _0x2e464c[_0x6c27('0x4d')]['id'];}return db[_0x6c27('0x2e')]['find']({'where':{'id':_0x2e464c[_0x6c27('0x47')]['id']}})[_0x6c27('0x26')](handleEntityNotFound(_0x39d4d6,null))[_0x6c27('0x26')](saveUpdates(_0x2e464c[_0x6c27('0x4d')],null))[_0x6c27('0x26')](respondWithResult(_0x39d4d6,null))[_0x6c27('0x45')](handleError(_0x39d4d6,null));};exports['destroy']=function(_0x47a564,_0x5e107f){return db[_0x6c27('0x2e')][_0x6c27('0x4b')]({'where':{'id':_0x47a564[_0x6c27('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e107f,null))[_0x6c27('0x26')](removeEntity(_0x5e107f,null))['catch'](handleError(_0x5e107f,null));};exports[_0x6c27('0x4e')]=function(_0x474b48,_0x3bb103){return db[_0x6c27('0x2e')][_0x6c27('0x4e')]()[_0x6c27('0x26')](respondWithResult(_0x3bb103,null))[_0x6c27('0x45')](handleError(_0x3bb103,null));}; \ No newline at end of file +var _0x31a2=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','include','findAll','rows','catch','params','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x188319,_0x482243){var _0x5e838f=function(_0x337d89){while(--_0x337d89){_0x188319['push'](_0x188319['shift']());}};_0x5e838f(++_0x482243);}(_0x31a2,0x165));var _0x231a=function(_0x21a064,_0x2777ae){_0x21a064=_0x21a064-0x0;var _0x2010ee=_0x31a2[_0x21a064];return _0x2010ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x231a('0x0'));var zipdir=require(_0x231a('0x1'));var jsonpatch=require(_0x231a('0x2'));var rp=require(_0x231a('0x3'));var moment=require(_0x231a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x231a('0x5'));var util=require('util');var path=require(_0x231a('0x6'));var sox=require(_0x231a('0x7'));var csv=require(_0x231a('0x8'));var ejs=require(_0x231a('0x9'));var fs=require('fs');var fs_extra=require(_0x231a('0xa'));var _=require(_0x231a('0xb'));var squel=require(_0x231a('0xc'));var crypto=require(_0x231a('0xd'));var jsforce=require(_0x231a('0xe'));var deskjs=require(_0x231a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x231a('0x10'));var Redis=require(_0x231a('0x11'));var authService=require(_0x231a('0x12'));var qs=require(_0x231a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x231a('0x14'));var logger=require('../../config/logger')(_0x231a('0x15'));var utils=require(_0x231a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x231a('0x17'))['db'];function respondWithStatusCode(_0x30e94f,_0x5c1781){_0x5c1781=_0x5c1781||0xcc;return function(_0x2d70fb){if(_0x2d70fb){return _0x30e94f[_0x231a('0x18')](_0x5c1781);}return _0x30e94f['status'](_0x5c1781)[_0x231a('0x19')]();};}function respondWithResult(_0x544242,_0x1ecb33){_0x1ecb33=_0x1ecb33||0xc8;return function(_0x3c6a0e){if(_0x3c6a0e){return _0x544242[_0x231a('0x1a')](_0x1ecb33)[_0x231a('0x1b')](_0x3c6a0e);}};}function respondWithFilteredResult(_0x435f98,_0x446a50){return function(_0x242906){if(_0x242906){var _0x41c805=typeof _0x446a50[_0x231a('0x1c')]===_0x231a('0x1d')&&typeof _0x446a50[_0x231a('0x1e')]===_0x231a('0x1d');var _0x5d8a86=_0x242906[_0x231a('0x1f')];var _0x1ca4b5=_0x41c805?0x0:_0x446a50[_0x231a('0x1c')];var _0x1b24fc=_0x41c805?_0x242906['count']:_0x446a50['offset']+_0x446a50[_0x231a('0x1e')];var _0x4f08a9;if(_0x1b24fc>=_0x5d8a86){_0x1b24fc=_0x5d8a86;_0x4f08a9=0xc8;}else{_0x4f08a9=0xce;}_0x435f98['status'](_0x4f08a9);return _0x435f98[_0x231a('0x20')](_0x231a('0x21'),_0x1ca4b5+'-'+_0x1b24fc+'/'+_0x5d8a86)['json'](_0x242906);}return null;};}function patchUpdates(_0x448727){return function(_0x54ebb1){try{jsonpatch[_0x231a('0x22')](_0x54ebb1,_0x448727,!![]);}catch(_0x406e3f){return BPromise[_0x231a('0x23')](_0x406e3f);}return _0x54ebb1[_0x231a('0x24')]();};}function saveUpdates(_0x19893f,_0x19cd1a){return function(_0x4f470f){if(_0x4f470f){return _0x4f470f[_0x231a('0x25')](_0x19893f)[_0x231a('0x26')](function(_0x3b290c){return _0x3b290c;});}return null;};}function removeEntity(_0x3d697f,_0x1673e3){return function(_0x5a616f){if(_0x5a616f){return _0x5a616f[_0x231a('0x27')]()['then'](function(){_0x3d697f[_0x231a('0x1a')](0xcc)[_0x231a('0x19')]();});}};}function handleEntityNotFound(_0x5cdf54,_0x2da1eb){return function(_0x4d26c9){if(!_0x4d26c9){_0x5cdf54[_0x231a('0x18')](0x194);}return _0x4d26c9;};}function handleError(_0x42d6ef,_0x153675){_0x153675=_0x153675||0x1f4;return function(_0x23bfbc){logger[_0x231a('0x28')](_0x23bfbc[_0x231a('0x29')]);if(_0x23bfbc[_0x231a('0x2a')]){delete _0x23bfbc[_0x231a('0x2a')];}_0x42d6ef[_0x231a('0x1a')](_0x153675)[_0x231a('0x2b')](_0x23bfbc);};}exports[_0x231a('0x2c')]=function(_0x1a06a4,_0x3d70fd){var _0x1dc5c9={},_0x4734db={},_0x1baff3={'count':0x0,'rows':[]};var _0x5ea288=_[_0x231a('0x2d')](db[_0x231a('0x2e')][_0x231a('0x2f')],function(_0x56cdfb){return{'name':_0x56cdfb[_0x231a('0x30')],'type':_0x56cdfb[_0x231a('0x31')]['key']};});_0x4734db['model']=_['map'](_0x5ea288,_0x231a('0x2a'));_0x4734db[_0x231a('0x32')]=_[_0x231a('0x33')](_0x1a06a4[_0x231a('0x32')]);_0x4734db[_0x231a('0x34')]=_[_0x231a('0x35')](_0x4734db[_0x231a('0x36')],_0x4734db['query']);_0x1dc5c9[_0x231a('0x37')]=_[_0x231a('0x35')](_0x4734db[_0x231a('0x36')],qs['fields'](_0x1a06a4[_0x231a('0x32')][_0x231a('0x38')]));_0x1dc5c9[_0x231a('0x37')]=_0x1dc5c9['attributes']['length']?_0x1dc5c9[_0x231a('0x37')]:_0x4734db[_0x231a('0x36')];if(!_0x1a06a4[_0x231a('0x32')][_0x231a('0x39')](_0x231a('0x3a'))){_0x1dc5c9[_0x231a('0x1e')]=qs[_0x231a('0x1e')](_0x1a06a4[_0x231a('0x32')][_0x231a('0x1e')]);_0x1dc5c9['offset']=qs[_0x231a('0x1c')](_0x1a06a4[_0x231a('0x32')][_0x231a('0x1c')]);}_0x1dc5c9[_0x231a('0x3b')]=qs['sort'](_0x1a06a4[_0x231a('0x32')]['sort']);_0x1dc5c9[_0x231a('0x3c')]=qs['filters'](_[_0x231a('0x3d')](_0x1a06a4[_0x231a('0x32')],_0x4734db[_0x231a('0x34')]),_0x5ea288);if(_0x1a06a4[_0x231a('0x32')][_0x231a('0x3e')]){_0x1dc5c9[_0x231a('0x3c')]=_[_0x231a('0x3f')](_0x1dc5c9['where'],{'$or':_[_0x231a('0x2d')](_0x5ea288,function(_0x4d0d4a){if(_0x4d0d4a[_0x231a('0x31')]!=='VIRTUAL'){var _0x35f1b4={};_0x35f1b4[_0x4d0d4a[_0x231a('0x2a')]]={'$like':'%'+_0x1a06a4[_0x231a('0x32')][_0x231a('0x3e')]+'%'};return _0x35f1b4;}})});}_0x1dc5c9=_[_0x231a('0x3f')]({},_0x1dc5c9,_0x1a06a4['options']);var _0x383c95={'where':_0x1dc5c9[_0x231a('0x3c')]};return db[_0x231a('0x2e')][_0x231a('0x1f')](_0x383c95)[_0x231a('0x26')](function(_0x174f67){_0x1baff3['count']=_0x174f67;if(_0x1a06a4[_0x231a('0x32')]['includeAll']){_0x1dc5c9[_0x231a('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x231a('0x41')](_0x1dc5c9);})['then'](function(_0x50daf2){_0x1baff3[_0x231a('0x42')]=_0x50daf2;return _0x1baff3;})[_0x231a('0x26')](respondWithFilteredResult(_0x3d70fd,_0x1dc5c9))[_0x231a('0x43')](handleError(_0x3d70fd,null));};exports['show']=function(_0x3eca7f,_0x2a744c){var _0x484473={'raw':!![],'where':{'id':_0x3eca7f[_0x231a('0x44')]['id']}},_0x5498c6={};_0x5498c6[_0x231a('0x36')]=_['keys'](db['VoiceTransferReport'][_0x231a('0x2f')]);_0x5498c6[_0x231a('0x32')]=_['keys'](_0x3eca7f[_0x231a('0x32')]);_0x5498c6[_0x231a('0x34')]=_[_0x231a('0x35')](_0x5498c6['model'],_0x5498c6[_0x231a('0x32')]);_0x484473[_0x231a('0x37')]=_[_0x231a('0x35')](_0x5498c6[_0x231a('0x36')],qs['fields'](_0x3eca7f[_0x231a('0x32')][_0x231a('0x38')]));_0x484473[_0x231a('0x37')]=_0x484473[_0x231a('0x37')]['length']?_0x484473['attributes']:_0x5498c6[_0x231a('0x36')];if(_0x3eca7f[_0x231a('0x32')]['includeAll']){_0x484473[_0x231a('0x40')]=[{'all':!![]}];}_0x484473=_[_0x231a('0x3f')]({},_0x484473,_0x3eca7f[_0x231a('0x45')]);return db[_0x231a('0x2e')][_0x231a('0x46')](_0x484473)[_0x231a('0x26')](handleEntityNotFound(_0x2a744c,null))[_0x231a('0x26')](respondWithResult(_0x2a744c,null))['catch'](handleError(_0x2a744c,null));};exports[_0x231a('0x47')]=function(_0x447be6,_0x5add06){return db[_0x231a('0x2e')]['create'](_0x447be6['body'],{})['then'](respondWithResult(_0x5add06,0xc9))[_0x231a('0x43')](handleError(_0x5add06,null));};exports[_0x231a('0x25')]=function(_0x3ed70a,_0x43318a){if(_0x3ed70a[_0x231a('0x48')]['id']){delete _0x3ed70a[_0x231a('0x48')]['id'];}return db[_0x231a('0x2e')][_0x231a('0x46')]({'where':{'id':_0x3ed70a[_0x231a('0x44')]['id']}})[_0x231a('0x26')](handleEntityNotFound(_0x43318a,null))[_0x231a('0x26')](saveUpdates(_0x3ed70a[_0x231a('0x48')],null))[_0x231a('0x26')](respondWithResult(_0x43318a,null))[_0x231a('0x43')](handleError(_0x43318a,null));};exports[_0x231a('0x27')]=function(_0x31fbcc,_0x18232e){return db[_0x231a('0x2e')][_0x231a('0x46')]({'where':{'id':_0x31fbcc[_0x231a('0x44')]['id']}})[_0x231a('0x26')](handleEntityNotFound(_0x18232e,null))['then'](removeEntity(_0x18232e,null))[_0x231a('0x43')](handleError(_0x18232e,null));};exports['describe']=function(_0x4a439e,_0x21c9d3){return db[_0x231a('0x2e')][_0x231a('0x49')]()[_0x231a('0x26')](respondWithResult(_0x21c9d3,null))['catch'](handleError(_0x21c9d3,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index afcfc9b..9b5f143 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 _0x8a54=['request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','moment','bluebird'];(function(_0x15b192,_0x38c235){var _0x396e73=function(_0x4ba480){while(--_0x4ba480){_0x15b192['push'](_0x15b192['shift']());}};_0x396e73(++_0x38c235);}(_0x8a54,0x181));var _0x48a5=function(_0x2212c0,_0x5cf37e){_0x2212c0=_0x2212c0-0x0;var _0x1e1c78=_0x8a54[_0x2212c0];return _0x1e1c78;};'use strict';var _=require('lodash');var util=require(_0x48a5('0x0'));var logger=require(_0x48a5('0x1'))(_0x48a5('0x2'));var moment=require(_0x48a5('0x3'));var BPromise=require(_0x48a5('0x4'));var rp=require(_0x48a5('0x5'));var fs=require('fs');var path=require(_0x48a5('0x6'));var rimraf=require('rimraf');var config=require(_0x48a5('0x7'));var attributes=require(_0x48a5('0x8'));module[_0x48a5('0x9')]=function(_0x23dc10,_0x417a09){return _0x23dc10[_0x48a5('0xa')](_0x48a5('0xb'),attributes,{'tableName':_0x48a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cdb=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird'];(function(_0x294a8c,_0x48324a){var _0x38b936=function(_0x1789c7){while(--_0x1789c7){_0x294a8c['push'](_0x294a8c['shift']());}};_0x38b936(++_0x48324a);}(_0x4cdb,0x95));var _0xb4cd=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x4cdb[_0x264545];return _0x114d10;};'use strict';var _=require(_0xb4cd('0x0'));var util=require(_0xb4cd('0x1'));var logger=require(_0xb4cd('0x2'))(_0xb4cd('0x3'));var moment=require('moment');var BPromise=require(_0xb4cd('0x4'));var rp=require(_0xb4cd('0x5'));var fs=require('fs');var path=require(_0xb4cd('0x6'));var rimraf=require(_0xb4cd('0x7'));var config=require(_0xb4cd('0x8'));var attributes=require(_0xb4cd('0x9'));module[_0xb4cd('0xa')]=function(_0x3ff09f,_0x4b8782){return _0x3ff09f[_0xb4cd('0xb')](_0xb4cd('0xc'),attributes,{'tableName':_0xb4cd('0xd'),'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 e42f454..21829c0 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 _0xdc08=['message','result','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','stringify','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x431401,_0x21fddc){var _0x27de6d=function(_0x24d07d){while(--_0x24d07d){_0x431401['push'](_0x431401['shift']());}};_0x27de6d(++_0x21fddc);}(_0xdc08,0x1c9));var _0x8dc0=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xdc08[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x8dc0('0x0'));var util=require('util');var moment=require(_0x8dc0('0x1'));var BPromise=require(_0x8dc0('0x2'));var rs=require(_0x8dc0('0x3'));var fs=require('fs');var Redis=require(_0x8dc0('0x4'));var db=require(_0x8dc0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8dc0('0x6'))(_0x8dc0('0x7'));var config=require(_0x8dc0('0x8'));var jayson=require(_0x8dc0('0x9'));var client=jayson[_0x8dc0('0xa')][_0x8dc0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34759c,_0x1c8c9e,_0x158e74){return new BPromise(function(_0x56f114,_0x343f4c){return client['request'](_0x34759c,_0x158e74)[_0x8dc0('0xc')](function(_0x264e83){logger[_0x8dc0('0xd')](_0x8dc0('0xe'),_0x1c8c9e,_0x8dc0('0xf'));logger[_0x8dc0('0x10')](_0x8dc0('0x11'),_0x1c8c9e,_0x8dc0('0xf'),JSON['stringify'](_0x264e83));if(_0x264e83[_0x8dc0('0x12')]){if(_0x264e83[_0x8dc0('0x12')]['code']===0x1f4){logger[_0x8dc0('0x12')](_0x8dc0('0xe'),_0x1c8c9e,_0x264e83[_0x8dc0('0x12')]['message']);return _0x343f4c(_0x264e83[_0x8dc0('0x12')][_0x8dc0('0x13')]);}logger[_0x8dc0('0x12')](_0x8dc0('0xe'),_0x1c8c9e,_0x264e83['error'][_0x8dc0('0x13')]);return _0x56f114(_0x264e83[_0x8dc0('0x12')][_0x8dc0('0x13')]);}else{logger[_0x8dc0('0xd')](_0x8dc0('0xe'),_0x1c8c9e,_0x8dc0('0xf'));_0x56f114(_0x264e83[_0x8dc0('0x14')][_0x8dc0('0x13')]);}})['catch'](function(_0x140d86){logger[_0x8dc0('0x12')](_0x8dc0('0xe'),_0x1c8c9e,_0x140d86);_0x343f4c(_0x140d86);});});}exports['CreateVoiceTransferReport']=function(_0x389c70){var _0x48b6fa=this;return new Promise(function(_0x1b7b9c,_0x1e6986){return db[_0x8dc0('0x15')][_0x8dc0('0x16')](_0x389c70['body'],{'raw':_0x389c70['options']?_0x389c70[_0x8dc0('0x17')][_0x8dc0('0x18')]===undefined?!![]:![]:!![]})[_0x8dc0('0xc')](function(_0x1c5b8a){logger[_0x8dc0('0xd')](_0x8dc0('0x19'),_0x389c70);logger['debug'](_0x8dc0('0x19'),_0x389c70,JSON[_0x8dc0('0x1a')](_0x1c5b8a));_0x1b7b9c(_0x1c5b8a);})[_0x8dc0('0x1b')](function(_0x21f0a4){logger[_0x8dc0('0x12')](_0x8dc0('0x19'),_0x21f0a4[_0x8dc0('0x13')],_0x389c70);_0x1e6986(_0x48b6fa[_0x8dc0('0x12')](0x1f4,_0x21f0a4['message']));});});}; \ No newline at end of file +var _0x6356=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceTransferReport','create','body','options','raw','lodash','util','moment'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x6356,0xb3));var _0x6635=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x6356[_0x4e170e];return _0x338291;};'use strict';var _=require(_0x6635('0x0'));var util=require(_0x6635('0x1'));var moment=require(_0x6635('0x2'));var BPromise=require(_0x6635('0x3'));var rs=require(_0x6635('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6635('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6635('0x6'))(_0x6635('0x7'));var config=require('../../config/environment');var jayson=require(_0x6635('0x8'));var client=jayson[_0x6635('0x9')][_0x6635('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a7337,_0x4ff866,_0x495a7d){return new BPromise(function(_0x278c86,_0x272c9d){return client['request'](_0x4a7337,_0x495a7d)[_0x6635('0xb')](function(_0x41d4d0){logger[_0x6635('0xc')](_0x6635('0xd'),_0x4ff866,_0x6635('0xe'));logger[_0x6635('0xf')](_0x6635('0x10'),_0x4ff866,_0x6635('0xe'),JSON[_0x6635('0x11')](_0x41d4d0));if(_0x41d4d0[_0x6635('0x12')]){if(_0x41d4d0[_0x6635('0x12')][_0x6635('0x13')]===0x1f4){logger[_0x6635('0x12')](_0x6635('0xd'),_0x4ff866,_0x41d4d0[_0x6635('0x12')][_0x6635('0x14')]);return _0x272c9d(_0x41d4d0[_0x6635('0x12')]['message']);}logger[_0x6635('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ff866,_0x41d4d0[_0x6635('0x12')][_0x6635('0x14')]);return _0x278c86(_0x41d4d0['error']['message']);}else{logger[_0x6635('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ff866,_0x6635('0xe'));_0x278c86(_0x41d4d0['result'][_0x6635('0x14')]);}})['catch'](function(_0x8320a5){logger[_0x6635('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4ff866,_0x8320a5);_0x272c9d(_0x8320a5);});});}exports[_0x6635('0x15')]=function(_0x5a885e){var _0x30b431=this;return new Promise(function(_0x52b7d2,_0x544a5e){return db['VoiceTransferReport'][_0x6635('0x16')](_0x5a885e[_0x6635('0x17')],{'raw':_0x5a885e[_0x6635('0x18')]?_0x5a885e[_0x6635('0x18')][_0x6635('0x19')]===undefined?!![]:![]:!![]})[_0x6635('0xb')](function(_0x23ea76){logger[_0x6635('0xc')](_0x6635('0x15'),_0x5a885e);logger[_0x6635('0xf')](_0x6635('0x15'),_0x5a885e,JSON[_0x6635('0x11')](_0x23ea76));_0x52b7d2(_0x23ea76);})['catch'](function(_0x345355){logger[_0x6635('0x12')](_0x6635('0x15'),_0x345355['message'],_0x5a885e);_0x544a5e(_0x30b431[_0x6635('0x12')](0x1f4,_0x345355[_0x6635('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 3633d5b..a7e8e99 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 _0xd1de=['/transfer','transfer','exports','express','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','/answer','answer','hold','/calls','calls'];(function(_0x482a3b,_0x29be82){var _0x38b625=function(_0x36b13c){while(--_0x36b13c){_0x482a3b['push'](_0x482a3b['shift']());}};_0x38b625(++_0x29be82);}(_0xd1de,0x123));var _0xed1d=function(_0x15b72c,_0x5bff5b){_0x15b72c=_0x15b72c-0x0;var _0x1e9272=_0xd1de[_0x15b72c];return _0x1e9272;};'use strict';var express=require(_0xed1d('0x0'));var router=express['Router']();var auth=require(_0xed1d('0x1'));var controller=require('./webbar.controller');router[_0xed1d('0x2')](_0xed1d('0x3'),auth[_0xed1d('0x4')](),auth[_0xed1d('0x5')](),controller[_0xed1d('0x6')]);router[_0xed1d('0x2')](_0xed1d('0x7'),auth[_0xed1d('0x4')](),auth[_0xed1d('0x5')](),controller['hangup']);router[_0xed1d('0x2')](_0xed1d('0x8'),auth['isAuthenticated'](),auth[_0xed1d('0x5')](),controller[_0xed1d('0x9')]);router[_0xed1d('0x2')]('/hold',auth['isAuthenticated'](),auth[_0xed1d('0x5')](),controller[_0xed1d('0xa')]);router[_0xed1d('0x2')]('/unhold',auth[_0xed1d('0x4')](),auth[_0xed1d('0x5')](),controller['unhold']);router[_0xed1d('0x2')](_0xed1d('0xb'),auth[_0xed1d('0x4')](),auth[_0xed1d('0x5')](),controller[_0xed1d('0xc')]);router['post'](_0xed1d('0xd'),auth[_0xed1d('0x4')](),auth[_0xed1d('0x5')](),controller[_0xed1d('0xe')]);module[_0xed1d('0xf')]=router; \ No newline at end of file +var _0xe224=['isAuthenticated','canUpdate','/hangup','hangup','answer','hold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate'];(function(_0x58b250,_0x210a75){var _0x2ad6d6=function(_0xfbc855){while(--_0xfbc855){_0x58b250['push'](_0x58b250['shift']());}};_0x2ad6d6(++_0x210a75);}(_0xe224,0x181));var _0x4e22=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe224[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x4e22('0x0'));var router=express[_0x4e22('0x1')]();var auth=require(_0x4e22('0x2'));var controller=require(_0x4e22('0x3'));router[_0x4e22('0x4')](_0x4e22('0x5'),auth[_0x4e22('0x6')](),auth[_0x4e22('0x7')](),controller['originate']);router[_0x4e22('0x4')](_0x4e22('0x8'),auth[_0x4e22('0x6')](),auth[_0x4e22('0x7')](),controller[_0x4e22('0x9')]);router[_0x4e22('0x4')]('/answer',auth[_0x4e22('0x6')](),auth[_0x4e22('0x7')](),controller[_0x4e22('0xa')]);router['post']('/hold',auth['isAuthenticated'](),auth[_0x4e22('0x7')](),controller[_0x4e22('0xb')]);router[_0x4e22('0x4')]('/unhold',auth['isAuthenticated'](),auth[_0x4e22('0x7')](),controller['unhold']);router['post'](_0x4e22('0xc'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x4e22('0xd')]);router[_0x4e22('0x4')](_0x4e22('0xe'),auth[_0x4e22('0x6')](),auth[_0x4e22('0x7')](),controller[_0x4e22('0xf')]);module[_0x4e22('0x10')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 4dce068..775071c 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 _0x5712=['findOne','agent','VoiceChannels','all','filter','rows','UserId','sessionId','\x20not\x20found!','originate','originate\x20fired:','body','length','callNumber','info','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','json','userId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','calls\x20fired:','webbar:conference','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','redis','localhost','socket.io-emitter','validate','number','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','handleError:','error','name','status','send','then','message','catch','User'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x5712,0x140));var _0x2571=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5712[_0x1facfa];return _0x9ec701;};'use strict';var path=require(_0x2571('0x0'));var fs=require('fs');var _=require(_0x2571('0x1'));var db=require(_0x2571('0x2'))['db'];var config=require(_0x2571('0x3'));var util=require(_0x2571('0x4'));var BPromise=require(_0x2571('0x5'));var jayson=require(_0x2571('0x6'));var amiClient=jayson[_0x2571('0x7')][_0x2571('0x8')]({'port':0x232a});var logger=require(_0x2571('0x9'))('webbarapi');var Redis=require('ioredis');config[_0x2571('0xa')]=_['defaults'](config[_0x2571('0xa')],{'host':_0x2571('0xb'),'port':0x18eb});var io=require(_0x2571('0xc'))(new Redis(config[_0x2571('0xa')]));var Schema=require(_0x2571('0xd'));var originateValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2571('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x2571('0xf')},'callbackUrl':{'type':_0x2571('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],_0x2571('0x10')]},'sessionId':{'type':_0x2571('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],_0x2571('0x10')]},'sessionId':{'type':_0x2571('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2571('0xf'),'required':[!![],_0x2571('0x11')]},'transferNumber':{'type':_0x2571('0xf'),'required':[!![],_0x2571('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],_0x2571('0x10')]},'sessionId':{'type':_0x2571('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],_0x2571('0x10')]},'sessionId':{'type':_0x2571('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2571('0xe'),'required':[!![],_0x2571('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2571('0x10')]}});function emit(_0x47b5e9,_0x51425e,_0x58cf1b){logger['info'](_0x47b5e9,_0x51425e,JSON[_0x2571('0x13')](_0x58cf1b));io['to'](_0x47b5e9)[_0x2571('0x14')](_0x51425e,_0x58cf1b);}function handleError(_0x23dffc){return function(_0x75af2a){console['log'](_0x2571('0x15'),_0x75af2a,_0x75af2a instanceof RangeError);logger[_0x2571('0x16')](_0x75af2a['stack']);if(_0x75af2a instanceof RangeError){if(_0x75af2a[_0x2571('0x17')]){delete _0x75af2a[_0x2571('0x17')];}_0x23dffc[_0x2571('0x18')](0x194)[_0x2571('0x19')](_0x75af2a);}else{if(_0x75af2a[_0x2571('0x17')]){delete _0x75af2a['name'];}_0x23dffc['status'](0x1f4)[_0x2571('0x19')](_0x75af2a);}};}function checkError(){return function(_0x463a19){if(!_0x463a19){throw new RangeError('NotFound');}return _0x463a19;};}function respondWithRpcPromise(_0x5c8b30,_0x21fa16){return new BPromise(function(_0x2e7d89,_0x2218fb){var _0xb6dfa6=amiClient;return _0xb6dfa6['request'](_0x5c8b30,_0x21fa16)[_0x2571('0x1a')](function(_0x55ec06){if(_0x55ec06[_0x2571('0x16')]){if(_0x55ec06[_0x2571('0x16')]['code']===0x1f4){return _0x2218fb(_0x55ec06[_0x2571('0x16')][_0x2571('0x1b')]);}return _0x2e7d89(_0x55ec06[_0x2571('0x16')]['message']);}else{_0x2e7d89(_0x55ec06['result']);}})[_0x2571('0x1c')](function(_0x1cbbdc){_0x2218fb(_0x1cbbdc);});});}function getAgent(_0xcde31f){return db[_0x2571('0x1d')][_0x2571('0x1e')]({'where':{'id':_0xcde31f,'role':_0x2571('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x4f6ccc,_0x1ceb21){return new BPromise(function(_0x426615,_0xfc6c47){var _0x2ce206=respondWithRpcPromise(_0x2571('0x20'));var _0x165aa8=getAgent(_0x4f6ccc);Promise[_0x2571('0x21')]([_0x2ce206,_0x165aa8])[_0x2571('0x1a')](function(_0x1f7562){var _0xac59bc=_0x1f7562[0x0];var _0x5b3373=_0x1f7562[0x1];var _0xc7e62=_[_0x2571('0x22')](_0xac59bc[_0x2571('0x23')],function(_0x441e7d){return _0x441e7d[_0x2571('0x24')]==_0x5b3373['id']&&_0x441e7d[_0x2571('0x25')]==_0x1ceb21;});if(_0xc7e62['length']==0x1){_0x426615(_0x5b3373);}else{_0xfc6c47(new RangeError('sessionId\x20'+_0x1ceb21+_0x2571('0x26')));}});});}exports[_0x2571('0x27')]=function(_0x3a2db2,_0x2b6416){logger['info'](_0x2571('0x28'),_0x3a2db2[_0x2571('0x29')]);var _0x58e6a2=originateValidation['validate'](_0x3a2db2[_0x2571('0x29')]);if(_0x58e6a2[_0x2571('0x2a')]>0x0){return _0x2b6416[_0x2571('0x18')](0x190)['json'](_0x58e6a2);}var _0x446056=_0x3a2db2[_0x2571('0x29')]['userId'];var _0x136e8b=_0x3a2db2['body'][_0x2571('0x2b')];var _0x2eebd0=_0x3a2db2[_0x2571('0x29')]['callerId'];var _0x483749=_0x3a2db2[_0x2571('0x29')]['callbackUrl'];return getAgent(_0x446056)[_0x2571('0x1a')](function(_0x1fc628){logger[_0x2571('0x2c')](_0x2571('0x2d'),_0x1fc628['name']);emit(util[_0x2571('0x2e')](_0x2571('0x2f'),_0x1fc628['name']),_0x2571('0x30'),{'callNumber':_0x136e8b,'callerId':_0x2eebd0,'callbackUrl':_0x483749});return _0x2b6416[_0x2571('0x18')](0xc8)['json']({'error':![],'message':_0x2571('0x31')});})[_0x2571('0x1c')](handleError(_0x2b6416));};exports[_0x2571('0x32')]=function(_0x393df0,_0x3dbda8){logger[_0x2571('0x2c')](_0x2571('0x33'),_0x393df0[_0x2571('0x29')]);var _0x1f3896=hangupValidation[_0x2571('0xd')](_0x393df0[_0x2571('0x29')]);if(_0x1f3896[_0x2571('0x2a')]>0x0){return _0x3dbda8[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x1f3896);}var _0x542e41=_0x393df0[_0x2571('0x29')][_0x2571('0x35')];var _0x1f7987=_0x393df0[_0x2571('0x29')][_0x2571('0x25')];return getAgent(_0x542e41)[_0x2571('0x1a')](function(_0x35deff){logger['info'](_0x2571('0x2d'),_0x35deff[_0x2571('0x17')]);emit(util[_0x2571('0x2e')]('user:%s',_0x35deff[_0x2571('0x17')]),_0x2571('0x36'),{'sessionId':_0x1f7987});return _0x3dbda8[_0x2571('0x18')](0xc8)['json']({'error':![],'message':_0x2571('0x37')});})[_0x2571('0x1c')](handleError(_0x3dbda8));};exports[_0x2571('0x38')]=function(_0x30405d,_0x1e98dc){logger[_0x2571('0x2c')](_0x2571('0x39'),_0x30405d[_0x2571('0x29')]);var _0x3d4004=answerValidation['validate'](_0x30405d[_0x2571('0x29')]);if(_0x3d4004[_0x2571('0x2a')]>0x0){return _0x1e98dc[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x3d4004);}var _0x2411d9=_0x30405d[_0x2571('0x29')][_0x2571('0x35')];var _0x2d024c=_0x30405d['body']['sessionId'];return getAgent(_0x2411d9)['then'](function(_0x53e462){logger['info']('entityFound:',_0x53e462[_0x2571('0x17')]);emit(util[_0x2571('0x2e')]('user:%s',_0x53e462[_0x2571('0x17')]),_0x2571('0x3a'),{'sessionId':_0x2d024c});return _0x1e98dc[_0x2571('0x18')](0xc8)[_0x2571('0x34')]({'error':![],'message':_0x2571('0x3b')});})['catch'](handleError(_0x1e98dc));};exports['hold']=function(_0x54e159,_0x240970){logger[_0x2571('0x2c')](_0x2571('0x3c'),_0x54e159[_0x2571('0x29')]);var _0x1ff069=holdValidation[_0x2571('0xd')](_0x54e159[_0x2571('0x29')]);if(_0x1ff069['length']>0x0){return _0x240970[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x1ff069);}var _0x1642a8=_0x54e159['body'][_0x2571('0x35')];var _0xd229cb=_0x54e159[_0x2571('0x29')][_0x2571('0x25')];return getAgent(_0x1642a8)['then'](function(_0x18291c){logger[_0x2571('0x2c')](_0x2571('0x2d'),_0x18291c[_0x2571('0x17')]);emit(util['format'](_0x2571('0x2f'),_0x18291c[_0x2571('0x17')]),_0x2571('0x3d'),{'sessionId':_0xd229cb});return _0x240970[_0x2571('0x18')](0xc8)[_0x2571('0x34')]({'error':![],'message':'hold\x20executed!'});})[_0x2571('0x1c')](handleError(_0x240970));};exports[_0x2571('0x3e')]=function(_0x20302b,_0x1d2e36){logger[_0x2571('0x2c')](_0x2571('0x3f'),_0x20302b['body']);var _0x573c93=unholdValidation[_0x2571('0xd')](_0x20302b['body']);if(_0x573c93['length']>0x0){return _0x1d2e36[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x573c93);}var _0x1d2b83=_0x20302b[_0x2571('0x29')][_0x2571('0x35')];var _0x311fcd=_0x20302b[_0x2571('0x29')][_0x2571('0x25')];return getAgent(_0x1d2b83)[_0x2571('0x1a')](function(_0x5ee410){logger[_0x2571('0x2c')](_0x2571('0x2d'),_0x5ee410[_0x2571('0x17')]);emit(util['format'](_0x2571('0x2f'),_0x5ee410['name']),_0x2571('0x40'),{'sessionId':_0x311fcd});return _0x1d2e36[_0x2571('0x18')](0xc8)[_0x2571('0x34')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x1d2e36));};exports['calls']=function(_0x484eb3,_0x1fb661){logger[_0x2571('0x2c')](_0x2571('0x41'),_0x1fb661[_0x2571('0x29')]);var _0x333b91=callsValidation[_0x2571('0xd')](_0x484eb3[_0x2571('0x29')]);if(_0x333b91[_0x2571('0x2a')]>0x0){return _0x1fb661[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x333b91);}var _0x24688d=_0x484eb3[_0x2571('0x29')][_0x2571('0x35')];var _0x13d446=respondWithRpcPromise(_0x2571('0x20'));var _0x3a3dd4=getAgent(_0x24688d);return Promise[_0x2571('0x21')]([_0x13d446,_0x3a3dd4])[_0x2571('0x1a')](function(_0x2321f0){var _0xddabb4=_0x2321f0[0x0];var _0x44ce01=_0x2321f0[0x1];var _0x31e5c8=_[_0x2571('0x22')](_0xddabb4[_0x2571('0x23')],function(_0x267d00){return _0x267d00[_0x2571('0x24')]==_0x44ce01['id'];});return _0x1fb661[_0x2571('0x18')](0xc8)[_0x2571('0x34')]({'count':_0x31e5c8['length'],'rows':_0x31e5c8});})[_0x2571('0x1c')](handleError(_0x1fb661));};exports['conference']=function(_0x38bf66,_0x2b0f3f){logger[_0x2571('0x2c')]('conference\x20fired:',_0x38bf66[_0x2571('0x29')]);var _0x558c8b=conferenceValidation[_0x2571('0xd')](_0x38bf66[_0x2571('0x29')]);if(_0x558c8b[_0x2571('0x2a')]>0x0){return _0x2b0f3f[_0x2571('0x18')](0x190)['json'](_0x558c8b);}var _0x7d8bba=_0x38bf66[_0x2571('0x29')]['userId'];return getAgent(_0x7d8bba)[_0x2571('0x1a')](function(_0x29795c){logger[_0x2571('0x2c')](_0x2571('0x2d'),_0x29795c[_0x2571('0x17')]);emit(util[_0x2571('0x2e')](_0x2571('0x2f'),_0x29795c[_0x2571('0x17')]),_0x2571('0x42'));return _0x2b0f3f[_0x2571('0x18')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x2571('0x1c')](handleError(_0x2b0f3f));};exports['transfer']=function(_0xc08bd9,_0x1dda43){logger[_0x2571('0x2c')](_0x2571('0x43'),_0xc08bd9[_0x2571('0x29')]);var _0x2fa4e3=transferValidation[_0x2571('0xd')](_0xc08bd9[_0x2571('0x29')]);if(_0x2fa4e3[_0x2571('0x2a')]>0x0){return _0x1dda43[_0x2571('0x18')](0x190)[_0x2571('0x34')](_0x2fa4e3);}var _0x20b98e=_0xc08bd9['body'][_0x2571('0x35')];var _0x3abe76=_0xc08bd9['body'][_0x2571('0x25')];var _0x49224f=_0xc08bd9[_0x2571('0x29')]['transferNumber'];return getAgent(_0x20b98e)[_0x2571('0x1a')](function(_0x3fa0d0){logger[_0x2571('0x2c')](_0x2571('0x2d'),_0x3fa0d0[_0x2571('0x17')]);emit(util[_0x2571('0x2e')](_0x2571('0x2f'),_0x3fa0d0[_0x2571('0x17')]),_0x2571('0x44'),{'sessionId':_0x3abe76,'transferNumber':_0x49224f});return _0x1dda43['status'](0xc8)['json']({'error':![],'message':_0x2571('0x45')});})[_0x2571('0x1c')](handleError(_0x1dda43));}; \ No newline at end of file +var _0x0624=['result','catch','findOne','agent','filter','rows','sessionId\x20','\x20not\x20found!','body','length','json','userId','callerId','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','webbar:hangup','answer','hold','webbar:hold','hold\x20executed!','webbar:unhold','calls','VoiceChannels','UserId','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','util','bluebird','jayson/promise','client','http','../../config/logger','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','error','stack','name','send','status','NotFound','then','message'];(function(_0x4052d,_0x2a3683){var _0x13b1e8=function(_0x2dcdca){while(--_0x2dcdca){_0x4052d['push'](_0x4052d['shift']());}};_0x13b1e8(++_0x2a3683);}(_0x0624,0x132));var _0x4062=function(_0x679dd1,_0x4d8681){_0x679dd1=_0x679dd1-0x0;var _0x4766b1=_0x0624[_0x679dd1];return _0x4766b1;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x4062('0x0'));var BPromise=require(_0x4062('0x1'));var jayson=require(_0x4062('0x2'));var amiClient=jayson[_0x4062('0x3')][_0x4062('0x4')]({'port':0x232a});var logger=require(_0x4062('0x5'))('webbarapi');var Redis=require('ioredis');config[_0x4062('0x6')]=_[_0x4062('0x7')](config[_0x4062('0x6')],{'host':_0x4062('0x8'),'port':0x18eb});var io=require(_0x4062('0x9'))(new Redis(config['redis']));var Schema=require(_0x4062('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4062('0xb')]},'callNumber':{'type':_0x4062('0xc'),'required':[!![],_0x4062('0xd')]},'callerId':{'type':_0x4062('0xc')},'callbackUrl':{'type':_0x4062('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4062('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':_0x4062('0xc'),'required':[!![],_0x4062('0xf')]},'transferNumber':{'type':'string','required':[!![],_0x4062('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4062('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],_0x4062('0xb')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4062('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4062('0xe'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x4d7166,_0x5458a1,_0x4cb54e){logger[_0x4062('0x11')](_0x4d7166,_0x5458a1,JSON['stringify'](_0x4cb54e));io['to'](_0x4d7166)[_0x4062('0x12')](_0x5458a1,_0x4cb54e);}function handleError(_0x278f51){return function(_0x3d14bb){console[_0x4062('0x13')](_0x4062('0x14'),_0x3d14bb,_0x3d14bb instanceof RangeError);logger[_0x4062('0x15')](_0x3d14bb[_0x4062('0x16')]);if(_0x3d14bb instanceof RangeError){if(_0x3d14bb['name']){delete _0x3d14bb[_0x4062('0x17')];}_0x278f51['status'](0x194)[_0x4062('0x18')](_0x3d14bb);}else{if(_0x3d14bb['name']){delete _0x3d14bb[_0x4062('0x17')];}_0x278f51[_0x4062('0x19')](0x1f4)[_0x4062('0x18')](_0x3d14bb);}};}function checkError(){return function(_0x18b2e6){if(!_0x18b2e6){throw new RangeError(_0x4062('0x1a'));}return _0x18b2e6;};}function respondWithRpcPromise(_0x78d507,_0xae1bbd){return new BPromise(function(_0x341310,_0xc6c0ba){var _0x53648a=amiClient;return _0x53648a['request'](_0x78d507,_0xae1bbd)[_0x4062('0x1b')](function(_0xc5e4a0){if(_0xc5e4a0[_0x4062('0x15')]){if(_0xc5e4a0[_0x4062('0x15')]['code']===0x1f4){return _0xc6c0ba(_0xc5e4a0['error']['message']);}return _0x341310(_0xc5e4a0[_0x4062('0x15')][_0x4062('0x1c')]);}else{_0x341310(_0xc5e4a0[_0x4062('0x1d')]);}})[_0x4062('0x1e')](function(_0x3c1ee0){_0xc6c0ba(_0x3c1ee0);});});}function getAgent(_0x10cb31){return db['User'][_0x4062('0x1f')]({'where':{'id':_0x10cb31,'role':_0x4062('0x20')}})[_0x4062('0x1b')](checkError());}function getAgentCheckSession(_0x28e9e4,_0xb7f7c7){return new BPromise(function(_0x5934d2,_0x5b6659){var _0x4a0312=respondWithRpcPromise('VoiceChannels');var _0x391065=getAgent(_0x28e9e4);Promise['all']([_0x4a0312,_0x391065])[_0x4062('0x1b')](function(_0x169c12){var _0x9c9fc3=_0x169c12[0x0];var _0xc1c540=_0x169c12[0x1];var _0x2ca2cd=_[_0x4062('0x21')](_0x9c9fc3[_0x4062('0x22')],function(_0x253bcf){return _0x253bcf['UserId']==_0xc1c540['id']&&_0x253bcf['sessionId']==_0xb7f7c7;});if(_0x2ca2cd['length']==0x1){_0x5934d2(_0xc1c540);}else{_0x5b6659(new RangeError(_0x4062('0x23')+_0xb7f7c7+_0x4062('0x24')));}});});}exports['originate']=function(_0x26c63a,_0x5ad1a3){logger['info']('originate\x20fired:',_0x26c63a[_0x4062('0x25')]);var _0x1792d0=originateValidation[_0x4062('0xa')](_0x26c63a[_0x4062('0x25')]);if(_0x1792d0[_0x4062('0x26')]>0x0){return _0x5ad1a3[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x1792d0);}var _0x126aab=_0x26c63a[_0x4062('0x25')][_0x4062('0x28')];var _0xf3c438=_0x26c63a[_0x4062('0x25')]['callNumber'];var _0x2a9d01=_0x26c63a['body'][_0x4062('0x29')];var _0x20068d=_0x26c63a[_0x4062('0x25')]['callbackUrl'];return getAgent(_0x126aab)[_0x4062('0x1b')](function(_0x2393e5){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x2393e5[_0x4062('0x17')]);emit(util[_0x4062('0x2b')](_0x4062('0x2c'),_0x2393e5[_0x4062('0x17')]),_0x4062('0x2d'),{'callNumber':_0xf3c438,'callerId':_0x2a9d01,'callbackUrl':_0x20068d});return _0x5ad1a3['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x2e')});})[_0x4062('0x1e')](handleError(_0x5ad1a3));};exports[_0x4062('0x2f')]=function(_0x13ee2d,_0x40d961){logger['info'](_0x4062('0x30'),_0x13ee2d[_0x4062('0x25')]);var _0x472b21=hangupValidation[_0x4062('0xa')](_0x13ee2d[_0x4062('0x25')]);if(_0x472b21['length']>0x0){return _0x40d961['status'](0x190)[_0x4062('0x27')](_0x472b21);}var _0x27fe83=_0x13ee2d['body'][_0x4062('0x28')];var _0x146463=_0x13ee2d[_0x4062('0x25')][_0x4062('0x31')];return getAgent(_0x27fe83)[_0x4062('0x1b')](function(_0x218864){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x218864[_0x4062('0x17')]);emit(util[_0x4062('0x2b')]('user:%s',_0x218864[_0x4062('0x17')]),_0x4062('0x32'),{'sessionId':_0x146463});return _0x40d961['status'](0xc8)['json']({'error':![],'message':'hangup\x20executed!'});})[_0x4062('0x1e')](handleError(_0x40d961));};exports[_0x4062('0x33')]=function(_0x157e60,_0x43a82c){logger['info']('answer\x20fired:',_0x157e60[_0x4062('0x25')]);var _0x42d0d3=answerValidation[_0x4062('0xa')](_0x157e60[_0x4062('0x25')]);if(_0x42d0d3['length']>0x0){return _0x43a82c['status'](0x190)[_0x4062('0x27')](_0x42d0d3);}var _0x2ac3b5=_0x157e60[_0x4062('0x25')][_0x4062('0x28')];var _0x9ab8ac=_0x157e60[_0x4062('0x25')][_0x4062('0x31')];return getAgent(_0x2ac3b5)[_0x4062('0x1b')](function(_0x48d9a3){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x48d9a3[_0x4062('0x17')]);emit(util['format'](_0x4062('0x2c'),_0x48d9a3['name']),'webbar:answer',{'sessionId':_0x9ab8ac});return _0x43a82c[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'error':![],'message':'answer\x20executed!'});})[_0x4062('0x1e')](handleError(_0x43a82c));};exports[_0x4062('0x34')]=function(_0x356ae0,_0x182b7f){logger[_0x4062('0x11')]('hold\x20fired:',_0x356ae0['body']);var _0x339337=holdValidation[_0x4062('0xa')](_0x356ae0[_0x4062('0x25')]);if(_0x339337['length']>0x0){return _0x182b7f[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x339337);}var _0x58a141=_0x356ae0[_0x4062('0x25')][_0x4062('0x28')];var _0x5e1c4f=_0x356ae0['body']['sessionId'];return getAgent(_0x58a141)[_0x4062('0x1b')](function(_0x560b20){logger['info'](_0x4062('0x2a'),_0x560b20['name']);emit(util['format'](_0x4062('0x2c'),_0x560b20[_0x4062('0x17')]),_0x4062('0x35'),{'sessionId':_0x5e1c4f});return _0x182b7f['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x36')});})[_0x4062('0x1e')](handleError(_0x182b7f));};exports['unhold']=function(_0x5c75b6,_0x36b58e){logger[_0x4062('0x11')]('unhold\x20fired:',_0x5c75b6[_0x4062('0x25')]);var _0x1b9ccf=unholdValidation[_0x4062('0xa')](_0x5c75b6['body']);if(_0x1b9ccf['length']>0x0){return _0x36b58e[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x1b9ccf);}var _0x6c5253=_0x5c75b6[_0x4062('0x25')][_0x4062('0x28')];var _0x5b975f=_0x5c75b6['body'][_0x4062('0x31')];return getAgent(_0x6c5253)[_0x4062('0x1b')](function(_0x2293c4){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x2293c4[_0x4062('0x17')]);emit(util[_0x4062('0x2b')](_0x4062('0x2c'),_0x2293c4[_0x4062('0x17')]),_0x4062('0x37'),{'sessionId':_0x5b975f});return _0x36b58e[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'error':![],'message':'unhold\x20executed!'});})[_0x4062('0x1e')](handleError(_0x36b58e));};exports[_0x4062('0x38')]=function(_0x567fdb,_0x36bba8){logger[_0x4062('0x11')]('calls\x20fired:',_0x36bba8[_0x4062('0x25')]);var _0x5c76e7=callsValidation['validate'](_0x567fdb[_0x4062('0x25')]);if(_0x5c76e7[_0x4062('0x26')]>0x0){return _0x36bba8[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x5c76e7);}var _0x24ccc2=_0x567fdb['body'][_0x4062('0x28')];var _0x487e77=respondWithRpcPromise(_0x4062('0x39'));var _0x2ab230=getAgent(_0x24ccc2);return Promise['all']([_0x487e77,_0x2ab230])[_0x4062('0x1b')](function(_0x7767ab){var _0x4c0811=_0x7767ab[0x0];var _0x4fa347=_0x7767ab[0x1];var _0x4d2d75=_[_0x4062('0x21')](_0x4c0811['rows'],function(_0x5c5190){return _0x5c5190[_0x4062('0x3a')]==_0x4fa347['id'];});return _0x36bba8[_0x4062('0x19')](0xc8)[_0x4062('0x27')]({'count':_0x4d2d75[_0x4062('0x26')],'rows':_0x4d2d75});})['catch'](handleError(_0x36bba8));};exports[_0x4062('0x3b')]=function(_0x3d5e74,_0x28aec1){logger[_0x4062('0x11')](_0x4062('0x3c'),_0x3d5e74['body']);var _0x45e832=conferenceValidation[_0x4062('0xa')](_0x3d5e74[_0x4062('0x25')]);if(_0x45e832[_0x4062('0x26')]>0x0){return _0x28aec1['status'](0x190)[_0x4062('0x27')](_0x45e832);}var _0x3fcc05=_0x3d5e74['body'][_0x4062('0x28')];return getAgent(_0x3fcc05)['then'](function(_0x1a488c){logger[_0x4062('0x11')](_0x4062('0x2a'),_0x1a488c[_0x4062('0x17')]);emit(util['format']('user:%s',_0x1a488c[_0x4062('0x17')]),_0x4062('0x3d'));return _0x28aec1['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x3e')});})[_0x4062('0x1e')](handleError(_0x28aec1));};exports[_0x4062('0x3f')]=function(_0x48bf59,_0x4d06c7){logger[_0x4062('0x11')](_0x4062('0x40'),_0x48bf59[_0x4062('0x25')]);var _0x322b0f=transferValidation['validate'](_0x48bf59[_0x4062('0x25')]);if(_0x322b0f[_0x4062('0x26')]>0x0){return _0x4d06c7[_0x4062('0x19')](0x190)[_0x4062('0x27')](_0x322b0f);}var _0x557bd4=_0x48bf59[_0x4062('0x25')][_0x4062('0x28')];var _0xdba734=_0x48bf59[_0x4062('0x25')][_0x4062('0x31')];var _0x3ee7cc=_0x48bf59[_0x4062('0x25')][_0x4062('0x41')];return getAgent(_0x557bd4)['then'](function(_0x342836){logger['info'](_0x4062('0x2a'),_0x342836[_0x4062('0x17')]);emit(util[_0x4062('0x2b')]('user:%s',_0x342836['name']),'webbar:transfer',{'sessionId':_0xdba734,'transferNumber':_0x3ee7cc});return _0x4d06c7['status'](0xc8)[_0x4062('0x27')]({'error':![],'message':_0x4062('0x42')});})[_0x4062('0x1e')](handleError(_0x4d06c7));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index a3617e0..7d85eef 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 _0x2ef3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','/:id/notify','/:id/send','send','put','update','delete','removeAnswers'];(function(_0x34366a,_0x557e46){var _0x48acc7=function(_0x5413a3){while(--_0x5413a3){_0x34366a['push'](_0x34366a['shift']());}};_0x48acc7(++_0x557e46);}(_0x2ef3,0xba));var _0x32ef=function(_0x4375ed,_0x4a9efd){_0x4375ed=_0x4375ed-0x0;var _0x5d6d91=_0x2ef3[_0x4375ed];return _0x5d6d91;};'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['getDispositions']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['get'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['getApplications']);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x15')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x15')](_0x32ef('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32ef('0x15')](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['addApplications']);router[_0x32ef('0x15')](_0x32ef('0x18'),controller['notify']);router[_0x32ef('0x15')](_0x32ef('0x19'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1a')]);router[_0x32ef('0x1b')](_0x32ef('0xd'),auth['isAuthenticated'](),controller[_0x32ef('0x1c')]);router['delete'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['destroy']);router[_0x32ef('0x1d')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller['removeDispositions']);router['delete'](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1e')]);router['delete']('/:id/users',auth[_0x32ef('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x93e9=['/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','/:id/users','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x3c4a7c,_0x2f4e3c){var _0xf13d1e=function(_0x24cb78){while(--_0x24cb78){_0x3c4a7c['push'](_0x3c4a7c['shift']());}};_0xf13d1e(++_0x2f4e3c);}(_0x93e9,0xcc));var _0x993e=function(_0x4ffb69,_0x38f106){_0x4ffb69=_0x4ffb69-0x0;var _0x4d196d=_0x93e9[_0x4ffb69];return _0x4d196d;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var fs_extra=require(_0x993e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x993e('0x7'));var controller=require(_0x993e('0x8'));router[_0x993e('0x9')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0xb')]);router[_0x993e('0x9')](_0x993e('0xc'),auth[_0x993e('0xa')](),controller['describe']);router[_0x993e('0x9')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0xe')]);router[_0x993e('0x9')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller['getDispositions']);router[_0x993e('0x9')](_0x993e('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x993e('0x9')]('/:id/users',auth[_0x993e('0xa')](),controller['getAgents']);router['get'](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x12')]);router[_0x993e('0x13')]('/',auth[_0x993e('0xa')](),controller[_0x993e('0x14')]);router[_0x993e('0x13')](_0x993e('0xf'),auth[_0x993e('0xa')](),controller[_0x993e('0x15')]);router[_0x993e('0x13')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x16')]);router[_0x993e('0x13')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller['addAgents']);router[_0x993e('0x13')](_0x993e('0x11'),auth[_0x993e('0xa')](),controller[_0x993e('0x18')]);router[_0x993e('0x13')](_0x993e('0x19'),controller['notify']);router[_0x993e('0x13')](_0x993e('0x1a'),auth[_0x993e('0xa')](),controller[_0x993e('0x1b')]);router[_0x993e('0x1c')](_0x993e('0xd'),auth[_0x993e('0xa')](),controller[_0x993e('0x1d')]);router['delete'](_0x993e('0xd'),auth['isAuthenticated'](),controller[_0x993e('0x1e')]);router[_0x993e('0x1f')](_0x993e('0xf'),auth['isAuthenticated'](),controller[_0x993e('0x20')]);router[_0x993e('0x1f')](_0x993e('0x10'),auth[_0x993e('0xa')](),controller[_0x993e('0x21')]);router[_0x993e('0x1f')](_0x993e('0x17'),auth[_0x993e('0xa')](),controller[_0x993e('0x22')]);module[_0x993e('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 72a3a25..6816519 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 _0x3bbc=['mandatoryDisposition','sequelize','STRING','name','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x16e8cb,_0x4a850f){var _0x3c4aee=function(_0x5afedd){while(--_0x5afedd){_0x16e8cb['push'](_0x16e8cb['shift']());}};_0x3c4aee(++_0x4a850f);}(_0x3bbc,0xaa));var _0xc3bb=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3bbc[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xc3bb('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xc3bb('0x1')],'unique':_0xc3bb('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc3bb('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xc3bb('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xc3bb('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc3bb('0x1')]},'type':{'type':Sequelize[_0xc3bb('0x3')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc3bb('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc3bb('0x4')],'defaultValue':function(){return _0xc3bb('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc3bb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc3bb('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc3bb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc3bb('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc3bb('0x6')],'comment':_0xc3bb('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xc3bb('0x7')],'defaultValue':![],'comment':_0xc3bb('0x9'),'set':function(_0x12a928){if(!_0x12a928){this[_0xc3bb('0xa')](_0xc3bb('0xb'),null);}this[_0xc3bb('0xa')](_0xc3bb('0xc'),_0x12a928);}},'description':{'type':Sequelize[_0xc3bb('0x1')]}}; \ No newline at end of file +var _0x81ba=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0xa97ca,_0x5dc464){var _0x173fc4=function(_0x5445ed){while(--_0x5445ed){_0xa97ca['push'](_0xa97ca['shift']());}};_0x173fc4(++_0x5dc464);}(_0x81ba,0x1f3));var _0xa81b=function(_0x579d73,_0x59449b){_0x579d73=_0x579d73-0x0;var _0xb987d8=_0x81ba[_0x579d73];return _0xb987d8;};'use strict';var Sequelize=require(_0xa81b('0x0'));var rs=require(_0xa81b('0x1'));module[_0xa81b('0x2')]={'name':{'type':Sequelize[_0xa81b('0x3')],'unique':_0xa81b('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xa81b('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xa81b('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xa81b('0x3')],'defaultValue':function(){return rs[_0xa81b('0x5')]();}},'phone':{'type':Sequelize[_0xa81b('0x3')]},'type':{'type':Sequelize['ENUM'](_0xa81b('0x6'))},'accountSid':{'type':Sequelize[_0xa81b('0x3')]},'authToken':{'type':Sequelize[_0xa81b('0x3')]},'notificationTemplate':{'type':Sequelize[_0xa81b('0x7')],'defaultValue':function(){return _0xa81b('0x8');}},'notificationSound':{'type':Sequelize[_0xa81b('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa81b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa81b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa81b('0xa')],'comment':_0xa81b('0xb')},'mandatoryDisposition':{'type':Sequelize[_0xa81b('0x9')],'defaultValue':![],'comment':_0xa81b('0xc'),'set':function(_0x56ee9c){if(!_0x56ee9c){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0xa81b('0xd')](_0xa81b('0xe'),_0x56ee9c);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index c6cc987..77d211c 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 _0x9080=['Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','findAll','rows','show','rawAttributes','length','includeAll','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','ids','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','getAgents','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','applications','orderBy','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','replace','whatsapp:','Body','messageId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','CmContact','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','get','out','Messages','spread','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','WhatsappAccounts','destroy','send','index'];(function(_0x831046,_0x39bf2d){var _0x53ff60=function(_0x39d00a){while(--_0x39d00a){_0x831046['push'](_0x831046['shift']());}};_0x53ff60(++_0x39bf2d);}(_0x9080,0x80));var _0x0908=function(_0x115a70,_0x5cfdee){_0x115a70=_0x115a70-0x0;var _0x3880e0=_0x9080[_0x115a70];return _0x3880e0;};'use strict';var emlformat=require(_0x0908('0x0'));var rimraf=require(_0x0908('0x1'));var zipdir=require(_0x0908('0x2'));var jsonpatch=require(_0x0908('0x3'));var rp=require(_0x0908('0x4'));var moment=require(_0x0908('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0908('0x6'));var util=require(_0x0908('0x7'));var path=require(_0x0908('0x8'));var sox=require(_0x0908('0x9'));var csv=require(_0x0908('0xa'));var ejs=require(_0x0908('0xb'));var fs=require('fs');var fs_extra=require(_0x0908('0xc'));var _=require(_0x0908('0xd'));var squel=require(_0x0908('0xe'));var crypto=require(_0x0908('0xf'));var jsforce=require(_0x0908('0x10'));var deskjs=require(_0x0908('0x11'));var toCsv=require(_0x0908('0xa'));var querystring=require(_0x0908('0x12'));var Papa=require(_0x0908('0x13'));var Redis=require(_0x0908('0x14'));var authService=require(_0x0908('0x15'));var qs=require(_0x0908('0x16'));var as=require(_0x0908('0x17'));var hardwareService=require(_0x0908('0x18'));var logger=require(_0x0908('0x19'))('api');var utils=require(_0x0908('0x1a'));var config=require(_0x0908('0x1b'));var licenseUtil=require(_0x0908('0x1c'));var db=require('../../mysqldb')['db'];config[_0x0908('0x1d')]=_[_0x0908('0x1e')](config[_0x0908('0x1d')],{'host':_0x0908('0x1f'),'port':0x18eb});var socket=require(_0x0908('0x20'))(new Redis(config['redis']));require(_0x0908('0x21'))['register'](socket);var jayson=require(_0x0908('0x22'));var client=jayson[_0x0908('0x23')][_0x0908('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x2b9486,_0x26f467,_0x4f89ae,_0x3c66fe){return new BPromise(function(_0x393cfb,_0x4654c1){var _0x257af7=_0x3c66fe||client;return _0x257af7['request'](_0x2b9486,_0x4f89ae)[_0x0908('0x25')](function(_0x2aeb58){logger[_0x0908('0x26')](_0x0908('0x27'),_0x26f467,_0x0908('0x28'));logger[_0x0908('0x29')](_0x0908('0x2a'),_0x26f467,_0x0908('0x28'),JSON[_0x0908('0x2b')](_0x2aeb58));if(_0x2aeb58['error']){if(_0x2aeb58['error']['code']===0x1f4){logger[_0x0908('0x2c')](_0x0908('0x27'),_0x26f467,_0x2aeb58[_0x0908('0x2c')][_0x0908('0x2d')]);return _0x4654c1(_0x2aeb58['error'][_0x0908('0x2d')]);}logger[_0x0908('0x2c')]('WhatsappAccount,\x20%s,\x20%s',_0x26f467,_0x2aeb58[_0x0908('0x2c')][_0x0908('0x2d')]);return _0x393cfb(_0x2aeb58[_0x0908('0x2c')][_0x0908('0x2d')]);}else{logger[_0x0908('0x26')](_0x0908('0x27'),_0x26f467,_0x0908('0x28'));_0x393cfb(_0x2aeb58[_0x0908('0x2e')][_0x0908('0x2d')]);}})[_0x0908('0x2f')](function(_0x523cdb){logger[_0x0908('0x2c')](_0x0908('0x27'),_0x26f467,_0x523cdb);_0x4654c1(_0x523cdb);});});}function respondWithStatusCode(_0x49c28d,_0x63a720){_0x63a720=_0x63a720||0xcc;return function(_0x49bfcd){if(_0x49bfcd){return _0x49c28d[_0x0908('0x30')](_0x63a720);}return _0x49c28d[_0x0908('0x31')](_0x63a720)[_0x0908('0x32')]();};}function respondWithResult(_0x22adcb,_0x2227cd){_0x2227cd=_0x2227cd||0xc8;return function(_0x21fa69){if(_0x21fa69){return _0x22adcb[_0x0908('0x31')](_0x2227cd)[_0x0908('0x33')](_0x21fa69);}};}function respondWithFilteredResult(_0x3fb4dd,_0x46c120){return function(_0x1eaf1c){if(_0x1eaf1c){var _0x3b7b2b=typeof _0x46c120[_0x0908('0x34')]===_0x0908('0x35')&&typeof _0x46c120[_0x0908('0x36')]===_0x0908('0x35');var _0x4ade7b=_0x1eaf1c[_0x0908('0x37')];var _0x1c0993=_0x3b7b2b?0x0:_0x46c120['offset'];var _0x14d8cc=_0x3b7b2b?_0x1eaf1c[_0x0908('0x37')]:_0x46c120['offset']+_0x46c120[_0x0908('0x36')];var _0x1cd439;if(_0x14d8cc>=_0x4ade7b){_0x14d8cc=_0x4ade7b;_0x1cd439=0xc8;}else{_0x1cd439=0xce;}_0x3fb4dd[_0x0908('0x31')](_0x1cd439);return _0x3fb4dd[_0x0908('0x38')](_0x0908('0x39'),_0x1c0993+'-'+_0x14d8cc+'/'+_0x4ade7b)['json'](_0x1eaf1c);}return null;};}function patchUpdates(_0x39ed0a){return function(_0x170d20){try{jsonpatch['apply'](_0x170d20,_0x39ed0a,!![]);}catch(_0x295e0a){return BPromise['reject'](_0x295e0a);}return _0x170d20[_0x0908('0x3a')]();};}function saveUpdates(_0x17202e,_0x31e0f1){return function(_0x409ecd){if(_0x409ecd){return _0x409ecd[_0x0908('0x3b')](_0x17202e)[_0x0908('0x25')](function(_0x52c9ea){return _0x52c9ea;});}return null;};}function removeEntity(_0x231df0,_0x31f9ad){return function(_0x5a9a08){if(_0x5a9a08){return _0x5a9a08['destroy']()[_0x0908('0x25')](function(){var _0x102983=_0x5a9a08['get']({'plain':!![]});var _0x3989c6=_0x0908('0x3c');return db['UserProfileResource'][_0x0908('0x3d')]({'where':{'type':_0x3989c6,'resourceId':_0x102983['id']}})[_0x0908('0x25')](function(){return _0x5a9a08;});})['then'](function(){_0x231df0[_0x0908('0x31')](0xcc)[_0x0908('0x32')]();});}};}function handleEntityNotFound(_0x4e83ed,_0x51e125){return function(_0x55b84d){if(!_0x55b84d){_0x4e83ed[_0x0908('0x30')](0x194);}return _0x55b84d;};}function handleError(_0x5dca77,_0x5dbd52){_0x5dbd52=_0x5dbd52||0x1f4;return function(_0x317cda){logger[_0x0908('0x2c')](_0x317cda['stack']);if(_0x317cda['name']){delete _0x317cda['name'];}_0x5dca77[_0x0908('0x31')](_0x5dbd52)[_0x0908('0x3e')](_0x317cda);};}exports[_0x0908('0x3f')]=function(_0x191d79,_0x2e52d1){var _0x4eb3e9={'include':[{'model':db[_0x0908('0x40')],'as':_0x0908('0x41')}]},_0x5e0cdf={},_0x19319e={'count':0x0,'rows':[]};var _0x2f24f0=_[_0x0908('0x42')](db[_0x0908('0x43')]['rawAttributes'],function(_0x12f18b){return{'name':_0x12f18b[_0x0908('0x44')],'type':_0x12f18b['type'][_0x0908('0x45')]};});_0x5e0cdf[_0x0908('0x46')]=_['map'](_0x2f24f0,_0x0908('0x47'));_0x5e0cdf[_0x0908('0x48')]=_[_0x0908('0x49')](_0x191d79[_0x0908('0x48')]);_0x5e0cdf[_0x0908('0x4a')]=_[_0x0908('0x4b')](_0x5e0cdf[_0x0908('0x46')],_0x5e0cdf['query']);_0x4eb3e9['attributes']=_['intersection'](_0x5e0cdf[_0x0908('0x46')],qs[_0x0908('0x4c')](_0x191d79[_0x0908('0x48')]['fields']));_0x4eb3e9['attributes']=_0x4eb3e9['attributes']['length']?_0x4eb3e9[_0x0908('0x4d')]:_0x5e0cdf[_0x0908('0x46')];if(!_0x191d79[_0x0908('0x48')][_0x0908('0x4e')](_0x0908('0x4f'))){_0x4eb3e9[_0x0908('0x36')]=qs[_0x0908('0x36')](_0x191d79[_0x0908('0x48')][_0x0908('0x36')]);_0x4eb3e9[_0x0908('0x34')]=qs[_0x0908('0x34')](_0x191d79['query'][_0x0908('0x34')]);}_0x4eb3e9['order']=qs[_0x0908('0x50')](_0x191d79['query'][_0x0908('0x50')]);_0x4eb3e9[_0x0908('0x51')]=qs[_0x0908('0x4a')](_[_0x0908('0x52')](_0x191d79['query'],_0x5e0cdf[_0x0908('0x4a')]),_0x2f24f0);if(_0x191d79[_0x0908('0x48')][_0x0908('0x53')]){_0x4eb3e9['where']=_[_0x0908('0x54')](_0x4eb3e9[_0x0908('0x51')],{'$or':_['map'](_0x2f24f0,function(_0x46f1e5){if(_0x46f1e5[_0x0908('0x55')]!=='VIRTUAL'){var _0x3811c5={};_0x3811c5[_0x46f1e5[_0x0908('0x47')]]={'$like':'%'+_0x191d79[_0x0908('0x48')][_0x0908('0x53')]+'%'};return _0x3811c5;}})});}_0x4eb3e9=_['merge']({},_0x4eb3e9,_0x191d79['options']);var _0x101069={'where':_0x4eb3e9['where']};return db[_0x0908('0x43')][_0x0908('0x37')](_0x101069)[_0x0908('0x25')](function(_0x443906){_0x19319e[_0x0908('0x37')]=_0x443906;if(_0x191d79[_0x0908('0x48')]['includeAll']){_0x4eb3e9['include']=[{'all':!![]}];}return db[_0x0908('0x43')][_0x0908('0x56')](_0x4eb3e9);})[_0x0908('0x25')](function(_0x5b8e51){_0x19319e[_0x0908('0x57')]=_0x5b8e51;return _0x19319e;})[_0x0908('0x25')](respondWithFilteredResult(_0x2e52d1,_0x4eb3e9))[_0x0908('0x2f')](handleError(_0x2e52d1,null));};exports[_0x0908('0x58')]=function(_0x163e03,_0x14a628){var _0x5f2e2={'raw':![],'where':{'id':_0x163e03['params']['id']},'include':[{'model':db['Pause'],'as':_0x0908('0x41')}]},_0x28b20b={};_0x28b20b[_0x0908('0x46')]=_[_0x0908('0x49')](db['WhatsappAccount'][_0x0908('0x59')]);_0x28b20b['query']=_[_0x0908('0x49')](_0x163e03['query']);_0x28b20b[_0x0908('0x4a')]=_[_0x0908('0x4b')](_0x28b20b['model'],_0x28b20b['query']);_0x5f2e2[_0x0908('0x4d')]=_['intersection'](_0x28b20b[_0x0908('0x46')],qs[_0x0908('0x4c')](_0x163e03[_0x0908('0x48')]['fields']));_0x5f2e2['attributes']=_0x5f2e2[_0x0908('0x4d')][_0x0908('0x5a')]?_0x5f2e2[_0x0908('0x4d')]:_0x28b20b[_0x0908('0x46')];if(_0x163e03[_0x0908('0x48')][_0x0908('0x5b')]){_0x5f2e2[_0x0908('0x5c')]=[{'all':!![]}];}_0x5f2e2=_[_0x0908('0x54')]({},_0x5f2e2,_0x163e03[_0x0908('0x5d')]);return db[_0x0908('0x43')]['find'](_0x5f2e2)[_0x0908('0x25')](handleEntityNotFound(_0x14a628,null))[_0x0908('0x25')](respondWithResult(_0x14a628,null))[_0x0908('0x2f')](handleError(_0x14a628,null));};exports[_0x0908('0x5e')]=function(_0x61b70b,_0x3ccf80){return db[_0x0908('0x43')][_0x0908('0x5e')](_0x61b70b[_0x0908('0x5f')],{})['then'](function(_0x210517){var _0x2fc01d=_0x61b70b[_0x0908('0x60')]['get']({'plain':!![]});if(!_0x2fc01d)throw new Error(_0x0908('0x61'));if(_0x2fc01d['role']===_0x0908('0x60')){var _0x28e51c=_0x210517['get']({'plain':!![]});var _0x158187='WhatsappAccounts';return db[_0x0908('0x62')]['find']({'where':{'name':_0x158187,'userProfileId':_0x2fc01d[_0x0908('0x63')]},'raw':!![]})[_0x0908('0x25')](function(_0x366b4b){if(_0x366b4b&&_0x366b4b[_0x0908('0x64')]===0x0){return db[_0x0908('0x65')][_0x0908('0x5e')]({'name':_0x28e51c[_0x0908('0x47')],'resourceId':_0x28e51c['id'],'type':_0x366b4b['name'],'sectionId':_0x366b4b['id']},{})[_0x0908('0x25')](function(){return _0x210517;});}else{return _0x210517;}})['catch'](function(_0x274842){logger['error'](_0x0908('0x66'),_0x274842);throw _0x274842;});}return _0x210517;})['then'](respondWithResult(_0x3ccf80,0xc9))['catch'](handleError(_0x3ccf80,null));};exports['update']=function(_0x2b852e,_0x5235cb){if(_0x2b852e[_0x0908('0x5f')]['id']){delete _0x2b852e['body']['id'];}return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x2b852e[_0x0908('0x68')]['id']},'include':[{'model':db[_0x0908('0x40')],'as':_0x0908('0x41')}]})[_0x0908('0x25')](handleEntityNotFound(_0x5235cb,null))['then'](saveUpdates(_0x2b852e[_0x0908('0x5f')],null))[_0x0908('0x25')](respondWithResult(_0x5235cb,null))['catch'](handleError(_0x5235cb,null));};exports['destroy']=function(_0x576769,_0x27ca68){return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x576769[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x27ca68,null))[_0x0908('0x25')](removeEntity(_0x27ca68,null))['catch'](handleError(_0x27ca68,null));};exports[_0x0908('0x69')]=function(_0x319814,_0x5cf536){return db['WhatsappAccount'][_0x0908('0x69')]()[_0x0908('0x25')](respondWithResult(_0x5cf536,null))[_0x0908('0x2f')](handleError(_0x5cf536,null));};exports[_0x0908('0x6a')]=function(_0x367c72,_0x1dda26,_0x2a1d03){if(_0x367c72[_0x0908('0x5f')]['id']){delete _0x367c72[_0x0908('0x5f')]['id'];}return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x367c72[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x1dda26,null))[_0x0908('0x25')](function(_0x17fe70){if(_0x17fe70){_0x367c72[_0x0908('0x5f')][_0x0908('0x6b')]=_0x17fe70['id'];return db[_0x0908('0x6c')][_0x0908('0x5e')](_0x367c72['body']);}})[_0x0908('0x25')](respondWithResult(_0x1dda26,null))['catch'](handleError(_0x1dda26,null));};exports[_0x0908('0x6d')]=function(_0x589b1c,_0xbb92bb,_0x3140ee){var _0x45c15f={'raw':![],'where':{}};var _0x2c3bdb={};var _0x53ac1c={'count':0x0,'rows':[]};return db[_0x0908('0x43')][_0x0908('0x6e')]({'where':{'id':_0x589b1c['params']['id']}})[_0x0908('0x25')](handleEntityNotFound(_0xbb92bb,null))['then'](function(_0x31ed8c){if(_0x31ed8c){_0x2c3bdb[_0x0908('0x46')]=_[_0x0908('0x49')](db[_0x0908('0x6c')][_0x0908('0x59')]);_0x2c3bdb[_0x0908('0x48')]=_[_0x0908('0x49')](_0x589b1c[_0x0908('0x48')]);_0x2c3bdb[_0x0908('0x4a')]=_['intersection'](_0x2c3bdb[_0x0908('0x46')],_0x2c3bdb['query']);_0x45c15f[_0x0908('0x4d')]=_[_0x0908('0x4b')](_0x2c3bdb[_0x0908('0x46')],qs[_0x0908('0x4c')](_0x589b1c['query'][_0x0908('0x4c')]));_0x45c15f[_0x0908('0x4d')]=_0x45c15f['attributes']['length']?_0x45c15f[_0x0908('0x4d')]:_0x2c3bdb[_0x0908('0x46')];if(!_0x589b1c[_0x0908('0x48')][_0x0908('0x4e')](_0x0908('0x4f'))){_0x45c15f[_0x0908('0x36')]=qs[_0x0908('0x36')](_0x589b1c[_0x0908('0x48')]['limit']);_0x45c15f['offset']=qs[_0x0908('0x34')](_0x589b1c[_0x0908('0x48')][_0x0908('0x34')]);}_0x45c15f['order']=qs['sort'](_0x589b1c['query']['sort']);_0x45c15f[_0x0908('0x51')]=qs[_0x0908('0x4a')](_['pick'](_0x589b1c['query'],_0x2c3bdb[_0x0908('0x4a')]));_0x45c15f[_0x0908('0x51')][_0x0908('0x6b')]=_0x31ed8c['id'];if(_0x589b1c['query'][_0x0908('0x53')]){_0x45c15f[_0x0908('0x51')]=_[_0x0908('0x54')](_0x45c15f['where'],{'$or':_['map'](_0x45c15f[_0x0908('0x4d')],function(_0x3dc481){var _0x4fcb77={};_0x4fcb77[_0x3dc481]={'$like':'%'+_0x589b1c[_0x0908('0x48')][_0x0908('0x53')]+'%'};return _0x4fcb77;})});}_0x45c15f=_[_0x0908('0x54')]({},_0x45c15f,_0x589b1c[_0x0908('0x5d')]);return db['Disposition']['count']({'where':_0x45c15f[_0x0908('0x51')]})[_0x0908('0x25')](function(_0x4bfce2){_0x53ac1c[_0x0908('0x37')]=_0x4bfce2;if(_0x589b1c[_0x0908('0x48')][_0x0908('0x5b')]){_0x45c15f[_0x0908('0x5c')]=[{'all':!![]}];}return db[_0x0908('0x6c')][_0x0908('0x56')](_0x45c15f);})[_0x0908('0x25')](function(_0x52cff7){_0x53ac1c[_0x0908('0x57')]=_0x52cff7;return _0x53ac1c;});}})[_0x0908('0x25')](respondWithFilteredResult(_0xbb92bb,_0x45c15f))['catch'](handleError(_0xbb92bb,null));};exports[_0x0908('0x6f')]=function(_0x598148,_0x3c572d,_0x425bae){return db[_0x0908('0x43')]['find']({'where':{'id':_0x598148[_0x0908('0x68')]['id']}})['then'](handleEntityNotFound(_0x3c572d,null))[_0x0908('0x25')](function(_0x5e0eaa){if(_0x5e0eaa){return _0x5e0eaa[_0x0908('0x6f')](_0x598148['query']['ids']);}})[_0x0908('0x25')](respondWithStatusCode(_0x3c572d,null))[_0x0908('0x2f')](handleError(_0x3c572d,null));};exports[_0x0908('0x70')]=function(_0x57d495,_0x2b75a5,_0x19c894){if(_0x57d495['body']['id']){delete _0x57d495[_0x0908('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x57d495[_0x0908('0x68')]['id']}})['then'](handleEntityNotFound(_0x2b75a5,null))[_0x0908('0x25')](function(_0xca4579){if(_0xca4579){_0x57d495[_0x0908('0x5f')][_0x0908('0x6b')]=_0xca4579['id'];return db[_0x0908('0x71')][_0x0908('0x5e')](_0x57d495[_0x0908('0x5f')]);}})[_0x0908('0x25')](respondWithResult(_0x2b75a5,null))[_0x0908('0x2f')](handleError(_0x2b75a5,null));};exports[_0x0908('0x72')]=function(_0x57290d,_0x7233b0,_0x4339dd){var _0x14f69e={'raw':![],'where':{}};var _0x46d23e={};var _0x5e0baf={'count':0x0,'rows':[]};return db[_0x0908('0x43')][_0x0908('0x6e')]({'where':{'id':_0x57290d[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x7233b0,null))[_0x0908('0x25')](function(_0x3571e2){if(_0x3571e2){_0x46d23e['model']=_[_0x0908('0x49')](db[_0x0908('0x71')][_0x0908('0x59')]);_0x46d23e['query']=_[_0x0908('0x49')](_0x57290d[_0x0908('0x48')]);_0x46d23e[_0x0908('0x4a')]=_[_0x0908('0x4b')](_0x46d23e['model'],_0x46d23e[_0x0908('0x48')]);_0x14f69e[_0x0908('0x4d')]=_[_0x0908('0x4b')](_0x46d23e['model'],qs[_0x0908('0x4c')](_0x57290d['query']['fields']));_0x14f69e[_0x0908('0x4d')]=_0x14f69e['attributes'][_0x0908('0x5a')]?_0x14f69e[_0x0908('0x4d')]:_0x46d23e[_0x0908('0x46')];if(!_0x57290d['query']['hasOwnProperty'](_0x0908('0x4f'))){_0x14f69e['limit']=qs[_0x0908('0x36')](_0x57290d[_0x0908('0x48')]['limit']);_0x14f69e[_0x0908('0x34')]=qs[_0x0908('0x34')](_0x57290d[_0x0908('0x48')]['offset']);}_0x14f69e[_0x0908('0x73')]=qs['sort'](_0x57290d[_0x0908('0x48')][_0x0908('0x50')]);_0x14f69e['where']=qs[_0x0908('0x4a')](_[_0x0908('0x52')](_0x57290d[_0x0908('0x48')],_0x46d23e[_0x0908('0x4a')]));_0x14f69e[_0x0908('0x51')]['WhatsappAccountId']=_0x3571e2['id'];if(_0x57290d[_0x0908('0x48')]['filter']){_0x14f69e['where']=_[_0x0908('0x54')](_0x14f69e[_0x0908('0x51')],{'$or':_[_0x0908('0x42')](_0x14f69e[_0x0908('0x4d')],function(_0x14ccb9){var _0x4cfed5={};_0x4cfed5[_0x14ccb9]={'$like':'%'+_0x57290d[_0x0908('0x48')]['filter']+'%'};return _0x4cfed5;})});}_0x14f69e=_[_0x0908('0x54')]({},_0x14f69e,_0x57290d['options']);return db[_0x0908('0x71')]['count']({'where':_0x14f69e[_0x0908('0x51')]})[_0x0908('0x25')](function(_0x3cc663){_0x5e0baf[_0x0908('0x37')]=_0x3cc663;if(_0x57290d[_0x0908('0x48')][_0x0908('0x5b')]){_0x14f69e[_0x0908('0x5c')]=[{'all':!![]}];}return db[_0x0908('0x71')][_0x0908('0x56')](_0x14f69e);})[_0x0908('0x25')](function(_0x35c8e0){_0x5e0baf['rows']=_0x35c8e0;return _0x5e0baf;});}})[_0x0908('0x25')](respondWithFilteredResult(_0x7233b0,_0x14f69e))[_0x0908('0x2f')](handleError(_0x7233b0,null));};exports[_0x0908('0x74')]=function(_0x35dbf4,_0x237e64,_0x439697){return db[_0x0908('0x43')]['find']({'where':{'id':_0x35dbf4['params']['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x237e64,null))['then'](function(_0x8a73ad){if(_0x8a73ad){return _0x8a73ad[_0x0908('0x74')](_0x35dbf4[_0x0908('0x48')][_0x0908('0x75')]);}})[_0x0908('0x25')](respondWithStatusCode(_0x237e64,null))['catch'](handleError(_0x237e64,null));};exports['addAgents']=function(_0x4d7d1c,_0x144205,_0x595fa1){return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x4d7d1c[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x144205,null))[_0x0908('0x25')](function(_0x111940){if(_0x111940){return _0x111940[_0x0908('0x76')](_0x4d7d1c[_0x0908('0x5f')][_0x0908('0x75')],_[_0x0908('0x77')](_0x4d7d1c['body'],[_0x0908('0x75'),'id'])||{})['spread'](function(_0x1af511){for(var _0xe07a75=0x0;_0xe07a75<_0x4d7d1c['body']['ids'][_0x0908('0x5a')];_0xe07a75+=0x1){socket[_0x0908('0x78')](_0x0908('0x79'),{'UserId':Number(_0x4d7d1c[_0x0908('0x5f')][_0x0908('0x75')][_0xe07a75]),'WhatsappAccountId':Number(_0x4d7d1c[_0x0908('0x68')]['id'])});}return _0x1af511;});}})[_0x0908('0x25')](respondWithResult(_0x144205,null))[_0x0908('0x2f')](handleError(_0x144205,null));};exports['removeAgents']=function(_0x596508,_0xa3db6f,_0x29dade){return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x596508[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0xa3db6f,null))[_0x0908('0x25')](function(_0x4d258){if(_0x4d258){return _0x4d258[_0x0908('0x7a')](_0x596508['query'][_0x0908('0x75')])['then'](function(){if(_[_0x0908('0x7b')](_0x596508[_0x0908('0x48')][_0x0908('0x75')])){for(var _0x176ef9=0x0;_0x176ef9<_0x596508[_0x0908('0x48')]['ids'][_0x0908('0x5a')];_0x176ef9+=0x1){socket[_0x0908('0x78')]('userWhatsappAccount:remove',{'UserId':Number(_0x596508['query'][_0x0908('0x75')][_0x176ef9]),'WhatsappAccountId':Number(_0x596508[_0x0908('0x68')]['id'])});}}else{socket[_0x0908('0x78')]('userWhatsappAccount:remove',{'UserId':Number(_0x596508[_0x0908('0x48')][_0x0908('0x75')]),'WhatsappAccountId':Number(_0x596508['params']['id'])});}});}})[_0x0908('0x25')](respondWithStatusCode(_0xa3db6f,null))[_0x0908('0x2f')](handleError(_0xa3db6f,null));};exports[_0x0908('0x7c')]=function(_0x5390c3,_0x163f9d,_0x3e54e2){var _0x3e0328={};var _0x34451f={};var _0x47bc27;var _0x5c53f3;return db['WhatsappAccount'][_0x0908('0x6e')]({'where':{'id':_0x5390c3[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x163f9d,null))['then'](function(_0x10ee43){if(_0x10ee43){_0x47bc27=_0x10ee43;_0x34451f[_0x0908('0x46')]=_[_0x0908('0x49')](db['User'][_0x0908('0x59')]);_0x34451f['query']=_[_0x0908('0x49')](_0x5390c3['query']);_0x34451f[_0x0908('0x4a')]=_['intersection'](_0x34451f[_0x0908('0x46')],_0x34451f['query']);_0x3e0328[_0x0908('0x4d')]=_['intersection'](_0x34451f[_0x0908('0x46')],qs[_0x0908('0x4c')](_0x5390c3[_0x0908('0x48')][_0x0908('0x4c')]));_0x3e0328[_0x0908('0x4d')]=_0x3e0328[_0x0908('0x4d')]['length']?_0x3e0328[_0x0908('0x4d')]:_0x34451f['model'];_0x3e0328[_0x0908('0x73')]=qs['sort'](_0x5390c3['query'][_0x0908('0x50')]);_0x3e0328['where']=qs[_0x0908('0x4a')](_['pick'](_0x5390c3['query'],_0x34451f[_0x0908('0x4a')]));if(_0x5390c3[_0x0908('0x48')][_0x0908('0x53')]){_0x3e0328['where']=_[_0x0908('0x54')](_0x3e0328['where'],{'$or':_[_0x0908('0x42')](_0x3e0328[_0x0908('0x4d')],function(_0x2a50a2){var _0x196936={};_0x196936[_0x2a50a2]={'$like':'%'+_0x5390c3['query']['filter']+'%'};return _0x196936;})});}_0x3e0328=_[_0x0908('0x54')]({},_0x3e0328,_0x5390c3[_0x0908('0x5d')]);return _0x47bc27['getAgents'](_0x3e0328);}})['then'](function(_0x523223){if(_0x523223){_0x5c53f3=_0x523223[_0x0908('0x5a')];if(!_0x5390c3[_0x0908('0x48')][_0x0908('0x4e')]('nolimit')){_0x3e0328[_0x0908('0x36')]=qs[_0x0908('0x36')](_0x5390c3[_0x0908('0x48')][_0x0908('0x36')]);_0x3e0328[_0x0908('0x34')]=qs[_0x0908('0x34')](_0x5390c3[_0x0908('0x48')]['offset']);}return _0x47bc27[_0x0908('0x7c')](_0x3e0328);}})['then'](function(_0x3ba92e){if(_0x3ba92e){return _0x3ba92e?{'count':_0x5c53f3,'rows':_0x3ba92e}:null;}})[_0x0908('0x25')](respondWithResult(_0x163f9d,null))[_0x0908('0x2f')](handleError(_0x163f9d,null));};exports[_0x0908('0x7d')]=function(_0x49a7ea,_0x3292d9,_0x3f3cdf){return db[_0x0908('0x43')][_0x0908('0x6e')]({'where':{'id':_0x49a7ea[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x3292d9,null))[_0x0908('0x25')](function(_0x4d767f){if(_0x4d767f){return db[_0x0908('0x7e')][_0x0908('0x7f')](function(_0x83f955){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x49a7ea['params']['id']},'transaction':_0x83f955})['then'](function(_0x4d949f){var _0x1f7207=_['map'](_0x49a7ea[_0x0908('0x5f')],function(_0x3aecd6){_0x3aecd6[_0x0908('0x6b')]=_0x49a7ea[_0x0908('0x68')]['id'];return _0x3aecd6;});return db[_0x0908('0x80')]['bulkCreate'](_0x1f7207,{'transaction':_0x83f955});});})[_0x0908('0x25')](function(){return db[_0x0908('0x80')][_0x0908('0x81')]({'where':{'WhatsappAccountId':_0x49a7ea[_0x0908('0x68')]['id']},'order':_0x0908('0x82')});});}})[_0x0908('0x25')](respondWithResult(_0x3292d9,null))['catch'](handleError(_0x3292d9,null));};exports['getApplications']=function(_0x3bfa83,_0x8f8291,_0x59d1cc){var _0x11520b={};var _0x36a08c={};var _0x17cda7;var _0x7e4833;return db[_0x0908('0x43')][_0x0908('0x6e')]({'where':{'id':_0x3bfa83[_0x0908('0x68')]['id']}})[_0x0908('0x25')](handleEntityNotFound(_0x8f8291,null))[_0x0908('0x25')](function(_0x472288){if(_0x472288){_0x17cda7=_0x472288;_0x36a08c[_0x0908('0x46')]=_[_0x0908('0x49')](db['WhatsappApplication'][_0x0908('0x59')]);_0x36a08c[_0x0908('0x48')]=_[_0x0908('0x49')](_0x3bfa83['query']);_0x36a08c[_0x0908('0x4a')]=_[_0x0908('0x4b')](_0x36a08c[_0x0908('0x46')],_0x36a08c[_0x0908('0x48')]);_0x11520b[_0x0908('0x4d')]=_['intersection'](_0x36a08c[_0x0908('0x46')],qs[_0x0908('0x4c')](_0x3bfa83['query'][_0x0908('0x4c')]));_0x11520b[_0x0908('0x4d')]=_0x11520b['attributes']['length']?_0x11520b[_0x0908('0x4d')]:_0x36a08c['model'];_0x11520b[_0x0908('0x73')]=qs[_0x0908('0x50')](_0x3bfa83['query']['sort']);_0x11520b['where']=qs[_0x0908('0x4a')](_[_0x0908('0x52')](_0x3bfa83[_0x0908('0x48')],_0x36a08c[_0x0908('0x4a')]));if(_0x3bfa83[_0x0908('0x48')][_0x0908('0x53')]){_0x11520b['where']=_['merge'](_0x11520b['where'],{'$or':_['map'](_0x11520b[_0x0908('0x4d')],function(_0x3a3ec2){var _0x86a729={};_0x86a729[_0x3a3ec2]={'$like':'%'+_0x3bfa83[_0x0908('0x48')][_0x0908('0x53')]+'%'};return _0x86a729;})});}_0x11520b=_[_0x0908('0x54')]({},_0x11520b,_0x3bfa83[_0x0908('0x5d')]);return _0x17cda7[_0x0908('0x83')](_0x11520b);}})[_0x0908('0x25')](function(_0x25d4f7){if(_0x25d4f7){_0x7e4833=_0x25d4f7[_0x0908('0x5a')];if(!_0x3bfa83[_0x0908('0x48')][_0x0908('0x4e')](_0x0908('0x4f'))){_0x11520b[_0x0908('0x36')]=qs[_0x0908('0x36')](_0x3bfa83[_0x0908('0x48')]['limit']);_0x11520b[_0x0908('0x34')]=qs[_0x0908('0x34')](_0x3bfa83['query'][_0x0908('0x34')]);}return _0x17cda7[_0x0908('0x83')](_0x11520b);}})['then'](function(_0x59aa69){if(_0x59aa69){return _0x59aa69?{'count':_0x7e4833,'rows':_0x59aa69}:null;}})[_0x0908('0x25')](respondWithResult(_0x8f8291,null))[_0x0908('0x2f')](handleError(_0x8f8291,null));};exports[_0x0908('0x84')]=function(_0x12273b,_0x3be4b1,_0x52558e){var _0x124f89={'channel':_0x0908('0x85')};var _0x211c15=[];var _0x1fda1d=[];var _0x4f58de={};return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x12273b['params']['id']},'include':[{'model':db[_0x0908('0x80')],'as':_0x0908('0x86')}]})[_0x0908('0x25')](handleEntityNotFound(_0x3be4b1,null))[_0x0908('0x25')](function(_0x124cf9){_0x124f89['account']=_0x124cf9;_0x124f89[_0x0908('0x87')]=_[_0x0908('0x88')](_0x124cf9[_0x0908('0x86')],['priority'],['asc']);if(_0x124f89[_0x0908('0x89')]['Applications']){delete _0x124f89[_0x0908('0x89')]['Applications'];}return db['CmContact']['describe']();})[_0x0908('0x25')](function(_0x416b84){if(!_0x416b84){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))](_0x0908('0x8c'));}_0x211c15=_[_0x0908('0x8d')](_[_0x0908('0x49')](_0x416b84),[_0x0908('0x8e'),_0x0908('0x8f')]);_0x1fda1d=_[_0x0908('0x8d')](_['keys'](_0x416b84),[_0x0908('0x8e'),_0x0908('0x8f'),_0x0908('0x90'),_0x0908('0x91')]);_0x124f89[_0x0908('0x5f')]={'mapKey':_0x0908('0x92')};if(_0x124f89[_0x0908('0x89')][_0x0908('0x55')]&&_0x124f89[_0x0908('0x89')][_0x0908('0x55')]===_0x0908('0x93')){_0x124f89[_0x0908('0x5f')]['from']=_0x12273b[_0x0908('0x5f')]['From'][_0x0908('0x94')](_0x0908('0x95'),'');_0x124f89[_0x0908('0x5f')][_0x0908('0x5f')]=_0x12273b['body'][_0x0908('0x96')];_0x124f89['body'][_0x0908('0x97')]=_0x12273b['body']['MessageSid'];}if(_0x124f89[_0x0908('0x5f')]['id']){delete _0x124f89[_0x0908('0x5f')]['id'];}if(_[_0x0908('0x98')](_0x124f89[_0x0908('0x5f')][_0x0908('0x99')])){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))](_0x0908('0x9a'));}if(_[_0x0908('0x98')](_0x124f89[_0x0908('0x5f')]['body'])||_0x124f89[_0x0908('0x5f')]['body']===''){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))](_0x0908('0x9b'));}if(_[_0x0908('0x98')](_0x124f89[_0x0908('0x5f')][_0x0908('0x9c')])){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fda1d);}if(!_['includes'](_0x1fda1d,_0x124f89[_0x0908('0x5f')][_0x0908('0x9c')])){throw new db[(_0x0908('0x8a'))]['ValidationError'](_0x0908('0x9d')+_0x1fda1d);}_0x4f58de[_0x124f89[_0x0908('0x5f')][_0x0908('0x9c')]]=_0x124f89[_0x0908('0x5f')][_0x0908('0x99')];return db[_0x0908('0x9e')][_0x0908('0x67')]({'where':{'id':_0x124f89[_0x0908('0x89')][_0x0908('0x91')]},'include':[{'model':db['CmContact'],'as':_0x0908('0x9f'),'where':_0x4f58de,'limit':0x1,'order':[['updatedAt',_0x0908('0xa0')]]}]});})['then'](handleEntityNotFound(_0x3be4b1,null))[_0x0908('0x25')](function(_0x1e6faa){if(_0x1e6faa){_0x124f89[_0x0908('0xa1')]=_[_0x0908('0x77')](_0x1e6faa,[_0x0908('0x9f')]);if(_0x1e6faa[_0x0908('0x9f')][_0x0908('0x5a')]){return _0x1e6faa['Contacts'][0x0];}var _0x52983b=_[_0x0908('0x1e')](_0x124f89[_0x0908('0x5f')],{'firstName':_0x124f89[_0x0908('0x5f')][_0x0908('0x99')],'ListId':_0x1e6faa['id']});_0x52983b[_0x124f89[_0x0908('0x5f')]['mapKey']]=_0x124f89[_0x0908('0x5f')][_0x0908('0x99')];return db[_0x0908('0xa2')][_0x0908('0x5e')](_0x52983b,{'fields':_0x211c15,'raw':!![]});}})['then'](handleEntityNotFound(_0x3be4b1,null))[_0x0908('0x25')](function(_0x249cbd){if(_0x249cbd){_0x124f89[_0x0908('0xa3')]=_0x249cbd;var _0x2bfb14={'ContactId':_0x249cbd['id'],'phone':_0x124f89[_0x0908('0x5f')]['from'],'WhatsappAccountId':_0x12273b[_0x0908('0x68')]['id']};var _0x58e423={'ContactId':_0x249cbd['id'],'WhatsappAccountId':_0x12273b[_0x0908('0x68')]['id'],'closed':![]};return db[_0x0908('0xa4')]['find']({'where':_0x58e423})['then'](function(_0x4cf8d4){if(_0x4cf8d4){return[_0x4cf8d4,![]];}return db[_0x0908('0xa4')][_0x0908('0x5e')](_0x2bfb14)[_0x0908('0x25')](function(_0x584c6b){return[_0x584c6b,!![]];});});}})['spread'](function(_0x3e467d,_0x3457cf){_0x124f89[_0x0908('0xa5')]=_0x3e467d['get']({'plain':!![]});_0x124f89[_0x0908('0xa5')][_0x0908('0xa6')]=![];if(_0x3457cf){if(_0x124f89[_0x0908('0x89')][_0x0908('0xa7')]){_0x124f89['applications']['push']({'id':0x0,'priority':_0x124f89[_0x0908('0x87')][_0x0908('0x5a')]+0x1,'app':_0x0908('0xa8'),'appdata':_0x0908('0xa9'),'interval':_0x0908('0xaa')});}_0x124f89[_0x0908('0xa5')][_0x0908('0xa6')]=!![];}return db[_0x0908('0xab')][_0x0908('0x5e')]({'phone':_0x124f89[_0x0908('0x5f')][_0x0908('0x99')],'messageId':_0x124f89[_0x0908('0x5f')][_0x0908('0x97')],'body':_0x124f89[_0x0908('0x5f')][_0x0908('0x5f')],'WhatsappAccountId':_0x12273b['params']['id'],'WhatsappInteractionId':_0x3e467d['id'],'direction':'in','ContactId':_0x3e467d[_0x0908('0xac')],'AttachmentId':_0x124f89[_0x0908('0x5f')]['AttachmentId']});})[_0x0908('0x25')](function(_0x599821){_0x124f89[_0x0908('0x2d')]=_0x599821;if(_0x124f89[_0x0908('0xa5')]['UserId']){return db['User'][_0x0908('0x67')]({'attributes':['id',_0x0908('0x47')],'where':{'id':_0x124f89[_0x0908('0xa5')][_0x0908('0xad')]}})[_0x0908('0x25')](function(_0x3cefce){if(_0x3cefce){_0x124f89['applications'][_0x0908('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3cefce[_0x0908('0x47')]+','+(_0x124f89[_0x0908('0x89')][_0x0908('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0908('0xb0'),_0x0908('0xb1'),_0x124f89);});}return respondWithRpcPromise('Start',_0x0908('0xb1'),_0x124f89);})['then'](function(_0x12a64d){if(_0x12a64d){var _0x1effaf=0xc8;var _0x445e9d=_0x0908('0xb2');logger[_0x0908('0x26')](_0x0908('0x2a'),_0x445e9d,_0x1effaf,'entity\x20found');logger[_0x0908('0x29')](_0x0908('0xb3'),_0x445e9d,_0x1effaf,_0x0908('0xb4'),JSON[_0x0908('0x2b')](_0x12a64d));if(_0x124f89[_0x0908('0x89')][_0x0908('0x55')]===_0x0908('0x93')){return _0x3be4b1[_0x0908('0x31')](_0x1effaf)['set'](_0x0908('0xb5'),_0x0908('0xb6'))[_0x0908('0x3e')](_0x0908('0xb7'));}else{return _0x3be4b1[_0x0908('0x31')](_0x1effaf)[_0x0908('0x33')](_0x12a64d);}}})[_0x0908('0x2f')](handleError(_0x3be4b1,null));};exports['send']=function(_0x36ec2d,_0x56ba81,_0x2c04a9){var _0x4aac7a,_0x1b514d,_0x1daefa;if(_[_0x0908('0x98')](_0x36ec2d['body'][_0x0908('0x5f')])||_0x36ec2d[_0x0908('0x5f')][_0x0908('0x5f')]===''){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))](_0x0908('0x9b'));}if(_[_0x0908('0x98')](_0x36ec2d[_0x0908('0x5f')]['to'])){throw new db[(_0x0908('0x8a'))][(_0x0908('0x8b'))](_0x0908('0xb8'));}_0x4aac7a=_0x36ec2d[_0x0908('0x5f')]['to'];return db[_0x0908('0x43')][_0x0908('0x67')]({'where':{'id':_0x36ec2d[_0x0908('0x68')]['id']},'include':[{'model':db[_0x0908('0x9e')],'as':_0x0908('0xb9'),'include':[{'model':db[_0x0908('0xa2')],'as':_0x0908('0x9f'),'where':{'mobile':_0x4aac7a},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x0908('0x25')](handleEntityNotFound(_0x56ba81,null))[_0x0908('0x25')](function(_0x1b0624){if(_0x1b0624&&_0x1b0624[_0x0908('0xb9')]){_0x1b514d=_0x1b0624[_0x0908('0xba')]({'plain':!![]});if(_0x1b514d[_0x0908('0xb9')]&&_0x1b514d['List'][_0x0908('0x9f')][_0x0908('0x5a')]){return _0x1b514d[_0x0908('0xb9')][_0x0908('0x9f')][0x0];}return db[_0x0908('0xa2')][_0x0908('0x5e')](_[_0x0908('0x1e')](_0x36ec2d['body'],{'firstName':_0x4aac7a,'mobile':_0x4aac7a,'phone':_0x4aac7a,'ListId':_0x1b514d[_0x0908('0x91')]}));}})[_0x0908('0x25')](handleEntityNotFound(_0x56ba81,null))[_0x0908('0x25')](function(_0x166ca3){if(_0x166ca3){_0x1daefa=_0x166ca3;return db[_0x0908('0xa4')][_0x0908('0x67')]({'where':{'ContactId':_0x1daefa['id'],'closed':![],'WhatsappAccountId':_0x1b514d['id']}})[_0x0908('0x25')](function(_0x3a0709){if(_0x3a0709){return[_0x3a0709,![]];}return db[_0x0908('0xa4')]['create']({'UserId':_0x36ec2d[_0x0908('0x60')]['id'],'ContactId':_0x1daefa['id'],'WhatsappAccountId':_0x1b514d['id'],'phone':_0x4aac7a,'firstMsgDirection':_0x0908('0xbb'),'Messages':[_[_0x0908('0x54')](_0x36ec2d[_0x0908('0x5f')],{'read':![],'body':_0x36ec2d[_0x0908('0x5f')][_0x0908('0x5f')],'phone':_0x4aac7a,'WhatsappAccountId':_0x1b514d['id'],'UserId':_0x36ec2d[_0x0908('0x60')]['id'],'ContactId':_0x1daefa['id']})]},{'include':[{'model':db[_0x0908('0xab')],'as':_0x0908('0xbc')}]})[_0x0908('0x25')](function(_0x5178fd){return[_0x5178fd,!![]];});});}})[_0x0908('0xbd')](function(_0x590763,_0x5e9a47){if(_0x5e9a47){return _0x590763;}return db['WhatsappMessage']['create'](_['merge'](_0x36ec2d[_0x0908('0x5f')],{'read':![],'body':_0x36ec2d[_0x0908('0x5f')]['body'],'phone':_0x4aac7a,'WhatsappAccountId':_0x1b514d['id'],'WhatsappInteractionId':_0x590763['id'],'UserId':_0x36ec2d[_0x0908('0x60')]['id'],'ContactId':_0x1daefa['id']}))[_0x0908('0x25')](function(_0x482ae2){_0x590763[_0x0908('0xbe')]['Messages']=[];_0x590763[_0x0908('0xbe')][_0x0908('0xbc')][_0x0908('0xbf')](_0x482ae2[_0x0908('0xbe')]);return _0x590763;});})['then'](respondWithResult(_0x56ba81,null))['catch'](handleError(_0x56ba81,null));}; \ No newline at end of file +var _0x840b=['filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','intersection','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','pick','getAgents','addApplications','transaction','bulkCreate','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','from','From','replace','whatsapp:','Body','messageId','MessageSid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','list','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','applications','*,*,*,*','WhatsappMessage','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../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','./whatsappAccount.socket','register','jayson/promise','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','map','WhatsappAccount','rawAttributes','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x840b,0x6e));var _0xb840=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x840b[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xb840('0x0'));var rimraf=require(_0xb840('0x1'));var zipdir=require(_0xb840('0x2'));var jsonpatch=require(_0xb840('0x3'));var rp=require(_0xb840('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb840('0x5'));var path=require(_0xb840('0x6'));var sox=require(_0xb840('0x7'));var csv=require(_0xb840('0x8'));var ejs=require(_0xb840('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb840('0xa'));var squel=require(_0xb840('0xb'));var crypto=require(_0xb840('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb840('0x8'));var querystring=require('querystring');var Papa=require(_0xb840('0xd'));var Redis=require(_0xb840('0xe'));var authService=require(_0xb840('0xf'));var qs=require(_0xb840('0x10'));var as=require(_0xb840('0x11'));var hardwareService=require(_0xb840('0x12'));var logger=require(_0xb840('0x13'))(_0xb840('0x14'));var utils=require('../../config/utils');var config=require(_0xb840('0x15'));var licenseUtil=require(_0xb840('0x16'));var db=require(_0xb840('0x17'))['db'];config[_0xb840('0x18')]=_[_0xb840('0x19')](config[_0xb840('0x18')],{'host':_0xb840('0x1a'),'port':0x18eb});var socket=require(_0xb840('0x1b'))(new Redis(config[_0xb840('0x18')]));require(_0xb840('0x1c'))[_0xb840('0x1d')](socket);var jayson=require(_0xb840('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0xd5adb2,_0x2282e6,_0x57868c,_0x344127){return new BPromise(function(_0x5962b9,_0xd2c3e1){var _0x5e5baf=_0x344127||client;return _0x5e5baf[_0xb840('0x1f')](_0xd5adb2,_0x57868c)[_0xb840('0x20')](function(_0xbe3664){logger[_0xb840('0x21')](_0xb840('0x22'),_0x2282e6,_0xb840('0x23'));logger[_0xb840('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2282e6,_0xb840('0x23'),JSON[_0xb840('0x25')](_0xbe3664));if(_0xbe3664[_0xb840('0x26')]){if(_0xbe3664['error'][_0xb840('0x27')]===0x1f4){logger[_0xb840('0x26')](_0xb840('0x22'),_0x2282e6,_0xbe3664[_0xb840('0x26')][_0xb840('0x28')]);return _0xd2c3e1(_0xbe3664[_0xb840('0x26')][_0xb840('0x28')]);}logger[_0xb840('0x26')](_0xb840('0x22'),_0x2282e6,_0xbe3664[_0xb840('0x26')][_0xb840('0x28')]);return _0x5962b9(_0xbe3664[_0xb840('0x26')][_0xb840('0x28')]);}else{logger[_0xb840('0x21')](_0xb840('0x22'),_0x2282e6,_0xb840('0x23'));_0x5962b9(_0xbe3664[_0xb840('0x29')][_0xb840('0x28')]);}})[_0xb840('0x2a')](function(_0x658098){logger[_0xb840('0x26')](_0xb840('0x22'),_0x2282e6,_0x658098);_0xd2c3e1(_0x658098);});});}function respondWithStatusCode(_0x2c3cb4,_0x1643fc){_0x1643fc=_0x1643fc||0xcc;return function(_0x4d1598){if(_0x4d1598){return _0x2c3cb4[_0xb840('0x2b')](_0x1643fc);}return _0x2c3cb4[_0xb840('0x2c')](_0x1643fc)[_0xb840('0x2d')]();};}function respondWithResult(_0x301da7,_0x5e8242){_0x5e8242=_0x5e8242||0xc8;return function(_0x58b48c){if(_0x58b48c){return _0x301da7[_0xb840('0x2c')](_0x5e8242)[_0xb840('0x2e')](_0x58b48c);}};}function respondWithFilteredResult(_0xa4e467,_0x3eb1a3){return function(_0x2471d8){if(_0x2471d8){var _0x31db3a=typeof _0x3eb1a3[_0xb840('0x2f')]===_0xb840('0x30')&&typeof _0x3eb1a3[_0xb840('0x31')]===_0xb840('0x30');var _0x48894b=_0x2471d8[_0xb840('0x32')];var _0x4ab9df=_0x31db3a?0x0:_0x3eb1a3['offset'];var _0x33d219=_0x31db3a?_0x2471d8[_0xb840('0x32')]:_0x3eb1a3[_0xb840('0x2f')]+_0x3eb1a3[_0xb840('0x31')];var _0x3f734a;if(_0x33d219>=_0x48894b){_0x33d219=_0x48894b;_0x3f734a=0xc8;}else{_0x3f734a=0xce;}_0xa4e467[_0xb840('0x2c')](_0x3f734a);return _0xa4e467['set']('Content-Range',_0x4ab9df+'-'+_0x33d219+'/'+_0x48894b)[_0xb840('0x2e')](_0x2471d8);}return null;};}function patchUpdates(_0x38a889){return function(_0x2c7f41){try{jsonpatch['apply'](_0x2c7f41,_0x38a889,!![]);}catch(_0x16a457){return BPromise['reject'](_0x16a457);}return _0x2c7f41[_0xb840('0x33')]();};}function saveUpdates(_0x2d703d,_0x1b0c3b){return function(_0x4cc6dd){if(_0x4cc6dd){return _0x4cc6dd[_0xb840('0x34')](_0x2d703d)[_0xb840('0x20')](function(_0x13c03f){return _0x13c03f;});}return null;};}function removeEntity(_0x52543e,_0x1444c2){return function(_0x45be55){if(_0x45be55){return _0x45be55[_0xb840('0x35')]()[_0xb840('0x20')](function(){var _0x39703c=_0x45be55['get']({'plain':!![]});var _0x40545c=_0xb840('0x36');return db[_0xb840('0x37')][_0xb840('0x35')]({'where':{'type':_0x40545c,'resourceId':_0x39703c['id']}})['then'](function(){return _0x45be55;});})[_0xb840('0x20')](function(){_0x52543e[_0xb840('0x2c')](0xcc)[_0xb840('0x2d')]();});}};}function handleEntityNotFound(_0x1356f2,_0x5047c5){return function(_0x397a00){if(!_0x397a00){_0x1356f2[_0xb840('0x2b')](0x194);}return _0x397a00;};}function handleError(_0x5a81cf,_0x6be8a9){_0x6be8a9=_0x6be8a9||0x1f4;return function(_0xa1318c){logger[_0xb840('0x26')](_0xa1318c[_0xb840('0x38')]);if(_0xa1318c['name']){delete _0xa1318c[_0xb840('0x39')];}_0x5a81cf[_0xb840('0x2c')](_0x6be8a9)['send'](_0xa1318c);};}exports[_0xb840('0x3a')]=function(_0x5766d3,_0xf3f29f){var _0x2c8e16={'include':[{'model':db[_0xb840('0x3b')],'as':'mandatoryDispositionPause'}]},_0x346709={},_0x5a9067={'count':0x0,'rows':[]};var _0x564a55=_[_0xb840('0x3c')](db[_0xb840('0x3d')][_0xb840('0x3e')],function(_0x34682d){return{'name':_0x34682d['fieldName'],'type':_0x34682d[_0xb840('0x3f')]['key']};});_0x346709[_0xb840('0x40')]=_['map'](_0x564a55,_0xb840('0x39'));_0x346709[_0xb840('0x41')]=_[_0xb840('0x42')](_0x5766d3['query']);_0x346709['filters']=_['intersection'](_0x346709[_0xb840('0x40')],_0x346709['query']);_0x2c8e16[_0xb840('0x43')]=_['intersection'](_0x346709['model'],qs[_0xb840('0x44')](_0x5766d3[_0xb840('0x41')][_0xb840('0x44')]));_0x2c8e16[_0xb840('0x43')]=_0x2c8e16['attributes'][_0xb840('0x45')]?_0x2c8e16[_0xb840('0x43')]:_0x346709[_0xb840('0x40')];if(!_0x5766d3['query'][_0xb840('0x46')](_0xb840('0x47'))){_0x2c8e16['limit']=qs[_0xb840('0x31')](_0x5766d3[_0xb840('0x41')][_0xb840('0x31')]);_0x2c8e16[_0xb840('0x2f')]=qs[_0xb840('0x2f')](_0x5766d3[_0xb840('0x41')][_0xb840('0x2f')]);}_0x2c8e16[_0xb840('0x48')]=qs[_0xb840('0x49')](_0x5766d3['query']['sort']);_0x2c8e16['where']=qs[_0xb840('0x4a')](_['pick'](_0x5766d3[_0xb840('0x41')],_0x346709[_0xb840('0x4a')]),_0x564a55);if(_0x5766d3['query'][_0xb840('0x4b')]){_0x2c8e16['where']=_[_0xb840('0x4c')](_0x2c8e16['where'],{'$or':_['map'](_0x564a55,function(_0x3c86ff){if(_0x3c86ff['type']!==_0xb840('0x4d')){var _0x2e32d2={};_0x2e32d2[_0x3c86ff[_0xb840('0x39')]]={'$like':'%'+_0x5766d3[_0xb840('0x41')][_0xb840('0x4b')]+'%'};return _0x2e32d2;}})});}_0x2c8e16=_[_0xb840('0x4c')]({},_0x2c8e16,_0x5766d3[_0xb840('0x4e')]);var _0x5cf8d4={'where':_0x2c8e16[_0xb840('0x4f')]};return db[_0xb840('0x3d')]['count'](_0x5cf8d4)[_0xb840('0x20')](function(_0x55a5ca){_0x5a9067['count']=_0x55a5ca;if(_0x5766d3[_0xb840('0x41')][_0xb840('0x50')]){_0x2c8e16[_0xb840('0x51')]=[{'all':!![]}];}return db[_0xb840('0x3d')][_0xb840('0x52')](_0x2c8e16);})['then'](function(_0xa55ecc){_0x5a9067[_0xb840('0x53')]=_0xa55ecc;return _0x5a9067;})[_0xb840('0x20')](respondWithFilteredResult(_0xf3f29f,_0x2c8e16))[_0xb840('0x2a')](handleError(_0xf3f29f,null));};exports[_0xb840('0x54')]=function(_0x43ca65,_0x1b2aba){var _0x49ac4a={'raw':![],'where':{'id':_0x43ca65[_0xb840('0x55')]['id']},'include':[{'model':db[_0xb840('0x3b')],'as':_0xb840('0x56')}]},_0x18e4f5={};_0x18e4f5[_0xb840('0x40')]=_[_0xb840('0x42')](db[_0xb840('0x3d')]['rawAttributes']);_0x18e4f5[_0xb840('0x41')]=_[_0xb840('0x42')](_0x43ca65[_0xb840('0x41')]);_0x18e4f5[_0xb840('0x4a')]=_[_0xb840('0x57')](_0x18e4f5[_0xb840('0x40')],_0x18e4f5[_0xb840('0x41')]);_0x49ac4a[_0xb840('0x43')]=_[_0xb840('0x57')](_0x18e4f5[_0xb840('0x40')],qs['fields'](_0x43ca65[_0xb840('0x41')][_0xb840('0x44')]));_0x49ac4a[_0xb840('0x43')]=_0x49ac4a[_0xb840('0x43')]['length']?_0x49ac4a[_0xb840('0x43')]:_0x18e4f5[_0xb840('0x40')];if(_0x43ca65['query']['includeAll']){_0x49ac4a[_0xb840('0x51')]=[{'all':!![]}];}_0x49ac4a=_[_0xb840('0x4c')]({},_0x49ac4a,_0x43ca65['options']);return db['WhatsappAccount'][_0xb840('0x58')](_0x49ac4a)[_0xb840('0x20')](handleEntityNotFound(_0x1b2aba,null))[_0xb840('0x20')](respondWithResult(_0x1b2aba,null))[_0xb840('0x2a')](handleError(_0x1b2aba,null));};exports[_0xb840('0x59')]=function(_0x31bcbb,_0x2cb525){return db[_0xb840('0x3d')][_0xb840('0x59')](_0x31bcbb['body'],{})[_0xb840('0x20')](function(_0x907c0){var _0x45321b=_0x31bcbb[_0xb840('0x5a')][_0xb840('0x5b')]({'plain':!![]});if(!_0x45321b)throw new Error(_0xb840('0x5c'));if(_0x45321b['role']==='user'){var _0x79ad00=_0x907c0[_0xb840('0x5b')]({'plain':!![]});var _0x257078='WhatsappAccounts';return db[_0xb840('0x5d')][_0xb840('0x58')]({'where':{'name':_0x257078,'userProfileId':_0x45321b[_0xb840('0x5e')]},'raw':!![]})[_0xb840('0x20')](function(_0x510b07){if(_0x510b07&&_0x510b07[_0xb840('0x5f')]===0x0){return db[_0xb840('0x37')][_0xb840('0x59')]({'name':_0x79ad00[_0xb840('0x39')],'resourceId':_0x79ad00['id'],'type':_0x510b07[_0xb840('0x39')],'sectionId':_0x510b07['id']},{})[_0xb840('0x20')](function(){return _0x907c0;});}else{return _0x907c0;}})[_0xb840('0x2a')](function(_0x27d4e9){logger[_0xb840('0x26')](_0xb840('0x60'),_0x27d4e9);throw _0x27d4e9;});}return _0x907c0;})[_0xb840('0x20')](respondWithResult(_0x2cb525,0xc9))[_0xb840('0x2a')](handleError(_0x2cb525,null));};exports[_0xb840('0x34')]=function(_0xd3e1ea,_0x3f137d){if(_0xd3e1ea['body']['id']){delete _0xd3e1ea[_0xb840('0x61')]['id'];}return db['WhatsappAccount'][_0xb840('0x58')]({'where':{'id':_0xd3e1ea['params']['id']},'include':[{'model':db[_0xb840('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xb840('0x20')](handleEntityNotFound(_0x3f137d,null))[_0xb840('0x20')](saveUpdates(_0xd3e1ea[_0xb840('0x61')],null))['then'](respondWithResult(_0x3f137d,null))[_0xb840('0x2a')](handleError(_0x3f137d,null));};exports[_0xb840('0x35')]=function(_0x3b015a,_0x263aaa){return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x3b015a['params']['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x263aaa,null))[_0xb840('0x20')](removeEntity(_0x263aaa,null))['catch'](handleError(_0x263aaa,null));};exports[_0xb840('0x62')]=function(_0x4bac8d,_0x5a5b4a){return db[_0xb840('0x3d')]['describe']()[_0xb840('0x20')](respondWithResult(_0x5a5b4a,null))[_0xb840('0x2a')](handleError(_0x5a5b4a,null));};exports[_0xb840('0x63')]=function(_0x312b6e,_0x43ab26,_0xde1241){if(_0x312b6e[_0xb840('0x61')]['id']){delete _0x312b6e['body']['id'];}return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x312b6e[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x43ab26,null))[_0xb840('0x20')](function(_0x19a722){if(_0x19a722){_0x312b6e[_0xb840('0x61')][_0xb840('0x64')]=_0x19a722['id'];return db['Disposition'][_0xb840('0x59')](_0x312b6e[_0xb840('0x61')]);}})[_0xb840('0x20')](respondWithResult(_0x43ab26,null))[_0xb840('0x2a')](handleError(_0x43ab26,null));};exports[_0xb840('0x65')]=function(_0x1b0662,_0x54b938,_0x2e8637){var _0x24d68e={'raw':![],'where':{}};var _0x891a2d={};var _0x45585a={'count':0x0,'rows':[]};return db[_0xb840('0x3d')]['findOne']({'where':{'id':_0x1b0662[_0xb840('0x55')]['id']}})['then'](handleEntityNotFound(_0x54b938,null))['then'](function(_0x1949cb){if(_0x1949cb){_0x891a2d[_0xb840('0x40')]=_[_0xb840('0x42')](db[_0xb840('0x66')][_0xb840('0x3e')]);_0x891a2d[_0xb840('0x41')]=_[_0xb840('0x42')](_0x1b0662['query']);_0x891a2d['filters']=_[_0xb840('0x57')](_0x891a2d['model'],_0x891a2d[_0xb840('0x41')]);_0x24d68e['attributes']=_['intersection'](_0x891a2d[_0xb840('0x40')],qs[_0xb840('0x44')](_0x1b0662[_0xb840('0x41')]['fields']));_0x24d68e[_0xb840('0x43')]=_0x24d68e['attributes'][_0xb840('0x45')]?_0x24d68e[_0xb840('0x43')]:_0x891a2d['model'];if(!_0x1b0662[_0xb840('0x41')][_0xb840('0x46')](_0xb840('0x47'))){_0x24d68e['limit']=qs['limit'](_0x1b0662[_0xb840('0x41')][_0xb840('0x31')]);_0x24d68e[_0xb840('0x2f')]=qs[_0xb840('0x2f')](_0x1b0662[_0xb840('0x41')]['offset']);}_0x24d68e[_0xb840('0x48')]=qs[_0xb840('0x49')](_0x1b0662[_0xb840('0x41')][_0xb840('0x49')]);_0x24d68e['where']=qs[_0xb840('0x4a')](_['pick'](_0x1b0662[_0xb840('0x41')],_0x891a2d[_0xb840('0x4a')]));_0x24d68e[_0xb840('0x4f')][_0xb840('0x64')]=_0x1949cb['id'];if(_0x1b0662['query'][_0xb840('0x4b')]){_0x24d68e[_0xb840('0x4f')]=_[_0xb840('0x4c')](_0x24d68e[_0xb840('0x4f')],{'$or':_['map'](_0x24d68e['attributes'],function(_0x531da5){var _0x58c6cd={};_0x58c6cd[_0x531da5]={'$like':'%'+_0x1b0662['query'][_0xb840('0x4b')]+'%'};return _0x58c6cd;})});}_0x24d68e=_[_0xb840('0x4c')]({},_0x24d68e,_0x1b0662[_0xb840('0x4e')]);return db['Disposition'][_0xb840('0x32')]({'where':_0x24d68e['where']})[_0xb840('0x20')](function(_0x49802f){_0x45585a[_0xb840('0x32')]=_0x49802f;if(_0x1b0662[_0xb840('0x41')]['includeAll']){_0x24d68e['include']=[{'all':!![]}];}return db['Disposition'][_0xb840('0x52')](_0x24d68e);})[_0xb840('0x20')](function(_0x43c2b6){_0x45585a[_0xb840('0x53')]=_0x43c2b6;return _0x45585a;});}})[_0xb840('0x20')](respondWithFilteredResult(_0x54b938,_0x24d68e))[_0xb840('0x2a')](handleError(_0x54b938,null));};exports[_0xb840('0x67')]=function(_0x34c999,_0x3d1ade,_0x38785e){return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x34c999[_0xb840('0x55')]['id']}})['then'](handleEntityNotFound(_0x3d1ade,null))[_0xb840('0x20')](function(_0x430a48){if(_0x430a48){return _0x430a48[_0xb840('0x67')](_0x34c999[_0xb840('0x41')]['ids']);}})[_0xb840('0x20')](respondWithStatusCode(_0x3d1ade,null))['catch'](handleError(_0x3d1ade,null));};exports[_0xb840('0x68')]=function(_0x48c264,_0x5c9323,_0x1ae7c5){if(_0x48c264['body']['id']){delete _0x48c264['body']['id'];}return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x48c264['params']['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x5c9323,null))[_0xb840('0x20')](function(_0x2e856d){if(_0x2e856d){_0x48c264[_0xb840('0x61')]['WhatsappAccountId']=_0x2e856d['id'];return db[_0xb840('0x69')]['create'](_0x48c264[_0xb840('0x61')]);}})[_0xb840('0x20')](respondWithResult(_0x5c9323,null))['catch'](handleError(_0x5c9323,null));};exports[_0xb840('0x6a')]=function(_0x18aec8,_0x57f55e,_0x34a3e9){var _0x4bf522={'raw':![],'where':{}};var _0xf144ef={};var _0x1e44eb={'count':0x0,'rows':[]};return db[_0xb840('0x3d')][_0xb840('0x6b')]({'where':{'id':_0x18aec8[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x57f55e,null))[_0xb840('0x20')](function(_0x4378f1){if(_0x4378f1){_0xf144ef[_0xb840('0x40')]=_[_0xb840('0x42')](db['CannedAnswer'][_0xb840('0x3e')]);_0xf144ef['query']=_[_0xb840('0x42')](_0x18aec8['query']);_0xf144ef['filters']=_[_0xb840('0x57')](_0xf144ef[_0xb840('0x40')],_0xf144ef[_0xb840('0x41')]);_0x4bf522[_0xb840('0x43')]=_['intersection'](_0xf144ef[_0xb840('0x40')],qs[_0xb840('0x44')](_0x18aec8['query'][_0xb840('0x44')]));_0x4bf522[_0xb840('0x43')]=_0x4bf522[_0xb840('0x43')]['length']?_0x4bf522[_0xb840('0x43')]:_0xf144ef['model'];if(!_0x18aec8[_0xb840('0x41')][_0xb840('0x46')](_0xb840('0x47'))){_0x4bf522[_0xb840('0x31')]=qs[_0xb840('0x31')](_0x18aec8[_0xb840('0x41')]['limit']);_0x4bf522[_0xb840('0x2f')]=qs[_0xb840('0x2f')](_0x18aec8['query'][_0xb840('0x2f')]);}_0x4bf522['order']=qs[_0xb840('0x49')](_0x18aec8[_0xb840('0x41')][_0xb840('0x49')]);_0x4bf522[_0xb840('0x4f')]=qs['filters'](_['pick'](_0x18aec8[_0xb840('0x41')],_0xf144ef[_0xb840('0x4a')]));_0x4bf522[_0xb840('0x4f')][_0xb840('0x64')]=_0x4378f1['id'];if(_0x18aec8[_0xb840('0x41')][_0xb840('0x4b')]){_0x4bf522[_0xb840('0x4f')]=_[_0xb840('0x4c')](_0x4bf522[_0xb840('0x4f')],{'$or':_[_0xb840('0x3c')](_0x4bf522[_0xb840('0x43')],function(_0x508f75){var _0x3b3a80={};_0x3b3a80[_0x508f75]={'$like':'%'+_0x18aec8[_0xb840('0x41')][_0xb840('0x4b')]+'%'};return _0x3b3a80;})});}_0x4bf522=_['merge']({},_0x4bf522,_0x18aec8[_0xb840('0x4e')]);return db[_0xb840('0x69')][_0xb840('0x32')]({'where':_0x4bf522['where']})[_0xb840('0x20')](function(_0xb23cae){_0x1e44eb['count']=_0xb23cae;if(_0x18aec8['query'][_0xb840('0x50')]){_0x4bf522[_0xb840('0x51')]=[{'all':!![]}];}return db[_0xb840('0x69')][_0xb840('0x52')](_0x4bf522);})[_0xb840('0x20')](function(_0xa8c5de){_0x1e44eb[_0xb840('0x53')]=_0xa8c5de;return _0x1e44eb;});}})[_0xb840('0x20')](respondWithFilteredResult(_0x57f55e,_0x4bf522))[_0xb840('0x2a')](handleError(_0x57f55e,null));};exports['removeAnswers']=function(_0x2321fe,_0x385e7d,_0x28c505){return db[_0xb840('0x3d')]['find']({'where':{'id':_0x2321fe[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x385e7d,null))['then'](function(_0x88a117){if(_0x88a117){return _0x88a117[_0xb840('0x6c')](_0x2321fe[_0xb840('0x41')][_0xb840('0x6d')]);}})['then'](respondWithStatusCode(_0x385e7d,null))[_0xb840('0x2a')](handleError(_0x385e7d,null));};exports[_0xb840('0x6e')]=function(_0x57178a,_0x17d4e0,_0x499ec8){return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x57178a[_0xb840('0x55')]['id']}})['then'](handleEntityNotFound(_0x17d4e0,null))[_0xb840('0x20')](function(_0x1dbd1d){if(_0x1dbd1d){return _0x1dbd1d[_0xb840('0x6e')](_0x57178a[_0xb840('0x61')][_0xb840('0x6d')],_[_0xb840('0x6f')](_0x57178a[_0xb840('0x61')],[_0xb840('0x6d'),'id'])||{})[_0xb840('0x70')](function(_0x805331){for(var _0x121b91=0x0;_0x121b91<_0x57178a['body'][_0xb840('0x6d')][_0xb840('0x45')];_0x121b91+=0x1){socket[_0xb840('0x71')](_0xb840('0x72'),{'UserId':Number(_0x57178a[_0xb840('0x61')][_0xb840('0x6d')][_0x121b91]),'WhatsappAccountId':Number(_0x57178a[_0xb840('0x55')]['id'])});}return _0x805331;});}})[_0xb840('0x20')](respondWithResult(_0x17d4e0,null))[_0xb840('0x2a')](handleError(_0x17d4e0,null));};exports[_0xb840('0x73')]=function(_0x4c9ccf,_0x5a4344,_0x3b0157){return db[_0xb840('0x3d')][_0xb840('0x58')]({'where':{'id':_0x4c9ccf[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x5a4344,null))[_0xb840('0x20')](function(_0x307b9e){if(_0x307b9e){return _0x307b9e[_0xb840('0x73')](_0x4c9ccf[_0xb840('0x41')][_0xb840('0x6d')])[_0xb840('0x20')](function(){if(_[_0xb840('0x74')](_0x4c9ccf['query'][_0xb840('0x6d')])){for(var _0x9b74ca=0x0;_0x9b74ca<_0x4c9ccf[_0xb840('0x41')][_0xb840('0x6d')]['length'];_0x9b74ca+=0x1){socket[_0xb840('0x71')]('userWhatsappAccount:remove',{'UserId':Number(_0x4c9ccf['query'][_0xb840('0x6d')][_0x9b74ca]),'WhatsappAccountId':Number(_0x4c9ccf[_0xb840('0x55')]['id'])});}}else{socket[_0xb840('0x71')](_0xb840('0x75'),{'UserId':Number(_0x4c9ccf[_0xb840('0x41')][_0xb840('0x6d')]),'WhatsappAccountId':Number(_0x4c9ccf['params']['id'])});}});}})[_0xb840('0x20')](respondWithStatusCode(_0x5a4344,null))[_0xb840('0x2a')](handleError(_0x5a4344,null));};exports['getAgents']=function(_0x1268bc,_0x3da2a3,_0x1e0873){var _0x239ce5={};var _0x56cb4c={};var _0x51dde0;var _0x1e5199;return db[_0xb840('0x3d')][_0xb840('0x6b')]({'where':{'id':_0x1268bc[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x3da2a3,null))[_0xb840('0x20')](function(_0x2ee7dd){if(_0x2ee7dd){_0x51dde0=_0x2ee7dd;_0x56cb4c[_0xb840('0x40')]=_[_0xb840('0x42')](db[_0xb840('0x76')][_0xb840('0x3e')]);_0x56cb4c[_0xb840('0x41')]=_[_0xb840('0x42')](_0x1268bc[_0xb840('0x41')]);_0x56cb4c[_0xb840('0x4a')]=_[_0xb840('0x57')](_0x56cb4c[_0xb840('0x40')],_0x56cb4c[_0xb840('0x41')]);_0x239ce5['attributes']=_[_0xb840('0x57')](_0x56cb4c[_0xb840('0x40')],qs['fields'](_0x1268bc[_0xb840('0x41')]['fields']));_0x239ce5[_0xb840('0x43')]=_0x239ce5[_0xb840('0x43')][_0xb840('0x45')]?_0x239ce5[_0xb840('0x43')]:_0x56cb4c['model'];_0x239ce5[_0xb840('0x48')]=qs[_0xb840('0x49')](_0x1268bc[_0xb840('0x41')]['sort']);_0x239ce5[_0xb840('0x4f')]=qs[_0xb840('0x4a')](_[_0xb840('0x77')](_0x1268bc['query'],_0x56cb4c[_0xb840('0x4a')]));if(_0x1268bc[_0xb840('0x41')][_0xb840('0x4b')]){_0x239ce5[_0xb840('0x4f')]=_['merge'](_0x239ce5[_0xb840('0x4f')],{'$or':_[_0xb840('0x3c')](_0x239ce5[_0xb840('0x43')],function(_0x83e6b1){var _0x284eb0={};_0x284eb0[_0x83e6b1]={'$like':'%'+_0x1268bc[_0xb840('0x41')][_0xb840('0x4b')]+'%'};return _0x284eb0;})});}_0x239ce5=_[_0xb840('0x4c')]({},_0x239ce5,_0x1268bc[_0xb840('0x4e')]);return _0x51dde0['getAgents'](_0x239ce5);}})[_0xb840('0x20')](function(_0x5398bf){if(_0x5398bf){_0x1e5199=_0x5398bf[_0xb840('0x45')];if(!_0x1268bc['query'][_0xb840('0x46')](_0xb840('0x47'))){_0x239ce5['limit']=qs[_0xb840('0x31')](_0x1268bc[_0xb840('0x41')][_0xb840('0x31')]);_0x239ce5['offset']=qs['offset'](_0x1268bc[_0xb840('0x41')][_0xb840('0x2f')]);}return _0x51dde0[_0xb840('0x78')](_0x239ce5);}})[_0xb840('0x20')](function(_0x4f3608){if(_0x4f3608){return _0x4f3608?{'count':_0x1e5199,'rows':_0x4f3608}:null;}})[_0xb840('0x20')](respondWithResult(_0x3da2a3,null))[_0xb840('0x2a')](handleError(_0x3da2a3,null));};exports[_0xb840('0x79')]=function(_0x431bcd,_0x1c6421,_0x285557){return db[_0xb840('0x3d')][_0xb840('0x6b')]({'where':{'id':_0x431bcd['params']['id']}})[_0xb840('0x20')](handleEntityNotFound(_0x1c6421,null))['then'](function(_0x5c780e){if(_0x5c780e){return db['sequelize'][_0xb840('0x7a')](function(_0x515240){return db['WhatsappApplication'][_0xb840('0x35')]({'where':{'WhatsappAccountId':_0x431bcd[_0xb840('0x55')]['id']},'transaction':_0x515240})[_0xb840('0x20')](function(_0x5f503d){var _0x1e5d40=_[_0xb840('0x3c')](_0x431bcd[_0xb840('0x61')],function(_0x48d384){_0x48d384['WhatsappAccountId']=_0x431bcd['params']['id'];return _0x48d384;});return db['WhatsappApplication'][_0xb840('0x7b')](_0x1e5d40,{'transaction':_0x515240});});})['then'](function(){return db[_0xb840('0x7c')][_0xb840('0x7d')]({'where':{'WhatsappAccountId':_0x431bcd[_0xb840('0x55')]['id']},'order':_0xb840('0x7e')});});}})[_0xb840('0x20')](respondWithResult(_0x1c6421,null))['catch'](handleError(_0x1c6421,null));};exports[_0xb840('0x7f')]=function(_0x3b4639,_0xa4c732,_0x2dacc3){var _0x4b1f89={};var _0x178eab={};var _0x753e38;var _0x5b94e9;return db[_0xb840('0x3d')][_0xb840('0x6b')]({'where':{'id':_0x3b4639[_0xb840('0x55')]['id']}})[_0xb840('0x20')](handleEntityNotFound(_0xa4c732,null))[_0xb840('0x20')](function(_0x57c933){if(_0x57c933){_0x753e38=_0x57c933;_0x178eab[_0xb840('0x40')]=_['keys'](db[_0xb840('0x7c')][_0xb840('0x3e')]);_0x178eab[_0xb840('0x41')]=_[_0xb840('0x42')](_0x3b4639[_0xb840('0x41')]);_0x178eab[_0xb840('0x4a')]=_[_0xb840('0x57')](_0x178eab[_0xb840('0x40')],_0x178eab[_0xb840('0x41')]);_0x4b1f89[_0xb840('0x43')]=_[_0xb840('0x57')](_0x178eab['model'],qs['fields'](_0x3b4639['query'][_0xb840('0x44')]));_0x4b1f89[_0xb840('0x43')]=_0x4b1f89[_0xb840('0x43')]['length']?_0x4b1f89[_0xb840('0x43')]:_0x178eab[_0xb840('0x40')];_0x4b1f89['order']=qs[_0xb840('0x49')](_0x3b4639[_0xb840('0x41')][_0xb840('0x49')]);_0x4b1f89[_0xb840('0x4f')]=qs[_0xb840('0x4a')](_['pick'](_0x3b4639[_0xb840('0x41')],_0x178eab[_0xb840('0x4a')]));if(_0x3b4639[_0xb840('0x41')][_0xb840('0x4b')]){_0x4b1f89[_0xb840('0x4f')]=_[_0xb840('0x4c')](_0x4b1f89[_0xb840('0x4f')],{'$or':_[_0xb840('0x3c')](_0x4b1f89[_0xb840('0x43')],function(_0x1c1473){var _0x1e3df5={};_0x1e3df5[_0x1c1473]={'$like':'%'+_0x3b4639[_0xb840('0x41')][_0xb840('0x4b')]+'%'};return _0x1e3df5;})});}_0x4b1f89=_[_0xb840('0x4c')]({},_0x4b1f89,_0x3b4639[_0xb840('0x4e')]);return _0x753e38['getApplications'](_0x4b1f89);}})['then'](function(_0x4a8144){if(_0x4a8144){_0x5b94e9=_0x4a8144['length'];if(!_0x3b4639['query'][_0xb840('0x46')](_0xb840('0x47'))){_0x4b1f89[_0xb840('0x31')]=qs[_0xb840('0x31')](_0x3b4639[_0xb840('0x41')]['limit']);_0x4b1f89[_0xb840('0x2f')]=qs[_0xb840('0x2f')](_0x3b4639[_0xb840('0x41')][_0xb840('0x2f')]);}return _0x753e38[_0xb840('0x7f')](_0x4b1f89);}})['then'](function(_0x57f005){if(_0x57f005){return _0x57f005?{'count':_0x5b94e9,'rows':_0x57f005}:null;}})[_0xb840('0x20')](respondWithResult(_0xa4c732,null))[_0xb840('0x2a')](handleError(_0xa4c732,null));};exports['notify']=function(_0x279f4f,_0x3333eb,_0xa32ac0){var _0x304d4a={'channel':_0xb840('0x80')};var _0x3330c7=[];var _0x1e25ca=[];var _0x4a4289={};return db['WhatsappAccount'][_0xb840('0x58')]({'where':{'id':_0x279f4f['params']['id']},'include':[{'model':db[_0xb840('0x7c')],'as':_0xb840('0x81')}]})[_0xb840('0x20')](handleEntityNotFound(_0x3333eb,null))[_0xb840('0x20')](function(_0x3a3d96){_0x304d4a[_0xb840('0x82')]=_0x3a3d96;_0x304d4a['applications']=_[_0xb840('0x83')](_0x3a3d96[_0xb840('0x81')],[_0xb840('0x7e')],[_0xb840('0x84')]);if(_0x304d4a[_0xb840('0x82')][_0xb840('0x81')]){delete _0x304d4a[_0xb840('0x82')]['Applications'];}return db[_0xb840('0x85')][_0xb840('0x62')]();})[_0xb840('0x20')](function(_0x78b726){if(!_0x78b726){throw new db[(_0xb840('0x86'))][(_0xb840('0x87'))]('no\x20available\x20attributes');}_0x3330c7=_[_0xb840('0x88')](_[_0xb840('0x42')](_0x78b726),[_0xb840('0x89'),_0xb840('0x8a')]);_0x1e25ca=_[_0xb840('0x88')](_[_0xb840('0x42')](_0x78b726),['createdAt','updatedAt','CompanyId',_0xb840('0x8b')]);_0x304d4a['body']={'mapKey':_0xb840('0x8c')};if(_0x304d4a['account'][_0xb840('0x3f')]&&_0x304d4a[_0xb840('0x82')][_0xb840('0x3f')]==='twilio'){_0x304d4a[_0xb840('0x61')][_0xb840('0x8d')]=_0x279f4f[_0xb840('0x61')][_0xb840('0x8e')][_0xb840('0x8f')](_0xb840('0x90'),'');_0x304d4a['body'][_0xb840('0x61')]=_0x279f4f[_0xb840('0x61')][_0xb840('0x91')];_0x304d4a['body'][_0xb840('0x92')]=_0x279f4f['body'][_0xb840('0x93')];}if(_0x304d4a['body']['id']){delete _0x304d4a[_0xb840('0x61')]['id'];}if(_['isNil'](_0x304d4a[_0xb840('0x61')][_0xb840('0x8d')])){throw new db[(_0xb840('0x86'))][(_0xb840('0x87'))](_0xb840('0x94'));}if(_[_0xb840('0x95')](_0x304d4a[_0xb840('0x61')][_0xb840('0x61')])||_0x304d4a['body'][_0xb840('0x61')]===''){throw new db[(_0xb840('0x86'))]['ValidationError'](_0xb840('0x96'));}if(_[_0xb840('0x95')](_0x304d4a['body'][_0xb840('0x97')])){throw new db['Sequelize'][(_0xb840('0x87'))](_0xb840('0x98')+_0x1e25ca);}if(!_[_0xb840('0x99')](_0x1e25ca,_0x304d4a['body']['mapKey'])){throw new db[(_0xb840('0x86'))][(_0xb840('0x87'))](_0xb840('0x9a')+_0x1e25ca);}_0x4a4289[_0x304d4a[_0xb840('0x61')][_0xb840('0x97')]]=_0x304d4a[_0xb840('0x61')]['from'];return db['CmList'][_0xb840('0x58')]({'where':{'id':_0x304d4a[_0xb840('0x82')][_0xb840('0x8b')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4a4289,'limit':0x1,'order':[[_0xb840('0x8a'),'DESC']]}]});})['then'](handleEntityNotFound(_0x3333eb,null))['then'](function(_0x1f26c9){if(_0x1f26c9){_0x304d4a[_0xb840('0x9b')]=_[_0xb840('0x6f')](_0x1f26c9,[_0xb840('0x9c')]);if(_0x1f26c9[_0xb840('0x9c')][_0xb840('0x45')]){return _0x1f26c9[_0xb840('0x9c')][0x0];}var _0xf54e80=_[_0xb840('0x19')](_0x304d4a[_0xb840('0x61')],{'firstName':_0x304d4a[_0xb840('0x61')]['from'],'ListId':_0x1f26c9['id']});_0xf54e80[_0x304d4a[_0xb840('0x61')][_0xb840('0x97')]]=_0x304d4a[_0xb840('0x61')][_0xb840('0x8d')];return db[_0xb840('0x85')][_0xb840('0x59')](_0xf54e80,{'fields':_0x3330c7,'raw':!![]});}})['then'](handleEntityNotFound(_0x3333eb,null))[_0xb840('0x20')](function(_0x105d97){if(_0x105d97){_0x304d4a[_0xb840('0x9d')]=_0x105d97;var _0x27c75a={'ContactId':_0x105d97['id'],'phone':_0x304d4a['body']['from'],'WhatsappAccountId':_0x279f4f['params']['id']};var _0x1e0fe1={'ContactId':_0x105d97['id'],'WhatsappAccountId':_0x279f4f[_0xb840('0x55')]['id'],'closed':![]};return db[_0xb840('0x9e')]['find']({'where':_0x1e0fe1})['then'](function(_0x4e3b3f){if(_0x4e3b3f){return[_0x4e3b3f,![]];}return db['WhatsappInteraction'][_0xb840('0x59')](_0x27c75a)[_0xb840('0x20')](function(_0x2e00a5){return[_0x2e00a5,!![]];});});}})[_0xb840('0x70')](function(_0x4f736e,_0x4da5d4){_0x304d4a[_0xb840('0x9f')]=_0x4f736e['get']({'plain':!![]});_0x304d4a[_0xb840('0x9f')][_0xb840('0xa0')]=![];if(_0x4da5d4){if(_0x304d4a[_0xb840('0x82')][_0xb840('0xa1')]){_0x304d4a[_0xb840('0xa2')]['push']({'id':0x0,'priority':_0x304d4a['applications'][_0xb840('0x45')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xb840('0xa3')});}_0x304d4a['interaction']['created']=!![];}return db[_0xb840('0xa4')][_0xb840('0x59')]({'phone':_0x304d4a[_0xb840('0x61')][_0xb840('0x8d')],'messageId':_0x304d4a[_0xb840('0x61')][_0xb840('0x92')],'body':_0x304d4a[_0xb840('0x61')][_0xb840('0x61')],'WhatsappAccountId':_0x279f4f[_0xb840('0x55')]['id'],'WhatsappInteractionId':_0x4f736e['id'],'direction':'in','ContactId':_0x4f736e['ContactId'],'AttachmentId':_0x304d4a[_0xb840('0x61')]['AttachmentId']});})[_0xb840('0x20')](function(_0x29d0bb){_0x304d4a['message']=_0x29d0bb;if(_0x304d4a[_0xb840('0x9f')][_0xb840('0xa5')]){return db[_0xb840('0x76')][_0xb840('0x58')]({'attributes':['id',_0xb840('0x39')],'where':{'id':_0x304d4a[_0xb840('0x9f')][_0xb840('0xa5')]}})['then'](function(_0x1c79b1){if(_0x1c79b1){_0x304d4a[_0xb840('0xa2')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb840('0xa6'),'appdata':_0x1c79b1[_0xb840('0x39')]+','+(_0x304d4a[_0xb840('0x82')][_0xb840('0xa7')]||0xa),'interval':_0xb840('0xa3')});}return respondWithRpcPromise(_0xb840('0xa8'),_0xb840('0xa9'),_0x304d4a);});}return respondWithRpcPromise(_0xb840('0xa8'),_0xb840('0xa9'),_0x304d4a);})['then'](function(_0x12e7c5){if(_0x12e7c5){var _0x3475ed=0xc8;var _0x4c2bd3=_0xb840('0xaa');logger[_0xb840('0x21')](_0xb840('0xab'),_0x4c2bd3,_0x3475ed,_0xb840('0xac'));logger[_0xb840('0x24')](_0xb840('0xad'),_0x4c2bd3,_0x3475ed,'entity\x20found',JSON[_0xb840('0x25')](_0x12e7c5));if(_0x304d4a[_0xb840('0x82')][_0xb840('0x3f')]===_0xb840('0xae')){return _0x3333eb['status'](_0x3475ed)['set'](_0xb840('0xaf'),_0xb840('0xb0'))[_0xb840('0xb1')](_0xb840('0xb2'));}else{return _0x3333eb[_0xb840('0x2c')](_0x3475ed)[_0xb840('0x2e')](_0x12e7c5);}}})[_0xb840('0x2a')](handleError(_0x3333eb,null));};exports[_0xb840('0xb1')]=function(_0x535821,_0x51b97f,_0x18ce49){var _0x5d1842,_0x5d38c6,_0x4e8ecb;if(_[_0xb840('0x95')](_0x535821[_0xb840('0x61')][_0xb840('0x61')])||_0x535821[_0xb840('0x61')][_0xb840('0x61')]===''){throw new db['Sequelize'][(_0xb840('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb840('0x95')](_0x535821[_0xb840('0x61')]['to'])){throw new db[(_0xb840('0x86'))]['ValidationError'](_0xb840('0xb3'));}_0x5d1842=_0x535821['body']['to'];return db[_0xb840('0x3d')]['find']({'where':{'id':_0x535821[_0xb840('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xb840('0xb4'),'include':[{'model':db[_0xb840('0x85')],'as':_0xb840('0x9c'),'where':{'mobile':_0x5d1842},'limit':0x1,'order':[[_0xb840('0x8a'),_0xb840('0xb5')]]}]}]})['then'](handleEntityNotFound(_0x51b97f,null))['then'](function(_0x14b2fd){if(_0x14b2fd&&_0x14b2fd['List']){_0x5d38c6=_0x14b2fd[_0xb840('0x5b')]({'plain':!![]});if(_0x5d38c6[_0xb840('0xb4')]&&_0x5d38c6[_0xb840('0xb4')][_0xb840('0x9c')][_0xb840('0x45')]){return _0x5d38c6[_0xb840('0xb4')][_0xb840('0x9c')][0x0];}return db['CmContact'][_0xb840('0x59')](_[_0xb840('0x19')](_0x535821[_0xb840('0x61')],{'firstName':_0x5d1842,'mobile':_0x5d1842,'phone':_0x5d1842,'ListId':_0x5d38c6[_0xb840('0x8b')]}));}})['then'](handleEntityNotFound(_0x51b97f,null))[_0xb840('0x20')](function(_0x12387d){if(_0x12387d){_0x4e8ecb=_0x12387d;return db[_0xb840('0x9e')][_0xb840('0x58')]({'where':{'ContactId':_0x4e8ecb['id'],'closed':![],'WhatsappAccountId':_0x5d38c6['id']}})[_0xb840('0x20')](function(_0x425d1e){if(_0x425d1e){return[_0x425d1e,![]];}return db[_0xb840('0x9e')][_0xb840('0x59')]({'UserId':_0x535821['user']['id'],'ContactId':_0x4e8ecb['id'],'WhatsappAccountId':_0x5d38c6['id'],'phone':_0x5d1842,'firstMsgDirection':_0xb840('0xb6'),'Messages':[_[_0xb840('0x4c')](_0x535821[_0xb840('0x61')],{'read':![],'body':_0x535821['body']['body'],'phone':_0x5d1842,'WhatsappAccountId':_0x5d38c6['id'],'UserId':_0x535821[_0xb840('0x5a')]['id'],'ContactId':_0x4e8ecb['id']})]},{'include':[{'model':db[_0xb840('0xa4')],'as':_0xb840('0xb7')}]})[_0xb840('0x20')](function(_0x2018fc){return[_0x2018fc,!![]];});});}})[_0xb840('0x70')](function(_0x54dc03,_0x5ee149){if(_0x5ee149){return _0x54dc03;}return db[_0xb840('0xa4')][_0xb840('0x59')](_[_0xb840('0x4c')](_0x535821[_0xb840('0x61')],{'read':![],'body':_0x535821[_0xb840('0x61')][_0xb840('0x61')],'phone':_0x5d1842,'WhatsappAccountId':_0x5d38c6['id'],'WhatsappInteractionId':_0x54dc03['id'],'UserId':_0x535821[_0xb840('0x5a')]['id'],'ContactId':_0x4e8ecb['id']}))[_0xb840('0x20')](function(_0x5e2bf4){_0x54dc03[_0xb840('0xb8')][_0xb840('0xb7')]=[];_0x54dc03[_0xb840('0xb8')][_0xb840('0xb7')]['push'](_0x5e2bf4[_0xb840('0xb8')]);return _0x54dc03;});})[_0xb840('0x20')](respondWithResult(_0x51b97f,null))[_0xb840('0x2a')](handleError(_0x51b97f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 7b18f2b..a3eab42 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 _0x73cc=['hasOwnProperty','hook','events','WhatsappAccount','save','update','remove','emit'];(function(_0x3f63b0,_0x169029){var _0x2379d9=function(_0x54e7e4){while(--_0x54e7e4){_0x3f63b0['push'](_0x3f63b0['shift']());}};_0x2379d9(++_0x169029);}(_0x73cc,0x1ca));var _0xc73c=function(_0x1d4cb8,_0x3df6b5){_0x1d4cb8=_0x1d4cb8-0x0;var _0x9b394c=_0x73cc[_0x1d4cb8];return _0x9b394c;};'use strict';var EventEmitter=require(_0xc73c('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xc73c('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc73c('0x2'),'afterUpdate':_0xc73c('0x3'),'afterDestroy':_0xc73c('0x4')};function emitEvent(_0x28da84){return function(_0x2dbe1c,_0x4ed1cf,_0x5c0d61){WhatsappAccountEvents[_0xc73c('0x5')](_0x28da84+':'+_0x2dbe1c['id'],_0x2dbe1c);WhatsappAccountEvents[_0xc73c('0x5')](_0x28da84,_0x2dbe1c);_0x5c0d61(null);};}for(var e in events){if(events[_0xc73c('0x6')](e)){var event=events[e];WhatsappAccount[_0xc73c('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x6c47=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners','save','update'];(function(_0x4a1b29,_0x19898f){var _0x2a5656=function(_0x3f314e){while(--_0x3f314e){_0x4a1b29['push'](_0x4a1b29['shift']());}};_0x2a5656(++_0x19898f);}(_0x6c47,0x1b3));var _0x76c4=function(_0x3bdda2,_0x444920){_0x3bdda2=_0x3bdda2-0x0;var _0x2ff7e0=_0x6c47[_0x3bdda2];return _0x2ff7e0;};'use strict';var EventEmitter=require(_0x76c4('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x76c4('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x76c4('0x2')](0x0);var events={'afterCreate':_0x76c4('0x3'),'afterUpdate':_0x76c4('0x4'),'afterDestroy':_0x76c4('0x5')};function emitEvent(_0x2dd09b){return function(_0x4af9b4,_0x445535,_0x7860cb){WhatsappAccountEvents[_0x76c4('0x6')](_0x2dd09b+':'+_0x4af9b4['id'],_0x4af9b4);WhatsappAccountEvents['emit'](_0x2dd09b,_0x4af9b4);_0x7860cb(null);};}for(var e in events){if(events[_0x76c4('0x7')](e)){var event=events[e];WhatsappAccount[_0x76c4('0x8')](e,emitEvent(event));}}module[_0x76c4('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 11d0ccd..b15c5bf 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 _0x93ae=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2707a0,_0x508ff1){var _0x164094=function(_0x25060e){while(--_0x25060e){_0x2707a0['push'](_0x2707a0['shift']());}};_0x164094(++_0x508ff1);}(_0x93ae,0x19a));var _0xe93a=function(_0x47f8b0,_0x1d56fb){_0x47f8b0=_0x47f8b0-0x0;var _0x3ca091=_0x93ae[_0x47f8b0];return _0x3ca091;};'use strict';var _=require(_0xe93a('0x0'));var util=require(_0xe93a('0x1'));var logger=require(_0xe93a('0x2'))(_0xe93a('0x3'));var moment=require(_0xe93a('0x4'));var BPromise=require(_0xe93a('0x5'));var rp=require(_0xe93a('0x6'));var fs=require('fs');var path=require(_0xe93a('0x7'));var rimraf=require(_0xe93a('0x8'));var config=require(_0xe93a('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0xe93a('0xa')]=function(_0x458cc0,_0x13acba){return _0x458cc0[_0xe93a('0xb')](_0xe93a('0xc'),attributes,{'tableName':_0xe93a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x731a=['../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ec7a0,_0x4d3534){var _0x21628c=function(_0x2ac541){while(--_0x2ac541){_0x3ec7a0['push'](_0x3ec7a0['shift']());}};_0x21628c(++_0x4d3534);}(_0x731a,0xbc));var _0xa731=function(_0x4bda95,_0x3dd9b1){_0x4bda95=_0x4bda95-0x0;var _0x2dd15f=_0x731a[_0x4bda95];return _0x2dd15f;};'use strict';var _=require(_0xa731('0x0'));var util=require(_0xa731('0x1'));var logger=require('../../config/logger')(_0xa731('0x2'));var moment=require(_0xa731('0x3'));var BPromise=require(_0xa731('0x4'));var rp=require(_0xa731('0x5'));var fs=require('fs');var path=require(_0xa731('0x6'));var rimraf=require(_0xa731('0x7'));var config=require(_0xa731('0x8'));var attributes=require(_0xa731('0x9'));module[_0xa731('0xa')]=function(_0x4a5534,_0x56213b){return _0x4a5534[_0xa731('0xb')](_0xa731('0xc'),attributes,{'tableName':_0xa731('0xd'),'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 bfea9da..df6b6b4 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 _0x081c=['redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','WhatsappAccount','find','options','include','map','attributes','model','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x081c,0xd7));var _0xc081=function(_0x12f7d1,_0xea85b3){_0x12f7d1=_0x12f7d1-0x0;var _0x17a408=_0x081c[_0x12f7d1];return _0x17a408;};'use strict';var _=require(_0xc081('0x0'));var util=require(_0xc081('0x1'));var moment=require(_0xc081('0x2'));var BPromise=require(_0xc081('0x3'));var rs=require(_0xc081('0x4'));var fs=require('fs');var Redis=require(_0xc081('0x5'));var db=require(_0xc081('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc081('0x7'))(_0xc081('0x8'));var config=require(_0xc081('0x9'));var jayson=require(_0xc081('0xa'));var client=jayson[_0xc081('0xb')][_0xc081('0xc')]({'port':0x232a});config[_0xc081('0xd')]=_[_0xc081('0xe')](config[_0xc081('0xd')],{'host':_0xc081('0xf'),'port':0x18eb});var socket=require(_0xc081('0x10'))(new Redis(config[_0xc081('0xd')]));require(_0xc081('0x11'))['register'](socket);function respondWithRpcPromise(_0x394d8a,_0x4b518f,_0x113e2e){return new BPromise(function(_0x5a163f,_0x331178){return client[_0xc081('0x12')](_0x394d8a,_0x113e2e)[_0xc081('0x13')](function(_0x5842f2){logger['info'](_0xc081('0x14'),_0x4b518f,_0xc081('0x15'));logger[_0xc081('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4b518f,_0xc081('0x15'),JSON[_0xc081('0x17')](_0x5842f2));if(_0x5842f2[_0xc081('0x18')]){if(_0x5842f2[_0xc081('0x18')][_0xc081('0x19')]===0x1f4){logger[_0xc081('0x18')](_0xc081('0x14'),_0x4b518f,_0x5842f2['error'][_0xc081('0x1a')]);return _0x331178(_0x5842f2[_0xc081('0x18')][_0xc081('0x1a')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4b518f,_0x5842f2[_0xc081('0x18')][_0xc081('0x1a')]);return _0x5a163f(_0x5842f2['error']['message']);}else{logger[_0xc081('0x1b')]('WhatsappAccount,\x20%s,\x20%s',_0x4b518f,'request\x20sent');_0x5a163f(_0x5842f2[_0xc081('0x1c')]['message']);}})[_0xc081('0x1d')](function(_0x268015){logger['error'](_0xc081('0x14'),_0x4b518f,_0x268015);_0x331178(_0x268015);});});}exports['ShowWhatsappAccount']=function(_0x1c95a1){var _0x131a0f=this;return new Promise(function(_0x496cad,_0xb14a50){return db[_0xc081('0x1e')][_0xc081('0x1f')]({'raw':_0x1c95a1[_0xc081('0x20')]?_0x1c95a1[_0xc081('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x1c95a1[_0xc081('0x20')]?_0x1c95a1[_0xc081('0x20')]['where']||null:null,'attributes':_0x1c95a1[_0xc081('0x20')]?_0x1c95a1[_0xc081('0x20')]['attributes']||null:null,'include':_0x1c95a1[_0xc081('0x20')]?_0x1c95a1[_0xc081('0x20')][_0xc081('0x21')]?_[_0xc081('0x22')](_0x1c95a1[_0xc081('0x20')]['include'],function(_0x649ee7){return{'model':db[_0x649ee7['model']],'as':_0x649ee7['as'],'attributes':_0x649ee7[_0xc081('0x23')],'include':_0x649ee7[_0xc081('0x21')]?_['map'](_0x649ee7[_0xc081('0x21')],function(_0x5688ff){return{'model':db[_0x5688ff['model']],'as':_0x5688ff['as'],'attributes':_0x5688ff[_0xc081('0x23')],'include':_0x5688ff[_0xc081('0x21')]?_[_0xc081('0x22')](_0x5688ff[_0xc081('0x21')],function(_0x2b5866){return{'model':db[_0x2b5866[_0xc081('0x24')]],'as':_0x2b5866['as'],'attributes':_0x2b5866[_0xc081('0x23')]};}):[]};}):[]};}):[]:[]})[_0xc081('0x13')](function(_0x55d712){logger[_0xc081('0x1b')](_0xc081('0x25'),_0x1c95a1);logger[_0xc081('0x16')](_0xc081('0x25'),_0x1c95a1,JSON[_0xc081('0x17')](_0x55d712));_0x496cad(_0x55d712);})[_0xc081('0x1d')](function(_0x1ad3ef){logger['error']('ShowWhatsappAccount',_0x1ad3ef[_0xc081('0x1a')],_0x1c95a1);_0xb14a50(_0x131a0f[_0xc081('0x18')](0x1f4,_0x1ad3ef['message']));});});}; \ No newline at end of file +var _0xa2a1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowWhatsappAccount','find','options','where','attributes','include','map','model','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xa2a1,0xf6));var _0x1a2a=function(_0x241c32,_0x526883){_0x241c32=_0x241c32-0x0;var _0x4c2866=_0xa2a1[_0x241c32];return _0x4c2866;};'use strict';var _=require(_0x1a2a('0x0'));var util=require('util');var moment=require(_0x1a2a('0x1'));var BPromise=require(_0x1a2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a2a('0x3'));var db=require(_0x1a2a('0x4'))['db'];var utils=require(_0x1a2a('0x5'));var logger=require(_0x1a2a('0x6'))(_0x1a2a('0x7'));var config=require(_0x1a2a('0x8'));var jayson=require(_0x1a2a('0x9'));var client=jayson[_0x1a2a('0xa')][_0x1a2a('0xb')]({'port':0x232a});config[_0x1a2a('0xc')]=_[_0x1a2a('0xd')](config[_0x1a2a('0xc')],{'host':_0x1a2a('0xe'),'port':0x18eb});var socket=require(_0x1a2a('0xf'))(new Redis(config[_0x1a2a('0xc')]));require('./whatsappAccount.socket')[_0x1a2a('0x10')](socket);function respondWithRpcPromise(_0x254835,_0x51dd3c,_0x355c6d){return new BPromise(function(_0x32a372,_0x183423){return client[_0x1a2a('0x11')](_0x254835,_0x355c6d)['then'](function(_0xf730ef){logger[_0x1a2a('0x12')](_0x1a2a('0x13'),_0x51dd3c,_0x1a2a('0x14'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'),JSON['stringify'](_0xf730ef));if(_0xf730ef[_0x1a2a('0x15')]){if(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x16')]===0x1f4){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);return _0x183423(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')]['message']);return _0x32a372(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}else{logger[_0x1a2a('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'));_0x32a372(_0xf730ef[_0x1a2a('0x18')][_0x1a2a('0x17')]);}})[_0x1a2a('0x19')](function(_0x16a0e9){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0x16a0e9);_0x183423(_0x16a0e9);});});}exports[_0x1a2a('0x1a')]=function(_0x1fb90c){var _0x968bc4=this;return new Promise(function(_0x4c5e43,_0x2ba51a){return db['WhatsappAccount'][_0x1a2a('0x1b')]({'raw':_0x1fb90c[_0x1a2a('0x1c')]?_0x1fb90c['options']['raw']===undefined?!![]:![]:!![],'where':_0x1fb90c[_0x1a2a('0x1c')]?_0x1fb90c[_0x1a2a('0x1c')][_0x1a2a('0x1d')]||null:null,'attributes':_0x1fb90c['options']?_0x1fb90c[_0x1a2a('0x1c')][_0x1a2a('0x1e')]||null:null,'include':_0x1fb90c['options']?_0x1fb90c[_0x1a2a('0x1c')][_0x1a2a('0x1f')]?_[_0x1a2a('0x20')](_0x1fb90c['options'][_0x1a2a('0x1f')],function(_0x33328b){return{'model':db[_0x33328b[_0x1a2a('0x21')]],'as':_0x33328b['as'],'attributes':_0x33328b[_0x1a2a('0x1e')],'include':_0x33328b[_0x1a2a('0x1f')]?_[_0x1a2a('0x20')](_0x33328b[_0x1a2a('0x1f')],function(_0x32a7e3){return{'model':db[_0x32a7e3[_0x1a2a('0x21')]],'as':_0x32a7e3['as'],'attributes':_0x32a7e3[_0x1a2a('0x1e')],'include':_0x32a7e3[_0x1a2a('0x1f')]?_['map'](_0x32a7e3[_0x1a2a('0x1f')],function(_0x3ee66c){return{'model':db[_0x3ee66c[_0x1a2a('0x21')]],'as':_0x3ee66c['as'],'attributes':_0x3ee66c[_0x1a2a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1719bf){logger[_0x1a2a('0x12')](_0x1a2a('0x1a'),_0x1fb90c);logger[_0x1a2a('0x22')](_0x1a2a('0x1a'),_0x1fb90c,JSON[_0x1a2a('0x23')](_0x1719bf));_0x4c5e43(_0x1719bf);})[_0x1a2a('0x19')](function(_0x62a77e){logger[_0x1a2a('0x15')](_0x1a2a('0x1a'),_0x62a77e[_0x1a2a('0x17')],_0x1fb90c);_0x2ba51a(_0x968bc4[_0x1a2a('0x15')](0x1f4,_0x62a77e[_0x1a2a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 92b710c..1374205 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 _0xe343=['register','whatsappAccount:','./whatsappAccount.events','remove','update','emit'];(function(_0x48f309,_0x2876b2){var _0xaebcca=function(_0x731cf9){while(--_0x731cf9){_0x48f309['push'](_0x48f309['shift']());}};_0xaebcca(++_0x2876b2);}(_0xe343,0x68));var _0x3e34=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0xe343[_0x377a6e];return _0x37f751;};'use strict';var WhatsappAccountEvents=require(_0x3e34('0x0'));var events=['save',_0x3e34('0x1'),_0x3e34('0x2')];function createListener(_0x117e1f,_0x3d9aa5){return function(_0x310e2b){_0x3d9aa5[_0x3e34('0x3')](_0x117e1f,_0x310e2b);};}function removeListener(_0x13137c,_0x2cf0e4){return function(){WhatsappAccountEvents['removeListener'](_0x13137c,_0x2cf0e4);};}exports[_0x3e34('0x4')]=function(_0x4ab9eb){for(var _0x43f7a4=0x0,_0x4e076f=events['length'];_0x43f7a4<_0x4e076f;_0x43f7a4++){var _0xc91cef=events[_0x43f7a4];var _0x465825=createListener(_0x3e34('0x5')+_0xc91cef,_0x4ab9eb);WhatsappAccountEvents['on'](_0xc91cef,_0x465825);}}; \ No newline at end of file +var _0x8db8=['./whatsappAccount.events','save','update','emit','removeListener','register','whatsappAccount:'];(function(_0x8a48ec,_0x5dea61){var _0x4b874f=function(_0x2fa9bb){while(--_0x2fa9bb){_0x8a48ec['push'](_0x8a48ec['shift']());}};_0x4b874f(++_0x5dea61);}(_0x8db8,0x85));var _0x88db=function(_0xa9055,_0x4891ca){_0xa9055=_0xa9055-0x0;var _0x50f47e=_0x8db8[_0xa9055];return _0x50f47e;};'use strict';var WhatsappAccountEvents=require(_0x88db('0x0'));var events=[_0x88db('0x1'),'remove',_0x88db('0x2')];function createListener(_0x2bd51b,_0xebc029){return function(_0x2bb982){_0xebc029[_0x88db('0x3')](_0x2bd51b,_0x2bb982);};}function removeListener(_0x4097ce,_0x1016d2){return function(){WhatsappAccountEvents[_0x88db('0x4')](_0x4097ce,_0x1016d2);};}exports[_0x88db('0x5')]=function(_0x2969c8){for(var _0x27d28b=0x0,_0x1db1e6=events['length'];_0x27d28b<_0x1db1e6;_0x27d28b++){var _0x284749=events[_0x27d28b];var _0x3a4d03=createListener(_0x88db('0x6')+_0x284749,_0x2969c8);WhatsappAccountEvents['on'](_0x284749,_0x3a4d03);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 6cf9137..0db8a3e 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 _0x126a=['isAuthenticated','index','post','create','put','update','/:id','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0x4577bb,_0x1ecbc6){var _0x2175b4=function(_0x2b457e){while(--_0x2b457e){_0x4577bb['push'](_0x4577bb['shift']());}};_0x2175b4(++_0x1ecbc6);}(_0x126a,0x118));var _0xa126=function(_0x1ee833,_0x123b1a){_0x1ee833=_0x1ee833-0x0;var _0xe675b8=_0x126a[_0x1ee833];return _0xe675b8;};'use strict';var multer=require(_0xa126('0x0'));var util=require('util');var path=require(_0xa126('0x1'));var timeout=require(_0xa126('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa126('0x3'));var interaction=require(_0xa126('0x4'));var config=require(_0xa126('0x5'));var controller=require(_0xa126('0x6'));router[_0xa126('0x7')]('/',auth[_0xa126('0x8')](),controller[_0xa126('0x9')]);router[_0xa126('0x7')]('/:id',auth[_0xa126('0x8')](),controller['show']);router[_0xa126('0xa')]('/',auth['isAuthenticated'](),controller[_0xa126('0xb')]);router[_0xa126('0xc')]('/:id',auth[_0xa126('0x8')](),controller[_0xa126('0xd')]);router['delete'](_0xa126('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xa126('0xf')]=router; \ No newline at end of file +var _0xef1b=['show','post','create','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id'];(function(_0x19bd88,_0x111454){var _0x2cb86d=function(_0x2c5374){while(--_0x2c5374){_0x19bd88['push'](_0x19bd88['shift']());}};_0x2cb86d(++_0x111454);}(_0xef1b,0x102));var _0xbef1=function(_0x425d83,_0x236601){_0x425d83=_0x425d83-0x0;var _0x344b8b=_0xef1b[_0x425d83];return _0x344b8b;};'use strict';var multer=require('multer');var util=require(_0xbef1('0x0'));var path=require(_0xbef1('0x1'));var timeout=require(_0xbef1('0x2'));var express=require('express');var router=express[_0xbef1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbef1('0x4'));var interaction=require(_0xbef1('0x5'));var config=require(_0xbef1('0x6'));var controller=require(_0xbef1('0x7'));router['get']('/',auth[_0xbef1('0x8')](),controller[_0xbef1('0x9')]);router[_0xbef1('0xa')](_0xbef1('0xb'),auth[_0xbef1('0x8')](),controller[_0xbef1('0xc')]);router[_0xbef1('0xd')]('/',auth['isAuthenticated'](),controller[_0xbef1('0xe')]);router['put'](_0xbef1('0xb'),auth[_0xbef1('0x8')](),controller[_0xbef1('0xf')]);router[_0xbef1('0x10')](_0xbef1('0xb'),auth['isAuthenticated'](),controller[_0xbef1('0x11')]);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 9adff48..f0d7235 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 _0x13ef=['*,*,*,*','sequelize','exports','noop','TEXT','STRING'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x13ef,0x12d));var _0xf13e=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x13ef[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0xf13e('0x0'));module[_0xf13e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf13e('0x2')},'appdata':{'type':Sequelize[_0xf13e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf13e('0x4')],'defaultValue':_0xf13e('0x5')}}; \ No newline at end of file +var _0x0ddd=['INTEGER','noop','STRING','sequelize','exports'];(function(_0x4fab09,_0x2e343b){var _0xf457df=function(_0x72447b){while(--_0x72447b){_0x4fab09['push'](_0x4fab09['shift']());}};_0xf457df(++_0x2e343b);}(_0x0ddd,0x1d4));var _0xd0dd=function(_0x26ad99,_0x18389e){_0x26ad99=_0x26ad99-0x0;var _0xc82094=_0x0ddd[_0x26ad99];return _0xc82094;};'use strict';var Sequelize=require(_0xd0dd('0x0'));module[_0xd0dd('0x1')]={'priority':{'type':Sequelize[_0xd0dd('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0dd('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd0dd('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 68548ec..53c0392 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 _0xeb3b=['offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','WhatsappApplication','rawAttributes','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count'];(function(_0x267c74,_0x4955d2){var _0xda114e=function(_0x22470b){while(--_0x22470b){_0x267c74['push'](_0x267c74['shift']());}};_0xda114e(++_0x4955d2);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xeb3b[_0x2ff762];return _0x158b02;};'use strict';var emlformat=require(_0xbeb3('0x0'));var rimraf=require(_0xbeb3('0x1'));var zipdir=require(_0xbeb3('0x2'));var jsonpatch=require(_0xbeb3('0x3'));var rp=require(_0xbeb3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbeb3('0x5'));var util=require('util');var path=require(_0xbeb3('0x6'));var sox=require('sox');var csv=require(_0xbeb3('0x7'));var ejs=require(_0xbeb3('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb3('0x9'));var _=require(_0xbeb3('0xa'));var squel=require(_0xbeb3('0xb'));var crypto=require(_0xbeb3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbeb3('0xd'));var toCsv=require(_0xbeb3('0x7'));var querystring=require(_0xbeb3('0xe'));var Papa=require(_0xbeb3('0xf'));var Redis=require(_0xbeb3('0x10'));var authService=require(_0xbeb3('0x11'));var qs=require(_0xbeb3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbeb3('0x13'));var logger=require(_0xbeb3('0x14'))('api');var utils=require(_0xbeb3('0x15'));var config=require(_0xbeb3('0x16'));var licenseUtil=require(_0xbeb3('0x17'));var db=require(_0xbeb3('0x18'))['db'];function respondWithStatusCode(_0x19868e,_0x313296){_0x313296=_0x313296||0xcc;return function(_0x5b9ace){if(_0x5b9ace){return _0x19868e['sendStatus'](_0x313296);}return _0x19868e[_0xbeb3('0x19')](_0x313296)[_0xbeb3('0x1a')]();};}function respondWithResult(_0x5f521b,_0x4dfb28){_0x4dfb28=_0x4dfb28||0xc8;return function(_0xed9879){if(_0xed9879){return _0x5f521b[_0xbeb3('0x19')](_0x4dfb28)[_0xbeb3('0x1b')](_0xed9879);}};}function respondWithFilteredResult(_0x43d58a,_0x26daf2){return function(_0x535836){if(_0x535836){var _0x1aeaee=typeof _0x26daf2['offset']===_0xbeb3('0x1c')&&typeof _0x26daf2['limit']==='undefined';var _0x4f8481=_0x535836[_0xbeb3('0x1d')];var _0x44a4bb=_0x1aeaee?0x0:_0x26daf2[_0xbeb3('0x1e')];var _0x10b15d=_0x1aeaee?_0x535836['count']:_0x26daf2[_0xbeb3('0x1e')]+_0x26daf2[_0xbeb3('0x1f')];var _0xe2cc47;if(_0x10b15d>=_0x4f8481){_0x10b15d=_0x4f8481;_0xe2cc47=0xc8;}else{_0xe2cc47=0xce;}_0x43d58a['status'](_0xe2cc47);return _0x43d58a['set'](_0xbeb3('0x20'),_0x44a4bb+'-'+_0x10b15d+'/'+_0x4f8481)['json'](_0x535836);}return null;};}function patchUpdates(_0x1d917b){return function(_0x50b005){try{jsonpatch['apply'](_0x50b005,_0x1d917b,!![]);}catch(_0xfa2736){return BPromise[_0xbeb3('0x21')](_0xfa2736);}return _0x50b005[_0xbeb3('0x22')]();};}function saveUpdates(_0x4bd89e,_0x301899){return function(_0x18ea0f){if(_0x18ea0f){return _0x18ea0f['update'](_0x4bd89e)[_0xbeb3('0x23')](function(_0x366bdb){return _0x366bdb;});}return null;};}function removeEntity(_0x55a59d,_0xfc384a){return function(_0x278fe4){if(_0x278fe4){return _0x278fe4[_0xbeb3('0x24')]()[_0xbeb3('0x23')](function(){_0x55a59d[_0xbeb3('0x19')](0xcc)[_0xbeb3('0x1a')]();});}};}function handleEntityNotFound(_0x84921a,_0x340581){return function(_0x46fe17){if(!_0x46fe17){_0x84921a['sendStatus'](0x194);}return _0x46fe17;};}function handleError(_0x4e695e,_0x1f36b9){_0x1f36b9=_0x1f36b9||0x1f4;return function(_0x520116){logger[_0xbeb3('0x25')](_0x520116[_0xbeb3('0x26')]);if(_0x520116[_0xbeb3('0x27')]){delete _0x520116[_0xbeb3('0x27')];}_0x4e695e['status'](_0x1f36b9)[_0xbeb3('0x28')](_0x520116);};}exports['index']=function(_0x26cd8f,_0xab301c){var _0x5bd93d={},_0x483198={},_0x9b8f13={'count':0x0,'rows':[]};var _0x585c6f=_['map'](db['WhatsappApplication']['rawAttributes'],function(_0xf5dbaf){return{'name':_0xf5dbaf['fieldName'],'type':_0xf5dbaf[_0xbeb3('0x29')][_0xbeb3('0x2a')]};});_0x483198[_0xbeb3('0x2b')]=_[_0xbeb3('0x2c')](_0x585c6f,_0xbeb3('0x27'));_0x483198[_0xbeb3('0x2d')]=_[_0xbeb3('0x2e')](_0x26cd8f[_0xbeb3('0x2d')]);_0x483198[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x483198['model'],_0x483198[_0xbeb3('0x2d')]);_0x5bd93d[_0xbeb3('0x31')]=_['intersection'](_0x483198[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0x5bd93d['attributes']=_0x5bd93d[_0xbeb3('0x31')][_0xbeb3('0x33')]?_0x5bd93d[_0xbeb3('0x31')]:_0x483198[_0xbeb3('0x2b')];if(!_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x34')](_0xbeb3('0x35'))){_0x5bd93d[_0xbeb3('0x1f')]=qs[_0xbeb3('0x1f')](_0x26cd8f['query'][_0xbeb3('0x1f')]);_0x5bd93d['offset']=qs[_0xbeb3('0x1e')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x1e')]);}_0x5bd93d[_0xbeb3('0x36')]=qs[_0xbeb3('0x37')](_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x37')]);_0x5bd93d[_0xbeb3('0x38')]=qs['filters'](_[_0xbeb3('0x39')](_0x26cd8f['query'],_0x483198['filters']),_0x585c6f);if(_0x26cd8f['query'][_0xbeb3('0x3a')]){_0x5bd93d[_0xbeb3('0x38')]=_[_0xbeb3('0x3b')](_0x5bd93d[_0xbeb3('0x38')],{'$or':_[_0xbeb3('0x2c')](_0x585c6f,function(_0x40f166){if(_0x40f166['type']!==_0xbeb3('0x3c')){var _0x40de8d={};_0x40de8d[_0x40f166[_0xbeb3('0x27')]]={'$like':'%'+_0x26cd8f['query']['filter']+'%'};return _0x40de8d;}})});}_0x5bd93d=_['merge']({},_0x5bd93d,_0x26cd8f[_0xbeb3('0x3d')]);var _0x2a8860={'where':_0x5bd93d[_0xbeb3('0x38')]};return db['WhatsappApplication'][_0xbeb3('0x1d')](_0x2a8860)['then'](function(_0x1b6700){_0x9b8f13[_0xbeb3('0x1d')]=_0x1b6700;if(_0x26cd8f[_0xbeb3('0x2d')][_0xbeb3('0x3e')]){_0x5bd93d['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xbeb3('0x3f')](_0x5bd93d);})[_0xbeb3('0x23')](function(_0x3d4262){_0x9b8f13[_0xbeb3('0x40')]=_0x3d4262;return _0x9b8f13;})[_0xbeb3('0x23')](respondWithFilteredResult(_0xab301c,_0x5bd93d))[_0xbeb3('0x41')](handleError(_0xab301c,null));};exports[_0xbeb3('0x42')]=function(_0x4606a6,_0x5758c6){var _0xfcb57f={'raw':!![],'where':{'id':_0x4606a6[_0xbeb3('0x43')]['id']}},_0x39f2d2={};_0x39f2d2[_0xbeb3('0x2b')]=_[_0xbeb3('0x2e')](db[_0xbeb3('0x44')][_0xbeb3('0x45')]);_0x39f2d2['query']=_[_0xbeb3('0x2e')](_0x4606a6[_0xbeb3('0x2d')]);_0x39f2d2[_0xbeb3('0x2f')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],_0x39f2d2[_0xbeb3('0x2d')]);_0xfcb57f[_0xbeb3('0x31')]=_[_0xbeb3('0x30')](_0x39f2d2[_0xbeb3('0x2b')],qs[_0xbeb3('0x32')](_0x4606a6[_0xbeb3('0x2d')][_0xbeb3('0x32')]));_0xfcb57f[_0xbeb3('0x31')]=_0xfcb57f['attributes'][_0xbeb3('0x33')]?_0xfcb57f[_0xbeb3('0x31')]:_0x39f2d2[_0xbeb3('0x2b')];if(_0x4606a6['query']['includeAll']){_0xfcb57f[_0xbeb3('0x46')]=[{'all':!![]}];}_0xfcb57f=_[_0xbeb3('0x3b')]({},_0xfcb57f,_0x4606a6[_0xbeb3('0x3d')]);return db[_0xbeb3('0x44')]['find'](_0xfcb57f)[_0xbeb3('0x23')](handleEntityNotFound(_0x5758c6,null))['then'](respondWithResult(_0x5758c6,null))['catch'](handleError(_0x5758c6,null));};exports[_0xbeb3('0x47')]=function(_0x393e60,_0x1ff297){return db[_0xbeb3('0x44')]['create'](_0x393e60[_0xbeb3('0x48')],{})[_0xbeb3('0x23')](respondWithResult(_0x1ff297,0xc9))[_0xbeb3('0x41')](handleError(_0x1ff297,null));};exports['update']=function(_0x3f93ab,_0x58c49f){if(_0x3f93ab['body']['id']){delete _0x3f93ab[_0xbeb3('0x48')]['id'];}return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x3f93ab['params']['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x58c49f,null))[_0xbeb3('0x23')](saveUpdates(_0x3f93ab[_0xbeb3('0x48')],null))['then'](respondWithResult(_0x58c49f,null))[_0xbeb3('0x41')](handleError(_0x58c49f,null));};exports['destroy']=function(_0x39605b,_0x4d8e21){return db[_0xbeb3('0x44')][_0xbeb3('0x49')]({'where':{'id':_0x39605b[_0xbeb3('0x43')]['id']}})[_0xbeb3('0x23')](handleEntityNotFound(_0x4d8e21,null))[_0xbeb3('0x23')](removeEntity(_0x4d8e21,null))[_0xbeb3('0x41')](handleError(_0x4d8e21,null));}; \ No newline at end of file +var _0x6ac2=['nolimit','order','sort','where','pick','VIRTUAL','filter','include','findAll','catch','show','params','includeAll','merge','options','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','then','error','stack','name','map','WhatsappApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6ac2,0x184));var _0x26ac=function(_0x2d9592,_0x578e59){_0x2d9592=_0x2d9592-0x0;var _0x4b5a91=_0x6ac2[_0x2d9592];return _0x4b5a91;};'use strict';var emlformat=require(_0x26ac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26ac('0x1'));var jsonpatch=require(_0x26ac('0x2'));var rp=require(_0x26ac('0x3'));var moment=require(_0x26ac('0x4'));var BPromise=require(_0x26ac('0x5'));var Mustache=require(_0x26ac('0x6'));var util=require('util');var path=require(_0x26ac('0x7'));var sox=require('sox');var csv=require(_0x26ac('0x8'));var ejs=require(_0x26ac('0x9'));var fs=require('fs');var fs_extra=require(_0x26ac('0xa'));var _=require(_0x26ac('0xb'));var squel=require(_0x26ac('0xc'));var crypto=require(_0x26ac('0xd'));var jsforce=require(_0x26ac('0xe'));var deskjs=require(_0x26ac('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x26ac('0x10'));var Redis=require(_0x26ac('0x11'));var authService=require(_0x26ac('0x12'));var qs=require(_0x26ac('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26ac('0x14'));var logger=require(_0x26ac('0x15'))(_0x26ac('0x16'));var utils=require(_0x26ac('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ac('0x18'))['db'];function respondWithStatusCode(_0x46cda7,_0x1ebacc){_0x1ebacc=_0x1ebacc||0xcc;return function(_0x2790e6){if(_0x2790e6){return _0x46cda7[_0x26ac('0x19')](_0x1ebacc);}return _0x46cda7[_0x26ac('0x1a')](_0x1ebacc)[_0x26ac('0x1b')]();};}function respondWithResult(_0x518cf8,_0x2f68ad){_0x2f68ad=_0x2f68ad||0xc8;return function(_0x3ec6e6){if(_0x3ec6e6){return _0x518cf8[_0x26ac('0x1a')](_0x2f68ad)[_0x26ac('0x1c')](_0x3ec6e6);}};}function respondWithFilteredResult(_0x506239,_0x1febf6){return function(_0x1ae5aa){if(_0x1ae5aa){var _0x4b2d19=typeof _0x1febf6[_0x26ac('0x1d')]===_0x26ac('0x1e')&&typeof _0x1febf6[_0x26ac('0x1f')]===_0x26ac('0x1e');var _0x5642b7=_0x1ae5aa[_0x26ac('0x20')];var _0xb03bbc=_0x4b2d19?0x0:_0x1febf6['offset'];var _0x539eda=_0x4b2d19?_0x1ae5aa[_0x26ac('0x20')]:_0x1febf6[_0x26ac('0x1d')]+_0x1febf6['limit'];var _0x754fce;if(_0x539eda>=_0x5642b7){_0x539eda=_0x5642b7;_0x754fce=0xc8;}else{_0x754fce=0xce;}_0x506239['status'](_0x754fce);return _0x506239['set']('Content-Range',_0xb03bbc+'-'+_0x539eda+'/'+_0x5642b7)[_0x26ac('0x1c')](_0x1ae5aa);}return null;};}function patchUpdates(_0x58ee68){return function(_0x1901b6){try{jsonpatch[_0x26ac('0x21')](_0x1901b6,_0x58ee68,!![]);}catch(_0x3c75c1){return BPromise[_0x26ac('0x22')](_0x3c75c1);}return _0x1901b6[_0x26ac('0x23')]();};}function saveUpdates(_0x28b32a,_0x21b6ab){return function(_0x147721){if(_0x147721){return _0x147721[_0x26ac('0x24')](_0x28b32a)['then'](function(_0x43bce8){return _0x43bce8;});}return null;};}function removeEntity(_0x18b83c,_0x2b8299){return function(_0x1885f7){if(_0x1885f7){return _0x1885f7[_0x26ac('0x25')]()[_0x26ac('0x26')](function(){_0x18b83c[_0x26ac('0x1a')](0xcc)[_0x26ac('0x1b')]();});}};}function handleEntityNotFound(_0x4172c2,_0x2a5ceb){return function(_0x4f752c){if(!_0x4f752c){_0x4172c2['sendStatus'](0x194);}return _0x4f752c;};}function handleError(_0x222e9d,_0x57ebd1){_0x57ebd1=_0x57ebd1||0x1f4;return function(_0x185296){logger[_0x26ac('0x27')](_0x185296[_0x26ac('0x28')]);if(_0x185296[_0x26ac('0x29')]){delete _0x185296[_0x26ac('0x29')];}_0x222e9d[_0x26ac('0x1a')](_0x57ebd1)['send'](_0x185296);};}exports['index']=function(_0x15bad7,_0x3e2c4d){var _0x398136={},_0x4d873e={},_0x4e1846={'count':0x0,'rows':[]};var _0x1812d5=_[_0x26ac('0x2a')](db[_0x26ac('0x2b')][_0x26ac('0x2c')],function(_0x47b7c8){return{'name':_0x47b7c8['fieldName'],'type':_0x47b7c8[_0x26ac('0x2d')][_0x26ac('0x2e')]};});_0x4d873e[_0x26ac('0x2f')]=_[_0x26ac('0x2a')](_0x1812d5,_0x26ac('0x29'));_0x4d873e[_0x26ac('0x30')]=_[_0x26ac('0x31')](_0x15bad7[_0x26ac('0x30')]);_0x4d873e[_0x26ac('0x32')]=_[_0x26ac('0x33')](_0x4d873e['model'],_0x4d873e[_0x26ac('0x30')]);_0x398136[_0x26ac('0x34')]=_['intersection'](_0x4d873e[_0x26ac('0x2f')],qs[_0x26ac('0x35')](_0x15bad7[_0x26ac('0x30')][_0x26ac('0x35')]));_0x398136[_0x26ac('0x34')]=_0x398136[_0x26ac('0x34')][_0x26ac('0x36')]?_0x398136[_0x26ac('0x34')]:_0x4d873e[_0x26ac('0x2f')];if(!_0x15bad7[_0x26ac('0x30')][_0x26ac('0x37')](_0x26ac('0x38'))){_0x398136['limit']=qs[_0x26ac('0x1f')](_0x15bad7[_0x26ac('0x30')][_0x26ac('0x1f')]);_0x398136['offset']=qs[_0x26ac('0x1d')](_0x15bad7['query'][_0x26ac('0x1d')]);}_0x398136[_0x26ac('0x39')]=qs['sort'](_0x15bad7[_0x26ac('0x30')][_0x26ac('0x3a')]);_0x398136[_0x26ac('0x3b')]=qs[_0x26ac('0x32')](_[_0x26ac('0x3c')](_0x15bad7[_0x26ac('0x30')],_0x4d873e['filters']),_0x1812d5);if(_0x15bad7[_0x26ac('0x30')]['filter']){_0x398136[_0x26ac('0x3b')]=_['merge'](_0x398136[_0x26ac('0x3b')],{'$or':_['map'](_0x1812d5,function(_0x56d72e){if(_0x56d72e[_0x26ac('0x2d')]!==_0x26ac('0x3d')){var _0x22647e={};_0x22647e[_0x56d72e[_0x26ac('0x29')]]={'$like':'%'+_0x15bad7[_0x26ac('0x30')][_0x26ac('0x3e')]+'%'};return _0x22647e;}})});}_0x398136=_['merge']({},_0x398136,_0x15bad7['options']);var _0x45abaa={'where':_0x398136[_0x26ac('0x3b')]};return db[_0x26ac('0x2b')]['count'](_0x45abaa)['then'](function(_0x561ea){_0x4e1846[_0x26ac('0x20')]=_0x561ea;if(_0x15bad7['query']['includeAll']){_0x398136[_0x26ac('0x3f')]=[{'all':!![]}];}return db[_0x26ac('0x2b')][_0x26ac('0x40')](_0x398136);})['then'](function(_0x485258){_0x4e1846['rows']=_0x485258;return _0x4e1846;})['then'](respondWithFilteredResult(_0x3e2c4d,_0x398136))[_0x26ac('0x41')](handleError(_0x3e2c4d,null));};exports[_0x26ac('0x42')]=function(_0x3ff319,_0x1fa9aa){var _0x7aa802={'raw':!![],'where':{'id':_0x3ff319[_0x26ac('0x43')]['id']}},_0x13b2af={};_0x13b2af[_0x26ac('0x2f')]=_[_0x26ac('0x31')](db['WhatsappApplication'][_0x26ac('0x2c')]);_0x13b2af[_0x26ac('0x30')]=_[_0x26ac('0x31')](_0x3ff319[_0x26ac('0x30')]);_0x13b2af[_0x26ac('0x32')]=_[_0x26ac('0x33')](_0x13b2af[_0x26ac('0x2f')],_0x13b2af[_0x26ac('0x30')]);_0x7aa802[_0x26ac('0x34')]=_[_0x26ac('0x33')](_0x13b2af[_0x26ac('0x2f')],qs[_0x26ac('0x35')](_0x3ff319[_0x26ac('0x30')][_0x26ac('0x35')]));_0x7aa802['attributes']=_0x7aa802[_0x26ac('0x34')][_0x26ac('0x36')]?_0x7aa802[_0x26ac('0x34')]:_0x13b2af['model'];if(_0x3ff319[_0x26ac('0x30')][_0x26ac('0x44')]){_0x7aa802[_0x26ac('0x3f')]=[{'all':!![]}];}_0x7aa802=_[_0x26ac('0x45')]({},_0x7aa802,_0x3ff319[_0x26ac('0x46')]);return db[_0x26ac('0x2b')]['find'](_0x7aa802)['then'](handleEntityNotFound(_0x1fa9aa,null))[_0x26ac('0x26')](respondWithResult(_0x1fa9aa,null))[_0x26ac('0x41')](handleError(_0x1fa9aa,null));};exports[_0x26ac('0x47')]=function(_0x37e929,_0x23a7db){return db[_0x26ac('0x2b')][_0x26ac('0x47')](_0x37e929[_0x26ac('0x48')],{})[_0x26ac('0x26')](respondWithResult(_0x23a7db,0xc9))[_0x26ac('0x41')](handleError(_0x23a7db,null));};exports['update']=function(_0x547ff1,_0x324a5f){if(_0x547ff1[_0x26ac('0x48')]['id']){delete _0x547ff1[_0x26ac('0x48')]['id'];}return db['WhatsappApplication'][_0x26ac('0x49')]({'where':{'id':_0x547ff1[_0x26ac('0x43')]['id']}})[_0x26ac('0x26')](handleEntityNotFound(_0x324a5f,null))[_0x26ac('0x26')](saveUpdates(_0x547ff1[_0x26ac('0x48')],null))[_0x26ac('0x26')](respondWithResult(_0x324a5f,null))[_0x26ac('0x41')](handleError(_0x324a5f,null));};exports[_0x26ac('0x25')]=function(_0x1307b0,_0x1f795b){return db[_0x26ac('0x2b')][_0x26ac('0x49')]({'where':{'id':_0x1307b0[_0x26ac('0x43')]['id']}})[_0x26ac('0x26')](handleEntityNotFound(_0x1f795b,null))['then'](removeEntity(_0x1f795b,null))['catch'](handleError(_0x1f795b,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7ff7d35..d8d5bef 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 _0x24ca=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x12a62c,_0xc9c41a){var _0x268a58=function(_0x100ca9){while(--_0x100ca9){_0x12a62c['push'](_0x12a62c['shift']());}};_0x268a58(++_0xc9c41a);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x24ca[_0x4e0a03];return _0x2478fc;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa24c('0xd')});}; \ No newline at end of file +var _0xcea5=['api','moment','request-promise','path','rimraf','../../config/environment','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x38b8c6,_0x541f91){var _0x3104d6=function(_0x4215ee){while(--_0x4215ee){_0x38b8c6['push'](_0x38b8c6['shift']());}};_0x3104d6(++_0x541f91);}(_0xcea5,0xed));var _0x5cea=function(_0x9c9f1c,_0x326a86){_0x9c9f1c=_0x9c9f1c-0x0;var _0x7e30d2=_0xcea5[_0x9c9f1c];return _0x7e30d2;};'use strict';var _=require(_0x5cea('0x0'));var util=require(_0x5cea('0x1'));var logger=require(_0x5cea('0x2'))(_0x5cea('0x3'));var moment=require(_0x5cea('0x4'));var BPromise=require('bluebird');var rp=require(_0x5cea('0x5'));var fs=require('fs');var path=require(_0x5cea('0x6'));var rimraf=require(_0x5cea('0x7'));var config=require(_0x5cea('0x8'));var attributes=require('./whatsappApplication.attributes');module[_0x5cea('0x9')]=function(_0x31e6f3,_0x599bc5){return _0x31e6f3['define']('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cea('0xa'),'collate':_0x5cea('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index b1e58fa..39bc46d 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 _0xed1f=['request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1019d6,_0x3a9526){var _0x16ddef=function(_0x4f5ee1){while(--_0x4f5ee1){_0x1019d6['push'](_0x1019d6['shift']());}};_0x16ddef(++_0x3a9526);}(_0xed1f,0x6a));var _0xfed1=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0xed1f[_0x176329];return _0x31997c;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('WhatsappApplication,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('WhatsappApplication,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('WhatsappApplication,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xefdb44,_0x32edc8){var _0x269f25=function(_0x502548){while(--_0x502548){_0xefdb44['push'](_0xefdb44['shift']());}};_0x269f25(++_0x32edc8);}(_0x6aa7,0x178));var _0x76aa=function(_0x5a851b,_0x14fe70){_0x5a851b=_0x5a851b-0x0;var _0x2228aa=_0x6aa7[_0x5a851b];return _0x2228aa;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 0d8ded0..2f2ac47 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 _0xce68=['Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','multer','path','connect-timeout','express'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xce68,0x10c));var _0x8ce6=function(_0xc8fe46,_0x5d5809){_0xc8fe46=_0xc8fe46-0x0;var _0x8f7597=_0xce68[_0xc8fe46];return _0x8f7597;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require('util');var path=require(_0x8ce6('0x1'));var timeout=require(_0x8ce6('0x2'));var express=require(_0x8ce6('0x3'));var router=express[_0x8ce6('0x4')]();var fs_extra=require(_0x8ce6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ce6('0x6'));var config=require(_0x8ce6('0x7'));var controller=require(_0x8ce6('0x8'));router['get']('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xa')]);router['get']('/describe',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0xb')]);router[_0x8ce6('0xc')](_0x8ce6('0xd'),auth['isAuthenticated'](),controller[_0x8ce6('0xe')]);router[_0x8ce6('0xc')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x10')]);router[_0x8ce6('0xc')](_0x8ce6('0x11'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x12')]);router[_0x8ce6('0x13')]('/',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x14')]);router[_0x8ce6('0x13')](_0x8ce6('0xf'),auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x15')]);router[_0x8ce6('0x13')](_0x8ce6('0x16'),auth['isAuthenticated'](),interaction[_0x8ce6('0x17')]('whatsapp',_0x8ce6('0x18')),controller[_0x8ce6('0x19')]);router[_0x8ce6('0x1a')](_0x8ce6('0xd'),auth[_0x8ce6('0x9')](),interaction[_0x8ce6('0x17')](_0x8ce6('0x1b'),_0x8ce6('0x1c')),controller[_0x8ce6('0x1d')]);router[_0x8ce6('0x1e')]('/:id',auth[_0x8ce6('0x9')](),interaction['tracked'](_0x8ce6('0x1b'),_0x8ce6('0x1f')),controller[_0x8ce6('0x20')]);router['delete']('/:id/tags',auth[_0x8ce6('0x9')](),controller[_0x8ce6('0x21')]);module['exports']=router; \ No newline at end of file +var _0xabce=['show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','whatsappinteraction:addtags','addTags','put','tracked','update','/:id','whatsapp','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe'];(function(_0x383f33,_0x290ffa){var _0x357573=function(_0xe4c4d6){while(--_0xe4c4d6){_0x383f33['push'](_0x383f33['shift']());}};_0x357573(++_0x290ffa);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x10')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x10')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller['addMessage']);router[_0xeabc('0x10')](_0xeabc('0x12'),auth[_0xeabc('0x8')](),interaction['tracked']('whatsapp',_0xeabc('0x13')),controller[_0xeabc('0x14')]);router[_0xeabc('0x15')]('/:id',auth[_0xeabc('0x8')](),interaction[_0xeabc('0x16')]('whatsapp','whatsappinteraction:update'),controller[_0xeabc('0x17')]);router['delete'](_0xeabc('0x18'),auth[_0xeabc('0x8')](),interaction[_0xeabc('0x16')](_0xeabc('0x19'),_0xeabc('0x1a')),controller[_0xeabc('0x1b')]);router[_0xeabc('0x1c')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 97e3bb6..ccc93a0 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 _0xf987=['STRING','DATE','ENUM','out','exports','BOOLEAN'];(function(_0x441e17,_0x340ea9){var _0x3c9eb4=function(_0x3b941f){while(--_0x3b941f){_0x441e17['push'](_0x441e17['shift']());}};_0x3c9eb4(++_0x340ea9);}(_0xf987,0x18a));var _0x7f98=function(_0x4f3d9d,_0x564ff3){_0x4f3d9d=_0x4f3d9d-0x0;var _0x92659=_0xf987[_0x4f3d9d];return _0x92659;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x7f98('0x0')]={'closed':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7f98('0x2')]},'secondDisposition':{'type':Sequelize[_0x7f98('0x2')]},'thirdDisposition':{'type':Sequelize[_0x7f98('0x2')]},'note':{'type':Sequelize[_0x7f98('0x2')]},'phone':{'type':Sequelize[_0x7f98('0x2')]},'read1stAt':{'type':Sequelize[_0x7f98('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7f98('0x4')]('in',_0x7f98('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7f98('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7f98('0x4')]('in',_0x7f98('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7f98('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x3eea=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x4d81fb,_0xad8553){var _0x3b2336=function(_0x1556f7){while(--_0x1556f7){_0x4d81fb['push'](_0x4d81fb['shift']());}};_0x3b2336(++_0xad8553);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x2f4eae,_0x4e72c1){_0x2f4eae=_0x2f4eae-0x0;var _0xdbd32c=_0x3eea[_0x2f4eae];return _0xdbd32c;};'use strict';var Sequelize=require(_0xa3ee('0x0'));var moment=require('moment');module[_0xa3ee('0x1')]={'closed':{'type':Sequelize[_0xa3ee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa3ee('0x3')]},'disposition':{'type':Sequelize[_0xa3ee('0x4')]},'secondDisposition':{'type':Sequelize[_0xa3ee('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa3ee('0x4')]},'note':{'type':Sequelize[_0xa3ee('0x4')]},'phone':{'type':Sequelize[_0xa3ee('0x4')]},'read1stAt':{'type':Sequelize[_0xa3ee('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa3ee('0x5')]('in',_0xa3ee('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa3ee('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index d013a96..f1940cd 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 _0x87f8=['compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','WhatsappInteraction','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','push','all','rows','show','params','includeAll','include','options','create','describe','addMessage','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','ids','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','mkdirSync','Whatsapp','Owner','N.A.','basename','existsSync','createReadStream','pipe','createWriteStream','out','Contact','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','map','fullname','Tags','TagIds','split','forEach','catch','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','$substring','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','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','start','body','type'];(function(_0x147337,_0x1023e2){var _0x3e0122=function(_0x286352){while(--_0x286352){_0x147337['push'](_0x147337['shift']());}};_0x3e0122(++_0x1023e2);}(_0x87f8,0x152));var _0x887f=function(_0x38f37d,_0x551034){_0x38f37d=_0x38f37d-0x0;var _0x17b67e=_0x87f8[_0x38f37d];return _0x17b67e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x887f('0x0'));var rp=require(_0x887f('0x1'));var moment=require('moment');var BPromise=require(_0x887f('0x2'));var Mustache=require('mustache');var util=require(_0x887f('0x3'));var path=require(_0x887f('0x4'));var sox=require(_0x887f('0x5'));var csv=require(_0x887f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x887f('0x7'));var _=require(_0x887f('0x8'));var squel=require(_0x887f('0x9'));var crypto=require(_0x887f('0xa'));var jsforce=require(_0x887f('0xb'));var deskjs=require(_0x887f('0xc'));var toCsv=require(_0x887f('0x6'));var querystring=require('querystring');var Papa=require(_0x887f('0xd'));var Redis=require('ioredis');var authService=require(_0x887f('0xe'));var qs=require(_0x887f('0xf'));var as=require(_0x887f('0x10'));var pdf=require(_0x887f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x887f('0x12'))(_0x887f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x887f('0x14'));var db=require(_0x887f('0x15'))['db'];config[_0x887f('0x16')]=_['defaults'](config[_0x887f('0x16')],{'host':_0x887f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x887f('0x16')]));require(_0x887f('0x18'))['register'](socket);function respondWithStatusCode(_0xabcefd,_0x46920e){_0x46920e=_0x46920e||0xcc;return function(_0x59ed6c){if(_0x59ed6c){return _0xabcefd[_0x887f('0x19')](_0x46920e);}return _0xabcefd[_0x887f('0x1a')](_0x46920e)[_0x887f('0x1b')]();};}function respondWithResult(_0x486b46,_0x2dd514){_0x2dd514=_0x2dd514||0xc8;return function(_0x2f3d36){if(_0x2f3d36){return _0x486b46['status'](_0x2dd514)[_0x887f('0x1c')](_0x2f3d36);}};}function respondWithFilteredResult(_0x618c59,_0x3ab397){return function(_0x3d3b0c){if(_0x3d3b0c){var _0x2399a5=typeof _0x3ab397[_0x887f('0x1d')]===_0x887f('0x1e')&&typeof _0x3ab397[_0x887f('0x1f')]===_0x887f('0x1e');var _0x3964d6=_0x3d3b0c[_0x887f('0x20')];var _0x366aae=_0x2399a5?0x0:_0x3ab397[_0x887f('0x1d')];var _0x4deddd=_0x2399a5?_0x3d3b0c[_0x887f('0x20')]:_0x3ab397[_0x887f('0x1d')]+_0x3ab397['limit'];var _0x11479b;if(_0x4deddd>=_0x3964d6){_0x4deddd=_0x3964d6;_0x11479b=0xc8;}else{_0x11479b=0xce;}_0x618c59[_0x887f('0x1a')](_0x11479b);return _0x618c59['set'](_0x887f('0x21'),_0x366aae+'-'+_0x4deddd+'/'+_0x3964d6)['json'](_0x3d3b0c);}return null;};}function patchUpdates(_0x2234ca){return function(_0x23c0ea){try{jsonpatch['apply'](_0x23c0ea,_0x2234ca,!![]);}catch(_0x338777){return BPromise[_0x887f('0x22')](_0x338777);}return _0x23c0ea[_0x887f('0x23')]();};}function saveUpdates(_0x9f7131,_0x538285){return function(_0x2bfe06){if(_0x2bfe06){return _0x2bfe06[_0x887f('0x24')](_0x9f7131)[_0x887f('0x25')](function(_0x1a1657){return _0x1a1657;});}return null;};}function removeEntity(_0x42c8bd,_0x4fbf9a){return function(_0x1811e6){if(_0x1811e6){return _0x1811e6[_0x887f('0x26')]()[_0x887f('0x25')](function(){_0x42c8bd['status'](0xcc)[_0x887f('0x1b')]();});}};}function handleEntityNotFound(_0x596db8,_0x49b715){return function(_0x36cd1a){if(!_0x36cd1a){_0x596db8[_0x887f('0x19')](0x194);}return _0x36cd1a;};}function handleError(_0xee5126,_0x2f20ce){_0x2f20ce=_0x2f20ce||0x1f4;return function(_0x1c5ce3){logger['error'](_0x1c5ce3['stack']);if(_0x1c5ce3[_0x887f('0x27')]){delete _0x1c5ce3[_0x887f('0x27')];}_0xee5126[_0x887f('0x1a')](_0x2f20ce)[_0x887f('0x28')](_0x1c5ce3);};}function getInteractionUsers(_0x4cf78e,_0x39a9ce){return new BPromise(function(_0x555db0,_0x155e39){try{if(_0x39a9ce[_0x4cf78e['id']]){_0x4cf78e['Users']=_[_0x887f('0x29')](_0x39a9ce[_0x4cf78e['id']],function(_0x10ec52){return{'id':_0x10ec52['id'],'fullname':_0x10ec52[_0x887f('0x2a')]};});}}catch(_0x3b0013){_0x155e39(_0x3b0013);}_0x555db0(_0x4cf78e);});}function getInteractionTags(_0x140d92,_0x3375c7){return new BPromise(function(_0x21040d,_0x173944){try{if(_0x140d92['TagIds']){_0x140d92[_0x887f('0x2b')]=[];_0x140d92[_0x887f('0x2c')][_0x887f('0x2d')](',')[_0x887f('0x2e')](function(_0x372ff2){_0x140d92[_0x887f('0x2b')]['push'](_0x3375c7[_0x372ff2]);});}delete _0x140d92[_0x887f('0x2c')];}catch(_0x1e3954){_0x173944(_0x1e3954);}_0x21040d(_0x140d92);});}function updateWhatsappInteraction(_0x450f83,_0x785968,_0x297d6e){return new BPromise(function(_0x4d2de4,_0x2a4d88){return getInteractionUsers(_0x450f83,_0x297d6e)[_0x887f('0x25')](function(_0x4efdff){return getInteractionTags(_0x4efdff,_0x785968);})[_0x887f('0x25')](function(_0x25354){_0x4d2de4(_0x25354);})[_0x887f('0x2f')](function(_0x529a37){_0x2a4d88(_0x529a37);});});}exports[_0x887f('0x30')]=function(_0x16ce43,_0x1994d2){var _0x202c99={},_0x580bae={},_0x474a9c={'count':0x0,'rows':[]};var _0x22295f=_['map'](db['WhatsappInteraction'][_0x887f('0x31')],function(_0x2a166b){return{'name':_0x2a166b[_0x887f('0x32')],'type':_0x2a166b['type'][_0x887f('0x33')]};});_0x580bae['model']=_['map'](_0x22295f,_0x887f('0x27'));_0x580bae[_0x887f('0x34')]=_[_0x887f('0x35')](_0x16ce43['query']);_0x580bae[_0x887f('0x36')]=_[_0x887f('0x37')](_0x580bae[_0x887f('0x38')],_0x580bae['query']);_0x202c99[_0x887f('0x39')]=_[_0x887f('0x37')](_0x580bae['model'],qs[_0x887f('0x3a')](_0x16ce43[_0x887f('0x34')][_0x887f('0x3a')]));_0x202c99[_0x887f('0x39')]=_0x202c99[_0x887f('0x39')][_0x887f('0x3b')]?_0x202c99['attributes']:_0x580bae[_0x887f('0x38')];if(!_0x16ce43[_0x887f('0x34')][_0x887f('0x3c')](_0x887f('0x3d'))){_0x202c99[_0x887f('0x1f')]=qs[_0x887f('0x1f')](_0x16ce43[_0x887f('0x34')]['limit']);_0x202c99[_0x887f('0x1d')]=qs[_0x887f('0x1d')](_0x16ce43[_0x887f('0x34')][_0x887f('0x1d')]);}_0x202c99['order']=qs[_0x887f('0x3e')](_0x16ce43[_0x887f('0x34')]['sort']);_0x202c99[_0x887f('0x3f')]=qs['filters'](_['pick'](_0x16ce43[_0x887f('0x34')],_0x580bae[_0x887f('0x36')]),_0x22295f);var _0x2b306a=[];var _0x12755c=squel[_0x887f('0x40')]()[_0x887f('0x41')]('id')['field'](_0x887f('0x27'))[_0x887f('0x41')](_0x887f('0x42'))[_0x887f('0x43')](_0x887f('0x44'));var _0x100a7d=squel[_0x887f('0x40')]()[_0x887f('0x41')](_0x887f('0x45'))[_0x887f('0x41')]('u.fullname')[_0x887f('0x41')](_0x887f('0x46'))[_0x887f('0x43')]('user_has_whatsapp_interactions','ui')[_0x887f('0x47')](_0x887f('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x3293a8=squel[_0x887f('0x40')]()[_0x887f('0x43')](_0x887f('0x49'),'i')[_0x887f('0x47')](_0x887f('0x4a'),'c',_0x887f('0x4b'))['left_join']('users','o',_0x887f('0x4c'))[_0x887f('0x47')]('whatsapp_accounts','a',_0x887f('0x4d'))[_0x887f('0x47')](_0x887f('0x4e'),'me',_0x887f('0x4f'))[_0x887f('0x47')](_0x887f('0x50'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x887f('0x44'),'t','t.id\x20=\x20it.TagId');var _0x35553f=squel['expr']();var _0x360436=[];var _0x2214f7=squel[_0x887f('0x51')]();var _0x417c8d;if(_0x16ce43[_0x887f('0x34')]['search']){_0x417c8d=as[_0x887f('0x52')](_0x16ce43[_0x887f('0x34')][_0x887f('0x53')]);var _0x1e5f43=_0x417c8d[_0x887f('0x54')];for(var _0x809211=0x0;_0x809211<_0x417c8d[_0x887f('0x55')][_0x887f('0x3b')];_0x809211++){var _0x4fbdfb=_0x417c8d[_0x887f('0x55')][_0x809211];var _0x39c4f1='i';var _0x1cd395=_[_0x887f('0x56')](_0x22295f,[_0x887f('0x27'),_0x4fbdfb[_0x887f('0x41')]]);if(!_0x1cd395){switch(_0x4fbdfb[_0x887f('0x41')]){case _0x887f('0x57'):if(_0x4fbdfb['value']==0x1){_0x3293a8[_0x887f('0x58')]('`'+_0x4fbdfb['field']+'`\x20=\x200');}else{_0x3293a8['having']('`'+_0x4fbdfb['field']+'`\x20>\x200');}break;case'Contact':if(_0x4fbdfb['operator']===_0x887f('0x59')){if(_0x4fbdfb['value'][_0x887f('0x2d')]('\x20')[_0x887f('0x3b')]>0x1){_0x35553f[_0x1e5f43]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4fbdfb['value']),null);}else{var _0x28576e='%'+_0x4fbdfb[_0x887f('0x5a')]+'%';_0x35553f[_0x1e5f43](_0x887f('0x5b'),_0x28576e,_0x28576e,_0x28576e);}}else{_0x1cd395=_['find'](_0x22295f,[_0x887f('0x27'),'ContactId']);_0x4fbdfb[_0x887f('0x41')]='ContactId';_0x5a9c18=as[_0x887f('0x5c')](_0x39c4f1,_0x1cd395['type'],_0x4fbdfb);_0x35553f[_0x1e5f43](_0x5a9c18[_0x887f('0x5d')],_0x5a9c18['value']['start'],_0x5a9c18[_0x887f('0x5a')][_0x887f('0x1b')]);}break;case _0x887f('0x5e'):var _0x573f76=_0x4fbdfb[_0x887f('0x5a')][_0x887f('0x2d')](',')[_0x887f('0x29')](function(_0x24bea4){return Number(_0x24bea4);});_0x573f76[_0x887f('0x2e')](function(_0x2f7420){_0x2214f7['or'](_0x887f('0x5f'),'%,'+_0x2f7420+',%');});_0x360436=_[_0x887f('0x60')](_0x360436,_0x573f76);break;case _0x887f('0x61'):if(_0x4fbdfb[_0x887f('0x62')]===_0x887f('0x59')){_0x35553f[_0x1e5f43](_0x887f('0x63'),'%'+_0x4fbdfb[_0x887f('0x5a')]+'%',null);}else{_0x1cd395=_[_0x887f('0x56')](_0x22295f,[_0x887f('0x27'),'UserId']);_0x4fbdfb[_0x887f('0x41')]=_0x887f('0x64');_0x5a9c18=as[_0x887f('0x5c')](_0x39c4f1,_0x1cd395['type'],_0x4fbdfb);_0x35553f[_0x1e5f43](_0x5a9c18['text'],_0x5a9c18[_0x887f('0x5a')][_0x887f('0x65')],_0x5a9c18[_0x887f('0x5a')]['end']);}break;case _0x887f('0x66'):_0x5a9c18=as[_0x887f('0x5c')]('me',null,_0x4fbdfb);_0x35553f[_0x1e5f43](_0x5a9c18[_0x887f('0x5d')],_0x5a9c18[_0x887f('0x5a')][_0x887f('0x65')],_0x5a9c18[_0x887f('0x5a')][_0x887f('0x1b')]);break;}}else{var _0x5a9c18=as[_0x887f('0x5c')](_0x39c4f1,_0x1cd395[_0x887f('0x67')],_0x4fbdfb);_0x35553f[_0x1e5f43](_0x5a9c18[_0x887f('0x5d')],_0x5a9c18[_0x887f('0x5a')]['start'],_0x5a9c18[_0x887f('0x5a')][_0x887f('0x1b')]);}}}else{var _0x40fb49=_(_0x16ce43[_0x887f('0x34')])[_0x887f('0x35')]()[_0x887f('0x29')](function(_0x36a8df){return _['some'](_0x22295f,[_0x887f('0x27'),_0x36a8df])?_0x36a8df:undefined;})[_0x887f('0x68')]()['value']();if(!_[_0x887f('0x69')](_0x40fb49)){_0x40fb49[_0x887f('0x2e')](function(_0xfe151d){if(_0xfe151d===_0x887f('0x6a')){_0x3293a8[_0x887f('0x3f')](_0x887f('0x6b'),[]['concat'](_0x16ce43[_0x887f('0x34')][_0xfe151d]));}else if(_0xfe151d===_0x887f('0x6c')){var _0x547ad5=JSON['parse'](_0x16ce43[_0x887f('0x34')][_0xfe151d])[_0x887f('0x6d')];var _0x5bf4a6=JSON['parse'](_0x16ce43[_0x887f('0x34')][_0xfe151d])[_0x887f('0x6e')];_0x3293a8[_0x887f('0x3f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x547ad5,_0x5bf4a6);}else{if(_0x16ce43['query'][_0xfe151d]===_0x887f('0x6f')){_0x3293a8[_0x887f('0x3f')]('i.'+_0xfe151d+'\x20IS\x20NULL');}else{_0x3293a8[_0x887f('0x3f')]('i.'+_0xfe151d+_0x887f('0x70'),_0x16ce43['query'][_0xfe151d]);}}});}if(_0x16ce43[_0x887f('0x34')]['read']){if(_0x16ce43[_0x887f('0x34')][_0x887f('0x71')]==0x1){_0x3293a8[_0x887f('0x58')]('`unreadMessages`\x20=\x200');}else{_0x3293a8[_0x887f('0x58')](_0x887f('0x72'));}}if(_0x16ce43[_0x887f('0x34')][_0x887f('0x73')]){_0x360436=_[_0x887f('0x74')](_0x16ce43[_0x887f('0x34')][_0x887f('0x73')])?_0x16ce43[_0x887f('0x34')]['tag']:new Array(_0x16ce43[_0x887f('0x34')][_0x887f('0x73')]);_0x360436[_0x887f('0x2e')](function(_0xc04568){_0x2214f7['or'](_0x887f('0x5f'),'%,'+_0xc04568+',%');});}if(_0x16ce43[_0x887f('0x34')][_0x887f('0x75')]){var _0x3d9600=_0x16ce43['query']['filter'][_0x887f('0x76')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x887f('0x77')](_0x3d9600)){_0x35553f['or'](_0x887f('0x78'),_0x3d9600+'%')['or'](_0x887f('0x79'),_0x3d9600+'%');}else{_0x35553f['or'](_0x887f('0x7a'),qs[_0x887f('0x7b')](_0x3d9600))['or'](_0x887f('0x7c'),_0x3d9600+'%');}}}_0x3293a8['where'](_0x35553f);_0x3293a8['group']('i.id');var _0x18073a={'type':db['Sequelize']['QueryTypes'][_0x887f('0x7d')],'raw':!![]};var _0x4c9241=_0x3293a8[_0x887f('0x7e')]();_0x4c9241[_0x887f('0x41')]('i.id');_0x4c9241['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x202c99['order']){_0x202c99[_0x887f('0x7f')][_0x887f('0x2e')](function(_0x2ff5c3){var _0x4f1a09=_0x2ff5c3[0x0]===_0x887f('0x80')?_0x2ff5c3[0x0]:'i.'+_0x2ff5c3[0x0];_0x3293a8[_0x887f('0x7f')](_0x4f1a09,_0x2ff5c3[0x1]===_0x887f('0x81')?![]:!![]);});}if(!_['isEmpty'](_0x360436)){_0x3293a8[_0x887f('0x58')](_0x2214f7);_0x4c9241['where'](_0x887f('0x82'),_0x360436);}BPromise['resolve']()[_0x887f('0x25')](function(){if(!_0x417c8d){if(_0x16ce43[_0x887f('0x34')]['WhatsappAccountId'])return;_0x4c9241[_0x887f('0x3f')](_0x887f('0x83'));_0x3293a8[_0x887f('0x3f')](_0x887f('0x83'));return;}if(_0x16ce43[_0x887f('0x84')][_0x887f('0x85')]!==_0x887f('0x86'))return;return _0x16ce43[_0x887f('0x84')][_0x887f('0x87')]({'attributes':['id'],'raw':!![]})[_0x887f('0x25')](function(_0x514e43){if(_[_0x887f('0x69')](_0x514e43)){_0x4c9241[_0x887f('0x3f')](_0x887f('0x88'));_0x3293a8[_0x887f('0x3f')](_0x887f('0x88'));}else{_0x4c9241[_0x887f('0x3f')]('i.WhatsappAccountId\x20IN\x20?',_[_0x887f('0x29')](_0x514e43,'id'));_0x3293a8['where'](_0x887f('0x6b'),_[_0x887f('0x29')](_0x514e43,'id'));}});})['then'](function(){if(_0x16ce43[_0x887f('0x84')][_0x887f('0x85')]===_0x887f('0x86')&&!_0x417c8d&&!_0x16ce43['query']['WhatsappAccountId'])return[];return db[_0x887f('0x89')]['query'](_0x4c9241[_0x887f('0x8a')](),_0x18073a);})[_0x887f('0x25')](function(_0x3247d2){_0x474a9c[_0x887f('0x20')]=_0x3247d2[_0x887f('0x3b')];if(_0x474a9c[_0x887f('0x20')]===0x0)return[];return db['sequelize'][_0x887f('0x34')](_0x12755c[_0x887f('0x8a')](),_0x18073a)['then'](function(_0x5bedcf){_0x2b306a=_[_0x887f('0x8b')](_0x5bedcf,'id');_0x18073a=_[_0x887f('0x8c')](_0x18073a,{'model':db[_0x887f('0x8d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16ce43[_0x887f('0x34')]['fields']){_0x202c99[_0x887f('0x39')][_0x887f('0x2e')](function(_0x59d1fc){_0x3293a8['field']('i.'+_0x59d1fc);});}else{_0x3293a8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x887f('0x57'));_0x3293a8['field']('a.key',_0x887f('0x8e'));_0x3293a8[_0x887f('0x41')]('a.mandatoryDisposition',_0x887f('0x8f'));_0x3293a8[_0x887f('0x41')](_0x887f('0x90'),_0x887f('0x80'));_0x3293a8[_0x887f('0x41')](_0x887f('0x91'));_0x3293a8[_0x887f('0x41')](_0x887f('0x92'),_0x887f('0x93'));_0x3293a8[_0x887f('0x41')]('c.lastName',_0x887f('0x94'));_0x3293a8[_0x887f('0x41')](_0x887f('0x95'),_0x887f('0x96'));_0x3293a8['field'](_0x887f('0x97'),_0x887f('0x98'));_0x3293a8['field'](_0x887f('0x99'),_0x887f('0x9a'));_0x3293a8[_0x887f('0x41')]('c.fax',_0x887f('0x9b'));_0x3293a8['field'](_0x887f('0x9c'),_0x887f('0x9d'));_0x3293a8[_0x887f('0x41')](_0x887f('0x9e'),_0x887f('0x9f'));_0x3293a8[_0x887f('0x41')](_0x887f('0xa0'),_0x887f('0x2c'));}if(_0x202c99['limit'])_0x3293a8['limit'](_0x202c99['limit']);if(_0x202c99[_0x887f('0x1d')])_0x3293a8['offset'](_0x202c99['offset']);return db[_0x887f('0x89')][_0x887f('0x34')](_0x3293a8[_0x887f('0x8a')](),_0x18073a);})[_0x887f('0x25')](function(_0x12984b){if(_0x12984b[_0x887f('0x3b')]>0x0)_0x100a7d[_0x887f('0x3f')](_0x887f('0xa1'),_['map'](_0x12984b,'id'));return db['sequelize']['query'](_0x100a7d[_0x887f('0x8a')](),_0x18073a)[_0x887f('0x25')](function(_0x324458){var _0x337fba=_['groupBy'](_0x324458,_0x887f('0xa2'));var _0x1df446=[];_0x12984b['forEach'](function(_0xeadad3){_0x1df446[_0x887f('0xa3')](updateWhatsappInteraction(_0xeadad3,_0x2b306a,_0x337fba));});return BPromise[_0x887f('0xa4')](_0x1df446);});});})['then'](function(_0x35f4b1){_0x474a9c[_0x887f('0xa5')]=_0x35f4b1;return _0x474a9c;})[_0x887f('0x25')](respondWithFilteredResult(_0x1994d2,_0x202c99))[_0x887f('0x2f')](handleError(_0x1994d2,null));};exports[_0x887f('0xa6')]=function(_0x5aa8a0,_0x698520){var _0x30e62e={'raw':![],'where':{'id':_0x5aa8a0[_0x887f('0xa7')]['id']}},_0x17cdfa={};_0x17cdfa[_0x887f('0x38')]=_[_0x887f('0x35')](db[_0x887f('0x8d')]['rawAttributes']);_0x17cdfa['query']=_['keys'](_0x5aa8a0[_0x887f('0x34')]);_0x17cdfa['filters']=_[_0x887f('0x37')](_0x17cdfa[_0x887f('0x38')],_0x17cdfa[_0x887f('0x34')]);_0x30e62e['attributes']=_[_0x887f('0x37')](_0x17cdfa[_0x887f('0x38')],qs[_0x887f('0x3a')](_0x5aa8a0[_0x887f('0x34')][_0x887f('0x3a')]));_0x30e62e['attributes']=_0x30e62e[_0x887f('0x39')][_0x887f('0x3b')]?_0x30e62e[_0x887f('0x39')]:_0x17cdfa['model'];if(_0x5aa8a0[_0x887f('0x34')][_0x887f('0xa8')]){_0x30e62e[_0x887f('0xa9')]=[{'all':!![]}];}_0x30e62e=_[_0x887f('0x8c')]({},_0x30e62e,_0x5aa8a0[_0x887f('0xaa')]);return db['WhatsappInteraction'][_0x887f('0x56')](_0x30e62e)['then'](handleEntityNotFound(_0x698520,null))[_0x887f('0x25')](respondWithResult(_0x698520,null))['catch'](handleError(_0x698520,null));};exports[_0x887f('0xab')]=function(_0x5a4134,_0x419fdd){return db['WhatsappInteraction'][_0x887f('0xab')](_0x5a4134[_0x887f('0x66')],{})[_0x887f('0x25')](respondWithResult(_0x419fdd,0xc9))['catch'](handleError(_0x419fdd,null));};exports['update']=function(_0x5ead7a,_0x4e5a05){if(_0x5ead7a[_0x887f('0x66')]['id']){delete _0x5ead7a['body']['id'];}return db['WhatsappInteraction'][_0x887f('0x56')]({'where':{'id':_0x5ead7a[_0x887f('0xa7')]['id']}})[_0x887f('0x25')](handleEntityNotFound(_0x4e5a05,null))['then'](saveUpdates(_0x5ead7a[_0x887f('0x66')],null))[_0x887f('0x25')](respondWithResult(_0x4e5a05,null))[_0x887f('0x2f')](handleError(_0x4e5a05,null));};exports['destroy']=function(_0x173710,_0x4d125d){return db['WhatsappInteraction'][_0x887f('0x56')]({'where':{'id':_0x173710[_0x887f('0xa7')]['id']}})['then'](handleEntityNotFound(_0x4d125d,null))[_0x887f('0x25')](removeEntity(_0x4d125d,null))['catch'](handleError(_0x4d125d,null));};exports[_0x887f('0xac')]=function(_0x582621,_0x5e0cf8){return db[_0x887f('0x8d')][_0x887f('0xac')]()[_0x887f('0x25')](respondWithResult(_0x5e0cf8,null))['catch'](handleError(_0x5e0cf8,null));};exports['addMessage']=function(_0x11b579,_0x497d29,_0x247485){return db['WhatsappMessage']['find']({'where':{'id':_0x11b579['params']['id']}})['then'](handleEntityNotFound(_0x497d29,null))[_0x887f('0x25')](function(_0x29f385){if(_0x29f385){return _0x29f385[_0x887f('0xad')](_0x11b579[_0x887f('0x66')]['ids'],_[_0x887f('0xae')](_0x11b579[_0x887f('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x497d29,null))['catch'](handleError(_0x497d29,null));};exports['getMessages']=function(_0xe9e9ff,_0x5c7ae7,_0x430786){var _0x24d106={'raw':![],'where':{}};var _0x2e9805={};var _0x10826c={'count':0x0,'rows':[]};return db[_0x887f('0x8d')][_0x887f('0xaf')]({'where':{'id':_0xe9e9ff[_0x887f('0xa7')]['id']}})[_0x887f('0x25')](handleEntityNotFound(_0x5c7ae7,null))['then'](function(_0x1cd837){if(_0x1cd837){_0x2e9805[_0x887f('0x38')]=_[_0x887f('0x35')](db['WhatsappMessage'][_0x887f('0x31')]);_0x2e9805['query']=_[_0x887f('0x35')](_0xe9e9ff[_0x887f('0x34')]);_0x2e9805[_0x887f('0x36')]=_[_0x887f('0x37')](_0x2e9805['model'],_0x2e9805[_0x887f('0x34')]);_0x24d106[_0x887f('0x39')]=_[_0x887f('0x37')](_0x2e9805[_0x887f('0x38')],qs['fields'](_0xe9e9ff[_0x887f('0x34')]['fields']));_0x24d106[_0x887f('0x39')]=_0x24d106[_0x887f('0x39')][_0x887f('0x3b')]?_0x24d106['attributes']:_0x2e9805['model'];if(!_0xe9e9ff[_0x887f('0x34')][_0x887f('0x3c')](_0x887f('0x3d'))){_0x24d106[_0x887f('0x1f')]=qs[_0x887f('0x1f')](_0xe9e9ff['query']['limit']);_0x24d106[_0x887f('0x1d')]=qs['offset'](_0xe9e9ff[_0x887f('0x34')][_0x887f('0x1d')]);}_0x24d106[_0x887f('0x7f')]=qs[_0x887f('0x3e')](_0xe9e9ff[_0x887f('0x34')]['sort']);_0x24d106[_0x887f('0x3f')]=qs[_0x887f('0x36')](_['pick'](_0xe9e9ff[_0x887f('0x34')],_0x2e9805[_0x887f('0x36')]));_0x24d106[_0x887f('0x3f')][_0x887f('0xa2')]=_0x1cd837['id'];if(_0xe9e9ff['query'][_0x887f('0x75')]){_0x24d106[_0x887f('0x3f')]=_[_0x887f('0x8c')](_0x24d106[_0x887f('0x3f')],{'$or':_['map'](_0x24d106[_0x887f('0x39')],function(_0xa403dc){var _0x4b1ebd={};_0x4b1ebd[_0xa403dc]={'$like':'%'+_0xe9e9ff[_0x887f('0x34')][_0x887f('0x75')]+'%'};return _0x4b1ebd;})});}if(_0xe9e9ff['query'][_0x887f('0x6d')]){var _0x2f03c6=_0xe9e9ff[_0x887f('0x34')][_0x887f('0x6d')][_0x887f('0x2d')](',');var _0x4fd7e8={};_0x4fd7e8[_0x2f03c6[0x0]]={'$gte':moment(_0x2f03c6[0x1])[_0x887f('0xb0')](_0x887f('0xb1'))};_0x24d106['where']=_[_0x887f('0x8c')](_0x24d106[_0x887f('0x3f')],_0x4fd7e8);}_0x24d106=_[_0x887f('0x8c')]({},_0x24d106,_0xe9e9ff[_0x887f('0xaa')]);return db['WhatsappMessage'][_0x887f('0x20')]({'where':_0x24d106[_0x887f('0x3f')]})[_0x887f('0x25')](function(_0x6e81b9){_0x10826c[_0x887f('0x20')]=_0x6e81b9;if(_0xe9e9ff['query'][_0x887f('0xa8')]){_0x24d106[_0x887f('0xa9')]=[{'all':!![]}];}return db[_0x887f('0xb2')][_0x887f('0xb3')](_0x24d106);})[_0x887f('0x25')](function(_0x3eddb3){_0x10826c[_0x887f('0xa5')]=_0x3eddb3;return _0x10826c;});}})[_0x887f('0x25')](respondWithFilteredResult(_0x5c7ae7,_0x24d106))[_0x887f('0x2f')](handleError(_0x5c7ae7,null));};exports[_0x887f('0xb4')]=function(_0x13a5c8,_0x5cee0f,_0x2a7c67){return db[_0x887f('0x8d')][_0x887f('0x56')]({'where':{'id':_0x13a5c8[_0x887f('0xa7')]['id']}})[_0x887f('0x25')](handleEntityNotFound(_0x5cee0f,null))[_0x887f('0x25')](function(_0x4268e7){if(_0x4268e7){return _0x4268e7[_0x887f('0xb5')](_0x13a5c8[_0x887f('0x66')][_0x887f('0xb6')],_['omit'](_0x13a5c8[_0x887f('0x66')],[_0x887f('0xb6'),'id'])||{})[_0x887f('0xb7')](function(){return db['Tag'][_0x887f('0xb3')]({'attributes':['id',_0x887f('0x27'),'color'],'where':{'id':_0x13a5c8[_0x887f('0x66')][_0x887f('0xb6')]}});})[_0x887f('0x25')](function(_0x49f7ca){socket[_0x887f('0xb8')](_0x887f('0xb9'),{'id':Number(_0x13a5c8[_0x887f('0xa7')]['id']),'tags':_0x49f7ca||[]});return{'id':Number(_0x13a5c8[_0x887f('0xa7')]['id']),'tags':_0x49f7ca||[]};});}})[_0x887f('0x25')](respondWithResult(_0x5cee0f,null))['catch'](handleError(_0x5cee0f,null));};exports[_0x887f('0xba')]=function(_0x3a5dc1,_0xe1ccec,_0xf4eea0){return db[_0x887f('0x8d')]['find']({'where':{'id':_0x3a5dc1[_0x887f('0xa7')]['id']}})['then'](handleEntityNotFound(_0xe1ccec,null))[_0x887f('0x25')](function(_0x4b2896){if(_0x4b2896){return _0x4b2896[_0x887f('0xba')](_0x3a5dc1['query']['ids']);}})['then'](respondWithStatusCode(_0xe1ccec,null))[_0x887f('0x2f')](handleError(_0xe1ccec,null));};exports[_0x887f('0xbb')]=function(_0x24ca8a,_0x4df734){var _0x102369=moment()[_0x887f('0xbc')]()['toString']();var _0x127275=path[_0x887f('0xbd')](config[_0x887f('0xbe')],_0x887f('0xbf'),_0x887f('0xc0'),_0x887f('0xc1'));var _0x56aea8=path['join'](config[_0x887f('0xbe')],_0x887f('0xbf'),_0x887f('0xc0'),_0x887f('0xc2'));var _0x56a5f9=path[_0x887f('0xbd')](_0x127275,_0x102369);var _0x56c96e=util[_0x887f('0xb0')](_0x887f('0xc3'),_0x24ca8a['params']['id'],_0x102369);var _0x36f678=path[_0x887f('0xbd')](_0x127275,_0x56c96e);var _0x47c479=[];_0x47c479[_0x887f('0xa3')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x47c479[_0x887f('0xa3')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x887f('0xc4'),_0x887f('0xc5')],'raw':!![]});if(_0x24ca8a['query']['attachments']){_0x47c479[_0x887f('0xa3')]({'model':db[_0x887f('0xc6')],'as':'Attachment','raw':!![]});}var _0x455e19=[{'model':db[_0x887f('0xb2')],'as':_0x887f('0xc7'),'attributes':['id',_0x887f('0x66'),_0x887f('0x6c'),_0x887f('0xc8'),'secret','read'],'include':_0x47c479}];_0x455e19[_0x887f('0xa3')]({'model':db[_0x887f('0xc9')],'as':'Account','attributes':['id',_0x887f('0x27')]});_0x455e19[_0x887f('0xa3')]({'model':db[_0x887f('0x61')],'as':'Owner','attributes':['id',_0x887f('0x2a')]});return db[_0x887f('0x8d')]['find']({'where':{'id':_0x24ca8a[_0x887f('0xa7')]['id']},'include':_0x455e19})['then'](handleEntityNotFound(_0x4df734,null))[_0x887f('0x25')](function(_0x55bd0b){if(_0x55bd0b){var _0x468902=_0x55bd0b['get']({'plain':!![]});fs[_0x887f('0xca')](_0x56a5f9);var _0x15e736={'channel':_0x887f('0xcb'),'account':_0x468902['Account'][_0x887f('0x27')],'agent':_0x468902[_0x887f('0xcc')]?_0x468902[_0x887f('0xcc')][_0x887f('0x2a')]:_0x887f('0xcd'),'createdAt':moment(_0x468902['createdAt'])['format'](_0x887f('0xb1'))[_0x887f('0x8a')](),'closedAt':_0x468902['closed']?moment(_0x468902['closedAt'])[_0x887f('0xb0')](_0x887f('0xb1'))[_0x887f('0x8a')]():'','disposition':_0x468902['disposition'],'messages':_(_0x468902[_0x887f('0xc7')])[_0x887f('0x75')]({'secret':![]})[_0x887f('0x29')](function(_0x2deb5f){if(_0x2deb5f[_0x887f('0xc6')]){var _0x4b7055=path[_0x887f('0xbd')](_0x56aea8,_0x2deb5f['Attachment'][_0x887f('0xce')]);if(fs[_0x887f('0xcf')](_0x4b7055)){fs[_0x887f('0xd0')](_0x4b7055)[_0x887f('0xd1')](fs[_0x887f('0xd2')](path[_0x887f('0xbd')](_0x56a5f9,_0x2deb5f[_0x887f('0xc6')][_0x887f('0xce')])));}}return{'date':moment(_0x2deb5f['createdAt'])[_0x887f('0xb0')](_0x887f('0xb1'))[_0x887f('0x8a')](),'sender':_0x2deb5f[_0x887f('0xc8')]===_0x887f('0xd3')?_0x2deb5f[_0x887f('0x61')]?_0x2deb5f[_0x887f('0x61')]['fullname']:'System':_0x2deb5f[_0x887f('0xd4')][_0x887f('0xc4')]+(_0x2deb5f['Contact'][_0x887f('0xc5')]?'\x20'+_0x2deb5f[_0x887f('0xd4')][_0x887f('0xc5')]:''),'body':_0x2deb5f[_0x887f('0xc6')]?_0x2deb5f['Attachment']['basename']:_0x2deb5f[_0x887f('0x66')],'direction':_0x2deb5f['direction']==='out'?'A':'C','secret':_0x2deb5f[_0x887f('0xd5')],'read':_0x2deb5f['read'],'attachment':_0x2deb5f[_0x887f('0xc6')]};})[_0x887f('0x5a')]()};return ejs[_0x887f('0xd6')](path['join'](config[_0x887f('0xbe')],_0x887f('0xbf'),_0x887f('0xd7'),_0x887f('0xd8')),{'interaction':_0x15e736})[_0x887f('0x25')](function(_0x5460d9){var _0x396293=path[_0x887f('0xbd')](_0x56a5f9,_0x887f('0xd9')+_0x468902['id']+'-'+_0x102369+_0x887f('0xda'));var _0x24d64f={'path':_0x396293,'channel':_0x887f('0xcb'),'interactionId':_0x468902['id']};return pdf['createPdfFromHTML'](_0x5460d9,_0x24d64f);})[_0x887f('0x25')](function(){return new BPromise(function(_0x3375ab,_0x2c21fc){zipdir(_0x56a5f9,{'saveTo':_0x36f678},function(_0x461180,_0x4c1b53){if(_0x461180)return _0x2c21fc(_0x461180);return _0x3375ab(_0x4c1b53);});})[_0x887f('0x25')](function(){return new BPromise(function(_0x4915b7,_0x6944e4){rimraf(_0x56a5f9,function(_0x48119c){if(_0x48119c)_0x6944e4(_0x48119c);return _0x4915b7();});});})[_0x887f('0x25')](function(){return _0x4df734[_0x887f('0xbb')](_0x36f678,_0x56c96e,function(_0x1677fb){if(_0x1677fb){console[_0x887f('0xdb')]('err',_0x1677fb);}else{fs[_0x887f('0xdc')](_0x36f678);}});});});}else{return _0x4df734[_0x887f('0x19')](0xc8);}})[_0x887f('0x2f')](handleError(_0x4df734,null));}; \ No newline at end of file +var _0x7857=['../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name','send','Users','map','TagIds','Tags','catch','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','select','field','color','tools_tags','u.fullname','ui.WhatsappInteractionId','from','left_join','users','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','expr','search','parseSearch','length','unreadMessages','value','having','`\x20=\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','text','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$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.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','role','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.email','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','create','params','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','nolimit','WhatsappInteractionId','format','findAll','spread','whatsappInteractionTags:save','removeTags','unix','root','server','files','join','attachments','transcript-%d-%s.zip','fullname','push','CmContact','firstName','Attachment','Messages','secret','Account','Owner','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','lastName','renderFile','views','transcript-','.pdf','download','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x371c21,_0x36c68a){var _0x12fbf6=function(_0x1c717e){while(--_0x1c717e){_0x371c21['push'](_0x371c21['shift']());}};_0x12fbf6(++_0x36c68a);}(_0x7857,0x1a9));var _0x7785=function(_0x5b3211,_0x38e8f8){_0x5b3211=_0x5b3211-0x0;var _0x14d236=_0x7857[_0x5b3211];return _0x14d236;};'use strict';var emlformat=require(_0x7785('0x0'));var rimraf=require(_0x7785('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7785('0x2'));var rp=require(_0x7785('0x3'));var moment=require('moment');var BPromise=require(_0x7785('0x4'));var Mustache=require(_0x7785('0x5'));var util=require(_0x7785('0x6'));var path=require('path');var sox=require(_0x7785('0x7'));var csv=require(_0x7785('0x8'));var ejs=require(_0x7785('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7785('0xa'));var crypto=require(_0x7785('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7785('0xc'));var toCsv=require(_0x7785('0x8'));var querystring=require(_0x7785('0xd'));var Papa=require(_0x7785('0xe'));var Redis=require('ioredis');var authService=require(_0x7785('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7785('0x10'));var pdf=require(_0x7785('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7785('0x12'))(_0x7785('0x13'));var utils=require(_0x7785('0x14'));var config=require(_0x7785('0x15'));var licenseUtil=require(_0x7785('0x16'));var db=require(_0x7785('0x17'))['db'];config['redis']=_[_0x7785('0x18')](config[_0x7785('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x7785('0x1a'))(new Redis(config[_0x7785('0x19')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3f4c10,_0xeb4a9c){_0xeb4a9c=_0xeb4a9c||0xcc;return function(_0x12d51c){if(_0x12d51c){return _0x3f4c10[_0x7785('0x1b')](_0xeb4a9c);}return _0x3f4c10[_0x7785('0x1c')](_0xeb4a9c)['end']();};}function respondWithResult(_0x325808,_0x1807fe){_0x1807fe=_0x1807fe||0xc8;return function(_0x26c8da){if(_0x26c8da){return _0x325808[_0x7785('0x1c')](_0x1807fe)[_0x7785('0x1d')](_0x26c8da);}};}function respondWithFilteredResult(_0x33daa7,_0x4d1fd3){return function(_0x473d1d){if(_0x473d1d){var _0x30e66e=typeof _0x4d1fd3[_0x7785('0x1e')]===_0x7785('0x1f')&&typeof _0x4d1fd3[_0x7785('0x20')]===_0x7785('0x1f');var _0x478194=_0x473d1d[_0x7785('0x21')];var _0x1c96c4=_0x30e66e?0x0:_0x4d1fd3[_0x7785('0x1e')];var _0x3535f8=_0x30e66e?_0x473d1d[_0x7785('0x21')]:_0x4d1fd3['offset']+_0x4d1fd3[_0x7785('0x20')];var _0x2a410a;if(_0x3535f8>=_0x478194){_0x3535f8=_0x478194;_0x2a410a=0xc8;}else{_0x2a410a=0xce;}_0x33daa7['status'](_0x2a410a);return _0x33daa7['set'](_0x7785('0x22'),_0x1c96c4+'-'+_0x3535f8+'/'+_0x478194)[_0x7785('0x1d')](_0x473d1d);}return null;};}function patchUpdates(_0x1a8b00){return function(_0x1f10c8){try{jsonpatch[_0x7785('0x23')](_0x1f10c8,_0x1a8b00,!![]);}catch(_0x5b0d94){return BPromise['reject'](_0x5b0d94);}return _0x1f10c8[_0x7785('0x24')]();};}function saveUpdates(_0x40b6a9,_0x218d07){return function(_0x383933){if(_0x383933){return _0x383933[_0x7785('0x25')](_0x40b6a9)[_0x7785('0x26')](function(_0xb6d6c){return _0xb6d6c;});}return null;};}function removeEntity(_0x81bd3d,_0x47ebe0){return function(_0x38efe2){if(_0x38efe2){return _0x38efe2[_0x7785('0x27')]()['then'](function(){_0x81bd3d[_0x7785('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41fcf8,_0x3619ee){return function(_0x17dd48){if(!_0x17dd48){_0x41fcf8['sendStatus'](0x194);}return _0x17dd48;};}function handleError(_0x23a772,_0x573e66){_0x573e66=_0x573e66||0x1f4;return function(_0x118efe){logger[_0x7785('0x28')](_0x118efe['stack']);if(_0x118efe[_0x7785('0x29')]){delete _0x118efe[_0x7785('0x29')];}_0x23a772[_0x7785('0x1c')](_0x573e66)[_0x7785('0x2a')](_0x118efe);};}function getInteractionUsers(_0x26908e,_0x5b09ad){return new BPromise(function(_0xf99533,_0x5bb57d){try{if(_0x5b09ad[_0x26908e['id']]){_0x26908e[_0x7785('0x2b')]=_[_0x7785('0x2c')](_0x5b09ad[_0x26908e['id']],function(_0x509d87){return{'id':_0x509d87['id'],'fullname':_0x509d87['fullname']};});}}catch(_0x4970d6){_0x5bb57d(_0x4970d6);}_0xf99533(_0x26908e);});}function getInteractionTags(_0x3b3f16,_0x3edee9){return new BPromise(function(_0x3c0b22,_0x494c83){try{if(_0x3b3f16[_0x7785('0x2d')]){_0x3b3f16[_0x7785('0x2e')]=[];_0x3b3f16[_0x7785('0x2d')]['split'](',')['forEach'](function(_0x5605ad){_0x3b3f16[_0x7785('0x2e')]['push'](_0x3edee9[_0x5605ad]);});}delete _0x3b3f16[_0x7785('0x2d')];}catch(_0x5f99d4){_0x494c83(_0x5f99d4);}_0x3c0b22(_0x3b3f16);});}function updateWhatsappInteraction(_0x29073d,_0x10601,_0x4100a2){return new BPromise(function(_0xbbac05,_0x2d4111){return getInteractionUsers(_0x29073d,_0x4100a2)[_0x7785('0x26')](function(_0x593f66){return getInteractionTags(_0x593f66,_0x10601);})[_0x7785('0x26')](function(_0x1d2191){_0xbbac05(_0x1d2191);})[_0x7785('0x2f')](function(_0x204395){_0x2d4111(_0x204395);});});}exports['index']=function(_0x5c7829,_0x243b38){var _0x51afe1={},_0x39bdf1={},_0x229826={'count':0x0,'rows':[]};var _0xc3acda=_[_0x7785('0x2c')](db[_0x7785('0x30')][_0x7785('0x31')],function(_0x113dff){return{'name':_0x113dff['fieldName'],'type':_0x113dff[_0x7785('0x32')][_0x7785('0x33')]};});_0x39bdf1[_0x7785('0x34')]=_[_0x7785('0x2c')](_0xc3acda,_0x7785('0x29'));_0x39bdf1[_0x7785('0x35')]=_[_0x7785('0x36')](_0x5c7829[_0x7785('0x35')]);_0x39bdf1[_0x7785('0x37')]=_[_0x7785('0x38')](_0x39bdf1['model'],_0x39bdf1[_0x7785('0x35')]);_0x51afe1['attributes']=_[_0x7785('0x38')](_0x39bdf1[_0x7785('0x34')],qs[_0x7785('0x39')](_0x5c7829[_0x7785('0x35')][_0x7785('0x39')]));_0x51afe1[_0x7785('0x3a')]=_0x51afe1['attributes']['length']?_0x51afe1[_0x7785('0x3a')]:_0x39bdf1[_0x7785('0x34')];if(!_0x5c7829[_0x7785('0x35')][_0x7785('0x3b')]('nolimit')){_0x51afe1[_0x7785('0x20')]=qs[_0x7785('0x20')](_0x5c7829[_0x7785('0x35')][_0x7785('0x20')]);_0x51afe1['offset']=qs['offset'](_0x5c7829[_0x7785('0x35')]['offset']);}_0x51afe1[_0x7785('0x3c')]=qs[_0x7785('0x3d')](_0x5c7829[_0x7785('0x35')]['sort']);_0x51afe1[_0x7785('0x3e')]=qs[_0x7785('0x37')](_[_0x7785('0x3f')](_0x5c7829[_0x7785('0x35')],_0x39bdf1[_0x7785('0x37')]),_0xc3acda);var _0x5a2d1b=[];var _0x4b2099=squel[_0x7785('0x40')]()[_0x7785('0x41')]('id')['field'](_0x7785('0x29'))[_0x7785('0x41')](_0x7785('0x42'))['from'](_0x7785('0x43'));var _0x3a6d60=squel['select']()[_0x7785('0x41')]('u.id')[_0x7785('0x41')](_0x7785('0x44'))['field'](_0x7785('0x45'))[_0x7785('0x46')]('user_has_whatsapp_interactions','ui')[_0x7785('0x47')](_0x7785('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x5c5286=squel['select']()[_0x7785('0x46')](_0x7785('0x49'),'i')[_0x7785('0x47')]('cm_contacts','c',_0x7785('0x4a'))['left_join'](_0x7785('0x48'),'o',_0x7785('0x4b'))['left_join']('whatsapp_accounts','a',_0x7785('0x4c'))[_0x7785('0x47')](_0x7785('0x4d'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x7785('0x47')](_0x7785('0x4e'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x403efb=squel[_0x7785('0x4f')]();var _0x37acea=[];var _0x4c7f64=squel[_0x7785('0x4f')]();var _0x36f1a2;if(_0x5c7829[_0x7785('0x35')][_0x7785('0x50')]){_0x36f1a2=as[_0x7785('0x51')](_0x5c7829[_0x7785('0x35')]['search']);var _0x548c1d=_0x36f1a2['sqlOperator'];for(var _0x1c6551=0x0;_0x1c6551<_0x36f1a2['conditions'][_0x7785('0x52')];_0x1c6551++){var _0x5757c2=_0x36f1a2['conditions'][_0x1c6551];var _0xbf04d7='i';var _0x1e85ab=_['find'](_0xc3acda,[_0x7785('0x29'),_0x5757c2[_0x7785('0x41')]]);if(!_0x1e85ab){switch(_0x5757c2[_0x7785('0x41')]){case _0x7785('0x53'):if(_0x5757c2[_0x7785('0x54')]==0x1){_0x5c5286[_0x7785('0x55')]('`'+_0x5757c2[_0x7785('0x41')]+_0x7785('0x56'));}else{_0x5c5286[_0x7785('0x55')]('`'+_0x5757c2[_0x7785('0x41')]+'`\x20>\x200');}break;case _0x7785('0x57'):if(_0x5757c2[_0x7785('0x58')]==='$substring'){if(_0x5757c2[_0x7785('0x54')][_0x7785('0x59')]('\x20')[_0x7785('0x52')]>0x1){_0x403efb[_0x548c1d](_0x7785('0x5a'),qs['getFullTextValue'](_0x5757c2[_0x7785('0x54')]),null);}else{var _0x216c0f='%'+_0x5757c2[_0x7785('0x54')]+'%';_0x403efb[_0x548c1d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x216c0f,_0x216c0f,_0x216c0f);}}else{_0x1e85ab=_[_0x7785('0x5b')](_0xc3acda,[_0x7785('0x29'),_0x7785('0x5c')]);_0x5757c2[_0x7785('0x41')]=_0x7785('0x5c');_0x1d89a5=as[_0x7785('0x5d')](_0xbf04d7,_0x1e85ab[_0x7785('0x32')],_0x5757c2);_0x403efb[_0x548c1d](_0x1d89a5[_0x7785('0x5e')],_0x1d89a5['value'][_0x7785('0x5f')],_0x1d89a5['value'][_0x7785('0x60')]);}break;case _0x7785('0x61'):var _0x2a9b28=_0x5757c2[_0x7785('0x54')][_0x7785('0x59')](',')[_0x7785('0x2c')](function(_0x2864ed){return Number(_0x2864ed);});_0x2a9b28['forEach'](function(_0x3f2bbb){_0x4c7f64['or'](_0x7785('0x62'),'%,'+_0x3f2bbb+',%');});_0x37acea=_[_0x7785('0x63')](_0x37acea,_0x2a9b28);break;case _0x7785('0x64'):if(_0x5757c2[_0x7785('0x58')]===_0x7785('0x65')){_0x403efb[_0x548c1d](_0x7785('0x66'),'%'+_0x5757c2[_0x7785('0x54')]+'%',null);}else{_0x1e85ab=_[_0x7785('0x5b')](_0xc3acda,[_0x7785('0x29'),_0x7785('0x67')]);_0x5757c2[_0x7785('0x41')]=_0x7785('0x67');_0x1d89a5=as[_0x7785('0x5d')](_0xbf04d7,_0x1e85ab[_0x7785('0x32')],_0x5757c2);_0x403efb[_0x548c1d](_0x1d89a5['text'],_0x1d89a5[_0x7785('0x54')][_0x7785('0x5f')],_0x1d89a5['value'][_0x7785('0x60')]);}break;case _0x7785('0x68'):_0x1d89a5=as[_0x7785('0x5d')]('me',null,_0x5757c2);_0x403efb[_0x548c1d](_0x1d89a5[_0x7785('0x5e')],_0x1d89a5['value'][_0x7785('0x5f')],_0x1d89a5[_0x7785('0x54')]['end']);break;}}else{var _0x1d89a5=as['buildExpression'](_0xbf04d7,_0x1e85ab[_0x7785('0x32')],_0x5757c2);_0x403efb[_0x548c1d](_0x1d89a5[_0x7785('0x5e')],_0x1d89a5[_0x7785('0x54')]['start'],_0x1d89a5['value'][_0x7785('0x60')]);}}}else{var _0x397688=_(_0x5c7829[_0x7785('0x35')])[_0x7785('0x36')]()[_0x7785('0x2c')](function(_0x3f8275){return _['some'](_0xc3acda,[_0x7785('0x29'),_0x3f8275])?_0x3f8275:undefined;})['compact']()[_0x7785('0x54')]();if(!_[_0x7785('0x69')](_0x397688)){_0x397688[_0x7785('0x6a')](function(_0x4a0c75){if(_0x4a0c75===_0x7785('0x6b')){_0x5c5286[_0x7785('0x3e')](_0x7785('0x6c'),[][_0x7785('0x6d')](_0x5c7829['query'][_0x4a0c75]));}else if(_0x4a0c75===_0x7785('0x6e')){var _0x171841=JSON['parse'](_0x5c7829['query'][_0x4a0c75])[_0x7785('0x6f')];var _0x184001=JSON['parse'](_0x5c7829[_0x7785('0x35')][_0x4a0c75])[_0x7785('0x70')];_0x5c5286[_0x7785('0x3e')](_0x7785('0x71'),_0x171841,_0x184001);}else{if(_0x5c7829['query'][_0x4a0c75]===_0x7785('0x72')){_0x5c5286[_0x7785('0x3e')]('i.'+_0x4a0c75+_0x7785('0x73'));}else{_0x5c5286['where']('i.'+_0x4a0c75+_0x7785('0x74'),_0x5c7829[_0x7785('0x35')][_0x4a0c75]);}}});}if(_0x5c7829[_0x7785('0x35')]['read']){if(_0x5c7829[_0x7785('0x35')][_0x7785('0x75')]==0x1){_0x5c5286['having'](_0x7785('0x76'));}else{_0x5c5286[_0x7785('0x55')](_0x7785('0x77'));}}if(_0x5c7829['query'][_0x7785('0x78')]){_0x37acea=_[_0x7785('0x79')](_0x5c7829[_0x7785('0x35')][_0x7785('0x78')])?_0x5c7829[_0x7785('0x35')]['tag']:new Array(_0x5c7829[_0x7785('0x35')][_0x7785('0x78')]);_0x37acea[_0x7785('0x6a')](function(_0x3dc883){_0x4c7f64['or'](_0x7785('0x62'),'%,'+_0x3dc883+',%');});}if(_0x5c7829['query']['filter']){var _0x4f0403=_0x5c7829[_0x7785('0x35')][_0x7785('0x7a')][_0x7785('0x7b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7785('0x7c')](_0x4f0403)){_0x403efb['or']('i.id\x20LIKE\x20?',_0x4f0403+'%')['or'](_0x7785('0x7d'),_0x4f0403+'%');}else{_0x403efb['or'](_0x7785('0x7e'),qs[_0x7785('0x7f')](_0x4f0403))['or'](_0x7785('0x80'),_0x4f0403+'%');}}}_0x5c5286[_0x7785('0x3e')](_0x403efb);_0x5c5286['group'](_0x7785('0x81'));var _0x50be76={'type':db[_0x7785('0x82')][_0x7785('0x83')][_0x7785('0x84')],'raw':!![]};var _0x3bcc38=_0x5c5286['clone']();_0x3bcc38['field'](_0x7785('0x81'));_0x3bcc38[_0x7785('0x41')](_0x7785('0x85'),'unreadMessages');if(_0x51afe1['order']){_0x51afe1['order'][_0x7785('0x6a')](function(_0x7f0856){var _0x159bfd=_0x7f0856[0x0]===_0x7785('0x86')?_0x7f0856[0x0]:'i.'+_0x7f0856[0x0];_0x5c5286['order'](_0x159bfd,_0x7f0856[0x1]===_0x7785('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x37acea)){_0x5c5286[_0x7785('0x55')](_0x4c7f64);_0x3bcc38[_0x7785('0x3e')](_0x7785('0x88'),_0x37acea);}BPromise[_0x7785('0x89')]()[_0x7785('0x26')](function(){if(!_0x36f1a2){if(_0x5c7829['query'][_0x7785('0x6b')])return;_0x3bcc38[_0x7785('0x3e')](_0x7785('0x8a'));_0x5c5286[_0x7785('0x3e')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5c7829[_0x7785('0x8b')]['role']!==_0x7785('0x8c'))return;return _0x5c7829['user'][_0x7785('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x942c8e){if(_['isEmpty'](_0x942c8e)){_0x3bcc38[_0x7785('0x3e')]('i.WhatsappAccountId\x20IS\x20NULL');_0x5c5286['where']('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3bcc38[_0x7785('0x3e')](_0x7785('0x6c'),_[_0x7785('0x2c')](_0x942c8e,'id'));_0x5c5286['where'](_0x7785('0x6c'),_[_0x7785('0x2c')](_0x942c8e,'id'));}});})[_0x7785('0x26')](function(){if(_0x5c7829['user'][_0x7785('0x8e')]===_0x7785('0x8c')&&!_0x36f1a2&&!_0x5c7829['query']['WhatsappAccountId'])return[];return db[_0x7785('0x8f')]['query'](_0x3bcc38[_0x7785('0x90')](),_0x50be76);})[_0x7785('0x26')](function(_0x4773fd){_0x229826['count']=_0x4773fd[_0x7785('0x52')];if(_0x229826[_0x7785('0x21')]===0x0)return[];return db[_0x7785('0x8f')][_0x7785('0x35')](_0x4b2099[_0x7785('0x90')](),_0x50be76)[_0x7785('0x26')](function(_0x5c3557){_0x5a2d1b=_['keyBy'](_0x5c3557,'id');_0x50be76=_[_0x7785('0x91')](_0x50be76,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5c7829[_0x7785('0x35')][_0x7785('0x39')]){_0x51afe1[_0x7785('0x3a')][_0x7785('0x6a')](function(_0x51ac1d){_0x5c5286[_0x7785('0x41')]('i.'+_0x51ac1d);});}else{_0x5c5286[_0x7785('0x41')](_0x7785('0x85'),_0x7785('0x53'));_0x5c5286[_0x7785('0x41')](_0x7785('0x92'),_0x7785('0x93'));_0x5c5286[_0x7785('0x41')](_0x7785('0x94'),_0x7785('0x95'));_0x5c5286[_0x7785('0x41')]('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',_0x7785('0x86'));_0x5c5286[_0x7785('0x41')](_0x7785('0x96'));_0x5c5286[_0x7785('0x41')]('c.firstName',_0x7785('0x97'));_0x5c5286['field']('c.lastName','Contact.lastName');_0x5c5286[_0x7785('0x41')]('c.email',_0x7785('0x98'));_0x5c5286[_0x7785('0x41')]('c.phone',_0x7785('0x99'));_0x5c5286[_0x7785('0x41')](_0x7785('0x9a'),'Contact.mobile');_0x5c5286[_0x7785('0x41')]('c.fax',_0x7785('0x9b'));_0x5c5286[_0x7785('0x41')]('o.fullname',_0x7785('0x9c'));_0x5c5286[_0x7785('0x41')](_0x7785('0x9d'),'Owner.internal');_0x5c5286[_0x7785('0x41')](_0x7785('0x9e'),_0x7785('0x2d'));}if(_0x51afe1[_0x7785('0x20')])_0x5c5286[_0x7785('0x20')](_0x51afe1['limit']);if(_0x51afe1[_0x7785('0x1e')])_0x5c5286['offset'](_0x51afe1[_0x7785('0x1e')]);return db[_0x7785('0x8f')]['query'](_0x5c5286[_0x7785('0x90')](),_0x50be76);})[_0x7785('0x26')](function(_0x46a202){if(_0x46a202['length']>0x0)_0x3a6d60['where'](_0x7785('0x9f'),_[_0x7785('0x2c')](_0x46a202,'id'));return db['sequelize'][_0x7785('0x35')](_0x3a6d60[_0x7785('0x90')](),_0x50be76)['then'](function(_0x663462){var _0x3af97d=_[_0x7785('0xa0')](_0x663462,'WhatsappInteractionId');var _0xc68dbc=[];_0x46a202[_0x7785('0x6a')](function(_0x1a4573){_0xc68dbc['push'](updateWhatsappInteraction(_0x1a4573,_0x5a2d1b,_0x3af97d));});return BPromise[_0x7785('0xa1')](_0xc68dbc);});});})['then'](function(_0x46a5ae){_0x229826[_0x7785('0xa2')]=_0x46a5ae;return _0x229826;})['then'](respondWithFilteredResult(_0x243b38,_0x51afe1))[_0x7785('0x2f')](handleError(_0x243b38,null));};exports[_0x7785('0xa3')]=function(_0x581318,_0x50ba23){var _0x4bd982={'raw':![],'where':{'id':_0x581318['params']['id']}},_0x4255d2={};_0x4255d2[_0x7785('0x34')]=_[_0x7785('0x36')](db[_0x7785('0x30')][_0x7785('0x31')]);_0x4255d2[_0x7785('0x35')]=_[_0x7785('0x36')](_0x581318[_0x7785('0x35')]);_0x4255d2['filters']=_[_0x7785('0x38')](_0x4255d2[_0x7785('0x34')],_0x4255d2[_0x7785('0x35')]);_0x4bd982[_0x7785('0x3a')]=_[_0x7785('0x38')](_0x4255d2[_0x7785('0x34')],qs[_0x7785('0x39')](_0x581318[_0x7785('0x35')][_0x7785('0x39')]));_0x4bd982[_0x7785('0x3a')]=_0x4bd982[_0x7785('0x3a')][_0x7785('0x52')]?_0x4bd982[_0x7785('0x3a')]:_0x4255d2[_0x7785('0x34')];if(_0x581318['query'][_0x7785('0xa4')]){_0x4bd982[_0x7785('0xa5')]=[{'all':!![]}];}_0x4bd982=_[_0x7785('0x91')]({},_0x4bd982,_0x581318[_0x7785('0xa6')]);return db[_0x7785('0x30')]['find'](_0x4bd982)[_0x7785('0x26')](handleEntityNotFound(_0x50ba23,null))[_0x7785('0x26')](respondWithResult(_0x50ba23,null))[_0x7785('0x2f')](handleError(_0x50ba23,null));};exports['create']=function(_0x2b34d0,_0x5a2d0e){return db['WhatsappInteraction'][_0x7785('0xa7')](_0x2b34d0[_0x7785('0x68')],{})[_0x7785('0x26')](respondWithResult(_0x5a2d0e,0xc9))[_0x7785('0x2f')](handleError(_0x5a2d0e,null));};exports[_0x7785('0x25')]=function(_0x5f4afa,_0x2dc384){if(_0x5f4afa[_0x7785('0x68')]['id']){delete _0x5f4afa['body']['id'];}return db[_0x7785('0x30')][_0x7785('0x5b')]({'where':{'id':_0x5f4afa['params']['id']}})['then'](handleEntityNotFound(_0x2dc384,null))['then'](saveUpdates(_0x5f4afa[_0x7785('0x68')],null))[_0x7785('0x26')](respondWithResult(_0x2dc384,null))[_0x7785('0x2f')](handleError(_0x2dc384,null));};exports[_0x7785('0x27')]=function(_0x1d2ff7,_0x1bc7fb){return db[_0x7785('0x30')][_0x7785('0x5b')]({'where':{'id':_0x1d2ff7[_0x7785('0xa8')]['id']}})[_0x7785('0x26')](handleEntityNotFound(_0x1bc7fb,null))[_0x7785('0x26')](removeEntity(_0x1bc7fb,null))[_0x7785('0x2f')](handleError(_0x1bc7fb,null));};exports['describe']=function(_0x1efedb,_0x91144a){return db[_0x7785('0x30')]['describe']()[_0x7785('0x26')](respondWithResult(_0x91144a,null))[_0x7785('0x2f')](handleError(_0x91144a,null));};exports[_0x7785('0xa9')]=function(_0x4fafa0,_0x5684f6,_0x2fa665){return db[_0x7785('0xaa')]['find']({'where':{'id':_0x4fafa0['params']['id']}})[_0x7785('0x26')](handleEntityNotFound(_0x5684f6,null))[_0x7785('0x26')](function(_0x771c9){if(_0x771c9){return _0x771c9[_0x7785('0xa9')](_0x4fafa0[_0x7785('0x68')][_0x7785('0xab')],_[_0x7785('0xac')](_0x4fafa0[_0x7785('0x68')],['ids','id'])||{});}})['then'](respondWithResult(_0x5684f6,null))[_0x7785('0x2f')](handleError(_0x5684f6,null));};exports[_0x7785('0xad')]=function(_0x271577,_0x26ff88,_0x3c943b){var _0x19341f={'raw':![],'where':{}};var _0x43f1d1={};var _0x42de62={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x7785('0xae')]({'where':{'id':_0x271577[_0x7785('0xa8')]['id']}})[_0x7785('0x26')](handleEntityNotFound(_0x26ff88,null))['then'](function(_0x9b835f){if(_0x9b835f){_0x43f1d1[_0x7785('0x34')]=_[_0x7785('0x36')](db[_0x7785('0xaa')][_0x7785('0x31')]);_0x43f1d1[_0x7785('0x35')]=_[_0x7785('0x36')](_0x271577['query']);_0x43f1d1[_0x7785('0x37')]=_['intersection'](_0x43f1d1[_0x7785('0x34')],_0x43f1d1[_0x7785('0x35')]);_0x19341f[_0x7785('0x3a')]=_['intersection'](_0x43f1d1[_0x7785('0x34')],qs['fields'](_0x271577['query'][_0x7785('0x39')]));_0x19341f[_0x7785('0x3a')]=_0x19341f[_0x7785('0x3a')]['length']?_0x19341f[_0x7785('0x3a')]:_0x43f1d1[_0x7785('0x34')];if(!_0x271577[_0x7785('0x35')][_0x7785('0x3b')](_0x7785('0xaf'))){_0x19341f[_0x7785('0x20')]=qs['limit'](_0x271577[_0x7785('0x35')][_0x7785('0x20')]);_0x19341f[_0x7785('0x1e')]=qs[_0x7785('0x1e')](_0x271577[_0x7785('0x35')][_0x7785('0x1e')]);}_0x19341f['order']=qs[_0x7785('0x3d')](_0x271577[_0x7785('0x35')][_0x7785('0x3d')]);_0x19341f[_0x7785('0x3e')]=qs['filters'](_[_0x7785('0x3f')](_0x271577['query'],_0x43f1d1['filters']));_0x19341f[_0x7785('0x3e')][_0x7785('0xb0')]=_0x9b835f['id'];if(_0x271577[_0x7785('0x35')]['filter']){_0x19341f[_0x7785('0x3e')]=_['merge'](_0x19341f[_0x7785('0x3e')],{'$or':_[_0x7785('0x2c')](_0x19341f[_0x7785('0x3a')],function(_0x317f8a){var _0x4fece0={};_0x4fece0[_0x317f8a]={'$like':'%'+_0x271577[_0x7785('0x35')]['filter']+'%'};return _0x4fece0;})});}if(_0x271577[_0x7785('0x35')][_0x7785('0x6f')]){var _0xf90e9e=_0x271577[_0x7785('0x35')][_0x7785('0x6f')][_0x7785('0x59')](',');var _0x11dd26={};_0x11dd26[_0xf90e9e[0x0]]={'$gte':moment(_0xf90e9e[0x1])[_0x7785('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x19341f['where']=_['merge'](_0x19341f[_0x7785('0x3e')],_0x11dd26);}_0x19341f=_['merge']({},_0x19341f,_0x271577[_0x7785('0xa6')]);return db[_0x7785('0xaa')][_0x7785('0x21')]({'where':_0x19341f[_0x7785('0x3e')]})[_0x7785('0x26')](function(_0x195dc9){_0x42de62[_0x7785('0x21')]=_0x195dc9;if(_0x271577['query'][_0x7785('0xa4')]){_0x19341f['include']=[{'all':!![]}];}return db[_0x7785('0xaa')][_0x7785('0xb2')](_0x19341f);})[_0x7785('0x26')](function(_0x5a544b){_0x42de62[_0x7785('0xa2')]=_0x5a544b;return _0x42de62;});}})[_0x7785('0x26')](respondWithFilteredResult(_0x26ff88,_0x19341f))[_0x7785('0x2f')](handleError(_0x26ff88,null));};exports['addTags']=function(_0x5bb76f,_0x22d6f1,_0x1e145d){return db['WhatsappInteraction'][_0x7785('0x5b')]({'where':{'id':_0x5bb76f['params']['id']}})[_0x7785('0x26')](handleEntityNotFound(_0x22d6f1,null))[_0x7785('0x26')](function(_0x1ee108){if(_0x1ee108){return _0x1ee108['setTags'](_0x5bb76f[_0x7785('0x68')][_0x7785('0xab')],_[_0x7785('0xac')](_0x5bb76f[_0x7785('0x68')],['ids','id'])||{})[_0x7785('0xb3')](function(){return db[_0x7785('0x61')][_0x7785('0xb2')]({'attributes':['id',_0x7785('0x29'),_0x7785('0x42')],'where':{'id':_0x5bb76f[_0x7785('0x68')][_0x7785('0xab')]}});})[_0x7785('0x26')](function(_0x3985c3){socket['emit'](_0x7785('0xb4'),{'id':Number(_0x5bb76f[_0x7785('0xa8')]['id']),'tags':_0x3985c3||[]});return{'id':Number(_0x5bb76f[_0x7785('0xa8')]['id']),'tags':_0x3985c3||[]};});}})['then'](respondWithResult(_0x22d6f1,null))[_0x7785('0x2f')](handleError(_0x22d6f1,null));};exports[_0x7785('0xb5')]=function(_0x2fd29c,_0x80703,_0x359007){return db[_0x7785('0x30')]['find']({'where':{'id':_0x2fd29c[_0x7785('0xa8')]['id']}})['then'](handleEntityNotFound(_0x80703,null))[_0x7785('0x26')](function(_0x229c5b){if(_0x229c5b){return _0x229c5b['removeTags'](_0x2fd29c[_0x7785('0x35')][_0x7785('0xab')]);}})[_0x7785('0x26')](respondWithStatusCode(_0x80703,null))[_0x7785('0x2f')](handleError(_0x80703,null));};exports['download']=function(_0x4073e4,_0x462802){var _0x3ab420=moment()[_0x7785('0xb6')]()[_0x7785('0x90')]();var _0x4c6272=path['join'](config[_0x7785('0xb7')],_0x7785('0xb8'),_0x7785('0xb9'),'tmp');var _0x23d10c=path[_0x7785('0xba')](config['root'],'server',_0x7785('0xb9'),_0x7785('0xbb'));var _0x5c3c6f=path[_0x7785('0xba')](_0x4c6272,_0x3ab420);var _0x321d39=util[_0x7785('0xb1')](_0x7785('0xbc'),_0x4073e4[_0x7785('0xa8')]['id'],_0x3ab420);var _0x10dfcf=path[_0x7785('0xba')](_0x4c6272,_0x321d39);var _0x324950=[];_0x324950['push']({'model':db[_0x7785('0x64')],'as':'User','attributes':['id',_0x7785('0xbd')],'raw':!![]});_0x324950[_0x7785('0xbe')]({'model':db[_0x7785('0xbf')],'as':_0x7785('0x57'),'attributes':['id',_0x7785('0xc0'),'lastName'],'raw':!![]});if(_0x4073e4[_0x7785('0x35')]['attachments']){_0x324950[_0x7785('0xbe')]({'model':db[_0x7785('0xc1')],'as':_0x7785('0xc1'),'raw':!![]});}var _0x53dd39=[{'model':db[_0x7785('0xaa')],'as':_0x7785('0xc2'),'attributes':['id','body',_0x7785('0x6e'),'direction',_0x7785('0xc3'),_0x7785('0x75')],'include':_0x324950}];_0x53dd39[_0x7785('0xbe')]({'model':db['WhatsappAccount'],'as':_0x7785('0xc4'),'attributes':['id',_0x7785('0x29')]});_0x53dd39[_0x7785('0xbe')]({'model':db[_0x7785('0x64')],'as':_0x7785('0xc5'),'attributes':['id','fullname']});return db[_0x7785('0x30')][_0x7785('0x5b')]({'where':{'id':_0x4073e4[_0x7785('0xa8')]['id']},'include':_0x53dd39})[_0x7785('0x26')](handleEntityNotFound(_0x462802,null))[_0x7785('0x26')](function(_0x26cb31){if(_0x26cb31){var _0xed8460=_0x26cb31['get']({'plain':!![]});fs[_0x7785('0xc6')](_0x5c3c6f);var _0x3a5254={'channel':_0x7785('0xc7'),'account':_0xed8460[_0x7785('0xc4')][_0x7785('0x29')],'agent':_0xed8460[_0x7785('0xc5')]?_0xed8460[_0x7785('0xc5')][_0x7785('0xbd')]:_0x7785('0xc8'),'createdAt':moment(_0xed8460[_0x7785('0x6e')])[_0x7785('0xb1')](_0x7785('0xc9'))[_0x7785('0x90')](),'closedAt':_0xed8460[_0x7785('0xca')]?moment(_0xed8460[_0x7785('0xcb')])[_0x7785('0xb1')](_0x7785('0xc9'))['toString']():'','disposition':_0xed8460[_0x7785('0xcc')],'messages':_(_0xed8460[_0x7785('0xc2')])[_0x7785('0x7a')]({'secret':![]})[_0x7785('0x2c')](function(_0x4c94bd){if(_0x4c94bd[_0x7785('0xc1')]){var _0x412923=path[_0x7785('0xba')](_0x23d10c,_0x4c94bd[_0x7785('0xc1')]['basename']);if(fs[_0x7785('0xcd')](_0x412923)){fs[_0x7785('0xce')](_0x412923)[_0x7785('0xcf')](fs[_0x7785('0xd0')](path[_0x7785('0xba')](_0x5c3c6f,_0x4c94bd[_0x7785('0xc1')][_0x7785('0xd1')])));}}return{'date':moment(_0x4c94bd[_0x7785('0x6e')])[_0x7785('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x7785('0x90')](),'sender':_0x4c94bd[_0x7785('0xd2')]===_0x7785('0xd3')?_0x4c94bd[_0x7785('0x64')]?_0x4c94bd[_0x7785('0x64')][_0x7785('0xbd')]:_0x7785('0xd4'):_0x4c94bd[_0x7785('0x57')][_0x7785('0xc0')]+(_0x4c94bd[_0x7785('0x57')][_0x7785('0xd5')]?'\x20'+_0x4c94bd[_0x7785('0x57')][_0x7785('0xd5')]:''),'body':_0x4c94bd['Attachment']?_0x4c94bd[_0x7785('0xc1')][_0x7785('0xd1')]:_0x4c94bd[_0x7785('0x68')],'direction':_0x4c94bd['direction']===_0x7785('0xd3')?'A':'C','secret':_0x4c94bd['secret'],'read':_0x4c94bd[_0x7785('0x75')],'attachment':_0x4c94bd[_0x7785('0xc1')]};})['value']()};return ejs[_0x7785('0xd6')](path['join'](config['root'],_0x7785('0xb8'),_0x7785('0xd7'),'downloadInteraction.ejs'),{'interaction':_0x3a5254})[_0x7785('0x26')](function(_0x1ff37a){var _0x1ea0c8=path[_0x7785('0xba')](_0x5c3c6f,_0x7785('0xd8')+_0xed8460['id']+'-'+_0x3ab420+_0x7785('0xd9'));var _0x8d25dd={'path':_0x1ea0c8,'channel':_0x7785('0xc7'),'interactionId':_0xed8460['id']};return pdf['createPdfFromHTML'](_0x1ff37a,_0x8d25dd);})[_0x7785('0x26')](function(){return new BPromise(function(_0x50fea2,_0x320fed){zipdir(_0x5c3c6f,{'saveTo':_0x10dfcf},function(_0x1cba38,_0x82d729){if(_0x1cba38)return _0x320fed(_0x1cba38);return _0x50fea2(_0x82d729);});})[_0x7785('0x26')](function(){return new BPromise(function(_0x445923,_0x27dd25){rimraf(_0x5c3c6f,function(_0x3a8c09){if(_0x3a8c09)_0x27dd25(_0x3a8c09);return _0x445923();});});})[_0x7785('0x26')](function(){return _0x462802[_0x7785('0xda')](_0x10dfcf,_0x321d39,function(_0x131497){if(_0x131497){console[_0x7785('0xdb')]('err',_0x131497);}else{fs[_0x7785('0xdc')](_0x10dfcf);}});});});}else{return _0x462802[_0x7785('0x1b')](0xc8);}})[_0x7785('0x2f')](handleError(_0x462802,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 846f356..338f1ba 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 _0x2c1b=['setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x2ccf68,_0x1d41df){var _0x2793f7=function(_0x3351af){while(--_0x3351af){_0x2ccf68['push'](_0x2ccf68['shift']());}};_0x2793f7(++_0x1d41df);}(_0x2c1b,0xb0));var _0xb2c1=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x2c1b[_0x2261ce];return _0x524640;};'use strict';var EventEmitter=require(_0xb2c1('0x0'));var WhatsappInteraction=require(_0xb2c1('0x1'))['db'][_0xb2c1('0x2')];var WhatsappMessage=require(_0xb2c1('0x1'))['db'][_0xb2c1('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb2c1('0x4')](0x0);var events={'afterCreate':_0xb2c1('0x5'),'afterUpdate':'update','afterDestroy':_0xb2c1('0x6')};function emitEvent(_0x3ed884){return function(_0x40302d,_0x362abe,_0x42b565){_0x40302d[_0xb2c1('0x7')]({'attributes':['id'],'raw':!![]})[_0xb2c1('0x8')](function(_0x42308a){_0x40302d[_0xb2c1('0x9')](_0xb2c1('0xa'),_0x42308a['map'](function(_0x564bcb){return{'id':_0x564bcb['id']};}));return WhatsappMessage[_0xb2c1('0xb')]({'where':{'WhatsappInteractionId':_0x40302d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb2c1('0x8')](function(_0x33b6ae){_0x40302d[_0xb2c1('0x9')](_0xb2c1('0xc'),_0x33b6ae[_0xb2c1('0xd')]);WhatsappInteractionEvents[_0xb2c1('0xe')](_0x3ed884+':'+_0x40302d['id'],_0x40302d);WhatsappInteractionEvents[_0xb2c1('0xe')](_0x3ed884,_0x40302d);_0x42b565(null);})['catch'](_0x42b565(null));};}for(var e in events){if(events[_0xb2c1('0xf')](e)){var event=events[e];WhatsappInteraction[_0xb2c1('0x10')](e,emitEvent(event));}}module[_0xb2c1('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xb544=['WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','map','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x4d11bf,_0x3cbfd0){var _0x54aaad=function(_0x55396e){while(--_0x55396e){_0x4d11bf['push'](_0x4d11bf['shift']());}};_0x54aaad(++_0x3cbfd0);}(_0xb544,0xd0));var _0x4b54=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xb544[_0x4d613c];return _0x301fe3;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x4b54('0x0')];var WhatsappMessage=require(_0x4b54('0x1'))['db'][_0x4b54('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x4b54('0x3')](0x0);var events={'afterCreate':_0x4b54('0x4'),'afterUpdate':_0x4b54('0x5'),'afterDestroy':_0x4b54('0x6')};function emitEvent(_0x192cc1){return function(_0x4e75e5,_0x56747e,_0x5c5c8f){_0x4e75e5['getUsers']({'attributes':['id'],'raw':!![]})[_0x4b54('0x7')](function(_0x513b8f){_0x4e75e5[_0x4b54('0x8')]('Users',_0x513b8f[_0x4b54('0x9')](function(_0x3452e1){return{'id':_0x3452e1['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4e75e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b54('0x7')](function(_0x15fb11){_0x4e75e5[_0x4b54('0x8')](_0x4b54('0xa'),_0x15fb11[_0x4b54('0xb')]);WhatsappInteractionEvents[_0x4b54('0xc')](_0x192cc1+':'+_0x4e75e5['id'],_0x4e75e5);WhatsappInteractionEvents[_0x4b54('0xc')](_0x192cc1,_0x4e75e5);_0x5c5c8f(null);})['catch'](_0x5c5c8f(null));};}for(var e in events){if(events[_0x4b54('0xd')](e)){var event=events[e];WhatsappInteraction[_0x4b54('0xe')](e,emitEvent(event));}}module[_0x4b54('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 25ed9c4..c06f260 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 _0x523a=['api','moment','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','util'];(function(_0xdcca54,_0x4b2b61){var _0x453197=function(_0x806f6a){while(--_0x806f6a){_0xdcca54['push'](_0xdcca54['shift']());}};_0x453197(++_0x4b2b61);}(_0x523a,0x1bf));var _0xa523=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x523a[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0xa523('0x0'));var logger=require('../../config/logger')(_0xa523('0x1'));var moment=require(_0xa523('0x2'));var BPromise=require('bluebird');var rp=require(_0xa523('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa523('0x4'));var config=require(_0xa523('0x5'));var attributes=require(_0xa523('0x6'));module['exports']=function(_0x3bf65e,_0x3e4510){return _0x3bf65e[_0xa523('0x7')](_0xa523('0x8'),attributes,{'tableName':_0xa523('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd0b139,_0x37b51d,_0xc14d01){if(_0xd0b139[_0xa523('0xa')](_0xa523('0xb'))){_0xd0b139[_0xa523('0xc')]=moment()[_0xa523('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc14d01(null,_0xd0b139);}}});}; \ No newline at end of file +var _0x9e59=['rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5240ab,_0x5b8fc9){var _0x337c85=function(_0x304750){while(--_0x304750){_0x5240ab['push'](_0x5240ab['shift']());}};_0x337c85(++_0x5b8fc9);}(_0x9e59,0x1da));var _0x99e5=function(_0x264538,_0x3aae17){_0x264538=_0x264538-0x0;var _0x3f881d=_0x9e59[_0x264538];return _0x3f881d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x99e5('0x0'))(_0x99e5('0x1'));var moment=require(_0x99e5('0x2'));var BPromise=require(_0x99e5('0x3'));var rp=require(_0x99e5('0x4'));var fs=require('fs');var path=require(_0x99e5('0x5'));var rimraf=require(_0x99e5('0x6'));var config=require(_0x99e5('0x7'));var attributes=require(_0x99e5('0x8'));module['exports']=function(_0x258198,_0x198dcb){return _0x258198[_0x99e5('0x9')](_0x99e5('0xa'),attributes,{'tableName':_0x99e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6feb16,_0x29f360,_0x35cefb){if(_0x6feb16['changed']('closed')){_0x6feb16[_0x99e5('0xc')]=moment()[_0x99e5('0xd')](_0x99e5('0xe'));}_0x35cefb(null,_0x6feb16);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 1c1248e..57a1a03 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 _0x637a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','find','addTags','omit','AddTags','util','moment'];(function(_0x519c17,_0x5d6701){var _0x2c7115=function(_0x454480){while(--_0x454480){_0x519c17['push'](_0x519c17['shift']());}};_0x2c7115(++_0x5d6701);}(_0x637a,0x1b6));var _0xa637=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x637a[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xa637('0x0'));var moment=require(_0xa637('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa637('0x2'));var db=require(_0xa637('0x3'))['db'];var utils=require(_0xa637('0x4'));var logger=require('../../config/logger')(_0xa637('0x5'));var config=require(_0xa637('0x6'));var jayson=require(_0xa637('0x7'));var client=jayson[_0xa637('0x8')][_0xa637('0x9')]({'port':0x232a});config[_0xa637('0xa')]=_[_0xa637('0xb')](config[_0xa637('0xa')],{'host':_0xa637('0xc'),'port':0x18eb});var socket=require(_0xa637('0xd'))(new Redis(config[_0xa637('0xa')]));require(_0xa637('0xe'))['register'](socket);function respondWithRpcPromise(_0x169c7e,_0x56dd6a,_0x3d2949){return new BPromise(function(_0x5843d,_0x114b1c){return client[_0xa637('0xf')](_0x169c7e,_0x3d2949)[_0xa637('0x10')](function(_0x232ce5){logger['info'](_0xa637('0x11'),_0x56dd6a,_0xa637('0x12'));logger[_0xa637('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x56dd6a,_0xa637('0x12'),JSON['stringify'](_0x232ce5));if(_0x232ce5[_0xa637('0x14')]){if(_0x232ce5[_0xa637('0x14')][_0xa637('0x15')]===0x1f4){logger['error'](_0xa637('0x11'),_0x56dd6a,_0x232ce5['error'][_0xa637('0x16')]);return _0x114b1c(_0x232ce5[_0xa637('0x14')][_0xa637('0x16')]);}logger[_0xa637('0x14')](_0xa637('0x11'),_0x56dd6a,_0x232ce5[_0xa637('0x14')][_0xa637('0x16')]);return _0x5843d(_0x232ce5[_0xa637('0x14')][_0xa637('0x16')]);}else{logger[_0xa637('0x17')](_0xa637('0x11'),_0x56dd6a,_0xa637('0x12'));_0x5843d(_0x232ce5[_0xa637('0x18')][_0xa637('0x16')]);}})[_0xa637('0x19')](function(_0x2f6e5e){logger[_0xa637('0x14')](_0xa637('0x11'),_0x56dd6a,_0x2f6e5e);_0x114b1c(_0x2f6e5e);});});}exports[_0xa637('0x1a')]=function(_0x58c61f){var _0x390a9c=this;return new Promise(function(_0x525794,_0x56b355){return db[_0xa637('0x1b')][_0xa637('0x1c')](_0x58c61f[_0xa637('0x1d')],{'raw':_0x58c61f['options']?_0x58c61f[_0xa637('0x1e')][_0xa637('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58c61f['options']?_0x58c61f[_0xa637('0x1e')][_0xa637('0x20')]||null:null,'attributes':_0x58c61f[_0xa637('0x1e')]?_0x58c61f[_0xa637('0x1e')][_0xa637('0x21')]||null:null,'limit':_0x58c61f[_0xa637('0x1e')]?_0x58c61f[_0xa637('0x1e')][_0xa637('0x22')]||null:null})[_0xa637('0x10')](function(_0x105164){logger['info'](_0xa637('0x1a'),_0x58c61f);logger['debug'](_0xa637('0x1a'),_0x58c61f,JSON[_0xa637('0x23')](_0x105164));_0x525794(_0x105164);})['catch'](function(_0x11ce00){logger[_0xa637('0x14')](_0xa637('0x1a'),_0x11ce00[_0xa637('0x16')],_0x58c61f);_0x56b355(_0x390a9c['error'](0x1f4,_0x11ce00[_0xa637('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x56102c){return new Promise(function(_0x32efd8,_0x1fd3be){return db[_0xa637('0x1b')][_0xa637('0x24')]({'where':_0x56102c[_0xa637('0x1e')]?_0x56102c[_0xa637('0x1e')][_0xa637('0x20')]||null:null})[_0xa637('0x10')](function(_0x5ad2d6){if(_0x5ad2d6){return _0x5ad2d6[_0xa637('0x25')](_0x56102c[_0xa637('0x1d')]['ids'],_[_0xa637('0x26')](_0x56102c[_0xa637('0x1d')],['ids','id'])||{});}})['spread'](function(_0x1d45b0){logger[_0xa637('0x17')](_0xa637('0x27'),_0x56102c);logger[_0xa637('0x13')](_0xa637('0x27'),_0x56102c,JSON[_0xa637('0x23')](_0x1d45b0));_0x32efd8(_0x1d45b0);})[_0xa637('0x19')](function(_0x2c8aa3){logger[_0xa637('0x14')](_0xa637('0x27'),_0x2c8aa3['message'],_0x56102c);_0x1fd3be(_this[_0xa637('0x14')](0x1f4,_0x2c8aa3['message']));});});}; \ No newline at end of file +var _0x24a7=['WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info'];(function(_0x220f04,_0x3286a5){var _0x5f2218=function(_0x49f1b4){while(--_0x49f1b4){_0x220f04['push'](_0x220f04['shift']());}};_0x5f2218(++_0x3286a5);}(_0x24a7,0xea));var _0x724a=function(_0x4705e0,_0x452e05){_0x4705e0=_0x4705e0-0x0;var _0x1ec1ba=_0x24a7[_0x4705e0];return _0x1ec1ba;};'use strict';var _=require(_0x724a('0x0'));var util=require('util');var moment=require(_0x724a('0x1'));var BPromise=require(_0x724a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x724a('0x3'));var logger=require(_0x724a('0x4'))(_0x724a('0x5'));var config=require('../../config/environment');var jayson=require(_0x724a('0x6'));var client=jayson[_0x724a('0x7')][_0x724a('0x8')]({'port':0x232a});config[_0x724a('0x9')]=_[_0x724a('0xa')](config[_0x724a('0x9')],{'host':_0x724a('0xb'),'port':0x18eb});var socket=require(_0x724a('0xc'))(new Redis(config[_0x724a('0x9')]));require(_0x724a('0xd'))[_0x724a('0xe')](socket);function respondWithRpcPromise(_0x5c3ad1,_0x26672d,_0x3c86f7){return new BPromise(function(_0x594b43,_0x37e477){return client[_0x724a('0xf')](_0x5c3ad1,_0x3c86f7)[_0x724a('0x10')](function(_0x6a6fe6){logger[_0x724a('0x11')](_0x724a('0x12'),_0x26672d,'request\x20sent');logger[_0x724a('0x13')](_0x724a('0x14'),_0x26672d,_0x724a('0x15'),JSON[_0x724a('0x16')](_0x6a6fe6));if(_0x6a6fe6[_0x724a('0x17')]){if(_0x6a6fe6[_0x724a('0x17')][_0x724a('0x18')]===0x1f4){logger[_0x724a('0x17')](_0x724a('0x12'),_0x26672d,_0x6a6fe6[_0x724a('0x17')][_0x724a('0x19')]);return _0x37e477(_0x6a6fe6[_0x724a('0x17')][_0x724a('0x19')]);}logger[_0x724a('0x17')](_0x724a('0x12'),_0x26672d,_0x6a6fe6[_0x724a('0x17')]['message']);return _0x594b43(_0x6a6fe6[_0x724a('0x17')][_0x724a('0x19')]);}else{logger['info'](_0x724a('0x12'),_0x26672d,_0x724a('0x15'));_0x594b43(_0x6a6fe6['result'][_0x724a('0x19')]);}})[_0x724a('0x1a')](function(_0x55d786){logger['error'](_0x724a('0x12'),_0x26672d,_0x55d786);_0x37e477(_0x55d786);});});}exports[_0x724a('0x1b')]=function(_0x1d380c){var _0x4fbaa6=this;return new Promise(function(_0x3b6204,_0x3aeca5){return db['WhatsappInteraction'][_0x724a('0x1c')](_0x1d380c[_0x724a('0x1d')],{'raw':_0x1d380c[_0x724a('0x1e')]?_0x1d380c['options'][_0x724a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d380c[_0x724a('0x1e')]?_0x1d380c[_0x724a('0x1e')][_0x724a('0x20')]||null:null,'attributes':_0x1d380c['options']?_0x1d380c['options'][_0x724a('0x21')]||null:null,'limit':_0x1d380c[_0x724a('0x1e')]?_0x1d380c['options'][_0x724a('0x22')]||null:null})[_0x724a('0x10')](function(_0x142616){logger[_0x724a('0x11')](_0x724a('0x1b'),_0x1d380c);logger[_0x724a('0x13')](_0x724a('0x1b'),_0x1d380c,JSON[_0x724a('0x16')](_0x142616));_0x3b6204(_0x142616);})['catch'](function(_0x324690){logger[_0x724a('0x17')](_0x724a('0x1b'),_0x324690[_0x724a('0x19')],_0x1d380c);_0x3aeca5(_0x4fbaa6['error'](0x1f4,_0x324690['message']));});});};exports[_0x724a('0x23')]=function(_0x36be21){return new Promise(function(_0xd36584,_0x4c1467){return db[_0x724a('0x24')][_0x724a('0x25')]({'where':_0x36be21[_0x724a('0x1e')]?_0x36be21[_0x724a('0x1e')][_0x724a('0x20')]||null:null})[_0x724a('0x10')](function(_0x42e0a6){if(_0x42e0a6){return _0x42e0a6['addTags'](_0x36be21['body'][_0x724a('0x26')],_[_0x724a('0x27')](_0x36be21[_0x724a('0x1d')],[_0x724a('0x26'),'id'])||{});}})[_0x724a('0x28')](function(_0x425dc4){logger[_0x724a('0x11')]('AddTags',_0x36be21);logger['debug'](_0x724a('0x29'),_0x36be21,JSON[_0x724a('0x16')](_0x425dc4));_0xd36584(_0x425dc4);})[_0x724a('0x1a')](function(_0x4c5844){logger[_0x724a('0x17')](_0x724a('0x29'),_0x4c5844['message'],_0x36be21);_0x4c1467(_this[_0x724a('0x17')](0x1f4,_0x4c5844[_0x724a('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 94871c2..5c26f74 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 _0x80a6=['whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','length'];(function(_0x3a215d,_0xe95341){var _0xa17db=function(_0x2fd666){while(--_0x2fd666){_0x3a215d['push'](_0x3a215d['shift']());}};_0xa17db(++_0xe95341);}(_0x80a6,0x151));var _0x680a=function(_0x18840e,_0x2151a8){_0x18840e=_0x18840e-0x0;var _0x1f0c85=_0x80a6[_0x18840e];return _0x1f0c85;};'use strict';var WhatsappInteractionEvents=require(_0x680a('0x0'));var events=[_0x680a('0x1'),_0x680a('0x2'),_0x680a('0x3')];function createListener(_0x42aa63,_0x2065f8){return function(_0x4bd146){_0x2065f8[_0x680a('0x4')](_0x42aa63,_0x4bd146);};}function removeListener(_0xd21b9c,_0x2e1be0){return function(){WhatsappInteractionEvents['removeListener'](_0xd21b9c,_0x2e1be0);};}exports['register']=function(_0x317542){for(var _0x2be3a1=0x0,_0x479d07=events[_0x680a('0x5')];_0x2be3a1<_0x479d07;_0x2be3a1++){var _0x3c76ff=events[_0x2be3a1];var _0x31b0f5=createListener(_0x680a('0x6')+_0x3c76ff,_0x317542);WhatsappInteractionEvents['on'](_0x3c76ff,_0x31b0f5);}}; \ No newline at end of file +var _0x1fc2=['register','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x301d70,_0x58eb08){var _0x269b8b=function(_0x4b6bc0){while(--_0x4b6bc0){_0x301d70['push'](_0x301d70['shift']());}};_0x269b8b(++_0x58eb08);}(_0x1fc2,0x1e2));var _0x21fc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1fc2[_0x57b54c];return _0x59cc19;};'use strict';var WhatsappInteractionEvents=require(_0x21fc('0x0'));var events=['save',_0x21fc('0x1'),'update'];function createListener(_0x56e171,_0x2eeea1){return function(_0x32cabf){_0x2eeea1['emit'](_0x56e171,_0x32cabf);};}function removeListener(_0x3f2ace,_0x46cb68){return function(){WhatsappInteractionEvents['removeListener'](_0x3f2ace,_0x46cb68);};}exports[_0x21fc('0x2')]=function(_0x3ee080){for(var _0x283b2c=0x0,_0x4eac2e=events['length'];_0x283b2c<_0x4eac2e;_0x283b2c++){var _0x2afe1f=events[_0x283b2c];var _0x50809d=createListener(_0x21fc('0x3')+_0x2afe1f,_0x3ee080);WhatsappInteractionEvents['on'](_0x2afe1f,_0x50809d);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 1c56bcf..a9fc04d 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 _0x07a4=['Router','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','show','tracked','whatsappmessage:create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x2963be,_0x881947){var _0x3b748c=function(_0xdfd776){while(--_0xdfd776){_0x2963be['push'](_0x2963be['shift']());}};_0x3b748c(++_0x881947);}(_0x07a4,0x1f1));var _0x407a=function(_0x1736c9,_0x2ad0da){_0x1736c9=_0x1736c9-0x0;var _0x536a5d=_0x07a4[_0x1736c9];return _0x536a5d;};'use strict';var multer=require(_0x407a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x407a('0x1'));var express=require(_0x407a('0x2'));var router=express[_0x407a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x407a('0x4'));var controller=require(_0x407a('0x5'));router[_0x407a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x407a('0x6')](_0x407a('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x407a('0x6')]('/:id',auth[_0x407a('0x8')](),controller[_0x407a('0x9')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x407a('0xa')]('whatsapp',_0x407a('0xb')),controller['create']);router[_0x407a('0xc')](_0x407a('0xd'),controller[_0x407a('0xe')]);router[_0x407a('0xf')](_0x407a('0x10'),auth[_0x407a('0x8')](),controller[_0x407a('0x11')]);router[_0x407a('0xf')](_0x407a('0x12'),auth[_0x407a('0x8')](),controller[_0x407a('0x13')]);router['put'](_0x407a('0x14'),auth['isAuthenticated'](),controller[_0x407a('0x15')]);router[_0x407a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x407a('0x17')]);module[_0x407a('0x18')]=router; \ No newline at end of file +var _0x33be=['/:id/status','status','put','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','tracked','whatsapp','whatsappmessage:create'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x33be,0x94));var _0xe33b=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x33be[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0xe33b('0x0'));var util=require(_0xe33b('0x1'));var path=require(_0xe33b('0x2'));var timeout=require(_0xe33b('0x3'));var express=require('express');var router=express[_0xe33b('0x4')]();var fs_extra=require(_0xe33b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe33b('0x6'));var config=require(_0xe33b('0x7'));var controller=require(_0xe33b('0x8'));router[_0xe33b('0x9')]('/',auth['isAuthenticated'](),controller[_0xe33b('0xa')]);router[_0xe33b('0x9')](_0xe33b('0xb'),auth['isAuthenticated'](),controller[_0xe33b('0xc')]);router['get'](_0xe33b('0xd'),auth[_0xe33b('0xe')](),controller[_0xe33b('0xf')]);router[_0xe33b('0x10')]('/',auth[_0xe33b('0xe')](),interaction[_0xe33b('0x11')](_0xe33b('0x12'),_0xe33b('0x13')),controller['create']);router[_0xe33b('0x10')](_0xe33b('0x14'),controller[_0xe33b('0x15')]);router['put']('/:id',auth[_0xe33b('0xe')](),controller['update']);router[_0xe33b('0x16')]('/:id/accept',auth[_0xe33b('0xe')](),controller['accept']);router['put'](_0xe33b('0x17'),auth[_0xe33b('0xe')](),controller[_0xe33b('0x18')]);router[_0xe33b('0x19')]('/:id',auth[_0xe33b('0xe')](),controller[_0xe33b('0x1a')]);module[_0xe33b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 7ae060e..4114a80 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 _0xb71c=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x33e356,_0x599fcf){var _0x175eff=function(_0x4cdeb5){while(--_0x4cdeb5){_0x33e356['push'](_0x33e356['shift']());}};_0x175eff(++_0x599fcf);}(_0xb71c,0x151));var _0xcb71=function(_0x3894b4,_0x3aa267){_0x3894b4=_0x3894b4-0x0;var _0x2db26b=_0xb71c[_0x3894b4];return _0x2db26b;};'use strict';var Sequelize=require(_0xcb71('0x0'));module[_0xcb71('0x1')]={'body':{'type':Sequelize[_0xcb71('0x2')](_0xcb71('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcb71('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcb71('0x5')]('in',_0xcb71('0x6')),'defaultValue':_0xcb71('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcb71('0x7')](0xbe)},'phone':{'type':Sequelize[_0xcb71('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xcb71('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcb71('0x7')]},'providerResponse':{'type':Sequelize[_0xcb71('0x2')]}}; \ No newline at end of file +var _0x891b=['BOOLEAN','TEXT','medium','ENUM','out','STRING','DATE'];(function(_0x3aa641,_0x14153e){var _0x4aa0f4=function(_0x44ceb3){while(--_0x44ceb3){_0x3aa641['push'](_0x3aa641['shift']());}};_0x4aa0f4(++_0x14153e);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb891('0x0')](_0xb891('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xb891('0x2')]('in',_0xb891('0x3')),'defaultValue':_0xb891('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb891('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xb891('0x5')]},'secret':{'type':Sequelize[_0xb891('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb891('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 296ed0f..34c5d25 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 _0xb9ee=['sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','whatsapp','params','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','end','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','create','body','find','describe','whatsapp-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null'];(function(_0x4edb68,_0x58a318){var _0x1449f8=function(_0x4dcbd4){while(--_0x4dcbd4){_0x4edb68['push'](_0x4edb68['shift']());}};_0x1449f8(++_0x58a318);}(_0xb9ee,0x12d));var _0xeb9e=function(_0x475dce,_0x1754ff){_0x475dce=_0x475dce-0x0;var _0x40687a=_0xb9ee[_0x475dce];return _0x40687a;};'use strict';var emlformat=require(_0xeb9e('0x0'));var rimraf=require(_0xeb9e('0x1'));var zipdir=require(_0xeb9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb9e('0x3'));var moment=require(_0xeb9e('0x4'));var BPromise=require(_0xeb9e('0x5'));var Mustache=require(_0xeb9e('0x6'));var util=require(_0xeb9e('0x7'));var path=require('path');var sox=require(_0xeb9e('0x8'));var csv=require(_0xeb9e('0x9'));var ejs=require(_0xeb9e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb9e('0xb'));var squel=require(_0xeb9e('0xc'));var crypto=require(_0xeb9e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeb9e('0xe'));var toCsv=require(_0xeb9e('0x9'));var querystring=require(_0xeb9e('0xf'));var Papa=require(_0xeb9e('0x10'));var Redis=require(_0xeb9e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xeb9e('0x12'));var as=require(_0xeb9e('0x13'));var hardwareService=require(_0xeb9e('0x14'));var logger=require(_0xeb9e('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeb9e('0x16'));var db=require(_0xeb9e('0x17'))['db'];config[_0xeb9e('0x18')]=_[_0xeb9e('0x19')](config[_0xeb9e('0x18')],{'host':_0xeb9e('0x1a'),'port':0x18eb});var socket=require(_0xeb9e('0x1b'))(new Redis(config['redis']));require(_0xeb9e('0x1c'))[_0xeb9e('0x1d')](socket);var jayson=require(_0xeb9e('0x1e'));var client=jayson[_0xeb9e('0x1f')][_0xeb9e('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f98e3,_0x31bccf,_0x22bb58,_0x1dee71){return new BPromise(function(_0x46f9a0,_0x349a36){var _0x2b43b0=_0x1dee71||client;return _0x2b43b0[_0xeb9e('0x21')](_0x1f98e3,_0x22bb58)[_0xeb9e('0x22')](function(_0x33bc15){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x31bccf,_0xeb9e('0x23'));logger[_0xeb9e('0x24')](_0xeb9e('0x25'),_0x31bccf,_0xeb9e('0x23'),JSON[_0xeb9e('0x26')](_0x33bc15));if(_0x33bc15[_0xeb9e('0x27')]){if(_0x33bc15[_0xeb9e('0x27')]['code']===0x1f4){logger[_0xeb9e('0x27')](_0xeb9e('0x28'),_0x31bccf,_0x33bc15['error'][_0xeb9e('0x29')]);return _0x349a36(_0x33bc15[_0xeb9e('0x27')][_0xeb9e('0x29')]);}logger['error'](_0xeb9e('0x28'),_0x31bccf,_0x33bc15[_0xeb9e('0x27')][_0xeb9e('0x29')]);return _0x46f9a0(_0x33bc15[_0xeb9e('0x27')][_0xeb9e('0x29')]);}else{logger[_0xeb9e('0x2a')](_0xeb9e('0x28'),_0x31bccf,_0xeb9e('0x23'));_0x46f9a0(_0x33bc15['result'][_0xeb9e('0x29')]);}})[_0xeb9e('0x2b')](function(_0x224165){logger[_0xeb9e('0x27')](_0xeb9e('0x28'),_0x31bccf,_0x224165);_0x349a36(_0x224165);});});}function respondWithStatusCode(_0x3e79c5,_0x2bb01d){_0x2bb01d=_0x2bb01d||0xcc;return function(_0x368517){if(_0x368517){return _0x3e79c5[_0xeb9e('0x2c')](_0x2bb01d);}return _0x3e79c5[_0xeb9e('0x2d')](_0x2bb01d)['end']();};}function respondWithResult(_0x1b85c1,_0x3aae51){_0x3aae51=_0x3aae51||0xc8;return function(_0x5010ae){if(_0x5010ae){return _0x1b85c1[_0xeb9e('0x2d')](_0x3aae51)[_0xeb9e('0x2e')](_0x5010ae);}};}function respondWithFilteredResult(_0x10ceec,_0x29d9ff){return function(_0x1bc1de){if(_0x1bc1de){var _0xb452f2=typeof _0x29d9ff[_0xeb9e('0x2f')]===_0xeb9e('0x30')&&typeof _0x29d9ff[_0xeb9e('0x31')]==='undefined';var _0x1920b6=_0x1bc1de[_0xeb9e('0x32')];var _0x2c77a5=_0xb452f2?0x0:_0x29d9ff[_0xeb9e('0x2f')];var _0x15530a=_0xb452f2?_0x1bc1de['count']:_0x29d9ff['offset']+_0x29d9ff['limit'];var _0x541dc8;if(_0x15530a>=_0x1920b6){_0x15530a=_0x1920b6;_0x541dc8=0xc8;}else{_0x541dc8=0xce;}_0x10ceec[_0xeb9e('0x2d')](_0x541dc8);return _0x10ceec[_0xeb9e('0x33')]('Content-Range',_0x2c77a5+'-'+_0x15530a+'/'+_0x1920b6)['json'](_0x1bc1de);}return null;};}function patchUpdates(_0x117585){return function(_0x465392){try{jsonpatch[_0xeb9e('0x34')](_0x465392,_0x117585,!![]);}catch(_0xfbdcda){return BPromise['reject'](_0xfbdcda);}return _0x465392[_0xeb9e('0x35')]();};}function saveUpdates(_0x40801e,_0x9791dd){return function(_0x43278d){if(_0x43278d){return _0x43278d[_0xeb9e('0x36')](_0x40801e)[_0xeb9e('0x22')](function(_0x49935d){return _0x49935d;});}return null;};}function removeEntity(_0x5be91e,_0x4d6be3){return function(_0x2402e7){if(_0x2402e7){return _0x2402e7['destroy']()[_0xeb9e('0x22')](function(){_0x5be91e['status'](0xcc)[_0xeb9e('0x37')]();});}};}function handleEntityNotFound(_0x266d5d,_0x48d1d0){return function(_0xfa5e0a){if(!_0xfa5e0a){_0x266d5d[_0xeb9e('0x2c')](0x194);}return _0xfa5e0a;};}function handleError(_0x5db995,_0x24aa67){_0x24aa67=_0x24aa67||0x1f4;return function(_0x92f7c9){logger[_0xeb9e('0x27')](_0x92f7c9['stack']);if(_0x92f7c9[_0xeb9e('0x38')]){delete _0x92f7c9[_0xeb9e('0x38')];}_0x5db995[_0xeb9e('0x2d')](_0x24aa67)[_0xeb9e('0x39')](_0x92f7c9);};}exports['index']=function(_0x441e85,_0x3ccc3c){var _0x144f8a={},_0x97a58c={},_0x2af5b4={'count':0x0,'rows':[]};var _0x430306=_[_0xeb9e('0x3a')](db[_0xeb9e('0x3b')][_0xeb9e('0x3c')],function(_0x1bd453){return{'name':_0x1bd453[_0xeb9e('0x3d')],'type':_0x1bd453[_0xeb9e('0x3e')][_0xeb9e('0x3f')]};});_0x97a58c[_0xeb9e('0x40')]=_[_0xeb9e('0x3a')](_0x430306,'name');_0x97a58c[_0xeb9e('0x41')]=_[_0xeb9e('0x42')](_0x441e85[_0xeb9e('0x41')]);_0x97a58c['filters']=_[_0xeb9e('0x43')](_0x97a58c['model'],_0x97a58c[_0xeb9e('0x41')]);_0x144f8a['attributes']=_[_0xeb9e('0x43')](_0x97a58c[_0xeb9e('0x40')],qs[_0xeb9e('0x44')](_0x441e85['query'][_0xeb9e('0x44')]));_0x144f8a[_0xeb9e('0x45')]=_0x144f8a[_0xeb9e('0x45')][_0xeb9e('0x46')]?_0x144f8a['attributes']:_0x97a58c[_0xeb9e('0x40')];if(!_0x441e85['query'][_0xeb9e('0x47')](_0xeb9e('0x48'))){_0x144f8a[_0xeb9e('0x31')]=qs[_0xeb9e('0x31')](_0x441e85[_0xeb9e('0x41')][_0xeb9e('0x31')]);_0x144f8a[_0xeb9e('0x2f')]=qs[_0xeb9e('0x2f')](_0x441e85[_0xeb9e('0x41')]['offset']);}_0x144f8a[_0xeb9e('0x49')]=qs[_0xeb9e('0x4a')](_0x441e85[_0xeb9e('0x41')][_0xeb9e('0x4a')]);_0x144f8a['where']=qs[_0xeb9e('0x4b')](_[_0xeb9e('0x4c')](_0x441e85[_0xeb9e('0x41')],_0x97a58c[_0xeb9e('0x4b')]),_0x430306);if(_0x441e85[_0xeb9e('0x41')][_0xeb9e('0x4d')]){_0x144f8a[_0xeb9e('0x4e')]=_[_0xeb9e('0x4f')](_0x144f8a[_0xeb9e('0x4e')],{'$or':_[_0xeb9e('0x3a')](_0x430306,function(_0x50e1a6){if(_0x50e1a6[_0xeb9e('0x3e')]!=='VIRTUAL'){var _0x319dad={};_0x319dad[_0x50e1a6[_0xeb9e('0x38')]]={'$like':'%'+_0x441e85['query'][_0xeb9e('0x4d')]+'%'};return _0x319dad;}})});}_0x144f8a=_[_0xeb9e('0x4f')]({},_0x144f8a,_0x441e85[_0xeb9e('0x50')]);var _0x95927c={'where':_0x144f8a['where']};return db[_0xeb9e('0x3b')][_0xeb9e('0x32')](_0x95927c)['then'](function(_0x37f28c){_0x2af5b4[_0xeb9e('0x32')]=_0x37f28c;if(_0x441e85[_0xeb9e('0x41')][_0xeb9e('0x51')]){_0x144f8a[_0xeb9e('0x52')]=[{'all':!![]}];}return db[_0xeb9e('0x3b')][_0xeb9e('0x53')](_0x144f8a);})['then'](function(_0x39c35a){_0x2af5b4[_0xeb9e('0x54')]=_0x39c35a;return _0x2af5b4;})['then'](respondWithFilteredResult(_0x3ccc3c,_0x144f8a))[_0xeb9e('0x2b')](handleError(_0x3ccc3c,null));};exports[_0xeb9e('0x55')]=function(_0x571ea0,_0x9da63c){var _0x467c9a={'raw':!![],'where':{'id':_0x571ea0['params']['id']}},_0x20569d={};_0x20569d[_0xeb9e('0x40')]=_['keys'](db[_0xeb9e('0x3b')][_0xeb9e('0x3c')]);_0x20569d[_0xeb9e('0x41')]=_['keys'](_0x571ea0[_0xeb9e('0x41')]);_0x20569d['filters']=_['intersection'](_0x20569d[_0xeb9e('0x40')],_0x20569d[_0xeb9e('0x41')]);_0x467c9a['attributes']=_['intersection'](_0x20569d[_0xeb9e('0x40')],qs[_0xeb9e('0x44')](_0x571ea0['query'][_0xeb9e('0x44')]));_0x467c9a[_0xeb9e('0x45')]=_0x467c9a[_0xeb9e('0x45')][_0xeb9e('0x46')]?_0x467c9a[_0xeb9e('0x45')]:_0x20569d['model'];if(_0x571ea0[_0xeb9e('0x41')][_0xeb9e('0x51')]){_0x467c9a[_0xeb9e('0x52')]=[{'all':!![]}];}_0x467c9a=_[_0xeb9e('0x4f')]({},_0x467c9a,_0x571ea0[_0xeb9e('0x50')]);return db[_0xeb9e('0x3b')]['find'](_0x467c9a)[_0xeb9e('0x22')](handleEntityNotFound(_0x9da63c,null))['then'](respondWithResult(_0x9da63c,null))[_0xeb9e('0x2b')](handleError(_0x9da63c,null));};exports[_0xeb9e('0x56')]=function(_0x52c98b,_0x264d31){return db[_0xeb9e('0x3b')][_0xeb9e('0x56')](_0x52c98b[_0xeb9e('0x57')],{})[_0xeb9e('0x22')](respondWithResult(_0x264d31,0xc9))[_0xeb9e('0x2b')](handleError(_0x264d31,null));};exports[_0xeb9e('0x36')]=function(_0x180d44,_0x559bfa){if(_0x180d44[_0xeb9e('0x57')]['id']){delete _0x180d44['body']['id'];}return db[_0xeb9e('0x3b')]['find']({'where':{'id':_0x180d44['params']['id']}})[_0xeb9e('0x22')](handleEntityNotFound(_0x559bfa,null))[_0xeb9e('0x22')](saveUpdates(_0x180d44[_0xeb9e('0x57')],null))[_0xeb9e('0x22')](respondWithResult(_0x559bfa,null))[_0xeb9e('0x2b')](handleError(_0x559bfa,null));};exports['destroy']=function(_0x14742a,_0x26208e){return db['WhatsappMessage'][_0xeb9e('0x58')]({'where':{'id':_0x14742a['params']['id']}})[_0xeb9e('0x22')](handleEntityNotFound(_0x26208e,null))['then'](removeEntity(_0x26208e,null))[_0xeb9e('0x2b')](handleError(_0x26208e,null));};exports['describe']=function(_0x25bfa2,_0x19152d){return db['WhatsappMessage'][_0xeb9e('0x59')]()[_0xeb9e('0x22')](respondWithResult(_0x19152d,null))[_0xeb9e('0x2b')](handleError(_0x19152d,null));};var interaction_log=require(_0xeb9e('0x15'))(_0xeb9e('0x5a'));exports['accept']=function(_0x42045f,_0x1b840e,_0x528dff){var _0x46e2a3={'agent':{},'channel':'whatsapp'};if(_0x42045f[_0xeb9e('0x57')]['id']){delete _0x42045f[_0xeb9e('0x57')]['id'];}_0x42045f[_0xeb9e('0x57')]['read']=!![];_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5b')]=moment()[_0xeb9e('0x5c')](_0xeb9e('0x5d'));_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5e')]=_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5e')]||_0x42045f[_0xeb9e('0x5f')]['id'];_0x46e2a3[_0xeb9e('0x60')]['id']=_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5e')];return db[_0xeb9e('0x3b')][_0xeb9e('0x58')]({'where':{'id':_0x42045f['params']['id'],'UserId':null}})[_0xeb9e('0x22')](handleEntityNotFound(_0x1b840e,null))[_0xeb9e('0x22')](saveUpdates(_0x42045f['body'],null))[_0xeb9e('0x22')](function(_0x4d2108){if(_0x4d2108){_0x46e2a3[_0xeb9e('0x29')]=_0x4d2108[_0xeb9e('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4d2108[_0xeb9e('0x62')]}});}return null;})[_0xeb9e('0x22')](handleEntityNotFound(_0x1b840e,null))[_0xeb9e('0x22')](function(_0x12af2c){if(_0x12af2c){return _0x12af2c[_0xeb9e('0x36')]({'UserId':_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5e')],'read1stAt':_[_0xeb9e('0x63')](_0x12af2c[_0xeb9e('0x64')])?moment()[_0xeb9e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x21d6af){if(_0x21d6af){_0x46e2a3[_0xeb9e('0x65')]=_0x21d6af[_0xeb9e('0x61')]({'plain':!![]});interaction_log[_0xeb9e('0x2a')](_0xeb9e('0x66'),_0x42045f[_0xeb9e('0x5f')]['id'],_0x42045f[_0xeb9e('0x5f')][_0xeb9e('0x38')],_0x42045f[_0xeb9e('0x5f')]['role'],_0x46e2a3[_0xeb9e('0x65')]['id'],_0x42045f[_0xeb9e('0x57')]?JSON[_0xeb9e('0x26')](_0x42045f[_0xeb9e('0x57')]):_0xeb9e('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x46e2a3);}return null;})['then'](function(_0x2483f7){var _0x576692='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2483f7[_0xeb9e('0x29')]['ContactId'];return db[_0xeb9e('0x68')][_0xeb9e('0x41')](_0x576692,{'type':db[_0xeb9e('0x69')][_0xeb9e('0x6a')][_0xeb9e('0x6b')],'raw':!![]})[_0xeb9e('0x22')](function(_0x5d20e6){return _0x5d20e6;});})[_0xeb9e('0x22')](function(_0x124a4c){if(_0x124a4c){_0x46e2a3[_0xeb9e('0x29')][_0xeb9e('0x6c')]=_0x124a4c[0x0];if(!_0x42045f[_0xeb9e('0x57')][_0xeb9e('0x5e')])return;return db[_0xeb9e('0x6d')][_0xeb9e('0x58')]({'where':{'id':_0x42045f['body'][_0xeb9e('0x5e')],'role':_0xeb9e('0x60')},'attributes':['id','name','fullname',_0xeb9e('0x6e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4c2a1a){if(!_0x4c2a1a)return null;_0x46e2a3[_0xeb9e('0x29')][_0xeb9e('0x60')]=_0x4c2a1a;return _0x46e2a3;})[_0xeb9e('0x22')](function(_0x202266){if(_0x202266){if(_0x42045f['body']['manual']){_0x46e2a3['message']['interface']=util['format']('SIP/%s',_0x42045f[_0xeb9e('0x5f')][_0xeb9e('0x38')]);_0x46e2a3['message'][_0xeb9e('0x6f')]=_0x46e2a3['channel'];_0x46e2a3['message'][_0xeb9e('0x70')]=_0x46e2a3[_0xeb9e('0x6f')];_0x46e2a3[_0xeb9e('0x29')][_0xeb9e('0x71')]=_0xeb9e('0x72');return respondWithRpcPromise(_0xeb9e('0x73'),_0xeb9e('0x73'),{'event':_0xeb9e('0x74'),'message':_0x46e2a3['message']},client9002)['then'](function(){return _0x46e2a3;});}return _0x46e2a3;}return null;})[_0xeb9e('0x22')](respondWithResult(_0x1b840e,null))['catch'](handleError(_0x1b840e,null));};var interaction_log=require(_0xeb9e('0x15'))('whatsapp-interactions');exports[_0xeb9e('0x75')]=function(_0x592619,_0xc5d32f,_0x3176fd){var _0x3c51ff={'agent':{},'channel':_0xeb9e('0x76')};if(_0x592619[_0xeb9e('0x57')]['id']){delete _0x592619[_0xeb9e('0x57')]['id'];}_0x592619[_0xeb9e('0x57')][_0xeb9e('0x5e')]=_0x592619[_0xeb9e('0x57')][_0xeb9e('0x5e')]||_0x592619[_0xeb9e('0x5f')]['id'];_0x3c51ff[_0xeb9e('0x60')]['id']=_0x592619[_0xeb9e('0x57')][_0xeb9e('0x5e')];return db[_0xeb9e('0x3b')][_0xeb9e('0x58')]({'where':{'id':_0x592619[_0xeb9e('0x77')]['id'],'UserId':null}})[_0xeb9e('0x22')](handleEntityNotFound(_0xc5d32f,null))['then'](function(_0x4ae03d){if(_0x4ae03d){_0x3c51ff['message']=_0x4ae03d['get']({'plain':!![]});return db[_0xeb9e('0x78')][_0xeb9e('0x58')]({'where':{'id':_0x4ae03d['WhatsappInteractionId']}});}return null;})[_0xeb9e('0x22')](handleEntityNotFound(_0xc5d32f,null))[_0xeb9e('0x22')](function(_0x276384){if(_0x276384){_0x3c51ff[_0xeb9e('0x65')]=_0x276384[_0xeb9e('0x61')]({'plain':!![]});interaction_log['info'](_0xeb9e('0x79'),_0x592619['user']['id'],_0x592619[_0xeb9e('0x5f')]['name'],_0x592619['user'][_0xeb9e('0x7a')],_0x3c51ff[_0xeb9e('0x65')]['id'],_0x592619['body']?JSON[_0xeb9e('0x26')](_0x592619[_0xeb9e('0x57')]):_0xeb9e('0x67'));return respondWithRpcPromise(_0xeb9e('0x7b'),'rejectMessage',_0x3c51ff);}return null;})[_0xeb9e('0x22')](function(_0x2511ce){var _0x5abdf4=_0xeb9e('0x7c')+_0x2511ce[_0xeb9e('0x29')]['ContactId'];return db[_0xeb9e('0x68')]['query'](_0x5abdf4,{'type':db[_0xeb9e('0x69')][_0xeb9e('0x6a')][_0xeb9e('0x6b')],'raw':!![]})[_0xeb9e('0x22')](function(_0x2c157c){return _0x2c157c;});})['then'](function(_0x1d9a75){if(_0x1d9a75){_0x3c51ff['message'][_0xeb9e('0x6c')]=_0x1d9a75[0x0];if(!_0x592619[_0xeb9e('0x57')]['UserId'])return;return db[_0xeb9e('0x6d')][_0xeb9e('0x58')]({'where':{'id':_0x592619[_0xeb9e('0x57')][_0xeb9e('0x5e')],'role':_0xeb9e('0x60')},'attributes':['id',_0xeb9e('0x38'),'fullname',_0xeb9e('0x6e'),_0xeb9e('0x7d')],'raw':!![]});}return null;})[_0xeb9e('0x22')](function(_0x1b809f){if(!_0x1b809f)return null;_0x3c51ff['message']['agent']=_0x1b809f;return _0x3c51ff;})[_0xeb9e('0x22')](function(_0x438730){if(_0x438730){_0x438730[_0xeb9e('0x29')]['interface']=util[_0xeb9e('0x5c')]('SIP/%s',_0x592619[_0xeb9e('0x5f')][_0xeb9e('0x38')]);_0x438730['message'][_0xeb9e('0x6f')]=_0x3c51ff[_0xeb9e('0x6f')];_0x438730['message'][_0xeb9e('0x70')]=_0x3c51ff['channel'];_0x438730['message'][_0xeb9e('0x71')]=_0xeb9e('0x75');respondWithRpcPromise(_0xeb9e('0x73'),_0xeb9e('0x73'),{'event':_0xeb9e('0x7e'),'message':_0x438730[_0xeb9e('0x29')]},client9002);return _0x3c51ff;}return null;})[_0xeb9e('0x22')](respondWithResult(_0xc5d32f,null))[_0xeb9e('0x2b')](handleError(_0xc5d32f,null));};exports['status']=function(_0x1178f4,_0x32e38b,_0x25161b){if(_0x1178f4[_0xeb9e('0x57')]['id']){delete _0x1178f4[_0xeb9e('0x57')]['id'];}var _0x53be69;return db[_0xeb9e('0x3b')][_0xeb9e('0x58')]({'where':{'id':_0x1178f4[_0xeb9e('0x77')]['id']}})['then'](handleEntityNotFound(_0x32e38b,null))[_0xeb9e('0x22')](function(_0x516c70){if(_0x516c70){_0x53be69=_0x516c70;return db[_0xeb9e('0x7f')][_0xeb9e('0x58')]({'where':{'id':_0x516c70['WhatsappAccountId']}});}})[_0xeb9e('0x22')](handleEntityNotFound(_0x32e38b,null))[_0xeb9e('0x22')](function(_0x55ff0e){if(_0x55ff0e){logger[_0xeb9e('0x24')](_0xeb9e('0x80'),_0xeb9e('0x2d'),'received\x20delivery\x20report\x20from',_0x55ff0e[_0xeb9e('0x3e')],util[_0xeb9e('0x81')](_0x1178f4[_0xeb9e('0x57')],{'showHidden':![],'depth':null}));switch(_0x55ff0e[_0xeb9e('0x3e')]){case _0xeb9e('0x82'):if(_0x1178f4[_0xeb9e('0x57')][_0xeb9e('0x83')]&&_0x1178f4[_0xeb9e('0x57')][_0xeb9e('0x83')]===_0x53be69[_0xeb9e('0x84')]&&_0x1178f4['body'][_0xeb9e('0x85')]&&_0x1178f4['body'][_0xeb9e('0x85')]==='read'){return _0x53be69[_0xeb9e('0x36')]({'read':!![]});}else{logger[_0xeb9e('0x27')](_0xeb9e('0x86'),_0xeb9e('0x2d'),_0xeb9e('0x82'),util[_0xeb9e('0x81')](_0x1178f4[_0xeb9e('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x53be69;}})['then'](respondWithResult(_0x32e38b,null))['catch'](handleError(_0x32e38b,null));}; \ No newline at end of file +var _0x2c16=['RejectMessage','rejectMessage','ContactId','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','WhatsappMessage','fieldName','type','key','query','keys','intersection','model','attributes','length','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','params','rawAttributes','fields','find','create','body','update','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2df84d,_0x56d874){var _0x2634ce=function(_0x8e8e31){while(--_0x8e8e31){_0x2df84d['push'](_0x2df84d['shift']());}};_0x2634ce(++_0x56d874);}(_0x2c16,0x1b3));var _0x62c1=function(_0x1a763f,_0x24fc68){_0x1a763f=_0x1a763f-0x0;var _0x103bd6=_0x2c16[_0x1a763f];return _0x103bd6;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require(_0x62c1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x62c1('0x4'));var Mustache=require(_0x62c1('0x5'));var util=require(_0x62c1('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x62c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x62c1('0x8'));var squel=require(_0x62c1('0x9'));var crypto=require(_0x62c1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x62c1('0x7'));var querystring=require(_0x62c1('0xb'));var Papa=require(_0x62c1('0xc'));var Redis=require('ioredis');var authService=require(_0x62c1('0xd'));var qs=require(_0x62c1('0xe'));var as=require(_0x62c1('0xf'));var hardwareService=require(_0x62c1('0x10'));var logger=require(_0x62c1('0x11'))('api');var utils=require(_0x62c1('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x62c1('0x13'));var db=require(_0x62c1('0x14'))['db'];config[_0x62c1('0x15')]=_[_0x62c1('0x16')](config[_0x62c1('0x15')],{'host':_0x62c1('0x17'),'port':0x18eb});var socket=require(_0x62c1('0x18'))(new Redis(config[_0x62c1('0x15')]));require('./whatsappMessage.socket')[_0x62c1('0x19')](socket);var jayson=require(_0x62c1('0x1a'));var client=jayson['client'][_0x62c1('0x1b')]({'port':0x232c});var client9002=jayson[_0x62c1('0x1c')][_0x62c1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x302205,_0x228507,_0x2956cb,_0x2fa576){return new BPromise(function(_0x34ab8f,_0x1f6726){var _0x4f87ff=_0x2fa576||client;return _0x4f87ff[_0x62c1('0x1d')](_0x302205,_0x2956cb)[_0x62c1('0x1e')](function(_0x38d8){logger[_0x62c1('0x1f')](_0x62c1('0x20'),_0x228507,_0x62c1('0x21'));logger[_0x62c1('0x22')](_0x62c1('0x23'),_0x228507,_0x62c1('0x21'),JSON[_0x62c1('0x24')](_0x38d8));if(_0x38d8[_0x62c1('0x25')]){if(_0x38d8[_0x62c1('0x25')][_0x62c1('0x26')]===0x1f4){logger['error'](_0x62c1('0x20'),_0x228507,_0x38d8[_0x62c1('0x25')][_0x62c1('0x27')]);return _0x1f6726(_0x38d8['error'][_0x62c1('0x27')]);}logger[_0x62c1('0x25')](_0x62c1('0x20'),_0x228507,_0x38d8[_0x62c1('0x25')][_0x62c1('0x27')]);return _0x34ab8f(_0x38d8['error'][_0x62c1('0x27')]);}else{logger['info'](_0x62c1('0x20'),_0x228507,_0x62c1('0x21'));_0x34ab8f(_0x38d8[_0x62c1('0x28')][_0x62c1('0x27')]);}})[_0x62c1('0x29')](function(_0x37bb65){logger[_0x62c1('0x25')](_0x62c1('0x20'),_0x228507,_0x37bb65);_0x1f6726(_0x37bb65);});});}function respondWithStatusCode(_0x4176c9,_0x430617){_0x430617=_0x430617||0xcc;return function(_0x2a5b7e){if(_0x2a5b7e){return _0x4176c9['sendStatus'](_0x430617);}return _0x4176c9[_0x62c1('0x2a')](_0x430617)[_0x62c1('0x2b')]();};}function respondWithResult(_0x3b0719,_0x21ac1b){_0x21ac1b=_0x21ac1b||0xc8;return function(_0x6c03ea){if(_0x6c03ea){return _0x3b0719['status'](_0x21ac1b)[_0x62c1('0x2c')](_0x6c03ea);}};}function respondWithFilteredResult(_0x259cc7,_0x1293e5){return function(_0x3e7746){if(_0x3e7746){var _0x3418c8=typeof _0x1293e5['offset']==='undefined'&&typeof _0x1293e5[_0x62c1('0x2d')]==='undefined';var _0x5d0180=_0x3e7746[_0x62c1('0x2e')];var _0x2c6073=_0x3418c8?0x0:_0x1293e5[_0x62c1('0x2f')];var _0x1a8c9e=_0x3418c8?_0x3e7746[_0x62c1('0x2e')]:_0x1293e5[_0x62c1('0x2f')]+_0x1293e5[_0x62c1('0x2d')];var _0x1d0375;if(_0x1a8c9e>=_0x5d0180){_0x1a8c9e=_0x5d0180;_0x1d0375=0xc8;}else{_0x1d0375=0xce;}_0x259cc7[_0x62c1('0x2a')](_0x1d0375);return _0x259cc7[_0x62c1('0x30')](_0x62c1('0x31'),_0x2c6073+'-'+_0x1a8c9e+'/'+_0x5d0180)[_0x62c1('0x2c')](_0x3e7746);}return null;};}function patchUpdates(_0x4ffdc1){return function(_0x699b74){try{jsonpatch[_0x62c1('0x32')](_0x699b74,_0x4ffdc1,!![]);}catch(_0x5d8418){return BPromise[_0x62c1('0x33')](_0x5d8418);}return _0x699b74[_0x62c1('0x34')]();};}function saveUpdates(_0x160af3,_0x401d3d){return function(_0x35703f){if(_0x35703f){return _0x35703f['update'](_0x160af3)[_0x62c1('0x1e')](function(_0x5c9e05){return _0x5c9e05;});}return null;};}function removeEntity(_0x3eeddc,_0x3b4da7){return function(_0x15e140){if(_0x15e140){return _0x15e140[_0x62c1('0x35')]()[_0x62c1('0x1e')](function(){_0x3eeddc[_0x62c1('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c4de8,_0x4e4250){return function(_0x57e4fd){if(!_0x57e4fd){_0x3c4de8[_0x62c1('0x36')](0x194);}return _0x57e4fd;};}function handleError(_0x1e57db,_0x2fa842){_0x2fa842=_0x2fa842||0x1f4;return function(_0x11f116){logger[_0x62c1('0x25')](_0x11f116[_0x62c1('0x37')]);if(_0x11f116[_0x62c1('0x38')]){delete _0x11f116['name'];}_0x1e57db[_0x62c1('0x2a')](_0x2fa842)['send'](_0x11f116);};}exports['index']=function(_0x499391,_0x298d5e){var _0x2c378f={},_0x2dca10={},_0x6a77fc={'count':0x0,'rows':[]};var _0x138bb5=_['map'](db[_0x62c1('0x39')]['rawAttributes'],function(_0x5bb266){return{'name':_0x5bb266[_0x62c1('0x3a')],'type':_0x5bb266[_0x62c1('0x3b')][_0x62c1('0x3c')]};});_0x2dca10['model']=_['map'](_0x138bb5,_0x62c1('0x38'));_0x2dca10[_0x62c1('0x3d')]=_[_0x62c1('0x3e')](_0x499391[_0x62c1('0x3d')]);_0x2dca10['filters']=_[_0x62c1('0x3f')](_0x2dca10[_0x62c1('0x40')],_0x2dca10[_0x62c1('0x3d')]);_0x2c378f[_0x62c1('0x41')]=_['intersection'](_0x2dca10[_0x62c1('0x40')],qs['fields'](_0x499391[_0x62c1('0x3d')]['fields']));_0x2c378f[_0x62c1('0x41')]=_0x2c378f[_0x62c1('0x41')][_0x62c1('0x42')]?_0x2c378f[_0x62c1('0x41')]:_0x2dca10[_0x62c1('0x40')];if(!_0x499391['query']['hasOwnProperty'](_0x62c1('0x43'))){_0x2c378f['limit']=qs[_0x62c1('0x2d')](_0x499391[_0x62c1('0x3d')][_0x62c1('0x2d')]);_0x2c378f[_0x62c1('0x2f')]=qs[_0x62c1('0x2f')](_0x499391[_0x62c1('0x3d')][_0x62c1('0x2f')]);}_0x2c378f['order']=qs[_0x62c1('0x44')](_0x499391['query'][_0x62c1('0x44')]);_0x2c378f[_0x62c1('0x45')]=qs[_0x62c1('0x46')](_[_0x62c1('0x47')](_0x499391[_0x62c1('0x3d')],_0x2dca10[_0x62c1('0x46')]),_0x138bb5);if(_0x499391[_0x62c1('0x3d')][_0x62c1('0x48')]){_0x2c378f['where']=_[_0x62c1('0x49')](_0x2c378f[_0x62c1('0x45')],{'$or':_[_0x62c1('0x4a')](_0x138bb5,function(_0x2361fe){if(_0x2361fe[_0x62c1('0x3b')]!==_0x62c1('0x4b')){var _0x3e0e3c={};_0x3e0e3c[_0x2361fe[_0x62c1('0x38')]]={'$like':'%'+_0x499391[_0x62c1('0x3d')][_0x62c1('0x48')]+'%'};return _0x3e0e3c;}})});}_0x2c378f=_[_0x62c1('0x49')]({},_0x2c378f,_0x499391[_0x62c1('0x4c')]);var _0x2017f8={'where':_0x2c378f['where']};return db['WhatsappMessage']['count'](_0x2017f8)[_0x62c1('0x1e')](function(_0x75eaf2){_0x6a77fc[_0x62c1('0x2e')]=_0x75eaf2;if(_0x499391['query']['includeAll']){_0x2c378f[_0x62c1('0x4d')]=[{'all':!![]}];}return db[_0x62c1('0x39')][_0x62c1('0x4e')](_0x2c378f);})[_0x62c1('0x1e')](function(_0x51fcd9){_0x6a77fc[_0x62c1('0x4f')]=_0x51fcd9;return _0x6a77fc;})[_0x62c1('0x1e')](respondWithFilteredResult(_0x298d5e,_0x2c378f))['catch'](handleError(_0x298d5e,null));};exports['show']=function(_0x45e17c,_0x1083b0){var _0x293a86={'raw':!![],'where':{'id':_0x45e17c[_0x62c1('0x50')]['id']}},_0x1887cf={};_0x1887cf[_0x62c1('0x40')]=_['keys'](db['WhatsappMessage'][_0x62c1('0x51')]);_0x1887cf['query']=_[_0x62c1('0x3e')](_0x45e17c['query']);_0x1887cf[_0x62c1('0x46')]=_['intersection'](_0x1887cf['model'],_0x1887cf[_0x62c1('0x3d')]);_0x293a86[_0x62c1('0x41')]=_['intersection'](_0x1887cf[_0x62c1('0x40')],qs[_0x62c1('0x52')](_0x45e17c[_0x62c1('0x3d')][_0x62c1('0x52')]));_0x293a86[_0x62c1('0x41')]=_0x293a86['attributes'][_0x62c1('0x42')]?_0x293a86[_0x62c1('0x41')]:_0x1887cf[_0x62c1('0x40')];if(_0x45e17c[_0x62c1('0x3d')]['includeAll']){_0x293a86[_0x62c1('0x4d')]=[{'all':!![]}];}_0x293a86=_[_0x62c1('0x49')]({},_0x293a86,_0x45e17c[_0x62c1('0x4c')]);return db['WhatsappMessage'][_0x62c1('0x53')](_0x293a86)[_0x62c1('0x1e')](handleEntityNotFound(_0x1083b0,null))[_0x62c1('0x1e')](respondWithResult(_0x1083b0,null))[_0x62c1('0x29')](handleError(_0x1083b0,null));};exports['create']=function(_0x310f9e,_0x572380){return db[_0x62c1('0x39')][_0x62c1('0x54')](_0x310f9e[_0x62c1('0x55')],{})[_0x62c1('0x1e')](respondWithResult(_0x572380,0xc9))[_0x62c1('0x29')](handleError(_0x572380,null));};exports[_0x62c1('0x56')]=function(_0x1c697a,_0x44cd2d){if(_0x1c697a[_0x62c1('0x55')]['id']){delete _0x1c697a[_0x62c1('0x55')]['id'];}return db[_0x62c1('0x39')][_0x62c1('0x53')]({'where':{'id':_0x1c697a['params']['id']}})[_0x62c1('0x1e')](handleEntityNotFound(_0x44cd2d,null))[_0x62c1('0x1e')](saveUpdates(_0x1c697a[_0x62c1('0x55')],null))[_0x62c1('0x1e')](respondWithResult(_0x44cd2d,null))[_0x62c1('0x29')](handleError(_0x44cd2d,null));};exports['destroy']=function(_0xba7f06,_0x4f4e56){return db[_0x62c1('0x39')][_0x62c1('0x53')]({'where':{'id':_0xba7f06[_0x62c1('0x50')]['id']}})['then'](handleEntityNotFound(_0x4f4e56,null))[_0x62c1('0x1e')](removeEntity(_0x4f4e56,null))[_0x62c1('0x29')](handleError(_0x4f4e56,null));};exports['describe']=function(_0x44ec2e,_0x3dd65a){return db['WhatsappMessage'][_0x62c1('0x57')]()['then'](respondWithResult(_0x3dd65a,null))[_0x62c1('0x29')](handleError(_0x3dd65a,null));};var interaction_log=require(_0x62c1('0x11'))(_0x62c1('0x58'));exports['accept']=function(_0x2f8d6d,_0x1ce174,_0x40aecc){var _0x472340={'agent':{},'channel':_0x62c1('0x59')};if(_0x2f8d6d['body']['id']){delete _0x2f8d6d[_0x62c1('0x55')]['id'];}_0x2f8d6d['body'][_0x62c1('0x5a')]=!![];_0x2f8d6d[_0x62c1('0x55')][_0x62c1('0x5b')]=moment()[_0x62c1('0x5c')](_0x62c1('0x5d'));_0x2f8d6d['body'][_0x62c1('0x5e')]=_0x2f8d6d[_0x62c1('0x55')]['UserId']||_0x2f8d6d[_0x62c1('0x5f')]['id'];_0x472340[_0x62c1('0x60')]['id']=_0x2f8d6d[_0x62c1('0x55')][_0x62c1('0x5e')];return db[_0x62c1('0x39')][_0x62c1('0x53')]({'where':{'id':_0x2f8d6d[_0x62c1('0x50')]['id'],'UserId':null}})[_0x62c1('0x1e')](handleEntityNotFound(_0x1ce174,null))['then'](saveUpdates(_0x2f8d6d['body'],null))[_0x62c1('0x1e')](function(_0x13841e){if(_0x13841e){_0x472340[_0x62c1('0x27')]=_0x13841e[_0x62c1('0x61')]({'plain':!![]});return db[_0x62c1('0x62')]['find']({'where':{'id':_0x13841e[_0x62c1('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x1ce174,null))[_0x62c1('0x1e')](function(_0xff2702){if(_0xff2702){return _0xff2702[_0x62c1('0x56')]({'UserId':_0x2f8d6d[_0x62c1('0x55')][_0x62c1('0x5e')],'read1stAt':_['isNil'](_0xff2702[_0x62c1('0x64')])?moment()['format'](_0x62c1('0x5d')):undefined});}return null;})['then'](function(_0x22ba8d){if(_0x22ba8d){_0x472340[_0x62c1('0x65')]=_0x22ba8d[_0x62c1('0x61')]({'plain':!![]});interaction_log[_0x62c1('0x1f')](_0x62c1('0x66'),_0x2f8d6d[_0x62c1('0x5f')]['id'],_0x2f8d6d['user'][_0x62c1('0x38')],_0x2f8d6d['user'][_0x62c1('0x67')],_0x472340[_0x62c1('0x65')]['id'],_0x2f8d6d[_0x62c1('0x55')]?JSON[_0x62c1('0x24')](_0x2f8d6d[_0x62c1('0x55')]):_0x62c1('0x68'));return respondWithRpcPromise(_0x62c1('0x69'),_0x62c1('0x6a'),_0x472340);}return null;})['then'](function(_0xda45eb){var _0x410164=_0x62c1('0x6b')+_0xda45eb[_0x62c1('0x27')]['ContactId'];return db[_0x62c1('0x6c')][_0x62c1('0x3d')](_0x410164,{'type':db[_0x62c1('0x6d')][_0x62c1('0x6e')][_0x62c1('0x6f')],'raw':!![]})[_0x62c1('0x1e')](function(_0x30345c){return _0x30345c;});})[_0x62c1('0x1e')](function(_0x1839e5){if(_0x1839e5){_0x472340['message'][_0x62c1('0x70')]=_0x1839e5[0x0];if(!_0x2f8d6d['body']['UserId'])return;return db[_0x62c1('0x71')][_0x62c1('0x53')]({'where':{'id':_0x2f8d6d[_0x62c1('0x55')][_0x62c1('0x5e')],'role':_0x62c1('0x60')},'attributes':['id',_0x62c1('0x38'),_0x62c1('0x72'),_0x62c1('0x73'),'internal'],'raw':!![]});}return null;})[_0x62c1('0x1e')](function(_0x3772de){if(!_0x3772de)return null;_0x472340[_0x62c1('0x27')][_0x62c1('0x60')]=_0x3772de;return _0x472340;})['then'](function(_0x585f4a){if(_0x585f4a){if(_0x2f8d6d[_0x62c1('0x55')][_0x62c1('0x74')]){_0x472340[_0x62c1('0x27')][_0x62c1('0x75')]=util[_0x62c1('0x5c')](_0x62c1('0x76'),_0x2f8d6d[_0x62c1('0x5f')][_0x62c1('0x38')]);_0x472340['message'][_0x62c1('0x77')]=_0x472340['channel'];_0x472340[_0x62c1('0x27')][_0x62c1('0x78')]=_0x472340['channel'];_0x472340[_0x62c1('0x27')][_0x62c1('0x79')]=_0x62c1('0x7a');return respondWithRpcPromise(_0x62c1('0x7b'),_0x62c1('0x7b'),{'event':'acceptmessage','message':_0x472340[_0x62c1('0x27')]},client9002)[_0x62c1('0x1e')](function(){return _0x472340;});}return _0x472340;}return null;})['then'](respondWithResult(_0x1ce174,null))[_0x62c1('0x29')](handleError(_0x1ce174,null));};var interaction_log=require(_0x62c1('0x11'))(_0x62c1('0x58'));exports['reject']=function(_0x43d880,_0x574546,_0x7981bf){var _0x4966ff={'agent':{},'channel':'whatsapp'};if(_0x43d880[_0x62c1('0x55')]['id']){delete _0x43d880[_0x62c1('0x55')]['id'];}_0x43d880[_0x62c1('0x55')][_0x62c1('0x5e')]=_0x43d880[_0x62c1('0x55')][_0x62c1('0x5e')]||_0x43d880['user']['id'];_0x4966ff['agent']['id']=_0x43d880[_0x62c1('0x55')][_0x62c1('0x5e')];return db[_0x62c1('0x39')][_0x62c1('0x53')]({'where':{'id':_0x43d880['params']['id'],'UserId':null}})[_0x62c1('0x1e')](handleEntityNotFound(_0x574546,null))[_0x62c1('0x1e')](function(_0x5405d1){if(_0x5405d1){_0x4966ff[_0x62c1('0x27')]=_0x5405d1[_0x62c1('0x61')]({'plain':!![]});return db[_0x62c1('0x62')][_0x62c1('0x53')]({'where':{'id':_0x5405d1['WhatsappInteractionId']}});}return null;})[_0x62c1('0x1e')](handleEntityNotFound(_0x574546,null))['then'](function(_0x2f561e){if(_0x2f561e){_0x4966ff[_0x62c1('0x65')]=_0x2f561e[_0x62c1('0x61')]({'plain':!![]});interaction_log[_0x62c1('0x1f')](_0x62c1('0x7c'),_0x43d880[_0x62c1('0x5f')]['id'],_0x43d880[_0x62c1('0x5f')]['name'],_0x43d880[_0x62c1('0x5f')][_0x62c1('0x67')],_0x4966ff[_0x62c1('0x65')]['id'],_0x43d880[_0x62c1('0x55')]?JSON[_0x62c1('0x24')](_0x43d880[_0x62c1('0x55')]):_0x62c1('0x68'));return respondWithRpcPromise(_0x62c1('0x7d'),_0x62c1('0x7e'),_0x4966ff);}return null;})[_0x62c1('0x1e')](function(_0x2e9993){var _0x5e81a6=_0x62c1('0x6b')+_0x2e9993[_0x62c1('0x27')][_0x62c1('0x7f')];return db[_0x62c1('0x6c')][_0x62c1('0x3d')](_0x5e81a6,{'type':db[_0x62c1('0x6d')]['QueryTypes'][_0x62c1('0x6f')],'raw':!![]})['then'](function(_0x5ae801){return _0x5ae801;});})[_0x62c1('0x1e')](function(_0x39848d){if(_0x39848d){_0x4966ff[_0x62c1('0x27')]['contact']=_0x39848d[0x0];if(!_0x43d880[_0x62c1('0x55')][_0x62c1('0x5e')])return;return db[_0x62c1('0x71')][_0x62c1('0x53')]({'where':{'id':_0x43d880[_0x62c1('0x55')][_0x62c1('0x5e')],'role':_0x62c1('0x60')},'attributes':['id','name',_0x62c1('0x72'),_0x62c1('0x73'),_0x62c1('0x80')],'raw':!![]});}return null;})[_0x62c1('0x1e')](function(_0x3ec02d){if(!_0x3ec02d)return null;_0x4966ff[_0x62c1('0x27')][_0x62c1('0x60')]=_0x3ec02d;return _0x4966ff;})[_0x62c1('0x1e')](function(_0x58d345){if(_0x58d345){_0x58d345[_0x62c1('0x27')][_0x62c1('0x75')]=util[_0x62c1('0x5c')](_0x62c1('0x76'),_0x43d880[_0x62c1('0x5f')][_0x62c1('0x38')]);_0x58d345[_0x62c1('0x27')][_0x62c1('0x77')]=_0x4966ff[_0x62c1('0x77')];_0x58d345[_0x62c1('0x27')][_0x62c1('0x78')]=_0x4966ff['channel'];_0x58d345[_0x62c1('0x27')]['event']=_0x62c1('0x33');respondWithRpcPromise('EventManager',_0x62c1('0x7b'),{'event':_0x62c1('0x81'),'message':_0x58d345[_0x62c1('0x27')]},client9002);return _0x4966ff;}return null;})[_0x62c1('0x1e')](respondWithResult(_0x574546,null))[_0x62c1('0x29')](handleError(_0x574546,null));};exports[_0x62c1('0x2a')]=function(_0x54ed63,_0xb23630,_0x1e5aca){if(_0x54ed63[_0x62c1('0x55')]['id']){delete _0x54ed63['body']['id'];}var _0x4f8739;return db[_0x62c1('0x39')][_0x62c1('0x53')]({'where':{'id':_0x54ed63[_0x62c1('0x50')]['id']}})['then'](handleEntityNotFound(_0xb23630,null))[_0x62c1('0x1e')](function(_0x4204e6){if(_0x4204e6){_0x4f8739=_0x4204e6;return db[_0x62c1('0x82')][_0x62c1('0x53')]({'where':{'id':_0x4204e6[_0x62c1('0x83')]}});}})[_0x62c1('0x1e')](handleEntityNotFound(_0xb23630,null))[_0x62c1('0x1e')](function(_0xf7619){if(_0xf7619){logger[_0x62c1('0x22')](_0x62c1('0x84'),_0x62c1('0x2a'),_0x62c1('0x85'),_0xf7619[_0x62c1('0x3b')],util['inspect'](_0x54ed63[_0x62c1('0x55')],{'showHidden':![],'depth':null}));switch(_0xf7619['type']){case _0x62c1('0x86'):if(_0x54ed63[_0x62c1('0x55')][_0x62c1('0x87')]&&_0x54ed63[_0x62c1('0x55')][_0x62c1('0x87')]===_0x4f8739[_0x62c1('0x88')]&&_0x54ed63[_0x62c1('0x55')][_0x62c1('0x89')]&&_0x54ed63[_0x62c1('0x55')][_0x62c1('0x89')]===_0x62c1('0x5a')){return _0x4f8739[_0x62c1('0x56')]({'read':!![]});}else{logger[_0x62c1('0x25')](_0x62c1('0x8a'),_0x62c1('0x2a'),_0x62c1('0x86'),util[_0x62c1('0x8b')](_0x54ed63[_0x62c1('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x4f8739;}})[_0x62c1('0x1e')](respondWithResult(_0xb23630,null))[_0x62c1('0x29')](handleError(_0xb23630,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index c9ff6c9..fe9f10b 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 _0xaaa2=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x1d8a5d,_0x59a110){var _0x54d59f=function(_0x54ce10){while(--_0x54ce10){_0x1d8a5d['push'](_0x1d8a5d['shift']());}};_0x54d59f(++_0x59a110);}(_0xaaa2,0xac));var _0x2aaa=function(_0x64a3b,_0x3eebb2){_0x64a3b=_0x64a3b-0x0;var _0x72c118=_0xaaa2[_0x64a3b];return _0x72c118;};'use strict';var EventEmitter=require(_0x2aaa('0x0'));var WhatsappMessage=require(_0x2aaa('0x1'))['db'][_0x2aaa('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2aaa('0x3')](0x0);var events={'afterCreate':_0x2aaa('0x4'),'afterUpdate':_0x2aaa('0x5'),'afterDestroy':'remove'};function emitEvent(_0xfc076){return function(_0x482489,_0x35b5c8,_0x340071){WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076+':'+_0x482489['id'],_0x482489);WhatsappMessageEvents[_0x2aaa('0x6')](_0xfc076,_0x482489);_0x340071(null);};}for(var e in events){if(events[_0x2aaa('0x7')](e)){var event=events[e];WhatsappMessage[_0x2aaa('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x1152=['remove','emit','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x4d2936,_0x2042ac){var _0x47b9f5=function(_0x163940){while(--_0x163940){_0x4d2936['push'](_0x4d2936['shift']());}};_0x47b9f5(++_0x2042ac);}(_0x1152,0x182));var _0x2115=function(_0x5b4d06,_0x3edc8d){_0x5b4d06=_0x5b4d06-0x0;var _0xad4053=_0x1152[_0x5b4d06];return _0xad4053;};'use strict';var EventEmitter=require(_0x2115('0x0'));var WhatsappMessage=require(_0x2115('0x1'))['db'][_0x2115('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2115('0x3')](0x0);var events={'afterCreate':_0x2115('0x4'),'afterUpdate':_0x2115('0x5'),'afterDestroy':_0x2115('0x6')};function emitEvent(_0x3b8dfa){return function(_0x4d0f31,_0x1e8a26,_0x5c17b3){WhatsappMessageEvents[_0x2115('0x7')](_0x3b8dfa+':'+_0x4d0f31['id'],_0x4d0f31);WhatsappMessageEvents[_0x2115('0x7')](_0x3b8dfa,_0x4d0f31);_0x5c17b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](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 21e1ce3..87e8724 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 _0x1806=['utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','toLowerCase','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally'];(function(_0x5234e4,_0x2a4ed3){var _0x580a82=function(_0x13f98e){while(--_0x13f98e){_0x5234e4['push'](_0x5234e4['shift']());}};_0x580a82(++_0x2a4ed3);}(_0x1806,0x8f));var _0x6180=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1806[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6180('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6180('0x1'));var BPromise=require(_0x6180('0x2'));var rp=require(_0x6180('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6180('0x4'));module[_0x6180('0x5')]=function(_0x4b3f8a,_0x547f18){return _0x4b3f8a[_0x6180('0x6')](_0x6180('0x7'),attributes,{'tableName':_0x6180('0x8'),'paranoid':![],'indexes':[{'name':_0x6180('0x9'),'fields':[_0x6180('0x9')]},{'name':_0x6180('0xa'),'fields':[_0x6180('0xb')],'type':_0x6180('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x261f51,_0x56e0d,_0x39df10){var _0x171c54=_0x4b3f8a[_0x6180('0xd')];var _0x57d8e2=_0x261f51[_0x6180('0xe')]({'plain':!![]});if(_0x57d8e2[_0x6180('0xf')]['toLowerCase']()==='in'||_0x57d8e2['direction']['toLowerCase']()===_0x6180('0x10')&&!_0x57d8e2[_0x6180('0x11')]&&!_[_0x6180('0x12')](_0x57d8e2[_0x6180('0x13')])){_0x171c54['WhatsappInteraction'][_0x6180('0x14')]({'where':{'id':_0x57d8e2[_0x6180('0x15')]}})[_0x6180('0x16')](function(_0x4a5dd6){if(_0x4a5dd6){_0x4a5dd6[_0x6180('0x17')]({'lastMsgAt':_0x57d8e2[_0x6180('0x18')],'lastMsgDirection':_0x57d8e2[_0x6180('0xf')][_0x6180('0x19')]()});}})[_0x6180('0x1a')](function(_0x3e20e2){console[_0x6180('0x1b')](_0x3e20e2);});}if(_0x57d8e2[_0x6180('0xf')]===_0x6180('0x10')&&!_0x57d8e2['secret']){var _0x1489d1;_0x171c54['WhatsappAccount'][_0x6180('0x1c')]({'where':{'id':_0x57d8e2[_0x6180('0x1d')]},'raw':!![]})[_0x6180('0x16')](function(_0x4f778f){_0x1489d1=_0x4f778f;if(_0x1489d1&&_0x1489d1[_0x6180('0x1e')]){switch(_0x1489d1[_0x6180('0x1e')]){case _0x6180('0x1f'):var _0x1183a5=require(_0x6180('0x1f'));if(_0x1489d1[_0x6180('0x20')]&&_0x1489d1[_0x6180('0x21')]&&_0x1489d1[_0x6180('0x22')]){var _0x21837a=new _0x1183a5(_0x1489d1[_0x6180('0x20')],_0x1489d1['authToken']);_0x21837a[_0x6180('0x23')][_0x6180('0x24')]({'body':_0x57d8e2[_0x6180('0xb')],'to':_0x6180('0x25')+_0x57d8e2[_0x6180('0x22')],'from':'whatsapp:'+_0x1489d1[_0x6180('0x22')],'statusCallback':_0x1489d1[_0x6180('0x26')]+'/api/whatsapp/messages/'+_0x57d8e2['id']+_0x6180('0x27')+_0x1489d1['token']})['then'](function(_0xb92e8b){if(_0xb92e8b['sid']){return _0x261f51[_0x6180('0x17')]({'messageId':_0xb92e8b['sid']});}})[_0x6180('0x1a')](function(_0x5181d1){logger['error'](_0x6180('0x28'),_0x6180('0x29'),'twilio',util[_0x6180('0x2a')](_0x5181d1,{'showHidden':![],'depth':null}));});}else{logger[_0x6180('0x1b')](_0x6180('0x28'),_0x6180('0x29'),_0x6180('0x1f'),_0x6180('0x2b'));}break;}}})[_0x6180('0x2c')](function(){_0x39df10();});}else{_0x39df10();}}},'charset':_0x6180('0x2d'),'collate':_0x6180('0x2e')});}; \ No newline at end of file +var _0x4731=['../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x261153,_0x174df0){var _0x5402f9=function(_0x5c7269){while(--_0x5c7269){_0x261153['push'](_0x261153['shift']());}};_0x5402f9(++_0x174df0);}(_0x4731,0xce));var _0x1473=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x4731[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1473('0x0'));var util=require(_0x1473('0x1'));var logger=require(_0x1473('0x2'))(_0x1473('0x3'));var moment=require(_0x1473('0x4'));var BPromise=require('bluebird');var rp=require(_0x1473('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1473('0x6'));var attributes=require(_0x1473('0x7'));module[_0x1473('0x8')]=function(_0x5e609a,_0x169ee1){return _0x5e609a[_0x1473('0x9')](_0x1473('0xa'),attributes,{'tableName':_0x1473('0xb'),'paranoid':![],'indexes':[{'name':_0x1473('0xc'),'fields':['messageId']},{'name':_0x1473('0xd'),'fields':[_0x1473('0xe')],'type':_0x1473('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x12faa9,_0x4fdf52,_0x6c082b){var _0x18b7f9=_0x5e609a[_0x1473('0x10')];var _0x128324=_0x12faa9[_0x1473('0x11')]({'plain':!![]});if(_0x128324[_0x1473('0x12')][_0x1473('0x13')]()==='in'||_0x128324[_0x1473('0x12')]['toLowerCase']()===_0x1473('0x14')&&!_0x128324[_0x1473('0x15')]&&!_[_0x1473('0x16')](_0x128324[_0x1473('0x17')])){_0x18b7f9[_0x1473('0x18')]['findOne']({'where':{'id':_0x128324[_0x1473('0x19')]}})[_0x1473('0x1a')](function(_0x14acb3){if(_0x14acb3){_0x14acb3[_0x1473('0x1b')]({'lastMsgAt':_0x128324[_0x1473('0x1c')],'lastMsgDirection':_0x128324['direction'][_0x1473('0x13')]()});}})['catch'](function(_0x3c70dd){console[_0x1473('0x1d')](_0x3c70dd);});}if(_0x128324[_0x1473('0x12')]===_0x1473('0x14')&&!_0x128324[_0x1473('0x15')]){var _0x2de6cb;_0x18b7f9[_0x1473('0x1e')][_0x1473('0x1f')]({'where':{'id':_0x128324[_0x1473('0x20')]},'raw':!![]})[_0x1473('0x1a')](function(_0x308dff){_0x2de6cb=_0x308dff;if(_0x2de6cb&&_0x2de6cb[_0x1473('0x21')]){switch(_0x2de6cb[_0x1473('0x21')]){case _0x1473('0x22'):var _0x17594f=require('twilio');if(_0x2de6cb[_0x1473('0x23')]&&_0x2de6cb[_0x1473('0x24')]&&_0x2de6cb[_0x1473('0x25')]){var _0x5d4c25=new _0x17594f(_0x2de6cb[_0x1473('0x23')],_0x2de6cb[_0x1473('0x24')]);_0x5d4c25[_0x1473('0x26')][_0x1473('0x27')]({'body':_0x128324[_0x1473('0xe')],'to':_0x1473('0x28')+_0x128324[_0x1473('0x25')],'from':_0x1473('0x28')+_0x2de6cb[_0x1473('0x25')],'statusCallback':_0x2de6cb[_0x1473('0x29')]+_0x1473('0x2a')+_0x128324['id']+_0x1473('0x2b')+_0x2de6cb[_0x1473('0x2c')]})['then'](function(_0x246d47){if(_0x246d47['sid']){return _0x12faa9[_0x1473('0x1b')]({'messageId':_0x246d47[_0x1473('0x2d')]});}})[_0x1473('0x2e')](function(_0x35b5c3){logger['error'](_0x1473('0x2f'),_0x1473('0x30'),_0x1473('0x22'),util[_0x1473('0x31')](_0x35b5c3,{'showHidden':![],'depth':null}));});}else{logger[_0x1473('0x1d')](_0x1473('0x2f'),'afterCreate',_0x1473('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x1473('0x32')](function(){_0x6c082b();});}else{_0x6c082b();}}},'charset':_0x1473('0x33'),'collate':_0x1473('0x34')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 7d51f52..11a25ad 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 _0xfd88=['WhatsappMessage','options','raw','then','CreateWhatsappMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0xfd88,0x18d));var _0x8fd8=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xfd88[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x8fd8('0x0'));var util=require(_0x8fd8('0x1'));var moment=require('moment');var BPromise=require(_0x8fd8('0x2'));var rs=require(_0x8fd8('0x3'));var fs=require('fs');var Redis=require(_0x8fd8('0x4'));var db=require(_0x8fd8('0x5'))['db'];var utils=require(_0x8fd8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8fd8('0x7'));var jayson=require(_0x8fd8('0x8'));var client=jayson[_0x8fd8('0x9')][_0x8fd8('0xa')]({'port':0x232a});config[_0x8fd8('0xb')]=_[_0x8fd8('0xc')](config[_0x8fd8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fd8('0xd'))(new Redis(config[_0x8fd8('0xb')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x39d736,_0x5400d2,_0x48f7f5){return new BPromise(function(_0x101c5,_0x19aa28){return client['request'](_0x39d736,_0x48f7f5)['then'](function(_0x361f38){logger[_0x8fd8('0xe')](_0x8fd8('0xf'),_0x5400d2,_0x8fd8('0x10'));logger[_0x8fd8('0x11')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5400d2,_0x8fd8('0x10'),JSON[_0x8fd8('0x12')](_0x361f38));if(_0x361f38[_0x8fd8('0x13')]){if(_0x361f38[_0x8fd8('0x13')][_0x8fd8('0x14')]===0x1f4){logger['error'](_0x8fd8('0xf'),_0x5400d2,_0x361f38[_0x8fd8('0x13')][_0x8fd8('0x15')]);return _0x19aa28(_0x361f38['error'][_0x8fd8('0x15')]);}logger[_0x8fd8('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5400d2,_0x361f38[_0x8fd8('0x13')][_0x8fd8('0x15')]);return _0x101c5(_0x361f38[_0x8fd8('0x13')][_0x8fd8('0x15')]);}else{logger[_0x8fd8('0xe')](_0x8fd8('0xf'),_0x5400d2,_0x8fd8('0x10'));_0x101c5(_0x361f38['result'][_0x8fd8('0x15')]);}})[_0x8fd8('0x16')](function(_0x20c21b){logger[_0x8fd8('0x13')](_0x8fd8('0xf'),_0x5400d2,_0x20c21b);_0x19aa28(_0x20c21b);});});}exports['CreateWhatsappMessage']=function(_0x2f9b0f){var _0x50b28c=this;return new Promise(function(_0x21c944,_0x5c4076){return db[_0x8fd8('0x17')]['create'](_0x2f9b0f['body'],{'raw':_0x2f9b0f[_0x8fd8('0x18')]?_0x2f9b0f[_0x8fd8('0x18')][_0x8fd8('0x19')]===undefined?!![]:![]:!![]})[_0x8fd8('0x1a')](function(_0xce5561){logger[_0x8fd8('0xe')](_0x8fd8('0x1b'),_0x2f9b0f);logger['debug'](_0x8fd8('0x1b'),_0x2f9b0f,JSON[_0x8fd8('0x12')](_0xce5561));_0x21c944(_0xce5561);})['catch'](function(_0x38e5e5){logger['error']('CreateWhatsappMessage',_0x38e5e5[_0x8fd8('0x15')],_0x2f9b0f);_0x5c4076(_0x50b28c[_0x8fd8('0x13')](0x1f4,_0x38e5e5['message']));});});}; \ No newline at end of file +var _0xf199=['WhatsappMessage','create','body','debug','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappMessage'];(function(_0x1415f4,_0xf59571){var _0x15d3b5=function(_0x132265){while(--_0x132265){_0x1415f4['push'](_0x1415f4['shift']());}};_0x15d3b5(++_0xf59571);}(_0xf199,0x1a8));var _0x9f19=function(_0x3238bd,_0x4ea3ef){_0x3238bd=_0x3238bd-0x0;var _0xdc7a7e=_0xf199[_0x3238bd];return _0xdc7a7e;};'use strict';var _=require('lodash');var util=require(_0x9f19('0x0'));var moment=require('moment');var BPromise=require(_0x9f19('0x1'));var rs=require(_0x9f19('0x2'));var fs=require('fs');var Redis=require(_0x9f19('0x3'));var db=require(_0x9f19('0x4'))['db'];var utils=require(_0x9f19('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9f19('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9f19('0x7')][_0x9f19('0x8')]({'port':0x232a});config[_0x9f19('0x9')]=_[_0x9f19('0xa')](config[_0x9f19('0x9')],{'host':_0x9f19('0xb'),'port':0x18eb});var socket=require(_0x9f19('0xc'))(new Redis(config[_0x9f19('0x9')]));require('./whatsappMessage.socket')[_0x9f19('0xd')](socket);function respondWithRpcPromise(_0x35ae03,_0x1c3686,_0x1257d4){return new BPromise(function(_0x20f628,_0x1d5a92){return client['request'](_0x35ae03,_0x1257d4)[_0x9f19('0xe')](function(_0x26a042){logger[_0x9f19('0xf')](_0x9f19('0x10'),_0x1c3686,_0x9f19('0x11'));logger['debug'](_0x9f19('0x12'),_0x1c3686,_0x9f19('0x11'),JSON[_0x9f19('0x13')](_0x26a042));if(_0x26a042['error']){if(_0x26a042['error']['code']===0x1f4){logger['error'](_0x9f19('0x10'),_0x1c3686,_0x26a042[_0x9f19('0x14')][_0x9f19('0x15')]);return _0x1d5a92(_0x26a042[_0x9f19('0x14')][_0x9f19('0x15')]);}logger[_0x9f19('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x1c3686,_0x26a042[_0x9f19('0x14')]['message']);return _0x20f628(_0x26a042[_0x9f19('0x14')][_0x9f19('0x15')]);}else{logger[_0x9f19('0xf')](_0x9f19('0x10'),_0x1c3686,_0x9f19('0x11'));_0x20f628(_0x26a042['result'][_0x9f19('0x15')]);}})[_0x9f19('0x16')](function(_0x221769){logger[_0x9f19('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x1c3686,_0x221769);_0x1d5a92(_0x221769);});});}exports[_0x9f19('0x17')]=function(_0x196552){var _0x3b4ac9=this;return new Promise(function(_0x5f4fac,_0x1facee){return db[_0x9f19('0x18')][_0x9f19('0x19')](_0x196552[_0x9f19('0x1a')],{'raw':_0x196552['options']?_0x196552['options']['raw']===undefined?!![]:![]:!![]})[_0x9f19('0xe')](function(_0x95396b){logger[_0x9f19('0xf')](_0x9f19('0x17'),_0x196552);logger[_0x9f19('0x1b')]('CreateWhatsappMessage',_0x196552,JSON['stringify'](_0x95396b));_0x5f4fac(_0x95396b);})[_0x9f19('0x16')](function(_0x3bdb82){logger[_0x9f19('0x14')]('CreateWhatsappMessage',_0x3bdb82[_0x9f19('0x15')],_0x196552);_0x1facee(_0x3b4ac9['error'](0x1f4,_0x3bdb82[_0x9f19('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 5f09c80..07769d4 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 _0x99a0=['./whatsappMessage.events','removeListener','length','whatsappMessage:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x99a0,0xbc));var _0x099a=function(_0x39f90d,_0x23fcb8){_0x39f90d=_0x39f90d-0x0;var _0x3c3781=_0x99a0[_0x39f90d];return _0x3c3781;};'use strict';var WhatsappMessageEvents=require(_0x099a('0x0'));var events=['save','remove','update'];function createListener(_0xf8e665,_0x35e644){return function(_0x850cd6){_0x35e644['emit'](_0xf8e665,_0x850cd6);};}function removeListener(_0xdbc4ed,_0xe78b8a){return function(){WhatsappMessageEvents[_0x099a('0x1')](_0xdbc4ed,_0xe78b8a);};}exports['register']=function(_0x1698da){for(var _0x54efc1=0x0,_0x230e1c=events[_0x099a('0x2')];_0x54efc1<_0x230e1c;_0x54efc1++){var _0x1d819f=events[_0x54efc1];var _0x3edc3d=createListener(_0x099a('0x3')+_0x1d819f,_0x1698da);WhatsappMessageEvents['on'](_0x1d819f,_0x3edc3d);}}; \ No newline at end of file +var _0x460b=['emit','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x502ef9,_0x21a2c8){var _0x5bfbe0=function(_0x1d6fa1){while(--_0x1d6fa1){_0x502ef9['push'](_0x502ef9['shift']());}};_0x5bfbe0(++_0x21a2c8);}(_0x460b,0xac));var _0xb460=function(_0x4a6a6b,_0x1909e3){_0x4a6a6b=_0x4a6a6b-0x0;var _0x3335a6=_0x460b[_0x4a6a6b];return _0x3335a6;};'use strict';var WhatsappMessageEvents=require(_0xb460('0x0'));var events=[_0xb460('0x1'),_0xb460('0x2'),_0xb460('0x3')];function createListener(_0x4ce7b7,_0x52e2ae){return function(_0x5f48aa){_0x52e2ae[_0xb460('0x4')](_0x4ce7b7,_0x5f48aa);};}function removeListener(_0x17f9cc,_0x548149){return function(){WhatsappMessageEvents['removeListener'](_0x17f9cc,_0x548149);};}exports[_0xb460('0x5')]=function(_0x13052d){for(var _0xcacaf6=0x0,_0x5c3c8b=events[_0xb460('0x6')];_0xcacaf6<_0x5c3c8b;_0xcacaf6++){var _0x268964=events[_0xcacaf6];var _0x26cbac=createListener(_0xb460('0x7')+_0x268964,_0x13052d);WhatsappMessageEvents['on'](_0x268964,_0x26cbac);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 5d1d5b3..0ccab1e 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 _0xd4c1=['/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','describe','show'];(function(_0x3b267f,_0x2a7dd9){var _0x4c0cd8=function(_0x5c20c6){while(--_0x5c20c6){_0x3b267f['push'](_0x3b267f['shift']());}};_0x4c0cd8(++_0x2a7dd9);}(_0xd4c1,0xf7));var _0x1d4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4c1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1d4c('0x0'));var util=require(_0x1d4c('0x1'));var path=require('path');var timeout=require(_0x1d4c('0x2'));var express=require(_0x1d4c('0x3'));var router=express[_0x1d4c('0x4')]();var fs_extra=require(_0x1d4c('0x5'));var auth=require(_0x1d4c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1d4c('0x7'));var controller=require(_0x1d4c('0x8'));router[_0x1d4c('0x9')]('/',auth[_0x1d4c('0xa')](),controller[_0x1d4c('0xb')]);router[_0x1d4c('0x9')]('/describe',auth[_0x1d4c('0xa')](),controller[_0x1d4c('0xc')]);router[_0x1d4c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1d4c('0xd')]);router[_0x1d4c('0x9')](_0x1d4c('0xe'),auth[_0x1d4c('0xa')](),controller['getMembers']);router[_0x1d4c('0x9')](_0x1d4c('0xf'),auth[_0x1d4c('0xa')](),controller[_0x1d4c('0x10')]);router[_0x1d4c('0x9')](_0x1d4c('0x11'),auth[_0x1d4c('0xa')](),controller['getAgents']);router[_0x1d4c('0x12')]('/',auth[_0x1d4c('0xa')](),controller[_0x1d4c('0x13')]);router[_0x1d4c('0x12')](_0x1d4c('0xf'),auth[_0x1d4c('0xa')](),controller[_0x1d4c('0x14')]);router[_0x1d4c('0x12')]('/:id/users',auth[_0x1d4c('0xa')](),controller[_0x1d4c('0x15')]);router['put'](_0x1d4c('0x16'),auth['isAuthenticated'](),controller[_0x1d4c('0x17')]);router[_0x1d4c('0x18')](_0x1d4c('0x16'),auth['isAuthenticated'](),controller[_0x1d4c('0x19')]);router[_0x1d4c('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1d4c('0x1a')]);router[_0x1d4c('0x18')]('/:id/users',auth[_0x1d4c('0xa')](),controller[_0x1d4c('0x1b')]);module[_0x1d4c('0x1c')]=router; \ No newline at end of file +var _0xb8b2=['delete','/:id','destroy','removeTeams','removeAgents','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','update'];(function(_0x2ae811,_0x585c47){var _0x595402=function(_0x25b8a7){while(--_0x25b8a7){_0x2ae811['push'](_0x2ae811['shift']());}};_0x595402(++_0x585c47);}(_0xb8b2,0x1d9));var _0x2b8b=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xb8b2[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b8b('0x0'));var timeout=require('connect-timeout');var express=require(_0x2b8b('0x1'));var router=express[_0x2b8b('0x2')]();var fs_extra=require(_0x2b8b('0x3'));var auth=require(_0x2b8b('0x4'));var interaction=require(_0x2b8b('0x5'));var config=require(_0x2b8b('0x6'));var controller=require(_0x2b8b('0x7'));router[_0x2b8b('0x8')]('/',auth[_0x2b8b('0x9')](),controller['index']);router['get'](_0x2b8b('0xa'),auth['isAuthenticated'](),controller[_0x2b8b('0xb')]);router['get']('/:id',auth[_0x2b8b('0x9')](),controller['show']);router[_0x2b8b('0x8')](_0x2b8b('0xc'),auth['isAuthenticated'](),controller[_0x2b8b('0xd')]);router[_0x2b8b('0x8')](_0x2b8b('0xe'),auth[_0x2b8b('0x9')](),controller['getTeams']);router[_0x2b8b('0x8')]('/:id/users',auth[_0x2b8b('0x9')](),controller[_0x2b8b('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2b8b('0x10')]);router[_0x2b8b('0x11')](_0x2b8b('0xe'),auth['isAuthenticated'](),controller[_0x2b8b('0x12')]);router['post'](_0x2b8b('0x13'),auth[_0x2b8b('0x9')](),controller['addAgents']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2b8b('0x14')]);router[_0x2b8b('0x15')](_0x2b8b('0x16'),auth[_0x2b8b('0x9')](),controller[_0x2b8b('0x17')]);router[_0x2b8b('0x15')](_0x2b8b('0xe'),auth[_0x2b8b('0x9')](),controller[_0x2b8b('0x18')]);router[_0x2b8b('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0x2b8b('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 0d05370..d7b87ad 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 _0x87f8=['rrmemory','roundrobin','STRING','name','INTEGER'];(function(_0x5d98f1,_0x5e6890){var _0x7dd486=function(_0x477052){while(--_0x477052){_0x5d98f1['push'](_0x5d98f1['shift']());}};_0x7dd486(++_0x5e6890);}(_0x87f8,0x152));var _0x887f=function(_0x498083,_0x321fd6){_0x498083=_0x498083-0x0;var _0x10b2b4=_0x87f8[_0x498083];return _0x10b2b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x887f('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x887f('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x887f('0x2'),'beepall',_0x887f('0x3'))},'description':{'type':Sequelize[_0x887f('0x4')]}}; \ No newline at end of file +var _0xb544=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','name'];(function(_0xe1a3a5,_0xd3e341){var _0x362646=function(_0xdcef03){while(--_0xdcef03){_0xe1a3a5['push'](_0xe1a3a5['shift']());}};_0x362646(++_0xd3e341);}(_0xb544,0xd0));var _0x4b54=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb544[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4b54('0x0')],'unique':_0x4b54('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4b54('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b54('0x3')](_0x4b54('0x4'),_0x4b54('0x5'),_0x4b54('0x6'))},'description':{'type':Sequelize[_0x4b54('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index ff9318d..4502c60 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 _0x649f=['name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','options','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','whatsappPause','Team','getTeams','addTeams','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','emit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappQueue.socket','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','WhatsappQueues','end','sendStatus','error','stack'];(function(_0x4612df,_0x37a8f7){var _0x2804c6=function(_0x2b1979){while(--_0x2b1979){_0x4612df['push'](_0x4612df['shift']());}};_0x2804c6(++_0x37a8f7);}(_0x649f,0xed));var _0xf649=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x649f[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0xf649('0x0'));var rimraf=require(_0xf649('0x1'));var zipdir=require(_0xf649('0x2'));var jsonpatch=require(_0xf649('0x3'));var rp=require(_0xf649('0x4'));var moment=require(_0xf649('0x5'));var BPromise=require(_0xf649('0x6'));var Mustache=require(_0xf649('0x7'));var util=require('util');var path=require(_0xf649('0x8'));var sox=require('sox');var csv=require(_0xf649('0x9'));var ejs=require(_0xf649('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf649('0xb'));var squel=require('squel');var crypto=require(_0xf649('0xc'));var jsforce=require(_0xf649('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf649('0xe'));var authService=require(_0xf649('0xf'));var qs=require(_0xf649('0x10'));var as=require(_0xf649('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf649('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf649('0x13'));var db=require(_0xf649('0x14'))['db'];config['redis']=_[_0xf649('0x15')](config[_0xf649('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xf649('0x17'))(new Redis(config['redis']));require(_0xf649('0x18'))[_0xf649('0x19')](socket);function respondWithStatusCode(_0x8065ce,_0x463e3e){_0x463e3e=_0x463e3e||0xcc;return function(_0x59227f){if(_0x59227f){return _0x8065ce['sendStatus'](_0x463e3e);}return _0x8065ce[_0xf649('0x1a')](_0x463e3e)['end']();};}function respondWithResult(_0x177c8d,_0x352900){_0x352900=_0x352900||0xc8;return function(_0x2fc0bf){if(_0x2fc0bf){return _0x177c8d['status'](_0x352900)[_0xf649('0x1b')](_0x2fc0bf);}};}function respondWithFilteredResult(_0xd2b5b8,_0x5ece03){return function(_0x1f3f45){if(_0x1f3f45){var _0x17ad12=typeof _0x5ece03[_0xf649('0x1c')]===_0xf649('0x1d')&&typeof _0x5ece03[_0xf649('0x1e')]==='undefined';var _0x1b6e2d=_0x1f3f45[_0xf649('0x1f')];var _0x3d48f9=_0x17ad12?0x0:_0x5ece03[_0xf649('0x1c')];var _0x250ce3=_0x17ad12?_0x1f3f45['count']:_0x5ece03['offset']+_0x5ece03['limit'];var _0x332037;if(_0x250ce3>=_0x1b6e2d){_0x250ce3=_0x1b6e2d;_0x332037=0xc8;}else{_0x332037=0xce;}_0xd2b5b8[_0xf649('0x1a')](_0x332037);return _0xd2b5b8['set'](_0xf649('0x20'),_0x3d48f9+'-'+_0x250ce3+'/'+_0x1b6e2d)[_0xf649('0x1b')](_0x1f3f45);}return null;};}function patchUpdates(_0x1f28e9){return function(_0x3fb626){try{jsonpatch[_0xf649('0x21')](_0x3fb626,_0x1f28e9,!![]);}catch(_0x43a38a){return BPromise[_0xf649('0x22')](_0x43a38a);}return _0x3fb626['save']();};}function saveUpdates(_0x56eb62,_0x3358ef){return function(_0xcb26af){if(_0xcb26af){return _0xcb26af[_0xf649('0x23')](_0x56eb62)['then'](function(_0x1fb763){return _0x1fb763;});}return null;};}function removeEntity(_0x175c55,_0x5484a7){return function(_0x322443){if(_0x322443){return _0x322443['destroy']()[_0xf649('0x24')](function(){var _0x57a0cf=_0x322443[_0xf649('0x25')]({'plain':!![]});var _0x32700f=_0xf649('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x32700f,'resourceId':_0x57a0cf['id']}})['then'](function(){return _0x322443;});})[_0xf649('0x24')](function(){_0x175c55[_0xf649('0x1a')](0xcc)[_0xf649('0x27')]();});}};}function handleEntityNotFound(_0x2885ad,_0x11b1fa){return function(_0x2a78dd){if(!_0x2a78dd){_0x2885ad[_0xf649('0x28')](0x194);}return _0x2a78dd;};}function handleError(_0x273953,_0x2fe19c){_0x2fe19c=_0x2fe19c||0x1f4;return function(_0x2b361c){logger[_0xf649('0x29')](_0x2b361c[_0xf649('0x2a')]);if(_0x2b361c[_0xf649('0x2b')]){delete _0x2b361c['name'];}_0x273953['status'](_0x2fe19c)[_0xf649('0x2c')](_0x2b361c);};}exports[_0xf649('0x2d')]=function(_0x36b443,_0x244763){var _0x4131ba={},_0x19d561={},_0x200f24={'count':0x0,'rows':[]};var _0x36bb98=_['map'](db[_0xf649('0x2e')][_0xf649('0x2f')],function(_0x1fb4de){return{'name':_0x1fb4de[_0xf649('0x30')],'type':_0x1fb4de[_0xf649('0x31')][_0xf649('0x32')]};});_0x19d561[_0xf649('0x33')]=_[_0xf649('0x34')](_0x36bb98,'name');_0x19d561[_0xf649('0x35')]=_[_0xf649('0x36')](_0x36b443[_0xf649('0x35')]);_0x19d561[_0xf649('0x37')]=_[_0xf649('0x38')](_0x19d561['model'],_0x19d561[_0xf649('0x35')]);_0x4131ba[_0xf649('0x39')]=_[_0xf649('0x38')](_0x19d561[_0xf649('0x33')],qs[_0xf649('0x3a')](_0x36b443[_0xf649('0x35')]['fields']));_0x4131ba[_0xf649('0x39')]=_0x4131ba[_0xf649('0x39')][_0xf649('0x3b')]?_0x4131ba[_0xf649('0x39')]:_0x19d561['model'];if(!_0x36b443[_0xf649('0x35')][_0xf649('0x3c')](_0xf649('0x3d'))){_0x4131ba[_0xf649('0x1e')]=qs['limit'](_0x36b443[_0xf649('0x35')]['limit']);_0x4131ba[_0xf649('0x1c')]=qs['offset'](_0x36b443[_0xf649('0x35')]['offset']);}_0x4131ba[_0xf649('0x3e')]=qs['sort'](_0x36b443['query'][_0xf649('0x3f')]);_0x4131ba[_0xf649('0x40')]=qs['filters'](_[_0xf649('0x41')](_0x36b443[_0xf649('0x35')],_0x19d561[_0xf649('0x37')]),_0x36bb98);if(_0x36b443[_0xf649('0x35')]['filter']){_0x4131ba[_0xf649('0x40')]=_[_0xf649('0x42')](_0x4131ba['where'],{'$or':_['map'](_0x36bb98,function(_0x1aa4f5){if(_0x1aa4f5[_0xf649('0x31')]!==_0xf649('0x43')){var _0x447084={};_0x447084[_0x1aa4f5[_0xf649('0x2b')]]={'$like':'%'+_0x36b443[_0xf649('0x35')][_0xf649('0x44')]+'%'};return _0x447084;}})});}_0x4131ba=_[_0xf649('0x42')]({},_0x4131ba,_0x36b443['options']);var _0x42c0dd={'where':_0x4131ba[_0xf649('0x40')]};return db[_0xf649('0x2e')][_0xf649('0x1f')](_0x42c0dd)[_0xf649('0x24')](function(_0x4bb9da){_0x200f24['count']=_0x4bb9da;if(_0x36b443[_0xf649('0x35')][_0xf649('0x45')]){_0x4131ba['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0xf649('0x46')](_0x4131ba);})[_0xf649('0x24')](function(_0x184c10){_0x200f24[_0xf649('0x47')]=_0x184c10;return _0x200f24;})[_0xf649('0x24')](respondWithFilteredResult(_0x244763,_0x4131ba))['catch'](handleError(_0x244763,null));};exports[_0xf649('0x48')]=function(_0x3fdba5,_0x1fb905){var _0x87af3c={'raw':!![],'where':{'id':_0x3fdba5[_0xf649('0x49')]['id']}},_0x438b55={};_0x438b55[_0xf649('0x33')]=_[_0xf649('0x36')](db[_0xf649('0x2e')]['rawAttributes']);_0x438b55['query']=_[_0xf649('0x36')](_0x3fdba5[_0xf649('0x35')]);_0x438b55[_0xf649('0x37')]=_[_0xf649('0x38')](_0x438b55[_0xf649('0x33')],_0x438b55['query']);_0x87af3c['attributes']=_['intersection'](_0x438b55[_0xf649('0x33')],qs[_0xf649('0x3a')](_0x3fdba5[_0xf649('0x35')][_0xf649('0x3a')]));_0x87af3c[_0xf649('0x39')]=_0x87af3c[_0xf649('0x39')][_0xf649('0x3b')]?_0x87af3c['attributes']:_0x438b55[_0xf649('0x33')];if(_0x3fdba5[_0xf649('0x35')][_0xf649('0x45')]){_0x87af3c['include']=[{'all':!![]}];}_0x87af3c=_[_0xf649('0x42')]({},_0x87af3c,_0x3fdba5[_0xf649('0x4a')]);return db['WhatsappQueue']['find'](_0x87af3c)[_0xf649('0x24')](handleEntityNotFound(_0x1fb905,null))[_0xf649('0x24')](respondWithResult(_0x1fb905,null))[_0xf649('0x4b')](handleError(_0x1fb905,null));};exports[_0xf649('0x4c')]=function(_0x4684de,_0x38a794){return db[_0xf649('0x2e')][_0xf649('0x4c')](_0x4684de[_0xf649('0x4d')],{})[_0xf649('0x24')](function(_0x4ec3ad){var _0x51ae0d=_0x4684de[_0xf649('0x4e')][_0xf649('0x25')]({'plain':!![]});if(!_0x51ae0d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51ae0d[_0xf649('0x4f')]==='user'){var _0x485abe=_0x4ec3ad[_0xf649('0x25')]({'plain':!![]});var _0x4ce753='WhatsappQueues';return db[_0xf649('0x50')]['find']({'where':{'name':_0x4ce753,'userProfileId':_0x51ae0d[_0xf649('0x51')]},'raw':!![]})[_0xf649('0x24')](function(_0x389af7){if(_0x389af7&&_0x389af7[_0xf649('0x52')]===0x0){return db[_0xf649('0x53')][_0xf649('0x4c')]({'name':_0x485abe['name'],'resourceId':_0x485abe['id'],'type':_0x389af7[_0xf649('0x2b')],'sectionId':_0x389af7['id']},{})[_0xf649('0x24')](function(){return _0x4ec3ad;});}else{return _0x4ec3ad;}})['catch'](function(_0x4ec115){logger[_0xf649('0x29')](_0xf649('0x54'),_0x4ec115);throw _0x4ec115;});}return _0x4ec3ad;})[_0xf649('0x24')](respondWithResult(_0x38a794,0xc9))['catch'](handleError(_0x38a794,null));};exports['update']=function(_0x4c7c80,_0x2730ed){if(_0x4c7c80[_0xf649('0x4d')]['id']){delete _0x4c7c80[_0xf649('0x4d')]['id'];}return db[_0xf649('0x2e')]['find']({'where':{'id':_0x4c7c80[_0xf649('0x49')]['id']}})['then'](handleEntityNotFound(_0x2730ed,null))[_0xf649('0x24')](saveUpdates(_0x4c7c80['body'],null))[_0xf649('0x24')](respondWithResult(_0x2730ed,null))[_0xf649('0x4b')](handleError(_0x2730ed,null));};exports['destroy']=function(_0x3f823d,_0x448f3b){return db[_0xf649('0x2e')][_0xf649('0x55')]({'where':{'id':_0x3f823d[_0xf649('0x49')]['id']}})['then'](handleEntityNotFound(_0x448f3b,null))[_0xf649('0x24')](removeEntity(_0x448f3b,null))[_0xf649('0x4b')](handleError(_0x448f3b,null));};exports[_0xf649('0x56')]=function(_0x2cd026,_0x3b8615){return db['WhatsappQueue']['describe']()[_0xf649('0x24')](respondWithResult(_0x3b8615,null))[_0xf649('0x4b')](handleError(_0x3b8615,null));};exports[_0xf649('0x57')]=function(_0x4a35b1,_0x4fe38d,_0x8d5dcc){var _0x16007d={'raw':!![],'where':{}},_0x243d7f={},_0x4be1a3;return db['WhatsappQueue'][_0xf649('0x58')]({'where':{'id':_0x4a35b1[_0xf649('0x49')]['id']}})[_0xf649('0x24')](handleEntityNotFound(_0x4fe38d,null))[_0xf649('0x24')](function(_0x5d4c26){if(_0x5d4c26){_0x4be1a3=_0x5d4c26[_0xf649('0x25')]({'plain':!![]});_0x243d7f[_0xf649('0x33')]=_[_0xf649('0x36')](db['UserWhatsappQueue'][_0xf649('0x2f')]);_0x243d7f[_0xf649('0x35')]=_[_0xf649('0x36')](_0x4a35b1[_0xf649('0x35')]);_0x243d7f[_0xf649('0x37')]=_[_0xf649('0x38')](_0x243d7f[_0xf649('0x33')],_0x243d7f[_0xf649('0x35')]);_0x16007d[_0xf649('0x39')]=_[_0xf649('0x38')](_0x243d7f[_0xf649('0x33')],qs['fields'](_0x4a35b1[_0xf649('0x35')][_0xf649('0x3a')]));_0x16007d[_0xf649('0x39')]=_0x16007d[_0xf649('0x39')][_0xf649('0x3b')]?_0x16007d[_0xf649('0x39')]:_0x243d7f[_0xf649('0x33')];if(!_0x4a35b1[_0xf649('0x35')][_0xf649('0x3c')](_0xf649('0x3d'))){_0x16007d[_0xf649('0x1e')]=qs[_0xf649('0x1e')](_0x4a35b1[_0xf649('0x35')][_0xf649('0x1e')]);_0x16007d['offset']=qs['offset'](_0x4a35b1[_0xf649('0x35')][_0xf649('0x1c')]);}_0x16007d[_0xf649('0x3e')]=qs['sort'](_0x4a35b1[_0xf649('0x35')][_0xf649('0x3f')]);_0x16007d[_0xf649('0x40')]=qs[_0xf649('0x37')](_[_0xf649('0x41')](_0x4a35b1['query'],_0x243d7f[_0xf649('0x37')]));_0x16007d[_0xf649('0x40')][_0xf649('0x59')]=_0x5d4c26['id'];if(_0x4a35b1[_0xf649('0x35')][_0xf649('0x44')]){_0x16007d[_0xf649('0x40')]=_[_0xf649('0x42')](_0x16007d['where'],{'$or':_[_0xf649('0x34')](_0x16007d['attributes'],function(_0x13b0e5){var _0x5f40af={};_0x5f40af[_0x13b0e5]={'$like':'%'+_0x4a35b1[_0xf649('0x35')]['filter']+'%'};return _0x5f40af;})});}_0x16007d=_[_0xf649('0x42')]({},_0x16007d,_0x4a35b1['options']);return db[_0xf649('0x5a')][_0xf649('0x46')](_0x16007d);}})['then'](function(_0x548ae3){if(_0x548ae3){return db[_0xf649('0x5b')][_0xf649('0x5c')]({'where':{'id':_[_0xf649('0x34')](_0x548ae3,_0xf649('0x5d')),'role':_0xf649('0x5e')},'attributes':['id','name','whatsappPause',_0xf649('0x5f'),_0xf649('0x60')]});}})[_0xf649('0x24')](function(_0x10a0b1){if(_0x10a0b1){return{'count':_0x10a0b1[_0xf649('0x1f')],'rows':_['map'](_0x10a0b1[_0xf649('0x47')],function(_0x38ef22){return{'membername':_0x38ef22[_0xf649('0x2b')],'UserId':_0x38ef22['id'],'queue_name':_0x4be1a3[_0xf649('0x2b')],'WhatsappQueueId':_0x4be1a3['id'],'interface':util[_0xf649('0x61')](_0xf649('0x62'),'SIP',_0x38ef22[_0xf649('0x2b')]),'penalty':0x0,'paused':_0x38ef22[_0xf649('0x63')],'createdAt':_0x38ef22[_0xf649('0x60')],'updatedAt':_0x38ef22[_0xf649('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf649('0x24')](respondWithFilteredResult(_0x4fe38d,_0x16007d))[_0xf649('0x4b')](handleError(_0x4fe38d,null));};exports['getTeams']=function(_0x471a10,_0x5f0753,_0x6f8503){var _0x45f04d={};var _0x248c99={};var _0x422786;var _0x9faa4d;return db['WhatsappQueue']['findOne']({'where':{'id':_0x471a10[_0xf649('0x49')]['id']}})['then'](handleEntityNotFound(_0x5f0753,null))[_0xf649('0x24')](function(_0x4bbf1b){if(_0x4bbf1b){_0x422786=_0x4bbf1b;_0x248c99['model']=_[_0xf649('0x36')](db[_0xf649('0x64')][_0xf649('0x2f')]);_0x248c99['query']=_[_0xf649('0x36')](_0x471a10[_0xf649('0x35')]);_0x248c99[_0xf649('0x37')]=_[_0xf649('0x38')](_0x248c99[_0xf649('0x33')],_0x248c99[_0xf649('0x35')]);_0x45f04d[_0xf649('0x39')]=_['intersection'](_0x248c99[_0xf649('0x33')],qs[_0xf649('0x3a')](_0x471a10[_0xf649('0x35')][_0xf649('0x3a')]));_0x45f04d[_0xf649('0x39')]=_0x45f04d[_0xf649('0x39')][_0xf649('0x3b')]?_0x45f04d['attributes']:_0x248c99['model'];_0x45f04d[_0xf649('0x3e')]=qs['sort'](_0x471a10['query'][_0xf649('0x3f')]);_0x45f04d[_0xf649('0x40')]=qs[_0xf649('0x37')](_['pick'](_0x471a10[_0xf649('0x35')],_0x248c99['filters']));if(_0x471a10['query'][_0xf649('0x44')]){_0x45f04d[_0xf649('0x40')]=_[_0xf649('0x42')](_0x45f04d[_0xf649('0x40')],{'$or':_[_0xf649('0x34')](_0x45f04d['attributes'],function(_0x58a928){var _0x13f9a4={};_0x13f9a4[_0x58a928]={'$like':'%'+_0x471a10['query'][_0xf649('0x44')]+'%'};return _0x13f9a4;})});}_0x45f04d=_[_0xf649('0x42')]({},_0x45f04d,_0x471a10[_0xf649('0x4a')]);return _0x422786[_0xf649('0x65')](_0x45f04d);}})[_0xf649('0x24')](function(_0x2b4204){if(_0x2b4204){_0x9faa4d=_0x2b4204[_0xf649('0x3b')];if(!_0x471a10['query'][_0xf649('0x3c')](_0xf649('0x3d'))){_0x45f04d[_0xf649('0x1e')]=qs[_0xf649('0x1e')](_0x471a10['query'][_0xf649('0x1e')]);_0x45f04d[_0xf649('0x1c')]=qs['offset'](_0x471a10['query'][_0xf649('0x1c')]);}return _0x422786['getTeams'](_0x45f04d);}})[_0xf649('0x24')](function(_0x3225ad){if(_0x3225ad){return _0x3225ad?{'count':_0x9faa4d,'rows':_0x3225ad}:null;}})[_0xf649('0x24')](respondWithResult(_0x5f0753,null))[_0xf649('0x4b')](handleError(_0x5f0753,null));};exports[_0xf649('0x66')]=function(_0x431b23,_0x1d67bb,_0x58d5a7){var _0x5aedb1=_0x431b23['body'][_0xf649('0x67')];return db[_0xf649('0x64')][_0xf649('0x46')]({'where':{'id':_0x5aedb1},'attributes':['id'],'include':[{'model':db[_0xf649('0x5b')],'as':_0xf649('0x68'),'attributes':['id',_0xf649('0x2b'),_0xf649('0x69'),'voicePause',_0xf649('0x6a')],'raw':!![]}]})['then'](function(_0x2b9fdf){if(_0x2b9fdf){var _0x5472dd=_['flatMap'](_0x2b9fdf,function(_0x247012){var _0xcbb95c=_0x247012['get']({'plain':!![]});return _0xcbb95c[_0xf649('0x68')];});return db[_0xf649('0x2e')][_0xf649('0x55')]({'where':{'id':_0x431b23[_0xf649('0x49')]['id']}})[_0xf649('0x24')](function(_0x483717){return db[_0xf649('0x6b')][_0xf649('0x6c')](function(_0x4b559a){return _0x483717[_0xf649('0x66')](_0x5aedb1,{'transaction':_0x4b559a})[_0xf649('0x24')](function(){return BPromise[_0xf649('0x6d')](_0x5472dd,function(_0x4b25e2){return db[_0xf649('0x5a')][_0xf649('0x6e')]({'where':{'UserId':_0x4b25e2['id'],'WhatsappQueueId':_0x431b23[_0xf649('0x49')]['id']},'transaction':_0x4b559a});});})[_0xf649('0x24')](function(){_0x5472dd['forEach'](function(_0x3ac11e){socket['emit'](_0xf649('0x6f'),{'UserId':_0x3ac11e['id'],'WhatsappQueueId':_0x483717['id']});});});});});}})[_0xf649('0x24')](respondWithStatusCode(_0x1d67bb,null))[_0xf649('0x4b')](handleError(_0x1d67bb,null));};exports[_0xf649('0x70')]=function(_0x15a1ba,_0x4208db,_0x1f0d13){return db[_0xf649('0x64')][_0xf649('0x46')]({'where':{'id':_0x15a1ba[_0xf649('0x35')][_0xf649('0x67')]},'attributes':['id'],'include':[{'model':db[_0xf649('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf649('0x24')](handleEntityNotFound(_0x4208db,null))[_0xf649('0x24')](function(_0x4ffc34){var _0x25df31=_['map'](_0x4ffc34,'id');var _0x3762bb=[];var _0x240988=[];var _0x4a880b=squel['select']();_0x4a880b[_0xf649('0x71')](_0xf649('0x72'))[_0xf649('0x73')](_0xf649('0x74'),'tq')[_0xf649('0x75')](_0xf649('0x76'),'ut',_0xf649('0x77'))[_0xf649('0x40')]('WhatsappQueueId\x20=\x20?',_0x15a1ba[_0xf649('0x49')]['id']);for(var _0xddf38d=0x0;_0xddf38d<_0x4ffc34['length'];_0xddf38d+=0x1){let _0x4c9c86=_0x4ffc34[_0xddf38d];for(var _0x1e9793=0x0;_0x1e9793<_0x4c9c86[_0xf649('0x68')][_0xf649('0x3b')];_0x1e9793+=0x1){let _0x5841f4=_0x4c9c86['Agents'][_0x1e9793];var _0x269da7=_0x4a880b[_0xf649('0x78')]();_0x269da7[_0xf649('0x40')](_0xf649('0x79'),_0x5841f4['id']);_0x240988['push'](db['sequelize'][_0xf649('0x35')](_0x269da7[_0xf649('0x7a')](),{'type':db[_0xf649('0x6b')][_0xf649('0x7b')][_0xf649('0x7c')]})[_0xf649('0x24')](function(_0xf7ded8){if(_0xf7ded8[_0xf649('0x3b')]===0x1){return _0x5841f4['id'];}else{var _0x235a37=_[_0xf649('0x7d')](_[_0xf649('0x34')](_0xf7ded8,_0xf649('0x7e')),function(_0x437069){return _[_0xf649('0x7f')](_0x25df31,_0x437069);});if(_0x235a37){return _0x5841f4['id'];}}}));}}return BPromise[_0xf649('0x80')](_0x240988)[_0xf649('0x24')](function(_0x548d1f){_0x3762bb=_(_0x3762bb)[_0xf649('0x81')](_0x548d1f)[_0xf649('0x82')]()[_0xf649('0x83')]();return db['WhatsappQueue'][_0xf649('0x55')]({'where':{'id':_0x15a1ba[_0xf649('0x49')]['id']}})['then'](function(_0x1add45){return db['sequelize']['transaction'](function(_0x570211){return _0x1add45['removeTeams'](_0x15a1ba[_0xf649('0x35')]['ids'],{'transaction':_0x570211})[_0xf649('0x24')](function(){if(!_['isEmpty'](_0x3762bb)){return _0x1add45[_0xf649('0x84')](_0x3762bb,{'transaction':_0x570211});}})[_0xf649('0x24')](function(){_0x3762bb[_0xf649('0x85')](function(_0x27654b){socket['emit'](_0xf649('0x86'),{'UserId':_0x27654b,'WhatsappQueueId':_0x1add45['id']});});});});});});})['then'](respondWithStatusCode(_0x4208db,null))[_0xf649('0x4b')](handleError(_0x4208db,null));};exports[_0xf649('0x87')]=function(_0x1a2673,_0x3e60ef,_0x36adac){return db['WhatsappQueue'][_0xf649('0x55')]({'where':{'id':_0x1a2673[_0xf649('0x49')]['id']}})[_0xf649('0x24')](handleEntityNotFound(_0x3e60ef,null))['then'](function(_0x11ee19){if(_0x11ee19){return _0x11ee19[_0xf649('0x87')](_0x1a2673[_0xf649('0x4d')][_0xf649('0x67')],_[_0xf649('0x88')](_0x1a2673['body'],[_0xf649('0x67'),'id'])||{})['spread'](function(_0x5146ef){for(var _0x19a169=0x0;_0x19a169<_0x1a2673[_0xf649('0x4d')][_0xf649('0x67')][_0xf649('0x3b')];_0x19a169+=0x1){socket[_0xf649('0x89')](_0xf649('0x6f'),{'UserId':Number(_0x1a2673['body']['ids'][_0x19a169]),'WhatsappQueueId':Number(_0x1a2673['params']['id'])});}return _0x5146ef;});}})[_0xf649('0x24')](respondWithResult(_0x3e60ef,null))[_0xf649('0x4b')](handleError(_0x3e60ef,null));};exports[_0xf649('0x84')]=function(_0x3fa31a,_0x517fe1,_0x4c6cdd){return db[_0xf649('0x2e')]['find']({'where':{'id':_0x3fa31a['params']['id']}})[_0xf649('0x24')](handleEntityNotFound(_0x517fe1,null))[_0xf649('0x24')](function(_0x236b08){if(_0x236b08){return _0x236b08[_0xf649('0x84')](_0x3fa31a[_0xf649('0x35')][_0xf649('0x67')])[_0xf649('0x24')](function(){if(_[_0xf649('0x8a')](_0x3fa31a[_0xf649('0x35')][_0xf649('0x67')])){for(var _0x23fd89=0x0;_0x23fd89<_0x3fa31a['query']['ids']['length'];_0x23fd89+=0x1){socket[_0xf649('0x89')](_0xf649('0x86'),{'UserId':Number(_0x3fa31a[_0xf649('0x35')]['ids'][_0x23fd89]),'WhatsappQueueId':Number(_0x3fa31a[_0xf649('0x49')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x3fa31a[_0xf649('0x35')][_0xf649('0x67')]),'WhatsappQueueId':Number(_0x3fa31a[_0xf649('0x49')]['id'])});}});}})[_0xf649('0x24')](respondWithStatusCode(_0x517fe1,null))[_0xf649('0x4b')](handleError(_0x517fe1,null));};exports[_0xf649('0x8b')]=function(_0x3bd7a4,_0x594851,_0x12445b){var _0x2ceb96={};var _0x5ad0e4={};var _0x4b3fec;var _0x3c7b93;return db[_0xf649('0x2e')][_0xf649('0x58')]({'where':{'id':_0x3bd7a4[_0xf649('0x49')]['id']}})[_0xf649('0x24')](handleEntityNotFound(_0x594851,null))[_0xf649('0x24')](function(_0x3e1715){if(_0x3e1715){_0x4b3fec=_0x3e1715;_0x5ad0e4[_0xf649('0x33')]=_[_0xf649('0x36')](db['User'][_0xf649('0x2f')]);_0x5ad0e4['query']=_[_0xf649('0x36')](_0x3bd7a4[_0xf649('0x35')]);_0x5ad0e4[_0xf649('0x37')]=_['intersection'](_0x5ad0e4[_0xf649('0x33')],_0x5ad0e4[_0xf649('0x35')]);_0x2ceb96[_0xf649('0x39')]=_[_0xf649('0x38')](_0x5ad0e4[_0xf649('0x33')],qs[_0xf649('0x3a')](_0x3bd7a4[_0xf649('0x35')]['fields']));_0x2ceb96[_0xf649('0x39')]=_0x2ceb96[_0xf649('0x39')][_0xf649('0x3b')]?_0x2ceb96[_0xf649('0x39')]:_0x5ad0e4['model'];_0x2ceb96[_0xf649('0x3e')]=qs['sort'](_0x3bd7a4[_0xf649('0x35')][_0xf649('0x3f')]);_0x2ceb96[_0xf649('0x40')]=qs[_0xf649('0x37')](_[_0xf649('0x41')](_0x3bd7a4['query'],_0x5ad0e4[_0xf649('0x37')]));if(_0x3bd7a4[_0xf649('0x35')][_0xf649('0x44')]){_0x2ceb96['where']=_[_0xf649('0x42')](_0x2ceb96[_0xf649('0x40')],{'$or':_['map'](_0x2ceb96[_0xf649('0x39')],function(_0x54e12c){var _0x56bd2e={};_0x56bd2e[_0x54e12c]={'$like':'%'+_0x3bd7a4[_0xf649('0x35')][_0xf649('0x44')]+'%'};return _0x56bd2e;})});}_0x2ceb96=_[_0xf649('0x42')]({},_0x2ceb96,_0x3bd7a4[_0xf649('0x4a')]);return _0x4b3fec[_0xf649('0x8b')](_0x2ceb96);}})['then'](function(_0x540647){if(_0x540647){_0x3c7b93=_0x540647[_0xf649('0x3b')];if(!_0x3bd7a4[_0xf649('0x35')][_0xf649('0x3c')]('nolimit')){_0x2ceb96[_0xf649('0x1e')]=qs['limit'](_0x3bd7a4[_0xf649('0x35')][_0xf649('0x1e')]);_0x2ceb96[_0xf649('0x1c')]=qs[_0xf649('0x1c')](_0x3bd7a4[_0xf649('0x35')][_0xf649('0x1c')]);}return _0x4b3fec[_0xf649('0x8b')](_0x2ceb96);}})[_0xf649('0x24')](function(_0x444fb6){if(_0x444fb6){return _0x444fb6?{'count':_0x3c7b93,'rows':_0x444fb6}:null;}})[_0xf649('0x24')](respondWithResult(_0x594851,null))['catch'](handleError(_0x594851,null));}; \ No newline at end of file +var _0xf680=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','WhatsappQueue','findAll','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','params','describe','findOne','UserWhatsappQueue','hasOwnProperty','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','Team','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','userWhatsappQueue:save','isArray','getAgents','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','limit','count','Content-Range','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xf680,0x1db));var _0x0f68=function(_0x3ecb3a,_0x4028e2){_0x3ecb3a=_0x3ecb3a-0x0;var _0x5f3dbe=_0xf680[_0x3ecb3a];return _0x5f3dbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f68('0x0'));var rp=require(_0x0f68('0x1'));var moment=require('moment');var BPromise=require(_0x0f68('0x2'));var Mustache=require(_0x0f68('0x3'));var util=require(_0x0f68('0x4'));var path=require(_0x0f68('0x5'));var sox=require(_0x0f68('0x6'));var csv=require(_0x0f68('0x7'));var ejs=require(_0x0f68('0x8'));var fs=require('fs');var fs_extra=require(_0x0f68('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f68('0xa'));var deskjs=require(_0x0f68('0xb'));var toCsv=require(_0x0f68('0x7'));var querystring=require(_0x0f68('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0f68('0xd'));var qs=require(_0x0f68('0xe'));var as=require(_0x0f68('0xf'));var hardwareService=require(_0x0f68('0x10'));var logger=require(_0x0f68('0x11'))('api');var utils=require(_0x0f68('0x12'));var config=require(_0x0f68('0x13'));var licenseUtil=require(_0x0f68('0x14'));var db=require(_0x0f68('0x15'))['db'];config[_0x0f68('0x16')]=_['defaults'](config['redis'],{'host':_0x0f68('0x17'),'port':0x18eb});var socket=require(_0x0f68('0x18'))(new Redis(config[_0x0f68('0x16')]));require(_0x0f68('0x19'))[_0x0f68('0x1a')](socket);function respondWithStatusCode(_0x911da9,_0x5e4816){_0x5e4816=_0x5e4816||0xcc;return function(_0x45296f){if(_0x45296f){return _0x911da9[_0x0f68('0x1b')](_0x5e4816);}return _0x911da9[_0x0f68('0x1c')](_0x5e4816)[_0x0f68('0x1d')]();};}function respondWithResult(_0x1cb1e0,_0x9ee39d){_0x9ee39d=_0x9ee39d||0xc8;return function(_0x110578){if(_0x110578){return _0x1cb1e0[_0x0f68('0x1c')](_0x9ee39d)['json'](_0x110578);}};}function respondWithFilteredResult(_0x488f5c,_0x372f83){return function(_0x1aa973){if(_0x1aa973){var _0x259d88=typeof _0x372f83[_0x0f68('0x1e')]==='undefined'&&typeof _0x372f83[_0x0f68('0x1f')]==='undefined';var _0x3e5f4c=_0x1aa973[_0x0f68('0x20')];var _0xb362cf=_0x259d88?0x0:_0x372f83[_0x0f68('0x1e')];var _0x5a54c2=_0x259d88?_0x1aa973[_0x0f68('0x20')]:_0x372f83[_0x0f68('0x1e')]+_0x372f83[_0x0f68('0x1f')];var _0x3ede89;if(_0x5a54c2>=_0x3e5f4c){_0x5a54c2=_0x3e5f4c;_0x3ede89=0xc8;}else{_0x3ede89=0xce;}_0x488f5c[_0x0f68('0x1c')](_0x3ede89);return _0x488f5c['set'](_0x0f68('0x21'),_0xb362cf+'-'+_0x5a54c2+'/'+_0x3e5f4c)['json'](_0x1aa973);}return null;};}function patchUpdates(_0x2aa066){return function(_0x2d844b){try{jsonpatch['apply'](_0x2d844b,_0x2aa066,!![]);}catch(_0x29ef54){return BPromise['reject'](_0x29ef54);}return _0x2d844b[_0x0f68('0x22')]();};}function saveUpdates(_0x45f24e,_0x404329){return function(_0x3f54bf){if(_0x3f54bf){return _0x3f54bf[_0x0f68('0x23')](_0x45f24e)[_0x0f68('0x24')](function(_0x515cc6){return _0x515cc6;});}return null;};}function removeEntity(_0x4c7749,_0xcf4c15){return function(_0x3173ef){if(_0x3173ef){return _0x3173ef[_0x0f68('0x25')]()['then'](function(){var _0x14e592=_0x3173ef[_0x0f68('0x26')]({'plain':!![]});var _0x362100=_0x0f68('0x27');return db[_0x0f68('0x28')][_0x0f68('0x25')]({'where':{'type':_0x362100,'resourceId':_0x14e592['id']}})[_0x0f68('0x24')](function(){return _0x3173ef;});})[_0x0f68('0x24')](function(){_0x4c7749['status'](0xcc)[_0x0f68('0x1d')]();});}};}function handleEntityNotFound(_0x4cf7db,_0x3507b9){return function(_0x39d674){if(!_0x39d674){_0x4cf7db[_0x0f68('0x1b')](0x194);}return _0x39d674;};}function handleError(_0x13527e,_0x23faa8){_0x23faa8=_0x23faa8||0x1f4;return function(_0x5ce9ff){logger[_0x0f68('0x29')](_0x5ce9ff[_0x0f68('0x2a')]);if(_0x5ce9ff['name']){delete _0x5ce9ff[_0x0f68('0x2b')];}_0x13527e[_0x0f68('0x1c')](_0x23faa8)['send'](_0x5ce9ff);};}exports[_0x0f68('0x2c')]=function(_0xa7468a,_0x2d8a4d){var _0x539320={},_0x4620a9={},_0x356851={'count':0x0,'rows':[]};var _0x2e88aa=_[_0x0f68('0x2d')](db['WhatsappQueue'][_0x0f68('0x2e')],function(_0xb1b1fe){return{'name':_0xb1b1fe[_0x0f68('0x2f')],'type':_0xb1b1fe[_0x0f68('0x30')][_0x0f68('0x31')]};});_0x4620a9[_0x0f68('0x32')]=_[_0x0f68('0x2d')](_0x2e88aa,_0x0f68('0x2b'));_0x4620a9[_0x0f68('0x33')]=_[_0x0f68('0x34')](_0xa7468a[_0x0f68('0x33')]);_0x4620a9[_0x0f68('0x35')]=_[_0x0f68('0x36')](_0x4620a9[_0x0f68('0x32')],_0x4620a9['query']);_0x539320[_0x0f68('0x37')]=_[_0x0f68('0x36')](_0x4620a9[_0x0f68('0x32')],qs[_0x0f68('0x38')](_0xa7468a['query']['fields']));_0x539320[_0x0f68('0x37')]=_0x539320[_0x0f68('0x37')][_0x0f68('0x39')]?_0x539320[_0x0f68('0x37')]:_0x4620a9[_0x0f68('0x32')];if(!_0xa7468a['query']['hasOwnProperty'](_0x0f68('0x3a'))){_0x539320[_0x0f68('0x1f')]=qs[_0x0f68('0x1f')](_0xa7468a[_0x0f68('0x33')][_0x0f68('0x1f')]);_0x539320['offset']=qs[_0x0f68('0x1e')](_0xa7468a[_0x0f68('0x33')]['offset']);}_0x539320[_0x0f68('0x3b')]=qs[_0x0f68('0x3c')](_0xa7468a[_0x0f68('0x33')][_0x0f68('0x3c')]);_0x539320['where']=qs[_0x0f68('0x35')](_[_0x0f68('0x3d')](_0xa7468a[_0x0f68('0x33')],_0x4620a9[_0x0f68('0x35')]),_0x2e88aa);if(_0xa7468a[_0x0f68('0x33')][_0x0f68('0x3e')]){_0x539320['where']=_[_0x0f68('0x3f')](_0x539320[_0x0f68('0x40')],{'$or':_[_0x0f68('0x2d')](_0x2e88aa,function(_0x5ee53d){if(_0x5ee53d[_0x0f68('0x30')]!==_0x0f68('0x41')){var _0x1f0f4b={};_0x1f0f4b[_0x5ee53d[_0x0f68('0x2b')]]={'$like':'%'+_0xa7468a['query'][_0x0f68('0x3e')]+'%'};return _0x1f0f4b;}})});}_0x539320=_[_0x0f68('0x3f')]({},_0x539320,_0xa7468a[_0x0f68('0x42')]);var _0x27b9ce={'where':_0x539320[_0x0f68('0x40')]};return db['WhatsappQueue'][_0x0f68('0x20')](_0x27b9ce)['then'](function(_0x2ede37){_0x356851['count']=_0x2ede37;if(_0xa7468a[_0x0f68('0x33')]['includeAll']){_0x539320[_0x0f68('0x43')]=[{'all':!![]}];}return db[_0x0f68('0x44')][_0x0f68('0x45')](_0x539320);})[_0x0f68('0x24')](function(_0x22e413){_0x356851['rows']=_0x22e413;return _0x356851;})[_0x0f68('0x24')](respondWithFilteredResult(_0x2d8a4d,_0x539320))['catch'](handleError(_0x2d8a4d,null));};exports[_0x0f68('0x46')]=function(_0x781022,_0x3c4e6b){var _0x16af3b={'raw':!![],'where':{'id':_0x781022['params']['id']}},_0x2eeb89={};_0x2eeb89[_0x0f68('0x32')]=_[_0x0f68('0x34')](db[_0x0f68('0x44')][_0x0f68('0x2e')]);_0x2eeb89['query']=_[_0x0f68('0x34')](_0x781022[_0x0f68('0x33')]);_0x2eeb89[_0x0f68('0x35')]=_[_0x0f68('0x36')](_0x2eeb89[_0x0f68('0x32')],_0x2eeb89[_0x0f68('0x33')]);_0x16af3b[_0x0f68('0x37')]=_[_0x0f68('0x36')](_0x2eeb89[_0x0f68('0x32')],qs[_0x0f68('0x38')](_0x781022['query'][_0x0f68('0x38')]));_0x16af3b[_0x0f68('0x37')]=_0x16af3b[_0x0f68('0x37')][_0x0f68('0x39')]?_0x16af3b[_0x0f68('0x37')]:_0x2eeb89[_0x0f68('0x32')];if(_0x781022[_0x0f68('0x33')]['includeAll']){_0x16af3b['include']=[{'all':!![]}];}_0x16af3b=_[_0x0f68('0x3f')]({},_0x16af3b,_0x781022[_0x0f68('0x42')]);return db[_0x0f68('0x44')][_0x0f68('0x47')](_0x16af3b)[_0x0f68('0x24')](handleEntityNotFound(_0x3c4e6b,null))['then'](respondWithResult(_0x3c4e6b,null))[_0x0f68('0x48')](handleError(_0x3c4e6b,null));};exports[_0x0f68('0x49')]=function(_0x2063a5,_0x474e0a){return db['WhatsappQueue'][_0x0f68('0x49')](_0x2063a5[_0x0f68('0x4a')],{})['then'](function(_0x5b5a8b){var _0x4ab0d1=_0x2063a5[_0x0f68('0x4b')][_0x0f68('0x26')]({'plain':!![]});if(!_0x4ab0d1)throw new Error(_0x0f68('0x4c'));if(_0x4ab0d1['role']===_0x0f68('0x4b')){var _0x21dad7=_0x5b5a8b[_0x0f68('0x26')]({'plain':!![]});var _0x50d19d='WhatsappQueues';return db[_0x0f68('0x4d')][_0x0f68('0x47')]({'where':{'name':_0x50d19d,'userProfileId':_0x4ab0d1[_0x0f68('0x4e')]},'raw':!![]})['then'](function(_0xd2e88){if(_0xd2e88&&_0xd2e88['autoAssociation']===0x0){return db[_0x0f68('0x28')][_0x0f68('0x49')]({'name':_0x21dad7[_0x0f68('0x2b')],'resourceId':_0x21dad7['id'],'type':_0xd2e88['name'],'sectionId':_0xd2e88['id']},{})[_0x0f68('0x24')](function(){return _0x5b5a8b;});}else{return _0x5b5a8b;}})['catch'](function(_0x241f4a){logger[_0x0f68('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x241f4a);throw _0x241f4a;});}return _0x5b5a8b;})[_0x0f68('0x24')](respondWithResult(_0x474e0a,0xc9))[_0x0f68('0x48')](handleError(_0x474e0a,null));};exports[_0x0f68('0x23')]=function(_0x22d2bb,_0x2ac4b2){if(_0x22d2bb[_0x0f68('0x4a')]['id']){delete _0x22d2bb[_0x0f68('0x4a')]['id'];}return db[_0x0f68('0x44')][_0x0f68('0x47')]({'where':{'id':_0x22d2bb[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0x2ac4b2,null))[_0x0f68('0x24')](saveUpdates(_0x22d2bb[_0x0f68('0x4a')],null))[_0x0f68('0x24')](respondWithResult(_0x2ac4b2,null))[_0x0f68('0x48')](handleError(_0x2ac4b2,null));};exports[_0x0f68('0x25')]=function(_0xb99556,_0xbb787b){return db['WhatsappQueue'][_0x0f68('0x47')]({'where':{'id':_0xb99556[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0xbb787b,null))[_0x0f68('0x24')](removeEntity(_0xbb787b,null))[_0x0f68('0x48')](handleError(_0xbb787b,null));};exports[_0x0f68('0x50')]=function(_0x43eb33,_0x5f0ba7){return db['WhatsappQueue'][_0x0f68('0x50')]()['then'](respondWithResult(_0x5f0ba7,null))[_0x0f68('0x48')](handleError(_0x5f0ba7,null));};exports['getMembers']=function(_0x4efe29,_0x1604b6,_0x52d65a){var _0x225874={'raw':!![],'where':{}},_0x5a1e56={},_0x43815f;return db[_0x0f68('0x44')][_0x0f68('0x51')]({'where':{'id':_0x4efe29['params']['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0x1604b6,null))[_0x0f68('0x24')](function(_0x3c7354){if(_0x3c7354){_0x43815f=_0x3c7354['get']({'plain':!![]});_0x5a1e56[_0x0f68('0x32')]=_[_0x0f68('0x34')](db[_0x0f68('0x52')]['rawAttributes']);_0x5a1e56[_0x0f68('0x33')]=_[_0x0f68('0x34')](_0x4efe29[_0x0f68('0x33')]);_0x5a1e56['filters']=_[_0x0f68('0x36')](_0x5a1e56[_0x0f68('0x32')],_0x5a1e56[_0x0f68('0x33')]);_0x225874['attributes']=_['intersection'](_0x5a1e56['model'],qs[_0x0f68('0x38')](_0x4efe29[_0x0f68('0x33')]['fields']));_0x225874[_0x0f68('0x37')]=_0x225874[_0x0f68('0x37')][_0x0f68('0x39')]?_0x225874[_0x0f68('0x37')]:_0x5a1e56[_0x0f68('0x32')];if(!_0x4efe29['query'][_0x0f68('0x53')](_0x0f68('0x3a'))){_0x225874[_0x0f68('0x1f')]=qs[_0x0f68('0x1f')](_0x4efe29[_0x0f68('0x33')][_0x0f68('0x1f')]);_0x225874[_0x0f68('0x1e')]=qs[_0x0f68('0x1e')](_0x4efe29['query'][_0x0f68('0x1e')]);}_0x225874['order']=qs[_0x0f68('0x3c')](_0x4efe29[_0x0f68('0x33')][_0x0f68('0x3c')]);_0x225874[_0x0f68('0x40')]=qs['filters'](_['pick'](_0x4efe29[_0x0f68('0x33')],_0x5a1e56[_0x0f68('0x35')]));_0x225874['where']['WhatsappQueueId']=_0x3c7354['id'];if(_0x4efe29[_0x0f68('0x33')][_0x0f68('0x3e')]){_0x225874['where']=_[_0x0f68('0x3f')](_0x225874[_0x0f68('0x40')],{'$or':_[_0x0f68('0x2d')](_0x225874['attributes'],function(_0x13aa34){var _0x117089={};_0x117089[_0x13aa34]={'$like':'%'+_0x4efe29[_0x0f68('0x33')][_0x0f68('0x3e')]+'%'};return _0x117089;})});}_0x225874=_[_0x0f68('0x3f')]({},_0x225874,_0x4efe29['options']);return db[_0x0f68('0x52')][_0x0f68('0x45')](_0x225874);}})[_0x0f68('0x24')](function(_0xc58677){if(_0xc58677){return db[_0x0f68('0x54')][_0x0f68('0x55')]({'where':{'id':_[_0x0f68('0x2d')](_0xc58677,_0x0f68('0x56')),'role':_0x0f68('0x57')},'attributes':['id',_0x0f68('0x2b'),_0x0f68('0x58'),'updatedAt',_0x0f68('0x59')]});}})[_0x0f68('0x24')](function(_0x57406f){if(_0x57406f){return{'count':_0x57406f['count'],'rows':_[_0x0f68('0x2d')](_0x57406f[_0x0f68('0x5a')],function(_0x2a2879){return{'membername':_0x2a2879['name'],'UserId':_0x2a2879['id'],'queue_name':_0x43815f['name'],'WhatsappQueueId':_0x43815f['id'],'interface':util[_0x0f68('0x5b')](_0x0f68('0x5c'),_0x0f68('0x5d'),_0x2a2879[_0x0f68('0x2b')]),'penalty':0x0,'paused':_0x2a2879[_0x0f68('0x58')],'createdAt':_0x2a2879['createdAt'],'updatedAt':_0x2a2879[_0x0f68('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f68('0x24')](respondWithFilteredResult(_0x1604b6,_0x225874))[_0x0f68('0x48')](handleError(_0x1604b6,null));};exports[_0x0f68('0x5f')]=function(_0x136380,_0x378dd6,_0x17b895){var _0x49c9f0={};var _0x3ac52d={};var _0x14ebc3;var _0x2b6180;return db['WhatsappQueue'][_0x0f68('0x51')]({'where':{'id':_0x136380[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0x378dd6,null))[_0x0f68('0x24')](function(_0x54e03f){if(_0x54e03f){_0x14ebc3=_0x54e03f;_0x3ac52d[_0x0f68('0x32')]=_[_0x0f68('0x34')](db['Team']['rawAttributes']);_0x3ac52d[_0x0f68('0x33')]=_['keys'](_0x136380['query']);_0x3ac52d[_0x0f68('0x35')]=_['intersection'](_0x3ac52d['model'],_0x3ac52d[_0x0f68('0x33')]);_0x49c9f0[_0x0f68('0x37')]=_[_0x0f68('0x36')](_0x3ac52d[_0x0f68('0x32')],qs[_0x0f68('0x38')](_0x136380[_0x0f68('0x33')]['fields']));_0x49c9f0[_0x0f68('0x37')]=_0x49c9f0[_0x0f68('0x37')][_0x0f68('0x39')]?_0x49c9f0[_0x0f68('0x37')]:_0x3ac52d['model'];_0x49c9f0['order']=qs[_0x0f68('0x3c')](_0x136380[_0x0f68('0x33')]['sort']);_0x49c9f0[_0x0f68('0x40')]=qs[_0x0f68('0x35')](_[_0x0f68('0x3d')](_0x136380[_0x0f68('0x33')],_0x3ac52d['filters']));if(_0x136380['query'][_0x0f68('0x3e')]){_0x49c9f0[_0x0f68('0x40')]=_[_0x0f68('0x3f')](_0x49c9f0['where'],{'$or':_[_0x0f68('0x2d')](_0x49c9f0[_0x0f68('0x37')],function(_0x4d9009){var _0x4ad6f3={};_0x4ad6f3[_0x4d9009]={'$like':'%'+_0x136380['query'][_0x0f68('0x3e')]+'%'};return _0x4ad6f3;})});}_0x49c9f0=_['merge']({},_0x49c9f0,_0x136380[_0x0f68('0x42')]);return _0x14ebc3[_0x0f68('0x5f')](_0x49c9f0);}})[_0x0f68('0x24')](function(_0x3f636f){if(_0x3f636f){_0x2b6180=_0x3f636f[_0x0f68('0x39')];if(!_0x136380[_0x0f68('0x33')][_0x0f68('0x53')](_0x0f68('0x3a'))){_0x49c9f0['limit']=qs[_0x0f68('0x1f')](_0x136380[_0x0f68('0x33')][_0x0f68('0x1f')]);_0x49c9f0['offset']=qs[_0x0f68('0x1e')](_0x136380[_0x0f68('0x33')][_0x0f68('0x1e')]);}return _0x14ebc3[_0x0f68('0x5f')](_0x49c9f0);}})['then'](function(_0x47ca08){if(_0x47ca08){return _0x47ca08?{'count':_0x2b6180,'rows':_0x47ca08}:null;}})['then'](respondWithResult(_0x378dd6,null))[_0x0f68('0x48')](handleError(_0x378dd6,null));};exports[_0x0f68('0x60')]=function(_0x29b9ac,_0x59de98,_0x3395be){var _0x51d169=_0x29b9ac[_0x0f68('0x4a')][_0x0f68('0x61')];return db['Team'][_0x0f68('0x45')]({'where':{'id':_0x51d169},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0f68('0x62'),'attributes':['id',_0x0f68('0x2b'),_0x0f68('0x63'),_0x0f68('0x64'),_0x0f68('0x65')],'raw':!![]}]})[_0x0f68('0x24')](function(_0x3d38da){if(_0x3d38da){var _0x47a787=_['flatMap'](_0x3d38da,function(_0x50d79f){var _0x2d198e=_0x50d79f['get']({'plain':!![]});return _0x2d198e['Agents'];});return db[_0x0f68('0x44')]['find']({'where':{'id':_0x29b9ac[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](function(_0x57bcbb){return db[_0x0f68('0x66')][_0x0f68('0x67')](function(_0x221728){return _0x57bcbb[_0x0f68('0x60')](_0x51d169,{'transaction':_0x221728})[_0x0f68('0x24')](function(){return BPromise['each'](_0x47a787,function(_0x1a289a){return db[_0x0f68('0x52')][_0x0f68('0x68')]({'where':{'UserId':_0x1a289a['id'],'WhatsappQueueId':_0x29b9ac['params']['id']},'transaction':_0x221728});});})['then'](function(){_0x47a787[_0x0f68('0x69')](function(_0xd44f5d){socket[_0x0f68('0x6a')]('userWhatsappQueue:save',{'UserId':_0xd44f5d['id'],'WhatsappQueueId':_0x57bcbb['id']});});});});});}})[_0x0f68('0x24')](respondWithStatusCode(_0x59de98,null))[_0x0f68('0x48')](handleError(_0x59de98,null));};exports[_0x0f68('0x6b')]=function(_0x2ec3be,_0x2b02e7,_0x1ca4e0){return db[_0x0f68('0x6c')][_0x0f68('0x45')]({'where':{'id':_0x2ec3be[_0x0f68('0x33')][_0x0f68('0x61')]},'attributes':['id'],'include':[{'model':db[_0x0f68('0x54')],'as':_0x0f68('0x62'),'attributes':['id'],'raw':!![]}]})[_0x0f68('0x24')](handleEntityNotFound(_0x2b02e7,null))[_0x0f68('0x24')](function(_0xb9d97a){var _0x8ac9cb=_[_0x0f68('0x2d')](_0xb9d97a,'id');var _0x33fe0f=[];var _0x3d940d=[];var _0x5d8cbc=squel[_0x0f68('0x6d')]();_0x5d8cbc['field'](_0x0f68('0x6e'))[_0x0f68('0x6f')]('team_has_whatsapp_queues','tq')[_0x0f68('0x70')]('user_has_teams','ut',_0x0f68('0x71'))['where'](_0x0f68('0x72'),_0x2ec3be['params']['id']);for(var _0x39dc8a=0x0;_0x39dc8a<_0xb9d97a[_0x0f68('0x39')];_0x39dc8a+=0x1){let _0x151cad=_0xb9d97a[_0x39dc8a];for(var _0x4c7ada=0x0;_0x4c7ada<_0x151cad[_0x0f68('0x62')][_0x0f68('0x39')];_0x4c7ada+=0x1){let _0x55103b=_0x151cad[_0x0f68('0x62')][_0x4c7ada];var _0x15edd6=_0x5d8cbc[_0x0f68('0x73')]();_0x15edd6[_0x0f68('0x40')]('ut.UserId\x20=\x20?',_0x55103b['id']);_0x3d940d[_0x0f68('0x74')](db[_0x0f68('0x66')][_0x0f68('0x33')](_0x15edd6[_0x0f68('0x75')](),{'type':db['sequelize']['QueryTypes'][_0x0f68('0x76')]})[_0x0f68('0x24')](function(_0x143c31){if(_0x143c31[_0x0f68('0x39')]===0x1){return _0x55103b['id'];}else{var _0x572194=_['every'](_[_0x0f68('0x2d')](_0x143c31,'TeamId'),function(_0x34151e){return _['includes'](_0x8ac9cb,_0x34151e);});if(_0x572194){return _0x55103b['id'];}}}));}}return BPromise[_0x0f68('0x77')](_0x3d940d)['then'](function(_0x2950a1){_0x33fe0f=_(_0x33fe0f)[_0x0f68('0x78')](_0x2950a1)[_0x0f68('0x79')]()[_0x0f68('0x7a')]();return db['WhatsappQueue']['find']({'where':{'id':_0x2ec3be[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](function(_0x1fe619){return db['sequelize']['transaction'](function(_0x420cec){return _0x1fe619['removeTeams'](_0x2ec3be[_0x0f68('0x33')][_0x0f68('0x61')],{'transaction':_0x420cec})[_0x0f68('0x24')](function(){if(!_[_0x0f68('0x7b')](_0x33fe0f)){return _0x1fe619[_0x0f68('0x7c')](_0x33fe0f,{'transaction':_0x420cec});}})[_0x0f68('0x24')](function(){_0x33fe0f['forEach'](function(_0x505d3c){socket[_0x0f68('0x6a')](_0x0f68('0x7d'),{'UserId':_0x505d3c,'WhatsappQueueId':_0x1fe619['id']});});});});});});})['then'](respondWithStatusCode(_0x2b02e7,null))[_0x0f68('0x48')](handleError(_0x2b02e7,null));};exports[_0x0f68('0x7e')]=function(_0x24b7b7,_0x2c31a1,_0x4750ec){return db[_0x0f68('0x44')]['find']({'where':{'id':_0x24b7b7[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0x2c31a1,null))[_0x0f68('0x24')](function(_0x340f4e){if(_0x340f4e){return _0x340f4e[_0x0f68('0x7e')](_0x24b7b7[_0x0f68('0x4a')][_0x0f68('0x61')],_['omit'](_0x24b7b7['body'],['ids','id'])||{})[_0x0f68('0x7f')](function(_0x454bed){for(var _0xaf8b5f=0x0;_0xaf8b5f<_0x24b7b7[_0x0f68('0x4a')]['ids']['length'];_0xaf8b5f+=0x1){socket[_0x0f68('0x6a')](_0x0f68('0x80'),{'UserId':Number(_0x24b7b7['body'][_0x0f68('0x61')][_0xaf8b5f]),'WhatsappQueueId':Number(_0x24b7b7[_0x0f68('0x4f')]['id'])});}return _0x454bed;});}})['then'](respondWithResult(_0x2c31a1,null))[_0x0f68('0x48')](handleError(_0x2c31a1,null));};exports[_0x0f68('0x7c')]=function(_0x4b885f,_0x3a4198,_0xb0731e){return db[_0x0f68('0x44')][_0x0f68('0x47')]({'where':{'id':_0x4b885f[_0x0f68('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3a4198,null))[_0x0f68('0x24')](function(_0x44bd88){if(_0x44bd88){return _0x44bd88[_0x0f68('0x7c')](_0x4b885f[_0x0f68('0x33')][_0x0f68('0x61')])[_0x0f68('0x24')](function(){if(_[_0x0f68('0x81')](_0x4b885f[_0x0f68('0x33')]['ids'])){for(var _0x961bef=0x0;_0x961bef<_0x4b885f[_0x0f68('0x33')][_0x0f68('0x61')][_0x0f68('0x39')];_0x961bef+=0x1){socket['emit'](_0x0f68('0x7d'),{'UserId':Number(_0x4b885f['query'][_0x0f68('0x61')][_0x961bef]),'WhatsappQueueId':Number(_0x4b885f['params']['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x4b885f[_0x0f68('0x33')]['ids']),'WhatsappQueueId':Number(_0x4b885f[_0x0f68('0x4f')]['id'])});}});}})[_0x0f68('0x24')](respondWithStatusCode(_0x3a4198,null))[_0x0f68('0x48')](handleError(_0x3a4198,null));};exports[_0x0f68('0x82')]=function(_0x544709,_0x5b371a,_0x28ae81){var _0x3dcdff={};var _0x317b28={};var _0x2537d5;var _0x49c8f6;return db[_0x0f68('0x44')]['findOne']({'where':{'id':_0x544709[_0x0f68('0x4f')]['id']}})[_0x0f68('0x24')](handleEntityNotFound(_0x5b371a,null))[_0x0f68('0x24')](function(_0x532225){if(_0x532225){_0x2537d5=_0x532225;_0x317b28[_0x0f68('0x32')]=_[_0x0f68('0x34')](db['User'][_0x0f68('0x2e')]);_0x317b28[_0x0f68('0x33')]=_['keys'](_0x544709['query']);_0x317b28[_0x0f68('0x35')]=_[_0x0f68('0x36')](_0x317b28[_0x0f68('0x32')],_0x317b28[_0x0f68('0x33')]);_0x3dcdff[_0x0f68('0x37')]=_[_0x0f68('0x36')](_0x317b28['model'],qs[_0x0f68('0x38')](_0x544709['query']['fields']));_0x3dcdff['attributes']=_0x3dcdff[_0x0f68('0x37')][_0x0f68('0x39')]?_0x3dcdff['attributes']:_0x317b28[_0x0f68('0x32')];_0x3dcdff['order']=qs[_0x0f68('0x3c')](_0x544709[_0x0f68('0x33')][_0x0f68('0x3c')]);_0x3dcdff['where']=qs[_0x0f68('0x35')](_[_0x0f68('0x3d')](_0x544709[_0x0f68('0x33')],_0x317b28[_0x0f68('0x35')]));if(_0x544709[_0x0f68('0x33')][_0x0f68('0x3e')]){_0x3dcdff[_0x0f68('0x40')]=_[_0x0f68('0x3f')](_0x3dcdff[_0x0f68('0x40')],{'$or':_[_0x0f68('0x2d')](_0x3dcdff['attributes'],function(_0x255128){var _0x51a4e1={};_0x51a4e1[_0x255128]={'$like':'%'+_0x544709[_0x0f68('0x33')]['filter']+'%'};return _0x51a4e1;})});}_0x3dcdff=_['merge']({},_0x3dcdff,_0x544709[_0x0f68('0x42')]);return _0x2537d5[_0x0f68('0x82')](_0x3dcdff);}})['then'](function(_0x5dc72d){if(_0x5dc72d){_0x49c8f6=_0x5dc72d[_0x0f68('0x39')];if(!_0x544709['query']['hasOwnProperty']('nolimit')){_0x3dcdff['limit']=qs[_0x0f68('0x1f')](_0x544709['query'][_0x0f68('0x1f')]);_0x3dcdff[_0x0f68('0x1e')]=qs[_0x0f68('0x1e')](_0x544709[_0x0f68('0x33')][_0x0f68('0x1e')]);}return _0x2537d5['getAgents'](_0x3dcdff);}})[_0x0f68('0x24')](function(_0xbbd692){if(_0xbbd692){return _0xbbd692?{'count':_0x49c8f6,'rows':_0xbbd692}:null;}})['then'](respondWithResult(_0x5b371a,null))[_0x0f68('0x48')](handleError(_0x5b371a,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 747f3eb..59f58af 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 _0x7038=['hook','events','../../mysqldb','WhatsappQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x19922b,_0x29dfb8){var _0x1fb4cd=function(_0x35d94d){while(--_0x35d94d){_0x19922b['push'](_0x19922b['shift']());}};_0x1fb4cd(++_0x29dfb8);}(_0x7038,0x91));var _0x8703=function(_0x736963,_0x46033c){_0x736963=_0x736963-0x0;var _0x24f458=_0x7038[_0x736963];return _0x24f458;};'use strict';var EventEmitter=require(_0x8703('0x0'));var WhatsappQueue=require(_0x8703('0x1'))['db'][_0x8703('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8703('0x3'),'afterUpdate':_0x8703('0x4'),'afterDestroy':_0x8703('0x5')};function emitEvent(_0x4a7303){return function(_0x4cc03e,_0x5ea56a,_0x47c9d0){WhatsappQueueEvents[_0x8703('0x6')](_0x4a7303+':'+_0x4cc03e['id'],_0x4cc03e);WhatsappQueueEvents[_0x8703('0x6')](_0x4a7303,_0x4cc03e);_0x47c9d0(null);};}for(var e in events){if(events[_0x8703('0x7')](e)){var event=events[e];WhatsappQueue[_0x8703('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xa9d5=['events','../../mysqldb','WhatsappQueue','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x357dfb,_0x9511d1){var _0x31a1ff=function(_0x1698f2){while(--_0x1698f2){_0x357dfb['push'](_0x357dfb['shift']());}};_0x31a1ff(++_0x9511d1);}(_0xa9d5,0x120));var _0x5a9d=function(_0x3b5bb5,_0x22c1c1){_0x3b5bb5=_0x3b5bb5-0x0;var _0x2ff5c4=_0xa9d5[_0x3b5bb5];return _0x2ff5c4;};'use strict';var EventEmitter=require(_0x5a9d('0x0'));var WhatsappQueue=require(_0x5a9d('0x1'))['db'][_0x5a9d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5a9d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2ae98e){return function(_0x5ace1b,_0x27e4a6,_0x2965ff){WhatsappQueueEvents[_0x5a9d('0x4')](_0x2ae98e+':'+_0x5ace1b['id'],_0x5ace1b);WhatsappQueueEvents['emit'](_0x2ae98e,_0x5ace1b);_0x2965ff(null);};}for(var e in events){if(events[_0x5a9d('0x5')](e)){var event=events[e];WhatsappQueue[_0x5a9d('0x6')](e,emitEvent(event));}}module[_0x5a9d('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 3684a19..d7ded8c 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 _0xad5a=['WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','./whatsappQueue.attributes','exports','define'];(function(_0x35ef6b,_0x53a861){var _0x214afb=function(_0x8a81c7){while(--_0x8a81c7){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x214afb(++_0x53a861);}(_0xad5a,0x1b2));var _0xaad5=function(_0x13c175,_0x30da96){_0x13c175=_0x13c175-0x0;var _0x489d12=_0xad5a[_0x13c175];return _0x489d12;};'use strict';var _=require(_0xaad5('0x0'));var util=require(_0xaad5('0x1'));var logger=require(_0xaad5('0x2'))(_0xaad5('0x3'));var moment=require('moment');var BPromise=require(_0xaad5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaad5('0x5'));var rimraf=require(_0xaad5('0x6'));var config=require('../../config/environment');var attributes=require(_0xaad5('0x7'));module[_0xaad5('0x8')]=function(_0x406a43,_0x2c17cb){return _0x406a43[_0xaad5('0x9')](_0xaad5('0xa'),attributes,{'tableName':_0xaad5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d92=['../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xe3cdae,_0x152d75){var _0x427679=function(_0x58539b){while(--_0x58539b){_0xe3cdae['push'](_0xe3cdae['shift']());}};_0x427679(++_0x152d75);}(_0x1d92,0xdd));var _0x21d9=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x1d92[_0x334599];return _0x4cdff2;};'use strict';var _=require('lodash');var util=require(_0x21d9('0x0'));var logger=require(_0x21d9('0x1'))(_0x21d9('0x2'));var moment=require('moment');var BPromise=require(_0x21d9('0x3'));var rp=require(_0x21d9('0x4'));var fs=require('fs');var path=require(_0x21d9('0x5'));var rimraf=require(_0x21d9('0x6'));var config=require(_0x21d9('0x7'));var attributes=require(_0x21d9('0x8'));module[_0x21d9('0x9')]=function(_0xc5bc84,_0x30f890){return _0xc5bc84['define'](_0x21d9('0xa'),attributes,{'tableName':_0x21d9('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 e6fc231..63745db 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 _0x7d0b=['result','GetWhatsappQueue','WhatsappQueue','findAll','raw','options','limit','include','model','attributes','map','catch','ShowWhatsappQueue','find','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x7d0b,0x16e));var _0xb7d0=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x7d0b[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb7d0('0x0'));var BPromise=require(_0xb7d0('0x1'));var rs=require(_0xb7d0('0x2'));var fs=require('fs');var Redis=require(_0xb7d0('0x3'));var db=require(_0xb7d0('0x4'))['db'];var utils=require(_0xb7d0('0x5'));var logger=require(_0xb7d0('0x6'))(_0xb7d0('0x7'));var config=require(_0xb7d0('0x8'));var jayson=require(_0xb7d0('0x9'));var client=jayson[_0xb7d0('0xa')]['http']({'port':0x232a});config[_0xb7d0('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7d0('0xb')]));require(_0xb7d0('0xc'))[_0xb7d0('0xd')](socket);function respondWithRpcPromise(_0x51c97d,_0x159843,_0x42c618){return new BPromise(function(_0x423c4d,_0x2e5ce0){return client[_0xb7d0('0xe')](_0x51c97d,_0x42c618)[_0xb7d0('0xf')](function(_0x407a38){logger['info'](_0xb7d0('0x10'),_0x159843,'request\x20sent');logger['debug'](_0xb7d0('0x11'),_0x159843,_0xb7d0('0x12'),JSON[_0xb7d0('0x13')](_0x407a38));if(_0x407a38[_0xb7d0('0x14')]){if(_0x407a38[_0xb7d0('0x14')][_0xb7d0('0x15')]===0x1f4){logger[_0xb7d0('0x14')](_0xb7d0('0x10'),_0x159843,_0x407a38['error'][_0xb7d0('0x16')]);return _0x2e5ce0(_0x407a38['error'][_0xb7d0('0x16')]);}logger[_0xb7d0('0x14')](_0xb7d0('0x10'),_0x159843,_0x407a38[_0xb7d0('0x14')][_0xb7d0('0x16')]);return _0x423c4d(_0x407a38[_0xb7d0('0x14')][_0xb7d0('0x16')]);}else{logger[_0xb7d0('0x17')](_0xb7d0('0x10'),_0x159843,'request\x20sent');_0x423c4d(_0x407a38[_0xb7d0('0x18')][_0xb7d0('0x16')]);}})['catch'](function(_0x3788a0){logger[_0xb7d0('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x159843,_0x3788a0);_0x2e5ce0(_0x3788a0);});});}exports[_0xb7d0('0x19')]=function(_0x2d8f66){var _0x4a9307=this;return new Promise(function(_0x1bb1e5,_0xd87cb7){return db[_0xb7d0('0x1a')][_0xb7d0('0x1b')]({'raw':_0x2d8f66['options']?_0x2d8f66['options'][_0xb7d0('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d8f66[_0xb7d0('0x1d')]?_0x2d8f66[_0xb7d0('0x1d')]['where']||null:null,'attributes':_0x2d8f66[_0xb7d0('0x1d')]?_0x2d8f66[_0xb7d0('0x1d')]['attributes']||null:null,'limit':_0x2d8f66[_0xb7d0('0x1d')]?_0x2d8f66[_0xb7d0('0x1d')][_0xb7d0('0x1e')]||null:null,'include':_0x2d8f66['options']?_0x2d8f66[_0xb7d0('0x1d')][_0xb7d0('0x1f')]?_['map'](_0x2d8f66['options'][_0xb7d0('0x1f')],function(_0x424afc){return{'model':db[_0x424afc[_0xb7d0('0x20')]],'as':_0x424afc['as'],'attributes':_0x424afc[_0xb7d0('0x21')],'include':_0x424afc[_0xb7d0('0x1f')]?_[_0xb7d0('0x22')](_0x424afc['include'],function(_0x3e8bfd){return{'model':db[_0x3e8bfd['model']],'as':_0x3e8bfd['as'],'attributes':_0x3e8bfd[_0xb7d0('0x21')],'include':_0x3e8bfd['include']?_[_0xb7d0('0x22')](_0x3e8bfd[_0xb7d0('0x1f')],function(_0x585be9){return{'model':db[_0x585be9['model']],'as':_0x585be9['as'],'attributes':_0x585be9['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7d0('0xf')](function(_0x64fb71){logger[_0xb7d0('0x17')](_0xb7d0('0x19'),_0x2d8f66);logger['debug'](_0xb7d0('0x19'),_0x2d8f66,JSON[_0xb7d0('0x13')](_0x64fb71));_0x1bb1e5(_0x64fb71);})[_0xb7d0('0x23')](function(_0x4dacd7){logger[_0xb7d0('0x14')](_0xb7d0('0x19'),_0x4dacd7[_0xb7d0('0x16')],_0x2d8f66);_0xd87cb7(_0x4a9307[_0xb7d0('0x14')](0x1f4,_0x4dacd7[_0xb7d0('0x16')]));});});};exports[_0xb7d0('0x24')]=function(_0x63194b){var _0x121d94=this;return new Promise(function(_0xdf99d6,_0x552e52){return db[_0xb7d0('0x1a')][_0xb7d0('0x25')]({'raw':_0x63194b['options']?_0x63194b[_0xb7d0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x63194b[_0xb7d0('0x1d')]?_0x63194b[_0xb7d0('0x1d')]['where']||null:null,'attributes':_0x63194b[_0xb7d0('0x1d')]?_0x63194b['options']['attributes']||null:null,'include':_0x63194b[_0xb7d0('0x1d')]?_0x63194b['options'][_0xb7d0('0x1f')]?_[_0xb7d0('0x22')](_0x63194b[_0xb7d0('0x1d')][_0xb7d0('0x1f')],function(_0x2f4f65){return{'model':db[_0x2f4f65[_0xb7d0('0x20')]],'as':_0x2f4f65['as'],'attributes':_0x2f4f65[_0xb7d0('0x21')],'include':_0x2f4f65['include']?_['map'](_0x2f4f65[_0xb7d0('0x1f')],function(_0x3b97f5){return{'model':db[_0x3b97f5[_0xb7d0('0x20')]],'as':_0x3b97f5['as'],'attributes':_0x3b97f5['attributes'],'include':_0x3b97f5[_0xb7d0('0x1f')]?_[_0xb7d0('0x22')](_0x3b97f5[_0xb7d0('0x1f')],function(_0x3bdccd){return{'model':db[_0x3bdccd[_0xb7d0('0x20')]],'as':_0x3bdccd['as'],'attributes':_0x3bdccd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7d0('0xf')](function(_0x3e38d4){logger[_0xb7d0('0x17')]('ShowWhatsappQueue',_0x63194b);logger[_0xb7d0('0x26')](_0xb7d0('0x24'),_0x63194b,JSON[_0xb7d0('0x13')](_0x3e38d4));_0xdf99d6(_0x3e38d4);})['catch'](function(_0x5a4496){logger[_0xb7d0('0x14')](_0xb7d0('0x24'),_0x5a4496[_0xb7d0('0x16')],_0x63194b);_0x552e52(_0x121d94[_0xb7d0('0x14')](0x1f4,_0x5a4496[_0xb7d0('0x16')]));});});}; \ No newline at end of file +var _0x1b44=['request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','where','attributes','limit','map','model','include','then','ShowWhatsappQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1b44,0x1d1));var _0x41b4=function(_0x5dfa4a,_0x181c31){_0x5dfa4a=_0x5dfa4a-0x0;var _0x2608f1=_0x1b44[_0x5dfa4a];return _0x2608f1;};'use strict';var _=require(_0x41b4('0x0'));var util=require(_0x41b4('0x1'));var moment=require(_0x41b4('0x2'));var BPromise=require(_0x41b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x41b4('0x5'));var logger=require(_0x41b4('0x6'))('rpc');var config=require(_0x41b4('0x7'));var jayson=require(_0x41b4('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x41b4('0x9')]=_['defaults'](config[_0x41b4('0x9')],{'host':_0x41b4('0xa'),'port':0x18eb});var socket=require(_0x41b4('0xb'))(new Redis(config[_0x41b4('0x9')]));require(_0x41b4('0xc'))['register'](socket);function respondWithRpcPromise(_0x123424,_0x35bcba,_0x20f8c7){return new BPromise(function(_0x7bcca0,_0x5399dd){return client[_0x41b4('0xd')](_0x123424,_0x20f8c7)['then'](function(_0x57ee5a){logger[_0x41b4('0xe')](_0x41b4('0xf'),_0x35bcba,_0x41b4('0x10'));logger[_0x41b4('0x11')](_0x41b4('0x12'),_0x35bcba,'request\x20sent',JSON[_0x41b4('0x13')](_0x57ee5a));if(_0x57ee5a[_0x41b4('0x14')]){if(_0x57ee5a[_0x41b4('0x14')][_0x41b4('0x15')]===0x1f4){logger[_0x41b4('0x14')](_0x41b4('0xf'),_0x35bcba,_0x57ee5a[_0x41b4('0x14')][_0x41b4('0x16')]);return _0x5399dd(_0x57ee5a[_0x41b4('0x14')][_0x41b4('0x16')]);}logger['error'](_0x41b4('0xf'),_0x35bcba,_0x57ee5a['error'][_0x41b4('0x16')]);return _0x7bcca0(_0x57ee5a[_0x41b4('0x14')][_0x41b4('0x16')]);}else{logger[_0x41b4('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x35bcba,_0x41b4('0x10'));_0x7bcca0(_0x57ee5a[_0x41b4('0x17')][_0x41b4('0x16')]);}})[_0x41b4('0x18')](function(_0x55c0fc){logger[_0x41b4('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x35bcba,_0x55c0fc);_0x5399dd(_0x55c0fc);});});}exports[_0x41b4('0x19')]=function(_0x3dde12){var _0x15b8e3=this;return new Promise(function(_0x27a891,_0x23bba0){return db[_0x41b4('0x1a')]['findAll']({'raw':_0x3dde12[_0x41b4('0x1b')]?_0x3dde12['options']['raw']===undefined?!![]:![]:!![],'where':_0x3dde12[_0x41b4('0x1b')]?_0x3dde12[_0x41b4('0x1b')][_0x41b4('0x1c')]||null:null,'attributes':_0x3dde12[_0x41b4('0x1b')]?_0x3dde12['options'][_0x41b4('0x1d')]||null:null,'limit':_0x3dde12[_0x41b4('0x1b')]?_0x3dde12[_0x41b4('0x1b')][_0x41b4('0x1e')]||null:null,'include':_0x3dde12[_0x41b4('0x1b')]?_0x3dde12['options']['include']?_[_0x41b4('0x1f')](_0x3dde12[_0x41b4('0x1b')]['include'],function(_0x2e5850){return{'model':db[_0x2e5850[_0x41b4('0x20')]],'as':_0x2e5850['as'],'attributes':_0x2e5850[_0x41b4('0x1d')],'include':_0x2e5850['include']?_['map'](_0x2e5850[_0x41b4('0x21')],function(_0xa6ab1f){return{'model':db[_0xa6ab1f[_0x41b4('0x20')]],'as':_0xa6ab1f['as'],'attributes':_0xa6ab1f[_0x41b4('0x1d')],'include':_0xa6ab1f[_0x41b4('0x21')]?_[_0x41b4('0x1f')](_0xa6ab1f[_0x41b4('0x21')],function(_0x58abed){return{'model':db[_0x58abed['model']],'as':_0x58abed['as'],'attributes':_0x58abed['attributes']};}):[]};}):[]};}):[]:[]})[_0x41b4('0x22')](function(_0x1bd91a){logger[_0x41b4('0xe')]('GetWhatsappQueue',_0x3dde12);logger[_0x41b4('0x11')](_0x41b4('0x19'),_0x3dde12,JSON[_0x41b4('0x13')](_0x1bd91a));_0x27a891(_0x1bd91a);})[_0x41b4('0x18')](function(_0x6cb2f1){logger['error'](_0x41b4('0x19'),_0x6cb2f1[_0x41b4('0x16')],_0x3dde12);_0x23bba0(_0x15b8e3[_0x41b4('0x14')](0x1f4,_0x6cb2f1[_0x41b4('0x16')]));});});};exports[_0x41b4('0x23')]=function(_0x2391a2){var _0x39a1bd=this;return new Promise(function(_0xdd0149,_0x56c1ba){return db[_0x41b4('0x1a')][_0x41b4('0x24')]({'raw':_0x2391a2[_0x41b4('0x1b')]?_0x2391a2[_0x41b4('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2391a2[_0x41b4('0x1b')]?_0x2391a2[_0x41b4('0x1b')][_0x41b4('0x1c')]||null:null,'attributes':_0x2391a2[_0x41b4('0x1b')]?_0x2391a2[_0x41b4('0x1b')][_0x41b4('0x1d')]||null:null,'include':_0x2391a2[_0x41b4('0x1b')]?_0x2391a2['options']['include']?_[_0x41b4('0x1f')](_0x2391a2[_0x41b4('0x1b')][_0x41b4('0x21')],function(_0x32029d){return{'model':db[_0x32029d['model']],'as':_0x32029d['as'],'attributes':_0x32029d[_0x41b4('0x1d')],'include':_0x32029d[_0x41b4('0x21')]?_[_0x41b4('0x1f')](_0x32029d[_0x41b4('0x21')],function(_0x595833){return{'model':db[_0x595833[_0x41b4('0x20')]],'as':_0x595833['as'],'attributes':_0x595833['attributes'],'include':_0x595833['include']?_[_0x41b4('0x1f')](_0x595833['include'],function(_0x1e71f8){return{'model':db[_0x1e71f8['model']],'as':_0x1e71f8['as'],'attributes':_0x1e71f8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x563405){logger[_0x41b4('0xe')]('ShowWhatsappQueue',_0x2391a2);logger[_0x41b4('0x11')](_0x41b4('0x23'),_0x2391a2,JSON[_0x41b4('0x13')](_0x563405));_0xdd0149(_0x563405);})[_0x41b4('0x18')](function(_0x2c77e2){logger[_0x41b4('0x14')](_0x41b4('0x23'),_0x2c77e2[_0x41b4('0x16')],_0x2391a2);_0x56c1ba(_0x39a1bd[_0x41b4('0x14')](0x1f4,_0x2c77e2[_0x41b4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 32128af..961521c 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 _0xd694=['whatsappQueue:','remove','update','emit','removeListener','register','length'];(function(_0x5aa7d2,_0xb4f6bd){var _0x29e542=function(_0x57c00c){while(--_0x57c00c){_0x5aa7d2['push'](_0x5aa7d2['shift']());}};_0x29e542(++_0xb4f6bd);}(_0xd694,0xfd));var _0x4d69=function(_0x2ca515,_0x2f0654){_0x2ca515=_0x2ca515-0x0;var _0x2f7701=_0xd694[_0x2ca515];return _0x2f7701;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x4d69('0x0'),_0x4d69('0x1')];function createListener(_0x3b49b0,_0x5d7ce4){return function(_0x191687){_0x5d7ce4[_0x4d69('0x2')](_0x3b49b0,_0x191687);};}function removeListener(_0x9f6158,_0x384c88){return function(){WhatsappQueueEvents[_0x4d69('0x3')](_0x9f6158,_0x384c88);};}exports[_0x4d69('0x4')]=function(_0x252a9c){for(var _0x523238=0x0,_0x2d8ddb=events[_0x4d69('0x5')];_0x523238<_0x2d8ddb;_0x523238++){var _0xcbc3f0=events[_0x523238];var _0xdce3c2=createListener(_0x4d69('0x6')+_0xcbc3f0,_0x252a9c);WhatsappQueueEvents['on'](_0xcbc3f0,_0xdce3c2);}}; \ No newline at end of file +var _0x3247=['remove','update','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x2a8991,_0x29d525){var _0x5fd994=function(_0x5df0e7){while(--_0x5df0e7){_0x2a8991['push'](_0x2a8991['shift']());}};_0x5fd994(++_0x29d525);}(_0x3247,0x76));var _0x7324=function(_0x10f18c,_0x1bd140){_0x10f18c=_0x10f18c-0x0;var _0x16e965=_0x3247[_0x10f18c];return _0x16e965;};'use strict';var WhatsappQueueEvents=require(_0x7324('0x0'));var events=[_0x7324('0x1'),_0x7324('0x2'),_0x7324('0x3')];function createListener(_0x4c5aef,_0x3b4290){return function(_0x35d604){_0x3b4290['emit'](_0x4c5aef,_0x35d604);};}function removeListener(_0x3efe2c,_0x8bde03){return function(){WhatsappQueueEvents[_0x7324('0x4')](_0x3efe2c,_0x8bde03);};}exports[_0x7324('0x5')]=function(_0x2d07fb){for(var _0x978d=0x0,_0x20ad78=events[_0x7324('0x6')];_0x978d<_0x20ad78;_0x978d++){var _0x4f45a4=events[_0x978d];var _0x47a808=createListener(_0x7324('0x7')+_0x4f45a4,_0x2d07fb);WhatsappQueueEvents['on'](_0x4f45a4,_0x47a808);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7f42001..77ab9d5 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 _0xb646=['/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','describe'];(function(_0x288478,_0x23303e){var _0x234c05=function(_0x4ff5a5){while(--_0x4ff5a5){_0x288478['push'](_0x288478['shift']());}};_0x234c05(++_0x23303e);}(_0xb646,0x85));var _0x6b64=function(_0x380da0,_0x2b57ce){_0x380da0=_0x380da0-0x0;var _0xc3a2f9=_0xb646[_0x380da0];return _0xc3a2f9;};'use strict';var multer=require(_0x6b64('0x0'));var util=require('util');var path=require(_0x6b64('0x1'));var timeout=require(_0x6b64('0x2'));var express=require(_0x6b64('0x3'));var router=express[_0x6b64('0x4')]();var fs_extra=require(_0x6b64('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6b64('0x6'));var controller=require(_0x6b64('0x7'));router[_0x6b64('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6b64('0x8')]('/describe',auth[_0x6b64('0x9')](),controller[_0x6b64('0xa')]);router[_0x6b64('0x8')](_0x6b64('0xb'),auth[_0x6b64('0x9')](),controller[_0x6b64('0xc')]);router[_0x6b64('0xd')]('/',auth[_0x6b64('0x9')](),controller[_0x6b64('0xe')]);router[_0x6b64('0xf')]('/:id',auth[_0x6b64('0x9')](),controller['update']);router[_0x6b64('0x10')](_0x6b64('0xb'),auth[_0x6b64('0x9')](),controller['destroy']);module[_0x6b64('0x11')]=router; \ No newline at end of file +var _0x67f8=['fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x1c3871,_0x290d71){var _0x40be9b=function(_0x5571b9){while(--_0x5571b9){_0x1c3871['push'](_0x1c3871['shift']());}};_0x40be9b(++_0x290d71);}(_0x67f8,0x88));var _0x867f=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x67f8[_0x37e845];return _0x59e55b;};'use strict';var multer=require(_0x867f('0x0'));var util=require(_0x867f('0x1'));var path=require('path');var timeout=require(_0x867f('0x2'));var express=require('express');var router=express[_0x867f('0x3')]();var fs_extra=require(_0x867f('0x4'));var auth=require(_0x867f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x867f('0x6'));var controller=require(_0x867f('0x7'));router[_0x867f('0x8')]('/',auth[_0x867f('0x9')](),controller[_0x867f('0xa')]);router[_0x867f('0x8')](_0x867f('0xb'),auth[_0x867f('0x9')](),controller[_0x867f('0xc')]);router[_0x867f('0x8')](_0x867f('0xd'),auth[_0x867f('0x9')](),controller['show']);router[_0x867f('0xe')]('/',auth[_0x867f('0x9')](),controller[_0x867f('0xf')]);router[_0x867f('0x10')](_0x867f('0xd'),auth[_0x867f('0x9')](),controller['update']);router[_0x867f('0x11')]('/:id',auth[_0x867f('0x9')](),controller[_0x867f('0x12')]);module[_0x867f('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index fd45912..7e306b1 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(_0x400ec8,_0x433bae){var _0x3fb167=function(_0x72594){while(--_0x72594){_0x400ec8['push'](_0x400ec8['shift']());}};_0x3fb167(++_0x433bae);}(_0x7a54,0x106));var _0x47a5=function(_0x1e4dcb,_0x926eed){_0x1e4dcb=_0x1e4dcb-0x0;var _0xce0327=_0x7a54[_0x1e4dcb];return _0xce0327;};'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(_0x1ec701,_0x519376){var _0x25bc13=function(_0x160c64){while(--_0x160c64){_0x1ec701['push'](_0x1ec701['shift']());}};_0x25bc13(++_0x519376);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 ce22559..05759e3 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 _0x4fc2=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','error','name','send','index','map','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','WhatsappQueueReport','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4fc2,0x111));var _0x24fc=function(_0x11859d,_0x1c9f0e){_0x11859d=_0x11859d-0x0;var _0x6c172e=_0x4fc2[_0x11859d];return _0x6c172e;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];function respondWithStatusCode(_0x5cc65e,_0x306873){_0x306873=_0x306873||0xcc;return function(_0x76cb25){if(_0x76cb25){return _0x5cc65e[_0x24fc('0x1b')](_0x306873);}return _0x5cc65e[_0x24fc('0x1c')](_0x306873)[_0x24fc('0x1d')]();};}function respondWithResult(_0x326276,_0x537b5c){_0x537b5c=_0x537b5c||0xc8;return function(_0x2a0971){if(_0x2a0971){return _0x326276[_0x24fc('0x1c')](_0x537b5c)[_0x24fc('0x1e')](_0x2a0971);}};}function respondWithFilteredResult(_0x42cbe8,_0x4acd36){return function(_0x2ac989){if(_0x2ac989){var _0x588543=typeof _0x4acd36[_0x24fc('0x1f')]===_0x24fc('0x20')&&typeof _0x4acd36[_0x24fc('0x21')]===_0x24fc('0x20');var _0x25cb40=_0x2ac989['count'];var _0x23873c=_0x588543?0x0:_0x4acd36[_0x24fc('0x1f')];var _0x6cfa0a=_0x588543?_0x2ac989[_0x24fc('0x22')]:_0x4acd36['offset']+_0x4acd36[_0x24fc('0x21')];var _0x4073e0;if(_0x6cfa0a>=_0x25cb40){_0x6cfa0a=_0x25cb40;_0x4073e0=0xc8;}else{_0x4073e0=0xce;}_0x42cbe8[_0x24fc('0x1c')](_0x4073e0);return _0x42cbe8['set'](_0x24fc('0x23'),_0x23873c+'-'+_0x6cfa0a+'/'+_0x25cb40)[_0x24fc('0x1e')](_0x2ac989);}return null;};}function patchUpdates(_0xbf1d6b){return function(_0x2d0e3d){try{jsonpatch['apply'](_0x2d0e3d,_0xbf1d6b,!![]);}catch(_0x323beb){return BPromise['reject'](_0x323beb);}return _0x2d0e3d[_0x24fc('0x24')]();};}function saveUpdates(_0x591c8f,_0x3ed464){return function(_0x44c121){if(_0x44c121){return _0x44c121[_0x24fc('0x25')](_0x591c8f)['then'](function(_0x313a25){return _0x313a25;});}return null;};}function removeEntity(_0x552035,_0x35a9c7){return function(_0x2bb93a){if(_0x2bb93a){return _0x2bb93a[_0x24fc('0x26')]()[_0x24fc('0x27')](function(){_0x552035[_0x24fc('0x1c')](0xcc)[_0x24fc('0x1d')]();});}};}function handleEntityNotFound(_0x3f0875,_0x20192b){return function(_0x168d98){if(!_0x168d98){_0x3f0875[_0x24fc('0x1b')](0x194);}return _0x168d98;};}function handleError(_0x568441,_0x11c913){_0x11c913=_0x11c913||0x1f4;return function(_0x16f27f){logger[_0x24fc('0x28')](_0x16f27f['stack']);if(_0x16f27f[_0x24fc('0x29')]){delete _0x16f27f[_0x24fc('0x29')];}_0x568441[_0x24fc('0x1c')](_0x11c913)[_0x24fc('0x2a')](_0x16f27f);};}exports[_0x24fc('0x2b')]=function(_0x443796,_0x5ac1f2){var _0x240ae7={},_0x29a461={},_0x3c99ed={'count':0x0,'rows':[]};var _0x1c5146=_[_0x24fc('0x2c')](db['WhatsappQueueReport']['rawAttributes'],function(_0x4e6f73){return{'name':_0x4e6f73[_0x24fc('0x2d')],'type':_0x4e6f73['type'][_0x24fc('0x2e')]};});_0x29a461[_0x24fc('0x2f')]=_[_0x24fc('0x2c')](_0x1c5146,_0x24fc('0x29'));_0x29a461['query']=_[_0x24fc('0x30')](_0x443796[_0x24fc('0x31')]);_0x29a461['filters']=_[_0x24fc('0x32')](_0x29a461[_0x24fc('0x2f')],_0x29a461['query']);_0x240ae7['attributes']=_[_0x24fc('0x32')](_0x29a461['model'],qs[_0x24fc('0x33')](_0x443796[_0x24fc('0x31')]['fields']));_0x240ae7[_0x24fc('0x34')]=_0x240ae7[_0x24fc('0x34')][_0x24fc('0x35')]?_0x240ae7[_0x24fc('0x34')]:_0x29a461[_0x24fc('0x2f')];if(!_0x443796[_0x24fc('0x31')][_0x24fc('0x36')](_0x24fc('0x37'))){_0x240ae7[_0x24fc('0x21')]=qs['limit'](_0x443796[_0x24fc('0x31')][_0x24fc('0x21')]);_0x240ae7[_0x24fc('0x1f')]=qs[_0x24fc('0x1f')](_0x443796[_0x24fc('0x31')]['offset']);}_0x240ae7['order']=qs[_0x24fc('0x38')](_0x443796['query'][_0x24fc('0x38')]);_0x240ae7[_0x24fc('0x39')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x3b')](_0x443796['query'],_0x29a461[_0x24fc('0x3a')]),_0x1c5146);if(_0x443796['query'][_0x24fc('0x3c')]){_0x240ae7[_0x24fc('0x39')]=_[_0x24fc('0x3d')](_0x240ae7[_0x24fc('0x39')],{'$or':_[_0x24fc('0x2c')](_0x1c5146,function(_0x508aaf){if(_0x508aaf[_0x24fc('0x3e')]!==_0x24fc('0x3f')){var _0x2181f7={};_0x2181f7[_0x508aaf[_0x24fc('0x29')]]={'$like':'%'+_0x443796['query'][_0x24fc('0x3c')]+'%'};return _0x2181f7;}})});}_0x240ae7=_[_0x24fc('0x3d')]({},_0x240ae7,_0x443796['options']);var _0xf40435={'where':_0x240ae7['where']};return db[_0x24fc('0x40')][_0x24fc('0x22')](_0xf40435)[_0x24fc('0x27')](function(_0x1e045a){_0x3c99ed[_0x24fc('0x22')]=_0x1e045a;if(_0x443796[_0x24fc('0x31')][_0x24fc('0x41')]){_0x240ae7[_0x24fc('0x42')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x24fc('0x43')](_0x240ae7);})[_0x24fc('0x27')](function(_0x32f72c){_0x3c99ed['rows']=_0x32f72c;return _0x3c99ed;})[_0x24fc('0x27')](respondWithFilteredResult(_0x5ac1f2,_0x240ae7))[_0x24fc('0x44')](handleError(_0x5ac1f2,null));};exports['show']=function(_0x2c4a6c,_0x22f30b){var _0x2c598c={'raw':!![],'where':{'id':_0x2c4a6c[_0x24fc('0x45')]['id']}},_0x5e4e9b={};_0x5e4e9b[_0x24fc('0x2f')]=_['keys'](db[_0x24fc('0x40')][_0x24fc('0x46')]);_0x5e4e9b[_0x24fc('0x31')]=_[_0x24fc('0x30')](_0x2c4a6c['query']);_0x5e4e9b[_0x24fc('0x3a')]=_[_0x24fc('0x32')](_0x5e4e9b[_0x24fc('0x2f')],_0x5e4e9b[_0x24fc('0x31')]);_0x2c598c[_0x24fc('0x34')]=_['intersection'](_0x5e4e9b[_0x24fc('0x2f')],qs[_0x24fc('0x33')](_0x2c4a6c[_0x24fc('0x31')][_0x24fc('0x33')]));_0x2c598c['attributes']=_0x2c598c[_0x24fc('0x34')][_0x24fc('0x35')]?_0x2c598c['attributes']:_0x5e4e9b['model'];if(_0x2c4a6c[_0x24fc('0x31')]['includeAll']){_0x2c598c['include']=[{'all':!![]}];}_0x2c598c=_[_0x24fc('0x3d')]({},_0x2c598c,_0x2c4a6c['options']);return db[_0x24fc('0x40')][_0x24fc('0x47')](_0x2c598c)[_0x24fc('0x27')](handleEntityNotFound(_0x22f30b,null))['then'](respondWithResult(_0x22f30b,null))[_0x24fc('0x44')](handleError(_0x22f30b,null));};exports[_0x24fc('0x48')]=function(_0x1b1f1c,_0x1ad8d6){return db[_0x24fc('0x40')][_0x24fc('0x48')](_0x1b1f1c[_0x24fc('0x49')],{})[_0x24fc('0x27')](respondWithResult(_0x1ad8d6,0xc9))['catch'](handleError(_0x1ad8d6,null));};exports['update']=function(_0x266378,_0x2f1a99){if(_0x266378[_0x24fc('0x49')]['id']){delete _0x266378['body']['id'];}return db['WhatsappQueueReport'][_0x24fc('0x47')]({'where':{'id':_0x266378[_0x24fc('0x45')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x2f1a99,null))[_0x24fc('0x27')](saveUpdates(_0x266378[_0x24fc('0x49')],null))[_0x24fc('0x27')](respondWithResult(_0x2f1a99,null))[_0x24fc('0x44')](handleError(_0x2f1a99,null));};exports[_0x24fc('0x26')]=function(_0x1671b0,_0x4574d3){return db[_0x24fc('0x40')][_0x24fc('0x47')]({'where':{'id':_0x1671b0['params']['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x4574d3,null))[_0x24fc('0x27')](removeEntity(_0x4574d3,null))[_0x24fc('0x44')](handleError(_0x4574d3,null));};exports[_0x24fc('0x4a')]=function(_0x370b6c,_0x5bdc4d){return db[_0x24fc('0x40')]['describe']()[_0x24fc('0x27')](respondWithResult(_0x5bdc4d,null))[_0x24fc('0x44')](handleError(_0x5bdc4d,null));}; \ No newline at end of file +var _0x4e81=['limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','status','json','offset','undefined'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e81,0x1bc));var _0x14e8=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0x4e81[_0x5a4400];return _0xf9b532;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['WhatsappQueueReport'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};exports[_0x14e8('0x4e')]=function(_0x4cc86a,_0x519c9c){return db[_0x14e8('0x2b')][_0x14e8('0x4e')]()[_0x14e8('0x24')](respondWithResult(_0x519c9c,null))[_0x14e8('0x49')](handleError(_0x519c9c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 61ede32..cdb6f29 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 _0x3c36=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x39201a,_0x3ad719){var _0x4c18fe=function(_0x9a535e){while(--_0x9a535e){_0x39201a['push'](_0x39201a['shift']());}};_0x4c18fe(++_0x3ad719);}(_0x3c36,0x87));var _0x63c3=function(_0x445c3e,_0x2c3d04){_0x445c3e=_0x445c3e-0x0;var _0x55aaaa=_0x3c36[_0x445c3e];return _0x55aaaa;};'use strict';var _=require(_0x63c3('0x0'));var util=require('util');var logger=require(_0x63c3('0x1'))('api');var moment=require(_0x63c3('0x2'));var BPromise=require('bluebird');var rp=require(_0x63c3('0x3'));var fs=require('fs');var path=require(_0x63c3('0x4'));var rimraf=require(_0x63c3('0x5'));var config=require(_0x63c3('0x6'));var attributes=require(_0x63c3('0x7'));module[_0x63c3('0x8')]=function(_0x126468,_0x3678ef){return _0x126468[_0x63c3('0x9')](_0x63c3('0xa'),attributes,{'tableName':_0x63c3('0xb'),'paranoid':![],'indexes':[{'name':_0x63c3('0xc'),'fields':[_0x63c3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe09b=['moment','bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x59e501,_0xfee5c1){var _0x53a38e=function(_0x1293fe){while(--_0x1293fe){_0x59e501['push'](_0x59e501['shift']());}};_0x53a38e(++_0xfee5c1);}(_0xe09b,0xb2));var _0xbe09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe09b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe09('0x0'));var util=require(_0xbe09('0x1'));var logger=require(_0xbe09('0x2'))(_0xbe09('0x3'));var moment=require(_0xbe09('0x4'));var BPromise=require(_0xbe09('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe09('0x6'));var rimraf=require('rimraf');var config=require(_0xbe09('0x7'));var attributes=require(_0xbe09('0x8'));module[_0xbe09('0x9')]=function(_0x2036ef,_0x5559b9){return _0x2036ef['define'](_0xbe09('0xa'),attributes,{'tableName':_0xbe09('0xb'),'paranoid':![],'indexes':[{'name':_0xbe09('0xc'),'fields':[_0xbe09('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index c609fb8..d31deb4 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 _0xed95=['../../mysqldb','rpc','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','where','attributes','lodash','util','bluebird','randomstring','ioredis'];(function(_0x285800,_0x26765e){var _0x4b809e=function(_0x12c58b){while(--_0x12c58b){_0x285800['push'](_0x285800['shift']());}};_0x4b809e(++_0x26765e);}(_0xed95,0x12f));var _0x5ed9=function(_0x1d01f3,_0x1a22d6){_0x1d01f3=_0x1d01f3-0x0;var _0x329da0=_0xed95[_0x1d01f3];return _0x329da0;};'use strict';var _=require(_0x5ed9('0x0'));var util=require(_0x5ed9('0x1'));var moment=require('moment');var BPromise=require(_0x5ed9('0x2'));var rs=require(_0x5ed9('0x3'));var fs=require('fs');var Redis=require(_0x5ed9('0x4'));var db=require(_0x5ed9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ed9('0x6'));var config=require('../../config/environment');var jayson=require(_0x5ed9('0x7'));var client=jayson['client'][_0x5ed9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cba1c,_0x1e3041,_0x2ac672){return new BPromise(function(_0xd86631,_0x242b0c){return client[_0x5ed9('0x9')](_0x4cba1c,_0x2ac672)[_0x5ed9('0xa')](function(_0x42f8b2){logger[_0x5ed9('0xb')](_0x5ed9('0xc'),_0x1e3041,_0x5ed9('0xd'));logger[_0x5ed9('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1e3041,_0x5ed9('0xd'),JSON[_0x5ed9('0xf')](_0x42f8b2));if(_0x42f8b2[_0x5ed9('0x10')]){if(_0x42f8b2[_0x5ed9('0x10')][_0x5ed9('0x11')]===0x1f4){logger[_0x5ed9('0x10')](_0x5ed9('0xc'),_0x1e3041,_0x42f8b2[_0x5ed9('0x10')][_0x5ed9('0x12')]);return _0x242b0c(_0x42f8b2['error'][_0x5ed9('0x12')]);}logger[_0x5ed9('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1e3041,_0x42f8b2[_0x5ed9('0x10')]['message']);return _0xd86631(_0x42f8b2[_0x5ed9('0x10')]['message']);}else{logger[_0x5ed9('0xb')](_0x5ed9('0xc'),_0x1e3041,_0x5ed9('0xd'));_0xd86631(_0x42f8b2['result'][_0x5ed9('0x12')]);}})[_0x5ed9('0x13')](function(_0x54882c){logger[_0x5ed9('0x10')](_0x5ed9('0xc'),_0x1e3041,_0x54882c);_0x242b0c(_0x54882c);});});}exports['CreateWhatsappQueueReport']=function(_0x255bdc){var _0x57b8a5=this;return new Promise(function(_0x4f775c,_0x3f6b41){return db[_0x5ed9('0x14')]['create'](_0x255bdc[_0x5ed9('0x15')],{'raw':_0x255bdc[_0x5ed9('0x16')]?_0x255bdc[_0x5ed9('0x16')][_0x5ed9('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x111e80){logger[_0x5ed9('0xb')](_0x5ed9('0x18'),_0x255bdc);logger['debug'](_0x5ed9('0x18'),_0x255bdc,JSON['stringify'](_0x111e80));_0x4f775c(_0x111e80);})['catch'](function(_0x44a4b3){logger[_0x5ed9('0x10')]('CreateWhatsappQueueReport',_0x44a4b3[_0x5ed9('0x12')],_0x255bdc);_0x3f6b41(_0x57b8a5[_0x5ed9('0x10')](0x1f4,_0x44a4b3[_0x5ed9('0x12')]));});});};exports[_0x5ed9('0x19')]=function(_0x584495){var _0x362ed5=this;return new Promise(function(_0x5dd278,_0x497dd8){return db[_0x5ed9('0x14')]['update'](_0x584495[_0x5ed9('0x15')],{'raw':_0x584495[_0x5ed9('0x16')]?_0x584495[_0x5ed9('0x16')][_0x5ed9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x584495[_0x5ed9('0x16')]?_0x584495[_0x5ed9('0x16')][_0x5ed9('0x1a')]||null:null,'attributes':_0x584495[_0x5ed9('0x16')]?_0x584495[_0x5ed9('0x16')][_0x5ed9('0x1b')]||null:null,'limit':_0x584495[_0x5ed9('0x16')]?_0x584495[_0x5ed9('0x16')]['limit']||null:null})[_0x5ed9('0xa')](function(_0x3fa960){logger[_0x5ed9('0xb')]('UpdateWhatsappQueueReport',_0x584495);logger[_0x5ed9('0xe')](_0x5ed9('0x19'),_0x584495,JSON[_0x5ed9('0xf')](_0x3fa960));_0x5dd278(_0x3fa960);})[_0x5ed9('0x13')](function(_0x550bb5){logger[_0x5ed9('0x10')](_0x5ed9('0x19'),_0x550bb5[_0x5ed9('0x12')],_0x584495);_0x497dd8(_0x362ed5['error'](0x1f4,_0x550bb5['message']));});});}; \ No newline at end of file +var _0xb1fa=['info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb1fa,0x134));var _0xab1f=function(_0x4e2e66,_0x1c7ede){_0x4e2e66=_0x4e2e66-0x0;var _0x1dcccc=_0xb1fa[_0x4e2e66];return _0x1dcccc;};'use strict';var _=require(_0xab1f('0x0'));var util=require(_0xab1f('0x1'));var moment=require(_0xab1f('0x2'));var BPromise=require(_0xab1f('0x3'));var rs=require(_0xab1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab1f('0x5'));var logger=require('../../config/logger')(_0xab1f('0x6'));var config=require('../../config/environment');var jayson=require(_0xab1f('0x7'));var client=jayson[_0xab1f('0x8')][_0xab1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dd18b,_0x5b65b9,_0xb5cd92){return new BPromise(function(_0x1a5fa4,_0x3af121){return client[_0xab1f('0xa')](_0x1dd18b,_0xb5cd92)[_0xab1f('0xb')](function(_0x15a068){logger[_0xab1f('0xc')](_0xab1f('0xd'),_0x5b65b9,_0xab1f('0xe'));logger[_0xab1f('0xf')](_0xab1f('0x10'),_0x5b65b9,'request\x20sent',JSON[_0xab1f('0x11')](_0x15a068));if(_0x15a068['error']){if(_0x15a068[_0xab1f('0x12')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5b65b9,_0x15a068['error'][_0xab1f('0x13')]);return _0x3af121(_0x15a068[_0xab1f('0x12')][_0xab1f('0x13')]);}logger['error'](_0xab1f('0xd'),_0x5b65b9,_0x15a068[_0xab1f('0x12')][_0xab1f('0x13')]);return _0x1a5fa4(_0x15a068['error']['message']);}else{logger[_0xab1f('0xc')](_0xab1f('0xd'),_0x5b65b9,_0xab1f('0xe'));_0x1a5fa4(_0x15a068[_0xab1f('0x14')][_0xab1f('0x13')]);}})[_0xab1f('0x15')](function(_0x431683){logger['error'](_0xab1f('0xd'),_0x5b65b9,_0x431683);_0x3af121(_0x431683);});});}exports['CreateWhatsappQueueReport']=function(_0x85a40e){var _0x289b21=this;return new Promise(function(_0x18fdd1,_0x5b5503){return db[_0xab1f('0x16')][_0xab1f('0x17')](_0x85a40e[_0xab1f('0x18')],{'raw':_0x85a40e[_0xab1f('0x19')]?_0x85a40e[_0xab1f('0x19')][_0xab1f('0x1a')]===undefined?!![]:![]:!![]})[_0xab1f('0xb')](function(_0x5693ce){logger[_0xab1f('0xc')](_0xab1f('0x1b'),_0x85a40e);logger[_0xab1f('0xf')]('CreateWhatsappQueueReport',_0x85a40e,JSON[_0xab1f('0x11')](_0x5693ce));_0x18fdd1(_0x5693ce);})[_0xab1f('0x15')](function(_0x223915){logger['error'](_0xab1f('0x1b'),_0x223915[_0xab1f('0x13')],_0x85a40e);_0x5b5503(_0x289b21[_0xab1f('0x12')](0x1f4,_0x223915[_0xab1f('0x13')]));});});};exports[_0xab1f('0x1c')]=function(_0x251409){var _0x2e7eee=this;return new Promise(function(_0x7ca05a,_0x56fb29){return db['WhatsappQueueReport'][_0xab1f('0x1d')](_0x251409[_0xab1f('0x18')],{'raw':_0x251409[_0xab1f('0x19')]?_0x251409[_0xab1f('0x19')][_0xab1f('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x251409[_0xab1f('0x19')]?_0x251409['options']['where']||null:null,'attributes':_0x251409['options']?_0x251409['options'][_0xab1f('0x1e')]||null:null,'limit':_0x251409[_0xab1f('0x19')]?_0x251409[_0xab1f('0x19')][_0xab1f('0x1f')]||null:null})[_0xab1f('0xb')](function(_0x348a45){logger[_0xab1f('0xc')](_0xab1f('0x1c'),_0x251409);logger[_0xab1f('0xf')](_0xab1f('0x1c'),_0x251409,JSON['stringify'](_0x348a45));_0x7ca05a(_0x348a45);})[_0xab1f('0x15')](function(_0xa6e278){logger['error'](_0xab1f('0x1c'),_0xa6e278[_0xab1f('0x13')],_0x251409);_0x56fb29(_0x2e7eee['error'](0x1f4,_0xa6e278['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 77f2883..ec2eef5 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 _0xd6f6=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put','destroy'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0xd6f6,0x99));var _0x6d6f=function(_0x3ad401,_0x3dcea2){_0x3ad401=_0x3ad401-0x0;var _0x3d45aa=_0xd6f6[_0x3ad401];return _0x3d45aa;};'use strict';var multer=require('multer');var util=require(_0x6d6f('0x0'));var path=require(_0x6d6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d6f('0x2'));var router=express[_0x6d6f('0x3')]();var fs_extra=require(_0x6d6f('0x4'));var auth=require(_0x6d6f('0x5'));var interaction=require(_0x6d6f('0x6'));var config=require(_0x6d6f('0x7'));var controller=require(_0x6d6f('0x8'));router['get']('/',auth[_0x6d6f('0x9')](),controller[_0x6d6f('0xa')]);router[_0x6d6f('0xb')](_0x6d6f('0xc'),auth[_0x6d6f('0x9')](),controller['describe']);router[_0x6d6f('0xb')](_0x6d6f('0xd'),auth[_0x6d6f('0x9')](),controller[_0x6d6f('0xe')]);router['post']('/',auth[_0x6d6f('0x9')](),controller[_0x6d6f('0xf')]);router[_0x6d6f('0x10')](_0x6d6f('0xd'),auth[_0x6d6f('0x9')](),controller['update']);router['delete'](_0x6d6f('0xd'),auth[_0x6d6f('0x9')](),controller[_0x6d6f('0x11')]);module[_0x6d6f('0x12')]=router; \ No newline at end of file +var _0xfa4f=['util','path','express','Router','../../components/auth/service','./whatsappTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xfa4f,0x109));var _0xffa4=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xfa4f[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xffa4('0x0'));var util=require(_0xffa4('0x1'));var path=require(_0xffa4('0x2'));var timeout=require('connect-timeout');var express=require(_0xffa4('0x3'));var router=express[_0xffa4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffa4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xffa4('0x6'));router['get']('/',auth[_0xffa4('0x7')](),controller[_0xffa4('0x8')]);router[_0xffa4('0x9')](_0xffa4('0xa'),auth[_0xffa4('0x7')](),controller[_0xffa4('0xb')]);router['get'](_0xffa4('0xc'),auth[_0xffa4('0x7')](),controller[_0xffa4('0xd')]);router['post']('/',auth[_0xffa4('0x7')](),controller[_0xffa4('0xe')]);router[_0xffa4('0xf')](_0xffa4('0xc'),auth[_0xffa4('0x7')](),controller[_0xffa4('0x10')]);router[_0xffa4('0x11')](_0xffa4('0xc'),auth[_0xffa4('0x7')](),controller[_0xffa4('0x12')]);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 a6fd9f8..490db1a 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 _0x4b17=['DATE','sequelize','STRING','account','agent'];(function(_0x12fc46,_0x3fd541){var _0x4666e5=function(_0x464e55){while(--_0x464e55){_0x12fc46['push'](_0x12fc46['shift']());}};_0x4666e5(++_0x3fd541);}(_0x4b17,0x10f));var _0x74b1=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x4b17[_0x22cc16];return _0x399b70;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x74b1('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x74b1('0x2'),_0x74b1('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x74b1('0x4')]}}; \ No newline at end of file +var _0x65c9=['DATE','sequelize','exports','ENUM','account','agent','queue'];(function(_0x551ed5,_0x299cc6){var _0x1a95dc=function(_0xc7fef3){while(--_0xc7fef3){_0x551ed5['push'](_0x551ed5['shift']());}};_0x1a95dc(++_0x299cc6);}(_0x65c9,0x182));var _0x965c=function(_0x283689,_0x4305fa){_0x283689=_0x283689-0x0;var _0x1d870f=_0x65c9[_0x283689];return _0x1d870f;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x965c('0x2')](_0x965c('0x3'),_0x965c('0x4'),_0x965c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x965c('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 5987da3..b1481ef 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 _0x4bb0=['send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','keys','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','name'];(function(_0x1773f7,_0x54318f){var _0x1983fb=function(_0x50b543){while(--_0x50b543){_0x1773f7['push'](_0x1773f7['shift']());}};_0x1983fb(++_0x54318f);}(_0x4bb0,0x73));var _0x04bb=function(_0x872f6f,_0x5efe7b){_0x872f6f=_0x872f6f-0x0;var _0x59a5f4=_0x4bb0[_0x872f6f];return _0x59a5f4;};'use strict';var emlformat=require(_0x04bb('0x0'));var rimraf=require(_0x04bb('0x1'));var zipdir=require(_0x04bb('0x2'));var jsonpatch=require(_0x04bb('0x3'));var rp=require(_0x04bb('0x4'));var moment=require(_0x04bb('0x5'));var BPromise=require(_0x04bb('0x6'));var Mustache=require(_0x04bb('0x7'));var util=require(_0x04bb('0x8'));var path=require(_0x04bb('0x9'));var sox=require(_0x04bb('0xa'));var csv=require('to-csv');var ejs=require(_0x04bb('0xb'));var fs=require('fs');var fs_extra=require(_0x04bb('0xc'));var _=require(_0x04bb('0xd'));var squel=require(_0x04bb('0xe'));var crypto=require(_0x04bb('0xf'));var jsforce=require(_0x04bb('0x10'));var deskjs=require(_0x04bb('0x11'));var toCsv=require(_0x04bb('0x12'));var querystring=require(_0x04bb('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04bb('0x14'));var as=require(_0x04bb('0x15'));var hardwareService=require(_0x04bb('0x16'));var logger=require(_0x04bb('0x17'))('api');var utils=require(_0x04bb('0x18'));var config=require(_0x04bb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x04bb('0x1a'))['db'];function respondWithStatusCode(_0x1a0370,_0x33f38c){_0x33f38c=_0x33f38c||0xcc;return function(_0x2e7c81){if(_0x2e7c81){return _0x1a0370['sendStatus'](_0x33f38c);}return _0x1a0370[_0x04bb('0x1b')](_0x33f38c)[_0x04bb('0x1c')]();};}function respondWithResult(_0x26c986,_0x4e20fb){_0x4e20fb=_0x4e20fb||0xc8;return function(_0x57d3ab){if(_0x57d3ab){return _0x26c986[_0x04bb('0x1b')](_0x4e20fb)[_0x04bb('0x1d')](_0x57d3ab);}};}function respondWithFilteredResult(_0x3ea048,_0xba2415){return function(_0x41be00){if(_0x41be00){var _0x4f2ec7=typeof _0xba2415[_0x04bb('0x1e')]===_0x04bb('0x1f')&&typeof _0xba2415[_0x04bb('0x20')]==='undefined';var _0x4e4be8=_0x41be00[_0x04bb('0x21')];var _0xa1b844=_0x4f2ec7?0x0:_0xba2415['offset'];var _0x3ce992=_0x4f2ec7?_0x41be00[_0x04bb('0x21')]:_0xba2415[_0x04bb('0x1e')]+_0xba2415['limit'];var _0x3db2dc;if(_0x3ce992>=_0x4e4be8){_0x3ce992=_0x4e4be8;_0x3db2dc=0xc8;}else{_0x3db2dc=0xce;}_0x3ea048['status'](_0x3db2dc);return _0x3ea048[_0x04bb('0x22')](_0x04bb('0x23'),_0xa1b844+'-'+_0x3ce992+'/'+_0x4e4be8)['json'](_0x41be00);}return null;};}function patchUpdates(_0x4689a0){return function(_0x44ce75){try{jsonpatch['apply'](_0x44ce75,_0x4689a0,!![]);}catch(_0x4539e4){return BPromise[_0x04bb('0x24')](_0x4539e4);}return _0x44ce75['save']();};}function saveUpdates(_0x38f872,_0x188c74){return function(_0xdd6527){if(_0xdd6527){return _0xdd6527[_0x04bb('0x25')](_0x38f872)['then'](function(_0x116c51){return _0x116c51;});}return null;};}function removeEntity(_0x2043d2,_0x5d960a){return function(_0x21bfc4){if(_0x21bfc4){return _0x21bfc4[_0x04bb('0x26')]()[_0x04bb('0x27')](function(){_0x2043d2['status'](0xcc)[_0x04bb('0x1c')]();});}};}function handleEntityNotFound(_0x83bb7,_0x529228){return function(_0x4dd82c){if(!_0x4dd82c){_0x83bb7[_0x04bb('0x28')](0x194);}return _0x4dd82c;};}function handleError(_0x839022,_0x19845a){_0x19845a=_0x19845a||0x1f4;return function(_0x2f3a14){logger[_0x04bb('0x29')](_0x2f3a14['stack']);if(_0x2f3a14['name']){delete _0x2f3a14[_0x04bb('0x2a')];}_0x839022[_0x04bb('0x1b')](_0x19845a)[_0x04bb('0x2b')](_0x2f3a14);};}exports[_0x04bb('0x2c')]=function(_0x1fe962,_0x3a6100){var _0x58c64f={},_0x5ba7bf={},_0x33b688={'count':0x0,'rows':[]};var _0x5364ea=_[_0x04bb('0x2d')](db[_0x04bb('0x2e')][_0x04bb('0x2f')],function(_0x137f65){return{'name':_0x137f65[_0x04bb('0x30')],'type':_0x137f65[_0x04bb('0x31')][_0x04bb('0x32')]};});_0x5ba7bf[_0x04bb('0x33')]=_['map'](_0x5364ea,_0x04bb('0x2a'));_0x5ba7bf[_0x04bb('0x34')]=_['keys'](_0x1fe962[_0x04bb('0x34')]);_0x5ba7bf[_0x04bb('0x35')]=_[_0x04bb('0x36')](_0x5ba7bf[_0x04bb('0x33')],_0x5ba7bf[_0x04bb('0x34')]);_0x58c64f[_0x04bb('0x37')]=_[_0x04bb('0x36')](_0x5ba7bf[_0x04bb('0x33')],qs[_0x04bb('0x38')](_0x1fe962['query'][_0x04bb('0x38')]));_0x58c64f[_0x04bb('0x37')]=_0x58c64f[_0x04bb('0x37')]['length']?_0x58c64f[_0x04bb('0x37')]:_0x5ba7bf['model'];if(!_0x1fe962[_0x04bb('0x34')][_0x04bb('0x39')](_0x04bb('0x3a'))){_0x58c64f[_0x04bb('0x20')]=qs['limit'](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x20')]);_0x58c64f[_0x04bb('0x1e')]=qs['offset'](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x1e')]);}_0x58c64f[_0x04bb('0x3b')]=qs[_0x04bb('0x3c')](_0x1fe962[_0x04bb('0x34')][_0x04bb('0x3c')]);_0x58c64f['where']=qs[_0x04bb('0x35')](_[_0x04bb('0x3d')](_0x1fe962['query'],_0x5ba7bf[_0x04bb('0x35')]),_0x5364ea);if(_0x1fe962[_0x04bb('0x34')]['filter']){_0x58c64f[_0x04bb('0x3e')]=_[_0x04bb('0x3f')](_0x58c64f[_0x04bb('0x3e')],{'$or':_[_0x04bb('0x2d')](_0x5364ea,function(_0x39bff5){if(_0x39bff5[_0x04bb('0x31')]!==_0x04bb('0x40')){var _0x107566={};_0x107566[_0x39bff5[_0x04bb('0x2a')]]={'$like':'%'+_0x1fe962['query'][_0x04bb('0x41')]+'%'};return _0x107566;}})});}_0x58c64f=_['merge']({},_0x58c64f,_0x1fe962[_0x04bb('0x42')]);var _0x2b6c10={'where':_0x58c64f[_0x04bb('0x3e')]};return db[_0x04bb('0x2e')][_0x04bb('0x21')](_0x2b6c10)[_0x04bb('0x27')](function(_0x15f68e){_0x33b688['count']=_0x15f68e;if(_0x1fe962[_0x04bb('0x34')][_0x04bb('0x43')]){_0x58c64f['include']=[{'all':!![]}];}return db[_0x04bb('0x2e')][_0x04bb('0x44')](_0x58c64f);})[_0x04bb('0x27')](function(_0x517d3e){_0x33b688['rows']=_0x517d3e;return _0x33b688;})['then'](respondWithFilteredResult(_0x3a6100,_0x58c64f))[_0x04bb('0x45')](handleError(_0x3a6100,null));};exports[_0x04bb('0x46')]=function(_0x5a8a30,_0x4a67fc){var _0x5c8947={'raw':!![],'where':{'id':_0x5a8a30[_0x04bb('0x47')]['id']}},_0xc7b774={};_0xc7b774[_0x04bb('0x33')]=_[_0x04bb('0x48')](db['WhatsappTransferReport'][_0x04bb('0x2f')]);_0xc7b774['query']=_[_0x04bb('0x48')](_0x5a8a30[_0x04bb('0x34')]);_0xc7b774['filters']=_['intersection'](_0xc7b774[_0x04bb('0x33')],_0xc7b774[_0x04bb('0x34')]);_0x5c8947[_0x04bb('0x37')]=_[_0x04bb('0x36')](_0xc7b774[_0x04bb('0x33')],qs[_0x04bb('0x38')](_0x5a8a30['query'][_0x04bb('0x38')]));_0x5c8947[_0x04bb('0x37')]=_0x5c8947['attributes'][_0x04bb('0x49')]?_0x5c8947[_0x04bb('0x37')]:_0xc7b774[_0x04bb('0x33')];if(_0x5a8a30['query'][_0x04bb('0x43')]){_0x5c8947[_0x04bb('0x4a')]=[{'all':!![]}];}_0x5c8947=_[_0x04bb('0x3f')]({},_0x5c8947,_0x5a8a30['options']);return db[_0x04bb('0x2e')][_0x04bb('0x4b')](_0x5c8947)[_0x04bb('0x27')](handleEntityNotFound(_0x4a67fc,null))[_0x04bb('0x27')](respondWithResult(_0x4a67fc,null))[_0x04bb('0x45')](handleError(_0x4a67fc,null));};exports['create']=function(_0x2d294b,_0x1380d0){return db[_0x04bb('0x2e')][_0x04bb('0x4c')](_0x2d294b[_0x04bb('0x4d')],{})[_0x04bb('0x27')](respondWithResult(_0x1380d0,0xc9))['catch'](handleError(_0x1380d0,null));};exports[_0x04bb('0x25')]=function(_0x27b773,_0x3cfdf3){if(_0x27b773[_0x04bb('0x4d')]['id']){delete _0x27b773[_0x04bb('0x4d')]['id'];}return db[_0x04bb('0x2e')][_0x04bb('0x4b')]({'where':{'id':_0x27b773[_0x04bb('0x47')]['id']}})[_0x04bb('0x27')](handleEntityNotFound(_0x3cfdf3,null))[_0x04bb('0x27')](saveUpdates(_0x27b773['body'],null))[_0x04bb('0x27')](respondWithResult(_0x3cfdf3,null))[_0x04bb('0x45')](handleError(_0x3cfdf3,null));};exports[_0x04bb('0x26')]=function(_0x982a2a,_0x1bf9b5){return db[_0x04bb('0x2e')][_0x04bb('0x4b')]({'where':{'id':_0x982a2a[_0x04bb('0x47')]['id']}})[_0x04bb('0x27')](handleEntityNotFound(_0x1bf9b5,null))[_0x04bb('0x27')](removeEntity(_0x1bf9b5,null))[_0x04bb('0x45')](handleError(_0x1bf9b5,null));};exports[_0x04bb('0x4e')]=function(_0x119993,_0x16ce77){return db[_0x04bb('0x2e')][_0x04bb('0x4e')]()[_0x04bb('0x27')](respondWithResult(_0x16ce77,null))['catch'](handleError(_0x16ce77,null));}; \ No newline at end of file +var _0xf672=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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'];(function(_0x20a887,_0x3570f2){var _0x34217e=function(_0x2749cc){while(--_0x2749cc){_0x20a887['push'](_0x20a887['shift']());}};_0x34217e(++_0x3570f2);}(_0xf672,0xc5));var _0x2f67=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf672[_0x4a53d];return _0x27410e;};'use strict';var emlformat=require(_0x2f67('0x0'));var rimraf=require(_0x2f67('0x1'));var zipdir=require(_0x2f67('0x2'));var jsonpatch=require(_0x2f67('0x3'));var rp=require('request-promise');var moment=require(_0x2f67('0x4'));var BPromise=require(_0x2f67('0x5'));var Mustache=require(_0x2f67('0x6'));var util=require(_0x2f67('0x7'));var path=require('path');var sox=require(_0x2f67('0x8'));var csv=require(_0x2f67('0x9'));var ejs=require(_0x2f67('0xa'));var fs=require('fs');var fs_extra=require(_0x2f67('0xb'));var _=require('lodash');var squel=require(_0x2f67('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2f67('0xe'));var Papa=require(_0x2f67('0xf'));var Redis=require(_0x2f67('0x10'));var authService=require(_0x2f67('0x11'));var qs=require(_0x2f67('0x12'));var as=require(_0x2f67('0x13'));var hardwareService=require(_0x2f67('0x14'));var logger=require(_0x2f67('0x15'))(_0x2f67('0x16'));var utils=require(_0x2f67('0x17'));var config=require(_0x2f67('0x18'));var licenseUtil=require(_0x2f67('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12ebb4,_0x121679){_0x121679=_0x121679||0xcc;return function(_0x4b536a){if(_0x4b536a){return _0x12ebb4[_0x2f67('0x1a')](_0x121679);}return _0x12ebb4['status'](_0x121679)[_0x2f67('0x1b')]();};}function respondWithResult(_0x5f4138,_0x2651df){_0x2651df=_0x2651df||0xc8;return function(_0x530c67){if(_0x530c67){return _0x5f4138[_0x2f67('0x1c')](_0x2651df)['json'](_0x530c67);}};}function respondWithFilteredResult(_0x519931,_0x26e808){return function(_0x31860a){if(_0x31860a){var _0x2b2708=typeof _0x26e808[_0x2f67('0x1d')]===_0x2f67('0x1e')&&typeof _0x26e808[_0x2f67('0x1f')]===_0x2f67('0x1e');var _0x4ab91a=_0x31860a['count'];var _0x493bab=_0x2b2708?0x0:_0x26e808['offset'];var _0x5b580c=_0x2b2708?_0x31860a[_0x2f67('0x20')]:_0x26e808[_0x2f67('0x1d')]+_0x26e808['limit'];var _0x59593e;if(_0x5b580c>=_0x4ab91a){_0x5b580c=_0x4ab91a;_0x59593e=0xc8;}else{_0x59593e=0xce;}_0x519931[_0x2f67('0x1c')](_0x59593e);return _0x519931[_0x2f67('0x21')](_0x2f67('0x22'),_0x493bab+'-'+_0x5b580c+'/'+_0x4ab91a)[_0x2f67('0x23')](_0x31860a);}return null;};}function patchUpdates(_0xbe8812){return function(_0x4f3d48){try{jsonpatch['apply'](_0x4f3d48,_0xbe8812,!![]);}catch(_0x3a2152){return BPromise[_0x2f67('0x24')](_0x3a2152);}return _0x4f3d48['save']();};}function saveUpdates(_0x46702b,_0x40af85){return function(_0x3d4479){if(_0x3d4479){return _0x3d4479[_0x2f67('0x25')](_0x46702b)[_0x2f67('0x26')](function(_0x4c182b){return _0x4c182b;});}return null;};}function removeEntity(_0x34d172,_0x283861){return function(_0x175452){if(_0x175452){return _0x175452[_0x2f67('0x27')]()[_0x2f67('0x26')](function(){_0x34d172['status'](0xcc)[_0x2f67('0x1b')]();});}};}function handleEntityNotFound(_0x3b43d7,_0x1ce540){return function(_0x50cfba){if(!_0x50cfba){_0x3b43d7['sendStatus'](0x194);}return _0x50cfba;};}function handleError(_0x285183,_0x3636ef){_0x3636ef=_0x3636ef||0x1f4;return function(_0x109483){logger[_0x2f67('0x28')](_0x109483['stack']);if(_0x109483[_0x2f67('0x29')]){delete _0x109483[_0x2f67('0x29')];}_0x285183[_0x2f67('0x1c')](_0x3636ef)[_0x2f67('0x2a')](_0x109483);};}exports['index']=function(_0x406251,_0x11a039){var _0x50fdcf={},_0x113c5e={},_0x35c6ca={'count':0x0,'rows':[]};var _0x382b72=_[_0x2f67('0x2b')](db[_0x2f67('0x2c')][_0x2f67('0x2d')],function(_0x3a14b9){return{'name':_0x3a14b9[_0x2f67('0x2e')],'type':_0x3a14b9[_0x2f67('0x2f')]['key']};});_0x113c5e['model']=_['map'](_0x382b72,_0x2f67('0x29'));_0x113c5e[_0x2f67('0x30')]=_['keys'](_0x406251['query']);_0x113c5e['filters']=_[_0x2f67('0x31')](_0x113c5e[_0x2f67('0x32')],_0x113c5e['query']);_0x50fdcf['attributes']=_[_0x2f67('0x31')](_0x113c5e[_0x2f67('0x32')],qs[_0x2f67('0x33')](_0x406251['query'][_0x2f67('0x33')]));_0x50fdcf['attributes']=_0x50fdcf[_0x2f67('0x34')][_0x2f67('0x35')]?_0x50fdcf[_0x2f67('0x34')]:_0x113c5e[_0x2f67('0x32')];if(!_0x406251[_0x2f67('0x30')]['hasOwnProperty'](_0x2f67('0x36'))){_0x50fdcf[_0x2f67('0x1f')]=qs['limit'](_0x406251['query'][_0x2f67('0x1f')]);_0x50fdcf[_0x2f67('0x1d')]=qs[_0x2f67('0x1d')](_0x406251[_0x2f67('0x30')][_0x2f67('0x1d')]);}_0x50fdcf[_0x2f67('0x37')]=qs['sort'](_0x406251['query']['sort']);_0x50fdcf['where']=qs['filters'](_[_0x2f67('0x38')](_0x406251[_0x2f67('0x30')],_0x113c5e['filters']),_0x382b72);if(_0x406251['query'][_0x2f67('0x39')]){_0x50fdcf[_0x2f67('0x3a')]=_[_0x2f67('0x3b')](_0x50fdcf[_0x2f67('0x3a')],{'$or':_[_0x2f67('0x2b')](_0x382b72,function(_0x1b8bf7){if(_0x1b8bf7[_0x2f67('0x2f')]!==_0x2f67('0x3c')){var _0x35196f={};_0x35196f[_0x1b8bf7[_0x2f67('0x29')]]={'$like':'%'+_0x406251[_0x2f67('0x30')][_0x2f67('0x39')]+'%'};return _0x35196f;}})});}_0x50fdcf=_[_0x2f67('0x3b')]({},_0x50fdcf,_0x406251[_0x2f67('0x3d')]);var _0x38c5ce={'where':_0x50fdcf[_0x2f67('0x3a')]};return db[_0x2f67('0x2c')][_0x2f67('0x20')](_0x38c5ce)['then'](function(_0x418afb){_0x35c6ca[_0x2f67('0x20')]=_0x418afb;if(_0x406251[_0x2f67('0x30')]['includeAll']){_0x50fdcf[_0x2f67('0x3e')]=[{'all':!![]}];}return db[_0x2f67('0x2c')][_0x2f67('0x3f')](_0x50fdcf);})['then'](function(_0x5150b8){_0x35c6ca[_0x2f67('0x40')]=_0x5150b8;return _0x35c6ca;})[_0x2f67('0x26')](respondWithFilteredResult(_0x11a039,_0x50fdcf))[_0x2f67('0x41')](handleError(_0x11a039,null));};exports['show']=function(_0x31f0e8,_0x380b23){var _0xe9f7f1={'raw':!![],'where':{'id':_0x31f0e8[_0x2f67('0x42')]['id']}},_0x53c5d5={};_0x53c5d5['model']=_[_0x2f67('0x43')](db['WhatsappTransferReport'][_0x2f67('0x2d')]);_0x53c5d5['query']=_[_0x2f67('0x43')](_0x31f0e8[_0x2f67('0x30')]);_0x53c5d5['filters']=_[_0x2f67('0x31')](_0x53c5d5[_0x2f67('0x32')],_0x53c5d5[_0x2f67('0x30')]);_0xe9f7f1[_0x2f67('0x34')]=_['intersection'](_0x53c5d5['model'],qs[_0x2f67('0x33')](_0x31f0e8[_0x2f67('0x30')][_0x2f67('0x33')]));_0xe9f7f1['attributes']=_0xe9f7f1[_0x2f67('0x34')][_0x2f67('0x35')]?_0xe9f7f1[_0x2f67('0x34')]:_0x53c5d5['model'];if(_0x31f0e8[_0x2f67('0x30')][_0x2f67('0x44')]){_0xe9f7f1[_0x2f67('0x3e')]=[{'all':!![]}];}_0xe9f7f1=_[_0x2f67('0x3b')]({},_0xe9f7f1,_0x31f0e8[_0x2f67('0x3d')]);return db['WhatsappTransferReport'][_0x2f67('0x45')](_0xe9f7f1)['then'](handleEntityNotFound(_0x380b23,null))['then'](respondWithResult(_0x380b23,null))['catch'](handleError(_0x380b23,null));};exports[_0x2f67('0x46')]=function(_0x471d0e,_0xa4b501){return db['WhatsappTransferReport'][_0x2f67('0x46')](_0x471d0e[_0x2f67('0x47')],{})[_0x2f67('0x26')](respondWithResult(_0xa4b501,0xc9))[_0x2f67('0x41')](handleError(_0xa4b501,null));};exports[_0x2f67('0x25')]=function(_0x4d8d5f,_0x3434c4){if(_0x4d8d5f[_0x2f67('0x47')]['id']){delete _0x4d8d5f['body']['id'];}return db[_0x2f67('0x2c')][_0x2f67('0x45')]({'where':{'id':_0x4d8d5f[_0x2f67('0x42')]['id']}})['then'](handleEntityNotFound(_0x3434c4,null))[_0x2f67('0x26')](saveUpdates(_0x4d8d5f['body'],null))[_0x2f67('0x26')](respondWithResult(_0x3434c4,null))[_0x2f67('0x41')](handleError(_0x3434c4,null));};exports[_0x2f67('0x27')]=function(_0x2b437d,_0x3d80d3){return db[_0x2f67('0x2c')]['find']({'where':{'id':_0x2b437d[_0x2f67('0x42')]['id']}})['then'](handleEntityNotFound(_0x3d80d3,null))[_0x2f67('0x26')](removeEntity(_0x3d80d3,null))[_0x2f67('0x41')](handleError(_0x3d80d3,null));};exports[_0x2f67('0x48')]=function(_0x191b34,_0x35c6b5){return db[_0x2f67('0x2c')]['describe']()[_0x2f67('0x26')](respondWithResult(_0x35c6b5,null))[_0x2f67('0x41')](handleError(_0x35c6b5,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index cb6711f..52ec26a 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 _0x793c=['rimraf','../../config/environment','./whatsappTransferReport.attributes','define','uniqueid','lodash','../../config/logger','moment','request-promise','path'];(function(_0x142a02,_0x1a6523){var _0x59a00f=function(_0x1fecbd){while(--_0x1fecbd){_0x142a02['push'](_0x142a02['shift']());}};_0x59a00f(++_0x1a6523);}(_0x793c,0xff));var _0xc793=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x793c[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xc793('0x0'));var util=require('util');var logger=require(_0xc793('0x1'))('api');var moment=require(_0xc793('0x2'));var BPromise=require('bluebird');var rp=require(_0xc793('0x3'));var fs=require('fs');var path=require(_0xc793('0x4'));var rimraf=require(_0xc793('0x5'));var config=require(_0xc793('0x6'));var attributes=require(_0xc793('0x7'));module['exports']=function(_0x3783de,_0x43a80a){return _0x3783de[_0xc793('0x8')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xc793('0x9'),'fields':[_0xc793('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8948=['../../config/logger','api','bluebird','request-promise','path','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util'];(function(_0x57e811,_0x125185){var _0x3c11dd=function(_0xf7842){while(--_0xf7842){_0x57e811['push'](_0x57e811['shift']());}};_0x3c11dd(++_0x125185);}(_0x8948,0x1c2));var _0x8894=function(_0x4327ad,_0x2169db){_0x4327ad=_0x4327ad-0x0;var _0x37f9da=_0x8948[_0x4327ad];return _0x37f9da;};'use strict';var _=require('lodash');var util=require(_0x8894('0x0'));var logger=require(_0x8894('0x1'))(_0x8894('0x2'));var moment=require('moment');var BPromise=require(_0x8894('0x3'));var rp=require(_0x8894('0x4'));var fs=require('fs');var path=require(_0x8894('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x8894('0x6')]=function(_0x5b5a03,_0x28a0aa){return _0x5b5a03[_0x8894('0x7')](_0x8894('0x8'),attributes,{'tableName':_0x8894('0x9'),'paranoid':![],'indexes':[{'name':_0x8894('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8e1072d..98d212d 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 _0x6ef0=['WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xc932f1,_0x598c86){var _0x2dd780=function(_0x172083){while(--_0x172083){_0xc932f1['push'](_0xc932f1['shift']());}};_0x2dd780(++_0x598c86);}(_0x6ef0,0x1ac));var _0x06ef=function(_0x2880ce,_0x56ccc3){_0x2880ce=_0x2880ce-0x0;var _0x5e7bee=_0x6ef0[_0x2880ce];return _0x5e7bee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x06ef('0x0'));var BPromise=require(_0x06ef('0x1'));var rs=require(_0x06ef('0x2'));var fs=require('fs');var Redis=require(_0x06ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x06ef('0x4'));var logger=require(_0x06ef('0x5'))(_0x06ef('0x6'));var config=require(_0x06ef('0x7'));var jayson=require(_0x06ef('0x8'));var client=jayson[_0x06ef('0x9')][_0x06ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5ffb,_0x283006,_0x654ce8){return new BPromise(function(_0x534b3a,_0xa8200){return client['request'](_0x1b5ffb,_0x654ce8)[_0x06ef('0xb')](function(_0x55e85e){logger[_0x06ef('0xc')](_0x06ef('0xd'),_0x283006,'request\x20sent');logger[_0x06ef('0xe')](_0x06ef('0xf'),_0x283006,_0x06ef('0x10'),JSON[_0x06ef('0x11')](_0x55e85e));if(_0x55e85e[_0x06ef('0x12')]){if(_0x55e85e[_0x06ef('0x12')]['code']===0x1f4){logger[_0x06ef('0x12')](_0x06ef('0xd'),_0x283006,_0x55e85e['error'][_0x06ef('0x13')]);return _0xa8200(_0x55e85e[_0x06ef('0x12')]['message']);}logger[_0x06ef('0x12')](_0x06ef('0xd'),_0x283006,_0x55e85e[_0x06ef('0x12')]['message']);return _0x534b3a(_0x55e85e[_0x06ef('0x12')][_0x06ef('0x13')]);}else{logger['info'](_0x06ef('0xd'),_0x283006,_0x06ef('0x10'));_0x534b3a(_0x55e85e['result'][_0x06ef('0x13')]);}})[_0x06ef('0x14')](function(_0x4b2f8a){logger[_0x06ef('0x12')](_0x06ef('0xd'),_0x283006,_0x4b2f8a);_0xa8200(_0x4b2f8a);});});} \ No newline at end of file +var _0x7e8a=['request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7e8a,0x1b2));var _0xa7e8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x7e8a[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xa7e8('0x0'));var util=require(_0xa7e8('0x1'));var moment=require(_0xa7e8('0x2'));var BPromise=require(_0xa7e8('0x3'));var rs=require(_0xa7e8('0x4'));var fs=require('fs');var Redis=require(_0xa7e8('0x5'));var db=require(_0xa7e8('0x6'))['db'];var utils=require(_0xa7e8('0x7'));var logger=require('../../config/logger')(_0xa7e8('0x8'));var config=require(_0xa7e8('0x9'));var jayson=require(_0xa7e8('0xa'));var client=jayson[_0xa7e8('0xb')][_0xa7e8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ba260,_0x1c4cda,_0x94f3a3){return new BPromise(function(_0x17e078,_0xb3f034){return client[_0xa7e8('0xd')](_0x3ba260,_0x94f3a3)[_0xa7e8('0xe')](function(_0x432a63){logger['info'](_0xa7e8('0xf'),_0x1c4cda,_0xa7e8('0x10'));logger['debug'](_0xa7e8('0x11'),_0x1c4cda,'request\x20sent',JSON[_0xa7e8('0x12')](_0x432a63));if(_0x432a63[_0xa7e8('0x13')]){if(_0x432a63[_0xa7e8('0x13')][_0xa7e8('0x14')]===0x1f4){logger[_0xa7e8('0x13')](_0xa7e8('0xf'),_0x1c4cda,_0x432a63['error'][_0xa7e8('0x15')]);return _0xb3f034(_0x432a63[_0xa7e8('0x13')]['message']);}logger[_0xa7e8('0x13')](_0xa7e8('0xf'),_0x1c4cda,_0x432a63[_0xa7e8('0x13')][_0xa7e8('0x15')]);return _0x17e078(_0x432a63[_0xa7e8('0x13')][_0xa7e8('0x15')]);}else{logger[_0xa7e8('0x16')](_0xa7e8('0xf'),_0x1c4cda,_0xa7e8('0x10'));_0x17e078(_0x432a63[_0xa7e8('0x17')][_0xa7e8('0x15')]);}})[_0xa7e8('0x18')](function(_0x307a04){logger[_0xa7e8('0x13')](_0xa7e8('0xf'),_0x1c4cda,_0x307a04);_0xb3f034(_0x307a04);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 727a7b9..234b179 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3a9=['map','filter','online','join','Offline\x20apps:','name','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','sequelize','then','info','start'];(function(_0x47315c,_0xa415ae){var _0x2ff5f9=function(_0x33a3af){while(--_0x33a3af){_0x47315c['push'](_0x47315c['shift']());}};_0x2ff5f9(++_0xa415ae);}(_0xc3a9,0xa8));var _0x9c3a=function(_0x55e1d5,_0x2dfeb5){_0x55e1d5=_0x55e1d5-0x0;var _0x5658f7=_0xc3a9[_0x55e1d5];return _0x5658f7;};'use strict';var _=require(_0x9c3a('0x0'));var mysqldb=require(_0x9c3a('0x1'));var rpc=require(_0x9c3a('0x2'));var config=require(_0x9c3a('0x3'));var logger=require(_0x9c3a('0x4'))(_0x9c3a('0x5'));var pm2=require(_0x9c3a('0x6'));var pm2Config=require(_0x9c3a('0x7'));var schedule=require('./config/schedule');var chat=require(_0x9c3a('0x8'));var whatsapp=require(_0x9c3a('0x9'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x9c3a('0xa')]['sync']()[_0x9c3a('0xb')](function(){return rpc['listen']();})[_0x9c3a('0xb')](function(_0x28230a){logger[_0x9c3a('0xc')](_0x28230a);return chat[_0x9c3a('0xd')]();})['then'](function(){return whatsapp[_0x9c3a('0xd')]();})[_0x9c3a('0xb')](function(){return schedule['start']();})[_0x9c3a('0xb')](function(){return transcribe[_0x9c3a('0xd')]();})[_0x9c3a('0xb')](function(_0x347abd){logger[_0x9c3a('0xc')](_0x347abd);return pm2[_0x9c3a('0xd')](pm2Config);})[_0x9c3a('0xb')](function(_0x2215b0){logger[_0x9c3a('0xc')]('Online\x20apps:',_[_0x9c3a('0xe')](_[_0x9c3a('0xf')](_0x2215b0,{'status':_0x9c3a('0x10')}),'name')[_0x9c3a('0x11')]());logger['info'](_0x9c3a('0x12'),_['map'](_['filter'](_0x2215b0,function(_0x1a1488){return _0x1a1488['status']!==_0x9c3a('0x10');}),_0x9c3a('0x13'))['join']()||'None');config['seedDB']&&require('./config/seedDB')[_0x9c3a('0x14')]();require(_0x9c3a('0x15'))[_0x9c3a('0x14')]();})[_0x9c3a('0x16')](function(_0x272c6a){logger[_0x9c3a('0x17')](_0x9c3a('0x18'),_0x272c6a);process[_0x9c3a('0x19')](0x1);});}main(); \ No newline at end of file +var _0xbc20=['./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','sync','listen','then','info','start','Online\x20apps:','map','online','name','join','Offline\x20apps:','filter','None','seedDB','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','./mysqldb','./rpc','./config/environment'];(function(_0x2381eb,_0x4b8512){var _0x4aa1ab=function(_0x268829){while(--_0x268829){_0x2381eb['push'](_0x2381eb['shift']());}};_0x4aa1ab(++_0x4b8512);}(_0xbc20,0x126));var _0x0bc2=function(_0x2afb08,_0x324211){_0x2afb08=_0x2afb08-0x0;var _0x38cc5a=_0xbc20[_0x2afb08];return _0x38cc5a;};'use strict';var _=require('lodash');var mysqldb=require(_0x0bc2('0x0'));var rpc=require(_0x0bc2('0x1'));var config=require(_0x0bc2('0x2'));var logger=require(_0x0bc2('0x3'))(_0x0bc2('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x0bc2('0x5'));var schedule=require('./config/schedule');var chat=require(_0x0bc2('0x6'));var whatsapp=require(_0x0bc2('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db']['sequelize'][_0x0bc2('0x8')]()['then'](function(){return rpc[_0x0bc2('0x9')]();})[_0x0bc2('0xa')](function(_0x337de1){logger[_0x0bc2('0xb')](_0x337de1);return chat['start']();})[_0x0bc2('0xa')](function(){return whatsapp[_0x0bc2('0xc')]();})[_0x0bc2('0xa')](function(){return schedule[_0x0bc2('0xc')]();})['then'](function(){return transcribe[_0x0bc2('0xc')]();})['then'](function(_0x424f32){logger[_0x0bc2('0xb')](_0x424f32);return pm2[_0x0bc2('0xc')](pm2Config);})[_0x0bc2('0xa')](function(_0x32cfcb){logger[_0x0bc2('0xb')](_0x0bc2('0xd'),_[_0x0bc2('0xe')](_['filter'](_0x32cfcb,{'status':_0x0bc2('0xf')}),_0x0bc2('0x10'))[_0x0bc2('0x11')]());logger['info'](_0x0bc2('0x12'),_[_0x0bc2('0xe')](_[_0x0bc2('0x13')](_0x32cfcb,function(_0x237b27){return _0x237b27['status']!=='online';}),_0x0bc2('0x10'))[_0x0bc2('0x11')]()||_0x0bc2('0x14'));config[_0x0bc2('0x15')]&&require(_0x0bc2('0x16'))[_0x0bc2('0x17')]();require(_0x0bc2('0x18'))[_0x0bc2('0x17')]();})['catch'](function(_0x1cd3be){logger[_0x0bc2('0x19')](_0x0bc2('0x1a'),_0x1cd3be);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 374cfc3..1fc1d4c 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 _0x415e=['phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','authenticate','pass','json','Wrong\x20credentials.','startsWith','Bearer','query','getUuid','apikey','find','sub','Setting','allowedLoginAttempts','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','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','split','join','promisify','sign','secret','payload','verify','randomBytes','hex','floor','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','internal','email','userpic','voicePause','chatPause','mailPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x415e,0xda));var _0xe415=function(_0x4d43fd,_0x224e59){_0x4d43fd=_0x4d43fd-0x0;var _0x11f50e=_0x415e[_0x4d43fd];return _0x11f50e;};'use strict';var db=require(_0xe415('0x0'))['db'];var config=require(_0xe415('0x1'));var hardwareConf=require(_0xe415('0x2'));var licenseUtil=require(_0xe415('0x3'));var encryptor=require(_0xe415('0x4'));var _=require(_0xe415('0x5'));var jwt=require(_0xe415('0x6'));var expressJwt=require(_0xe415('0x7'));var compose=require(_0xe415('0x8'));var basicAuth=require(_0xe415('0x9'));var crypto=require(_0xe415('0xa'));var BPromise=require('bluebird');var util=require(_0xe415('0xb'));var moment=require(_0xe415('0xc'));var validateJwt=expressJwt({'secret':config[_0xe415('0xd')][_0xe415('0xe')]});var userAttributes=['id',_0xe415('0xf'),_0xe415('0x10'),'name',_0xe415('0x11'),_0xe415('0x12'),_0xe415('0x13'),'permissions','md5secret',_0xe415('0x14'),_0xe415('0x15'),_0xe415('0x16'),'faxPause','smsPause',_0xe415('0x17'),'pauseType',_0xe415('0x18'),_0xe415('0x19'),_0xe415('0x1a'),_0xe415('0x1b'),_0xe415('0x1c'),_0xe415('0x1d'),_0xe415('0x1e'),_0xe415('0x1f'),_0xe415('0x20'),_0xe415('0x21'),_0xe415('0x22'),'phoneBarEnableDtmfTone',_0xe415('0x23'),_0xe415('0x24'),_0xe415('0x25'),_0xe415('0x26'),_0xe415('0x27'),_0xe415('0x28'),'interface',_0xe415('0x29'),_0xe415('0x2a'),_0xe415('0x2b'),_0xe415('0x2c'),'downloadVoiceRecordings',_0xe415('0x2d'),_0xe415('0x2e')];exports[_0xe415('0x2f')]=function(){return this[_0xe415('0x30')](!![])[_0xe415('0x31')](function(_0x5daed3,_0x3ee950,_0x171c81){if(_0x5daed3[_0xe415('0x32')]){_0x171c81();}else{return db[_0xe415('0x33')][_0xe415('0x34')]({'where':{'id':_0x5daed3[_0xe415('0x35')]['id']},'attributes':['id',_0xe415('0x36'),_0xe415('0x37')],'raw':!![]})[_0xe415('0x38')](function(_0x2c3060){if(_0x2c3060&&_0x2c3060[_0xe415('0x36')]){return _0x3ee950[_0xe415('0x39')](_0x2c3060['disposition']===_0xe415('0x3a')?0x195:0x193)['json']({'message':_0x2c3060[_0xe415('0x37')]===_0xe415('0x3a')?_0xe415('0x3b'):_0xe415('0x3c')});}else{_0x171c81();}})[_0xe415('0x3d')](function(_0x20bece){_0x171c81(_0x20bece);});}});};exports[_0xe415('0x30')]=function isAuthenticated(_0xbf41){return compose()[_0xe415('0x31')](function(_0x3ec8b1,_0x13ccce,_0x6a1834){var _0x15a756;if(_0x3ec8b1[_0xe415('0x3e')][_0xe415('0x3f')]){if(_['startsWith'](_0x3ec8b1[_0xe415('0x3e')][_0xe415('0x3f')],'Basic')){var _0x22e219=basicAuth(_0x3ec8b1);db[_0xe415('0x40')]['find']({'where':{'name':_0x22e219[_0xe415('0x41')]}})[_0xe415('0x38')](function(_0x54488c){if(!_0x54488c||!_0x54488c[_0xe415('0x42')](_0x22e219[_0xe415('0x43')])){return _0x13ccce[_0xe415('0x39')](0x191)[_0xe415('0x44')]({'message':_0xe415('0x45')});}_0x3ec8b1[_0xe415('0x32')]={'id':_0x54488c['id']};_0x6a1834();})[_0xe415('0x3d')](function(_0x559bcd){_0x6a1834(_0x559bcd);});}else if(_[_0xe415('0x46')](_0x3ec8b1['headers'][_0xe415('0x3f')],_0xe415('0x47'))){validateJwt(_0x3ec8b1,_0x13ccce,_0x6a1834);}else{if(_0xbf41){_0x6a1834();}else{return _0x13ccce[_0xe415('0x39')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x3ec8b1[_0xe415('0x48')]['apikey']){try{var _0x4accc8={'audience':hardwareConf[_0xe415('0x49')](),'issuer':hardwareConf[_0xe415('0x49')]()};verifyJwt(_0x3ec8b1['query'][_0xe415('0x4a')],_0x4accc8)[_0xe415('0x38')](function(_0x22dd53){return db[_0xe415('0x40')][_0xe415('0x4b')]({'where':{'id':_0x22dd53[_0xe415('0x4c')]}})[_0xe415('0x38')](function(_0x371adf){_0x15a756=_0x371adf;return db[_0xe415('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xe415('0x4e'),'blockDuration'],'raw':!![]});})[_0xe415('0x38')](function(_0x31ea34){if(!_0x15a756||!_['isEqual'](_0x15a756[_0xe415('0x4f')],_0x22dd53['nonce'])){return _0x13ccce[_0xe415('0x39')](0x191)['json']({'message':_0xe415('0x50')});}if(_0x15a756[_0xe415('0x51')]){return _0x13ccce['status'](0x191)['json']({'message':_0xe415('0x52')});}if(_0x15a756[_0xe415('0x53')]){if(_0x31ea34[_0xe415('0x54')]>0x0){if(moment(_0x15a756[_0xe415('0x55')])['add'](_0x31ea34[_0xe415('0x54')],'minutes')>moment()){return _0x13ccce[_0xe415('0x39')](0x191)[_0xe415('0x44')]({'message':_0xe415('0x52')});}}else{return _0x13ccce[_0xe415('0x39')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x3ec8b1[_0xe415('0x32')]={'id':_0x15a756['id']};_0x6a1834();});})[_0xe415('0x3d')](function(){return _0x13ccce['status'](0x191)['json']({'message':_0xe415('0x52')});});}catch(_0x19f3a3){_0x6a1834(_0x19f3a3);}}else if(_0xbf41){_0x6a1834();}else{return _0x13ccce[_0xe415('0x39')](0x193)[_0xe415('0x44')]({'message':_0xe415('0x56')});}})[_0xe415('0x31')](function(_0x3f6dff,_0x446a33,_0x3fc0eb){if(_0x3f6dff[_0xe415('0x32')]){db[_0xe415('0x40')][_0xe415('0x4b')]({'where':{'id':_0x3f6dff[_0xe415('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x33d5ef){if(!_0x33d5ef){return _0x446a33[_0xe415('0x39')](0x194)[_0xe415('0x44')]({'message':_0xe415('0x57')});}_0x3f6dff[_0xe415('0x32')]=_0x33d5ef;_0x3fc0eb();})[_0xe415('0x3d')](function(_0x55f587){_0x3fc0eb(_0x55f587);});}else if(_0xbf41){_0x3fc0eb();}else{return _0x446a33['status'](0x194)[_0xe415('0x44')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xe415('0x58')]=function canUpdate(){return compose()[_0xe415('0x31')](function(_0x28592e,_0xb6fdd,_0x1df672){return licenseUtil[_0xe415('0x59')]()[_0xe415('0x38')](function(_0x12b12d){if(_0x12b12d['update']){_0x1df672();}else{return _0xb6fdd['status'](0x193)['json']({'message':_0xe415('0x5a')});}})['catch'](function(_0x3a2fbf){_0x1df672(_0x3a2fbf);});});};exports['isMiddleware']=function(_0x48f1f0,_0x368c64,_0x1197d8){_0x48f1f0[_0xe415('0x5b')]=!![];return _0x1197d8();};exports[_0xe415('0x5c')]=function signToken(_0xc22082){return signJwt(_0xc22082);};exports[_0xe415('0x5d')]=function(_0x3c2dc1,_0x170955){if(!_0x3c2dc1[_0xe415('0x32')]){return _0x170955[_0xe415('0x39')](0x194)['json']({'message':_0xe415('0x5e')});}var _0x515e47={'payload':{'id':_0x3c2dc1[_0xe415('0x32')]['id'],'role':_0x3c2dc1[_0xe415('0x32')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x515e47)[_0xe415('0x38')](function(_0x37efee){_0x170955[_0xe415('0x5f')]('motion.token',_0x37efee);_0x170955[_0xe415('0x60')](_0xe415('0x61'));})[_0xe415('0x3d')](function(_0x47e1e5){return _0x170955['status'](0x1f4)[_0xe415('0x62')](_0x47e1e5);});};exports[_0xe415('0x63')]=function(_0x708ffb){if(_[_0xe415('0x64')](_0x708ffb[_0xe415('0x4f')])||_[_0xe415('0x64')](_0x708ffb['apiKeyIat'])){return null;}else{return createJwt(_0x708ffb);}};exports[_0xe415('0x65')]=function(_0x5f544a){_0x5f544a[_0xe415('0x4f')]=generateNonce();_0x5f544a['apiKeyIat']=generateIssuedAt();return createJwt(_0x5f544a);};exports[_0xe415('0x66')]=function(_0x3a84bb,_0x2f3638){var _0x4abedc=_0x3a84bb['query']['apikey'];if(_0x4abedc){var _0xb1dfb3={'nonce':_0x2f3638[_0xe415('0x4f')],'iat':_0x2f3638[_0xe415('0x67')],'audience':hardwareConf[_0xe415('0x49')](),'issuer':hardwareConf[_0xe415('0x49')]()};return verifyJwt(_0x4abedc,_0xb1dfb3)[_0xe415('0x38')](function(){return generateApiKey(_0x2f3638);});}else{throw{'message':_0xe415('0x68')};}};exports['validatePasswordPattern']=function(_0x274b38){var _0x481dde=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x481dde[_0xe415('0x69')](_0x274b38))throw new db[(_0xe415('0x6a'))][(_0xe415('0x6b'))](_0xe415('0x6c'));return;};exports[_0xe415('0x6d')]=function(_0xd79208,_0x37a8fd,_0x28cfce){var _0x2fd8e0=encryptor[_0xe415('0x6e')](_0x37a8fd)['split'](',');for(var _0x52b08d=0x0;_0x52b08d<_0x28cfce;_0x52b08d++){if(!_0x2fd8e0[_0x52b08d])break;if(_0xd79208['toLowerCase']()===_0x2fd8e0[_0x52b08d][_0xe415('0x6f')]()){var _0x2cc189=util[_0xe415('0x70')](_0xe415('0x71'),_0x28cfce);if(_0x28cfce===0x1){_0x2cc189=_0xe415('0x72');}throw new db[(_0xe415('0x6a'))]['ValidationError'](_0x2cc189);}}return;};exports[_0xe415('0x73')]=function(_0x4c1bbf,_0x46ac44){var _0x3fe40d=_0x46ac44?encryptor['decryptString'](_0x46ac44)[_0xe415('0x74')](','):[];if(_0x3fe40d['length']===0x5){_0x3fe40d['splice'](-0x1,0x1);}_0x3fe40d['unshift'](_0x4c1bbf);return encryptor['encryptString'](_0x3fe40d[_0xe415('0x75')](','));};function signJwt(_0x36ad67){var _0x51bc56=BPromise[_0xe415('0x76')](jwt[_0xe415('0x77')],{'context':jwt});var _0x1ae816=_0x36ad67[_0xe415('0x78')]||config[_0xe415('0xd')][_0xe415('0xe')];return new BPromise(function(_0x26c53a,_0x30f303){_0x51bc56(_0x36ad67[_0xe415('0x79')],_0x1ae816,_0x36ad67['options'])[_0xe415('0x38')](function(_0x4eabea){_0x26c53a(_0x4eabea);})[_0xe415('0x3d')](function(_0x451c1c){_0x30f303(_0x451c1c);});});}function verifyJwt(_0x3004d2,_0x13f455,_0x47fd05){var _0x28dc0d=BPromise[_0xe415('0x76')](jwt[_0xe415('0x7a')],{'context':jwt});var _0xfe0b7b=_0x47fd05||config[_0xe415('0xd')][_0xe415('0xe')];return new BPromise(function(_0x4c446d,_0x349baa){_0x28dc0d(_0x3004d2,_0xfe0b7b,_0x13f455)[_0xe415('0x38')](function(_0xcef4bd){_0x4c446d(_0xcef4bd);})[_0xe415('0x3d')](function(_0x580626){_0x349baa(_0x580626);});});}function generateNonce(){return crypto[_0xe415('0x7b')](0x10)['toString'](_0xe415('0x7c'));}function generateIssuedAt(){return Math[_0xe415('0x7d')](Date['now']()/0x3e8)[_0xe415('0x7e')]();}function createJwt(_0x13a5b7){var _0x5c75ae={'payload':{'iat':_0x13a5b7[_0xe415('0x67')],'nonce':_0x13a5b7['apiKeyNonce']},'options':{'algorithm':_0xe415('0x7f'),'subject':_0x13a5b7['id'][_0xe415('0x7e')](),'issuer':hardwareConf[_0xe415('0x49')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x5c75ae)[_0xe415('0x38')](function(_0x201dd6){return{'iat':_0x13a5b7['apiKeyIat'],'nonce':_0x13a5b7[_0xe415('0x4f')],'token':_0x201dd6};});} \ No newline at end of file +var _0x7184=['smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','closed','disposition','then','unmanaged','json','Unmanaged.','catch','authorization','startsWith','Basic','User','name','authenticate','pass','status','headers','Bearer','query','apikey','getUuid','sub','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','unshift','promisify','sign','secret','options','randomBytes','hex','floor','toString','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','secrets','fullname','internal','userpic','md5secret','voicePause','chatPause','mailPause','faxPause'];(function(_0x493a53,_0x4597c7){var _0xb32ee7=function(_0x156b58){while(--_0x156b58){_0x493a53['push'](_0x493a53['shift']());}};_0xb32ee7(++_0x4597c7);}(_0x7184,0xd8));var _0x4718=function(_0xac21df,_0x4f3ba2){_0xac21df=_0xac21df-0x0;var _0x1faa60=_0x7184[_0xac21df];return _0x1faa60;};'use strict';var db=require(_0x4718('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x4718('0x1'));var licenseUtil=require(_0x4718('0x2'));var encryptor=require(_0x4718('0x3'));var _=require(_0x4718('0x4'));var jwt=require(_0x4718('0x5'));var expressJwt=require('express-jwt');var compose=require(_0x4718('0x6'));var basicAuth=require(_0x4718('0x7'));var crypto=require(_0x4718('0x8'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x4718('0x9')]['session']});var userAttributes=['id','role',_0x4718('0xa'),'name',_0x4718('0xb'),'email',_0x4718('0xc'),'permissions',_0x4718('0xd'),_0x4718('0xe'),_0x4718('0xf'),_0x4718('0x10'),_0x4718('0x11'),_0x4718('0x12'),_0x4718('0x13'),_0x4718('0x14'),'showWebBar',_0x4718('0x15'),_0x4718('0x16'),_0x4718('0x17'),_0x4718('0x18'),_0x4718('0x19'),_0x4718('0x1a'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x4718('0x1b'),_0x4718('0x1c'),'phoneBarEnableDtmfTone',_0x4718('0x1d'),_0x4718('0x1e'),_0x4718('0x1f'),_0x4718('0x20'),_0x4718('0x21'),'hotdesk',_0x4718('0x22'),_0x4718('0x23'),'privacyEnabled','settingsEnabled',_0x4718('0x24'),_0x4718('0x25'),'downloadOmnichannelInteractions',_0x4718('0x26')];exports[_0x4718('0x27')]=function(){return this[_0x4718('0x28')](!![])[_0x4718('0x29')](function(_0xcc39bd,_0x125277,_0x13f74a){if(_0xcc39bd[_0x4718('0x2a')]){_0x13f74a();}else{return db[_0x4718('0x2b')]['findOne']({'where':{'id':_0xcc39bd[_0x4718('0x2c')]['id']},'attributes':['id',_0x4718('0x2d'),_0x4718('0x2e')],'raw':!![]})[_0x4718('0x2f')](function(_0x55caa9){if(_0x55caa9&&_0x55caa9[_0x4718('0x2d')]){return _0x125277['status'](_0x55caa9[_0x4718('0x2e')]===_0x4718('0x30')?0x195:0x193)[_0x4718('0x31')]({'message':_0x55caa9[_0x4718('0x2e')]==='unmanaged'?_0x4718('0x32'):'Forbidden.'});}else{_0x13f74a();}})[_0x4718('0x33')](function(_0x41b6d8){_0x13f74a(_0x41b6d8);});}});};exports[_0x4718('0x28')]=function isAuthenticated(_0x3fcfbc){return compose()[_0x4718('0x29')](function(_0x971880,_0x2424a5,_0x4aef77){var _0x119c21;if(_0x971880['headers'][_0x4718('0x34')]){if(_[_0x4718('0x35')](_0x971880['headers']['authorization'],_0x4718('0x36'))){var _0x4328e8=basicAuth(_0x971880);db[_0x4718('0x37')]['find']({'where':{'name':_0x4328e8[_0x4718('0x38')]}})[_0x4718('0x2f')](function(_0x3dd9e1){if(!_0x3dd9e1||!_0x3dd9e1[_0x4718('0x39')](_0x4328e8[_0x4718('0x3a')])){return _0x2424a5[_0x4718('0x3b')](0x191)[_0x4718('0x31')]({'message':'Wrong\x20credentials.'});}_0x971880[_0x4718('0x2a')]={'id':_0x3dd9e1['id']};_0x4aef77();})[_0x4718('0x33')](function(_0x2a61af){_0x4aef77(_0x2a61af);});}else if(_[_0x4718('0x35')](_0x971880[_0x4718('0x3c')][_0x4718('0x34')],_0x4718('0x3d'))){validateJwt(_0x971880,_0x2424a5,_0x4aef77);}else{if(_0x3fcfbc){_0x4aef77();}else{return _0x2424a5['status'](0x193)[_0x4718('0x31')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x971880[_0x4718('0x3e')][_0x4718('0x3f')]){try{var _0xf52326={'audience':hardwareConf[_0x4718('0x40')](),'issuer':hardwareConf[_0x4718('0x40')]()};verifyJwt(_0x971880[_0x4718('0x3e')]['apikey'],_0xf52326)[_0x4718('0x2f')](function(_0x5d856a){return db[_0x4718('0x37')]['find']({'where':{'id':_0x5d856a[_0x4718('0x41')]}})[_0x4718('0x2f')](function(_0xd7ba08){_0x119c21=_0xd7ba08;return db['Setting'][_0x4718('0x42')]({'where':{'id':0x1},'attributes':[_0x4718('0x43'),_0x4718('0x44')],'raw':!![]});})[_0x4718('0x2f')](function(_0x19ecf9){if(!_0x119c21||!_[_0x4718('0x45')](_0x119c21[_0x4718('0x46')],_0x5d856a[_0x4718('0x47')])){return _0x2424a5[_0x4718('0x3b')](0x191)[_0x4718('0x31')]({'message':_0x4718('0x48')});}if(_0x119c21[_0x4718('0x49')]){return _0x2424a5[_0x4718('0x3b')](0x191)['json']({'message':_0x4718('0x4a')});}if(_0x119c21['blocked']){if(_0x19ecf9['blockDuration']>0x0){if(moment(_0x119c21[_0x4718('0x4b')])[_0x4718('0x4c')](_0x19ecf9[_0x4718('0x44')],_0x4718('0x4d'))>moment()){return _0x2424a5['status'](0x191)[_0x4718('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2424a5[_0x4718('0x3b')](0x191)[_0x4718('0x31')]({'message':_0x4718('0x4a')});}}_0x971880[_0x4718('0x2a')]={'id':_0x119c21['id']};_0x4aef77();});})[_0x4718('0x33')](function(){return _0x2424a5[_0x4718('0x3b')](0x191)[_0x4718('0x31')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x304ce5){_0x4aef77(_0x304ce5);}}else if(_0x3fcfbc){_0x4aef77();}else{return _0x2424a5[_0x4718('0x3b')](0x193)[_0x4718('0x31')]({'message':'Unknown\x20authorization\x20format'});}})[_0x4718('0x29')](function(_0x49d8bb,_0x18b3dd,_0x130a8c){if(_0x49d8bb[_0x4718('0x2a')]){db['User'][_0x4718('0x4e')]({'where':{'id':_0x49d8bb[_0x4718('0x2a')]['id']},'attributes':userAttributes})[_0x4718('0x2f')](function(_0x1a5660){if(!_0x1a5660){return _0x18b3dd[_0x4718('0x3b')](0x194)[_0x4718('0x31')]({'message':_0x4718('0x4f')});}_0x49d8bb[_0x4718('0x2a')]=_0x1a5660;_0x130a8c();})['catch'](function(_0x465007){_0x130a8c(_0x465007);});}else if(_0x3fcfbc){_0x130a8c();}else{return _0x18b3dd[_0x4718('0x3b')](0x194)[_0x4718('0x31')]({'message':_0x4718('0x50')});}});};exports[_0x4718('0x51')]=function canUpdate(){return compose()[_0x4718('0x29')](function(_0x27b544,_0x18a9f7,_0x3800db){return licenseUtil[_0x4718('0x52')]()[_0x4718('0x2f')](function(_0x469f43){if(_0x469f43[_0x4718('0x53')]){_0x3800db();}else{return _0x18a9f7[_0x4718('0x3b')](0x193)[_0x4718('0x31')]({'message':_0x4718('0x54')});}})[_0x4718('0x33')](function(_0x38dd2b){_0x3800db(_0x38dd2b);});});};exports[_0x4718('0x55')]=function(_0x33582d,_0x1679aa,_0x404428){_0x33582d[_0x4718('0x55')]=!![];return _0x404428();};exports[_0x4718('0x56')]=function signToken(_0x32c409){return signJwt(_0x32c409);};exports['setTokenCookie']=function(_0x33f8be,_0x2ca3b0){if(!_0x33f8be[_0x4718('0x2a')]){return _0x2ca3b0['status'](0x194)[_0x4718('0x31')]({'message':_0x4718('0x57')});}var _0x553654={'payload':{'id':_0x33f8be['user']['id'],'role':_0x33f8be[_0x4718('0x2a')][_0x4718('0x58')]},'options':{'expiresIn':0x15180}};return signJwt(_0x553654)['then'](function(_0x3bc24a){_0x2ca3b0['cookie'](_0x4718('0x59'),_0x3bc24a);_0x2ca3b0[_0x4718('0x5a')]('/dashboards/general');})['catch'](function(_0x380c53){return _0x2ca3b0[_0x4718('0x3b')](0x1f4)[_0x4718('0x5b')](_0x380c53);});};exports[_0x4718('0x5c')]=function(_0x317109){if(_['isNil'](_0x317109[_0x4718('0x46')])||_[_0x4718('0x5d')](_0x317109[_0x4718('0x5e')])){return null;}else{return createJwt(_0x317109);}};exports[_0x4718('0x5f')]=function(_0x5dbfad){_0x5dbfad['apiKeyNonce']=generateNonce();_0x5dbfad[_0x4718('0x5e')]=generateIssuedAt();return createJwt(_0x5dbfad);};exports[_0x4718('0x60')]=function(_0xe5198,_0x293803){var _0x4da375=_0xe5198[_0x4718('0x3e')][_0x4718('0x3f')];if(_0x4da375){var _0x441119={'nonce':_0x293803[_0x4718('0x46')],'iat':_0x293803[_0x4718('0x5e')],'audience':hardwareConf[_0x4718('0x40')](),'issuer':hardwareConf[_0x4718('0x40')]()};return verifyJwt(_0x4da375,_0x441119)[_0x4718('0x2f')](function(){return generateApiKey(_0x293803);});}else{throw{'message':_0x4718('0x61')};}};exports[_0x4718('0x62')]=function(_0x4f2806){var _0x16f56f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x16f56f['test'](_0x4f2806))throw new db[(_0x4718('0x63'))][(_0x4718('0x64'))](_0x4718('0x65'));return;};exports[_0x4718('0x66')]=function(_0x5ac9ae,_0x308e47,_0xd7db29){var _0x135393=encryptor[_0x4718('0x67')](_0x308e47)[_0x4718('0x68')](',');for(var _0x108787=0x0;_0x108787<_0xd7db29;_0x108787++){if(!_0x135393[_0x108787])break;if(_0x5ac9ae['toLowerCase']()===_0x135393[_0x108787]['toLowerCase']()){var _0xea7809=util['format'](_0x4718('0x69'),_0xd7db29);if(_0xd7db29===0x1){_0xea7809='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x4718('0x63'))][(_0x4718('0x64'))](_0xea7809);}}return;};exports[_0x4718('0x6a')]=function(_0x4d84c6,_0x103bc0){var _0x2ed4e8=_0x103bc0?encryptor[_0x4718('0x67')](_0x103bc0)[_0x4718('0x68')](','):[];if(_0x2ed4e8['length']===0x5){_0x2ed4e8['splice'](-0x1,0x1);}_0x2ed4e8[_0x4718('0x6b')](_0x4d84c6);return encryptor['encryptString'](_0x2ed4e8['join'](','));};function signJwt(_0xa59889){var _0x3ee5be=BPromise[_0x4718('0x6c')](jwt[_0x4718('0x6d')],{'context':jwt});var _0x10fcd2=_0xa59889[_0x4718('0x6e')]||config[_0x4718('0x9')]['session'];return new BPromise(function(_0x184b12,_0x45750d){_0x3ee5be(_0xa59889['payload'],_0x10fcd2,_0xa59889[_0x4718('0x6f')])['then'](function(_0x30f333){_0x184b12(_0x30f333);})['catch'](function(_0x3f8da3){_0x45750d(_0x3f8da3);});});}function verifyJwt(_0x4b0aa2,_0x3f978d,_0x3fc237){var _0x1f9d3c=BPromise[_0x4718('0x6c')](jwt['verify'],{'context':jwt});var _0xd9438b=_0x3fc237||config[_0x4718('0x9')]['session'];return new BPromise(function(_0x15f8f0,_0x19e93a){_0x1f9d3c(_0x4b0aa2,_0xd9438b,_0x3f978d)[_0x4718('0x2f')](function(_0x4e16bc){_0x15f8f0(_0x4e16bc);})[_0x4718('0x33')](function(_0x23a05b){_0x19e93a(_0x23a05b);});});}function generateNonce(){return crypto[_0x4718('0x70')](0x10)['toString'](_0x4718('0x71'));}function generateIssuedAt(){return Math[_0x4718('0x72')](Date['now']()/0x3e8)[_0x4718('0x73')]();}function createJwt(_0x897aca){var _0x4e9955={'payload':{'iat':_0x897aca['apiKeyIat'],'nonce':_0x897aca['apiKeyNonce']},'options':{'algorithm':_0x4718('0x74'),'subject':_0x897aca['id'][_0x4718('0x73')](),'issuer':hardwareConf[_0x4718('0x40')](),'audience':hardwareConf[_0x4718('0x40')]()}};return signJwt(_0x4e9955)[_0x4718('0x2f')](function(_0xd02024){return{'iat':_0x897aca[_0x4718('0x5e')],'nonce':_0x897aca['apiKeyNonce'],'token':_0xd02024};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index eea64e2..7be8069 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 _0x1e20=['secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','encryptString','secret','base64','decryptString','utf8','bluebird','lodash','app'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e20,0x10d));var _0x01e2=function(_0x51a022,_0x31f20e){_0x51a022=_0x51a022-0x0;var _0x2667f2=_0x1e20[_0x51a022];return _0x2667f2;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x01e2('0x0'));var _=require(_0x01e2('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x01e2('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x01e2('0x3')][_0x01e2('0x4')],'algorithm':_0x01e2('0x5')};const fileOptions={'algorithm':_0x01e2('0x6')};if(config[_0x01e2('0x7')]&&config['encrypt'][_0x01e2('0x8')]){var isSupported=isAlgorithmSupported(config[_0x01e2('0x7')][_0x01e2('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x01e2('0x7')][_0x01e2('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x01e2('0x9')](',\x20');logger[_0x01e2('0xa')](config[_0x01e2('0x7')][_0x01e2('0x8')],_0x01e2('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x2cc9bf){return AES_SUPPORTED_RX[_0x01e2('0xc')](_0x2cc9bf);}function getSupportedCiphers(){return crypto[_0x01e2('0xd')]()[_0x01e2('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x3d1438){return getSupportedCiphers()[_0x01e2('0xf')](_0x3d1438)>-0x1;}function combineOptions(_0x8eb85b){var _0x1a41d2={};for(var _0x5651fb in fileOptions){if(fileOptions[_0x01e2('0x10')](_0x5651fb)){_0x1a41d2[_0x5651fb]=fileOptions[_0x5651fb];}}if(_0x8eb85b){for(var _0x58b731 in _0x8eb85b){if(_0x8eb85b['hasOwnProperty'](_0x58b731)){_0x1a41d2[_0x58b731]=_0x8eb85b[_0x58b731];}}}return _0x1a41d2;}exports['encryptFile']=function(_0xbf3d43,_0x143439,_0x4198a6,_0x846d71){return new BPromise(function(_0x9d6cad,_0x5974d5){_0x846d71=combineOptions(_0x846d71);var _0x189835=new Buffer(_0x4198a6);var _0x35dac6=fs[_0x01e2('0x11')](_0xbf3d43);var _0x47ee0f=fs['createWriteStream'](_0x143439);var _0x35f4a6=crypto[_0x01e2('0x12')](_0x846d71['algorithm'],_0x189835);_0x35dac6['on'](_0x01e2('0x13'),function(_0x5c6ee5){var _0x405272=new Buffer(_0x35f4a6[_0x01e2('0x14')](_0x5c6ee5),_0x01e2('0x15'));_0x47ee0f[_0x01e2('0x16')](_0x405272);});_0x35dac6['on'](_0x01e2('0x17'),function(){try{var _0x1f110d=new Buffer(_0x35f4a6[_0x01e2('0x18')](_0x01e2('0x15')),_0x01e2('0x15'));_0x47ee0f['write'](_0x1f110d);_0x47ee0f[_0x01e2('0x17')]();_0x47ee0f['on'](_0x01e2('0x19'),function(){return _0x9d6cad(_0x143439);});}catch(_0x1f69f0){fs[_0x01e2('0x1a')](_0x143439);return _0x5974d5(_0x1f69f0);}});});};exports[_0x01e2('0x1b')]=function(_0x33a85b,_0x48822d,_0x2754ef,_0x5269a9){return new BPromise(function(_0x1b2728,_0x1cc134){_0x5269a9=combineOptions(_0x5269a9);var _0x4700de=new Buffer(_0x2754ef);var _0x39fd4d=fs['createReadStream'](_0x33a85b);var _0x21555c=fs['createWriteStream'](_0x48822d);var _0x1c4f62=crypto[_0x01e2('0x1c')](_0x5269a9[_0x01e2('0x8')],_0x4700de);_0x39fd4d['on'](_0x01e2('0x13'),function(_0x53cf7a){var _0x11742d=new Buffer(_0x1c4f62['update'](_0x53cf7a),'binary');_0x21555c['write'](_0x11742d);});_0x39fd4d['on'](_0x01e2('0x17'),function(){try{var _0x1d5b70=new Buffer(_0x1c4f62[_0x01e2('0x18')]('binary'),_0x01e2('0x15'));_0x21555c['write'](_0x1d5b70);_0x21555c[_0x01e2('0x17')]();_0x21555c['on'](_0x01e2('0x19'),function(){return _0x1b2728(_0x48822d);});}catch(_0xaf3da1){fs[_0x01e2('0x1a')](_0x48822d);return _0x1cc134(_0xaf3da1);}});});};exports[_0x01e2('0x1d')]=function(_0x1f1243,_0x4d7cb6,_0x2e1ba0){var _0x1946a9=_0x2e1ba0||stringOptions[_0x01e2('0x8')];var _0x2fc507=_0x4d7cb6||stringOptions[_0x01e2('0x1e')];var _0x9b91bc=crypto[_0x01e2('0x12')](_0x1946a9,_0x2fc507);var _0x1c774a=_0x9b91bc[_0x01e2('0x14')](_0x1f1243,'utf8',_0x01e2('0x1f'));_0x1c774a+=_0x9b91bc[_0x01e2('0x18')](_0x01e2('0x1f'));return _0x1c774a;};exports[_0x01e2('0x20')]=function(_0x55c3ee,_0x5a4bc7,_0x282441){var _0x5f396a=_0x282441||stringOptions[_0x01e2('0x8')];var _0x1a5aef=_0x5a4bc7||stringOptions[_0x01e2('0x1e')];var _0x161666=crypto[_0x01e2('0x1c')](_0x5f396a,_0x1a5aef);var _0x610245=_0x161666[_0x01e2('0x14')](_0x55c3ee,_0x01e2('0x1f'),'utf8');_0x610245+=_0x161666[_0x01e2('0x18')](_0x01e2('0x21'));return _0x610245;}; \ No newline at end of file +var _0x6811=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','end','final','binary','unlink','decryptFile','close','encryptString','utf8','base64','decryptString','secret','createDecipher','crypto','bluebird','lodash','../../config/logger','app','secrets','session','encrypt','algorithm','join'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x6811,0x131));var _0x1681=function(_0x5e6e2a,_0x54984e){_0x5e6e2a=_0x5e6e2a-0x0;var _0x9ca794=_0x6811[_0x5e6e2a];return _0x9ca794;};'use strict';var crypto=require(_0x1681('0x0'));var fs=require('fs');var BPromise=require(_0x1681('0x1'));var _=require(_0x1681('0x2'));var config=require('../../config/environment');var logger=require(_0x1681('0x3'))(_0x1681('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1681('0x5')][_0x1681('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x1681('0x7')]&&config[_0x1681('0x7')][_0x1681('0x8')]){var isSupported=isAlgorithmSupported(config[_0x1681('0x7')][_0x1681('0x8')]);if(isSupported){fileOptions[_0x1681('0x8')]=config[_0x1681('0x7')][_0x1681('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1681('0x9')](',\x20');logger[_0x1681('0xa')](config[_0x1681('0x7')][_0x1681('0x8')],_0x1681('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x5903e7){return AES_SUPPORTED_RX[_0x1681('0xc')](_0x5903e7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x1681('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x510f56){return getSupportedCiphers()[_0x1681('0xe')](_0x510f56)>-0x1;}function combineOptions(_0x348d99){var _0x14bf95={};for(var _0x21151e in fileOptions){if(fileOptions[_0x1681('0xf')](_0x21151e)){_0x14bf95[_0x21151e]=fileOptions[_0x21151e];}}if(_0x348d99){for(var _0x5f3e12 in _0x348d99){if(_0x348d99[_0x1681('0xf')](_0x5f3e12)){_0x14bf95[_0x5f3e12]=_0x348d99[_0x5f3e12];}}}return _0x14bf95;}exports[_0x1681('0x10')]=function(_0x3bf54c,_0x20caf0,_0x49558d,_0x4196a5){return new BPromise(function(_0x3c992e,_0x16108c){_0x4196a5=combineOptions(_0x4196a5);var _0x137100=new Buffer(_0x49558d);var _0x1180b3=fs[_0x1681('0x11')](_0x3bf54c);var _0x6fb3a0=fs[_0x1681('0x12')](_0x20caf0);var _0x4424de=crypto[_0x1681('0x13')](_0x4196a5['algorithm'],_0x137100);_0x1180b3['on'](_0x1681('0x14'),function(_0x22f892){var _0x1e2d68=new Buffer(_0x4424de[_0x1681('0x15')](_0x22f892),'binary');_0x6fb3a0[_0x1681('0x16')](_0x1e2d68);});_0x1180b3['on'](_0x1681('0x17'),function(){try{var _0x5f4336=new Buffer(_0x4424de[_0x1681('0x18')](_0x1681('0x19')),_0x1681('0x19'));_0x6fb3a0[_0x1681('0x16')](_0x5f4336);_0x6fb3a0[_0x1681('0x17')]();_0x6fb3a0['on']('close',function(){return _0x3c992e(_0x20caf0);});}catch(_0x1f22bd){fs[_0x1681('0x1a')](_0x20caf0);return _0x16108c(_0x1f22bd);}});});};exports[_0x1681('0x1b')]=function(_0x640b20,_0x5a8e71,_0x57bba8,_0x2117f1){return new BPromise(function(_0x28fdc5,_0x222535){_0x2117f1=combineOptions(_0x2117f1);var _0x4a1e09=new Buffer(_0x57bba8);var _0x42db64=fs[_0x1681('0x11')](_0x640b20);var _0x6a968f=fs[_0x1681('0x12')](_0x5a8e71);var _0x542564=crypto['createDecipher'](_0x2117f1[_0x1681('0x8')],_0x4a1e09);_0x42db64['on'](_0x1681('0x14'),function(_0x598d4e){var _0x57cacc=new Buffer(_0x542564[_0x1681('0x15')](_0x598d4e),_0x1681('0x19'));_0x6a968f['write'](_0x57cacc);});_0x42db64['on'](_0x1681('0x17'),function(){try{var _0x375e2d=new Buffer(_0x542564[_0x1681('0x18')](_0x1681('0x19')),_0x1681('0x19'));_0x6a968f[_0x1681('0x16')](_0x375e2d);_0x6a968f[_0x1681('0x17')]();_0x6a968f['on'](_0x1681('0x1c'),function(){return _0x28fdc5(_0x5a8e71);});}catch(_0x5c1646){fs[_0x1681('0x1a')](_0x5a8e71);return _0x222535(_0x5c1646);}});});};exports[_0x1681('0x1d')]=function(_0x36e2d7,_0x550d5d,_0x10a178){var _0x5ac189=_0x10a178||stringOptions[_0x1681('0x8')];var _0x16af3e=_0x550d5d||stringOptions['secret'];var _0x274053=crypto['createCipher'](_0x5ac189,_0x16af3e);var _0x3fe3d1=_0x274053[_0x1681('0x15')](_0x36e2d7,_0x1681('0x1e'),'base64');_0x3fe3d1+=_0x274053[_0x1681('0x18')](_0x1681('0x1f'));return _0x3fe3d1;};exports[_0x1681('0x20')]=function(_0x8eb8c,_0x49a42b,_0xea2166){var _0x1dfbcc=_0xea2166||stringOptions[_0x1681('0x8')];var _0x13ebc2=_0x49a42b||stringOptions[_0x1681('0x21')];var _0x37e415=crypto[_0x1681('0x22')](_0x1dfbcc,_0x13ebc2);var _0x10647c=_0x37e415[_0x1681('0x15')](_0x8eb8c,_0x1681('0x1f'),_0x1681('0x1e'));_0x10647c+=_0x37e415[_0x1681('0x18')](_0x1681('0x1e'));return _0x10647c;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b23cc92..80c0e2a 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 _0x6d8f=['find','splitSizeCsv','then','sequelize','query','Empty','split','length','range','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','push','dirname','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6d8f,0xe1));var _0xf6d8=function(_0x4c464f,_0x118b7d){_0x4c464f=_0x4c464f-0x0;var _0xb91fb3=_0x6d8f[_0x4c464f];return _0xb91fb3;};'use strict';var util=require(_0xf6d8('0x0'));var path=require('path');var _=require(_0xf6d8('0x1'));var csv=require(_0xf6d8('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xf6d8('0x3'));var rimraf=require(_0xf6d8('0x4'));var db=require(_0xf6d8('0x5'))['db'];var dbH=require(_0xf6d8('0x5'))[_0xf6d8('0x6')];var logger=require(_0xf6d8('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf6d8('0x8')][0x3];var PATH=process[_0xf6d8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x144370,_0x3ca0cd){var _0x48702a={'status':_0x144370};var _0x513da8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3ca0cd){_0x48702a['savename']=_0x3ca0cd;}return db[_0xf6d8('0x9')][_0xf6d8('0xa')](_0x48702a,_0x513da8);}function main(){var _0x5e0a63=0x1388;var _0x3be814;logger['info'](util[_0xf6d8('0xb')](_0xf6d8('0xc'),EXTRACTED_REPORT_ID,_0xf6d8('0xd')));return db[_0xf6d8('0xe')][_0xf6d8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf6d8('0x10')]})[_0xf6d8('0x11')](function(_0x2cf66a){if(_0x2cf66a){_0x3be814=_0x2cf66a;_0x5e0a63=_0x3be814[_0xf6d8('0x10')]||0x1388;}})[_0xf6d8('0x11')](function(){return dbH[_0xf6d8('0x12')][_0xf6d8('0x13')](util[_0xf6d8('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf6d8('0x12')]['QueryTypes']['SELECT']});})[_0xf6d8('0x11')](function(_0x5979ad){if(!_0x5979ad[0x0]['num']){return analyticExtractedReport(_0xf6d8('0x14'));}var _0x355a11=[];var _0x5a4e6e=0x0;if(_0x3be814[_0xf6d8('0x15')]){if(_0x5979ad&&_0x5979ad[_0xf6d8('0x16')]){var _0x9dc1d2=_[_0xf6d8('0x17')](_0x5979ad[0x0][_0xf6d8('0x18')]/_0x5e0a63);var _0x2f122e=Number[_0xf6d8('0x19')](_0x5979ad[0x0]['num']/_0x5e0a63)?_0x5979ad[0x0][_0xf6d8('0x18')]%_0x5e0a63:0x0;_0x9dc1d2[_0xf6d8('0x1a')](function(_0x5d71be){if(_0x5d71be>0x0){_0x5a4e6e+=_0x5e0a63;}_0x355a11['push'](dbH[_0xf6d8('0x12')]['query'](util[_0xf6d8('0xb')](_0xf6d8('0x1b'),QUERY,_0x5e0a63,_0x5a4e6e),{'type':dbH[_0xf6d8('0x12')][_0xf6d8('0x1c')][_0xf6d8('0x1d')]}));});if(_0x2f122e>0x0){_0x5a4e6e+=_0x5e0a63;_0x355a11[_0xf6d8('0x1e')](dbH['sequelize']['query'](util[_0xf6d8('0xb')](_0xf6d8('0x1b'),QUERY,_0x2f122e,_0x5a4e6e),{'type':dbH[_0xf6d8('0x12')][_0xf6d8('0x1c')][_0xf6d8('0x1d')]}));}}}else{_0x355a11[_0xf6d8('0x1e')](dbH['sequelize'][_0xf6d8('0x13')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xf6d8('0x1d')]}));}var _0x2db47a=path[_0xf6d8('0x1f')](PATH);var _0x4116e5=path['basename'](PATH,_0xf6d8('0x20'));var _0x25aafa=_0x3be814[_0xf6d8('0x15')]&&_0x355a11[_0xf6d8('0x16')]>0x1;var _0x3bd2d7=[];if(!fs[_0xf6d8('0x21')](path[_0xf6d8('0x22')](_0x2db47a,_0x4116e5))&&_0x25aafa){fs[_0xf6d8('0x23')](path[_0xf6d8('0x22')](_0x2db47a,_0x4116e5));}return BPromise[_0xf6d8('0x24')](_0x355a11,function(_0x78bbe2){_0x3bd2d7[_0xf6d8('0x1e')](_0x78bbe2);})[_0xf6d8('0x11')](function(){for(var _0x59b734=0x0;_0x59b734<_0x3bd2d7[_0xf6d8('0x16')];_0x59b734+=0x1){var _0x2618aa;var _0x389bdd=_0x3bd2d7[_0x59b734];if(_0x25aafa){_0x2618aa=path['join'](_0x2db47a,_0x4116e5,util[_0xf6d8('0xb')]('%s%d.%s',_0x4116e5,_0x59b734,_0xf6d8('0x25')));}else{_0x2618aa=path[_0xf6d8('0x22')](_0x2db47a,util['format']('%s.%s',_0x4116e5,'csv'));}fs[_0xf6d8('0x26')](_0x2618aa,csv(_0x389bdd));}})[_0xf6d8('0x11')](function(){if(_0x25aafa){return new Promise(function(_0x1316b8){zipdir(path[_0xf6d8('0x22')](_0x2db47a,_0x4116e5),{'saveTo':path['join'](_0x2db47a,util[_0xf6d8('0xb')](_0xf6d8('0x27'),_0x4116e5,_0xf6d8('0x28')))},function(_0x1434ea,_0x31861f){rimraf(path[_0xf6d8('0x22')](_0x2db47a,_0x4116e5),function(){});_0x1316b8(_0xf6d8('0x29'));});});}})[_0xf6d8('0x11')](function(){logger[_0xf6d8('0x2a')](util[_0xf6d8('0xb')](_0xf6d8('0x2b'),EXTRACTED_REPORT_ID,_0xf6d8('0xd')));return analyticExtractedReport('Completed',_0x25aafa?util[_0xf6d8('0xb')]('%s.%s',_0x4116e5,_0x25aafa?_0xf6d8('0x28'):_0xf6d8('0x25')):null);});})[_0xf6d8('0x2c')](function(_0x10a26c){logger[_0xf6d8('0x2a')](util[_0xf6d8('0xb')](_0xf6d8('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0xf6d8('0x2e')](_0x10a26c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf6d8('0x2f'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe365=['basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push'];(function(_0x30151b,_0x7e4f5){var _0x4c8a4a=function(_0x54c310){while(--_0x54c310){_0x30151b['push'](_0x30151b['shift']());}};_0x4c8a4a(++_0x7e4f5);}(_0xe365,0x1d4));var _0x5e36=function(_0x373925,_0x57badd){_0x373925=_0x373925-0x0;var _0x305525=_0xe365[_0x373925];return _0x305525;};'use strict';var util=require(_0x5e36('0x0'));var path=require(_0x5e36('0x1'));var _=require(_0x5e36('0x2'));var csv=require(_0x5e36('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x5e36('0x4'));var rimraf=require(_0x5e36('0x5'));var db=require(_0x5e36('0x6'))['db'];var dbH=require(_0x5e36('0x6'))[_0x5e36('0x7')];var logger=require(_0x5e36('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5e36('0x9')][0x2]);var QUERY=process[_0x5e36('0x9')][0x3];var PATH=process[_0x5e36('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x13240a,_0x9c2aff){var _0x154e6d={'status':_0x13240a};var _0x427777={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x9c2aff){_0x154e6d[_0x5e36('0xa')]=_0x9c2aff;}return db['AnalyticExtractedReport']['update'](_0x154e6d,_0x427777);}function main(){var _0x5dae57=0x1388;var _0x1b3099;logger[_0x5e36('0xb')](util[_0x5e36('0xc')](_0x5e36('0xd'),EXTRACTED_REPORT_ID,_0x5e36('0xe')));return db[_0x5e36('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5e36('0x10'),_0x5e36('0x11')]})[_0x5e36('0x12')](function(_0x58ef77){if(_0x58ef77){_0x1b3099=_0x58ef77;_0x5dae57=_0x1b3099['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x5e36('0x13')][_0x5e36('0x14')](util[_0x5e36('0xc')](_0x5e36('0x15'),QUERY),{'type':dbH[_0x5e36('0x13')][_0x5e36('0x16')][_0x5e36('0x17')]});})[_0x5e36('0x12')](function(_0x137c8d){if(!_0x137c8d[0x0][_0x5e36('0x18')]){return analyticExtractedReport(_0x5e36('0x19'));}var _0x11f450=[];var _0x5a4175=0x0;if(_0x1b3099['split']){if(_0x137c8d&&_0x137c8d[_0x5e36('0x1a')]){var _0x1d4771=_[_0x5e36('0x1b')](_0x137c8d[0x0][_0x5e36('0x18')]/_0x5dae57);var _0x5b7c7b=Number[_0x5e36('0x1c')](_0x137c8d[0x0][_0x5e36('0x18')]/_0x5dae57)?_0x137c8d[0x0][_0x5e36('0x18')]%_0x5dae57:0x0;_0x1d4771[_0x5e36('0x1d')](function(_0x24cafa){if(_0x24cafa>0x0){_0x5a4175+=_0x5dae57;}_0x11f450['push'](dbH[_0x5e36('0x13')]['query'](util[_0x5e36('0xc')](_0x5e36('0x1e'),QUERY,_0x5dae57,_0x5a4175),{'type':dbH[_0x5e36('0x13')][_0x5e36('0x16')][_0x5e36('0x17')]}));});if(_0x5b7c7b>0x0){_0x5a4175+=_0x5dae57;_0x11f450[_0x5e36('0x1f')](dbH[_0x5e36('0x13')][_0x5e36('0x14')](util['format'](_0x5e36('0x1e'),QUERY,_0x5b7c7b,_0x5a4175),{'type':dbH[_0x5e36('0x13')][_0x5e36('0x16')][_0x5e36('0x17')]}));}}}else{_0x11f450[_0x5e36('0x1f')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x5e36('0x13')][_0x5e36('0x16')][_0x5e36('0x17')]}));}var _0x18c665=path['dirname'](PATH);var _0x238cd1=path[_0x5e36('0x20')](PATH,_0x5e36('0x21'));var _0x4da3cf=_0x1b3099[_0x5e36('0x10')]&&_0x11f450[_0x5e36('0x1a')]>0x1;var _0x4cf5c6=[];if(!fs[_0x5e36('0x22')](path[_0x5e36('0x23')](_0x18c665,_0x238cd1))&&_0x4da3cf){fs[_0x5e36('0x24')](path[_0x5e36('0x23')](_0x18c665,_0x238cd1));}return BPromise[_0x5e36('0x25')](_0x11f450,function(_0x5bde00){_0x4cf5c6[_0x5e36('0x1f')](_0x5bde00);})[_0x5e36('0x12')](function(){for(var _0x49ed0e=0x0;_0x49ed0e<_0x4cf5c6['length'];_0x49ed0e+=0x1){var _0x33fc60;var _0xde6809=_0x4cf5c6[_0x49ed0e];if(_0x4da3cf){_0x33fc60=path[_0x5e36('0x23')](_0x18c665,_0x238cd1,util[_0x5e36('0xc')](_0x5e36('0x26'),_0x238cd1,_0x49ed0e,_0x5e36('0x27')));}else{_0x33fc60=path[_0x5e36('0x23')](_0x18c665,util[_0x5e36('0xc')](_0x5e36('0x28'),_0x238cd1,_0x5e36('0x27')));}fs[_0x5e36('0x29')](_0x33fc60,csv(_0xde6809));}})['then'](function(){if(_0x4da3cf){return new Promise(function(_0x1b8422){zipdir(path[_0x5e36('0x23')](_0x18c665,_0x238cd1),{'saveTo':path[_0x5e36('0x23')](_0x18c665,util[_0x5e36('0xc')](_0x5e36('0x28'),_0x238cd1,_0x5e36('0x2a')))},function(_0x386d28,_0x39a1d8){rimraf(path[_0x5e36('0x23')](_0x18c665,_0x238cd1),function(){});_0x1b8422('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x5e36('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x5e36('0x2b'),_0x4da3cf?util[_0x5e36('0xc')](_0x5e36('0x28'),_0x238cd1,_0x4da3cf?_0x5e36('0x2a'):_0x5e36('0x27')):null);});})[_0x5e36('0x2c')](function(_0x52f2b3){logger[_0x5e36('0xb')](util[_0x5e36('0xc')](_0x5e36('0x2d'),EXTRACTED_REPORT_ID,_0x5e36('0xe')),util[_0x5e36('0x2e')](_0x52f2b3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5e36('0x2f'));})[_0x5e36('0x30')](function(){process[_0x5e36('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 26b90ea..3b394fe 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 _0x18af=['length','header','pageBreak','margin','landscape','\x20/\x20','Arial','black','right','num','find','split','splitSizePdf','then','isInteger','sequelize','query','QueryTypes','SELECT','dirname','existsSync','join','mkdirSync','each','flatten','%s%d.%s','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','\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','path','html-to-pdfmake','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','fill','auto','push','concat','chunk','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format'];(function(_0x4e6463,_0x73900c){var _0x3456b5=function(_0x2309a1){while(--_0x2309a1){_0x4e6463['push'](_0x4e6463['shift']());}};_0x3456b5(++_0x73900c);}(_0x18af,0x8b));var _0xf18a=function(_0x456d97,_0x31f1e9){_0x456d97=_0x456d97-0x0;var _0x66c499=_0x18af[_0x456d97];return _0x66c499;};'use strict';var _=require(_0xf18a('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xf18a('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xf18a('0x2'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0xf18a('0x3'))[_0xf18a('0x4')];var window=new JSDOM('')[_0xf18a('0x5')];var BPromise=require(_0xf18a('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf18a('0x7'))[_0xf18a('0x8')];var logger=require(_0xf18a('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf18a('0xa')][0x2]);var QUERY=process[_0xf18a('0xa')][0x3];var PATH=process[_0xf18a('0xa')][0x4];var NAME=process[_0xf18a('0xa')][0x5];var FORMAT=_0xf18a('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x270333,_0xcafadb){var _0x20247d={'status':_0x270333};var _0x33fb6a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xcafadb){_0x20247d[_0xf18a('0xc')]=_0xcafadb;}return db[_0xf18a('0xd')][_0xf18a('0xe')](_0x20247d,_0x33fb6a);}function getHeaders(_0x36a9c6){return _['map'](_0x36a9c6,function(_0xe1f537){return{'text':_0xe1f537,'style':_0xf18a('0xf')};});}function getRows(_0x252333,_0x12c907){return _[_0xf18a('0x10')](_0x12c907,function(_0x4e9ee9){return _(_0x4e9ee9)[_0xf18a('0x11')](_0x252333)[_0xf18a('0x10')](function(_0x4bfc63){return _0x4bfc63?_[_0xf18a('0x12')](_0x4bfc63):'';})['value']();});}function createTable(_0x27428a,_0x30d3d5){var _0x52dc2c={'widths':_[_0xf18a('0x13')](Array(_0x27428a['length']),0x91),'heights':function(_0x39fe13){return _0x39fe13===0x0?_0xf18a('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x52fcfa=getHeaders(_0x27428a);_0x52dc2c['body'][_0xf18a('0x15')](_0x52fcfa);var _0x23c8f1=getRows(_0x27428a,_0x30d3d5);_0x52dc2c['body']=_0x52dc2c['body'][_0xf18a('0x16')](_0x23c8f1);return _0x52dc2c;}function createTables(_0x1aff7c){var _0x1d21e7=[];var _0x5c9173=_[_0xf18a('0x17')](Object['keys'](_0x1aff7c[0x0]),0x5);_0x5c9173[_0xf18a('0x18')](function(_0x31cb63){_0x1d21e7['push'](createTable(_0x31cb63,_0x1aff7c));});return _0x1d21e7;}function getPDFDocDefinition(_0x1aa0b2){var _0x340d94=util['format'](_0xf18a('0x19'),NAME,EXTRACTED_REPORT[_0xf18a('0x1a')],moment(EXTRACTED_REPORT[_0xf18a('0x1b')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xf18a('0x1c')](FORMAT));var _0x4438ed=[];for(var _0xabe9a2=0x0;_0xabe9a2<_0x1aa0b2[_0xf18a('0x1d')];_0xabe9a2++){var _0x1ad933=[];if(_0xabe9a2===0x0){_0x1ad933[_0xf18a('0x15')]({'text':_0x340d94,'style':_0xf18a('0x1e')});}var _0x304bd4={'table':_0x1aa0b2[_0xabe9a2]};if(_0xabe9a2>0x0){_0x304bd4[_0xf18a('0x1f')]='before';_0x304bd4[_0xf18a('0x20')]=[0x0,0x46,0x0,0x0];}_0x1ad933[_0xf18a('0x15')](_0x304bd4);_0x4438ed[_0xf18a('0x15')](_0x1ad933);}return{'pageSize':'A4','pageOrientation':_0xf18a('0x21'),'content':_0x4438ed,'footer':function(_0x5dd917,_0x44369e){return{'text':_0x5dd917[_0xf18a('0x12')]()+_0xf18a('0x22')+_0x44369e,'style':'footer'};},'defaultStyle':{'font':_0xf18a('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf18a('0x24')},'footer':{'alignment':_0xf18a('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x39d746){var _0x5d9907=0x1388;var _0x3d0eeb;if(!_0x39d746[0x0][_0xf18a('0x26')]){return analyticExtractedReport('Empty');}return db['Setting'][_0xf18a('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf18a('0x28'),_0xf18a('0x29')]})[_0xf18a('0x2a')](function(_0x528e37){if(_0x528e37){_0x3d0eeb=_0x528e37;_0x5d9907=_0x3d0eeb[_0xf18a('0x29')]||0x3e8;}})[_0xf18a('0x2a')](function(){var _0x3a70a2=[];var _0x28d654=0x0;if(_0x3d0eeb[_0xf18a('0x28')]){if(_0x39d746&&_0x39d746[_0xf18a('0x1d')]){var _0x5a6817=_['range'](_0x39d746[0x0][_0xf18a('0x26')]/_0x5d9907);var _0x3ea07a=Number[_0xf18a('0x2b')](_0x39d746[0x0]['num']/_0x5d9907)?_0x39d746[0x0]['num']%_0x5d9907:0x0;_0x5a6817[_0xf18a('0x18')](function(_0x33adad){if(_0x33adad>0x0){_0x28d654+=_0x5d9907;}_0x3a70a2[_0xf18a('0x15')](dbH[_0xf18a('0x2c')][_0xf18a('0x2d')](util[_0xf18a('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d9907,_0x28d654),{'type':dbH[_0xf18a('0x2c')][_0xf18a('0x2e')]['SELECT']}));});if(_0x3ea07a>0x0){_0x28d654+=_0x5d9907;_0x3a70a2[_0xf18a('0x15')](dbH['sequelize'][_0xf18a('0x2d')](util[_0xf18a('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ea07a,_0x28d654),{'type':dbH['sequelize'][_0xf18a('0x2e')][_0xf18a('0x2f')]}));}}}else{_0x3a70a2[_0xf18a('0x15')](dbH[_0xf18a('0x2c')]['query'](QUERY,{'type':dbH[_0xf18a('0x2c')][_0xf18a('0x2e')]['SELECT']}));}var _0x3e8b31=path[_0xf18a('0x30')](PATH);var _0x10a115=path['basename'](PATH,'.pdf');var _0x153283=_0x3d0eeb[_0xf18a('0x28')]&&_0x3a70a2[_0xf18a('0x1d')]>0x1;var _0x337b45=[];if(!fs[_0xf18a('0x31')](path[_0xf18a('0x32')](_0x3e8b31,_0x10a115))&&_0x153283){fs[_0xf18a('0x33')](path[_0xf18a('0x32')](_0x3e8b31,_0x10a115));}return BPromise[_0xf18a('0x34')](_0x3a70a2,function(_0x46d769){_0x337b45['push'](_0x46d769);})[_0xf18a('0x2a')](function(){var _0x374600=[];for(var _0x5df534=0x0;_0x5df534<_0x337b45[_0xf18a('0x1d')];_0x5df534+=0x1){var _0x519025=_0x337b45[_0x5df534];var _0x377bc9=createTables(_[_0xf18a('0x35')](_0x519025));var _0x1ab00c;var _0x55a832=getPDFDocDefinition(_0x377bc9);var _0x366399=getPDFPrinter();var _0x3e8906=_0x366399['createPdfKitDocument'](_0x55a832);if(_0x153283){_0x1ab00c=path[_0xf18a('0x32')](_0x3e8b31,_0x10a115,util[_0xf18a('0x1c')](_0xf18a('0x36'),_0x10a115,_0x5df534,'pdf'));}else{_0x1ab00c=path['join'](_0x3e8b31,util[_0xf18a('0x1c')](_0xf18a('0x37'),_0x10a115,_0xf18a('0x38')));}_0x374600['push'](writePDFDocument(_0x3e8906,_0x1ab00c));}return Promise[_0xf18a('0x39')](_0x374600);})[_0xf18a('0x2a')](function(){if(_0x153283){return new Promise(function(_0x5f4d7a){zipdir(path[_0xf18a('0x32')](_0x3e8b31,_0x10a115),{'saveTo':path['join'](_0x3e8b31,util[_0xf18a('0x1c')](_0xf18a('0x37'),_0x10a115,_0xf18a('0x3a')))},function(){rimraf(path[_0xf18a('0x32')](_0x3e8b31,_0x10a115),function(){});_0x5f4d7a(_0xf18a('0x3b'));});});}})['then'](function(){if(!_0x153283)return;rimraf(path[_0xf18a('0x32')](_0x3e8b31,_0x10a115),function(){});})[_0xf18a('0x2a')](function(){logger[_0xf18a('0x3c')](util[_0xf18a('0x1c')](_0xf18a('0x3d'),EXTRACTED_REPORT_ID,_0xf18a('0x3e')));return analyticExtractedReport(_0xf18a('0x3f'),_0x153283?util['format'](_0xf18a('0x37'),_0x10a115,_0x153283?_0xf18a('0x3a'):_0xf18a('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf18a('0x3c')](util[_0xf18a('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf18a('0x3e')));return db[_0xf18a('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf18a('0x2a')](function(_0x331d00){EXTRACTED_REPORT=_0x331d00;return dbH[_0xf18a('0x2c')][_0xf18a('0x2d')](util[_0xf18a('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xf18a('0x2a')](extractReport)[_0xf18a('0x40')](function(_0x2fe3e4){logger[_0xf18a('0x3c')](util[_0xf18a('0x1c')](_0xf18a('0x41'),EXTRACTED_REPORT_ID,_0xf18a('0x3e')),util['inspect'](_0x2fe3e4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf18a('0x42'));})[_0xf18a('0x43')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x34d3da=new PdfPrinter({'Arial':{'normal':__dirname+_0xf18a('0x44'),'bold':__dirname+_0xf18a('0x45'),'italics':__dirname+_0xf18a('0x46'),'bolditalics':__dirname+_0xf18a('0x47')}});return _0x34d3da;}function getPDFDocDefinitionFromHTML(_0x3688e0,_0x29032e){var _0x4b4082=util[_0xf18a('0x1c')](_0xf18a('0x48'),_0x29032e['channel'],_0x29032e[_0xf18a('0x49')]);var _0x42fdd3=moment()[_0xf18a('0x1c')](_0xf18a('0x4a'))['toString']();var _0x383349=htmlToPdfmake(_0x3688e0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x383349],'defaultStyle':{'font':_0xf18a('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf18a('0x4b'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf18a('0x4b'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf18a('0x4b')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xf18a('0x1e')}];},'footer':function(_0x20d65d,_0x12d798){return[{'text':util[_0xf18a('0x1c')](_0xf18a('0x4c'),_0x4b4082,_0x20d65d,_0x12d798,_0x42fdd3),'style':_0xf18a('0x4d')}];}};}function writePDFDocument(_0x43231f,_0x1a08b0){return new Promise(function(_0x84ff60,_0xd3d2c2){var _0x34cee3=_0x43231f[_0xf18a('0x4e')](fs[_0xf18a('0x4f')](_0x1a08b0));_0x34cee3['on']('finish',function(){_0x84ff60(_0xf18a('0x50'));});_0x34cee3['on'](_0xf18a('0x51'),function(_0x239dd6){_0xd3d2c2(_0x239dd6);});_0x43231f[_0xf18a('0x52')]();});}exports[_0xf18a('0x53')]=function(_0x119339,_0x3ed489){var _0xb4284c=getPDFPrinter();var _0x2392c5=getPDFDocDefinitionFromHTML(_0x119339,_0x3ed489);var _0x42d779=_0xb4284c['createPdfKitDocument'](_0x2392c5);return writePDFDocument(_0x42d779,_0x3ed489[_0xf18a('0x1')])[_0xf18a('0x40')](function(_0x182ff3){throw _0x182ff3;});}; \ No newline at end of file +var _0x5d8b=['createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','info','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','error','end','catch','path','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','body','concat','chunk','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','before','landscape','\x20/\x20','right','num','Setting','find','splitSizePdf','then','split','range','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','query','SELECT','dirname','existsSync','join','each','flatten'];(function(_0x4e4413,_0x1116a6){var _0x4c449a=function(_0x2ff65c){while(--_0x2ff65c){_0x4e4413['push'](_0x4e4413['shift']());}};_0x4c449a(++_0x1116a6);}(_0x5d8b,0x77));var _0xb5d8=function(_0x158436,_0x59d6fc){_0x158436=_0x158436-0x0;var _0x343a38=_0x5d8b[_0x158436];return _0x343a38;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0xb5d8('0x0'));var moment=require('moment');var htmlToPdfmake=require(_0xb5d8('0x1'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xb5d8('0x2'));var rimraf=require(_0xb5d8('0x3'));var JSDOM=require(_0xb5d8('0x4'))[_0xb5d8('0x5')];var window=new JSDOM('')['window'];var BPromise=require(_0xb5d8('0x6'));var db=require(_0xb5d8('0x7'))['db'];var dbH=require('../../mysqldb')[_0xb5d8('0x8')];var logger=require(_0xb5d8('0x9'))(_0xb5d8('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xb5d8('0xb')][0x2]);var QUERY=process[_0xb5d8('0xb')][0x3];var PATH=process[_0xb5d8('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xb5d8('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x15693d,_0x2608fd){var _0x32ae25={'status':_0x15693d};var _0x29f0e5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2608fd){_0x32ae25[_0xb5d8('0xd')]=_0x2608fd;}return db[_0xb5d8('0xe')][_0xb5d8('0xf')](_0x32ae25,_0x29f0e5);}function getHeaders(_0x57f879){return _[_0xb5d8('0x10')](_0x57f879,function(_0x4d4375){return{'text':_0x4d4375,'style':_0xb5d8('0x11')};});}function getRows(_0x2e0a7f,_0x84a01b){return _[_0xb5d8('0x10')](_0x84a01b,function(_0x5577f6){return _(_0x5577f6)[_0xb5d8('0x12')](_0x2e0a7f)[_0xb5d8('0x10')](function(_0x3d7b30){return _0x3d7b30?_[_0xb5d8('0x13')](_0x3d7b30):'';})[_0xb5d8('0x14')]();});}function createTable(_0x258522,_0x26d921){var _0x2bc710={'widths':_['fill'](Array(_0x258522[_0xb5d8('0x15')]),0x91),'heights':function(_0x4a75dd){return _0x4a75dd===0x0?_0xb5d8('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x21473a=getHeaders(_0x258522);_0x2bc710[_0xb5d8('0x17')]['push'](_0x21473a);var _0x52b568=getRows(_0x258522,_0x26d921);_0x2bc710['body']=_0x2bc710['body'][_0xb5d8('0x18')](_0x52b568);return _0x2bc710;}function createTables(_0x590b39){var _0x396153=[];var _0x2668cf=_[_0xb5d8('0x19')](Object[_0xb5d8('0x1a')](_0x590b39[0x0]),0x5);_0x2668cf[_0xb5d8('0x1b')](function(_0x198ddc){_0x396153[_0xb5d8('0x1c')](createTable(_0x198ddc,_0x590b39));});return _0x396153;}function getPDFDocDefinition(_0x851e30){var _0x14f8de=util[_0xb5d8('0x1d')](_0xb5d8('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xb5d8('0x1f')])[_0xb5d8('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])['format'](FORMAT));var _0x513a13=[];for(var _0x34823b=0x0;_0x34823b<_0x851e30[_0xb5d8('0x15')];_0x34823b++){var _0x23c41e=[];if(_0x34823b===0x0){_0x23c41e[_0xb5d8('0x1c')]({'text':_0x14f8de,'style':'header'});}var _0x43f3f0={'table':_0x851e30[_0x34823b]};if(_0x34823b>0x0){_0x43f3f0['pageBreak']=_0xb5d8('0x20');_0x43f3f0['margin']=[0x0,0x46,0x0,0x0];}_0x23c41e['push'](_0x43f3f0);_0x513a13[_0xb5d8('0x1c')](_0x23c41e);}return{'pageSize':'A4','pageOrientation':_0xb5d8('0x21'),'content':_0x513a13,'footer':function(_0x32315c,_0x49b782){return{'text':_0x32315c[_0xb5d8('0x13')]()+_0xb5d8('0x22')+_0x49b782,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xb5d8('0x23'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x268931){var _0x5c1908=0x1388;var _0x3a09e6;if(!_0x268931[0x0][_0xb5d8('0x24')]){return analyticExtractedReport('Empty');}return db[_0xb5d8('0x25')][_0xb5d8('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb5d8('0x27')]})['then'](function(_0x168dba){if(_0x168dba){_0x3a09e6=_0x168dba;_0x5c1908=_0x3a09e6[_0xb5d8('0x27')]||0x3e8;}})[_0xb5d8('0x28')](function(){var _0x47a6c7=[];var _0x189050=0x0;if(_0x3a09e6[_0xb5d8('0x29')]){if(_0x268931&&_0x268931[_0xb5d8('0x15')]){var _0x5ab36b=_[_0xb5d8('0x2a')](_0x268931[0x0][_0xb5d8('0x24')]/_0x5c1908);var _0x119590=Number['isInteger'](_0x268931[0x0]['num']/_0x5c1908)?_0x268931[0x0][_0xb5d8('0x24')]%_0x5c1908:0x0;_0x5ab36b[_0xb5d8('0x1b')](function(_0xbbbcc9){if(_0xbbbcc9>0x0){_0x189050+=_0x5c1908;}_0x47a6c7[_0xb5d8('0x1c')](dbH[_0xb5d8('0x2b')]['query'](util[_0xb5d8('0x1d')](_0xb5d8('0x2c'),QUERY,_0x5c1908,_0x189050),{'type':dbH[_0xb5d8('0x2b')][_0xb5d8('0x2d')]['SELECT']}));});if(_0x119590>0x0){_0x189050+=_0x5c1908;_0x47a6c7[_0xb5d8('0x1c')](dbH[_0xb5d8('0x2b')]['query'](util[_0xb5d8('0x1d')](_0xb5d8('0x2c'),QUERY,_0x119590,_0x189050),{'type':dbH['sequelize'][_0xb5d8('0x2d')]['SELECT']}));}}}else{_0x47a6c7[_0xb5d8('0x1c')](dbH[_0xb5d8('0x2b')][_0xb5d8('0x2e')](QUERY,{'type':dbH[_0xb5d8('0x2b')][_0xb5d8('0x2d')][_0xb5d8('0x2f')]}));}var _0x506e01=path[_0xb5d8('0x30')](PATH);var _0x5ce33e=path['basename'](PATH,'.pdf');var _0x1c5511=_0x3a09e6[_0xb5d8('0x29')]&&_0x47a6c7['length']>0x1;var _0x2b7f37=[];if(!fs[_0xb5d8('0x31')](path[_0xb5d8('0x32')](_0x506e01,_0x5ce33e))&&_0x1c5511){fs['mkdirSync'](path['join'](_0x506e01,_0x5ce33e));}return BPromise[_0xb5d8('0x33')](_0x47a6c7,function(_0x113a52){_0x2b7f37[_0xb5d8('0x1c')](_0x113a52);})['then'](function(){var _0x259659=[];for(var _0x3bf66a=0x0;_0x3bf66a<_0x2b7f37[_0xb5d8('0x15')];_0x3bf66a+=0x1){var _0xba29b1=_0x2b7f37[_0x3bf66a];var _0x3ec309=createTables(_[_0xb5d8('0x34')](_0xba29b1));var _0x3cb8b7;var _0x29e2b3=getPDFDocDefinition(_0x3ec309);var _0x24536d=getPDFPrinter();var _0x3f9175=_0x24536d[_0xb5d8('0x35')](_0x29e2b3);if(_0x1c5511){_0x3cb8b7=path['join'](_0x506e01,_0x5ce33e,util[_0xb5d8('0x1d')](_0xb5d8('0x36'),_0x5ce33e,_0x3bf66a,_0xb5d8('0x37')));}else{_0x3cb8b7=path[_0xb5d8('0x32')](_0x506e01,util['format'](_0xb5d8('0x38'),_0x5ce33e,_0xb5d8('0x37')));}_0x259659[_0xb5d8('0x1c')](writePDFDocument(_0x3f9175,_0x3cb8b7));}return Promise[_0xb5d8('0x39')](_0x259659);})['then'](function(){if(_0x1c5511){return new Promise(function(_0x50de74){zipdir(path[_0xb5d8('0x32')](_0x506e01,_0x5ce33e),{'saveTo':path[_0xb5d8('0x32')](_0x506e01,util[_0xb5d8('0x1d')]('%s.%s',_0x5ce33e,_0xb5d8('0x3a')))},function(){rimraf(path[_0xb5d8('0x32')](_0x506e01,_0x5ce33e),function(){});_0x50de74(_0xb5d8('0x3b'));});});}})['then'](function(){if(!_0x1c5511)return;rimraf(path[_0xb5d8('0x32')](_0x506e01,_0x5ce33e),function(){});})[_0xb5d8('0x28')](function(){logger['info'](util[_0xb5d8('0x1d')](_0xb5d8('0x3c'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xb5d8('0x3d'),_0x1c5511?util['format'](_0xb5d8('0x38'),_0x5ce33e,_0x1c5511?'zip':_0xb5d8('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xb5d8('0x3e')](util[_0xb5d8('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb5d8('0x3f')));return db['AnalyticExtractedReport'][_0xb5d8('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xb5d8('0x28')](function(_0x3cc1b3){EXTRACTED_REPORT=_0x3cc1b3;return dbH[_0xb5d8('0x2b')]['query'](util['format'](_0xb5d8('0x41'),QUERY),{'type':dbH[_0xb5d8('0x2b')][_0xb5d8('0x2d')][_0xb5d8('0x2f')]});})[_0xb5d8('0x28')](extractReport)['catch'](function(_0x5e2f8e){logger['info'](util[_0xb5d8('0x1d')](_0xb5d8('0x42'),EXTRACTED_REPORT_ID,_0xb5d8('0x3f')),util[_0xb5d8('0x43')](_0x5e2f8e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb5d8('0x44'));})[_0xb5d8('0x45')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x12a3f6=new PdfPrinter({'Arial':{'normal':__dirname+_0xb5d8('0x46'),'bold':__dirname+_0xb5d8('0x47'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xb5d8('0x48')}});return _0x12a3f6;}function getPDFDocDefinitionFromHTML(_0x29b479,_0x3c9b1d){var _0xf1b3db=util['format'](_0xb5d8('0x49'),_0x3c9b1d[_0xb5d8('0x4a')],_0x3c9b1d[_0xb5d8('0x4b')]);var _0x53d82d=moment()[_0xb5d8('0x1d')](_0xb5d8('0x4c'))[_0xb5d8('0x13')]();var _0x1c21b9=htmlToPdfmake(_0x29b479,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c21b9],'defaultStyle':{'font':_0xb5d8('0x4d')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xb5d8('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0xb5d8('0x4f'),'style':_0xb5d8('0x50')}];},'footer':function(_0x4cd792,_0x38d718){return[{'text':util[_0xb5d8('0x1d')](_0xb5d8('0x51'),_0xf1b3db,_0x4cd792,_0x38d718,_0x53d82d),'style':'footer'}];}};}function writePDFDocument(_0x557a6f,_0x466fdc){return new Promise(function(_0x3a8d85,_0x55e528){var _0x3f45ab=_0x557a6f['pipe'](fs['createWriteStream'](_0x466fdc));_0x3f45ab['on']('finish',function(){_0x3a8d85(_0xb5d8('0x52'));});_0x3f45ab['on'](_0xb5d8('0x53'),function(_0x2a15fc){_0x55e528(_0x2a15fc);});_0x557a6f[_0xb5d8('0x54')]();});}exports['createPdfFromHTML']=function(_0x50bfd8,_0x4e0170){var _0x30923c=getPDFPrinter();var _0x52c812=getPDFDocDefinitionFromHTML(_0x50bfd8,_0x4e0170);var _0x3b4474=_0x30923c[_0xb5d8('0x35')](_0x52c812);return writePDFDocument(_0x3b4474,_0x4e0170[_0xb5d8('0x0')])[_0xb5d8('0x55')](function(_0x14e2b0){throw _0x14e2b0;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 817cb71..c4d8707 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 _0x5835=['%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','json2xls','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','basename','existsSync','join','each'];(function(_0x291b7,_0x367444){var _0x462c3d=function(_0x5c0a8f){while(--_0x5c0a8f){_0x291b7['push'](_0x291b7['shift']());}};_0x462c3d(++_0x367444);}(_0x5835,0x123));var _0x5583=function(_0x9adcd6,_0x36278b){_0x9adcd6=_0x9adcd6-0x0;var _0xdf8ff2=_0x5835[_0x9adcd6];return _0xdf8ff2;};'use strict';var util=require(_0x5583('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0x5583('0x1'));var BPromise=require(_0x5583('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x5583('0x3'))['db'];var dbH=require('../../mysqldb')[_0x5583('0x4')];var logger=require('../../config/logger')(_0x5583('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x5583('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2df44b,_0x18767a){var _0x2e2362={'status':_0x2df44b};var _0x16b5f8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x18767a){_0x2e2362[_0x5583('0x7')]=_0x18767a;}return db[_0x5583('0x8')][_0x5583('0x9')](_0x2e2362,_0x16b5f8);}function main(){var _0x13463b=0x1388;var _0x4a1fa7;logger['info'](util[_0x5583('0xa')](_0x5583('0xb'),EXTRACTED_REPORT_ID,_0x5583('0xc')));return db[_0x5583('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5583('0xe'),_0x5583('0xf')]})[_0x5583('0x10')](function(_0x497fe3){if(_0x497fe3){_0x4a1fa7=_0x497fe3;_0x13463b=_0x4a1fa7['splitSizeXlsx']||0x1388;}})[_0x5583('0x10')](function(){return dbH[_0x5583('0x11')][_0x5583('0x12')](util[_0x5583('0xa')](_0x5583('0x13'),QUERY),{'type':dbH[_0x5583('0x11')]['QueryTypes'][_0x5583('0x14')]});})[_0x5583('0x10')](function(_0x453cc0){if(!_0x453cc0[0x0][_0x5583('0x15')]){return analyticExtractedReport(_0x5583('0x16'));}var _0x49d525=[];var _0x3bc551=0x0;if(_0x4a1fa7[_0x5583('0xe')]){if(_0x453cc0&&_0x453cc0[_0x5583('0x17')]){var _0x388de3=_['range'](_0x453cc0[0x0][_0x5583('0x15')]/_0x13463b);var _0x4be517=Number['isInteger'](_0x453cc0[0x0]['num']/_0x13463b)?_0x453cc0[0x0][_0x5583('0x15')]%_0x13463b:0x0;_0x388de3['forEach'](function(_0x4f26e5){if(_0x4f26e5>0x0){_0x3bc551+=_0x13463b;}_0x49d525['push'](dbH[_0x5583('0x11')]['query'](util[_0x5583('0xa')](_0x5583('0x18'),QUERY,_0x13463b,_0x3bc551),{'type':dbH[_0x5583('0x11')][_0x5583('0x19')][_0x5583('0x14')]}));});if(_0x4be517>0x0){_0x3bc551+=_0x13463b;_0x49d525['push'](dbH[_0x5583('0x11')][_0x5583('0x12')](util['format'](_0x5583('0x18'),QUERY,_0x4be517,_0x3bc551),{'type':dbH[_0x5583('0x11')]['QueryTypes'][_0x5583('0x14')]}));}}}else{_0x49d525[_0x5583('0x1a')](dbH[_0x5583('0x11')][_0x5583('0x12')](QUERY,{'type':dbH[_0x5583('0x11')][_0x5583('0x19')][_0x5583('0x14')]}));}var _0x2a1035=path['dirname'](PATH);var _0x3a452a=path[_0x5583('0x1b')](PATH,'.xlsx');var _0xf69b10=_0x4a1fa7[_0x5583('0xe')]&&_0x49d525[_0x5583('0x17')]>0x1;var _0x293353=[];if(!fs[_0x5583('0x1c')](path[_0x5583('0x1d')](_0x2a1035,_0x3a452a))&&_0xf69b10){fs['mkdirSync'](path[_0x5583('0x1d')](_0x2a1035,_0x3a452a));}return BPromise[_0x5583('0x1e')](_0x49d525,function(_0x96e36d){_0x293353[_0x5583('0x1a')](_0x96e36d);})[_0x5583('0x10')](function(){for(var _0x215a1e=0x0;_0x215a1e<_0x293353[_0x5583('0x17')];_0x215a1e+=0x1){var _0x4b2a67;var _0x17ab05=_0x293353[_0x215a1e];if(_0xf69b10){_0x4b2a67=path[_0x5583('0x1d')](_0x2a1035,_0x3a452a,util[_0x5583('0xa')](_0x5583('0x1f'),_0x3a452a,_0x215a1e,_0x5583('0x20')));}else{_0x4b2a67=path['join'](_0x2a1035,util[_0x5583('0xa')](_0x5583('0x21'),_0x3a452a,_0x5583('0x20')));}fs[_0x5583('0x22')](_0x4b2a67,json2xls(_0x17ab05),_0x5583('0x23'));}})[_0x5583('0x10')](function(){if(_0xf69b10){return new Promise(function(_0x221a54){zipdir(path[_0x5583('0x1d')](_0x2a1035,_0x3a452a),{'saveTo':path['join'](_0x2a1035,util[_0x5583('0xa')]('%s.%s',_0x3a452a,_0x5583('0x24')))},function(_0x91163d,_0x7aa30){rimraf(path[_0x5583('0x1d')](_0x2a1035,_0x3a452a),function(){});_0x221a54(_0x5583('0x25'));});});}})[_0x5583('0x10')](function(){logger[_0x5583('0x26')](util[_0x5583('0xa')](_0x5583('0x27'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0xf69b10?util[_0x5583('0xa')](_0x5583('0x21'),_0x3a452a,_0xf69b10?'zip':_0x5583('0x20')):null);});})[_0x5583('0x28')](function(_0x2c2b03){logger[_0x5583('0x26')](util[_0x5583('0xa')](_0x5583('0x29'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x5583('0x2a')](_0x2c2b03,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5583('0x2b'));})[_0x5583('0x2c')](function(){process[_0x5583('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x5b5f=['split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','existsSync','join','%s%d.%s','%s.%s','xlsx','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find'];(function(_0x375537,_0x166c08){var _0x1b43be=function(_0x342cee){while(--_0x342cee){_0x375537['push'](_0x375537['shift']());}};_0x1b43be(++_0x166c08);}(_0x5b5f,0x1a7));var _0xf5b5=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x5b5f[_0x11e30d];return _0x2d4e29;};'use strict';var util=require(_0xf5b5('0x0'));var path=require(_0xf5b5('0x1'));var _=require(_0xf5b5('0x2'));var fs=require('fs');var json2xls=require(_0xf5b5('0x3'));var BPromise=require('bluebird');var zipdir=require(_0xf5b5('0x4'));var rimraf=require(_0xf5b5('0x5'));var db=require(_0xf5b5('0x6'))['db'];var dbH=require(_0xf5b5('0x6'))[_0xf5b5('0x7')];var logger=require(_0xf5b5('0x8'))(_0xf5b5('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf5b5('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x42a8e2,_0x17df45){var _0x107652={'status':_0x42a8e2};var _0x276f3b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17df45){_0x107652[_0xf5b5('0xb')]=_0x17df45;}return db['AnalyticExtractedReport'][_0xf5b5('0xc')](_0x107652,_0x276f3b);}function main(){var _0x306ac1=0x1388;var _0x120a63;logger[_0xf5b5('0xd')](util[_0xf5b5('0xe')](_0xf5b5('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf5b5('0x10')][_0xf5b5('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5b5('0x12'),_0xf5b5('0x13')]})[_0xf5b5('0x14')](function(_0x1caf85){if(_0x1caf85){_0x120a63=_0x1caf85;_0x306ac1=_0x120a63['splitSizeXlsx']||0x1388;}})[_0xf5b5('0x14')](function(){return dbH[_0xf5b5('0x15')][_0xf5b5('0x16')](util[_0xf5b5('0xe')](_0xf5b5('0x17'),QUERY),{'type':dbH[_0xf5b5('0x15')][_0xf5b5('0x18')][_0xf5b5('0x19')]});})['then'](function(_0x4086c3){if(!_0x4086c3[0x0][_0xf5b5('0x1a')]){return analyticExtractedReport(_0xf5b5('0x1b'));}var _0x1291b0=[];var _0x4d2f89=0x0;if(_0x120a63['split']){if(_0x4086c3&&_0x4086c3[_0xf5b5('0x1c')]){var _0x13e59e=_['range'](_0x4086c3[0x0]['num']/_0x306ac1);var _0x4b2568=Number[_0xf5b5('0x1d')](_0x4086c3[0x0][_0xf5b5('0x1a')]/_0x306ac1)?_0x4086c3[0x0]['num']%_0x306ac1:0x0;_0x13e59e[_0xf5b5('0x1e')](function(_0x12b238){if(_0x12b238>0x0){_0x4d2f89+=_0x306ac1;}_0x1291b0[_0xf5b5('0x1f')](dbH[_0xf5b5('0x15')][_0xf5b5('0x16')](util[_0xf5b5('0xe')](_0xf5b5('0x20'),QUERY,_0x306ac1,_0x4d2f89),{'type':dbH['sequelize'][_0xf5b5('0x18')][_0xf5b5('0x19')]}));});if(_0x4b2568>0x0){_0x4d2f89+=_0x306ac1;_0x1291b0[_0xf5b5('0x1f')](dbH['sequelize'][_0xf5b5('0x16')](util['format'](_0xf5b5('0x20'),QUERY,_0x4b2568,_0x4d2f89),{'type':dbH['sequelize'][_0xf5b5('0x18')][_0xf5b5('0x19')]}));}}}else{_0x1291b0['push'](dbH[_0xf5b5('0x15')]['query'](QUERY,{'type':dbH['sequelize'][_0xf5b5('0x18')][_0xf5b5('0x19')]}));}var _0x356d27=path['dirname'](PATH);var _0x1c8823=path[_0xf5b5('0x21')](PATH,_0xf5b5('0x22'));var _0x4f5196=_0x120a63['split']&&_0x1291b0[_0xf5b5('0x1c')]>0x1;var _0x1f21c2=[];if(!fs[_0xf5b5('0x23')](path[_0xf5b5('0x24')](_0x356d27,_0x1c8823))&&_0x4f5196){fs['mkdirSync'](path[_0xf5b5('0x24')](_0x356d27,_0x1c8823));}return BPromise['each'](_0x1291b0,function(_0x241a26){_0x1f21c2[_0xf5b5('0x1f')](_0x241a26);})[_0xf5b5('0x14')](function(){for(var _0x46565b=0x0;_0x46565b<_0x1f21c2[_0xf5b5('0x1c')];_0x46565b+=0x1){var _0x4d42d2;var _0x481b9e=_0x1f21c2[_0x46565b];if(_0x4f5196){_0x4d42d2=path[_0xf5b5('0x24')](_0x356d27,_0x1c8823,util['format'](_0xf5b5('0x25'),_0x1c8823,_0x46565b,'xlsx'));}else{_0x4d42d2=path[_0xf5b5('0x24')](_0x356d27,util[_0xf5b5('0xe')](_0xf5b5('0x26'),_0x1c8823,_0xf5b5('0x27')));}fs['writeFileSync'](_0x4d42d2,json2xls(_0x481b9e),_0xf5b5('0x28'));}})[_0xf5b5('0x14')](function(){if(_0x4f5196){return new Promise(function(_0x1e6359){zipdir(path[_0xf5b5('0x24')](_0x356d27,_0x1c8823),{'saveTo':path['join'](_0x356d27,util['format']('%s.%s',_0x1c8823,_0xf5b5('0x29')))},function(_0x4d00f0,_0x14503f){rimraf(path[_0xf5b5('0x24')](_0x356d27,_0x1c8823),function(){});_0x1e6359('zip\x20finished');});});}})['then'](function(){logger[_0xf5b5('0xd')](util[_0xf5b5('0xe')](_0xf5b5('0x2a'),EXTRACTED_REPORT_ID,_0xf5b5('0x2b')));return analyticExtractedReport(_0xf5b5('0x2c'),_0x4f5196?util[_0xf5b5('0xe')](_0xf5b5('0x26'),_0x1c8823,_0x4f5196?_0xf5b5('0x29'):_0xf5b5('0x27')):null);});})[_0xf5b5('0x2d')](function(_0x399a84){logger[_0xf5b5('0xd')](util['format'](_0xf5b5('0x2e'),EXTRACTED_REPORT_ID,_0xf5b5('0x2b')),util['inspect'](_0x399a84,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf5b5('0x2f')](function(){process[_0xf5b5('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e6966bc..60f75df 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 _0x9376=['toLowerCase','createdAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','filter','groupBy','exten','playback','hasOwnProperty','priority','extensions','find','push','type','format','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9376,0x138));var _0x6937=function(_0x51cc7c,_0x24ab34){_0x51cc7c=_0x51cc7c-0x0;var _0x59fe79=_0x9376[_0x51cc7c];return _0x59fe79;};'use strict';var _=require(_0x6937('0x0'));var util=require(_0x6937('0x1'));function rewrite(_0x350f48,_0x23fed2){var _0x6a81f7=this;return _0x350f48[_0x6937('0x2')][_0x6937('0x3')]['findAll']({'raw':!![]})[_0x6937('0x4')](function(_0x1be089){_0x6a81f7[_0x6937('0x5')]=_0x1be089;return _0x350f48['models'][_0x6937('0x6')][_0x6937('0x7')]({'where':{'IntervalId':_0x23fed2['IntervalId']},'raw':!![]});})['then'](function(_0x52698e){return _0x350f48['models'][_0x6937('0x6')][_0x6937('0x7')]({'where':{'exten':{'$in':_[_0x6937('0x8')](_['map'](_0x52698e,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x6937('0x4')](function(_0x10e944){var _0xa2de02=_['filter'](_0x10e944,{'priority':'1'});var _0x297c4c=_[_0x6937('0x9')](_0x10e944,{'isApp':0x1});var _0x1817e8=_[_0x6937('0xa')](_0x297c4c,_0x6937('0xb'));var _0x38a904=['queue',_0x6937('0xc')];var _0x5ec54e=[];var _0x108a2a=[];for(var _0x319461 in _0x1817e8){if(_0x1817e8[_0x6937('0xd')](_0x319461)){_0x6a81f7[_0x6937('0xe')]=0x2;_0x6a81f7[_0x6937('0xf')]=[];_0x6a81f7['extension']=_[_0x6937('0x10')](_0xa2de02,{'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')]});_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':'Set','appdata':util[_0x6937('0x13')]('CDR(type)=%s',_0x1817e8[_0x319461][0x0][_0x6937('0x12')]),'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});if(_0x1817e8[_0x319461][0x0][_0x6937('0x12')]===_0x6937('0x16')){_0x6a81f7[_0x6937('0xf')]['push']({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x18')+_0x1817e8[_0x319461][0x0][_0x6937('0x15')],'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});}else if(_0x1817e8[_0x319461][0x0][_0x6937('0x12')]===_0x6937('0x19')){if(_0x6a81f7[_0x6937('0x1a')]){_0x6a81f7['extensions'][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':'Set','appdata':_0x6937('0x1b')+(_0x6a81f7['extension'][_0x6937('0x1c')]?'${EXTEN:'+_0x6a81f7[_0x6937('0x1a')]['cutdigits']+'}':_0x6937('0x1d')),'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7['priority']++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});}_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x18')+_0x1817e8[_0x319461][0x0]['VoiceExtensionId'],'context':_0x1817e8[_0x319461][0x0]['context'],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0]['VoiceExtensionId']});var _0x4a6e2e=_0x6a81f7[_0x6937('0xe')]++;_0x6a81f7[_0x6937('0xf')]['push']({'type':_0x1817e8[_0x319461][0x0]['type'],'app':_0x6937('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4a6e2e+0x2)+_0x6937('0x1f')+(_0x4a6e2e+0x1)+')','context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x4a6e2e,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});if(_0x6a81f7[_0x6937('0x1a')]){_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6a81f7[_0x6937('0x1a')][_0x6937('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x6a81f7[_0x6937('0x1a')][_0x6937('0x1c')]+'}':_0x6937('0x20'),'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0]['exten'],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0]['VoiceExtensionId']});}_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x21')+_0x1817e8[_0x319461][0x0]['VoiceExtensionId'],'context':_0x1817e8[_0x319461][0x0]['context'],'exten':_0x1817e8[_0x319461][0x0]['exten'],'priority':_0x6a81f7['priority']++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});if(_0x6a81f7[_0x6937('0x1a')]&&_0x6a81f7['extension'][_0x6937('0xd')](_0x6937('0x22'))&&_0x6a81f7[_0x6937('0x1a')]['recordingFormat']!==_0x6937('0x23')){_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':'Set','appdata':_0x6937('0x24'),'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7['priority']++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});_0x6a81f7[_0x6937('0xf')]['push']({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x25')+_0x6a81f7[_0x6937('0x1a')][_0x6937('0x22')]||_0x6937('0x26'),'context':_0x1817e8[_0x319461][0x0]['context'],'exten':_0x1817e8[_0x319461][0x0]['exten'],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});}}_0x6a81f7['extensions'][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0]['type'],'app':_0x6937('0x17'),'appdata':_0x6937('0x27'),'context':_0x1817e8[_0x319461][0x0]['context'],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x28'),'context':_0x1817e8[_0x319461][0x0]['context'],'exten':_0x1817e8[_0x319461][0x0]['exten'],'priority':_0x6a81f7[_0x6937('0xe')]++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0]['VoiceExtensionId']});_0x6a81f7[_0x6937('0xf')][_0x6937('0x11')]({'type':_0x1817e8[_0x319461][0x0][_0x6937('0x12')],'app':'Set','appdata':_0x6937('0x29'),'context':_0x1817e8[_0x319461][0x0][_0x6937('0x14')],'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'priority':_0x6a81f7['priority']++,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});for(var _0x33f068=0x0,_0x2f56a4=0x0;_0x33f068<_0x1817e8[_0x319461][_0x6937('0x2a')];_0x33f068+=0x1,_0x2f56a4=0x0){var _0x12e66a=_0x1817e8[_0x319461][_0x33f068];if(_0x12e66a[_0x6937('0x12')]){_0x12e66a[_0x6937('0x12')]=_0x12e66a['type'][_0x6937('0x2b')]();}var _0x57664e=[];var _0x103fdf=[];delete _0x12e66a['id'];delete _0x12e66a[_0x6937('0x2c')];delete _0x12e66a['updatedAt'];var _0x19720c=_0x12e66a[_0x6937('0x2d')]!==_0x6937('0x2e')?[_0x12e66a[_0x6937('0x2d')]]:_0x12e66a[_0x6937('0x2f')]?_['map'](_[_0x6937('0x9')](_0x6a81f7[_0x6937('0x5')],{'IntervalId':_0x12e66a[_0x6937('0x2f')]}),_0x6937('0x2d')):[];if(_0x12e66a['hasOwnProperty'](_0x6937('0x30'))){if(_0x12e66a['tag']&&_0x12e66a[_0x6937('0x30')]!=='--'){_0x57664e[_0x6937('0x11')]({'type':_0x12e66a[_0x6937('0x12')],'app':_0x6937('0x17'),'appdata':_0x6937('0x31')+_0x12e66a[_0x6937('0x30')],'context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c[_0x6937('0x2a')]+_0x6a81f7['priority']+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});}}if(_0x12e66a['type']===_0x6937('0x19')&&_0x12e66a[_0x6937('0xd')](_0x6937('0x32'))){if(_0x12e66a[_0x6937('0x32')]){_0x57664e['push']({'type':_0x12e66a[_0x6937('0x12')],'app':_0x6937('0x1e'),'appdata':_0x6937('0x33')+_0x12e66a[_0x6937('0x32')]+')','context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c[_0x6937('0x2a')]+_0x6a81f7[_0x6937('0xe')]+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});}else{_0x57664e[_0x6937('0x11')]({'type':_0x12e66a[_0x6937('0x12')],'app':_0x6937('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c['length']+_0x6a81f7[_0x6937('0xe')]+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});}}if(_0x12e66a[_0x6937('0xd')](_0x6937('0x34'))){if(_0x38a904[_0x6937('0x35')](_0x12e66a['app'][_0x6937('0x2b')]())>=0x0&&_0x12e66a[_0x6937('0x36')]!==_0x6937('0x37')){if(_0x12e66a[_0x6937('0x34')]){_0x57664e[_0x6937('0x11')]({'type':_0x12e66a['type'],'app':'ExecIf','appdata':_0x6937('0x38'),'context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c[_0x6937('0x2a')]+_0x6a81f7[_0x6937('0xe')]+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});_0x57664e['push']({'type':_0x12e66a[_0x6937('0x12')],'app':'Set','appdata':_0x6937('0x39'),'context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c['length']+_0x6a81f7[_0x6937('0xe')]+_0x2f56a4++,'VoiceExtensionId':_0x12e66a['VoiceExtensionId']});}else{_0x57664e[_0x6937('0x11')]({'type':_0x12e66a[_0x6937('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x12e66a['context'],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c['length']+_0x6a81f7['priority']+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});_0x57664e[_0x6937('0x11')]({'type':_0x12e66a['type'],'app':'Set','appdata':_0x6937('0x3a'),'context':_0x12e66a[_0x6937('0x14')],'exten':_0x12e66a[_0x6937('0xb')],'priority':_0x19720c[_0x6937('0x2a')]+_0x6a81f7['priority']+_0x2f56a4++,'VoiceExtensionId':_0x12e66a[_0x6937('0x15')]});}}}for(var _0x2cf779=0x0;_0x2cf779<_0x19720c['length'];_0x2cf779+=0x1){var _0x23daa3=_0x6a81f7[_0x6937('0xe')]+_0x19720c[_0x6937('0x2a')];var _0xc22c04=_0x2cf779===_0x19720c['length']-0x1?_0x6a81f7['priority']+_0x57664e['length']+_0x103fdf[_0x6937('0x2a')]+0x2:_0x6a81f7[_0x6937('0xe')]+_0x2cf779+0x1;_0x57664e[_0x6937('0x3b')](_0x2cf779,0x0,{'type':_0x12e66a[_0x6937('0x12')],'app':_0x6937('0x3c'),'appdata':_0x19720c[_0x2cf779]+'?'+_0x12e66a[_0x6937('0x14')]+',${EXTEN},'+_0x23daa3+':'+_0x12e66a[_0x6937('0x14')]+_0x6937('0x3d')+_0xc22c04,'exten':_0x12e66a[_0x6937('0xb')],'context':_0x12e66a[_0x6937('0x14')],'priority':_0x6a81f7[_0x6937('0xe')]+_0x2cf779,'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});}_0x12e66a[_0x6937('0xe')]=_0x57664e[_0x6937('0x2a')]?_[_0x6937('0x3e')](_0x57664e)['priority']+0x1:_0x6a81f7['priority'];_0x6a81f7['priority']=(_0x103fdf[_0x6937('0x2a')]?_[_0x6937('0x3e')](_0x103fdf)[_0x6937('0xe')]:_0x12e66a[_0x6937('0xe')])+0x1;_0x6a81f7[_0x6937('0xf')]=_['concat'](_0x6a81f7[_0x6937('0xf')],_0x57664e,[_0x12e66a],_0x103fdf);}_0x6a81f7['extensions']['push']({'type':_0x1817e8[_0x319461][0x0]['type'],'app':_0x6937('0x3f'),'exten':_0x1817e8[_0x319461][0x0][_0x6937('0xb')],'context':_0x1817e8[_0x319461][0x0]['context'],'priority':_0x6a81f7[_0x6937('0xe')],'VoiceExtensionId':_0x1817e8[_0x319461][0x0][_0x6937('0x15')]});_0x5ec54e[_0x6937('0x11')](_0x1817e8[_0x319461][0x0][_0x6937('0x15')]);_0x108a2a=_['concat'](_0x108a2a,_0x6a81f7[_0x6937('0xf')]);}}return _0x350f48[_0x6937('0x40')](function(_0x4bf775){return _0x350f48[_0x6937('0x2')]['VoiceExtension'][_0x6937('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x5ec54e}},'transaction':_0x4bf775})[_0x6937('0x4')](function(_0x520244){return _0x350f48[_0x6937('0x2')]['VoiceExtension'][_0x6937('0x42')](_[_0x6937('0x43')](_0x108a2a,'priority'),{'transaction':_0x4bf775});});});})[_0x6937('0x44')](function(_0x1345ef){console[_0x6937('0x45')](_0x1345ef);});}exports[_0x6937('0x46')]=rewrite; \ No newline at end of file +var _0xd083=['priority','extensions','extension','find','push','type','Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','outbound','callerID','ExecIf','$[${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','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','catch','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','hasOwnProperty'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xd083,0x14a));var _0x3d08=function(_0x1f1170,_0x3b5783){_0x1f1170=_0x1f1170-0x0;var _0x127b7b=_0xd083[_0x1f1170];return _0x127b7b;};'use strict';var _=require(_0x3d08('0x0'));var util=require(_0x3d08('0x1'));function rewrite(_0x28f778,_0x44139a){var _0x26752d=this;return _0x28f778[_0x3d08('0x2')][_0x3d08('0x3')][_0x3d08('0x4')]({'raw':!![]})[_0x3d08('0x5')](function(_0x2a8013){_0x26752d[_0x3d08('0x6')]=_0x2a8013;return _0x28f778[_0x3d08('0x2')][_0x3d08('0x7')][_0x3d08('0x4')]({'where':{'IntervalId':_0x44139a['IntervalId']},'raw':!![]});})[_0x3d08('0x5')](function(_0xc41152){return _0x28f778[_0x3d08('0x2')][_0x3d08('0x7')][_0x3d08('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x3d08('0x8')](_0xc41152,_0x3d08('0x9')))}},'order':[{'raw':_0x3d08('0xa')}],'raw':!![]});})[_0x3d08('0x5')](function(_0x5b3475){var _0x34a358=_[_0x3d08('0xb')](_0x5b3475,{'priority':'1'});var _0x3a0d02=_['filter'](_0x5b3475,{'isApp':0x1});var _0xd3f444=_[_0x3d08('0xc')](_0x3a0d02,_0x3d08('0x9'));var _0x4536d7=[_0x3d08('0xd'),'playback'];var _0x20a27f=[];var _0x45cd35=[];for(var _0x1eac4a in _0xd3f444){if(_0xd3f444[_0x3d08('0xe')](_0x1eac4a)){_0x26752d[_0x3d08('0xf')]=0x2;_0x26752d[_0x3d08('0x10')]=[];_0x26752d[_0x3d08('0x11')]=_[_0x3d08('0x12')](_0x34a358,{'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')]});_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':util['format'](_0x3d08('0x16'),_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')]),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0]['exten'],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});if(_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')]===_0x3d08('0x19')){_0x26752d['extensions'][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')],'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});}else if(_0xd3f444[_0x1eac4a][0x0]['type']==='outbound'){if(_0x26752d['extension']){_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0]['type'],'app':'Set','appdata':_0x3d08('0x1a')+(_0x26752d[_0x3d08('0x11')][_0x3d08('0x1b')]?_0x3d08('0x1c')+_0x26752d['extension'][_0x3d08('0x1b')]+'}':_0x3d08('0x1d')),'context':_0xd3f444[_0x1eac4a][0x0]['context'],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d['priority']++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});}_0x26752d['extensions']['push']({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x1e')+_0xd3f444[_0x1eac4a][0x0]['VoiceExtensionId'],'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});var _0x292924=_0x26752d[_0x3d08('0xf')]++;_0x26752d[_0x3d08('0x10')]['push']({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':'ExecIf','appdata':_0x3d08('0x1f')+(_0x292924+0x2)+_0x3d08('0x20')+(_0x292924+0x1)+')','context':_0xd3f444[_0x1eac4a][0x0]['context'],'exten':_0xd3f444[_0x1eac4a][0x0]['exten'],'priority':_0x292924,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});if(_0x26752d['extension']){_0x26752d['extensions'][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x26752d[_0x3d08('0x11')][_0x3d08('0x1b')]?_0x3d08('0x21')+_0x26752d[_0x3d08('0x11')]['cutdigits']+'}':_0x3d08('0x22'),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d['priority']++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0]['VoiceExtensionId']});}_0x26752d['extensions'][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x23')+_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')],'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0]['exten'],'priority':_0x26752d['priority']++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});if(_0x26752d[_0x3d08('0x11')]&&_0x26752d[_0x3d08('0x11')][_0x3d08('0xe')]('recordingFormat')&&_0x26752d['extension'][_0x3d08('0x24')]!==_0x3d08('0x25')){_0x26752d['extensions']['push']({'type':_0xd3f444[_0x1eac4a][0x0]['type'],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x26'),'context':_0xd3f444[_0x1eac4a][0x0]['context'],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':'Set','appdata':_0x3d08('0x27')+_0x26752d['extension'][_0x3d08('0x24')]||_0x3d08('0x28'),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});}}_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x29'),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});_0x26752d['extensions']['push']({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x2a'),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0]['exten'],'priority':_0x26752d['priority']++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0]['VoiceExtensionId']});_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x2b'),'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'exten':_0xd3f444[_0x1eac4a][0x0]['exten'],'priority':_0x26752d[_0x3d08('0xf')]++,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});for(var _0x200770=0x0,_0x2ccdd5=0x0;_0x200770<_0xd3f444[_0x1eac4a][_0x3d08('0x2c')];_0x200770+=0x1,_0x2ccdd5=0x0){var _0x2c84ab=_0xd3f444[_0x1eac4a][_0x200770];if(_0x2c84ab[_0x3d08('0x14')]){_0x2c84ab[_0x3d08('0x14')]=_0x2c84ab[_0x3d08('0x14')]['toLowerCase']();}var _0x2138b2=[];var _0x5bd096=[];delete _0x2c84ab['id'];delete _0x2c84ab[_0x3d08('0x2d')];delete _0x2c84ab[_0x3d08('0x2e')];var _0x62f6f2=_0x2c84ab[_0x3d08('0x2f')]!==_0x3d08('0x30')?[_0x2c84ab['interval']]:_0x2c84ab['IntervalId']?_[_0x3d08('0x8')](_[_0x3d08('0xb')](_0x26752d[_0x3d08('0x6')],{'IntervalId':_0x2c84ab[_0x3d08('0x31')]}),_0x3d08('0x2f')):[];if(_0x2c84ab[_0x3d08('0xe')](_0x3d08('0x32'))){if(_0x2c84ab['tag']&&_0x2c84ab[_0x3d08('0x32')]!=='--'){_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab['type'],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x33')+_0x2c84ab[_0x3d08('0x32')],'context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab[_0x3d08('0x9')],'priority':_0x62f6f2[_0x3d08('0x2c')]+_0x26752d[_0x3d08('0xf')]+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});}}if(_0x2c84ab['type']===_0x3d08('0x34')&&_0x2c84ab['hasOwnProperty'](_0x3d08('0x35'))){if(_0x2c84ab['callerID']){_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x36'),'appdata':_0x3d08('0x37')+_0x2c84ab[_0x3d08('0x35')]+')','context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab['exten'],'priority':_0x62f6f2['length']+_0x26752d[_0x3d08('0xf')]+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});}else{_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x36'),'appdata':_0x3d08('0x38'),'context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab[_0x3d08('0x9')],'priority':_0x62f6f2[_0x3d08('0x2c')]+_0x26752d[_0x3d08('0xf')]+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab['VoiceExtensionId']});}}if(_0x2c84ab[_0x3d08('0xe')](_0x3d08('0x39'))){if(_0x4536d7[_0x3d08('0x3a')](_0x2c84ab['app']['toLowerCase']())>=0x0&&_0x2c84ab['appType']!=='custom'){if(_0x2c84ab[_0x3d08('0x39')]){_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab['exten'],'priority':_0x62f6f2[_0x3d08('0x2c')]+_0x26752d['priority']+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':_0x3d08('0x3b'),'context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab['exten'],'priority':_0x62f6f2['length']+_0x26752d[_0x3d08('0xf')]+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});}else{_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x36'),'appdata':_0x3d08('0x3c'),'context':_0x2c84ab[_0x3d08('0x17')],'exten':_0x2c84ab[_0x3d08('0x9')],'priority':_0x62f6f2[_0x3d08('0x2c')]+_0x26752d[_0x3d08('0xf')]+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});_0x2138b2[_0x3d08('0x13')]({'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2c84ab['context'],'exten':_0x2c84ab[_0x3d08('0x9')],'priority':_0x62f6f2[_0x3d08('0x2c')]+_0x26752d['priority']+_0x2ccdd5++,'VoiceExtensionId':_0x2c84ab[_0x3d08('0x18')]});}}}for(var _0x17d22a=0x0;_0x17d22a<_0x62f6f2[_0x3d08('0x2c')];_0x17d22a+=0x1){var _0x32e25b=_0x26752d['priority']+_0x62f6f2['length'];var _0x200a14=_0x17d22a===_0x62f6f2[_0x3d08('0x2c')]-0x1?_0x26752d[_0x3d08('0xf')]+_0x2138b2[_0x3d08('0x2c')]+_0x5bd096[_0x3d08('0x2c')]+0x2:_0x26752d[_0x3d08('0xf')]+_0x17d22a+0x1;_0x2138b2[_0x3d08('0x3d')](_0x17d22a,0x0,{'type':_0x2c84ab[_0x3d08('0x14')],'app':_0x3d08('0x3e'),'appdata':_0x62f6f2[_0x17d22a]+'?'+_0x2c84ab[_0x3d08('0x17')]+_0x3d08('0x3f')+_0x32e25b+':'+_0x2c84ab[_0x3d08('0x17')]+_0x3d08('0x3f')+_0x200a14,'exten':_0x2c84ab[_0x3d08('0x9')],'context':_0x2c84ab[_0x3d08('0x17')],'priority':_0x26752d['priority']+_0x17d22a,'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});}_0x2c84ab[_0x3d08('0xf')]=_0x2138b2['length']?_[_0x3d08('0x40')](_0x2138b2)[_0x3d08('0xf')]+0x1:_0x26752d[_0x3d08('0xf')];_0x26752d[_0x3d08('0xf')]=(_0x5bd096[_0x3d08('0x2c')]?_['last'](_0x5bd096)[_0x3d08('0xf')]:_0x2c84ab[_0x3d08('0xf')])+0x1;_0x26752d['extensions']=_['concat'](_0x26752d[_0x3d08('0x10')],_0x2138b2,[_0x2c84ab],_0x5bd096);}_0x26752d[_0x3d08('0x10')][_0x3d08('0x13')]({'type':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x14')],'app':'Hangup','exten':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x9')],'context':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x17')],'priority':_0x26752d['priority'],'VoiceExtensionId':_0xd3f444[_0x1eac4a][0x0][_0x3d08('0x18')]});_0x20a27f[_0x3d08('0x13')](_0xd3f444[_0x1eac4a][0x0]['VoiceExtensionId']);_0x45cd35=_[_0x3d08('0x41')](_0x45cd35,_0x26752d[_0x3d08('0x10')]);}}return _0x28f778[_0x3d08('0x42')](function(_0x770285){return _0x28f778['models'][_0x3d08('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x20a27f}},'transaction':_0x770285})[_0x3d08('0x5')](function(_0x31cf7c){return _0x28f778['models'][_0x3d08('0x7')]['bulkCreate'](_['sortBy'](_0x45cd35,'priority'),{'transaction':_0x770285});});});})[_0x3d08('0x43')](function(_0x1f7f3c){console['error'](_0x1f7f3c);});}exports[_0x3d08('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 17ca858..664c835 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 _0x10a5=['VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','get','onlyIfOpen','CampaignId','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','duplicate','CSV\x20parse\x20error','bluebird','util','lodash','squel','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','cm_contacts','id\x20IN\x20?','cm_hopper_final','into','cm_hopper_black','str'];(function(_0x54648f,_0x26aae7){var _0x4a888e=function(_0x2837d2){while(--_0x2837d2){_0x54648f['push'](_0x54648f['shift']());}};_0x4a888e(++_0x26aae7);}(_0x10a5,0x1db));var _0x510a=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0x10a5[_0xe719ec];return _0x4842a1;};'use strict';var BPromise=require(_0x510a('0x0'));var util=require(_0x510a('0x1'));var _=require(_0x510a('0x2'));var fs=require('fs');var squel=require(_0x510a('0x3'));var Papa=require('papaparse');var Redis=require(_0x510a('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0x510a('0x5'));var logger=require('../../../config/logger')('api');config[_0x510a('0x6')]=_[_0x510a('0x7')](config[_0x510a('0x6')],{'host':_0x510a('0x8'),'port':0x18eb});var socket=require(_0x510a('0x9'))(new Redis(config[_0x510a('0x6')]));require(_0x510a('0xa'))['register'](socket);try{if(!process[_0x510a('0xb')][0x2]||process[_0x510a('0xb')][0x2]===_0x510a('0xc')||process['argv'][0x2]===_0x510a('0xd')){throw new Error(_0x510a('0xe'));}var FILEPATH=process[_0x510a('0xb')][0x2];if(!process[_0x510a('0xb')][0x3]||process[_0x510a('0xb')][0x3]===_0x510a('0xc')||process[_0x510a('0xb')][0x3]===_0x510a('0xd')||!process['argv'][0x4]||process['argv'][0x4]===_0x510a('0xc')||process[_0x510a('0xb')][0x4]===_0x510a('0xd')){throw new Error(_0x510a('0xf'));}var FIELDS=_['zipObject'](process[_0x510a('0xb')][0x3][_0x510a('0x10')](','),process[_0x510a('0xb')][0x4][_0x510a('0x10')](','));if(!process[_0x510a('0xb')][0x5]||process[_0x510a('0xb')][0x5]===_0x510a('0xc')||process['argv'][0x5]===_0x510a('0xd')){throw new Error(_0x510a('0x11'));}var LISTID=process[_0x510a('0xb')][0x5];var COMPANYID=process[_0x510a('0xb')][0x6]&&process[_0x510a('0xb')][0x6]!=='undefined'&&process[_0x510a('0xb')][0x6]!==_0x510a('0xd')?process[_0x510a('0xb')][0x6]:null;var DUPLICATES=process[_0x510a('0xb')][0x7]&&process[_0x510a('0xb')][0x7]!==_0x510a('0xc')&&process[_0x510a('0xb')][0x7]!=='null'?process[_0x510a('0xb')][0x7]:null;if(!process[_0x510a('0xb')][0x8]||process[_0x510a('0xb')][0x8]===_0x510a('0xc')||process[_0x510a('0xb')][0x8]===_0x510a('0xd')){throw new Error(_0x510a('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x485776){logger['error'](_0x485776);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(_0x12c678,_0xbc19a,_0x5b6dbd,_0x299208){var _0x36063a={'message':_0xbc19a};_0x36063a[_0x12c678]=!![];if(_0x5b6dbd){_0x36063a[_0x510a('0x13')]=_0x5b6dbd;}if(_0x299208){_0x36063a[_0x510a('0x14')]=_0x299208;}return _0x36063a;}function isEmail(_0x962059){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))*$/[_0x510a('0x15')](_0x962059);}function checkRow(_0x38d7c8,_0x5f2541,_0x4d6b97){return new BPromise(function(_0x52c153,_0x512f06){if(_[_0x510a('0x16')](_0x38d7c8)){return _0x512f06(handleCheckRowError(_0x510a('0x17'),_0x510a('0x18'),null,_0x4d6b97));}if(_0x38d7c8[_0x510a('0x19')]&&_0x38d7c8[_0x510a('0x19')]['length']){var _0x2260d7=_[_0x510a('0x1a')](_0x38d7c8['errors'],_0x510a('0x1b'))[_0x510a('0x1c')](';');return _0x512f06(handleCheckRowError(_0x510a('0x17'),_0x2260d7,null,_0x4d6b97));}var _0x15f2da={};for(var _0x3db65e in FIELDS){if(FIELDS['hasOwnProperty'](_0x3db65e)&&FIELDS[_0x3db65e]){_0x15f2da[_0x3db65e]=_0x38d7c8[_0x510a('0x1d')][0x0][FIELDS[_0x3db65e]]||_0x38d7c8['data'][0x0]['\ufeff'+FIELDS[_0x3db65e]];}}if(!_0x15f2da[_0x510a('0x1e')]){return _0x512f06(handleCheckRowError('error',_0x510a('0x1f'),null,_0x4d6b97));}if(!_0x15f2da[_0x510a('0x20')]){return _0x512f06(handleCheckRowError(_0x510a('0x17'),_0x510a('0x21'),null,_0x4d6b97));}if(_0x15f2da[_0x510a('0x22')]){var _0x378d6f=moment(_0x15f2da[_0x510a('0x22')],_0x510a('0x23'));if(!_0x378d6f[_0x510a('0x24')]()){return _0x512f06(handleCheckRowError(_0x510a('0x17'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4d6b97));}}if(_0x15f2da[_0x510a('0x25')]){if(!isEmail(_0x15f2da['email'])){return _0x512f06(handleCheckRowError(_0x510a('0x17'),_0x510a('0x26'),null,_0x4d6b97));}}_0x15f2da['ListId']=LISTID;_0x15f2da[_0x510a('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x510a('0x28')]&&_0x5f2541){var _0x49ac0a={};for(var _0xbe6dea=0x0,_0x49f072=DUPLICATES[_0x510a('0x28')];_0xbe6dea<_0x49f072;_0xbe6dea+=0x1){_0x49ac0a[DUPLICATES[_0xbe6dea]]=_0x15f2da[DUPLICATES[_0xbe6dea]];}var _0x3d4e4c=_[_0x510a('0x29')](_0x5f2541,_0x49ac0a);if(_0x3d4e4c){return _0x512f06(handleCheckRowError('duplicate',_0x510a('0x2a'),_0x3d4e4c,_0x4d6b97));}}return db[_0x510a('0x2b')][_0x510a('0x2c')](_0x15f2da,{'raw':!![],'hooks':![],'fields':_[_0x510a('0x2d')](_0x15f2da)})[_0x510a('0x2e')](function(_0xebc6f4){if(DUPLICATES&&DUPLICATES[_0x510a('0x28')]&&_0x5f2541){_0x5f2541[_0x510a('0x2f')](_[_0x510a('0x30')](_0x15f2da,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xebc6f4['id'];return _0x52c153();})[_0x510a('0x31')](function(_0x5d017d){return _0x512f06(handleCheckRowError('error',_0x510a('0x32')+(_0x5d017d[_0x510a('0x1b')]||JSON[_0x510a('0x33')](_0x5d017d)),null,_0x4d6b97));});});}function checkHopper(){function _0x5bcea5(){return function(_0x2cb2eb){logger[_0x510a('0x17')](_0x510a('0x34'),_0x510a('0x35'),util[_0x510a('0x36')](_0x2cb2eb,{'showHidden':![],'depth':null}));};}var _0x15f385=function(_0x38a756,_0x3a6c94){var _0xd91f32=squel[_0x510a('0x37')]()['into'](_0x510a('0x38'))[_0x510a('0x39')]([_0x510a('0x20'),_0x510a('0x3a'),_0x510a('0x3b'),_0x510a('0x3c'),_0x3a6c94,_0x510a('0x3d'),_0x510a('0x3e')],squel[_0x510a('0x3f')]()[_0x510a('0x40')](_0x510a('0x20'),_0x510a('0x20'))[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3a'))[_0x510a('0x40')]('id',_0x510a('0x3b'))[_0x510a('0x40')](LISTID[_0x510a('0x42')](),_0x510a('0x3c'))[_0x510a('0x40')](_0x38a756['id'][_0x510a('0x42')](),_0x3a6c94)[_0x510a('0x40')]('NOW()','createdAt')[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3e'))['from']('cm_contacts')[_0x510a('0x43')](_0x510a('0x44'))[_0x510a('0x43')](_0x510a('0x45'),LISTID[_0x510a('0x42')]())['where'](_0x510a('0x46'))[_0x510a('0x43')](_0x510a('0x47'),squel['select']()['field']('phone')[_0x510a('0x48')](_0x510a('0x38'))[_0x510a('0x43')](_0x3a6c94+_0x510a('0x49'),_0x38a756['id']['toString']())))[_0x510a('0x42')]();return _0xd91f32;};var _0x6d6eee=function(_0xb40e2f,_0x2be63c){var _0x2b0864=squel['insert']()['into'](_0x510a('0x38'))['fromQuery']([_0x510a('0x20'),_0x510a('0x3a'),_0x510a('0x3b'),_0x510a('0x3c'),_0x2be63c,_0x510a('0x3d'),_0x510a('0x3e')],squel[_0x510a('0x3f')]()[_0x510a('0x40')](_0x510a('0x20'),_0x510a('0x20'))[_0x510a('0x40')]('NOW()',_0x510a('0x3a'))['field']('id',_0x510a('0x3b'))['field'](LISTID[_0x510a('0x42')](),_0x510a('0x3c'))['field'](_0xb40e2f['id'][_0x510a('0x42')](),_0x2be63c)[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3d'))[_0x510a('0x40')](_0x510a('0x41'),'updatedAt')[_0x510a('0x48')](_0x510a('0x4a'))[_0x510a('0x43')](_0x510a('0x44'))[_0x510a('0x43')](_0x510a('0x45'),LISTID[_0x510a('0x42')]())[_0x510a('0x43')](_0x510a('0x4b'),squel['str'](hopperContacts))['where'](_0x510a('0x46'))[_0x510a('0x43')](_0x510a('0x47'),squel[_0x510a('0x3f')]()[_0x510a('0x40')]('calleridnum')[_0x510a('0x48')](_0x510a('0x4c'))[_0x510a('0x43')](_0x2be63c+_0x510a('0x49'),_0xb40e2f['id']['toString']()))[_0x510a('0x43')](_0x510a('0x47'),squel[_0x510a('0x3f')]()[_0x510a('0x40')](_0x510a('0x20'))[_0x510a('0x48')](_0x510a('0x38'))[_0x510a('0x43')](_0x2be63c+_0x510a('0x49'),_0xb40e2f['id'][_0x510a('0x42')]())))[_0x510a('0x42')]();return _0x2b0864;};function _0x1e2265(_0x273c03,_0x524d72){var _0x552309=squel[_0x510a('0x37')]()[_0x510a('0x4d')]('cm_hopper')[_0x510a('0x39')]([_0x510a('0x20'),_0x510a('0x3a'),_0x510a('0x3b'),_0x510a('0x3c'),_0x524d72,_0x510a('0x3d'),_0x510a('0x3e')],squel['select']()[_0x510a('0x40')](_0x510a('0x20'),_0x510a('0x20'))[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3a'))['field']('id','ContactId')[_0x510a('0x40')](LISTID[_0x510a('0x42')](),_0x510a('0x3c'))[_0x510a('0x40')](_0x273c03['id'][_0x510a('0x42')](),_0x524d72)[_0x510a('0x40')]('NOW()',_0x510a('0x3d'))['field'](_0x510a('0x41'),_0x510a('0x3e'))[_0x510a('0x48')](_0x510a('0x4a'))[_0x510a('0x43')](_0x510a('0x44'))[_0x510a('0x43')](_0x510a('0x45'),LISTID['toString']())[_0x510a('0x43')](_0x510a('0x4b'),squel['str'](hopperContacts))[_0x510a('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x510a('0x42')]();return _0x552309;}function _0x4856f5(_0x5ca4e0,_0x3a57c6){var _0x4efe26=squel[_0x510a('0x37')]()[_0x510a('0x4d')](_0x510a('0x4e'))[_0x510a('0x39')]([_0x510a('0x20'),_0x510a('0x3b'),_0x510a('0x3c'),_0x3a57c6,_0x510a('0x3d'),_0x510a('0x3e')],squel[_0x510a('0x3f')]()['field'](_0x510a('0x20'),'phone')[_0x510a('0x40')]('id',_0x510a('0x3b'))[_0x510a('0x40')](LISTID['toString'](),'ListId')[_0x510a('0x40')](_0x5ca4e0['id']['toString'](),_0x3a57c6)[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3d'))[_0x510a('0x40')](_0x510a('0x41'),_0x510a('0x3e'))[_0x510a('0x48')](_0x510a('0x4a'))[_0x510a('0x43')]('deletedAt\x20IS\x20NULL')[_0x510a('0x43')](_0x510a('0x45'),LISTID[_0x510a('0x42')]())[_0x510a('0x43')](_0x510a('0x4b'),squel[_0x510a('0x4f')](hopperContacts))[_0x510a('0x43')]('phone\x20IS\x20NOT\x20NULL'))[_0x510a('0x42')]();return _0x4efe26;}return db[_0x510a('0x50')][_0x510a('0x51')]({'where':{'type':_0x510a('0x52')},'attributes':['id',_0x510a('0x53')],'include':[{'model':db[_0x510a('0x54')],'as':_0x510a('0x55'),'where':{'id':LISTID}}]})[_0x510a('0x2e')](function(_0x4e814d){var _0x2cffd3=[];if(_0x4e814d){var _0xa26fa9;for(var _0x49c5fa=0x0,_0x1efa34;_0x49c5fa<_0x4e814d[_0x510a('0x28')];_0x49c5fa+=0x1){_0x1efa34=_0x4e814d[_0x49c5fa]['get']({'plain':!![]});switch(_0x1efa34[_0x510a('0x53')]){case _0x510a('0x56'):_0x2cffd3['push'](db[_0x510a('0x57')][_0x510a('0x58')](_0x6d6eee(_0x1efa34,_0x510a('0x59')))[_0x510a('0x2e')](function(){})[_0x510a('0x31')](_0x5bcea5()));break;case'onlyIfOpen':_0x2cffd3[_0x510a('0x2f')](db[_0x510a('0x57')][_0x510a('0x58')](_0x15f385(_0x1efa34,_0x510a('0x59')))[_0x510a('0x2e')](function(){})[_0x510a('0x31')](_0x5bcea5()));break;default:_0x2cffd3['push'](db[_0x510a('0x57')][_0x510a('0x58')](_0x1e2265(_0x1efa34,'VoiceQueueId'))[_0x510a('0x2e')](function(){})['catch'](_0x5bcea5()));}}}return _0x2cffd3;})[_0x510a('0x5a')]()[_0x510a('0x2e')](function(){return db[_0x510a('0x50')][_0x510a('0x51')]({'where':{'type':_0x510a('0x52')},'attributes':['id'],'include':[{'model':db[_0x510a('0x54')],'as':_0x510a('0x5b'),'where':{'id':LISTID}}]})[_0x510a('0x2e')](function(_0x1dfb76){var _0x3addb7=[];if(_0x1dfb76){var _0xf4b503;for(var _0x2df677=0x0,_0x1fe5e9;_0x2df677<_0x1dfb76[_0x510a('0x28')];_0x2df677+=0x1){_0x1fe5e9=_0x1dfb76[_0x2df677]['get']({'plain':!![]});_0x3addb7[_0x510a('0x2f')](db[_0x510a('0x57')]['query'](_0x4856f5(_0x1fe5e9,_0x510a('0x59')))[_0x510a('0x2e')](function(){})[_0x510a('0x31')](_0x5bcea5()));}}return _0x3addb7;})[_0x510a('0x5a')]();})['then'](function(){return db[_0x510a('0x5c')][_0x510a('0x51')]({'attributes':['id',_0x510a('0x53')],'include':[{'model':db[_0x510a('0x54')],'as':_0x510a('0x55'),'where':{'id':LISTID}}]})[_0x510a('0x2e')](function(_0x4fe7fc){var _0x5a4042=[];if(_0x4fe7fc){for(var _0x4f3f62=0x0,_0x3beaf6;_0x4f3f62<_0x4fe7fc[_0x510a('0x28')];_0x4f3f62+=0x1){_0x3beaf6=_0x4fe7fc[_0x4f3f62][_0x510a('0x5d')]({'plain':!![]});switch(_0x3beaf6[_0x510a('0x53')]){case'always':_0x5a4042[_0x510a('0x2f')](db[_0x510a('0x57')][_0x510a('0x58')](_0x6d6eee(_0x3beaf6,'CampaignId'))['then'](function(){})[_0x510a('0x31')](_0x5bcea5()));break;case _0x510a('0x5e'):_0x5a4042[_0x510a('0x2f')](db['sequelize']['query'](_0x15f385(_0x3beaf6,_0x510a('0x5f')))['then'](function(){})[_0x510a('0x31')](_0x5bcea5()));break;default:_0x5a4042[_0x510a('0x2f')](db[_0x510a('0x57')][_0x510a('0x58')](_0x1e2265(_0x3beaf6,_0x510a('0x5f')))[_0x510a('0x2e')](function(){})[_0x510a('0x31')](_0x5bcea5()));}}}return _0x5a4042;})['all']();})[_0x510a('0x2e')](function(){return db['Campaign'][_0x510a('0x51')]({'attributes':['id'],'include':[{'model':db[_0x510a('0x54')],'as':_0x510a('0x5b'),'where':{'id':LISTID}}]})[_0x510a('0x2e')](function(_0x9e306e){var _0xd5697f=[];if(_0x9e306e){for(var _0x2dc377=0x0,_0xe6c0fb;_0x2dc377<_0x9e306e[_0x510a('0x28')];_0x2dc377+=0x1){_0xe6c0fb=_0x9e306e[_0x2dc377]['get']({'plain':!![]});_0xd5697f[_0x510a('0x2f')](db[_0x510a('0x57')][_0x510a('0x58')](_0x4856f5(_0xe6c0fb,'CampaignId'))[_0x510a('0x2e')](function(){})[_0x510a('0x31')](_0x5bcea5()));}}return _0xd5697f;})[_0x510a('0x5a')]();})['catch'](function(_0x599ef1){logger['error'](_0x510a('0x60'),'generalCheckHopper',_0x599ef1[_0x510a('0x1b')]);});}var processPromises=function(_0x4e0f82){return BPromise[_0x510a('0x5a')](promises)[_0x510a('0x2e')](function(_0x13a184){})['catch'](function(_0x4bf45d){logger[_0x510a('0x17')]('Error\x20processing\x20rows\x20block:',JSON[_0x510a('0x33')](_0x4bf45d));})[_0x510a('0x61')](function(){socket[_0x510a('0x62')](_0x510a('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4e0f82){return _0x4e0f82[_0x510a('0x64')]();}});};var endCsv=function(){return BPromise[_0x510a('0x65')]()[_0x510a('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x510a('0x2e')](function(){socket[_0x510a('0x62')](_0x510a('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x510a('0x66')](FILEPATH);}catch(_0xa74c0e){logger['error'](_0x510a('0x67'),JSON[_0x510a('0x33')](_0xa74c0e));}finally{process[_0x510a('0x68')](0x0);}});};process['on'](_0x510a('0x69'),function(){logger[_0x510a('0x6a')](_0x510a('0x6b'));endCsv();});function main(){return BPromise[_0x510a('0x65')]()[_0x510a('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x510a('0x10')](',');return db[_0x510a('0x2b')][_0x510a('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x510a('0x2e')](function(_0x2f2587){var _0x185b92=fs[_0x510a('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x185b92,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3cbdd4,_0xd55ad3){total+=0x1;var _0xbd5527=total;promises[_0x510a('0x2f')](checkRow(_0x3cbdd4,_0x2f2587,_0xbd5527)[_0x510a('0x2e')](function(){success+=0x1;})[_0x510a('0x31')](function(_0x346e53){if(_0x346e53[_0x510a('0x17')]){errors+=0x1;delete _0x346e53[_0x510a('0x17')];}else if(_0x346e53[_0x510a('0x6d')]){duplicates+=0x1;delete _0x346e53[_0x510a('0x6d')];}rows[_0x510a('0x2f')](_0x346e53);}));if(total%0xc8===0x0){_0xd55ad3['pause']();return processPromises(_0xd55ad3);}},'complete':function(){return processPromises()[_0x510a('0x2e')](function(){logger[_0x510a('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5679d2,_0x3eb3f9){logger['info'](_0x510a('0x6e'),JSON[_0x510a('0x33')](_0x5679d2));endCsv();}});})[_0x510a('0x31')](function(_0x2c14bf){logger[_0x510a('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x2c14bf));});}main(); \ No newline at end of file +var _0x2b38=['finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parse\x20error','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','str','calleridnum','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','outbound','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:'];(function(_0x2a5256,_0x5800ec){var _0x4119c7=function(_0x36e1b8){while(--_0x36e1b8){_0x2a5256['push'](_0x2a5256['shift']());}};_0x4119c7(++_0x5800ec);}(_0x2b38,0x1b4));var _0x82b3=function(_0x27cf4c,_0x52d773){_0x27cf4c=_0x27cf4c-0x0;var _0x263735=_0x2b38[_0x27cf4c];return _0x263735;};'use strict';var BPromise=require('bluebird');var util=require(_0x82b3('0x0'));var _=require(_0x82b3('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x82b3('0x2'));var Redis=require(_0x82b3('0x3'));var db=require(_0x82b3('0x4'))['db'];var config=require(_0x82b3('0x5'));var logger=require(_0x82b3('0x6'))(_0x82b3('0x7'));config[_0x82b3('0x8')]=_[_0x82b3('0x9')](config[_0x82b3('0x8')],{'host':_0x82b3('0xa'),'port':0x18eb});var socket=require(_0x82b3('0xb'))(new Redis(config[_0x82b3('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x82b3('0xc')](socket);try{if(!process[_0x82b3('0xd')][0x2]||process['argv'][0x2]==='undefined'||process['argv'][0x2]===_0x82b3('0xe')){throw new Error(_0x82b3('0xf'));}var FILEPATH=process[_0x82b3('0xd')][0x2];if(!process['argv'][0x3]||process[_0x82b3('0xd')][0x3]===_0x82b3('0x10')||process[_0x82b3('0xd')][0x3]===_0x82b3('0xe')||!process[_0x82b3('0xd')][0x4]||process[_0x82b3('0xd')][0x4]===_0x82b3('0x10')||process['argv'][0x4]===_0x82b3('0xe')){throw new Error(_0x82b3('0x11'));}var FIELDS=_['zipObject'](process[_0x82b3('0xd')][0x3][_0x82b3('0x12')](','),process[_0x82b3('0xd')][0x4][_0x82b3('0x12')](','));if(!process['argv'][0x5]||process[_0x82b3('0xd')][0x5]===_0x82b3('0x10')||process[_0x82b3('0xd')][0x5]==='null'){throw new Error(_0x82b3('0x13'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x82b3('0xd')][0x6]!==_0x82b3('0x10')&&process['argv'][0x6]!==_0x82b3('0xe')?process[_0x82b3('0xd')][0x6]:null;var DUPLICATES=process[_0x82b3('0xd')][0x7]&&process[_0x82b3('0xd')][0x7]!==_0x82b3('0x10')&&process[_0x82b3('0xd')][0x7]!==_0x82b3('0xe')?process[_0x82b3('0xd')][0x7]:null;if(!process[_0x82b3('0xd')][0x8]||process[_0x82b3('0xd')][0x8]===_0x82b3('0x10')||process[_0x82b3('0xd')][0x8]===_0x82b3('0xe')){throw new Error(_0x82b3('0x14'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xc81163){logger[_0x82b3('0x15')](_0xc81163);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(_0x332783,_0x3220fa,_0x53557a,_0x55b11a){var _0x39b15f={'message':_0x3220fa};_0x39b15f[_0x332783]=!![];if(_0x53557a){_0x39b15f['contact']=_0x53557a;}if(_0x55b11a){_0x39b15f['index']=_0x55b11a;}return _0x39b15f;}function isEmail(_0xca6b){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'](_0xca6b);}function checkRow(_0x589b9c,_0x222bd3,_0x289386){return new BPromise(function(_0x177087,_0x40c677){if(_[_0x82b3('0x16')](_0x589b9c)){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x17'),null,_0x289386));}if(_0x589b9c[_0x82b3('0x18')]&&_0x589b9c[_0x82b3('0x18')][_0x82b3('0x19')]){var _0x4c46e8=_[_0x82b3('0x1a')](_0x589b9c[_0x82b3('0x18')],_0x82b3('0x1b'))['join'](';');return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x4c46e8,null,_0x289386));}var _0x1d3af7={};for(var _0xb66017 in FIELDS){if(FIELDS[_0x82b3('0x1c')](_0xb66017)&&FIELDS[_0xb66017]){_0x1d3af7[_0xb66017]=_0x589b9c[_0x82b3('0x1d')][0x0][FIELDS[_0xb66017]]||_0x589b9c[_0x82b3('0x1d')][0x0]['\ufeff'+FIELDS[_0xb66017]];}}if(!_0x1d3af7[_0x82b3('0x1e')]){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x1f'),null,_0x289386));}if(!_0x1d3af7[_0x82b3('0x20')]){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x21'),null,_0x289386));}if(_0x1d3af7[_0x82b3('0x22')]){var _0x31b08f=moment(_0x1d3af7[_0x82b3('0x22')],'YYYY-MM-DD');if(!_0x31b08f[_0x82b3('0x23')]()){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x24'),null,_0x289386));}}if(_0x1d3af7[_0x82b3('0x25')]){if(!isEmail(_0x1d3af7[_0x82b3('0x25')])){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x26'),null,_0x289386));}}_0x1d3af7[_0x82b3('0x27')]=LISTID;_0x1d3af7[_0x82b3('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x82b3('0x19')]&&_0x222bd3){var _0x5d5fc3={};for(var _0x98d385=0x0,_0x412bd5=DUPLICATES['length'];_0x98d385<_0x412bd5;_0x98d385+=0x1){_0x5d5fc3[DUPLICATES[_0x98d385]]=_0x1d3af7[DUPLICATES[_0x98d385]];}var _0x2bc0c2=_[_0x82b3('0x29')](_0x222bd3,_0x5d5fc3);if(_0x2bc0c2){return _0x40c677(handleCheckRowError(_0x82b3('0x2a'),'Duplicate\x20Contact',_0x2bc0c2,_0x289386));}}return db['CmContact']['create'](_0x1d3af7,{'raw':!![],'hooks':![],'fields':_[_0x82b3('0x2b')](_0x1d3af7)})[_0x82b3('0x2c')](function(_0x3a7f17){if(DUPLICATES&&DUPLICATES[_0x82b3('0x19')]&&_0x222bd3){_0x222bd3['push'](_[_0x82b3('0x2d')](_0x1d3af7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3a7f17['id'];return _0x177087();})[_0x82b3('0x2e')](function(_0x48305c){return _0x40c677(handleCheckRowError(_0x82b3('0x15'),_0x82b3('0x2f')+(_0x48305c[_0x82b3('0x1b')]||JSON[_0x82b3('0x30')](_0x48305c)),null,_0x289386));});});}function checkHopper(){function _0x26e784(){return function(_0x52062b){logger[_0x82b3('0x15')]('cmContact',_0x82b3('0x31'),util[_0x82b3('0x32')](_0x52062b,{'showHidden':![],'depth':null}));};}var _0x588c10=function(_0x54036f,_0x567833){var _0x16a4f8=squel[_0x82b3('0x33')]()['into'](_0x82b3('0x34'))[_0x82b3('0x35')]([_0x82b3('0x20'),_0x82b3('0x36'),_0x82b3('0x37'),_0x82b3('0x27'),_0x567833,_0x82b3('0x38'),_0x82b3('0x39')],squel[_0x82b3('0x3a')]()[_0x82b3('0x3b')]('phone',_0x82b3('0x20'))[_0x82b3('0x3b')]('NOW()','scheduledAt')[_0x82b3('0x3b')]('id','ContactId')[_0x82b3('0x3b')](LISTID['toString'](),_0x82b3('0x27'))[_0x82b3('0x3b')](_0x54036f['id'][_0x82b3('0x3c')](),_0x567833)['field'](_0x82b3('0x3d'),_0x82b3('0x38'))['field'](_0x82b3('0x3d'),'updatedAt')[_0x82b3('0x3e')](_0x82b3('0x3f'))[_0x82b3('0x40')](_0x82b3('0x41'))[_0x82b3('0x40')](_0x82b3('0x42'),LISTID[_0x82b3('0x3c')]())['where'](_0x82b3('0x43'))[_0x82b3('0x40')](_0x82b3('0x44'),squel[_0x82b3('0x3a')]()['field'](_0x82b3('0x20'))[_0x82b3('0x3e')](_0x82b3('0x34'))[_0x82b3('0x40')](_0x567833+_0x82b3('0x45'),_0x54036f['id'][_0x82b3('0x3c')]())))[_0x82b3('0x3c')]();return _0x16a4f8;};var _0x38beea=function(_0x33187e,_0x59be76){var _0x172c17=squel[_0x82b3('0x33')]()[_0x82b3('0x46')]('cm_hopper')[_0x82b3('0x35')]([_0x82b3('0x20'),_0x82b3('0x36'),'ContactId',_0x82b3('0x27'),_0x59be76,'createdAt',_0x82b3('0x39')],squel['select']()[_0x82b3('0x3b')]('phone',_0x82b3('0x20'))[_0x82b3('0x3b')](_0x82b3('0x3d'),_0x82b3('0x36'))[_0x82b3('0x3b')]('id',_0x82b3('0x37'))[_0x82b3('0x3b')](LISTID[_0x82b3('0x3c')](),_0x82b3('0x27'))[_0x82b3('0x3b')](_0x33187e['id']['toString'](),_0x59be76)[_0x82b3('0x3b')](_0x82b3('0x3d'),_0x82b3('0x38'))[_0x82b3('0x3b')](_0x82b3('0x3d'),'updatedAt')[_0x82b3('0x3e')](_0x82b3('0x3f'))['where'](_0x82b3('0x41'))[_0x82b3('0x40')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x82b3('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0x82b3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x82b3('0x3a')]()['field'](_0x82b3('0x48'))[_0x82b3('0x3e')]('cm_hopper_final')['where'](_0x59be76+_0x82b3('0x45'),_0x33187e['id'][_0x82b3('0x3c')]()))[_0x82b3('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x82b3('0x3a')]()[_0x82b3('0x3b')](_0x82b3('0x20'))[_0x82b3('0x3e')](_0x82b3('0x34'))[_0x82b3('0x40')](_0x59be76+_0x82b3('0x45'),_0x33187e['id']['toString']())))[_0x82b3('0x3c')]();return _0x172c17;};function _0x381d8e(_0x388871,_0x4ee759){var _0x32e144=squel[_0x82b3('0x33')]()['into']('cm_hopper')[_0x82b3('0x35')]([_0x82b3('0x20'),_0x82b3('0x36'),_0x82b3('0x37'),'ListId',_0x4ee759,_0x82b3('0x38'),_0x82b3('0x39')],squel[_0x82b3('0x3a')]()[_0x82b3('0x3b')](_0x82b3('0x20'),'phone')[_0x82b3('0x3b')](_0x82b3('0x3d'),_0x82b3('0x36'))[_0x82b3('0x3b')]('id',_0x82b3('0x37'))['field'](LISTID[_0x82b3('0x3c')](),_0x82b3('0x27'))[_0x82b3('0x3b')](_0x388871['id']['toString'](),_0x4ee759)[_0x82b3('0x3b')](_0x82b3('0x3d'),'createdAt')['field']('NOW()',_0x82b3('0x39'))[_0x82b3('0x3e')](_0x82b3('0x3f'))['where'](_0x82b3('0x41'))['where'](_0x82b3('0x42'),LISTID['toString']())[_0x82b3('0x40')](_0x82b3('0x49'),squel[_0x82b3('0x47')](hopperContacts))['where'](_0x82b3('0x43')))[_0x82b3('0x3c')]();return _0x32e144;}function _0x4e9b3a(_0x5c3575,_0xa0cdff){var _0x377e60=squel[_0x82b3('0x33')]()[_0x82b3('0x46')](_0x82b3('0x4a'))[_0x82b3('0x35')]([_0x82b3('0x20'),_0x82b3('0x37'),'ListId',_0xa0cdff,_0x82b3('0x38'),_0x82b3('0x39')],squel[_0x82b3('0x3a')]()[_0x82b3('0x3b')](_0x82b3('0x20'),_0x82b3('0x20'))['field']('id',_0x82b3('0x37'))['field'](LISTID[_0x82b3('0x3c')](),_0x82b3('0x27'))['field'](_0x5c3575['id']['toString'](),_0xa0cdff)['field']('NOW()',_0x82b3('0x38'))[_0x82b3('0x3b')](_0x82b3('0x3d'),_0x82b3('0x39'))['from'](_0x82b3('0x3f'))[_0x82b3('0x40')]('deletedAt\x20IS\x20NULL')[_0x82b3('0x40')](_0x82b3('0x42'),LISTID[_0x82b3('0x3c')]())[_0x82b3('0x40')](_0x82b3('0x49'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x82b3('0x3c')]();return _0x377e60;}return db[_0x82b3('0x4b')][_0x82b3('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x82b3('0x4d')],'include':[{'model':db[_0x82b3('0x4e')],'as':_0x82b3('0x4f'),'where':{'id':LISTID}}]})[_0x82b3('0x2c')](function(_0x100514){var _0x3c0729=[];if(_0x100514){var _0x519cd1;for(var _0x1583fe=0x0,_0x5668c1;_0x1583fe<_0x100514['length'];_0x1583fe+=0x1){_0x5668c1=_0x100514[_0x1583fe]['get']({'plain':!![]});switch(_0x5668c1[_0x82b3('0x4d')]){case _0x82b3('0x50'):_0x3c0729[_0x82b3('0x51')](db[_0x82b3('0x52')][_0x82b3('0x53')](_0x38beea(_0x5668c1,'VoiceQueueId'))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));break;case _0x82b3('0x54'):_0x3c0729[_0x82b3('0x51')](db['sequelize'][_0x82b3('0x53')](_0x588c10(_0x5668c1,_0x82b3('0x55')))['then'](function(){})['catch'](_0x26e784()));break;default:_0x3c0729[_0x82b3('0x51')](db['sequelize']['query'](_0x381d8e(_0x5668c1,'VoiceQueueId'))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));}}}return _0x3c0729;})[_0x82b3('0x56')]()[_0x82b3('0x2c')](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0x82b3('0x57')},'attributes':['id'],'include':[{'model':db[_0x82b3('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x82b3('0x2c')](function(_0xb06123){var _0x5a8dcc=[];if(_0xb06123){var _0x4b11c4;for(var _0x31325f=0x0,_0x25ea69;_0x31325f<_0xb06123[_0x82b3('0x19')];_0x31325f+=0x1){_0x25ea69=_0xb06123[_0x31325f][_0x82b3('0x58')]({'plain':!![]});_0x5a8dcc[_0x82b3('0x51')](db[_0x82b3('0x52')]['query'](_0x4e9b3a(_0x25ea69,_0x82b3('0x55')))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));}}return _0x5a8dcc;})[_0x82b3('0x56')]();})[_0x82b3('0x2c')](function(){return db[_0x82b3('0x59')][_0x82b3('0x4c')]({'attributes':['id',_0x82b3('0x4d')],'include':[{'model':db[_0x82b3('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x82b3('0x2c')](function(_0x2569d5){var _0x1779c7=[];if(_0x2569d5){for(var _0xb0b225=0x0,_0x2a8bf6;_0xb0b225<_0x2569d5[_0x82b3('0x19')];_0xb0b225+=0x1){_0x2a8bf6=_0x2569d5[_0xb0b225][_0x82b3('0x58')]({'plain':!![]});switch(_0x2a8bf6['dialCheckDuplicateType']){case _0x82b3('0x50'):_0x1779c7[_0x82b3('0x51')](db[_0x82b3('0x52')][_0x82b3('0x53')](_0x38beea(_0x2a8bf6,'CampaignId'))['then'](function(){})['catch'](_0x26e784()));break;case _0x82b3('0x54'):_0x1779c7[_0x82b3('0x51')](db[_0x82b3('0x52')]['query'](_0x588c10(_0x2a8bf6,_0x82b3('0x5a')))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));break;default:_0x1779c7[_0x82b3('0x51')](db[_0x82b3('0x52')][_0x82b3('0x53')](_0x381d8e(_0x2a8bf6,'CampaignId'))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));}}}return _0x1779c7;})['all']();})['then'](function(){return db[_0x82b3('0x59')][_0x82b3('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x82b3('0x4e')],'as':_0x82b3('0x5b'),'where':{'id':LISTID}}]})[_0x82b3('0x2c')](function(_0x541e07){var _0x1836b3=[];if(_0x541e07){for(var _0x444c2f=0x0,_0x508b3c;_0x444c2f<_0x541e07[_0x82b3('0x19')];_0x444c2f+=0x1){_0x508b3c=_0x541e07[_0x444c2f]['get']({'plain':!![]});_0x1836b3[_0x82b3('0x51')](db[_0x82b3('0x52')][_0x82b3('0x53')](_0x4e9b3a(_0x508b3c,_0x82b3('0x5a')))[_0x82b3('0x2c')](function(){})[_0x82b3('0x2e')](_0x26e784()));}}return _0x1836b3;})['all']();})[_0x82b3('0x2e')](function(_0x435d02){logger[_0x82b3('0x15')](_0x82b3('0x5c'),'generalCheckHopper',_0x435d02[_0x82b3('0x1b')]);});}var processPromises=function(_0x47d2ab){return BPromise['all'](promises)[_0x82b3('0x2c')](function(_0x47433f){})[_0x82b3('0x2e')](function(_0xaedcc4){logger[_0x82b3('0x15')](_0x82b3('0x5d'),JSON[_0x82b3('0x30')](_0xaedcc4));})[_0x82b3('0x5e')](function(){socket[_0x82b3('0x5f')](_0x82b3('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x47d2ab){return _0x47d2ab['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x82b3('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x82b3('0x61')](FILEPATH);}catch(_0x2c880c){logger[_0x82b3('0x15')](_0x82b3('0x62'),JSON[_0x82b3('0x30')](_0x2c880c));}finally{process[_0x82b3('0x63')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x82b3('0x64'));endCsv();});function main(){return BPromise['resolve']()[_0x82b3('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x3fa21c){var _0x541797=fs[_0x82b3('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x82b3('0x66')](_0x541797,{'header':!![],'skipEmptyLines':!![],'step':function(_0x170d0a,_0x20714b){total+=0x1;var _0x4b9f97=total;promises[_0x82b3('0x51')](checkRow(_0x170d0a,_0x3fa21c,_0x4b9f97)[_0x82b3('0x2c')](function(){success+=0x1;})[_0x82b3('0x2e')](function(_0x5beff1){if(_0x5beff1[_0x82b3('0x15')]){errors+=0x1;delete _0x5beff1[_0x82b3('0x15')];}else if(_0x5beff1[_0x82b3('0x2a')]){duplicates+=0x1;delete _0x5beff1[_0x82b3('0x2a')];}rows[_0x82b3('0x51')](_0x5beff1);}));if(total%0xc8===0x0){_0x20714b[_0x82b3('0x67')]();return processPromises(_0x20714b);}},'complete':function(){return processPromises()[_0x82b3('0x2c')](function(){logger[_0x82b3('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1fe2b9,_0x54c073){logger[_0x82b3('0x68')](_0x82b3('0x69'),JSON['stringify'](_0x1fe2b9));endCsv();}});})[_0x82b3('0x2e')](function(_0x2f0348){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x82b3('0x30')](_0x2f0348));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f35eb63..0154511 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 _0x7ba7=['YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','into','cm_hopper_black','fields','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','push','code','message','sequelize','query','spread','catch','stringify','binding','root','server/files/tmp','.csv','header','writeFileSync','data','length','rows','errors','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','\x20not\x20specified','appendFileSync','contact:import:','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','CampaignId','then','finish','affectedRows','emit','unlink','exit','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter'];(function(_0x45394a,_0xd98fae){var _0x3acea6=function(_0x3851ef){while(--_0x3851ef){_0x45394a['push'](_0x45394a['shift']());}};_0x3acea6(++_0xd98fae);}(_0x7ba7,0xf3));var _0x77ba=function(_0x36d11c,_0x6dffa7){_0x36d11c=_0x36d11c-0x0;var _0xd95b50=_0x7ba7[_0x36d11c];return _0xd95b50;};'use strict';var fs=require('fs');var path=require(_0x77ba('0x0'));var _=require(_0x77ba('0x1'));var Papa=require(_0x77ba('0x2'));var util=require(_0x77ba('0x3'));var BPromise=require(_0x77ba('0x4'));var moment=require(_0x77ba('0x5'));var squel=require('squel');var Redis=require(_0x77ba('0x6'));var db=require(_0x77ba('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x77ba('0x8'))('import');config[_0x77ba('0x9')]=_[_0x77ba('0xa')](config[_0x77ba('0x9')],{'host':_0x77ba('0xb'),'port':0x18eb});var socket=require(_0x77ba('0xc'))(new Redis(config[_0x77ba('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x77ba('0xd'));function isEmail(_0x3ef960){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))*$/[_0x77ba('0xe')](_0x3ef960);}function selectNotIn(_0x18c0ce,_0x203f5f,_0x4fd405,_0x21fc75,_0x4c6f8d){return squel[_0x77ba('0xf')]()[_0x77ba('0x10')](_0x77ba('0x11'))[_0x77ba('0x12')](_0x21fc75)['join'](_0x203f5f,null,_0x203f5f+'.id\x20=\x20'+_0x21fc75+'.'+_0x4fd405)[_0x77ba('0x13')](_0x21fc75+'.'+_0x4fd405+_0x77ba('0x14')+_0x18c0ce+'.'+_0x4fd405)['where'](_0x203f5f+_0x77ba('0x15')+_0x4c6f8d[_0x77ba('0x16')]()+')');}function insertCmHopper(_0x19ed7a,_0x5b6dce,_0x1dd74a,_0x29d677,_0x512e99){var _0x3ab6d9=[_0x77ba('0x17'),_0x77ba('0x18'),_0x77ba('0x19'),_0x77ba('0x1a'),_0x5b6dce+'.'+_0x29d677,_0x77ba('0x1b'),_0x77ba('0x1c'),_0x77ba('0x1d'),'cm_contacts.UserId','\x22'+_0x512e99+'\x22'];return squel[_0x77ba('0x1e')]()['into'](_0x77ba('0x1f'))[_0x77ba('0x20')](['phone',_0x77ba('0x21'),_0x77ba('0x22'),_0x77ba('0x23'),_0x29d677,_0x77ba('0x24'),_0x77ba('0x25'),_0x77ba('0x26'),'UserId',_0x77ba('0x27')],squel[_0x77ba('0xf')]()['fields'](_0x3ab6d9)[_0x77ba('0x12')](_0x5b6dce)[_0x77ba('0x16')](_0x77ba('0x28'),null,_0x77ba('0x29')+_0x5b6dce+'.CmListId')[_0x77ba('0x16')](_0x1dd74a,null,_0x1dd74a+_0x77ba('0x2a')+_0x5b6dce+'.'+_0x29d677)['where'](_0x5b6dce+_0x77ba('0x2b'),_0x19ed7a)[_0x77ba('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x77ba('0x2c'),selectNotIn(_0x5b6dce,_0x1dd74a,_0x29d677,'cm_hopper',[_0x77ba('0x2d'),'\x22onlyIfOpen\x22']))['where'](_0x77ba('0x2c'),selectNotIn(_0x5b6dce,_0x1dd74a,_0x29d677,'cm_hopper',['\x22always\x22'])))[_0x77ba('0x2e')]();}function insertCmHopperBlack(_0x3f3a24,_0x367ab3,_0x36e2be,_0x306730){var _0x218057=['cm_contacts.phone',_0x77ba('0x19'),_0x77ba('0x1a'),_0x367ab3+'.'+_0x306730,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x77ba('0x1e')]()[_0x77ba('0x2f')](_0x77ba('0x30'))[_0x77ba('0x20')]([_0x77ba('0x11'),_0x77ba('0x22'),_0x77ba('0x23'),_0x306730,_0x77ba('0x24'),_0x77ba('0x25')],squel[_0x77ba('0xf')]()[_0x77ba('0x31')](_0x218057)[_0x77ba('0x12')](_0x367ab3)[_0x77ba('0x16')]('cm_contacts',null,_0x77ba('0x29')+_0x367ab3+'.CmListId')[_0x77ba('0x16')](_0x36e2be,null,_0x36e2be+_0x77ba('0x2a')+_0x367ab3+'.'+_0x306730)[_0x77ba('0x13')](_0x367ab3+_0x77ba('0x2b'),_0x3f3a24)[_0x77ba('0x13')](_0x77ba('0x32'),NOW)['where'](_0x77ba('0x2c'),squel[_0x77ba('0xf')]()['field'](_0x77ba('0x11'))[_0x77ba('0x12')](_0x77ba('0x30'))[_0x77ba('0x13')](_0x77ba('0x33'),_0x3f3a24)[_0x77ba('0x13')](_0x306730+_0x77ba('0x34'),_0x367ab3+'.'+_0x306730)))[_0x77ba('0x2e')]();}function insertCmContact(_0x566748,_0x2e71e5,_0x108aed,_0x5d131a){var _0x16ca1a=_['concat'](_[_0x77ba('0x35')](_0x5d131a),[_0x77ba('0x23'),_0x77ba('0x36'),_0x77ba('0x24'),_0x77ba('0x25')]);return squel['insert']()[_0x77ba('0x2f')](_0x77ba('0x28'))[_0x77ba('0x20')](_0x16ca1a,squel['select']()[_0x77ba('0x31')](_0x16ca1a)['from'](_0x2e71e5)['where']('('+_0x108aed[_0x77ba('0x16')](',')+_0x77ba('0x37'),squel[_0x77ba('0xf')]()[_0x77ba('0x31')](_0x108aed)[_0x77ba('0x12')](_0x77ba('0x28'))[_0x77ba('0x13')](_0x77ba('0x33'),_0x566748)['where'](_0x77ba('0x38')))['where'](_0x77ba('0x39'),squel['select']()[_0x77ba('0x10')](_0x77ba('0x3a'),_0x77ba('0x3b'))[_0x77ba('0x12')](_0x2e71e5)[_0x77ba('0x3c')](_0x108aed[_0x77ba('0x16')](','))))['toString']();}function handleStop(){logger[_0x77ba('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x1b0e75){logger[_0x77ba('0x3e')](_0x1b0e75['message']);process['exit'](0x1);}function handleError(_0x3e0334,_0x5f37e2){stats['errors'][_0x77ba('0x3f')]({'name':_0x5f37e2[_0x77ba('0x40')],'message':_0x5f37e2[_0x77ba('0x41')],'row':_0x3e0334});}function handleQuery(_0xb2bc53){logger['info'](_0xb2bc53);return db[_0x77ba('0x42')][_0x77ba('0x43')](_0xb2bc53)[_0x77ba('0x44')](function(_0x17a709){results[_0x77ba('0x3f')](_0x17a709);})[_0x77ba('0x45')](function(_0x2cba30){logger[_0x77ba('0x3e')](_0x2cba30[_0x77ba('0x41')]);});}function main(_0xb3c5d3,_0x79e182,_0x2c6277,_0x287200){logger['info']('main',_0xb3c5d3,JSON[_0x77ba('0x46')](_0x79e182));process['send']('start');var _0x42fc0f=_0x79e182[_0x77ba('0x47')];var _0xd57de6=_0x79e182['socket_timestamp'];var _0x274b0e=path['join'](config[_0x77ba('0x48')],_0x77ba('0x49'),_0xd57de6+_0x77ba('0x4a'));var _0x79c883=_[_0x77ba('0x35')](_0x42fc0f)[_0x77ba('0x16')]();logger[_0x77ba('0x3d')](_0x77ba('0x4b'),_0x79c883);fs[_0x77ba('0x4c')](_0x274b0e,_0x79c883+'\x0a');Papa['parse'](fs['createReadStream'](_0xb3c5d3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3f6b65,_0x166734){try{for(var _0x55b468=0x0,_0x56a772=[];_0x55b468<_0x3f6b65[_0x77ba('0x4d')][_0x77ba('0x4e')];_0x55b468++){stats[_0x77ba('0x4f')]+=0x1;if(_0x3f6b65[_0x77ba('0x50')][_0x55b468]){handleError(_0x3f6b65[_0x77ba('0x4d')][_0x55b468],_0x3f6b65[_0x77ba('0x50')][_0x55b468]);}else{var _0x25a3a0=[];for(var _0x204b9c in _0x42fc0f){if(_0x42fc0f[_0x77ba('0x51')](_0x204b9c)){if(_0x3f6b65[_0x77ba('0x4d')][_0x55b468][_0x42fc0f[_0x204b9c]]){var _0x5363f1=_[_0x77ba('0x52')](_0x3f6b65['data'][_0x55b468][_0x42fc0f[_0x204b9c]][_0x77ba('0x53')](/"/g,'\x27'));switch(_0x204b9c){case _0x77ba('0x21'):var _0x4cd998=moment(_0x5363f1,_0x77ba('0xd'),!![]);if(_0x4cd998['isValid']()){_0x56a772[_0x77ba('0x3f')]('\x22'+_0x5363f1+'\x22');}else{_0x25a3a0[_0x77ba('0x3f')](_0x77ba('0x54'));}break;case _0x77ba('0x26'):var _0x42e74a=parseInt(_0x5363f1);_0x5363f1=_[_0x77ba('0x55')](_0x42e74a)||_0x42e74a<0x0||_0x42e74a>0x4?_0x287200?0x3:0x2:_0x42e74a;_0x56a772['push']('\x22'+_0x5363f1+'\x22');break;case _0x77ba('0x56'):var _0x35b773=parseInt(_0x5363f1);if(_[_0x77ba('0x57')](_0x35b773)&&_['includes'](_0x2c6277,_0x35b773)){_0x56a772[_0x77ba('0x3f')]('\x22'+_0x35b773+'\x22');}else{_0x25a3a0[_0x77ba('0x3f')](_0x77ba('0x58'));}break;case _0x77ba('0x59'):if(isEmail(_0x5363f1)){_0x56a772[_0x77ba('0x3f')]('\x22'+_0x5363f1+'\x22');}else{_0x25a3a0[_0x77ba('0x3f')](_0x77ba('0x5a'));}break;case _0x77ba('0x5b'):var _0x5c05b4=moment(_0x5363f1,_0x77ba('0x5c'),!![]);if(_0x5c05b4[_0x77ba('0x5d')]()){_0x56a772['push']('\x22'+_0x5363f1+'\x22');}else{_0x25a3a0[_0x77ba('0x3f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x56a772[_0x77ba('0x3f')]('\x22'+_0x5363f1+'\x22');}}else{switch(_0x204b9c){case'firstName':case _0x77ba('0x11'):_0x25a3a0[_0x77ba('0x3f')](_0x204b9c+_0x77ba('0x5e'));break;default:_0x56a772[_0x77ba('0x3f')]('\x22\x22');}}}}if(_0x25a3a0['length']){handleError(_0x3f6b65[_0x77ba('0x4d')][_0x55b468],{'code':'SystemRow','message':_0x25a3a0[_0x77ba('0x16')]()});}else{fs[_0x77ba('0x5f')](_0x274b0e,_0x56a772[_0x77ba('0x16')]()+'\x0a');}_0x56a772=[];}if(!(stats[_0x77ba('0x4f')]%0xc8)){socket['emit'](_0x77ba('0x60')+_0xd57de6,stats);stats[_0x77ba('0x50')]=[];}}if(stopped){logger[_0x77ba('0x3d')]('Abort\x20parser');_0x166734['abort']();}}catch(_0x324e84){handleError(_0x3f6b65[_0x77ba('0x4d')][_0x55b468],{'code':'SystemError','message':_0x324e84[_0x77ba('0x41')]});logger['error'](_0x77ba('0x61'),_0x324e84['message']);}},'complete':function(){try{var _0x533efd=[];var _0x40853e=_0x77ba('0x28');if(_0x79e182[_0x77ba('0x62')]&&_0x79e182[_0x77ba('0x62')]['length']){_0x40853e=_0x77ba('0x63')+_0xd57de6;_0x533efd[_0x77ba('0x3f')](_0x77ba('0x64')+_0x40853e+'\x20LIKE\x20cm_contacts;');}var _0x335aee=util[_0x77ba('0x65')](_0x77ba('0x66'),_0x274b0e,_0x40853e,_0x79c883,_0x79e182[_0x77ba('0x23')],_0x79e182[_0x77ba('0x36')]||null,NOW,NOW);if(_['isNil'](_0x42fc0f[_0x77ba('0x21')])){_0x335aee+=_0x77ba('0x67');}_0x533efd[_0x77ba('0x3f')](_0x335aee);if(_0x79e182['duplicates']&&_0x79e182[_0x77ba('0x62')][_0x77ba('0x4e')]){_0x533efd['push'](insertCmContact(_0x79e182[_0x77ba('0x23')],_0x40853e,_0x79e182[_0x77ba('0x62')],_0x42fc0f));_0x533efd['push']('DROP\x20TABLE\x20'+_0x40853e+';');}_0x533efd[_0x77ba('0x3f')](insertCmHopper(_0x79e182['ListId'],_0x77ba('0x68'),_0x77ba('0x69'),_0x77ba('0x6a'),_0x287200));_0x533efd['push'](insertCmHopperBlack(_0x79e182[_0x77ba('0x23')],'voice_queues_has_cm_blacklists',_0x77ba('0x69'),'VoiceQueueId'));_0x533efd[_0x77ba('0x3f')](insertCmHopper(_0x79e182[_0x77ba('0x23')],_0x77ba('0x6b'),'campaigns',_0x77ba('0x6c'),_0x287200));_0x533efd['push'](insertCmHopperBlack(_0x79e182['ListId'],'campaigns_has_cm_blacklists','campaigns',_0x77ba('0x6c')));BPromise['each'](_0x533efd,handleQuery)[_0x77ba('0x6d')](function(_0x249586){stats[_0x77ba('0x6e')]=!![];stats[_0x77ba('0x6f')]=_0x79e182['duplicates']&&_0x79e182[_0x77ba('0x62')][_0x77ba('0x4e')]?results[0x2][_0x77ba('0x6f')]:results[0x0][_0x77ba('0x6f')];socket[_0x77ba('0x70')](_0x77ba('0x60')+_0xd57de6,stats);fs[_0x77ba('0x71')](_0xb3c5d3);fs['unlink'](_0x274b0e);process[_0x77ba('0x72')](0x0);})[_0x77ba('0x45')](function(_0x47784d){logger[_0x77ba('0x3e')](_0x47784d[_0x77ba('0x41')]);process[_0x77ba('0x72')](0x1);});}catch(_0x4ffe2c){logger[_0x77ba('0x3e')]('complete',_0x4ffe2c['message']);process[_0x77ba('0x72')](0x1);}},'error':function(_0x2692d5,_0x162a75,_0x33ae5a,_0x13f684){throw new Error(_0x13f684);}});}function validate(){if(process[_0x77ba('0x73')]&&process[_0x77ba('0x73')][_0x77ba('0x4e')]<0x4){throw new Error(_0x77ba('0x74'));}var _0x27d9c5=path['join'](config[_0x77ba('0x48')],_0x77ba('0x49'),process[_0x77ba('0x73')][0x2]);if(!fs[_0x77ba('0x75')](_0x27d9c5)){throw new Error(_0x77ba('0x76'));}var _0x250628={};try{_0x250628=JSON[_0x77ba('0x77')](process[_0x77ba('0x73')][0x3]);if(!_0x250628['binding']){throw new Error(_0x77ba('0x78'));}if(!_0x250628[_0x77ba('0x47')][_0x77ba('0x11')]){throw new Error(_0x77ba('0x79'));}if(!_0x250628[_0x77ba('0x47')][_0x77ba('0x7a')]){throw new Error(_0x77ba('0x7b'));}var _0x44fa8a=0x0;if(_0x250628[_0x77ba('0x47')][_0x77ba('0x56')]){_0x44fa8a=0x1;}if(!_0x250628[_0x77ba('0x23')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x53a3bc){throw new Error(_0x77ba('0x7c'));}var _0x3541e8=[];try{_0x3541e8=_[_0x77ba('0x7d')](JSON['parse'](process[_0x77ba('0x73')][0x4]),'id');}catch(_0x535181){logger[_0x77ba('0x3d')]('No\x20agent\x20available');}main(_0x27d9c5,_0x250628,_0x3541e8,_0x44fa8a);}validate();process['on'](_0x77ba('0x7e'),handleStop);process['on'](_0x77ba('0x7f'),handleUncaughtException); \ No newline at end of file +var _0x7cef=['abort','SystemError','step','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',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.priority','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','updatedAt','.CmListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','into',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','push','code','sequelize','query','spread','catch','error','message','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7cef,0x12f));var _0xf7ce=function(_0x2eb1d7,_0x58d92e){_0x2eb1d7=_0x2eb1d7-0x0;var _0x11460e=_0x7cef[_0x2eb1d7];return _0x11460e;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xf7ce('0x0'));var Papa=require(_0xf7ce('0x1'));var util=require('util');var BPromise=require(_0xf7ce('0x2'));var moment=require(_0xf7ce('0x3'));var squel=require(_0xf7ce('0x4'));var Redis=require(_0xf7ce('0x5'));var db=require(_0xf7ce('0x6'))['db'];var config=require(_0xf7ce('0x7'));var logger=require(_0xf7ce('0x8'))('import');config[_0xf7ce('0x9')]=_['defaults'](config['redis'],{'host':_0xf7ce('0xa'),'port':0x18eb});var socket=require(_0xf7ce('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xf7ce('0xc')](_0xf7ce('0xd'));function isEmail(_0xba354e){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'](_0xba354e);}function selectNotIn(_0x407900,_0x48989a,_0x4031a5,_0x2dbc43,_0x7cc351){return squel[_0xf7ce('0xe')]()[_0xf7ce('0xf')]('phone')[_0xf7ce('0x10')](_0x2dbc43)[_0xf7ce('0x11')](_0x48989a,null,_0x48989a+_0xf7ce('0x12')+_0x2dbc43+'.'+_0x4031a5)[_0xf7ce('0x13')](_0x2dbc43+'.'+_0x4031a5+_0xf7ce('0x14')+_0x407900+'.'+_0x4031a5)[_0xf7ce('0x13')](_0x48989a+_0xf7ce('0x15')+_0x7cc351['join']()+')');}function insertCmHopper(_0x407346,_0x5afeac,_0x3b2a30,_0x20904d,_0x5c6e9b){var _0x111412=['cm_contacts.phone',_0xf7ce('0x16'),_0xf7ce('0x17'),'cm_contacts.ListId',_0x5afeac+'.'+_0x20904d,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xf7ce('0x18'),'cm_contacts.UserId','\x22'+_0x5c6e9b+'\x22'];return squel[_0xf7ce('0x19')]()['into'](_0xf7ce('0x1a'))[_0xf7ce('0x1b')]([_0xf7ce('0x1c'),_0xf7ce('0x1d'),_0xf7ce('0x1e'),_0xf7ce('0x1f'),_0x20904d,_0xf7ce('0x20'),'updatedAt',_0xf7ce('0x21'),_0xf7ce('0x22'),_0xf7ce('0x23')],squel[_0xf7ce('0xe')]()[_0xf7ce('0x24')](_0x111412)[_0xf7ce('0x10')](_0x5afeac)['join'](_0xf7ce('0x25'),null,_0xf7ce('0x26')+_0x5afeac+'.CmListId')['join'](_0x3b2a30,null,_0x3b2a30+_0xf7ce('0x12')+_0x5afeac+'.'+_0x20904d)[_0xf7ce('0x13')](_0x5afeac+_0xf7ce('0x27'),_0x407346)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xf7ce('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5afeac,_0x3b2a30,_0x20904d,_0xf7ce('0x1a'),[_0xf7ce('0x28'),_0xf7ce('0x29')]))['where'](_0xf7ce('0x2a'),selectNotIn(_0x5afeac,_0x3b2a30,_0x20904d,_0xf7ce('0x1a'),[_0xf7ce('0x28')])))[_0xf7ce('0x2b')]();}function insertCmHopperBlack(_0x54b9e1,_0x12094c,_0x1a8a95,_0x18d5f5){var _0x1ece69=['cm_contacts.phone',_0xf7ce('0x17'),_0xf7ce('0x2c'),_0x12094c+'.'+_0x18d5f5,_0xf7ce('0x2d'),_0xf7ce('0x2e')];return squel['insert']()['into']('cm_hopper_black')[_0xf7ce('0x1b')]([_0xf7ce('0x1c'),'ContactId',_0xf7ce('0x1f'),_0x18d5f5,_0xf7ce('0x20'),_0xf7ce('0x2f')],squel['select']()[_0xf7ce('0x24')](_0x1ece69)[_0xf7ce('0x10')](_0x12094c)[_0xf7ce('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x12094c+_0xf7ce('0x30'))['join'](_0x1a8a95,null,_0x1a8a95+_0xf7ce('0x12')+_0x12094c+'.'+_0x18d5f5)[_0xf7ce('0x13')](_0x12094c+_0xf7ce('0x27'),_0x54b9e1)['where'](_0xf7ce('0x31'),NOW)[_0xf7ce('0x13')](_0xf7ce('0x2a'),squel[_0xf7ce('0xe')]()[_0xf7ce('0xf')]('phone')['from']('cm_hopper_black')['where'](_0xf7ce('0x32'),_0x54b9e1)[_0xf7ce('0x13')](_0x18d5f5+_0xf7ce('0x33'),_0x12094c+'.'+_0x18d5f5)))['toString']();}function insertCmContact(_0x39c81a,_0x2274a7,_0x30666c,_0x4b5e5d){var _0x466acf=_[_0xf7ce('0x34')](_[_0xf7ce('0x35')](_0x4b5e5d),[_0xf7ce('0x1f'),_0xf7ce('0x36'),_0xf7ce('0x20'),'updatedAt']);return squel['insert']()[_0xf7ce('0x37')]('cm_contacts')[_0xf7ce('0x1b')](_0x466acf,squel[_0xf7ce('0xe')]()['fields'](_0x466acf)[_0xf7ce('0x10')](_0x2274a7)[_0xf7ce('0x13')]('('+_0x30666c[_0xf7ce('0x11')](',')+_0xf7ce('0x38'),squel['select']()[_0xf7ce('0x24')](_0x30666c)[_0xf7ce('0x10')](_0xf7ce('0x25'))[_0xf7ce('0x13')](_0xf7ce('0x32'),_0x39c81a)[_0xf7ce('0x13')](_0xf7ce('0x39')))[_0xf7ce('0x13')](_0xf7ce('0x3a'),squel[_0xf7ce('0xe')]()[_0xf7ce('0xf')](_0xf7ce('0x3b'),_0xf7ce('0x3c'))[_0xf7ce('0x10')](_0x2274a7)[_0xf7ce('0x3d')](_0x30666c[_0xf7ce('0x11')](','))))[_0xf7ce('0x2b')]();}function handleStop(){logger[_0xf7ce('0x3e')](_0xf7ce('0x3f'));stopped=!![];}function handleUncaughtException(_0x46cd59){logger['error'](_0x46cd59['message']);process[_0xf7ce('0x40')](0x1);}function handleError(_0x566774,_0x1b6ea1){stats[_0xf7ce('0x41')][_0xf7ce('0x42')]({'name':_0x1b6ea1[_0xf7ce('0x43')],'message':_0x1b6ea1['message'],'row':_0x566774});}function handleQuery(_0x4cea1a){logger[_0xf7ce('0x3e')](_0x4cea1a);return db[_0xf7ce('0x44')][_0xf7ce('0x45')](_0x4cea1a)[_0xf7ce('0x46')](function(_0x4dd9d0){results[_0xf7ce('0x42')](_0x4dd9d0);})[_0xf7ce('0x47')](function(_0x3017f5){logger[_0xf7ce('0x48')](_0x3017f5[_0xf7ce('0x49')]);});}function main(_0x40e28c,_0x29e59b,_0xf7da5d,_0x62e4d8){logger[_0xf7ce('0x3e')](_0xf7ce('0x4a'),_0x40e28c,JSON['stringify'](_0x29e59b));process[_0xf7ce('0x4b')](_0xf7ce('0x4c'));var _0x1be627=_0x29e59b[_0xf7ce('0x4d')];var _0x26b4c0=_0x29e59b[_0xf7ce('0x4e')];var _0x1ab8d0=path[_0xf7ce('0x11')](config[_0xf7ce('0x4f')],_0xf7ce('0x50'),_0x26b4c0+_0xf7ce('0x51'));var _0x3bec45=_[_0xf7ce('0x35')](_0x1be627)[_0xf7ce('0x11')]();logger[_0xf7ce('0x3e')]('header',_0x3bec45);fs[_0xf7ce('0x52')](_0x1ab8d0,_0x3bec45+'\x0a');Papa[_0xf7ce('0x53')](fs[_0xf7ce('0x54')](_0x40e28c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x534caf,_0x1f23f2){try{for(var _0xa1d0a0=0x0,_0x5db648=[];_0xa1d0a0<_0x534caf[_0xf7ce('0x55')][_0xf7ce('0x56')];_0xa1d0a0++){stats[_0xf7ce('0x57')]+=0x1;if(_0x534caf['errors'][_0xa1d0a0]){handleError(_0x534caf[_0xf7ce('0x55')][_0xa1d0a0],_0x534caf[_0xf7ce('0x41')][_0xa1d0a0]);}else{var _0xf53fa2=[];for(var _0x48ce00 in _0x1be627){if(_0x1be627[_0xf7ce('0x58')](_0x48ce00)){if(_0x534caf[_0xf7ce('0x55')][_0xa1d0a0][_0x1be627[_0x48ce00]]){var _0x5aaf19=_['trim'](_0x534caf['data'][_0xa1d0a0][_0x1be627[_0x48ce00]][_0xf7ce('0x59')](/"/g,'\x27'));switch(_0x48ce00){case _0xf7ce('0x1d'):var _0x2f43a2=moment(_0x5aaf19,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2f43a2[_0xf7ce('0x5a')]()){_0x5db648[_0xf7ce('0x42')]('\x22'+_0x5aaf19+'\x22');}else{_0xf53fa2[_0xf7ce('0x42')](_0xf7ce('0x5b'));}break;case _0xf7ce('0x21'):var _0x44d4f0=parseInt(_0x5aaf19);_0x5aaf19=_['isNaN'](_0x44d4f0)||_0x44d4f0<0x0||_0x44d4f0>0x4?_0x62e4d8?0x3:0x2:_0x44d4f0;_0x5db648[_0xf7ce('0x42')]('\x22'+_0x5aaf19+'\x22');break;case _0xf7ce('0x22'):var _0x26e20e=parseInt(_0x5aaf19);if(_['isNumber'](_0x26e20e)&&_[_0xf7ce('0x5c')](_0xf7da5d,_0x26e20e)){_0x5db648[_0xf7ce('0x42')]('\x22'+_0x26e20e+'\x22');}else{_0xf53fa2['push'](_0xf7ce('0x5d'));}break;case _0xf7ce('0x5e'):if(isEmail(_0x5aaf19)){_0x5db648['push']('\x22'+_0x5aaf19+'\x22');}else{_0xf53fa2[_0xf7ce('0x42')](_0xf7ce('0x5f'));}break;case _0xf7ce('0x60'):var _0x2357da=moment(_0x5aaf19,_0xf7ce('0x61'),!![]);if(_0x2357da['isValid']()){_0x5db648[_0xf7ce('0x42')]('\x22'+_0x5aaf19+'\x22');}else{_0xf53fa2['push'](_0xf7ce('0x62'));}break;default:_0x5db648[_0xf7ce('0x42')]('\x22'+_0x5aaf19+'\x22');}}else{switch(_0x48ce00){case _0xf7ce('0x63'):case _0xf7ce('0x1c'):_0xf53fa2[_0xf7ce('0x42')](_0x48ce00+_0xf7ce('0x64'));break;default:_0x5db648['push']('\x22\x22');}}}}if(_0xf53fa2[_0xf7ce('0x56')]){handleError(_0x534caf[_0xf7ce('0x55')][_0xa1d0a0],{'code':'SystemRow','message':_0xf53fa2[_0xf7ce('0x11')]()});}else{fs[_0xf7ce('0x65')](_0x1ab8d0,_0x5db648[_0xf7ce('0x11')]()+'\x0a');}_0x5db648=[];}if(!(stats[_0xf7ce('0x57')]%0xc8)){socket[_0xf7ce('0x66')](_0xf7ce('0x67')+_0x26b4c0,stats);stats[_0xf7ce('0x41')]=[];}}if(stopped){logger[_0xf7ce('0x3e')](_0xf7ce('0x68'));_0x1f23f2[_0xf7ce('0x69')]();}}catch(_0x5c164e){handleError(_0x534caf[_0xf7ce('0x55')][_0xa1d0a0],{'code':_0xf7ce('0x6a'),'message':_0x5c164e[_0xf7ce('0x49')]});logger[_0xf7ce('0x48')](_0xf7ce('0x6b'),_0x5c164e['message']);}},'complete':function(){try{var _0x4c4fcd=[];var _0x165e8c='cm_contacts';if(_0x29e59b['duplicates']&&_0x29e59b['duplicates'][_0xf7ce('0x56')]){_0x165e8c=_0xf7ce('0x6c')+_0x26b4c0;_0x4c4fcd[_0xf7ce('0x42')](_0xf7ce('0x6d')+_0x165e8c+_0xf7ce('0x6e'));}var _0x34c58e=util[_0xf7ce('0xc')](_0xf7ce('0x6f'),_0x1ab8d0,_0x165e8c,_0x3bec45,_0x29e59b['ListId'],_0x29e59b[_0xf7ce('0x36')]||null,NOW,NOW);if(_['isNil'](_0x1be627[_0xf7ce('0x1d')])){_0x34c58e+=_0xf7ce('0x70');}_0x4c4fcd[_0xf7ce('0x42')](_0x34c58e);if(_0x29e59b['duplicates']&&_0x29e59b[_0xf7ce('0x71')][_0xf7ce('0x56')]){_0x4c4fcd[_0xf7ce('0x42')](insertCmContact(_0x29e59b[_0xf7ce('0x1f')],_0x165e8c,_0x29e59b[_0xf7ce('0x71')],_0x1be627));_0x4c4fcd['push'](_0xf7ce('0x72')+_0x165e8c+';');}_0x4c4fcd['push'](insertCmHopper(_0x29e59b[_0xf7ce('0x1f')],_0xf7ce('0x73'),_0xf7ce('0x74'),_0xf7ce('0x75'),_0x62e4d8));_0x4c4fcd['push'](insertCmHopperBlack(_0x29e59b[_0xf7ce('0x1f')],_0xf7ce('0x76'),'voice_queues',_0xf7ce('0x75')));_0x4c4fcd[_0xf7ce('0x42')](insertCmHopper(_0x29e59b[_0xf7ce('0x1f')],_0xf7ce('0x77'),_0xf7ce('0x78'),'CampaignId',_0x62e4d8));_0x4c4fcd[_0xf7ce('0x42')](insertCmHopperBlack(_0x29e59b[_0xf7ce('0x1f')],_0xf7ce('0x79'),_0xf7ce('0x78'),_0xf7ce('0x7a')));BPromise['each'](_0x4c4fcd,handleQuery)[_0xf7ce('0x7b')](function(_0x48d1bd){stats[_0xf7ce('0x7c')]=!![];stats[_0xf7ce('0x7d')]=_0x29e59b['duplicates']&&_0x29e59b[_0xf7ce('0x71')][_0xf7ce('0x56')]?results[0x2]['affectedRows']:results[0x0][_0xf7ce('0x7d')];socket['emit'](_0xf7ce('0x67')+_0x26b4c0,stats);fs[_0xf7ce('0x7e')](_0x40e28c);fs[_0xf7ce('0x7e')](_0x1ab8d0);process[_0xf7ce('0x40')](0x0);})[_0xf7ce('0x47')](function(_0x109e06){logger[_0xf7ce('0x48')](_0x109e06[_0xf7ce('0x49')]);process['exit'](0x1);});}catch(_0x33503a){logger[_0xf7ce('0x48')]('complete',_0x33503a['message']);process[_0xf7ce('0x40')](0x1);}},'error':function(_0x7dccec,_0x12fc59,_0x3bba89,_0x3592a9){throw new Error(_0x3592a9);}});}function validate(){if(process[_0xf7ce('0x7f')]&&process['argv'][_0xf7ce('0x56')]<0x4){throw new Error(_0xf7ce('0x80'));}var _0x19757f=path[_0xf7ce('0x11')](config[_0xf7ce('0x4f')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xf7ce('0x81')](_0x19757f)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5de2f8={};try{_0x5de2f8=JSON['parse'](process['argv'][0x3]);if(!_0x5de2f8['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x5de2f8[_0xf7ce('0x4d')][_0xf7ce('0x1c')]){throw new Error(_0xf7ce('0x82'));}if(!_0x5de2f8[_0xf7ce('0x4d')][_0xf7ce('0x63')]){throw new Error(_0xf7ce('0x83'));}var _0x131db3=0x0;if(_0x5de2f8[_0xf7ce('0x4d')][_0xf7ce('0x22')]){_0x131db3=0x1;}if(!_0x5de2f8['ListId']){throw new Error(_0xf7ce('0x84'));}}catch(_0xf3c0f){throw new Error(_0xf7ce('0x85'));}var _0x1f5b9b=[];try{_0x1f5b9b=_[_0xf7ce('0x86')](JSON['parse'](process[_0xf7ce('0x7f')][0x4]),'id');}catch(_0x194593){logger[_0xf7ce('0x3e')]('No\x20agent\x20available');}main(_0x19757f,_0x5de2f8,_0x1f5b9b,_0x131db3);}validate();process['on']('SIGINT',handleStop);process['on'](_0xf7ce('0x87'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 9911ea0..327eec4 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 _0xa2e6=['calleridname','Call\x20To','destexten','Queue','agentcalledAt','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','UniqueId','Date','starttime','Answer\x20Time','endtime','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','inbound','Caller\x20Number','keyValue','Caller\x20Name'];(function(_0x2844c4,_0x2d55d8){var _0x36adf8=function(_0x344dd0){while(--_0x344dd0){_0x2844c4['push'](_0x2844c4['shift']());}};_0x36adf8(++_0x2d55d8);}(_0xa2e6,0x173));var _0x6a2e=function(_0x5a7321,_0x5c9c77){_0x5a7321=_0x5a7321-0x0;var _0x36cde4=_0xa2e6[_0x5a7321];return _0x36cde4;};'use strict';exports['getSubjects']=function(_0xdfdf13,_0x2aaf7b){var _0x4cd121=[{'type':'string','content':_0x6a2e('0x0'),'variableName':null}];switch(_0xdfdf13[_0x6a2e('0x1')]()){case _0x6a2e('0x2'):switch(_0x2aaf7b[_0x6a2e('0x1')]()){case'inbound':_0x4cd121[_0x6a2e('0x3')]({'type':_0x6a2e('0x4'),'content':'','variableName':_0x6a2e('0x5')});_0x4cd121[_0x6a2e('0x3')]({'type':'variable','content':'','variableName':_0x6a2e('0x6')});break;case _0x6a2e('0x7'):_0x4cd121[_0x6a2e('0x3')]({'type':_0x6a2e('0x8'),'content':_0x6a2e('0x9'),'variableName':null});_0x4cd121['push']({'type':_0x6a2e('0x4'),'content':'','variableName':_0x6a2e('0xa')});break;}}return _0x4cd121;};exports[_0x6a2e('0xb')]=function(_0x4243cf,_0x327b30){var _0x50f1=[];switch(_0x4243cf['toLowerCase']()){case _0x6a2e('0x2'):switch(_0x327b30[_0x6a2e('0x1')]()){case _0x6a2e('0xc'):_0x50f1=[{'type':_0x6a2e('0x8'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x6a2e('0xd'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x6')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0xf'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x10')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x11'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x12')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x13'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x5')},{'type':_0x6a2e('0xe'),'content':'','key':'UniqueId','keyType':_0x6a2e('0x4'),'variableName':'uniqueid'},{'type':_0x6a2e('0xe'),'content':'','key':'Date','keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x14')},{'type':_0x6a2e('0x8'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x15'),'keyType':'variable','variableName':'destcalleridname'},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x16'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0xa')},{'type':_0x6a2e('0x8'),'content':_0x6a2e('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x18'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x14')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x19'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x1a')},{'type':_0x6a2e('0xe'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':'agentcompleteAt'},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x1b'),'keyType':_0x6a2e('0x4'),'variableName':_0x6a2e('0x1c')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x1d'),'keyType':'variable','variableName':_0x6a2e('0x1e')}];break;case _0x6a2e('0x7'):_0x50f1=[{'type':'string','content':_0x6a2e('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x6a2e('0x20'),'keyType':_0x6a2e('0x4'),'keyContent':'','variableName':_0x6a2e('0xa')},{'type':'keyValue','content':'','key':_0x6a2e('0x21'),'keyType':_0x6a2e('0x4'),'keyContent':'','variableName':_0x6a2e('0x22')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x23'),'keyType':_0x6a2e('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x24'),'keyType':'variable','keyContent':'','variableName':_0x6a2e('0x25')},{'type':'string','content':_0x6a2e('0x17')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x26'),'keyType':_0x6a2e('0x4'),'keyContent':'','variableName':'answertime'},{'type':_0x6a2e('0xe'),'content':'','key':'Complete\x20Time','keyType':_0x6a2e('0x4'),'keyContent':'','variableName':_0x6a2e('0x27')},{'type':_0x6a2e('0xe'),'content':'','key':'Duration','keyType':_0x6a2e('0x4'),'keyContent':'','variableName':_0x6a2e('0x28')},{'type':_0x6a2e('0xe'),'content':'','key':_0x6a2e('0x29'),'keyType':'variable','keyContent':'','variableName':_0x6a2e('0x2a')}];break;}}return _0x50f1;}; \ No newline at end of file +var _0x1f4f=['starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','Call\x20To','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','membername','uniqueid'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x1f4f,0xda));var _0xf1f4=function(_0x4e5d51,_0xa30a8a){_0x4e5d51=_0x4e5d51-0x0;var _0x3420cf=_0x1f4f[_0x4e5d51];return _0x3420cf;};'use strict';exports['getSubjects']=function(_0x4803c0,_0x21ad98){var _0x41376f=[{'type':_0xf1f4('0x0'),'content':_0xf1f4('0x1'),'variableName':null}];switch(_0x4803c0[_0xf1f4('0x2')]()){case _0xf1f4('0x3'):switch(_0x21ad98['toLowerCase']()){case _0xf1f4('0x4'):_0x41376f[_0xf1f4('0x5')]({'type':_0xf1f4('0x6'),'content':'','variableName':_0xf1f4('0x7')});_0x41376f[_0xf1f4('0x5')]({'type':'variable','content':'','variableName':_0xf1f4('0x8')});break;case _0xf1f4('0x9'):_0x41376f[_0xf1f4('0x5')]({'type':'string','content':_0xf1f4('0xa'),'variableName':null});_0x41376f[_0xf1f4('0x5')]({'type':_0xf1f4('0x6'),'content':'','variableName':_0xf1f4('0xb')});break;}}return _0x41376f;};exports[_0xf1f4('0xc')]=function(_0x1a24d3,_0x417176){var _0x101a43=[];switch(_0x1a24d3[_0xf1f4('0x2')]()){case _0xf1f4('0x3'):switch(_0x417176[_0xf1f4('0x2')]()){case'inbound':_0x101a43=[{'type':'string','content':_0xf1f4('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf1f4('0xe'),'keyType':'variable','variableName':'calleridnum'},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x10'),'keyType':_0xf1f4('0x6'),'variableName':'calleridname'},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x11'),'keyType':_0xf1f4('0x6'),'variableName':'destexten'},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x12'),'keyType':_0xf1f4('0x6'),'variableName':_0xf1f4('0x7')},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x13'),'keyType':_0xf1f4('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xf1f4('0x14'),'keyType':_0xf1f4('0x6'),'variableName':_0xf1f4('0x15')},{'type':_0xf1f4('0x0'),'content':_0xf1f4('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xf1f4('0xf'),'content':'','key':'Agent\x20Name','keyType':_0xf1f4('0x6'),'variableName':_0xf1f4('0x17')},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x18'),'keyType':_0xf1f4('0x6'),'variableName':'destcalleridnum'},{'type':_0xf1f4('0x0'),'content':_0xf1f4('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xf1f4('0xf'),'content':'','key':'Agent\x20Ring','keyType':'variable','variableName':_0xf1f4('0x15')},{'type':_0xf1f4('0xf'),'content':'','key':'Agent\x20Connect','keyType':_0xf1f4('0x6'),'variableName':_0xf1f4('0x1a')},{'type':'keyValue','content':'','key':_0xf1f4('0x1b'),'keyType':'variable','variableName':_0xf1f4('0x1c')},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x1d'),'keyType':_0xf1f4('0x6'),'variableName':'holdtime'},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x1e'),'keyType':_0xf1f4('0x6'),'variableName':_0xf1f4('0x1f')}];break;case _0xf1f4('0x9'):_0x101a43=[{'type':_0xf1f4('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0xb')},{'type':_0xf1f4('0xf'),'content':'','key':'Member\x20Name','keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x20')},{'type':_0xf1f4('0xf'),'content':'','key':'UniqueId','keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x21')},{'type':'keyValue','content':'','key':_0xf1f4('0x14'),'keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x22')},{'type':_0xf1f4('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0xf1f4('0x23'),'keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x24')},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x25'),'keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x26')},{'type':'keyValue','content':'','key':_0xf1f4('0x27'),'keyType':_0xf1f4('0x6'),'keyContent':'','variableName':_0xf1f4('0x28')},{'type':_0xf1f4('0xf'),'content':'','key':_0xf1f4('0x29'),'keyType':_0xf1f4('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x101a43;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 343e7b7..352dc0b 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 _0x6e6a=['omit','html','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','body'];(function(_0x2081b9,_0x476416){var _0x5de516=function(_0x596f49){while(--_0x596f49){_0x2081b9['push'](_0x2081b9['shift']());}};_0x5de516(++_0x476416);}(_0x6e6a,0xa4));var _0xa6e6=function(_0x1b1232,_0x14f867){_0x1b1232=_0x1b1232-0x0;var _0x2d2ef7=_0x6e6a[_0x1b1232];return _0x2d2ef7;};'use strict';var _=require(_0xa6e6('0x0'));var db=require(_0xa6e6('0x1'))['db'];var loggers={'openchannel':require(_0xa6e6('0x2'))(_0xa6e6('0x3')),'mail':require('../../config/logger')(_0xa6e6('0x4')),'fax':require('../../config/logger')(_0xa6e6('0x5')),'sms':require('../../config/logger')(_0xa6e6('0x6')),'chat':require(_0xa6e6('0x2'))(_0xa6e6('0x7')),'whatsapp':require(_0xa6e6('0x2'))(_0xa6e6('0x8'))};function getInteractionId(_0x362b87,_0x121543,_0x5dcb94){if(_0x362b87&&_0x362b87[_[_0xa6e6('0x9')](_0x5dcb94)+_0xa6e6('0xa')]){return _0x362b87[_['upperFirst'](_0x5dcb94)+_0xa6e6('0xa')];}else if(_0x362b87&&_0x362b87['id']){return _0x362b87['id'];}else if(_0x121543&&_0x121543['id']){return _0x121543['id'];}else{return _0xa6e6('0xb');}}function log(_0x1ec1bd,_0x228cd7,_0x22c26d,_0x1c5c95,_0x377a30,_0xfaa81c){loggers[_0x377a30[_0xa6e6('0xc')]()][_0x1ec1bd](_0xa6e6('0xd'),_0xfaa81c['toUpperCase'](),_0x228cd7?_0x228cd7['id']:null,_0x228cd7?_0x228cd7['name']:null,_0x228cd7?_0x228cd7[_0xa6e6('0xe')]:null,getInteractionId(_0x22c26d,_0x1c5c95,_0x377a30),_0x22c26d?JSON[_0xa6e6('0xf')](_0x22c26d):_0xa6e6('0x10'));}function updateUser(_0x4795d8,_0x2eba7e,_0x4fb064,_0x5a8be2,_0x32e151){db[_[_0xa6e6('0x9')](_0x5a8be2)+_0xa6e6('0x11')][_0xa6e6('0x12')]({'where':{'id':getInteractionId(_0x2eba7e,_0x4fb064,_0x5a8be2)}})[_0xa6e6('0x13')](function(_0x5539fa){if(_0x5539fa){return _0x5539fa[_0xa6e6('0x14')]({'UserId':_0x4795d8?_0x4795d8['id']:null});}})['then'](function(_0x27407a){if(_0x27407a){log(_0xa6e6('0x15'),_0x4795d8,_0x2eba7e,_0x4fb064,_0x5a8be2,_0x32e151);}})[_0xa6e6('0x16')](function(){log(_0xa6e6('0x17'),_0x4795d8,_0x2eba7e,_0x4fb064,_0x5a8be2,_0x32e151);});}exports[_0xa6e6('0x18')]=function(_0x39c430,_0x1e0e20){return function(_0x2ae2b6,_0x128fcf,_0x277f25){var _0x350cba=_0x2ae2b6[_0xa6e6('0x19')];var _0x10ac71={};var _0x2620ee=_0x2ae2b6[_0xa6e6('0x1a')];if(_0x10ac71){_0x10ac71=_['clone'](_0x2ae2b6[_0xa6e6('0x1b')]);_0x10ac71=_[_0xa6e6('0x1c')](_0x10ac71,[_0xa6e6('0x1b'),_0xa6e6('0x1d'),'phone',_0xa6e6('0x1e'),_0xa6e6('0x1f')]);}updateUser(_0x350cba,_0x10ac71,_0x2620ee,_0x39c430,_0x1e0e20);_0x277f25(null);};}; \ No newline at end of file +var _0xfb96=['../../config/logger','openchannel-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb'];(function(_0x5d3623,_0x2e3379){var _0x47a25c=function(_0x3b826d){while(--_0x3b826d){_0x5d3623['push'](_0x5d3623['shift']());}};_0x47a25c(++_0x2e3379);}(_0xfb96,0x9e));var _0x6fb9=function(_0x2f1ddc,_0x559c28){_0x2f1ddc=_0x2f1ddc-0x0;var _0x337b7c=_0xfb96[_0x2f1ddc];return _0x337b7c;};'use strict';var _=require(_0x6fb9('0x0'));var db=require(_0x6fb9('0x1'))['db'];var loggers={'openchannel':require(_0x6fb9('0x2'))(_0x6fb9('0x3')),'mail':require(_0x6fb9('0x2'))('mail-interactions'),'fax':require('../../config/logger')(_0x6fb9('0x4')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x6fb9('0x2'))(_0x6fb9('0x5')),'whatsapp':require(_0x6fb9('0x2'))(_0x6fb9('0x6'))};function getInteractionId(_0xe25db2,_0x20539a,_0x492560){if(_0xe25db2&&_0xe25db2[_[_0x6fb9('0x7')](_0x492560)+_0x6fb9('0x8')]){return _0xe25db2[_[_0x6fb9('0x7')](_0x492560)+'InteractionId'];}else if(_0xe25db2&&_0xe25db2['id']){return _0xe25db2['id'];}else if(_0x20539a&&_0x20539a['id']){return _0x20539a['id'];}else{return _0x6fb9('0x9');}}function log(_0x3827c4,_0x5c52cb,_0x47d2f1,_0x8041d1,_0x39b0eb,_0x1601d1){loggers[_0x39b0eb[_0x6fb9('0xa')]()][_0x3827c4](_0x6fb9('0xb'),_0x1601d1[_0x6fb9('0xc')](),_0x5c52cb?_0x5c52cb['id']:null,_0x5c52cb?_0x5c52cb[_0x6fb9('0xd')]:null,_0x5c52cb?_0x5c52cb[_0x6fb9('0xe')]:null,getInteractionId(_0x47d2f1,_0x8041d1,_0x39b0eb),_0x47d2f1?JSON['stringify'](_0x47d2f1):_0x6fb9('0xf'));}function updateUser(_0xa726b7,_0x9555c0,_0x101526,_0x2b82d4,_0x1d0e9b){db[_[_0x6fb9('0x7')](_0x2b82d4)+_0x6fb9('0x10')][_0x6fb9('0x11')]({'where':{'id':getInteractionId(_0x9555c0,_0x101526,_0x2b82d4)}})[_0x6fb9('0x12')](function(_0x2838b4){if(_0x2838b4){return _0x2838b4[_0x6fb9('0x13')]({'UserId':_0xa726b7?_0xa726b7['id']:null});}})[_0x6fb9('0x12')](function(_0x5f2266){if(_0x5f2266){log('info',_0xa726b7,_0x9555c0,_0x101526,_0x2b82d4,_0x1d0e9b);}})[_0x6fb9('0x14')](function(){log(_0x6fb9('0x15'),_0xa726b7,_0x9555c0,_0x101526,_0x2b82d4,_0x1d0e9b);});}exports[_0x6fb9('0x16')]=function(_0x26b4c3,_0x3872c1){return function(_0x3eb92f,_0x99a5c3,_0x13ccd0){var _0x2b2d34=_0x3eb92f[_0x6fb9('0x17')];var _0xaec0e8={};var _0x2cc476=_0x3eb92f[_0x6fb9('0x18')];if(_0xaec0e8){_0xaec0e8=_[_0x6fb9('0x19')](_0x3eb92f[_0x6fb9('0x1a')]);_0xaec0e8=_[_0x6fb9('0x1b')](_0xaec0e8,['body',_0x6fb9('0x1c'),_0x6fb9('0x1d'),_0x6fb9('0x1e'),_0x6fb9('0x1f')]);}updateUser(_0x2b2d34,_0xaec0e8,_0x2cc476,_0x26b4c3,_0x3872c1);_0x13ccd0(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 41b4f40..0bf0615 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 _0xcb1f=['user','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','License','then','status','json','users','User','admin'];(function(_0x8929a1,_0x25516b){var _0x5102cc=function(_0x2d128e){while(--_0x2d128e){_0x8929a1['push'](_0x8929a1['shift']());}};_0x5102cc(++_0x25516b);}(_0xcb1f,0xb1));var _0xfcb1=function(_0x1bcd59,_0x2fe21f){_0x1bcd59=_0x1bcd59-0x0;var _0x152a69=_0xcb1f[_0x1bcd59];return _0x152a69;};'use strict';var crypto=require(_0xfcb1('0x0'));var util=require('util');var compose=require(_0xfcb1('0x1'));var db=require(_0xfcb1('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3f6166,_0x286df8){if(_0x3f6166&&_0x286df8){if(_0x286df8[_0xfcb1('0x3')]&&_0x286df8[_0xfcb1('0x4')]){var _0x25badf=_0x286df8['data1'];var _0x10fba3=_0x286df8[_0xfcb1('0x4')];var _0x566925=_0x25badf[_0xfcb1('0x5')]('-')[0x4];var _0x41e670=_0x25badf[_0xfcb1('0x5')]('-')[0x0];var _0x254933=crypto[_0xfcb1('0x6')](_0xfcb1('0x7'),util[_0xfcb1('0x8')](_0xfcb1('0x9'),_0x566925,_0x25badf,_0x41e670));var _0x3208c9=_0x254933[_0xfcb1('0xa')](_0x10fba3,'base64',_0xfcb1('0xb'));_0x3208c9+=_0x254933[_0xfcb1('0xc')](_0xfcb1('0xb'));var _0x31e2c1=JSON[_0xfcb1('0xd')](_0x3208c9);return _0x31e2c1['hasOwnProperty'](_0x3f6166)?_0x31e2c1[_0x3f6166]:null;}}return null;}function isLimit(_0x1fd580,_0x14c128,_0x401cfb,_0x12d82c){var _0x9932e3=_0x14c128;return compose()['use'](function(_0xd483eb,_0x3b3649,_0x18f3e8){return db[_0xfcb1('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x24a4c4){var _0x4de4cb=getValueFromLicense(_0x1fd580,_0x24a4c4);return _0x4de4cb?_0x4de4cb:_0x9932e3;})[_0xfcb1('0xf')](function(_0x124dc5){_0x9932e3=_0x124dc5;return _0x401cfb['count'](_0x12d82c);})[_0xfcb1('0xf')](function(_0x165055){if(_0x165055>=_0x9932e3){return _0x3b3649[_0xfcb1('0x10')](0x193)[_0xfcb1('0x11')]({'message':util[_0xfcb1('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1fd580)});}_0x18f3e8();})['catch'](function(_0x5d99c5){_0x18f3e8(_0x5d99c5);});});}function isUserLimit(){return isLimit(_0xfcb1('0x12'),0x1,db[_0xfcb1('0x13')],{'where':{'$or':[{'role':_0xfcb1('0x14')},{'role':_0xfcb1('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xfde6=['split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','use','findOne','then','count','status','json','catch','users','User','admin','isUserLimit','util','composable-middleware','../../config/environment','data1','license'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xfde6,0x1c3));var _0x6fde=function(_0x432bd1,_0x11f28f){_0x432bd1=_0x432bd1-0x0;var _0x31827d=_0xfde6[_0x432bd1];return _0x31827d;};'use strict';var crypto=require('crypto');var util=require(_0x6fde('0x0'));var compose=require(_0x6fde('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x6fde('0x2'));function getValueFromLicense(_0x4bf3a9,_0x6ea1c8){if(_0x4bf3a9&&_0x6ea1c8){if(_0x6ea1c8[_0x6fde('0x3')]&&_0x6ea1c8[_0x6fde('0x4')]){var _0x3114c1=_0x6ea1c8[_0x6fde('0x3')];var _0x504e08=_0x6ea1c8[_0x6fde('0x4')];var _0x2c6ed5=_0x3114c1[_0x6fde('0x5')]('-')[0x4];var _0x148d65=_0x3114c1[_0x6fde('0x5')]('-')[0x0];var _0x227a8f=crypto['createDecipher'](_0x6fde('0x6'),util[_0x6fde('0x7')](_0x6fde('0x8'),_0x2c6ed5,_0x3114c1,_0x148d65));var _0x1b268a=_0x227a8f[_0x6fde('0x9')](_0x504e08,_0x6fde('0xa'),_0x6fde('0xb'));_0x1b268a+=_0x227a8f['final'](_0x6fde('0xb'));var _0x286a9b=JSON[_0x6fde('0xc')](_0x1b268a);return _0x286a9b['hasOwnProperty'](_0x4bf3a9)?_0x286a9b[_0x4bf3a9]:null;}}return null;}function isLimit(_0xff35ae,_0x2261cd,_0x57aede,_0x590282){var _0x39f8d0=_0x2261cd;return compose()[_0x6fde('0xd')](function(_0x2f7924,_0x3b7896,_0x49dff1){return db['License'][_0x6fde('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x6fde('0xf')](function(_0x272c62){var _0x3551ca=getValueFromLicense(_0xff35ae,_0x272c62);return _0x3551ca?_0x3551ca:_0x39f8d0;})[_0x6fde('0xf')](function(_0x339723){_0x39f8d0=_0x339723;return _0x57aede[_0x6fde('0x10')](_0x590282);})[_0x6fde('0xf')](function(_0x56109a){if(_0x56109a>=_0x39f8d0){return _0x3b7896[_0x6fde('0x11')](0x193)[_0x6fde('0x12')]({'message':util[_0x6fde('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xff35ae)});}_0x49dff1();})[_0x6fde('0x13')](function(_0x49f304){_0x49dff1(_0x49f304);});});}function isUserLimit(){return isLimit(_0x6fde('0x14'),0x1,db[_0x6fde('0x15')],{'where':{'$or':[{'role':_0x6fde('0x16')},{'role':'user'}]}});}exports[_0x6fde('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f4e5578..b6d7d99 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 _0x2fc8=['DATE','operator','$between','value','$gt','$lte','add','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','includes','$ne','$notIn','\x20IS\x20NULL)','$in','$eq','=\x20?','<>\x20?','$endsWith','LIKE\x20?','<\x20?','>\x20?','$gte','>=\x20?','start','$startsWith','shift','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','length','split','slice','forEach','match','filter','conditions','push','buildExpression'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x2fc8,0x1e4));var _0x82fc=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2fc8[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x82fc('0x0'));var moment=require(_0x82fc('0x1'));exports[_0x82fc('0x2')]=function(_0x22e01a){var _0x4d2597={'conditions':[]};_0x4d2597['sqlOperator']=_[_0x82fc('0x3')](_0x22e01a,_0x82fc('0x4'))?'or':_0x82fc('0x5');var _0x438044=_0x22e01a[_0x82fc('0x6')]('[$and]','')['replace']('[$or]','')['split']('||');for(var _0x5bf87a=0x0;_0x5bf87a<_0x438044[_0x82fc('0x7')];_0x5bf87a++){var _0xaee2be=_0x438044[_0x5bf87a][_0x82fc('0x8')](':=');var _0x2147b1=_0xaee2be[0x0];var _0x5a7113=_0xaee2be[_0x82fc('0x9')](0x1);_0x5a7113[_0x82fc('0xa')](function(_0xa404d8){var _0x87df87=_0xa404d8[_0x82fc('0x8')]('[')['shift']();var _0x2491a7=_0xa404d8[_0x82fc('0xb')](/\[(.*?)\]/g);_0x2491a7[_0x82fc('0xa')](function(_0x5a5e98){var _0x45967e=_0x5a5e98[_0x82fc('0x8')]('[')[_0x82fc('0xc')](function(_0x7ddf22){return _0x7ddf22['indexOf'](']')>-0x1;})['map'](function(_0x50a504){return _0x50a504[_0x82fc('0x8')](']')[0x0];})[0x0];_0x4d2597[_0x82fc('0xd')][_0x82fc('0xe')]({'field':_0x2147b1,'operator':_0x87df87,'value':_0x45967e});});});}return _0x4d2597;};exports[_0x82fc('0xf')]=function(_0x1d9e88,_0x396a2a,_0x1f9beb){var _0x59d34e={};if(_0x396a2a===_0x82fc('0x10')){if(_0x1f9beb[_0x82fc('0x11')]==='$eq'){_0x1f9beb[_0x82fc('0x11')]=_0x82fc('0x12');_0x1f9beb[_0x82fc('0x13')]+=','+_0x1f9beb[_0x82fc('0x13')];}else if(_['includes']([_0x82fc('0x14'),_0x82fc('0x15')],_0x1f9beb[_0x82fc('0x11')])){_0x1f9beb[_0x82fc('0x13')]=moment(_0x1f9beb[_0x82fc('0x13')])[_0x82fc('0x16')](0x1,_0x82fc('0x17'))['format'](_0x82fc('0x18'));}}if(_0x1f9beb[_0x82fc('0x19')]){_0x396a2a=_0x1f9beb['castTo'];_0x59d34e[_0x82fc('0x1a')]=_0x82fc('0x1b')+_0x1d9e88+'.'+_0x1f9beb['field']+_0x82fc('0x1c')+_0x1f9beb[_0x82fc('0x19')]+')\x20'+parseOperator(_0x1f9beb[_0x82fc('0x11')]);}else{_0x59d34e[_0x82fc('0x1a')]=_0x1d9e88+'.'+_0x1f9beb['field']+'\x20'+parseOperator(_0x1f9beb['operator']);}if(_[_0x82fc('0x1d')]([_0x82fc('0x1e'),_0x82fc('0x1f')],_0x1f9beb['operator']))_0x59d34e[_0x82fc('0x1a')]='('+_0x59d34e[_0x82fc('0x1a')]+'\x20OR\x20'+_0x1d9e88+'.'+_0x1f9beb['field']+_0x82fc('0x20');_0x59d34e[_0x82fc('0x13')]=parseValue(_0x396a2a,_0x1f9beb['operator'],_0x1f9beb[_0x82fc('0x13')]);return _0x59d34e;};function parseOperator(_0x373db5){var _0x31f2d1;switch(_0x373db5){case _0x82fc('0x21'):_0x31f2d1='IN\x20?';break;case _0x82fc('0x1f'):_0x31f2d1='NOT\x20IN\x20?';break;case _0x82fc('0x22'):_0x31f2d1=_0x82fc('0x23');break;case _0x82fc('0x1e'):_0x31f2d1=_0x82fc('0x24');break;case'$substring':case'$startsWith':case _0x82fc('0x25'):_0x31f2d1=_0x82fc('0x26');break;case'$lt':_0x31f2d1=_0x82fc('0x27');break;case _0x82fc('0x14'):_0x31f2d1=_0x82fc('0x28');break;case _0x82fc('0x15'):_0x31f2d1='<=\x20?';break;case _0x82fc('0x29'):_0x31f2d1=_0x82fc('0x2a');break;case _0x82fc('0x12'):_0x31f2d1='BETWEEN\x20?\x20AND\x20?';break;}return _0x31f2d1;}function parseValue(_0x2fabd5,_0x935a48,_0x2280f6){var _0x5eb594={'start':undefined,'end':undefined};switch(_0x935a48){case _0x82fc('0x21'):case _0x82fc('0x1f'):_0x5eb594['start']=_0x2280f6[_0x82fc('0x8')](',');break;case'$substring':_0x5eb594[_0x82fc('0x2b')]='%'+_0x2280f6+'%';break;case _0x82fc('0x2c'):_0x5eb594[_0x82fc('0x2b')]=_0x2280f6+'%';break;case _0x82fc('0x25'):_0x5eb594['start']='%'+_0x2280f6;break;case _0x82fc('0x12'):var _0x2b93a6=_0x2280f6['split'](',');var _0x2280f6=_0x2b93a6[_0x82fc('0x2d')]();var _0x12328a=_0x2b93a6['pop']();if(_0x2fabd5===_0x82fc('0x10')){_0x2280f6=moment(_0x2280f6)[_0x82fc('0x2e')](0x0,!![])['format']();_0x12328a=moment(_0x12328a)[_0x82fc('0x2e')](0x0,!![])['add'](0x17,_0x82fc('0x2f'))['add'](0x3b,_0x82fc('0x30'))[_0x82fc('0x16')](0x3b,_0x82fc('0x31'))['format']();}_0x5eb594={'start':_0x2280f6,'end':_0x12328a};break;default:_0x5eb594['start']=_0x2280f6;break;}return _0x5eb594;} \ No newline at end of file +var _0x0889=['value','includes','add','days','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','$in','start','$substring','$between','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','map','push','DATE','operator','$eq'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0889,0x94));var _0x9088=function(_0x5d6ba4,_0x187ba7){_0x5d6ba4=_0x5d6ba4-0x0;var _0x1c53b5=_0x0889[_0x5d6ba4];return _0x1c53b5;};'use strict';var _=require(_0x9088('0x0'));var moment=require('moment');exports[_0x9088('0x1')]=function(_0x845e9c){var _0x149378={'conditions':[]};_0x149378[_0x9088('0x2')]=_['startsWith'](_0x845e9c,_0x9088('0x3'))?'or':_0x9088('0x4');var _0x3cdc09=_0x845e9c[_0x9088('0x5')](_0x9088('0x6'),'')['replace'](_0x9088('0x3'),'')[_0x9088('0x7')]('||');for(var _0x56fac1=0x0;_0x56fac1<_0x3cdc09[_0x9088('0x8')];_0x56fac1++){var _0x5a0b71=_0x3cdc09[_0x56fac1][_0x9088('0x7')](':=');var _0x9539a4=_0x5a0b71[0x0];var _0x165cb1=_0x5a0b71[_0x9088('0x9')](0x1);_0x165cb1[_0x9088('0xa')](function(_0x53a445){var _0x568853=_0x53a445[_0x9088('0x7')]('[')[_0x9088('0xb')]();var _0x482c0d=_0x53a445[_0x9088('0xc')](/\[(.*?)\]/g);_0x482c0d[_0x9088('0xa')](function(_0x18a8d9){var _0x421fe0=_0x18a8d9['split']('[')[_0x9088('0xd')](function(_0x576b84){return _0x576b84[_0x9088('0xe')](']')>-0x1;})[_0x9088('0xf')](function(_0x4e81b6){return _0x4e81b6[_0x9088('0x7')](']')[0x0];})[0x0];_0x149378['conditions'][_0x9088('0x10')]({'field':_0x9539a4,'operator':_0x568853,'value':_0x421fe0});});});}return _0x149378;};exports['buildExpression']=function(_0x926465,_0x54df6f,_0xd85485){var _0x2680b4={};if(_0x54df6f===_0x9088('0x11')){if(_0xd85485[_0x9088('0x12')]===_0x9088('0x13')){_0xd85485[_0x9088('0x12')]='$between';_0xd85485[_0x9088('0x14')]+=','+_0xd85485[_0x9088('0x14')];}else if(_[_0x9088('0x15')](['$gt','$lte'],_0xd85485[_0x9088('0x12')])){_0xd85485['value']=moment(_0xd85485['value'])[_0x9088('0x16')](0x1,_0x9088('0x17'))[_0x9088('0x18')](_0x9088('0x19'));}}if(_0xd85485[_0x9088('0x1a')]){_0x54df6f=_0xd85485[_0x9088('0x1a')];_0x2680b4['text']=_0x9088('0x1b')+_0x926465+'.'+_0xd85485[_0x9088('0x1c')]+_0x9088('0x1d')+_0xd85485[_0x9088('0x1a')]+')\x20'+parseOperator(_0xd85485[_0x9088('0x12')]);}else{_0x2680b4[_0x9088('0x1e')]=_0x926465+'.'+_0xd85485[_0x9088('0x1c')]+'\x20'+parseOperator(_0xd85485[_0x9088('0x12')]);}if(_['includes'](['$ne',_0x9088('0x1f')],_0xd85485[_0x9088('0x12')]))_0x2680b4[_0x9088('0x1e')]='('+_0x2680b4[_0x9088('0x1e')]+_0x9088('0x20')+_0x926465+'.'+_0xd85485[_0x9088('0x1c')]+_0x9088('0x21');_0x2680b4[_0x9088('0x14')]=parseValue(_0x54df6f,_0xd85485[_0x9088('0x12')],_0xd85485[_0x9088('0x14')]);return _0x2680b4;};function parseOperator(_0x13f3ab){var _0x363f20;switch(_0x13f3ab){case'$in':_0x363f20=_0x9088('0x22');break;case'$notIn':_0x363f20='NOT\x20IN\x20?';break;case _0x9088('0x13'):_0x363f20=_0x9088('0x23');break;case'$ne':_0x363f20=_0x9088('0x24');break;case'$substring':case _0x9088('0x25'):case _0x9088('0x26'):_0x363f20=_0x9088('0x27');break;case _0x9088('0x28'):_0x363f20=_0x9088('0x29');break;case _0x9088('0x2a'):_0x363f20=_0x9088('0x2b');break;case _0x9088('0x2c'):_0x363f20=_0x9088('0x2d');break;case _0x9088('0x2e'):_0x363f20=_0x9088('0x2f');break;case'$between':_0x363f20='BETWEEN\x20?\x20AND\x20?';break;}return _0x363f20;}function parseValue(_0x148b57,_0x35ac1d,_0x3b6390){var _0x452211={'start':undefined,'end':undefined};switch(_0x35ac1d){case _0x9088('0x30'):case'$notIn':_0x452211[_0x9088('0x31')]=_0x3b6390[_0x9088('0x7')](',');break;case _0x9088('0x32'):_0x452211[_0x9088('0x31')]='%'+_0x3b6390+'%';break;case _0x9088('0x25'):_0x452211[_0x9088('0x31')]=_0x3b6390+'%';break;case _0x9088('0x26'):_0x452211[_0x9088('0x31')]='%'+_0x3b6390;break;case _0x9088('0x33'):var _0x4eb9f=_0x3b6390['split'](',');var _0x3b6390=_0x4eb9f['shift']();var _0x20afcf=_0x4eb9f['pop']();if(_0x148b57===_0x9088('0x11')){_0x3b6390=moment(_0x3b6390)[_0x9088('0x34')](0x0,!![])['format']();_0x20afcf=moment(_0x20afcf)[_0x9088('0x34')](0x0,!![])['add'](0x17,_0x9088('0x35'))[_0x9088('0x16')](0x3b,_0x9088('0x36'))[_0x9088('0x16')](0x3b,_0x9088('0x37'))[_0x9088('0x18')]();}_0x452211={'start':_0x3b6390,'end':_0x20afcf};break;default:_0x452211[_0x9088('0x31')]=_0x3b6390;break;}return _0x452211;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 33f0bb8..5b10bfd 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 _0xce02=['replace','join','$id','query','model','map','attributes','intersection','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','lower','filter','options','lodash','sequelize','parse','includes','keys','fields','split','filters','forOwn','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','priority','cast','unsigned','substr','DESC','col','omit','length','isString','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach'];(function(_0x50ff33,_0xd21424){var _0x1cf4f2=function(_0x279994){while(--_0x279994){_0x50ff33['push'](_0x50ff33['shift']());}};_0x1cf4f2(++_0xd21424);}(_0xce02,0x1da));var _0x2ce0=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xce02[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0x2ce0('0x0'));var sequelize=require(_0x2ce0('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x265856){var _0x40350e=['ne'];try{var _0x597f6d=JSON[_0x2ce0('0x2')](_0x265856);var _0x1563c6=Object['keys'](_0x597f6d)[0x0];return _0x40350e[_0x2ce0('0x3')](_0x1563c6);}catch(_0x92e77a){return![];}}function getOperatorValue(_0x32bd98){var _0x325d9e=JSON['parse'](_0x32bd98);var _0x2743d2=Object[_0x2ce0('0x4')](_0x325d9e)[0x0];var _0x175cc5=_0x325d9e[_0x2743d2];return{['$'+_0x2743d2]:_0x175cc5};}exports[_0x2ce0('0x5')]=function(_0x20fc39){var _0x164f74=null;if(_0x20fc39){_0x164f74=_0x20fc39[_0x2ce0('0x6')](',');}return _0x164f74;};exports[_0x2ce0('0x7')]=function(_0x243189,_0x5be4b6){var _0x4f0778={};if(!_['isEmpty'](_0x243189)){_[_0x2ce0('0x8')](_0x243189,function(_0x411de0,_0x12a862){try{if(_0x5be4b6){var _0x553153=_['find'](_0x5be4b6,{'name':_0x12a862})||{};if(hasSequelizeOperator(_0x411de0)){_0x4f0778[_0x12a862]=getOperatorValue(_0x411de0);}else if(_0x553153[_0x2ce0('0x9')]===_0x2ce0('0xa')&&_[_0x2ce0('0xb')](_0x411de0)){var _0x20aac2=JSON[_0x2ce0('0x2')](_0x411de0);var _0x2ba2cf={'$gte':moment(moment(_0x20aac2[_0x2ce0('0xc')])[_0x2ce0('0xd')](_0x2ce0('0xe')))[_0x2ce0('0xf')]()['format'](),'$lte':moment(moment(_0x20aac2[_0x2ce0('0x10')])[_0x2ce0('0xd')]('YYYY-MM-DD'))[_0x2ce0('0xf')]()[_0x2ce0('0x11')](0x1,'s')['format']()};_0x4f0778[_0x12a862]=_0x2ba2cf;}else if(_0x553153[_0x2ce0('0x12')]===_0x2ce0('0x13')){_0x4f0778[_0x12a862]=_0x411de0;}else{_0x4f0778[_0x12a862]=_[_0x2ce0('0x14')](_0x411de0)?_0x411de0:JSON[_0x2ce0('0x2')](_0x411de0);}}else{_0x4f0778[_0x12a862]=_[_0x2ce0('0x14')](_0x411de0)?_0x411de0:JSON[_0x2ce0('0x2')](_0x411de0);}}catch(_0x277539){_0x4f0778[_0x12a862]=_0x411de0[_0x2ce0('0x6')](',');}});}return _0x4f0778;};exports[_0x2ce0('0x15')]=function(_0x2b0244){_0x2b0244=parseInt(_0x2b0244,0xa);if(!_0x2b0244||_0x2b0244<0x0){_0x2b0244=LIMIT_VALUE;}return _0x2b0244;};exports[_0x2ce0('0x16')]=function(_0x3ed5bf){_0x3ed5bf=parseInt(_0x3ed5bf,0xa);if(!_0x3ed5bf||_0x3ed5bf<0x0){_0x3ed5bf=0x0;}return _0x3ed5bf;};exports[_0x2ce0('0x17')]=function(_0x386e85){var _0x464545,_0x13a450=null;if(_0x386e85){_0x464545=_0x386e85['split'](',');_0x13a450=_['map'](_0x464545,function(_0x450657){if(_0x450657['indexOf']('-')===0x0){return[_0x450657===_0x2ce0('0x18')?sequelize[_0x2ce0('0x19')](sequelize['col'](_0x2ce0('0x18')),_0x2ce0('0x1a')):_0x450657[_0x2ce0('0x1b')](0x1),_0x2ce0('0x1c')];}else{return[_0x450657===_0x2ce0('0x18')?sequelize[_0x2ce0('0x19')](sequelize[_0x2ce0('0x1d')](_0x2ce0('0x18')),_0x2ce0('0x1a')):_0x450657,'ASC'];}});}return _0x13a450;};exports[_0x2ce0('0x1e')]=function(_0x398d64,_0x3e55e5){if(_['isEmpty'](_0x398d64)){return _0x398d64;}if(_['isArray'](_0x398d64)){for(var _0x47ffda=0x0;_0x47ffda<_0x398d64[_0x2ce0('0x1f')];_0x47ffda+=0x1){_0x398d64[_0x47ffda]=this[_0x2ce0('0x1e')](_0x398d64[_0x47ffda],_0x3e55e5);}return _0x398d64;}if(!_['isObject'](_0x398d64)){return _0x398d64;}if(_[_0x2ce0('0x20')](_0x3e55e5)){_0x3e55e5=[_0x3e55e5];}if(!_[_0x2ce0('0x14')](_0x3e55e5)){return _0x398d64;}for(var _0x5dee3e=0x0;_0x5dee3e<_0x3e55e5['length'];_0x5dee3e+=0x1){_['unset'](_0x398d64,_0x3e55e5[_0x5dee3e]);}for(var _0x32d925 in _0x398d64){if(_0x398d64['hasOwnProperty'](_0x32d925)){_0x398d64[_0x32d925]=this[_0x2ce0('0x1e')](_0x398d64[_0x32d925],_0x3e55e5);}}return _0x398d64;};exports[_0x2ce0('0x21')]=function(_0x2bcee0){return _0x2bcee0[_0x2ce0('0x22')](RegExp(_0x2ce0('0x23')))?!![]:![];};exports[_0x2ce0('0x24')]=function(_0x5769c6){return _0x5769c6['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x2ce0('0x25')]=function(_0x43ee97){var _0x234155=[];_0x43ee97[_0x2ce0('0x6')](/[ ,]+/)[_0x2ce0('0x26')](function(_0x12c46d){_0x12c46d=_0x12c46d[_0x2ce0('0x27')](/([^:]")"+/g,'$1');_0x12c46d='+'+_0x12c46d+'*';if(_0x12c46d[_0x2ce0('0x3')]('@'))_0x12c46d='\x22'+_0x12c46d+'\x22';_0x234155['push'](_0x12c46d);});return _0x234155[_0x2ce0('0x28')]('\x20');};exports['getOptions']=function(_0x1aee6d,_0x1a6687,_0x3ce28f){var _0x11fd81={},_0x515055={};if(_0x1a6687['query'][_0x2ce0('0x29')]){_0x1a6687['query']['id']=_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x29')];delete _0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x29')];}_0x11fd81[_0x2ce0('0x2b')]=_[_0x2ce0('0x2c')](_0x1aee6d,'name');_0x11fd81[_0x2ce0('0x2a')]=_[_0x2ce0('0x4')](_0x1a6687[_0x2ce0('0x2a')]);_0x11fd81[_0x2ce0('0x7')]=_['intersection'](_0x11fd81['model'],_0x11fd81[_0x2ce0('0x2a')]);_0x515055[_0x2ce0('0x2d')]=_[_0x2ce0('0x2e')](_0x11fd81[_0x2ce0('0x2b')],this['fields'](_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x5')]));_0x515055['attributes']=_0x515055[_0x2ce0('0x2d')][_0x2ce0('0x1f')]?_0x515055[_0x2ce0('0x2d')]:_0x11fd81[_0x2ce0('0x2b')];if(!_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x2f')](_0x2ce0('0x30'))){_0x515055['limit']=this[_0x2ce0('0x15')](_0x1a6687[_0x2ce0('0x2a')]['limit']);_0x515055[_0x2ce0('0x16')]=this['offset'](_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x16')]);}_0x515055[_0x2ce0('0x31')]=this[_0x2ce0('0x17')](_0x1a6687['query'][_0x2ce0('0x17')]);_0x515055[_0x2ce0('0x32')]=this[_0x2ce0('0x7')](_[_0x2ce0('0x33')](_0x1a6687['query'],_0x11fd81[_0x2ce0('0x7')]),_0x1aee6d);if(_0x1a6687[_0x2ce0('0x2a')]['filter']){_0x515055[_0x2ce0('0x32')]=_[_0x2ce0('0x34')](_0x515055['where'],{'$or':_['map'](_0x1aee6d,function(_0x54f290){if(_0x54f290[_0x2ce0('0x9')]!==_0x2ce0('0x35')){if(_0x3ce28f){return sequelize[_0x2ce0('0x32')](sequelize['fn'](_0x2ce0('0x36'),sequelize[_0x2ce0('0x1d')](_0x54f290[_0x2ce0('0x12')])),{'$like':sequelize['fn'](_0x2ce0('0x36'),'%'+_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x37')]+'%')});}else{var _0x5b870a={};_0x5b870a[_0x54f290[_0x2ce0('0x12')]]={'$like':'%'+_0x1a6687[_0x2ce0('0x2a')][_0x2ce0('0x37')]+'%'};return _0x5b870a;}}})});}_0x515055=_[_0x2ce0('0x34')]({},_0x515055,_0x1a6687[_0x2ce0('0x38')]);return _0x515055;}; \ No newline at end of file +var _0x5b39=['attributes','offset','order','where','pick','filter','VIRTUAL','lower','merge','options','sequelize','parse','keys','includes','fields','split','filters','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','forEach','replace','join','query','$id','model','intersection'];(function(_0x215658,_0x2604ba){var _0x268935=function(_0x32649f){while(--_0x32649f){_0x215658['push'](_0x215658['shift']());}};_0x268935(++_0x2604ba);}(_0x5b39,0x7a));var _0x95b3=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x5b39[_0x381589];return _0x2a075d;};'use strict';var _=require('lodash');var sequelize=require(_0x95b3('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5cac61){var _0x552e60=['ne'];try{var _0x233594=JSON[_0x95b3('0x1')](_0x5cac61);var _0x47eb43=Object[_0x95b3('0x2')](_0x233594)[0x0];return _0x552e60[_0x95b3('0x3')](_0x47eb43);}catch(_0x1777d2){return![];}}function getOperatorValue(_0x135a29){var _0x552b11=JSON[_0x95b3('0x1')](_0x135a29);var _0x18c4e1=Object[_0x95b3('0x2')](_0x552b11)[0x0];var _0x4e6f5a=_0x552b11[_0x18c4e1];return{['$'+_0x18c4e1]:_0x4e6f5a};}exports[_0x95b3('0x4')]=function(_0xd9d1ef){var _0x38db1e=null;if(_0xd9d1ef){_0x38db1e=_0xd9d1ef[_0x95b3('0x5')](',');}return _0x38db1e;};exports[_0x95b3('0x6')]=function(_0x3912b8,_0x9afadf){var _0x51cfbb={};if(!_['isEmpty'](_0x3912b8)){_['forOwn'](_0x3912b8,function(_0x7541a,_0xe90858){try{if(_0x9afadf){var _0x44982a=_[_0x95b3('0x7')](_0x9afadf,{'name':_0xe90858})||{};if(hasSequelizeOperator(_0x7541a)){_0x51cfbb[_0xe90858]=getOperatorValue(_0x7541a);}else if(_0x44982a[_0x95b3('0x8')]===_0x95b3('0x9')&&_[_0x95b3('0xa')](_0x7541a)){var _0x2ef992=JSON[_0x95b3('0x1')](_0x7541a);var _0x8937ef={'$gte':moment(moment(_0x2ef992[_0x95b3('0xb')])[_0x95b3('0xc')](_0x95b3('0xd')))[_0x95b3('0xe')]()[_0x95b3('0xc')](),'$lte':moment(moment(_0x2ef992[_0x95b3('0xf')])[_0x95b3('0xc')](_0x95b3('0xd')))[_0x95b3('0xe')]()['subtract'](0x1,'s')[_0x95b3('0xc')]()};_0x51cfbb[_0xe90858]=_0x8937ef;}else if(_0x44982a[_0x95b3('0x10')]===_0x95b3('0x11')){_0x51cfbb[_0xe90858]=_0x7541a;}else{_0x51cfbb[_0xe90858]=_['isArray'](_0x7541a)?_0x7541a:JSON[_0x95b3('0x1')](_0x7541a);}}else{_0x51cfbb[_0xe90858]=_[_0x95b3('0x12')](_0x7541a)?_0x7541a:JSON[_0x95b3('0x1')](_0x7541a);}}catch(_0x54704e){_0x51cfbb[_0xe90858]=_0x7541a[_0x95b3('0x5')](',');}});}return _0x51cfbb;};exports[_0x95b3('0x13')]=function(_0x4ac8ec){_0x4ac8ec=parseInt(_0x4ac8ec,0xa);if(!_0x4ac8ec||_0x4ac8ec<0x0){_0x4ac8ec=LIMIT_VALUE;}return _0x4ac8ec;};exports['offset']=function(_0x2c3069){_0x2c3069=parseInt(_0x2c3069,0xa);if(!_0x2c3069||_0x2c3069<0x0){_0x2c3069=0x0;}return _0x2c3069;};exports['sort']=function(_0x1b785b){var _0x3c973b,_0x29980a=null;if(_0x1b785b){_0x3c973b=_0x1b785b['split'](',');_0x29980a=_[_0x95b3('0x14')](_0x3c973b,function(_0x54ee60){if(_0x54ee60[_0x95b3('0x15')]('-')===0x0){return[_0x54ee60===_0x95b3('0x16')?sequelize[_0x95b3('0x17')](sequelize[_0x95b3('0x18')](_0x95b3('0x16')),_0x95b3('0x19')):_0x54ee60[_0x95b3('0x1a')](0x1),_0x95b3('0x1b')];}else{return[_0x54ee60===_0x95b3('0x16')?sequelize[_0x95b3('0x17')](sequelize[_0x95b3('0x18')](_0x95b3('0x16')),_0x95b3('0x19')):_0x54ee60,'ASC'];}});}return _0x29980a;};exports[_0x95b3('0x1c')]=function(_0x12f514,_0x45bf88){if(_[_0x95b3('0x1d')](_0x12f514)){return _0x12f514;}if(_[_0x95b3('0x12')](_0x12f514)){for(var _0x4e39f2=0x0;_0x4e39f2<_0x12f514[_0x95b3('0x1e')];_0x4e39f2+=0x1){_0x12f514[_0x4e39f2]=this[_0x95b3('0x1c')](_0x12f514[_0x4e39f2],_0x45bf88);}return _0x12f514;}if(!_[_0x95b3('0x1f')](_0x12f514)){return _0x12f514;}if(_[_0x95b3('0x20')](_0x45bf88)){_0x45bf88=[_0x45bf88];}if(!_[_0x95b3('0x12')](_0x45bf88)){return _0x12f514;}for(var _0x215feb=0x0;_0x215feb<_0x45bf88['length'];_0x215feb+=0x1){_[_0x95b3('0x21')](_0x12f514,_0x45bf88[_0x215feb]);}for(var _0x4559d4 in _0x12f514){if(_0x12f514[_0x95b3('0x22')](_0x4559d4)){_0x12f514[_0x4559d4]=this['omit'](_0x12f514[_0x4559d4],_0x45bf88);}}return _0x12f514;};exports[_0x95b3('0x23')]=function(_0x2e0ee2){return _0x2e0ee2[_0x95b3('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x95b3('0x25')]=function(_0x513d50){return _0x513d50['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x95b3('0x26')]=function(_0x320556){var _0x565e1f=[];_0x320556['split'](/[ ,]+/)[_0x95b3('0x27')](function(_0x284c61){_0x284c61=_0x284c61[_0x95b3('0x28')](/([^:]")"+/g,'$1');_0x284c61='+'+_0x284c61+'*';if(_0x284c61[_0x95b3('0x3')]('@'))_0x284c61='\x22'+_0x284c61+'\x22';_0x565e1f['push'](_0x284c61);});return _0x565e1f[_0x95b3('0x29')]('\x20');};exports['getOptions']=function(_0x3368a7,_0x10a040,_0x17e7af){var _0x594d2d={},_0x2c113d={};if(_0x10a040[_0x95b3('0x2a')][_0x95b3('0x2b')]){_0x10a040['query']['id']=_0x10a040[_0x95b3('0x2a')][_0x95b3('0x2b')];delete _0x10a040['query'][_0x95b3('0x2b')];}_0x594d2d[_0x95b3('0x2c')]=_[_0x95b3('0x14')](_0x3368a7,'name');_0x594d2d[_0x95b3('0x2a')]=_['keys'](_0x10a040['query']);_0x594d2d['filters']=_[_0x95b3('0x2d')](_0x594d2d['model'],_0x594d2d[_0x95b3('0x2a')]);_0x2c113d[_0x95b3('0x2e')]=_['intersection'](_0x594d2d[_0x95b3('0x2c')],this['fields'](_0x10a040[_0x95b3('0x2a')][_0x95b3('0x4')]));_0x2c113d[_0x95b3('0x2e')]=_0x2c113d[_0x95b3('0x2e')][_0x95b3('0x1e')]?_0x2c113d[_0x95b3('0x2e')]:_0x594d2d[_0x95b3('0x2c')];if(!_0x10a040[_0x95b3('0x2a')][_0x95b3('0x22')]('nolimit')){_0x2c113d[_0x95b3('0x13')]=this['limit'](_0x10a040[_0x95b3('0x2a')]['limit']);_0x2c113d[_0x95b3('0x2f')]=this['offset'](_0x10a040['query'][_0x95b3('0x2f')]);}_0x2c113d[_0x95b3('0x30')]=this['sort'](_0x10a040[_0x95b3('0x2a')]['sort']);_0x2c113d[_0x95b3('0x31')]=this['filters'](_[_0x95b3('0x32')](_0x10a040[_0x95b3('0x2a')],_0x594d2d[_0x95b3('0x6')]),_0x3368a7);if(_0x10a040[_0x95b3('0x2a')][_0x95b3('0x33')]){_0x2c113d[_0x95b3('0x31')]=_['merge'](_0x2c113d[_0x95b3('0x31')],{'$or':_[_0x95b3('0x14')](_0x3368a7,function(_0x3ca006){if(_0x3ca006[_0x95b3('0x8')]!==_0x95b3('0x34')){if(_0x17e7af){return sequelize[_0x95b3('0x31')](sequelize['fn'](_0x95b3('0x35'),sequelize[_0x95b3('0x18')](_0x3ca006[_0x95b3('0x10')])),{'$like':sequelize['fn'](_0x95b3('0x35'),'%'+_0x10a040['query'][_0x95b3('0x33')]+'%')});}else{var _0x3b99f6={};_0x3b99f6[_0x3ca006['name']]={'$like':'%'+_0x10a040['query'][_0x95b3('0x33')]+'%'};return _0x3b99f6;}}})});}_0x2c113d=_[_0x95b3('0x36')]({},_0x2c113d,_0x10a040[_0x95b3('0x37')]);return _0x2c113d;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 381c015..4db6816 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4265=['appPath','join','root','public','development','test','client','json\x20replacer','toISOString','split','use','static','/server/views','engine','ejs','renderFile','view\x20engine','html','urlencoded','50mb','json','method-override','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','set'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x4265,0xba));var _0x5426=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4265[_0x46e363];return _0x3fb059;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0x5426('0x0'));var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0x5426('0x1'));var passport=require(_0x5426('0x2'));var cors=require(_0x5426('0x3'));var moment=require(_0x5426('0x4'));var config=require(_0x5426('0x5'));var db=require(_0x5426('0x6'))['db'];exports[_0x5426('0x7')]=function(_0x9b50be){var _0x476ac6=_0x9b50be[_0x5426('0x8')](_0x5426('0x9'));if(_0x476ac6===_0x5426('0xa')){_0x9b50be[_0x5426('0xb')](_0x5426('0xc'),path[_0x5426('0xd')](config[_0x5426('0xe')],_0x5426('0xf')));}if(_0x476ac6===_0x5426('0x10')||_0x476ac6===_0x5426('0x11')){_0x9b50be[_0x5426('0xb')]('appPath',path[_0x5426('0xd')](config[_0x5426('0xe')],_0x5426('0x12')));_0x9b50be['use'](errorHandler());}_0x9b50be[_0x5426('0xb')](_0x5426('0x13'),function(_0xfdf884,_0x21bfc3){if(this[_0xfdf884]instanceof Date){_0x21bfc3=this[_0xfdf884][_0x5426('0x14')]()[_0x5426('0x15')]('.')[0x0]+'Z';}return _0x21bfc3;});_0x9b50be[_0x5426('0x16')](express[_0x5426('0x17')](_0x9b50be[_0x5426('0x8')]('appPath')));_0x9b50be[_0x5426('0xb')]('views',config[_0x5426('0xe')]+_0x5426('0x18'));_0x9b50be[_0x5426('0x19')]('html',require(_0x5426('0x1a'))[_0x5426('0x1b')]);_0x9b50be[_0x5426('0xb')](_0x5426('0x1c'),_0x5426('0x1d'));_0x9b50be[_0x5426('0x16')](bodyParser[_0x5426('0x1e')]({'limit':_0x5426('0x1f'),'extended':!![]}));_0x9b50be[_0x5426('0x16')](bodyParser[_0x5426('0x20')]({'limit':_0x5426('0x1f')}));_0x9b50be[_0x5426('0x16')](cors());_0x9b50be[_0x5426('0x16')](methodOverride());_0x9b50be['use'](cookieParser());_0x9b50be['use'](passport['initialize']());}; \ No newline at end of file +var _0xec3d=['use','/server/views','html','view\x20engine','urlencoded','50mb','json','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','default','get','set','appPath','join','root','public','development','json\x20replacer','toISOString','split'];(function(_0x5b02d6,_0x527c00){var _0x43dab4=function(_0x34508f){while(--_0x34508f){_0x5b02d6['push'](_0x5b02d6['shift']());}};_0x43dab4(++_0x527c00);}(_0xec3d,0x157));var _0xdec3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec3d[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xdec3('0x0'));var favicon=require(_0xdec3('0x1'));var bodyParser=require(_0xdec3('0x2'));var methodOverride=require(_0xdec3('0x3'));var cookieParser=require(_0xdec3('0x4'));var errorHandler=require(_0xdec3('0x5'));var path=require(_0xdec3('0x6'));var passport=require('passport');var cors=require(_0xdec3('0x7'));var moment=require(_0xdec3('0x8'));var config=require(_0xdec3('0x9'));var db=require('../mysqldb')['db'];exports[_0xdec3('0xa')]=function(_0x3da77a){var _0x450cc5=_0x3da77a[_0xdec3('0xb')]('env');if(_0x450cc5==='production'){_0x3da77a[_0xdec3('0xc')](_0xdec3('0xd'),path[_0xdec3('0xe')](config[_0xdec3('0xf')],_0xdec3('0x10')));}if(_0x450cc5===_0xdec3('0x11')||_0x450cc5==='test'){_0x3da77a[_0xdec3('0xc')](_0xdec3('0xd'),path[_0xdec3('0xe')](config[_0xdec3('0xf')],'client'));_0x3da77a['use'](errorHandler());}_0x3da77a['set'](_0xdec3('0x12'),function(_0x40d63f,_0xb35e80){if(this[_0x40d63f]instanceof Date){_0xb35e80=this[_0x40d63f][_0xdec3('0x13')]()[_0xdec3('0x14')]('.')[0x0]+'Z';}return _0xb35e80;});_0x3da77a[_0xdec3('0x15')](express['static'](_0x3da77a[_0xdec3('0xb')]('appPath')));_0x3da77a[_0xdec3('0xc')]('views',config['root']+_0xdec3('0x16'));_0x3da77a['engine'](_0xdec3('0x17'),require('ejs')['renderFile']);_0x3da77a[_0xdec3('0xc')](_0xdec3('0x18'),_0xdec3('0x17'));_0x3da77a['use'](bodyParser[_0xdec3('0x19')]({'limit':_0xdec3('0x1a'),'extended':!![]}));_0x3da77a[_0xdec3('0x15')](bodyParser[_0xdec3('0x1b')]({'limit':'50mb'}));_0x3da77a[_0xdec3('0x15')](cors());_0x3da77a[_0xdec3('0x15')](methodOverride());_0x3da77a[_0xdec3('0x15')](cookieParser());_0x3da77a[_0xdec3('0x15')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 2e2343f..bea720c 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 _0xa32b=['family','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','createHash','md5','update','hex','getUuid','platform','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length'];(function(_0x26792f,_0x10c998){var _0x5ce63f=function(_0x3552ba){while(--_0x3552ba){_0x26792f['push'](_0x26792f['shift']());}};_0x5ce63f(++_0x10c998);}(_0xa32b,0xf8));var _0xba32=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0xa32b[_0x5ce3c8];return _0xa76867;};'use strict';var _=require(_0xba32('0x0'));var os=require('os');var crypto=require(_0xba32('0x1'));var machine=require(_0xba32('0x2'));var exec=require(_0xba32('0x3'))[_0xba32('0x4')];var config=require('../environment');function getInterfaces(){var _0x3f8718=[];var _0x5f3d5c=os['networkInterfaces']();var _0x1ea389=_[_0xba32('0x5')](_[_0xba32('0x6')](_0x5f3d5c));for(var _0x4c6ab5=0x0;_0x4c6ab5<_0x1ea389[_0xba32('0x7')];_0x4c6ab5++){var _0x33ce09=_0x5f3d5c[_0x1ea389[_0x4c6ab5]]['filter'](function(_0x27d1e2){return _0x27d1e2[_0xba32('0x8')]==='IPv4'&&_0x27d1e2[_0xba32('0x9')]===![];});_0x3f8718=_0x3f8718['concat'](_0x33ce09);}return _0x3f8718;}function getFirstInterface(){var _0x34f455=_['head'](getInterfaces());return{'macAddress':_0x34f455&&_0x34f455[_0xba32('0xa')]?_0x34f455[_0xba32('0xa')]:_0xba32('0xb'),'ipAddress':_0x34f455&&_0x34f455[_0xba32('0xc')]?_0x34f455['address']:_0xba32('0xd')};}exports[_0xba32('0xe')]=getFirstInterface;function getCPUhash(){var _0x43b51b=_['orderBy'](os[_0xba32('0xf')]()['map'](function(_0x2ef622){return _0x2ef622[_0xba32('0x10')];}))['join'](':');return crypto[_0xba32('0x11')](_0xba32('0x12'))[_0xba32('0x13')](_0x43b51b)['digest'](_0xba32('0x14'));}exports[_0xba32('0x15')]=function(){var _0x2cb818=os[_0xba32('0x16')]();var _0x90e2e5=/[0-9a-f-]{36}/;if(config[_0xba32('0x17')]&&_0x90e2e5[_0xba32('0x18')](config['licenseToken'])){return config[_0xba32('0x17')];}else if(_0x2cb818==='win32'){return exec(_0xba32('0x19'),{'encoding':_0xba32('0x1a')})[_0xba32('0x1b')]('\x0d\x0a','');}else{var _0x33b95e=getFirstInterface();var _0x279b28=getCPUhash();var _0x471506=_0x279b28+'|'+os[_0xba32('0x1c')]()+'|'+_0x33b95e[_0xba32('0x1d')]+'|'+_0x33b95e[_0xba32('0x1e')];var _0x4968e8=crypto[_0xba32('0x11')](_0xba32('0x12'))[_0xba32('0x13')](_0x471506)['digest']('hex');return _0x4968e8['substring'](0x0,0x8)+'-'+_0x4968e8[_0xba32('0x1f')](0x8,0xc)+'-'+_0x4968e8[_0xba32('0x1f')](0xc,0x10)+'-'+_0x4968e8['substring'](0x10,0x14)+'-'+_0x4968e8[_0xba32('0x1f')](0x14);}}; \ No newline at end of file +var _0xbbe8=['macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','family','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x5918f8,_0x4aa79d){var _0x3a498d=function(_0x3845ce){while(--_0x3845ce){_0x5918f8['push'](_0x5918f8['shift']());}};_0x3a498d(++_0x4aa79d);}(_0xbbe8,0x1df));var _0x8bbe=function(_0x25e221,_0x3c16c7){_0x25e221=_0x25e221-0x0;var _0x84fb0a=_0xbbe8[_0x25e221];return _0x84fb0a;};'use strict';var _=require(_0x8bbe('0x0'));var os=require('os');var crypto=require(_0x8bbe('0x1'));var machine=require(_0x8bbe('0x2'));var exec=require(_0x8bbe('0x3'))[_0x8bbe('0x4')];var config=require('../environment');function getInterfaces(){var _0x1d497f=[];var _0x4d77c2=os['networkInterfaces']();var _0x1f57ac=_[_0x8bbe('0x5')](_['keys'](_0x4d77c2));for(var _0x4a1b29=0x0;_0x4a1b29<_0x1f57ac['length'];_0x4a1b29++){var _0x2f420a=_0x4d77c2[_0x1f57ac[_0x4a1b29]]['filter'](function(_0x466cc9){return _0x466cc9[_0x8bbe('0x6')]===_0x8bbe('0x7')&&_0x466cc9[_0x8bbe('0x8')]===![];});_0x1d497f=_0x1d497f[_0x8bbe('0x9')](_0x2f420a);}return _0x1d497f;}function getFirstInterface(){var _0x44e988=_[_0x8bbe('0xa')](getInterfaces());return{'macAddress':_0x44e988&&_0x44e988[_0x8bbe('0xb')]?_0x44e988['mac']:'00:00:00:00:00:00','ipAddress':_0x44e988&&_0x44e988[_0x8bbe('0xc')]?_0x44e988[_0x8bbe('0xc')]:'127.0.0.1'};}exports[_0x8bbe('0xd')]=getFirstInterface;function getCPUhash(){var _0x192005=_[_0x8bbe('0x5')](os[_0x8bbe('0xe')]()[_0x8bbe('0xf')](function(_0x25f687){return _0x25f687[_0x8bbe('0x10')];}))[_0x8bbe('0x11')](':');return crypto[_0x8bbe('0x12')](_0x8bbe('0x13'))[_0x8bbe('0x14')](_0x192005)[_0x8bbe('0x15')](_0x8bbe('0x16'));}exports[_0x8bbe('0x17')]=function(){var _0x3ce047=os['platform']();var _0x1cd532=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x1cd532[_0x8bbe('0x18')](config['licenseToken'])){return config[_0x8bbe('0x19')];}else if(_0x3ce047===_0x8bbe('0x1a')){return exec(_0x8bbe('0x1b'),{'encoding':_0x8bbe('0x1c')})[_0x8bbe('0x1d')]('\x0d\x0a','');}else{var _0x5db9ed=getFirstInterface();var _0x490369=getCPUhash();var _0x4e1ee1=_0x490369+'|'+os[_0x8bbe('0x1e')]()+'|'+_0x5db9ed[_0x8bbe('0x1f')]+'|'+_0x5db9ed[_0x8bbe('0x20')];var _0x4f3127=crypto[_0x8bbe('0x12')](_0x8bbe('0x13'))[_0x8bbe('0x14')](_0x4e1ee1)['digest'](_0x8bbe('0x16'));return _0x4f3127[_0x8bbe('0x21')](0x0,0x8)+'-'+_0x4f3127[_0x8bbe('0x21')](0x8,0xc)+'-'+_0x4f3127[_0x8bbe('0x21')](0xc,0x10)+'-'+_0x4f3127[_0x8bbe('0x21')](0x10,0x14)+'-'+_0x4f3127['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 57c3b92..1dc743b 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 _0x76c4=['then','catch','get','data1','data2','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','GET'];(function(_0x9d238f,_0x119afc){var _0x23562d=function(_0x2c4e4e){while(--_0x2c4e4e){_0x9d238f['push'](_0x9d238f['shift']());}};_0x23562d(++_0x119afc);}(_0x76c4,0x99));var _0x476c=function(_0x2b30f6,_0x4194be){_0x2b30f6=_0x2b30f6-0x0;var _0x48e600=_0x76c4[_0x2b30f6];return _0x48e600;};'use strict';var util=require(_0x476c('0x0'));var moment=require(_0x476c('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0x476c('0x2'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x476c('0x3'));var logger=require(_0x476c('0x4'))('license');var HOST=_0x476c('0x5');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3bbeca){return new BPromise(function(_0x1fe814,_0x46ef30){var _0x29a9f4=util[_0x476c('0x6')](_0x476c('0x7'),HOST,_0x3bbeca,module[_0x476c('0x8')][_0x476c('0x9')]);if(oldToken){_0x29a9f4=util[_0x476c('0x6')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x3bbeca,module[_0x476c('0x8')][_0x476c('0x9')],oldToken);}var _0x33314c={'uri':_0x29a9f4,'method':_0x476c('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x33314c)[_0x476c('0xb')](function(_0x2b3bcd){_0x1fe814(_0x2b3bcd);})[_0x476c('0xc')](function(_0x5df55e){_0x46ef30(_0x5df55e);});});}function manageLicense(_0x42f20e,_0x537908){var _0x40e4d5=_0x537908[_0x476c('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x40e4d5[_0x476c('0xe')]!==_0x42f20e&&!_0x40e4d5[_0x476c('0xf')]){oldToken=_0x40e4d5[_0x476c('0xe')];}httpRequest(_0x42f20e)[_0x476c('0xb')](function(_0x4b6f70){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4b6f70[_0x476c('0x10')]){isOldTokenSent=![];if(!_0x40e4d5[_0x476c('0x11')]&&_0x40e4d5['license']!=_0x4b6f70['license']||_0x40e4d5[_0x476c('0x11')]&&_0x40e4d5['data2']){logger['info'](_0x476c('0x12'));}if(_0x40e4d5[_0x476c('0x11')]&&!_0x40e4d5['data2']&&_0x40e4d5[_0x476c('0x11')]!=_0x4b6f70[_0x476c('0x11')]){logger[_0x476c('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x40e4d5[_0x476c('0x11')]&&!_0x40e4d5['data2']&&_0x40e4d5[_0x476c('0x11')]==_0x4b6f70[_0x476c('0x11')]){return _0x537908;}return _0x537908[_0x476c('0x14')]({'data1':_0x42f20e,'data2':null,'license':_0x4b6f70['license']});}else{if(_0x4b6f70[_0x476c('0x11')]||_0x40e4d5['license']){if(!_0x40e4d5[_0x476c('0xf')]){if(_0x40e4d5[_0x476c('0xe')]==_0x42f20e){GRAY_PERIOD_REASON=_0x476c('0x15');logger[_0x476c('0x13')](_0x476c('0x16'));}else{GRAY_PERIOD_REASON=_0x476c('0x17');logger[_0x476c('0x13')](_0x476c('0x18'),_0x40e4d5[_0x476c('0xe')],_0x42f20e);}logger['info'](_0x476c('0x19'),GRAY_PERIOD_REASON[_0x476c('0x1a')](),moment()['format'](_0x476c('0x1b')));return _0x537908[_0x476c('0x14')]({'data2':encryptor[_0x476c('0x1c')](moment()[_0x476c('0x6')](_0x476c('0x1b')))});}else{if(moment()[_0x476c('0x1d')](encryptor[_0x476c('0x1e')](_0x40e4d5['data2']),_0x476c('0x1f'))>DAYS){logger['info'](_0x476c('0x20'),moment()[_0x476c('0x6')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x537908['update']({'data1':_0x42f20e,'data2':null,'license':null});}}}else{if(_0x40e4d5[_0x476c('0xe')]!=_0x42f20e){logger[_0x476c('0x13')](_0x476c('0x18'),_0x40e4d5[_0x476c('0xe')],_0x42f20e);return _0x537908['update']({'data1':_0x42f20e,'data2':null,'license':null});}}}return _0x537908;})[_0x476c('0xb')](function(_0x4b77fb){_0x537908=_0x4b77fb;})[_0x476c('0xc')](function(_0x5d861a){logger[_0x476c('0x21')](_0x5d861a[_0x476c('0x22')]);})[_0x476c('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x476c('0x24')](),_0x537908);},TIME);});}function defaultLicense(){var _0x123dab=hardware[_0x476c('0x24')]();if(_0x123dab){return db[_0x476c('0x25')][_0x476c('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x123dab}})[_0x476c('0x27')](function(_0xd437b4,_0x179619){logger['info'](_0x476c('0x28'),_0x123dab);manageLicense(_0x123dab,_0xd437b4);})[_0x476c('0xc')](function(_0x2659fc){logger['error'](_0x2659fc[_0x476c('0x22')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x993e=['Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','default','util','moment','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update'];(function(_0xa04cc4,_0x3cc00c){var _0x3a96d7=function(_0x54178a){while(--_0x54178a){_0xa04cc4['push'](_0xa04cc4['shift']());}};_0x3a96d7(++_0x3cc00c);}(_0x993e,0x1d6));var _0xe993=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x993e[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xe993('0x0'));var moment=require(_0xe993('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0xe993('0x2'))(module,_0xe993('0x3'));var db=require(_0xe993('0x4'))['db'];var encryptor=require(_0xe993('0x5'));var hardware=require(_0xe993('0x6'));var logger=require(_0xe993('0x7'))(_0xe993('0x8'));var HOST=_0xe993('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4e4ed3){return new BPromise(function(_0x481fb7,_0x4afb17){var _0x5e2b35=util[_0xe993('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x4e4ed3,module[_0xe993('0xb')][_0xe993('0x3')]);if(oldToken){_0x5e2b35=util[_0xe993('0xa')](_0xe993('0xc'),HOST,_0x4e4ed3,module[_0xe993('0xb')][_0xe993('0x3')],oldToken);}var _0x441c98={'uri':_0x5e2b35,'method':_0xe993('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x441c98)[_0xe993('0xe')](function(_0x2e71bc){_0x481fb7(_0x2e71bc);})[_0xe993('0xf')](function(_0xf81a8d){_0x4afb17(_0xf81a8d);});});}function manageLicense(_0x2381c1,_0x1f3719){var _0x54bc07=_0x1f3719[_0xe993('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x54bc07[_0xe993('0x11')]!==_0x2381c1&&!_0x54bc07[_0xe993('0x12')]){oldToken=_0x54bc07[_0xe993('0x11')];}httpRequest(_0x2381c1)[_0xe993('0xe')](function(_0x5cfb3a){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5cfb3a[_0xe993('0x13')]){isOldTokenSent=![];if(!_0x54bc07['license']&&_0x54bc07[_0xe993('0x8')]!=_0x5cfb3a[_0xe993('0x8')]||_0x54bc07[_0xe993('0x8')]&&_0x54bc07[_0xe993('0x12')]){logger[_0xe993('0x14')](_0xe993('0x15'));}if(_0x54bc07[_0xe993('0x8')]&&!_0x54bc07[_0xe993('0x12')]&&_0x54bc07[_0xe993('0x8')]!=_0x5cfb3a[_0xe993('0x8')]){logger[_0xe993('0x14')](_0xe993('0x16'));}if(_0x54bc07['license']&&!_0x54bc07['data2']&&_0x54bc07[_0xe993('0x8')]==_0x5cfb3a[_0xe993('0x8')]){return _0x1f3719;}return _0x1f3719[_0xe993('0x17')]({'data1':_0x2381c1,'data2':null,'license':_0x5cfb3a[_0xe993('0x8')]});}else{if(_0x5cfb3a[_0xe993('0x8')]||_0x54bc07[_0xe993('0x8')]){if(!_0x54bc07['data2']){if(_0x54bc07[_0xe993('0x11')]==_0x2381c1){GRAY_PERIOD_REASON=_0xe993('0x18');logger[_0xe993('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xe993('0x19');logger['info'](_0xe993('0x1a'),_0x54bc07['data1'],_0x2381c1);}logger[_0xe993('0x14')](_0xe993('0x1b'),GRAY_PERIOD_REASON[_0xe993('0x1c')](),moment()[_0xe993('0xa')](_0xe993('0x1d')));return _0x1f3719['update']({'data2':encryptor[_0xe993('0x1e')](moment()[_0xe993('0xa')](_0xe993('0x1d')))});}else{if(moment()[_0xe993('0x1f')](encryptor['decryptString'](_0x54bc07[_0xe993('0x12')]),_0xe993('0x20'))>DAYS){logger['info'](_0xe993('0x21'),moment()[_0xe993('0xa')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x1f3719[_0xe993('0x17')]({'data1':_0x2381c1,'data2':null,'license':null});}}}else{if(_0x54bc07['data1']!=_0x2381c1){logger[_0xe993('0x14')](_0xe993('0x1a'),_0x54bc07[_0xe993('0x11')],_0x2381c1);return _0x1f3719[_0xe993('0x17')]({'data1':_0x2381c1,'data2':null,'license':null});}}}return _0x1f3719;})[_0xe993('0xe')](function(_0x16fb1a){_0x1f3719=_0x16fb1a;})[_0xe993('0xf')](function(_0x458bcb){logger['error'](_0x458bcb[_0xe993('0x22')]);})[_0xe993('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xe993('0x24')](),_0x1f3719);},TIME);});}function defaultLicense(){var _0x35e62c=hardware[_0xe993('0x24')]();if(_0x35e62c){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x35e62c}})['spread'](function(_0x275c6b,_0x10ccfb){logger[_0xe993('0x14')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x35e62c);manageLicense(_0x35e62c,_0x275c6b);})[_0xe993('0xf')](function(_0x351e94){logger['error'](_0x351e94[_0xe993('0x22')]);});}}exports[_0xe993('0x25')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6daa132..27a2c45 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 _0xd562=['Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','decryptString','format','parse','demo','machineUuid','deadline','add','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','count','admin','user','telephone','forEach','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xd562,0xa5));var _0x2d56=function(_0x2241e4,_0x52268c){_0x2241e4=_0x2241e4-0x0;var _0x5dbe29=_0xd562[_0x2241e4];return _0x5dbe29;};'use strict';var util=require(_0x2d56('0x0'));var _=require(_0x2d56('0x1'));var moment=require(_0x2d56('0x2'));var BPromise=require(_0x2d56('0x3'));var hardware=require(_0x2d56('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x2d56('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2d56('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2d56('0x7'),'machineUuid':hardware[_0x2d56('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x36d409){return new BPromise(function(_0x18d0a9,_0x1820b3){return db[_0x2d56('0x9')][_0x2d56('0xa')](_[_0x2d56('0xb')](_0x36d409,{'raw':!![],'where':{'id':0x1}}))[_0x2d56('0xc')](function(_0x23c87f){return checkLicense(_0x23c87f,null);})[_0x2d56('0xc')](function(_0x7e1336){_0x18d0a9(_0x7e1336);return;})[_0x2d56('0xd')](function(_0x1a85ab){_0x1820b3(_0x1a85ab);});});}function checkLicense(_0x54e8cd,_0x6a77fa){if(!_0x54e8cd){demoLicense[_0x2d56('0xe')]=_0x54e8cd[_0x2d56('0xf')];return demoLicense;}try{var _0x25b064=_0x6a77fa||_0x54e8cd[_0x2d56('0x10')];if(_[_0x2d56('0x11')](_0x25b064)){throw new Error(_0x2d56('0x12'));}var _0x42a042=_0x54e8cd['data1'];var _0x2f16a8=_0x54e8cd[_0x2d56('0x13')];var _0x34d7b4=_0x42a042['split']('-')[0x4];var _0x232d59=_0x42a042['split']('-')[0x0];var _0x1de238=encryptor[_0x2d56('0x14')](_0x25b064,util[_0x2d56('0x15')]('%s:%s:%s',_0x34d7b4,_0x42a042,_0x232d59));var _0x5be125=JSON[_0x2d56('0x16')](_0x1de238);_0x5be125[_0x2d56('0x17')]=![];_0x5be125[_0x2d56('0xe')]=_0x42a042;_0x5be125[_0x2d56('0x18')]=hardware[_0x2d56('0x8')]();if(_0x2f16a8){var _0x3f3c6b=encryptor['decryptString'](_0x2f16a8);_0x5be125['gray']=_0x3f3c6b;_0x5be125[_0x2d56('0x19')]=moment(_0x3f3c6b)[_0x2d56('0x1a')](0x7,'days')['format']();_0x5be125[_0x2d56('0x1b')]=_0x5be125[_0x2d56('0xe')]!=_0x5be125[_0x2d56('0x18')]?_0x2d56('0x1c'):_0x2d56('0x1d');}return _0x5be125;}catch(_0x4dfc58){breakingLicense[_0x2d56('0xe')]=_0x54e8cd[_0x2d56('0xf')];breakingLicense['message']=_0x4dfc58[_0x2d56('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3df9ee,_0x23b84c){getLicense()[_0x2d56('0xc')](function(_0x10cac8){return db[_0x2d56('0x1f')]['findAll']({'attributes':[_0x2d56('0x20'),[db[_0x2d56('0x21')]['fn'](_0x2d56('0x22'),db[_0x2d56('0x21')][_0x2d56('0x23')](_0x2d56('0x20'))),_0x2d56('0x24')]],'group':_0x2d56('0x20'),'where':{'role':{'$or':[_0x2d56('0x25'),_0x2d56('0x26'),_0x2d56('0x27')]}},'raw':!![]})[_0x2d56('0xc')](function(_0x4bc71f){var _0x48cafc={'user':_0x10cac8['users']||0x0,'telephone':_0x10cac8['telephones']||0x0};_0x4bc71f[_0x2d56('0x28')](function(_0x2781d8){var _0x135e73=_0x2781d8[_0x2d56('0x20')]==='admin'?_0x2d56('0x26'):_0x2781d8[_0x2d56('0x20')];_0x48cafc[_0x135e73]-=_0x2781d8['count'];if(_0x48cafc[_0x135e73]<0x0)_0x48cafc[_0x135e73]=0x0;});_0x3df9ee(_0x48cafc);return;});})[_0x2d56('0xd')](function(_0x50543d){_0x23b84c(_0x50543d);});});}function checkUserLimits(_0x2eb143){return new BPromise(function(_0x32049f,_0x389e97){getLimits()[_0x2d56('0xc')](function(_0x2a8c8b){var _0x35990a=_['pick'](_['countBy'](_0x2eb143,_0x2d56('0x20')),['admin',_0x2d56('0x26'),_0x2d56('0x27')]);var _0x5d1aeb=(_0x35990a[_0x2d56('0x25')]||0x0)+(_0x35990a[_0x2d56('0x26')]||0x0);var _0x156466=_0x35990a[_0x2d56('0x27')]||0x0;if(_0x5d1aeb>_0x2a8c8b['user'])return _0x389e97(_0x2d56('0x29'));if(_0x156466>_0x2a8c8b[_0x2d56('0x27')])return _0x389e97('License\x20limit\x20reached\x20for\x20telephones');return _0x32049f();})[_0x2d56('0xd')](function(_0x3ba6c8){_0x389e97(_0x3ba6c8);});});}module[_0x2d56('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xa4bd=['pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','findAll','sequelize','COUNT','col','count','role','user','users','telephones','admin'];(function(_0x4b191e,_0x515ddb){var _0x13e232=function(_0x1f32b8){while(--_0x1f32b8){_0x4b191e['push'](_0x4b191e['shift']());}};_0x13e232(++_0x515ddb);}(_0xa4bd,0x64));var _0xda4b=function(_0x18a71f,_0x45b2b0){_0x18a71f=_0x18a71f-0x0;var _0xb370f4=_0xa4bd[_0x18a71f];return _0xb370f4;};'use strict';var util=require(_0xda4b('0x0'));var _=require('lodash');var moment=require(_0xda4b('0x1'));var BPromise=require(_0xda4b('0x2'));var hardware=require('./hardware');var encryptor=require(_0xda4b('0x3'));var db=require(_0xda4b('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xda4b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xda4b('0x6'),'machineUuid':hardware[_0xda4b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xda4b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xda4b('0x8'),'machineUuid':hardware[_0xda4b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x473f40){return new BPromise(function(_0x196878,_0x7cb4ad){return db[_0xda4b('0x9')][_0xda4b('0xa')](_[_0xda4b('0xb')](_0x473f40,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5d66aa){return checkLicense(_0x5d66aa,null);})[_0xda4b('0xc')](function(_0x467239){_0x196878(_0x467239);return;})[_0xda4b('0xd')](function(_0x354a74){_0x7cb4ad(_0x354a74);});});}function checkLicense(_0x485a6b,_0x300b63){if(!_0x485a6b){demoLicense[_0xda4b('0xe')]=_0x485a6b[_0xda4b('0xf')];return demoLicense;}try{var _0x259e52=_0x300b63||_0x485a6b[_0xda4b('0x10')];if(_[_0xda4b('0x11')](_0x259e52)){throw new Error(_0xda4b('0x12'));}var _0x32185d=_0x485a6b[_0xda4b('0xf')];var _0x17e0b8=_0x485a6b[_0xda4b('0x13')];var _0x3bf2e8=_0x32185d[_0xda4b('0x14')]('-')[0x4];var _0x2cdb98=_0x32185d[_0xda4b('0x14')]('-')[0x0];var _0x1ae7cd=encryptor[_0xda4b('0x15')](_0x259e52,util[_0xda4b('0x16')]('%s:%s:%s',_0x3bf2e8,_0x32185d,_0x2cdb98));var _0x5be835=JSON[_0xda4b('0x17')](_0x1ae7cd);_0x5be835[_0xda4b('0x18')]=![];_0x5be835[_0xda4b('0xe')]=_0x32185d;_0x5be835[_0xda4b('0x19')]=hardware[_0xda4b('0x7')]();if(_0x17e0b8){var _0x2ca94c=encryptor['decryptString'](_0x17e0b8);_0x5be835[_0xda4b('0x1a')]=_0x2ca94c;_0x5be835[_0xda4b('0x1b')]=moment(_0x2ca94c)[_0xda4b('0x1c')](0x7,_0xda4b('0x1d'))['format']();_0x5be835[_0xda4b('0x1e')]=_0x5be835[_0xda4b('0xe')]!=_0x5be835[_0xda4b('0x19')]?_0xda4b('0x1f'):_0xda4b('0x20');}return _0x5be835;}catch(_0xb42e4){breakingLicense['uuid']=_0x485a6b[_0xda4b('0xf')];breakingLicense['message']=_0xb42e4[_0xda4b('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x13f08c,_0xdd650b){getLicense()[_0xda4b('0xc')](function(_0x1c0b4e){return db['User'][_0xda4b('0x22')]({'attributes':['role',[db[_0xda4b('0x23')]['fn'](_0xda4b('0x24'),db[_0xda4b('0x23')][_0xda4b('0x25')]('role')),_0xda4b('0x26')]],'group':_0xda4b('0x27'),'where':{'role':{'$or':['admin',_0xda4b('0x28'),'telephone']}},'raw':!![]})[_0xda4b('0xc')](function(_0x303161){var _0x247019={'user':_0x1c0b4e[_0xda4b('0x29')]||0x0,'telephone':_0x1c0b4e[_0xda4b('0x2a')]||0x0};_0x303161['forEach'](function(_0xad559){var _0x11d38c=_0xad559[_0xda4b('0x27')]===_0xda4b('0x2b')?_0xda4b('0x28'):_0xad559[_0xda4b('0x27')];_0x247019[_0x11d38c]-=_0xad559[_0xda4b('0x26')];if(_0x247019[_0x11d38c]<0x0)_0x247019[_0x11d38c]=0x0;});_0x13f08c(_0x247019);return;});})[_0xda4b('0xd')](function(_0x120022){_0xdd650b(_0x120022);});});}function checkUserLimits(_0x2a82bb){return new BPromise(function(_0x3ff6b3,_0x307879){getLimits()[_0xda4b('0xc')](function(_0x5a3e34){var _0x42380c=_[_0xda4b('0x2c')](_['countBy'](_0x2a82bb,'role'),[_0xda4b('0x2b'),_0xda4b('0x28'),_0xda4b('0x2d')]);var _0x188295=(_0x42380c['admin']||0x0)+(_0x42380c[_0xda4b('0x28')]||0x0);var _0x33fd56=_0x42380c[_0xda4b('0x2d')]||0x0;if(_0x188295>_0x5a3e34[_0xda4b('0x28')])return _0x307879(_0xda4b('0x2e'));if(_0x33fd56>_0x5a3e34[_0xda4b('0x2d')])return _0x307879(_0xda4b('0x2f'));return _0x3ff6b3();})[_0xda4b('0xd')](function(_0x303dfa){_0x307879(_0x303dfa);});});}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 d452a3d..ca8cfb0 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 _0xcf66=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcf66,0x71));var _0x6cf6=function(_0x2a0995,_0x1a79da){_0x2a0995=_0x2a0995-0x0;var _0x25ec0f=_0xcf66[_0x2a0995];return _0x25ec0f;};'use strict';module[_0x6cf6('0x0')]={'DOMAIN':_0x6cf6('0x1'),'SESSION_SECRET':_0x6cf6('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x6cf6('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x6cb4=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x5408c9,_0x19f8e7){var _0x4512df=function(_0x1c01fa){while(--_0x1c01fa){_0x5408c9['push'](_0x5408c9['shift']());}};_0x4512df(++_0x19f8e7);}(_0x6cb4,0xff));var _0x46cb=function(_0x59077b,_0xfe8ad1){_0x59077b=_0x59077b-0x0;var _0x338a38=_0x6cb4[_0x59077b];return _0x338a38;};'use strict';module[_0x46cb('0x0')]={'DOMAIN':_0x46cb('0x1'),'SESSION_SECRET':_0x46cb('0x2'),'GOOGLE_ID':_0x46cb('0x3'),'GOOGLE_SECRET':_0x46cb('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 005d780..9191bc4 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f41=['/var','log','xcally','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','level','toUpperCase','exports','Logger','transports','File','%s-%s','info','env','moment','util','INFO','join'];(function(_0xae7875,_0x16dfd1){var _0xf1996a=function(_0x4a6c44){while(--_0x4a6c44){_0xae7875['push'](_0xae7875['shift']());}};_0xf1996a(++_0x16dfd1);}(_0x2f41,0x11a));var _0x12f4=function(_0x3bb5b4,_0x128455){_0x3bb5b4=_0x3bb5b4-0x0;var _0x586c60=_0x2f41[_0x3bb5b4];return _0x586c60;};'use strict';var moment=require(_0x12f4('0x0'));var winston=require('winston');var util=require(_0x12f4('0x1'));var path=require('path');var debugLevel=_0x12f4('0x2');function filename(_0x4af197,_0x4929e2){return path[_0x12f4('0x3')](_0x12f4('0x4'),_0x12f4('0x5'),_0x12f4('0x6'),util['format']('%s-%s.log',_0x4af197,_0x4929e2));}function formatter(_0x10ed8c,_0x5afbaf){_0x5afbaf[_0x12f4('0x7')]=_0x5afbaf[_0x12f4('0x7')][_0x12f4('0x8')](/@@{/g,_0x12f4('0x9'))[_0x12f4('0x8')](/}@@/g,_0x12f4('0xa'))[_0x12f4('0x8')](/@{/g,'{{')[_0x12f4('0x8')](/}@/g,'}}');return util['format'](_0x12f4('0xb'),moment()[_0x12f4('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5afbaf[_0x12f4('0xd')][_0x12f4('0xe')](),_0x10ed8c,_0x5afbaf['message']);}module[_0x12f4('0xf')]=function(_0x3e1be3){return new winston[(_0x12f4('0x10'))]({'transports':[new winston[(_0x12f4('0x11'))][(_0x12f4('0x12'))]({'name':util[_0x12f4('0xc')](_0x12f4('0x13'),_0x3e1be3,'error'),'filename':filename(_0x3e1be3,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8025ca){return formatter(_0x3e1be3,_0x8025ca);}}),new winston[(_0x12f4('0x11'))][(_0x12f4('0x12'))]({'name':util[_0x12f4('0xc')]('%s-%s',_0x3e1be3,_0x12f4('0x14')),'filename':filename(_0x3e1be3,'info'),'level':_0x12f4('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x19d03f){return formatter(_0x3e1be3,_0x19d03f);}}),new winston[(_0x12f4('0x11'))]['Console']({'level':process[_0x12f4('0x15')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3b96b4){return formatter(_0x3e1be3,_0x3b96b4);}})]});}; \ No newline at end of file +var _0x6291=['exports','transports','error','%s-%s','info','Console','debugLevel','moment','winston','util','join','/var','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase'];(function(_0x8137b,_0x36e2bb){var _0x1593a1=function(_0xe060a5){while(--_0xe060a5){_0x8137b['push'](_0x8137b['shift']());}};_0x1593a1(++_0x36e2bb);}(_0x6291,0xb7));var _0x1629=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x6291[_0x13342f];return _0x2fc1fc;};'use strict';var moment=require(_0x1629('0x0'));var winston=require(_0x1629('0x1'));var util=require(_0x1629('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x5fb0a8,_0x3df944){return path[_0x1629('0x3')](_0x1629('0x4'),_0x1629('0x5'),_0x1629('0x6'),util[_0x1629('0x7')](_0x1629('0x8'),_0x5fb0a8,_0x3df944));}function formatter(_0x24de27,_0x4d6eea){_0x4d6eea[_0x1629('0x9')]=_0x4d6eea['message'][_0x1629('0xa')](/@@{/g,'{{{')[_0x1629('0xa')](/}@@/g,_0x1629('0xb'))[_0x1629('0xa')](/@{/g,'{{')[_0x1629('0xa')](/}@/g,'}}');return util[_0x1629('0x7')](_0x1629('0xc'),moment()[_0x1629('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4d6eea[_0x1629('0xd')][_0x1629('0xe')](),_0x24de27,_0x4d6eea[_0x1629('0x9')]);}module[_0x1629('0xf')]=function(_0x25558f){return new winston['Logger']({'transports':[new winston[(_0x1629('0x10'))]['File']({'name':util[_0x1629('0x7')]('%s-%s',_0x25558f,_0x1629('0x11')),'filename':filename(_0x25558f,_0x1629('0x11')),'level':_0x1629('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x124336){return formatter(_0x25558f,_0x124336);}}),new winston[(_0x1629('0x10'))]['File']({'name':util[_0x1629('0x7')](_0x1629('0x12'),_0x25558f,_0x1629('0x13')),'filename':filename(_0x25558f,_0x1629('0x13')),'level':_0x1629('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ce14f){return formatter(_0x25558f,_0x3ce14f);}}),new winston[(_0x1629('0x10'))][(_0x1629('0x14'))]({'level':process['env'][_0x1629('0x15')]||debugLevel,'json':![],'formatter':function(_0xeccf1){return formatter(_0x25558f,_0xeccf1);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 816d821..cd9437a 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 _0xc25f=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/express/index.js'];(function(_0x44db7e,_0x2e16e3){var _0x26ad2c=function(_0x39f2ce){while(--_0x39f2ce){_0x44db7e['push'](_0x44db7e['shift']());}};_0x26ad2c(++_0x2e16e3);}(_0xc25f,0x183));var _0xfc25=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc25f[_0x14add3];return _0x4a174f;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xfc25('0x0'),'script':path[_0xfc25('0x1')](__dirname,_0xfc25('0x2'))},{'name':'ami','script':path[_0xfc25('0x1')](__dirname,_0xfc25('0x3'))},{'name':_0xfc25('0x4'),'script':path['join'](__dirname,_0xfc25('0x5'))},{'name':_0xfc25('0x6'),'script':path[_0xfc25('0x1')](__dirname,_0xfc25('0x7'))},{'name':_0xfc25('0x8'),'script':path[_0xfc25('0x1')](__dirname,_0xfc25('0x9'))},{'name':_0xfc25('0xa'),'script':path['join'](__dirname,_0xfc25('0xb'))}]};module[_0xfc25('0xc')]=config; \ No newline at end of file +var _0x1167=['../../services/express/index.js','ami','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','exports','path','join'];(function(_0x1e50ce,_0x330023){var _0x5af6a2=function(_0x113c4a){while(--_0x113c4a){_0x1e50ce['push'](_0x1e50ce['shift']());}};_0x5af6a2(++_0x330023);}(_0x1167,0x10c));var _0x7116=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x1167[_0x465028];return _0xb783d4;};'use strict';var path=require(_0x7116('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x7116('0x1')](__dirname,_0x7116('0x2'))},{'name':_0x7116('0x3'),'script':path[_0x7116('0x1')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,_0x7116('0x4'))},{'name':'email','script':path[_0x7116('0x1')](__dirname,_0x7116('0x5'))},{'name':_0x7116('0x6'),'script':path[_0x7116('0x1')](__dirname,_0x7116('0x7'))},{'name':'xdr','script':path[_0x7116('0x1')](__dirname,'../../services/xdr/index.js')}]};module[_0x7116('0x8')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 0e020ca..8c748e8 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 _0xb93a=['restart','list','describe','delete','dump','saved','pm2','./config','connect','connected','start','stop','then','disconnect'];(function(_0x3512b2,_0x2cb54a){var _0x16c6e8=function(_0x1698d4){while(--_0x1698d4){_0x3512b2['push'](_0x3512b2['shift']());}};_0x16c6e8(++_0x2cb54a);}(_0xb93a,0x102));var _0xab93=function(_0x2baa3f,_0x43a5da){_0x2baa3f=_0x2baa3f-0x0;var _0x24c2a8=_0xb93a[_0x2baa3f];return _0x24c2a8;};'use strict';var pm2=require(_0xab93('0x0'));var BPromise=require('bluebird');var config=require(_0xab93('0x1'));function connect(){return new BPromise(function(_0x26ce4e,_0x78557c){return pm2[_0xab93('0x2')](function(_0xe1f77f){if(_0xe1f77f){return _0x78557c(_0xe1f77f);}return _0x26ce4e(_0xab93('0x3'));});});};exports['start']=function(_0xfc9f9f){return connect()['then'](function(){return new BPromise(function(_0x360071,_0x329405){return pm2[_0xab93('0x4')](_0xfc9f9f,function(_0x41a259,_0x21c911){if(_0x41a259){return _0x329405(_0x41a259);}pm2['disconnect']();return _0x360071(_0x21c911);});});});};exports[_0xab93('0x5')]=function(_0x58f360){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x2d8d3b,_0xbdefb4){return pm2[_0xab93('0x5')](_0x58f360,function(_0x1677db,_0x44c6de){if(_0x1677db){return _0xbdefb4(_0x1677db);}pm2[_0xab93('0x7')]();return _0x2d8d3b(_0x44c6de);});});});};exports[_0xab93('0x8')]=function(_0x26f312){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x3a6444,_0x4057cc){return pm2[_0xab93('0x8')](_0x26f312,function(_0x2bfdf3,_0x30ceda){if(_0x2bfdf3){return _0x4057cc(_0x2bfdf3);}pm2[_0xab93('0x7')]();return _0x3a6444(_0x30ceda);});});});};exports['list']=function(){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x3fa5d6,_0x45ca27){return pm2[_0xab93('0x9')](function(_0x109929,_0xc01cc0){if(_0x109929){return _0x45ca27(_0x109929);}pm2[_0xab93('0x7')]();return _0x3fa5d6(_0xc01cc0);});});});};exports[_0xab93('0xa')]=function(_0x5bbded){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x133c82,_0x4b2d51){return pm2['describe'](_0x5bbded,function(_0x1150b3,_0x1af2d8){if(_0x1150b3){return _0x4b2d51(_0x1150b3);}pm2[_0xab93('0x7')]();return _0x133c82(_0x1af2d8);});});});};exports[_0xab93('0xb')]=function(_0x8a5d1f){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x362440,_0x34bd26){return pm2[_0xab93('0xb')](_0x8a5d1f,function(_0xc7d283,_0x2a0d1f){if(_0xc7d283){return _0x34bd26(_0xc7d283);}pm2['disconnect']();return _0x362440(_0x2a0d1f);});});});};exports[_0xab93('0xc')]=function(){return connect()[_0xab93('0x6')](function(){return new BPromise(function(_0x4544fe,_0x2878a0){return pm2[_0xab93('0xc')](function(_0x355f8e){if(_0x355f8e){return _0x2878a0(_0x355f8e);}return _0x4544fe(_0xab93('0xd'));});});});}; \ No newline at end of file +var _0xadf5=['connected','start','disconnect','stop','restart','then','list','describe','delete','dump','./config','connect'];(function(_0x1d919b,_0x3188f8){var _0x233c28=function(_0x37927a){while(--_0x37927a){_0x1d919b['push'](_0x1d919b['shift']());}};_0x233c28(++_0x3188f8);}(_0xadf5,0x136));var _0x5adf=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xadf5[_0x25bea7];return _0x175952;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x5adf('0x0'));function connect(){return new BPromise(function(_0x33d938,_0x2865f4){return pm2[_0x5adf('0x1')](function(_0x203370){if(_0x203370){return _0x2865f4(_0x203370);}return _0x33d938(_0x5adf('0x2'));});});};exports[_0x5adf('0x3')]=function(_0x274865){return connect()['then'](function(){return new BPromise(function(_0x53d02a,_0x230edf){return pm2[_0x5adf('0x3')](_0x274865,function(_0x4cb7dd,_0x234acf){if(_0x4cb7dd){return _0x230edf(_0x4cb7dd);}pm2[_0x5adf('0x4')]();return _0x53d02a(_0x234acf);});});});};exports[_0x5adf('0x5')]=function(_0x32c3d8){return connect()['then'](function(){return new BPromise(function(_0x3e74cc,_0x2429f8){return pm2[_0x5adf('0x5')](_0x32c3d8,function(_0x333d5f,_0x38c652){if(_0x333d5f){return _0x2429f8(_0x333d5f);}pm2[_0x5adf('0x4')]();return _0x3e74cc(_0x38c652);});});});};exports[_0x5adf('0x6')]=function(_0x421f9a){return connect()[_0x5adf('0x7')](function(){return new BPromise(function(_0x10be46,_0x35e456){return pm2['restart'](_0x421f9a,function(_0x5ee1f9,_0x295278){if(_0x5ee1f9){return _0x35e456(_0x5ee1f9);}pm2['disconnect']();return _0x10be46(_0x295278);});});});};exports[_0x5adf('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4bb3f4,_0x2c3897){return pm2[_0x5adf('0x8')](function(_0x3f6d40,_0x1fe5c9){if(_0x3f6d40){return _0x2c3897(_0x3f6d40);}pm2['disconnect']();return _0x4bb3f4(_0x1fe5c9);});});});};exports[_0x5adf('0x9')]=function(_0x48752b){return connect()[_0x5adf('0x7')](function(){return new BPromise(function(_0xb77c95,_0x4f6286){return pm2[_0x5adf('0x9')](_0x48752b,function(_0x4208a0,_0x225d0c){if(_0x4208a0){return _0x4f6286(_0x4208a0);}pm2[_0x5adf('0x4')]();return _0xb77c95(_0x225d0c);});});});};exports[_0x5adf('0xa')]=function(_0xf1aadb){return connect()[_0x5adf('0x7')](function(){return new BPromise(function(_0x15d8eb,_0x308ea9){return pm2[_0x5adf('0xa')](_0xf1aadb,function(_0x352e2c,_0x399a34){if(_0x352e2c){return _0x308ea9(_0x352e2c);}pm2['disconnect']();return _0x15d8eb(_0x399a34);});});});};exports[_0x5adf('0xb')]=function(){return connect()[_0x5adf('0x7')](function(){return new BPromise(function(_0x24eb75,_0x3ab148){return pm2[_0x5adf('0xb')](function(_0x5c4c99){if(_0x5c4c99){return _0x3ab148(_0x5c4c99);}return _0x24eb75('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 96a8758..4677339 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 _0xd24c=['length','map','ChatInteraction','update','system','format','info','emit','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','Setting','chatTimeout','then','findAll','lastMsgAt','subtract','minutes'];(function(_0x3dcc8b,_0x21d76d){var _0x216362=function(_0x2ad64a){while(--_0x2ad64a){_0x3dcc8b['push'](_0x3dcc8b['shift']());}};_0x216362(++_0x21d76d);}(_0xd24c,0xae));var _0xcd24=function(_0x440237,_0x403080){_0x440237=_0x440237-0x0;var _0x59c5b8=_0xd24c[_0x440237];return _0x59c5b8;};'use strict';var _=require(_0xcd24('0x0'));var moment=require('moment');var Redis=require(_0xcd24('0x1'));var util=require(_0xcd24('0x2'));var config=require(_0xcd24('0x3'));var db=require(_0xcd24('0x4'))['db'];var logger=require('../logger')('schedule');config[_0xcd24('0x5')]=_[_0xcd24('0x6')](config[_0xcd24('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xcd24('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x504640=0x0;var _0x24b7dc=[];return db[_0xcd24('0x8')]['find']({'raw':!![],'attributes':['id',_0xcd24('0x9')],'where':{'id':0x1}})[_0xcd24('0xa')](function(_0x1379e5){_0x504640=_0x1379e5['chatTimeout'];if(_0x504640){return db['ChatInteraction'][_0xcd24('0xb')]({'raw':!![],'attributes':['id',_0xcd24('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcd24('0xd')](_0x1379e5['chatTimeout'],_0xcd24('0xe'))}}});}else{return[];}})[_0xcd24('0xa')](function(_0x334089){if(_0x334089&&_0x334089[_0xcd24('0xf')]){_0x24b7dc=_[_0xcd24('0x10')](_0x334089||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x24b7dc['join']());return db[_0xcd24('0x11')][_0xcd24('0x12')]({'closeReason':_0xcd24('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xcd24('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x24b7dc}});}})[_0xcd24('0xa')](function(){if(_0x24b7dc&&_0x24b7dc[_0xcd24('0xf')]){logger[_0xcd24('0x15')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x24b7dc['join']());for(var _0x4dcebf=0x0;_0x4dcebf<_0x24b7dc['length'];_0x4dcebf++){io[_0xcd24('0x16')]('chatInteraction:update',{'id':_0x24b7dc[_0x4dcebf],'closed':!![]});}}})[_0xcd24('0x17')](function(_0x554363){logger[_0xcd24('0x18')]('[CHAT]\x20Error\x20closing\x20interactions',_0x554363?util[_0xcd24('0x19')](_0x554363,{'showHidden':![],'depth':null}):'');});}exports[_0xcd24('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc839=['length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes'];(function(_0x4e020a,_0x77ce3e){var _0x4d3608=function(_0x18f0a4){while(--_0x18f0a4){_0x4e020a['push'](_0x4e020a['shift']());}};_0x4d3608(++_0x77ce3e);}(_0xc839,0x19b));var _0x9c83=function(_0x27bd65,_0x5407b3){_0x27bd65=_0x27bd65-0x0;var _0x5dfef=_0xc839[_0x27bd65];return _0x5dfef;};'use strict';var _=require(_0x9c83('0x0'));var moment=require(_0x9c83('0x1'));var Redis=require('ioredis');var util=require(_0x9c83('0x2'));var config=require(_0x9c83('0x3'));var db=require(_0x9c83('0x4'))['db'];var logger=require(_0x9c83('0x5'))(_0x9c83('0x6'));config[_0x9c83('0x7')]=_[_0x9c83('0x8')](config[_0x9c83('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9c83('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x3c9dee=0x0;var _0x132223=[];return db[_0x9c83('0xa')]['find']({'raw':!![],'attributes':['id',_0x9c83('0xb')],'where':{'id':0x1}})[_0x9c83('0xc')](function(_0x3e14b0){_0x3c9dee=_0x3e14b0[_0x9c83('0xb')];if(_0x3c9dee){return db[_0x9c83('0xd')][_0x9c83('0xe')]({'raw':!![],'attributes':['id',_0x9c83('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9c83('0x10')](_0x3e14b0[_0x9c83('0xb')],_0x9c83('0x11'))}}});}else{return[];}})[_0x9c83('0xc')](function(_0x2deb55){if(_0x2deb55&&_0x2deb55[_0x9c83('0x12')]){_0x132223=_[_0x9c83('0x13')](_0x2deb55||[],'id');logger[_0x9c83('0x14')](_0x9c83('0x15'),_0x132223[_0x9c83('0x16')]());return db[_0x9c83('0xd')][_0x9c83('0x17')]({'closeReason':_0x9c83('0x18'),'disposition':_0x9c83('0x19'),'closed':!![],'closedAt':moment()[_0x9c83('0x1a')](_0x9c83('0x1b'))},{'where':{'id':_0x132223}});}})['then'](function(){if(_0x132223&&_0x132223[_0x9c83('0x12')]){logger[_0x9c83('0x14')](_0x9c83('0x1c'),_0x132223['join']());for(var _0x34283d=0x0;_0x34283d<_0x132223['length'];_0x34283d++){io[_0x9c83('0x1d')]('chatInteraction:update',{'id':_0x132223[_0x34283d],'closed':!![]});}}})['catch'](function(_0x386ae8){logger[_0x9c83('0x1e')]('[CHAT]\x20Error\x20closing\x20interactions',_0x386ae8?util[_0x9c83('0x1f')](_0x386ae8,{'showHidden':![],'depth':null}):'');});}exports[_0x9c83('0x20')]=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 d6bfe06..ec80be5 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 _0xaa5e=['YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','toString','keyBy','difference','length','exists','stop','deleteJob','cron','startAt','start','stop\x20cron','isBetween','endAt','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','format','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','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','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract'];(function(_0x59ee81,_0x5f1543){var _0x45505e=function(_0x402c46){while(--_0x402c46){_0x59ee81['push'](_0x59ee81['shift']());}};_0x45505e(++_0x5f1543);}(_0xaa5e,0xbb));var _0xeaa5=function(_0x182f00,_0x5698e9){_0x182f00=_0x182f00-0x0;var _0x352208=_0xaa5e[_0x182f00];return _0x352208;};'use strict';var fs=require('fs');var util=require(_0xeaa5('0x0'));var path=require(_0xeaa5('0x1'));var _=require(_0xeaa5('0x2'));var moment=require(_0xeaa5('0x3'));var CronJobManager=require(_0xeaa5('0x4'));var jayson=require(_0xeaa5('0x5'));var BPromise=require('bluebird');var logger=require(_0xeaa5('0x6'))(_0xeaa5('0x7'));var db=require(_0xeaa5('0x8'))['db'];var analyticCustomReportController=require(_0xeaa5('0x9'));var analyticDefaultReportController=require(_0xeaa5('0xa'));var client=jayson[_0xeaa5('0xb')][_0xeaa5('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x235f59,_0x47834d){return function(){logger['info'](_0xeaa5('0xd'),_0x235f59[_0xeaa5('0xe')]);var _0x5e52f9=!![];var _0x31d76b={'tls':{'rejectUnauthorized':![]}};if(_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')][_0xeaa5('0x11')]){_0x31d76b['service']=_0x235f59[_0xeaa5('0xf')]['Smtp'][_0xeaa5('0x11')];}else{_0x31d76b['host']=_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')][_0xeaa5('0x12')];_0x31d76b['port']=_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')][_0xeaa5('0x13')];_0x31d76b['secure']=_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')][_0xeaa5('0x14')];}if(_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')][_0xeaa5('0x15')]){_0x31d76b[_0xeaa5('0x16')]={'user':_0x235f59[_0xeaa5('0xf')]['Smtp'][_0xeaa5('0x17')],'pass':_0x235f59[_0xeaa5('0xf')][_0xeaa5('0x10')]['pass']};}var _0x28a738={'account':_0x31d76b,'message':{'from':util[_0xeaa5('0x18')]('\x22%s\x22\x20<%s>',_0x235f59[_0xeaa5('0xf')]['name'],_0x235f59[_0xeaa5('0xf')][_0xeaa5('0xe')]||_0x235f59['MailAccount'][_0xeaa5('0x10')]['user']),'to':_0x235f59[_0xeaa5('0xe')],'cc':_0x235f59['cc'],'bcc':_0x235f59[_0xeaa5('0x19')],'subject':util[_0xeaa5('0x18')]('Report\x20%s\x20last\x20%s\x20%s',_0x47834d[_0xeaa5('0x1a')],_0x235f59[_0xeaa5('0x1b')],_0x235f59[_0xeaa5('0x1c')])}};var _0x1fca96=path[_0xeaa5('0x1d')](__dirname,_0xeaa5('0x1e'));var _0xee5987=_0x47834d[_0xeaa5('0x1f')];var _0x1c1f9b=util[_0xeaa5('0x18')](_0xeaa5('0x20'),path['basename'](_0x47834d['savename'],path[_0xeaa5('0x21')](_0x47834d[_0xeaa5('0x1f')])),'zip');var _0x312efe=path[_0xeaa5('0x1d')](_0x1fca96,_0xee5987);var _0x5dbe49=path[_0xeaa5('0x1d')](_0x1fca96,_0x1c1f9b);if(fs[_0xeaa5('0x22')](_0x312efe)){_0x47834d[_0xeaa5('0x23')]=_0xeaa5('0x24');_0x28a738['message']['attachments']=[{'filename':_0xee5987,'path':_0x312efe}];_0x28a738[_0xeaa5('0x25')][_0xeaa5('0x26')]=util[_0xeaa5('0x18')](_0xeaa5('0x27'),JSON[_0xeaa5('0x28')](_0x47834d,null,0x2));}else if(fs[_0xeaa5('0x22')](_0x5dbe49)){_0x47834d[_0xeaa5('0x23')]=_0xeaa5('0x24');_0x28a738[_0xeaa5('0x25')][_0xeaa5('0x29')]=[{'filename':_0x1c1f9b,'path':_0x5dbe49}];}else{_0x28a738[_0xeaa5('0x25')][_0xeaa5('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x235f59[_0xeaa5('0x2a')]){_0x5e52f9=![];logger[_0xeaa5('0x2b')](_0xeaa5('0x2c'));}}if(_0x5e52f9){return client['request'](_0xeaa5('0x2d'),_0x28a738)[_0xeaa5('0x2e')](function(_0x3970c1){if(_0x3970c1['error']){return logger[_0xeaa5('0x2f')](_0xeaa5('0x30'),JSON[_0xeaa5('0x28')](_0x3970c1));}return logger['info'](_0xeaa5('0x31'));})[_0xeaa5('0x32')](function(_0x35eece){return logger[_0xeaa5('0x2f')](_0xeaa5('0x30'),JSON[_0xeaa5('0x28')](_0x35eece));});}};}function handleError(){return function(_0x21d336){return logger[_0xeaa5('0x2f')](JSON[_0xeaa5('0x28')](_0x21d336));};}function handleResult(_0x55c9c3){return function(_0x4cb1db){logger[_0xeaa5('0x2b')](_0xeaa5('0x33'),JSON[_0xeaa5('0x28')](_0x4cb1db));if(_0x55c9c3['MailAccount']&&_0x55c9c3['MailAccount'][_0xeaa5('0x10')]&&!_[_0xeaa5('0x34')](_0x55c9c3[_0xeaa5('0xe')])){setTimeout(handleSendEmail(_0x55c9c3,_0x4cb1db),0x3c*0x3e8);}};}function handleJob(_0x3eae58){return function(){try{if(_['isNil'](_0x3eae58[_0xeaa5('0x1b')])){return logger[_0xeaa5('0x2b')](_0xeaa5('0x35'));}if(_['isNil'](_0x3eae58[_0xeaa5('0x1c')])){return logger[_0xeaa5('0x2b')](_0xeaa5('0x36'));}var _0x27d387={'startDate':moment()[_0xeaa5('0x37')](_0x3eae58[_0xeaa5('0x1b')],_0x3eae58['subtractUnit'])[_0xeaa5('0x18')](_0xeaa5('0x38')),'endDate':moment()[_0xeaa5('0x18')](_0xeaa5('0x38')),'type':_0xeaa5('0x39'),'output':_0x3eae58['output'],'name':_0x3eae58['name']};if(!_[_0xeaa5('0x34')](_0x3eae58[_0xeaa5('0x3a')])){logger[_0xeaa5('0x2b')](_0xeaa5('0x3b'),_0x3eae58[_0xeaa5('0x3a')]);return analyticDefaultReportController[_0xeaa5('0x3c')]({'id':_0x3eae58[_0xeaa5('0x3a')]},_0x27d387)['then'](handleResult(_0x3eae58))[_0xeaa5('0x32')](handleError());}if(!_[_0xeaa5('0x34')](_0x3eae58[_0xeaa5('0x3d')])){logger[_0xeaa5('0x2b')](_0xeaa5('0x3e'),_0x3eae58[_0xeaa5('0x3d')]);return analyticCustomReportController[_0xeaa5('0x3c')]({'id':_0x3eae58[_0xeaa5('0x3d')]},_0x27d387)['then'](handleResult(_0x3eae58))[_0xeaa5('0x32')](handleError());}}catch(_0x512745){logger[_0xeaa5('0x2f')](JSON[_0xeaa5('0x28')](_0x512745));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x2c85fa){var _0x28fbcb={};if(_0x2c85fa){_0x28fbcb['id']=_0x2c85fa;}return db[_0xeaa5('0x3f')][_0xeaa5('0x40')]({'where':_0x28fbcb,'include':[{'model':db[_0xeaa5('0xf')],'attributes':['id',_0xeaa5('0x1a'),_0xeaa5('0xe')],'include':[{'model':db[_0xeaa5('0x41')],'as':_0xeaa5('0x10')}]}]})[_0xeaa5('0x2e')](function(_0x5ae2c7){var _0xdb5918=_['keys'](manager['jobs']);var _0xdaab71=_['map'](_0x5ae2c7,function(_0x2668f6){return _0x2668f6['id'][_0xeaa5('0x42')]();});var _0xc76a76=_[_0xeaa5('0x43')](_0x5ae2c7,function(_0x212385){return _0x212385['id'][_0xeaa5('0x42')]();});var _0x2608ec=_0x2c85fa?_0xdaab71:_[_0xeaa5('0x44')](_0xdaab71,_0xdb5918);var _0x41d7d8=_['intersection'](_0xdaab71,_0xdb5918);var _0x160ed9=_[_0xeaa5('0x44')](_0xdb5918,_0xdaab71);var _0x24c067;var _0x6e36ef;for(_0x24c067=0x0;_0x24c067<_0x160ed9[_0xeaa5('0x45')]&&!_0x2c85fa;_0x24c067+=0x1){_0x6e36ef=_0x160ed9[_0x24c067]['toString']();if(manager[_0xeaa5('0x46')](_0x6e36ef)){manager[_0xeaa5('0x47')](_0x6e36ef);manager[_0xeaa5('0x48')](_0x6e36ef);logger[_0xeaa5('0x2b')]('delete\x20cron',_0x6e36ef);}}logger[_0xeaa5('0x2b')]('toRun',JSON['stringify'](_0x2608ec));for(_0x24c067=0x0;_0x24c067<_0x2608ec['length'];_0x24c067+=0x1){_0x6e36ef=_0x2608ec[_0x24c067][_0xeaa5('0x42')]();logger['info']('index',_0x6e36ef);if(_0x2c85fa){logger[_0xeaa5('0x2b')]('my\x20id',_0x2c85fa);logger[_0xeaa5('0x2b')](JSON[_0xeaa5('0x28')](_0xc76a76[_0x6e36ef]));BPromise['resolve']()[_0xeaa5('0x2e')](handleJob(_0xc76a76[_0x6e36ef]));logger[_0xeaa5('0x2b')]('run\x20job',_0xc76a76[_0x6e36ef]['name'],_0xc76a76[_0x6e36ef][_0xeaa5('0x49')]);}else if(_0xc76a76[_0x6e36ef]['cron']&&_0xc76a76[_0x6e36ef]['active']&&moment()['isBetween'](_0xc76a76[_0x6e36ef][_0xeaa5('0x4a')],_0xc76a76[_0x6e36ef]['endAt'])){manager['add'](_0x6e36ef,_0xc76a76[_0x6e36ef][_0xeaa5('0x49')],handleJob(_0xc76a76[_0x6e36ef]));manager[_0xeaa5('0x4b')](_0x6e36ef);logger[_0xeaa5('0x2b')]('add\x20cron',_0xc76a76[_0x6e36ef][_0xeaa5('0x1a')],_0xc76a76[_0x6e36ef][_0xeaa5('0x49')]);}else if(manager[_0xeaa5('0x46')](_0x6e36ef)){manager[_0xeaa5('0x47')](_0x6e36ef);manager[_0xeaa5('0x48')](_0x6e36ef);logger[_0xeaa5('0x2b')](_0xeaa5('0x4c'),_0xc76a76[_0x6e36ef][_0xeaa5('0x1a')],_0xc76a76[_0x6e36ef]['cron']);}}for(_0x24c067=0x0,_0x6e36ef;_0x24c067<_0x41d7d8['length']&&!_0x2c85fa;_0x24c067+=0x1){_0x6e36ef=_0x41d7d8[_0x24c067]['toString']();if(manager[_0xeaa5('0x46')](_0x6e36ef)){if(_0xc76a76[_0x6e36ef][_0xeaa5('0x49')]&&_0xc76a76[_0x6e36ef]['active']&&moment()[_0xeaa5('0x4d')](_0xc76a76[_0x6e36ef][_0xeaa5('0x4a')],_0xc76a76[_0x6e36ef][_0xeaa5('0x4e')])){manager['update'](_0x6e36ef,_0xc76a76[_0x6e36ef][_0xeaa5('0x49')],handleJob(_0xc76a76[_0x6e36ef]));logger[_0xeaa5('0x2b')](_0xeaa5('0x4f'),_0xc76a76[_0x6e36ef][_0xeaa5('0x1a')],_0xc76a76[_0x6e36ef][_0xeaa5('0x49')]);}else{manager[_0xeaa5('0x47')](_0x6e36ef);manager[_0xeaa5('0x48')](_0x6e36ef);logger[_0xeaa5('0x2b')](_0xeaa5('0x4c'),_0xc76a76[_0x6e36ef][_0xeaa5('0x1a')],_0xc76a76[_0x6e36ef][_0xeaa5('0x49')]);}}}})[_0xeaa5('0x32')](function(_0x321d93){logger[_0xeaa5('0x2f')](JSON[_0xeaa5('0x28')](_0x321d93));});}exports[_0xeaa5('0x50')]=function(_0x12a7b9){return getJobs(_0x12a7b9);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x008b=['text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','keys','jobs','map','toString','keyBy','difference','intersection','length','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','exists','stop','stop\x20cron','endAt','update\x20cron','run','util','path','lodash','moment','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','message','attachments'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x008b,0x95));var _0xb008=function(_0x53d859,_0x111d6d){_0x53d859=_0x53d859-0x0;var _0x9eefb2=_0x008b[_0x53d859];return _0x9eefb2;};'use strict';var fs=require('fs');var util=require(_0xb008('0x0'));var path=require(_0xb008('0x1'));var _=require(_0xb008('0x2'));var moment=require(_0xb008('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0xb008('0x4'));var logger=require(_0xb008('0x5'))(_0xb008('0x6'));var db=require(_0xb008('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb008('0x8'));var client=jayson[_0xb008('0x9')][_0xb008('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3baa1b,_0x51543a){return function(){logger[_0xb008('0xb')](_0xb008('0xc'),_0x3baa1b[_0xb008('0xd')]);var _0x4058cd=!![];var _0x22dda1={'tls':{'rejectUnauthorized':![]}};if(_0x3baa1b[_0xb008('0xe')][_0xb008('0xf')][_0xb008('0x10')]){_0x22dda1[_0xb008('0x10')]=_0x3baa1b[_0xb008('0xe')]['Smtp'][_0xb008('0x10')];}else{_0x22dda1[_0xb008('0x11')]=_0x3baa1b['MailAccount'][_0xb008('0xf')][_0xb008('0x11')];_0x22dda1[_0xb008('0x12')]=_0x3baa1b['MailAccount']['Smtp'][_0xb008('0x12')];_0x22dda1[_0xb008('0x13')]=_0x3baa1b['MailAccount']['Smtp']['secure'];}if(_0x3baa1b[_0xb008('0xe')][_0xb008('0xf')][_0xb008('0x14')]){_0x22dda1[_0xb008('0x15')]={'user':_0x3baa1b['MailAccount'][_0xb008('0xf')][_0xb008('0x16')],'pass':_0x3baa1b[_0xb008('0xe')]['Smtp'][_0xb008('0x17')]};}var _0x5e2853={'account':_0x22dda1,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3baa1b['MailAccount']['name'],_0x3baa1b[_0xb008('0xe')][_0xb008('0xd')]||_0x3baa1b[_0xb008('0xe')][_0xb008('0xf')][_0xb008('0x16')]),'to':_0x3baa1b[_0xb008('0xd')],'cc':_0x3baa1b['cc'],'bcc':_0x3baa1b[_0xb008('0x18')],'subject':util[_0xb008('0x19')](_0xb008('0x1a'),_0x51543a['name'],_0x3baa1b[_0xb008('0x1b')],_0x3baa1b[_0xb008('0x1c')])}};var _0x22ec92=path[_0xb008('0x1d')](__dirname,_0xb008('0x1e'));var _0x727db8=_0x51543a[_0xb008('0x1f')];var _0x1bcae5=util[_0xb008('0x19')](_0xb008('0x20'),path[_0xb008('0x21')](_0x51543a['savename'],path[_0xb008('0x22')](_0x51543a[_0xb008('0x1f')])),_0xb008('0x23'));var _0x2aed8d=path[_0xb008('0x1d')](_0x22ec92,_0x727db8);var _0x4271f2=path[_0xb008('0x1d')](_0x22ec92,_0x1bcae5);if(fs['existsSync'](_0x2aed8d)){_0x51543a[_0xb008('0x24')]='Sent';_0x5e2853[_0xb008('0x25')][_0xb008('0x26')]=[{'filename':_0x727db8,'path':_0x2aed8d}];_0x5e2853[_0xb008('0x25')][_0xb008('0x27')]=util['format'](_0xb008('0x28'),JSON['stringify'](_0x51543a,null,0x2));}else if(fs[_0xb008('0x29')](_0x4271f2)){_0x51543a[_0xb008('0x24')]=_0xb008('0x2a');_0x5e2853['message'][_0xb008('0x26')]=[{'filename':_0x1bcae5,'path':_0x4271f2}];}else{_0x5e2853['message']['text']=_0xb008('0x2b');if(!_0x3baa1b[_0xb008('0x2c')]){_0x4058cd=![];logger[_0xb008('0xb')](_0xb008('0x2d'));}}if(_0x4058cd){return client[_0xb008('0x2e')](_0xb008('0x2f'),_0x5e2853)[_0xb008('0x30')](function(_0x1f98a5){if(_0x1f98a5[_0xb008('0x31')]){return logger[_0xb008('0x31')](_0xb008('0x32'),JSON['stringify'](_0x1f98a5));}return logger['info'](_0xb008('0x33'));})[_0xb008('0x34')](function(_0x4d3467){return logger[_0xb008('0x31')]('error\x20mail',JSON[_0xb008('0x35')](_0x4d3467));});}};}function handleError(){return function(_0x3bde2e){return logger['error'](JSON[_0xb008('0x35')](_0x3bde2e));};}function handleResult(_0x10ceff){return function(_0x8e2463){logger[_0xb008('0xb')](_0xb008('0x36'),JSON[_0xb008('0x35')](_0x8e2463));if(_0x10ceff[_0xb008('0xe')]&&_0x10ceff['MailAccount'][_0xb008('0xf')]&&!_[_0xb008('0x37')](_0x10ceff[_0xb008('0xd')])){setTimeout(handleSendEmail(_0x10ceff,_0x8e2463),0x3c*0x3e8);}};}function handleJob(_0x577e55){return function(){try{if(_[_0xb008('0x37')](_0x577e55[_0xb008('0x1b')])){return logger[_0xb008('0xb')](_0xb008('0x38'));}if(_['isNil'](_0x577e55['subtractUnit'])){return logger[_0xb008('0xb')](_0xb008('0x39'));}var _0x129cb2={'startDate':moment()['subtract'](_0x577e55[_0xb008('0x1b')],_0x577e55[_0xb008('0x1c')])['format'](_0xb008('0x3a')),'endDate':moment()[_0xb008('0x19')](_0xb008('0x3a')),'type':_0xb008('0x3b'),'output':_0x577e55[_0xb008('0x3c')],'name':_0x577e55[_0xb008('0x3d')]};if(!_[_0xb008('0x37')](_0x577e55[_0xb008('0x3e')])){logger[_0xb008('0xb')](_0xb008('0x3f'),_0x577e55[_0xb008('0x3e')]);return analyticDefaultReportController[_0xb008('0x40')]({'id':_0x577e55[_0xb008('0x3e')]},_0x129cb2)[_0xb008('0x30')](handleResult(_0x577e55))[_0xb008('0x34')](handleError());}if(!_[_0xb008('0x37')](_0x577e55[_0xb008('0x41')])){logger[_0xb008('0xb')]('exec\x20custom\x20report\x20id:%s',_0x577e55[_0xb008('0x41')]);return analyticCustomReportController[_0xb008('0x40')]({'id':_0x577e55[_0xb008('0x41')]},_0x129cb2)[_0xb008('0x30')](handleResult(_0x577e55))['catch'](handleError());}}catch(_0x488620){logger['error'](JSON[_0xb008('0x35')](_0x488620));}return logger[_0xb008('0xb')](_0xb008('0x42'));};}function getJobs(_0x40ecf3){var _0x3d90aa={};if(_0x40ecf3){_0x3d90aa['id']=_0x40ecf3;}return db['Schedule'][_0xb008('0x43')]({'where':_0x3d90aa,'include':[{'model':db[_0xb008('0xe')],'attributes':['id',_0xb008('0x3d'),_0xb008('0xd')],'include':[{'model':db['MailServerOut'],'as':_0xb008('0xf')}]}]})[_0xb008('0x30')](function(_0x3b9278){var _0x2c2008=_[_0xb008('0x44')](manager[_0xb008('0x45')]);var _0x27e2b6=_[_0xb008('0x46')](_0x3b9278,function(_0x106f82){return _0x106f82['id'][_0xb008('0x47')]();});var _0x265845=_[_0xb008('0x48')](_0x3b9278,function(_0x404114){return _0x404114['id'][_0xb008('0x47')]();});var _0x15afb4=_0x40ecf3?_0x27e2b6:_[_0xb008('0x49')](_0x27e2b6,_0x2c2008);var _0x441ae9=_[_0xb008('0x4a')](_0x27e2b6,_0x2c2008);var _0x52387b=_[_0xb008('0x49')](_0x2c2008,_0x27e2b6);var _0x26e018;var _0x4ea5e1;for(_0x26e018=0x0;_0x26e018<_0x52387b[_0xb008('0x4b')]&&!_0x40ecf3;_0x26e018+=0x1){_0x4ea5e1=_0x52387b[_0x26e018][_0xb008('0x47')]();if(manager['exists'](_0x4ea5e1)){manager['stop'](_0x4ea5e1);manager[_0xb008('0x4c')](_0x4ea5e1);logger['info']('delete\x20cron',_0x4ea5e1);}}logger[_0xb008('0xb')](_0xb008('0x4d'),JSON[_0xb008('0x35')](_0x15afb4));for(_0x26e018=0x0;_0x26e018<_0x15afb4[_0xb008('0x4b')];_0x26e018+=0x1){_0x4ea5e1=_0x15afb4[_0x26e018][_0xb008('0x47')]();logger['info']('index',_0x4ea5e1);if(_0x40ecf3){logger[_0xb008('0xb')](_0xb008('0x4e'),_0x40ecf3);logger[_0xb008('0xb')](JSON[_0xb008('0x35')](_0x265845[_0x4ea5e1]));BPromise[_0xb008('0x4f')]()[_0xb008('0x30')](handleJob(_0x265845[_0x4ea5e1]));logger['info'](_0xb008('0x50'),_0x265845[_0x4ea5e1]['name'],_0x265845[_0x4ea5e1][_0xb008('0x51')]);}else if(_0x265845[_0x4ea5e1][_0xb008('0x51')]&&_0x265845[_0x4ea5e1][_0xb008('0x52')]&&moment()[_0xb008('0x53')](_0x265845[_0x4ea5e1][_0xb008('0x54')],_0x265845[_0x4ea5e1]['endAt'])){manager[_0xb008('0x55')](_0x4ea5e1,_0x265845[_0x4ea5e1][_0xb008('0x51')],handleJob(_0x265845[_0x4ea5e1]));manager[_0xb008('0x56')](_0x4ea5e1);logger[_0xb008('0xb')](_0xb008('0x57'),_0x265845[_0x4ea5e1][_0xb008('0x3d')],_0x265845[_0x4ea5e1][_0xb008('0x51')]);}else if(manager[_0xb008('0x58')](_0x4ea5e1)){manager[_0xb008('0x59')](_0x4ea5e1);manager[_0xb008('0x4c')](_0x4ea5e1);logger[_0xb008('0xb')](_0xb008('0x5a'),_0x265845[_0x4ea5e1][_0xb008('0x3d')],_0x265845[_0x4ea5e1]['cron']);}}for(_0x26e018=0x0,_0x4ea5e1;_0x26e018<_0x441ae9[_0xb008('0x4b')]&&!_0x40ecf3;_0x26e018+=0x1){_0x4ea5e1=_0x441ae9[_0x26e018][_0xb008('0x47')]();if(manager[_0xb008('0x58')](_0x4ea5e1)){if(_0x265845[_0x4ea5e1][_0xb008('0x51')]&&_0x265845[_0x4ea5e1]['active']&&moment()[_0xb008('0x53')](_0x265845[_0x4ea5e1][_0xb008('0x54')],_0x265845[_0x4ea5e1][_0xb008('0x5b')])){manager['update'](_0x4ea5e1,_0x265845[_0x4ea5e1][_0xb008('0x51')],handleJob(_0x265845[_0x4ea5e1]));logger[_0xb008('0xb')](_0xb008('0x5c'),_0x265845[_0x4ea5e1]['name'],_0x265845[_0x4ea5e1][_0xb008('0x51')]);}else{manager[_0xb008('0x59')](_0x4ea5e1);manager['deleteJob'](_0x4ea5e1);logger['info'](_0xb008('0x5a'),_0x265845[_0x4ea5e1][_0xb008('0x3d')],_0x265845[_0x4ea5e1]['cron']);}}}})[_0xb008('0x34')](function(_0x490a7c){logger[_0xb008('0x31')](JSON[_0xb008('0x35')](_0x490a7c));});}exports[_0xb008('0x5d')]=function(_0x358837){return getJobs(_0x358837);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index a5c0e28..1e1d87e 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 _0x131e=['catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','then','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','update','SentimentScore','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Negative','Mixed'];(function(_0x12669d,_0x79268){var _0x2d84ec=function(_0x2b3350){while(--_0x2b3350){_0x12669d['push'](_0x12669d['shift']());}};_0x2d84ec(++_0x79268);}(_0x131e,0x1ec));var _0xe131=function(_0x3a5670,_0x4d482b){_0x3a5670=_0x3a5670-0x0;var _0xac0919=_0x131e[_0x3a5670];return _0xac0919;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xe131('0x0'));var BPromise=require(_0xe131('0x1'));var db=require(_0xe131('0x2'))['db'];var logger=require(_0xe131('0x3'))(_0xe131('0x4'));function getTranscriptionJob(_0x761c,_0x4ff7f7,_0x2fc440,_0x344903){return new Promise(function(_0x2de969,_0x1eb0df){var _0x1002a6=new AWS['TranscribeService']({'accessKeyId':_0x4ff7f7,'secretAccessKey':_0x761c,'region':_0x2fc440});_0x1002a6['getTranscriptionJob']({'TranscriptionJobName':_0x344903},function(_0x562617,_0x4bf386){if(_0x562617){return _0x1eb0df(_0x562617);}else{return _0x2de969(_0x4bf386);}});});}function sentiment(_0x241f05,_0x210bb5,_0x530ecb,_0xfdbf4c,_0x4e126a){return new Promise(function(_0x149011,_0x18f749){var _0x5ae4c1=new AWS[(_0xe131('0x5'))]({'accessKeyId':_0x210bb5,'secretAccessKey':_0x241f05,'region':_0x530ecb});_0x5ae4c1[_0xe131('0x6')]({'Text':_0xfdbf4c,'LanguageCode':_0x4e126a[_0xe131('0x7')](0x0,0x2)},function(_0x12f2cf,_0x555b36){if(_0x12f2cf){return _0x18f749(_0x12f2cf);}else{return _0x149011(_0x555b36);}});});}function checkTranscribeJob(_0x55768a,_0x554db6,_0x5f0434){var _0x14ed9a;return new BPromise(function(_0x1714db,_0x33938d){logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0xa'),_0x55768a['id'],_0x55768a[_0xe131('0xb')]));return getTranscriptionJob(_0x5f0434[_0xe131('0xc')],_0x5f0434[_0xe131('0xd')],_0x554db6['transcribeRegion'],_0x55768a['transcribeName'])['then'](function(_0x5a6ca9){logger['info'](util[_0xe131('0x9')](_0xe131('0xe'),_0x55768a['id'],_0x55768a[_0xe131('0xb')],_0x5a6ca9['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x55768a[_0xe131('0xf')]){switch(_0x5a6ca9[_0xe131('0x10')][_0xe131('0x11')]){case _0xe131('0x12'):var _0x317200={'transcribeStatus':_0x5a6ca9[_0xe131('0x10')]['TranscriptionJobStatus'],'fileUri':_0x5a6ca9[_0xe131('0x10')][_0xe131('0x13')][_0xe131('0x14')]};logger[_0xe131('0x8')](util[_0xe131('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x55768a['id']));return rp({'uri':_0x5a6ca9['TranscriptionJob'][_0xe131('0x13')][_0xe131('0x14')],'json':!![]})['then'](function(_0x42df0a){logger['info'](util['format'](_0xe131('0x15'),_0x55768a['id']));if(_0x42df0a&&_0x42df0a[_0xe131('0x16')]&&_0x42df0a[_0xe131('0x16')][_0xe131('0x17')]&&_0x42df0a[_0xe131('0x16')][_0xe131('0x17')][_0xe131('0x18')]){_0x317200['fileText']='';for(var _0x2be2df=0x0;_0x2be2df<_0x42df0a[_0xe131('0x16')]['transcripts']['length'];_0x2be2df++){_0x317200[_0xe131('0xf')]+=_0x42df0a['results'][_0xe131('0x17')][_0x2be2df][_0xe131('0x19')]+'';}}return _0x55768a['update'](_0x317200);})[_0xe131('0x1a')](function(){logger[_0xe131('0x8')](util[_0xe131('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x55768a['id']));if(!_0x55768a[_0xe131('0x1b')]){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x1e'));}if(!_0x554db6[_0xe131('0x1f')]||!_0x554db6[_0xe131('0x20')]||!_0x554db6[_0xe131('0x21')]||!_0x554db6[_0xe131('0x22')]||!_0x554db6[_0xe131('0x23')]){throw new db[(_0xe131('0x1c'))]['ValidationError'](_0xe131('0x24'));}if(!_0x317200['fileText']){throw new Error(_0xe131('0x25'));}if(_0x554db6['sentimentAccountId']===_0x5f0434['id']){return _0x5f0434;}else{return db[_0xe131('0x26')]['findOne']({'where':{'id':_settings[_0xe131('0x20')]}});}})[_0xe131('0x1a')](function(_0x306082){if(!_0x306082){throw new db['Sequelize']['ValidationError'](_0xe131('0x27'));}if(!_0x306082[_0xe131('0xc')]||!_0x306082[_0xe131('0xd')]){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x28'));}_0x14ed9a=_0x306082;logger[_0xe131('0x8')](util[_0xe131('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x55768a['id']));return sentiment(_0x14ed9a['data1'],_0x14ed9a[_0xe131('0xd')],_0x554db6[_0xe131('0x21')],_0x317200[_0xe131('0xf')],_0x554db6[_0xe131('0x22')]);})[_0xe131('0x1a')](function(_0x44cc9f){logger[_0xe131('0x8')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x55768a['id']));return _0x55768a[_0xe131('0x29')]({'sentiment':_0x44cc9f['Sentiment'],'sPositive':_0x44cc9f[_0xe131('0x2a')]['Positive'],'sNegative':_0x44cc9f[_0xe131('0x2a')]['Negative'],'sMixed':_0x44cc9f[_0xe131('0x2a')]['Mixed'],'sNeutral':_0x44cc9f[_0xe131('0x2a')][_0xe131('0x2b')]});})[_0xe131('0x1a')](function(){logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x2c'),_0x55768a['id']));_0x1714db();});case'FAILED':return _0x55768a[_0xe131('0x29')]({'transcribeStatus':'FAILED','failureReason':_0x5a6ca9[_0xe131('0x10')]['FailureReason']})[_0xe131('0x1a')](function(){logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x2c'),_0x55768a['id']));_0x1714db();});default:logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x2d'),_0x55768a['id']));break;}}else{return BPromise['resolve']()[_0xe131('0x1a')](function(){if(!_0x55768a['tempSentiment']){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x554db6['sentiment']||!_0x554db6[_0xe131('0x20')]||!_0x554db6['sentimentRegion']||!_0x554db6['language']||!_0x554db6[_0xe131('0x23')]){throw new db['Sequelize'][(_0xe131('0x1d'))](_0xe131('0x24'));}if(!_0x55768a['fileText']){throw new Error(_0xe131('0x25'));}if(_0x554db6[_0xe131('0x20')]===_0x5f0434['id']){return _0x5f0434;}else{return db[_0xe131('0x26')][_0xe131('0x2e')]({'where':{'id':_settings[_0xe131('0x20')]}});}})['then'](function(_0x512409){if(!_0x512409){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x27'));}if(!_0x512409['data1']||!_0x512409[_0xe131('0xd')]){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x14ed9a=_0x512409;logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x2f'),_0x55768a['id']));return sentiment(_0x14ed9a['data1'],_0x14ed9a[_0xe131('0xd')],_0x554db6[_0xe131('0x21')],_0x55768a[_0xe131('0xf')],_0x554db6['language']);})[_0xe131('0x1a')](function(_0x3ad7ab){logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x30'),_0x55768a['id']));return _0x55768a[_0xe131('0x29')]({'sentiment':_0x3ad7ab[_0xe131('0x31')],'sPositive':_0x3ad7ab['SentimentScore']['Positive'],'sNegative':_0x3ad7ab[_0xe131('0x2a')][_0xe131('0x32')],'sMixed':_0x3ad7ab[_0xe131('0x2a')][_0xe131('0x33')],'sNeutral':_0x3ad7ab[_0xe131('0x2a')][_0xe131('0x2b')],'transcribeStatus':'COMPLETED'});})[_0xe131('0x1a')](function(){logger[_0xe131('0x8')](util[_0xe131('0x9')](_0xe131('0x2c'),_0x55768a['id']));_0x1714db();});}})[_0xe131('0x34')](function(_0x9cb89){if(_0x9cb89){if(!_0x9cb89['name']||_0x9cb89[_0xe131('0x35')]!==_0xe131('0x36')){logger[_0xe131('0x37')](util[_0xe131('0x9')](_0xe131('0x38'),_0x55768a['id']),util[_0xe131('0x39')](_0x9cb89,{'showHidden':![],'depth':null}));}}_0x1714db();});});}function checkTranscribe(){var _0x2f8dee;var _0x3fd16e;var _0x3d7ae8;return db[_0xe131('0x3a')][_0xe131('0x3b')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xe131('0x1a')](function(_0x5b03ab){if(!_0x5b03ab||!_0x5b03ab['length']){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x3c'));}_0x2f8dee=_0x5b03ab;return db[_0xe131('0x3d')][_0xe131('0x2e')]({'where':{'id':0x1}});})[_0xe131('0x1a')](function(_0xf4dbe4){if(!_0xf4dbe4){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x3e'));}_0x3fd16e=_0xf4dbe4;if(!_0x3fd16e[_0xe131('0x4')]||!_0x3fd16e['transcribeAccountId']||!_0x3fd16e['transcribeRegion']||!_0x3fd16e[_0xe131('0x22')]||!_0x3fd16e[_0xe131('0x23')]){throw new db['Sequelize']['ValidationError'](_0xe131('0x3f'));}return db['CloudProvider']['findOne']({'where':{'id':_0x3fd16e[_0xe131('0x40')]}});})[_0xe131('0x1a')](function(_0x32e45d){if(!_0x32e45d){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))](_0xe131('0x27'));}if(!_0x32e45d['data1']||!_0x32e45d['data2']){throw new db[(_0xe131('0x1c'))][(_0xe131('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x3d7ae8=_0x32e45d;var _0x19692b=[];_0x2f8dee[_0xe131('0x41')](function(_0x1b6b7a){_0x19692b[_0xe131('0x42')](checkTranscribeJob(_0x1b6b7a,_0x3fd16e,_0x3d7ae8));});return BPromise[_0xe131('0x43')](_0x19692b);})[_0xe131('0x34')](function(_0x4a9ad6){if(_0x4a9ad6){if(!_0x4a9ad6[_0xe131('0x35')]||_0x4a9ad6['name']!=='SequelizeValidationError'){logger[_0xe131('0x37')](util[_0xe131('0x39')](_0x4a9ad6,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xce25=['TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','fileText','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','Mixed','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','start','request-promise','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','then','info','transcribeName'];(function(_0x1c8986,_0xd9f9d5){var _0x18f21f=function(_0x5a5543){while(--_0x5a5543){_0x1c8986['push'](_0x1c8986['shift']());}};_0x18f21f(++_0xd9f9d5);}(_0xce25,0x196));var _0x5ce2=function(_0x476ff5,_0x33ec04){_0x476ff5=_0x476ff5-0x0;var _0x14800c=_0xce25[_0x476ff5];return _0x14800c;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x5ce2('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x5ce2('0x1'))(_0x5ce2('0x2'));function getTranscriptionJob(_0x58f9eb,_0x3f4b36,_0x41a229,_0x54f598){return new Promise(function(_0x57a7a5,_0x41fb85){var _0x417149=new AWS[(_0x5ce2('0x3'))]({'accessKeyId':_0x3f4b36,'secretAccessKey':_0x58f9eb,'region':_0x41a229});_0x417149[_0x5ce2('0x4')]({'TranscriptionJobName':_0x54f598},function(_0x4a57a6,_0x2ccf81){if(_0x4a57a6){return _0x41fb85(_0x4a57a6);}else{return _0x57a7a5(_0x2ccf81);}});});}function sentiment(_0x412b62,_0x166c86,_0x49ede4,_0x2c2cee,_0x13e872){return new Promise(function(_0x1ff8d9,_0x363850){var _0x22e433=new AWS[(_0x5ce2('0x5'))]({'accessKeyId':_0x166c86,'secretAccessKey':_0x412b62,'region':_0x49ede4});_0x22e433['detectSentiment']({'Text':_0x2c2cee,'LanguageCode':_0x13e872[_0x5ce2('0x6')](0x0,0x2)},function(_0x4f7a36,_0xf8525c){if(_0x4f7a36){return _0x363850(_0x4f7a36);}else{return _0x1ff8d9(_0xf8525c);}});});}function checkTranscribeJob(_0x3b027b,_0x5387b2,_0x496c1e){var _0x595d33;return new BPromise(function(_0x550fb3,_0x15a95e){logger['info'](util['format'](_0x5ce2('0x7'),_0x3b027b['id'],_0x3b027b['transcribeName']));return getTranscriptionJob(_0x496c1e[_0x5ce2('0x8')],_0x496c1e[_0x5ce2('0x9')],_0x5387b2[_0x5ce2('0xa')],_0x3b027b['transcribeName'])[_0x5ce2('0xb')](function(_0x2727c7){logger[_0x5ce2('0xc')](util['format']('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3b027b['id'],_0x3b027b[_0x5ce2('0xd')],_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0xf')]));if(!_0x3b027b['fileText']){switch(_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0xf')]){case _0x5ce2('0x10'):var _0x385d2e={'transcribeStatus':_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0xf')],'fileUri':_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0x11')][_0x5ce2('0x12')]};logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x14'),_0x3b027b['id']));return rp({'uri':_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0x11')][_0x5ce2('0x12')],'json':!![]})[_0x5ce2('0xb')](function(_0x13d32d){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3b027b['id']));if(_0x13d32d&&_0x13d32d['results']&&_0x13d32d[_0x5ce2('0x15')][_0x5ce2('0x16')]&&_0x13d32d[_0x5ce2('0x15')]['transcripts']['length']){_0x385d2e[_0x5ce2('0x17')]='';for(var _0x43580f=0x0;_0x43580f<_0x13d32d['results'][_0x5ce2('0x16')][_0x5ce2('0x18')];_0x43580f++){_0x385d2e[_0x5ce2('0x17')]+=_0x13d32d[_0x5ce2('0x15')][_0x5ce2('0x16')][_0x43580f][_0x5ce2('0x19')]+'';}}return _0x3b027b[_0x5ce2('0x1a')](_0x385d2e);})[_0x5ce2('0xb')](function(){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x1b'),_0x3b027b['id']));if(!_0x3b027b[_0x5ce2('0x1c')]){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))](_0x5ce2('0x1f'));}if(!_0x5387b2[_0x5ce2('0x20')]||!_0x5387b2[_0x5ce2('0x21')]||!_0x5387b2[_0x5ce2('0x22')]||!_0x5387b2[_0x5ce2('0x23')]||!_0x5387b2[_0x5ce2('0x24')]){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))](_0x5ce2('0x25'));}if(!_0x385d2e[_0x5ce2('0x17')]){throw new Error(_0x5ce2('0x26'));}if(_0x5387b2[_0x5ce2('0x21')]===_0x496c1e['id']){return _0x496c1e;}else{return db[_0x5ce2('0x27')][_0x5ce2('0x28')]({'where':{'id':_settings[_0x5ce2('0x21')]}});}})[_0x5ce2('0xb')](function(_0x2c956c){if(!_0x2c956c){throw new db[(_0x5ce2('0x1d'))]['ValidationError'](_0x5ce2('0x29'));}if(!_0x2c956c[_0x5ce2('0x8')]||!_0x2c956c[_0x5ce2('0x9')]){throw new db['Sequelize']['ValidationError'](_0x5ce2('0x2a'));}_0x595d33=_0x2c956c;logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3b027b['id']));return sentiment(_0x595d33['data1'],_0x595d33[_0x5ce2('0x9')],_0x5387b2[_0x5ce2('0x22')],_0x385d2e['fileText'],_0x5387b2[_0x5ce2('0x23')]);})[_0x5ce2('0xb')](function(_0x106ecc){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x2b'),_0x3b027b['id']));return _0x3b027b[_0x5ce2('0x1a')]({'sentiment':_0x106ecc[_0x5ce2('0x2c')],'sPositive':_0x106ecc[_0x5ce2('0x2d')][_0x5ce2('0x2e')],'sNegative':_0x106ecc[_0x5ce2('0x2d')]['Negative'],'sMixed':_0x106ecc['SentimentScore']['Mixed'],'sNeutral':_0x106ecc['SentimentScore'][_0x5ce2('0x2f')]});})[_0x5ce2('0xb')](function(){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x1b'),_0x3b027b['id']));_0x550fb3();});case _0x5ce2('0x30'):return _0x3b027b[_0x5ce2('0x1a')]({'transcribeStatus':_0x5ce2('0x30'),'failureReason':_0x2727c7[_0x5ce2('0xe')][_0x5ce2('0x31')]})[_0x5ce2('0xb')](function(){logger[_0x5ce2('0xc')](util['format'](_0x5ce2('0x1b'),_0x3b027b['id']));_0x550fb3();});default:logger[_0x5ce2('0xc')](util['format'](_0x5ce2('0x32'),_0x3b027b['id']));break;}}else{return BPromise[_0x5ce2('0x33')]()[_0x5ce2('0xb')](function(){if(!_0x3b027b[_0x5ce2('0x1c')]){throw new db['Sequelize'][(_0x5ce2('0x1e'))](_0x5ce2('0x1f'));}if(!_0x5387b2[_0x5ce2('0x20')]||!_0x5387b2[_0x5ce2('0x21')]||!_0x5387b2[_0x5ce2('0x22')]||!_0x5387b2[_0x5ce2('0x23')]||!_0x5387b2['bucket']){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x3b027b[_0x5ce2('0x17')]){throw new Error(_0x5ce2('0x26'));}if(_0x5387b2['sentimentAccountId']===_0x496c1e['id']){return _0x496c1e;}else{return db[_0x5ce2('0x27')][_0x5ce2('0x28')]({'where':{'id':_settings[_0x5ce2('0x21')]}});}})[_0x5ce2('0xb')](function(_0x3af34a){if(!_0x3af34a){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))](_0x5ce2('0x29'));}if(!_0x3af34a[_0x5ce2('0x8')]||!_0x3af34a['data2']){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x595d33=_0x3af34a;logger[_0x5ce2('0xc')](util['format'](_0x5ce2('0x34'),_0x3b027b['id']));return sentiment(_0x595d33[_0x5ce2('0x8')],_0x595d33[_0x5ce2('0x9')],_0x5387b2[_0x5ce2('0x22')],_0x3b027b[_0x5ce2('0x17')],_0x5387b2[_0x5ce2('0x23')]);})[_0x5ce2('0xb')](function(_0x495af2){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x2b'),_0x3b027b['id']));return _0x3b027b[_0x5ce2('0x1a')]({'sentiment':_0x495af2['Sentiment'],'sPositive':_0x495af2[_0x5ce2('0x2d')][_0x5ce2('0x2e')],'sNegative':_0x495af2[_0x5ce2('0x2d')][_0x5ce2('0x35')],'sMixed':_0x495af2['SentimentScore'][_0x5ce2('0x36')],'sNeutral':_0x495af2[_0x5ce2('0x2d')][_0x5ce2('0x2f')],'transcribeStatus':_0x5ce2('0x10')});})['then'](function(){logger[_0x5ce2('0xc')](util[_0x5ce2('0x13')](_0x5ce2('0x1b'),_0x3b027b['id']));_0x550fb3();});}})[_0x5ce2('0x37')](function(_0x1029e9){if(_0x1029e9){if(!_0x1029e9['name']||_0x1029e9[_0x5ce2('0x38')]!==_0x5ce2('0x39')){logger[_0x5ce2('0x3a')](util[_0x5ce2('0x13')](_0x5ce2('0x3b'),_0x3b027b['id']),util[_0x5ce2('0x3c')](_0x1029e9,{'showHidden':![],'depth':null}));}}_0x550fb3();});});}function checkTranscribe(){var _0x21c98c;var _0x35bc3c;var _0x1c29af;return db[_0x5ce2('0x3d')]['findAll']({'where':{'transcribeStatus':_0x5ce2('0x3e')}})[_0x5ce2('0xb')](function(_0x1e5a07){if(!_0x1e5a07||!_0x1e5a07['length']){throw new db[(_0x5ce2('0x1d'))]['ValidationError'](_0x5ce2('0x3f'));}_0x21c98c=_0x1e5a07;return db['Setting'][_0x5ce2('0x28')]({'where':{'id':0x1}});})['then'](function(_0x50568c){if(!_0x50568c){throw new db['Sequelize'][(_0x5ce2('0x1e'))](_0x5ce2('0x40'));}_0x35bc3c=_0x50568c;if(!_0x35bc3c[_0x5ce2('0x2')]||!_0x35bc3c[_0x5ce2('0x41')]||!_0x35bc3c[_0x5ce2('0xa')]||!_0x35bc3c[_0x5ce2('0x23')]||!_0x35bc3c[_0x5ce2('0x24')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x5ce2('0x28')]({'where':{'id':_0x35bc3c['transcribeAccountId']}});})[_0x5ce2('0xb')](function(_0x296ea8){if(!_0x296ea8){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x296ea8[_0x5ce2('0x8')]||!_0x296ea8[_0x5ce2('0x9')]){throw new db[(_0x5ce2('0x1d'))][(_0x5ce2('0x1e'))](_0x5ce2('0x2a'));}_0x1c29af=_0x296ea8;var _0x2b5fc5=[];_0x21c98c[_0x5ce2('0x42')](function(_0x568288){_0x2b5fc5[_0x5ce2('0x43')](checkTranscribeJob(_0x568288,_0x35bc3c,_0x1c29af));});return BPromise[_0x5ce2('0x44')](_0x2b5fc5);})[_0x5ce2('0x37')](function(_0x3ddf21){if(_0x3ddf21){if(!_0x3ddf21['name']||_0x3ddf21[_0x5ce2('0x38')]!==_0x5ce2('0x39')){logger['error'](util[_0x5ce2('0x3c')](_0x3ddf21,{'showHidden':![],'depth':null}));}}});}exports[_0x5ce2('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 6a3b604..b763918 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 _0x9931=['YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format'];(function(_0x57afd6,_0x44f6ea){var _0x2b09b8=function(_0x49b8df){while(--_0x49b8df){_0x57afd6['push'](_0x57afd6['shift']());}};_0x2b09b8(++_0x44f6ea);}(_0x9931,0x1b6));var _0x1993=function(_0x313981,_0x50d1ac){_0x313981=_0x313981-0x0;var _0x5cbc31=_0x9931[_0x313981];return _0x5cbc31;};'use strict';var _=require('lodash');var moment=require(_0x1993('0x0'));var Redis=require('ioredis');var util=require(_0x1993('0x1'));var config=require(_0x1993('0x2'));var db=require(_0x1993('0x3'))['db'];var logger=require(_0x1993('0x4'))(_0x1993('0x5'));config[_0x1993('0x6')]=_[_0x1993('0x7')](config[_0x1993('0x6')],{'host':_0x1993('0x8'),'port':0x18eb});var io=require(_0x1993('0x9'))(new Redis(config[_0x1993('0x6')]));function closeInteractions(){var _0x75d9c=[];return db[_0x1993('0xa')][_0x1993('0xb')]({'raw':!![],'attributes':['id',_0x1993('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1993('0xd')](0x18,_0x1993('0xe'))}}})['then'](function(_0x58b0fe){if(_0x58b0fe&&_0x58b0fe[_0x1993('0xf')]){_0x75d9c=_[_0x1993('0x10')](_0x58b0fe||[],'id');logger[_0x1993('0x11')](_0x1993('0x12'),_0x75d9c[_0x1993('0x13')]());return db[_0x1993('0xa')][_0x1993('0x14')]({'closeReason':_0x1993('0x15'),'disposition':_0x1993('0x16'),'closed':!![],'closedAt':moment()[_0x1993('0x17')](_0x1993('0x18'))},{'where':{'id':_0x75d9c}});}})[_0x1993('0x19')](function(){if(_0x75d9c&&_0x75d9c['length']){logger['info'](_0x1993('0x1a'),_0x75d9c[_0x1993('0x13')]());for(var _0x1c0fb4=0x0;_0x1c0fb4<_0x75d9c[_0x1993('0xf')];_0x1c0fb4++){io['emit'](_0x1993('0x1b'),{'id':_0x75d9c[_0x1c0fb4],'closed':!![]});}}})[_0x1993('0x1c')](function(_0x22fe76){logger[_0x1993('0x1d')](_0x1993('0x1e'),_0x22fe76?util[_0x1993('0x1f')](_0x22fe76,{'showHidden':![],'depth':null}):'');});}exports[_0x1993('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x452d=['lastMsgAt','subtract','hours','then','length','map','info','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll'];(function(_0x3ee99e,_0x4affec){var _0x1b56e1=function(_0x3857a2){while(--_0x3857a2){_0x3ee99e['push'](_0x3ee99e['shift']());}};_0x1b56e1(++_0x4affec);}(_0x452d,0x16b));var _0xd452=function(_0x3cad53,_0x32711c){_0x3cad53=_0x3cad53-0x0;var _0x437793=_0x452d[_0x3cad53];return _0x437793;};'use strict';var _=require(_0xd452('0x0'));var moment=require(_0xd452('0x1'));var Redis=require(_0xd452('0x2'));var util=require(_0xd452('0x3'));var config=require(_0xd452('0x4'));var db=require(_0xd452('0x5'))['db'];var logger=require(_0xd452('0x6'))(_0xd452('0x7'));config['redis']=_[_0xd452('0x8')](config[_0xd452('0x9')],{'host':_0xd452('0xa'),'port':0x18eb});var io=require(_0xd452('0xb'))(new Redis(config[_0xd452('0x9')]));function closeInteractions(){var _0x31c10c=[];return db[_0xd452('0xc')][_0xd452('0xd')]({'raw':!![],'attributes':['id',_0xd452('0xe')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd452('0xf')](0x18,_0xd452('0x10'))}}})[_0xd452('0x11')](function(_0x2dfaee){if(_0x2dfaee&&_0x2dfaee[_0xd452('0x12')]){_0x31c10c=_[_0xd452('0x13')](_0x2dfaee||[],'id');logger[_0xd452('0x14')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x31c10c[_0xd452('0x15')]());return db[_0xd452('0xc')]['update']({'closeReason':'system','disposition':_0xd452('0x16'),'closed':!![],'closedAt':moment()[_0xd452('0x17')](_0xd452('0x18'))},{'where':{'id':_0x31c10c}});}})[_0xd452('0x11')](function(){if(_0x31c10c&&_0x31c10c['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x31c10c[_0xd452('0x15')]());for(var _0x29fa0b=0x0;_0x29fa0b<_0x31c10c[_0xd452('0x12')];_0x29fa0b++){io[_0xd452('0x19')](_0xd452('0x1a'),{'id':_0x31c10c[_0x29fa0b],'closed':!![]});}}})['catch'](function(_0x1c0e4f){logger['error'](_0xd452('0x1b'),_0x1c0e4f?util[_0xd452('0x1c')](_0x1c0e4f,{'showHidden':![],'depth':null}):'');});}exports['start']=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 e779096..7cbc3d0 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39ef=['log','finished\x20populating','hopper1','hopper2','catch','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com','now','CmContact','then','contacts1','CmHopper','destroy','bulkCreate'];(function(_0x1bc143,_0x5664aa){var _0x36c4ba=function(_0x41ef48){while(--_0x41ef48){_0x1bc143['push'](_0x1bc143['shift']());}};_0x36c4ba(++_0x5664aa);}(_0x39ef,0x113));var _0xf39e=function(_0x1bc6af,_0x4fbcc4){_0x1bc6af=_0x1bc6af-0x0;var _0x35e765=_0x39ef[_0x1bc6af];return _0x35e765;};'use strict';var util=require(_0xf39e('0x0'));var db=require(_0xf39e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf39e('0x2')]({'id':i,'firstName':_0xf39e('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf39e('0x4')+i+_0xf39e('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf39e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xf39e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf39e('0x6')](),'updatedAt':Date[_0xf39e('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf39e('0x2')]({'id':i,'firstName':_0xf39e('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xf39e('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf39e('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[_0xf39e('0x6')]()});}db[_0xf39e('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0xf39e('0x7')]['bulkCreate'](contacts);})[_0xf39e('0x8')](function(){console['log']('finished\x20populating',_0xf39e('0x9'));return db[_0xf39e('0xa')][_0xf39e('0xb')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xf39e('0xc')](hopper);})[_0xf39e('0x8')](function(){console[_0xf39e('0xd')](_0xf39e('0xe'),_0xf39e('0xf'));return db[_0xf39e('0x7')][_0xf39e('0xc')](contacts2);})[_0xf39e('0x8')](function(){console[_0xf39e('0xd')](_0xf39e('0xe'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0xf39e('0x8')](function(){console[_0xf39e('0xd')]('finished\x20populating',_0xf39e('0x10'));})[_0xf39e('0x11')](function(_0x3ba121){console[_0xf39e('0xd')](_0x3ba121);}); \ No newline at end of file +var _0x5a2e=['CmHopper','hopper1','finished\x20populating','contacts2','hopper2','util','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','push','CmContact','destroy','then','bulkCreate','log','contacts1'];(function(_0x48d130,_0xaa557b){var _0x37ebe9=function(_0x26200a){while(--_0x26200a){_0x48d130['push'](_0x48d130['shift']());}};_0x37ebe9(++_0xaa557b);}(_0x5a2e,0x95));var _0xe5a2=function(_0x13db20,_0x21636b){_0x13db20=_0x13db20-0x0;var _0xe78a5d=_0x5a2e[_0x13db20];return _0xe78a5d;};'use strict';var util=require(_0xe5a2('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xe5a2('0x1')+i,'lastName':_0xe5a2('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xe5a2('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xe5a2('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xe5a2('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xe5a2('0x1')+i,'lastName':_0xe5a2('0x2')+i,'phone':0xf879fb460+i,'email':_0xe5a2('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe5a2('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xe5a2('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe5a2('0x4')](),'updatedAt':Date[_0xe5a2('0x4')]()});}db[_0xe5a2('0x7')][_0xe5a2('0x8')]({'where':{}})[_0xe5a2('0x9')](function(){return db[_0xe5a2('0x7')][_0xe5a2('0xa')](contacts);})[_0xe5a2('0x9')](function(){console[_0xe5a2('0xb')]('finished\x20populating',_0xe5a2('0xc'));return db[_0xe5a2('0xd')][_0xe5a2('0x8')]({'where':{}});})['then'](function(){return db[_0xe5a2('0xd')][_0xe5a2('0xa')](hopper);})[_0xe5a2('0x9')](function(){console[_0xe5a2('0xb')]('finished\x20populating',_0xe5a2('0xe'));return db[_0xe5a2('0x7')][_0xe5a2('0xa')](contacts2);})[_0xe5a2('0x9')](function(){console[_0xe5a2('0xb')](_0xe5a2('0xf'),_0xe5a2('0x10'));return db[_0xe5a2('0xd')][_0xe5a2('0xa')](hopper2);})['then'](function(){console[_0xe5a2('0xb')](_0xe5a2('0xf'),_0xe5a2('0x11'));})['catch'](function(_0x1103b5){console['log'](_0x1103b5);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 42bf0b6..b88a28b 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36d8=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','password','friend','wss','all'];(function(_0x297d2b,_0x3689a6){var _0x40eff9=function(_0x1d2c91){while(--_0x1d2c91){_0x297d2b['push'](_0x297d2b['shift']());}};_0x40eff9(++_0x3689a6);}(_0x36d8,0x6f));var _0x836d=function(_0x3d5d66,_0x5097e0){_0x3d5d66=_0x3d5d66-0x0;var _0xa3b320=_0x36d8[_0x3d5d66];return _0xa3b320;};'use strict';var util=require(_0x836d('0x0'));var db=require(_0x836d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x836d('0x2')](_0x836d('0x3'),_0x836d('0x4'),i),'fullname':util[_0x836d('0x2')](_0x836d('0x3'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x836d('0x4'),i),'role':_0x836d('0x4'),'password':_0x836d('0x5'),'internal':0xfa0+i,'type':_0x836d('0x6'),'transport':['udp','ws',_0x836d('0x7')],'disallow':[_0x836d('0x8')],'allow':[_0x836d('0x9')],'defaultuser':util['format'](_0x836d('0x3'),_0x836d('0x4'),i),'encryption':'yes','avpf':_0x836d('0xa'),'force_avp':_0x836d('0xa'),'icesupport':_0x836d('0xa'),'dtlsenable':_0x836d('0xa'),'dtlsverify':'no','dtlscertfile':_0x836d('0xb'),'dtlsprivatekey':_0x836d('0xc'),'dtlssetup':_0x836d('0xd'),'callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x836d('0x2')]('%s%s','agent',i),0xfa0+i)});}db[_0x836d('0xe')][_0x836d('0xf')](users)[_0x836d('0x10')](function(){console[_0x836d('0x11')](_0x836d('0x12'));})[_0x836d('0x13')](function(_0x3b9a58){console['log'](_0x3b9a58);}); \ No newline at end of file +var _0x9d92=['all','ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util','../mysqldb','format','agent','%s%s','password','udp','wss'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x9d92,0x106));var _0x29d9=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x9d92[_0x120376];return _0x28c529;};'use strict';var util=require(_0x29d9('0x0'));var db=require(_0x29d9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x29d9('0x2')]('%s%s',_0x29d9('0x3'),i),'fullname':util[_0x29d9('0x2')](_0x29d9('0x4'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x29d9('0x3'),i),'role':'agent','password':_0x29d9('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0x29d9('0x6'),'ws',_0x29d9('0x7')],'disallow':[_0x29d9('0x8')],'allow':[_0x29d9('0x9')],'defaultuser':util[_0x29d9('0x2')]('%s%s','agent',i),'encryption':'yes','avpf':_0x29d9('0xa'),'force_avp':_0x29d9('0xa'),'icesupport':_0x29d9('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x29d9('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x29d9('0x2')](_0x29d9('0xc'),util[_0x29d9('0x2')](_0x29d9('0x4'),_0x29d9('0x3'),i),0xfa0+i)});}db[_0x29d9('0xd')][_0x29d9('0xe')](users)['then'](function(){console['log'](_0x29d9('0xf'));})[_0x29d9('0x10')](function(_0xaf70c7){console[_0x29d9('0x11')](_0xaf70c7);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index b7d2fa9..600f848 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2905=['lodash','util','bluebird','./environment','name','Agents','User','agent','telephone','type','UserProfileSection','then','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','ivr','format','length','user:%s','handshake','query','find','role','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueue','ChatQueues','SmsQueues','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','ChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','request','remoteAddress','remotePort','connectedAt','nsp','address','disconnect','CONNECTED'];(function(_0x4e879e,_0x2071f0){var _0x1ea254=function(_0x514330){while(--_0x514330){_0x4e879e['push'](_0x4e879e['shift']());}};_0x1ea254(++_0x2071f0);}(_0x2905,0x19c));var _0x5290=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2905[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x5290('0x0'));var util=require(_0x5290('0x1'));var BPromise=require(_0x5290('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x5290('0x3'));var queryQueues={'attributes':['id',_0x5290('0x4')],'include':[{'as':_0x5290('0x5'),'model':db[_0x5290('0x6')],'attributes':['id',_0x5290('0x4'),'role'],'raw':!![],'where':{'role':_0x5290('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5290('0x4')],'where':{'role':_0x5290('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5290('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5290('0x4'),_0x5290('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x57c719,_0x15fc1e,_0x22bb06){return db[_0x5290('0xa')]['findOne']({'where':{'name':_0x57c719,'userProfileId':_0x15fc1e},'raw':!![]})[_0x5290('0xb')](function(_0x4913ea){if(_0x4913ea){if(_0x4913ea['autoAssociation']){switch(_0x57c719){case _0x5290('0xc'):case'ChatQueues':case _0x5290('0xd'):case'SmsQueues':case _0x5290('0xe'):case _0x5290('0xf'):case _0x5290('0x10'):return db[_0x22bb06][_0x5290('0x11')](queryQueues);case _0x5290('0x12'):return db[_0x22bb06]['findAll'](queryTelephones);case _0x5290('0x13'):return db[_0x22bb06]['findAll'](queryTrunks);case _0x5290('0x14'):return db[_0x22bb06][_0x5290('0x11')](queryCampaigns);}}else{return db[_0x5290('0x15')][_0x5290('0x11')]({'attributes':[_0x5290('0x16')],'where':{'sectionId':_0x4913ea['id']},'raw':!![]})[_0x5290('0xb')](function(_0x33bd74){if(_0x33bd74){var _0xf12e41={'where':{'id':_[_0x5290('0x17')](_0x33bd74,'resourceId')},'raw':!![]};switch(_0x22bb06){case _0x5290('0x6'):_0xf12e41[_0x5290('0x18')]['role']=_0x5290('0x8');break;case _0x5290('0x19'):_0xf12e41[_0x5290('0x18')][_0x5290('0x9')]=_0x5290('0x1a');break;}return db[_0x22bb06][_0x5290('0x11')](_0xf12e41);}else{return[];}});}}else{return[];}})[_0x5290('0xb')](function(_0x27f449){return _0x27f449;});}function joinOrLeaveQueues(_0x1e9d23,_0x32bc0b,_0x4cc04b,_0x137b4d){_0x1e9d23[_0x32bc0b](util[_0x5290('0x1b')]('%s:queue:%s',_0x4cc04b,_0x137b4d[_0x5290('0x4')]));if(_0x137b4d[_0x5290('0x5')]){for(var _0x5d0007=0x0;_0x5d0007<_0x137b4d[_0x5290('0x5')][_0x5290('0x1c')];_0x5d0007+=0x1){_0x1e9d23[_0x32bc0b](util[_0x5290('0x1b')](_0x5290('0x1d'),_0x137b4d[_0x5290('0x5')][_0x5d0007]['name']));}}}function joinOrLeave(_0x5289a9,_0x2a47a9,_0x53d91a){var _0x13fe87;if(_0x5289a9[_0x5290('0x1e')][_0x5290('0x1f')]['id']){db['User'][_0x5290('0x20')]({'attributes':['id',_0x5290('0x4'),_0x5290('0x21'),_0x5290('0x22')],'where':{'id':_0x5289a9[_0x5290('0x1e')][_0x5290('0x1f')]['id']},'include':[{'model':db[_0x5290('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x24')],'as':_0x5290('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x26')],'as':_0x5290('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5290('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x29')],'as':_0x5290('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x5290('0x2b')],'as':_0x5290('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3f50cd){if(_0x3f50cd){_0x13fe87=_0x3f50cd;_0x5289a9[_0x2a47a9](util['format'](_0x5290('0x1d'),_0x3f50cd['name']));var _0x1a8d86=[];switch(_0x3f50cd[_0x5290('0x21')]){case _0x5290('0x2d'):_0x5289a9[_0x2a47a9](_0x5290('0x2e'));_0x5289a9[_0x2a47a9](_0x5290('0x2f'));if(queryQueues[_0x5290('0x30')]('include')){delete queryQueues[_0x5290('0x31')];}_0x1a8d86[_0x5290('0x32')](db['VoiceQueue']['findAll'](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x33')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db[_0x5290('0x34')][_0x5290('0x11')](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x35')]['findAll'](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x36')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db[_0x5290('0x37')][_0x5290('0x11')](queryQueues));_0x1a8d86['push'](db['WhatsappQueue'][_0x5290('0x11')](queryQueues));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')][_0x5290('0x11')](queryTelephones));_0x1a8d86['push'](db[_0x5290('0x38')]['findAll'](queryTrunks));_0x1a8d86['push'](db[_0x5290('0x19')][_0x5290('0x11')](queryCampaigns));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')]['findAll'](queryAgents));break;case _0x5290('0x39'):_0x5289a9[_0x2a47a9]('voice:inbound');_0x5289a9[_0x2a47a9](_0x5290('0x2f'));_0x1a8d86['push'](getAssociatedResources(_0x5290('0xc'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x3a')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x3b'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x33')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xd'),_0x3f50cd[_0x5290('0x22')],'FaxQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x3c'),_0x3f50cd[_0x5290('0x22')],'SmsQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xe'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x36')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0xf'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x37')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x10'),_0x3f50cd[_0x5290('0x22')],'WhatsappQueue'));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x12'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x6')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x13'),_0x3f50cd[_0x5290('0x22')],_0x5290('0x38')));_0x1a8d86[_0x5290('0x32')](getAssociatedResources(_0x5290('0x14'),_0x3f50cd[_0x5290('0x22')],'Campaign'));_0x1a8d86[_0x5290('0x32')](db[_0x5290('0x6')][_0x5290('0x11')](queryAgents));break;case'agent':_0x5289a9[_0x2a47a9](_0x5290('0x2e'));_0x5289a9[_0x2a47a9]('voice:outbound');_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x3d')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x3e')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd['getFaxQueues']({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86['push'](_0x3f50cd[_0x5290('0x3f')]({'attributes':['id','name']}));_0x1a8d86['push'](_0x3f50cd[_0x5290('0x40')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x41')]({'attributes':['id',_0x5290('0x4')]}));_0x1a8d86[_0x5290('0x32')](_0x3f50cd[_0x5290('0x42')]({'attributes':['id',_0x5290('0x4')]}));break;}return BPromise[_0x5290('0x43')](_0x1a8d86);}})['then'](function(_0x175525){if(_0x175525&&_0x175525[_0x5290('0x1c')]){for(var _0x1ae523=0x0;_0x1ae523<_0x175525['length'];_0x1ae523+=0x1){for(var _0x378b41=0x0;_0x378b41<_0x175525[_0x1ae523][_0x5290('0x1c')];_0x378b41+=0x1){switch(_0x1ae523){case 0x0:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x44'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x1:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x45'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x2:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x46'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x3:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x47'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x4:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x48'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x5:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x49'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x6:joinOrLeaveQueues(_0x5289a9,_0x2a47a9,_0x5290('0x4a'),_0x175525[_0x1ae523][_0x378b41]);break;case 0x7:if(_0x13fe87[_0x5290('0x21')]!==_0x5290('0x7'))_0x5289a9[_0x2a47a9](util['format'](_0x5290('0x4b'),_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0x8:if(_0x13fe87[_0x5290('0x21')]!==_0x5290('0x7'))_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')](_0x5290('0x4c'),_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0x9:if(_0x13fe87['role']!=='agent')_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')](_0x5290('0x4d'),_0x175525[_0x1ae523][_0x378b41][_0x5290('0x9')],_0x175525[_0x1ae523][_0x378b41]['name']));break;case 0xa:_0x5289a9[_0x2a47a9](util[_0x5290('0x1b')]('user:%s',_0x175525[_0x1ae523][_0x378b41][_0x5290('0x4')]));break;}}}}})[_0x5290('0xb')](function(){if(_0x2a47a9==='leave'){var _0x343d28=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x4e')],'id');return _0x13fe87['removeChatInteractions'](_0x343d28)[_0x5290('0xb')](function(){for(var _0x260baf=0x0;_0x260baf<_0x343d28[_0x5290('0x1c')];_0x260baf+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x50'),{'ChatInteractionId':Number(_0x343d28[_0x260baf]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0xe87a2=_[_0x5290('0x17')](_0x13fe87['MailInteractions'],'id');return _0x13fe87[_0x5290('0x52')](_0xe87a2)['then'](function(){for(var _0x3ac74f=0x0;_0x3ac74f<_0xe87a2[_0x5290('0x1c')];_0x3ac74f+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x53'),{'MailInteractionId':Number(_0xe87a2[_0x3ac74f]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x21bcd6=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x27')],'id');return _0x13fe87[_0x5290('0x54')](_0x21bcd6)[_0x5290('0xb')](function(){for(var _0x58d387=0x0;_0x58d387<_0x21bcd6[_0x5290('0x1c')];_0x58d387+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x55'),{'FaxInteractionId':Number(_0x21bcd6[_0x58d387]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9==='leave'){var _0x2f0020=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x28')],'id');return _0x13fe87['removeSmsInteractions'](_0x2f0020)[_0x5290('0xb')](function(){for(var _0x2aeb09=0x0;_0x2aeb09<_0x2f0020[_0x5290('0x1c')];_0x2aeb09+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x56'),{'SmsInteractionId':Number(_0x2f0020[_0x2aeb09]),'UserId':Number(_0x13fe87['id'])});}});}})['then'](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x3d69fa=_['map'](_0x13fe87[_0x5290('0x2a')],'id');return _0x13fe87[_0x5290('0x57')](_0x3d69fa)[_0x5290('0xb')](function(){for(var _0x1a3949=0x0;_0x1a3949<_0x3d69fa[_0x5290('0x1c')];_0x1a3949+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x58'),{'OpenchannelInteractionId':Number(_0x3d69fa[_0x1a3949]),'UserId':Number(_0x13fe87['id'])});}});}})[_0x5290('0xb')](function(){if(_0x2a47a9===_0x5290('0x51')){var _0x1c204c=_[_0x5290('0x17')](_0x13fe87[_0x5290('0x2c')],'id');return _0x13fe87[_0x5290('0x59')](_0x1c204c)[_0x5290('0xb')](function(){for(var _0x1d04b8=0x0;_0x1d04b8<_0x1c204c[_0x5290('0x1c')];_0x1d04b8+=0x1){_0x53d91a[_0x5290('0x4f')](_0x5290('0x5a'),{'WhatsappInteractionId':Number(_0x1c204c[_0x1d04b8]),'UserId':Number(_0x13fe87['id'])});}});}})['catch'](function(_0xa0483b){_0x5289a9[_0x5290('0x5b')](_0xa0483b);});}}function onDisconnect(_0x326771,_0x3dbf3b){joinOrLeave(_0x326771,_0x5290('0x51'),_0x3dbf3b);}function onConnect(_0x392373){joinOrLeave(_0x392373,_0x5290('0x5c'));}exports[_0x5290('0x5d')]=function(_0x44f83b){_0x44f83b['on'](_0x5290('0x5e'),function(_0x10b8c1){_0x10b8c1['setMaxListeners'](0x0);_0x10b8c1['address']=_0x10b8c1[_0x5290('0x5f')][_0x5290('0x5e')][_0x5290('0x60')]+':'+_0x10b8c1[_0x5290('0x5f')][_0x5290('0x5e')][_0x5290('0x61')];_0x10b8c1[_0x5290('0x62')]=new Date();_0x10b8c1['log']=function(_0x495a8b){console[_0x5290('0x5b')]('SocketIO\x20'+_0x10b8c1[_0x5290('0x63')][_0x5290('0x4')]+'['+_0x10b8c1[_0x5290('0x64')]+']',_0x495a8b);};_0x10b8c1['on'](_0x5290('0x65'),function(){onDisconnect(_0x10b8c1,_0x44f83b);_0x10b8c1['log']('DISCONNECTED');});onConnect(_0x10b8c1);_0x10b8c1[_0x5290('0x5b')](_0x5290('0x66'));});}; \ No newline at end of file +var _0xc891=['OpenchannelInteraction','WhatsappInteraction','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','voice:outbound','ChatQueues','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','mail','whatsapp','telephone:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','request','remoteAddress','connection','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','../mysqldb','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','then','resourceId','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','FaxInteractions'];(function(_0x3729fd,_0x3e4e23){var _0x3b768e=function(_0x2acf00){while(--_0x2acf00){_0x3729fd['push'](_0x3729fd['shift']());}};_0x3b768e(++_0x3e4e23);}(_0xc891,0x152));var _0x1c89=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc891[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x1c89('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x1c89('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x1c89('0x2')],'include':[{'as':_0x1c89('0x3'),'model':db[_0x1c89('0x4')],'attributes':['id','name',_0x1c89('0x5')],'raw':!![],'where':{'role':_0x1c89('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1c89('0x2')],'where':{'role':_0x1c89('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1c89('0x2')],'where':{'role':_0x1c89('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1c89('0x8')],'where':{'type':_0x1c89('0x9')}};function getAssociatedResources(_0x4faab7,_0x1a3e57,_0x4e9b16){return db[_0x1c89('0xa')]['findOne']({'where':{'name':_0x4faab7,'userProfileId':_0x1a3e57},'raw':!![]})['then'](function(_0x4c69e3){if(_0x4c69e3){if(_0x4c69e3['autoAssociation']){switch(_0x4faab7){case _0x1c89('0xb'):case'ChatQueues':case _0x1c89('0xc'):case _0x1c89('0xd'):case _0x1c89('0xe'):case _0x1c89('0xf'):case _0x1c89('0x10'):return db[_0x4e9b16][_0x1c89('0x11')](queryQueues);case _0x1c89('0x12'):return db[_0x4e9b16][_0x1c89('0x11')](queryTelephones);case'Trunks':return db[_0x4e9b16][_0x1c89('0x11')](queryTrunks);case'IvrCampaigns':return db[_0x4e9b16][_0x1c89('0x11')](queryCampaigns);}}else{return db[_0x1c89('0x13')][_0x1c89('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x4c69e3['id']},'raw':!![]})[_0x1c89('0x14')](function(_0x29602e){if(_0x29602e){var _0x2c9572={'where':{'id':_['map'](_0x29602e,_0x1c89('0x15'))},'raw':!![]};switch(_0x4e9b16){case _0x1c89('0x4'):_0x2c9572[_0x1c89('0x16')][_0x1c89('0x5')]=_0x1c89('0x7');break;case _0x1c89('0x17'):_0x2c9572[_0x1c89('0x16')][_0x1c89('0x8')]=_0x1c89('0x9');break;}return db[_0x4e9b16][_0x1c89('0x11')](_0x2c9572);}else{return[];}});}}else{return[];}})[_0x1c89('0x14')](function(_0x52ec5c){return _0x52ec5c;});}function joinOrLeaveQueues(_0x18ce93,_0x3003c1,_0x4c9069,_0xdb5b03){_0x18ce93[_0x3003c1](util[_0x1c89('0x18')](_0x1c89('0x19'),_0x4c9069,_0xdb5b03[_0x1c89('0x2')]));if(_0xdb5b03['Agents']){for(var _0x4ef155=0x0;_0x4ef155<_0xdb5b03[_0x1c89('0x3')][_0x1c89('0x1a')];_0x4ef155+=0x1){_0x18ce93[_0x3003c1](util[_0x1c89('0x18')](_0x1c89('0x1b'),_0xdb5b03['Agents'][_0x4ef155][_0x1c89('0x2')]));}}}function joinOrLeave(_0x372ed5,_0x4fbd33,_0x45f604){var _0x26a1cc;if(_0x372ed5[_0x1c89('0x1c')]['query']['id']){db[_0x1c89('0x4')][_0x1c89('0x1d')]({'attributes':['id',_0x1c89('0x2'),'role',_0x1c89('0x1e')],'where':{'id':_0x372ed5['handshake']['query']['id']},'include':[{'model':db[_0x1c89('0x1f')],'as':_0x1c89('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x1c89('0x21'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1c89('0x22')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1c89('0x23')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x25500d){if(_0x25500d){_0x26a1cc=_0x25500d;_0x372ed5[_0x4fbd33](util[_0x1c89('0x18')](_0x1c89('0x1b'),_0x25500d['name']));var _0xe662=[];switch(_0x25500d[_0x1c89('0x5')]){case'admin':_0x372ed5[_0x4fbd33](_0x1c89('0x24'));_0x372ed5[_0x4fbd33]('voice:outbound');if(queryQueues[_0x1c89('0x25')](_0x1c89('0x26'))){delete queryQueues[_0x1c89('0x26')];}_0xe662[_0x1c89('0x27')](db[_0x1c89('0x28')][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x29')][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db['FaxQueue'][_0x1c89('0x11')](queryQueues));_0xe662['push'](db['SmsQueue'][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x2a')][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x2b')][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x2c')][_0x1c89('0x11')](queryQueues));_0xe662[_0x1c89('0x27')](db['User']['findAll'](queryTelephones));_0xe662[_0x1c89('0x27')](db['Trunk']['findAll'](queryTrunks));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x17')][_0x1c89('0x11')](queryCampaigns));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x4')][_0x1c89('0x11')](queryAgents));break;case _0x1c89('0x2d'):_0x372ed5[_0x4fbd33]('voice:inbound');_0x372ed5[_0x4fbd33](_0x1c89('0x2e'));_0xe662[_0x1c89('0x27')](getAssociatedResources('VoiceQueues',_0x25500d[_0x1c89('0x1e')],_0x1c89('0x28')));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0x2f'),_0x25500d[_0x1c89('0x1e')],'ChatQueue'));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0xc'),_0x25500d[_0x1c89('0x1e')],'FaxQueue'));_0xe662[_0x1c89('0x27')](getAssociatedResources('SmsQueues',_0x25500d[_0x1c89('0x1e')],'SmsQueue'));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0xe'),_0x25500d[_0x1c89('0x1e')],_0x1c89('0x2a')));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0xf'),_0x25500d[_0x1c89('0x1e')],_0x1c89('0x2b')));_0xe662[_0x1c89('0x27')](getAssociatedResources('WhatsappQueues',_0x25500d[_0x1c89('0x1e')],_0x1c89('0x2c')));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0x12'),_0x25500d['userProfileId'],_0x1c89('0x4')));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0x30'),_0x25500d['userProfileId'],'Trunk'));_0xe662[_0x1c89('0x27')](getAssociatedResources(_0x1c89('0x31'),_0x25500d['userProfileId'],_0x1c89('0x17')));_0xe662[_0x1c89('0x27')](db[_0x1c89('0x4')][_0x1c89('0x11')](queryAgents));break;case _0x1c89('0x6'):_0x372ed5[_0x4fbd33](_0x1c89('0x24'));_0x372ed5[_0x4fbd33](_0x1c89('0x2e'));_0xe662['push'](_0x25500d[_0x1c89('0x32')]({'attributes':['id','name']}));_0xe662['push'](_0x25500d[_0x1c89('0x33')]({'attributes':['id',_0x1c89('0x2')]}));_0xe662[_0x1c89('0x27')](_0x25500d[_0x1c89('0x34')]({'attributes':['id',_0x1c89('0x2')]}));_0xe662[_0x1c89('0x27')](_0x25500d[_0x1c89('0x35')]({'attributes':['id',_0x1c89('0x2')]}));_0xe662[_0x1c89('0x27')](_0x25500d[_0x1c89('0x36')]({'attributes':['id',_0x1c89('0x2')]}));_0xe662[_0x1c89('0x27')](_0x25500d[_0x1c89('0x37')]({'attributes':['id',_0x1c89('0x2')]}));_0xe662[_0x1c89('0x27')](_0x25500d[_0x1c89('0x38')]({'attributes':['id','name']}));break;}return BPromise[_0x1c89('0x39')](_0xe662);}})['then'](function(_0x4a3343){if(_0x4a3343&&_0x4a3343[_0x1c89('0x1a')]){for(var _0x52f376=0x0;_0x52f376<_0x4a3343['length'];_0x52f376+=0x1){for(var _0x108aaa=0x0;_0x108aaa<_0x4a3343[_0x52f376][_0x1c89('0x1a')];_0x108aaa+=0x1){switch(_0x52f376){case 0x0:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,_0x1c89('0x3a'),_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x1:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,'chat',_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x2:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,_0x1c89('0x3b'),_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x3:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,'sms',_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x4:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,_0x1c89('0x3c'),_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x5:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,'openchannel',_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x6:joinOrLeaveQueues(_0x372ed5,_0x4fbd33,_0x1c89('0x3d'),_0x4a3343[_0x52f376][_0x108aaa]);break;case 0x7:if(_0x26a1cc['role']!==_0x1c89('0x6'))_0x372ed5[_0x4fbd33](util[_0x1c89('0x18')](_0x1c89('0x3e'),_0x4a3343[_0x52f376][_0x108aaa]['name']));break;case 0x8:if(_0x26a1cc[_0x1c89('0x5')]!==_0x1c89('0x6'))_0x372ed5[_0x4fbd33](util['format']('trunk:%s',_0x4a3343[_0x52f376][_0x108aaa][_0x1c89('0x2')]));break;case 0x9:if(_0x26a1cc[_0x1c89('0x5')]!==_0x1c89('0x6'))_0x372ed5[_0x4fbd33](util[_0x1c89('0x18')](_0x1c89('0x3f'),_0x4a3343[_0x52f376][_0x108aaa][_0x1c89('0x8')],_0x4a3343[_0x52f376][_0x108aaa][_0x1c89('0x2')]));break;case 0xa:_0x372ed5[_0x4fbd33](util[_0x1c89('0x18')](_0x1c89('0x1b'),_0x4a3343[_0x52f376][_0x108aaa][_0x1c89('0x2')]));break;}}}}})[_0x1c89('0x14')](function(){if(_0x4fbd33===_0x1c89('0x40')){var _0x25a45a=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x20')],'id');return _0x26a1cc[_0x1c89('0x42')](_0x25a45a)[_0x1c89('0x14')](function(){for(var _0x1d61a3=0x0;_0x1d61a3<_0x25a45a[_0x1c89('0x1a')];_0x1d61a3+=0x1){_0x45f604[_0x1c89('0x43')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x25a45a[_0x1d61a3]),'UserId':Number(_0x26a1cc['id'])});}});}})[_0x1c89('0x14')](function(){if(_0x4fbd33===_0x1c89('0x40')){var _0x3ef99d=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x44')],'id');return _0x26a1cc[_0x1c89('0x45')](_0x3ef99d)[_0x1c89('0x14')](function(){for(var _0x1dfa31=0x0;_0x1dfa31<_0x3ef99d['length'];_0x1dfa31+=0x1){_0x45f604[_0x1c89('0x43')](_0x1c89('0x46'),{'MailInteractionId':Number(_0x3ef99d[_0x1dfa31]),'UserId':Number(_0x26a1cc['id'])});}});}})[_0x1c89('0x14')](function(){if(_0x4fbd33==='leave'){var _0x152938=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x21')],'id');return _0x26a1cc['removeFaxInteractions'](_0x152938)[_0x1c89('0x14')](function(){for(var _0x3367d3=0x0;_0x3367d3<_0x152938['length'];_0x3367d3+=0x1){_0x45f604['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x152938[_0x3367d3]),'UserId':Number(_0x26a1cc['id'])});}});}})[_0x1c89('0x14')](function(){if(_0x4fbd33===_0x1c89('0x40')){var _0x145671=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x47')],'id');return _0x26a1cc[_0x1c89('0x48')](_0x145671)[_0x1c89('0x14')](function(){for(var _0x5323ea=0x0;_0x5323ea<_0x145671['length'];_0x5323ea+=0x1){_0x45f604[_0x1c89('0x43')](_0x1c89('0x49'),{'SmsInteractionId':Number(_0x145671[_0x5323ea]),'UserId':Number(_0x26a1cc['id'])});}});}})[_0x1c89('0x14')](function(){if(_0x4fbd33===_0x1c89('0x40')){var _0x391d91=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x4a')],'id');return _0x26a1cc[_0x1c89('0x4b')](_0x391d91)[_0x1c89('0x14')](function(){for(var _0x1157c6=0x0;_0x1157c6<_0x391d91[_0x1c89('0x1a')];_0x1157c6+=0x1){_0x45f604['emit'](_0x1c89('0x4c'),{'OpenchannelInteractionId':Number(_0x391d91[_0x1157c6]),'UserId':Number(_0x26a1cc['id'])});}});}})[_0x1c89('0x14')](function(){if(_0x4fbd33===_0x1c89('0x40')){var _0x21a1a2=_[_0x1c89('0x41')](_0x26a1cc[_0x1c89('0x4d')],'id');return _0x26a1cc['removeWhatsappInteractions'](_0x21a1a2)[_0x1c89('0x14')](function(){for(var _0x9321a4=0x0;_0x9321a4<_0x21a1a2[_0x1c89('0x1a')];_0x9321a4+=0x1){_0x45f604[_0x1c89('0x43')](_0x1c89('0x4e'),{'WhatsappInteractionId':Number(_0x21a1a2[_0x9321a4]),'UserId':Number(_0x26a1cc['id'])});}});}})['catch'](function(_0x3b218f){_0x372ed5[_0x1c89('0x4f')](_0x3b218f);});}}function onDisconnect(_0x3fe3bc,_0x22b74b){joinOrLeave(_0x3fe3bc,_0x1c89('0x40'),_0x22b74b);}function onConnect(_0xcdddd0){joinOrLeave(_0xcdddd0,_0x1c89('0x50'));}exports[_0x1c89('0x51')]=function(_0xba5a0f){_0xba5a0f['on']('connection',function(_0x10c29a){_0x10c29a[_0x1c89('0x52')](0x0);_0x10c29a[_0x1c89('0x53')]=_0x10c29a[_0x1c89('0x54')]['connection'][_0x1c89('0x55')]+':'+_0x10c29a['request'][_0x1c89('0x56')]['remotePort'];_0x10c29a[_0x1c89('0x57')]=new Date();_0x10c29a[_0x1c89('0x4f')]=function(_0x3e5234){console[_0x1c89('0x4f')](_0x1c89('0x58')+_0x10c29a[_0x1c89('0x59')][_0x1c89('0x2')]+'['+_0x10c29a[_0x1c89('0x53')]+']',_0x3e5234);};_0x10c29a['on'](_0x1c89('0x5a'),function(){onDisconnect(_0x10c29a,_0xba5a0f);_0x10c29a[_0x1c89('0x4f')](_0x1c89('0x5b'));});onConnect(_0x10c29a);_0x10c29a[_0x1c89('0x4f')](_0x1c89('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 184d0e6..8fef8c3 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 _0x5310=['newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','OpenchannelInteraction','Openchannel','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','catch','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','then','contact','UserId','User','find','name','internal','interface','format','SIP/%s','channel','incomingmessage','outgoingmessage','get','motionChannel','opened','changed','closed','substatus','agent','length','model','hook','callback','toLowerCase','condition','util','../../mysqldb','triggers','client','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage'];(function(_0x4b86a5,_0x2a81f5){var _0x5152e9=function(_0x313980){while(--_0x313980){_0x4b86a5['push'](_0x4b86a5['shift']());}};_0x5152e9(++_0x2a81f5);}(_0x5310,0x181));var _0x0531=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x5310[_0x4de586];return _0x46baf5;};'use strict';var util=require(_0x0531('0x0'));var db=require(_0x0531('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x0531('0x2'));var _=require('lodash');var client=jayson[_0x0531('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x0531('0x4'),'model':'ChatInteraction','event':_0x0531('0x5'),'condition':_0x0531('0x6'),'callback':afterCreate},{'channel':_0x0531('0x4'),'model':_0x0531('0x7'),'event':_0x0531('0x8'),'condition':_0x0531('0x9'),'callback':afterUpdate},{'channel':_0x0531('0x4'),'model':_0x0531('0xa'),'event':_0x0531('0x5'),'condition':_0x0531('0xb'),'callback':afterCreateMessage},{'channel':_0x0531('0xc'),'model':_0x0531('0xd'),'event':_0x0531('0x5'),'condition':_0x0531('0x6'),'callback':afterCreate},{'channel':'Sms','model':_0x0531('0xd'),'event':_0x0531('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0531('0xc'),'model':_0x0531('0xe'),'event':_0x0531('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x0531('0xf'),'model':_0x0531('0x10'),'event':_0x0531('0x5'),'condition':_0x0531('0x6'),'callback':afterCreate},{'channel':_0x0531('0xf'),'model':_0x0531('0x10'),'event':_0x0531('0x8'),'condition':_0x0531('0x9'),'callback':afterUpdate},{'channel':_0x0531('0xf'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x0531('0xb'),'callback':afterCreateMessage},{'channel':_0x0531('0x11'),'model':_0x0531('0x12'),'event':_0x0531('0x5'),'condition':_0x0531('0x6'),'callback':afterCreate},{'channel':_0x0531('0x11'),'model':_0x0531('0x12'),'event':'afterUpdate','condition':_0x0531('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0x0531('0x13'),'event':_0x0531('0x5'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x0531('0x14'),'event':'afterCreate','condition':_0x0531('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0x0531('0x14'),'event':_0x0531('0x8'),'condition':_0x0531('0x9'),'callback':afterUpdate},{'channel':_0x0531('0x15'),'model':'MailMessage','event':_0x0531('0x5'),'condition':_0x0531('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x0531('0x16'),'event':_0x0531('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0531('0x17'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x0531('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x0531('0x18'),'event':_0x0531('0x5'),'condition':_0x0531('0xb'),'callback':afterCreateMessage}];function request(_0x5554ea){return client[_0x0531('0x19')](_0x0531('0x1a'),_0x5554ea)['then'](function(_0x155dc8){logger[_0x0531('0x1b')](_0x0531('0x1c'),_0x0531('0x1a'),_0x155dc8);if(_0x155dc8[_0x0531('0x1d')]){if(_0x155dc8[_0x0531('0x1d')]['code']===0x1f4){logger['error'](_0x0531('0x1c'),_0x0531('0x1a'),_0x155dc8[_0x0531('0x1d')]);}}})[_0x0531('0x1e')](function(_0x5b421a){logger[_0x0531('0x1d')](_0x0531('0x1c'),_0x0531('0x1a'),_0x5b421a);});}function afterCreateMessage(_0x375e32,_0x311e1c){return function(_0x5b5e56,_0x508a79){_0x5b5e56=_0x5b5e56['get']({'plain':!![]});_0x5b5e56['channel']=_0x375e32;_0x5b5e56['motionChannel']=_0x375e32;_0x5b5e56[_0x0531('0x1f')]=_0x5b5e56[_0x0531('0x20')];var _0xe859ee=_0x0531('0x21')+_0x5b5e56[_0x0531('0x22')];return db[_0x0531('0x23')][_0x0531('0x24')](_0xe859ee,{'type':db[_0x0531('0x25')][_0x0531('0x26')][_0x0531('0x27')],'raw':!![]})[_0x0531('0x28')](function(_0x265e1a){return _0x265e1a;})[_0x0531('0x28')](function(_0x502fe1){if(_0x502fe1){_0x5b5e56[_0x0531('0x29')]=_0x502fe1[0x0];}if(_0x5b5e56[_0x0531('0x2a')]){return db[_0x0531('0x2b')][_0x0531('0x2c')]({'where':{'id':_0x5b5e56['UserId']},'attributes':['id',_0x0531('0x2d'),'fullname','email',_0x0531('0x2e')],'raw':!![]})[_0x0531('0x28')](function(_0x59a5aa){_0x5b5e56[_0x0531('0x2f')]=util[_0x0531('0x30')](_0x0531('0x31'),_0x59a5aa[_0x0531('0x2d')]);_0x5b5e56[_0x0531('0x32')]=_0x375e32;_0x5b5e56['agent']=_0x59a5aa;return request({'event':_0x0531('0x33'),'message':_0x5b5e56});})[_0x0531('0x1e')](function(_0x2ff45a){console[_0x0531('0x1d')](_0x2ff45a);});}else{return request({'event':_0x0531('0x34'),'message':_0x5b5e56});}});};}function afterCreate(_0x865713,_0x522cd9){return function(_0x5b04b0,_0x4e6ddb){_0x5b04b0=_0x5b04b0[_0x0531('0x35')]({'plain':!![]});_0x5b04b0[_0x0531('0x32')]=_0x865713;_0x5b04b0[_0x0531('0x36')]=_0x865713;_0x5b04b0[_0x0531('0x1f')]=_0x0531('0x37');var _0x528017='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b04b0['ContactId'];return db[_0x0531('0x23')]['query'](_0x528017,{'type':db[_0x0531('0x25')]['QueryTypes'][_0x0531('0x27')],'raw':!![]})['then'](function(_0x5f1f4d){return _0x5f1f4d;})[_0x0531('0x28')](function(_0x548031){if(_0x548031){_0x5b04b0[_0x0531('0x29')]=_0x548031[0x0];}return request({'event':_0x522cd9,'message':_0x5b04b0});});};}function afterUpdate(_0x14780d){return function(_0x576db0){var _0x5efe3b=_0x576db0[_0x0531('0x38')]('closed')&&_0x576db0[_0x0531('0x39')];var _0x3bf91f=_0x576db0[_0x0531('0x38')](_0x0531('0x3a'));if(_0x5efe3b||_0x3bf91f){var _0x1d70d1=_0x5efe3b?_0x0531('0x9'):'substatus';var _0x3cbe4e=_0x576db0['get']({'plain':!![]});_0x3cbe4e[_0x0531('0x32')]=_0x14780d;_0x3cbe4e[_0x0531('0x36')]=_0x14780d;_0x3cbe4e[_0x0531('0x1f')]=_0x5efe3b?_0x0531('0x39'):_0x0531('0x3a');var _0x5b248e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3cbe4e[_0x0531('0x22')];return db[_0x0531('0x23')]['query'](_0x5b248e,{'type':db[_0x0531('0x25')][_0x0531('0x26')][_0x0531('0x27')],'raw':!![]})[_0x0531('0x28')](function(_0x3b895f){if(_0x3b895f){_0x3cbe4e[_0x0531('0x29')]=_0x3b895f[0x0];}if(_0x3cbe4e[_0x0531('0x2a')]){return db[_0x0531('0x2b')]['find']({'where':{'id':_0x3cbe4e[_0x0531('0x2a')]},'attributes':['id',_0x0531('0x2d'),'fullname','email',_0x0531('0x2e')],'raw':!![]})['then'](function(_0x21c0d1){_0x3cbe4e[_0x0531('0x2f')]=util[_0x0531('0x30')](_0x0531('0x31'),_0x21c0d1[_0x0531('0x2d')]);_0x3cbe4e[_0x0531('0x3b')]=_0x21c0d1;return request({'event':_0x1d70d1,'message':_0x3cbe4e});})[_0x0531('0x1e')](function(_0x3a010e){console[_0x0531('0x1d')](_0x3a010e);});}else{return request({'event':_0x1d70d1,'message':_0x3cbe4e});}});}};}exports['default']=function(){for(var _0x25f52c=0x0;_0x25f52c=_0x4536bd['agents']){throw Error(_0xfdb5('0x16'));}_0x4e77ec(_0x323fbc);})[_0xfdb5('0x17')](function(_0x133189){_0x47941d(_0x133189);});});}; \ No newline at end of file +var _0x6136=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','voice','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x6136,0x1e8));var _0x6613=function(_0x3673dd,_0x27aa2c){_0x3673dd=_0x3673dd-0x0;var _0x57553f=_0x6136[_0x3673dd];return _0x57553f;};'use strict';var _=require('lodash');var BPromise=require(_0x6613('0x0'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x6613('0x1'),_0x6613('0x2'),_0x6613('0x3'),_0x6613('0x4'),_0x6613('0x5'),_0x6613('0x6'),'openchannel'];exports[_0x6613('0x7')]=function(){return channels;};exports[_0x6613('0x8')]=function(_0x326205){_0x326205=_0x326205[_0x6613('0x9')]();return _[_0x6613('0xa')](channels,_0x326205);};exports[_0x6613('0xb')]=function(_0xb35d47,_0x3d4512,_0x2e73cb,_0x17b8c6){var _0x3f877e={'loginAttempts':_0x3d4512,'blocked':_0x2e73cb};if(!_[_0x6613('0xc')](_0x17b8c6)){_0x3f877e[_0x6613('0xd')]=_0x17b8c6;}return _0xb35d47[_0x6613('0xe')](_0x3f877e);};exports[_0x6613('0xf')]=function(_0x36562f){return new BPromise(function(_0x1b2460,_0x3b26a9){var _0x343f9d=0x0;if(_0x36562f[_0x6613('0x10')]!==_0x6613('0x11')){_0x1b2460(_0x36562f);}db['User']['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x36562f['id']}}})[_0x6613('0x12')](function(_0xb7a6e1){_0x343f9d=_0xb7a6e1;return util[_0x6613('0xf')]();})['then'](function(_0x335b57){if(_0x335b57&&_0x335b57[_0x6613('0x13')]&&_0x343f9d>=_0x335b57[_0x6613('0x13')]){throw Error(_0x6613('0x14'));}_0x1b2460(_0x36562f);})[_0x6613('0x15')](function(_0x4558f0){_0x3b26a9(_0x4558f0);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index b0278fb..70137cc 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c2e=['render','json','status'];(function(_0x55841f,_0x487812){var _0x4c5ccf=function(_0x2ce694){while(--_0x2ce694){_0x55841f['push'](_0x55841f['shift']());}};_0x4c5ccf(++_0x487812);}(_0x5c2e,0x140));var _0xe5c2=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5c2e[_0x5d4607];return _0x5e4a86;};'use strict';module['exports'][0x194]=function pageNotFound(_0xe87530,_0x383823){var _0x3afc29='404';var _0x46b012=0x194;var _0x2ac39a={'status':_0x46b012};_0x383823[_0xe5c2('0x0')](_0x2ac39a['status']);_0x383823[_0xe5c2('0x1')](_0x3afc29,{},function(_0x3a745c,_0x955231){if(_0x3a745c){return _0x383823[_0xe5c2('0x0')](_0x2ac39a[_0xe5c2('0x0')])[_0xe5c2('0x2')](_0x2ac39a);}_0x383823['send'](_0x955231);});}; \ No newline at end of file +var _0x7334=['render','json','send','exports','status'];(function(_0x3c1dec,_0x128674){var _0xe1213b=function(_0xcce0f4){while(--_0xcce0f4){_0x3c1dec['push'](_0x3c1dec['shift']());}};_0xe1213b(++_0x128674);}(_0x7334,0x184));var _0x4733=function(_0x46e7b5,_0x3bd2d2){_0x46e7b5=_0x46e7b5-0x0;var _0x475605=_0x7334[_0x46e7b5];return _0x475605;};'use strict';module[_0x4733('0x0')][0x194]=function pageNotFound(_0x36c14a,_0x280b6b){var _0x5016ad='404';var _0x26b8f3=0x194;var _0x4b8b5a={'status':_0x26b8f3};_0x280b6b[_0x4733('0x1')](_0x4b8b5a[_0x4733('0x1')]);_0x280b6b[_0x4733('0x2')](_0x5016ad,{},function(_0x29d7da,_0x2b146d){if(_0x29d7da){return _0x280b6b[_0x4733('0x1')](_0x4b8b5a[_0x4733('0x1')])[_0x4733('0x3')](_0x4b8b5a);}_0x280b6b[_0x4733('0x4')](_0x2b146d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 41ff0cb..7b93afd 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4483=['../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','ChatInternalMessage','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','UserVoiceQueue','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperHistories','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','hasOne','Imap','Smtp','Dispositions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','Dashboard','Items','Disposition','FaxAccountId','Answers','Interactions','FaxApplication','mandatoryDispositionPause','TagId','FaxInteractionId','Tags','fax_interaction_has_tags','user_has_fax_interactions','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','Users','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ProactiveActions','ChatMessage','user_has_chat_websites','ChatApplication','Agent','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','team_has_chat_queues','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','Automation','Condition','All','OneAll','AutomationAllId','AutomationAnyId','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','SalesforceConfiguration','Descriptions','DescriptionId','Description','Field','FieldId','Variable','VariableId','SugarcrmConfiguration','SugarcrmField','SugarcrmAccount','int_desk_configuration_has_tags','Subject','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_whatsapp_queues','TeamVoicePrefix','HopperBlacks','campaigns_has_cm_lists','MailTransferReport','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ChatTransferReport','FromUserId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromAccount','ToFaxQueueId','ToQueue','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','UserVoicePrefix','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','user_has_whatsapp_interactions','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication'];(function(_0x581a69,_0x2e7726){var _0x5bd55f=function(_0x3cfb2a){while(--_0x3cfb2a){_0x581a69['push'](_0x581a69['shift']());}};_0x5bd55f(++_0x2e7726);}(_0x4483,0x1a3));var _0x3448=function(_0x48e4f2,_0x4b67c0){_0x48e4f2=_0x48e4f2-0x0;var _0x11c5d3=_0x4483[_0x48e4f2];return _0x11c5d3;};'use strict';var config=require(_0x3448('0x0'));var Sequelize=require(_0x3448('0x1'));var _=require(_0x3448('0x2'));var jstz=require('jstz');var timezone=jstz[_0x3448('0x3')]();config[_0x3448('0x1')]=_[_0x3448('0x4')](config[_0x3448('0x1')],{'database':_0x3448('0x5'),'username':'xcall','password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});config[_0x3448('0xd')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x3448('0x5'),'username':_0x3448('0xe'),'password':_0x3448('0x6'),'options':{'host':_0x3448('0x7'),'port':0xcea,'dialect':_0x3448('0x8'),'dialectOptions':{'charset':_0x3448('0x9')},'logging':![],'timezone':timezone[_0x3448('0xa')](),'define':{'charset':_0x3448('0xb'),'collate':_0x3448('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0x1')][_0x3448('0xf')],config['sequelize']['username'],config[_0x3448('0x1')][_0x3448('0x10')],config['sequelize'][_0x3448('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3448('0xd')][_0x3448('0xf')],config['sequelizeHistory'][_0x3448('0x12')],config[_0x3448('0xd')]['password'],config[_0x3448('0xd')][_0x3448('0x11')])};db[_0x3448('0x13')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x15'));db[_0x3448('0x16')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x17'));db[_0x3448('0x18')]=db[_0x3448('0x1')]['import'](_0x3448('0x19'));db['VoiceExtension']=db['sequelize']['import'](_0x3448('0x1a'));db[_0x3448('0x1b')]=db[_0x3448('0x1')]['import'](_0x3448('0x1c'));db[_0x3448('0x1d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x1e'));db[_0x3448('0x1f')]=db['sequelize']['import']('../api/voiceRecording/voiceRecording.model');db[_0x3448('0x20')]=db[_0x3448('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x3448('0x21')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x22'));db[_0x3448('0x23')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x24'));db[_0x3448('0x25')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceCallReport/voiceCallReport.model');db[_0x3448('0x26')]=db[_0x3448('0x1')]['import'](_0x3448('0x27'));db[_0x3448('0x28')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x29'));db[_0x3448('0x2a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x3448('0x2b')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/memberReport/memberReport.model');db[_0x3448('0x2c')]=db['sequelize']['import']('../api/trunk/trunk.model');db[_0x3448('0x2d')]=db[_0x3448('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3448('0x2e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x2f'));db['UserVoiceQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x30'));db['UserChatQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x31'));db[_0x3448('0x32')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x33'));db[_0x3448('0x34')]=db[_0x3448('0x1')]['import'](_0x3448('0x35'));db[_0x3448('0x36')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x37'));db[_0x3448('0x38')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x39'));db[_0x3448('0x3a')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x3448('0x1')]['import'](_0x3448('0x3b'));db[_0x3448('0x3c')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailAccount/mailAccount.model');db[_0x3448('0x3d')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x3e'));db[_0x3448('0x3f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x40'));db[_0x3448('0x41')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x42'));db[_0x3448('0x43')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/mailMessage/mailMessage.model');db[_0x3448('0x44')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x45'));db[_0x3448('0x46')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x47'));db['Dashboard']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x48'));db['DashboardItem']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x49'));db[_0x3448('0x4a')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4b'));db['FaxApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x4c'));db[_0x3448('0x4d')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x3448('0x4e')]=db['sequelize']['import'](_0x3448('0x4f'));db[_0x3448('0x50')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x51'));db['FaxQueueReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x3448('0x52')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x53'));db[_0x3448('0x54')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x55'));db[_0x3448('0x56')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x57'));db[_0x3448('0x58')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/smsQueue/smsQueue.model');db[_0x3448('0x59')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x5a'));db['OpenchannelApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5b'));db[_0x3448('0x5c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5d'));db['OpenchannelMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x5e'));db[_0x3448('0x5f')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x60'));db['ChatApplication']=db['sequelize']['import'](_0x3448('0x61'));db[_0x3448('0x62')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x63'));db['ChatMessage']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/chatMessage/chatMessage.model');db[_0x3448('0x64')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x65'));db[_0x3448('0x66')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x67'));db[_0x3448('0x68')]=db['sequelize'][_0x3448('0x14')]('../api/chatGroup/chatGroup.model');db[_0x3448('0x69')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6a'));db[_0x3448('0x6b')]=db[_0x3448('0x1')]['import'](_0x3448('0x6c'));db['CmContact']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x6d'));db[_0x3448('0x6e')]=db[_0x3448('0x1')]['import']('../api/cmHopper/cmHopper.model');db[_0x3448('0x6f')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x3448('0x70')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x71'));db[_0x3448('0x72')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x73'));db[_0x3448('0x74')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x75'));db[_0x3448('0x76')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x77'));db[_0x3448('0x78')]=db[_0x3448('0x1')]['import'](_0x3448('0x79'));db['Automation']=db[_0x3448('0x1')]['import'](_0x3448('0x7a'));db[_0x3448('0x7b')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x7c'));db['Disposition']=db['sequelize'][_0x3448('0x14')]('../api/disposition/disposition.model');db['Condition']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/condition/condition.model');db['Interval']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7d'));db[_0x3448('0x7e')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x7f'));db[_0x3448('0x80')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x81'));db[_0x3448('0x82')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x3448('0x83')]=db[_0x3448('0x1')]['import'](_0x3448('0x84'));db[_0x3448('0x85')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x86'));db[_0x3448('0x87')]=db['sequelize']['import'](_0x3448('0x88'));db['Template']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x89'));db['Trigger']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8a'));db['Variable']=db['sequelize'][_0x3448('0x14')](_0x3448('0x8b'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db['IntegrationReport']=db[_0x3448('0x1')]['import'](_0x3448('0x8e'));db[_0x3448('0x8f')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x90'));db['AnalyticDefaultReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0x91'));db[_0x3448('0x92')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x93'));db[_0x3448('0x94')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x95'));db[_0x3448('0x96')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x97'));db[_0x3448('0x98')]=db[_0x3448('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x3448('0x99')]=db['sequelize'][_0x3448('0x14')](_0x3448('0x9a'));db['SalesforceConfiguration']=db[_0x3448('0x1')]['import'](_0x3448('0x9b'));db[_0x3448('0x9c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9d'));db['SugarcrmAccount']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9e'));db['SugarcrmConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x9f'));db['SugarcrmField']=db[_0x3448('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x3448('0xa0')]=db['sequelize'][_0x3448('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x3448('0xa1')]=db[_0x3448('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x3448('0xa2')]=db[_0x3448('0x1')]['import'](_0x3448('0xa3'));db[_0x3448('0xa4')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xa5'));db[_0x3448('0xa6')]=db[_0x3448('0x1')]['import'](_0x3448('0xa7'));db['ZohoField']=db[_0x3448('0x1')]['import'](_0x3448('0xa8'));db[_0x3448('0xa9')]=db[_0x3448('0x1')]['import'](_0x3448('0xaa'));db[_0x3448('0xab')]=db['sequelize'][_0x3448('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0x3448('0x1')]['import'](_0x3448('0xac'));db[_0x3448('0xad')]=db[_0x3448('0x1')]['import'](_0x3448('0xae'));db[_0x3448('0xaf')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb0'));db[_0x3448('0xb1')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb2'));db[_0x3448('0xb3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xb4'));db['VtigerConfiguration']=db['sequelize']['import'](_0x3448('0xb5'));db['VtigerField']=db['sequelize'][_0x3448('0x14')](_0x3448('0xb6'));db[_0x3448('0xb7')]=db[_0x3448('0x1')]['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x3448('0xb8')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x3448('0xb9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xba'));db['Dynamics365Account']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbb'));db['Dynamics365Field']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbc'));db[_0x3448('0xbd')]=db['sequelize'][_0x3448('0x14')](_0x3448('0xbe'));db['FreshsalesConfiguration']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xbf'));db[_0x3448('0x8c')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x8d'));db[_0x3448('0xc0')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/network/network.model');db[_0x3448('0xc1')]=db['sequelize'][_0x3448('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x3448('0xc2')]=db[_0x3448('0x1')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc3'));db['JscriptyQuestionReport']=db[_0x3448('0x1')][_0x3448('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc4'));db[_0x3448('0xc5')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xc6'));db[_0x3448('0xc7')]=db[_0x3448('0x1')]['import']('../api/squareReport/squareReport.model');db[_0x3448('0xc8')]=db['sequelize'][_0x3448('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x3448('0xc9')]=db[_0x3448('0x1')]['import'](_0x3448('0xca'));db[_0x3448('0xcb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xcc'));db[_0x3448('0xcd')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xce'));db[_0x3448('0xcf')]=db[_0x3448('0x1')]['import'](_0x3448('0xd0'));db[_0x3448('0xd1')]=db[_0x3448('0x1')]['import'](_0x3448('0xd2'));db[_0x3448('0xd3')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd4'));db[_0x3448('0xd5')]=db['sequelize']['import'](_0x3448('0xd6'));db[_0x3448('0xd7')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xd8'));db[_0x3448('0xd9')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xda'));db[_0x3448('0xdb')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdc'));db[_0x3448('0xdd')]=db['sequelize']['import']('../api/attachment/attachment.model');db[_0x3448('0xde')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xdf'));db['MailTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe0'));db['ChatTransferReport']=db[_0x3448('0x1')]['import'](_0x3448('0xe1'));db[_0x3448('0xe2')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe3'));db[_0x3448('0xe4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xe5'));db['SmsTransferReport']=db['sequelize'][_0x3448('0x14')](_0x3448('0xe6'));db[_0x3448('0xe7')]=db[_0x3448('0x1')]['import'](_0x3448('0xe8'));db[_0x3448('0xe9')]=db[_0x3448('0x1')]['import'](_0x3448('0xea'));db['UserProfile']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xeb'));db['UserProfileSection']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xec'));db[_0x3448('0xed')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xee'));db[_0x3448('0xef')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf0'));db[_0x3448('0xf1')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf2'));db['WhatsappInteraction']=db['sequelize'][_0x3448('0x14')](_0x3448('0xf3'));db[_0x3448('0xf4')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf5'));db[_0x3448('0xf6')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xf7'));db[_0x3448('0xf8')]=db[_0x3448('0x1')]['import'](_0x3448('0xf9'));db[_0x3448('0xfa')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfb'));db[_0x3448('0xfc')]=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xfd'));db[_0x3448('0xfe')]=db[_0x3448('0x1')][_0x3448('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0xff'));db['UserVoicePrefix']=db[_0x3448('0x1')][_0x3448('0x14')](_0x3448('0x100'));db['User']['hasOne'](db[_0x3448('0x21')],{'as':_0x3448('0x21'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x1f')],{'as':_0x3448('0x104'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x2e')],{'as':_0x3448('0x105'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Extensions','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':'UserId'});db['User'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x102')});db['User'][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')]['hasMany'](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':_0x3448('0x10d'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x13')][_0x3448('0x103')](db[_0x3448('0xef')],{'as':'UserNotifications','foreignKey':_0x3448('0x111')});db['User'][_0x3448('0x112')](db[_0x3448('0x113')],{'as':'UserProfile','foreignKey':_0x3448('0x114')});db['User'][_0x3448('0x115')](db[_0x3448('0x68')],{'as':'Groups','through':_0x3448('0x116')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'through':_0x3448('0x119')});db['User']['belongsToMany'](db[_0x3448('0xe7')],{'as':_0x3448('0x11a'),'through':_0x3448('0x11b')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x11c')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x41')],{'as':_0x3448('0x10e'),'through':_0x3448('0x11d')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'through':_0x3448('0x11e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4d')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10b')],{'as':'SmsInteractions','through':_0x3448('0x11f')});db['User'][_0x3448('0x115')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'through':_0x3448('0x120')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x110'),'through':'user_has_whatsapp_interactions'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'VoiceQueues','through':_0x3448('0x121'),'required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xe9')],{'as':_0x3448('0x122'),'through':'UserVoicePrefix','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x3d')],{'as':_0x3448('0x123'),'through':_0x3448('0x124'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x66')],{'as':_0x3448('0x125'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x3448('0x13')][_0x3448('0x115')](db['FaxQueue'],{'as':_0x3448('0x126'),'through':'UserFaxQueue','required':![]});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x58')],{'as':_0x3448('0x127'),'through':_0x3448('0x34'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x128')],{'as':_0x3448('0x129'),'through':_0x3448('0x36'),'required':![]});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xfa')],{'as':_0x3448('0x12a'),'through':_0x3448('0x38'),'required':![]});db['User'][_0x3448('0x115')](db['CmList'],{'through':_0x3448('0x11b')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0x12b')],{'as':_0x3448('0x12c'),'through':'user_has_chat_websites'});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x4a')],{'as':_0x3448('0x12d'),'through':_0x3448('0x12e')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x3c')],{'as':_0x3448('0x12f'),'through':_0x3448('0x130')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0x59')],{'as':_0x3448('0x131'),'through':_0x3448('0x132')});db['User'][_0x3448('0x115')](db['SmsAccount'],{'as':_0x3448('0x133'),'through':_0x3448('0x134')});db[_0x3448('0x13')][_0x3448('0x115')](db[_0x3448('0xf1')],{'as':_0x3448('0x135'),'through':_0x3448('0x136')});db[_0x3448('0x13')]['belongsToMany'](db[_0x3448('0xcf')],{'as':_0x3448('0x137'),'through':_0x3448('0x138')});db[_0x3448('0x16')]['hasMany'](db[_0x3448('0x106')],{'as':_0x3448('0x139'),'onDelete':'cascade','foreignKey':_0x3448('0x13a')});db['VoiceContext'][_0x3448('0x103')](db['VoiceExtension'],{'onDelete':_0x3448('0x101')});db[_0x3448('0x106')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x13b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x1b')][_0x3448('0x115')](db[_0x3448('0x85')],{'as':_0x3448('0x13c'),'through':_0x3448('0x13d')});db[_0x3448('0x1d')][_0x3448('0x103')](db['UserVoiceQueueRt'],{'as':_0x3448('0x13e'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db['CmHopper'],{'as':_0x3448('0x13f'),'foreignKey':'VoiceQueueId'});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x70')],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x74')],{'as':_0x3448('0x74'),'foreignKey':_0x3448('0x140')});db['VoiceQueue']['hasMany'](db[_0x3448('0x6f')],{'as':'HopperBlacks','foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x140')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x2c'),'foreignKey':_0x3448('0x144')});db[_0x3448('0x1d')]['belongsTo'](db['Trunk'],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x147')],{'as':'Interval','foreignKey':_0x3448('0x148')});db[_0x3448('0x1d')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0xe7')],{'as':'Lists','through':_0x3448('0x149')});db[_0x3448('0x1d')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x121')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'as':_0x3448('0x14b'),'through':_0x3448('0xfe')});db[_0x3448('0x1d')][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':_0x3448('0x14c'),'through':'voice_queues_has_cm_blacklists'});db[_0x3448('0x1f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x20')][_0x3448('0x112')](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x3448('0x21')][_0x3448('0x103')](db['VoiceMailMessage'],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':_0x3448('0x14e'),'sourceKey':_0x3448('0x14f')});db['VoiceMailMessage'][_0x3448('0x112')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x3448('0x14f')});db[_0x3448('0x25')][_0x3448('0x103')](db[_0x3448('0x2a')],{'as':_0x3448('0x150'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x103')](db['VoiceAgentReport'],{'as':_0x3448('0x152'),'foreignKey':_0x3448('0x151'),'constraints':![]});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x25')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x3a')][_0x3448('0x112')](db['MailAccount'],{'as':_0x3448('0x3c'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x155')](db[_0x3448('0x3a')],{'as':_0x3448('0x156'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x155')](db['MailServerOut'],{'as':_0x3448('0x157'),'onDelete':_0x3448('0x101')});db[_0x3448('0x3c')][_0x3448('0x103')](db['Disposition'],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x154'),'onDelete':'cascade'});db['MailAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x41')],{'as':'Interactions'});db[_0x3448('0x3c')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':'Applications'});db['MailAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0x3c')]['belongsTo'](db[_0x3448('0x15b')],{'as':_0x3448('0x15b'),'foreignKey':_0x3448('0x15c')});db[_0x3448('0x3c')][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0x3c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x130')});db['MailQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserMailQueue'});db[_0x3448('0x3d')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'team_has_mail_queues','as':_0x3448('0x14b')});db[_0x3448('0x41')][_0x3448('0x103')](db[_0x3448('0x43')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x41')]['belongsTo'](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db['MailInteraction']['belongsTo'](db['User'],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x41')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x161'),'as':'Tags'});db['MailInteraction'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x161'),'as':_0x3448('0x162')});db[_0x3448('0x41')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x11d'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x103')](db['Attachment'],{'as':'Attachments','onDelete':_0x3448('0x101')});db['MailMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x41')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x15e')});db[_0x3448('0x43')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x154')});db[_0x3448('0x43')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x12b'),'foreignKey':_0x3448('0x165')});db['MailMessage'][_0x3448('0x112')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x3448('0x166')});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db['MailApplication'][_0x3448('0x112')](db[_0x3448('0x3d')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')][_0x3448('0x112')](db['MailAccount'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x44')]['belongsTo'](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':'IntervalId'});db[_0x3448('0x44')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x3c')],{});db[_0x3448('0x46')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['MailQueueReport'][_0x3448('0x112')](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x46')][_0x3448('0x112')](db['MailInteraction'],{});db['MailQueueReport'][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x46')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x46')][_0x3448('0x112')](db['MailQueue'],{});db[_0x3448('0x168')][_0x3448('0x103')](db['DashboardItem'],{'as':_0x3448('0x169'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x16b'),'onDelete':_0x3448('0x101')});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'FaxAccountId'});db[_0x3448('0x4a')]['hasMany'](db[_0x3448('0x4d')],{'as':_0x3448('0x16d')});db[_0x3448('0x4a')][_0x3448('0x103')](db[_0x3448('0x16e')],{'as':_0x3448('0x13b')});db['FaxAccount'][_0x3448('0x103')](db[_0x3448('0x106')],{'as':'Exntensions','onDelete':_0x3448('0x101')});db['FaxAccount'][_0x3448('0x103')](db['FaxMessage'],{'as':'Messages'});db[_0x3448('0x4a')][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':'Trunk'});db['FaxAccount'][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':'List','foreignKey':'ListId'});db[_0x3448('0x4a')]['belongsTo'](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db['FaxAccount'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_fax_accounts'});db[_0x3448('0x16e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x50')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x16e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x170')});db[_0x3448('0x4d')][_0x3448('0x103')](db[_0x3448('0x4e')],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x171')});db['FaxInteraction']['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x3448('0x4d')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['FaxInteraction'][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x4d')][_0x3448('0x115')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x3448('0x172')});db['FaxInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x173'),'as':'ThroughTags'});db[_0x3448('0x4d')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x174'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')][_0x3448('0x112')](db['User'],{'onDelete':'cascade','as':_0x3448('0x13')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x4d')],{'as':_0x3448('0x164'),'foreignKey':_0x3448('0x171')});db[_0x3448('0x4e')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db['FaxMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x3448('0x4e')][_0x3448('0x112')](db[_0x3448('0x4a')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x16b')});db[_0x3448('0x50')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':_0x3448('0x32')});db['FaxQueue'][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x175'),'as':_0x3448('0x14b')});db['FaxQueueReport'][_0x3448('0x112')](db['FaxAccount'],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a')});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x176')]['belongsTo'](db['FaxInteraction'],{});db[_0x3448('0x176')][_0x3448('0x112')](db['FaxMessage'],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x176')][_0x3448('0x112')](db[_0x3448('0x50')],{});db[_0x3448('0x52')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x177'),'onDelete':_0x3448('0x101')});db[_0x3448('0x52')][_0x3448('0x103')](db['CannedAnswer'],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x52')]['hasMany'](db['SmsInteraction'],{'as':_0x3448('0x16d')});db[_0x3448('0x52')][_0x3448('0x103')](db['SmsApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x52')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['SmsAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x3448('0x52')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'user_has_sms_accounts'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x58')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x54')][_0x3448('0x112')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x3448('0x54')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db['SmsApplication'][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10b')][_0x3448('0x103')](db[_0x3448('0x56')],{'as':_0x3448('0x14d'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x52')],{'as':'Account','foreignKey':_0x3448('0x177')});db['SmsInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10b')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':'UserId'});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'sms_interaction_has_tags','as':_0x3448('0x172')});db[_0x3448('0x10b')]['belongsToMany'](db[_0x3448('0x87')],{'through':_0x3448('0x178'),'as':_0x3448('0x162')});db[_0x3448('0x10b')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11f'),'foreignKey':'SmsInteractionId'});db[_0x3448('0x56')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x13')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x163')});db[_0x3448('0x56')][_0x3448('0x112')](db[_0x3448('0x10b')],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17a')});db['SmsMessage'][_0x3448('0x112')](db[_0x3448('0x52')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x177')});db[_0x3448('0x58')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x34'),'foreignKey':'SmsQueueId'});db[_0x3448('0x58')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x17b'),'as':_0x3448('0x14b')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x17c'),'onDelete':_0x3448('0x101')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x5c')],{'as':_0x3448('0x16d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x59')]['hasMany'](db[_0x3448('0x17e')],{'as':_0x3448('0x13b'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x59')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['OpenchannelAccount'][_0x3448('0x112')](db['Pause'],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x59')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x132')});db[_0x3448('0x17e')][_0x3448('0x112')](db['User'],{'onDelete':_0x3448('0x167')});db['OpenchannelApplication'][_0x3448('0x112')](db[_0x3448('0x128')],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x3448('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x3448('0x17e')]['belongsTo'](db['Interval'],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x17e')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':'restrict','foreignKey':_0x3448('0x170')});db[_0x3448('0x5c')][_0x3448('0x103')](db[_0x3448('0x17d')],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x5c')][_0x3448('0x112')](db['OpenchannelAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x5c')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x5c')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x5c')][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x180'),'as':_0x3448('0x172')});db[_0x3448('0x5c')]['belongsToMany'](db[_0x3448('0x87')],{'through':'openchannel_interaction_has_tags','as':_0x3448('0x162')});db[_0x3448('0x5c')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db[_0x3448('0x17d')]['belongsTo'](db[_0x3448('0x117')],{'onDelete':'cascade','as':_0x3448('0x163')});db[_0x3448('0x17d')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x3448('0x164'),'foreignKey':_0x3448('0x17f')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db[_0x3448('0x17d')][_0x3448('0x112')](db[_0x3448('0x59')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x17c')});db[_0x3448('0x128')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':'UserOpenchannelQueue','foreignKey':_0x3448('0x182')});db['OpenchannelQueue']['belongsToMany'](db[_0x3448('0xd5')],{'through':_0x3448('0x183'),'as':'Teams'});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':'ChatWebsiteId','onDelete':_0x3448('0x101')});db['ChatWebsite'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':_0x3448('0x16c'),'foreignKey':_0x3448('0x165')});db[_0x3448('0x12b')]['hasMany'](db['ChatProactiveAction'],{'as':_0x3448('0x184')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':'Interactions'});db[_0x3448('0x12b')]['hasMany'](db['ChatApplication'],{'as':_0x3448('0x13b')});db[_0x3448('0x12b')][_0x3448('0x103')](db[_0x3448('0x185')],{'as':_0x3448('0x14d')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db['ChatWebsite'][_0x3448('0x112')](db['Interval'],{'as':_0x3448('0x147'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x12b')][_0x3448('0x112')](db[_0x3448('0x3c')],{'as':_0x3448('0x3c'),'foreignKey':_0x3448('0x154')});db['ChatWebsite']['belongsTo'](db[_0x3448('0x7e')],{'as':_0x3448('0x16f'),'foreignKey':_0x3448('0x15d')});db[_0x3448('0x12b')][_0x3448('0x115')](db['User'],{'as':_0x3448('0x14a'),'through':_0x3448('0x186')});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x59')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':'ListId'});db[_0x3448('0x5f')]['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':_0x3448('0x153')});db[_0x3448('0x5f')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x3448('0x5f')][_0x3448('0x112')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0x5f')][_0x3448('0x112')](db[_0x3448('0x128')],{});db[_0x3448('0x187')][_0x3448('0x112')](db['User'],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102'),'onDelete':_0x3448('0x167')});db['ChatApplication'][_0x3448('0x112')](db[_0x3448('0x66')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x3448('0x187')][_0x3448('0x112')](db['ChatWebsite'],{'as':_0x3448('0x189'),'foreignKey':_0x3448('0x165'),'onDelete':_0x3448('0x167')});db[_0x3448('0x187')]['belongsTo'](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db['ChatInteraction'][_0x3448('0x103')](db['ChatMessage'],{'as':_0x3448('0x14d'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x62')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x165')});db['ChatInteraction']['belongsTo'](db[_0x3448('0x117')],{'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x62')]['belongsTo'](db[_0x3448('0x13')],{'as':'Owner','foreignKey':_0x3448('0x102')});db[_0x3448('0x62')]['belongsToMany'](db[_0x3448('0x87')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x18b'),'as':_0x3448('0x162')});db['ChatInteraction'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x11e'),'foreignKey':_0x3448('0x18a')});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x13')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x185')]['belongsTo'](db[_0x3448('0x62')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0xdd')],{'as':_0x3448('0xdd'),'foreignKey':_0x3448('0x181')});db['ChatMessage'][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':_0x3448('0x15f'),'foreignKey':'ChatWebsiteId'});db[_0x3448('0x64')][_0x3448('0x103')](db[_0x3448('0xdd')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x3448('0x101'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x3448('0x101'),'as':'Contact','foreignKey':'ContactId'});db[_0x3448('0x64')][_0x3448('0x112')](db[_0x3448('0x12b')],{'as':'Account','foreignKey':_0x3448('0x165')});db['ChatQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x18c'),'hooks':!![]});db[_0x3448('0x66')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':_0x3448('0x18d'),'as':_0x3448('0x14b')});db[_0x3448('0x68')][_0x3448('0x103')](db[_0x3448('0xc2')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x3448('0x68')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x13e'),'through':'chat_group_has_users'});db[_0x3448('0x69')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x3448('0x165')});db[_0x3448('0x6b')]['hasMany'](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'foreignKey':_0x3448('0x18e')});db[_0x3448('0x117')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'ContactId'});db['CmContact'][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x153')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x142')],{'as':_0x3448('0x143'),'foreignKey':_0x3448('0x153')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x5c')],{'as':_0x3448('0x109'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x62')],{'as':_0x3448('0x10a'),'foreignKey':'ContactId','onDelete':_0x3448('0x167')});db['CmContact'][_0x3448('0x103')](db[_0x3448('0x10b')],{'as':_0x3448('0x10c'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')][_0x3448('0x103')](db[_0x3448('0x4d')],{'as':'FaxInteractions','foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x167')});db[_0x3448('0x117')]['hasMany'](db[_0x3448('0x41')],{'as':'MailInteractions','foreignKey':_0x3448('0x153'),'onDelete':'restrict'});db[_0x3448('0x117')]['belongsTo'](db[_0x3448('0x6b')],{'as':_0x3448('0x18f'),'foreignKey':'CompanyId'});db[_0x3448('0x117')][_0x3448('0x112')](db['CmList'],{'as':'List','foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'through':_0x3448('0x119')});db[_0x3448('0x117')][_0x3448('0x115')](db[_0x3448('0x87')],{'as':_0x3448('0x172'),'through':'cm_contact_has_tags'});db['CmContact'][_0x3448('0x115')](db['Tag'],{'through':_0x3448('0x190'),'as':_0x3448('0x162')});db['CmHopper'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x188'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopper']['belongsTo'](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6e')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x193')});db[_0x3448('0x6f')][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153'),'onDelete':_0x3448('0x101')});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db[_0x3448('0x6f')]['belongsTo'](db[_0x3448('0x1d')],{'as':_0x3448('0x191'),'foreignKey':_0x3448('0x140'),'onDelete':_0x3448('0x101')});db['CmHopperBlack'][_0x3448('0x112')](db[_0x3448('0xd9')],{'as':_0x3448('0xd9'),'foreignKey':_0x3448('0x192'),'onDelete':_0x3448('0x101')});db[_0x3448('0x194')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x196'),'singular':_0x3448('0x197')},'foreignKey':_0x3448('0x198'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x194')]['hasMany'](db[_0x3448('0x195')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':_0x3448('0x199'),'onDelete':_0x3448('0x101'),'hooks':!![]});db['Automation'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':_0x3448('0x19a'),'foreignKey':'AutomationId','onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x16a')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x19b'),'onDelete':'cascade'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x147')],{'as':_0x3448('0x19c'),'foreignKey':_0x3448('0x148'),'onDelete':_0x3448('0x101'),'hooks':!![],'required':![]});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'foreignKey':_0x3448('0x148'),'onDelete':'restrict'});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x44')],{'as':_0x3448('0x19e'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db[_0x3448('0x187')],{'as':_0x3448('0x19f'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x147')][_0x3448('0x103')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x3448('0x148')});db['Interval']['hasMany'](db['SmsApplication'],{'as':_0x3448('0x1a0'),'foreignKey':'IntervalId'});db['Schedule']['belongsTo'](db[_0x3448('0x3c')],{});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x1a1')],{'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x83')][_0x3448('0x112')](db[_0x3448('0x8f')],{'foreignKey':_0x3448('0x1a3')});db[_0x3448('0x85')][_0x3448('0x115')](db[_0x3448('0x1b')],{'as':_0x3448('0x1a4'),'through':'moh_has_sounds','onDelete':_0x3448('0x167')});db[_0x3448('0x87')][_0x3448('0x115')](db['CmContact'],{'through':_0x3448('0x190')});db['Tag'][_0x3448('0x115')](db[_0x3448('0x62')],{'through':_0x3448('0x18b')});db['Tag'][_0x3448('0x115')](db['MailInteraction'],{'through':_0x3448('0x161')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10b')],{'through':_0x3448('0x178')});db[_0x3448('0x87')]['belongsToMany'](db['FaxInteraction'],{'through':_0x3448('0x173')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x5c')],{'through':_0x3448('0x180')});db[_0x3448('0x87')][_0x3448('0x115')](db[_0x3448('0x10f')],{'through':_0x3448('0x1a5')});db[_0x3448('0x1a6')][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1a7'),'singular':_0x3448('0x1a8')},'foreignKey':_0x3448('0x1a9'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x195')],{'as':{'plural':_0x3448('0x1aa'),'singular':_0x3448('0x1ab')},'foreignKey':'TriggerAnyId','onDelete':_0x3448('0x101'),'hooks':!![]});db['Trigger'][_0x3448('0x103')](db[_0x3448('0x78')],{'as':'Actions','foreignKey':_0x3448('0x1ac'),'onDelete':_0x3448('0x101'),'hooks':!![]});db[_0x3448('0x8f')][_0x3448('0x103')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a3'),'hooks':!![]});db[_0x3448('0x1a1')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1a2')});db[_0x3448('0x94')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x3448('0x96')][_0x3448('0x112')](db['AnalyticMetric'],{'foreignKey':_0x3448('0x1ae')});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1b3')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db['SalesforceConfiguration'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1ad'),'onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x3448('0x112')](db[_0x3448('0x99')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x9c')]['hasMany'](db[_0x3448('0x9c')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db[_0x3448('0x9c')][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db['SalesforceField'][_0x3448('0x103')](db[_0x3448('0x9c')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['SalesforceField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':_0x3448('0x1ba')});db['SugarcrmAccount'][_0x3448('0x103')](db[_0x3448('0x1bb')],{'as':_0x3448('0x1af'),'onDelete':'cascade','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1bb')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subjects','onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3448('0x1bb')][_0x3448('0x103')](db['SugarcrmField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1bb')][_0x3448('0x112')](db[_0x3448('0x1bd')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':'Subject','foreignKey':_0x3448('0x1b2')});db['SugarcrmField'][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1bc')][_0x3448('0x103')](db[_0x3448('0x1bc')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa0')][_0x3448('0x103')](db[_0x3448('0xa1')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa1')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db[_0x3448('0xa1')][_0x3448('0x103')](db['DeskField'],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa1')]['hasMany'](db['DeskField'],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':'FieldId'});db[_0x3448('0xa1')][_0x3448('0x112')](db[_0x3448('0xa0')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['DeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1be')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x3448('0xa2')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa2')][_0x3448('0x103')](db[_0x3448('0xa2')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa2')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db[_0x3448('0xa4')][_0x3448('0x103')](db[_0x3448('0xa6')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xa6')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xa6')]['hasMany'](db[_0x3448('0x1c0')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xa6')][_0x3448('0x112')](db[_0x3448('0xa4')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1c0')][_0x3448('0x103')](db['ZohoField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c0')][_0x3448('0x103')](db[_0x3448('0x1c0')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0x1c0')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xa9')][_0x3448('0x103')](db['ZendeskConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xab')][_0x3448('0x103')](db['ZendeskField'],{'as':_0x3448('0x1b4'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xab')]['hasMany'](db[_0x3448('0x1c1')],{'as':_0x3448('0x1ad'),'foreignKey':'FieldId'});db[_0x3448('0xab')][_0x3448('0x112')](db['ZendeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['ZendeskConfiguration'][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c2')});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0x1c1')][_0x3448('0x103')](db[_0x3448('0x1c1')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db['ZendeskField'][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x3448('0x103')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b1'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0x3448('0x1b4'),'onDelete':'cascade','foreignKey':_0x3448('0x1b5')});db[_0x3448('0xaf')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xaf')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x3448('0x15f'),'foreignKey':'AccountId'});db[_0x3448('0xaf')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1c3')});db[_0x3448('0xb1')][_0x3448('0x103')](db['FreshdeskField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0xb1')][_0x3448('0x103')](db[_0x3448('0xb1')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0xb1')]['hasMany'](db[_0x3448('0xb1')],{'as':_0x3448('0x1b7'),'foreignKey':'FieldId'});db[_0x3448('0xb1')]['belongsTo'](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xb3')][_0x3448('0x103')](db['VtigerConfiguration'],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db['VtigerConfiguration'][_0x3448('0x103')](db['VtigerField'],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c4')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c4')][_0x3448('0x112')](db[_0x3448('0xb3')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c5')][_0x3448('0x103')](db['VtigerField'],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['VtigerField']['hasMany'](db[_0x3448('0x1c5')],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1c5')][_0x3448('0x103')](db[_0x3448('0x1c5')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c5')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x3448('0x103')](db[_0x3448('0xb8')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb8')]['hasMany'](db['ServicenowField'],{'as':_0x3448('0x1b1'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Descriptions','foreignKey':_0x3448('0x1b5')});db['ServicenowConfiguration'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':_0x3448('0x1ad'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb8')][_0x3448('0x112')](db[_0x3448('0xb7')],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0xb9')]['hasMany'](db[_0x3448('0xb9')],{'as':_0x3448('0x1bf'),'foreignKey':_0x3448('0x1b2')});db['ServicenowField'][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3448('0xb9')][_0x3448('0x103')](db[_0x3448('0xb9')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0xb9')][_0x3448('0x112')](db['Variable'],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0x1c6')][_0x3448('0x103')](db[_0x3448('0x1c7')],{'as':_0x3448('0x1af'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c7')]['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b1'),'onDelete':'cascade','foreignKey':_0x3448('0x1b2')});db['Dynamics365Configuration'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b4'),'onDelete':_0x3448('0x101'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c7')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1ad'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c7')][_0x3448('0x112')](db['Dynamics365Account'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1b0')});db['Dynamics365Field'][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db[_0x3448('0x1c8')],{'as':_0x3448('0x1b6'),'foreignKey':'DescriptionId'});db[_0x3448('0x1c8')][_0x3448('0x103')](db[_0x3448('0x1c8')],{'as':'Field','foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1c8')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':'Variable','foreignKey':'VariableId'});db['FreshsalesAccount'][_0x3448('0x103')](db[_0x3448('0x1c9')],{'as':'Configurations','onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1c9')]['hasMany'](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b1'),'foreignKey':_0x3448('0x1b2')});db[_0x3448('0x1c9')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b4'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x3448('0x103')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x3448('0x1b8')});db['FreshsalesConfiguration'][_0x3448('0x112')](db[_0x3448('0xbd')],{'as':'Account','foreignKey':_0x3448('0x1b0')});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1bf'),'foreignKey':'SubjectId'});db[_0x3448('0x1ca')][_0x3448('0x103')](db['FreshsalesField'],{'as':_0x3448('0x1b6'),'foreignKey':_0x3448('0x1b5')});db[_0x3448('0x1ca')][_0x3448('0x103')](db[_0x3448('0x1ca')],{'as':_0x3448('0x1b7'),'foreignKey':_0x3448('0x1b8')});db[_0x3448('0x1ca')][_0x3448('0x112')](db[_0x3448('0x1b9')],{'as':_0x3448('0x1b9'),'foreignKey':_0x3448('0x1ba')});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x12b')],{});db['ChatQueueReport'][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['ChatQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['User'],{});db[_0x3448('0xc1')][_0x3448('0x112')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cb')});db[_0x3448('0xc2')][_0x3448('0x112')](db[_0x3448('0x13')],{'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x1cc')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0x142')][_0x3448('0x103')](db[_0x3448('0x1cf')],{'foreignKey':_0x3448('0x1ce'),'onDelete':_0x3448('0x101')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x52')],{});db['SmsQueueReport']['belongsTo'](db[_0x3448('0xe7')],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xc5')]['belongsTo'](db['CmContact'],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x10b')],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xc5')][_0x3448('0x112')](db[_0x3448('0x58')],{});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x142')],{'foreignKey':'ProjectId'});db[_0x3448('0xc9')][_0x3448('0x103')](db[_0x3448('0x1cd')],{'foreignKey':_0x3448('0x1d0')});db['JscriptyProject']['hasMany'](db[_0x3448('0x1cf')],{'foreignKey':'ProjectId'});db[_0x3448('0xcf')]['belongsToMany'](db[_0x3448('0x13')],{'as':'Users','through':_0x3448('0x138')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11c')});db['Team'][_0x3448('0x115')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x3448('0x1d1')});db[_0x3448('0xd5')][_0x3448('0x115')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x3448('0x123')});db['Team'][_0x3448('0x115')](db['ChatQueue'],{'through':_0x3448('0x18d'),'as':_0x3448('0x125')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x50')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x3448('0x58')],{'through':_0x3448('0x17b'),'as':_0x3448('0x127')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0x128')],{'through':_0x3448('0x183'),'as':_0x3448('0x129')});db[_0x3448('0xd5')][_0x3448('0x115')](db[_0x3448('0xfa')],{'through':_0x3448('0x1d2'),'as':_0x3448('0x12a')});db['Team'][_0x3448('0x115')](db[_0x3448('0xe9')],{'through':_0x3448('0x1d3'),'as':_0x3448('0x122')});db['Campaign'][_0x3448('0x103')](db[_0x3448('0x6e')],{'as':_0x3448('0x13f'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x141'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['hasMany'](db[_0x3448('0x6f')],{'as':_0x3448('0x1d4'),'foreignKey':_0x3448('0x192')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x2c')],{'as':'Trunk','foreignKey':_0x3448('0x144')});db['Campaign'][_0x3448('0x112')](db[_0x3448('0x2c')],{'as':_0x3448('0x145'),'foreignKey':_0x3448('0x146')});db[_0x3448('0xd9')]['belongsTo'](db[_0x3448('0x147')],{'as':_0x3448('0x147'),'foreignKey':'IntervalId'});db['Campaign'][_0x3448('0x112')](db[_0x3448('0xcf')],{'as':_0x3448('0xcf'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0x3448('0x11a'),'through':_0x3448('0x1d5')});db['Campaign'][_0x3448('0x115')](db[_0x3448('0xe7')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db['Attachment']['belongsTo'](db[_0x3448('0x64')],{'as':_0x3448('0x64'),'foreignKey':_0x3448('0x166')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x43')],{});db[_0x3448('0x1d6')][_0x3448('0x112')](db['MailInteraction'],{});db[_0x3448('0x1d6')]['belongsTo'](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db['MailTransferReport'][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1d6')][_0x3448('0x112')](db[_0x3448('0x3d')],{'foreignKey':_0x3448('0x1da'),'as':'ToQueue'});db[_0x3448('0x1d6')]['belongsTo'](db[_0x3448('0x3c')],{'foreignKey':_0x3448('0x1db'),'as':'ToAccount'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x185')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x62')],{});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x12b')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x3448('0x1dc')]['belongsTo'](db['User'],{'foreignKey':_0x3448('0x1dd'),'as':'FromAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x3448('0x1dc')][_0x3448('0x112')](db[_0x3448('0x66')],{'foreignKey':_0x3448('0x1de'),'as':'ToQueue'});db[_0x3448('0x1dc')][_0x3448('0x112')](db['ChatWebsite'],{'foreignKey':_0x3448('0x1df'),'as':_0x3448('0x1e0')});db['FaxTransferReport'][_0x3448('0x112')](db[_0x3448('0x4e')],{});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e1'),'as':_0x3448('0x1e2')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'FromUserId','as':_0x3448('0x1d7')});db[_0x3448('0xe2')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0xe2')][_0x3448('0x112')](db[_0x3448('0x50')],{'foreignKey':_0x3448('0x1e3'),'as':_0x3448('0x1e4')});db[_0x3448('0xe2')][_0x3448('0x112')](db['FaxAccount'],{'foreignKey':_0x3448('0x1e5'),'as':'ToAccount'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x17d')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x5c')],{});db[_0x3448('0xe4')][_0x3448('0x112')](db['OpenchannelAccount'],{'foreignKey':_0x3448('0x1e6'),'as':_0x3448('0x1e2')});db[_0x3448('0xe4')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':'ToUserId','as':_0x3448('0x1d9')});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x128')],{'foreignKey':_0x3448('0x1e7'),'as':'ToQueue'});db[_0x3448('0xe4')][_0x3448('0x112')](db[_0x3448('0x59')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x56')],{});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x10b')],{});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x52')],{'foreignKey':_0x3448('0x1e9'),'as':_0x3448('0x1e2')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0x1e8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db[_0x3448('0x1e8')][_0x3448('0x112')](db[_0x3448('0x58')],{'foreignKey':_0x3448('0x1ea'),'as':_0x3448('0x1e4')});db[_0x3448('0x1e8')][_0x3448('0x112')](db['SmsAccount'],{'foreignKey':_0x3448('0x1eb'),'as':'ToAccount'});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x15a'),'onDelete':'cascade'});db['CmList'][_0x3448('0x103')](db[_0x3448('0x76')],{'as':'CustomFields','foreignKey':_0x3448('0x15a')});db['CmList'][_0x3448('0x103')](db[_0x3448('0x117')],{'as':_0x3448('0x118'),'onDelete':_0x3448('0x101'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['CmHopperFinal'],{'as':_0x3448('0x107'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db[_0x3448('0x72')],{'as':_0x3448('0x108'),'foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x103')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x3448('0x15a')});db[_0x3448('0xe7')][_0x3448('0x115')](db[_0x3448('0x1d')],{'as':'Queues','through':_0x3448('0x149')});db[_0x3448('0xe7')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x11b')});db[_0x3448('0xe9')][_0x3448('0x103')](db[_0x3448('0x106')],{'as':_0x3448('0x19d'),'onDelete':_0x3448('0x101')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x1ec')});db[_0x3448('0xe9')][_0x3448('0x115')](db[_0x3448('0xd5')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0x3448('0x113')][_0x3448('0x103')](db[_0x3448('0x13')],{'as':_0x3448('0x179'),'foreignKey':_0x3448('0x114')});db['UserProfile'][_0x3448('0x103')](db[_0x3448('0x1ed')],{'as':_0x3448('0x1ee'),'foreignKey':_0x3448('0x114'),'onDelete':_0x3448('0x101')});db['UserProfileSection'][_0x3448('0x103')](db[_0x3448('0xed')],{'as':_0x3448('0x1ef'),'foreignKey':_0x3448('0x1f0'),'onDelete':'cascade'});db[_0x3448('0xf1')]['hasMany'](db[_0x3448('0x16a')],{'as':_0x3448('0x158'),'foreignKey':_0x3448('0x1f1'),'onDelete':_0x3448('0x101')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0x7b')],{'as':'Answers','foreignKey':_0x3448('0x1f1')});db['WhatsappAccount'][_0x3448('0x103')](db[_0x3448('0xf4')],{'as':_0x3448('0x14d'),'foreignKey':_0x3448('0x1f1')});db['WhatsappAccount']['hasMany'](db[_0x3448('0x10f')],{'as':_0x3448('0x16d')});db[_0x3448('0xf1')][_0x3448('0x103')](db[_0x3448('0x1f2')],{'as':_0x3448('0x13b')});db[_0x3448('0xf1')]['belongsTo'](db[_0x3448('0xe7')],{'as':'List','foreignKey':_0x3448('0x15a')});db['WhatsappAccount'][_0x3448('0x112')](db[_0x3448('0x7e')],{'as':'mandatoryDispositionPause','foreignKey':_0x3448('0x15d')});db[_0x3448('0xf1')]['belongsToMany'](db[_0x3448('0x13')],{'as':_0x3448('0x14a'),'through':_0x3448('0x136')});db[_0x3448('0x1f2')]['belongsTo'](db['User'],{'onDelete':_0x3448('0x167')});db['WhatsappApplication'][_0x3448('0x112')](db[_0x3448('0xfa')],{'onDelete':'restrict'});db[_0x3448('0x1f2')]['belongsTo'](db[_0x3448('0xf1')],{'onDelete':_0x3448('0x167')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x147')],{'onDelete':_0x3448('0x167'),'foreignKey':_0x3448('0x148')});db[_0x3448('0x1f2')][_0x3448('0x112')](db[_0x3448('0x87')],{'onDelete':_0x3448('0x167'),'foreignKey':'TagId'});db[_0x3448('0x10f')][_0x3448('0x103')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x3448('0x101'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction']['belongsTo'](db[_0x3448('0xf1')],{'as':_0x3448('0x15f'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x3448('0x112')](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':'ContactId'});db[_0x3448('0x10f')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x160'),'foreignKey':_0x3448('0x102')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':_0x3448('0x1a5'),'as':_0x3448('0x172')});db[_0x3448('0x10f')][_0x3448('0x115')](db[_0x3448('0x87')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x3448('0x10f')]['belongsToMany'](db['User'],{'as':_0x3448('0x179'),'through':_0x3448('0x1f3'),'foreignKey':_0x3448('0x1f4')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x13')],{'as':_0x3448('0x13')});db[_0x3448('0xf4')][_0x3448('0x112')](db[_0x3448('0x117')],{'onDelete':_0x3448('0x101'),'as':'Contact'});db['WhatsappMessage'][_0x3448('0x112')](db[_0x3448('0x10f')],{'onDelete':_0x3448('0x101'),'as':_0x3448('0x164'),'foreignKey':'WhatsappInteractionId'});db[_0x3448('0xf4')][_0x3448('0x112')](db['WhatsappAccount'],{'as':_0x3448('0x15f'),'foreignKey':_0x3448('0x1f1')});db[_0x3448('0xf6')]['belongsTo'](db[_0x3448('0xf1')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db['CmList'],{'as':_0x3448('0x159'),'foreignKey':_0x3448('0x15a')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x117')],{'as':_0x3448('0x163'),'foreignKey':_0x3448('0x153')});db['WhatsappQueueReport']['belongsTo'](db[_0x3448('0x10f')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xfa')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db[_0x3448('0xf6')][_0x3448('0x112')](db[_0x3448('0x13')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf4')],{});db['WhatsappTransferReport'][_0x3448('0x112')](db[_0x3448('0x10f')],{});db[_0x3448('0xf8')][_0x3448('0x112')](db['WhatsappAccount'],{'foreignKey':_0x3448('0x1f5'),'as':_0x3448('0x1e2')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xf1')],{'foreignKey':_0x3448('0x1f6'),'as':_0x3448('0x1e0')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0xfa')],{'foreignKey':_0x3448('0x1f7'),'as':_0x3448('0x1e4')});db[_0x3448('0xf8')][_0x3448('0x112')](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1dd'),'as':_0x3448('0x1d7')});db[_0x3448('0xf8')]['belongsTo'](db[_0x3448('0x13')],{'foreignKey':_0x3448('0x1d8'),'as':_0x3448('0x1d9')});db['WhatsappQueue'][_0x3448('0x115')](db[_0x3448('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0x3448('0xfa')][_0x3448('0x115')](db['Team'],{'through':_0x3448('0x1d2'),'as':_0x3448('0x14b')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf109=['user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sound','moh_has_sounds','Members','VoiceQueueId','HopperFinals','CmHopperHistory','HopperHistories','CmHopperBlack','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','Imap','Smtp','Answers','Interactions','List','ListId','Template','TemplateId','Teams','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','MailInteractionId','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','FaxAccountId','FaxApplication','Trunk','FaxInteractionId','Tags','fax_interaction_has_tags','Users','Interaction','Attachment','AttachmentId','team_has_fax_queues','Dispositions','SmsAccountId','SmsApplication','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','Hoppers','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','Fields','CustomReportId','MetricId','SalesforceAccount','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Field','VariableId','SugarcrmConfiguration','Configurations','FieldId','DeskAccount','int_desk_configuration_has_tags','Description','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','ServicenowField','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','FromId','ToId','SessionId','SmsQueueReport','ProjectId','team_has_mail_queues','OpenchannelQueues','TeamVoicePrefix','HopperBlacks','SquareProjectId','BlackLists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FaxTransferReport','FromUserId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','userProfileId','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','password','username','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','hasMany','VoiceRecording','Recordings','UserId','Extensions','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteraction','MailInteractions','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0xf109,0xce));var _0x9f10=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xf109[_0x4e7d25];return _0x526fe6;};'use strict';var config=require(_0x9f10('0x0'));var Sequelize=require(_0x9f10('0x1'));var _=require(_0x9f10('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0x9f10('0x3')](config[_0x9f10('0x1')],{'database':_0x9f10('0x4'),'username':_0x9f10('0x5'),'password':_0x9f10('0x6'),'options':{'host':_0x9f10('0x7'),'port':0xcea,'dialect':_0x9f10('0x8'),'dialectOptions':{'charset':_0x9f10('0x9')},'logging':![],'timezone':timezone[_0x9f10('0xa')](),'define':{'charset':_0x9f10('0xb'),'collate':_0x9f10('0xc')}}});config['sequelizeHistory']=_[_0x9f10('0x3')](config[_0x9f10('0xd')],{'database':_0x9f10('0x4'),'username':_0x9f10('0x5'),'password':_0x9f10('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9f10('0x8'),'dialectOptions':{'charset':_0x9f10('0x9')},'logging':![],'timezone':timezone[_0x9f10('0xa')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9f10('0x1')][_0x9f10('0xe')],config[_0x9f10('0x1')]['username'],config[_0x9f10('0x1')][_0x9f10('0xf')],config[_0x9f10('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9f10('0xd')][_0x9f10('0xe')],config['sequelizeHistory'][_0x9f10('0x10')],config[_0x9f10('0xd')]['password'],config['sequelizeHistory'][_0x9f10('0x11')])};db[_0x9f10('0x12')]=db['sequelize'][_0x9f10('0x13')]('../api/user/user.model');db[_0x9f10('0x14')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x15'));db[_0x9f10('0x16')]=db['sequelize'][_0x9f10('0x13')]('../api/voiceContext/voiceContext.model');db[_0x9f10('0x17')]=db['sequelize'][_0x9f10('0x13')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x18'));db[_0x9f10('0x19')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x1a'));db['VoiceRecording']=db[_0x9f10('0x1')]['import'](_0x9f10('0x1b'));db[_0x9f10('0x1c')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x1d'));db[_0x9f10('0x1e')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x1f'));db[_0x9f10('0x20')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x21'));db[_0x9f10('0x22')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize'][_0x9f10('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x9f10('0x23')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x24'));db[_0x9f10('0x25')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x26'));db[_0x9f10('0x27')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x28'));db['Trunk']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x29'));db[_0x9f10('0x2a')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x2b'));db[_0x9f10('0x2c')]=db['sequelize'][_0x9f10('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x9f10('0x2d')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x9f10('0x2e')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x2f'));db[_0x9f10('0x30')]=db['sequelize'][_0x9f10('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x9f10('0x31')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x32'));db[_0x9f10('0x33')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x34'));db[_0x9f10('0x35')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x36'));db[_0x9f10('0x37')]=db['sequelize'][_0x9f10('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x9f10('0x38')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x39'));db[_0x9f10('0x3a')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x3b'));db['MailAccount']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x3c'));db['MailQueue']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/mailQueue/mailQueue.model');db[_0x9f10('0x3d')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x3e'));db[_0x9f10('0x3f')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x40'));db[_0x9f10('0x41')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x42'));db[_0x9f10('0x43')]=db['sequelize']['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x9f10('0x44')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x45'));db[_0x9f10('0x46')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x47'));db[_0x9f10('0x48')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db['sequelize'][_0x9f10('0x13')]('../api/faxApplication/faxApplication.model');db[_0x9f10('0x49')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x4a'));db[_0x9f10('0x4b')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x4c'));db[_0x9f10('0x4d')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x4e'));db[_0x9f10('0x4f')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x50'));db[_0x9f10('0x51')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x52'));db['SmsApplication']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/smsApplication/smsApplication.model');db[_0x9f10('0x53')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x54'));db['SmsMessage']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x55'));db[_0x9f10('0x56')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/smsQueue/smsQueue.model');db[_0x9f10('0x57')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x58'));db[_0x9f10('0x59')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x5a'));db[_0x9f10('0x5b')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x5c'));db[_0x9f10('0x5d')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/openchannelMessage/openchannelMessage.model');db[_0x9f10('0x5e')]=db['sequelize'][_0x9f10('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x9f10('0x5f')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x60'));db[_0x9f10('0x61')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x62'));db[_0x9f10('0x63')]=db[_0x9f10('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0x9f10('0x64')]=db[_0x9f10('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x9f10('0x65')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/chatMessage/chatMessage.model');db[_0x9f10('0x66')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x9f10('0x67')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/chatQueue/chatQueue.model');db[_0x9f10('0x68')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x69'));db[_0x9f10('0x6a')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x6b'));db['CmCompany']=db[_0x9f10('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x9f10('0x6c')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x6d'));db[_0x9f10('0x6e')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x6f'));db[_0x9f10('0x70')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x71'));db['CmHopperHistory']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x9f10('0x72')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x73'));db[_0x9f10('0x74')]=db['sequelize'][_0x9f10('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x9f10('0x75')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x76'));db[_0x9f10('0x77')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x78'));db[_0x9f10('0x79')]=db['sequelize']['import'](_0x9f10('0x7a'));db[_0x9f10('0x7b')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x7c'));db[_0x9f10('0x7d')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x7e'));db[_0x9f10('0x7f')]=db['sequelize'][_0x9f10('0x13')]('../api/interval/interval.model');db[_0x9f10('0x80')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x81'));db['Cdr']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x82'));db['VoiceQueuesLog']=db[_0x9f10('0x1')]['import'](_0x9f10('0x83'));db[_0x9f10('0x84')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x85'));db['Sound']=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x86'));db[_0x9f10('0x87')]=db['sequelize'][_0x9f10('0x13')]('../api/tag/tag.model');db['Template']=db[_0x9f10('0x1')]['import']('../api/template/template.model');db[_0x9f10('0x88')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x89'));db[_0x9f10('0x8a')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x8b'));db['Integration']=db[_0x9f10('0x1')]['import']('../api/integration/integration.model');db[_0x9f10('0x8c')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x8d'));db[_0x9f10('0x8e')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x9f10('0x8f')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x90'));db[_0x9f10('0x91')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x92'));db[_0x9f10('0x93')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0x94'));db[_0x9f10('0x95')]=db[_0x9f10('0x1')]['import'](_0x9f10('0x96'));db[_0x9f10('0x97')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x98'));db[_0x9f10('0x99')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x9a'));db[_0x9f10('0x9b')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x9c'));db[_0x9f10('0x9d')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0x9e'));db['SugarcrmConfiguration']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x9f10('0x9f')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xa0'));db['DeskAccount']=db[_0x9f10('0x1')]['import'](_0x9f10('0xa1'));db[_0x9f10('0xa2')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xa3'));db[_0x9f10('0xa4')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xa5'));db[_0x9f10('0xa6')]=db[_0x9f10('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/intZohoField/intZohoField.model');db[_0x9f10('0xa7')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xa8'));db[_0x9f10('0xa9')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xaa'));db[_0x9f10('0xab')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xac'));db[_0x9f10('0xad')]=db['sequelize'][_0x9f10('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x9f10('0xae')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xaf'));db[_0x9f10('0xb0')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xb1'));db[_0x9f10('0xb2')]=db['sequelize']['import'](_0x9f10('0xb3'));db[_0x9f10('0xb4')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xb5'));db['ServicenowAccount']=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xb6'));db['ServicenowConfiguration']=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xb7'));db['ServicenowField']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xb8'));db[_0x9f10('0xb9')]=db[_0x9f10('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xba'));db['Dynamics365Field']=db[_0x9f10('0x1')]['import'](_0x9f10('0xbb'));db['FreshsalesAccount']=db['sequelize']['import'](_0x9f10('0xbc'));db[_0x9f10('0xbd')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xbe'));db[_0x9f10('0xbf')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x9f10('0xc0')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/integration/integration.model');db[_0x9f10('0xc1')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xc2'));db[_0x9f10('0xc3')]=db['sequelize'][_0x9f10('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0x9f10('0xc4')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xc5'));db[_0x9f10('0xc6')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x9f10('0xc7')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xc8'));db['JscriptySessionReport']=db['sequelize'][_0x9f10('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xc9'));db['SquareReport']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xca'));db[_0x9f10('0xcb')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xcc'));db[_0x9f10('0xcd')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize']['import'](_0x9f10('0xce'));db[_0x9f10('0xcf')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xd0'));db['SquareProject']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/squareProject/squareProject.model');db[_0x9f10('0xd1')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xd2'));db[_0x9f10('0xd3')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xd4'));db[_0x9f10('0xd5')]=db['sequelize']['import'](_0x9f10('0xd6'));db[_0x9f10('0xd7')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/license/license.model');db[_0x9f10('0xd8')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xd9'));db[_0x9f10('0xda')]=db[_0x9f10('0x1')]['import']('../api/migration/migration.model');db['Attachment']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xdb'));db[_0x9f10('0xdc')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xdd'));db[_0x9f10('0xde')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xdf'));db[_0x9f10('0xe0')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xe1'));db['FaxTransferReport']=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x9f10('0xe2')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xe3'));db[_0x9f10('0xe4')]=db['sequelize'][_0x9f10('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x9f10('0xe5')]=db['sequelize']['import'](_0x9f10('0xe6'));db[_0x9f10('0xe7')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xe8'));db[_0x9f10('0xe9')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xea'));db[_0x9f10('0xeb')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xec'));db[_0x9f10('0xed')]=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xee'));db[_0x9f10('0xef')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xf0'));db['WhatsappAccount']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xf1'));db['WhatsappApplication']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xf2'));db[_0x9f10('0xf3')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x9f10('0xf4')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xf5'));db[_0x9f10('0xf6')]=db[_0x9f10('0x1')][_0x9f10('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db[_0x9f10('0x1')]['import'](_0x9f10('0xf7'));db[_0x9f10('0xf8')]=db['sequelize'][_0x9f10('0x13')](_0x9f10('0xf9'));db[_0x9f10('0xfa')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xfb'));db[_0x9f10('0xfc')]=db['sequelize'][_0x9f10('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x9f10('0x1')][_0x9f10('0x13')](_0x9f10('0xfd'));db[_0x9f10('0xfe')]=db[_0x9f10('0x1')]['import'](_0x9f10('0xff'));db['User'][_0x9f10('0x100')](db[_0x9f10('0x1e')],{'as':'VoiceMail','onDelete':_0x9f10('0x101'),'foreignKey':'UserId'});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x103')],{'as':_0x9f10('0x104'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x2c')],{'as':'VoiceQueuesRt','foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x17')],{'as':_0x9f10('0x106'),'onDelete':_0x9f10('0x101'),'hooks':!![]});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x70')],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0x9f10('0x102')](db['CmHopperHistory'],{'as':_0x9f10('0x107'),'foreignKey':_0x9f10('0x105')});db['User'][_0x9f10('0x102')](db[_0x9f10('0x72')],{'as':_0x9f10('0x72'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x5b')],{'as':_0x9f10('0x108'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db['ChatInteraction'],{'as':_0x9f10('0x109'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db['SmsInteraction'],{'as':_0x9f10('0x10a'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x49')],{'as':'FaxInteractions','foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0x10b')],{'as':_0x9f10('0x10c'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')]['hasMany'](db[_0x9f10('0xf3')],{'as':'WhatsappInteractions','foreignKey':_0x9f10('0x105')});db[_0x9f10('0x12')][_0x9f10('0x102')](db[_0x9f10('0xef')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x9f10('0x12')][_0x9f10('0x10d')](db['UserProfile'],{'as':_0x9f10('0xe9'),'foreignKey':'userProfileId'});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x68')],{'as':_0x9f10('0x10f'),'through':_0x9f10('0x110')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x111'),'through':_0x9f10('0x112')});db['User']['belongsToMany'](db['CmList'],{'as':_0x9f10('0x113'),'through':_0x9f10('0x114')});db[_0x9f10('0x12')]['belongsToMany'](db[_0x9f10('0xd5')],{'through':_0x9f10('0x115')});db['User'][_0x9f10('0x10e')](db[_0x9f10('0x10b')],{'as':_0x9f10('0x10c'),'through':_0x9f10('0x116')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x64')],{'as':_0x9f10('0x109'),'through':_0x9f10('0x117')});db['User'][_0x9f10('0x10e')](db[_0x9f10('0x49')],{'as':_0x9f10('0x118'),'through':'user_has_fax_interactions'});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x53')],{'as':_0x9f10('0x10a'),'through':_0x9f10('0x119')});db[_0x9f10('0x12')]['belongsToMany'](db[_0x9f10('0x5b')],{'as':_0x9f10('0x108'),'through':'user_has_openchannel_interactions'});db[_0x9f10('0x12')]['belongsToMany'](db[_0x9f10('0xf3')],{'as':_0x9f10('0x11a'),'through':_0x9f10('0x11b')});db['User']['belongsToMany'](db[_0x9f10('0x19')],{'as':_0x9f10('0x11c'),'through':_0x9f10('0x2d'),'required':![]});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0xe7')],{'as':_0x9f10('0x11d'),'through':_0x9f10('0xfe'),'required':![]});db[_0x9f10('0x12')]['belongsToMany'](db[_0x9f10('0x11e')],{'as':_0x9f10('0x11f'),'through':_0x9f10('0x30'),'required':![]});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x67')],{'as':_0x9f10('0x120'),'through':_0x9f10('0x2e'),'required':![],'hooks':!![]});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x4d')],{'as':_0x9f10('0x121'),'through':'UserFaxQueue','required':![]});db[_0x9f10('0x12')]['belongsToMany'](db['SmsQueue'],{'as':_0x9f10('0x122'),'through':_0x9f10('0x33'),'required':![]});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x5e')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0xf8')],{'as':_0x9f10('0x123'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x9f10('0x10e')](db[_0x9f10('0xe5')],{'through':_0x9f10('0x114')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x5f')],{'as':'ChatWebsites','through':_0x9f10('0x124')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x48')],{'as':'FaxAccounts','through':_0x9f10('0x125')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db[_0x9f10('0x126')],{'as':_0x9f10('0x127'),'through':_0x9f10('0x128')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db['OpenchannelAccount'],{'as':_0x9f10('0x129'),'through':_0x9f10('0x12a')});db[_0x9f10('0x12')][_0x9f10('0x10e')](db['SmsAccount'],{'as':_0x9f10('0x12b'),'through':_0x9f10('0x12c')});db[_0x9f10('0x12')]['belongsToMany'](db[_0x9f10('0x12d')],{'as':_0x9f10('0x12e'),'through':_0x9f10('0x12f')});db['User'][_0x9f10('0x10e')](db[_0x9f10('0x130')],{'as':'SquareProjects','through':'user_has_square_projects'});db['VoiceChanSpy'][_0x9f10('0x102')](db[_0x9f10('0x17')],{'as':_0x9f10('0x131'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x132')});db['VoiceContext'][_0x9f10('0x102')](db['VoiceExtension'],{'onDelete':_0x9f10('0x101')});db[_0x9f10('0x17')]['hasMany'](db[_0x9f10('0x17')],{'as':_0x9f10('0x133'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x134')][_0x9f10('0x10e')](db[_0x9f10('0x135')],{'as':'Sounds','through':_0x9f10('0x136')});db[_0x9f10('0x19')][_0x9f10('0x102')](db[_0x9f10('0x2c')],{'as':_0x9f10('0x137'),'foreignKey':_0x9f10('0x138')});db[_0x9f10('0x19')][_0x9f10('0x102')](db[_0x9f10('0x6e')],{'as':'Hoppers','foreignKey':_0x9f10('0x138')});db[_0x9f10('0x19')]['hasMany'](db[_0x9f10('0x70')],{'as':_0x9f10('0x139'),'foreignKey':_0x9f10('0x138')});db['VoiceQueue'][_0x9f10('0x102')](db[_0x9f10('0x13a')],{'as':_0x9f10('0x13b'),'foreignKey':_0x9f10('0x138')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0x9f10('0x72'),'foreignKey':_0x9f10('0x138')});db['VoiceQueue']['hasMany'](db[_0x9f10('0x13c')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x9f10('0x19')][_0x9f10('0x102')](db[_0x9f10('0x13d')],{'as':_0x9f10('0x13e'),'foreignKey':_0x9f10('0x138')});db['VoiceQueue'][_0x9f10('0x10d')](db['Trunk'],{'as':'Trunk','foreignKey':_0x9f10('0x13f')});db[_0x9f10('0x19')]['belongsTo'](db['Trunk'],{'as':_0x9f10('0x140'),'foreignKey':_0x9f10('0x141')});db[_0x9f10('0x19')]['belongsTo'](db['Interval'],{'as':_0x9f10('0x7f'),'foreignKey':_0x9f10('0x142')});db[_0x9f10('0x19')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':_0x9f10('0x143'),'foreignKey':_0x9f10('0x144')});db['VoiceQueue'][_0x9f10('0x10e')](db[_0x9f10('0xe5')],{'as':'Lists','through':_0x9f10('0x145')});db[_0x9f10('0x19')]['belongsToMany'](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x2d')});db[_0x9f10('0x19')][_0x9f10('0x10e')](db['Team'],{'as':'Teams','through':_0x9f10('0xfc')});db[_0x9f10('0x19')][_0x9f10('0x10e')](db['CmList'],{'as':'BlackLists','through':_0x9f10('0x147')});db[_0x9f10('0x103')]['belongsTo'](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x9f10('0x1c')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':_0x9f10('0x12'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x1e')]['hasMany'](db[_0x9f10('0x20')],{'as':_0x9f10('0x148'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x149'),'sourceKey':_0x9f10('0x14a')});db[_0x9f10('0x20')][_0x9f10('0x10d')](db[_0x9f10('0x1e')],{'foreignKey':_0x9f10('0x149'),'targetKey':_0x9f10('0x14a')});db[_0x9f10('0x22')][_0x9f10('0x102')](db[_0x9f10('0x25')],{'as':_0x9f10('0x14b'),'foreignKey':_0x9f10('0x14c'),'constraints':![]});db[_0x9f10('0x22')][_0x9f10('0x102')](db['VoiceAgentReport'],{'as':_0x9f10('0x14d'),'foreignKey':_0x9f10('0x14c'),'constraints':![]});db[_0x9f10('0x22')][_0x9f10('0x10d')](db['User'],{'as':_0x9f10('0x12'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x22')]['belongsTo'](db[_0x9f10('0x6c')],{'as':'Contact','foreignKey':_0x9f10('0x14e')});db['MailServerIn']['belongsTo'](db[_0x9f10('0x126')],{'as':'MailAccount','foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x3a')][_0x9f10('0x10d')](db[_0x9f10('0x126')],{'as':'MailAccount','foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x126')][_0x9f10('0x100')](db['MailServerIn'],{'as':_0x9f10('0x150'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x126')][_0x9f10('0x100')](db[_0x9f10('0x3a')],{'as':_0x9f10('0x151'),'onDelete':_0x9f10('0x101')});db['MailAccount']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0x9f10('0x14f'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x126')][_0x9f10('0x102')](db[_0x9f10('0x79')],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x126')][_0x9f10('0x102')](db[_0x9f10('0x3f')],{'as':_0x9f10('0x148'),'foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x126')][_0x9f10('0x102')](db['MailInteraction'],{'as':_0x9f10('0x153')});db[_0x9f10('0x126')][_0x9f10('0x102')](db[_0x9f10('0x41')],{'as':_0x9f10('0x133')});db['MailAccount'][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x126')][_0x9f10('0x10d')](db[_0x9f10('0x156')],{'as':_0x9f10('0x156'),'foreignKey':_0x9f10('0x157')});db[_0x9f10('0x126')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':_0x9f10('0x143'),'foreignKey':_0x9f10('0x144')});db[_0x9f10('0x126')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x128')});db['MailQueue'][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':'UserMailQueue'});db[_0x9f10('0x11e')][_0x9f10('0x10e')](db[_0x9f10('0xd5')],{'through':'team_has_mail_queues','as':_0x9f10('0x158')});db[_0x9f10('0x10b')][_0x9f10('0x102')](db[_0x9f10('0x3f')],{'as':'Messages','onDelete':_0x9f10('0x101'),'foreignKey':'MailInteractionId'});db[_0x9f10('0x10b')][_0x9f10('0x10d')](db[_0x9f10('0x126')],{'as':_0x9f10('0x159'),'foreignKey':'MailAccountId'});db[_0x9f10('0x10b')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x10b')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':_0x9f10('0x15b'),'foreignKey':'UserId'});db['MailInteraction'][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x15c'),'as':'Tags'});db[_0x9f10('0x10b')]['belongsToMany'](db[_0x9f10('0x87')],{'through':_0x9f10('0x15c'),'as':_0x9f10('0x15d')});db['MailInteraction']['belongsToMany'](db[_0x9f10('0x12')],{'as':'Users','through':_0x9f10('0x116'),'foreignKey':_0x9f10('0x15e')});db['MailMessage'][_0x9f10('0x102')](db['Attachment'],{'as':'Attachments','onDelete':_0x9f10('0x101')});db[_0x9f10('0x3f')][_0x9f10('0x10d')](db['User'],{'as':_0x9f10('0x12')});db['MailMessage'][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'onDelete':_0x9f10('0x101'),'as':'Contact'});db[_0x9f10('0x3f')][_0x9f10('0x10d')](db[_0x9f10('0x10b')],{'as':'Interaction','foreignKey':_0x9f10('0x15e')});db[_0x9f10('0x3f')][_0x9f10('0x10d')](db[_0x9f10('0x126')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x3f')][_0x9f10('0x10d')](db['ChatWebsite'],{'as':_0x9f10('0x5f'),'foreignKey':_0x9f10('0x15f')});db['MailMessage']['belongsTo'](db['ChatOfflineMessage'],{'as':_0x9f10('0x66'),'foreignKey':_0x9f10('0x160')});db['MailApplication'][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x161')});db[_0x9f10('0x41')][_0x9f10('0x10d')](db[_0x9f10('0x11e')],{'onDelete':_0x9f10('0x161')});db['MailApplication'][_0x9f10('0x10d')](db[_0x9f10('0x126')],{'onDelete':_0x9f10('0x161')});db[_0x9f10('0x41')][_0x9f10('0x10d')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x9f10('0x142')});db[_0x9f10('0x41')]['belongsTo'](db[_0x9f10('0x87')],{'onDelete':_0x9f10('0x161'),'foreignKey':_0x9f10('0x162')});db[_0x9f10('0x43')][_0x9f10('0x10d')](db[_0x9f10('0x126')],{});db['MailQueueReport'][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db['MailQueueReport'][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x43')][_0x9f10('0x10d')](db[_0x9f10('0x10b')],{});db['MailQueueReport'][_0x9f10('0x10d')](db[_0x9f10('0x3f')],{});db[_0x9f10('0x43')][_0x9f10('0x10d')](db['User'],{});db[_0x9f10('0x43')]['belongsTo'](db['MailQueue'],{});db[_0x9f10('0x44')][_0x9f10('0x102')](db['DashboardItem'],{'as':'Items','onDelete':_0x9f10('0x101')});db['FaxAccount'][_0x9f10('0x102')](db[_0x9f10('0x7b')],{'as':'Dispositions','foreignKey':_0x9f10('0x163'),'onDelete':_0x9f10('0x101')});db['FaxAccount'][_0x9f10('0x102')](db['CannedAnswer'],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x163')});db[_0x9f10('0x48')][_0x9f10('0x102')](db[_0x9f10('0x49')],{'as':'Interactions'});db[_0x9f10('0x48')][_0x9f10('0x102')](db[_0x9f10('0x164')],{'as':_0x9f10('0x133')});db[_0x9f10('0x48')][_0x9f10('0x102')](db[_0x9f10('0x17')],{'as':'Exntensions','onDelete':_0x9f10('0x101')});db['FaxAccount']['hasMany'](db[_0x9f10('0x4b')],{'as':'Messages'});db[_0x9f10('0x48')]['belongsTo'](db[_0x9f10('0x165')],{'as':_0x9f10('0x165')});db[_0x9f10('0x48')][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':'List','foreignKey':_0x9f10('0x155')});db[_0x9f10('0x48')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x9f10('0x144')});db['FaxAccount'][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x125')});db['FaxApplication'][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x161')});db['FaxApplication'][_0x9f10('0x10d')](db[_0x9f10('0x4d')],{'onDelete':'restrict'});db[_0x9f10('0x164')][_0x9f10('0x10d')](db[_0x9f10('0x48')],{'onDelete':_0x9f10('0x161')});db[_0x9f10('0x164')]['belongsTo'](db[_0x9f10('0x87')],{'onDelete':'restrict','foreignKey':_0x9f10('0x162')});db['FaxInteraction']['hasMany'](db[_0x9f10('0x4b')],{'as':_0x9f10('0x148'),'onDelete':'cascade','foreignKey':_0x9f10('0x166')});db[_0x9f10('0x49')][_0x9f10('0x10d')](db[_0x9f10('0x48')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x163')});db[_0x9f10('0x49')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x49')]['belongsTo'](db[_0x9f10('0x12')],{'as':_0x9f10('0x15b'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x49')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':'fax_interaction_has_tags','as':_0x9f10('0x167')});db[_0x9f10('0x49')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x168'),'as':_0x9f10('0x15d')});db[_0x9f10('0x49')]['belongsToMany'](db[_0x9f10('0x12')],{'as':_0x9f10('0x169'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0x9f10('0x4b')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x101'),'as':'User'});db[_0x9f10('0x4b')][_0x9f10('0x10d')](db[_0x9f10('0x49')],{'as':_0x9f10('0x16a'),'foreignKey':_0x9f10('0x166')});db[_0x9f10('0x4b')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'onDelete':_0x9f10('0x101'),'as':'Contact'});db[_0x9f10('0x4b')]['belongsTo'](db[_0x9f10('0x16b')],{'as':_0x9f10('0x16b'),'foreignKey':_0x9f10('0x16c')});db['FaxMessage']['belongsTo'](db[_0x9f10('0x48')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x163')});db[_0x9f10('0x4d')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x31')});db['FaxQueue'][_0x9f10('0x10e')](db['Team'],{'through':_0x9f10('0x16d'),'as':_0x9f10('0x158')});db[_0x9f10('0x4f')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport']['belongsTo'](db['CmList'],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db['FaxQueueReport'][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':'Contact','foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x4f')][_0x9f10('0x10d')](db['FaxInteraction'],{});db[_0x9f10('0x4f')][_0x9f10('0x10d')](db['FaxMessage'],{});db[_0x9f10('0x4f')][_0x9f10('0x10d')](db['User'],{});db[_0x9f10('0x4f')][_0x9f10('0x10d')](db[_0x9f10('0x4d')],{});db['SmsAccount'][_0x9f10('0x102')](db['Disposition'],{'as':_0x9f10('0x16e'),'foreignKey':'SmsAccountId','onDelete':_0x9f10('0x101')});db[_0x9f10('0x51')]['hasMany'](db[_0x9f10('0x79')],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x16f')});db[_0x9f10('0x51')][_0x9f10('0x102')](db['SmsMessage'],{'as':_0x9f10('0x148'),'foreignKey':_0x9f10('0x16f')});db[_0x9f10('0x51')][_0x9f10('0x102')](db[_0x9f10('0x53')],{'as':'Interactions'});db['SmsAccount'][_0x9f10('0x102')](db[_0x9f10('0x170')],{'as':_0x9f10('0x133')});db[_0x9f10('0x51')]['belongsTo'](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x51')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':_0x9f10('0x143'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount']['belongsToMany'](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x12c')});db[_0x9f10('0x170')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x161')});db['SmsApplication']['belongsTo'](db[_0x9f10('0x56')],{'onDelete':'restrict'});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':_0x9f10('0x161')});db[_0x9f10('0x170')][_0x9f10('0x10d')](db[_0x9f10('0x7f')],{'onDelete':_0x9f10('0x161'),'foreignKey':'IntervalId'});db[_0x9f10('0x170')][_0x9f10('0x10d')](db['Tag'],{'onDelete':_0x9f10('0x161'),'foreignKey':_0x9f10('0x162')});db['SmsInteraction'][_0x9f10('0x102')](db[_0x9f10('0x171')],{'as':_0x9f10('0x148'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x172')});db['SmsInteraction'][_0x9f10('0x10d')](db[_0x9f10('0x51')],{'as':_0x9f10('0x159'),'foreignKey':'SmsAccountId'});db[_0x9f10('0x53')][_0x9f10('0x10d')](db['CmContact'],{'as':'Contact','foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x53')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':_0x9f10('0x15b'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x53')][_0x9f10('0x10e')](db['Tag'],{'through':_0x9f10('0x173'),'as':_0x9f10('0x167')});db['SmsInteraction'][_0x9f10('0x10e')](db['Tag'],{'through':_0x9f10('0x173'),'as':_0x9f10('0x15d')});db[_0x9f10('0x53')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x169'),'through':_0x9f10('0x119'),'foreignKey':'SmsInteractionId'});db[_0x9f10('0x171')][_0x9f10('0x10d')](db['User'],{'as':_0x9f10('0x12')});db[_0x9f10('0x171')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'onDelete':'cascade','as':_0x9f10('0x15a')});db['SmsMessage'][_0x9f10('0x10d')](db['SmsInteraction'],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x16a'),'foreignKey':_0x9f10('0x172')});db[_0x9f10('0x171')][_0x9f10('0x10d')](db[_0x9f10('0x51')],{'as':'Account','foreignKey':_0x9f10('0x16f')});db[_0x9f10('0x56')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x33'),'foreignKey':_0x9f10('0x174')});db[_0x9f10('0x56')][_0x9f10('0x10e')](db[_0x9f10('0xd5')],{'through':_0x9f10('0x175'),'as':_0x9f10('0x158')});db[_0x9f10('0x57')][_0x9f10('0x102')](db[_0x9f10('0x7b')],{'as':_0x9f10('0x16e'),'foreignKey':'OpenchannelAccountId','onDelete':_0x9f10('0x101')});db[_0x9f10('0x57')]['hasMany'](db[_0x9f10('0x79')],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x176')});db[_0x9f10('0x57')]['hasMany'](db[_0x9f10('0x5b')],{'as':_0x9f10('0x153'),'foreignKey':_0x9f10('0x176')});db[_0x9f10('0x57')][_0x9f10('0x102')](db[_0x9f10('0x5d')],{'as':_0x9f10('0x148'),'foreignKey':_0x9f10('0x176')});db[_0x9f10('0x57')][_0x9f10('0x102')](db[_0x9f10('0x59')],{'as':_0x9f10('0x133'),'foreignKey':_0x9f10('0x176')});db[_0x9f10('0x57')][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x57')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0x9f10('0x144')});db[_0x9f10('0x57')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x12a')});db[_0x9f10('0x59')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x161')});db['OpenchannelApplication']['belongsTo'](db[_0x9f10('0x5e')],{'onDelete':'restrict','foreignKey':_0x9f10('0x177')});db[_0x9f10('0x59')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x9f10('0x176')});db['OpenchannelApplication'][_0x9f10('0x10d')](db[_0x9f10('0x7f')],{'onDelete':_0x9f10('0x161'),'foreignKey':_0x9f10('0x142')});db[_0x9f10('0x59')][_0x9f10('0x10d')](db[_0x9f10('0x87')],{'onDelete':_0x9f10('0x161'),'foreignKey':'TagId'});db[_0x9f10('0x5b')]['hasMany'](db[_0x9f10('0x5d')],{'as':'Messages','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x178')});db[_0x9f10('0x5b')][_0x9f10('0x10d')](db[_0x9f10('0x57')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x176')});db['OpenchannelInteraction']['belongsTo'](db['CmContact'],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x5b')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':_0x9f10('0x15b'),'foreignKey':_0x9f10('0x105')});db[_0x9f10('0x5b')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x179'),'as':_0x9f10('0x167')});db['OpenchannelInteraction'][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x179'),'as':_0x9f10('0x15d')});db[_0x9f10('0x5b')][_0x9f10('0x10e')](db['User'],{'as':_0x9f10('0x169'),'through':'user_has_openchannel_interactions','foreignKey':_0x9f10('0x178')});db[_0x9f10('0x5d')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x12')});db[_0x9f10('0x5d')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x15a')});db[_0x9f10('0x5d')][_0x9f10('0x10d')](db[_0x9f10('0x5b')],{'onDelete':_0x9f10('0x101'),'as':'Interaction','foreignKey':_0x9f10('0x178')});db[_0x9f10('0x5d')]['belongsTo'](db[_0x9f10('0x16b')],{'as':_0x9f10('0x16b'),'foreignKey':_0x9f10('0x16c')});db['OpenchannelMessage'][_0x9f10('0x10d')](db['OpenchannelAccount'],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x176')});db['OpenchannelQueue'][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x9f10('0x5e')][_0x9f10('0x10e')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x9f10('0x158')});db[_0x9f10('0x5f')][_0x9f10('0x102')](db[_0x9f10('0x7b')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0x9f10('0x101')});db[_0x9f10('0x5f')]['hasMany'](db[_0x9f10('0x79')],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x15f')});db['ChatWebsite'][_0x9f10('0x102')](db[_0x9f10('0x6a')],{'as':_0x9f10('0x17a')});db[_0x9f10('0x5f')]['hasMany'](db['ChatInteraction'],{'as':'Interactions'});db[_0x9f10('0x5f')][_0x9f10('0x102')](db[_0x9f10('0x63')],{'as':'Applications'});db[_0x9f10('0x5f')][_0x9f10('0x102')](db[_0x9f10('0x65')],{'as':_0x9f10('0x148')});db[_0x9f10('0x5f')]['belongsTo'](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x5f')][_0x9f10('0x10d')](db['Interval'],{'as':_0x9f10('0x7f'),'foreignKey':_0x9f10('0x142')});db['ChatWebsite'][_0x9f10('0x10d')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x9f10('0x14f')});db[_0x9f10('0x5f')][_0x9f10('0x10d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x9f10('0x144')});db[_0x9f10('0x5f')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':'Agents','through':_0x9f10('0x124')});db[_0x9f10('0x61')]['belongsTo'](db[_0x9f10('0x57')],{});db[_0x9f10('0x61')][_0x9f10('0x10d')](db['CmList'],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x61')][_0x9f10('0x10d')](db['CmContact'],{'as':'Contact','foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x61')]['belongsTo'](db[_0x9f10('0x5b')],{});db[_0x9f10('0x61')]['belongsTo'](db[_0x9f10('0x5d')],{});db[_0x9f10('0x61')]['belongsTo'](db[_0x9f10('0x12')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x9f10('0x5e')],{});db[_0x9f10('0x63')][_0x9f10('0x10d')](db['User'],{'as':'Agent','foreignKey':_0x9f10('0x105'),'onDelete':'restrict'});db[_0x9f10('0x63')][_0x9f10('0x10d')](db[_0x9f10('0x67')],{'as':_0x9f10('0x17b'),'foreignKey':_0x9f10('0x17c'),'onDelete':_0x9f10('0x161')});db[_0x9f10('0x63')][_0x9f10('0x10d')](db[_0x9f10('0x5f')],{'as':_0x9f10('0x17d'),'foreignKey':_0x9f10('0x15f'),'onDelete':_0x9f10('0x161')});db[_0x9f10('0x63')][_0x9f10('0x10d')](db[_0x9f10('0x87')],{'onDelete':_0x9f10('0x161'),'foreignKey':_0x9f10('0x162')});db[_0x9f10('0x64')][_0x9f10('0x102')](db[_0x9f10('0x65')],{'as':'Messages','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x17e')});db[_0x9f10('0x64')][_0x9f10('0x10d')](db['ChatWebsite'],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x15f')});db['ChatInteraction'][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':'ContactId'});db[_0x9f10('0x64')][_0x9f10('0x10d')](db['User'],{'as':_0x9f10('0x15b'),'foreignKey':'UserId'});db[_0x9f10('0x64')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x17f'),'as':_0x9f10('0x167')});db[_0x9f10('0x64')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db['ChatInteraction']['belongsToMany'](db[_0x9f10('0x12')],{'as':'Users','through':_0x9f10('0x117'),'foreignKey':_0x9f10('0x17e')});db['ChatMessage'][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x12')});db[_0x9f10('0x65')]['belongsTo'](db[_0x9f10('0x6c')],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x65')]['belongsTo'](db['ChatInteraction'],{'onDelete':'cascade','as':_0x9f10('0x16a'),'foreignKey':_0x9f10('0x17e')});db[_0x9f10('0x65')][_0x9f10('0x10d')](db[_0x9f10('0x16b')],{'as':_0x9f10('0x16b'),'foreignKey':_0x9f10('0x16c')});db[_0x9f10('0x65')][_0x9f10('0x10d')](db['ChatWebsite'],{'as':_0x9f10('0x159'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage']['hasMany'](db[_0x9f10('0x16b')],{'as':_0x9f10('0x180'),'foreignKey':_0x9f10('0x160'),'onDelete':_0x9f10('0x101'),'hooks':!![]});db['ChatOfflineMessage'][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'onDelete':_0x9f10('0x101'),'as':'Contact','foreignKey':'ContactId'});db[_0x9f10('0x66')][_0x9f10('0x10d')](db[_0x9f10('0x5f')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x15f')});db['ChatQueue'][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0x2e'),'hooks':!![]});db[_0x9f10('0x67')]['belongsToMany'](db['Team'],{'through':_0x9f10('0x181'),'as':'Teams'});db[_0x9f10('0x68')]['hasMany'](db[_0x9f10('0xc4')],{'as':_0x9f10('0x148'),'foreignKey':_0x9f10('0x182'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x68')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':'Members','through':_0x9f10('0x110')});db[_0x9f10('0x6a')]['belongsTo'](db[_0x9f10('0x5f')],{'as':'Website','foreignKey':_0x9f10('0x15f')});db[_0x9f10('0x183')][_0x9f10('0x102')](db[_0x9f10('0x6c')],{'as':'Contacts','foreignKey':_0x9f10('0x184')});db[_0x9f10('0x6c')][_0x9f10('0x102')](db['CmHopper'],{'as':_0x9f10('0x185'),'foreignKey':'ContactId'});db[_0x9f10('0x6c')]['hasMany'](db[_0x9f10('0x70')],{'as':_0x9f10('0x139'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x6c')]['hasMany'](db['CmHopperHistory'],{'as':_0x9f10('0x13b'),'foreignKey':_0x9f10('0x14e')});db['CmContact'][_0x9f10('0x102')](db[_0x9f10('0x72')],{'as':_0x9f10('0x72'),'foreignKey':'ContactId'});db[_0x9f10('0x6c')][_0x9f10('0x102')](db[_0x9f10('0x13d')],{'as':_0x9f10('0x13e'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x6c')][_0x9f10('0x102')](db[_0x9f10('0x5b')],{'as':_0x9f10('0x108'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x9f10('0x102')](db[_0x9f10('0x64')],{'as':_0x9f10('0x109'),'foreignKey':'ContactId','onDelete':_0x9f10('0x161')});db['CmContact'][_0x9f10('0x102')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x9f10('0x14e'),'onDelete':_0x9f10('0x161')});db[_0x9f10('0x6c')][_0x9f10('0x102')](db[_0x9f10('0x49')],{'as':_0x9f10('0x118'),'foreignKey':_0x9f10('0x14e'),'onDelete':'restrict'});db[_0x9f10('0x6c')][_0x9f10('0x102')](db[_0x9f10('0x10b')],{'as':_0x9f10('0x10c'),'foreignKey':_0x9f10('0x14e'),'onDelete':_0x9f10('0x161')});db[_0x9f10('0x6c')][_0x9f10('0x10d')](db[_0x9f10('0x183')],{'as':_0x9f10('0x186'),'foreignKey':_0x9f10('0x184')});db[_0x9f10('0x6c')][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x6c')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x169'),'through':_0x9f10('0x112')});db['CmContact'][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'as':_0x9f10('0x167'),'through':'cm_contact_has_tags'});db[_0x9f10('0x6c')]['belongsToMany'](db[_0x9f10('0x87')],{'through':_0x9f10('0x187'),'as':_0x9f10('0x15d')});db[_0x9f10('0x6e')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x6e')]['belongsTo'](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x6e')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':_0x9f10('0x188'),'foreignKey':_0x9f10('0x105')});db['CmHopper'][_0x9f10('0x10d')](db[_0x9f10('0x19')],{'as':_0x9f10('0x17b'),'foreignKey':'VoiceQueueId','onDelete':_0x9f10('0x101')});db[_0x9f10('0x6e')]['belongsTo'](db[_0x9f10('0xd8')],{'as':_0x9f10('0xd8'),'foreignKey':_0x9f10('0x189'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x6e')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':'Owner','foreignKey':_0x9f10('0x18a')});db[_0x9f10('0x13c')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e'),'onDelete':_0x9f10('0x101')});db['CmHopperBlack'][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155'),'onDelete':_0x9f10('0x101')});db['CmHopperBlack']['belongsTo'](db[_0x9f10('0x19')],{'as':_0x9f10('0x17b'),'foreignKey':_0x9f10('0x138'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x13c')]['belongsTo'](db['Campaign'],{'as':_0x9f10('0xd8'),'foreignKey':_0x9f10('0x189'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x77')]['hasMany'](db['Condition'],{'as':{'plural':_0x9f10('0x18b'),'singular':_0x9f10('0x18c')},'foreignKey':_0x9f10('0x18d'),'onDelete':_0x9f10('0x101'),'hooks':!![]});db[_0x9f10('0x77')][_0x9f10('0x102')](db[_0x9f10('0x7d')],{'as':{'plural':_0x9f10('0x18e'),'singular':_0x9f10('0x18f')},'foreignKey':'AutomationAnyId','onDelete':_0x9f10('0x101'),'hooks':!![]});db['Automation'][_0x9f10('0x102')](db[_0x9f10('0x75')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x9f10('0x101'),'hooks':!![]});db[_0x9f10('0x7b')]['hasMany'](db[_0x9f10('0x7b')],{'as':_0x9f10('0x16e'),'foreignKey':_0x9f10('0x190'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x7f')][_0x9f10('0x102')](db[_0x9f10('0x7f')],{'as':_0x9f10('0x191'),'foreignKey':_0x9f10('0x142'),'onDelete':_0x9f10('0x101'),'hooks':!![],'required':![]});db[_0x9f10('0x7f')]['hasMany'](db[_0x9f10('0x17')],{'as':'Extensions','foreignKey':_0x9f10('0x142'),'onDelete':'restrict'});db['Interval'][_0x9f10('0x102')](db[_0x9f10('0x41')],{'as':_0x9f10('0x192'),'foreignKey':_0x9f10('0x142')});db['Interval'][_0x9f10('0x102')](db['ChatApplication'],{'as':_0x9f10('0x193'),'foreignKey':_0x9f10('0x142')});db[_0x9f10('0x7f')]['hasMany'](db['FaxApplication'],{'as':_0x9f10('0x194'),'foreignKey':_0x9f10('0x142')});db[_0x9f10('0x7f')]['hasMany'](db['SmsApplication'],{'as':_0x9f10('0x195'),'foreignKey':_0x9f10('0x142')});db[_0x9f10('0x84')][_0x9f10('0x10d')](db[_0x9f10('0x126')],{});db['Schedule']['belongsTo'](db[_0x9f10('0x8f')],{'foreignKey':_0x9f10('0x196')});db[_0x9f10('0x84')][_0x9f10('0x10d')](db[_0x9f10('0x8e')],{'foreignKey':'CustomReportId'});db[_0x9f10('0x135')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x9f10('0x197'),'through':_0x9f10('0x136'),'onDelete':_0x9f10('0x161')});db['Tag'][_0x9f10('0x10e')](db[_0x9f10('0x6c')],{'through':'cm_contact_has_tags'});db[_0x9f10('0x87')]['belongsToMany'](db[_0x9f10('0x64')],{'through':'chat_interaction_has_tags'});db[_0x9f10('0x87')][_0x9f10('0x10e')](db['MailInteraction'],{'through':_0x9f10('0x15c')});db[_0x9f10('0x87')][_0x9f10('0x10e')](db['SmsInteraction'],{'through':_0x9f10('0x173')});db[_0x9f10('0x87')][_0x9f10('0x10e')](db[_0x9f10('0x49')],{'through':'fax_interaction_has_tags'});db[_0x9f10('0x87')]['belongsToMany'](db[_0x9f10('0x5b')],{'through':_0x9f10('0x179')});db[_0x9f10('0x87')]['belongsToMany'](db[_0x9f10('0xf3')],{'through':_0x9f10('0x198')});db[_0x9f10('0x88')][_0x9f10('0x102')](db['Condition'],{'as':{'plural':_0x9f10('0x199'),'singular':_0x9f10('0x19a')},'foreignKey':_0x9f10('0x19b'),'onDelete':_0x9f10('0x101'),'hooks':!![]});db[_0x9f10('0x88')][_0x9f10('0x102')](db[_0x9f10('0x7d')],{'as':{'plural':_0x9f10('0x19c'),'singular':_0x9f10('0x19d')},'foreignKey':_0x9f10('0x19e'),'onDelete':_0x9f10('0x101'),'hooks':!![]});db[_0x9f10('0x88')][_0x9f10('0x102')](db[_0x9f10('0x75')],{'as':_0x9f10('0x19f'),'foreignKey':'TriggerId','onDelete':_0x9f10('0x101'),'hooks':!![]});db['AnalyticCustomReport'][_0x9f10('0x102')](db[_0x9f10('0x95')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a1'),'hooks':!![]});db['AnalyticDefaultReport'][_0x9f10('0x102')](db[_0x9f10('0x95')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x196')});db['AnalyticMetric'][_0x9f10('0x102')](db[_0x9f10('0x95')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a2')});db['AnalyticFieldReport']['belongsTo'](db[_0x9f10('0x93')],{'foreignKey':_0x9f10('0x1a2')});db[_0x9f10('0x1a3')]['hasMany'](db[_0x9f10('0x99')],{'as':'Configurations','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x99')][_0x9f10('0x102')](db[_0x9f10('0x9b')],{'as':_0x9f10('0x1a5'),'onDelete':'cascade','foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x99')]['hasMany'](db[_0x9f10('0x9b')],{'as':_0x9f10('0x1a7'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a8')});db['SalesforceConfiguration'][_0x9f10('0x102')](db[_0x9f10('0x9b')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':'FieldId'});db[_0x9f10('0x99')][_0x9f10('0x10d')](db[_0x9f10('0x1a3')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x9f10('0x102')](db['SalesforceField'],{'as':_0x9f10('0x1a9'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x9b')]['hasMany'](db[_0x9f10('0x9b')],{'as':'Description','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0x9b')][_0x9f10('0x102')](db[_0x9f10('0x9b')],{'as':_0x9f10('0x1aa'),'foreignKey':'FieldId'});db[_0x9f10('0x9b')]['belongsTo'](db[_0x9f10('0x8a')],{'as':_0x9f10('0x8a'),'foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0x9d')][_0x9f10('0x102')](db[_0x9f10('0x1ac')],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1ac')][_0x9f10('0x102')](db[_0x9f10('0x9f')],{'as':_0x9f10('0x1a5'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x1ac')][_0x9f10('0x102')](db[_0x9f10('0x9f')],{'as':_0x9f10('0x1a7'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0x1ac')][_0x9f10('0x102')](db[_0x9f10('0x9f')],{'as':'Fields','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0x1ac')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x9f10('0x159'),'foreignKey':'AccountId'});db[_0x9f10('0x9f')][_0x9f10('0x102')](db[_0x9f10('0x9f')],{'as':_0x9f10('0x1a9'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0x9f10('0x102')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0x9f')][_0x9f10('0x102')](db['SugarcrmField'],{'as':_0x9f10('0x1aa'),'foreignKey':'FieldId'});db[_0x9f10('0x9f')][_0x9f10('0x10d')](db['Variable'],{'as':'Variable','foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0x1af')]['hasMany'](db[_0x9f10('0xa2')],{'as':_0x9f10('0x1ad'),'onDelete':'cascade','foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xa2')][_0x9f10('0x102')](db[_0x9f10('0xa4')],{'as':_0x9f10('0x1a5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9f10('0xa2')][_0x9f10('0x102')](db[_0x9f10('0xa4')],{'as':_0x9f10('0x1a7'),'onDelete':'cascade','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xa2')][_0x9f10('0x102')](db[_0x9f10('0xa4')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0xa2')][_0x9f10('0x10d')](db[_0x9f10('0x1af')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xa2')]['belongsToMany'](db[_0x9f10('0x87')],{'through':_0x9f10('0x1b0')});db[_0x9f10('0xa4')][_0x9f10('0x102')](db['DeskField'],{'as':'Subject','foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0xa4')][_0x9f10('0x102')](db[_0x9f10('0xa4')],{'as':_0x9f10('0x1b1'),'foreignKey':'DescriptionId'});db[_0x9f10('0xa4')][_0x9f10('0x102')](db[_0x9f10('0xa4')],{'as':_0x9f10('0x1aa'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0xa4')]['belongsTo'](db['Variable'],{'as':_0x9f10('0x8a'),'foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0xa6')][_0x9f10('0x102')](db[_0x9f10('0x1b2')],{'as':_0x9f10('0x1ad'),'onDelete':'cascade','foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1b2')]['hasMany'](db[_0x9f10('0x1b3')],{'as':'Subjects','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x1b2')][_0x9f10('0x102')](db[_0x9f10('0x1b3')],{'as':_0x9f10('0x1a7'),'onDelete':_0x9f10('0x101'),'foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0x9f10('0x102')](db[_0x9f10('0x1b3')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':'FieldId'});db[_0x9f10('0x1b2')][_0x9f10('0x10d')](db[_0x9f10('0xa6')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1b3')][_0x9f10('0x102')](db[_0x9f10('0x1b3')],{'as':_0x9f10('0x1a9'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x1b3')]['hasMany'](db[_0x9f10('0x1b3')],{'as':_0x9f10('0x1b1'),'foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0x1b3')][_0x9f10('0x102')](db[_0x9f10('0x1b3')],{'as':_0x9f10('0x1aa'),'foreignKey':'FieldId'});db[_0x9f10('0x1b3')][_0x9f10('0x10d')](db[_0x9f10('0x8a')],{'as':_0x9f10('0x8a'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0x9f10('0x102')](db[_0x9f10('0xa9')],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db['ZendeskConfiguration'][_0x9f10('0x102')](db[_0x9f10('0xab')],{'as':_0x9f10('0x1a5'),'foreignKey':'SubjectId'});db[_0x9f10('0xa9')][_0x9f10('0x102')](db[_0x9f10('0xab')],{'as':'Descriptions','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xa9')][_0x9f10('0x102')](db[_0x9f10('0xab')],{'as':_0x9f10('0x1a0'),'foreignKey':_0x9f10('0x1ae')});db['ZendeskConfiguration'][_0x9f10('0x10d')](db['ZendeskAccount'],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xa9')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x1b4')});db['ZendeskField'][_0x9f10('0x102')](db['ZendeskField'],{'as':_0x9f10('0x1a9'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0xab')][_0x9f10('0x102')](db[_0x9f10('0xab')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x9f10('0xab')]['hasMany'](db[_0x9f10('0xab')],{'as':_0x9f10('0x1aa'),'foreignKey':'FieldId'});db['ZendeskField'][_0x9f10('0x10d')](db['Variable'],{'as':_0x9f10('0x8a'),'foreignKey':'VariableId'});db[_0x9f10('0xad')]['hasMany'](db[_0x9f10('0x1b5')],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':'AccountId'});db[_0x9f10('0x1b5')][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':'Subjects','onDelete':_0x9f10('0x101'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':_0x9f10('0x1a7'),'onDelete':_0x9f10('0x101'),'foreignKey':'DescriptionId'});db[_0x9f10('0x1b5')][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':'Fields','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0x1b5')][_0x9f10('0x10d')](db[_0x9f10('0xad')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1b5')][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x1b6')});db[_0x9f10('0xae')][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':_0x9f10('0x1a9'),'foreignKey':'SubjectId'});db[_0x9f10('0xae')][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':'Description','foreignKey':_0x9f10('0x1a8')});db['FreshdeskField'][_0x9f10('0x102')](db[_0x9f10('0xae')],{'as':_0x9f10('0x1aa'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0xae')][_0x9f10('0x10d')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x9f10('0xb0')][_0x9f10('0x102')](db[_0x9f10('0xb2')],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xb2')][_0x9f10('0x102')](db[_0x9f10('0xb4')],{'as':_0x9f10('0x1a5'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0xb2')][_0x9f10('0x102')](db[_0x9f10('0xb4')],{'as':_0x9f10('0x1a7'),'foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xb2')][_0x9f10('0x102')](db[_0x9f10('0xb4')],{'as':_0x9f10('0x1a0'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x9f10('0x10d')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xb4')]['hasMany'](db[_0x9f10('0xb4')],{'as':_0x9f10('0x1a9'),'foreignKey':_0x9f10('0x1a6')});db['VtigerField'][_0x9f10('0x102')](db[_0x9f10('0xb4')],{'as':'Description','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xb4')][_0x9f10('0x102')](db[_0x9f10('0xb4')],{'as':_0x9f10('0x1aa'),'foreignKey':'FieldId'});db[_0x9f10('0xb4')][_0x9f10('0x10d')](db[_0x9f10('0x8a')],{'as':'Variable','foreignKey':'VariableId'});db[_0x9f10('0x1b7')][_0x9f10('0x102')](db[_0x9f10('0x1b8')],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1b8')][_0x9f10('0x102')](db[_0x9f10('0x1b9')],{'as':_0x9f10('0x1a5'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0x9f10('0x1b9')],{'as':'Descriptions','foreignKey':_0x9f10('0x1a8')});db['ServicenowConfiguration'][_0x9f10('0x102')](db[_0x9f10('0x1b9')],{'as':'Fields','foreignKey':_0x9f10('0x1ae')});db['ServicenowConfiguration'][_0x9f10('0x10d')](db['ServicenowAccount'],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db['ServicenowField']['hasMany'](db[_0x9f10('0x1b9')],{'as':_0x9f10('0x1a9'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x1b9')][_0x9f10('0x102')](db[_0x9f10('0x1b9')],{'as':_0x9f10('0x1b1'),'foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0x1b9')][_0x9f10('0x102')](db[_0x9f10('0x1b9')],{'as':_0x9f10('0x1aa'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0x1b9')]['belongsTo'](db[_0x9f10('0x8a')],{'as':'Variable','foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0xb9')][_0x9f10('0x102')](db['Dynamics365Configuration'],{'as':_0x9f10('0x1ad'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a4')});db['Dynamics365Configuration'][_0x9f10('0x102')](db['Dynamics365Field'],{'as':_0x9f10('0x1a5'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0x1ba')][_0x9f10('0x102')](db[_0x9f10('0x1bb')],{'as':'Descriptions','onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1a8')});db['Dynamics365Configuration'][_0x9f10('0x102')](db[_0x9f10('0x1bb')],{'as':_0x9f10('0x1a0'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0x1ba')][_0x9f10('0x10d')](db[_0x9f10('0xb9')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0x1bb')]['hasMany'](db[_0x9f10('0x1bb')],{'as':_0x9f10('0x1a9'),'foreignKey':'SubjectId'});db[_0x9f10('0x1bb')][_0x9f10('0x102')](db[_0x9f10('0x1bb')],{'as':_0x9f10('0x1b1'),'foreignKey':_0x9f10('0x1a8')});db['Dynamics365Field']['hasMany'](db[_0x9f10('0x1bb')],{'as':_0x9f10('0x1aa'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0x1bb')]['belongsTo'](db[_0x9f10('0x8a')],{'as':'Variable','foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0x1bc')][_0x9f10('0x102')](db['FreshsalesConfiguration'],{'as':'Configurations','onDelete':_0x9f10('0x101'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0x9f10('0x102')](db[_0x9f10('0xbf')],{'as':_0x9f10('0x1a5'),'foreignKey':_0x9f10('0x1a6')});db[_0x9f10('0xbd')][_0x9f10('0x102')](db[_0x9f10('0xbf')],{'as':_0x9f10('0x1a7'),'foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xbd')][_0x9f10('0x102')](db['FreshsalesField'],{'as':_0x9f10('0x1a0'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0xbd')][_0x9f10('0x10d')](db[_0x9f10('0x1bc')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1a4')});db[_0x9f10('0xbf')][_0x9f10('0x102')](db[_0x9f10('0xbf')],{'as':_0x9f10('0x1a9'),'foreignKey':'SubjectId'});db[_0x9f10('0xbf')][_0x9f10('0x102')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x9f10('0x1a8')});db[_0x9f10('0xbf')][_0x9f10('0x102')](db['FreshsalesField'],{'as':_0x9f10('0x1aa'),'foreignKey':_0x9f10('0x1ae')});db[_0x9f10('0xbf')][_0x9f10('0x10d')](db[_0x9f10('0x8a')],{'as':_0x9f10('0x8a'),'foreignKey':_0x9f10('0x1ab')});db[_0x9f10('0xc3')][_0x9f10('0x10d')](db['ChatWebsite'],{});db[_0x9f10('0xc3')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x9f10('0x155')});db[_0x9f10('0xc3')][_0x9f10('0x10d')](db['CmContact'],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0xc3')][_0x9f10('0x10d')](db[_0x9f10('0x64')],{});db[_0x9f10('0xc3')][_0x9f10('0x10d')](db[_0x9f10('0x65')],{});db[_0x9f10('0xc3')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{});db['ChatQueueReport'][_0x9f10('0x10d')](db[_0x9f10('0x67')],{});db[_0x9f10('0xc4')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1bd')});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1be')});db[_0x9f10('0x13d')][_0x9f10('0x102')](db['JscriptyQuestionReport'],{'foreignKey':_0x9f10('0x1bf'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x13d')][_0x9f10('0x102')](db[_0x9f10('0xc6')],{'foreignKey':_0x9f10('0x1bf'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x1c0')][_0x9f10('0x10d')](db[_0x9f10('0x51')],{});db[_0x9f10('0x1c0')][_0x9f10('0x10d')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':'ListId'});db[_0x9f10('0x1c0')]['belongsTo'](db[_0x9f10('0x6c')],{'as':'Contact','foreignKey':_0x9f10('0x14e')});db[_0x9f10('0x1c0')][_0x9f10('0x10d')](db[_0x9f10('0x53')],{});db['SmsQueueReport'][_0x9f10('0x10d')](db['SmsMessage'],{});db[_0x9f10('0x1c0')]['belongsTo'](db['User'],{});db[_0x9f10('0x1c0')][_0x9f10('0x10d')](db[_0x9f10('0x56')],{});db[_0x9f10('0xcd')]['hasMany'](db[_0x9f10('0x13d')],{'foreignKey':_0x9f10('0x1c1')});db[_0x9f10('0xcd')][_0x9f10('0x102')](db[_0x9f10('0xc7')],{'foreignKey':_0x9f10('0x1c1')});db[_0x9f10('0xcd')][_0x9f10('0x102')](db[_0x9f10('0xc6')],{'foreignKey':_0x9f10('0x1c1')});db[_0x9f10('0x130')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':'Users','through':'user_has_square_projects'});db[_0x9f10('0xd5')]['belongsToMany'](db[_0x9f10('0x12')],{'as':'Agents','through':_0x9f10('0x115')});db['Team']['belongsToMany'](db[_0x9f10('0x19')],{'through':_0x9f10('0xfc'),'as':_0x9f10('0x11c')});db['Team'][_0x9f10('0x10e')](db['MailQueue'],{'through':_0x9f10('0x1c2'),'as':_0x9f10('0x11f')});db[_0x9f10('0xd5')][_0x9f10('0x10e')](db[_0x9f10('0x67')],{'through':_0x9f10('0x181'),'as':'ChatQueues'});db['Team'][_0x9f10('0x10e')](db['FaxQueue'],{'through':_0x9f10('0x16d'),'as':_0x9f10('0x121')});db['Team']['belongsToMany'](db[_0x9f10('0x56')],{'through':_0x9f10('0x175'),'as':_0x9f10('0x122')});db[_0x9f10('0xd5')]['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x9f10('0x1c3')});db[_0x9f10('0xd5')][_0x9f10('0x10e')](db[_0x9f10('0xf8')],{'through':'team_has_whatsapp_queues','as':_0x9f10('0x123')});db[_0x9f10('0xd5')][_0x9f10('0x10e')](db['VoicePrefix'],{'through':_0x9f10('0x1c4'),'as':_0x9f10('0x11d')});db[_0x9f10('0xd8')][_0x9f10('0x102')](db[_0x9f10('0x6e')],{'as':_0x9f10('0x185'),'foreignKey':_0x9f10('0x189')});db['Campaign'][_0x9f10('0x102')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x9f10('0x189')});db['Campaign']['hasMany'](db['CmHopperHistory'],{'as':_0x9f10('0x13b'),'foreignKey':_0x9f10('0x189')});db[_0x9f10('0xd8')][_0x9f10('0x102')](db[_0x9f10('0x13c')],{'as':_0x9f10('0x1c5'),'foreignKey':_0x9f10('0x189')});db[_0x9f10('0xd8')][_0x9f10('0x10d')](db[_0x9f10('0x165')],{'as':'Trunk','foreignKey':_0x9f10('0x13f')});db[_0x9f10('0xd8')][_0x9f10('0x10d')](db[_0x9f10('0x165')],{'as':_0x9f10('0x140'),'foreignKey':'TrunkBackupId'});db[_0x9f10('0xd8')]['belongsTo'](db[_0x9f10('0x7f')],{'as':'Interval','foreignKey':_0x9f10('0x142')});db[_0x9f10('0xd8')]['belongsTo'](db[_0x9f10('0x130')],{'as':_0x9f10('0x130'),'foreignKey':_0x9f10('0x1c6')});db[_0x9f10('0xd8')][_0x9f10('0x10e')](db['CmList'],{'as':_0x9f10('0x113'),'through':'campaigns_has_cm_lists'});db[_0x9f10('0xd8')][_0x9f10('0x10e')](db[_0x9f10('0xe5')],{'as':_0x9f10('0x1c7'),'through':'campaigns_has_cm_blacklists'});db[_0x9f10('0x16b')][_0x9f10('0x10d')](db[_0x9f10('0x66')],{'as':_0x9f10('0x66'),'foreignKey':_0x9f10('0x160')});db[_0x9f10('0xde')][_0x9f10('0x10d')](db[_0x9f10('0x3f')],{});db['MailTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0x10b')],{});db['MailTransferReport']['belongsTo'](db[_0x9f10('0x126')],{'foreignKey':_0x9f10('0x1c8'),'as':_0x9f10('0x1c9')});db['MailTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':'FromUserId','as':_0x9f10('0x1ca')});db[_0x9f10('0xde')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':_0x9f10('0x1cb'),'as':_0x9f10('0x1cc')});db[_0x9f10('0xde')][_0x9f10('0x10d')](db['MailQueue'],{'foreignKey':_0x9f10('0x1cd'),'as':_0x9f10('0x1ce')});db['MailTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0x126')],{'foreignKey':_0x9f10('0x1cf'),'as':_0x9f10('0x1d0')});db[_0x9f10('0xe0')]['belongsTo'](db[_0x9f10('0x65')],{});db[_0x9f10('0xe0')][_0x9f10('0x10d')](db[_0x9f10('0x64')],{});db['ChatTransferReport'][_0x9f10('0x10d')](db['ChatWebsite'],{'foreignKey':_0x9f10('0x1d1'),'as':'FromAccount'});db['ChatTransferReport'][_0x9f10('0x10d')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9f10('0xe0')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':_0x9f10('0x1cb'),'as':_0x9f10('0x1cc')});db['ChatTransferReport'][_0x9f10('0x10d')](db['ChatQueue'],{'foreignKey':'ToChatQueueId','as':_0x9f10('0x1ce')});db[_0x9f10('0xe0')][_0x9f10('0x10d')](db['ChatWebsite'],{'foreignKey':_0x9f10('0x1d2'),'as':_0x9f10('0x1d0')});db[_0x9f10('0x1d3')][_0x9f10('0x10d')](db[_0x9f10('0x4b')],{});db[_0x9f10('0x1d3')][_0x9f10('0x10d')](db['FaxInteraction'],{});db[_0x9f10('0x1d3')]['belongsTo'](db[_0x9f10('0x48')],{'foreignKey':'FromFaxAccountId','as':_0x9f10('0x1c9')});db[_0x9f10('0x1d3')]['belongsTo'](db[_0x9f10('0x12')],{'foreignKey':'FromUserId','as':_0x9f10('0x1ca')});db[_0x9f10('0x1d3')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':_0x9f10('0x1cb'),'as':_0x9f10('0x1cc')});db[_0x9f10('0x1d3')][_0x9f10('0x10d')](db[_0x9f10('0x4d')],{'foreignKey':'ToFaxQueueId','as':_0x9f10('0x1ce')});db[_0x9f10('0x1d3')][_0x9f10('0x10d')](db[_0x9f10('0x48')],{'foreignKey':'ToFaxAccountId','as':_0x9f10('0x1d0')});db['OpenchannelTransferReport'][_0x9f10('0x10d')](db['OpenchannelMessage'],{});db[_0x9f10('0xe2')][_0x9f10('0x10d')](db[_0x9f10('0x5b')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x9f10('0x57')],{'foreignKey':'FromOpenchannelAccountId','as':_0x9f10('0x1c9')});db[_0x9f10('0xe2')]['belongsTo'](db['User'],{'foreignKey':_0x9f10('0x1d4'),'as':'FromAgent'});db[_0x9f10('0xe2')]['belongsTo'](db['User'],{'foreignKey':_0x9f10('0x1cb'),'as':_0x9f10('0x1cc')});db[_0x9f10('0xe2')]['belongsTo'](db[_0x9f10('0x5e')],{'foreignKey':_0x9f10('0x1d5'),'as':_0x9f10('0x1ce')});db[_0x9f10('0xe2')][_0x9f10('0x10d')](db['OpenchannelAccount'],{'foreignKey':_0x9f10('0x1d6'),'as':'ToAccount'});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x171')],{});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x53')],{});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x51')],{'foreignKey':_0x9f10('0x1d7'),'as':_0x9f10('0x1c9')});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9f10('0xe4')][_0x9f10('0x10d')](db[_0x9f10('0x56')],{'foreignKey':_0x9f10('0x1d8'),'as':_0x9f10('0x1ce')});db['SmsTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0x51')],{'foreignKey':'ToSmsAccountId','as':_0x9f10('0x1d0')});db['CmList']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':'ListId','onDelete':'cascade'});db[_0x9f10('0xe5')][_0x9f10('0x102')](db['CmCustomField'],{'as':_0x9f10('0x1d9'),'foreignKey':'ListId'});db[_0x9f10('0xe5')]['hasMany'](db[_0x9f10('0x6c')],{'as':_0x9f10('0x111'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0xe5')]['hasMany'](db[_0x9f10('0x70')],{'as':'HopperFinals','foreignKey':_0x9f10('0x155')});db['CmList'][_0x9f10('0x102')](db[_0x9f10('0x13a')],{'as':_0x9f10('0x107'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0xe5')][_0x9f10('0x102')](db[_0x9f10('0x72')],{'as':_0x9f10('0x72'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0xe5')][_0x9f10('0x10e')](db['VoiceQueue'],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x9f10('0xe5')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':'cm_user_has_lists'});db[_0x9f10('0xe7')][_0x9f10('0x102')](db[_0x9f10('0x17')],{'as':_0x9f10('0x106'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0xe7')]['belongsToMany'](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':_0x9f10('0xfe')});db[_0x9f10('0xe7')][_0x9f10('0x10e')](db[_0x9f10('0xd5')],{'through':_0x9f10('0x1c4'),'as':_0x9f10('0x158')});db['UserProfile'][_0x9f10('0x102')](db[_0x9f10('0x12')],{'as':_0x9f10('0x169'),'foreignKey':_0x9f10('0x1da')});db[_0x9f10('0xe9')]['hasMany'](db[_0x9f10('0xeb')],{'as':'UserProfileSections','foreignKey':_0x9f10('0x1da'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0xeb')]['hasMany'](db[_0x9f10('0xed')],{'as':'Resources','foreignKey':_0x9f10('0x1db'),'onDelete':_0x9f10('0x101')});db[_0x9f10('0x12d')][_0x9f10('0x102')](db[_0x9f10('0x7b')],{'as':_0x9f10('0x16e'),'foreignKey':'WhatsappAccountId','onDelete':_0x9f10('0x101')});db[_0x9f10('0x12d')][_0x9f10('0x102')](db[_0x9f10('0x79')],{'as':_0x9f10('0x152'),'foreignKey':_0x9f10('0x1dc')});db[_0x9f10('0x12d')][_0x9f10('0x102')](db['WhatsappMessage'],{'as':_0x9f10('0x148'),'foreignKey':_0x9f10('0x1dc')});db[_0x9f10('0x12d')]['hasMany'](db['WhatsappInteraction'],{'as':_0x9f10('0x153')});db['WhatsappAccount'][_0x9f10('0x102')](db[_0x9f10('0x1dd')],{'as':_0x9f10('0x133')});db[_0x9f10('0x12d')][_0x9f10('0x10d')](db['CmList'],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0x12d')][_0x9f10('0x10d')](db[_0x9f10('0x80')],{'as':_0x9f10('0x143'),'foreignKey':_0x9f10('0x144')});db[_0x9f10('0x12d')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x146'),'through':'user_has_whatsapp_accounts'});db[_0x9f10('0x1dd')]['belongsTo'](db[_0x9f10('0x12')],{'onDelete':_0x9f10('0x161')});db['WhatsappApplication'][_0x9f10('0x10d')](db['WhatsappQueue'],{'onDelete':_0x9f10('0x161')});db[_0x9f10('0x1dd')]['belongsTo'](db[_0x9f10('0x12d')],{'onDelete':'restrict'});db[_0x9f10('0x1dd')][_0x9f10('0x10d')](db[_0x9f10('0x7f')],{'onDelete':_0x9f10('0x161'),'foreignKey':'IntervalId'});db[_0x9f10('0x1dd')][_0x9f10('0x10d')](db[_0x9f10('0x87')],{'onDelete':_0x9f10('0x161'),'foreignKey':'TagId'});db[_0x9f10('0xf3')][_0x9f10('0x102')](db[_0x9f10('0xf4')],{'as':_0x9f10('0x148'),'onDelete':_0x9f10('0x101'),'foreignKey':_0x9f10('0x1de')});db[_0x9f10('0xf3')]['belongsTo'](db['WhatsappAccount'],{'as':_0x9f10('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x9f10('0xf3')][_0x9f10('0x10d')](db[_0x9f10('0x6c')],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0xf3')][_0x9f10('0x10d')](db['User'],{'as':_0x9f10('0x15b'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x9f10('0x10e')](db[_0x9f10('0x87')],{'through':_0x9f10('0x198'),'as':_0x9f10('0x167')});db['WhatsappInteraction']['belongsToMany'](db[_0x9f10('0x87')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':_0x9f10('0x169'),'through':_0x9f10('0x11b'),'foreignKey':_0x9f10('0x1de')});db[_0x9f10('0xf4')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'as':'User'});db[_0x9f10('0xf4')][_0x9f10('0x10d')](db['CmContact'],{'onDelete':'cascade','as':_0x9f10('0x15a')});db['WhatsappMessage']['belongsTo'](db[_0x9f10('0xf3')],{'onDelete':_0x9f10('0x101'),'as':_0x9f10('0x16a'),'foreignKey':'WhatsappInteractionId'});db[_0x9f10('0xf4')][_0x9f10('0x10d')](db[_0x9f10('0x12d')],{'as':_0x9f10('0x159'),'foreignKey':_0x9f10('0x1dc')});db[_0x9f10('0xf6')][_0x9f10('0x10d')](db['WhatsappAccount'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x9f10('0xe5')],{'as':_0x9f10('0x154'),'foreignKey':_0x9f10('0x155')});db[_0x9f10('0xf6')][_0x9f10('0x10d')](db['CmContact'],{'as':_0x9f10('0x15a'),'foreignKey':_0x9f10('0x14e')});db[_0x9f10('0xf6')][_0x9f10('0x10d')](db[_0x9f10('0xf3')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x9f10('0xf8')],{});db[_0x9f10('0xf6')]['belongsTo'](db[_0x9f10('0xf4')],{});db[_0x9f10('0xf6')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{});db['WhatsappTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0xf4')],{});db['WhatsappTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0xf3')],{});db[_0x9f10('0x1df')]['belongsTo'](db[_0x9f10('0x12d')],{'foreignKey':_0x9f10('0x1e0'),'as':'FromAccount'});db[_0x9f10('0x1df')][_0x9f10('0x10d')](db[_0x9f10('0x12d')],{'foreignKey':_0x9f10('0x1e1'),'as':_0x9f10('0x1d0')});db['WhatsappTransferReport'][_0x9f10('0x10d')](db[_0x9f10('0xf8')],{'foreignKey':'ToQueueId','as':'ToQueue'});db[_0x9f10('0x1df')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':'FromUserId','as':_0x9f10('0x1ca')});db[_0x9f10('0x1df')][_0x9f10('0x10d')](db[_0x9f10('0x12')],{'foreignKey':_0x9f10('0x1cb'),'as':'ToAgent'});db[_0x9f10('0xf8')][_0x9f10('0x10e')](db[_0x9f10('0x12')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0x9f10('0x1e2')});db[_0x9f10('0xf8')][_0x9f10('0x10e')](db[_0x9f10('0xd5')],{'through':_0x9f10('0x1e3'),'as':_0x9f10('0x158')});module[_0x9f10('0x1e4')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 5bf03f7..8950d60 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf0cb=['./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','securityToken','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','includes','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','url','statusCode','user','name','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','responseTime','other','test','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./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/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/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/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','/api/cloudProviders','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system'];(function(_0x431bd7,_0x47fdf6){var _0x356280=function(_0x2e4ded){while(--_0x2e4ded){_0x431bd7['push'](_0x431bd7['shift']());}};_0x356280(++_0x47fdf6);}(_0xf0cb,0x192));var _0xbf0c=function(_0x88620a,_0x1bc1d5){_0x88620a=_0x88620a-0x0;var _0x28983a=_0xf0cb[_0x88620a];return _0x28983a;};'use strict';var _=require(_0xbf0c('0x0'));var path=require(_0xbf0c('0x1'));var express=require(_0xbf0c('0x2'));var ewinston=require(_0xbf0c('0x3'));var util=require(_0xbf0c('0x4'));var errors=require(_0xbf0c('0x5'));var config=require(_0xbf0c('0x6'));var logger=require(_0xbf0c('0x7'))(_0xbf0c('0x8'));var authLogger=require(_0xbf0c('0x7'))(_0xbf0c('0x9'));exports[_0xbf0c('0xa')]=function(_0xd8f41){_0xd8f41[_0xbf0c('0xb')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x52e310,_0x2a5c08){var _0x2f8953=_0xbf0c('0xc');if(!_[_0xbf0c('0xd')](_0x52e310['body'])){_0x2f8953+=_0xbf0c('0xe');var _0x3bb99f=_0x52e310[_0xbf0c('0xf')];maskSensitiveData(_0x3bb99f);}return util[_0xbf0c('0x10')](_0x2f8953,_0x52e310[_0xbf0c('0x11')],_0x52e310[_0xbf0c('0x12')][_0xbf0c('0x13')]?_0x52e310[_0xbf0c('0x12')][_0xbf0c('0x13')]:_0x52e310[_0xbf0c('0x14')]['remoteAddress']||_0x52e310['ip'],_0x52e310[_0xbf0c('0x15')],_0x2a5c08[_0xbf0c('0x16')],_0x2a5c08['responseTime'],_0x52e310['user']?_0x52e310['user']['id']:null,_0x52e310[_0xbf0c('0x17')]?_0x52e310[_0xbf0c('0x17')][_0xbf0c('0x18')]:null,_0x52e310['user']?_0x52e310[_0xbf0c('0x17')][_0xbf0c('0x19')]:null,_0x3bb99f?util[_0xbf0c('0x1a')](_0x3bb99f,![],null):'');}}));_0xd8f41[_0xbf0c('0xb')](ewinston[_0xbf0c('0x1b')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x242327,_0x409038){var _0x1840c7=_0xbf0c('0x1c');if(_0x242327[_0xbf0c('0xf')]&&_0x242327[_0xbf0c('0xf')][_0xbf0c('0x1d')]&&_0x242327[_0xbf0c('0xf')][_0xbf0c('0x1e')]){_0x1840c7=_0xbf0c('0x1f');}return util[_0xbf0c('0x10')](_0x1840c7,_0x242327[_0xbf0c('0x11')],_0x242327[_0xbf0c('0x12')][_0xbf0c('0x13')]?_0x242327[_0xbf0c('0x12')]['x-forwarded-for']:_0x242327['connection'][_0xbf0c('0x20')]||_0x242327['ip'],_0x242327['url'],_0x409038[_0xbf0c('0x16')],_0x409038[_0xbf0c('0x21')],_0x242327[_0xbf0c('0x17')]?_0x242327['user']['id']:null,_0x242327[_0xbf0c('0x17')]?_0x242327[_0xbf0c('0x17')][_0xbf0c('0x18')]:null,_0x242327[_0xbf0c('0x17')]?_0x242327[_0xbf0c('0x17')]['role']:null,_0x242327[_0xbf0c('0xf')]&&_0x242327['body'][_0xbf0c('0x1d')]?_0x242327['body']['device']:_0xbf0c('0x22'),_0x242327[_0xbf0c('0xf')]&&_0x242327[_0xbf0c('0xf')][_0xbf0c('0x1e')]?_0x242327['body'][_0xbf0c('0x1e')]:'',_0x242327[_0xbf0c('0xf')]&&_0x242327[_0xbf0c('0xf')]['agent_name']?_0x242327[_0xbf0c('0xf')]['agent_name']:'');},'ignoreRoute':function(_0x542e5c){var _0x39e120=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x39e120[_0xbf0c('0x23')](_0x542e5c[_0xbf0c('0x15')]);}}));_0xd8f41[_0xbf0c('0xb')]('/api/users',require(_0xbf0c('0x24')));_0xd8f41[_0xbf0c('0xb')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x25'),require(_0xbf0c('0x26')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x27'),require(_0xbf0c('0x28')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x29'),require('./api/voiceMusicOnHold'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x2a'),require(_0xbf0c('0x2b')));_0xd8f41['use'](_0xbf0c('0x2c'),require(_0xbf0c('0x2d')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x2e'),require(_0xbf0c('0x2f')));_0xd8f41['use']('/api/voice/mails',require(_0xbf0c('0x30')));_0xd8f41[_0xbf0c('0xb')]('/api/voice/mails/messages',require(_0xbf0c('0x31')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x32'),require(_0xbf0c('0x33')));_0xd8f41['use'](_0xbf0c('0x34'),require('./api/voiceDialReport'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x35'),require('./api/voiceAgentReport'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x36'),require(_0xbf0c('0x37')));_0xd8f41['use'](_0xbf0c('0x38'),require(_0xbf0c('0x39')));_0xd8f41[_0xbf0c('0xb')]('/api/trunks',require(_0xbf0c('0x3a')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x3b'),require(_0xbf0c('0x3c')));_0xd8f41['use'](_0xbf0c('0x3d'),require(_0xbf0c('0x3e')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x3f'),require(_0xbf0c('0x40')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x41'),require(_0xbf0c('0x42')));_0xd8f41['use'](_0xbf0c('0x43'),require(_0xbf0c('0x44')));_0xd8f41['use']('/api/mail/interactions',require(_0xbf0c('0x45')));_0xd8f41['use'](_0xbf0c('0x46'),require(_0xbf0c('0x47')));_0xd8f41[_0xbf0c('0xb')]('/api/mail/applications',require(_0xbf0c('0x48')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x49'),require(_0xbf0c('0x4a')));_0xd8f41[_0xbf0c('0xb')]('/api/dashboards',require(_0xbf0c('0x4b')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x4c'),require('./api/dashboardItem'));_0xd8f41['use']('/api/fax/accounts',require(_0xbf0c('0x4d')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x4e'),require('./api/faxApplication'));_0xd8f41['use']('/api/fax/interactions',require(_0xbf0c('0x4f')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x50'),require(_0xbf0c('0x51')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x52'),require('./api/faxQueue'));_0xd8f41[_0xbf0c('0xb')]('/api/fax/reports/queue',require(_0xbf0c('0x53')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x54'),require(_0xbf0c('0x55')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x56'),require(_0xbf0c('0x57')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x58'),require(_0xbf0c('0x59')));_0xd8f41[_0xbf0c('0xb')]('/api/sms/messages',require(_0xbf0c('0x5a')));_0xd8f41['use'](_0xbf0c('0x5b'),require('./api/smsQueue'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x5c'),require(_0xbf0c('0x5d')));_0xd8f41['use'](_0xbf0c('0x5e'),require(_0xbf0c('0x5f')));_0xd8f41['use']('/api/openchannel/interactions',require(_0xbf0c('0x60')));_0xd8f41['use'](_0xbf0c('0x61'),require(_0xbf0c('0x62')));_0xd8f41[_0xbf0c('0xb')]('/api/openchannel/queues',require(_0xbf0c('0x63')));_0xd8f41[_0xbf0c('0xb')]('/api/chat/websites',require(_0xbf0c('0x64')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x65'),require('./api/openchannelQueueReport'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x66'),require(_0xbf0c('0x67')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x68'),require(_0xbf0c('0x69')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x6a'),require(_0xbf0c('0x6b')));_0xd8f41[_0xbf0c('0xb')]('/api/chat/offline_messages',require(_0xbf0c('0x6c')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x6d'),require(_0xbf0c('0x6e')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x6f'),require(_0xbf0c('0x70')));_0xd8f41[_0xbf0c('0xb')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x71'),require(_0xbf0c('0x72')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x73'),require(_0xbf0c('0x74')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x75'),require(_0xbf0c('0x76')));_0xd8f41['use'](_0xbf0c('0x77'),require('./api/cmHopperBlack'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x78'),require(_0xbf0c('0x79')));_0xd8f41[_0xbf0c('0xb')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x7a'),require(_0xbf0c('0x7b')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x7c'),require('./api/action'));_0xd8f41[_0xbf0c('0xb')]('/api/automations',require(_0xbf0c('0x7d')));_0xd8f41['use'](_0xbf0c('0x7e'),require(_0xbf0c('0x7f')));_0xd8f41['use'](_0xbf0c('0x80'),require(_0xbf0c('0x81')));_0xd8f41['use'](_0xbf0c('0x82'),require(_0xbf0c('0x83')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x84'),require('./api/interval'));_0xd8f41[_0xbf0c('0xb')]('/api/pauses',require('./api/pause'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x85'),require(_0xbf0c('0x86')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x87'),require('./api/voiceQueuesLog'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x88'),require(_0xbf0c('0x89')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x8a'),require(_0xbf0c('0x8b')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x8c'),require(_0xbf0c('0x8d')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x8e'),require(_0xbf0c('0x8f')));_0xd8f41['use'](_0xbf0c('0x90'),require(_0xbf0c('0x91')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x92'),require('./api/variable'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x93'),require(_0xbf0c('0x94')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x95'),require(_0xbf0c('0x96')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x97'),require('./api/analyticCustomReport'));_0xd8f41[_0xbf0c('0xb')]('/api/analytics/default_reports',require(_0xbf0c('0x98')));_0xd8f41['use'](_0xbf0c('0x99'),require(_0xbf0c('0x9a')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x9b'),require(_0xbf0c('0x9c')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x9d'),require(_0xbf0c('0x9e')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x9f'),require(_0xbf0c('0xa0')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/salesforce/accounts',require(_0xbf0c('0xa1')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xa2'),require(_0xbf0c('0xa3')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xa4'),require(_0xbf0c('0xa5')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xa6'),require(_0xbf0c('0xa7')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/sugarcrm/configurations',require(_0xbf0c('0xa8')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/sugarcrm/fields',require(_0xbf0c('0xa9')));_0xd8f41['use'](_0xbf0c('0xaa'),require(_0xbf0c('0xab')));_0xd8f41['use'](_0xbf0c('0xac'),require(_0xbf0c('0xad')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xae'),require(_0xbf0c('0xaf')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/zoho/accounts',require(_0xbf0c('0xb0')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/zoho/configurations',require(_0xbf0c('0xb1')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/zoho/fields',require(_0xbf0c('0xb2')));_0xd8f41['use'](_0xbf0c('0xb3'),require('./api/intZendeskAccount'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xb4'),require(_0xbf0c('0xb5')));_0xd8f41['use'](_0xbf0c('0xb6'),require(_0xbf0c('0xb7')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xb8'),require(_0xbf0c('0xb9')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xba'),require(_0xbf0c('0xbb')));_0xd8f41['use'](_0xbf0c('0xbc'),require(_0xbf0c('0xbd')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xbe'),require(_0xbf0c('0xbf')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xc0'),require(_0xbf0c('0xc1')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xc2'),require(_0xbf0c('0xc3')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0xd8f41['use'](_0xbf0c('0xc4'),require(_0xbf0c('0xc5')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xc6'),require(_0xbf0c('0xc7')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/dynamics365/accounts',require(_0xbf0c('0xc8')));_0xd8f41['use'](_0xbf0c('0xc9'),require(_0xbf0c('0xca')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xcb'),require(_0xbf0c('0xcc')));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/freshsales/accounts',require(_0xbf0c('0xcd')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xce'),require('./api/intFreshsalesConfiguration'));_0xd8f41[_0xbf0c('0xb')]('/api/integrations/freshsales/fields',require(_0xbf0c('0xcf')));_0xd8f41['use'](_0xbf0c('0xd0'),require(_0xbf0c('0xd1')));_0xd8f41['use'](_0xbf0c('0xd2'),require(_0xbf0c('0xd3')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xd4'),require(_0xbf0c('0xd5')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xd6'),require('./api/jscriptyAnswerReport'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xd7'),require(_0xbf0c('0xd8')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xd9'),require(_0xbf0c('0xda')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xdb'),require(_0xbf0c('0xdc')));_0xd8f41['use'](_0xbf0c('0xdd'),require(_0xbf0c('0xde')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xdf'),require(_0xbf0c('0xe0')));_0xd8f41['use'](_0xbf0c('0xe1'),require(_0xbf0c('0xe2')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xe3'),require(_0xbf0c('0xe4')));_0xd8f41['use'](_0xbf0c('0xe5'),require(_0xbf0c('0xe6')));_0xd8f41[_0xbf0c('0xb')]('/api/square/projects',require(_0xbf0c('0xe7')));_0xd8f41['use'](_0xbf0c('0xe8'),require(_0xbf0c('0xe9')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xea'),require(_0xbf0c('0xeb')));_0xd8f41['use'](_0xbf0c('0xec'),require(_0xbf0c('0xed')));_0xd8f41['use'](_0xbf0c('0xee'),require(_0xbf0c('0xef')));_0xd8f41[_0xbf0c('0xb')]('/api/campaigns',require(_0xbf0c('0xf0')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xf1'),require(_0xbf0c('0xf2')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xf3'),require(_0xbf0c('0xf4')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xf5'),require(_0xbf0c('0xf6')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xf7'),require(_0xbf0c('0xf8')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xf9'),require(_0xbf0c('0xfa')));_0xd8f41[_0xbf0c('0xb')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0xd8f41[_0xbf0c('0xb')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0xd8f41['use']('/api/sms/reports/transfer',require(_0xbf0c('0xfb')));_0xd8f41[_0xbf0c('0xb')]('/api/cm/lists',require('./api/cmList'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xfc'),require(_0xbf0c('0xfd')));_0xd8f41['use']('/api/userProfiles',require('./api/userProfile'));_0xd8f41[_0xbf0c('0xb')]('/api/userProfile/sections',require(_0xbf0c('0xfe')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0xff'),require('./api/userProfileResource'));_0xd8f41['use'](_0xbf0c('0x100'),require('./api/userNotification'));_0xd8f41['use'](_0xbf0c('0x101'),require(_0xbf0c('0x102')));_0xd8f41['use'](_0xbf0c('0x103'),require(_0xbf0c('0x104')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x105'),require(_0xbf0c('0x106')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x107'),require(_0xbf0c('0x108')));_0xd8f41['use']('/api/whatsapp/reports/queue',require(_0xbf0c('0x109')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x10a'),require('./api/whatsappTransferReport'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x10b'),require('./api/whatsappQueue'));_0xd8f41['use'](_0xbf0c('0x10c'),require('./api/cloudProvider'));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x10d'),require(_0xbf0c('0x10e')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x10f'),require(_0xbf0c('0x110')));_0xd8f41[_0xbf0c('0xb')]('/api/auth/google',require(_0xbf0c('0x111')));_0xd8f41['use'](_0xbf0c('0x112'),require(_0xbf0c('0x113')));_0xd8f41[_0xbf0c('0xb')]('/api/jira',require(_0xbf0c('0x114')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x115'),require(_0xbf0c('0x116')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x117'),require(_0xbf0c('0x118')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x119'),require(_0xbf0c('0x11a')));_0xd8f41['use'](_0xbf0c('0x11b'),require(_0xbf0c('0x11c')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x11d'),require(_0xbf0c('0x11e')));_0xd8f41['use'](_0xbf0c('0x11f'),express['static'](path[_0xbf0c('0x120')](config['root'],_0xbf0c('0x11f'))));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x121'),express[_0xbf0c('0x122')](path[_0xbf0c('0x120')](config[_0xbf0c('0x123')],_0xbf0c('0x121'))));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x124'),express[_0xbf0c('0x122')](path['join'](config[_0xbf0c('0x123')],'/demo')));_0xd8f41[_0xbf0c('0xb')](_0xbf0c('0x125'),express[_0xbf0c('0x122')](path[_0xbf0c('0x120')](config[_0xbf0c('0x123')],'snippet',_0xbf0c('0x126'))));_0xd8f41[_0xbf0c('0xb')]('/plugins',express['static'](path[_0xbf0c('0x120')](config[_0xbf0c('0x123')],_0xbf0c('0x127'))));_0xd8f41[_0xbf0c('0x128')](_0xbf0c('0x129'))[_0xbf0c('0x12a')](errors[0x194]);_0xd8f41[_0xbf0c('0x128')]('/*')[_0xbf0c('0x12a')](function(_0x2ef93b,_0x2f9d02){_0x2f9d02[_0xbf0c('0x12b')](path[_0xbf0c('0x12c')](_0xd8f41['get'](_0xbf0c('0x12d'))+'/index.html'));});};var sensitiveFields=['username',_0xbf0c('0x12e'),_0xbf0c('0x12f'),_0xbf0c('0x130'),_0xbf0c('0x131'),_0xbf0c('0x132'),_0xbf0c('0x133'),_0xbf0c('0x134'),_0xbf0c('0x135'),_0xbf0c('0x136'),_0xbf0c('0x137'),_0xbf0c('0x138'),'clientSecret',_0xbf0c('0x139'),_0xbf0c('0x13a'),'accessKey',_0xbf0c('0x13b'),_0xbf0c('0x13c'),_0xbf0c('0x13d'),_0xbf0c('0x13e'),_0xbf0c('0x13f'),_0xbf0c('0x140'),_0xbf0c('0x141'),'consumerSecret','membername',_0xbf0c('0x142'),'calleridnum',_0xbf0c('0x143'),_0xbf0c('0x144'),_0xbf0c('0x145'),_0xbf0c('0x146'),_0xbf0c('0x147'),_0xbf0c('0x148'),_0xbf0c('0x149'),'user',_0xbf0c('0x14a'),_0xbf0c('0x14b'),'localstationid','dsn',_0xbf0c('0x14c'),_0xbf0c('0x14d'),_0xbf0c('0x14e')];function maskSensitiveData(_0x577aba){var _0x56a80f=/(?!^)[\s\S](?!$)/g;if(!_[_0xbf0c('0x14f')](_0x577aba))return;for(var _0x4f6528 in _0x577aba){if(_[_0xbf0c('0x150')](_0x577aba[_0x4f6528])){for(var _0xa93dcf=0x0;_0xa93dcf<_0x577aba[_0x4f6528][_0xbf0c('0x151')];_0xa93dcf++){maskSensitiveData(_0x577aba[_0x4f6528][_0xa93dcf]);}}else if(_[_0xbf0c('0x14f')](_0x577aba[_0x4f6528])){maskSensitiveData(_0x577aba[_0x4f6528]);}else if(_[_0xbf0c('0x152')](_0x577aba[_0x4f6528])){_0x577aba[_0x4f6528]=_0x577aba[_0x4f6528][_0xbf0c('0x153')](/{{{/g,_0xbf0c('0x154'))['replace'](/}}}/g,'}@@')['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xbf0c('0x155')](sensitiveFields,_0x4f6528)){_0x577aba[_0x4f6528]=_0x577aba[_0x4f6528]['replace'](_0x56a80f,'*');}}}} \ No newline at end of file +var _0x5281=['./api/mailAccount','/api/mail/queues','./api/mailInteraction','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./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/fax/queues','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/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/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/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/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','/demo','/snippet','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','apiKey','firstName','lastName','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerSecret','membername','calleridname','calleridnum','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','localstationid','secret','registry','isPlainObject','isArray','isString','replace','@@{','}@@','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','auth','use','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','url','responseTime','user','name','role','inspect','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','other','agent_name','test','/api/users','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts'];(function(_0xa2cdf9,_0x50399f){var _0x5085b9=function(_0x16a96c){while(--_0x16a96c){_0xa2cdf9['push'](_0xa2cdf9['shift']());}};_0x5085b9(++_0x50399f);}(_0x5281,0x106));var _0x1528=function(_0x27c352,_0x4b7af5){_0x27c352=_0x27c352-0x0;var _0x287a61=_0x5281[_0x27c352];return _0x287a61;};'use strict';var _=require(_0x1528('0x0'));var path=require(_0x1528('0x1'));var express=require(_0x1528('0x2'));var ewinston=require(_0x1528('0x3'));var util=require(_0x1528('0x4'));var errors=require(_0x1528('0x5'));var config=require(_0x1528('0x6'));var logger=require(_0x1528('0x7'))('api');var authLogger=require(_0x1528('0x7'))(_0x1528('0x8'));exports['default']=function(_0x3684df){_0x3684df[_0x1528('0x9')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4729bb,_0x32a9ca){var _0x2dd07='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x1528('0xa')](_0x4729bb[_0x1528('0xb')])){_0x2dd07+=_0x1528('0xc');var _0x22a1cd=_0x4729bb[_0x1528('0xb')];maskSensitiveData(_0x22a1cd);}return util[_0x1528('0xd')](_0x2dd07,_0x4729bb[_0x1528('0xe')],_0x4729bb['headers']['x-forwarded-for']?_0x4729bb[_0x1528('0xf')][_0x1528('0x10')]:_0x4729bb['connection'][_0x1528('0x11')]||_0x4729bb['ip'],_0x4729bb[_0x1528('0x12')],_0x32a9ca['statusCode'],_0x32a9ca[_0x1528('0x13')],_0x4729bb[_0x1528('0x14')]?_0x4729bb[_0x1528('0x14')]['id']:null,_0x4729bb[_0x1528('0x14')]?_0x4729bb[_0x1528('0x14')][_0x1528('0x15')]:null,_0x4729bb[_0x1528('0x14')]?_0x4729bb['user'][_0x1528('0x16')]:null,_0x22a1cd?util[_0x1528('0x17')](_0x22a1cd,![],null):'');}}));_0x3684df[_0x1528('0x9')](ewinston[_0x1528('0x18')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x41c9fa,_0x4e865f){var _0x4a8cb9=_0x1528('0x19');if(_0x41c9fa[_0x1528('0xb')]&&_0x41c9fa['body'][_0x1528('0x1a')]&&_0x41c9fa[_0x1528('0xb')][_0x1528('0x1b')]){_0x4a8cb9=_0x1528('0x1c');}return util[_0x1528('0xd')](_0x4a8cb9,_0x41c9fa[_0x1528('0xe')],_0x41c9fa['headers'][_0x1528('0x10')]?_0x41c9fa[_0x1528('0xf')][_0x1528('0x10')]:_0x41c9fa[_0x1528('0x1d')][_0x1528('0x11')]||_0x41c9fa['ip'],_0x41c9fa[_0x1528('0x12')],_0x4e865f['statusCode'],_0x4e865f[_0x1528('0x13')],_0x41c9fa[_0x1528('0x14')]?_0x41c9fa[_0x1528('0x14')]['id']:null,_0x41c9fa[_0x1528('0x14')]?_0x41c9fa[_0x1528('0x14')][_0x1528('0x15')]:null,_0x41c9fa['user']?_0x41c9fa[_0x1528('0x14')][_0x1528('0x16')]:null,_0x41c9fa[_0x1528('0xb')]&&_0x41c9fa[_0x1528('0xb')][_0x1528('0x1a')]?_0x41c9fa[_0x1528('0xb')][_0x1528('0x1a')]:_0x1528('0x1e'),_0x41c9fa[_0x1528('0xb')]&&_0x41c9fa[_0x1528('0xb')][_0x1528('0x1b')]?_0x41c9fa[_0x1528('0xb')]['agent_id']:'',_0x41c9fa['body']&&_0x41c9fa[_0x1528('0xb')][_0x1528('0x1f')]?_0x41c9fa[_0x1528('0xb')][_0x1528('0x1f')]:'');},'ignoreRoute':function(_0x26a56b){var _0x4087d6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4087d6[_0x1528('0x20')](_0x26a56b[_0x1528('0x12')]);}}));_0x3684df[_0x1528('0x9')](_0x1528('0x21'),require('./api/user'));_0x3684df[_0x1528('0x9')]('/api/voice/chanspy',require(_0x1528('0x22')));_0x3684df[_0x1528('0x9')]('/api/voice/contexts',require(_0x1528('0x23')));_0x3684df[_0x1528('0x9')](_0x1528('0x24'),require(_0x1528('0x25')));_0x3684df[_0x1528('0x9')](_0x1528('0x26'),require('./api/voiceMusicOnHold'));_0x3684df['use'](_0x1528('0x27'),require(_0x1528('0x28')));_0x3684df[_0x1528('0x9')]('/api/voice/recordings',require('./api/voiceRecording'));_0x3684df[_0x1528('0x9')](_0x1528('0x29'),require('./api/screenRecording'));_0x3684df['use'](_0x1528('0x2a'),require('./api/voiceMail'));_0x3684df[_0x1528('0x9')](_0x1528('0x2b'),require(_0x1528('0x2c')));_0x3684df[_0x1528('0x9')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x3684df[_0x1528('0x9')](_0x1528('0x2d'),require(_0x1528('0x2e')));_0x3684df['use'](_0x1528('0x2f'),require('./api/voiceAgentReport'));_0x3684df[_0x1528('0x9')]('/api/voice/queues/reports',require(_0x1528('0x30')));_0x3684df[_0x1528('0x9')](_0x1528('0x31'),require(_0x1528('0x32')));_0x3684df[_0x1528('0x9')](_0x1528('0x33'),require(_0x1528('0x34')));_0x3684df[_0x1528('0x9')](_0x1528('0x35'),require('./api/voiceTransferReport'));_0x3684df['use'](_0x1528('0x36'),require('./api/mailServerOut'));_0x3684df[_0x1528('0x9')](_0x1528('0x37'),require(_0x1528('0x38')));_0x3684df[_0x1528('0x9')](_0x1528('0x39'),require('./api/mailQueue'));_0x3684df['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0x3684df[_0x1528('0x9')]('/api/mail/interactions',require(_0x1528('0x3a')));_0x3684df[_0x1528('0x9')](_0x1528('0x3b'),require('./api/mailMessage'));_0x3684df[_0x1528('0x9')](_0x1528('0x3c'),require('./api/mailApplication'));_0x3684df[_0x1528('0x9')](_0x1528('0x3d'),require(_0x1528('0x3e')));_0x3684df['use']('/api/dashboards',require(_0x1528('0x3f')));_0x3684df[_0x1528('0x9')](_0x1528('0x40'),require(_0x1528('0x41')));_0x3684df['use'](_0x1528('0x42'),require(_0x1528('0x43')));_0x3684df[_0x1528('0x9')](_0x1528('0x44'),require(_0x1528('0x45')));_0x3684df['use'](_0x1528('0x46'),require(_0x1528('0x47')));_0x3684df['use'](_0x1528('0x48'),require('./api/faxMessage'));_0x3684df[_0x1528('0x9')](_0x1528('0x49'),require('./api/faxQueue'));_0x3684df[_0x1528('0x9')](_0x1528('0x4a'),require('./api/faxQueueReport'));_0x3684df[_0x1528('0x9')](_0x1528('0x4b'),require('./api/smsAccount'));_0x3684df['use'](_0x1528('0x4c'),require('./api/smsApplication'));_0x3684df[_0x1528('0x9')]('/api/sms/interactions',require(_0x1528('0x4d')));_0x3684df[_0x1528('0x9')](_0x1528('0x4e'),require(_0x1528('0x4f')));_0x3684df[_0x1528('0x9')]('/api/sms/queues',require('./api/smsQueue'));_0x3684df[_0x1528('0x9')](_0x1528('0x50'),require(_0x1528('0x51')));_0x3684df['use'](_0x1528('0x52'),require('./api/openchannelApplication'));_0x3684df[_0x1528('0x9')](_0x1528('0x53'),require(_0x1528('0x54')));_0x3684df['use'](_0x1528('0x55'),require(_0x1528('0x56')));_0x3684df[_0x1528('0x9')](_0x1528('0x57'),require(_0x1528('0x58')));_0x3684df[_0x1528('0x9')](_0x1528('0x59'),require('./api/chatWebsite'));_0x3684df['use'](_0x1528('0x5a'),require(_0x1528('0x5b')));_0x3684df[_0x1528('0x9')](_0x1528('0x5c'),require('./api/chatApplication'));_0x3684df[_0x1528('0x9')](_0x1528('0x5d'),require(_0x1528('0x5e')));_0x3684df[_0x1528('0x9')](_0x1528('0x5f'),require(_0x1528('0x60')));_0x3684df[_0x1528('0x9')](_0x1528('0x61'),require(_0x1528('0x62')));_0x3684df[_0x1528('0x9')](_0x1528('0x63'),require(_0x1528('0x64')));_0x3684df[_0x1528('0x9')](_0x1528('0x65'),require('./api/chatGroup'));_0x3684df[_0x1528('0x9')](_0x1528('0x66'),require('./api/chatProactiveAction'));_0x3684df[_0x1528('0x9')]('/api/cm/companies',require(_0x1528('0x67')));_0x3684df[_0x1528('0x9')](_0x1528('0x68'),require(_0x1528('0x69')));_0x3684df[_0x1528('0x9')](_0x1528('0x6a'),require(_0x1528('0x6b')));_0x3684df[_0x1528('0x9')](_0x1528('0x6c'),require('./api/cmHopperBlack'));_0x3684df[_0x1528('0x9')](_0x1528('0x6d'),require(_0x1528('0x6e')));_0x3684df[_0x1528('0x9')](_0x1528('0x6f'),require(_0x1528('0x70')));_0x3684df[_0x1528('0x9')](_0x1528('0x71'),require('./api/cmCustomField'));_0x3684df[_0x1528('0x9')](_0x1528('0x72'),require('./api/action'));_0x3684df[_0x1528('0x9')](_0x1528('0x73'),require(_0x1528('0x74')));_0x3684df[_0x1528('0x9')](_0x1528('0x75'),require(_0x1528('0x76')));_0x3684df[_0x1528('0x9')]('/api/dispositions',require(_0x1528('0x77')));_0x3684df[_0x1528('0x9')](_0x1528('0x78'),require('./api/condition'));_0x3684df[_0x1528('0x9')]('/api/intervals',require(_0x1528('0x79')));_0x3684df[_0x1528('0x9')](_0x1528('0x7a'),require(_0x1528('0x7b')));_0x3684df['use'](_0x1528('0x7c'),require(_0x1528('0x7d')));_0x3684df[_0x1528('0x9')](_0x1528('0x7e'),require(_0x1528('0x7f')));_0x3684df[_0x1528('0x9')]('/api/schedules',require('./api/schedule'));_0x3684df['use']('/api/sounds',require(_0x1528('0x80')));_0x3684df['use'](_0x1528('0x81'),require(_0x1528('0x82')));_0x3684df[_0x1528('0x9')](_0x1528('0x83'),require(_0x1528('0x84')));_0x3684df[_0x1528('0x9')]('/api/triggers',require('./api/trigger'));_0x3684df['use'](_0x1528('0x85'),require(_0x1528('0x86')));_0x3684df[_0x1528('0x9')]('/api/integrations',require(_0x1528('0x87')));_0x3684df[_0x1528('0x9')](_0x1528('0x88'),require(_0x1528('0x89')));_0x3684df[_0x1528('0x9')](_0x1528('0x8a'),require(_0x1528('0x8b')));_0x3684df[_0x1528('0x9')](_0x1528('0x8c'),require(_0x1528('0x8d')));_0x3684df[_0x1528('0x9')](_0x1528('0x8e'),require('./api/analyticExtractedReport'));_0x3684df['use'](_0x1528('0x8f'),require(_0x1528('0x90')));_0x3684df[_0x1528('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x3684df[_0x1528('0x9')](_0x1528('0x91'),require(_0x1528('0x92')));_0x3684df[_0x1528('0x9')]('/api/integrations/salesforce/accounts',require(_0x1528('0x93')));_0x3684df[_0x1528('0x9')](_0x1528('0x94'),require(_0x1528('0x95')));_0x3684df[_0x1528('0x9')](_0x1528('0x96'),require('./api/intSalesforceField'));_0x3684df['use'](_0x1528('0x97'),require(_0x1528('0x98')));_0x3684df['use'](_0x1528('0x99'),require('./api/intSugarcrmConfiguration'));_0x3684df[_0x1528('0x9')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x3684df[_0x1528('0x9')](_0x1528('0x9a'),require(_0x1528('0x9b')));_0x3684df[_0x1528('0x9')]('/api/integrations/desk/configurations',require(_0x1528('0x9c')));_0x3684df[_0x1528('0x9')](_0x1528('0x9d'),require(_0x1528('0x9e')));_0x3684df[_0x1528('0x9')](_0x1528('0x9f'),require(_0x1528('0xa0')));_0x3684df['use']('/api/integrations/zoho/configurations',require(_0x1528('0xa1')));_0x3684df[_0x1528('0x9')](_0x1528('0xa2'),require(_0x1528('0xa3')));_0x3684df[_0x1528('0x9')]('/api/integrations/zendesk/accounts',require(_0x1528('0xa4')));_0x3684df[_0x1528('0x9')](_0x1528('0xa5'),require('./api/intZendeskConfiguration'));_0x3684df['use'](_0x1528('0xa6'),require('./api/intZendeskField'));_0x3684df['use'](_0x1528('0xa7'),require(_0x1528('0xa8')));_0x3684df[_0x1528('0x9')](_0x1528('0xa9'),require(_0x1528('0xaa')));_0x3684df[_0x1528('0x9')]('/api/integrations/freshdesk/fields',require(_0x1528('0xab')));_0x3684df[_0x1528('0x9')](_0x1528('0xac'),require(_0x1528('0xad')));_0x3684df[_0x1528('0x9')]('/api/integrations/vtiger/configurations',require(_0x1528('0xae')));_0x3684df[_0x1528('0x9')](_0x1528('0xaf'),require(_0x1528('0xb0')));_0x3684df[_0x1528('0x9')](_0x1528('0xb1'),require(_0x1528('0xb2')));_0x3684df[_0x1528('0x9')](_0x1528('0xb3'),require(_0x1528('0xb4')));_0x3684df[_0x1528('0x9')](_0x1528('0xb5'),require(_0x1528('0xb6')));_0x3684df[_0x1528('0x9')](_0x1528('0xb7'),require(_0x1528('0xb8')));_0x3684df[_0x1528('0x9')](_0x1528('0xb9'),require('./api/intDynamics365Configuration'));_0x3684df['use'](_0x1528('0xba'),require(_0x1528('0xbb')));_0x3684df[_0x1528('0x9')](_0x1528('0xbc'),require(_0x1528('0xbd')));_0x3684df['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x3684df['use'](_0x1528('0xbe'),require(_0x1528('0xbf')));_0x3684df[_0x1528('0x9')](_0x1528('0xc0'),require('./api/network'));_0x3684df['use'](_0x1528('0xc1'),require(_0x1528('0xc2')));_0x3684df['use'](_0x1528('0xc3'),require('./api/chatInternalMessage'));_0x3684df[_0x1528('0x9')](_0x1528('0xc4'),require(_0x1528('0xc5')));_0x3684df[_0x1528('0x9')](_0x1528('0xc6'),require('./api/jscriptyQuestionReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xc7'),require(_0x1528('0xc8')));_0x3684df[_0x1528('0x9')](_0x1528('0xc9'),require('./api/smsQueueReport'));_0x3684df[_0x1528('0x9')]('/api/square/reports',require('./api/squareReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xca'),require(_0x1528('0xcb')));_0x3684df['use'](_0x1528('0xcc'),require(_0x1528('0xcd')));_0x3684df[_0x1528('0x9')](_0x1528('0xce'),require(_0x1528('0xcf')));_0x3684df[_0x1528('0x9')](_0x1528('0xd0'),require(_0x1528('0xd1')));_0x3684df[_0x1528('0x9')](_0x1528('0xd2'),require(_0x1528('0xd3')));_0x3684df[_0x1528('0x9')]('/api/square/recordings',require(_0x1528('0xd4')));_0x3684df['use'](_0x1528('0xd5'),require(_0x1528('0xd6')));_0x3684df['use'](_0x1528('0xd7'),require('./api/team'));_0x3684df['use'](_0x1528('0xd8'),require(_0x1528('0xd9')));_0x3684df[_0x1528('0x9')](_0x1528('0xda'),require(_0x1528('0xdb')));_0x3684df[_0x1528('0x9')](_0x1528('0xdc'),require(_0x1528('0xdd')));_0x3684df[_0x1528('0x9')](_0x1528('0xde'),require('./api/attachment'));_0x3684df[_0x1528('0x9')](_0x1528('0xdf'),require(_0x1528('0xe0')));_0x3684df[_0x1528('0x9')]('/api/mail/reports/transfer',require(_0x1528('0xe1')));_0x3684df['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xe2'),require(_0x1528('0xe3')));_0x3684df[_0x1528('0x9')](_0x1528('0xe4'),require('./api/openchannelTransferReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xe5'),require('./api/smsTransferReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xe6'),require(_0x1528('0xe7')));_0x3684df[_0x1528('0x9')](_0x1528('0xe8'),require(_0x1528('0xe9')));_0x3684df[_0x1528('0x9')](_0x1528('0xea'),require(_0x1528('0xeb')));_0x3684df[_0x1528('0x9')](_0x1528('0xec'),require(_0x1528('0xed')));_0x3684df[_0x1528('0x9')](_0x1528('0xee'),require(_0x1528('0xef')));_0x3684df['use']('/api/userNotifications',require('./api/userNotification'));_0x3684df['use'](_0x1528('0xf0'),require(_0x1528('0xf1')));_0x3684df['use'](_0x1528('0xf2'),require('./api/whatsappApplication'));_0x3684df[_0x1528('0x9')](_0x1528('0xf3'),require('./api/whatsappInteraction'));_0x3684df[_0x1528('0x9')](_0x1528('0xf4'),require(_0x1528('0xf5')));_0x3684df[_0x1528('0x9')](_0x1528('0xf6'),require('./api/whatsappQueueReport'));_0x3684df[_0x1528('0x9')](_0x1528('0xf7'),require(_0x1528('0xf8')));_0x3684df[_0x1528('0x9')](_0x1528('0xf9'),require(_0x1528('0xfa')));_0x3684df[_0x1528('0x9')]('/api/cloudProviders',require(_0x1528('0xfb')));_0x3684df[_0x1528('0x9')]('/api/realtime',require(_0x1528('0xfc')));_0x3684df[_0x1528('0x9')]('/api/auth/local',require(_0x1528('0xfd')));_0x3684df[_0x1528('0x9')](_0x1528('0xfe'),require('./api/authGoogle'));_0x3684df[_0x1528('0x9')](_0x1528('0xff'),require('./api/authActiveDirectory'));_0x3684df[_0x1528('0x9')](_0x1528('0x100'),require('./api/jira'));_0x3684df[_0x1528('0x9')](_0x1528('0x101'),require(_0x1528('0x102')));_0x3684df['use'](_0x1528('0x103'),require(_0x1528('0x104')));_0x3684df[_0x1528('0x9')]('/api/system',require('./api/system'));_0x3684df[_0x1528('0x9')]('/api/pm2',require(_0x1528('0x105')));_0x3684df[_0x1528('0x9')](_0x1528('0x106'),require(_0x1528('0x107')));_0x3684df[_0x1528('0x9')](_0x1528('0x108'),express['static'](path[_0x1528('0x109')](config['root'],_0x1528('0x108'))));_0x3684df[_0x1528('0x9')](_0x1528('0x10a'),express[_0x1528('0x10b')](path[_0x1528('0x109')](config['root'],_0x1528('0x10a'))));_0x3684df['use'](_0x1528('0x10c'),express['static'](path['join'](config['root'],'/demo')));_0x3684df['use'](_0x1528('0x10d'),express[_0x1528('0x10b')](path[_0x1528('0x109')](config[_0x1528('0x10e')],'snippet',_0x1528('0x10f'))));_0x3684df['use'](_0x1528('0x110'),express['static'](path[_0x1528('0x109')](config['root'],_0x1528('0x111'))));_0x3684df[_0x1528('0x112')](_0x1528('0x113'))[_0x1528('0x114')](errors[0x194]);_0x3684df[_0x1528('0x112')]('/*')[_0x1528('0x114')](function(_0x47a2e6,_0x4d348d){_0x4d348d[_0x1528('0x115')](path[_0x1528('0x116')](_0x3684df[_0x1528('0x114')](_0x1528('0x117'))+_0x1528('0x118')));});};var sensitiveFields=[_0x1528('0x119'),_0x1528('0x11a'),'newPassword',_0x1528('0x11b'),_0x1528('0x11c'),_0x1528('0x11d'),'street',_0x1528('0x11e'),'mobile',_0x1528('0x11f'),_0x1528('0x120'),_0x1528('0x121'),_0x1528('0x122'),_0x1528('0x123'),_0x1528('0x124'),_0x1528('0x125'),_0x1528('0x126'),_0x1528('0x127'),_0x1528('0x128'),_0x1528('0x129'),_0x1528('0x12a'),_0x1528('0x12b'),'consumerKey',_0x1528('0x12c'),_0x1528('0x12d'),_0x1528('0x12e'),_0x1528('0x12f'),'exten',_0x1528('0x130'),'clientEmail',_0x1528('0x131'),_0x1528('0x132'),_0x1528('0x133'),_0x1528('0x134'),'user','pass','accountSid',_0x1528('0x135'),'dsn',_0x1528('0x136'),_0x1528('0x137'),'oldPassword'];function maskSensitiveData(_0x21fca6){var _0x59df93=/(?!^)[\s\S](?!$)/g;if(!_[_0x1528('0x138')](_0x21fca6))return;for(var _0xaa5c61 in _0x21fca6){if(_[_0x1528('0x139')](_0x21fca6[_0xaa5c61])){for(var _0x31761a=0x0;_0x31761a<_0x21fca6[_0xaa5c61]['length'];_0x31761a++){maskSensitiveData(_0x21fca6[_0xaa5c61][_0x31761a]);}}else if(_[_0x1528('0x138')](_0x21fca6[_0xaa5c61])){maskSensitiveData(_0x21fca6[_0xaa5c61]);}else if(_[_0x1528('0x13a')](_0x21fca6[_0xaa5c61])){_0x21fca6[_0xaa5c61]=_0x21fca6[_0xaa5c61][_0x1528('0x13b')](/{{{/g,_0x1528('0x13c'))['replace'](/}}}/g,_0x1528('0x13d'))[_0x1528('0x13b')](/{{/g,'@{')[_0x1528('0x13b')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0xaa5c61)){_0x21fca6[_0xaa5c61]=_0x21fca6[_0xaa5c61][_0x1528('0x13b')](_0x59df93,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 29f680b..47eca1e 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1250=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc'];(function(_0x2f5fbc,_0x5c1fb4){var _0x55a581=function(_0x3e8ba5){while(--_0x3e8ba5){_0x2f5fbc['push'](_0x2f5fbc['shift']());}};_0x55a581(++_0x5c1fb4);}(_0x1250,0x18a));var _0x0125=function(_0x36d1f3,_0x56a4e2){_0x36d1f3=_0x36d1f3-0x0;var _0x187ba2=_0x1250[_0x36d1f3];return _0x187ba2;};'use strict';var jayson=require(_0x0125('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x0125('0x1'));exports['listen']=function(){return new BPromise(function(_0x26aa99,_0x31a98e){var _0x45942c={};_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x3')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/voiceExtension/voiceExtension.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x4')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/voiceRecording/voiceRecording.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x5')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x6')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x7')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x8')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x9')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0xa')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0xb')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0xc')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0xd')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0xe')));_0x45942c=_['merge'](_0x45942c,require('../api/mailInteraction/mailInteraction.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0xf')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x10')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x11')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/faxAccount/faxAccount.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x12')));_0x45942c=_['merge'](_0x45942c,require('../api/faxInteraction/faxInteraction.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x13')));_0x45942c=_['merge'](_0x45942c,require('../api/faxQueue/faxQueue.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x14')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x15')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/smsInteraction/smsInteraction.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x16')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x17')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x18')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x19')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x1a')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x1b')));_0x45942c=_['merge'](_0x45942c,require('../api/chatMessage/chatMessage.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x1c')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x1d')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x1e')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x1f')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x20')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x21')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/interval/interval.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x22')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x23')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x24')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x25')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/variable/variable.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x26')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x27')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x28')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x29')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2a')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2b')));_0x45942c=_['merge'](_0x45942c,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2c')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/squareReport/squareReport.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2d')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2e')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x2f')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x30')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x31')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x32')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x33')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x34')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x35')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x36')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x37')));_0x45942c=_['merge'](_0x45942c,require(_0x0125('0x38')));_0x45942c=_[_0x0125('0x2')](_0x45942c,require(_0x0125('0x39')));var _0x48170e=jayson[_0x0125('0x3a')](_0x45942c)['http']();var _0x314483=config['rpc'][_0x0125('0x3b')]||config[_0x0125('0x3b')]+0x1;var _0x1380c8=config['rpc']['ip']||'localhost';_0x48170e['on'](_0x0125('0x3c'),function(_0x2a80a1){return _0x31a98e(_0x2a80a1);});_0x48170e[_0x0125('0x3d')](_0x314483,_0x1380c8,function(){console[_0x0125('0x3e')](_0x0125('0x3f'),_0x1380c8,_0x314483);require(_0x0125('0x40'))[_0x0125('0x41')]();return _0x26aa99(_0x0125('0x42')+_0x1380c8+':'+_0x314483);});});}; \ No newline at end of file +var _0x2d89=['../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/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.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/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc'];(function(_0x70ee89,_0x190453){var _0x34d056=function(_0x170797){while(--_0x170797){_0x70ee89['push'](_0x70ee89['shift']());}};_0x34d056(++_0x190453);}(_0x2d89,0x15e));var _0x92d8=function(_0x140e71,_0x378d3f){_0x140e71=_0x140e71-0x0;var _0x561efb=_0x2d89[_0x140e71];return _0x561efb;};'use strict';var jayson=require(_0x92d8('0x0'));var BPromise=require(_0x92d8('0x1'));var _=require(_0x92d8('0x2'));var config=require(_0x92d8('0x3'));exports[_0x92d8('0x4')]=function(){return new BPromise(function(_0x38ee75,_0x3ce0bd){var _0xf17a8f={};_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/user/user.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x6')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x7')));_0xf17a8f=_['merge'](_0xf17a8f,require('../api/voiceRecording/voiceRecording.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x8')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x9')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0xa')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/memberReport/memberReport.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0xb')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0xc')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0xd')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0xe')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0xf')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x10')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x11')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x12')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x13')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x14')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x15')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x16')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x17')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/faxQueue/faxQueue.rpc'));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x18')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x19')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x1a')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x1b')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x1c')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x1d')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/openchannelMessage/openchannelMessage.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x1e')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0xf17a8f=_['merge'](_0xf17a8f,require('../api/chatInteraction/chatInteraction.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x1f')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x20')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x21')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x22')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x23')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x24')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x25')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x26')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x27')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x28')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x29')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2a')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2b')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2c')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2d')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2e')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x2f')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x30')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x31')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x32')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x33')));_0xf17a8f=_['merge'](_0xf17a8f,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x34')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x35')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x36')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/smsQueueReport/smsQueueReport.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x37')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x38')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x39')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x3a')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require('../api/squareProject/squareProject.rpc'));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x3b')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x3c')));_0xf17a8f=_['merge'](_0xf17a8f,require('../api/campaign/campaign.rpc'));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x3d')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x3e')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x3f')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x40')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x41')));_0xf17a8f=_[_0x92d8('0x5')](_0xf17a8f,require(_0x92d8('0x42')));_0xf17a8f=_['merge'](_0xf17a8f,require(_0x92d8('0x43')));var _0x30f440=jayson[_0x92d8('0x44')](_0xf17a8f)[_0x92d8('0x45')]();var _0x36e2e1=config[_0x92d8('0x46')][_0x92d8('0x47')]||config[_0x92d8('0x47')]+0x1;var _0x4534d9=config[_0x92d8('0x46')]['ip']||'localhost';_0x30f440['on']('error',function(_0x5c2606){return _0x3ce0bd(_0x5c2606);});_0x30f440[_0x92d8('0x4')](_0x36e2e1,_0x4534d9,function(){console[_0x92d8('0x48')](_0x92d8('0x49'),_0x4534d9,_0x36e2e1);require(_0x92d8('0x4a'))[_0x92d8('0x4b')]();return _0x38ee75(_0x92d8('0x4c')+_0x4534d9+':'+_0x36e2e1);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 8e6db3e..546e2f6 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 _0x5d58=['SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','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','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','command','sync','prototype','answer','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic'];(function(_0x30720e,_0x55753f){var _0x5674ac=function(_0x32b76f){while(--_0x32b76f){_0x30720e['push'](_0x30720e['shift']());}};_0x5674ac(++_0x55753f);}(_0x5d58,0x187));var _0x85d5=function(_0x28b6e3,_0x2a17ca){_0x28b6e3=_0x28b6e3-0x0;var _0x295452=_0x5d58[_0x28b6e3];return _0x295452;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require('events')['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x85d5('0x0'));function AGIChannel(_0x1eff3b){var _0x53ca58=this,_0x1469fc=new AGIReply(),_0x30bfe8=![],_0x54207b={};EventEmitter[_0x85d5('0x1')](_0x53ca58);_0x1eff3b[_0x85d5('0x2')](_0x85d5('0x3'));_0x1eff3b[_0x85d5('0x4')](0x8*0x3c*0x3c*0x3e8);_0x1469fc['setEncoding'](_0x85d5('0x3'));_0x1469fc['on'](_0x85d5('0x5'),function(_0x4ca293){for(var _0x4326a8 in _0x4ca293){_0x53ca58[_0x4326a8]=_0x4ca293[_0x4326a8];}_0x53ca58['emit'](_0x85d5('0x6'));});_0x1469fc['on'](_0x85d5('0x7'),function(_0x258f0c){if(_0x258f0c['toLowerCase']()=='hangup'){_0x53ca58['emit'](_0x85d5('0x8'));return;}if(_0x258f0c[_0x85d5('0x9')](0x0,0xb)==_0x85d5('0xa')){_0x30bfe8=!![];}if(_0x30bfe8){_0x54207b['rx']+=_0x258f0c+'\x0a';if(_0x258f0c[_0x85d5('0xb')](_0x85d5('0xc'))!=-0x1){_0x30bfe8=![];}}else{_0x54207b['rx']=_0x258f0c;}if(_0x30bfe8){return;}if(typeof _0x54207b['cb']==_0x85d5('0xd')){var _0x31409d=_0x54207b['rx']['substring'](0x0,0x3),_0x5897af=null,_0x4bbf2a=null;_0x31409d=parseInt(_0x31409d);if(isNaN(_0x31409d)){_0x54207b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x85d5('0xe')});return;}if(_0x31409d!=0xc8){_0x54207b['cb'](null,{'code':_0x31409d,'result':-0x1,'extra':'KO'});return;}_0x5897af=_0x54207b['rx'][_0x85d5('0x9')](0x4)[_0x85d5('0xf')](_0x85d5('0x10'),'');if(_0x5897af[_0x85d5('0x11')]('\x20')!=-0x1){_0x5897af=_0x5897af[_0x85d5('0x12')](0x0,_0x5897af[_0x85d5('0x11')]('\x20'));}if(_['startsWith'](_0x5897af,'-1')){_0x5897af=parseInt(_0x5897af);}_0x4bbf2a=_0x54207b['rx'][_0x85d5('0x13')]('\x20');if(_0x4bbf2a[_0x85d5('0x14')]==0x3){_0x4bbf2a=_0x4bbf2a[0x2][_0x85d5('0x9')](0x1,_0x4bbf2a[0x2][_0x85d5('0x14')]-0x1);}else if(_0x4bbf2a[_0x85d5('0x14')]>0x3){var _0x3dc83c=/\((.+)\)/;var _0x2dbf13=_0x54207b['rx'][_0x85d5('0x15')](_0x3dc83c);if(_0x2dbf13){_0x4bbf2a=_0x2dbf13[0x1];}else{_0x4bbf2a=null;}}else{_0x4bbf2a=null;}_0x54207b['cb'](null,{'code':_0x31409d,'result':_0x5897af,'extra':_0x4bbf2a});}});_0x1eff3b['on'](_0x85d5('0x16'),function(_0x17acb0){_0x53ca58[_0x85d5('0x17')](_0x85d5('0x16'),new AGIError(_0x85d5('0x18'),_0x17acb0[_0x85d5('0x19')]));});_0x1eff3b['on'](_0x85d5('0x1a'),function(){_0x53ca58[_0x85d5('0x17')](_0x85d5('0x1a'),new AGIError(_0x85d5('0x1b')));});_0x1eff3b['on']('timeout',function(){_0x53ca58[_0x85d5('0x17')](_0x85d5('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1eff3b[_0x85d5('0x1d')]();});_0x1eff3b[_0x85d5('0x1e')](_0x1469fc);this['command']=function(_0x58290b,_0x347337){var _0x58290b=_0x58290b||'',_0x347337=typeof _0x347337=='function'?_0x347337:new Function();_0x54207b={'tx':_0x58290b,'rx':'','cb':_0x347337};_0x1eff3b[_0x85d5('0x1f')](_0x58290b+'\x0a');},this[_0x85d5('0x1a')]=function(){_0x1eff3b['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0xf03669){return this[_0x85d5('0x20')][_0x85d5('0x21')](this,_0xf03669);};AGIChannel[_0x85d5('0x22')][_0x85d5('0x23')]=function(){return this[_0x85d5('0x24')]('ANSWER');};AGIChannel[_0x85d5('0x22')]['getData']=function(_0x1b3fae,_0x1ed432,_0x233ccd){_0x1b3fae=_0x1b3fae===undefined?'beep':_0x1b3fae;_0x1ed432=_0x1ed432===undefined?'5':_0x1ed432;_0x233ccd=_0x233ccd===undefined?'1':_0x233ccd;return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x26'),_0x1b3fae,_0x1ed432*0x3e8,_0x233ccd));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x27')]=function(_0x56031f){_0x56031f=_0x56031f||_0x85d5('0x28');return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x29'),_0x56031f));};AGIChannel[_0x85d5('0x22')]['exec']=function(_0x539dc9,_0x2ce7a9){if(_[_0x85d5('0x2a')](_0x2ce7a9)){return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x2b'),_0x539dc9,_0x2ce7a9['join'](',')));}return this[_0x85d5('0x24')](util[_0x85d5('0x25')]('EXEC\x20%s\x20%s',_0x539dc9,_0x2ce7a9));};AGIChannel['prototype'][_0x85d5('0x2c')]=function(_0x153713){return this['sendRequest'](util[_0x85d5('0x25')]('SET\x20CONTEXT\x20%s',_0x153713));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x2d')]=function(_0x5e426d){return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x2e'),_0x5e426d));};AGIChannel[_0x85d5('0x22')]['setPriority']=function(_0x4b09f0){return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x2f'),_0x4b09f0));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x8')]=function(){return this[_0x85d5('0x24')](_0x85d5('0x30'));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x31')]=function(_0x539edd,_0x5a15fd){var _0x27308c=_[_0x85d5('0x32')](_0x5a15fd)||_[_0x85d5('0x33')](_0x5a15fd)?_0x5a15fd[_0x85d5('0x34')]():_0x5a15fd;return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x35'),_0x539edd,_0x27308c?_0x27308c[_0x85d5('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x36')]=function(_0x11ed28,_0x1fdb00){return this['sendRequest'](util[_0x85d5('0x25')](_0x85d5('0x37'),_0x11ed28,_0x1fdb00));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x38')]=function(_0x4d4c12,_0x34caed){return this['sendRequest'](util['format'](_0x85d5('0x39'),_0x4d4c12,_0x34caed));};AGIChannel['prototype'][_0x85d5('0x3a')]=function(_0x5ddba7,_0x56f3de){return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x3b'),_0x5ddba7,_0x56f3de));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x3c')]=function(_0x556800,_0x519ced,_0x276aaf){_0x519ced=_0x519ced||this[_0x85d5('0x3d')];_0x276aaf=_0x276aaf||0x1;this[_0x85d5('0x2c')](_0x556800);this[_0x85d5('0x2d')](_0x519ced);this[_0x85d5('0x3e')](_0x276aaf);return this[_0x85d5('0x27')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x556800,_0x519ced,_0x276aaf));};AGIChannel[_0x85d5('0x22')]['getVariable']=function(_0xfbf466){return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x3f'),_0xfbf466));};AGIChannel[_0x85d5('0x22')]['recordFile']=function(_0x4f1fc6,_0x34a42b,_0x3325aa,_0x1f699e,_0x45a6cc,_0x2fe3e0){_0x34a42b=_0x34a42b||_0x85d5('0x40');_0x3325aa=_0x3325aa||'';_0x1f699e=_0x1f699e===undefined?-0x1:_0x1f699e==='-1'?-0x1:_0x1f699e*0x3e8;_0x45a6cc=_0x45a6cc===undefined?'':'s='+_0x45a6cc;_0x2fe3e0=_0x2fe3e0?_0x85d5('0x41'):'';return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x42'),_0x4f1fc6,_0x34a42b,_0x3325aa,_0x1f699e,_0x2fe3e0,_0x45a6cc));};AGIChannel[_0x85d5('0x22')][_0x85d5('0x43')]=function(_0x2c3f18,_0x1100f4){_0x1100f4=_0x1100f4||'';return this[_0x85d5('0x24')](util[_0x85d5('0x25')](_0x85d5('0x44'),_0x2c3f18,_0x1100f4));};AGIChannel['prototype']['agi']=function(_0x3d12c0){return this[_0x85d5('0x45')](_0x85d5('0x46'),_0x3d12c0);};AGIChannel[_0x85d5('0x22')][_0x85d5('0x47')]=function(_0xe34edd){return this['exec'](_0x85d5('0x48'),_0xe34edd);};AGIChannel['prototype']['error']=function(_0x1cc44b,_0x13ab32){this[_0x85d5('0x27')](util[_0x85d5('0x25')](_0x85d5('0x49'),_0x1cc44b['id'],_0x1cc44b['label'],_0x13ab32));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x85d5('0x4a')]=AGIChannel; \ No newline at end of file +var _0x4186=['hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','pipe','command','inherits','prototype','sync','answer','sendRequest','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','exports','util','lodash','events','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','headers','emit','ready','line'];(function(_0x414d57,_0x511678){var _0x228b45=function(_0x467cb5){while(--_0x467cb5){_0x414d57['push'](_0x414d57['shift']());}};_0x228b45(++_0x511678);}(_0x4186,0x11f));var _0x6418=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x4186[_0x207811];return _0x170d56;};'use strict';var util=require(_0x6418('0x0'));var _=require(_0x6418('0x1'));var EventEmitter=require(_0x6418('0x2'))[_0x6418('0x3')];var AGIReply=require(_0x6418('0x4'));var AGIError=require('./error');function AGIChannel(_0x5040de){var _0xcdf6ce=this,_0x30821c=new AGIReply(),_0x3b1670=![],_0x2bb490={};EventEmitter[_0x6418('0x5')](_0xcdf6ce);_0x5040de['setEncoding'](_0x6418('0x6'));_0x5040de[_0x6418('0x7')](0x8*0x3c*0x3c*0x3e8);_0x30821c[_0x6418('0x8')]('utf8');_0x30821c['on'](_0x6418('0x9'),function(_0x568cae){for(var _0x152c81 in _0x568cae){_0xcdf6ce[_0x152c81]=_0x568cae[_0x152c81];}_0xcdf6ce[_0x6418('0xa')](_0x6418('0xb'));});_0x30821c['on'](_0x6418('0xc'),function(_0x47cd02){if(_0x47cd02['toLowerCase']()==_0x6418('0xd')){_0xcdf6ce[_0x6418('0xa')](_0x6418('0xd'));return;}if(_0x47cd02[_0x6418('0xe')](0x0,0xb)=='520-Invalid'){_0x3b1670=!![];}if(_0x3b1670){_0x2bb490['rx']+=_0x47cd02+'\x0a';if(_0x47cd02[_0x6418('0xf')](_0x6418('0x10'))!=-0x1){_0x3b1670=![];}}else{_0x2bb490['rx']=_0x47cd02;}if(_0x3b1670){return;}if(typeof _0x2bb490['cb']==_0x6418('0x11')){var _0xce71d3=_0x2bb490['rx'][_0x6418('0xe')](0x0,0x3),_0x2e30c6=null,_0x5cd5a6=null;_0xce71d3=parseInt(_0xce71d3);if(isNaN(_0xce71d3)){_0x2bb490['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6418('0x12')});return;}if(_0xce71d3!=0xc8){_0x2bb490['cb'](null,{'code':_0xce71d3,'result':-0x1,'extra':'KO'});return;}_0x2e30c6=_0x2bb490['rx'][_0x6418('0xe')](0x4)[_0x6418('0x13')](_0x6418('0x14'),'');if(_0x2e30c6[_0x6418('0x15')]('\x20')!=-0x1){_0x2e30c6=_0x2e30c6[_0x6418('0x16')](0x0,_0x2e30c6[_0x6418('0x15')]('\x20'));}if(_['startsWith'](_0x2e30c6,'-1')){_0x2e30c6=parseInt(_0x2e30c6);}_0x5cd5a6=_0x2bb490['rx'][_0x6418('0x17')]('\x20');if(_0x5cd5a6[_0x6418('0x18')]==0x3){_0x5cd5a6=_0x5cd5a6[0x2][_0x6418('0xe')](0x1,_0x5cd5a6[0x2][_0x6418('0x18')]-0x1);}else if(_0x5cd5a6[_0x6418('0x18')]>0x3){var _0x1dcbf0=/\((.+)\)/;var _0x128131=_0x2bb490['rx']['match'](_0x1dcbf0);if(_0x128131){_0x5cd5a6=_0x128131[0x1];}else{_0x5cd5a6=null;}}else{_0x5cd5a6=null;}_0x2bb490['cb'](null,{'code':_0xce71d3,'result':_0x2e30c6,'extra':_0x5cd5a6});}});_0x5040de['on'](_0x6418('0x19'),function(_0x122b23){_0xcdf6ce[_0x6418('0xa')](_0x6418('0x19'),new AGIError(_0x6418('0x1a'),_0x122b23[_0x6418('0x1b')]));});_0x5040de['on'](_0x6418('0x1c'),function(){_0xcdf6ce[_0x6418('0xa')](_0x6418('0x1c'),new AGIError(_0x6418('0x1d')));});_0x5040de['on'](_0x6418('0x1e'),function(){_0xcdf6ce[_0x6418('0xa')](_0x6418('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5040de['destroy']();});_0x5040de[_0x6418('0x1f')](_0x30821c);this[_0x6418('0x20')]=function(_0xcedfb6,_0x12c11a){var _0xcedfb6=_0xcedfb6||'',_0x12c11a=typeof _0x12c11a==_0x6418('0x11')?_0x12c11a:new Function();_0x2bb490={'tx':_0xcedfb6,'rx':'','cb':_0x12c11a};_0x5040de['write'](_0xcedfb6+'\x0a');},this[_0x6418('0x1c')]=function(){_0x5040de['destroy']();};}util[_0x6418('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x6418('0x22')]['sendRequest']=function(_0x253227){return this[_0x6418('0x20')][_0x6418('0x23')](this,_0x253227);};AGIChannel['prototype'][_0x6418('0x24')]=function(){return this[_0x6418('0x25')](_0x6418('0x26'));};AGIChannel[_0x6418('0x22')]['getData']=function(_0x17eff2,_0x30a9e0,_0x193d2){_0x17eff2=_0x17eff2===undefined?_0x6418('0x27'):_0x17eff2;_0x30a9e0=_0x30a9e0===undefined?'5':_0x30a9e0;_0x193d2=_0x193d2===undefined?'1':_0x193d2;return this[_0x6418('0x25')](util[_0x6418('0x28')](_0x6418('0x29'),_0x17eff2,_0x30a9e0*0x3e8,_0x193d2));};AGIChannel[_0x6418('0x22')][_0x6418('0x2a')]=function(_0x1ad401){_0x1ad401=_0x1ad401||_0x6418('0x2b');return this[_0x6418('0x25')](util[_0x6418('0x28')]('VERBOSE\x20\x22%s\x22',_0x1ad401));};AGIChannel[_0x6418('0x22')][_0x6418('0x2c')]=function(_0x39ba75,_0x44f531){if(_[_0x6418('0x2d')](_0x44f531)){return this['sendRequest'](util[_0x6418('0x28')](_0x6418('0x2e'),_0x39ba75,_0x44f531['join'](',')));}return this[_0x6418('0x25')](util[_0x6418('0x28')](_0x6418('0x2e'),_0x39ba75,_0x44f531));};AGIChannel['prototype'][_0x6418('0x2f')]=function(_0x13c756){return this[_0x6418('0x25')](util['format'](_0x6418('0x30'),_0x13c756));};AGIChannel[_0x6418('0x22')][_0x6418('0x31')]=function(_0x30b064){return this[_0x6418('0x25')](util['format'](_0x6418('0x32'),_0x30b064));};AGIChannel[_0x6418('0x22')]['setPriority']=function(_0x378c2e){return this[_0x6418('0x25')](util[_0x6418('0x28')](_0x6418('0x33'),_0x378c2e));};AGIChannel[_0x6418('0x22')][_0x6418('0xd')]=function(){return this['sendRequest'](_0x6418('0x34'));};AGIChannel['prototype']['setVariable']=function(_0x1ff6f7,_0x3e2bc1){var _0x3cf894=_[_0x6418('0x35')](_0x3e2bc1)||_[_0x6418('0x36')](_0x3e2bc1)?_0x3e2bc1[_0x6418('0x37')]():_0x3e2bc1;return this[_0x6418('0x25')](util['format'](_0x6418('0x38'),_0x1ff6f7,_0x3cf894?_0x3cf894[_0x6418('0x37')]()[_0x6418('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x6418('0x39')]=function(_0x4ef1fa,_0x36987b){return this[_0x6418('0x25')](util[_0x6418('0x28')](_0x6418('0x3a'),_0x4ef1fa,_0x36987b));};AGIChannel[_0x6418('0x22')]['sayDigits']=function(_0x41580b,_0x454997){return this['sendRequest'](util[_0x6418('0x28')](_0x6418('0x3b'),_0x41580b,_0x454997));};AGIChannel[_0x6418('0x22')]['sayPhonetic']=function(_0x4821ba,_0x294893){return this[_0x6418('0x25')](util[_0x6418('0x28')](_0x6418('0x3c'),_0x4821ba,_0x294893));};AGIChannel[_0x6418('0x22')]['continueAt']=function(_0x3a0f12,_0x3ac4e4,_0x1f7915){_0x3ac4e4=_0x3ac4e4||this[_0x6418('0x3d')];_0x1f7915=_0x1f7915||0x1;this[_0x6418('0x2f')](_0x3a0f12);this[_0x6418('0x31')](_0x3ac4e4);this[_0x6418('0x3e')](_0x1f7915);return this[_0x6418('0x2a')](util[_0x6418('0x28')](_0x6418('0x3f'),_0x3a0f12,_0x3ac4e4,_0x1f7915));};AGIChannel[_0x6418('0x22')][_0x6418('0x40')]=function(_0x5430e1){return this[_0x6418('0x25')](util['format'](_0x6418('0x41'),_0x5430e1));};AGIChannel[_0x6418('0x22')]['recordFile']=function(_0x491c8d,_0x46039d,_0x4bdf9d,_0x4e6b9d,_0x4f9d12,_0x2912e6){_0x46039d=_0x46039d||_0x6418('0x42');_0x4bdf9d=_0x4bdf9d||'';_0x4e6b9d=_0x4e6b9d===undefined?-0x1:_0x4e6b9d==='-1'?-0x1:_0x4e6b9d*0x3e8;_0x4f9d12=_0x4f9d12===undefined?'':'s='+_0x4f9d12;_0x2912e6=_0x2912e6?_0x6418('0x43'):'';return this[_0x6418('0x25')](util[_0x6418('0x28')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x491c8d,_0x46039d,_0x4bdf9d,_0x4e6b9d,_0x2912e6,_0x4f9d12));};AGIChannel[_0x6418('0x22')][_0x6418('0x44')]=function(_0x1e27ad,_0x192c65){_0x192c65=_0x192c65||'';return this['sendRequest'](util[_0x6418('0x28')](_0x6418('0x45'),_0x1e27ad,_0x192c65));};AGIChannel[_0x6418('0x22')][_0x6418('0x46')]=function(_0x125177){return this[_0x6418('0x2c')](_0x6418('0x47'),_0x125177);};AGIChannel[_0x6418('0x22')][_0x6418('0x48')]=function(_0x21f793){return this['exec'](_0x6418('0x49'),_0x21f793);};AGIChannel[_0x6418('0x22')]['error']=function(_0x163cf6,_0xf255c0){this[_0x6418('0x2a')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x163cf6['id'],_0x163cf6['label'],_0xf255c0));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6418('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index aa51af8..94caa0a 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 _0x62b4=['format','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x4c914a,_0x4e5665){var _0x446d9b=function(_0x29d0c2){while(--_0x29d0c2){_0x4c914a['push'](_0x4c914a['shift']());}};_0x446d9b(++_0x4e5665);}(_0x62b4,0xe3));var _0x462b=function(_0x30aadd,_0x20a265){_0x30aadd=_0x30aadd-0x0;var _0x428865=_0x62b4[_0x30aadd];return _0x428865;};'use strict';var util=require(_0x462b('0x0'));var error={'E_AGI_UNDEFINED':_0x462b('0x1'),'E_AGI_ARGUMENT_PORT':_0x462b('0x2'),'E_AGI_SERVER_ERROR':_0x462b('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x462b('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x462b('0x5'),'E_AGI_SOCKET_ERROR':_0x462b('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x462b('0x7'),'E_AGI_COMMAND_EMPTY':_0x462b('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x462b('0x9'),'E_AGI_IVR_ENTRY':_0x462b('0xa')};function AGIError(_0x9a58da){var _0x9a58da=_0x9a58da||null,_0x203ea1=_0x203ea1||[],_0xc61c68=0x1,_0x39aba2='';if(!error[_0x9a58da]){_0x9a58da=_0x462b('0xb');}_0x203ea1[_0x462b('0xc')](error[_0x9a58da]);while(arguments[_0xc61c68]){_0x203ea1[_0x462b('0xc')](arguments[_0xc61c68]);_0xc61c68++;}_0x39aba2=util[_0x462b('0xd')]['apply'](util,_0x203ea1);this[_0x462b('0xe')]=_0x39aba2;this[_0x462b('0xf')]=_0x9a58da;}module['exports']=AGIError; \ No newline at end of file +var _0x3a37=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.'];(function(_0x21f9b5,_0x2c3da5){var _0x3172eb=function(_0x1c1811){while(--_0x1c1811){_0x21f9b5['push'](_0x21f9b5['shift']());}};_0x3172eb(++_0x2c3da5);}(_0x3a37,0x17e));var _0x73a3=function(_0x36a5d0,_0x477b0f){_0x36a5d0=_0x36a5d0-0x0;var _0x2b0076=_0x3a37[_0x36a5d0];return _0x2b0076;};'use strict';var util=require(_0x73a3('0x0'));var error={'E_AGI_UNDEFINED':_0x73a3('0x1'),'E_AGI_ARGUMENT_PORT':_0x73a3('0x2'),'E_AGI_SERVER_ERROR':_0x73a3('0x3'),'E_AGI_SERVER_CLOSE':_0x73a3('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x73a3('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x73a3('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x73a3('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x73a3('0x8'),'E_AGI_IVR_ENTRY':_0x73a3('0x9')};function AGIError(_0x2f60ba){var _0x2f60ba=_0x2f60ba||null,_0x5d0b52=_0x5d0b52||[],_0x3483f6=0x1,_0x149489='';if(!error[_0x2f60ba]){_0x2f60ba=_0x73a3('0xa');}_0x5d0b52[_0x73a3('0xb')](error[_0x2f60ba]);while(arguments[_0x3483f6]){_0x5d0b52[_0x73a3('0xb')](arguments[_0x3483f6]);_0x3483f6++;}_0x149489=util[_0x73a3('0xc')]['apply'](util,_0x5d0b52);this['message']=_0x149489;this[_0x73a3('0xd')]=_0x2f60ba;}module[_0x73a3('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 71d512b..03cd0d9 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 _0xb199=['addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','prototype','addVertex'];(function(_0x3ab4ab,_0x54847c){var _0x303ff7=function(_0x9fc477){while(--_0x9fc477){_0x3ab4ab['push'](_0x3ab4ab['shift']());}};_0x303ff7(++_0x54847c);}(_0xb199,0x156));var _0x9b19=function(_0x323757,_0x186343){_0x323757=_0x323757-0x0;var _0x340f53=_0xb199[_0x323757];return _0x340f53;};'use strict';var _=require(_0x9b19('0x0'));var logger=require(_0x9b19('0x1'))(_0x9b19('0x2'));var verticesWithRetry=[_0x9b19('0x3'),_0x9b19('0x4'),_0x9b19('0x5')];var Graph=function(){this[_0x9b19('0x6')]={};this[_0x9b19('0x7')]={};this['numberOfEdges']=0x0;};Graph[_0x9b19('0x8')][_0x9b19('0x9')]=function(_0x96d978){this[_0x9b19('0x6')][_0x96d978['id']]=_0x96d978;this[_0x9b19('0x7')][_0x96d978['id']]=[];};Graph['prototype'][_0x9b19('0xa')]=function(_0x4ecc07,_0x284b5a,_0x5d5a1b){this[_0x9b19('0x7')][_0x4ecc07][_0x9b19('0xb')]({'target':_0x284b5a,'condition':_0x5d5a1b});this[_0x9b19('0xc')]+=0x1;};Graph[_0x9b19('0x8')][_0x9b19('0xd')]=function(){return _[_0x9b19('0xd')](this[_0x9b19('0x6')]);};Graph[_0x9b19('0x8')][_0x9b19('0xe')]=function(){return this[_0x9b19('0xc')];};Graph[_0x9b19('0x8')][_0x9b19('0xf')]=function(_0x1f1982){return this[_0x9b19('0x6')][_0x1f1982];};Graph[_0x9b19('0x8')][_0x9b19('0x10')]=function(_0x4b53b2,_0x585e3a){if(!this['vertices'][_0x4b53b2]){return logger[_0x9b19('0x11')](_0x9b19('0x12'));}var _0x46154c=_0x585e3a(this['vertices'][_0x4b53b2]);if(!_0x46154c){return logger[_0x9b19('0x11')](_0x9b19('0x13'));}if(this[_0x9b19('0x7')][_0x4b53b2][_0x9b19('0x14')]===0x0){return logger[_0x9b19('0x11')]('no\x20edge/s\x20available');}for(var _0x430217=0x0,_0x3291f5=[],_0x5974dc=![];_0x430217\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','agicommand','code','isUndefined','result','toString','finally','response','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','syncho','moment','../../config/environment','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','error','[%s]\x20%s','[ERROR]\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','evtHangup','toJson','mxGraphModel','retry','maxRetry','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','getSquareProject','catch','createSquareReport'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0x5d03,0x1e4));var _0x35d0=function(_0x46c7ef,_0x59f839){_0x46c7ef=_0x46c7ef-0x0;var _0x45fd75=_0x5d03[_0x46c7ef];return _0x45fd75;};'use strict';var parser=require(_0x35d0('0x0'));var _=require('lodash');var syncho=require(_0x35d0('0x1'));var util=require('util');var moment=require(_0x35d0('0x2'));var config=require(_0x35d0('0x3'));var logger=require('../../config/logger')(_0x35d0('0x4'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x35d0('0x5'));var Graph=require(_0x35d0('0x6'));var Vertices=require(_0x35d0('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x35d0('0x4')]=_[_0x35d0('0x8')](config[_0x35d0('0x4')],{'ip':_0x35d0('0x9'),'port':0x11dd});function connectionHandler(_0x680e47){process[_0x35d0('0xa')](function(){syncho(function(){try{setChannelVariables(_0x680e47);agiHandler(_0x680e47);}catch(_0x168e7f){logger['error'](_0x168e7f[_0x35d0('0xb')]);}});});}function listeningHandler(){console['log'](_0x35d0('0xc'),config[_0x35d0('0x4')]['port']);logger[_0x35d0('0xd')](util[_0x35d0('0xe')](_0x35d0('0xf'),config['agi']['ip'],config[_0x35d0('0x4')][_0x35d0('0x10')]));}function errorHandler(_0x556b04){if(_0x556b04&&_0x556b04[_0x35d0('0x11')]&&_0x556b04['message']){logger[_0x35d0('0x12')](util[_0x35d0('0xe')](_0x35d0('0x13'),_0x556b04[_0x35d0('0x11')],_0x556b04['message']));}else{logger[_0x35d0('0x12')](util[_0x35d0('0xe')](_0x35d0('0x14'),_0x556b04[_0x35d0('0xb')]));}}function closeHandler(){logger['info'](util[_0x35d0('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x35d0('0x15')],this[_0x35d0('0x16')],this[_0x35d0('0x17')],this['dnid'],this[_0x35d0('0x18')]));try{createSquareReport(this);}catch(_0x484117){logger[_0x35d0('0x12')](_0x484117[_0x35d0('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x35d0('0xe')](_0x35d0('0x19'),this[_0x35d0('0x15')],this[_0x35d0('0x16')],this[_0x35d0('0x17')],this[_0x35d0('0x1a')],this[_0x35d0('0x18')]));}function hangupHandler(){logger['info'](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x35d0('0x15')],this[_0x35d0('0x16')],this[_0x35d0('0x17')],this[_0x35d0('0x1a')],this[_0x35d0('0x18')]));this[_0x35d0('0x1b')]=!![];}function getRoot(_0x2b07fe){return parser[_0x35d0('0x1c')](_0x2b07fe,{'object':!![]})[_0x35d0('0x1d')]['root'];}function addVertex(_0x2599fa,_0x43f9b0,_0x5f42a8){_0x43f9b0['agicommand']=_0x5f42a8;if(_0x43f9b0['hasOwnProperty'](_0x35d0('0x1e'))){_0x43f9b0[_0x35d0('0x1f')]=parseInt(_0x43f9b0[_0x35d0('0x1e')],0xa);}_0x2599fa['addVertex'](_[_0x35d0('0x20')](_0x43f9b0,_0x35d0('0x21')));}function initGraph(_0x5b0c2a,_0x1ff835){var _0x5d5b03=new Graph();for(var _0x2f9dd1 in _0x5b0c2a){if(_0x5b0c2a[_0x35d0('0x22')](_0x2f9dd1)){if(_[_0x35d0('0x23')](_0x5b0c2a[_0x2f9dd1])){for(var _0x69ee22=0x0;_0x69ee22<_0x5b0c2a[_0x2f9dd1]['length'];_0x69ee22+=0x1){addVertex(_0x5d5b03,_0x5b0c2a[_0x2f9dd1][_0x69ee22],_0x2f9dd1);}}else{addVertex(_0x5d5b03,_0x5b0c2a[_0x2f9dd1],_0x2f9dd1);}}}for(var _0x1b61bd=0x0;_0x1b61bd<_0x1ff835[_0x35d0('0x24')];_0x1b61bd+=0x1){if(_0x1ff835[_0x1b61bd][_0x35d0('0x25')]&&_0x1ff835[_0x1b61bd][_0x35d0('0x26')]){_0x5d5b03[_0x35d0('0x27')](_0x1ff835[_0x1b61bd][_0x35d0('0x25')],_0x1ff835[_0x1b61bd][_0x35d0('0x26')],_0x1ff835[_0x1b61bd][_0x35d0('0x28')]);}}return _0x5d5b03;}function getSquareProject(_0x14a596,_0x42ac71){rpc[_0x35d0('0x29')](_0x14a596)['then'](function(_0x560fc3){_0x42ac71(null,_0x560fc3);})[_0x35d0('0x2a')](function(_0x2ed379){_0x42ac71(null,_0x2ed379);});}function createSquareReport(_0x3837d6,_0x58b28c){rpc[_0x35d0('0x2b')](_0x3837d6)[_0x35d0('0x2c')](function(_0xfe94b6){if(_0x58b28c){_0x58b28c(null,_0xfe94b6);}})[_0x35d0('0x2a')](function(_0x39d56c){if(_0x58b28c){_0x58b28c(null,_0x39d56c);}});}function setChannelVariables(_0x146c5e){for(var _0x4488cf in _0x146c5e){if(_0x146c5e[_0x35d0('0x22')](_0x4488cf)){if(_0x4488cf[_0x35d0('0x2d')]('agi_')===0x0){_0x146c5e[_0x4488cf[_0x35d0('0x2e')](0x4)]=_0x146c5e[_0x4488cf];delete _0x146c5e[_0x4488cf];}}}}function getLogFromObject(_0x26e276){return util[_0x35d0('0x2f')](_0x26e276,{'showHidden':![],'depth':null});}function agiHandler(_0x137d0e){var _0x442614,_0xa9f118,_0x1d15ff,_0x1b874c,_0x2fc1c2;logger['debug'](_0x35d0('0x30'),JSON[_0x35d0('0x31')](_0x137d0e,null,0x2));logger[_0x35d0('0xd')](util[_0x35d0('0xe')](_0x35d0('0x32'),_0x137d0e[_0x35d0('0x15')],_0x137d0e['calleridname'],_0x137d0e[_0x35d0('0x17')],_0x137d0e[_0x35d0('0x1a')],_0x137d0e[_0x35d0('0x18')]));_0x137d0e['on'](_0x35d0('0x12'),errorHandler);_0x137d0e['on'](_0x35d0('0x33'),closeHandler);_0x137d0e['on'](_0x35d0('0x34'),timeoutHandler);_0x137d0e['evtHangup']=![];_0x137d0e['on'](_0x35d0('0x35'),hangupHandler);var _0x5af5a9=getSquareProject[_0x35d0('0x36')](null,_0x137d0e['arg_1']);if(_0x5af5a9){if(_0x5af5a9[_0x35d0('0x37')]){_0x442614=getRoot(_0x5af5a9['production']);if(_0x442614&&_0x442614[_0x35d0('0x38')]){logger[_0x35d0('0x39')]('root',JSON['stringify'](_0x442614,null,0x2));_0x137d0e[_0x35d0('0x3a')]=moment()[_0x35d0('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0xa9f118=initGraph(_[_0x35d0('0x20')](_0x442614,_0x35d0('0x21')),_0x442614[_0x35d0('0x21')]);_0x1d15ff=new Vertices(_0x137d0e,rpc,mailRpc);logger[_0x35d0('0xd')](util[_0x35d0('0xe')](_0x35d0('0x3b'),_0x137d0e[_0x35d0('0x15')],_0x137d0e['calleridname'],_0x137d0e[_0x35d0('0x17')],_0x137d0e[_0x35d0('0x1a')],_0x137d0e[_0x35d0('0x18')]));_0xa9f118[_0x35d0('0x3c')](_0x442614['start']['id'],function(_0x1a4663){try{_0x1a4663=_0x1d15ff[_0x35d0('0x3d')](_0x1a4663);logger[_0x35d0('0x39')](_0x35d0('0x3e'),JSON['stringify'](_0x1a4663,null,0x2));if(_0x1a4663['agicommand']===_0x35d0('0x3f')){logger['info'](_0x35d0('0x40'));_0x137d0e[_0x35d0('0x41')]=_0x1a4663[_0x35d0('0x41')]||_0x137d0e[_0x35d0('0x41')];_0x137d0e[_0x35d0('0x42')]=_0x1a4663[_0x35d0('0x42')];_0x137d0e['priority']=_0x1a4663[_0x35d0('0x43')]?_0x1a4663[_0x35d0('0x43')]-0x1:0x1;return null;}else if(_0x1a4663&&_0x1d15ff[_0x1a4663[_0x35d0('0x44')]]){_0x2fc1c2=_0x1d15ff[_0x1a4663['agicommand']](_0x1a4663);logger[_0x35d0('0xd')]('response',JSON[_0x35d0('0x31')](_0x2fc1c2,null,0x2));if(_0x2fc1c2&&_0x2fc1c2[_0x35d0('0x45')]===AGI_CODE_SUCCESS&&_0x2fc1c2['result']!==AGI_RESULT_ERROR&&!_0x137d0e['evtHangup']){logger[_0x35d0('0x39')]('response',getLogFromObject(_0x2fc1c2));return _[_0x35d0('0x46')](_0x2fc1c2[_0x35d0('0x47')])?null:_0x2fc1c2['result'][_0x35d0('0x48')]();}else{logger[_0x35d0('0x12')]('response',getLogFromObject(_0x2fc1c2));return null;}}else{logger[_0x35d0('0x12')]('agicommand\x20not\x20found');return null;}}catch(_0x545fb6){logger[_0x35d0('0x12')](_0x545fb6['stack']);return null;}});if(_0x442614['finally']){logger['info'](util[_0x35d0('0xe')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x137d0e[_0x35d0('0x15')],_0x137d0e[_0x35d0('0x16')],_0x137d0e[_0x35d0('0x17')],_0x137d0e[_0x35d0('0x1a')],_0x137d0e[_0x35d0('0x18')]));_0xa9f118[_0x35d0('0x3c')](_0x442614[_0x35d0('0x49')]['id'],function(_0x4877f1){try{_0x4877f1=_0x1d15ff[_0x35d0('0x3d')](_0x4877f1);logger['debug'](_0x35d0('0x3e'),JSON[_0x35d0('0x31')](_0x4877f1,null,0x2));if(_0x4877f1&&_0x1d15ff[_0x4877f1['agicommand']]){_0x2fc1c2=_0x1d15ff[_0x4877f1[_0x35d0('0x44')]](_0x4877f1);if(_0x2fc1c2){logger[_0x35d0('0x39')](_0x35d0('0x4a'),getLogFromObject(_0x2fc1c2));return _['isUndefined'](_0x2fc1c2[_0x35d0('0x47')])?null:_0x2fc1c2['result'][_0x35d0('0x48')]();}else{logger[_0x35d0('0x12')]('response',getLogFromObject(_0x2fc1c2));return null;}}else{logger[_0x35d0('0x12')](_0x35d0('0x4b'));return null;}}catch(_0x5b3793){logger[_0x35d0('0x12')](_0x5b3793[_0x35d0('0xb')]);return null;}});}logger[_0x35d0('0xd')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x137d0e[_0x35d0('0x15')],_0x137d0e[_0x35d0('0x16')],_0x137d0e['callerid'],_0x137d0e[_0x35d0('0x1a')],_0x137d0e[_0x35d0('0x18')]));logger[_0x35d0('0xd')](util['format'](_0x35d0('0x4c'),_0x137d0e[_0x35d0('0x41')],_0x137d0e[_0x35d0('0x42')],parseInt(_0x137d0e[_0x35d0('0x43')],0xa)+0x1));_0x137d0e['continueAt'](_0x137d0e[_0x35d0('0x41')],_0x137d0e[_0x35d0('0x42')],parseInt(_0x137d0e['priority'],0xa)+0x1);_0x137d0e[_0x35d0('0x33')]();}}else{logger[_0x35d0('0x12')](util[_0x35d0('0xe')](_0x35d0('0x4d'),_0x137d0e['arg_1']));_0x137d0e[_0x35d0('0x4e')](_0x137d0e[_0x35d0('0x41')],_0x137d0e[_0x35d0('0x42')],parseInt(_0x137d0e[_0x35d0('0x43')],0xa)+0x1);_0x137d0e['close']();}}else{logger[_0x35d0('0x12')](util[_0x35d0('0xe')](_0x35d0('0x4f'),_0x137d0e['arg_1']));_0x137d0e['continueAt'](_0x137d0e[_0x35d0('0x41')],_0x137d0e['extension'],parseInt(_0x137d0e[_0x35d0('0x43')],0xa)+0x1);_0x137d0e[_0x35d0('0x33')]();}}function main(){var _0xbca7dd;return utilLicense['getLicense']()[_0x35d0('0x2c')](function(_0x27a2a0){if(_0x27a2a0){if(_0x27a2a0[_0x35d0('0x50')]){if(_0x27a2a0[_0x35d0('0x51')]&&_0x27a2a0[_0x35d0('0x51')]>0x0){logger['info'](util[_0x35d0('0xe')](_0x35d0('0x52'),_0x27a2a0[_0x35d0('0x51')]));_0xbca7dd=_0x27a2a0[_0x35d0('0x51')];}else{logger[_0x35d0('0xd')](_0x35d0('0x53'));}}else{logger[_0x35d0('0xd')](_0x35d0('0x54'));_0xbca7dd=-0x1;}}})[_0x35d0('0x2a')](function(_0x2df946){logger[_0x35d0('0x12')](_0x35d0('0x55'),_0x2df946['stack']);})[_0x35d0('0x49')](function(){var _0x1e8755=require(_0x35d0('0x56'))(config[_0x35d0('0x4')][_0x35d0('0x10')],config[_0x35d0('0x4')]['ip'],_0xbca7dd);_0x1e8755['on'](_0x35d0('0x12'),errorHandler);_0x1e8755['on']('listening',listeningHandler);_0x1e8755['on'](_0x35d0('0x57'),connectionHandler);_0x1e8755['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xde0f=['connection','xml2json','syncho','util','moment','../../config/logger','agi','../../config/license/util','./graph','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','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','traverseBFS','vertex','stringify','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','clear','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','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server'];(function(_0x42dd4d,_0x55104b){var _0x458f55=function(_0xe4d6cd){while(--_0xe4d6cd){_0x42dd4d['push'](_0x42dd4d['shift']());}};_0x458f55(++_0x55104b);}(_0xde0f,0x165));var _0xfde0=function(_0x10b27d,_0x83e605){_0x10b27d=_0x10b27d-0x0;var _0x293ae2=_0xde0f[_0x10b27d];return _0x293ae2;};'use strict';var parser=require(_0xfde0('0x0'));var _=require('lodash');var syncho=require(_0xfde0('0x1'));var util=require(_0xfde0('0x2'));var moment=require(_0xfde0('0x3'));var config=require('../../config/environment');var logger=require(_0xfde0('0x4'))(_0xfde0('0x5'));var utilLicense=require(_0xfde0('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xfde0('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xfde0('0x5')]=_[_0xfde0('0x8')](config[_0xfde0('0x5')],{'ip':_0xfde0('0x9'),'port':0x11dd});function connectionHandler(_0x4bd8b0){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4bd8b0);agiHandler(_0x4bd8b0);}catch(_0x3e91b8){logger[_0xfde0('0xa')](_0x3e91b8[_0xfde0('0xb')]);}});});}function listeningHandler(){console[_0xfde0('0xc')](_0xfde0('0xd'),config[_0xfde0('0x5')][_0xfde0('0xe')]);logger[_0xfde0('0xf')](util[_0xfde0('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xfde0('0x5')]['ip'],config[_0xfde0('0x5')][_0xfde0('0xe')]));}function errorHandler(_0x9b9645){if(_0x9b9645&&_0x9b9645[_0xfde0('0x11')]&&_0x9b9645[_0xfde0('0x12')]){logger['error'](util[_0xfde0('0x10')](_0xfde0('0x13'),_0x9b9645[_0xfde0('0x11')],_0x9b9645[_0xfde0('0x12')]));}else{logger['error'](util['format']('[ERROR]\x20%s',_0x9b9645[_0xfde0('0xb')]));}}function closeHandler(){logger[_0xfde0('0xf')](util[_0xfde0('0x10')](_0xfde0('0x14'),this[_0xfde0('0x15')],this[_0xfde0('0x16')],this[_0xfde0('0x17')],this[_0xfde0('0x18')],this[_0xfde0('0x19')]));try{createSquareReport(this);}catch(_0x219d76){logger[_0xfde0('0xa')](_0x219d76[_0xfde0('0xb')]);}}function timeoutHandler(){logger[_0xfde0('0xf')](util[_0xfde0('0x10')](_0xfde0('0x1a'),this[_0xfde0('0x15')],this[_0xfde0('0x16')],this[_0xfde0('0x17')],this[_0xfde0('0x18')],this['uniqueid']));}function hangupHandler(){logger[_0xfde0('0xf')](util[_0xfde0('0x10')](_0xfde0('0x1b'),this['arg_1'],this[_0xfde0('0x16')],this[_0xfde0('0x17')],this['dnid'],this['uniqueid']));this[_0xfde0('0x1c')]=!![];}function getRoot(_0x3833e){return parser[_0xfde0('0x1d')](_0x3833e,{'object':!![]})['mxGraphModel'][_0xfde0('0x1e')];}function addVertex(_0x5cbe64,_0x335f4b,_0x497102){_0x335f4b[_0xfde0('0x1f')]=_0x497102;if(_0x335f4b['hasOwnProperty'](_0xfde0('0x20'))){_0x335f4b['maxRetry']=parseInt(_0x335f4b[_0xfde0('0x20')],0xa);}_0x5cbe64[_0xfde0('0x21')](_[_0xfde0('0x22')](_0x335f4b,_0xfde0('0x23')));}function initGraph(_0x88a45b,_0x3e8532){var _0x30901a=new Graph();for(var _0x39c83c in _0x88a45b){if(_0x88a45b[_0xfde0('0x24')](_0x39c83c)){if(_[_0xfde0('0x25')](_0x88a45b[_0x39c83c])){for(var _0x4ba22d=0x0;_0x4ba22d<_0x88a45b[_0x39c83c][_0xfde0('0x26')];_0x4ba22d+=0x1){addVertex(_0x30901a,_0x88a45b[_0x39c83c][_0x4ba22d],_0x39c83c);}}else{addVertex(_0x30901a,_0x88a45b[_0x39c83c],_0x39c83c);}}}for(var _0x5a79d2=0x0;_0x5a79d2<_0x3e8532[_0xfde0('0x26')];_0x5a79d2+=0x1){if(_0x3e8532[_0x5a79d2][_0xfde0('0x27')]&&_0x3e8532[_0x5a79d2][_0xfde0('0x28')]){_0x30901a[_0xfde0('0x29')](_0x3e8532[_0x5a79d2][_0xfde0('0x27')],_0x3e8532[_0x5a79d2][_0xfde0('0x28')],_0x3e8532[_0x5a79d2]['value']);}}return _0x30901a;}function getSquareProject(_0x2ce575,_0x26382d){rpc[_0xfde0('0x2a')](_0x2ce575)[_0xfde0('0x2b')](function(_0x1ee536){_0x26382d(null,_0x1ee536);})[_0xfde0('0x2c')](function(_0x1c1e1e){_0x26382d(null,_0x1c1e1e);});}function createSquareReport(_0x452d79,_0x348e09){rpc[_0xfde0('0x2d')](_0x452d79)[_0xfde0('0x2b')](function(_0x5e3a80){if(_0x348e09){_0x348e09(null,_0x5e3a80);}})[_0xfde0('0x2c')](function(_0x375fb7){if(_0x348e09){_0x348e09(null,_0x375fb7);}});}function setChannelVariables(_0x492d64){for(var _0x320f44 in _0x492d64){if(_0x492d64['hasOwnProperty'](_0x320f44)){if(_0x320f44[_0xfde0('0x2e')](_0xfde0('0x2f'))===0x0){_0x492d64[_0x320f44[_0xfde0('0x30')](0x4)]=_0x492d64[_0x320f44];delete _0x492d64[_0x320f44];}}}}function getLogFromObject(_0x5d1b0c){return util['inspect'](_0x5d1b0c,{'showHidden':![],'depth':null});}function agiHandler(_0x1e8585){var _0x3b8103,_0x1a45ef,_0x89adcd,_0x5dd06b,_0x3ae23f;logger[_0xfde0('0x31')](_0xfde0('0x32'),JSON['stringify'](_0x1e8585,null,0x2));logger[_0xfde0('0xf')](util['format'](_0xfde0('0x33'),_0x1e8585[_0xfde0('0x15')],_0x1e8585[_0xfde0('0x16')],_0x1e8585[_0xfde0('0x17')],_0x1e8585[_0xfde0('0x18')],_0x1e8585[_0xfde0('0x19')]));_0x1e8585['on'](_0xfde0('0xa'),errorHandler);_0x1e8585['on'](_0xfde0('0x34'),closeHandler);_0x1e8585['on'](_0xfde0('0x35'),timeoutHandler);_0x1e8585[_0xfde0('0x1c')]=![];_0x1e8585['on']('hangup',hangupHandler);var _0x36dac7=getSquareProject[_0xfde0('0x36')](null,_0x1e8585[_0xfde0('0x15')]);if(_0x36dac7){if(_0x36dac7[_0xfde0('0x37')]){_0x3b8103=getRoot(_0x36dac7[_0xfde0('0x37')]);if(_0x3b8103&&_0x3b8103[_0xfde0('0x38')]){logger[_0xfde0('0x31')](_0xfde0('0x1e'),JSON['stringify'](_0x3b8103,null,0x2));_0x1e8585[_0xfde0('0x39')]=moment()['format'](_0xfde0('0x3a'));_0x1a45ef=initGraph(_[_0xfde0('0x22')](_0x3b8103,_0xfde0('0x23')),_0x3b8103['mxCell']);_0x89adcd=new Vertices(_0x1e8585,rpc,mailRpc);logger['info'](util[_0xfde0('0x10')](_0xfde0('0x3b'),_0x1e8585[_0xfde0('0x15')],_0x1e8585[_0xfde0('0x16')],_0x1e8585[_0xfde0('0x17')],_0x1e8585[_0xfde0('0x18')],_0x1e8585[_0xfde0('0x19')]));_0x1a45ef[_0xfde0('0x3c')](_0x3b8103[_0xfde0('0x38')]['id'],function(_0x227432){try{_0x227432=_0x89adcd['clear'](_0x227432);logger['debug'](_0xfde0('0x3d'),JSON[_0xfde0('0x3e')](_0x227432,null,0x2));if(_0x227432['agicommand']===_0xfde0('0x3f')){logger['info'](_0xfde0('0x40'));_0x1e8585[_0xfde0('0x41')]=_0x227432[_0xfde0('0x41')]||_0x1e8585[_0xfde0('0x41')];_0x1e8585[_0xfde0('0x42')]=_0x227432['extension'];_0x1e8585['priority']=_0x227432[_0xfde0('0x43')]?_0x227432['priority']-0x1:0x1;return null;}else if(_0x227432&&_0x89adcd[_0x227432['agicommand']]){_0x3ae23f=_0x89adcd[_0x227432[_0xfde0('0x1f')]](_0x227432);logger[_0xfde0('0xf')]('response',JSON[_0xfde0('0x3e')](_0x3ae23f,null,0x2));if(_0x3ae23f&&_0x3ae23f[_0xfde0('0x44')]===AGI_CODE_SUCCESS&&_0x3ae23f[_0xfde0('0x45')]!==AGI_RESULT_ERROR&&!_0x1e8585[_0xfde0('0x1c')]){logger[_0xfde0('0x31')](_0xfde0('0x46'),getLogFromObject(_0x3ae23f));return _['isUndefined'](_0x3ae23f[_0xfde0('0x45')])?null:_0x3ae23f[_0xfde0('0x45')][_0xfde0('0x47')]();}else{logger['error'](_0xfde0('0x46'),getLogFromObject(_0x3ae23f));return null;}}else{logger[_0xfde0('0xa')](_0xfde0('0x48'));return null;}}catch(_0x31551a){logger[_0xfde0('0xa')](_0x31551a['stack']);return null;}});if(_0x3b8103[_0xfde0('0x49')]){logger[_0xfde0('0xf')](util[_0xfde0('0x10')](_0xfde0('0x4a'),_0x1e8585[_0xfde0('0x15')],_0x1e8585[_0xfde0('0x16')],_0x1e8585[_0xfde0('0x17')],_0x1e8585[_0xfde0('0x18')],_0x1e8585[_0xfde0('0x19')]));_0x1a45ef[_0xfde0('0x3c')](_0x3b8103[_0xfde0('0x49')]['id'],function(_0x1cde2d){try{_0x1cde2d=_0x89adcd[_0xfde0('0x4b')](_0x1cde2d);logger['debug'](_0xfde0('0x3d'),JSON[_0xfde0('0x3e')](_0x1cde2d,null,0x2));if(_0x1cde2d&&_0x89adcd[_0x1cde2d[_0xfde0('0x1f')]]){_0x3ae23f=_0x89adcd[_0x1cde2d[_0xfde0('0x1f')]](_0x1cde2d);if(_0x3ae23f){logger[_0xfde0('0x31')](_0xfde0('0x46'),getLogFromObject(_0x3ae23f));return _[_0xfde0('0x4c')](_0x3ae23f[_0xfde0('0x45')])?null:_0x3ae23f[_0xfde0('0x45')][_0xfde0('0x47')]();}else{logger['error'](_0xfde0('0x46'),getLogFromObject(_0x3ae23f));return null;}}else{logger[_0xfde0('0xa')](_0xfde0('0x48'));return null;}}catch(_0x32a556){logger[_0xfde0('0xa')](_0x32a556[_0xfde0('0xb')]);return null;}});}logger[_0xfde0('0xf')](util[_0xfde0('0x10')](_0xfde0('0x4d'),_0x1e8585['arg_1'],_0x1e8585[_0xfde0('0x16')],_0x1e8585[_0xfde0('0x17')],_0x1e8585[_0xfde0('0x18')],_0x1e8585[_0xfde0('0x19')]));logger['info'](util[_0xfde0('0x10')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x1e8585['context'],_0x1e8585[_0xfde0('0x42')],parseInt(_0x1e8585[_0xfde0('0x43')],0xa)+0x1));_0x1e8585[_0xfde0('0x4e')](_0x1e8585[_0xfde0('0x41')],_0x1e8585[_0xfde0('0x42')],parseInt(_0x1e8585['priority'],0xa)+0x1);_0x1e8585[_0xfde0('0x34')]();}}else{logger[_0xfde0('0xa')](util[_0xfde0('0x10')](_0xfde0('0x4f'),_0x1e8585[_0xfde0('0x15')]));_0x1e8585[_0xfde0('0x4e')](_0x1e8585['context'],_0x1e8585[_0xfde0('0x42')],parseInt(_0x1e8585[_0xfde0('0x43')],0xa)+0x1);_0x1e8585[_0xfde0('0x34')]();}}else{logger['error'](util[_0xfde0('0x10')](_0xfde0('0x50'),_0x1e8585[_0xfde0('0x15')]));_0x1e8585[_0xfde0('0x4e')](_0x1e8585['context'],_0x1e8585['extension'],parseInt(_0x1e8585[_0xfde0('0x43')],0xa)+0x1);_0x1e8585['close']();}}function main(){var _0x1172cb;return utilLicense[_0xfde0('0x51')]()[_0xfde0('0x2b')](function(_0x3a48e4){if(_0x3a48e4){if(_0x3a48e4[_0xfde0('0x52')]){if(_0x3a48e4['callysquare']&&_0x3a48e4[_0xfde0('0x53')]>0x0){logger[_0xfde0('0xf')](util['format'](_0xfde0('0x54'),_0x3a48e4['callysquare']));_0x1172cb=_0x3a48e4['callysquare'];}else{logger[_0xfde0('0xf')](_0xfde0('0x55'));}}else{logger[_0xfde0('0xf')](_0xfde0('0x56'));_0x1172cb=-0x1;}}})['catch'](function(_0x53ab45){logger[_0xfde0('0xa')]('[LICENSE]',_0x53ab45[_0xfde0('0xb')]);})['finally'](function(){var _0x369b17=require(_0xfde0('0x57'))(config[_0xfde0('0x5')][_0xfde0('0xe')],config[_0xfde0('0x5')]['ip'],_0x1172cb);_0x369b17['on'](_0xfde0('0xa'),errorHandler);_0x369b17['on']('listening',listeningHandler);_0x369b17['on'](_0xfde0('0x58'),connectionHandler);_0x369b17['on'](_0xfde0('0x34'),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 ee4c3f6..40d1ce6 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 _0xdbad=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','result'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0xdbad,0x1a6));var _0xddba=function(_0x2e8b86,_0x10764e){_0x2e8b86=_0x2e8b86-0x0;var _0x4b5205=_0xdbad[_0x2e8b86];return _0x4b5205;};'use strict';var BPromise=require(_0xddba('0x0'));var jayson=require(_0xddba('0x1'));var client=jayson[_0xddba('0x2')][_0xddba('0x3')]({'port':0x232b});function request(_0x58ab8c,_0x59127b){return new BPromise(function(_0x4fd2db,_0x4969fe){return client[_0xddba('0x4')](_0x58ab8c,_0x59127b)['then'](function(_0x207c5d){if(_0x207c5d[_0xddba('0x5')]){return _0x4969fe(_0x207c5d[_0xddba('0x5')][_0xddba('0x6')]);}else{return _0x4fd2db(_0x207c5d[_0xddba('0x7')]);}})['catch'](function(_0x5e8011){return _0x4969fe(_0x5e8011);});});}exports[_0xddba('0x8')]=function(_0x1f3c78,_0xe17ae2){return request(_0xddba('0x9'),{'account':_0x1f3c78,'message':_0xe17ae2});}; \ No newline at end of file +var _0x8bfe=['bluebird','jayson/promise','client','http','request','then','error','message','result','sendMailMessage','SendMail'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x8bfe,0x9a));var _0xe8bf=function(_0x12b83d,_0x4bcec7){_0x12b83d=_0x12b83d-0x0;var _0x1fd39d=_0x8bfe[_0x12b83d];return _0x1fd39d;};'use strict';var BPromise=require(_0xe8bf('0x0'));var jayson=require(_0xe8bf('0x1'));var client=jayson[_0xe8bf('0x2')][_0xe8bf('0x3')]({'port':0x232b});function request(_0x5e4005,_0x250412){return new BPromise(function(_0x10a74b,_0x59da38){return client[_0xe8bf('0x4')](_0x5e4005,_0x250412)[_0xe8bf('0x5')](function(_0xfb7dff){if(_0xfb7dff[_0xe8bf('0x6')]){return _0x59da38(_0xfb7dff[_0xe8bf('0x6')][_0xe8bf('0x7')]);}else{return _0x10a74b(_0xfb7dff[_0xe8bf('0x8')]);}})['catch'](function(_0x3fd7cf){return _0x59da38(_0x3fd7cf);});});}exports[_0xe8bf('0x9')]=function(_0x80498,_0x288b4d){return request(_0xe8bf('0xa'),{'account':_0x80498,'message':_0x288b4d});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 29b8739..d13d777 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 _0x078c=['Transform','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','slice','trim','headers','line','length','exports','stream'];(function(_0x509a17,_0x497b29){var _0x2e4919=function(_0x52e5d2){while(--_0x52e5d2){_0x509a17['push'](_0x509a17['shift']());}};_0x2e4919(++_0x497b29);}(_0x078c,0x86));var _0xc078=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x078c[_0x9aada2];return _0x196dff;};'use strict';var util=require('util');var Transform=require(_0xc078('0x0'))[_0xc078('0x1')];function AGIReply(_0x478e38){Transform['call'](this,_0x478e38);this['_localBuffer']='';this[_0xc078('0x2')]=![];}util[_0xc078('0x3')](AGIReply,Transform);AGIReply['prototype'][_0xc078('0x4')]=function(_0x236054,_0x4683b9,_0x5fb3ff){var _0x446b9a='\x0a',_0x3a1f78=['\x0a\x0a',_0xc078('0x5')],_0x40f13d=-0x1,_0x363f47=-0x1,_0x2224d6='',_0x3f0e9a=0x0,_0xfb1b1b='',_0x5442ce='';this[_0xc078('0x6')]+=_0x236054['toString']();_0xfb1b1b=this[_0xc078('0x6')];if(!this['_inBody']){_0x3f0e9a=0x0;while(_0x3a1f78[_0x3f0e9a]){while((_0x363f47=_0xfb1b1b[_0xc078('0x7')](_0x3a1f78[_0x3f0e9a]))!=-0x1){_0x2224d6=_0x3a1f78[_0x3f0e9a];_0x5442ce=_0xfb1b1b['substring'](0x0,_0x363f47);_0xfb1b1b=_0xfb1b1b[_0xc078('0x8')](_0x363f47+_0x2224d6['length']);var _0x4ccbab=_0x5442ce['split'](_0x446b9a),_0xc1af3c=0x0,_0x1e1a6e={},_0x5c3ebc='',_0x43e9a6='',_0x2e2fc3=-0x1;while(_0x4ccbab[_0xc1af3c]){_0x2e2fc3=_0x4ccbab[_0xc1af3c][_0xc078('0x7')](':');if(_0x2e2fc3!=-0x1){_0x5c3ebc=_0x4ccbab[_0xc1af3c][_0xc078('0x9')](0x0,_0x2e2fc3)['trim']();_0x43e9a6=_0x4ccbab[_0xc1af3c][_0xc078('0x9')](_0x2e2fc3+0x1)[_0xc078('0xa')]();if(_0x5c3ebc['length']>0x0){_0x1e1a6e[_0x5c3ebc]=_0x43e9a6;}}else{}_0xc1af3c++;}this['emit'](_0xc078('0xb'),_0x1e1a6e);this['_inBody']=!![];}_0x3f0e9a++;}this[_0xc078('0x6')]=_0xfb1b1b;}else{while((_0x40f13d=_0xfb1b1b[_0xc078('0x7')](_0x446b9a))!=-0x1){_0x5442ce=_0xfb1b1b[_0xc078('0x8')](0x0,_0x40f13d);this['emit'](_0xc078('0xc'),_0x5442ce);_0xfb1b1b=_0xfb1b1b[_0xc078('0x8')](_0x40f13d+_0x446b9a[_0xc078('0xd')]);}this[_0xc078('0x6')]=_0xfb1b1b;}_0x5fb3ff();};module[_0xc078('0xe')]=AGIReply; \ No newline at end of file +var _0x6183=['length','split','slice','trim','emit','headers','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x6183,0x1e2));var _0x3618=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x6183[_0x2181fc];return _0x315da1;};'use strict';var util=require(_0x3618('0x0'));var Transform=require(_0x3618('0x1'))[_0x3618('0x2')];function AGIReply(_0x3ff20a){Transform[_0x3618('0x3')](this,_0x3ff20a);this[_0x3618('0x4')]='';this[_0x3618('0x5')]=![];}util[_0x3618('0x6')](AGIReply,Transform);AGIReply[_0x3618('0x7')][_0x3618('0x8')]=function(_0x28ab94,_0x253c08,_0x2f4ab4){var _0x430360='\x0a',_0x5a4167=['\x0a\x0a',_0x3618('0x9')],_0x39a6b2=-0x1,_0x24be95=-0x1,_0x4b3a95='',_0x29c084=0x0,_0x5c6b24='',_0x320948='';this[_0x3618('0x4')]+=_0x28ab94['toString']();_0x5c6b24=this[_0x3618('0x4')];if(!this[_0x3618('0x5')]){_0x29c084=0x0;while(_0x5a4167[_0x29c084]){while((_0x24be95=_0x5c6b24[_0x3618('0xa')](_0x5a4167[_0x29c084]))!=-0x1){_0x4b3a95=_0x5a4167[_0x29c084];_0x320948=_0x5c6b24[_0x3618('0xb')](0x0,_0x24be95);_0x5c6b24=_0x5c6b24['substring'](_0x24be95+_0x4b3a95[_0x3618('0xc')]);var _0x12fe9d=_0x320948[_0x3618('0xd')](_0x430360),_0x331186=0x0,_0x255892={},_0x7fdef4='',_0x55b4e5='',_0xfb115e=-0x1;while(_0x12fe9d[_0x331186]){_0xfb115e=_0x12fe9d[_0x331186]['indexOf'](':');if(_0xfb115e!=-0x1){_0x7fdef4=_0x12fe9d[_0x331186][_0x3618('0xe')](0x0,_0xfb115e)[_0x3618('0xf')]();_0x55b4e5=_0x12fe9d[_0x331186]['slice'](_0xfb115e+0x1)[_0x3618('0xf')]();if(_0x7fdef4['length']>0x0){_0x255892[_0x7fdef4]=_0x55b4e5;}}else{}_0x331186++;}this[_0x3618('0x10')](_0x3618('0x11'),_0x255892);this[_0x3618('0x5')]=!![];}_0x29c084++;}this['_localBuffer']=_0x5c6b24;}else{while((_0x39a6b2=_0x5c6b24['indexOf'](_0x430360))!=-0x1){_0x320948=_0x5c6b24['substring'](0x0,_0x39a6b2);this[_0x3618('0x10')]('line',_0x320948);_0x5c6b24=_0x5c6b24[_0x3618('0xb')](_0x39a6b2+_0x430360[_0x3618('0xc')]);}this['_localBuffer']=_0x5c6b24;}_0x2f4ab4();};module[_0x3618('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index c60cbc2..39d7e71 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 _0x27d3=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','dsn','ShowUser','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','client','http','request','then','error','message','catch','getSquareProject'];(function(_0x202ec8,_0x550958){var _0x12d800=function(_0x16db03){while(--_0x16db03){_0x202ec8['push'](_0x202ec8['shift']());}};_0x12d800(++_0x550958);}(_0x27d3,0x9b));var _0x327d=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x27d3[_0x2dadb9];return _0x2f0097;};'use strict';var BPromise=require(_0x327d('0x0'));var moment=require('moment');var _=require(_0x327d('0x1'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x327d('0x2')][_0x327d('0x3')]({'port':0x2329});function request(_0x424b08,_0x7d35f1){return new BPromise(function(_0x538d14,_0x33c05c){return client[_0x327d('0x4')](_0x424b08,_0x7d35f1)[_0x327d('0x5')](function(_0x274d3f){if(_0x274d3f['error']){return _0x33c05c(_0x274d3f[_0x327d('0x6')][_0x327d('0x7')]);}else{return _0x538d14(_0x274d3f['result']);}})[_0x327d('0x8')](function(_0x45ff69){return _0x33c05c(_0x45ff69);});});}exports[_0x327d('0x9')]=function(_0x4215ef){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4215ef},'attributes':['production']}});};exports[_0x327d('0xa')]=function(_0x4652c6){return request(_0x327d('0xb'),{'options':{'raw':![],'where':{'id':_0x4652c6},'include':[{'model':_0x327d('0xc'),'as':_0x327d('0xd')}],'attributes':['id',_0x327d('0xe'),'email']}});};exports[_0x327d('0xf')]=function(_0x158ae8){return request(_0x327d('0x10'),{'options':{'where':{'id':_0x158ae8},'attributes':[_0x327d('0xe')]}});};exports[_0x327d('0x11')]=function(_0x54445a){return request(_0x327d('0x12'),{'options':{'where':{'id':_0x54445a},'attributes':['name']}});};exports['getVariableById']=function(_0x56f612){return request(_0x327d('0x13'),{'options':{'where':{'id':_0x56f612},'attributes':[_0x327d('0xe')]}});};exports['getSquareOdbcById']=function(_0x6518b6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x6518b6},'attributes':[_0x327d('0x14')]}});};exports['getUserById']=function(_0x109521){return request(_0x327d('0x15'),{'options':{'where':{'id':_0x109521},'attributes':[_0x327d('0xe')]}});};exports['getTrunkById']=function(_0x382582){return request(_0x327d('0x16'),{'options':{'where':{'id':_0x382582},'attributes':['name']}});};exports['getSoundById']=function(_0x57e984){return request(_0x327d('0x17'),{'options':{'where':{'id':_0x57e984},'attributes':[_0x327d('0x18')]}});};exports[_0x327d('0x19')]=function(_0x364eab){return request(_0x327d('0x1a'),{'options':{'raw':![],'where':{'id':_0x364eab},'include':[{'model':'Interval','as':_0x327d('0x1b')}]}});};exports[_0x327d('0x1c')]=function(_0x44976a){return request(_0x327d('0x1d'),{'options':{'where':{'id':_0x44976a},'attributes':['id',_0x327d('0xe')]}});};exports['createSmsMessage']=function(_0x2e1333){return request(_0x327d('0x1e'),{'body':_0x2e1333});};exports['createSquareDetailsReport']=function(_0x4aeb47){return request(_0x327d('0x1f'),{'body':_0x4aeb47});};exports[_0x327d('0x20')]=function(_0x330ee1){return request(_0x327d('0x21'),{'body':_[_0x327d('0x22')](_0x330ee1,{'project_name':_0x330ee1[_0x327d('0x23')],'prev_project_name':_0x330ee1[_0x327d('0x24')]||'','is_subproject':_0x330ee1[_0x327d('0x24')]?!![]:![],'leaveAt':moment()['format'](_0x327d('0x25'))})});};exports[_0x327d('0x26')]=function(_0x1fa75c){return request(_0x327d('0x27'),{'body':_0x1fa75c});};exports[_0x327d('0x28')]=function(_0x4a36b6){return request(_0x327d('0x29'),{'body':_0x4a36b6});};exports[_0x327d('0x2a')]=function(_0x6dac8b){return request(_0x327d('0x2b'),{'options':{'raw':![],'where':{'phone':_0x6dac8b['phone'],'ListId':_0x6dac8b[_0x327d('0x2c')]}}})['then'](function(_0x53336f){if(_0x53336f){return _0x53336f;}return request('CreateCmContact',{'body':_0x6dac8b});});};exports[_0x327d('0x2d')]=function(_0x2219a6){return request(_0x327d('0x2e'),{'options':{'where':{'id':_0x2219a6},'attributes':[_0x327d('0xe')]}});};exports[_0x327d('0x2f')]=function(_0x59b0fa,_0x377e7f){return request(_0x327d('0x30'),{'body':{'interface':_0x377e7f},'options':{'where':_0x59b0fa}});};exports[_0x327d('0x31')]=function(_0x370a49,_0x2098e3,_0x5266f1){return request(_0x327d('0x32'),{'body':{'type':_0x2098e3,'uniqueid':_0x5266f1},'options':{'where':_0x370a49}});};exports[_0x327d('0x33')]=function(_0x26b3fc){return request(_0x327d('0x34'),{'body':{},'options':{'where':_0x26b3fc}});};exports[_0x327d('0x35')]=function(_0x1c444e){return request(_0x327d('0x36'),{'body':{},'options':{'where':_0x1c444e}});}; \ No newline at end of file +var _0xa011=['getTrunkById','getSoundById','save_name','getIntervalById','ShowInterval','Interval','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createCmContact','phone','CreateCmContact','getPauseById','agentPause','agentLogout','LogoutUser','moment','lodash','jayson/promise','http','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','dsn','getUserById','ShowUser'];(function(_0x258182,_0x4dca48){var _0xe370c4=function(_0x1c5588){while(--_0x1c5588){_0x258182['push'](_0x258182['shift']());}};_0xe370c4(++_0x4dca48);}(_0xa011,0xc1));var _0x1a01=function(_0x5ea9b7,_0x395466){_0x5ea9b7=_0x5ea9b7-0x0;var _0x2da9a=_0xa011[_0x5ea9b7];return _0x2da9a;};'use strict';var BPromise=require('bluebird');var moment=require(_0x1a01('0x0'));var _=require(_0x1a01('0x1'));var util=require('util');var jayson=require(_0x1a01('0x2'));var client=jayson['client'][_0x1a01('0x3')]({'port':0x2329});function request(_0x13f1cf,_0x33c979){return new BPromise(function(_0x1623ce,_0x3fbc2d){return client['request'](_0x13f1cf,_0x33c979)[_0x1a01('0x4')](function(_0x1cf8f7){if(_0x1cf8f7[_0x1a01('0x5')]){return _0x3fbc2d(_0x1cf8f7[_0x1a01('0x5')][_0x1a01('0x6')]);}else{return _0x1623ce(_0x1cf8f7[_0x1a01('0x7')]);}})[_0x1a01('0x8')](function(_0x360bf1){return _0x3fbc2d(_0x360bf1);});});}exports[_0x1a01('0x9')]=function(_0x3fc63a){return request(_0x1a01('0xa'),{'options':{'raw':![],'where':{'name':_0x3fc63a},'attributes':[_0x1a01('0xb')]}});};exports[_0x1a01('0xc')]=function(_0x306441){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x306441},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x1a01('0xd'),_0x1a01('0xe')]}});};exports[_0x1a01('0xf')]=function(_0x3161fc){return request(_0x1a01('0xa'),{'options':{'where':{'id':_0x3161fc},'attributes':['name']}});};exports[_0x1a01('0x10')]=function(_0x3c2ef3){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3c2ef3},'attributes':[_0x1a01('0xd')]}});};exports[_0x1a01('0x11')]=function(_0x3add0d){return request(_0x1a01('0x12'),{'options':{'where':{'id':_0x3add0d},'attributes':[_0x1a01('0xd')]}});};exports['getSquareOdbcById']=function(_0x33e81f){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x33e81f},'attributes':[_0x1a01('0x13')]}});};exports[_0x1a01('0x14')]=function(_0x5a5f6e){return request(_0x1a01('0x15'),{'options':{'where':{'id':_0x5a5f6e},'attributes':[_0x1a01('0xd')]}});};exports[_0x1a01('0x16')]=function(_0x2f41c5){return request('ShowTrunk',{'options':{'where':{'id':_0x2f41c5},'attributes':[_0x1a01('0xd')]}});};exports[_0x1a01('0x17')]=function(_0x192a81){return request('ShowSound',{'options':{'where':{'id':_0x192a81},'attributes':[_0x1a01('0x18')]}});};exports[_0x1a01('0x19')]=function(_0x296e27){return request(_0x1a01('0x1a'),{'options':{'raw':![],'where':{'id':_0x296e27},'include':[{'model':_0x1a01('0x1b'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x292065){return request('ShowSmsAccount',{'options':{'where':{'id':_0x292065},'attributes':['id',_0x1a01('0xd')]}});};exports[_0x1a01('0x1c')]=function(_0xc0bd6){return request('CreateSmsMessage',{'body':_0xc0bd6});};exports[_0x1a01('0x1d')]=function(_0x155849){return request(_0x1a01('0x1e'),{'body':_0x155849});};exports['createSquareReport']=function(_0x3f3e15){return request('CreateSquareReport',{'body':_[_0x1a01('0x1f')](_0x3f3e15,{'project_name':_0x3f3e15['arg_1'],'prev_project_name':_0x3f3e15[_0x1a01('0x20')]||'','is_subproject':_0x3f3e15[_0x1a01('0x20')]?!![]:![],'leaveAt':moment()[_0x1a01('0x21')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x1a01('0x22')]=function(_0x3ca7be){return request(_0x1a01('0x23'),{'body':_0x3ca7be});};exports['createSquareMessage']=function(_0x4bfb4a){return request('CreateSquareMessage',{'body':_0x4bfb4a});};exports[_0x1a01('0x24')]=function(_0x3801ca){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3801ca[_0x1a01('0x25')],'ListId':_0x3801ca['ListId']}}})[_0x1a01('0x4')](function(_0x1c4c30){if(_0x1c4c30){return _0x1c4c30;}return request(_0x1a01('0x26'),{'body':_0x3801ca});});};exports[_0x1a01('0x27')]=function(_0x5be00f){return request('ShowPause',{'options':{'where':{'id':_0x5be00f},'attributes':[_0x1a01('0xd')]}});};exports['agentLogin']=function(_0x5d5f99,_0x2c2340){return request('LoginUser',{'body':{'interface':_0x2c2340},'options':{'where':_0x5d5f99}});};exports[_0x1a01('0x28')]=function(_0x37a360,_0x28d4e8,_0xaa9d94){return request('PauseUser',{'body':{'type':_0x28d4e8,'uniqueid':_0xaa9d94},'options':{'where':_0x37a360}});};exports['agentUnpause']=function(_0x7a47b2){return request('UnpauseUser',{'body':{},'options':{'where':_0x7a47b2}});};exports[_0x1a01('0x29')]=function(_0x33b139){return request(_0x1a01('0x2a'),{'body':{},'options':{'where':_0x33b139}});}; \ 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 c26caf1..138252e 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 _0x126e=['./lex','exports'];(function(_0x3c10ce,_0x714f53){var _0x7ccf7b=function(_0x26f38c){while(--_0x26f38c){_0x3c10ce['push'](_0x3c10ce['shift']());}};_0x7ccf7b(++_0x714f53);}(_0x126e,0x108));var _0xe126=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x126e[_0x565c49];return _0x20ca34;};var polly=require('./polly');var lex=require(_0xe126('0x0'));module[_0xe126('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x8cad=['./lex','exports','./polly'];(function(_0x1383cd,_0xcbecab){var _0x48ce66=function(_0x1dfc8d){while(--_0x1dfc8d){_0x1383cd['push'](_0x1383cd['shift']());}};_0x48ce66(++_0xcbecab);}(_0x8cad,0xfe));var _0xd8ca=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x8cad[_0x25d386];return _0x857f4a;};var polly=require(_0xd8ca('0x0'));var lex=require(_0xd8ca('0x1'));module[_0xd8ca('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 14ca6fc..ce6a2f9 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['./lib/api','exports'];(function(_0x46eba7,_0x110f45){var _0x186a42=function(_0x87040c){while(--_0x87040c){_0x46eba7['push'](_0x46eba7['shift']());}};_0x186a42(++_0x110f45);}(_0x5c00,0x17e));var _0x05c0=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x5c00[_0x2543d6];return _0x55213c;};'use strict';var lex=require(_0x05c0('0x0'));module[_0x05c0('0x1')]=function(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9){return lex(_0x1c3b79,_0x4e54ec,_0x1e76da,_0x5859bc,_0x41c4b4,_0x25c3a9);}; \ No newline at end of file +var _0x6c76=['./lib/api','exports'];(function(_0x57ff98,_0x32441d){var _0x2c2c24=function(_0x27dae7){while(--_0x27dae7){_0x57ff98['push'](_0x57ff98['shift']());}};_0x2c2c24(++_0x32441d);}(_0x6c76,0x184));var _0x66c7=function(_0x5c7695,_0x4c660f){_0x5c7695=_0x5c7695-0x0;var _0x45b3c0=_0x6c76[_0x5c7695];return _0x45b3c0;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 4437794..1be7cae 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(_0x3e2d32,_0x4931b1){var _0x4c6678=function(_0x1785ea){while(--_0x1785ea){_0x3e2d32['push'](_0x3e2d32['shift']());}};_0x4c6678(++_0x4931b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x163940,_0x42418b){var _0x229f36=function(_0x45a73f){while(--_0x45a73f){_0x163940['push'](_0x163940['shift']());}};_0x229f36(++_0x42418b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 c727621..b9392d8 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 _0x7ae1=['exports','./lib/api'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x7ae1,0x185));var _0x17ae=function(_0x322cdb,_0x2d6859){_0x322cdb=_0x322cdb-0x0;var _0x7437b=_0x7ae1[_0x322cdb];return _0x7437b;};'use strict';var polly=require(_0x17ae('0x0'));module[_0x17ae('0x1')]=function(_0x41eeb3,_0x5934c2,_0x85099d,_0x57b3f2,_0x388840,_0x3ddf44,_0x5a4440){return polly(_0x41eeb3,_0x5934c2,_0x85099d,_0x57b3f2,_0x388840,_0x3ddf44,_0x5a4440);}; \ No newline at end of file +var _0xf414=['./lib/api','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xf414,0x80));var _0x4f41=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0xf414[_0x21de89];return _0x290b7e;};'use strict';var polly=require(_0x4f41('0x0'));module[_0x4f41('0x1')]=function(_0x485622,_0x49bce3,_0x57ef1c,_0xcc28ed,_0x2b1517,_0x27d05b,_0x2850f2){return polly(_0x485622,_0x49bce3,_0x57ef1c,_0xcc28ed,_0x2b1517,_0x27d05b,_0x2850f2);}; \ 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 235b85e..db19fa2 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 _0x3004=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','synthesizeSpeech','AudioStream','writeFile'];(function(_0xd6343d,_0x1addb1){var _0x5d181b=function(_0x3fe462){while(--_0x3fe462){_0xd6343d['push'](_0xd6343d['shift']());}};_0x5d181b(++_0x1addb1);}(_0x3004,0x15a));var _0x4300=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x3004[_0x273c39];return _0x46d6b5;};'use strict';var fs=require('fs');var path=require(_0x4300('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0xfb278c,_0x4229bc,_0x1f7a8d){return new BPromise(function(_0x52f22a,_0x504bc2){_0xfb278c[_0x4300('0x1')](_0x4229bc,function(_0x1267d6,_0x29f08b){if(_0x1267d6){_0x504bc2(_0x1267d6);}else if(_0x29f08b){if(_0x29f08b[_0x4300('0x2')]instanceof Buffer){fs[_0x4300('0x3')](_0x1f7a8d,_0x29f08b[_0x4300('0x2')],function(_0x367c75){if(_0x367c75){_0x504bc2(_0x367c75);}else{_0x52f22a();}});}else{_0x504bc2(new Error(_0x4300('0x4')));}}else{_0x504bc2(new Error(_0x4300('0x5')));}});});}module[_0x4300('0x6')]=function(_0x418362,_0x7aba42,_0x24b0db,_0x568bba,_0x118281,_0x35bbbe,_0x2aaea1){var _0x406cfd=new AWS[(_0x4300('0x7'))]({'accessKeyId':_0x418362,'secretAccessKey':_0x7aba42,'region':_0x24b0db});var _0x1118d9={'Text':_0x118281,'TextType':_0x35bbbe||_0x4300('0x8'),'OutputFormat':_0x4300('0x9'),'VoiceId':_0x568bba};return pollyResult(_0x406cfd,_0x1118d9,_0x2aaea1);}; \ No newline at end of file +var _0xbe1a=['randomstring','aws-sdk','synthesizeSpeech','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x18fed8,_0x1af473){var _0x4af60c=function(_0x239435){while(--_0x239435){_0x18fed8['push'](_0x18fed8['shift']());}};_0x4af60c(++_0x1af473);}(_0xbe1a,0x166));var _0xabe1=function(_0x1cbb0c,_0x554547){_0x1cbb0c=_0x1cbb0c-0x0;var _0x242be9=_0xbe1a[_0x1cbb0c];return _0x242be9;};'use strict';var fs=require('fs');var path=require(_0xabe1('0x0'));var BPromise=require(_0xabe1('0x1'));var rs=require(_0xabe1('0x2'));var AWS=require(_0xabe1('0x3'));function pollyResult(_0x35d1ad,_0x463a0e,_0xe38fee){return new BPromise(function(_0x2e7986,_0xe8e809){_0x35d1ad[_0xabe1('0x4')](_0x463a0e,function(_0x2cbedf,_0x289b7a){if(_0x2cbedf){_0xe8e809(_0x2cbedf);}else if(_0x289b7a){if(_0x289b7a['AudioStream']instanceof Buffer){fs['writeFile'](_0xe38fee,_0x289b7a['AudioStream'],function(_0x44ceef){if(_0x44ceef){_0xe8e809(_0x44ceef);}else{_0x2e7986();}});}else{_0xe8e809(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xe8e809(new Error(_0xabe1('0x5')));}});});}module[_0xabe1('0x6')]=function(_0x3b3471,_0x51c81e,_0x4735de,_0x140e81,_0x5e219c,_0x262a1e,_0x230ff1){var _0x202298=new AWS[(_0xabe1('0x7'))]({'accessKeyId':_0x3b3471,'secretAccessKey':_0x51c81e,'region':_0x4735de});var _0x1f3e33={'Text':_0x5e219c,'TextType':_0x262a1e||_0xabe1('0x8'),'OutputFormat':_0xabe1('0x9'),'VoiceId':_0x140e81};return pollyResult(_0x202298,_0x1f3e33,_0x230ff1);}; \ 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 0e8ec3e..43795dc 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 _0x9302=['./lib/api','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9302,0x13e));var _0x2930=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0x9302[_0x19efbc];return _0x205c5e;};'use strict';var asr=require(_0x2930('0x0'));module[_0x2930('0x1')]=function(_0x353127,_0x1a2743,_0x440d9b,_0x52b298){return asr(_0x353127,_0x1a2743,_0x440d9b);}; \ No newline at end of file +var _0x52fa=['exports','./lib/api'];(function(_0x1028ec,_0x44ea48){var _0x2833bd=function(_0x1ec8d9){while(--_0x1ec8d9){_0x1028ec['push'](_0x1028ec['shift']());}};_0x2833bd(++_0x44ea48);}(_0x52fa,0xa3));var _0xa52f=function(_0x19e2ed,_0x3b1ba2){_0x19e2ed=_0x19e2ed-0x0;var _0x45fd72=_0x52fa[_0x19e2ed];return _0x45fd72;};'use strict';var asr=require(_0xa52f('0x0'));module[_0xa52f('0x1')]=function(_0x1ae654,_0x4490a1,_0x17736b,_0x333f0e){return asr(_0x1ae654,_0x4490a1,_0x17736b);}; \ 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 283ed63..b8c59ca 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 _0xfc4c=['undefined','length','base64','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com','string','key\x20should\x20be\x20a\x20string'];(function(_0x4a562c,_0x4f80ad){var _0x4e0bb1=function(_0x265d61){while(--_0x265d61){_0x4a562c['push'](_0x4a562c['shift']());}};_0x4e0bb1(++_0x4f80ad);}(_0xfc4c,0xca));var _0xcfc4=function(_0x5b5405,_0x6dacb6){_0x5b5405=_0x5b5405-0x0;var _0x5c4a98=_0xfc4c[_0x5b5405];return _0x5c4a98;};'use strict';var url=require(_0xcfc4('0x0'));var BPromise=require(_0xcfc4('0x1'));var fs=require('fs');var host=_0xcfc4('0x2');module['exports']=function(_0x29323d,_0xb8f67b,_0x3a0bd9){return new BPromise(function(_0x54bee8,_0x57bf8a){var _0x436d9b;if(typeof _0x29323d!==_0xcfc4('0x3')||_0x29323d['length']===0x0){return _0x57bf8a('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xb8f67b!==_0xcfc4('0x3')||_0xb8f67b['length']===0x0){return _0x57bf8a(_0xcfc4('0x4'));}if(typeof _0x3a0bd9!==_0xcfc4('0x5')&&(typeof _0x3a0bd9!=='string'||_0x3a0bd9[_0xcfc4('0x6')]===0x0)){return _0x57bf8a('lang\x20should\x20be\x20a\x20string');}try{_0x436d9b=fs['readFileSync'](_0x29323d)['toString'](_0xcfc4('0x7'));}catch(_0x2d8256){return _0x57bf8a(_0x2d8256);}return _0x54bee8({'method':'POST','uri':host+_0xcfc4('0x8')+_0xb8f67b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x3a0bd9},'audio':{'content':_0x436d9b}},'json':!![]});});}; \ No newline at end of file +var _0x4517=['undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string'];(function(_0x4823f7,_0x2b3c45){var _0x507df1=function(_0x20414c){while(--_0x20414c){_0x4823f7['push'](_0x4823f7['shift']());}};_0x507df1(++_0x2b3c45);}(_0x4517,0x112));var _0x7451=function(_0x2aff7b,_0x1372c3){_0x2aff7b=_0x2aff7b-0x0;var _0x2bdb41=_0x4517[_0x2aff7b];return _0x2bdb41;};'use strict';var url=require('url');var BPromise=require(_0x7451('0x0'));var fs=require('fs');var host=_0x7451('0x1');module['exports']=function(_0x121fa7,_0xd66e4,_0x24505e){return new BPromise(function(_0x286bf4,_0x355fbd){var _0x21b34c;if(typeof _0x121fa7!==_0x7451('0x2')||_0x121fa7[_0x7451('0x3')]===0x0){return _0x355fbd(_0x7451('0x4'));}if(typeof _0xd66e4!==_0x7451('0x2')||_0xd66e4[_0x7451('0x3')]===0x0){return _0x355fbd(_0x7451('0x5'));}if(typeof _0x24505e!==_0x7451('0x6')&&(typeof _0x24505e!==_0x7451('0x2')||_0x24505e[_0x7451('0x3')]===0x0)){return _0x355fbd(_0x7451('0x7'));}try{_0x21b34c=fs[_0x7451('0x8')](_0x121fa7)['toString'](_0x7451('0x9'));}catch(_0xc586c3){return _0x355fbd(_0xc586c3);}return _0x286bf4({'method':_0x7451('0xa'),'uri':host+_0x7451('0xb')+_0xd66e4,'body':{'config':{'encoding':_0x7451('0xc'),'sampleRateHertz':_0x7451('0xd'),'languageCode':_0x24505e},'audio':{'content':_0x21b34c}},'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 44c429f..29bdb5b 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 _0xb5ed=['exports','./asr'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5ed,0xe7));var _0xdb5e=function(_0x58220b,_0xf23808){_0x58220b=_0x58220b-0x0;var _0x21d69d=_0xb5ed[_0x58220b];return _0x21d69d;};var asr=require(_0xdb5e('0x0'));module[_0xdb5e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd0f3=['exports','./asr'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xd0f3,0x11f));var _0x3d0f=function(_0x27bd9b,_0x206238){_0x27bd9b=_0x27bd9b-0x0;var _0xbd6219=_0xd0f3[_0x27bd9b];return _0xbd6219;};var asr=require(_0x3d0f('0x0'));module[_0x3d0f('0x1')]={'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 9a1d282..f59f840 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 _0x6da8=['stringify','jQ1olc','null','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','result','source','resolvedQuery','action','speech','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','text','CustomAction','channelData','AudioFromTts','audiofile','apiai-promise','bluebird','dialogflow','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','host','\x20failed,\x20status\x20code\x20=\x20','data','wav','error\x20convert','resolve','tmp','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','then','generate','.mp3','from','audioContent','writeFile','.wav','unlink','googleCloudTTS\x20path','utf8','application/x-www-form-urlencoded'];(function(_0x37f7b7,_0x3cf4d8){var _0x3c4497=function(_0x1ed3e3){while(--_0x1ed3e3){_0x37f7b7['push'](_0x37f7b7['shift']());}};_0x3c4497(++_0x3cf4d8);}(_0x6da8,0x1be));var _0x86da=function(_0x4b6c61,_0x51e994){_0x4b6c61=_0x4b6c61-0x0;var _0x4041ba=_0x6da8[_0x4b6c61];return _0x4041ba;};'use strict';var apiai=require(_0x86da('0x0'));var BPromise=require(_0x86da('0x1'));var dialogflow=require(_0x86da('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x86da('0x3'));var md5=require('md5');var path=require(_0x86da('0x4'));var querystring=require(_0x86da('0x5'));var rp=require(_0x86da('0x6'));var rs=require(_0x86da('0x7'));var sox=require(_0x86da('0x8'));var tts=require(_0x86da('0x9'));var urlParse=require(_0x86da('0xa'))[_0x86da('0xb')];var util=require(_0x86da('0xc'));var aws=require('./aws');var google=require(_0x86da('0xd'));var sestek=require(_0x86da('0xe'));var tilde=require(_0x86da('0xf'));var logger=require(_0x86da('0x10'))(_0x86da('0x11'));var ISPEECH_API=_0x86da('0x12');function downloadFile(_0x1a2764,_0x24aa7d){return new BPromise(function(_0x28312a,_0xcefceb){var _0x240713=urlParse(_0x1a2764);var _0x4b1617=_0x240713['protocol']===_0x86da('0x13')?https:http;var _0x4e2c62={'host':_0x240713['host'],'path':_0x240713[_0x86da('0x4')],'headers':{'user-agent':_0x86da('0x14')}};_0x4b1617[_0x86da('0x15')](_0x4e2c62,function(_0x3dfb30){if(_0x3dfb30[_0x86da('0x16')]!==0xc8){logger[_0x86da('0x17')](_0x86da('0x18')+_0x1a2764+'\x20failed,\x20status\x20code\x20=\x20'+_0x3dfb30[_0x86da('0x16')]+'\x20('+_0x3dfb30[_0x86da('0x19')]+')');_0xcefceb(new Error(_0x86da('0x18')+_0x1a2764+'\x20failed,\x20status\x20code\x20=\x20'+_0x3dfb30['statusCode']+'\x20('+_0x3dfb30[_0x86da('0x19')]+')'));return;}var _0x135cf3=fs[_0x86da('0x1a')](_0x24aa7d);_0x135cf3['on'](_0x86da('0x1b'),function(){logger[_0x86da('0x1c')](_0x86da('0x1d'));_0x135cf3[_0x86da('0x1e')](_0x28312a);});_0x135cf3['on'](_0x86da('0x17'),function(_0x5037c9){fs['unlink'](_0x24aa7d);logger['error'](_0x86da('0x1f'),_0x5037c9);_0xcefceb(_0x5037c9);});_0x3dfb30[_0x86da('0x20')](_0x135cf3);})['on'](_0x86da('0x17'),function(_0x533375){logger[_0x86da('0x17')](_0x533375);_0xcefceb(_0x533375);})[_0x86da('0x21')]();});}function uploadFile(_0x54efbc){return new BPromise(function(_0x5e814b,_0x45d6b1){var _0x2c12dc=urlParse(_0x54efbc);var _0x3894db=_0x2c12dc['protocol']===_0x86da('0x13')?https:http;var _0x161836={'host':_0x2c12dc[_0x86da('0x22')],'path':_0x2c12dc[_0x86da('0x4')],'headers':{'user-agent':_0x86da('0x14')}};_0x3894db[_0x86da('0x15')](_0x161836,function(_0x1c083a){if(_0x1c083a[_0x86da('0x16')]!==0xc8){_0x45d6b1(new Error(_0x86da('0x18')+_0x54efbc+_0x86da('0x23')+_0x1c083a['statusCode']+'\x20('+_0x1c083a['statusMessage']+')'));return;}var _0x30619c='';_0x1c083a['on'](_0x86da('0x24'),function(_0x5d8d72){_0x30619c+=_0x5d8d72;});_0x1c083a['on']('end',function(){_0x5e814b(_0x30619c);});})['on'](_0x86da('0x17'),function(_0x2ebc1e){_0x45d6b1(_0x2ebc1e);})[_0x86da('0x21')]();});}function convertFile(_0x1d942f,_0x4f9156){return new BPromise(function(_0x3a3f97,_0x2c5662){var _0x43f042=sox['transcode'](_0x1d942f,_0x4f9156,{'sampleRate':0x1f40,'format':_0x86da('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x43f042['on'](_0x86da('0x17'),function(_0x3eb3be){logger[_0x86da('0x17')](_0x86da('0x26'),_0x3eb3be);_0x2c5662(_0x3eb3be);});_0x43f042['on']('end',function(){logger[_0x86da('0x1c')]('finish\x20to\x20convert');_0x3a3f97();});_0x43f042['start']();});}function base64Decode(_0x54a0d9,_0x4e7399){var _0x5babe6=path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs['generate'](0x4)+'.wav');fs[_0x86da('0x29')](_0x5babe6,_0x54a0d9,_0x86da('0x2a'));return convertFile(_0x5babe6,_0x4e7399)['then'](function(){try{fs['unlink'](_0x5babe6);fs[_0x86da('0x2b')](_0x4e7399,_0x86da('0x2c'));}catch(_0x1ca2e6){logger[_0x86da('0x17')](_0x1ca2e6);}return _0x4e7399[_0x86da('0x2d')]('.')[0x0];});}function base64Encode(_0x9d4599){var _0x36325c=fs[_0x86da('0x2e')](_0x9d4599);return new Buffer(_0x36325c)[_0x86da('0x2f')](_0x86da('0x2a'));}exports['googleCloudTTS']=function(_0x3acf57,_0x222440,_0x657008,_0x1136f8,_0x255898,_0x2827c5){var _0x162831,_0x44a6a4;var _0x44b69d='https://texttospeech.googleapis.com/v1/';var _0x2d4b0d='?key='+_0x3acf57;var _0x36d52b={};if(_0x222440===_0x86da('0x30')){_0x36d52b[_0x86da('0x31')]={'ssml':_0x657008};}else{_0x36d52b[_0x86da('0x31')]={'text':_0x657008};};_0x36d52b[_0x86da('0x32')]={'languageCode':_0x1136f8,'ssmlGender':_0x255898};_0x36d52b[_0x86da('0x33')]={'audioEncoding':_0x86da('0x34'),'sampleRateHertz':0x1f40};var _0x3b1ddc={'url':_0x44b69d+_0x86da('0x35')+_0x2d4b0d,'method':_0x86da('0x36'),'json':!![],'body':_0x36d52b};return rp(_0x3b1ddc)[_0x86da('0x37')](function(_0x433389){return new BPromise(function(_0xca937c,_0x13e11b){_0x162831=path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs[_0x86da('0x38')](0x4)+_0x86da('0x39'));var _0x1d1cf0=Buffer[_0x86da('0x3a')](_0x433389[_0x86da('0x3b')],'base64');return fs[_0x86da('0x3c')](_0x162831,_0x1d1cf0,function(_0x818dbd){_0x13e11b(_0x818dbd);},function(_0x402b51){fs[_0x86da('0x2b')](_0x162831,_0x86da('0x2c'));_0xca937c(_0x402b51);});});})[_0x86da('0x37')](function(_0x440c00){_0x44a6a4=path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs['generate'](0x4)+_0x86da('0x3d'));return convertFile(_0x162831,_0x44a6a4);})[_0x86da('0x37')](function(){try{fs[_0x86da('0x3e')](_0x162831);fs[_0x86da('0x2b')](_0x44a6a4,_0x86da('0x2c'));}catch(_0x56e009){logger[_0x86da('0x17')](_0x56e009);}logger[_0x86da('0x1c')](_0x86da('0x3f'),_0x44a6a4['split']('.')[0x0]);return _0x44a6a4[_0x86da('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x25eef0,_0x2159c7){var _0x381531='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0xcceae0,_0x31869d;var _0x35d00e;var _0x3553bc={'encoding':_0x86da('0x40'),'method':'POST','timeout':0x2710,'url':_0x381531,'headers':{'Content-Type':_0x86da('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x86da('0x42')]([[[_0x86da('0x43'),JSON[_0x86da('0x42')]([_0x25eef0,_0x2159c7||'en',![],_0x86da('0x44')]),null,'generic']]]))};return rp(_0x3553bc)[_0x86da('0x37')](function(_0x289dc9){try{_0x35d00e=eval(_0x289dc9['slice'](0x5))[0x0][0x2];}catch(_0x31797d){throw new Error('parse\x20response\x20failed:\x0a'+_0x289dc9[_0x86da('0x24')]);}if(!_0x35d00e){if(_0x25eef0[_0x86da('0x45')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x86da('0x46')+_0x2159c7+_0x86da('0x47'));}}try{_0x35d00e=eval(_0x35d00e)[0x0];}catch(_0x126bab){throw new Error(_0x86da('0x48')+res[_0x86da('0x24')]);}const _0x5edc1e=_0x35d00e;_0xcceae0=path[_0x86da('0x27')](__dirname,'tmp',rs[_0x86da('0x38')](0x4)+_0x86da('0x39'));fs['writeFileSync'](_0xcceae0,_0x35d00e,{'encoding':_0x86da('0x2a')});_0x31869d=path['resolve'](__dirname,'tmp',rs[_0x86da('0x38')](0x4)+'.wav');return convertFile(_0xcceae0,_0x31869d);})[_0x86da('0x37')](function(){try{fs[_0x86da('0x3e')](_0xcceae0);fs[_0x86da('0x2b')](_0x31869d,_0x86da('0x2c'));}catch(_0x4575b7){logger[_0x86da('0x17')](_0x4575b7);}logger[_0x86da('0x1c')](_0x86da('0x49'),_0x31869d['split']('.')[0x0]);return _0x31869d['split']('.')[0x0];});};exports[_0x86da('0x4a')]=function(_0x350e29,_0x33afe1,_0x2cadf7){return google[_0x86da('0x4b')](_0x350e29,_0x33afe1,_0x2cadf7)[_0x86da('0x37')](function(_0x4ad5ed){logger[_0x86da('0x1c')](_0x4ad5ed[_0x86da('0x4c')]);return rp(_0x4ad5ed);})['then'](function(_0x94174d){var _0x265337='';var _0x46d039=0x0;try{fs[_0x86da('0x3e')](_0x350e29);}catch(_0x2cf845){logger[_0x86da('0x17')](_0x2cf845);}if(_0x94174d&&_0x94174d[_0x86da('0x4d')]){_0x265337=_0x94174d[_0x86da('0x4d')][_0x86da('0x4e')](function(_0x789381){return _0x789381&&_0x789381['alternatives'][0x0]&&_0x789381[_0x86da('0x4f')][0x0][_0x86da('0x50')]?_0x789381['alternatives'][0x0][_0x86da('0x50')]:'';})[_0x86da('0x51')]('\x0a');_0x46d039=_0x94174d[_0x86da('0x4d')]['map'](function(_0x21a922){return _0x21a922&&_0x21a922[_0x86da('0x4f')][0x0]&&_0x21a922[_0x86da('0x4f')][0x0][_0x86da('0x52')]?_0x21a922[_0x86da('0x4f')][0x0][_0x86da('0x52')]:0x0;})[_0x86da('0x51')]('\x0a');}logger['info'](_0x86da('0x53'),_0x265337);logger[_0x86da('0x1c')]('googleASR\x20confidence',_0x46d039);return{'transcript':_0x265337,'confidence':_0x46d039};})[_0x86da('0x54')](function(_0x541c27){logger[_0x86da('0x17')](_0x86da('0x55'),_0x541c27['statusCode'],_0x541c27[_0x86da('0x56')],_0x541c27['message']);});};exports['googleDialogflow']=function(_0xfcc0c9,_0x49b759,_0x2f00fa,_0x43efe9){var _0x44241b=apiai(_0x49b759,{'language':_0x43efe9||'en'});return _0x44241b['textRequest'](_0x2f00fa,{'sessionId':md5(_0xfcc0c9)})[_0x86da('0x37')](function(_0x1b0857){logger[_0x86da('0x1c')](JSON['stringify'](_0x1b0857));return{'source':_0x1b0857[_0x86da('0x57')][_0x86da('0x58')],'resolvedQuery':_0x1b0857['result'][_0x86da('0x59')],'action':_0x1b0857['result'][_0x86da('0x5a')],'actionIncomplete':_0x1b0857[_0x86da('0x57')]['actionIncomplete'],'speech':_0x1b0857[_0x86da('0x57')]['fulfillment'][_0x86da('0x5b')],'score':_0x1b0857[_0x86da('0x57')]['score'],'statusCode':_0x1b0857['status'][_0x86da('0x5c')],'endConversation':_0x1b0857['result']['metadata'][_0x86da('0x5d')]||![],'isFallbackIntent':_0x1b0857[_0x86da('0x57')][_0x86da('0x5e')][_0x86da('0x5f')]};});};exports[_0x86da('0x60')]=function(_0x4fcc1a,_0x5bec4e,_0x3d550e,_0x3a9be7,_0x4896e0,_0x222920){var _0x2c5ca8=_0x3a9be7[_0x86da('0x61')](/\\n/g,'\x0a');var _0x1cf2fb={'credentials':{'private_key':_0x2c5ca8,'client_email':_0x3d550e}};var _0x25f280=new dialogflow['SessionsClient'](_0x1cf2fb);var _0x59d3fd=_0x25f280[_0x86da('0x62')](_0x5bec4e,md5(_0x4fcc1a));var _0xa69539={'session':_0x59d3fd,'queryInput':{'text':{'text':_0x4896e0,'languageCode':_0x222920}}};return _0x25f280[_0x86da('0x63')](_0xa69539)[_0x86da('0x37')](function(_0x1e0d4d){if(_0x1e0d4d&&_0x1e0d4d[_0x86da('0x45')]){logger['info'](_0x86da('0x64'),JSON[_0x86da('0x42')](_0x1e0d4d));var _0x2fde8e=_0x1e0d4d[0x0];if(_0x2fde8e){var _0x2ea10f={'action':_0x2fde8e['queryResult']['action'],'allRequiredParamsPresent':_0x2fde8e[_0x86da('0x65')][_0x86da('0x66')],'endConversation':_0x2fde8e['queryResult'][_0x86da('0x67')]&&_0x2fde8e[_0x86da('0x65')][_0x86da('0x67')][_0x86da('0x68')]?_0x2fde8e[_0x86da('0x65')][_0x86da('0x67')][_0x86da('0x68')][_0x86da('0x69')]['boolValue']:![],'fulfillmentText':_0x2fde8e[_0x86da('0x65')][_0x86da('0x6a')],'intentName':_0x2fde8e[_0x86da('0x65')]['intent']['name'],'intentDisplayName':_0x2fde8e[_0x86da('0x65')]['intent']['displayName'],'isFallbackIntent':_0x2fde8e[_0x86da('0x65')][_0x86da('0x6b')]['isFallback'],'languageCode':_0x2fde8e['queryResult'][_0x86da('0x6c')],'queryText':_0x2fde8e[_0x86da('0x65')][_0x86da('0x6d')],'responseId':_0x2fde8e['responseId'],'score':_0x2fde8e['queryResult']['intentDetectionConfidence'],'speech':_0x2fde8e[_0x86da('0x65')][_0x86da('0x6a')],'providerResponse':JSON[_0x86da('0x42')](_0x1e0d4d)};return _0x2ea10f;}}});};exports[_0x86da('0x6e')]=function(_0x3cfbdf,_0x18d982,_0x479b8d,_0x5cd5cf){return tilde[_0x86da('0x4b')](_0x3cfbdf,_0x18d982,_0x479b8d,_0x5cd5cf)[_0x86da('0x37')](function(_0xccabee){try{fs[_0x86da('0x3e')](_0x3cfbdf);}catch(_0x583296){logger[_0x86da('0x17')](_0x583296);}logger[_0x86da('0x1c')](_0x86da('0x6f'),_0xccabee[_0x86da('0x50')]);logger[_0x86da('0x1c')](_0x86da('0x70'),_0xccabee[_0x86da('0x52')]);return _0xccabee;});};exports[_0x86da('0x71')]=function(_0xc52752,_0x5bedd7,_0x3e36de,_0x11ee45,_0x5ca72e,_0x4c2945){var _0x4de4c3=path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs[_0x86da('0x38')](0x4)+_0x86da('0x39'));var _0x3487b1;return aws['polly'](_0xc52752,_0x5bedd7,_0x3e36de,_0x11ee45,_0x5ca72e,_0x4c2945,_0x4de4c3)['then'](function(){_0x3487b1=path['resolve'](__dirname,_0x86da('0x28'),rs[_0x86da('0x38')](0x4)+_0x86da('0x3d'));return convertFile(_0x4de4c3,_0x3487b1);})[_0x86da('0x37')](function(){try{fs['unlink'](_0x4de4c3);fs[_0x86da('0x2b')](_0x3487b1,_0x86da('0x2c'));}catch(_0x1d574d){logger[_0x86da('0x17')](_0x1d574d);}return _0x3487b1[_0x86da('0x2d')]('.')[0x0];});};exports[_0x86da('0x72')]=function(_0x2c8a9f,_0x19b701,_0x1125d5,_0x5caeed,_0x419e1a,_0x42079b){return aws[_0x86da('0x73')](_0x2c8a9f,_0x19b701,_0x1125d5,_0x5caeed,_0x419e1a,_0x42079b)[_0x86da('0x37')](function(_0x534092){logger[_0x86da('0x1c')](JSON[_0x86da('0x42')](_0x534092));return _0x534092;});};exports[_0x86da('0x74')]=function(_0x2f1bce,_0x159b0f,_0x6ee91a,_0x257bc6){var _0xe8304c=util[_0x86da('0x75')](_0x86da('0x76'),ISPEECH_API,_0x2f1bce,encodeURIComponent(_0x159b0f),_0x6ee91a,_0x257bc6);var _0x39bcac=path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs[_0x86da('0x38')](0x4)+_0x86da('0x39'));var _0x1055e7;return downloadFile(_0xe8304c,_0x39bcac)['then'](function(){_0x1055e7=path['resolve'](__dirname,_0x86da('0x28'),rs[_0x86da('0x38')](0x4)+'.wav');return convertFile(_0x39bcac,_0x1055e7);})[_0x86da('0x37')](function(){try{fs[_0x86da('0x3e')](_0x39bcac);fs[_0x86da('0x2b')](_0x1055e7,_0x86da('0x2c'));}catch(_0x3dc4c1){logger[_0x86da('0x17')](_0x3dc4c1);}return _0x1055e7['split']('.')[0x0];});};exports[_0x86da('0x77')]=function(_0x48c163,_0x4c9aa8,_0x2dec73,_0x54d8e8){var _0x1c054f=util[_0x86da('0x75')](_0x86da('0x78'),ISPEECH_API,_0x4c9aa8,_0x2dec73,base64Encode(_0x48c163),_0x54d8e8?util[_0x86da('0x75')](_0x86da('0x79'),encodeURIComponent(_0x54d8e8)):_0x86da('0x7a'));return uploadFile(_0x1c054f)['then'](function(_0x2c435a){return querystring[_0x86da('0xb')](_0x2c435a);});};exports['sestekNDA']=function(_0x528026,_0x57e937){return sestek['nda'](_0x528026,_0x57e937)[_0x86da('0x37')](function(_0x50a8cd){logger['info'](JSON[_0x86da('0x42')](_0x50a8cd));var _0x329ac3={'speech':_0x50a8cd[_0x86da('0x7b')],'action':_0x50a8cd['channelData']?_0x50a8cd['channelData'][_0x86da('0x7c')]:undefined,'actiondata':_0x50a8cd[_0x86da('0x7d')]?_0x50a8cd[_0x86da('0x7d')]['CustomActionData']:undefined};if(_0x50a8cd['channelData']&&_0x50a8cd['channelData'][_0x86da('0x7e')]){return base64Decode(_0x50a8cd[_0x86da('0x7d')][_0x86da('0x7e')]['Data'],path[_0x86da('0x27')](__dirname,_0x86da('0x28'),rs['generate'](0x4)+_0x86da('0x3d')))['then'](function(_0x485038){_0x329ac3[_0x86da('0x7f')]=_0x485038;return _0x329ac3;});}return _0x329ac3;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x1c11=['jQ1olc','null','generic','slice','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','asr','uri','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','queryText','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','ispeechASR','model=%s','nda','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','dialogflow','https','md5','querystring','randomstring','sox','google-tts-api','parse','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','generate','then','chmodSync','777','split','readFileSync','toString','base64','googleCloudTTS','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify'];(function(_0x4c35d8,_0x344e20){var _0x20f0e9=function(_0x39ed4e){while(--_0x39ed4e){_0x4c35d8['push'](_0x4c35d8['shift']());}};_0x20f0e9(++_0x344e20);}(_0x1c11,0x14b));var _0x11c1=function(_0x2118ae,_0x225ca7){_0x2118ae=_0x2118ae-0x0;var _0x1f8c44=_0x1c11[_0x2118ae];return _0x1f8c44;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x11c1('0x0'));var fs=require('fs');var http=require('http');var https=require(_0x11c1('0x1'));var md5=require(_0x11c1('0x2'));var path=require('path');var querystring=require(_0x11c1('0x3'));var rp=require('request-promise');var rs=require(_0x11c1('0x4'));var sox=require(_0x11c1('0x5'));var tts=require(_0x11c1('0x6'));var urlParse=require('url')[_0x11c1('0x7')];var util=require('util');var aws=require('./aws');var google=require(_0x11c1('0x8'));var sestek=require(_0x11c1('0x9'));var tilde=require(_0x11c1('0xa'));var logger=require(_0x11c1('0xb'))(_0x11c1('0xc'));var ISPEECH_API=_0x11c1('0xd');function downloadFile(_0x283fdf,_0x24190f){return new BPromise(function(_0x5c55cc,_0x2eeeef){var _0x3dc940=urlParse(_0x283fdf);var _0xa3cdb9=_0x3dc940[_0x11c1('0xe')]==='https:'?https:http;var _0x1dcd07={'host':_0x3dc940['host'],'path':_0x3dc940[_0x11c1('0xf')],'headers':{'user-agent':_0x11c1('0x10')}};_0xa3cdb9[_0x11c1('0x11')](_0x1dcd07,function(_0xb45486){if(_0xb45486[_0x11c1('0x12')]!==0xc8){logger[_0x11c1('0x13')](_0x11c1('0x14')+_0x283fdf+_0x11c1('0x15')+_0xb45486['statusCode']+'\x20('+_0xb45486[_0x11c1('0x16')]+')');_0x2eeeef(new Error(_0x11c1('0x14')+_0x283fdf+_0x11c1('0x15')+_0xb45486[_0x11c1('0x12')]+'\x20('+_0xb45486[_0x11c1('0x16')]+')'));return;}var _0x295362=fs[_0x11c1('0x17')](_0x24190f);_0x295362['on'](_0x11c1('0x18'),function(){logger[_0x11c1('0x19')](_0x11c1('0x1a'));_0x295362[_0x11c1('0x1b')](_0x5c55cc);});_0x295362['on'](_0x11c1('0x13'),function(_0x4a08aa){fs[_0x11c1('0x1c')](_0x24190f);logger[_0x11c1('0x13')]('download\x20error',_0x4a08aa);_0x2eeeef(_0x4a08aa);});_0xb45486[_0x11c1('0x1d')](_0x295362);})['on'](_0x11c1('0x13'),function(_0x5e5c31){logger['error'](_0x5e5c31);_0x2eeeef(_0x5e5c31);})[_0x11c1('0x1e')]();});}function uploadFile(_0x294f74){return new BPromise(function(_0x2855d9,_0x1bc87b){var _0x591f39=urlParse(_0x294f74);var _0x194f0c=_0x591f39['protocol']==='https:'?https:http;var _0x10a007={'host':_0x591f39['host'],'path':_0x591f39[_0x11c1('0xf')],'headers':{'user-agent':_0x11c1('0x10')}};_0x194f0c[_0x11c1('0x11')](_0x10a007,function(_0x18e477){if(_0x18e477['statusCode']!==0xc8){_0x1bc87b(new Error('request\x20to\x20'+_0x294f74+_0x11c1('0x15')+_0x18e477[_0x11c1('0x12')]+'\x20('+_0x18e477[_0x11c1('0x16')]+')'));return;}var _0x49e664='';_0x18e477['on'](_0x11c1('0x1f'),function(_0x10c935){_0x49e664+=_0x10c935;});_0x18e477['on'](_0x11c1('0x1e'),function(){_0x2855d9(_0x49e664);});})['on']('error',function(_0x1b87ab){_0x1bc87b(_0x1b87ab);})['end']();});}function convertFile(_0x12ad75,_0x3c0df8){return new BPromise(function(_0x4151b3,_0x32cc49){var _0x2c3c11=sox[_0x11c1('0x20')](_0x12ad75,_0x3c0df8,{'sampleRate':0x1f40,'format':_0x11c1('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2c3c11['on'](_0x11c1('0x13'),function(_0x300bce){logger[_0x11c1('0x13')](_0x11c1('0x22'),_0x300bce);_0x32cc49(_0x300bce);});_0x2c3c11['on'](_0x11c1('0x1e'),function(){logger[_0x11c1('0x19')](_0x11c1('0x23'));_0x4151b3();});_0x2c3c11['start']();});}function base64Decode(_0x521455,_0x2ee7d3){var _0x110996=path[_0x11c1('0x24')](__dirname,'tmp',rs[_0x11c1('0x25')](0x4)+'.wav');fs['writeFileSync'](_0x110996,_0x521455,'base64');return convertFile(_0x110996,_0x2ee7d3)[_0x11c1('0x26')](function(){try{fs[_0x11c1('0x1c')](_0x110996);fs[_0x11c1('0x27')](_0x2ee7d3,_0x11c1('0x28'));}catch(_0x2877cd){logger[_0x11c1('0x13')](_0x2877cd);}return _0x2ee7d3[_0x11c1('0x29')]('.')[0x0];});}function base64Encode(_0x100fdc){var _0x464244=fs[_0x11c1('0x2a')](_0x100fdc);return new Buffer(_0x464244)[_0x11c1('0x2b')](_0x11c1('0x2c'));}exports[_0x11c1('0x2d')]=function(_0x1dcc7b,_0x3ff04d,_0x414e62,_0xc6c6e9,_0x103b53,_0xf04b07){var _0x479308,_0x3966e3;var _0x302655='https://texttospeech.googleapis.com/v1/';var _0xed4db=_0x11c1('0x2e')+_0x1dcc7b;var _0x52a877={};if(_0x3ff04d===_0x11c1('0x2f')){_0x52a877[_0x11c1('0x30')]={'ssml':_0x414e62};}else{_0x52a877['input']={'text':_0x414e62};};_0x52a877[_0x11c1('0x31')]={'languageCode':_0xc6c6e9,'ssmlGender':_0x103b53};_0x52a877[_0x11c1('0x32')]={'audioEncoding':_0x11c1('0x33'),'sampleRateHertz':0x1f40};var _0x3fda66={'url':_0x302655+_0x11c1('0x34')+_0xed4db,'method':_0x11c1('0x35'),'json':!![],'body':_0x52a877};return rp(_0x3fda66)[_0x11c1('0x26')](function(_0x5b1679){return new BPromise(function(_0x8cebb5,_0x1670e4){_0x479308=path[_0x11c1('0x24')](__dirname,_0x11c1('0x36'),rs[_0x11c1('0x25')](0x4)+_0x11c1('0x37'));var _0x5703bd=Buffer[_0x11c1('0x38')](_0x5b1679[_0x11c1('0x39')],_0x11c1('0x2c'));return fs[_0x11c1('0x3a')](_0x479308,_0x5703bd,function(_0xd97b17){_0x1670e4(_0xd97b17);},function(_0x4e69b0){fs[_0x11c1('0x27')](_0x479308,_0x11c1('0x28'));_0x8cebb5(_0x4e69b0);});});})[_0x11c1('0x26')](function(_0x49cf6f){_0x3966e3=path[_0x11c1('0x24')](__dirname,_0x11c1('0x36'),rs['generate'](0x4)+_0x11c1('0x3b'));return convertFile(_0x479308,_0x3966e3);})[_0x11c1('0x26')](function(){try{fs[_0x11c1('0x1c')](_0x479308);fs[_0x11c1('0x27')](_0x3966e3,_0x11c1('0x28'));}catch(_0x5c3dad){logger['error'](_0x5c3dad);}logger['info'](_0x11c1('0x3c'),_0x3966e3[_0x11c1('0x29')]('.')[0x0]);return _0x3966e3[_0x11c1('0x29')]('.')[0x0];});};exports[_0x11c1('0x3d')]=function(_0x37ad43,_0x2e63a3){var _0x2cc31e='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x5d3c9c,_0x43c4b6;var _0x53b480;var _0x35feac={'encoding':_0x11c1('0x3e'),'method':'POST','timeout':0x2710,'url':_0x2cc31e,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x11c1('0x3f')+encodeURIComponent(JSON[_0x11c1('0x40')]([[[_0x11c1('0x41'),JSON['stringify']([_0x37ad43,_0x2e63a3||'en',![],_0x11c1('0x42')]),null,_0x11c1('0x43')]]]))};return rp(_0x35feac)['then'](function(_0x1ac038){try{_0x53b480=eval(_0x1ac038[_0x11c1('0x44')](0x5))[0x0][0x2];}catch(_0xb73753){throw new Error(_0x11c1('0x45')+_0x1ac038[_0x11c1('0x1f')]);}if(!_0x53b480){if(_0x37ad43[_0x11c1('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x11c1('0x47')+_0x2e63a3+_0x11c1('0x48'));}}try{_0x53b480=eval(_0x53b480)[0x0];}catch(_0x460dd6){throw new Error(_0x11c1('0x45')+res['data']);}const _0x5956bb=_0x53b480;_0x5d3c9c=path[_0x11c1('0x24')](__dirname,'tmp',rs[_0x11c1('0x25')](0x4)+'.mp3');fs[_0x11c1('0x49')](_0x5d3c9c,_0x53b480,{'encoding':'base64'});_0x43c4b6=path['resolve'](__dirname,_0x11c1('0x36'),rs['generate'](0x4)+_0x11c1('0x3b'));return convertFile(_0x5d3c9c,_0x43c4b6);})['then'](function(){try{fs[_0x11c1('0x1c')](_0x5d3c9c);fs[_0x11c1('0x27')](_0x43c4b6,_0x11c1('0x28'));}catch(_0x1f4cf1){logger[_0x11c1('0x13')](_0x1f4cf1);}logger[_0x11c1('0x19')]('goggleTTS\x20path',_0x43c4b6[_0x11c1('0x29')]('.')[0x0]);return _0x43c4b6[_0x11c1('0x29')]('.')[0x0];});};exports['googleASR']=function(_0x3533a7,_0x4e145b,_0x49dd90){return google[_0x11c1('0x4a')](_0x3533a7,_0x4e145b,_0x49dd90)[_0x11c1('0x26')](function(_0x11562f){logger[_0x11c1('0x19')](_0x11562f[_0x11c1('0x4b')]);return rp(_0x11562f);})['then'](function(_0x64c77d){var _0x1bd608='';var _0x130ba0=0x0;try{fs['unlink'](_0x3533a7);}catch(_0x5bc70b){logger[_0x11c1('0x13')](_0x5bc70b);}if(_0x64c77d&&_0x64c77d[_0x11c1('0x4c')]){_0x1bd608=_0x64c77d[_0x11c1('0x4c')][_0x11c1('0x4d')](function(_0x44bdbb){return _0x44bdbb&&_0x44bdbb['alternatives'][0x0]&&_0x44bdbb[_0x11c1('0x4e')][0x0]['transcript']?_0x44bdbb[_0x11c1('0x4e')][0x0][_0x11c1('0x4f')]:'';})[_0x11c1('0x50')]('\x0a');_0x130ba0=_0x64c77d[_0x11c1('0x4c')][_0x11c1('0x4d')](function(_0x3f5163){return _0x3f5163&&_0x3f5163[_0x11c1('0x4e')][0x0]&&_0x3f5163[_0x11c1('0x4e')][0x0][_0x11c1('0x51')]?_0x3f5163['alternatives'][0x0][_0x11c1('0x51')]:0x0;})[_0x11c1('0x50')]('\x0a');}logger[_0x11c1('0x19')]('googleASR\x20transcription',_0x1bd608);logger[_0x11c1('0x19')]('googleASR\x20confidence',_0x130ba0);return{'transcript':_0x1bd608,'confidence':_0x130ba0};})[_0x11c1('0x52')](function(_0x43d695){logger[_0x11c1('0x13')](_0x11c1('0x53'),_0x43d695[_0x11c1('0x12')],_0x43d695['name'],_0x43d695[_0x11c1('0x54')]);});};exports[_0x11c1('0x55')]=function(_0x3ced89,_0x419c5e,_0x4ed4f7,_0xa8d9ad){var _0x459e64=apiai(_0x419c5e,{'language':_0xa8d9ad||'en'});return _0x459e64[_0x11c1('0x56')](_0x4ed4f7,{'sessionId':md5(_0x3ced89)})[_0x11c1('0x26')](function(_0x3a1d){logger[_0x11c1('0x19')](JSON[_0x11c1('0x40')](_0x3a1d));return{'source':_0x3a1d['result'][_0x11c1('0x57')],'resolvedQuery':_0x3a1d[_0x11c1('0x58')][_0x11c1('0x59')],'action':_0x3a1d[_0x11c1('0x58')][_0x11c1('0x5a')],'actionIncomplete':_0x3a1d['result'][_0x11c1('0x5b')],'speech':_0x3a1d[_0x11c1('0x58')][_0x11c1('0x5c')][_0x11c1('0x5d')],'score':_0x3a1d[_0x11c1('0x58')][_0x11c1('0x5e')],'statusCode':_0x3a1d[_0x11c1('0x5f')]['code'],'endConversation':_0x3a1d[_0x11c1('0x58')]['metadata'][_0x11c1('0x60')]||![],'isFallbackIntent':_0x3a1d['result'][_0x11c1('0x61')][_0x11c1('0x62')]};});};exports[_0x11c1('0x63')]=function(_0x7e8430,_0x36bdeb,_0x427118,_0x3c4815,_0x53e6b5,_0x2f2370){var _0x41fd58=_0x3c4815[_0x11c1('0x64')](/\\n/g,'\x0a');var _0x238571={'credentials':{'private_key':_0x41fd58,'client_email':_0x427118}};var _0x24e158=new dialogflow[(_0x11c1('0x65'))](_0x238571);var _0x5057f4=_0x24e158['sessionPath'](_0x36bdeb,md5(_0x7e8430));var _0xb7be79={'session':_0x5057f4,'queryInput':{'text':{'text':_0x53e6b5,'languageCode':_0x2f2370}}};return _0x24e158[_0x11c1('0x66')](_0xb7be79)['then'](function(_0x1a25d8){if(_0x1a25d8&&_0x1a25d8[_0x11c1('0x46')]){logger[_0x11c1('0x19')]('Dialogflow\x20V2\x20response:',JSON[_0x11c1('0x40')](_0x1a25d8));var _0x566fdc=_0x1a25d8[0x0];if(_0x566fdc){var _0x38c1e6={'action':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x5a')],'allRequiredParamsPresent':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x68')],'endConversation':_0x566fdc[_0x11c1('0x67')]['diagnosticInfo']&&_0x566fdc[_0x11c1('0x67')][_0x11c1('0x69')][_0x11c1('0x6a')]?_0x566fdc['queryResult']['diagnosticInfo'][_0x11c1('0x6a')][_0x11c1('0x6b')][_0x11c1('0x6c')]:![],'fulfillmentText':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x6d')],'intentName':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x6e')][_0x11c1('0x6f')],'intentDisplayName':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x6e')][_0x11c1('0x70')],'isFallbackIntent':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x6e')][_0x11c1('0x71')],'languageCode':_0x566fdc['queryResult']['languageCode'],'queryText':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x72')],'responseId':_0x566fdc['responseId'],'score':_0x566fdc[_0x11c1('0x67')][_0x11c1('0x73')],'speech':_0x566fdc[_0x11c1('0x67')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x1a25d8)};return _0x38c1e6;}}});};exports['tildeASR']=function(_0x38f5d8,_0x3d7536,_0x247aef,_0x24f536){return tilde['asr'](_0x38f5d8,_0x3d7536,_0x247aef,_0x24f536)['then'](function(_0x153efa){try{fs[_0x11c1('0x1c')](_0x38f5d8);}catch(_0x5b976a){logger['error'](_0x5b976a);}logger['info'](_0x11c1('0x74'),_0x153efa['transcript']);logger[_0x11c1('0x19')](_0x11c1('0x75'),_0x153efa['confidence']);return _0x153efa;});};exports['awsPolly']=function(_0x48354e,_0x13d7d7,_0x57f3f6,_0x5d091b,_0x2c553b,_0xff7cc5){var _0x1647a1=path[_0x11c1('0x24')](__dirname,_0x11c1('0x36'),rs[_0x11c1('0x25')](0x4)+_0x11c1('0x37'));var _0x3a66c8;return aws[_0x11c1('0x76')](_0x48354e,_0x13d7d7,_0x57f3f6,_0x5d091b,_0x2c553b,_0xff7cc5,_0x1647a1)[_0x11c1('0x26')](function(){_0x3a66c8=path[_0x11c1('0x24')](__dirname,'tmp',rs[_0x11c1('0x25')](0x4)+_0x11c1('0x3b'));return convertFile(_0x1647a1,_0x3a66c8);})[_0x11c1('0x26')](function(){try{fs[_0x11c1('0x1c')](_0x1647a1);fs[_0x11c1('0x27')](_0x3a66c8,_0x11c1('0x28'));}catch(_0x1c3ff4){logger['error'](_0x1c3ff4);}return _0x3a66c8[_0x11c1('0x29')]('.')[0x0];});};exports[_0x11c1('0x77')]=function(_0x588765,_0x3a0496,_0x2f5f7f,_0x4b4026,_0x3b7839,_0x398824){return aws[_0x11c1('0x78')](_0x588765,_0x3a0496,_0x2f5f7f,_0x4b4026,_0x3b7839,_0x398824)[_0x11c1('0x26')](function(_0x5a1100){logger[_0x11c1('0x19')](JSON[_0x11c1('0x40')](_0x5a1100));return _0x5a1100;});};exports[_0x11c1('0x79')]=function(_0x4390c2,_0xb5e3c4,_0x5c9500,_0x3661f8){var _0x2e95c8=util[_0x11c1('0x7a')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x4390c2,encodeURIComponent(_0xb5e3c4),_0x5c9500,_0x3661f8);var _0x3b1b72=path['resolve'](__dirname,_0x11c1('0x36'),rs[_0x11c1('0x25')](0x4)+'.mp3');var _0x6b7e82;return downloadFile(_0x2e95c8,_0x3b1b72)['then'](function(){_0x6b7e82=path['resolve'](__dirname,_0x11c1('0x36'),rs[_0x11c1('0x25')](0x4)+_0x11c1('0x3b'));return convertFile(_0x3b1b72,_0x6b7e82);})[_0x11c1('0x26')](function(){try{fs['unlink'](_0x3b1b72);fs[_0x11c1('0x27')](_0x6b7e82,_0x11c1('0x28'));}catch(_0x5ae7d4){logger[_0x11c1('0x13')](_0x5ae7d4);}return _0x6b7e82[_0x11c1('0x29')]('.')[0x0];});};exports[_0x11c1('0x7b')]=function(_0x3f6959,_0x31b276,_0xc52cce,_0x49522b){var _0x2151d9=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x31b276,_0xc52cce,base64Encode(_0x3f6959),_0x49522b?util[_0x11c1('0x7a')](_0x11c1('0x7c'),encodeURIComponent(_0x49522b)):'freeform=3');return uploadFile(_0x2151d9)[_0x11c1('0x26')](function(_0x99044d){return querystring[_0x11c1('0x7')](_0x99044d);});};exports['sestekNDA']=function(_0x1a6667,_0x434e46){return sestek[_0x11c1('0x7d')](_0x1a6667,_0x434e46)[_0x11c1('0x26')](function(_0x3b36a3){logger[_0x11c1('0x19')](JSON[_0x11c1('0x40')](_0x3b36a3));var _0x20ad2b={'speech':_0x3b36a3['text'],'action':_0x3b36a3[_0x11c1('0x7e')]?_0x3b36a3[_0x11c1('0x7e')][_0x11c1('0x7f')]:undefined,'actiondata':_0x3b36a3[_0x11c1('0x7e')]?_0x3b36a3[_0x11c1('0x7e')][_0x11c1('0x80')]:undefined};if(_0x3b36a3[_0x11c1('0x7e')]&&_0x3b36a3[_0x11c1('0x7e')][_0x11c1('0x81')]){return base64Decode(_0x3b36a3[_0x11c1('0x7e')][_0x11c1('0x81')]['Data'],path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x11c1('0x3b')))['then'](function(_0x2084c3){_0x20ad2b[_0x11c1('0x82')]=_0x2084c3;return _0x20ad2b;});}return _0x20ad2b;});};exports[_0x11c1('0x83')]=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 aab1df1..46d6b0c 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 _0x4190=['./nda','exports'];(function(_0x1880f5,_0x18418a){var _0x3f0957=function(_0x22b58b){while(--_0x22b58b){_0x1880f5['push'](_0x1880f5['shift']());}};_0x3f0957(++_0x18418a);}(_0x4190,0x154));var _0x0419=function(_0x2c2a8e,_0x1dfe39){_0x2c2a8e=_0x2c2a8e-0x0;var _0x3b9e38=_0x4190[_0x2c2a8e];return _0x3b9e38;};var nda=require(_0x0419('0x0'));module[_0x0419('0x1')]={'nda':nda}; \ No newline at end of file +var _0xf2f4=['./nda'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0xf2f4,0x12d));var _0x4f2f=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xf2f4[_0x4ae829];return _0x256b31;};var nda=require(_0x4f2f('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 14a1350..d5d972d 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 _0x80c7=['CustomAction','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav'];(function(_0x2e1907,_0x229a70){var _0x401555=function(_0x487ac2){while(--_0x487ac2){_0x2e1907['push'](_0x2e1907['shift']());}};_0x401555(++_0x229a70);}(_0x80c7,0x8d));var _0x780c=function(_0x509acf,_0x2cccdb){_0x509acf=_0x509acf-0x0;var _0x415a55=_0x80c7[_0x509acf];return _0x415a55;};'use strict';var rp=require(_0x780c('0x0'));var url=require(_0x780c('0x1'));var logger=require(_0x780c('0x2'))(_0x780c('0x3'));module['exports']=function(_0x5589b0,_0x381187){var _0x5af044={'method':_0x780c('0x4'),'uri':url[_0x780c('0x5')](_0x381187[_0x780c('0x6')],_0x780c('0x7')),'form':{'grant_type':_0x780c('0x8'),'username':_0x381187[_0x780c('0x9')],'password':_0x381187[_0x780c('0x8')]},'json':!![]};return rp(_0x5af044)[_0x780c('0xa')](function(_0x4041cb){var _0x2d858f={'method':_0x780c('0x4'),'uri':url['resolve'](_0x381187[_0x780c('0xb')],_0x780c('0xc')),'body':{'type':_0x381187['ndaactivity_type']||_0x780c('0xd'),'channelId':_0x780c('0xe'),'conversation':{'id':_0x5589b0[_0x780c('0xf')]},'from':{'id':_0x5589b0['callerid'],'name':_0x5589b0[_0x780c('0x10')]},'recipient':{'id':_0x5589b0[_0x780c('0x11')],'name':_0x5589b0[_0x780c('0x12')]},'text':_0x381187[_0x780c('0x13')],'channelData':{}},'headers':{'Authorization':_0x780c('0x14')+_0x4041cb[_0x780c('0x15')]},'json':!![]};if(_0x381187[_0x780c('0x16')]){_0x2d858f[_0x780c('0x17')][_0x780c('0x18')][_0x780c('0x19')]=_0x381187[_0x780c('0x16')];}if(_0x381187[_0x780c('0x1a')]=='1'){_0x2d858f['body']['channelData'][_0x780c('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x780c('0x1c')};}if(_0x381187['custom_action']){_0x2d858f['body'][_0x780c('0x18')][_0x780c('0x1d')]=_0x381187[_0x780c('0x1e')];if(_0x381187[_0x780c('0x1f')]){_0x2d858f[_0x780c('0x17')][_0x780c('0x18')]['CustomActionData']=_0x381187[_0x780c('0x1f')];}}logger[_0x780c('0x20')](JSON[_0x780c('0x21')](_0x2d858f));return rp(_0x2d858f);});}; \ No newline at end of file +var _0xdbfc=['CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','text','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav'];(function(_0x119927,_0x8bc398){var _0x5927b8=function(_0x6d6641){while(--_0x6d6641){_0x119927['push'](_0x119927['shift']());}};_0x5927b8(++_0x8bc398);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x1813d9,_0x4c91c1){_0x1813d9=_0x1813d9-0x0;var _0x39d3b6=_0xdbfc[_0x1813d9];return _0x39d3b6;};'use strict';var rp=require(_0xcdbf('0x0'));var url=require(_0xcdbf('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0xcdbf('0x2')]=function(_0x3067d8,_0x3db24f){var _0x3ed1e1={'method':_0xcdbf('0x3'),'uri':url[_0xcdbf('0x4')](_0x3db24f[_0xcdbf('0x5')],'/token'),'form':{'grant_type':_0xcdbf('0x6'),'username':_0x3db24f[_0xcdbf('0x7')],'password':_0x3db24f['password']},'json':!![]};return rp(_0x3ed1e1)[_0xcdbf('0x8')](function(_0x3c077d){var _0x409a4e={'method':_0xcdbf('0x3'),'uri':url['resolve'](_0x3db24f[_0xcdbf('0x9')],_0xcdbf('0xa')),'body':{'type':_0x3db24f[_0xcdbf('0xb')]||_0xcdbf('0xc'),'channelId':_0xcdbf('0xd'),'conversation':{'id':_0x3067d8['uniqueid']},'from':{'id':_0x3067d8[_0xcdbf('0xe')],'name':_0x3067d8['calleridname']},'recipient':{'id':_0x3067d8[_0xcdbf('0xf')],'name':_0x3067d8['extension']},'text':_0x3db24f[_0xcdbf('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3c077d[_0xcdbf('0x11')]},'json':!![]};if(_0x3db24f[_0xcdbf('0x12')]){_0x409a4e[_0xcdbf('0x13')]['channelData'][_0xcdbf('0x14')]=_0x3db24f['project'];}if(_0x3db24f[_0xcdbf('0x15')]=='1'){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcdbf('0x18')};}if(_0x3db24f['custom_action']){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x19')]=_0x3db24f[_0xcdbf('0x1a')];if(_0x3db24f[_0xcdbf('0x1b')]){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x1c')]=_0x3db24f[_0xcdbf('0x1b')];}}logger[_0xcdbf('0x1d')](JSON[_0xcdbf('0x1e')](_0x409a4e));return rp(_0x409a4e);});}; \ 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 161eb54..c26de6c 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x313d0a,_0x3832d5,_0x40ba1a,_0x2980cf){return asr(_0x313d0a,_0x3832d5,_0x40ba1a,_0x2980cf);}; \ No newline at end of file +var _0x62bd=['exports','./lib/api'];(function(_0x1bab1f,_0x1b51e8){var _0xeb960=function(_0x3199a6){while(--_0x3199a6){_0x1bab1f['push'](_0x1bab1f['shift']());}};_0xeb960(++_0x1b51e8);}(_0x62bd,0x135));var _0xd62b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62bd[_0x14add3];return _0x4a174f;};'use strict';var asr=require(_0xd62b('0x0'));module[_0xd62b('0x1')]=function(_0x5cb07d,_0x247c45,_0x315b42,_0x14c6fc){return asr(_0x5cb07d,_0x247c45,_0x315b42,_0x14c6fc);}; \ 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 d56ee96..aad68ce 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 _0x5843=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','parse','status','final','result','hypotheses','likelihood','Success.','terminate','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'];(function(_0xee7762,_0x2c5dc3){var _0x378222=function(_0x26b423){while(--_0x26b423){_0xee7762['push'](_0xee7762['shift']());}};_0x378222(++_0x2c5dc3);}(_0x5843,0x1b2));var _0x3584=function(_0x44042f,_0x2bc0cc){_0x44042f=_0x44042f-0x0;var _0x4047ea=_0x5843[_0x44042f];return _0x4047ea;};'use strict';var BPromise=require(_0x3584('0x0'));var _=require(_0x3584('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3584('0x2'));var crypto=require(_0x3584('0x3'));var logger=require('../../../../../../config/logger')(_0x3584('0x4'));module['exports']=function(_0x3acf86,_0x31864e,_0x2b308c,_0x5356ec){return new BPromise(function(_0x3950c9,_0x159f91){logger[_0x3584('0x5')](_0x3584('0x6'),_0x5356ec||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x68a148=new WebSocket(_0x5356ec||_0x3584('0x7'),{'perMessageDeflate':![]});var _0x9cedcd='';var _0x458ed5='0';var _0x13fa14='1';var _0x287f15='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x56b578(_0xbe7609){var _0x40a075=crypto['createHash'](_0x3584('0x8'));_0x40a075[_0x3584('0x9')](_0xbe7609);return _0x40a075[_0x3584('0xa')]('hex');}function _0x11ecc7(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x3e3666=moment()[_0x3584('0xb')]();var _0x5e0640=_0x56b578(_0x3e3666+_0x31864e+_0x2b308c);_0x68a148[_0x3584('0xc')](JSON['stringify']({'appID':_0x31864e,'timestamp':_0x3e3666,'appKey':_0x5e0640}));var _0x42a2c4=fs[_0x3584('0xd')](_0x3acf86);_0x42a2c4['on'](_0x3584('0xe'),function(_0x5a7cf0){_0x68a148[_0x3584('0xc')](_0x5a7cf0);});_0x42a2c4['on'](_0x3584('0xf'),function(){_0x68a148[_0x3584('0xc')](_0x3584('0x10'));});}catch(_0x37b92e){logger[_0x3584('0x11')](_0x3584('0x12'),JSON[_0x3584('0x13')](_0x37b92e));_0x68a148['terminate']();}}function _0x572458(_0x1cf4fa){try{if(_0x1cf4fa){var _0x2fd246=JSON[_0x3584('0x14')](_0x1cf4fa);switch(_0x2fd246[_0x3584('0x15')]){case 0x0:if(_0x2fd246['result']){if(_0x2fd246['result'][_0x3584('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x2fd246[_0x3584('0x17')]['hypotheses']));_0x9cedcd=_0x2fd246[_0x3584('0x17')][_0x3584('0x18')][0x0]['transcript'];_0x458ed5=_0x2fd246[_0x3584('0x17')][_0x3584('0x18')][0x0][_0x3584('0x19')];_0x13fa14='0';_0x287f15=_0x3584('0x1a');_0x68a148[_0x3584('0x1b')]();}}break;case 0x1:logger[_0x3584('0x5')](_0x3584('0x1c'));_0x13fa14='1';_0x287f15='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x13fa14='2';_0x287f15=_0x3584('0x1d');break;case 0x9:logger[_0x3584('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x13fa14='9';_0x287f15=_0x3584('0x1e');break;case 0xa:logger[_0x3584('0x5')](_0x3584('0x1f'));_0x13fa14='10';_0x287f15='Authentication\x20failed.';break;case 0xb:logger[_0x3584('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x13fa14='11';_0x287f15=_0x3584('0x20');}}}catch(_0x2cf7c3){logger[_0x3584('0x11')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x3584('0x13')](_0x2cf7c3));_0x68a148[_0x3584('0x1b')]();}}function _0xcb12e5(){logger[_0x3584('0x5')](_0x3584('0x21'));_0x3950c9({'transcript':_0x9cedcd,'confidence':_0x458ed5,'status':_0x13fa14,'status_message':_0x287f15});}function _0x2055ee(_0xc18733){logger[_0x3584('0x11')](_0x3584('0x22'));if(!_[_0x3584('0x23')](_0xc18733)){logger[_0x3584('0x11')](_[_0x3584('0x24')](_0xc18733)?JSON[_0x3584('0x13')](_0xc18733):_0xc18733);}}_0x68a148['on'](_0x3584('0x25'),_0x11ecc7);_0x68a148['on'](_0x3584('0x26'),_0x572458);_0x68a148['on'](_0x3584('0xf'),_0xcb12e5);_0x68a148['on'](_0x3584('0x11'),_0x2055ee);});}; \ No newline at end of file +var _0x79dc=['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','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','lodash','moment','crypto','agi','exports','createHash','sha1','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x79dc,0x1d9));var _0xc79d=function(_0x38ee38,_0x1b1b79){_0x38ee38=_0x38ee38-0x0;var _0x5c4cc4=_0x79dc[_0x38ee38];return _0x5c4cc4;};'use strict';var BPromise=require(_0xc79d('0x0'));var _=require(_0xc79d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xc79d('0x2'));var crypto=require(_0xc79d('0x3'));var logger=require('../../../../../../config/logger')(_0xc79d('0x4'));module[_0xc79d('0x5')]=function(_0x3d0ec7,_0x5f029d,_0xcafd68,_0x529900){return new BPromise(function(_0x449247,_0x5d1856){logger['info']('Tilde\x20URI',_0x529900||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x56d1e2=new WebSocket(_0x529900||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3468f1='';var _0xac646='0';var _0x131757='1';var _0x152053='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2fa6d8(_0x4ee5c9){var _0x40d767=crypto[_0xc79d('0x6')](_0xc79d('0x7'));_0x40d767['update'](_0x4ee5c9);return _0x40d767['digest']('hex');}function _0x54968c(){try{logger[_0xc79d('0x8')](_0xc79d('0x9'));var _0x2e36e3=moment()[_0xc79d('0xa')]();var _0x438914=_0x2fa6d8(_0x2e36e3+_0x5f029d+_0xcafd68);_0x56d1e2[_0xc79d('0xb')](JSON[_0xc79d('0xc')]({'appID':_0x5f029d,'timestamp':_0x2e36e3,'appKey':_0x438914}));var _0x27ed4a=fs['createReadStream'](_0x3d0ec7);_0x27ed4a['on']('data',function(_0x14ac18){_0x56d1e2[_0xc79d('0xb')](_0x14ac18);});_0x27ed4a['on']('close',function(){_0x56d1e2[_0xc79d('0xb')](_0xc79d('0xd'));});}catch(_0x262ef0){logger[_0xc79d('0xe')](_0xc79d('0xf'),JSON[_0xc79d('0xc')](_0x262ef0));_0x56d1e2[_0xc79d('0x10')]();}}function _0xe1472e(_0x2f7d6d){try{if(_0x2f7d6d){var _0x5c5d1a=JSON['parse'](_0x2f7d6d);switch(_0x5c5d1a['status']){case 0x0:if(_0x5c5d1a[_0xc79d('0x11')]){if(_0x5c5d1a['result'][_0xc79d('0x12')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xc79d('0xc')](_0x5c5d1a['result'][_0xc79d('0x13')]));_0x3468f1=_0x5c5d1a['result'][_0xc79d('0x13')][0x0][_0xc79d('0x14')];_0xac646=_0x5c5d1a[_0xc79d('0x11')][_0xc79d('0x13')][0x0][_0xc79d('0x15')];_0x131757='0';_0x152053='Success.';_0x56d1e2[_0xc79d('0x10')]();}}break;case 0x1:logger[_0xc79d('0x8')](_0xc79d('0x16'));_0x131757='1';_0x152053=_0xc79d('0x16');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x131757='2';_0x152053=_0xc79d('0x17');break;case 0x9:logger['info'](_0xc79d('0x18'));_0x131757='9';_0x152053=_0xc79d('0x18');break;case 0xa:logger[_0xc79d('0x8')](_0xc79d('0x19'));_0x131757='10';_0x152053=_0xc79d('0x19');break;case 0xb:logger[_0xc79d('0x8')](_0xc79d('0x1a'));_0x131757='11';_0x152053=_0xc79d('0x1a');}}}catch(_0x471b74){logger['error'](_0xc79d('0x1b'),JSON[_0xc79d('0xc')](_0x471b74));_0x56d1e2[_0xc79d('0x10')]();}}function _0xff3d92(){logger[_0xc79d('0x8')]('Close\x20Tilde\x20ASR\x20socket');_0x449247({'transcript':_0x3468f1,'confidence':_0xac646,'status':_0x131757,'status_message':_0x152053});}function _0x599861(_0x15ba0c){logger['error'](_0xc79d('0x1c'));if(!_[_0xc79d('0x1d')](_0x15ba0c)){logger['error'](_[_0xc79d('0x1e')](_0x15ba0c)?JSON[_0xc79d('0xc')](_0x15ba0c):_0x15ba0c);}}_0x56d1e2['on']('open',_0x54968c);_0x56d1e2['on']('message',_0xe1472e);_0x56d1e2['on']('close',_0xff3d92);_0x56d1e2['on'](_0xc79d('0xe'),_0x599861);});}; \ 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 c7548d8..5fcf8e4 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 _0x75c2=['exports','./asr'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x75c2,0x191));var _0x275c=function(_0x63fb96,_0x16ca20){_0x63fb96=_0x63fb96-0x0;var _0x1059ee=_0x75c2[_0x63fb96];return _0x1059ee;};var asr=require(_0x275c('0x0'));module[_0x275c('0x1')]={'asr':asr}; \ No newline at end of file +var _0x86fb=['exports'];(function(_0x4d98d6,_0xd2082){var _0x11f4ea=function(_0x5a41ec){while(--_0x5a41ec){_0x4d98d6['push'](_0x4d98d6['shift']());}};_0x11f4ea(++_0xd2082);}(_0x86fb,0x87));var _0xb86f=function(_0x1836a0,_0x1feea1){_0x1836a0=_0x1836a0-0x0;var _0x55711b=_0x86fb[_0x1836a0];return _0x55711b;};var asr=require('./asr');module[_0xb86f('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0065d41..52de731 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 _0x4d76=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','inherits','exports','util','net','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x58fe86,_0x19655f){var _0x3f0732=function(_0x1d0b4a){while(--_0x1d0b4a){_0x58fe86['push'](_0x58fe86['shift']());}};_0x3f0732(++_0x19655f);}(_0x4d76,0x192));var _0x64d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d76[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x64d7('0x0'));var net=require(_0x64d7('0x1'));var EventEmitter=require('events')[_0x64d7('0x2')];var AGIError=require(_0x64d7('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x200dbe,_0x1c8aea,_0x13850d){var _0x481764=this,_0x200dbe=_0x200dbe||0x11dd,_0x1c8aea=_0x1c8aea||_0x64d7('0x4'),_0x59bb6c=null,_0xd2395a=0x0;EventEmitter[_0x64d7('0x5')](_0x481764);function _0x57e2e0(){if(!_0x200dbe){_0x481764[_0x64d7('0x6')](_0x64d7('0x7'),new AGIError(_0x64d7('0x8')));return![];}_0x59bb6c=net[_0x64d7('0x9')]();_0x59bb6c[_0x64d7('0xa')](_0x200dbe,_0x1c8aea);_0x59bb6c['on']('listening',function(){_0x481764[_0x64d7('0x6')](_0x64d7('0xb'));});_0x59bb6c['on'](_0x64d7('0xc'),function(_0x6a72f0){_0x59bb6c[_0x64d7('0xd')](function(_0x4e8bd8,_0x192c8c){if(_0x4e8bd8){_0x481764['emit'](_0x64d7('0x7'),new AGIError(_0x64d7('0xe'),_0x4e8bd8));}else if(_0x13850d&&_0x13850d<0x0){_0x481764[_0x64d7('0x6')](_0x64d7('0x7'),new AGIError(_0x64d7('0xf')));_0x6a72f0[_0x64d7('0x10')]();}else if(_0x13850d&&_0x13850d>0x0&&_0x13850d<_0x192c8c){_0xd2395a+=0x1;_0x481764[_0x64d7('0x6')](_0x64d7('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xd2395a));_0x6a72f0[_0x64d7('0x10')]();}else{var _0x1e36c4=new AGIChannel(_0x6a72f0);_0x1e36c4['on'](_0x64d7('0x11'),function(){_0x481764[_0x64d7('0x6')]('connection',_0x1e36c4);});}});});_0x59bb6c['on'](_0x64d7('0x7'),function(_0x5e4e6a){_0x481764[_0x64d7('0x6')](_0x64d7('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5e4e6a[_0x64d7('0x12')]));});_0x59bb6c['on'](_0x64d7('0x13'),function(){_0x481764[_0x64d7('0x6')](_0x64d7('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x64d7('0x14')](function(){_0x57e2e0();});};util[_0x64d7('0x15')](AGIServer,EventEmitter);module[_0x64d7('0x16')]=function(_0x1efa6f,_0x4f2b3d,_0x704a9d){return new AGIServer(_0x1efa6f,_0x4f2b3d,_0x704a9d);}; \ No newline at end of file +var _0x4d2e=['E_AGI_SERVER_MAXCONNECTION','ready','code','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x4f2725,_0x3b0fde){var _0x511032=function(_0x1b8025){while(--_0x1b8025){_0x4f2725['push'](_0x4f2725['shift']());}};_0x511032(++_0x3b0fde);}(_0x4d2e,0xa8));var _0xe4d2=function(_0x1ccb5a,_0x4ff3d1){_0x1ccb5a=_0x1ccb5a-0x0;var _0x1842d4=_0x4d2e[_0x1ccb5a];return _0x1842d4;};'use strict';var util=require(_0xe4d2('0x0'));var net=require(_0xe4d2('0x1'));var EventEmitter=require(_0xe4d2('0x2'))[_0xe4d2('0x3')];var AGIError=require('./error');var AGIChannel=require(_0xe4d2('0x4'));var AGIServer=function(_0x92943e,_0x5b139c,_0x2792a1){var _0x1540ab=this,_0x92943e=_0x92943e||0x11dd,_0x5b139c=_0x5b139c||_0xe4d2('0x5'),_0x2b5b52=null,_0x305632=0x0;EventEmitter[_0xe4d2('0x6')](_0x1540ab);function _0x4e2478(){if(!_0x92943e){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0x8'),new AGIError(_0xe4d2('0x9')));return![];}_0x2b5b52=net['createServer']();_0x2b5b52[_0xe4d2('0xa')](_0x92943e,_0x5b139c);_0x2b5b52['on'](_0xe4d2('0xb'),function(){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0xb'));});_0x2b5b52['on'](_0xe4d2('0xc'),function(_0x38fb6b){_0x2b5b52['getConnections'](function(_0x5589c6,_0x4c1e4b){if(_0x5589c6){_0x1540ab[_0xe4d2('0x7')]('error',new AGIError(_0xe4d2('0xd'),_0x5589c6));}else if(_0x2792a1&&_0x2792a1<0x0){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0x8'),new AGIError(_0xe4d2('0xe')));_0x38fb6b[_0xe4d2('0xf')]();}else if(_0x2792a1&&_0x2792a1>0x0&&_0x2792a1<_0x4c1e4b){_0x305632+=0x1;_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0x8'),new AGIError(_0xe4d2('0x10'),_0x305632));_0x38fb6b[_0xe4d2('0xf')]();}else{var _0x1cc6dd=new AGIChannel(_0x38fb6b);_0x1cc6dd['on'](_0xe4d2('0x11'),function(){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0xc'),_0x1cc6dd);});}});});_0x2b5b52['on'](_0xe4d2('0x8'),function(_0x3a73d9){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x3a73d9[_0xe4d2('0x12')]));});_0x2b5b52['on'](_0xe4d2('0x13'),function(){_0x1540ab[_0xe4d2('0x7')](_0xe4d2('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xe4d2('0x14')](function(){_0x4e2478();});};util[_0xe4d2('0x15')](AGIServer,EventEmitter);module[_0xe4d2('0x16')]=function(_0x39b8a0,_0xc9fe25,_0x2db1c4){return new AGIServer(_0x39b8a0,_0xc9fe25,_0x2db1c4);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 89e75f4..d7fcac1 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 _0x1dc3=['googleASR','google_asr_language','tildeASR','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','custom_app','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','dialogflow','Dialogflow\x20Result\x20%s','speech','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','Trying\x20DialogflowV2:\x20%s','providerResponse','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','maxRetry','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','recordFile','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','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','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','escape_digits','restapi','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','\x22%s\x22\x20<%s>','user','bcc','subject','Smtp','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','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','replaceAll','split','join','exports','path','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','getVoiceQueueById','then','getSquareProjectById','name','catch','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','method','timeout','number','includes','PUT','toUpperCase','body','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','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name'];(function(_0x4e2b8d,_0x41006c){var _0x41d2e5=function(_0x4ff501){while(--_0x4ff501){_0x4e2b8d['push'](_0x4e2b8d['shift']());}};_0x41d2e5(++_0x41006c);}(_0x1dc3,0x145));var _0x31dc=function(_0x44392b,_0x31103e){_0x44392b=_0x44392b-0x0;var _0x516f55=_0x1dc3[_0x44392b];return _0x516f55;};'use strict';var fs=require('fs');var path=require(_0x31dc('0x0'));var util=require('util');var _=require('lodash');var sh=require('shelljs');var odbc=require(_0x31dc('0x1'))();var rs=require(_0x31dc('0x2'));var moment=require(_0x31dc('0x3'));var Mustache=require(_0x31dc('0x4'));var rp=require(_0x31dc('0x5'));var logger=require(_0x31dc('0x6'))('agi');var config=require(_0x31dc('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x31dc('0x8');var recursiveMapAttributes=[_0x31dc('0x9'),_0x31dc('0xa')];var verticesWithRetry=['menu','getdigits',_0x31dc('0xb')];var AGIVertices=function(_0x10e982,_0x12313e,_0x38dbe6){this[_0x31dc('0xc')]=_0x10e982;this[_0x31dc('0xd')]=_0x12313e;this[_0x31dc('0xe')]=_0x38dbe6;};AGIVertices[_0x31dc('0xf')][_0x31dc('0x10')]=function(_0x29c2b7,_0x5cccf7){this[_0x31dc('0xd')][_0x31dc('0x11')](_0x29c2b7)['then'](function(_0x3e0157){_0x5cccf7(null,_0x3e0157?_0x3e0157['name']:![]);})['catch'](function(_0x293cff){_0x5cccf7(_0x293cff);});};AGIVertices[_0x31dc('0xf')]['getVoiceQueue']=function(_0x25bd1d,_0x458175){this[_0x31dc('0xd')][_0x31dc('0x12')](_0x25bd1d)[_0x31dc('0x13')](function(_0x41a3b9){_0x458175(null,_0x41a3b9?_0x41a3b9['name']:![]);})['catch'](function(_0x409e0a){_0x458175(_0x409e0a);});};AGIVertices[_0x31dc('0xf')]['getSquareProject']=function(_0xd05e84,_0xba657a){this[_0x31dc('0xd')][_0x31dc('0x14')](_0xd05e84)[_0x31dc('0x13')](function(_0xb282fe){_0xba657a(null,_0xb282fe?_0xb282fe[_0x31dc('0x15')]:![]);})[_0x31dc('0x16')](function(_0x1a7b4a){_0xba657a(_0x1a7b4a);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x17')]=function(_0x75b67f,_0x1cda87){this[_0x31dc('0xd')][_0x31dc('0x18')](_0x75b67f)[_0x31dc('0x13')](function(_0xad81bf){_0x1cda87(null,_0xad81bf?_0xad81bf['dsn']:![]);})[_0x31dc('0x16')](function(_0x2eef05){_0x1cda87(_0x2eef05);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x19')]=function(_0x4a860c,_0x5be1f1){this[_0x31dc('0xd')]['getUserById'](_0x4a860c)[_0x31dc('0x13')](function(_0xe89fc6){_0x5be1f1(null,_0xe89fc6?_0xe89fc6[_0x31dc('0x15')]:![]);})[_0x31dc('0x16')](function(_0x43b652){_0x5be1f1(_0x43b652);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1a')]=function(_0x434fe9,_0xa655cc){this[_0x31dc('0xd')][_0x31dc('0x1b')](_0x434fe9)[_0x31dc('0x13')](function(_0x2e0c4e){_0xa655cc(null,_0x2e0c4e?_0x2e0c4e['name']:![]);})[_0x31dc('0x16')](function(_0x408aa5){_0xa655cc(_0x408aa5);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1c')]=function(_0x34ae43,_0x38adbe){var _0x594b34=this;this['rpc']['getSoundById'](_0x34ae43)[_0x31dc('0x13')](function(_0x46f513){_0x38adbe(null,_0x46f513?_0x594b34[_0x31dc('0x1d')](_0x46f513[_0x31dc('0x1e')]):![]);})[_0x31dc('0x16')](function(_0x972b02){_0x38adbe(_0x972b02);});};AGIVertices[_0x31dc('0xf')]['getMailAccount']=function(_0xebcedc,_0x152f9a){this[_0x31dc('0xd')][_0x31dc('0x1f')](_0xebcedc)[_0x31dc('0x13')](function(_0x116479){_0x152f9a(null,_0x116479?_0x116479:![]);})['catch'](function(_0x4e9c7b){_0x152f9a(_0x4e9c7b);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x20')]=function(_0x3073fd,_0x3732c3,_0x28b251){this[_0x31dc('0xe')][_0x31dc('0x20')](_0x3073fd,_0x3732c3)['then'](function(){_0x28b251(null);})[_0x31dc('0x16')](function(_0x38de90){_0x28b251(_0x38de90);});};AGIVertices[_0x31dc('0xf')]['getIntervals']=function(_0x1e1c32,_0x2960f9){this[_0x31dc('0xd')][_0x31dc('0x21')](_0x1e1c32)['then'](function(_0x241970){if(_0x241970){if(_0x241970[_0x31dc('0x22')]){_0x2960f9(null,[_0x241970[_0x31dc('0x23')]]);}else{_0x2960f9(null,_[_0x31dc('0x24')](_0x241970[_0x31dc('0x25')],_0x31dc('0x23')));}}else{_0x2960f9(null,![]);}})[_0x31dc('0x16')](function(_0x3e54c1){_0x2960f9(_0x3e54c1);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1d')]=function(_0x4f8b0c){return util[_0x31dc('0x26')](_0x31dc('0x27'),FILES_PATH,_0x4f8b0c);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x28')]=function(_0x4f807e,_0xf5c140,_0x428696){odbc[_0x31dc('0x29')](_0x4f807e,function(_0x5189da){if(_0x5189da){logger[_0x31dc('0x2a')](_0x31dc('0x2b'),_0x5189da);_0x428696(_0x5189da);}else{logger[_0x31dc('0x2c')](_0x31dc('0x2d'));odbc[_0x31dc('0x2e')](_0xf5c140,function(_0x15486f,_0x350c57){if(_0x15486f){logger['info'](_0x31dc('0x2f'),_0xf5c140);_0x428696(_0x15486f);}else{logger[_0x31dc('0x2c')](_0x31dc('0x30'),_0xf5c140);odbc[_0x31dc('0x31')](function(_0x97a5a9){if(_0x97a5a9){logger[_0x31dc('0x2a')](_0x31dc('0x32'),_0x97a5a9);}_0x428696(null,_0x350c57);});}});}});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x33')]=function(_0xe4489,_0xe1ce08){this['rpc'][_0x31dc('0x34')](_0xe4489)[_0x31dc('0x13')](function(_0x2a1095){_0xe1ce08(null,_0x2a1095?_0x2a1095:![]);})['catch'](function(_0x3c6f39){_0xe1ce08(_0x3c6f39);});};AGIVertices['prototype'][_0x31dc('0x35')]=function(_0x4c2460,_0x23555b){this[_0x31dc('0xd')]['createSmsMessage'](_0x4c2460)['then'](function(_0x48c810){_0x23555b(null,_0x48c810);})[_0x31dc('0x16')](function(_0x482bc0){_0x23555b(_0x482bc0);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x36')]=function(_0x533286,_0x866573,_0x5e74a4){this[_0x31dc('0xd')]['createSquareDetailsReport']({'uniqueid':this[_0x31dc('0xc')]['uniqueid'],'node':_0x533286[_0x31dc('0x37')],'application':_0x533286[_0x31dc('0x38')],'data':_0x866573||null,'project_name':this['channel'][_0x31dc('0x39')],'callerid':this[_0x31dc('0xc')][_0x31dc('0x3a')]})['then'](function(_0x2634c4){if(_0x5e74a4){_0x5e74a4(null,_0x2634c4);}})[_0x31dc('0x16')](function(_0x6140a5){if(_0x5e74a4){_0x5e74a4(_0x6140a5);}});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x3b')]=function(_0x1b20e7,_0x2ec082,_0x49c917,_0x42ea3a){this[_0x31dc('0xd')][_0x31dc('0x3b')]({'uniqueid':this[_0x31dc('0xc')][_0x31dc('0x3c')],'callerid':this['channel'][_0x31dc('0x3a')],'calleridname':this[_0x31dc('0xc')]['calleridname'],'context':this[_0x31dc('0xc')][_0x31dc('0x3d')],'extension':this[_0x31dc('0xc')]['extension'],'priority':this['channel'][_0x31dc('0x3e')],'accountcode':this[_0x31dc('0xc')][_0x31dc('0x3f')],'dnid':this[_0x31dc('0xc')][_0x31dc('0x40')],'projectName':this[_0x31dc('0xc')]['arg_1'],'saveName':_0x2ec082,'filename':_0x1b20e7[_0x31dc('0x41')]||_0x2ec082,'savePath':_0x49c917})[_0x31dc('0x13')](function(_0x1e056f){_0x42ea3a(null,_0x1e056f);})[_0x31dc('0x16')](function(_0xb987a6){_0x42ea3a(_0xb987a6);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x42')]=function(_0x224fb3,_0x58ac63,_0x306b01,_0xf7753a,_0x594a5c){this[_0x31dc('0xd')][_0x31dc('0x42')]({'uniqueid':this[_0x31dc('0xc')][_0x31dc('0x3c')],'body':_0x224fb3,'direction':_0x58ac63,'providerName':_0x306b01,'providerResponse':_0xf7753a})['then'](function(_0x2708fe){if(_0x594a5c){_0x594a5c(null,_0x2708fe);}})[_0x31dc('0x16')](function(_0x47e3b2){if(_0x594a5c){_0x594a5c(_0x47e3b2);}});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x43')]=function(_0x93027,_0x57e5ad){this[_0x31dc('0xd')][_0x31dc('0x43')]({'firstName':_[_0x31dc('0x44')](_0x93027[_0x31dc('0x15')])||_[_0x31dc('0x45')](_0x93027[_0x31dc('0x15')])?_0x31dc('0x46')+Math[_0x31dc('0x47')]():_0x93027[_0x31dc('0x15')],'lastName':_[_0x31dc('0x44')](_0x93027[_0x31dc('0x48')])||_['isNil'](_0x93027[_0x31dc('0x48')])?null:_0x93027[_0x31dc('0x48')],'phone':_0x93027[_0x31dc('0x49')],'ListId':_0x93027[_0x31dc('0x4a')],'scheduledat':_0x93027[_0x31dc('0x4b')],'callbackUniqueid':this[_0x31dc('0xc')]['uniqueid'],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x93027['scheduledAt'][_0x31dc('0x4c')](),'priority':_0x93027[_0x31dc('0x4d')]})[_0x31dc('0x13')](function(_0x1fd249){_0x57e5ad(null,_0x1fd249);})[_0x31dc('0x16')](function(_0x3a2529){_0x57e5ad(_0x3a2529);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x4e')]=function(_0x2c69ad,_0x3146f0){this[_0x31dc('0xd')][_0x31dc('0x4f')](_0x2c69ad)[_0x31dc('0x13')](function(_0x1fa9f2){_0x3146f0(null,_0x1fa9f2?_0x1fa9f2['name']:![]);})['catch'](function(_0x366ecd){_0x3146f0(_0x366ecd);});};AGIVertices[_0x31dc('0xf')]['agentPause']=function(_0x44cad4,_0x4c8c35,_0x2da554){var _0x1adaf1={'role':'agent'};_0x1adaf1[_0x44cad4]=this[_0x31dc('0xc')][_0x31dc('0x3a')];this['rpc'][_0x31dc('0x50')](_0x1adaf1,_0x4c8c35,this['channel'][_0x31dc('0x3c')])[_0x31dc('0x13')](function(_0x2bca91){_0x2da554(null,_[_0x31dc('0x45')](_0x2bca91)?![]:!![]);})[_0x31dc('0x16')](function(_0x4f7c18){logger[_0x31dc('0x2a')](_0x4f7c18);_0x2da554(null,![]);});};AGIVertices[_0x31dc('0xf')]['agentUnpause']=function(_0x3a8478,_0xf9d244){var _0x4c5d98={'role':_0x31dc('0x51')};_0x4c5d98[_0x3a8478]=this[_0x31dc('0xc')][_0x31dc('0x3a')];this[_0x31dc('0xd')][_0x31dc('0x52')](_0x4c5d98)[_0x31dc('0x13')](function(_0x6db5e3){_0xf9d244(null,_[_0x31dc('0x45')](_0x6db5e3)?![]:!![]);})[_0x31dc('0x16')](function(_0x4eac63){logger[_0x31dc('0x2a')](_0x4eac63);_0xf9d244(null,![]);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x53')]=function(_0x161414,_0x53e8d7){var _0x2d0c30={'role':_0x31dc('0x51')};_0x2d0c30[_0x161414]=this[_0x31dc('0xc')][_0x31dc('0x3a')];this[_0x31dc('0xd')][_0x31dc('0x53')](_0x2d0c30)[_0x31dc('0x13')](function(_0xd5ac6c){_0x53e8d7(null,_[_0x31dc('0x45')](_0xd5ac6c)?![]:!![]);})[_0x31dc('0x16')](function(_0x4079d1){logger[_0x31dc('0x2a')](_0x4079d1);_0x53e8d7(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x43db68,_0x23ae3f){var _0x4edb69={'role':_0x31dc('0x51')};_0x4edb69[_0x43db68]=this[_0x31dc('0xc')]['callerid'];var _0x15de1c=_0x43db68!='internal'?util[_0x31dc('0x26')](_0x31dc('0x54'),_0x31dc('0x55'),this['channel'][_0x31dc('0x3a')]):undefined;this[_0x31dc('0xd')][_0x31dc('0x56')](_0x4edb69,_0x15de1c)[_0x31dc('0x13')](function(_0x58047e){_0x23ae3f(null,_[_0x31dc('0x45')](_0x58047e)?![]:!![]);})[_0x31dc('0x16')](function(_0x4b2e27){logger[_0x31dc('0x2a')](_0x4b2e27);_0x23ae3f(null,![]);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x57')]=function(_0x546ec9,_0xbd017a){sh[_0x31dc('0x58')](_[_0x31dc('0x59')](_0x546ec9),function(_0x52b0ca,_0xdf39b2){var _0x3ac18c=_0xdf39b2[_0x31dc('0x5a')](/(\r\n|\n|\r)/gm,'');_0xbd017a(null,_0x3ac18c);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x5b')]=function(_0x1b8321,_0x277622){scripts[_0x31dc('0x5b')](_0x1b8321[_0x31dc('0x5c')],_0x1b8321['google_cloud_tts_text_type']||'text',_0x1b8321[_0x31dc('0x5d')],_0x1b8321[_0x31dc('0x5e')]||_0x31dc('0x5f'),_0x1b8321[_0x31dc('0x60')]||_0x31dc('0x61'),_0x1b8321['audioEncoding']||_0x31dc('0x62'))[_0x31dc('0x13')](function(_0x2d9c18){_0x277622(null,_0x2d9c18);})[_0x31dc('0x16')](function(_0x1810e3){_0x277622(_0x1810e3);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x63')]=function(_0x11c876,_0x20526e){scripts[_0x31dc('0x63')](_0x11c876[_0x31dc('0x5d')],_0x11c876['google_tts_language']||'en',0x1)[_0x31dc('0x13')](function(_0x43b7e5){_0x20526e(null,_0x43b7e5);})[_0x31dc('0x16')](function(_0x1c4122){_0x20526e(_0x1c4122);});};AGIVertices['prototype']['restAPI']=function(_0x5cb001,_0x2d72f4){var _0x34423a={'uri':_0x5cb001['url'],'method':_0x5cb001[_0x31dc('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5cb001[_0x31dc('0x65')])===_0x31dc('0x66')&&parseInt(_0x5cb001['timeout'])>=0x1?parseInt(_0x5cb001[_0x31dc('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x31dc('0x67')](['POST',_0x31dc('0x68')],_0x34423a[_0x31dc('0x64')][_0x31dc('0x69')]())){try{_0x34423a[_0x31dc('0x6a')]=_0x5cb001[_0x31dc('0xa')]?JSON[_0x31dc('0x6b')](_0x5cb001['rawBody']):{};}catch(_0x1ec398){logger['error'](_0x31dc('0x6c'),_0x1ec398);}}try{_0x34423a[_0x31dc('0x6d')]=_0x5cb001[_0x31dc('0x9')]?JSON['parse'](_0x5cb001['rawHeaders']):{};}catch(_0x42e344){logger['error'](_0x31dc('0x6e'),_0x42e344);}if(_0x5cb001[_0x31dc('0x6f')]){try{var _0xa1a45d=require(_0x5cb001[_0x31dc('0x6f')])['sync'](this,_0x34423a);_0x34423a['uri']=Mustache[_0x31dc('0x70')](_0x5cb001[_0x31dc('0x71')],_0xa1a45d,{},['$$','$$']);if(_0x34423a['headers']){_0x34423a[_0x31dc('0x6d')]=JSON[_0x31dc('0x6b')](Mustache[_0x31dc('0x70')](JSON[_0x31dc('0x72')](_0x34423a[_0x31dc('0x6d')]),_0xa1a45d,{},['$$','$$']));}if(_0x34423a[_0x31dc('0x6a')]){_0x34423a['body']=JSON['parse'](Mustache[_0x31dc('0x70')](JSON[_0x31dc('0x72')](_0x34423a[_0x31dc('0x6a')]),_0xa1a45d,{},['$$','$$']));}}catch(_0x4e877d){logger[_0x31dc('0x2a')](_0x31dc('0x73'),_0x4e877d);}}rp(_0x34423a)[_0x31dc('0x13')](function(_0x597cbd){var _0x4c3b46={'statusCode':_0x597cbd[_0x31dc('0x74')]||0xc8,'statusMessage':_0x597cbd[_0x31dc('0x75')]||'OK','headers':_0x597cbd[_0x31dc('0x6d')]||{},'body':_0x597cbd[_0x31dc('0x6a')]||{}};_0x2d72f4(null,_0x4c3b46);})[_0x31dc('0x16')](function(_0x4ce56a){var _0x23f616={'statusCode':_0x4ce56a['statusCode']||0x1f4,'statusMessage':_0x4ce56a[_0x31dc('0x76')]||_0x31dc('0x77'),'headers':_0x4ce56a[_0x31dc('0x78')][_0x31dc('0x6d')]||{},'body':_0x4ce56a[_0x31dc('0x78')]['body']||{}};_0x2d72f4(null,_0x23f616);});};AGIVertices['prototype'][_0x31dc('0x79')]=function(_0x435dd9,_0x5eaa35){scripts['googleDialogflow'](this[_0x31dc('0xc')][_0x31dc('0x3c')],_0x435dd9[_0x31dc('0x7a')],_0x435dd9[_0x31dc('0x5d')],_0x435dd9['dialogflow_language']||'en')['then'](function(_0x1c1711){_0x5eaa35(null,_0x1c1711);})['catch'](function(_0x47acbe){_0x5eaa35(_0x47acbe);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x7b')]=function(_0x46b907,_0x5a0f70){scripts['googleDialogflowV2'](this[_0x31dc('0xc')]['uniqueid'],_0x46b907[_0x31dc('0x7c')],_0x46b907[_0x31dc('0x7d')],_0x46b907[_0x31dc('0x7e')],_0x46b907[_0x31dc('0x5d')],_0x46b907['dialogflowV2_language']||'en')[_0x31dc('0x13')](function(_0x4c7025){_0x5a0f70(null,_0x4c7025);})[_0x31dc('0x16')](function(_0x486a69){_0x5a0f70(_0x486a69);});};AGIVertices[_0x31dc('0xf')]['sestekNDA']=function(_0x556b9a,_0x3a30ef){scripts[_0x31dc('0x7f')](this['channel'],_0x556b9a)[_0x31dc('0x13')](function(_0x5b9f97){_0x3a30ef(null,_0x5b9f97);})[_0x31dc('0x16')](function(_0x36cd39){_0x3a30ef(_0x36cd39);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x80')]=function(_0x3b670a,_0x5c6d73){scripts['ispeechTTS'](_0x3b670a[_0x31dc('0x7a')],_0x3b670a[_0x31dc('0x5d')],_0x3b670a[_0x31dc('0x81')]||_0x31dc('0x5f'),_0x3b670a[_0x31dc('0x82')])[_0x31dc('0x13')](function(_0x523f3a){_0x5c6d73(null,_0x523f3a);})['catch'](function(_0x579713){_0x5c6d73(_0x579713);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x83')]=function(_0x57d40b,_0x47201a,_0x53ca0e){scripts[_0x31dc('0x83')](_0x47201a,_0x57d40b['key'],_0x57d40b[_0x31dc('0x84')]||'en-US',this[_0x31dc('0x85')](_0x57d40b[_0x31dc('0x86')])?_0x57d40b['model']:undefined)['then'](function(_0x165bb1){_0x53ca0e(null,_0x165bb1);})[_0x31dc('0x16')](function(_0x394bff){_0x53ca0e(_0x394bff);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x87')]=function(_0x34d69c,_0x5d19be){scripts[_0x31dc('0x87')](_0x34d69c[_0x31dc('0x88')],_0x34d69c[_0x31dc('0x89')],_0x34d69c['aws_polly_region'],_0x34d69c['aws_polly_voice']||_0x31dc('0x8a'),_0x34d69c[_0x31dc('0x5d')],_0x34d69c[_0x31dc('0x8b')]||'text')['then'](function(_0x2f4448){_0x5d19be(null,_0x2f4448);})['catch'](function(_0x45f615){_0x5d19be(_0x45f615);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x8c')]=function(_0x145686,_0x195787){scripts[_0x31dc('0x8c')](this[_0x31dc('0xc')][_0x31dc('0x3c')],_0x145686['aws_access_key_id'],_0x145686[_0x31dc('0x89')],_0x145686[_0x31dc('0x8d')],_0x145686[_0x31dc('0x5d')],_0x145686[_0x31dc('0x8e')])[_0x31dc('0x13')](function(_0x541ad0){_0x195787(null,_0x541ad0);})[_0x31dc('0x16')](function(_0x114dd8){_0x195787(_0x114dd8);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x8f')]=function(_0x3c4041,_0x3b2e98,_0x177d76){scripts['googleASR'](_0x3b2e98,_0x3c4041[_0x31dc('0x7a')],_0x3c4041[_0x31dc('0x90')]||_0x31dc('0x5f'))[_0x31dc('0x13')](function(_0x807e57){_0x177d76(null,_0x807e57);})[_0x31dc('0x16')](function(_0x3b8a05){_0x177d76(_0x3b8a05);});};AGIVertices[_0x31dc('0xf')][_0x31dc('0x91')]=function(_0x54a3ee,_0x40c511,_0x5b2247){scripts['tildeASR'](_0x40c511,_0x54a3ee['appid'],_0x54a3ee[_0x31dc('0x92')],_0x54a3ee['uri'])[_0x31dc('0x13')](function(_0xce4e3a){_0x5b2247(null,_0xce4e3a);})[_0x31dc('0x16')](function(_0xa4b772){_0x5b2247(_0xa4b772);});};AGIVertices['prototype']['clear']=function(_0x136f4f){var _0x441e85=_[_0x31dc('0x67')](verticesWithRetry,_0x136f4f[_0x31dc('0x38')])?_0x136f4f:_[_0x31dc('0x93')](_0x136f4f);for(var _0x65c549 in _0x441e85){if(_0x441e85[_0x31dc('0x94')](_0x65c549)){if(_0x441e85[_0x65c549]&&_[_0x31dc('0x95')](_0x441e85[_0x65c549])){if(_[_0x31dc('0x67')](recursiveMapAttributes,_0x65c549)){_0x441e85[_0x65c549]=this[_0x31dc('0x96')](_0x441e85[_0x65c549]);}else{_0x441e85[_0x65c549]=this[_0x31dc('0x97')](_0x441e85[_0x65c549]);}}}}return _0x441e85;};AGIVertices['prototype'][_0x31dc('0x98')]=function(_0x482eb5){for(var _0x41525f in _0x482eb5){if(_0x482eb5[_0x31dc('0x94')](_0x41525f)){if(_[_0x31dc('0x99')](_0x482eb5[_0x41525f])){this[_0x31dc('0x98')](_0x482eb5[_0x41525f]);}else if(_[_0x31dc('0x9a')](_0x482eb5[_0x41525f])){for(var _0x358ec6=0x0;_0x358ec6<_0x482eb5[_0x41525f][_0x31dc('0x9b')];_0x358ec6++){this[_0x31dc('0x98')](_0x482eb5[_0x41525f][_0x358ec6]);}}else if(_[_0x31dc('0x95')](_0x482eb5[_0x41525f])){_0x482eb5[_0x41525f]=this[_0x31dc('0x97')](_0x482eb5[_0x41525f]);}}}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x9c')]=function(_0x19347c,_0x9613d6){for(var _0x1d452d in _0x19347c){if(_0x19347c[_0x31dc('0x94')](_0x1d452d)){if(_['isPlainObject'](_0x19347c[_0x1d452d])){if(!_['isEmpty'](_0x19347c[_0x1d452d])){this[_0x31dc('0x9c')](_0x19347c[_0x1d452d],util[_0x31dc('0x26')]('%s.%s',_0x9613d6,_0x1d452d));}}else if(_[_0x31dc('0x9a')](_0x19347c[_0x1d452d])){for(var _0x3e570c=0x0;_0x3e570c<_0x19347c[_0x1d452d][_0x31dc('0x9b')];_0x3e570c++){this[_0x31dc('0x9c')](_0x19347c[_0x1d452d][_0x3e570c],util[_0x31dc('0x26')](_0x31dc('0x9d'),_0x9613d6,_0x1d452d+'['+_0x3e570c+']'));}}else{if(!_[_0x31dc('0x45')](_0x19347c[_0x1d452d])){this[_0x31dc('0xc')][_0x31dc('0x9e')](util['format'](_0x31dc('0x9d'),_0x9613d6,_0x1d452d),_0x19347c[_0x1d452d]);}}}}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x96')]=function(_0x1d0d97){try{var _0xef429f=JSON[_0x31dc('0x6b')](_0x1d0d97);this[_0x31dc('0x98')](_0xef429f);return JSON[_0x31dc('0x72')](_0xef429f);}catch(_0x41202b){return this[_0x31dc('0x97')](_0x1d0d97);}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x97')]=function(_0x4a77cf){var _0x3b042a=_0x4a77cf['split']('{');for(var _0x14eff1=0x1;_0x14eff1<_0x3b042a[_0x31dc('0x9b')];_0x14eff1+=0x1){var _0x4cbd67=_0x3b042a[_0x14eff1]['split']('}');if(_0x4cbd67[_0x31dc('0x9b')]>0x1){_0x4a77cf=_0x4a77cf['replaceAll']('{'+_0x4cbd67[0x0]+'}',this['channel'][_0x31dc('0x10')](_0x4cbd67[0x0])['extra']||_0x4cbd67[0x0]);}}if(_0x3b042a[_0x31dc('0x9b')]===0x1){return _0x4a77cf[_0x31dc('0x4c')]();}return this[_0x31dc('0x97')](_0x4a77cf);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x9f')]=function(_0x227303,_0x5c7456){var _0x3d6167=this['channel']['getVariable'](_0x227303);if(_0x3d6167[_0x31dc('0xa0')]===-0x1){return _0x3d6167;}logger['info'](util[_0x31dc('0x26')](_0x31dc('0xa1'),_0x5c7456,_0x3d6167[_0x31dc('0xa2')]));return this['channel'][_0x31dc('0x9e')](_0x5c7456,_0x3d6167['extra']);};AGIVertices['prototype'][_0x31dc('0x85')]=function(_0x575954){return _0x575954&&_0x575954!=='0'&&_0x575954!=='-1'&&_0x575954!=='';};AGIVertices['prototype']['maxRetry']=function(_0x41b3ce){this['createSquareDetailsReport'][_0x31dc('0xa3')](this,_0x41b3ce,'-');_0x41b3ce['retry']=_0x41b3ce['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x31dc('0xf')][_0x31dc('0xa4')]=function(_0x13e1b7){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0xa5'),_0x13e1b7['label']));if(!this[_0x31dc('0x85')](_0x13e1b7['text'])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xa6'));}var _0x274c9f='\x22'+_0x13e1b7[_0x31dc('0x5d')]+'\x22';if(this['isConfigured'](_0x13e1b7['options'])){_0x274c9f+=','+_0x13e1b7[_0x31dc('0x78')];}var _0x3b0af9=this[_0x31dc('0xc')]['exec'](_0x31dc('0xa7'),_0x274c9f);if(_0x3b0af9[_0x31dc('0xa0')]===-0x1){return _0x3b0af9;}return this['channel'][_0x31dc('0xa8')](util['format'](_0x31dc('0xa9'),_0x274c9f));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xaa')]=function(_0x435204){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xab'),_0x435204['label']));if(!this['isConfigured'](_0x435204[_0x31dc('0xac')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xad'));}var _0x120865=_0x435204[_0x31dc('0xac')];if(this[_0x31dc('0x85')](_0x435204[_0x31dc('0x78')])){_0x120865+=','+_0x435204[_0x31dc('0x78')];}var _0x437778=this['channel']['exec']('MRCPRecog',_0x120865);if(_0x437778[_0x31dc('0xa0')]===-0x1){return _0x437778;}var _0x7d78fc=this[_0x31dc('0x9f')]('RECOG_CONFIDENCE()',_0x31dc('0xae'));if(_0x7d78fc[_0x31dc('0xa0')]===-0x1){return _0x7d78fc;}var _0x417015=this['getAndSetVariable']('RECOG_INPUT()',_0x31dc('0xaf'));if(_0x417015[_0x31dc('0xa0')]===-0x1){return _0x417015;}var _0x4892c0=this['getAndSetVariable']('RECOG_INSTANCE()',_0x31dc('0xb0'));if(_0x4892c0[_0x31dc('0xa0')]===-0x1){return _0x4892c0;}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xb1'),_0x120865));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xb2')]=function(_0x4937c7){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4937c7['label']));return this[_0x31dc('0xc')]['agi']([_0x4937c7['command'],_0x4937c7[_0x31dc('0xb3')]]);};AGIVertices[_0x31dc('0xf')][_0x31dc('0xb4')]=function(_0x2c6548){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2c6548[_0x31dc('0x37')]));if(this[_0x31dc('0x85')](_0x2c6548[_0x31dc('0x65')])){logger['info'](util[_0x31dc('0x26')](_0x31dc('0xb5'),_0x2c6548[_0x31dc('0x65')]));var _0x49b80f=this[_0x31dc('0xc')][_0x31dc('0xb6')](_0x2c6548[_0x31dc('0x65')]);if(_0x49b80f['result']===-0x1){return _0x49b80f;}}return this[_0x31dc('0xc')][_0x31dc('0xb4')]();};AGIVertices[_0x31dc('0xf')][_0x31dc('0xb7')]=function(_0x2d0b8b){logger['info'](util[_0x31dc('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x2d0b8b[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x2d0b8b[_0x31dc('0x4a')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x2d0b8b,_0x31dc('0xb8'));}_0x2d0b8b[_0x31dc('0x4b')]=moment();if(this[_0x31dc('0x85')](_0x2d0b8b[_0x31dc('0xb9')])){_0x2d0b8b['scheduledAt']=moment()[_0x31dc('0xba')](_0x2d0b8b['delay'],'minutes');}if(!this[_0x31dc('0x85')](_0x2d0b8b[_0x31dc('0x4d')])){_0x2d0b8b['callback_priority']=0x2;}this[_0x31dc('0x43')][_0x31dc('0xa3')](this,_0x2d0b8b);return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x2d0b8b[_0x31dc('0x49')],_0x2d0b8b[_0x31dc('0x4a')],_0x2d0b8b[_0x31dc('0x4b')]));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xbb')]=function(_0x447c66){logger['info'](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x447c66[_0x31dc('0x37')]));var _0x58784e=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x447c66[_0x31dc('0xbc')],_0x447c66[_0x31dc('0x78')]);if(_0x58784e[_0x31dc('0xa0')]===-0x1){return _0x58784e;}return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')]('Executed\x20command\x20%s\x20%s',_0x447c66[_0x31dc('0xbc')],_0x447c66[_0x31dc('0x78')]));};AGIVertices['prototype'][_0x31dc('0xbd')]=function(_0x469ea2){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xbe'),_0x469ea2['label']));if(!this[_0x31dc('0x85')](_0x469ea2['text'])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xa6'));}var _0x445cb9='\x22'+_0x469ea2['text']+'\x22';if(this[_0x31dc('0x85')](_0x469ea2['options'])){_0x445cb9+=','+_0x469ea2[_0x31dc('0x78')];}var _0x3a6060=this['channel'][_0x31dc('0x58')](_0x31dc('0xa7'),_0x445cb9);if(_0x3a6060[_0x31dc('0xa0')]===-0x1){return _0x3a6060;}return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x445cb9));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xbf')]=function(_0x373eb0){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xc0'),_0x373eb0[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x373eb0[_0x31dc('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x573452='\x22'+_0x373eb0['text']+'\x22';if(this[_0x31dc('0x85')](_0x373eb0[_0x31dc('0x78')])){_0x573452+=','+_0x373eb0[_0x31dc('0x78')];}var _0x27042f=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x31dc('0xa7'),_0x573452);if(_0x27042f['result']===-0x1){return _0x27042f;}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0xa9'),_0x573452));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xc1')]=function(_0x3c9bf6){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xc2'),_0x3c9bf6[_0x31dc('0x37')]));if(!this['isConfigured'](_0x3c9bf6[_0x31dc('0xac')])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0xad'));}var _0x4fb610=_0x3c9bf6[_0x31dc('0xac')];if(this[_0x31dc('0x85')](_0x3c9bf6['options'])){_0x4fb610+=','+_0x3c9bf6['options'];}var _0x177c4c=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x31dc('0xc3'),_0x4fb610);if(_0x177c4c[_0x31dc('0xa0')]===-0x1){return _0x177c4c;}var _0x524b4c=this[_0x31dc('0x9f')](_0x31dc('0xc4'),_0x31dc('0xc5'));if(_0x524b4c[_0x31dc('0xa0')]===-0x1){return _0x524b4c;}var _0x2f7d45=this[_0x31dc('0x9f')](_0x31dc('0xc6'),_0x31dc('0xc7'));if(_0x2f7d45[_0x31dc('0xa0')]===-0x1){return _0x2f7d45;}var _0x289589=this['getAndSetVariable']('RECOG_INSTANCE()',_0x31dc('0xc8'));if(_0x289589[_0x31dc('0xa0')]===-0x1){return _0x289589;}return this['channel'][_0x31dc('0xa8')](util['format'](_0x31dc('0xb1'),_0x4fb610));};AGIVertices[_0x31dc('0xf')]['sestekasr']=function(_0x141a4b){logger['info'](util[_0x31dc('0x26')](_0x31dc('0xc9'),_0x141a4b[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x141a4b['grammar'])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0xad'));}var _0x9bb7d2=_0x141a4b[_0x31dc('0xac')];if(this[_0x31dc('0x85')](_0x141a4b['options'])){_0x9bb7d2+=','+_0x141a4b[_0x31dc('0x78')];}var _0xb14df=this['channel'][_0x31dc('0x58')]('MRCPRecog',_0x9bb7d2);if(_0xb14df[_0x31dc('0xa0')]===-0x1){return _0xb14df;}var _0x267ba0=this[_0x31dc('0x9f')](_0x31dc('0xc4'),_0x31dc('0xca'));if(_0x267ba0[_0x31dc('0xa0')]===-0x1){return _0x267ba0;}var _0x35a547=this[_0x31dc('0x9f')]('RECOG_INPUT()',_0x31dc('0xcb'));if(_0x35a547[_0x31dc('0xa0')]===-0x1){return _0x35a547;}var _0x414b23=this[_0x31dc('0x9f')](_0x31dc('0xcc'),'SESTEK_ASR_INSTANCE');if(_0x414b23[_0x31dc('0xa0')]===-0x1){return _0x414b23;}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xb1'),_0x9bb7d2));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xcd')]=function(_0x117339){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0xce'),_0x117339[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x117339[_0x31dc('0xcf')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x117339,'no\x20database\x20selected');}var _0xf5cf62=this['getSquareOdbc']['sync'](this,_0x117339[_0x31dc('0xcf')]);if(!_0xf5cf62){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x117339,_0x31dc('0xd0'));}if(!this[_0x31dc('0x85')](_0x117339[_0x31dc('0x2e')])){return this['channel']['error'](_0x117339,_0x31dc('0xd1'));}var _0x42c977=_0x117339['query'][_0x31dc('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x31dc('0xc')]['noop'](util[_0x31dc('0x26')](_0x31dc('0xd2'),_0x42c977));var _0x32ff23=this[_0x31dc('0x28')]['sync'](this,_0xf5cf62,_0x42c977);this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x117339,_0x42c977);if(!this[_0x31dc('0x85')](_0x117339[_0x31dc('0xd3')])){return this[_0x31dc('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x19c45b=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0x117339['variable_id']);if(!_0x19c45b){return this[_0x31dc('0xc')]['error'](_0x117339,'no\x20variable\x20found');}var _0x4844e6=this;_0x32ff23['forEach'](function(_0x5e2457,_0x11da22){Object[_0x31dc('0xd4')](_0x5e2457)[_0x31dc('0xd5')](function(_0x1a9e0d){_0x4844e6[_0x31dc('0xc')]['setVariable'](util[_0x31dc('0x26')](_0x31dc('0xd6'),_0x19c45b,_0x11da22,_0x1a9e0d),_0x5e2457[_0x1a9e0d]);});});this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0xd7'),_0x19c45b),_0x32ff23['length']);return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('variable\x20%s\x20set',_0x19c45b));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xd8')]=function(_0x5d4b1){logger[_0x31dc('0xd9')](util['format'](_0x31dc('0xda'),_0x5d4b1['label']));if(!this[_0x31dc('0x85')](_0x5d4b1[_0x31dc('0xdb')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x5d4b1,'no\x20user\x20selected');}var _0x437bca=this['getUser']['sync'](this,_0x5d4b1[_0x31dc('0xdb')]);if(!_0x437bca){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x5d4b1,_0x31dc('0xdc'));}var _0x277d32=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x31dc('0xdd'),[util[_0x31dc('0x26')](_0x31dc('0xde'),_0x437bca),_0x5d4b1[_0x31dc('0x65')],_0x5d4b1[_0x31dc('0xdf')],_0x5d4b1['url']]);if(_0x277d32[_0x31dc('0xa0')]===-0x1){return _0x277d32;}return this['channel'][_0x31dc('0xa8')](util['format'](_0x31dc('0xe0'),_0x31dc('0xdd')));};AGIVertices['prototype']['dialogflow']=function(_0x2eae94){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xe1'),_0x2eae94['label']));if(!this['isConfigured'](_0x2eae94[_0x31dc('0x7a')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x2eae94[_0x31dc('0x5d')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xa6'));}this[_0x31dc('0xc')][_0x31dc('0xe2')]=!![];this[_0x31dc('0x36')](_0x2eae94);this[_0x31dc('0x42')](_0x2eae94['text'],'in','','');this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format']('Trying\x20Dialogflow:\x20%s',_0x2eae94[_0x31dc('0x5d')]));var _0x80fdbc=this['googleDialogflow'][_0x31dc('0xa3')](this,_0x2eae94);if(_0x80fdbc){for(var _0x31f00e in _0x80fdbc){if(_0x80fdbc[_0x31dc('0x94')](_0x31f00e)){this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0xe3'),_0x31f00e[_0x31dc('0x69')]()),_0x80fdbc[_0x31f00e]);}}this['createSquareMessage'](_0x80fdbc['speech'],'out',_0x31dc('0xe4'),'');return this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0xe5'),_0x80fdbc[_0x31dc('0xe6')]));}return this['channel'][_0x31dc('0x2a')](_0x2eae94,_0x31dc('0xe7'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xe8')]=function(_0xcc9cd){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0xe9'),_0xcc9cd[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0xcc9cd[_0x31dc('0x7c')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xea'));}if(!this[_0x31dc('0x85')](_0xcc9cd[_0x31dc('0x7d')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xeb'));}if(!this[_0x31dc('0x85')](_0xcc9cd[_0x31dc('0x7e')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xec'));}if(!this['isConfigured'](_0xcc9cd[_0x31dc('0xed')])){return this[_0x31dc('0xc')]['noop']('no\x20anguage\x20configured');}if(!this[_0x31dc('0x85')](_0xcc9cd[_0x31dc('0x5d')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xa6'));}this['channel'][_0x31dc('0xe2')]=!![];this[_0x31dc('0x36')](_0xcc9cd);this[_0x31dc('0x42')](_0xcc9cd[_0x31dc('0x5d')],'in','','');this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xee'),_0xcc9cd[_0x31dc('0x5d')]));var _0x3a2288=this[_0x31dc('0x7b')][_0x31dc('0xa3')](this,_0xcc9cd);if(_0x3a2288){for(var _0x4ae90b in _0x3a2288){if(_0x3a2288[_0x31dc('0x94')](_0x4ae90b)){if(_0x4ae90b!==_0x31dc('0xef')){this[_0x31dc('0xc')]['setVariable'](util[_0x31dc('0x26')]('DIALOGFLOW_%s',_0x4ae90b[_0x31dc('0x69')]()),_0x3a2288[_0x4ae90b]);}}}this[_0x31dc('0x42')](_0x3a2288['speech'],_0x31dc('0xf0'),_0x31dc('0xe8'),_0x3a2288[_0x31dc('0xef')]);return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xf1'),_0x3a2288[_0x31dc('0xe6')]));}return this[_0x31dc('0xc')]['error'](_0xcc9cd,_0x31dc('0xf2'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0xf3')]=function(_0x56236f){logger['info'](util[_0x31dc('0x26')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x56236f[_0x31dc('0x37')]));if(!this['isConfigured'](_0x56236f[_0x31dc('0xf4')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xf5'));}if(!this[_0x31dc('0x85')](_0x56236f[_0x31dc('0xf6')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xf7'));}if(!this['isConfigured'](_0x56236f['password'])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0xf8'));}if(!this['isConfigured'](_0x56236f[_0x31dc('0xf9')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xa6'));}this[_0x31dc('0xc')][_0x31dc('0xe2')]=!![];this['createSquareDetailsReport'](_0x56236f);this[_0x31dc('0x42')](_0x56236f['text'],'in','','');this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xfa'),_0x56236f[_0x31dc('0x5d')]));var _0x2c9209=this['sestekNDA'][_0x31dc('0xa3')](this,_0x56236f);if(_0x2c9209){for(var _0x44d39c in _0x2c9209){if(_0x2c9209['hasOwnProperty'](_0x44d39c)){this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0xfb'),_0x44d39c[_0x31dc('0x69')]()),_0x2c9209[_0x44d39c]);}}this[_0x31dc('0x42')](_0x2c9209[_0x31dc('0xe6')],_0x31dc('0xf0'),_0x31dc('0xf3'),'');if(_0x2c9209[_0x31dc('0xfc')]){this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xfd'),_0x2c9209[_0x31dc('0xfc')]));var _0xa40391=this[_0x31dc('0xc')]['streamFile'](_0x2c9209[_0x31dc('0xfc')]);try{fs['unlink'](_0x2c9209[_0x31dc('0xfc')]+_0x31dc('0xfe'));}catch(_0x1c7e5a){logger[_0x31dc('0x2a')](_0x1c7e5a);}return _0xa40391;}else{return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xff'),_0x2c9209[_0x31dc('0xe6')]));}}return this[_0x31dc('0xc')]['error'](_0x56236f,_0x31dc('0x100'));};AGIVertices[_0x31dc('0xf')]['end']=function(_0x21f47a){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x21f47a[_0x31dc('0x37')]));return this[_0x31dc('0xc')]['noop'](_0x31dc('0x101'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x102')]=function(_0x33f197){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x103'),_0x33f197[_0x31dc('0x37')]));var _0x6f1ef0='';if(_0x33f197['trunk_id']){if(!this[_0x31dc('0x85')](_0x33f197[_0x31dc('0x104')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x33f197,_0x31dc('0x105'));}else{var _0x152413=parseInt(_0x33f197['trunk_id'],0xa);if(isNaN(_0x152413)){_0x6f1ef0=_0x33f197[_0x31dc('0x104')];}else{_0x6f1ef0=this[_0x31dc('0x1a')]['sync'](this,_0x33f197[_0x31dc('0x104')]);if(!_0x6f1ef0){return this['channel']['error'](_0x33f197,_0x31dc('0x106'));}}}}else if(_0x33f197[_0x31dc('0x107')]){_0x6f1ef0=_0x33f197[_0x31dc('0x107')];}else{return this['channel'][_0x31dc('0x2a')](_0x33f197,'no\x20trunk\x20selected');}var _0x55c25c=this[_0x31dc('0xc')][_0x31dc('0x58')]('DIAL',[util[_0x31dc('0x26')](_0x31dc('0x108'),_0x6f1ef0,_0x33f197['phone']),_0x33f197['timeout'],_0x33f197[_0x31dc('0xdf')],_0x33f197[_0x31dc('0x71')]]);if(_0x55c25c[_0x31dc('0xa0')]===-0x1){return _0x55c25c;}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0xe0'),_0x31dc('0xdd')));};AGIVertices['prototype']['finally']=function(_0x8c1ae8){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x109'),_0x8c1ae8[_0x31dc('0x37')]));return this['channel'][_0x31dc('0xa8')](_0x31dc('0x10a'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x10b')]=function(_0x3ab9f2){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x10c'),_0x3ab9f2[_0x31dc('0x37')]));if(_0x3ab9f2[_0x31dc('0x10d')]===0x0){return this[_0x31dc('0x10e')](_0x3ab9f2);}_0x3ab9f2[_0x31dc('0x10d')]-=0x1;if(!this['isConfigured'](_0x3ab9f2[_0x31dc('0x10f')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x3ab9f2,_0x31dc('0x110'));}var _0x3120fe=this[_0x31dc('0x1c')]['sync'](this,_0x3ab9f2[_0x31dc('0x10f')]);if(!_0x3120fe){return this[_0x31dc('0xc')]['error'](_0x3ab9f2,'no\x20file\x20audio\x20found');}if(!this[_0x31dc('0x85')](_0x3ab9f2[_0x31dc('0xd3')])){return this['channel'][_0x31dc('0x2a')](_0x31dc('0x111'));}var _0x317f8c=this[_0x31dc('0xc')][_0x31dc('0x112')](_0x3120fe,_0x3ab9f2[_0x31dc('0x113')],_0x3ab9f2[_0x31dc('0x114')]);var _0x323ba3=_0x317f8c['result']?_0x317f8c[_0x31dc('0xa0')]['toString']():'';logger[_0x31dc('0x2c')](_0x31dc('0x115'),JSON['stringify'](_0x317f8c));if(_0x317f8c[_0x31dc('0xa0')]===-0x1){this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x3ab9f2,_0x323ba3);return _0x317f8c;}else if(_0x317f8c[_0x31dc('0xa2')]===_0x31dc('0x65')){_0x317f8c['result']=_0x323ba3[_0x31dc('0x9b')]>=parseInt(_0x3ab9f2[_0x31dc('0x116')])?'x':'i';}else{_0x317f8c['result']=_0x323ba3[_0x31dc('0x9b')]>=parseInt(_0x3ab9f2[_0x31dc('0x116')])&&_0x323ba3[_0x31dc('0x9b')]<=parseInt(_0x3ab9f2['maxdigit'])?'x':'i';}var _0x4a7e04=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0x3ab9f2[_0x31dc('0xd3')]);if(!_0x4a7e04){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x3ab9f2,_0x31dc('0x117'));}this[_0x31dc('0xc')][_0x31dc('0x9e')](_0x4a7e04,_0x323ba3);if(this[_0x31dc('0x85')](_0x3ab9f2[_0x31dc('0x118')])){var _0x1a8280=parseInt(_0x3ab9f2[_0x31dc('0x118')],0xa);var _0x2072ed=rs[_0x31dc('0x119')]({'charset':'*','length':_0x1a8280});var _0xc1aec0=_0x323ba3[_0x31dc('0x9b')];if(_0xc1aec0>0x0){if(_0xc1aec0>_0x1a8280){this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x3ab9f2,_0x3ab9f2[_0x31dc('0x11a')]===_0x31dc('0x11b')?_0x2072ed+_0x323ba3[_0x31dc('0x11c')](_0x1a8280):_0x323ba3[_0x31dc('0x11c')](0x0,_0xc1aec0-_0x1a8280)+_0x2072ed);}else{this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x3ab9f2,rs[_0x31dc('0x119')]({'charset':'*','length':_0xc1aec0}));}}else{this['createSquareDetailsReport'][_0x31dc('0xa3')](this,_0x3ab9f2,'');}}else{this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x3ab9f2,_0x323ba3);}return _0x317f8c;};AGIVertices[_0x31dc('0xf')][_0x31dc('0xb')]=function(_0x1d9e2f){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x11d'),_0x1d9e2f['label']));return this[_0x31dc('0x10b')](_0x1d9e2f);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x11e')]=function(_0x2085c6){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x11f'),_0x2085c6[_0x31dc('0x37')]));this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x2085c6,_0x2085c6['goalname']);return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x120'),_0x2085c6['goalname']));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x121')]=function(_0x374b87){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x122'),_0x374b87['label']));if(!this[_0x31dc('0x85')](_0x374b87[_0x31dc('0x88')])||!this['isConfigured'](_0x374b87[_0x31dc('0x89')])){return this['channel']['noop'](_0x31dc('0x123'));}if(!this[_0x31dc('0x85')](_0x374b87['text'])){return this['channel'][_0x31dc('0xa8')]('no\x20text\x20configured');}this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x124'),_0x374b87['text']));var _0x369f60=this[_0x31dc('0x87')][_0x31dc('0xa3')](this,_0x374b87);if(_0x369f60){this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0x125'),_0x369f60));var _0x301f3f=this[_0x31dc('0xc')]['streamFile'](_0x369f60);try{fs['unlink'](_0x369f60+_0x31dc('0xfe'));}catch(_0x517593){logger[_0x31dc('0x2a')](_0x517593);}return _0x301f3f;}return this[_0x31dc('0xc')]['error'](_0x374b87,_0x31dc('0x126'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x127')]=function(_0x3ba4e7){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x128'),_0x3ba4e7['label']));if(!this[_0x31dc('0x85')](_0x3ba4e7['aws_access_key_id'])||!this[_0x31dc('0x85')](_0x3ba4e7[_0x31dc('0x89')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x123'));}if(!this[_0x31dc('0x85')](_0x3ba4e7['aws_bot_name'])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x129'));}if(!this[_0x31dc('0x85')](_0x3ba4e7[_0x31dc('0x5d')])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0xa6'));}this[_0x31dc('0xc')][_0x31dc('0xe2')]=!![];this[_0x31dc('0x36')](_0x3ba4e7);this[_0x31dc('0x42')](_0x3ba4e7['text'],'in','','');this['channel'][_0x31dc('0xa8')](util['format'](_0x31dc('0x12a'),_0x3ba4e7[_0x31dc('0x5d')]));var _0x25e688=this[_0x31dc('0x8c')][_0x31dc('0xa3')](this,_0x3ba4e7);if(_0x25e688){for(var _0x34df2b in _0x25e688){if(_0x25e688['hasOwnProperty'](_0x34df2b)&&_['isString'](_0x25e688[_0x34df2b])){this['channel'][_0x31dc('0x9e')](util['format'](_0x31dc('0x12b'),_0x34df2b['toUpperCase']()),_0x25e688[_0x34df2b]);}}if(_['isNil'](_0x25e688[_0x31dc('0x76')])){return this['channel'][_0x31dc('0xa8')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x31dc('0x42')](_0x25e688[_0x31dc('0x76')],_0x31dc('0xf0'),'amazonlex','');return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x25e688[_0x31dc('0x76')]));}}return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x3ba4e7,_0x31dc('0x12c'));};AGIVertices['prototype'][_0x31dc('0x12d')]=function(_0x296655){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x12e'),_0x296655['label'],_0x296655['timeout']));if(!this[_0x31dc('0x85')](_0x296655[_0x31dc('0x7a')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x12f'));}var _0x46d5d4='wav';var _0x101936=util[_0x31dc('0x26')](_0x31dc('0x130'),FILES_PATH,rs[_0x31dc('0x119')](0x4));var _0x4d8e65=util[_0x31dc('0x26')]('%s.%s',_0x101936,_0x46d5d4);var _0x5f2c2c=!![];if(_0x296655['beep']===_0x31dc('0x131')){_0x5f2c2c=![];}var _0x54c449=this[_0x31dc('0xc')]['recordFile'](_0x101936,_0x46d5d4,_0x296655[_0x31dc('0x132')],_0x296655[_0x31dc('0x65')],undefined,_0x5f2c2c);if(_0x54c449[_0x31dc('0xa0')]!==-0x1){this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x133'),_0x4d8e65));var _0x2dc353=this[_0x31dc('0x8f')][_0x31dc('0xa3')](this,_0x296655,_0x4d8e65);if(_0x2dc353){for(var _0x2893ec in _0x2dc353){if(_0x2dc353[_0x31dc('0x94')](_0x2893ec)){this['channel'][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0x134'),_0x2893ec['toUpperCase']()),_0x2dc353[_0x2893ec]);}}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x135'),JSON[_0x31dc('0x72')](_0x2dc353)));}}return _0x54c449;};AGIVertices[_0x31dc('0xf')][_0x31dc('0x136')]=function(_0x28c544){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x137'),_0x28c544[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x28c544[_0x31dc('0x138')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x139'));}if(!this[_0x31dc('0x85')](_0x28c544[_0x31dc('0x92')])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0x13a'));}var _0x4490dc=_0x31dc('0x13b');var _0x43df26=util[_0x31dc('0x26')](_0x31dc('0x130'),FILES_PATH,rs['generate'](0x4));var _0x673c5=util[_0x31dc('0x26')](_0x31dc('0x9d'),_0x43df26,_0x4490dc);var _0x258b16=!![];if(_0x28c544['beep']===_0x31dc('0x131')){_0x258b16=![];}var _0xd931ab=this[_0x31dc('0xc')][_0x31dc('0x13c')](_0x43df26,_0x4490dc,_0x28c544[_0x31dc('0x132')],_0x28c544[_0x31dc('0x65')],undefined,_0x258b16);if(_0xd931ab[_0x31dc('0xa0')]!==-0x1){this['channel']['noop'](util['format']('tilde\x20%s\x20file\x20created',_0x673c5));var _0x1b9c91=this[_0x31dc('0x91')][_0x31dc('0xa3')](this,_0x28c544,_0x673c5);if(_0x1b9c91){for(var _0x34eaca in _0x1b9c91){if(_0x1b9c91[_0x31dc('0x94')](_0x34eaca)){this['channel'][_0x31dc('0x9e')](util['format'](_0x31dc('0x13d'),_0x34eaca[_0x31dc('0x69')]()),_0x1b9c91[_0x34eaca]);}}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('TildeASR\x20Result\x20%s',JSON[_0x31dc('0x72')](_0x1b9c91)));}}return _0xd931ab;};AGIVertices['prototype'][_0x31dc('0x13e')]=function(_0x3f560d){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x13f'),_0x3f560d[_0x31dc('0x37')]));return this[_0x31dc('0xc')]['continueAt'](_0x3f560d['context'],_0x3f560d[_0x31dc('0x140')],_0x3f560d['priority']);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x141')]=function(_0xb4bef){logger['info'](util[_0x31dc('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0xb4bef[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0xb4bef[_0x31dc('0x142')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0xb4bef,'no\x20condition\x20configured');}try{var _0x1aa375=eval(_0xb4bef[_0x31dc('0x142')])?_0x31dc('0x143'):'false';this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('EVAL\x20CONDITION\x20%s\x20%s',_0xb4bef[_0x31dc('0x142')],_0x1aa375));return{'code':0xc8,'result':_0x1aa375};}catch(_0x6604aa){return{'code':0xc8,'result':_0x31dc('0x144')};}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x145')]=function(_0x1fc4d9){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x146'),_0x1fc4d9[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x1fc4d9[_0x31dc('0x147')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x1fc4d9,_0x31dc('0x148'));}var _0x126dfd=this[_0x31dc('0x149')][_0x31dc('0xa3')](this,_0x1fc4d9[_0x31dc('0x147')]);if(!_0x126dfd){return this['channel'][_0x31dc('0x2a')](_0x1fc4d9,'no\x20intervals\x20found');}for(var _0x39d904=0x0;_0x39d904<_0x126dfd[_0x31dc('0x9b')];_0x39d904+=0x1){var _0x52cda7=this['channel'][_0x31dc('0x10')](util[_0x31dc('0x26')](_0x31dc('0x14a'),_0x126dfd[_0x39d904]));if(_0x52cda7[_0x31dc('0xa0')]===-0x1){return _0x52cda7;}logger[_0x31dc('0x2c')](util['format']('IFTIME\x20%s\x20%s',_0x126dfd[_0x39d904],_0x52cda7['extra']));if(_0x52cda7[_0x31dc('0xa2')]===_0x31dc('0x143')){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x14b'),_0x126dfd[_0x39d904],_0x31dc('0x143')));this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format']('IFTIME\x20%s\x20%s',_0x126dfd[_0x39d904],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x14b'),_0x126dfd[_0x39d904],_0x31dc('0x144')));this['channel'][_0x31dc('0xa8')](util['format']('IFTIME\x20%s\x20%s',_0x126dfd[_0x39d904],_0x31dc('0x144')));}}return{'code':0xc8,'result':_0x31dc('0x144')};};AGIVertices[_0x31dc('0xf')]['hangup']=function(_0x54ce3b){logger[_0x31dc('0x2c')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x54ce3b['label']));return this[_0x31dc('0xc')][_0x31dc('0x14c')]();};AGIVertices[_0x31dc('0xf')][_0x31dc('0x14d')]=function(_0x38896a){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x14e'),_0x38896a['label']));if(!this['isConfigured'](_0x38896a[_0x31dc('0x7a')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x12f'));}var _0x13ed4d=_0x31dc('0x13b');var _0xfdd065=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x31dc('0x119')](0x4));var _0x308680=util[_0x31dc('0x26')]('%s.%s',_0xfdd065,_0x13ed4d);var _0x1cb2aa=!![];if(_0x38896a['beep']===_0x31dc('0x131')){_0x1cb2aa=![];}var _0x1ad6a0=this[_0x31dc('0xc')]['recordFile'](_0xfdd065,_0x13ed4d,_0x38896a['intKey'],_0x38896a['timeout'],undefined,_0x1cb2aa);if(_0x1ad6a0[_0x31dc('0xa0')]!==-0x1){this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('ispeech\x20%s\x20file\x20created',_0x308680));var _0x392835=this[_0x31dc('0x83')][_0x31dc('0xa3')](this,_0x38896a,_0x308680);if(_0x392835){for(var _0x144d82 in _0x392835){if(_0x392835['hasOwnProperty'](_0x144d82)){this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0x14f'),_0x144d82[_0x31dc('0x69')]()),_0x392835[_0x144d82]);}}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x150'),JSON[_0x31dc('0x72')](_0x392835)));}}return _0x1ad6a0;};AGIVertices[_0x31dc('0xf')][_0x31dc('0x151')]=function(_0x28f8be){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x152'),_0x28f8be[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x28f8be['key'])){return this[_0x31dc('0xc')]['noop'](_0x31dc('0x12f'));}if(!this['isConfigured'](_0x28f8be[_0x31dc('0x5d')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xa6'));}this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0x153'),_0x28f8be['text']));var _0x334be7=this['ispeechTTS'][_0x31dc('0xa3')](this,_0x28f8be);if(_0x334be7){this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0x154'),_0x334be7));var _0x1c070b=this[_0x31dc('0xc')][_0x31dc('0x155')](_0x334be7,_0x28f8be[_0x31dc('0x132')]);try{fs['unlink'](_0x334be7+_0x31dc('0xfe'));}catch(_0x1c3359){logger[_0x31dc('0x2a')](_0x1c3359);}return _0x1c070b;}return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x28f8be,_0x31dc('0x156'));};AGIVertices['prototype'][_0x31dc('0x157')]=function(_0x440b08){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x158'),_0x440b08['label']));if(!this[_0x31dc('0x85')](_0x440b08['findBy'])){return this['channel'][_0x31dc('0x2a')](_0x440b08,_0x31dc('0x159'));}logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x15a'),this[_0x31dc('0xc')]['callerid'],_0x440b08[_0x31dc('0x15b')]));var _0x5d5c06=this['agentLogin']['sync'](this,_0x440b08[_0x31dc('0x15b')]);if(_0x5d5c06){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x15c'),this['channel']['callerid'],_0x440b08['findBy']));this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x440b08['findBy']));return{'code':0xc8,'result':_0x31dc('0x15d')};}else{logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x15e'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x440b08[_0x31dc('0x15b')]));this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x31dc('0xc')]['callerid'],_0x440b08[_0x31dc('0x15b')]));return{'code':0xc8,'result':_0x31dc('0x15f')};}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x160')]=function(_0x550474){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x161'),_0x550474[_0x31dc('0x37')]));if(!this['isConfigured'](_0x550474[_0x31dc('0x15b')])){return this['channel'][_0x31dc('0x2a')](_0x550474,_0x31dc('0x159'));}logger['info'](util['format'](_0x31dc('0x15a'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x550474[_0x31dc('0x15b')]));var _0x33416f=this[_0x31dc('0x53')]['sync'](this,_0x550474[_0x31dc('0x15b')]);if(_0x33416f){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x15c'),this['channel'][_0x31dc('0x3a')],_0x550474[_0x31dc('0x15b')]));this['channel']['noop'](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x550474['findBy']));return{'code':0xc8,'result':_0x31dc('0x15d')};}else{logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x15e'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x550474[_0x31dc('0x15b')]));this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x31dc('0xc')]['callerid'],_0x550474[_0x31dc('0x15b')]));return{'code':0xc8,'result':_0x31dc('0x15f')};}};AGIVertices['prototype'][_0x31dc('0x162')]=function(_0x48d8ff){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x163'),_0x48d8ff['label']));if(!this['isConfigured'](_0x48d8ff[_0x31dc('0x164')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x48d8ff,_0x31dc('0x165'));}this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0x166'),_0x48d8ff[_0x31dc('0x164')]));var _0xc2ce17=eval(_0x48d8ff[_0x31dc('0x164')]);if(!this[_0x31dc('0x85')](_0x48d8ff['variable_id'])){return this[_0x31dc('0xc')][_0x31dc('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x17d4fa=this[_0x31dc('0x10')]['sync'](this,_0x48d8ff[_0x31dc('0xd3')]);if(!_0x17d4fa){return this[_0x31dc('0xc')]['error'](_0x48d8ff,'no\x20variable\x20found');}if(_['isArray'](_0xc2ce17)){var _0x3e0d68=this;_0xc2ce17['forEach'](function(_0x49302e,_0x378ff0){_0x3e0d68[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0x167'),_0x17d4fa,_0x378ff0),_0x49302e);});return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x168'),_0x17d4fa));}else{return this[_0x31dc('0xc')]['setVariable'](_0x17d4fa,_0xc2ce17);}};AGIVertices[_0x31dc('0xf')][_0x31dc('0x169')]=function(_0x5c7764){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x16a'),_0x5c7764[_0x31dc('0x37')]));if(_0x5c7764['retry']===0x0){return this[_0x31dc('0x10e')](_0x5c7764);}_0x5c7764[_0x31dc('0x10d')]-=0x1;if(!this['isConfigured'](_0x5c7764['file_id'])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x5c7764,_0x31dc('0x110'));}var _0x59e72e=this[_0x31dc('0x1c')][_0x31dc('0xa3')](this,_0x5c7764[_0x31dc('0x10f')]);if(!_0x59e72e){return this['channel']['error'](_0x5c7764,'no\x20file\x20audio\x20found');}var _0x551923=this[_0x31dc('0xc')][_0x31dc('0x112')](_0x59e72e,_0x5c7764['response'],_0x5c7764[_0x31dc('0x16b')]);var _0x4b3f05=_0x551923['result'];if(_0x551923['result']===-0x1){this[_0x31dc('0x36')]['sync'](this,_0x5c7764,'-1');return _0x551923;}else if(_0x551923[_0x31dc('0xa2')]===_0x31dc('0x65')){_0x551923[_0x31dc('0xa0')]=_0x551923[_0x31dc('0xa0')][_0x31dc('0x9b')]>0x0?_0x551923[_0x31dc('0xa0')]:'t';}else if(_[_0x31dc('0x44')](_0x551923[_0x31dc('0xa0')])){_0x551923[_0x31dc('0xa0')]='#';_0x4b3f05='#';}if(!this['isConfigured'](_0x5c7764[_0x31dc('0xd3')])){this['channel'][_0x31dc('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5dce53=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0x5c7764[_0x31dc('0xd3')]);if(!_0x5dce53){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x5c7764,_0x31dc('0x117'));}this[_0x31dc('0xc')]['setVariable'](_0x5dce53,_0x4b3f05);}this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x5c7764,_0x4b3f05);return _0x551923;};AGIVertices[_0x31dc('0xf')][_0x31dc('0xa8')]=function(_0x339a2b){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x16c'),_0x339a2b[_0x31dc('0x37')]));return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x339a2b[_0x31dc('0x16d')]||_0x339a2b[_0x31dc('0x37')]);};AGIVertices['prototype'][_0x31dc('0x16e')]=function(_0x72559b){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x16f'),_0x72559b[_0x31dc('0x37')]));if(!this['isConfigured'](_0x72559b[_0x31dc('0x15b')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x72559b,_0x31dc('0x159'));}logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x15a'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x72559b[_0x31dc('0x15b')]));var _0x372953=this[_0x31dc('0x4e')][_0x31dc('0xa3')](this,_0x72559b[_0x31dc('0x170')]);var _0x261988=this[_0x31dc('0x50')]['sync'](this,_0x72559b[_0x31dc('0x15b')],_0x372953);if(_0x261988){logger['info'](util['format'](_0x31dc('0x15c'),this[_0x31dc('0xc')]['callerid'],_0x72559b[_0x31dc('0x15b')]));this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x72559b['findBy']));return{'code':0xc8,'result':_0x31dc('0x15d')};}else{logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x15e'),this[_0x31dc('0xc')]['callerid'],_0x72559b[_0x31dc('0x15b')]));this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x72559b[_0x31dc('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['playback']=function(_0x222099){logger['info'](util[_0x31dc('0x26')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x222099[_0x31dc('0x37')]));if(!this['isConfigured'](_0x222099['file_id'])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x222099,_0x31dc('0x110'));}var _0x3460b9=this[_0x31dc('0x1c')][_0x31dc('0xa3')](this,_0x222099['file_id']);if(!_0x3460b9){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x222099,_0x31dc('0x171'));}var _0x2b2987=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x31dc('0x172'),[_0x3460b9,_0x222099[_0x31dc('0xdf')]]);if(_0x2b2987[_0x31dc('0xa0')]===-0x1){return _0x2b2987;}return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x173'),_0x31dc('0x172'),_0x3460b9));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x174')]=function(_0xfa21ed){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x175'),_0xfa21ed['label']));if(!this[_0x31dc('0x85')](_0xfa21ed[_0x31dc('0x176')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0xfa21ed,_0x31dc('0x177'));}var _0x14f47a='';var _0x504ce6=parseInt(_0xfa21ed[_0x31dc('0x176')],0xa);if(isNaN(_0x504ce6)){_0x14f47a=_0xfa21ed[_0x31dc('0x176')];}else{_0x14f47a=this[_0x31dc('0x178')][_0x31dc('0xa3')](this,_0xfa21ed[_0x31dc('0x176')]);if(!_0x14f47a){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0xfa21ed,_0x31dc('0x179'));}}var _0x304020='';if(this[_0x31dc('0x85')](_0xfa21ed[_0x31dc('0x10f')])){var _0x1f1a65=this[_0x31dc('0x1c')]['sync'](this,_0xfa21ed['file_id']);if(_0x1f1a65){_0x304020=_0x1f1a65;}}this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0xfa21ed,_0x14f47a);if(_0xfa21ed[_0x31dc('0xdf')][_0x31dc('0x17a')]('x')<0x0){_0xfa21ed['opts']+='x';}if(_0xfa21ed['opts'][_0x31dc('0x17a')]('X')<0x0){_0xfa21ed[_0x31dc('0xdf')]+='X';}this[_0x31dc('0xc')][_0x31dc('0x9e')](_0x31dc('0x17b'),_0x14f47a?_0x14f47a['toLowerCase']():'');var _0x441cf7=this[_0x31dc('0xc')][_0x31dc('0x58')](_0x31dc('0x17c'),[_0x14f47a,_0xfa21ed[_0x31dc('0xdf')],_0xfa21ed[_0x31dc('0x71')],_0x304020,_0xfa21ed[_0x31dc('0x65')],_0xfa21ed['agi'],_0xfa21ed[_0x31dc('0x17d')],_0xfa21ed[_0x31dc('0x17e')],'',_0xfa21ed['position']]);if(_0x441cf7[_0x31dc('0xa0')]===-0x1){return _0x441cf7;}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')]('Executed\x20command\x20%s\x20%s',_0x31dc('0x17c'),_0x14f47a));};AGIVertices[_0x31dc('0xf')]['record']=function(_0x25150b){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x17f'),_0x25150b[_0x31dc('0x37')]));var _0x103945=_0x25150b[_0x31dc('0x180')]||'wav';var _0x5645ee=util[_0x31dc('0x26')]('%s_%s',this[_0x31dc('0xc')][_0x31dc('0x3c')],rs[_0x31dc('0x119')](0x5));var _0x42cffa=util[_0x31dc('0x26')](_0x31dc('0x181'),FILES_PATH,_0x5645ee,_0x103945);var _0x4fae58=util[_0x31dc('0x26')](_0x31dc('0x130'),FILES_PATH,_0x5645ee);this[_0x31dc('0x3b')][_0x31dc('0xa3')](this,_0x25150b,_0x5645ee,_0x42cffa);this[_0x31dc('0xc')]['setVariable']('RECORDING_SAVENAME',_0x5645ee);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x4fae58,_0x103945,_0x25150b['escape_digits'],_0x25150b[_0x31dc('0x65')]);return this[_0x31dc('0xc')]['recordFile'](_0x4fae58,_0x103945,_0x25150b[_0x31dc('0x182')],_0x25150b[_0x31dc('0x65')],undefined,!![]);};AGIVertices['prototype'][_0x31dc('0x183')]=function(_0x4d0432){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x4d0432['label']));if(!this[_0x31dc('0x85')](_0x4d0432[_0x31dc('0x71')])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0x184'));}var _0x465d55=this[_0x31dc('0x185')][_0x31dc('0xa3')](this,_0x4d0432);logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x186'),util[_0x31dc('0x187')](_0x465d55,{'showHidden':![],'depth':null})));if(!this[_0x31dc('0x85')](_0x4d0432['variable_id'])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x188'));}var _0x4f3598=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0x4d0432[_0x31dc('0xd3')]);if(!_0x4f3598){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x4d0432,_0x31dc('0x117'));}this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')]('%s_STATUS_CODE',_0x4f3598),_0x465d55[_0x31dc('0x74')]?_0x465d55[_0x31dc('0x74')]:'200');this[_0x31dc('0xc')][_0x31dc('0x9e')](util[_0x31dc('0x26')](_0x31dc('0x189'),_0x4f3598),_0x465d55['statusMessage']?_0x465d55['statusMessage']:'OK');if(_0x465d55[_0x31dc('0x6a')]){try{this[_0x31dc('0x9c')](_0x465d55[_0x31dc('0x6a')],_0x4f3598);}catch(_0x4f8a64){logger[_0x31dc('0x2a')](util['format'](_0x31dc('0x18a'),_0x4f3598));}}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x18b'),_0x4f3598));};AGIVertices[_0x31dc('0xf')]['saydigits']=function(_0x45820d){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x18c'),_0x45820d['label']));return this[_0x31dc('0xc')][_0x31dc('0x18d')](_0x45820d['digits'][_0x31dc('0x5a')](/\s+/g,''),_0x45820d[_0x31dc('0x182')]);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x18e')]=function(_0x103016){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x18f'),_0x103016['label']));return this['channel'][_0x31dc('0x190')](_0x103016[_0x31dc('0x66')][_0x31dc('0x5a')](/\s+/g,''),_0x103016[_0x31dc('0x182')]);};AGIVertices[_0x31dc('0xf')]['sayphonetic']=function(_0x170782){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x191'),_0x170782[_0x31dc('0x37')]));return this[_0x31dc('0xc')]['sayPhonetic'](_0x170782['text'],_0x170782[_0x31dc('0x182')]);};AGIVertices['prototype'][_0x31dc('0x192')]=function(_0x5c11f1){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x193'),_0x5c11f1[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x5c11f1[_0x31dc('0x194')])){return this['channel'][_0x31dc('0xa8')](_0x31dc('0x195'));}var _0x55c1bb=this[_0x31dc('0x196')]['sync'](this,_0x5c11f1[_0x31dc('0x194')]);if(!_0x55c1bb||!_0x55c1bb['Smtp']){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x5c11f1,'no\x20mail\x20account\x20found');}var _0x1c630c={'from':util[_0x31dc('0x26')](_0x31dc('0x197'),_0x55c1bb[_0x31dc('0x15')],_0x55c1bb['email']||_0x55c1bb['Smtp'][_0x31dc('0x198')]),'to':_0x5c11f1['to']||'','cc':_0x5c11f1['cc']||'','bcc':_0x5c11f1[_0x31dc('0x199')]||'','subject':_0x5c11f1[_0x31dc('0x19a')],'html':_0x5c11f1['text'],'text':_0x5c11f1['text']};var _0x356a6b={'tls':{'rejectUnauthorized':![]}};if(_0x55c1bb[_0x31dc('0x19b')][_0x31dc('0x19c')]){_0x356a6b[_0x31dc('0x19c')]=_0x55c1bb[_0x31dc('0x19b')]['service'];}else{_0x356a6b[_0x31dc('0x19d')]=_0x55c1bb[_0x31dc('0x19b')][_0x31dc('0x19d')];_0x356a6b[_0x31dc('0x19e')]=_0x55c1bb['Smtp']['port'];_0x356a6b[_0x31dc('0x19f')]=_0x55c1bb[_0x31dc('0x19b')][_0x31dc('0x19f')];}if(_0x55c1bb[_0x31dc('0x19b')][_0x31dc('0x1a0')]){_0x356a6b[_0x31dc('0x1a1')]={'user':_0x55c1bb[_0x31dc('0x19b')]['user'],'pass':_0x55c1bb[_0x31dc('0x19b')][_0x31dc('0x1a2')]};}if(this[_0x31dc('0x85')](_0x5c11f1[_0x31dc('0x1a3')])){}logger[_0x31dc('0xd9')](_0x31dc('0x1a4'),JSON[_0x31dc('0x72')](_0x1c630c));this['createSquareDetailsReport'][_0x31dc('0xa3')](this,_0x5c11f1,_0x5c11f1[_0x31dc('0x194')]);this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x1a5'),_0x55c1bb['name']));this[_0x31dc('0x20')]['sync'](this,_0x356a6b,_0x1c630c);return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x1a6'));};AGIVertices['prototype'][_0x31dc('0x1a7')]=function(_0x2084c1){logger['info'](util['format'](_0x31dc('0x1a8'),_0x2084c1[_0x31dc('0x37')]));return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x1a9'));};AGIVertices['prototype'][_0x31dc('0x1aa')]=function(_0x49026f){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x1ab'),_0x49026f['label']));if(!this[_0x31dc('0x85')](_0x49026f[_0x31dc('0x1ac')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')]('no\x20sms\x20account\x20configured');}var _0x5c134b=this['getSmsAccount'][_0x31dc('0xa3')](this,_0x49026f[_0x31dc('0x1ac')]);if(!_0x5c134b){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x49026f,_0x31dc('0x1ad'));}var _0x1585d8={'body':_0x49026f[_0x31dc('0x1ae')],'phone':_0x49026f['to']||'','SmsAccountId':_0x5c134b['id']};logger[_0x31dc('0xd9')](_0x31dc('0x1af'),JSON['stringify'](_0x1585d8));this['createSquareDetailsReport'][_0x31dc('0xa3')](this,_0x49026f,_0x49026f[_0x31dc('0x1ac')]);this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5c134b[_0x31dc('0x15')]));this[_0x31dc('0x35')][_0x31dc('0xa3')](this,_0x1585d8);return this[_0x31dc('0xc')]['noop'](_0x31dc('0x1b0'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1b1')]=function(_0xad78f8){logger['info'](util[_0x31dc('0x26')]('Enter\x20in\x20SET\x20(%s)\x20block',_0xad78f8[_0x31dc('0x37')]));if(!this['isConfigured'](_0xad78f8[_0x31dc('0xd3')])){return this['channel'][_0x31dc('0x2a')](_0xad78f8,_0x31dc('0x1b2'));}var _0x53b7d9=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0xad78f8[_0x31dc('0xd3')]);if(!_0x53b7d9){return this['channel'][_0x31dc('0x2a')](_0xad78f8,_0x31dc('0x117'));}return this[_0x31dc('0xc')]['setVariable'](_0x53b7d9,_0xad78f8['variable_value']);};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1b3')]=function(_0x216e79){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')]('Enter\x20in\x20START\x20(%s)\x20block',_0x216e79['label']));this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x1b4'));if(_0x216e79[_0x31dc('0xb4')]==='yes'){this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0x1b5'));return this[_0x31dc('0xc')][_0x31dc('0xb4')]();}return this['channel'][_0x31dc('0xa8')](_0x31dc('0x1b6'));};AGIVertices[_0x31dc('0xf')]['subproject']=function(_0x2ca834){logger[_0x31dc('0x2c')](util['format'](_0x31dc('0x1b7'),_0x2ca834[_0x31dc('0x37')]));if(!this['isConfigured'](_0x2ca834[_0x31dc('0x1b8')])){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x2ca834,'no\x20subproject\x20selected');}var _0x8ddd53=this[_0x31dc('0x1b9')][_0x31dc('0xa3')](this,_0x2ca834[_0x31dc('0x1b8')]);if(!this[_0x31dc('0x85')](_0x8ddd53)){return this['channel']['error'](_0x2ca834,util[_0x31dc('0x26')](_0x31dc('0x1ba'),_0x2ca834[_0x31dc('0x1b8')]));}if(_0x8ddd53===this[_0x31dc('0xc')][_0x31dc('0x39')]){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x2ca834,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x2ca834,_0x8ddd53);var _0x578dd8=this['channel'][_0x31dc('0x58')]('AGI',util[_0x31dc('0x26')](_0x31dc('0x1bb'),config[_0x31dc('0xb2')][_0x31dc('0x19d')]||_0x31dc('0x1bc'),_0x8ddd53,this[_0x31dc('0xc')]['arg_1']));if(_0x578dd8['result']===-0x1){return _0x578dd8;}return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x173'),_0x31dc('0x1bd'),_0x8ddd53));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1be')]=function(_0x518a0b){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x1bf'),_0x518a0b[_0x31dc('0x37')]));var _0x11445c=this[_0x31dc('0x57')]['sync'](this,_0x518a0b[_0x31dc('0x1c0')]);this[_0x31dc('0x36')][_0x31dc('0xa3')](this,_0x518a0b,_0x518a0b['command']);if(this[_0x31dc('0x85')](_0x518a0b[_0x31dc('0xd3')])){var _0x30f722=this[_0x31dc('0x10')][_0x31dc('0xa3')](this,_0x518a0b[_0x31dc('0xd3')]);if(_0x30f722){this[_0x31dc('0xc')][_0x31dc('0x9e')](_0x30f722,_0x11445c);return this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x518a0b[_0x31dc('0x1c0')],_0x30f722));}}return this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x1c1'),_0x518a0b['command']));};AGIVertices['prototype'][_0x31dc('0x1c2')]=function(_0x2bfc01){logger['info'](util['format'](_0x31dc('0x1c3'),_0x2bfc01[_0x31dc('0x37')]));_0x2bfc01[_0x31dc('0x5d')]=_0x2bfc01['text'][_0x31dc('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x31dc('0x85')](_0x2bfc01[_0x31dc('0x5c')])){return this['channel'][_0x31dc('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0x31dc('0x85')](_0x2bfc01[_0x31dc('0x5d')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xa6'));}this[_0x31dc('0xc')][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x1c4'),_0x2bfc01['text']));var _0x52bc0a=this[_0x31dc('0x5b')][_0x31dc('0xa3')](this,_0x2bfc01);if(_0x52bc0a){this[_0x31dc('0xc')]['noop'](util['format'](_0x31dc('0x1c5'),_0x52bc0a));var _0x301c50=this[_0x31dc('0xc')][_0x31dc('0x155')](_0x52bc0a);try{fs['unlink'](_0x52bc0a+'.wav');}catch(_0x3d579e){logger[_0x31dc('0x2a')](_0x3d579e);}return _0x301c50;}return this['channel'][_0x31dc('0x2a')](_0x2bfc01,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1c6')]=function(_0xcd3c11){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x1c7'),_0xcd3c11[_0x31dc('0x37')]));_0xcd3c11[_0x31dc('0x5d')]=_0xcd3c11['text'][_0x31dc('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x31dc('0x85')](_0xcd3c11[_0x31dc('0x5d')])){return this[_0x31dc('0xc')][_0x31dc('0xa8')](_0x31dc('0xa6'));}this[_0x31dc('0xc')]['noop'](util[_0x31dc('0x26')]('Trying\x20Google\x20TTS\x20%s',_0xcd3c11[_0x31dc('0x5d')]));var _0x508ab3=this['googleTTS'][_0x31dc('0xa3')](this,_0xcd3c11);if(_0x508ab3){this[_0x31dc('0xc')][_0x31dc('0xa8')](util['format'](_0x31dc('0x1c8'),_0x508ab3));var _0xb607bf=this[_0x31dc('0xc')][_0x31dc('0x155')](_0x508ab3);try{fs['unlink'](_0x508ab3+_0x31dc('0xfe'));}catch(_0x27f5c4){logger[_0x31dc('0x2a')](_0x27f5c4);}return _0xb607bf;}return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0xcd3c11,_0x31dc('0x1c9'));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1ca')]=function(_0x14caf6){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x1cb'),_0x14caf6['label']));if(!this[_0x31dc('0x85')](_0x14caf6[_0x31dc('0x15b')])){return this['channel']['error'](_0x14caf6,_0x31dc('0x159'));}logger['info'](util['format'](_0x31dc('0x15a'),this['channel']['callerid'],_0x14caf6[_0x31dc('0x15b')]));var _0x3eb4a0=this['agentUnpause'][_0x31dc('0xa3')](this,_0x14caf6[_0x31dc('0x15b')]);if(_0x3eb4a0){logger['info'](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x14caf6[_0x31dc('0x15b')]));this['channel'][_0x31dc('0xa8')](util[_0x31dc('0x26')](_0x31dc('0x15c'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x14caf6[_0x31dc('0x15b')]));return{'code':0xc8,'result':_0x31dc('0x15d')};}else{logger['info'](util[_0x31dc('0x26')](_0x31dc('0x15e'),this[_0x31dc('0xc')][_0x31dc('0x3a')],_0x14caf6['findBy']));this[_0x31dc('0xc')]['noop'](util[_0x31dc('0x26')](_0x31dc('0x15e'),this['channel'][_0x31dc('0x3a')],_0x14caf6[_0x31dc('0x15b')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x31dc('0xf')]['voicemail']=function(_0x2b1d23){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')](_0x31dc('0x1cc'),_0x2b1d23[_0x31dc('0x37')]));var _0x1a64e3=this[_0x31dc('0xc')][_0x31dc('0x58')]('VOICEMAIL',[_0x2b1d23['mailbox'],_0x2b1d23[_0x31dc('0x78')]]);if(_0x1a64e3['result']===-0x1){return _0x1a64e3;}return this[_0x31dc('0xc')]['noop'](util[_0x31dc('0x26')]('Executed\x20command\x20%s\x20%s',_0x31dc('0x1cd'),_0x2b1d23[_0x31dc('0x1ce')]));};AGIVertices[_0x31dc('0xf')][_0x31dc('0x1cf')]=function(_0x29776f){logger[_0x31dc('0x2c')](util[_0x31dc('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x29776f[_0x31dc('0x37')]));if(!this[_0x31dc('0x85')](_0x29776f['variable_id'])){return this[_0x31dc('0xc')]['error'](_0x29776f,_0x31dc('0x1b2'));}var _0x1d081a=this[_0x31dc('0x10')]['sync'](this,_0x29776f[_0x31dc('0xd3')]);if(!_0x1d081a){return this[_0x31dc('0xc')][_0x31dc('0x2a')](_0x29776f,_0x31dc('0x117'));}var _0xc99680=this[_0x31dc('0xc')][_0x31dc('0x10')](_0x1d081a);return{'code':0xc8,'result':_0xc99680['extra']?_0xc99680[_0x31dc('0xa2')]:'-'};};String[_0x31dc('0xf')][_0x31dc('0x1d0')]=function(_0x3c5dcf,_0x21400a){return this[_0x31dc('0x1d1')](_0x3c5dcf)[_0x31dc('0x1d2')](_0x21400a);};module[_0x31dc('0x1d3')]=AGIVertices; \ No newline at end of file +var _0xd89b=['SIP/%s/%s','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','maxRetry','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appsecret\x20configured','wav','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','condition','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','operation','no\x20operation\x20configured','no\x20file\x20audio\x20selected','response','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sendSMS\x20message','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundPath','save_name','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','error','agentLogout','internal','format','%s/%s@from-sip/n','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','parse','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','includes','clone','hasOwnProperty','recursiveNodeIndex','isPlainObject','isArray','length','isString','isEmpty','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','result','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','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','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','out','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name'];(function(_0x246226,_0xf5445d){var _0x1fa957=function(_0x18df03){while(--_0x18df03){_0x246226['push'](_0x246226['shift']());}};_0x1fa957(++_0xf5445d);}(_0xd89b,0xca));var _0xbd89=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd89b[_0x4fde08];return _0x12e725;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xbd89('0x0'));var _=require(_0xbd89('0x1'));var sh=require(_0xbd89('0x2'));var odbc=require(_0xbd89('0x3'))();var rs=require(_0xbd89('0x4'));var moment=require(_0xbd89('0x5'));var Mustache=require(_0xbd89('0x6'));var rp=require(_0xbd89('0x7'));var logger=require(_0xbd89('0x8'))('agi');var config=require(_0xbd89('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xbd89('0xa')];var verticesWithRetry=[_0xbd89('0xb'),_0xbd89('0xc'),_0xbd89('0xd')];var AGIVertices=function(_0x4572e3,_0x50345b,_0x30990b){this[_0xbd89('0xe')]=_0x4572e3;this['rpc']=_0x50345b;this[_0xbd89('0xf')]=_0x30990b;};AGIVertices[_0xbd89('0x10')][_0xbd89('0x11')]=function(_0x49f7b2,_0x498924){this[_0xbd89('0x12')][_0xbd89('0x13')](_0x49f7b2)[_0xbd89('0x14')](function(_0x265162){_0x498924(null,_0x265162?_0x265162[_0xbd89('0x15')]:![]);})['catch'](function(_0x1ac068){_0x498924(_0x1ac068);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x16')]=function(_0x1eda1a,_0x2e3c1f){this['rpc'][_0xbd89('0x17')](_0x1eda1a)['then'](function(_0x3ad344){_0x2e3c1f(null,_0x3ad344?_0x3ad344[_0xbd89('0x15')]:![]);})[_0xbd89('0x18')](function(_0x1a6b59){_0x2e3c1f(_0x1a6b59);});};AGIVertices[_0xbd89('0x10')]['getSquareProject']=function(_0x1f857e,_0x3f2ed2){this[_0xbd89('0x12')][_0xbd89('0x19')](_0x1f857e)[_0xbd89('0x14')](function(_0x2e0c7a){_0x3f2ed2(null,_0x2e0c7a?_0x2e0c7a['name']:![]);})[_0xbd89('0x18')](function(_0xd691be){_0x3f2ed2(_0xd691be);});};AGIVertices[_0xbd89('0x10')]['getSquareOdbc']=function(_0x5814ca,_0x237e3b){this['rpc'][_0xbd89('0x1a')](_0x5814ca)[_0xbd89('0x14')](function(_0x2af25e){_0x237e3b(null,_0x2af25e?_0x2af25e['dsn']:![]);})[_0xbd89('0x18')](function(_0x507fee){_0x237e3b(_0x507fee);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1b')]=function(_0x314bf3,_0x2f9a1e){this['rpc'][_0xbd89('0x1c')](_0x314bf3)['then'](function(_0x4f5323){_0x2f9a1e(null,_0x4f5323?_0x4f5323['name']:![]);})[_0xbd89('0x18')](function(_0x1a23a0){_0x2f9a1e(_0x1a23a0);});};AGIVertices['prototype'][_0xbd89('0x1d')]=function(_0x1ccebf,_0x4bd1a9){this[_0xbd89('0x12')]['getTrunkById'](_0x1ccebf)[_0xbd89('0x14')](function(_0x162eca){_0x4bd1a9(null,_0x162eca?_0x162eca['name']:![]);})['catch'](function(_0x3b151a){_0x4bd1a9(_0x3b151a);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1e')]=function(_0x129f07,_0x12845d){var _0x3fca6a=this;this[_0xbd89('0x12')]['getSoundById'](_0x129f07)[_0xbd89('0x14')](function(_0x5afaeb){_0x12845d(null,_0x5afaeb?_0x3fca6a[_0xbd89('0x1f')](_0x5afaeb[_0xbd89('0x20')]):![]);})[_0xbd89('0x18')](function(_0x1aec91){_0x12845d(_0x1aec91);});};AGIVertices[_0xbd89('0x10')]['getMailAccount']=function(_0xc44f28,_0x2f70dc){this[_0xbd89('0x12')]['getMailAccountById'](_0xc44f28)[_0xbd89('0x14')](function(_0x142f65){_0x2f70dc(null,_0x142f65?_0x142f65:![]);})[_0xbd89('0x18')](function(_0x5b091a){_0x2f70dc(_0x5b091a);});};AGIVertices['prototype'][_0xbd89('0x21')]=function(_0x539507,_0x2fdaed,_0x3aec27){this[_0xbd89('0xf')][_0xbd89('0x21')](_0x539507,_0x2fdaed)[_0xbd89('0x14')](function(){_0x3aec27(null);})[_0xbd89('0x18')](function(_0x3dbdca){_0x3aec27(_0x3dbdca);});};AGIVertices[_0xbd89('0x10')]['getIntervals']=function(_0x4609c7,_0x30258a){this[_0xbd89('0x12')][_0xbd89('0x22')](_0x4609c7)[_0xbd89('0x14')](function(_0x1546d){if(_0x1546d){if(_0x1546d[_0xbd89('0x23')]){_0x30258a(null,[_0x1546d[_0xbd89('0x24')]]);}else{_0x30258a(null,_['map'](_0x1546d[_0xbd89('0x25')],_0xbd89('0x24')));}}else{_0x30258a(null,![]);}})[_0xbd89('0x18')](function(_0x455035){_0x30258a(_0x455035);});};AGIVertices[_0xbd89('0x10')]['getSoundPath']=function(_0x7d3f22){return util['format'](_0xbd89('0x26'),FILES_PATH,_0x7d3f22);};AGIVertices[_0xbd89('0x10')][_0xbd89('0x27')]=function(_0x1517d4,_0x4d83ee,_0x549135){odbc[_0xbd89('0x28')](_0x1517d4,function(_0x550cb4){if(_0x550cb4){logger['error'](_0xbd89('0x29'),_0x550cb4);_0x549135(_0x550cb4);}else{logger[_0xbd89('0x2a')]('ODBC\x20connection\x20successfully');odbc['query'](_0x4d83ee,function(_0x5129f2,_0x356ede){if(_0x5129f2){logger['info'](_0xbd89('0x2b'),_0x4d83ee);_0x549135(_0x5129f2);}else{logger[_0xbd89('0x2a')](_0xbd89('0x2c'),_0x4d83ee);odbc[_0xbd89('0x2d')](function(_0x3b47b7){if(_0x3b47b7){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3b47b7);}_0x549135(null,_0x356ede);});}});}});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x2e')]=function(_0x2f64ab,_0x48ced3){this[_0xbd89('0x12')][_0xbd89('0x2f')](_0x2f64ab)[_0xbd89('0x14')](function(_0x311d7b){_0x48ced3(null,_0x311d7b?_0x311d7b:![]);})[_0xbd89('0x18')](function(_0x3fa989){_0x48ced3(_0x3fa989);});};AGIVertices[_0xbd89('0x10')]['createSmsMessage']=function(_0x3f7ff1,_0x37a691){this[_0xbd89('0x12')][_0xbd89('0x30')](_0x3f7ff1)[_0xbd89('0x14')](function(_0x55782b){_0x37a691(null,_0x55782b);})[_0xbd89('0x18')](function(_0x262a4b){_0x37a691(_0x262a4b);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x31')]=function(_0x2556b7,_0x4a6e05,_0x29d86d){this[_0xbd89('0x12')]['createSquareDetailsReport']({'uniqueid':this[_0xbd89('0xe')][_0xbd89('0x32')],'node':_0x2556b7[_0xbd89('0x33')],'application':_0x2556b7[_0xbd89('0x34')],'data':_0x4a6e05||null,'project_name':this[_0xbd89('0xe')][_0xbd89('0x35')],'callerid':this[_0xbd89('0xe')][_0xbd89('0x36')]})[_0xbd89('0x14')](function(_0x5d8c8a){if(_0x29d86d){_0x29d86d(null,_0x5d8c8a);}})[_0xbd89('0x18')](function(_0x484ab1){if(_0x29d86d){_0x29d86d(_0x484ab1);}});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x37')]=function(_0x4202d4,_0x441fb5,_0x471658,_0x52d3f9){this[_0xbd89('0x12')][_0xbd89('0x37')]({'uniqueid':this[_0xbd89('0xe')]['uniqueid'],'callerid':this[_0xbd89('0xe')]['callerid'],'calleridname':this[_0xbd89('0xe')]['calleridname'],'context':this[_0xbd89('0xe')][_0xbd89('0x38')],'extension':this[_0xbd89('0xe')][_0xbd89('0x39')],'priority':this['channel']['priority'],'accountcode':this[_0xbd89('0xe')][_0xbd89('0x3a')],'dnid':this[_0xbd89('0xe')][_0xbd89('0x3b')],'projectName':this[_0xbd89('0xe')][_0xbd89('0x35')],'saveName':_0x441fb5,'filename':_0x4202d4[_0xbd89('0x3c')]||_0x441fb5,'savePath':_0x471658})[_0xbd89('0x14')](function(_0x27437a){_0x52d3f9(null,_0x27437a);})[_0xbd89('0x18')](function(_0x59232c){_0x52d3f9(_0x59232c);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x3d')]=function(_0x188ce2,_0x12db74,_0x5ad20f,_0x160be9,_0x23c6d3){this['rpc'][_0xbd89('0x3d')]({'uniqueid':this[_0xbd89('0xe')][_0xbd89('0x32')],'body':_0x188ce2,'direction':_0x12db74,'providerName':_0x5ad20f,'providerResponse':_0x160be9})[_0xbd89('0x14')](function(_0x332938){if(_0x23c6d3){_0x23c6d3(null,_0x332938);}})['catch'](function(_0x5a0a2b){if(_0x23c6d3){_0x23c6d3(_0x5a0a2b);}});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x3e')]=function(_0x3e9705,_0x41baa8){this[_0xbd89('0x12')][_0xbd89('0x3e')]({'firstName':_['isEmpty'](_0x3e9705[_0xbd89('0x15')])||_[_0xbd89('0x3f')](_0x3e9705[_0xbd89('0x15')])?_0xbd89('0x40')+Math[_0xbd89('0x41')]():_0x3e9705['name'],'lastName':_['isEmpty'](_0x3e9705[_0xbd89('0x42')])||_[_0xbd89('0x3f')](_0x3e9705['lastName'])?null:_0x3e9705['lastName'],'phone':_0x3e9705['phone'],'ListId':_0x3e9705[_0xbd89('0x43')],'scheduledat':_0x3e9705[_0xbd89('0x44')],'callbackUniqueid':this[_0xbd89('0xe')][_0xbd89('0x32')],'tags':'callback','description':_0xbd89('0x45')+_0x3e9705[_0xbd89('0x44')][_0xbd89('0x46')](),'priority':_0x3e9705[_0xbd89('0x47')]})[_0xbd89('0x14')](function(_0x1a9b27){_0x41baa8(null,_0x1a9b27);})[_0xbd89('0x18')](function(_0x1b570a){_0x41baa8(_0x1b570a);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x48')]=function(_0x39d5ae,_0x579dae){this[_0xbd89('0x12')][_0xbd89('0x49')](_0x39d5ae)[_0xbd89('0x14')](function(_0x4426c9){_0x579dae(null,_0x4426c9?_0x4426c9[_0xbd89('0x15')]:![]);})[_0xbd89('0x18')](function(_0x4e0821){_0x579dae(_0x4e0821);});};AGIVertices[_0xbd89('0x10')]['agentPause']=function(_0x36da52,_0x5ebb26,_0x18ed07){var _0x4459f1={'role':_0xbd89('0x4a')};_0x4459f1[_0x36da52]=this[_0xbd89('0xe')][_0xbd89('0x36')];this[_0xbd89('0x12')]['agentPause'](_0x4459f1,_0x5ebb26,this[_0xbd89('0xe')][_0xbd89('0x32')])['then'](function(_0x47012f){_0x18ed07(null,_[_0xbd89('0x3f')](_0x47012f)?![]:!![]);})[_0xbd89('0x18')](function(_0x3d4a7c){logger['error'](_0x3d4a7c);_0x18ed07(null,![]);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x4b')]=function(_0x245242,_0x5906bd){var _0x30eec1={'role':'agent'};_0x30eec1[_0x245242]=this[_0xbd89('0xe')][_0xbd89('0x36')];this[_0xbd89('0x12')][_0xbd89('0x4b')](_0x30eec1)[_0xbd89('0x14')](function(_0x3f30b8){_0x5906bd(null,_[_0xbd89('0x3f')](_0x3f30b8)?![]:!![]);})[_0xbd89('0x18')](function(_0x367b03){logger[_0xbd89('0x4c')](_0x367b03);_0x5906bd(null,![]);});};AGIVertices[_0xbd89('0x10')]['agentLogout']=function(_0x1e4c97,_0x9dbc25){var _0x130263={'role':'agent'};_0x130263[_0x1e4c97]=this['channel'][_0xbd89('0x36')];this[_0xbd89('0x12')][_0xbd89('0x4d')](_0x130263)[_0xbd89('0x14')](function(_0x5e2894){_0x9dbc25(null,_[_0xbd89('0x3f')](_0x5e2894)?![]:!![]);})['catch'](function(_0x482b4a){logger['error'](_0x482b4a);_0x9dbc25(null,![]);});};AGIVertices[_0xbd89('0x10')]['agentLogin']=function(_0x2a58d2,_0x36574d){var _0x5c3bfb={'role':_0xbd89('0x4a')};_0x5c3bfb[_0x2a58d2]=this[_0xbd89('0xe')][_0xbd89('0x36')];var _0x4d7a19=_0x2a58d2!=_0xbd89('0x4e')?util[_0xbd89('0x4f')](_0xbd89('0x50'),'LOCAL',this[_0xbd89('0xe')]['callerid']):undefined;this[_0xbd89('0x12')]['agentLogin'](_0x5c3bfb,_0x4d7a19)[_0xbd89('0x14')](function(_0x1d7e1a){_0x36574d(null,_['isNil'](_0x1d7e1a)?![]:!![]);})[_0xbd89('0x18')](function(_0x2204a0){logger[_0xbd89('0x4c')](_0x2204a0);_0x36574d(null,![]);});};AGIVertices[_0xbd89('0x10')]['shellCommand']=function(_0x37e98f,_0x2f1fec){sh[_0xbd89('0x51')](_[_0xbd89('0x52')](_0x37e98f),function(_0x408000,_0x4ed2ab){var _0x104d24=_0x4ed2ab['replace'](/(\r\n|\n|\r)/gm,'');_0x2f1fec(null,_0x104d24);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x53')]=function(_0x5c5438,_0x4b4b72){scripts['googleCloudTTS'](_0x5c5438[_0xbd89('0x54')],_0x5c5438[_0xbd89('0x55')]||_0xbd89('0x56'),_0x5c5438[_0xbd89('0x56')],_0x5c5438[_0xbd89('0x57')]||'en-US',_0x5c5438[_0xbd89('0x58')]||'MALE',_0x5c5438[_0xbd89('0x59')]||'MP3')['then'](function(_0x4aa35b){_0x4b4b72(null,_0x4aa35b);})[_0xbd89('0x18')](function(_0x5d5dcc){_0x4b4b72(_0x5d5dcc);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x5a')]=function(_0x3385f9,_0x37c503){scripts[_0xbd89('0x5a')](_0x3385f9[_0xbd89('0x56')],_0x3385f9[_0xbd89('0x5b')]||'en',0x1)[_0xbd89('0x14')](function(_0x3c53ca){_0x37c503(null,_0x3c53ca);})[_0xbd89('0x18')](function(_0x1a0279){_0x37c503(_0x1a0279);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x5c')]=function(_0x3e8e49,_0xbdf2ff){var _0x262e32={'uri':_0x3e8e49[_0xbd89('0x5d')],'method':_0x3e8e49[_0xbd89('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3e8e49[_0xbd89('0x5f')])===_0xbd89('0x60')&&parseInt(_0x3e8e49[_0xbd89('0x5f')])>=0x1?parseInt(_0x3e8e49[_0xbd89('0x5f')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0xbd89('0x61')],_0x262e32[_0xbd89('0x5e')][_0xbd89('0x62')]())){try{_0x262e32[_0xbd89('0x63')]=_0x3e8e49[_0xbd89('0xa')]?JSON['parse'](_0x3e8e49[_0xbd89('0xa')]):{};}catch(_0x4b81d4){logger[_0xbd89('0x4c')](_0xbd89('0x64'),_0x4b81d4);}}try{_0x262e32['headers']=_0x3e8e49[_0xbd89('0x65')]?JSON['parse'](_0x3e8e49[_0xbd89('0x65')]):{};}catch(_0x2f6f4d){logger['error'](_0xbd89('0x66'),_0x2f6f4d);}if(_0x3e8e49[_0xbd89('0x67')]){try{var _0x1414c4=require(_0x3e8e49[_0xbd89('0x67')])[_0xbd89('0x68')](this,_0x262e32);_0x262e32[_0xbd89('0x69')]=Mustache['render'](_0x3e8e49[_0xbd89('0x5d')],_0x1414c4,{},['$$','$$']);if(_0x262e32[_0xbd89('0x6a')]){_0x262e32[_0xbd89('0x6a')]=JSON[_0xbd89('0x6b')](Mustache[_0xbd89('0x6c')](JSON[_0xbd89('0x6d')](_0x262e32[_0xbd89('0x6a')]),_0x1414c4,{},['$$','$$']));}if(_0x262e32[_0xbd89('0x63')]){_0x262e32[_0xbd89('0x63')]=JSON[_0xbd89('0x6b')](Mustache[_0xbd89('0x6c')](JSON['stringify'](_0x262e32['body']),_0x1414c4,{},['$$','$$']));}}catch(_0x4c63fe){logger['error'](_0xbd89('0x6e'),_0x4c63fe);}}rp(_0x262e32)['then'](function(_0x1cf5e7){var _0x47002c={'statusCode':_0x1cf5e7['statusCode']||0xc8,'statusMessage':_0x1cf5e7[_0xbd89('0x6f')]||'OK','headers':_0x1cf5e7['headers']||{},'body':_0x1cf5e7['body']||{}};_0xbdf2ff(null,_0x47002c);})[_0xbd89('0x18')](function(_0x12b6a5){var _0x45a667={'statusCode':_0x12b6a5['statusCode']||0x1f4,'statusMessage':_0x12b6a5[_0xbd89('0x70')]||_0xbd89('0x71'),'headers':_0x12b6a5[_0xbd89('0x72')][_0xbd89('0x6a')]||{},'body':_0x12b6a5['options']['body']||{}};_0xbdf2ff(null,_0x45a667);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x73')]=function(_0x2b6cb2,_0x297b50){scripts[_0xbd89('0x73')](this[_0xbd89('0xe')]['uniqueid'],_0x2b6cb2[_0xbd89('0x74')],_0x2b6cb2['text'],_0x2b6cb2[_0xbd89('0x75')]||'en')[_0xbd89('0x14')](function(_0x59f108){_0x297b50(null,_0x59f108);})[_0xbd89('0x18')](function(_0x451a1f){_0x297b50(_0x451a1f);});};AGIVertices['prototype'][_0xbd89('0x76')]=function(_0x5e5ae7,_0x14c86b){scripts['googleDialogflowV2'](this[_0xbd89('0xe')][_0xbd89('0x32')],_0x5e5ae7[_0xbd89('0x77')],_0x5e5ae7[_0xbd89('0x78')],_0x5e5ae7[_0xbd89('0x79')],_0x5e5ae7['text'],_0x5e5ae7['dialogflowV2_language']||'en')[_0xbd89('0x14')](function(_0x2f5521){_0x14c86b(null,_0x2f5521);})[_0xbd89('0x18')](function(_0xc450f2){_0x14c86b(_0xc450f2);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x7a')]=function(_0x9d3b7c,_0x17b20f){scripts[_0xbd89('0x7a')](this[_0xbd89('0xe')],_0x9d3b7c)['then'](function(_0x211773){_0x17b20f(null,_0x211773);})['catch'](function(_0x211af7){_0x17b20f(_0x211af7);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x7b')]=function(_0x169a0,_0x173cb5){scripts[_0xbd89('0x7b')](_0x169a0[_0xbd89('0x74')],_0x169a0[_0xbd89('0x56')],_0x169a0[_0xbd89('0x7c')]||_0xbd89('0x7d'),_0x169a0[_0xbd89('0x7e')])['then'](function(_0x45968f){_0x173cb5(null,_0x45968f);})[_0xbd89('0x18')](function(_0xdac3e0){_0x173cb5(_0xdac3e0);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x7f')]=function(_0x3621da,_0x118f3d,_0x48e694){scripts[_0xbd89('0x7f')](_0x118f3d,_0x3621da[_0xbd89('0x74')],_0x3621da[_0xbd89('0x80')]||_0xbd89('0x7d'),this[_0xbd89('0x81')](_0x3621da['model'])?_0x3621da[_0xbd89('0x82')]:undefined)[_0xbd89('0x14')](function(_0xbf0c6e){_0x48e694(null,_0xbf0c6e);})[_0xbd89('0x18')](function(_0x2dc4e7){_0x48e694(_0x2dc4e7);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x83')]=function(_0x4e0def,_0x2141fb){scripts[_0xbd89('0x83')](_0x4e0def['aws_access_key_id'],_0x4e0def[_0xbd89('0x84')],_0x4e0def[_0xbd89('0x85')],_0x4e0def[_0xbd89('0x86')]||'Amy',_0x4e0def[_0xbd89('0x56')],_0x4e0def['aws_text_type']||'text')[_0xbd89('0x14')](function(_0xec0686){_0x2141fb(null,_0xec0686);})['catch'](function(_0x457bb4){_0x2141fb(_0x457bb4);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x87')]=function(_0x223a9,_0xe33d63){scripts[_0xbd89('0x87')](this[_0xbd89('0xe')][_0xbd89('0x32')],_0x223a9[_0xbd89('0x88')],_0x223a9[_0xbd89('0x84')],_0x223a9[_0xbd89('0x89')],_0x223a9[_0xbd89('0x56')],_0x223a9[_0xbd89('0x8a')])['then'](function(_0x48ca15){_0xe33d63(null,_0x48ca15);})[_0xbd89('0x18')](function(_0x23319f){_0xe33d63(_0x23319f);});};AGIVertices['prototype'][_0xbd89('0x8b')]=function(_0x1ebfd1,_0x3f504e,_0x33cdd6){scripts[_0xbd89('0x8b')](_0x3f504e,_0x1ebfd1[_0xbd89('0x74')],_0x1ebfd1[_0xbd89('0x8c')]||_0xbd89('0x7d'))[_0xbd89('0x14')](function(_0x49e33e){_0x33cdd6(null,_0x49e33e);})[_0xbd89('0x18')](function(_0x3b75b1){_0x33cdd6(_0x3b75b1);});};AGIVertices[_0xbd89('0x10')][_0xbd89('0x8d')]=function(_0xfda6c1,_0x5d44d8,_0x340418){scripts[_0xbd89('0x8d')](_0x5d44d8,_0xfda6c1['appid'],_0xfda6c1[_0xbd89('0x8e')],_0xfda6c1['uri'])['then'](function(_0x5aee5d){_0x340418(null,_0x5aee5d);})[_0xbd89('0x18')](function(_0x3f50b7){_0x340418(_0x3f50b7);});};AGIVertices['prototype']['clear']=function(_0xb0680d){var _0x1b7cba=_[_0xbd89('0x8f')](verticesWithRetry,_0xb0680d[_0xbd89('0x34')])?_0xb0680d:_[_0xbd89('0x90')](_0xb0680d);for(var _0x350b43 in _0x1b7cba){if(_0x1b7cba[_0xbd89('0x91')](_0x350b43)){if(_0x1b7cba[_0x350b43]&&_['isString'](_0x1b7cba[_0x350b43])){if(_[_0xbd89('0x8f')](recursiveMapAttributes,_0x350b43)){_0x1b7cba[_0x350b43]=this['replaceObjectAllVariables'](_0x1b7cba[_0x350b43]);}else{_0x1b7cba[_0x350b43]=this['replaceAllVariables'](_0x1b7cba[_0x350b43]);}}}}return _0x1b7cba;};AGIVertices[_0xbd89('0x10')][_0xbd89('0x92')]=function(_0x1662d4){for(var _0x2cc6ee in _0x1662d4){if(_0x1662d4[_0xbd89('0x91')](_0x2cc6ee)){if(_[_0xbd89('0x93')](_0x1662d4[_0x2cc6ee])){this['recursiveNodeIndex'](_0x1662d4[_0x2cc6ee]);}else if(_[_0xbd89('0x94')](_0x1662d4[_0x2cc6ee])){for(var _0x4eb512=0x0;_0x4eb512<_0x1662d4[_0x2cc6ee][_0xbd89('0x95')];_0x4eb512++){this[_0xbd89('0x92')](_0x1662d4[_0x2cc6ee][_0x4eb512]);}}else if(_[_0xbd89('0x96')](_0x1662d4[_0x2cc6ee])){_0x1662d4[_0x2cc6ee]=this['replaceAllVariables'](_0x1662d4[_0x2cc6ee]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x16c1cc,_0x2b8e47){for(var _0x27c950 in _0x16c1cc){if(_0x16c1cc[_0xbd89('0x91')](_0x27c950)){if(_['isPlainObject'](_0x16c1cc[_0x27c950])){if(!_[_0xbd89('0x97')](_0x16c1cc[_0x27c950])){this[_0xbd89('0x98')](_0x16c1cc[_0x27c950],util[_0xbd89('0x4f')]('%s.%s',_0x2b8e47,_0x27c950));}}else if(_[_0xbd89('0x94')](_0x16c1cc[_0x27c950])){for(var _0x5d006c=0x0;_0x5d006c<_0x16c1cc[_0x27c950][_0xbd89('0x95')];_0x5d006c++){this[_0xbd89('0x98')](_0x16c1cc[_0x27c950][_0x5d006c],util[_0xbd89('0x4f')](_0xbd89('0x99'),_0x2b8e47,_0x27c950+'['+_0x5d006c+']'));}}else{if(!_[_0xbd89('0x3f')](_0x16c1cc[_0x27c950])){this[_0xbd89('0xe')][_0xbd89('0x9a')](util['format'](_0xbd89('0x99'),_0x2b8e47,_0x27c950),_0x16c1cc[_0x27c950]);}}}}};AGIVertices[_0xbd89('0x10')]['replaceObjectAllVariables']=function(_0xbf80c2){try{var _0xb8b265=JSON[_0xbd89('0x6b')](_0xbf80c2);this[_0xbd89('0x92')](_0xb8b265);return JSON[_0xbd89('0x6d')](_0xb8b265);}catch(_0x26bc3f){return this[_0xbd89('0x9b')](_0xbf80c2);}};AGIVertices[_0xbd89('0x10')][_0xbd89('0x9b')]=function(_0x4f35d4){var _0x583fda=_0x4f35d4[_0xbd89('0x9c')]('{');for(var _0x53d824=0x1;_0x53d824<_0x583fda['length'];_0x53d824+=0x1){var _0x46b83b=_0x583fda[_0x53d824][_0xbd89('0x9c')]('}');if(_0x46b83b[_0xbd89('0x95')]>0x1){_0x4f35d4=_0x4f35d4[_0xbd89('0x9d')]('{'+_0x46b83b[0x0]+'}',this['channel'][_0xbd89('0x11')](_0x46b83b[0x0])[_0xbd89('0x9e')]||_0x46b83b[0x0]);}}if(_0x583fda['length']===0x1){return _0x4f35d4[_0xbd89('0x46')]();}return this[_0xbd89('0x9b')](_0x4f35d4);};AGIVertices['prototype'][_0xbd89('0x9f')]=function(_0x1636d1,_0x482b23){var _0x1cfd87=this['channel']['getVariable'](_0x1636d1);if(_0x1cfd87[_0xbd89('0xa0')]===-0x1){return _0x1cfd87;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x482b23,_0x1cfd87['extra']));return this['channel'][_0xbd89('0x9a')](_0x482b23,_0x1cfd87[_0xbd89('0x9e')]);};AGIVertices[_0xbd89('0x10')][_0xbd89('0x81')]=function(_0x5a0f1a){return _0x5a0f1a&&_0x5a0f1a!=='0'&&_0x5a0f1a!=='-1'&&_0x5a0f1a!=='';};AGIVertices[_0xbd89('0x10')]['maxRetry']=function(_0x1480ce){this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x1480ce,'-');_0x1480ce[_0xbd89('0xa1')]=_0x1480ce['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbd89('0x10')]['mrcpsynth']=function(_0x234d33){logger['info'](util['format'](_0xbd89('0xa2'),_0x234d33[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x234d33[_0xbd89('0x56')])){return this[_0xbd89('0xe')]['noop'](_0xbd89('0xa3'));}var _0x5bcb17='\x22'+_0x234d33[_0xbd89('0x56')]+'\x22';if(this[_0xbd89('0x81')](_0x234d33[_0xbd89('0x72')])){_0x5bcb17+=','+_0x234d33['options'];}var _0x1aecd6=this[_0xbd89('0xe')][_0xbd89('0x51')](_0xbd89('0xa4'),_0x5bcb17);if(_0x1aecd6[_0xbd89('0xa0')]===-0x1){return _0x1aecd6;}return this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5bcb17));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xa6')]=function(_0x673da3){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0xa7'),_0x673da3['label']));if(!this[_0xbd89('0x81')](_0x673da3[_0xbd89('0xa8')])){return this['channel'][_0xbd89('0xa5')]('no\x20grammar\x20configured');}var _0x452c5a=_0x673da3[_0xbd89('0xa8')];if(this[_0xbd89('0x81')](_0x673da3[_0xbd89('0x72')])){_0x452c5a+=','+_0x673da3['options'];}var _0x7c78c4=this[_0xbd89('0xe')][_0xbd89('0x51')](_0xbd89('0xa9'),_0x452c5a);if(_0x7c78c4['result']===-0x1){return _0x7c78c4;}var _0x46ca84=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xbd89('0xaa'));if(_0x46ca84[_0xbd89('0xa0')]===-0x1){return _0x46ca84;}var _0x470e59=this[_0xbd89('0x9f')]('RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT');if(_0x470e59[_0xbd89('0xa0')]===-0x1){return _0x470e59;}var _0x1e5ac6=this[_0xbd89('0x9f')](_0xbd89('0xab'),_0xbd89('0xac'));if(_0x1e5ac6[_0xbd89('0xa0')]===-0x1){return _0x1e5ac6;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xad'),_0x452c5a));};AGIVertices[_0xbd89('0x10')]['agi']=function(_0x341c31){logger[_0xbd89('0x2a')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x341c31[_0xbd89('0x33')]));return this[_0xbd89('0xe')][_0xbd89('0xae')]([_0x341c31[_0xbd89('0xaf')],_0x341c31[_0xbd89('0xb0')]]);};AGIVertices[_0xbd89('0x10')]['answer']=function(_0x3a7c7a){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0xb1'),_0x3a7c7a[_0xbd89('0x33')]));if(this[_0xbd89('0x81')](_0x3a7c7a[_0xbd89('0x5f')])){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x3a7c7a[_0xbd89('0x5f')]));var _0x4d356a=this[_0xbd89('0xe')][_0xbd89('0xb2')](_0x3a7c7a['timeout']);if(_0x4d356a[_0xbd89('0xa0')]===-0x1){return _0x4d356a;}}return this[_0xbd89('0xe')][_0xbd89('0xb3')]();};AGIVertices[_0xbd89('0x10')]['callback']=function(_0x281cee){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0xb4'),_0x281cee[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x281cee[_0xbd89('0x43')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x281cee,_0xbd89('0xb5'));}_0x281cee['scheduledAt']=moment();if(this[_0xbd89('0x81')](_0x281cee['delay'])){_0x281cee[_0xbd89('0x44')]=moment()[_0xbd89('0xb6')](_0x281cee[_0xbd89('0xb7')],_0xbd89('0xb8'));}if(!this[_0xbd89('0x81')](_0x281cee[_0xbd89('0x47')])){_0x281cee[_0xbd89('0x47')]=0x2;}this['createCmContact'][_0xbd89('0x68')](this,_0x281cee);return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xb9'),_0x281cee[_0xbd89('0xba')],_0x281cee[_0xbd89('0x43')],_0x281cee[_0xbd89('0x44')]));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xbb')]=function(_0x32fb27){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0xbc'),_0x32fb27['label']));var _0x4b8298=this[_0xbd89('0xe')][_0xbd89('0x51')](_0x32fb27['application'],_0x32fb27['options']);if(_0x4b8298[_0xbd89('0xa0')]===-0x1){return _0x4b8298;}return this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xbd'),_0x32fb27[_0xbd89('0xbe')],_0x32fb27[_0xbd89('0x72')]));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xbf')]=function(_0x58d4f0){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x58d4f0[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x58d4f0[_0xbd89('0x56')])){return this[_0xbd89('0xe')]['noop'](_0xbd89('0xa3'));}var _0x5ca58f='\x22'+_0x58d4f0[_0xbd89('0x56')]+'\x22';if(this[_0xbd89('0x81')](_0x58d4f0['options'])){_0x5ca58f+=','+_0x58d4f0[_0xbd89('0x72')];}var _0x1ff4aa=this[_0xbd89('0xe')][_0xbd89('0x51')](_0xbd89('0xa4'),_0x5ca58f);if(_0x1ff4aa[_0xbd89('0xa0')]===-0x1){return _0x1ff4aa;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5ca58f));};AGIVertices[_0xbd89('0x10')]['sestektts']=function(_0x591ff8){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x591ff8[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x591ff8[_0xbd89('0x56')])){return this[_0xbd89('0xe')]['noop'](_0xbd89('0xa3'));}var _0x11d175='\x22'+_0x591ff8[_0xbd89('0x56')]+'\x22';if(this[_0xbd89('0x81')](_0x591ff8['options'])){_0x11d175+=','+_0x591ff8['options'];}var _0x27f7d9=this[_0xbd89('0xe')][_0xbd89('0x51')]('MRCPSynth',_0x11d175);if(_0x27f7d9[_0xbd89('0xa0')]===-0x1){return _0x27f7d9;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xc0'),_0x11d175));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xc1')]=function(_0x527e00){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0xc2'),_0x527e00[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x527e00[_0xbd89('0xa8')])){return this['channel']['noop'](_0xbd89('0xc3'));}var _0x43cc4e=_0x527e00[_0xbd89('0xa8')];if(this[_0xbd89('0x81')](_0x527e00[_0xbd89('0x72')])){_0x43cc4e+=','+_0x527e00[_0xbd89('0x72')];}var _0x6554fa=this['channel'][_0xbd89('0x51')](_0xbd89('0xa9'),_0x43cc4e);if(_0x6554fa[_0xbd89('0xa0')]===-0x1){return _0x6554fa;}var _0x3ad868=this[_0xbd89('0x9f')](_0xbd89('0xc4'),_0xbd89('0xc5'));if(_0x3ad868[_0xbd89('0xa0')]===-0x1){return _0x3ad868;}var _0x4cf364=this['getAndSetVariable'](_0xbd89('0xc6'),_0xbd89('0xc7'));if(_0x4cf364[_0xbd89('0xa0')]===-0x1){return _0x4cf364;}var _0x3b03ae=this['getAndSetVariable'](_0xbd89('0xab'),_0xbd89('0xc8'));if(_0x3b03ae['result']===-0x1){return _0x3b03ae;}return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0xad'),_0x43cc4e));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xc9')]=function(_0x4944db){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0xca'),_0x4944db[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x4944db[_0xbd89('0xa8')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xc3'));}var _0x3024a0=_0x4944db['grammar'];if(this[_0xbd89('0x81')](_0x4944db[_0xbd89('0x72')])){_0x3024a0+=','+_0x4944db[_0xbd89('0x72')];}var _0x4265ee=this['channel']['exec'](_0xbd89('0xa9'),_0x3024a0);if(_0x4265ee[_0xbd89('0xa0')]===-0x1){return _0x4265ee;}var _0x2cf38d=this[_0xbd89('0x9f')]('RECOG_CONFIDENCE()',_0xbd89('0xcb'));if(_0x2cf38d[_0xbd89('0xa0')]===-0x1){return _0x2cf38d;}var _0x5bafe3=this['getAndSetVariable'](_0xbd89('0xc6'),_0xbd89('0xcc'));if(_0x5bafe3[_0xbd89('0xa0')]===-0x1){return _0x5bafe3;}var _0x1946ce=this['getAndSetVariable'](_0xbd89('0xab'),_0xbd89('0xcd'));if(_0x1946ce['result']===-0x1){return _0x1946ce;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xad'),_0x3024a0));};AGIVertices['prototype']['database']=function(_0x71e46a){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0xce'),_0x71e46a[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x71e46a['odbc_id'])){return this['channel'][_0xbd89('0x4c')](_0x71e46a,_0xbd89('0xcf'));}var _0x42daef=this[_0xbd89('0xd0')][_0xbd89('0x68')](this,_0x71e46a['odbc_id']);if(!_0x42daef){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x71e46a,_0xbd89('0xd1'));}if(!this[_0xbd89('0x81')](_0x71e46a[_0xbd89('0xd2')])){return this['channel'][_0xbd89('0x4c')](_0x71e46a,_0xbd89('0xd3'));}var _0xad8ab5=_0x71e46a[_0xbd89('0xd2')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0xd4'),_0xad8ab5));var _0x1fbd48=this['getQueryOdbc'][_0xbd89('0x68')](this,_0x42daef,_0xad8ab5);this[_0xbd89('0x31')]['sync'](this,_0x71e46a,_0xad8ab5);if(!this[_0xbd89('0x81')](_0x71e46a['variable_id'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xd5'));}var _0x401317=this[_0xbd89('0x11')]['sync'](this,_0x71e46a[_0xbd89('0xd6')]);if(!_0x401317){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x71e46a,'no\x20variable\x20found');}var _0x1ef3fd=this;_0x1fbd48[_0xbd89('0xd7')](function(_0x1144de,_0x22d544){Object[_0xbd89('0xd8')](_0x1144de)[_0xbd89('0xd7')](function(_0x2cd0c9){_0x1ef3fd['channel'][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0xd9'),_0x401317,_0x22d544,_0x2cd0c9),_0x1144de[_0x2cd0c9]);});});this['channel'][_0xbd89('0x9a')](util['format'](_0xbd89('0xda'),_0x401317),_0x1fbd48[_0xbd89('0x95')]);return this['channel'][_0xbd89('0xa5')](util['format'](_0xbd89('0xdb'),_0x401317));};AGIVertices['prototype'][_0xbd89('0xdc')]=function(_0x4b4c59){logger[_0xbd89('0xdd')](util[_0xbd89('0x4f')](_0xbd89('0xde'),_0x4b4c59['label']));if(!this[_0xbd89('0x81')](_0x4b4c59[_0xbd89('0xdf')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4b4c59,_0xbd89('0xe0'));}var _0x5e6ea1=this[_0xbd89('0x1b')][_0xbd89('0x68')](this,_0x4b4c59[_0xbd89('0xdf')]);if(!_0x5e6ea1){return this['channel']['error'](_0x4b4c59,'no\x20user\x20found');}var _0x28c399=this[_0xbd89('0xe')][_0xbd89('0x51')]('DIAL',[util[_0xbd89('0x4f')](_0xbd89('0xe1'),_0x5e6ea1),_0x4b4c59[_0xbd89('0x5f')],_0x4b4c59[_0xbd89('0xe2')],_0x4b4c59[_0xbd89('0x5d')]]);if(_0x28c399[_0xbd89('0xa0')]===-0x1){return _0x28c399;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0xe3'),_0xbd89('0xe4')));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xe5')]=function(_0x41ba49){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0xe6'),_0x41ba49[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x41ba49['key'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20key\x20configured');}if(!this[_0xbd89('0x81')](_0x41ba49[_0xbd89('0x56')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0xa3'));}this[_0xbd89('0xe')][_0xbd89('0xe7')]=!![];this[_0xbd89('0x31')](_0x41ba49);this[_0xbd89('0x3d')](_0x41ba49[_0xbd89('0x56')],'in','','');this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0xe8'),_0x41ba49[_0xbd89('0x56')]));var _0x2bf586=this['googleDialogflow'][_0xbd89('0x68')](this,_0x41ba49);if(_0x2bf586){for(var _0x22b21d in _0x2bf586){if(_0x2bf586[_0xbd89('0x91')](_0x22b21d)){this[_0xbd89('0xe')][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0xe9'),_0x22b21d[_0xbd89('0x62')]()),_0x2bf586[_0x22b21d]);}}this[_0xbd89('0x3d')](_0x2bf586[_0xbd89('0xea')],'out','dialogflow','');return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xeb'),_0x2bf586[_0xbd89('0xea')]));}return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x41ba49,_0xbd89('0xec'));};AGIVertices[_0xbd89('0x10')]['dialogflowV2']=function(_0x11b417){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x11b417[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x11b417[_0xbd89('0x77')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xed'));}if(!this['isConfigured'](_0x11b417[_0xbd89('0x78')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xee'));}if(!this['isConfigured'](_0x11b417[_0xbd89('0x79')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20private_key\x20configured');}if(!this[_0xbd89('0x81')](_0x11b417['dialogflowV2_language'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xef'));}if(!this['isConfigured'](_0x11b417['text'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xa3'));}this[_0xbd89('0xe')][_0xbd89('0xe7')]=!![];this[_0xbd89('0x31')](_0x11b417);this[_0xbd89('0x3d')](_0x11b417[_0xbd89('0x56')],'in','','');this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('Trying\x20DialogflowV2:\x20%s',_0x11b417['text']));var _0x5af0e4=this['googleDialogflowV2'][_0xbd89('0x68')](this,_0x11b417);if(_0x5af0e4){for(var _0x4221b1 in _0x5af0e4){if(_0x5af0e4['hasOwnProperty'](_0x4221b1)){if(_0x4221b1!=='providerResponse'){this['channel'][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0xe9'),_0x4221b1[_0xbd89('0x62')]()),_0x5af0e4[_0x4221b1]);}}}this[_0xbd89('0x3d')](_0x5af0e4[_0xbd89('0xea')],_0xbd89('0xf0'),_0xbd89('0xf1'),_0x5af0e4['providerResponse']);return this['channel'][_0xbd89('0xa5')](util['format']('DialogflowV2\x20Result\x20%s',_0x5af0e4[_0xbd89('0xea')]));}return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x11b417,_0xbd89('0xf2'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0xf3')]=function(_0x395f26){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0xf4'),_0x395f26[_0xbd89('0x33')]));if(!this['isConfigured'](_0x395f26[_0xbd89('0xf5')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0xf6'));}if(!this['isConfigured'](_0x395f26[_0xbd89('0xf7')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xf8'));}if(!this['isConfigured'](_0x395f26[_0xbd89('0xf9')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0xfa'));}if(!this['isConfigured'](_0x395f26[_0xbd89('0xfb')])){return this[_0xbd89('0xe')]['noop']('no\x20text\x20configured');}this[_0xbd89('0xe')][_0xbd89('0xe7')]=!![];this[_0xbd89('0x31')](_0x395f26);this[_0xbd89('0x3d')](_0x395f26[_0xbd89('0x56')],'in','','');this[_0xbd89('0xe')]['noop'](util['format'](_0xbd89('0xfc'),_0x395f26[_0xbd89('0x56')]));var _0x584e2a=this[_0xbd89('0x7a')]['sync'](this,_0x395f26);if(_0x584e2a){for(var _0x9ea219 in _0x584e2a){if(_0x584e2a['hasOwnProperty'](_0x9ea219)){this[_0xbd89('0xe')]['setVariable'](util[_0xbd89('0x4f')](_0xbd89('0xfd'),_0x9ea219['toUpperCase']()),_0x584e2a[_0x9ea219]);}}this[_0xbd89('0x3d')](_0x584e2a[_0xbd89('0xea')],_0xbd89('0xf0'),'sesteknda','');if(_0x584e2a[_0xbd89('0xfe')]){this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xff'),_0x584e2a[_0xbd89('0xfe')]));var _0x16dbfe=this['channel'][_0xbd89('0x100')](_0x584e2a[_0xbd89('0xfe')]);try{fs[_0xbd89('0x101')](_0x584e2a[_0xbd89('0xfe')]+'.wav');}catch(_0x5af572){logger[_0xbd89('0x4c')](_0x5af572);}return _0x16dbfe;}else{return this[_0xbd89('0xe')]['noop'](util['format'](_0xbd89('0x102'),_0x584e2a[_0xbd89('0xea')]));}}return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x395f26,_0xbd89('0x103'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x104')]=function(_0xc3e33){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20END\x20(%s)\x20block',_0xc3e33[_0xbd89('0x33')]));return this['channel'][_0xbd89('0xa5')]('end');};AGIVertices[_0xbd89('0x10')]['ext_dial']=function(_0x48237e){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x105'),_0x48237e[_0xbd89('0x33')]));var _0x1d8db3='';if(_0x48237e['trunk_id']){if(!this[_0xbd89('0x81')](_0x48237e[_0xbd89('0x106')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x48237e,_0xbd89('0x107'));}else{var _0x19cdfd=parseInt(_0x48237e[_0xbd89('0x106')],0xa);if(isNaN(_0x19cdfd)){_0x1d8db3=_0x48237e[_0xbd89('0x106')];}else{_0x1d8db3=this[_0xbd89('0x1d')]['sync'](this,_0x48237e['trunk_id']);if(!_0x1d8db3){return this[_0xbd89('0xe')]['error'](_0x48237e,'no\x20trunk\x20found');}}}}else if(_0x48237e[_0xbd89('0x108')]){_0x1d8db3=_0x48237e[_0xbd89('0x108')];}else{return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x48237e,_0xbd89('0x107'));}var _0x188fc7=this['channel'][_0xbd89('0x51')](_0xbd89('0xe4'),[util[_0xbd89('0x4f')](_0xbd89('0x109'),_0x1d8db3,_0x48237e['phone']),_0x48237e[_0xbd89('0x5f')],_0x48237e[_0xbd89('0xe2')],_0x48237e[_0xbd89('0x5d')]]);if(_0x188fc7[_0xbd89('0xa0')]===-0x1){return _0x188fc7;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0xe3'),_0xbd89('0xe4')));};AGIVertices[_0xbd89('0x10')]['finally']=function(_0x4b7a40){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x4b7a40[_0xbd89('0x33')]));return this[_0xbd89('0xe')]['noop']('finally');};AGIVertices[_0xbd89('0x10')][_0xbd89('0xc')]=function(_0x4ff881){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x10a'),_0x4ff881[_0xbd89('0x33')]));if(_0x4ff881[_0xbd89('0xa1')]===0x0){return this[_0xbd89('0x10b')](_0x4ff881);}_0x4ff881[_0xbd89('0xa1')]-=0x1;if(!this[_0xbd89('0x81')](_0x4ff881[_0xbd89('0x10c')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4ff881,'no\x20file\x20audio\x20selected');}var _0x3cf60e=this[_0xbd89('0x1e')][_0xbd89('0x68')](this,_0x4ff881[_0xbd89('0x10c')]);if(!_0x3cf60e){return this[_0xbd89('0xe')]['error'](_0x4ff881,_0xbd89('0x10d'));}if(!this[_0xbd89('0x81')](_0x4ff881['variable_id'])){return this['channel'][_0xbd89('0x4c')](_0xbd89('0xd5'));}var _0x457f9e=this['channel'][_0xbd89('0x10e')](_0x3cf60e,_0x4ff881['response'],_0x4ff881[_0xbd89('0x10f')]);var _0x5a7c80=_0x457f9e[_0xbd89('0xa0')]?_0x457f9e['result'][_0xbd89('0x46')]():'';logger[_0xbd89('0x2a')](_0xbd89('0x110'),JSON[_0xbd89('0x6d')](_0x457f9e));if(_0x457f9e['result']===-0x1){this['createSquareDetailsReport'][_0xbd89('0x68')](this,_0x4ff881,_0x5a7c80);return _0x457f9e;}else if(_0x457f9e[_0xbd89('0x9e')]==='timeout'){_0x457f9e[_0xbd89('0xa0')]=_0x5a7c80[_0xbd89('0x95')]>=parseInt(_0x4ff881[_0xbd89('0x111')])?'x':'i';}else{_0x457f9e[_0xbd89('0xa0')]=_0x5a7c80[_0xbd89('0x95')]>=parseInt(_0x4ff881[_0xbd89('0x111')])&&_0x5a7c80[_0xbd89('0x95')]<=parseInt(_0x4ff881[_0xbd89('0x10f')])?'x':'i';}var _0x24d798=this[_0xbd89('0x11')][_0xbd89('0x68')](this,_0x4ff881['variable_id']);if(!_0x24d798){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4ff881,_0xbd89('0x112'));}this[_0xbd89('0xe')]['setVariable'](_0x24d798,_0x5a7c80);if(this[_0xbd89('0x81')](_0x4ff881['hiddendigitsnum'])){var _0x40b3ba=parseInt(_0x4ff881[_0xbd89('0x113')],0xa);var _0x4e7e54=rs[_0xbd89('0x114')]({'charset':'*','length':_0x40b3ba});var _0x1176c6=_0x5a7c80['length'];if(_0x1176c6>0x0){if(_0x1176c6>_0x40b3ba){this[_0xbd89('0x31')]['sync'](this,_0x4ff881,_0x4ff881[_0xbd89('0x115')]===_0xbd89('0x116')?_0x4e7e54+_0x5a7c80[_0xbd89('0x117')](_0x40b3ba):_0x5a7c80[_0xbd89('0x117')](0x0,_0x1176c6-_0x40b3ba)+_0x4e7e54);}else{this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x4ff881,rs[_0xbd89('0x114')]({'charset':'*','length':_0x1176c6}));}}else{this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x4ff881,'');}}else{this['createSquareDetailsReport'][_0xbd89('0x68')](this,_0x4ff881,_0x5a7c80);}return _0x457f9e;};AGIVertices[_0xbd89('0x10')][_0xbd89('0xd')]=function(_0x57d943){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x118'),_0x57d943['label']));return this[_0xbd89('0xc')](_0x57d943);};AGIVertices[_0xbd89('0x10')][_0xbd89('0x119')]=function(_0xd23d90){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x11a'),_0xd23d90[_0xbd89('0x33')]));this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0xd23d90,_0xd23d90[_0xbd89('0x11b')]);return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0x11c'),_0xd23d90['goalname']));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x11d')]=function(_0x44f8a7){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x11e'),_0x44f8a7[_0xbd89('0x33')]));if(!this['isConfigured'](_0x44f8a7['aws_access_key_id'])||!this[_0xbd89('0x81')](_0x44f8a7[_0xbd89('0x84')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbd89('0x81')](_0x44f8a7[_0xbd89('0x56')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20text\x20configured');}this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x11f'),_0x44f8a7['text']));var _0x40bdbe=this['awsPolly'][_0xbd89('0x68')](this,_0x44f8a7);if(_0x40bdbe){this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('aws\x20Polly\x20%s\x20file\x20created',_0x40bdbe));var _0x5c9155=this['channel'][_0xbd89('0x100')](_0x40bdbe);try{fs[_0xbd89('0x101')](_0x40bdbe+_0xbd89('0x120'));}catch(_0x4152cd){logger['error'](_0x4152cd);}return _0x5c9155;}return this[_0xbd89('0xe')]['error'](_0x44f8a7,_0xbd89('0x121'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x122')]=function(_0x21696a){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x21696a['label']));if(!this[_0xbd89('0x81')](_0x21696a[_0xbd89('0x88')])||!this[_0xbd89('0x81')](_0x21696a[_0xbd89('0x84')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbd89('0x81')](_0x21696a[_0xbd89('0x8a')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0x123'));}if(!this['isConfigured'](_0x21696a[_0xbd89('0x56')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xa3'));}this[_0xbd89('0xe')]['bot']=!![];this[_0xbd89('0x31')](_0x21696a);this[_0xbd89('0x3d')](_0x21696a[_0xbd89('0x56')],'in','','');this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0x124'),_0x21696a[_0xbd89('0x56')]));var _0x1fe45c=this[_0xbd89('0x87')][_0xbd89('0x68')](this,_0x21696a);if(_0x1fe45c){for(var _0x1f5ab9 in _0x1fe45c){if(_0x1fe45c['hasOwnProperty'](_0x1f5ab9)&&_[_0xbd89('0x96')](_0x1fe45c[_0x1f5ab9])){this['channel']['setVariable'](util['format'](_0xbd89('0x125'),_0x1f5ab9[_0xbd89('0x62')]()),_0x1fe45c[_0x1f5ab9]);}}if(_[_0xbd89('0x3f')](_0x1fe45c['message'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x126'));}else{this[_0xbd89('0x3d')](_0x1fe45c[_0xbd89('0x70')],_0xbd89('0xf0'),'amazonlex','');return this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0x127'),_0x1fe45c['message']));}}return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x21696a,_0xbd89('0x128'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x129')]=function(_0x5f2d4c){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x12a'),_0x5f2d4c[_0xbd89('0x33')],_0x5f2d4c[_0xbd89('0x5f')]));if(!this[_0xbd89('0x81')](_0x5f2d4c[_0xbd89('0x74')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x12b'));}var _0xda73da='wav';var _0x48a42a=util[_0xbd89('0x4f')]('%s/recordings/%s',FILES_PATH,rs[_0xbd89('0x114')](0x4));var _0x28f68e=util[_0xbd89('0x4f')]('%s.%s',_0x48a42a,_0xda73da);var _0x5a97f9=!![];if(_0x5f2d4c[_0xbd89('0x12c')]===_0xbd89('0x12d')){_0x5a97f9=![];}var _0x3a469a=this['channel'][_0xbd89('0x12e')](_0x48a42a,_0xda73da,_0x5f2d4c[_0xbd89('0x12f')],_0x5f2d4c['timeout'],undefined,_0x5a97f9);if(_0x3a469a['result']!==-0x1){this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x130'),_0x28f68e));var _0x2187b1=this[_0xbd89('0x8b')][_0xbd89('0x68')](this,_0x5f2d4c,_0x28f68e);if(_0x2187b1){for(var _0x5267bc in _0x2187b1){if(_0x2187b1['hasOwnProperty'](_0x5267bc)){this['channel'][_0xbd89('0x9a')](util[_0xbd89('0x4f')]('GOOGLE_ASR_%s',_0x5267bc['toUpperCase']()),_0x2187b1[_0x5267bc]);}}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x131'),JSON[_0xbd89('0x6d')](_0x2187b1)));}}return _0x3a469a;};AGIVertices['prototype'][_0xbd89('0x132')]=function(_0x4e8142){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x133'),_0x4e8142[_0xbd89('0x33')]));if(!this['isConfigured'](_0x4e8142[_0xbd89('0x134')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20appid\x20configured');}if(!this[_0xbd89('0x81')](_0x4e8142[_0xbd89('0x8e')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0x135'));}var _0x264303=_0xbd89('0x136');var _0x2d23b5=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x2c7138=util[_0xbd89('0x4f')]('%s.%s',_0x2d23b5,_0x264303);var _0x5ca059=!![];if(_0x4e8142[_0xbd89('0x12c')]==='NOBEEP'){_0x5ca059=![];}var _0x55ca61=this['channel'][_0xbd89('0x12e')](_0x2d23b5,_0x264303,_0x4e8142[_0xbd89('0x12f')],_0x4e8142[_0xbd89('0x5f')],undefined,_0x5ca059);if(_0x55ca61[_0xbd89('0xa0')]!==-0x1){this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format']('tilde\x20%s\x20file\x20created',_0x2c7138));var _0x72eb01=this[_0xbd89('0x8d')][_0xbd89('0x68')](this,_0x4e8142,_0x2c7138);if(_0x72eb01){for(var _0x27bf0f in _0x72eb01){if(_0x72eb01[_0xbd89('0x91')](_0x27bf0f)){this[_0xbd89('0xe')][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0x137'),_0x27bf0f['toUpperCase']()),_0x72eb01[_0x27bf0f]);}}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('TildeASR\x20Result\x20%s',JSON[_0xbd89('0x6d')](_0x72eb01)));}}return _0x55ca61;};AGIVertices['prototype'][_0xbd89('0x138')]=function(_0x2090b2){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x139'),_0x2090b2[_0xbd89('0x33')]));return this[_0xbd89('0xe')][_0xbd89('0x13a')](_0x2090b2[_0xbd89('0x38')],_0x2090b2[_0xbd89('0x39')],_0x2090b2[_0xbd89('0x13b')]);};AGIVertices[_0xbd89('0x10')]['gotoif']=function(_0x430b7f){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x13c'),_0x430b7f['label']));if(!this[_0xbd89('0x81')](_0x430b7f['condition'])){return this[_0xbd89('0xe')]['error'](_0x430b7f,_0xbd89('0x13d'));}try{var _0x1ba6a1=eval(_0x430b7f['condition'])?_0xbd89('0x13e'):_0xbd89('0x13f');this[_0xbd89('0xe')]['noop'](util['format'](_0xbd89('0x140'),_0x430b7f[_0xbd89('0x141')],_0x1ba6a1));return{'code':0xc8,'result':_0x1ba6a1};}catch(_0x361474){return{'code':0xc8,'result':_0xbd89('0x13f')};}};AGIVertices[_0xbd89('0x10')]['gotoiftime']=function(_0x188c4e){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x142'),_0x188c4e[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x188c4e[_0xbd89('0x143')])){return this['channel'][_0xbd89('0x4c')](_0x188c4e,_0xbd89('0x144'));}var _0x48ef84=this[_0xbd89('0x145')][_0xbd89('0x68')](this,_0x188c4e[_0xbd89('0x143')]);if(!_0x48ef84){return this['channel'][_0xbd89('0x4c')](_0x188c4e,_0xbd89('0x146'));}for(var _0x18f853=0x0;_0x18f853<_0x48ef84[_0xbd89('0x95')];_0x18f853+=0x1){var _0x4c0ce3=this[_0xbd89('0xe')][_0xbd89('0x11')](util[_0xbd89('0x4f')](_0xbd89('0x147'),_0x48ef84[_0x18f853]));if(_0x4c0ce3[_0xbd89('0xa0')]===-0x1){return _0x4c0ce3;}logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x148'),_0x48ef84[_0x18f853],_0x4c0ce3[_0xbd89('0x9e')]));if(_0x4c0ce3[_0xbd89('0x9e')]===_0xbd89('0x13e')){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x148'),_0x48ef84[_0x18f853],'true'));this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x148'),_0x48ef84[_0x18f853],_0xbd89('0x13e')));return{'code':0xc8,'result':_0xbd89('0x13e')};}else{logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x148'),_0x48ef84[_0x18f853],_0xbd89('0x13f')));this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x148'),_0x48ef84[_0x18f853],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xbd89('0x10')]['hangup']=function(_0x4a111d){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x149'),_0x4a111d['label']));return this['channel'][_0xbd89('0x14a')]();};AGIVertices[_0xbd89('0x10')][_0xbd89('0x14b')]=function(_0x5e32b1){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x14c'),_0x5e32b1[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x5e32b1[_0xbd89('0x74')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0x12b'));}var _0x45d4ef=_0xbd89('0x136');var _0x40673d=util[_0xbd89('0x4f')](_0xbd89('0x14d'),FILES_PATH,rs['generate'](0x4));var _0x5af204=util[_0xbd89('0x4f')](_0xbd89('0x99'),_0x40673d,_0x45d4ef);var _0x235a87=!![];if(_0x5e32b1['beep']==='NOBEEP'){_0x235a87=![];}var _0x35fba5=this[_0xbd89('0xe')][_0xbd89('0x12e')](_0x40673d,_0x45d4ef,_0x5e32b1[_0xbd89('0x12f')],_0x5e32b1[_0xbd89('0x5f')],undefined,_0x235a87);if(_0x35fba5[_0xbd89('0xa0')]!==-0x1){this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x14e'),_0x5af204));var _0x3f1723=this['ispeechASR'][_0xbd89('0x68')](this,_0x5e32b1,_0x5af204);if(_0x3f1723){for(var _0x1c1dc3 in _0x3f1723){if(_0x3f1723[_0xbd89('0x91')](_0x1c1dc3)){this[_0xbd89('0xe')][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0x14f'),_0x1c1dc3['toUpperCase']()),_0x3f1723[_0x1c1dc3]);}}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x150'),JSON[_0xbd89('0x6d')](_0x3f1723)));}}return _0x35fba5;};AGIVertices['prototype'][_0xbd89('0x151')]=function(_0x50b462){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x152'),_0x50b462[_0xbd89('0x33')]));if(!this['isConfigured'](_0x50b462[_0xbd89('0x74')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x12b'));}if(!this[_0xbd89('0x81')](_0x50b462[_0xbd89('0x56')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xa3'));}this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x153'),_0x50b462[_0xbd89('0x56')]));var _0x4a3755=this[_0xbd89('0x7b')]['sync'](this,_0x50b462);if(_0x4a3755){this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x14e'),_0x4a3755));var _0x3b3bc6=this[_0xbd89('0xe')][_0xbd89('0x100')](_0x4a3755,_0x50b462[_0xbd89('0x12f')]);try{fs['unlink'](_0x4a3755+_0xbd89('0x120'));}catch(_0x3ad1e5){logger[_0xbd89('0x4c')](_0x3ad1e5);}return _0x3b3bc6;}return this['channel'][_0xbd89('0x4c')](_0x50b462,_0xbd89('0x154'));};AGIVertices['prototype'][_0xbd89('0x155')]=function(_0x2326bc){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x156'),_0x2326bc[_0xbd89('0x33')]));if(!this['isConfigured'](_0x2326bc['findBy'])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x2326bc,_0xbd89('0x157'));}logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbd89('0xe')][_0xbd89('0x36')],_0x2326bc[_0xbd89('0x158')]));var _0x31cea7=this[_0xbd89('0x159')]['sync'](this,_0x2326bc['findBy']);if(_0x31cea7){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x15a'),this[_0xbd89('0xe')]['callerid'],_0x2326bc[_0xbd89('0x158')]));this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbd89('0xe')]['callerid'],_0x2326bc['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x15b'),this['channel'][_0xbd89('0x36')],_0x2326bc[_0xbd89('0x158')]));this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x15b'),this['channel'][_0xbd89('0x36')],_0x2326bc['findBy']));return{'code':0xc8,'result':_0xbd89('0x15c')};}};AGIVertices[_0xbd89('0x10')][_0xbd89('0x15d')]=function(_0x3d4067){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x15e'),_0x3d4067['label']));if(!this[_0xbd89('0x81')](_0x3d4067[_0xbd89('0x158')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x3d4067,_0xbd89('0x157'));}logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x15f'),this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3d4067[_0xbd89('0x158')]));var _0x1f4fbf=this[_0xbd89('0x4d')][_0xbd89('0x68')](this,_0x3d4067['findBy']);if(_0x1f4fbf){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3d4067[_0xbd89('0x158')]));this['channel']['noop'](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this['channel'][_0xbd89('0x36')],_0x3d4067['findBy']));return{'code':0xc8,'result':_0xbd89('0x160')};}else{logger[_0xbd89('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3d4067[_0xbd89('0x158')]));this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0x15b'),this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3d4067[_0xbd89('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xbd89('0x10')][_0xbd89('0x161')]=function(_0x3d8085){logger['info'](util[_0xbd89('0x4f')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3d8085[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x3d8085[_0xbd89('0x162')])){return this['channel'][_0xbd89('0x4c')](_0x3d8085,_0xbd89('0x163'));}this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('math\x20%s',_0x3d8085[_0xbd89('0x162')]));var _0x38ccac=eval(_0x3d8085['operation']);if(!this[_0xbd89('0x81')](_0x3d8085[_0xbd89('0xd6')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0xd5'));}var _0x5d6e7b=this[_0xbd89('0x11')]['sync'](this,_0x3d8085['variable_id']);if(!_0x5d6e7b){return this['channel'][_0xbd89('0x4c')](_0x3d8085,_0xbd89('0x112'));}if(_[_0xbd89('0x94')](_0x38ccac)){var _0x21d8eb=this;_0x38ccac[_0xbd89('0xd7')](function(_0x51fc06,_0x5a3e73){_0x21d8eb['channel']['setVariable'](util[_0xbd89('0x4f')]('%s[%s]',_0x5d6e7b,_0x5a3e73),_0x51fc06);});return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')]('variable\x20%s[key]\x20set',_0x5d6e7b));}else{return this['channel'][_0xbd89('0x9a')](_0x5d6e7b,_0x38ccac);}};AGIVertices['prototype'][_0xbd89('0xb')]=function(_0x4a2b31){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4a2b31[_0xbd89('0x33')]));if(_0x4a2b31[_0xbd89('0xa1')]===0x0){return this[_0xbd89('0x10b')](_0x4a2b31);}_0x4a2b31[_0xbd89('0xa1')]-=0x1;if(!this[_0xbd89('0x81')](_0x4a2b31[_0xbd89('0x10c')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4a2b31,_0xbd89('0x164'));}var _0x446a3c=this['getSound']['sync'](this,_0x4a2b31['file_id']);if(!_0x446a3c){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4a2b31,_0xbd89('0x10d'));}var _0x43e7b2=this[_0xbd89('0xe')]['getData'](_0x446a3c,_0x4a2b31[_0xbd89('0x165')],_0x4a2b31[_0xbd89('0x166')]);var _0x3bf41e=_0x43e7b2['result'];if(_0x43e7b2[_0xbd89('0xa0')]===-0x1){this['createSquareDetailsReport'][_0xbd89('0x68')](this,_0x4a2b31,'-1');return _0x43e7b2;}else if(_0x43e7b2[_0xbd89('0x9e')]===_0xbd89('0x5f')){_0x43e7b2[_0xbd89('0xa0')]=_0x43e7b2[_0xbd89('0xa0')]['length']>0x0?_0x43e7b2[_0xbd89('0xa0')]:'t';}else if(_[_0xbd89('0x97')](_0x43e7b2[_0xbd89('0xa0')])){_0x43e7b2[_0xbd89('0xa0')]='#';_0x3bf41e='#';}if(!this['isConfigured'](_0x4a2b31[_0xbd89('0xd6')])){this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xcf3770=this[_0xbd89('0x11')][_0xbd89('0x68')](this,_0x4a2b31['variable_id']);if(!_0xcf3770){return this['channel'][_0xbd89('0x4c')](_0x4a2b31,_0xbd89('0x112'));}this['channel'][_0xbd89('0x9a')](_0xcf3770,_0x3bf41e);}this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x4a2b31,_0x3bf41e);return _0x43e7b2;};AGIVertices[_0xbd89('0x10')][_0xbd89('0xa5')]=function(_0x2f8c7c){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2f8c7c['label']));return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0x2f8c7c[_0xbd89('0x167')]||_0x2f8c7c[_0xbd89('0x33')]);};AGIVertices['prototype'][_0xbd89('0x168')]=function(_0x4a58b5){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x169'),_0x4a58b5[_0xbd89('0x33')]));if(!this['isConfigured'](_0x4a58b5[_0xbd89('0x158')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x4a58b5,_0xbd89('0x157'));}logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xbd89('0x36')],_0x4a58b5[_0xbd89('0x158')]));var _0x4acd55=this[_0xbd89('0x48')]['sync'](this,_0x4a58b5['pause_id']);var _0x231f33=this[_0xbd89('0x16a')][_0xbd89('0x68')](this,_0x4a58b5['findBy'],_0x4acd55);if(_0x231f33){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this[_0xbd89('0xe')]['callerid'],_0x4a58b5[_0xbd89('0x158')]));this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this[_0xbd89('0xe')][_0xbd89('0x36')],_0x4a58b5[_0xbd89('0x158')]));return{'code':0xc8,'result':_0xbd89('0x160')};}else{logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x15b'),this[_0xbd89('0xe')][_0xbd89('0x36')],_0x4a58b5[_0xbd89('0x158')]));this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this[_0xbd89('0xe')]['callerid'],_0x4a58b5[_0xbd89('0x158')]));return{'code':0xc8,'result':_0xbd89('0x15c')};}};AGIVertices[_0xbd89('0x10')][_0xbd89('0x16b')]=function(_0x17902d){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x16c'),_0x17902d['label']));if(!this[_0xbd89('0x81')](_0x17902d['file_id'])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x17902d,_0xbd89('0x164'));}var _0x22aa16=this[_0xbd89('0x1e')][_0xbd89('0x68')](this,_0x17902d[_0xbd89('0x10c')]);if(!_0x22aa16){return this[_0xbd89('0xe')]['error'](_0x17902d,_0xbd89('0x10d'));}var _0x50a455=this[_0xbd89('0xe')][_0xbd89('0x51')](_0xbd89('0x16d'),[_0x22aa16,_0x17902d['opts']]);if(_0x50a455[_0xbd89('0xa0')]===-0x1){return _0x50a455;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xbd'),_0xbd89('0x16d'),_0x22aa16));};AGIVertices[_0xbd89('0x10')]['queue']=function(_0x599e2d){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x599e2d[_0xbd89('0x33')]));if(!this['isConfigured'](_0x599e2d[_0xbd89('0x16e')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x599e2d,_0xbd89('0x16f'));}var _0xefb135='';var _0x2e575c=parseInt(_0x599e2d[_0xbd89('0x16e')],0xa);if(isNaN(_0x2e575c)){_0xefb135=_0x599e2d[_0xbd89('0x16e')];}else{_0xefb135=this[_0xbd89('0x16')][_0xbd89('0x68')](this,_0x599e2d['queue_id']);if(!_0xefb135){return this[_0xbd89('0xe')]['error'](_0x599e2d,_0xbd89('0x170'));}}var _0x4a881f='';if(this['isConfigured'](_0x599e2d[_0xbd89('0x10c')])){var _0x2aca9e=this[_0xbd89('0x1e')]['sync'](this,_0x599e2d[_0xbd89('0x10c')]);if(_0x2aca9e){_0x4a881f=_0x2aca9e;}}this[_0xbd89('0x31')]['sync'](this,_0x599e2d,_0xefb135);if(_0x599e2d[_0xbd89('0xe2')][_0xbd89('0x171')]('x')<0x0){_0x599e2d[_0xbd89('0xe2')]+='x';}if(_0x599e2d['opts']['indexOf']('X')<0x0){_0x599e2d[_0xbd89('0xe2')]+='X';}this['channel'][_0xbd89('0x9a')](_0xbd89('0x172'),_0xefb135?_0xefb135[_0xbd89('0x173')]():'');var _0x47aae1=this['channel'][_0xbd89('0x51')](_0xbd89('0x174'),[_0xefb135,_0x599e2d[_0xbd89('0xe2')],_0x599e2d['url'],_0x4a881f,_0x599e2d['timeout'],_0x599e2d[_0xbd89('0xae')],_0x599e2d[_0xbd89('0x175')],_0x599e2d[_0xbd89('0x176')],'',_0x599e2d[_0xbd89('0x177')]]);if(_0x47aae1[_0xbd89('0xa0')]===-0x1){return _0x47aae1;}return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')]('Executed\x20command\x20%s\x20%s',_0xbd89('0x174'),_0xefb135));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x178')]=function(_0x49288d){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x179'),_0x49288d[_0xbd89('0x33')]));var _0x55f194=_0x49288d[_0xbd89('0x17a')]||_0xbd89('0x136');var _0x1d1a23=util[_0xbd89('0x4f')](_0xbd89('0x17b'),this[_0xbd89('0xe')][_0xbd89('0x32')],rs[_0xbd89('0x114')](0x5));var _0x5dd350=util[_0xbd89('0x4f')](_0xbd89('0x17c'),FILES_PATH,_0x1d1a23,_0x55f194);var _0x5a5971=util[_0xbd89('0x4f')](_0xbd89('0x14d'),FILES_PATH,_0x1d1a23);this[_0xbd89('0x37')][_0xbd89('0x68')](this,_0x49288d,_0x1d1a23,_0x5dd350);this[_0xbd89('0xe')]['setVariable'](_0xbd89('0x17d'),_0x1d1a23);logger[_0xbd89('0x2a')](_0xbd89('0x17e'),_0x5a5971,_0x55f194,_0x49288d[_0xbd89('0x17f')],_0x49288d[_0xbd89('0x5f')]);return this[_0xbd89('0xe')][_0xbd89('0x12e')](_0x5a5971,_0x55f194,_0x49288d[_0xbd89('0x17f')],_0x49288d['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xbd89('0x180')]=function(_0x5106c6){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x5106c6['label']));if(!this['isConfigured'](_0x5106c6[_0xbd89('0x5d')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x181'));}var _0x3a75cd=this['restAPI'][_0xbd89('0x68')](this,_0x5106c6);logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x182'),util[_0xbd89('0x183')](_0x3a75cd,{'showHidden':![],'depth':null})));if(!this[_0xbd89('0x81')](_0x5106c6[_0xbd89('0xd6')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0x184'));}var _0x244652=this['getVariable'][_0xbd89('0x68')](this,_0x5106c6[_0xbd89('0xd6')]);if(!_0x244652){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x5106c6,'no\x20variable\x20found');}this['channel']['setVariable'](util['format'](_0xbd89('0x185'),_0x244652),_0x3a75cd[_0xbd89('0x186')]?_0x3a75cd[_0xbd89('0x186')]:_0xbd89('0x187'));this[_0xbd89('0xe')][_0xbd89('0x9a')](util[_0xbd89('0x4f')](_0xbd89('0x188'),_0x244652),_0x3a75cd[_0xbd89('0x6f')]?_0x3a75cd[_0xbd89('0x6f')]:'OK');if(_0x3a75cd[_0xbd89('0x63')]){try{this['saveRestApiResult'](_0x3a75cd['body'],_0x244652);}catch(_0x4a9798){logger[_0xbd89('0x4c')](util[_0xbd89('0x4f')](_0xbd89('0x189'),_0x244652));}}return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0xdb'),_0x244652));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x18a')]=function(_0x3e14d6){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x18b'),_0x3e14d6[_0xbd89('0x33')]));return this['channel'][_0xbd89('0x18c')](_0x3e14d6[_0xbd89('0x18d')][_0xbd89('0x18e')](/\s+/g,''),_0x3e14d6[_0xbd89('0x17f')]);};AGIVertices[_0xbd89('0x10')]['saynumber']=function(_0xfa3c3b){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x18f'),_0xfa3c3b['label']));return this[_0xbd89('0xe')][_0xbd89('0x190')](_0xfa3c3b[_0xbd89('0x60')]['replace'](/\s+/g,''),_0xfa3c3b['escape_digits']);};AGIVertices['prototype'][_0xbd89('0x191')]=function(_0x122995){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x192'),_0x122995[_0xbd89('0x33')]));return this['channel'][_0xbd89('0x193')](_0x122995[_0xbd89('0x56')],_0x122995[_0xbd89('0x17f')]);};AGIVertices[_0xbd89('0x10')][_0xbd89('0x194')]=function(_0x764f58){logger['info'](util[_0xbd89('0x4f')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x764f58[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x764f58[_0xbd89('0x195')])){return this['channel'][_0xbd89('0xa5')](_0xbd89('0x196'));}var _0x15f3c0=this[_0xbd89('0x197')][_0xbd89('0x68')](this,_0x764f58[_0xbd89('0x195')]);if(!_0x15f3c0||!_0x15f3c0[_0xbd89('0x198')]){return this['channel'][_0xbd89('0x4c')](_0x764f58,'no\x20mail\x20account\x20found');}var _0x53dadc={'from':util[_0xbd89('0x4f')](_0xbd89('0x199'),_0x15f3c0['name'],_0x15f3c0[_0xbd89('0x19a')]||_0x15f3c0[_0xbd89('0x198')][_0xbd89('0x19b')]),'to':_0x764f58['to']||'','cc':_0x764f58['cc']||'','bcc':_0x764f58[_0xbd89('0x19c')]||'','subject':_0x764f58[_0xbd89('0x19d')],'html':_0x764f58['text'],'text':_0x764f58[_0xbd89('0x56')]};var _0x31aa27={'tls':{'rejectUnauthorized':![]}};if(_0x15f3c0[_0xbd89('0x198')][_0xbd89('0x19e')]){_0x31aa27['service']=_0x15f3c0[_0xbd89('0x198')]['service'];}else{_0x31aa27[_0xbd89('0x19f')]=_0x15f3c0['Smtp'][_0xbd89('0x19f')];_0x31aa27[_0xbd89('0x1a0')]=_0x15f3c0[_0xbd89('0x198')][_0xbd89('0x1a0')];_0x31aa27['secure']=_0x15f3c0['Smtp'][_0xbd89('0x1a1')];}if(_0x15f3c0[_0xbd89('0x198')][_0xbd89('0x1a2')]){_0x31aa27[_0xbd89('0x1a3')]={'user':_0x15f3c0[_0xbd89('0x198')][_0xbd89('0x19b')],'pass':_0x15f3c0['Smtp']['pass']};}if(this[_0xbd89('0x81')](_0x764f58['template_id'])){}logger[_0xbd89('0xdd')](_0xbd89('0x1a4'),JSON['stringify'](_0x53dadc));this['createSquareDetailsReport'][_0xbd89('0x68')](this,_0x764f58,_0x764f58[_0xbd89('0x195')]);this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0x1a5'),_0x15f3c0[_0xbd89('0x15')]));this[_0xbd89('0x21')]['sync'](this,_0x31aa27,_0x53dadc);return this[_0xbd89('0xe')]['noop'](_0xbd89('0x1a6'));};AGIVertices['prototype'][_0xbd89('0x1a7')]=function(_0x90530a){logger[_0xbd89('0x2a')](util['format'](_0xbd89('0x1a8'),_0x90530a[_0xbd89('0x33')]));return this[_0xbd89('0xe')][_0xbd89('0xa5')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0xbd89('0x1a9')]=function(_0x338bb4){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1aa'),_0x338bb4[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x338bb4['sms_account_id'])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x1ab'));}var _0x399bdf=this['getSmsAccount'][_0xbd89('0x68')](this,_0x338bb4['sms_account_id']);if(!_0x399bdf){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x338bb4,'no\x20sms\x20account\x20found');}var _0x38e02b={'body':_0x338bb4['sms_text'],'phone':_0x338bb4['to']||'','SmsAccountId':_0x399bdf['id']};logger[_0xbd89('0xdd')](_0xbd89('0x1ac'),JSON[_0xbd89('0x6d')](_0x38e02b));this['createSquareDetailsReport'][_0xbd89('0x68')](this,_0x338bb4,_0x338bb4[_0xbd89('0x1ad')]);this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x1ae'),_0x399bdf[_0xbd89('0x15')]));this[_0xbd89('0x30')][_0xbd89('0x68')](this,_0x38e02b);return this[_0xbd89('0xe')]['noop'](_0xbd89('0x1af'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1b0')]=function(_0x199f34){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1b1'),_0x199f34[_0xbd89('0x33')]));if(!this['isConfigured'](_0x199f34[_0xbd89('0xd6')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x199f34,_0xbd89('0x1b2'));}var _0x4c7f69=this[_0xbd89('0x11')][_0xbd89('0x68')](this,_0x199f34[_0xbd89('0xd6')]);if(!_0x4c7f69){return this[_0xbd89('0xe')]['error'](_0x199f34,_0xbd89('0x112'));}return this['channel'][_0xbd89('0x9a')](_0x4c7f69,_0x199f34[_0xbd89('0x1b3')]);};AGIVertices['prototype'][_0xbd89('0x1b4')]=function(_0x510000){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1b5'),_0x510000[_0xbd89('0x33')]));this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x1b6'));if(_0x510000[_0xbd89('0xb3')]===_0xbd89('0x1b7')){this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0x1b8'));return this[_0xbd89('0xe')][_0xbd89('0xb3')]();}return this[_0xbd89('0xe')]['noop']('Skipped\x20Answer');};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1b9')]=function(_0x1f68b2){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1f68b2[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x1f68b2[_0xbd89('0x1ba')])){return this[_0xbd89('0xe')]['error'](_0x1f68b2,_0xbd89('0x1bb'));}var _0x1f9980=this[_0xbd89('0x1bc')]['sync'](this,_0x1f68b2['project_id']);if(!this[_0xbd89('0x81')](_0x1f9980)){return this['channel'][_0xbd89('0x4c')](_0x1f68b2,util['format'](_0xbd89('0x1bd'),_0x1f68b2['project_id']));}if(_0x1f9980===this[_0xbd89('0xe')]['arg_1']){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x1f68b2,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x1f68b2,_0x1f9980);var _0x5617f3=this[_0xbd89('0xe')]['exec']('AGI',util[_0xbd89('0x4f')](_0xbd89('0x1be'),config['agi'][_0xbd89('0x19f')]||'127.0.0.1',_0x1f9980,this[_0xbd89('0xe')][_0xbd89('0x35')]));if(_0x5617f3['result']===-0x1){return _0x5617f3;}return this[_0xbd89('0xe')]['noop'](util[_0xbd89('0x4f')](_0xbd89('0xbd'),_0xbd89('0x1bf'),_0x1f9980));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1c0')]=function(_0x2c1f9d){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1c1'),_0x2c1f9d['label']));var _0x174050=this[_0xbd89('0x1c2')][_0xbd89('0x68')](this,_0x2c1f9d[_0xbd89('0xaf')]);this[_0xbd89('0x31')][_0xbd89('0x68')](this,_0x2c1f9d,_0x2c1f9d[_0xbd89('0xaf')]);if(this[_0xbd89('0x81')](_0x2c1f9d[_0xbd89('0xd6')])){var _0x5f46d1=this['getVariable']['sync'](this,_0x2c1f9d[_0xbd89('0xd6')]);if(_0x5f46d1){this['channel'][_0xbd89('0x9a')](_0x5f46d1,_0x174050);return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x1c3'),_0x2c1f9d[_0xbd89('0xaf')],_0x5f46d1));}}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2c1f9d[_0xbd89('0xaf')]));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1c4')]=function(_0x3fc385){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1c5'),_0x3fc385['label']));_0x3fc385[_0xbd89('0x56')]=_0x3fc385['text'][_0xbd89('0x18e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbd89('0x81')](_0x3fc385[_0xbd89('0x54')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')]('no\x20apiKey\x20configured');}if(!this[_0xbd89('0x81')](_0x3fc385[_0xbd89('0x56')])){return this['channel'][_0xbd89('0xa5')]('no\x20text\x20configured');}this['channel'][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x1c6'),_0x3fc385[_0xbd89('0x56')]));var _0xd4d608=this[_0xbd89('0x53')]['sync'](this,_0x3fc385);if(_0xd4d608){this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0x1c7'),_0xd4d608));var _0x4f9a22=this[_0xbd89('0xe')][_0xbd89('0x100')](_0xd4d608);try{fs['unlink'](_0xd4d608+_0xbd89('0x120'));}catch(_0x45f183){logger[_0xbd89('0x4c')](_0x45f183);}return _0x4f9a22;}return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x3fc385,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1c8')]=function(_0x24ef88){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x1c9'),_0x24ef88[_0xbd89('0x33')]));_0x24ef88[_0xbd89('0x56')]=_0x24ef88['text'][_0xbd89('0x18e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbd89('0x81')](_0x24ef88[_0xbd89('0x56')])){return this[_0xbd89('0xe')][_0xbd89('0xa5')](_0xbd89('0xa3'));}this['channel'][_0xbd89('0xa5')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x24ef88[_0xbd89('0x56')]));var _0x2bfa7=this['googleTTS'][_0xbd89('0x68')](this,_0x24ef88);if(_0x2bfa7){this[_0xbd89('0xe')][_0xbd89('0xa5')](util['format'](_0xbd89('0x1ca'),_0x2bfa7));var _0x309a33=this[_0xbd89('0xe')][_0xbd89('0x100')](_0x2bfa7);try{fs[_0xbd89('0x101')](_0x2bfa7+_0xbd89('0x120'));}catch(_0x5f2b51){logger['error'](_0x5f2b51);}return _0x309a33;}return this['channel'][_0xbd89('0x4c')](_0x24ef88,_0xbd89('0x1cb'));};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1cc')]=function(_0x3f87f6){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1cd'),_0x3f87f6['label']));if(!this[_0xbd89('0x81')](_0x3f87f6[_0xbd89('0x158')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x3f87f6,_0xbd89('0x157'));}logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbd89('0xe')]['callerid'],_0x3f87f6[_0xbd89('0x158')]));var _0x1f4420=this['agentUnpause'][_0xbd89('0x68')](this,_0x3f87f6[_0xbd89('0x158')]);if(_0x1f4420){logger['info'](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this['channel']['callerid'],_0x3f87f6['findBy']));this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0x15a'),this['channel']['callerid'],_0x3f87f6[_0xbd89('0x158')]));return{'code':0xc8,'result':_0xbd89('0x160')};}else{logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3f87f6[_0xbd89('0x158')]));this['channel'][_0xbd89('0xa5')](util['format'](_0xbd89('0x15b'),this[_0xbd89('0xe')][_0xbd89('0x36')],_0x3f87f6['findBy']));return{'code':0xc8,'result':_0xbd89('0x15c')};}};AGIVertices[_0xbd89('0x10')][_0xbd89('0x1ce')]=function(_0x46c0a0){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1cf'),_0x46c0a0[_0xbd89('0x33')]));var _0x435aea=this[_0xbd89('0xe')][_0xbd89('0x51')](_0xbd89('0x1d0'),[_0x46c0a0['mailbox'],_0x46c0a0[_0xbd89('0x72')]]);if(_0x435aea[_0xbd89('0xa0')]===-0x1){return _0x435aea;}return this[_0xbd89('0xe')][_0xbd89('0xa5')](util[_0xbd89('0x4f')](_0xbd89('0xbd'),_0xbd89('0x1d0'),_0x46c0a0['mailbox']));};AGIVertices['prototype']['vswitch']=function(_0x52f202){logger[_0xbd89('0x2a')](util[_0xbd89('0x4f')](_0xbd89('0x1d1'),_0x52f202[_0xbd89('0x33')]));if(!this[_0xbd89('0x81')](_0x52f202[_0xbd89('0xd6')])){return this[_0xbd89('0xe')][_0xbd89('0x4c')](_0x52f202,_0xbd89('0x1b2'));}var _0x3271af=this[_0xbd89('0x11')][_0xbd89('0x68')](this,_0x52f202[_0xbd89('0xd6')]);if(!_0x3271af){return this[_0xbd89('0xe')]['error'](_0x52f202,_0xbd89('0x112'));}var _0x1b529e=this[_0xbd89('0xe')][_0xbd89('0x11')](_0x3271af);return{'code':0xc8,'result':_0x1b529e['extra']?_0x1b529e['extra']:'-'};};String[_0xbd89('0x10')][_0xbd89('0x9d')]=function(_0x4de452,_0x59b9e5){return this[_0xbd89('0x9c')](_0x4de452)[_0xbd89('0x1d2')](_0x59b9e5);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index fa82480..b716838 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 _0xd8b3=['YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','update','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format'];(function(_0x3f8556,_0x2218ef){var _0x20a940=function(_0x26d861){while(--_0x26d861){_0x3f8556['push'](_0x3f8556['shift']());}};_0x20a940(++_0x2218ef);}(_0xd8b3,0xd2));var _0x3d8b=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0xd8b3[_0x38c699];return _0x3b1ded;};'use strict';var util=require(_0x3d8b('0x0'));var _=require(_0x3d8b('0x1'));var moment=require('moment');var ami=require(_0x3d8b('0x2'));var logger=require(_0x3d8b('0x3'))(_0x3d8b('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x21006f){this[_0x3d8b('0x5')]=_0x21006f[_0x3d8b('0x5')];this[_0x3d8b('0x6')]=_0x21006f[_0x3d8b('0x6')];this[_0x3d8b('0x7')]=_0x21006f[_0x3d8b('0x7')];this['channels']={};ami['on'](_0x3d8b('0x8'),this['syncAgentConnect'][_0x3d8b('0x9')](this));ami['on'](_0x3d8b('0xa'),this['syncHangupRequest'][_0x3d8b('0x9')](this));ami['on']('hangup',this[_0x3d8b('0xb')]['bind'](this));ami['on'](_0x3d8b('0xc'),this[_0x3d8b('0xd')][_0x3d8b('0x9')](this));ami['on'](_0x3d8b('0xe'),this[_0x3d8b('0xf')][_0x3d8b('0x9')](this));ami['on'](_0x3d8b('0x10'),this[_0x3d8b('0x11')]['bind'](this));ami['on'](_0x3d8b('0x12'),this[_0x3d8b('0x13')][_0x3d8b('0x9')](this));}function getDiff(_0x101f31){var _0x216f29=moment()['milliseconds'](0x0);var _0x39fea3=moment(_0x101f31)['milliseconds'](0x0);return _0x216f29[_0x3d8b('0x14')](_0x39fea3,_0x3d8b('0x15'));}Acw[_0x3d8b('0x16')][_0x3d8b('0x17')]=function(_0x303c66){try{var _0x8dc9cb=this;var _0x552e83=this[_0x3d8b('0x18')][_0x303c66][_0x3d8b('0x19')];var _0x151915=this['channels'][_0x303c66]['queue'];var _0x5ccc67=this[_0x3d8b('0x5')][_0x151915];var _0x53787d=![];var _0x4ce2f4=_0x3d8b('0x1a');if(_0x5ccc67[_0x3d8b('0x1b')]){if(_0x5ccc67[_0x3d8b('0x1c')][_0x3d8b('0x1d')]){_0x53787d=!![];_0x4ce2f4=_0x5ccc67[_0x3d8b('0x1c')]['name'];}}ami[_0x3d8b('0x1e')]({'action':'QueuePause','interface':_0x552e83,'paused':!![],'reason':_0x4ce2f4})[_0x3d8b('0x1f')](function(_0x4a1da9){if(_0x8dc9cb[_0x3d8b('0x6')][_0x552e83]){return RpcUser[_0x3d8b('0x20')](_0x8dc9cb['agents'][_0x552e83]['id'])[_0x3d8b('0x1f')](function(_0x151de8){if(_0x151de8&&!_0x151de8[_0x3d8b('0x21')]){logger[_0x3d8b('0x22')](_0x3d8b('0x23'),_0x303c66,_0x552e83,_0x151915);var _0x222db5=_0x8dc9cb['channels'][_0x303c66][_0x3d8b('0x24')]&&_0x8dc9cb[_0x3d8b('0x18')][_0x303c66]['destlinkedid']?_0x8dc9cb[_0x3d8b('0x18')][_0x303c66][_0x3d8b('0x25')]:_0x303c66;return RpcUser[_0x3d8b('0x26')](_0x8dc9cb[_0x3d8b('0x6')][_0x552e83],_0x4ce2f4,_0x222db5)[_0x3d8b('0x1f')](function(_0x17ec81){if(!_0x53787d){_0x8dc9cb['timers'][_0x552e83]={};logger[_0x3d8b('0x22')](_0x3d8b('0x27'),_0x303c66,_0x8dc9cb[_0x3d8b('0x5')][_0x151915]['acwTimeout'],_0x552e83,_0x151915);_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x28')]=setTimeout(_0x8dc9cb[_0x3d8b('0x29')]['bind'](_0x8dc9cb,_0x552e83),_0x8dc9cb[_0x3d8b('0x5')][_0x151915][_0x3d8b('0x2a')]*0x3e8);_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x2b')]=moment()[_0x3d8b('0x2c')](_0x3d8b('0x2d'));_0x8dc9cb['timers'][_0x552e83]['uniqueid']=_0x303c66;_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x2e')]=_0x151915;_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x2f')]=function(){var _0x58d5ae=getDiff(_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x2b')]);clearTimeout(_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x28')]);_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x28')]=![];RpcVoiceAgentReport[_0x3d8b('0x30')]({'acwtime':_0x58d5ae},_0x8dc9cb[_0x3d8b('0x7')][_0x552e83][_0x3d8b('0x31')],_0x552e83)['then'](function(_0x36a4d3){logger[_0x3d8b('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x303c66,_0x58d5ae,_0x36a4d3);})[_0x3d8b('0x32')](function(_0x45c533){logger[_0x3d8b('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x303c66,_0x45c533);});delete _0x8dc9cb[_0x3d8b('0x7')][_0x552e83];};}});}else{logger[_0x3d8b('0x22')](_0x3d8b('0x34'),_0x303c66,_0x552e83,_0x151915);}});}})['catch'](function(_0x13c6dc){logger['error'](_0x3d8b('0x27'),_0x303c66,_0x8dc9cb[_0x3d8b('0x5')][_0x151915][_0x3d8b('0x2a')],_0x552e83,_0x151915);})[_0x3d8b('0x35')](function(){delete _0x8dc9cb[_0x3d8b('0x18')][_0x303c66];});}catch(_0xd3d9c7){logger['error'](_0x3d8b('0x36'),_0xd3d9c7['message']);}};Acw[_0x3d8b('0x16')][_0x3d8b('0x29')]=function(_0x19df4c){try{var _0x2e44a0=this;if(_0x2e44a0[_0x3d8b('0x7')][_0x19df4c]){_0x2e44a0[_0x3d8b('0x7')][_0x19df4c][_0x3d8b('0x28')]=![];var _0x3bd8ac=_0x2e44a0[_0x3d8b('0x7')][_0x19df4c]['uniqueid'];var _0x16f66=_0x2e44a0[_0x3d8b('0x7')][_0x19df4c]['queue'];var _0x9084a1=_0x2e44a0[_0x3d8b('0x5')][_0x16f66][_0x3d8b('0x2a')];logger[_0x3d8b('0x22')](_0x3d8b('0x37'),_0x3bd8ac,_0x19df4c);RpcUser['saveUnpause'](this['agents'][_0x19df4c]);RpcVoiceAgentReport[_0x3d8b('0x30')]({'acwtime':_0x9084a1,'agentacw':!![]},_0x3bd8ac,_0x19df4c)[_0x3d8b('0x1f')](function(_0x3107c9){logger[_0x3d8b('0x22')](_0x3d8b('0x38'),_0x3bd8ac,_0x9084a1,_0x3107c9);})['catch'](function(_0x2a0c93){logger['error'](_0x3d8b('0x39'),_0x3bd8ac,_0x2a0c93);});}else{logger['error'](_0x3d8b('0x3a'),_0x19df4c);if(_0x2e44a0[_0x3d8b('0x7')]){logger[_0x3d8b('0x22')](_0x3d8b('0x3b'),JSON[_0x3d8b('0x3c')](_0x2e44a0[_0x3d8b('0x7')]));}}}catch(_0x3deb5c){logger[_0x3d8b('0x33')](_0x3d8b('0x3d'),_0x3deb5c[_0x3d8b('0x3e')]);}};Acw[_0x3d8b('0x16')][_0x3d8b('0x3f')]=function(_0x5759e6){try{if(this[_0x3d8b('0x5')][_0x5759e6[_0x3d8b('0x2e')]]&&(this[_0x3d8b('0x5')][_0x5759e6[_0x3d8b('0x2e')]][_0x3d8b('0x4')]||this[_0x3d8b('0x5')][_0x5759e6[_0x3d8b('0x2e')]][_0x3d8b('0x1b')])){if(this[_0x3d8b('0x6')][_0x5759e6['interface']]){this['channels'][_0x5759e6[_0x3d8b('0x31')]]={'queue':_0x5759e6[_0x3d8b('0x2e')],'interface':_0x5759e6[_0x3d8b('0x19')],'destlinkedid':_0x5759e6[_0x3d8b('0x25')]};}}}catch(_0x144e54){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x144e54[_0x3d8b('0x3e')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4d6b13){try{if(this['voiceQueues'][_0x4d6b13['queue']]&&(this[_0x3d8b('0x5')][_0x4d6b13[_0x3d8b('0x2e')]]['acw']||this[_0x3d8b('0x5')][_0x4d6b13[_0x3d8b('0x2e')]][_0x3d8b('0x1b')])){if(this['agents'][_0x4d6b13[_0x3d8b('0x19')]]){this[_0x3d8b('0x18')][_0x4d6b13['uniqueid']]={'queue':_0x4d6b13[_0x3d8b('0x2e')],'interface':_0x4d6b13[_0x3d8b('0x19')]};}}}catch(_0x325a2b){logger[_0x3d8b('0x33')](_0x3d8b('0x40'),_0x325a2b[_0x3d8b('0x3e')]);}};Acw[_0x3d8b('0x16')][_0x3d8b('0x41')]=function(_0x592d9d){try{if(this[_0x3d8b('0x18')][_0x592d9d[_0x3d8b('0x31')]]&&_[_0x3d8b('0x42')](this[_0x3d8b('0x18')][_0x592d9d[_0x3d8b('0x31')]][_0x3d8b('0x24')])){logger[_0x3d8b('0x22')](_0x3d8b('0x43'),_0x592d9d[_0x3d8b('0x31')]);this[_0x3d8b('0x17')](_0x592d9d[_0x3d8b('0x31')]);}else if(this[_0x3d8b('0x18')][_0x592d9d[_0x3d8b('0x44')]]&&_['isUndefined'](this[_0x3d8b('0x18')][_0x592d9d['linkedid']]['attended'])){logger[_0x3d8b('0x22')](_0x3d8b('0x45'),_0x592d9d[_0x3d8b('0x44')]);this[_0x3d8b('0x17')](_0x592d9d[_0x3d8b('0x44')]);}}catch(_0x569cd2){logger[_0x3d8b('0x33')](_0x3d8b('0x46'),_0x569cd2[_0x3d8b('0x3e')]);}};Acw[_0x3d8b('0x16')][_0x3d8b('0xb')]=function(_0x1a5eb3){try{if(this[_0x3d8b('0x18')][_0x1a5eb3[_0x3d8b('0x31')]]&&this[_0x3d8b('0x18')][_0x1a5eb3[_0x3d8b('0x31')]][_0x3d8b('0x24')]){logger[_0x3d8b('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1a5eb3[_0x3d8b('0x31')]);this[_0x3d8b('0x17')](_0x1a5eb3[_0x3d8b('0x31')]);}else if(this['channels'][_0x1a5eb3[_0x3d8b('0x44')]]&&this[_0x3d8b('0x18')][_0x1a5eb3[_0x3d8b('0x44')]][_0x3d8b('0x24')]){logger[_0x3d8b('0x22')](_0x3d8b('0x47'),_0x1a5eb3[_0x3d8b('0x44')]);this[_0x3d8b('0x17')](_0x1a5eb3['linkedid']);}}catch(_0xf37fae){logger[_0x3d8b('0x33')](_0x3d8b('0x48'),_0xf37fae[_0x3d8b('0x3e')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x8c165){try{if(!_['isNil'](this['channels'][_0x8c165[_0x3d8b('0x49')]])){this[_0x3d8b('0x17')](_0x8c165[_0x3d8b('0x49')]);if(this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4a')]]){this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4a')]][_0x3d8b('0x24')]=!![];this[_0x3d8b('0x18')][_0x8c165['transfertargetuniqueid']]=this['channels'][_0x8c165['secondtransfereruniqueid']];delete this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4a')]];}}else if(!_['isNil'](this['channels'][_0x8c165['transfertargetuniqueid']])){this['startAcw'](_0x8c165['transfertargetuniqueid']);if(this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4b')]]){this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4b')]][_0x3d8b('0x24')]=!![];this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x49')]]=this['channels'][_0x8c165[_0x3d8b('0x4b')]];delete this[_0x3d8b('0x18')][_0x8c165[_0x3d8b('0x4b')]];}}}catch(_0x2c3c62){logger[_0x3d8b('0x33')](_0x3d8b('0x4c'),_0x2c3c62[_0x3d8b('0x3e')]);}};Acw[_0x3d8b('0x16')]['syncBlindTransfer']=function(_0x10cc2b){try{if(this[_0x3d8b('0x18')][_0x10cc2b[_0x3d8b('0x4d')]]){logger[_0x3d8b('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x10cc2b[_0x3d8b('0x4d')]));this[_0x3d8b('0x17')](_0x10cc2b[_0x3d8b('0x4d')]);}else if(this['channels'][_0x10cc2b[_0x3d8b('0x4e')]]){logger[_0x3d8b('0x22')](_0x3d8b('0x4f'),JSON['stringify'](_0x10cc2b[_0x3d8b('0x4e')]));this[_0x3d8b('0x17')](_0x10cc2b['transfererlinkedid']);}}catch(_0x49f9a1){logger[_0x3d8b('0x33')](_0x3d8b('0x50'),_0x49f9a1[_0x3d8b('0x3e')]);}};Acw[_0x3d8b('0x16')][_0x3d8b('0xd')]=function(_0x3a2c02){try{if(this['voiceQueues'][_0x3a2c02[_0x3d8b('0x2e')]]&&this[_0x3d8b('0x5')][_0x3a2c02['queue']][_0x3d8b('0x51')]==='all'){if(this['agents'][_0x3a2c02[_0x3d8b('0x19')]]){logger[_0x3d8b('0x22')](_0x3d8b('0x52'),_0x3a2c02[_0x3d8b('0x31')],_0x3a2c02['interface'],_0x3a2c02[_0x3d8b('0x2e')]);return RpcUser['savePause'](this[_0x3d8b('0x6')][_0x3a2c02[_0x3d8b('0x19')]],'Auto-Pause',_0x3a2c02[_0x3d8b('0x31')]);}}}catch(_0x14c880){logger[_0x3d8b('0x33')](_0x3d8b('0x53'),_0x14c880[_0x3d8b('0x3e')]);}};module[_0x3d8b('0x54')]=Acw; \ No newline at end of file +var _0xfe06=['secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','channels','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','timer','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid'];(function(_0x475835,_0x3dd122){var _0x496aed=function(_0x24ab63){while(--_0x24ab63){_0x475835['push'](_0x475835['shift']());}};_0x496aed(++_0x3dd122);}(_0xfe06,0xb9));var _0x6fe0=function(_0x5ddec1,_0x330a4c){_0x5ddec1=_0x5ddec1-0x0;var _0x26a61=_0xfe06[_0x5ddec1];return _0x26a61;};'use strict';var util=require(_0x6fe0('0x0'));var _=require(_0x6fe0('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require('../../../config/logger')(_0x6fe0('0x2'));var RpcUser=require(_0x6fe0('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4194bb){this['voiceQueues']=_0x4194bb[_0x6fe0('0x4')];this[_0x6fe0('0x5')]=_0x4194bb[_0x6fe0('0x5')];this[_0x6fe0('0x6')]=_0x4194bb[_0x6fe0('0x6')];this['channels']={};ami['on'](_0x6fe0('0x7'),this['syncAgentConnect'][_0x6fe0('0x8')](this));ami['on'](_0x6fe0('0x9'),this[_0x6fe0('0xa')][_0x6fe0('0x8')](this));ami['on'](_0x6fe0('0xb'),this[_0x6fe0('0xc')][_0x6fe0('0x8')](this));ami['on'](_0x6fe0('0xd'),this[_0x6fe0('0xe')][_0x6fe0('0x8')](this));ami['on'](_0x6fe0('0xf'),this[_0x6fe0('0x10')][_0x6fe0('0x8')](this));ami['on'](_0x6fe0('0x11'),this[_0x6fe0('0x12')]['bind'](this));ami['on'](_0x6fe0('0x13'),this[_0x6fe0('0x14')]['bind'](this));}function getDiff(_0x34c6dd){var _0xc44627=moment()['milliseconds'](0x0);var _0x28cb08=moment(_0x34c6dd)[_0x6fe0('0x15')](0x0);return _0xc44627['diff'](_0x28cb08,_0x6fe0('0x16'));}Acw[_0x6fe0('0x17')][_0x6fe0('0x18')]=function(_0xbb72d4){try{var _0x12a5ca=this;var _0x91a3db=this[_0x6fe0('0x19')][_0xbb72d4][_0x6fe0('0x1a')];var _0x24c90a=this[_0x6fe0('0x19')][_0xbb72d4][_0x6fe0('0x1b')];var _0x107428=this[_0x6fe0('0x4')][_0x24c90a];var _0x3dc43e=![];var _0x491c37=_0x6fe0('0x1c');if(_0x107428['mandatoryDisposition']){if(_0x107428[_0x6fe0('0x1d')][_0x6fe0('0x1e')]){_0x3dc43e=!![];_0x491c37=_0x107428[_0x6fe0('0x1d')][_0x6fe0('0x1e')];}}ami[_0x6fe0('0x1f')]({'action':_0x6fe0('0x20'),'interface':_0x91a3db,'paused':!![],'reason':_0x491c37})['then'](function(_0x86b98c){if(_0x12a5ca[_0x6fe0('0x5')][_0x91a3db]){return RpcUser[_0x6fe0('0x21')](_0x12a5ca['agents'][_0x91a3db]['id'])[_0x6fe0('0x22')](function(_0x1c427f){if(_0x1c427f&&!_0x1c427f['voicePause']){logger[_0x6fe0('0x23')](_0x6fe0('0x24'),_0xbb72d4,_0x91a3db,_0x24c90a);var _0x3fc2d4=_0x12a5ca[_0x6fe0('0x19')][_0xbb72d4][_0x6fe0('0x25')]&&_0x12a5ca[_0x6fe0('0x19')][_0xbb72d4][_0x6fe0('0x26')]?_0x12a5ca[_0x6fe0('0x19')][_0xbb72d4]['destlinkedid']:_0xbb72d4;return RpcUser[_0x6fe0('0x27')](_0x12a5ca[_0x6fe0('0x5')][_0x91a3db],_0x491c37,_0x3fc2d4)[_0x6fe0('0x22')](function(_0xd60df4){if(!_0x3dc43e){_0x12a5ca[_0x6fe0('0x6')][_0x91a3db]={};logger[_0x6fe0('0x23')](_0x6fe0('0x28'),_0xbb72d4,_0x12a5ca[_0x6fe0('0x4')][_0x24c90a][_0x6fe0('0x29')],_0x91a3db,_0x24c90a);_0x12a5ca['timers'][_0x91a3db]['timer']=setTimeout(_0x12a5ca[_0x6fe0('0x2a')][_0x6fe0('0x8')](_0x12a5ca,_0x91a3db),_0x12a5ca[_0x6fe0('0x4')][_0x24c90a][_0x6fe0('0x29')]*0x3e8);_0x12a5ca['timers'][_0x91a3db][_0x6fe0('0x2b')]=moment()[_0x6fe0('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x12a5ca['timers'][_0x91a3db][_0x6fe0('0x2d')]=_0xbb72d4;_0x12a5ca[_0x6fe0('0x6')][_0x91a3db][_0x6fe0('0x1b')]=_0x24c90a;_0x12a5ca[_0x6fe0('0x6')][_0x91a3db][_0x6fe0('0x2e')]=function(){var _0xf4a87d=getDiff(_0x12a5ca[_0x6fe0('0x6')][_0x91a3db][_0x6fe0('0x2b')]);clearTimeout(_0x12a5ca[_0x6fe0('0x6')][_0x91a3db]['timer']);_0x12a5ca[_0x6fe0('0x6')][_0x91a3db]['timer']=![];RpcVoiceAgentReport[_0x6fe0('0x2f')]({'acwtime':_0xf4a87d},_0x12a5ca[_0x6fe0('0x6')][_0x91a3db][_0x6fe0('0x2d')],_0x91a3db)[_0x6fe0('0x22')](function(_0x21c9da){logger[_0x6fe0('0x23')](_0x6fe0('0x30'),_0xbb72d4,_0xf4a87d,_0x21c9da);})['catch'](function(_0x22a653){logger[_0x6fe0('0x31')](_0x6fe0('0x32'),_0xbb72d4,_0x22a653);});delete _0x12a5ca[_0x6fe0('0x6')][_0x91a3db];};}});}else{logger['info'](_0x6fe0('0x33'),_0xbb72d4,_0x91a3db,_0x24c90a);}});}})[_0x6fe0('0x34')](function(_0x19b53e){logger[_0x6fe0('0x31')](_0x6fe0('0x28'),_0xbb72d4,_0x12a5ca[_0x6fe0('0x4')][_0x24c90a][_0x6fe0('0x29')],_0x91a3db,_0x24c90a);})['finally'](function(){delete _0x12a5ca[_0x6fe0('0x19')][_0xbb72d4];});}catch(_0x5d284a){logger['error'](_0x6fe0('0x35'),_0x5d284a[_0x6fe0('0x36')]);}};Acw['prototype'][_0x6fe0('0x2a')]=function(_0x603936){try{var _0x43362f=this;if(_0x43362f[_0x6fe0('0x6')][_0x603936]){_0x43362f[_0x6fe0('0x6')][_0x603936][_0x6fe0('0x37')]=![];var _0x322f7d=_0x43362f['timers'][_0x603936][_0x6fe0('0x2d')];var _0x4ca9c5=_0x43362f[_0x6fe0('0x6')][_0x603936][_0x6fe0('0x1b')];var _0x13e406=_0x43362f[_0x6fe0('0x4')][_0x4ca9c5][_0x6fe0('0x29')];logger[_0x6fe0('0x23')](_0x6fe0('0x38'),_0x322f7d,_0x603936);RpcUser['saveUnpause'](this[_0x6fe0('0x5')][_0x603936]);RpcVoiceAgentReport['update']({'acwtime':_0x13e406,'agentacw':!![]},_0x322f7d,_0x603936)[_0x6fe0('0x22')](function(_0x4af226){logger[_0x6fe0('0x23')](_0x6fe0('0x30'),_0x322f7d,_0x13e406,_0x4af226);})[_0x6fe0('0x34')](function(_0x433df7){logger[_0x6fe0('0x31')](_0x6fe0('0x32'),_0x322f7d,_0x433df7);});}else{logger[_0x6fe0('0x31')](_0x6fe0('0x39'),_0x603936);if(_0x43362f['timers']){logger[_0x6fe0('0x23')](_0x6fe0('0x3a'),JSON[_0x6fe0('0x3b')](_0x43362f[_0x6fe0('0x6')]));}}}catch(_0x194c07){logger[_0x6fe0('0x31')](_0x6fe0('0x3c'),_0x194c07[_0x6fe0('0x36')]);}};Acw['prototype'][_0x6fe0('0x3d')]=function(_0x25a82f){try{if(this[_0x6fe0('0x4')][_0x25a82f[_0x6fe0('0x1b')]]&&(this[_0x6fe0('0x4')][_0x25a82f['queue']][_0x6fe0('0x2')]||this[_0x6fe0('0x4')][_0x25a82f[_0x6fe0('0x1b')]][_0x6fe0('0x3e')])){if(this[_0x6fe0('0x5')][_0x25a82f[_0x6fe0('0x1a')]]){this[_0x6fe0('0x19')][_0x25a82f[_0x6fe0('0x2d')]]={'queue':_0x25a82f[_0x6fe0('0x1b')],'interface':_0x25a82f['interface'],'destlinkedid':_0x25a82f[_0x6fe0('0x26')]};}}}catch(_0x2f48d5){logger[_0x6fe0('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x2f48d5[_0x6fe0('0x36')]);}};Acw[_0x6fe0('0x17')]['syncAgentConnectPreview']=function(_0xcef03d){try{if(this['voiceQueues'][_0xcef03d['queue']]&&(this[_0x6fe0('0x4')][_0xcef03d['queue']]['acw']||this[_0x6fe0('0x4')][_0xcef03d[_0x6fe0('0x1b')]][_0x6fe0('0x3e')])){if(this['agents'][_0xcef03d[_0x6fe0('0x1a')]]){this[_0x6fe0('0x19')][_0xcef03d[_0x6fe0('0x2d')]]={'queue':_0xcef03d[_0x6fe0('0x1b')],'interface':_0xcef03d['interface']};}}}catch(_0x62aebb){logger[_0x6fe0('0x31')](_0x6fe0('0x3f'),_0x62aebb[_0x6fe0('0x36')]);}};Acw[_0x6fe0('0x17')][_0x6fe0('0xa')]=function(_0xe5adb){try{if(this[_0x6fe0('0x19')][_0xe5adb[_0x6fe0('0x2d')]]&&_[_0x6fe0('0x40')](this[_0x6fe0('0x19')][_0xe5adb[_0x6fe0('0x2d')]][_0x6fe0('0x25')])){logger[_0x6fe0('0x23')]('[%s][HANGUP:UNIQUEID]',_0xe5adb[_0x6fe0('0x2d')]);this[_0x6fe0('0x18')](_0xe5adb[_0x6fe0('0x2d')]);}else if(this[_0x6fe0('0x19')][_0xe5adb[_0x6fe0('0x41')]]&&_['isUndefined'](this[_0x6fe0('0x19')][_0xe5adb['linkedid']][_0x6fe0('0x25')])){logger['info'](_0x6fe0('0x42'),_0xe5adb[_0x6fe0('0x41')]);this[_0x6fe0('0x18')](_0xe5adb[_0x6fe0('0x41')]);}}catch(_0x69a629){logger['error'](_0x6fe0('0x43'),_0x69a629[_0x6fe0('0x36')]);}};Acw[_0x6fe0('0x17')][_0x6fe0('0xc')]=function(_0x11e98a){try{if(this[_0x6fe0('0x19')][_0x11e98a['uniqueid']]&&this[_0x6fe0('0x19')][_0x11e98a['uniqueid']]['attended']){logger[_0x6fe0('0x23')](_0x6fe0('0x44'),_0x11e98a[_0x6fe0('0x2d')]);this[_0x6fe0('0x18')](_0x11e98a[_0x6fe0('0x2d')]);}else if(this[_0x6fe0('0x19')][_0x11e98a[_0x6fe0('0x41')]]&&this['channels'][_0x11e98a[_0x6fe0('0x41')]][_0x6fe0('0x25')]){logger[_0x6fe0('0x23')](_0x6fe0('0x45'),_0x11e98a[_0x6fe0('0x41')]);this[_0x6fe0('0x18')](_0x11e98a[_0x6fe0('0x41')]);}}catch(_0x5e3e93){logger[_0x6fe0('0x31')](_0x6fe0('0x46'),_0x5e3e93[_0x6fe0('0x36')]);}};Acw[_0x6fe0('0x17')][_0x6fe0('0x10')]=function(_0x3cca0c){try{if(!_[_0x6fe0('0x47')](this[_0x6fe0('0x19')][_0x3cca0c['transfereeuniqueid']])){this[_0x6fe0('0x18')](_0x3cca0c[_0x6fe0('0x48')]);if(this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x49')]]){this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x49')]][_0x6fe0('0x25')]=!![];this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x4a')]]=this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x49')]];delete this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x49')]];}}else if(!_[_0x6fe0('0x47')](this[_0x6fe0('0x19')][_0x3cca0c['transfertargetuniqueid']])){this[_0x6fe0('0x18')](_0x3cca0c['transfertargetuniqueid']);if(this[_0x6fe0('0x19')][_0x3cca0c['origtransfereruniqueid']]){this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x4b')]]['attended']=!![];this[_0x6fe0('0x19')][_0x3cca0c[_0x6fe0('0x48')]]=this[_0x6fe0('0x19')][_0x3cca0c['origtransfereruniqueid']];delete this['channels'][_0x3cca0c['origtransfereruniqueid']];}}}catch(_0x4bb3b2){logger[_0x6fe0('0x31')](_0x6fe0('0x4c'),_0x4bb3b2[_0x6fe0('0x36')]);}};Acw['prototype'][_0x6fe0('0x12')]=function(_0x1c9f72){try{if(this[_0x6fe0('0x19')][_0x1c9f72[_0x6fe0('0x4d')]]){logger[_0x6fe0('0x23')](_0x6fe0('0x4e'),JSON[_0x6fe0('0x3b')](_0x1c9f72[_0x6fe0('0x4d')]));this[_0x6fe0('0x18')](_0x1c9f72['transfereruniqueid']);}else if(this['channels'][_0x1c9f72[_0x6fe0('0x4f')]]){logger['info'](_0x6fe0('0x50'),JSON[_0x6fe0('0x3b')](_0x1c9f72[_0x6fe0('0x4f')]));this['startAcw'](_0x1c9f72[_0x6fe0('0x4f')]);}}catch(_0x369b9e){logger[_0x6fe0('0x31')](_0x6fe0('0x51'),_0x369b9e[_0x6fe0('0x36')]);}};Acw[_0x6fe0('0x17')][_0x6fe0('0xe')]=function(_0x23ced4){try{if(this['voiceQueues'][_0x23ced4[_0x6fe0('0x1b')]]&&this[_0x6fe0('0x4')][_0x23ced4[_0x6fe0('0x1b')]]['autopause']===_0x6fe0('0x52')){if(this[_0x6fe0('0x5')][_0x23ced4[_0x6fe0('0x1a')]]){logger[_0x6fe0('0x23')](_0x6fe0('0x53'),_0x23ced4[_0x6fe0('0x2d')],_0x23ced4['interface'],_0x23ced4[_0x6fe0('0x1b')]);return RpcUser[_0x6fe0('0x27')](this[_0x6fe0('0x5')][_0x23ced4[_0x6fe0('0x1a')]],_0x6fe0('0x54'),_0x23ced4['uniqueid']);}}}catch(_0x14c51d){logger['error'](_0x6fe0('0x55'),_0x14c51d[_0x6fe0('0x36')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index e902b1f..47339bd 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 _0x5e3b=['password','keepConnected','Action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','error','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','actionCoreShowChannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','catch','log','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port'];(function(_0x10f161,_0x153d1e){var _0xace7e6=function(_0x33c56f){while(--_0x33c56f){_0x10f161['push'](_0x10f161['shift']());}};_0xace7e6(++_0x153d1e);}(_0x5e3b,0xd5));var _0xb5e3=function(_0x29206e,_0x1dd5f0){_0x29206e=_0x29206e-0x0;var _0x44463d=_0x5e3b[_0x29206e];return _0x44463d;};'use strict';var Manager=require(_0xb5e3('0x0'));var BPromise=require(_0xb5e3('0x1'));var moment=require('moment');var util=require(_0xb5e3('0x2'));var _=require(_0xb5e3('0x3'));var logger=require(_0xb5e3('0x4'))(_0xb5e3('0x5'));var config=require(_0xb5e3('0x6'));var ami=new Manager(config[_0xb5e3('0x7')][_0xb5e3('0x8')],config[_0xb5e3('0x7')]['ip'],config['asterisk']['username'],config['asterisk'][_0xb5e3('0x9')],!![]);ami[_0xb5e3('0xa')]();ami[_0xb5e3('0xb')]=BPromise['promisify'](ami['action']);function error(_0x567c68){logger['error'](util[_0xb5e3('0xc')](_0xb5e3('0xd'),config[_0xb5e3('0x7')][_0xb5e3('0xe')],config[_0xb5e3('0x7')]['ip'],config[_0xb5e3('0x7')]['port'],util['inspect'](_0x567c68,![],null)));}function close(){logger[_0xb5e3('0xf')](util[_0xb5e3('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xb5e3('0x7')]['username'],config[_0xb5e3('0x7')]['ip'],config[_0xb5e3('0x7')][_0xb5e3('0x8')]));}ami[_0xb5e3('0x10')]=function(){return function(){return ami[_0xb5e3('0xb')]({'action':_0xb5e3('0x11')});};};ami[_0xb5e3('0x12')]=function(){return function(){return ami[_0xb5e3('0xb')]({'action':_0xb5e3('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xb5e3('0xb')]({'action':'sippeerstatus'});};};ami[_0xb5e3('0x14')]=function(){return function(){return ami[_0xb5e3('0xb')]({'action':_0xb5e3('0x15')});};};ami[_0xb5e3('0x16')]=function(){return function(){return ami[_0xb5e3('0xb')]({'action':'coreshowchannels'});};};function connect(_0x13c770){logger[_0xb5e3('0x17')](util[_0xb5e3('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0xb5e3('0xe')],config['asterisk']['ip'],config['asterisk'][_0xb5e3('0x8')]));ami[_0xb5e3('0x18')](_0xb5e3('0xf'),error);ami['once'](_0xb5e3('0x19'),close);}ami['on'](_0xb5e3('0x1a'),connect);ami['on'](_0xb5e3('0x1b'),function(_0x55a3a5){logger[_0xb5e3('0x17')](util[_0xb5e3('0xc')](_0xb5e3('0x1c'),config[_0xb5e3('0x7')][_0xb5e3('0xe')],config[_0xb5e3('0x7')]['ip'],config[_0xb5e3('0x7')][_0xb5e3('0x8')],util[_0xb5e3('0x1d')](_0x55a3a5,![],null)));});ami['on'](_0xb5e3('0x1e'),function(_0xd9dd0d){logger[_0xb5e3('0x17')](util['format'](_0xb5e3('0x1f'),config[_0xb5e3('0x7')][_0xb5e3('0xe')],config[_0xb5e3('0x7')]['ip'],config[_0xb5e3('0x7')][_0xb5e3('0x8')]));return BPromise[_0xb5e3('0x20')]()[_0xb5e3('0x21')](ami[_0xb5e3('0x10')]())[_0xb5e3('0x21')](ami[_0xb5e3('0x12')]())['then'](ami[_0xb5e3('0x22')]())['then'](ami[_0xb5e3('0x14')]())[_0xb5e3('0x21')](ami['actionCoreShowChannels']())[_0xb5e3('0x23')](function(_0x536fba){console[_0xb5e3('0x24')](_0x536fba);});});ami[_0xb5e3('0x18')](_0xb5e3('0xf'),error);ami[_0xb5e3('0x18')](_0xb5e3('0x19'),close);module['exports']=ami; \ No newline at end of file +var _0xea61=['exports','asterisk-manager','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionCoreShowChannels','log'];(function(_0x59ea44,_0x1c1958){var _0x47c1e5=function(_0x3abf54){while(--_0x3abf54){_0x59ea44['push'](_0x59ea44['shift']());}};_0x47c1e5(++_0x1c1958);}(_0xea61,0x9d));var _0x1ea6=function(_0x29c65b,_0xe629a7){_0x29c65b=_0x29c65b-0x0;var _0x290a00=_0xea61[_0x29c65b];return _0x290a00;};'use strict';var Manager=require(_0x1ea6('0x0'));var BPromise=require(_0x1ea6('0x1'));var moment=require('moment');var util=require(_0x1ea6('0x2'));var _=require(_0x1ea6('0x3'));var logger=require(_0x1ea6('0x4'))(_0x1ea6('0x5'));var config=require(_0x1ea6('0x6'));var ami=new Manager(config[_0x1ea6('0x7')][_0x1ea6('0x8')],config[_0x1ea6('0x7')]['ip'],config[_0x1ea6('0x7')][_0x1ea6('0x9')],config[_0x1ea6('0x7')][_0x1ea6('0xa')],!![]);ami['keepConnected']();ami[_0x1ea6('0xb')]=BPromise[_0x1ea6('0xc')](ami[_0x1ea6('0xd')]);function error(_0x2fc67f){logger[_0x1ea6('0xe')](util[_0x1ea6('0xf')](_0x1ea6('0x10'),config[_0x1ea6('0x7')]['username'],config[_0x1ea6('0x7')]['ip'],config[_0x1ea6('0x7')][_0x1ea6('0x8')],util[_0x1ea6('0x11')](_0x2fc67f,![],null)));}function close(){logger[_0x1ea6('0xe')](util[_0x1ea6('0xf')](_0x1ea6('0x12'),config[_0x1ea6('0x7')]['username'],config['asterisk']['ip'],config[_0x1ea6('0x7')]['port']));}ami[_0x1ea6('0x13')]=function(){return function(){return ami['Action']({'action':_0x1ea6('0x14')});};};ami[_0x1ea6('0x15')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0x1ea6('0x16')]=function(){return function(){return ami[_0x1ea6('0xb')]({'action':_0x1ea6('0x17')});};};ami[_0x1ea6('0x18')]=function(){return function(){return ami[_0x1ea6('0xb')]({'action':_0x1ea6('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x1ea6('0x1a')});};};function connect(_0x338126){logger[_0x1ea6('0x1b')](util[_0x1ea6('0xf')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x1ea6('0x7')][_0x1ea6('0x9')],config[_0x1ea6('0x7')]['ip'],config[_0x1ea6('0x7')][_0x1ea6('0x8')]));ami[_0x1ea6('0x1c')](_0x1ea6('0xe'),error);ami['once'](_0x1ea6('0x1d'),close);}ami['on'](_0x1ea6('0x1e'),connect);ami['on'](_0x1ea6('0x1f'),function(_0x4f40fe){logger[_0x1ea6('0x1b')](util['format'](_0x1ea6('0x20'),config[_0x1ea6('0x7')][_0x1ea6('0x9')],config[_0x1ea6('0x7')]['ip'],config['asterisk']['port'],util[_0x1ea6('0x11')](_0x4f40fe,![],null)));});ami['on'](_0x1ea6('0x21'),function(_0x555eaa){logger['info'](util[_0x1ea6('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x1ea6('0x7')][_0x1ea6('0x9')],config[_0x1ea6('0x7')]['ip'],config[_0x1ea6('0x7')]['port']));return BPromise[_0x1ea6('0x22')]()[_0x1ea6('0x23')](ami['actionSipShowRegistry']())[_0x1ea6('0x23')](ami[_0x1ea6('0x15')]())['then'](ami[_0x1ea6('0x16')]())[_0x1ea6('0x23')](ami[_0x1ea6('0x18')]())[_0x1ea6('0x23')](ami[_0x1ea6('0x24')]())['catch'](function(_0x1c0bc8){console[_0x1ea6('0x25')](_0x1c0bc8);});});ami[_0x1ea6('0x1c')](_0x1ea6('0xe'),error);ami[_0x1ea6('0x1c')](_0x1ea6('0x1d'),close);module[_0x1ea6('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a76dcb7..02edf00 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 _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x323c60,_0x219b72){var _0x103f23=function(_0x7695b3){while(--_0x7695b3){_0x323c60['push'](_0x323c60['shift']());}};_0x103f23(++_0x219b72);}(_0x9bde,0xe1));var _0xe9bd=function(_0xe68266,_0x95a6e3){_0xe68266=_0xe68266-0x0;var _0x5bd0d3=_0x9bde[_0xe68266];return _0x5bd0d3;};'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 +var _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x3855b5,_0x54efb3){var _0x162047=function(_0x29205c){while(--_0x29205c){_0x3855b5['push'](_0x3855b5['shift']());}};_0x162047(++_0x54efb3);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x12950d,_0x1b889b){_0x12950d=_0x12950d-0x0;var _0x55c9b3=_0x9ffd[_0x12950d];return _0x55c9b3;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index b52a885..d54a626 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 _0x3a71=['recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','exports','lodash','moment','string','isNil','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat'];(function(_0x4c2c23,_0x3d8d28){var _0x5c992e=function(_0x5cfed7){while(--_0x5cfed7){_0x4c2c23['push'](_0x4c2c23['shift']());}};_0x5c992e(++_0x3d8d28);}(_0x3a71,0xb8));var _0x13a7=function(_0x12eb2a,_0x5df46a){_0x12eb2a=_0x12eb2a-0x0;var _0x526096=_0x3a71[_0x12eb2a];return _0x526096;};'use strict';var util=require('util');var _=require(_0x13a7('0x0'));var moment=require(_0x13a7('0x1'));function checkNameSurname(_0x2aa700,_0x36df45,_0x5abe27){var _0x50dbc1='';if(!_['isNil'](_0x36df45)&&_0x13a7('0x2')===typeof _0x36df45){_0x50dbc1+=_0x36df45;}if(!_[_0x13a7('0x3')](_0x5abe27)&&_0x13a7('0x2')===typeof _0x5abe27){_0x50dbc1+='\x20'+_0x5abe27;}if(_0x50dbc1!==''){return _0x50dbc1;}return _0x2aa700;}function Action(_0x1f5779,_0x58d134,_0x52c370){this[_0x13a7('0x4')]=_0x1f5779;this[_0x13a7('0x5')]=_0x52c370||undefined;this['name']=checkNameSurname(_0x58d134[_0x13a7('0x6')][_0x13a7('0x7')],_0x58d134[_0x13a7('0x6')][_0x13a7('0x8')],_0x58d134['Contact'][_0x13a7('0x9')]);this[_0x13a7('0xa')]=_0x58d134[_0x13a7('0x6')][_0x13a7('0x7')];this[_0x13a7('0xb')]=_0x1f5779[_0x13a7('0xc')];this[_0x13a7('0xd')]=_0x58d134[_0x13a7('0xd')]||![];this[_0x13a7('0xe')]=_0x1f5779[_0x13a7('0xe')];this['dialQueueTimeout']=_0x1f5779[_0x13a7('0xf')]||0x3;this[_0x13a7('0x10')]=_0x58d134['scheduledat'];this['countbusyretry']=_0x58d134[_0x13a7('0x11')];this[_0x13a7('0x12')]=_0x58d134[_0x13a7('0x12')];this['countnoanswerretry']=_0x58d134[_0x13a7('0x13')];this[_0x13a7('0x14')]=_0x58d134[_0x13a7('0x14')];this[_0x13a7('0x15')]=_0x58d134[_0x13a7('0x15')];this[_0x13a7('0x16')]=_0x58d134[_0x13a7('0x16')];this[_0x13a7('0x17')]=_0x58d134[_0x13a7('0x17')];this[_0x13a7('0x18')]=_0x58d134[_0x13a7('0x18')];this[_0x13a7('0x19')]=_0x58d134[_0x13a7('0x19')];this[_0x13a7('0x1a')]=_0x58d134['ListId'];this[_0x13a7('0x1b')]=_0x58d134[_0x13a7('0x1b')];this['VoiceQueueId']=_0x58d134[_0x13a7('0x1c')];this[_0x13a7('0x1d')]=_0x58d134[_0x13a7('0x1d')];this['idHopper']=_0x58d134['id'];this[_0x13a7('0x1e')]=_0x58d134[_0x13a7('0x6')]['firstName']||'';this[_0x13a7('0x1f')]=moment()[_0x13a7('0x20')](_0x13a7('0x21'));this[_0x13a7('0x22')]=_0x58d134['callback'];this['callbackuniqueid']=_0x58d134['callbackuniqueid'];this['callbackat']=_0x58d134[_0x13a7('0x23')];this[_0x13a7('0x24')]=_0x58d134[_0x13a7('0x24')];this[_0x13a7('0x25')]='';this['originatecalleridname']='';}Action[_0x13a7('0x26')][_0x13a7('0x27')]=function(){return util[_0x13a7('0x20')](_0x13a7('0x28'),this[_0x13a7('0xc')],this[_0x13a7('0x4')][_0x13a7('0x29')]>0x0?this[_0x13a7('0xa')][_0x13a7('0x2a')](this[_0x13a7('0x4')][_0x13a7('0x29')]):this[_0x13a7('0xa')]);};Action[_0x13a7('0x26')]['getQueue']=function(){return this[_0x13a7('0xb')];};module[_0x13a7('0x2b')]=Action; \ No newline at end of file +var _0x72e5=['YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x72e5,0xbe));var _0x572e=function(_0x5a0086,_0x3c3ab5){_0x5a0086=_0x5a0086-0x0;var _0x53b512=_0x72e5[_0x5a0086];return _0x53b512;};'use strict';var util=require(_0x572e('0x0'));var _=require(_0x572e('0x1'));var moment=require(_0x572e('0x2'));function checkNameSurname(_0x10e9ef,_0x44ba2,_0x1c7e79){var _0x2139ed='';if(!_[_0x572e('0x3')](_0x44ba2)&&_0x572e('0x4')===typeof _0x44ba2){_0x2139ed+=_0x44ba2;}if(!_[_0x572e('0x3')](_0x1c7e79)&&'string'===typeof _0x1c7e79){_0x2139ed+='\x20'+_0x1c7e79;}if(_0x2139ed!==''){return _0x2139ed;}return _0x10e9ef;}function Action(_0x2b0f7a,_0x21b69a,_0x1374bb){this[_0x572e('0x5')]=_0x2b0f7a;this[_0x572e('0x6')]=_0x1374bb||undefined;this['name']=checkNameSurname(_0x21b69a[_0x572e('0x7')]['phone'],_0x21b69a[_0x572e('0x7')][_0x572e('0x8')],_0x21b69a[_0x572e('0x7')][_0x572e('0x9')]);this['number']=_0x21b69a[_0x572e('0x7')]['phone'];this[_0x572e('0xa')]=_0x2b0f7a[_0x572e('0xb')];this[_0x572e('0xc')]=_0x21b69a[_0x572e('0xc')]||![];this[_0x572e('0xd')]=_0x2b0f7a[_0x572e('0xd')];this[_0x572e('0xe')]=_0x2b0f7a[_0x572e('0xe')]||0x3;this[_0x572e('0xf')]=_0x21b69a[_0x572e('0xf')];this[_0x572e('0x10')]=_0x21b69a['countbusyretry'];this[_0x572e('0x11')]=_0x21b69a[_0x572e('0x11')];this['countnoanswerretry']=_0x21b69a['countnoanswerretry'];this['countnosuchnumberretry']=_0x21b69a[_0x572e('0x12')];this['countdropretry']=_0x21b69a['countdropretry'];this[_0x572e('0x13')]=_0x21b69a['countabandonedretry'];this[_0x572e('0x14')]=_0x21b69a[_0x572e('0x14')];this[_0x572e('0x15')]=_0x21b69a[_0x572e('0x15')];this[_0x572e('0x16')]=_0x21b69a[_0x572e('0x16')];this['ListId']=_0x21b69a[_0x572e('0x17')];this[_0x572e('0x18')]=_0x21b69a['UserId'];this[_0x572e('0x19')]=_0x21b69a[_0x572e('0x19')];this[_0x572e('0x1a')]=_0x21b69a[_0x572e('0x1a')];this[_0x572e('0x1b')]=_0x21b69a['id'];this['ContactFirstName']=_0x21b69a[_0x572e('0x7')][_0x572e('0x8')]||'';this[_0x572e('0x1c')]=moment()[_0x572e('0x1d')](_0x572e('0x1e'));this[_0x572e('0x1f')]=_0x21b69a[_0x572e('0x1f')];this['callbackuniqueid']=_0x21b69a['callbackuniqueid'];this[_0x572e('0x20')]=_0x21b69a[_0x572e('0x20')];this[_0x572e('0x21')]=_0x21b69a[_0x572e('0x21')];this[_0x572e('0x22')]='';this[_0x572e('0x23')]='';}Action[_0x572e('0x24')][_0x572e('0x25')]=function(){return util[_0x572e('0x1d')](_0x572e('0x26'),this[_0x572e('0xb')],this[_0x572e('0x5')][_0x572e('0x27')]>0x0?this[_0x572e('0x28')][_0x572e('0x29')](this['voiceQueue'][_0x572e('0x27')]):this[_0x572e('0x28')]);};Action[_0x572e('0x24')][_0x572e('0x2a')]=function(){return this['queue'];};module[_0x572e('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9096aa5..c4aafed 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 _0x726f=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x247380,_0x20f201){var _0x3f34cd=function(_0x591e67){while(--_0x591e67){_0x247380['push'](_0x247380['shift']());}};_0x3f34cd(++_0x20f201);}(_0x726f,0x1ca));var _0xf726=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x726f[_0xfae23b];return _0x200640;};'use strict';var util=require(_0xf726('0x0'));var _=require(_0xf726('0x1'));var moment=require(_0xf726('0x2'));function getSeconds(_0x4514bb,_0x126b5b){var _0x363b06=moment(_0x4514bb)[_0xf726('0x3')](0x0);var _0x1a0f1e=moment(_0x126b5b)[_0xf726('0x3')](0x0);return _0x363b06[_0xf726('0x4')](_0x1a0f1e,_0xf726('0x5'));}function AgentComplete(_0x581e5b,_0x5446bd){this[_0xf726('0x6')]=0x4;this['statedesc']=_0xf726('0x7');this['scheduledat']=_0x581e5b['scheduledat'];this[_0xf726('0x8')]=_0x581e5b[_0xf726('0x8')];this[_0xf726('0x9')]=_0x581e5b['type']===_0xf726('0xa')?_0xf726('0xb'):_0x581e5b[_0xf726('0x8')];this['countbusyretry']=_0x581e5b[_0xf726('0xc')];this[_0xf726('0xd')]=_0x581e5b['countcongestionretry'];this[_0xf726('0xe')]=_0x581e5b[_0xf726('0xe')];this[_0xf726('0xf')]=_0x581e5b['countbusyretry']+_0x581e5b[_0xf726('0xd')]+_0x581e5b[_0xf726('0xe')]+_0x581e5b[_0xf726('0x10')]+_0x581e5b['countdropretry']+_0x581e5b[_0xf726('0x11')]+_0x581e5b[_0xf726('0x12')]+_0x581e5b[_0xf726('0x13')];this['countnosuchnumberretry']=_0x581e5b[_0xf726('0x10')];this[_0xf726('0x14')]=_0x581e5b[_0xf726('0x14')];this[_0xf726('0x11')]=_0x581e5b[_0xf726('0x11')];this['countmachineretry']=_0x581e5b[_0xf726('0x12')];this[_0xf726('0x13')]=_0x581e5b[_0xf726('0x13')];this[_0xf726('0x15')]=_0x5446bd[_0xf726('0x15')];this['calleridname']=_0x581e5b[_0xf726('0x16')];this[_0xf726('0x17')]=_0x581e5b[_0xf726('0x18')];this[_0xf726('0x19')]=_0x581e5b['starttime'];this[_0xf726('0x1a')]=_0x581e5b['responsetime'];this[_0xf726('0x1b')]=_0x581e5b[_0xf726('0x1b')];this[_0xf726('0x1c')]=moment()[_0xf726('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x581e5b[_0xf726('0x1a')],_0x581e5b[_0xf726('0x19')]);this['holdtime']=getSeconds(_0x581e5b[_0xf726('0x1b')],_0x581e5b[_0xf726('0x1a')]);this[_0xf726('0x1e')]=getSeconds(this[_0xf726('0x1c')],_0x581e5b[_0xf726('0x1b')]);this[_0xf726('0xb')]=_0x5446bd[_0xf726('0xb')];this[_0xf726('0x1f')]=_0x5446bd['membername'];this[_0xf726('0x20')]=_0x5446bd[_0xf726('0x20')];this[_0xf726('0x21')]=_0x581e5b[_0xf726('0x21')];this[_0xf726('0x22')]=_0x581e5b[_0xf726('0x22')];this[_0xf726('0x23')]=_0x581e5b[_0xf726('0x23')];this['recallme']=_0x581e5b[_0xf726('0x24')];this[_0xf726('0x25')]=_0x581e5b[_0xf726('0x25')];this[_0xf726('0x26')]=_0x581e5b[_0xf726('0x26')];this[_0xf726('0x27')]=_0x581e5b[_0xf726('0x27')];this['VoiceQueueId']=_0x581e5b[_0xf726('0x28')];this['CampaignId']=_0x581e5b[_0xf726('0x29')];this[_0xf726('0x2a')]=_0x581e5b[_0xf726('0x2a')]||'';this[_0xf726('0x2b')]=_0x581e5b['originatecalleridname']||'';}module[_0xf726('0x2c')]=AgentComplete; \ No newline at end of file +var _0xec5b=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','number','starttime'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xec5b,0x175));var _0xbec5=function(_0x218fd8,_0x44c72c){_0x218fd8=_0x218fd8-0x0;var _0x4dc2e3=_0xec5b[_0x218fd8];return _0x4dc2e3;};'use strict';var util=require(_0xbec5('0x0'));var _=require('lodash');var moment=require(_0xbec5('0x1'));function getSeconds(_0x4bf879,_0x332835){var _0x2b1b43=moment(_0x4bf879)['milliseconds'](0x0);var _0x1370c4=moment(_0x332835)[_0xbec5('0x2')](0x0);return _0x2b1b43[_0xbec5('0x3')](_0x1370c4,_0xbec5('0x4'));}function AgentComplete(_0x5a9301,_0x304310){this[_0xbec5('0x5')]=0x4;this[_0xbec5('0x6')]=_0xbec5('0x7');this[_0xbec5('0x8')]=_0x5a9301[_0xbec5('0x8')];this[_0xbec5('0x9')]=_0x5a9301['type'];this['campaigntype']=_0x5a9301['type']===_0xbec5('0xa')?'queue':_0x5a9301['type'];this[_0xbec5('0xb')]=_0x5a9301[_0xbec5('0xb')];this[_0xbec5('0xc')]=_0x5a9301[_0xbec5('0xc')];this[_0xbec5('0xd')]=_0x5a9301[_0xbec5('0xd')];this['countglobal']=_0x5a9301[_0xbec5('0xb')]+_0x5a9301[_0xbec5('0xc')]+_0x5a9301[_0xbec5('0xd')]+_0x5a9301['countnosuchnumberretry']+_0x5a9301[_0xbec5('0xe')]+_0x5a9301['countabandonedretry']+_0x5a9301[_0xbec5('0xf')]+_0x5a9301[_0xbec5('0x10')];this[_0xbec5('0x11')]=_0x5a9301['countnosuchnumberretry'];this[_0xbec5('0xe')]=_0x5a9301[_0xbec5('0xe')];this[_0xbec5('0x12')]=_0x5a9301[_0xbec5('0x12')];this[_0xbec5('0xf')]=_0x5a9301[_0xbec5('0xf')];this[_0xbec5('0x10')]=_0x5a9301[_0xbec5('0x10')];this[_0xbec5('0x13')]=_0x304310['uniqueid'];this[_0xbec5('0x14')]=_0x5a9301['name'];this['calleridnum']=_0x5a9301[_0xbec5('0x15')];this[_0xbec5('0x16')]=_0x5a9301['starttime'];this[_0xbec5('0x17')]=_0x5a9301[_0xbec5('0x17')];this['answertime']=_0x5a9301[_0xbec5('0x18')];this[_0xbec5('0x19')]=moment()[_0xbec5('0x1a')](_0xbec5('0x1b'));this[_0xbec5('0x1c')]=getSeconds(_0x5a9301['responsetime'],_0x5a9301[_0xbec5('0x16')]);this[_0xbec5('0x1d')]=getSeconds(_0x5a9301[_0xbec5('0x18')],_0x5a9301['responsetime']);this['talktime']=getSeconds(this[_0xbec5('0x19')],_0x5a9301[_0xbec5('0x18')]);this['queue']=_0x304310['queue'];this[_0xbec5('0x1e')]=_0x304310[_0xbec5('0x1e')];this['reason']=_0x304310[_0xbec5('0x1f')];this[_0xbec5('0x20')]=_0x5a9301[_0xbec5('0x20')];this[_0xbec5('0x21')]=_0x5a9301[_0xbec5('0x21')];this[_0xbec5('0x22')]=_0x5a9301[_0xbec5('0x22')];this['recallme']=_0x5a9301[_0xbec5('0x23')];this[_0xbec5('0x24')]=_0x5a9301['ContactId'];this[_0xbec5('0x25')]=_0x5a9301[_0xbec5('0x25')];this[_0xbec5('0x26')]=_0x5a9301[_0xbec5('0x26')];this[_0xbec5('0x27')]=_0x5a9301[_0xbec5('0x27')];this[_0xbec5('0x28')]=_0x5a9301['CampaignId'];this[_0xbec5('0x29')]=_0x5a9301[_0xbec5('0x29')]||'';this[_0xbec5('0x2a')]=_0x5a9301[_0xbec5('0x2a')]||'';}module[_0xbec5('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 4330ec8..81bc8b6 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 _0x3248=['type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countmachineretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat'];(function(_0xdc627,_0x4ad1a){var _0x1dd362=function(_0x380bd8){while(--_0x380bd8){_0xdc627['push'](_0xdc627['shift']());}};_0x1dd362(++_0x4ad1a);}(_0x3248,0x1b0));var _0x8324=function(_0x507e42,_0x412ea6){_0x507e42=_0x507e42-0x0;var _0x473aef=_0x3248[_0x507e42];return _0x473aef;};'use strict';var util=require(_0x8324('0x0'));var _=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));function getSeconds(_0x36a586,_0x9b580){var _0x23b671=moment(_0x36a586)[_0x8324('0x3')](0x0);var _0x5a7e4d=moment(_0x9b580)['milliseconds'](0x0);return _0x23b671[_0x8324('0x4')](_0x5a7e4d,_0x8324('0x5'));}function Final(_0x584b6e){this[_0x8324('0x6')]=_0x584b6e[_0x8324('0x6')];this[_0x8324('0x7')]=_0x584b6e[_0x8324('0x7')];this[_0x8324('0x8')]=_0x584b6e['type'];this[_0x8324('0x9')]=_0x584b6e[_0x8324('0x8')]===_0x8324('0xa')?'queue':_0x584b6e['type'];this[_0x8324('0xb')]=_0x584b6e[_0x8324('0xb')];this[_0x8324('0xc')]=_0x584b6e['countcongestionretry'];this[_0x8324('0xd')]=_0x584b6e[_0x8324('0xd')];this[_0x8324('0xe')]=_0x584b6e[_0x8324('0xb')]+_0x584b6e[_0x8324('0xc')]+_0x584b6e[_0x8324('0xd')]+_0x584b6e['countnosuchnumberretry']+_0x584b6e['countdropretry']+_0x584b6e['countabandonedretry']+_0x584b6e[_0x8324('0xf')]+_0x584b6e['countagentrejectretry'];this['countnosuchnumberretry']=_0x584b6e[_0x8324('0x10')];this[_0x8324('0x11')]=_0x584b6e[_0x8324('0x11')];this['countabandonedretry']=_0x584b6e[_0x8324('0x12')];this[_0x8324('0xf')]=_0x584b6e[_0x8324('0xf')];this['countagentrejectretry']=_0x584b6e[_0x8324('0x13')];this[_0x8324('0x14')]=_0x584b6e[_0x8324('0x14')];this[_0x8324('0x15')]=_0x584b6e[_0x8324('0x15')];this[_0x8324('0x16')]=_0x584b6e['calleridnum'];this['starttime']=_0x584b6e[_0x8324('0x17')];this[_0x8324('0x18')]=_0x584b6e[_0x8324('0x18')];this['endtime']=_0x584b6e[_0x8324('0x18')];this[_0x8324('0x19')]=_0x584b6e[_0x8324('0x19')]||0x0;this[_0x8324('0x1a')]=_0x584b6e[_0x8324('0x1a')]||0x0;this['talktime']=_0x584b6e[_0x8324('0x1b')]||0x0;this['callback']=_0x584b6e[_0x8324('0x1c')];this['callbackuniqueid']=_0x584b6e[_0x8324('0x1d')];this['callbackat']=_0x584b6e[_0x8324('0x1e')];this[_0x8324('0x1f')]=_0x584b6e[_0x8324('0x1f')];this[_0x8324('0x20')]=_0x584b6e[_0x8324('0x20')];this[_0x8324('0x21')]=_0x584b6e[_0x8324('0x21')];this[_0x8324('0x22')]=_0x584b6e[_0x8324('0x22')];this[_0x8324('0x23')]=_0x584b6e[_0x8324('0x23')];this[_0x8324('0x24')]=_0x584b6e[_0x8324('0x24')];this[_0x8324('0x25')]=_0x584b6e[_0x8324('0x25')]||'';this[_0x8324('0x26')]=_0x584b6e[_0x8324('0x26')]||'';}module[_0x8324('0x27')]=Final; \ No newline at end of file +var _0xe14b=['lodash','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x1020d9,_0x34ef67){var _0x57479c=function(_0x3d6dbd){while(--_0x3d6dbd){_0x1020d9['push'](_0x1020d9['shift']());}};_0x57479c(++_0x34ef67);}(_0xe14b,0x93));var _0xbe14=function(_0xebf815,_0x296deb){_0xebf815=_0xebf815-0x0;var _0x5359a4=_0xe14b[_0xebf815];return _0x5359a4;};'use strict';var util=require(_0xbe14('0x0'));var _=require(_0xbe14('0x1'));var moment=require('moment');function getSeconds(_0x5cc4d8,_0x11c3a0){var _0x36393a=moment(_0x5cc4d8)['milliseconds'](0x0);var _0x7d3665=moment(_0x11c3a0)['milliseconds'](0x0);return _0x36393a['diff'](_0x7d3665,_0xbe14('0x2'));}function Final(_0x2d1a4a){this[_0xbe14('0x3')]=_0x2d1a4a[_0xbe14('0x3')];this[_0xbe14('0x4')]=_0x2d1a4a[_0xbe14('0x4')];this[_0xbe14('0x5')]=_0x2d1a4a['type'];this['campaigntype']=_0x2d1a4a['type']===_0xbe14('0x6')?_0xbe14('0x7'):_0x2d1a4a[_0xbe14('0x5')];this[_0xbe14('0x8')]=_0x2d1a4a['countbusyretry'];this['countcongestionretry']=_0x2d1a4a[_0xbe14('0x9')];this[_0xbe14('0xa')]=_0x2d1a4a['countnoanswerretry'];this[_0xbe14('0xb')]=_0x2d1a4a[_0xbe14('0x8')]+_0x2d1a4a[_0xbe14('0x9')]+_0x2d1a4a[_0xbe14('0xa')]+_0x2d1a4a[_0xbe14('0xc')]+_0x2d1a4a[_0xbe14('0xd')]+_0x2d1a4a[_0xbe14('0xe')]+_0x2d1a4a[_0xbe14('0xf')]+_0x2d1a4a[_0xbe14('0x10')];this[_0xbe14('0xc')]=_0x2d1a4a[_0xbe14('0xc')];this[_0xbe14('0xd')]=_0x2d1a4a[_0xbe14('0xd')];this['countabandonedretry']=_0x2d1a4a['countabandonedretry'];this[_0xbe14('0xf')]=_0x2d1a4a[_0xbe14('0xf')];this[_0xbe14('0x10')]=_0x2d1a4a[_0xbe14('0x10')];this['queue']=_0x2d1a4a[_0xbe14('0x7')];this[_0xbe14('0x11')]=_0x2d1a4a[_0xbe14('0x11')];this[_0xbe14('0x12')]=_0x2d1a4a[_0xbe14('0x12')];this[_0xbe14('0x13')]=_0x2d1a4a[_0xbe14('0x13')];this['responsetime']=_0x2d1a4a[_0xbe14('0x14')];this[_0xbe14('0x15')]=_0x2d1a4a[_0xbe14('0x14')];this[_0xbe14('0x16')]=_0x2d1a4a[_0xbe14('0x16')]||0x0;this[_0xbe14('0x17')]=_0x2d1a4a['holdtime']||0x0;this[_0xbe14('0x18')]=_0x2d1a4a[_0xbe14('0x18')]||0x0;this[_0xbe14('0x19')]=_0x2d1a4a[_0xbe14('0x19')];this[_0xbe14('0x1a')]=_0x2d1a4a['callbackuniqueid'];this[_0xbe14('0x1b')]=_0x2d1a4a['callbackat'];this[_0xbe14('0x1c')]=_0x2d1a4a['recallme'];this[_0xbe14('0x1d')]=_0x2d1a4a['ContactId'];this[_0xbe14('0x1e')]=_0x2d1a4a[_0xbe14('0x1e')];this['UserId']=_0x2d1a4a[_0xbe14('0x1f')];this['VoiceQueueId']=_0x2d1a4a[_0xbe14('0x20')];this['CampaignId']=_0x2d1a4a[_0xbe14('0x21')];this[_0xbe14('0x22')]=_0x2d1a4a[_0xbe14('0x22')]||'';this[_0xbe14('0x23')]=_0x2d1a4a[_0xbe14('0x23')]||'';}module[_0xbe14('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 8787a7f..0ea59ca 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 _0x40f2=['state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds'];(function(_0x323f51,_0x29ecaa){var _0x364d3b=function(_0x348d83){while(--_0x348d83){_0x323f51['push'](_0x323f51['shift']());}};_0x364d3b(++_0x29ecaa);}(_0x40f2,0x109));var _0x240f=function(_0x355068,_0x44d56b){_0x355068=_0x355068-0x0;var _0x31a402=_0x40f2[_0x355068];return _0x31a402;};'use strict';var util=require('util');var _=require(_0x240f('0x0'));var moment=require(_0x240f('0x1'));function getSeconds(_0x31b6bc,_0x5dca14){var _0x5a9583=moment(_0x31b6bc)[_0x240f('0x2')](0x0);var _0x1c80a8=moment(_0x5dca14)[_0x240f('0x2')](0x0);return _0x5a9583[_0x240f('0x3')](_0x1c80a8,_0x240f('0x4'));}function Hangup(_0x226e3e,_0x44418f){this[_0x240f('0x5')]=0x4;this[_0x240f('0x6')]='Answer';this[_0x240f('0x7')]=_0x226e3e[_0x240f('0x7')];this['type']=_0x226e3e[_0x240f('0x8')];this[_0x240f('0x9')]=_0x226e3e[_0x240f('0x8')]===_0x240f('0xa')?_0x240f('0xb'):_0x226e3e[_0x240f('0x8')];this[_0x240f('0xc')]=_0x226e3e[_0x240f('0xc')];this[_0x240f('0xd')]=_0x226e3e[_0x240f('0xd')];this['countnoanswerretry']=_0x226e3e[_0x240f('0xe')];this['countglobal']=_0x226e3e[_0x240f('0xc')]+_0x226e3e[_0x240f('0xd')]+_0x226e3e[_0x240f('0xe')]+_0x226e3e['countnosuchnumberretry']+_0x226e3e[_0x240f('0xf')]+_0x226e3e[_0x240f('0x10')]+_0x226e3e['countmachineretry']+_0x226e3e[_0x240f('0x11')];this[_0x240f('0x12')]=_0x226e3e[_0x240f('0x12')];this['countdropretry']=_0x226e3e['countdropretry'];this[_0x240f('0x10')]=_0x226e3e[_0x240f('0x10')];this[_0x240f('0x13')]=_0x226e3e[_0x240f('0x13')];this['countagentrejectretry']=_0x226e3e[_0x240f('0x11')];this[_0x240f('0x14')]=_0x44418f[_0x240f('0x14')];this[_0x240f('0x15')]=_0x226e3e[_0x240f('0x16')];this[_0x240f('0x17')]=_0x226e3e['number'];this[_0x240f('0x18')]=_0x226e3e['starttime'];this[_0x240f('0x19')]=_0x226e3e[_0x240f('0x19')];this[_0x240f('0x1a')]=moment()[_0x240f('0x1b')](_0x240f('0x1c'));this[_0x240f('0x1d')]=getSeconds(_0x226e3e[_0x240f('0x19')],_0x226e3e[_0x240f('0x18')]);this[_0x240f('0x1e')]=0x0;this[_0x240f('0x1f')]=getSeconds(this[_0x240f('0x1a')],_0x226e3e['responsetime']);this[_0x240f('0xb')]=_0x226e3e[_0x240f('0xb')];this[_0x240f('0x20')]=_0x240f('0x21');this[_0x240f('0x22')]=_0x44418f[_0x240f('0x23')];this['callback']=_0x226e3e[_0x240f('0x24')];this['callbackuniqueid']=_0x226e3e[_0x240f('0x25')];this[_0x240f('0x26')]=_0x226e3e[_0x240f('0x26')];this['recallme']=_0x226e3e[_0x240f('0x27')];this['ContactId']=_0x226e3e[_0x240f('0x28')];this[_0x240f('0x29')]=_0x226e3e[_0x240f('0x29')];this[_0x240f('0x2a')]=_0x226e3e[_0x240f('0x2a')];this[_0x240f('0x2b')]=_0x226e3e[_0x240f('0x2b')];this[_0x240f('0x2c')]=_0x226e3e['CampaignId'];}module['exports']=Hangup; \ No newline at end of file +var _0x4ddc=['CampaignId','exports','util','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x4ddc,0x173));var _0xc4dd=function(_0x1d112a,_0x4ab278){_0x1d112a=_0x1d112a-0x0;var _0x18a590=_0x4ddc[_0x1d112a];return _0x18a590;};'use strict';var util=require(_0xc4dd('0x0'));var _=require('lodash');var moment=require(_0xc4dd('0x1'));function getSeconds(_0x127315,_0x423721){var _0x34a124=moment(_0x127315)['milliseconds'](0x0);var _0x1dab9f=moment(_0x423721)[_0xc4dd('0x2')](0x0);return _0x34a124[_0xc4dd('0x3')](_0x1dab9f,_0xc4dd('0x4'));}function Hangup(_0x56ae11,_0x4caea2){this['state']=0x4;this[_0xc4dd('0x5')]=_0xc4dd('0x6');this[_0xc4dd('0x7')]=_0x56ae11['scheduledat'];this['type']=_0x56ae11[_0xc4dd('0x8')];this[_0xc4dd('0x9')]=_0x56ae11[_0xc4dd('0x8')]===_0xc4dd('0xa')?_0xc4dd('0xb'):_0x56ae11[_0xc4dd('0x8')];this[_0xc4dd('0xc')]=_0x56ae11[_0xc4dd('0xc')];this[_0xc4dd('0xd')]=_0x56ae11[_0xc4dd('0xd')];this['countnoanswerretry']=_0x56ae11['countnoanswerretry'];this[_0xc4dd('0xe')]=_0x56ae11[_0xc4dd('0xc')]+_0x56ae11[_0xc4dd('0xd')]+_0x56ae11[_0xc4dd('0xf')]+_0x56ae11[_0xc4dd('0x10')]+_0x56ae11[_0xc4dd('0x11')]+_0x56ae11[_0xc4dd('0x12')]+_0x56ae11[_0xc4dd('0x13')]+_0x56ae11[_0xc4dd('0x14')];this[_0xc4dd('0x10')]=_0x56ae11[_0xc4dd('0x10')];this[_0xc4dd('0x11')]=_0x56ae11[_0xc4dd('0x11')];this[_0xc4dd('0x12')]=_0x56ae11[_0xc4dd('0x12')];this[_0xc4dd('0x13')]=_0x56ae11[_0xc4dd('0x13')];this['countagentrejectretry']=_0x56ae11[_0xc4dd('0x14')];this[_0xc4dd('0x15')]=_0x4caea2[_0xc4dd('0x15')];this[_0xc4dd('0x16')]=_0x56ae11['name'];this[_0xc4dd('0x17')]=_0x56ae11['number'];this[_0xc4dd('0x18')]=_0x56ae11[_0xc4dd('0x18')];this[_0xc4dd('0x19')]=_0x56ae11[_0xc4dd('0x19')];this[_0xc4dd('0x1a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x56ae11[_0xc4dd('0x19')],_0x56ae11[_0xc4dd('0x18')]);this[_0xc4dd('0x1b')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x56ae11[_0xc4dd('0x19')]);this[_0xc4dd('0xb')]=_0x56ae11[_0xc4dd('0xb')];this[_0xc4dd('0x1c')]=_0xc4dd('0x1d');this[_0xc4dd('0x1e')]=_0x4caea2['cause-txt'];this[_0xc4dd('0x1f')]=_0x56ae11[_0xc4dd('0x1f')];this['callbackuniqueid']=_0x56ae11[_0xc4dd('0x20')];this['callbackat']=_0x56ae11[_0xc4dd('0x21')];this[_0xc4dd('0x22')]=_0x56ae11['recallme'];this[_0xc4dd('0x23')]=_0x56ae11['ContactId'];this[_0xc4dd('0x24')]=_0x56ae11[_0xc4dd('0x24')];this[_0xc4dd('0x25')]=_0x56ae11[_0xc4dd('0x25')];this['VoiceQueueId']=_0x56ae11[_0xc4dd('0x26')];this[_0xc4dd('0x27')]=_0x56ae11['CampaignId'];}module[_0xc4dd('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 3e440c4..167dccc 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 _0xd057=['originatecalleridnum','originatecalleridname','exports','util','lodash','diff','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','calleridname','name','number','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x406021,_0x34ea22){var _0x1c4723=function(_0x1286f4){while(--_0x1286f4){_0x406021['push'](_0x406021['shift']());}};_0x1c4723(++_0x34ea22);}(_0xd057,0x123));var _0x7d05=function(_0x1c6116,_0x2f48b8){_0x1c6116=_0x1c6116-0x0;var _0x40bc26=_0xd057[_0x1c6116];return _0x40bc26;};'use strict';var util=require(_0x7d05('0x0'));var _=require(_0x7d05('0x1'));var moment=require('moment');function getSeconds(_0x437143,_0x38d626){var _0x4e1685=moment(_0x437143)['milliseconds'](0x0);var _0x28553e=moment(_0x38d626)['milliseconds'](0x0);return _0x4e1685[_0x7d05('0x2')](_0x28553e,'seconds');}function History(_0x50f147){this[_0x7d05('0x3')]=_0x50f147[_0x7d05('0x3')];this[_0x7d05('0x4')]=_0x50f147[_0x7d05('0x4')]||undefined;this['type']=_0x50f147[_0x7d05('0x5')];this['campaigntype']=_0x50f147[_0x7d05('0x5')]===_0x7d05('0x6')?'queue':_0x50f147[_0x7d05('0x5')];this[_0x7d05('0x7')]=_0x50f147[_0x7d05('0x7')];this['countcongestionretry']=_0x50f147[_0x7d05('0x8')];this[_0x7d05('0x9')]=_0x50f147[_0x7d05('0x9')];this[_0x7d05('0xa')]=_0x50f147[_0x7d05('0x7')]+_0x50f147[_0x7d05('0x8')]+_0x50f147[_0x7d05('0x9')]+_0x50f147[_0x7d05('0xb')]+_0x50f147['countdropretry']+_0x50f147['countabandonedretry']+_0x50f147[_0x7d05('0xc')]+_0x50f147[_0x7d05('0xd')];this[_0x7d05('0xb')]=_0x50f147['countnosuchnumberretry'];this[_0x7d05('0xe')]=_0x50f147[_0x7d05('0xe')];this[_0x7d05('0xf')]=_0x50f147[_0x7d05('0xf')];this[_0x7d05('0xc')]=_0x50f147[_0x7d05('0xc')];this[_0x7d05('0xd')]=_0x50f147[_0x7d05('0xd')];this[_0x7d05('0x10')]=_0x50f147['queue'];this[_0x7d05('0x11')]=_0x50f147[_0x7d05('0x12')];this['calleridnum']=_0x50f147[_0x7d05('0x13')];this[_0x7d05('0x14')]=_0x50f147[_0x7d05('0x14')];this['responsetime']=_0x50f147[_0x7d05('0x15')];this['endtime']=_0x50f147['responsetime'];this[_0x7d05('0x16')]=getSeconds(_0x50f147[_0x7d05('0x15')],_0x50f147[_0x7d05('0x14')]);this[_0x7d05('0x17')]=0x0;this[_0x7d05('0x18')]=0x0;this[_0x7d05('0x19')]=_0x50f147[_0x7d05('0x19')];this[_0x7d05('0x1a')]=_0x50f147[_0x7d05('0x1a')];this[_0x7d05('0x1b')]=_0x50f147[_0x7d05('0x1b')];this[_0x7d05('0x1c')]=_0x50f147[_0x7d05('0x1c')];this[_0x7d05('0x1d')]=_0x50f147[_0x7d05('0x1d')];this[_0x7d05('0x1e')]=_0x50f147[_0x7d05('0x1e')];this['UserId']=_0x50f147['UserId'];this[_0x7d05('0x1f')]=_0x50f147[_0x7d05('0x1f')];this['CampaignId']=_0x50f147[_0x7d05('0x20')];this[_0x7d05('0x21')]=_0x50f147[_0x7d05('0x21')]||'';this['originatecalleridname']=_0x50f147[_0x7d05('0x22')]||'';}module[_0x7d05('0x23')]=History; \ No newline at end of file +var _0xdbc5=['moment','milliseconds','diff','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x4af5d9,_0x1198c8){var _0xf6a1fd=function(_0x4db7a7){while(--_0x4db7a7){_0x4af5d9['push'](_0x4af5d9['shift']());}};_0xf6a1fd(++_0x1198c8);}(_0xdbc5,0x1af));var _0x5dbc=function(_0x34d44f,_0x5dbe00){_0x34d44f=_0x34d44f-0x0;var _0x2b9d21=_0xdbc5[_0x34d44f];return _0x2b9d21;};'use strict';var util=require(_0x5dbc('0x0'));var _=require('lodash');var moment=require(_0x5dbc('0x1'));function getSeconds(_0x2d1a4c,_0x1db4f9){var _0x25a879=moment(_0x2d1a4c)[_0x5dbc('0x2')](0x0);var _0x259166=moment(_0x1db4f9)[_0x5dbc('0x2')](0x0);return _0x25a879[_0x5dbc('0x3')](_0x259166,'seconds');}function History(_0x199957){this[_0x5dbc('0x4')]=_0x199957[_0x5dbc('0x4')];this[_0x5dbc('0x5')]=_0x199957['scheduledat']||undefined;this[_0x5dbc('0x6')]=_0x199957['type'];this['campaigntype']=_0x199957[_0x5dbc('0x6')]==='outbound'?_0x5dbc('0x7'):_0x199957[_0x5dbc('0x6')];this[_0x5dbc('0x8')]=_0x199957['countbusyretry'];this[_0x5dbc('0x9')]=_0x199957['countcongestionretry'];this[_0x5dbc('0xa')]=_0x199957[_0x5dbc('0xa')];this[_0x5dbc('0xb')]=_0x199957[_0x5dbc('0x8')]+_0x199957['countcongestionretry']+_0x199957[_0x5dbc('0xa')]+_0x199957[_0x5dbc('0xc')]+_0x199957[_0x5dbc('0xd')]+_0x199957[_0x5dbc('0xe')]+_0x199957[_0x5dbc('0xf')]+_0x199957[_0x5dbc('0x10')];this[_0x5dbc('0xc')]=_0x199957[_0x5dbc('0xc')];this[_0x5dbc('0xd')]=_0x199957[_0x5dbc('0xd')];this[_0x5dbc('0xe')]=_0x199957[_0x5dbc('0xe')];this[_0x5dbc('0xf')]=_0x199957[_0x5dbc('0xf')];this[_0x5dbc('0x10')]=_0x199957[_0x5dbc('0x10')];this[_0x5dbc('0x7')]=_0x199957[_0x5dbc('0x7')];this[_0x5dbc('0x11')]=_0x199957[_0x5dbc('0x12')];this[_0x5dbc('0x13')]=_0x199957['number'];this['starttime']=_0x199957['starttime'];this[_0x5dbc('0x14')]=_0x199957[_0x5dbc('0x14')];this['endtime']=_0x199957[_0x5dbc('0x14')];this[_0x5dbc('0x15')]=getSeconds(_0x199957[_0x5dbc('0x14')],_0x199957['starttime']);this[_0x5dbc('0x16')]=0x0;this[_0x5dbc('0x17')]=0x0;this[_0x5dbc('0x18')]=_0x199957['callback'];this[_0x5dbc('0x19')]=_0x199957[_0x5dbc('0x19')];this[_0x5dbc('0x1a')]=_0x199957[_0x5dbc('0x1a')];this[_0x5dbc('0x1b')]=_0x199957[_0x5dbc('0x1b')];this[_0x5dbc('0x1c')]=_0x199957['ContactId'];this[_0x5dbc('0x1d')]=_0x199957[_0x5dbc('0x1d')];this[_0x5dbc('0x1e')]=_0x199957[_0x5dbc('0x1e')];this['VoiceQueueId']=_0x199957[_0x5dbc('0x1f')];this[_0x5dbc('0x20')]=_0x199957[_0x5dbc('0x20')];this['originatecalleridnum']=_0x199957[_0x5dbc('0x21')]||'';this[_0x5dbc('0x22')]=_0x199957[_0x5dbc('0x22')]||'';}module[_0x5dbc('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 183612e..68ba460 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 _0x5044=['command','iftime\x20%s,%s','true','content','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','dialMethod','power','handlePower','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueTimeout','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','Action','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','predictiveIntervalTotalCalls','[CatchErlangB]','outboundQueuePauses','busyFactor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','dialLimitQueue','not_inuse','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','agentcomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','message','[ifTime][Action]','Error','milliseconds','seconds','type','strategy','answered','loggedIn','sumBillable','sumHoldTime','talking','total','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','pTalking','sendMessageOneNotActive','available','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','isNil','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','status','reachable','SIP/%s','unmonitored','uniqueid','variable','exten','dialAMDActive','value','HANGUP','state','HangupInAMD','membername','AMD','emit','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countglobal','custom:amd','countbusyretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','CampaignId','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dropreason','TIMEOUT','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actions','channel','syncQueueMember','actionid','roundrobin','locked','paused','stateinterface','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push'];(function(_0x3051b2,_0x503ee3){var _0x595b21=function(_0x467ec0){while(--_0x467ec0){_0x3051b2['push'](_0x3051b2['shift']());}};_0x595b21(++_0x503ee3);}(_0x5044,0xc8));var _0x4504=function(_0x4a1fa1,_0x2db06b){_0x4a1fa1=_0x4a1fa1-0x0;var _0x21d32f=_0x5044[_0x4a1fa1];return _0x21d32f;};'use strict';var util=require('util');var _=require(_0x4504('0x0'));var BPromise=require('bluebird');var uuid=require(_0x4504('0x1'));var moment=require(_0x4504('0x2'));var rr=require('rr');var md5=require(_0x4504('0x3'));var Redis=require(_0x4504('0x4'));var ut=require(_0x4504('0x5'));var config=require(_0x4504('0x6'));var logger=require(_0x4504('0x7'))(_0x4504('0x8'));var loggerBooked=require('../../../config/logger')(_0x4504('0x9'));var loggerPredictive=require(_0x4504('0x7'))(_0x4504('0xa'));var loggerPredictiveCalls=require(_0x4504('0x7'))(_0x4504('0xb'));var loggerSyncQueueSummary=require(_0x4504('0x7'))(_0x4504('0xc'));var ami=require(_0x4504('0xd'));config[_0x4504('0xe')]=_['defaults'](config[_0x4504('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x4504('0xf'))(new Redis(config[_0x4504('0xe')]));var cmHopper=require(_0x4504('0x10'));var cmHopperHistory=require(_0x4504('0x11'));var cmHopperBlack=require(_0x4504('0x12'));var voiceQueueRt=require(_0x4504('0x13'));var Action=require(_0x4504('0x14'));var History=require(_0x4504('0x15'));var Final=require(_0x4504('0x16'));var AgentComplete=require(_0x4504('0x17'));var QueueCallerAbandon=require(_0x4504('0x18'));var Hangup=require(_0x4504('0x19'));var ipAgi=process[_0x4504('0x1a')]['XCALLY_IP_AGI']||_0x4504('0x1b');var strategy={'rrmemory':_0x4504('0x1c'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x4504('0x1d')][_0x4504('0x1e')]=function(_0x3cdd27){this[_0x4504('0x1f')]=this['tail']?this['tail'][_0x4504('0x20')](_0x3cdd27):_0x3cdd27();};function Dialer(_0x5a37cb,_0x1dbc83){this['sequence']=new Sequence();this[_0x4504('0x21')]=_0x1dbc83;this[_0x4504('0x22')]=_0x5a37cb[_0x4504('0x22')];this['campaigns']=_0x5a37cb[_0x4504('0x23')];this[_0x4504('0x24')]=_0x5a37cb[_0x4504('0x24')];this[_0x4504('0x25')]=_0x5a37cb[_0x4504('0x25')];this[_0x4504('0x26')]=config['maxNumberOriginate']||0x2;this['channels']={};this['actions']={};this[_0x4504('0x27')]={};this[_0x4504('0x28')]={};this[_0x4504('0x29')]={};this[_0x4504('0x2a')]={};this[_0x4504('0x2b')]={};this['ivrOriginated']={};this[_0x4504('0x2c')]={};this[_0x4504('0x2d')]={};ami['on'](_0x4504('0x2e'),this[_0x4504('0x2f')][_0x4504('0x30')](this));ami['on'](_0x4504('0x31'),this['syncQueueCallerAbandon'][_0x4504('0x30')](this));ami['on'](_0x4504('0x32'),this['syncOriginateResponse'][_0x4504('0x30')](this));ami['on'](_0x4504('0x33'),this['syncAgentComplete'][_0x4504('0x30')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0x4504('0x30')](this));ami['on'](_0x4504('0x34'),this[_0x4504('0x35')]['bind'](this));ami['on'](_0x4504('0x36'),this[_0x4504('0x37')][_0x4504('0x30')](this));ami['on'](_0x4504('0x38'),this[_0x4504('0x39')]['bind'](this));ami['on'](_0x4504('0x3a'),this['syncQueueMember'][_0x4504('0x30')](this));ami['on'](_0x4504('0x3b'),this[_0x4504('0x3c')][_0x4504('0x30')](this));this[_0x4504('0x3d')]();this[_0x4504('0x3e')]();}function isNotNull(_0x42971f){return _0x42971f!==null&&!_['isUndefined'](_0x42971f);}function checkIsLoggedIn(_0x206c92,_0x558dc4){return function(){if(_0x558dc4<=0x0){_0x206c92['message']=_0x4504('0x3f');throw _0x206c92[_0x4504('0x40')]+_0x4504('0x41');}};}function isActive(_0x17f296){return _0x17f296;}function checkIsActive(_0x33b18a,_0x5b2d9a){return function(){if(!isActive(_0x5b2d9a)){_0x33b18a['message']='NOT_ACTIVE';throw _0x33b18a[_0x4504('0x40')]+_0x4504('0x42');}};}function checkInterval(_0xd962b1){return function(){if(!isNotNull(_0xd962b1['Interval'])){_0xd962b1['message']=_0x4504('0x43');throw _0xd962b1['name']+_0x4504('0x44');}if(!isNotNull(_0xd962b1[_0x4504('0x45')]['Intervals'])){_0xd962b1[_0x4504('0x46')]=_0x4504('0x43');throw _0xd962b1[_0x4504('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0xd962b1[_0x4504('0x45')]['Intervals']))){_0xd962b1['message']=_0x4504('0x43');throw _0xd962b1[_0x4504('0x40')]+_0x4504('0x44');}};}function msgResponse(_0x55b9f0,_0x139186,_0x2cb8a1){return{'action':_0x55b9f0,'response':_0x139186,'message':_0x2cb8a1,'stack':_0x2cb8a1};}function myreject(_0x4db4b5){return function(_0xbfc307){return _0x4db4b5(msgResponse(_0x4504('0x47'),_0x4504('0x48'),JSON['stringify'](_0xbfc307)));};}function getSeconds(_0x2dfd61,_0x187473){var _0x3245ea=moment(_0x2dfd61)[_0x4504('0x49')](0x0);var _0x3aa56a=moment(_0x187473)[_0x4504('0x49')](0x0);return _0x3245ea['diff'](_0x3aa56a,_0x4504('0x4a'));}function emit(_0xac1d96,_0x12f366,_0x26a982){io['to'](_0xac1d96)['emit'](_0x12f366,_0x26a982);}function emitVoiceQueueSummary(_0x6128d6){if(_0x6128d6[_0x4504('0x4b')]==='outbound'){var _0x18bbb2={'id':_0x6128d6['id'],'name':_0x6128d6[_0x4504('0x40')],'strategy':_0x6128d6[_0x4504('0x4c')],'answered':_0x6128d6[_0x4504('0x4d')],'available':_0x6128d6['available'],'loggedIn':_0x6128d6[_0x4504('0x4e')],'pTalking':_0x6128d6['pTalking'],'sumBillable':_0x6128d6[_0x4504('0x4f')],'sumDuration':_0x6128d6['sumDuration'],'sumHoldTime':_0x6128d6[_0x4504('0x50')]||0x0,'talking':_0x6128d6[_0x4504('0x51')],'total':_0x6128d6[_0x4504('0x52')],'type':_0x6128d6[_0x4504('0x4b')],'unmanaged':_0x6128d6['unmanaged'],'abandoned':_0x6128d6['abandoned'],'waiting':_0x6128d6[_0x4504('0x53')],'loggedInDb':_0x6128d6[_0x4504('0x54')],'dialActive':_0x6128d6[_0x4504('0x55')],'dialMethod':_0x6128d6['dialMethod'],'dialOriginateCallerIdName':_0x6128d6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x6128d6[_0x4504('0x56')],'dialOriginateTimeout':_0x6128d6[_0x4504('0x57')],'dialPrefix':_0x6128d6['dialPrefix'],'outboundAnswerAgiCallsDay':_0x6128d6[_0x4504('0x58')],'outboundAnswerCallsDay':_0x6128d6[_0x4504('0x59')],'outboundBlacklistCallsDay':_0x6128d6[_0x4504('0x5a')],'outboundBusyCallsDay':_0x6128d6[_0x4504('0x5b')],'outboundCongestionCallsDay':_0x6128d6[_0x4504('0x5c')],'outboundDropCallsDayACS':_0x6128d6[_0x4504('0x5d')],'outboundDropCallsDayCallersExit':_0x6128d6['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x6128d6[_0x4504('0x5e')],'outboundNoAnswerCallsDay':_0x6128d6[_0x4504('0x5f')],'outboundNoSuchCallsDay':_0x6128d6[_0x4504('0x60')],'outboundOriginateFailureCallsDay':_0x6128d6[_0x4504('0x61')],'outboundReCallsDay':_0x6128d6[_0x4504('0x62')],'outboundRejectCallsDay':_0x6128d6[_0x4504('0x63')],'outboundUnknownCallsDay':_0x6128d6['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x6128d6[_0x4504('0x64')],'predictiveIntervalAvgHoldtime':_0x6128d6[_0x4504('0x65')],'predictiveIntervalAvgTalktime':_0x6128d6[_0x4504('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x6128d6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x6128d6[_0x4504('0x67')],'predictiveIntervalErlangCalls':_0x6128d6[_0x4504('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x6128d6[_0x4504('0x69')],'predictiveIntervalHitRate':_0x6128d6[_0x4504('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x6128d6[_0x4504('0x6b')],'predictiveIntervalPauses':_0x6128d6[_0x4504('0x6c')],'predictiveIntervalAvailable':_0x6128d6[_0x4504('0x6d')],'predictiveIntervalTotalCalls':_0x6128d6['predictiveIntervalTotalCalls'],'message':_0x6128d6[_0x4504('0x46')],'originated':_0x6128d6[_0x4504('0x6e')],'erlangCalls':_0x6128d6[_0x4504('0x6f')],'erlangCallToSecond':_0x6128d6[_0x4504('0x70')],'erlangAbandonmentRate':_0x6128d6[_0x4504('0x71')],'erlangBusyFactor':_0x6128d6[_0x4504('0x72')],'startPredictive':_0x6128d6[_0x4504('0x2a')],'startProgressive':_0x6128d6[_0x4504('0x2b')]};if(_0x6128d6['Trunk']){_0x18bbb2['Trunk']={'id':_0x6128d6['Trunk']['id'],'name':_0x6128d6[_0x4504('0x73')][_0x4504('0x40')],'active':_0x6128d6[_0x4504('0x73')][_0x4504('0x74')],'callerid':_0x6128d6[_0x4504('0x73')][_0x4504('0x75')]};}if(_0x6128d6[_0x4504('0x45')]){_0x18bbb2[_0x4504('0x45')]={'id':_0x6128d6[_0x4504('0x45')]['id'],'name':_0x6128d6[_0x4504('0x45')][_0x4504('0x40')]};}var _0x113949=md5(JSON[_0x4504('0x76')](_0x18bbb2));if(_0x6128d6[_0x4504('0x3')]!==_0x113949){_0x6128d6[_0x4504('0x3')]=_0x113949;emit(util[_0x4504('0x77')](_0x4504('0x78'),_0x18bbb2[_0x4504('0x40')]),'voice_queue:save',_0x18bbb2);}}}function emitCampaignSummary(_0x21d831){if(_0x21d831[_0x4504('0x4b')]===_0x4504('0x79')){emit(util['format'](_0x4504('0x7a'),_0x21d831[_0x4504('0x40')]),_0x4504('0x7b'),_0x21d831);}}function checkGetDataPredictive(_0x3e7169){if(isNotNull(_0x3e7169)&&!_[_0x4504('0x7c')](_0x3e7169)){loggerPredictive['info'](_0x4504('0x7d'));loggerPredictive[_0x4504('0x7e')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e7169['predictiveIntervalTotalCalls']);loggerPredictive[_0x4504('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e7169['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x4504('0x7f'),_0x3e7169[_0x4504('0x67')]);loggerPredictive[_0x4504('0x7e')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e7169[_0x4504('0x80')]);loggerPredictive['info'](_0x4504('0x81'),_0x3e7169['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x4504('0x7e')](_0x4504('0x82'),_0x3e7169[_0x4504('0x66')]);loggerPredictive[_0x4504('0x7e')]('---------------------------');if(_0x3e7169['predictiveIntervalTotalCalls']>0x0){if(!_[_0x4504('0x83')](_0x3e7169[_0x4504('0x66')])&&_0x3e7169[_0x4504('0x66')]>0x0){return!![];}loggerPredictive[_0x4504('0x7e')](_0x4504('0x84'));if(!_[_0x4504('0x83')](_0x3e7169['predictiveIntervalAvgHoldtime'])&&_0x3e7169['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x4504('0x7e')](_0x4504('0x85'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x4504('0x7e')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x3613b8){return function(_0x4d14c8){loggerPredictive[_0x4504('0x7e')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x4504('0x7e')](_0x4504('0x86'),_0x4d14c8['erlangCalls']);loggerPredictive[_0x4504('0x7e')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d14c8[_0x4504('0x70')]);loggerPredictive[_0x4504('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d14c8[_0x4504('0x71')]);loggerPredictive['info'](_0x4504('0x87'),_0x4d14c8['erlangBusyFactor']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4d14c8[_0x4504('0x71')]);loggerPredictive['info'](_0x4504('0x88'));_[_0x4504('0x89')](_0x3613b8,_0x4d14c8);};}function getDiff(_0x599a28){var _0x16975c=moment()[_0x4504('0x49')](0x0);var _0xa9ff3a=moment(_0x599a28)[_0x4504('0x49')](0x0);return _0x16975c[_0x4504('0x8a')](_0xa9ff3a,_0x4504('0x4a'));}function ifInterval(_0x2db24b,_0x22ce66){if(_[_0x4504('0x83')](_0x22ce66)){return![];}return getDiff(_0x22ce66)<_0x2db24b*0x3c;}function freeVariablesPredictive(_0x1fd455){if(isNotNull(_0x1fd455)){if(!_[_0x4504('0x83')](_0x1fd455[_0x4504('0x2b')])){_0x1fd455['startProgressive']=undefined;loggerPredictive[_0x4504('0x7e')](_0x1fd455[_0x4504('0x40')],_0x4504('0x8b'));}if(!_[_0x4504('0x83')](_0x1fd455['startPredictive'])){_0x1fd455['startPredictive']=undefined;loggerPredictive['info'](_0x1fd455[_0x4504('0x40')],_0x4504('0x8c'));}if(!_[_0x4504('0x83')](_0x1fd455[_0x4504('0x8d')])){clearInterval(_0x1fd455['handlePredictive']);_0x1fd455[_0x4504('0x8d')]=undefined;loggerPredictive['info'](_0x1fd455[_0x4504('0x40')],_0x4504('0x8e'));}}}function erlangb(_0x2fb3e1,_0x40df4d){if(_0x40df4d===0x0){return 0x0;}var _0x3529f0=0x1;for(var _0x52935e=0x1;_0x52935e<=_0x40df4d;_0x52935e+=0x1){_0x3529f0=0x1+_0x3529f0*_0x52935e/_0x2fb3e1;}return 0x1/_0x3529f0;}function isVoiceQueueOutbound(_0x4d0b5d){return _0x4d0b5d===_0x4504('0x8f');}function isNotPreview(_0x1b7fa6){return _0x1b7fa6!==_0x4504('0x21');}function isCampaignIvr(_0x25d334){return _0x25d334===_0x4504('0x79');}function getCallerId(_0x3dc131,_0x2d94a2,_0x43dfa9){if(!_[_0x4504('0x83')](_0x43dfa9)&&typeof _0x43dfa9===_0x4504('0x90')&&!_['isEmpty'](_0x43dfa9)){if(!_[_0x4504('0x83')](_0x2d94a2)&&typeof _0x2d94a2===_0x4504('0x90')&&!_[_0x4504('0x7c')](_0x2d94a2)){return util[_0x4504('0x77')](_0x4504('0x91'),_0x2d94a2,_0x43dfa9);}return util[_0x4504('0x77')](_0x4504('0x91'),_0x43dfa9,_0x43dfa9);}if(!_['isUndefined'](_0x3dc131)&&typeof _0x3dc131===_0x4504('0x90')&&!_[_0x4504('0x7c')](_0x3dc131)){return _0x3dc131;}return _0x4504('0x92');}function loggerCatchQueueSummary(_0x3d6ca9,_0x243923){return function(_0x2031af){freeVariablesPredictive(_0x243923);emitVoiceQueueSummary(_0x243923);emitCampaignSummary(_0x243923);loggerSyncQueueSummary[_0x4504('0x93')](_0x3d6ca9,util[_0x4504('0x94')](_0x2031af,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2601a9,_0x5a8749){return function(_0x5329e7){loggerPredictive[_0x4504('0x93')](_0x5a8749['name'],_0x2601a9);loggerPredictive[_0x4504('0x93')](_0x5329e7[_0x4504('0x95')]);freeVariablesPredictive(_0x5a8749);};}function loggerCatch(_0x54f4e2){return function(_0xb5228){logger[_0x4504('0x93')](_0x54f4e2,util[_0x4504('0x94')](_0xb5228,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5ef285){return _0x5ef285&&!_['isUndefined'](_0x5ef285)&&_0x5ef285['length']>0x0;}function decremetOriginate(_0x872dff){if(!_['isUndefined'](_0x872dff)&&_0x872dff!==null){if(typeof _0x872dff[_0x4504('0x6e')]!==_0x4504('0x96')){if(_0x872dff[_0x4504('0x6e')]>0x0){_0x872dff['originated']-=0x1;}else{logger[_0x4504('0x93')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x4504('0x97'));}}function checkContactLowerLimitOriginate(_0x12c2b5,_0x5927e7,_0x108a6c){if(_0x5927e7>_0x108a6c){for(var _0x387b1d=0x0;_0x387b1d<_0x5927e7-_0x108a6c;_0x387b1d+=0x1){decremetOriginate(_0x12c2b5);}}}function loggerGetContactDialer(_0x2533c2,_0x481bf7,_0xc74cd){return function(_0x113a5c){checkContactLowerLimitOriginate(_0x481bf7,_0xc74cd,0x0);logger[_0x4504('0x93')](_0x2533c2,util[_0x4504('0x94')](_0x113a5c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x7c14d1){return function(_0x30d929){if(isNotNull(_0x30d929)&&isNotNull(_0x30d929[0x0])){if(_0x30d929[0x0][_0x4504('0x98')]>0x0){_0x7c14d1[_0x4504('0x46')]=_0x4504('0x99');logger[_0x4504('0x7e')](_0x4504('0x9a')+_0x7c14d1[_0x4504('0x40')],_0x30d929[0x0][_0x4504('0x98')],_0x4504('0x9b'));}else{_0x7c14d1[_0x4504('0x46')]=_0x4504('0x9c');logger[_0x4504('0x7e')]('[getContactDialer2][Empty]'+_0x7c14d1[_0x4504('0x40')]);}}};}function notSendMessagesQueue(_0x1ed0c8){if(_0x1ed0c8['sendMessageOneNotActive']){freeVariablesPredictive(_0x1ed0c8);if(_0x1ed0c8['originated']===0x0&&_0x1ed0c8[_0x4504('0x51')]===0x0&&_0x1ed0c8[_0x4504('0x53')]===0x0&&(_0x1ed0c8[_0x4504('0x9d')]||0x0)===0x0){_0x1ed0c8[_0x4504('0x9e')]=![];_0x1ed0c8[_0x4504('0x9f')]=0x0;_0x1ed0c8[_0x4504('0x46')]=_0x4504('0xa0');loggerSyncQueueSummary[_0x4504('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1ed0c8['name'],_0x4504('0xa1'));}else{_0x1ed0c8[_0x4504('0x46')]=_0x4504('0xa2');loggerSyncQueueSummary[_0x4504('0x93')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1ed0c8[_0x4504('0x40')],_0x4504('0xa3'));}emitVoiceQueueSummary(_0x1ed0c8);}}function notSendMessagesCampaign(_0x22826b){if(_0x22826b[_0x4504('0x9e')]){if(_0x22826b['originated']===0x0){_0x22826b[_0x4504('0x9e')]=![];_0x22826b[_0x4504('0x46')]=_0x4504('0xa0');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x22826b[_0x4504('0x40')],_0x4504('0xa1'));}else{_0x22826b[_0x4504('0x46')]=_0x4504('0xa2');loggerSyncQueueSummary[_0x4504('0x93')](_0x4504('0xa4'),_0x22826b[_0x4504('0x40')],_0x4504('0xa3'));}emitCampaignSummary(_0x22826b);}}function createObjHistory(_0x2506e1,_0x1f2ac3,_0x150704,_0xb49a3c,_0x498bea){_0x2506e1[_0x4504('0x46')]=_0x150704;var _0x14c43a=new Action(_0x2506e1,_0x1f2ac3);var _0x3725fe=new History(_0x14c43a);_0x3725fe['state']=_0xb49a3c;_0x3725fe[_0x4504('0xa5')]=_0x498bea;_0x3725fe[_0x4504('0xa6')]=_0x14c43a[_0x4504('0xa7')];return _0x3725fe;}Dialer[_0x4504('0x1d')][_0x4504('0x3e')]=function(){var _0x5cc36a=this;setInterval(function(){_0x5cc36a[_0x4504('0xa8')](_0x5cc36a[_0x4504('0x28')],_0x4504('0xa9'));_0x5cc36a[_0x4504('0xa8')](_0x5cc36a['actions'],_0x4504('0xaa'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x1b4eff,_0x9cecd8){var _0x1bb35a=this;for(var _0x37f83f in _0x1b4eff){if(typeof _0x1b4eff[_0x37f83f]!==_0x4504('0x96')){this['sequence']['enqueue'](function(){if(!_[_0x4504('0xab')](_0x1b4eff[_0x37f83f])){return ami['Action']({'action':'status','channel':_0x1b4eff[_0x37f83f]['channel']})['catch'](function(_0x1fde75){if(_0x1fde75[_0x4504('0x46')]===_0x4504('0xac')){setTimeout(function(){if(_0x1b4eff[_0x37f83f]&&_0x1b4eff[_0x37f83f][_0x4504('0x4b')]!==_0x4504('0x79')){_0x1bb35a[_0x4504('0xad')](_0x1bb35a[_0x4504('0x22')][_0x1b4eff[_0x37f83f][_0x4504('0xae')]]);logger[_0x4504('0x93')](_0x4504('0xaf'),_0x9cecd8,_0x37f83f,_0x1b4eff[_0x37f83f][_0x4504('0xae')]);delete _0x1b4eff[_0x37f83f];}if(_0x1b4eff[_0x37f83f]&&_0x1b4eff[_0x37f83f][_0x4504('0x4b')]===_0x4504('0x79')){_0x1bb35a[_0x4504('0xad')](_0x1bb35a[_0x4504('0x23')][_0x1b4eff[_0x37f83f][_0x4504('0xae')]]);logger[_0x4504('0x93')](_0x4504('0xb0'),_0x9cecd8,_0x37f83f,_0x1b4eff[_0x37f83f][_0x4504('0xae')]);delete _0x1b4eff[_0x37f83f];}},0x2328);}});}});}}};Dialer[_0x4504('0x1d')]['countReScheduled']=function(_0x52b112){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](cmHopper[_0x4504('0xb3')](_0x52b112))[_0x4504('0xb4')](loggerCatch(_0x4504('0xb5')));};Dialer[_0x4504('0x1d')][_0x4504('0xb6')]=function(_0xd026c1){return BPromise[_0x4504('0xb1')]()['then'](cmHopperBlack[_0x4504('0xb6')](_0xd026c1))[_0x4504('0xb4')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x417ebf){return BPromise[_0x4504('0xb1')]()['then'](cmHopperBlack[_0x4504('0xb7')](_0x417ebf))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x4504('0xb8')]=function(_0x12f139){return BPromise[_0x4504('0xb1')]()['then'](cmHopperHistory[_0x4504('0xb9')](_0x12f139))[_0x4504('0xb4')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x4504('0x1d')][_0x4504('0xba')]=function(_0x47b913){return BPromise[_0x4504('0xb1')]()['then'](cmHopper[_0x4504('0xba')](_0x47b913))[_0x4504('0xb4')](loggerCatch(_0x4504('0xbb')));};Dialer[_0x4504('0x1d')][_0x4504('0xbc')]=function(_0x3ed364,_0x4a6160,_0x14d839){return BPromise['resolve']()[_0x4504('0xb2')](cmHopper[_0x4504('0xbc')](_0x3ed364,_0x4a6160,_0x14d839))[_0x4504('0xb4')](loggerCatch(_0x4504('0xbd')));};Dialer[_0x4504('0x1d')][_0x4504('0xbe')]=function(_0xbe1185,_0xade71b,_0x1ad026,_0x1fdd11,_0x11c115){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](cmHopper[_0x4504('0xbe')](_0xbe1185,_0xade71b,_0x1ad026,_0x1fdd11))[_0x4504('0xb4')](function(_0x240c2e){_0x11c115['temp']-=_0x1ad026;_0x11c115[_0x4504('0xbf')]=_0x11c115[_0x4504('0xbf')]>0x0?_0x11c115[_0x4504('0xbf')]:0x0;loggerCatch(_0x4504('0xc0'))(_0x240c2e);});};Dialer[_0x4504('0x1d')]['getContactDialerIvr']=function(_0x59b73f,_0x43bec7,_0x4d319a,_0x5a3461){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](cmHopper['getContactDialerIvr'](_0x59b73f,_0x43bec7,_0x4d319a))[_0x4504('0xb4')](function(_0x3618a7){_0x5a3461[_0x4504('0xbf')]-=_0x43bec7;_0x5a3461[_0x4504('0xbf')]=_0x5a3461[_0x4504('0xbf')]>0x0?_0x5a3461[_0x4504('0xbf')]:0x0;loggerCatch(_0x4504('0xc1'))(_0x3618a7);});};Dialer[_0x4504('0x1d')]['getVoiceQueueRtPauses']=function(_0x10fa9e){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](voiceQueueRt[_0x4504('0xc2')](_0x10fa9e))[_0x4504('0xb4')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x4504('0x1d')][_0x4504('0xc3')]=function(_0x17a4fc){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](cmHopper[_0x4504('0xc3')](_0x17a4fc))['catch'](loggerCatch(_0x4504('0xc4')));};Dialer[_0x4504('0x1d')][_0x4504('0xc5')]=function(_0xe34dbb){return BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](cmHopperHistory[_0x4504('0xc5')](_0xe34dbb))[_0x4504('0xb4')](loggerCatch(_0x4504('0xc6')));};Dialer['prototype'][_0x4504('0xad')]=function(_0x129f0e){if(!_[_0x4504('0x83')](_0x129f0e)&&_0x129f0e!==null){if(typeof _0x129f0e[_0x4504('0x6e')]!==_0x4504('0x96')){if(_0x129f0e[_0x4504('0x6e')]>0x0){_0x129f0e[_0x4504('0x6e')]-=0x1;}else{logger[_0x4504('0x93')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x4504('0x93')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x4504('0x1d')]['loggerHandler']=function(_0xa58f22,_0x3c6765){var _0x247101=this;return function(_0x1f3957){_0x247101[_0x4504('0xad')](_0x3c6765);logger[_0x4504('0x93')](_0xa58f22,util[_0x4504('0x94')](_0x1f3957,{'showHidden':![],'depth':null}));};};Dialer[_0x4504('0x1d')][_0x4504('0xc7')]=function(_0x2514db,_0x59abba,_0x280197){var _0x4bd323={'state':0x19,'statedesc':_0x4504('0xc8')};this['updateOriginated'](_0x59abba);this[_0x4504('0xc9')](_[_0x4504('0x89')](_0x4bd323,_[_0x4504('0xca')](_0x280197,[_0x4504('0xcb'),_0x4504('0xcc'),_0x4504('0xcd'),_0x4504('0xce'),'CampaignId'])),_0x4504('0xcf'),_0x4504('0xd0'));logger['error'](_0x2514db);};Dialer[_0x4504('0x1d')]['isSuccess']=function(_0x58198a){return _0x58198a===_0x4504('0xd1');};Dialer[_0x4504('0x1d')][_0x4504('0xd2')]=function(_0x99f86f){return!_[_0x4504('0x83')](_0x99f86f)&&_0x99f86f&&!_[_0x4504('0x83')](_0x99f86f[_0x4504('0x40')])&&!_[_0x4504('0x83')](_0x99f86f[_0x4504('0x74')])&&_0x99f86f[_0x4504('0x74')]&&(this[_0x4504('0x25')][util[_0x4504('0x77')]('SIP/%s',_0x99f86f[_0x4504('0x40')])][_0x4504('0xd3')]===_0x4504('0xd4')||this['trunks'][util[_0x4504('0x77')](_0x4504('0xd5'),_0x99f86f['name'])][_0x4504('0xd3')]===_0x4504('0xd6'));};Dialer['prototype']['saveInDb']=function(_0x38e118,_0x30f9e4,_0x48a7e9){this[_0x4504('0xc5')](_0x38e118)[_0x4504('0xb4')](loggerCatch(_0x30f9e4));this[_0x4504('0xc3')](_0x38e118)[_0x4504('0xb4')](loggerCatch(_0x48a7e9));};Dialer[_0x4504('0x1d')]['syncVarSet']=function(_0x4d0732){var _0x50db7e=this[_0x4504('0x28')][_0x4d0732[_0x4504('0xd7')]];var _0x403b82;if(!_[_0x4504('0xab')](_0x4d0732)&&!_[_0x4504('0xab')](_0x4d0732[_0x4504('0xd8')])&&!_[_0x4504('0xab')](_0x4d0732['variable']['amdstatus'])&&_0x4d0732[_0x4504('0xd9')]==='xcally-motion-dialer'&&_0x50db7e){if(_0x50db7e[_0x4504('0x4b')]!==_0x4504('0x79')&&this['voiceQueues'][_0x50db7e['queue']][_0x4504('0xda')]&&_0x4d0732[_0x4504('0xdb')]===_0x4504('0xdc')){delete this['uniqueId'][_0x4d0732[_0x4504('0xd7')]];this[_0x4504('0xad')](this[_0x4504('0x22')][_0x50db7e[_0x4504('0xae')]]);this[_0x4504('0x22')][_0x50db7e[_0x4504('0xae')]][_0x4504('0x59')]+=0x1;this[_0x4504('0x22')][_0x50db7e[_0x4504('0xae')]][_0x4504('0x58')]+=0x1;_0x403b82=new Hangup(_0x50db7e,_0x4d0732);_0x403b82[_0x4504('0xdd')]=0x12;_0x403b82[_0x4504('0xa5')]=_0x4504('0xde');_0x403b82[_0x4504('0xdf')]=_0x4504('0xe0');ami[_0x4504('0xe1')]('custom:amd',ut[_0x4504('0xe2')](_0x403b82,_0x4504('0xe3')));this[_0x4504('0xc9')](_0x403b82,_0x4504('0xe4'),_0x4504('0xe5'));}if(_0x50db7e[_0x4504('0x4b')]!==_0x4504('0x79')&&this[_0x4504('0x22')][_0x50db7e['queue']][_0x4504('0xda')]&&_0x4d0732[_0x4504('0xdb')]===_0x4504('0xe6')){var _0x5eac0e=this;return new BPromise(function(_0xcad04c,_0x2b9303){delete _0x5eac0e[_0x4504('0x28')][_0x4d0732[_0x4504('0xd7')]];_0x5eac0e[_0x4504('0xad')](_0x5eac0e['voiceQueues'][_0x50db7e['queue']]);_0x5eac0e[_0x4504('0x22')][_0x50db7e['queue']][_0x4504('0x59')]+=0x1;_0x5eac0e[_0x4504('0x22')][_0x50db7e[_0x4504('0xae')]][_0x4504('0x58')]+=0x1;var _0x1955f7=_0x5eac0e[_0x4504('0x22')][_0x50db7e['queue']];var _0x2f354c=new Hangup(_0x50db7e,_0x4d0732);_0x2f354c[_0x4504('0xdd')]=0x13;_0x2f354c[_0x4504('0xa5')]='Machine';_0x2f354c[_0x4504('0xdf')]='AMD';_0x2f354c['countmachineretry']+=0x1;_0x2f354c[_0x4504('0xe7')]+=0x1;_0x2f354c[_0x4504('0xe3')]=!![];ami['emit'](_0x4504('0xe8'),ut[_0x4504('0xe2')](_0x2f354c,_0x4504('0xe3')));_0x5eac0e['createHistory'](_0x2f354c)[_0x4504('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2f354c[_0x4504('0xe9')]+_0x2f354c['countcongestionretry']+_0x2f354c[_0x4504('0xea')]+_0x2f354c['countnosuchnumberretry']+_0x2f354c[_0x4504('0xeb')]+_0x2f354c['countabandonedretry']+_0x2f354c[_0x4504('0xec')]+_0x2f354c[_0x4504('0xed')]>=_0x1955f7[_0x4504('0xee')]){_0x5eac0e[_0x4504('0xef')](_0x2f354c,_0xcad04c,_0x2b9303,_0x4504('0xf0'));}else{if(_0x2f354c[_0x4504('0xec')]>=_0x1955f7[_0x4504('0xf1')]){_0x5eac0e[_0x4504('0xf2')](_0x2f354c,_0xcad04c,_0x2b9303,_0x4504('0xf3'));}else{_0x5eac0e[_0x4504('0xba')]({'active':![],'countmachineretry':_0x2f354c[_0x4504('0xec')],'scheduledat':moment()[_0x4504('0xf4')](_0x1955f7[_0x4504('0xf5')],_0x4504('0xf6'))['format'](_0x4504('0xf7')),'ContactId':_0x2f354c[_0x4504('0xcb')],'ListId':_0x2f354c[_0x4504('0xcc')],'VoiceQueueId':_0x2f354c[_0x4504('0xce')]||undefined,'CampaignId':_0x2f354c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0xcad04c({'reschedule':0x1});}}});}if(_0x50db7e[_0x4504('0x4b')]===_0x4504('0x79')&&this['campaigns'][_0x50db7e[_0x4504('0xae')]][_0x4504('0xda')]&&_0x4d0732[_0x4504('0xdb')]===_0x4504('0xdc')){delete this[_0x4504('0x28')][_0x4d0732[_0x4504('0xd7')]];this[_0x4504('0xad')](this['campaigns'][_0x50db7e[_0x4504('0xae')]]);_0x403b82=new Hangup(_0x50db7e,_0x4d0732);_0x403b82[_0x4504('0xdd')]=0x12;_0x403b82[_0x4504('0xa5')]='HangupInAMD';_0x403b82[_0x4504('0xdf')]='AMD';ami[_0x4504('0xe1')](_0x4504('0xe8'),ut['buildObj'](_0x403b82,_0x4504('0xe3')));this[_0x4504('0xc9')](_0x403b82,'[syncHangupInAMDIvr][createHistory]',_0x4504('0xf8'));}if(_0x50db7e[_0x4504('0x4b')]===_0x4504('0x79')&&this['campaigns'][_0x50db7e['queue']][_0x4504('0xda')]&&_0x4d0732[_0x4504('0xdb')]==='MACHINE'){var _0x5eac0e=this;return new BPromise(function(_0x54c2a9,_0x5621ab){delete _0x5eac0e['uniqueId'][_0x4d0732[_0x4504('0xd7')]];_0x5eac0e['updateOriginated'](_0x5eac0e[_0x4504('0x23')][_0x50db7e[_0x4504('0xae')]]);_0x5eac0e['campaigns'][_0x50db7e[_0x4504('0xae')]][_0x4504('0x59')]+=0x1;_0x5eac0e[_0x4504('0x23')][_0x50db7e['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x104b87=_0x5eac0e[_0x4504('0x23')][_0x50db7e[_0x4504('0xae')]];var _0x412fa3=new Hangup(_0x50db7e,_0x4d0732);_0x412fa3[_0x4504('0xdd')]=0x13;_0x412fa3[_0x4504('0xa5')]='Machine';_0x412fa3[_0x4504('0xdf')]=_0x4504('0xe0');_0x412fa3[_0x4504('0xec')]+=0x1;_0x412fa3[_0x4504('0xe7')]+=0x1;_0x412fa3['amd']=!![];ami[_0x4504('0xe1')](_0x4504('0xe8'),ut[_0x4504('0xe2')](_0x412fa3,_0x4504('0xe3')));_0x5eac0e['createHistory'](_0x412fa3)[_0x4504('0xb4')](loggerCatch(_0x4504('0xf9')));if(_0x412fa3[_0x4504('0xe9')]+_0x412fa3[_0x4504('0xfa')]+_0x412fa3['countnoanswerretry']+_0x412fa3[_0x4504('0xfb')]+_0x412fa3[_0x4504('0xeb')]+_0x412fa3['countabandonedretry']+_0x412fa3[_0x4504('0xec')]+_0x412fa3[_0x4504('0xed')]>=_0x104b87[_0x4504('0xee')]){_0x5eac0e[_0x4504('0xef')](_0x412fa3,_0x54c2a9,_0x5621ab,_0x4504('0xf0'));}else{if(_0x412fa3['countmachineretry']>=_0x104b87[_0x4504('0xf1')]){_0x5eac0e[_0x4504('0xf2')](_0x412fa3,_0x54c2a9,_0x5621ab,'reason\x2019\x20machine....');}else{_0x5eac0e[_0x4504('0xba')]({'active':![],'countmachineretry':_0x412fa3['countmachineretry'],'scheduledat':moment()['add'](_0x104b87[_0x4504('0xf5')],'minutes')[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x412fa3['ContactId'],'ListId':_0x412fa3[_0x4504('0xcc')],'VoiceQueueId':_0x412fa3[_0x4504('0xce')]||undefined,'CampaignId':_0x412fa3[_0x4504('0xfc')]||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0xfd')));_0x54c2a9({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x4504('0x35')]=function(_0x3060d2){var _0x3379c0=this[_0x4504('0x28')][_0x3060d2[_0x4504('0xd7')]];var _0x219fd5=this;var _0x437cae;if(_0x3379c0&&_0x3379c0[_0x4504('0x4b')]==='ivr'){delete this[_0x4504('0x28')][_0x3060d2['uniqueid']];this['updateOriginated'](this[_0x4504('0x23')][_0x3379c0[_0x4504('0xae')]]);this[_0x4504('0x23')][_0x3379c0[_0x4504('0xae')]][_0x4504('0xfe')]+=0x1;_0x437cae=new Hangup(_0x3379c0,_0x3060d2);this[_0x4504('0xc5')](_0x437cae)['catch'](loggerCatch(_0x4504('0xff')));this['moveContactManagedDialer'](_0x437cae)[_0x4504('0xb4')](loggerCatch(_0x4504('0x100')));}if(_0x3379c0&&_0x3379c0[_0x4504('0x4b')]!=='ivr'&&isNotNull(this[_0x4504('0x22')][_0x3379c0['queue']][_0x4504('0x101')])){delete this[_0x4504('0x28')][_0x3060d2[_0x4504('0xd7')]];this['updateOriginated'](this[_0x4504('0x22')][_0x3379c0[_0x4504('0xae')]]);this[_0x4504('0x22')][_0x3379c0[_0x4504('0xae')]][_0x4504('0x59')]+=0x1;this['voiceQueues'][_0x3379c0[_0x4504('0xae')]][_0x4504('0x58')]+=0x1;_0x437cae=new Hangup(_0x3379c0,_0x3060d2);_0x437cae[_0x4504('0xdd')]=0x10;_0x437cae['statedesc']='AnswerAGI';_0x437cae['membername']=_0x4504('0x102');this[_0x4504('0xc5')](_0x437cae)[_0x4504('0xb4')](loggerCatch(_0x4504('0xff')));this[_0x4504('0xc3')](_0x437cae)[_0x4504('0xb4')](loggerCatch(_0x4504('0x100')));}if(_0x3379c0&&_0x3379c0['type']!==_0x4504('0x79')&&!isNotNull(this['voiceQueues'][_0x3379c0[_0x4504('0xae')]][_0x4504('0x101')])){delete this[_0x4504('0x28')][_0x3060d2[_0x4504('0xd7')]];this[_0x4504('0xad')](this[_0x4504('0x22')][_0x3379c0[_0x4504('0xae')]]);this[_0x4504('0x22')][_0x3379c0[_0x4504('0xae')]][_0x4504('0x103')]+=0x1;_0x437cae=new Hangup(_0x3379c0,_0x3060d2);_0x437cae['state']=0xc;_0x437cae[_0x4504('0xa5')]=_0x3060d2[_0x4504('0x104')];_0x437cae['membername']=_0x4504('0x105');this[_0x4504('0xc5')](_0x437cae)[_0x4504('0xb4')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x437cae)[_0x4504('0xb4')](loggerCatch(_0x4504('0x100')));}};Dialer[_0x4504('0x1d')][_0x4504('0x106')]=function(_0x5b6f8c){var _0x46218b=this[_0x4504('0x28')][_0x5b6f8c[_0x4504('0xd7')]];var _0x3faedc=this;if(this[_0x4504('0x22')][_0x5b6f8c[_0x4504('0xae')]]){if(_0x46218b&&_0x46218b[_0x4504('0x4b')]!==_0x4504('0x79')){delete this[_0x4504('0x28')][_0x5b6f8c['uniqueid']];this[_0x4504('0x22')][_0x5b6f8c[_0x4504('0xae')]][_0x4504('0x59')]+=0x1;var _0x57bd77=new AgentComplete(_0x46218b,_0x5b6f8c);if(_0x5b6f8c[_0x4504('0x107')]===_0x4504('0x108')){_0x57bd77[_0x4504('0x109')]=this[_0x4504('0x22')][_0x5b6f8c['queue']][_0x4504('0x10a')]&&this[_0x4504('0x22')][_0x5b6f8c[_0x4504('0xae')]][_0x4504('0x10b')]?moment()[_0x4504('0x77')](_0x4504('0xf7')):undefined;}this['createHistory'](_0x57bd77)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x57bd77)[_0x4504('0xb4')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4504('0x1d')][_0x4504('0x2f')]=function(_0x3a327a){if(this[_0x4504('0x22')][_0x3a327a[_0x4504('0xae')]]){if(this[_0x4504('0x28')][_0x3a327a['uniqueid']]&&this[_0x4504('0x28')][_0x3a327a['uniqueid']][_0x4504('0x4b')]!==_0x4504('0x79')){this['updateOriginated'](this[_0x4504('0x22')][_0x3a327a[_0x4504('0xae')]]);this[_0x4504('0x28')][_0x3a327a[_0x4504('0xd7')]]['answertime']=moment()[_0x4504('0x77')](_0x4504('0xf7'));}}};Dialer[_0x4504('0x1d')][_0x4504('0x10c')]=function(_0xad29){this[_0x4504('0xc5')](_0xad29)[_0x4504('0xb4')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4504('0xc3')](_0xad29)[_0x4504('0xb4')](loggerCatch(_0x4504('0x10d')));};Dialer[_0x4504('0x1d')][_0x4504('0x10e')]=function(_0x4f389e){var _0x50d24e=this[_0x4504('0x28')][_0x4f389e['uniqueid']];var _0x47a770=this;if(this[_0x4504('0x22')][_0x4f389e[_0x4504('0xae')]]){if(_0x50d24e&&_0x50d24e[_0x4504('0x4b')]!==_0x4504('0x79')){delete this[_0x4504('0x28')][_0x4f389e[_0x4504('0xd7')]];this[_0x4504('0xad')](this[_0x4504('0x22')][_0x4f389e[_0x4504('0xae')]]);_0x50d24e[_0x4504('0x10f')]=moment()['format'](_0x4504('0xf7'));var _0x21b39b=new QueueCallerAbandon(_0x50d24e,_0x4f389e);if(getSeconds(_0x50d24e[_0x4504('0x10f')],_0x50d24e[_0x4504('0x110')])>=_0x50d24e['dialQueueTimeout']){this[_0x4504('0x22')][_0x4f389e['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x4f389e[_0x4504('0xae')]][_0x4504('0x5e')]+=0x1;this[_0x4504('0x22')][_0x4f389e['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x21b39b[_0x4504('0xdd')]=0xa;_0x21b39b[_0x4504('0xa5')]='Drop';_0x21b39b[_0x4504('0x111')]=_0x4504('0x112');_0x21b39b[_0x4504('0x109')]=this['voiceQueues'][_0x4f389e['queue']][_0x4504('0x10a')]?moment()[_0x4504('0x77')](_0x4504('0xf7')):undefined;_0x21b39b[_0x4504('0xeb')]+=0x1;_0x21b39b[_0x4504('0xe7')]+=0x1;if(_0x21b39b[_0x4504('0xeb')]>=this[_0x4504('0x22')][_0x4f389e[_0x4504('0xae')]][_0x4504('0x113')]){this[_0x4504('0x10c')](_0x21b39b);}else{this[_0x4504('0xba')]({'active':![],'countdropretry':_0x21b39b[_0x4504('0xeb')],'scheduledat':moment()[_0x4504('0xf4')](this['voiceQueues'][_0x4f389e[_0x4504('0xae')]]['dialDropRetryFrequency'],_0x4504('0xf6'))[_0x4504('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50d24e[_0x4504('0xcb')],'ListId':_0x50d24e[_0x4504('0xcc')],'VoiceQueueId':_0x50d24e[_0x4504('0xce')]||undefined,'CampaignId':_0x50d24e[_0x4504('0xfc')]||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0x114')));var _0x1ccb27=new History(_0x21b39b);_0x1ccb27['state']=0xa;_0x1ccb27[_0x4504('0xa5')]='Drop';_0x1ccb27[_0x4504('0xa7')]=moment()['format'](_0x4504('0xf7'));_0x1ccb27[_0x4504('0xa6')]=_0x1ccb27[_0x4504('0xa7')];_0x1ccb27[_0x4504('0x115')]=_0x21b39b[_0x4504('0x115')];_0x1ccb27[_0x4504('0x116')]=_0x21b39b[_0x4504('0x116')];this['createHistory'](_0x1ccb27)[_0x4504('0xb4')](loggerCatch(_0x4504('0x117')));}}else{this[_0x4504('0x22')][_0x4f389e[_0x4504('0xae')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x4504('0x22')][_0x4f389e['queue']][_0x4504('0x118')]+=0x1;_0x21b39b[_0x4504('0xdd')]=0xb;_0x21b39b['statedesc']='Abandoned';_0x21b39b[_0x4504('0x111')]=_0x4504('0x119');_0x21b39b[_0x4504('0x11a')]+=0x1;_0x21b39b[_0x4504('0xe7')]+=0x1;if(_0x21b39b[_0x4504('0x11a')]>=this[_0x4504('0x22')][_0x4f389e['queue']]['dialAbandonedMaxRetry']){this[_0x4504('0x10c')](_0x21b39b);}else{this[_0x4504('0xba')]({'active':![],'countabandonedretry':_0x21b39b['countabandonedretry'],'scheduledat':moment()[_0x4504('0xf4')](this[_0x4504('0x22')][_0x4f389e[_0x4504('0xae')]]['dialAbandonedRetryFrequency'],'minutes')[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x50d24e[_0x4504('0xcb')],'ListId':_0x50d24e[_0x4504('0xcc')],'VoiceQueueId':_0x50d24e[_0x4504('0xce')]||undefined,'CampaignId':_0x50d24e['CampaignId']||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0x11b')));var _0x1ccb27=new History(_0x21b39b);_0x1ccb27[_0x4504('0xdd')]=0xb;_0x1ccb27[_0x4504('0xa5')]=_0x4504('0x11c');_0x1ccb27[_0x4504('0xa7')]=moment()[_0x4504('0x77')](_0x4504('0xf7'));_0x1ccb27[_0x4504('0xa6')]=_0x1ccb27['starttime'];_0x1ccb27[_0x4504('0x115')]=_0x21b39b[_0x4504('0x115')];_0x1ccb27[_0x4504('0x116')]=_0x21b39b[_0x4504('0x116')];this[_0x4504('0xc5')](_0x1ccb27)[_0x4504('0xb4')](loggerCatch(_0x4504('0x11d')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x310ed2){if(this[_0x4504('0x11e')][_0x310ed2[_0x4504('0xd7')]]){this[_0x4504('0x11e')][_0x310ed2[_0x4504('0xd7')]]['channel']=_0x310ed2[_0x4504('0x11f')];}if(this[_0x4504('0x28')][_0x310ed2[_0x4504('0xd7')]]){this[_0x4504('0x28')][_0x310ed2[_0x4504('0xd7')]][_0x4504('0x11f')]=_0x310ed2['channel'];}};Dialer[_0x4504('0x1d')][_0x4504('0x120')]=function(_0x49247c){if(strategy[this[_0x4504('0x22')][this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]][_0x4504('0xae')]][_0x4504('0x4c')]]===_0x4504('0x122')){if(this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]]&&_[_0x4504('0xab')](this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]][_0x4504('0x123')])&&_0x49247c[_0x4504('0xd3')]==='1'&&_0x49247c[_0x4504('0x124')]==='0'){if(this[_0x4504('0x24')][_0x49247c[_0x4504('0x125')]]){if(!this[_0x4504('0x24')][_0x49247c[_0x4504('0x125')]][_0x4504('0x123')]){this[_0x4504('0x24')][_0x49247c[_0x4504('0x125')]][_0x4504('0x123')]=!![];this['actions'][_0x49247c[_0x4504('0x121')]][_0x4504('0x123')]=!![];this[_0x4504('0x11e')][_0x49247c['actionid']][_0x4504('0x125')]=_0x49247c['stateinterface'];}}}}else if((strategy[this[_0x4504('0x22')][this['actions'][_0x49247c['actionid']][_0x4504('0xae')]][_0x4504('0x4c')]]||_0x4504('0x1c'))===_0x4504('0x1c')){if(this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]]){if(this['agents'][_0x49247c[_0x4504('0x125')]]){this[_0x4504('0x11e')][_0x49247c['actionid']][_0x4504('0x125')]=_0x49247c['stateinterface'];if(_[_0x4504('0xab')](this[_0x4504('0x2c')][this['actions'][_0x49247c[_0x4504('0x121')]][_0x4504('0xae')]])){this[_0x4504('0x2c')][this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x49247c[_0x4504('0x121')]][_0x4504('0xae')]]['push'](_['merge'](_[_0x4504('0xca')](this[_0x4504('0x11e')][_0x49247c[_0x4504('0x121')]],[_0x4504('0x126'),_0x4504('0x125')]),{'status':_0x49247c[_0x4504('0xd3')],'paused':_0x49247c[_0x4504('0x124')]}));}}}};function unlockQueueStatus(_0x418d68,_0xc672de){setTimeout(function(){if(_[_0x4504('0x83')](_0x418d68[_0x4504('0x127')])){loggerBooked[_0x4504('0x93')](_0x4504('0x128'),_0xc672de);}_0x418d68['queueStatusComplete']=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0xc672de,JSON[_0x4504('0x76')](_[_0x4504('0xca')](_0x418d68,[_0x4504('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4504('0x1d')][_0x4504('0x3c')]=function(_0x1f0fcc){var _0x56c4b6=this;var _0x502d01=_0x56c4b6[_0x4504('0x22')][_0x56c4b6[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]];if(strategy[this['voiceQueues'][this['actions'][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]][_0x4504('0x4c')]]===_0x4504('0x122')){if(this[_0x4504('0x11e')][_0x1f0fcc['actionid']]&&this['actions'][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0x125')]){this[_0x4504('0x21')]['run'](this['actions'][_0x1f0fcc[_0x4504('0x121')]]['idHopper'],this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0x125')])['catch'](function(_0x2b7447){logger['error'](_0x4504('0x129'),util[_0x4504('0x94')](_0x2b7447,{'showHidden':![],'depth':null}));})[_0x4504('0x20')](function(){_0x56c4b6[_0x4504('0xad')](_0x56c4b6[_0x4504('0x22')][_0x56c4b6[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]]);_0x56c4b6[_0x4504('0x24')][_0x56c4b6[_0x4504('0x11e')][_0x1f0fcc['actionid']][_0x4504('0x125')]][_0x4504('0x123')]=![];delete _0x56c4b6[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]];unlockQueueStatus(_0x502d01);});}else{this[_0x4504('0xad')](this[_0x4504('0x22')][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]]['queue']]);this[_0x4504('0xba')]({'active':![],'ContactId':this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xcb')],'ListId':this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xcc')],'VoiceQueueId':this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xce')]||undefined,'CampaignId':this['actions'][_0x1f0fcc[_0x4504('0x121')]]['CampaignId']||undefined})[_0x4504('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]];unlockQueueStatus(_0x502d01);}}else if((strategy[this['voiceQueues'][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]]['strategy']]||'rrmemory')===_0x4504('0x1c')){var _0x3a6a49;if(this['actions'][_0x1f0fcc[_0x4504('0x121')]]&&!_['isEmpty'](this['queueBooked'][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]])){if(this[_0x4504('0x2d')][_0x56c4b6[_0x4504('0x11e')][_0x1f0fcc['actionid']][_0x4504('0xae')]]){this[_0x4504('0x2d')][_0x56c4b6[_0x4504('0x11e')][_0x1f0fcc['actionid']]['queue']]=this[_0x4504('0x2d')][this[_0x4504('0x11e')][_0x1f0fcc['actionid']]['queue']]?this[_0x4504('0x2d')][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]]:this[_0x4504('0x2c')][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]]?this[_0x4504('0x2c')][this[_0x4504('0x11e')][_0x1f0fcc['actionid']][_0x4504('0xae')]][_0x4504('0x12a')]||0x0:0x0;}this[_0x4504('0x2c')][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]][_0x4504('0xae')]][_0x4504('0x12a')]=this[_0x4504('0x2d')][this[_0x4504('0x11e')][_0x1f0fcc[_0x4504('0x121')]]['queue']];for(var _0x513472=0x0;_0x513472=0x0;})[_0x4504('0xb4')](myreject(_0x397312)));}}else{_0x505722[_0x4504('0x145')](ami['Action']({'action':'command','command':util[_0x4504('0x77')](_0x4504('0x147'),_0x559647,!_[_0x4504('0x83')](config['timezones'][_0x3fbe42])?_0x3fbe42:'')})[_0x4504('0xb2')](function(_0x4c2cd4){return _0x4c2cd4[_0x4504('0x149')]['indexOf'](_0x4504('0x148'))>=0x0;})[_0x4504('0xb4')](myreject(_0x397312)));}BPromise[_0x4504('0x14a')](_0x505722)[_0x4504('0xb2')](function(_0x5e8f5d){var _0x58fa69=_['some'](_0x5e8f5d);if(_0x58fa69){return _0x5b7b68(_0x58fa69);}else{_0x572797[_0x4504('0x46')]=_0x5282fc?_0x4504('0x14b'):_0x4504('0x14c');return _0x397312(msgResponse('[ifTime][promiseAll]',_0x4504('0x13e'),_0x4504('0x14d')+_0x5282fc+'\x20'+_0xef1855+_0x4504('0x14e')+util['inspect'](_0x559647,{'showHidden':![],'depth':null})+_0x4504('0x14f')+_0x3fbe42));}})['catch'](function(_0x38428d){return _0x397312(msgResponse(_0x4504('0x13d'),_0x4504('0x13e'),JSON[_0x4504('0x76')](_0x38428d)));});});};Dialer[_0x4504('0x1d')]['checkDialMethod']=function(_0x45e36d){var _0x4ba562=this;return function(){switch(_0x45e36d[_0x4504('0x150')]){case'progressive':freeVariablesPredictive(_0x45e36d);_0x4ba562['handlePower'](_0x45e36d,0x1);break;case _0x4504('0x151'):freeVariablesPredictive(_0x45e36d);_0x4ba562[_0x4504('0x152')](_0x45e36d,_0x45e36d['dialPowerLevel']);break;case _0x4504('0xa'):_0x4ba562[_0x4504('0xa')](_0x45e36d);break;case'booked':freeVariablesPredictive(_0x45e36d);_0x4ba562[_0x4504('0x152')](_0x45e36d,0x1);break;default:freeVariablesPredictive(_0x45e36d);logger[_0x4504('0x93')](_0x4504('0x153'),_0x45e36d['name'],_0x4504('0x154'));}};};Dialer['prototype'][_0x4504('0x155')]=function(_0x5b762e){var _0x5babc7=this;return function(){_0x5babc7[_0x4504('0x156')](_0x5b762e);};};Dialer[_0x4504('0x1d')][_0x4504('0xc')]=function(_0x539747){var _0xb4852e=this;if(isNotPreview(_0x539747[_0x4504('0x150')])){if(isVoiceQueueOutbound(_0x539747['type'])&&isActive(_0x539747[_0x4504('0x55')])){_0x539747['sendMessageOneNotActive']=!![];BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](checkIsLoggedIn(_0x539747,_0x539747['loggedIn']))['then'](checkIsActive(_0x539747,_0x539747[_0x4504('0x55')]))[_0x4504('0xb2')](checkInterval(_0x539747))['then'](_0xb4852e[_0x4504('0x138')](_0x539747))[_0x4504('0xb2')](_0xb4852e['checkIfTime'](_0x539747[_0x4504('0x157')],_0x539747[_0x4504('0x158')],_0x539747[_0x4504('0x40')],_0x539747))['then'](_0xb4852e[_0x4504('0x13c')](_0x539747[_0x4504('0x45')],_0x539747[_0x4504('0x158')],_0x539747['name'],_0x539747))['then'](_0xb4852e[_0x4504('0x159')](_0x539747))[_0x4504('0xb4')](loggerCatchQueueSummary(_0x4504('0x15a'),_0x539747));}else{notSendMessagesQueue(_0x539747);}}else{freeVariablesPredictive(_0x539747);}};Dialer['prototype']['syncCampaigns']=function(){var _0x12cefa=this;var _0x5aab0a;for(var _0xd04a01 in this[_0x4504('0x23')]){if(typeof this[_0x4504('0x23')][_0xd04a01]!=='undefined'){_0x5aab0a=this[_0x4504('0x23')][_0xd04a01];if(isCampaignIvr(_0x5aab0a[_0x4504('0x4b')])&&isActive(_0x5aab0a['active'])){_0x5aab0a[_0x4504('0x9e')]=!![];BPromise[_0x4504('0xb1')]()[_0x4504('0xb2')](checkIsActive(_0x5aab0a,_0x5aab0a['active']))[_0x4504('0xb2')](checkInterval(_0x5aab0a))[_0x4504('0xb2')](_0x12cefa[_0x4504('0x138')](_0x5aab0a))[_0x4504('0xb2')](_0x12cefa[_0x4504('0x13b')](_0x5aab0a[_0x4504('0x157')],_0x5aab0a[_0x4504('0x158')],_0x5aab0a[_0x4504('0x40')],_0x5aab0a))[_0x4504('0xb2')](_0x12cefa[_0x4504('0x13c')](_0x5aab0a[_0x4504('0x45')],_0x5aab0a[_0x4504('0x158')],_0x5aab0a[_0x4504('0x40')],_0x5aab0a))[_0x4504('0xb2')](_0x12cefa[_0x4504('0x155')](_0x5aab0a))[_0x4504('0xb4')](loggerCatchQueueSummary(_0x4504('0x15b'),_0x5aab0a));}else{notSendMessagesCampaign(_0x5aab0a);}}}};function getCallerIdRandom(_0x926adf,_0x192954){var _0x170466;var _0x33b142;var _0x464219;if(_0x192954<=0x0){_0x192954=0x1;}_0x170466=new RegExp('\x5cw{0,'+_0x192954+'}$');_0x33b142=Math[_0x4504('0x15c')](0xa,_0x192954-0x1);_0x464219=Math[_0x4504('0x15c')](0xa,_0x192954)-0x1;return util[_0x4504('0x77')]('%s',_[_0x4504('0x15d')](_0x926adf,_0x170466,_[_0x4504('0x15e')](_0x33b142,_0x464219)));}function extractCalleridName(_0x570476){var _0x31ea36=_0x570476['match'](/"(.*?)"/);return _0x31ea36?_0x31ea36[0x1]:_0x570476;}function extractCalleridNumber(_0x8226b4){var _0x327738=_0x8226b4[_0x4504('0x15f')](/<(.*?)>/);return _0x327738?_0x327738[0x1]:_0x8226b4;}Dialer[_0x4504('0x1d')]['actionOriginate']=function(_0x328cd2,_0x410c74){var _0x2b1008=this;var _0x33e880=uuid['v4']();this[_0x4504('0x11e')][_0x33e880]=new Action(_0x328cd2,_0x410c74,_0x33e880);return new BPromise(function(_0xa768a4,_0x15a681){if(_[_0x4504('0x83')](_0x328cd2)&&typeof _0x328cd2!==_0x4504('0x160')){return _0x15a681(msgResponse(_0x4504('0x161'),'Failure',_0x4504('0x162')));}if(_[_0x4504('0x83')](_0x410c74[_0x4504('0x163')]['phone'])||_0x410c74['Contact'][_0x4504('0x164')]===null){return _0x15a681(msgResponse(_0x4504('0x161'),_0x4504('0x13e'),_0x4504('0x165')));}var _0x130b11={'XMD-CALLERID':_0x2b1008['actions'][_0x33e880][_0x4504('0x166')](),'XMD-AGI':_0x328cd2[_0x4504('0x101')]?util[_0x4504('0x77')](_0x4504('0x167'),ipAgi,_0x328cd2[_0x4504('0x101')]):_0x4504('0x168'),'XMD-AGIAFTER':_0x328cd2[_0x4504('0x10a')]?util[_0x4504('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x328cd2[_0x4504('0x10a')]):_0x4504('0x168'),'XMD-QUEUE':_0x328cd2[_0x4504('0x4b')]===_0x4504('0x8f')?util[_0x4504('0x77')]('\x22%s,%s%s,,,%s\x22',_0x328cd2['name'],_0x328cd2['dialQueueOptions']||'',_0x328cd2['dialAgiAfterHangupAgent']?'c':'',_0x328cd2[_0x4504('0x169')]||0x3):_0x4504('0x168'),'XMD-CONTACTID':_0x410c74['ContactId'],'XMD-CDRTYPE':_0x4504('0x8'),'CALLERID(all)':_0x2b1008[_0x4504('0x11e')][_0x33e880]['getCaller'](),'XMD-AMD':_0x328cd2[_0x4504('0xda')]?_0x4504('0x16a'):_0x4504('0x168'),'XMD-DESTINATION':_0x4504('0x16b')};if(_0x328cd2[_0x4504('0xda')]){_0x130b11[_0x4504('0x16c')]=_0x328cd2[_0x4504('0x16d')]||0x9c4;_0x130b11['XMD-AMDGREETING']=_0x328cd2['dialAMDGreeting']||0x5dc;_0x130b11[_0x4504('0x16e')]=_0x328cd2[_0x4504('0x16f')]||0x320;_0x130b11[_0x4504('0x170')]=_0x328cd2[_0x4504('0x171')]||0x1388;_0x130b11['XMD-AMDMINWORDLENGTH']=_0x328cd2[_0x4504('0x172')]||0x64;_0x130b11[_0x4504('0x173')]=_0x328cd2[_0x4504('0x174')]||0x32;_0x130b11[_0x4504('0x175')]=_0x328cd2['dialAMDMaximumNumberOfWords']||0x3;_0x130b11['XMD-AMDSILENCETHRESHOLD']=_0x328cd2['dialAMDSilenceThreshold']||0x100;_0x130b11[_0x4504('0x176')]=_0x328cd2[_0x4504('0x177')]||0x1388;}if(_0x328cd2['type']===_0x4504('0x8f')){_0x130b11['XMD-VOICEQUEUEID']=_0x410c74[_0x4504('0xce')];}else{_0x130b11[_0x4504('0x178')]=_0x410c74[_0x4504('0xfc')];}for(var _0x4b0f96 in _0x410c74[_0x4504('0x163')]){if(typeof _0x410c74[_0x4504('0x163')][_0x4b0f96]!==_0x4504('0x96')){if(isNotNull(_0x410c74[_0x4504('0x163')][_0x4b0f96])&&_0x4b0f96!=='id'&&_0x4b0f96!=='tags'&&_0x4b0f96!==_0x4504('0x179')&&_0x4b0f96!==_0x4504('0x17a')){_0x130b11[util[_0x4504('0x77')](_0x4504('0x17b'),_0x4504('0x17c'),_['toUpper'](_0x4b0f96))]=_0x410c74['Contact'][_0x4b0f96];}}}var _0x598b9b=_0x2b1008[_0x4504('0xd2')](_0x328cd2['Trunk'])?getCallerId(_0x328cd2[_0x4504('0x73')][_0x4504('0x75')],_0x328cd2[_0x4504('0x17d')],_0x328cd2['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x328cd2[_0x4504('0x56')],_0x328cd2[_0x4504('0x17e')]):_0x328cd2['dialOriginateCallerIdNumber']):getCallerId(_[_0x4504('0xab')](_0x328cd2[_0x4504('0x139')])?_0x328cd2[_0x4504('0x73')][_0x4504('0x75')]:_0x328cd2[_0x4504('0x139')][_0x4504('0x75')],_0x328cd2[_0x4504('0x17d')],_0x328cd2[_0x4504('0x17e')]>0x0?getCallerIdRandom(_0x328cd2[_0x4504('0x56')],_0x328cd2[_0x4504('0x17e')]):_0x328cd2[_0x4504('0x56')]);if(_0x598b9b){_0x130b11['XMD-ORIGINATECALLERIDNAME']=_0x2b1008[_0x4504('0x11e')][_0x33e880][_0x4504('0x17f')]=extractCalleridName(_0x598b9b);_0x130b11['XMD-ORIGINATECALLERIDNUM']=_0x2b1008[_0x4504('0x11e')][_0x33e880][_0x4504('0x180')]=extractCalleridNumber(_0x598b9b);}return ami[_0x4504('0x181')]({'actionid':_0x33e880,'action':_0x4504('0x161'),'channel':_0x2b1008[_0x4504('0xd2')](_0x328cd2['Trunk'])?util['format']('SIP/%s/%s%s',_0x328cd2[_0x4504('0x73')]['name'],isNotNull(_0x328cd2[_0x4504('0x182')])?_0x328cd2[_0x4504('0x182')][_0x4504('0x183')]()||'':'',_0x328cd2[_0x4504('0x184')]>0x0?_0x410c74[_0x4504('0x163')][_0x4504('0x164')]['substring'](_0x328cd2[_0x4504('0x184')]):_0x410c74[_0x4504('0x163')]['phone']):util['format'](_0x4504('0x185'),_[_0x4504('0xab')](_0x328cd2[_0x4504('0x139')])?_0x328cd2[_0x4504('0x73')][_0x4504('0x40')]:_0x328cd2[_0x4504('0x139')][_0x4504('0x40')],isNotNull(_0x328cd2[_0x4504('0x182')])?_0x328cd2[_0x4504('0x182')][_0x4504('0x183')]()||'':'',_0x328cd2[_0x4504('0x184')]>0x0?_0x410c74['Contact']['phone']['substring'](_0x328cd2['dialCutDigit']):_0x410c74[_0x4504('0x163')]['phone']),'callerid':_0x598b9b,'Exten':_0x4504('0x16b'),'Context':_0x4504('0x186'),'Priority':'1','variable':_0x130b11,'timeout':(_0x328cd2[_0x4504('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x33e880})['then'](function(_0x2da768){return _0xa768a4(_0x2da768);})[_0x4504('0xb4')](function(_0x366f47){_0x328cd2[_0x4504('0x61')]+=0x1;var _0x4ed383=new History(_0x2b1008['actions'][_0x33e880]);logger[_0x4504('0x93')](util[_0x4504('0x77')](_0x4504('0x187'),JSON[_0x4504('0x76')](_0x366f47)));_0x4ed383[_0x4504('0xdd')]=0xe;_0x4ed383[_0x4504('0xa5')]=_0x4504('0x188');_0x4ed383[_0x4504('0xa7')]=moment()[_0x4504('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ed383[_0x4504('0xa6')]=_0x4ed383[_0x4504('0xa7')];_0x2b1008[_0x4504('0xc5')](_0x4ed383)[_0x4504('0xb4')](loggerCatch(_0x4504('0x189')));_0x2b1008[_0x4504('0xc3')](_0x4ed383)[_0x4504('0xb4')](loggerCatch(_0x4504('0x189')))[_0x4504('0x20')](function(){delete _0x2b1008[_0x4504('0x11e')][_0x33e880];return _0x15a681(msgResponse(_0x4504('0x161'),_0x4504('0x48'),_0x4504('0x18a')));});});});};Dialer['prototype'][_0x4504('0x18b')]=function(_0xf189ff){var _0x584378=this[_0x4504('0x11e')][_0xf189ff[_0x4504('0x121')]];if(_0x584378){delete this[_0x4504('0x11e')][_0xf189ff[_0x4504('0x121')]];_0x584378[_0x4504('0x110')]=moment()[_0x4504('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x43aded=_0x584378[_0x4504('0x4b')]==='ivr'?this[_0x4504('0x23')][_0x584378[_0x4504('0xae')]]:this[_0x4504('0x22')][_0x584378[_0x4504('0x18c')]()];if(!this[_0x4504('0x18d')](_0xf189ff[_0x4504('0x18e')])){this[_0x4504('0xad')](_0x43aded);return this[_0x4504('0x18f')](_0x584378,_0x43aded,_0xf189ff)[_0x4504('0xb4')](loggerCatch(_0x4504('0x190')));}this['uniqueId'][_0xf189ff[_0x4504('0xd7')]]=_0x584378;}};Dialer[_0x4504('0x1d')][_0x4504('0x191')]=function(_0x95ef4c,_0x2b459a,_0x54ec1d){var _0x3f878f=new History(_0x2b459a);if(_0x3f878f[_0x4504('0xe9')]+_0x3f878f[_0x4504('0xfa')]+_0x3f878f[_0x4504('0xea')]+_0x3f878f['countnosuchnumberretry']+_0x3f878f[_0x4504('0xeb')]+_0x3f878f['countabandonedretry']+_0x3f878f[_0x4504('0xec')]+_0x3f878f[_0x4504('0xed')]>=_0x54ec1d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x95ef4c){case 0x3:if(_0x3f878f[_0x4504('0xea')]>=_0x54ec1d[_0x4504('0x192')]-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countnoanswerretry':_0x3f878f[_0x4504('0xea')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d['dialNoAnswerRetryFrequency'],'minutes')[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f['ListId'],'VoiceQueueId':_0x3f878f['VoiceQueueId']||undefined,'CampaignId':_0x3f878f[_0x4504('0xfc')]||undefined})['catch'](loggerCatch(_0x4504('0x193')));break;case 0x5:if(_0x3f878f[_0x4504('0xe9')]>=_0x54ec1d[_0x4504('0x194')]-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countbusyretry':_0x3f878f['countbusyretry']+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x195')],_0x4504('0xf6'))[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f['CampaignId']||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0x196')));break;case 0x8:if(_0x3f878f[_0x4504('0xfa')]>=_0x54ec1d[_0x4504('0x197')]-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countcongestionretry':_0x3f878f[_0x4504('0xfa')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x198')],'minutes')[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x3f878f['ContactId'],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f[_0x4504('0xfc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3f878f['countnosuchnumberretry']>=_0x54ec1d[_0x4504('0x199')]-0x1){return!![];}else{this[_0x4504('0xba')]({'active':![],'countnosuchnumberretry':_0x3f878f[_0x4504('0xfb')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x19a')],_0x4504('0xf6'))[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f[_0x4504('0xfc')]||undefined})[_0x4504('0xb4')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3f878f[_0x4504('0xeb')]>=_0x54ec1d[_0x4504('0x113')]-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countdropretry':_0x3f878f[_0x4504('0xeb')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x19b')],_0x4504('0xf6'))[_0x4504('0x77')](_0x4504('0xf7')),'ContactId':_0x3f878f['ContactId'],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f[_0x4504('0xfc')]||undefined})['catch'](loggerCatch(_0x4504('0x114')));break;case 0xb:if(_0x3f878f['countabandonedretry']>=_0x54ec1d['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countabandonedretry':_0x3f878f[_0x4504('0x11a')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x19c')],_0x4504('0xf6'))[_0x4504('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f['ListId'],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f[_0x4504('0xfc')]||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0x11b')));break;case 0x13:if(_0x3f878f[_0x4504('0xec')]>=_0x54ec1d['dialMachineMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x3f878f[_0x4504('0xec')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d['dialMachineRetryFrequency'],'minutes')['format'](_0x4504('0xf7')),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f[_0x4504('0xce')]||undefined,'CampaignId':_0x3f878f['CampaignId']||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0xfd')));break;case 0x14:if(_0x3f878f[_0x4504('0xed')]>=_0x54ec1d['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x4504('0xba')]({'active':![],'countagentrejectretry':_0x3f878f[_0x4504('0xed')]+=0x1,'scheduledat':moment()[_0x4504('0xf4')](_0x54ec1d[_0x4504('0x19d')],_0x4504('0xf6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3f878f[_0x4504('0xcb')],'ListId':_0x3f878f[_0x4504('0xcc')],'VoiceQueueId':_0x3f878f['VoiceQueueId']||undefined,'CampaignId':_0x3f878f['CampaignId']||undefined})[_0x4504('0xb4')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x4504('0x1d')][_0x4504('0x18f')]=function(_0x2d849e,_0x2d8fc7,_0x17b21d){var _0x58d8f3=this;var _0x12f4a5=new History(_0x2d849e);return new BPromise(function(_0xb45e8f,_0x5f11c7){if(_['isUndefined'](_0x2d8fc7)&&typeof _0x2d8fc7!=='object'){return _0x5f11c7(msgResponse(_0x4504('0x19e'),_0x4504('0x13e'),_0x4504('0x19f')));}if(_[_0x4504('0x83')](_0x17b21d)&&typeof _0x17b21d!==_0x4504('0x160')){return _0x5f11c7(msgResponse(_0x4504('0x19e'),_0x4504('0x13e'),_0x4504('0x1a0')));}switch(_0x17b21d[_0x4504('0x107')]){case'0':_0x2d8fc7['outboundNoSuchCallsDay']+=0x1;_0x12f4a5[_0x4504('0xdd')]=0x0;_0x12f4a5['statedesc']='NoSuchNumber';_0x12f4a5[_0x4504('0xfb')]+=0x1;_0x12f4a5[_0x4504('0xe7')]+=0x1;ami[_0x4504('0xe1')]('custom:agentnosuchnumber',ut[_0x4504('0xe2')](_0x2d849e,_0x4504('0x1a1')));_0x58d8f3[_0x4504('0xc5')](_0x12f4a5)[_0x4504('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x58d8f3[_0x4504('0x191')](0x0,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5[_0x4504('0xfb')]>=_0x2d8fc7[_0x4504('0x199')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1a2'));}else{_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1a2'));}}break;case'3':_0x2d8fc7[_0x4504('0x5f')]+=0x1;_0x12f4a5[_0x4504('0xdd')]=0x3;_0x12f4a5['statedesc']='NoAnswer';_0x12f4a5[_0x4504('0xea')]+=0x1;_0x12f4a5['countglobal']+=0x1;ami['emit'](_0x4504('0x1a3'),ut[_0x4504('0xe2')](_0x2d849e,'noanswer'));_0x58d8f3[_0x4504('0xc5')](_0x12f4a5)[_0x4504('0xb4')](loggerCatch(_0x4504('0x1a4')));if(_0x58d8f3['checkRetriveMax'](0x3,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5[_0x4504('0xea')]>=_0x2d8fc7[_0x4504('0x192')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,'reason\x203\x20ringing\x20no\x20answer');}else{_0x58d8f3['stateGlobal'](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1a5'));}}break;case'5':_0x2d8fc7[_0x4504('0x5b')]+=0x1;_0x12f4a5[_0x4504('0xdd')]=0x5;_0x12f4a5['statedesc']=_0x4504('0x1a6');_0x12f4a5[_0x4504('0xe9')]+=0x1;_0x12f4a5[_0x4504('0xe7')]+=0x1;ami[_0x4504('0xe1')](_0x4504('0x1a7'),ut[_0x4504('0xe2')](_0x2d849e,_0x4504('0x1a8')));_0x58d8f3['createHistory'](_0x12f4a5)[_0x4504('0xb4')](loggerCatch(_0x4504('0x1a9')));if(_0x58d8f3[_0x4504('0x191')](0x5,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5[_0x4504('0xe9')]>=_0x2d8fc7[_0x4504('0x194')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1aa'));}else{_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,'reason\x205\x20busy');}}break;case'8':_0x2d8fc7['outboundCongestionCallsDay']+=0x1;_0x12f4a5[_0x4504('0xdd')]=0x8;_0x12f4a5[_0x4504('0xa5')]='Congestion';_0x12f4a5['countcongestionretry']+=0x1;_0x12f4a5[_0x4504('0xe7')]+=0x1;ami['emit'](_0x4504('0x1ab'),ut['buildObj'](_0x2d849e,'congestion'));_0x58d8f3[_0x4504('0xc5')](_0x12f4a5)[_0x4504('0xb4')](loggerCatch(_0x4504('0x1ac')));if(_0x58d8f3['checkRetriveMax'](0x8,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5[_0x4504('0xfa')]>=_0x2d8fc7[_0x4504('0x197')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1ad'));}else{_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1ad'));}}break;case'11':_0x2d8fc7[_0x4504('0x1ae')]+=0x1;_0x12f4a5['state']=0xb;_0x12f4a5['statedesc']=_0x4504('0x11c');_0x12f4a5[_0x4504('0x11a')]+=0x1;_0x12f4a5[_0x4504('0xe7')]+=0x1;_0x58d8f3[_0x4504('0xc5')](_0x12f4a5)[_0x4504('0xb4')](loggerCatch(_0x4504('0x11d')));if(_0x58d8f3[_0x4504('0x191')](0xb,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5[_0x4504('0x11a')]>=_0x2d8fc7[_0x4504('0x1af')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1b0'));}else{_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1b0'));}}break;case'20':_0x2d8fc7[_0x4504('0x63')]+=0x1;_0x12f4a5[_0x4504('0xdd')]=0x14;_0x12f4a5[_0x4504('0xa5')]=_0x4504('0x1b1');_0x12f4a5[_0x4504('0xed')]+=0x1;_0x12f4a5[_0x4504('0xe7')]+=0x1;ami[_0x4504('0xe1')]('custom:agentreject',ut[_0x4504('0xe2')](_0x2d849e,'agentreject'));_0x58d8f3[_0x4504('0xc5')](_0x12f4a5)[_0x4504('0xb4')](loggerCatch(_0x4504('0x1b2')));if(_0x58d8f3[_0x4504('0x191')](0x14,_0x2d849e,_0x2d8fc7)){if(_0x12f4a5['countagentrejectretry']>=_0x2d8fc7[_0x4504('0x1b3')]){_0x58d8f3[_0x4504('0xf2')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x4504('0x1b4'));}else{_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,'reason\x2020\x20agentreject');}}break;default:_0x2d8fc7[_0x4504('0x103')]+=0x1;_0x12f4a5[_0x4504('0xdd')]=0xc;_0x12f4a5['statedesc']=_0x17b21d[_0x4504('0x107')];_0x58d8f3['createHistory'](_0x12f4a5)[_0x4504('0xb4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x58d8f3['checkRetriveMax'](_0x17b21d[_0x4504('0x107')],_0x2d849e,_0x2d8fc7)){if(_0x12f4a5['countbusyretry']+_0x12f4a5['countcongestionretry']+_0x12f4a5[_0x4504('0xea')]+_0x12f4a5['countnosuchnumberretry']+_0x12f4a5[_0x4504('0xeb')]+_0x12f4a5[_0x4504('0x11a')]+_0x12f4a5['countmachineretry']+_0x12f4a5[_0x4504('0xed')]>=_0x2d8fc7[_0x4504('0xee')]){_0x58d8f3[_0x4504('0xef')](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x17b21d[_0x4504('0x107')]);}else{_0x58d8f3['createStateFinal'](_0x12f4a5,_0xb45e8f,_0x5f11c7,_0x17b21d[_0x4504('0x107')]);}}}});};Dialer[_0x4504('0x1d')][_0x4504('0xef')]=function(_0x8ef4c5,_0x2558af,_0x554ce8,_0x1e1751){var _0x3d1478=new Final(_0x8ef4c5);_0x3d1478['state']=0xf;_0x3d1478[_0x4504('0xa5')]=_0x4504('0x1b5');this['createStateFinal'](_0x3d1478,_0x2558af,_0x554ce8,_0x1e1751);};Dialer[_0x4504('0x1d')][_0x4504('0xf2')]=function(_0x28fa4a,_0x5b0431,_0x22c416,_0x3b30b3){this[_0x4504('0xc3')](_0x28fa4a)['then'](function(){return _0x5b0431(msgResponse(_0x4504('0x19e'),'Success',_0x3b30b3));})[_0x4504('0xb4')](function(){return _0x22c416(msgResponse(_0x4504('0x1b6'),'Failure',_0x4504('0x1b7')));});};Dialer['prototype'][_0x4504('0xa')]=function(_0x3df0bc){var _0x30f97c=_0x3df0bc[_0x4504('0x1b8')]/0x64;var _0x27dc21=_0x3df0bc['outboundDropCallsDayTimeout']/(_0x3df0bc['outboundDropCallsDayTimeout']+_0x3df0bc[_0x4504('0x59')]);var _0x3fc752=Math[_0x4504('0x1b9')](_0x3df0bc[_0x4504('0x6d')]*(_0x3df0bc[_0x4504('0x1ba')]/0x64));var _0x2d68df=Math[_0x4504('0x1b9')](_0x3df0bc[_0x4504('0x6d')]*(_0x3df0bc[_0x4504('0x1bb')]/0x64));var _0x54a647=_0x3df0bc[_0x4504('0x9f')]+_0x3df0bc[_0x4504('0x51')];var _0x4b544b=Math[_0x4504('0x1bc')](_0x3df0bc[_0x4504('0x6f')]*_0x3df0bc['erlangAbandonmentRate']*_0x3df0bc[_0x4504('0x6a')]*_0x3df0bc[_0x4504('0x6b')]);if(_[_0x4504('0x83')](_0x3df0bc[_0x4504('0x2b')])){if(!_[_0x4504('0x83')](_0x3df0bc[_0x4504('0x2a')])){_0x3df0bc['startPredictive']=undefined;loggerPredictive[_0x4504('0x93')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x4504('0x83')](_0x3df0bc[_0x4504('0x8d')])){loggerPredictive[_0x4504('0x93')](_0x4504('0x1bd'),_0x4504('0x1be'));clearInterval(_0x3df0bc[_0x4504('0x8d')]);_0x3df0bc[_0x4504('0x8d')]=undefined;}_0x3df0bc[_0x4504('0x2b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x4504('0x7e')](_0x3df0bc[_0x4504('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x3df0bc[_0x4504('0x2b')]);this[_0x4504('0x152')](_0x3df0bc,0x1);}else if(ifInterval(_0x3df0bc[_0x4504('0x1bf')],_0x3df0bc[_0x4504('0x2b')])){this[_0x4504('0x152')](_0x3df0bc,0x1);loggerPredictiveCalls['info'](_0x4504('0x1c0'),_0x3df0bc[_0x4504('0x2b')],_0x3df0bc[_0x4504('0x40')]);_0x3df0bc[_0x4504('0x6f')]=0x0;_0x3df0bc['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x30f97c<_0x27dc21&&_0x3df0bc[_0x4504('0x1c1')]==='dropRate'){freeVariablesPredictive(_0x3df0bc);loggerPredictive[_0x4504('0x7e')](_0x4504('0x1c2'),_0x4504('0x1c3'),_0x27dc21,_0x4504('0x2b'),_0x3df0bc[_0x4504('0x40')]);}else if(_0x4b544b<_0x3df0bc[_0x4504('0x69')]&&_0x3df0bc[_0x4504('0x1c1')]===_0x4504('0x1c4')){freeVariablesPredictive(_0x3df0bc);loggerPredictive[_0x4504('0x7e')](_0x4504('0x1c5'),_0x4504('0x1c6'),_0x4b544b,_0x4504('0x1c7'),_0x3df0bc[_0x4504('0x69')],_0x4504('0x2b'),_0x3df0bc[_0x4504('0x40')]);}else if(!ifInterval(_0x3df0bc[_0x4504('0x1bf')],_0x3df0bc[_0x4504('0x2b')])&&_[_0x4504('0x83')](_0x3df0bc[_0x4504('0x2a')])&&!_[_0x4504('0x83')](_0x3df0bc[_0x4504('0x2b')])){_0x3df0bc[_0x4504('0x2a')]=moment()[_0x4504('0x77')](_0x4504('0xf7'));loggerPredictive[_0x4504('0x7e')](_0x3df0bc[_0x4504('0x40')],'started\x20in\x20predictive\x20at',_0x3df0bc[_0x4504('0x2a')]);this[_0x4504('0xb8')](_0x3df0bc[_0x4504('0x1bf')])['then'](this[_0x4504('0x1c8')](_0x3df0bc))['then'](mergeDataErlangB(_0x3df0bc))['then'](this[_0x4504('0x1c9')](_0x3df0bc))[_0x4504('0xb4')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x3df0bc));}else if(!ifInterval(_0x3df0bc[_0x4504('0x1bf')],_0x3df0bc[_0x4504('0x2a')])){_0x3df0bc[_0x4504('0x69')]=0x0;_0x3df0bc[_0x4504('0x2a')]=moment()[_0x4504('0x77')](_0x4504('0xf7'));loggerPredictive[_0x4504('0x7e')](_0x3df0bc[_0x4504('0x40')],_0x4504('0x1ca'),_0x3df0bc[_0x4504('0x2a')]);clearInterval(_0x3df0bc[_0x4504('0x8d')]);_0x3df0bc[_0x4504('0x8d')]=undefined;this['averageHandleTime'](_0x3df0bc['dialPredictiveInterval'])[_0x4504('0xb2')](this['getDataPredictive'](_0x3df0bc))['then'](mergeDataErlangB(_0x3df0bc))['then'](this[_0x4504('0x1c9')](_0x3df0bc))[_0x4504('0xb4')](loggerCatchPredictive(_0x4504('0x1cb'),_0x3df0bc));}else if(_0x3df0bc[_0x4504('0x6d')]&&_0x54a647<_0x3df0bc[_0x4504('0x6d')]-_0x2d68df){freeVariablesPredictive(_0x3df0bc);loggerPredictive[_0x4504('0x7e')](_0x3df0bc[_0x4504('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x54a647,')\x20are\x20less\x20than\x20threshold\x20(',_0x3df0bc[_0x4504('0x6d')],'-',_0x2d68df,'=',_0x3df0bc['predictiveIntervalAvailable']-_0x2d68df,')');}else if(_0x3df0bc[_0x4504('0x6d')]&&_0x54a647>_0x3df0bc[_0x4504('0x6d')]+_0x3fc752){freeVariablesPredictive(_0x3df0bc);loggerPredictive['info'](_0x3df0bc[_0x4504('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x54a647,_0x4504('0x1cc'),_0x3df0bc[_0x4504('0x6d')],'+',_0x3fc752,'=',_0x3df0bc['predictiveIntervalAvailable']+_0x3fc752,')');}};Dialer[_0x4504('0x1d')][_0x4504('0x1c8')]=function(_0x1664ec){var _0x2c2a01=this;return function(_0x2b3fd0){return new BPromise(function(_0x482696,_0x1c867c){_[_0x4504('0x89')](_0x1664ec,_0x2b3fd0[0x0]);if(checkGetDataPredictive(_0x2b3fd0[0x0])){var _0x4ccec2=_0x1664ec['predictiveIntervalAvailable']=_0x1664ec['talking']+_0x1664ec[_0x4504('0x9f')];var _0xdb9a86=_0x1664ec[_0x4504('0x1bf')]*0x3c;var _0x32fb51=_0x2b3fd0[0x0]['predictiveIntervalAvgTalktime']+_0x2b3fd0[0x0][_0x4504('0x65')];var _0x40c151=(_0x2b3fd0[0x0][_0x4504('0x64')]+_0x2b3fd0[0x0][_0x4504('0x67')]+_0x2b3fd0[0x0][_0x4504('0x80')])/_0x2b3fd0[0x0]['predictiveIntervalTotalCalls'];_0x1664ec[_0x4504('0x6a')]=_0x40c151>0x0?_0x40c151:0x1;switch(_0x1664ec['dialPredictiveOptimization']){case'dropRate':var _0x3c8466=_0x1664ec[_0x4504('0x1b8')]/0x64;return _0x2c2a01[_0x4504('0x1cd')](_0x4ccec2,_0xdb9a86,_0x32fb51,_0x40c151,_0x3c8466)[_0x4504('0xb2')](function(_0x1806d9){return _0x482696(_0x1806d9);});case _0x4504('0x1ce'):var _0xf7e32e=_0x1664ec[_0x4504('0x1b8')]/0x64;return _0x2c2a01['busyFactor'](_0x4ccec2,_0xdb9a86,_0x32fb51,_0x40c151,_0xf7e32e)[_0x4504('0xb2')](function(_0x5b3a86){return _0x482696(_0x5b3a86);});default:return _0x1c867c(msgResponse(_0x4504('0x1cf'),_0x4504('0x13e'),_0x4504('0x1d0')));}}else{return _0x1c867c(msgResponse('[getDataPredictive]',_0x4504('0x13e'),_0x4504('0x1d1')));}});};};Dialer[_0x4504('0x1d')][_0x4504('0x1d2')]=function(_0x1e7d53){var _0x5ba33a=this;return function(_0x50c92b){return new BPromise(function(_0x519d4d,_0x1c002d){_[_0x4504('0x89')](_0x1e7d53,_0x50c92b[0x0]);if(checkGetDataPredictive(_0x50c92b[0x0])){loggerPredictive[_0x4504('0x7e')](JSON['stringify'](_0x50c92b[0x0]));if(_0x1e7d53['dialPredictiveOptimization']===_0x4504('0x1c4')){return _0x5ba33a[_0x4504('0xc2')](_0x1e7d53['id'])[_0x4504('0xb2')](function(_0x1ef295){var _0x3a5ea9=_0x1e7d53[_0x4504('0x4e')]-_0x1ef295[0x0]['outboundQueuePauses'];var _0x10f3b6=_0x1e7d53[_0x4504('0x1bf')]*0x3c;var _0x525648=_0x50c92b[0x0]['predictiveIntervalAvgTalktime']+_0x50c92b[0x0][_0x4504('0x65')];var _0x5b049b=(_0x50c92b[0x0][_0x4504('0x64')]+_0x50c92b[0x0][_0x4504('0x67')]+_0x50c92b[0x0][_0x4504('0x80')])/_0x50c92b[0x0][_0x4504('0x1d3')];var _0x466768=_0x1e7d53[_0x4504('0x1b8')]/0x64;_0x1e7d53[_0x4504('0x6c')]=_0x1ef295[0x0]['outboundQueuePauses']||0x0;_0x1e7d53[_0x4504('0x6a')]=_0x5b049b>0x0?_0x5b049b:0x1;return _0x5ba33a['abandonmentRate'](_0x3a5ea9,_0x10f3b6,_0x525648,_0x5b049b,_0x466768);})[_0x4504('0xb2')](function(_0x53f1af){return _0x519d4d(_0x53f1af);})[_0x4504('0xb4')](function(_0x566141){return _0x1c002d(msgResponse(_0x4504('0x1d4'),_0x4504('0x13e'),JSON[_0x4504('0x76')](_0x566141)));});}if(_0x1e7d53[_0x4504('0x1c1')]===_0x4504('0x1ce')){return _0x5ba33a[_0x4504('0xc2')](_0x1e7d53['id'])['then'](function(_0x2dada5){var _0x21d2d4=_0x1e7d53[_0x4504('0x4e')]-_0x2dada5[0x0][_0x4504('0x1d5')];var _0x159e56=_0x1e7d53[_0x4504('0x1bf')]*0x3c;var _0x38c273=_0x50c92b[0x0][_0x4504('0x66')]+_0x50c92b[0x0][_0x4504('0x65')];var _0x388229=(_0x50c92b[0x0][_0x4504('0x64')]+_0x50c92b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x50c92b[0x0][_0x4504('0x80')])/_0x50c92b[0x0][_0x4504('0x1d3')];var _0xafa982=_0x1e7d53[_0x4504('0x1b8')]/0x64;_0x1e7d53[_0x4504('0x6c')]=_0x2dada5[0x0]['outboundQueuePauses']||0x0;_0x1e7d53['predictiveIntervalHitRate']=_0x388229>0x0?_0x388229:0x1;return _0x5ba33a[_0x4504('0x1d6')](_0x21d2d4,_0x159e56,_0x38c273,_0x388229,_0xafa982);})['then'](function(_0x5abaac){return _0x519d4d(_0x5abaac);})['catch'](function(_0x6a3915){return _0x1c002d(msgResponse(_0x4504('0x1d4'),_0x4504('0x13e'),JSON['stringify'](_0x6a3915)));});}}else{return _0x1c002d(msgResponse(_0x4504('0x1cf'),_0x4504('0x13e'),_0x4504('0x1d1')));}});};};Dialer['prototype'][_0x4504('0x1c9')]=function(_0x58b4a3){var _0x2e04df=this;return function(){var _0x2805b9=0x0;var _0x4354b3=Math['floor'](_0x58b4a3['erlangCallToSecond']*0x3e8);if(_0x4354b3>0x0){_0x4354b3=_0x4354b3<0x64?0x64:_0x4354b3;loggerPredictive[_0x4504('0x7e')](_0x58b4a3['name'],_0x4504('0x1d7'),_0x4354b3,_0x4504('0x49'));_0x58b4a3[_0x4504('0x8d')]=setInterval(function(){_0x2e04df['handlePredictive'](_0x58b4a3);loggerPredictiveCalls['info']('[handlePredictive]',_0x2805b9+=0x1);},_0x4354b3);}else{loggerPredictive['info'](_0x58b4a3['name'],_0x4504('0x1d8'));}};};Dialer[_0x4504('0x1d')][_0x4504('0x1d9')]=function(_0x24cb28,_0x3de494){var _0x2d4aa6=this;return function(_0x17e40a){if(_['isEmpty'](_0x17e40a)){if(_[_0x4504('0xab')](_0x3de494[_0x4504('0xcd')])||!_0x3de494[_0x4504('0x1da')]){if(_0x24cb28[_0x4504('0x150')]===_0x4504('0x9')){_0x24cb28[_0x4504('0x127')]=_[_0x4504('0x83')](_0x24cb28[_0x4504('0x127')])?!![]:_0x24cb28[_0x4504('0x127')];var _0x3e84b1=uuid['v4']();_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1]=new Action(_0x24cb28,_0x3de494,_0x3e84b1);loggerBooked[_0x4504('0x7e')]('[booked][checkContactBlack]',_0x3e84b1,_0x4504('0x1db'),JSON[_0x4504('0x76')](_0x24cb28['queueStatusComplete']),_0x4504('0x1dc'),_0x24cb28[_0x4504('0x40')]);if(_0x24cb28[_0x4504('0x127')]){_0x24cb28[_0x4504('0x127')]=![];_0x2d4aa6[_0x4504('0x2c')][_0x2d4aa6['actions'][_0x3e84b1]['queue']]=[];ami[_0x4504('0x181')]({'actionid':_0x3e84b1,'action':'queuestatus','queue':_0x24cb28['name']})[_0x4504('0xb4')](function(){_0x2d4aa6['updateOriginated'](_0x24cb28);_0x2d4aa6[_0x4504('0xba')]({'active':![],'ContactId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1][_0x4504('0xcb')],'ListId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1][_0x4504('0xcc')],'VoiceQueueId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1][_0x4504('0xce')]||undefined,'CampaignId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1][_0x4504('0xfc')]||undefined})[_0x4504('0xb4')](loggerCatch(_0x4504('0x1dd')));delete _0x2d4aa6['actions'][_0x3e84b1];});}else{loggerBooked[_0x4504('0x7e')](_0x4504('0x1de'),JSON[_0x4504('0x76')](_0x24cb28[_0x4504('0x127')]),_0x4504('0x1dc'),_0x24cb28[_0x4504('0x40')]);_0x2d4aa6['updateOriginated'](_0x24cb28);_0x2d4aa6[_0x4504('0xba')]({'active':![],'ContactId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1][_0x4504('0xcb')],'ListId':_0x2d4aa6['actions'][_0x3e84b1][_0x4504('0xcc')],'VoiceQueueId':_0x2d4aa6['actions'][_0x3e84b1]['VoiceQueueId']||undefined,'CampaignId':_0x2d4aa6[_0x4504('0x11e')][_0x3e84b1]['CampaignId']||undefined})['catch'](loggerCatch(_0x4504('0x1dd')));delete _0x2d4aa6[_0x4504('0x11e')][_0x3e84b1];}}else{return _0x2d4aa6[_0x4504('0x1df')](_0x24cb28,_0x3de494);}}else{if(getDiff(_0x3de494[_0x4504('0x1e0')])<_0x24cb28[_0x4504('0x1e1')]*0x3c){if(_0x3de494['Agent']&&!_0x3de494[_0x4504('0x1e2')][_0x4504('0x1e3')]){_0x2d4aa6['preview'][_0x4504('0x1e4')](_0x3de494['id'])[_0x4504('0x20')](function(){_0x2d4aa6[_0x4504('0xad')](_0x24cb28);});}else{_0x2d4aa6['unlockContact']({'active':![]},_0x3de494['id'],0x1)[_0x4504('0x20')](function(){_0x2d4aa6[_0x4504('0xad')](_0x24cb28);});}}else{_0x24cb28[_0x4504('0x62')]+=0x1;_0x2d4aa6[_0x4504('0xad')](_0x24cb28);if(_0x24cb28[_0x4504('0x1e5')]){_0x2d4aa6[_0x4504('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3de494[_0x4504('0xcb')],'ListId':_0x3de494[_0x4504('0xcc')],'VoiceQueueId':_0x3de494['VoiceQueueId']||undefined,'CampaignId':_0x3de494[_0x4504('0xfc')]||undefined})['catch'](loggerCatch(_0x4504('0x1e6')));_0x2d4aa6[_0x4504('0xc5')](createObjHistory(_0x24cb28,_0x3de494,'RECALLINQUEUE',0x17,_0x4504('0x1e7')))['catch'](loggerCatch(_0x4504('0x1e8')));}else{_0x2d4aa6[_0x4504('0xc9')](createObjHistory(_0x24cb28,_0x3de494,_0x4504('0x1e9'),0x16,'RecallFailedTimeout'),_0x4504('0x1ea'),_0x4504('0x1eb'));}}}}else{_0x24cb28[_0x4504('0x5a')]+=0x1;_0x2d4aa6[_0x4504('0xc9')](createObjHistory(_0x24cb28,_0x3de494,_0x4504('0x1ec'),0xd,_0x4504('0x1ed')),_0x4504('0x1ee'),_0x4504('0x1ef'));throw _0x4504('0x1f0');}};};Dialer['prototype'][_0x4504('0x156')]=function(_0xa599df){var _0x4d215b=this;var _0x1de5d=_0xa599df[_0x4504('0x1f1')]-_0xa599df[_0x4504('0x6e')]-_0xa599df[_0x4504('0xbf')];emitCampaignSummary(_0xa599df);if(_0x1de5d>0x0){if(_0x1de5d>this['maxNumberOriginate']){_0x1de5d=this[_0x4504('0x26')];}_0xa599df[_0x4504('0xbf')]+=_0x1de5d;this[_0x4504('0x1f2')](_0xa599df['id'],_0x1de5d,_0xa599df[_0x4504('0x1f3')],_0xa599df)[_0x4504('0xb2')](function(_0x3542ec){_0xa599df[_0x4504('0xbf')]-=_0x1de5d;_0xa599df[_0x4504('0xbf')]=_0xa599df[_0x4504('0xbf')]>0x0?_0xa599df['temp']:0x0;if(!checkContactEmpty(_0x3542ec)){_0xa599df[_0x4504('0x46')]=_0x4504('0x9c');logger['info'](_0x4504('0x1f4')+_0xa599df[_0x4504('0x40')]);}else{_0xa599df[_0x4504('0x6e')]+=_0x3542ec[_0x4504('0x12b')];_0xa599df['message']=_0x4504('0x1f5');for(var _0x209369=0x0;_0x209369<_0x3542ec[_0x4504('0x12b')];_0x209369+=0x1){_0xa599df['ivrTotalCallsDays']+=0x1;if(_[_0x4504('0xab')](_0x3542ec[_0x209369])||_['isNil'](_0x3542ec[_0x209369]['Contact'])||_[_0x4504('0xab')](_0x3542ec[_0x209369][_0x4504('0x163')][_0x4504('0x164')])){_0x4d215b[_0x4504('0xc7')](_0x4504('0x1f6'),_0xa599df,_0x3542ec[_0x209369]);}else{_0x4d215b[_0x4504('0xb7')](_['pick'](_0x3542ec[_0x209369],[_0x4504('0xfc'),_0x4504('0x1f7')]))[_0x4504('0xb2')](_0x4d215b[_0x4504('0x1d9')](_0xa599df,_0x3542ec[_0x209369]))[_0x4504('0xb4')](_0x4d215b['loggerHandler']('[actionOriginateIvr]\x20',_0xa599df));}}}})[_0x4504('0xb4')](loggerGetContactDialer('[getContactCampaign2]',_0xa599df,_0x1de5d));}};Dialer[_0x4504('0x1d')][_0x4504('0x152')]=function(_0x20aaad,_0x24a369){var _0x250ee4=this;var _0xe57189=[];var _0x41ac03=_0x24a369>=0x1?_0x24a369:0x1;if(_0x20aaad['dialMethod']===_0x4504('0x9')){_0x41ac03=0x1;}var _0x34ab44=Math['floor'](_0x20aaad['available']*_0x41ac03)-_0x20aaad['originated']-_0x20aaad[_0x4504('0xbf')];emitVoiceQueueSummary(_0x20aaad);if(_0x20aaad[_0x4504('0x1f8')]>0x0){var _0x32be10=_0x20aaad[_0x4504('0x1f8')]-_0x20aaad[_0x4504('0x6e')]-_0x20aaad['talking']-_0x20aaad[_0x4504('0xbf')]-_0x20aaad[_0x4504('0x9d')];if(_0x34ab44>_0x32be10){_0x34ab44=_0x32be10;}}if(_0x34ab44>0x0){if(_0x20aaad[_0x4504('0x150')]===_0x4504('0x9')){_0x34ab44=0x1;}if(_0x34ab44>this[_0x4504('0x26')]){_0x34ab44=this[_0x4504('0x26')];}_0x20aaad[_0x4504('0xbf')]+=_0x34ab44;for(var _0x48a288 in this[_0x4504('0x24')]){if(typeof this[_0x4504('0x24')][_0x48a288]!==_0x4504('0x96')){if(this[_0x4504('0x24')][_0x48a288]['state']===_0x4504('0x1f9')&&this[_0x4504('0x24')][_0x48a288][_0x4504('0xd3')]===_0x4504('0xd4')){_0xe57189['push'](this['agents'][_0x48a288]['id']);}}}this[_0x4504('0xbe')](_0x20aaad['id'],_0xe57189,_0x34ab44,_0x20aaad['dialOrderByScheduledAt'],_0x20aaad)[_0x4504('0xb2')](function(_0x163b82){_0x20aaad['temp']-=_0x34ab44;_0x20aaad['temp']=_0x20aaad['temp']>0x0?_0x20aaad[_0x4504('0xbf')]:0x0;if(!checkContactEmpty(_0x163b82)){_0x250ee4[_0x4504('0xb3')](_0x20aaad)[_0x4504('0xb2')](sendMessageReschedule(_0x20aaad))[_0x4504('0xb4')](loggerCatch(_0x4504('0xb5')));}else{_0x20aaad[_0x4504('0x6e')]+=_0x163b82['length'];_0x20aaad[_0x4504('0x46')]=_0x20aaad['dialMethod']===_0x4504('0x9')?_0x4504('0x16a'):_0x4504('0x1f5');for(var _0x12f458=0x0;_0x12f458<_0x163b82[_0x4504('0x12b')];_0x12f458+=0x1){if(_[_0x4504('0xab')](_0x163b82[_0x12f458])||_['isNil'](_0x163b82[_0x12f458][_0x4504('0x163')])||_[_0x4504('0xab')](_0x163b82[_0x12f458][_0x4504('0x163')]['phone'])){_0x250ee4[_0x4504('0xc7')](_0x4504('0x1f6'),_0x20aaad,_0x163b82[_0x12f458]);}else{_0x250ee4['checkIsBlackList'](_[_0x4504('0xca')](_0x163b82[_0x12f458],[_0x4504('0xce'),'Contact.phone']))[_0x4504('0xb2')](_0x250ee4['checkContactBlack'](_0x20aaad,_0x163b82[_0x12f458]))[_0x4504('0xb4')](_0x250ee4[_0x4504('0x1fa')](_0x4504('0x1f6'),_0x20aaad));}}}})['catch'](loggerGetContactDialer(_0x4504('0x1fb'),_0x20aaad,_0x34ab44));}};Dialer[_0x4504('0x1d')][_0x4504('0x8d')]=function(_0x4b2de1){if(_0x4b2de1[_0x4504('0x1f8')]>0x0){var _0x160386=_0x4b2de1['dialLimitQueue']-_0x4b2de1[_0x4504('0x6e')]-_0x4b2de1['talking'];if(_0x160386>0x0){this[_0x4504('0x1fc')](_0x4b2de1);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x4b2de1);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x322a26){var _0x4a7d9f=this;var _0x8fa2a=[];_0x322a26[_0x4504('0x6e')]+=0x1;for(var _0xf84cab in this['agents']){if(typeof this[_0x4504('0x24')][_0xf84cab]!==_0x4504('0x96')){if(this[_0x4504('0x24')][_0xf84cab]['state']===_0x4504('0x1f9')&&this['agents'][_0xf84cab]['status']==='reachable'){_0x8fa2a[_0x4504('0x145')](this[_0x4504('0x24')][_0xf84cab]['id']);}}}this['getContactDialer'](_0x322a26['id'],_0x8fa2a,0x1,_0x322a26[_0x4504('0x1f3')],_0x322a26)[_0x4504('0xb2')](function(_0x26c7bc){if(!checkContactEmpty(_0x26c7bc)){checkContactLowerLimitOriginate(_0x322a26,0x1,0x0);_0x4a7d9f['countReScheduled'](_0x322a26)['then'](sendMessageReschedule(_0x322a26))[_0x4504('0xb4')](loggerCatch(_0x4504('0xb5')));}else{_0x322a26[_0x4504('0x46')]=_0x4504('0x1f5');if(_[_0x4504('0xab')](_0x26c7bc[0x0])||_[_0x4504('0xab')](_0x26c7bc[0x0][_0x4504('0x163')])||_[_0x4504('0xab')](_0x26c7bc[0x0][_0x4504('0x163')]['phone'])){_0x4a7d9f[_0x4504('0xc7')]('[actionOriginate]\x20',_0x322a26,_0x26c7bc[0x0]);}else{_0x4a7d9f[_0x4504('0xb6')](_[_0x4504('0xca')](_0x26c7bc[0x0],[_0x4504('0xce'),_0x4504('0x1f7')]))[_0x4504('0xb2')](_0x4a7d9f[_0x4504('0x1d9')](_0x322a26,_0x26c7bc[0x0]))[_0x4504('0xb4')](_0x4a7d9f[_0x4504('0x1fa')]('[actionOriginatePredictive]\x20',_0x322a26));}}})['catch'](loggerGetContactDialer(_0x4504('0x1fd'),_0x322a26,0x1));emitVoiceQueueSummary(_0x322a26);};Dialer['prototype'][_0x4504('0x1cd')]=function(_0x46cdd9,_0x1f75ff,_0x56bdea,_0x3b29b3,_0x3d843c,_0x541c4e){loggerPredictive['info'](_0x4504('0x1fe'));loggerPredictive[_0x4504('0x7e')](_0x4504('0x1ff'),_0x46cdd9);loggerPredictive[_0x4504('0x7e')](_0x4504('0x200'),_0x1f75ff);loggerPredictive[_0x4504('0x7e')](_0x4504('0x201'),_0x56bdea);loggerPredictive[_0x4504('0x7e')](_0x4504('0x202'),_0x3b29b3);loggerPredictive['info'](_0x4504('0x203'),_0x3d843c);loggerPredictive[_0x4504('0x7e')](_0x4504('0x88'));return new BPromise(function(_0x49b1a8,_0x92fe38){if(_0x46cdd9<=0x0||isNaN(_0x46cdd9)){return _0x92fe38(msgResponse(_0x4504('0x204'),_0x4504('0x48'),_0x4504('0x205')+_0x46cdd9));}if(_0x56bdea<=0x0||isNaN(_0x56bdea)){return _0x92fe38(msgResponse('[abandonmentRate]',_0x4504('0x48'),_0x4504('0x206')+_0x56bdea));}if(_0x3b29b3<=0x0||isNaN(_0x3b29b3)){return _0x92fe38(msgResponse('[abandonmentRate]','Error','p\x20=\x20'+_0x3b29b3));}if(_0x1f75ff<=0x0||isNaN(_0x1f75ff)){return _0x92fe38(msgResponse('[abandonmentRate]',_0x4504('0x48'),_0x4504('0x207')+_0x1f75ff));}if(_0x3d843c<=0x0||isNaN(_0x3d843c)){return _0x92fe38(msgResponse(_0x4504('0x204'),_0x4504('0x48'),_0x4504('0x208')+_0x3d843c));}_0x541c4e=_0x541c4e||0x0;var _0x2eded0=0x1/_0x56bdea;var _0x1f62da=0x0;var _0x275270=0x0;var _0x18dc1a=0x0;var _0x153051=0x0;for(var _0x4cac98=0x0;_0x18dc1a<_0x3d843c;_0x4cac98+=0x1){_0x275270=_0x4cac98/_0x1f75ff;_0x1f62da=(_0x3b29b3*_0x275270+_0x541c4e)/_0x2eded0;_0x18dc1a=erlangb(_0x1f62da,_0x46cdd9);_0x153051=_0x1f62da/_0x46cdd9*(0x1-erlangb(_0x1f62da,_0x46cdd9));}return _0x49b1a8({'erlangCalls':_0x4cac98,'erlangCallToSecond':_0x1f75ff/_0x4cac98,'erlangAbandonmentRate':_0x18dc1a,'erlangBusyFactor':_0x153051});});};Dialer[_0x4504('0x1d')]['busyFactor']=function(_0x19965c,_0x23f07d,_0x33ff80,_0x5aef92,_0x57a7a2,_0x51f970){loggerPredictive[_0x4504('0x7e')](_0x4504('0x209'));loggerPredictive[_0x4504('0x7e')](_0x4504('0x1ff'),_0x19965c);loggerPredictive['info'](_0x4504('0x200'),_0x23f07d);loggerPredictive[_0x4504('0x7e')]('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',_0x33ff80);loggerPredictive[_0x4504('0x7e')](_0x4504('0x202'),_0x5aef92);loggerPredictive[_0x4504('0x7e')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57a7a2);loggerPredictive[_0x4504('0x7e')](_0x4504('0x88'));return new BPromise(function(_0x85c6dc,_0x47cbae){if(_0x19965c<=0x0||isNaN(_0x19965c)){return _0x47cbae(msgResponse('[busyFactor]',_0x4504('0x48'),_0x4504('0x205')+_0x19965c));}if(_0x33ff80<=0x0||isNaN(_0x33ff80)){return _0x47cbae(msgResponse(_0x4504('0x20a'),_0x4504('0x48'),_0x4504('0x206')+_0x33ff80));}if(_0x5aef92<=0x0||isNaN(_0x5aef92)){return _0x47cbae(msgResponse('[busyFactor]',_0x4504('0x48'),_0x4504('0x20b')+_0x5aef92));}if(_0x23f07d<=0x0||isNaN(_0x23f07d)){return _0x47cbae(msgResponse(_0x4504('0x20a'),'Error',_0x4504('0x207')+_0x23f07d));}if(_0x57a7a2<=0x0||isNaN(_0x57a7a2)){return _0x47cbae(msgResponse(_0x4504('0x20a'),_0x4504('0x48'),_0x4504('0x20c')+_0x57a7a2));}_0x51f970=_0x51f970||0x0;var _0x9186a=0x1/_0x33ff80;var _0x39f056=0x0;var _0x2fc046=0x0;var _0x2af00c=0x0;var _0x2eba45=0x0;for(var _0x51e6eb=0x0;_0x2eba45<_0x57a7a2;_0x51e6eb+=0x1){_0x2fc046=_0x51e6eb/_0x23f07d;_0x39f056=(_0x5aef92*_0x2fc046+_0x51f970)/_0x9186a;_0x2af00c=erlangb(_0x39f056,_0x19965c);_0x2eba45=_0x39f056/_0x19965c*(0x1-erlangb(_0x39f056,_0x19965c));}return _0x85c6dc({'erlangCalls':_0x51e6eb,'erlangCallToSecond':_0x23f07d/_0x51e6eb,'erlangAbandonmentRate':_0x2af00c,'erlangBusyFactor':_0x2eba45});});};module[_0x4504('0x20d')]=Dialer; \ No newline at end of file +var _0xd9dc=['dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','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','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','endtime','starttime','clearZombieChannels','[uniqueid]','undefined','isNil','Action','channel','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','updateOriginated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','syncVarSet','uniqueId','uniqueid','variable','exten','xcally-motion-dialer','dialAMDActive','HANGUP','statedesc','membername','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','Machine','AMD','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countglobal','countnoanswerretry','countabandonedretry','dialGlobalMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','predictiveIntervalDroppedCallsCallersExit','outboundQueuePauses','abandonmentRate','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','Agent','voicePause','outboundReCallsDay','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','emptyContact','Contact.phone','[getContactCampaign2]','floor','dialLimitQueue','dialOrderByScheduledAt','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./history','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','Interval','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','outbound','strategy','answered','available','loggedIn','sumDuration','talking','total','type','abandoned','waiting','loggedInDb'];(function(_0x11afc5,_0x5e0530){var _0x2ef424=function(_0x56429b){while(--_0x56429b){_0x11afc5['push'](_0x11afc5['shift']());}};_0x2ef424(++_0x5e0530);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x2312d3,_0x277d99){_0x2312d3=_0x2312d3-0x0;var _0x446418=_0xd9dc[_0x2312d3];return _0x446418;};'use strict';var util=require('util');var _=require(_0xcd9d('0x0'));var BPromise=require(_0xcd9d('0x1'));var uuid=require('uuid');var moment=require(_0xcd9d('0x2'));var rr=require('rr');var md5=require(_0xcd9d('0x3'));var Redis=require(_0xcd9d('0x4'));var ut=require('../preview/util/util');var config=require(_0xcd9d('0x5'));var logger=require(_0xcd9d('0x6'))(_0xcd9d('0x7'));var loggerBooked=require(_0xcd9d('0x6'))(_0xcd9d('0x8'));var loggerPredictive=require('../../../config/logger')(_0xcd9d('0x9'));var loggerPredictiveCalls=require(_0xcd9d('0x6'))(_0xcd9d('0xa'));var loggerSyncQueueSummary=require(_0xcd9d('0x6'))(_0xcd9d('0xb'));var ami=require('../ami');config[_0xcd9d('0xc')]=_[_0xcd9d('0xd')](config[_0xcd9d('0xc')],{'host':_0xcd9d('0xe'),'port':0x18eb});var io=require(_0xcd9d('0xf'))(new Redis(config[_0xcd9d('0xc')]));var cmHopper=require(_0xcd9d('0x10'));var cmHopperHistory=require(_0xcd9d('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xcd9d('0x12'));var Action=require('./action');var History=require(_0xcd9d('0x13'));var Final=require('./final');var AgentComplete=require(_0xcd9d('0x14'));var QueueCallerAbandon=require(_0xcd9d('0x15'));var Hangup=require(_0xcd9d('0x16'));var ipAgi=process['env'][_0xcd9d('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0xcd9d('0x18'),'roundrobin':_0xcd9d('0x19')};var Sequence=function(){};Sequence[_0xcd9d('0x1a')]['enqueue']=function(_0x12edfc){this[_0xcd9d('0x1b')]=this['tail']?this[_0xcd9d('0x1b')]['finally'](_0x12edfc):_0x12edfc();};function Dialer(_0x3ea72c,_0x534c8f){this[_0xcd9d('0x1c')]=new Sequence();this[_0xcd9d('0x1d')]=_0x534c8f;this[_0xcd9d('0x1e')]=_0x3ea72c[_0xcd9d('0x1e')];this[_0xcd9d('0x1f')]=_0x3ea72c[_0xcd9d('0x1f')];this[_0xcd9d('0x20')]=_0x3ea72c[_0xcd9d('0x20')];this[_0xcd9d('0x21')]=_0x3ea72c[_0xcd9d('0x21')];this[_0xcd9d('0x22')]=config['maxNumberOriginate']||0x2;this[_0xcd9d('0x23')]={};this[_0xcd9d('0x24')]={};this[_0xcd9d('0x25')]={};this['uniqueId']={};this[_0xcd9d('0x26')]={};this[_0xcd9d('0x27')]={};this[_0xcd9d('0x28')]={};this[_0xcd9d('0x29')]={};this[_0xcd9d('0x2a')]={};this[_0xcd9d('0x2b')]={};ami['on'](_0xcd9d('0x2c'),this[_0xcd9d('0x2d')]['bind'](this));ami['on']('queuecallerabandon',this[_0xcd9d('0x2e')][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x30'),this[_0xcd9d('0x31')]['bind'](this));ami['on'](_0xcd9d('0x32'),this[_0xcd9d('0x33')][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x34'),this[_0xcd9d('0xb')][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x35'),this[_0xcd9d('0x36')][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x37'),this[_0xcd9d('0x38')][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x39'),this['syncVarSet'][_0xcd9d('0x2f')](this));ami['on'](_0xcd9d('0x3a'),this['syncQueueMember']['bind'](this));ami['on'](_0xcd9d('0x3b'),this[_0xcd9d('0x3c')]['bind'](this));this[_0xcd9d('0x3d')]();this[_0xcd9d('0x3e')]();}function isNotNull(_0x3c70de){return _0x3c70de!==null&&!_[_0xcd9d('0x3f')](_0x3c70de);}function checkIsLoggedIn(_0xe0f467,_0x4e485b){return function(){if(_0x4e485b<=0x0){_0xe0f467[_0xcd9d('0x40')]=_0xcd9d('0x41');throw _0xe0f467[_0xcd9d('0x42')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x1fef3c){return _0x1fef3c;}function checkIsActive(_0xcd6fa9,_0x38e3e2){return function(){if(!isActive(_0x38e3e2)){_0xcd6fa9['message']=_0xcd9d('0x43');throw _0xcd6fa9[_0xcd9d('0x42')]+_0xcd9d('0x44');}};}function checkInterval(_0xa4440){return function(){if(!isNotNull(_0xa4440['Interval'])){_0xa4440['message']=_0xcd9d('0x45');throw _0xa4440['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xa4440[_0xcd9d('0x46')][_0xcd9d('0x47')])){_0xa4440[_0xcd9d('0x40')]=_0xcd9d('0x45');throw _0xa4440['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xcd9d('0x48')](_0xa4440[_0xcd9d('0x46')][_0xcd9d('0x47')]))){_0xa4440['message']=_0xcd9d('0x45');throw _0xa4440[_0xcd9d('0x42')]+_0xcd9d('0x49');}};}function msgResponse(_0x1cac92,_0x37314d,_0x41ff12){return{'action':_0x1cac92,'response':_0x37314d,'message':_0x41ff12,'stack':_0x41ff12};}function myreject(_0x148957){return function(_0x258234){return _0x148957(msgResponse(_0xcd9d('0x4a'),_0xcd9d('0x4b'),JSON[_0xcd9d('0x4c')](_0x258234)));};}function getSeconds(_0x3a815d,_0x52cb2c){var _0x2f6eff=moment(_0x3a815d)[_0xcd9d('0x4d')](0x0);var _0x5630c7=moment(_0x52cb2c)['milliseconds'](0x0);return _0x2f6eff[_0xcd9d('0x4e')](_0x5630c7,'seconds');}function emit(_0x4dadc5,_0x31c5ea,_0x7aa07f){io['to'](_0x4dadc5)[_0xcd9d('0x4f')](_0x31c5ea,_0x7aa07f);}function emitVoiceQueueSummary(_0x4325f6){if(_0x4325f6['type']===_0xcd9d('0x50')){var _0x663d1e={'id':_0x4325f6['id'],'name':_0x4325f6['name'],'strategy':_0x4325f6[_0xcd9d('0x51')],'answered':_0x4325f6[_0xcd9d('0x52')],'available':_0x4325f6[_0xcd9d('0x53')],'loggedIn':_0x4325f6[_0xcd9d('0x54')],'pTalking':_0x4325f6['pTalking'],'sumBillable':_0x4325f6['sumBillable'],'sumDuration':_0x4325f6[_0xcd9d('0x55')],'sumHoldTime':_0x4325f6['sumHoldTime']||0x0,'talking':_0x4325f6[_0xcd9d('0x56')],'total':_0x4325f6[_0xcd9d('0x57')],'type':_0x4325f6[_0xcd9d('0x58')],'unmanaged':_0x4325f6['unmanaged'],'abandoned':_0x4325f6[_0xcd9d('0x59')],'waiting':_0x4325f6[_0xcd9d('0x5a')],'loggedInDb':_0x4325f6[_0xcd9d('0x5b')],'dialActive':_0x4325f6[_0xcd9d('0x5c')],'dialMethod':_0x4325f6[_0xcd9d('0x5d')],'dialOriginateCallerIdName':_0x4325f6[_0xcd9d('0x5e')],'dialOriginateCallerIdNumber':_0x4325f6[_0xcd9d('0x5f')],'dialOriginateTimeout':_0x4325f6[_0xcd9d('0x60')],'dialPrefix':_0x4325f6[_0xcd9d('0x61')],'outboundAnswerAgiCallsDay':_0x4325f6[_0xcd9d('0x62')],'outboundAnswerCallsDay':_0x4325f6[_0xcd9d('0x63')],'outboundBlacklistCallsDay':_0x4325f6['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4325f6['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4325f6['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4325f6[_0xcd9d('0x64')],'outboundDropCallsDayCallersExit':_0x4325f6[_0xcd9d('0x65')],'outboundDropCallsDayTimeout':_0x4325f6[_0xcd9d('0x66')],'outboundNoAnswerCallsDay':_0x4325f6['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4325f6[_0xcd9d('0x67')],'outboundOriginateFailureCallsDay':_0x4325f6[_0xcd9d('0x68')],'outboundReCallsDay':_0x4325f6['outboundReCallsDay'],'outboundRejectCallsDay':_0x4325f6[_0xcd9d('0x69')],'outboundUnknownCallsDay':_0x4325f6['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4325f6[_0xcd9d('0x6a')],'predictiveIntervalAvgHoldtime':_0x4325f6[_0xcd9d('0x6b')],'predictiveIntervalAvgTalktime':_0x4325f6['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4325f6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4325f6[_0xcd9d('0x6c')],'predictiveIntervalErlangCalls':_0x4325f6[_0xcd9d('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x4325f6[_0xcd9d('0x6e')],'predictiveIntervalHitRate':_0x4325f6[_0xcd9d('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x4325f6[_0xcd9d('0x70')],'predictiveIntervalPauses':_0x4325f6[_0xcd9d('0x71')],'predictiveIntervalAvailable':_0x4325f6['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4325f6['predictiveIntervalTotalCalls'],'message':_0x4325f6['message'],'originated':_0x4325f6[_0xcd9d('0x72')],'erlangCalls':_0x4325f6[_0xcd9d('0x73')],'erlangCallToSecond':_0x4325f6['erlangCallToSecond'],'erlangAbandonmentRate':_0x4325f6[_0xcd9d('0x74')],'erlangBusyFactor':_0x4325f6[_0xcd9d('0x75')],'startPredictive':_0x4325f6[_0xcd9d('0x27')],'startProgressive':_0x4325f6[_0xcd9d('0x28')]};if(_0x4325f6[_0xcd9d('0x76')]){_0x663d1e[_0xcd9d('0x76')]={'id':_0x4325f6[_0xcd9d('0x76')]['id'],'name':_0x4325f6[_0xcd9d('0x76')][_0xcd9d('0x42')],'active':_0x4325f6[_0xcd9d('0x76')]['active'],'callerid':_0x4325f6[_0xcd9d('0x76')][_0xcd9d('0x77')]};}if(_0x4325f6[_0xcd9d('0x46')]){_0x663d1e[_0xcd9d('0x46')]={'id':_0x4325f6[_0xcd9d('0x46')]['id'],'name':_0x4325f6[_0xcd9d('0x46')][_0xcd9d('0x42')]};}var _0x3234ea=md5(JSON['stringify'](_0x663d1e));if(_0x4325f6[_0xcd9d('0x3')]!==_0x3234ea){_0x4325f6[_0xcd9d('0x3')]=_0x3234ea;emit(util[_0xcd9d('0x78')]('voice:queue:%s',_0x663d1e[_0xcd9d('0x42')]),_0xcd9d('0x79'),_0x663d1e);}}}function emitCampaignSummary(_0x38d590){if(_0x38d590[_0xcd9d('0x58')]===_0xcd9d('0x7a')){emit(util[_0xcd9d('0x78')](_0xcd9d('0x7b'),_0x38d590[_0xcd9d('0x42')]),'campaign:save',_0x38d590);}}function checkGetDataPredictive(_0x15170e){if(isNotNull(_0x15170e)&&!_[_0xcd9d('0x48')](_0x15170e)){loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x7d'));loggerPredictive['info'](_0xcd9d('0x7e'),_0x15170e[_0xcd9d('0x7f')]);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x80'),_0x15170e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x81'),_0x15170e[_0xcd9d('0x6c')]);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x82'),_0x15170e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x83'),_0x15170e['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x84'),_0x15170e['predictiveIntervalAvgTalktime']);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x85'));if(_0x15170e[_0xcd9d('0x7f')]>0x0){if(!_[_0xcd9d('0x3f')](_0x15170e[_0xcd9d('0x86')])&&_0x15170e[_0xcd9d('0x86')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x15170e[_0xcd9d('0x6b')])&&_0x15170e[_0xcd9d('0x6b')]>0x0){return!![];}loggerPredictive[_0xcd9d('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x87'));}}else{loggerPredictive['info'](_0xcd9d('0x88'));}return![];}function mergeDataErlangB(_0x1877fd){return function(_0x3187c9){loggerPredictive['info'](_0xcd9d('0x89'));loggerPredictive[_0xcd9d('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3187c9[_0xcd9d('0x73')]);loggerPredictive['info'](_0xcd9d('0x8a'),_0x3187c9[_0xcd9d('0x8b')]);loggerPredictive[_0xcd9d('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3187c9[_0xcd9d('0x74')]);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x8c'),_0x3187c9[_0xcd9d('0x75')]);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x8d'),_0x3187c9[_0xcd9d('0x74')]);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x85'));_['merge'](_0x1877fd,_0x3187c9);};}function getDiff(_0x22a056){var _0x28c759=moment()[_0xcd9d('0x4d')](0x0);var _0x5e6052=moment(_0x22a056)[_0xcd9d('0x4d')](0x0);return _0x28c759[_0xcd9d('0x4e')](_0x5e6052,_0xcd9d('0x8e'));}function ifInterval(_0x2ec7fa,_0x10559c){if(_[_0xcd9d('0x3f')](_0x10559c)){return![];}return getDiff(_0x10559c)<_0x2ec7fa*0x3c;}function freeVariablesPredictive(_0x4dde5c){if(isNotNull(_0x4dde5c)){if(!_['isUndefined'](_0x4dde5c[_0xcd9d('0x28')])){_0x4dde5c[_0xcd9d('0x28')]=undefined;loggerPredictive[_0xcd9d('0x7c')](_0x4dde5c[_0xcd9d('0x42')],_0xcd9d('0x8f'));}if(!_['isUndefined'](_0x4dde5c[_0xcd9d('0x27')])){_0x4dde5c['startPredictive']=undefined;loggerPredictive[_0xcd9d('0x7c')](_0x4dde5c['name'],_0xcd9d('0x90'));}if(!_['isUndefined'](_0x4dde5c[_0xcd9d('0x91')])){clearInterval(_0x4dde5c[_0xcd9d('0x91')]);_0x4dde5c['handlePredictive']=undefined;loggerPredictive[_0xcd9d('0x7c')](_0x4dde5c['name'],_0xcd9d('0x92'));}}}function erlangb(_0x1b79f2,_0x521966){if(_0x521966===0x0){return 0x0;}var _0x305eff=0x1;for(var _0x2ad975=0x1;_0x2ad975<=_0x521966;_0x2ad975+=0x1){_0x305eff=0x1+_0x305eff*_0x2ad975/_0x1b79f2;}return 0x1/_0x305eff;}function isVoiceQueueOutbound(_0x23998d){return _0x23998d==='outbound';}function isNotPreview(_0x1301ed){return _0x1301ed!=='preview';}function isCampaignIvr(_0x55701e){return _0x55701e===_0xcd9d('0x7a');}function getCallerId(_0x1780f6,_0x229e39,_0x538c53){if(!_[_0xcd9d('0x3f')](_0x538c53)&&typeof _0x538c53===_0xcd9d('0x93')&&!_[_0xcd9d('0x48')](_0x538c53)){if(!_[_0xcd9d('0x3f')](_0x229e39)&&typeof _0x229e39===_0xcd9d('0x93')&&!_[_0xcd9d('0x48')](_0x229e39)){return util['format'](_0xcd9d('0x94'),_0x229e39,_0x538c53);}return util[_0xcd9d('0x78')]('\x22%s\x22\x20<%s>',_0x538c53,_0x538c53);}if(!_[_0xcd9d('0x3f')](_0x1780f6)&&typeof _0x1780f6==='string'&&!_[_0xcd9d('0x48')](_0x1780f6)){return _0x1780f6;}return _0xcd9d('0x95');}function loggerCatchQueueSummary(_0x19cb99,_0x26ecba){return function(_0x3faeac){freeVariablesPredictive(_0x26ecba);emitVoiceQueueSummary(_0x26ecba);emitCampaignSummary(_0x26ecba);loggerSyncQueueSummary[_0xcd9d('0x96')](_0x19cb99,util[_0xcd9d('0x97')](_0x3faeac,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xb62b90,_0x2e7eef){return function(_0x4a16f8){loggerPredictive[_0xcd9d('0x96')](_0x2e7eef['name'],_0xb62b90);loggerPredictive[_0xcd9d('0x96')](_0x4a16f8[_0xcd9d('0x98')]);freeVariablesPredictive(_0x2e7eef);};}function loggerCatch(_0xede338){return function(_0x2f3c93){logger[_0xcd9d('0x96')](_0xede338,util['inspect'](_0x2f3c93,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xb6e0a6){return _0xb6e0a6&&!_[_0xcd9d('0x3f')](_0xb6e0a6)&&_0xb6e0a6[_0xcd9d('0x99')]>0x0;}function decremetOriginate(_0x4f10b0){if(!_[_0xcd9d('0x3f')](_0x4f10b0)&&_0x4f10b0!==null){if(typeof _0x4f10b0['originated']!=='undefined'){if(_0x4f10b0[_0xcd9d('0x72')]>0x0){_0x4f10b0['originated']-=0x1;}else{logger[_0xcd9d('0x96')](_0xcd9d('0x9a'));}}}else{logger['error'](_0xcd9d('0x9b'));}}function checkContactLowerLimitOriginate(_0x110be1,_0x3da7c2,_0x1e7665){if(_0x3da7c2>_0x1e7665){for(var _0x5e9b80=0x0;_0x5e9b80<_0x3da7c2-_0x1e7665;_0x5e9b80+=0x1){decremetOriginate(_0x110be1);}}}function loggerGetContactDialer(_0x52b1bc,_0x565ee7,_0x4b42ae){return function(_0x4b196e){checkContactLowerLimitOriginate(_0x565ee7,_0x4b42ae,0x0);logger[_0xcd9d('0x96')](_0x52b1bc,util['inspect'](_0x4b196e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3d1bd0){return function(_0x3f9a2d){if(isNotNull(_0x3f9a2d)&&isNotNull(_0x3f9a2d[0x0])){if(_0x3f9a2d[0x0][_0xcd9d('0x9c')]>0x0){_0x3d1bd0[_0xcd9d('0x40')]=_0xcd9d('0x9d');logger[_0xcd9d('0x7c')]('[getContactDialer2][ReScheduled]'+_0x3d1bd0[_0xcd9d('0x42')],_0x3f9a2d[0x0][_0xcd9d('0x9c')],_0xcd9d('0x9e'));}else{_0x3d1bd0['message']=_0xcd9d('0x9f');logger[_0xcd9d('0x7c')](_0xcd9d('0xa0')+_0x3d1bd0['name']);}}};}function notSendMessagesQueue(_0x3398a5){if(_0x3398a5['sendMessageOneNotActive']){freeVariablesPredictive(_0x3398a5);if(_0x3398a5[_0xcd9d('0x72')]===0x0&&_0x3398a5[_0xcd9d('0x56')]===0x0&&_0x3398a5[_0xcd9d('0x5a')]===0x0&&(_0x3398a5[_0xcd9d('0xa1')]||0x0)===0x0){_0x3398a5[_0xcd9d('0xa2')]=![];_0x3398a5[_0xcd9d('0x53')]=0x0;_0x3398a5[_0xcd9d('0x40')]=_0xcd9d('0x43');loggerSyncQueueSummary[_0xcd9d('0x96')](_0xcd9d('0xa3'),_0x3398a5['name'],'is\x20not\x20active');}else{_0x3398a5[_0xcd9d('0x40')]=_0xcd9d('0xa4');loggerSyncQueueSummary[_0xcd9d('0x96')](_0xcd9d('0xa3'),_0x3398a5['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x3398a5);}}function notSendMessagesCampaign(_0x4f6261){if(_0x4f6261[_0xcd9d('0xa2')]){if(_0x4f6261['originated']===0x0){_0x4f6261[_0xcd9d('0xa2')]=![];_0x4f6261[_0xcd9d('0x40')]=_0xcd9d('0x43');loggerSyncQueueSummary[_0xcd9d('0x96')](_0xcd9d('0xa5'),_0x4f6261[_0xcd9d('0x42')],_0xcd9d('0xa6'));}else{_0x4f6261[_0xcd9d('0x40')]=_0xcd9d('0xa4');loggerSyncQueueSummary[_0xcd9d('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4f6261[_0xcd9d('0x42')],_0xcd9d('0xa7'));}emitCampaignSummary(_0x4f6261);}}function createObjHistory(_0x59490,_0x1cf4d3,_0x3212fd,_0x2dc70f,_0x40a18c){_0x59490[_0xcd9d('0x40')]=_0x3212fd;var _0x13d9e7=new Action(_0x59490,_0x1cf4d3);var _0x1588d3=new History(_0x13d9e7);_0x1588d3[_0xcd9d('0xa8')]=_0x2dc70f;_0x1588d3['statedesc']=_0x40a18c;_0x1588d3[_0xcd9d('0xa9')]=_0x13d9e7[_0xcd9d('0xaa')];return _0x1588d3;}Dialer[_0xcd9d('0x1a')][_0xcd9d('0x3e')]=function(){var _0x2d1581=this;setInterval(function(){_0x2d1581[_0xcd9d('0xab')](_0x2d1581['uniqueId'],_0xcd9d('0xac'));_0x2d1581[_0xcd9d('0xab')](_0x2d1581[_0xcd9d('0x24')],'[actions]');},0x32c8);};Dialer[_0xcd9d('0x1a')]['clearZombieChannels']=function(_0x55dbdf,_0x3a5b3f){var _0x4a9171=this;for(var _0x70305f in _0x55dbdf){if(typeof _0x55dbdf[_0x70305f]!==_0xcd9d('0xad')){this[_0xcd9d('0x1c')]['enqueue'](function(){if(!_[_0xcd9d('0xae')](_0x55dbdf[_0x70305f])){return ami[_0xcd9d('0xaf')]({'action':'status','channel':_0x55dbdf[_0x70305f][_0xcd9d('0xb0')]})['catch'](function(_0x55edf9){if(_0x55edf9[_0xcd9d('0x40')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x55dbdf[_0x70305f]&&_0x55dbdf[_0x70305f][_0xcd9d('0x58')]!==_0xcd9d('0x7a')){_0x4a9171['updateOriginated'](_0x4a9171[_0xcd9d('0x1e')][_0x55dbdf[_0x70305f][_0xcd9d('0xb1')]]);logger[_0xcd9d('0x96')]('[Dialer][checkChannel]',_0x3a5b3f,_0x70305f,_0x55dbdf[_0x70305f][_0xcd9d('0xb1')]);delete _0x55dbdf[_0x70305f];}if(_0x55dbdf[_0x70305f]&&_0x55dbdf[_0x70305f][_0xcd9d('0x58')]==='ivr'){_0x4a9171['updateOriginated'](_0x4a9171[_0xcd9d('0x1f')][_0x55dbdf[_0x70305f][_0xcd9d('0xb1')]]);logger['error'](_0xcd9d('0xb2'),_0x3a5b3f,_0x70305f,_0x55dbdf[_0x70305f][_0xcd9d('0xb1')]);delete _0x55dbdf[_0x70305f];}},0x2328);}});}});}}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xb3')]=function(_0x1e8e46){return BPromise[_0xcd9d('0xb4')]()['then'](cmHopper[_0xcd9d('0xb3')](_0x1e8e46))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xb6')));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xb7')]=function(_0x30b236){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopperBlack['checkIsBlackList'](_0x30b236))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xb9')));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xba')]=function(_0x6d834c){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopperBlack['checkIsBlackListIvr'](_0x6d834c))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xbb')));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xbc')]=function(_0xdeb72c){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopperHistory[_0xcd9d('0xbd')](_0xdeb72c))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xbe')));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xbf')]=function(_0x475a4e){return BPromise['resolve']()[_0xcd9d('0xb8')](cmHopper[_0xcd9d('0xbf')](_0x475a4e))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xc0')));};Dialer[_0xcd9d('0x1a')]['unlockContact']=function(_0x271d18,_0x5d044c,_0x4cc739){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopper[_0xcd9d('0xc1')](_0x271d18,_0x5d044c,_0x4cc739))[_0xcd9d('0xb5')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xcd9d('0x1a')]['getContactDialer']=function(_0x4e01c7,_0x6abb45,_0x5c502b,_0x319742,_0x4d11d0){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopper[_0xcd9d('0xc2')](_0x4e01c7,_0x6abb45,_0x5c502b,_0x319742))[_0xcd9d('0xb5')](function(_0x42b407){_0x4d11d0[_0xcd9d('0xc3')]-=_0x5c502b;_0x4d11d0['temp']=_0x4d11d0['temp']>0x0?_0x4d11d0['temp']:0x0;loggerCatch(_0xcd9d('0xc4'))(_0x42b407);});};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xc5')]=function(_0x4043dd,_0x1ee340,_0x39e0f9,_0x2be97e){return BPromise[_0xcd9d('0xb4')]()['then'](cmHopper['getContactDialerIvr'](_0x4043dd,_0x1ee340,_0x39e0f9))[_0xcd9d('0xb5')](function(_0x11d55b){_0x2be97e[_0xcd9d('0xc3')]-=_0x1ee340;_0x2be97e[_0xcd9d('0xc3')]=_0x2be97e[_0xcd9d('0xc3')]>0x0?_0x2be97e[_0xcd9d('0xc3')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x11d55b);});};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xc6')]=function(_0x2f0219){return BPromise['resolve']()[_0xcd9d('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x2f0219))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xc7')));};Dialer[_0xcd9d('0x1a')]['moveContactManagedDialer']=function(_0x152155){return BPromise['resolve']()[_0xcd9d('0xb8')](cmHopper[_0xcd9d('0xc8')](_0x152155))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xc9')));};Dialer[_0xcd9d('0x1a')]['createHistory']=function(_0x38534a){return BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](cmHopperHistory[_0xcd9d('0xca')](_0x38534a))[_0xcd9d('0xb5')](loggerCatch('[createHistory]\x20'));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xcb')]=function(_0x39802f){if(!_[_0xcd9d('0x3f')](_0x39802f)&&_0x39802f!==null){if(typeof _0x39802f[_0xcd9d('0x72')]!==_0xcd9d('0xad')){if(_0x39802f[_0xcd9d('0x72')]>0x0){_0x39802f[_0xcd9d('0x72')]-=0x1;}else{logger[_0xcd9d('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xcd9d('0x96')](_0xcd9d('0xcc'));}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xcd')]=function(_0x1ff306,_0x39d6bc){var _0x1d57ad=this;return function(_0x252d11){_0x1d57ad[_0xcd9d('0xcb')](_0x39d6bc);logger[_0xcd9d('0x96')](_0x1ff306,util['inspect'](_0x252d11,{'showHidden':![],'depth':null}));};};Dialer[_0xcd9d('0x1a')]['emptyContact']=function(_0x9830cc,_0xc8c44f,_0x1c445d){var _0x363488={'state':0x19,'statedesc':_0xcd9d('0xce')};this[_0xcd9d('0xcb')](_0xc8c44f);this[_0xcd9d('0xcf')](_[_0xcd9d('0xd0')](_0x363488,_[_0xcd9d('0xd1')](_0x1c445d,[_0xcd9d('0xd2'),'ListId',_0xcd9d('0xd3'),_0xcd9d('0xd4'),_0xcd9d('0xd5')])),_0xcd9d('0xd6'),_0xcd9d('0xd7'));logger[_0xcd9d('0x96')](_0x9830cc);};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xd8')]=function(_0xa6862d){return _0xa6862d===_0xcd9d('0xd9');};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xda')]=function(_0x492e78){return!_[_0xcd9d('0x3f')](_0x492e78)&&_0x492e78&&!_[_0xcd9d('0x3f')](_0x492e78[_0xcd9d('0x42')])&&!_[_0xcd9d('0x3f')](_0x492e78[_0xcd9d('0xdb')])&&_0x492e78['active']&&(this['trunks'][util[_0xcd9d('0x78')](_0xcd9d('0xdc'),_0x492e78['name'])]['status']===_0xcd9d('0xdd')||this[_0xcd9d('0x21')][util['format'](_0xcd9d('0xdc'),_0x492e78[_0xcd9d('0x42')])][_0xcd9d('0xde')]===_0xcd9d('0xdf'));};Dialer[_0xcd9d('0x1a')]['saveInDb']=function(_0x362402,_0xc93231,_0x4c623b){this[_0xcd9d('0xca')](_0x362402)[_0xcd9d('0xb5')](loggerCatch(_0xc93231));this['moveContactManagedDialer'](_0x362402)[_0xcd9d('0xb5')](loggerCatch(_0x4c623b));};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xe0')]=function(_0xceec8e){var _0x4c8a05=this[_0xcd9d('0xe1')][_0xceec8e[_0xcd9d('0xe2')]];var _0x197e09;if(!_['isNil'](_0xceec8e)&&!_[_0xcd9d('0xae')](_0xceec8e[_0xcd9d('0xe3')])&&!_[_0xcd9d('0xae')](_0xceec8e['variable']['amdstatus'])&&_0xceec8e[_0xcd9d('0xe4')]===_0xcd9d('0xe5')&&_0x4c8a05){if(_0x4c8a05[_0xcd9d('0x58')]!==_0xcd9d('0x7a')&&this[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]][_0xcd9d('0xe6')]&&_0xceec8e['value']===_0xcd9d('0xe7')){delete this[_0xcd9d('0xe1')][_0xceec8e[_0xcd9d('0xe2')]];this[_0xcd9d('0xcb')](this['voiceQueues'][_0x4c8a05[_0xcd9d('0xb1')]]);this[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x197e09=new Hangup(_0x4c8a05,_0xceec8e);_0x197e09[_0xcd9d('0xa8')]=0x12;_0x197e09[_0xcd9d('0xe8')]='HangupInAMD';_0x197e09[_0xcd9d('0xe9')]='AMD';ami[_0xcd9d('0x4f')](_0xcd9d('0xea'),ut[_0xcd9d('0xeb')](_0x197e09,'amd'));this[_0xcd9d('0xcf')](_0x197e09,_0xcd9d('0xec'),_0xcd9d('0xed'));}if(_0x4c8a05[_0xcd9d('0x58')]!==_0xcd9d('0x7a')&&this[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]][_0xcd9d('0xe6')]&&_0xceec8e[_0xcd9d('0xee')]==='MACHINE'){var _0x1be1c2=this;return new BPromise(function(_0x5abcc7,_0x1ddded){delete _0x1be1c2['uniqueId'][_0xceec8e[_0xcd9d('0xe2')]];_0x1be1c2[_0xcd9d('0xcb')](_0x1be1c2[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]]);_0x1be1c2[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]][_0xcd9d('0x63')]+=0x1;_0x1be1c2[_0xcd9d('0x1e')][_0x4c8a05['queue']][_0xcd9d('0x62')]+=0x1;var _0x209bde=_0x1be1c2[_0xcd9d('0x1e')][_0x4c8a05[_0xcd9d('0xb1')]];var _0x3e8a70=new Hangup(_0x4c8a05,_0xceec8e);_0x3e8a70[_0xcd9d('0xa8')]=0x13;_0x3e8a70['statedesc']=_0xcd9d('0xef');_0x3e8a70[_0xcd9d('0xe9')]=_0xcd9d('0xf0');_0x3e8a70['countmachineretry']+=0x1;_0x3e8a70['countglobal']+=0x1;_0x3e8a70[_0xcd9d('0xf1')]=!![];ami[_0xcd9d('0x4f')](_0xcd9d('0xea'),ut['buildObj'](_0x3e8a70,_0xcd9d('0xf1')));_0x1be1c2['createHistory'](_0x3e8a70)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xf2')));if(_0x3e8a70[_0xcd9d('0xf3')]+_0x3e8a70[_0xcd9d('0xf4')]+_0x3e8a70['countnoanswerretry']+_0x3e8a70[_0xcd9d('0xf5')]+_0x3e8a70[_0xcd9d('0xf6')]+_0x3e8a70['countabandonedretry']+_0x3e8a70[_0xcd9d('0xf7')]+_0x3e8a70['countagentrejectretry']>=_0x209bde['dialGlobalMaxRetry']){_0x1be1c2[_0xcd9d('0xf8')](_0x3e8a70,_0x5abcc7,_0x1ddded,_0xcd9d('0xf9'));}else{if(_0x3e8a70[_0xcd9d('0xf7')]>=_0x209bde[_0xcd9d('0xfa')]){_0x1be1c2[_0xcd9d('0xfb')](_0x3e8a70,_0x5abcc7,_0x1ddded,_0xcd9d('0xfc'));}else{_0x1be1c2['rescheduleContact']({'active':![],'countmachineretry':_0x3e8a70[_0xcd9d('0xf7')],'scheduledat':moment()[_0xcd9d('0xfd')](_0x209bde[_0xcd9d('0xfe')],_0xcd9d('0xff'))['format'](_0xcd9d('0x100')),'ContactId':_0x3e8a70[_0xcd9d('0xd2')],'ListId':_0x3e8a70[_0xcd9d('0x101')],'VoiceQueueId':_0x3e8a70['VoiceQueueId']||undefined,'CampaignId':_0x3e8a70['CampaignId']||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x102')));_0x5abcc7({'reschedule':0x1});}}});}if(_0x4c8a05['type']===_0xcd9d('0x7a')&&this[_0xcd9d('0x1f')][_0x4c8a05['queue']][_0xcd9d('0xe6')]&&_0xceec8e['value']==='HANGUP'){delete this[_0xcd9d('0xe1')][_0xceec8e[_0xcd9d('0xe2')]];this[_0xcd9d('0xcb')](this[_0xcd9d('0x1f')][_0x4c8a05[_0xcd9d('0xb1')]]);_0x197e09=new Hangup(_0x4c8a05,_0xceec8e);_0x197e09[_0xcd9d('0xa8')]=0x12;_0x197e09['statedesc']=_0xcd9d('0x103');_0x197e09[_0xcd9d('0xe9')]=_0xcd9d('0xf0');ami[_0xcd9d('0x4f')](_0xcd9d('0xea'),ut[_0xcd9d('0xeb')](_0x197e09,_0xcd9d('0xf1')));this[_0xcd9d('0xcf')](_0x197e09,_0xcd9d('0x104'),_0xcd9d('0x105'));}if(_0x4c8a05['type']===_0xcd9d('0x7a')&&this['campaigns'][_0x4c8a05[_0xcd9d('0xb1')]]['dialAMDActive']&&_0xceec8e[_0xcd9d('0xee')]===_0xcd9d('0x106')){var _0x1be1c2=this;return new BPromise(function(_0x3435ce,_0x1d8ff7){delete _0x1be1c2[_0xcd9d('0xe1')][_0xceec8e[_0xcd9d('0xe2')]];_0x1be1c2[_0xcd9d('0xcb')](_0x1be1c2[_0xcd9d('0x1f')][_0x4c8a05[_0xcd9d('0xb1')]]);_0x1be1c2['campaigns'][_0x4c8a05[_0xcd9d('0xb1')]][_0xcd9d('0x63')]+=0x1;_0x1be1c2[_0xcd9d('0x1f')][_0x4c8a05[_0xcd9d('0xb1')]][_0xcd9d('0x62')]+=0x1;var _0x228bfe=_0x1be1c2['campaigns'][_0x4c8a05[_0xcd9d('0xb1')]];var _0x4be8b1=new Hangup(_0x4c8a05,_0xceec8e);_0x4be8b1['state']=0x13;_0x4be8b1[_0xcd9d('0xe8')]=_0xcd9d('0xef');_0x4be8b1['membername']=_0xcd9d('0xf0');_0x4be8b1[_0xcd9d('0xf7')]+=0x1;_0x4be8b1[_0xcd9d('0x107')]+=0x1;_0x4be8b1[_0xcd9d('0xf1')]=!![];ami[_0xcd9d('0x4f')]('custom:amd',ut[_0xcd9d('0xeb')](_0x4be8b1,_0xcd9d('0xf1')));_0x1be1c2['createHistory'](_0x4be8b1)['catch'](loggerCatch(_0xcd9d('0xf2')));if(_0x4be8b1[_0xcd9d('0xf3')]+_0x4be8b1[_0xcd9d('0xf4')]+_0x4be8b1[_0xcd9d('0x108')]+_0x4be8b1['countnosuchnumberretry']+_0x4be8b1['countdropretry']+_0x4be8b1[_0xcd9d('0x109')]+_0x4be8b1[_0xcd9d('0xf7')]+_0x4be8b1['countagentrejectretry']>=_0x228bfe[_0xcd9d('0x10a')]){_0x1be1c2['stateGlobal'](_0x4be8b1,_0x3435ce,_0x1d8ff7,_0xcd9d('0xf9'));}else{if(_0x4be8b1[_0xcd9d('0xf7')]>=_0x228bfe[_0xcd9d('0xfa')]){_0x1be1c2[_0xcd9d('0xfb')](_0x4be8b1,_0x3435ce,_0x1d8ff7,_0xcd9d('0xfc'));}else{_0x1be1c2['rescheduleContact']({'active':![],'countmachineretry':_0x4be8b1[_0xcd9d('0xf7')],'scheduledat':moment()[_0xcd9d('0xfd')](_0x228bfe[_0xcd9d('0xfe')],_0xcd9d('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4be8b1[_0xcd9d('0xd2')],'ListId':_0x4be8b1[_0xcd9d('0x101')],'VoiceQueueId':_0x4be8b1[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x4be8b1[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x102')));_0x3435ce({'reschedule':0x1});}}});}}};Dialer['prototype'][_0xcd9d('0x36')]=function(_0x1e1e58){var _0x549c43=this[_0xcd9d('0xe1')][_0x1e1e58[_0xcd9d('0xe2')]];var _0x2150c6=this;var _0x5ba836;if(_0x549c43&&_0x549c43[_0xcd9d('0x58')]===_0xcd9d('0x7a')){delete this['uniqueId'][_0x1e1e58[_0xcd9d('0xe2')]];this['updateOriginated'](this[_0xcd9d('0x1f')][_0x549c43[_0xcd9d('0xb1')]]);this[_0xcd9d('0x1f')][_0x549c43['queue']][_0xcd9d('0x10b')]+=0x1;_0x5ba836=new Hangup(_0x549c43,_0x1e1e58);this[_0xcd9d('0xca')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x10c')));this[_0xcd9d('0xc8')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x10d')));}if(_0x549c43&&_0x549c43[_0xcd9d('0x58')]!==_0xcd9d('0x7a')&&isNotNull(this['voiceQueues'][_0x549c43[_0xcd9d('0xb1')]]['dialQueueProject'])){delete this['uniqueId'][_0x1e1e58['uniqueid']];this[_0xcd9d('0xcb')](this[_0xcd9d('0x1e')][_0x549c43['queue']]);this[_0xcd9d('0x1e')][_0x549c43['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xcd9d('0x1e')][_0x549c43[_0xcd9d('0xb1')]][_0xcd9d('0x62')]+=0x1;_0x5ba836=new Hangup(_0x549c43,_0x1e1e58);_0x5ba836[_0xcd9d('0xa8')]=0x10;_0x5ba836[_0xcd9d('0xe8')]=_0xcd9d('0x10e');_0x5ba836[_0xcd9d('0xe9')]=_0xcd9d('0x10f');this[_0xcd9d('0xca')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x10c')));this[_0xcd9d('0xc8')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x10d')));}if(_0x549c43&&_0x549c43[_0xcd9d('0x58')]!==_0xcd9d('0x7a')&&!isNotNull(this[_0xcd9d('0x1e')][_0x549c43[_0xcd9d('0xb1')]][_0xcd9d('0x110')])){delete this[_0xcd9d('0xe1')][_0x1e1e58[_0xcd9d('0xe2')]];this[_0xcd9d('0xcb')](this[_0xcd9d('0x1e')][_0x549c43['queue']]);this[_0xcd9d('0x1e')][_0x549c43[_0xcd9d('0xb1')]][_0xcd9d('0x111')]+=0x1;_0x5ba836=new Hangup(_0x549c43,_0x1e1e58);_0x5ba836[_0xcd9d('0xa8')]=0xc;_0x5ba836['statedesc']=_0x1e1e58[_0xcd9d('0x112')];_0x5ba836[_0xcd9d('0xe9')]=_0xcd9d('0x113');this[_0xcd9d('0xca')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x10c')));this[_0xcd9d('0xc8')](_0x5ba836)[_0xcd9d('0xb5')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x33')]=function(_0x2d1f5c){var _0x6ff888=this[_0xcd9d('0xe1')][_0x2d1f5c[_0xcd9d('0xe2')]];var _0x1d8c7d=this;if(this[_0xcd9d('0x1e')][_0x2d1f5c[_0xcd9d('0xb1')]]){if(_0x6ff888&&_0x6ff888[_0xcd9d('0x58')]!==_0xcd9d('0x7a')){delete this['uniqueId'][_0x2d1f5c[_0xcd9d('0xe2')]];this['voiceQueues'][_0x2d1f5c[_0xcd9d('0xb1')]][_0xcd9d('0x63')]+=0x1;var _0x5b7603=new AgentComplete(_0x6ff888,_0x2d1f5c);if(_0x2d1f5c[_0xcd9d('0x114')]===_0xcd9d('0x115')){_0x5b7603['agiafterat']=this[_0xcd9d('0x1e')][_0x2d1f5c[_0xcd9d('0xb1')]][_0xcd9d('0x116')]&&this[_0xcd9d('0x1e')][_0x2d1f5c[_0xcd9d('0xb1')]][_0xcd9d('0x117')]?moment()[_0xcd9d('0x78')](_0xcd9d('0x100')):undefined;}this[_0xcd9d('0xca')](_0x5b7603)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x118')));this[_0xcd9d('0xc8')](_0x5b7603)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x119')));}}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x2d')]=function(_0x5d8723){if(this[_0xcd9d('0x1e')][_0x5d8723['queue']]){if(this[_0xcd9d('0xe1')][_0x5d8723[_0xcd9d('0xe2')]]&&this['uniqueId'][_0x5d8723[_0xcd9d('0xe2')]][_0xcd9d('0x58')]!==_0xcd9d('0x7a')){this[_0xcd9d('0xcb')](this[_0xcd9d('0x1e')][_0x5d8723['queue']]);this['uniqueId'][_0x5d8723[_0xcd9d('0xe2')]][_0xcd9d('0x11a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x11b')]=function(_0x1251e1){this[_0xcd9d('0xca')](_0x1251e1)['catch'](loggerCatch(_0xcd9d('0x118')));this[_0xcd9d('0xc8')](_0x1251e1)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x11c')));};Dialer[_0xcd9d('0x1a')]['syncQueueCallerAbandon']=function(_0x25ca1c){var _0x515737=this['uniqueId'][_0x25ca1c[_0xcd9d('0xe2')]];var _0x44f33c=this;if(this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]]){if(_0x515737&&_0x515737[_0xcd9d('0x58')]!==_0xcd9d('0x7a')){delete this['uniqueId'][_0x25ca1c['uniqueid']];this[_0xcd9d('0xcb')](this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]]);_0x515737[_0xcd9d('0x11d')]=moment()[_0xcd9d('0x78')]('YYYY-MM-DD\x20HH:mm:ss');var _0x26ba4=new QueueCallerAbandon(_0x515737,_0x25ca1c);if(getSeconds(_0x515737['droptime'],_0x515737[_0xcd9d('0x11e')])>=_0x515737['dialQueueTimeout']){this[_0xcd9d('0x1e')][_0x25ca1c['queue']][_0xcd9d('0x6c')]+=0x1;this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]][_0xcd9d('0x66')]+=0x1;this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]][_0xcd9d('0x6e')]+=0x1;_0x26ba4[_0xcd9d('0xa8')]=0xa;_0x26ba4[_0xcd9d('0xe8')]='Drop';_0x26ba4['dropreason']=_0xcd9d('0x11f');_0x26ba4['agiafterat']=this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]]['dialQueueProject2']?moment()[_0xcd9d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x26ba4[_0xcd9d('0xf6')]+=0x1;_0x26ba4[_0xcd9d('0x107')]+=0x1;if(_0x26ba4[_0xcd9d('0xf6')]>=this['voiceQueues'][_0x25ca1c[_0xcd9d('0xb1')]][_0xcd9d('0x120')]){this[_0xcd9d('0x11b')](_0x26ba4);}else{this[_0xcd9d('0xbf')]({'active':![],'countdropretry':_0x26ba4[_0xcd9d('0xf6')],'scheduledat':moment()[_0xcd9d('0xfd')](this[_0xcd9d('0x1e')][_0x25ca1c['queue']][_0xcd9d('0x121')],'minutes')[_0xcd9d('0x78')](_0xcd9d('0x100')),'ContactId':_0x515737['ContactId'],'ListId':_0x515737[_0xcd9d('0x101')],'VoiceQueueId':_0x515737[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x515737[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x122')));var _0x495260=new History(_0x26ba4);_0x495260[_0xcd9d('0xa8')]=0xa;_0x495260[_0xcd9d('0xe8')]=_0xcd9d('0x123');_0x495260[_0xcd9d('0xaa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x495260['endtime']=_0x495260['starttime'];_0x495260[_0xcd9d('0x124')]=_0x26ba4['calleridname'];_0x495260[_0xcd9d('0x125')]=_0x26ba4['calleridnum'];this['createHistory'](_0x495260)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xcd9d('0x1e')][_0x25ca1c['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x25ca1c[_0xcd9d('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x26ba4['state']=0xb;_0x26ba4[_0xcd9d('0xe8')]=_0xcd9d('0x126');_0x26ba4[_0xcd9d('0x127')]=_0xcd9d('0x128');_0x26ba4[_0xcd9d('0x109')]+=0x1;_0x26ba4['countglobal']+=0x1;if(_0x26ba4[_0xcd9d('0x109')]>=this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]][_0xcd9d('0x129')]){this['queueCallerAbandonCreateState'](_0x26ba4);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x26ba4['countabandonedretry'],'scheduledat':moment()[_0xcd9d('0xfd')](this[_0xcd9d('0x1e')][_0x25ca1c[_0xcd9d('0xb1')]]['dialAbandonedRetryFrequency'],_0xcd9d('0xff'))[_0xcd9d('0x78')](_0xcd9d('0x100')),'ContactId':_0x515737['ContactId'],'ListId':_0x515737['ListId'],'VoiceQueueId':_0x515737[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x515737[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x12a')));var _0x495260=new History(_0x26ba4);_0x495260[_0xcd9d('0xa8')]=0xb;_0x495260['statedesc']=_0xcd9d('0x126');_0x495260[_0xcd9d('0xaa')]=moment()[_0xcd9d('0x78')](_0xcd9d('0x100'));_0x495260[_0xcd9d('0xa9')]=_0x495260[_0xcd9d('0xaa')];_0x495260[_0xcd9d('0x124')]=_0x26ba4[_0xcd9d('0x124')];_0x495260[_0xcd9d('0x125')]=_0x26ba4[_0xcd9d('0x125')];this[_0xcd9d('0xca')](_0x495260)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x12b')));}}}}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x38')]=function(_0x59cb68){if(this[_0xcd9d('0x24')][_0x59cb68[_0xcd9d('0xe2')]]){this[_0xcd9d('0x24')][_0x59cb68[_0xcd9d('0xe2')]][_0xcd9d('0xb0')]=_0x59cb68[_0xcd9d('0xb0')];}if(this[_0xcd9d('0xe1')][_0x59cb68[_0xcd9d('0xe2')]]){this[_0xcd9d('0xe1')][_0x59cb68[_0xcd9d('0xe2')]][_0xcd9d('0xb0')]=_0x59cb68[_0xcd9d('0xb0')];}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x12c')]=function(_0x332dd0){if(strategy[this[_0xcd9d('0x1e')][this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]['strategy']]===_0xcd9d('0x19')){if(this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]]&&_[_0xcd9d('0xae')](this['actions'][_0x332dd0[_0xcd9d('0x12d')]][_0xcd9d('0x12e')])&&_0x332dd0['status']==='1'&&_0x332dd0[_0xcd9d('0x12f')]==='0'){if(this['agents'][_0x332dd0[_0xcd9d('0x130')]]){if(!this['agents'][_0x332dd0[_0xcd9d('0x130')]][_0xcd9d('0x12e')]){this['agents'][_0x332dd0['stateinterface']][_0xcd9d('0x12e')]=!![];this['actions'][_0x332dd0[_0xcd9d('0x12d')]][_0xcd9d('0x12e')]=!![];this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]]['stateinterface']=_0x332dd0['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xcd9d('0x24')][_0x332dd0['actionid']][_0xcd9d('0xb1')]][_0xcd9d('0x51')]]||_0xcd9d('0x18'))===_0xcd9d('0x18')){if(this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]]){if(this[_0xcd9d('0x20')][_0x332dd0['stateinterface']]){this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]]['stateinterface']=_0x332dd0[_0xcd9d('0x130')];if(_[_0xcd9d('0xae')](this['queueBooked'][this['actions'][_0x332dd0[_0xcd9d('0x12d')]]['queue']])){this[_0xcd9d('0x2a')][this['actions'][_0x332dd0[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]=[];}this[_0xcd9d('0x2a')][this[_0xcd9d('0x24')][_0x332dd0['actionid']][_0xcd9d('0xb1')]][_0xcd9d('0x131')](_[_0xcd9d('0xd0')](_['pick'](this[_0xcd9d('0x24')][_0x332dd0[_0xcd9d('0x12d')]],[_0xcd9d('0x132'),_0xcd9d('0x130')]),{'status':_0x332dd0[_0xcd9d('0xde')],'paused':_0x332dd0[_0xcd9d('0x12f')]}));}}}};function unlockQueueStatus(_0x3be193,_0x4d0c4c){setTimeout(function(){if(_[_0xcd9d('0x3f')](_0x3be193[_0xcd9d('0x133')])){loggerBooked[_0xcd9d('0x96')](_0xcd9d('0x134'),_0x4d0c4c);}_0x3be193[_0xcd9d('0x133')]=!![];loggerBooked[_0xcd9d('0x7c')](_0xcd9d('0x135'),_0x4d0c4c,JSON[_0xcd9d('0x4c')](_[_0xcd9d('0xd1')](_0x3be193,[_0xcd9d('0x42'),_0xcd9d('0x133')])));},0x1f3);}Dialer['prototype'][_0xcd9d('0x3c')]=function(_0x44b573){var _0x33c33d=this;var _0x4c113f=_0x33c33d['voiceQueues'][_0x33c33d[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['queue']];if(strategy[this[_0xcd9d('0x1e')][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['queue']][_0xcd9d('0x51')]]===_0xcd9d('0x19')){if(this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]&&this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0x130')]){this['preview'][_0xcd9d('0x136')](this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['idHopper'],this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0x130')])['catch'](function(_0x454b47){logger[_0xcd9d('0x96')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xcd9d('0x97')](_0x454b47,{'showHidden':![],'depth':null}));})[_0xcd9d('0x137')](function(){_0x33c33d[_0xcd9d('0xcb')](_0x33c33d[_0xcd9d('0x1e')][_0x33c33d[_0xcd9d('0x24')][_0x44b573['actionid']][_0xcd9d('0xb1')]]);_0x33c33d['agents'][_0x33c33d[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0x130')]]['locked']=![];delete _0x33c33d[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]];unlockQueueStatus(_0x4c113f);});}else{this[_0xcd9d('0xcb')](this['voiceQueues'][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['queue']]);this[_0xcd9d('0xbf')]({'active':![],'ContactId':this['actions'][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xd2')],'ListId':this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0x101')],'VoiceQueueId':this[_0xcd9d('0x24')][_0x44b573['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]];unlockQueueStatus(_0x4c113f);}}else if((strategy[this[_0xcd9d('0x1e')][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['queue']][_0xcd9d('0x51')]]||'rrmemory')===_0xcd9d('0x18')){var _0x493979;if(this['actions'][_0x44b573[_0xcd9d('0x12d')]]&&!_[_0xcd9d('0x48')](this[_0xcd9d('0x2a')][this['actions'][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]])){if(this[_0xcd9d('0x2b')][_0x33c33d[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]){this[_0xcd9d('0x2b')][_0x33c33d['actions'][_0x44b573['actionid']][_0xcd9d('0xb1')]]=this[_0xcd9d('0x2b')][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]?this[_0xcd9d('0x2b')][this['actions'][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]:this[_0xcd9d('0x2a')][this['actions'][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]?this['queueBooked'][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]]['queue']][_0xcd9d('0x138')]||0x0:0x0;}this[_0xcd9d('0x2a')][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]]['_rr']=this['queueBookedRR'][this[_0xcd9d('0x24')][_0x44b573[_0xcd9d('0x12d')]][_0xcd9d('0xb1')]];for(var _0x560040=0x0;_0x560040=0x0;})['catch'](myreject(_0xa07819)));}}else{_0x224449[_0xcd9d('0x131')](ami[_0xcd9d('0xaf')]({'action':'command','command':util[_0xcd9d('0x78')]('iftime\x20%s,%s',_0x48c520,!_[_0xcd9d('0x3f')](config['timezones'][_0x19439c])?_0x19439c:'')})[_0xcd9d('0xb8')](function(_0x4414cd){return _0x4414cd['content'][_0xcd9d('0x154')](_0xcd9d('0x155'))>=0x0;})[_0xcd9d('0xb5')](myreject(_0xa07819)));}BPromise[_0xcd9d('0x156')](_0x224449)[_0xcd9d('0xb8')](function(_0x45194b){var _0x3592de=_[_0xcd9d('0x157')](_0x45194b);if(_0x3592de){return _0x42097c(_0x3592de);}else{_0x9b2c38['message']=_0x5bf6b0?_0xcd9d('0x158'):'INTERVAL_IS_OVERTIME';return _0xa07819(msgResponse(_0xcd9d('0x159'),_0xcd9d('0x149'),_0xcd9d('0x15a')+_0x5bf6b0+'\x20'+_0x50c35c+_0xcd9d('0x15b')+util[_0xcd9d('0x97')](_0x48c520,{'showHidden':![],'depth':null})+_0xcd9d('0x15c')+_0x19439c));}})[_0xcd9d('0xb5')](function(_0x3e3290){return _0xa07819(msgResponse(_0xcd9d('0x148'),_0xcd9d('0x149'),JSON[_0xcd9d('0x4c')](_0x3e3290)));});});};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x15d')]=function(_0x12fc9c){var _0x3679be=this;return function(){switch(_0x12fc9c[_0xcd9d('0x5d')]){case _0xcd9d('0x15e'):freeVariablesPredictive(_0x12fc9c);_0x3679be[_0xcd9d('0x15f')](_0x12fc9c,0x1);break;case'power':freeVariablesPredictive(_0x12fc9c);_0x3679be[_0xcd9d('0x15f')](_0x12fc9c,_0x12fc9c[_0xcd9d('0x160')]);break;case _0xcd9d('0x9'):_0x3679be['predictive'](_0x12fc9c);break;case'booked':freeVariablesPredictive(_0x12fc9c);_0x3679be['handlePower'](_0x12fc9c,0x1);break;default:freeVariablesPredictive(_0x12fc9c);logger['error'](_0xcd9d('0x161'),_0x12fc9c[_0xcd9d('0x42')],_0xcd9d('0x162'));}};};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x163')]=function(_0x167a70){var _0x223892=this;return function(){_0x223892[_0xcd9d('0x164')](_0x167a70);};};Dialer['prototype'][_0xcd9d('0xb')]=function(_0x4437a0){var _0x4ca309=this;if(isNotPreview(_0x4437a0[_0xcd9d('0x5d')])){if(isVoiceQueueOutbound(_0x4437a0[_0xcd9d('0x58')])&&isActive(_0x4437a0[_0xcd9d('0x5c')])){_0x4437a0[_0xcd9d('0xa2')]=!![];BPromise['resolve']()[_0xcd9d('0xb8')](checkIsLoggedIn(_0x4437a0,_0x4437a0[_0xcd9d('0x54')]))['then'](checkIsActive(_0x4437a0,_0x4437a0['dialActive']))['then'](checkInterval(_0x4437a0))[_0xcd9d('0xb8')](_0x4ca309[_0xcd9d('0x142')](_0x4437a0))[_0xcd9d('0xb8')](_0x4ca309[_0xcd9d('0x146')](_0x4437a0[_0xcd9d('0x165')],_0x4437a0[_0xcd9d('0x166')],_0x4437a0['name'],_0x4437a0))[_0xcd9d('0xb8')](_0x4ca309[_0xcd9d('0x147')](_0x4437a0[_0xcd9d('0x46')],_0x4437a0[_0xcd9d('0x166')],_0x4437a0[_0xcd9d('0x42')],_0x4437a0))[_0xcd9d('0xb8')](_0x4ca309['checkDialMethod'](_0x4437a0))[_0xcd9d('0xb5')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4437a0));}else{notSendMessagesQueue(_0x4437a0);}}else{freeVariablesPredictive(_0x4437a0);}};Dialer[_0xcd9d('0x1a')]['syncCampaigns']=function(){var _0x2c6121=this;var _0x20cf23;for(var _0x2e9e7b in this[_0xcd9d('0x1f')]){if(typeof this[_0xcd9d('0x1f')][_0x2e9e7b]!==_0xcd9d('0xad')){_0x20cf23=this[_0xcd9d('0x1f')][_0x2e9e7b];if(isCampaignIvr(_0x20cf23[_0xcd9d('0x58')])&&isActive(_0x20cf23['active'])){_0x20cf23[_0xcd9d('0xa2')]=!![];BPromise[_0xcd9d('0xb4')]()[_0xcd9d('0xb8')](checkIsActive(_0x20cf23,_0x20cf23[_0xcd9d('0xdb')]))[_0xcd9d('0xb8')](checkInterval(_0x20cf23))[_0xcd9d('0xb8')](_0x2c6121[_0xcd9d('0x142')](_0x20cf23))[_0xcd9d('0xb8')](_0x2c6121['checkIfTime'](_0x20cf23[_0xcd9d('0x165')],_0x20cf23[_0xcd9d('0x166')],_0x20cf23['name'],_0x20cf23))[_0xcd9d('0xb8')](_0x2c6121['checkIfTimeIntervals'](_0x20cf23[_0xcd9d('0x46')],_0x20cf23[_0xcd9d('0x166')],_0x20cf23[_0xcd9d('0x42')],_0x20cf23))[_0xcd9d('0xb8')](_0x2c6121[_0xcd9d('0x163')](_0x20cf23))[_0xcd9d('0xb5')](loggerCatchQueueSummary(_0xcd9d('0x167'),_0x20cf23));}else{notSendMessagesCampaign(_0x20cf23);}}}};function getCallerIdRandom(_0x523fea,_0x1e17b8){var _0x345266;var _0x3f55cb;var _0x2471df;if(_0x1e17b8<=0x0){_0x1e17b8=0x1;}_0x345266=new RegExp('\x5cw{0,'+_0x1e17b8+'}$');_0x3f55cb=Math['pow'](0xa,_0x1e17b8-0x1);_0x2471df=Math[_0xcd9d('0x168')](0xa,_0x1e17b8)-0x1;return util[_0xcd9d('0x78')]('%s',_[_0xcd9d('0x169')](_0x523fea,_0x345266,_[_0xcd9d('0x16a')](_0x3f55cb,_0x2471df)));}function extractCalleridName(_0x46eec7){var _0x10fa1c=_0x46eec7[_0xcd9d('0x16b')](/"(.*?)"/);return _0x10fa1c?_0x10fa1c[0x1]:_0x46eec7;}function extractCalleridNumber(_0x39d80f){var _0x123b25=_0x39d80f[_0xcd9d('0x16b')](/<(.*?)>/);return _0x123b25?_0x123b25[0x1]:_0x39d80f;}Dialer[_0xcd9d('0x1a')][_0xcd9d('0x16c')]=function(_0x18a430,_0x154f2c){var _0x59809d=this;var _0x16f0c8=uuid['v4']();this[_0xcd9d('0x24')][_0x16f0c8]=new Action(_0x18a430,_0x154f2c,_0x16f0c8);return new BPromise(function(_0x410630,_0x269d93){if(_[_0xcd9d('0x3f')](_0x18a430)&&typeof _0x18a430!=='object'){return _0x269d93(msgResponse(_0xcd9d('0x16d'),_0xcd9d('0x149'),_0xcd9d('0x16e')));}if(_[_0xcd9d('0x3f')](_0x154f2c[_0xcd9d('0x16f')][_0xcd9d('0x170')])||_0x154f2c[_0xcd9d('0x16f')][_0xcd9d('0x170')]===null){return _0x269d93(msgResponse(_0xcd9d('0x16d'),'Failure','contact\x20is\x20undefine'));}var _0x20f235={'XMD-CALLERID':_0x59809d[_0xcd9d('0x24')][_0x16f0c8][_0xcd9d('0x171')](),'XMD-AGI':_0x18a430[_0xcd9d('0x110')]?util[_0xcd9d('0x78')](_0xcd9d('0x172'),ipAgi,_0x18a430[_0xcd9d('0x110')]):_0xcd9d('0x173'),'XMD-AGIAFTER':_0x18a430[_0xcd9d('0x116')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x18a430['dialQueueProject2']):'NONE','XMD-QUEUE':_0x18a430['type']===_0xcd9d('0x50')?util[_0xcd9d('0x78')](_0xcd9d('0x174'),_0x18a430[_0xcd9d('0x42')],_0x18a430['dialQueueOptions']||'',_0x18a430['dialAgiAfterHangupAgent']?'c':'',_0x18a430['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x154f2c['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x59809d[_0xcd9d('0x24')][_0x16f0c8][_0xcd9d('0x171')](),'XMD-AMD':_0x18a430[_0xcd9d('0xe6')]?_0xcd9d('0x175'):_0xcd9d('0x173'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x18a430[_0xcd9d('0xe6')]){_0x20f235['XMD-AMDINITIALSILENCE']=_0x18a430[_0xcd9d('0x176')]||0x9c4;_0x20f235[_0xcd9d('0x177')]=_0x18a430[_0xcd9d('0x178')]||0x5dc;_0x20f235['XMD-AMDAFTERGREETINGSILENCE']=_0x18a430[_0xcd9d('0x179')]||0x320;_0x20f235[_0xcd9d('0x17a')]=_0x18a430[_0xcd9d('0x17b')]||0x1388;_0x20f235[_0xcd9d('0x17c')]=_0x18a430[_0xcd9d('0x17d')]||0x64;_0x20f235['XMD-AMDBETWEENWORDSSILENCE']=_0x18a430['dialAMDBetweenWordsSilence']||0x32;_0x20f235['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x18a430[_0xcd9d('0x17e')]||0x3;_0x20f235['XMD-AMDSILENCETHRESHOLD']=_0x18a430[_0xcd9d('0x17f')]||0x100;_0x20f235[_0xcd9d('0x180')]=_0x18a430[_0xcd9d('0x181')]||0x1388;}if(_0x18a430[_0xcd9d('0x58')]===_0xcd9d('0x50')){_0x20f235[_0xcd9d('0x182')]=_0x154f2c['VoiceQueueId'];}else{_0x20f235['XMD-CAMPAIGNID']=_0x154f2c['CampaignId'];}for(var _0x12da61 in _0x154f2c[_0xcd9d('0x16f')]){if(typeof _0x154f2c[_0xcd9d('0x16f')][_0x12da61]!==_0xcd9d('0xad')){if(isNotNull(_0x154f2c[_0xcd9d('0x16f')][_0x12da61])&&_0x12da61!=='id'&&_0x12da61!==_0xcd9d('0x183')&&_0x12da61!=='createdAt'&&_0x12da61!==_0xcd9d('0x184')){_0x20f235[util[_0xcd9d('0x78')](_0xcd9d('0x185'),_0xcd9d('0x186'),_['toUpper'](_0x12da61))]=_0x154f2c[_0xcd9d('0x16f')][_0x12da61];}}}var _0x1757c7=_0x59809d[_0xcd9d('0xda')](_0x18a430[_0xcd9d('0x76')])?getCallerId(_0x18a430[_0xcd9d('0x76')][_0xcd9d('0x77')],_0x18a430[_0xcd9d('0x5e')],_0x18a430['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x18a430[_0xcd9d('0x5f')],_0x18a430[_0xcd9d('0x187')]):_0x18a430[_0xcd9d('0x5f')]):getCallerId(_[_0xcd9d('0xae')](_0x18a430[_0xcd9d('0x143')])?_0x18a430[_0xcd9d('0x76')][_0xcd9d('0x77')]:_0x18a430[_0xcd9d('0x143')]['callerid'],_0x18a430[_0xcd9d('0x5e')],_0x18a430[_0xcd9d('0x187')]>0x0?getCallerIdRandom(_0x18a430[_0xcd9d('0x5f')],_0x18a430[_0xcd9d('0x187')]):_0x18a430['dialOriginateCallerIdNumber']);if(_0x1757c7){_0x20f235['XMD-ORIGINATECALLERIDNAME']=_0x59809d[_0xcd9d('0x24')][_0x16f0c8][_0xcd9d('0x188')]=extractCalleridName(_0x1757c7);_0x20f235[_0xcd9d('0x189')]=_0x59809d[_0xcd9d('0x24')][_0x16f0c8][_0xcd9d('0x18a')]=extractCalleridNumber(_0x1757c7);}return ami['Action']({'actionid':_0x16f0c8,'action':_0xcd9d('0x16d'),'channel':_0x59809d[_0xcd9d('0xda')](_0x18a430['Trunk'])?util['format'](_0xcd9d('0x18b'),_0x18a430[_0xcd9d('0x76')][_0xcd9d('0x42')],isNotNull(_0x18a430['dialPrefix'])?_0x18a430[_0xcd9d('0x61')][_0xcd9d('0x18c')]()||'':'',_0x18a430[_0xcd9d('0x18d')]>0x0?_0x154f2c['Contact']['phone'][_0xcd9d('0x18e')](_0x18a430[_0xcd9d('0x18d')]):_0x154f2c[_0xcd9d('0x16f')][_0xcd9d('0x170')]):util[_0xcd9d('0x78')](_0xcd9d('0x18b'),_[_0xcd9d('0xae')](_0x18a430['TrunkBackup'])?_0x18a430['Trunk']['name']:_0x18a430[_0xcd9d('0x143')]['name'],isNotNull(_0x18a430['dialPrefix'])?_0x18a430[_0xcd9d('0x61')][_0xcd9d('0x18c')]()||'':'',_0x18a430[_0xcd9d('0x18d')]>0x0?_0x154f2c['Contact'][_0xcd9d('0x170')][_0xcd9d('0x18e')](_0x18a430['dialCutDigit']):_0x154f2c[_0xcd9d('0x16f')][_0xcd9d('0x170')]),'callerid':_0x1757c7,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x20f235,'timeout':(_0x18a430[_0xcd9d('0x60')]||0x1e)*0x3e8,'async':!![],'channelid':_0x16f0c8})[_0xcd9d('0xb8')](function(_0x3d1848){return _0x410630(_0x3d1848);})[_0xcd9d('0xb5')](function(_0x3fc58a){_0x18a430['outboundOriginateFailureCallsDay']+=0x1;var _0x59868d=new History(_0x59809d[_0xcd9d('0x24')][_0x16f0c8]);logger[_0xcd9d('0x96')](util['format'](_0xcd9d('0x18f'),JSON[_0xcd9d('0x4c')](_0x3fc58a)));_0x59868d[_0xcd9d('0xa8')]=0xe;_0x59868d[_0xcd9d('0xe8')]=_0xcd9d('0x190');_0x59868d[_0xcd9d('0xaa')]=moment()['format'](_0xcd9d('0x100'));_0x59868d[_0xcd9d('0xa9')]=_0x59868d[_0xcd9d('0xaa')];_0x59809d[_0xcd9d('0xca')](_0x59868d)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x191')));_0x59809d['moveContactManagedDialer'](_0x59868d)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x191')))['finally'](function(){delete _0x59809d[_0xcd9d('0x24')][_0x16f0c8];return _0x269d93(msgResponse(_0xcd9d('0x16d'),_0xcd9d('0x4b'),_0xcd9d('0x192')));});});});};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x31')]=function(_0x56af7e){var _0x55864d=this[_0xcd9d('0x24')][_0x56af7e[_0xcd9d('0x12d')]];if(_0x55864d){delete this['actions'][_0x56af7e[_0xcd9d('0x12d')]];_0x55864d[_0xcd9d('0x11e')]=moment()[_0xcd9d('0x78')](_0xcd9d('0x100'));var _0x29ffb0=_0x55864d[_0xcd9d('0x58')]==='ivr'?this['campaigns'][_0x55864d['queue']]:this[_0xcd9d('0x1e')][_0x55864d['getQueue']()];if(!this[_0xcd9d('0xd8')](_0x56af7e[_0xcd9d('0x193')])){this[_0xcd9d('0xcb')](_0x29ffb0);return this[_0xcd9d('0x194')](_0x55864d,_0x29ffb0,_0x56af7e)['catch'](loggerCatch(_0xcd9d('0x195')));}this[_0xcd9d('0xe1')][_0x56af7e['uniqueid']]=_0x55864d;}};Dialer['prototype'][_0xcd9d('0x196')]=function(_0x2ab2da,_0x303cbe,_0x517679){var _0x21eb52=new History(_0x303cbe);if(_0x21eb52[_0xcd9d('0xf3')]+_0x21eb52[_0xcd9d('0xf4')]+_0x21eb52[_0xcd9d('0x108')]+_0x21eb52[_0xcd9d('0xf5')]+_0x21eb52[_0xcd9d('0xf6')]+_0x21eb52[_0xcd9d('0x109')]+_0x21eb52[_0xcd9d('0xf7')]+_0x21eb52[_0xcd9d('0x197')]>=_0x517679['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x2ab2da){case 0x3:if(_0x21eb52[_0xcd9d('0x108')]>=_0x517679[_0xcd9d('0x198')]-0x1){return!![];}this[_0xcd9d('0xbf')]({'active':![],'countnoanswerretry':_0x21eb52[_0xcd9d('0x108')]+=0x1,'scheduledat':moment()[_0xcd9d('0xfd')](_0x517679[_0xcd9d('0x199')],_0xcd9d('0xff'))['format'](_0xcd9d('0x100')),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52['ListId'],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52['CampaignId']||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x19a')));break;case 0x5:if(_0x21eb52[_0xcd9d('0xf3')]>=_0x517679[_0xcd9d('0x19b')]-0x1){return!![];}this[_0xcd9d('0xbf')]({'active':![],'countbusyretry':_0x21eb52['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x517679[_0xcd9d('0x19c')],_0xcd9d('0xff'))[_0xcd9d('0x78')](_0xcd9d('0x100')),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52[_0xcd9d('0x101')],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x19d')));break;case 0x8:if(_0x21eb52['countcongestionretry']>=_0x517679['dialCongestionMaxRetry']-0x1){return!![];}this[_0xcd9d('0xbf')]({'active':![],'countcongestionretry':_0x21eb52[_0xcd9d('0xf4')]+=0x1,'scheduledat':moment()[_0xcd9d('0xfd')](_0x517679['dialCongestionRetryFrequency'],_0xcd9d('0xff'))[_0xcd9d('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52[_0xcd9d('0x101')],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x19e')));break;case 0x0:if(_0x21eb52[_0xcd9d('0xf5')]>=_0x517679[_0xcd9d('0x19f')]-0x1){return!![];}else{this[_0xcd9d('0xbf')]({'active':![],'countnosuchnumberretry':_0x21eb52[_0xcd9d('0xf5')]+=0x1,'scheduledat':moment()[_0xcd9d('0xfd')](_0x517679[_0xcd9d('0x1a0')],'minutes')[_0xcd9d('0x78')](_0xcd9d('0x100')),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52[_0xcd9d('0x101')],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52['CampaignId']||undefined})['catch'](loggerCatch(_0xcd9d('0x1a1')));}break;case 0xa:if(_0x21eb52[_0xcd9d('0xf6')]>=_0x517679[_0xcd9d('0x120')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x21eb52['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x517679[_0xcd9d('0x121')],_0xcd9d('0xff'))['format'](_0xcd9d('0x100')),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52[_0xcd9d('0x101')],'VoiceQueueId':_0x21eb52['VoiceQueueId']||undefined,'CampaignId':_0x21eb52['CampaignId']||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x122')));break;case 0xb:if(_0x21eb52['countabandonedretry']>=_0x517679[_0xcd9d('0x129')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x21eb52['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x517679[_0xcd9d('0x1a2')],_0xcd9d('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52[_0xcd9d('0x101')],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x12a')));break;case 0x13:if(_0x21eb52[_0xcd9d('0xf7')]>=_0x517679[_0xcd9d('0xfa')]-0x1){return!![];}this[_0xcd9d('0xbf')]({'active':![],'countmachineretry':_0x21eb52[_0xcd9d('0xf7')]+=0x1,'scheduledat':moment()[_0xcd9d('0xfd')](_0x517679[_0xcd9d('0xfe')],_0xcd9d('0xff'))[_0xcd9d('0x78')](_0xcd9d('0x100')),'ContactId':_0x21eb52['ContactId'],'ListId':_0x21eb52['ListId'],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x21eb52[_0xcd9d('0x197')]>=_0x517679[_0xcd9d('0x1a3')]-0x1){return!![];}this[_0xcd9d('0xbf')]({'active':![],'countagentrejectretry':_0x21eb52['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xcd9d('0xfd')](_0x517679[_0xcd9d('0x1a4')],_0xcd9d('0xff'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21eb52[_0xcd9d('0xd2')],'ListId':_0x21eb52['ListId'],'VoiceQueueId':_0x21eb52[_0xcd9d('0xd4')]||undefined,'CampaignId':_0x21eb52[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x1a5')));break;default:return!![];}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x194')]=function(_0x4d8757,_0x3d8354,_0x3ec128){var _0x1e1bf9=this;var _0xa6e8fb=new History(_0x4d8757);return new BPromise(function(_0x3070dc,_0x51ffce){if(_[_0xcd9d('0x3f')](_0x3d8354)&&typeof _0x3d8354!==_0xcd9d('0x1a6')){return _0x51ffce(msgResponse('[callProgressDetecting]',_0xcd9d('0x149'),_0xcd9d('0x1a7')));}if(_['isUndefined'](_0x3ec128)&&typeof _0x3ec128!==_0xcd9d('0x1a6')){return _0x51ffce(msgResponse('[callProgressDetecting]',_0xcd9d('0x149'),_0xcd9d('0x1a8')));}switch(_0x3ec128[_0xcd9d('0x114')]){case'0':_0x3d8354[_0xcd9d('0x67')]+=0x1;_0xa6e8fb['state']=0x0;_0xa6e8fb[_0xcd9d('0xe8')]='NoSuchNumber';_0xa6e8fb[_0xcd9d('0xf5')]+=0x1;_0xa6e8fb[_0xcd9d('0x107')]+=0x1;ami[_0xcd9d('0x4f')](_0xcd9d('0x1a9'),ut[_0xcd9d('0xeb')](_0x4d8757,_0xcd9d('0x1aa')));_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xf2')));if(_0x1e1bf9[_0xcd9d('0x196')](0x0,_0x4d8757,_0x3d8354)){if(_0xa6e8fb['countnosuchnumberretry']>=_0x3d8354['dialNoSuchNumberMaxRetry']){_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1ab'));}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1ab'));}}break;case'3':_0x3d8354['outboundNoAnswerCallsDay']+=0x1;_0xa6e8fb[_0xcd9d('0xa8')]=0x3;_0xa6e8fb[_0xcd9d('0xe8')]=_0xcd9d('0x1ac');_0xa6e8fb['countnoanswerretry']+=0x1;_0xa6e8fb[_0xcd9d('0x107')]+=0x1;ami[_0xcd9d('0x4f')](_0xcd9d('0x1ad'),ut['buildObj'](_0x4d8757,_0xcd9d('0x1ae')));_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)['catch'](loggerCatch(_0xcd9d('0x1af')));if(_0x1e1bf9[_0xcd9d('0x196')](0x3,_0x4d8757,_0x3d8354)){if(_0xa6e8fb[_0xcd9d('0x108')]>=_0x3d8354[_0xcd9d('0x198')]){_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1b0'));}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1b0'));}}break;case'5':_0x3d8354[_0xcd9d('0x1b1')]+=0x1;_0xa6e8fb['state']=0x5;_0xa6e8fb['statedesc']=_0xcd9d('0x1b2');_0xa6e8fb['countbusyretry']+=0x1;_0xa6e8fb[_0xcd9d('0x107')]+=0x1;ami['emit']('custom:agentbusy',ut[_0xcd9d('0xeb')](_0x4d8757,_0xcd9d('0x1b3')));_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)[_0xcd9d('0xb5')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1e1bf9[_0xcd9d('0x196')](0x5,_0x4d8757,_0x3d8354)){if(_0xa6e8fb[_0xcd9d('0xf3')]>=_0x3d8354[_0xcd9d('0x19b')]){_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,'reason\x205\x20busy');}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1b4'));}}break;case'8':_0x3d8354[_0xcd9d('0x1b5')]+=0x1;_0xa6e8fb['state']=0x8;_0xa6e8fb[_0xcd9d('0xe8')]='Congestion';_0xa6e8fb[_0xcd9d('0xf4')]+=0x1;_0xa6e8fb[_0xcd9d('0x107')]+=0x1;ami[_0xcd9d('0x4f')](_0xcd9d('0x1b6'),ut[_0xcd9d('0xeb')](_0x4d8757,'congestion'));_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)['catch'](loggerCatch(_0xcd9d('0x1b7')));if(_0x1e1bf9[_0xcd9d('0x196')](0x8,_0x4d8757,_0x3d8354)){if(_0xa6e8fb[_0xcd9d('0xf4')]>=_0x3d8354[_0xcd9d('0x1b8')]){_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1b9'));}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1b9'));}}break;case'11':_0x3d8354[_0xcd9d('0x1ba')]+=0x1;_0xa6e8fb[_0xcd9d('0xa8')]=0xb;_0xa6e8fb[_0xcd9d('0xe8')]=_0xcd9d('0x126');_0xa6e8fb['countabandonedretry']+=0x1;_0xa6e8fb[_0xcd9d('0x107')]+=0x1;_0x1e1bf9['createHistory'](_0xa6e8fb)[_0xcd9d('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1e1bf9[_0xcd9d('0x196')](0xb,_0x4d8757,_0x3d8354)){if(_0xa6e8fb[_0xcd9d('0x109')]>=_0x3d8354[_0xcd9d('0x129')]){_0x1e1bf9['createStateFinal'](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1bb'));}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1bb'));}}break;case'20':_0x3d8354[_0xcd9d('0x69')]+=0x1;_0xa6e8fb['state']=0x14;_0xa6e8fb['statedesc']='AgentReject';_0xa6e8fb[_0xcd9d('0x197')]+=0x1;_0xa6e8fb['countglobal']+=0x1;ami[_0xcd9d('0x4f')](_0xcd9d('0x1bc'),ut[_0xcd9d('0xeb')](_0x4d8757,_0xcd9d('0x1bd')));_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x1be')));if(_0x1e1bf9[_0xcd9d('0x196')](0x14,_0x4d8757,_0x3d8354)){if(_0xa6e8fb[_0xcd9d('0x197')]>=_0x3d8354['dialAgentRejectMaxRetry']){_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0xcd9d('0x1bf'));}else{_0x1e1bf9[_0xcd9d('0xf8')](_0xa6e8fb,_0x3070dc,_0x51ffce,'reason\x2020\x20agentreject');}}break;default:_0x3d8354['outboundUnknownCallsDay']+=0x1;_0xa6e8fb['state']=0xc;_0xa6e8fb[_0xcd9d('0xe8')]=_0x3ec128[_0xcd9d('0x114')];_0x1e1bf9[_0xcd9d('0xca')](_0xa6e8fb)['catch'](loggerCatch(_0xcd9d('0x1c0')));if(_0x1e1bf9[_0xcd9d('0x196')](_0x3ec128['reason'],_0x4d8757,_0x3d8354)){if(_0xa6e8fb['countbusyretry']+_0xa6e8fb['countcongestionretry']+_0xa6e8fb[_0xcd9d('0x108')]+_0xa6e8fb[_0xcd9d('0xf5')]+_0xa6e8fb[_0xcd9d('0xf6')]+_0xa6e8fb[_0xcd9d('0x109')]+_0xa6e8fb[_0xcd9d('0xf7')]+_0xa6e8fb[_0xcd9d('0x197')]>=_0x3d8354[_0xcd9d('0x10a')]){_0x1e1bf9['stateGlobal'](_0xa6e8fb,_0x3070dc,_0x51ffce,_0x3ec128[_0xcd9d('0x114')]);}else{_0x1e1bf9[_0xcd9d('0xfb')](_0xa6e8fb,_0x3070dc,_0x51ffce,_0x3ec128['reason']);}}}});};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xf8')]=function(_0x2c67fd,_0x37226b,_0x5b9e87,_0x31d8c2){var _0x36dfc1=new Final(_0x2c67fd);_0x36dfc1[_0xcd9d('0xa8')]=0xf;_0x36dfc1[_0xcd9d('0xe8')]=_0xcd9d('0x1c1');this[_0xcd9d('0xfb')](_0x36dfc1,_0x37226b,_0x5b9e87,_0x31d8c2);};Dialer[_0xcd9d('0x1a')][_0xcd9d('0xfb')]=function(_0x5b32cd,_0x525d3f,_0x5157c3,_0x3efc5c){this[_0xcd9d('0xc8')](_0x5b32cd)['then'](function(){return _0x525d3f(msgResponse(_0xcd9d('0x1c2'),_0xcd9d('0xd9'),_0x3efc5c));})['catch'](function(){return _0x5157c3(msgResponse(_0xcd9d('0x1c3'),_0xcd9d('0x149'),'contact\x20not\x20moved'));});};Dialer[_0xcd9d('0x1a')]['predictive']=function(_0x2ac825){var _0x4a1fd5=_0x2ac825[_0xcd9d('0x1c4')]/0x64;var _0x2af595=_0x2ac825['outboundDropCallsDayTimeout']/(_0x2ac825[_0xcd9d('0x66')]+_0x2ac825[_0xcd9d('0x63')]);var _0x9e89e2=Math[_0xcd9d('0x1c5')](_0x2ac825[_0xcd9d('0x1c6')]*(_0x2ac825[_0xcd9d('0x1c7')]/0x64));var _0x26ef2d=Math[_0xcd9d('0x1c5')](_0x2ac825[_0xcd9d('0x1c6')]*(_0x2ac825[_0xcd9d('0x1c8')]/0x64));var _0x4ef14c=_0x2ac825[_0xcd9d('0x53')]+_0x2ac825[_0xcd9d('0x56')];var _0x535236=Math['floor'](_0x2ac825['erlangCalls']*_0x2ac825[_0xcd9d('0x74')]*_0x2ac825[_0xcd9d('0x6f')]*_0x2ac825[_0xcd9d('0x70')]);if(_[_0xcd9d('0x3f')](_0x2ac825['startProgressive'])){if(!_['isUndefined'](_0x2ac825[_0xcd9d('0x27')])){_0x2ac825[_0xcd9d('0x27')]=undefined;loggerPredictive[_0xcd9d('0x96')](_0xcd9d('0x1c9'),_0xcd9d('0x1ca'));}if(!_[_0xcd9d('0x3f')](_0x2ac825['handlePredictive'])){loggerPredictive[_0xcd9d('0x96')]('[startMethodPredictive][StartProgressive]',_0xcd9d('0x1cb'));clearInterval(_0x2ac825['handlePredictive']);_0x2ac825[_0xcd9d('0x91')]=undefined;}_0x2ac825[_0xcd9d('0x28')]=moment()[_0xcd9d('0x78')](_0xcd9d('0x100'));loggerPredictive['info'](_0x2ac825[_0xcd9d('0x42')],'collection\x20data\x20in\x20progressive\x20at',_0x2ac825[_0xcd9d('0x28')]);this[_0xcd9d('0x15f')](_0x2ac825,0x1);}else if(ifInterval(_0x2ac825[_0xcd9d('0x1cc')],_0x2ac825[_0xcd9d('0x28')])){this[_0xcd9d('0x15f')](_0x2ac825,0x1);loggerPredictiveCalls[_0xcd9d('0x7c')](_0xcd9d('0x1cd'),_0x2ac825[_0xcd9d('0x28')],_0x2ac825['name']);_0x2ac825[_0xcd9d('0x73')]=0x0;_0x2ac825[_0xcd9d('0x6e')]=0x0;}else if(_0x4a1fd5<_0x2af595&&_0x2ac825['dialPredictiveOptimization']===_0xcd9d('0x1ce')){freeVariablesPredictive(_0x2ac825);loggerPredictive[_0xcd9d('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xcd9d('0x1cf'),_0x2af595,'startProgressive',_0x2ac825[_0xcd9d('0x42')]);}else if(_0x535236<_0x2ac825['predictiveIntervalErlangCallsDroppedCalls']&&_0x2ac825[_0xcd9d('0x1d0')]==='dropRate'){freeVariablesPredictive(_0x2ac825);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x1d1'),_0xcd9d('0x1d2'),_0x535236,_0xcd9d('0x1d3'),_0x2ac825['predictiveIntervalErlangCallsDroppedCalls'],_0xcd9d('0x28'),_0x2ac825[_0xcd9d('0x42')]);}else if(!ifInterval(_0x2ac825[_0xcd9d('0x1cc')],_0x2ac825[_0xcd9d('0x28')])&&_[_0xcd9d('0x3f')](_0x2ac825[_0xcd9d('0x27')])&&!_['isUndefined'](_0x2ac825[_0xcd9d('0x28')])){_0x2ac825[_0xcd9d('0x27')]=moment()[_0xcd9d('0x78')](_0xcd9d('0x100'));loggerPredictive[_0xcd9d('0x7c')](_0x2ac825[_0xcd9d('0x42')],'started\x20in\x20predictive\x20at',_0x2ac825[_0xcd9d('0x27')]);this[_0xcd9d('0xbc')](_0x2ac825['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x2ac825))[_0xcd9d('0xb8')](mergeDataErlangB(_0x2ac825))[_0xcd9d('0xb8')](this[_0xcd9d('0x1d4')](_0x2ac825))[_0xcd9d('0xb5')](loggerCatchPredictive(_0xcd9d('0x1d5'),_0x2ac825));}else if(!ifInterval(_0x2ac825[_0xcd9d('0x1cc')],_0x2ac825['startPredictive'])){_0x2ac825['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x2ac825[_0xcd9d('0x27')]=moment()['format'](_0xcd9d('0x100'));loggerPredictive['info'](_0x2ac825[_0xcd9d('0x42')],_0xcd9d('0x1d6'),_0x2ac825[_0xcd9d('0x27')]);clearInterval(_0x2ac825[_0xcd9d('0x91')]);_0x2ac825[_0xcd9d('0x91')]=undefined;this[_0xcd9d('0xbc')](_0x2ac825[_0xcd9d('0x1cc')])[_0xcd9d('0xb8')](this[_0xcd9d('0x1d7')](_0x2ac825))[_0xcd9d('0xb8')](mergeDataErlangB(_0x2ac825))['then'](this[_0xcd9d('0x1d4')](_0x2ac825))[_0xcd9d('0xb5')](loggerCatchPredictive(_0xcd9d('0x1d8'),_0x2ac825));}else if(_0x2ac825['predictiveIntervalAvailable']&&_0x4ef14c<_0x2ac825[_0xcd9d('0x1c6')]-_0x26ef2d){freeVariablesPredictive(_0x2ac825);loggerPredictive[_0xcd9d('0x7c')](_0x2ac825[_0xcd9d('0x42')],_0xcd9d('0x1d9'),_0x4ef14c,')\x20are\x20less\x20than\x20threshold\x20(',_0x2ac825[_0xcd9d('0x1c6')],'-',_0x26ef2d,'=',_0x2ac825[_0xcd9d('0x1c6')]-_0x26ef2d,')');}else if(_0x2ac825[_0xcd9d('0x1c6')]&&_0x4ef14c>_0x2ac825[_0xcd9d('0x1c6')]+_0x9e89e2){freeVariablesPredictive(_0x2ac825);loggerPredictive['info'](_0x2ac825['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x4ef14c,_0xcd9d('0x1da'),_0x2ac825[_0xcd9d('0x1c6')],'+',_0x9e89e2,'=',_0x2ac825[_0xcd9d('0x1c6')]+_0x9e89e2,')');}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x1d7')]=function(_0x2cc9eb){var _0x27096f=this;return function(_0x5f1ca0){return new BPromise(function(_0x178ccb,_0x49ba7c){_[_0xcd9d('0xd0')](_0x2cc9eb,_0x5f1ca0[0x0]);if(checkGetDataPredictive(_0x5f1ca0[0x0])){var _0x5b9edd=_0x2cc9eb[_0xcd9d('0x1c6')]=_0x2cc9eb['talking']+_0x2cc9eb['available'];var _0x39983f=_0x2cc9eb[_0xcd9d('0x1cc')]*0x3c;var _0x1d4fba=_0x5f1ca0[0x0][_0xcd9d('0x86')]+_0x5f1ca0[0x0]['predictiveIntervalAvgHoldtime'];var _0x222560=(_0x5f1ca0[0x0][_0xcd9d('0x6a')]+_0x5f1ca0[0x0][_0xcd9d('0x6c')]+_0x5f1ca0[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5f1ca0[0x0][_0xcd9d('0x7f')];_0x2cc9eb['predictiveIntervalHitRate']=_0x222560>0x0?_0x222560:0x1;switch(_0x2cc9eb['dialPredictiveOptimization']){case _0xcd9d('0x1ce'):var _0x1e91cc=_0x2cc9eb['dialPredictiveOptimizationPercentage']/0x64;return _0x27096f['abandonmentRate'](_0x5b9edd,_0x39983f,_0x1d4fba,_0x222560,_0x1e91cc)[_0xcd9d('0xb8')](function(_0x350125){return _0x178ccb(_0x350125);});case _0xcd9d('0x1db'):var _0x560d3a=_0x2cc9eb[_0xcd9d('0x1c4')]/0x64;return _0x27096f['busyFactor'](_0x5b9edd,_0x39983f,_0x1d4fba,_0x222560,_0x560d3a)[_0xcd9d('0xb8')](function(_0x118f5f){return _0x178ccb(_0x118f5f);});default:return _0x49ba7c(msgResponse(_0xcd9d('0x1dc'),_0xcd9d('0x149'),_0xcd9d('0x1dd')));}}else{return _0x49ba7c(msgResponse('[getDataPredictive]',_0xcd9d('0x149'),'check\x20failure'));}});};};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x1de')]=function(_0xcf7adc){var _0x1e12d0=this;return function(_0x472aa6){return new BPromise(function(_0x3a0f3d,_0x3ac0a4){_[_0xcd9d('0xd0')](_0xcf7adc,_0x472aa6[0x0]);if(checkGetDataPredictive(_0x472aa6[0x0])){loggerPredictive['info'](JSON[_0xcd9d('0x4c')](_0x472aa6[0x0]));if(_0xcf7adc[_0xcd9d('0x1d0')]===_0xcd9d('0x1ce')){return _0x1e12d0['getVoiceQueueRtPauses'](_0xcf7adc['id'])[_0xcd9d('0xb8')](function(_0x3fd04b){var _0x50adbb=_0xcf7adc[_0xcd9d('0x54')]-_0x3fd04b[0x0]['outboundQueuePauses'];var _0x3bd844=_0xcf7adc[_0xcd9d('0x1cc')]*0x3c;var _0x1b9c3f=_0x472aa6[0x0]['predictiveIntervalAvgTalktime']+_0x472aa6[0x0][_0xcd9d('0x6b')];var _0x2cd35d=(_0x472aa6[0x0][_0xcd9d('0x6a')]+_0x472aa6[0x0][_0xcd9d('0x6c')]+_0x472aa6[0x0][_0xcd9d('0x1df')])/_0x472aa6[0x0][_0xcd9d('0x7f')];var _0xdd079b=_0xcf7adc[_0xcd9d('0x1c4')]/0x64;_0xcf7adc['predictiveIntervalPauses']=_0x3fd04b[0x0][_0xcd9d('0x1e0')]||0x0;_0xcf7adc[_0xcd9d('0x6f')]=_0x2cd35d>0x0?_0x2cd35d:0x1;return _0x1e12d0[_0xcd9d('0x1e1')](_0x50adbb,_0x3bd844,_0x1b9c3f,_0x2cd35d,_0xdd079b);})['then'](function(_0xc2643f){return _0x3a0f3d(_0xc2643f);})['catch'](function(_0x184c5c){return _0x3ac0a4(msgResponse(_0xcd9d('0x1e2'),'Failure',JSON['stringify'](_0x184c5c)));});}if(_0xcf7adc[_0xcd9d('0x1d0')]===_0xcd9d('0x1db')){return _0x1e12d0[_0xcd9d('0xc6')](_0xcf7adc['id'])[_0xcd9d('0xb8')](function(_0x4d2e28){var _0xdfc39c=_0xcf7adc[_0xcd9d('0x54')]-_0x4d2e28[0x0][_0xcd9d('0x1e0')];var _0x2097cd=_0xcf7adc[_0xcd9d('0x1cc')]*0x3c;var _0x17743b=_0x472aa6[0x0][_0xcd9d('0x86')]+_0x472aa6[0x0][_0xcd9d('0x6b')];var _0x3d2fd0=(_0x472aa6[0x0][_0xcd9d('0x6a')]+_0x472aa6[0x0][_0xcd9d('0x6c')]+_0x472aa6[0x0][_0xcd9d('0x1df')])/_0x472aa6[0x0]['predictiveIntervalTotalCalls'];var _0x4ebc77=_0xcf7adc[_0xcd9d('0x1c4')]/0x64;_0xcf7adc[_0xcd9d('0x71')]=_0x4d2e28[0x0][_0xcd9d('0x1e0')]||0x0;_0xcf7adc[_0xcd9d('0x6f')]=_0x3d2fd0>0x0?_0x3d2fd0:0x1;return _0x1e12d0['busyFactor'](_0xdfc39c,_0x2097cd,_0x17743b,_0x3d2fd0,_0x4ebc77);})[_0xcd9d('0xb8')](function(_0xbbb1ab){return _0x3a0f3d(_0xbbb1ab);})[_0xcd9d('0xb5')](function(_0x404a99){return _0x3ac0a4(msgResponse(_0xcd9d('0x1e2'),_0xcd9d('0x149'),JSON['stringify'](_0x404a99)));});}}else{return _0x3ac0a4(msgResponse(_0xcd9d('0x1dc'),_0xcd9d('0x149'),_0xcd9d('0x1e3')));}});};};Dialer[_0xcd9d('0x1a')]['startMethodPredictive']=function(_0x2b49aa){var _0x29d48d=this;return function(){var _0x4ee057=0x0;var _0x420c4b=Math['floor'](_0x2b49aa[_0xcd9d('0x8b')]*0x3e8);if(_0x420c4b>0x0){_0x420c4b=_0x420c4b<0x64?0x64:_0x420c4b;loggerPredictive['info'](_0x2b49aa['name'],_0xcd9d('0x1e4'),_0x420c4b,'milliseconds');_0x2b49aa['handlePredictive']=setInterval(function(){_0x29d48d[_0xcd9d('0x91')](_0x2b49aa);loggerPredictiveCalls[_0xcd9d('0x7c')](_0xcd9d('0x1e5'),_0x4ee057+=0x1);},_0x420c4b);}else{loggerPredictive[_0xcd9d('0x7c')](_0x2b49aa[_0xcd9d('0x42')],_0xcd9d('0x1e6'));}};};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x1e7')]=function(_0x28cfc4,_0x46002a){var _0x352522=this;return function(_0x57f247){if(_['isEmpty'](_0x57f247)){if(_[_0xcd9d('0xae')](_0x46002a[_0xcd9d('0xd3')])||!_0x46002a[_0xcd9d('0x1e8')]){if(_0x28cfc4[_0xcd9d('0x5d')]==='booked'){_0x28cfc4['queueStatusComplete']=_[_0xcd9d('0x3f')](_0x28cfc4[_0xcd9d('0x133')])?!![]:_0x28cfc4[_0xcd9d('0x133')];var _0x116142=uuid['v4']();_0x352522[_0xcd9d('0x24')][_0x116142]=new Action(_0x28cfc4,_0x46002a,_0x116142);loggerBooked['info'](_0xcd9d('0x1e9'),_0x116142,_0xcd9d('0x1ea'),JSON[_0xcd9d('0x4c')](_0x28cfc4[_0xcd9d('0x133')]),_0xcd9d('0x1eb'),_0x28cfc4['name']);if(_0x28cfc4[_0xcd9d('0x133')]){_0x28cfc4[_0xcd9d('0x133')]=![];_0x352522[_0xcd9d('0x2a')][_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xb1')]]=[];ami[_0xcd9d('0xaf')]({'actionid':_0x116142,'action':'queuestatus','queue':_0x28cfc4[_0xcd9d('0x42')]})[_0xcd9d('0xb5')](function(){_0x352522[_0xcd9d('0xcb')](_0x28cfc4);_0x352522[_0xcd9d('0xbf')]({'active':![],'ContactId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd2')],'ListId':_0x352522[_0xcd9d('0x24')][_0x116142]['ListId'],'VoiceQueueId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd4')]||undefined,'CampaignId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd5')]||undefined})['catch'](loggerCatch(_0xcd9d('0x1ec')));delete _0x352522[_0xcd9d('0x24')][_0x116142];});}else{loggerBooked['info'](_0xcd9d('0x1ed'),JSON[_0xcd9d('0x4c')](_0x28cfc4[_0xcd9d('0x133')]),_0xcd9d('0x1eb'),_0x28cfc4[_0xcd9d('0x42')]);_0x352522[_0xcd9d('0xcb')](_0x28cfc4);_0x352522[_0xcd9d('0xbf')]({'active':![],'ContactId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd2')],'ListId':_0x352522['actions'][_0x116142]['ListId'],'VoiceQueueId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd4')]||undefined,'CampaignId':_0x352522[_0xcd9d('0x24')][_0x116142][_0xcd9d('0xd5')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x352522[_0xcd9d('0x24')][_0x116142];}}else{return _0x352522[_0xcd9d('0x16c')](_0x28cfc4,_0x46002a);}}else{if(getDiff(_0x46002a[_0xcd9d('0x1ee')])<_0x28cfc4['dialRecallMeTimeout']*0x3c){if(_0x46002a['Agent']&&!_0x46002a[_0xcd9d('0x1ef')][_0xcd9d('0x1f0')]){_0x352522['preview'][_0xcd9d('0x136')](_0x46002a['id'])[_0xcd9d('0x137')](function(){_0x352522[_0xcd9d('0xcb')](_0x28cfc4);});}else{_0x352522['unlockContact']({'active':![]},_0x46002a['id'],0x1)['finally'](function(){_0x352522[_0xcd9d('0xcb')](_0x28cfc4);});}}else{_0x28cfc4[_0xcd9d('0x1f1')]+=0x1;_0x352522['updateOriginated'](_0x28cfc4);if(_0x28cfc4['dialRecallInQueue']){_0x352522['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x46002a[_0xcd9d('0xd2')],'ListId':_0x46002a['ListId'],'VoiceQueueId':_0x46002a['VoiceQueueId']||undefined,'CampaignId':_0x46002a[_0xcd9d('0xd5')]||undefined})[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x1f2')));_0x352522[_0xcd9d('0xca')](createObjHistory(_0x28cfc4,_0x46002a,_0xcd9d('0x1f3'),0x17,_0xcd9d('0x1f4')))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0x1f5')));}else{_0x352522['saveInDb'](createObjHistory(_0x28cfc4,_0x46002a,_0xcd9d('0x1f6'),0x16,'RecallFailedTimeout'),_0xcd9d('0x1f7'),_0xcd9d('0x1f8'));}}}}else{_0x28cfc4[_0xcd9d('0x1f9')]+=0x1;_0x352522[_0xcd9d('0xcf')](createObjHistory(_0x28cfc4,_0x46002a,'BLACKLIST',0xd,_0xcd9d('0x1fa')),_0xcd9d('0x1fb'),'[Originate][MoveBlacklist]');throw _0xcd9d('0x1fc');}};};Dialer[_0xcd9d('0x1a')]['handleIvr']=function(_0x5255b9){var _0x362ec1=this;var _0x1ee28b=_0x5255b9[_0xcd9d('0x1fd')]-_0x5255b9[_0xcd9d('0x72')]-_0x5255b9['temp'];emitCampaignSummary(_0x5255b9);if(_0x1ee28b>0x0){if(_0x1ee28b>this[_0xcd9d('0x22')]){_0x1ee28b=this['maxNumberOriginate'];}_0x5255b9['temp']+=_0x1ee28b;this['getContactDialerIvr'](_0x5255b9['id'],_0x1ee28b,_0x5255b9['dialOrderByScheduledAt'],_0x5255b9)['then'](function(_0x575bd7){_0x5255b9[_0xcd9d('0xc3')]-=_0x1ee28b;_0x5255b9[_0xcd9d('0xc3')]=_0x5255b9[_0xcd9d('0xc3')]>0x0?_0x5255b9[_0xcd9d('0xc3')]:0x0;if(!checkContactEmpty(_0x575bd7)){_0x5255b9[_0xcd9d('0x40')]=_0xcd9d('0x9f');logger[_0xcd9d('0x7c')](_0xcd9d('0x1fe')+_0x5255b9[_0xcd9d('0x42')]);}else{_0x5255b9[_0xcd9d('0x72')]+=_0x575bd7[_0xcd9d('0x99')];_0x5255b9['message']=_0xcd9d('0x1ff');for(var _0xc52ebf=0x0;_0xc52ebf<_0x575bd7[_0xcd9d('0x99')];_0xc52ebf+=0x1){_0x5255b9['ivrTotalCallsDays']+=0x1;if(_[_0xcd9d('0xae')](_0x575bd7[_0xc52ebf])||_['isNil'](_0x575bd7[_0xc52ebf][_0xcd9d('0x16f')])||_[_0xcd9d('0xae')](_0x575bd7[_0xc52ebf][_0xcd9d('0x16f')]['phone'])){_0x362ec1[_0xcd9d('0x200')]('[actionOriginate]\x20',_0x5255b9,_0x575bd7[_0xc52ebf]);}else{_0x362ec1['checkIsBlackListIvr'](_[_0xcd9d('0xd1')](_0x575bd7[_0xc52ebf],[_0xcd9d('0xd5'),_0xcd9d('0x201')]))[_0xcd9d('0xb8')](_0x362ec1[_0xcd9d('0x1e7')](_0x5255b9,_0x575bd7[_0xc52ebf]))[_0xcd9d('0xb5')](_0x362ec1[_0xcd9d('0xcd')]('[actionOriginateIvr]\x20',_0x5255b9));}}}})[_0xcd9d('0xb5')](loggerGetContactDialer(_0xcd9d('0x202'),_0x5255b9,_0x1ee28b));}};Dialer[_0xcd9d('0x1a')]['handlePower']=function(_0x47473f,_0x309555){var _0x2913bf=this;var _0x153226=[];var _0x507618=_0x309555>=0x1?_0x309555:0x1;if(_0x47473f[_0xcd9d('0x5d')]===_0xcd9d('0x8')){_0x507618=0x1;}var _0x163853=Math[_0xcd9d('0x203')](_0x47473f[_0xcd9d('0x53')]*_0x507618)-_0x47473f[_0xcd9d('0x72')]-_0x47473f[_0xcd9d('0xc3')];emitVoiceQueueSummary(_0x47473f);if(_0x47473f[_0xcd9d('0x204')]>0x0){var _0x3d6d51=_0x47473f[_0xcd9d('0x204')]-_0x47473f['originated']-_0x47473f['talking']-_0x47473f[_0xcd9d('0xc3')]-_0x47473f[_0xcd9d('0xa1')];if(_0x163853>_0x3d6d51){_0x163853=_0x3d6d51;}}if(_0x163853>0x0){if(_0x47473f['dialMethod']===_0xcd9d('0x8')){_0x163853=0x1;}if(_0x163853>this['maxNumberOriginate']){_0x163853=this[_0xcd9d('0x22')];}_0x47473f[_0xcd9d('0xc3')]+=_0x163853;for(var _0x31324b in this['agents']){if(typeof this[_0xcd9d('0x20')][_0x31324b]!=='undefined'){if(this['agents'][_0x31324b]['state']==='not_inuse'&&this[_0xcd9d('0x20')][_0x31324b][_0xcd9d('0xde')]===_0xcd9d('0xdd')){_0x153226[_0xcd9d('0x131')](this['agents'][_0x31324b]['id']);}}}this[_0xcd9d('0xc2')](_0x47473f['id'],_0x153226,_0x163853,_0x47473f[_0xcd9d('0x205')],_0x47473f)[_0xcd9d('0xb8')](function(_0x5134d7){_0x47473f['temp']-=_0x163853;_0x47473f[_0xcd9d('0xc3')]=_0x47473f[_0xcd9d('0xc3')]>0x0?_0x47473f['temp']:0x0;if(!checkContactEmpty(_0x5134d7)){_0x2913bf[_0xcd9d('0xb3')](_0x47473f)[_0xcd9d('0xb8')](sendMessageReschedule(_0x47473f))[_0xcd9d('0xb5')](loggerCatch('[countReScheduled]\x20'));}else{_0x47473f[_0xcd9d('0x72')]+=_0x5134d7[_0xcd9d('0x99')];_0x47473f[_0xcd9d('0x40')]=_0x47473f['dialMethod']===_0xcd9d('0x8')?'ACTIVE':_0xcd9d('0x1ff');for(var _0x1cda5d=0x0;_0x1cda5d<_0x5134d7[_0xcd9d('0x99')];_0x1cda5d+=0x1){if(_[_0xcd9d('0xae')](_0x5134d7[_0x1cda5d])||_[_0xcd9d('0xae')](_0x5134d7[_0x1cda5d][_0xcd9d('0x16f')])||_[_0xcd9d('0xae')](_0x5134d7[_0x1cda5d][_0xcd9d('0x16f')]['phone'])){_0x2913bf[_0xcd9d('0x200')](_0xcd9d('0x206'),_0x47473f,_0x5134d7[_0x1cda5d]);}else{_0x2913bf[_0xcd9d('0xb7')](_['pick'](_0x5134d7[_0x1cda5d],[_0xcd9d('0xd4'),_0xcd9d('0x201')]))[_0xcd9d('0xb8')](_0x2913bf['checkContactBlack'](_0x47473f,_0x5134d7[_0x1cda5d]))[_0xcd9d('0xb5')](_0x2913bf[_0xcd9d('0xcd')]('[actionOriginate]\x20',_0x47473f));}}}})[_0xcd9d('0xb5')](loggerGetContactDialer(_0xcd9d('0x207'),_0x47473f,_0x163853));}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x91')]=function(_0x284e4b){if(_0x284e4b[_0xcd9d('0x204')]>0x0){var _0x1aa184=_0x284e4b[_0xcd9d('0x204')]-_0x284e4b[_0xcd9d('0x72')]-_0x284e4b[_0xcd9d('0x56')];if(_0x1aa184>0x0){this['tryOriginatePredictive'](_0x284e4b);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0xcd9d('0x208')](_0x284e4b);}};Dialer[_0xcd9d('0x1a')][_0xcd9d('0x208')]=function(_0x1f150c){var _0x185148=this;var _0x1cd740=[];_0x1f150c['originated']+=0x1;for(var _0x13726e in this[_0xcd9d('0x20')]){if(typeof this['agents'][_0x13726e]!==_0xcd9d('0xad')){if(this['agents'][_0x13726e][_0xcd9d('0xa8')]===_0xcd9d('0x209')&&this[_0xcd9d('0x20')][_0x13726e][_0xcd9d('0xde')]===_0xcd9d('0xdd')){_0x1cd740[_0xcd9d('0x131')](this[_0xcd9d('0x20')][_0x13726e]['id']);}}}this[_0xcd9d('0xc2')](_0x1f150c['id'],_0x1cd740,0x1,_0x1f150c['dialOrderByScheduledAt'],_0x1f150c)[_0xcd9d('0xb8')](function(_0xb6c07f){if(!checkContactEmpty(_0xb6c07f)){checkContactLowerLimitOriginate(_0x1f150c,0x1,0x0);_0x185148[_0xcd9d('0xb3')](_0x1f150c)['then'](sendMessageReschedule(_0x1f150c))[_0xcd9d('0xb5')](loggerCatch(_0xcd9d('0xb6')));}else{_0x1f150c['message']=_0xcd9d('0x1ff');if(_['isNil'](_0xb6c07f[0x0])||_[_0xcd9d('0xae')](_0xb6c07f[0x0][_0xcd9d('0x16f')])||_['isNil'](_0xb6c07f[0x0]['Contact'][_0xcd9d('0x170')])){_0x185148['emptyContact'](_0xcd9d('0x206'),_0x1f150c,_0xb6c07f[0x0]);}else{_0x185148[_0xcd9d('0xb7')](_[_0xcd9d('0xd1')](_0xb6c07f[0x0],[_0xcd9d('0xd4'),'Contact.phone']))[_0xcd9d('0xb8')](_0x185148[_0xcd9d('0x1e7')](_0x1f150c,_0xb6c07f[0x0]))[_0xcd9d('0xb5')](_0x185148[_0xcd9d('0xcd')](_0xcd9d('0x20a'),_0x1f150c));}}})[_0xcd9d('0xb5')](loggerGetContactDialer(_0xcd9d('0x20b'),_0x1f150c,0x1));emitVoiceQueueSummary(_0x1f150c);};Dialer[_0xcd9d('0x1a')]['abandonmentRate']=function(_0x1bc948,_0x523d73,_0x3b7010,_0x143348,_0x3068d9,_0x3184aa){loggerPredictive['info'](_0xcd9d('0x20c'));loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x20d'),_0x1bc948);loggerPredictive[_0xcd9d('0x7c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x523d73);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x20e'),_0x3b7010);loggerPredictive['info']('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',_0x143348);loggerPredictive['info'](_0xcd9d('0x20f'),_0x3068d9);loggerPredictive[_0xcd9d('0x7c')]('---------------------------');return new BPromise(function(_0x2cdc73,_0x2df3c1){if(_0x1bc948<=0x0||isNaN(_0x1bc948)){return _0x2df3c1(msgResponse(_0xcd9d('0x210'),_0xcd9d('0x4b'),'m\x20=\x20'+_0x1bc948));}if(_0x3b7010<=0x0||isNaN(_0x3b7010)){return _0x2df3c1(msgResponse(_0xcd9d('0x210'),_0xcd9d('0x4b'),_0xcd9d('0x211')+_0x3b7010));}if(_0x143348<=0x0||isNaN(_0x143348)){return _0x2df3c1(msgResponse(_0xcd9d('0x210'),_0xcd9d('0x4b'),_0xcd9d('0x212')+_0x143348));}if(_0x523d73<=0x0||isNaN(_0x523d73)){return _0x2df3c1(msgResponse(_0xcd9d('0x210'),_0xcd9d('0x4b'),_0xcd9d('0x213')+_0x523d73));}if(_0x3068d9<=0x0||isNaN(_0x3068d9)){return _0x2df3c1(msgResponse(_0xcd9d('0x210'),'Error','Amax\x20=\x20'+_0x3068d9));}_0x3184aa=_0x3184aa||0x0;var _0x58cd31=0x1/_0x3b7010;var _0x2261fc=0x0;var _0x4fe35e=0x0;var _0x4c0b55=0x0;var _0xd54d21=0x0;for(var _0xe22f9a=0x0;_0x4c0b55<_0x3068d9;_0xe22f9a+=0x1){_0x4fe35e=_0xe22f9a/_0x523d73;_0x2261fc=(_0x143348*_0x4fe35e+_0x3184aa)/_0x58cd31;_0x4c0b55=erlangb(_0x2261fc,_0x1bc948);_0xd54d21=_0x2261fc/_0x1bc948*(0x1-erlangb(_0x2261fc,_0x1bc948));}return _0x2cdc73({'erlangCalls':_0xe22f9a,'erlangCallToSecond':_0x523d73/_0xe22f9a,'erlangAbandonmentRate':_0x4c0b55,'erlangBusyFactor':_0xd54d21});});};Dialer[_0xcd9d('0x1a')]['busyFactor']=function(_0x332dba,_0x563178,_0x55e98a,_0x1189df,_0x38e33b,_0x626c68){loggerPredictive['info'](_0xcd9d('0x214'));loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x20d'),_0x332dba);loggerPredictive['info'](_0xcd9d('0x215'),_0x563178);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x20e'),_0x55e98a);loggerPredictive[_0xcd9d('0x7c')]('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',_0x1189df);loggerPredictive['info'](_0xcd9d('0x216'),_0x38e33b);loggerPredictive[_0xcd9d('0x7c')](_0xcd9d('0x85'));return new BPromise(function(_0x4b2e97,_0x1e5cc0){if(_0x332dba<=0x0||isNaN(_0x332dba)){return _0x1e5cc0(msgResponse('[busyFactor]',_0xcd9d('0x4b'),'m\x20=\x20'+_0x332dba));}if(_0x55e98a<=0x0||isNaN(_0x55e98a)){return _0x1e5cc0(msgResponse(_0xcd9d('0x217'),_0xcd9d('0x4b'),_0xcd9d('0x211')+_0x55e98a));}if(_0x1189df<=0x0||isNaN(_0x1189df)){return _0x1e5cc0(msgResponse(_0xcd9d('0x217'),_0xcd9d('0x4b'),_0xcd9d('0x212')+_0x1189df));}if(_0x563178<=0x0||isNaN(_0x563178)){return _0x1e5cc0(msgResponse(_0xcd9d('0x217'),_0xcd9d('0x4b'),'interval\x20=\x20'+_0x563178));}if(_0x38e33b<=0x0||isNaN(_0x38e33b)){return _0x1e5cc0(msgResponse(_0xcd9d('0x217'),_0xcd9d('0x4b'),_0xcd9d('0x218')+_0x38e33b));}_0x626c68=_0x626c68||0x0;var _0x59ddaa=0x1/_0x55e98a;var _0x28f399=0x0;var _0x2e0c08=0x0;var _0x350bf7=0x0;var _0xd64e9b=0x0;for(var _0xbfb62f=0x0;_0xd64e9b<_0x38e33b;_0xbfb62f+=0x1){_0x2e0c08=_0xbfb62f/_0x563178;_0x28f399=(_0x1189df*_0x2e0c08+_0x626c68)/_0x59ddaa;_0x350bf7=erlangb(_0x28f399,_0x332dba);_0xd64e9b=_0x28f399/_0x332dba*(0x1-erlangb(_0x28f399,_0x332dba));}return _0x4b2e97({'erlangCalls':_0xbfb62f,'erlangCallToSecond':_0x563178/_0xbfb62f,'erlangAbandonmentRate':_0x350bf7,'erlangBusyFactor':_0xd64e9b});});};module[_0xcd9d('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 0482ece..f5f0c06 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 _0x80ae=['countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x36bab3,_0x19ce33){var _0x2d3989=function(_0x2a4f60){while(--_0x2a4f60){_0x36bab3['push'](_0x36bab3['shift']());}};_0x2d3989(++_0x19ce33);}(_0x80ae,0x1b6));var _0xe80a=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x80ae[_0x2f4c1c];return _0x25e0f2;};'use strict';var util=require(_0xe80a('0x0'));var _=require(_0xe80a('0x1'));var moment=require(_0xe80a('0x2'));function getSeconds(_0x203b3d,_0x2c8018){var _0x1c3252=moment(_0x203b3d)[_0xe80a('0x3')](0x0);var _0x470fca=moment(_0x2c8018)['milliseconds'](0x0);return _0x1c3252[_0xe80a('0x4')](_0x470fca,_0xe80a('0x5'));}function QueueCallerAbandon(_0x45671b,_0x433cfb){this[_0xe80a('0x6')]=_0x45671b[_0xe80a('0x6')];this[_0xe80a('0x7')]=_0x45671b['type'];this[_0xe80a('0x8')]=_0x45671b['type']===_0xe80a('0x9')?_0xe80a('0xa'):_0x45671b[_0xe80a('0x7')];this[_0xe80a('0xb')]=_0x45671b[_0xe80a('0xb')];this['countcongestionretry']=_0x45671b[_0xe80a('0xc')];this[_0xe80a('0xd')]=_0x45671b[_0xe80a('0xd')];this[_0xe80a('0xe')]=_0x45671b[_0xe80a('0xb')]+_0x45671b[_0xe80a('0xc')]+_0x45671b[_0xe80a('0xd')]+_0x45671b[_0xe80a('0xf')]+_0x45671b[_0xe80a('0x10')]+_0x45671b['countabandonedretry']+_0x45671b[_0xe80a('0x11')]+_0x45671b[_0xe80a('0x12')];this['countnosuchnumberretry']=_0x45671b[_0xe80a('0xf')];this[_0xe80a('0x10')]=_0x45671b['countdropretry'];this['countabandonedretry']=_0x45671b[_0xe80a('0x13')];this['countmachineretry']=_0x45671b[_0xe80a('0x11')];this[_0xe80a('0x12')]=_0x45671b[_0xe80a('0x12')];this[_0xe80a('0x14')]=_0x433cfb['uniqueid'];this['calleridname']=_0x45671b[_0xe80a('0x15')];this[_0xe80a('0x16')]=_0x45671b[_0xe80a('0x17')];this[_0xe80a('0x18')]=_0x45671b[_0xe80a('0x18')];this[_0xe80a('0x19')]=_0x45671b[_0xe80a('0x19')];this['droptime']=_0x45671b[_0xe80a('0x1a')];this['endtime']=this[_0xe80a('0x1a')];this[_0xe80a('0x1b')]=getSeconds(_0x45671b[_0xe80a('0x19')],_0x45671b[_0xe80a('0x18')]);this[_0xe80a('0x1c')]=getSeconds(this['droptime'],_0x45671b['responsetime']);this[_0xe80a('0x1d')]=0x0;this['queue']=_0x433cfb[_0xe80a('0xa')];this[_0xe80a('0x1e')]=_0x433cfb[_0xe80a('0x1f')];this['reason']=_0x433cfb[_0xe80a('0x20')];this['callback']=_0x45671b[_0xe80a('0x21')];this[_0xe80a('0x22')]=_0x45671b['callbackuniqueid'];this[_0xe80a('0x23')]=_0x45671b['callbackat'];this[_0xe80a('0x24')]=_0x45671b[_0xe80a('0x24')];this[_0xe80a('0x25')]=_0x45671b[_0xe80a('0x25')];this[_0xe80a('0x26')]=_0x45671b['ListId'];this[_0xe80a('0x27')]=_0x45671b['UserId'];this['VoiceQueueId']=_0x45671b[_0xe80a('0x28')];this[_0xe80a('0x29')]=_0x45671b[_0xe80a('0x29')];this[_0xe80a('0x2a')]=_0x45671b[_0xe80a('0x2a')]||'';this[_0xe80a('0x2b')]=_0x45671b[_0xe80a('0x2b')]||'';}module[_0xe80a('0x2c')]=QueueCallerAbandon; \ No newline at end of file +var _0x5f41=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x5f41,0x14c));var _0x15f4=function(_0x34e61f,_0x1e4205){_0x34e61f=_0x34e61f-0x0;var _0x330e63=_0x5f41[_0x34e61f];return _0x330e63;};'use strict';var util=require(_0x15f4('0x0'));var _=require('lodash');var moment=require(_0x15f4('0x1'));function getSeconds(_0x594043,_0x256115){var _0x5a0d5c=moment(_0x594043)['milliseconds'](0x0);var _0x4bc278=moment(_0x256115)['milliseconds'](0x0);return _0x5a0d5c['diff'](_0x4bc278,_0x15f4('0x2'));}function QueueCallerAbandon(_0x22b672,_0x432bec){this[_0x15f4('0x3')]=_0x22b672['scheduledat'];this[_0x15f4('0x4')]=_0x22b672[_0x15f4('0x4')];this['campaigntype']=_0x22b672['type']===_0x15f4('0x5')?_0x15f4('0x6'):_0x22b672[_0x15f4('0x4')];this[_0x15f4('0x7')]=_0x22b672['countbusyretry'];this[_0x15f4('0x8')]=_0x22b672['countcongestionretry'];this[_0x15f4('0x9')]=_0x22b672[_0x15f4('0x9')];this[_0x15f4('0xa')]=_0x22b672[_0x15f4('0x7')]+_0x22b672[_0x15f4('0x8')]+_0x22b672['countnoanswerretry']+_0x22b672['countnosuchnumberretry']+_0x22b672['countdropretry']+_0x22b672[_0x15f4('0xb')]+_0x22b672['countmachineretry']+_0x22b672[_0x15f4('0xc')];this[_0x15f4('0xd')]=_0x22b672[_0x15f4('0xd')];this[_0x15f4('0xe')]=_0x22b672[_0x15f4('0xe')];this[_0x15f4('0xb')]=_0x22b672[_0x15f4('0xb')];this[_0x15f4('0xf')]=_0x22b672[_0x15f4('0xf')];this['countagentrejectretry']=_0x22b672[_0x15f4('0xc')];this[_0x15f4('0x10')]=_0x432bec[_0x15f4('0x10')];this[_0x15f4('0x11')]=_0x22b672[_0x15f4('0x12')];this[_0x15f4('0x13')]=_0x22b672[_0x15f4('0x14')];this[_0x15f4('0x15')]=_0x22b672[_0x15f4('0x15')];this[_0x15f4('0x16')]=_0x22b672[_0x15f4('0x16')];this['droptime']=_0x22b672['droptime'];this[_0x15f4('0x17')]=this['droptime'];this[_0x15f4('0x18')]=getSeconds(_0x22b672[_0x15f4('0x16')],_0x22b672[_0x15f4('0x15')]);this[_0x15f4('0x19')]=getSeconds(this['droptime'],_0x22b672[_0x15f4('0x16')]);this[_0x15f4('0x1a')]=0x0;this[_0x15f4('0x6')]=_0x432bec[_0x15f4('0x6')];this[_0x15f4('0x1b')]=_0x432bec['connectedlinename'];this['reason']=_0x432bec[_0x15f4('0x1c')];this[_0x15f4('0x1d')]=_0x22b672[_0x15f4('0x1d')];this[_0x15f4('0x1e')]=_0x22b672[_0x15f4('0x1e')];this[_0x15f4('0x1f')]=_0x22b672['callbackat'];this[_0x15f4('0x20')]=_0x22b672['recallme'];this[_0x15f4('0x21')]=_0x22b672[_0x15f4('0x21')];this['ListId']=_0x22b672[_0x15f4('0x22')];this[_0x15f4('0x23')]=_0x22b672[_0x15f4('0x23')];this[_0x15f4('0x24')]=_0x22b672[_0x15f4('0x24')];this[_0x15f4('0x25')]=_0x22b672['CampaignId'];this[_0x15f4('0x26')]=_0x22b672['originatecalleridnum']||'';this[_0x15f4('0x27')]=_0x22b672[_0x15f4('0x27')]||'';}module[_0x15f4('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 4efad4f..dbc5bb8 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(_0x711d1d,_0x140b5a){var _0x2f5e3a=function(_0x2a58f9){while(--_0x2a58f9){_0x711d1d['push'](_0x711d1d['shift']());}};_0x2f5e3a(++_0x140b5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x406da3,_0x666f64){var _0x504eea=function(_0x1bc22e){while(--_0x1bc22e){_0x406da3['push'](_0x406da3['shift']());}};_0x504eea(++_0x666f64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 75ea359..1cafb56 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 _0x069a=['transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','reachable','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','channelstate','channelstatedesc','syncNewExten','variable','value','operation','status','filename','remotestationid','pagestransferred','resolution'];(function(_0x7463ff,_0x45bf48){var _0x26a3c0=function(_0x884f6d){while(--_0x884f6d){_0x7463ff['push'](_0x7463ff['shift']());}};_0x26a3c0(++_0x45bf48);}(_0x069a,0xb8));var _0xa069=function(_0x775e29,_0x34a551){_0x775e29=_0x775e29-0x0;var _0x38f865=_0x069a[_0x775e29];return _0x38f865;};'use strict';var util=require(_0xa069('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xa069('0x1'));var moment=require(_0xa069('0x2'));var path=require('path');var tiff2pdf=require(_0xa069('0x3'));var gs=require(_0xa069('0x4'));var logger=require('../../../config/logger')(_0xa069('0x5'));var ami=require(_0xa069('0x6'));var rpcDb=require(_0xa069('0x7'));var Channel=require(_0xa069('0x8'));var ut=require(_0xa069('0x9'));var Action=require(_0xa069('0xa'));var faxAccount=require(_0xa069('0xb'));var attachment=require(_0xa069('0xc'));var faxMessage=require(_0xa069('0xd'));function Fax(_0x1a3feb){this[_0xa069('0xe')]={};this[_0xa069('0xf')]=_0x1a3feb[_0xa069('0xf')];this[_0xa069('0x10')]=_0x1a3feb[_0xa069('0x10')];this[_0xa069('0x11')]={};ami['on'](_0xa069('0x12'),this[_0xa069('0x13')][_0xa069('0x14')](this));ami['on']('varset',this[_0xa069('0x15')]['bind'](this));ami['on'](_0xa069('0x16'),this[_0xa069('0x17')][_0xa069('0x14')](this));ami['on'](_0xa069('0x18'),this['syncNewExten'][_0xa069('0x14')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0xa069('0x19'),this[_0xa069('0x1a')][_0xa069('0x14')](this));ami['on'](_0xa069('0x1b'),this[_0xa069('0x1c')]['bind'](this));ami['on'](_0xa069('0x1d'),this[_0xa069('0x1e')]['bind'](this));}Fax[_0xa069('0x1f')]['syncNewchannel']=function(_0x9805a7){if(_0x9805a7[_0xa069('0x20')]===_0xa069('0x21')){for(var _0x423828 in this[_0xa069('0xf')]){if(this[_0xa069('0xf')][_0xa069('0x22')](_0x423828)){if(_0x9805a7[_0xa069('0x23')]===this['faxAccounts'][_0x423828][_0xa069('0x24')]){this[_0xa069('0xe')][_0x9805a7['uniqueid']]={};this[_0xa069('0xe')][_0x9805a7[_0xa069('0x25')]][_0xa069('0x26')]=_0x9805a7['channel'];this[_0xa069('0xe')][_0x9805a7[_0xa069('0x25')]]['id']=this['faxAccounts'][_0x423828]['id'];this['channels'][_0x9805a7[_0xa069('0x25')]][_0xa069('0x27')]=this[_0xa069('0xf')][_0x423828][_0xa069('0x27')];logger[_0xa069('0x28')](_0x9805a7[_0xa069('0x25')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x9805a7[_0xa069('0x25')]]){this['channels'][_0x9805a7['uniqueid']]={};this[_0xa069('0xe')][_0x9805a7[_0xa069('0x25')]]['channel']=_0x9805a7['channel'];logger[_0xa069('0x28')](_0x9805a7['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0xa069('0x1f')][_0xa069('0x15')]=function(_0x5cb7c7){if(this[_0xa069('0xe')][_0x5cb7c7[_0xa069('0x25')]]){for(var _0x116380 in _0x5cb7c7['variable']){if(_0x5cb7c7['variable'][_0xa069('0x22')](_0x116380)){this[_0xa069('0xe')][_0x5cb7c7[_0xa069('0x25')]][_0x116380]=_0x5cb7c7['value'];}}}};Fax[_0xa069('0x1f')]['syncNewState']=function(_0x28841f){if(this[_0xa069('0xe')][_0x28841f[_0xa069('0x25')]]){this[_0xa069('0xe')][_0x28841f[_0xa069('0x25')]][_0xa069('0x29')]=_0x28841f[_0xa069('0x29')];this[_0xa069('0xe')][_0x28841f['uniqueid']][_0xa069('0x2a')]=_0x28841f[_0xa069('0x2a')];}};Fax[_0xa069('0x1f')][_0xa069('0x2b')]=function(_0x5aded3){if(this[_0xa069('0xe')][_0x5aded3[_0xa069('0x25')]]){for(var _0x19bb61 in _0x5aded3[_0xa069('0x2c')]){if(_0x5aded3['variable'][_0xa069('0x22')](_0x19bb61)){this[_0xa069('0xe')][_0x5aded3[_0xa069('0x25')]][_0x19bb61]=_0x5aded3[_0xa069('0x2d')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x4d03df){if(this[_0xa069('0xe')][_0x4d03df[_0xa069('0x25')]]){this[_0xa069('0xe')][_0x4d03df['uniqueid']][_0xa069('0x2e')]=_0x4d03df[_0xa069('0x2e')];this[_0xa069('0xe')][_0x4d03df['uniqueid']][_0xa069('0x2f')]=_0x4d03df['status'];this[_0xa069('0xe')][_0x4d03df['uniqueid']][_0xa069('0x24')]=_0x4d03df[_0xa069('0x24')];this[_0xa069('0xe')][_0x4d03df[_0xa069('0x25')]]['filename']=_0x4d03df[_0xa069('0x30')];logger[_0xa069('0x28')](_0x4d03df[_0xa069('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0xa069('0x1f')][_0xa069('0x1a')]=function(_0xb6f86c){var _0x3864e4=this;if(this[_0xa069('0xe')][_0xb6f86c[_0xa069('0x25')]]){var _0x5b11f7=this['channels'][_0xb6f86c[_0xa069('0x25')]]['id'];this[_0xa069('0xe')][_0xb6f86c[_0xa069('0x25')]][_0xa069('0x31')]=_0xb6f86c[_0xa069('0x31')];this[_0xa069('0xe')][_0xb6f86c[_0xa069('0x25')]][_0xa069('0x32')]=_0xb6f86c[_0xa069('0x32')];this[_0xa069('0xe')][_0xb6f86c[_0xa069('0x25')]][_0xa069('0x24')]=_0xb6f86c[_0xa069('0x24')];this[_0xa069('0xe')][_0xb6f86c['uniqueid']]['resolution']=_0xb6f86c[_0xa069('0x33')];this[_0xa069('0xe')][_0xb6f86c[_0xa069('0x25')]][_0xa069('0x34')]=_0xb6f86c[_0xa069('0x34')];this['channels'][_0xb6f86c[_0xa069('0x25')]][_0xa069('0x30')]=_0xb6f86c[_0xa069('0x30')];this[_0xa069('0xe')][_0xb6f86c['uniqueid']]['calleridnum']=_0xb6f86c[_0xa069('0x35')];if(this[_0xa069('0xe')][_0xb6f86c['uniqueid']][_0xa069('0x32')]>0x0){tiff2pdf(_0xb6f86c['filename'],_0xa069('0x36'),function(_0x5be372){logger['info'](_0xb6f86c[_0xa069('0x25')],_0xa069('0x37'),_0x5be372[_0xa069('0x38')]);attachment[_0xa069('0x39')]({'name':path[_0xa069('0x3a')](_0xb6f86c[_0xa069('0x30')])[_0xa069('0x27')],'basename':path['parse'](_0xb6f86c['filename'])['name']+'.pdf','type':_0xa069('0x3b')})['then'](function(_0x3e695e){faxAccount['notify'](_0x5b11f7,{'from':_0xb6f86c['calleridnum'],'mapKey':_0xa069('0x5'),'body':path[_0xa069('0x3a')](_0xb6f86c[_0xa069('0x30')])[_0xa069('0x27')]+_0xa069('0x3c'),'AttachmentId':_0x3e695e['id']})[_0xa069('0x3d')](function(_0x309ac5){logger[_0xa069('0x3e')](_0xb6f86c[_0xa069('0x25')],_0xa069('0x3f'),JSON['stringify'](_0x309ac5));});})[_0xa069('0x3d')](function(_0x33e713){logger['error'](_0xb6f86c[_0xa069('0x25')],_0xa069('0x40'),JSON[_0xa069('0x41')](_0x33e713));});});}logger['info'](_0xb6f86c[_0xa069('0x25')],'\x20receiveFax\x20');}};Fax[_0xa069('0x1f')][_0xa069('0x1e')]=function(_0x20ec16){if(this[_0xa069('0x11')][_0x20ec16[_0xa069('0x25')]]){_[_0xa069('0x42')](this['channels'][_0x20ec16['uniqueid']],_[_0xa069('0x43')](_0x20ec16,['response','reason']));}};function updateStatus(_0x5aec3c){if(_0x5aec3c[_0xa069('0x44')]){faxMessage[_0xa069('0x45')](_0x5aec3c[_0xa069('0x44')],{'failMessage':_0xa069('0x46')})[_0xa069('0x47')](function(_0x3791e4){ut[_0xa069('0x48')](_0xa069('0x49'),_0x3791e4);})[_0xa069('0x3d')](function(_0x25650b){ut[_0xa069('0x48')](_0xa069('0x4a'),_0x25650b);});}else{ut[_0xa069('0x48')](_0xa069('0x4b'));}}Fax[_0xa069('0x1f')][_0xa069('0x4c')]=function(_0x391d6a,_0x1cf459,_0x491901){var _0x4cde8f=this;var _0x1bd5a1={};if(_0x1cf459){_0x1bd5a1={'read':_0x1cf459};}else{_0x1bd5a1={'failMessage':_0x491901};}if(this[_0xa069('0x11')][_0x391d6a][_0xa069('0x44')]){faxMessage[_0xa069('0x45')](this['actions'][_0x391d6a][_0xa069('0x44')],_0x1bd5a1)['then'](function(_0x5af159){ut['logger'](_0xa069('0x4d'),_0x5af159);})['catch'](function(_0x4dfd94){ut['logger'](_0xa069('0x4e'),_0x4dfd94);})['finally'](function(){delete _0x4cde8f[_0xa069('0xe')][_0x391d6a];delete _0x4cde8f['actions'][_0x391d6a];});}else{ut[_0xa069('0x48')](_0xa069('0x4f'));delete this[_0xa069('0xe')][_0x391d6a];delete this[_0xa069('0x11')][_0x391d6a];}};Fax[_0xa069('0x1f')][_0xa069('0x1c')]=function(_0x3373ca){var _0x3baa7d=this;if(this[_0xa069('0xe')][_0x3373ca[_0xa069('0x25')]]){if(this['actions'][_0x3373ca[_0xa069('0x25')]]){this[_0xa069('0xe')][_0x3373ca[_0xa069('0x25')]]['id']=this[_0xa069('0x11')][_0x3373ca[_0xa069('0x25')]]['id'];this[_0xa069('0xe')][_0x3373ca['uniqueid']]['name']=this[_0xa069('0x11')][_0x3373ca['uniqueid']][_0xa069('0x27')];}logger[_0xa069('0x28')](_0x3373ca[_0xa069('0x25')],this[_0xa069('0x11')][_0x3373ca[_0xa069('0x25')]]?'\x20hangup\x20sendFile\x20':_0xa069('0x50'),JSON['stringify'](this['channels'][_0x3373ca['uniqueid']]));if(this[_0xa069('0x11')][_0x3373ca[_0xa069('0x25')]]){if(this['channels'][_0x3373ca[_0xa069('0x25')]][_0xa069('0x51')]>0x0&&this[_0xa069('0xe')][_0x3373ca[_0xa069('0x25')]][_0xa069('0x52')]===_0xa069('0x53')){this[_0xa069('0x4c')](_0x3373ca['uniqueid'],!![]);}else{this[_0xa069('0x4c')](_0x3373ca[_0xa069('0x25')],![],this[_0xa069('0xe')][_0x3373ca[_0xa069('0x25')]][_0xa069('0x54')]?_0xa069('0x55')+this[_0xa069('0xe')][_0x3373ca[_0xa069('0x25')]]['faxstatusstring']:_0xa069('0x56'));}}}};Fax[_0xa069('0x1f')]['send']=function(_0x419570){var _0x29b3dc=this;return new BPromise(function(_0x4a7518,_0x13789b){_0x29b3dc[_0xa069('0x57')](_0x419570,_0x29b3dc[_0xa069('0xf')][_0x419570[_0xa069('0x58')]])[_0xa069('0x47')](function(_0x38d2ad){ut[_0xa069('0x48')](_0xa069('0x59'),_0x38d2ad);_0x4a7518(ut['message']('Fax\x20received'));})[_0xa069('0x3d')](function(_0x36cdb3){ut[_0xa069('0x48')](_0xa069('0x5a'),_0x36cdb3);updateStatus(_0x419570);_0x13789b(ut[_0xa069('0x38')](_0xa069('0x5b')));});});};Fax[_0xa069('0x1f')][_0xa069('0x5c')]=function(_0x413361){var _0x11c64c=this;return new BPromise(function(_0x18872e,_0x32f0ee){var _0x16a761=_0x11c64c[_0xa069('0x5d')](_0x11c64c[_0xa069('0xf')][_0x413361['FaxAccountId']][_0xa069('0x5e')],_0x413361);if(_0x16a761[_0xa069('0x5f')]){_0x18872e(ut[_0xa069('0x38')]('Trunk\x20Reachable'));}else{_0x32f0ee(ut[_0xa069('0x38')](_0x16a761[_0xa069('0x38')]));}});};function originate(_0x832587,_0x3dc0bc,_0x4f46d4){return new BPromise(function(_0x1ceda6,_0x408daf){if(_0x4f46d4){var _0x148236=util[_0xa069('0x60')](_0xa069('0x61'),path[_0xa069('0x3a')](_0x832587['path'])['name'],_0x832587[_0xa069('0x62')]);gs[_0xa069('0x63')](_0x148236)[_0xa069('0x47')](function(){_0x832587[_0xa069('0x62')]=util[_0xa069('0x60')](_0xa069('0x64'),path['parse'](_0x832587[_0xa069('0x62')])['dir'],path[_0xa069('0x3a')](_0x832587[_0xa069('0x62')])['name']);_0x3dc0bc[_0xa069('0x65')]=_0x832587[_0xa069('0x62')];ut['logger'](_0xa069('0x66'),'');ami[_0xa069('0x67')](ut['variablesAction'](_0x832587,_0x3dc0bc))[_0xa069('0x47')](function(_0x1764d2){_0x1ceda6(_0x1764d2);})['catch'](function(_0x3b913e){_0x408daf(_0x3b913e);});})[_0xa069('0x3d')](function(_0x366335){_0x408daf(_0x366335);});}else{ami[_0xa069('0x67')](ut[_0xa069('0x68')](_0x832587,_0x3dc0bc))[_0xa069('0x47')](function(_0x1b31be){_0x1ceda6(_0x1b31be);})[_0xa069('0x3d')](function(_0x2a2188){_0x408daf(_0x2a2188);});}});}Fax['prototype'][_0xa069('0x57')]=function(_0x3e393b,_0x51f99c){var _0x2dfc3b=this;return new BPromise(function(_0x274f77,_0x3fa400){var _0x30d893=uuid['v4']();var _0x24992f=ut[_0xa069('0x69')](_0x3e393b,_0x51f99c);_0x2dfc3b[_0xa069('0x11')][_0x30d893]=new Action(_0x30d893,_0x51f99c,_0x3e393b);var _0x59af3c=_0x2dfc3b[_0xa069('0x11')][_0x30d893];if(path[_0xa069('0x3a')](_0x3e393b[_0xa069('0x62')])['ext']===_0xa069('0x3c')){originate(_0x59af3c,_0x24992f,!![])[_0xa069('0x47')](function(_0x568f21){_0x274f77(_0x568f21);})[_0xa069('0x3d')](function(_0x3b6a08){_0x3fa400(_0x3b6a08);});}else{originate(_0x59af3c,_0x24992f,![])[_0xa069('0x47')](function(_0x5cd4c4){_0x274f77(_0x5cd4c4);})[_0xa069('0x3d')](function(_0x1bd9d1){_0x3fa400(_0x1bd9d1);});}});};Fax[_0xa069('0x1f')]['isTrunkReachable']=function(_0x2d3d10){return!_[_0xa069('0x6a')](_0x2d3d10)&&!_['isNil'](_0x2d3d10['name'])&&!_[_0xa069('0x6a')](_0x2d3d10[_0xa069('0x6b')])&&_0x2d3d10[_0xa069('0x6b')]&&!_[_0xa069('0x6a')](this[_0xa069('0x10')][util[_0xa069('0x60')](_0xa069('0x6c'),_0x2d3d10[_0xa069('0x27')])])&&!_[_0xa069('0x6a')](this[_0xa069('0x10')][util['format'](_0xa069('0x6c'),_0x2d3d10[_0xa069('0x27')])][_0xa069('0x2f')])&&(this[_0xa069('0x10')][util['format'](_0xa069('0x6c'),_0x2d3d10[_0xa069('0x27')])]['status']===_0xa069('0x6d')||this[_0xa069('0x10')][util[_0xa069('0x60')](_0xa069('0x6c'),_0x2d3d10[_0xa069('0x27')])][_0xa069('0x2f')]==='unmonitored');};Fax[_0xa069('0x1f')][_0xa069('0x5d')]=function(_0x1c9df3,_0x26d41c){if(!this[_0xa069('0x6e')](_0x1c9df3)){ut[_0xa069('0x48')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x1c9df3)?'':_0x1c9df3[_0xa069('0x27')]+_0xa069('0x6f'));return{'isValid':![],'message':_0xa069('0x70')};}if(_[_0xa069('0x6a')](_0x26d41c[_0xa069('0x5')])){ut['logger'](_0xa069('0x71'),JSON[_0xa069('0x41')](_0x26d41c));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x26d41c[_0xa069('0x62')])){ut[_0xa069('0x48')](_0xa069('0x72'),JSON['stringify'](_0x26d41c));return{'isValid':![],'message':_0xa069('0x73')};}return{'isValid':!![],'message':_0xa069('0x74')};};module[_0xa069('0x75')]=Fax; \ No newline at end of file +var _0xc7c3=['[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Action','variablesAction','execOriginate','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','fax','error','stringify','catch','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus'];(function(_0x2a377a,_0x379558){var _0x58e906=function(_0x430033){while(--_0x430033){_0x2a377a['push'](_0x2a377a['shift']());}};_0x58e906(++_0x379558);}(_0xc7c3,0xa0));var _0x3c7c=function(_0x5c188a,_0x4988ae){_0x5c188a=_0x5c188a-0x0;var _0x21d9dc=_0xc7c3[_0x5c188a];return _0x21d9dc;};'use strict';var util=require(_0x3c7c('0x0'));var _=require(_0x3c7c('0x1'));var BPromise=require(_0x3c7c('0x2'));var uuid=require(_0x3c7c('0x3'));var moment=require(_0x3c7c('0x4'));var path=require(_0x3c7c('0x5'));var tiff2pdf=require(_0x3c7c('0x6'));var gs=require(_0x3c7c('0x7'));var logger=require(_0x3c7c('0x8'))('fax');var ami=require(_0x3c7c('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x3c7c('0xa'));var ut=require('./util/util');var Action=require(_0x3c7c('0xb'));var faxAccount=require(_0x3c7c('0xc'));var attachment=require(_0x3c7c('0xd'));var faxMessage=require(_0x3c7c('0xe'));function Fax(_0x482fff){this[_0x3c7c('0xf')]={};this['faxAccounts']=_0x482fff['faxAccounts'];this['trunks']=_0x482fff[_0x3c7c('0x10')];this[_0x3c7c('0x11')]={};ami['on'](_0x3c7c('0x12'),this[_0x3c7c('0x13')][_0x3c7c('0x14')](this));ami['on'](_0x3c7c('0x15'),this[_0x3c7c('0x16')][_0x3c7c('0x14')](this));ami['on'](_0x3c7c('0x17'),this[_0x3c7c('0x18')][_0x3c7c('0x14')](this));ami['on'](_0x3c7c('0x19'),this[_0x3c7c('0x1a')][_0x3c7c('0x14')](this));ami['on'](_0x3c7c('0x1b'),this[_0x3c7c('0x1c')]['bind'](this));ami['on']('receivefax',this[_0x3c7c('0x1d')][_0x3c7c('0x14')](this));ami['on'](_0x3c7c('0x1e'),this[_0x3c7c('0x1f')][_0x3c7c('0x14')](this));ami['on']('originateresponse',this[_0x3c7c('0x20')]['bind'](this));}Fax[_0x3c7c('0x21')][_0x3c7c('0x13')]=function(_0x17a8c3){if(_0x17a8c3[_0x3c7c('0x22')]===_0x3c7c('0x23')){for(var _0xe18afc in this[_0x3c7c('0x24')]){if(this[_0x3c7c('0x24')][_0x3c7c('0x25')](_0xe18afc)){if(_0x17a8c3[_0x3c7c('0x26')]===this[_0x3c7c('0x24')][_0xe18afc][_0x3c7c('0x27')]){this[_0x3c7c('0xf')][_0x17a8c3[_0x3c7c('0x28')]]={};this['channels'][_0x17a8c3[_0x3c7c('0x28')]]['channel']=_0x17a8c3[_0x3c7c('0x29')];this[_0x3c7c('0xf')][_0x17a8c3['uniqueid']]['id']=this['faxAccounts'][_0xe18afc]['id'];this[_0x3c7c('0xf')][_0x17a8c3[_0x3c7c('0x28')]][_0x3c7c('0x2a')]=this[_0x3c7c('0x24')][_0xe18afc]['name'];logger[_0x3c7c('0x2b')](_0x17a8c3[_0x3c7c('0x28')],_0x3c7c('0x2c'));}}}}if(this[_0x3c7c('0x11')][_0x17a8c3[_0x3c7c('0x28')]]){this[_0x3c7c('0xf')][_0x17a8c3[_0x3c7c('0x28')]]={};this[_0x3c7c('0xf')][_0x17a8c3[_0x3c7c('0x28')]][_0x3c7c('0x29')]=_0x17a8c3[_0x3c7c('0x29')];logger['info'](_0x17a8c3[_0x3c7c('0x28')],_0x3c7c('0x2c'));}};Fax[_0x3c7c('0x21')][_0x3c7c('0x16')]=function(_0x191da7){if(this[_0x3c7c('0xf')][_0x191da7[_0x3c7c('0x28')]]){for(var _0x30625f in _0x191da7[_0x3c7c('0x2d')]){if(_0x191da7[_0x3c7c('0x2d')][_0x3c7c('0x25')](_0x30625f)){this[_0x3c7c('0xf')][_0x191da7['uniqueid']][_0x30625f]=_0x191da7[_0x3c7c('0x2e')];}}}};Fax[_0x3c7c('0x21')]['syncNewState']=function(_0x29d527){if(this[_0x3c7c('0xf')][_0x29d527[_0x3c7c('0x28')]]){this[_0x3c7c('0xf')][_0x29d527[_0x3c7c('0x28')]][_0x3c7c('0x2f')]=_0x29d527[_0x3c7c('0x2f')];this[_0x3c7c('0xf')][_0x29d527[_0x3c7c('0x28')]]['channelstatedesc']=_0x29d527[_0x3c7c('0x30')];}};Fax[_0x3c7c('0x21')][_0x3c7c('0x1a')]=function(_0x32e200){if(this['channels'][_0x32e200[_0x3c7c('0x28')]]){for(var _0x2e9d5f in _0x32e200[_0x3c7c('0x2d')]){if(_0x32e200[_0x3c7c('0x2d')]['hasOwnProperty'](_0x2e9d5f)){this[_0x3c7c('0xf')][_0x32e200[_0x3c7c('0x28')]][_0x2e9d5f]=_0x32e200['value'];}}}};Fax[_0x3c7c('0x21')][_0x3c7c('0x1c')]=function(_0x398366){if(this[_0x3c7c('0xf')][_0x398366[_0x3c7c('0x28')]]){this['channels'][_0x398366['uniqueid']][_0x3c7c('0x31')]=_0x398366[_0x3c7c('0x31')];this['channels'][_0x398366[_0x3c7c('0x28')]][_0x3c7c('0x32')]=_0x398366[_0x3c7c('0x32')];this[_0x3c7c('0xf')][_0x398366[_0x3c7c('0x28')]][_0x3c7c('0x27')]=_0x398366[_0x3c7c('0x27')];this[_0x3c7c('0xf')][_0x398366[_0x3c7c('0x28')]][_0x3c7c('0x33')]=_0x398366[_0x3c7c('0x33')];logger[_0x3c7c('0x2b')](_0x398366[_0x3c7c('0x28')],_0x3c7c('0x34'));}};Fax[_0x3c7c('0x21')][_0x3c7c('0x1d')]=function(_0x1de3df){var _0x3f10c1=this;if(this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]]){var _0x4490c1=this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]]['id'];this['channels'][_0x1de3df[_0x3c7c('0x28')]]['remotestationid']=_0x1de3df[_0x3c7c('0x35')];this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]][_0x3c7c('0x36')]=_0x1de3df[_0x3c7c('0x36')];this[_0x3c7c('0xf')][_0x1de3df['uniqueid']][_0x3c7c('0x27')]=_0x1de3df[_0x3c7c('0x27')];this['channels'][_0x1de3df[_0x3c7c('0x28')]][_0x3c7c('0x37')]=_0x1de3df[_0x3c7c('0x37')];this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]][_0x3c7c('0x38')]=_0x1de3df[_0x3c7c('0x38')];this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]][_0x3c7c('0x33')]=_0x1de3df[_0x3c7c('0x33')];this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]]['calleridnum']=_0x1de3df[_0x3c7c('0x39')];if(this[_0x3c7c('0xf')][_0x1de3df[_0x3c7c('0x28')]]['pagestransferred']>0x0){tiff2pdf(_0x1de3df['filename'],_0x3c7c('0x3a'),function(_0x35573f){logger[_0x3c7c('0x2b')](_0x1de3df[_0x3c7c('0x28')],_0x3c7c('0x3b'),_0x35573f[_0x3c7c('0x3c')]);attachment['create']({'name':path[_0x3c7c('0x3d')](_0x1de3df[_0x3c7c('0x33')])[_0x3c7c('0x2a')],'basename':path[_0x3c7c('0x3d')](_0x1de3df[_0x3c7c('0x33')])['name']+_0x3c7c('0x3e'),'type':_0x3c7c('0x3f')})[_0x3c7c('0x40')](function(_0x1164ff){faxAccount[_0x3c7c('0x41')](_0x4490c1,{'from':_0x1de3df[_0x3c7c('0x39')],'mapKey':_0x3c7c('0x42'),'body':path[_0x3c7c('0x3d')](_0x1de3df[_0x3c7c('0x33')])[_0x3c7c('0x2a')]+'.pdf','AttachmentId':_0x1164ff['id']})['catch'](function(_0x1247e7){logger[_0x3c7c('0x43')](_0x1de3df[_0x3c7c('0x28')],'\x20notify\x20',JSON[_0x3c7c('0x44')](_0x1247e7));});})[_0x3c7c('0x45')](function(_0x24315b){logger[_0x3c7c('0x43')](_0x1de3df[_0x3c7c('0x28')],_0x3c7c('0x46'),JSON[_0x3c7c('0x44')](_0x24315b));});});}logger[_0x3c7c('0x2b')](_0x1de3df[_0x3c7c('0x28')],'\x20receiveFax\x20');}};Fax[_0x3c7c('0x21')][_0x3c7c('0x20')]=function(_0x3dca97){if(this[_0x3c7c('0x11')][_0x3dca97[_0x3c7c('0x28')]]){_[_0x3c7c('0x47')](this[_0x3c7c('0xf')][_0x3dca97[_0x3c7c('0x28')]],_[_0x3c7c('0x48')](_0x3dca97,[_0x3c7c('0x49'),_0x3c7c('0x4a')]));}};function updateStatus(_0x2c89ec){if(_0x2c89ec[_0x3c7c('0x4b')]){faxMessage[_0x3c7c('0x4c')](_0x2c89ec[_0x3c7c('0x4b')],{'failMessage':_0x3c7c('0x4d')})['then'](function(_0x1ef64b){ut[_0x3c7c('0x4e')](_0x3c7c('0x4f'),_0x1ef64b);})[_0x3c7c('0x45')](function(_0x14d178){ut[_0x3c7c('0x4e')]('[Fax][Message][Error][NoUpdate1]',_0x14d178);});}else{ut[_0x3c7c('0x4e')](_0x3c7c('0x50'));}}Fax['prototype'][_0x3c7c('0x51')]=function(_0x57b2d0,_0xccdaec,_0x1e621c){var _0x1095c5=this;var _0x20074b={};if(_0xccdaec){_0x20074b={'read':_0xccdaec};}else{_0x20074b={'failMessage':_0x1e621c};}if(this['actions'][_0x57b2d0][_0x3c7c('0x4b')]){faxMessage['update'](this[_0x3c7c('0x11')][_0x57b2d0][_0x3c7c('0x4b')],_0x20074b)[_0x3c7c('0x40')](function(_0x3b7350){ut[_0x3c7c('0x4e')]('[Fax][Message][Updated]',_0x3b7350);})['catch'](function(_0x3f51af){ut['logger'](_0x3c7c('0x52'),_0x3f51af);})[_0x3c7c('0x53')](function(){delete _0x1095c5[_0x3c7c('0xf')][_0x57b2d0];delete _0x1095c5['actions'][_0x57b2d0];});}else{ut[_0x3c7c('0x4e')](_0x3c7c('0x54'));delete this[_0x3c7c('0xf')][_0x57b2d0];delete this[_0x3c7c('0x11')][_0x57b2d0];}};Fax[_0x3c7c('0x21')][_0x3c7c('0x1f')]=function(_0x422725){var _0x395bc5=this;if(this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]]){if(this['actions'][_0x422725[_0x3c7c('0x28')]]){this[_0x3c7c('0xf')][_0x422725['uniqueid']]['id']=this['actions'][_0x422725[_0x3c7c('0x28')]]['id'];this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]][_0x3c7c('0x2a')]=this[_0x3c7c('0x11')][_0x422725[_0x3c7c('0x28')]]['name'];}logger[_0x3c7c('0x2b')](_0x422725[_0x3c7c('0x28')],this[_0x3c7c('0x11')][_0x422725[_0x3c7c('0x28')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x3c7c('0x44')](this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]]));if(this[_0x3c7c('0x11')][_0x422725[_0x3c7c('0x28')]]){if(this['channels'][_0x422725[_0x3c7c('0x28')]][_0x3c7c('0x55')]>0x0&&this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]][_0x3c7c('0x1b')]===_0x3c7c('0x56')){this[_0x3c7c('0x51')](_0x422725[_0x3c7c('0x28')],!![]);}else{this['updateStatus'](_0x422725[_0x3c7c('0x28')],![],this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x3c7c('0xf')][_0x422725[_0x3c7c('0x28')]][_0x3c7c('0x57')]:_0x3c7c('0x58'));}}}};Fax[_0x3c7c('0x21')][_0x3c7c('0x59')]=function(_0x20dc27){var _0x13c780=this;return new BPromise(function(_0x1d592a,_0x548fe1){_0x13c780['execOriginate'](_0x20dc27,_0x13c780[_0x3c7c('0x24')][_0x20dc27[_0x3c7c('0x5a')]])['then'](function(_0x4a3a24){ut['logger'](_0x3c7c('0x5b'),_0x4a3a24);_0x1d592a(ut[_0x3c7c('0x3c')](_0x3c7c('0x5c')));})[_0x3c7c('0x45')](function(_0xf80e58){ut[_0x3c7c('0x4e')](_0x3c7c('0x5d'),_0xf80e58);updateStatus(_0x20dc27);_0x548fe1(ut['message'](_0x3c7c('0x5e')));});});};Fax[_0x3c7c('0x21')]['checkAfterSend']=function(_0x2404b8){var _0x58ba6e=this;return new BPromise(function(_0x30f844,_0x1e6226){var _0x4f007c=_0x58ba6e['checkTrunk'](_0x58ba6e[_0x3c7c('0x24')][_0x2404b8[_0x3c7c('0x5a')]][_0x3c7c('0x5f')],_0x2404b8);if(_0x4f007c[_0x3c7c('0x60')]){_0x30f844(ut[_0x3c7c('0x3c')](_0x3c7c('0x61')));}else{_0x1e6226(ut['message'](_0x4f007c[_0x3c7c('0x3c')]));}});};function originate(_0x22980b,_0x4e5acd,_0x47271c){return new BPromise(function(_0x4b7f00,_0x30e996){if(_0x47271c){var _0x20988c=util[_0x3c7c('0x62')](_0x3c7c('0x63'),path['parse'](_0x22980b[_0x3c7c('0x5')])[_0x3c7c('0x2a')],_0x22980b[_0x3c7c('0x5')]);gs[_0x3c7c('0x64')](_0x20988c)['then'](function(){_0x22980b[_0x3c7c('0x5')]=util[_0x3c7c('0x62')](_0x3c7c('0x65'),path['parse'](_0x22980b[_0x3c7c('0x5')])[_0x3c7c('0x66')],path[_0x3c7c('0x3d')](_0x22980b[_0x3c7c('0x5')])[_0x3c7c('0x2a')]);_0x4e5acd['XMF-PATH']=_0x22980b[_0x3c7c('0x5')];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x3c7c('0x67')](ut[_0x3c7c('0x68')](_0x22980b,_0x4e5acd))[_0x3c7c('0x40')](function(_0x3e61a6){_0x4b7f00(_0x3e61a6);})[_0x3c7c('0x45')](function(_0x54f60e){_0x30e996(_0x54f60e);});})[_0x3c7c('0x45')](function(_0x2c92b7){_0x30e996(_0x2c92b7);});}else{ami['Action'](ut[_0x3c7c('0x68')](_0x22980b,_0x4e5acd))[_0x3c7c('0x40')](function(_0x5ec45d){_0x4b7f00(_0x5ec45d);})[_0x3c7c('0x45')](function(_0x1181c3){_0x30e996(_0x1181c3);});}});}Fax[_0x3c7c('0x21')][_0x3c7c('0x69')]=function(_0x4bf821,_0x5aaa10){var _0x140534=this;return new BPromise(function(_0x50cac6,_0x562f07){var _0x316f76=uuid['v4']();var _0x2a6b57=ut['addVariables'](_0x4bf821,_0x5aaa10);_0x140534[_0x3c7c('0x11')][_0x316f76]=new Action(_0x316f76,_0x5aaa10,_0x4bf821);var _0x4f651a=_0x140534[_0x3c7c('0x11')][_0x316f76];if(path[_0x3c7c('0x3d')](_0x4bf821['path'])[_0x3c7c('0x6a')]===_0x3c7c('0x3e')){originate(_0x4f651a,_0x2a6b57,!![])[_0x3c7c('0x40')](function(_0xf25a94){_0x50cac6(_0xf25a94);})[_0x3c7c('0x45')](function(_0x108d31){_0x562f07(_0x108d31);});}else{originate(_0x4f651a,_0x2a6b57,![])[_0x3c7c('0x40')](function(_0x4eb828){_0x50cac6(_0x4eb828);})[_0x3c7c('0x45')](function(_0x507831){_0x562f07(_0x507831);});}});};Fax['prototype'][_0x3c7c('0x6b')]=function(_0x6621a4){return!_['isNil'](_0x6621a4)&&!_[_0x3c7c('0x6c')](_0x6621a4['name'])&&!_[_0x3c7c('0x6c')](_0x6621a4[_0x3c7c('0x6d')])&&_0x6621a4[_0x3c7c('0x6d')]&&!_[_0x3c7c('0x6c')](this['trunks'][util[_0x3c7c('0x62')](_0x3c7c('0x6e'),_0x6621a4[_0x3c7c('0x2a')])])&&!_['isNil'](this['trunks'][util[_0x3c7c('0x62')](_0x3c7c('0x6e'),_0x6621a4[_0x3c7c('0x2a')])][_0x3c7c('0x32')])&&(this['trunks'][util[_0x3c7c('0x62')](_0x3c7c('0x6e'),_0x6621a4[_0x3c7c('0x2a')])][_0x3c7c('0x32')]===_0x3c7c('0x6f')||this[_0x3c7c('0x10')][util['format']('SIP/%s',_0x6621a4[_0x3c7c('0x2a')])][_0x3c7c('0x32')]===_0x3c7c('0x70'));};Fax['prototype'][_0x3c7c('0x71')]=function(_0x5db71b,_0x2cbe15){if(!this['isTrunkReachable'](_0x5db71b)){ut[_0x3c7c('0x4e')](_0x3c7c('0x72'),_['isNil'](_0x5db71b)?'':_0x5db71b['name']+_0x3c7c('0x73'));return{'isValid':![],'message':_0x3c7c('0x74')};}if(_[_0x3c7c('0x6c')](_0x2cbe15['fax'])){ut[_0x3c7c('0x4e')](_0x3c7c('0x75'),JSON[_0x3c7c('0x44')](_0x2cbe15));return{'isValid':![],'message':_0x3c7c('0x76')};}if(_[_0x3c7c('0x6c')](_0x2cbe15[_0x3c7c('0x5')])){ut['logger'](_0x3c7c('0x77'),JSON[_0x3c7c('0x44')](_0x2cbe15));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x3c7c('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index da41b8e..47d131a 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 _0x082b=['catch','[Notify]\x20','../../../config/logger','lodash','../rpc/faxAccount','error','inspect','resolve','notify'];(function(_0x772275,_0x5de4e8){var _0x1c49a6=function(_0x4caaff){while(--_0x4caaff){_0x772275['push'](_0x772275['shift']());}};_0x1c49a6(++_0x5de4e8);}(_0x082b,0xe3));var _0xb082=function(_0x40388c,_0xd1439b){_0x40388c=_0x40388c-0x0;var _0x403883=_0x082b[_0x40388c];return _0x403883;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0xb082('0x0'))('preview');var _=require(_0xb082('0x1'));var faxAccount=require(_0xb082('0x2'));function loggerCatch(_0x36b508){return function(_0x1252d3){logger[_0xb082('0x3')](_0x36b508,util[_0xb082('0x4')](_0x1252d3,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x40de62,_0x21d396){return BPromise[_0xb082('0x5')]()['then'](faxAccount[_0xb082('0x6')](_0x40de62,_0x21d396))[_0xb082('0x7')](loggerCatch(_0xb082('0x8')));}; \ No newline at end of file +var _0x8156=['catch','[Notify]\x20','util','../../../config/logger','preview','../rpc/faxAccount','notify'];(function(_0x442888,_0x366e1f){var _0x21adb1=function(_0x144def){while(--_0x144def){_0x442888['push'](_0x442888['shift']());}};_0x21adb1(++_0x366e1f);}(_0x8156,0x1d0));var _0x6815=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8156[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0x6815('0x0'));var BPromise=require('bluebird');var logger=require(_0x6815('0x1'))(_0x6815('0x2'));var _=require('lodash');var faxAccount=require(_0x6815('0x3'));function loggerCatch(_0x5a2abf){return function(_0x845dff){logger['error'](_0x5a2abf,util['inspect'](_0x845dff,{'showHidden':![],'depth':null}));};}exports[_0x6815('0x4')]=function(_0x3b8567,_0x275ef1){return BPromise['resolve']()['then'](faxAccount[_0x6815('0x4')](_0x3b8567,_0x275ef1))[_0x6815('0x5')](loggerCatch(_0x6815('0x6')));}; \ 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 4d77eef..9c704c2 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 _0x2e30=['bluebird','exec','execute','info','Exec\x20gs','inspect','../../../../config/logger','fax'];(function(_0x6dd5c,_0x4bfc19){var _0x5a87fa=function(_0x3b068b){while(--_0x3b068b){_0x6dd5c['push'](_0x6dd5c['shift']());}};_0x5a87fa(++_0x4bfc19);}(_0x2e30,0x66));var _0x02e3=function(_0xfade56,_0x2c2bbf){_0xfade56=_0xfade56-0x0;var _0x3a0f80=_0x2e30[_0xfade56];return _0x3a0f80;};'use strict';var util=require('util');var logger=require(_0x02e3('0x0'))(_0x02e3('0x1'));var BPromise=require(_0x02e3('0x2'));var exec=require('child_process')[_0x02e3('0x3')];exports[_0x02e3('0x4')]=function(_0x5a8ea7){return new BPromise(function(_0x1e5bde,_0x558cb1){exec(_0x5a8ea7,function(_0x555e02,_0x34538a,_0x4f6718){logger['info']('Exec\x20gs',_0x34538a);if(_0x555e02){logger[_0x02e3('0x5')](_0x02e3('0x6'),'\x20Error\x20:',util[_0x02e3('0x7')](_0x555e02,{'showHidden':![],'depth':null}),_0x34538a,_0x4f6718);_0x558cb1(_0x555e02);}_0x1e5bde(_0x34538a);});});}; \ No newline at end of file +var _0x5c2d=['\x20Error\x20:','inspect','fax','child_process','exec','info','Exec\x20gs'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5c2d,0x1e5));var _0xd5c2=function(_0xf3b019,_0x33d92a){_0xf3b019=_0xf3b019-0x0;var _0x3eb2e9=_0x5c2d[_0xf3b019];return _0x3eb2e9;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xd5c2('0x0'));var BPromise=require('bluebird');var exec=require(_0xd5c2('0x1'))[_0xd5c2('0x2')];exports['execute']=function(_0x57ed74){return new BPromise(function(_0xae6a97,_0x542247){exec(_0x57ed74,function(_0x1e8755,_0x97a41c,_0x463715){logger[_0xd5c2('0x3')](_0xd5c2('0x4'),_0x97a41c);if(_0x1e8755){logger['info'](_0xd5c2('0x4'),_0xd5c2('0x5'),util[_0xd5c2('0x6')](_0x1e8755,{'showHidden':![],'depth':null}),_0x97a41c,_0x463715);_0x542247(_0x1e8755);}_0xae6a97(_0x97a41c);});});}; \ 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 36530b7..f1c543f 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 _0x0c30=['faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','from-sip','\x22%s\x22\x20<%s>','headerinfo','lodash','moment','message','inspect','addVariables','ecm','minrate','format','\x22%s\x22','modem','gateway'];(function(_0x452630,_0x1c0fc4){var _0x31ebec=function(_0x18cb48){while(--_0x18cb48){_0x452630['push'](_0x452630['shift']());}};_0x31ebec(++_0x1c0fc4);}(_0x0c30,0xd1));var _0x00c3=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x0c30[_0x4c12ec];return _0x3ae42c;};'use strict';var util=require('util');var _=require(_0x00c3('0x0'));var moment=require(_0x00c3('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x00c3('0x2')]=function(_0x3b8a2a){return{'message':_0x3b8a2a};};exports['logger']=function(_0x396584,_0x3f22ea){logger['info'](_0x396584,util[_0x00c3('0x3')](_0x3f22ea,{'showHidden':![],'depth':null}));};exports[_0x00c3('0x4')]=function(_0x1bbaa7,_0x3d3ab6){var _0x17047b={'XMF-ECM':_0x3d3ab6[_0x00c3('0x5')],'XMF-HEADERINFO':_0x3d3ab6['headerinfo'],'XMF-MINRATE':_0x3d3ab6[_0x00c3('0x6')],'XMF-MAXRATE':_0x3d3ab6['maxrate'],'XMF-MODEM':util[_0x00c3('0x7')](_0x00c3('0x8'),_0x3d3ab6[_0x00c3('0x9')]),'XMF-GATEWAY':_0x3d3ab6[_0x00c3('0xa')],'XMF-FAXDETECT':_0x3d3ab6[_0x00c3('0xb')],'XMF-T38TIMEOUT':_0x3d3ab6[_0x00c3('0xc')],'XMF-LOCALSTATIONID':_0x3d3ab6[_0x00c3('0xd')],'XMF-PATH':_0x1bbaa7['path']};return _0x17047b;};exports[_0x00c3('0xe')]=function(_0x231692,_0x3ed01f){return{'actionid':_0x231692[_0x00c3('0xf')],'action':_0x00c3('0x10'),'channel':_0x231692['channel'],'Exten':'xcally-motion-fax','Context':_0x00c3('0x11'),'Priority':'1','callerid':util[_0x00c3('0x7')](_0x00c3('0x12'),_0x231692[_0x00c3('0x13')]?_0x231692[_0x00c3('0x13')]:'',_0x231692['localstationid']),'variable':_0x3ed01f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x231692[_0x00c3('0xf')]};}; \ No newline at end of file +var _0x27e4=['localstationid','util','lodash','../../../../config/logger','fax','message','logger','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','faxdetect','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>'];(function(_0x3e41a9,_0x17c9e6){var _0x2ccdbf=function(_0x480772){while(--_0x480772){_0x3e41a9['push'](_0x3e41a9['shift']());}};_0x2ccdbf(++_0x17c9e6);}(_0x27e4,0x166));var _0x427e=function(_0x2188fe,_0x52afaa){_0x2188fe=_0x2188fe-0x0;var _0x52bf6a=_0x27e4[_0x2188fe];return _0x52bf6a;};'use strict';var util=require(_0x427e('0x0'));var _=require(_0x427e('0x1'));var moment=require('moment');var logger=require(_0x427e('0x2'))(_0x427e('0x3'));exports[_0x427e('0x4')]=function(_0x1daea4){return{'message':_0x1daea4};};exports[_0x427e('0x5')]=function(_0x664d6c,_0x2459a2){logger['info'](_0x664d6c,util[_0x427e('0x6')](_0x2459a2,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x1e54e1,_0x18cc69){var _0x49f260={'XMF-ECM':_0x18cc69[_0x427e('0x7')],'XMF-HEADERINFO':_0x18cc69[_0x427e('0x8')],'XMF-MINRATE':_0x18cc69[_0x427e('0x9')],'XMF-MAXRATE':_0x18cc69[_0x427e('0xa')],'XMF-MODEM':util[_0x427e('0xb')](_0x427e('0xc'),_0x18cc69['modem']),'XMF-GATEWAY':_0x18cc69['gateway'],'XMF-FAXDETECT':_0x18cc69[_0x427e('0xd')],'XMF-T38TIMEOUT':_0x18cc69['t38timeout'],'XMF-LOCALSTATIONID':_0x18cc69['localstationid'],'XMF-PATH':_0x1e54e1['path']};return _0x49f260;};exports['variablesAction']=function(_0x1a5f19,_0x5d6e03){return{'actionid':_0x1a5f19[_0x427e('0xe')],'action':_0x427e('0xf'),'channel':_0x1a5f19[_0x427e('0x10')],'Exten':_0x427e('0x11'),'Context':_0x427e('0x12'),'Priority':'1','callerid':util[_0x427e('0xb')](_0x427e('0x13'),_0x1a5f19[_0x427e('0x8')]?_0x1a5f19['headerinfo']:'',_0x1a5f19[_0x427e('0x14')]),'variable':_0x5d6e03,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1a5f19[_0x427e('0xe')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 5c7bac8..f8be9a1 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 _0xf551=['initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts'];(function(_0x4ba6be,_0x4ab800){var _0x57a0e6=function(_0xb6e233){while(--_0xb6e233){_0x4ba6be['push'](_0x4ba6be['shift']());}};_0x57a0e6(++_0x4ab800);}(_0xf551,0xcd));var _0x1f55=function(_0x371ef0,_0x48a567){_0x371ef0=_0x371ef0-0x0;var _0x4a9ad0=_0xf551[_0x371ef0];return _0x4a9ad0;};'use strict';var BPromise=require(_0x1f55('0x0'));var util=require(_0x1f55('0x1'));var moment=require(_0x1f55('0x2'));var server=require(_0x1f55('0x3'));var Realtime=require('./realtime');var Report=require('./report');var Acw=require(_0x1f55('0x4'));var Trigger=require(_0x1f55('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x1f55('0x6'));var user=require(_0x1f55('0x7'));var voiceQueue=require(_0x1f55('0x8'));var voiceQueueReport=require(_0x1f55('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x1f55('0xa'));var trigger=require(_0x1f55('0xb'));var template=require(_0x1f55('0xc'));var cmHopperHistory=require(_0x1f55('0xd'));var campaign=require(_0x1f55('0xe'));var voiceExtension=require(_0x1f55('0xf'));var faxAccount=require(_0x1f55('0x10'));var zendesk=require(_0x1f55('0x11'));var salesforce=require(_0x1f55('0x12'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x1f55('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x1f55('0x14'));var dynamics365=require(_0x1f55('0x15'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1f55('0x16')](_0x1f55('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1f55('0x16')](_0x1f55('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1f55('0x18')]()[_0x1f55('0x19')](user[_0x1f55('0x1a')]())['then'](realtime[_0x1f55('0x1b')]())[_0x1f55('0x19')](user[_0x1f55('0x1c')]())[_0x1f55('0x19')](realtime['initTelephones']())[_0x1f55('0x19')](trunk['getTrunks']())[_0x1f55('0x19')](realtime[_0x1f55('0x1d')]())[_0x1f55('0x19')](voiceQueue[_0x1f55('0x1e')]())[_0x1f55('0x19')](realtime[_0x1f55('0x1f')]())['then'](trigger[_0x1f55('0x20')]())[_0x1f55('0x19')](realtime[_0x1f55('0x21')]())[_0x1f55('0x19')](template[_0x1f55('0x22')]())[_0x1f55('0x19')](realtime[_0x1f55('0x23')]())[_0x1f55('0x19')](zendesk['getZendeskAccounts']())['then'](realtime[_0x1f55('0x24')]())['then'](salesforce[_0x1f55('0x25')]())[_0x1f55('0x19')](realtime[_0x1f55('0x26')]())[_0x1f55('0x19')](sugarcrm[_0x1f55('0x27')]())[_0x1f55('0x19')](realtime[_0x1f55('0x28')]())[_0x1f55('0x19')](freshdesk[_0x1f55('0x29')]())[_0x1f55('0x19')](realtime[_0x1f55('0x2a')]())[_0x1f55('0x19')](desk[_0x1f55('0x2b')]())['then'](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x1f55('0x19')](realtime[_0x1f55('0x2c')]())[_0x1f55('0x19')](vtiger['getVtigerAccounts']())['then'](realtime[_0x1f55('0x2d')]())[_0x1f55('0x19')](freshsales[_0x1f55('0x2e')]())[_0x1f55('0x19')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x1f55('0x2f')]())[_0x1f55('0x19')](realtime[_0x1f55('0x30')]())['then'](dynamics365[_0x1f55('0x31')]())[_0x1f55('0x19')](realtime[_0x1f55('0x32')]())['then'](campaign[_0x1f55('0x33')]())[_0x1f55('0x19')](realtime[_0x1f55('0x34')]())[_0x1f55('0x19')](voiceExtension[_0x1f55('0x35')]())[_0x1f55('0x19')](realtime['initVoiceExtensions']())[_0x1f55('0x19')](faxAccount[_0x1f55('0x36')]())['then'](realtime[_0x1f55('0x37')]())[_0x1f55('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x1f55('0x38')]())[_0x1f55('0x19')](realtime[_0x1f55('0x39')]())[_0x1f55('0x19')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x1f55('0x3a')]())[_0x1f55('0x19')](realtime[_0x1f55('0x3b')]())[_0x1f55('0x19')](voiceCallReport[_0x1f55('0x3c')]())[_0x1f55('0x19')](realtime[_0x1f55('0x3d')]())[_0x1f55('0x19')](function(_0x101cac){})[_0x1f55('0x3e')](function(_0x20ba76){console[_0x1f55('0x3f')](_0x20ba76);});}function main(){return server[_0x1f55('0x40')](realtime,preview,fax)[_0x1f55('0x19')](function(_0x2918a6){return initRealtime();})[_0x1f55('0x19')](function(){return initParams();})[_0x1f55('0x19')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x1f55('0x3e')](function(_0x2552c2){console[_0x1f55('0x3f')](_0x2552c2);});}main(); \ No newline at end of file +var _0x2541=['getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','hour','get','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2541,0xf0));var _0x1254=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2541[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x1254('0x0'));var util=require(_0x1254('0x1'));var moment=require(_0x1254('0x2'));var server=require(_0x1254('0x3'));var Realtime=require('./realtime');var Report=require(_0x1254('0x4'));var Acw=require(_0x1254('0x5'));var Trigger=require(_0x1254('0x6'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x1254('0x7'));var user=require(_0x1254('0x8'));var voiceQueue=require(_0x1254('0x9'));var voiceQueueReport=require(_0x1254('0xa'));var voiceCallReport=require(_0x1254('0xb'));var trunk=require(_0x1254('0xc'));var trigger=require(_0x1254('0xd'));var template=require(_0x1254('0xe'));var cmHopperHistory=require(_0x1254('0xf'));var campaign=require(_0x1254('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x1254('0x11'));var zendesk=require(_0x1254('0x12'));var salesforce=require(_0x1254('0x13'));var sugarcrm=require(_0x1254('0x14'));var freshdesk=require(_0x1254('0x15'));var desk=require(_0x1254('0x16'));var zoho=require(_0x1254('0x17'));var vtiger=require(_0x1254('0x18'));var freshsales=require(_0x1254('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x1254('0x1a'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x1254('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1254('0x1c')](_0x1254('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1254('0x1d')]()[_0x1254('0x1e')](user[_0x1254('0x1f')]())['then'](realtime[_0x1254('0x20')]())[_0x1254('0x1e')](user['getTelephones']())['then'](realtime[_0x1254('0x21')]())['then'](trunk[_0x1254('0x22')]())[_0x1254('0x1e')](realtime[_0x1254('0x23')]())[_0x1254('0x1e')](voiceQueue[_0x1254('0x24')]())[_0x1254('0x1e')](realtime['initVoiceQueues']())[_0x1254('0x1e')](trigger[_0x1254('0x25')]())[_0x1254('0x1e')](realtime[_0x1254('0x26')]())[_0x1254('0x1e')](template[_0x1254('0x27')]())[_0x1254('0x1e')](realtime[_0x1254('0x28')]())[_0x1254('0x1e')](zendesk['getZendeskAccounts']())[_0x1254('0x1e')](realtime['initZendeskAccounts']())[_0x1254('0x1e')](salesforce[_0x1254('0x29')]())[_0x1254('0x1e')](realtime[_0x1254('0x2a')]())[_0x1254('0x1e')](sugarcrm[_0x1254('0x2b')]())[_0x1254('0x1e')](realtime[_0x1254('0x2c')]())[_0x1254('0x1e')](freshdesk[_0x1254('0x2d')]())[_0x1254('0x1e')](realtime[_0x1254('0x2e')]())[_0x1254('0x1e')](desk['getDeskAccounts']())[_0x1254('0x1e')](realtime[_0x1254('0x2f')]())[_0x1254('0x1e')](zoho[_0x1254('0x30')]())[_0x1254('0x1e')](realtime['initZohoAccounts']())[_0x1254('0x1e')](vtiger[_0x1254('0x31')]())[_0x1254('0x1e')](realtime[_0x1254('0x32')]())[_0x1254('0x1e')](freshsales[_0x1254('0x33')]())[_0x1254('0x1e')](realtime[_0x1254('0x34')]())['then'](servicenow[_0x1254('0x35')]())['then'](realtime[_0x1254('0x36')]())[_0x1254('0x1e')](dynamics365[_0x1254('0x37')]())[_0x1254('0x1e')](realtime[_0x1254('0x38')]())[_0x1254('0x1e')](campaign[_0x1254('0x39')]())['then'](realtime[_0x1254('0x3a')]())[_0x1254('0x1e')](voiceExtension[_0x1254('0x3b')]())[_0x1254('0x1e')](realtime[_0x1254('0x3c')]())[_0x1254('0x1e')](faxAccount['getFaxAccounts']())['then'](realtime[_0x1254('0x3d')]())[_0x1254('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x1254('0x3e')]())[_0x1254('0x1e')](realtime[_0x1254('0x3f')]())[_0x1254('0x1e')](cmHopperHistory[_0x1254('0x40')]())['then'](realtime[_0x1254('0x41')]())[_0x1254('0x1e')](cmHopperHistory[_0x1254('0x42')]())[_0x1254('0x1e')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x1254('0x43')]())[_0x1254('0x1e')](realtime[_0x1254('0x44')]())['then'](function(_0x16c23f){})[_0x1254('0x45')](function(_0x1a37a2){console[_0x1254('0x46')](_0x1a37a2);});}function main(){return server[_0x1254('0x47')](realtime,preview,fax)['then'](function(_0x13b7b4){return initRealtime();})[_0x1254('0x1e')](function(){return initParams();})[_0x1254('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x64637){console[_0x1254('0x46')](_0x64637);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 965fd46..0a37091 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(_0x525825,_0x5a8f41){var _0x257da1=function(_0x2cd436){while(--_0x2cd436){_0x525825['push'](_0x525825['shift']());}};_0x257da1(++_0x5a8f41);}(_0xe706,0xa3));var _0x6e70=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0xe706[_0x2e50a2];return _0x47e5de;};'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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x3cd8be,_0x5d605c){var _0x227de0=function(_0x45961e){while(--_0x45961e){_0x3cd8be['push'](_0x3cd8be['shift']());}};_0x227de0(++_0x5d605c);}(_0x70e0,0x17b));var _0x070e=function(_0x101cb6,_0x485fa7){_0x101cb6=_0x101cb6-0x0;var _0x2ffbe8=_0x70e0[_0x101cb6];return _0x2ffbe8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};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 1de2aad..2be96b3 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 _0xc317=['dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency'];(function(_0x5aaaf3,_0x3aab35){var _0x462d76=function(_0x1b44e0){while(--_0x1b44e0){_0x5aaaf3['push'](_0x5aaaf3['shift']());}};_0x462d76(++_0x3aab35);}(_0xc317,0x168));var _0x7c31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc317[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x206ea3){this['id']=_0x206ea3['id']||0x0;this[_0x7c31('0x0')]=_0x206ea3['name']||'';this[_0x7c31('0x1')]=_0x206ea3['type']||_0x7c31('0x2');this['originated']=0x0;this['temp']=0x0;this[_0x7c31('0x3')]=0x0;this[_0x7c31('0x4')]=0x0;this[_0x7c31('0x5')]='';this[_0x7c31('0x6')]=!![];this[_0x7c31('0x7')]=_0x206ea3[_0x7c31('0x7')];this[_0x7c31('0x8')]=_0x206ea3['limitCalls'];this[_0x7c31('0x9')]=_0x206ea3['dialTimezone']||null;this['dialGlobalInterval']=_0x206ea3[_0x7c31('0xa')]?_0x206ea3[_0x7c31('0xa')]:null;this[_0x7c31('0xb')]=_0x206ea3['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x206ea3['dialOriginateCallerIdNumber'];this[_0x7c31('0xc')]=_0x206ea3[_0x7c31('0xc')]||0x1e;this[_0x7c31('0xd')]=_0x206ea3[_0x7c31('0xd')];this[_0x7c31('0xe')]=_0x206ea3[_0x7c31('0xe')];this[_0x7c31('0xf')]=_0x206ea3[_0x7c31('0xf')];this[_0x7c31('0x10')]=_0x206ea3[_0x7c31('0x10')];this[_0x7c31('0x11')]=_0x206ea3[_0x7c31('0x11')];this[_0x7c31('0x12')]=_0x206ea3[_0x7c31('0x12')];this[_0x7c31('0x13')]=_0x206ea3[_0x7c31('0x13')];this['dialNoSuchNumberMaxRetry']=_0x206ea3[_0x7c31('0x14')]||0x3;this[_0x7c31('0x15')]=_0x206ea3[_0x7c31('0x15')]||0x96;this[_0x7c31('0x16')]=_0x206ea3[_0x7c31('0x16')]||0x3;this[_0x7c31('0x17')]=_0x206ea3[_0x7c31('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x206ea3[_0x7c31('0x18')]||0x3;this[_0x7c31('0x19')]=_0x206ea3['dialAbandonedRetryFrequency']||0x96;this[_0x7c31('0x1a')]=_0x206ea3[_0x7c31('0x1a')]||0x3;this[_0x7c31('0x1b')]=_0x206ea3[_0x7c31('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x206ea3[_0x7c31('0x1c')]||0x3;this[_0x7c31('0x1d')]=_0x206ea3['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x206ea3['dialOrderByScheduledAt']||_0x7c31('0x1e');this[_0x7c31('0x1f')]=_0x206ea3[_0x7c31('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x206ea3[_0x7c31('0x20')]||undefined;this['dialCutDigit']=_0x206ea3[_0x7c31('0x21')]||undefined;this[_0x7c31('0x22')]=_0x206ea3[_0x7c31('0x22')]?_0x206ea3[_0x7c31('0x22')]:undefined;this[_0x7c31('0x23')]=_0x206ea3['Trunk']?_0x206ea3[_0x7c31('0x23')]:undefined;this[_0x7c31('0x24')]=_0x206ea3[_0x7c31('0x24')]?_0x206ea3[_0x7c31('0x24')]:undefined;this[_0x7c31('0x25')]=_0x206ea3[_0x7c31('0x25')]?_0x206ea3['SquareProject']:undefined;this['dialQueueProject']=_0x206ea3[_0x7c31('0x25')]?_0x206ea3['SquareProject']['name']:undefined;this[_0x7c31('0x26')]=_0x206ea3[_0x7c31('0x26')]||![];this[_0x7c31('0x27')]=_0x206ea3[_0x7c31('0x27')];this['dialAMDGreeting']=_0x206ea3['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x206ea3[_0x7c31('0x28')];this[_0x7c31('0x29')]=_0x206ea3[_0x7c31('0x29')];this[_0x7c31('0x2a')]=_0x206ea3['dialAMDMinWordLength'];this[_0x7c31('0x2b')]=_0x206ea3[_0x7c31('0x2b')];this[_0x7c31('0x2c')]=_0x206ea3[_0x7c31('0x2c')];this[_0x7c31('0x2d')]=_0x206ea3[_0x7c31('0x2d')];this['dialAMDMaximumWordLength']=_0x206ea3[_0x7c31('0x2e')];}module[_0x7c31('0x2f')]=Campaign; \ No newline at end of file +var _0x2d10=['ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated'];(function(_0x4203df,_0x5af8de){var _0x53321f=function(_0x5c126b){while(--_0x5c126b){_0x4203df['push'](_0x4203df['shift']());}};_0x53321f(++_0x5af8de);}(_0x2d10,0x12e));var _0x02d1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2d10[_0x19950b];return _0x3c6b41;};'use strict';function Campaign(_0x10d6fc){this['id']=_0x10d6fc['id']||0x0;this[_0x02d1('0x0')]=_0x10d6fc[_0x02d1('0x0')]||'';this[_0x02d1('0x1')]=_0x10d6fc['type']||_0x02d1('0x2');this[_0x02d1('0x3')]=0x0;this['temp']=0x0;this[_0x02d1('0x4')]=0x0;this[_0x02d1('0x5')]=0x0;this[_0x02d1('0x6')]='';this[_0x02d1('0x7')]=!![];this[_0x02d1('0x8')]=_0x10d6fc['active'];this[_0x02d1('0x9')]=_0x10d6fc['limitCalls'];this[_0x02d1('0xa')]=_0x10d6fc[_0x02d1('0xa')]||null;this[_0x02d1('0xb')]=_0x10d6fc[_0x02d1('0xb')]?_0x10d6fc['dialGlobalInterval']:null;this[_0x02d1('0xc')]=_0x10d6fc['dialOriginateCallerIdName'];this[_0x02d1('0xd')]=_0x10d6fc[_0x02d1('0xd')];this['dialOriginateTimeout']=_0x10d6fc['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x10d6fc[_0x02d1('0xe')];this[_0x02d1('0xf')]=_0x10d6fc[_0x02d1('0xf')];this[_0x02d1('0x10')]=_0x10d6fc[_0x02d1('0x10')];this['dialBusyRetryFrequency']=_0x10d6fc[_0x02d1('0x11')];this[_0x02d1('0x12')]=_0x10d6fc[_0x02d1('0x12')];this[_0x02d1('0x13')]=_0x10d6fc[_0x02d1('0x13')];this[_0x02d1('0x14')]=_0x10d6fc[_0x02d1('0x14')];this[_0x02d1('0x15')]=_0x10d6fc[_0x02d1('0x15')]||0x3;this[_0x02d1('0x16')]=_0x10d6fc[_0x02d1('0x16')]||0x96;this[_0x02d1('0x17')]=_0x10d6fc[_0x02d1('0x17')]||0x3;this[_0x02d1('0x18')]=_0x10d6fc[_0x02d1('0x18')]||0x96;this[_0x02d1('0x19')]=_0x10d6fc[_0x02d1('0x19')]||0x3;this[_0x02d1('0x1a')]=_0x10d6fc[_0x02d1('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x10d6fc['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x10d6fc[_0x02d1('0x1b')]||0x96;this[_0x02d1('0x1c')]=_0x10d6fc[_0x02d1('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x10d6fc[_0x02d1('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x10d6fc[_0x02d1('0x1e')]||_0x02d1('0x1f');this['dialPrefix']=_0x10d6fc[_0x02d1('0x20')]||undefined;this[_0x02d1('0x21')]=_0x10d6fc[_0x02d1('0x21')]||undefined;this[_0x02d1('0x22')]=_0x10d6fc[_0x02d1('0x22')]||undefined;this[_0x02d1('0x23')]=_0x10d6fc[_0x02d1('0x23')]?_0x10d6fc[_0x02d1('0x23')]:undefined;this['Trunk']=_0x10d6fc[_0x02d1('0x24')]?_0x10d6fc[_0x02d1('0x24')]:undefined;this[_0x02d1('0x25')]=_0x10d6fc['Interval']?_0x10d6fc[_0x02d1('0x25')]:undefined;this[_0x02d1('0x26')]=_0x10d6fc[_0x02d1('0x26')]?_0x10d6fc[_0x02d1('0x26')]:undefined;this[_0x02d1('0x27')]=_0x10d6fc[_0x02d1('0x26')]?_0x10d6fc[_0x02d1('0x26')][_0x02d1('0x0')]:undefined;this['dialAMDActive']=_0x10d6fc[_0x02d1('0x28')]||![];this['dialAMDInitialSilence']=_0x10d6fc[_0x02d1('0x29')];this[_0x02d1('0x2a')]=_0x10d6fc['dialAMDGreeting'];this[_0x02d1('0x2b')]=_0x10d6fc[_0x02d1('0x2b')];this[_0x02d1('0x2c')]=_0x10d6fc[_0x02d1('0x2c')];this[_0x02d1('0x2d')]=_0x10d6fc[_0x02d1('0x2d')];this[_0x02d1('0x2e')]=_0x10d6fc[_0x02d1('0x2e')];this[_0x02d1('0x2f')]=_0x10d6fc['dialAMDMaximumNumberOfWords'];this[_0x02d1('0x30')]=_0x10d6fc[_0x02d1('0x30')];this[_0x02d1('0x31')]=_0x10d6fc['dialAMDMaximumWordLength'];}module[_0x02d1('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 9c1a8d9..1628628 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 _0xd93e=['answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','linkedid'];(function(_0x1b1b75,_0x2a54f1){var _0x22e581=function(_0x184631){while(--_0x184631){_0x1b1b75['push'](_0x1b1b75['shift']());}};_0x22e581(++_0x2a54f1);}(_0xd93e,0x1d7));var _0xed93=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xd93e[_0x5c2e3e];return _0x53f64a;};'use strict';function Channel(){this[_0xed93('0x0')]=null;this[_0xed93('0x1')]='';this[_0xed93('0x2')]='';this['calleridnum']=0x0;this[_0xed93('0x3')]='';this[_0xed93('0x4')]=undefined;this[_0xed93('0x5')]=undefined;this[_0xed93('0x6')]=0x0;this[_0xed93('0x7')]='';this['uniqueid']=0x0;this[_0xed93('0x8')]=0x0;this['exten']=0x0;this[_0xed93('0x9')]=![];this[_0xed93('0xa')]=null;this[_0xed93('0xb')]=null;this[_0xed93('0xc')]=![];this[_0xed93('0xd')]=![];this[_0xed93('0xe')]='';this[_0xed93('0xf')]='';this[_0xed93('0x10')]=0x0;this[_0xed93('0x11')]=0x0;this[_0xed93('0x12')]=0x0;this[_0xed93('0x13')]=null;this[_0xed93('0x14')]=null;this[_0xed93('0x15')]=null;this['monitor']=![];this[_0xed93('0x16')]=null;this[_0xed93('0x17')]=null;this[_0xed93('0x18')]=[];this[_0xed93('0x19')]=undefined;this[_0xed93('0x1a')]=undefined;this[_0xed93('0x1b')]=undefined;this[_0xed93('0x1c')]=0x0;}module[_0xed93('0x1d')]=Channel; \ No newline at end of file +var _0x8066=['disposition','monitor','monitorFilename','monitors','transfercalleridnum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','context','linkedid','exten','answered','answertime','abandoned','lastapplication','lastdata','billableseconds','holdtime','tag'];(function(_0x36aca3,_0x14251a){var _0x323f94=function(_0x36acb5){while(--_0x36acb5){_0x36aca3['push'](_0x36aca3['shift']());}};_0x323f94(++_0x14251a);}(_0x8066,0x192));var _0x6806=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x8066[_0x3740fe];return _0x55492b;};'use strict';function Channel(){this[_0x6806('0x0')]=null;this[_0x6806('0x1')]='';this[_0x6806('0x2')]='';this[_0x6806('0x3')]=0x0;this[_0x6806('0x4')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x6806('0x5')]='';this['uniqueid']=0x0;this[_0x6806('0x6')]=0x0;this[_0x6806('0x7')]=0x0;this[_0x6806('0x8')]=![];this[_0x6806('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this[_0x6806('0xa')]=![];this[_0x6806('0xb')]='';this[_0x6806('0xc')]='';this['duration']=0x0;this[_0x6806('0xd')]=0x0;this[_0x6806('0xe')]=0x0;this['type']=null;this[_0x6806('0xf')]=null;this[_0x6806('0x10')]=null;this[_0x6806('0x11')]=![];this[_0x6806('0x12')]=null;this['queue']=null;this[_0x6806('0x13')]=[];this[_0x6806('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x6806('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 70a552b..ad097ef 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 _0xd374=['consumerSecret','token','tokenSecret','type','serverUrl','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x401fe6,_0x41fb95){var _0x3258af=function(_0x18fcbb){while(--_0x18fcbb){_0x401fe6['push'](_0x401fe6['shift']());}};_0x3258af(++_0x41fb95);}(_0xd374,0xd2));var _0x4d37=function(_0x56d824,_0x58d13e){_0x56d824=_0x56d824-0x0;var _0x2a8138=_0xd374[_0x56d824];return _0x2a8138;};'use strict';function DeskAccount(_0x508dd6){this['id']=_0x508dd6['id']||0x0;this[_0x4d37('0x0')]=_0x508dd6['name']||'';this[_0x4d37('0x1')]=_0x508dd6['username']||'';this[_0x4d37('0x2')]=_0x508dd6[_0x4d37('0x2')]||'';this[_0x4d37('0x3')]=_0x508dd6['authType']||'';this[_0x4d37('0x4')]=_0x508dd6[_0x4d37('0x4')]||'';this[_0x4d37('0x5')]=_0x508dd6[_0x4d37('0x5')]||'';this[_0x4d37('0x6')]=_0x508dd6[_0x4d37('0x6')]||'';this[_0x4d37('0x7')]=_0x508dd6[_0x4d37('0x7')]||'';this[_0x4d37('0x8')]=_0x508dd6[_0x4d37('0x8')]||'';this[_0x4d37('0x9')]=_0x508dd6['type']||'';this[_0x4d37('0xa')]=_0x508dd6[_0x4d37('0xa')]||'';this['Configurations']=_0x508dd6['Configurations']||{};}module[_0x4d37('0xb')]=DeskAccount; \ No newline at end of file +var _0x542e=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x1195ba,_0x126582){var _0x258d5c=function(_0x7611e5){while(--_0x7611e5){_0x1195ba['push'](_0x1195ba['shift']());}};_0x258d5c(++_0x126582);}(_0x542e,0x6e));var _0xe542=function(_0x288ffa,_0x527c53){_0x288ffa=_0x288ffa-0x0;var _0xf1b90=_0x542e[_0x288ffa];return _0xf1b90;};'use strict';function DeskAccount(_0x60c05e){this['id']=_0x60c05e['id']||0x0;this['name']=_0x60c05e[_0xe542('0x0')]||'';this[_0xe542('0x1')]=_0x60c05e[_0xe542('0x1')]||'';this['remoteUri']=_0x60c05e[_0xe542('0x2')]||'';this['authType']=_0x60c05e[_0xe542('0x3')]||'';this[_0xe542('0x4')]=_0x60c05e[_0xe542('0x4')]||'';this[_0xe542('0x5')]=_0x60c05e['consumerKey']||'';this[_0xe542('0x6')]=_0x60c05e[_0xe542('0x6')]||'';this['token']=_0x60c05e[_0xe542('0x7')]||'';this[_0xe542('0x8')]=_0x60c05e['tokenSecret']||'';this[_0xe542('0x9')]=_0x60c05e[_0xe542('0x9')]||'';this[_0xe542('0xa')]=_0x60c05e['serverUrl']||'';this[_0xe542('0xb')]=_0x60c05e[_0xe542('0xb')]||{};}module[_0xe542('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 11a4499..c101f2b 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 _0x34b7=['Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x34b7,0x196));var _0x734b=function(_0x29f476,_0x2db883){_0x29f476=_0x29f476-0x0;var _0x18ded1=_0x34b7[_0x29f476];return _0x18ded1;};'use strict';function Dynamics365Account(_0x3573c4){this['id']=_0x3573c4['id']||0x0;this['name']=_0x3573c4[_0x734b('0x0')]||'';this[_0x734b('0x1')]=_0x3573c4[_0x734b('0x1')]||'';this[_0x734b('0x2')]=_0x3573c4[_0x734b('0x2')]||'';this[_0x734b('0x3')]=_0x3573c4['remoteUri']||'';this['tenantId']=_0x3573c4[_0x734b('0x4')]||'';this[_0x734b('0x5')]=_0x3573c4[_0x734b('0x5')]||'';this[_0x734b('0x6')]=_0x3573c4[_0x734b('0x6')]||{};this[_0x734b('0x7')]=_0x3573c4['serverUrl']||'';this[_0x734b('0x8')]=_0x3573c4[_0x734b('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x91a7=['exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations'];(function(_0x22cf47,_0x1b5d60){var _0x5bb75a=function(_0x334b59){while(--_0x334b59){_0x22cf47['push'](_0x22cf47['shift']());}};_0x5bb75a(++_0x1b5d60);}(_0x91a7,0xe7));var _0x791a=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x91a7[_0x1cc961];return _0x471d86;};'use strict';function Dynamics365Account(_0x27c92e){this['id']=_0x27c92e['id']||0x0;this[_0x791a('0x0')]=_0x27c92e[_0x791a('0x0')]||'';this[_0x791a('0x1')]=_0x27c92e['username']||'';this[_0x791a('0x2')]=_0x27c92e['password']||'';this[_0x791a('0x3')]=_0x27c92e['remoteUri']||'';this['tenantId']=_0x27c92e[_0x791a('0x4')]||'';this[_0x791a('0x5')]=_0x27c92e['clientId']||'';this[_0x791a('0x6')]=_0x27c92e['clientSecret']||{};this[_0x791a('0x7')]=_0x27c92e[_0x791a('0x7')]||'';this['Configurations']=_0x27c92e[_0x791a('0x8')]||{};}module[_0x791a('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 26ffc7e..65fa5a1 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 _0x4eec=['maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x4b9a62,_0x528ba3){var _0x45c582=function(_0x596041){while(--_0x596041){_0x4b9a62['push'](_0x4b9a62['shift']());}};_0x45c582(++_0x528ba3);}(_0x4eec,0x12b));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';function FaxAccount(_0x320116){this['id']=_0x320116['id']||0x0;this['name']=_0x320116[_0xc4ee('0x0')]||'';this['description']=_0x320116[_0xc4ee('0x1')];this[_0xc4ee('0x2')]=_0x320116[_0xc4ee('0x2')];this['headerinfo']=_0x320116[_0xc4ee('0x3')];this[_0xc4ee('0x4')]=_0x320116['localstationid'];this['minrate']=_0x320116['minrate']||0x960;this[_0xc4ee('0x5')]=_0x320116[_0xc4ee('0x5')]||0x3840;this['modem']=_0x320116['modem']||_0xc4ee('0x6');this[_0xc4ee('0x7')]=_0x320116[_0xc4ee('0x7')]||'no';this[_0xc4ee('0x8')]=_0x320116[_0xc4ee('0x8')]||'no';this['t38timeout']=_0x320116[_0xc4ee('0x9')]||0x1388;this['tech']=_0x320116[_0xc4ee('0xa')]||_0xc4ee('0xb');this['Trunk']=_0x320116['Trunk']?_0x320116[_0xc4ee('0xc')]:undefined;this[_0xc4ee('0xd')]=_0x320116[_0xc4ee('0xd')];this[_0xc4ee('0xe')]=_0x320116[_0xc4ee('0xe')];}module[_0xc4ee('0xf')]=FaxAccount; \ No newline at end of file +var _0xc80b=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc80b,0x128));var _0xbc80=function(_0x309baf,_0x5af54d){_0x309baf=_0x309baf-0x0;var _0x57b777=_0xc80b[_0x309baf];return _0x57b777;};'use strict';function FaxAccount(_0x31dbe0){this['id']=_0x31dbe0['id']||0x0;this['name']=_0x31dbe0[_0xbc80('0x0')]||'';this[_0xbc80('0x1')]=_0x31dbe0[_0xbc80('0x1')];this[_0xbc80('0x2')]=_0x31dbe0[_0xbc80('0x2')];this['headerinfo']=_0x31dbe0[_0xbc80('0x3')];this[_0xbc80('0x4')]=_0x31dbe0[_0xbc80('0x4')];this[_0xbc80('0x5')]=_0x31dbe0[_0xbc80('0x5')]||0x960;this[_0xbc80('0x6')]=_0x31dbe0[_0xbc80('0x6')]||0x3840;this['modem']=_0x31dbe0['modem']||_0xbc80('0x7');this[_0xbc80('0x8')]=_0x31dbe0[_0xbc80('0x8')]||'no';this[_0xbc80('0x9')]=_0x31dbe0[_0xbc80('0x9')]||'no';this[_0xbc80('0xa')]=_0x31dbe0['t38timeout']||0x1388;this[_0xbc80('0xb')]=_0x31dbe0['tech']||_0xbc80('0xc');this['Trunk']=_0x31dbe0[_0xbc80('0xd')]?_0x31dbe0[_0xbc80('0xd')]:undefined;this[_0xbc80('0xe')]=_0x31dbe0[_0xbc80('0xe')];this['key']=_0x31dbe0[_0xbc80('0xf')];}module[_0xbc80('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 1ad4eaa..6508127 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 _0xb0ec=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x1d252e,_0x5ec134){var _0x27f222=function(_0x33e002){while(--_0x33e002){_0x1d252e['push'](_0x1d252e['shift']());}};_0x27f222(++_0x5ec134);}(_0xb0ec,0x114));var _0xcb0e=function(_0x5c6346,_0x89a950){_0x5c6346=_0x5c6346-0x0;var _0x3cd582=_0xb0ec[_0x5c6346];return _0x3cd582;};'use strict';function FreshdeskAccount(_0x2b3e3c){this['id']=_0x2b3e3c['id']||0x0;this['name']=_0x2b3e3c[_0xcb0e('0x0')]||'';this[_0xcb0e('0x1')]=_0x2b3e3c['username']||'';this[_0xcb0e('0x2')]=_0x2b3e3c['token']||'';this['remoteUri']=_0x2b3e3c[_0xcb0e('0x3')]||'';this[_0xcb0e('0x4')]=_0x2b3e3c[_0xcb0e('0x4')]||'';this[_0xcb0e('0x5')]=_0x2b3e3c[_0xcb0e('0x5')]||{};}module[_0xcb0e('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x5406=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5406,0x1e4));var _0x6540=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x5406[_0x52e363];return _0x3fc2b5;};'use strict';function FreshdeskAccount(_0x20bdb3){this['id']=_0x20bdb3['id']||0x0;this[_0x6540('0x0')]=_0x20bdb3[_0x6540('0x0')]||'';this[_0x6540('0x1')]=_0x20bdb3[_0x6540('0x1')]||'';this[_0x6540('0x2')]=_0x20bdb3[_0x6540('0x3')]||'';this[_0x6540('0x4')]=_0x20bdb3[_0x6540('0x4')]||'';this[_0x6540('0x5')]=_0x20bdb3[_0x6540('0x5')]||'';this['Configurations']=_0x20bdb3[_0x6540('0x6')]||{};}module[_0x6540('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 081afbc..c8b9c97 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 _0x5900=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x12ca16,_0x281fd9){var _0x56fb78=function(_0x3479b2){while(--_0x3479b2){_0x12ca16['push'](_0x12ca16['shift']());}};_0x56fb78(++_0x281fd9);}(_0x5900,0xd2));var _0x0590=function(_0x578062,_0x2858e9){_0x578062=_0x578062-0x0;var _0x2ba7f5=_0x5900[_0x578062];return _0x2ba7f5;};'use strict';function FreshsalesAccount(_0x28f652){this['id']=_0x28f652['id']||0x0;this[_0x0590('0x0')]=_0x28f652[_0x0590('0x0')]||'';this['username']=_0x28f652[_0x0590('0x1')]||'';this[_0x0590('0x2')]=_0x28f652[_0x0590('0x3')]||'';this['remoteUri']=_0x28f652[_0x0590('0x4')]||'';this[_0x0590('0x5')]=_0x28f652['serverUrl']||'';this[_0x0590('0x6')]=_0x28f652[_0x0590('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xf435=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x3b189d,_0x1c25e0){var _0x382792=function(_0x107d2b){while(--_0x107d2b){_0x3b189d['push'](_0x3b189d['shift']());}};_0x382792(++_0x1c25e0);}(_0xf435,0x174));var _0x5f43=function(_0x30926b,_0x1c08b7){_0x30926b=_0x30926b-0x0;var _0x3dede1=_0xf435[_0x30926b];return _0x3dede1;};'use strict';function FreshsalesAccount(_0x4c68b9){this['id']=_0x4c68b9['id']||0x0;this[_0x5f43('0x0')]=_0x4c68b9[_0x5f43('0x0')]||'';this[_0x5f43('0x1')]=_0x4c68b9[_0x5f43('0x1')]||'';this[_0x5f43('0x2')]=_0x4c68b9['token']||'';this[_0x5f43('0x3')]=_0x4c68b9[_0x5f43('0x3')]||'';this[_0x5f43('0x4')]=_0x4c68b9[_0x5f43('0x4')]||'';this['Configurations']=_0x4c68b9[_0x5f43('0x5')]||{};}module[_0x5f43('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 55dd4a9..22bdfe9 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 _0x88ff=['queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','queue'];(function(_0x326974,_0x4444ca){var _0xf331c2=function(_0x2c1585){while(--_0x2c1585){_0x326974['push'](_0x326974['shift']());}};_0xf331c2(++_0x4444ca);}(_0x88ff,0xf5));var _0xf88f=function(_0x37cc20,_0x21a2d2){_0x37cc20=_0x37cc20-0x0;var _0x46975c=_0x88ff[_0x37cc20];return _0x46975c;};'use strict';function QueueReport(){this[_0xf88f('0x0')]=_0xf88f('0x1');this[_0xf88f('0x2')]='';this[_0xf88f('0x3')]='';this['calleridname']='';this[_0xf88f('0x4')]='';this[_0xf88f('0x5')]=null;this[_0xf88f('0x6')]=null;this[_0xf88f('0x7')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0xf88f('0x8')]=null;this[_0xf88f('0x9')]=![];this[_0xf88f('0xa')]=null;this[_0xf88f('0xb')]=![];this['queuecallerexitAt']=null;this[_0xf88f('0xc')]=0x1;this['channel']='';this[_0xf88f('0xd')]='';this[_0xf88f('0xe')]='';this[_0xf88f('0xf')]='';this[_0xf88f('0x10')]='';this[_0xf88f('0x11')]='';this[_0xf88f('0x12')]='';this['holdtime']=0x0;this[_0xf88f('0x13')]=![];this[_0xf88f('0x14')]='';this[_0xf88f('0x15')]=_0xf88f('0x16');this[_0xf88f('0x17')]=0x0;this[_0xf88f('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xee85=['channel','connectedlinenum','accountcode','context','exten','priority','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xee85,0x141));var _0x5ee8=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0xee85[_0x1aeda2];return _0x32dc6d;};'use strict';function QueueReport(){this[_0x5ee8('0x0')]=_0x5ee8('0x1');this[_0x5ee8('0x2')]='';this[_0x5ee8('0x3')]='';this[_0x5ee8('0x4')]='';this[_0x5ee8('0x5')]='';this[_0x5ee8('0x6')]=null;this[_0x5ee8('0x7')]=null;this[_0x5ee8('0x8')]=0x1;this[_0x5ee8('0x9')]=0x1;this[_0x5ee8('0xa')]=![];this['queuecallerabandonAt']=null;this[_0x5ee8('0xb')]=![];this[_0x5ee8('0xc')]=null;this['queuecallerexit']=![];this[_0x5ee8('0xd')]=null;this[_0x5ee8('0xe')]=0x1;this[_0x5ee8('0xf')]='';this[_0x5ee8('0x10')]='';this['connectedlinename']='';this[_0x5ee8('0x11')]='';this[_0x5ee8('0x12')]='';this[_0x5ee8('0x13')]='';this[_0x5ee8('0x14')]='';this['holdtime']=0x0;this[_0x5ee8('0x15')]=![];this[_0x5ee8('0x16')]='';this[_0x5ee8('0x17')]=_0x5ee8('0x18');this[_0x5ee8('0x19')]=0x0;this[_0x5ee8('0x1a')]={};}module[_0x5ee8('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 493b07e..c8cf548 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 _0xfb9f=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0xe56790,_0x5f304d){var _0x145cf7=function(_0x49aeb1){while(--_0x49aeb1){_0xe56790['push'](_0xe56790['shift']());}};_0x145cf7(++_0x5f304d);}(_0xfb9f,0x8c));var _0xffb9=function(_0xfaf4ff,_0x462a7a){_0xfaf4ff=_0xfaf4ff-0x0;var _0x11c18f=_0xfb9f[_0xfaf4ff];return _0x11c18f;};'use strict';function SalesforceAccount(_0x4bdf5c){this['id']=_0x4bdf5c['id']||0x0;this[_0xffb9('0x0')]=_0x4bdf5c[_0xffb9('0x0')]||'';this[_0xffb9('0x1')]=_0x4bdf5c[_0xffb9('0x1')]||'';this[_0xffb9('0x2')]=_0x4bdf5c[_0xffb9('0x2')]||'';this[_0xffb9('0x3')]=_0x4bdf5c[_0xffb9('0x3')]||'';this[_0xffb9('0x4')]=_0x4bdf5c['clientId']||'';this[_0xffb9('0x5')]=_0x4bdf5c[_0xffb9('0x5')]||'';this[_0xffb9('0x6')]=_0x4bdf5c[_0xffb9('0x6')]||'';this['type']=_0x4bdf5c[_0xffb9('0x7')]||_0xffb9('0x8');this[_0xffb9('0x9')]=_0x4bdf5c['serverUrl']||'';this[_0xffb9('0xa')]=_0x4bdf5c[_0xffb9('0xa')]||{};}module[_0xffb9('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xbd15=['serverUrl','Configurations','exports','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x31c1af,_0x9b2f41){var _0x333544=function(_0x4d805d){while(--_0x4d805d){_0x31c1af['push'](_0x31c1af['shift']());}};_0x333544(++_0x9b2f41);}(_0xbd15,0x179));var _0x5bd1=function(_0x28b072,_0xbf8b6){_0x28b072=_0x28b072-0x0;var _0x39fce7=_0xbd15[_0x28b072];return _0x39fce7;};'use strict';function SalesforceAccount(_0x1788bc){this['id']=_0x1788bc['id']||0x0;this['name']=_0x1788bc['name']||'';this[_0x5bd1('0x0')]=_0x1788bc['username']||'';this[_0x5bd1('0x1')]=_0x1788bc[_0x5bd1('0x1')]||'';this[_0x5bd1('0x2')]=_0x1788bc[_0x5bd1('0x2')]||'';this[_0x5bd1('0x3')]=_0x1788bc[_0x5bd1('0x3')]||'';this[_0x5bd1('0x4')]=_0x1788bc[_0x5bd1('0x4')]||'';this[_0x5bd1('0x5')]=_0x1788bc[_0x5bd1('0x5')]||'';this['type']=_0x1788bc[_0x5bd1('0x6')]||_0x5bd1('0x7');this[_0x5bd1('0x8')]=_0x1788bc['serverUrl']||'';this['Configurations']=_0x1788bc[_0x5bd1('0x9')]||{};}module[_0x5bd1('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4dfa5e6..d4e6c43 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 _0x08b8=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x4942ad,_0x2fd67d){var _0x166df7=function(_0x1fded7){while(--_0x1fded7){_0x4942ad['push'](_0x4942ad['shift']());}};_0x166df7(++_0x2fd67d);}(_0x08b8,0x9e));var _0x808b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x08b8[_0x321bb2];return _0x9c12ed;};'use strict';function ServicenowAccount(_0x231b15){this['id']=_0x231b15['id']||0x0;this[_0x808b('0x0')]=_0x231b15['name']||'';this[_0x808b('0x1')]=_0x231b15['username']||'';this[_0x808b('0x2')]=_0x231b15['password']||'';this[_0x808b('0x3')]=_0x231b15[_0x808b('0x3')]||'';this[_0x808b('0x4')]=_0x231b15[_0x808b('0x4')]||'';this[_0x808b('0x5')]=_0x231b15[_0x808b('0x5')]||{};}module[_0x808b('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xd56c=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x3a44d1,_0x513c39){var _0x1c63dc=function(_0x51f9bc){while(--_0x51f9bc){_0x3a44d1['push'](_0x3a44d1['shift']());}};_0x1c63dc(++_0x513c39);}(_0xd56c,0x105));var _0xcd56=function(_0x4bfd76,_0x4053cd){_0x4bfd76=_0x4bfd76-0x0;var _0x59afbc=_0xd56c[_0x4bfd76];return _0x59afbc;};'use strict';function ServicenowAccount(_0x4b95cf){this['id']=_0x4b95cf['id']||0x0;this['name']=_0x4b95cf[_0xcd56('0x0')]||'';this[_0xcd56('0x1')]=_0x4b95cf[_0xcd56('0x1')]||'';this[_0xcd56('0x2')]=_0x4b95cf[_0xcd56('0x2')]||'';this[_0xcd56('0x3')]=_0x4b95cf['remoteUri']||'';this[_0xcd56('0x4')]=_0x4b95cf['serverUrl']||'';this[_0xcd56('0x5')]=_0x4b95cf[_0xcd56('0x5')]||{};}module[_0xcd56('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index e39ca66..dd69bc5 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 _0xf883=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1dfdd5,_0x2f1efe){var _0x2d106a=function(_0x33f5c5){while(--_0x33f5c5){_0x1dfdd5['push'](_0x1dfdd5['shift']());}};_0x2d106a(++_0x2f1efe);}(_0xf883,0x1c1));var _0x3f88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf883[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x170970){this['id']=_0x170970['id']||0x0;this[_0x3f88('0x0')]=_0x170970[_0x3f88('0x0')]||'';this['username']=_0x170970['username']||'';this[_0x3f88('0x1')]=_0x170970[_0x3f88('0x1')]||'';this['remoteUri']=_0x170970[_0x3f88('0x2')]||'';this[_0x3f88('0x3')]=_0x170970['serverUrl']||'';this[_0x3f88('0x4')]=_0x170970[_0x3f88('0x4')]||{};}module[_0x3f88('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xde15=['Configurations','exports','username','remoteUri','serverUrl'];(function(_0x245d8a,_0x336aaf){var _0x1a91a2=function(_0x458052){while(--_0x458052){_0x245d8a['push'](_0x245d8a['shift']());}};_0x1a91a2(++_0x336aaf);}(_0xde15,0x106));var _0x5de1=function(_0x428aa3,_0x9ce6c1){_0x428aa3=_0x428aa3-0x0;var _0x13461e=_0xde15[_0x428aa3];return _0x13461e;};'use strict';function SugarcrmAccount(_0x2f8e44){this['id']=_0x2f8e44['id']||0x0;this['name']=_0x2f8e44['name']||'';this[_0x5de1('0x0')]=_0x2f8e44['username']||'';this['password']=_0x2f8e44['password']||'';this['remoteUri']=_0x2f8e44[_0x5de1('0x1')]||'';this[_0x5de1('0x2')]=_0x2f8e44['serverUrl']||'';this[_0x5de1('0x3')]=_0x2f8e44[_0x5de1('0x3')]||{};}module[_0x5de1('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 816bfc4..30e9ac7 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 _0xd85c=['state','stateTime','status','address','exports','name','accountcode'];(function(_0x563900,_0x27caa9){var _0x4a656d=function(_0xfd6aa5){while(--_0xfd6aa5){_0x563900['push'](_0x563900['shift']());}};_0x4a656d(++_0x27caa9);}(_0xd85c,0x8a));var _0xcd85=function(_0x11a7c9,_0x2de6e8){_0x11a7c9=_0x11a7c9-0x0;var _0x2bf3d8=_0xd85c[_0x11a7c9];return _0x2bf3d8;};'use strict';function Telephone(_0x3d559d){this['id']=_0x3d559d['id']||0x0;this['name']=_0x3d559d[_0xcd85('0x0')]||'';this['accountcode']=_0x3d559d[_0xcd85('0x1')]||'';this[_0xcd85('0x2')]='unknown';this[_0xcd85('0x3')]=0x0;this[_0xcd85('0x4')]='unknown';this[_0xcd85('0x5')]='';}module[_0xcd85('0x6')]=Telephone; \ No newline at end of file +var _0x26f0=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x2dd6b7,_0x4ccce3){var _0x9c28c1=function(_0x2a3124){while(--_0x2a3124){_0x2dd6b7['push'](_0x2dd6b7['shift']());}};_0x9c28c1(++_0x4ccce3);}(_0x26f0,0xf4));var _0x026f=function(_0x11148b,_0x49e9b0){_0x11148b=_0x11148b-0x0;var _0x168648=_0x26f0[_0x11148b];return _0x168648;};'use strict';function Telephone(_0x5f3409){this['id']=_0x5f3409['id']||0x0;this[_0x026f('0x0')]=_0x5f3409[_0x026f('0x0')]||'';this[_0x026f('0x1')]=_0x5f3409['accountcode']||'';this[_0x026f('0x2')]=_0x026f('0x3');this[_0x026f('0x4')]=0x0;this[_0x026f('0x5')]=_0x026f('0x3');this['address']='';}module[_0x026f('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index eb3f5c6..68cc74c 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(_0x1d940b,_0x5d2c8e){var _0xa3c0b5=function(_0x18b109){while(--_0x18b109){_0x1d940b['push'](_0x1d940b['shift']());}};_0xa3c0b5(++_0x5d2c8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 _0xb10b=['name','html'];(function(_0x5a93cf,_0xf9da86){var _0x1e520e=function(_0x29d4f0){while(--_0x29d4f0){_0x5a93cf['push'](_0x5a93cf['shift']());}};_0x1e520e(++_0xf9da86);}(_0xb10b,0x12a));var _0xbb10=function(_0x4dc8fc,_0x27d9a5){_0x4dc8fc=_0x4dc8fc-0x0;var _0x18d77f=_0xb10b[_0x4dc8fc];return _0x18d77f;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e8887ca..3fe3b6f 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0xa6a371,_0x3d33e1){var _0x581f97=function(_0x10447b){while(--_0x10447b){_0xa6a371['push'](_0xa6a371['shift']());}};_0x581f97(++_0x3d33e1);}(_0x14a0,0x8e));var _0x014a=function(_0x20be6c,_0x544e09){_0x20be6c=_0x20be6c-0x0;var _0x117c8d=_0x14a0[_0x20be6c];return _0x117c8d;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x1d0869,_0x406960){var _0x2f706e=function(_0x2f0563){while(--_0x2f0563){_0x1d0869['push'](_0x1d0869['shift']());}};_0x2f706e(++_0x406960);}(_0x757a,0xde));var _0xa757=function(_0x502fee,_0x571e35){_0x502fee=_0x502fee-0x0;var _0x4d0b02=_0x757a[_0x502fee];return _0x4d0b02;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 9cdfa33..a4de8c0 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 _0x3f22=['domain','stateRegistry','registrationtime','defaultuser','active','name','state','stateTime','status','unknown','registry','split','host','port'];(function(_0x10fb80,_0x4a842c){var _0x2f1939=function(_0x28d15a){while(--_0x28d15a){_0x10fb80['push'](_0x10fb80['shift']());}};_0x2f1939(++_0x4a842c);}(_0x3f22,0x1a8));var _0x23f2=function(_0x405bd8,_0x57afaf){_0x405bd8=_0x405bd8-0x0;var _0xe17de2=_0x3f22[_0x405bd8];return _0xe17de2;};'use strict';function Trunk(_0xa91bf5){this['id']=_0xa91bf5['id']||0x0;this[_0x23f2('0x0')]=_0xa91bf5[_0x23f2('0x0')]||![];this['name']=_0xa91bf5[_0x23f2('0x1')]||'';this[_0x23f2('0x2')]='unknown';this[_0x23f2('0x3')]=0x0;this[_0x23f2('0x4')]=_0x23f2('0x5');this[_0x23f2('0x6')]=_0xa91bf5[_0x23f2('0x6')]&&_0xa91bf5['registry']['indexOf'](':')?_0xa91bf5[_0x23f2('0x6')][_0x23f2('0x7')](':')[0x0]:'';this[_0x23f2('0x8')]='';this[_0x23f2('0x9')]='';this[_0x23f2('0xa')]='';this['domainport']='';this['refresh']='';this[_0x23f2('0xb')]=_0x23f2('0x5');this[_0x23f2('0xc')]='';this['address']='';this[_0x23f2('0xd')]=_0xa91bf5[_0x23f2('0xd')]||'';}module['exports']=Trunk; \ No newline at end of file +var _0xd4da=['unknown','status','registry','indexOf','host','port','domain','domainport','refresh','registrationtime','address','defaultuser'];(function(_0x33e849,_0x2f80dc){var _0x4b3af4=function(_0x52b764){while(--_0x52b764){_0x33e849['push'](_0x33e849['shift']());}};_0x4b3af4(++_0x2f80dc);}(_0xd4da,0x120));var _0xad4d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd4da[_0x2c91e9];return _0x13f0ff;};'use strict';function Trunk(_0x57036c){this['id']=_0x57036c['id']||0x0;this['active']=_0x57036c['active']||![];this['name']=_0x57036c['name']||'';this['state']=_0xad4d('0x0');this['stateTime']=0x0;this[_0xad4d('0x1')]=_0xad4d('0x0');this[_0xad4d('0x2')]=_0x57036c[_0xad4d('0x2')]&&_0x57036c[_0xad4d('0x2')][_0xad4d('0x3')](':')?_0x57036c[_0xad4d('0x2')]['split'](':')[0x0]:'';this[_0xad4d('0x4')]='';this[_0xad4d('0x5')]='';this[_0xad4d('0x6')]='';this[_0xad4d('0x7')]='';this[_0xad4d('0x8')]='';this['stateRegistry']=_0xad4d('0x0');this[_0xad4d('0x9')]='';this[_0xad4d('0xa')]='';this[_0xad4d('0xb')]=_0x57036c['defaultuser']||'';}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 541c30e..5db65b1 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 _0x4940=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x5ac684,_0x370253){var _0x47daaa=function(_0x5c0710){while(--_0x5c0710){_0x5ac684['push'](_0x5ac684['shift']());}};_0x47daaa(++_0x370253);}(_0x4940,0x1ce));var _0x0494=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4940[_0x255d5b];return _0x3e141a;};'use strict';function voiceExtension(_0x33c1d7){this['id']=_0x33c1d7['id']||0x0;this[_0x0494('0x0')]=_0x33c1d7['exten']||'';this[_0x0494('0x1')]=_0x33c1d7[_0x0494('0x1')]||_0x0494('0x2');this[_0x0494('0x3')]=_0x33c1d7[_0x0494('0x3')]||![];}module[_0x0494('0x4')]=voiceExtension; \ No newline at end of file +var _0x6269=['mandatoryDisposition','exports','recordingFormat','none'];(function(_0x669ead,_0x140f58){var _0x5fc7b7=function(_0x644767){while(--_0x644767){_0x669ead['push'](_0x669ead['shift']());}};_0x5fc7b7(++_0x140f58);}(_0x6269,0xbe));var _0x9626=function(_0x4243a0,_0x4178d4){_0x4243a0=_0x4243a0-0x0;var _0x3362f1=_0x6269[_0x4243a0];return _0x3362f1;};'use strict';function voiceExtension(_0x4cf14b){this['id']=_0x4cf14b['id']||0x0;this['exten']=_0x4cf14b['exten']||'';this['recordingFormat']=_0x4cf14b[_0x9626('0x0')]||_0x9626('0x1');this[_0x9626('0x2')]=_0x4cf14b[_0x9626('0x2')]||![];}module[_0x9626('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 7193966..a57586f 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 _0x8ed9=['wav49','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav'];(function(_0x233660,_0x37646d){var _0x740732=function(_0x848e66){while(--_0x848e66){_0x233660['push'](_0x233660['shift']());}};_0x740732(++_0x37646d);}(_0x8ed9,0x16a));var _0x98ed=function(_0xeee8f2,_0x351024){_0xeee8f2=_0xeee8f2-0x0;var _0x16102b=_0x8ed9[_0xeee8f2];return _0x16102b;};'use strict';var statusDesc=[_0x98ed('0x0'),_0x98ed('0x1'),_0x98ed('0x2'),_0x98ed('0x3'),_0x98ed('0x4'),_0x98ed('0x5'),_0x98ed('0x6'),_0x98ed('0x7'),_0x98ed('0x8')];var monitorFormat={'wav':_0x98ed('0x9'),'wav49':_0x98ed('0xa'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0x98ed('0xb')};function VoiceQueue(_0x3d04a4){this['id']=_0x3d04a4['id']||0x0;this[_0x98ed('0xc')]=_0x3d04a4[_0x98ed('0xc')]||'';this[_0x98ed('0xd')]=_0x3d04a4['monitor_format']||'';this[_0x98ed('0xe')]=_0x3d04a4[_0x98ed('0xe')]||_0x98ed('0xf');this[_0x98ed('0x10')]=0x0;this['talking']=0x0;this[_0x98ed('0x11')]=0x0;this[_0x98ed('0x12')]=0x0;this[_0x98ed('0x13')]=0x0;this[_0x98ed('0x14')]=0x0;this[_0x98ed('0x15')]=0x0;this[_0x98ed('0x16')]=0x0;this['abandoned']=0x0;this[_0x98ed('0x17')]=0x0;this['available']=0x0;this[_0x98ed('0x18')]=_0x3d04a4['acw']||![];this[_0x98ed('0x19')]=_0x3d04a4[_0x98ed('0x19')]||0xa;this['autopause']=_0x3d04a4[_0x98ed('0x1a')]||'no';this['sendMessageOneNotActive']=!![];this[_0x98ed('0x1b')]='';this[_0x98ed('0x1c')]=0x0;this[_0x98ed('0x1d')]=0x0;this[_0x98ed('0x1e')]=_0x3d04a4[_0x98ed('0x1e')]||null;this[_0x98ed('0x1f')]=_0x3d04a4['dialGlobalInterval']?_0x3d04a4[_0x98ed('0x1f')]:null;this[_0x98ed('0x20')]=_0x3d04a4[_0x98ed('0x20')];this[_0x98ed('0x21')]=_0x3d04a4['dialMethod']||_0x98ed('0x22');this[_0x98ed('0x23')]=_0x3d04a4[_0x98ed('0x23')]||0x0;this[_0x98ed('0x24')]=_0x3d04a4[_0x98ed('0x24')]||0x0;this[_0x98ed('0x25')]=_0x3d04a4[_0x98ed('0x25')]||0x1;this[_0x98ed('0x26')]=_0x3d04a4[_0x98ed('0x26')]||'dropRate';this[_0x98ed('0x27')]=_0x3d04a4[_0x98ed('0x27')]||0.03;this[_0x98ed('0x28')]=_0x3d04a4[_0x98ed('0x28')]||0x258;this[_0x98ed('0x29')]=_0x3d04a4[_0x98ed('0x29')]||_0x98ed('0x2a');this[_0x98ed('0x2b')]=_0x3d04a4[_0x98ed('0x2b')]||'anonymous';this[_0x98ed('0x2c')]=_0x3d04a4[_0x98ed('0x2c')]||0x1e;this['dialQueueOptions']=_0x3d04a4[_0x98ed('0x2d')]||_0x98ed('0x2e');this['dialQueueTimeout']=_0x3d04a4[_0x98ed('0x2f')]||0x3;this[_0x98ed('0x30')]=_0x3d04a4[_0x98ed('0x30')]||undefined;this[_0x98ed('0x31')]=_0x3d04a4['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x3d04a4['dialCongestionRetryFrequency']||0x96;this[_0x98ed('0x32')]=_0x3d04a4[_0x98ed('0x32')]||0x3;this[_0x98ed('0x33')]=_0x3d04a4[_0x98ed('0x33')]||0x96;this[_0x98ed('0x34')]=_0x3d04a4[_0x98ed('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3d04a4[_0x98ed('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3d04a4[_0x98ed('0x36')]||0x3;this[_0x98ed('0x37')]=_0x3d04a4[_0x98ed('0x37')]||0x96;this[_0x98ed('0x38')]=_0x3d04a4[_0x98ed('0x38')]||0x3;this[_0x98ed('0x39')]=_0x3d04a4[_0x98ed('0x39')]||0x96;this[_0x98ed('0x3a')]=_0x3d04a4[_0x98ed('0x3a')]||0x3;this[_0x98ed('0x3b')]=_0x3d04a4['dialAbandonedRetryFrequency']||0x96;this[_0x98ed('0x3c')]=_0x3d04a4[_0x98ed('0x3c')]||0x3;this['dialMachineRetryFrequency']=_0x3d04a4[_0x98ed('0x3d')]||0x96;this[_0x98ed('0x3e')]=_0x3d04a4['dialAgentRejectMaxRetry']||0x3;this[_0x98ed('0x3f')]=_0x3d04a4[_0x98ed('0x3f')]||0x96;this[_0x98ed('0x40')]=_0x3d04a4[_0x98ed('0x40')]||0x4;this[_0x98ed('0x41')]=_0x3d04a4[_0x98ed('0x41')]?_0x3d04a4[_0x98ed('0x41')]:undefined;this[_0x98ed('0x42')]=_0x3d04a4[_0x98ed('0x42')]?_0x3d04a4[_0x98ed('0x42')]:undefined;this['dialPrefix']=_0x3d04a4['dialPrefix']||undefined;this[_0x98ed('0x43')]=_0x3d04a4[_0x98ed('0x43')]?_0x3d04a4['Interval']:undefined;this[_0x98ed('0x44')]=_0x3d04a4[_0x98ed('0x44')]||_0x98ed('0x45');this['dialRandomLastDigitCallerIdNumber']=_0x3d04a4[_0x98ed('0x46')]||undefined;this[_0x98ed('0x47')]=_0x3d04a4['dialCutDigit']||undefined;this[_0x98ed('0x48')]=strategy[_0x3d04a4['strategy']]||'rrmemory';this['queueStatusComplete']=!![];this[_0x98ed('0x49')]=_0x3d04a4[_0x98ed('0x49')]||![];this['dialAMDInitialSilence']=_0x3d04a4[_0x98ed('0x4a')];this[_0x98ed('0x4b')]=_0x3d04a4[_0x98ed('0x4b')];this[_0x98ed('0x4c')]=_0x3d04a4[_0x98ed('0x4c')];this[_0x98ed('0x4d')]=_0x3d04a4[_0x98ed('0x4d')];this[_0x98ed('0x4e')]=_0x3d04a4[_0x98ed('0x4e')];this[_0x98ed('0x4f')]=_0x3d04a4[_0x98ed('0x4f')];this[_0x98ed('0x50')]=_0x3d04a4[_0x98ed('0x50')];this[_0x98ed('0x51')]=_0x3d04a4[_0x98ed('0x51')];this[_0x98ed('0x52')]=_0x3d04a4[_0x98ed('0x52')];this[_0x98ed('0x53')]=0x0;this[_0x98ed('0x54')]=0x0;this[_0x98ed('0x55')]=_0x3d04a4[_0x98ed('0x55')];this[_0x98ed('0x56')]=0x0;this[_0x98ed('0x57')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x98ed('0x58')]=0x0;this[_0x98ed('0x59')]=0x0;this[_0x98ed('0x5a')]=0x0;this[_0x98ed('0x5b')]=0x0;this[_0x98ed('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x98ed('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x98ed('0x5e')]=0x0;this[_0x98ed('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x98ed('0x60')]=undefined;this[_0x98ed('0x61')]=undefined;this['handlePredictive']=undefined;this[_0x98ed('0x62')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x98ed('0x63')]=0x0;this[_0x98ed('0x64')]=0x0;this[_0x98ed('0x65')]=0x0;this[_0x98ed('0x66')]=0x0;this[_0x98ed('0x67')]=0x0;this[_0x98ed('0x68')]=0x0;this[_0x98ed('0x69')]=0x0;this[_0x98ed('0x6a')]=_0x3d04a4['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x98ed('0x6b')]=_0x3d04a4[_0x98ed('0x6c')]||0xa;this[_0x98ed('0x6d')]=0x0;this[_0x98ed('0x6e')]=0x0;this[_0x98ed('0x6f')]=0x1;this[_0x98ed('0x70')]=0x0;this[_0x98ed('0x71')]=0x0;this[_0x98ed('0x72')]=0x0;this[_0x98ed('0x73')]=0x0;this[_0x98ed('0x74')]=_0x3d04a4[_0x98ed('0x74')]||0x1e;this[_0x98ed('0x75')]=_0x3d04a4[_0x98ed('0x75')]||![];this['dialQueueProject2']=_0x3d04a4[_0x98ed('0x76')]||undefined;this[_0x98ed('0x77')]=_0x3d04a4[_0x98ed('0x77')]||![];this['dialAgiAfterHangupAgent']=_0x3d04a4[_0x98ed('0x78')]||![];this['monitor_format']=monitorFormat[_0x3d04a4['monitor_format']]?monitorFormat[_0x3d04a4[_0x98ed('0xd')]]:undefined;this[_0x98ed('0x79')]=_0x3d04a4[_0x98ed('0x79')]||![];this[_0x98ed('0x7a')]=_0x3d04a4[_0x98ed('0x7a')]?_0x3d04a4[_0x98ed('0x7a')]:undefined;}module[_0x98ed('0x7b')]=VoiceQueue; \ No newline at end of file +var _0xd530=['unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid'];(function(_0x1d8a38,_0x4e726f){var _0x7e65c=function(_0x471037){while(--_0x471037){_0x1d8a38['push'](_0x1d8a38['shift']());}};_0x7e65c(++_0x4e726f);}(_0xd530,0x7a));var _0x0d53=function(_0x3803f4,_0x492950){_0x3803f4=_0x3803f4-0x0;var _0x2ac8ea=_0xd530[_0x3803f4];return _0x2ac8ea;};'use strict';var statusDesc=[_0x0d53('0x0'),'not_inuse',_0x0d53('0x1'),_0x0d53('0x2'),_0x0d53('0x3'),_0x0d53('0x4'),_0x0d53('0x5'),_0x0d53('0x6'),_0x0d53('0x7')];var monitorFormat={'wav':_0x0d53('0x8'),'wav49':'wav49','gsm':_0x0d53('0x9')};var strategy={'rrmemory':_0x0d53('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5672ef){this['id']=_0x5672ef['id']||0x0;this[_0x0d53('0xb')]=_0x5672ef[_0x0d53('0xb')]||'';this[_0x0d53('0xc')]=_0x5672ef[_0x0d53('0xc')]||'';this[_0x0d53('0xd')]=_0x5672ef[_0x0d53('0xd')]||_0x0d53('0xe');this[_0x0d53('0xf')]=0x0;this[_0x0d53('0x10')]=0x0;this[_0x0d53('0x11')]=0x0;this[_0x0d53('0x12')]=0x0;this[_0x0d53('0x13')]=0x0;this['sumHoldTime']=0x0;this[_0x0d53('0x14')]=0x0;this[_0x0d53('0x15')]=0x0;this[_0x0d53('0x16')]=0x0;this['loggedIn']=0x0;this[_0x0d53('0x17')]=0x0;this[_0x0d53('0x18')]=_0x5672ef[_0x0d53('0x18')]||![];this[_0x0d53('0x19')]=_0x5672ef[_0x0d53('0x19')]||0xa;this[_0x0d53('0x1a')]=_0x5672ef[_0x0d53('0x1a')]||'no';this[_0x0d53('0x1b')]=!![];this[_0x0d53('0x1c')]='';this[_0x0d53('0x1d')]=0x0;this[_0x0d53('0x1e')]=0x0;this[_0x0d53('0x1f')]=_0x5672ef[_0x0d53('0x1f')]||null;this[_0x0d53('0x20')]=_0x5672ef[_0x0d53('0x20')]?_0x5672ef[_0x0d53('0x20')]:null;this[_0x0d53('0x21')]=_0x5672ef[_0x0d53('0x21')];this[_0x0d53('0x22')]=_0x5672ef['dialMethod']||_0x0d53('0x23');this[_0x0d53('0x24')]=_0x5672ef[_0x0d53('0x24')]||0x0;this[_0x0d53('0x25')]=_0x5672ef[_0x0d53('0x25')]||0x0;this['dialPowerLevel']=_0x5672ef[_0x0d53('0x26')]||0x1;this[_0x0d53('0x27')]=_0x5672ef[_0x0d53('0x27')]||_0x0d53('0x28');this[_0x0d53('0x29')]=_0x5672ef['dialPredictiveOptimizationPercentage']||0.03;this[_0x0d53('0x2a')]=_0x5672ef[_0x0d53('0x2a')]||0x258;this[_0x0d53('0x2b')]=_0x5672ef[_0x0d53('0x2b')]||_0x0d53('0x2c');this['dialOriginateCallerIdNumber']=_0x5672ef[_0x0d53('0x2d')]||'anonymous';this[_0x0d53('0x2e')]=_0x5672ef[_0x0d53('0x2e')]||0x1e;this[_0x0d53('0x2f')]=_0x5672ef[_0x0d53('0x2f')]||_0x0d53('0x30');this['dialQueueTimeout']=_0x5672ef[_0x0d53('0x31')]||0x3;this['dialQueueProject']=_0x5672ef['dialQueueProject']||undefined;this[_0x0d53('0x32')]=_0x5672ef[_0x0d53('0x32')]||0x3;this[_0x0d53('0x33')]=_0x5672ef['dialCongestionRetryFrequency']||0x96;this[_0x0d53('0x34')]=_0x5672ef[_0x0d53('0x34')]||0x3;this[_0x0d53('0x35')]=_0x5672ef['dialBusyRetryFrequency']||0x96;this[_0x0d53('0x36')]=_0x5672ef[_0x0d53('0x36')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5672ef[_0x0d53('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x5672ef[_0x0d53('0x38')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5672ef[_0x0d53('0x39')]||0x96;this['dialDropMaxRetry']=_0x5672ef[_0x0d53('0x3a')]||0x3;this[_0x0d53('0x3b')]=_0x5672ef[_0x0d53('0x3b')]||0x96;this[_0x0d53('0x3c')]=_0x5672ef[_0x0d53('0x3c')]||0x3;this[_0x0d53('0x3d')]=_0x5672ef[_0x0d53('0x3d')]||0x96;this[_0x0d53('0x3e')]=_0x5672ef['dialMachineMaxRetry']||0x3;this[_0x0d53('0x3f')]=_0x5672ef['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x5672ef[_0x0d53('0x40')]||0x3;this[_0x0d53('0x41')]=_0x5672ef[_0x0d53('0x41')]||0x96;this['dialGlobalMaxRetry']=_0x5672ef[_0x0d53('0x42')]||0x4;this[_0x0d53('0x43')]=_0x5672ef[_0x0d53('0x43')]?_0x5672ef[_0x0d53('0x43')]:undefined;this[_0x0d53('0x44')]=_0x5672ef[_0x0d53('0x44')]?_0x5672ef[_0x0d53('0x44')]:undefined;this[_0x0d53('0x45')]=_0x5672ef['dialPrefix']||undefined;this['Interval']=_0x5672ef['Interval']?_0x5672ef[_0x0d53('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x5672ef[_0x0d53('0x47')]||'DESC';this[_0x0d53('0x48')]=_0x5672ef['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x0d53('0x49')]=_0x5672ef[_0x0d53('0x49')]||undefined;this['strategy']=strategy[_0x5672ef[_0x0d53('0x4a')]]||_0x0d53('0xa');this[_0x0d53('0x4b')]=!![];this['dialAMDActive']=_0x5672ef['dialAMDActive']||![];this[_0x0d53('0x4c')]=_0x5672ef['dialAMDInitialSilence'];this[_0x0d53('0x4d')]=_0x5672ef[_0x0d53('0x4d')];this[_0x0d53('0x4e')]=_0x5672ef[_0x0d53('0x4e')];this[_0x0d53('0x4f')]=_0x5672ef[_0x0d53('0x4f')];this[_0x0d53('0x50')]=_0x5672ef[_0x0d53('0x50')];this['dialAMDBetweenWordsSilence']=_0x5672ef[_0x0d53('0x51')];this[_0x0d53('0x52')]=_0x5672ef['dialAMDMaximumNumberOfWords'];this[_0x0d53('0x53')]=_0x5672ef[_0x0d53('0x53')];this['dialAMDMaximumWordLength']=_0x5672ef[_0x0d53('0x54')];this['outboundRejectCallsDay']=0x0;this[_0x0d53('0x55')]=0x0;this['timeout']=_0x5672ef[_0x0d53('0x56')];this[_0x0d53('0x57')]=0x0;this[_0x0d53('0x58')]=0x0;this[_0x0d53('0x59')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x0d53('0x5a')]=0x0;this[_0x0d53('0x5b')]=0x0;this[_0x0d53('0x5c')]=0x0;this[_0x0d53('0x5d')]=0x0;this[_0x0d53('0x5e')]=0x0;this[_0x0d53('0x5f')]=0x0;this[_0x0d53('0x60')]=0x0;this[_0x0d53('0x61')]=0x0;this[_0x0d53('0x62')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x0d53('0x63')]=undefined;this[_0x0d53('0x64')]=undefined;this[_0x0d53('0x65')]=undefined;this[_0x0d53('0x66')]=1.05;this[_0x0d53('0x67')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x0d53('0x68')]=0x0;this[_0x0d53('0x69')]=0x0;this[_0x0d53('0x6a')]=0x0;this[_0x0d53('0x6b')]=0x0;this[_0x0d53('0x6c')]=0x0;this[_0x0d53('0x6d')]=0x0;this[_0x0d53('0x6e')]=_0x5672ef[_0x0d53('0x6f')]||0x14;this[_0x0d53('0x70')]=_0x5672ef[_0x0d53('0x6f')]||0xa;this[_0x0d53('0x71')]=0x0;this[_0x0d53('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0d53('0x73')]=0x0;this[_0x0d53('0x74')]=0x0;this[_0x0d53('0x75')]=0x0;this[_0x0d53('0x76')]=0x0;this['dialRecallMeTimeout']=_0x5672ef[_0x0d53('0x77')]||0x1e;this[_0x0d53('0x78')]=_0x5672ef[_0x0d53('0x78')]||![];this['dialQueueProject2']=_0x5672ef['dialQueueProject2']||undefined;this[_0x0d53('0x79')]=_0x5672ef[_0x0d53('0x79')]||![];this[_0x0d53('0x7a')]=_0x5672ef[_0x0d53('0x7a')]||![];this[_0x0d53('0xc')]=monitorFormat[_0x5672ef['monitor_format']]?monitorFormat[_0x5672ef[_0x0d53('0xc')]]:undefined;this['mandatoryDisposition']=_0x5672ef[_0x0d53('0x7b')]||![];this[_0x0d53('0x7c')]=_0x5672ef[_0x0d53('0x7c')]?_0x5672ef[_0x0d53('0x7c')]:undefined;}module[_0x0d53('0x7d')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 9f69571..9ec411e 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 _0xae4c=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x295849,_0xb1aa86){var _0xd4a728=function(_0x34a2f1){while(--_0x34a2f1){_0x295849['push'](_0x295849['shift']());}};_0xd4a728(++_0xb1aa86);}(_0xae4c,0x96));var _0xcae4=function(_0x11a379,_0x572c80){_0x11a379=_0x11a379-0x0;var _0xc53c9f=_0xae4c[_0x11a379];return _0xc53c9f;};'use strict';function VtigerAccount(_0x4bfb0f){this['id']=_0x4bfb0f['id']||0x0;this[_0xcae4('0x0')]=_0x4bfb0f[_0xcae4('0x0')]||'';this[_0xcae4('0x1')]=_0x4bfb0f[_0xcae4('0x1')]||'';this[_0xcae4('0x2')]=_0x4bfb0f[_0xcae4('0x2')]||'';this['remoteUri']=_0x4bfb0f[_0xcae4('0x3')]||'';this['serverUrl']=_0x4bfb0f[_0xcae4('0x4')]||'';this['Configurations']=_0x4bfb0f[_0xcae4('0x5')]||{};}module[_0xcae4('0x6')]=VtigerAccount; \ No newline at end of file +var _0x7d0e=['accessKey','remoteUri','serverUrl','Configurations','exports','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d0e,0x131));var _0xe7d0=function(_0x4e1550,_0x1219bf){_0x4e1550=_0x4e1550-0x0;var _0x265734=_0x7d0e[_0x4e1550];return _0x265734;};'use strict';function VtigerAccount(_0x332285){this['id']=_0x332285['id']||0x0;this['name']=_0x332285['name']||'';this[_0xe7d0('0x0')]=_0x332285[_0xe7d0('0x0')]||'';this[_0xe7d0('0x1')]=_0x332285[_0xe7d0('0x1')]||'';this[_0xe7d0('0x2')]=_0x332285[_0xe7d0('0x2')]||'';this[_0xe7d0('0x3')]=_0x332285[_0xe7d0('0x3')]||'';this[_0xe7d0('0x4')]=_0x332285[_0xe7d0('0x4')]||{};}module[_0xe7d0('0x5')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7ecd7c1..cc9e959 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 _0x3a1f=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x276dab,_0x537a0f){var _0x287fff=function(_0x1faf05){while(--_0x1faf05){_0x276dab['push'](_0x276dab['shift']());}};_0x287fff(++_0x537a0f);}(_0x3a1f,0xbe));var _0xf3a1=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x3a1f[_0x55f8b4];return _0x2475f9;};'use strict';function ZendeskAccount(_0xc5ccc5){this['id']=_0xc5ccc5['id']||0x0;this[_0xf3a1('0x0')]=_0xc5ccc5[_0xf3a1('0x0')]||'';this[_0xf3a1('0x1')]=_0xc5ccc5['username']||'';this[_0xf3a1('0x2')]=_0xc5ccc5['password']||'';this[_0xf3a1('0x3')]=_0xc5ccc5[_0xf3a1('0x3')]||'';this['remoteUri']=_0xc5ccc5[_0xf3a1('0x4')]||'';this[_0xf3a1('0x5')]=_0xc5ccc5[_0xf3a1('0x5')]||'';this['type']=_0xc5ccc5[_0xf3a1('0x6')]||_0xf3a1('0x7');this[_0xf3a1('0x8')]=_0xc5ccc5['serverUrl']||'';this[_0xf3a1('0x9')]=_0xc5ccc5[_0xf3a1('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xee8f=['username','password','remoteUri','authType','type','integrationTab','Configurations','exports','name'];(function(_0x5d99bb,_0x10e04b){var _0xdfe846=function(_0x2e3377){while(--_0x2e3377){_0x5d99bb['push'](_0x5d99bb['shift']());}};_0xdfe846(++_0x10e04b);}(_0xee8f,0x1a6));var _0xfee8=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xee8f[_0x4cf98e];return _0x1623ac;};'use strict';function ZendeskAccount(_0x35bd1f){this['id']=_0x35bd1f['id']||0x0;this[_0xfee8('0x0')]=_0x35bd1f[_0xfee8('0x0')]||'';this[_0xfee8('0x1')]=_0x35bd1f[_0xfee8('0x1')]||'';this[_0xfee8('0x2')]=_0x35bd1f['password']||'';this['token']=_0x35bd1f['token']||'';this[_0xfee8('0x3')]=_0x35bd1f['remoteUri']||'';this[_0xfee8('0x4')]=_0x35bd1f['authType']||'';this[_0xfee8('0x5')]=_0x35bd1f[_0xfee8('0x5')]||_0xfee8('0x6');this['serverUrl']=_0x35bd1f['serverUrl']||'';this[_0xfee8('0x7')]=_0x35bd1f[_0xfee8('0x7')]||{};}module[_0xfee8('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index dbf4366..89c4e68 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 _0xaab0=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x542149,_0x5df180){var _0x36df57=function(_0x1f6e73){while(--_0x1f6e73){_0x542149['push'](_0x542149['shift']());}};_0x36df57(++_0x5df180);}(_0xaab0,0x145));var _0x0aab=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0xaab0[_0x1af1e1];return _0x5f3450;};'use strict';function ZohoAccount(_0x165f65){this['id']=_0x165f65['id']||0x0;this[_0x0aab('0x0')]=_0x165f65['name']||'';this[_0x0aab('0x1')]=_0x165f65[_0x0aab('0x1')]||'';this[_0x0aab('0x2')]=_0x165f65[_0x0aab('0x2')]||'';this[_0x0aab('0x3')]=_0x165f65['zone']||'';this[_0x0aab('0x4')]=_0x165f65['clientId']||'';this[_0x0aab('0x5')]=_0x165f65[_0x0aab('0x5')]||'';this[_0x0aab('0x6')]=_0x165f65['serverUrl']||'';this['code']=_0x165f65[_0x0aab('0x7')]||'';this[_0x0aab('0x8')]=_0x165f65[_0x0aab('0x8')]||'';this['Configurations']=_0x165f65[_0x0aab('0x9')]||{};}module[_0x0aab('0xa')]=ZohoAccount; \ No newline at end of file +var _0xe399=['exports','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x3af68e,_0x384315){var _0x3e6d5b=function(_0x21e40c){while(--_0x21e40c){_0x3af68e['push'](_0x3af68e['shift']());}};_0x3e6d5b(++_0x384315);}(_0xe399,0x17d));var _0x9e39=function(_0x2f5a0d,_0x445da1){_0x2f5a0d=_0x2f5a0d-0x0;var _0x1f9d96=_0xe399[_0x2f5a0d];return _0x1f9d96;};'use strict';function ZohoAccount(_0x3f80ba){this['id']=_0x3f80ba['id']||0x0;this['name']=_0x3f80ba['name']||'';this[_0x9e39('0x0')]=_0x3f80ba['description']||'';this[_0x9e39('0x1')]=_0x3f80ba[_0x9e39('0x1')]||'';this[_0x9e39('0x2')]=_0x3f80ba[_0x9e39('0x2')]||'';this[_0x9e39('0x3')]=_0x3f80ba[_0x9e39('0x3')]||'';this[_0x9e39('0x4')]=_0x3f80ba['clientSecret']||'';this[_0x9e39('0x5')]=_0x3f80ba[_0x9e39('0x5')]||'';this[_0x9e39('0x6')]=_0x3f80ba[_0x9e39('0x6')]||'';this[_0x9e39('0x7')]=_0x3f80ba[_0x9e39('0x7')]||'';this['Configurations']=_0x3f80ba[_0x9e39('0x8')]||{};}module[_0x9e39('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 28e95af..dad829e 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 _0xb1f3=['Agent','channelAgent','SIP/%s','calleridname','Contact','lastName','active','phone','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','lodash','string','uniqueid','idContact','campaigntype','queue','membername','isNil'];(function(_0x16850e,_0x3006be){var _0xaa2d55=function(_0x10d191){while(--_0x10d191){_0x16850e['push'](_0x16850e['shift']());}};_0xaa2d55(++_0x3006be);}(_0xb1f3,0x1b0));var _0x3b1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1f3[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0x3b1f('0x0'));var moment=require('moment');function checkNameSurname(_0x200680,_0x285a41,_0x181f72){var _0x120715='';if(!_['isNil'](_0x285a41)&&_0x3b1f('0x1')===typeof _0x285a41){_0x120715+=_0x285a41;}if(!_['isNil'](_0x181f72)&&_0x3b1f('0x1')===typeof _0x181f72){_0x120715+='\x20'+_0x181f72;}if(_0x120715!==''){return _0x120715;}return _0x200680;}function Action(_0x56b8b4,_0x385cf0,_0xaa5d25,_0x239585,_0x5743ba){this[_0x3b1f('0x2')]=_0xaa5d25||undefined;this[_0x3b1f('0x3')]=_0x56b8b4['id'];this['queue']=_0x385cf0['name'];this['type']=_0x385cf0['type'];this[_0x3b1f('0x4')]=_0x3b1f('0x5');this['dialAnswer']=![];this[_0x3b1f('0x6')]=_[_0x3b1f('0x7')](_0x56b8b4[_0x3b1f('0x8')])?undefined:_0x56b8b4['Agent']['name'];this[_0x3b1f('0x9')]=this[_0x3b1f('0x6')]?util['format'](_0x3b1f('0xa'),this[_0x3b1f('0x6')]):_0x239585||undefined;this[_0x3b1f('0xb')]=checkNameSurname(_0x56b8b4[_0x3b1f('0xc')]['phone'],_0x56b8b4['Contact']['firstName'],_0x56b8b4[_0x3b1f('0xc')][_0x3b1f('0xd')]);this[_0x3b1f('0xe')]=_0x56b8b4[_0x3b1f('0xe')]||![];this['calleridnum']=_0x56b8b4[_0x3b1f('0xc')][_0x3b1f('0xf')];this['scheduledat']=_0x56b8b4['scheduledat'];this[_0x3b1f('0x10')]=_0x56b8b4[_0x3b1f('0x10')]||0x0;this[_0x3b1f('0x11')]=_0x56b8b4[_0x3b1f('0x11')]||0x0;this[_0x3b1f('0x12')]=_0x56b8b4[_0x3b1f('0x12')]||0x0;this['countglobal']=(_0x56b8b4['countbusyretry']||0x0)+(_0x56b8b4[_0x3b1f('0x11')]||0x0)+(_0x56b8b4[_0x3b1f('0x12')]||0x0)+(_0x56b8b4['countnosuchnumberretry']||0x0)+(_0x56b8b4[_0x3b1f('0x13')]||0x0)+(_0x56b8b4[_0x3b1f('0x14')]||0x0)+(_0x56b8b4[_0x3b1f('0x15')]||0x0)+(_0x56b8b4[_0x3b1f('0x16')]||0x0);this[_0x3b1f('0x17')]=_0x56b8b4[_0x3b1f('0x17')]||0x0;this[_0x3b1f('0x13')]=_0x56b8b4['countdropretry']||0x0;this['countabandonedretry']=_0x56b8b4['countabandonedretry']||0x0;this[_0x3b1f('0x15')]=_0x56b8b4[_0x3b1f('0x15')]||0x0;this['countagentrejectretry']=_0x56b8b4['countagentrejectretry']||0x0;this[_0x3b1f('0x18')]=_0x56b8b4[_0x3b1f('0x18')];this[_0x3b1f('0x19')]=_0x56b8b4[_0x3b1f('0x19')];this[_0x3b1f('0x1a')]=_0x56b8b4[_0x3b1f('0x1a')];this[_0x3b1f('0x1b')]=_0x56b8b4[_0x3b1f('0x1b')];this[_0x3b1f('0x1c')]=_0x56b8b4[_0x3b1f('0x1c')];this[_0x3b1f('0x1d')]=_0x56b8b4['ListId'];this[_0x3b1f('0x1e')]=_[_0x3b1f('0x7')](_0x56b8b4[_0x3b1f('0x8')])?_0x56b8b4[_0x3b1f('0x1e')]:_0x56b8b4[_0x3b1f('0x8')]['id'];this[_0x3b1f('0x1f')]=_0x56b8b4[_0x3b1f('0x1f')];this[_0x3b1f('0x20')]='';this[_0x3b1f('0x21')]='';}Action[_0x3b1f('0x22')][_0x3b1f('0x23')]=function(){return util[_0x3b1f('0x24')](_0x3b1f('0x25'),this[_0x3b1f('0xb')],this[_0x3b1f('0x26')]);};module[_0x3b1f('0x27')]=Action; \ No newline at end of file +var _0x5bc4=['string','uniqueid','queue','name','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','isNil'];(function(_0x24ada3,_0x1c3417){var _0x299fa5=function(_0x4bd564){while(--_0x4bd564){_0x24ada3['push'](_0x24ada3['shift']());}};_0x299fa5(++_0x1c3417);}(_0x5bc4,0x1de));var _0x45bc=function(_0x1028d6,_0x50f22e){_0x1028d6=_0x1028d6-0x0;var _0x427a81=_0x5bc4[_0x1028d6];return _0x427a81;};'use strict';var util=require(_0x45bc('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x58fec8,_0x48ba96,_0x8625a5){var _0xe340e0='';if(!_[_0x45bc('0x1')](_0x48ba96)&&_0x45bc('0x2')===typeof _0x48ba96){_0xe340e0+=_0x48ba96;}if(!_[_0x45bc('0x1')](_0x8625a5)&&_0x45bc('0x2')===typeof _0x8625a5){_0xe340e0+='\x20'+_0x8625a5;}if(_0xe340e0!==''){return _0xe340e0;}return _0x58fec8;}function Action(_0x202fae,_0x19f6ea,_0x46d2b9,_0x105d9e,_0x3c701a){this[_0x45bc('0x3')]=_0x46d2b9||undefined;this['idContact']=_0x202fae['id'];this[_0x45bc('0x4')]=_0x19f6ea[_0x45bc('0x5')];this['type']=_0x19f6ea['type'];this[_0x45bc('0x6')]='queue';this[_0x45bc('0x7')]=![];this[_0x45bc('0x8')]=_[_0x45bc('0x1')](_0x202fae[_0x45bc('0x9')])?undefined:_0x202fae[_0x45bc('0x9')][_0x45bc('0x5')];this['channelAgent']=this[_0x45bc('0x8')]?util[_0x45bc('0xa')](_0x45bc('0xb'),this['membername']):_0x105d9e||undefined;this[_0x45bc('0xc')]=checkNameSurname(_0x202fae[_0x45bc('0xd')][_0x45bc('0xe')],_0x202fae[_0x45bc('0xd')][_0x45bc('0xf')],_0x202fae[_0x45bc('0xd')]['lastName']);this[_0x45bc('0x10')]=_0x202fae['active']||![];this[_0x45bc('0x11')]=_0x202fae['Contact'][_0x45bc('0xe')];this[_0x45bc('0x12')]=_0x202fae[_0x45bc('0x12')];this[_0x45bc('0x13')]=_0x202fae[_0x45bc('0x13')]||0x0;this[_0x45bc('0x14')]=_0x202fae[_0x45bc('0x14')]||0x0;this['countnoanswerretry']=_0x202fae[_0x45bc('0x15')]||0x0;this[_0x45bc('0x16')]=(_0x202fae[_0x45bc('0x13')]||0x0)+(_0x202fae[_0x45bc('0x14')]||0x0)+(_0x202fae[_0x45bc('0x15')]||0x0)+(_0x202fae['countnosuchnumberretry']||0x0)+(_0x202fae[_0x45bc('0x17')]||0x0)+(_0x202fae[_0x45bc('0x18')]||0x0)+(_0x202fae[_0x45bc('0x19')]||0x0)+(_0x202fae[_0x45bc('0x1a')]||0x0);this[_0x45bc('0x1b')]=_0x202fae[_0x45bc('0x1b')]||0x0;this[_0x45bc('0x17')]=_0x202fae[_0x45bc('0x17')]||0x0;this[_0x45bc('0x18')]=_0x202fae[_0x45bc('0x18')]||0x0;this['countmachineretry']=_0x202fae[_0x45bc('0x19')]||0x0;this[_0x45bc('0x1a')]=_0x202fae[_0x45bc('0x1a')]||0x0;this['callback']=_0x202fae['callback'];this[_0x45bc('0x1c')]=_0x202fae[_0x45bc('0x1c')];this['callbackat']=_0x202fae['callbackat'];this[_0x45bc('0x1d')]=_0x202fae['recallme'];this[_0x45bc('0x1e')]=_0x202fae[_0x45bc('0x1e')];this[_0x45bc('0x1f')]=_0x202fae['ListId'];this['UserId']=_[_0x45bc('0x1')](_0x202fae['Agent'])?_0x202fae[_0x45bc('0x20')]:_0x202fae[_0x45bc('0x9')]['id'];this[_0x45bc('0x21')]=_0x202fae[_0x45bc('0x21')];this[_0x45bc('0x22')]='';this['originatecalleridname']='';}Action[_0x45bc('0x23')][_0x45bc('0x24')]=function(){return util[_0x45bc('0xa')](_0x45bc('0x25'),this[_0x45bc('0xc')],this[_0x45bc('0x26')]);};module[_0x45bc('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index aa665b2..6e2ef52 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 _0xdf63=['paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','message','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','clockClearZombieChannels','clearZombieChannels','recallMe','clearZombieChannel','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','contactId','UserId','status','channel','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','createCustomerHistory','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','sumDuration','talktime','[syncHangup][talking][decrement]','countbusyretry','totalGlobal','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','[callProgressDetectingCustomer][logBusy]','unlockAgent','NOANSWER','NoAnswer','custom:agentnoanswer','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','pick','unlock','unlockContact','recallme','validateContact','isValid','checkIsBlackList','VoiceQueueId','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','SIP/%s/%s%s','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','toLowerVariables','Action','variablesAction','channelAgent','calleridnum','user:agentconnect','accountcode','OriginateError','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','statedesc','channelstate','transfer','disableContact','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','addVariable','variables','keys','value','error','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','type','outbound','strategy','available','pTalking','sumBillable','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','name','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'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xdf63,0xff));var _0x3df6=function(_0x3dcae6,_0x24652e){_0x3dcae6=_0x3dcae6-0x0;var _0x24fc25=_0xdf63[_0x3dcae6];return _0x24fc25;};'use strict';var util=require(_0x3df6('0x0'));var _=require('lodash');var BPromise=require(_0x3df6('0x1'));var uuid=require(_0x3df6('0x2'));var moment=require(_0x3df6('0x3'));var md5=require(_0x3df6('0x4'));var Redis=require(_0x3df6('0x5'));var config=require('../../../config/environment');var logger=require(_0x3df6('0x6'))('preview');var loggerAction=require(_0x3df6('0x6'))(_0x3df6('0x7'));var ami=require(_0x3df6('0x8'));var rpcDb=require(_0x3df6('0x9'));var Action=require('./action');var ut=require(_0x3df6('0xa'));config[_0x3df6('0xb')]=_['defaults'](config[_0x3df6('0xb')],{'host':_0x3df6('0xc'),'port':0x18eb});var io=require(_0x3df6('0xd'))(new Redis(config[_0x3df6('0xb')]));var Sequence=function(){};Sequence[_0x3df6('0xe')][_0x3df6('0xf')]=function(_0x17cf7f){this['tail']=this[_0x3df6('0x10')]?this['tail'][_0x3df6('0x11')](_0x17cf7f):_0x17cf7f();};function Preview(_0x39a20e){this[_0x3df6('0x12')]=new Sequence();this[_0x3df6('0x13')]=_0x39a20e[_0x3df6('0x14')];this[_0x3df6('0x15')]=_0x39a20e[_0x3df6('0x15')];this[_0x3df6('0x16')]={};this['agents']=_0x39a20e[_0x3df6('0x17')];this['clockClearZombieChannels']=0x0;ami['on'](_0x3df6('0x18'),this[_0x3df6('0x19')][_0x3df6('0x1a')](this));ami['on'](_0x3df6('0x1b'),this['syncHangup']['bind'](this));ami['on'](_0x3df6('0x1c'),this[_0x3df6('0x1d')][_0x3df6('0x1a')](this));ami['on'](_0x3df6('0x1e'),this[_0x3df6('0x1f')][_0x3df6('0x1a')](this));ami['on']('newexten',this[_0x3df6('0x20')]['bind'](this));ami['on'](_0x3df6('0x21'),this['syncVarSet'][_0x3df6('0x1a')](this));ami['on'](_0x3df6('0x22'),this[_0x3df6('0x23')][_0x3df6('0x1a')](this));ami['on'](_0x3df6('0x24'),this['syncBlindTransfer'][_0x3df6('0x1a')](this));this[_0x3df6('0x25')](this[_0x3df6('0x13')]);}function emit(_0x3ac5f9,_0x5cbd7c,_0x177396){io['to'](_0x3ac5f9)['emit'](_0x5cbd7c,_0x177396);}function emitCampaignPreview(_0x428d3b){if(_0x428d3b[_0x3df6('0x26')]===_0x3df6('0x27')){var _0x459d23={'id':_0x428d3b['id'],'name':_0x428d3b['name'],'strategy':_0x428d3b[_0x3df6('0x28')],'answered':_0x428d3b['answered'],'available':_0x428d3b[_0x3df6('0x29')],'loggedIn':_0x428d3b['loggedIn'],'pTalking':_0x428d3b[_0x3df6('0x2a')],'sumBillable':_0x428d3b[_0x3df6('0x2b')],'sumDuration':_0x428d3b['sumDuration'],'sumHoldTime':_0x428d3b[_0x3df6('0x2c')]||0x0,'talking':_0x428d3b[_0x3df6('0x2d')],'total':_0x428d3b[_0x3df6('0x2e')],'type':_0x428d3b[_0x3df6('0x26')],'unmanaged':_0x428d3b['unmanaged'],'abandoned':_0x428d3b[_0x3df6('0x2f')],'waiting':_0x428d3b['waiting'],'loggedInDb':_0x428d3b[_0x3df6('0x30')],'dialActive':_0x428d3b[_0x3df6('0x31')],'dialMethod':_0x428d3b[_0x3df6('0x32')],'dialOriginateCallerIdName':_0x428d3b[_0x3df6('0x33')],'dialOriginateCallerIdNumber':_0x428d3b[_0x3df6('0x34')],'dialOriginateTimeout':_0x428d3b['dialOriginateTimeout'],'dialPrefix':_0x428d3b[_0x3df6('0x35')],'outboundAnswerAgiCallsDay':_0x428d3b[_0x3df6('0x36')],'outboundAnswerCallsDay':_0x428d3b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x428d3b[_0x3df6('0x37')],'outboundBusyCallsDay':_0x428d3b[_0x3df6('0x38')],'outboundCongestionCallsDay':_0x428d3b[_0x3df6('0x39')],'outboundDropCallsDayACS':_0x428d3b[_0x3df6('0x3a')],'outboundDropCallsDayCallersExit':_0x428d3b[_0x3df6('0x3b')],'outboundDropCallsDayTimeout':_0x428d3b['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x428d3b[_0x3df6('0x3c')],'outboundNoSuchCallsDay':_0x428d3b[_0x3df6('0x3d')],'outboundOriginateFailureCallsDay':_0x428d3b[_0x3df6('0x3e')],'outboundReCallsDay':_0x428d3b['outboundReCallsDay'],'outboundRejectCallsDay':_0x428d3b[_0x3df6('0x3f')],'outboundUnknownCallsDay':_0x428d3b['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x428d3b[_0x3df6('0x40')],'predictiveIntervalAnsweredCalls':_0x428d3b['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x428d3b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x428d3b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x428d3b[_0x3df6('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x428d3b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x428d3b[_0x3df6('0x42')],'predictiveIntervalErlangCallsDroppedCalls':_0x428d3b[_0x3df6('0x43')],'predictiveIntervalHitRate':_0x428d3b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x428d3b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x428d3b[_0x3df6('0x44')],'predictiveIntervalAvailable':_0x428d3b[_0x3df6('0x45')],'predictiveIntervalTotalCalls':_0x428d3b['predictiveIntervalTotalCalls'],'message':_0x428d3b['message'],'originated':_0x428d3b[_0x3df6('0x46')],'erlangCalls':_0x428d3b[_0x3df6('0x47')],'erlangCallToSecond':_0x428d3b['erlangCallToSecond'],'erlangAbandonmentRate':_0x428d3b[_0x3df6('0x48')],'erlangBusyFactor':_0x428d3b['erlangBusyFactor'],'startPredictive':_0x428d3b[_0x3df6('0x49')],'startProgressive':_0x428d3b[_0x3df6('0x4a')]};if(_0x428d3b[_0x3df6('0x4b')]){_0x459d23[_0x3df6('0x4b')]={'id':_0x428d3b[_0x3df6('0x4b')]['id'],'name':_0x428d3b['Trunk'][_0x3df6('0x4c')],'active':_0x428d3b[_0x3df6('0x4b')]['active'],'callerid':_0x428d3b[_0x3df6('0x4b')]['callerid']};}if(_0x428d3b[_0x3df6('0x4d')]){_0x459d23['Interval']={'id':_0x428d3b['Interval']['id'],'name':_0x428d3b[_0x3df6('0x4d')][_0x3df6('0x4c')]};}var _0x355cf3=md5(JSON[_0x3df6('0x4e')](_0x459d23));if(_0x428d3b['md5']!==_0x355cf3){_0x428d3b[_0x3df6('0x4')]=_0x355cf3;emit(util[_0x3df6('0x4f')](_0x3df6('0x50'),_0x459d23[_0x3df6('0x4c')]),_0x3df6('0x51'),_0x459d23);}}}function emitVoiceQueueChannelRemove(_0x4797ce){logger[_0x3df6('0x52')](_0x3df6('0x53'),JSON[_0x3df6('0x4e')](_0x4797ce));emit(util[_0x3df6('0x4f')](_0x3df6('0x50'),_0x4797ce['name']),_0x3df6('0x54'),_0x4797ce);io['emit'](_0x3df6('0x55'),_0x4797ce);}function notSendMessagesQueue(_0x398b73){if(_0x398b73[_0x3df6('0x56')]){if(_0x398b73[_0x3df6('0x46')]===0x0&&_0x398b73[_0x3df6('0x2a')]===0x0){_0x398b73['sendMessageOneNotActive']=![];_0x398b73[_0x3df6('0x29')]=0x0;_0x398b73[_0x3df6('0x57')]=0x0;_0x398b73['message']=_0x3df6('0x58');ut[_0x3df6('0x59')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x398b73[_0x3df6('0x4c')]+_0x3df6('0x5a'));}else{_0x398b73[_0x3df6('0x5b')]=_0x3df6('0x5c');ut[_0x3df6('0x59')](_0x3df6('0x5d'),_0x398b73[_0x3df6('0x4c')]+_0x3df6('0x5e'));}emitCampaignPreview(_0x398b73);}}Preview['prototype']['loopCampaigns']=function(){var _0x577547=this;setInterval(function(){_0x577547['syncCampaigns']();},0x7cf);};Preview[_0x3df6('0xe')][_0x3df6('0x5f')]=function(){var _0xddf7c9=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x4d1134 in _0xddf7c9){if(_0xddf7c9[_0x3df6('0x60')](_0x4d1134)&&(_0xddf7c9[_0x4d1134][_0x3df6('0x32')]===_0x3df6('0x61')||_0xddf7c9[_0x4d1134]['dialMethod']===_0x3df6('0x62'))&&_0xddf7c9[_0x4d1134][_0x3df6('0x26')]===_0x3df6('0x27')){if(this['clockClearZombieChannels']>0x7){this[_0x3df6('0x63')]=0x0;this[_0x3df6('0x64')]();}}if(_0xddf7c9[_0x3df6('0x60')](_0x4d1134)&&_0xddf7c9[_0x4d1134][_0x3df6('0x32')]===_0x3df6('0x61')&&_0xddf7c9[_0x4d1134][_0x3df6('0x26')]===_0x3df6('0x27')){if(_0xddf7c9[_0x4d1134][_0x3df6('0x31')]){this['setMessage'](_0xddf7c9[_0x4d1134]);this[_0x3df6('0x65')](_0xddf7c9[_0x4d1134]);}else{notSendMessagesQueue(_0xddf7c9[_0x4d1134]);}}}};Preview['prototype'][_0x3df6('0x66')]=function(_0x2d7f7c){var _0x3d518d=this;this[_0x3df6('0x12')]['enqueue'](function(){if(!_['isNil'](_0x3d518d[_0x3df6('0x16')][_0x2d7f7c])){loggerAction[_0x3df6('0x52')]('[clearZombieChannels][talking]',_0x2d7f7c,_0x3df6('0x67'),_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')],_0x3df6('0x69'),JSON[_0x3df6('0x4e')](_0x3d518d[_0x3df6('0x13')][_0x3d518d[_0x3df6('0x16')][_0x2d7f7c]['queue']][_0x3df6('0x46')]),_0x3df6('0x6a'),JSON[_0x3df6('0x4e')](_0x3d518d[_0x3df6('0x13')][_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')]][_0x3df6('0x2a')]),JSON[_0x3df6('0x4e')](_0x3d518d['actions'][_0x2d7f7c][_0x3df6('0x6b')]),JSON['stringify'](_['pick'](_0x3d518d[_0x3df6('0x16')][_0x2d7f7c],[_0x3df6('0x6c'),_0x3df6('0x6d'),'VoiceQueueId','ListId'])));return ami['Action']({'action':_0x3df6('0x6e'),'channel':_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x6f')]})[_0x3df6('0x70')](function(_0x75effc){if(_0x75effc[_0x3df6('0x5b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3d518d[_0x3df6('0x16')][_0x2d7f7c]){ut[_0x3df6('0x71')](_0x3d518d['campaignsPreview'][_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')]],'[clearZombieChannel]');if(_0x3d518d['actions'][_0x2d7f7c][_0x3df6('0x6b')]===!![]){ut[_0x3df6('0x72')](_0x3d518d[_0x3df6('0x13')][_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')]],_0x3df6('0x73'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x2d7f7c,_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')]);}ut[_0x3df6('0x74')]('[Dialer][checkChannel][Preview]'+_0x2d7f7c,_0x3d518d[_0x3df6('0x16')][_0x2d7f7c][_0x3df6('0x68')]);delete _0x3d518d[_0x3df6('0x16')][_0x2d7f7c];}},0x2328);}});}});};Preview['prototype'][_0x3df6('0x64')]=function(){var _0x5166c0=this;loggerAction[_0x3df6('0x52')]('[action]',_[_0x3df6('0x75')](this[_0x3df6('0x16')]));for(var _0x54f073 in this[_0x3df6('0x16')]){if(_0x5166c0['actions'][_0x3df6('0x60')](_0x54f073)){_0x5166c0[_0x3df6('0x66')](_0x54f073);}}};Preview[_0x3df6('0xe')]['recallMe']=function(_0x36d566){var _0x2d3899=this;rpcDb[_0x3df6('0x76')](_0x36d566['id'],ut[_0x3df6('0x77')](this[_0x3df6('0x17')]))[_0x3df6('0x78')](function(_0x4a884d){if(!_[_0x3df6('0x79')](_0x4a884d)){for(var _0x5ba9c5=0x0;_0x5ba9c5<_0x4a884d[_0x3df6('0x7a')];_0x5ba9c5+=0x1){if(ut[_0x3df6('0x7b')](_0x4a884d[_0x5ba9c5][_0x3df6('0x7c')])<_0x36d566[_0x3df6('0x7d')]*0x3c){if(_0x4a884d[_0x5ba9c5][_0x3df6('0x7e')]&&!_0x4a884d[_0x5ba9c5][_0x3df6('0x7e')][_0x3df6('0x7f')]){_0x2d3899[_0x3df6('0x80')](_0x4a884d[_0x5ba9c5]['id'])[_0x3df6('0x78')](ut[_0x3df6('0x81')]('[RecallMe]'))[_0x3df6('0x70')](ut[_0x3df6('0x81')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x4a884d[_0x5ba9c5]['id']);}}else{var _0x50c43b=new Action(_0x4a884d[_0x5ba9c5],_0x36d566);_0x50c43b[_0x3df6('0x82')]=moment()[_0x3df6('0x4f')](_0x3df6('0x83'));_0x36d566[_0x3df6('0x84')]+=0x1;ut[_0x3df6('0x85')](_0x50c43b,0x17,_0x3df6('0x86'));if(_0x36d566[_0x3df6('0x87')]){rpcDb['rescheduleContactInQueue'](ut[_0x3df6('0x88')](_0x4a884d[_0x5ba9c5]));rpcDb['createCustomerHistory'](_0x50c43b,_0x3df6('0x89'));}else{ut[_0x3df6('0x85')](_0x50c43b,0x16,_0x3df6('0x8a'));rpcDb['createCustomerHistory'](_0x50c43b,_0x3df6('0x8b'));rpcDb[_0x3df6('0x8c')](_0x50c43b,_0x3df6('0x8b'));}}}}})[_0x3df6('0x70')](ut[_0x3df6('0x81')](_0x3df6('0x8d')));};Preview['prototype'][_0x3df6('0x8e')]=function(_0xd8cabb){_0xd8cabb[_0x3df6('0x56')]=!![];if(ut[_0x3df6('0x8f')](_0xd8cabb['loggedIn'])){_0xd8cabb[_0x3df6('0x5b')]=_0x3df6('0x90');}else if(!ut[_0x3df6('0x91')](_0xd8cabb[_0x3df6('0x31')])){_0xd8cabb['message']=_0x3df6('0x58');}else if(!this[_0x3df6('0x92')](_0xd8cabb['Trunk'])){if(!this['isTrunkReachable'](_0xd8cabb[_0x3df6('0x93')])){_0xd8cabb[_0x3df6('0x5b')]=_0x3df6('0x94');}else{_0xd8cabb['message']=_0x3df6('0x95');}}else{_0xd8cabb['message']='ACTIVE';}emitCampaignPreview(_0xd8cabb);};Preview[_0x3df6('0xe')][_0x3df6('0x96')]=function(_0x5c68fe,_0x47befd,_0x27b5ac){var _0x275ed8=this;var _0x1a44c1=this[_0x3df6('0x16')][_0x47befd];var _0x4bd424=this[_0x3df6('0x13')][_0x1a44c1['queue']];var _0x453552;if(_0x4bd424){switch(_0x27b5ac){case'1':_0x4bd424[_0x3df6('0x3d')]+=0x1;_0x1a44c1[_0x3df6('0x97')]+=0x1;_0x1a44c1[_0x3df6('0x98')]=ut['totalGlobal'](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0x0,'NoSuchNumber');ami['emit'](_0x3df6('0x99'),ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0x9b')));rpcDb[_0x3df6('0x9c')](_0x1a44c1,_0x3df6('0x9d'));if(ut['totalGlobal'](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x1a44c1[_0x3df6('0x97')]>=_0x4bd424[_0x3df6('0xa1')]){rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xa2'));}else{rpcDb[_0x3df6('0xa3')](ut[_0x3df6('0xa4')](_0x1a44c1,_0x3df6('0x97'),_0x4bd424[_0x3df6('0xa5')]),_0x1a44c1['unlockAgent'],_0x1a44c1[_0x3df6('0xa6')]);}}delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xa7')]];break;case _0x3df6('0xa8'):var _0x31fbbc=moment()[_0x3df6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a44c1['responsetime']=_0x31fbbc;_0x1a44c1[_0x3df6('0xa9')]=_0x31fbbc;_0x1a44c1[_0x3df6('0x6b')]=!![];_0x4bd424[_0x3df6('0x2a')]+=0x1;logger['info'](_0x3df6('0xaa'),_0x1a44c1[_0x3df6('0xab')],_0x3df6('0xac'),_0x4bd424[_0x3df6('0x4c')],_0x3df6('0x6a'),_0x4bd424[_0x3df6('0x2a')]);ami[_0x3df6('0xad')](_0x3df6('0xae'),ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0xaf'),this[_0x3df6('0x13')][_0x1a44c1[_0x3df6('0x68')]]));if(_0x4bd424[_0x3df6('0xb0')]){ami[_0x3df6('0xad')](_0x3df6('0xb1'),ut[_0x3df6('0xb2')](_0x1a44c1));}break;case'16':ami[_0x3df6('0xad')](_0x3df6('0xb3'),ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0xb4'),this[_0x3df6('0x13')][_0x1a44c1['queue']]));emitVoiceQueueChannelRemove(ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0xb4')));_0x4bd424[_0x3df6('0xb5')]+=0x1;_0x4bd424[_0x3df6('0x2e')]+=0x1;_0x4bd424['answered']+=0x1;ut['decrementTalkink'](_0x4bd424,_0x3df6('0xb6'));_0x1a44c1[_0x3df6('0x98')]=ut['totalGlobal'](_0x1a44c1);ut['logCustomer'](_0x1a44c1,0x4,'Answer');rpcDb[_0x3df6('0x9c')](_0x1a44c1,_0x3df6('0xb7'));rpcDb[_0x3df6('0x8c')](_0x1a44c1,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x1a44c1);_0x4bd424[_0x3df6('0xb8')]+=_0x1a44c1[_0x3df6('0xb9')];_0x4bd424[_0x3df6('0x2b')]+=_0x1a44c1[_0x3df6('0xb9')];logger[_0x3df6('0x52')](_0x3df6('0xba'),_0x1a44c1['uniqueid'],_0x3df6('0xac'),_0x4bd424[_0x3df6('0x4c')],_0x3df6('0x6a'),_0x4bd424[_0x3df6('0x2a')]);delete this[_0x3df6('0x16')][_0x5c68fe['linkedid']];break;case'BUSY':_0x4bd424[_0x3df6('0x38')]+=0x1;_0x1a44c1[_0x3df6('0xbb')]+=0x1;_0x1a44c1[_0x3df6('0x98')]=ut[_0x3df6('0xbc')](_0x1a44c1);ut['logCustomer'](_0x1a44c1,0x5,_0x3df6('0xbd'));ami['emit'](_0x3df6('0xbe'),ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0xbf')));rpcDb[_0x3df6('0x9c')](_0x1a44c1,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424['dialGlobalMaxRetry']){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,_0x3df6('0xc0'));}else{if(_0x1a44c1[_0x3df6('0xbb')]>=_0x4bd424['dialBusyMaxRetry']){rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xc1'));}else{rpcDb['rescheduleContact'](ut[_0x3df6('0xa4')](_0x1a44c1,'countbusyretry',_0x4bd424['dialBusyRetryFrequency']),_0x1a44c1[_0x3df6('0xc2')],_0x1a44c1[_0x3df6('0xa6')]);}}break;case _0x3df6('0xc3'):_0x4bd424[_0x3df6('0x3c')]+=0x1;_0x1a44c1['countnoanswerretry']+=0x1;_0x1a44c1['countglobal']=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0x3,_0x3df6('0xc4'));ami[_0x3df6('0xad')](_0x3df6('0xc5'),ut[_0x3df6('0x9a')](_0x1a44c1,'noanswer'));rpcDb['createCustomerHistory'](_0x1a44c1,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x1a44c1[_0x3df6('0xc6')]>=_0x4bd424[_0x3df6('0xc7')]){rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xc8'));}else{rpcDb[_0x3df6('0xa3')](ut['scheduledAt'](_0x1a44c1,_0x3df6('0xc6'),_0x4bd424[_0x3df6('0xc9')]),_0x1a44c1[_0x3df6('0xc2')],_0x1a44c1[_0x3df6('0xa6')]);}}break;case'CONGESTION':_0x4bd424['outboundCongestionCallsDay']+=0x1;_0x1a44c1[_0x3df6('0xca')]+=0x1;_0x1a44c1[_0x3df6('0x98')]=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0x8,_0x3df6('0xcb'));ami['emit'](_0x3df6('0xcc'),ut[_0x3df6('0x9a')](_0x1a44c1,_0x3df6('0xcd')));rpcDb[_0x3df6('0x9c')](_0x1a44c1,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut['cloneAction'](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,_0x3df6('0xce'));}else{if(_0x1a44c1[_0x3df6('0xca')]>=_0x4bd424[_0x3df6('0xcf')]){rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xd0'));}else{rpcDb[_0x3df6('0xa3')](ut[_0x3df6('0xa4')](_0x1a44c1,_0x3df6('0xca'),_0x4bd424[_0x3df6('0xd1')]),_0x1a44c1[_0x3df6('0xc2')],_0x1a44c1[_0x3df6('0xa6')]);}}break;case _0x3df6('0xd2'):_0x4bd424[_0x3df6('0x3f')]+=0x1;_0x1a44c1[_0x3df6('0xd3')]+=0x1;_0x1a44c1[_0x3df6('0x98')]=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0x14,_0x3df6('0xd4'));ami[_0x3df6('0xad')](_0x3df6('0xd5'),ut[_0x3df6('0x9a')](_0x1a44c1,'agentreject'));rpcDb[_0x3df6('0x9c')](_0x1a44c1,'[syncHangupRequest][logAgentReject]');if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0x14,_0x3df6('0xd4'));rpcDb[_0x3df6('0x8c')](_0x453552,_0x3df6('0xd6'));}else{if(_0x1a44c1[_0x3df6('0xd3')]>=_0x4bd424[_0x3df6('0xd7')]){rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xd6'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x1a44c1,_0x3df6('0xd3'),_0x4bd424[_0x3df6('0xd8')]),_0x1a44c1['unlockAgent'],_0x1a44c1[_0x3df6('0xa6')]);}}break;case _0x3df6('0xd9'):_0x4bd424['outboundAbandonedCallsDay']+=0x1;_0x1a44c1[_0x3df6('0xda')]+=0x1;_0x1a44c1['countglobal']=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x1a44c1,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb['createCustomerFinal'](_0x453552,_0x3df6('0xdb'));}else{if(_0x1a44c1[_0x3df6('0xdc')]>=_0x4bd424[_0x3df6('0xdd')]){rpcDb['createCustomerFinal'](_0x1a44c1,_0x3df6('0xdb'));}else{rpcDb[_0x3df6('0xa3')](ut[_0x3df6('0xa4')](_0x1a44c1,_0x3df6('0xda'),_0x4bd424[_0x3df6('0xde')]),_0x1a44c1[_0x3df6('0xc2')],_0x1a44c1[_0x3df6('0xa6')]);}}break;case'18':_0x4bd424[_0x3df6('0xdf')]+=0x1;_0x1a44c1[_0x3df6('0xe0')]+=0x1;_0x1a44c1['countglobal']=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0x12,_0x5c68fe[_0x3df6('0xe1')]||_0x5c68fe[_0x3df6('0xe2')]);ami['emit']('custom:amd',ut['buildObj'](_0x1a44c1,_0x3df6('0xe3')));rpcDb[_0x3df6('0x9c')](_0x1a44c1,_0x3df6('0xe4'));if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424[_0x3df6('0x9e')]){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb['createCustomerFinal'](_0x453552,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xe4'));}delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xa7')]];break;case'19':_0x4bd424[_0x3df6('0xdf')]+=0x1;_0x1a44c1[_0x3df6('0x98')]=ut[_0x3df6('0xbc')](_0x1a44c1);ut['logCustomer'](_0x1a44c1,0x13,_0x5c68fe[_0x3df6('0xe1')]||_0x5c68fe[_0x3df6('0xe2')]);ami[_0x3df6('0xad')](_0x3df6('0xe5'),ut['buildObj'](_0x1a44c1,_0x3df6('0xe3')));rpcDb[_0x3df6('0x9c')](_0x1a44c1,_0x3df6('0xe6'));if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424['dialGlobalMaxRetry']){_0x453552=ut[_0x3df6('0x9f')](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,_0x3df6('0xe6'));}else{rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xe6'));}delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xa7')]];break;default:if(_0x1a44c1[_0x3df6('0x6b')]){ut[_0x3df6('0x72')](_0x4bd424,_0x3df6('0xe7'));ut[_0x3df6('0x74')](_0x3df6('0xe8')+_0x4bd424[_0x3df6('0x4c')],_0x5c68fe);}_0x4bd424[_0x3df6('0xdf')]+=0x1;_0x1a44c1['countglobal']=ut[_0x3df6('0xbc')](_0x1a44c1);ut[_0x3df6('0x85')](_0x1a44c1,0xc,_0x5c68fe[_0x3df6('0xe1')]||_0x5c68fe['dialstatus']);rpcDb[_0x3df6('0x9c')](_0x1a44c1,_0x3df6('0xe9'));if(ut[_0x3df6('0xbc')](_0x1a44c1)>=_0x4bd424['dialGlobalMaxRetry']){_0x453552=ut['cloneAction'](_0x1a44c1,0xf,_0x3df6('0xa0'));rpcDb[_0x3df6('0x8c')](_0x453552,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x3df6('0x8c')](_0x1a44c1,_0x3df6('0xea'));}delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xa7')]];}if(!(_0x1a44c1[_0x3df6('0x6b')]&&_0x27b5ac==='16')){ut[_0x3df6('0x71')](_0x4bd424,_0x3df6('0xeb'));logger[_0x3df6('0x52')](_0x3df6('0xec'),_0x1a44c1[_0x3df6('0xab')],_0x3df6('0xac'),_0x4bd424['name'],_0x3df6('0x69'),_0x4bd424[_0x3df6('0x46')]);}if(_0x27b5ac!==_0x3df6('0xa8')){delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xa7')]];delete this[_0x3df6('0x16')][_0x5c68fe[_0x3df6('0xed')]];}}};Preview[_0x3df6('0xe')][_0x3df6('0xee')]=function(_0x4cbcc8,_0x24f51d,_0x5c6ea9){if(_['isUndefined'](_0x24f51d)&&_0x3df6('0xef')!==typeof _0x24f51d){return;}if(_[_0x3df6('0xf0')](_0x5c6ea9)&&'object'!==typeof _0x5c6ea9){return;}switch(_0x5c6ea9['reason']){case'0':ut[_0x3df6('0xf1')](_0x4cbcc8,0x0,_0x3df6('0xf2'));rpcDb[_0x3df6('0xf3')](_0x4cbcc8,_0x3df6('0xf4'));break;case'3':ut[_0x3df6('0xf1')](_0x4cbcc8,0x3,_0x3df6('0xc4'));rpcDb[_0x3df6('0xf3')](_0x4cbcc8,_0x3df6('0xf5'));break;case'5':ut['logAgent'](_0x4cbcc8,0x5,_0x3df6('0xbd'));rpcDb[_0x3df6('0xf3')](_0x4cbcc8,_0x3df6('0xf6'));break;case'8':ut['logAgent'](_0x4cbcc8,0x8,_0x3df6('0xcb'));rpcDb[_0x3df6('0xf3')](_0x4cbcc8,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x3df6('0xf1')](_0x4cbcc8,0x16,_0x3df6('0xf7'));rpcDb[_0x3df6('0xf3')](_0x4cbcc8,_0x3df6('0xf8'));break;default:ut[_0x3df6('0xf1')](_0x4cbcc8,0xc,_0x5c6ea9[_0x3df6('0xf9')]);rpcDb[_0x3df6('0xf3')](_0x4cbcc8,_0x3df6('0xfa'));}ut[_0x3df6('0x71')](_0x24f51d,_0x3df6('0xfb'));logger[_0x3df6('0x52')](_0x3df6('0xfc'),_0x4cbcc8[_0x3df6('0xab')],_0x3df6('0xac'),_0x24f51d[_0x3df6('0x4c')],'originated:\x20',_0x24f51d[_0x3df6('0x46')]);delete this['actions'][_0x4cbcc8[_0x3df6('0xab')]];};Preview[_0x3df6('0xe')]['checkInBlack']=function(_0x29b2a4,_0x439353,_0x3909c5,_0x6142a9,_0x1cd4e5){var _0x4e1615=this;return new BPromise(function(_0x49c7a3,_0x402002){if(_[_0x3df6('0x79')](_0x439353)||_[_0x3df6('0x79')](_0x439353['Contact'])||_[_0x3df6('0x79')](_0x439353[_0x3df6('0xfd')][_0x3df6('0xfe')])||_[_0x3df6('0x79')](_0x439353['VoiceQueueId'])){_0x402002(ut[_0x3df6('0x5b')](_0x3df6('0xff'),_0x6142a9,_0x1cd4e5));return;}var _0x33fbcf=uuid['v4']();var _0x7cde33=_0x4e1615[_0x3df6('0x13')][_0x439353[_0x3df6('0x67')][_0x3df6('0x4c')]];var _0x5d9cbd=_0x3909c5?_0x4e1615['agents'][_0x3909c5]['id']:undefined;_0x4e1615['actions'][_0x33fbcf]=new Action(_0x439353,_0x7cde33,_0x33fbcf,_0x3909c5,_0x5d9cbd);var _0x4fdf2c=_0x4e1615[_0x3df6('0x16')][_0x33fbcf];_0x4fdf2c['unlockAgent']=_0x6142a9;_0x4fdf2c['activeContact']=_0x1cd4e5;_0x4fdf2c[_0x3df6('0x100')]=_0x3909c5;if(_[_0x3df6('0x101')](_0x29b2a4)){_0x4e1615[_0x3df6('0x102')](_0x4fdf2c,_0x7cde33,_0x439353,_0x3909c5)[_0x3df6('0x78')](function(_0x1d3b77){logger[_0x3df6('0x52')](_0x3df6('0x103'),_0x3df6('0x104')+_0x4fdf2c['queue']+_0x3df6('0x105')+_0x4fdf2c[_0x3df6('0x106')],JSON['stringify'](_0x1d3b77));ami[_0x3df6('0xad')](_0x3df6('0x107'),ut[_0x3df6('0x9a')](_0x4fdf2c,'called',_0x4e1615[_0x3df6('0x13')][_0x4fdf2c[_0x3df6('0x68')]]));_0x49c7a3(ut[_0x3df6('0x5b')](_0x3df6('0x108')));})['catch'](function(_0x346130){ut[_0x3df6('0x59')]('[Preview][execCall][failure]',_0x346130);_0x402002(ut['message'](_0x3df6('0x109'),_0x6142a9,_0x1cd4e5));});}else{_0x7cde33[_0x3df6('0x37')]+=0x1;ut['logBlacklist'](_0x4fdf2c);rpcDb[_0x3df6('0x10a')](_0x4fdf2c,_0x3df6('0x10b'));delete _0x4e1615[_0x3df6('0x16')][_0x33fbcf];_0x402002(ut['message'](_0x3df6('0x10c'),_0x6142a9,_0x1cd4e5));}});};Preview[_0x3df6('0xe')][_0x3df6('0x92')]=function(_0x8dc9be){return!_[_0x3df6('0x79')](_0x8dc9be)&&!_['isNil'](_0x8dc9be[_0x3df6('0x4c')])&&!_[_0x3df6('0x79')](_0x8dc9be[_0x3df6('0x10d')])&&_0x8dc9be[_0x3df6('0x10d')]&&!_[_0x3df6('0x79')](this['trunks'][util[_0x3df6('0x4f')]('SIP/%s',_0x8dc9be[_0x3df6('0x4c')])])&&!_['isNil'](this['trunks'][util[_0x3df6('0x4f')](_0x3df6('0x10e'),_0x8dc9be[_0x3df6('0x4c')])][_0x3df6('0x6e')])&&(this['trunks'][util[_0x3df6('0x4f')](_0x3df6('0x10e'),_0x8dc9be[_0x3df6('0x4c')])]['status']===_0x3df6('0x10f')||this[_0x3df6('0x15')][util['format']('SIP/%s',_0x8dc9be['name'])][_0x3df6('0x6e')]===_0x3df6('0x110'));};Preview[_0x3df6('0xe')][_0x3df6('0x80')]=function(_0x2a4982,_0x18e2f9){var _0x3f21cd=this;return new BPromise(function(_0x116a94,_0x36365e){_0x3f21cd[_0x3df6('0x111')](_0x2a4982,_0x18e2f9)['then'](function(_0x165a87){_0x116a94(_[_0x3df6('0x112')](_0x165a87,[_0x3df6('0x5b')]));})['catch'](function(_0x5831b0){if(_0x5831b0[_0x3df6('0x113')]){rpcDb[_0x3df6('0x114')](_0x2a4982);}if(_0x5831b0['active']){rpcDb['disableContact'](_0x2a4982);}_0x36365e(_[_0x3df6('0x112')](_0x5831b0,[_0x3df6('0x5b')]));});});};Preview['prototype'][_0x3df6('0x111')]=function(_0x4979f4,_0x4d836c){var _0x48890e=this;return new BPromise(function(_0x37ff29,_0x313cf1){var _0x57fb3d,_0xeaa370;rpcDb['getContactPreview'](_0x4979f4)['then'](function(_0x3c3e96){if(!_[_0x3df6('0x79')](_0x3c3e96[0x0])){_0xeaa370=_0x3c3e96[0x0][_0x3df6('0x115')]?![]:!![];_0x57fb3d=_0x3c3e96[0x0]['recallme']?!![]:![];_0x57fb3d=_0x4d836c?!![]:_0x57fb3d;}var _0x487e87=_0x48890e[_0x3df6('0x116')](_0x3c3e96);if(_0x487e87[_0x3df6('0x117')]){rpcDb[_0x3df6('0x118')](_['pick'](_0x3c3e96[0x0],[_0x3df6('0x119'),_0x3df6('0x11a')]))['then'](function(_0x2ef029){_0x48890e[_0x3df6('0x11b')](_0x2ef029,_0x3c3e96[0x0],_0x4d836c,_0xeaa370,_0x57fb3d)[_0x3df6('0x78')](function(_0x4caca9){_0x37ff29(_0x4caca9);})[_0x3df6('0x70')](function(_0x3590e7){_0x313cf1(_0x3590e7);});})['catch'](function(_0x305f53){ut[_0x3df6('0x59')](_0x3df6('0x11c'),_0x305f53);_0x313cf1(ut[_0x3df6('0x5b')]('Call\x20unsuccessful',_0xeaa370,_0x57fb3d));});}else{_0x313cf1(ut[_0x3df6('0x5b')](_0x487e87[_0x3df6('0x5b')],_0xeaa370,_0x57fb3d));}})[_0x3df6('0x70')](function(_0x33e6e8){ut['logger'](_0x3df6('0x11d'),_0x33e6e8);_0x313cf1(ut[_0x3df6('0x5b')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x1d699a){if(_[_0x3df6('0x79')](_0x1d699a)||_[_0x3df6('0x101')](_0x1d699a)||!_[_0x3df6('0x79')](_0x1d699a[0x0][_0x3df6('0x7e')])&&_[_0x3df6('0x79')](_0x1d699a[0x0]['Agent']['name'])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x1d699a);return{'isValid':![],'message':_0x3df6('0x11e')};}var _0x3fcc35=this['campaignsPreview'][_0x1d699a[0x0][_0x3df6('0x67')][_0x3df6('0x4c')]];_0x3fcc35[_0x3df6('0x5b')]=_0x3df6('0x95');if(_['isNil'](_0x3fcc35)){ut[_0x3df6('0x59')](_0x3df6('0x11f'),_0x3fcc35);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x3fcc35[_0x3df6('0x4b')])){ut[_0x3df6('0x59')](_0x3df6('0x120'),_0x3df6('0x121')+_0x3fcc35[_0x3df6('0x4c')]+_0x3df6('0x122'));if(!this[_0x3df6('0x92')](_0x3fcc35[_0x3df6('0x93')])){ut[_0x3df6('0x59')](_0x3df6('0x120'),_0x3fcc35['name']+_0x3df6('0x123'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x3df6('0x91')](_0x3fcc35['dialActive'])){ut[_0x3df6('0x59')](_0x3df6('0x124'),_0x3fcc35[_0x3df6('0x4c')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x3df6('0x121')+_0x3fcc35[_0x3df6('0x4c')]+_0x3df6('0x125')};}return{'isValid':!![],'message':_0x3df6('0x126')};};Preview['prototype'][_0x3df6('0x102')]=function(_0x48753c,_0x281abf,_0x3fdcd1,_0x5e34ba){var _0x34ecc8=this;return new BPromise(function(_0x5088ad,_0x5ea7f2){var _0x436642=_0x48753c[_0x3df6('0xab')];var _0x110d6e=_0x34ecc8['isTrunkReachable'](_0x281abf[_0x3df6('0x4b')])?util[_0x3df6('0x4f')]('SIP/%s/%s%s',_0x281abf[_0x3df6('0x4b')][_0x3df6('0x4c')],_[_0x3df6('0x79')](_0x281abf['dialPrefix'])?'':_0x281abf[_0x3df6('0x35')][_0x3df6('0x127')]()||'',_0x281abf[_0x3df6('0x128')]>0x0?_0x3fdcd1['Contact'][_0x3df6('0xfe')]['substring'](_0x281abf[_0x3df6('0x128')]):_0x3fdcd1[_0x3df6('0xfd')]['phone']):util['format'](_0x3df6('0x129'),_[_0x3df6('0x79')](_0x281abf[_0x3df6('0x93')])?_0x281abf[_0x3df6('0x4b')][_0x3df6('0x4c')]:_0x281abf['TrunkBackup']['name'],_['isNil'](_0x281abf[_0x3df6('0x35')])?'':_0x281abf[_0x3df6('0x35')][_0x3df6('0x127')]()||'',_0x281abf[_0x3df6('0x128')]>0x0?_0x3fdcd1[_0x3df6('0xfd')][_0x3df6('0xfe')][_0x3df6('0x12a')](_0x281abf[_0x3df6('0x128')]):_0x3fdcd1['Contact']['phone']);var _0x578fcf=_0x34ecc8['isTrunkReachable'](_0x281abf[_0x3df6('0x4b')])?ut[_0x3df6('0x12b')](_0x281abf[_0x3df6('0x4b')][_0x3df6('0x12c')],_0x281abf[_0x3df6('0x33')],_0x281abf[_0x3df6('0x12d')]>0x0?ut[_0x3df6('0x12e')](_0x281abf[_0x3df6('0x34')],_0x281abf['dialRandomLastDigitCallerIdNumber']):_0x281abf['dialOriginateCallerIdNumber']):ut[_0x3df6('0x12b')](_[_0x3df6('0x79')](_0x281abf[_0x3df6('0x93')])?_0x281abf['Trunk']['callerid']:_0x281abf['TrunkBackup'][_0x3df6('0x12c')],_0x281abf[_0x3df6('0x33')],_0x281abf['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x3df6('0x12e')](_0x281abf[_0x3df6('0x34')],_0x281abf['dialRandomLastDigitCallerIdNumber']):_0x281abf[_0x3df6('0x34')]);if(_0x578fcf){_0x48753c['originatecalleridname']=ut[_0x3df6('0x12f')](_0x578fcf);_0x48753c[_0x3df6('0x130')]=ut['extractCalleridNumber'](_0x578fcf);}var _0x21f06d=ut['addVariables'](_0x281abf,_0x3fdcd1,_0x110d6e,_0x578fcf,_0x436642,_0x48753c);_['merge'](_0x48753c,ut[_0x3df6('0x131')](_0x21f06d));_0x48753c[_0x3df6('0x82')]=moment()[_0x3df6('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x3df6('0x132')](ut[_0x3df6('0x133')](_0x48753c,_0x281abf,_0x21f06d,_0x48753c[_0x3df6('0xa6')],_0x5e34ba))['then'](function(_0x189bba){var _0x2c828c=_0x48753c[_0x3df6('0x134')];if(!_['isNil'](_0x2c828c)){if(!_[_0x3df6('0x79')](_0x34ecc8[_0x3df6('0x17')][_0x2c828c])){_0x34ecc8['agents'][_0x2c828c]['destconnectedlinenum']=_0x48753c[_0x3df6('0x135')];emit(util['format']('user:%s',_0x34ecc8[_0x3df6('0x17')][_0x2c828c][_0x3df6('0x4c')]),_0x3df6('0x136'),{'destaccountcode':_0x34ecc8['agents'][_0x2c828c][_0x3df6('0x137')],'destconnectedlinenum':_0x48753c['calleridnum']});}}_0x281abf['originated']+=0x1;logger[_0x3df6('0x52')]('[originated][increment]',_0x436642,_0x3df6('0xac'),_0x281abf[_0x3df6('0x4c')],_0x3df6('0x69'),_0x281abf[_0x3df6('0x46')]);_0x5088ad(_0x189bba);})[_0x3df6('0x70')](function(_0x38c5c5){ut['logAgent'](_0x48753c,0xe,_0x3df6('0x138'));rpcDb[_0x3df6('0xf3')](_0x48753c,'[originateFailure][logOriginateFailure]');_0x5ea7f2(_0x38c5c5);});});};Preview[_0x3df6('0xe')][_0x3df6('0x20')]=function(_0x2a90f){if(this[_0x3df6('0x16')][_0x2a90f[_0x3df6('0xa7')]]){this[_0x3df6('0x16')][_0x2a90f[_0x3df6('0xa7')]][_0x3df6('0x6f')]=_0x2a90f['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x3f6f3b){var _0x4a1255=this;var _0xab94=this[_0x3df6('0x16')][_0x3f6f3b[_0x3df6('0x139')]];if(_0xab94){if(_0xab94[_0x3df6('0x100')]&&this['agents'][_0xab94['lookAgent']]){ut[_0x3df6('0x13a')](_0xab94,this['agents'][_0xab94[_0x3df6('0x100')]][_0x3df6('0x4c')],this[_0x3df6('0x17')][_0xab94[_0x3df6('0x100')]]['id']);}var _0x1eebfb=_[_0x3df6('0x13b')](_0xab94);_0x1eebfb[_0x3df6('0x13c')]=moment()[_0x3df6('0x4f')](_0x3df6('0x83'));var _0x1fc7a7=_0x4a1255[_0x3df6('0x13')][_0xab94[_0x3df6('0x68')]];if(ut[_0x3df6('0x13d')](_0x3f6f3b[_0x3df6('0x13e')])){if(_0xab94[_0x3df6('0xc2')]){rpcDb['unlockContact'](_0xab94[_0x3df6('0x106')]);}if(_0xab94[_0x3df6('0xa6')]){rpcDb['disableContact'](_0xab94[_0x3df6('0x106')]);}ami['emit'](_0x3df6('0x13f'),ut[_0x3df6('0x9a')](_0xab94,_0x3df6('0x140'),this['campaignsPreview'][_0xab94[_0x3df6('0x68')]]));this['callProgressDetectingAgent'](_0x1eebfb,_0x1fc7a7,_0x3f6f3b);}else{_0xab94[_0x3df6('0x82')]=moment()[_0x3df6('0x4f')](_0x3df6('0x83'));ut[_0x3df6('0xf1')](_0x1eebfb,0x4,_0x3df6('0x141'));rpcDb['createAgentHistory'](_0x1eebfb,_0x3df6('0x142'));}}};Preview[_0x3df6('0xe')][_0x3df6('0x143')]=function(_0x45d0d4){var _0x59f8bd=this;var _0x1edf9e=this[_0x3df6('0x16')][_0x45d0d4[_0x3df6('0xa7')]];var _0x145018;if(_0x1edf9e){_0x145018=this[_0x3df6('0x13')][_0x1edf9e[_0x3df6('0x68')]];logger[_0x3df6('0x52')](_0x3df6('0x144'),_0x45d0d4[_0x3df6('0xa7')],_0x3df6('0xac'),_0x145018[_0x3df6('0x4c')],_0x3df6('0x6a'),_0x145018[_0x3df6('0x2a')]);}if(this[_0x3df6('0x16')][_0x45d0d4['linkedid']]&&_0x45d0d4[_0x3df6('0xa7')]!==_0x45d0d4[_0x3df6('0xab')]){if(_0x45d0d4['cause']==='16'&&this[_0x3df6('0x16')][_0x45d0d4[_0x3df6('0xa7')]]['dialAnswer']){this[_0x3df6('0x96')](_0x45d0d4,_0x45d0d4[_0x3df6('0xa7')],_0x45d0d4[_0x3df6('0x145')]);}else if(this[_0x3df6('0x16')][_0x45d0d4[_0x3df6('0xa7')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x45d0d4['linkedid'],_0x45d0d4['cause'],'\x20Queue',_0x145018['name'],_0x3df6('0x6a'),_0x145018['pTalking']);this[_0x3df6('0x96')](_0x45d0d4,_0x45d0d4[_0x3df6('0xa7')],_0x45d0d4[_0x3df6('0x145')]);}}else if(_0x1edf9e&&_[_0x3df6('0x79')](_0x1edf9e[_0x3df6('0x146')])&&_0x145018['dialQueueProject']&&_0x45d0d4[_0x3df6('0xa7')]===_0x45d0d4[_0x3df6('0xab')]&&_['isNil'](_0x45d0d4['reason'])&&_0x45d0d4['cause']==='16'&&_0x45d0d4[_0x3df6('0x147')]==='6'&&_[_0x3df6('0xf0')](_0x1edf9e[_0x3df6('0x148')])){if(_0x1edf9e[_0x3df6('0xc2')]){rpcDb[_0x3df6('0x114')](_0x1edf9e['idContact']);}if(_0x1edf9e[_0x3df6('0xa6')]){rpcDb[_0x3df6('0x149')](_0x1edf9e[_0x3df6('0x106')]);}_0x45d0d4[_0x3df6('0xf9')]='22';this['callProgressDetectingAgent'](_0x1edf9e,_0x145018,_0x45d0d4);}else if(_0x1edf9e&&_0x1edf9e[_0x3df6('0x148')]){if(_0x45d0d4[_0x3df6('0x145')]==='16'&&this[_0x3df6('0x16')][_0x45d0d4[_0x3df6('0xa7')]][_0x3df6('0x6b')]){logger[_0x3df6('0x52')](_0x3df6('0x14a'),_0x45d0d4[_0x3df6('0xa7')],_0x45d0d4[_0x3df6('0x145')],_0x3df6('0xac'),_0x145018['name'],_0x3df6('0x6a'),_0x145018['pTalking']);this[_0x3df6('0x96')](_0x45d0d4,_0x45d0d4[_0x3df6('0xa7')],_0x45d0d4[_0x3df6('0x145')]);}else if(this['actions'][_0x45d0d4[_0x3df6('0xa7')]][_0x3df6('0x6b')]){logger[_0x3df6('0x52')](_0x3df6('0x14b'),_0x45d0d4[_0x3df6('0xa7')],_0x45d0d4[_0x3df6('0x145')],_0x3df6('0xac'),_0x145018['name'],_0x3df6('0x6a'),_0x145018[_0x3df6('0x2a')]);this['callProgressDetectingCustomer'](_0x45d0d4,_0x45d0d4['linkedid'],_0x45d0d4[_0x3df6('0x145')]);}}};Preview[_0x3df6('0xe')]['syncDialEnd']=function(_0x5d04dc){if(this[_0x3df6('0x16')][_0x5d04dc[_0x3df6('0xed')]]&&_0x5d04dc['destlinkedid']!==_0x5d04dc['destuniqueid']){this[_0x3df6('0x96')](_0x5d04dc,_0x5d04dc[_0x3df6('0xed')],_0x5d04dc[_0x3df6('0xe2')]);}};Preview[_0x3df6('0xe')][_0x3df6('0x1d')]=function(_0x468bf1){if(this[_0x3df6('0x16')][_0x468bf1[_0x3df6('0xa7')]]&&_0x468bf1[_0x3df6('0xa7')]!==_0x468bf1[_0x3df6('0xab')]&&!this[_0x3df6('0x16')][_0x468bf1[_0x3df6('0xa7')]][_0x3df6('0x6b')]){if(_0x468bf1[_0x3df6('0x145')]==='1'){this[_0x3df6('0x96')](_0x468bf1,_0x468bf1[_0x3df6('0xa7')],_0x468bf1['cause']);}}};Preview[_0x3df6('0xe')][_0x3df6('0x14c')]=function(_0x5a152d,_0x351ae8,_0x5c250a){if(this[_0x3df6('0x16')][_0x5a152d]){if(_['isNil'](this[_0x3df6('0x16')][_0x5a152d][_0x3df6('0x14d')])){this[_0x3df6('0x16')][_0x5a152d]['variables']={};}this[_0x3df6('0x16')][_0x5a152d][_0x3df6('0x14d')][_0x351ae8]=_0x5c250a;}};Preview[_0x3df6('0xe')]['syncVarSet']=function(_0x483faf){try{if(!_['isNil'](_0x483faf)){if(ut['filterKey'](_[_0x3df6('0x14e')](_0x483faf['variable'])[0x0])){this[_0x3df6('0x14c')](_0x483faf['uniqueid'],_[_0x3df6('0x14e')](_0x483faf['variable'])[0x0],_0x483faf[_0x3df6('0x14f')]);}}}catch(_0xaf6453){logger[_0x3df6('0x150')]('[syncVarSet][Preview]',util[_0x3df6('0x151')](_0xaf6453,{'showHidden':![],'depth':null}));}};Preview[_0x3df6('0xe')][_0x3df6('0x23')]=function(_0x380a2e){if(_0x380a2e){if(this[_0x3df6('0x16')][_0x380a2e[_0x3df6('0x152')]]){this['actions'][_0x380a2e[_0x3df6('0x152')]][_0x3df6('0x148')]=!![];}}};Preview[_0x3df6('0xe')][_0x3df6('0x153')]=function(_0x3ea0d5){if(_0x3ea0d5){if(this[_0x3df6('0x16')][_0x3ea0d5[_0x3df6('0x154')]]){this[_0x3df6('0x16')][_0x3ea0d5[_0x3df6('0x154')]][_0x3df6('0x148')]=!![];}}};module[_0x3df6('0x155')]=Preview; \ No newline at end of file +var _0x5ad7=['isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','activeContact','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','campaign\x20Name:\x20','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','toLowerVariables','Action','variablesAction','destconnectedlinenum','calleridnum','accountcode','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','moment','md5','../../../config/logger','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','preview','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED'];(function(_0x386ba0,_0x56e378){var _0x54f71d=function(_0x27f97a){while(--_0x27f97a){_0x386ba0['push'](_0x386ba0['shift']());}};_0x54f71d(++_0x56e378);}(_0x5ad7,0xbb));var _0x75ad=function(_0x5609a,_0x22c699){_0x5609a=_0x5609a-0x0;var _0x356e85=_0x5ad7[_0x5609a];return _0x356e85;};'use strict';var util=require('util');var _=require(_0x75ad('0x0'));var BPromise=require(_0x75ad('0x1'));var uuid=require(_0x75ad('0x2'));var moment=require(_0x75ad('0x3'));var md5=require(_0x75ad('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('preview');var loggerAction=require(_0x75ad('0x5'))(_0x75ad('0x6'));var ami=require('../ami');var rpcDb=require(_0x75ad('0x7'));var Action=require(_0x75ad('0x8'));var ut=require(_0x75ad('0x9'));config[_0x75ad('0xa')]=_[_0x75ad('0xb')](config['redis'],{'host':_0x75ad('0xc'),'port':0x18eb});var io=require(_0x75ad('0xd'))(new Redis(config[_0x75ad('0xa')]));var Sequence=function(){};Sequence[_0x75ad('0xe')][_0x75ad('0xf')]=function(_0x4d602a){this[_0x75ad('0x10')]=this[_0x75ad('0x10')]?this[_0x75ad('0x10')][_0x75ad('0x11')](_0x4d602a):_0x4d602a();};function Preview(_0x394296){this[_0x75ad('0x12')]=new Sequence();this[_0x75ad('0x13')]=_0x394296[_0x75ad('0x14')];this[_0x75ad('0x15')]=_0x394296[_0x75ad('0x15')];this[_0x75ad('0x16')]={};this[_0x75ad('0x17')]=_0x394296['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x75ad('0x18'),this[_0x75ad('0x19')]['bind'](this));ami['on'](_0x75ad('0x1a'),this[_0x75ad('0x1b')][_0x75ad('0x1c')](this));ami['on'](_0x75ad('0x1d'),this[_0x75ad('0x1e')]['bind'](this));ami['on']('dialend',this[_0x75ad('0x1f')][_0x75ad('0x1c')](this));ami['on']('newexten',this['syncNewExten'][_0x75ad('0x1c')](this));ami['on']('varset',this[_0x75ad('0x20')][_0x75ad('0x1c')](this));ami['on'](_0x75ad('0x21'),this[_0x75ad('0x22')][_0x75ad('0x1c')](this));ami['on'](_0x75ad('0x23'),this[_0x75ad('0x24')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0xbee655,_0x2d3b54,_0x552118){io['to'](_0xbee655)[_0x75ad('0x25')](_0x2d3b54,_0x552118);}function emitCampaignPreview(_0xd62b2){if(_0xd62b2[_0x75ad('0x26')]===_0x75ad('0x27')){var _0x4dab6e={'id':_0xd62b2['id'],'name':_0xd62b2[_0x75ad('0x28')],'strategy':_0xd62b2[_0x75ad('0x29')],'answered':_0xd62b2[_0x75ad('0x2a')],'available':_0xd62b2[_0x75ad('0x2b')],'loggedIn':_0xd62b2[_0x75ad('0x2c')],'pTalking':_0xd62b2[_0x75ad('0x2d')],'sumBillable':_0xd62b2[_0x75ad('0x2e')],'sumDuration':_0xd62b2['sumDuration'],'sumHoldTime':_0xd62b2['sumHoldTime']||0x0,'talking':_0xd62b2[_0x75ad('0x2f')],'total':_0xd62b2[_0x75ad('0x30')],'type':_0xd62b2['type'],'unmanaged':_0xd62b2[_0x75ad('0x31')],'abandoned':_0xd62b2[_0x75ad('0x32')],'waiting':_0xd62b2[_0x75ad('0x33')],'loggedInDb':_0xd62b2[_0x75ad('0x34')],'dialActive':_0xd62b2[_0x75ad('0x35')],'dialMethod':_0xd62b2[_0x75ad('0x36')],'dialOriginateCallerIdName':_0xd62b2[_0x75ad('0x37')],'dialOriginateCallerIdNumber':_0xd62b2[_0x75ad('0x38')],'dialOriginateTimeout':_0xd62b2[_0x75ad('0x39')],'dialPrefix':_0xd62b2[_0x75ad('0x3a')],'outboundAnswerAgiCallsDay':_0xd62b2[_0x75ad('0x3b')],'outboundAnswerCallsDay':_0xd62b2['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xd62b2['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xd62b2[_0x75ad('0x3c')],'outboundCongestionCallsDay':_0xd62b2[_0x75ad('0x3d')],'outboundDropCallsDayACS':_0xd62b2[_0x75ad('0x3e')],'outboundDropCallsDayCallersExit':_0xd62b2['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xd62b2[_0x75ad('0x3f')],'outboundNoAnswerCallsDay':_0xd62b2['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xd62b2[_0x75ad('0x40')],'outboundOriginateFailureCallsDay':_0xd62b2['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xd62b2['outboundReCallsDay'],'outboundRejectCallsDay':_0xd62b2[_0x75ad('0x41')],'outboundUnknownCallsDay':_0xd62b2['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0xd62b2[_0x75ad('0x42')],'predictiveIntervalAnsweredCalls':_0xd62b2[_0x75ad('0x43')],'predictiveIntervalAvgHoldtime':_0xd62b2[_0x75ad('0x44')],'predictiveIntervalAvgTalktime':_0xd62b2[_0x75ad('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0xd62b2[_0x75ad('0x46')],'predictiveIntervalDroppedCallsTimeout':_0xd62b2[_0x75ad('0x47')],'predictiveIntervalErlangCalls':_0xd62b2[_0x75ad('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0xd62b2[_0x75ad('0x49')],'predictiveIntervalHitRate':_0xd62b2[_0x75ad('0x4a')],'predictiveIntervalMultiplicativeFactor':_0xd62b2[_0x75ad('0x4b')],'predictiveIntervalPauses':_0xd62b2['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xd62b2[_0x75ad('0x4c')],'predictiveIntervalTotalCalls':_0xd62b2[_0x75ad('0x4d')],'message':_0xd62b2[_0x75ad('0x4e')],'originated':_0xd62b2[_0x75ad('0x4f')],'erlangCalls':_0xd62b2['erlangCalls'],'erlangCallToSecond':_0xd62b2[_0x75ad('0x50')],'erlangAbandonmentRate':_0xd62b2['erlangAbandonmentRate'],'erlangBusyFactor':_0xd62b2[_0x75ad('0x51')],'startPredictive':_0xd62b2['startPredictive'],'startProgressive':_0xd62b2['startProgressive']};if(_0xd62b2[_0x75ad('0x52')]){_0x4dab6e[_0x75ad('0x52')]={'id':_0xd62b2[_0x75ad('0x52')]['id'],'name':_0xd62b2[_0x75ad('0x52')][_0x75ad('0x28')],'active':_0xd62b2[_0x75ad('0x52')][_0x75ad('0x53')],'callerid':_0xd62b2[_0x75ad('0x52')][_0x75ad('0x54')]};}if(_0xd62b2[_0x75ad('0x55')]){_0x4dab6e['Interval']={'id':_0xd62b2[_0x75ad('0x55')]['id'],'name':_0xd62b2[_0x75ad('0x55')][_0x75ad('0x28')]};}var _0x5658f6=md5(JSON[_0x75ad('0x56')](_0x4dab6e));if(_0xd62b2[_0x75ad('0x4')]!==_0x5658f6){_0xd62b2[_0x75ad('0x4')]=_0x5658f6;emit(util[_0x75ad('0x57')](_0x75ad('0x58'),_0x4dab6e[_0x75ad('0x28')]),'voice_queue:save',_0x4dab6e);}}}function emitVoiceQueueChannelRemove(_0x4cc5d5){logger['info'](_0x75ad('0x59'),JSON[_0x75ad('0x56')](_0x4cc5d5));emit(util['format'](_0x75ad('0x58'),_0x4cc5d5['name']),_0x75ad('0x5a'),_0x4cc5d5);io[_0x75ad('0x25')](_0x75ad('0x5b'),_0x4cc5d5);}function notSendMessagesQueue(_0x36f3c7){if(_0x36f3c7[_0x75ad('0x5c')]){if(_0x36f3c7[_0x75ad('0x4f')]===0x0&&_0x36f3c7[_0x75ad('0x2d')]===0x0){_0x36f3c7[_0x75ad('0x5c')]=![];_0x36f3c7['available']=0x0;_0x36f3c7[_0x75ad('0x5d')]=0x0;_0x36f3c7['message']='NOT_ACTIVE';ut[_0x75ad('0x5e')](_0x75ad('0x5f'),_0x36f3c7['name']+_0x75ad('0x60'));}else{_0x36f3c7[_0x75ad('0x4e')]='IS_DISACTIVED';ut[_0x75ad('0x5e')](_0x75ad('0x5f'),_0x36f3c7['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x36f3c7);}}Preview[_0x75ad('0xe')][_0x75ad('0x61')]=function(){var _0xed5fee=this;setInterval(function(){_0xed5fee[_0x75ad('0x62')]();},0x7cf);};Preview[_0x75ad('0xe')][_0x75ad('0x62')]=function(){var _0x2f4160=this[_0x75ad('0x13')];this[_0x75ad('0x63')]+=0x1;for(var _0x4948d3 in _0x2f4160){if(_0x2f4160[_0x75ad('0x64')](_0x4948d3)&&(_0x2f4160[_0x4948d3]['dialMethod']===_0x75ad('0x65')||_0x2f4160[_0x4948d3]['dialMethod']===_0x75ad('0x66'))&&_0x2f4160[_0x4948d3][_0x75ad('0x26')]===_0x75ad('0x27')){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this[_0x75ad('0x67')]();}}if(_0x2f4160[_0x75ad('0x64')](_0x4948d3)&&_0x2f4160[_0x4948d3]['dialMethod']===_0x75ad('0x65')&&_0x2f4160[_0x4948d3][_0x75ad('0x26')]===_0x75ad('0x27')){if(_0x2f4160[_0x4948d3][_0x75ad('0x35')]){this[_0x75ad('0x68')](_0x2f4160[_0x4948d3]);this[_0x75ad('0x69')](_0x2f4160[_0x4948d3]);}else{notSendMessagesQueue(_0x2f4160[_0x4948d3]);}}}};Preview[_0x75ad('0xe')][_0x75ad('0x6a')]=function(_0x1f6806){var _0x5d47b0=this;this[_0x75ad('0x12')][_0x75ad('0xf')](function(){if(!_[_0x75ad('0x6b')](_0x5d47b0[_0x75ad('0x16')][_0x1f6806])){loggerAction[_0x75ad('0x6c')](_0x75ad('0x6d'),_0x1f6806,_0x75ad('0x6e'),_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x6f')],_0x75ad('0x70'),JSON[_0x75ad('0x56')](_0x5d47b0[_0x75ad('0x13')][_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x6f')]][_0x75ad('0x4f')]),_0x75ad('0x71'),JSON[_0x75ad('0x56')](_0x5d47b0['campaignsPreview'][_0x5d47b0['actions'][_0x1f6806]['queue']][_0x75ad('0x2d')]),JSON[_0x75ad('0x56')](_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x72')]),JSON[_0x75ad('0x56')](_[_0x75ad('0x73')](_0x5d47b0[_0x75ad('0x16')][_0x1f6806],[_0x75ad('0x74'),_0x75ad('0x75'),_0x75ad('0x76'),_0x75ad('0x77')])));return ami['Action']({'action':_0x75ad('0x78'),'channel':_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x79')]})[_0x75ad('0x7a')](function(_0x2eabf4){if(_0x2eabf4[_0x75ad('0x4e')]===_0x75ad('0x7b')){setTimeout(function(){if(_0x5d47b0[_0x75ad('0x16')][_0x1f6806]){ut[_0x75ad('0x7c')](_0x5d47b0[_0x75ad('0x13')][_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x6f')]],'[clearZombieChannel]');if(_0x5d47b0[_0x75ad('0x16')][_0x1f6806][_0x75ad('0x72')]===!![]){ut['decrementTalkink'](_0x5d47b0[_0x75ad('0x13')][_0x5d47b0['actions'][_0x1f6806]['queue']],_0x75ad('0x7d'));ut[_0x75ad('0x7e')](_0x75ad('0x7f')+_0x1f6806,_0x5d47b0[_0x75ad('0x16')][_0x1f6806]['queue']);}ut[_0x75ad('0x7e')](_0x75ad('0x80')+_0x1f6806,_0x5d47b0['actions'][_0x1f6806]['queue']);delete _0x5d47b0[_0x75ad('0x16')][_0x1f6806];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x13619c=this;loggerAction[_0x75ad('0x6c')]('[action]',_[_0x75ad('0x81')](this[_0x75ad('0x16')]));for(var _0x585c37 in this[_0x75ad('0x16')]){if(_0x13619c[_0x75ad('0x16')][_0x75ad('0x64')](_0x585c37)){_0x13619c[_0x75ad('0x6a')](_0x585c37);}}};Preview[_0x75ad('0xe')][_0x75ad('0x69')]=function(_0x3d4bea){var _0x136fd7=this;rpcDb['getContactRecallMe'](_0x3d4bea['id'],ut[_0x75ad('0x82')](this[_0x75ad('0x17')]))[_0x75ad('0x83')](function(_0x25cf0a){if(!_['isNil'](_0x25cf0a)){for(var _0x3bd5b8=0x0;_0x3bd5b8<_0x25cf0a['length'];_0x3bd5b8+=0x1){if(ut[_0x75ad('0x84')](_0x25cf0a[_0x3bd5b8][_0x75ad('0x85')])<_0x3d4bea[_0x75ad('0x86')]*0x3c){if(_0x25cf0a[_0x3bd5b8][_0x75ad('0x87')]&&!_0x25cf0a[_0x3bd5b8][_0x75ad('0x87')]['voicePause']){_0x136fd7[_0x75ad('0x88')](_0x25cf0a[_0x3bd5b8]['id'])[_0x75ad('0x83')](ut[_0x75ad('0x89')](_0x75ad('0x8a')))['catch'](ut[_0x75ad('0x89')](_0x75ad('0x8a')));}else{rpcDb[_0x75ad('0x8b')](_0x25cf0a[_0x3bd5b8]['id']);}}else{var _0xc3f16a=new Action(_0x25cf0a[_0x3bd5b8],_0x3d4bea);_0xc3f16a[_0x75ad('0x8c')]=moment()['format'](_0x75ad('0x8d'));_0x3d4bea[_0x75ad('0x8e')]+=0x1;ut[_0x75ad('0x8f')](_0xc3f16a,0x17,_0x75ad('0x90'));if(_0x3d4bea[_0x75ad('0x91')]){rpcDb[_0x75ad('0x92')](ut[_0x75ad('0x93')](_0x25cf0a[_0x3bd5b8]));rpcDb[_0x75ad('0x94')](_0xc3f16a,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x75ad('0x8f')](_0xc3f16a,0x16,_0x75ad('0x95'));rpcDb['createCustomerHistory'](_0xc3f16a,_0x75ad('0x96'));rpcDb[_0x75ad('0x97')](_0xc3f16a,_0x75ad('0x96'));}}}}})[_0x75ad('0x7a')](ut['logger2'](_0x75ad('0x98')));};Preview[_0x75ad('0xe')][_0x75ad('0x68')]=function(_0x4023e1){_0x4023e1['sendMessageOneNotActive']=!![];if(ut[_0x75ad('0x99')](_0x4023e1['loggedIn'])){_0x4023e1[_0x75ad('0x4e')]=_0x75ad('0x9a');}else if(!ut[_0x75ad('0x9b')](_0x4023e1[_0x75ad('0x35')])){_0x4023e1['message']=_0x75ad('0x9c');}else if(!this['isTrunkReachable'](_0x4023e1[_0x75ad('0x52')])){if(!this[_0x75ad('0x9d')](_0x4023e1[_0x75ad('0x9e')])){_0x4023e1['message']=_0x75ad('0x9f');}else{_0x4023e1[_0x75ad('0x4e')]=_0x75ad('0xa0');}}else{_0x4023e1['message']='ACTIVE';}emitCampaignPreview(_0x4023e1);};Preview[_0x75ad('0xe')]['callProgressDetectingCustomer']=function(_0x5c332e,_0x211a94,_0x292bf9){var _0x1922c6=this;var _0x3e328c=this[_0x75ad('0x16')][_0x211a94];var _0x2a8e85=this[_0x75ad('0x13')][_0x3e328c['queue']];var _0x1cab92;if(_0x2a8e85){switch(_0x292bf9){case'1':_0x2a8e85[_0x75ad('0x40')]+=0x1;_0x3e328c[_0x75ad('0xa1')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut[_0x75ad('0xa3')](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x0,_0x75ad('0xa4'));ami[_0x75ad('0x25')](_0x75ad('0xa5'),ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xa7')));rpcDb[_0x75ad('0x94')](_0x3e328c,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0xf,_0x75ad('0xaa'));rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xab'));}else{if(_0x3e328c['countnosuchnumberretry']>=_0x2a8e85[_0x75ad('0xac')]){rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xab'));}else{rpcDb['rescheduleContact'](ut[_0x75ad('0xad')](_0x3e328c,'countnosuchnumberretry',_0x2a8e85['dialNoSuchNumberRetryFrequency']),_0x3e328c[_0x75ad('0xae')],_0x3e328c[_0x75ad('0xaf')]);}}delete this[_0x75ad('0x16')][_0x5c332e['linkedid']];break;case'ANSWER':var _0x1ba6b2=moment()[_0x75ad('0x57')](_0x75ad('0x8d'));_0x3e328c['responsetime']=_0x1ba6b2;_0x3e328c[_0x75ad('0xb0')]=_0x1ba6b2;_0x3e328c[_0x75ad('0x72')]=!![];_0x2a8e85['pTalking']+=0x1;logger[_0x75ad('0x6c')](_0x75ad('0xb1'),_0x3e328c[_0x75ad('0xb2')],'\x20Queue',_0x2a8e85['name'],_0x75ad('0x71'),_0x2a8e85['pTalking']);ami[_0x75ad('0x25')](_0x75ad('0xb3'),ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xb4'),this[_0x75ad('0x13')][_0x3e328c[_0x75ad('0x6f')]]));if(_0x2a8e85[_0x75ad('0xb5')]){ami[_0x75ad('0x25')]('custom:agentConnectPreview',ut[_0x75ad('0xb6')](_0x3e328c));}break;case'16':ami[_0x75ad('0x25')](_0x75ad('0xb7'),ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xb8'),this[_0x75ad('0x13')][_0x3e328c[_0x75ad('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xb8')));_0x2a8e85[_0x75ad('0xb9')]+=0x1;_0x2a8e85['total']+=0x1;_0x2a8e85[_0x75ad('0x2a')]+=0x1;ut[_0x75ad('0xba')](_0x2a8e85,_0x75ad('0xbb'));_0x3e328c[_0x75ad('0xa2')]=ut[_0x75ad('0xa3')](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x4,_0x75ad('0xbc'));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xbd'));rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xbe'));rpcDb[_0x75ad('0xbf')](_0x3e328c);_0x2a8e85[_0x75ad('0xc0')]+=_0x3e328c[_0x75ad('0xc1')];_0x2a8e85['sumBillable']+=_0x3e328c[_0x75ad('0xc1')];logger[_0x75ad('0x6c')](_0x75ad('0xc2'),_0x3e328c[_0x75ad('0xb2')],_0x75ad('0xc3'),_0x2a8e85[_0x75ad('0x28')],_0x75ad('0x71'),_0x2a8e85[_0x75ad('0x2d')]);delete this[_0x75ad('0x16')][_0x5c332e[_0x75ad('0xc4')]];break;case _0x75ad('0xc5'):_0x2a8e85[_0x75ad('0x3c')]+=0x1;_0x3e328c[_0x75ad('0xc6')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut['totalGlobal'](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x5,_0x75ad('0xc7'));ami['emit'](_0x75ad('0xc8'),ut['buildObj'](_0x3e328c,_0x75ad('0xc9')));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xca'));if(ut['totalGlobal'](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0xf,_0x75ad('0xaa'));rpcDb[_0x75ad('0x97')](_0x1cab92,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3e328c[_0x75ad('0xc6')]>=_0x2a8e85['dialBusyMaxRetry']){rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xca'));}else{rpcDb[_0x75ad('0xcb')](ut[_0x75ad('0xad')](_0x3e328c,_0x75ad('0xc6'),_0x2a8e85[_0x75ad('0xcc')]),_0x3e328c[_0x75ad('0xae')],_0x3e328c[_0x75ad('0xaf')]);}}break;case _0x75ad('0xcd'):_0x2a8e85['outboundNoAnswerCallsDay']+=0x1;_0x3e328c[_0x75ad('0xce')]+=0x1;_0x3e328c['countglobal']=ut[_0x75ad('0xa3')](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x3,_0x75ad('0xcf'));ami[_0x75ad('0x25')](_0x75ad('0xd0'),ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xd1')));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xd2'));if(ut[_0x75ad('0xa3')](_0x3e328c)>=_0x2a8e85['dialGlobalMaxRetry']){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0xf,_0x75ad('0xaa'));rpcDb['createCustomerFinal'](_0x1cab92,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3e328c['countnoanswerretry']>=_0x2a8e85[_0x75ad('0xd3')]){rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xd2'));}else{rpcDb[_0x75ad('0xcb')](ut[_0x75ad('0xad')](_0x3e328c,'countnoanswerretry',_0x2a8e85[_0x75ad('0xd4')]),_0x3e328c['unlockAgent'],_0x3e328c[_0x75ad('0xaf')]);}}break;case _0x75ad('0xd5'):_0x2a8e85[_0x75ad('0x3d')]+=0x1;_0x3e328c[_0x75ad('0xd6')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut[_0x75ad('0xa3')](_0x3e328c);ut['logCustomer'](_0x3e328c,0x8,'Congestion');ami[_0x75ad('0x25')]('custom:agentcongestion',ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xd7')));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xd8'));if(ut[_0x75ad('0xa3')](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut['cloneAction'](_0x3e328c,0xf,'Global');rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xd9'));}else{if(_0x3e328c[_0x75ad('0xd6')]>=_0x2a8e85['dialCongestionMaxRetry']){rpcDb[_0x75ad('0x97')](_0x3e328c,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x75ad('0xcb')](ut[_0x75ad('0xad')](_0x3e328c,_0x75ad('0xd6'),_0x2a8e85[_0x75ad('0xcc')]),_0x3e328c[_0x75ad('0xae')],_0x3e328c[_0x75ad('0xaf')]);}}break;case'CANCEL':_0x2a8e85['outboundRejectCallsDay']+=0x1;_0x3e328c[_0x75ad('0xda')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut['totalGlobal'](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x14,_0x75ad('0xdb'));ami['emit'](_0x75ad('0xdc'),ut[_0x75ad('0xa6')](_0x3e328c,'agentreject'));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xdd'));if(ut[_0x75ad('0xa3')](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0x14,'AgentReject');rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xde'));}else{if(_0x3e328c[_0x75ad('0xda')]>=_0x2a8e85['dialAgentRejectMaxRetry']){rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xde'));}else{rpcDb['rescheduleContact'](ut[_0x75ad('0xad')](_0x3e328c,'countagentrejectretry',_0x2a8e85[_0x75ad('0xdf')]),_0x3e328c['unlockAgent'],_0x3e328c[_0x75ad('0xaf')]);}}break;case'ABANDONED':_0x2a8e85['outboundAbandonedCallsDay']+=0x1;_0x3e328c[_0x75ad('0xe0')]+=0x1;_0x3e328c['countglobal']=ut['totalGlobal'](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0xb,_0x75ad('0xe1'));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xe2'));if(ut['totalGlobal'](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0xf,_0x75ad('0xaa'));rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xe2'));}else{if(_0x3e328c[_0x75ad('0xe3')]>=_0x2a8e85[_0x75ad('0xe4')]){rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xe2'));}else{rpcDb[_0x75ad('0xcb')](ut[_0x75ad('0xad')](_0x3e328c,'countabandonedretry',_0x2a8e85[_0x75ad('0xe5')]),_0x3e328c[_0x75ad('0xae')],_0x3e328c[_0x75ad('0xaf')]);}}break;case'18':_0x2a8e85['outboundUnknownCallsDay']+=0x1;_0x3e328c[_0x75ad('0xe6')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut[_0x75ad('0xa3')](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x12,_0x5c332e[_0x75ad('0xe7')]||_0x5c332e['dialstatus']);ami[_0x75ad('0x25')](_0x75ad('0xe8'),ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xe9')));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xea'));if(ut['totalGlobal'](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut['cloneAction'](_0x3e328c,0xf,'Global');rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xea'));}else{rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xea'));}delete this[_0x75ad('0x16')][_0x5c332e['linkedid']];break;case'19':_0x2a8e85[_0x75ad('0xeb')]+=0x1;_0x3e328c[_0x75ad('0xa2')]=ut[_0x75ad('0xa3')](_0x3e328c);ut[_0x75ad('0x8f')](_0x3e328c,0x13,_0x5c332e[_0x75ad('0xe7')]||_0x5c332e[_0x75ad('0xec')]);ami[_0x75ad('0x25')]('custom:amd',ut[_0x75ad('0xa6')](_0x3e328c,_0x75ad('0xe9')));rpcDb[_0x75ad('0x94')](_0x3e328c,_0x75ad('0xed'));if(ut[_0x75ad('0xa3')](_0x3e328c)>=_0x2a8e85['dialGlobalMaxRetry']){_0x1cab92=ut[_0x75ad('0xa9')](_0x3e328c,0xf,'Global');rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xed'));}else{rpcDb[_0x75ad('0x97')](_0x3e328c,_0x75ad('0xed'));}delete this[_0x75ad('0x16')][_0x5c332e[_0x75ad('0xc4')]];break;default:if(_0x3e328c[_0x75ad('0x72')]){ut['decrementTalkink'](_0x2a8e85,'[default]');ut[_0x75ad('0x7e')](_0x75ad('0xee')+_0x2a8e85[_0x75ad('0x28')],_0x5c332e);}_0x2a8e85[_0x75ad('0xeb')]+=0x1;_0x3e328c['countglobal']=ut[_0x75ad('0xa3')](_0x3e328c);ut['logCustomer'](_0x3e328c,0xc,_0x5c332e[_0x75ad('0xe7')]||_0x5c332e[_0x75ad('0xec')]);rpcDb['createCustomerHistory'](_0x3e328c,_0x75ad('0xef'));if(ut[_0x75ad('0xa3')](_0x3e328c)>=_0x2a8e85[_0x75ad('0xa8')]){_0x1cab92=ut['cloneAction'](_0x3e328c,0xf,_0x75ad('0xaa'));rpcDb[_0x75ad('0x97')](_0x1cab92,_0x75ad('0xf0'));}else{rpcDb['createCustomerFinal'](_0x3e328c,_0x75ad('0xf0'));}delete this[_0x75ad('0x16')][_0x5c332e[_0x75ad('0xc4')]];}if(!(_0x3e328c[_0x75ad('0x72')]&&_0x292bf9==='16')){ut[_0x75ad('0x7c')](_0x2a8e85,_0x75ad('0xf1'));logger[_0x75ad('0x6c')](_0x75ad('0xf2'),_0x3e328c[_0x75ad('0xb2')],'\x20Queue',_0x2a8e85['name'],_0x75ad('0x70'),_0x2a8e85[_0x75ad('0x4f')]);}if(_0x292bf9!==_0x75ad('0xf3')){delete this[_0x75ad('0x16')][_0x5c332e[_0x75ad('0xc4')]];delete this[_0x75ad('0x16')][_0x5c332e[_0x75ad('0xf4')]];}}};Preview['prototype'][_0x75ad('0xf5')]=function(_0xead669,_0xbccfc5,_0x2c1a69){if(_[_0x75ad('0xf6')](_0xbccfc5)&&_0x75ad('0xf7')!==typeof _0xbccfc5){return;}if(_[_0x75ad('0xf6')](_0x2c1a69)&&'object'!==typeof _0x2c1a69){return;}switch(_0x2c1a69[_0x75ad('0xf8')]){case'0':ut['logAgent'](_0xead669,0x0,_0x75ad('0xa4'));rpcDb['createAgentHistory'](_0xead669,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x75ad('0xf9')](_0xead669,0x3,_0x75ad('0xcf'));rpcDb[_0x75ad('0xfa')](_0xead669,_0x75ad('0xfb'));break;case'5':ut[_0x75ad('0xf9')](_0xead669,0x5,'Busy');rpcDb['createAgentHistory'](_0xead669,_0x75ad('0xfc'));break;case'8':ut[_0x75ad('0xf9')](_0xead669,0x8,_0x75ad('0xfd'));rpcDb['createAgentHistory'](_0xead669,_0x75ad('0xfe'));break;case'22':ut['logAgent'](_0xead669,0x16,_0x75ad('0xff'));rpcDb['createAgentHistory'](_0xead669,_0x75ad('0x100'));break;default:ut['logAgent'](_0xead669,0xc,_0x2c1a69[_0x75ad('0xf8')]);rpcDb['createAgentHistory'](_0xead669,_0x75ad('0xfe'));}ut[_0x75ad('0x7c')](_0xbccfc5,'[callProgressDetectingAgent]');logger[_0x75ad('0x6c')](_0x75ad('0x101'),_0xead669['uniqueid'],_0x75ad('0xc3'),_0xbccfc5[_0x75ad('0x28')],_0x75ad('0x70'),_0xbccfc5[_0x75ad('0x4f')]);delete this[_0x75ad('0x16')][_0xead669[_0x75ad('0xb2')]];};Preview[_0x75ad('0xe')][_0x75ad('0x102')]=function(_0x4c83c4,_0x3f92d1,_0x39a989,_0x4ff062,_0x3b2a43){var _0x5f0935=this;return new BPromise(function(_0x2d395f,_0x1eb331){if(_['isNil'](_0x3f92d1)||_[_0x75ad('0x6b')](_0x3f92d1[_0x75ad('0x103')])||_[_0x75ad('0x6b')](_0x3f92d1[_0x75ad('0x103')]['phone'])||_[_0x75ad('0x6b')](_0x3f92d1[_0x75ad('0x76')])){_0x1eb331(ut[_0x75ad('0x4e')](_0x75ad('0x104'),_0x4ff062,_0x3b2a43));return;}var _0x4d560b=uuid['v4']();var _0x6f045c=_0x5f0935[_0x75ad('0x13')][_0x3f92d1[_0x75ad('0x6e')][_0x75ad('0x28')]];var _0x2e46de=_0x39a989?_0x5f0935['agents'][_0x39a989]['id']:undefined;_0x5f0935[_0x75ad('0x16')][_0x4d560b]=new Action(_0x3f92d1,_0x6f045c,_0x4d560b,_0x39a989,_0x2e46de);var _0x371beb=_0x5f0935['actions'][_0x4d560b];_0x371beb[_0x75ad('0xae')]=_0x4ff062;_0x371beb[_0x75ad('0xaf')]=_0x3b2a43;_0x371beb[_0x75ad('0x105')]=_0x39a989;if(_[_0x75ad('0x106')](_0x4c83c4)){_0x5f0935[_0x75ad('0x107')](_0x371beb,_0x6f045c,_0x3f92d1,_0x39a989)[_0x75ad('0x83')](function(_0xed4eb6){logger['info'](_0x75ad('0x108'),_0x75ad('0x109')+_0x371beb[_0x75ad('0x6f')]+_0x75ad('0x10a')+_0x371beb[_0x75ad('0x10b')],JSON[_0x75ad('0x56')](_0xed4eb6));ami[_0x75ad('0x25')](_0x75ad('0x10c'),ut[_0x75ad('0xa6')](_0x371beb,'called',_0x5f0935[_0x75ad('0x13')][_0x371beb[_0x75ad('0x6f')]]));_0x2d395f(ut[_0x75ad('0x4e')]('Calling'));})[_0x75ad('0x7a')](function(_0x5b0e07){ut[_0x75ad('0x5e')](_0x75ad('0x10d'),_0x5b0e07);_0x1eb331(ut[_0x75ad('0x4e')]('Call\x20failed',_0x4ff062,_0x3b2a43));});}else{_0x6f045c[_0x75ad('0x10e')]+=0x1;ut[_0x75ad('0x10f')](_0x371beb);rpcDb[_0x75ad('0x110')](_0x371beb,_0x75ad('0x111'));delete _0x5f0935[_0x75ad('0x16')][_0x4d560b];_0x1eb331(ut['message']('Contact\x20in\x20black\x20List',_0x4ff062,_0x3b2a43));}});};Preview[_0x75ad('0xe')][_0x75ad('0x9d')]=function(_0x3c1c2f){return!_['isNil'](_0x3c1c2f)&&!_[_0x75ad('0x6b')](_0x3c1c2f[_0x75ad('0x28')])&&!_[_0x75ad('0x6b')](_0x3c1c2f[_0x75ad('0x53')])&&_0x3c1c2f[_0x75ad('0x53')]&&!_[_0x75ad('0x6b')](this[_0x75ad('0x15')][util[_0x75ad('0x57')](_0x75ad('0x112'),_0x3c1c2f[_0x75ad('0x28')])])&&!_[_0x75ad('0x6b')](this['trunks'][util[_0x75ad('0x57')]('SIP/%s',_0x3c1c2f['name'])][_0x75ad('0x78')])&&(this[_0x75ad('0x15')][util['format']('SIP/%s',_0x3c1c2f[_0x75ad('0x28')])][_0x75ad('0x78')]===_0x75ad('0x113')||this[_0x75ad('0x15')][util['format'](_0x75ad('0x112'),_0x3c1c2f[_0x75ad('0x28')])][_0x75ad('0x78')]===_0x75ad('0x114'));};Preview[_0x75ad('0xe')][_0x75ad('0x88')]=function(_0x1ae14f,_0x12cbf3){var _0x28c94b=this;return new BPromise(function(_0x32b4fd,_0x404e59){_0x28c94b[_0x75ad('0x115')](_0x1ae14f,_0x12cbf3)[_0x75ad('0x83')](function(_0x4d89a6){_0x32b4fd(_[_0x75ad('0x73')](_0x4d89a6,['message']));})[_0x75ad('0x7a')](function(_0x436301){if(_0x436301[_0x75ad('0x116')]){rpcDb[_0x75ad('0x117')](_0x1ae14f);}if(_0x436301['active']){rpcDb[_0x75ad('0x8b')](_0x1ae14f);}_0x404e59(_[_0x75ad('0x73')](_0x436301,['message']));});});};Preview['prototype'][_0x75ad('0x115')]=function(_0x48d83d,_0x581c94){var _0x5f0820=this;return new BPromise(function(_0x5028f8,_0x972358){var _0x507bad,_0xc5ba8f;rpcDb[_0x75ad('0x118')](_0x48d83d)[_0x75ad('0x83')](function(_0x5ca50c){if(!_[_0x75ad('0x6b')](_0x5ca50c[0x0])){_0xc5ba8f=_0x5ca50c[0x0][_0x75ad('0x119')]?![]:!![];_0x507bad=_0x5ca50c[0x0][_0x75ad('0x119')]?!![]:![];_0x507bad=_0x581c94?!![]:_0x507bad;}var _0x3b724a=_0x5f0820['validateContact'](_0x5ca50c);if(_0x3b724a['isValid']){rpcDb[_0x75ad('0x11a')](_[_0x75ad('0x73')](_0x5ca50c[0x0],[_0x75ad('0x76'),_0x75ad('0x11b')]))['then'](function(_0x4b1aa2){_0x5f0820[_0x75ad('0x102')](_0x4b1aa2,_0x5ca50c[0x0],_0x581c94,_0xc5ba8f,_0x507bad)[_0x75ad('0x83')](function(_0x27f4a4){_0x5028f8(_0x27f4a4);})['catch'](function(_0x57aacf){_0x972358(_0x57aacf);});})[_0x75ad('0x7a')](function(_0x108cab){ut[_0x75ad('0x5e')](_0x75ad('0x11c'),_0x108cab);_0x972358(ut[_0x75ad('0x4e')](_0x75ad('0x11d'),_0xc5ba8f,_0x507bad));});}else{_0x972358(ut[_0x75ad('0x4e')](_0x3b724a['message'],_0xc5ba8f,_0x507bad));}})['catch'](function(_0x4abf76){ut['logger'](_0x75ad('0x11e'),_0x4abf76);_0x972358(ut[_0x75ad('0x4e')](_0x75ad('0x11d'),![],!![]));});});};Preview['prototype'][_0x75ad('0x11f')]=function(_0x8f36bd){if(_[_0x75ad('0x6b')](_0x8f36bd)||_[_0x75ad('0x106')](_0x8f36bd)||!_[_0x75ad('0x6b')](_0x8f36bd[0x0][_0x75ad('0x87')])&&_[_0x75ad('0x6b')](_0x8f36bd[0x0][_0x75ad('0x87')][_0x75ad('0x28')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x8f36bd);return{'isValid':![],'message':_0x75ad('0x120')};}var _0x4c2859=this[_0x75ad('0x13')][_0x8f36bd[0x0][_0x75ad('0x6e')][_0x75ad('0x28')]];_0x4c2859['message']=_0x75ad('0xa0');if(_['isNil'](_0x4c2859)){ut[_0x75ad('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x4c2859);return{'isValid':![],'message':_0x75ad('0x121')};}if(!this[_0x75ad('0x9d')](_0x4c2859['Trunk'])){ut[_0x75ad('0x5e')](_0x75ad('0x122'),'campaign\x20Name:\x20'+_0x4c2859[_0x75ad('0x28')]+_0x75ad('0x123'));if(!this[_0x75ad('0x9d')](_0x4c2859[_0x75ad('0x9e')])){ut[_0x75ad('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x4c2859[_0x75ad('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x75ad('0x124')};}}if(!ut[_0x75ad('0x9b')](_0x4c2859[_0x75ad('0x35')])){ut[_0x75ad('0x5e')]('[Preview][validateContact][Campaign\x20Active]',_0x4c2859[_0x75ad('0x28')]+_0x75ad('0x125'));return{'isValid':![],'message':_0x75ad('0x126')+_0x4c2859[_0x75ad('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x75ad('0xe')]['execCall']=function(_0x24b941,_0x3bb506,_0x19b8a0,_0x5300db){var _0x345f92=this;return new BPromise(function(_0x332fbe,_0x391f18){var _0x69fa0b=_0x24b941[_0x75ad('0xb2')];var _0x4903be=_0x345f92[_0x75ad('0x9d')](_0x3bb506[_0x75ad('0x52')])?util[_0x75ad('0x57')](_0x75ad('0x127'),_0x3bb506['Trunk']['name'],_[_0x75ad('0x6b')](_0x3bb506[_0x75ad('0x3a')])?'':_0x3bb506['dialPrefix'][_0x75ad('0x128')]()||'',_0x3bb506[_0x75ad('0x129')]>0x0?_0x19b8a0[_0x75ad('0x103')][_0x75ad('0x12a')]['substring'](_0x3bb506[_0x75ad('0x129')]):_0x19b8a0[_0x75ad('0x103')][_0x75ad('0x12a')]):util[_0x75ad('0x57')]('SIP/%s/%s%s',_[_0x75ad('0x6b')](_0x3bb506[_0x75ad('0x9e')])?_0x3bb506['Trunk']['name']:_0x3bb506[_0x75ad('0x9e')][_0x75ad('0x28')],_[_0x75ad('0x6b')](_0x3bb506['dialPrefix'])?'':_0x3bb506[_0x75ad('0x3a')][_0x75ad('0x128')]()||'',_0x3bb506['dialCutDigit']>0x0?_0x19b8a0[_0x75ad('0x103')][_0x75ad('0x12a')][_0x75ad('0x12b')](_0x3bb506[_0x75ad('0x129')]):_0x19b8a0[_0x75ad('0x103')][_0x75ad('0x12a')]);var _0x24ba10=_0x345f92[_0x75ad('0x9d')](_0x3bb506[_0x75ad('0x52')])?ut[_0x75ad('0x12c')](_0x3bb506[_0x75ad('0x52')][_0x75ad('0x54')],_0x3bb506[_0x75ad('0x37')],_0x3bb506['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x75ad('0x12d')](_0x3bb506[_0x75ad('0x38')],_0x3bb506[_0x75ad('0x12e')]):_0x3bb506['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x75ad('0x6b')](_0x3bb506[_0x75ad('0x9e')])?_0x3bb506['Trunk'][_0x75ad('0x54')]:_0x3bb506[_0x75ad('0x9e')]['callerid'],_0x3bb506[_0x75ad('0x37')],_0x3bb506[_0x75ad('0x12e')]>0x0?ut['getCallerIdRandom'](_0x3bb506['dialOriginateCallerIdNumber'],_0x3bb506[_0x75ad('0x12e')]):_0x3bb506['dialOriginateCallerIdNumber']);if(_0x24ba10){_0x24b941[_0x75ad('0x12f')]=ut['extractCalleridName'](_0x24ba10);_0x24b941[_0x75ad('0x130')]=ut[_0x75ad('0x131')](_0x24ba10);}var _0x1c9adf=ut['addVariables'](_0x3bb506,_0x19b8a0,_0x4903be,_0x24ba10,_0x69fa0b,_0x24b941);_['merge'](_0x24b941,ut[_0x75ad('0x132')](_0x1c9adf));_0x24b941[_0x75ad('0x8c')]=moment()['format'](_0x75ad('0x8d'));ami[_0x75ad('0x133')](ut[_0x75ad('0x134')](_0x24b941,_0x3bb506,_0x1c9adf,_0x24b941[_0x75ad('0xaf')],_0x5300db))[_0x75ad('0x83')](function(_0x4fe865){var _0x87f8b2=_0x24b941['channelAgent'];if(!_['isNil'](_0x87f8b2)){if(!_[_0x75ad('0x6b')](_0x345f92['agents'][_0x87f8b2])){_0x345f92['agents'][_0x87f8b2][_0x75ad('0x135')]=_0x24b941[_0x75ad('0x136')];emit(util['format']('user:%s',_0x345f92[_0x75ad('0x17')][_0x87f8b2]['name']),'user:agentconnect',{'destaccountcode':_0x345f92[_0x75ad('0x17')][_0x87f8b2][_0x75ad('0x137')],'destconnectedlinenum':_0x24b941[_0x75ad('0x136')]});}}_0x3bb506[_0x75ad('0x4f')]+=0x1;logger[_0x75ad('0x6c')](_0x75ad('0x138'),_0x69fa0b,_0x75ad('0xc3'),_0x3bb506[_0x75ad('0x28')],_0x75ad('0x70'),_0x3bb506[_0x75ad('0x4f')]);_0x332fbe(_0x4fe865);})[_0x75ad('0x7a')](function(_0x575d80){ut[_0x75ad('0xf9')](_0x24b941,0xe,'OriginateError');rpcDb[_0x75ad('0xfa')](_0x24b941,_0x75ad('0x139'));_0x391f18(_0x575d80);});});};Preview['prototype'][_0x75ad('0x13a')]=function(_0x4de5c0){if(this['actions'][_0x4de5c0[_0x75ad('0xc4')]]){this['actions'][_0x4de5c0['linkedid']][_0x75ad('0x79')]=_0x4de5c0[_0x75ad('0x79')];}};Preview['prototype'][_0x75ad('0x19')]=function(_0x1b7a8f){var _0x36f6d2=this;var _0xdb88f1=this[_0x75ad('0x16')][_0x1b7a8f[_0x75ad('0x13b')]];if(_0xdb88f1){if(_0xdb88f1[_0x75ad('0x105')]&&this[_0x75ad('0x17')][_0xdb88f1['lookAgent']]){ut[_0x75ad('0x13c')](_0xdb88f1,this[_0x75ad('0x17')][_0xdb88f1[_0x75ad('0x105')]][_0x75ad('0x28')],this[_0x75ad('0x17')][_0xdb88f1[_0x75ad('0x105')]]['id']);}var _0x5d8a57=_[_0x75ad('0x13d')](_0xdb88f1);_0x5d8a57[_0x75ad('0x13e')]=moment()[_0x75ad('0x57')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3d7cc1=_0x36f6d2[_0x75ad('0x13')][_0xdb88f1['queue']];if(ut[_0x75ad('0x13f')](_0x1b7a8f[_0x75ad('0x140')])){if(_0xdb88f1['unlockAgent']){rpcDb[_0x75ad('0x117')](_0xdb88f1['idContact']);}if(_0xdb88f1[_0x75ad('0xaf')]){rpcDb[_0x75ad('0x8b')](_0xdb88f1['idContact']);}ami[_0x75ad('0x25')](_0x75ad('0x141'),ut[_0x75ad('0xa6')](_0xdb88f1,_0x75ad('0x142'),this[_0x75ad('0x13')][_0xdb88f1['queue']]));this[_0x75ad('0xf5')](_0x5d8a57,_0x3d7cc1,_0x1b7a8f);}else{_0xdb88f1[_0x75ad('0x8c')]=moment()[_0x75ad('0x57')](_0x75ad('0x8d'));ut[_0x75ad('0xf9')](_0x5d8a57,0x4,'Answer');rpcDb[_0x75ad('0xfa')](_0x5d8a57,_0x75ad('0x143'));}}};Preview[_0x75ad('0xe')][_0x75ad('0x1b')]=function(_0x575bf2){var _0x1a8718=this;var _0x3c800b=this[_0x75ad('0x16')][_0x575bf2[_0x75ad('0xc4')]];var _0x1fc4d0;if(_0x3c800b){_0x1fc4d0=this[_0x75ad('0x13')][_0x3c800b[_0x75ad('0x6f')]];logger[_0x75ad('0x6c')]('[syncHangup][talking]',_0x575bf2[_0x75ad('0xc4')],'\x20Queue',_0x1fc4d0[_0x75ad('0x28')],_0x75ad('0x71'),_0x1fc4d0[_0x75ad('0x2d')]);}if(this[_0x75ad('0x16')][_0x575bf2[_0x75ad('0xc4')]]&&_0x575bf2['linkedid']!==_0x575bf2[_0x75ad('0xb2')]){if(_0x575bf2[_0x75ad('0x144')]==='16'&&this[_0x75ad('0x16')][_0x575bf2[_0x75ad('0xc4')]][_0x75ad('0x72')]){this[_0x75ad('0x145')](_0x575bf2,_0x575bf2[_0x75ad('0xc4')],_0x575bf2['cause']);}else if(this[_0x75ad('0x16')][_0x575bf2[_0x75ad('0xc4')]][_0x75ad('0x72')]){logger[_0x75ad('0x6c')](_0x75ad('0x146'),_0x575bf2[_0x75ad('0xc4')],_0x575bf2['cause'],'\x20Queue',_0x1fc4d0[_0x75ad('0x28')],_0x75ad('0x71'),_0x1fc4d0[_0x75ad('0x2d')]);this[_0x75ad('0x145')](_0x575bf2,_0x575bf2[_0x75ad('0xc4')],_0x575bf2['cause']);}}else if(_0x3c800b&&_[_0x75ad('0x6b')](_0x3c800b[_0x75ad('0x147')])&&_0x1fc4d0[_0x75ad('0x148')]&&_0x575bf2[_0x75ad('0xc4')]===_0x575bf2['uniqueid']&&_[_0x75ad('0x6b')](_0x575bf2[_0x75ad('0xf8')])&&_0x575bf2['cause']==='16'&&_0x575bf2[_0x75ad('0x149')]==='6'&&_[_0x75ad('0xf6')](_0x3c800b[_0x75ad('0x14a')])){if(_0x3c800b[_0x75ad('0xae')]){rpcDb[_0x75ad('0x117')](_0x3c800b[_0x75ad('0x10b')]);}if(_0x3c800b[_0x75ad('0xaf')]){rpcDb[_0x75ad('0x8b')](_0x3c800b[_0x75ad('0x10b')]);}_0x575bf2[_0x75ad('0xf8')]='22';this['callProgressDetectingAgent'](_0x3c800b,_0x1fc4d0,_0x575bf2);}else if(_0x3c800b&&_0x3c800b[_0x75ad('0x14a')]){if(_0x575bf2[_0x75ad('0x144')]==='16'&&this[_0x75ad('0x16')][_0x575bf2['linkedid']]['dialAnswer']){logger[_0x75ad('0x6c')](_0x75ad('0x14b'),_0x575bf2[_0x75ad('0xc4')],_0x575bf2[_0x75ad('0x144')],_0x75ad('0xc3'),_0x1fc4d0[_0x75ad('0x28')],_0x75ad('0x71'),_0x1fc4d0['pTalking']);this['callProgressDetectingCustomer'](_0x575bf2,_0x575bf2['linkedid'],_0x575bf2[_0x75ad('0x144')]);}else if(this[_0x75ad('0x16')][_0x575bf2['linkedid']][_0x75ad('0x72')]){logger[_0x75ad('0x6c')](_0x75ad('0x146'),_0x575bf2['linkedid'],_0x575bf2[_0x75ad('0x144')],_0x75ad('0xc3'),_0x1fc4d0[_0x75ad('0x28')],_0x75ad('0x71'),_0x1fc4d0[_0x75ad('0x2d')]);this['callProgressDetectingCustomer'](_0x575bf2,_0x575bf2['linkedid'],_0x575bf2[_0x75ad('0x144')]);}}};Preview[_0x75ad('0xe')][_0x75ad('0x1f')]=function(_0x39aee9){if(this[_0x75ad('0x16')][_0x39aee9['destlinkedid']]&&_0x39aee9[_0x75ad('0xf4')]!==_0x39aee9[_0x75ad('0x14c')]){this['callProgressDetectingCustomer'](_0x39aee9,_0x39aee9['destlinkedid'],_0x39aee9[_0x75ad('0xec')]);}};Preview[_0x75ad('0xe')]['syncHangupRequest']=function(_0x11d89c){if(this[_0x75ad('0x16')][_0x11d89c['linkedid']]&&_0x11d89c[_0x75ad('0xc4')]!==_0x11d89c['uniqueid']&&!this['actions'][_0x11d89c[_0x75ad('0xc4')]][_0x75ad('0x72')]){if(_0x11d89c['cause']==='1'){this[_0x75ad('0x145')](_0x11d89c,_0x11d89c[_0x75ad('0xc4')],_0x11d89c[_0x75ad('0x144')]);}}};Preview['prototype'][_0x75ad('0x14d')]=function(_0x3876ff,_0x378cf0,_0x5d39fd){if(this[_0x75ad('0x16')][_0x3876ff]){if(_[_0x75ad('0x6b')](this[_0x75ad('0x16')][_0x3876ff]['variables'])){this[_0x75ad('0x16')][_0x3876ff][_0x75ad('0x14e')]={};}this[_0x75ad('0x16')][_0x3876ff][_0x75ad('0x14e')][_0x378cf0]=_0x5d39fd;}};Preview[_0x75ad('0xe')]['syncVarSet']=function(_0xe8d2d4){try{if(!_[_0x75ad('0x6b')](_0xe8d2d4)){if(ut[_0x75ad('0x14f')](_[_0x75ad('0x150')](_0xe8d2d4[_0x75ad('0x151')])[0x0])){this[_0x75ad('0x14d')](_0xe8d2d4['uniqueid'],_['keys'](_0xe8d2d4[_0x75ad('0x151')])[0x0],_0xe8d2d4[_0x75ad('0x152')]);}}}catch(_0x2fc00c){logger[_0x75ad('0x153')]('[syncVarSet][Preview]',util['inspect'](_0x2fc00c,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x75ad('0x22')]=function(_0x35f8e2){if(_0x35f8e2){if(this[_0x75ad('0x16')][_0x35f8e2['transfertargetlinkedid']]){this[_0x75ad('0x16')][_0x35f8e2[_0x75ad('0x154')]]['transfer']=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x2051c7){if(_0x2051c7){if(this[_0x75ad('0x16')][_0x2051c7['transfererlinkedid']]){this[_0x75ad('0x16')][_0x2051c7[_0x75ad('0x155')]]['transfer']=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 26f48eb..4ae1a3c 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 _0xab0a=['rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','holdtime','queuecallerexitreason','create','getContactRecallMe','[GetContactRecallMe]\x20'];(function(_0x5c3eb6,_0x55d8a2){var _0x54ff0f=function(_0xdfd344){while(--_0xdfd344){_0x5c3eb6['push'](_0x5c3eb6['shift']());}};_0x54ff0f(++_0x55d8a2);}(_0xab0a,0xda));var _0xaab0=function(_0x521ac8,_0x1c8975){_0x521ac8=_0x521ac8-0x0;var _0x2c7e0a=_0xab0a[_0x521ac8];return _0x2c7e0a;};'use strict';var util=require(_0xaab0('0x0'));var BPromise=require(_0xaab0('0x1'));var logger=require(_0xaab0('0x2'))(_0xaab0('0x3'));var _=require(_0xaab0('0x4'));var cmHopper=require(_0xaab0('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xaab0('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xaab0('0x7'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xaab0('0x8'));function loggerCatch(_0x1e180e){return function(_0x409a81){logger[_0xaab0('0x9')](_0x1e180e,util['inspect'](_0x409a81,{'showHidden':![],'depth':null}));};}function create(_0x10e077){return BPromise[_0xaab0('0xa')]()['then'](cmHopperHistory[_0xaab0('0xb')](_0x10e077))[_0xaab0('0xc')](loggerCatch(_0xaab0('0xd')));}function createAgent(_0x3c7bba){return BPromise[_0xaab0('0xa')]()['then'](agentReportPreview['createHistory'](_0x3c7bba))[_0xaab0('0xc')](loggerCatch(_0xaab0('0xd')));}function moveContact(_0x2080e8){return BPromise['resolve']()[_0xaab0('0xe')](cmHopper[_0xaab0('0xf')](_0x2080e8,!![]))['catch'](loggerCatch(_0xaab0('0x10')));}exports[_0xaab0('0x11')]=function(_0x3c28d8){return BPromise[_0xaab0('0xa')]()['then'](cmHopperBlack[_0xaab0('0x11')](_0x3c28d8))[_0xaab0('0xc')](loggerCatch(_0xaab0('0x12')));};exports[_0xaab0('0x13')]=function(_0xc471a7){return BPromise['resolve']()[_0xaab0('0xe')](cmHopper['getContactPreview'](_0xc471a7))[_0xaab0('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0xaab0('0xb')]=function(_0x39c528,_0x749270){create(_0x39c528)[_0xaab0('0xc')](loggerCatch(_0x749270));moveContact(_0x39c528)[_0xaab0('0xc')](loggerCatch(_0x749270));};exports[_0xaab0('0x14')]=function(_0x195c72,_0x178ee3){createAgent(_0x195c72)[_0xaab0('0xc')](loggerCatch(_0x178ee3));};exports[_0xaab0('0x15')]=function(_0x43dc13,_0x2fabb1){create(_0x43dc13)[_0xaab0('0xc')](loggerCatch(_0x2fabb1));};exports[_0xaab0('0x16')]=function(_0x4ae069,_0xeb49d4){moveContact(_0x4ae069)['catch'](loggerCatch(_0xeb49d4));};exports[_0xaab0('0x17')]=function(_0x220bc1,_0x178a76,_0xcaadfb){if(_0x178a76){_0x220bc1['UserId']=null;}if(_0xcaadfb){_0x220bc1[_0xaab0('0x18')]=![];}return BPromise['resolve']()[_0xaab0('0xe')](cmHopper[_0xaab0('0x17')](_0x220bc1))[_0xaab0('0xc')](loggerCatch(_0xaab0('0x19')));};exports[_0xaab0('0x1a')]=function(_0x19288b){return BPromise[_0xaab0('0xa')]()[_0xaab0('0xe')](cmHopper['countReScheduled'](_0x19288b))[_0xaab0('0xc')](loggerCatch(_0xaab0('0x1b')));};exports[_0xaab0('0x1c')]=function(_0x2ec673){return BPromise[_0xaab0('0xa')]()[_0xaab0('0xe')](cmHopper['unlockContact']({'UserId':null},_0x2ec673,0x1))[_0xaab0('0xc')](loggerCatch(_0xaab0('0x1d')));};exports[_0xaab0('0x1e')]=function(_0x1c7b31){return BPromise[_0xaab0('0xa')]()[_0xaab0('0xe')](cmHopper[_0xaab0('0x1c')]({'active':![]},_0x1c7b31,0x1))[_0xaab0('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xaab0('0x1f')]=function(_0x47fab2){var _0x1bb086={};_0x1bb086[_0xaab0('0x20')]=_0x47fab2[_0xaab0('0x20')];_0x1bb086['uniqueid']=_0x47fab2['uniqueid'];_0x1bb086[_0xaab0('0x21')]=_0x47fab2[_0xaab0('0x21')];_0x1bb086[_0xaab0('0x22')]=_0x47fab2['calleridname'];_0x1bb086[_0xaab0('0x23')]=_0x47fab2[_0xaab0('0x23')];_0x1bb086[_0xaab0('0x24')]=_0x47fab2[_0xaab0('0x25')];_0x1bb086[_0xaab0('0x26')]=_0x47fab2[_0xaab0('0x25')];_0x1bb086[_0xaab0('0x27')]=0x1;_0x1bb086[_0xaab0('0x28')]=_0x47fab2[_0xaab0('0x29')];_0x1bb086[_0xaab0('0x2a')]=_0x47fab2[_0xaab0('0x2b')];_0x1bb086['context']=_0xaab0('0x2c');_0x1bb086[_0xaab0('0x2d')]=_0xaab0('0x2e');_0x1bb086[_0xaab0('0x2f')]=0x0;_0x1bb086['assigned']=0x1;_0x1bb086['lastAssignedTo']=_0x47fab2[_0xaab0('0x2b')];_0x1bb086[_0xaab0('0x30')]='COMPLETED';return BPromise[_0xaab0('0xa')]()[_0xaab0('0xe')](voiceQueueReport[_0xaab0('0x31')](_0x1bb086))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xaab0('0x32')]=function(_0x25e895,_0x55f607){return BPromise['resolve']()[_0xaab0('0xe')](cmHopper[_0xaab0('0x32')](_0x25e895,_0x55f607))[_0xaab0('0xc')](loggerCatch(_0xaab0('0x33')));};exports[_0xaab0('0x34')]=function(_0x34694b){return BPromise[_0xaab0('0xa')]()[_0xaab0('0xe')](cmHopper['rescheduleContact'](_0x34694b,!![],!![]))['catch'](loggerCatch(_0xaab0('0x35')));}; \ No newline at end of file +var _0x4d54=['exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x4d54,0x74));var _0x44d5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4d54[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x44d5('0x0'));var BPromise=require(_0x44d5('0x1'));var logger=require(_0x44d5('0x2'))(_0x44d5('0x3'));var _=require(_0x44d5('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x44d5('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x44d5('0x6'));var voiceQueueReport=require(_0x44d5('0x7'));function loggerCatch(_0xfddca){return function(_0x1dacc2){logger[_0x44d5('0x8')](_0xfddca,util[_0x44d5('0x9')](_0x1dacc2,{'showHidden':![],'depth':null}));};}function create(_0x50b600){return BPromise['resolve']()[_0x44d5('0xa')](cmHopperHistory[_0x44d5('0xb')](_0x50b600))[_0x44d5('0xc')](loggerCatch(_0x44d5('0xd')));}function createAgent(_0x1f3ac8){return BPromise['resolve']()[_0x44d5('0xa')](agentReportPreview['createHistory'](_0x1f3ac8))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x1494e5){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper['moveContactManagedDialer'](_0x1494e5,!![]))['catch'](loggerCatch(_0x44d5('0xf')));}exports[_0x44d5('0x10')]=function(_0x2656bf){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopperBlack[_0x44d5('0x10')](_0x2656bf))['catch'](loggerCatch(_0x44d5('0x11')));};exports[_0x44d5('0x12')]=function(_0x53bb8a){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper['getContactPreview'](_0x53bb8a))[_0x44d5('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0x44d5('0xb')]=function(_0x137d26,_0x683a0){create(_0x137d26)[_0x44d5('0xc')](loggerCatch(_0x683a0));moveContact(_0x137d26)['catch'](loggerCatch(_0x683a0));};exports[_0x44d5('0x13')]=function(_0x4a54c9,_0x54e246){createAgent(_0x4a54c9)['catch'](loggerCatch(_0x54e246));};exports[_0x44d5('0x14')]=function(_0x328369,_0x42a8c2){create(_0x328369)[_0x44d5('0xc')](loggerCatch(_0x42a8c2));};exports[_0x44d5('0x15')]=function(_0x183931,_0x13acac){moveContact(_0x183931)[_0x44d5('0xc')](loggerCatch(_0x13acac));};exports[_0x44d5('0x16')]=function(_0x3ecb36,_0x49f3b5,_0x341d3e){if(_0x49f3b5){_0x3ecb36[_0x44d5('0x17')]=null;}if(_0x341d3e){_0x3ecb36[_0x44d5('0x18')]=![];}return BPromise[_0x44d5('0xe')]()['then'](cmHopper[_0x44d5('0x16')](_0x3ecb36))[_0x44d5('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x44d5('0x19')]=function(_0x274abd){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper[_0x44d5('0x19')](_0x274abd))['catch'](loggerCatch(_0x44d5('0x1a')));};exports[_0x44d5('0x1b')]=function(_0x40c61f){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper[_0x44d5('0x1b')]({'UserId':null},_0x40c61f,0x1))[_0x44d5('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x44d5('0x1c')]=function(_0x2440a7){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper[_0x44d5('0x1b')]({'active':![]},_0x2440a7,0x1))['catch'](loggerCatch(_0x44d5('0x1d')));};exports['crateCustomerReportQueue']=function(_0x2749ca){var _0x229a82={};_0x229a82[_0x44d5('0x1e')]=_0x2749ca['type'];_0x229a82[_0x44d5('0x1f')]=_0x2749ca[_0x44d5('0x1f')];_0x229a82[_0x44d5('0x20')]=_0x2749ca[_0x44d5('0x20')];_0x229a82[_0x44d5('0x21')]=_0x2749ca[_0x44d5('0x21')];_0x229a82['queue']=_0x2749ca[_0x44d5('0x22')];_0x229a82[_0x44d5('0x23')]=_0x2749ca[_0x44d5('0x24')];_0x229a82['queuecallerleaveAt']=_0x2749ca[_0x44d5('0x24')];_0x229a82[_0x44d5('0x25')]=0x1;_0x229a82[_0x44d5('0x26')]=_0x2749ca[_0x44d5('0x27')];_0x229a82[_0x44d5('0x28')]=_0x2749ca[_0x44d5('0x29')];_0x229a82['context']=_0x44d5('0x2a');_0x229a82[_0x44d5('0x2b')]=_0x44d5('0x2c');_0x229a82['holdtime']=0x0;_0x229a82[_0x44d5('0x2d')]=0x1;_0x229a82[_0x44d5('0x2e')]=_0x2749ca['membername'];_0x229a82[_0x44d5('0x2f')]=_0x44d5('0x30');return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](voiceQueueReport[_0x44d5('0x31')](_0x229a82))['catch'](loggerCatch(_0x44d5('0x32')));};exports[_0x44d5('0x33')]=function(_0x4ace6b,_0x363233){return BPromise['resolve']()[_0x44d5('0xa')](cmHopper[_0x44d5('0x33')](_0x4ace6b,_0x363233))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x14db06){return BPromise[_0x44d5('0xe')]()[_0x44d5('0xa')](cmHopper['rescheduleContact'](_0x14db06,!![],!![]))['catch'](loggerCatch(_0x44d5('0x34')));}; \ 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 3d9371e..bf6ac91 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 _0xde7b=['sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','error','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','endtime','logAgent','ringtime','logLookAgent','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','state','responsetime','starttime','isFailure','Failure','BOOKED','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','motionChannel','voice','agentReadyId','not_inuse','status','reachable','push','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','recallme','UserId'];(function(_0x283248,_0x5bcbd6){var _0x4a25f7=function(_0x3baea0){while(--_0x3baea0){_0x283248['push'](_0x283248['shift']());}};_0x4a25f7(++_0x5bcbd6);}(_0xde7b,0x12c));var _0xbde7=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xde7b[_0x2070da];return _0x4f9fe1;};'use strict';var util=require(_0xbde7('0x0'));var _=require(_0xbde7('0x1'));var moment=require(_0xbde7('0x2'));var logger=require(_0xbde7('0x3'))(_0xbde7('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0xbde7('0x5');function getSeconds(_0x483ea6,_0x1a20a1){var _0x31191c=moment(_0x483ea6)[_0xbde7('0x6')](0x0);var _0x2b88a3=moment(_0x1a20a1)[_0xbde7('0x6')](0x0);return _0x31191c[_0xbde7('0x7')](_0x2b88a3,_0xbde7('0x8'));}exports[_0xbde7('0x9')]=function(_0x41a032){return function(_0x619aae){logger['error'](_0x41a032,util['inspect'](_0x619aae,{'showHidden':![],'depth':null}));};};exports[_0xbde7('0xa')]=function(_0x3187dd,_0x1e701e){logger[_0xbde7('0xb')](_0x3187dd,util[_0xbde7('0xc')](_0x1e701e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xbf40d9,_0x3f50f0){logger[_0xbde7('0xd')](_0xbf40d9,util['inspect'](_0x3f50f0,{'showHidden':![],'depth':null}));};exports[_0xbde7('0xe')]=function(_0x3c2d8d){return function(_0x677c16){logger[_0xbde7('0xb')](_0x3c2d8d,util[_0xbde7('0xc')](_0x677c16,{'showHidden':![],'depth':null}));};};exports[_0xbde7('0xf')]=function(_0xc22eb9,_0x431055,_0x285499){return{'message':_0xc22eb9,'unlock':_0x431055,'active':_0x285499};};exports[_0xbde7('0x10')]=function(_0x49256a,_0x446c93,_0x59f35f){if(!_['isUndefined'](_0x59f35f)&&_0xbde7('0x11')===typeof _0x59f35f&&!_[_0xbde7('0x12')](_0x59f35f)){if(!_['isUndefined'](_0x446c93)&&_0xbde7('0x11')===typeof _0x446c93&&!_[_0xbde7('0x12')](_0x446c93)){return util[_0xbde7('0x13')](_0xbde7('0x14'),_0x446c93,_0x59f35f);}return util[_0xbde7('0x13')]('\x22%s\x22\x20<%s>',_0x59f35f,_0x59f35f);}if(!_[_0xbde7('0x15')](_0x49256a)&&_0xbde7('0x11')===typeof _0x49256a&&!_[_0xbde7('0x12')](_0x49256a)){return _0x49256a;}return _0xbde7('0x16');};exports['isActive']=function(_0x49ab7c){if(_[_0xbde7('0x17')](_0x49ab7c)){return![];}return _0x49ab7c;};exports[_0xbde7('0x18')]=function(_0x7a1a5c,_0x79821f,_0xa6e4fb,_0x56140d,_0x21c03c,_0x4d6207){var _0x8bb8b5={'XMD-QUEUE':_0x79821f[_0xbde7('0x19')]?_0x79821f['Queue'][_0xbde7('0x1a')]:'','XMD-CALLERID':_0x56140d,'XMD-CALLERID-PREVIEW':_0x4d6207?util['format'](_0xbde7('0x14'),_0x4d6207[_0xbde7('0x1b')],_0x4d6207[_0xbde7('0x1c')]):_0x56140d,'XMD-DIALID':_0x21c03c,'XMD-CONTACTID':_0x79821f[_0xbde7('0x1d')],'XMD-CDRTYPE':_0xbde7('0x1e'),'CALLERID(all)':_0x56140d,'XMD-VOICEQUEUEID':_0x79821f[_0xbde7('0x1f')],'XMD-DIALCHANNEL':_0xa6e4fb,'XMD-DIALTIMEOUT':_0x7a1a5c[_0xbde7('0x20')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xbde7('0x21'),_0x7a1a5c[_0xbde7('0x22')]?'g':'',_[_0xbde7('0x12')](_0x7a1a5c['monitor_format'])?'':_0xbde7('0x23')),'XMD-DIALURL':_0x7a1a5c[_0xbde7('0x24')]||'','XMD-AGI':_0x7a1a5c['dialQueueProject']?util[_0xbde7('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x7a1a5c[_0xbde7('0x25')]):_0xbde7('0x26'),'XMD-AGIAFTER':_0x7a1a5c[_0xbde7('0x22')]?util[_0xbde7('0x13')](_0xbde7('0x27'),ipAgi,_0x7a1a5c[_0xbde7('0x22')]):_0xbde7('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x4d6207?_0x4d6207[_0xbde7('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x4d6207?_0x4d6207[_0xbde7('0x29')]:'','XMD-DESTINATION':_0xbde7('0x2a')};if(!_[_0xbde7('0x12')](_0x7a1a5c[_0xbde7('0x2b')])){_0x8bb8b5[util[_0xbde7('0x13')]('%s',_0xbde7('0x2c'))]=_0x7a1a5c['monitor_format'];_0x8bb8b5[util['format']('%s',_0xbde7('0x2d'))]=_0x21c03c;}if(_0x79821f&&_0x79821f['Contact']){for(var _0x40cf57 in _0x79821f['Contact']){if(_0x79821f[_0xbde7('0x2e')]['hasOwnProperty'](_0x40cf57)){if(!_[_0xbde7('0x17')](_0x79821f[_0xbde7('0x2e')][_0x40cf57])&&_0x40cf57!=='id'&&_0x40cf57!==_0xbde7('0x2f')&&_0x40cf57!==_0xbde7('0x30')&&_0x40cf57!=='updatedAt'){_0x8bb8b5[util['format'](_0xbde7('0x31'),_0xbde7('0x32'),_[_0xbde7('0x33')](_0x40cf57))]=_0x79821f['Contact'][_0x40cf57];}}}}return _0x8bb8b5;};exports[_0xbde7('0x34')]=function(_0x512a20){var _0x628279={};for(var _0x5ad187 in _0x512a20){if(_0x512a20['hasOwnProperty'](_0x5ad187)){_0x628279[util[_0xbde7('0x13')]('%s',_['toLower'](_0x5ad187))]=_0x512a20[_0x5ad187];}}return{'variables':_0x628279};};exports[_0xbde7('0x35')]=function(_0x35db65,_0x320de5){if(!_[_0xbde7('0x17')](_0x35db65)){if(_0x35db65[_0xbde7('0x36')](_0xbde7('0x37'))){if(_0x35db65[_0xbde7('0x37')]>0x0){_0x35db65[_0xbde7('0x37')]-=0x1;}else{logger[_0xbde7('0xd')](_0xbde7('0x38'),_0x320de5);}}}else{logger['error'](_0xbde7('0x39'),_0x320de5);}};exports[_0xbde7('0x3a')]=function(_0x3c66b6){var _0x13dd11=moment()[_0xbde7('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c66b6['state']=0xd;_0x3c66b6[_0xbde7('0x3b')]='Blacklist';_0x3c66b6['starttime']=_0x13dd11;_0x3c66b6['responsetime']=_0x13dd11;_0x3c66b6[_0xbde7('0x3c')]=_0x13dd11;};exports[_0xbde7('0x3d')]=function(_0x36113f,_0x3deaea,_0x2f8f71){var _0x29f7c8=moment()[_0xbde7('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x36113f['state']=_0x3deaea;_0x36113f[_0xbde7('0x3b')]=_0x2f8f71;_0x36113f['responsetime']=_0x29f7c8;_0x36113f[_0xbde7('0x3e')]=getSeconds(_0x36113f['responsetime'],_0x36113f['starttime']);};exports[_0xbde7('0x3f')]=function(_0x3923f6,_0x264ac8,_0x58cb68){_0x3923f6[_0xbde7('0x40')]=_0x264ac8;_0x3923f6['UserId']=_0x58cb68;};exports[_0xbde7('0x41')]=function(_0x24151a,_0x324d6d,_0x157bb3){var _0x294699=moment()[_0xbde7('0x13')](_0xbde7('0x42'));_0x24151a[_0xbde7('0x43')]=_0x324d6d;_0x24151a[_0xbde7('0x3b')]=_0x157bb3;_0x24151a['responsetime']=_0x24151a[_0xbde7('0x44')]?_0x24151a['responsetime']:_0x294699;_0x24151a['endtime']=_0x24151a[_0xbde7('0x3c')]?_0x24151a[_0xbde7('0x3c')]:_0x294699;_0x24151a[_0xbde7('0x3e')]=getSeconds(_0x24151a[_0xbde7('0x44')]||0x0,_0x24151a[_0xbde7('0x45')]||0x0);_0x24151a['talktime']=_0x24151a['answertime']?getSeconds(_0x24151a[_0xbde7('0x3c')],_0x24151a['answertime']):0x0;};exports[_0xbde7('0x46')]=function(_0x578a26){return _0x578a26===_0xbde7('0x47');};exports['variablesAction']=function(_0x5d7581,_0x4bb543,_0x26260a,_0x2d114c,_0x33cd3b){var _0x356a34=_0x2d114c?'RECALL':_0x5d7581[_0xbde7('0x1b')];_0x356a34=_0x33cd3b?_0xbde7('0x48'):_0x356a34;return{'actionid':_0x5d7581['uniqueid'],'action':'originate','channel':_0x5d7581[_0xbde7('0x49')],'callerid':util[_0xbde7('0x13')]('\x22%s\x22\x20<%s>',_0x356a34,_0x5d7581[_0xbde7('0x1c')]),'Exten':_0xbde7('0x2a'),'Context':_0xbde7('0x4a'),'Priority':'1','variable':_0x26260a,'timeout':(_0x4bb543[_0xbde7('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5d7581[_0xbde7('0x4c')]};};exports[_0xbde7('0x4d')]=function(_0x48cb88){return _0x48cb88[_0xbde7('0x4e')]+_0x48cb88[_0xbde7('0x4f')]+_0x48cb88[_0xbde7('0x50')]+_0x48cb88['countagentrejectretry']+_0x48cb88[_0xbde7('0x51')];};exports[_0xbde7('0x52')]=function(_0x4f39dc){var _0x250ba9=_['clone'](_0x4f39dc);_0x250ba9[_0xbde7('0x43')]=0xf;_0x250ba9[_0xbde7('0x3b')]=_0xbde7('0x53');return _0x250ba9;};exports['scheduledAt']=function(_0x33866e,_0x4c84fc,_0x3dfa72){var _0x225a1d={};_0x225a1d[_0x4c84fc]=_0x33866e[_0x4c84fc];_0x225a1d[_0xbde7('0x54')]=![];_0x225a1d[_0xbde7('0x55')]=moment()[_0xbde7('0x56')](_0x3dfa72,_0xbde7('0x57'))[_0xbde7('0x13')](_0xbde7('0x42'));_0x225a1d[_0xbde7('0x1d')]=_0x33866e[_0xbde7('0x1d')];_0x225a1d['ListId']=_0x33866e[_0xbde7('0x58')];_0x225a1d[_0xbde7('0x1f')]=_0x33866e['VoiceQueueId']||undefined;return _0x225a1d;};exports[_0xbde7('0x59')]=function(_0x51c858,_0x32445b){if(!_[_0xbde7('0x17')](_0x51c858)){if(_0x51c858[_0xbde7('0x5a')]>0x0){_0x51c858[_0xbde7('0x5a')]-=0x1;}else{logger[_0xbde7('0xd')](_0x32445b,_0xbde7('0x5b'));}}else{logger[_0xbde7('0xd')](_0x32445b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x290865){if(_0x290865<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4ebf9d,_0x45feae,_0x40893d){_0x4ebf9d[_0xbde7('0x5c')]=_0x45feae;_0x4ebf9d[_0xbde7('0x1a')]=_0x4ebf9d[_0xbde7('0x5d')];_0x4ebf9d[_0xbde7('0x5e')]=_0x4ebf9d[_0xbde7('0x49')];_0x4ebf9d[_0xbde7('0x5f')]=_0xbde7('0x60');if(_0x40893d){_0x4ebf9d['mandatoryDisposition']=_0x40893d['mandatoryDisposition'];}return _0x4ebf9d;};exports['buildAcw']=function(_0x19a200){var _0x2dcba={};_0x2dcba[_0xbde7('0x5d')]=_0x19a200[_0xbde7('0x5d')];_0x2dcba[_0xbde7('0x5e')]=_0x19a200[_0xbde7('0x49')];_0x2dcba[_0xbde7('0x4c')]=_0x19a200[_0xbde7('0x4c')];return _0x2dcba;};exports[_0xbde7('0x61')]=function(_0xed6fde){var _0x5e052c=[];for(var _0xc5729 in _0xed6fde){if(_0xed6fde[_0xbde7('0x36')](_0xc5729)){if(!_[_0xbde7('0x17')](_0xed6fde[_0xc5729])&&_0xed6fde[_0xc5729]['state']===_0xbde7('0x62')&&_0xed6fde[_0xc5729][_0xbde7('0x63')]===_0xbde7('0x64')){_0x5e052c[_0xbde7('0x65')](_0xed6fde[_0xc5729]['id']);}}}return _0x5e052c;};exports['getDiff']=function(_0x56e064){var _0x8473ad=moment()['milliseconds'](0x0);var _0x5d296f=moment(_0x56e064)['milliseconds'](0x0);return _0x8473ad[_0xbde7('0x7')](_0x5d296f,_0xbde7('0x8'));};exports[_0xbde7('0x66')]=function(_0x6d7176){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x6d7176[_0xbde7('0x1d')],'ListId':_0x6d7176['ListId'],'VoiceQueueId':_0x6d7176[_0xbde7('0x1f')]||undefined,'CampaignId':_0x6d7176['CampaignId']||undefined};};exports[_0xbde7('0x67')]=function(_0x5ca229){if(_0x5ca229==='uniqueid'||_0x5ca229===_0xbde7('0x68')||_0x5ca229===_0xbde7('0x5d')||_0x5ca229===_0xbde7('0x69')||_0x5ca229===_0xbde7('0x6a')||_0x5ca229===_0xbde7('0x6b')||_0x5ca229===_0xbde7('0x40')||_0x5ca229===_0xbde7('0x49')||_0x5ca229===_0xbde7('0x1b')||_0x5ca229===_0xbde7('0x54')||_0x5ca229===_0xbde7('0x1c')||_0x5ca229===_0xbde7('0x55')||_0x5ca229===_0xbde7('0x4e')||_0x5ca229==='countcongestionretry'||_0x5ca229===_0xbde7('0x50')||_0x5ca229===_0xbde7('0x6c')||_0x5ca229==='callback'||_0x5ca229==='callbackuniqueid'||_0x5ca229==='callbackat'||_0x5ca229===_0xbde7('0x6d')||_0x5ca229==='ContactId'||_0x5ca229===_0xbde7('0x58')||_0x5ca229===_0xbde7('0x6e')||_0x5ca229===_0xbde7('0x1f')||_0x5ca229===_0xbde7('0x6f')||_0x5ca229==='xmd-voicequeueid'||_0x5ca229===_0xbde7('0x70')||_0x5ca229===_0xbde7('0x71')||_0x5ca229===_0xbde7('0x72')||_0x5ca229==='xmd-dialurl'||_0x5ca229===_0xbde7('0x73')||_0x5ca229==='xmd-dialoptions'||_0x5ca229===_0xbde7('0x74')||_0x5ca229===_0xbde7('0x75')||_0x5ca229===_0xbde7('0x76')||_0x5ca229==='xmd-cdrtype'||_0x5ca229===_0xbde7('0x77')||_0x5ca229===_0xbde7('0x78')||_0x5ca229===_0xbde7('0x79')||_0x5ca229===_0xbde7('0x7a')||_0x5ca229===_0xbde7('0x7b')||_0x5ca229===_0xbde7('0x7c')||_0x5ca229==='rtpaudioqosjitterbridged'||_0x5ca229===_0xbde7('0x7d')||_0x5ca229==='rtpaudioqoslossbridged'||_0x5ca229===_0xbde7('0x7e')||_0x5ca229===_0xbde7('0x7f')||_0x5ca229===_0xbde7('0x7a')||_0x5ca229==='rtpaudioqosbridged'||_0x5ca229==='rtpaudioqosjitter'||_0x5ca229===_0xbde7('0x80')||_0x5ca229===_0xbde7('0x7d')||_0x5ca229==='rtpaudioqoslossbridged'||_0x5ca229===_0xbde7('0x7e')||_0x5ca229==='rtpaudioqosrttbridged'||_0x5ca229===_0xbde7('0x81')||_0x5ca229===_0xbde7('0x82')||_0x5ca229===_0xbde7('0x43')||_0x5ca229===_0xbde7('0x3b')){return![];}return!![];};exports['getCallerIdRandom']=function(_0xa31772,_0x2c29f9){var _0x291771,_0x2be742,_0x33d499;if(_0x2c29f9<=0x0){_0x2c29f9=0x1;}_0x291771=new RegExp(_0xbde7('0x83')+_0x2c29f9+'}$');_0x2be742=Math[_0xbde7('0x84')](0xa,_0x2c29f9-0x1);_0x33d499=Math[_0xbde7('0x84')](0xa,_0x2c29f9)-0x1;return util[_0xbde7('0x13')]('%s',_[_0xbde7('0x85')](_0xa31772,_0x291771,_[_0xbde7('0x86')](_0x2be742,_0x33d499)));};exports['extractCalleridName']=function(_0xce52cb){var _0x4c3963=_0xce52cb[_0xbde7('0x87')](/"(.*?)"/);return _0x4c3963?_0x4c3963[0x1]:_0xce52cb;};exports[_0xbde7('0x88')]=function(_0x4b4349){var _0x43d0e0=_0x4b4349['match'](/<(.*?)>/);return _0x43d0e0?_0x43d0e0[0x1]:_0x4b4349;}; \ No newline at end of file +var _0xf957=['XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','logAgent','responsetime','ringtime','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','match','lodash','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','error','logger','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt'];(function(_0x281a04,_0x21f405){var _0x548f71=function(_0x9f8e7c){while(--_0x9f8e7c){_0x281a04['push'](_0x281a04['shift']());}};_0x548f71(++_0x21f405);}(_0xf957,0xf0));var _0x7f95=function(_0x443311,_0xa639d4){_0x443311=_0x443311-0x0;var _0x802493=_0xf957[_0x443311];return _0x802493;};'use strict';var util=require('util');var _=require(_0x7f95('0x0'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x7f95('0x1'));var ipAgi=process[_0x7f95('0x2')][_0x7f95('0x3')]||'127.0.0.1';function getSeconds(_0x34687f,_0x38aec3){var _0x4c2d38=moment(_0x34687f)[_0x7f95('0x4')](0x0);var _0x5c1c9c=moment(_0x38aec3)[_0x7f95('0x4')](0x0);return _0x4c2d38[_0x7f95('0x5')](_0x5c1c9c,_0x7f95('0x6'));}exports['loggerCatch']=function(_0x4ab7f6){return function(_0x3055f3){logger[_0x7f95('0x7')](_0x4ab7f6,util['inspect'](_0x3055f3,{'showHidden':![],'depth':null}));};};exports[_0x7f95('0x8')]=function(_0x1072ab,_0x1818b1){logger[_0x7f95('0x9')](_0x1072ab,util[_0x7f95('0xa')](_0x1818b1,{'showHidden':![],'depth':null}));};exports[_0x7f95('0xb')]=function(_0x2572c1,_0x50416a){logger[_0x7f95('0x7')](_0x2572c1,util[_0x7f95('0xa')](_0x50416a,{'showHidden':![],'depth':null}));};exports[_0x7f95('0xc')]=function(_0x557ddd){return function(_0x426363){logger[_0x7f95('0x9')](_0x557ddd,util['inspect'](_0x426363,{'showHidden':![],'depth':null}));};};exports[_0x7f95('0xd')]=function(_0x15f779,_0x236f61,_0x498b1d){return{'message':_0x15f779,'unlock':_0x236f61,'active':_0x498b1d};};exports[_0x7f95('0xe')]=function(_0xef20ed,_0x58480c,_0x37ad24){if(!_[_0x7f95('0xf')](_0x37ad24)&&_0x7f95('0x10')===typeof _0x37ad24&&!_[_0x7f95('0x11')](_0x37ad24)){if(!_[_0x7f95('0xf')](_0x58480c)&&_0x7f95('0x10')===typeof _0x58480c&&!_[_0x7f95('0x11')](_0x58480c)){return util[_0x7f95('0x12')](_0x7f95('0x13'),_0x58480c,_0x37ad24);}return util[_0x7f95('0x12')]('\x22%s\x22\x20<%s>',_0x37ad24,_0x37ad24);}if(!_['isUndefined'](_0xef20ed)&&'string'===typeof _0xef20ed&&!_[_0x7f95('0x11')](_0xef20ed)){return _0xef20ed;}return _0x7f95('0x14');};exports[_0x7f95('0x15')]=function(_0x24a34f){if(_[_0x7f95('0x16')](_0x24a34f)){return![];}return _0x24a34f;};exports[_0x7f95('0x17')]=function(_0x291999,_0x4df526,_0x2b19f3,_0xbed8a9,_0x452740,_0x534830){var _0x1d8b03={'XMD-QUEUE':_0x4df526['Queue']?_0x4df526[_0x7f95('0x18')][_0x7f95('0x19')]:'','XMD-CALLERID':_0xbed8a9,'XMD-CALLERID-PREVIEW':_0x534830?util[_0x7f95('0x12')](_0x7f95('0x13'),_0x534830[_0x7f95('0x1a')],_0x534830['calleridnum']):_0xbed8a9,'XMD-DIALID':_0x452740,'XMD-CONTACTID':_0x4df526[_0x7f95('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xbed8a9,'XMD-VOICEQUEUEID':_0x4df526[_0x7f95('0x1c')],'XMD-DIALCHANNEL':_0x2b19f3,'XMD-DIALTIMEOUT':_0x291999[_0x7f95('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x7f95('0x1e'),_0x291999[_0x7f95('0x1f')]?'g':'',_[_0x7f95('0x11')](_0x291999['monitor_format'])?'':_0x7f95('0x20')),'XMD-DIALURL':_0x291999['dialPreviewUrl']||'','XMD-AGI':_0x291999[_0x7f95('0x21')]?util[_0x7f95('0x12')](_0x7f95('0x22'),ipAgi,_0x291999[_0x7f95('0x21')]):'NONE','XMD-AGIAFTER':_0x291999['dialQueueProject2']?util[_0x7f95('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x291999[_0x7f95('0x1f')]):_0x7f95('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x534830?_0x534830['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x534830?_0x534830['originatecalleridname']:'','XMD-DESTINATION':_0x7f95('0x24')};if(!_['isEmpty'](_0x291999[_0x7f95('0x25')])){_0x1d8b03[util['format']('%s',_0x7f95('0x26'))]=_0x291999[_0x7f95('0x25')];_0x1d8b03[util[_0x7f95('0x12')]('%s',_0x7f95('0x27'))]=_0x452740;}if(_0x4df526&&_0x4df526[_0x7f95('0x28')]){for(var _0x37a761 in _0x4df526[_0x7f95('0x28')]){if(_0x4df526[_0x7f95('0x28')]['hasOwnProperty'](_0x37a761)){if(!_[_0x7f95('0x16')](_0x4df526['Contact'][_0x37a761])&&_0x37a761!=='id'&&_0x37a761!==_0x7f95('0x29')&&_0x37a761!==_0x7f95('0x2a')&&_0x37a761!==_0x7f95('0x2b')){_0x1d8b03[util[_0x7f95('0x12')]('%s%s',_0x7f95('0x2c'),_[_0x7f95('0x2d')](_0x37a761))]=_0x4df526[_0x7f95('0x28')][_0x37a761];}}}}return _0x1d8b03;};exports[_0x7f95('0x2e')]=function(_0x3debec){var _0x11de6e={};for(var _0x5c96cb in _0x3debec){if(_0x3debec[_0x7f95('0x2f')](_0x5c96cb)){_0x11de6e[util[_0x7f95('0x12')]('%s',_[_0x7f95('0x30')](_0x5c96cb))]=_0x3debec[_0x5c96cb];}}return{'variables':_0x11de6e};};exports['updateOriginated']=function(_0x2b7628,_0x434d94){if(!_[_0x7f95('0x16')](_0x2b7628)){if(_0x2b7628[_0x7f95('0x2f')]('originated')){if(_0x2b7628['originated']>0x0){_0x2b7628[_0x7f95('0x31')]-=0x1;}else{logger['error'](_0x7f95('0x32'),_0x434d94);}}}else{logger[_0x7f95('0x7')](_0x7f95('0x33'),_0x434d94);}};exports[_0x7f95('0x34')]=function(_0x44b1ee){var _0x32c471=moment()[_0x7f95('0x12')](_0x7f95('0x35'));_0x44b1ee[_0x7f95('0x36')]=0xd;_0x44b1ee[_0x7f95('0x37')]=_0x7f95('0x38');_0x44b1ee[_0x7f95('0x39')]=_0x32c471;_0x44b1ee['responsetime']=_0x32c471;_0x44b1ee['endtime']=_0x32c471;};exports[_0x7f95('0x3a')]=function(_0x578e87,_0x5ed431,_0x72b85f){var _0x4d299a=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x578e87[_0x7f95('0x36')]=_0x5ed431;_0x578e87[_0x7f95('0x37')]=_0x72b85f;_0x578e87[_0x7f95('0x3b')]=_0x4d299a;_0x578e87[_0x7f95('0x3c')]=getSeconds(_0x578e87['responsetime'],_0x578e87['starttime']);};exports['logLookAgent']=function(_0x3e5258,_0x1c54b2,_0x27423a){_0x3e5258[_0x7f95('0x3d')]=_0x1c54b2;_0x3e5258[_0x7f95('0x3e')]=_0x27423a;};exports[_0x7f95('0x3f')]=function(_0x37ed6f,_0x4722ce,_0x1981d6){var _0xf6b3a6=moment()[_0x7f95('0x12')](_0x7f95('0x35'));_0x37ed6f[_0x7f95('0x36')]=_0x4722ce;_0x37ed6f[_0x7f95('0x37')]=_0x1981d6;_0x37ed6f['responsetime']=_0x37ed6f[_0x7f95('0x3b')]?_0x37ed6f[_0x7f95('0x3b')]:_0xf6b3a6;_0x37ed6f['endtime']=_0x37ed6f[_0x7f95('0x40')]?_0x37ed6f[_0x7f95('0x40')]:_0xf6b3a6;_0x37ed6f['ringtime']=getSeconds(_0x37ed6f['responsetime']||0x0,_0x37ed6f[_0x7f95('0x39')]||0x0);_0x37ed6f[_0x7f95('0x41')]=_0x37ed6f[_0x7f95('0x42')]?getSeconds(_0x37ed6f['endtime'],_0x37ed6f[_0x7f95('0x42')]):0x0;};exports[_0x7f95('0x43')]=function(_0x24ee9c){return _0x24ee9c===_0x7f95('0x44');};exports[_0x7f95('0x45')]=function(_0xb31de1,_0x1ad668,_0x471287,_0x4189ec,_0x2a1b0f){var _0x436e79=_0x4189ec?_0x7f95('0x46'):_0xb31de1[_0x7f95('0x1a')];_0x436e79=_0x2a1b0f?_0x7f95('0x47'):_0x436e79;return{'actionid':_0xb31de1[_0x7f95('0x48')],'action':'originate','channel':_0xb31de1[_0x7f95('0x49')],'callerid':util[_0x7f95('0x12')]('\x22%s\x22\x20<%s>',_0x436e79,_0xb31de1[_0x7f95('0x4a')]),'Exten':_0x7f95('0x24'),'Context':_0x7f95('0x4b'),'Priority':'1','variable':_0x471287,'timeout':(_0x1ad668[_0x7f95('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0xb31de1[_0x7f95('0x48')]};};exports[_0x7f95('0x4d')]=function(_0x1eb308){return _0x1eb308[_0x7f95('0x4e')]+_0x1eb308[_0x7f95('0x4f')]+_0x1eb308[_0x7f95('0x50')]+_0x1eb308[_0x7f95('0x51')]+_0x1eb308[_0x7f95('0x52')];};exports[_0x7f95('0x53')]=function(_0x46a43d){var _0xfbb17f=_['clone'](_0x46a43d);_0xfbb17f[_0x7f95('0x36')]=0xf;_0xfbb17f[_0x7f95('0x37')]=_0x7f95('0x54');return _0xfbb17f;};exports[_0x7f95('0x55')]=function(_0x254ead,_0x25972f,_0x2fff59){var _0x3e0d19={};_0x3e0d19[_0x25972f]=_0x254ead[_0x25972f];_0x3e0d19[_0x7f95('0x56')]=![];_0x3e0d19[_0x7f95('0x57')]=moment()[_0x7f95('0x58')](_0x2fff59,_0x7f95('0x59'))[_0x7f95('0x12')](_0x7f95('0x35'));_0x3e0d19['ContactId']=_0x254ead[_0x7f95('0x1b')];_0x3e0d19[_0x7f95('0x5a')]=_0x254ead['ListId'];_0x3e0d19[_0x7f95('0x1c')]=_0x254ead[_0x7f95('0x1c')]||undefined;return _0x3e0d19;};exports[_0x7f95('0x5b')]=function(_0x31845f,_0x397a47){if(!_[_0x7f95('0x16')](_0x31845f)){if(_0x31845f[_0x7f95('0x5c')]>0x0){_0x31845f[_0x7f95('0x5c')]-=0x1;}else{logger[_0x7f95('0x7')](_0x397a47,_0x7f95('0x5d'));}}else{logger[_0x7f95('0x7')](_0x397a47,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x7f95('0x5e')]=function(_0x1922b0){if(_0x1922b0<=0x0){return!![];}return![];};exports['buildObj']=function(_0x120ff8,_0x325041,_0x55493b){_0x120ff8[_0x7f95('0x5f')]=_0x325041;_0x120ff8[_0x7f95('0x19')]=_0x120ff8[_0x7f95('0x60')];_0x120ff8[_0x7f95('0x61')]=_0x120ff8[_0x7f95('0x49')];_0x120ff8['motionChannel']=_0x7f95('0x62');if(_0x55493b){_0x120ff8[_0x7f95('0x63')]=_0x55493b['mandatoryDisposition'];}return _0x120ff8;};exports[_0x7f95('0x64')]=function(_0x35985d){var _0x5e505a={};_0x5e505a[_0x7f95('0x60')]=_0x35985d[_0x7f95('0x60')];_0x5e505a[_0x7f95('0x61')]=_0x35985d[_0x7f95('0x49')];_0x5e505a['uniqueid']=_0x35985d[_0x7f95('0x48')];return _0x5e505a;};exports['agentReadyId']=function(_0x175991){var _0x8cd87d=[];for(var _0xa93904 in _0x175991){if(_0x175991['hasOwnProperty'](_0xa93904)){if(!_['isNil'](_0x175991[_0xa93904])&&_0x175991[_0xa93904][_0x7f95('0x36')]===_0x7f95('0x65')&&_0x175991[_0xa93904][_0x7f95('0x66')]===_0x7f95('0x67')){_0x8cd87d[_0x7f95('0x68')](_0x175991[_0xa93904]['id']);}}}return _0x8cd87d;};exports[_0x7f95('0x69')]=function(_0x31670c){var _0x1c8623=moment()[_0x7f95('0x4')](0x0);var _0x2e8d96=moment(_0x31670c)[_0x7f95('0x4')](0x0);return _0x1c8623[_0x7f95('0x5')](_0x2e8d96,_0x7f95('0x6'));};exports[_0x7f95('0x6a')]=function(_0x1a9aee){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a9aee['ContactId'],'ListId':_0x1a9aee[_0x7f95('0x5a')],'VoiceQueueId':_0x1a9aee['VoiceQueueId']||undefined,'CampaignId':_0x1a9aee[_0x7f95('0x6b')]||undefined};};exports[_0x7f95('0x6c')]=function(_0x1728bd){if(_0x1728bd===_0x7f95('0x48')||_0x1728bd==='idContact'||_0x1728bd==='queue'||_0x1728bd===_0x7f95('0x6d')||_0x1728bd===_0x7f95('0x6e')||_0x1728bd===_0x7f95('0x6f')||_0x1728bd===_0x7f95('0x3d')||_0x1728bd==='channelAgent'||_0x1728bd==='calleridname'||_0x1728bd===_0x7f95('0x56')||_0x1728bd===_0x7f95('0x4a')||_0x1728bd===_0x7f95('0x57')||_0x1728bd===_0x7f95('0x4e')||_0x1728bd==='countcongestionretry'||_0x1728bd===_0x7f95('0x50')||_0x1728bd===_0x7f95('0x70')||_0x1728bd===_0x7f95('0x71')||_0x1728bd===_0x7f95('0x72')||_0x1728bd==='callbackat'||_0x1728bd===_0x7f95('0x73')||_0x1728bd===_0x7f95('0x1b')||_0x1728bd===_0x7f95('0x5a')||_0x1728bd===_0x7f95('0x3e')||_0x1728bd===_0x7f95('0x1c')||_0x1728bd===_0x7f95('0x74')||_0x1728bd===_0x7f95('0x75')||_0x1728bd===_0x7f95('0x76')||_0x1728bd==='xmd-phone'||_0x1728bd===_0x7f95('0x77')||_0x1728bd===_0x7f95('0x78')||_0x1728bd===_0x7f95('0x79')||_0x1728bd===_0x7f95('0x7a')||_0x1728bd==='xmd-dialid'||_0x1728bd===_0x7f95('0x7b')||_0x1728bd==='xmd-contactid'||_0x1728bd==='xmd-cdrtype'||_0x1728bd===_0x7f95('0x7c')||_0x1728bd===_0x7f95('0x7d')||_0x1728bd===_0x7f95('0x7e')||_0x1728bd==='rtpaudioqos'||_0x1728bd===_0x7f95('0x7f')||_0x1728bd===_0x7f95('0x80')||_0x1728bd===_0x7f95('0x81')||_0x1728bd===_0x7f95('0x82')||_0x1728bd==='rtpaudioqoslossbridged'||_0x1728bd===_0x7f95('0x83')||_0x1728bd===_0x7f95('0x84')||_0x1728bd===_0x7f95('0x85')||_0x1728bd===_0x7f95('0x7f')||_0x1728bd===_0x7f95('0x80')||_0x1728bd==='rtpaudioqosjitterbridged'||_0x1728bd===_0x7f95('0x82')||_0x1728bd===_0x7f95('0x86')||_0x1728bd===_0x7f95('0x83')||_0x1728bd===_0x7f95('0x84')||_0x1728bd===_0x7f95('0x87')||_0x1728bd==='bridgepvtcallid'||_0x1728bd===_0x7f95('0x36')||_0x1728bd===_0x7f95('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4e05dc,_0x1516e4){var _0x3b17a1,_0x2aaece,_0x5e9e5c;if(_0x1516e4<=0x0){_0x1516e4=0x1;}_0x3b17a1=new RegExp(_0x7f95('0x88')+_0x1516e4+'}$');_0x2aaece=Math[_0x7f95('0x89')](0xa,_0x1516e4-0x1);_0x5e9e5c=Math[_0x7f95('0x89')](0xa,_0x1516e4)-0x1;return util['format']('%s',_[_0x7f95('0x8a')](_0x4e05dc,_0x3b17a1,_[_0x7f95('0x8b')](_0x2aaece,_0x5e9e5c)));};exports[_0x7f95('0x8c')]=function(_0x31b200){var _0x5e3cda=_0x31b200[_0x7f95('0x8d')](/"(.*?)"/);return _0x5e3cda?_0x5e3cda[0x1]:_0x31b200;};exports['extractCalleridNumber']=function(_0x259bb2){var _0x97b0e6=_0x259bb2['match'](/<(.*?)>/);return _0x97b0e6?_0x97b0e6[0x1]:_0x259bb2;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f0c3b55..e522d38 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 _0xc47b=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xc47b,0x138));var _0xbc47=function(_0x56f4dd,_0x5b444e){_0x56f4dd=_0x56f4dd-0x0;var _0x5dc63e=_0xc47b[_0x56f4dd];return _0x5dc63e;};'use strict';exports[_0xbc47('0x0')]={'queue':{'type':_0xbc47('0x1'),'required':!![]},'interface':{'type':_0xbc47('0x1'),'required':!![]},'membername':{'type':_0xbc47('0x1'),'required':!![]},'penalty':{'type':_0xbc47('0x2'),'required':![]},'paused':{'type':_0xbc47('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xbc47('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xbc47('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xbc47('0x3')},'reason':{'type':'string','required':![]}};exports[_0xbc47('0x5')]={'module':{'type':'string','required':![]}};exports[_0xbc47('0x6')]={'uniqueid':{'type':_0xbc47('0x1'),'required':!![]}};exports[_0xbc47('0x7')]={'uniqueid':{'type':_0xbc47('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0xbc47('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xbc47('0x9')]={'uniqueid':{'type':_0xbc47('0x1'),'required':!![]},'exten':{'type':_0xbc47('0x1'),'required':!![]},'context':{'type':_0xbc47('0x1')}}; \ No newline at end of file +var _0x7255=['reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','boolean','queuepause'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x7255,0x17c));var _0x5725=function(_0x205425,_0x5f30e6){_0x205425=_0x205425-0x0;var _0x4079b7=_0x7255[_0x205425];return _0x4079b7;};'use strict';exports[_0x5725('0x0')]={'queue':{'type':_0x5725('0x1'),'required':!![]},'interface':{'type':_0x5725('0x1'),'required':!![]},'membername':{'type':_0x5725('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x5725('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x5725('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x5725('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x5725('0x2')},'reason':{'type':_0x5725('0x1'),'required':![]}};exports[_0x5725('0x4')]={'module':{'type':_0x5725('0x1'),'required':![]}};exports[_0x5725('0x5')]={'uniqueid':{'type':_0x5725('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x5725('0x1'),'required':!![]},'filename':{'type':_0x5725('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0x5725('0x1')}};exports[_0x5725('0x6')]={'uniqueid':{'type':_0x5725('0x1'),'required':!![]}};exports[_0x5725('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index c023803..8ba89c2 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 _0xe7f9=['triggers','templates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','outbound','voiceExtensions','channels','outboundChannels','settings','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','format','SIP/%s','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','name','isUndefined','mergeFromDatabase','initTelephones','initVoiceQueues'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe7f9,0xf9));var _0x9e7f=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xe7f9[_0x55d829];return _0x52163b;};'use strict';var BPromise=require(_0x9e7f('0x0'));var util=require('util');var _=require(_0x9e7f('0x1'));var moment=require(_0x9e7f('0x2'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x9e7f('0x3'));var VoiceQueue=require(_0x9e7f('0x4'));var Trigger=require(_0x9e7f('0x5'));var Template=require(_0x9e7f('0x6'));var Campaign=require(_0x9e7f('0x7'));var VoiceExtension=require(_0x9e7f('0x8'));var ZendeskAccount=require(_0x9e7f('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x9e7f('0xa'));var ZohoAccount=require(_0x9e7f('0xb'));var DeskAccount=require(_0x9e7f('0xc'));var VtigerAccount=require(_0x9e7f('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x9e7f('0xe'));var FreshsalesAccount=require(_0x9e7f('0xf'));var FaxAccount=require(_0x9e7f('0x10'));var Realtime=function(){this[_0x9e7f('0x11')]={};this[_0x9e7f('0x12')]={};this[_0x9e7f('0x13')]={};this[_0x9e7f('0x14')]={};this['triggers']={};this[_0x9e7f('0x15')]={};this['templates']={};this[_0x9e7f('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9e7f('0x17')]={};this[_0x9e7f('0x18')]={};this['queueChannels']={};this[_0x9e7f('0x19')]={};this['timers']={};this[_0x9e7f('0x1a')]={};this['zendeskAccounts']={};this[_0x9e7f('0x1b')]={};this['sugarcrmAccounts']={};this[_0x9e7f('0x1c')]={};this[_0x9e7f('0x1d')]={};this[_0x9e7f('0x1e')]={};this[_0x9e7f('0x1f')]={};this[_0x9e7f('0x20')]={};this[_0x9e7f('0x21')]={};this['freshsalesAccounts']={};this[_0x9e7f('0x22')]={};};function freeIsNotKey(_0xc9765b,_0x4b051f,_0x193fac){var _0x1182a2=_[_0x9e7f('0x23')](_0xc9765b,function(_0xb39b25,_0x314b17){return _0xb39b25[_0x193fac];});for(var _0x461dcf in _0x4b051f){if(_0x4b051f['hasOwnProperty'](_0x461dcf)){if(!_0x1182a2[_0x461dcf]){delete _0x4b051f[_0x461dcf];}}}}function freeIsNotKeySip(_0x8e596,_0x18449c){var _0x427fe0=_[_0x9e7f('0x23')](_0x8e596,function(_0x23465e,_0x16c625){return util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x23465e['name']);});for(var _0x5015a8 in _0x18449c){if(_0x18449c[_0x9e7f('0x26')](_0x5015a8)){if(!_0x427fe0[_0x5015a8]){delete _0x18449c[_0x5015a8];}}}}function freeIsNotKeyAgent(_0xb71cd9,_0x355b53){var _0x3c2f38=_[_0x9e7f('0x23')](_0xb71cd9,function(_0x5de3bd,_0x426eff){var _0x42b75e=_[_0x9e7f('0x27')](_0x5de3bd[_0x9e7f('0x28')])?util[_0x9e7f('0x24')]('SIP/%s',_0x5de3bd['name']):_0x5de3bd['interface'];return _0x42b75e;});for(var _0x6aa4a4 in _0x355b53){if(_0x355b53[_0x9e7f('0x26')](_0x6aa4a4)){if(!_0x3c2f38[_0x6aa4a4]){delete _0x355b53[_0x6aa4a4];}}}}function clearVoiceCallReports(_0x55bd95){_0x55bd95[_0x9e7f('0x29')]=0x0;_0x55bd95[_0x9e7f('0x2a')]=0x0;_0x55bd95[_0x9e7f('0x2b')]=0x0;_0x55bd95['sumDuration']=0x0;_0x55bd95[_0x9e7f('0x2c')]=0x0;}function clearCampaigns(_0x1dd9a0){if(!_[_0x9e7f('0x2d')](_0x1dd9a0)){for(var _0x4732bc in _0x1dd9a0){if(_0x1dd9a0[_0x9e7f('0x26')](_0x4732bc)){_0x1dd9a0[_0x4732bc][_0x9e7f('0x2e')]=0x0;_0x1dd9a0[_0x4732bc][_0x9e7f('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x14c8c1){if(!_[_0x9e7f('0x2d')](_0x14c8c1)){for(var _0x459b6c in _0x14c8c1){if(_0x14c8c1['hasOwnProperty'](_0x459b6c)){_0x14c8c1[_0x459b6c][_0x9e7f('0x29')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x2a')]=0x0;_0x14c8c1[_0x459b6c]['unmanaged']=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x30')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x2b')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x31')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x2c')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x32')]=0x0;_0x14c8c1[_0x459b6c]['outboundNoAnswerCallsDay']=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x33')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x34')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x35')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x36')]=0x0;_0x14c8c1[_0x459b6c]['outboundDropCallsDayTimeout']=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x37')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x38')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x39')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x3a')]=0x0;_0x14c8c1[_0x459b6c]['outboundReCallsDay']=0x0;_0x14c8c1[_0x459b6c]['outboundAnswerAgiCallsDay']=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x3b')]=0x0;_0x14c8c1[_0x459b6c][_0x9e7f('0x3c')]=!![];}}}}Realtime[_0x9e7f('0x3d')]['mergeFromDatabase']=function(_0x44e0dd,_0x2540fc){for(var _0x5d503e in _0x2540fc){if(_0x44e0dd[_0x9e7f('0x26')](_0x5d503e)){_0x44e0dd[_0x5d503e]=_0x2540fc[_0x5d503e];}}};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x3e')]=function(){var _0xd0e35d=this;return function(_0x81de6b){if(_0x81de6b){freeIsNotKeyAgent(_0x81de6b,_0xd0e35d['agents']);for(var _0x4f9924=0x0,_0x5b74c6={},_0x308217={};_0x4f9924<_0x81de6b[_0x9e7f('0x3f')];_0x4f9924+=0x1){_0x5b74c6=_0x81de6b[_0x4f9924];var _0x2b06d0=_['isNil'](_0x5b74c6['interface'])?util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x5b74c6[_0x9e7f('0x40')]):_0x5b74c6['interface'];if(_[_0x9e7f('0x41')](_0xd0e35d[_0x9e7f('0x11')][_0x2b06d0])){_0xd0e35d[_0x9e7f('0x11')][_0x2b06d0]=new Agent(_0x5b74c6);}else{_0xd0e35d[_0x9e7f('0x42')](_0xd0e35d[_0x9e7f('0x11')][_0x2b06d0],_0x5b74c6);}}}return _0xd0e35d['agents'];};};Realtime['prototype'][_0x9e7f('0x43')]=function(){var _0x2ad09e=this;return function(_0x3c5836){if(_0x3c5836){freeIsNotKeySip(_0x3c5836,_0x2ad09e['telephones']);for(var _0x1ec6b9=0x0,_0x448e29={},_0xf670c4={};_0x1ec6b9<_0x3c5836[_0x9e7f('0x3f')];_0x1ec6b9+=0x1){_0x448e29=_0x3c5836[_0x1ec6b9];if(_[_0x9e7f('0x41')](_0x2ad09e[_0x9e7f('0x12')][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x448e29[_0x9e7f('0x40')])])){_0x2ad09e[_0x9e7f('0x12')][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x448e29[_0x9e7f('0x40')])]=new Telephone(_0x448e29);}else{_0x2ad09e[_0x9e7f('0x42')](_0x2ad09e[_0x9e7f('0x12')][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x448e29[_0x9e7f('0x40')])],_0x448e29);}}}return _0x2ad09e[_0x9e7f('0x12')];};};Realtime[_0x9e7f('0x3d')]['initTrunks']=function(){var _0x1db510=this;return function(_0x19473b){if(_0x19473b){freeIsNotKeySip(_0x19473b,_0x1db510[_0x9e7f('0x13')]);for(var _0x467877=0x0,_0x4e418b={},_0x299ef9={};_0x467877<_0x19473b[_0x9e7f('0x3f')];_0x467877+=0x1){_0x4e418b=_0x19473b[_0x467877];if(_['isUndefined'](_0x1db510['trunks'][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x4e418b['name'])])){_0x1db510[_0x9e7f('0x13')][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x4e418b[_0x9e7f('0x40')])]=new Trunk(_0x4e418b);}else{_0x1db510['mergeFromDatabase'](_0x1db510[_0x9e7f('0x13')][util[_0x9e7f('0x24')](_0x9e7f('0x25'),_0x4e418b[_0x9e7f('0x40')])],_0x4e418b);}}}return _0x1db510[_0x9e7f('0x13')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x44')]=function(){var _0x471d1e=this;return function(_0x15077d){if(_0x15077d){freeIsNotKey(_0x15077d,_0x471d1e['voiceQueues'],_0x9e7f('0x40'));for(var _0x443f5a=0x0,_0x1897d4={},_0x3c0c75={};_0x443f5a<_0x15077d[_0x9e7f('0x3f')];_0x443f5a+=0x1){_0x1897d4=_0x15077d[_0x443f5a];if(_[_0x9e7f('0x41')](_0x471d1e['voiceQueues'][_0x1897d4[_0x9e7f('0x40')]])){_0x471d1e[_0x9e7f('0x14')][_0x1897d4[_0x9e7f('0x40')]]=new VoiceQueue(_0x1897d4);}else{_0x471d1e[_0x9e7f('0x42')](_0x471d1e[_0x9e7f('0x14')][_0x1897d4[_0x9e7f('0x40')]],_0x1897d4);}}}return _0x471d1e[_0x9e7f('0x14')];};};Realtime[_0x9e7f('0x3d')]['initTriggers']=function(){var _0x1677f0=this;return function(_0x1db7a8){if(_0x1db7a8){freeIsNotKey(_0x1db7a8,_0x1677f0[_0x9e7f('0x45')],'id');for(var _0x23ec63=0x0,_0x4b9dfb={},_0x25eaa2={};_0x23ec63<_0x1db7a8['length'];_0x23ec63+=0x1){_0x4b9dfb=_0x1db7a8[_0x23ec63];if(_[_0x9e7f('0x41')](_0x1677f0['triggers'][_0x4b9dfb['id']])){_0x1677f0[_0x9e7f('0x45')][_0x4b9dfb['id']]=new Trigger(_0x4b9dfb);}else{_0x1677f0[_0x9e7f('0x42')](_0x1677f0['triggers'][_0x4b9dfb['id']],_0x4b9dfb);}}}return _0x1677f0[_0x9e7f('0x45')];};};Realtime[_0x9e7f('0x3d')]['initTemplates']=function(){var _0x56cf86=this;return function(_0x2e1a1e){if(_0x2e1a1e){freeIsNotKey(_0x2e1a1e,_0x56cf86[_0x9e7f('0x46')],'id');for(var _0x4ae965=0x0,_0x55fbad={},_0x596998={};_0x4ae965<_0x2e1a1e['length'];_0x4ae965+=0x1){_0x55fbad=_0x2e1a1e[_0x4ae965];if(_[_0x9e7f('0x41')](_0x56cf86[_0x9e7f('0x46')][_0x55fbad['id']])){_0x56cf86[_0x9e7f('0x46')][_0x55fbad['id']]=new Template(_0x55fbad);}else{_0x56cf86[_0x9e7f('0x42')](_0x56cf86['templates'][_0x55fbad['id']],_0x55fbad);}}}return _0x56cf86[_0x9e7f('0x46')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x47')]=function(){var _0x386307=this;return function(_0x11026e){if(_0x11026e){freeIsNotKey(_0x11026e,_0x386307['zendeskAccounts'],'id');for(var _0x25cb71=0x0,_0x2ec5e5={},_0x42b7ea={};_0x25cb71<_0x11026e[_0x9e7f('0x3f')];_0x25cb71+=0x1){_0x2ec5e5=_0x11026e[_0x25cb71];if(_[_0x9e7f('0x41')](_0x386307['zendeskAccounts'][_0x2ec5e5['id']])){_0x386307[_0x9e7f('0x48')][_0x2ec5e5['id']]=new ZendeskAccount(_0x2ec5e5);}else{_0x386307[_0x9e7f('0x42')](_0x386307[_0x9e7f('0x48')][_0x2ec5e5['id']],_0x2ec5e5);}}}return _0x386307['zendeskAccounts'];};};Realtime[_0x9e7f('0x3d')]['initSalesforceAccounts']=function(){var _0x4b02ea=this;return function(_0x5a20e9){if(_0x5a20e9){freeIsNotKey(_0x5a20e9,_0x4b02ea[_0x9e7f('0x1b')],'id');for(var _0x321f2b=0x0,_0x513bcb={},_0x52ca5c={};_0x321f2b<_0x5a20e9[_0x9e7f('0x3f')];_0x321f2b+=0x1){_0x513bcb=_0x5a20e9[_0x321f2b];if(_[_0x9e7f('0x41')](_0x4b02ea[_0x9e7f('0x1b')][_0x513bcb['id']])){_0x4b02ea[_0x9e7f('0x1b')][_0x513bcb['id']]=new SalesforceAccount(_0x513bcb);}else{_0x4b02ea[_0x9e7f('0x42')](_0x4b02ea[_0x9e7f('0x1b')][_0x513bcb['id']],_0x513bcb);}}}return _0x4b02ea[_0x9e7f('0x1b')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x49')]=function(){var _0x29b89b=this;return function(_0x2ada82){if(_0x2ada82){freeIsNotKey(_0x2ada82,_0x29b89b[_0x9e7f('0x1c')],'id');for(var _0x455aa4=0x0,_0x55a23b={},_0x1a74b6={};_0x455aa4<_0x2ada82[_0x9e7f('0x3f')];_0x455aa4+=0x1){_0x55a23b=_0x2ada82[_0x455aa4];if(_[_0x9e7f('0x41')](_0x29b89b[_0x9e7f('0x1c')][_0x55a23b['id']])){_0x29b89b[_0x9e7f('0x1c')][_0x55a23b['id']]=new FreshdeskAccount(_0x55a23b);}else{_0x29b89b['mergeFromDatabase'](_0x29b89b[_0x9e7f('0x1c')][_0x55a23b['id']],_0x55a23b);}}}return _0x29b89b[_0x9e7f('0x1c')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x4a')]=function(){var _0x35a121=this;return function(_0x39a193){if(_0x39a193){freeIsNotKey(_0x39a193,_0x35a121['zohoAccounts'],'id');for(var _0x5074ec=0x0,_0x15f67a={},_0x546ce6={};_0x5074ec<_0x39a193[_0x9e7f('0x3f')];_0x5074ec+=0x1){_0x15f67a=_0x39a193[_0x5074ec];if(_['isUndefined'](_0x35a121[_0x9e7f('0x1d')][_0x15f67a['id']])){_0x35a121['zohoAccounts'][_0x15f67a['id']]=new ZohoAccount(_0x15f67a);}else{_0x35a121[_0x9e7f('0x42')](_0x35a121['zohoAccounts'][_0x15f67a['id']],_0x15f67a);}}}return _0x35a121[_0x9e7f('0x1d')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x4b')]=function(){var _0x323674=this;return function(_0x5920a4){if(_0x5920a4){freeIsNotKey(_0x5920a4,_0x323674[_0x9e7f('0x1e')],'id');for(var _0x21cfea=0x0,_0xb904d0={},_0x42f2f8={};_0x21cfea<_0x5920a4[_0x9e7f('0x3f')];_0x21cfea+=0x1){_0xb904d0=_0x5920a4[_0x21cfea];if(_[_0x9e7f('0x41')](_0x323674[_0x9e7f('0x1e')][_0xb904d0['id']])){_0x323674[_0x9e7f('0x1e')][_0xb904d0['id']]=new DeskAccount(_0xb904d0);}else{_0x323674[_0x9e7f('0x42')](_0x323674['deskAccounts'][_0xb904d0['id']],_0xb904d0);}}}return _0x323674[_0x9e7f('0x1e')];};};Realtime['prototype'][_0x9e7f('0x4c')]=function(){var _0x36ebfc=this;return function(_0x5e4a9a){if(_0x5e4a9a){freeIsNotKey(_0x5e4a9a,_0x36ebfc[_0x9e7f('0x4d')],'id');for(var _0x4383d9=0x0,_0x17426c={},_0x1ca1b6={};_0x4383d9<_0x5e4a9a[_0x9e7f('0x3f')];_0x4383d9+=0x1){_0x17426c=_0x5e4a9a[_0x4383d9];if(_['isUndefined'](_0x36ebfc[_0x9e7f('0x4d')][_0x17426c['id']])){_0x36ebfc[_0x9e7f('0x4d')][_0x17426c['id']]=new SugarcrmAccount(_0x17426c);}else{_0x36ebfc[_0x9e7f('0x42')](_0x36ebfc[_0x9e7f('0x4d')][_0x17426c['id']],_0x17426c);}}}return _0x36ebfc[_0x9e7f('0x4d')];};};Realtime[_0x9e7f('0x3d')]['initVtigerAccounts']=function(){var _0x1c0964=this;return function(_0x5d82cc){if(_0x5d82cc){freeIsNotKey(_0x5d82cc,_0x1c0964['vtigerAccounts'],'id');for(var _0x259242=0x0,_0x3b0a74={},_0x591d9b={};_0x259242<_0x5d82cc[_0x9e7f('0x3f')];_0x259242+=0x1){_0x3b0a74=_0x5d82cc[_0x259242];if(_[_0x9e7f('0x41')](_0x1c0964['vtigerAccounts'][_0x3b0a74['id']])){_0x1c0964[_0x9e7f('0x1f')][_0x3b0a74['id']]=new VtigerAccount(_0x3b0a74);}else{_0x1c0964[_0x9e7f('0x42')](_0x1c0964[_0x9e7f('0x1f')][_0x3b0a74['id']],_0x3b0a74);}}}return _0x1c0964[_0x9e7f('0x1f')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x4e')]=function(){var _0x3cfa77=this;return function(_0x9abe11){if(_0x9abe11){freeIsNotKey(_0x9abe11,_0x3cfa77[_0x9e7f('0x20')],'id');for(var _0x3af04c=0x0,_0x550bd5={},_0x3efe8c={};_0x3af04c<_0x9abe11['length'];_0x3af04c+=0x1){_0x550bd5=_0x9abe11[_0x3af04c];if(_[_0x9e7f('0x41')](_0x3cfa77[_0x9e7f('0x20')][_0x550bd5['id']])){_0x3cfa77[_0x9e7f('0x20')][_0x550bd5['id']]=new ServicenowAccount(_0x550bd5);}else{_0x3cfa77[_0x9e7f('0x42')](_0x3cfa77[_0x9e7f('0x20')][_0x550bd5['id']],_0x550bd5);}}}return _0x3cfa77[_0x9e7f('0x20')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x4f')]=function(){var _0x110f1e=this;return function(_0x73de33){if(_0x73de33){freeIsNotKey(_0x73de33,_0x110f1e[_0x9e7f('0x21')],'id');for(var _0x3d78e6=0x0,_0x216460={},_0x3d2a89={};_0x3d78e6<_0x73de33['length'];_0x3d78e6+=0x1){_0x216460=_0x73de33[_0x3d78e6];if(_['isUndefined'](_0x110f1e[_0x9e7f('0x21')][_0x216460['id']])){_0x110f1e['dynamics365Accounts'][_0x216460['id']]=new Dynamics365Account(_0x216460);}else{_0x110f1e[_0x9e7f('0x42')](_0x110f1e[_0x9e7f('0x21')][_0x216460['id']],_0x216460);}}}return _0x110f1e['dynamics365Accounts'];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x50')]=function(){var _0x27594c=this;return function(_0x213e7d){if(_0x213e7d){freeIsNotKey(_0x213e7d,_0x27594c[_0x9e7f('0x51')],'id');for(var _0x359607=0x0,_0x3158e={},_0x33179d={};_0x359607<_0x213e7d[_0x9e7f('0x3f')];_0x359607+=0x1){_0x3158e=_0x213e7d[_0x359607];if(_[_0x9e7f('0x41')](_0x27594c[_0x9e7f('0x51')][_0x3158e['id']])){_0x27594c[_0x9e7f('0x51')][_0x3158e['id']]=new FreshsalesAccount(_0x3158e);}else{_0x27594c['mergeFromDatabase'](_0x27594c[_0x9e7f('0x51')][_0x3158e['id']],_0x3158e);}}}return _0x27594c['freshsalesAccounts'];};};Realtime[_0x9e7f('0x3d')]['initVoiceQueueHopperHistory']=function(){var _0x4bb3a7=this;return function(_0x234812){for(var _0x186651=0x0;_0x186651<_0x234812['length'];_0x186651+=0x1){_[_0x9e7f('0x52')](_0x4bb3a7[_0x9e7f('0x14')][_0x234812[_0x186651]['name']],_0x234812[_0x186651]);}return _0x4bb3a7[_0x9e7f('0x14')];};};Realtime['prototype'][_0x9e7f('0x53')]=function(){var _0xc04e64=this;return function(_0x3bf4ec){clearVoiceQueues(_0xc04e64[_0x9e7f('0x14')]);if(_0x3bf4ec){_0x3bf4ec=_[_0x9e7f('0x54')](_0x3bf4ec,_0x9e7f('0x55'));for(var _0x128967 in _0x3bf4ec){if(_0x3bf4ec['hasOwnProperty'](_0x128967)){var _0x5e1707={};for(var _0x37c71d=0x0;_0x37c71d<_0x3bf4ec[_0x128967][_0x9e7f('0x3f')];_0x37c71d+=0x1){var _0x3ee9aa=_0x3bf4ec[_0x128967][_0x37c71d]['queue'];if(_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa]){if(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x56')]){_0xc04e64['voiceQueues'][_0x3ee9aa][_0x9e7f('0x57')]+=0x1;}if(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x58')]){_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x30')]+=0x1;}_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x2b')]+=moment(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x59')])[_0x9e7f('0x5a')](moment(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x5b')]),_0x9e7f('0x5c'))||0x0;if(_0x37c71d===_0x3bf4ec[_0x128967]['length']-0x1){_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x31')]+=moment(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x5d')]||_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x5e')]||_0x3bf4ec[_0x128967][_0x37c71d]['queuecallerexitAt'])[_0x9e7f('0x5a')](moment(_0x3bf4ec[_0x128967][_0x37c71d]['queuecallerjoinAt']),_0x9e7f('0x5c'))||0x0;_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x29')]+=0x1;if(_0x3bf4ec[_0x128967][_0x37c71d][_0x9e7f('0x5f')]){_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x2a')]+=0x1;_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa]['sumBillable']+=moment(_0x3bf4ec[_0x128967][_0x37c71d]['queuecallercompleteAt'])[_0x9e7f('0x5a')](moment(_0x3bf4ec[_0x128967][_0x37c71d]['queuecallerleaveAt']),_0x9e7f('0x5c'))||0x0;}}else{_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x31')]+=_0xc04e64[_0x9e7f('0x14')][_0x3ee9aa][_0x9e7f('0x2b')]||0x0;}}}}}}return _0xc04e64[_0x9e7f('0x14')];};};Realtime[_0x9e7f('0x3d')]['initVoiceCallReports']=function(){var _0x4eb4e4=this;return function(_0x4566d8){clearVoiceCallReports(_0x4eb4e4['outbound']);if(_0x4566d8){for(var _0x24d9b0=0x0;_0x24d9b0<_0x4566d8[_0x9e7f('0x3f')];_0x24d9b0+=0x1){_0x4eb4e4[_0x9e7f('0x16')][_0x9e7f('0x29')]+=0x1;_0x4eb4e4[_0x9e7f('0x16')]['sumDuration']+=_0x4566d8[_0x24d9b0][_0x9e7f('0x60')];if(_0x4566d8[_0x24d9b0][_0x9e7f('0x61')]==='ANSWERED'){_0x4eb4e4['outbound']['answered']+=0x1;_0x4eb4e4[_0x9e7f('0x16')][_0x9e7f('0x2b')]+=_0x4566d8[_0x24d9b0][_0x9e7f('0x60')]-_0x4566d8[_0x24d9b0][_0x9e7f('0x62')]||0x0;_0x4eb4e4[_0x9e7f('0x16')][_0x9e7f('0x2c')]+=_0x4566d8[_0x24d9b0]['billableseconds'];}}}return _0x4eb4e4[_0x9e7f('0x16')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x63')]=function(){var _0xc24d0d=this;return function(_0x35d4ae){if(_0x35d4ae){freeIsNotKey(_0x35d4ae,_0xc24d0d[_0x9e7f('0x15')],_0x9e7f('0x40'));for(var _0x1f3989=0x0,_0x2a909c={};_0x1f3989<_0x35d4ae[_0x9e7f('0x3f')];_0x1f3989+=0x1){_0x2a909c=_0x35d4ae[_0x1f3989];if(_[_0x9e7f('0x41')](_0xc24d0d[_0x9e7f('0x15')][_0x2a909c[_0x9e7f('0x40')]])){_0xc24d0d['campaigns'][_0x2a909c[_0x9e7f('0x40')]]=new Campaign(_0x2a909c);}else{_0xc24d0d[_0x9e7f('0x42')](_0xc24d0d['campaigns'][_0x2a909c['name']],_0x2a909c);_0xc24d0d['campaigns'][_0x2a909c[_0x9e7f('0x40')]][_0x9e7f('0x64')]=_0x2a909c['SquareProject']?_0x2a909c[_0x9e7f('0x65')][_0x9e7f('0x40')]:undefined;}}}return _0xc24d0d[_0x9e7f('0x15')];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x66')]=function(){var _0x1b31e1=this;return function(_0x416f7d){if(_0x416f7d){freeIsNotKey(_0x416f7d,_0x1b31e1[_0x9e7f('0x17')],'id');for(var _0x4b6bb5=0x0,_0xae8436={};_0x4b6bb5<_0x416f7d[_0x9e7f('0x3f')];_0x4b6bb5+=0x1){_0xae8436=_0x416f7d[_0x4b6bb5];if(_['isUndefined'](_0x1b31e1[_0x9e7f('0x17')][_0xae8436['id']])){_0x1b31e1[_0x9e7f('0x17')][_0xae8436['id']]=new VoiceExtension(_0xae8436);}else{_0x1b31e1[_0x9e7f('0x42')](_0x1b31e1[_0x9e7f('0x17')][_0xae8436['id']],_0xae8436);}}}return _0x1b31e1[_0x9e7f('0x17')];};};Realtime['prototype'][_0x9e7f('0x67')]=function(){var _0x70038c=this;return function(_0x1dd2d2){clearCampaigns(_0x70038c[_0x9e7f('0x15')]);for(var _0x6793f2=0x0;_0x6793f2<_0x1dd2d2['length'];_0x6793f2+=0x1){_['merge'](_0x70038c[_0x9e7f('0x15')][_0x1dd2d2[_0x6793f2][_0x9e7f('0x40')]],_0x1dd2d2[_0x6793f2]);}return _0x70038c['campaigns'];};};Realtime[_0x9e7f('0x3d')][_0x9e7f('0x68')]=function(){var _0xc219a4=this;return function(_0x400dc8){if(_0x400dc8){freeIsNotKey(_0x400dc8,_0xc219a4['faxAccounts'],'id');for(var _0x3afacc=0x0,_0x102855={},_0x1da093={};_0x3afacc<_0x400dc8[_0x9e7f('0x3f')];_0x3afacc+=0x1){_0x102855=_0x400dc8[_0x3afacc];if(_['isUndefined'](_0xc219a4[_0x9e7f('0x22')][_0x102855['id']])){_0xc219a4['faxAccounts'][_0x102855['id']]=new FaxAccount(_0x102855);}else{_0xc219a4['mergeFromDatabase'](_0xc219a4[_0x9e7f('0x22')][_0x102855['id']],_0x102855);}}}return _0xc219a4[_0x9e7f('0x22')];};};module[_0x9e7f('0x69')]=Realtime; \ No newline at end of file +var _0xa9cc=['initAgents','agents','length','isUndefined','initTelephones','initVoiceQueues','triggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','SquareProject','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','name','mapKeys','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase'];(function(_0x1c1fd2,_0xd75a8f){var _0x2a02fc=function(_0x3e66fc){while(--_0x3e66fc){_0x1c1fd2['push'](_0x1c1fd2['shift']());}};_0x2a02fc(++_0xd75a8f);}(_0xa9cc,0x165));var _0xca9c=function(_0x1723cd,_0x2c1dc8){_0x1723cd=_0x1723cd-0x0;var _0x2c06ec=_0xa9cc[_0x1723cd];return _0x2c06ec;};'use strict';var BPromise=require(_0xca9c('0x0'));var util=require(_0xca9c('0x1'));var _=require(_0xca9c('0x2'));var moment=require(_0xca9c('0x3'));var Agent=require(_0xca9c('0x4'));var Telephone=require(_0xca9c('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xca9c('0x6'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xca9c('0x7'));var SalesforceAccount=require(_0xca9c('0x8'));var FreshdeskAccount=require(_0xca9c('0x9'));var SugarcrmAccount=require(_0xca9c('0xa'));var ZohoAccount=require(_0xca9c('0xb'));var DeskAccount=require(_0xca9c('0xc'));var VtigerAccount=require(_0xca9c('0xd'));var ServicenowAccount=require(_0xca9c('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xca9c('0xf'));var FaxAccount=require(_0xca9c('0x10'));var Realtime=function(){this['agents']={};this[_0xca9c('0x11')]={};this[_0xca9c('0x12')]={};this[_0xca9c('0x13')]={};this['triggers']={};this[_0xca9c('0x14')]={};this[_0xca9c('0x15')]={};this[_0xca9c('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xca9c('0x17')]={};this[_0xca9c('0x18')]={};this['queueChannels']={};this[_0xca9c('0x19')]={};this[_0xca9c('0x1a')]={};this[_0xca9c('0x1b')]={};this[_0xca9c('0x1c')]={};this[_0xca9c('0x1d')]={};this[_0xca9c('0x1e')]={};this[_0xca9c('0x1f')]={};this['zohoAccounts']={};this[_0xca9c('0x20')]={};this['vtigerAccounts']={};this[_0xca9c('0x21')]={};this[_0xca9c('0x22')]={};this[_0xca9c('0x23')]={};this[_0xca9c('0x24')]={};};function freeIsNotKey(_0x523d52,_0x4932c6,_0x26c0e9){var _0x305d8a=_['mapKeys'](_0x523d52,function(_0x4cf1d2,_0x578842){return _0x4cf1d2[_0x26c0e9];});for(var _0x18e4b8 in _0x4932c6){if(_0x4932c6[_0xca9c('0x25')](_0x18e4b8)){if(!_0x305d8a[_0x18e4b8]){delete _0x4932c6[_0x18e4b8];}}}}function freeIsNotKeySip(_0x21b7c9,_0x1e6a3c){var _0x1bbc81=_['mapKeys'](_0x21b7c9,function(_0x73bd5b,_0x4808cf){return util[_0xca9c('0x26')](_0xca9c('0x27'),_0x73bd5b[_0xca9c('0x28')]);});for(var _0x37c969 in _0x1e6a3c){if(_0x1e6a3c[_0xca9c('0x25')](_0x37c969)){if(!_0x1bbc81[_0x37c969]){delete _0x1e6a3c[_0x37c969];}}}}function freeIsNotKeyAgent(_0x3a473b,_0x3d8704){var _0x37a7b1=_[_0xca9c('0x29')](_0x3a473b,function(_0x201211,_0xb25da6){var _0x285412=_[_0xca9c('0x2a')](_0x201211['interface'])?util['format'](_0xca9c('0x27'),_0x201211[_0xca9c('0x28')]):_0x201211[_0xca9c('0x2b')];return _0x285412;});for(var _0x119070 in _0x3d8704){if(_0x3d8704[_0xca9c('0x25')](_0x119070)){if(!_0x37a7b1[_0x119070]){delete _0x3d8704[_0x119070];}}}}function clearVoiceCallReports(_0xf77277){_0xf77277[_0xca9c('0x2c')]=0x0;_0xf77277[_0xca9c('0x2d')]=0x0;_0xf77277[_0xca9c('0x2e')]=0x0;_0xf77277[_0xca9c('0x2f')]=0x0;_0xf77277[_0xca9c('0x30')]=0x0;}function clearCampaigns(_0x2c14e8){if(!_[_0xca9c('0x31')](_0x2c14e8)){for(var _0x5cb42f in _0x2c14e8){if(_0x2c14e8[_0xca9c('0x25')](_0x5cb42f)){_0x2c14e8[_0x5cb42f][_0xca9c('0x32')]=0x0;_0x2c14e8[_0x5cb42f][_0xca9c('0x33')]=0x0;}}}}function clearVoiceQueues(_0x338f3e){if(!_[_0xca9c('0x31')](_0x338f3e)){for(var _0x4089c0 in _0x338f3e){if(_0x338f3e[_0xca9c('0x25')](_0x4089c0)){_0x338f3e[_0x4089c0][_0xca9c('0x2c')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x2d')]=0x0;_0x338f3e[_0x4089c0]['unmanaged']=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x34')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x2e')]=0x0;_0x338f3e[_0x4089c0]['sumDuration']=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x30')]=0x0;_0x338f3e[_0x4089c0]['outboundAnswerAgiCallsDay']=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x35')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x36')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x37')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x38')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x39')]=0x0;_0x338f3e[_0x4089c0]['outboundDropCallsDayTimeout']=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3a')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3b')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3c')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3d')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3e')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x3f')]=0x0;_0x338f3e[_0x4089c0][_0xca9c('0x40')]=0x0;_0x338f3e[_0x4089c0]['queueStatusComplete']=!![];}}}}Realtime[_0xca9c('0x41')][_0xca9c('0x42')]=function(_0x3acfab,_0x46ee08){for(var _0x2b927e in _0x46ee08){if(_0x3acfab[_0xca9c('0x25')](_0x2b927e)){_0x3acfab[_0x2b927e]=_0x46ee08[_0x2b927e];}}};Realtime[_0xca9c('0x41')][_0xca9c('0x43')]=function(){var _0x4841e6=this;return function(_0x327935){if(_0x327935){freeIsNotKeyAgent(_0x327935,_0x4841e6[_0xca9c('0x44')]);for(var _0x47b73a=0x0,_0x25a907={},_0x1a5f3f={};_0x47b73a<_0x327935[_0xca9c('0x45')];_0x47b73a+=0x1){_0x25a907=_0x327935[_0x47b73a];var _0x5c50a1=_[_0xca9c('0x2a')](_0x25a907['interface'])?util[_0xca9c('0x26')](_0xca9c('0x27'),_0x25a907[_0xca9c('0x28')]):_0x25a907[_0xca9c('0x2b')];if(_[_0xca9c('0x46')](_0x4841e6[_0xca9c('0x44')][_0x5c50a1])){_0x4841e6[_0xca9c('0x44')][_0x5c50a1]=new Agent(_0x25a907);}else{_0x4841e6[_0xca9c('0x42')](_0x4841e6[_0xca9c('0x44')][_0x5c50a1],_0x25a907);}}}return _0x4841e6[_0xca9c('0x44')];};};Realtime['prototype'][_0xca9c('0x47')]=function(){var _0x4d1ebf=this;return function(_0x5007ec){if(_0x5007ec){freeIsNotKeySip(_0x5007ec,_0x4d1ebf[_0xca9c('0x11')]);for(var _0x40cf02=0x0,_0x42a012={},_0x26b7a1={};_0x40cf02<_0x5007ec[_0xca9c('0x45')];_0x40cf02+=0x1){_0x42a012=_0x5007ec[_0x40cf02];if(_['isUndefined'](_0x4d1ebf['telephones'][util['format']('SIP/%s',_0x42a012[_0xca9c('0x28')])])){_0x4d1ebf[_0xca9c('0x11')][util[_0xca9c('0x26')]('SIP/%s',_0x42a012[_0xca9c('0x28')])]=new Telephone(_0x42a012);}else{_0x4d1ebf[_0xca9c('0x42')](_0x4d1ebf['telephones'][util[_0xca9c('0x26')](_0xca9c('0x27'),_0x42a012[_0xca9c('0x28')])],_0x42a012);}}}return _0x4d1ebf[_0xca9c('0x11')];};};Realtime['prototype']['initTrunks']=function(){var _0x242503=this;return function(_0x8c5893){if(_0x8c5893){freeIsNotKeySip(_0x8c5893,_0x242503['trunks']);for(var _0x3657ec=0x0,_0xd937f7={},_0xbddaa3={};_0x3657ec<_0x8c5893[_0xca9c('0x45')];_0x3657ec+=0x1){_0xd937f7=_0x8c5893[_0x3657ec];if(_[_0xca9c('0x46')](_0x242503['trunks'][util['format'](_0xca9c('0x27'),_0xd937f7[_0xca9c('0x28')])])){_0x242503[_0xca9c('0x12')][util[_0xca9c('0x26')](_0xca9c('0x27'),_0xd937f7['name'])]=new Trunk(_0xd937f7);}else{_0x242503['mergeFromDatabase'](_0x242503[_0xca9c('0x12')][util[_0xca9c('0x26')](_0xca9c('0x27'),_0xd937f7[_0xca9c('0x28')])],_0xd937f7);}}}return _0x242503[_0xca9c('0x12')];};};Realtime['prototype'][_0xca9c('0x48')]=function(){var _0x2d4d02=this;return function(_0x13bb05){if(_0x13bb05){freeIsNotKey(_0x13bb05,_0x2d4d02['voiceQueues'],_0xca9c('0x28'));for(var _0x50f33c=0x0,_0x588bd1={},_0x3337d5={};_0x50f33c<_0x13bb05[_0xca9c('0x45')];_0x50f33c+=0x1){_0x588bd1=_0x13bb05[_0x50f33c];if(_[_0xca9c('0x46')](_0x2d4d02[_0xca9c('0x13')][_0x588bd1[_0xca9c('0x28')]])){_0x2d4d02[_0xca9c('0x13')][_0x588bd1[_0xca9c('0x28')]]=new VoiceQueue(_0x588bd1);}else{_0x2d4d02['mergeFromDatabase'](_0x2d4d02[_0xca9c('0x13')][_0x588bd1[_0xca9c('0x28')]],_0x588bd1);}}}return _0x2d4d02['voiceQueues'];};};Realtime[_0xca9c('0x41')]['initTriggers']=function(){var _0x34339f=this;return function(_0x4556d){if(_0x4556d){freeIsNotKey(_0x4556d,_0x34339f['triggers'],'id');for(var _0x38fd83=0x0,_0x405650={},_0x43d9db={};_0x38fd83<_0x4556d[_0xca9c('0x45')];_0x38fd83+=0x1){_0x405650=_0x4556d[_0x38fd83];if(_[_0xca9c('0x46')](_0x34339f[_0xca9c('0x49')][_0x405650['id']])){_0x34339f[_0xca9c('0x49')][_0x405650['id']]=new Trigger(_0x405650);}else{_0x34339f['mergeFromDatabase'](_0x34339f[_0xca9c('0x49')][_0x405650['id']],_0x405650);}}}return _0x34339f[_0xca9c('0x49')];};};Realtime[_0xca9c('0x41')]['initTemplates']=function(){var _0x22ba27=this;return function(_0x4f3959){if(_0x4f3959){freeIsNotKey(_0x4f3959,_0x22ba27[_0xca9c('0x15')],'id');for(var _0x517bd1=0x0,_0x5fe57a={},_0x238ba9={};_0x517bd1<_0x4f3959['length'];_0x517bd1+=0x1){_0x5fe57a=_0x4f3959[_0x517bd1];if(_[_0xca9c('0x46')](_0x22ba27[_0xca9c('0x15')][_0x5fe57a['id']])){_0x22ba27['templates'][_0x5fe57a['id']]=new Template(_0x5fe57a);}else{_0x22ba27[_0xca9c('0x42')](_0x22ba27[_0xca9c('0x15')][_0x5fe57a['id']],_0x5fe57a);}}}return _0x22ba27[_0xca9c('0x15')];};};Realtime['prototype'][_0xca9c('0x4a')]=function(){var _0x739243=this;return function(_0x473b7d){if(_0x473b7d){freeIsNotKey(_0x473b7d,_0x739243[_0xca9c('0x1c')],'id');for(var _0x12d0cf=0x0,_0x33d88f={},_0x464748={};_0x12d0cf<_0x473b7d[_0xca9c('0x45')];_0x12d0cf+=0x1){_0x33d88f=_0x473b7d[_0x12d0cf];if(_[_0xca9c('0x46')](_0x739243[_0xca9c('0x1c')][_0x33d88f['id']])){_0x739243[_0xca9c('0x1c')][_0x33d88f['id']]=new ZendeskAccount(_0x33d88f);}else{_0x739243[_0xca9c('0x42')](_0x739243['zendeskAccounts'][_0x33d88f['id']],_0x33d88f);}}}return _0x739243[_0xca9c('0x1c')];};};Realtime[_0xca9c('0x41')][_0xca9c('0x4b')]=function(){var _0x4060fc=this;return function(_0x282e3c){if(_0x282e3c){freeIsNotKey(_0x282e3c,_0x4060fc[_0xca9c('0x1d')],'id');for(var _0x3f4c2f=0x0,_0x4cebb6={},_0x1d20e1={};_0x3f4c2f<_0x282e3c['length'];_0x3f4c2f+=0x1){_0x4cebb6=_0x282e3c[_0x3f4c2f];if(_[_0xca9c('0x46')](_0x4060fc['salesforceAccounts'][_0x4cebb6['id']])){_0x4060fc[_0xca9c('0x1d')][_0x4cebb6['id']]=new SalesforceAccount(_0x4cebb6);}else{_0x4060fc['mergeFromDatabase'](_0x4060fc[_0xca9c('0x1d')][_0x4cebb6['id']],_0x4cebb6);}}}return _0x4060fc[_0xca9c('0x1d')];};};Realtime['prototype'][_0xca9c('0x4c')]=function(){var _0x37351b=this;return function(_0x4314c1){if(_0x4314c1){freeIsNotKey(_0x4314c1,_0x37351b['freshdeskAccounts'],'id');for(var _0x1730e9=0x0,_0x47b4c0={},_0x379359={};_0x1730e9<_0x4314c1[_0xca9c('0x45')];_0x1730e9+=0x1){_0x47b4c0=_0x4314c1[_0x1730e9];if(_[_0xca9c('0x46')](_0x37351b[_0xca9c('0x1f')][_0x47b4c0['id']])){_0x37351b[_0xca9c('0x1f')][_0x47b4c0['id']]=new FreshdeskAccount(_0x47b4c0);}else{_0x37351b['mergeFromDatabase'](_0x37351b[_0xca9c('0x1f')][_0x47b4c0['id']],_0x47b4c0);}}}return _0x37351b[_0xca9c('0x1f')];};};Realtime['prototype'][_0xca9c('0x4d')]=function(){var _0x117a42=this;return function(_0x266de9){if(_0x266de9){freeIsNotKey(_0x266de9,_0x117a42['zohoAccounts'],'id');for(var _0x1988b9=0x0,_0x507e1d={},_0x4056a9={};_0x1988b9<_0x266de9[_0xca9c('0x45')];_0x1988b9+=0x1){_0x507e1d=_0x266de9[_0x1988b9];if(_[_0xca9c('0x46')](_0x117a42[_0xca9c('0x4e')][_0x507e1d['id']])){_0x117a42[_0xca9c('0x4e')][_0x507e1d['id']]=new ZohoAccount(_0x507e1d);}else{_0x117a42[_0xca9c('0x42')](_0x117a42['zohoAccounts'][_0x507e1d['id']],_0x507e1d);}}}return _0x117a42[_0xca9c('0x4e')];};};Realtime['prototype'][_0xca9c('0x4f')]=function(){var _0x2ff23d=this;return function(_0x4de6b0){if(_0x4de6b0){freeIsNotKey(_0x4de6b0,_0x2ff23d[_0xca9c('0x20')],'id');for(var _0x49b03b=0x0,_0x4abd20={},_0x31e30c={};_0x49b03b<_0x4de6b0[_0xca9c('0x45')];_0x49b03b+=0x1){_0x4abd20=_0x4de6b0[_0x49b03b];if(_[_0xca9c('0x46')](_0x2ff23d[_0xca9c('0x20')][_0x4abd20['id']])){_0x2ff23d['deskAccounts'][_0x4abd20['id']]=new DeskAccount(_0x4abd20);}else{_0x2ff23d['mergeFromDatabase'](_0x2ff23d[_0xca9c('0x20')][_0x4abd20['id']],_0x4abd20);}}}return _0x2ff23d['deskAccounts'];};};Realtime[_0xca9c('0x41')][_0xca9c('0x50')]=function(){var _0x4776df=this;return function(_0x3feb79){if(_0x3feb79){freeIsNotKey(_0x3feb79,_0x4776df[_0xca9c('0x1e')],'id');for(var _0x1a770f=0x0,_0x311ba6={},_0x2adbfd={};_0x1a770f<_0x3feb79[_0xca9c('0x45')];_0x1a770f+=0x1){_0x311ba6=_0x3feb79[_0x1a770f];if(_[_0xca9c('0x46')](_0x4776df[_0xca9c('0x1e')][_0x311ba6['id']])){_0x4776df['sugarcrmAccounts'][_0x311ba6['id']]=new SugarcrmAccount(_0x311ba6);}else{_0x4776df[_0xca9c('0x42')](_0x4776df[_0xca9c('0x1e')][_0x311ba6['id']],_0x311ba6);}}}return _0x4776df[_0xca9c('0x1e')];};};Realtime['prototype'][_0xca9c('0x51')]=function(){var _0xb91c87=this;return function(_0x23b302){if(_0x23b302){freeIsNotKey(_0x23b302,_0xb91c87[_0xca9c('0x52')],'id');for(var _0x2fca5b=0x0,_0x53f8a2={},_0x517d4f={};_0x2fca5b<_0x23b302['length'];_0x2fca5b+=0x1){_0x53f8a2=_0x23b302[_0x2fca5b];if(_[_0xca9c('0x46')](_0xb91c87[_0xca9c('0x52')][_0x53f8a2['id']])){_0xb91c87[_0xca9c('0x52')][_0x53f8a2['id']]=new VtigerAccount(_0x53f8a2);}else{_0xb91c87[_0xca9c('0x42')](_0xb91c87[_0xca9c('0x52')][_0x53f8a2['id']],_0x53f8a2);}}}return _0xb91c87['vtigerAccounts'];};};Realtime[_0xca9c('0x41')]['initServicenowAccounts']=function(){var _0x592d5b=this;return function(_0x590dc8){if(_0x590dc8){freeIsNotKey(_0x590dc8,_0x592d5b[_0xca9c('0x21')],'id');for(var _0x5b9607=0x0,_0x4dac93={},_0xe38e0c={};_0x5b9607<_0x590dc8[_0xca9c('0x45')];_0x5b9607+=0x1){_0x4dac93=_0x590dc8[_0x5b9607];if(_['isUndefined'](_0x592d5b[_0xca9c('0x21')][_0x4dac93['id']])){_0x592d5b[_0xca9c('0x21')][_0x4dac93['id']]=new ServicenowAccount(_0x4dac93);}else{_0x592d5b[_0xca9c('0x42')](_0x592d5b['servicenowAccounts'][_0x4dac93['id']],_0x4dac93);}}}return _0x592d5b[_0xca9c('0x21')];};};Realtime[_0xca9c('0x41')]['initDynamics365Accounts']=function(){var _0x2b948d=this;return function(_0x18095b){if(_0x18095b){freeIsNotKey(_0x18095b,_0x2b948d[_0xca9c('0x22')],'id');for(var _0x29c5d9=0x0,_0x2bbab3={},_0xfc7d32={};_0x29c5d9<_0x18095b['length'];_0x29c5d9+=0x1){_0x2bbab3=_0x18095b[_0x29c5d9];if(_[_0xca9c('0x46')](_0x2b948d['dynamics365Accounts'][_0x2bbab3['id']])){_0x2b948d[_0xca9c('0x22')][_0x2bbab3['id']]=new Dynamics365Account(_0x2bbab3);}else{_0x2b948d[_0xca9c('0x42')](_0x2b948d['dynamics365Accounts'][_0x2bbab3['id']],_0x2bbab3);}}}return _0x2b948d['dynamics365Accounts'];};};Realtime['prototype'][_0xca9c('0x53')]=function(){var _0x26afd4=this;return function(_0x221e04){if(_0x221e04){freeIsNotKey(_0x221e04,_0x26afd4[_0xca9c('0x23')],'id');for(var _0x3e97a7=0x0,_0x5188d9={},_0x2470f5={};_0x3e97a7<_0x221e04['length'];_0x3e97a7+=0x1){_0x5188d9=_0x221e04[_0x3e97a7];if(_[_0xca9c('0x46')](_0x26afd4[_0xca9c('0x23')][_0x5188d9['id']])){_0x26afd4[_0xca9c('0x23')][_0x5188d9['id']]=new FreshsalesAccount(_0x5188d9);}else{_0x26afd4['mergeFromDatabase'](_0x26afd4[_0xca9c('0x23')][_0x5188d9['id']],_0x5188d9);}}}return _0x26afd4['freshsalesAccounts'];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x5a646e=this;return function(_0x4ecd1c){for(var _0x2a8903=0x0;_0x2a8903<_0x4ecd1c['length'];_0x2a8903+=0x1){_[_0xca9c('0x54')](_0x5a646e[_0xca9c('0x13')][_0x4ecd1c[_0x2a8903][_0xca9c('0x28')]],_0x4ecd1c[_0x2a8903]);}return _0x5a646e['voiceQueues'];};};Realtime[_0xca9c('0x41')][_0xca9c('0x55')]=function(){var _0x12370f=this;return function(_0x5be31b){clearVoiceQueues(_0x12370f[_0xca9c('0x13')]);if(_0x5be31b){_0x5be31b=_[_0xca9c('0x56')](_0x5be31b,_0xca9c('0x57'));for(var _0x38069f in _0x5be31b){if(_0x5be31b[_0xca9c('0x25')](_0x38069f)){var _0x4fa5f1={};for(var _0x2530bd=0x0;_0x2530bd<_0x5be31b[_0x38069f][_0xca9c('0x45')];_0x2530bd+=0x1){var _0x7a4b85=_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x58')];if(_0x12370f[_0xca9c('0x13')][_0x7a4b85]){if(_0x5be31b[_0x38069f][_0x2530bd]['queuecallerexit']){_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x59')]+=0x1;}if(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5a')]){_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x34')]+=0x1;}_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x2e')]+=moment(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5b')])[_0xca9c('0x5c')](moment(_0x5be31b[_0x38069f][_0x2530bd]['queuecallerjoinAt']),_0xca9c('0x5d'))||0x0;if(_0x2530bd===_0x5be31b[_0x38069f][_0xca9c('0x45')]-0x1){_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x2f')]+=moment(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5e')]||_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5f')]||_0x5be31b[_0x38069f][_0x2530bd]['queuecallerexitAt'])[_0xca9c('0x5c')](moment(_0x5be31b[_0x38069f][_0x2530bd]['queuecallerjoinAt']),_0xca9c('0x5d'))||0x0;_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x2c')]+=0x1;if(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x60')]){_0x12370f['voiceQueues'][_0x7a4b85]['answered']+=0x1;_0x12370f['voiceQueues'][_0x7a4b85][_0xca9c('0x30')]+=moment(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5e')])[_0xca9c('0x5c')](moment(_0x5be31b[_0x38069f][_0x2530bd][_0xca9c('0x5b')]),'seconds')||0x0;}}else{_0x12370f[_0xca9c('0x13')][_0x7a4b85][_0xca9c('0x2f')]+=_0x12370f[_0xca9c('0x13')][_0x7a4b85]['sumHoldTime']||0x0;}}}}}}return _0x12370f[_0xca9c('0x13')];};};Realtime[_0xca9c('0x41')][_0xca9c('0x61')]=function(){var _0x424277=this;return function(_0x204670){clearVoiceCallReports(_0x424277[_0xca9c('0x16')]);if(_0x204670){for(var _0x2cb14b=0x0;_0x2cb14b<_0x204670[_0xca9c('0x45')];_0x2cb14b+=0x1){_0x424277[_0xca9c('0x16')][_0xca9c('0x2c')]+=0x1;_0x424277['outbound'][_0xca9c('0x2f')]+=_0x204670[_0x2cb14b]['duration'];if(_0x204670[_0x2cb14b][_0xca9c('0x62')]===_0xca9c('0x63')){_0x424277[_0xca9c('0x16')][_0xca9c('0x2d')]+=0x1;_0x424277[_0xca9c('0x16')][_0xca9c('0x2e')]+=_0x204670[_0x2cb14b][_0xca9c('0x64')]-_0x204670[_0x2cb14b][_0xca9c('0x65')]||0x0;_0x424277[_0xca9c('0x16')][_0xca9c('0x30')]+=_0x204670[_0x2cb14b]['billableseconds'];}}}return _0x424277[_0xca9c('0x16')];};};Realtime['prototype'][_0xca9c('0x66')]=function(){var _0x1cce6f=this;return function(_0x4586cf){if(_0x4586cf){freeIsNotKey(_0x4586cf,_0x1cce6f[_0xca9c('0x14')],_0xca9c('0x28'));for(var _0x1f55b3=0x0,_0xe591bf={};_0x1f55b3<_0x4586cf[_0xca9c('0x45')];_0x1f55b3+=0x1){_0xe591bf=_0x4586cf[_0x1f55b3];if(_['isUndefined'](_0x1cce6f[_0xca9c('0x14')][_0xe591bf[_0xca9c('0x28')]])){_0x1cce6f[_0xca9c('0x14')][_0xe591bf[_0xca9c('0x28')]]=new Campaign(_0xe591bf);}else{_0x1cce6f[_0xca9c('0x42')](_0x1cce6f[_0xca9c('0x14')][_0xe591bf[_0xca9c('0x28')]],_0xe591bf);_0x1cce6f[_0xca9c('0x14')][_0xe591bf[_0xca9c('0x28')]]['dialQueueProject']=_0xe591bf[_0xca9c('0x67')]?_0xe591bf[_0xca9c('0x67')][_0xca9c('0x28')]:undefined;}}}return _0x1cce6f[_0xca9c('0x14')];};};Realtime[_0xca9c('0x41')]['initVoiceExtensions']=function(){var _0x22a485=this;return function(_0x77dd19){if(_0x77dd19){freeIsNotKey(_0x77dd19,_0x22a485['voiceExtensions'],'id');for(var _0x54ebc2=0x0,_0x15394a={};_0x54ebc2<_0x77dd19[_0xca9c('0x45')];_0x54ebc2+=0x1){_0x15394a=_0x77dd19[_0x54ebc2];if(_['isUndefined'](_0x22a485[_0xca9c('0x17')][_0x15394a['id']])){_0x22a485[_0xca9c('0x17')][_0x15394a['id']]=new VoiceExtension(_0x15394a);}else{_0x22a485[_0xca9c('0x42')](_0x22a485[_0xca9c('0x17')][_0x15394a['id']],_0x15394a);}}}return _0x22a485[_0xca9c('0x17')];};};Realtime[_0xca9c('0x41')][_0xca9c('0x68')]=function(){var _0x38ac04=this;return function(_0xb36b56){clearCampaigns(_0x38ac04['campaigns']);for(var _0x575b56=0x0;_0x575b56<_0xb36b56['length'];_0x575b56+=0x1){_['merge'](_0x38ac04[_0xca9c('0x14')][_0xb36b56[_0x575b56][_0xca9c('0x28')]],_0xb36b56[_0x575b56]);}return _0x38ac04['campaigns'];};};Realtime[_0xca9c('0x41')]['initFaxAccounts']=function(){var _0x2cba05=this;return function(_0x225abb){if(_0x225abb){freeIsNotKey(_0x225abb,_0x2cba05[_0xca9c('0x24')],'id');for(var _0x4a7f72=0x0,_0x5dd7a1={},_0x2a30c2={};_0x4a7f72<_0x225abb[_0xca9c('0x45')];_0x4a7f72+=0x1){_0x5dd7a1=_0x225abb[_0x4a7f72];if(_[_0xca9c('0x46')](_0x2cba05[_0xca9c('0x24')][_0x5dd7a1['id']])){_0x2cba05[_0xca9c('0x24')][_0x5dd7a1['id']]=new FaxAccount(_0x5dd7a1);}else{_0x2cba05[_0xca9c('0x42')](_0x2cba05[_0xca9c('0x24')][_0x5dd7a1['id']],_0x5dd7a1);}}}return _0x2cba05['faxAccounts'];};};module[_0xca9c('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index ac433c3..37b942e 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 _0x15df=['./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','telephones','interface','format','SIP/%s','assigned','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','callerid','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','uniqueid','monitors','length','monitorFilename','filename','createdAt','connectedlinenum','calleridname','connectedlinename','membername','xcally-motion-dialer','forEach','channel','startsWith','substring','indexOf','lastIndexOf','isNil','exports','lodash','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport'];(function(_0x2de602,_0x2157a8){var _0x48514a=function(_0x265cf3){while(--_0x265cf3){_0x2de602['push'](_0x2de602['shift']());}};_0x48514a(++_0x2157a8);}(_0x15df,0xa1));var _0xf15d=function(_0x3ef448,_0x28300f){_0x3ef448=_0x3ef448-0x0;var _0x2d27cf=_0x15df[_0x3ef448];return _0x2d27cf;};'use strict';var _=require(_0xf15d('0x0'));var moment=require(_0xf15d('0x1'));var util=require(_0xf15d('0x2'));var config=require(_0xf15d('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xf15d('0x4'));var RpcVoiceCallReport=require(_0xf15d('0x5'));var RpcVoiceDialReport=require(_0xf15d('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xf15d('0x7'));var RpcVoiceRecording=require(_0xf15d('0x8'));var RpcVoiceTransferReport=require(_0xf15d('0x9'));var VoiceQueueReport=require(_0xf15d('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xf15d('0xb'));var UserReport=require(_0xf15d('0xc'));function Report(_0x1d4cb5){this[_0xf15d('0xd')]=_0x1d4cb5;this[_0xf15d('0xe')]=_0x1d4cb5['agents'];this['telephones']=_0x1d4cb5['telephones'];}Report[_0xf15d('0xf')][_0xf15d('0x10')]=function(_0x2e17ee){var _0x44eaa7=new VoiceQueueReport(this[_0xf15d('0xd')]);var _0x988fd3=new VoiceAgentReport(this[_0xf15d('0xd')]);var _0x3a2e81=new VoiceDialReport(this[_0xf15d('0xd')]);var _0x24def6=new VoiceCallReport(this[_0xf15d('0xd')]);var _0x2b4c92=new UserReport(this[_0xf15d('0xd')]);if(config['xdr']&&config[_0xf15d('0x11')][_0xf15d('0x12')]){ami['on'](_0xf15d('0x13'),this[_0xf15d('0x14')][_0xf15d('0x15')](this));ami['on'](_0xf15d('0x16'),this[_0xf15d('0x17')][_0xf15d('0x15')](this));ami['on'](_0xf15d('0x18'),this[_0xf15d('0x19')]['bind'](this));ami['on'](_0xf15d('0x1a'),this[_0xf15d('0x1b')][_0xf15d('0x15')](this));ami['on'](_0xf15d('0x1c'),this[_0xf15d('0x1d')][_0xf15d('0x15')](this));ami['on'](_0xf15d('0x1e'),this[_0xf15d('0x1f')][_0xf15d('0x15')](this));}};Report[_0xf15d('0xf')][_0xf15d('0x20')]=function(_0x241bb3){var _0x420549;_0x420549=_[_0xf15d('0x21')](this[_0xf15d('0xe')],function(_0x3f3151){return _0x3f3151[_0xf15d('0x22')]==_0x241bb3||_0x3f3151[_0xf15d('0x23')]==_0x241bb3;});if(_['isNil'](_0x420549)){var _0x39bfd2=_[_0xf15d('0x21')](this[_0xf15d('0x24')],function(_0xeb601d){return _0xeb601d['accountcode']==_0x241bb3||_0xeb601d[_0xf15d('0x23')]==_0x241bb3;});if(_0x39bfd2){_0x420549=_['find'](this[_0xf15d('0xe')],function(_0xe14537){return _0xe14537[_0xf15d('0x25')]==util[_0xf15d('0x26')](_0xf15d('0x27'),_0x39bfd2[_0xf15d('0x23')]);});}}return _0x420549;};Report['prototype'][_0xf15d('0x14')]=function(_0xe5e895){for(var _0x48d9ce=0x0;_0x48d9ce<_0xe5e895['length'];_0x48d9ce+=0x1){var _0x4ba867=this[_0xf15d('0x20')](_0xe5e895[_0x48d9ce]['connectedlinenum']);if(_0x4ba867){_0xe5e895[_0x48d9ce][_0xf15d('0x22')]=_0x4ba867[_0xf15d('0x22')];_0xe5e895[_0x48d9ce][_0xf15d('0x28')]=!![];_0xe5e895[_0x48d9ce]['lastAssignedTo']=_0x4ba867[_0xf15d('0x23')];_0xe5e895[_0x48d9ce][_0xf15d('0x25')]=_['isNil'](_0x4ba867['interface'])?util[_0xf15d('0x26')]('SIP/%s',_0x4ba867[_0xf15d('0x23')]):_0x4ba867[_0xf15d('0x25')];if(_0xe5e895[_0x48d9ce]['queuecallercomplete']){_0xe5e895[_0x48d9ce][_0xf15d('0x29')]=moment()[_0xf15d('0x26')](_0xf15d('0x2a'));}if(_0xe5e895[_0x48d9ce][_0xf15d('0x2b')]){_0xe5e895[_0x48d9ce][_0xf15d('0x2c')]=moment()[_0xf15d('0x26')](_0xf15d('0x2a'));}RpcMemberReport['voiceQueueReport'](_0xe5e895[_0x48d9ce]);}RpcVoiceQueueReport[_0xf15d('0x2d')](_0xe5e895[_0x48d9ce]);}};function extractCalleridNumber(_0x561b4e){var _0xeca2c5=_0x561b4e[_0xf15d('0x2e')](/<(.*?)>/);return _0xeca2c5?_0xeca2c5[0x1]:_0x561b4e;}Report[_0xf15d('0xf')][_0xf15d('0x17')]=function(_0x33c992){_0x33c992[_0xf15d('0x2f')]=_0x33c992[_0xf15d('0x2f')]||_0x33c992[_0xf15d('0x30')];if(_0x33c992[_0xf15d('0x31')]==_0xf15d('0x32')){_0x33c992[_0xf15d('0x33')]=_0xf15d('0x34');_0x33c992[_0xf15d('0x35')]=_0x33c992[_0xf15d('0x34')];if(_0x33c992[_0xf15d('0x36')]=='from-voip-provider'){_0x33c992[_0xf15d('0x22')]='';_0x33c992[_0xf15d('0x2f')]=extractCalleridNumber(_0x33c992['callerid']);}else if(_0x33c992[_0xf15d('0x36')]==_0xf15d('0x37')){if(_0x33c992[_0xf15d('0x2f')]==_0xf15d('0x38')){_0x33c992[_0xf15d('0x2f')]=extractCalleridNumber(_0x33c992[_0xf15d('0x39')]);_0x33c992[_0xf15d('0x3a')]=_0x33c992['originatecalleridnum'];_0x33c992['destinationchannel']=[_0x33c992['channel'],_0x33c992['channel']=_0x33c992[_0xf15d('0x3b')]][0x0];_0x33c992[_0xf15d('0x3c')]=_0x33c992[_0xf15d('0x39')];}else{_0x33c992[_0xf15d('0x2f')]=_0x33c992[_0xf15d('0x3a')];_0x33c992['calleridnum']=_0x33c992[_0xf15d('0x3d')];if(_0x33c992['disposition']==_0xf15d('0x3e')){_0x33c992[_0xf15d('0x22')]=_0x33c992['connectedlinenum'];}else{_0x33c992['accountcode']='';}}}}else{_0x33c992['callerid']=util[_0xf15d('0x26')](_0xf15d('0x3f'),_0x33c992['calleridname'],_0x33c992[_0xf15d('0x3a')]);}if(RpcVoiceTransferReport[_0xf15d('0x40')][_0x33c992[_0xf15d('0x41')]]){var _0x22ffde=RpcVoiceTransferReport[_0xf15d('0x40')][_0x33c992[_0xf15d('0x41')]];_0x22ffde[_0xf15d('0x42')]=_0x33c992[_0xf15d('0x43')];RpcVoiceTransferReport[_0xf15d('0x1d')](_0x22ffde);delete RpcVoiceTransferReport[_0xf15d('0x40')][_0x33c992['linkedid']];}RpcVoiceCallReport[_0xf15d('0x2d')](_0x33c992);if(_0x33c992['monitor']){for(var _0x4f56b0=0x0;_0x4f56b0<_0x33c992[_0xf15d('0x44')][_0xf15d('0x45')];_0x4f56b0+=0x1){_0x33c992[_0xf15d('0x46')]=_0x33c992[_0xf15d('0x44')][_0x4f56b0][_0xf15d('0x47')];_0x33c992[_0xf15d('0x48')]=_0x33c992[_0xf15d('0x44')][_0x4f56b0][_0xf15d('0x48')];if(_0x33c992[_0xf15d('0x30')]==_0xf15d('0x38')){_0x33c992[_0xf15d('0x3a')]=_0x33c992[_0xf15d('0x49')];_0x33c992[_0xf15d('0x4a')]=_0x33c992['connectedlinename'];_0x33c992['connectedlinenum']=_0x33c992['accountcode'];_0x33c992[_0xf15d('0x4b')]=_0x33c992[_0xf15d('0x4c')];_0x33c992[_0xf15d('0x30')]=_0x33c992[_0xf15d('0x3d')];}else if(_0x33c992[_0xf15d('0x30')]==_0xf15d('0x4d')){_0x33c992['calleridnum']=_0x33c992['destination'];_0x33c992[_0xf15d('0x30')]=_0x33c992[_0xf15d('0x3d')];}RpcVoiceRecording[_0xf15d('0x2d')](_0x33c992);}}};Report['prototype'][_0xf15d('0x19')]=function(_0x2ff84f){if(_['isArray'](_0x2ff84f)){_0x2ff84f[_0xf15d('0x4e')](function(_0x43fc44){RpcVoiceAgentReport[_0xf15d('0x2d')](_0x43fc44);});}else{RpcVoiceAgentReport['create'](_0x2ff84f);}};Report[_0xf15d('0xf')][_0xf15d('0x1b')]=function(_0x1b7b15){RpcVoiceDialReport[_0xf15d('0x2d')](_0x1b7b15);var _0x18adb8;var _0x55e29b;var _0xacffb7=_0x1b7b15[_0xf15d('0x4f')];if(_[_0xf15d('0x50')](_0xacffb7,'Local')){_0x55e29b=_0xacffb7[_0xf15d('0x51')](_0xacffb7[_0xf15d('0x52')]('/')+0x1,_0xacffb7[_0xf15d('0x52')]('@'));_0x18adb8=_[_0xf15d('0x21')](this['agents'],function(_0x2f5f31){return _0x2f5f31['mobile']==_0x55e29b||_0x2f5f31['phone']==_0x55e29b||_0x2f5f31[_0xf15d('0x22')]==_0x55e29b;});}else{_0x55e29b=_0xacffb7[_0xf15d('0x51')](_0xacffb7[_0xf15d('0x52')]('/')+0x1,_0xacffb7[_0xf15d('0x53')]('-'));_0x18adb8=this[_0xf15d('0x20')](_0x55e29b);}if(_0x18adb8){_0x1b7b15[_0xf15d('0x25')]=_[_0xf15d('0x54')](_0x18adb8[_0xf15d('0x25')])?util[_0xf15d('0x26')](_0xf15d('0x27'),_0x18adb8[_0xf15d('0x23')]):_0x18adb8[_0xf15d('0x25')];_0x1b7b15[_0xf15d('0x4c')]=_0x18adb8[_0xf15d('0x23')];_0x1b7b15[_0xf15d('0x22')]=_0x18adb8[_0xf15d('0x22')];RpcMemberReport['voiceDialReport'](_0x1b7b15);}};Report[_0xf15d('0xf')][_0xf15d('0x1d')]=function(_0x1941cc){RpcVoiceTransferReport[_0xf15d('0x40')][_0x1941cc['transfererlinkedid']]=_0x1941cc;};Report[_0xf15d('0xf')][_0xf15d('0x1f')]=function(_0x337df8){RpcVoiceTransferReport[_0xf15d('0x1f')](_0x337df8);};module[_0xf15d('0x55')]=Report; \ No newline at end of file +var _0x9a9a=['\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','exten','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','lastIndexOf','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','name','accountcode','SIP/%s','prototype','length','connectedlinenum','assigned','lastAssignedTo','interface','isNil','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','queue','lastdata','context','from-voip-provider','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','callerid','disposition','ANSWERED'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9a9a,0xc3));var _0xa9a9=function(_0x4a9afa,_0x2f6d8d){_0x4a9afa=_0x4a9afa-0x0;var _0x2e7f04=_0x9a9a[_0x4a9afa];return _0x2e7f04;};'use strict';var _=require(_0xa9a9('0x0'));var moment=require(_0xa9a9('0x1'));var util=require(_0xa9a9('0x2'));var config=require('../../../config/environment');var ami=require(_0xa9a9('0x3'));var RpcVoiceAgentReport=require(_0xa9a9('0x4'));var RpcVoiceCallReport=require(_0xa9a9('0x5'));var RpcVoiceDialReport=require(_0xa9a9('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xa9a9('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xa9a9('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xa9a9('0x9'));var VoiceAgentReport=require(_0xa9a9('0xa'));var VoiceDialReport=require(_0xa9a9('0xb'));var UserReport=require(_0xa9a9('0xc'));function Report(_0x4b43cc){this['realtime']=_0x4b43cc;this[_0xa9a9('0xd')]=_0x4b43cc[_0xa9a9('0xd')];this[_0xa9a9('0xe')]=_0x4b43cc[_0xa9a9('0xe')];}Report['prototype'][_0xa9a9('0xf')]=function(_0x13e8e3){var _0x160e2c=new VoiceQueueReport(this[_0xa9a9('0x10')]);var _0x529802=new VoiceAgentReport(this[_0xa9a9('0x10')]);var _0x44f6bd=new VoiceDialReport(this[_0xa9a9('0x10')]);var _0x479ce0=new VoiceCallReport(this['realtime']);var _0x484ccd=new UserReport(this[_0xa9a9('0x10')]);if(config[_0xa9a9('0x11')]&&config['xdr']['disabled']){ami['on'](_0xa9a9('0x12'),this[_0xa9a9('0x13')][_0xa9a9('0x14')](this));ami['on'](_0xa9a9('0x15'),this[_0xa9a9('0x16')][_0xa9a9('0x14')](this));ami['on'](_0xa9a9('0x17'),this[_0xa9a9('0x18')]['bind'](this));ami['on'](_0xa9a9('0x19'),this[_0xa9a9('0x1a')][_0xa9a9('0x14')](this));ami['on'](_0xa9a9('0x1b'),this[_0xa9a9('0x1c')][_0xa9a9('0x14')](this));ami['on']('attendedtransfer',this[_0xa9a9('0x1d')][_0xa9a9('0x14')](this));}};Report['prototype'][_0xa9a9('0x1e')]=function(_0x599eb8){var _0x2aaa25;_0x2aaa25=_[_0xa9a9('0x1f')](this[_0xa9a9('0xd')],function(_0x4dc978){return _0x4dc978['accountcode']==_0x599eb8||_0x4dc978[_0xa9a9('0x20')]==_0x599eb8;});if(_['isNil'](_0x2aaa25)){var _0x433f53=_['find'](this[_0xa9a9('0xe')],function(_0x4e356c){return _0x4e356c[_0xa9a9('0x21')]==_0x599eb8||_0x4e356c[_0xa9a9('0x20')]==_0x599eb8;});if(_0x433f53){_0x2aaa25=_[_0xa9a9('0x1f')](this[_0xa9a9('0xd')],function(_0x3f1510){return _0x3f1510['interface']==util['format'](_0xa9a9('0x22'),_0x433f53[_0xa9a9('0x20')]);});}}return _0x2aaa25;};Report[_0xa9a9('0x23')][_0xa9a9('0x13')]=function(_0x5316c6){for(var _0x10a179=0x0;_0x10a179<_0x5316c6[_0xa9a9('0x24')];_0x10a179+=0x1){var _0x69b67d=this[_0xa9a9('0x1e')](_0x5316c6[_0x10a179][_0xa9a9('0x25')]);if(_0x69b67d){_0x5316c6[_0x10a179]['accountcode']=_0x69b67d[_0xa9a9('0x21')];_0x5316c6[_0x10a179][_0xa9a9('0x26')]=!![];_0x5316c6[_0x10a179][_0xa9a9('0x27')]=_0x69b67d[_0xa9a9('0x20')];_0x5316c6[_0x10a179][_0xa9a9('0x28')]=_[_0xa9a9('0x29')](_0x69b67d[_0xa9a9('0x28')])?util[_0xa9a9('0x2a')](_0xa9a9('0x22'),_0x69b67d[_0xa9a9('0x20')]):_0x69b67d[_0xa9a9('0x28')];if(_0x5316c6[_0x10a179]['queuecallercomplete']){_0x5316c6[_0x10a179]['queuecallercompleteAt']=moment()[_0xa9a9('0x2a')](_0xa9a9('0x2b'));}if(_0x5316c6[_0x10a179][_0xa9a9('0x2c')]){_0x5316c6[_0x10a179][_0xa9a9('0x2d')]=moment()[_0xa9a9('0x2a')](_0xa9a9('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x5316c6[_0x10a179]);}RpcVoiceQueueReport[_0xa9a9('0x2e')](_0x5316c6[_0x10a179]);}};function extractCalleridNumber(_0x31187d){var _0x130714=_0x31187d[_0xa9a9('0x2f')](/<(.*?)>/);return _0x130714?_0x130714[0x1]:_0x31187d;}Report['prototype'][_0xa9a9('0x16')]=function(_0x46f358){_0x46f358[_0xa9a9('0x30')]=_0x46f358[_0xa9a9('0x30')]||_0x46f358['exten'];if(_0x46f358[_0xa9a9('0x31')]==_0xa9a9('0x32')){_0x46f358['lastapplication']=_0xa9a9('0x33');_0x46f358[_0xa9a9('0x34')]=_0x46f358[_0xa9a9('0x33')];if(_0x46f358[_0xa9a9('0x35')]==_0xa9a9('0x36')){_0x46f358['accountcode']='';_0x46f358[_0xa9a9('0x30')]=extractCalleridNumber(_0x46f358['callerid']);}else if(_0x46f358['context']=='from-sip'){if(_0x46f358['destination']=='xcally-motion-preview'){_0x46f358[_0xa9a9('0x30')]=extractCalleridNumber(_0x46f358[_0xa9a9('0x37')]);_0x46f358[_0xa9a9('0x38')]=_0x46f358[_0xa9a9('0x39')];_0x46f358['destinationchannel']=[_0x46f358[_0xa9a9('0x3a')],_0x46f358['channel']=_0x46f358[_0xa9a9('0x3b')]][0x0];_0x46f358[_0xa9a9('0x3c')]=_0x46f358[_0xa9a9('0x37')];}else{_0x46f358[_0xa9a9('0x30')]=_0x46f358['calleridnum'];_0x46f358[_0xa9a9('0x38')]=_0x46f358['originatecalleridnum'];if(_0x46f358[_0xa9a9('0x3d')]==_0xa9a9('0x3e')){_0x46f358['accountcode']=_0x46f358[_0xa9a9('0x25')];}else{_0x46f358[_0xa9a9('0x21')]='';}}}}else{_0x46f358[_0xa9a9('0x3c')]=util[_0xa9a9('0x2a')](_0xa9a9('0x3f'),_0x46f358[_0xa9a9('0x40')],_0x46f358[_0xa9a9('0x38')]);}if(RpcVoiceTransferReport[_0xa9a9('0x41')][_0x46f358[_0xa9a9('0x42')]]){var _0x3f878b=RpcVoiceTransferReport[_0xa9a9('0x41')][_0x46f358[_0xa9a9('0x42')]];_0x3f878b['transfereelinkedid']=_0x46f358[_0xa9a9('0x43')];RpcVoiceTransferReport[_0xa9a9('0x1c')](_0x3f878b);delete RpcVoiceTransferReport[_0xa9a9('0x41')][_0x46f358[_0xa9a9('0x42')]];}RpcVoiceCallReport['create'](_0x46f358);if(_0x46f358[_0xa9a9('0x44')]){for(var _0x438c62=0x0;_0x438c62<_0x46f358[_0xa9a9('0x45')][_0xa9a9('0x24')];_0x438c62+=0x1){_0x46f358[_0xa9a9('0x46')]=_0x46f358[_0xa9a9('0x45')][_0x438c62][_0xa9a9('0x47')];_0x46f358['createdAt']=_0x46f358[_0xa9a9('0x45')][_0x438c62][_0xa9a9('0x48')];if(_0x46f358[_0xa9a9('0x49')]==_0xa9a9('0x4a')){_0x46f358[_0xa9a9('0x38')]=_0x46f358['connectedlinenum'];_0x46f358['calleridname']=_0x46f358[_0xa9a9('0x4b')];_0x46f358[_0xa9a9('0x25')]=_0x46f358['accountcode'];_0x46f358[_0xa9a9('0x4b')]=_0x46f358[_0xa9a9('0x4c')];_0x46f358[_0xa9a9('0x49')]=_0x46f358['originatecalleridnum'];}else if(_0x46f358[_0xa9a9('0x49')]==_0xa9a9('0x4d')){_0x46f358[_0xa9a9('0x38')]=_0x46f358[_0xa9a9('0x30')];_0x46f358[_0xa9a9('0x49')]=_0x46f358[_0xa9a9('0x39')];}RpcVoiceRecording['create'](_0x46f358);}}};Report[_0xa9a9('0x23')][_0xa9a9('0x18')]=function(_0x555d64){if(_[_0xa9a9('0x4e')](_0x555d64)){_0x555d64[_0xa9a9('0x4f')](function(_0x5f0615){RpcVoiceAgentReport['create'](_0x5f0615);});}else{RpcVoiceAgentReport[_0xa9a9('0x2e')](_0x555d64);}};Report['prototype'][_0xa9a9('0x1a')]=function(_0x1eaebd){RpcVoiceDialReport[_0xa9a9('0x2e')](_0x1eaebd);var _0x23ce2f;var _0x395f8c;var _0x360fd0=_0x1eaebd[_0xa9a9('0x3a')];if(_[_0xa9a9('0x50')](_0x360fd0,'Local')){_0x395f8c=_0x360fd0[_0xa9a9('0x51')](_0x360fd0[_0xa9a9('0x52')]('/')+0x1,_0x360fd0['indexOf']('@'));_0x23ce2f=_[_0xa9a9('0x1f')](this[_0xa9a9('0xd')],function(_0x1d92d8){return _0x1d92d8[_0xa9a9('0x53')]==_0x395f8c||_0x1d92d8['phone']==_0x395f8c||_0x1d92d8[_0xa9a9('0x21')]==_0x395f8c;});}else{_0x395f8c=_0x360fd0[_0xa9a9('0x51')](_0x360fd0[_0xa9a9('0x52')]('/')+0x1,_0x360fd0[_0xa9a9('0x54')]('-'));_0x23ce2f=this[_0xa9a9('0x1e')](_0x395f8c);}if(_0x23ce2f){_0x1eaebd[_0xa9a9('0x28')]=_[_0xa9a9('0x29')](_0x23ce2f[_0xa9a9('0x28')])?util[_0xa9a9('0x2a')](_0xa9a9('0x22'),_0x23ce2f[_0xa9a9('0x20')]):_0x23ce2f[_0xa9a9('0x28')];_0x1eaebd[_0xa9a9('0x4c')]=_0x23ce2f[_0xa9a9('0x20')];_0x1eaebd[_0xa9a9('0x21')]=_0x23ce2f[_0xa9a9('0x21')];RpcMemberReport[_0xa9a9('0x1a')](_0x1eaebd);}};Report[_0xa9a9('0x23')][_0xa9a9('0x1c')]=function(_0x128f24){RpcVoiceTransferReport['transfers'][_0x128f24['transfererlinkedid']]=_0x128f24;};Report[_0xa9a9('0x23')][_0xa9a9('0x1d')]=function(_0x1e9782){RpcVoiceTransferReport[_0xa9a9('0x1d')](_0x1e9782);};module[_0xa9a9('0x55')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 3329186..2ede182 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 _0x3576=['[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','merge','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','substring','indexOf','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','peerstatus','[userReport][peerstatus]','status','address','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','../../../config/logger','ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','bind','syncRegistry','devicestatechange','syncDeviceState','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','actionDeviceStateList','[userReport][devicestatelist]','[userReport][sippeerstatus]','inspect','prototype','isNotNull','isUndefined','emit','info'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x3576,0x177));var _0x6357=function(_0x3286b2,_0x149520){_0x3286b2=_0x3286b2-0x0;var _0x5867ab=_0x3576[_0x3286b2];return _0x5867ab;};'use strict';var _=require(_0x6357('0x0'));var moment=require(_0x6357('0x1'));var util=require(_0x6357('0x2'));var Redis=require(_0x6357('0x3'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x6357('0x4'))(_0x6357('0x5'));var ami=require('../ami');config[_0x6357('0x6')]=_[_0x6357('0x7')](config[_0x6357('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x6357('0x8'))(new Redis(config[_0x6357('0x6')]));function UserReport(_0x3dc5c8){this[_0x6357('0x9')]=_0x3dc5c8['trunks'];this[_0x6357('0xa')]=_0x3dc5c8['agents'];this[_0x6357('0xb')]=_0x3dc5c8['telephones'];ami['on'](_0x6357('0xc'),this['syncRegistry'][_0x6357('0xd')](this));ami['on']('registry',this[_0x6357('0xe')][_0x6357('0xd')](this));ami['on'](_0x6357('0xf'),this[_0x6357('0x10')]['bind'](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));return this[_0x6357('0x11')]();}function showSipRegistrations(){Promise[_0x6357('0x12')]()[_0x6357('0x13')](ami[_0x6357('0x14')]())[_0x6357('0x15')](function(_0x16ebd3){logger[_0x6357('0x16')](_0x6357('0x17'),util['inspect'](_0x16ebd3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0x6357('0x13')](ami[_0x6357('0x18')]())[_0x6357('0x15')](function(_0x44561d){logger[_0x6357('0x16')](_0x6357('0x19'),util['inspect'](_0x44561d,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x6357('0x13')](ami['actionSipPeerStatus']())[_0x6357('0x15')](function(_0x354ef3){logger[_0x6357('0x16')](_0x6357('0x1a'),util[_0x6357('0x1b')](_0x354ef3,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x6357('0x11')]=function(){setInterval(function(){BPromise[_0x6357('0x12')]()[_0x6357('0x13')](showSipRegistrations())[_0x6357('0x13')](listDeviceStates())[_0x6357('0x13')](showPeersStatus());},0x32c8);};UserReport[_0x6357('0x1c')][_0x6357('0x1d')]=function(_0x6b0232){return _0x6b0232!==null&&!_[_0x6357('0x1e')](_0x6b0232);};UserReport[_0x6357('0x1c')][_0x6357('0x1f')]=function(_0x305e50,_0x5a05a3,_0x417fd3){io['to'](_0x305e50)[_0x6357('0x1f')](_0x5a05a3,_0x417fd3);};UserReport[_0x6357('0x1c')][_0x6357('0xe')]=function(_0x47fa5d){try{if(this[_0x6357('0x1d')](_0x47fa5d)){logger[_0x6357('0x20')](_0x6357('0x21'),_0x47fa5d[_0x6357('0x22')],_0x47fa5d[_0x6357('0x23')]);logger['debug'](_0x6357('0x24'),util[_0x6357('0x1b')](_0x47fa5d,{'showHidden':![],'depth':null}));var _0x2cd93c=_['find'](this['trunks'],{'defaultuser':_0x47fa5d[_0x6357('0x22')]});if(_0x2cd93c){_0x47fa5d['stateRegistry']=_0x47fa5d[_0x6357('0x23')];_[_0x6357('0x25')](_0x2cd93c,_[_0x6357('0x26')](_0x47fa5d,[_0x6357('0x27'),_0x6357('0x28'),'username',_0x6357('0x23')]));logger[_0x6357('0x29')](_0x6357('0x2a'),util[_0x6357('0x1b')](_0x2cd93c,{'showHidden':![],'depth':null}));this[_0x6357('0x1f')](util[_0x6357('0x2b')](_0x6357('0x2c'),_0x2cd93c['name']),_0x6357('0x2d'),_0x2cd93c);}}}catch(_0x3bb7ff){logger[_0x6357('0x16')](_0x6357('0x24'),util[_0x6357('0x1b')](_0x3bb7ff,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6357('0x10')]=function(_0x377652){try{if(this[_0x6357('0x1d')](_0x377652)){logger['info'](_0x6357('0x2e'),_0x377652[_0x6357('0x2f')],_0x377652[_0x6357('0x23')]);logger['debug'](_0x6357('0x30'),util[_0x6357('0x1b')](_0x377652,{'showHidden':![],'depth':null}));if(this['agents'][_0x377652[_0x6357('0x2f')]]){if(!this[_0x6357('0xa')][_0x377652['device']][_0x6357('0x31')]||_0x377652[_0x6357('0x23')]['toLowerCase']()=='inuse'){this[_0x6357('0xa')][_0x377652[_0x6357('0x2f')]][_0x6357('0x31')]=![];if(this[_0x6357('0xa')][_0x377652[_0x6357('0x2f')]][_0x6357('0x23')]!==_0x377652['state'][_0x6357('0x32')]()){this[_0x6357('0xa')][_0x377652[_0x6357('0x2f')]][_0x6357('0x33')]=_[_0x6357('0x34')](moment()[_0x6357('0x2b')]('x'));}this[_0x6357('0xa')][_0x377652[_0x6357('0x2f')]][_0x6357('0x23')]=_0x377652['state'][_0x6357('0x32')]();this[_0x6357('0xa')][_0x377652[_0x6357('0x2f')]][_0x6357('0x35')](_0x377652);}}else if(this[_0x6357('0xb')][_0x377652['device']]){if(this[_0x6357('0xb')][_0x377652[_0x6357('0x2f')]][_0x6357('0x23')]!==_0x377652[_0x6357('0x23')]['toLowerCase']()){this[_0x6357('0xb')][_0x377652[_0x6357('0x2f')]][_0x6357('0x33')]=_[_0x6357('0x34')](moment()[_0x6357('0x2b')]('x'));}this[_0x6357('0xb')][_0x377652['device']][_0x6357('0x23')]=_0x377652[_0x6357('0x23')][_0x6357('0x32')]();logger[_0x6357('0x29')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this['telephones'][_0x377652['device']],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x6357('0xb')][_0x377652[_0x6357('0x2f')]][_0x6357('0x36')]),_0x6357('0x37'),this[_0x6357('0xb')][_0x377652[_0x6357('0x2f')]]);}else if(this[_0x6357('0x9')][_0x377652[_0x6357('0x2f')]]){if(this[_0x6357('0x9')][_0x377652[_0x6357('0x2f')]][_0x6357('0x23')]!==_0x377652[_0x6357('0x23')][_0x6357('0x32')]()){this['trunks'][_0x377652['device']][_0x6357('0x33')]=_[_0x6357('0x34')](moment()['format']('x'));}this[_0x6357('0x9')][_0x377652[_0x6357('0x2f')]][_0x6357('0x23')]=_0x377652[_0x6357('0x23')][_0x6357('0x32')]();logger[_0x6357('0x29')](_0x6357('0x38'),util['inspect'](this[_0x6357('0x9')][_0x377652[_0x6357('0x2f')]],{'showHidden':![],'depth':null}));this[_0x6357('0x1f')](util[_0x6357('0x2b')](_0x6357('0x2c'),this[_0x6357('0x9')][_0x377652[_0x6357('0x2f')]]['name']),_0x6357('0x2d'),this['trunks'][_0x377652['device']]);}else if(_['startsWith'](_0x377652[_0x6357('0x2f')],'Local')){var _0x34a163=_0x377652[_0x6357('0x2f')];var _0x4497e1=_0x34a163[_0x6357('0x39')](_0x34a163[_0x6357('0x3a')]('/')+0x1,_0x34a163[_0x6357('0x3a')]('@'));var _0x3a6118=_['find'](this[_0x6357('0xa')],function(_0x32516f){return _0x32516f['mobile']==_0x4497e1||_0x32516f['phone']==_0x4497e1||_0x32516f['accountcode']==_0x4497e1;});if(_0x3a6118){if(_0x3a6118['state']!==_0x377652[_0x6357('0x23')][_0x6357('0x32')]()){_0x3a6118[_0x6357('0x33')]=_[_0x6357('0x34')](moment()['format']('x'));}_0x3a6118[_0x6357('0x23')]=_0x377652[_0x6357('0x23')][_0x6357('0x32')]();_0x3a6118[_0x6357('0x31')]=!![];_0x3a6118['updateStatusRealtime'](_0x377652);}}}}catch(_0x493c9e){logger[_0x6357('0x16')](_0x6357('0x30'),util[_0x6357('0x1b')](_0x493c9e,{'showHidden':![],'depth':null}));}};UserReport[_0x6357('0x1c')][_0x6357('0x3b')]=function(_0x4a7e32){try{if(this[_0x6357('0x1d')](_0x4a7e32)&&this['isNotNull'](_0x4a7e32['peerstatus'])){logger[_0x6357('0x20')](_0x6357('0x3c'),_0x4a7e32[_0x6357('0x3d')],_0x4a7e32['address'],_0x4a7e32[_0x6357('0x3e')]);logger[_0x6357('0x29')](_0x6357('0x3f'),util['inspect'](_0x4a7e32,{'showHidden':![],'depth':null}));if(this[_0x6357('0xa')][_0x4a7e32[_0x6357('0x3d')]]){if(!this[_0x6357('0xa')][_0x4a7e32[_0x6357('0x3d')]]['local']||_0x4a7e32['peerstatus'][_0x6357('0x32')]()=='registered'){this[_0x6357('0xa')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x31')]=![];this[_0x6357('0xa')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x40')]=_0x4a7e32[_0x6357('0x3e')][_0x6357('0x32')]();this[_0x6357('0xa')][_0x4a7e32['peer']]['address']=_0x4a7e32[_0x6357('0x41')];this[_0x6357('0xa')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x35')](_0x4a7e32);}}else if(this[_0x6357('0xb')][_0x4a7e32['peer']]){this[_0x6357('0xb')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x40')]=_0x4a7e32[_0x6357('0x3e')][_0x6357('0x32')]();this[_0x6357('0xb')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x41')]=_0x4a7e32[_0x6357('0x41')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x6357('0xb')][_0x4a7e32[_0x6357('0x3d')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6357('0x2b')]('telephone:%s',this['telephones'][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x36')]),'telephone:save',this[_0x6357('0xb')][_0x4a7e32[_0x6357('0x3d')]]);}else if(this[_0x6357('0x9')][_0x4a7e32[_0x6357('0x3d')]]){this[_0x6357('0x9')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x40')]=_0x4a7e32[_0x6357('0x3e')]['toLowerCase']();this[_0x6357('0x9')][_0x4a7e32[_0x6357('0x3d')]][_0x6357('0x41')]=_0x4a7e32[_0x6357('0x41')];logger[_0x6357('0x29')](_0x6357('0x42'),util[_0x6357('0x1b')](this['trunks'][_0x4a7e32[_0x6357('0x3d')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',this[_0x6357('0x9')][_0x4a7e32['peer']][_0x6357('0x36')]),_0x6357('0x2d'),this[_0x6357('0x9')][_0x4a7e32[_0x6357('0x3d')]]);}}}catch(_0x5d21ca){logger[_0x6357('0x16')](_0x6357('0x3f'),util[_0x6357('0x1b')](_0x5d21ca,{'showHidden':![],'depth':null}));}};module[_0x6357('0x43')]=UserReport; \ No newline at end of file +var _0xc760=['syncRegistry','registry','bind','devicestatechange','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','inuse','local','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','mobile','accountcode','error','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','ioredis','bluebird','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc760,0xc8));var _0x0c76=function(_0x4d430e,_0x14d80f){_0x4d430e=_0x4d430e-0x0;var _0x2feaa4=_0xc760[_0x4d430e];return _0x2feaa4;};'use strict';var _=require(_0x0c76('0x0'));var moment=require(_0x0c76('0x1'));var util=require('util');var Redis=require(_0x0c76('0x2'));var BPromise=require(_0x0c76('0x3'));var config=require('../../../config/environment');var logger=require(_0x0c76('0x4'))(_0x0c76('0x5'));var ami=require('../ami');config['redis']=_[_0x0c76('0x6')](config[_0x0c76('0x7')],{'host':_0x0c76('0x8'),'port':0x18eb});var io=require(_0x0c76('0x9'))(new Redis(config[_0x0c76('0x7')]));function UserReport(_0x5cbe96){this[_0x0c76('0xa')]=_0x5cbe96[_0x0c76('0xa')];this[_0x0c76('0xb')]=_0x5cbe96['agents'];this[_0x0c76('0xc')]=_0x5cbe96[_0x0c76('0xc')];ami['on']('registryentry',this[_0x0c76('0xd')]['bind'](this));ami['on'](_0x0c76('0xe'),this['syncRegistry'][_0x0c76('0xf')](this));ami['on'](_0x0c76('0x10'),this['syncDeviceState'][_0x0c76('0xf')](this));ami['on'](_0x0c76('0x11'),this['syncPeerStatus'][_0x0c76('0xf')](this));return this[_0x0c76('0x12')]();}function showSipRegistrations(){Promise[_0x0c76('0x13')]()[_0x0c76('0x14')](ami[_0x0c76('0x15')]())[_0x0c76('0x16')](function(_0x393bc7){logger['error'](_0x0c76('0x17'),util[_0x0c76('0x18')](_0x393bc7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0c76('0x13')]()[_0x0c76('0x14')](ami['actionDeviceStateList']())[_0x0c76('0x16')](function(_0x5d357a){logger['error'](_0x0c76('0x19'),util[_0x0c76('0x18')](_0x5d357a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x0c76('0x14')](ami[_0x0c76('0x1a')]())[_0x0c76('0x16')](function(_0x4da662){logger['error'](_0x0c76('0x1b'),util[_0x0c76('0x18')](_0x4da662,{'showHidden':![],'depth':null}));});}UserReport[_0x0c76('0x1c')][_0x0c76('0x12')]=function(){setInterval(function(){BPromise[_0x0c76('0x13')]()[_0x0c76('0x14')](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x0c76('0x1c')][_0x0c76('0x1d')]=function(_0x5410b2){return _0x5410b2!==null&&!_[_0x0c76('0x1e')](_0x5410b2);};UserReport[_0x0c76('0x1c')][_0x0c76('0x1f')]=function(_0x196ac8,_0x3ba386,_0xdb3d04){io['to'](_0x196ac8)['emit'](_0x3ba386,_0xdb3d04);};UserReport[_0x0c76('0x1c')]['syncRegistry']=function(_0x4da0fa){try{if(this[_0x0c76('0x1d')](_0x4da0fa)){logger[_0x0c76('0x20')](_0x0c76('0x21'),_0x4da0fa[_0x0c76('0x22')],_0x4da0fa[_0x0c76('0x23')]);logger[_0x0c76('0x24')](_0x0c76('0x25'),util[_0x0c76('0x18')](_0x4da0fa,{'showHidden':![],'depth':null}));var _0x5a148e=_[_0x0c76('0x26')](this[_0x0c76('0xa')],{'defaultuser':_0x4da0fa[_0x0c76('0x22')]});if(_0x5a148e){_0x4da0fa['stateRegistry']=_0x4da0fa['state'];_['merge'](_0x5a148e,_['omit'](_0x4da0fa,['event','actionid',_0x0c76('0x22'),'state']));logger['debug'](_0x0c76('0x27'),util[_0x0c76('0x18')](_0x5a148e,{'showHidden':![],'depth':null}));this['emit'](util['format']('trunk:%s',_0x5a148e['name']),_0x0c76('0x28'),_0x5a148e);}}}catch(_0x46b064){logger['error'](_0x0c76('0x25'),util['inspect'](_0x46b064,{'showHidden':![],'depth':null}));}};UserReport[_0x0c76('0x1c')][_0x0c76('0x29')]=function(_0x2320db){try{if(this[_0x0c76('0x1d')](_0x2320db)){logger[_0x0c76('0x20')](_0x0c76('0x2a'),_0x2320db[_0x0c76('0x2b')],_0x2320db[_0x0c76('0x23')]);logger[_0x0c76('0x24')]('[userReport][devicestatechange]',util['inspect'](_0x2320db,{'showHidden':![],'depth':null}));if(this[_0x0c76('0xb')][_0x2320db[_0x0c76('0x2b')]]){if(!this[_0x0c76('0xb')][_0x2320db[_0x0c76('0x2b')]]['local']||_0x2320db['state']['toLowerCase']()==_0x0c76('0x2c')){this[_0x0c76('0xb')][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x2d')]=![];if(this['agents'][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x23')]!==_0x2320db[_0x0c76('0x23')][_0x0c76('0x2e')]()){this[_0x0c76('0xb')][_0x2320db['device']][_0x0c76('0x2f')]=_[_0x0c76('0x30')](moment()[_0x0c76('0x31')]('x'));}this['agents'][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x23')]=_0x2320db[_0x0c76('0x23')][_0x0c76('0x2e')]();this[_0x0c76('0xb')][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x32')](_0x2320db);}}else if(this[_0x0c76('0xc')][_0x2320db[_0x0c76('0x2b')]]){if(this[_0x0c76('0xc')][_0x2320db[_0x0c76('0x2b')]]['state']!==_0x2320db[_0x0c76('0x23')][_0x0c76('0x2e')]()){this[_0x0c76('0xc')][_0x2320db['device']][_0x0c76('0x2f')]=_['toNumber'](moment()[_0x0c76('0x31')]('x'));}this[_0x0c76('0xc')][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x23')]=_0x2320db[_0x0c76('0x23')][_0x0c76('0x2e')]();logger[_0x0c76('0x24')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x0c76('0x18')](this['telephones'][_0x2320db['device']],{'showHidden':![],'depth':null}));this[_0x0c76('0x1f')](util[_0x0c76('0x31')](_0x0c76('0x33'),this[_0x0c76('0xc')][_0x2320db['device']][_0x0c76('0x34')]),_0x0c76('0x35'),this[_0x0c76('0xc')][_0x2320db[_0x0c76('0x2b')]]);}else if(this[_0x0c76('0xa')][_0x2320db['device']]){if(this[_0x0c76('0xa')][_0x2320db[_0x0c76('0x2b')]]['state']!==_0x2320db[_0x0c76('0x23')]['toLowerCase']()){this['trunks'][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x2f')]=_[_0x0c76('0x30')](moment()['format']('x'));}this['trunks'][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x23')]=_0x2320db['state'][_0x0c76('0x2e')]();logger[_0x0c76('0x24')](_0x0c76('0x36'),util[_0x0c76('0x18')](this[_0x0c76('0xa')][_0x2320db[_0x0c76('0x2b')]],{'showHidden':![],'depth':null}));this[_0x0c76('0x1f')](util[_0x0c76('0x31')](_0x0c76('0x37'),this[_0x0c76('0xa')][_0x2320db[_0x0c76('0x2b')]][_0x0c76('0x34')]),_0x0c76('0x28'),this[_0x0c76('0xa')][_0x2320db[_0x0c76('0x2b')]]);}else if(_['startsWith'](_0x2320db[_0x0c76('0x2b')],_0x0c76('0x38'))){var _0x1e30c9=_0x2320db[_0x0c76('0x2b')];var _0x592888=_0x1e30c9[_0x0c76('0x39')](_0x1e30c9[_0x0c76('0x3a')]('/')+0x1,_0x1e30c9[_0x0c76('0x3a')]('@'));var _0x18ec13=_[_0x0c76('0x26')](this['agents'],function(_0x15b9c3){return _0x15b9c3[_0x0c76('0x3b')]==_0x592888||_0x15b9c3['phone']==_0x592888||_0x15b9c3[_0x0c76('0x3c')]==_0x592888;});if(_0x18ec13){if(_0x18ec13['state']!==_0x2320db['state'][_0x0c76('0x2e')]()){_0x18ec13['stateTime']=_[_0x0c76('0x30')](moment()[_0x0c76('0x31')]('x'));}_0x18ec13[_0x0c76('0x23')]=_0x2320db[_0x0c76('0x23')][_0x0c76('0x2e')]();_0x18ec13[_0x0c76('0x2d')]=!![];_0x18ec13[_0x0c76('0x32')](_0x2320db);}}}}catch(_0xeb2c64){logger[_0x0c76('0x3d')](_0x0c76('0x3e'),util[_0x0c76('0x18')](_0xeb2c64,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x249dc0){try{if(this[_0x0c76('0x1d')](_0x249dc0)&&this[_0x0c76('0x1d')](_0x249dc0['peerstatus'])){logger[_0x0c76('0x20')](_0x0c76('0x3f'),_0x249dc0['peer'],_0x249dc0[_0x0c76('0x40')],_0x249dc0[_0x0c76('0x11')]);logger[_0x0c76('0x24')](_0x0c76('0x41'),util[_0x0c76('0x18')](_0x249dc0,{'showHidden':![],'depth':null}));if(this[_0x0c76('0xb')][_0x249dc0[_0x0c76('0x42')]]){if(!this['agents'][_0x249dc0['peer']]['local']||_0x249dc0[_0x0c76('0x11')][_0x0c76('0x2e')]()==_0x0c76('0x43')){this[_0x0c76('0xb')][_0x249dc0[_0x0c76('0x42')]]['local']=![];this[_0x0c76('0xb')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x44')]=_0x249dc0[_0x0c76('0x11')][_0x0c76('0x2e')]();this['agents'][_0x249dc0['peer']][_0x0c76('0x40')]=_0x249dc0[_0x0c76('0x40')];this[_0x0c76('0xb')][_0x249dc0['peer']][_0x0c76('0x32')](_0x249dc0);}}else if(this[_0x0c76('0xc')][_0x249dc0[_0x0c76('0x42')]]){this[_0x0c76('0xc')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x44')]=_0x249dc0['peerstatus'][_0x0c76('0x2e')]();this[_0x0c76('0xc')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x40')]=_0x249dc0['address'];logger[_0x0c76('0x24')](_0x0c76('0x45'),util[_0x0c76('0x18')](this[_0x0c76('0xc')][_0x249dc0[_0x0c76('0x42')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0c76('0x33'),this['telephones'][_0x249dc0['peer']][_0x0c76('0x34')]),'telephone:save',this[_0x0c76('0xc')][_0x249dc0[_0x0c76('0x42')]]);}else if(this[_0x0c76('0xa')][_0x249dc0[_0x0c76('0x42')]]){this[_0x0c76('0xa')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x44')]=_0x249dc0['peerstatus'][_0x0c76('0x2e')]();this[_0x0c76('0xa')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x40')]=_0x249dc0[_0x0c76('0x40')];logger[_0x0c76('0x24')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x0c76('0x18')](this['trunks'][_0x249dc0[_0x0c76('0x42')]],{'showHidden':![],'depth':null}));this[_0x0c76('0x1f')](util['format']('trunk:%s',this[_0x0c76('0xa')][_0x249dc0[_0x0c76('0x42')]][_0x0c76('0x34')]),_0x0c76('0x28'),this['trunks'][_0x249dc0[_0x0c76('0x42')]]);}}}catch(_0x1bff75){logger[_0x0c76('0x3d')](_0x0c76('0x41'),util['inspect'](_0x1bff75,{'showHidden':![],'depth':null}));}};module[_0x0c76('0x46')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 925d079..6ccf2f5 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 _0x4196=['uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','voice','omit','privilege','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','merge','interface','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','agentringnoanswerAt','answeredelsewheremembername','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%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:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','agent','talktime','acwtime','acwTimeout','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','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','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','transfer','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','seconds','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called'];(function(_0x51895b,_0x4352ed){var _0x546b18=function(_0x3fcef3){while(--_0x3fcef3){_0x51895b['push'](_0x51895b['shift']());}};_0x546b18(++_0x4352ed);}(_0x4196,0x7a));var _0x6419=function(_0x308fcd,_0x18c5fb){_0x308fcd=_0x308fcd-0x0;var _0x57ee31=_0x4196[_0x308fcd];return _0x57ee31;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x6419('0x0'));var Redis=require(_0x6419('0x1'));var config=require('../../../config/environment');var logger=require(_0x6419('0x2'))(_0x6419('0x3'));var ami=require(_0x6419('0x4'));config[_0x6419('0x5')]=_[_0x6419('0x6')](config['redis'],{'host':_0x6419('0x7'),'port':0x18eb});var io=require(_0x6419('0x8'))(new Redis(config[_0x6419('0x5')]));function VoiceAgentReport(_0x1e0a93){this[_0x6419('0x9')]={};this[_0x6419('0xa')]=_0x1e0a93['channels'];this['voiceQueues']=_0x1e0a93[_0x6419('0xb')];this['agents']=_0x1e0a93[_0x6419('0xc')];this[_0x6419('0xd')]={};ami['on']('agentcalled',this[_0x6419('0xe')][_0x6419('0xf')](this));ami['on'](_0x6419('0x10'),this['syncAgentConnect'][_0x6419('0xf')](this));ami['on'](_0x6419('0x11'),this[_0x6419('0x12')][_0x6419('0xf')](this));ami['on'](_0x6419('0x13'),this[_0x6419('0x14')][_0x6419('0xf')](this));ami['on'](_0x6419('0x15'),this[_0x6419('0x16')][_0x6419('0xf')](this));ami['on'](_0x6419('0x17'),this[_0x6419('0x18')][_0x6419('0xf')](this));ami['on'](_0x6419('0x19'),this[_0x6419('0x1a')][_0x6419('0xf')](this));ami['on'](_0x6419('0x1b'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x6419('0x1c'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x6419('0x1d'),this[_0x6419('0x1e')]['bind'](this));ami['on'](_0x6419('0x1f'),this[_0x6419('0x20')]['bind'](this));}VoiceAgentReport[_0x6419('0x21')][_0x6419('0x22')]=function(_0x40f925,_0x404215,_0x5e972d){io['to'](_0x40f925)[_0x6419('0x22')](_0x404215,_0x5e972d);};VoiceAgentReport[_0x6419('0x21')][_0x6419('0x23')]=function(_0x11e610){return _0x11e610!==null&&!_[_0x6419('0x24')](_0x11e610);};VoiceAgentReport[_0x6419('0x21')][_0x6419('0xe')]=function(_0x1f9fba){try{if(this['isNotNull'](_0x1f9fba)){logger[_0x6419('0x25')](_0x6419('0x26'),_0x1f9fba[_0x6419('0x27')],_0x1f9fba[_0x6419('0x28')],_0x1f9fba[_0x6419('0x29')]);logger[_0x6419('0x2a')](_0x6419('0x2b'),_0x1f9fba['uniqueid'],util[_0x6419('0x2c')](_0x1f9fba,{'showHidden':![],'depth':null}));if(_[_0x6419('0x24')](this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]])){this[_0x6419('0x9')][_0x1f9fba['uniqueid']]={};}if(_[_0x6419('0x24')](this['channels'][_0x1f9fba['uniqueid']][_0x1f9fba[_0x6419('0x29')]])){this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba['destuniqueid']]={'agentcalledAt':moment()['format'](_0x6419('0x2d')),'lastevent':_0x6419('0x2e'),'mandatoryDisposition':this['voiceQueues'][_0x1f9fba['queue']]?this['voiceQueues'][_0x1f9fba[_0x6419('0x2f')]]['mandatoryDisposition']||![]:![],'type':this[_0x6419('0xb')][_0x1f9fba[_0x6419('0x2f')]]?this[_0x6419('0xb')][_0x1f9fba[_0x6419('0x2f')]][_0x6419('0x30')]||_0x6419('0x31'):'inbound','variables':this[_0x6419('0xd')][_0x1f9fba[_0x6419('0x27')]],'motionChannel':_0x6419('0x32')};}_['merge'](this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba[_0x6419('0x29')]],_[_0x6419('0x33')](_0x1f9fba,['event',_0x6419('0x34')]));logger[_0x6419('0x2a')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x1f9fba['uniqueid'],util[_0x6419('0x2c')](this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba[_0x6419('0x29')]],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x35'),this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba[_0x6419('0x29')]]);logger[_0x6419('0x2a')](_0x6419('0x36'),_0x1f9fba[_0x6419('0x27')],util['inspect'](this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba[_0x6419('0x29')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6419('0x37')]('user:%s',_0x1f9fba[_0x6419('0x28')]),_0x6419('0x38'),this[_0x6419('0x9')][_0x1f9fba[_0x6419('0x27')]][_0x1f9fba['destuniqueid']]);}}catch(_0x23a436){logger[_0x6419('0x39')](_0x6419('0x3a'),_0x1f9fba['uniqueid'],util[_0x6419('0x2c')](_0x23a436,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')][_0x6419('0x3b')]=function(_0x45686f){try{if(this[_0x6419('0x23')](_0x45686f)){if(this['channels'][_0x45686f[_0x6419('0x27')]]){logger[_0x6419('0x2a')](_0x6419('0x3c'),_0x45686f[_0x6419('0x27')],util['inspect'](_0x45686f,{'showHidden':![],'depth':null}));for(var _0x107a66 in this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]]){if(this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x6419('0x3d')](_0x107a66)){if(_0x45686f[_0x6419('0x29')]===_0x107a66){logger[_0x6419('0x25')](_0x6419('0x3e'),_0x45686f[_0x6419('0x27')],_0x45686f[_0x6419('0x28')],_0x45686f['destuniqueid']);this['channels'][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x3f')]=moment()[_0x6419('0x37')](_0x6419('0x2d'));this['channels'][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x40')]=_0x45686f['connectedlinename'];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x41')]=_0x45686f[_0x6419('0x41')];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]['destchannelstate']=_0x45686f[_0x6419('0x42')];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]['destchannelstatedesc']=_0x45686f[_0x6419('0x43')];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x44')]=_0x45686f[_0x6419('0x44')];this[_0x6419('0x9')][_0x45686f['uniqueid']][_0x107a66][_0x6419('0x45')]='connect';if(this['voiceChannels'][this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x27')]]){var _0x232bb5=this[_0x6419('0xa')][this[_0x6419('0x9')][_0x45686f['uniqueid']][_0x107a66][_0x6419('0x27')]]['routealias'];this[_0x6419('0x9')][_0x45686f['uniqueid']][_0x107a66][_0x6419('0x46')]=_0x232bb5;_0x45686f[_0x6419('0x46')]=_0x232bb5;}_[_0x6419('0x47')](this[_0x6419('0xc')][_0x45686f[_0x6419('0x48')]],_['pick'](_0x45686f,[_0x6419('0x2f'),_0x6419('0x49'),'routealias']));logger['debug'](_0x6419('0x4a'),_0x45686f[_0x6419('0x27')],util[_0x6419('0x2c')](this['channels'][_0x45686f['uniqueid']][_0x45686f[_0x6419('0x29')]],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x4b'),this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x45686f[_0x6419('0x29')]]);logger[_0x6419('0x2a')](_0x6419('0x4c'),_0x45686f['uniqueid'],util[_0x6419('0x2c')](this['channels'][_0x45686f[_0x6419('0x27')]][_0x45686f[_0x6419('0x29')]],{'showHidden':![],'depth':null}));this[_0x6419('0x22')](util[_0x6419('0x37')](_0x6419('0x4d'),_0x45686f[_0x6419('0x28')]),_0x6419('0x4e'),this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x45686f[_0x6419('0x29')]]);}else if(!this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x11')]&&!this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]['agentcomplete']){logger[_0x6419('0x25')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x45686f[_0x6419('0x27')],this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x28')],_0x107a66);this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]['agentringnoanswer']=!![];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x4f')]=moment()[_0x6419('0x37')](_0x6419('0x2d'));this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]['answeredelsewheredestinationuniqueid']=_0x45686f[_0x6419('0x29')];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x50')]=_0x45686f[_0x6419('0x28')];this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x45')]=_0x6419('0x51');this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66][_0x6419('0x52')]=_0x6419('0x51');logger[_0x6419('0x2a')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x45686f['uniqueid'],util[_0x6419('0x2c')](this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x53'),this[_0x6419('0x9')][_0x45686f[_0x6419('0x27')]][_0x107a66]);}}}}}}catch(_0x1fd58c){logger[_0x6419('0x39')](_0x6419('0x54'),_0x45686f[_0x6419('0x27')],util[_0x6419('0x2c')](_0x1fd58c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')][_0x6419('0x12')]=function(_0x4a6ecb){try{if(this[_0x6419('0x23')](_0x4a6ecb)){logger[_0x6419('0x2a')](_0x6419('0x55'),_0x4a6ecb['uniqueid'],util[_0x6419('0x2c')](_0x4a6ecb,{'showHidden':![],'depth':null}));if(this[_0x6419('0x9')][_0x4a6ecb['uniqueid']]&&this[_0x6419('0x9')][_0x4a6ecb[_0x6419('0x27')]][_0x4a6ecb[_0x6419('0x29')]]){logger[_0x6419('0x25')](_0x6419('0x56'),_0x4a6ecb[_0x6419('0x27')],_0x4a6ecb['membername'],_0x4a6ecb[_0x6419('0x29')]);this[_0x6419('0x9')][_0x4a6ecb['uniqueid']][_0x4a6ecb['destuniqueid']][_0x6419('0x11')]=!![];this[_0x6419('0x9')][_0x4a6ecb[_0x6419('0x27')]][_0x4a6ecb[_0x6419('0x29')]]['agentringnoanswerAt']=moment()[_0x6419('0x37')](_0x6419('0x2d'));this[_0x6419('0x9')][_0x4a6ecb['uniqueid']][_0x4a6ecb[_0x6419('0x29')]][_0x6419('0x45')]=_0x6419('0x57');this[_0x6419('0x9')][_0x4a6ecb[_0x6419('0x27')]][_0x4a6ecb[_0x6419('0x29')]][_0x6419('0x52')]='rejected';logger[_0x6419('0x2a')](_0x6419('0x58'),_0x4a6ecb[_0x6419('0x27')],util['inspect'](this['channels'][_0x4a6ecb[_0x6419('0x27')]][_0x4a6ecb[_0x6419('0x29')]],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x59'),this['channels'][_0x4a6ecb['uniqueid']][_0x4a6ecb[_0x6419('0x29')]]);}}}catch(_0x27e0af){logger[_0x6419('0x39')](_0x6419('0x5a'),_0x4a6ecb['uniqueid'],util[_0x6419('0x2c')](_0x27e0af,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')][_0x6419('0x14')]=function(_0x6455c7){try{if(this[_0x6419('0x23')](_0x6455c7)){logger[_0x6419('0x2a')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x6455c7['uniqueid'],util[_0x6419('0x2c')](_0x6455c7,{'showHidden':![],'depth':null}));if(this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]]){for(var _0x19bdd4 in this['channels'][_0x6455c7[_0x6419('0x27')]]){if(this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]][_0x6419('0x3d')](_0x19bdd4)&&!this['channels'][_0x6455c7[_0x6419('0x27')]][_0x19bdd4][_0x6419('0x11')]&&!this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]][_0x19bdd4]['agentcomplete']){logger['info'](_0x6419('0x5b'),_0x6455c7[_0x6419('0x27')],this[_0x6419('0x9')][_0x6455c7['uniqueid']][_0x19bdd4][_0x6419('0x28')],_0x19bdd4);this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]][_0x19bdd4]['agentringnoanswer']=!![];this[_0x6419('0x9')][_0x6455c7['uniqueid']][_0x19bdd4]['agentringnoanswerAt']=moment()[_0x6419('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6419('0x9')][_0x6455c7['uniqueid']][_0x19bdd4][_0x6419('0x45')]=_0x6419('0x5c');this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]][_0x19bdd4][_0x6419('0x52')]='abandoned';logger[_0x6419('0x2a')](_0x6419('0x5d'),_0x6455c7['uniqueid'],util[_0x6419('0x2c')](this['channels'][_0x6455c7[_0x6419('0x27')]][_0x19bdd4],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x5e'),this[_0x6419('0x9')][_0x6455c7[_0x6419('0x27')]][_0x19bdd4]);}}}}}catch(_0x4515cd){logger['error'](_0x6419('0x5f'),_0x6455c7['uniqueid'],util[_0x6419('0x2c')](_0x4515cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')][_0x6419('0x16')]=function(_0x285c35){try{if(this[_0x6419('0x23')](_0x285c35)){logger[_0x6419('0x2a')](_0x6419('0x60'),_0x285c35['uniqueid'],util['inspect'](_0x285c35,{'showHidden':![],'depth':null}));if(this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]]){for(var _0x189f59 in this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]]){if(this['channels'][_0x285c35[_0x6419('0x27')]]['hasOwnProperty'](_0x189f59)){if(this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59]['agentconnectAt']&&!this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59][_0x6419('0x15')]){logger[_0x6419('0x25')](_0x6419('0x61'),_0x285c35['uniqueid'],this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59]['membername'],_0x189f59);this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59][_0x6419('0x15')]=!![];this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x285c35[_0x6419('0x27')]][_0x189f59]['lastevent']=_0x6419('0x62');this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59][_0x6419('0x52')]=_0x285c35[_0x6419('0x52')]=='transfer'?_0x6419('0x63'):_0x285c35[_0x6419('0x52')];this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59][_0x6419('0x64')]=_0x285c35['talktime'];if(this[_0x6419('0xb')][_0x285c35[_0x6419('0x2f')]]&&this[_0x6419('0xb')][_0x285c35[_0x6419('0x2f')]]['acw']){this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59][_0x6419('0x65')]=this['voiceQueues'][_0x285c35[_0x6419('0x2f')]][_0x6419('0x66')];this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59][_0x6419('0x67')]=!![];}this[_0x6419('0xc')][_0x285c35['interface']]=_[_0x6419('0x33')](this['agents'][_0x285c35[_0x6419('0x48')]],[_0x6419('0x2f'),'destconnectedlinenum']);logger[_0x6419('0x2a')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x285c35[_0x6419('0x27')],util[_0x6419('0x2c')](this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59],{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x68'),this[_0x6419('0x9')][_0x285c35['uniqueid']][_0x189f59]);logger['debug'](_0x6419('0x69'),_0x285c35[_0x6419('0x27')],util[_0x6419('0x2c')](this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59],{'showHidden':![],'depth':null}));this[_0x6419('0x22')](util[_0x6419('0x37')](_0x6419('0x4d'),_0x285c35[_0x6419('0x28')]),_0x6419('0x6a'),this[_0x6419('0x9')][_0x285c35[_0x6419('0x27')]][_0x189f59]);}}}}}}catch(_0x1adabd){logger['error'](_0x6419('0x6b'),_0x285c35[_0x6419('0x27')],util[_0x6419('0x2c')](_0x1adabd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')]['syncVarSet']=function(_0x17f69b){try{if(this[_0x6419('0x23')](_0x17f69b)){logger['debug'](_0x6419('0x6c'),_0x17f69b['uniqueid'],util[_0x6419('0x2c')](_0x17f69b,{'showHidden':![],'depth':null}));this[_0x6419('0x6d')](_0x17f69b[_0x6419('0x27')],_[_0x6419('0x6e')](_0x17f69b[_0x6419('0x6f')])[0x0],_0x17f69b[_0x6419('0x70')]);if(this[_0x6419('0x9')][_0x17f69b['uniqueid']]){for(var _0x33cc87 in this['channels'][_0x17f69b['uniqueid']]){if(this[_0x6419('0x9')][_0x17f69b[_0x6419('0x27')]][_0x6419('0x3d')](_0x33cc87)){logger[_0x6419('0x25')](_0x6419('0x71'),_0x17f69b['uniqueid'],_0x33cc87,_[_0x6419('0x6e')](_0x17f69b[_0x6419('0x6f')])[0x0],_0x17f69b[_0x6419('0x70')]);if(_['isUndefined'](this[_0x6419('0x9')][_0x17f69b[_0x6419('0x27')]][_0x33cc87][_0x6419('0xd')])){this[_0x6419('0x9')][_0x17f69b[_0x6419('0x27')]][_0x33cc87][_0x6419('0xd')]={};}this[_0x6419('0x9')][_0x17f69b[_0x6419('0x27')]][_0x33cc87][_0x6419('0xd')]=this[_0x6419('0xd')][_0x17f69b[_0x6419('0x27')]];}}}}}catch(_0x4765d1){logger[_0x6419('0x39')](_0x6419('0x72'),_0x17f69b[_0x6419('0x27')],util['inspect'](_0x4765d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')]['addVariable']=function(_0x2c33a8,_0x51ce4c,_0x71f9a8){var _0x5db354=[_0x6419('0x73'),_0x6419('0x74'),'rtpaudioqosjitter',_0x6419('0x75'),_0x6419('0x76'),_0x6419('0x77'),_0x6419('0x78'),'rtpaudioqosrttbridged',_0x6419('0x79'),_0x6419('0x7a'),_0x6419('0x7b'),'bridgepvtcallid',_0x6419('0x7c'),_0x6419('0x7d'),_0x6419('0x7e'),'memberlastcall',_0x6419('0x28'),_0x6419('0x7f'),_0x6419('0x80')];if(!_[_0x6419('0x81')](_0x51ce4c)&&!_[_0x6419('0x82')](_0x5db354,_0x51ce4c)){if(_[_0x6419('0x24')](this[_0x6419('0xd')][_0x2c33a8])){this['variables'][_0x2c33a8]={};}this[_0x6419('0xd')][_0x2c33a8][_0x51ce4c]=_0x71f9a8;}};VoiceAgentReport[_0x6419('0x21')]['syncHangup']=function(_0x4e4239){try{if(this[_0x6419('0x23')](_0x4e4239)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x4e4239[_0x6419('0x27')],util[_0x6419('0x2c')](_0x4e4239,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e4239[_0x6419('0x27')]]){for(var _0x7d262a in this['channels'][_0x4e4239[_0x6419('0x27')]]){if(this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]]['hasOwnProperty'](_0x7d262a)){if(this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]][_0x7d262a]['reason']=='transfer'&&this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]][_0x7d262a][_0x6419('0x15')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x4e4239[_0x6419('0x27')],_0x7d262a);this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]][_0x7d262a]['agentcompleteAt']=moment()[_0x6419('0x37')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x6419('0x2a')](_0x6419('0x83'),_0x4e4239[_0x6419('0x27')],util['inspect'](_[_0x6419('0x84')](this['channels'][_0x4e4239[_0x6419('0x27')]]),{'showHidden':![],'depth':null}));ami[_0x6419('0x22')](_0x6419('0x85'),_['values'](this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]]));delete this[_0x6419('0x9')][_0x4e4239[_0x6419('0x27')]];}if(this[_0x6419('0xd')][_0x4e4239[_0x6419('0x27')]]){delete this[_0x6419('0xd')][_0x4e4239['uniqueid']];}}}catch(_0x57fda4){logger[_0x6419('0x39')](_0x6419('0x86'),_0x4e4239['uniqueid'],util[_0x6419('0x2c')](_0x57fda4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')]['syncAttendedTransfer']=function(_0x4c53d5){try{if(this[_0x6419('0x23')](_0x4c53d5)){logger['debug'](_0x6419('0x87'),_0x4c53d5[_0x6419('0x27')],util['inspect'](_0x4c53d5,{'showHidden':![],'depth':null}));if(this[_0x6419('0x9')][_0x4c53d5['transfereeuniqueid']]){for(var _0x51e335 in this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x88')]]){if(this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x88')]][_0x6419('0x3d')](_0x51e335)){if(_0x4c53d5[_0x6419('0x89')]===_0x51e335){logger[_0x6419('0x25')](_0x6419('0x8a'),_0x4c53d5[_0x6419('0x27')],this['channels'][_0x4c53d5[_0x6419('0x88')]][_0x51e335][_0x6419('0x28')],_0x51e335);var _0x18199f=moment();this['channels'][_0x4c53d5[_0x6419('0x88')]][_0x51e335][_0x6419('0x15')]=!![];this['channels'][_0x4c53d5[_0x6419('0x88')]][_0x51e335]['agentcompleteAt']=moment()[_0x6419('0x37')](_0x6419('0x2d'));this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x88')]][_0x51e335][_0x6419('0x45')]=_0x6419('0x62');this[_0x6419('0x9')][_0x4c53d5['transfereeuniqueid']][_0x51e335][_0x6419('0x52')]=_0x6419('0x8b');this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x88')]][_0x51e335][_0x6419('0x64')]=_0x18199f[_0x6419('0x8c')](this[_0x6419('0x9')][_0x4c53d5['transfereeuniqueid']][_0x51e335][_0x6419('0x3f')],'seconds');}}}}if(this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x8d')]]){var _0x547602=this[_0x6419('0x9')][_0x4c53d5['secondtransfereruniqueid']];this['channels'][_0x4c53d5[_0x6419('0x8d')]]=this[_0x6419('0x9')][_0x4c53d5[_0x6419('0x88')]];this['channels'][_0x4c53d5[_0x6419('0x88')]]=_0x547602;}}}catch(_0x15c3fd){logger[_0x6419('0x39')](_0x6419('0x8e'),_0x4c53d5[_0x6419('0x27')],util[_0x6419('0x2c')](_0x15c3fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6419('0x20')]=function(_0x1a0ee5){try{if(this['isNotNull'](_0x1a0ee5)){logger[_0x6419('0x2a')](_0x6419('0x8f'),_0x1a0ee5[_0x6419('0x27')],util['inspect'](_0x1a0ee5,{'showHidden':![],'depth':null}));if(this[_0x6419('0x9')][_0x1a0ee5['transfereeuniqueid']]){for(var _0x167746 in this[_0x6419('0x9')][_0x1a0ee5['transfereeuniqueid']]){if(this[_0x6419('0x9')][_0x1a0ee5[_0x6419('0x88')]][_0x6419('0x3d')](_0x167746)){if(_0x1a0ee5[_0x6419('0x90')]===_0x167746){logger[_0x6419('0x25')](_0x6419('0x91'),_0x1a0ee5[_0x6419('0x27')],this[_0x6419('0x9')][_0x1a0ee5[_0x6419('0x88')]][_0x167746][_0x6419('0x28')],_0x167746);var _0x204463=moment();this['channels'][_0x1a0ee5[_0x6419('0x88')]][_0x167746][_0x6419('0x15')]=!![];this[_0x6419('0x9')][_0x1a0ee5[_0x6419('0x88')]][_0x167746][_0x6419('0x92')]=_0x204463;this[_0x6419('0x9')][_0x1a0ee5[_0x6419('0x88')]][_0x167746][_0x6419('0x45')]=_0x6419('0x62');this[_0x6419('0x9')][_0x1a0ee5[_0x6419('0x88')]][_0x167746][_0x6419('0x52')]=_0x6419('0x8b');this[_0x6419('0x9')][_0x1a0ee5['transfereeuniqueid']][_0x167746][_0x6419('0x64')]=_0x204463[_0x6419('0x8c')](this[_0x6419('0x9')][_0x1a0ee5['transfereeuniqueid']][_0x167746][_0x6419('0x3f')],_0x6419('0x93'));}}}}}}catch(_0x20d918){logger[_0x6419('0x39')](_0x6419('0x94'),_0x1a0ee5[_0x6419('0x27')],util[_0x6419('0x2c')](_0x20d918,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6419('0x95')]=function(_0x5018df){var _0x575a07='';try{if(this[_0x6419('0x23')](_0x5018df)){logger[_0x6419('0x2a')](_0x6419('0x96'),_0x5018df[_0x6419('0x27')],util[_0x6419('0x2c')](_0x5018df,{'showHidden':![],'depth':null}));if(_0x5018df[_0x6419('0x97')]){_0x575a07=_0x5018df['channel'][_0x6419('0x98')](0x0,_0x5018df['channel'][_0x6419('0x99')]('-'));if(this[_0x6419('0xc')][_0x575a07]){logger['info'](_0x6419('0x9a'),_0x5018df['uniqueid'],_0x575a07);this[_0x6419('0xc')][_0x575a07][_0x6419('0x9b')]=!![];}}}}catch(_0x2f5999){logger['error'](_0x6419('0x9c'),_0x5018df[_0x6419('0x27')],util[_0x6419('0x2c')](_0x2f5999,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6419('0x21')]['syncMusicOnHoldStop']=function(_0x51c5de){var _0x3365ae='';try{if(this[_0x6419('0x23')](_0x51c5de)){logger['debug'](_0x6419('0x9d'),_0x51c5de[_0x6419('0x27')],util[_0x6419('0x2c')](_0x51c5de,{'showHidden':![],'depth':null}));if(_0x51c5de[_0x6419('0x97')]){_0x3365ae=_0x51c5de['channel'][_0x6419('0x98')](0x0,_0x51c5de['channel'][_0x6419('0x99')]('-'));if(this['agents'][_0x3365ae]){logger[_0x6419('0x25')](_0x6419('0x9e'),_0x51c5de['uniqueid'],_0x3365ae);this[_0x6419('0xc')][_0x3365ae][_0x6419('0x9b')]=![];}}}}catch(_0x4519aa){logger['error'](_0x6419('0x9f'),_0x51c5de[_0x6419('0x27')],util['inspect'](_0x4519aa,{'showHidden':![],'depth':null}));}};module[_0x6419('0xa0')]=VoiceAgentReport; \ No newline at end of file +var _0x29b3=['rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','uniqueid','membername','debug','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','queue','type','inbound','voice','merge','omit','event','privilege','inspect','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','agentringnoanswer','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%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]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agent','talktime','acwtime','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitter'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x29b3,0x160));var _0x329b=function(_0x48d96a,_0x49256c){_0x48d96a=_0x48d96a-0x0;var _0x3cc5b0=_0x29b3[_0x48d96a];return _0x3cc5b0;};'use strict';var _=require(_0x329b('0x0'));var moment=require(_0x329b('0x1'));var util=require(_0x329b('0x2'));var Redis=require('ioredis');var config=require(_0x329b('0x3'));var logger=require(_0x329b('0x4'))(_0x329b('0x5'));var ami=require(_0x329b('0x6'));config[_0x329b('0x7')]=_[_0x329b('0x8')](config[_0x329b('0x7')],{'host':_0x329b('0x9'),'port':0x18eb});var io=require(_0x329b('0xa'))(new Redis(config[_0x329b('0x7')]));function VoiceAgentReport(_0x267eed){this['channels']={};this[_0x329b('0xb')]=_0x267eed[_0x329b('0xc')];this[_0x329b('0xd')]=_0x267eed['voiceQueues'];this[_0x329b('0xe')]=_0x267eed['agents'];this[_0x329b('0xf')]={};ami['on']('agentcalled',this[_0x329b('0x10')][_0x329b('0x11')](this));ami['on'](_0x329b('0x12'),this['syncAgentConnect'][_0x329b('0x11')](this));ami['on']('agentringnoanswer',this[_0x329b('0x13')][_0x329b('0x11')](this));ami['on'](_0x329b('0x14'),this['syncQueueCallerAbandon'][_0x329b('0x11')](this));ami['on'](_0x329b('0x15'),this['syncAgentComplete'][_0x329b('0x11')](this));ami['on'](_0x329b('0x16'),this[_0x329b('0x17')][_0x329b('0x11')](this));ami['on'](_0x329b('0x18'),this[_0x329b('0x19')]['bind'](this));ami['on'](_0x329b('0x1a'),this['syncMusicOnHoldStart'][_0x329b('0x11')](this));ami['on'](_0x329b('0x1b'),this[_0x329b('0x1c')][_0x329b('0x11')](this));ami['on'](_0x329b('0x1d'),this[_0x329b('0x1e')]['bind'](this));ami['on']('blindtransfer',this[_0x329b('0x1f')][_0x329b('0x11')](this));}VoiceAgentReport[_0x329b('0x20')]['emit']=function(_0x260446,_0x140fdd,_0x30e9db){io['to'](_0x260446)[_0x329b('0x21')](_0x140fdd,_0x30e9db);};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x22')]=function(_0x51857f){return _0x51857f!==null&&!_[_0x329b('0x23')](_0x51857f);};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x10')]=function(_0x150e8b){try{if(this[_0x329b('0x22')](_0x150e8b)){logger[_0x329b('0x24')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x150e8b[_0x329b('0x25')],_0x150e8b[_0x329b('0x26')],_0x150e8b['destuniqueid']);logger[_0x329b('0x27')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x150e8b[_0x329b('0x25')],util['inspect'](_0x150e8b,{'showHidden':![],'depth':null}));if(_[_0x329b('0x23')](this['channels'][_0x150e8b['uniqueid']])){this[_0x329b('0xc')][_0x150e8b[_0x329b('0x25')]]={};}if(_[_0x329b('0x23')](this[_0x329b('0xc')][_0x150e8b[_0x329b('0x25')]][_0x150e8b['destuniqueid']])){this[_0x329b('0xc')][_0x150e8b[_0x329b('0x25')]][_0x150e8b[_0x329b('0x28')]]={'agentcalledAt':moment()['format'](_0x329b('0x29')),'lastevent':_0x329b('0x2a'),'mandatoryDisposition':this[_0x329b('0xd')][_0x150e8b['queue']]?this[_0x329b('0xd')][_0x150e8b['queue']][_0x329b('0x2b')]||![]:![],'type':this[_0x329b('0xd')][_0x150e8b[_0x329b('0x2c')]]?this[_0x329b('0xd')][_0x150e8b[_0x329b('0x2c')]][_0x329b('0x2d')]||_0x329b('0x2e'):_0x329b('0x2e'),'variables':this['variables'][_0x150e8b[_0x329b('0x25')]],'motionChannel':_0x329b('0x2f')};}_[_0x329b('0x30')](this['channels'][_0x150e8b[_0x329b('0x25')]][_0x150e8b[_0x329b('0x28')]],_[_0x329b('0x31')](_0x150e8b,[_0x329b('0x32'),_0x329b('0x33')]));logger[_0x329b('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x150e8b['uniqueid'],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x150e8b['uniqueid']][_0x150e8b[_0x329b('0x28')]],{'showHidden':![],'depth':null}));ami[_0x329b('0x21')](_0x329b('0x35'),this['channels'][_0x150e8b['uniqueid']][_0x150e8b[_0x329b('0x28')]]);logger[_0x329b('0x27')](_0x329b('0x36'),_0x150e8b['uniqueid'],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x150e8b['uniqueid']][_0x150e8b[_0x329b('0x28')]],{'showHidden':![],'depth':null}));this[_0x329b('0x21')](util[_0x329b('0x37')](_0x329b('0x38'),_0x150e8b['membername']),_0x329b('0x39'),this[_0x329b('0xc')][_0x150e8b[_0x329b('0x25')]][_0x150e8b[_0x329b('0x28')]]);}}catch(_0x2be08e){logger[_0x329b('0x3a')](_0x329b('0x3b'),_0x150e8b[_0x329b('0x25')],util[_0x329b('0x34')](_0x2be08e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x3c')]=function(_0x187cf5){try{if(this['isNotNull'](_0x187cf5)){if(this['channels'][_0x187cf5[_0x329b('0x25')]]){logger[_0x329b('0x27')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x187cf5[_0x329b('0x25')],util[_0x329b('0x34')](_0x187cf5,{'showHidden':![],'depth':null}));for(var _0xed0c13 in this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]]){if(this[_0x329b('0xc')][_0x187cf5['uniqueid']]['hasOwnProperty'](_0xed0c13)){if(_0x187cf5['destuniqueid']===_0xed0c13){logger[_0x329b('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x187cf5[_0x329b('0x25')],_0x187cf5[_0x329b('0x26')],_0x187cf5[_0x329b('0x28')]);this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x3d')]=moment()[_0x329b('0x37')](_0x329b('0x29'));this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x3e')]=_0x187cf5[_0x329b('0x3e')];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x3f')]=_0x187cf5[_0x329b('0x3f')];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x40')]=_0x187cf5[_0x329b('0x40')];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13]['destchannelstatedesc']=_0x187cf5[_0x329b('0x41')];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13]['holdtime']=_0x187cf5[_0x329b('0x42')];this[_0x329b('0xc')][_0x187cf5['uniqueid']][_0xed0c13][_0x329b('0x43')]=_0x329b('0x44');if(this[_0x329b('0xb')][this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x25')]]){var _0x545285=this[_0x329b('0xb')][this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x25')]][_0x329b('0x45')];this['channels'][_0x187cf5[_0x329b('0x25')]][_0xed0c13]['routealias']=_0x545285;_0x187cf5[_0x329b('0x45')]=_0x545285;}_[_0x329b('0x30')](this['agents'][_0x187cf5[_0x329b('0x46')]],_[_0x329b('0x47')](_0x187cf5,['queue',_0x329b('0x48'),_0x329b('0x45')]));logger[_0x329b('0x27')](_0x329b('0x49'),_0x187cf5[_0x329b('0x25')],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x187cf5['uniqueid']][_0x187cf5[_0x329b('0x28')]],{'showHidden':![],'depth':null}));ami[_0x329b('0x21')](_0x329b('0x4a'),this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0x187cf5['destuniqueid']]);logger[_0x329b('0x27')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x187cf5[_0x329b('0x25')],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0x187cf5[_0x329b('0x28')]],{'showHidden':![],'depth':null}));this[_0x329b('0x21')](util[_0x329b('0x37')](_0x329b('0x38'),_0x187cf5[_0x329b('0x26')]),_0x329b('0x4b'),this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0x187cf5[_0x329b('0x28')]]);}else if(!this['channels'][_0x187cf5['uniqueid']][_0xed0c13][_0x329b('0x4c')]&&!this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x15')]){logger[_0x329b('0x24')](_0x329b('0x4d'),_0x187cf5[_0x329b('0x25')],this['channels'][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x26')],_0xed0c13);this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13]['agentringnoanswer']=!![];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x4e')]=moment()[_0x329b('0x37')](_0x329b('0x29'));this[_0x329b('0xc')][_0x187cf5['uniqueid']][_0xed0c13][_0x329b('0x4f')]=_0x187cf5[_0x329b('0x28')];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x50')]=_0x187cf5['membername'];this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13]['lastevent']=_0x329b('0x51');this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13][_0x329b('0x52')]=_0x329b('0x51');logger['debug'](_0x329b('0x53'),_0x187cf5[_0x329b('0x25')],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x187cf5[_0x329b('0x25')]][_0xed0c13],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x187cf5[_0x329b('0x25')]][_0xed0c13]);}}}}}}catch(_0x313fdc){logger[_0x329b('0x3a')](_0x329b('0x54'),_0x187cf5[_0x329b('0x25')],util[_0x329b('0x34')](_0x313fdc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x13')]=function(_0x4963f2){try{if(this[_0x329b('0x22')](_0x4963f2)){logger['debug'](_0x329b('0x55'),_0x4963f2[_0x329b('0x25')],util[_0x329b('0x34')](_0x4963f2,{'showHidden':![],'depth':null}));if(this['channels'][_0x4963f2[_0x329b('0x25')]]&&this[_0x329b('0xc')][_0x4963f2['uniqueid']][_0x4963f2[_0x329b('0x28')]]){logger[_0x329b('0x24')](_0x329b('0x56'),_0x4963f2[_0x329b('0x25')],_0x4963f2[_0x329b('0x26')],_0x4963f2[_0x329b('0x28')]);this[_0x329b('0xc')][_0x4963f2['uniqueid']][_0x4963f2[_0x329b('0x28')]][_0x329b('0x4c')]=!![];this[_0x329b('0xc')][_0x4963f2['uniqueid']][_0x4963f2[_0x329b('0x28')]][_0x329b('0x4e')]=moment()['format'](_0x329b('0x29'));this[_0x329b('0xc')][_0x4963f2[_0x329b('0x25')]][_0x4963f2[_0x329b('0x28')]]['lastevent']=_0x329b('0x57');this['channels'][_0x4963f2[_0x329b('0x25')]][_0x4963f2['destuniqueid']][_0x329b('0x52')]=_0x329b('0x57');logger[_0x329b('0x27')](_0x329b('0x58'),_0x4963f2[_0x329b('0x25')],util['inspect'](this[_0x329b('0xc')][_0x4963f2['uniqueid']][_0x4963f2[_0x329b('0x28')]],{'showHidden':![],'depth':null}));ami[_0x329b('0x21')](_0x329b('0x59'),this[_0x329b('0xc')][_0x4963f2[_0x329b('0x25')]][_0x4963f2[_0x329b('0x28')]]);}}}catch(_0x285c05){logger['error'](_0x329b('0x5a'),_0x4963f2[_0x329b('0x25')],util[_0x329b('0x34')](_0x285c05,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x329b('0x5b')]=function(_0x1c1333){try{if(this[_0x329b('0x22')](_0x1c1333)){logger[_0x329b('0x27')](_0x329b('0x5c'),_0x1c1333[_0x329b('0x25')],util[_0x329b('0x34')](_0x1c1333,{'showHidden':![],'depth':null}));if(this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]]){for(var _0xb135a2 in this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]]){if(this[_0x329b('0xc')][_0x1c1333['uniqueid']][_0x329b('0x5d')](_0xb135a2)&&!this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]][_0xb135a2][_0x329b('0x4c')]&&!this[_0x329b('0xc')][_0x1c1333['uniqueid']][_0xb135a2][_0x329b('0x15')]){logger[_0x329b('0x24')](_0x329b('0x5e'),_0x1c1333[_0x329b('0x25')],this['channels'][_0x1c1333[_0x329b('0x25')]][_0xb135a2][_0x329b('0x26')],_0xb135a2);this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]][_0xb135a2]['agentringnoanswer']=!![];this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]][_0xb135a2][_0x329b('0x4e')]=moment()[_0x329b('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x329b('0xc')][_0x1c1333[_0x329b('0x25')]][_0xb135a2]['lastevent']='abandoned';this['channels'][_0x1c1333[_0x329b('0x25')]][_0xb135a2]['reason']=_0x329b('0x5f');logger[_0x329b('0x27')](_0x329b('0x60'),_0x1c1333[_0x329b('0x25')],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x1c1333['uniqueid']][_0xb135a2],{'showHidden':![],'depth':null}));ami[_0x329b('0x21')](_0x329b('0x61'),this[_0x329b('0xc')][_0x1c1333['uniqueid']][_0xb135a2]);}}}}}catch(_0x2d1066){logger[_0x329b('0x3a')](_0x329b('0x62'),_0x1c1333['uniqueid'],util[_0x329b('0x34')](_0x2d1066,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x329b('0x63')]=function(_0x2fbbf0){try{if(this[_0x329b('0x22')](_0x2fbbf0)){logger[_0x329b('0x27')](_0x329b('0x64'),_0x2fbbf0[_0x329b('0x25')],util[_0x329b('0x34')](_0x2fbbf0,{'showHidden':![],'depth':null}));if(this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]]){for(var _0x85196d in this[_0x329b('0xc')][_0x2fbbf0['uniqueid']]){if(this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x329b('0x5d')](_0x85196d)){if(this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d]['agentconnectAt']&&!this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d][_0x329b('0x15')]){logger['info'](_0x329b('0x65'),_0x2fbbf0['uniqueid'],this['channels'][_0x2fbbf0[_0x329b('0x25')]][_0x85196d][_0x329b('0x26')],_0x85196d);this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d][_0x329b('0x15')]=!![];this['channels'][_0x2fbbf0['uniqueid']][_0x85196d]['agentcompleteAt']=moment()['format'](_0x329b('0x29'));this[_0x329b('0xc')][_0x2fbbf0['uniqueid']][_0x85196d][_0x329b('0x43')]='complete';this[_0x329b('0xc')][_0x2fbbf0['uniqueid']][_0x85196d][_0x329b('0x52')]=_0x2fbbf0[_0x329b('0x52')]=='transfer'?_0x329b('0x66'):_0x2fbbf0['reason'];this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d][_0x329b('0x67')]=_0x2fbbf0[_0x329b('0x67')];if(this[_0x329b('0xd')][_0x2fbbf0[_0x329b('0x2c')]]&&this[_0x329b('0xd')][_0x2fbbf0[_0x329b('0x2c')]]['acw']){this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d][_0x329b('0x68')]=this[_0x329b('0xd')][_0x2fbbf0[_0x329b('0x2c')]]['acwTimeout'];this[_0x329b('0xc')][_0x2fbbf0['uniqueid']][_0x85196d]['agentacw']=!![];}this['agents'][_0x2fbbf0[_0x329b('0x46')]]=_[_0x329b('0x31')](this[_0x329b('0xe')][_0x2fbbf0[_0x329b('0x46')]],[_0x329b('0x2c'),_0x329b('0x48')]);logger[_0x329b('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x2fbbf0['uniqueid'],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x2fbbf0['uniqueid']][_0x85196d],{'showHidden':![],'depth':null}));ami[_0x329b('0x21')]('custom:agentcomplete',this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d]);logger[_0x329b('0x27')](_0x329b('0x69'),_0x2fbbf0[_0x329b('0x25')],util[_0x329b('0x34')](this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d],{'showHidden':![],'depth':null}));this[_0x329b('0x21')](util[_0x329b('0x37')](_0x329b('0x38'),_0x2fbbf0[_0x329b('0x26')]),'user:agentcomplete',this[_0x329b('0xc')][_0x2fbbf0[_0x329b('0x25')]][_0x85196d]);}}}}}}catch(_0x42ad41){logger[_0x329b('0x3a')](_0x329b('0x6a'),_0x2fbbf0[_0x329b('0x25')],util[_0x329b('0x34')](_0x42ad41,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x55ece7){try{if(this['isNotNull'](_0x55ece7)){logger[_0x329b('0x27')](_0x329b('0x6b'),_0x55ece7[_0x329b('0x25')],util['inspect'](_0x55ece7,{'showHidden':![],'depth':null}));this['addVariable'](_0x55ece7[_0x329b('0x25')],_[_0x329b('0x6c')](_0x55ece7[_0x329b('0x6d')])[0x0],_0x55ece7[_0x329b('0x6e')]);if(this[_0x329b('0xc')][_0x55ece7['uniqueid']]){for(var _0x2051e7 in this[_0x329b('0xc')][_0x55ece7['uniqueid']]){if(this[_0x329b('0xc')][_0x55ece7[_0x329b('0x25')]][_0x329b('0x5d')](_0x2051e7)){logger['info'](_0x329b('0x6f'),_0x55ece7[_0x329b('0x25')],_0x2051e7,_['keys'](_0x55ece7['variable'])[0x0],_0x55ece7[_0x329b('0x6e')]);if(_[_0x329b('0x23')](this[_0x329b('0xc')][_0x55ece7[_0x329b('0x25')]][_0x2051e7]['variables'])){this[_0x329b('0xc')][_0x55ece7['uniqueid']][_0x2051e7]['variables']={};}this[_0x329b('0xc')][_0x55ece7[_0x329b('0x25')]][_0x2051e7][_0x329b('0xf')]=this[_0x329b('0xf')][_0x55ece7[_0x329b('0x25')]];}}}}}catch(_0x309c78){logger[_0x329b('0x3a')](_0x329b('0x70'),_0x55ece7['uniqueid'],util['inspect'](_0x309c78,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x71')]=function(_0x1485d4,_0x5a5aa0,_0x5b420d){var _0x5afb89=[_0x329b('0x72'),'rtpaudioqosbridged',_0x329b('0x73'),_0x329b('0x74'),'rtpaudioqosloss',_0x329b('0x75'),_0x329b('0x76'),_0x329b('0x77'),_0x329b('0x78'),'sipuri',_0x329b('0x79'),_0x329b('0x7a'),'membercalls',_0x329b('0x7b'),'memberinterface',_0x329b('0x7c'),_0x329b('0x26'),_0x329b('0x7d'),'memberrealtime'];if(!_['isNil'](_0x5a5aa0)&&!_[_0x329b('0x7e')](_0x5afb89,_0x5a5aa0)){if(_[_0x329b('0x23')](this['variables'][_0x1485d4])){this[_0x329b('0xf')][_0x1485d4]={};}this[_0x329b('0xf')][_0x1485d4][_0x5a5aa0]=_0x5b420d;}};VoiceAgentReport[_0x329b('0x20')]['syncHangup']=function(_0x1037c0){try{if(this[_0x329b('0x22')](_0x1037c0)){logger['debug'](_0x329b('0x7f'),_0x1037c0[_0x329b('0x25')],util[_0x329b('0x34')](_0x1037c0,{'showHidden':![],'depth':null}));if(this[_0x329b('0xc')][_0x1037c0[_0x329b('0x25')]]){for(var _0x1cae2b in this[_0x329b('0xc')][_0x1037c0[_0x329b('0x25')]]){if(this[_0x329b('0xc')][_0x1037c0[_0x329b('0x25')]][_0x329b('0x5d')](_0x1cae2b)){if(this[_0x329b('0xc')][_0x1037c0[_0x329b('0x25')]][_0x1cae2b]['reason']==_0x329b('0x80')&&this[_0x329b('0xc')][_0x1037c0['uniqueid']][_0x1cae2b][_0x329b('0x15')]){logger[_0x329b('0x24')](_0x329b('0x81'),_0x1037c0['uniqueid'],_0x1cae2b);this[_0x329b('0xc')][_0x1037c0[_0x329b('0x25')]][_0x1cae2b][_0x329b('0x82')]=moment()[_0x329b('0x37')](_0x329b('0x29'));}}}logger[_0x329b('0x27')](_0x329b('0x83'),_0x1037c0[_0x329b('0x25')],util[_0x329b('0x34')](_['values'](this['channels'][_0x1037c0[_0x329b('0x25')]]),{'showHidden':![],'depth':null}));ami[_0x329b('0x21')](_0x329b('0x84'),_[_0x329b('0x85')](this['channels'][_0x1037c0[_0x329b('0x25')]]));delete this[_0x329b('0xc')][_0x1037c0['uniqueid']];}if(this[_0x329b('0xf')][_0x1037c0[_0x329b('0x25')]]){delete this[_0x329b('0xf')][_0x1037c0[_0x329b('0x25')]];}}}catch(_0x5b84a1){logger[_0x329b('0x3a')](_0x329b('0x86'),_0x1037c0[_0x329b('0x25')],util[_0x329b('0x34')](_0x5b84a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x329b('0x20')]['syncAttendedTransfer']=function(_0x35412e){try{if(this[_0x329b('0x22')](_0x35412e)){logger['debug'](_0x329b('0x87'),_0x35412e['uniqueid'],util[_0x329b('0x34')](_0x35412e,{'showHidden':![],'depth':null}));if(this[_0x329b('0xc')][_0x35412e['transfereeuniqueid']]){for(var _0x412fb7 in this[_0x329b('0xc')][_0x35412e['transfereeuniqueid']]){if(this['channels'][_0x35412e[_0x329b('0x88')]][_0x329b('0x5d')](_0x412fb7)){if(_0x35412e[_0x329b('0x89')]===_0x412fb7){logger[_0x329b('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x35412e[_0x329b('0x25')],this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]][_0x412fb7][_0x329b('0x26')],_0x412fb7);var _0x22f2a2=moment();this['channels'][_0x35412e[_0x329b('0x88')]][_0x412fb7][_0x329b('0x15')]=!![];this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]][_0x412fb7][_0x329b('0x82')]=moment()[_0x329b('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x329b('0xc')][_0x35412e['transfereeuniqueid']][_0x412fb7][_0x329b('0x43')]=_0x329b('0x8a');this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]][_0x412fb7]['reason']=_0x329b('0x80');this[_0x329b('0xc')][_0x35412e['transfereeuniqueid']][_0x412fb7]['talktime']=_0x22f2a2['diff'](this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]][_0x412fb7][_0x329b('0x3d')],_0x329b('0x8b'));}}}}if(this[_0x329b('0xc')][_0x35412e[_0x329b('0x8c')]]){var _0x14a036=this['channels'][_0x35412e['secondtransfereruniqueid']];this[_0x329b('0xc')][_0x35412e[_0x329b('0x8c')]]=this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]];this[_0x329b('0xc')][_0x35412e[_0x329b('0x88')]]=_0x14a036;}}}catch(_0x38ca62){logger[_0x329b('0x3a')](_0x329b('0x8d'),_0x35412e['uniqueid'],util[_0x329b('0x34')](_0x38ca62,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x329b('0x1f')]=function(_0x656b68){try{if(this[_0x329b('0x22')](_0x656b68)){logger[_0x329b('0x27')](_0x329b('0x8e'),_0x656b68[_0x329b('0x25')],util[_0x329b('0x34')](_0x656b68,{'showHidden':![],'depth':null}));if(this[_0x329b('0xc')][_0x656b68[_0x329b('0x88')]]){for(var _0x4bf037 in this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']]){if(this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']]['hasOwnProperty'](_0x4bf037)){if(_0x656b68[_0x329b('0x8f')]===_0x4bf037){logger['info'](_0x329b('0x90'),_0x656b68[_0x329b('0x25')],this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']][_0x4bf037][_0x329b('0x26')],_0x4bf037);var _0x51a5fa=moment();this[_0x329b('0xc')][_0x656b68[_0x329b('0x88')]][_0x4bf037][_0x329b('0x15')]=!![];this[_0x329b('0xc')][_0x656b68[_0x329b('0x88')]][_0x4bf037][_0x329b('0x82')]=_0x51a5fa;this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']][_0x4bf037][_0x329b('0x43')]=_0x329b('0x8a');this[_0x329b('0xc')][_0x656b68[_0x329b('0x88')]][_0x4bf037][_0x329b('0x52')]='transfer';this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']][_0x4bf037][_0x329b('0x67')]=_0x51a5fa['diff'](this[_0x329b('0xc')][_0x656b68['transfereeuniqueid']][_0x4bf037][_0x329b('0x3d')],'seconds');}}}}}}catch(_0x5e3690){logger['error'](_0x329b('0x91'),_0x656b68[_0x329b('0x25')],util['inspect'](_0x5e3690,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x329b('0x20')][_0x329b('0x92')]=function(_0x1487e8){var _0x2f5782='';try{if(this['isNotNull'](_0x1487e8)){logger[_0x329b('0x27')](_0x329b('0x93'),_0x1487e8[_0x329b('0x25')],util[_0x329b('0x34')](_0x1487e8,{'showHidden':![],'depth':null}));if(_0x1487e8['channel']){_0x2f5782=_0x1487e8[_0x329b('0x94')][_0x329b('0x95')](0x0,_0x1487e8[_0x329b('0x94')][_0x329b('0x96')]('-'));if(this[_0x329b('0xe')][_0x2f5782]){logger[_0x329b('0x24')](_0x329b('0x97'),_0x1487e8[_0x329b('0x25')],_0x2f5782);this[_0x329b('0xe')][_0x2f5782][_0x329b('0x98')]=!![];}}}}catch(_0x1a60e9){logger[_0x329b('0x3a')](_0x329b('0x99'),_0x1487e8[_0x329b('0x25')],util[_0x329b('0x34')](_0x1a60e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x329b('0x1c')]=function(_0x31a2cd){var _0x241001='';try{if(this[_0x329b('0x22')](_0x31a2cd)){logger[_0x329b('0x27')](_0x329b('0x9a'),_0x31a2cd[_0x329b('0x25')],util[_0x329b('0x34')](_0x31a2cd,{'showHidden':![],'depth':null}));if(_0x31a2cd[_0x329b('0x94')]){_0x241001=_0x31a2cd[_0x329b('0x94')][_0x329b('0x95')](0x0,_0x31a2cd['channel'][_0x329b('0x96')]('-'));if(this['agents'][_0x241001]){logger['info']('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x31a2cd[_0x329b('0x25')],_0x241001);this[_0x329b('0xe')][_0x241001][_0x329b('0x98')]=![];}}}}catch(_0x1d5d60){logger[_0x329b('0x3a')]('[%s][voiceAgentReport][musiconholdstop]',_0x31a2cd['uniqueid'],util['inspect'](_0x1d5d60,{'showHidden':![],'depth':null}));}};module[_0x329b('0x9b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 47e5d3e..73375ad 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 _0xfbe6=['[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','answertime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','getSettings','catch','Action','finally','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','milliseconds','mohtime','exports','bluebird','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','localhost','channels','agents','blindTransfers','coreshowchannel','bind','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','isUndefined','prototype','emit','isNotNull','uniqueid','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','inspect','merge','pick','keys','context','from-sip','split','exten','destconnectedlinenum','format','user:%s','channel','name','accountcode','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','linkedid','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newchannel]','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','starttime','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','set','cdr(','match','queue','[%s][voiceCallReport][newexten]','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xfbe6,0x1d5));var _0x6fbe=function(_0x39fa5c,_0x30706f){_0x39fa5c=_0x39fa5c-0x0;var _0x2fceff=_0xfbe6[_0x39fa5c];return _0x2fceff;};'use strict';var BPromise=require(_0x6fbe('0x0'));var _=require(_0x6fbe('0x1'));var moment=require('moment');var util=require(_0x6fbe('0x2'));var path=require(_0x6fbe('0x3'));var Redis=require(_0x6fbe('0x4'));var config=require(_0x6fbe('0x5'));var logger=require(_0x6fbe('0x6'))('ami');var ami=require(_0x6fbe('0x7'));var Channel=require('../model/channel');var RpcSetting=require(_0x6fbe('0x8'));var statusDesc=[_0x6fbe('0x9'),_0x6fbe('0xa'),_0x6fbe('0xb'),_0x6fbe('0xc'),_0x6fbe('0xd'),_0x6fbe('0xe'),'ringing',_0x6fbe('0xf'),'onhold'];var applications=['set','queue',_0x6fbe('0x10'),_0x6fbe('0x11'),_0x6fbe('0x12'),_0x6fbe('0x13')];var dispositions=[_0x6fbe('0x14'),_0x6fbe('0x15'),_0x6fbe('0x15'),_0x6fbe('0x14'),_0x6fbe('0x14'),_0x6fbe('0x14'),_0x6fbe('0x16'),'BUSY',_0x6fbe('0x15'),'FAILED',_0x6fbe('0x15')];var actions={};config[_0x6fbe('0x17')]=_['defaults'](config[_0x6fbe('0x17')],{'host':_0x6fbe('0x18'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceCallReport(_0x27cb81){this[_0x6fbe('0x19')]=_0x27cb81['channels'];this[_0x6fbe('0x1a')]=_0x27cb81['agents'];this[_0x6fbe('0x1b')]={};ami['on'](_0x6fbe('0x1c'),this['syncNewExten'][_0x6fbe('0x1d')](this));ami['on']('newexten',this[_0x6fbe('0x1e')]['bind'](this));ami['on'](_0x6fbe('0x1f'),this[_0x6fbe('0x20')][_0x6fbe('0x1d')](this));ami['on'](_0x6fbe('0x21'),this[_0x6fbe('0x22')][_0x6fbe('0x1d')](this));ami['on']('varset',this['syncVarSet'][_0x6fbe('0x1d')](this));ami['on'](_0x6fbe('0x23'),this[_0x6fbe('0x24')][_0x6fbe('0x1d')](this));ami['on'](_0x6fbe('0x25'),this[_0x6fbe('0x26')][_0x6fbe('0x1d')](this));ami['on'](_0x6fbe('0x27'),this[_0x6fbe('0x28')][_0x6fbe('0x1d')](this));ami['on'](_0x6fbe('0x29'),this[_0x6fbe('0x2a')]['bind'](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x6fbe('0x2b'),this['syncMusicOnHoldStop'][_0x6fbe('0x1d')](this));try{logger[_0x6fbe('0x2c')](_0x6fbe('0x2d'));ami[_0x6fbe('0x2e')]();}catch(_0x716f91){logger[_0x6fbe('0x2f')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0x716f91,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0x591fbb){return _0x591fbb!==null&&!_[_0x6fbe('0x30')](_0x591fbb);};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0x32')]=function(_0x53692f,_0x3b5365,_0x3a83b8){io['to'](_0x53692f)['emit'](_0x3b5365,_0x3a83b8);};VoiceCallReport[_0x6fbe('0x31')]['syncNewCallerId']=function(_0x15bddf){try{if(this[_0x6fbe('0x33')](_0x15bddf)){logger[_0x6fbe('0x2c')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x15bddf[_0x6fbe('0x34')],_0x15bddf[_0x6fbe('0x35')],_0x15bddf['calleridnum']);logger['debug'](_0x6fbe('0x36'),_0x15bddf[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x15bddf,{'showHidden':![],'depth':null}));if(_0x15bddf['uniqueid']===_0x15bddf['linkedid']){if(!_[_0x6fbe('0x30')](this[_0x6fbe('0x19')][_0x15bddf[_0x6fbe('0x34')]])){_[_0x6fbe('0x38')](this[_0x6fbe('0x19')][_0x15bddf['uniqueid']],_[_0x6fbe('0x39')](_0x15bddf,_[_0x6fbe('0x3a')](this['channels'][_0x15bddf[_0x6fbe('0x34')]])));}}if(_0x15bddf[_0x6fbe('0x3b')]===_0x6fbe('0x3c')){if(this[_0x6fbe('0x1a')][_0x15bddf['channel'][_0x6fbe('0x3d')]('-')[0x0]]){if(_0x15bddf[_0x6fbe('0x3e')]=='xcally-motion-preview'){this['agents'][_0x15bddf['channel']['split']('-')[0x0]][_0x6fbe('0x3f')]=_0x15bddf['connectedlinenum'];this['emit'](util[_0x6fbe('0x40')](_0x6fbe('0x41'),this['agents'][_0x15bddf[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x43')]),'user:agentconnect',{'destaccountcode':this[_0x6fbe('0x1a')][_0x15bddf[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x44')],'destconnectedlinenum':_0x15bddf['connectedlinenum']});}}}}}catch(_0x2da2d6){logger[_0x6fbe('0x2f')](_0x6fbe('0x45'),_0x15bddf[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x2da2d6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')]['syncNewChannel']=function(_0x3af874){try{if(this[_0x6fbe('0x33')](_0x3af874)){logger[_0x6fbe('0x46')](_0x6fbe('0x47'),_0x3af874[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x3af874,{'showHidden':![],'depth':null}));if(_0x3af874[_0x6fbe('0x34')]===_0x3af874[_0x6fbe('0x48')]&&_0x3af874[_0x6fbe('0x42')]!='OutgoingSpoolFailed'){if(_[_0x6fbe('0x30')](this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]])){logger['info']('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x3af874[_0x6fbe('0x34')],_0x3af874[_0x6fbe('0x3b')],_0x3af874[_0x6fbe('0x3e')]);this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]]=new Channel();this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]]['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]][_0x6fbe('0x49')]=dispositions[_[_0x6fbe('0x4a')](_0x3af874[_0x6fbe('0x4b')])];_[_0x6fbe('0x38')](this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]],_['pick'](_0x3af874,_['keys'](this[_0x6fbe('0x19')][_0x3af874[_0x6fbe('0x34')]])));if(_0x3af874[_0x6fbe('0x3b')]===_0x6fbe('0x3c')){if(this['agents'][_0x3af874[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]){if(_[_0x6fbe('0x30')](this[_0x6fbe('0x1a')][_0x3af874[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x3f')])){this['agents'][_0x3af874['channel'][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x3f')]=_0x3af874['exten'];logger[_0x6fbe('0x46')](_0x6fbe('0x4c'),_0x3af874[_0x6fbe('0x34')],util[_0x6fbe('0x37')]({'destaccountcode':this[_0x6fbe('0x1a')][_0x3af874[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x44')],'destconnectedlinenum':_0x3af874[_0x6fbe('0x3e')]},{'showHidden':![],'depth':null}));this[_0x6fbe('0x32')](util[_0x6fbe('0x40')](_0x6fbe('0x41'),this[_0x6fbe('0x1a')][_0x3af874[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]['name']),_0x6fbe('0x4d'),{'destaccountcode':this[_0x6fbe('0x1a')][_0x3af874['channel'][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x44')],'destconnectedlinenum':_0x3af874['exten']});}}}}}}}catch(_0x1a4f2d){logger[_0x6fbe('0x2f')](_0x6fbe('0x4e'),_0x3af874['uniqueid'],util[_0x6fbe('0x37')](_0x1a4f2d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')]['syncNewExten']=function(_0x62f33d){try{if(this[_0x6fbe('0x33')](_0x62f33d)){logger[_0x6fbe('0x46')]('[%s][voiceCallReport][newexten]\x20event:',_0x62f33d[_0x6fbe('0x34')],util['inspect'](_0x62f33d,{'showHidden':![],'depth':null}));if(_0x62f33d[_0x6fbe('0x34')]===_0x62f33d[_0x6fbe('0x48')]&&_0x62f33d['exten']!='h'&&_0x62f33d['channel']!=_0x6fbe('0x4f')){_0x62f33d[_0x6fbe('0x50')]=_0x62f33d['application'][_0x6fbe('0x51')]();_0x62f33d[_0x6fbe('0x52')]=_0x62f33d['appdata']&&_0x62f33d[_0x6fbe('0x53')]['startsWith']('CDR(routeAlias)')?_0x62f33d['appdata']:(_0x62f33d[_0x6fbe('0x53')]||_0x62f33d[_0x6fbe('0x52')])[_0x6fbe('0x51')]();logger[_0x6fbe('0x2c')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x62f33d['uniqueid'],_0x62f33d[_0x6fbe('0x50')],_0x62f33d[_0x6fbe('0x52')]);if(_[_0x6fbe('0x30')](this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]])){this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]]=new Channel();this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]][_0x6fbe('0x54')]=_0x62f33d['duration']?moment()['subtract'](moment[_0x6fbe('0x55')](_0x62f33d[_0x6fbe('0x55')])[_0x6fbe('0x56')](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x6fbe('0x40')](_0x6fbe('0x57'));this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]][_0x6fbe('0x49')]='NO\x20ANSWER';}_[_0x6fbe('0x38')](this['channels'][_0x62f33d[_0x6fbe('0x34')]],_[_0x6fbe('0x39')](_0x62f33d,_['keys'](this[_0x6fbe('0x19')][_0x62f33d['uniqueid']])));if(_[_0x6fbe('0x58')](applications,_0x62f33d[_0x6fbe('0x50')])){this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]][_0x6fbe('0x59')]=_0x62f33d[_0x6fbe('0x50')];this['channels'][_0x62f33d[_0x6fbe('0x34')]]['lastdata']=_0x62f33d[_0x6fbe('0x52')];if(_0x62f33d['application']===_0x6fbe('0x5a')&&_['startsWith'](_0x62f33d[_0x6fbe('0x52')][_0x6fbe('0x51')](),_0x6fbe('0x5b'))){var _0x3e95d0=_0x62f33d[_0x6fbe('0x52')]['split']('=');var _0x24e881=_0x3e95d0[0x0][_0x6fbe('0x51')]()[_0x6fbe('0x5c')](/cdr\((.*)\)/);if(_0x24e881){this[_0x6fbe('0x19')][_0x62f33d[_0x6fbe('0x34')]][_0x24e881[0x1]]=_0x3e95d0[0x1];}}else if(_0x62f33d['application']==='queue'){this[_0x6fbe('0x19')][_0x62f33d['uniqueid']][_0x6fbe('0x5d')]=_0x62f33d[_0x6fbe('0x52')]['split'](',')[0x0];}}}}}catch(_0x3d6a83){logger[_0x6fbe('0x2f')](_0x6fbe('0x5e'),_0x62f33d[_0x6fbe('0x34')],util['inspect'](_0x3d6a83,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x3ce84f){try{if(this[_0x6fbe('0x33')](_0x3ce84f)){logger[_0x6fbe('0x2c')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x3ce84f[_0x6fbe('0x34')],_0x3ce84f[_0x6fbe('0x48')],_0x3ce84f[_0x6fbe('0x35')],_0x3ce84f[_0x6fbe('0x5f')]);logger[_0x6fbe('0x46')](_0x6fbe('0x60'),_0x3ce84f[_0x6fbe('0x34')],util['inspect'](_0x3ce84f,{'showHidden':![],'depth':null}));if(_0x3ce84f[_0x6fbe('0x34')]!==_0x3ce84f['linkedid']){if(this['channels'][_0x3ce84f['linkedid']]){if(_0x3ce84f[_0x6fbe('0x4b')]==='6'){if(!this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x61')]){var _0x18b723=moment();this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]]['answered']=!![];this['channels'][_0x3ce84f[_0x6fbe('0x48')]]['answertime']=_0x18b723[_0x6fbe('0x40')](_0x6fbe('0x57'));if(this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x54')]){this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x62')]=_0x18b723[_0x6fbe('0x63')](this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]]['starttime'],_0x6fbe('0x56'));}}this['channels'][_0x3ce84f['linkedid']]['linkedid']=_0x3ce84f[_0x6fbe('0x34')];if(_0x3ce84f[_0x6fbe('0x5f')]!==_0x6fbe('0x64')){this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x65')]=_0x3ce84f['calleridnum'];}this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x66')]=_0x3ce84f['calleridname'];this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x67')]=_0x3ce84f[_0x6fbe('0x42')];this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]]['disposition']=dispositions[_[_0x6fbe('0x4a')](_0x3ce84f['channelstate'])];if(this[_0x6fbe('0x1a')][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]){this['channels'][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x68')]=this[_0x6fbe('0x1a')][_0x3ce84f['channel']['split']('-')[0x0]]['id'];this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]]['membername']=this['agents'][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]['name'];}}}}else{if(this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x34')]]){if(_0x3ce84f[_0x6fbe('0x4b')]==='6'){if(this['agents'][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]){this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x34')]][_0x6fbe('0x68')]=this[_0x6fbe('0x1a')][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]['id'];this[_0x6fbe('0x19')][_0x3ce84f['uniqueid']][_0x6fbe('0x69')]=this['agents'][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x43')];}}}}if(_0x3ce84f[_0x6fbe('0x4b')]==='6'&&_0x3ce84f[_0x6fbe('0x3b')]==='from-sip'){if(this['agents'][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]){this[_0x6fbe('0x1a')][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x3f')]=_0x3ce84f[_0x6fbe('0x3e')];var _0x2d8fd1;if(this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x34')]])_0x2d8fd1=this['channels'][_0x3ce84f[_0x6fbe('0x34')]][_0x6fbe('0x6a')];else if(this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]])_0x2d8fd1=this[_0x6fbe('0x19')][_0x3ce84f[_0x6fbe('0x48')]][_0x6fbe('0x6a')];logger[_0x6fbe('0x46')](_0x6fbe('0x6b'),_0x3ce84f[_0x6fbe('0x34')],util[_0x6fbe('0x37')]({'destaccountcode':this[_0x6fbe('0x1a')][_0x3ce84f['channel'][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x44')],'destconnectedlinenum':_0x3ce84f['exten'],'routealias':_0x2d8fd1},{'showHidden':![],'depth':null}));this['emit'](util[_0x6fbe('0x40')](_0x6fbe('0x41'),this[_0x6fbe('0x1a')][_0x3ce84f['channel'][_0x6fbe('0x3d')]('-')[0x0]]['name']),_0x6fbe('0x4d'),{'destaccountcode':this[_0x6fbe('0x1a')][_0x3ce84f[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x44')],'destconnectedlinenum':_0x3ce84f['exten'],'routealias':_0x2d8fd1});}}}}catch(_0x29bbf3){logger['error'](_0x6fbe('0x6c'),_0x3ce84f[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x29bbf3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0x6d')]=function(_0x3ff9b1,_0x169269){try{if(this[_0x6fbe('0x19')][_0x3ff9b1]){logger[_0x6fbe('0x2c')](_0x6fbe('0x6e'),_0x3ff9b1,_0x169269);this[_0x6fbe('0x19')][_0x3ff9b1][_0x6fbe('0x6f')]=!![];if(_['endsWith'](_0x169269,_0x6fbe('0x70'))){_0x169269=_0x169269[_0x6fbe('0x71')](_0x6fbe('0x70'),_0x6fbe('0x72'));}this['channels'][_0x3ff9b1][_0x6fbe('0x73')]=_0x169269;var _0x2148a2=_[_0x6fbe('0x74')](this['channels'][_0x3ff9b1][_0x6fbe('0x75')],{'filename':_0x169269});if(_[_0x6fbe('0x76')](_0x2148a2)){this[_0x6fbe('0x19')][_0x3ff9b1]['monitors'][_0x6fbe('0x77')]({'filename':_0x169269,'createdAt':moment()[_0x6fbe('0x40')](_0x6fbe('0x57')),'mixmonitorid':'','status':_0x6fbe('0x78')});}}}catch(_0x352bb9){logger[_0x6fbe('0x2f')](_0x6fbe('0x79'),_0x3ff9b1,util[_0x6fbe('0x37')](_0x352bb9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0x7a')]=function(_0x1fd1a7){try{if(this['isNotNull'](_0x1fd1a7)){logger['debug'](_0x6fbe('0x7b'),_0x1fd1a7[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x1fd1a7,{'showHidden':![],'depth':null}));if(this[_0x6fbe('0x19')][_0x1fd1a7[_0x6fbe('0x34')]]&&_0x1fd1a7[_0x6fbe('0x42')]!=_0x6fbe('0x4f')){if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')])){if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')]['mixmonitor_filename'])){logger[_0x6fbe('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this[_0x6fbe('0x6d')](_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7['value']);}else if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x7e')])){logger[_0x6fbe('0x2c')](_0x6fbe('0x7f'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this[_0x6fbe('0x19')][_0x1fd1a7['uniqueid']][_0x6fbe('0x5f')]=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x80')])){logger[_0x6fbe('0x2c')](_0x6fbe('0x81'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this[_0x6fbe('0x19')][_0x1fd1a7[_0x6fbe('0x34')]][_0x6fbe('0x82')]=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')]['xmd-cdrtype'])){logger[_0x6fbe('0x2c')](_0x6fbe('0x83'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this['channels'][_0x1fd1a7['uniqueid']][_0x6fbe('0x84')]=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x85')])){logger['info'](_0x6fbe('0x86'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7['value'][_0x6fbe('0x3d')](',')[0x0]);this['channels'][_0x1fd1a7[_0x6fbe('0x34')]][_0x6fbe('0x5d')]=_0x1fd1a7[_0x6fbe('0x7d')][_0x6fbe('0x3d')](',')[0x0];}else if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')]['xmd-originatecalleridnum'])){logger[_0x6fbe('0x2c')](_0x6fbe('0x87'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7['value']);this[_0x6fbe('0x19')][_0x1fd1a7[_0x6fbe('0x34')]]['originatecalleridnum']=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x88')])){logger[_0x6fbe('0x2c')](_0x6fbe('0x89'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this['channels'][_0x1fd1a7[_0x6fbe('0x34')]][_0x6fbe('0x8a')]=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x8b')])){logger['info'](_0x6fbe('0x8c'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this[_0x6fbe('0x19')][_0x1fd1a7['uniqueid']]['calleridpreview']=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this[_0x6fbe('0x33')](_0x1fd1a7['variable'][_0x6fbe('0x8d')])){logger[_0x6fbe('0x2c')](_0x6fbe('0x8e'),_0x1fd1a7['uniqueid'],_0x1fd1a7['value']);this['channels'][_0x1fd1a7['uniqueid']]['queue']=_0x1fd1a7[_0x6fbe('0x7d')];}else if(this[_0x6fbe('0x33')](_0x1fd1a7[_0x6fbe('0x7c')]['sipcallid'])){logger['info'](_0x6fbe('0x8f'),_0x1fd1a7[_0x6fbe('0x34')],_0x1fd1a7[_0x6fbe('0x7d')]);this['channels'][_0x1fd1a7['uniqueid']][_0x6fbe('0x90')]=_0x1fd1a7[_0x6fbe('0x7d')];}}}else if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x91')])){if(_0x1fd1a7['value']){var _0x159254=path[_0x6fbe('0x92')](_0x1fd1a7[_0x6fbe('0x7d')])[_0x6fbe('0x43')];logger[_0x6fbe('0x2c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x159254,_0x1fd1a7['value']);this[_0x6fbe('0x6d')](_0x159254,_0x1fd1a7[_0x6fbe('0x7d')]);}}else if(this['channels'][_0x1fd1a7[_0x6fbe('0x48')]]){if(this['isNotNull'](_0x1fd1a7['variable'])){if(this['isNotNull'](_0x1fd1a7[_0x6fbe('0x7c')][_0x6fbe('0x93')])){logger[_0x6fbe('0x2c')](_0x6fbe('0x8f'),_0x1fd1a7[_0x6fbe('0x48')],_0x1fd1a7[_0x6fbe('0x7d')]);this[_0x6fbe('0x19')][_0x1fd1a7['linkedid']][_0x6fbe('0x94')]=_0x1fd1a7[_0x6fbe('0x7d')];}}}}}catch(_0x5881fd){logger['error'](_0x6fbe('0x95'),_0x1fd1a7[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x5881fd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0x24')]=function(_0x16a187){try{if(this[_0x6fbe('0x33')](_0x16a187)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x16a187['uniqueid'],util[_0x6fbe('0x37')](_0x16a187,{'showHidden':![],'depth':null}));if(this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]]){logger[_0x6fbe('0x2c')](_0x6fbe('0x96'),_0x16a187['uniqueid'],_0x16a187[_0x6fbe('0x97')]);var _0x5077e1=moment();this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]]['endtime']=_0x5077e1[_0x6fbe('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x55')]=_0x5077e1[_0x6fbe('0x63')](this[_0x6fbe('0x19')][_0x16a187['uniqueid']][_0x6fbe('0x54')],_0x6fbe('0x56'));if(this[_0x6fbe('0x19')][_0x16a187['uniqueid']]['answered']){this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x98')]=_0x5077e1['diff'](this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x99')],_0x6fbe('0x56'));this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x62')]=this[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x55')]-this['channels'][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x98')];}if(_0x16a187[_0x6fbe('0x3b')]===_0x6fbe('0x3c')){if(this[_0x6fbe('0x1a')][_0x16a187[_0x6fbe('0x42')]['split']('-')[0x0]]){this[_0x6fbe('0x1a')][_0x16a187[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]=_[_0x6fbe('0x9a')](this[_0x6fbe('0x1a')][_0x16a187['channel']['split']('-')[0x0]],[_0x6fbe('0x3f')]);logger[_0x6fbe('0x46')](_0x6fbe('0x9b'),_0x16a187[_0x6fbe('0x34')],util[_0x6fbe('0x37')]({'id':this[_0x6fbe('0x1a')][_0x16a187[_0x6fbe('0x42')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x6fbe('0x1a')][_0x16a187[_0x6fbe('0x42')]['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x6fbe('0x32')](util[_0x6fbe('0x40')]('user:%s',this[_0x6fbe('0x1a')][_0x16a187['channel'][_0x6fbe('0x3d')]('-')[0x0]][_0x6fbe('0x43')]),_0x6fbe('0x9c'),{'id':this['agents'][_0x16a187[_0x6fbe('0x42')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x6fbe('0x1a')][_0x16a187[_0x6fbe('0x42')][_0x6fbe('0x3d')]('-')[0x0]]['accountcode']});}}var _0x927665=this;Promise[_0x6fbe('0x9d')]()[_0x6fbe('0x9e')](function(){var _0x5af3fe=_0x927665[_0x6fbe('0x19')][_0x16a187['uniqueid']];if(typeof _0x5af3fe[_0x6fbe('0x9f')]===_0x6fbe('0xa0'))return;if(_['isEmpty'](_0x5af3fe[_0x6fbe('0x75')]))return;return RpcSetting[_0x6fbe('0xa1')]()['then'](function(_0x3cc80c){if(!_0x3cc80c['stopRecordingOnTransfer'])return;return Promise['resolve']()['then'](function(){return ami['Action']({'action':'StopMixMonitor','channel':_0x5af3fe['channel']})[_0x6fbe('0xa2')](function(){});})[_0x6fbe('0x9e')](function(){return ami[_0x6fbe('0xa3')]({'action':'StopMixMonitor','channel':_0x5af3fe['destinationchannel']})[_0x6fbe('0xa2')](function(){})[_0x6fbe('0xa4')](function(){var _0x65cf0e=_0x927665[_0x6fbe('0x1a')][_0x5af3fe[_0x6fbe('0x67')][_0x6fbe('0x3d')]('-')[0x0]];if(!_0x65cf0e)return;io[_0x6fbe('0x32')]('webbar:stopmonitors',{'agentId':_0x65cf0e['id'],'uniqueid':_0x5af3fe[_0x6fbe('0x34')]});});});});})['then'](function(){if(_0x16a187[_0x6fbe('0xa5')]===_0x6fbe('0xa6')){_0x927665[_0x6fbe('0x1b')][_0x16a187['uniqueid']]=_0x927665['channels'][_0x16a187[_0x6fbe('0x34')]];}else{if(_0x927665[_0x6fbe('0x19')][_0x16a187['uniqueid']][_0x6fbe('0x84')]===_0x6fbe('0xa7')&&_0x927665[_0x6fbe('0x1b')][_0x16a187[_0x6fbe('0x34')]]){_0x927665[_0x6fbe('0x19')][_0x16a187['uniqueid']][_0x6fbe('0x34')]=[_0x927665['channels'][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x48')],_0x927665[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x48')]=_0x927665['channels'][_0x16a187[_0x6fbe('0x34')]][_0x6fbe('0x34')]][0x0];delete _0x927665[_0x6fbe('0x1b')][_0x16a187['uniqueid']];}}logger[_0x6fbe('0x46')](_0x6fbe('0xa8'),_0x16a187[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x927665[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]],{'showHidden':![],'depth':null}));ami[_0x6fbe('0x32')](_0x6fbe('0xa9'),_0x927665[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]]);delete _0x927665[_0x6fbe('0x19')][_0x16a187[_0x6fbe('0x34')]];});}}}catch(_0x369a5a){logger[_0x6fbe('0x2f')](_0x6fbe('0xaa'),_0x16a187[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x369a5a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0x28')]=function(_0x45fe3d){try{if(this[_0x6fbe('0x33')](_0x45fe3d)){logger[_0x6fbe('0x2c')](_0x6fbe('0xab'),_0x45fe3d[_0x6fbe('0x34')],_0x45fe3d['origtransferercalleridnum'],_0x45fe3d[_0x6fbe('0xac')]);logger['debug'](_0x6fbe('0xad'),_0x45fe3d[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x45fe3d,{'showHidden':![],'depth':null}));if(this['channels'][_0x45fe3d[_0x6fbe('0xae')]]){this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xae')]][_0x6fbe('0xaf')]=_0x45fe3d[_0x6fbe('0xb0')];this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xae')]][_0x6fbe('0xb1')]=_0x45fe3d[_0x6fbe('0xac')];if(this[_0x6fbe('0x19')][_0x45fe3d['secondtransfereruniqueid']]){var _0x287e18=this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb2')]];this['channels'][_0x45fe3d[_0x6fbe('0xb2')]]=this[_0x6fbe('0x19')][_0x45fe3d['transfereeuniqueid']];this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xae')]]=_0x287e18;}}else if(this['channels'][_0x45fe3d[_0x6fbe('0xb3')]]){this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb3')]][_0x6fbe('0xaf')]=_0x45fe3d['origtransferercalleridnum'];this[_0x6fbe('0x19')][_0x45fe3d['transfertargetuniqueid']]['transferconnectedlinenum']=_0x45fe3d[_0x6fbe('0xac')];if(this['channels'][_0x45fe3d[_0x6fbe('0xb4')]]){var _0x287e18=this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb4')]];this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb4')]]=this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb3')]];this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb3')]]=_0x287e18;}}if((this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb4')]]||this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb5')]])&&this[_0x6fbe('0x19')][_0x45fe3d['secondtransfereruniqueid']]){var _0x4a8c41=_[_0x6fbe('0xb6')]([this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb4')]],this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb5')]],this['channels'][_0x45fe3d[_0x6fbe('0xb2')]]],function(_0xaa99cd){return _0xaa99cd&&_0xaa99cd['type']===_0x6fbe('0xa7')&&_0xaa99cd[_0x6fbe('0xb7')];});if(_0x4a8c41){if(this['channels'][_0x45fe3d[_0x6fbe('0xb4')]])this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb4')]][_0x6fbe('0x9f')]=_0x6fbe('0xb8');if(this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb5')]])this[_0x6fbe('0x19')][_0x45fe3d['origtransfererlinkedid']][_0x6fbe('0x9f')]=_0x6fbe('0xb8');this[_0x6fbe('0x19')][_0x45fe3d[_0x6fbe('0xb2')]][_0x6fbe('0x9f')]=_0x6fbe('0xb8');}}}}catch(_0x5adc1f){logger['error'](_0x6fbe('0xb9'),_0x45fe3d[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x5adc1f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6fbe('0x2a')]=function(_0x122877){try{if(this[_0x6fbe('0x33')](_0x122877)){logger['info'](_0x6fbe('0xba'),_0x122877[_0x6fbe('0x34')],_0x122877[_0x6fbe('0xbb')],_0x122877[_0x6fbe('0xbc')]);logger[_0x6fbe('0x46')](_0x6fbe('0xbd'),_0x122877[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x122877,{'showHidden':![],'depth':null}));if(this[_0x6fbe('0x19')][_0x122877[_0x6fbe('0xae')]]){this[_0x6fbe('0x19')][_0x122877[_0x6fbe('0xae')]][_0x6fbe('0xaf')]=_0x122877[_0x6fbe('0xbb')];this[_0x6fbe('0x19')][_0x122877['transfereeuniqueid']][_0x6fbe('0xb1')]=_0x122877[_0x6fbe('0xbc')];this['channels'][_0x122877['transfereeuniqueid']][_0x6fbe('0x9f')]=_0x6fbe('0xbe');this[_0x6fbe('0x24')]({'event':'BlindTransfer','uniqueid':_0x122877[_0x6fbe('0xae')],'context':_0x122877[_0x6fbe('0x3b')],'channel':_0x122877[_0x6fbe('0xbf')]});}else{this[_0x6fbe('0x19')][_0x122877[_0x6fbe('0xc0')]][_0x6fbe('0x9f')]='BLIND';}}}catch(_0x5a66f){logger[_0x6fbe('0x2f')](_0x6fbe('0xc1'),_0x122877[_0x6fbe('0x34')],util['inspect'](_0x5a66f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0xc2')]=function(_0x1384cd){try{if(this[_0x6fbe('0x33')](_0x1384cd)){logger[_0x6fbe('0x46')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x1384cd['uniqueid'],util['inspect'](_0x1384cd,{'showHidden':![],'depth':null}));if(this[_0x6fbe('0x19')][_0x1384cd[_0x6fbe('0x34')]]){if(!_[_0x6fbe('0x76')](this['channels'][_0x1384cd[_0x6fbe('0x34')]][_0x6fbe('0x99')])){this['channels'][_0x1384cd[_0x6fbe('0x34')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x6fbe('0xc3'),_0x1384cd['uniqueid'],this['channels'][_0x1384cd[_0x6fbe('0x34')]][_0x6fbe('0xc4')]);}}}}catch(_0x3ffa02){logger[_0x6fbe('0x2f')](_0x6fbe('0xc5'),_0x1384cd[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x3ffa02,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6fbe('0x31')][_0x6fbe('0xc6')]=function(_0x4981b3){try{if(this[_0x6fbe('0x33')](_0x4981b3)){logger[_0x6fbe('0x46')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x4981b3[_0x6fbe('0x34')],util['inspect'](_0x4981b3,{'showHidden':![],'depth':null}));if(this[_0x6fbe('0x19')][_0x4981b3[_0x6fbe('0x34')]]){if(!_['isNil'](this[_0x6fbe('0x19')][_0x4981b3['uniqueid']]['mohstarttime'])){this[_0x6fbe('0x19')][_0x4981b3[_0x6fbe('0x34')]]['mohtime']+=moment()[_0x6fbe('0xc7')](0x0)[_0x6fbe('0x63')](this[_0x6fbe('0x19')][_0x4981b3[_0x6fbe('0x34')]]['mohstarttime'],_0x6fbe('0x56'));logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4981b3[_0x6fbe('0x34')],this[_0x6fbe('0x19')][_0x4981b3[_0x6fbe('0x34')]][_0x6fbe('0xc8')]);delete this['channels'][_0x4981b3['uniqueid']][_0x6fbe('0xc4')];}}}}catch(_0x4e56db){logger[_0x6fbe('0x2f')]('[%s][voiceCallReport][musiconholdstop]',_0x4981b3[_0x6fbe('0x34')],util[_0x6fbe('0x37')](_0x4e56db,{'showHidden':![],'depth':null}));}};module[_0x6fbe('0xc9')]=VoiceCallReport; \ No newline at end of file +var _0x8bf5=['transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','transfereruniqueid','BLIND','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','socket.io-emitter','redis','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','keys','context','channel','split','xcally-motion-preview','connectedlinenum','format','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','isUndefined','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','connectedlinename','destinationchannel','UserId','membername','destconnectedlinenum','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','.wav49','.WAV','monitors','isNil','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','billableseconds','omit','user:agentcomplete','resolve','then','transferType','undefined','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid'];(function(_0x30f3eb,_0x417b5b){var _0x27356c=function(_0x1e45a0){while(--_0x1e45a0){_0x30f3eb['push'](_0x30f3eb['shift']());}};_0x27356c(++_0x417b5b);}(_0x8bf5,0x1a4));var _0x58bf=function(_0x97d60a,_0x2011d1){_0x97d60a=_0x97d60a-0x0;var _0x4d9d3f=_0x8bf5[_0x97d60a];return _0x4d9d3f;};'use strict';var BPromise=require(_0x58bf('0x0'));var _=require(_0x58bf('0x1'));var moment=require(_0x58bf('0x2'));var util=require(_0x58bf('0x3'));var path=require('path');var Redis=require('ioredis');var config=require(_0x58bf('0x4'));var logger=require(_0x58bf('0x5'))(_0x58bf('0x6'));var ami=require(_0x58bf('0x7'));var Channel=require(_0x58bf('0x8'));var RpcSetting=require(_0x58bf('0x9'));var statusDesc=[_0x58bf('0xa'),'not_inuse',_0x58bf('0xb'),_0x58bf('0xc'),_0x58bf('0xd'),_0x58bf('0xe'),_0x58bf('0xf'),_0x58bf('0x10'),_0x58bf('0x11')];var applications=[_0x58bf('0x12'),_0x58bf('0x13'),_0x58bf('0x14'),_0x58bf('0x15'),_0x58bf('0x16'),'voicemail'];var dispositions=[_0x58bf('0x17'),_0x58bf('0x18'),_0x58bf('0x18'),_0x58bf('0x17'),_0x58bf('0x17'),_0x58bf('0x17'),'ANSWERED','BUSY',_0x58bf('0x18'),_0x58bf('0x18'),_0x58bf('0x18')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x58bf('0x19'))(new Redis(config[_0x58bf('0x1a')]));function VoiceCallReport(_0x1c6f91){this[_0x58bf('0x1b')]=_0x1c6f91[_0x58bf('0x1b')];this[_0x58bf('0x1c')]=_0x1c6f91[_0x58bf('0x1c')];this[_0x58bf('0x1d')]={};ami['on'](_0x58bf('0x1e'),this[_0x58bf('0x1f')]['bind'](this));ami['on'](_0x58bf('0x20'),this[_0x58bf('0x1f')][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x22'),this[_0x58bf('0x23')][_0x58bf('0x21')](this));ami['on']('newstate',this['syncNewState'][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x24'),this['syncVarSet']['bind'](this));ami['on'](_0x58bf('0x25'),this[_0x58bf('0x26')][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x27'),this[_0x58bf('0x28')][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x29'),this[_0x58bf('0x2a')]['bind'](this));ami['on'](_0x58bf('0x2b'),this[_0x58bf('0x2c')][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x2d'),this['syncMusicOnHoldStart'][_0x58bf('0x21')](this));ami['on'](_0x58bf('0x2e'),this[_0x58bf('0x2f')][_0x58bf('0x21')](this));try{logger[_0x58bf('0x30')](_0x58bf('0x31'));ami['actionCoreShowChannels']();}catch(_0xc7c755){logger[_0x58bf('0x32')]('[voiceCallReport][coreshowchannels]',util[_0x58bf('0x33')](_0xc7c755,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x35')]=function(_0x29de53){return _0x29de53!==null&&!_['isUndefined'](_0x29de53);};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x36')]=function(_0x50cd76,_0xb4c1db,_0xe5b9ad){io['to'](_0x50cd76)[_0x58bf('0x36')](_0xb4c1db,_0xe5b9ad);};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x28')]=function(_0x1fee56){try{if(this[_0x58bf('0x35')](_0x1fee56)){logger[_0x58bf('0x30')](_0x58bf('0x37'),_0x1fee56['uniqueid'],_0x1fee56[_0x58bf('0x38')],_0x1fee56[_0x58bf('0x39')]);logger[_0x58bf('0x3a')](_0x58bf('0x3b'),_0x1fee56[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x1fee56,{'showHidden':![],'depth':null}));if(_0x1fee56[_0x58bf('0x3c')]===_0x1fee56[_0x58bf('0x3d')]){if(!_['isUndefined'](this[_0x58bf('0x1b')][_0x1fee56[_0x58bf('0x3c')]])){_[_0x58bf('0x3e')](this[_0x58bf('0x1b')][_0x1fee56['uniqueid']],_[_0x58bf('0x3f')](_0x1fee56,_[_0x58bf('0x40')](this['channels'][_0x1fee56[_0x58bf('0x3c')]])));}}if(_0x1fee56[_0x58bf('0x41')]==='from-sip'){if(this[_0x58bf('0x1c')][_0x1fee56[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]){if(_0x1fee56['exten']==_0x58bf('0x44')){this[_0x58bf('0x1c')][_0x1fee56['channel'][_0x58bf('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x1fee56[_0x58bf('0x45')];this[_0x58bf('0x36')](util[_0x58bf('0x46')]('user:%s',this[_0x58bf('0x1c')][_0x1fee56[_0x58bf('0x42')]['split']('-')[0x0]][_0x58bf('0x47')]),_0x58bf('0x48'),{'destaccountcode':this['agents'][_0x1fee56[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x49')],'destconnectedlinenum':_0x1fee56[_0x58bf('0x45')]});}}}}}catch(_0x45e751){logger[_0x58bf('0x32')](_0x58bf('0x4a'),_0x1fee56[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x45e751,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x23')]=function(_0x4465f7){try{if(this[_0x58bf('0x35')](_0x4465f7)){logger[_0x58bf('0x3a')](_0x58bf('0x4b'),_0x4465f7['uniqueid'],util[_0x58bf('0x33')](_0x4465f7,{'showHidden':![],'depth':null}));if(_0x4465f7[_0x58bf('0x3c')]===_0x4465f7[_0x58bf('0x3d')]&&_0x4465f7[_0x58bf('0x42')]!=_0x58bf('0x4c')){if(_[_0x58bf('0x4d')](this['channels'][_0x4465f7[_0x58bf('0x3c')]])){logger[_0x58bf('0x30')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x4465f7[_0x58bf('0x3c')],_0x4465f7[_0x58bf('0x41')],_0x4465f7[_0x58bf('0x4e')]);this[_0x58bf('0x1b')][_0x4465f7[_0x58bf('0x3c')]]=new Channel();this[_0x58bf('0x1b')][_0x4465f7[_0x58bf('0x3c')]][_0x58bf('0x4f')]=moment()['format'](_0x58bf('0x50'));this[_0x58bf('0x1b')][_0x4465f7[_0x58bf('0x3c')]][_0x58bf('0x51')]=dispositions[_[_0x58bf('0x52')](_0x4465f7[_0x58bf('0x53')])];_[_0x58bf('0x3e')](this[_0x58bf('0x1b')][_0x4465f7[_0x58bf('0x3c')]],_[_0x58bf('0x3f')](_0x4465f7,_[_0x58bf('0x40')](this[_0x58bf('0x1b')][_0x4465f7['uniqueid']])));if(_0x4465f7['context']===_0x58bf('0x54')){if(this[_0x58bf('0x1c')][_0x4465f7[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]){if(_[_0x58bf('0x4d')](this[_0x58bf('0x1c')][_0x4465f7[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['destconnectedlinenum'])){this[_0x58bf('0x1c')][_0x4465f7[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['destconnectedlinenum']=_0x4465f7['exten'];logger[_0x58bf('0x3a')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x4465f7['uniqueid'],util[_0x58bf('0x33')]({'destaccountcode':this[_0x58bf('0x1c')][_0x4465f7['channel'][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x49')],'destconnectedlinenum':_0x4465f7['exten']},{'showHidden':![],'depth':null}));this[_0x58bf('0x36')](util[_0x58bf('0x46')](_0x58bf('0x55'),this[_0x58bf('0x1c')][_0x4465f7['channel'][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x47')]),_0x58bf('0x48'),{'destaccountcode':this[_0x58bf('0x1c')][_0x4465f7['channel'][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x49')],'destconnectedlinenum':_0x4465f7[_0x58bf('0x4e')]});}}}}}}}catch(_0x53245e){logger[_0x58bf('0x32')](_0x58bf('0x56'),_0x4465f7[_0x58bf('0x3c')],util['inspect'](_0x53245e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x1f')]=function(_0x8e40fe){try{if(this['isNotNull'](_0x8e40fe)){logger[_0x58bf('0x3a')](_0x58bf('0x57'),_0x8e40fe[_0x58bf('0x3c')],util['inspect'](_0x8e40fe,{'showHidden':![],'depth':null}));if(_0x8e40fe[_0x58bf('0x3c')]===_0x8e40fe[_0x58bf('0x3d')]&&_0x8e40fe[_0x58bf('0x4e')]!='h'&&_0x8e40fe['channel']!=_0x58bf('0x4c')){_0x8e40fe[_0x58bf('0x58')]=_0x8e40fe[_0x58bf('0x58')][_0x58bf('0x59')]();_0x8e40fe[_0x58bf('0x5a')]=_0x8e40fe['appdata']&&_0x8e40fe[_0x58bf('0x5b')][_0x58bf('0x5c')](_0x58bf('0x5d'))?_0x8e40fe[_0x58bf('0x5b')]:(_0x8e40fe[_0x58bf('0x5b')]||_0x8e40fe['applicationdata'])[_0x58bf('0x59')]();logger['info'](_0x58bf('0x5e'),_0x8e40fe[_0x58bf('0x3c')],_0x8e40fe['application'],_0x8e40fe[_0x58bf('0x5a')]);if(_[_0x58bf('0x4d')](this['channels'][_0x8e40fe['uniqueid']])){this[_0x58bf('0x1b')][_0x8e40fe['uniqueid']]=new Channel();this['channels'][_0x8e40fe[_0x58bf('0x3c')]][_0x58bf('0x4f')]=_0x8e40fe[_0x58bf('0x5f')]?moment()[_0x58bf('0x60')](moment[_0x58bf('0x5f')](_0x8e40fe[_0x58bf('0x5f')])['seconds'](),_0x58bf('0x61'))[_0x58bf('0x46')](_0x58bf('0x50')):moment()[_0x58bf('0x46')](_0x58bf('0x50'));this['channels'][_0x8e40fe[_0x58bf('0x3c')]]['disposition']=_0x58bf('0x17');}_['merge'](this['channels'][_0x8e40fe[_0x58bf('0x3c')]],_[_0x58bf('0x3f')](_0x8e40fe,_[_0x58bf('0x40')](this[_0x58bf('0x1b')][_0x8e40fe[_0x58bf('0x3c')]])));if(_[_0x58bf('0x62')](applications,_0x8e40fe['application'])){this[_0x58bf('0x1b')][_0x8e40fe[_0x58bf('0x3c')]][_0x58bf('0x63')]=_0x8e40fe[_0x58bf('0x58')];this[_0x58bf('0x1b')][_0x8e40fe[_0x58bf('0x3c')]][_0x58bf('0x64')]=_0x8e40fe[_0x58bf('0x5a')];if(_0x8e40fe['application']===_0x58bf('0x12')&&_[_0x58bf('0x5c')](_0x8e40fe[_0x58bf('0x5a')][_0x58bf('0x59')](),_0x58bf('0x65'))){var _0x453ada=_0x8e40fe['applicationdata']['split']('=');var _0x33c47f=_0x453ada[0x0][_0x58bf('0x59')]()[_0x58bf('0x66')](/cdr\((.*)\)/);if(_0x33c47f){this[_0x58bf('0x1b')][_0x8e40fe[_0x58bf('0x3c')]][_0x33c47f[0x1]]=_0x453ada[0x1];}}else if(_0x8e40fe['application']==='queue'){this[_0x58bf('0x1b')][_0x8e40fe[_0x58bf('0x3c')]][_0x58bf('0x13')]=_0x8e40fe[_0x58bf('0x5a')][_0x58bf('0x43')](',')[0x0];}}}}}catch(_0x2deeca){logger[_0x58bf('0x32')](_0x58bf('0x67'),_0x8e40fe[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x2deeca,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x58bf('0x68')]=function(_0x22060b){try{if(this['isNotNull'](_0x22060b)){logger[_0x58bf('0x30')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x22060b[_0x58bf('0x3c')],_0x22060b[_0x58bf('0x3d')],_0x22060b[_0x58bf('0x38')],_0x22060b['calleridnum']);logger['debug'](_0x58bf('0x69'),_0x22060b[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x22060b,{'showHidden':![],'depth':null}));if(_0x22060b['uniqueid']!==_0x22060b[_0x58bf('0x3d')]){if(this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]]){if(_0x22060b[_0x58bf('0x53')]==='6'){if(!this[_0x58bf('0x1b')][_0x22060b['linkedid']][_0x58bf('0x6a')]){var _0x55092a=moment();this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x6a')]=!![];this[_0x58bf('0x1b')][_0x22060b['linkedid']][_0x58bf('0x6b')]=_0x55092a[_0x58bf('0x46')](_0x58bf('0x50'));if(this['channels'][_0x22060b['linkedid']][_0x58bf('0x4f')]){this[_0x58bf('0x1b')][_0x22060b['linkedid']]['holdtime']=_0x55092a[_0x58bf('0x6c')](this[_0x58bf('0x1b')][_0x22060b['linkedid']][_0x58bf('0x4f')],_0x58bf('0x61'));}}this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x3d')]=_0x22060b[_0x58bf('0x3c')];if(_0x22060b[_0x58bf('0x39')]!==_0x58bf('0x44')){this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x45')]=_0x22060b['calleridnum'];}this[_0x58bf('0x1b')][_0x22060b['linkedid']][_0x58bf('0x6d')]=_0x22060b[_0x58bf('0x38')];this['channels'][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x6e')]=_0x22060b[_0x58bf('0x42')];this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x51')]=dispositions[_[_0x58bf('0x52')](_0x22060b[_0x58bf('0x53')])];if(this[_0x58bf('0x1c')][_0x22060b['channel'][_0x58bf('0x43')]('-')[0x0]]){this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x6f')]=this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['id'];this[_0x58bf('0x1b')][_0x22060b['linkedid']][_0x58bf('0x70')]=this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['name'];}}}}else{if(this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3c')]]){if(_0x22060b[_0x58bf('0x53')]==='6'){if(this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]){this['channels'][_0x22060b[_0x58bf('0x3c')]][_0x58bf('0x6f')]=this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')]['split']('-')[0x0]]['id'];this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3c')]][_0x58bf('0x70')]=this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x47')];}}}}if(_0x22060b[_0x58bf('0x53')]==='6'&&_0x22060b[_0x58bf('0x41')]===_0x58bf('0x54')){if(this['agents'][_0x22060b['channel'][_0x58bf('0x43')]('-')[0x0]]){this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x71')]=_0x22060b[_0x58bf('0x4e')];var _0x5853c4;if(this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3c')]])_0x5853c4=this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3c')]]['routealias'];else if(this['channels'][_0x22060b[_0x58bf('0x3d')]])_0x5853c4=this[_0x58bf('0x1b')][_0x22060b[_0x58bf('0x3d')]][_0x58bf('0x72')];logger['debug'](_0x58bf('0x73'),_0x22060b[_0x58bf('0x3c')],util[_0x58bf('0x33')]({'destaccountcode':this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x49')],'destconnectedlinenum':_0x22060b[_0x58bf('0x4e')],'routealias':_0x5853c4},{'showHidden':![],'depth':null}));this['emit'](util[_0x58bf('0x46')](_0x58bf('0x55'),this[_0x58bf('0x1c')][_0x22060b['channel']['split']('-')[0x0]][_0x58bf('0x47')]),_0x58bf('0x48'),{'destaccountcode':this[_0x58bf('0x1c')][_0x22060b[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x49')],'destconnectedlinenum':_0x22060b[_0x58bf('0x4e')],'routealias':_0x5853c4});}}}}catch(_0x2c1c71){logger[_0x58bf('0x32')](_0x58bf('0x74'),_0x22060b[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x2c1c71,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x75')]=function(_0x14ae93,_0x57abdb){try{if(this[_0x58bf('0x1b')][_0x14ae93]){logger[_0x58bf('0x30')](_0x58bf('0x76'),_0x14ae93,_0x57abdb);this[_0x58bf('0x1b')][_0x14ae93]['monitor']=!![];if(_['endsWith'](_0x57abdb,_0x58bf('0x77'))){_0x57abdb=_0x57abdb['replace'](_0x58bf('0x77'),_0x58bf('0x78'));}this[_0x58bf('0x1b')][_0x14ae93]['monitorFilename']=_0x57abdb;var _0x4e2a08=_['find'](this[_0x58bf('0x1b')][_0x14ae93][_0x58bf('0x79')],{'filename':_0x57abdb});if(_[_0x58bf('0x7a')](_0x4e2a08)){this[_0x58bf('0x1b')][_0x14ae93][_0x58bf('0x79')]['push']({'filename':_0x57abdb,'createdAt':moment()[_0x58bf('0x46')](_0x58bf('0x50')),'mixmonitorid':'','status':'rec'});}}}catch(_0x40d5ab){logger[_0x58bf('0x32')]('[%s][voiceCallReport][mixMonitorFilename]',_0x14ae93,util[_0x58bf('0x33')](_0x40d5ab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')]['syncVarSet']=function(_0x1ea95f){try{if(this[_0x58bf('0x35')](_0x1ea95f)){logger[_0x58bf('0x3a')](_0x58bf('0x7b'),_0x1ea95f['uniqueid'],util['inspect'](_0x1ea95f,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ea95f[_0x58bf('0x3c')]]&&_0x1ea95f['channel']!='OutgoingSpoolFailed'){if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')])){if(this[_0x58bf('0x35')](_0x1ea95f['variable']['mixmonitor_filename'])){logger[_0x58bf('0x30')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f['value']);this['syncMixMonitorFilename'](_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);}else if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x7e')])){logger[_0x58bf('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]][_0x58bf('0x39')]=_0x1ea95f[_0x58bf('0x7d')];}else if(this['isNotNull'](_0x1ea95f[_0x58bf('0x7c')]['xmd-callerid'])){logger[_0x58bf('0x30')](_0x58bf('0x7f'),_0x1ea95f['uniqueid'],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]][_0x58bf('0x80')]=_0x1ea95f[_0x58bf('0x7d')];}else if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x81')])){logger[_0x58bf('0x30')](_0x58bf('0x82'),_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]][_0x58bf('0x83')]=_0x1ea95f[_0x58bf('0x7d')];}else if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x84')])){logger[_0x58bf('0x30')](_0x58bf('0x85'),_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f['value'][_0x58bf('0x43')](',')[0x0]);this[_0x58bf('0x1b')][_0x1ea95f['uniqueid']][_0x58bf('0x13')]=_0x1ea95f['value']['split'](',')[0x0];}else if(this['isNotNull'](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x86')])){logger[_0x58bf('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]][_0x58bf('0x87')]=_0x1ea95f[_0x58bf('0x7d')];}else if(this['isNotNull'](_0x1ea95f[_0x58bf('0x7c')]['xmd-destination'])){logger[_0x58bf('0x30')](_0x58bf('0x88'),_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]]['destination']=_0x1ea95f[_0x58bf('0x7d')];}else if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')]['xmd-callerid-preview'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x1ea95f['uniqueid'],_0x1ea95f[_0x58bf('0x7d')]);this['channels'][_0x1ea95f[_0x58bf('0x3c')]][_0x58bf('0x89')]=_0x1ea95f[_0x58bf('0x7d')];}else if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x8a')])){logger[_0x58bf('0x30')](_0x58bf('0x8b'),_0x1ea95f[_0x58bf('0x3c')],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3c')]]['queue']=_0x1ea95f[_0x58bf('0x7d')];}else if(this['isNotNull'](_0x1ea95f[_0x58bf('0x7c')][_0x58bf('0x8c')])){logger['info'](_0x58bf('0x8d'),_0x1ea95f['uniqueid'],_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x1b')][_0x1ea95f['uniqueid']][_0x58bf('0x8e')]=_0x1ea95f[_0x58bf('0x7d')];}}}else if(this[_0x58bf('0x35')](_0x1ea95f['variable'][_0x58bf('0x8f')])){if(_0x1ea95f[_0x58bf('0x7d')]){var _0x32d8b4=path[_0x58bf('0x90')](_0x1ea95f['value'])[_0x58bf('0x47')];logger[_0x58bf('0x30')](_0x58bf('0x91'),_0x32d8b4,_0x1ea95f[_0x58bf('0x7d')]);this[_0x58bf('0x75')](_0x32d8b4,_0x1ea95f[_0x58bf('0x7d')]);}}else if(this[_0x58bf('0x1b')][_0x1ea95f[_0x58bf('0x3d')]]){if(this[_0x58bf('0x35')](_0x1ea95f[_0x58bf('0x7c')])){if(this[_0x58bf('0x35')](_0x1ea95f['variable'][_0x58bf('0x8c')])){logger['info'](_0x58bf('0x8d'),_0x1ea95f[_0x58bf('0x3d')],_0x1ea95f[_0x58bf('0x7d')]);this['channels'][_0x1ea95f['linkedid']][_0x58bf('0x92')]=_0x1ea95f[_0x58bf('0x7d')];}}}}}catch(_0x495843){logger['error'](_0x58bf('0x93'),_0x1ea95f[_0x58bf('0x3c')],util['inspect'](_0x495843,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x26')]=function(_0x32269f){try{if(this[_0x58bf('0x35')](_0x32269f)){logger['debug'](_0x58bf('0x94'),_0x32269f[_0x58bf('0x3c')],util['inspect'](_0x32269f,{'showHidden':![],'depth':null}));if(this['channels'][_0x32269f['uniqueid']]){logger[_0x58bf('0x30')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x32269f[_0x58bf('0x3c')],_0x32269f[_0x58bf('0x95')]);var _0x361967=moment();this[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]['endtime']=_0x361967[_0x58bf('0x46')](_0x58bf('0x50'));this[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]][_0x58bf('0x5f')]=_0x361967[_0x58bf('0x6c')](this['channels'][_0x32269f['uniqueid']]['starttime'],'seconds');if(this['channels'][_0x32269f[_0x58bf('0x3c')]][_0x58bf('0x6a')]){this[_0x58bf('0x1b')][_0x32269f['uniqueid']][_0x58bf('0x96')]=_0x361967[_0x58bf('0x6c')](this[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]][_0x58bf('0x6b')],_0x58bf('0x61'));this['channels'][_0x32269f[_0x58bf('0x3c')]]['holdtime']=this[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]][_0x58bf('0x5f')]-this[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]['billableseconds'];}if(_0x32269f[_0x58bf('0x41')]===_0x58bf('0x54')){if(this[_0x58bf('0x1c')][_0x32269f[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]){this[_0x58bf('0x1c')][_0x32269f[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]=_[_0x58bf('0x97')](this['agents'][_0x32269f[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]],['destconnectedlinenum']);logger[_0x58bf('0x3a')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x32269f['uniqueid'],util[_0x58bf('0x33')]({'id':this[_0x58bf('0x1c')][_0x32269f[_0x58bf('0x42')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x32269f[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x58bf('0x36')](util[_0x58bf('0x46')](_0x58bf('0x55'),this[_0x58bf('0x1c')][_0x32269f['channel'][_0x58bf('0x43')]('-')[0x0]][_0x58bf('0x47')]),_0x58bf('0x98'),{'id':this[_0x58bf('0x1c')][_0x32269f[_0x58bf('0x42')][_0x58bf('0x43')]('-')[0x0]]['id'],'destaccountcode':this[_0x58bf('0x1c')][_0x32269f[_0x58bf('0x42')]['split']('-')[0x0]][_0x58bf('0x49')]});}}var _0x5518f7=this;Promise[_0x58bf('0x99')]()[_0x58bf('0x9a')](function(){var _0x550f62=_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]];if(typeof _0x550f62[_0x58bf('0x9b')]===_0x58bf('0x9c'))return;if(_['isEmpty'](_0x550f62[_0x58bf('0x79')]))return;return RpcSetting[_0x58bf('0x9d')]()[_0x58bf('0x9a')](function(_0x5451f6){if(!_0x5451f6[_0x58bf('0x9e')])return;return Promise[_0x58bf('0x99')]()[_0x58bf('0x9a')](function(){return ami[_0x58bf('0x9f')]({'action':_0x58bf('0xa0'),'channel':_0x550f62[_0x58bf('0x42')]})['catch'](function(){});})[_0x58bf('0x9a')](function(){return ami[_0x58bf('0x9f')]({'action':_0x58bf('0xa0'),'channel':_0x550f62[_0x58bf('0x6e')]})['catch'](function(){})['finally'](function(){var _0x220e28=_0x5518f7[_0x58bf('0x1c')][_0x550f62[_0x58bf('0x6e')][_0x58bf('0x43')]('-')[0x0]];if(!_0x220e28)return;io[_0x58bf('0x36')](_0x58bf('0xa1'),{'agentId':_0x220e28['id'],'uniqueid':_0x550f62[_0x58bf('0x3c')]});});});});})['then'](function(){if(_0x32269f['event']===_0x58bf('0xa2')){_0x5518f7[_0x58bf('0x1d')][_0x32269f[_0x58bf('0x3c')]]=_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]];}else{if(_0x5518f7['channels'][_0x32269f['uniqueid']][_0x58bf('0x83')]===_0x58bf('0xa3')&&_0x5518f7[_0x58bf('0x1d')][_0x32269f['uniqueid']]){_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]['uniqueid']=[_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]['linkedid'],_0x5518f7['channels'][_0x32269f[_0x58bf('0x3c')]][_0x58bf('0x3d')]=_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]['uniqueid']][0x0];delete _0x5518f7['blindTransfers'][_0x32269f[_0x58bf('0x3c')]];}}logger[_0x58bf('0x3a')](_0x58bf('0xa4'),_0x32269f[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]],{'showHidden':![],'depth':null}));ami[_0x58bf('0x36')]('custom:voiceCallReport',_0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]]);delete _0x5518f7[_0x58bf('0x1b')][_0x32269f[_0x58bf('0x3c')]];});}}}catch(_0x5a0ed3){logger[_0x58bf('0x32')](_0x58bf('0xa5'),_0x32269f[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x5a0ed3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')]['syncAttendedTransfer']=function(_0x4cfc58){try{if(this['isNotNull'](_0x4cfc58)){logger[_0x58bf('0x30')](_0x58bf('0xa6'),_0x4cfc58[_0x58bf('0x3c')],_0x4cfc58[_0x58bf('0xa7')],_0x4cfc58[_0x58bf('0xa8')]);logger['debug'](_0x58bf('0xa9'),_0x4cfc58[_0x58bf('0x3c')],util['inspect'](_0x4cfc58,{'showHidden':![],'depth':null}));if(this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaa')]]){this['channels'][_0x4cfc58[_0x58bf('0xaa')]][_0x58bf('0xab')]=_0x4cfc58['origtransferercalleridnum'];this[_0x58bf('0x1b')][_0x4cfc58['transfereeuniqueid']][_0x58bf('0xac')]=_0x4cfc58[_0x58bf('0xa8')];if(this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xad')]]){var _0x4d63c8=this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xad')]];this['channels'][_0x4cfc58[_0x58bf('0xad')]]=this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaa')]];this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaa')]]=_0x4d63c8;}}else if(this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xae')]]){this[_0x58bf('0x1b')][_0x4cfc58['transfertargetuniqueid']][_0x58bf('0xab')]=_0x4cfc58[_0x58bf('0xa7')];this[_0x58bf('0x1b')][_0x4cfc58['transfertargetuniqueid']][_0x58bf('0xac')]=_0x4cfc58[_0x58bf('0xa8')];if(this[_0x58bf('0x1b')][_0x4cfc58['origtransfereruniqueid']]){var _0x4d63c8=this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaf')]];this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaf')]]=this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xae')]];this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xae')]]=_0x4d63c8;}}if((this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaf')]]||this[_0x58bf('0x1b')][_0x4cfc58['origtransfererlinkedid']])&&this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xad')]]){var _0xd1c60f=_[_0x58bf('0xb0')]([this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaf')]],this['channels'][_0x4cfc58[_0x58bf('0xb1')]],this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xad')]]],function(_0x4ac0b9){return _0x4ac0b9&&_0x4ac0b9[_0x58bf('0x83')]===_0x58bf('0xa3')&&_0x4ac0b9[_0x58bf('0xb2')];});if(_0xd1c60f){if(this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xaf')]])this['channels'][_0x4cfc58[_0x58bf('0xaf')]]['transferType']=_0x58bf('0xb3');if(this[_0x58bf('0x1b')][_0x4cfc58[_0x58bf('0xb1')]])this['channels'][_0x4cfc58[_0x58bf('0xb1')]][_0x58bf('0x9b')]='ATTENDED';this['channels'][_0x4cfc58[_0x58bf('0xad')]][_0x58bf('0x9b')]=_0x58bf('0xb3');}}}}catch(_0x2b6c24){logger['error'](_0x58bf('0xb4'),_0x4cfc58[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x2b6c24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')][_0x58bf('0x2c')]=function(_0x369e01){try{if(this[_0x58bf('0x35')](_0x369e01)){logger[_0x58bf('0x30')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x369e01[_0x58bf('0x3c')],_0x369e01[_0x58bf('0xb5')],_0x369e01[_0x58bf('0xb6')]);logger['debug'](_0x58bf('0xb7'),_0x369e01[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x369e01,{'showHidden':![],'depth':null}));if(this[_0x58bf('0x1b')][_0x369e01[_0x58bf('0xaa')]]){this[_0x58bf('0x1b')][_0x369e01[_0x58bf('0xaa')]]['transfercalleridnum']=_0x369e01[_0x58bf('0xb5')];this['channels'][_0x369e01['transfereeuniqueid']]['transferconnectedlinenum']=_0x369e01[_0x58bf('0xb6')];this[_0x58bf('0x1b')][_0x369e01[_0x58bf('0xaa')]][_0x58bf('0x9b')]='BLIND';this[_0x58bf('0x26')]({'event':_0x58bf('0xa2'),'uniqueid':_0x369e01['transfereeuniqueid'],'context':_0x369e01['context'],'channel':_0x369e01[_0x58bf('0xb8')]});}else{this[_0x58bf('0x1b')][_0x369e01[_0x58bf('0xb9')]]['transferType']=_0x58bf('0xba');}}}catch(_0x8dbb9a){logger['error'](_0x58bf('0xbb'),_0x369e01[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x8dbb9a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x58bf('0xbc')]=function(_0x1d8b4e){try{if(this[_0x58bf('0x35')](_0x1d8b4e)){logger[_0x58bf('0x3a')](_0x58bf('0xbd'),_0x1d8b4e[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x1d8b4e,{'showHidden':![],'depth':null}));if(this[_0x58bf('0x1b')][_0x1d8b4e[_0x58bf('0x3c')]]){if(!_[_0x58bf('0x7a')](this[_0x58bf('0x1b')][_0x1d8b4e[_0x58bf('0x3c')]][_0x58bf('0x6b')])){this[_0x58bf('0x1b')][_0x1d8b4e['uniqueid']][_0x58bf('0xbe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x58bf('0x30')](_0x58bf('0xbf'),_0x1d8b4e[_0x58bf('0x3c')],this['channels'][_0x1d8b4e[_0x58bf('0x3c')]][_0x58bf('0xbe')]);}}}}catch(_0x465c09){logger[_0x58bf('0x32')](_0x58bf('0xc0'),_0x1d8b4e[_0x58bf('0x3c')],util[_0x58bf('0x33')](_0x465c09,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x58bf('0x34')]['syncMusicOnHoldStop']=function(_0x3db6da){try{if(this['isNotNull'](_0x3db6da)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x3db6da['uniqueid'],util[_0x58bf('0x33')](_0x3db6da,{'showHidden':![],'depth':null}));if(this[_0x58bf('0x1b')][_0x3db6da['uniqueid']]){if(!_[_0x58bf('0x7a')](this[_0x58bf('0x1b')][_0x3db6da[_0x58bf('0x3c')]][_0x58bf('0xbe')])){this[_0x58bf('0x1b')][_0x3db6da['uniqueid']]['mohtime']+=moment()[_0x58bf('0xc1')](0x0)['diff'](this[_0x58bf('0x1b')][_0x3db6da[_0x58bf('0x3c')]][_0x58bf('0xbe')],_0x58bf('0x61'));logger['info'](_0x58bf('0xc2'),_0x3db6da[_0x58bf('0x3c')],this['channels'][_0x3db6da['uniqueid']][_0x58bf('0xc3')]);delete this[_0x58bf('0x1b')][_0x3db6da[_0x58bf('0x3c')]]['mohstarttime'];}}}}catch(_0x59effd){logger[_0x58bf('0x32')]('[%s][voiceCallReport][musiconholdstop]',_0x3db6da[_0x58bf('0x3c')],util['inspect'](_0x59effd,{'showHidden':![],'depth':null}));}};module[_0x58bf('0xc4')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index aeece4b..99b5d15 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf29d=['lastevent','complete','total','holdtime','diff','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','outbound','applications','variables','syncDialBegin','syncDialEnd','bind','varset','newexten','syncNewExten','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','YYYY-MM-DD\x20HH:mm:ss','substring','lastIndexOf','channel','omit','event','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','merge','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','value','variable','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','duration','starttime','seconds'];(function(_0x26181b,_0x340659){var _0x1a1eb5=function(_0x1d2119){while(--_0x1d2119){_0x26181b['push'](_0x26181b['shift']());}};_0x1a1eb5(++_0x340659);}(_0xf29d,0x109));var _0xdf29=function(_0xe6f164,_0xc47bea){_0xe6f164=_0xe6f164-0x0;var _0x37f530=_0xf29d[_0xe6f164];return _0x37f530;};'use strict';var _=require(_0xdf29('0x0'));var moment=require(_0xdf29('0x1'));var util=require(_0xdf29('0x2'));var Redis=require(_0xdf29('0x3'));var config=require(_0xdf29('0x4'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0xdf29('0x5')]=_[_0xdf29('0x6')](config[_0xdf29('0x5')],{'host':_0xdf29('0x7'),'port':0x18eb});var io=require(_0xdf29('0x8'))(new Redis(config[_0xdf29('0x5')]));function VoiceDialReport(_0x5cd92a){this['channels']=_0x5cd92a['outboundChannels'];this[_0xdf29('0x9')]=_0x5cd92a[_0xdf29('0x9')];this[_0xdf29('0xa')]={};this[_0xdf29('0xb')]={};ami['on']('dialbegin',this[_0xdf29('0xc')]['bind'](this));ami['on']('dialend',this[_0xdf29('0xd')][_0xdf29('0xe')](this));ami['on'](_0xdf29('0xf'),this['syncVarSet'][_0xdf29('0xe')](this));ami['on'](_0xdf29('0x10'),this[_0xdf29('0x11')][_0xdf29('0xe')](this));ami['on']('hangup',this[_0xdf29('0x12')]['bind'](this));}VoiceDialReport[_0xdf29('0x13')][_0xdf29('0x14')]=function(_0x2e8809){return _0x2e8809!==null&&!_[_0xdf29('0x15')](_0x2e8809);};VoiceDialReport['prototype']['emit']=function(_0x5f06a3,_0x17feec,_0x5a91c5){io['to'](_0x5f06a3)[_0xdf29('0x16')](_0x17feec,_0x5a91c5);};VoiceDialReport[_0xdf29('0x13')][_0xdf29('0xc')]=function(_0x439477){try{if(this[_0xdf29('0x14')](_0x439477)){logger[_0xdf29('0x17')](_0xdf29('0x18'),_0x439477[_0xdf29('0x19')],util[_0xdf29('0x1a')](_0x439477,{'showHidden':![],'depth':null}));if(this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]]){_['merge'](this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]],{'starttime':moment()['format'](_0xdf29('0x1c')),'lastevent':'called','interface':_0x439477['channel'][_0xdf29('0x1d')](0x0,_0x439477['channel'][_0xdf29('0x1e')]('-')),'membername':_0x439477['channel']['substring'](_0x439477[_0xdf29('0x1f')]['lastIndexOf']('/')+0x1,_0x439477[_0xdf29('0x1f')][_0xdf29('0x1e')]('-'))},_[_0xdf29('0x20')](_0x439477,[_0xdf29('0x21'),'privilege']));logger[_0xdf29('0x22')](_0xdf29('0x23'),_0x439477[_0xdf29('0x19')],this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]]['membername'],this[_0xdf29('0x1b')][_0x439477['uniqueid']][_0xdf29('0x24')]);logger['debug']('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x439477['uniqueid'],util[_0xdf29('0x1a')](this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));if(this[_0xdf29('0xa')][_0x439477[_0xdf29('0x19')]])_[_0xdf29('0x25')](this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]],this[_0xdf29('0xa')][_0x439477[_0xdf29('0x19')]]);this[_0xdf29('0x16')](_0xdf29('0x26'),_0xdf29('0x27'),this['channels'][_0x439477[_0xdf29('0x19')]]);logger[_0xdf29('0x17')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x439477[_0xdf29('0x19')],util[_0xdf29('0x1a')](this['channels'][_0x439477[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));ami[_0xdf29('0x16')](_0xdf29('0x28'),this[_0xdf29('0x1b')][_0x439477[_0xdf29('0x19')]]);}}}catch(_0x2ab014){logger[_0xdf29('0x29')](_0xdf29('0x2a'),_0x439477[_0xdf29('0x19')],util[_0xdf29('0x1a')](_0x2ab014,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdf29('0x13')][_0xdf29('0xd')]=function(_0x55e81f){try{if(this[_0xdf29('0x14')](_0x55e81f)){logger[_0xdf29('0x17')](_0xdf29('0x2b'),_0x55e81f[_0xdf29('0x19')],util['inspect'](_0x55e81f,{'showHidden':![],'depth':null}));if(this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]){this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]['dialstatus']=_0x55e81f[_0xdf29('0x2c')];if(_0x55e81f[_0xdf29('0x2c')]===_0xdf29('0x2d')){this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]['connectedlinenum']=_0x55e81f[_0xdf29('0x2e')];this[_0xdf29('0x1b')][_0x55e81f['uniqueid']][_0xdf29('0x2f')]=_0x55e81f['connectedlinename'];this['channels'][_0x55e81f['uniqueid']][_0xdf29('0x30')]=moment()[_0xdf29('0x31')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]['lastevent']=_0xdf29('0x32');logger[_0xdf29('0x22')](_0xdf29('0x33'),_0x55e81f[_0xdf29('0x19')],_0x55e81f[_0xdf29('0x1f')][_0xdf29('0x1d')](_0x55e81f[_0xdf29('0x1f')]['lastIndexOf']('/')+0x1,_0x55e81f['channel'][_0xdf29('0x1e')]('-')));logger[_0xdf29('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x55e81f[_0xdf29('0x19')],util['inspect'](this['channels'][_0x55e81f[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));ami[_0xdf29('0x16')](_0xdf29('0x34'),this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]);}logger[_0xdf29('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x55e81f[_0xdf29('0x19')],util[_0xdf29('0x1a')](this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));this[_0xdf29('0x16')](_0xdf29('0x26'),_0xdf29('0x27'),this[_0xdf29('0x1b')][_0x55e81f[_0xdf29('0x19')]]);}}}catch(_0x2569ca){logger['error'](_0xdf29('0x35'),_0x55e81f['uniqueid'],util['inspect'](_0x2569ca,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdf29('0x13')][_0xdf29('0x36')]=function(_0x248705){try{if(this['isNotNull'](_0x248705)){logger[_0xdf29('0x17')](_0xdf29('0x37'),_0x248705['uniqueid'],util[_0xdf29('0x1a')](_0x248705,{'showHidden':![],'depth':null}));this['addVariable'](_0x248705['uniqueid'],_[_0xdf29('0x38')](_0x248705['variable'])[0x0],_0x248705[_0xdf29('0x39')]);if(this[_0xdf29('0x14')](_0x248705[_0xdf29('0x3a')])&&this[_0xdf29('0x14')](_0x248705[_0xdf29('0x3a')][_0xdf29('0x3b')])){if(_['isUndefined'](this[_0xdf29('0x1b')][_0x248705[_0xdf29('0x19')]])){this['channels'][_0x248705['uniqueid']]={'routeId':_0x248705['value'],'variables':this[_0xdf29('0xb')][_0x248705[_0xdf29('0x19')]],'motionChannel':'voice'};logger['info'](_0xdf29('0x3c'),_0x248705[_0xdf29('0x19')],_0x248705[_0xdf29('0x3a')][_0xdf29('0x3b')],_[_0xdf29('0x38')](_0x248705[_0xdf29('0x3a')])[0x0],_0x248705[_0xdf29('0x39')]);logger[_0xdf29('0x17')](_0xdf29('0x3d'),_0x248705[_0xdf29('0x19')],util[_0xdf29('0x1a')](this[_0xdf29('0x1b')][_0x248705['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xdf29('0x26'),_0xdf29('0x27'),this[_0xdf29('0x1b')][_0x248705['uniqueid']]);}}}}catch(_0x3f0ec9){logger[_0xdf29('0x29')](_0xdf29('0x3e'),_0x248705[_0xdf29('0x19')],util[_0xdf29('0x1a')](_0x3f0ec9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdf29('0x13')][_0xdf29('0x3f')]=function(_0x13f143,_0x5dfd1f,_0x5959e5){var _0x45d679=[_0xdf29('0x40'),_0xdf29('0x41'),_0xdf29('0x42'),_0xdf29('0x43'),_0xdf29('0x44'),'rtpaudioqoslossbridged',_0xdf29('0x45'),_0xdf29('0x46'),'sipcallid',_0xdf29('0x47'),_0xdf29('0x48'),_0xdf29('0x49'),'membercalls',_0xdf29('0x4a'),_0xdf29('0x4b'),_0xdf29('0x4c'),_0xdf29('0x4d'),_0xdf29('0x4e'),'memberrealtime'];if(!_[_0xdf29('0x4f')](_0x5dfd1f)&&!_[_0xdf29('0x50')](_0x45d679,_0x5dfd1f)){if(_[_0xdf29('0x15')](this[_0xdf29('0xb')][_0x13f143])){this[_0xdf29('0xb')][_0x13f143]={};}this['variables'][_0x13f143][_0x5dfd1f]=_0x5959e5;}};VoiceDialReport[_0xdf29('0x13')][_0xdf29('0x12')]=function(_0x4e1b85){try{if(this[_0xdf29('0x14')](_0x4e1b85)){logger[_0xdf29('0x17')](_0xdf29('0x51'),_0x4e1b85['uniqueid'],util[_0xdf29('0x1a')](_0x4e1b85,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e1b85[_0xdf29('0x19')]]){logger[_0xdf29('0x22')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x4e1b85[_0xdf29('0x19')],_0x4e1b85['cause-txt']);this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x52')]=moment()[_0xdf29('0x31')](_0xdf29('0x1c'));this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']][_0xdf29('0x53')]=moment(this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x52')])['diff'](this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x54')],_0xdf29('0x55'));this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x56')]=_0xdf29('0x57');this[_0xdf29('0x9')][_0xdf29('0x58')]+=0x1;if(this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]]['answertime']){this['outbound']['answered']+=0x1;this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x59')]=moment(this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x30')])[_0xdf29('0x5a')](this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']][_0xdf29('0x54')],_0xdf29('0x55'));this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]][_0xdf29('0x5b')]=moment(this['channels'][_0x4e1b85['uniqueid']]['endtime'])['diff'](this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]]['answertime'],_0xdf29('0x55'));this[_0xdf29('0x9')][_0xdf29('0x5c')]+=this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']][_0xdf29('0x59')]||0x0;this[_0xdf29('0x9')][_0xdf29('0x5d')]+=this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']][_0xdf29('0x5b')];}this[_0xdf29('0x9')][_0xdf29('0x5e')]+=this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']][_0xdf29('0x53')];logger[_0xdf29('0x17')](_0xdf29('0x5f'),_0x4e1b85[_0xdf29('0x19')],util[_0xdf29('0x1a')](this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xdf29('0x60'),this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]]);logger[_0xdf29('0x17')](_0xdf29('0x61'),_0x4e1b85[_0xdf29('0x19')],util['inspect'](this['channels'][_0x4e1b85[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));ami[_0xdf29('0x16')](_0xdf29('0x62'),this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']]);logger[_0xdf29('0x17')](_0xdf29('0x63'),_0x4e1b85[_0xdf29('0x19')],util[_0xdf29('0x1a')](this[_0xdf29('0x1b')][_0x4e1b85['uniqueid']],{'showHidden':![],'depth':null}));this[_0xdf29('0x16')](_0xdf29('0x26'),_0xdf29('0x64'),this[_0xdf29('0x9')]);logger['info'](_0xdf29('0x65'),JSON['stringify'](this['channels'][_0x4e1b85[_0xdf29('0x19')]]));logger[_0xdf29('0x17')](_0xdf29('0x66'),_0x4e1b85[_0xdf29('0x19')],util[_0xdf29('0x1a')](this['channels'][_0x4e1b85[_0xdf29('0x19')]],{'showHidden':![],'depth':null}));this[_0xdf29('0x16')](_0xdf29('0x26'),_0xdf29('0x67'),this['channels'][_0x4e1b85[_0xdf29('0x19')]]);delete this[_0xdf29('0x1b')][_0x4e1b85[_0xdf29('0x19')]];}else if(this['channels'][_0x4e1b85[_0xdf29('0x68')]]){this[_0xdf29('0x1b')][_0x4e1b85['linkedid']][_0xdf29('0x19')]=this['channels'][_0x4e1b85[_0xdf29('0x68')]][_0xdf29('0x69')];}if(this[_0xdf29('0xb')][_0x4e1b85[_0xdf29('0x19')]]){delete this['variables'][_0x4e1b85[_0xdf29('0x19')]];}}}catch(_0x1056fc){logger[_0xdf29('0x29')]('[%s][voiceDialReport][hangup]',_0x4e1b85[_0xdf29('0x19')],util['inspect'](_0x1056fc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdf29('0x13')]['syncNewExten']=function(_0x10a209){try{if(this[_0xdf29('0x14')](_0x10a209)){logger[_0xdf29('0x17')](_0xdf29('0x6a'),_0x10a209[_0xdf29('0x19')],util[_0xdf29('0x1a')](_0x10a209,{'showHidden':![],'depth':null}));if(_0x10a209[_0xdf29('0x6b')][_0xdf29('0x6c')]()===_0xdf29('0x6d')){_0x10a209[_0xdf29('0x6e')]=(_0x10a209[_0xdf29('0x6f')]||_0x10a209[_0xdf29('0x6e')])[_0xdf29('0x6c')]();if(_[_0xdf29('0x70')](_0x10a209[_0xdf29('0x6e')],'cdr(')){if(_['isUndefined'](this[_0xdf29('0xa')][_0x10a209[_0xdf29('0x19')]]))this[_0xdf29('0xa')][_0x10a209[_0xdf29('0x19')]]={};logger[_0xdf29('0x22')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x10a209['uniqueid'],_0x10a209[_0xdf29('0x6b')],_0x10a209[_0xdf29('0x6e')]);var _0x3bae69=_0x10a209[_0xdf29('0x6e')][_0xdf29('0x71')]('=');var _0x519720=_0x3bae69[0x0][_0xdf29('0x72')](/cdr\((.*)\)/);if(_0x519720)this[_0xdf29('0xa')][_0x10a209[_0xdf29('0x19')]][_0x519720[0x1]]=_0x3bae69[0x1];}}}}catch(_0x22bab9){logger[_0xdf29('0x29')](_0xdf29('0x73'),_0x10a209['uniqueid'],util[_0xdf29('0x1a')](_0x22bab9,{'showHidden':![],'depth':null}));}};module[_0xdf29('0x74')]=VoiceDialReport; \ No newline at end of file +var _0x0d06=['dialstatus','ANSWER','connectedlinenum','connectedlinename','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','keys','value','variable','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','isUndefined','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','starttime','complete','total','answered','holdtime','answertime','diff','seconds','billableseconds','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','linkedid','destuniqueid','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','syncDialEnd','bind','newexten','syncNewExten','syncHangup','prototype','isNotNull','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','called','substring','lastIndexOf','channel','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:'];(function(_0xe95469,_0x48d56b){var _0x28dd82=function(_0x811dcc){while(--_0x811dcc){_0xe95469['push'](_0xe95469['shift']());}};_0x28dd82(++_0x48d56b);}(_0x0d06,0xb1));var _0x60d0=function(_0x2aa788,_0x498eb8){_0x2aa788=_0x2aa788-0x0;var _0x5be967=_0x0d06[_0x2aa788];return _0x5be967;};'use strict';var _=require(_0x60d0('0x0'));var moment=require(_0x60d0('0x1'));var util=require(_0x60d0('0x2'));var Redis=require('ioredis');var config=require(_0x60d0('0x3'));var logger=require(_0x60d0('0x4'))(_0x60d0('0x5'));var ami=require(_0x60d0('0x6'));config[_0x60d0('0x7')]=_['defaults'](config[_0x60d0('0x7')],{'host':_0x60d0('0x8'),'port':0x18eb});var io=require(_0x60d0('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x36a5f3){this[_0x60d0('0xa')]=_0x36a5f3[_0x60d0('0xb')];this[_0x60d0('0xc')]=_0x36a5f3[_0x60d0('0xc')];this[_0x60d0('0xd')]={};this[_0x60d0('0xe')]={};ami['on']('dialbegin',this[_0x60d0('0xf')]['bind'](this));ami['on']('dialend',this[_0x60d0('0x10')][_0x60d0('0x11')](this));ami['on']('varset',this['syncVarSet'][_0x60d0('0x11')](this));ami['on'](_0x60d0('0x12'),this[_0x60d0('0x13')][_0x60d0('0x11')](this));ami['on']('hangup',this[_0x60d0('0x14')][_0x60d0('0x11')](this));}VoiceDialReport[_0x60d0('0x15')][_0x60d0('0x16')]=function(_0xe66956){return _0xe66956!==null&&!_['isUndefined'](_0xe66956);};VoiceDialReport[_0x60d0('0x15')]['emit']=function(_0x309bf5,_0x3e26f1,_0x22fcfe){io['to'](_0x309bf5)[_0x60d0('0x17')](_0x3e26f1,_0x22fcfe);};VoiceDialReport[_0x60d0('0x15')][_0x60d0('0xf')]=function(_0x71ce36){try{if(this[_0x60d0('0x16')](_0x71ce36)){logger[_0x60d0('0x18')](_0x60d0('0x19'),_0x71ce36[_0x60d0('0x1a')],util['inspect'](_0x71ce36,{'showHidden':![],'depth':null}));if(this[_0x60d0('0xa')][_0x71ce36[_0x60d0('0x1a')]]){_[_0x60d0('0x1b')](this['channels'][_0x71ce36[_0x60d0('0x1a')]],{'starttime':moment()[_0x60d0('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x60d0('0x1d'),'interface':_0x71ce36['channel'][_0x60d0('0x1e')](0x0,_0x71ce36['channel'][_0x60d0('0x1f')]('-')),'membername':_0x71ce36[_0x60d0('0x20')][_0x60d0('0x1e')](_0x71ce36[_0x60d0('0x20')][_0x60d0('0x1f')]('/')+0x1,_0x71ce36['channel'][_0x60d0('0x1f')]('-'))},_[_0x60d0('0x21')](_0x71ce36,['event','privilege']));logger[_0x60d0('0x22')](_0x60d0('0x23'),_0x71ce36[_0x60d0('0x1a')],this[_0x60d0('0xa')][_0x71ce36['uniqueid']][_0x60d0('0x24')],this[_0x60d0('0xa')][_0x71ce36[_0x60d0('0x1a')]][_0x60d0('0x25')]);logger[_0x60d0('0x18')](_0x60d0('0x26'),_0x71ce36[_0x60d0('0x1a')],util[_0x60d0('0x27')](this['channels'][_0x71ce36[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0x60d0('0xd')][_0x71ce36[_0x60d0('0x1a')]])_[_0x60d0('0x1b')](this[_0x60d0('0xa')][_0x71ce36[_0x60d0('0x1a')]],this[_0x60d0('0xd')][_0x71ce36[_0x60d0('0x1a')]]);this[_0x60d0('0x17')](_0x60d0('0x28'),_0x60d0('0x29'),this[_0x60d0('0xa')][_0x71ce36[_0x60d0('0x1a')]]);logger[_0x60d0('0x18')](_0x60d0('0x2a'),_0x71ce36['uniqueid'],util[_0x60d0('0x27')](this['channels'][_0x71ce36['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x60d0('0x17')](_0x60d0('0x2b'),this[_0x60d0('0xa')][_0x71ce36['uniqueid']]);}}}catch(_0x4710e6){logger[_0x60d0('0x2c')](_0x60d0('0x2d'),_0x71ce36[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x4710e6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x60d0('0x15')][_0x60d0('0x10')]=function(_0x3f5c31){try{if(this['isNotNull'](_0x3f5c31)){logger[_0x60d0('0x18')](_0x60d0('0x2e'),_0x3f5c31[_0x60d0('0x1a')],util['inspect'](_0x3f5c31,{'showHidden':![],'depth':null}));if(this['channels'][_0x3f5c31[_0x60d0('0x1a')]]){this['channels'][_0x3f5c31['uniqueid']][_0x60d0('0x2f')]=_0x3f5c31[_0x60d0('0x2f')];if(_0x3f5c31[_0x60d0('0x2f')]===_0x60d0('0x30')){this[_0x60d0('0xa')][_0x3f5c31['uniqueid']][_0x60d0('0x31')]=_0x3f5c31[_0x60d0('0x31')];this[_0x60d0('0xa')][_0x3f5c31['uniqueid']][_0x60d0('0x32')]=_0x3f5c31[_0x60d0('0x32')];this['channels'][_0x3f5c31[_0x60d0('0x1a')]]['answertime']=moment()[_0x60d0('0x1c')](_0x60d0('0x33'));this[_0x60d0('0xa')][_0x3f5c31[_0x60d0('0x1a')]][_0x60d0('0x34')]=_0x60d0('0x35');logger[_0x60d0('0x22')](_0x60d0('0x36'),_0x3f5c31[_0x60d0('0x1a')],_0x3f5c31[_0x60d0('0x20')][_0x60d0('0x1e')](_0x3f5c31[_0x60d0('0x20')][_0x60d0('0x1f')]('/')+0x1,_0x3f5c31[_0x60d0('0x20')][_0x60d0('0x1f')]('-')));logger[_0x60d0('0x18')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x3f5c31[_0x60d0('0x1a')],util[_0x60d0('0x27')](this['channels'][_0x3f5c31[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x60d0('0x17')](_0x60d0('0x37'),this[_0x60d0('0xa')][_0x3f5c31[_0x60d0('0x1a')]]);}logger[_0x60d0('0x18')](_0x60d0('0x38'),_0x3f5c31[_0x60d0('0x1a')],util[_0x60d0('0x27')](this[_0x60d0('0xa')][_0x3f5c31[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));this[_0x60d0('0x17')](_0x60d0('0x28'),_0x60d0('0x29'),this[_0x60d0('0xa')][_0x3f5c31[_0x60d0('0x1a')]]);}}}catch(_0x1fc45e){logger[_0x60d0('0x2c')](_0x60d0('0x39'),_0x3f5c31[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x1fc45e,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x60d0('0x3a')]=function(_0x363f65){try{if(this[_0x60d0('0x16')](_0x363f65)){logger['debug'](_0x60d0('0x3b'),_0x363f65[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x363f65,{'showHidden':![],'depth':null}));this['addVariable'](_0x363f65[_0x60d0('0x1a')],_[_0x60d0('0x3c')](_0x363f65['variable'])[0x0],_0x363f65[_0x60d0('0x3d')]);if(this[_0x60d0('0x16')](_0x363f65[_0x60d0('0x3e')])&&this['isNotNull'](_0x363f65[_0x60d0('0x3e')][_0x60d0('0x3f')])){if(_['isUndefined'](this[_0x60d0('0xa')][_0x363f65[_0x60d0('0x1a')]])){this[_0x60d0('0xa')][_0x363f65[_0x60d0('0x1a')]]={'routeId':_0x363f65[_0x60d0('0x3d')],'variables':this[_0x60d0('0xe')][_0x363f65[_0x60d0('0x1a')]],'motionChannel':'voice'};logger[_0x60d0('0x22')](_0x60d0('0x40'),_0x363f65[_0x60d0('0x1a')],_0x363f65[_0x60d0('0x3e')][_0x60d0('0x3f')],_[_0x60d0('0x3c')](_0x363f65['variable'])[0x0],_0x363f65[_0x60d0('0x3d')]);logger['debug'](_0x60d0('0x41'),_0x363f65['uniqueid'],util[_0x60d0('0x27')](this['channels'][_0x363f65[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));this[_0x60d0('0x17')](_0x60d0('0x28'),_0x60d0('0x29'),this[_0x60d0('0xa')][_0x363f65[_0x60d0('0x1a')]]);}}}}catch(_0x4ee528){logger[_0x60d0('0x2c')](_0x60d0('0x42'),_0x363f65[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x4ee528,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x60d0('0x15')][_0x60d0('0x43')]=function(_0x1f88de,_0x1588b6,_0x44103c){var _0x44494f=['rtpaudioqos',_0x60d0('0x44'),_0x60d0('0x45'),'rtpaudioqosjitterbridged',_0x60d0('0x46'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x60d0('0x47'),'sipcallid','sipuri',_0x60d0('0x48'),_0x60d0('0x49'),'membercalls',_0x60d0('0x4a'),_0x60d0('0x4b'),_0x60d0('0x4c'),_0x60d0('0x24'),_0x60d0('0x4d'),_0x60d0('0x4e')];if(!_[_0x60d0('0x4f')](_0x1588b6)&&!_['includes'](_0x44494f,_0x1588b6)){if(_[_0x60d0('0x50')](this['variables'][_0x1f88de])){this['variables'][_0x1f88de]={};}this[_0x60d0('0xe')][_0x1f88de][_0x1588b6]=_0x44103c;}};VoiceDialReport['prototype'][_0x60d0('0x14')]=function(_0x1c7349){try{if(this[_0x60d0('0x16')](_0x1c7349)){logger[_0x60d0('0x18')](_0x60d0('0x51'),_0x1c7349[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x1c7349,{'showHidden':![],'depth':null}));if(this['channels'][_0x1c7349[_0x60d0('0x1a')]]){logger[_0x60d0('0x22')](_0x60d0('0x52'),_0x1c7349[_0x60d0('0x1a')],_0x1c7349[_0x60d0('0x53')]);this['channels'][_0x1c7349['uniqueid']]['endtime']=moment()['format'](_0x60d0('0x33'));this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]]['duration']=moment(this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x54')])['diff'](this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x55')],'seconds');this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x34')]=_0x60d0('0x56');this[_0x60d0('0xc')][_0x60d0('0x57')]+=0x1;if(this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]]['answertime']){this[_0x60d0('0xc')][_0x60d0('0x58')]+=0x1;this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x59')]=moment(this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x5a')])[_0x60d0('0x5b')](this[_0x60d0('0xa')][_0x1c7349['uniqueid']][_0x60d0('0x55')],_0x60d0('0x5c'));this['channels'][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x5d')]=moment(this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x54')])['diff'](this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]]['answertime'],'seconds');this[_0x60d0('0xc')][_0x60d0('0x5e')]+=this[_0x60d0('0xa')][_0x1c7349['uniqueid']][_0x60d0('0x59')]||0x0;this[_0x60d0('0xc')][_0x60d0('0x5f')]+=this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]][_0x60d0('0x5d')];}this[_0x60d0('0xc')]['sumDuration']+=this[_0x60d0('0xa')][_0x1c7349['uniqueid']][_0x60d0('0x60')];logger['debug'](_0x60d0('0x61'),_0x1c7349[_0x60d0('0x1a')],util['inspect'](this[_0x60d0('0xa')][_0x1c7349['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x60d0('0x17')](_0x60d0('0x62'),this['channels'][_0x1c7349['uniqueid']]);logger[_0x60d0('0x18')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x1c7349[_0x60d0('0x1a')],util['inspect'](this['channels'][_0x1c7349[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x60d0('0x17')](_0x60d0('0x63'),this['channels'][_0x1c7349['uniqueid']]);logger[_0x60d0('0x18')](_0x60d0('0x64'),_0x1c7349[_0x60d0('0x1a')],util['inspect'](this['channels'][_0x1c7349['uniqueid']],{'showHidden':![],'depth':null}));this[_0x60d0('0x17')](_0x60d0('0x28'),'voice_outbound:save',this['outbound']);logger[_0x60d0('0x22')](_0x60d0('0x65'),JSON['stringify'](this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1c7349[_0x60d0('0x1a')],util['inspect'](this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]],{'showHidden':![],'depth':null}));this[_0x60d0('0x17')]('voice:outbound','voice_outbound_channel:remove',this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x1a')]]);delete this['channels'][_0x1c7349[_0x60d0('0x1a')]];}else if(this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x66')]]){this[_0x60d0('0xa')][_0x1c7349[_0x60d0('0x66')]][_0x60d0('0x1a')]=this['channels'][_0x1c7349['linkedid']][_0x60d0('0x67')];}if(this[_0x60d0('0xe')][_0x1c7349[_0x60d0('0x1a')]]){delete this['variables'][_0x1c7349[_0x60d0('0x1a')]];}}}catch(_0x18e246){logger[_0x60d0('0x2c')]('[%s][voiceDialReport][hangup]',_0x1c7349[_0x60d0('0x1a')],util[_0x60d0('0x27')](_0x18e246,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x60d0('0x13')]=function(_0x3798e4){try{if(this[_0x60d0('0x16')](_0x3798e4)){logger[_0x60d0('0x18')]('[%s][voiceDialReport][newexten]\x20event:',_0x3798e4['uniqueid'],util[_0x60d0('0x27')](_0x3798e4,{'showHidden':![],'depth':null}));if(_0x3798e4['application'][_0x60d0('0x68')]()===_0x60d0('0x69')){_0x3798e4[_0x60d0('0x6a')]=(_0x3798e4[_0x60d0('0x6b')]||_0x3798e4['applicationdata'])[_0x60d0('0x68')]();if(_[_0x60d0('0x6c')](_0x3798e4['applicationdata'],'cdr(')){if(_[_0x60d0('0x50')](this[_0x60d0('0xd')][_0x3798e4['uniqueid']]))this[_0x60d0('0xd')][_0x3798e4['uniqueid']]={};logger[_0x60d0('0x22')](_0x60d0('0x6d'),_0x3798e4[_0x60d0('0x1a')],_0x3798e4[_0x60d0('0x6e')],_0x3798e4[_0x60d0('0x6a')]);var _0x3c3c5a=_0x3798e4['applicationdata'][_0x60d0('0x6f')]('=');var _0x17e564=_0x3c3c5a[0x0]['match'](/cdr\((.*)\)/);if(_0x17e564)this['applications'][_0x3798e4[_0x60d0('0x1a')]][_0x17e564[0x1]]=_0x3c3c5a[0x1];}}}}catch(_0x517d3a){logger[_0x60d0('0x2c')]('[%s][voiceDialReport][newexten]',_0x3798e4[_0x60d0('0x1a')],util['inspect'](_0x517d3a,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index ce76b22..63bf7cc 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x049e=['voice_queue:save','isNotNull','isUndefined','loopQueueShow','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','type','position','count','routealias','merge','pick','keys','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','linkedid','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','syncVarSet','[%s][voiceQueueReport][varset]','variable','value','CONTINUE','varset','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','abandoned','diff','queuecallerjoinAt','seconds','length','sumDuration','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','extension','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','CDR(routeAlias)','startsWith','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','queuecallerabandon','queuecallerleave','agentcomplete','hangup','fullybooted','syncFullyBooted','newexten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','status','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','format','voice:queue:%s','name','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','pTalking','sumBillable','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:'];(function(_0x13f729,_0x2689d0){var _0x5d1288=function(_0xd85899){while(--_0xd85899){_0x13f729['push'](_0x13f729['shift']());}};_0x5d1288(++_0x2689d0);}(_0x049e,0x16a));var _0xe049=function(_0x4f35f4,_0x51a8c3){_0x4f35f4=_0x4f35f4-0x0;var _0x2e9a70=_0x049e[_0x4f35f4];return _0x2e9a70;};'use strict';var _=require(_0xe049('0x0'));var moment=require(_0xe049('0x1'));var util=require('util');var md5=require(_0xe049('0x2'));var Redis=require('ioredis');var config=require(_0xe049('0x3'));var logger=require(_0xe049('0x4'))(_0xe049('0x5'));var ami=require(_0xe049('0x6'));var QueueReport=require(_0xe049('0x7'));config['redis']=_[_0xe049('0x8')](config[_0xe049('0x9')],{'host':_0xe049('0xa'),'port':0x18eb});var io=require(_0xe049('0xb'))(new Redis(config[_0xe049('0x9')]));var Sequence=function(){};Sequence[_0xe049('0xc')][_0xe049('0xd')]=function(_0x515823){this[_0xe049('0xe')]=this[_0xe049('0xe')]?this[_0xe049('0xe')]['finally'](_0x515823):_0x515823();};function VoiceQueueReport(_0x5cd404){this[_0xe049('0xf')]=new Sequence();this[_0xe049('0x10')]={};this[_0xe049('0x11')]=_0x5cd404['agents'];this['channels']=_0x5cd404['queueChannels'];this[_0xe049('0x12')]=_0x5cd404[_0xe049('0x12')];this[_0xe049('0x13')]=!![];this[_0xe049('0x14')]=_0x5cd404[_0xe049('0x14')];this[_0xe049('0x15')]={};ami['on'](_0xe049('0x16'),this[_0xe049('0x17')]['bind'](this));ami['on'](_0xe049('0x18'),this[_0xe049('0x19')][_0xe049('0x1a')](this));ami['on'](_0xe049('0x1b'),this['syncQueueCallerJoin'][_0xe049('0x1a')](this));ami['on'](_0xe049('0x1c'),this['syncQueueCallerAbandon'][_0xe049('0x1a')](this));ami['on'](_0xe049('0x1d'),this['syncQueueCallerLeave'][_0xe049('0x1a')](this));ami['on'](_0xe049('0x1e'),this['syncAgentComplete'][_0xe049('0x1a')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xe049('0x1a')](this));ami['on']('varset',this['syncVarSet'][_0xe049('0x1a')](this));ami['on'](_0xe049('0x1f'),this['syncHangup']['bind'](this));ami['on'](_0xe049('0x20'),this[_0xe049('0x21')][_0xe049('0x1a')](this));ami['on'](_0xe049('0x22'),this['syncNewExten']['bind'](this));ami['on'](_0xe049('0x23'),this[_0xe049('0x24')]['bind'](this));ami['on'](_0xe049('0x25'),this[_0xe049('0x26')][_0xe049('0x1a')](this));ami['on']('attendedtransfer',this[_0xe049('0x27')][_0xe049('0x1a')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));this[_0xe049('0x28')]();this['loopQueueShow']();}function clearChannels(_0x54a0ee){if(!_[_0xe049('0x29')](_0x54a0ee)){for(var _0x1efbbe in _0x54a0ee){if(_0x54a0ee['hasOwnProperty'](_0x1efbbe)){delete _0x54a0ee[_0x1efbbe];}}}}function clearCampaigns(_0x1f5233){if(!_[_0xe049('0x29')](_0x1f5233)){for(var _0x3e5c7f in _0x1f5233){if(_0x1f5233[_0xe049('0x2a')](_0x3e5c7f)){_0x1f5233[_0x3e5c7f][_0xe049('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x1843b8){if(!_['isEmpty'](_0x1843b8)){for(var _0x50552d in _0x1843b8){if(_0x1843b8[_0xe049('0x2a')](_0x50552d)){_0x1843b8[_0x50552d]['originated']=0x0;_0x1843b8[_0x50552d][_0xe049('0x2c')]=0x0;_0x1843b8[_0x50552d]['pTalking']=0x0;_0x1843b8[_0x50552d][_0xe049('0x2d')]=0x0;_0x1843b8[_0x50552d][_0xe049('0x2e')]=!![];}}}}function clearAgentBooked(_0x5adcd6){if(!_[_0xe049('0x29')](_0x5adcd6)){for(var _0x364630 in _0x5adcd6){if(_0x5adcd6[_0xe049('0x2a')](_0x364630)){_0x5adcd6[_0x364630][_0xe049('0x2f')]=!![];}}}}VoiceQueueReport[_0xe049('0xc')][_0xe049('0x30')]=function(){var _0x123d2e=this;for(var _0x44faff in this[_0xe049('0x31')]){if(this[_0xe049('0x31')][_0xe049('0x2a')](_0x44faff)&&!this['channels'][_0x44faff][_0xe049('0x32')]){this[_0xe049('0xf')]['enqueue'](function(){if(!_['isNil'](_0x123d2e['channels'][_0x44faff])){return ami['Action']({'action':_0xe049('0x33'),'channel':_0x123d2e[_0xe049('0x31')][_0x44faff][_0xe049('0x34')]})[_0xe049('0x35')](function(_0x9af9bd){if(_0x9af9bd['message']===_0xe049('0x36')){setTimeout(function(){if(_0x123d2e[_0xe049('0x31')][_0x44faff]){delete _0x123d2e[_0xe049('0x31')][_0x44faff];logger[_0xe049('0x37')](_0xe049('0x38'),_0x44faff,util['inspect'](_0x9af9bd,{'showHidden':![],'depth':null}));}if(_0x123d2e[_0xe049('0x10')][_0x44faff]){delete _0x123d2e['queueReports'][_0x44faff];logger[_0xe049('0x37')]('[%s][voiceQueueReport][checkQueueReport]',_0x44faff,util[_0xe049('0x39')](_0x9af9bd,{'showHidden':![],'depth':null}));}if(_0x123d2e[_0xe049('0x15')][_0x44faff]){delete _0x123d2e[_0xe049('0x15')][_0x44faff];logger[_0xe049('0x37')](_0xe049('0x3a'),_0x44faff,util[_0xe049('0x39')](_0x9af9bd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x21')]=function(){logger[_0xe049('0x37')](_0xe049('0x3b'));clearChannels(this[_0xe049('0x31')]);this['clearQueueReport'](this[_0xe049('0x10')]);clearAgentBooked(this[_0xe049('0x11')]);clearVoiceQueues(this[_0xe049('0x12')]);clearCampaigns(this[_0xe049('0x14')]);};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x3c')]=function(_0x2285d4){var _0x1e39f2=this;if(!_['isEmpty'](_0x2285d4)){for(var _0x1e5767 in _0x2285d4){if(_0x2285d4[_0xe049('0x2a')](_0x1e5767)){_0x1e39f2[_0xe049('0x3d')](_0x2285d4[_0x1e5767],_0xe049('0x3e'));delete _0x2285d4[_0x1e5767];}}}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x3f')]=function(_0x82d695,_0x3963e6,_0x2a840f){io['to'](_0x82d695)[_0xe049('0x3f')](_0x3963e6,_0x2a840f);};VoiceQueueReport['prototype'][_0xe049('0x40')]=function(_0x176374,_0x21f6e6){logger['debug'](_0xe049('0x41')+_0x21f6e6+']\x20sending\x20voice_queue_channel:save\x20event:',_0x176374['uniqueid'],util[_0xe049('0x39')](_0x176374,{'showHidden':![],'depth':null}));this['emit'](util[_0xe049('0x42')](_0xe049('0x43'),_0x176374[_0xe049('0x44')]),_0xe049('0x45'),_0x176374);io[_0xe049('0x3f')]('voice_queue_presence:save',_0x176374);};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x3d')]=function(_0x5e2374,_0x546137){logger[_0xe049('0x46')](_0xe049('0x41')+_0x546137+_0xe049('0x47'),_0x5e2374[_0xe049('0x48')],util[_0xe049('0x39')](_0x5e2374,{'showHidden':![],'depth':null}));this[_0xe049('0x3f')](util['format'](_0xe049('0x43'),_0x5e2374[_0xe049('0x44')]),'voice_queue_channel:remove',_0x5e2374);io[_0xe049('0x3f')](_0xe049('0x49'),_0x5e2374);};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x4a')]=function(_0x117798,_0x560d2e){if(_0x117798['type']===_0xe049('0x4b')){var _0x3fcc2b={'id':_0x117798['id'],'name':_0x117798[_0xe049('0x44')],'strategy':_0x117798[_0xe049('0x4c')],'answered':_0x117798[_0xe049('0x4d')],'available':_0x117798[_0xe049('0x4e')],'loggedIn':_0x117798['loggedIn'],'pTalking':_0x117798[_0xe049('0x4f')],'sumBillable':_0x117798[_0xe049('0x50')],'sumDuration':_0x117798['sumDuration'],'sumHoldTime':_0x117798[_0xe049('0x51')]||0x0,'talking':_0x117798['talking'],'total':_0x117798[_0xe049('0x52')],'type':_0x117798['type'],'unmanaged':_0x117798[_0xe049('0x53')],'abandoned':_0x117798['abandoned'],'waiting':_0x117798[_0xe049('0x2d')]};if(_0x117798[_0xe049('0x54')]){_0x3fcc2b[_0xe049('0x54')]={'id':_0x117798[_0xe049('0x54')]['id'],'name':_0x117798[_0xe049('0x54')]['name'],'active':_0x117798[_0xe049('0x54')][_0xe049('0x55')],'callerid':_0x117798[_0xe049('0x54')][_0xe049('0x56')]};}if(_0x117798[_0xe049('0x57')]){_0x3fcc2b[_0xe049('0x57')]={'id':_0x117798[_0xe049('0x57')]['id'],'name':_0x117798[_0xe049('0x57')][_0xe049('0x44')]};}var _0x493962=md5(JSON['stringify'](_0x3fcc2b));if(_0x117798[_0xe049('0x2')]!==_0x493962){_0x117798[_0xe049('0x2')]=_0x493962;logger[_0xe049('0x46')](_0xe049('0x58')+_0x560d2e+_0xe049('0x59'),util[_0xe049('0x39')](_0x3fcc2b,{'showHidden':![],'depth':null}));this[_0xe049('0x3f')](util[_0xe049('0x42')](_0xe049('0x43'),_0x3fcc2b[_0xe049('0x44')]),_0xe049('0x5a'),_0x3fcc2b);}}};VoiceQueueReport['prototype'][_0xe049('0x5b')]=function(_0x3534fa){return _0x3534fa!==null&&!_[_0xe049('0x5c')](_0x3534fa);};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x5d')]=function(){var _0x3779c6=this;setInterval(function(){_0x3779c6[_0xe049('0x30')]();ami['Action']({'action':'queues'})['catch'](function(_0x147d90){logger[_0xe049('0x37')]('[voiceQueueReport][queues]',util[_0xe049('0x39')](_0x147d90,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x28')]=function(){var _0x31d593=this;setInterval(function(){if(_0x31d593['flagQueueSummary']){return ami['Action']({'action':_0xe049('0x16')})[_0xe049('0x5e')](function(_0x4b3947){_0x31d593['flagQueueSummary']=![];})[_0xe049('0x35')](function(_0x57158d){logger[_0xe049('0x37')](_0xe049('0x5f'),util['inspect'](_0x57158d,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xe049('0xc')]['syncQueueSummary']=function(_0x356605){try{if(this[_0xe049('0x5b')](_0x356605)&&this['isNotNull'](_0x356605[_0xe049('0x60')])){logger[_0xe049('0x46')](_0xe049('0x61'),util[_0xe049('0x39')](_0x356605,{'showHidden':![],'depth':null}));if(this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]]){logger[_0xe049('0x62')](_0xe049('0x63'),_0x356605[_0xe049('0x60')]);var _0x35f367=_['countBy'](this[_0xe049('0x31')],_0xe049('0x60'))[_0x356605[_0xe049('0x60')]]||0x0;var _0x4d2b67=_0x35f367-_0x356605[_0xe049('0x64')];if(this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]][_0xe049('0x2d')]!==_[_0xe049('0x65')](_0x356605[_0xe049('0x64')])||this[_0xe049('0x12')][_0x356605['queue']][_0xe049('0x66')]!==_['toNumber'](_0x356605[_0xe049('0x67')])||this['voiceQueues'][_0x356605[_0xe049('0x60')]][_0xe049('0x4e')]!==_[_0xe049('0x65')](_0x356605[_0xe049('0x4e')])||this[_0xe049('0x12')][_0x356605['queue']][_0xe049('0x2c')]!==_0x4d2b67){this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]][_0xe049('0x2d')]=_[_0xe049('0x65')](_0x356605[_0xe049('0x64')]);this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]]['loggedIn']=_['toNumber'](_0x356605[_0xe049('0x67')]);this[_0xe049('0x12')][_0x356605['queue']][_0xe049('0x4e')]=_[_0xe049('0x65')](_0x356605[_0xe049('0x4e')]);this[_0xe049('0x12')][_0x356605['queue']]['talking']=_0x4d2b67>0x0?_0x4d2b67:0x0;this[_0xe049('0x12')][_0x356605['queue']][_0xe049('0x2c')]=this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]][_0xe049('0x2c')]>_[_0xe049('0x65')](_0x356605[_0xe049('0x67')])?_[_0xe049('0x65')](_0x356605[_0xe049('0x67')]):this['voiceQueues'][_0x356605[_0xe049('0x60')]][_0xe049('0x2c')];this[_0xe049('0x4a')](this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]],'queuesummary');}logger[_0xe049('0x46')](_0xe049('0x68'),util[_0xe049('0x39')](this[_0xe049('0x12')][_0x356605['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xe049('0x69'),this[_0xe049('0x12')][_0x356605[_0xe049('0x60')]]);}}}catch(_0x51678c){logger[_0xe049('0x37')](_0xe049('0x5f'),util[_0xe049('0x39')](_0x51678c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x19')]=function(_0x248f02){logger[_0xe049('0x46')](_0xe049('0x6a'),util[_0xe049('0x39')](_0x248f02,{'showHidden':![],'depth':null}));this[_0xe049('0x13')]=!![];};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x6b')]=function(_0x5f0262){try{if(this['isNotNull'](_0x5f0262)){logger[_0xe049('0x46')](_0xe049('0x6c'),_0x5f0262[_0xe049('0x48')],util['inspect'](_0x5f0262,{'showHidden':![],'depth':null}));if(_[_0xe049('0x5c')](this[_0xe049('0x10')][_0x5f0262['uniqueid']]))this[_0xe049('0x10')][_0x5f0262[_0xe049('0x48')]]=[];if(_['isUndefined'](this[_0xe049('0x31')][_0x5f0262[_0xe049('0x48')]]))this[_0xe049('0x31')][_0x5f0262[_0xe049('0x48')]]={};var _0xf95e5c=new QueueReport();_0xf95e5c[_0xe049('0x44')]=_0x5f0262[_0xe049('0x60')];_0xf95e5c[_0xe049('0x6d')]=this[_0xe049('0x12')][_0xf95e5c[_0xe049('0x44')]]&&this[_0xe049('0x12')][_0xf95e5c[_0xe049('0x44')]][_0xe049('0x6d')]?this['voiceQueues'][_0xf95e5c[_0xe049('0x44')]]['type']||'inbound':_0xe049('0x4b');_0xf95e5c[_0xe049('0x60')]=_0x5f0262[_0xe049('0x60')];_0xf95e5c['queuecallerjoinAt']=moment()[_0xe049('0x42')]('YYYY-MM-DD\x20HH:mm:ss');_0xf95e5c[_0xe049('0x6e')]=_0x5f0262['position'];_0xf95e5c[_0xe049('0x6f')]=_0x5f0262[_0xe049('0x6f')];_0xf95e5c[_0xe049('0x48')]=_0x5f0262[_0xe049('0x48')];_0xf95e5c[_0xe049('0x70')]=this[_0xe049('0x31')][_0x5f0262[_0xe049('0x48')]][_0xe049('0x70')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xf95e5c[_0xe049('0x44')],_0xf95e5c[_0xe049('0x6d')]);_[_0xe049('0x71')](_0xf95e5c,_[_0xe049('0x72')](_0x5f0262,_[_0xe049('0x73')](_0xf95e5c)));this[_0xe049('0x10')][_0x5f0262['uniqueid']][_0xe049('0x74')](_0xf95e5c);this['channels'][_0x5f0262['uniqueid']]=_0xf95e5c;this[_0xe049('0x40')](_0xf95e5c,_0xe049('0x1b'));}}catch(_0x460671){logger['error'](_0xe049('0x6c'),_0x5f0262['uniqueid'],util['inspect'](_0x460671,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x75')]=function(_0x3f11a7){try{if(this['isNotNull'](_0x3f11a7)){logger['debug'](_0xe049('0x76'),_0x3f11a7[_0xe049('0x48')],util['inspect'](_0x3f11a7,{'showHidden':![],'depth':null}));if(this[_0xe049('0x10')][_0x3f11a7[_0xe049('0x48')]]){var _0x3edd1c=_[_0xe049('0x77')](this['queueReports'][_0x3f11a7[_0xe049('0x48')]]);_0x3edd1c[_0xe049('0x78')]=![];_0x3edd1c[_0xe049('0x79')]=null;_0x3edd1c['holdtime']=_0x3f11a7[_0xe049('0x7a')];_0x3edd1c[_0xe049('0x7b')]=_0x3f11a7[_0xe049('0x7b')];_0x3edd1c[_0xe049('0x1c')]=!![];_0x3edd1c['queuecallerabandonAt']=moment()[_0xe049('0x42')](_0xe049('0x7c'));_0x3edd1c[_0xe049('0x7d')]='ABANDONED';_0x3edd1c[_0xe049('0x7e')]=null;logger[_0xe049('0x62')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3edd1c[_0xe049('0x44')],_0x3edd1c[_0xe049('0x6d')]);this['channels'][_0x3f11a7[_0xe049('0x48')]]=_0x3edd1c;this[_0xe049('0x3d')](_0x3edd1c,_0xe049('0x1c'));}}}catch(_0x37ca72){logger[_0xe049('0x37')](_0xe049('0x76'),_0x3f11a7[_0xe049('0x48')],util['inspect'](_0x37ca72,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x10894b){try{if(this['isNotNull'](_0x10894b)){logger[_0xe049('0x46')](_0xe049('0x7f'),_0x10894b[_0xe049('0x48')],util[_0xe049('0x39')](_0x10894b,{'showHidden':![],'depth':null}));if(this[_0xe049('0x10')][_0x10894b[_0xe049('0x48')]]){var _0x363da7=_['last'](this['queueReports'][_0x10894b[_0xe049('0x48')]]);_0x363da7[_0xe049('0x80')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x363da7[_0xe049('0x81')]=_0x10894b['connectedlinenum'];_0x363da7['connectedlinename']=_0x10894b[_0xe049('0x82')];logger[_0xe049('0x62')](_0xe049('0x83'),_0x363da7[_0xe049('0x44')],_0x363da7[_0xe049('0x6d')],_0x10894b[_0xe049('0x81')],_0x10894b['connectedlinename']);this[_0xe049('0x31')][_0x10894b[_0xe049('0x48')]]=_0x363da7;this[_0xe049('0x40')](_0x363da7,'queuecallerleave');}}}catch(_0x5ada32){logger[_0xe049('0x37')](_0xe049('0x7f'),_0x10894b[_0xe049('0x48')],util['inspect'](_0x5ada32,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x84')]=function(_0x1e733b){try{if(this[_0xe049('0x5b')](_0x1e733b)){logger[_0xe049('0x46')](_0xe049('0x85'),_0x1e733b[_0xe049('0x48')],util[_0xe049('0x39')](_0x1e733b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1e733b[_0xe049('0x48')]]){var _0x1ac4c8=_[_0xe049('0x77')](this[_0xe049('0x10')][_0x1e733b[_0xe049('0x48')]]);_0x1ac4c8[_0xe049('0x78')]=!![];_0x1ac4c8[_0xe049('0x7d')]=_0xe049('0x86');logger[_0xe049('0x62')](_0xe049('0x87'),_0x1ac4c8['name'],_0x1ac4c8['type']);}}}catch(_0x55372d){logger['error'](_0xe049('0x85'),_0x1e733b['uniqueid'],util['inspect'](_0x55372d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')]['syncAgentComplete']=function(_0x55c600){try{if(this[_0xe049('0x5b')](_0x55c600)){logger[_0xe049('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x55c600[_0xe049('0x48')],util[_0xe049('0x39')](_0x55c600,{'showHidden':![],'depth':null}));if(this[_0xe049('0x10')][_0x55c600['uniqueid']]){var _0x2178c2=_[_0xe049('0x77')](this['queueReports'][_0x55c600[_0xe049('0x48')]]);_0x2178c2[_0xe049('0x1c')]=![];_0x2178c2[_0xe049('0x88')]=null;_0x2178c2[_0xe049('0x89')]=!![];_0x2178c2[_0xe049('0x7e')]=_0x55c600[_0xe049('0x8a')];_0x2178c2[_0xe049('0x7a')]=_0x55c600[_0xe049('0x7a')];_0x2178c2[_0xe049('0x78')]=!![];_0x2178c2[_0xe049('0x8b')]=![];_0x2178c2[_0xe049('0x8c')]=null;if(!_0x2178c2[_0xe049('0x8d')]){if(_0x55c600[_0xe049('0x8e')]==_0xe049('0x8d')){_0x2178c2['queuecallerexitreason']='COMPLETED';logger['info'](_0xe049('0x8f'),_0x2178c2['name'],_0x2178c2[_0xe049('0x6d')]);}else{if(_['startsWith'](_0x55c600[_0xe049('0x34')][_0xe049('0x90')](),'local/')){if(this[_0xe049('0x10')][_0x55c600[_0xe049('0x91')]]){var _0x57b50e=_[_0xe049('0x77')](this['queueReports'][_0x55c600[_0xe049('0x91')]]);_0x57b50e[_0xe049('0x78')]=![];_0x57b50e[_0xe049('0x8b')]=!![];_0x57b50e[_0xe049('0x8c')]=moment(_0x2178c2['queuecallerjoinAt'])[_0xe049('0x92')](_0x55c600['holdtime'],'seconds')['format'](_0xe049('0x7c'));_0x57b50e[_0xe049('0x7d')]=_0xe049('0x93');_0x57b50e[_0xe049('0x8d')]=!![];_0x57b50e[_0xe049('0x94')]=_0xe049('0x95');_0x57b50e[_0xe049('0x96')]=_0x55c600['destexten'];_0x57b50e[_0xe049('0x97')]=_0x55c600['uniqueid'];logger[_0xe049('0x62')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x57b50e[_0xe049('0x44')],_0x57b50e[_0xe049('0x6d')]);var _0x51c6df=this[_0xe049('0x10')][_0x55c600[_0xe049('0x91')]];this[_0xe049('0x10')][_0x55c600[_0xe049('0x91')]]=this[_0xe049('0x10')][_0x55c600[_0xe049('0x48')]];this[_0xe049('0x10')][_0x55c600['uniqueid']]=_0x51c6df;}}else{_0x2178c2[_0xe049('0x7d')]='COMPLETEDBY'+_0x55c600[_0xe049('0x8e')][_0xe049('0x98')]();logger['info'](_0xe049('0x99'),_0x2178c2[_0xe049('0x44')],_0x2178c2[_0xe049('0x6d')],_0x2178c2[_0xe049('0x7d')]);}}}this[_0xe049('0x31')][_0x55c600['uniqueid']]=_0x2178c2;this[_0xe049('0x3d')](_0x2178c2,_0xe049('0x1e'));}}}catch(_0x3999b7){logger[_0xe049('0x37')](_0xe049('0x9a'),_0x55c600[_0xe049('0x48')],util[_0xe049('0x39')](_0x3999b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0x9b')]=function(_0x1ef285){try{if(this[_0xe049('0x5b')](_0x1ef285)){logger[_0xe049('0x46')](_0xe049('0x9c'),_0x1ef285[_0xe049('0x48')],util['inspect'](_0x1ef285,{'showHidden':![],'depth':null}));this['addVariable'](_0x1ef285[_0xe049('0x48')],_[_0xe049('0x73')](_0x1ef285[_0xe049('0x9d')])[0x0],_0x1ef285['value']);if(this['queueReports'][_0x1ef285[_0xe049('0x48')]]){var _0x6731d=_[_0xe049('0x77')](this[_0xe049('0x10')][_0x1ef285[_0xe049('0x48')]]);if(_0x6731d){if(this[_0xe049('0x5b')](_0x1ef285[_0xe049('0x9d')])&&this[_0xe049('0x5b')](_0x1ef285[_0xe049('0x9d')]['queuestatus'])){switch(_0x1ef285[_0xe049('0x9e')]){case _0xe049('0x9f'):_0x6731d[_0xe049('0x8b')]=![];_0x6731d['queuecallerexitAt']=null;break;case'TIMEOUT':_0x6731d['lastevent']='timeout';_0x6731d[_0xe049('0x8b')]=!![];_0x6731d[_0xe049('0x8c')]=moment()['format'](_0xe049('0x7c'));_0x6731d[_0xe049('0x80')]=moment()[_0xe049('0x42')](_0xe049('0x7c'));logger[_0xe049('0x46')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1ef285[_0xe049('0x48')],util['inspect'](_0x6731d,{'showHidden':![],'depth':null}));ami[_0xe049('0x3f')]('custom:timeout',_0x6731d);break;default:_0x6731d[_0xe049('0x8b')]=!![];_0x6731d[_0xe049('0x8c')]=moment()[_0xe049('0x42')](_0xe049('0x7c'));_0x6731d[_0xe049('0x80')]=moment()[_0xe049('0x42')](_0xe049('0x7c'));}_0x6731d[_0xe049('0x1c')]=![];_0x6731d[_0xe049('0x88')]=null;_0x6731d[_0xe049('0x7d')]=_0x1ef285[_0xe049('0x9e')];this[_0xe049('0x31')][_0x1ef285[_0xe049('0x48')]]=_0x6731d;this[_0xe049('0x3d')](_0x6731d,_0xe049('0xa0'));}else if(this[_0xe049('0x5b')](_0x1ef285[_0xe049('0x9d')])&&this['isNotNull'](_0x1ef285[_0xe049('0x9d')][_0xe049('0xa1')])){if(!_0x6731d[_0xe049('0x1c')]){_0x6731d[_0xe049('0x8b')]=!![];_0x6731d[_0xe049('0x8c')]=moment()[_0xe049('0x42')](_0xe049('0x7c'));_0x6731d[_0xe049('0x7d')]=_0xe049('0xa2');_0x6731d[_0xe049('0x80')]=moment()[_0xe049('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1ef285[_0xe049('0x48')]]=_0x6731d;}}logger[_0xe049('0x62')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1ef285[_0xe049('0x48')],_0x6731d['name'],_0x6731d[_0xe049('0x6d')],_['keys'](_0x1ef285[_0xe049('0x9d')])[0x0],_0x1ef285['value']);_0x6731d[_0xe049('0x15')]=this['variables'][_0x1ef285['uniqueid']];}}}}catch(_0x3f630e){logger['error'](_0xe049('0x9c'),_0x1ef285[_0xe049('0x48')],util[_0xe049('0x39')](_0x3f630e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe049('0xc')]['addVariable']=function(_0x21fff6,_0x287b9d,_0x32adc1){var _0x42bfd6=[_0xe049('0xa3'),_0xe049('0xa4'),'rtpaudioqosjitter',_0xe049('0xa5'),_0xe049('0xa6'),_0xe049('0xa7'),_0xe049('0xa8'),'rtpaudioqosrttbridged',_0xe049('0xa9'),_0xe049('0xaa'),'bridgepeer',_0xe049('0xab'),_0xe049('0xac'),'memberdynamic',_0xe049('0xad'),_0xe049('0xae'),'membername',_0xe049('0xaf'),_0xe049('0xb0')];if(!_['isNil'](_0x287b9d)&&!_[_0xe049('0xb1')](_0x42bfd6,_0x287b9d)){if(_[_0xe049('0x5c')](this[_0xe049('0x15')][_0x21fff6])){this[_0xe049('0x15')][_0x21fff6]={};}this[_0xe049('0x15')][_0x21fff6][_0x287b9d]=_0x32adc1;}};VoiceQueueReport[_0xe049('0xc')][_0xe049('0xb2')]=function(_0x20d9fb){try{if(this['isNotNull'](_0x20d9fb)){logger[_0xe049('0x46')]('[%s][voiceQueueReport][hangup]',_0x20d9fb[_0xe049('0x48')],util[_0xe049('0x39')](_0x20d9fb,{'showHidden':![],'depth':null}));if(this[_0xe049('0x10')][_0x20d9fb[_0xe049('0x48')]]){for(var _0x1c5d42=0x0,_0x334ae8={};_0x1c5d420x0?_0x4437f5:0x0;this[_0x2aaa('0x13')][_0x1a5d71[_0x2aaa('0x65')]][_0x2aaa('0x2f')]=this['voiceQueues'][_0x1a5d71['queue']]['talking']>_[_0x2aaa('0x69')](_0x1a5d71[_0x2aaa('0x6b')])?_[_0x2aaa('0x69')](_0x1a5d71[_0x2aaa('0x6b')]):this[_0x2aaa('0x13')][_0x1a5d71[_0x2aaa('0x65')]][_0x2aaa('0x2f')];this['emitVoiceQueueSummary'](this[_0x2aaa('0x13')][_0x1a5d71[_0x2aaa('0x65')]],'queuesummary');}logger[_0x2aaa('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x2aaa('0x3c')](this[_0x2aaa('0x13')][_0x1a5d71['queue']],{'showHidden':![],'depth':null}));ami[_0x2aaa('0x43')]('custom:queuesummary',this[_0x2aaa('0x13')][_0x1a5d71[_0x2aaa('0x65')]]);}}}catch(_0x32ae60){logger['error'](_0x2aaa('0x64'),util['inspect'](_0x32ae60,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2aaa('0xc')]['syncQueueSummaryComplete']=function(_0x2dab2f){logger['debug'](_0x2aaa('0x6c'),util[_0x2aaa('0x3c')](_0x2dab2f,{'showHidden':![],'depth':null}));this[_0x2aaa('0x14')]=!![];};VoiceQueueReport[_0x2aaa('0xc')][_0x2aaa('0x6d')]=function(_0x2c305a){try{if(this[_0x2aaa('0x5e')](_0x2c305a)){logger[_0x2aaa('0x45')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2c305a[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x2c305a,{'showHidden':![],'depth':null}));if(_[_0x2aaa('0x5f')](this[_0x2aaa('0xf')][_0x2c305a[_0x2aaa('0x48')]]))this[_0x2aaa('0xf')][_0x2c305a[_0x2aaa('0x48')]]=[];if(_[_0x2aaa('0x5f')](this['channels'][_0x2c305a[_0x2aaa('0x48')]]))this[_0x2aaa('0x11')][_0x2c305a['uniqueid']]={};var _0x613d41=new QueueReport();_0x613d41['name']=_0x2c305a['queue'];_0x613d41[_0x2aaa('0x52')]=this[_0x2aaa('0x13')][_0x613d41['name']]&&this[_0x2aaa('0x13')][_0x613d41['name']][_0x2aaa('0x52')]?this[_0x2aaa('0x13')][_0x613d41[_0x2aaa('0x4e')]][_0x2aaa('0x52')]||_0x2aaa('0x6e'):_0x2aaa('0x6e');_0x613d41[_0x2aaa('0x65')]=_0x2c305a[_0x2aaa('0x65')];_0x613d41[_0x2aaa('0x6f')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));_0x613d41[_0x2aaa('0x71')]=_0x2c305a[_0x2aaa('0x71')];_0x613d41[_0x2aaa('0x72')]=_0x2c305a[_0x2aaa('0x72')];_0x613d41[_0x2aaa('0x48')]=_0x2c305a['uniqueid'];_0x613d41['routealias']=this[_0x2aaa('0x11')][_0x2c305a[_0x2aaa('0x48')]][_0x2aaa('0x73')];logger[_0x2aaa('0x67')](_0x2aaa('0x74'),_0x613d41['name'],_0x613d41[_0x2aaa('0x52')]);_[_0x2aaa('0x75')](_0x613d41,_[_0x2aaa('0x76')](_0x2c305a,_[_0x2aaa('0x77')](_0x613d41)));this[_0x2aaa('0xf')][_0x2c305a['uniqueid']][_0x2aaa('0x78')](_0x613d41);this[_0x2aaa('0x11')][_0x2c305a[_0x2aaa('0x48')]]=_0x613d41;this[_0x2aaa('0x44')](_0x613d41,_0x2aaa('0x1c'));}}catch(_0x5459ec){logger[_0x2aaa('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2c305a[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x5459ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2aaa('0x1d')]=function(_0x131549){try{if(this[_0x2aaa('0x5e')](_0x131549)){logger[_0x2aaa('0x45')](_0x2aaa('0x79'),_0x131549[_0x2aaa('0x48')],util['inspect'](_0x131549,{'showHidden':![],'depth':null}));if(this[_0x2aaa('0xf')][_0x131549['uniqueid']]){var _0xc8afd=_[_0x2aaa('0x7a')](this[_0x2aaa('0xf')][_0x131549[_0x2aaa('0x48')]]);_0xc8afd[_0x2aaa('0x7b')]=![];_0xc8afd[_0x2aaa('0x7c')]=null;_0xc8afd['holdtime']=_0x131549[_0x2aaa('0x7d')];_0xc8afd[_0x2aaa('0x7e')]=_0x131549[_0x2aaa('0x7e')];_0xc8afd[_0x2aaa('0x7f')]=!![];_0xc8afd[_0x2aaa('0x80')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));_0xc8afd[_0x2aaa('0x81')]=_0x2aaa('0x82');_0xc8afd[_0x2aaa('0x83')]=null;logger[_0x2aaa('0x67')](_0x2aaa('0x84'),_0xc8afd[_0x2aaa('0x4e')],_0xc8afd[_0x2aaa('0x52')]);this[_0x2aaa('0x11')][_0x131549[_0x2aaa('0x48')]]=_0xc8afd;this[_0x2aaa('0x41')](_0xc8afd,_0x2aaa('0x7f'));}}}catch(_0x3018b3){logger['error'](_0x2aaa('0x79'),_0x131549['uniqueid'],util[_0x2aaa('0x3c')](_0x3018b3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2aaa('0x85')]=function(_0x3d0fa0){try{if(this['isNotNull'](_0x3d0fa0)){logger[_0x2aaa('0x45')](_0x2aaa('0x86'),_0x3d0fa0[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x3d0fa0,{'showHidden':![],'depth':null}));if(this[_0x2aaa('0xf')][_0x3d0fa0[_0x2aaa('0x48')]]){var _0x2d2e63=_[_0x2aaa('0x7a')](this['queueReports'][_0x3d0fa0[_0x2aaa('0x48')]]);_0x2d2e63[_0x2aaa('0x87')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));_0x2d2e63[_0x2aaa('0x88')]=_0x3d0fa0[_0x2aaa('0x88')];_0x2d2e63['connectedlinename']=_0x3d0fa0[_0x2aaa('0x89')];logger[_0x2aaa('0x67')](_0x2aaa('0x8a'),_0x2d2e63[_0x2aaa('0x4e')],_0x2d2e63[_0x2aaa('0x52')],_0x3d0fa0[_0x2aaa('0x88')],_0x3d0fa0[_0x2aaa('0x89')]);this[_0x2aaa('0x11')][_0x3d0fa0[_0x2aaa('0x48')]]=_0x2d2e63;this[_0x2aaa('0x44')](_0x2d2e63,_0x2aaa('0x8b'));}}}catch(_0x264d03){logger['error'](_0x2aaa('0x86'),_0x3d0fa0[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x264d03,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x1e2e7d){try{if(this['isNotNull'](_0x1e2e7d)){logger[_0x2aaa('0x45')](_0x2aaa('0x8c'),_0x1e2e7d['uniqueid'],util['inspect'](_0x1e2e7d,{'showHidden':![],'depth':null}));if(this[_0x2aaa('0xf')][_0x1e2e7d[_0x2aaa('0x48')]]){var _0x58bbc0=_[_0x2aaa('0x7a')](this[_0x2aaa('0xf')][_0x1e2e7d[_0x2aaa('0x48')]]);_0x58bbc0[_0x2aaa('0x7b')]=!![];_0x58bbc0[_0x2aaa('0x81')]=_0x2aaa('0x8d');logger[_0x2aaa('0x67')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x58bbc0[_0x2aaa('0x4e')],_0x58bbc0['type']);}}}catch(_0x3f1780){logger[_0x2aaa('0x3a')](_0x2aaa('0x8c'),_0x1e2e7d[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x3f1780,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2aaa('0xc')]['syncAgentComplete']=function(_0x31da3d){try{if(this[_0x2aaa('0x5e')](_0x31da3d)){logger[_0x2aaa('0x45')](_0x2aaa('0x8e'),_0x31da3d[_0x2aaa('0x48')],util['inspect'](_0x31da3d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x31da3d['uniqueid']]){var _0x1dccad=_['last'](this['queueReports'][_0x31da3d[_0x2aaa('0x48')]]);_0x1dccad[_0x2aaa('0x7f')]=![];_0x1dccad[_0x2aaa('0x80')]=null;_0x1dccad[_0x2aaa('0x8f')]=!![];_0x1dccad[_0x2aaa('0x83')]=_0x31da3d['membername'];_0x1dccad[_0x2aaa('0x7d')]=_0x31da3d[_0x2aaa('0x7d')];_0x1dccad[_0x2aaa('0x7b')]=!![];_0x1dccad[_0x2aaa('0x90')]=![];_0x1dccad[_0x2aaa('0x91')]=null;if(!_0x1dccad[_0x2aaa('0x92')]){if(_0x31da3d[_0x2aaa('0x93')]==_0x2aaa('0x92')){_0x1dccad[_0x2aaa('0x81')]=_0x2aaa('0x94');logger[_0x2aaa('0x67')](_0x2aaa('0x95'),_0x1dccad['name'],_0x1dccad[_0x2aaa('0x52')]);}else{if(_[_0x2aaa('0x96')](_0x31da3d[_0x2aaa('0x97')][_0x2aaa('0x98')](),_0x2aaa('0x99'))){if(this[_0x2aaa('0xf')][_0x31da3d['linkedid']]){var _0x2354f3=_['last'](this[_0x2aaa('0xf')][_0x31da3d[_0x2aaa('0x9a')]]);_0x2354f3[_0x2aaa('0x7b')]=![];_0x2354f3['queuecallerexit']=!![];_0x2354f3[_0x2aaa('0x91')]=moment(_0x1dccad['queuecallerjoinAt'])[_0x2aaa('0x9b')](_0x31da3d['holdtime'],_0x2aaa('0x9c'))[_0x2aaa('0x49')](_0x2aaa('0x70'));_0x2354f3[_0x2aaa('0x81')]=_0x2aaa('0x9d');_0x2354f3[_0x2aaa('0x92')]=!![];_0x2354f3['transfertype']=_0x2aaa('0x9e');_0x2354f3[_0x2aaa('0x9f')]=_0x31da3d['destexten'];_0x2354f3[_0x2aaa('0xa0')]=_0x31da3d[_0x2aaa('0x48')];logger[_0x2aaa('0x67')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2354f3[_0x2aaa('0x4e')],_0x2354f3['type']);var _0x3ff2d5=this[_0x2aaa('0xf')][_0x31da3d[_0x2aaa('0x9a')]];this['queueReports'][_0x31da3d[_0x2aaa('0x9a')]]=this['queueReports'][_0x31da3d[_0x2aaa('0x48')]];this[_0x2aaa('0xf')][_0x31da3d[_0x2aaa('0x48')]]=_0x3ff2d5;}}else{_0x1dccad[_0x2aaa('0x81')]=_0x2aaa('0xa1')+_0x31da3d[_0x2aaa('0x93')][_0x2aaa('0xa2')]();logger[_0x2aaa('0x67')](_0x2aaa('0xa3'),_0x1dccad[_0x2aaa('0x4e')],_0x1dccad['type'],_0x1dccad['queuecallerexitreason']);}}}this[_0x2aaa('0x11')][_0x31da3d['uniqueid']]=_0x1dccad;this['emitVoiceQueueChannelRemove'](_0x1dccad,_0x2aaa('0x1e'));}}}catch(_0x6ad632){logger[_0x2aaa('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x31da3d[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x6ad632,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2aaa('0xc')][_0x2aaa('0xa4')]=function(_0x22db51){try{if(this[_0x2aaa('0x5e')](_0x22db51)){logger[_0x2aaa('0x45')]('[%s][voiceQueueReport][varset]',_0x22db51['uniqueid'],util[_0x2aaa('0x3c')](_0x22db51,{'showHidden':![],'depth':null}));this['addVariable'](_0x22db51[_0x2aaa('0x48')],_['keys'](_0x22db51['variable'])[0x0],_0x22db51[_0x2aaa('0xa5')]);if(this['queueReports'][_0x22db51[_0x2aaa('0x48')]]){var _0x29162f=_[_0x2aaa('0x7a')](this[_0x2aaa('0xf')][_0x22db51['uniqueid']]);if(_0x29162f){if(this[_0x2aaa('0x5e')](_0x22db51['variable'])&&this['isNotNull'](_0x22db51[_0x2aaa('0xa6')][_0x2aaa('0xa7')])){switch(_0x22db51[_0x2aaa('0xa5')]){case'CONTINUE':_0x29162f[_0x2aaa('0x90')]=![];_0x29162f['queuecallerexitAt']=null;break;case _0x2aaa('0xa8'):_0x29162f[_0x2aaa('0xa9')]=_0x2aaa('0xaa');_0x29162f[_0x2aaa('0x90')]=!![];_0x29162f[_0x2aaa('0x91')]=moment()['format'](_0x2aaa('0x70'));_0x29162f[_0x2aaa('0x87')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x22db51[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x29162f,{'showHidden':![],'depth':null}));ami[_0x2aaa('0x43')](_0x2aaa('0xab'),_0x29162f);break;default:_0x29162f[_0x2aaa('0x90')]=!![];_0x29162f['queuecallerexitAt']=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));_0x29162f[_0x2aaa('0x87')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));}_0x29162f[_0x2aaa('0x7f')]=![];_0x29162f[_0x2aaa('0x80')]=null;_0x29162f[_0x2aaa('0x81')]=_0x22db51[_0x2aaa('0xa5')];this[_0x2aaa('0x11')][_0x22db51[_0x2aaa('0x48')]]=_0x29162f;this[_0x2aaa('0x41')](_0x29162f,_0x2aaa('0x22'));}else if(this['isNotNull'](_0x22db51['variable'])&&this[_0x2aaa('0x5e')](_0x22db51[_0x2aaa('0xa6')]['queueposition'])){if(!_0x29162f[_0x2aaa('0x7f')]){_0x29162f[_0x2aaa('0x90')]=!![];_0x29162f[_0x2aaa('0x91')]=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));_0x29162f[_0x2aaa('0x81')]='EXITWITHKEY';_0x29162f['queuecallerleaveAt']=moment()[_0x2aaa('0x49')](_0x2aaa('0x70'));this['channels'][_0x22db51[_0x2aaa('0x48')]]=_0x29162f;}}logger[_0x2aaa('0x67')](_0x2aaa('0xac'),_0x22db51[_0x2aaa('0x48')],_0x29162f['name'],_0x29162f[_0x2aaa('0x52')],_[_0x2aaa('0x77')](_0x22db51[_0x2aaa('0xa6')])[0x0],_0x22db51['value']);_0x29162f['variables']=this['variables'][_0x22db51[_0x2aaa('0x48')]];}}}}catch(_0x12373e){logger['error'](_0x2aaa('0xad'),_0x22db51['uniqueid'],util['inspect'](_0x12373e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2aaa('0xc')][_0x2aaa('0xae')]=function(_0x3838e0,_0x3eefa5,_0x3d1328){var _0x17fc11=[_0x2aaa('0xaf'),_0x2aaa('0xb0'),_0x2aaa('0xb1'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x2aaa('0xb2'),_0x2aaa('0xb3'),_0x2aaa('0xb4'),'sipcallid',_0x2aaa('0xb5'),_0x2aaa('0xb6'),'bridgepvtcallid',_0x2aaa('0xb7'),_0x2aaa('0xb8'),_0x2aaa('0xb9'),_0x2aaa('0xba'),_0x2aaa('0xbb'),_0x2aaa('0xbc'),_0x2aaa('0xbd')];if(!_['isNil'](_0x3eefa5)&&!_['includes'](_0x17fc11,_0x3eefa5)){if(_['isUndefined'](this['variables'][_0x3838e0])){this[_0x2aaa('0x16')][_0x3838e0]={};}this['variables'][_0x3838e0][_0x3eefa5]=_0x3d1328;}};VoiceQueueReport[_0x2aaa('0xc')][_0x2aaa('0xbe')]=function(_0x925fa8){try{if(this[_0x2aaa('0x5e')](_0x925fa8)){logger[_0x2aaa('0x45')](_0x2aaa('0xbf'),_0x925fa8[_0x2aaa('0x48')],util[_0x2aaa('0x3c')](_0x925fa8,{'showHidden':![],'depth':null}));if(this[_0x2aaa('0xf')][_0x925fa8[_0x2aaa('0x48')]]){for(var _0xcf8028=0x0,_0x15c8eb={};_0xcf8028=0x0?moment(_0x4dc218[_0xa1dc('0x17')])['diff'](_0x4dc218[_0xa1dc('0x16')],_0xa1dc('0xe')):null,'data1':_0xa1dc('0x18'),'data2':_0x4dc218[_0xa1dc('0x12')],'data3':_0x4dc218[_0xa1dc('0xf')],'data4':_0x4dc218[_0xa1dc('0x19')]||null,'role':_0xa1dc('0x11'),'internal':_0x4dc218[_0xa1dc('0x12')]?_[_0xa1dc('0x13')](_0x4dc218['accountcode']):undefined,'uniqueid':_0x4dc218['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x2732=['voice','lastAssignedTo','isNil','SIP/%s','interface','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','voiceDialReport','Request','CreateMemberReport','endtime','starttime','dialstring','uniqueid','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x2732,0x1e6));var _0x2273=function(_0x1dbbc2,_0x4c84b1){_0x1dbbc2=_0x1dbbc2-0x0;var _0x569955=_0x2732[_0x1dbbc2];return _0x569955;};'use strict';var moment=require(_0x2273('0x0'));var _=require(_0x2273('0x1'));var util=require(_0x2273('0x2'));var client=require(_0x2273('0x3'));exports[_0x2273('0x4')]=function(_0x24d6b9){var _0x22867d=_0x24d6b9[_0x2273('0x5')]||_0x24d6b9[_0x2273('0x6')];return client['Request']('CreateMemberReport',{'body':{'channel':_0x2273('0x7'),'membername':_0x24d6b9[_0x2273('0x8')],'interface':_[_0x2273('0x9')](_0x24d6b9['interface'])?util['format'](_0x2273('0xa'),_0x24d6b9[_0x2273('0x8')]):_0x24d6b9[_0x2273('0xb')],'type':_0x2273('0xc'),'enterAt':_0x24d6b9['queuecallerleaveAt'],'exitAt':_0x22867d,'duration':moment(_0x22867d)[_0x2273('0xd')](_0x24d6b9[_0x2273('0xe')],_0x2273('0xf')),'data1':_0x2273('0x10'),'data2':_0x24d6b9[_0x2273('0x11')],'data3':_0x24d6b9[_0x2273('0x12')],'data4':null,'data5':_0x24d6b9['queue'],'role':_0x2273('0x13'),'internal':_0x24d6b9[_0x2273('0x14')]?_[_0x2273('0x15')](_0x24d6b9[_0x2273('0x14')]):undefined,'uniqueid':_0x24d6b9['uniqueid']},'log':'CreateMemberReport'});};exports[_0x2273('0x16')]=function(_0x152c06){return client[_0x2273('0x17')](_0x2273('0x18'),{'body':{'channel':_0x2273('0x7'),'membername':_0x152c06['membername'],'interface':_0x152c06[_0x2273('0xb')],'type':_0x2273('0xc'),'enterAt':_0x152c06['starttime'],'exitAt':_0x152c06[_0x2273('0x19')],'duration':moment(_0x152c06['endtime'])[_0x2273('0xd')](_0x152c06[_0x2273('0x1a')],_0x2273('0xf'))>=0x0?moment(_0x152c06[_0x2273('0x19')])[_0x2273('0xd')](_0x152c06['starttime'],_0x2273('0xf')):null,'data1':'outbound','data2':_0x152c06[_0x2273('0x14')],'data3':_0x152c06['exten'],'data4':_0x152c06[_0x2273('0x1b')]||null,'role':_0x2273('0x13'),'internal':_0x152c06[_0x2273('0x14')]?_['toNumber'](_0x152c06['accountcode']):undefined,'uniqueid':_0x152c06[_0x2273('0x1c')]},'log':_0x2273('0x18')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 1bb4954..76cb6da 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 _0x6931=['GetSettings','../client','getSettings','stopRecordingOnTransfer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6931,0xa5));var _0x1693=function(_0x1667f1,_0x5e5d34){_0x1667f1=_0x1667f1-0x0;var _0x393238=_0x6931[_0x1667f1];return _0x393238;};'use strict';var client=require(_0x1693('0x0'));exports[_0x1693('0x1')]=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1693('0x2')]},'log':_0x1693('0x3')});}; \ No newline at end of file +var _0x2a4b=['ShowSetting','stopRecordingOnTransfer','GetSettings','getSettings'];(function(_0x1e7583,_0x51f7b7){var _0x5662cd=function(_0x39b1b2){while(--_0x39b1b2){_0x1e7583['push'](_0x1e7583['shift']());}};_0x5662cd(++_0x51f7b7);}(_0x2a4b,0xbb));var _0xb2a4=function(_0x16d9cf,_0x2007d9){_0x16d9cf=_0x16d9cf-0x0;var _0x58aa4e=_0x2a4b[_0x16d9cf];return _0x58aa4e;};'use strict';var client=require('../client');exports[_0xb2a4('0x0')]=function(){return client['Request'](_0xb2a4('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb2a4('0x2')]},'log':_0xb2a4('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b230227..3a1a477 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 _0x6eb9=['GetTemplate','../client','getTemplates','Request','name','html'];(function(_0x1dc421,_0x481d54){var _0x27ffa0=function(_0x341436){while(--_0x341436){_0x1dc421['push'](_0x1dc421['shift']());}};_0x27ffa0(++_0x481d54);}(_0x6eb9,0x1ed));var _0x96eb=function(_0x5b4615,_0x3fad71){_0x5b4615=_0x5b4615-0x0;var _0x44eb78=_0x6eb9[_0x5b4615];return _0x44eb78;};'use strict';var client=require(_0x96eb('0x0'));exports[_0x96eb('0x1')]=function(_0x4c3bc8){return function(_0x2cb3ca){return client[_0x96eb('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x96eb('0x3'),_0x96eb('0x4')]},'log':_0x96eb('0x5')});};}; \ No newline at end of file +var _0x3152=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0xf1b38a,_0x332f07){var _0x4bc197=function(_0x3e9329){while(--_0x3e9329){_0xf1b38a['push'](_0xf1b38a['shift']());}};_0x4bc197(++_0x332f07);}(_0x3152,0x147));var _0x2315=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x3152[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x2315('0x0'));exports[_0x2315('0x1')]=function(_0xd1a4af){return function(_0x239bb4){return client[_0x2315('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x2315('0x3'),_0x2315('0x4')]},'log':_0x2315('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 31db03c..7a3e51e 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 _0x411b=['AnyConditions','Action','Actions','data1','data3','data4','data6','data7','../client','Request','GetTrigger','name','channel','status','field','operator','value','Condition'];(function(_0x35c36a,_0x1562bc){var _0x42ec6d=function(_0x5e571f){while(--_0x5e571f){_0x35c36a['push'](_0x35c36a['shift']());}};_0x42ec6d(++_0x1562bc);}(_0x411b,0x1b8));var _0xb411=function(_0x5c4b5b,_0x2a9f1b){_0x5c4b5b=_0x5c4b5b-0x0;var _0x1cbf51=_0x411b[_0x5c4b5b];return _0x1cbf51;};'use strict';var client=require(_0xb411('0x0'));exports['getTriggers']=function(_0x3eb9cd){return function(_0x46d5d9){return client[_0xb411('0x1')](_0xb411('0x2'),{'options':{'raw':![],'attributes':['id',_0xb411('0x3'),_0xb411('0x4'),_0xb411('0x5')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0xb411('0x6'),_0xb411('0x7'),_0xb411('0x8')]},{'model':_0xb411('0x9'),'as':_0xb411('0xa'),'attributes':['id','field',_0xb411('0x7'),_0xb411('0x8')]},{'model':_0xb411('0xb'),'as':_0xb411('0xc'),'attributes':['id','action',_0xb411('0xd'),'data2',_0xb411('0xe'),_0xb411('0xf'),'data5',_0xb411('0x10'),_0xb411('0x11')]}]},'log':_0xb411('0x2')});};}; \ No newline at end of file +var _0x0c8a=['AnyConditions','Action','action','data2','data4','data5','data6','Request','GetTrigger','status','Condition','AllConditions','field','operator','value'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x0c8a,0x19c));var _0xa0c8=function(_0x276262,_0x12fe78){_0x276262=_0x276262-0x0;var _0x4c3ceb=_0x0c8a[_0x276262];return _0x4c3ceb;};'use strict';var client=require('../client');exports['getTriggers']=function(_0x48e6b0){return function(_0x567078){return client[_0xa0c8('0x0')](_0xa0c8('0x1'),{'options':{'raw':![],'attributes':['id','name','channel',_0xa0c8('0x2')],'include':[{'model':_0xa0c8('0x3'),'as':_0xa0c8('0x4'),'attributes':['id',_0xa0c8('0x5'),_0xa0c8('0x6'),_0xa0c8('0x7')]},{'model':_0xa0c8('0x3'),'as':_0xa0c8('0x8'),'attributes':['id',_0xa0c8('0x5'),_0xa0c8('0x6'),'value']},{'model':_0xa0c8('0x9'),'as':'Actions','attributes':['id',_0xa0c8('0xa'),'data1',_0xa0c8('0xb'),'data3',_0xa0c8('0xc'),_0xa0c8('0xd'),_0xa0c8('0xe'),'data7']}]},'log':_0xa0c8('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 1009202..32df7c2 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 _0x08ce=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x08ce,0x86));var _0xe08c=function(_0x1fbde3,_0x59da39){_0x1fbde3=_0x1fbde3-0x0;var _0x2b092f=_0x08ce[_0x1fbde3];return _0x2b092f;};'use strict';var client=require(_0xe08c('0x0'));exports[_0xe08c('0x1')]=function(_0x63738d){return function(_0x3bed89){return client[_0xe08c('0x2')](_0xe08c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe08c('0x4'),_0xe08c('0x5'),_0xe08c('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0xcee0=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xcee0,0x1e1));var _0x0cee=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0xcee0[_0x25d2fb];return _0x1ded53;};'use strict';var client=require(_0x0cee('0x0'));exports[_0x0cee('0x1')]=function(_0x3c80b7){return function(_0xdc43c7){return client[_0x0cee('0x2')](_0x0cee('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0cee('0x4'),_0x0cee('0x5'),_0x0cee('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index c0cbb3e..0a8e70f 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 _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x2f706c,_0x2b5f9b){var _0x32b562=function(_0x1f50d9){while(--_0x1f50d9){_0x2f706c['push'](_0x2f706c['shift']());}};_0x32b562(++_0x2b5f9b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xcb91[_0x30d87a];return _0x48f64b;};'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 +var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x532262,_0x11abd0){var _0x79af82=function(_0x9537cb){while(--_0x9537cb){_0x532262['push'](_0x532262['shift']());}};_0x79af82(++_0x11abd0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 71c9916..96966db 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 _0x30f1=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x6a2857,_0x507f15){var _0x32be04=function(_0x27c744){while(--_0x27c744){_0x6a2857['push'](_0x6a2857['shift']());}};_0x32be04(++_0x507f15);}(_0x30f1,0x150));var _0x130f=function(_0x547969,_0x28d7cf){_0x547969=_0x547969-0x0;var _0x53cce1=_0x30f1[_0x547969];return _0x53cce1;};'use strict';var client=require('../client');exports['create']=function(_0x245474){return client[_0x130f('0x0')](_0x130f('0x1'),{'body':_0x245474,'log':_0x130f('0x1')});};exports['update']=function(_0x3acdf6,_0x6e3d0e,_0x24865e){return client['Request'](_0x130f('0x2'),{'body':_0x3acdf6,'options':{'where':{'uniqueid':_0x6e3d0e,'interface':_0x24865e,'agentcomplete':!![]}},'log':_0x130f('0x2')});}; \ No newline at end of file +var _0x6f28=['../client','create','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x54b90d,_0x22c01c){var _0x8a5cae=function(_0x18f9ea){while(--_0x18f9ea){_0x54b90d['push'](_0x54b90d['shift']());}};_0x8a5cae(++_0x22c01c);}(_0x6f28,0x1e0));var _0x86f2=function(_0xbc4659,_0x578fba){_0xbc4659=_0xbc4659-0x0;var _0x5831f9=_0x6f28[_0xbc4659];return _0x5831f9;};'use strict';var client=require(_0x86f2('0x0'));exports[_0x86f2('0x1')]=function(_0x51d7c5){return client['Request'](_0x86f2('0x2'),{'body':_0x51d7c5,'log':_0x86f2('0x2')});};exports['update']=function(_0x1a3cdb,_0xbfa134,_0xd26d9a){return client['Request']('UpdateVoiceAgentReport',{'body':_0x1a3cdb,'options':{'where':{'uniqueid':_0xbfa134,'interface':_0xd26d9a,'agentcomplete':!![]}},'log':_0x86f2('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 3599daa..8e469a2 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 _0xdf35=['Request','CreateVoiceCallReport','merge','calleridnum','callerid','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','GetVoiceCallReports','util','lodash','../client','create'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0xdf35,0x178));var _0x5df3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xdf35[_0x4b055c];return _0x4b62bb;};'use strict';var moment=require('moment');var util=require(_0x5df3('0x0'));var _=require(_0x5df3('0x1'));var client=require(_0x5df3('0x2'));exports[_0x5df3('0x3')]=function(_0x3f9eac){return client[_0x5df3('0x4')](_0x5df3('0x5'),{'body':_[_0x5df3('0x6')](_0x3f9eac,{'source':_0x3f9eac[_0x5df3('0x7')],'destinationcontext':_0x3f9eac['context'],'callerid':_0x3f9eac[_0x5df3('0x8')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x5df3('0x9'),{'options':{'where':{'type':[_0x5df3('0xa')],'createdAt':{'$between':[moment()[_0x5df3('0xb')](_0x5df3('0xc'))[_0x5df3('0xd')](_0x5df3('0xe')),moment()[_0x5df3('0xf')]('day')[_0x5df3('0xd')](_0x5df3('0xe'))]}},'attributes':[_0x5df3('0x10'),_0x5df3('0x11'),'duration','billableseconds']},'log':_0x5df3('0x12')});};}; \ No newline at end of file +var _0xa211=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','startOf'];(function(_0x2bcc7d,_0x151cf8){var _0x434aad=function(_0x49ac17){while(--_0x49ac17){_0x2bcc7d['push'](_0x2bcc7d['shift']());}};_0x434aad(++_0x151cf8);}(_0xa211,0x6c));var _0x1a21=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa211[_0x4565bf];return _0x5610ba;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x1a21('0x0'));var client=require(_0x1a21('0x1'));exports['create']=function(_0x2b9403){return client[_0x1a21('0x2')]('CreateVoiceCallReport',{'body':_[_0x1a21('0x3')](_0x2b9403,{'source':_0x2b9403[_0x1a21('0x4')],'destinationcontext':_0x2b9403[_0x1a21('0x5')],'callerid':_0x2b9403[_0x1a21('0x6')],'amaflags':_0x1a21('0x7')}),'log':_0x1a21('0x8')});};exports[_0x1a21('0x9')]=function(){return function(){return client[_0x1a21('0x2')](_0x1a21('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x1a21('0xb')](_0x1a21('0xc'))[_0x1a21('0xd')](_0x1a21('0xe')),moment()[_0x1a21('0xf')](_0x1a21('0xc'))[_0x1a21('0xd')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x1a21('0x10'),_0x1a21('0x11'),_0x1a21('0x12')]},'log':_0x1a21('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index df7ddbe..97d7fb8 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 _0x5935=['CreateVoiceDialReport','../client','Request'];(function(_0xd413a4,_0x3120fe){var _0x9170f4=function(_0x5aa567){while(--_0x5aa567){_0xd413a4['push'](_0xd413a4['shift']());}};_0x9170f4(++_0x3120fe);}(_0x5935,0x1b7));var _0x5593=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x5935[_0x273dc5];return _0x46dae7;};'use strict';var client=require(_0x5593('0x0'));exports['create']=function(_0x50329f){return client[_0x5593('0x1')](_0x5593('0x2'),{'body':_0x50329f,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x922b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2199a8,_0x149c94){var _0x2c81f9=function(_0x337f05){while(--_0x337f05){_0x2199a8['push'](_0x2199a8['shift']());}};_0x2c81f9(++_0x149c94);}(_0x922b,0xd2));var _0xb922=function(_0x3b2642,_0x320357){_0x3b2642=_0x3b2642-0x0;var _0x154700=_0x922b[_0x3b2642];return _0x154700;};'use strict';var client=require(_0xb922('0x0'));exports[_0xb922('0x1')]=function(_0x1f6753){return client[_0xb922('0x2')](_0xb922('0x3'),{'body':_0x1f6753,'log':_0xb922('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 6da1640..942d1e2 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 _0x8164=['Request','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x795024,_0x121da5){var _0x1f5110=function(_0x251a23){while(--_0x251a23){_0x795024['push'](_0x795024['shift']());}};_0x1f5110(++_0x121da5);}(_0x8164,0x170));var _0x4816=function(_0x125eb3,_0x4171a9){_0x125eb3=_0x125eb3-0x0;var _0x1b19c5=_0x8164[_0x125eb3];return _0x1b19c5;};'use strict';var client=require(_0x4816('0x0'));exports[_0x4816('0x1')]=function(){return function(){return client[_0x4816('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x4816('0x3'),_0x4816('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x8130=['recordingFormat','../client','getVoiceExtensions','GetVoiceExtension','exten'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8130,0x146));var _0x0813=function(_0x2fee93,_0x351185){_0x2fee93=_0x2fee93-0x0;var _0x57b211=_0x8130[_0x2fee93];return _0x57b211;};'use strict';var client=require(_0x0813('0x0'));exports[_0x0813('0x1')]=function(){return function(){return client['Request'](_0x0813('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0813('0x3'),_0x0813('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x0813('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 341bc52..9e34141 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 _0x802a=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','active','Pause','mandatoryDispositionPause','Trunk','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x30a33c,_0x9d1dac){var _0x19509c=function(_0x421cff){while(--_0x421cff){_0x30a33c['push'](_0x30a33c['shift']());}};_0x19509c(++_0x9d1dac);}(_0x802a,0x66));var _0xa802=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x802a[_0x5a9c0c];return _0x53c77d;};'use strict';var client=require(_0xa802('0x0'));exports[_0xa802('0x1')]=function(){return function(){return client['Request'](_0xa802('0x2'),{'options':{'raw':![],'attributes':['id',_0xa802('0x3'),_0xa802('0x4'),_0xa802('0x5'),_0xa802('0x6'),_0xa802('0x7'),_0xa802('0x8'),_0xa802('0x9'),'dialMethod',_0xa802('0xa'),_0xa802('0xb'),'dialPowerLevel',_0xa802('0xc'),_0xa802('0xd'),_0xa802('0xe'),_0xa802('0xf'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0xa802('0x10'),_0xa802('0x11'),_0xa802('0x12'),'dialCongestionMaxRetry',_0xa802('0x13'),'dialBusyMaxRetry',_0xa802('0x14'),_0xa802('0x15'),_0xa802('0x16'),_0xa802('0x17'),_0xa802('0x18'),_0xa802('0x19'),_0xa802('0x1a'),_0xa802('0x1b'),_0xa802('0x1c'),'dialAMDInitialSilence',_0xa802('0x1d'),_0xa802('0x1e'),_0xa802('0x1f'),_0xa802('0x20'),_0xa802('0x21'),'dialAMDMaximumNumberOfWords',_0xa802('0x22'),_0xa802('0x23'),_0xa802('0x24'),'dialRecallMeTimeout',_0xa802('0x25'),'dialOrderByScheduledAt',_0xa802('0x26'),'dialAgiAfterHangupClient',_0xa802('0x27'),_0xa802('0x7'),_0xa802('0x28'),_0xa802('0x29'),'dialCutDigit',_0xa802('0x2a'),_0xa802('0x2b'),'dialDropMaxRetry',_0xa802('0x2c'),_0xa802('0x2d'),_0xa802('0x2e'),_0xa802('0x2f'),_0xa802('0x30'),_0xa802('0x31'),_0xa802('0x32'),_0xa802('0x33'),_0xa802('0x34'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xa802('0x3'),'callerid',_0xa802('0x35')]},{'model':_0xa802('0x36'),'as':_0xa802('0x37'),'attributes':['id',_0xa802('0x3')]},{'model':_0xa802('0x38'),'as':_0xa802('0x39'),'attributes':['id',_0xa802('0x3'),_0xa802('0x3a'),_0xa802('0x35')]},{'model':_0xa802('0x3b'),'as':_0xa802('0x3b'),'attributes':['id',_0xa802('0x3')],'include':[{'model':_0xa802('0x3b'),'as':_0xa802('0x3c'),'attributes':['id',_0xa802('0x3'),_0xa802('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x58d0=['interval','../client','getVoiceQueues','Request','GetVoiceQueue','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals'];(function(_0x449881,_0x88fdf4){var _0x204f62=function(_0x54d8ff){while(--_0x54d8ff){_0x449881['push'](_0x449881['shift']());}};_0x204f62(++_0x88fdf4);}(_0x58d0,0xbe));var _0x058d=function(_0x53bcfa,_0x20eb6e){_0x53bcfa=_0x53bcfa-0x0;var _0x25e64e=_0x58d0[_0x53bcfa];return _0x25e64e;};'use strict';var client=require(_0x058d('0x0'));exports[_0x058d('0x1')]=function(){return function(){return client[_0x058d('0x2')](_0x058d('0x3'),{'options':{'raw':![],'attributes':['id','name','acw',_0x058d('0x4'),_0x058d('0x5'),_0x058d('0x6'),_0x058d('0x7'),_0x058d('0x8'),_0x058d('0x9'),_0x058d('0xa'),_0x058d('0xb'),_0x058d('0xc'),_0x058d('0xd'),'dialPredictiveOptimizationPercentage',_0x058d('0xe'),_0x058d('0xf'),_0x058d('0x10'),_0x058d('0x11'),_0x058d('0x12'),_0x058d('0x13'),_0x058d('0x14'),_0x058d('0x15'),_0x058d('0x16'),_0x058d('0x17'),'dialBusyRetryFrequency',_0x058d('0x18'),_0x058d('0x19'),_0x058d('0x1a'),_0x058d('0x1b'),_0x058d('0x1c'),_0x058d('0x1d'),_0x058d('0x1e'),'dialAMDActive',_0x058d('0x1f'),_0x058d('0x20'),_0x058d('0x21'),_0x058d('0x22'),_0x058d('0x23'),_0x058d('0x24'),_0x058d('0x25'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0x058d('0x26'),'dialRecallMeTimeout',_0x058d('0x27'),_0x058d('0x28'),_0x058d('0x29'),'dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy',_0x058d('0x2a'),_0x058d('0x2b'),'dialNoSuchNumberMaxRetry',_0x058d('0x2c'),_0x058d('0x2d'),_0x058d('0x2e'),'dialAbandonedMaxRetry',_0x058d('0x2f'),'dialMachineMaxRetry',_0x058d('0x30'),_0x058d('0x31'),'dialAgentRejectRetryFrequency',_0x058d('0x32'),_0x058d('0x33'),_0x058d('0x34')],'include':[{'model':_0x058d('0x35'),'as':_0x058d('0x35'),'attributes':['id',_0x058d('0x36'),'callerid',_0x058d('0x37')]},{'model':_0x058d('0x38'),'as':_0x058d('0x39'),'attributes':['id',_0x058d('0x36')]},{'model':_0x058d('0x35'),'as':_0x058d('0x3a'),'attributes':['id',_0x058d('0x36'),_0x058d('0x3b'),_0x058d('0x37')]},{'model':'Interval','as':_0x058d('0x3c'),'attributes':['id',_0x058d('0x36')],'include':[{'model':_0x058d('0x3c'),'as':_0x058d('0x3d'),'attributes':['id','name',_0x058d('0x3e')]}]}]},'log':_0x058d('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 65c2119..8413088 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(_0x195b1c,_0x24e478){var _0x5ef65d=function(_0x453509){while(--_0x453509){_0x195b1c['push'](_0x195b1c['shift']());}};_0x5ef65d(++_0x24e478);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x32f8d0,_0x3bd972){var _0x51deed=function(_0x2c64b8){while(--_0x2c64b8){_0x32f8d0['push'](_0x32f8d0['shift']());}};_0x51deed(++_0x3bd972);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 608df57..c389ca0 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 _0x2b55=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x1151eb,_0x187715){var _0x2c661c=function(_0x2e0a61){while(--_0x2e0a61){_0x1151eb['push'](_0x1151eb['shift']());}};_0x2c661c(++_0x187715);}(_0x2b55,0x167));var _0x52b5=function(_0x355cb9,_0x36c176){_0x355cb9=_0x355cb9-0x0;var _0x11b868=_0x2b55[_0x355cb9];return _0x11b868;};'use strict';var client=require(_0x52b5('0x0'));exports[_0x52b5('0x1')]=function(_0x4d4e77){return function(){return client['Request'](_0x52b5('0x2'),{'options':{'where':{'VoiceQueueId':_0x4d4e77,'paused':!![]},'raw':!![]},'log':_0x52b5('0x1')});};}; \ No newline at end of file +var _0x798b=['Request','GetVoiceQueueRtPauses'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x798b,0x144));var _0xb798=function(_0x301f12,_0x479fed){_0x301f12=_0x301f12-0x0;var _0x9b139e=_0x798b[_0x301f12];return _0x9b139e;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x494dbf){return function(){return client[_0xb798('0x0')](_0xb798('0x1'),{'options':{'where':{'VoiceQueueId':_0x494dbf,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index d69bad0..d80728b 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(_0x253ba5,_0x2b7290){var _0x23dea6=function(_0xb51277){while(--_0xb51277){_0x253ba5['push'](_0x253ba5['shift']());}};_0x23dea6(++_0x2b7290);}(_0x7a54,0x106));var _0x47a5=function(_0x264b12,_0x477c67){_0x264b12=_0x264b12-0x0;var _0x4a5042=_0x7a54[_0x264b12];return _0x4a5042;};'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(_0xcb9de2,_0x5e2d74){var _0x16d745=function(_0x1a9709){while(--_0x1a9709){_0xcb9de2['push'](_0xcb9de2['shift']());}};_0x16d745(++_0x5e2d74);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 df42d2e..af8f417 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 _0x9d4d=['origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','origtransferercontext','origtransfererexten','attended','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','transfereelinkedid','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename'];(function(_0x4dbda2,_0xfe3c81){var _0x407ed9=function(_0x5e5700){while(--_0x5e5700){_0x4dbda2['push'](_0x4dbda2['shift']());}};_0x407ed9(++_0xfe3c81);}(_0x9d4d,0x12a));var _0xd9d4=function(_0x191ad2,_0x153718){_0x191ad2=_0x191ad2-0x0;var _0x238dee=_0x9d4d[_0x191ad2];return _0x238dee;};'use strict';var client=require('../client');exports['transfers']={};exports['blindTransfer']=function(_0xe11714){return client[_0xd9d4('0x0')](_0xd9d4('0x1'),{'body':{'result':_0xe11714[_0xd9d4('0x2')],'transfererchannel':_0xe11714['transfererchannel'],'transferercalleridnum':_0xe11714[_0xd9d4('0x3')],'transferercalleridname':_0xe11714['transferercalleridname'],'transfererconnectedlinenum':_0xe11714[_0xd9d4('0x4')],'transfererconnectedlinename':_0xe11714[_0xd9d4('0x5')],'transfereraccountcode':_0xe11714['transfereraccountcode'],'transferercontext':_0xe11714[_0xd9d4('0x6')],'transfererexten':_0xe11714[_0xd9d4('0x7')],'transfererlinkedid':_0xe11714[_0xd9d4('0x8')],'transfereechannel':_0xe11714[_0xd9d4('0x9')],'transfereecalleridnum':_0xe11714['transfereecalleridnum'],'transfereecalleridname':_0xe11714[_0xd9d4('0xa')],'transfereeconnectedlinenum':_0xe11714[_0xd9d4('0xb')],'transfereeconnectedlinename':_0xe11714[_0xd9d4('0xc')],'transfereeaccountcode':_0xe11714['transfereeaccountcode'],'transfereecontext':_0xe11714['transfereecontext'],'transfereeexten':_0xe11714[_0xd9d4('0xd')],'transfereelinkedid':_0xe11714[_0xd9d4('0xe')],'isexternal':_0xe11714['isexternal'],'context':_0xe11714['context'],'extension':_0xe11714[_0xd9d4('0xf')],'type':_0xd9d4('0x10')},'log':_0xd9d4('0x1')});};exports[_0xd9d4('0x11')]=function(_0x1c18d3){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x1c18d3['result'],'transfererchannel':_0x1c18d3['origtransfererchannel'],'transferercalleridnum':_0x1c18d3[_0xd9d4('0x12')],'transferercalleridname':_0x1c18d3[_0xd9d4('0x13')],'transfererconnectedlinenum':_0x1c18d3[_0xd9d4('0x14')],'transfererconnectedlinename':_0x1c18d3[_0xd9d4('0x15')],'transfereraccountcode':_0x1c18d3[_0xd9d4('0x16')],'transferercontext':_0x1c18d3['secondtransferercontext'],'transfererexten':_0x1c18d3[_0xd9d4('0x17')],'transfererlinkedid':_0x1c18d3['origtransfererlinkedid'],'transfereechannel':_0x1c18d3[_0xd9d4('0x18')],'transfereecalleridnum':_0x1c18d3[_0xd9d4('0x19')],'transfereecalleridname':_0x1c18d3[_0xd9d4('0x1a')],'transfereeconnectedlinenum':_0x1c18d3[_0xd9d4('0x1b')],'transfereeconnectedlinename':_0x1c18d3[_0xd9d4('0x1c')],'transfereeaccountcode':_0x1c18d3['transfertargetaccountcode'],'transfereecontext':_0x1c18d3['transfertargetcontext'],'transfereeexten':_0x1c18d3['transfertargetexten'],'transfereelinkedid':_0x1c18d3['transfertargetlinkedid'],'isexternal':_0x1c18d3['isexternal'],'context':_0x1c18d3[_0xd9d4('0x1d')],'extension':_0x1c18d3[_0xd9d4('0x1e')],'type':_0xd9d4('0x1f')},'log':_0xd9d4('0x1')});}; \ No newline at end of file +var _0x0830=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','transfers','blindTransfer','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','CreateVoiceTransferReport','origtransfererchannel'];(function(_0x1e09a4,_0x4db402){var _0x40b895=function(_0x5517fb){while(--_0x5517fb){_0x1e09a4['push'](_0x1e09a4['shift']());}};_0x40b895(++_0x4db402);}(_0x0830,0x1f1));var _0x0083=function(_0x22d7e6,_0xa620e7){_0x22d7e6=_0x22d7e6-0x0;var _0x72bc58=_0x0830[_0x22d7e6];return _0x72bc58;};'use strict';var client=require(_0x0083('0x0'));exports[_0x0083('0x1')]={};exports[_0x0083('0x2')]=function(_0x423582){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x423582[_0x0083('0x3')],'transfererchannel':_0x423582[_0x0083('0x4')],'transferercalleridnum':_0x423582[_0x0083('0x5')],'transferercalleridname':_0x423582[_0x0083('0x6')],'transfererconnectedlinenum':_0x423582[_0x0083('0x7')],'transfererconnectedlinename':_0x423582['transfererconnectedlinename'],'transfereraccountcode':_0x423582[_0x0083('0x8')],'transferercontext':_0x423582[_0x0083('0x9')],'transfererexten':_0x423582[_0x0083('0xa')],'transfererlinkedid':_0x423582[_0x0083('0xb')],'transfereechannel':_0x423582[_0x0083('0xc')],'transfereecalleridnum':_0x423582[_0x0083('0xd')],'transfereecalleridname':_0x423582[_0x0083('0xe')],'transfereeconnectedlinenum':_0x423582[_0x0083('0xf')],'transfereeconnectedlinename':_0x423582[_0x0083('0x10')],'transfereeaccountcode':_0x423582['transfereeaccountcode'],'transfereecontext':_0x423582[_0x0083('0x11')],'transfereeexten':_0x423582[_0x0083('0x12')],'transfereelinkedid':_0x423582[_0x0083('0x13')],'isexternal':_0x423582['isexternal'],'context':_0x423582[_0x0083('0x14')],'extension':_0x423582['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x139414){return client['Request'](_0x0083('0x15'),{'body':{'result':_0x139414[_0x0083('0x3')],'transfererchannel':_0x139414[_0x0083('0x16')],'transferercalleridnum':_0x139414[_0x0083('0x17')],'transferercalleridname':_0x139414[_0x0083('0x18')],'transfererconnectedlinenum':_0x139414['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x139414[_0x0083('0x19')],'transfereraccountcode':_0x139414[_0x0083('0x1a')],'transferercontext':_0x139414[_0x0083('0x1b')],'transfererexten':_0x139414['secondtransfererexten'],'transfererlinkedid':_0x139414[_0x0083('0x1c')],'transfereechannel':_0x139414[_0x0083('0x1d')],'transfereecalleridnum':_0x139414['transfertargetcalleridnum'],'transfereecalleridname':_0x139414[_0x0083('0x1e')],'transfereeconnectedlinenum':_0x139414[_0x0083('0x1f')],'transfereeconnectedlinename':_0x139414[_0x0083('0x20')],'transfereeaccountcode':_0x139414[_0x0083('0x21')],'transfereecontext':_0x139414[_0x0083('0x22')],'transfereeexten':_0x139414[_0x0083('0x23')],'transfereelinkedid':_0x139414[_0x0083('0x24')],'isexternal':_0x139414[_0x0083('0x25')],'context':_0x139414[_0x0083('0x26')],'extension':_0x139414['origtransfererexten'],'type':_0x0083('0x27')},'log':_0x0083('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 730d168..1790091 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 _0x1115=['monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','stop','%s.%s','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','run','event','custom:','faxAccounts','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','Reload','Action','then','message','catch','pick','command','Command','content','voiceQueues','hasOwnProperty','name','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','waiting','type','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','voicechannel','map','channels','uniqueid','channel','filename','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase'];(function(_0x24c724,_0x46d96b){var _0x2a0c69=function(_0x3bb054){while(--_0x3bb054){_0x24c724['push'](_0x24c724['shift']());}};_0x2a0c69(++_0x46d96b);}(_0x1115,0x1b6));var _0x5111=function(_0x508e46,_0x5be010){_0x508e46=_0x508e46-0x0;var _0x450bdc=_0x1115[_0x508e46];return _0x450bdc;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var jayson=require(_0x5111('0x1'));var schema=require(_0x5111('0x2'));var BPromise=require(_0x5111('0x3'));var moment=require(_0x5111('0x4'));var config=require(_0x5111('0x5'));var properties=require(_0x5111('0x6'));var ami=require(_0x5111('0x7'));exports[_0x5111('0x8')]=function(_0x4b0f15,_0x5981cb,_0x467c3a){return new BPromise(function(_0x115ba7,_0x50f0a3){var _0x400661={'QueuePause':function(_0x2d2777){return new Promise(function(_0x54d5ae,_0x42a3c5){var _0x5e629a=util[_0x5111('0x9')](_0x5111('0xa'),'SIP',_0x2d2777['name']);if(_0x4b0f15[_0x5111('0xb')]&&_0x4b0f15['timers'][_0x5e629a]&&_0x4b0f15[_0x5111('0xb')][_0x5e629a]['timer']){_0x4b0f15[_0x5111('0xb')][_0x5e629a][_0x5111('0xc')]();}if(_0x4b0f15[_0x5111('0xd')][_0x5e629a]){_0x4b0f15[_0x5111('0xd')][_0x5e629a][_0x5111('0xe')]({'statePause':_0x2d2777[_0x5111('0xf')]?!![]:![]});}_0x54d5ae({'code':0xc8,'message':_0x5111('0x10')});});},'Reload':function(_0x14b4e3){var _0x1e335f=this;return new Promise(function(_0x10e3c4,_0x38af76){if(ami[_0x5111('0x11')]()==![]){return _0x38af76(_0x1e335f[_0x5111('0x12')](0x1f4,[config[_0x5111('0x13')]['ip'],config[_0x5111('0x13')][_0x5111('0x14')],_0x5111('0x15')][_0x5111('0x16')]('\x20')));}_0x14b4e3=_['pick'](_0x14b4e3,_[_0x5111('0x17')](properties['module']));_0x14b4e3['action']=_0x5111('0x18');return ami[_0x5111('0x19')](_0x14b4e3)[_0x5111('0x1a')](function(_0x51ce4a){_0x10e3c4({'code':0xc8,'message':_0x51ce4a[_0x5111('0x1b')]});})[_0x5111('0x1c')](function(_0x52c614){_0x38af76(_0x1e335f[_0x5111('0x12')](0x1f5,_0x52c614[_0x5111('0x1b')]));});});},'Command':function(_0x28f24b){var _0x1b3b45=this;return new Promise(function(_0x5e8f1d,_0x52d236){if(ami[_0x5111('0x11')]()==![]){return _0x52d236(_0x1b3b45[_0x5111('0x12')](0x1f4,[config[_0x5111('0x13')]['ip'],config[_0x5111('0x13')][_0x5111('0x14')],_0x5111('0x15')][_0x5111('0x16')]('\x20')));}_0x28f24b=_[_0x5111('0x1d')](_0x28f24b,_0x5111('0x1e'));_0x28f24b['action']=_0x5111('0x1f');return ami[_0x5111('0x19')](_0x28f24b)[_0x5111('0x1a')](function(_0x5bf534){_0x5e8f1d({'code':0xc8,'message':_0x5bf534[_0x5111('0x20')]});})[_0x5111('0x1c')](function(_0x2d9446){_0x52d236(_0x1b3b45[_0x5111('0x12')](0x1f5,_0x2d9446[_0x5111('0x1b')]));});});},'VoiceQueues':function(_0x33fea2){return new Promise(function(_0x5990,_0x316b39){var _0x382bd0=[];for(var _0x1a5793 in _0x4b0f15['voiceQueues']){if(_0x4b0f15[_0x5111('0x21')][_0x5111('0x22')](_0x1a5793)){var _0x151b67=_0x4b0f15[_0x5111('0x21')][_0x1a5793];var _0x265149={'id':_0x151b67['id'],'name':_0x151b67[_0x5111('0x23')],'strategy':_0x151b67[_0x5111('0x24')],'answered':_0x151b67['answered'],'available':_0x151b67[_0x5111('0x25')],'loggedIn':_0x151b67[_0x5111('0x26')],'pTalking':_0x151b67[_0x5111('0x27')],'sumBillable':_0x151b67['sumBillable'],'sumDuration':_0x151b67[_0x5111('0x28')],'sumHoldTime':_0x151b67[_0x5111('0x29')]||0x0,'talking':_0x151b67[_0x5111('0x2a')],'total':_0x151b67['total'],'type':_0x151b67['type'],'unmanaged':_0x151b67[_0x5111('0x2b')],'abandoned':_0x151b67['abandoned'],'waiting':_0x151b67[_0x5111('0x2c')],'loggedInDb':_0x151b67['loggedInDb']};if(_0x151b67[_0x5111('0x2d')]==='outbound'){_0x265149['dialActive']=_0x151b67['dialActive'];_0x265149[_0x5111('0x2e')]=_0x151b67[_0x5111('0x2e')];_0x265149[_0x5111('0x2f')]=_0x151b67[_0x5111('0x2f')];_0x265149[_0x5111('0x30')]=_0x151b67[_0x5111('0x30')];_0x265149[_0x5111('0x31')]=_0x151b67['dialOriginateTimeout'];_0x265149[_0x5111('0x32')]=_0x151b67[_0x5111('0x32')];_0x265149[_0x5111('0x33')]=_0x151b67[_0x5111('0x33')];_0x265149['outboundAnswerAgiCallsDay']=_0x151b67['outboundAnswerAgiCallsDay'];_0x265149[_0x5111('0x34')]=_0x151b67[_0x5111('0x34')];_0x265149[_0x5111('0x35')]=_0x151b67[_0x5111('0x35')];_0x265149[_0x5111('0x36')]=_0x151b67[_0x5111('0x36')];_0x265149[_0x5111('0x37')]=_0x151b67[_0x5111('0x37')];_0x265149['outboundDropCallsDayACS']=_0x151b67[_0x5111('0x38')];_0x265149[_0x5111('0x39')]=_0x151b67[_0x5111('0x39')];_0x265149['outboundDropCallsDayTimeout']=_0x151b67[_0x5111('0x3a')];_0x265149[_0x5111('0x3b')]=_0x151b67[_0x5111('0x3b')];_0x265149['outboundNoSuchCallsDay']=_0x151b67['outboundNoSuchCallsDay'];_0x265149['outboundOriginateFailureCallsDay']=_0x151b67[_0x5111('0x3c')];_0x265149[_0x5111('0x3d')]=_0x151b67[_0x5111('0x3d')];_0x265149[_0x5111('0x3e')]=_0x151b67[_0x5111('0x3e')];_0x265149['outboundUnknownCallsDay']=_0x151b67[_0x5111('0x3f')];_0x265149[_0x5111('0x40')]=_0x151b67[_0x5111('0x40')];_0x265149[_0x5111('0x41')]=_0x151b67['predictiveIntervalAvgHoldtime'];_0x265149[_0x5111('0x42')]=_0x151b67[_0x5111('0x42')];_0x265149[_0x5111('0x43')]=_0x151b67[_0x5111('0x43')];_0x265149[_0x5111('0x44')]=_0x151b67[_0x5111('0x44')];_0x265149[_0x5111('0x45')]=_0x151b67[_0x5111('0x45')];_0x265149[_0x5111('0x46')]=_0x151b67[_0x5111('0x46')];_0x265149[_0x5111('0x47')]=_0x151b67[_0x5111('0x47')];_0x265149[_0x5111('0x48')]=_0x151b67['predictiveIntervalMultiplicativeFactor'];_0x265149[_0x5111('0x49')]=_0x151b67[_0x5111('0x49')];_0x265149['predictiveIntervalAvailable']=_0x151b67[_0x5111('0x4a')];_0x265149[_0x5111('0x4b')]=_0x151b67[_0x5111('0x4b')];_0x265149[_0x5111('0x1b')]=_0x151b67[_0x5111('0x1b')];_0x265149[_0x5111('0x4c')]=_0x151b67[_0x5111('0x4c')];_0x265149['erlangCalls']=_0x151b67[_0x5111('0x4d')];_0x265149[_0x5111('0x4e')]=_0x151b67[_0x5111('0x4e')];_0x265149[_0x5111('0x4f')]=_0x151b67[_0x5111('0x4f')];_0x265149['erlangBusyFactor']=_0x151b67['erlangBusyFactor'];_0x265149[_0x5111('0x50')]=_0x151b67[_0x5111('0x50')];_0x265149['startProgressive']=_0x151b67[_0x5111('0x51')];}if(_0x151b67[_0x5111('0x52')]){_0x265149[_0x5111('0x52')]={'id':_0x151b67[_0x5111('0x52')]['id'],'name':_0x151b67[_0x5111('0x52')][_0x5111('0x23')],'active':_0x151b67[_0x5111('0x52')][_0x5111('0x53')],'callerid':_0x151b67[_0x5111('0x52')][_0x5111('0x54')]};}if(_0x151b67['Interval']){_0x265149['Interval']={'id':_0x151b67[_0x5111('0x55')]['id'],'name':_0x151b67[_0x5111('0x55')][_0x5111('0x23')]};}_0x382bd0[_0x5111('0x56')](_0x265149);}}_0x5990({'count':_0x382bd0[_0x5111('0x57')],'rows':_0x382bd0});});},'UpdateVoiceQueue':function(_0x4ff01a){return new Promise(function(_0x546968,_0x1b9a74){var _0x1110fc=_[_0x5111('0x58')](_0x4b0f15[_0x5111('0x21')],{'id':parseInt(_0x4ff01a['id'])});var _0x5d5b0b=_[_0x5111('0x59')](_0x4ff01a,['id']);if(_0x1110fc){for(var _0x135993 in _0x5d5b0b){if(typeof _0x5d5b0b[_0x135993]!==_0x5111('0x5a')&&typeof _0x1110fc[_0x135993]!=='undefined'){_0x1110fc[_0x135993]=_0x5d5b0b[_0x135993];}}_0x546968(_0x1110fc);}else{_0x1b9a74();}});},'VoiceChannels':function(_0x2c1dcc){return new Promise(function(_0x3e88e2,_0x226eb8){var _0x2d64de=_['values'](_0x4b0f15['channels']);_0x3e88e2({'count':_0x2d64de[_0x5111('0x57')],'rows':_0x2d64de});});},'VoiceChannelMixMonitor':function(_0x5dddfb){var _0x545f71=this;return new Promise(function(_0x333e5a,_0x1ef508){if(ami['isConnected']()==![]){return _0x1ef508(_0x545f71[_0x5111('0x12')](0x1f4,[config[_0x5111('0x13')]['ip'],config[_0x5111('0x13')][_0x5111('0x14')],_0x5111('0x15')][_0x5111('0x16')]('\x20')));}var _0x3b4c5c=schema(properties[_0x5111('0x5b')])[_0x5111('0x2')](_0x5dddfb);if(_0x3b4c5c[_0x5111('0x57')]>0x0){return _0x1ef508(_0x545f71[_0x5111('0x12')](0x1f4,_[_0x5111('0x5c')](_0x3b4c5c,'message')[_0x5111('0x16')](',\x20')));}var _0x29636d=_[_0x5111('0x58')](_0x4b0f15[_0x5111('0x5d')],{'uniqueid':_0x5dddfb[_0x5111('0x5e')]});if(_0x29636d&&_0x29636d[_0x5111('0x5f')]){var _0x358dfa=util['format']('%s.%s',_0x5dddfb[_0x5111('0x60')]||_0x5dddfb['uniqueid'],_0x5dddfb[_0x5111('0x9')]||_0x5111('0x61'));return ami[_0x5111('0x19')]({'action':_0x5111('0x62'),'channel':_0x29636d[_0x5111('0x5f')],'file':_0x358dfa,'options':_0x5111('0x63')})[_0x5111('0x1a')](function(_0x520e80){var _0x2c92f6=_[_0x5111('0x58')](_0x29636d['monitors'],{'filename':_0x5111('0x64')+_0x358dfa[_0x5111('0x65')]()});if(_['isNil'](_0x2c92f6)){_0x29636d[_0x5111('0x66')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x358dfa['toLowerCase'](),'createdAt':moment()[_0x5111('0x9')](_0x5111('0x67')),'mixmonitorid':_0x520e80[_0x5111('0x68')],'status':_0x5111('0x69')});}else{_0x2c92f6['mixmonitorid']=_0x520e80[_0x5111('0x68')];_0x2c92f6[_0x5111('0x6a')]=_0x5111('0x69');}_0x333e5a({'code':0xc8,'message':[_0x5dddfb['uniqueid'],_0x5111('0x6b'),_0x520e80[_0x5111('0x68')]][_0x5111('0x16')]('\x20'),'mixmonitorid':_0x520e80['mixmonitorid']});})[_0x5111('0x1c')](function(_0x555d63){_0x1ef508(_0x545f71[_0x5111('0x12')](0x1f5,[_0x5dddfb[_0x5111('0x5e')],_0x555d63[_0x5111('0x1b')][_0x5111('0x65')]()]['join']('\x20')));});}else{return _0x1ef508(_0x545f71[_0x5111('0x12')](0x1f5,_0x5111('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x2fa75c){var _0x3b3e75=this;return new Promise(function(_0x2b07ae,_0x438db3){if(ami[_0x5111('0x11')]()==![]){return _0x438db3(_0x3b3e75['error'](0x1f4,[config[_0x5111('0x13')]['ip'],config['asterisk'][_0x5111('0x14')],_0x5111('0x15')][_0x5111('0x16')]('\x20')));}var _0x1a3bfb=schema(properties[_0x5111('0x5b')])[_0x5111('0x2')](_0x2fa75c);if(_0x1a3bfb['length']>0x0){return _0x438db3(_0x3b3e75[_0x5111('0x12')](0x1f4,_[_0x5111('0x5c')](_0x1a3bfb,_0x5111('0x1b'))[_0x5111('0x16')](',\x20')));}var _0x3384ee=_[_0x5111('0x58')](_0x4b0f15['channels'],{'uniqueid':_0x2fa75c[_0x5111('0x5e')]});if(_0x3384ee){return BPromise[_0x5111('0x6d')]()[_0x5111('0x1a')](function(){if(_0x3384ee[_0x5111('0x5f')]){return ami[_0x5111('0x19')]({'action':'StopMixMonitor','channel':_0x3384ee[_0x5111('0x5f')],'mixmonitorid':_0x2fa75c[_0x5111('0x68')]})[_0x5111('0x1c')](function(_0x16b59f){});}})[_0x5111('0x1a')](function(){if(_0x3384ee[_0x5111('0x6e')]){return ami[_0x5111('0x19')]({'action':'StopMixMonitor','channel':_0x3384ee['destinationchannel'],'mixmonitorid':_0x2fa75c['mixmonitorid']})[_0x5111('0x1c')](function(_0x36d533){});}})[_0x5111('0x1a')](function(_0x3fb713){var _0x12b8a9=_['find'](_0x3384ee[_0x5111('0x66')],{'mixmonitorid':_0x2fa75c[_0x5111('0x68')]});if(_0x12b8a9){_0x12b8a9[_0x5111('0x6a')]=_0x5111('0x6f');}})[_0x5111('0x1a')](function(){var _0x421f33=util[_0x5111('0x9')](_0x5111('0x70'),_0x2fa75c[_0x5111('0x60')]||_0x2fa75c[_0x5111('0x5e')],_0x2fa75c['format']||_0x5111('0x61'));var _0x8cf274=_['find'](_0x3384ee[_0x5111('0x66')],{'filename':_0x5111('0x64')+_0x421f33['toLowerCase']()});if(_0x8cf274){_0x8cf274[_0x5111('0x6a')]=_0x5111('0x6f');}})[_0x5111('0x1a')](function(){_0x2b07ae({'code':0xc8,'message':[_0x2fa75c[_0x5111('0x5e')],_0x5111('0x71')][_0x5111('0x16')]('\x20')});})[_0x5111('0x1c')](function(_0x573c8a){_0x438db3(_0x3b3e75[_0x5111('0x12')](0x1f5,[_0x2fa75c['uniqueid'],_0x573c8a['message'][_0x5111('0x65')]()]['join']('\x20')));});}else{return _0x438db3(_0x3b3e75[_0x5111('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x24420b){return new Promise(function(_0x206442,_0x10cb46){var _0x2fa175=_[_0x5111('0x72')](_0x4b0f15[_0x5111('0x73')]);_0x206442({'count':_0x2fa175[_0x5111('0x57')],'rows':_0x2fa175});});},'VoiceQueuesChannel':function(_0xf39b30){var _0x3ad8f7=this;return new Promise(function(_0x1da35e,_0x8e6ddb){var _0x25f691=schema(properties[_0x5111('0x74')])['validate'](_0xf39b30);if(_0x25f691[_0x5111('0x57')]>0x0){return _0x8e6ddb(_0x3ad8f7['error'](0x1f4,_[_0x5111('0x5c')](_0x25f691,'message')[_0x5111('0x16')](',\x20')));}var _0x372196=_[_0x5111('0x58')](_0x4b0f15[_0x5111('0x73')],{'uniqueid':_0xf39b30[_0x5111('0x5e')]});if(_0x372196){_0x1da35e(_0x372196);}else{return _0x8e6ddb(_0x3ad8f7['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x472e24){var _0x57bfaa=this;return new Promise(function(_0x4fe598,_0x4173e7){if(ami[_0x5111('0x11')]()==![]){return _0x4173e7(_0x57bfaa[_0x5111('0x12')](0x1f4,[config[_0x5111('0x13')]['ip'],config[_0x5111('0x13')][_0x5111('0x14')],'ami\x20disconnected'][_0x5111('0x16')]('\x20')));}var _0x400147=schema(properties['voicequeuechannelhangup'])[_0x5111('0x2')](_0x472e24);if(_0x400147['length']>0x0){return _0x4173e7(_0x57bfaa[_0x5111('0x12')](0x1f4,_[_0x5111('0x5c')](_0x400147,_0x5111('0x1b'))[_0x5111('0x16')](',\x20')));}var _0x56d3a8=_[_0x5111('0x58')](_0x4b0f15['queueChannels'],{'uniqueid':_0x472e24[_0x5111('0x5e')]});if(_0x56d3a8&&_0x56d3a8['channel']){return ami[_0x5111('0x19')]({'action':_0x5111('0x75'),'channel':_0x56d3a8[_0x5111('0x5f')]})[_0x5111('0x1a')](function(_0x44bd8d){_0x4fe598({'code':0xc8,'message':[_0x472e24[_0x5111('0x5e')],_0x44bd8d[_0x5111('0x1b')][_0x5111('0x65')]()]['join']('\x20')});})[_0x5111('0x1c')](function(_0x378529){_0x4173e7(_0x57bfaa[_0x5111('0x12')](0x1f5,[_0x472e24[_0x5111('0x5e')],_0x378529[_0x5111('0x1b')]['toLowerCase']()][_0x5111('0x16')]('\x20')));});}else{return _0x4173e7(_0x57bfaa[_0x5111('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x20a26d){var _0x2c66d1=this;return new Promise(function(_0x24b95b,_0x52d1e5){if(ami[_0x5111('0x11')]()==![]){return _0x52d1e5(_0x2c66d1[_0x5111('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x5111('0x13')]['username'],_0x5111('0x15')]['join']('\x20')));}var _0x27dd95=schema(properties[_0x5111('0x76')])[_0x5111('0x2')](_0x20a26d);if(_0x27dd95[_0x5111('0x57')]>0x0){return _0x52d1e5(_0x2c66d1['error'](0x1f4,_[_0x5111('0x5c')](_0x27dd95,_0x5111('0x1b'))[_0x5111('0x16')](',\x20')));}var _0x3c9759=_[_0x5111('0x58')](_0x4b0f15[_0x5111('0x73')],{'uniqueid':_0x20a26d[_0x5111('0x5e')]});if(_0x3c9759&&_0x3c9759[_0x5111('0x5f')]){return ami[_0x5111('0x19')]({'action':_0x5111('0x77'),'channel':_0x3c9759['channel'],'exten':_0x20a26d[_0x5111('0x78')],'context':_0x20a26d[_0x5111('0x79')]||_0x3c9759['context'],'priority':0x1})[_0x5111('0x1a')](function(_0x1c2bde){_0x24b95b({'code':0xc8,'message':[_0x20a26d['uniqueid'],_0x1c2bde['message']['toLowerCase']()][_0x5111('0x16')]('\x20')});})[_0x5111('0x1c')](function(_0x48920f){_0x52d1e5(_0x2c66d1[_0x5111('0x12')](0x1f5,[_0x20a26d[_0x5111('0x5e')],_0x48920f['message'][_0x5111('0x65')]()][_0x5111('0x16')]('\x20')));});}else{return _0x52d1e5(_0x2c66d1[_0x5111('0x12')](0x1f5,_0x5111('0x6c')));}});},'Agents':function(_0x3d0145){return new Promise(function(_0x779d7f,_0x4cbf35){var _0x100014=_[_0x5111('0x72')](_0x4b0f15[_0x5111('0xd')]);_0x779d7f({'count':_0x100014[_0x5111('0x57')],'rows':_0x100014});});},'Telephones':function(_0x1dfb7b){return new Promise(function(_0x5bf72f,_0x1efb6a){var _0x44d27d=_[_0x5111('0x72')](_0x4b0f15[_0x5111('0x7a')]);_0x5bf72f({'count':_0x44d27d[_0x5111('0x57')],'rows':_0x44d27d});});},'Trunks':function(_0x37b860){return new Promise(function(_0x1ad170,_0x55426a){var _0x5a95a4=_[_0x5111('0x72')](_0x4b0f15[_0x5111('0x7b')]);_0x1ad170({'count':_0x5a95a4[_0x5111('0x57')],'rows':_0x5a95a4});});},'OutboundChannels':function(_0x27c950){return new Promise(function(_0x19b43f,_0x1c09a2){var _0x17c142=_[_0x5111('0x72')](_0x4b0f15[_0x5111('0x7c')]);_0x19b43f({'count':_0x17c142[_0x5111('0x57')],'rows':_0x17c142});});},'Outbound':function(_0x1e5d84){return new Promise(function(_0x48db8d,_0x1f9d67){_0x48db8d(_0x4b0f15[_0x5111('0x7d')]);});},'Campaigns':function(_0x4fc954){return new Promise(function(_0x1f4c53,_0xc258c0){var _0xc3780d=_[_0x5111('0x72')](_0x4b0f15['campaigns']);_0x1f4c53({'count':_0xc3780d[_0x5111('0x57')],'rows':_0xc3780d});});},'VoiceQueuesPreview':function(_0xbb17d7){var _0x5f0338=this;return new Promise(function(_0x49870a,_0x1688f3){_0x5981cb[_0x5111('0x7e')](_0xbb17d7['id'])[_0x5111('0x1a')](function(_0x22a4c9){_0x49870a({'code':0xc8,'message':_0x22a4c9['message']});})[_0x5111('0x1c')](function(_0x9fc4ce){_0x1688f3(_0x5f0338[_0x5111('0x12')](0x1f4,_0x9fc4ce[_0x5111('0x1b')]));});});},'EventManager':function(_0x2623a6){var _0x3dbec0=this;return new Promise(function(_0x3cffcb,_0x4de1b3){if(!_0x2623a6[_0x5111('0x7f')]){return _0x4de1b3(_0x3dbec0[_0x5111('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x5111('0x80')+_0x2623a6[_0x5111('0x7f')],_0x2623a6[_0x5111('0x1b')]);_0x3cffcb({'code':0xc8,'message':_0x2623a6});});},'FaxAccounts':function(_0x47b98d){return new Promise(function(_0x4a5b3e,_0x2e99a4){var _0x410bc4=_['values'](_0x4b0f15[_0x5111('0x81')]);_0x4a5b3e({'count':_0x410bc4[_0x5111('0x57')],'rows':_0x410bc4});});},'SendFax':function(_0x18cf2a){var _0x46ca55=this;return new Promise(function(_0x130b3f,_0x471791){_0x467c3a['send'](_0x18cf2a)['then'](function(_0x5736b4){_0x130b3f({'code':0xc8,'message':_0x5736b4[_0x5111('0x1b')]});})['catch'](function(_0x28fc7e){_0x471791(_0x46ca55['error'](0x1f4,_0x28fc7e[_0x5111('0x1b')]));});});},'CheckAfterSend':function(_0x28a264){var _0x36757e=this;return new Promise(function(_0x15ea65,_0x2665ae){_0x467c3a[_0x5111('0x82')](_0x28a264)['then'](function(_0x9b1f58){_0x15ea65({'code':0xc8,'message':_0x9b1f58['message']});})[_0x5111('0x1c')](function(_0x59fdce){_0x2665ae(_0x36757e['error'](0x1f4,_0x59fdce[_0x5111('0x1b')]));});});}};var _0x5b0d12=jayson['server'](_0x400661)[_0x5111('0x83')]();_0x5b0d12['on'](_0x5111('0x12'),function(_0xb8920){return _0x50f0a3(_0xb8920);});_0x5b0d12[_0x5111('0x8')](0x232a,_0x5111('0x84'),function(){console[_0x5111('0x85')](_0x5111('0x86'),0x232a);return _0x115ba7('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xee2c=['Interval','push','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','Action','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','then','message','catch','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid'];(function(_0x121bd7,_0xcfe60e){var _0x429966=function(_0x2bb384){while(--_0x2bb384){_0x121bd7['push'](_0x121bd7['shift']());}};_0x429966(++_0xcfe60e);}(_0xee2c,0x1c7));var _0xcee2=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xee2c[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var jayson=require(_0xcee2('0x1'));var schema=require(_0xcee2('0x2'));var BPromise=require(_0xcee2('0x3'));var moment=require(_0xcee2('0x4'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0xcee2('0x5'));exports[_0xcee2('0x6')]=function(_0x49d04d,_0xae585b,_0x409944){return new BPromise(function(_0x12fa86,_0x3d7611){var _0x24ce33={'QueuePause':function(_0x5a8219){return new Promise(function(_0x52a4ac,_0xea6c3c){var _0x2059ef=util[_0xcee2('0x7')](_0xcee2('0x8'),_0xcee2('0x9'),_0x5a8219[_0xcee2('0xa')]);if(_0x49d04d[_0xcee2('0xb')]&&_0x49d04d[_0xcee2('0xb')][_0x2059ef]&&_0x49d04d['timers'][_0x2059ef][_0xcee2('0xc')]){_0x49d04d[_0xcee2('0xb')][_0x2059ef][_0xcee2('0xd')]();}if(_0x49d04d[_0xcee2('0xe')][_0x2059ef]){_0x49d04d[_0xcee2('0xe')][_0x2059ef]['updateStatusRealtime']({'statePause':_0x5a8219[_0xcee2('0xf')]?!![]:![]});}_0x52a4ac({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x50a306){var _0x5dad1e=this;return new Promise(function(_0xfa663a,_0x34cc92){if(ami[_0xcee2('0x10')]()==![]){return _0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f4,[config['asterisk']['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x50a306=_[_0xcee2('0x16')](_0x50a306,_[_0xcee2('0x17')](properties[_0xcee2('0x18')]));_0x50a306[_0xcee2('0x19')]=_0xcee2('0x1a');return ami['Action'](_0x50a306)[_0xcee2('0x1b')](function(_0x548e47){_0xfa663a({'code':0xc8,'message':_0x548e47[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x2b2ea0){_0x34cc92(_0x5dad1e[_0xcee2('0x11')](0x1f5,_0x2b2ea0['message']));});});},'Command':function(_0x245811){var _0x317659=this;return new Promise(function(_0x19022a,_0x36af7f){if(ami[_0xcee2('0x10')]()==![]){return _0x36af7f(_0x317659[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}_0x245811=_['pick'](_0x245811,_0xcee2('0x1e'));_0x245811[_0xcee2('0x19')]='Command';return ami['Action'](_0x245811)[_0xcee2('0x1b')](function(_0x4fa083){_0x19022a({'code':0xc8,'message':_0x4fa083[_0xcee2('0x1f')]});})[_0xcee2('0x1d')](function(_0x2edef5){_0x36af7f(_0x317659['error'](0x1f5,_0x2edef5['message']));});});},'VoiceQueues':function(_0x20a6de){return new Promise(function(_0x2ccc9c,_0x22789d){var _0x5905f6=[];for(var _0x2f18ec in _0x49d04d['voiceQueues']){if(_0x49d04d[_0xcee2('0x20')][_0xcee2('0x21')](_0x2f18ec)){var _0x14615a=_0x49d04d[_0xcee2('0x20')][_0x2f18ec];var _0x84d7c={'id':_0x14615a['id'],'name':_0x14615a[_0xcee2('0xa')],'strategy':_0x14615a[_0xcee2('0x22')],'answered':_0x14615a[_0xcee2('0x23')],'available':_0x14615a[_0xcee2('0x24')],'loggedIn':_0x14615a[_0xcee2('0x25')],'pTalking':_0x14615a[_0xcee2('0x26')],'sumBillable':_0x14615a['sumBillable'],'sumDuration':_0x14615a[_0xcee2('0x27')],'sumHoldTime':_0x14615a[_0xcee2('0x28')]||0x0,'talking':_0x14615a[_0xcee2('0x29')],'total':_0x14615a['total'],'type':_0x14615a[_0xcee2('0x2a')],'unmanaged':_0x14615a[_0xcee2('0x2b')],'abandoned':_0x14615a['abandoned'],'waiting':_0x14615a[_0xcee2('0x2c')],'loggedInDb':_0x14615a[_0xcee2('0x2d')]};if(_0x14615a['type']==='outbound'){_0x84d7c[_0xcee2('0x2e')]=_0x14615a['dialActive'];_0x84d7c['dialMethod']=_0x14615a[_0xcee2('0x2f')];_0x84d7c[_0xcee2('0x30')]=_0x14615a['dialOriginateCallerIdName'];_0x84d7c[_0xcee2('0x31')]=_0x14615a[_0xcee2('0x31')];_0x84d7c[_0xcee2('0x32')]=_0x14615a[_0xcee2('0x32')];_0x84d7c[_0xcee2('0x33')]=_0x14615a[_0xcee2('0x33')];_0x84d7c[_0xcee2('0x34')]=_0x14615a[_0xcee2('0x34')];_0x84d7c[_0xcee2('0x35')]=_0x14615a[_0xcee2('0x35')];_0x84d7c[_0xcee2('0x36')]=_0x14615a[_0xcee2('0x36')];_0x84d7c['outboundBlacklistCallsDay']=_0x14615a[_0xcee2('0x37')];_0x84d7c[_0xcee2('0x38')]=_0x14615a['outboundBusyCallsDay'];_0x84d7c[_0xcee2('0x39')]=_0x14615a[_0xcee2('0x39')];_0x84d7c['outboundDropCallsDayACS']=_0x14615a[_0xcee2('0x3a')];_0x84d7c[_0xcee2('0x3b')]=_0x14615a[_0xcee2('0x3b')];_0x84d7c['outboundDropCallsDayTimeout']=_0x14615a[_0xcee2('0x3c')];_0x84d7c[_0xcee2('0x3d')]=_0x14615a[_0xcee2('0x3d')];_0x84d7c[_0xcee2('0x3e')]=_0x14615a[_0xcee2('0x3e')];_0x84d7c[_0xcee2('0x3f')]=_0x14615a['outboundOriginateFailureCallsDay'];_0x84d7c[_0xcee2('0x40')]=_0x14615a[_0xcee2('0x40')];_0x84d7c[_0xcee2('0x41')]=_0x14615a['outboundRejectCallsDay'];_0x84d7c[_0xcee2('0x42')]=_0x14615a['outboundUnknownCallsDay'];_0x84d7c['predictiveIntervalAnsweredCalls']=_0x14615a[_0xcee2('0x43')];_0x84d7c[_0xcee2('0x44')]=_0x14615a[_0xcee2('0x44')];_0x84d7c[_0xcee2('0x45')]=_0x14615a[_0xcee2('0x45')];_0x84d7c[_0xcee2('0x46')]=_0x14615a['predictiveIntervalDroppedCallsCallersExit'];_0x84d7c['predictiveIntervalDroppedCallsTimeout']=_0x14615a['predictiveIntervalDroppedCallsTimeout'];_0x84d7c[_0xcee2('0x47')]=_0x14615a['predictiveIntervalErlangCalls'];_0x84d7c[_0xcee2('0x48')]=_0x14615a[_0xcee2('0x48')];_0x84d7c['predictiveIntervalHitRate']=_0x14615a[_0xcee2('0x49')];_0x84d7c['predictiveIntervalMultiplicativeFactor']=_0x14615a['predictiveIntervalMultiplicativeFactor'];_0x84d7c[_0xcee2('0x4a')]=_0x14615a[_0xcee2('0x4a')];_0x84d7c['predictiveIntervalAvailable']=_0x14615a['predictiveIntervalAvailable'];_0x84d7c[_0xcee2('0x4b')]=_0x14615a[_0xcee2('0x4b')];_0x84d7c[_0xcee2('0x1c')]=_0x14615a[_0xcee2('0x1c')];_0x84d7c[_0xcee2('0x4c')]=_0x14615a[_0xcee2('0x4c')];_0x84d7c[_0xcee2('0x4d')]=_0x14615a[_0xcee2('0x4d')];_0x84d7c[_0xcee2('0x4e')]=_0x14615a['erlangCallToSecond'];_0x84d7c[_0xcee2('0x4f')]=_0x14615a[_0xcee2('0x4f')];_0x84d7c[_0xcee2('0x50')]=_0x14615a[_0xcee2('0x50')];_0x84d7c['startPredictive']=_0x14615a[_0xcee2('0x51')];_0x84d7c[_0xcee2('0x52')]=_0x14615a[_0xcee2('0x52')];}if(_0x14615a[_0xcee2('0x53')]){_0x84d7c[_0xcee2('0x53')]={'id':_0x14615a[_0xcee2('0x53')]['id'],'name':_0x14615a[_0xcee2('0x53')][_0xcee2('0xa')],'active':_0x14615a[_0xcee2('0x53')]['active'],'callerid':_0x14615a[_0xcee2('0x53')][_0xcee2('0x54')]};}if(_0x14615a[_0xcee2('0x55')]){_0x84d7c['Interval']={'id':_0x14615a[_0xcee2('0x55')]['id'],'name':_0x14615a[_0xcee2('0x55')][_0xcee2('0xa')]};}_0x5905f6[_0xcee2('0x56')](_0x84d7c);}}_0x2ccc9c({'count':_0x5905f6[_0xcee2('0x57')],'rows':_0x5905f6});});},'UpdateVoiceQueue':function(_0x1a883a){return new Promise(function(_0x2f3cdd,_0x3af08a){var _0x27ec54=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x20')],{'id':parseInt(_0x1a883a['id'])});var _0x4720c0=_[_0xcee2('0x59')](_0x1a883a,['id']);if(_0x27ec54){for(var _0xa98bc1 in _0x4720c0){if(typeof _0x4720c0[_0xa98bc1]!=='undefined'&&typeof _0x27ec54[_0xa98bc1]!==_0xcee2('0x5a')){_0x27ec54[_0xa98bc1]=_0x4720c0[_0xa98bc1];}}_0x2f3cdd(_0x27ec54);}else{_0x3af08a();}});},'VoiceChannels':function(_0x54ab70){return new Promise(function(_0x52c037,_0xe69b91){var _0x399291=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x5c')]);_0x52c037({'count':_0x399291[_0xcee2('0x57')],'rows':_0x399291});});},'VoiceChannelMixMonitor':function(_0x5e5011){var _0x10d8a6=this;return new Promise(function(_0x4b9864,_0x2f6cf0){if(ami[_0xcee2('0x10')]()==![]){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')]['join']('\x20')));}var _0xfbd8d2=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x5e5011);if(_0xfbd8d2[_0xcee2('0x57')]>0x0){return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0xfbd8d2,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x228c88=_['find'](_0x49d04d['channels'],{'uniqueid':_0x5e5011[_0xcee2('0x5f')]});if(_0x228c88&&_0x228c88[_0xcee2('0x60')]){var _0x4b888f=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x5e5011[_0xcee2('0x62')]||_0x5e5011[_0xcee2('0x5f')],_0x5e5011[_0xcee2('0x7')]||_0xcee2('0x63'));return ami[_0xcee2('0x64')]({'action':'MixMonitor','channel':_0x228c88['channel'],'file':_0x4b888f,'options':'ai(mixmonitorid)'})[_0xcee2('0x1b')](function(_0x3e0aa8){var _0x841efa=_['find'](_0x228c88[_0xcee2('0x65')],{'filename':_0xcee2('0x66')+_0x4b888f[_0xcee2('0x67')]()});if(_['isNil'](_0x841efa)){_0x228c88[_0xcee2('0x65')][_0xcee2('0x56')]({'filename':_0xcee2('0x66')+_0x4b888f['toLowerCase'](),'createdAt':moment()[_0xcee2('0x7')](_0xcee2('0x68')),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')],'status':_0xcee2('0x6a')});}else{_0x841efa['mixmonitorid']=_0x3e0aa8['mixmonitorid'];_0x841efa['status']=_0xcee2('0x6a');}_0x4b9864({'code':0xc8,'message':[_0x5e5011[_0xcee2('0x5f')],_0xcee2('0x6b'),_0x3e0aa8[_0xcee2('0x69')]][_0xcee2('0x15')]('\x20'),'mixmonitorid':_0x3e0aa8[_0xcee2('0x69')]});})[_0xcee2('0x1d')](function(_0x4c9a97){_0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,[_0x5e5011[_0xcee2('0x5f')],_0x4c9a97[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x2f6cf0(_0x10d8a6[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x1bb852){var _0x289744=this;return new Promise(function(_0x310098,_0x325f62){if(ami[_0xcee2('0x10')]()==![]){return _0x325f62(_0x289744['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x297e70=schema(properties[_0xcee2('0x5d')])[_0xcee2('0x2')](_0x1bb852);if(_0x297e70[_0xcee2('0x57')]>0x0){return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f4,_['map'](_0x297e70,'message')[_0xcee2('0x15')](',\x20')));}var _0xaf7f73=_[_0xcee2('0x58')](_0x49d04d['channels'],{'uniqueid':_0x1bb852['uniqueid']});if(_0xaf7f73){return BPromise['resolve']()[_0xcee2('0x1b')](function(){if(_0xaf7f73['channel']){return ami['Action']({'action':_0xcee2('0x6d'),'channel':_0xaf7f73['channel'],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x4920a1){});}})[_0xcee2('0x1b')](function(){if(_0xaf7f73[_0xcee2('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0xaf7f73[_0xcee2('0x6e')],'mixmonitorid':_0x1bb852[_0xcee2('0x69')]})[_0xcee2('0x1d')](function(_0x1b07b5){});}})[_0xcee2('0x1b')](function(_0x4faaef){var _0x41521f=_[_0xcee2('0x58')](_0xaf7f73[_0xcee2('0x65')],{'mixmonitorid':_0x1bb852[_0xcee2('0x69')]});if(_0x41521f){_0x41521f[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){var _0xa2f8b0=util[_0xcee2('0x7')](_0xcee2('0x61'),_0x1bb852[_0xcee2('0x62')]||_0x1bb852[_0xcee2('0x5f')],_0x1bb852['format']||_0xcee2('0x63'));var _0x19feb8=_[_0xcee2('0x58')](_0xaf7f73['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0xa2f8b0[_0xcee2('0x67')]()});if(_0x19feb8){_0x19feb8[_0xcee2('0x6f')]=_0xcee2('0x70');}})[_0xcee2('0x1b')](function(){_0x310098({'code':0xc8,'message':[_0x1bb852['uniqueid'],'StopMixMonitor\x20Success'][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x81f30a){_0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,[_0x1bb852[_0xcee2('0x5f')],_0x81f30a['message']['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x325f62(_0x289744[_0xcee2('0x11')](0x1f5,_0xcee2('0x6c')));}});},'VoiceQueuesChannels':function(_0xd39003){return new Promise(function(_0x3ba2d0,_0x4ea04a){var _0x3796cf=_['values'](_0x49d04d[_0xcee2('0x71')]);_0x3ba2d0({'count':_0x3796cf[_0xcee2('0x57')],'rows':_0x3796cf});});},'VoiceQueuesChannel':function(_0x2c9497){var _0x3f11e2=this;return new Promise(function(_0x59d2fe,_0xc64dbb){var _0x4edaba=schema(properties['voicequeuechannel'])[_0xcee2('0x2')](_0x2c9497);if(_0x4edaba[_0xcee2('0x57')]>0x0){return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x4edaba,'message')[_0xcee2('0x15')](',\x20')));}var _0x51599d=_['find'](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x2c9497[_0xcee2('0x5f')]});if(_0x51599d){_0x59d2fe(_0x51599d);}else{return _0xc64dbb(_0x3f11e2[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x17cd07){var _0x5bbd36=this;return new Promise(function(_0x1c7436,_0x5a44be){if(ami[_0xcee2('0x10')]()==![]){return _0x5a44be(_0x5bbd36['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config[_0xcee2('0x12')][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x43bf19=schema(properties[_0xcee2('0x72')])[_0xcee2('0x2')](_0x17cd07);if(_0x43bf19[_0xcee2('0x57')]>0x0){return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x43bf19,_0xcee2('0x1c'))[_0xcee2('0x15')](',\x20')));}var _0x292549=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x17cd07[_0xcee2('0x5f')]});if(_0x292549&&_0x292549[_0xcee2('0x60')]){return ami[_0xcee2('0x64')]({'action':'Hangup','channel':_0x292549[_0xcee2('0x60')]})[_0xcee2('0x1b')](function(_0x586b40){_0x1c7436({'code':0xc8,'message':[_0x17cd07[_0xcee2('0x5f')],_0x586b40[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x355834){_0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,[_0x17cd07[_0xcee2('0x5f')],_0x355834[_0xcee2('0x1c')][_0xcee2('0x67')]()]['join']('\x20')));});}else{return _0x5a44be(_0x5bbd36[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x109b85){var _0x2907f1=this;return new Promise(function(_0x132436,_0x4025f2){if(ami['isConnected']()==![]){return _0x4025f2(_0x2907f1['error'](0x1f4,[config[_0xcee2('0x12')]['ip'],config['asterisk'][_0xcee2('0x13')],_0xcee2('0x14')][_0xcee2('0x15')]('\x20')));}var _0x10db5b=schema(properties[_0xcee2('0x73')])['validate'](_0x109b85);if(_0x10db5b['length']>0x0){return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f4,_[_0xcee2('0x5e')](_0x10db5b,'message')['join'](',\x20')));}var _0x1f1676=_[_0xcee2('0x58')](_0x49d04d[_0xcee2('0x71')],{'uniqueid':_0x109b85['uniqueid']});if(_0x1f1676&&_0x1f1676['channel']){return ami[_0xcee2('0x64')]({'action':'Redirect','channel':_0x1f1676['channel'],'exten':_0x109b85[_0xcee2('0x74')],'context':_0x109b85[_0xcee2('0x75')]||_0x1f1676[_0xcee2('0x75')],'priority':0x1})[_0xcee2('0x1b')](function(_0xf3d804){_0x132436({'code':0xc8,'message':[_0x109b85[_0xcee2('0x5f')],_0xf3d804[_0xcee2('0x1c')][_0xcee2('0x67')]()][_0xcee2('0x15')]('\x20')});})[_0xcee2('0x1d')](function(_0x21bbb5){_0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,[_0x109b85[_0xcee2('0x5f')],_0x21bbb5[_0xcee2('0x1c')]['toLowerCase']()][_0xcee2('0x15')]('\x20')));});}else{return _0x4025f2(_0x2907f1[_0xcee2('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2057fb){return new Promise(function(_0x203572,_0x472e15){var _0x58511f=_['values'](_0x49d04d['agents']);_0x203572({'count':_0x58511f[_0xcee2('0x57')],'rows':_0x58511f});});},'Telephones':function(_0x2afc1e){return new Promise(function(_0x2d1a5e,_0x10fd3a){var _0x5e2d43=_['values'](_0x49d04d[_0xcee2('0x76')]);_0x2d1a5e({'count':_0x5e2d43[_0xcee2('0x57')],'rows':_0x5e2d43});});},'Trunks':function(_0x42cd1d){return new Promise(function(_0x255f8a,_0x10c8c4){var _0x56900e=_[_0xcee2('0x5b')](_0x49d04d[_0xcee2('0x77')]);_0x255f8a({'count':_0x56900e[_0xcee2('0x57')],'rows':_0x56900e});});},'OutboundChannels':function(_0x4c755a){return new Promise(function(_0x19c2e4,_0x28f6a9){var _0x51f8ff=_[_0xcee2('0x5b')](_0x49d04d['outboundChannels']);_0x19c2e4({'count':_0x51f8ff[_0xcee2('0x57')],'rows':_0x51f8ff});});},'Outbound':function(_0x30848b){return new Promise(function(_0x31c0f6,_0x6e6bff){_0x31c0f6(_0x49d04d[_0xcee2('0x78')]);});},'Campaigns':function(_0x4d753f){return new Promise(function(_0x51c204,_0x977c1a){var _0xc18245=_['values'](_0x49d04d[_0xcee2('0x79')]);_0x51c204({'count':_0xc18245[_0xcee2('0x57')],'rows':_0xc18245});});},'VoiceQueuesPreview':function(_0x1ecbbf){var _0x352100=this;return new Promise(function(_0x2c3d40,_0x58e5e5){_0xae585b[_0xcee2('0x7a')](_0x1ecbbf['id'])[_0xcee2('0x1b')](function(_0x3163d7){_0x2c3d40({'code':0xc8,'message':_0x3163d7[_0xcee2('0x1c')]});})['catch'](function(_0x3ba30c){_0x58e5e5(_0x352100[_0xcee2('0x11')](0x1f4,_0x3ba30c[_0xcee2('0x1c')]));});});},'EventManager':function(_0x1c18c0){var _0xdc2285=this;return new Promise(function(_0x13748b,_0xad1457){if(!_0x1c18c0[_0xcee2('0x7b')]){return _0xad1457(_0xdc2285[_0xcee2('0x11')](0x1f4,_0xcee2('0x7c')));}ami[_0xcee2('0x7d')](_0xcee2('0x7e')+_0x1c18c0[_0xcee2('0x7b')],_0x1c18c0[_0xcee2('0x1c')]);_0x13748b({'code':0xc8,'message':_0x1c18c0});});},'FaxAccounts':function(_0x2d0bfb){return new Promise(function(_0x49a1a5,_0x46c635){var _0x450e2a=_[_0xcee2('0x5b')](_0x49d04d['faxAccounts']);_0x49a1a5({'count':_0x450e2a[_0xcee2('0x57')],'rows':_0x450e2a});});},'SendFax':function(_0x75e016){var _0x5a8347=this;return new Promise(function(_0x3365ee,_0x532417){_0x409944[_0xcee2('0x7f')](_0x75e016)[_0xcee2('0x1b')](function(_0x257650){_0x3365ee({'code':0xc8,'message':_0x257650[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x17c838){_0x532417(_0x5a8347[_0xcee2('0x11')](0x1f4,_0x17c838[_0xcee2('0x1c')]));});});},'CheckAfterSend':function(_0x1db3c3){var _0x467911=this;return new Promise(function(_0x26ed21,_0x292045){_0x409944[_0xcee2('0x80')](_0x1db3c3)[_0xcee2('0x1b')](function(_0x5e8544){_0x26ed21({'code':0xc8,'message':_0x5e8544[_0xcee2('0x1c')]});})[_0xcee2('0x1d')](function(_0x558776){_0x292045(_0x467911[_0xcee2('0x11')](0x1f4,_0x558776[_0xcee2('0x1c')]));});});}};var _0x18b013=jayson[_0xcee2('0x81')](_0x24ce33)[_0xcee2('0x82')]();_0x18b013['on'](_0xcee2('0x11'),function(_0x1fce50){return _0x3d7611(_0x1fce50);});_0x18b013[_0xcee2('0x6')](0x232a,_0xcee2('0x83'),function(){console[_0xcee2('0x84')](_0xcee2('0x85'),0x232a);return _0x12fa86(_0xcee2('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 1f3dfef..d0dd902 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 _0xb458=['redis','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','format','user:%s','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xb458,0x103));var _0x8b45=function(_0x487473,_0x1c95a8){_0x487473=_0x487473-0x0;var _0x49697c=_0xb458[_0x487473];return _0x49697c;};'use strict';var _=require(_0x8b45('0x0'));var BPromise=require(_0x8b45('0x1'));var Redis=require(_0x8b45('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x8b45('0x3'))(_0x8b45('0x4'));var cmContactRpc=require(_0x8b45('0x5'));config[_0x8b45('0x6')]=_['defaults'](config[_0x8b45('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8b45('0x6')]));function emit(_0x12bd05,_0x2daa9a,_0x3a8ccb,_0x32342f,_0x4d1718){logger[_0x8b45('0x7')](_0x8b45('0x8'),_0x12bd05,_0x2daa9a['id'],_0x3a8ccb,_0x32342f,JSON[_0x8b45('0x9')](_0x4d1718));io['to'](_0x3a8ccb)[_0x8b45('0xa')](_0x32342f,_0x4d1718);}exports[_0x8b45('0xb')]=function(_0x499899,_0x2a4c83,_0x7cc49b,_0x57faf9){var _0x5316af,_0x5bb708;var _0x4e28bb={};var _0x43a4c3=Number(_0x7cc49b[_0x8b45('0xc')]);var _0x37c220=_0x7cc49b['data2']?Boolean(Number(_0x7cc49b[_0x8b45('0xd')])):![];var _0x455ecf;var _0x42bb72=![];if(!_[_0x8b45('0xe')](_0x7cc49b[_0x8b45('0xf')])){if(_0x7cc49b[_0x8b45('0xf')]=='1')_0x42bb72=!![];}if(!_0x42bb72){if(_0x57faf9['xmd-contactid']){_0x4e28bb['id']=_0x57faf9['xmd-contactid'];}}if(!_0x4e28bb['id']){_0x4e28bb[_0x8b45('0x10')]=_0x43a4c3;_0x455ecf=_0x7cc49b[_0x8b45('0x11')]&&_0x7cc49b[_0x8b45('0x11')]!=='0'?_0x7cc49b[_0x8b45('0x11')][_0x8b45('0x12')](','):[_0x8b45('0x13')];_0x4e28bb[_0x8b45('0x14')]=_[_0x8b45('0x15')](_0x455ecf,function(_0x33102e){var _0x391d1e={};_0x391d1e[_0x33102e]=_0x57faf9[_0x8b45('0x16')]?_0x57faf9[_0x8b45('0x17')]:_0x57faf9[_0x8b45('0x18')];return _0x391d1e;});}var _0x43ffb7=['id',_0x8b45('0x19'),_0x8b45('0x1a'),_0x8b45('0x13'),_0x8b45('0x1b'),'fax',_0x8b45('0x10'),_0x8b45('0x1c'),_0x8b45('0x1d'),_0x8b45('0x1e')];var _0x3e1438=_[_0x8b45('0x1f')](_0x43ffb7,_0x455ecf);BPromise[_0x8b45('0x20')]()[_0x8b45('0x21')](cmContactRpc['getContacts']({'attributes':_0x3e1438,'where':_0x4e28bb}))['then'](function(_0x41154a){_0x5bb708=_0x41154a;if(!_['isEmpty'](_0x5bb708)){if(_0x5bb708[_0x8b45('0x22')]===0x1){_0x5316af=_0x5bb708[0x0];logger[_0x8b45('0x7')](_0x8b45('0x23'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}else{logger[_0x8b45('0x7')](_0x8b45('0x25'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_['map'](_0x5bb708,'id')['join'](','));}return;}else{logger[_0x8b45('0x7')](_0x8b45('0x26'),_0x57faf9['uniqueid'],_0x2a4c83['id']);var _0x5723a2={'ListId':_0x43a4c3};var _0x129c35=_0x7cc49b[_0x8b45('0x27')]&&_0x7cc49b[_0x8b45('0x27')]!=='0'?_0x7cc49b[_0x8b45('0x27')]:'phone';if(_0x37c220){logger[_0x8b45('0x7')](_0x8b45('0x28'),_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9[_0x8b45('0x2c')]!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}return BPromise[_0x8b45('0x20')]()['then'](cmContactRpc[_0x8b45('0x2d')](_0x5723a2))[_0x8b45('0x21')](function(_0x50302){_0x5316af=_0x50302;_0x5bb708[_0x8b45('0x2e')](_0x50302);if(_0x5316af){logger[_0x8b45('0x7')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id'],_0x5316af['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x57faf9[_0x8b45('0x24')],_0x2a4c83['id']);_0x5723a2[_0x129c35]=_[_0x8b45('0xe')](_0x57faf9[_0x8b45('0x16')])?_0x57faf9[_0x8b45('0x18')]:_0x57faf9[_0x8b45('0x17')];if(_[_0x8b45('0xe')](_0x57faf9['routeId'])){_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x29')]&&_0x57faf9[_0x8b45('0x29')]!==_0x8b45('0x2a')?_0x57faf9['calleridname']:_0x8b45('0x2b');}else{_0x5723a2[_0x8b45('0x19')]=_0x57faf9[_0x8b45('0x2c')]&&_0x57faf9['destcalleridname']!==_0x8b45('0x2a')?_0x57faf9[_0x8b45('0x2c')]:_0x8b45('0x2b');}_0x5316af=_0x5723a2;_0x5bb708['push'](_0x5723a2);return;}}})[_0x8b45('0x21')](function(){if(_0x499899){emit(_0x57faf9[_0x8b45('0x24')],_0x2a4c83,util[_0x8b45('0x2f')](_0x8b45('0x30'),_0x499899['name']),util[_0x8b45('0x2f')](_0x8b45('0x31'),_0x7cc49b[_0x8b45('0x32')][_0x8b45('0x33')]()),{'evt':_[_0x8b45('0x34')](_0x57faf9,{'autoCreate':_0x37c220}),'contact':_0x5316af===undefined?{}:_0x5316af,'contacts':_0x5bb708[_0x8b45('0x22')]===0x0?undefined:_0x5bb708});}});}; \ No newline at end of file +var _0xbec5=['fax','scheduledAt','union','resolve','then','getContacts','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridnum','destcalleridnum','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','trigger:%s','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','info','[CM][%s][%s]','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','map','routeId','firstName','phone','mobile'];(function(_0x11fd4e,_0x1a32ec){var _0x324371=function(_0x3f90a1){while(--_0x3f90a1){_0x11fd4e['push'](_0x11fd4e['shift']());}};_0x324371(++_0x1a32ec);}(_0xbec5,0xe5));var _0x5bec=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xbec5[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x5bec('0x0'));var BPromise=require(_0x5bec('0x1'));var Redis=require('ioredis');var util=require(_0x5bec('0x2'));var config=require(_0x5bec('0x3'));var logger=require(_0x5bec('0x4'))(_0x5bec('0x5'));var cmContactRpc=require(_0x5bec('0x6'));config['redis']=_[_0x5bec('0x7')](config[_0x5bec('0x8')],{'host':_0x5bec('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5bec('0x8')]));function emit(_0x28a427,_0x38456e,_0x406e65,_0x43d96e,_0x302aae){logger[_0x5bec('0xa')](_0x5bec('0xb'),_0x28a427,_0x38456e['id'],_0x406e65,_0x43d96e,JSON['stringify'](_0x302aae));io['to'](_0x406e65)[_0x5bec('0xc')](_0x43d96e,_0x302aae);}exports['exec']=function(_0x748f75,_0x2a70a7,_0x117162,_0x4a5482){var _0x288d1b,_0x18fa47;var _0x16226b={};var _0x57ffc4=Number(_0x117162[_0x5bec('0xd')]);var _0x1c888f=_0x117162['data2']?Boolean(Number(_0x117162[_0x5bec('0xe')])):![];var _0xaa984d;var _0x35393a=![];if(!_[_0x5bec('0xf')](_0x117162[_0x5bec('0x10')])){if(_0x117162[_0x5bec('0x10')]=='1')_0x35393a=!![];}if(!_0x35393a){if(_0x4a5482[_0x5bec('0x11')]){_0x16226b['id']=_0x4a5482[_0x5bec('0x11')];}}if(!_0x16226b['id']){_0x16226b[_0x5bec('0x12')]=_0x57ffc4;_0xaa984d=_0x117162[_0x5bec('0x13')]&&_0x117162[_0x5bec('0x13')]!=='0'?_0x117162[_0x5bec('0x13')][_0x5bec('0x14')](','):['phone'];_0x16226b['$or']=_[_0x5bec('0x15')](_0xaa984d,function(_0x773740){var _0x31ad9c={};_0x31ad9c[_0x773740]=_0x4a5482[_0x5bec('0x16')]?_0x4a5482['destcalleridnum']:_0x4a5482['calleridnum'];return _0x31ad9c;});}var _0x3cd354=['id',_0x5bec('0x17'),'lastName',_0x5bec('0x18'),_0x5bec('0x19'),_0x5bec('0x1a'),_0x5bec('0x12'),'createdAt',_0x5bec('0x1b'),'updatedAt'];var _0x191c0f=_[_0x5bec('0x1c')](_0x3cd354,_0xaa984d);BPromise[_0x5bec('0x1d')]()[_0x5bec('0x1e')](cmContactRpc[_0x5bec('0x1f')]({'attributes':_0x191c0f,'where':_0x16226b}))['then'](function(_0x232584){_0x18fa47=_0x232584;if(!_['isEmpty'](_0x18fa47)){if(_0x18fa47[_0x5bec('0x20')]===0x1){_0x288d1b=_0x18fa47[0x0];logger[_0x5bec('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4a5482[_0x5bec('0x21')],_0x2a70a7['id'],_0x288d1b['id']);}else{logger[_0x5bec('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4a5482[_0x5bec('0x21')],_0x2a70a7['id'],_[_0x5bec('0x15')](_0x18fa47,'id')[_0x5bec('0x22')](','));}return;}else{logger[_0x5bec('0xa')](_0x5bec('0x23'),_0x4a5482[_0x5bec('0x21')],_0x2a70a7['id']);var _0x2dc014={'ListId':_0x57ffc4};var _0x4de66a=_0x117162['data4']&&_0x117162['data4']!=='0'?_0x117162[_0x5bec('0x24')]:_0x5bec('0x18');if(_0x1c888f){logger[_0x5bec('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4a5482[_0x5bec('0x21')],_0x2a70a7['id']);_0x2dc014[_0x4de66a]=_[_0x5bec('0xf')](_0x4a5482['routeId'])?_0x4a5482[_0x5bec('0x25')]:_0x4a5482[_0x5bec('0x26')];if(_['isNil'](_0x4a5482['routeId'])){_0x2dc014[_0x5bec('0x17')]=_0x4a5482[_0x5bec('0x27')]&&_0x4a5482[_0x5bec('0x27')]!==_0x5bec('0x28')?_0x4a5482[_0x5bec('0x27')]:_0x5bec('0x29');}else{_0x2dc014['firstName']=_0x4a5482[_0x5bec('0x2a')]&&_0x4a5482['destcalleridname']!==_0x5bec('0x28')?_0x4a5482[_0x5bec('0x2a')]:_0x5bec('0x29');}return BPromise[_0x5bec('0x1d')]()['then'](cmContactRpc[_0x5bec('0x2b')](_0x2dc014))[_0x5bec('0x1e')](function(_0xfc7d41){_0x288d1b=_0xfc7d41;_0x18fa47['push'](_0xfc7d41);if(_0x288d1b){logger[_0x5bec('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4a5482[_0x5bec('0x21')],_0x2a70a7['id'],_0x288d1b['id']);}return;});}else{logger[_0x5bec('0xa')](_0x5bec('0x2c'),_0x4a5482['uniqueid'],_0x2a70a7['id']);_0x2dc014[_0x4de66a]=_[_0x5bec('0xf')](_0x4a5482[_0x5bec('0x16')])?_0x4a5482['calleridnum']:_0x4a5482[_0x5bec('0x26')];if(_[_0x5bec('0xf')](_0x4a5482[_0x5bec('0x16')])){_0x2dc014[_0x5bec('0x17')]=_0x4a5482[_0x5bec('0x27')]&&_0x4a5482['calleridname']!==_0x5bec('0x28')?_0x4a5482['calleridname']:_0x5bec('0x29');}else{_0x2dc014[_0x5bec('0x17')]=_0x4a5482[_0x5bec('0x2a')]&&_0x4a5482[_0x5bec('0x2a')]!==_0x5bec('0x28')?_0x4a5482[_0x5bec('0x2a')]:'Unknown';}_0x288d1b=_0x2dc014;_0x18fa47[_0x5bec('0x2d')](_0x2dc014);return;}}})[_0x5bec('0x1e')](function(){if(_0x748f75){emit(_0x4a5482[_0x5bec('0x21')],_0x2a70a7,util['format'](_0x5bec('0x2e'),_0x748f75[_0x5bec('0x2f')]),util['format'](_0x5bec('0x30'),_0x117162['action'][_0x5bec('0x31')]()),{'evt':_[_0x5bec('0x32')](_0x4a5482,{'autoCreate':_0x1c888f}),'contact':_0x288d1b===undefined?{}:_0x288d1b,'contacts':_0x18fa47[_0x5bec('0x20')]===0x0?undefined:_0x18fa47});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a334679..86ec4b9 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 _0x3e30=['undefined','motionChannel','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','interface','toLowerCase','contactmanager','browser','data1','TemplateId','data2','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','action','jscripty','trigger:%s','exec','integration','queue','urlforward','parse','query','search','channel','AllConditions','checkConditions','AnyConditions','some','account','chat','operator','ChatWebsiteId','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','routeId','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','redis','defaults','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone'];(function(_0x53ea45,_0x49f914){var _0x32bbca=function(_0x4cdfa0){while(--_0x4cdfa0){_0x53ea45['push'](_0x53ea45['shift']());}};_0x32bbca(++_0x49f914);}(_0x3e30,0x12e));var _0x03e3=function(_0x23744e,_0x395956){_0x23744e=_0x23744e-0x0;var _0xa09197=_0x3e30[_0x23744e];return _0xa09197;};'use strict';var util=require(_0x03e3('0x0'));var _=require(_0x03e3('0x1'));var url=require(_0x03e3('0x2'));var Mustache=require('mustache');var Redis=require(_0x03e3('0x3'));var urlforward=require(_0x03e3('0x4'));var integration=require(_0x03e3('0x5'));var cmContact=require(_0x03e3('0x6'));var script=require('./script');var config=require(_0x03e3('0x7'));var logger=require(_0x03e3('0x8'))(_0x03e3('0x9'));var ami=require('../ami');config[_0x03e3('0xa')]=_[_0x03e3('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x03e3('0xc'))(new Redis(config[_0x03e3('0xa')]));var operators={'equals':function(_0x317198,_0x35cbc6){return _0x317198==_0x35cbc6;},'not_equals':function(_0x55b1b1,_0x221282){return _0x55b1b1!=_0x221282;}};var barAndWebActions=[_0x03e3('0xd'),_0x03e3('0x2'),_0x03e3('0xe')];function Trigger(_0x30a968){this[_0x03e3('0xf')]=_0x30a968[_0x03e3('0xf')];this['agents']=_0x30a968[_0x03e3('0x10')];this[_0x03e3('0x11')]=_0x30a968[_0x03e3('0x11')];this[_0x03e3('0x12')]=_0x30a968[_0x03e3('0x12')];this[_0x03e3('0x13')]=_0x30a968[_0x03e3('0x13')];this['zendeskAccounts']=_0x30a968[_0x03e3('0x14')];this[_0x03e3('0x15')]=_0x30a968[_0x03e3('0x15')];this[_0x03e3('0x16')]=_0x30a968[_0x03e3('0x16')];this[_0x03e3('0x17')]=_0x30a968[_0x03e3('0x17')];this['zohoAccounts']=_0x30a968[_0x03e3('0x18')];this[_0x03e3('0x19')]=_0x30a968['deskAccounts'];this[_0x03e3('0x1a')]=_0x30a968['vtigerAccounts'];this[_0x03e3('0x1b')]=_0x30a968[_0x03e3('0x1b')];this['dynamics365Accounts']=_0x30a968[_0x03e3('0x1c')];this[_0x03e3('0x1d')]=_0x30a968[_0x03e3('0x1d')];this[_0x03e3('0x1e')]={'zendesk':this[_0x03e3('0x14')],'salesforce':this[_0x03e3('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x03e3('0x17')],'zoho':this['zohoAccounts'],'desk':this[_0x03e3('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x03e3('0x1d')],'servicenow':this[_0x03e3('0x1b')]};ami['on'](_0x03e3('0x1f'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x22'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x23'),this['syncCustomEvent']['bind'](this));ami['on'](_0x03e3('0x24'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x25'),this['syncCustomEvent'][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x26'),this[_0x03e3('0x20')]['bind'](this));ami['on'](_0x03e3('0x27'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on']('custom:agentcongestion',this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x28'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on']('custom:amd',this[_0x03e3('0x20')]['bind'](this));ami['on'](_0x03e3('0x29'),this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x2a'),this[_0x03e3('0x2b')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x2c'),this['syncAgentDial'][_0x03e3('0x21')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x2d'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x2e'),this['syncCustomEvent'][_0x03e3('0x21')](this));ami['on']('custom:substatus',this[_0x03e3('0x20')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x2f'),this[_0x03e3('0x20')][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x30'),this['syncCustomEvent'][_0x03e3('0x21')](this));ami['on'](_0x03e3('0x31'),this[_0x03e3('0x20')]['bind'](this));}Trigger[_0x03e3('0x32')][_0x03e3('0x33')]=function(_0x3c5c9c,_0x5b2aac,_0x19a30c){logger[_0x03e3('0x34')](_0x3c5c9c,_0x5b2aac,JSON[_0x03e3('0x35')](_0x19a30c));io['to'](_0x3c5c9c)[_0x03e3('0x33')](_0x5b2aac,_0x19a30c);};Trigger['prototype'][_0x03e3('0x20')]=function(_0x249298){var _0x572572=_[_0x03e3('0x36')](_0x249298);if(typeof _0x572572['motionChannel']===_0x03e3('0x37')){_0x572572[_0x03e3('0x38')]=_0x03e3('0x39');}this[_0x03e3('0x3a')](_0x572572);};Trigger['prototype'][_0x03e3('0x2b')]=function(_0x722705){if(this[_0x03e3('0x10')][_0x722705['interface']]){this['syncCustomEvent'](_0x722705);}};Trigger[_0x03e3('0x32')]['checkTriggers']=function(_0x27a044){var _0x726f42;for(var _0x199065 in this['triggers']){if(this[_0x03e3('0xf')][_0x03e3('0x3b')](_0x199065)){if(this[_0x03e3('0xf')][_0x199065][_0x03e3('0x3c')]){_0x726f42=this[_0x03e3('0x3d')](this[_0x03e3('0xf')][_0x199065],_0x27a044);if(_0x726f42){_[_0x03e3('0x3e')](_0x27a044,_0x27a044['variables']);for(var _0x44c36d=0x0,_0x3a3e5d,_0x47ea7e,_0x19fd0e;_0x44c36d0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x46307c,_0x23018a){var _0x4db669=function(_0x103ecf){while(--_0x103ecf){_0x46307c['push'](_0x46307c['shift']());}};_0x4db669(++_0x23018a);}(_0x3e74,0x175));var _0x43e7=function(_0x50afd0,_0x496aa9){_0x50afd0=_0x50afd0-0x0;var _0x5ccb6c=_0x3e74[_0x50afd0];return _0x5ccb6c;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index a043527..ed78d3c 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 _0x1c34=[']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','userEmail','email','internalemailaddress','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','length','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','headers','substring','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','Bearer\x20','enduserId',']\x20Enduser\x20Created!','forEach','includes','string','type','indexOf','content','ticketType','assign','getString','Subjects','/contacts(','Fields','phonecall','phonecalls','Descriptions','callDirection','queue','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:'];(function(_0x2e78eb,_0x3bdc3c){var _0x1190f0=function(_0x810d6e){while(--_0x810d6e){_0x2e78eb['push'](_0x2e78eb['shift']());}};_0x1190f0(++_0x3bdc3c);}(_0x1c34,0x65));var _0x41c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c34[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41c3('0x0'));var BPromise=require(_0x41c3('0x1'));var rp=require('request-promise');var util=require(_0x41c3('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x41c3('0x3'));var logger=require(_0x41c3('0x4'))(_0x41c3('0x5'));var config=require(_0x41c3('0x6'));config[_0x41c3('0x7')]=_['defaults'](config[_0x41c3('0x7')],{'host':_0x41c3('0x8'),'port':0x18eb});var io=require(_0x41c3('0x9'))(new Redis(config[_0x41c3('0x7')]));function getAuthToken(_0x42b65d,_0x466caf,_0x3cbd57){var _0x12ca4a={'method':_0x41c3('0xa'),'uri':_0x466caf,'form':{'client_id':_0x42b65d[_0x41c3('0xb')],'resource':_0x42b65d[_0x41c3('0xc')],'username':_0x42b65d[_0x41c3('0xd')],'password':_0x42b65d[_0x41c3('0xe')],'grant_type':_0x41c3('0xe'),'client_secret':_0x42b65d[_0x41c3('0xf')]},'json':!![]};return rp(_0x12ca4a)[_0x41c3('0x10')](function(_0x282019){return _0x282019[_0x41c3('0x11')];})[_0x41c3('0x12')](function(_0x569c19){logger['error']('['+[_0x3cbd57['toUpperCase']()]+_0x41c3('0x13'));return _0x569c19[_0x41c3('0x14')];});}function getUser(_0x3a85e6,_0x144ad8,_0x1a656f,_0x4c836c,_0x3212f,_0x1d2d1c){return new BPromise(function(_0x5ac143,_0x43e798){return getAuthToken(_0x144ad8,_0x4c836c,_0x1d2d1c)[_0x41c3('0x10')](function(_0x42fd4e){var _0x24f94e={'method':_0x41c3('0x15'),'uri':_0x3212f+_0x41c3('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x42fd4e,'OData-Version':_0x41c3('0x17')},'json':!![]};return rp(_0x24f94e);})[_0x41c3('0x10')](function(_0x138f80){var _0x20cd8f=_0x138f80[_0x41c3('0x18')];var _0x170213=![];var _0x2aec7e=null;if(!_[_0x41c3('0x19')](_0x1a656f)){if(intUtil[_0x41c3('0x1a')](_0x1a656f['email'])){_0x3a85e6[_0x41c3('0x1b')]=_0x1a656f[_0x41c3('0x1c')];for(_0x2aec7e=0x0;_0x2aec7e<_0x20cd8f['length'];_0x2aec7e++){if(_0x20cd8f[_0x2aec7e][_0x41c3('0x1d')]===_0x1a656f[_0x41c3('0x1c')]&&!_0x20cd8f[_0x2aec7e]['isdisabled']){_0x170213=!![];logger[_0x41c3('0x1e')]('['+[_0x1d2d1c[_0x41c3('0x1f')]()]+_0x41c3('0x20')+_0x20cd8f[_0x2aec7e][_0x41c3('0x21')]+'!');_0x3a85e6[_0x41c3('0x22')]=_0x20cd8f[_0x2aec7e]['systemuserid'];}}}}if(!_0x170213){logger['info']('['+[_0x1d2d1c['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3a85e6[_0x41c3('0x1b')]=_0x144ad8[_0x41c3('0xd')];for(_0x2aec7e=0x0;_0x2aec7e<_0x20cd8f[_0x41c3('0x23')];_0x2aec7e++){if(_0x20cd8f[_0x2aec7e][_0x41c3('0x1d')]===_0x144ad8[_0x41c3('0xd')]){_0x3a85e6[_0x41c3('0x22')]=_0x20cd8f[_0x2aec7e][_0x41c3('0x21')];}}}_0x5ac143(_0x3a85e6);})[_0x41c3('0x12')](function(_0xdbf271){_0x43e798(_0xdbf271['message']);});});}function createEndUser(_0x509c59,_0x383924,_0x402d1d,_0x5e543b,_0x20229d,_0x1432d2){return new BPromise(function(_0x7a08dc,_0xb12448){return getAuthToken(_0x383924,_0x402d1d,_0x1432d2)[_0x41c3('0x10')](function(_0x22ce84){var _0x7f5787=_0x1432d2[_0x41c3('0x24')]()===_0x41c3('0x25')?_0x20229d[_0x41c3('0x26')]:_0x20229d[_0x41c3('0x27')];var _0x195f30={'method':_0x41c3('0xa'),'uri':_0x5e543b+'contacts','body':{'telephone1':_0x7f5787,'fullname':_0x7f5787,'firstname':_0x7f5787,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x41c3('0x28')+_0x509c59[_0x41c3('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x22ce84,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x195f30);})[_0x41c3('0x10')](function(_0xd23a09){var _0x141f5a=_0xd23a09[_0x41c3('0x29')]['odata-entityid'];var _0x5a82ad=_0x141f5a[_0x41c3('0x2a')](_0x141f5a[_0x41c3('0x2b')]('(')+0x1,_0x141f5a[_0x41c3('0x2b')](')'));_0x509c59['enduserId']=_0x5a82ad;_0x7a08dc(_0x509c59);})[_0x41c3('0x12')](function(_0x26ae98){_0xb12448(_0x26ae98[_0x41c3('0x14')]);});});}function getEndUser(_0x27497b,_0x5972f7,_0x1d7325,_0x34ebed,_0x404534,_0x43a7fe){return new BPromise(function(_0x2fdd83,_0x2598f0){var _0x5286d0=_0x43a7fe[_0x41c3('0x24')]()===_0x41c3('0x25')?_0x404534[_0x41c3('0x26')]:_0x404534[_0x41c3('0x27')];return getAuthToken(_0x5972f7,_0x1d7325,_0x43a7fe)[_0x41c3('0x10')](function(_0x33792a){var _0x5bb4db={'method':_0x41c3('0x15'),'uri':_0x34ebed+_0x41c3('0x2c')+_0x5286d0[_0x41c3('0x2d')]('+',_0x41c3('0x2e'))+'\x27','headers':{'Authorization':_0x41c3('0x2f')+_0x33792a,'If-None-Match':null,'OData-Version':_0x41c3('0x17')},'json':!![]};return rp(_0x5bb4db);})[_0x41c3('0x10')](function(_0x54cb50){var _0x1a884a=null;if(_0x54cb50){var _0xa9b7a3=_0x54cb50[_0x41c3('0x18')];var _0x574a2d=![];for(_0x1a884a=0x0;_0x1a884a<_0xa9b7a3['length'];_0x1a884a++){if(_0xa9b7a3[_0x1a884a]['telephone1']===_0x5286d0){_0x574a2d=!![];_0x27497b[_0x41c3('0x30')]=_0xa9b7a3[_0x1a884a]['contactid'];}}if(_0x574a2d){_0x2fdd83(_0x27497b);}else{return createEndUser(_0x27497b,_0x5972f7,_0x1d7325,_0x34ebed,_0x404534,_0x43a7fe)[_0x41c3('0x10')](function(_0x9ef2f8){logger[_0x41c3('0x1e')]('['+[_0x43a7fe['toUpperCase']()]+']\x20Enduser\x20created!',_0x9ef2f8[_0x41c3('0x30')]);_0x2fdd83(_0x9ef2f8);});}}else{return createEndUser(_0x27497b,_0x5972f7,_0x1d7325,_0x34ebed,_0x404534,_0x43a7fe)['then'](function(_0xb7eded){logger[_0x41c3('0x1e')]('['+[_0x43a7fe[_0x41c3('0x1f')]()]+_0x41c3('0x31'),_0xb7eded[_0x41c3('0x30')]);_0x2fdd83(_0xb7eded);});}});});}function getCustomFields(_0x5b9dd8,_0x5a7be5,_0x467082){var _0x2846b6={};if(_0x5b9dd8[_0x41c3('0x23')]>0x0){_[_0x41c3('0x32')](_0x5b9dd8,function(_0x2d18b3){if(_[_0x41c3('0x33')]([_0x41c3('0x34'),'picklist'],_0x2d18b3[_0x41c3('0x35')])&&_0x2d18b3['nameField']&&!_0x2d18b3['customField']){var _0x9908f8=_0x2d18b3['idField'][_0x41c3('0x24')]();var _0x139d2a=_0x9908f8[_0x41c3('0x2a')](0x0,_0x9908f8[_0x41c3('0x36')]('_'));var _0x3df84d=_0x9908f8[_0x41c3('0x2a')](_0x9908f8['indexOf']('_')+0x1);if(_0x139d2a===_0x467082){_0x2846b6[_0x3df84d]=_0x2d18b3[_0x41c3('0x37')];}}});}return _0x2846b6;}function getTicket(_0x54958c,_0xa992de,_0x54a33f,_0x4d0090,_0x279483,_0x43d8dd,_0x93ec8b){return new BPromise(function(_0x21c3db,_0x2b1a06){var _0x233d0a;return getAuthToken(_0xa992de,_0x54a33f,_0x93ec8b)[_0x41c3('0x10')](function(_0x53ac7e){if(_0x43d8dd[_0x41c3('0x38')]==='incident'){_0x233d0a={'method':_0x41c3('0xa'),'uri':_0x4d0090+'incidents','body':Object[_0x41c3('0x39')]({},{'title':intUtil[_0x41c3('0x3a')](_0x43d8dd[_0x41c3('0x3b')],_0x279483,'\x20'),'description':intUtil['getString'](_0x43d8dd['Descriptions'],_0x279483,'\x0a'),'customerid_contact@odata.bind':_0x41c3('0x3c')+_0x54958c['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x54958c['userId']+')','caseorigincode':'1'},getCustomFields(_0x43d8dd[_0x41c3('0x3d')],_0x279483,_0x43d8dd[_0x41c3('0x38')])),'headers':{'Authorization':'Bearer\x20'+_0x53ac7e,'OData-Version':_0x41c3('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x43d8dd[_0x41c3('0x38')]===_0x41c3('0x3e')){_0x233d0a={'method':_0x41c3('0xa'),'uri':_0x4d0090+_0x41c3('0x3f'),'body':Object[_0x41c3('0x39')]({},{'subject':intUtil[_0x41c3('0x3a')](_0x43d8dd[_0x41c3('0x3b')],_0x279483,'\x20'),'phonenumber':String(_0x279483[_0x41c3('0x27')]),'description':intUtil[_0x41c3('0x3a')](_0x43d8dd[_0x41c3('0x40')],_0x279483,'\x0a'),'regardingobjectid_contact@odata.bind':_0x41c3('0x3c')+_0x54958c[_0x41c3('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x54958c[_0x41c3('0x22')]+')','directioncode':_0x54958c[_0x41c3('0x41')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x54958c[_0x41c3('0x22')]+')','participationtypemask':_0x54958c[_0x41c3('0x41')]===_0x41c3('0x42')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x54958c[_0x41c3('0x30')]+')','participationtypemask':_0x54958c['callDirection']==='queue'?0x1:0x2}]},getCustomFields(_0x43d8dd[_0x41c3('0x3d')],_0x279483,_0x43d8dd[_0x41c3('0x38')])),'headers':{'Authorization':_0x41c3('0x2f')+_0x53ac7e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x233d0a);})[_0x41c3('0x10')](function(_0x3966f4){var _0x22c955=_0x3966f4[_0x41c3('0x29')][_0x41c3('0x43')];var _0x458f40=_0x22c955[_0x41c3('0x2a')](_0x22c955[_0x41c3('0x2b')]('(')+0x1,_0x22c955[_0x41c3('0x2b')](')'));_0x54958c[_0x41c3('0x44')]=_0x458f40;_0x21c3db(_0x54958c);})['catch'](function(_0x5326a6){_0x2b1a06(_0x5326a6[_0x41c3('0x14')]);});});}function emit(_0x1ed33d,_0x1af7ce,_0x33cee8,_0x554352){var _0x5572fb={'uri':util['format'](_0x41c3('0x45'),_0x1ed33d,_0x33cee8,_0x554352)};io['to'](util[_0x41c3('0x46')](_0x41c3('0x47'),_0x1af7ce))[_0x41c3('0x48')](_0x41c3('0x49'),_0x5572fb);}exports['cs']=function(_0x28afd0,_0x17e753,_0x4282f5,_0x14c440,_0x4d304f,_0x563c9d,_0x1b3d99,_0x48340c){var _0x4be6c1={};_0x563c9d[_0x41c3('0xc')]=intUtil[_0x41c3('0x4a')](_0x563c9d[_0x41c3('0xc')]);_0x563c9d[_0x41c3('0x4b')]=intUtil[_0x41c3('0x4a')](_0x563c9d[_0x41c3('0x4b')]);_0x4be6c1[_0x41c3('0x41')]=_0x48340c===_0x41c3('0x42')||_0x48340c===_0x41c3('0x4c')?_0x41c3('0x42'):_0x41c3('0x25');var _0x929e6c=util[_0x41c3('0x46')](_0x41c3('0x4d'),_0x563c9d['remoteUri']);var _0x4fccb2=util['format'](_0x41c3('0x4e'),_0x563c9d[_0x41c3('0x4f')]);var _0x58ca1e=util[_0x41c3('0x46')](_0x41c3('0x50'),_0x563c9d[_0x41c3('0x4b')],_0x17e753[_0x41c3('0x51')],md5(_0x17e753['uniqueid']));if(_0x4d304f&&_0x4d304f[_0x41c3('0x52')]){logger['info'](_0x41c3('0x53'),_0x41c3('0x54'));_0x17e753['recordingURL']=_0x58ca1e;}else if(_0x1b3d99&&_0x1b3d99['recordingFormat']&&_0x1b3d99['recordingFormat']!==_0x41c3('0x55')){logger[_0x41c3('0x1e')](_0x41c3('0x56'),_0x41c3('0x54'));_0x17e753[_0x41c3('0x57')]=_0x58ca1e;}else{_0x17e753['recordingURL']='';}return getUser(_0x4be6c1,_0x563c9d,_0x14c440,_0x4fccb2,_0x929e6c,_0x48340c)['then'](function(_0x362bed){logger[_0x41c3('0x1e')]('['+_0x48340c[_0x41c3('0x1f')]()+']\x20The\x20User\x20ID\x20is:',_0x362bed['userId']);logger[_0x41c3('0x1e')]('['+_0x48340c[_0x41c3('0x1f')]()+_0x41c3('0x58'),_0x362bed[_0x41c3('0x1b')]);return getEndUser(_0x362bed,_0x563c9d,_0x4fccb2,_0x929e6c,_0x17e753,_0x48340c);})[_0x41c3('0x10')](function(_0x4da3e1){logger[_0x41c3('0x1e')]('['+_0x48340c[_0x41c3('0x1f')]()+_0x41c3('0x59'),_0x4da3e1['enduserId']);logger[_0x41c3('0x1e')]('['+_0x48340c['toUpperCase']()+_0x41c3('0x5a'),_0x17e753[_0x41c3('0x27')]);return getTicket(_0x4da3e1,_0x563c9d,_0x4fccb2,_0x929e6c,_0x17e753,_0x4282f5,_0x48340c);})[_0x41c3('0x10')](function(_0x53df15){logger[_0x41c3('0x1e')](util[_0x41c3('0x46')]('['+_0x48340c[_0x41c3('0x1f')]()+_0x41c3('0x5b'),_0x4282f5['ticketType'],_0x53df15[_0x41c3('0x44')]));logger[_0x41c3('0x1e')](util[_0x41c3('0x46')]('['+_0x48340c[_0x41c3('0x1f')]()+_0x41c3('0x5c'),_0x48340c));if(_0x48340c!==_0x41c3('0x4c')){logger[_0x41c3('0x1e')]('['+_0x48340c['toUpperCase']()+']',_0x41c3('0x5d'));emit(_0x563c9d[_0x41c3('0xc')],_0x14c440['name'],_0x4282f5[_0x41c3('0x38')],_0x53df15[_0x41c3('0x44')]);}})[_0x41c3('0x12')](function(_0x304f77){logger['error']('['+_0x48340c['toUpperCase']()+_0x41c3('0x5e'),util[_0x41c3('0x5f')](_0x304f77,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x069c=['queue','ticketType','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','4.0','isNil','validateEmail','userEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','userId','systemuserid','username','calleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','toLowerCase','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','callDirection'];(function(_0x526d31,_0x309f71){var _0x4da01b=function(_0x28b503){while(--_0x28b503){_0x526d31['push'](_0x526d31['shift']());}};_0x4da01b(++_0x309f71);}(_0x069c,0x86));var _0xc069=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x069c[_0x3c51d4];return _0x53c45f;};'use strict';var _=require(_0xc069('0x0'));var BPromise=require('bluebird');var rp=require(_0xc069('0x1'));var util=require(_0xc069('0x2'));var intUtil=require(_0xc069('0x3'));var md5=require(_0xc069('0x4'));var Redis=require('ioredis');var logger=require(_0xc069('0x5'))(_0xc069('0x6'));var config=require(_0xc069('0x7'));config[_0xc069('0x8')]=_[_0xc069('0x9')](config[_0xc069('0x8')],{'host':_0xc069('0xa'),'port':0x18eb});var io=require(_0xc069('0xb'))(new Redis(config['redis']));function getAuthToken(_0x4ae5c7,_0x4eb4c3,_0x23c39e){var _0x4f0af6={'method':_0xc069('0xc'),'uri':_0x4eb4c3,'form':{'client_id':_0x4ae5c7[_0xc069('0xd')],'resource':_0x4ae5c7['remoteUri'],'username':_0x4ae5c7['username'],'password':_0x4ae5c7[_0xc069('0xe')],'grant_type':_0xc069('0xe'),'client_secret':_0x4ae5c7[_0xc069('0xf')]},'json':!![]};return rp(_0x4f0af6)[_0xc069('0x10')](function(_0x5c3422){return _0x5c3422['access_token'];})[_0xc069('0x11')](function(_0x21e3b5){logger[_0xc069('0x12')]('['+[_0x23c39e[_0xc069('0x13')]()]+_0xc069('0x14'));return _0x21e3b5[_0xc069('0x15')];});}function getUser(_0x4275c2,_0x510d9e,_0x24df1d,_0x592726,_0x35bfb4,_0x595a64){return new BPromise(function(_0x40485a,_0x3484ba){return getAuthToken(_0x510d9e,_0x592726,_0x595a64)[_0xc069('0x10')](function(_0x4198fc){var _0x3fb4a4={'method':'GET','uri':_0x35bfb4+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xc069('0x16')+_0x4198fc,'OData-Version':_0xc069('0x17')},'json':!![]};return rp(_0x3fb4a4);})[_0xc069('0x10')](function(_0x2035e6){var _0x225b52=_0x2035e6['value'];var _0x301864=![];var _0x18d88e=null;if(!_[_0xc069('0x18')](_0x24df1d)){if(intUtil[_0xc069('0x19')](_0x24df1d['email'])){_0x4275c2[_0xc069('0x1a')]=_0x24df1d[_0xc069('0x1b')];for(_0x18d88e=0x0;_0x18d88e<_0x225b52[_0xc069('0x1c')];_0x18d88e++){if(_0x225b52[_0x18d88e][_0xc069('0x1d')]===_0x24df1d[_0xc069('0x1b')]&&!_0x225b52[_0x18d88e]['isdisabled']){_0x301864=!![];logger[_0xc069('0x1e')]('['+[_0x595a64['toUpperCase']()]+_0xc069('0x1f')+_0x225b52[_0x18d88e]['systemuserid']+'!');_0x4275c2[_0xc069('0x20')]=_0x225b52[_0x18d88e][_0xc069('0x21')];}}}}if(!_0x301864){logger['info']('['+[_0x595a64['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4275c2[_0xc069('0x1a')]=_0x510d9e[_0xc069('0x22')];for(_0x18d88e=0x0;_0x18d88e<_0x225b52[_0xc069('0x1c')];_0x18d88e++){if(_0x225b52[_0x18d88e][_0xc069('0x1d')]===_0x510d9e[_0xc069('0x22')]){_0x4275c2[_0xc069('0x20')]=_0x225b52[_0x18d88e]['systemuserid'];}}}_0x40485a(_0x4275c2);})[_0xc069('0x11')](function(_0x25b74b){_0x3484ba(_0x25b74b[_0xc069('0x15')]);});});}function createEndUser(_0x1751db,_0x3ea005,_0x54b628,_0x20b0b4,_0x7a70ab,_0x206c91){return new BPromise(function(_0x411dd0,_0x66bbf3){return getAuthToken(_0x3ea005,_0x54b628,_0x206c91)['then'](function(_0x480a8b){var _0x22aecb=_0x206c91['toLowerCase']()==='outbound'?_0x7a70ab['destcalleridnum']:_0x7a70ab[_0xc069('0x23')];var _0x44aadc={'method':'POST','uri':_0x20b0b4+_0xc069('0x24'),'body':{'telephone1':_0x22aecb,'fullname':_0x22aecb,'firstname':_0x22aecb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xc069('0x25')+_0x1751db[_0xc069('0x20')]+')'},'headers':{'Authorization':_0xc069('0x16')+_0x480a8b,'OData-Version':_0xc069('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x44aadc);})[_0xc069('0x10')](function(_0x30db90){var _0x1ea0ba=_0x30db90[_0xc069('0x26')]['odata-entityid'];var _0x32dd91=_0x1ea0ba[_0xc069('0x27')](_0x1ea0ba[_0xc069('0x28')]('(')+0x1,_0x1ea0ba['lastIndexOf'](')'));_0x1751db[_0xc069('0x29')]=_0x32dd91;_0x411dd0(_0x1751db);})['catch'](function(_0x30bc5d){_0x66bbf3(_0x30bc5d[_0xc069('0x15')]);});});}function getEndUser(_0x2e8e28,_0x45195b,_0x354ebb,_0x4e64fb,_0x17b212,_0x882e2b){return new BPromise(function(_0x51cb97,_0x2c8118){var _0xb25d56=_0x882e2b[_0xc069('0x2a')]()===_0xc069('0x2b')?_0x17b212['destcalleridnum']:_0x17b212['calleridnum'];return getAuthToken(_0x45195b,_0x354ebb,_0x882e2b)[_0xc069('0x10')](function(_0x42bfbb){var _0x1841ed={'method':_0xc069('0x2c'),'uri':_0x4e64fb+_0xc069('0x2d')+_0xb25d56['replace']('+','%2b')+'\x27','headers':{'Authorization':_0xc069('0x16')+_0x42bfbb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1841ed);})['then'](function(_0x16b0b2){var _0x59d85b=null;if(_0x16b0b2){var _0xec77c8=_0x16b0b2[_0xc069('0x2e')];var _0xa9424d=![];for(_0x59d85b=0x0;_0x59d85b<_0xec77c8['length'];_0x59d85b++){if(_0xec77c8[_0x59d85b][_0xc069('0x2f')]===_0xb25d56){_0xa9424d=!![];_0x2e8e28['enduserId']=_0xec77c8[_0x59d85b][_0xc069('0x30')];}}if(_0xa9424d){_0x51cb97(_0x2e8e28);}else{return createEndUser(_0x2e8e28,_0x45195b,_0x354ebb,_0x4e64fb,_0x17b212,_0x882e2b)[_0xc069('0x10')](function(_0x4a3698){logger[_0xc069('0x1e')]('['+[_0x882e2b[_0xc069('0x13')]()]+_0xc069('0x31'),_0x4a3698[_0xc069('0x29')]);_0x51cb97(_0x4a3698);});}}else{return createEndUser(_0x2e8e28,_0x45195b,_0x354ebb,_0x4e64fb,_0x17b212,_0x882e2b)[_0xc069('0x10')](function(_0x168b44){logger[_0xc069('0x1e')]('['+[_0x882e2b[_0xc069('0x13')]()]+_0xc069('0x32'),_0x168b44[_0xc069('0x29')]);_0x51cb97(_0x168b44);});}});});}function getCustomFields(_0x5c9403,_0x55f4fb,_0x5d1522){var _0x86f4fb={};if(_0x5c9403[_0xc069('0x1c')]>0x0){_[_0xc069('0x33')](_0x5c9403,function(_0x53773a){if(_[_0xc069('0x34')]([_0xc069('0x35'),_0xc069('0x36')],_0x53773a[_0xc069('0x37')])&&_0x53773a[_0xc069('0x38')]&&!_0x53773a[_0xc069('0x39')]){var _0x28805c=_0x53773a[_0xc069('0x3a')]['toLowerCase']();var _0x3af547=_0x28805c[_0xc069('0x27')](0x0,_0x28805c[_0xc069('0x3b')]('_'));var _0x41f69b=_0x28805c['substring'](_0x28805c[_0xc069('0x3b')]('_')+0x1);if(_0x3af547===_0x5d1522){_0x86f4fb[_0x41f69b]=_0x53773a['content'];}}});}return _0x86f4fb;}function getTicket(_0x3232eb,_0xe23247,_0x17866f,_0x52685c,_0xfe54a3,_0x286a3a,_0x26370c){return new BPromise(function(_0xc09369,_0x54c53e){var _0xa78df5;return getAuthToken(_0xe23247,_0x17866f,_0x26370c)['then'](function(_0x56ff7c){if(_0x286a3a['ticketType']===_0xc069('0x3c')){_0xa78df5={'method':_0xc069('0xc'),'uri':_0x52685c+_0xc069('0x3d'),'body':Object[_0xc069('0x3e')]({},{'title':intUtil[_0xc069('0x3f')](_0x286a3a[_0xc069('0x40')],_0xfe54a3,'\x20'),'description':intUtil[_0xc069('0x3f')](_0x286a3a[_0xc069('0x41')],_0xfe54a3,'\x0a'),'customerid_contact@odata.bind':_0xc069('0x42')+_0x3232eb[_0xc069('0x29')]+')','ownerid@odata.bind':_0xc069('0x25')+_0x3232eb[_0xc069('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x286a3a[_0xc069('0x43')],_0xfe54a3,_0x286a3a['ticketType'])),'headers':{'Authorization':_0xc069('0x16')+_0x56ff7c,'OData-Version':_0xc069('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x286a3a['ticketType']==='phonecall'){_0xa78df5={'method':_0xc069('0xc'),'uri':_0x52685c+_0xc069('0x44'),'body':Object[_0xc069('0x3e')]({},{'subject':intUtil['getString'](_0x286a3a[_0xc069('0x40')],_0xfe54a3,'\x20'),'phonenumber':String(_0xfe54a3['calleridnum']),'description':intUtil[_0xc069('0x3f')](_0x286a3a[_0xc069('0x41')],_0xfe54a3,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x3232eb[_0xc069('0x29')]+')','ownerid@odata.bind':_0xc069('0x25')+_0x3232eb['userId']+')','directioncode':_0x3232eb[_0xc069('0x45')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xc069('0x25')+_0x3232eb['userId']+')','participationtypemask':_0x3232eb['callDirection']===_0xc069('0x46')?0x2:0x1},{'partyid_contact@odata.bind':_0xc069('0x42')+_0x3232eb[_0xc069('0x29')]+')','participationtypemask':_0x3232eb['callDirection']===_0xc069('0x46')?0x1:0x2}]},getCustomFields(_0x286a3a[_0xc069('0x43')],_0xfe54a3,_0x286a3a[_0xc069('0x47')])),'headers':{'Authorization':_0xc069('0x16')+_0x56ff7c,'OData-Version':_0xc069('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xa78df5);})['then'](function(_0xfe0f3c){var _0xa84f2f=_0xfe0f3c['headers'][_0xc069('0x48')];var _0x2e3fb9=_0xa84f2f[_0xc069('0x27')](_0xa84f2f[_0xc069('0x28')]('(')+0x1,_0xa84f2f['lastIndexOf'](')'));_0x3232eb[_0xc069('0x49')]=_0x2e3fb9;_0xc09369(_0x3232eb);})[_0xc069('0x11')](function(_0x3a4514){_0x54c53e(_0x3a4514[_0xc069('0x15')]);});});}function emit(_0xd871a9,_0x5c1924,_0x4ae4d3,_0x467020){var _0x1ae175={'uri':util[_0xc069('0x4a')](_0xc069('0x4b'),_0xd871a9,_0x4ae4d3,_0x467020)};io['to'](util['format'](_0xc069('0x4c'),_0x5c1924))[_0xc069('0x4d')](_0xc069('0x4e'),_0x1ae175);}exports['cs']=function(_0x4a9876,_0x4f768c,_0x1ed548,_0x2dffd8,_0x199e5c,_0x47ecce,_0x4df87c,_0x1822d7){var _0x327339={};_0x47ecce[_0xc069('0x4f')]=intUtil[_0xc069('0x50')](_0x47ecce[_0xc069('0x4f')]);_0x47ecce[_0xc069('0x51')]=intUtil[_0xc069('0x50')](_0x47ecce[_0xc069('0x51')]);_0x327339[_0xc069('0x45')]=_0x1822d7===_0xc069('0x46')||_0x1822d7===_0xc069('0x52')?_0xc069('0x46'):_0xc069('0x2b');var _0x110758=util['format']('%s/api/data/v9.0/',_0x47ecce['remoteUri']);var _0x5b3024=util[_0xc069('0x4a')]('https://login.microsoftonline.com/%s/oauth2/token',_0x47ecce[_0xc069('0x53')]);var _0x12c0d4=util['format'](_0xc069('0x54'),_0x47ecce[_0xc069('0x51')],_0x4f768c['uniqueid'],md5(_0x4f768c[_0xc069('0x55')]));if(_0x199e5c&&_0x199e5c[_0xc069('0x56')]){logger[_0xc069('0x1e')](_0xc069('0x57'),_0xc069('0x58'));_0x4f768c[_0xc069('0x59')]=_0x12c0d4;}else if(_0x4df87c&&_0x4df87c[_0xc069('0x5a')]&&_0x4df87c[_0xc069('0x5a')]!==_0xc069('0x5b')){logger[_0xc069('0x1e')](_0xc069('0x5c'),_0xc069('0x58'));_0x4f768c[_0xc069('0x59')]=_0x12c0d4;}else{_0x4f768c['recordingURL']='';}return getUser(_0x327339,_0x47ecce,_0x2dffd8,_0x5b3024,_0x110758,_0x1822d7)[_0xc069('0x10')](function(_0x506700){logger[_0xc069('0x1e')]('['+_0x1822d7[_0xc069('0x13')]()+_0xc069('0x5d'),_0x506700['userId']);logger[_0xc069('0x1e')]('['+_0x1822d7['toUpperCase']()+_0xc069('0x5e'),_0x506700['userEmail']);return getEndUser(_0x506700,_0x47ecce,_0x5b3024,_0x110758,_0x4f768c,_0x1822d7);})[_0xc069('0x10')](function(_0x4de85e){logger[_0xc069('0x1e')]('['+_0x1822d7['toUpperCase']()+_0xc069('0x5f'),_0x4de85e[_0xc069('0x29')]);logger[_0xc069('0x1e')]('['+_0x1822d7[_0xc069('0x13')]()+_0xc069('0x60'),_0x4f768c[_0xc069('0x23')]);return getTicket(_0x4de85e,_0x47ecce,_0x5b3024,_0x110758,_0x4f768c,_0x1ed548,_0x1822d7);})[_0xc069('0x10')](function(_0x284343){logger[_0xc069('0x1e')](util['format']('['+_0x1822d7[_0xc069('0x13')]()+_0xc069('0x61'),_0x1ed548[_0xc069('0x47')],_0x284343[_0xc069('0x49')]));logger[_0xc069('0x1e')](util['format']('['+_0x1822d7[_0xc069('0x13')]()+_0xc069('0x62'),_0x1822d7));if(_0x1822d7!==_0xc069('0x52')){logger[_0xc069('0x1e')]('['+_0x1822d7['toUpperCase']()+']',_0xc069('0x63'));emit(_0x47ecce[_0xc069('0x4f')],_0x2dffd8['name'],_0x1ed548[_0xc069('0x47')],_0x284343['ticketId']);}})[_0xc069('0x11')](function(_0x1fab65){logger['error']('['+_0x1822d7[_0xc069('0x13')]()+_0xc069('0x64'),util[_0xc069('0x65')](_0x1fab65,{'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 c5538db..ca60f49 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 _0x8295=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','destcalleridname','[OUTBOUND]','monitor_format','toUpperCase','lastevent','lodash','request-promise','util','ioredis','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','calleridname','calleridnum','getString','Subjects','
','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','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!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','length','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','customField','variable','variableName','customVariable','Variable','name','push','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:'];(function(_0x2ac2e7,_0x2ca7d2){var _0x2b1423=function(_0x5f527c){while(--_0x5f527c){_0x2ac2e7['push'](_0x2ac2e7['shift']());}};_0x2b1423(++_0x2ca7d2);}(_0x8295,0x177));var _0x5829=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x8295[_0x4191af];return _0x27bebf;};'use strict';var _=require(_0x5829('0x0'));var rp=require(_0x5829('0x1'));var md5=require('md5');var util=require(_0x5829('0x2'));var Redis=require(_0x5829('0x3'));var intUtil=require('./util');var config=require(_0x5829('0x4'));var logger=require('../../../../config/logger')(_0x5829('0x5'));config[_0x5829('0x6')]=_[_0x5829('0x7')](config['redis'],{'host':_0x5829('0x8'),'port':0x18eb});var io=require(_0x5829('0x9'))(new Redis(config[_0x5829('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x49053f,_0x24b273,_0x2aa44e){io['to'](_0x49053f)[_0x5829('0xa')](_0x24b273,_0x2aa44e);}function getTicket(_0xe69327,_0x21cc1d,_0x3a740e,_0x1d1d02,_0x69b8a4){logger[_0x5829('0xb')](_0x5829('0xc'));var _0x2c3fbe=_['merge']({'responder_id':_0x21cc1d['id'],'requester_id':_0x3a740e['id'],'name':util[_0x5829('0xd')]('Caller\x20-\x20%s',_0x69b8a4[_0x5829('0xe')]),'phone':_0x69b8a4[_0x5829('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5829('0x10')](_0x1d1d02[_0x5829('0x11')],_0x69b8a4,'\x20'),'description':intUtil[_0x5829('0x10')](_0x1d1d02['Descriptions'],_0x69b8a4,_0x5829('0x12')),'tags':getTags(_0x1d1d02[_0x5829('0x13')],'name')},getCustomFields(_0x1d1d02[_0x5829('0x14')],_0x69b8a4));_0x2c3fbe[_0x5829('0x15')]=_[_0x5829('0x16')](_[_0x5829('0x17')](_0x2c3fbe[_0x5829('0x15')],'id'),_0x5829('0x18'));return request({'uri':util[_0x5829('0xd')](_0x5829('0x19'),_0xe69327['remoteUri']),'method':_0x5829('0x1a'),'body':_0x2c3fbe})[_0x5829('0x1b')](function(_0x2c7fd5){logger['info'](_0x5829('0x1c'));return _0x2c7fd5;});}function getUser(_0x14e771,_0x3674e9){if(intUtil['validateEmail'](_0x3674e9)){return request({'uri':util[_0x5829('0xd')](_0x5829('0x1d'),_0x14e771['remoteUri']),'qs':{'email':_0x3674e9}})[_0x5829('0x1b')](function(_0x2f20e2){if(_0x2f20e2['length']){logger['info']('Agent\x20found!');return _[_0x5829('0x1e')](_0x2f20e2,function(_0x164753){return _0x164753[_0x5829('0x1f')][_0x5829('0x20')]===_0x3674e9;});}else{logger[_0x5829('0xb')](_0x5829('0x21'));return request({'uri':util[_0x5829('0xd')](_0x5829('0x22'),_0x14e771[_0x5829('0x23')])})[_0x5829('0x1b')](function(_0x36ca85){logger[_0x5829('0xb')](_0x5829('0x24'));return _0x36ca85;});}});}else{logger[_0x5829('0xb')](_0x5829('0x25'));return request({'uri':util[_0x5829('0xd')](_0x5829('0x22'),_0x14e771[_0x5829('0x23')])})[_0x5829('0x1b')](function(_0x58c3c6){logger['info'](_0x5829('0x24'));return _0x58c3c6;});}}function getEndUser(_0x2105dd,_0x4f2974,_0x5cf646){logger[_0x5829('0xb')](_0x5829('0x26'),_0x5cf646);return request({'uri':util[_0x5829('0xd')](_0x5829('0x27'),_0x2105dd[_0x5829('0x23')]),'qs':{'phone':_0x5cf646}})[_0x5829('0x1b')](function(_0x5f4853){if(_0x5f4853['length']){logger[_0x5829('0xb')](_0x5829('0x28'));return _[_0x5829('0x1e')](_0x5f4853,{'phone':_0x5cf646});}else{logger['info'](_0x5829('0x29'));return request({'uri':util[_0x5829('0xd')](_0x5829('0x27'),_0x2105dd[_0x5829('0x23')]),'method':_0x5829('0x1a'),'body':{'name':_0x4f2974,'phone':_0x5cf646}})['then'](function(_0x5d380e){logger[_0x5829('0xb')]('Enduser\x20created.');return _0x5d380e;});}});}function getAuth(_0x59fb4a){return util[_0x5829('0xd')](_0x5829('0x2a'),new Buffer(_0x59fb4a[_0x5829('0x2b')]+':X')['toString'](_0x5829('0x2c')));}function request(_0x1f3bed){logger[_0x5829('0x2d')](_0x5829('0x2e'),JSON[_0x5829('0x2f')](_0x1f3bed));return rp(_[_0x5829('0x7')](_0x1f3bed,{'method':_0x5829('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x351883,_0x2dc84b){var _0x24097f=[];if(_0x351883&&_0x351883[_0x5829('0x31')]>0x0){_0x24097f=_['map'](_0x351883,_0x2dc84b);}return _0x24097f;}function getCustomFields(_0x5b0427,_0x8d21dc){var _0x371884=[];var _0x7d1e7e={'custom_fields':[]};if(_0x5b0427[_0x5829('0x31')]>0x0){_[_0x5829('0x32')](_0x5b0427,function(_0x12f3b3){if(_[_0x5829('0x33')]([_0x5829('0x34'),_0x5829('0x35')],_0x12f3b3[_0x5829('0x36')])&&_0x12f3b3['nameField']&&!_0x12f3b3['customField']){_0x7d1e7e[_0x12f3b3[_0x5829('0x37')][_0x5829('0x38')]()]=_0x12f3b3['content'][_0x5829('0x39')]();}else if(_[_0x5829('0x33')]([_0x5829('0x34'),'picklist'],_0x12f3b3[_0x5829('0x36')])&&_0x12f3b3[_0x5829('0x3a')]&&_0x12f3b3[_0x5829('0x3b')]){_0x7d1e7e[_0x5829('0x15')]['push']({'id':_0x12f3b3[_0x5829('0x3a')],'value':_0x12f3b3['content'][_0x5829('0x39')]()});}else if(_0x12f3b3[_0x5829('0x36')]===_0x5829('0x3c')&&_0x12f3b3[_0x5829('0x3d')]&&_0x12f3b3[_0x5829('0x3a')]&&_0x12f3b3[_0x5829('0x3b')]){_0x8d21dc[_0x12f3b3['variableName']]&&_0x7d1e7e[_0x5829('0x15')]['push']({'id':_0x12f3b3[_0x5829('0x3a')],'value':_0x8d21dc[_0x12f3b3[_0x5829('0x3d')]][_0x5829('0x39')]()});}else if(_0x12f3b3['type']===_0x5829('0x3e')&&_0x12f3b3[_0x5829('0x3f')]&&_0x12f3b3[_0x5829('0x3f')][_0x5829('0x40')]&&_0x12f3b3[_0x5829('0x3a')]&&_0x12f3b3['customField']){_0x8d21dc[_0x12f3b3[_0x5829('0x3f')]['name'][_0x5829('0x38')]()]&&_0x7d1e7e[_0x5829('0x15')][_0x5829('0x41')]({'id':_0x12f3b3[_0x5829('0x3a')],'value':_0x8d21dc[_0x12f3b3[_0x5829('0x3f')][_0x5829('0x40')]['toLowerCase']()][_0x5829('0x39')]()});}});}return _0x7d1e7e;}exports[_0x5829('0x42')]=function(_0x24c3c1,_0x56fe89,_0x9b41b8,_0x5ae21b,_0x3646b7,_0xf9cefb){var _0x44878d,_0x4761f2;_0xf9cefb[_0x5829('0x23')]=intUtil[_0x5829('0x43')](_0xf9cefb['remoteUri']);_0xf9cefb['serverUrl']=intUtil[_0x5829('0x43')](_0xf9cefb[_0x5829('0x44')]);if(_0x3646b7&&_0x3646b7['monitor_format']){logger[_0x5829('0xb')]('[QUEUE]',_0x5829('0x45'));_0x56fe89['recordingURL']=util['format'](_0x5829('0x46'),_0xf9cefb[_0x5829('0x44')],_0x56fe89[_0x5829('0x47')],md5(_0x56fe89['uniqueid']));}else{_0x56fe89[_0x5829('0x48')]='';}headers[_0x5829('0x49')]=getAuth(_0xf9cefb);return getUser(_0xf9cefb,_0x5ae21b[_0x5829('0x20')])[_0x5829('0x1b')](function(_0x2e11ed){_0x44878d=_0x2e11ed;logger[_0x5829('0xb')](_0x5829('0x4a'),_0x44878d['id']);return getEndUser(_0xf9cefb,_0x56fe89[_0x5829('0xe')],_0x56fe89[_0x5829('0xf')]);})[_0x5829('0x1b')](function(_0x51de12){_0x4761f2=_0x51de12;logger[_0x5829('0xb')](_0x5829('0x4b'),_0x4761f2['id']);return getTicket(_0xf9cefb,_0x44878d,_0x4761f2,_0x9b41b8,_0x56fe89);})[_0x5829('0x1b')](function(_0x278fcc){if(_0x278fcc&&_0x278fcc['id']){logger['info'](_0x5829('0x1c'));logger['info'](_0x5829('0x4c'),_0x278fcc['id']);logger[_0x5829('0xb')](_0x5829('0x4d'),_0x5829('0x4e'));emit(util[_0x5829('0xd')](_0x5829('0x4f'),_0x5ae21b[_0x5829('0x40')]),_0x5829('0x50'),{'uri':util[_0x5829('0xd')]('%s/helpdesk/tickets/%d',_0xf9cefb['remoteUri'],_0x278fcc['id'])});}})[_0x5829('0x51')](function(_0x46ea9e){logger[_0x5829('0x52')](_0x5829('0x4d'),JSON[_0x5829('0x2f')](_0x46ea9e));});};exports['outbound']=function(_0x48cb0f,_0x316f1,_0x174d40,_0x492176,_0x2c083b,_0x51dcf2,_0x4326c5){var _0x58a86a,_0x10c5d2;_0x51dcf2['remoteUri']=intUtil[_0x5829('0x43')](_0x51dcf2['remoteUri']);_0x51dcf2[_0x5829('0x44')]=intUtil[_0x5829('0x43')](_0x51dcf2['serverUrl']);if(_0x4326c5&&_0x4326c5[_0x5829('0x53')]&&_0x4326c5[_0x5829('0x53')]!==_0x5829('0x54')){logger[_0x5829('0xb')]('[OUTBOUND]',_0x5829('0x45'));_0x316f1[_0x5829('0x48')]=util['format'](_0x5829('0x46'),_0x51dcf2[_0x5829('0x44')],_0x316f1[_0x5829('0x47')],md5(_0x316f1['uniqueid']));}headers[_0x5829('0x49')]=getAuth(_0x51dcf2);return getUser(_0x51dcf2,_0x492176[_0x5829('0x20')])[_0x5829('0x1b')](function(_0x24dc09){_0x58a86a=_0x24dc09;logger[_0x5829('0xb')](_0x5829('0x4a'),_0x58a86a['id']);return getEndUser(_0x51dcf2,_0x316f1[_0x5829('0x55')],_0x316f1['destcalleridnum']);})[_0x5829('0x1b')](function(_0x4782b4){_0x10c5d2=_0x4782b4;logger['info'](_0x5829('0x4b'),_0x10c5d2['id']);return getTicket(_0x51dcf2,_0x58a86a,_0x10c5d2,_0x174d40,_0x316f1);})[_0x5829('0x1b')](function(_0x5e1433){if(_0x5e1433&&_0x5e1433['id']){logger[_0x5829('0xb')]('Ticket\x20created!');logger[_0x5829('0xb')](_0x5829('0x4c'),_0x5e1433['id']);logger['info'](_0x5829('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5829('0xd')](_0x5829('0x4f'),_0x492176[_0x5829('0x40')]),_0x5829('0x50'),{'uri':util[_0x5829('0xd')]('%s/helpdesk/tickets/%d',_0x51dcf2['remoteUri'],_0x5e1433['id'])});}})[_0x5829('0x51')](function(_0x86e1e7){logger[_0x5829('0x52')](_0x5829('0x56'),JSON[_0x5829('0x2f')](_0x86e1e7));});};exports['unmanaged']=function(_0x1eead2,_0xa4707f,_0x46c003,_0x1ae33d,_0x240e68,_0xde6e33){var _0x282ed0,_0x5c6a96;_0xde6e33[_0x5829('0x23')]=intUtil[_0x5829('0x43')](_0xde6e33[_0x5829('0x23')]);_0xde6e33[_0x5829('0x44')]=intUtil['stripTrailingSlash'](_0xde6e33['serverUrl']);if(_0x240e68&&_0x240e68[_0x5829('0x57')]){logger['info']('['+_0xa4707f['lastevent'][_0x5829('0x58')]()+']',_0x5829('0x45'));_0xa4707f[_0x5829('0x48')]=util['format'](_0x5829('0x46'),_0xde6e33['serverUrl'],_0xa4707f[_0x5829('0x47')],md5(_0xa4707f[_0x5829('0x47')]));}else{_0xa4707f[_0x5829('0x48')]='';}headers[_0x5829('0x49')]=getAuth(_0xde6e33);return getUser(_0xde6e33,'')[_0x5829('0x1b')](function(_0x397200){_0x282ed0=_0x397200;logger[_0x5829('0xb')](_0x5829('0x4a'),_0x282ed0['id']);return getEndUser(_0xde6e33,_0xa4707f[_0x5829('0xe')],_0xa4707f['calleridnum']);})['then'](function(_0x1e49c8){_0x5c6a96=_0x1e49c8;logger[_0x5829('0xb')](_0x5829('0x4b'),_0x5c6a96['id']);return getTicket(_0xde6e33,_0x282ed0,_0x5c6a96,_0x46c003,_0xa4707f);})['then'](function(_0x316b85){if(_0x316b85){logger[_0x5829('0xb')](_0x5829('0x1c'));logger[_0x5829('0xb')](_0x5829('0x4c'),_0x316b85['id']);}})[_0x5829('0x51')](function(_0x7fe4f4){logger['error']('['+_0xa4707f[_0x5829('0x59')][_0x5829('0x58')]()+']',JSON[_0x5829('0x2f')](_0x7fe4f4));});}; \ No newline at end of file +var _0x1f12=['../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','calleridname','calleridnum','getString','Subjects','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','POST','validateEmail','remoteUri','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','stringify','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','idField','push','variable','variableName','customField','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','toUpperCase','lodash','md5','util'];(function(_0xd3fc94,_0x1275d7){var _0x1821f9=function(_0x5c4dbd){while(--_0x5c4dbd){_0xd3fc94['push'](_0xd3fc94['shift']());}};_0x1821f9(++_0x1275d7);}(_0x1f12,0xaf));var _0x21f1=function(_0x4172b0,_0x564f69){_0x4172b0=_0x4172b0-0x0;var _0x4df734=_0x1f12[_0x4172b0];return _0x4df734;};'use strict';var _=require(_0x21f1('0x0'));var rp=require('request-promise');var md5=require(_0x21f1('0x1'));var util=require(_0x21f1('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x21f1('0x3'));var logger=require(_0x21f1('0x4'))('freshdesk');config[_0x21f1('0x5')]=_[_0x21f1('0x6')](config[_0x21f1('0x5')],{'host':_0x21f1('0x7'),'port':0x18eb});var io=require(_0x21f1('0x8'))(new Redis(config[_0x21f1('0x5')]));var headers={'Content-Type':_0x21f1('0x9'),'Accept':_0x21f1('0x9')};function emit(_0x11ba17,_0x5c1dbd,_0x1ae33b){io['to'](_0x11ba17)[_0x21f1('0xa')](_0x5c1dbd,_0x1ae33b);}function getTicket(_0x46eb26,_0x5444ab,_0x521c51,_0x5ddc03,_0x3ef7d1){logger[_0x21f1('0xb')](_0x21f1('0xc'));var _0x8e0e84=_['merge']({'responder_id':_0x5444ab['id'],'requester_id':_0x521c51['id'],'name':util[_0x21f1('0xd')]('Caller\x20-\x20%s',_0x3ef7d1[_0x21f1('0xe')]),'phone':_0x3ef7d1[_0x21f1('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x21f1('0x10')](_0x5ddc03[_0x21f1('0x11')],_0x3ef7d1,'\x20'),'description':intUtil[_0x21f1('0x10')](_0x5ddc03['Descriptions'],_0x3ef7d1,_0x21f1('0x12')),'tags':getTags(_0x5ddc03[_0x21f1('0x13')],_0x21f1('0x14'))},getCustomFields(_0x5ddc03[_0x21f1('0x15')],_0x3ef7d1));_0x8e0e84['custom_fields']=_[_0x21f1('0x16')](_[_0x21f1('0x17')](_0x8e0e84[_0x21f1('0x18')],'id'),_0x21f1('0x19'));return request({'uri':util[_0x21f1('0xd')](_0x21f1('0x1a'),_0x46eb26['remoteUri']),'method':_0x21f1('0x1b'),'body':_0x8e0e84})['then'](function(_0x26673b){logger[_0x21f1('0xb')]('Ticket\x20created!');return _0x26673b;});}function getUser(_0x12ac0b,_0x4bc4e6){if(intUtil[_0x21f1('0x1c')](_0x4bc4e6)){return request({'uri':util[_0x21f1('0xd')]('%s/api/v2/agents',_0x12ac0b[_0x21f1('0x1d')]),'qs':{'email':_0x4bc4e6}})[_0x21f1('0x1e')](function(_0x2b6f40){if(_0x2b6f40[_0x21f1('0x1f')]){logger['info'](_0x21f1('0x20'));return _['find'](_0x2b6f40,function(_0x153e2d){return _0x153e2d[_0x21f1('0x21')][_0x21f1('0x22')]===_0x4bc4e6;});}else{logger[_0x21f1('0xb')](_0x21f1('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x12ac0b[_0x21f1('0x1d')])})[_0x21f1('0x1e')](function(_0x182a45){logger[_0x21f1('0xb')]('Admin\x20account\x20selected.');return _0x182a45;});}});}else{logger[_0x21f1('0xb')](_0x21f1('0x24'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x12ac0b[_0x21f1('0x1d')])})[_0x21f1('0x1e')](function(_0x4c52c4){logger['info']('Admin\x20account\x20selected.');return _0x4c52c4;});}}function getEndUser(_0x408f92,_0x5d9ea8,_0x533660){logger[_0x21f1('0xb')](_0x21f1('0x25'),_0x533660);return request({'uri':util[_0x21f1('0xd')]('%s/api/v2/contacts',_0x408f92[_0x21f1('0x1d')]),'qs':{'phone':_0x533660}})[_0x21f1('0x1e')](function(_0x340118){if(_0x340118[_0x21f1('0x1f')]){logger[_0x21f1('0xb')](_0x21f1('0x26'));return _[_0x21f1('0x27')](_0x340118,{'phone':_0x533660});}else{logger['info'](_0x21f1('0x28'));return request({'uri':util[_0x21f1('0xd')](_0x21f1('0x29'),_0x408f92[_0x21f1('0x1d')]),'method':_0x21f1('0x1b'),'body':{'name':_0x5d9ea8,'phone':_0x533660}})['then'](function(_0x92ada7){logger[_0x21f1('0xb')](_0x21f1('0x2a'));return _0x92ada7;});}});}function getAuth(_0x1c9169){return util[_0x21f1('0xd')](_0x21f1('0x2b'),new Buffer(_0x1c9169[_0x21f1('0x2c')]+':X')[_0x21f1('0x2d')]('base64'));}function request(_0x51eba2){logger['debug']('[HTTP]',JSON[_0x21f1('0x2e')](_0x51eba2));return rp(_[_0x21f1('0x6')](_0x51eba2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x17a754,_0x348266){var _0x4ba5d1=[];if(_0x17a754&&_0x17a754[_0x21f1('0x1f')]>0x0){_0x4ba5d1=_[_0x21f1('0x2f')](_0x17a754,_0x348266);}return _0x4ba5d1;}function getCustomFields(_0x3f4ca4,_0x5acda0){var _0x2f7427=[];var _0x345963={'custom_fields':[]};if(_0x3f4ca4[_0x21f1('0x1f')]>0x0){_[_0x21f1('0x30')](_0x3f4ca4,function(_0x4c8599){if(_[_0x21f1('0x31')]([_0x21f1('0x32'),_0x21f1('0x33')],_0x4c8599['type'])&&_0x4c8599[_0x21f1('0x34')]&&!_0x4c8599['customField']){_0x345963[_0x4c8599[_0x21f1('0x34')][_0x21f1('0x35')]()]=_0x4c8599[_0x21f1('0x36')]['toString']();}else if(_[_0x21f1('0x31')](['string',_0x21f1('0x33')],_0x4c8599[_0x21f1('0x37')])&&_0x4c8599[_0x21f1('0x38')]&&_0x4c8599['customField']){_0x345963[_0x21f1('0x18')][_0x21f1('0x39')]({'id':_0x4c8599['idField'],'value':_0x4c8599[_0x21f1('0x36')][_0x21f1('0x2d')]()});}else if(_0x4c8599[_0x21f1('0x37')]===_0x21f1('0x3a')&&_0x4c8599[_0x21f1('0x3b')]&&_0x4c8599[_0x21f1('0x38')]&&_0x4c8599[_0x21f1('0x3c')]){_0x5acda0[_0x4c8599[_0x21f1('0x3b')]]&&_0x345963[_0x21f1('0x18')][_0x21f1('0x39')]({'id':_0x4c8599[_0x21f1('0x38')],'value':_0x5acda0[_0x4c8599[_0x21f1('0x3b')]]['toString']()});}else if(_0x4c8599['type']==='customVariable'&&_0x4c8599['Variable']&&_0x4c8599['Variable'][_0x21f1('0x14')]&&_0x4c8599[_0x21f1('0x38')]&&_0x4c8599[_0x21f1('0x3c')]){_0x5acda0[_0x4c8599['Variable'][_0x21f1('0x14')][_0x21f1('0x35')]()]&&_0x345963[_0x21f1('0x18')][_0x21f1('0x39')]({'id':_0x4c8599[_0x21f1('0x38')],'value':_0x5acda0[_0x4c8599[_0x21f1('0x3d')][_0x21f1('0x14')]['toLowerCase']()][_0x21f1('0x2d')]()});}});}return _0x345963;}exports['queue']=function(_0x41cdab,_0x155011,_0x4c76e1,_0x31b327,_0x5dd141,_0x3000a9){var _0x583033,_0x5d3954;_0x3000a9[_0x21f1('0x1d')]=intUtil[_0x21f1('0x3e')](_0x3000a9[_0x21f1('0x1d')]);_0x3000a9[_0x21f1('0x3f')]=intUtil[_0x21f1('0x3e')](_0x3000a9[_0x21f1('0x3f')]);if(_0x5dd141&&_0x5dd141['monitor_format']){logger[_0x21f1('0xb')](_0x21f1('0x40'),_0x21f1('0x41'));_0x155011[_0x21f1('0x42')]=util[_0x21f1('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3000a9[_0x21f1('0x3f')],_0x155011[_0x21f1('0x43')],md5(_0x155011[_0x21f1('0x43')]));}else{_0x155011[_0x21f1('0x42')]='';}headers[_0x21f1('0x44')]=getAuth(_0x3000a9);return getUser(_0x3000a9,_0x31b327[_0x21f1('0x22')])['then'](function(_0x58bfd0){_0x583033=_0x58bfd0;logger[_0x21f1('0xb')]('The\x20User\x20ID\x20is:',_0x583033['id']);return getEndUser(_0x3000a9,_0x155011[_0x21f1('0xe')],_0x155011[_0x21f1('0xf')]);})[_0x21f1('0x1e')](function(_0x8a93af){_0x5d3954=_0x8a93af;logger[_0x21f1('0xb')](_0x21f1('0x45'),_0x5d3954['id']);return getTicket(_0x3000a9,_0x583033,_0x5d3954,_0x4c76e1,_0x155011);})[_0x21f1('0x1e')](function(_0x5ceef4){if(_0x5ceef4&&_0x5ceef4['id']){logger[_0x21f1('0xb')](_0x21f1('0x46'));logger['info'](_0x21f1('0x47'),_0x5ceef4['id']);logger[_0x21f1('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x21f1('0x48'),_0x31b327['name']),_0x21f1('0x49'),{'uri':util[_0x21f1('0xd')](_0x21f1('0x4a'),_0x3000a9[_0x21f1('0x1d')],_0x5ceef4['id'])});}})[_0x21f1('0x4b')](function(_0x56057a){logger[_0x21f1('0x4c')](_0x21f1('0x40'),JSON['stringify'](_0x56057a));});};exports[_0x21f1('0x4d')]=function(_0x440c5d,_0xc20a40,_0xc590b3,_0x20ab1d,_0x5c5602,_0x1bbf23,_0x497c37){var _0x45a08f,_0x1499c2;_0x1bbf23[_0x21f1('0x1d')]=intUtil[_0x21f1('0x3e')](_0x1bbf23[_0x21f1('0x1d')]);_0x1bbf23[_0x21f1('0x3f')]=intUtil[_0x21f1('0x3e')](_0x1bbf23[_0x21f1('0x3f')]);if(_0x497c37&&_0x497c37[_0x21f1('0x4e')]&&_0x497c37['recordingFormat']!==_0x21f1('0x4f')){logger['info'](_0x21f1('0x50'),_0x21f1('0x41'));_0xc20a40[_0x21f1('0x42')]=util[_0x21f1('0xd')](_0x21f1('0x51'),_0x1bbf23[_0x21f1('0x3f')],_0xc20a40[_0x21f1('0x43')],md5(_0xc20a40[_0x21f1('0x43')]));}headers[_0x21f1('0x44')]=getAuth(_0x1bbf23);return getUser(_0x1bbf23,_0x20ab1d['email'])[_0x21f1('0x1e')](function(_0x1050c6){_0x45a08f=_0x1050c6;logger[_0x21f1('0xb')](_0x21f1('0x52'),_0x45a08f['id']);return getEndUser(_0x1bbf23,_0xc20a40[_0x21f1('0x53')],_0xc20a40[_0x21f1('0x54')]);})[_0x21f1('0x1e')](function(_0xea47a5){_0x1499c2=_0xea47a5;logger[_0x21f1('0xb')](_0x21f1('0x45'),_0x1499c2['id']);return getTicket(_0x1bbf23,_0x45a08f,_0x1499c2,_0xc590b3,_0xc20a40);})[_0x21f1('0x1e')](function(_0x2bc8fd){if(_0x2bc8fd&&_0x2bc8fd['id']){logger[_0x21f1('0xb')](_0x21f1('0x46'));logger[_0x21f1('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2bc8fd['id']);logger[_0x21f1('0xb')]('[OUTBOUND]',_0x21f1('0x55'));emit(util['format'](_0x21f1('0x48'),_0x20ab1d['name']),_0x21f1('0x49'),{'uri':util[_0x21f1('0xd')]('%s/helpdesk/tickets/%d',_0x1bbf23[_0x21f1('0x1d')],_0x2bc8fd['id'])});}})[_0x21f1('0x4b')](function(_0x528cda){logger[_0x21f1('0x4c')]('[OUTBOUND]',JSON[_0x21f1('0x2e')](_0x528cda));});};exports[_0x21f1('0x56')]=function(_0x3b2412,_0x10311d,_0x5dad5e,_0x54c88f,_0x2b70f6,_0x454a15){var _0x38c75b,_0x13b9ee;_0x454a15[_0x21f1('0x1d')]=intUtil[_0x21f1('0x3e')](_0x454a15[_0x21f1('0x1d')]);_0x454a15[_0x21f1('0x3f')]=intUtil[_0x21f1('0x3e')](_0x454a15[_0x21f1('0x3f')]);if(_0x2b70f6&&_0x2b70f6[_0x21f1('0x57')]){logger['info']('['+_0x10311d['lastevent'][_0x21f1('0x58')]()+']',_0x21f1('0x41'));_0x10311d[_0x21f1('0x42')]=util[_0x21f1('0xd')](_0x21f1('0x51'),_0x454a15[_0x21f1('0x3f')],_0x10311d[_0x21f1('0x43')],md5(_0x10311d['uniqueid']));}else{_0x10311d['recordingURL']='';}headers['Authorization']=getAuth(_0x454a15);return getUser(_0x454a15,'')['then'](function(_0x3e5481){_0x38c75b=_0x3e5481;logger[_0x21f1('0xb')]('The\x20User\x20ID\x20is:',_0x38c75b['id']);return getEndUser(_0x454a15,_0x10311d['calleridname'],_0x10311d[_0x21f1('0xf')]);})['then'](function(_0x49ffbb){_0x13b9ee=_0x49ffbb;logger['info'](_0x21f1('0x45'),_0x13b9ee['id']);return getTicket(_0x454a15,_0x38c75b,_0x13b9ee,_0x5dad5e,_0x10311d);})[_0x21f1('0x1e')](function(_0x341ec2){if(_0x341ec2){logger[_0x21f1('0xb')]('Ticket\x20created!');logger[_0x21f1('0xb')](_0x21f1('0x47'),_0x341ec2['id']);}})[_0x21f1('0x4b')](function(_0x47af66){logger['error']('['+_0x10311d['lastevent'][_0x21f1('0x58')]()+']',JSON[_0x21f1('0x2e')](_0x47af66));});}; \ 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 7006197..ffe23b7 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 _0x6fc0=['../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','catch','message','/api/lookup?q=','&f=','find','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','./util'];(function(_0x2aa35a,_0x498b17){var _0x53ba25=function(_0x228255){while(--_0x228255){_0x2aa35a['push'](_0x2aa35a['shift']());}};_0x53ba25(++_0x498b17);}(_0x6fc0,0xf3));var _0x06fc=function(_0x2e513d,_0x30c4c8){_0x2e513d=_0x2e513d-0x0;var _0x4dc878=_0x6fc0[_0x2e513d];return _0x4dc878;};'use strict';var _=require('lodash');var rp=require(_0x06fc('0x0'));var md5=require(_0x06fc('0x1'));var util=require(_0x06fc('0x2'));var moment=require(_0x06fc('0x3'));var Promise=require(_0x06fc('0x4'));var Redis=require('ioredis');var intUtil=require(_0x06fc('0x5'));var config=require(_0x06fc('0x6'));var logger=require(_0x06fc('0x7'))(_0x06fc('0x8'));config[_0x06fc('0x9')]=_[_0x06fc('0xa')](config[_0x06fc('0x9')],{'host':_0x06fc('0xb'),'port':0x18eb});var io=require(_0x06fc('0xc'))(new Redis(config['redis']));function getAdminId(_0x294111,_0x2c82b4,_0xb99e39,_0x2d756c){return new Promise(function(_0x5bb6ac,_0x430aad){var _0x536812=![];var _0x1faa90={'method':_0x06fc('0xd'),'uri':_0x2d756c+'/api/selector/owners','json':!![]};_0x1faa90[_0x06fc('0xe')]=_0xb99e39;logger[_0x06fc('0xf')](_0x06fc('0x10'));return rp(_0x1faa90)[_0x06fc('0x11')](function(_0x5ed170){if(_0x5ed170){var _0x328acf=_0x5ed170[_0x06fc('0x12')];var _0x418615=null;for(_0x418615=0x0;_0x418615<_0x328acf[_0x06fc('0x13')];_0x418615++){if(_0x328acf[_0x418615][_0x06fc('0x14')]===_0x294111[_0x06fc('0x15')]){_0x294111[_0x06fc('0x16')]=_0x328acf[_0x418615]['id'];_0x536812=!![];}}if(_0x536812){logger[_0x06fc('0xf')](_0x06fc('0x17'),_0x294111['adminId']);_0x5bb6ac(_0x294111);}else{_0x430aad({'statusCode':0x194,'message':_0x06fc('0x18')});}}else{_0x430aad({'statusCode':0x194,'message':_0x06fc('0x18')});}})['catch'](function(_0x13a3c9){logger[_0x06fc('0x19')]('['+[_0x2c82b4[_0x06fc('0x1a')]()]+']',_0x13a3c9['message']);_0x430aad(_0x13a3c9);});});}function getUser(_0x30e6b5,_0x9af757,_0x46440a){return function(_0xf0e82a){return new Promise(function(_0x5150e0,_0x2ee344){var _0x37189b={'method':'GET','uri':_0x46440a+'/api/selector/owners','json':!![]};_0x37189b[_0x06fc('0xe')]=_0x9af757;logger[_0x06fc('0xf')](_0x06fc('0x1b'));return rp(_0x37189b)[_0x06fc('0x11')](function(_0x1328c3){if(_0x1328c3){var _0x12e75e=_0x1328c3['users'];var _0x1fa3ec=![];var _0x5d2fa4=null;if(_0xf0e82a[_0x06fc('0x1c')]!==null){logger[_0x06fc('0xf')](_0x06fc('0x1d'),_0xf0e82a['agentEmail']);_0xf0e82a['userEmail']=_0xf0e82a['agentEmail'];for(_0x5d2fa4=0x0;_0x5d2fa4<_0x12e75e[_0x06fc('0x13')];_0x5d2fa4++){if(_0x12e75e[_0x5d2fa4][_0x06fc('0x14')]===_0xf0e82a[_0x06fc('0x1c')]){_0x1fa3ec=!![];_0xf0e82a[_0x06fc('0x1e')]=_0x12e75e[_0x5d2fa4]['id'];logger[_0x06fc('0xf')](_0x06fc('0x1f'),_0xf0e82a[_0x06fc('0x1e')]);}}}if(!_0x1fa3ec){logger[_0x06fc('0xf')](_0x06fc('0x20'));_0xf0e82a[_0x06fc('0x21')]=_0xf0e82a['adminEmail'];_0xf0e82a[_0x06fc('0x1e')]=_0xf0e82a[_0x06fc('0x16')];_0x1fa3ec=!![];}if(_0x1fa3ec){_0x5150e0(_0xf0e82a);}else{_0x2ee344({'statusCode':0x194,'message':_0x06fc('0x18')});}}else{_0x2ee344({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x06fc('0x22')](function(_0x1f7cab){logger[_0x06fc('0x19')]('['+[_0x30e6b5[_0x06fc('0x1a')]()]+']',_0x1f7cab[_0x06fc('0x23')]);_0x2ee344(_0x1f7cab);});});};}function searchContact(_0x1ad9a1,_0x1477e6,_0x2868c8,_0x147e48){return new Promise(function(_0x3e2958,_0x5bad00){var _0x558e4c={'method':_0x06fc('0xd'),'headers':_0x1477e6,'uri':_0x1ad9a1+_0x06fc('0x24')+_0x147e48+_0x06fc('0x25')+_0x2868c8+'&entities=contact','json':!![]};rp(_0x558e4c)['then'](function(_0x2a99d7){var _0x385c80=_[_0x06fc('0x26')](_0x2a99d7['contacts']['contacts'],[_0x2868c8,_0x147e48]);_0x3e2958(_0x385c80);})[_0x06fc('0x22')](function(_0x37e967){_0x5bad00(_0x37e967);});});}function getEndUser(_0x455aee,_0xbe615d,_0x3c11fc){return function(_0x5433f7){return new Promise(function(_0x5f5d9a,_0x4ff2ec){logger[_0x06fc('0xf')](util[_0x06fc('0x27')](_0x06fc('0x28'),_0x5433f7[_0x06fc('0x29')]));searchContact(_0x3c11fc,_0xbe615d,_0x06fc('0x2a'),_0x5433f7[_0x06fc('0x29')])[_0x06fc('0x11')](function(_0x530993){if(_0x530993){_0x5433f7[_0x06fc('0x2b')]=_0x530993['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x5433f7[_0x06fc('0x2b')]);return _0x5f5d9a(_0x5433f7);}searchContact(_0x3c11fc,_0xbe615d,_0x06fc('0x2c'),_0x5433f7['contactNumber'])[_0x06fc('0x11')](function(_0x3a1319){if(_0x3a1319){_0x5433f7[_0x06fc('0x2b')]=_0x3a1319['id'];logger[_0x06fc('0xf')](_0x06fc('0x2d'),_0x5433f7['endUserId']);return _0x5f5d9a(_0x5433f7);}createEndUser(_0x5433f7,_0x455aee,_0xbe615d,_0x3c11fc)['then'](function(_0x3f23ef){logger[_0x06fc('0xf')](_0x06fc('0x2e'),_0x3f23ef[_0x06fc('0x2b')]);return _0x5f5d9a(_0x3f23ef);});});})[_0x06fc('0x22')](function(_0x405da3){_0x4ff2ec(_0x405da3);});});};}function createEndUser(_0x12c801,_0x2cae06,_0x3a2e47,_0xec8cff){return new Promise(function(_0x3e7794,_0x2071a7){var _0x1286dd=moment();var _0x4b1f50={'method':_0x06fc('0x2f'),'uri':_0xec8cff+_0x06fc('0x30'),'body':{'contact':{'last_name':_0x12c801['contactNumber'],'work_number':_0x12c801['contactNumber'],'mobile_number':_0x12c801[_0x06fc('0x29')],'owner_id':_0x12c801[_0x06fc('0x1e')],'created_at':_0x1286dd[_0x06fc('0x27')](_0x06fc('0x31'))}},'json':!![]};_0x4b1f50[_0x06fc('0xe')]=_0x3a2e47;logger[_0x06fc('0xf')](_0x06fc('0x32'));return rp(_0x4b1f50)[_0x06fc('0x11')](function(_0x24827a){_0x12c801[_0x06fc('0x2b')]=_0x24827a['contact']['id'];_0x3e7794(_0x12c801);})[_0x06fc('0x22')](function(_0x3ee31d){logger[_0x06fc('0x19')]('['+[_0x2cae06[_0x06fc('0x1a')]()]+']',_0x3ee31d[_0x06fc('0x23')]);_0x2071a7(_0x3ee31d[_0x06fc('0x23')]);});});}function getTicket(_0x2a66e5,_0x5dfcbc,_0x3ccbbf,_0x37f86d,_0x5eebfe){return function(_0x39df57){logger['info'](_0x06fc('0x33'));return new Promise(function(_0x3743e9,_0x3c1cdf){var _0x3bf3a8=moment();var _0x49c1c3={'method':_0x06fc('0x2f'),'uri':_0x3ccbbf+'/api/tasks','body':{'title':intUtil[_0x06fc('0x34')](_0x37f86d[_0x06fc('0x35')],_0x5eebfe,'\x20'),'description':intUtil[_0x06fc('0x34')](_0x37f86d[_0x06fc('0x36')],_0x5eebfe,'\x0a'),'owner_id':_0x39df57['userId'],'creater_id':_0x39df57[_0x06fc('0x16')],'targetable_id':_0x39df57[_0x06fc('0x2b')],'targetable_type':_0x06fc('0x37'),'created_at':_0x3bf3a8[_0x06fc('0x27')](_0x06fc('0x31')),'due_date':_0x3bf3a8['add'](0x1e,'m')[_0x06fc('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x49c1c3[_0x06fc('0xe')]=_0x5dfcbc;return rp(_0x49c1c3)[_0x06fc('0x11')](function(_0x13eb17){_0x39df57[_0x06fc('0x38')]=_0x13eb17['task']['id'];logger[_0x06fc('0xf')](_0x06fc('0x39'),_0x39df57[_0x06fc('0x38')]);_0x3743e9(_0x39df57);})[_0x06fc('0x22')](function(_0x41ce78){logger[_0x06fc('0x19')]('['+[_0x2a66e5[_0x06fc('0x1a')]()]+']',_0x41ce78[_0x06fc('0x23')]);_0x3c1cdf(_0x41ce78[_0x06fc('0x23')]);});});};}function emit(_0x319902,_0x29aa56,_0xf883ef){var _0x13b050={'uri':_0x319902+_0x06fc('0x3a')+_0xf883ef};io['to'](util[_0x06fc('0x27')](_0x06fc('0x3b'),_0x29aa56))[_0x06fc('0x3c')](_0x06fc('0x3d'),_0x13b050);}exports['cs']=function(_0x2bb43b,_0x33599c,_0x242b9d,_0xf92e2f,_0x4788d0,_0xe93682,_0x5be953,_0x569a60){var _0xedcbb4={};var _0x76320c={'Authorization':_0x06fc('0x3e')+_0xe93682[_0x06fc('0x3f')]};_0xe93682[_0x06fc('0x40')]=intUtil[_0x06fc('0x41')](_0xe93682['remoteUri']);_0xe93682[_0x06fc('0x42')]=intUtil['stripTrailingSlash'](_0xe93682['serverUrl']);var _0xbbf122=_0xe93682['remoteUri'];_0xedcbb4[_0x06fc('0x15')]=_0xe93682[_0x06fc('0x43')];_0xedcbb4[_0x06fc('0x29')]=_0x569a60[_0x06fc('0x44')]()===_0x06fc('0x45')?_0x33599c['destcalleridnum']:_0x33599c[_0x06fc('0x46')];_0xedcbb4[_0x06fc('0x47')]=_0x569a60===_0x06fc('0x48')||_0x569a60===_0x06fc('0x49')?_0x06fc('0x48'):_0x06fc('0x45');if(_0xf92e2f){_0xedcbb4[_0x06fc('0x1c')]=_0xf92e2f[_0x06fc('0x14')];}var _0x112f2b=util[_0x06fc('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe93682[_0x06fc('0x42')],_0x33599c[_0x06fc('0x4a')],md5(_0x33599c['uniqueid']));if(_0x4788d0&&_0x4788d0['monitor_format']){logger[_0x06fc('0xf')](_0x06fc('0x4b'),_0x06fc('0x4c'));_0x33599c[_0x06fc('0x4d')]=_0x112f2b;}else if(_0x5be953&&_0x5be953[_0x06fc('0x4e')]&&_0x5be953['recordingFormat']!==_0x06fc('0x4f')){logger[_0x06fc('0xf')]('[OUTBOUND]',_0x06fc('0x4c'));_0x33599c['recordingURL']=_0x112f2b;}else{_0x33599c['recordingURL']='';}return getAdminId(_0xedcbb4,_0x569a60,_0x76320c,_0xbbf122)[_0x06fc('0x11')](getUser(_0x569a60,_0x76320c,_0xbbf122))[_0x06fc('0x11')](getEndUser(_0x569a60,_0x76320c,_0xbbf122))['then'](getTicket(_0x569a60,_0x76320c,_0xbbf122,_0x242b9d,_0x33599c))[_0x06fc('0x11')](function(_0x365f2a){logger[_0x06fc('0xf')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x365f2a[_0x06fc('0x38')]));if(_0x569a60!==_0x06fc('0x49')){logger[_0x06fc('0xf')]('['+[_0x569a60[_0x06fc('0x1a')]()]+']',_0x06fc('0x50'));emit(_0xbbf122,_0xf92e2f[_0x06fc('0x51')],_0x365f2a[_0x06fc('0x2b')]);}})[_0x06fc('0x22')](function(_0xf9f085){logger[_0x06fc('0x19')]('['+[_0x569a60['toUpperCase']()]+_0x06fc('0x52'),util['inspect'](_0xf9f085,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x84d2=['getString','Subjects','Descriptions','Contact','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','md5','util','moment','bluebird','../../../../config/environment','freshsales','redis','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task'];(function(_0x56dd7c,_0x3a82fd){var _0x475cdb=function(_0x411109){while(--_0x411109){_0x56dd7c['push'](_0x56dd7c['shift']());}};_0x475cdb(++_0x3a82fd);}(_0x84d2,0x11b));var _0x284d=function(_0x1499f0,_0x2d11e5){_0x1499f0=_0x1499f0-0x0;var _0x576a80=_0x84d2[_0x1499f0];return _0x576a80;};'use strict';var _=require(_0x284d('0x0'));var rp=require('request-promise');var md5=require(_0x284d('0x1'));var util=require(_0x284d('0x2'));var moment=require(_0x284d('0x3'));var Promise=require(_0x284d('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x284d('0x5'));var logger=require('../../../../config/logger')(_0x284d('0x6'));config[_0x284d('0x7')]=_['defaults'](config[_0x284d('0x7')],{'host':_0x284d('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x1a2b0b,_0x11d0fa,_0x3eba96,_0x2eacea){return new Promise(function(_0x3f5993,_0x1e9e7c){var _0x197e41=![];var _0xf8eb3f={'method':_0x284d('0x9'),'uri':_0x2eacea+_0x284d('0xa'),'json':!![]};_0xf8eb3f[_0x284d('0xb')]=_0x3eba96;logger[_0x284d('0xc')](_0x284d('0xd'));return rp(_0xf8eb3f)[_0x284d('0xe')](function(_0x1263bd){if(_0x1263bd){var _0x1fc577=_0x1263bd['users'];var _0x25f912=null;for(_0x25f912=0x0;_0x25f912<_0x1fc577[_0x284d('0xf')];_0x25f912++){if(_0x1fc577[_0x25f912][_0x284d('0x10')]===_0x1a2b0b[_0x284d('0x11')]){_0x1a2b0b[_0x284d('0x12')]=_0x1fc577[_0x25f912]['id'];_0x197e41=!![];}}if(_0x197e41){logger[_0x284d('0xc')]('Admin\x20found:',_0x1a2b0b[_0x284d('0x12')]);_0x3f5993(_0x1a2b0b);}else{_0x1e9e7c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1e9e7c({'statusCode':0x194,'message':_0x284d('0x13')});}})[_0x284d('0x14')](function(_0x2435be){logger[_0x284d('0x15')]('['+[_0x11d0fa[_0x284d('0x16')]()]+']',_0x2435be[_0x284d('0x17')]);_0x1e9e7c(_0x2435be);});});}function getUser(_0x5d16c8,_0x164cb1,_0x3aebcb){return function(_0x3088e9){return new Promise(function(_0x58c132,_0x513ce9){var _0x1883fe={'method':_0x284d('0x9'),'uri':_0x3aebcb+_0x284d('0xa'),'json':!![]};_0x1883fe['headers']=_0x164cb1;logger[_0x284d('0xc')](_0x284d('0x18'));return rp(_0x1883fe)[_0x284d('0xe')](function(_0x5ecdce){if(_0x5ecdce){var _0x26bc5c=_0x5ecdce[_0x284d('0x19')];var _0x91d6da=![];var _0x3caa9c=null;if(_0x3088e9[_0x284d('0x1a')]!==null){logger['info'](_0x284d('0x1b'),_0x3088e9[_0x284d('0x1a')]);_0x3088e9[_0x284d('0x1c')]=_0x3088e9[_0x284d('0x1a')];for(_0x3caa9c=0x0;_0x3caa9c<_0x26bc5c[_0x284d('0xf')];_0x3caa9c++){if(_0x26bc5c[_0x3caa9c][_0x284d('0x10')]===_0x3088e9[_0x284d('0x1a')]){_0x91d6da=!![];_0x3088e9[_0x284d('0x1d')]=_0x26bc5c[_0x3caa9c]['id'];logger[_0x284d('0xc')](_0x284d('0x1e'),_0x3088e9[_0x284d('0x1d')]);}}}if(!_0x91d6da){logger['info'](_0x284d('0x1f'));_0x3088e9[_0x284d('0x1c')]=_0x3088e9[_0x284d('0x11')];_0x3088e9['userId']=_0x3088e9['adminId'];_0x91d6da=!![];}if(_0x91d6da){_0x58c132(_0x3088e9);}else{_0x513ce9({'statusCode':0x194,'message':_0x284d('0x13')});}}else{_0x513ce9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x33123a){logger[_0x284d('0x15')]('['+[_0x5d16c8[_0x284d('0x16')]()]+']',_0x33123a[_0x284d('0x17')]);_0x513ce9(_0x33123a);});});};}function searchContact(_0x2775d8,_0x18dd75,_0x54cd5b,_0x1e422a){return new Promise(function(_0x4d0607,_0x4b427c){var _0x78fe9f={'method':_0x284d('0x9'),'headers':_0x18dd75,'uri':_0x2775d8+'/api/lookup?q='+_0x1e422a+_0x284d('0x20')+_0x54cd5b+'&entities=contact','json':!![]};rp(_0x78fe9f)[_0x284d('0xe')](function(_0x5802d2){var _0x3966fb=_[_0x284d('0x21')](_0x5802d2[_0x284d('0x22')][_0x284d('0x22')],[_0x54cd5b,_0x1e422a]);_0x4d0607(_0x3966fb);})['catch'](function(_0x507d18){_0x4b427c(_0x507d18);});});}function getEndUser(_0x30eb68,_0x40b035,_0x499330){return function(_0x21d754){return new Promise(function(_0x45d799,_0xe002bd){logger[_0x284d('0xc')](util[_0x284d('0x23')](_0x284d('0x24'),_0x21d754[_0x284d('0x25')]));searchContact(_0x499330,_0x40b035,_0x284d('0x26'),_0x21d754[_0x284d('0x25')])[_0x284d('0xe')](function(_0x523408){if(_0x523408){_0x21d754[_0x284d('0x27')]=_0x523408['id'];logger[_0x284d('0xc')](_0x284d('0x28'),_0x21d754[_0x284d('0x27')]);return _0x45d799(_0x21d754);}searchContact(_0x499330,_0x40b035,_0x284d('0x29'),_0x21d754['contactNumber'])['then'](function(_0x3d833f){if(_0x3d833f){_0x21d754['endUserId']=_0x3d833f['id'];logger[_0x284d('0xc')](_0x284d('0x2a'),_0x21d754[_0x284d('0x27')]);return _0x45d799(_0x21d754);}createEndUser(_0x21d754,_0x30eb68,_0x40b035,_0x499330)['then'](function(_0x5235d4){logger[_0x284d('0xc')](_0x284d('0x2b'),_0x5235d4['endUserId']);return _0x45d799(_0x5235d4);});});})[_0x284d('0x14')](function(_0x30f09e){_0xe002bd(_0x30f09e);});});};}function createEndUser(_0x32be9e,_0x4433da,_0x4136af,_0x5beefc){return new Promise(function(_0x41a9e6,_0xc33b42){var _0x18ea01=moment();var _0x3f3701={'method':_0x284d('0x2c'),'uri':_0x5beefc+_0x284d('0x2d'),'body':{'contact':{'last_name':_0x32be9e[_0x284d('0x25')],'work_number':_0x32be9e[_0x284d('0x25')],'mobile_number':_0x32be9e['contactNumber'],'owner_id':_0x32be9e[_0x284d('0x1d')],'created_at':_0x18ea01['format'](_0x284d('0x2e'))}},'json':!![]};_0x3f3701[_0x284d('0xb')]=_0x4136af;logger[_0x284d('0xc')](_0x284d('0x2f'));return rp(_0x3f3701)['then'](function(_0x47d61c){_0x32be9e[_0x284d('0x27')]=_0x47d61c['contact']['id'];_0x41a9e6(_0x32be9e);})[_0x284d('0x14')](function(_0x46bbb6){logger['error']('['+[_0x4433da['toUpperCase']()]+']',_0x46bbb6[_0x284d('0x17')]);_0xc33b42(_0x46bbb6[_0x284d('0x17')]);});});}function getTicket(_0x43f0fa,_0x2b5bdf,_0x23c48c,_0xe663c1,_0x5b17ab){return function(_0x39788f){logger['info'](_0x284d('0x30'));return new Promise(function(_0x393098,_0x5cfece){var _0x56e38a=moment();var _0x98b6ec={'method':'POST','uri':_0x23c48c+'/api/tasks','body':{'title':intUtil[_0x284d('0x31')](_0xe663c1[_0x284d('0x32')],_0x5b17ab,'\x20'),'description':intUtil['getString'](_0xe663c1[_0x284d('0x33')],_0x5b17ab,'\x0a'),'owner_id':_0x39788f[_0x284d('0x1d')],'creater_id':_0x39788f[_0x284d('0x12')],'targetable_id':_0x39788f['endUserId'],'targetable_type':_0x284d('0x34'),'created_at':_0x56e38a[_0x284d('0x23')](_0x284d('0x2e')),'due_date':_0x56e38a['add'](0x1e,'m')[_0x284d('0x23')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x98b6ec['headers']=_0x2b5bdf;return rp(_0x98b6ec)[_0x284d('0xe')](function(_0x317175){_0x39788f[_0x284d('0x35')]=_0x317175[_0x284d('0x36')]['id'];logger[_0x284d('0xc')]('Task\x20created:',_0x39788f[_0x284d('0x35')]);_0x393098(_0x39788f);})['catch'](function(_0x334706){logger[_0x284d('0x15')]('['+[_0x43f0fa[_0x284d('0x16')]()]+']',_0x334706[_0x284d('0x17')]);_0x5cfece(_0x334706[_0x284d('0x17')]);});});};}function emit(_0x638944,_0x265ace,_0x3c3463){var _0x3c50d7={'uri':_0x638944+_0x284d('0x37')+_0x3c3463};io['to'](util[_0x284d('0x23')](_0x284d('0x38'),_0x265ace))[_0x284d('0x39')](_0x284d('0x3a'),_0x3c50d7);}exports['cs']=function(_0x36e6d9,_0xb31590,_0x1cc27f,_0x3ba762,_0x4c68d5,_0x2a6a58,_0x362c1b,_0x435777){var _0x51f77c={};var _0x14b09c={'Authorization':'Token\x20token='+_0x2a6a58[_0x284d('0x3b')]};_0x2a6a58[_0x284d('0x3c')]=intUtil[_0x284d('0x3d')](_0x2a6a58['remoteUri']);_0x2a6a58[_0x284d('0x3e')]=intUtil[_0x284d('0x3d')](_0x2a6a58['serverUrl']);var _0x2a2200=_0x2a6a58[_0x284d('0x3c')];_0x51f77c[_0x284d('0x11')]=_0x2a6a58[_0x284d('0x3f')];_0x51f77c[_0x284d('0x25')]=_0x435777[_0x284d('0x40')]()===_0x284d('0x41')?_0xb31590[_0x284d('0x42')]:_0xb31590[_0x284d('0x43')];_0x51f77c[_0x284d('0x44')]=_0x435777===_0x284d('0x45')||_0x435777===_0x284d('0x46')?_0x284d('0x45'):'outbound';if(_0x3ba762){_0x51f77c[_0x284d('0x1a')]=_0x3ba762[_0x284d('0x10')];}var _0x91ffce=util[_0x284d('0x23')](_0x284d('0x47'),_0x2a6a58[_0x284d('0x3e')],_0xb31590[_0x284d('0x48')],md5(_0xb31590[_0x284d('0x48')]));if(_0x4c68d5&&_0x4c68d5['monitor_format']){logger[_0x284d('0xc')](_0x284d('0x49'),_0x284d('0x4a'));_0xb31590[_0x284d('0x4b')]=_0x91ffce;}else if(_0x362c1b&&_0x362c1b[_0x284d('0x4c')]&&_0x362c1b[_0x284d('0x4c')]!==_0x284d('0x4d')){logger[_0x284d('0xc')](_0x284d('0x4e'),_0x284d('0x4a'));_0xb31590[_0x284d('0x4b')]=_0x91ffce;}else{_0xb31590['recordingURL']='';}return getAdminId(_0x51f77c,_0x435777,_0x14b09c,_0x2a2200)[_0x284d('0xe')](getUser(_0x435777,_0x14b09c,_0x2a2200))[_0x284d('0xe')](getEndUser(_0x435777,_0x14b09c,_0x2a2200))['then'](getTicket(_0x435777,_0x14b09c,_0x2a2200,_0x1cc27f,_0xb31590))[_0x284d('0xe')](function(_0x5a57f8){logger['info'](util['format'](_0x284d('0x4f'),_0x5a57f8[_0x284d('0x35')]));if(_0x435777!==_0x284d('0x46')){logger[_0x284d('0xc')]('['+[_0x435777[_0x284d('0x16')]()]+']',_0x284d('0x50'));emit(_0x2a2200,_0x3ba762[_0x284d('0x51')],_0x5a57f8[_0x284d('0x27')]);}})[_0x284d('0x14')](function(_0x39c611){logger[_0x284d('0x15')]('['+[_0x435777['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x284d('0x52')](_0x39c611,{'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 3fe94b3..c7f191a 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 _0xb665=['freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','desk','vtiger','dynamics365'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0xb665,0xf4));var _0x5b66=function(_0x86728a,_0x1b070f){_0x86728a=_0x86728a-0x0;var _0x3b0b26=_0xb665[_0x86728a];return _0x3b0b26;};'use strict';var _=require(_0x5b66('0x0'));var util=require(_0x5b66('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x5b66('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x5b66('0x3'));var desk=require(_0x5b66('0x4'));var vtiger=require(_0x5b66('0x5'));var servicenow=require(_0x5b66('0x6'));var dynamics365=require(_0x5b66('0x7'));var freshsales=require(_0x5b66('0x8'));var integrations=[_0x5b66('0x9'),'salesforce',_0x5b66('0xa'),_0x5b66('0xb'),'zoho',_0x5b66('0xc'),_0x5b66('0xd'),_0x5b66('0xe'),_0x5b66('0xf'),_0x5b66('0x10')];exports[_0x5b66('0x11')]=function(_0x539f67,_0xf6e45a,_0x5597e4,_0x532c88,_0x468bcf,_0x17e0e8){if(_0x5597e4){if(_['includes'](integrations,_0x539f67[_0x5b66('0x12')][_0x5b66('0x13')]())){try{var _0x236848=null;var _0x48ac2a='';var _0x2f0aa2=_0x5597e4[_0x539f67[_0x5b66('0x12')]['toLowerCase']()];if(_0x2f0aa2){var _0x368560=_0x2f0aa2[_0x539f67[_0x5b66('0x14')]];if(_0x368560){var _0xf7c4ad=_[_0x5b66('0x15')](_0x368560[_0x5b66('0x16')],{'id':parseInt(_0x539f67[_0x5b66('0x17')],0xa)});if(_0xf7c4ad){if(_0x532c88){if(_0x468bcf&&_0xf6e45a[_0x5b66('0x18')]){_0x48ac2a='queue';}else if(_0xf6e45a[_0x5b66('0x19')]){_0x48ac2a=_0x5b66('0x1a');}else{console[_0x5b66('0x1b')](_0x5b66('0x1c'),_0xf6e45a);}}else{_0x48ac2a=_0x5b66('0x1d');}switch(_0x539f67[_0x5b66('0x12')][_0x5b66('0x13')]()){case _0x5b66('0x9'):zendesk[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case'salesforce':salesforce[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case'sugarcrm':sugarcrm[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case _0x5b66('0xb'):freshdesk[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case _0x5b66('0x1e'):zoho[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case _0x5b66('0xc'):desk[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case _0x5b66('0xd'):vtiger[_0x48ac2a](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8);break;case'freshsales':freshsales['cs'](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8,_0x48ac2a);break;case _0x5b66('0x10'):servicenow['cs'](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8,_0x48ac2a);break;case _0x5b66('0xe'):dynamics365['cs'](_0x539f67,_0xf6e45a,_0xf7c4ad,_0x532c88,_0x468bcf,_0x368560,_0x17e0e8,_0x48ac2a);break;default:console[_0x5b66('0x1b')]('unknown\x20integration');}}else{_0x236848=require('../../../../config/logger')(_0x539f67[_0x5b66('0x12')]['toLowerCase']());_0x236848[_0x5b66('0x1f')](_0x5b66('0x20'),util[_0x5b66('0x21')](_0x5b66('0x22'),_0x539f67['data1'][_0x5b66('0x13')](),_0x539f67[_0x5b66('0x17')]));}}else{_0x236848=require(_0x5b66('0x23'))(_0x539f67[_0x5b66('0x12')]['toLowerCase']());_0x236848[_0x5b66('0x1f')](_0x5b66('0x20'),util[_0x5b66('0x21')](_0x5b66('0x24'),_0x539f67[_0x5b66('0x12')][_0x5b66('0x13')](),_0x539f67[_0x5b66('0x14')]));}}else{}}catch(_0x17efc3){console[_0x5b66('0x1f')](_0x17efc3);}}}}; \ No newline at end of file +var _0x1ccb=['desk','vtiger','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','salesforce','unknown\x20integration','error','[EXEC]','data3','../../../../config/logger','format','%s\x20account\x20#%s\x20not\x20found','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','freshdesk','zoho'];(function(_0x25838d,_0xfc827f){var _0x2627fc=function(_0x1e3c49){while(--_0x1e3c49){_0x25838d['push'](_0x25838d['shift']());}};_0x2627fc(++_0xfc827f);}(_0x1ccb,0x105));var _0xb1cc=function(_0x5e95b7,_0x5a5d14){_0x5e95b7=_0x5e95b7-0x0;var _0x4f0fd4=_0x1ccb[_0x5e95b7];return _0x4f0fd4;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0xb1cc('0x0'));var salesforce=require(_0xb1cc('0x1'));var sugarcrm=require(_0xb1cc('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0xb1cc('0x3'));var desk=require(_0xb1cc('0x4'));var vtiger=require(_0xb1cc('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xb1cc('0x6'));var freshsales=require(_0xb1cc('0x7'));var integrations=[_0xb1cc('0x8'),'salesforce','sugarcrm',_0xb1cc('0x9'),_0xb1cc('0xa'),_0xb1cc('0xb'),_0xb1cc('0xc'),_0xb1cc('0xd'),_0xb1cc('0xe'),_0xb1cc('0xf')];exports['exec']=function(_0x287508,_0x1c89ef,_0x1cf8d0,_0x5b8d52,_0x41857c,_0xb465be){if(_0x1cf8d0){if(_[_0xb1cc('0x10')](integrations,_0x287508[_0xb1cc('0x11')][_0xb1cc('0x12')]())){try{var _0x377c5e=null;var _0x458277='';var _0x44014c=_0x1cf8d0[_0x287508[_0xb1cc('0x11')][_0xb1cc('0x12')]()];if(_0x44014c){var _0x5710b9=_0x44014c[_0x287508[_0xb1cc('0x13')]];if(_0x5710b9){var _0x2c0205=_['find'](_0x5710b9[_0xb1cc('0x14')],{'id':parseInt(_0x287508['data3'],0xa)});if(_0x2c0205){if(_0x5b8d52){if(_0x41857c&&_0x1c89ef[_0xb1cc('0x15')]){_0x458277=_0xb1cc('0x15');}else if(_0x1c89ef[_0xb1cc('0x16')]){_0x458277=_0xb1cc('0x17');}else{console[_0xb1cc('0x18')](_0xb1cc('0x19'),_0x1c89ef);}}else{_0x458277='unmanaged';}switch(_0x287508[_0xb1cc('0x11')][_0xb1cc('0x12')]()){case _0xb1cc('0x8'):zendesk[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case _0xb1cc('0x1a'):salesforce[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case'sugarcrm':sugarcrm[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case'freshdesk':freshdesk[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case _0xb1cc('0xa'):zoho[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case _0xb1cc('0xb'):desk[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case _0xb1cc('0xc'):vtiger[_0x458277](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be);break;case'freshsales':freshsales['cs'](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be,_0x458277);break;case _0xb1cc('0xf'):servicenow['cs'](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be,_0x458277);break;case'dynamics365':dynamics365['cs'](_0x287508,_0x1c89ef,_0x2c0205,_0x5b8d52,_0x41857c,_0x5710b9,_0xb465be,_0x458277);break;default:console[_0xb1cc('0x18')](_0xb1cc('0x1b'));}}else{_0x377c5e=require('../../../../config/logger')(_0x287508['data1'][_0xb1cc('0x12')]());_0x377c5e[_0xb1cc('0x1c')](_0xb1cc('0x1d'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x287508[_0xb1cc('0x11')]['toLowerCase'](),_0x287508[_0xb1cc('0x1e')]));}}else{_0x377c5e=require(_0xb1cc('0x1f'))(_0x287508[_0xb1cc('0x11')]['toLowerCase']());_0x377c5e[_0xb1cc('0x1c')](_0xb1cc('0x1d'),util[_0xb1cc('0x20')](_0xb1cc('0x21'),_0x287508[_0xb1cc('0x11')][_0xb1cc('0x12')](),_0x287508[_0xb1cc('0x13')]));}}else{}}catch(_0xc8678b){console['error'](_0xc8678b);}}}}; \ 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 d98756d..3581437 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 _0x6008=['util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','execute','then','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','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','length','Contact','account','first','attributes','type','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','create','forEach','includes','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lastevent','request-promise','bluebird','md5','jsforce'];(function(_0x3a8114,_0x549ce8){var _0x4ebb2f=function(_0x1e9106){while(--_0x1e9106){_0x3a8114['push'](_0x3a8114['shift']());}};_0x4ebb2f(++_0x549ce8);}(_0x6008,0x7b));var _0x8600=function(_0x1a1c3b,_0x28fabb){_0x1a1c3b=_0x1a1c3b-0x0;var _0x3d532a=_0x6008[_0x1a1c3b];return _0x3d532a;};'use strict';var _=require('lodash');var rp=require(_0x8600('0x0'));var moment=require('moment');var BPromise=require(_0x8600('0x1'));var md5=require(_0x8600('0x2'));var jsforce=require(_0x8600('0x3'));var util=require(_0x8600('0x4'));var Redis=require(_0x8600('0x5'));var intUtil=require('./util');var config=require(_0x8600('0x6'));var logger=require(_0x8600('0x7'))('salesforce');config[_0x8600('0x8')]=_[_0x8600('0x9')](config['redis'],{'host':_0x8600('0xa'),'port':0x18eb});var io=require(_0x8600('0xb'))(new Redis(config[_0x8600('0x8')]));function emit(_0x17d826,_0xae51e4,_0x4061fe){io['to'](_0x17d826)[_0x8600('0xc')](_0xae51e4,_0x4061fe);}function getTicket(_0x5f1132,_0x5b45db,_0x113720,_0x195bea,_0x3504c9,_0x9b8598,_0x450462,_0x5c63eb){var _0x39df07=Object[_0x8600('0xd')]({},{'OwnerId':_0x5b45db['id'],'Subject':intUtil['getString'](_0x195bea['Subjects'],_0x3504c9,'\x20'),'Description':intUtil[_0x8600('0xe')](_0x195bea[_0x8600('0xf')],_0x3504c9,'\x0a')},getCustomFields(_0x9b8598,_0x3504c9));if(_0x113720){if(_0x195bea['ticketType']==='Task'){_0x39df07['ActivityDate']=moment['utc']();_0x39df07[_0x8600('0x10')]=![];_0x39df07[_0x8600('0x11')]=![];if(_0x113720[_0x8600('0x12')]===_0x8600('0x13')||_0x113720[_0x8600('0x12')]===_0x8600('0x14')){_0x39df07[_0x8600('0x15')]=_0x113720['id'];}else if(_0x113720['endUserType']==='account'){_0x39df07['WhatId']=_0x113720['id'];}}else if(_0x195bea['ticketType']===_0x8600('0x16')){if(_0x113720['endUserType']===_0x8600('0x13')){_0x39df07[_0x8600('0x17')]=_0x113720['id'];}else if(_0x113720[_0x8600('0x12')]==='account'){_0x39df07[_0x8600('0x18')]=_0x113720['id'];}else if(_0x113720[_0x8600('0x12')]===_0x8600('0x14')&&_0x195bea[_0x8600('0x19')]){_0x39df07[_0x195bea['leadId']]=_0x113720['id'];}else{logger['info'](_0x8600('0x1a'));}}}return _0x450462['sobject'](_0x195bea['ticketType'])['create'](_0x39df07);}function getUser(_0x5c14db,_0x582cf4,_0x1ebfc9){if(!_[_0x8600('0x1b')](_0x582cf4)&&intUtil[_0x8600('0x1c')](_0x582cf4)){var _0x2d28c9={'Email':_0x582cf4};var _0x5a8b3d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1ebfc9[_0x8600('0x1d')](_0x8600('0x1e'))[_0x8600('0x1f')](_0x2d28c9,_0x5a8b3d)[_0x8600('0x20')]()[_0x8600('0x21')](function(_0x345d94){if(_0x345d94['length']){var _0x470b40=_[_0x8600('0x1f')](_0x345d94,function(_0x5dd856){return _0x5dd856[_0x8600('0x22')]===_0x582cf4;});if(_0x470b40){logger[_0x8600('0x23')](_0x8600('0x24'),_0x582cf4);return BPromise[_0x8600('0x25')]({'id':_0x470b40['Id'],'name':_0x470b40[_0x8600('0x26')]});}}else{logger[_0x8600('0x23')](_0x8600('0x27'),_0x582cf4);return _0x1ebfc9[_0x8600('0x28')]()['then'](function(_0x1fcbca){return BPromise[_0x8600('0x25')]({'id':_0x1fcbca['user_id'],'name':_0x1fcbca['display_name']});});}});}else{logger['info'](_0x8600('0x27'),_0x582cf4);return _0x1ebfc9[_0x8600('0x28')]()[_0x8600('0x21')](function(_0x4412be){return BPromise[_0x8600('0x25')]({'id':_0x4412be[_0x8600('0x29')],'name':_0x4412be[_0x8600('0x2a')]});});}}function getEndUser(_0x5779c6,_0x3dd6de,_0x56c83e,_0x4f27ff,_0xcb34b1){var _0x247af1={'$or':{'Phone':_0x4f27ff}};var _0x574f3b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8600('0x25')]()['then'](function(){logger['info'](_0x8600('0x2b'),_0x4f27ff,_0x3dd6de[_0x8600('0x2c')]);switch(_0x3dd6de[_0x8600('0x2c')]){case _0x8600('0x2d'):var _0x410b64=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de['additionalSearchContact']){var _0x1bed38={};_0x1bed38[_0x3dd6de[_0x8600('0x2f')]]=_0x4f27ff;_[_0x8600('0x30')](_0x410b64[_0x8600('0x31')],_0x1bed38);}return _0xcb34b1[_0x8600('0x1d')]('Contact')[_0x8600('0x1f')](_0x410b64,_0x574f3b)[_0x8600('0x20')]()['then'](function(_0x52ebaf){if(_0x52ebaf&&_0x52ebaf['length']){return _0x52ebaf;}else{var _0x3d7a9a=_['cloneDeep'](_0x247af1);if(_0x3dd6de['additionalSearchLead']){var _0x6a8635={};_0x6a8635[_0x3dd6de[_0x8600('0x32')]]=_0x4f27ff;_[_0x8600('0x30')](_0x3d7a9a['$or'],_0x6a8635);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x33'))[_0x8600('0x1f')](_0x3d7a9a,_0x574f3b);}});case _0x8600('0x34'):var _0x1912d4=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de[_0x8600('0x35')]){var _0x1bed38={};_0x1bed38[_0x3dd6de['additionalSearchAccount']]=_0x4f27ff;_[_0x8600('0x30')](_0x1912d4[_0x8600('0x31')],_0x1bed38);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x36'))['find'](_0x1912d4,_0x574f3b)[_0x8600('0x20')]()[_0x8600('0x21')](function(_0x494870){if(_0x494870&&_0x494870[_0x8600('0x37')]){return _0x494870;}else{var _0x5cb9db=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de[_0x8600('0x2f')]){var _0x5a9e7c={};_0x5a9e7c[_0x3dd6de[_0x8600('0x2f')]]=_0x4f27ff;_[_0x8600('0x30')](_0x5cb9db['$or'],_0x5a9e7c);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x38'))[_0x8600('0x1f')](_0x5cb9db,_0x574f3b)[_0x8600('0x21')](function(_0x1ce062){if(_0x1ce062&&_0x1ce062['length']){return _0x1ce062;}else{var _0x3241bf=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de['additionalSearchLead']){var _0x3603ba={};_0x3603ba[_0x3dd6de['additionalSearchLead']]=_0x4f27ff;_[_0x8600('0x30')](_0x3241bf[_0x8600('0x31')],_0x3603ba);}return _0xcb34b1['sobject'](_0x8600('0x33'))[_0x8600('0x1f')](_0x3241bf,_0x574f3b);}});}});case _0x8600('0x13'):var _0x410b64=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de[_0x8600('0x2f')]){var _0x1bed38={};_0x1bed38[_0x3dd6de['additionalSearchContact']]=_0x4f27ff;_[_0x8600('0x30')](_0x410b64[_0x8600('0x31')],_0x1bed38);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x38'))[_0x8600('0x1f')](_0x410b64,_0x574f3b)[_0x8600('0x20')]();case _0x8600('0x14'):var _0x3a81fd=_['cloneDeep'](_0x247af1);if(_0x3dd6de[_0x8600('0x32')]){var _0x1bed38={};_0x1bed38[_0x3dd6de[_0x8600('0x32')]]=_0x4f27ff;_[_0x8600('0x30')](_0x3a81fd['$or'],_0x1bed38);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x33'))[_0x8600('0x1f')](_0x3a81fd,_0x574f3b);case _0x8600('0x39'):var _0x1912d4=_[_0x8600('0x2e')](_0x247af1);if(_0x3dd6de[_0x8600('0x35')]){var _0x1bed38={};_0x1bed38[_0x3dd6de['additionalSearchAccount']]=_0x4f27ff;_[_0x8600('0x30')](_0x1912d4[_0x8600('0x31')],_0x1bed38);}return _0xcb34b1[_0x8600('0x1d')](_0x8600('0x36'))[_0x8600('0x1f')](_0x1912d4,_0x574f3b);default:return null;}})['then'](function(_0xd79a40){if(_0xd79a40&&_0xd79a40[_0x8600('0x37')]){var _0x9169c6=_[_0x8600('0x3a')](_0xd79a40);if(_0x9169c6){return BPromise['resolve']({'id':_0x9169c6['Id'],'name':_0x9169c6[_0x8600('0x26')],'phone':_0x9169c6['Phone'],'endUserType':_0x9169c6[_0x8600('0x3b')][_0x8600('0x3c')]['toLowerCase']()});}}})[_0x8600('0x21')](function(_0x5ddcc5){if(_0x5ddcc5){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5ddcc5[_0x8600('0x12')],_0x4f27ff);return BPromise[_0x8600('0x25')](_0x5ddcc5);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x4f27ff);var _0x49ed6b={'Phone':_0x4f27ff};if(_0x3dd6de[_0x8600('0x3d')]){if(_0x3dd6de[_0x8600('0x3d')]===_0x8600('0x13')){logger[_0x8600('0x23')](_0x8600('0x3e'),_0x4f27ff,_0x3dd6de['moduleCreate']);_0x49ed6b[_0x8600('0x3f')]=_0x56c83e!==_0x8600('0x40')?_0x56c83e:util[_0x8600('0x41')](_0x8600('0x42'),_0x4f27ff);}else if(_0x3dd6de['moduleCreate']===_0x8600('0x14')){logger[_0x8600('0x23')](_0x8600('0x3e'),_0x4f27ff,_0x3dd6de['moduleCreate']);_0x49ed6b['LastName']=_0x56c83e!==_0x8600('0x40')?_0x56c83e:util[_0x8600('0x41')]('Caller\x20-\x20%s',_0x4f27ff);_0x49ed6b[_0x8600('0x43')]=_0x8600('0x44');}else if(_0x3dd6de['moduleCreate']===_0x8600('0x39')){logger[_0x8600('0x23')](_0x8600('0x3e'),_0x4f27ff,_0x3dd6de[_0x8600('0x3d')]);_0x49ed6b['Name']=_0x56c83e!==_0x8600('0x40')?_0x56c83e:util[_0x8600('0x41')](_0x8600('0x42'),_0x4f27ff);}else{return null;}}return _0xcb34b1['sobject'](_[_0x8600('0x45')](_0x3dd6de[_0x8600('0x3d')]))[_0x8600('0x46')](_0x49ed6b)[_0x8600('0x21')](function(_0x230d5b){return BPromise[_0x8600('0x25')]({'id':_0x230d5b['id'],'endUserType':_0x3dd6de[_0x8600('0x3d')]});});}});}function getCustomFields(_0x45845e,_0x42e261){var _0x128e34={};if(_0x45845e[_0x8600('0x37')]>0x0){_[_0x8600('0x47')](_0x45845e,function(_0x2267c2){if(_[_0x8600('0x48')](['string',_0x8600('0x49')],_0x2267c2[_0x8600('0x3c')])&&_0x2267c2[_0x8600('0x4a')]){_0x128e34[_0x2267c2['idField']]=_0x2267c2[_0x8600('0x4b')][_0x8600('0x4c')]();}else if(_0x2267c2[_0x8600('0x3c')]===_0x8600('0x4d')&&_0x2267c2[_0x8600('0x4e')]&&_0x2267c2[_0x8600('0x4a')]){_0x42e261[_0x2267c2[_0x8600('0x4e')]]&&(_0x128e34[_0x2267c2[_0x8600('0x4a')]]=_0x42e261[_0x2267c2[_0x8600('0x4e')]][_0x8600('0x4c')]());}else if(_0x2267c2[_0x8600('0x3c')]===_0x8600('0x4f')&&_0x2267c2[_0x8600('0x50')]&&_0x2267c2[_0x8600('0x50')][_0x8600('0x51')]&&_0x2267c2['idField']){_0x42e261[_0x2267c2['Variable']['name'][_0x8600('0x52')]()]&&(_0x128e34[_0x2267c2['idField']]=_0x42e261[_0x2267c2['Variable'][_0x8600('0x51')][_0x8600('0x52')]()]['toString']());}});}return _0x128e34;}function getConnection(_0x25b525){var _0x88c56d=_0x25b525[_0x8600('0x53')][_0x8600('0x54')](_0x25b525[_0x8600('0x55')]);var _0x43cd6d=new jsforce['Connection']({'oauth2':{'loginUrl':_0x25b525[_0x8600('0x56')]||_0x8600('0x57'),'clientId':_0x25b525[_0x8600('0x58')],'clientSecret':_0x25b525[_0x8600('0x59')]}});return _0x43cd6d[_0x8600('0x5a')](_0x25b525[_0x8600('0x5b')],_0x88c56d)[_0x8600('0x21')](function(){logger['info'](_0x8600('0x5c'));return _0x43cd6d;});}exports[_0x8600('0x5d')]=function(_0x3ce680,_0x320cd9,_0x954eeb,_0x49dbbd,_0x314917,_0x48146d){var _0x58a3bd,_0x2a7371,_0x55f858,_0x31c28e;_0x48146d[_0x8600('0x5e')]=intUtil[_0x8600('0x5f')](_0x48146d[_0x8600('0x5e')]);_0x48146d[_0x8600('0x56')]=intUtil['stripTrailingSlash'](_0x48146d['remoteUri']);if(_0x314917&&_0x314917[_0x8600('0x60')]){logger[_0x8600('0x23')](_0x8600('0x61'),_0x8600('0x62'));_0x320cd9[_0x8600('0x63')]=util['format'](_0x8600('0x64'),_0x48146d['serverUrl'],_0x320cd9['uniqueid'],md5(_0x320cd9[_0x8600('0x65')]));}else{_0x320cd9[_0x8600('0x63')]='';}return getConnection(_0x48146d)['then'](function(_0x4c3f01){_0x31c28e=_0x4c3f01;return getUser(_0x48146d,_0x49dbbd[_0x8600('0x66')],_0x31c28e);})[_0x8600('0x21')](function(_0x3a1858){_0x58a3bd=_0x3a1858;return getEndUser(_0x48146d,_0x954eeb,_0x320cd9[_0x8600('0x67')],_0x320cd9[_0x8600('0x68')],_0x31c28e);})[_0x8600('0x21')](function(_0x20af55){_0x2a7371=_0x20af55;return getTicket(_0x48146d,_0x58a3bd,_0x2a7371,_0x954eeb,_0x320cd9,_0x954eeb[_0x8600('0x69')],_0x31c28e,_0x8600('0x5d'));})['then'](function(_0x3ea790){_0x55f858=_0x3ea790;logger['info'](_0x8600('0x6a'),_0x55f858['id']);logger[_0x8600('0x23')](_0x8600('0x6b'),_0x55f858['id'],_0x49dbbd['name'],_0x48146d['type']);switch(_0x48146d[_0x8600('0x3c')]){case _0x8600('0x6c'):emit(util[_0x8600('0x41')]('user:%s',_0x49dbbd[_0x8600('0x51')]),_0x8600('0x6d'),{'recordId':_0x55f858['id']});break;case _0x8600('0x6e'):emit(util['format'](_0x8600('0x6f'),_0x49dbbd[_0x8600('0x51')]),_0x8600('0x70'),{'uri':util[_0x8600('0x41')](_0x8600('0x71'),_0x31c28e[_0x8600('0x72')],_0x55f858['id'])});break;default:logger[_0x8600('0x73')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x8600('0x74')](function(_0x296100){logger[_0x8600('0x73')](_0x8600('0x61'),_0x296100);});};exports[_0x8600('0x75')]=function(_0x48ea9e,_0x2508ec,_0x2404f0,_0x58fa6f,_0x30600f,_0x1e8bd3,_0x216872){var _0x4d5445,_0x5889c0,_0x5d0374,_0x4554b3;_0x1e8bd3['serverUrl']=intUtil[_0x8600('0x5f')](_0x1e8bd3[_0x8600('0x5e')]);_0x1e8bd3[_0x8600('0x56')]=intUtil[_0x8600('0x5f')](_0x1e8bd3['remoteUri']);if(_0x216872&&_0x216872['recordingFormat']&&_0x216872[_0x8600('0x76')]!=='none'){logger['info'](_0x8600('0x77'),_0x8600('0x62'));_0x2508ec[_0x8600('0x63')]=util[_0x8600('0x41')](_0x8600('0x64'),_0x1e8bd3['serverUrl'],_0x2508ec[_0x8600('0x65')],md5(_0x2508ec[_0x8600('0x65')]));}return getConnection(_0x1e8bd3)[_0x8600('0x21')](function(_0x496def){_0x4554b3=_0x496def;return getUser(_0x1e8bd3,_0x58fa6f[_0x8600('0x66')],_0x4554b3);})[_0x8600('0x21')](function(_0x25e4fb){_0x4d5445=_0x25e4fb;return getEndUser(_0x1e8bd3,_0x2404f0,_0x2508ec[_0x8600('0x78')],_0x2508ec[_0x8600('0x79')],_0x4554b3);})[_0x8600('0x21')](function(_0x34da23){_0x5889c0=_0x34da23;return getTicket(_0x1e8bd3,_0x4d5445,_0x5889c0,_0x2404f0,_0x2508ec,_0x2404f0[_0x8600('0x69')],_0x4554b3,_0x8600('0x75'));})[_0x8600('0x21')](function(_0x4eeacb){_0x5d0374=_0x4eeacb;logger[_0x8600('0x23')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x5d0374['id']);logger[_0x8600('0x23')](_0x8600('0x7a'),_0x5d0374['id'],_0x58fa6f[_0x8600('0x51')],_0x1e8bd3['type']);switch(_0x1e8bd3[_0x8600('0x3c')]){case _0x8600('0x6c'):emit(util[_0x8600('0x41')](_0x8600('0x6f'),_0x58fa6f[_0x8600('0x51')]),_0x8600('0x6d'),{'recordId':_0x5d0374['id']});break;case'newTab':emit(util['format'](_0x8600('0x6f'),_0x58fa6f[_0x8600('0x51')]),_0x8600('0x70'),{'uri':util[_0x8600('0x41')](_0x8600('0x71'),_0x4554b3['instanceUrl'],_0x5d0374['id'])});break;default:logger[_0x8600('0x73')]('[OUTBOUND]',_0x8600('0x7b'));}})['catch'](function(_0x176078){logger[_0x8600('0x73')](_0x8600('0x77'),_0x176078);});};exports['unmanaged']=function(_0x5f42fb,_0xf307eb,_0x205a65,_0x11e33c,_0x1f5aba,_0x1966cd){var _0x3b2346,_0x186e34,_0x1189be,_0x4e30c4;_0x1966cd[_0x8600('0x5e')]=intUtil['stripTrailingSlash'](_0x1966cd[_0x8600('0x5e')]);_0x1966cd[_0x8600('0x56')]=intUtil[_0x8600('0x5f')](_0x1966cd['remoteUri']);if(_0x1f5aba&&_0x1f5aba[_0x8600('0x60')]){logger[_0x8600('0x23')]('['+_0xf307eb['lastevent'][_0x8600('0x7c')]()+']',_0x8600('0x62'));_0xf307eb[_0x8600('0x63')]=util['format'](_0x8600('0x64'),_0x1966cd[_0x8600('0x5e')],_0xf307eb[_0x8600('0x65')],md5(_0xf307eb[_0x8600('0x65')]));}else{_0xf307eb[_0x8600('0x63')]='';}return getConnection(_0x1966cd)[_0x8600('0x21')](function(_0x2472c5){_0x4e30c4=_0x2472c5;if(!_[_0x8600('0x1b')](_0x11e33c)){return getUser(_0x1966cd,_0x11e33c[_0x8600('0x51')],_0x4e30c4);}else{return getUser(_0x1966cd,null,_0x4e30c4);}})['then'](function(_0x3b8a3a){_0x3b2346=_0x3b8a3a;return getEndUser(_0x1966cd,_0x205a65,_0xf307eb[_0x8600('0x67')],_0xf307eb['calleridnum'],_0x4e30c4);})['then'](function(_0x36d760){_0x186e34=_0x36d760;return getTicket(_0x1966cd,_0x3b2346,_0x186e34,_0x205a65,_0xf307eb,_0x205a65[_0x8600('0x69')],_0x4e30c4);})[_0x8600('0x21')](function(_0x14e32c){_0x1189be=_0x14e32c;logger[_0x8600('0x23')]('['+_0xf307eb['lastevent']['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x1189be['id']);logger[_0x8600('0x23')]('['+_0xf307eb['lastevent'][_0x8600('0x7c')]()+_0x8600('0x7d'),_0x1966cd[_0x8600('0x3c')]);})[_0x8600('0x74')](function(_0x4f7e8d){logger[_0x8600('0x73')]('['+_0xf307eb[_0x8600('0x7e')][_0x8600('0x7c')]()+']',_0x4f7e8d);});}; \ No newline at end of file +var _0xdb8a=['User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','Contact','first','Phone','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','includes','picklist','idField','content','variableName','toString','customVariable','Variable','name','password','concat','Connection','https://login.salesforce.com','clientSecret','login','Connection\x20established.','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','email','destcalleridname','destcalleridnum','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','newTab','trigger:browser:url','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridname',']\x20Ticket\x20%s\x20created.','toUpperCase','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString','Subjects','Task','utc','IsReminderSet','contact','endUserType','account','Case','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb8a,0xd7));var _0xadb8=function(_0x3dda13,_0x531a50){_0x3dda13=_0x3dda13-0x0;var _0x4cb902=_0xdb8a[_0x3dda13];return _0x4cb902;};'use strict';var _=require(_0xadb8('0x0'));var rp=require(_0xadb8('0x1'));var moment=require(_0xadb8('0x2'));var BPromise=require('bluebird');var md5=require(_0xadb8('0x3'));var jsforce=require(_0xadb8('0x4'));var util=require(_0xadb8('0x5'));var Redis=require(_0xadb8('0x6'));var intUtil=require(_0xadb8('0x7'));var config=require(_0xadb8('0x8'));var logger=require(_0xadb8('0x9'))(_0xadb8('0xa'));config[_0xadb8('0xb')]=_[_0xadb8('0xc')](config[_0xadb8('0xb')],{'host':_0xadb8('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xadb8('0xb')]));function emit(_0x7635c1,_0x1ef5b7,_0x22602e){io['to'](_0x7635c1)[_0xadb8('0xe')](_0x1ef5b7,_0x22602e);}function getTicket(_0x2cbdb6,_0x4e6327,_0x53fd59,_0x210259,_0xcb9589,_0x4501f4,_0x56091c,_0x4f2533){var _0x40b116=Object['assign']({},{'OwnerId':_0x4e6327['id'],'Subject':intUtil[_0xadb8('0xf')](_0x210259[_0xadb8('0x10')],_0xcb9589,'\x20'),'Description':intUtil[_0xadb8('0xf')](_0x210259['Descriptions'],_0xcb9589,'\x0a')},getCustomFields(_0x4501f4,_0xcb9589));if(_0x53fd59){if(_0x210259['ticketType']===_0xadb8('0x11')){_0x40b116['ActivityDate']=moment[_0xadb8('0x12')]();_0x40b116[_0xadb8('0x13')]=![];_0x40b116['IsRecurrence']=![];if(_0x53fd59['endUserType']===_0xadb8('0x14')||_0x53fd59[_0xadb8('0x15')]==='lead'){_0x40b116['WhoId']=_0x53fd59['id'];}else if(_0x53fd59[_0xadb8('0x15')]===_0xadb8('0x16')){_0x40b116['WhatId']=_0x53fd59['id'];}}else if(_0x210259['ticketType']===_0xadb8('0x17')){if(_0x53fd59[_0xadb8('0x15')]===_0xadb8('0x14')){_0x40b116[_0xadb8('0x18')]=_0x53fd59['id'];}else if(_0x53fd59[_0xadb8('0x15')]===_0xadb8('0x16')){_0x40b116['AccountId']=_0x53fd59['id'];}else if(_0x53fd59['endUserType']===_0xadb8('0x19')&&_0x210259[_0xadb8('0x1a')]){_0x40b116[_0x210259[_0xadb8('0x1a')]]=_0x53fd59['id'];}else{logger[_0xadb8('0x1b')](_0xadb8('0x1c'));}}}return _0x56091c[_0xadb8('0x1d')](_0x210259['ticketType'])[_0xadb8('0x1e')](_0x40b116);}function getUser(_0x3f33cf,_0xb22f2a,_0x4741b8){if(!_[_0xadb8('0x1f')](_0xb22f2a)&&intUtil[_0xadb8('0x20')](_0xb22f2a)){var _0xb9b757={'Email':_0xb22f2a};var _0x4c590d={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4741b8[_0xadb8('0x1d')](_0xadb8('0x21'))[_0xadb8('0x22')](_0xb9b757,_0x4c590d)[_0xadb8('0x23')]()[_0xadb8('0x24')](function(_0x210c4e){if(_0x210c4e[_0xadb8('0x25')]){var _0x4ed082=_[_0xadb8('0x22')](_0x210c4e,function(_0x5b7e0e){return _0x5b7e0e[_0xadb8('0x26')]===_0xb22f2a;});if(_0x4ed082){logger[_0xadb8('0x1b')]('Agent\x20%s\x20found.',_0xb22f2a);return BPromise[_0xadb8('0x27')]({'id':_0x4ed082['Id'],'name':_0x4ed082[_0xadb8('0x28')]});}}else{logger[_0xadb8('0x1b')](_0xadb8('0x29'),_0xb22f2a);return _0x4741b8[_0xadb8('0x2a')]()['then'](function(_0x392424){return BPromise[_0xadb8('0x27')]({'id':_0x392424[_0xadb8('0x2b')],'name':_0x392424[_0xadb8('0x2c')]});});}});}else{logger[_0xadb8('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xb22f2a);return _0x4741b8[_0xadb8('0x2a')]()[_0xadb8('0x24')](function(_0x1e83ae){return BPromise[_0xadb8('0x27')]({'id':_0x1e83ae[_0xadb8('0x2b')],'name':_0x1e83ae['display_name']});});}}function getEndUser(_0x4495b8,_0x26b8a9,_0x33c4c7,_0x292666,_0x543566){var _0x3e9c02={'$or':{'Phone':_0x292666}};var _0x5ae882={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xadb8('0x24')](function(){logger[_0xadb8('0x1b')](_0xadb8('0x2d'),_0x292666,_0x26b8a9[_0xadb8('0x2e')]);switch(_0x26b8a9['moduleSearch']){case _0xadb8('0x2f'):var _0x202f1f=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9['additionalSearchContact']){var _0x2d23ee={};_0x2d23ee[_0x26b8a9['additionalSearchContact']]=_0x292666;_[_0xadb8('0x31')](_0x202f1f['$or'],_0x2d23ee);}return _0x543566[_0xadb8('0x1d')]('Contact')[_0xadb8('0x22')](_0x202f1f,_0x5ae882)['execute']()[_0xadb8('0x24')](function(_0x5935f1){if(_0x5935f1&&_0x5935f1[_0xadb8('0x25')]){return _0x5935f1;}else{var _0x58de7a=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x32')]){var _0x3e4abf={};_0x3e4abf[_0x26b8a9['additionalSearchLead']]=_0x292666;_['merge'](_0x58de7a[_0xadb8('0x33')],_0x3e4abf);}return _0x543566[_0xadb8('0x1d')](_0xadb8('0x34'))['find'](_0x58de7a,_0x5ae882);}});case _0xadb8('0x35'):var _0x589219=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x36')]){var _0x2d23ee={};_0x2d23ee[_0x26b8a9[_0xadb8('0x36')]]=_0x292666;_[_0xadb8('0x31')](_0x589219[_0xadb8('0x33')],_0x2d23ee);}return _0x543566[_0xadb8('0x1d')](_0xadb8('0x37'))[_0xadb8('0x22')](_0x589219,_0x5ae882)[_0xadb8('0x23')]()[_0xadb8('0x24')](function(_0x273128){if(_0x273128&&_0x273128[_0xadb8('0x25')]){return _0x273128;}else{var _0x5e76c0=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x38')]){var _0x53cd7d={};_0x53cd7d[_0x26b8a9['additionalSearchContact']]=_0x292666;_[_0xadb8('0x31')](_0x5e76c0[_0xadb8('0x33')],_0x53cd7d);}return _0x543566[_0xadb8('0x1d')](_0xadb8('0x39'))['find'](_0x5e76c0,_0x5ae882)[_0xadb8('0x24')](function(_0xd7d406){if(_0xd7d406&&_0xd7d406[_0xadb8('0x25')]){return _0xd7d406;}else{var _0x33cd32=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9['additionalSearchLead']){var _0x273176={};_0x273176[_0x26b8a9[_0xadb8('0x32')]]=_0x292666;_[_0xadb8('0x31')](_0x33cd32[_0xadb8('0x33')],_0x273176);}return _0x543566[_0xadb8('0x1d')](_0xadb8('0x34'))[_0xadb8('0x22')](_0x33cd32,_0x5ae882);}});}});case'contact':var _0x202f1f=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x38')]){var _0x2d23ee={};_0x2d23ee[_0x26b8a9['additionalSearchContact']]=_0x292666;_[_0xadb8('0x31')](_0x202f1f[_0xadb8('0x33')],_0x2d23ee);}return _0x543566['sobject']('Contact')[_0xadb8('0x22')](_0x202f1f,_0x5ae882)[_0xadb8('0x23')]();case _0xadb8('0x19'):var _0x4087ad=_['cloneDeep'](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x32')]){var _0x2d23ee={};_0x2d23ee[_0x26b8a9['additionalSearchLead']]=_0x292666;_[_0xadb8('0x31')](_0x4087ad[_0xadb8('0x33')],_0x2d23ee);}return _0x543566[_0xadb8('0x1d')]('Lead')['find'](_0x4087ad,_0x5ae882);case _0xadb8('0x16'):var _0x589219=_[_0xadb8('0x30')](_0x3e9c02);if(_0x26b8a9[_0xadb8('0x36')]){var _0x2d23ee={};_0x2d23ee[_0x26b8a9['additionalSearchAccount']]=_0x292666;_[_0xadb8('0x31')](_0x589219[_0xadb8('0x33')],_0x2d23ee);}return _0x543566[_0xadb8('0x1d')](_0xadb8('0x37'))[_0xadb8('0x22')](_0x589219,_0x5ae882);default:return null;}})[_0xadb8('0x24')](function(_0x9e6fd2){if(_0x9e6fd2&&_0x9e6fd2[_0xadb8('0x25')]){var _0x4cf601=_[_0xadb8('0x3a')](_0x9e6fd2);if(_0x4cf601){return BPromise[_0xadb8('0x27')]({'id':_0x4cf601['Id'],'name':_0x4cf601[_0xadb8('0x28')],'phone':_0x4cf601[_0xadb8('0x3b')],'endUserType':_0x4cf601['attributes'][_0xadb8('0x3c')][_0xadb8('0x3d')]()});}}})[_0xadb8('0x24')](function(_0x12042c){if(_0x12042c){logger[_0xadb8('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x12042c[_0xadb8('0x15')],_0x292666);return BPromise[_0xadb8('0x27')](_0x12042c);}else{logger[_0xadb8('0x1b')](_0xadb8('0x3e'),_0x292666);var _0x3fe08e={'Phone':_0x292666};if(_0x26b8a9[_0xadb8('0x3f')]){if(_0x26b8a9['moduleCreate']===_0xadb8('0x14')){logger[_0xadb8('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x292666,_0x26b8a9[_0xadb8('0x3f')]);_0x3fe08e[_0xadb8('0x40')]=_0x33c4c7!==_0xadb8('0x41')?_0x33c4c7:util[_0xadb8('0x42')]('Caller\x20-\x20%s',_0x292666);}else if(_0x26b8a9['moduleCreate']===_0xadb8('0x19')){logger[_0xadb8('0x1b')](_0xadb8('0x43'),_0x292666,_0x26b8a9['moduleCreate']);_0x3fe08e['LastName']=_0x33c4c7!==''?_0x33c4c7:util['format'](_0xadb8('0x44'),_0x292666);_0x3fe08e[_0xadb8('0x45')]=_0xadb8('0x46');}else if(_0x26b8a9[_0xadb8('0x3f')]===_0xadb8('0x16')){logger[_0xadb8('0x1b')](_0xadb8('0x43'),_0x292666,_0x26b8a9[_0xadb8('0x3f')]);_0x3fe08e['Name']=_0x33c4c7!==_0xadb8('0x41')?_0x33c4c7:util[_0xadb8('0x42')]('Caller\x20-\x20%s',_0x292666);}else{return null;}}return _0x543566[_0xadb8('0x1d')](_['upperFirst'](_0x26b8a9[_0xadb8('0x3f')]))[_0xadb8('0x1e')](_0x3fe08e)[_0xadb8('0x24')](function(_0x37b96d){return BPromise[_0xadb8('0x27')]({'id':_0x37b96d['id'],'endUserType':_0x26b8a9[_0xadb8('0x3f')]});});}});}function getCustomFields(_0x3dc04a,_0x248478){var _0x2d9521={};if(_0x3dc04a[_0xadb8('0x25')]>0x0){_['forEach'](_0x3dc04a,function(_0x483287){if(_[_0xadb8('0x47')](['string',_0xadb8('0x48')],_0x483287[_0xadb8('0x3c')])&&_0x483287[_0xadb8('0x49')]){_0x2d9521[_0x483287[_0xadb8('0x49')]]=_0x483287[_0xadb8('0x4a')]['toString']();}else if(_0x483287[_0xadb8('0x3c')]==='variable'&&_0x483287[_0xadb8('0x4b')]&&_0x483287[_0xadb8('0x49')]){_0x248478[_0x483287[_0xadb8('0x4b')]]&&(_0x2d9521[_0x483287['idField']]=_0x248478[_0x483287['variableName']][_0xadb8('0x4c')]());}else if(_0x483287[_0xadb8('0x3c')]===_0xadb8('0x4d')&&_0x483287[_0xadb8('0x4e')]&&_0x483287['Variable']['name']&&_0x483287['idField']){_0x248478[_0x483287[_0xadb8('0x4e')][_0xadb8('0x4f')][_0xadb8('0x3d')]()]&&(_0x2d9521[_0x483287[_0xadb8('0x49')]]=_0x248478[_0x483287[_0xadb8('0x4e')][_0xadb8('0x4f')][_0xadb8('0x3d')]()]['toString']());}});}return _0x2d9521;}function getConnection(_0x3d845a){var _0x342265=_0x3d845a[_0xadb8('0x50')][_0xadb8('0x51')](_0x3d845a['securityToken']);var _0x3c6e17=new jsforce[(_0xadb8('0x52'))]({'oauth2':{'loginUrl':_0x3d845a['remoteUri']||_0xadb8('0x53'),'clientId':_0x3d845a['clientId'],'clientSecret':_0x3d845a[_0xadb8('0x54')]}});return _0x3c6e17[_0xadb8('0x55')](_0x3d845a['username'],_0x342265)[_0xadb8('0x24')](function(){logger['info'](_0xadb8('0x56'));return _0x3c6e17;});}exports['queue']=function(_0x3cf566,_0x3f3c6d,_0x192397,_0x1395e0,_0x40771c,_0x4f2ac5){var _0xea546e,_0x4165ec,_0x44de0e,_0x5ee9d4;_0x4f2ac5[_0xadb8('0x57')]=intUtil['stripTrailingSlash'](_0x4f2ac5[_0xadb8('0x57')]);_0x4f2ac5[_0xadb8('0x58')]=intUtil[_0xadb8('0x59')](_0x4f2ac5[_0xadb8('0x58')]);if(_0x40771c&&_0x40771c[_0xadb8('0x5a')]){logger['info'](_0xadb8('0x5b'),_0xadb8('0x5c'));_0x3f3c6d[_0xadb8('0x5d')]=util['format'](_0xadb8('0x5e'),_0x4f2ac5[_0xadb8('0x57')],_0x3f3c6d['uniqueid'],md5(_0x3f3c6d[_0xadb8('0x5f')]));}else{_0x3f3c6d[_0xadb8('0x5d')]='';}return getConnection(_0x4f2ac5)['then'](function(_0x22232b){_0x5ee9d4=_0x22232b;return getUser(_0x4f2ac5,_0x1395e0['email'],_0x5ee9d4);})[_0xadb8('0x24')](function(_0x1e704b){_0xea546e=_0x1e704b;return getEndUser(_0x4f2ac5,_0x192397,_0x3f3c6d['calleridname'],_0x3f3c6d[_0xadb8('0x60')],_0x5ee9d4);})[_0xadb8('0x24')](function(_0x1600cb){_0x4165ec=_0x1600cb;return getTicket(_0x4f2ac5,_0xea546e,_0x4165ec,_0x192397,_0x3f3c6d,_0x192397['Fields'],_0x5ee9d4,_0xadb8('0x61'));})[_0xadb8('0x24')](function(_0x19808f){_0x44de0e=_0x19808f;logger[_0xadb8('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x44de0e['id']);logger[_0xadb8('0x1b')](_0xadb8('0x62'),_0x44de0e['id'],_0x1395e0[_0xadb8('0x4f')],_0x4f2ac5[_0xadb8('0x3c')]);switch(_0x4f2ac5[_0xadb8('0x3c')]){case _0xadb8('0x63'):emit(util[_0xadb8('0x42')](_0xadb8('0x64'),_0x1395e0[_0xadb8('0x4f')]),'trigger:salesforce:display',{'recordId':_0x44de0e['id']});break;case'newTab':emit(util[_0xadb8('0x42')]('user:%s',_0x1395e0[_0xadb8('0x4f')]),'trigger:browser:url',{'uri':util['format'](_0xadb8('0x65'),_0x5ee9d4[_0xadb8('0x66')],_0x44de0e['id'])});break;default:logger[_0xadb8('0x67')](_0xadb8('0x68'));}})[_0xadb8('0x69')](function(_0x27fb75){logger[_0xadb8('0x67')](_0xadb8('0x5b'),_0x27fb75);});};exports['outbound']=function(_0x2e1895,_0x81a619,_0xb08e82,_0x30d60d,_0xb6e674,_0x2d561e,_0x1e915c){var _0x4ab1a0,_0x5d96d2,_0x309842,_0x448031;_0x2d561e[_0xadb8('0x57')]=intUtil[_0xadb8('0x59')](_0x2d561e['serverUrl']);_0x2d561e['remoteUri']=intUtil[_0xadb8('0x59')](_0x2d561e[_0xadb8('0x58')]);if(_0x1e915c&&_0x1e915c[_0xadb8('0x6a')]&&_0x1e915c['recordingFormat']!==_0xadb8('0x6b')){logger['info']('[OUTBOUND]',_0xadb8('0x5c'));_0x81a619[_0xadb8('0x5d')]=util[_0xadb8('0x42')](_0xadb8('0x5e'),_0x2d561e[_0xadb8('0x57')],_0x81a619[_0xadb8('0x5f')],md5(_0x81a619['uniqueid']));}return getConnection(_0x2d561e)[_0xadb8('0x24')](function(_0x5b1a8c){_0x448031=_0x5b1a8c;return getUser(_0x2d561e,_0x30d60d[_0xadb8('0x6c')],_0x448031);})['then'](function(_0x3ad4ee){_0x4ab1a0=_0x3ad4ee;return getEndUser(_0x2d561e,_0xb08e82,_0x81a619[_0xadb8('0x6d')],_0x81a619[_0xadb8('0x6e')],_0x448031);})[_0xadb8('0x24')](function(_0x13ca22){_0x5d96d2=_0x13ca22;return getTicket(_0x2d561e,_0x4ab1a0,_0x5d96d2,_0xb08e82,_0x81a619,_0xb08e82[_0xadb8('0x6f')],_0x448031,_0xadb8('0x70'));})['then'](function(_0x16b042){_0x309842=_0x16b042;logger[_0xadb8('0x1b')](_0xadb8('0x71'),_0x309842['id']);logger[_0xadb8('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x309842['id'],_0x30d60d[_0xadb8('0x4f')],_0x2d561e[_0xadb8('0x3c')]);switch(_0x2d561e[_0xadb8('0x3c')]){case'integrationTab':emit(util['format']('user:%s',_0x30d60d[_0xadb8('0x4f')]),_0xadb8('0x72'),{'recordId':_0x309842['id']});break;case _0xadb8('0x73'):emit(util[_0xadb8('0x42')]('user:%s',_0x30d60d['name']),_0xadb8('0x74'),{'uri':util[_0xadb8('0x42')](_0xadb8('0x65'),_0x448031['instanceUrl'],_0x309842['id'])});break;default:logger[_0xadb8('0x67')](_0xadb8('0x75'),_0xadb8('0x76'));}})['catch'](function(_0xc45136){logger[_0xadb8('0x67')](_0xadb8('0x75'),_0xc45136);});};exports[_0xadb8('0x77')]=function(_0x9a0328,_0x3f0d08,_0x79590,_0x2cddcc,_0x3fe558,_0x53a4a1){var _0x57ff02,_0x155ca9,_0x6d1d82,_0x582efb;_0x53a4a1[_0xadb8('0x57')]=intUtil[_0xadb8('0x59')](_0x53a4a1[_0xadb8('0x57')]);_0x53a4a1['remoteUri']=intUtil[_0xadb8('0x59')](_0x53a4a1[_0xadb8('0x58')]);if(_0x3fe558&&_0x3fe558['monitor_format']){logger[_0xadb8('0x1b')]('['+_0x3f0d08[_0xadb8('0x78')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3f0d08[_0xadb8('0x5d')]=util[_0xadb8('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53a4a1[_0xadb8('0x57')],_0x3f0d08[_0xadb8('0x5f')],md5(_0x3f0d08['uniqueid']));}else{_0x3f0d08['recordingURL']='';}return getConnection(_0x53a4a1)[_0xadb8('0x24')](function(_0x40958a){_0x582efb=_0x40958a;if(!_[_0xadb8('0x1f')](_0x2cddcc)){return getUser(_0x53a4a1,_0x2cddcc[_0xadb8('0x4f')],_0x582efb);}else{return getUser(_0x53a4a1,null,_0x582efb);}})[_0xadb8('0x24')](function(_0x418964){_0x57ff02=_0x418964;return getEndUser(_0x53a4a1,_0x79590,_0x3f0d08[_0xadb8('0x79')],_0x3f0d08['calleridnum'],_0x582efb);})[_0xadb8('0x24')](function(_0x5c8d85){_0x155ca9=_0x5c8d85;return getTicket(_0x53a4a1,_0x57ff02,_0x155ca9,_0x79590,_0x3f0d08,_0x79590[_0xadb8('0x6f')],_0x582efb);})['then'](function(_0x426ac7){_0x6d1d82=_0x426ac7;logger[_0xadb8('0x1b')]('['+_0x3f0d08[_0xadb8('0x78')]['toUpperCase']()+_0xadb8('0x7a'),_0x6d1d82['id']);logger['info']('['+_0x3f0d08[_0xadb8('0x78')][_0xadb8('0x7b')]()+']\x20Integration\x20account\x20type\x20%s.',_0x53a4a1[_0xadb8('0x3c')]);})['catch'](function(_0x340672){logger[_0xadb8('0x67')]('['+_0x3f0d08[_0xadb8('0x78')][_0xadb8('0x7b')]()+']',_0x340672);});}; \ 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 9a7b45d..fb7471d 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 _0x975d=['name','Variable','outbound','incident','assign','true','Subjects','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','password','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/logger','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','adminId','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','customVariable'];(function(_0x37d9b1,_0x358b0d){var _0x580044=function(_0x23530f){while(--_0x23530f){_0x37d9b1['push'](_0x37d9b1['shift']());}};_0x580044(++_0x358b0d);}(_0x975d,0xa0));var _0xd975=function(_0x22c4c5,_0x4fade0){_0x22c4c5=_0x22c4c5-0x0;var _0x1df18f=_0x975d[_0x22c4c5];return _0x1df18f;};'use strict';var _=require(_0xd975('0x0'));var Promise=require(_0xd975('0x1'));var rp=require(_0xd975('0x2'));var util=require(_0xd975('0x3'));var md5=require('md5');var Redis=require(_0xd975('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd975('0x5'))('servicenow');config['redis']=_[_0xd975('0x6')](config['redis'],{'host':_0xd975('0x7'),'port':0x18eb});var io=require(_0xd975('0x8'))(new Redis(config['redis']));function getAdminUser(_0x138473,_0x1a1096,_0x4db19b,_0x521ea2,_0x56b642,_0x51c23e){return new Promise(function(_0x3867c6,_0x19df51){var _0x30acea={'method':'GET','uri':_0x521ea2+_0xd975('0x9')+'&'+_0x56b642+'&'+_0x51c23e,'auth':_0x1a1096,'json':!![]};return rp(_0x30acea)[_0xd975('0xa')](function(_0xaedaf2){if(_0xaedaf2[_0xd975('0xb')][_0xd975('0xc')]>0x0){_0x4db19b['adminId']=_0xaedaf2[_0xd975('0xb')][0x0]['sys_id'];}logger[_0xd975('0xd')]('['+[_0x138473[_0xd975('0xe')]()]+_0xd975('0xf'),_0x4db19b);_0x3867c6(_0x4db19b);})['catch'](function(_0xdd8d3){logger[_0xd975('0x10')]('['+[_0x138473[_0xd975('0xe')]()]+']',_0xdd8d3[_0xd975('0x11')]);_0x19df51(_0xdd8d3[_0xd975('0x11')]);});});}function getUser(_0x16d064,_0x37c497,_0x429aaf,_0xcd8925,_0x556d41){return function(_0x42e7b1){logger[_0xd975('0xd')]('['+[_0x16d064[_0xd975('0xe')]()]+'],\x20getUser\x20input\x20crm',_0x42e7b1);return new Promise(function(_0xd2fad9,_0x11151e){if(intUtil[_0xd975('0x12')](_0x42e7b1[_0xd975('0x13')])){var _0x9bea0b={'method':_0xd975('0x14'),'uri':_0x429aaf+_0xd975('0x15')+_0x42e7b1[_0xd975('0x13')]+'&'+_0xcd8925+'&'+_0x556d41,'auth':_0x37c497,'json':!![]};logger[_0xd975('0xd')]('['+[_0x16d064[_0xd975('0xe')]()]+_0xd975('0x16'),_0x9bea0b);return rp(_0x9bea0b)[_0xd975('0xa')](function(_0xa6741d){logger[_0xd975('0xd')]('['+[_0x16d064[_0xd975('0xe')]()]+_0xd975('0x17'),_0xa6741d);if(_0xa6741d[_0xd975('0xb')][_0xd975('0xc')]>0x0&&String(_0xa6741d['result'][0x0][_0xd975('0x18')])==='true'){_0x42e7b1['userId']=_0xa6741d[_0xd975('0xb')][0x0]['sys_id'];}else{_0x42e7b1[_0xd975('0x19')]=_0x42e7b1[_0xd975('0x1a')];_0x42e7b1['userEmail']=_0x42e7b1['adminEmail'];}logger[_0xd975('0xd')]('['+[_0x16d064[_0xd975('0xe')]()]+_0xd975('0x1b'),_0x42e7b1);_0xd2fad9(_0x42e7b1);})[_0xd975('0x1c')](function(_0x1b1f4c){logger[_0xd975('0x10')]('['+[_0x16d064['toUpperCase']()]+']',_0x1b1f4c[_0xd975('0x11')]);_0x11151e(_0x1b1f4c[_0xd975('0x11')]);});}else{logger[_0xd975('0xd')]('['+[_0x16d064[_0xd975('0xe')]()]+_0xd975('0x1d'));_0x42e7b1[_0xd975('0x19')]=_0x42e7b1[_0xd975('0x1a')];_0x42e7b1[_0xd975('0x13')]=_0x42e7b1[_0xd975('0x1e')];_0xd2fad9(_0x42e7b1);}});};}function createEndUser(_0x47e756,_0x22cdad,_0x5dbf16,_0xae09f9,_0x18ac54){logger['info']('['+[_0x47e756[_0xd975('0xe')]()]+_0xd975('0x1f'),_0x5dbf16);return new Promise(function(_0x4e485b,_0x5c29a4){var _0x33b357={'method':_0xd975('0x20'),'uri':_0xae09f9+_0xd975('0x21')+_0x18ac54,'body':{'user_name':_0x5dbf16[_0xd975('0x22')],'roles':_0xd975('0x23'),'first_name':_0x5dbf16[_0xd975('0x22')],'active':'true','date_format':'System','phone':_0x5dbf16[_0xd975('0x22')]},'auth':_0x22cdad,'json':!![]};return rp(_0x33b357)['then'](function(_0x35021e){logger[_0xd975('0xd')]('['+[_0x47e756[_0xd975('0xe')]()]+_0xd975('0x24'),_0x35021e[_0xd975('0xb')]);_0x5dbf16[_0xd975('0x25')]=_0x35021e['result'][_0xd975('0x26')];_0x4e485b(_0x5dbf16);})[_0xd975('0x1c')](function(_0x1a4500){logger['error']('['+[_0x47e756[_0xd975('0xe')]()]+']',_0x1a4500[_0xd975('0x11')]);_0x5c29a4(_0x1a4500[_0xd975('0x11')]);});});}function getEndUser(_0x5b8bbf,_0x12c6dd,_0x161322,_0x1f0ef1,_0x3c1f81){return function(_0x48cf97){logger['info']('['+[_0x5b8bbf[_0xd975('0xe')]()]+_0xd975('0x27'),_0x48cf97);return new Promise(function(_0x8ec132,_0x46a107){var _0x263ea6={'method':_0xd975('0x14'),'uri':_0x161322+_0xd975('0x28')+_0x48cf97[_0xd975('0x22')]+'&'+_0x1f0ef1+'&'+_0x3c1f81,'auth':_0x12c6dd,'json':!![]};return rp(_0x263ea6)[_0xd975('0xa')](function(_0x4699af){if(_0x4699af[_0xd975('0xb')][_0xd975('0xc')]>0x0){_0x48cf97[_0xd975('0x25')]=_0x4699af[_0xd975('0xb')][0x0][_0xd975('0x26')];logger[_0xd975('0xd')]('['+[_0x5b8bbf[_0xd975('0xe')]()]+_0xd975('0x29'),_0x48cf97);_0x8ec132(_0x48cf97);}else{return createEndUser(_0x5b8bbf,_0x12c6dd,_0x48cf97,_0x161322,_0x1f0ef1)[_0xd975('0xa')](function(_0x8cc48b){logger[_0xd975('0xd')]('['+[_0x5b8bbf['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x8cc48b);_0x8ec132(_0x8cc48b);});}})[_0xd975('0x1c')](function(_0x549e66){logger[_0xd975('0x10')]('['+[_0x5b8bbf[_0xd975('0xe')]()]+']',_0x549e66[_0xd975('0x11')]);_0x46a107(_0x549e66[_0xd975('0x11')]);});});};}function getCustomFields(_0x23790d,_0x1c1b82){var _0x41b130={};if(_0x23790d[_0xd975('0xc')]>0x0){_[_0xd975('0x2a')](_0x23790d,function(_0xb86aac){if(_[_0xd975('0x2b')]([_0xd975('0x2c'),_0xd975('0x2d')],_0xb86aac[_0xd975('0x2e')])&&_0xb86aac[_0xd975('0x2f')]&&!_0xb86aac[_0xd975('0x30')]){_0x41b130[_0xb86aac[_0xd975('0x2f')][_0xd975('0x31')]()]=_0xb86aac[_0xd975('0x32')][_0xd975('0x33')]();}else if(_['includes']([_0xd975('0x2c'),_0xd975('0x2d')],_0xb86aac['type'])&&_0xb86aac[_0xd975('0x34')]&&_0xb86aac[_0xd975('0x30')]){_0x41b130[_0xb86aac[_0xd975('0x34')][_0xd975('0x31')]()]=_0xb86aac['content'][_0xd975('0x33')]();}else if(_0xb86aac[_0xd975('0x2e')]===_0xd975('0x35')&&_0xb86aac['variableName']&&_0xb86aac['idField']&&_0xb86aac[_0xd975('0x30')]){_0x41b130[_0xb86aac[_0xd975('0x34')][_0xd975('0x31')]()]=_0x1c1b82[_0xb86aac[_0xd975('0x36')]][_0xd975('0x33')]();}else if(_0xb86aac['type']===_0xd975('0x37')&&_0xb86aac['Variable']&&_0xb86aac['Variable'][_0xd975('0x38')]&&_0xb86aac[_0xd975('0x34')]&&_0xb86aac['customField']){_0x41b130[_0xb86aac[_0xd975('0x34')]['toLowerCase']()]=_0x1c1b82[_0xb86aac[_0xd975('0x39')][_0xd975('0x38')][_0xd975('0x31')]()][_0xd975('0x33')]();}});}return _0x41b130;}function getTicket(_0x48f962,_0x1ae7ca,_0x48704c,_0x2ab5a8,_0x34a462,_0x5bf142){return function(_0xe4ce58){logger[_0xd975('0xd')]('['+[_0x48f962[_0xd975('0xe')]()]+']\x20getTicket\x20input\x20crm',_0xe4ce58);return new Promise(function(_0x43a19e,_0x1101f7){var _0x5f3f17=_0x48f962[_0xd975('0x31')]()===_0xd975('0x3a')?_0xe4ce58['userId']:_0xe4ce58[_0xd975('0x25')];var _0x294859={'method':_0xd975('0x20'),'uri':_0x48704c+_0xd975('0x3b')+'?'+_0x5bf142,'body':Object[_0xd975('0x3c')]({},{'active':_0xd975('0x3d'),'caller_id':_0x5f3f17,'assigned_to':_0xe4ce58[_0xd975('0x19')],'short_description':intUtil['getString'](_0x2ab5a8[_0xd975('0x3e')],_0x34a462,'\x20'),'description':intUtil[_0xd975('0x3f')](_0x2ab5a8[_0xd975('0x40')],_0x34a462,'\x0a')},getCustomFields(_0x2ab5a8['Fields'],_0x34a462)),'auth':_0x1ae7ca,'json':!![]};return rp(_0x294859)[_0xd975('0xa')](function(_0x435a80){logger[_0xd975('0xd')]('['+[_0x48f962[_0xd975('0xe')]()]+_0xd975('0x41'),_0x435a80[_0xd975('0xb')]);_0xe4ce58[_0xd975('0x42')]=_0x435a80[_0xd975('0xb')]['sys_id'];_0xe4ce58['ticketNumber']=_0x435a80[_0xd975('0xb')][_0xd975('0x43')];logger[_0xd975('0xd')]('['+[_0x48f962['toUpperCase']()]+_0xd975('0x44'),_0xe4ce58);_0x43a19e(_0xe4ce58);})[_0xd975('0x1c')](function(_0x80c4f5){logger['error']('['+[_0x48f962['toUpperCase']()]+']',_0x80c4f5[_0xd975('0x11')]);_0x1101f7(_0x80c4f5[_0xd975('0x11')]);});});};}function createRemoteTag(_0x21bfe4,_0x42db46,_0xb58f97,_0x77c2c3){return new Promise(function(_0x17524e,_0x3ad7c5){var _0x2f016f={'method':_0xd975('0x20'),'uri':_0xb58f97+_0xd975('0x45')+'?'+_0x77c2c3,'body':{'short_description':_0x21bfe4,'global':!![],'active':!![],'name':_0x21bfe4},'auth':_0x42db46,'json':!![]};return rp(_0x2f016f)[_0xd975('0xa')](function(_0x293707){var _0x239717=_0x293707[_0xd975('0xb')][_0xd975('0x26')];_0x17524e(_0x239717);});});}function getRemoteTag(_0x23ad4d,_0x247cc2,_0x9504f2,_0x2f1227,_0x4e55b4){return new Promise(function(_0x203b97,_0x4134a0){var _0x4a4f63={'method':'GET','uri':_0x9504f2+'label'+_0xd975('0x46')+_0x23ad4d+'&'+_0x2f1227,'auth':_0x247cc2,'json':!![]};return rp(_0x4a4f63)[_0xd975('0xa')](function(_0x5aede4){if(_0x5aede4['result']['length']>0x0){var _0x9d20b0=_0x5aede4[_0xd975('0xb')][0x0][_0xd975('0x26')];_0x203b97(_0x9d20b0);}else{return createRemoteTag(_0x23ad4d,_0x247cc2,_0x9504f2,_0x2f1227)['then'](function(_0x1df206){_0x203b97(_0x1df206);});}});});}function assignTagToIncident(_0x3014e9,_0x2bd520,_0x270085,_0x2e0e67,_0xf6ab56){return new Promise(function(_0x348669,_0x2a967e){var _0x438784={'method':_0xd975('0x20'),'uri':_0x270085+'label_entry'+'?'+_0xf6ab56,'body':{'label':_0x3014e9,'table':'incident','id_type':_0xd975('0x47'),'table_key':_0x2e0e67[_0xd975('0x42')],'title':_0xd975('0x48')+_0x2e0e67[_0xd975('0x49')],'id_display':_0x2e0e67[_0xd975('0x49')]},'auth':_0x2bd520,'json':!![]};return rp(_0x438784)[_0xd975('0xa')](function(_0x22b157){_0x348669();})[_0xd975('0x1c')](function(){_0x348669();});});}function manageTags(_0x5357ad,_0x12ca83,_0x2ada8e,_0x57437b,_0x30435f,_0xf76d30,_0x4521bd){return new Promise(function(_0x56a28d,_0x499ed2){var _0x13969a=[];_0x12ca83[_0xd975('0x2a')](function(_0x2ef238){_0x13969a[_0xd975('0x4a')](getRemoteTag(_0x2ef238,_0x2ada8e,_0x57437b,_0xf76d30,_0x4521bd));});return Promise[_0xd975('0x4b')](_0x13969a)[_0xd975('0xa')](function(_0x20069e){if(_0x20069e[_0xd975('0xc')]){logger[_0xd975('0xd')]('['+[_0x5357ad[_0xd975('0xe')]()]+_0xd975('0x4c'),_0x20069e);var _0x299e4c=[];_0x20069e[_0xd975('0x2a')](function(_0x4ff83d){_0x299e4c['push'](assignTagToIncident(_0x4ff83d,_0x2ada8e,_0x57437b,_0x30435f,_0xf76d30));});return Promise['all'](_0x299e4c)['then'](function(){_0x56a28d();})[_0xd975('0x1c')](function(){_0x56a28d();});}else{_0x56a28d();}});});}function getTags(_0x900ba6,_0x1e45bf,_0x319c4a,_0x1b319d,_0x3edd64,_0x1768ab){return function(_0x2a42ce){return new Promise(function(_0x7fce08,_0x27db46){var _0x433f14=[];var _0x35cbe6=_0x1b319d[_0xd975('0x4d')];if(_0x35cbe6&&_0x35cbe6['length']>0x0){_0x433f14=_[_0xd975('0x4e')](_0x35cbe6,_0xd975('0x38'));}if(_0x433f14[_0xd975('0xc')]>0x0){return manageTags(_0x900ba6,_0x433f14,_0x1e45bf,_0x319c4a,_0x2a42ce,_0x3edd64,_0x1768ab)[_0xd975('0xa')](function(){_0x7fce08(_0x2a42ce);});}else{_0x7fce08(_0x2a42ce);}});};}function emit(_0x14c92a,_0x135d9f,_0x397bd8){var _0xfcbb45=_0xd975('0x4f')+_0xd975('0x50')+_0xd975('0x51')+_0xd975('0x52');var _0x53f934={'uri':_0x14c92a+_0xd975('0x53')+_0x397bd8+_0xfcbb45};io['to'](util[_0xd975('0x54')]('user:%s',_0x135d9f))[_0xd975('0x55')]('trigger:browser:url',_0x53f934);}exports['cs']=function(_0x32500c,_0x4a149d,_0x2c6ef6,_0x3fa23b,_0x48bdd8,_0x23e9c6,_0x2ea3a9,_0x9c20bf){var _0x13f71b={};var _0x6fd185={'user':_0x23e9c6[_0xd975('0x56')],'pass':_0x23e9c6[_0xd975('0x57')]};var _0x20c4e3='sysparm_limit=1';var _0x262914='sysparm_display_value=true';_0x23e9c6[_0xd975('0x58')]=intUtil[_0xd975('0x59')](_0x23e9c6[_0xd975('0x58')]);_0x23e9c6[_0xd975('0x5a')]=intUtil[_0xd975('0x59')](_0x23e9c6['serverUrl']);var _0x25a3d0=util['format'](_0xd975('0x5b'),_0x23e9c6[_0xd975('0x58')]);_0x13f71b[_0xd975('0x13')]=!_[_0xd975('0x5c')](_0x3fa23b)?_0x3fa23b[_0xd975('0x5d')]:null;_0x13f71b[_0xd975('0x1e')]=_0x23e9c6[_0xd975('0x5d')];_0x13f71b[_0xd975('0x22')]=_0x9c20bf[_0xd975('0x31')]()==='outbound'?_0x4a149d[_0xd975('0x5e')]:_0x4a149d[_0xd975('0x5f')];_0x13f71b[_0xd975('0x60')]=_0x9c20bf===_0xd975('0x61')||_0x9c20bf===_0xd975('0x62')?_0xd975('0x61'):_0xd975('0x3a');var _0x2a5aac=util[_0xd975('0x54')](_0xd975('0x63'),_0x23e9c6[_0xd975('0x5a')],_0x4a149d['uniqueid'],md5(_0x4a149d[_0xd975('0x64')]));if(_0x48bdd8&&_0x48bdd8['monitor_format']){logger['info']('[QUEUE]',_0xd975('0x65'));_0x4a149d[_0xd975('0x66')]=_0x2a5aac;}else if(_0x2ea3a9&&_0x2ea3a9['recordingFormat']&&_0x2ea3a9['recordingFormat']!==_0xd975('0x67')){logger[_0xd975('0xd')](_0xd975('0x68'),_0xd975('0x65'));_0x4a149d[_0xd975('0x66')]=_0x2a5aac;}else{_0x4a149d[_0xd975('0x66')]='';}return getAdminUser(_0x9c20bf,_0x6fd185,_0x13f71b,_0x25a3d0,_0x262914,_0x20c4e3)['then'](getUser(_0x9c20bf,_0x6fd185,_0x25a3d0,_0x262914,_0x20c4e3))[_0xd975('0xa')](getEndUser(_0x9c20bf,_0x6fd185,_0x25a3d0,_0x262914,_0x20c4e3))[_0xd975('0xa')](getTicket(_0x9c20bf,_0x6fd185,_0x25a3d0,_0x2c6ef6,_0x4a149d,_0x262914))['then'](function(_0x26f5b2){logger[_0xd975('0xd')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x26f5b2[_0xd975('0x42')]));logger['info'](util[_0xd975('0x54')](_0xd975('0x69'),_0x9c20bf));if(_0x9c20bf!==_0xd975('0x62')){logger[_0xd975('0xd')]('['+[_0x9c20bf[_0xd975('0xe')]()]+']',_0xd975('0x6a'));emit(_0x23e9c6['remoteUri'],_0x3fa23b[_0xd975('0x38')],_0x26f5b2[_0xd975('0x42')]);}})[_0xd975('0x1c')](function(_0x1c991b){logger['error']('['+[_0x9c20bf['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xd975('0x6b')](_0x1c991b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x66ac=['GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','adminEmail','],\x20getUser\x20crm','userId','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','forEach','picklist','type','nameField','content','includes','string','idField','customField','toLowerCase','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults'];(function(_0x52bed7,_0x317ee1){var _0x5a2df7=function(_0x51f654){while(--_0x51f654){_0x52bed7['push'](_0x52bed7['shift']());}};_0x5a2df7(++_0x317ee1);}(_0x66ac,0x1f2));var _0xc66a=function(_0x41e822,_0x5b16c3){_0x41e822=_0x41e822-0x0;var _0x250fa2=_0x66ac[_0x41e822];return _0x250fa2;};'use strict';var _=require(_0xc66a('0x0'));var Promise=require(_0xc66a('0x1'));var rp=require(_0xc66a('0x2'));var util=require(_0xc66a('0x3'));var md5=require(_0xc66a('0x4'));var Redis=require(_0xc66a('0x5'));var intUtil=require(_0xc66a('0x6'));var config=require(_0xc66a('0x7'));var logger=require(_0xc66a('0x8'))(_0xc66a('0x9'));config[_0xc66a('0xa')]=_[_0xc66a('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x4917a8,_0x4cd014,_0x1f3c95,_0xb0b177,_0x179d9d,_0x3083de){return new Promise(function(_0x366b6a,_0x1d0f39){var _0x5ba6a4={'method':_0xc66a('0xc'),'uri':_0xb0b177+_0xc66a('0xd')+'&'+_0x179d9d+'&'+_0x3083de,'auth':_0x4cd014,'json':!![]};return rp(_0x5ba6a4)[_0xc66a('0xe')](function(_0x46842f){if(_0x46842f[_0xc66a('0xf')]['length']>0x0){_0x1f3c95[_0xc66a('0x10')]=_0x46842f[_0xc66a('0xf')][0x0][_0xc66a('0x11')];}logger[_0xc66a('0x12')]('['+[_0x4917a8[_0xc66a('0x13')]()]+_0xc66a('0x14'),_0x1f3c95);_0x366b6a(_0x1f3c95);})[_0xc66a('0x15')](function(_0x1e4517){logger[_0xc66a('0x16')]('['+[_0x4917a8[_0xc66a('0x13')]()]+']',_0x1e4517[_0xc66a('0x17')]);_0x1d0f39(_0x1e4517[_0xc66a('0x17')]);});});}function getUser(_0x14cf2a,_0x412c99,_0x4000e9,_0x582ef0,_0x53acac){return function(_0x273324){logger[_0xc66a('0x12')]('['+[_0x14cf2a[_0xc66a('0x13')]()]+_0xc66a('0x18'),_0x273324);return new Promise(function(_0x36a055,_0x45b38b){if(intUtil['validateEmail'](_0x273324[_0xc66a('0x19')])){var _0x340754={'method':'GET','uri':_0x4000e9+_0xc66a('0x1a')+_0x273324[_0xc66a('0x19')]+'&'+_0x582ef0+'&'+_0x53acac,'auth':_0x412c99,'json':!![]};logger[_0xc66a('0x12')]('['+[_0x14cf2a['toUpperCase']()]+_0xc66a('0x1b'),_0x340754);return rp(_0x340754)[_0xc66a('0xe')](function(_0x378ce6){logger[_0xc66a('0x12')]('['+[_0x14cf2a['toUpperCase']()]+_0xc66a('0x1c'),_0x378ce6);if(_0x378ce6['result'][_0xc66a('0x1d')]>0x0&&String(_0x378ce6['result'][0x0][_0xc66a('0x1e')])==='true'){_0x273324['userId']=_0x378ce6[_0xc66a('0xf')][0x0][_0xc66a('0x11')];}else{_0x273324['userId']=_0x273324[_0xc66a('0x10')];_0x273324[_0xc66a('0x19')]=_0x273324[_0xc66a('0x1f')];}logger[_0xc66a('0x12')]('['+[_0x14cf2a[_0xc66a('0x13')]()]+_0xc66a('0x20'),_0x273324);_0x36a055(_0x273324);})[_0xc66a('0x15')](function(_0x5ad6b6){logger[_0xc66a('0x16')]('['+[_0x14cf2a[_0xc66a('0x13')]()]+']',_0x5ad6b6[_0xc66a('0x17')]);_0x45b38b(_0x5ad6b6[_0xc66a('0x17')]);});}else{logger[_0xc66a('0x12')]('['+[_0x14cf2a[_0xc66a('0x13')]()]+']\x20using\x20admin\x20profile');_0x273324[_0xc66a('0x21')]=_0x273324[_0xc66a('0x10')];_0x273324[_0xc66a('0x19')]=_0x273324[_0xc66a('0x1f')];_0x36a055(_0x273324);}});};}function createEndUser(_0x5bd85a,_0x35d234,_0x278a31,_0x206951,_0xbafa62){logger[_0xc66a('0x12')]('['+[_0x5bd85a[_0xc66a('0x13')]()]+_0xc66a('0x22'),_0x278a31);return new Promise(function(_0x26fa5b,_0x1c69c9){var _0x36214b={'method':_0xc66a('0x23'),'uri':_0x206951+_0xc66a('0x24')+_0xbafa62,'body':{'user_name':_0x278a31[_0xc66a('0x25')],'roles':'user','first_name':_0x278a31['endUserNumber'],'active':_0xc66a('0x26'),'date_format':'System','phone':_0x278a31[_0xc66a('0x25')]},'auth':_0x35d234,'json':!![]};return rp(_0x36214b)['then'](function(_0x44b55f){logger[_0xc66a('0x12')]('['+[_0x5bd85a[_0xc66a('0x13')]()]+_0xc66a('0x27'),_0x44b55f['result']);_0x278a31[_0xc66a('0x28')]=_0x44b55f[_0xc66a('0xf')][_0xc66a('0x11')];_0x26fa5b(_0x278a31);})['catch'](function(_0x2a24d3){logger['error']('['+[_0x5bd85a[_0xc66a('0x13')]()]+']',_0x2a24d3[_0xc66a('0x17')]);_0x1c69c9(_0x2a24d3[_0xc66a('0x17')]);});});}function getEndUser(_0x59e799,_0x2b08ed,_0x205a51,_0x22b826,_0x580602){return function(_0x262022){logger[_0xc66a('0x12')]('['+[_0x59e799[_0xc66a('0x13')]()]+_0xc66a('0x29'),_0x262022);return new Promise(function(_0x283949,_0x32808a){var _0x4e8908={'method':_0xc66a('0xc'),'uri':_0x205a51+_0xc66a('0x2a')+_0x262022[_0xc66a('0x25')]+'&'+_0x22b826+'&'+_0x580602,'auth':_0x2b08ed,'json':!![]};return rp(_0x4e8908)[_0xc66a('0xe')](function(_0x4103ef){if(_0x4103ef[_0xc66a('0xf')][_0xc66a('0x1d')]>0x0){_0x262022['endUserId']=_0x4103ef[_0xc66a('0xf')][0x0][_0xc66a('0x11')];logger['info']('['+[_0x59e799['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x262022);_0x283949(_0x262022);}else{return createEndUser(_0x59e799,_0x2b08ed,_0x262022,_0x205a51,_0x22b826)[_0xc66a('0xe')](function(_0x49f637){logger[_0xc66a('0x12')]('['+[_0x59e799[_0xc66a('0x13')]()]+'],\x20createEndUser\x20crm',_0x49f637);_0x283949(_0x49f637);});}})['catch'](function(_0x4a4518){logger[_0xc66a('0x16')]('['+[_0x59e799[_0xc66a('0x13')]()]+']',_0x4a4518['message']);_0x32808a(_0x4a4518[_0xc66a('0x17')]);});});};}function getCustomFields(_0x110e90,_0x3436fa){var _0x25a462={};if(_0x110e90[_0xc66a('0x1d')]>0x0){_[_0xc66a('0x2b')](_0x110e90,function(_0x530c01){if(_['includes'](['string',_0xc66a('0x2c')],_0x530c01[_0xc66a('0x2d')])&&_0x530c01[_0xc66a('0x2e')]&&!_0x530c01['customField']){_0x25a462[_0x530c01[_0xc66a('0x2e')]['toLowerCase']()]=_0x530c01[_0xc66a('0x2f')]['toString']();}else if(_[_0xc66a('0x30')]([_0xc66a('0x31'),'picklist'],_0x530c01[_0xc66a('0x2d')])&&_0x530c01[_0xc66a('0x32')]&&_0x530c01[_0xc66a('0x33')]){_0x25a462[_0x530c01[_0xc66a('0x32')][_0xc66a('0x34')]()]=_0x530c01[_0xc66a('0x2f')]['toString']();}else if(_0x530c01['type']==='variable'&&_0x530c01['variableName']&&_0x530c01['idField']&&_0x530c01[_0xc66a('0x33')]){_0x25a462[_0x530c01[_0xc66a('0x32')]['toLowerCase']()]=_0x3436fa[_0x530c01[_0xc66a('0x35')]][_0xc66a('0x36')]();}else if(_0x530c01[_0xc66a('0x2d')]===_0xc66a('0x37')&&_0x530c01[_0xc66a('0x38')]&&_0x530c01[_0xc66a('0x38')][_0xc66a('0x39')]&&_0x530c01[_0xc66a('0x32')]&&_0x530c01[_0xc66a('0x33')]){_0x25a462[_0x530c01[_0xc66a('0x32')][_0xc66a('0x34')]()]=_0x3436fa[_0x530c01[_0xc66a('0x38')][_0xc66a('0x39')][_0xc66a('0x34')]()][_0xc66a('0x36')]();}});}return _0x25a462;}function getTicket(_0x1e2eb1,_0x243450,_0x4260c3,_0x3e75bc,_0x4902a7,_0x543e90){return function(_0x36c929){logger[_0xc66a('0x12')]('['+[_0x1e2eb1['toUpperCase']()]+_0xc66a('0x3a'),_0x36c929);return new Promise(function(_0x19ffda,_0x7ad9d2){var _0xe39536=_0x1e2eb1['toLowerCase']()===_0xc66a('0x3b')?_0x36c929['userId']:_0x36c929['endUserId'];var _0x209716={'method':_0xc66a('0x23'),'uri':_0x4260c3+'incident'+'?'+_0x543e90,'body':Object[_0xc66a('0x3c')]({},{'active':_0xc66a('0x26'),'caller_id':_0xe39536,'assigned_to':_0x36c929['userId'],'short_description':intUtil['getString'](_0x3e75bc[_0xc66a('0x3d')],_0x4902a7,'\x20'),'description':intUtil['getString'](_0x3e75bc[_0xc66a('0x3e')],_0x4902a7,'\x0a')},getCustomFields(_0x3e75bc['Fields'],_0x4902a7)),'auth':_0x243450,'json':!![]};return rp(_0x209716)['then'](function(_0x2b8bf6){logger['info']('['+[_0x1e2eb1['toUpperCase']()]+_0xc66a('0x3f'),_0x2b8bf6[_0xc66a('0xf')]);_0x36c929['ticketId']=_0x2b8bf6[_0xc66a('0xf')][_0xc66a('0x11')];_0x36c929[_0xc66a('0x40')]=_0x2b8bf6['result']['number'];logger[_0xc66a('0x12')]('['+[_0x1e2eb1[_0xc66a('0x13')]()]+_0xc66a('0x41'),_0x36c929);_0x19ffda(_0x36c929);})[_0xc66a('0x15')](function(_0x4e5411){logger[_0xc66a('0x16')]('['+[_0x1e2eb1[_0xc66a('0x13')]()]+']',_0x4e5411[_0xc66a('0x17')]);_0x7ad9d2(_0x4e5411[_0xc66a('0x17')]);});});};}function createRemoteTag(_0x2123c5,_0x51f73e,_0x41ecb6,_0x158b33){return new Promise(function(_0x14550d,_0x5ecf82){var _0x5a6dba={'method':_0xc66a('0x23'),'uri':_0x41ecb6+_0xc66a('0x42')+'?'+_0x158b33,'body':{'short_description':_0x2123c5,'global':!![],'active':!![],'name':_0x2123c5},'auth':_0x51f73e,'json':!![]};return rp(_0x5a6dba)['then'](function(_0x84a025){var _0x2ebe27=_0x84a025[_0xc66a('0xf')]['sys_id'];_0x14550d(_0x2ebe27);});});}function getRemoteTag(_0x272e6f,_0x1affc3,_0xa01a7e,_0x51359a,_0x312277){return new Promise(function(_0x365c5c,_0x598629){var _0x134925={'method':_0xc66a('0xc'),'uri':_0xa01a7e+'label'+'?sysparm_query=name%3D'+_0x272e6f+'&'+_0x51359a,'auth':_0x1affc3,'json':!![]};return rp(_0x134925)[_0xc66a('0xe')](function(_0x22f746){if(_0x22f746['result'][_0xc66a('0x1d')]>0x0){var _0x28dbd4=_0x22f746[_0xc66a('0xf')][0x0][_0xc66a('0x11')];_0x365c5c(_0x28dbd4);}else{return createRemoteTag(_0x272e6f,_0x1affc3,_0xa01a7e,_0x51359a)[_0xc66a('0xe')](function(_0x455055){_0x365c5c(_0x455055);});}});});}function assignTagToIncident(_0x5eed10,_0x5c8640,_0x265a58,_0x5631cb,_0x302184){return new Promise(function(_0x4d9d3a,_0x2d03f5){var _0x66e9f9={'method':_0xc66a('0x23'),'uri':_0x265a58+_0xc66a('0x43')+'?'+_0x302184,'body':{'label':_0x5eed10,'table':'incident','id_type':_0xc66a('0x44'),'table_key':_0x5631cb['ticketId'],'title':_0xc66a('0x45')+_0x5631cb['ticketNumber'],'id_display':_0x5631cb[_0xc66a('0x40')]},'auth':_0x5c8640,'json':!![]};return rp(_0x66e9f9)[_0xc66a('0xe')](function(_0x37fd68){_0x4d9d3a();})[_0xc66a('0x15')](function(){_0x4d9d3a();});});}function manageTags(_0x4fcb94,_0x53c428,_0x23f3da,_0x12769f,_0x125150,_0x2f0b4a,_0x2e3c04){return new Promise(function(_0x2b7967,_0x1e4158){var _0x20d325=[];_0x53c428[_0xc66a('0x2b')](function(_0x20a298){_0x20d325[_0xc66a('0x46')](getRemoteTag(_0x20a298,_0x23f3da,_0x12769f,_0x2f0b4a,_0x2e3c04));});return Promise[_0xc66a('0x47')](_0x20d325)[_0xc66a('0xe')](function(_0x465658){if(_0x465658[_0xc66a('0x1d')]){logger['info']('['+[_0x4fcb94[_0xc66a('0x13')]()]+_0xc66a('0x48'),_0x465658);var _0x14cac9=[];_0x465658[_0xc66a('0x2b')](function(_0x5b6d08){_0x14cac9[_0xc66a('0x46')](assignTagToIncident(_0x5b6d08,_0x23f3da,_0x12769f,_0x125150,_0x2f0b4a));});return Promise['all'](_0x14cac9)[_0xc66a('0xe')](function(){_0x2b7967();})[_0xc66a('0x15')](function(){_0x2b7967();});}else{_0x2b7967();}});});}function getTags(_0x59d97b,_0x46af0d,_0x597e4c,_0x5c3214,_0x5ebc38,_0x590500){return function(_0x18c46b){return new Promise(function(_0x10b757,_0x333aef){var _0x3db081=[];var _0x35792b=_0x5c3214[_0xc66a('0x49')];if(_0x35792b&&_0x35792b['length']>0x0){_0x3db081=_[_0xc66a('0x4a')](_0x35792b,'name');}if(_0x3db081['length']>0x0){return manageTags(_0x59d97b,_0x3db081,_0x46af0d,_0x597e4c,_0x18c46b,_0x5ebc38,_0x590500)['then'](function(){_0x10b757(_0x18c46b);});}else{_0x10b757(_0x18c46b);}});};}function emit(_0x14b064,_0x5a4c94,_0x13dc7c){var _0x12c566='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x15cc8b={'uri':_0x14b064+_0xc66a('0x4b')+_0x13dc7c+_0x12c566};io['to'](util[_0xc66a('0x4c')](_0xc66a('0x4d'),_0x5a4c94))['emit']('trigger:browser:url',_0x15cc8b);}exports['cs']=function(_0x445c0c,_0x46e38e,_0x2f44f4,_0x21c4b6,_0x4bc211,_0x3f0c9b,_0x4c5f30,_0x4fbc85){var _0x150b9c={};var _0x134074={'user':_0x3f0c9b[_0xc66a('0x4e')],'pass':_0x3f0c9b['password']};var _0x772030=_0xc66a('0x4f');var _0x21eadc=_0xc66a('0x50');_0x3f0c9b[_0xc66a('0x51')]=intUtil[_0xc66a('0x52')](_0x3f0c9b[_0xc66a('0x51')]);_0x3f0c9b[_0xc66a('0x53')]=intUtil[_0xc66a('0x52')](_0x3f0c9b['serverUrl']);var _0x2a236f=util[_0xc66a('0x4c')](_0xc66a('0x54'),_0x3f0c9b[_0xc66a('0x51')]);_0x150b9c[_0xc66a('0x19')]=!_[_0xc66a('0x55')](_0x21c4b6)?_0x21c4b6[_0xc66a('0x56')]:null;_0x150b9c['adminEmail']=_0x3f0c9b[_0xc66a('0x56')];_0x150b9c['endUserNumber']=_0x4fbc85['toLowerCase']()===_0xc66a('0x3b')?_0x46e38e['destcalleridnum']:_0x46e38e[_0xc66a('0x57')];_0x150b9c[_0xc66a('0x58')]=_0x4fbc85===_0xc66a('0x59')||_0x4fbc85===_0xc66a('0x5a')?_0xc66a('0x59'):_0xc66a('0x3b');var _0x4ad66d=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3f0c9b[_0xc66a('0x53')],_0x46e38e[_0xc66a('0x5b')],md5(_0x46e38e[_0xc66a('0x5b')]));if(_0x4bc211&&_0x4bc211['monitor_format']){logger[_0xc66a('0x12')](_0xc66a('0x5c'),_0xc66a('0x5d'));_0x46e38e[_0xc66a('0x5e')]=_0x4ad66d;}else if(_0x4c5f30&&_0x4c5f30[_0xc66a('0x5f')]&&_0x4c5f30[_0xc66a('0x5f')]!==_0xc66a('0x60')){logger[_0xc66a('0x12')](_0xc66a('0x61'),_0xc66a('0x5d'));_0x46e38e['recordingURL']=_0x4ad66d;}else{_0x46e38e[_0xc66a('0x5e')]='';}return getAdminUser(_0x4fbc85,_0x134074,_0x150b9c,_0x2a236f,_0x21eadc,_0x772030)['then'](getUser(_0x4fbc85,_0x134074,_0x2a236f,_0x21eadc,_0x772030))['then'](getEndUser(_0x4fbc85,_0x134074,_0x2a236f,_0x21eadc,_0x772030))['then'](getTicket(_0x4fbc85,_0x134074,_0x2a236f,_0x2f44f4,_0x46e38e,_0x21eadc))[_0xc66a('0xe')](function(_0x7c549f){logger['info'](util[_0xc66a('0x4c')](_0xc66a('0x62'),_0x7c549f[_0xc66a('0x63')]));logger[_0xc66a('0x12')](util[_0xc66a('0x4c')]('call\x20direction:\x20%s',_0x4fbc85));if(_0x4fbc85!==_0xc66a('0x5a')){logger[_0xc66a('0x12')]('['+[_0x4fbc85[_0xc66a('0x13')]()]+']',_0xc66a('0x64'));emit(_0x3f0c9b[_0xc66a('0x51')],_0x21c4b6[_0xc66a('0x39')],_0x7c549f['ticketId']);}})['catch'](function(_0x260002){logger[_0xc66a('0x16')]('['+[_0x4fbc85['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xc66a('0x65')](_0x260002,{'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 fe4a281..35ea8f8 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 _0x9b71=['calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','name','getString','Subjects','assigned_user_id','created_by','description','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','length','push','idField','variableName','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','then','find','name_value_list','user_name','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','entry_list','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','forEach','type','nameField','customField','toLowerCase','content','string','variable','custom_fields','customVariable','Variable','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','Calls','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname'];(function(_0x211b58,_0x38996f){var _0x136aba=function(_0x1adc1e){while(--_0x1adc1e){_0x211b58['push'](_0x211b58['shift']());}};_0x136aba(++_0x38996f);}(_0x9b71,0x1f4));var _0x19b7=function(_0x32202d,_0x2c048d){_0x32202d=_0x32202d-0x0;var _0xcdea74=_0x9b71[_0x32202d];return _0xcdea74;};'use strict';var _=require(_0x19b7('0x0'));var rp=require(_0x19b7('0x1'));var BPromise=require(_0x19b7('0x2'));var md5=require(_0x19b7('0x3'));var util=require(_0x19b7('0x4'));var Redis=require(_0x19b7('0x5'));var intUtil=require(_0x19b7('0x6'));var config=require(_0x19b7('0x7'));var logger=require(_0x19b7('0x8'))(_0x19b7('0x9'));config[_0x19b7('0xa')]=_[_0x19b7('0xb')](config['redis'],{'host':_0x19b7('0xc'),'port':0x18eb});var io=require(_0x19b7('0xd'))(new Redis(config[_0x19b7('0xa')]));var def={'method':_0x19b7('0xe'),'json':!![]};function emit(_0x5d79d4,_0x3c54a1,_0x5c4b83){io['to'](_0x5d79d4)[_0x19b7('0xf')](_0x3c54a1,_0x5c4b83);}function getTicket(_0x4da8fd,_0x3f669c,_0x200b15,_0x2bedae,_0x510ed2,_0x1a7428,_0x2818f5,_0x5b7dae){logger['info']('Creating\x20new\x20ticket...');var _0x37b07b=new Date();var _0x2f5702=[{'name':_0x19b7('0x10'),'value':intUtil[_0x19b7('0x11')](_0x2bedae[_0x19b7('0x12')],_0x510ed2,'\x20')},{'name':_0x19b7('0x13'),'value':_0x3f669c['id']},{'name':_0x19b7('0x14'),'value':_0x3f669c['id']},{'name':_0x19b7('0x15'),'value':intUtil[_0x19b7('0x11')](_0x2bedae['Descriptions'],_0x510ed2,'\x0a')},{'name':'date_start','value':_0x37b07b[_0x19b7('0x16')]()[_0x19b7('0x17')](0x0,0x13)[_0x19b7('0x18')]('T','\x20')},{'name':_0x19b7('0x19'),'value':'0'},{'name':_0x19b7('0x1a'),'value':'15'},{'name':_0x19b7('0x1b'),'value':_0x200b15['id']},{'name':'parent_type','value':_0x19b7('0x1c')},{'name':'parent_name','value':_0x200b15[_0x19b7('0x10')]},{'name':'direction','value':_0x5b7dae}];if(_0x1a7428[_0x19b7('0x1d')]){_['forEach'](_0x1a7428,function(_0x1801f4){if(_0x510ed2[_0x1801f4['variableName']]){_0x2f5702[_0x19b7('0x1e')]({'name':_0x1801f4[_0x19b7('0x1f')],'value':_0x510ed2[_0x1801f4[_0x19b7('0x20')]]});}});}return request({'form':{'method':_0x19b7('0x21'),'input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0x2818f5['id'],'module_name':'Calls','name_value_list':_0x2f5702})}});}function getAuth(_0x82067d){return util[_0x19b7('0x24')](_0x19b7('0x25'),new Buffer(_0x82067d[_0x19b7('0x26')]+':X')[_0x19b7('0x27')](_0x19b7('0x28')));}function getServerInfo(_0x59d913){return request({'form':{'method':_0x19b7('0x29'),'input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0x59d913['id']})}});}function getUser(_0xcb81c5,_0x3591bd,_0x45d379){if(!_[_0x19b7('0x2a')](_0x3591bd)){logger[_0x19b7('0x2b')](_0x19b7('0x2c'),_0x3591bd);return request({'form':{'method':_0x19b7('0x2d'),'input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0x45d379['id'],'module_name':'Employees','query':util[_0x19b7('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3591bd),'order_by':'','offset':'0','select_fields':['id',_0x19b7('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x19b7('0x2e')](function(_0x414ad1){if(_0x414ad1['entry_list']['length']){var _0x2b73d9=_[_0x19b7('0x2f')](_0x414ad1['entry_list'],function(_0x31b78c){return _0x31b78c[_0x19b7('0x30')][_0x19b7('0x31')]['value']===_0x3591bd;});if(_0x2b73d9){logger['info']('Agent\x20found!');return BPromise[_0x19b7('0x32')]({'id':_0x2b73d9[_0x19b7('0x30')]['id']['value'],'name':_0x2b73d9[_0x19b7('0x30')][_0x19b7('0x10')]['value']});}}logger[_0x19b7('0x2b')](_0x19b7('0x33'));return BPromise[_0x19b7('0x32')]({'id':_0x45d379['name_value_list'][_0x19b7('0x34')]['value'],'name':_0x45d379['name_value_list'][_0x19b7('0x31')][_0x19b7('0x35')]});});}else{logger[_0x19b7('0x2b')](_0x19b7('0x36'));return BPromise['resolve']({'id':_0x45d379[_0x19b7('0x30')][_0x19b7('0x34')]['value'],'name':_0x45d379[_0x19b7('0x30')][_0x19b7('0x31')][_0x19b7('0x35')]});}}function getEndUser(_0x1e9364,_0x4f567e,_0x13c74c,_0x56c072){logger[_0x19b7('0x2b')](_0x19b7('0x37'),_0x13c74c);return request({'form':{'method':'get_entry_list','input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0x56c072['id'],'module_name':_0x19b7('0x1c'),'query':util[_0x19b7('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x13c74c),'order_by':'','offset':'0','select_fields':['id',_0x19b7('0x10'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x19b7('0x2e')](function(_0x93b75c){if(_0x93b75c[_0x19b7('0x38')][_0x19b7('0x1d')]){var _0x3bb368=_[_0x19b7('0x2f')](_0x93b75c[_0x19b7('0x38')],function(_0x12e04a){return _0x12e04a[_0x19b7('0x30')]['phone_home'][_0x19b7('0x35')]===_0x13c74c;});if(_0x3bb368){logger[_0x19b7('0x2b')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x3bb368[_0x19b7('0x30')]['id'][_0x19b7('0x35')],'name':_0x3bb368[_0x19b7('0x30')][_0x19b7('0x10')][_0x19b7('0x35')],'phone':_0x3bb368['name_value_list'][_0x19b7('0x39')][_0x19b7('0x35')]});}}else{logger[_0x19b7('0x2b')](_0x19b7('0x3a'));return request({'form':{'method':_0x19b7('0x21'),'input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0x56c072['id'],'module_name':'Contacts','name_value_list':[{'name':_0x19b7('0x3b'),'value':_0x4f567e!==_0x19b7('0x3c')?_0x4f567e:util['format'](_0x19b7('0x3d'),_0x13c74c)},{'name':_0x19b7('0x39'),'value':_0x13c74c}]})}})[_0x19b7('0x2e')](function(_0x2fbcd5){logger['info'](_0x19b7('0x3e'));return BPromise[_0x19b7('0x32')]({'id':_0x2fbcd5['id'],'name':_0x2fbcd5['entry_list'][_0x19b7('0x3b')][_0x19b7('0x35')],'phone':_0x2fbcd5[_0x19b7('0x38')]['phone_home'][_0x19b7('0x35')]});});}});}function request(_0x31b861){logger[_0x19b7('0x3f')](_0x19b7('0x40'),JSON[_0x19b7('0x23')](_0x31b861));return rp(_[_0x19b7('0x41')](def,_0x31b861));}function getTags(_0x3c4b10,_0x433ea4){var _0x24e89a=[];if(_0x3c4b10&&_0x3c4b10[_0x19b7('0x1d')]>0x0){_0x24e89a=_['map'](_0x3c4b10,_0x433ea4);}return _0x24e89a;}function getCustomFields(_0x1fb5d3,_0x4a161b){var _0x313be9=[];var _0x177bd5={'custom_fields':[]};if(_0x1fb5d3['length']>0x0){_[_0x19b7('0x42')](_0x1fb5d3,function(_0x42de10){if(_0x42de10[_0x19b7('0x43')]==='string'&&_0x42de10[_0x19b7('0x44')]&&!_0x42de10[_0x19b7('0x45')]){_0x177bd5[_0x42de10[_0x19b7('0x44')][_0x19b7('0x46')]()]=_0x42de10[_0x19b7('0x47')][_0x19b7('0x27')]();}else if(_0x42de10[_0x19b7('0x43')]===_0x19b7('0x48')&&_0x42de10[_0x19b7('0x1f')]&&_0x42de10[_0x19b7('0x45')]){_0x177bd5['custom_fields']['push']({'id':_0x42de10[_0x19b7('0x1f')],'value':_0x42de10[_0x19b7('0x47')][_0x19b7('0x27')]()});}else if(_0x42de10[_0x19b7('0x43')]===_0x19b7('0x49')&&_0x42de10[_0x19b7('0x20')]&&_0x42de10[_0x19b7('0x1f')]&&_0x42de10['customField']){_0x4a161b[_0x42de10['variableName']]&&_0x177bd5[_0x19b7('0x4a')]['push']({'id':_0x42de10[_0x19b7('0x1f')],'value':_0x4a161b[_0x42de10['variableName']][_0x19b7('0x27')]()});}else if(_0x42de10[_0x19b7('0x43')]===_0x19b7('0x4b')&&_0x42de10[_0x19b7('0x4c')]&&_0x42de10[_0x19b7('0x4c')]['name']&&_0x42de10[_0x19b7('0x1f')]&&_0x42de10['customField']){_0x4a161b[_0x42de10[_0x19b7('0x4c')][_0x19b7('0x10')][_0x19b7('0x46')]()]&&_0x177bd5['custom_fields'][_0x19b7('0x1e')]({'id':_0x42de10[_0x19b7('0x1f')],'value':_0x4a161b[_0x42de10[_0x19b7('0x4c')]['name'][_0x19b7('0x46')]()][_0x19b7('0x27')]()});}});}return _0x177bd5;}function getConnection(_0x2e3c11){return request({'method':_0x19b7('0xe'),'form':{'method':'login','input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'user_auth':{'user_name':_0x2e3c11['username'],'password':_0x2e3c11[_0x19b7('0x4d')],'encryption':_0x19b7('0x4e')},'application':_0x19b7('0x4f')})}})[_0x19b7('0x2e')](function(_0x344f44){var _0x357db8=_0x344f44;if(_0x357db8['id']){def['sessionID']=_0x357db8['id'];return BPromise['resolve'](_0x357db8);}else{throw new Error(util[_0x19b7('0x24')]('Account\x20%d\x20is\x20not\x20valid',_0x2e3c11['id']));}});}function setRelationship(_0xfc3cd4,_0x84f5e1,_0x1ab8d8,_0x28bbc4){return request({'form':{'method':_0x19b7('0x50'),'input_type':_0x19b7('0x22'),'response_type':_0x19b7('0x22'),'rest_data':JSON[_0x19b7('0x23')]({'session':_0xfc3cd4['id'],'module_name':_0x19b7('0x51'),'module_id':_0x1ab8d8['id'],'link_field_name':_0x28bbc4,'related_ids':[_0x84f5e1['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x530cf1,_0x166c4b,_0x5cab68,_0x29b22a,_0x3901b9,_0x358fc2){var _0x51e811,_0x368f78,_0x562410,_0x579c4e;_0x358fc2[_0x19b7('0x52')]=intUtil[_0x19b7('0x53')](_0x358fc2[_0x19b7('0x52')]);_0x358fc2[_0x19b7('0x54')]=intUtil[_0x19b7('0x53')](_0x358fc2['serverUrl']);def[_0x19b7('0x55')]=util['format'](_0x19b7('0x56'),_0x358fc2[_0x19b7('0x52')]);if(_0x3901b9&&_0x3901b9[_0x19b7('0x57')]){logger[_0x19b7('0x2b')](_0x19b7('0x58'),_0x19b7('0x59'));_0x166c4b[_0x19b7('0x5a')]=util['format'](_0x19b7('0x5b'),_0x358fc2[_0x19b7('0x54')],_0x166c4b[_0x19b7('0x5c')],md5(_0x166c4b['uniqueid']));}else{_0x166c4b['recordingURL']='';}return getConnection(_0x358fc2)[_0x19b7('0x2e')](function(_0x32b8c8){_0x579c4e=_0x32b8c8;return getUser(_0x358fc2,_0x29b22a[_0x19b7('0x10')],_0x579c4e);})[_0x19b7('0x2e')](function(_0x557525){_0x51e811=_0x557525;logger['info'](_0x19b7('0x5d'),_0x51e811['id']);return getEndUser(_0x358fc2,_0x166c4b[_0x19b7('0x5e')],_0x166c4b[_0x19b7('0x5f')],_0x579c4e);})[_0x19b7('0x2e')](function(_0x90e59d){_0x368f78=_0x90e59d;logger[_0x19b7('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x368f78['id']);return getTicket(_0x358fc2,_0x51e811,_0x368f78,_0x5cab68,_0x166c4b,_0x5cab68[_0x19b7('0x60')],_0x579c4e,_0x19b7('0x61'));})['then'](function(_0x48dea4){_0x562410=_0x48dea4;logger['info'](_0x19b7('0x62'));logger['info'](_0x19b7('0x63'),_0x562410['id']);return setRelationship(_0x579c4e,_0x51e811,_0x562410,_0x19b7('0x64'));})['then'](function(){return setRelationship(_0x579c4e,_0x368f78,_0x562410,_0x19b7('0x65'));})[_0x19b7('0x2e')](function(){return getServerInfo(_0x579c4e);})[_0x19b7('0x2e')](function(_0x7880af){var _0x2a33c8=parseInt(_0x7880af[_0x19b7('0x66')][_0x19b7('0x67')](0x0));var _0x1d09ae=util[_0x19b7('0x24')](_0x19b7('0x68'),_0x358fc2[_0x19b7('0x52')],_0x562410['id']);if(_0x2a33c8>0x6){_0x1d09ae=util[_0x19b7('0x24')](_0x19b7('0x69'),_0x358fc2[_0x19b7('0x52')],_0x562410['id']);}logger[_0x19b7('0x2b')](_0x19b7('0x58'),_0x19b7('0x6a'));emit(util[_0x19b7('0x24')](_0x19b7('0x6b'),_0x29b22a[_0x19b7('0x10')]),_0x19b7('0x6c'),{'uri':_0x1d09ae});})[_0x19b7('0x6d')](function(_0xf834c8){logger[_0x19b7('0x6e')](_0x19b7('0x58'),JSON[_0x19b7('0x23')](_0xf834c8));});};exports['outbound']=function(_0x3ffab7,_0x140c53,_0x13470b,_0x4cfbb6,_0x1864bd,_0x2844da,_0x32ef12){var _0x2967d7,_0x25b6ff,_0x2f14e8,_0x56a393;_0x2844da[_0x19b7('0x52')]=intUtil['stripTrailingSlash'](_0x2844da[_0x19b7('0x52')]);_0x2844da[_0x19b7('0x54')]=intUtil[_0x19b7('0x53')](_0x2844da[_0x19b7('0x54')]);def[_0x19b7('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x2844da[_0x19b7('0x52')]);if(_0x32ef12&&_0x32ef12[_0x19b7('0x6f')]&&_0x32ef12['recordingFormat']!=='none'){logger['info'](_0x19b7('0x70'),_0x19b7('0x59'));_0x140c53[_0x19b7('0x5a')]=util[_0x19b7('0x24')](_0x19b7('0x5b'),_0x2844da[_0x19b7('0x54')],_0x140c53['uniqueid'],md5(_0x140c53['uniqueid']));}return getConnection(_0x2844da)[_0x19b7('0x2e')](function(_0x2feea8){_0x56a393=_0x2feea8;return getUser(_0x2844da,_0x4cfbb6[_0x19b7('0x10')],_0x56a393);})['then'](function(_0x59bf71){_0x2967d7=_0x59bf71;logger[_0x19b7('0x2b')]('The\x20User\x20ID\x20is:',_0x2967d7['id']);return getEndUser(_0x2844da,_0x140c53[_0x19b7('0x71')],_0x140c53[_0x19b7('0x72')],_0x56a393);})['then'](function(_0x43e511){_0x25b6ff=_0x43e511;logger[_0x19b7('0x2b')]('The\x20Enduser\x20ID\x20is:',_0x25b6ff['id']);return getTicket(_0x2844da,_0x2967d7,_0x25b6ff,_0x13470b,_0x140c53,_0x13470b[_0x19b7('0x60')],_0x56a393,_0x19b7('0x73'));})[_0x19b7('0x2e')](function(_0x24e5bf){_0x2f14e8=_0x24e5bf;logger['info']('Ticket\x20created!');logger['info'](_0x19b7('0x63'),_0x2f14e8['id']);return setRelationship(_0x56a393,_0x2967d7,_0x2f14e8,_0x19b7('0x64'));})[_0x19b7('0x2e')](function(){return setRelationship(_0x56a393,_0x25b6ff,_0x2f14e8,'contacts');})[_0x19b7('0x2e')](function(){return getServerInfo(_0x56a393);})[_0x19b7('0x2e')](function(_0x36817c){var _0x4ee349=parseInt(_0x36817c[_0x19b7('0x66')][_0x19b7('0x67')](0x0));var _0x4bc9df=util[_0x19b7('0x24')](_0x19b7('0x68'),_0x2844da[_0x19b7('0x52')],_0x2f14e8['id']);if(_0x4ee349>0x6){_0x4bc9df=util[_0x19b7('0x24')](_0x19b7('0x69'),_0x2844da[_0x19b7('0x52')],_0x2f14e8['id']);}logger['info'](_0x19b7('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x19b7('0x6b'),_0x4cfbb6['name']),_0x19b7('0x6c'),{'uri':_0x4bc9df});})[_0x19b7('0x6d')](function(_0xa37ee0){logger[_0x19b7('0x6e')](_0x19b7('0x70'),JSON[_0x19b7('0x23')](_0xa37ee0));});};exports[_0x19b7('0x74')]=function(_0x74d7e,_0x182d3e,_0x42a004,_0x4b25d3,_0x2953a6,_0x550102){var _0x43283d,_0xc473a0,_0x13a08c,_0x5925e0;_0x550102['remoteUri']=intUtil['stripTrailingSlash'](_0x550102[_0x19b7('0x52')]);_0x550102[_0x19b7('0x54')]=intUtil['stripTrailingSlash'](_0x550102[_0x19b7('0x54')]);def[_0x19b7('0x55')]=util['format'](_0x19b7('0x56'),_0x550102[_0x19b7('0x52')]);if(_0x2953a6&&_0x2953a6['monitor_format']){logger[_0x19b7('0x2b')]('['+_0x182d3e[_0x19b7('0x75')][_0x19b7('0x76')]()+']',_0x19b7('0x59'));_0x182d3e[_0x19b7('0x5a')]=util['format'](_0x19b7('0x5b'),_0x550102['serverUrl'],_0x182d3e[_0x19b7('0x5c')],md5(_0x182d3e[_0x19b7('0x5c')]));}else{_0x182d3e[_0x19b7('0x5a')]='';}return getConnection(_0x550102)[_0x19b7('0x2e')](function(_0x10b97e){_0x5925e0=_0x10b97e;if(!_[_0x19b7('0x2a')](_0x4b25d3)){return getUser(_0x550102,_0x4b25d3[_0x19b7('0x10')],_0x5925e0);}else{return getUser(_0x550102,null,_0x5925e0);}})[_0x19b7('0x2e')](function(_0x33ab9d){_0x43283d=_0x33ab9d;logger[_0x19b7('0x2b')]('The\x20User\x20ID\x20is:',_0x43283d['id']);return getEndUser(_0x550102,_0x182d3e[_0x19b7('0x5e')],_0x182d3e[_0x19b7('0x5f')],_0x5925e0);})[_0x19b7('0x2e')](function(_0xe3d8d3){_0xc473a0=_0xe3d8d3;logger[_0x19b7('0x2b')]('The\x20Enduser\x20ID\x20is:',_0xc473a0['id']);return getTicket(_0x550102,_0x43283d,_0xc473a0,_0x42a004,_0x182d3e,_0x42a004[_0x19b7('0x60')],_0x5925e0,_0x19b7('0x61'));})[_0x19b7('0x2e')](function(_0x309b48){_0x13a08c=_0x309b48;logger[_0x19b7('0x2b')](_0x19b7('0x62'));logger['info'](_0x19b7('0x63'),_0x13a08c['id']);return setRelationship(_0x5925e0,_0x43283d,_0x13a08c,_0x19b7('0x64'));})[_0x19b7('0x2e')](function(){return setRelationship(_0x5925e0,_0xc473a0,_0x13a08c,_0x19b7('0x65'));})[_0x19b7('0x2e')](function(){return getServerInfo(_0x5925e0);})[_0x19b7('0x6d')](function(_0x4e795d){logger[_0x19b7('0x6e')]('['+_0x182d3e['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x4e795d));});}; \ No newline at end of file +var _0x89ca=['first_name','debug','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','POST','login','username','password','PLAIN','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','uri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','stripTrailingSlash','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','toUpperCase','lodash','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','Descriptions','date_start','toISOString','duration_hours','parent_id','Contacts','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','entry_list','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x89ca,0x11e));var _0xa89c=function(_0x255cab,_0x4839d9){_0x255cab=_0x255cab-0x0;var _0x3171b5=_0x89ca[_0x255cab];return _0x3171b5;};'use strict';var _=require(_0xa89c('0x0'));var rp=require('request-promise');var BPromise=require(_0xa89c('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xa89c('0x2'));var intUtil=require(_0xa89c('0x3'));var config=require(_0xa89c('0x4'));var logger=require(_0xa89c('0x5'))('sugarcrm');config[_0xa89c('0x6')]=_[_0xa89c('0x7')](config[_0xa89c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa89c('0x8'))(new Redis(config[_0xa89c('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x1456a4,_0x3048b7,_0xaf8dbb){io['to'](_0x1456a4)[_0xa89c('0x9')](_0x3048b7,_0xaf8dbb);}function getTicket(_0x2dbcb7,_0x5f0a49,_0x2849ee,_0x130c88,_0xc526e3,_0x3e3e39,_0x467146,_0x5d2d78){logger[_0xa89c('0xa')](_0xa89c('0xb'));var _0x2246ee=new Date();var _0x340d93=[{'name':_0xa89c('0xc'),'value':intUtil[_0xa89c('0xd')](_0x130c88[_0xa89c('0xe')],_0xc526e3,'\x20')},{'name':'assigned_user_id','value':_0x5f0a49['id']},{'name':'created_by','value':_0x5f0a49['id']},{'name':'description','value':intUtil[_0xa89c('0xd')](_0x130c88[_0xa89c('0xf')],_0xc526e3,'\x0a')},{'name':_0xa89c('0x10'),'value':_0x2246ee[_0xa89c('0x11')]()['slice'](0x0,0x13)['replace']('T','\x20')},{'name':_0xa89c('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa89c('0x13'),'value':_0x2849ee['id']},{'name':'parent_type','value':_0xa89c('0x14')},{'name':'parent_name','value':_0x2849ee[_0xa89c('0xc')]},{'name':_0xa89c('0x15'),'value':_0x5d2d78}];if(_0x3e3e39[_0xa89c('0x16')]){_[_0xa89c('0x17')](_0x3e3e39,function(_0x34cc7c){if(_0xc526e3[_0x34cc7c[_0xa89c('0x18')]]){_0x340d93['push']({'name':_0x34cc7c[_0xa89c('0x19')],'value':_0xc526e3[_0x34cc7c[_0xa89c('0x18')]]});}});}return request({'form':{'method':_0xa89c('0x1a'),'input_type':_0xa89c('0x1b'),'response_type':'JSON','rest_data':JSON[_0xa89c('0x1c')]({'session':_0x467146['id'],'module_name':_0xa89c('0x1d'),'name_value_list':_0x340d93})}});}function getAuth(_0x1d1859){return util[_0xa89c('0x1e')](_0xa89c('0x1f'),new Buffer(_0x1d1859[_0xa89c('0x20')]+':X')[_0xa89c('0x21')](_0xa89c('0x22')));}function getServerInfo(_0x2a518c){return request({'form':{'method':_0xa89c('0x23'),'input_type':_0xa89c('0x1b'),'response_type':_0xa89c('0x1b'),'rest_data':JSON['stringify']({'session':_0x2a518c['id']})}});}function getUser(_0x3a4594,_0x202685,_0x49e1a0){if(!_['isNil'](_0x202685)){logger[_0xa89c('0xa')](_0xa89c('0x24'),_0x202685);return request({'form':{'method':_0xa89c('0x25'),'input_type':_0xa89c('0x1b'),'response_type':'JSON','rest_data':JSON[_0xa89c('0x1c')]({'session':_0x49e1a0['id'],'module_name':_0xa89c('0x26'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x202685),'order_by':'','offset':'0','select_fields':['id',_0xa89c('0xc'),_0xa89c('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa89c('0x28')](function(_0x277d8b){if(_0x277d8b['entry_list'][_0xa89c('0x16')]){var _0x3729a2=_['find'](_0x277d8b['entry_list'],function(_0xd963eb){return _0xd963eb[_0xa89c('0x29')]['user_name'][_0xa89c('0x2a')]===_0x202685;});if(_0x3729a2){logger['info'](_0xa89c('0x2b'));return BPromise[_0xa89c('0x2c')]({'id':_0x3729a2['name_value_list']['id'][_0xa89c('0x2a')],'name':_0x3729a2[_0xa89c('0x29')]['name'][_0xa89c('0x2a')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa89c('0x2c')]({'id':_0x49e1a0['name_value_list']['user_id'][_0xa89c('0x2a')],'name':_0x49e1a0['name_value_list'][_0xa89c('0x27')][_0xa89c('0x2a')]});});}else{logger[_0xa89c('0xa')](_0xa89c('0x2d'));return BPromise[_0xa89c('0x2c')]({'id':_0x49e1a0[_0xa89c('0x29')][_0xa89c('0x2e')]['value'],'name':_0x49e1a0[_0xa89c('0x29')]['user_name'][_0xa89c('0x2a')]});}}function getEndUser(_0x1139b7,_0x2042fd,_0x4784f2,_0xe25092){logger[_0xa89c('0xa')](_0xa89c('0x2f'),_0x4784f2);return request({'form':{'method':_0xa89c('0x25'),'input_type':'JSON','response_type':_0xa89c('0x1b'),'rest_data':JSON[_0xa89c('0x1c')]({'session':_0xe25092['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x4784f2),'order_by':'','offset':'0','select_fields':['id',_0xa89c('0xc'),_0xa89c('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa89c('0x28')](function(_0x1fc66e){if(_0x1fc66e[_0xa89c('0x31')][_0xa89c('0x16')]){var _0x476f1b=_[_0xa89c('0x32')](_0x1fc66e[_0xa89c('0x31')],function(_0x10e67c){return _0x10e67c[_0xa89c('0x29')]['phone_home'][_0xa89c('0x2a')]===_0x4784f2;});if(_0x476f1b){logger['info'](_0xa89c('0x33'));return BPromise[_0xa89c('0x2c')]({'id':_0x476f1b[_0xa89c('0x29')]['id'][_0xa89c('0x2a')],'name':_0x476f1b[_0xa89c('0x29')][_0xa89c('0xc')][_0xa89c('0x2a')],'phone':_0x476f1b['name_value_list']['phone_home'][_0xa89c('0x2a')]});}}else{logger[_0xa89c('0xa')](_0xa89c('0x34'));return request({'form':{'method':_0xa89c('0x1a'),'input_type':_0xa89c('0x1b'),'response_type':_0xa89c('0x1b'),'rest_data':JSON[_0xa89c('0x1c')]({'session':_0xe25092['id'],'module_name':_0xa89c('0x14'),'name_value_list':[{'name':'first_name','value':_0x2042fd!==_0xa89c('0x35')?_0x2042fd:util[_0xa89c('0x1e')](_0xa89c('0x36'),_0x4784f2)},{'name':'phone_home','value':_0x4784f2}]})}})[_0xa89c('0x28')](function(_0x39cdaf){logger[_0xa89c('0xa')](_0xa89c('0x37'));return BPromise[_0xa89c('0x2c')]({'id':_0x39cdaf['id'],'name':_0x39cdaf[_0xa89c('0x31')][_0xa89c('0x38')]['value'],'phone':_0x39cdaf[_0xa89c('0x31')][_0xa89c('0x30')][_0xa89c('0x2a')]});});}});}function request(_0xa75414){logger[_0xa89c('0x39')]('[HTTP]',JSON[_0xa89c('0x1c')](_0xa75414));return rp(_[_0xa89c('0x3a')](def,_0xa75414));}function getTags(_0x108fa2,_0x392a32){var _0x12ece3=[];if(_0x108fa2&&_0x108fa2[_0xa89c('0x16')]>0x0){_0x12ece3=_[_0xa89c('0x3b')](_0x108fa2,_0x392a32);}return _0x12ece3;}function getCustomFields(_0x2b1af3,_0x279142){var _0x22038c=[];var _0x428c61={'custom_fields':[]};if(_0x2b1af3[_0xa89c('0x16')]>0x0){_[_0xa89c('0x17')](_0x2b1af3,function(_0x2b9522){if(_0x2b9522[_0xa89c('0x3c')]===_0xa89c('0x3d')&&_0x2b9522[_0xa89c('0x3e')]&&!_0x2b9522[_0xa89c('0x3f')]){_0x428c61[_0x2b9522['nameField'][_0xa89c('0x40')]()]=_0x2b9522[_0xa89c('0x41')][_0xa89c('0x21')]();}else if(_0x2b9522[_0xa89c('0x3c')]===_0xa89c('0x3d')&&_0x2b9522['idField']&&_0x2b9522[_0xa89c('0x3f')]){_0x428c61[_0xa89c('0x42')][_0xa89c('0x43')]({'id':_0x2b9522[_0xa89c('0x19')],'value':_0x2b9522[_0xa89c('0x41')]['toString']()});}else if(_0x2b9522['type']===_0xa89c('0x44')&&_0x2b9522[_0xa89c('0x18')]&&_0x2b9522['idField']&&_0x2b9522[_0xa89c('0x3f')]){_0x279142[_0x2b9522[_0xa89c('0x18')]]&&_0x428c61['custom_fields'][_0xa89c('0x43')]({'id':_0x2b9522[_0xa89c('0x19')],'value':_0x279142[_0x2b9522[_0xa89c('0x18')]][_0xa89c('0x21')]()});}else if(_0x2b9522['type']===_0xa89c('0x45')&&_0x2b9522[_0xa89c('0x46')]&&_0x2b9522[_0xa89c('0x46')][_0xa89c('0xc')]&&_0x2b9522['idField']&&_0x2b9522[_0xa89c('0x3f')]){_0x279142[_0x2b9522[_0xa89c('0x46')][_0xa89c('0xc')][_0xa89c('0x40')]()]&&_0x428c61[_0xa89c('0x42')][_0xa89c('0x43')]({'id':_0x2b9522[_0xa89c('0x19')],'value':_0x279142[_0x2b9522[_0xa89c('0x46')][_0xa89c('0xc')][_0xa89c('0x40')]()][_0xa89c('0x21')]()});}});}return _0x428c61;}function getConnection(_0xfd10ec){return request({'method':_0xa89c('0x47'),'form':{'method':_0xa89c('0x48'),'input_type':_0xa89c('0x1b'),'response_type':_0xa89c('0x1b'),'rest_data':JSON[_0xa89c('0x1c')]({'user_auth':{'user_name':_0xfd10ec[_0xa89c('0x49')],'password':_0xfd10ec[_0xa89c('0x4a')],'encryption':_0xa89c('0x4b')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xa89c('0x28')](function(_0x42b3de){var _0x41a485=_0x42b3de;if(_0x41a485['id']){def['sessionID']=_0x41a485['id'];return BPromise[_0xa89c('0x2c')](_0x41a485);}else{throw new Error(util[_0xa89c('0x1e')](_0xa89c('0x4c'),_0xfd10ec['id']));}});}function setRelationship(_0x48355d,_0x55a88c,_0x48df3b,_0x4dbfd9){return request({'form':{'method':_0xa89c('0x4d'),'input_type':_0xa89c('0x1b'),'response_type':'JSON','rest_data':JSON[_0xa89c('0x1c')]({'session':_0x48355d['id'],'module_name':_0xa89c('0x1d'),'module_id':_0x48df3b['id'],'link_field_name':_0x4dbfd9,'related_ids':[_0x55a88c['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x17bba8,_0x199c3a,_0x56855b,_0x4af1af,_0x4f5ee0,_0x1e80b9){var _0x5657fe,_0x41c3ec,_0x1ab000,_0x2a62ad;_0x1e80b9[_0xa89c('0x4e')]=intUtil['stripTrailingSlash'](_0x1e80b9[_0xa89c('0x4e')]);_0x1e80b9[_0xa89c('0x4f')]=intUtil['stripTrailingSlash'](_0x1e80b9[_0xa89c('0x4f')]);def[_0xa89c('0x50')]=util[_0xa89c('0x1e')]('%s/service/v4_1/rest.php',_0x1e80b9[_0xa89c('0x4e')]);if(_0x4f5ee0&&_0x4f5ee0[_0xa89c('0x51')]){logger['info']('[QUEUE]',_0xa89c('0x52'));_0x199c3a[_0xa89c('0x53')]=util[_0xa89c('0x1e')](_0xa89c('0x54'),_0x1e80b9[_0xa89c('0x4f')],_0x199c3a[_0xa89c('0x55')],md5(_0x199c3a[_0xa89c('0x55')]));}else{_0x199c3a[_0xa89c('0x53')]='';}return getConnection(_0x1e80b9)[_0xa89c('0x28')](function(_0x29b72f){_0x2a62ad=_0x29b72f;return getUser(_0x1e80b9,_0x4af1af['name'],_0x2a62ad);})[_0xa89c('0x28')](function(_0x4dd1fc){_0x5657fe=_0x4dd1fc;logger['info'](_0xa89c('0x56'),_0x5657fe['id']);return getEndUser(_0x1e80b9,_0x199c3a[_0xa89c('0x57')],_0x199c3a[_0xa89c('0x58')],_0x2a62ad);})[_0xa89c('0x28')](function(_0x3276b7){_0x41c3ec=_0x3276b7;logger['info'](_0xa89c('0x59'),_0x41c3ec['id']);return getTicket(_0x1e80b9,_0x5657fe,_0x41c3ec,_0x56855b,_0x199c3a,_0x56855b[_0xa89c('0x5a')],_0x2a62ad,_0xa89c('0x5b'));})['then'](function(_0x259888){_0x1ab000=_0x259888;logger[_0xa89c('0xa')](_0xa89c('0x5c'));logger[_0xa89c('0xa')](_0xa89c('0x5d'),_0x1ab000['id']);return setRelationship(_0x2a62ad,_0x5657fe,_0x1ab000,_0xa89c('0x5e'));})[_0xa89c('0x28')](function(){return setRelationship(_0x2a62ad,_0x41c3ec,_0x1ab000,_0xa89c('0x5f'));})['then'](function(){return getServerInfo(_0x2a62ad);})[_0xa89c('0x28')](function(_0x1813fa){var _0x191b23=parseInt(_0x1813fa[_0xa89c('0x60')]['charAt'](0x0));var _0x316cec=util['format'](_0xa89c('0x61'),_0x1e80b9[_0xa89c('0x4e')],_0x1ab000['id']);if(_0x191b23>0x6){_0x316cec=util[_0xa89c('0x1e')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1e80b9['remoteUri'],_0x1ab000['id']);}logger[_0xa89c('0xa')](_0xa89c('0x62'),_0xa89c('0x63'));emit(util['format']('user:%s',_0x4af1af[_0xa89c('0xc')]),_0xa89c('0x64'),{'uri':_0x316cec});})[_0xa89c('0x65')](function(_0x7c0287){logger[_0xa89c('0x66')](_0xa89c('0x62'),JSON[_0xa89c('0x1c')](_0x7c0287));});};exports[_0xa89c('0x67')]=function(_0x159402,_0x98b4bb,_0x4fadf0,_0x4a18a3,_0x27f557,_0x4982f4,_0x4faccf){var _0x45f0eb,_0x1860b2,_0x5bf466,_0x20b22e;_0x4982f4[_0xa89c('0x4e')]=intUtil[_0xa89c('0x68')](_0x4982f4[_0xa89c('0x4e')]);_0x4982f4['serverUrl']=intUtil[_0xa89c('0x68')](_0x4982f4[_0xa89c('0x4f')]);def[_0xa89c('0x50')]=util[_0xa89c('0x1e')](_0xa89c('0x69'),_0x4982f4[_0xa89c('0x4e')]);if(_0x4faccf&&_0x4faccf[_0xa89c('0x6a')]&&_0x4faccf[_0xa89c('0x6a')]!==_0xa89c('0x6b')){logger[_0xa89c('0xa')](_0xa89c('0x6c'),_0xa89c('0x52'));_0x98b4bb['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4982f4[_0xa89c('0x4f')],_0x98b4bb['uniqueid'],md5(_0x98b4bb[_0xa89c('0x55')]));}return getConnection(_0x4982f4)['then'](function(_0x4cd74d){_0x20b22e=_0x4cd74d;return getUser(_0x4982f4,_0x4a18a3[_0xa89c('0xc')],_0x20b22e);})[_0xa89c('0x28')](function(_0x25723d){_0x45f0eb=_0x25723d;logger[_0xa89c('0xa')](_0xa89c('0x56'),_0x45f0eb['id']);return getEndUser(_0x4982f4,_0x98b4bb[_0xa89c('0x6d')],_0x98b4bb['destcalleridnum'],_0x20b22e);})[_0xa89c('0x28')](function(_0x10b4e8){_0x1860b2=_0x10b4e8;logger[_0xa89c('0xa')](_0xa89c('0x59'),_0x1860b2['id']);return getTicket(_0x4982f4,_0x45f0eb,_0x1860b2,_0x4fadf0,_0x98b4bb,_0x4fadf0[_0xa89c('0x5a')],_0x20b22e,_0xa89c('0x6e'));})['then'](function(_0x5c5eb4){_0x5bf466=_0x5c5eb4;logger[_0xa89c('0xa')](_0xa89c('0x5c'));logger[_0xa89c('0xa')](_0xa89c('0x5d'),_0x5bf466['id']);return setRelationship(_0x20b22e,_0x45f0eb,_0x5bf466,_0xa89c('0x5e'));})[_0xa89c('0x28')](function(){return setRelationship(_0x20b22e,_0x1860b2,_0x5bf466,'contacts');})[_0xa89c('0x28')](function(){return getServerInfo(_0x20b22e);})['then'](function(_0x1cfa08){var _0x1e5d0b=parseInt(_0x1cfa08[_0xa89c('0x60')]['charAt'](0x0));var _0x9a99a2=util[_0xa89c('0x1e')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4982f4[_0xa89c('0x4e')],_0x5bf466['id']);if(_0x1e5d0b>0x6){_0x9a99a2=util['format'](_0xa89c('0x6f'),_0x4982f4[_0xa89c('0x4e')],_0x5bf466['id']);}logger['info']('[OUTBOUND]',_0xa89c('0x63'));emit(util[_0xa89c('0x1e')]('user:%s',_0x4a18a3[_0xa89c('0xc')]),_0xa89c('0x64'),{'uri':_0x9a99a2});})[_0xa89c('0x65')](function(_0x4cc1d9){logger['error'](_0xa89c('0x6c'),JSON[_0xa89c('0x1c')](_0x4cc1d9));});};exports[_0xa89c('0x70')]=function(_0x16355e,_0x2013e0,_0x176b7a,_0x1e2299,_0x5dcd27,_0x279f8a){var _0x233019,_0x2e0dc9,_0x9935da,_0x5d7a6b;_0x279f8a['remoteUri']=intUtil[_0xa89c('0x68')](_0x279f8a[_0xa89c('0x4e')]);_0x279f8a[_0xa89c('0x4f')]=intUtil[_0xa89c('0x68')](_0x279f8a[_0xa89c('0x4f')]);def[_0xa89c('0x50')]=util[_0xa89c('0x1e')]('%s/service/v4_1/rest.php',_0x279f8a[_0xa89c('0x4e')]);if(_0x5dcd27&&_0x5dcd27[_0xa89c('0x51')]){logger[_0xa89c('0xa')]('['+_0x2013e0['lastevent'][_0xa89c('0x71')]()+']',_0xa89c('0x52'));_0x2013e0[_0xa89c('0x53')]=util['format'](_0xa89c('0x54'),_0x279f8a['serverUrl'],_0x2013e0['uniqueid'],md5(_0x2013e0['uniqueid']));}else{_0x2013e0['recordingURL']='';}return getConnection(_0x279f8a)[_0xa89c('0x28')](function(_0x28e45a){_0x5d7a6b=_0x28e45a;if(!_['isNil'](_0x1e2299)){return getUser(_0x279f8a,_0x1e2299[_0xa89c('0xc')],_0x5d7a6b);}else{return getUser(_0x279f8a,null,_0x5d7a6b);}})[_0xa89c('0x28')](function(_0x33e6e6){_0x233019=_0x33e6e6;logger[_0xa89c('0xa')](_0xa89c('0x56'),_0x233019['id']);return getEndUser(_0x279f8a,_0x2013e0['calleridname'],_0x2013e0['calleridnum'],_0x5d7a6b);})['then'](function(_0x84b943){_0x2e0dc9=_0x84b943;logger[_0xa89c('0xa')](_0xa89c('0x59'),_0x2e0dc9['id']);return getTicket(_0x279f8a,_0x233019,_0x2e0dc9,_0x176b7a,_0x2013e0,_0x176b7a['Fields'],_0x5d7a6b,'Inbound');})[_0xa89c('0x28')](function(_0x1c8b1d){_0x9935da=_0x1c8b1d;logger[_0xa89c('0xa')](_0xa89c('0x5c'));logger[_0xa89c('0xa')](_0xa89c('0x5d'),_0x9935da['id']);return setRelationship(_0x5d7a6b,_0x233019,_0x9935da,'users');})[_0xa89c('0x28')](function(){return setRelationship(_0x5d7a6b,_0x2e0dc9,_0x9935da,'contacts');})['then'](function(){return getServerInfo(_0x5d7a6b);})['catch'](function(_0x165554){logger[_0xa89c('0x66')]('['+_0x2013e0['lastevent'][_0xa89c('0x71')]()+']',JSON[_0xa89c('0x1c')](_0x165554));});}; \ 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 0ed38e4..1a2cbc0 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 _0x55c6=['key','format','%s:\x20%s','variable','join','slice','substring','lastIndexOf','validateEmail','isNil','test','getString','length','sortBy','push','content','type','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string'];(function(_0x3fb05b,_0x473ea3){var _0x36c70b=function(_0x418604){while(--_0x418604){_0x3fb05b['push'](_0x3fb05b['shift']());}};_0x36c70b(++_0x473ea3);}(_0x55c6,0x1ab));var _0x655c=function(_0x242cbc,_0x516814){_0x242cbc=_0x242cbc-0x0;var _0xba7047=_0x55c6[_0x242cbc];return _0xba7047;};'use strict';var _=require('lodash');var util=require('util');exports[_0x655c('0x0')]=function(_0x49d8f,_0x3ac648,_0x3e4977){var _0x2d7b2e=[];if(_0x49d8f[_0x655c('0x1')]>0x0){var _0x365c74=_[_0x655c('0x2')](_0x49d8f,['id']);for(var _0x1557f3=0x0;_0x1557f3<_0x365c74[_0x655c('0x1')];_0x1557f3++){var _0x4429ee=_0x365c74[_0x1557f3];if(_0x4429ee['type']==='string'){_0x2d7b2e[_0x655c('0x3')](_0x4429ee[_0x655c('0x4')]);}else if(_0x4429ee[_0x655c('0x5')]==='variable'&&_0x4429ee[_0x655c('0x6')]){_0x3ac648[_0x4429ee['variableName']]&&_0x2d7b2e[_0x655c('0x3')](_0x3ac648[_0x4429ee[_0x655c('0x6')]][_0x655c('0x7')]());}else if(_0x4429ee[_0x655c('0x5')]===_0x655c('0x8')&&_0x4429ee[_0x655c('0x9')]&&_0x4429ee['Variable']['name']){_0x3ac648[_0x4429ee[_0x655c('0x9')][_0x655c('0xa')]['toLowerCase']()]&&_0x2d7b2e[_0x655c('0x3')](_0x3ac648[_0x4429ee[_0x655c('0x9')][_0x655c('0xa')][_0x655c('0xb')]()][_0x655c('0x7')]());}else if(_0x4429ee[_0x655c('0x5')]===_0x655c('0xc')){if(_0x4429ee[_0x655c('0xd')]===_0x655c('0xe')&&_0x4429ee[_0x655c('0xf')]){_0x2d7b2e[_0x655c('0x3')](util[_0x655c('0x10')](_0x655c('0x11'),_0x4429ee['key'],_0x4429ee['keyContent']));}else if(_0x4429ee[_0x655c('0xd')]===_0x655c('0x12')&&_0x4429ee[_0x655c('0x6')]&&_0x4429ee['key']){_0x3ac648[_0x4429ee[_0x655c('0x6')]]&&_0x2d7b2e[_0x655c('0x3')](util[_0x655c('0x10')]('%s:\x20%s',_0x4429ee[_0x655c('0xf')],_0x3ac648[_0x4429ee[_0x655c('0x6')]]));}else if(_0x4429ee[_0x655c('0xd')]===_0x655c('0x8')&&_0x4429ee[_0x655c('0x9')]&&_0x4429ee[_0x655c('0x9')][_0x655c('0xa')]&&_0x4429ee[_0x655c('0xf')]){_0x3ac648[_0x4429ee[_0x655c('0x9')][_0x655c('0xa')]['toLowerCase']()]&&_0x2d7b2e[_0x655c('0x3')](util[_0x655c('0x10')](_0x655c('0x11'),_0x4429ee[_0x655c('0xf')],_0x3ac648[_0x4429ee[_0x655c('0x9')][_0x655c('0xa')][_0x655c('0xb')]()]));}}}}return _0x2d7b2e[_0x655c('0x13')](_0x3e4977);};exports['stripTrailingSlash']=function(_0x373e96){var _0x335e85=_0x373e96[_0x655c('0x14')](-0x1);if(_0x335e85==='/'){_0x373e96=_0x373e96[_0x655c('0x15')](0x0,_0x373e96[_0x655c('0x16')](_0x335e85));}return _0x373e96;};exports[_0x655c('0x17')]=function(_0x17f778){if(!_[_0x655c('0x18')](_0x17f778)&&_0x17f778!==''){var _0x32d3f8=/^(([^<>()\[\]\\.,;:\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 _0x32d3f8[_0x655c('0x19')](String(_0x17f778)[_0x655c('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xc2b7=['test','getString','sortBy','length','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','validateEmail','isNil'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0xc2b7,0x1e5));var _0x7c2b=function(_0x36cd93,_0x593481){_0x36cd93=_0x36cd93-0x0;var _0x10f6cd=_0xc2b7[_0x36cd93];return _0x10f6cd;};'use strict';var _=require('lodash');var util=require('util');exports[_0x7c2b('0x0')]=function(_0x3b73ac,_0x4b6f90,_0x1543b1){var _0x131702=[];if(_0x3b73ac['length']>0x0){var _0x2e73fa=_[_0x7c2b('0x1')](_0x3b73ac,['id']);for(var _0x31a7fc=0x0;_0x31a7fc<_0x2e73fa[_0x7c2b('0x2')];_0x31a7fc++){var _0x3c0f39=_0x2e73fa[_0x31a7fc];if(_0x3c0f39[_0x7c2b('0x3')]===_0x7c2b('0x4')){_0x131702[_0x7c2b('0x5')](_0x3c0f39[_0x7c2b('0x6')]);}else if(_0x3c0f39['type']===_0x7c2b('0x7')&&_0x3c0f39['variableName']){_0x4b6f90[_0x3c0f39['variableName']]&&_0x131702[_0x7c2b('0x5')](_0x4b6f90[_0x3c0f39[_0x7c2b('0x8')]][_0x7c2b('0x9')]());}else if(_0x3c0f39['type']===_0x7c2b('0xa')&&_0x3c0f39[_0x7c2b('0xb')]&&_0x3c0f39['Variable'][_0x7c2b('0xc')]){_0x4b6f90[_0x3c0f39['Variable'][_0x7c2b('0xc')][_0x7c2b('0xd')]()]&&_0x131702[_0x7c2b('0x5')](_0x4b6f90[_0x3c0f39[_0x7c2b('0xb')][_0x7c2b('0xc')][_0x7c2b('0xd')]()]['toString']());}else if(_0x3c0f39['type']==='keyValue'){if(_0x3c0f39[_0x7c2b('0xe')]===_0x7c2b('0x4')&&_0x3c0f39[_0x7c2b('0xf')]){_0x131702[_0x7c2b('0x5')](util[_0x7c2b('0x10')](_0x7c2b('0x11'),_0x3c0f39[_0x7c2b('0xf')],_0x3c0f39[_0x7c2b('0x12')]));}else if(_0x3c0f39[_0x7c2b('0xe')]==='variable'&&_0x3c0f39['variableName']&&_0x3c0f39['key']){_0x4b6f90[_0x3c0f39['variableName']]&&_0x131702[_0x7c2b('0x5')](util[_0x7c2b('0x10')](_0x7c2b('0x11'),_0x3c0f39[_0x7c2b('0xf')],_0x4b6f90[_0x3c0f39[_0x7c2b('0x8')]]));}else if(_0x3c0f39[_0x7c2b('0xe')]==='customVariable'&&_0x3c0f39[_0x7c2b('0xb')]&&_0x3c0f39['Variable'][_0x7c2b('0xc')]&&_0x3c0f39[_0x7c2b('0xf')]){_0x4b6f90[_0x3c0f39[_0x7c2b('0xb')][_0x7c2b('0xc')][_0x7c2b('0xd')]()]&&_0x131702[_0x7c2b('0x5')](util[_0x7c2b('0x10')]('%s:\x20%s',_0x3c0f39[_0x7c2b('0xf')],_0x4b6f90[_0x3c0f39['Variable']['name'][_0x7c2b('0xd')]()]));}}}}return _0x131702['join'](_0x1543b1);};exports['stripTrailingSlash']=function(_0x48e971){var _0x5c8f01=_0x48e971['slice'](-0x1);if(_0x5c8f01==='/'){_0x48e971=_0x48e971['substring'](0x0,_0x48e971['lastIndexOf'](_0x5c8f01));}return _0x48e971;};exports[_0x7c2b('0x13')]=function(_0x2aae9e){if(!_[_0x7c2b('0x14')](_0x2aae9e)&&_0x2aae9e!==''){var _0x1dd8e1=/^(([^<>()\[\]\\.,;:\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 _0x1dd8e1[_0x7c2b('0x15')](String(_0x2aae9e)[_0x7c2b('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 d531a0c..2d28f09 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x20126d,_0x1623b5){var _0x4e80c8=function(_0x1c370b){while(--_0x1c370b){_0x20126d['push'](_0x20126d['shift']());}};_0x4e80c8(++_0x1623b5);}(_0xe706,0xa3));var _0x6e70=function(_0x7902d0,_0x378152){_0x7902d0=_0x7902d0-0x0;var _0x2ab4ac=_0xe706[_0x7902d0];return _0x2ab4ac;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _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(_0x169876,_0x4243fb){var _0x33c00d=function(_0x1fdf43){while(--_0x1fdf43){_0x169876['push'](_0x169876['shift']());}};_0x33c00d(++_0x4243fb);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 0261e62..1ac7215 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 _0xa9fe=['[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','email','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','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','Displaying\x20ticket\x20to\x20agent...','lastevent','toUpperCase','Recording\x20is\x20enabled!','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','user','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','includes','string','type','nameField','customField','toLowerCase','content','picklist','custom_fields','push','idField','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x303b4a,_0x5f2249){var _0x478794=function(_0x3ea853){while(--_0x3ea853){_0x303b4a['push'](_0x303b4a['shift']());}};_0x478794(++_0x5f2249);}(_0xa9fe,0xf2));var _0xea9f=function(_0x559200,_0x43f57b){_0x559200=_0x559200-0x0;var _0x3cb366=_0xa9fe[_0x559200];return _0x3cb366;};'use strict';var _=require('lodash');var rp=require(_0xea9f('0x0'));var md5=require('md5');var util=require(_0xea9f('0x1'));var Redis=require('ioredis');var intUtil=require(_0xea9f('0x2'));var config=require(_0xea9f('0x3'));var logger=require(_0xea9f('0x4'))('zendesk');config[_0xea9f('0x5')]=_[_0xea9f('0x6')](config['redis'],{'host':_0xea9f('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea9f('0x5')]));function emit(_0x255b9a,_0xf041ab,_0x4e59b1){io['to'](_0x255b9a)[_0xea9f('0x8')](_0xf041ab,_0x4e59b1);}var headers={'Content-Type':'application/json','Accept':_0xea9f('0x9')};function getTicket(_0x5fde4d,_0x595cdd,_0x28abc3,_0x1f3206,_0x590da8){logger[_0xea9f('0xa')](_0xea9f('0xb'));return request({'uri':util[_0xea9f('0xc')](_0xea9f('0xd'),_0x5fde4d['remoteUri']),'method':_0xea9f('0xe'),'body':{'ticket':_[_0xea9f('0xf')]({'requester_id':_0x28abc3['id'],'submitter_id':_0x595cdd?_0x595cdd['id']:undefined,'assignee_id':_0x595cdd?_0x595cdd['id']:undefined,'tags':getTags(_0x1f3206[_0xea9f('0x10')],_0xea9f('0x11')),'subject':intUtil[_0xea9f('0x12')](_0x1f3206[_0xea9f('0x13')],_0x590da8,'\x20'),'description':intUtil[_0xea9f('0x12')](_0x1f3206[_0xea9f('0x14')],_0x590da8,'\x0a'),'comment':{'public':![],'body':intUtil[_0xea9f('0x12')](_0x1f3206[_0xea9f('0x14')],_0x590da8,'\x0a')}},getCustomFields(_0x1f3206[_0xea9f('0x15')],_0x590da8))}})[_0xea9f('0x16')](function(_0x1efd01){logger[_0xea9f('0xa')]('Ticket\x20created!');return _0x1efd01['ticket'];});}function getUser(_0x8fedd3,_0xe63d3c){if(intUtil[_0xea9f('0x17')](_0xe63d3c)){logger[_0xea9f('0xa')](_0xea9f('0x18'),_0xe63d3c);return request({'uri':util[_0xea9f('0xc')](_0xea9f('0x19'),_0x8fedd3[_0xea9f('0x1a')]),'qs':{'query':util['format'](_0xea9f('0x1b'),_0xe63d3c)}})[_0xea9f('0x16')](function(_0x529169){if(_0x529169[_0xea9f('0x1c')]){logger['info'](_0xea9f('0x1d'));return _[_0xea9f('0x1e')](_0x529169[_0xea9f('0x1f')],{'email':_0xe63d3c,'role':'agent'});}else{logger[_0xea9f('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xea9f('0xc')](_0xea9f('0x20'),_0x8fedd3['remoteUri'])})[_0xea9f('0x16')](function(_0x1bc731){logger[_0xea9f('0xa')](_0xea9f('0x21'));return _0x1bc731['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xea9f('0x20'),_0x8fedd3[_0xea9f('0x1a')])})['then'](function(_0x27b2a2){logger['info'](_0xea9f('0x21'));return _0x27b2a2['user'];});}}function getEndUser(_0x2bf11f,_0x172aca,_0x44ebba){logger[_0xea9f('0xa')](_0xea9f('0x22'),_0x44ebba);return request({'uri':util['format'](_0xea9f('0x19'),_0x2bf11f[_0xea9f('0x1a')]),'qs':{'query':util[_0xea9f('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x44ebba)}})[_0xea9f('0x16')](function(_0x135b71){var _0x467312;if(_0x135b71[_0xea9f('0x1f')][_0xea9f('0x23')]){_0x135b71['results']=_['filter'](_0x135b71[_0xea9f('0x1f')],{'suspended':![],'role':_0xea9f('0x24')});if(_0x135b71[_0xea9f('0x1f')][_0xea9f('0x23')]){_0x467312=_[_0xea9f('0x25')](_0x135b71['results']);}}if(_0x467312){logger[_0xea9f('0xa')](_0xea9f('0x26'));return _0x467312;}else{logger[_0xea9f('0xa')](_0xea9f('0x27'));return request({'uri':util[_0xea9f('0xc')](_0xea9f('0x28'),_0x2bf11f[_0xea9f('0x1a')]),'method':'POST','body':{'user':{'role':_0xea9f('0x24'),'name':util['format']('Caller\x20-\x20%s',_0x172aca||_0x44ebba),'phone':_0x44ebba}}})[_0xea9f('0x16')](function(_0x4bebdd){logger['info'](_0xea9f('0x29'));return _0x4bebdd[_0xea9f('0x2a')];});}});}function getAuth(_0x1b8fd9){var _0x440ebd;if(_0x1b8fd9['authType']===_0xea9f('0x2b')){_0x440ebd=util[_0xea9f('0xc')](_0xea9f('0x2c'),_0x1b8fd9[_0xea9f('0x2d')],_0x1b8fd9[_0xea9f('0x2b')]);}else if(_0x1b8fd9['authType']===_0xea9f('0x2e')){_0x440ebd=util[_0xea9f('0xc')](_0xea9f('0x2f'),_0x1b8fd9[_0xea9f('0x2d')],_0x1b8fd9[_0xea9f('0x2e')]);}return util[_0xea9f('0xc')]('Basic\x20%s',new Buffer(_0x440ebd)[_0xea9f('0x30')](_0xea9f('0x31')));}function request(_0xa39466){logger[_0xea9f('0x32')](_0xea9f('0x33'),JSON[_0xea9f('0x34')](_0xa39466));return rp(_[_0xea9f('0x6')](_0xa39466,{'method':_0xea9f('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x2e4151,_0x599331){var _0x2b38b0=[];if(_0x2e4151&&_0x2e4151[_0xea9f('0x23')]>0x0){_0x2b38b0=_[_0xea9f('0x36')](_0x2e4151,_0x599331);}return _0x2b38b0;}function getCustomFields(_0x2938c6,_0x4ce448){var _0x19426b=[];var _0x39f34c={'custom_fields':[]};if(_0x2938c6[_0xea9f('0x23')]>0x0){_['forEach'](_0x2938c6,function(_0x32592c){if(_[_0xea9f('0x37')]([_0xea9f('0x38'),'picklist'],_0x32592c[_0xea9f('0x39')])&&_0x32592c[_0xea9f('0x3a')]&&!_0x32592c[_0xea9f('0x3b')]){_0x39f34c[_0x32592c[_0xea9f('0x3a')][_0xea9f('0x3c')]()]=_0x32592c[_0xea9f('0x3d')][_0xea9f('0x30')]();}else if(_[_0xea9f('0x37')](['string',_0xea9f('0x3e')],_0x32592c[_0xea9f('0x39')])&&_0x32592c['idField']&&_0x32592c[_0xea9f('0x3b')]){_0x39f34c[_0xea9f('0x3f')][_0xea9f('0x40')]({'id':_0x32592c[_0xea9f('0x41')],'value':_0x32592c[_0xea9f('0x3d')][_0xea9f('0x30')]()});}else if(_0x32592c[_0xea9f('0x39')]===_0xea9f('0x42')&&_0x32592c[_0xea9f('0x43')]&&_0x32592c[_0xea9f('0x41')]&&_0x32592c[_0xea9f('0x3b')]){_0x4ce448[_0x32592c['variableName']]&&_0x39f34c[_0xea9f('0x3f')]['push']({'id':_0x32592c['idField'],'value':_0x4ce448[_0x32592c['variableName']][_0xea9f('0x30')]()});}else if(_0x32592c[_0xea9f('0x39')]===_0xea9f('0x44')&&_0x32592c[_0xea9f('0x45')]&&_0x32592c[_0xea9f('0x45')][_0xea9f('0x11')]&&_0x32592c[_0xea9f('0x41')]&&_0x32592c[_0xea9f('0x3b')]){_0x4ce448[_0x32592c[_0xea9f('0x45')][_0xea9f('0x11')][_0xea9f('0x3c')]()]&&_0x39f34c[_0xea9f('0x3f')]['push']({'id':_0x32592c[_0xea9f('0x41')],'value':_0x4ce448[_0x32592c[_0xea9f('0x45')][_0xea9f('0x11')][_0xea9f('0x3c')]()]['toString']()});}});}return _0x39f34c;}exports['queue']=function(_0x5099bc,_0x84981a,_0x252167,_0x5a876e,_0x4dce25,_0x44248e){var _0x19d284,_0x3380a9;_0x44248e['remoteUri']=intUtil[_0xea9f('0x46')](_0x44248e[_0xea9f('0x1a')]);_0x44248e[_0xea9f('0x47')]=intUtil[_0xea9f('0x46')](_0x44248e[_0xea9f('0x47')]);if(_0x4dce25&&_0x4dce25[_0xea9f('0x48')]){logger['info'](_0xea9f('0x49'),'Recording\x20is\x20enabled!');_0x84981a['recordingURL']=util[_0xea9f('0xc')](_0xea9f('0x4a'),_0x44248e[_0xea9f('0x47')],_0x84981a['uniqueid'],md5(_0x84981a['uniqueid']));}else{_0x84981a[_0xea9f('0x4b')]='';}headers[_0xea9f('0x4c')]=getAuth(_0x44248e);return getUser(_0x44248e,_0x5a876e[_0xea9f('0x4d')])['then'](function(_0x4e7ec5){_0x19d284=_0x4e7ec5;logger[_0xea9f('0xa')](_0xea9f('0x4e'),_0x19d284['id']);return getEndUser(_0x44248e,_0x84981a[_0xea9f('0x4f')],_0x84981a[_0xea9f('0x50')]);})[_0xea9f('0x16')](function(_0x41ffed){_0x3380a9=_0x41ffed;logger['info'](_0xea9f('0x51'),_0x3380a9['id']);return getTicket(_0x44248e,_0x19d284,_0x3380a9,_0x252167,_0x84981a);})[_0xea9f('0x16')](function(_0x488ead){if(_0x488ead){logger[_0xea9f('0xa')](_0xea9f('0x52'),_0x488ead['id']);switch(_0x44248e[_0xea9f('0x39')]){case _0xea9f('0x53'):logger[_0xea9f('0xa')](_0xea9f('0x49'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xea9f('0x54'),_0x44248e['remoteUri'],_0x19d284['id'],_0x488ead['id']),'method':'POST'});case _0xea9f('0x55'):logger['info'](_0xea9f('0x49'),_0xea9f('0x56'));emit(util[_0xea9f('0xc')](_0xea9f('0x57'),_0x5a876e[_0xea9f('0x11')]),_0xea9f('0x58'),{'uri':util['format']('%s/agent/tickets/%s',_0x44248e[_0xea9f('0x1a')][_0xea9f('0x59')]('/api/v2',''),_0x488ead['id'])});break;default:logger[_0xea9f('0x5a')](_0xea9f('0x49'),_0xea9f('0x5b'));}}})[_0xea9f('0x5c')](function(_0xde60b5){logger[_0xea9f('0x5a')](_0xea9f('0x5d'),util[_0xea9f('0x5e')](_0xde60b5,{'showHidden':!![],'depth':null}));});};exports[_0xea9f('0x5f')]=function(_0xfd7a3a,_0x5db686,_0x1e3f8b,_0x10eba6,_0x2cb0a7,_0x5a61b0,_0x3da327){var _0x447afc,_0x2e91ce;_0x5a61b0[_0xea9f('0x1a')]=intUtil[_0xea9f('0x46')](_0x5a61b0[_0xea9f('0x1a')]);_0x5a61b0['serverUrl']=intUtil['stripTrailingSlash'](_0x5a61b0['serverUrl']);if(_0x3da327&&_0x3da327[_0xea9f('0x60')]&&_0x3da327['recordingFormat']!=='none'){logger[_0xea9f('0xa')](_0xea9f('0x61'),'Recording\x20is\x20enabled!');_0x5db686['recordingURL']=util[_0xea9f('0xc')](_0xea9f('0x4a'),_0x5a61b0[_0xea9f('0x47')],_0x5db686['uniqueid'],md5(_0x5db686[_0xea9f('0x62')]));}headers['Authorization']=getAuth(_0x5a61b0);return getUser(_0x5a61b0,_0x10eba6[_0xea9f('0x4d')])[_0xea9f('0x16')](function(_0x286701){_0x447afc=_0x286701;logger[_0xea9f('0xa')](_0xea9f('0x4e'),_0x447afc['id']);return getEndUser(_0x5a61b0,_0x5db686[_0xea9f('0x63')],_0x5db686['destcalleridnum']);})[_0xea9f('0x16')](function(_0x2058b9){_0x2e91ce=_0x2058b9;logger[_0xea9f('0xa')](_0xea9f('0x51'),_0x2e91ce['id']);return getTicket(_0x5a61b0,_0x447afc,_0x2e91ce,_0x1e3f8b,_0x5db686);})[_0xea9f('0x16')](function(_0x3ae496){if(_0x3ae496){logger[_0xea9f('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3ae496['id']);switch(_0x5a61b0[_0xea9f('0x39')]){case _0xea9f('0x53'):logger['info'](_0xea9f('0x61'),_0xea9f('0x64'));return request({'uri':util[_0xea9f('0xc')](_0xea9f('0x54'),_0x5a61b0['remoteUri'],_0x447afc['id'],_0x3ae496['id']),'method':_0xea9f('0xe')});case _0xea9f('0x55'):logger[_0xea9f('0xa')]('[OUTBOUND]',_0xea9f('0x56'));emit(util[_0xea9f('0xc')]('user:%s',_0x10eba6[_0xea9f('0x11')]),_0xea9f('0x58'),{'uri':util['format']('%s/agent/tickets/%s',_0x5a61b0['remoteUri'][_0xea9f('0x59')]('/api/v2',''),_0x3ae496['id'])});break;default:logger[_0xea9f('0x5a')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xea9f('0x5c')](function(_0x3b5840){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x3b5840,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x28fc5b,_0x8b6eec,_0x224bb3,_0x4a14fd,_0x11943d,_0x17c7d2){var _0x225319,_0x2780ab;_0x17c7d2[_0xea9f('0x1a')]=intUtil[_0xea9f('0x46')](_0x17c7d2[_0xea9f('0x1a')]);_0x17c7d2[_0xea9f('0x47')]=intUtil[_0xea9f('0x46')](_0x17c7d2[_0xea9f('0x47')]);if(_0x11943d&&_0x11943d['monitor_format']){logger[_0xea9f('0xa')]('['+_0x8b6eec[_0xea9f('0x65')][_0xea9f('0x66')]()+']',_0xea9f('0x67'));_0x8b6eec['recordingURL']=util[_0xea9f('0xc')](_0xea9f('0x4a'),_0x17c7d2[_0xea9f('0x47')],_0x8b6eec['uniqueid'],md5(_0x8b6eec[_0xea9f('0x62')]));}else{_0x8b6eec[_0xea9f('0x4b')]='';}headers[_0xea9f('0x4c')]=getAuth(_0x17c7d2);return getUser(_0x17c7d2)[_0xea9f('0x16')](function(_0x298b89){_0x225319=_0x298b89;logger[_0xea9f('0xa')](_0xea9f('0x4e'),_0x225319['id']);return getEndUser(_0x17c7d2,_0x8b6eec[_0xea9f('0x4f')],_0x8b6eec[_0xea9f('0x50')]);})[_0xea9f('0x16')](function(_0x376581){_0x2780ab=_0x376581;logger[_0xea9f('0xa')](_0xea9f('0x51'),_0x2780ab['id']);return getTicket(_0x17c7d2,_0x225319,_0x2780ab,_0x224bb3,_0x8b6eec);})[_0xea9f('0x16')](function(_0x16ff98){if(_0x16ff98){logger[_0xea9f('0xa')](_0xea9f('0x52'),_0x16ff98['id']);}})[_0xea9f('0x5c')](function(_0x2e4037){logger[_0xea9f('0x5a')]('['+_0x8b6eec['lastevent']['toUpperCase']()+']'+_0xea9f('0x68'),util[_0xea9f('0x5e')](_0x2e4037,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4dd8=['type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','token','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','forEach','includes','picklist','type','nameField','toLowerCase','string','idField','customField','custom_fields','push','content','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone'];(function(_0x234318,_0xf22f31){var _0x1ab719=function(_0x10a0b1){while(--_0x10a0b1){_0x234318['push'](_0x234318['shift']());}};_0x1ab719(++_0xf22f31);}(_0x4dd8,0xb7));var _0x84dd=function(_0x240240,_0x3ce03e){_0x240240=_0x240240-0x0;var _0x16b73f=_0x4dd8[_0x240240];return _0x16b73f;};'use strict';var _=require(_0x84dd('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x84dd('0x1'));var Redis=require(_0x84dd('0x2'));var intUtil=require(_0x84dd('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x84dd('0x4'));config[_0x84dd('0x5')]=_['defaults'](config[_0x84dd('0x5')],{'host':_0x84dd('0x6'),'port':0x18eb});var io=require(_0x84dd('0x7'))(new Redis(config[_0x84dd('0x5')]));function emit(_0x17f189,_0x56a3db,_0x64703){io['to'](_0x17f189)[_0x84dd('0x8')](_0x56a3db,_0x64703);}var headers={'Content-Type':_0x84dd('0x9'),'Accept':_0x84dd('0x9')};function getTicket(_0x41da1b,_0x1b3536,_0x544e12,_0x20b717,_0x15439d){logger[_0x84dd('0xa')](_0x84dd('0xb'));return request({'uri':util[_0x84dd('0xc')](_0x84dd('0xd'),_0x41da1b[_0x84dd('0xe')]),'method':_0x84dd('0xf'),'body':{'ticket':_[_0x84dd('0x10')]({'requester_id':_0x544e12['id'],'submitter_id':_0x1b3536?_0x1b3536['id']:undefined,'assignee_id':_0x1b3536?_0x1b3536['id']:undefined,'tags':getTags(_0x20b717[_0x84dd('0x11')],_0x84dd('0x12')),'subject':intUtil['getString'](_0x20b717[_0x84dd('0x13')],_0x15439d,'\x20'),'description':intUtil['getString'](_0x20b717[_0x84dd('0x14')],_0x15439d,'\x0a'),'comment':{'public':![],'body':intUtil[_0x84dd('0x15')](_0x20b717[_0x84dd('0x14')],_0x15439d,'\x0a')}},getCustomFields(_0x20b717[_0x84dd('0x16')],_0x15439d))}})[_0x84dd('0x17')](function(_0x161808){logger[_0x84dd('0xa')](_0x84dd('0x18'));return _0x161808[_0x84dd('0x19')];});}function getUser(_0x547ae2,_0x1d8819){if(intUtil[_0x84dd('0x1a')](_0x1d8819)){logger[_0x84dd('0xa')](_0x84dd('0x1b'),_0x1d8819);return request({'uri':util['format'](_0x84dd('0x1c'),_0x547ae2[_0x84dd('0xe')]),'qs':{'query':util[_0x84dd('0xc')]('type:user\x20role:agent\x20email:%s',_0x1d8819)}})[_0x84dd('0x17')](function(_0x541cab){if(_0x541cab[_0x84dd('0x1d')]){logger['info']('Agent\x20found!');return _['find'](_0x541cab[_0x84dd('0x1e')],{'email':_0x1d8819,'role':_0x84dd('0x1f')});}else{logger[_0x84dd('0xa')](_0x84dd('0x20'));return request({'uri':util['format'](_0x84dd('0x21'),_0x547ae2[_0x84dd('0xe')])})['then'](function(_0x188516){logger[_0x84dd('0xa')](_0x84dd('0x22'));return _0x188516['user'];});}});}else{logger[_0x84dd('0xa')](_0x84dd('0x20'));return request({'uri':util[_0x84dd('0xc')](_0x84dd('0x21'),_0x547ae2[_0x84dd('0xe')])})[_0x84dd('0x17')](function(_0x2d50c6){logger[_0x84dd('0xa')](_0x84dd('0x22'));return _0x2d50c6[_0x84dd('0x23')];});}}function getEndUser(_0x34c6e1,_0x3a1095,_0x1feb37){logger[_0x84dd('0xa')](_0x84dd('0x24'),_0x1feb37);return request({'uri':util[_0x84dd('0xc')]('%s/search.json',_0x34c6e1[_0x84dd('0xe')]),'qs':{'query':util[_0x84dd('0xc')](_0x84dd('0x25'),_0x1feb37)}})[_0x84dd('0x17')](function(_0x48902b){var _0x14880f;if(_0x48902b[_0x84dd('0x1e')][_0x84dd('0x26')]){_0x48902b[_0x84dd('0x1e')]=_[_0x84dd('0x27')](_0x48902b['results'],{'suspended':![],'role':_0x84dd('0x28')});if(_0x48902b[_0x84dd('0x1e')][_0x84dd('0x26')]){_0x14880f=_[_0x84dd('0x29')](_0x48902b[_0x84dd('0x1e')]);}}if(_0x14880f){logger[_0x84dd('0xa')](_0x84dd('0x2a'));return _0x14880f;}else{logger[_0x84dd('0xa')](_0x84dd('0x2b'));return request({'uri':util[_0x84dd('0xc')](_0x84dd('0x2c'),_0x34c6e1['remoteUri']),'method':'POST','body':{'user':{'role':_0x84dd('0x28'),'name':util[_0x84dd('0xc')](_0x84dd('0x2d'),_0x3a1095||_0x1feb37),'phone':_0x1feb37}}})[_0x84dd('0x17')](function(_0x5687a0){logger[_0x84dd('0xa')]('Enduser\x20created.');return _0x5687a0['user'];});}});}function getAuth(_0x244282){var _0x211c9f;if(_0x244282[_0x84dd('0x2e')]===_0x84dd('0x2f')){_0x211c9f=util[_0x84dd('0xc')]('%s:%s',_0x244282['username'],_0x244282[_0x84dd('0x2f')]);}else if(_0x244282[_0x84dd('0x2e')]===_0x84dd('0x30')){_0x211c9f=util['format']('%s/token:%s',_0x244282[_0x84dd('0x31')],_0x244282[_0x84dd('0x30')]);}return util[_0x84dd('0xc')](_0x84dd('0x32'),new Buffer(_0x211c9f)[_0x84dd('0x33')](_0x84dd('0x34')));}function request(_0x25a35c){logger[_0x84dd('0x35')](_0x84dd('0x36'),JSON[_0x84dd('0x37')](_0x25a35c));return rp(_['defaults'](_0x25a35c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3c2e68,_0x544666){var _0x239405=[];if(_0x3c2e68&&_0x3c2e68[_0x84dd('0x26')]>0x0){_0x239405=_['map'](_0x3c2e68,_0x544666);}return _0x239405;}function getCustomFields(_0x54ae6e,_0x1379b8){var _0x25b6a1=[];var _0x49c152={'custom_fields':[]};if(_0x54ae6e[_0x84dd('0x26')]>0x0){_[_0x84dd('0x38')](_0x54ae6e,function(_0x2799e5){if(_[_0x84dd('0x39')](['string',_0x84dd('0x3a')],_0x2799e5[_0x84dd('0x3b')])&&_0x2799e5[_0x84dd('0x3c')]&&!_0x2799e5['customField']){_0x49c152[_0x2799e5[_0x84dd('0x3c')][_0x84dd('0x3d')]()]=_0x2799e5['content'][_0x84dd('0x33')]();}else if(_['includes']([_0x84dd('0x3e'),_0x84dd('0x3a')],_0x2799e5[_0x84dd('0x3b')])&&_0x2799e5[_0x84dd('0x3f')]&&_0x2799e5[_0x84dd('0x40')]){_0x49c152[_0x84dd('0x41')][_0x84dd('0x42')]({'id':_0x2799e5[_0x84dd('0x3f')],'value':_0x2799e5[_0x84dd('0x43')][_0x84dd('0x33')]()});}else if(_0x2799e5['type']===_0x84dd('0x44')&&_0x2799e5['variableName']&&_0x2799e5['idField']&&_0x2799e5['customField']){_0x1379b8[_0x2799e5[_0x84dd('0x45')]]&&_0x49c152[_0x84dd('0x41')]['push']({'id':_0x2799e5[_0x84dd('0x3f')],'value':_0x1379b8[_0x2799e5[_0x84dd('0x45')]][_0x84dd('0x33')]()});}else if(_0x2799e5['type']==='customVariable'&&_0x2799e5[_0x84dd('0x46')]&&_0x2799e5[_0x84dd('0x46')][_0x84dd('0x12')]&&_0x2799e5[_0x84dd('0x3f')]&&_0x2799e5[_0x84dd('0x40')]){_0x1379b8[_0x2799e5[_0x84dd('0x46')][_0x84dd('0x12')][_0x84dd('0x3d')]()]&&_0x49c152['custom_fields']['push']({'id':_0x2799e5[_0x84dd('0x3f')],'value':_0x1379b8[_0x2799e5['Variable'][_0x84dd('0x12')]['toLowerCase']()][_0x84dd('0x33')]()});}});}return _0x49c152;}exports[_0x84dd('0x47')]=function(_0x33f558,_0x2fa39b,_0x2df13f,_0x5b1f13,_0x541fec,_0x52312b){var _0x517298,_0x58b008;_0x52312b[_0x84dd('0xe')]=intUtil[_0x84dd('0x48')](_0x52312b['remoteUri']);_0x52312b[_0x84dd('0x49')]=intUtil[_0x84dd('0x48')](_0x52312b['serverUrl']);if(_0x541fec&&_0x541fec['monitor_format']){logger[_0x84dd('0xa')](_0x84dd('0x4a'),_0x84dd('0x4b'));_0x2fa39b[_0x84dd('0x4c')]=util[_0x84dd('0xc')](_0x84dd('0x4d'),_0x52312b[_0x84dd('0x49')],_0x2fa39b[_0x84dd('0x4e')],md5(_0x2fa39b['uniqueid']));}else{_0x2fa39b[_0x84dd('0x4c')]='';}headers[_0x84dd('0x4f')]=getAuth(_0x52312b);return getUser(_0x52312b,_0x5b1f13[_0x84dd('0x50')])[_0x84dd('0x17')](function(_0x25bed7){_0x517298=_0x25bed7;logger['info'](_0x84dd('0x51'),_0x517298['id']);return getEndUser(_0x52312b,_0x2fa39b['calleridname'],_0x2fa39b[_0x84dd('0x52')]);})[_0x84dd('0x17')](function(_0x17492f){_0x58b008=_0x17492f;logger['info'](_0x84dd('0x53'),_0x58b008['id']);return getTicket(_0x52312b,_0x517298,_0x58b008,_0x2df13f,_0x2fa39b);})[_0x84dd('0x17')](function(_0x3f4917){if(_0x3f4917){logger[_0x84dd('0xa')](_0x84dd('0x54'),_0x3f4917['id']);switch(_0x52312b[_0x84dd('0x3b')]){case _0x84dd('0x55'):logger[_0x84dd('0xa')]('[QUEUE]',_0x84dd('0x56'));return request({'uri':util[_0x84dd('0xc')](_0x84dd('0x57'),_0x52312b['remoteUri'],_0x517298['id'],_0x3f4917['id']),'method':_0x84dd('0xf')});case _0x84dd('0x58'):logger[_0x84dd('0xa')]('[QUEUE]',_0x84dd('0x59'));emit(util['format']('user:%s',_0x5b1f13[_0x84dd('0x12')]),_0x84dd('0x5a'),{'uri':util[_0x84dd('0xc')](_0x84dd('0x5b'),_0x52312b[_0x84dd('0xe')][_0x84dd('0x5c')](_0x84dd('0x5d'),''),_0x3f4917['id'])});break;default:logger[_0x84dd('0x5e')](_0x84dd('0x4a'),_0x84dd('0x5f'));}}})[_0x84dd('0x60')](function(_0x45ccdd){logger[_0x84dd('0x5e')](_0x84dd('0x61'),util[_0x84dd('0x62')](_0x45ccdd,{'showHidden':!![],'depth':null}));});};exports[_0x84dd('0x63')]=function(_0x5ab987,_0x2cbcb5,_0x225caf,_0x675525,_0x10a1c2,_0x3fdbb2,_0x24e47c){var _0x34cc62,_0x429a36;_0x3fdbb2[_0x84dd('0xe')]=intUtil[_0x84dd('0x48')](_0x3fdbb2[_0x84dd('0xe')]);_0x3fdbb2[_0x84dd('0x49')]=intUtil['stripTrailingSlash'](_0x3fdbb2[_0x84dd('0x49')]);if(_0x24e47c&&_0x24e47c[_0x84dd('0x64')]&&_0x24e47c[_0x84dd('0x64')]!==_0x84dd('0x65')){logger[_0x84dd('0xa')](_0x84dd('0x66'),_0x84dd('0x4b'));_0x2cbcb5[_0x84dd('0x4c')]=util[_0x84dd('0xc')](_0x84dd('0x4d'),_0x3fdbb2[_0x84dd('0x49')],_0x2cbcb5[_0x84dd('0x4e')],md5(_0x2cbcb5[_0x84dd('0x4e')]));}headers[_0x84dd('0x4f')]=getAuth(_0x3fdbb2);return getUser(_0x3fdbb2,_0x675525['email'])[_0x84dd('0x17')](function(_0x5c9b83){_0x34cc62=_0x5c9b83;logger['info'](_0x84dd('0x51'),_0x34cc62['id']);return getEndUser(_0x3fdbb2,_0x2cbcb5[_0x84dd('0x67')],_0x2cbcb5[_0x84dd('0x68')]);})[_0x84dd('0x17')](function(_0x2902ca){_0x429a36=_0x2902ca;logger['info'](_0x84dd('0x53'),_0x429a36['id']);return getTicket(_0x3fdbb2,_0x34cc62,_0x429a36,_0x225caf,_0x2cbcb5);})[_0x84dd('0x17')](function(_0x5f1371){if(_0x5f1371){logger[_0x84dd('0xa')](_0x84dd('0x54'),_0x5f1371['id']);switch(_0x3fdbb2[_0x84dd('0x3b')]){case _0x84dd('0x55'):logger[_0x84dd('0xa')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x84dd('0xc')](_0x84dd('0x57'),_0x3fdbb2[_0x84dd('0xe')],_0x34cc62['id'],_0x5f1371['id']),'method':_0x84dd('0xf')});case _0x84dd('0x58'):logger['info']('[OUTBOUND]',_0x84dd('0x59'));emit(util[_0x84dd('0xc')]('user:%s',_0x675525[_0x84dd('0x12')]),_0x84dd('0x5a'),{'uri':util[_0x84dd('0xc')](_0x84dd('0x5b'),_0x3fdbb2['remoteUri'][_0x84dd('0x5c')](_0x84dd('0x5d'),''),_0x5f1371['id'])});break;default:logger[_0x84dd('0x5e')](_0x84dd('0x66'),_0x84dd('0x5f'));}}})[_0x84dd('0x60')](function(_0x35ea53){logger[_0x84dd('0x5e')](_0x84dd('0x69'),util[_0x84dd('0x62')](_0x35ea53,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0xfb5aea,_0x565c60,_0x303437,_0x3c2684,_0x341f12,_0x203fe4){var _0xc9e5f,_0xa5cb7b;_0x203fe4[_0x84dd('0xe')]=intUtil[_0x84dd('0x48')](_0x203fe4['remoteUri']);_0x203fe4[_0x84dd('0x49')]=intUtil['stripTrailingSlash'](_0x203fe4[_0x84dd('0x49')]);if(_0x341f12&&_0x341f12[_0x84dd('0x6a')]){logger[_0x84dd('0xa')]('['+_0x565c60['lastevent'][_0x84dd('0x6b')]()+']',_0x84dd('0x4b'));_0x565c60[_0x84dd('0x4c')]=util['format'](_0x84dd('0x4d'),_0x203fe4['serverUrl'],_0x565c60[_0x84dd('0x4e')],md5(_0x565c60[_0x84dd('0x4e')]));}else{_0x565c60[_0x84dd('0x4c')]='';}headers[_0x84dd('0x4f')]=getAuth(_0x203fe4);return getUser(_0x203fe4)[_0x84dd('0x17')](function(_0x286cde){_0xc9e5f=_0x286cde;logger[_0x84dd('0xa')](_0x84dd('0x51'),_0xc9e5f['id']);return getEndUser(_0x203fe4,_0x565c60[_0x84dd('0x6c')],_0x565c60[_0x84dd('0x52')]);})[_0x84dd('0x17')](function(_0x574926){_0xa5cb7b=_0x574926;logger['info']('The\x20Enduser\x20ID\x20is:',_0xa5cb7b['id']);return getTicket(_0x203fe4,_0xc9e5f,_0xa5cb7b,_0x303437,_0x565c60);})[_0x84dd('0x17')](function(_0x10b69b){if(_0x10b69b){logger['info']('The\x20Ticket\x20ID\x20is:',_0x10b69b['id']);}})[_0x84dd('0x60')](function(_0x189d3d){logger[_0x84dd('0x5e')]('['+_0x565c60['lastevent'][_0x84dd('0x6b')]()+']'+_0x84dd('0x6d'),util[_0x84dd('0x62')](_0x189d3d,{'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 dcd790d..6ad301a 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 _0x61ce=['log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','Called','complete','Answered','Call_Result','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','unmanaged','toUpperCase','Recording\x20is\x20enabled!','request-promise','md5','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','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','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20'];(function(_0x13b64a,_0x28f9a8){var _0x209eff=function(_0x17c2a2){while(--_0x17c2a2){_0x13b64a['push'](_0x13b64a['shift']());}};_0x209eff(++_0x28f9a8);}(_0x61ce,0xeb));var _0xe61c=function(_0x23102f,_0x4390fd){_0x23102f=_0x23102f-0x0;var _0xd9c209=_0x61ce[_0x23102f];return _0xd9c209;};'use strict';var _=require('lodash');var rp=require(_0xe61c('0x0'));var md5=require(_0xe61c('0x1'));var util=require('util');var intUtil=require('./util');var moment=require(_0xe61c('0x2'));var Redis=require(_0xe61c('0x3'));var BPromise=require(_0xe61c('0x4'));var config=require(_0xe61c('0x5'));var logger=require(_0xe61c('0x6'))(_0xe61c('0x7'));config[_0xe61c('0x8')]=_[_0xe61c('0x9')](config[_0xe61c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe61c('0xa'))(new Redis(config[_0xe61c('0x8')]));function emit(_0x3c4af4,_0x15b204,_0x27b17c){io['to'](_0x3c4af4)['emit'](_0x15b204,_0x27b17c);}function request(_0x2dbf64){logger[_0xe61c('0xb')](_0xe61c('0xc'),JSON[_0xe61c('0xd')](_0x2dbf64));return rp(_0x2dbf64);}function getCustomFields(_0xaaa1e6,_0x1f97e4){var _0x594d1c={};if(_0xaaa1e6[_0xe61c('0xe')]>0x0){_[_0xe61c('0xf')](_0xaaa1e6,function(_0x59e1f2){if(_['includes']([_0xe61c('0x10'),_0xe61c('0x11')],_0x59e1f2[_0xe61c('0x12')])&&_0x59e1f2[_0xe61c('0x13')]){_0x594d1c[_0x59e1f2['idField']]=_0x59e1f2[_0xe61c('0x14')][_0xe61c('0x15')]();}else if(_0x59e1f2[_0xe61c('0x12')]===_0xe61c('0x16')&&_0x59e1f2[_0xe61c('0x17')]&&_0x59e1f2[_0xe61c('0x13')]&&_0x1f97e4[_0x59e1f2[_0xe61c('0x17')]]){_0x594d1c[_0x59e1f2[_0xe61c('0x13')]]=_0x1f97e4[_0x59e1f2[_0xe61c('0x17')]][_0xe61c('0x15')]();}else if(_0x59e1f2[_0xe61c('0x12')]===_0xe61c('0x18')&&_0x59e1f2['Variable']&&_0x59e1f2[_0xe61c('0x19')][_0xe61c('0x1a')]&&_0x59e1f2[_0xe61c('0x13')]&&_0x1f97e4[_0x59e1f2[_0xe61c('0x19')][_0xe61c('0x1a')][_0xe61c('0x1b')]()]){_0x594d1c[_0x59e1f2['idField']]=_0x1f97e4[_0x59e1f2[_0xe61c('0x19')]['name']['toLowerCase']()][_0xe61c('0x15')]();}});}return _0x594d1c;}function getName(_0x291d3b){if(_0x291d3b[_0xe61c('0x1c')]('\x20')>0x0){var _0x1ef4f9=_0x291d3b[_0xe61c('0x1d')](/ (.+)/);if(_0x1ef4f9[0x1]){return _0x1ef4f9;}}return[_0x291d3b,_0x291d3b];}var accountsTokens={};function getAccessToken(_0x429e14){return new Promise(function(_0x2c5036,_0x58cfae){if(!_['isNil'](accountsTokens[_0x429e14['id']])&&!_[_0xe61c('0x1e')](accountsTokens[_0x429e14['id']][_0xe61c('0x1f')])){if(moment()[_0xe61c('0x20')](accountsTokens[_0x429e14['id']][_0xe61c('0x21')])){_0x2c5036(accountsTokens[_0x429e14['id']][_0xe61c('0x1f')]);}}var _0x2d74f1;switch(_0x429e14[_0xe61c('0x22')]){case'US':_0x2d74f1='https://accounts.zoho.com';break;case'AU':_0x2d74f1=_0xe61c('0x23');break;case'EU':_0x2d74f1=_0xe61c('0x24');break;case'IN':_0x2d74f1=_0xe61c('0x25');break;case'CN':_0x2d74f1='https://accounts.zoho.com.cn';break;default:_0x2d74f1='https://accounts.zoho.eu';break;}var _0x4ea908={'method':_0xe61c('0x26'),'uri':_0x2d74f1+_0xe61c('0x27'),'qs':{'refresh_token':_0x429e14[_0xe61c('0x28')],'client_id':_0x429e14[_0xe61c('0x29')],'client_secret':_0x429e14[_0xe61c('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4ea908)['then'](function(_0x447c34){accountsTokens[_0x429e14['id']]={'access_token':_0x447c34[_0xe61c('0x1f')],'expires_in':moment()[_0xe61c('0x2b')](_0x447c34[_0xe61c('0x21')],_0xe61c('0x2c'))};_0x2c5036(_0x447c34['access_token']);})[_0xe61c('0x2d')](function(_0x3fa928){logger[_0xe61c('0x2e')](_0xe61c('0x2f'),_0x3fa928[_0xe61c('0x30')]);_0x58cfae(_0x3fa928);});});}function getUser(_0x22e506,_0x250cff,_0x4fd7e0,_0x2f07fd){logger[_0xe61c('0x31')](_0xe61c('0x32'));return request({'method':'GET','uri':util[_0xe61c('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x250cff),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xe61c('0x34')+_0x22e506},'json':!![]})[_0xe61c('0x35')](function(_0x5191ed){if(_0x5191ed[_0xe61c('0x36')]){var _0x9b667=-0x1;if(_[_0xe61c('0x37')](_0x5191ed['users'])){if(!_[_0xe61c('0x1e')](_0x2f07fd)){_0x9b667=_[_0xe61c('0x38')](_0x5191ed[_0xe61c('0x36')],function(_0x2489a6){return _0x2489a6[_0xe61c('0x39')]===_0x2f07fd;});}if(_0x9b667>=0x0){logger['info'](_0xe61c('0x3a'));}else{logger[_0xe61c('0x31')](_0xe61c('0x3b'));_0x9b667=_[_0xe61c('0x38')](_0x5191ed[_0xe61c('0x36')],function(_0x57134a){return _0x57134a[_0xe61c('0x3c')]['name']===_0xe61c('0x3d');});}return _0x5191ed[_0xe61c('0x36')][_0x9b667];}else{if(_0x5191ed['user'][_0xe61c('0x3c')]['name']==='Administrator'){logger['info'](_0xe61c('0x3b'));user=_0x5191ed[_0xe61c('0x3e')];return user;}else{logger[_0xe61c('0x2e')](_0xe61c('0x3f'),JSON[_0xe61c('0xd')](_0x5191ed));throw new Error(_0xe61c('0x40')+JSON[_0xe61c('0xd')](_0x5191ed));}}}else{logger[_0xe61c('0x2e')](_0xe61c('0x3f'),JSON['stringify'](_0x5191ed));throw new Error(_0xe61c('0x40')+JSON[_0xe61c('0xd')](_0x5191ed));}})[_0xe61c('0x2d')](function(_0xce3267){console['error'](_0xce3267);});}function getZohoUser(_0x28bb44,_0x4d8e25){return new BPromise(function(_0x5cade9,_0x5cff17){request(_0x28bb44)['then'](function(_0x287553){var _0x225517=null;if(_0x287553){_0x225517=_0x287553[_0xe61c('0x41')][0x0];_0x225517[_0xe61c('0x42')]=_0x4d8e25;}_0x5cade9(_0x225517);})[_0xe61c('0x2d')](function(_0x4f2d46){_0x5cff17(_0x4f2d46);});});}function createEndUser(_0x39ecad,_0x115278,_0x259ab6,_0x3be4b3,_0x21435d,_0x494191){var _0x259ab6=getName(_0x259ab6);return request({'method':_0xe61c('0x26'),'uri':'https://www.zohoapis.'+_0x115278+_0xe61c('0x43')+_[_0xe61c('0x44')](_0x494191[_0xe61c('0x45')])+'s','body':{'data':[{'Last_Name':_0x259ab6[0x1],'First_Name':_0x259ab6[0x0],'Phone':_0x3be4b3,'Owner':{'name':!_[_0xe61c('0x1e')](_0x21435d['role'][_0xe61c('0x1a')])?_0x21435d[_0xe61c('0x46')]['name']:!_[_0xe61c('0x1e')](_0x21435d[_0xe61c('0x47')])?_0x21435d[_0xe61c('0x47')]+'\x20'+_0x21435d['last_name']:_0x21435d[_0xe61c('0x48')],'id':_0x21435d['id']}}]},'headers':{'Authorization':_0xe61c('0x34')+_0x39ecad},'json':!![]})['then'](function(_0x27bd47){if(_0x27bd47&&_0x27bd47['data'][0x0][_0xe61c('0x49')]===_0xe61c('0x4a')){var _0x609fcb=_0x27bd47[_0xe61c('0x41')][0x0][_0xe61c('0x4b')];_0x609fcb[_0xe61c('0x42')]=_[_0xe61c('0x44')](_0x494191[_0xe61c('0x45')])+'s';return _0x609fcb;}logger[_0xe61c('0x2e')](_0xe61c('0x3f'),JSON[_0xe61c('0xd')](data));throw new Error(_0xe61c('0x4c')+JSON[_0xe61c('0xd')](data));})[_0xe61c('0x2d')](function(_0x436b91){console[_0xe61c('0x4d')](_0xe61c('0x4e'),_0x436b91);});}function getEndUser(_0x569790,_0x2fed5b,_0x2dabcf,_0x30f0af,_0x5c0759,_0x16f66a,_0x3000a7){var _0x312437={'method':'GET','uri':'','headers':{'Authorization':_0xe61c('0x34')+_0x569790},'json':!![]};switch(_0x3000a7[_0xe61c('0x4f')]){case _0xe61c('0x50'):_0x312437[_0xe61c('0x51')]=_0xe61c('0x52')+_0x2fed5b+_0xe61c('0x53')+_0x5c0759+'))';return getZohoUser(_0x312437,'Contacts')['then'](function(_0x1f2809){if(_0x1f2809)return _0x1f2809;_0x312437[_0xe61c('0x51')]=_0xe61c('0x52')+_0x2fed5b+_0xe61c('0x54')+_0x5c0759+'))';return getZohoUser(_0x312437,_0xe61c('0x55'))[_0xe61c('0x35')](function(_0x4afa70){if(_0x4afa70)return _0x4afa70;if(_0x3000a7[_0xe61c('0x45')]!=_0xe61c('0x56')){return createEndUser(_0x569790,_0x2fed5b,_0x30f0af,_0x5c0759,_0x16f66a,_0x3000a7);}else{return{};}});});break;case _0xe61c('0x57'):_0x312437[_0xe61c('0x51')]='https://www.zohoapis.'+_0x2fed5b+_0xe61c('0x53')+_0x5c0759+'))';return getZohoUser(_0x312437,_0xe61c('0x58'))[_0xe61c('0x35')](function(_0x581022){if(_0x581022)return _0x581022;if(_0x3000a7[_0xe61c('0x45')]!=_0xe61c('0x56')){return createEndUser(_0x569790,_0x2fed5b,_0x30f0af,_0x5c0759,_0x16f66a,_0x3000a7);}else{return{};}});break;case _0xe61c('0x59'):_0x312437[_0xe61c('0x51')]='https://www.zohoapis.'+_0x2fed5b+_0xe61c('0x54')+_0x5c0759+'))';return getZohoUser(_0x312437,_0xe61c('0x55'))[_0xe61c('0x35')](function(_0x4b359b){if(_0x4b359b)return _0x4b359b;if(_0x3000a7['moduleCreate']!=_0xe61c('0x56')){return createEndUser(_0x569790,_0x2fed5b,_0x30f0af,_0x5c0759,_0x16f66a,_0x3000a7);}else{return{};}});break;}}function getCall(_0x1b0b9c,_0x241ab6,_0x5d2119,_0x5607b7,_0x17cf0c,_0xbe0355,_0x108ea9,_0x1895dd){logger[_0xe61c('0x31')](_0xe61c('0x5a'));var _0x4cf8bc={};_0x4cf8bc[_0xe61c('0x5b')]={'name':!_[_0xe61c('0x1e')](_0x5607b7[_0xe61c('0x46')][_0xe61c('0x1a')])&&!_[_0xe61c('0x1e')](_0x5607b7[_0xe61c('0x3c')][_0xe61c('0x1a')])&&_0x5607b7['profile']['name']===_0xe61c('0x5c')?_0x5607b7['role'][_0xe61c('0x1a')]:!_[_0xe61c('0x1e')](_0x5607b7[_0xe61c('0x47')])?_0x5607b7[_0xe61c('0x47')]+'\x20'+_0x5607b7[_0xe61c('0x48')]:_0x5607b7['last_name'],'id':_0x5607b7['id']};_0x4cf8bc[_0xe61c('0x5d')]=intUtil[_0xe61c('0x5e')](_0xbe0355[_0xe61c('0x5f')],_0x108ea9,'\x20');_0x4cf8bc[_0xe61c('0x60')]=intUtil[_0xe61c('0x5e')](_0xbe0355[_0xe61c('0x61')],_0x108ea9,'\x0a');if(_0x17cf0c['enduserType']===_0xe61c('0x58')){_0x4cf8bc[_0xe61c('0x62')]={'name':!_[_0xe61c('0x1e')](_0x17cf0c[_0xe61c('0x63')])?_0x17cf0c[_0xe61c('0x63')]:!_[_0xe61c('0x1e')](_0x17cf0c[_0xe61c('0x64')])?_0x17cf0c[_0xe61c('0x64')]+'\x20'+_0x17cf0c[_0xe61c('0x65')]:_0x17cf0c['Last_Name'],'id':_0x17cf0c['id']};}if(_0x17cf0c[_0xe61c('0x42')]===_0xe61c('0x55')){_0x4cf8bc['What_Id']={'name':!_[_0xe61c('0x1e')](_0x17cf0c[_0xe61c('0x63')])?_0x17cf0c['Full_Name']:!_['isNil'](_0x17cf0c[_0xe61c('0x64')])?_0x17cf0c[_0xe61c('0x64')]+'\x20'+_0x17cf0c[_0xe61c('0x65')]:_0x17cf0c[_0xe61c('0x65')],'id':_0x17cf0c['id']};_0x4cf8bc[_0xe61c('0x66')]=_[_0xe61c('0x44')](_0x17cf0c[_0xe61c('0x42')]);}if(_0x108ea9[_0xe61c('0x67')]){_0x4cf8bc[_0xe61c('0x68')]=moment[_0xe61c('0x69')](parseInt(_0x108ea9[_0xe61c('0x67')])*0x3e8)['format'](_0xe61c('0x6a'));}else if(_0x108ea9[_0xe61c('0x6b')]&&_0x108ea9['endtime']){_0x4cf8bc['Call_Duration']=moment['utc'](moment(_0x108ea9[_0xe61c('0x6c')],_0xe61c('0x6d'))[_0xe61c('0x6e')](moment(_0x108ea9['starttime'],_0xe61c('0x6d'))))['format'](_0xe61c('0x6a'));}switch(_0x108ea9[_0xe61c('0x6f')]){case'called':_0x4cf8bc['Call_Result']=_0xe61c('0x70');break;case _0xe61c('0x71'):case'connect':_0x4cf8bc['Call_Result']=_0xe61c('0x72');break;case'rejected':_0x4cf8bc['Call_Result']='Rejected';break;case'abandoned':_0x4cf8bc[_0xe61c('0x73')]='Abandoned';break;case _0xe61c('0x74'):_0x4cf8bc[_0xe61c('0x73')]=_0xe61c('0x75');default:}_0x4cf8bc[_0xe61c('0x76')]=(_0x1895dd===_0xe61c('0x77')?moment(_0x108ea9[_0xe61c('0x78')])[_0xe61c('0x33')](_0xe61c('0x6d')):moment(_0x108ea9[_0xe61c('0x79')])[_0xe61c('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0xe61c('0x6d'));_0x4cf8bc[_0xe61c('0x7a')]=_0x1895dd||_0xe61c('0x7b');_0x4cf8bc=_[_0xe61c('0x7c')](_0x4cf8bc,getCustomFields(_0xbe0355['Fields'],_0x108ea9));return request({'method':_0xe61c('0x26'),'uri':'https://www.zohoapis.'+_0x241ab6+_0xe61c('0x7d'),'headers':{'Authorization':_0xe61c('0x34')+_0x1b0b9c},'body':{'data':[_0x4cf8bc]},'json':!![]})[_0xe61c('0x35')](function(_0xafb57b){if(_0xafb57b&&_0xafb57b['data'][0x0]['code']===_0xe61c('0x4a')){logger['info'](_0xe61c('0x7e'));return{'id':_0xafb57b[_0xe61c('0x41')][0x0][_0xe61c('0x4b')]['id']};}})['catch'](function(_0x4e4030){logger['info']('err',_0x4e4030[_0xe61c('0x30')]);console[_0xe61c('0x4d')](_0xe61c('0x7f'),_0x4e4030);});}exports[_0xe61c('0x80')]=function(_0x33f95d,_0x21b98a,_0x36fb38,_0x290ab0,_0x4ed474,_0x10c5cd){var _0x3b44b4,_0x124460,_0x72460c;_0x10c5cd['host']=intUtil['stripTrailingSlash'](_0x10c5cd[_0xe61c('0x81')]);_0x10c5cd[_0xe61c('0x82')]=intUtil[_0xe61c('0x83')](_0x10c5cd['serverUrl']);if(_0x4ed474&&_0x4ed474[_0xe61c('0x84')]){logger['info'](_0xe61c('0x85'),'Recording\x20is\x20enabled!');_0x21b98a[_0xe61c('0x86')]=_0x10c5cd[_0xe61c('0x82')]+_0xe61c('0x87')+_0x21b98a[_0xe61c('0x88')]+'/downloads?type=uniqueid&token='+md5(_0x21b98a[_0xe61c('0x88')]);}else{_0x21b98a[_0xe61c('0x86')]='';}var _0x511e94=_0x10c5cd[_0xe61c('0x81')]===_0xe61c('0x89')?'eu':_0xe61c('0x8a');return getAccessToken(_0x10c5cd)['then'](function(_0x550020){_0x72460c=_0x550020;return getUser(_0x72460c,_0x511e94,_0x10c5cd,_0x290ab0[_0xe61c('0x39')]);})['then'](function(_0x2518cc){_0x3b44b4=_0x2518cc;logger['info'](_0xe61c('0x8b'),_0x3b44b4['id']);return getEndUser(_0x72460c,_0x511e94,_0x10c5cd,_0x21b98a[_0xe61c('0x8c')],_0x21b98a[_0xe61c('0x8d')],_0x3b44b4,_0x36fb38);})[_0xe61c('0x35')](function(_0x1da810){_0x124460=_0x1da810;return getCall(_0x72460c,_0x511e94,_0x10c5cd,_0x3b44b4,_0x124460,_0x36fb38,_0x21b98a,_0xe61c('0x7b'));})[_0xe61c('0x35')](function(_0x28b369){if(_0x28b369){logger[_0xe61c('0x31')](_0xe61c('0x8e'),_0x28b369['id']);logger[_0xe61c('0x31')](_0xe61c('0x85'),_0xe61c('0x8f'));emit(util['format'](_0xe61c('0x90'),_0x290ab0[_0xe61c('0x1a')]),_0xe61c('0x91'),{'uri':_0xe61c('0x92')+_0x10c5cd['host']+_0xe61c('0x93')+_0x28b369['id']});}})[_0xe61c('0x2d')](function(_0x5d997d){logger[_0xe61c('0x2e')](_0xe61c('0x85'),JSON[_0xe61c('0xd')](_0x5d997d));});};exports['outbound']=function(_0x1e100b,_0x7d1ba7,_0x179c47,_0x4e5b9b,_0x2c80c2,_0x249004,_0x45aa10){var _0x1521c8,_0x5993c2,_0x763e33;_0x249004[_0xe61c('0x81')]=intUtil['stripTrailingSlash'](_0x249004['host']);_0x249004[_0xe61c('0x82')]=intUtil[_0xe61c('0x83')](_0x249004[_0xe61c('0x82')]);if(_0x45aa10&&_0x45aa10[_0xe61c('0x94')]&&_0x45aa10[_0xe61c('0x94')]!==_0xe61c('0x95')){logger[_0xe61c('0x31')](_0xe61c('0x96'),'Recording\x20is\x20enabled!');_0x7d1ba7['recordingURL']=_0x249004[_0xe61c('0x82')]+'/api/voice/recordings/'+_0x7d1ba7[_0xe61c('0x88')]+_0xe61c('0x97')+md5(_0x7d1ba7[_0xe61c('0x88')]);}var _0x58b15f=_0x249004[_0xe61c('0x81')]===_0xe61c('0x89')?'eu':_0xe61c('0x8a');return getAccessToken(_0x249004)[_0xe61c('0x35')](function(_0xa524cc){_0x763e33=_0xa524cc;return getUser(_0x763e33,_0x58b15f,_0x249004,_0x4e5b9b['email']);})[_0xe61c('0x35')](function(_0x3dbc9c){_0x1521c8=_0x3dbc9c;logger[_0xe61c('0x31')](_0xe61c('0x8b'),_0x1521c8['id']);return getEndUser(_0x763e33,_0x58b15f,_0x249004,_0x7d1ba7[_0xe61c('0x98')],_0x7d1ba7['destcalleridnum'],_0x1521c8,_0x179c47);})['then'](function(_0x536fd9){_0x5993c2=_0x536fd9;return getCall(_0x763e33,_0x58b15f,_0x249004,_0x1521c8,_0x5993c2,_0x179c47,_0x7d1ba7,'Outbound');})[_0xe61c('0x35')](function(_0x5612e0){if(_0x5612e0){logger['info'](_0xe61c('0x8e'),_0x5612e0['id']);logger[_0xe61c('0x31')](_0xe61c('0x96'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe61c('0x33')](_0xe61c('0x90'),_0x4e5b9b[_0xe61c('0x1a')]),_0xe61c('0x91'),{'uri':_0xe61c('0x92')+_0x249004[_0xe61c('0x81')]+_0xe61c('0x93')+_0x5612e0['id']});}})[_0xe61c('0x2d')](function(_0x3924bf){logger[_0xe61c('0x2e')](_0xe61c('0x96'),JSON[_0xe61c('0xd')](_0x3924bf));});};exports[_0xe61c('0x99')]=function(_0x16d836,_0x5d89b4,_0xdbdf4a,_0x3a6e34,_0x5697d5,_0x4f8f36){var _0x1b5b6d,_0x5195d2,_0x3e3e3e;_0x4f8f36[_0xe61c('0x81')]=intUtil[_0xe61c('0x83')](_0x4f8f36[_0xe61c('0x81')]);_0x4f8f36[_0xe61c('0x82')]=intUtil['stripTrailingSlash'](_0x4f8f36['serverUrl']);if(_0x5697d5&&_0x5697d5[_0xe61c('0x84')]){logger[_0xe61c('0x31')]('['+_0x5d89b4['lastevent'][_0xe61c('0x9a')]()+']',_0xe61c('0x9b'));_0x5d89b4['recordingURL']=_0x4f8f36[_0xe61c('0x82')]+_0xe61c('0x87')+_0x5d89b4[_0xe61c('0x88')]+_0xe61c('0x97')+md5(_0x5d89b4[_0xe61c('0x88')]);}else{_0x5d89b4[_0xe61c('0x86')]='';}var _0x52e06a=_0x4f8f36[_0xe61c('0x81')]==='zoho.eu'?'eu':_0xe61c('0x8a');return getAccessToken(_0x4f8f36)[_0xe61c('0x35')](function(_0x34ea6c){_0x3e3e3e=_0x34ea6c;return getUser(_0x3e3e3e,_0x52e06a,_0x4f8f36);})[_0xe61c('0x35')](function(_0x489a12){_0x1b5b6d=_0x489a12;logger['info'](_0xe61c('0x8b'),_0x1b5b6d['id']);return getEndUser(_0x3e3e3e,_0x52e06a,_0x4f8f36,_0x5d89b4[_0xe61c('0x8c')],_0x5d89b4['calleridnum'],_0x1b5b6d,_0xdbdf4a);})['then'](function(_0x43bfce){_0x5195d2=_0x43bfce;return getCall(_0x3e3e3e,_0x52e06a,_0x4f8f36,_0x1b5b6d,_0x5195d2,_0xdbdf4a,_0x5d89b4,_0xe61c('0x7b'));})['then'](function(_0x14c46f){if(_0x14c46f){logger[_0xe61c('0x31')](_0xe61c('0x8e'),_0x14c46f['id']);}})[_0xe61c('0x2d')](function(_0x50450d){logger['error']('['+_0x5d89b4[_0xe61c('0x6f')]['toUpperCase']()+']',JSON[_0xe61c('0xd')](_0x50450d));});}; \ No newline at end of file +var _0x0f5b=['administrator','first_name','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','mm:ss','lastevent','called','Called','complete','Call_Result','Answered','abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Call\x20created!','err','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','destcalleridnum','trigger:browser:url','toUpperCase','request-promise','./util','moment','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','seconds','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','catch','data','https://www.zohoapis.','role','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','nothing','contact','lead','Creating\x20new\x20call...','Owner'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f5b,0xd1));var _0xb0f5=function(_0x597258,_0x293d8b){_0x597258=_0x597258-0x0;var _0x1f1142=_0x0f5b[_0x597258];return _0x1f1142;};'use strict';var _=require('lodash');var rp=require(_0xb0f5('0x0'));var md5=require('md5');var util=require('util');var intUtil=require(_0xb0f5('0x1'));var moment=require(_0xb0f5('0x2'));var Redis=require('ioredis');var BPromise=require(_0xb0f5('0x3'));var config=require(_0xb0f5('0x4'));var logger=require(_0xb0f5('0x5'))(_0xb0f5('0x6'));config[_0xb0f5('0x7')]=_[_0xb0f5('0x8')](config[_0xb0f5('0x7')],{'host':_0xb0f5('0x9'),'port':0x18eb});var io=require(_0xb0f5('0xa'))(new Redis(config[_0xb0f5('0x7')]));function emit(_0x392287,_0x4c7f9a,_0x5f213a){io['to'](_0x392287)[_0xb0f5('0xb')](_0x4c7f9a,_0x5f213a);}function request(_0x15b41e){logger['debug'](_0xb0f5('0xc'),JSON['stringify'](_0x15b41e));return rp(_0x15b41e);}function getCustomFields(_0x2f7e09,_0x1b3a52){var _0xdecb71={};if(_0x2f7e09['length']>0x0){_['forEach'](_0x2f7e09,function(_0x5de304){if(_['includes']([_0xb0f5('0xd'),_0xb0f5('0xe')],_0x5de304[_0xb0f5('0xf')])&&_0x5de304[_0xb0f5('0x10')]){_0xdecb71[_0x5de304[_0xb0f5('0x10')]]=_0x5de304[_0xb0f5('0x11')][_0xb0f5('0x12')]();}else if(_0x5de304[_0xb0f5('0xf')]===_0xb0f5('0x13')&&_0x5de304[_0xb0f5('0x14')]&&_0x5de304[_0xb0f5('0x10')]&&_0x1b3a52[_0x5de304[_0xb0f5('0x14')]]){_0xdecb71[_0x5de304[_0xb0f5('0x10')]]=_0x1b3a52[_0x5de304[_0xb0f5('0x14')]][_0xb0f5('0x12')]();}else if(_0x5de304[_0xb0f5('0xf')]===_0xb0f5('0x15')&&_0x5de304[_0xb0f5('0x16')]&&_0x5de304[_0xb0f5('0x16')]['name']&&_0x5de304[_0xb0f5('0x10')]&&_0x1b3a52[_0x5de304[_0xb0f5('0x16')][_0xb0f5('0x17')][_0xb0f5('0x18')]()]){_0xdecb71[_0x5de304[_0xb0f5('0x10')]]=_0x1b3a52[_0x5de304['Variable']['name'][_0xb0f5('0x18')]()]['toString']();}});}return _0xdecb71;}function getName(_0x1a71ec){if(_0x1a71ec[_0xb0f5('0x19')]('\x20')>0x0){var _0x1e9363=_0x1a71ec[_0xb0f5('0x1a')](/ (.+)/);if(_0x1e9363[0x1]){return _0x1e9363;}}return[_0x1a71ec,_0x1a71ec];}var accountsTokens={};function getAccessToken(_0x1b96c5){return new Promise(function(_0x44d79f,_0x46f95f){if(!_[_0xb0f5('0x1b')](accountsTokens[_0x1b96c5['id']])&&!_[_0xb0f5('0x1b')](accountsTokens[_0x1b96c5['id']]['access_token'])){if(moment()[_0xb0f5('0x1c')](accountsTokens[_0x1b96c5['id']][_0xb0f5('0x1d')])){_0x44d79f(accountsTokens[_0x1b96c5['id']][_0xb0f5('0x1e')]);}}var _0x24cb9f;switch(_0x1b96c5[_0xb0f5('0x1f')]){case'US':_0x24cb9f=_0xb0f5('0x20');break;case'AU':_0x24cb9f=_0xb0f5('0x21');break;case'EU':_0x24cb9f=_0xb0f5('0x22');break;case'IN':_0x24cb9f=_0xb0f5('0x23');break;case'CN':_0x24cb9f=_0xb0f5('0x24');break;default:_0x24cb9f=_0xb0f5('0x22');break;}var _0x5828d7={'method':_0xb0f5('0x25'),'uri':_0x24cb9f+'/oauth/v2/token','qs':{'refresh_token':_0x1b96c5[_0xb0f5('0x26')],'client_id':_0x1b96c5[_0xb0f5('0x27')],'client_secret':_0x1b96c5[_0xb0f5('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5828d7)[_0xb0f5('0x29')](function(_0x8128ba){accountsTokens[_0x1b96c5['id']]={'access_token':_0x8128ba[_0xb0f5('0x1e')],'expires_in':moment()['add'](_0x8128ba[_0xb0f5('0x1d')],_0xb0f5('0x2a'))};_0x44d79f(_0x8128ba[_0xb0f5('0x1e')]);})['catch'](function(_0x166306){logger[_0xb0f5('0x2b')]('Failing\x20creating\x20the\x20access_token',_0x166306[_0xb0f5('0x2c')]);_0x46f95f(_0x166306);});});}function getUser(_0xce5833,_0x40fb5a,_0x3b7588,_0x28b31e){logger[_0xb0f5('0x2d')](_0xb0f5('0x2e'));return request({'method':_0xb0f5('0x2f'),'uri':util[_0xb0f5('0x30')](_0xb0f5('0x31'),_0x40fb5a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xce5833},'json':!![]})[_0xb0f5('0x29')](function(_0x297e9e){if(_0x297e9e[_0xb0f5('0x32')]){var _0x293292=-0x1;if(_[_0xb0f5('0x33')](_0x297e9e['users'])){if(!_[_0xb0f5('0x1b')](_0x28b31e)){_0x293292=_[_0xb0f5('0x34')](_0x297e9e[_0xb0f5('0x32')],function(_0x245f9c){return _0x245f9c[_0xb0f5('0x35')]===_0x28b31e;});}if(_0x293292>=0x0){logger[_0xb0f5('0x2d')](_0xb0f5('0x36'));}else{logger[_0xb0f5('0x2d')](_0xb0f5('0x37'));_0x293292=_[_0xb0f5('0x34')](_0x297e9e[_0xb0f5('0x32')],function(_0x1efc58){return _0x1efc58['profile'][_0xb0f5('0x17')]===_0xb0f5('0x38');});}return _0x297e9e[_0xb0f5('0x32')][_0x293292];}else{if(_0x297e9e['user'][_0xb0f5('0x39')]['name']===_0xb0f5('0x38')){logger[_0xb0f5('0x2d')](_0xb0f5('0x37'));user=_0x297e9e[_0xb0f5('0x3a')];return user;}else{logger[_0xb0f5('0x2b')](_0xb0f5('0x3b'),JSON['stringify'](_0x297e9e));throw new Error(_0xb0f5('0x3c')+JSON['stringify'](_0x297e9e));}}}else{logger['error'](_0xb0f5('0x3b'),JSON['stringify'](_0x297e9e));throw new Error(_0xb0f5('0x3c')+JSON[_0xb0f5('0x3d')](_0x297e9e));}})[_0xb0f5('0x3e')](function(_0x39cc54){console[_0xb0f5('0x2b')](_0x39cc54);});}function getZohoUser(_0x24ed84,_0x3097f5){return new BPromise(function(_0x5807b1,_0x342b27){request(_0x24ed84)[_0xb0f5('0x29')](function(_0x3518a6){var _0x1b689a=null;if(_0x3518a6){_0x1b689a=_0x3518a6[_0xb0f5('0x3f')][0x0];_0x1b689a['enduserType']=_0x3097f5;}_0x5807b1(_0x1b689a);})[_0xb0f5('0x3e')](function(_0x1c8ecc){_0x342b27(_0x1c8ecc);});});}function createEndUser(_0x5985b2,_0x493758,_0x2f2318,_0x30d22f,_0x402bfe,_0x449cd1){var _0x2f2318=getName(_0x2f2318);return request({'method':_0xb0f5('0x25'),'uri':_0xb0f5('0x40')+_0x493758+'/crm/v2/'+_['startCase'](_0x449cd1['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x2f2318[0x1],'First_Name':_0x2f2318[0x0],'Phone':_0x30d22f,'Owner':{'name':!_['isNil'](_0x402bfe['role'][_0xb0f5('0x17')])?_0x402bfe[_0xb0f5('0x41')][_0xb0f5('0x17')]:!_[_0xb0f5('0x1b')](_0x402bfe['first_name'])?_0x402bfe['first_name']+'\x20'+_0x402bfe[_0xb0f5('0x42')]:_0x402bfe[_0xb0f5('0x42')],'id':_0x402bfe['id']}}]},'headers':{'Authorization':_0xb0f5('0x43')+_0x5985b2},'json':!![]})[_0xb0f5('0x29')](function(_0x356045){if(_0x356045&&_0x356045[_0xb0f5('0x3f')][0x0][_0xb0f5('0x44')]===_0xb0f5('0x45')){var _0x54c0c5=_0x356045['data'][0x0][_0xb0f5('0x46')];_0x54c0c5[_0xb0f5('0x47')]=_[_0xb0f5('0x48')](_0x449cd1['moduleCreate'])+'s';return _0x54c0c5;}logger[_0xb0f5('0x2b')]('The\x20failing\x20result\x20is',JSON[_0xb0f5('0x3d')](data));throw new Error(_0xb0f5('0x49')+JSON['stringify'](data));})['catch'](function(_0x3c05bb){console['log'](_0xb0f5('0x4a'),_0x3c05bb);});}function getEndUser(_0x40a48b,_0x248a5e,_0x14e01f,_0x3ee280,_0x1d5e74,_0x1ce159,_0xf886dc){var _0x2693e6={'method':'GET','uri':'','headers':{'Authorization':_0xb0f5('0x43')+_0x40a48b},'json':!![]};switch(_0xf886dc[_0xb0f5('0x4b')]){case'contact_lead':_0x2693e6[_0xb0f5('0x4c')]='https://www.zohoapis.'+_0x248a5e+_0xb0f5('0x4d')+_0x1d5e74+'))';return getZohoUser(_0x2693e6,_0xb0f5('0x4e'))[_0xb0f5('0x29')](function(_0x3215bb){if(_0x3215bb)return _0x3215bb;_0x2693e6[_0xb0f5('0x4c')]=_0xb0f5('0x40')+_0x248a5e+_0xb0f5('0x4f')+_0x1d5e74+'))';return getZohoUser(_0x2693e6,_0xb0f5('0x50'))['then'](function(_0x175bb6){if(_0x175bb6)return _0x175bb6;if(_0xf886dc[_0xb0f5('0x51')]!=_0xb0f5('0x52')){return createEndUser(_0x40a48b,_0x248a5e,_0x3ee280,_0x1d5e74,_0x1ce159,_0xf886dc);}else{return{};}});});break;case _0xb0f5('0x53'):_0x2693e6['uri']='https://www.zohoapis.'+_0x248a5e+_0xb0f5('0x4d')+_0x1d5e74+'))';return getZohoUser(_0x2693e6,'Contacts')['then'](function(_0x12db35){if(_0x12db35)return _0x12db35;if(_0xf886dc[_0xb0f5('0x51')]!=_0xb0f5('0x52')){return createEndUser(_0x40a48b,_0x248a5e,_0x3ee280,_0x1d5e74,_0x1ce159,_0xf886dc);}else{return{};}});break;case _0xb0f5('0x54'):_0x2693e6['uri']=_0xb0f5('0x40')+_0x248a5e+_0xb0f5('0x4f')+_0x1d5e74+'))';return getZohoUser(_0x2693e6,'Leads')[_0xb0f5('0x29')](function(_0x3d308f){if(_0x3d308f)return _0x3d308f;if(_0xf886dc[_0xb0f5('0x51')]!=_0xb0f5('0x52')){return createEndUser(_0x40a48b,_0x248a5e,_0x3ee280,_0x1d5e74,_0x1ce159,_0xf886dc);}else{return{};}});break;}}function getCall(_0x249cd4,_0x3d2591,_0x242503,_0x178d33,_0x3a9a79,_0x420a67,_0x5906d6,_0x4165e4){logger[_0xb0f5('0x2d')](_0xb0f5('0x55'));var _0x30e82a={};_0x30e82a[_0xb0f5('0x56')]={'name':!_['isNil'](_0x178d33['role'][_0xb0f5('0x17')])&&!_[_0xb0f5('0x1b')](_0x178d33[_0xb0f5('0x39')]['name'])&&_0x178d33[_0xb0f5('0x39')][_0xb0f5('0x17')]===_0xb0f5('0x57')?_0x178d33[_0xb0f5('0x41')][_0xb0f5('0x17')]:!_[_0xb0f5('0x1b')](_0x178d33[_0xb0f5('0x58')])?_0x178d33[_0xb0f5('0x58')]+'\x20'+_0x178d33['last_name']:_0x178d33[_0xb0f5('0x42')],'id':_0x178d33['id']};_0x30e82a['Subject']=intUtil['getString'](_0x420a67[_0xb0f5('0x59')],_0x5906d6,'\x20');_0x30e82a[_0xb0f5('0x5a')]=intUtil['getString'](_0x420a67[_0xb0f5('0x5b')],_0x5906d6,'\x0a');if(_0x3a9a79['enduserType']==='Contacts'){_0x30e82a[_0xb0f5('0x5c')]={'name':!_['isNil'](_0x3a9a79['Full_Name'])?_0x3a9a79[_0xb0f5('0x5d')]:!_[_0xb0f5('0x1b')](_0x3a9a79[_0xb0f5('0x5e')])?_0x3a9a79['First_Name']+'\x20'+_0x3a9a79[_0xb0f5('0x5f')]:_0x3a9a79[_0xb0f5('0x5f')],'id':_0x3a9a79['id']};}if(_0x3a9a79['enduserType']===_0xb0f5('0x50')){_0x30e82a['What_Id']={'name':!_[_0xb0f5('0x1b')](_0x3a9a79[_0xb0f5('0x5d')])?_0x3a9a79['Full_Name']:!_['isNil'](_0x3a9a79[_0xb0f5('0x5e')])?_0x3a9a79[_0xb0f5('0x5e')]+'\x20'+_0x3a9a79[_0xb0f5('0x5f')]:_0x3a9a79['Last_Name'],'id':_0x3a9a79['id']};_0x30e82a[_0xb0f5('0x60')]=_[_0xb0f5('0x48')](_0x3a9a79[_0xb0f5('0x47')]);}if(_0x5906d6['talktime']){_0x30e82a[_0xb0f5('0x61')]=moment[_0xb0f5('0x62')](parseInt(_0x5906d6[_0xb0f5('0x63')])*0x3e8)['format']('mm:ss');}else if(_0x5906d6[_0xb0f5('0x64')]&&_0x5906d6[_0xb0f5('0x65')]){_0x30e82a[_0xb0f5('0x61')]=moment['utc'](moment(_0x5906d6[_0xb0f5('0x65')],_0xb0f5('0x66'))['diff'](moment(_0x5906d6[_0xb0f5('0x67')],_0xb0f5('0x66'))))[_0xb0f5('0x30')](_0xb0f5('0x68'));}switch(_0x5906d6[_0xb0f5('0x69')]){case _0xb0f5('0x6a'):_0x30e82a['Call_Result']=_0xb0f5('0x6b');break;case _0xb0f5('0x6c'):case'connect':_0x30e82a[_0xb0f5('0x6d')]=_0xb0f5('0x6e');break;case'rejected':_0x30e82a[_0xb0f5('0x6d')]='Rejected';break;case _0xb0f5('0x6f'):_0x30e82a['Call_Result']='Abandoned';break;case _0xb0f5('0x70'):_0x30e82a[_0xb0f5('0x6d')]=_0xb0f5('0x71');default:}_0x30e82a[_0xb0f5('0x72')]=(_0x4165e4==='outbound'?moment(_0x5906d6[_0xb0f5('0x67')])['format'](_0xb0f5('0x66')):moment(_0x5906d6[_0xb0f5('0x73')])[_0xb0f5('0x30')](_0xb0f5('0x66')))||moment()[_0xb0f5('0x30')](_0xb0f5('0x66'));_0x30e82a[_0xb0f5('0x74')]=_0x4165e4||_0xb0f5('0x75');_0x30e82a=_[_0xb0f5('0x76')](_0x30e82a,getCustomFields(_0x420a67['Fields'],_0x5906d6));return request({'method':_0xb0f5('0x25'),'uri':_0xb0f5('0x40')+_0x3d2591+'/crm/v2/Calls','headers':{'Authorization':_0xb0f5('0x43')+_0x249cd4},'body':{'data':[_0x30e82a]},'json':!![]})[_0xb0f5('0x29')](function(_0x4bdcfe){if(_0x4bdcfe&&_0x4bdcfe[_0xb0f5('0x3f')][0x0][_0xb0f5('0x44')]===_0xb0f5('0x45')){logger[_0xb0f5('0x2d')](_0xb0f5('0x77'));return{'id':_0x4bdcfe[_0xb0f5('0x3f')][0x0][_0xb0f5('0x46')]['id']};}})[_0xb0f5('0x3e')](function(_0x2df751){logger[_0xb0f5('0x2d')](_0xb0f5('0x78'),_0x2df751[_0xb0f5('0x2c')]);console[_0xb0f5('0x79')](_0xb0f5('0x78'),_0x2df751);});}exports[_0xb0f5('0x7a')]=function(_0xd79e97,_0x5caec2,_0x2cfba8,_0x491ddc,_0x519e5b,_0x16cc50){var _0x5b1e18,_0x356b6c,_0x58543a;_0x16cc50[_0xb0f5('0x7b')]=intUtil['stripTrailingSlash'](_0x16cc50[_0xb0f5('0x7b')]);_0x16cc50[_0xb0f5('0x7c')]=intUtil[_0xb0f5('0x7d')](_0x16cc50[_0xb0f5('0x7c')]);if(_0x519e5b&&_0x519e5b[_0xb0f5('0x7e')]){logger[_0xb0f5('0x2d')](_0xb0f5('0x7f'),_0xb0f5('0x80'));_0x5caec2[_0xb0f5('0x81')]=_0x16cc50[_0xb0f5('0x7c')]+'/api/voice/recordings/'+_0x5caec2[_0xb0f5('0x82')]+_0xb0f5('0x83')+md5(_0x5caec2[_0xb0f5('0x82')]);}else{_0x5caec2['recordingURL']='';}var _0x5bf1d3=_0x16cc50[_0xb0f5('0x7b')]===_0xb0f5('0x84')?'eu':_0xb0f5('0x85');return getAccessToken(_0x16cc50)[_0xb0f5('0x29')](function(_0x24fc47){_0x58543a=_0x24fc47;return getUser(_0x58543a,_0x5bf1d3,_0x16cc50,_0x491ddc[_0xb0f5('0x35')]);})['then'](function(_0x3e0403){_0x5b1e18=_0x3e0403;logger[_0xb0f5('0x2d')](_0xb0f5('0x86'),_0x5b1e18['id']);return getEndUser(_0x58543a,_0x5bf1d3,_0x16cc50,_0x5caec2[_0xb0f5('0x87')],_0x5caec2[_0xb0f5('0x88')],_0x5b1e18,_0x2cfba8);})[_0xb0f5('0x29')](function(_0x1f06f8){_0x356b6c=_0x1f06f8;return getCall(_0x58543a,_0x5bf1d3,_0x16cc50,_0x5b1e18,_0x356b6c,_0x2cfba8,_0x5caec2,_0xb0f5('0x75'));})['then'](function(_0x4f2d66){if(_0x4f2d66){logger['info'](_0xb0f5('0x89'),_0x4f2d66['id']);logger['info'](_0xb0f5('0x7f'),_0xb0f5('0x8a'));emit(util[_0xb0f5('0x30')](_0xb0f5('0x8b'),_0x491ddc['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x16cc50['host']+_0xb0f5('0x8c')+_0x4f2d66['id']});}})['catch'](function(_0x298a76){logger[_0xb0f5('0x2b')](_0xb0f5('0x7f'),JSON[_0xb0f5('0x3d')](_0x298a76));});};exports['outbound']=function(_0x121b6d,_0x18bac5,_0x449bc7,_0x1ef2b8,_0x48efb1,_0x322df9,_0x4a1cb0){var _0x2f6e13,_0x394025,_0x5e1705;_0x322df9[_0xb0f5('0x7b')]=intUtil['stripTrailingSlash'](_0x322df9[_0xb0f5('0x7b')]);_0x322df9['serverUrl']=intUtil['stripTrailingSlash'](_0x322df9[_0xb0f5('0x7c')]);if(_0x4a1cb0&&_0x4a1cb0[_0xb0f5('0x8d')]&&_0x4a1cb0[_0xb0f5('0x8d')]!==_0xb0f5('0x8e')){logger[_0xb0f5('0x2d')](_0xb0f5('0x8f'),_0xb0f5('0x80'));_0x18bac5[_0xb0f5('0x81')]=_0x322df9[_0xb0f5('0x7c')]+_0xb0f5('0x90')+_0x18bac5[_0xb0f5('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x18bac5['uniqueid']);}var _0x56ef33=_0x322df9[_0xb0f5('0x7b')]===_0xb0f5('0x84')?'eu':_0xb0f5('0x85');return getAccessToken(_0x322df9)[_0xb0f5('0x29')](function(_0x588901){_0x5e1705=_0x588901;return getUser(_0x5e1705,_0x56ef33,_0x322df9,_0x1ef2b8['email']);})[_0xb0f5('0x29')](function(_0x166fab){_0x2f6e13=_0x166fab;logger[_0xb0f5('0x2d')](_0xb0f5('0x86'),_0x2f6e13['id']);return getEndUser(_0x5e1705,_0x56ef33,_0x322df9,_0x18bac5['destcalleridname'],_0x18bac5[_0xb0f5('0x91')],_0x2f6e13,_0x449bc7);})[_0xb0f5('0x29')](function(_0x5c233a){_0x394025=_0x5c233a;return getCall(_0x5e1705,_0x56ef33,_0x322df9,_0x2f6e13,_0x394025,_0x449bc7,_0x18bac5,'Outbound');})['then'](function(_0x30f40b){if(_0x30f40b){logger[_0xb0f5('0x2d')](_0xb0f5('0x89'),_0x30f40b['id']);logger['info'](_0xb0f5('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb0f5('0x30')](_0xb0f5('0x8b'),_0x1ef2b8[_0xb0f5('0x17')]),_0xb0f5('0x92'),{'uri':'https://crm.'+_0x322df9[_0xb0f5('0x7b')]+_0xb0f5('0x8c')+_0x30f40b['id']});}})[_0xb0f5('0x3e')](function(_0x403c73){logger['error'](_0xb0f5('0x8f'),JSON[_0xb0f5('0x3d')](_0x403c73));});};exports['unmanaged']=function(_0x58a8f9,_0x1aff6b,_0xf12861,_0x3e3b5a,_0x3d3ccc,_0x4cc44e){var _0x2ac55e,_0x52171d,_0xf1a427;_0x4cc44e['host']=intUtil[_0xb0f5('0x7d')](_0x4cc44e[_0xb0f5('0x7b')]);_0x4cc44e[_0xb0f5('0x7c')]=intUtil[_0xb0f5('0x7d')](_0x4cc44e[_0xb0f5('0x7c')]);if(_0x3d3ccc&&_0x3d3ccc[_0xb0f5('0x7e')]){logger['info']('['+_0x1aff6b['lastevent'][_0xb0f5('0x93')]()+']','Recording\x20is\x20enabled!');_0x1aff6b['recordingURL']=_0x4cc44e['serverUrl']+'/api/voice/recordings/'+_0x1aff6b[_0xb0f5('0x82')]+_0xb0f5('0x83')+md5(_0x1aff6b[_0xb0f5('0x82')]);}else{_0x1aff6b[_0xb0f5('0x81')]='';}var _0x16f400=_0x4cc44e[_0xb0f5('0x7b')]===_0xb0f5('0x84')?'eu':_0xb0f5('0x85');return getAccessToken(_0x4cc44e)['then'](function(_0x117745){_0xf1a427=_0x117745;return getUser(_0xf1a427,_0x16f400,_0x4cc44e);})[_0xb0f5('0x29')](function(_0x58d71c){_0x2ac55e=_0x58d71c;logger[_0xb0f5('0x2d')](_0xb0f5('0x86'),_0x2ac55e['id']);return getEndUser(_0xf1a427,_0x16f400,_0x4cc44e,_0x1aff6b[_0xb0f5('0x87')],_0x1aff6b[_0xb0f5('0x88')],_0x2ac55e,_0xf12861);})[_0xb0f5('0x29')](function(_0x490524){_0x52171d=_0x490524;return getCall(_0xf1a427,_0x16f400,_0x4cc44e,_0x2ac55e,_0x52171d,_0xf12861,_0x1aff6b,_0xb0f5('0x75'));})[_0xb0f5('0x29')](function(_0x37601a){if(_0x37601a){logger[_0xb0f5('0x2d')](_0xb0f5('0x89'),_0x37601a['id']);}})[_0xb0f5('0x3e')](function(_0x45ae48){logger[_0xb0f5('0x2b')]('['+_0x1aff6b[_0xb0f5('0x69')][_0xb0f5('0x93')]()+']',JSON[_0xb0f5('0x3d')](_0x45ae48));});}; \ 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 2f87361..1e943ba 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 _0x5d7a=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','Script','render','data3','format'];(function(_0x3167a8,_0x4d5006){var _0x20073f=function(_0x5b7216){while(--_0x5b7216){_0x3167a8['push'](_0x3167a8['shift']());}};_0x20073f(++_0x4d5006);}(_0x5d7a,0x10a));var _0xa5d7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5d7a[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xa5d7('0x0'));var sh=require(_0xa5d7('0x1'));var Mustache=require(_0xa5d7('0x2'));var logger=require(_0xa5d7('0x3'))(_0xa5d7('0x4'));exports['exec']=function(_0x5c7b41,_0x125b16){var _0x4ea38f=_0x5c7b41['data2']?_0x5c7b41['data2']:_0xa5d7('0x5');var _0x1ffe27=_0x5c7b41['data3']?Mustache[_0xa5d7('0x6')](_0x5c7b41[_0xa5d7('0x7')],_0x125b16):_0x125b16;sh['exec'](_0x1ffe27,function(_0x5e238c,_0x73d7f3,_0xc8f3e9){if(_0x5e238c!==0x0){logger['error'](util[_0xa5d7('0x8')](_0xa5d7('0x9'),_0x4ea38f,_0x1ffe27,_0x5e238c,_0xc8f3e9));}else{logger['info'](util[_0xa5d7('0x8')](_0xa5d7('0xa'),_0x4ea38f,_0x1ffe27,_0x73d7f3));}});}; \ No newline at end of file +var _0xf398=['../../../../config/logger','trigger','exec','data2','data3','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache'];(function(_0x13c9a3,_0x1eb4a9){var _0x43ad78=function(_0x3695ee){while(--_0x3695ee){_0x13c9a3['push'](_0x13c9a3['shift']());}};_0x43ad78(++_0x1eb4a9);}(_0xf398,0x1ab));var _0x8f39=function(_0x13fd25,_0x1c7b86){_0x13fd25=_0x13fd25-0x0;var _0x430e07=_0xf398[_0x13fd25];return _0x430e07;};'use strict';var util=require(_0x8f39('0x0'));var sh=require(_0x8f39('0x1'));var Mustache=require(_0x8f39('0x2'));var logger=require(_0x8f39('0x3'))(_0x8f39('0x4'));exports[_0x8f39('0x5')]=function(_0x126ef8,_0x5c8c7b){var _0x57af67=_0x126ef8['data2']?_0x126ef8[_0x8f39('0x6')]:'Script';var _0x4cea92=_0x126ef8['data3']?Mustache['render'](_0x126ef8[_0x8f39('0x7')],_0x5c8c7b):_0x5c8c7b;sh[_0x8f39('0x5')](_0x4cea92,function(_0x107f2b,_0x1b4a34,_0x3967cc){if(_0x107f2b!==0x0){logger['error'](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x57af67,_0x4cea92,_0x107f2b,_0x3967cc));}else{logger['info'](util[_0x8f39('0x8')](_0x8f39('0x9'),_0x57af67,_0x4cea92,_0x1b4a34));}});}; \ 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 1bfd6ce..5c1b7db 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 _0xd97f=['render','data2','data5','headers','data6','parse','error','stack','data1','toUpperCase','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','stringify','then',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','message','request-promise','util','mustache','../../../../config/logger','trigger','exec'];(function(_0x5cecdb,_0x254dce){var _0x2c40c8=function(_0x407366){while(--_0x407366){_0x5cecdb['push'](_0x5cecdb['shift']());}};_0x2c40c8(++_0x254dce);}(_0xd97f,0xd3));var _0xfd97=function(_0x5b7503,_0x4366d6){_0x5b7503=_0x5b7503-0x0;var _0x57daef=_0xd97f[_0x5b7503];return _0x57daef;};'use strict';var rp=require(_0xfd97('0x0'));var util=require(_0xfd97('0x1'));var _=require('lodash');var Mustache=require(_0xfd97('0x2'));var logger=require(_0xfd97('0x3'))(_0xfd97('0x4'));exports[_0xfd97('0x5')]=function(_0x5957b3,_0x34d12b){var _0xb172d8,_0x23adde;var _0x235806={'method':_0x5957b3['data1']['toUpperCase'](),'uri':Mustache[_0xfd97('0x6')](_0x5957b3[_0xfd97('0x7')],_0x34d12b),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5957b3[_0xfd97('0x8')])==='number'&&parseInt(_0x5957b3[_0xfd97('0x8')])>=0x1&&parseInt(_0x5957b3[_0xfd97('0x8')])<=0xa?parseInt(_0x5957b3[_0xfd97('0x8')])*0x3e8:0x5*0x3e8};try{_0x235806[_0xfd97('0x9')]=_0x5957b3[_0xfd97('0xa')]?JSON[_0xfd97('0xb')](Mustache[_0xfd97('0x6')](_0x5957b3[_0xfd97('0xa')],_0x34d12b)):{};}catch(_0x141c1e){logger[_0xfd97('0xc')](_0x141c1e[_0xfd97('0xd')]);}switch(_0x5957b3[_0xfd97('0xe')][_0xfd97('0xf')]()){case _0xfd97('0x10'):case _0xfd97('0x11'):_0xb172d8=null;_0x235806['qs']=_0x34d12b;break;case _0xfd97('0x12'):case'PUT':if(_0x5957b3[_0xfd97('0x13')]){try{_0xb172d8=JSON[_0xfd97('0xb')](Mustache[_0xfd97('0x6')](_0x5957b3[_0xfd97('0x13')],_0x34d12b));_0x235806['body']=_0xb172d8;}catch(_0x42b228){logger[_0xfd97('0xc')](_0x42b228['stack']);logger[_0xfd97('0xc')](_0xfd97('0x14'));}}else{_0xb172d8=_0x34d12b;_0x235806[_0xfd97('0x15')]=_0xb172d8;}break;}logger[_0xfd97('0x16')](util[_0xfd97('0x17')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x5957b3[_0xfd97('0xe')],_0x5957b3[_0xfd97('0x7')],JSON[_0xfd97('0x18')](_0x235806)));rp(_0x235806)[_0xfd97('0x19')](function(_0x1936ad){_0xb172d8=!_['isNil'](_0xb172d8)?_0xfd97('0x1a')+_0xb172d8:'';_0x23adde=typeof _0x1936ad['body']==='object'?JSON['stringify'](_0x1936ad[_0xfd97('0x15')]):_0x1936ad[_0xfd97('0x15')];logger[_0xfd97('0x16')](util['format'](_0xfd97('0x1b'),_0x5957b3['data1'],_0x5957b3[_0xfd97('0x7')],_0x1936ad[_0xfd97('0x1c')],_0x23adde));})[_0xfd97('0x1d')](function(_0x35d2e8){logger['error'](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5957b3[_0xfd97('0xe')],_0x5957b3[_0xfd97('0x7')],_0x35d2e8['statusCode'],_0x35d2e8['name'],_0x35d2e8[_0xfd97('0x1e')]));});}; \ No newline at end of file +var _0xc062=['data5','data6','parse','stack','GET','PUT','data7','error','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0xc062,0x1a8));var _0x2c06=function(_0x510c4c,_0x168272){_0x510c4c=_0x510c4c-0x0;var _0x1042eb=_0xc062[_0x510c4c];return _0x1042eb;};'use strict';var rp=require('request-promise');var util=require(_0x2c06('0x0'));var _=require(_0x2c06('0x1'));var Mustache=require(_0x2c06('0x2'));var logger=require(_0x2c06('0x3'))(_0x2c06('0x4'));exports[_0x2c06('0x5')]=function(_0x4715da,_0x42fe28){var _0x312ba9,_0x3ec479;var _0x2944cc={'method':_0x4715da[_0x2c06('0x6')][_0x2c06('0x7')](),'uri':Mustache[_0x2c06('0x8')](_0x4715da[_0x2c06('0x9')],_0x42fe28),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4715da[_0x2c06('0xa')])==='number'&&parseInt(_0x4715da[_0x2c06('0xa')])>=0x1&&parseInt(_0x4715da[_0x2c06('0xa')])<=0xa?parseInt(_0x4715da[_0x2c06('0xa')])*0x3e8:0x5*0x3e8};try{_0x2944cc['headers']=_0x4715da[_0x2c06('0xb')]?JSON[_0x2c06('0xc')](Mustache[_0x2c06('0x8')](_0x4715da[_0x2c06('0xb')],_0x42fe28)):{};}catch(_0x24b44d){logger['error'](_0x24b44d[_0x2c06('0xd')]);}switch(_0x4715da[_0x2c06('0x6')]['toUpperCase']()){case _0x2c06('0xe'):case'DELETE':_0x312ba9=null;_0x2944cc['qs']=_0x42fe28;break;case'POST':case _0x2c06('0xf'):if(_0x4715da[_0x2c06('0x10')]){try{_0x312ba9=JSON[_0x2c06('0xc')](Mustache['render'](_0x4715da[_0x2c06('0x10')],_0x42fe28));_0x2944cc['body']=_0x312ba9;}catch(_0x4d54f7){logger['error'](_0x4d54f7[_0x2c06('0xd')]);logger[_0x2c06('0x11')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x312ba9=_0x42fe28;_0x2944cc[_0x2c06('0x12')]=_0x312ba9;}break;}logger[_0x2c06('0x13')](util[_0x2c06('0x14')](_0x2c06('0x15'),_0x4715da['data1'],_0x4715da[_0x2c06('0x9')],JSON['stringify'](_0x2944cc)));rp(_0x2944cc)[_0x2c06('0x16')](function(_0x4d818a){_0x312ba9=!_['isNil'](_0x312ba9)?_0x2c06('0x17')+_0x312ba9:'';_0x3ec479=typeof _0x4d818a['body']===_0x2c06('0x18')?JSON[_0x2c06('0x19')](_0x4d818a['body']):_0x4d818a['body'];logger[_0x2c06('0x13')](util[_0x2c06('0x14')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4715da[_0x2c06('0x6')],_0x4715da[_0x2c06('0x9')],_0x4d818a[_0x2c06('0x1a')],_0x3ec479));})[_0x2c06('0x1b')](function(_0xab168a){logger[_0x2c06('0x11')](util['format'](_0x2c06('0x1c'),_0x4715da[_0x2c06('0x6')],_0x4715da[_0x2c06('0x9')],_0xab168a[_0x2c06('0x1a')],_0xab168a[_0x2c06('0x1d')],_0xab168a[_0x2c06('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e35bbfd..ed481dd 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 _0xc1d4=['request','error','rpc','result','catch','jayson/promise','routing','client','http','Request'];(function(_0xcb2e11,_0x1cd678){var _0x4b0880=function(_0x14b015){while(--_0x14b015){_0xcb2e11['push'](_0xcb2e11['shift']());}};_0x4b0880(++_0x1cd678);}(_0xc1d4,0x131));var _0x4c1d=function(_0x5b2167,_0x3f7fc4){_0x5b2167=_0x5b2167-0x0;var _0x32efbd=_0xc1d4[_0x5b2167];return _0x32efbd;};'use strict';var jayson=require(_0x4c1d('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x4c1d('0x1'));var client=jayson[_0x4c1d('0x2')][_0x4c1d('0x3')]({'port':0x2329});client[_0x4c1d('0x4')]=function(_0xe50b88,_0x4b845f){return new BPromise(function(_0x34ef4b,_0x40a806){return client[_0x4c1d('0x5')](_0xe50b88,_0x4b845f)['then'](function(_0x50b6a0){logger['debug']('rpc',_0x4c1d('0x1'),_0xe50b88,_0x4b845f,_0x50b6a0);if(_0x50b6a0['error']){logger[_0x4c1d('0x6')](_0x4c1d('0x7'),_0x4c1d('0x1'),_0xe50b88,_0x50b6a0['error']['message'],_0x4b845f);return _0x40a806(_0x50b6a0[_0x4c1d('0x6')]['message']);}else{return _0x34ef4b(_0x50b6a0[_0x4c1d('0x8')]);}})[_0x4c1d('0x9')](function(_0x3505ca){logger[_0x4c1d('0x6')](_0x4c1d('0x7'),_0x4c1d('0x1'),_0xe50b88,_0x3505ca,_0x4b845f);return _0x40a806(_0x3505ca);});});};module['exports']=client; \ No newline at end of file +var _0xbe0c=['message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x43bb67,_0x53f659){var _0x34260e=function(_0x331df3){while(--_0x331df3){_0x43bb67['push'](_0x43bb67['shift']());}};_0x34260e(++_0x53f659);}(_0xbe0c,0x9a));var _0xcbe0=function(_0x237da8,_0x37b77a){_0x237da8=_0x237da8-0x0;var _0x558825=_0xbe0c[_0x237da8];return _0x558825;};'use strict';var jayson=require(_0xcbe0('0x0'));var BPromise=require('bluebird');var logger=require(_0xcbe0('0x1'))(_0xcbe0('0x2'));var client=jayson[_0xcbe0('0x3')][_0xcbe0('0x4')]({'port':0x2329});client[_0xcbe0('0x5')]=function(_0x20b48f,_0x10fd25){return new BPromise(function(_0xa1e4b6,_0x21757e){return client[_0xcbe0('0x6')](_0x20b48f,_0x10fd25)[_0xcbe0('0x7')](function(_0x173a79){logger[_0xcbe0('0x8')](_0xcbe0('0x9'),'routing',_0x20b48f,_0x10fd25,_0x173a79);if(_0x173a79[_0xcbe0('0xa')]){logger[_0xcbe0('0xa')](_0xcbe0('0x9'),_0xcbe0('0x2'),_0x20b48f,_0x173a79[_0xcbe0('0xa')][_0xcbe0('0xb')],_0x10fd25);return _0x21757e(_0x173a79[_0xcbe0('0xa')][_0xcbe0('0xb')]);}else{return _0xa1e4b6(_0x173a79[_0xcbe0('0xc')]);}})[_0xcbe0('0xd')](function(_0x4913ce){logger[_0xcbe0('0xa')](_0xcbe0('0x9'),'routing',_0x20b48f,_0x4913ce,_0x10fd25);return _0x21757e(_0x4913ce);});});};module[_0xcbe0('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index ae90098..ddbb388 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 _0xde25=['getMailAccounts','then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve'];(function(_0x301ab4,_0x43345a){var _0x205296=function(_0x4b64ba){while(--_0x4b64ba){_0x301ab4['push'](_0x301ab4['shift']());}};_0x205296(++_0x43345a);}(_0xde25,0x104));var _0x5de2=function(_0x3db7d1,_0x2ca20d){_0x3db7d1=_0x3db7d1-0x0;var _0x31966c=_0xde25[_0x3db7d1];return _0x31966c;};'use strict';var BPromise=require(_0x5de2('0x0'));var server=require('./server');var Realtime=require(_0x5de2('0x1'));var EmailChannel=require(_0x5de2('0x2'));var mailAccount=require(_0x5de2('0x3'));var setting=require(_0x5de2('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x5de2('0x5')]()['then'](mailAccount[_0x5de2('0x6')]())[_0x5de2('0x7')](realtime[_0x5de2('0x8')]())['then'](function(){email[_0x5de2('0x9')](realtime[_0x5de2('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x5de2('0x7')](function(){return initRealtime();})[_0x5de2('0x7')](function(){return setting[_0x5de2('0xb')]();})[_0x5de2('0x7')](function(_0x4539ec){return setInterval(initRealtime,_0x4539ec[_0x5de2('0xc')]*0x3e8);})['catch'](function(_0x1c2414){console[_0x5de2('0xd')](_0x1c2414);});}main(); \ No newline at end of file +var _0xcbe1=['refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','then','initMailAccounts'];(function(_0x55042b,_0x449fbe){var _0x518ed1=function(_0x55837e){while(--_0x55837e){_0x55042b['push'](_0x55042b['shift']());}};_0x518ed1(++_0x449fbe);}(_0xcbe1,0xd7));var _0x1cbe=function(_0x32214a,_0x24fb09){_0x32214a=_0x32214a-0x0;var _0x1ce1a5=_0xcbe1[_0x32214a];return _0x1ce1a5;};'use strict';var BPromise=require(_0x1cbe('0x0'));var server=require(_0x1cbe('0x1'));var Realtime=require(_0x1cbe('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x1cbe('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x1cbe('0x4')](mailAccount['getMailAccounts']())[_0x1cbe('0x4')](realtime[_0x1cbe('0x5')]())[_0x1cbe('0x4')](function(){email[_0x1cbe('0x6')](realtime[_0x1cbe('0x7')]);return realtime;});}function main(){return server[_0x1cbe('0x8')](realtime,email)[_0x1cbe('0x4')](function(){return initRealtime();})[_0x1cbe('0x4')](function(){return setting[_0x1cbe('0x9')]();})[_0x1cbe('0x4')](function(_0x196b5a){return setInterval(initRealtime,_0x196b5a[_0x1cbe('0xa')]*0x3e8);})[_0x1cbe('0xb')](function(_0x22268c){console[_0x1cbe('0xc')](_0x22268c);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 4cca078..b33a5be 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 _0xe383=['smtp','emit','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','imapAccounts','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','./imap','./smtp','info','mailAccounts'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xe383,0x1f2));var _0x3e38=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xe383[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3e38('0x0'));var moment=require('moment');var BPromise=require(_0x3e38('0x1'));var md5=require(_0x3e38('0x2'));var Redis=require(_0x3e38('0x3'));var config=require(_0x3e38('0x4'));var logger=require(_0x3e38('0x5'))('email');config[_0x3e38('0x6')]=_[_0x3e38('0x7')](config[_0x3e38('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3e38('0x6')]));var EmailImap=require(_0x3e38('0x8'));var EmailSmtp=require(_0x3e38('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x333a8c){logger[_0x3e38('0xa')]('start\x20email\x20channel');this[_0x3e38('0xb')]=_0x333a8c[_0x3e38('0xb')];this['imapAccounts']={};this[_0x3e38('0xc')]=new EmailSmtp();}EmailChannel['prototype'][_0x3e38('0xd')]=function(_0x200aa5){var _0x69e174=this[_0x3e38('0xb')][_0x200aa5];var _0x37fcb4={'id':_0x69e174['id'],'name':_0x69e174['name'],'key':_0x69e174[_0x3e38('0xe')],'active':_0x69e174[_0x3e38('0xf')],'Imap':{'status':_0x69e174[_0x3e38('0x10')][_0x3e38('0x11')],'messageStatus':_0x69e174[_0x3e38('0x10')][_0x3e38('0x12')],'total':_0x69e174[_0x3e38('0x10')][_0x3e38('0x13')]}};if(_[_0x3e38('0x14')](md5Accounts[_0x200aa5])){md5Accounts[_0x200aa5]={};}var _0x4b9007=md5(JSON[_0x3e38('0x15')](_0x37fcb4));if(md5Accounts[_0x200aa5]['md5']!==_0x4b9007){md5Accounts[_0x200aa5][_0x3e38('0x2')]=_0x4b9007;io[_0x3e38('0xd')](_0x3e38('0x16'),_0x37fcb4);}};EmailChannel[_0x3e38('0x17')][_0x3e38('0x18')]=function(_0x124b6a){for(var _0x1f00fb in _0x124b6a){if(_0x124b6a[_0x3e38('0x19')](_0x1f00fb)){if(_0x124b6a[_0x1f00fb][_0x3e38('0x10')]&&_0x124b6a[_0x1f00fb][_0x3e38('0xf')]){var _0xebd446=_0x124b6a[_0x1f00fb]['Imap'];if(!this[_0x3e38('0x1a')][_0x3e38('0x19')](_0xebd446['id'])){this[_0x3e38('0x1a')][_0xebd446['id']]=new EmailImap(_0xebd446,_0x124b6a[_0x1f00fb][_0x3e38('0x1b')]);this['imapAccounts'][_0xebd446['id']]['on'](_0x3e38('0x1c'),this[_0x3e38('0x1d')][_0x3e38('0x1e')](this,_0x1f00fb));this[_0x3e38('0x1a')][_0xebd446['id']]['on']('email',this[_0x3e38('0x1f')][_0x3e38('0x1e')](this,_0x1f00fb));this[_0x3e38('0x1a')][_0xebd446['id']]['on'](_0x3e38('0x20'),this[_0x3e38('0x21')][_0x3e38('0x1e')](this,_0x1f00fb));this[_0x3e38('0x1a')][_0xebd446['id']]['on'](_0x3e38('0x22'),this[_0x3e38('0x23')]['bind'](this,_0x1f00fb));}}else{if(_[_0x3e38('0x14')](this['mailAccounts'][_0x1f00fb][_0x3e38('0x10')])){this[_0x3e38('0xb')][_0x1f00fb][_0x3e38('0x10')]={};}this[_0x3e38('0xb')][_0x1f00fb][_0x3e38('0x10')][_0x3e38('0x11')]='disabled';this[_0x3e38('0xb')][_0x1f00fb]['Imap'][_0x3e38('0x12')]='';this[_0x3e38('0xd')](_0x1f00fb);}}}};EmailChannel['prototype'][_0x3e38('0x1d')]=function(_0x4e6d9a,_0x374739){if(this['mailAccounts'][_0x4e6d9a]){this['mailAccounts'][_0x4e6d9a]['Imap'][_0x3e38('0x11')]=_0x3e38('0x24');this[_0x3e38('0xb')][_0x4e6d9a][_0x3e38('0x10')][_0x3e38('0x12')]=_0x374739[_0x3e38('0x25')];if(_0x374739[_0x3e38('0x26')]){this[_0x3e38('0xb')][_0x4e6d9a][_0x3e38('0x10')][_0x3e38('0x13')]=_0x374739[_0x3e38('0x26')][_0x3e38('0x13')];}return this[_0x3e38('0xd')](_0x4e6d9a);}};EmailChannel[_0x3e38('0x17')][_0x3e38('0x1f')]=function(_0x5c01db,_0x341b13){logger[_0x3e38('0xa')](_0x3e38('0x27'),_0x341b13['firstName'],_0x341b13[_0x3e38('0x28')],_0x341b13['from'],_0x5c01db);if(this[_0x3e38('0xb')][_0x5c01db]){return mailAccount[_0x3e38('0x29')](_0x5c01db,_0x341b13)[_0x3e38('0x2a')](function(_0x3ccb04){if(_0x3ccb04){logger[_0x3e38('0xa')](_0x3e38('0x2b'));}})[_0x3e38('0x2c')](function(_0x5ca1e3){logger[_0x3e38('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x3e38('0x15')](_0x5ca1e3));});}};EmailChannel[_0x3e38('0x17')][_0x3e38('0x21')]=function(_0x2f8e73){if(this[_0x3e38('0xb')][_0x2f8e73]&&this[_0x3e38('0xb')][_0x2f8e73][_0x3e38('0x10')]){if(this[_0x3e38('0x1a')][this[_0x3e38('0xb')][_0x2f8e73]['Imap']['id']]){delete this[_0x3e38('0x1a')][this['mailAccounts'][_0x2f8e73]['Imap']['id']];}this[_0x3e38('0xb')][_0x2f8e73][_0x3e38('0x10')]['lastSync']=moment();this[_0x3e38('0xd')](_0x2f8e73);}};EmailChannel[_0x3e38('0x17')][_0x3e38('0x23')]=function(_0x548ce4,_0x44dee5){if(this[_0x3e38('0xb')][_0x548ce4]){this[_0x3e38('0xb')][_0x548ce4]['Imap']['status']='error';this[_0x3e38('0xb')][_0x548ce4][_0x3e38('0x10')][_0x3e38('0x12')]=_0x44dee5;return this[_0x3e38('0xd')](_0x548ce4);}};EmailChannel['prototype']['sendMail']=function(_0xeca094,_0x4b264f){return this[_0x3e38('0xc')][_0x3e38('0x2d')](_0xeca094,_0x4b264f);};EmailChannel[_0x3e38('0x17')][_0x3e38('0x2e')]=function(_0x39c2ad){var _0x469b7f=this;if(this[_0x3e38('0xb')][_0x39c2ad['id']]){if(_[_0x3e38('0x14')](this[_0x3e38('0xb')][_0x39c2ad['id']][_0x3e38('0x2f')])){this[_0x3e38('0xb')][_0x39c2ad['id']][_0x3e38('0x2f')]={};}this[_0x3e38('0xb')][_0x39c2ad['id']][_0x3e38('0x2f')][_0x3e38('0x30')]=moment();return new BPromise(function(_0x288331,_0x4f8b51){return _0x469b7f['smtp'][_0x3e38('0x31')](_0x39c2ad)[_0x3e38('0x2a')](function(_0x1449e3){_0x469b7f[_0x3e38('0xb')][_0x39c2ad['id']][_0x3e38('0x2f')][_0x3e38('0x11')]=_0x3e38('0x32');_0x469b7f['mailAccounts'][_0x39c2ad['id']][_0x3e38('0x2f')][_0x3e38('0x12')]='';_0x469b7f[_0x3e38('0xd')](_0x39c2ad['id']);_0x288331(_0x1449e3);})[_0x3e38('0x2c')](function(_0x4f6db0){_0x469b7f[_0x3e38('0xb')][_0x39c2ad['id']][_0x3e38('0x2f')][_0x3e38('0x11')]=_0x3e38('0x22');_0x469b7f['mailAccounts'][_0x39c2ad['id']]['Smtp'][_0x3e38('0x12')]=_0x4f6db0;_0x469b7f[_0x3e38('0xd')](_0x39c2ad['id']);_0x4f8b51(_0x4f6db0);});});}return this['smtp']['verify'](_0x39c2ad);};module['exports']=EmailChannel; \ No newline at end of file +var _0x999d=['prototype','emit','active','messageStatus','Imap','total','stringify','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','isNil','status','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp'];(function(_0x31f25c,_0x67b2d1){var _0x2a3533=function(_0x5677ce){while(--_0x5677ce){_0x31f25c['push'](_0x31f25c['shift']());}};_0x2a3533(++_0x67b2d1);}(_0x999d,0x19f));var _0xd999=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x999d[_0x2a2166];return _0x3bcf50;};'use strict';var _=require(_0xd999('0x0'));var moment=require(_0xd999('0x1'));var BPromise=require(_0xd999('0x2'));var md5=require(_0xd999('0x3'));var Redis=require(_0xd999('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xd999('0x5'));config[_0xd999('0x6')]=_[_0xd999('0x7')](config[_0xd999('0x6')],{'host':_0xd999('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd999('0x6')]));var EmailImap=require(_0xd999('0x9'));var EmailSmtp=require(_0xd999('0xa'));var mailAccount=require(_0xd999('0xb'));var md5Accounts={};function EmailChannel(_0x50b85c){logger[_0xd999('0xc')](_0xd999('0xd'));this[_0xd999('0xe')]=_0x50b85c[_0xd999('0xe')];this[_0xd999('0xf')]={};this[_0xd999('0x10')]=new EmailSmtp();}EmailChannel[_0xd999('0x11')][_0xd999('0x12')]=function(_0x5009d1){var _0xc3f3a=this[_0xd999('0xe')][_0x5009d1];var _0x55c700={'id':_0xc3f3a['id'],'name':_0xc3f3a['name'],'key':_0xc3f3a['key'],'active':_0xc3f3a[_0xd999('0x13')],'Imap':{'status':_0xc3f3a['Imap']['status'],'messageStatus':_0xc3f3a['Imap'][_0xd999('0x14')],'total':_0xc3f3a[_0xd999('0x15')][_0xd999('0x16')]}};if(_['isNil'](md5Accounts[_0x5009d1])){md5Accounts[_0x5009d1]={};}var _0x521076=md5(JSON[_0xd999('0x17')](_0x55c700));if(md5Accounts[_0x5009d1][_0xd999('0x3')]!==_0x521076){md5Accounts[_0x5009d1][_0xd999('0x3')]=_0x521076;io[_0xd999('0x12')]('mailAccount:update',_0x55c700);}};EmailChannel[_0xd999('0x11')][_0xd999('0x18')]=function(_0x1de453){for(var _0x29798b in _0x1de453){if(_0x1de453[_0xd999('0x19')](_0x29798b)){if(_0x1de453[_0x29798b][_0xd999('0x15')]&&_0x1de453[_0x29798b][_0xd999('0x13')]){var _0x2ccb70=_0x1de453[_0x29798b][_0xd999('0x15')];if(!this[_0xd999('0xf')]['hasOwnProperty'](_0x2ccb70['id'])){this[_0xd999('0xf')][_0x2ccb70['id']]=new EmailImap(_0x2ccb70,_0x1de453[_0x29798b][_0xd999('0x5')]);this[_0xd999('0xf')][_0x2ccb70['id']]['on'](_0xd999('0x1a'),this[_0xd999('0x1b')][_0xd999('0x1c')](this,_0x29798b));this[_0xd999('0xf')][_0x2ccb70['id']]['on'](_0xd999('0x5'),this[_0xd999('0x1d')][_0xd999('0x1c')](this,_0x29798b));this['imapAccounts'][_0x2ccb70['id']]['on']('end',this[_0xd999('0x1e')][_0xd999('0x1c')](this,_0x29798b));this[_0xd999('0xf')][_0x2ccb70['id']]['on']('error',this['handleImapError'][_0xd999('0x1c')](this,_0x29798b));}}else{if(_[_0xd999('0x1f')](this[_0xd999('0xe')][_0x29798b][_0xd999('0x15')])){this['mailAccounts'][_0x29798b][_0xd999('0x15')]={};}this[_0xd999('0xe')][_0x29798b][_0xd999('0x15')][_0xd999('0x20')]=_0xd999('0x21');this[_0xd999('0xe')][_0x29798b][_0xd999('0x15')]['messageStatus']='';this[_0xd999('0x12')](_0x29798b);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x1614aa,_0x379ab8){if(this[_0xd999('0xe')][_0x1614aa]){this[_0xd999('0xe')][_0x1614aa][_0xd999('0x15')][_0xd999('0x20')]=_0xd999('0x22');this[_0xd999('0xe')][_0x1614aa][_0xd999('0x15')][_0xd999('0x14')]=_0x379ab8[_0xd999('0x23')];if(_0x379ab8[_0xd999('0x24')]){this[_0xd999('0xe')][_0x1614aa][_0xd999('0x15')][_0xd999('0x16')]=_0x379ab8[_0xd999('0x24')][_0xd999('0x16')];}return this[_0xd999('0x12')](_0x1614aa);}};EmailChannel[_0xd999('0x11')][_0xd999('0x1d')]=function(_0x344072,_0x311e48){logger[_0xd999('0xc')](_0xd999('0x25'),_0x311e48[_0xd999('0x26')],_0x311e48[_0xd999('0x27')],_0x311e48[_0xd999('0x28')],_0x344072);if(this[_0xd999('0xe')][_0x344072]){return mailAccount['notify'](_0x344072,_0x311e48)[_0xd999('0x29')](function(_0xd9dc0){if(_0xd9dc0){logger[_0xd999('0xc')](_0xd999('0x2a'));}})[_0xd999('0x2b')](function(_0x3bbf36){logger[_0xd999('0x2c')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x3bbf36));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x2a3f03){if(this[_0xd999('0xe')][_0x2a3f03]&&this[_0xd999('0xe')][_0x2a3f03][_0xd999('0x15')]){if(this['imapAccounts'][this['mailAccounts'][_0x2a3f03]['Imap']['id']]){delete this['imapAccounts'][this[_0xd999('0xe')][_0x2a3f03][_0xd999('0x15')]['id']];}this[_0xd999('0xe')][_0x2a3f03]['Imap'][_0xd999('0x2d')]=moment();this[_0xd999('0x12')](_0x2a3f03);}};EmailChannel[_0xd999('0x11')][_0xd999('0x2e')]=function(_0xf38151,_0x17e7ea){if(this[_0xd999('0xe')][_0xf38151]){this[_0xd999('0xe')][_0xf38151]['Imap'][_0xd999('0x20')]=_0xd999('0x2c');this['mailAccounts'][_0xf38151]['Imap'][_0xd999('0x14')]=_0x17e7ea;return this[_0xd999('0x12')](_0xf38151);}};EmailChannel['prototype'][_0xd999('0x2f')]=function(_0x3c94a4,_0x2da01f){return this[_0xd999('0x10')][_0xd999('0x30')](_0x3c94a4,_0x2da01f);};EmailChannel[_0xd999('0x11')][_0xd999('0x31')]=function(_0x28d19f){var _0x2e1f6a=this;if(this[_0xd999('0xe')][_0x28d19f['id']]){if(_[_0xd999('0x1f')](this['mailAccounts'][_0x28d19f['id']][_0xd999('0x32')])){this[_0xd999('0xe')][_0x28d19f['id']][_0xd999('0x32')]={};}this[_0xd999('0xe')][_0x28d19f['id']][_0xd999('0x32')]['lastSync']=moment();return new BPromise(function(_0xeae915,_0x241e6b){return _0x2e1f6a['smtp'][_0xd999('0x33')](_0x28d19f)['then'](function(_0xcb14f6){_0x2e1f6a['mailAccounts'][_0x28d19f['id']][_0xd999('0x32')][_0xd999('0x20')]=_0xd999('0x34');_0x2e1f6a[_0xd999('0xe')][_0x28d19f['id']]['Smtp'][_0xd999('0x14')]='';_0x2e1f6a[_0xd999('0x12')](_0x28d19f['id']);_0xeae915(_0xcb14f6);})[_0xd999('0x2b')](function(_0x2d2602){_0x2e1f6a[_0xd999('0xe')][_0x28d19f['id']][_0xd999('0x32')][_0xd999('0x20')]=_0xd999('0x2c');_0x2e1f6a[_0xd999('0xe')][_0x28d19f['id']]['Smtp'][_0xd999('0x14')]=_0x2d2602;_0x2e1f6a[_0xd999('0x12')](_0x28d19f['id']);_0x241e6b(_0x2d2602);});});}return this[_0xd999('0x10')]['verify'](_0x28d19f);};module[_0xd999('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 98582f7..db5a1ab 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 _0x9de5=['user','password','host','port','tls','autotls','required','getHost','service','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','closeBox','stringify','textCode','hasOwnProperty','upperFirst','path','util','imap','lodash','randomstring','mailparser','iconv','EventEmitter','./utils','email','mailbox','INBOX','account','handleReady','once','end','handleEnd','handleError','bind','connect','prototype','getAccount','connTimeout','authTimeout','isNil','authentication'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9de5,0x11c));var _0x59de=function(_0x1a3754,_0x4aa12a){_0x1a3754=_0x1a3754-0x0;var _0x47be7e=_0x9de5[_0x1a3754];return _0x47be7e;};'use strict';var fs=require('fs');var path=require(_0x59de('0x0'));var util=require(_0x59de('0x1'));var Imap=require(_0x59de('0x2'));var _=require(_0x59de('0x3'));var rs=require(_0x59de('0x4'));var simpleParser=require(_0x59de('0x5'))['simpleParser'];var Iconv=require(_0x59de('0x6'))['Iconv'];var EventEmitter=require('events')[_0x59de('0x7')];var utils=require(_0x59de('0x8'));var logger=require('../../../config/logger')(_0x59de('0x9'));function EmailImap(_0x46ce3d,_0x399936){this[_0x59de('0xa')]=_0x59de('0xb');this[_0x59de('0xc')]=this['getAccount'](_0x46ce3d,_0x399936);this[_0x59de('0x2')]=new Imap(this[_0x59de('0xc')]);this[_0x59de('0x2')]['once']('ready',this[_0x59de('0xd')]['bind'](this));this[_0x59de('0x2')][_0x59de('0xe')](_0x59de('0xf'),this[_0x59de('0x10')]['bind'](this));this[_0x59de('0x2')]['on']('error',this[_0x59de('0x11')][_0x59de('0x12')](this));this[_0x59de('0x2')][_0x59de('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x59de('0x14')][_0x59de('0x15')]=function(_0x497e0f,_0xd28aa8){var _0x4847c3={'connTimeout':_0x497e0f[_0x59de('0x16')]?_0x497e0f[_0x59de('0x16')]*0x3e8:0x2710,'authTimeout':_0x497e0f[_0x59de('0x17')]?_0x497e0f[_0x59de('0x17')]*0x3e8:0x1388};if(_[_0x59de('0x18')](_0x497e0f['service'])){if(_0x497e0f[_0x59de('0x19')]){_0x4847c3[_0x59de('0x1a')]=_0x497e0f[_0x59de('0x1a')];_0x4847c3['password']=_0x497e0f[_0x59de('0x1b')];}_0x4847c3[_0x59de('0x1c')]=_0x497e0f[_0x59de('0x1c')];_0x4847c3[_0x59de('0x1d')]=_0x497e0f['port']||0x3e1;if(_0x497e0f['tls']){_0x4847c3['tls']=!![];}else{_0x4847c3[_0x59de('0x1e')]=![];_0x4847c3[_0x59de('0x1f')]=_0x59de('0x20');}}else{_0x4847c3[_0x59de('0x1a')]=_0x497e0f[_0x59de('0x1a')];_0x4847c3['password']=_0x497e0f[_0x59de('0x1b')];_0x4847c3[_0x59de('0x1c')]=utils[_0x59de('0x21')](_0x497e0f[_0x59de('0x22')]);_0x4847c3[_0x59de('0x1d')]=0x3e1;_0x4847c3['tls']=!![];}_0x4847c3[_0x59de('0x9')]=_0xd28aa8||_0x497e0f[_0x59de('0x1a')]||_0x59de('0x23');return _0x4847c3;};EmailImap[_0x59de('0x14')]['handleReady']=function(){this[_0x59de('0x2')][_0x59de('0x24')](this[_0x59de('0xa')],![],this['handleOpenBox'][_0x59de('0x12')](this));};EmailImap[_0x59de('0x14')][_0x59de('0x25')]=function(_0x4e36b9,_0x3572ae){if(_0x4e36b9){this[_0x59de('0x11')](_0x4e36b9,!![]);}else{this[_0x59de('0x26')](_0x59de('0x27'),_0x3572ae);this[_0x59de('0x28')]();}};EmailImap[_0x59de('0x14')][_0x59de('0x29')]=function(_0x597a7b){if(_0x597a7b){this[_0x59de('0x11')](_0x597a7b,!![]);}else{this[_0x59de('0x2')][_0x59de('0xf')]();}};EmailImap[_0x59de('0x14')][_0x59de('0x28')]=function(){this[_0x59de('0x2')][_0x59de('0x2a')]([_0x59de('0x2b')],this[_0x59de('0x2c')][_0x59de('0x12')](this));};EmailImap[_0x59de('0x14')][_0x59de('0x2c')]=function(_0x511dc3,_0x394053){if(_0x511dc3){this[_0x59de('0x11')](_0x511dc3,!![]);}else{if(_0x394053[_0x59de('0x2d')]){try{var _0x3db2f0=this[_0x59de('0x2')][_0x59de('0x2e')](_0x394053,{'bodies':'','markSeen':!![]});_0x3db2f0['on'](_0x59de('0x2f'),this[_0x59de('0x30')][_0x59de('0x12')](this));_0x3db2f0[_0x59de('0xe')](_0x59de('0x31'),this[_0x59de('0x32')][_0x59de('0x12')](this));_0x3db2f0[_0x59de('0xe')](_0x59de('0xf'),this[_0x59de('0x33')][_0x59de('0x12')](this));}catch(_0x2441b1){logger[_0x59de('0x31')](_0x2441b1);}}else{this[_0x59de('0x2')]['closeBox'](!![],this[_0x59de('0x29')][_0x59de('0x12')](this));}}};EmailImap[_0x59de('0x14')][_0x59de('0x30')]=function(_0x5bc3a4,_0x158576){_0x5bc3a4['on'](_0x59de('0x34'),this[_0x59de('0x35')][_0x59de('0x12')](this));_0x5bc3a4['once']('attributes',this[_0x59de('0x36')][_0x59de('0x12')](this));_0x5bc3a4[_0x59de('0xe')]('end',this[_0x59de('0x37')][_0x59de('0x12')](this));};EmailImap['prototype'][_0x59de('0x35')]=function(_0x1f83c1,_0x488961){simpleParser(_0x1f83c1,{'Iconv':Iconv},this[_0x59de('0x38')][_0x59de('0x12')](this));};EmailImap[_0x59de('0x14')][_0x59de('0x36')]=function(_0x4202be){};EmailImap[_0x59de('0x14')]['handleMessageEnd']=function(){};EmailImap[_0x59de('0x14')][_0x59de('0x38')]=function(_0x5dcdb6,_0x52d537){if(_0x5dcdb6){logger[_0x59de('0x31')](_0x5dcdb6);}else{var _0x3f8e7d=this;utils['parser'](this[_0x59de('0xc')],_0x52d537,function(_0x51e7b4){_0x3f8e7d['emit']('email',_0x51e7b4);});}};EmailImap['prototype'][_0x59de('0x33')]=function(){this['imap']['closeBox'](!![],this[_0x59de('0x29')]['bind'](this));};EmailImap[_0x59de('0x14')][_0x59de('0x32')]=function(_0x4eb697){this[_0x59de('0x11')](_0x4eb697);this[_0x59de('0x2')][_0x59de('0x39')](!![],this[_0x59de('0x29')][_0x59de('0x12')](this));};EmailImap[_0x59de('0x14')][_0x59de('0x10')]=function(){this[_0x59de('0x26')]('end');};EmailImap[_0x59de('0x14')][_0x59de('0x11')]=function(_0x5a1543,_0x12dd80){logger[_0x59de('0x31')](_0x59de('0x11'),this[_0x59de('0xc')][_0x59de('0x9')],JSON[_0x59de('0x3a')](_0x5a1543));var _0x10bf63='';if(_0x5a1543){if(_0x5a1543['textCode']){_0x10bf63=_0x5a1543[_0x59de('0x3b')];}else{for(var _0x2b1269 in _0x5a1543){if(_0x5a1543[_0x59de('0x3c')](_0x2b1269)){_0x10bf63+=_[_0x59de('0x3d')](_0x2b1269)+':\x20'+_0x5a1543[_0x2b1269]+'\x0a';}}}}if(_0x12dd80){this[_0x59de('0x2')][_0x59de('0xf')]();}else{this['emit'](_0x59de('0x31'),_0x10bf63);this[_0x59de('0x26')](_0x59de('0xf'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xe4b6=['connTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','emit','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','exports','path','util','imap','lodash','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','handleReady','end','handleEnd','bind','error','handleError','inherits','prototype'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xe4b6,0x1a8));var _0x6e4b=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe4b6[_0x4b055c];return _0x4b62bb;};'use strict';var fs=require('fs');var path=require(_0x6e4b('0x0'));var util=require(_0x6e4b('0x1'));var Imap=require(_0x6e4b('0x2'));var _=require(_0x6e4b('0x3'));var rs=require('randomstring');var simpleParser=require(_0x6e4b('0x4'))['simpleParser'];var Iconv=require(_0x6e4b('0x5'))['Iconv'];var EventEmitter=require(_0x6e4b('0x6'))[_0x6e4b('0x7')];var utils=require(_0x6e4b('0x8'));var logger=require(_0x6e4b('0x9'))(_0x6e4b('0xa'));function EmailImap(_0x2dc2d4,_0x5b20c6){this[_0x6e4b('0xb')]=_0x6e4b('0xc');this[_0x6e4b('0xd')]=this[_0x6e4b('0xe')](_0x2dc2d4,_0x5b20c6);this[_0x6e4b('0x2')]=new Imap(this[_0x6e4b('0xd')]);this[_0x6e4b('0x2')][_0x6e4b('0xf')]('ready',this[_0x6e4b('0x10')]['bind'](this));this['imap'][_0x6e4b('0xf')](_0x6e4b('0x11'),this[_0x6e4b('0x12')][_0x6e4b('0x13')](this));this['imap']['on'](_0x6e4b('0x14'),this[_0x6e4b('0x15')]['bind'](this));this[_0x6e4b('0x2')]['connect']();}util[_0x6e4b('0x16')](EmailImap,EventEmitter);EmailImap[_0x6e4b('0x17')][_0x6e4b('0xe')]=function(_0x1ab87f,_0x1aa5b3){var _0x23ecfc={'connTimeout':_0x1ab87f[_0x6e4b('0x18')]?_0x1ab87f[_0x6e4b('0x18')]*0x3e8:0x2710,'authTimeout':_0x1ab87f['authTimeout']?_0x1ab87f['authTimeout']*0x3e8:0x1388};if(_['isNil'](_0x1ab87f[_0x6e4b('0x19')])){if(_0x1ab87f[_0x6e4b('0x1a')]){_0x23ecfc[_0x6e4b('0x1b')]=_0x1ab87f[_0x6e4b('0x1b')];_0x23ecfc[_0x6e4b('0x1c')]=_0x1ab87f[_0x6e4b('0x1c')];}_0x23ecfc['host']=_0x1ab87f[_0x6e4b('0x1d')];_0x23ecfc[_0x6e4b('0x1e')]=_0x1ab87f[_0x6e4b('0x1e')]||0x3e1;if(_0x1ab87f['tls']){_0x23ecfc[_0x6e4b('0x1f')]=!![];}else{_0x23ecfc[_0x6e4b('0x1f')]=![];_0x23ecfc[_0x6e4b('0x20')]=_0x6e4b('0x21');}}else{_0x23ecfc['user']=_0x1ab87f['user'];_0x23ecfc['password']=_0x1ab87f['password'];_0x23ecfc[_0x6e4b('0x1d')]=utils[_0x6e4b('0x22')](_0x1ab87f[_0x6e4b('0x19')]);_0x23ecfc[_0x6e4b('0x1e')]=0x3e1;_0x23ecfc[_0x6e4b('0x1f')]=!![];}_0x23ecfc[_0x6e4b('0xa')]=_0x1aa5b3||_0x1ab87f[_0x6e4b('0x1b')]||_0x6e4b('0x23');return _0x23ecfc;};EmailImap['prototype'][_0x6e4b('0x10')]=function(){this[_0x6e4b('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0x6e4b('0x13')](this));};EmailImap[_0x6e4b('0x17')]['handleOpenBox']=function(_0x264e20,_0x418469){if(_0x264e20){this[_0x6e4b('0x15')](_0x264e20,!![]);}else{this[_0x6e4b('0x24')]('box',_0x418469);this['readUnseen']();}};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x25')]=function(_0x1999c0){if(_0x1999c0){this[_0x6e4b('0x15')](_0x1999c0,!![]);}else{this[_0x6e4b('0x2')]['end']();}};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x26')]=function(){this['imap'][_0x6e4b('0x27')]([_0x6e4b('0x28')],this[_0x6e4b('0x29')]['bind'](this));};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x29')]=function(_0x2de055,_0x5315ea){if(_0x2de055){this['handleError'](_0x2de055,!![]);}else{if(_0x5315ea['length']){try{var _0x26196c=this['imap'][_0x6e4b('0x2a')](_0x5315ea,{'bodies':'','markSeen':!![]});_0x26196c['on'](_0x6e4b('0x2b'),this['handleFetchMessage'][_0x6e4b('0x13')](this));_0x26196c[_0x6e4b('0xf')]('error',this[_0x6e4b('0x2c')][_0x6e4b('0x13')](this));_0x26196c[_0x6e4b('0xf')](_0x6e4b('0x11'),this[_0x6e4b('0x2d')][_0x6e4b('0x13')](this));}catch(_0x5d75fb){logger[_0x6e4b('0x14')](_0x5d75fb);}}else{this[_0x6e4b('0x2')][_0x6e4b('0x2e')](!![],this[_0x6e4b('0x25')][_0x6e4b('0x13')](this));}}};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x2f')]=function(_0x335935,_0x34ada3){_0x335935['on'](_0x6e4b('0x30'),this[_0x6e4b('0x31')][_0x6e4b('0x13')](this));_0x335935[_0x6e4b('0xf')](_0x6e4b('0x32'),this['handleMessageAttributes'][_0x6e4b('0x13')](this));_0x335935[_0x6e4b('0xf')](_0x6e4b('0x11'),this[_0x6e4b('0x33')][_0x6e4b('0x13')](this));};EmailImap[_0x6e4b('0x17')]['handleMessageBody']=function(_0xda253d,_0x3441ea){simpleParser(_0xda253d,{'Iconv':Iconv},this[_0x6e4b('0x34')][_0x6e4b('0x13')](this));};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x35')]=function(_0x2403b3){};EmailImap[_0x6e4b('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x6e4b('0x17')]['handleSimpleParser']=function(_0x1492fa,_0x5dc604){if(_0x1492fa){logger[_0x6e4b('0x14')](_0x1492fa);}else{var _0x502acb=this;utils[_0x6e4b('0x36')](this[_0x6e4b('0xd')],_0x5dc604,function(_0x19862c){_0x502acb[_0x6e4b('0x24')](_0x6e4b('0xa'),_0x19862c);});}};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x2d')]=function(){this[_0x6e4b('0x2')][_0x6e4b('0x2e')](!![],this[_0x6e4b('0x25')][_0x6e4b('0x13')](this));};EmailImap['prototype'][_0x6e4b('0x2c')]=function(_0x387453){this[_0x6e4b('0x15')](_0x387453);this[_0x6e4b('0x2')][_0x6e4b('0x2e')](!![],this['handleCloseBox'][_0x6e4b('0x13')](this));};EmailImap[_0x6e4b('0x17')][_0x6e4b('0x12')]=function(){this['emit'](_0x6e4b('0x11'));};EmailImap[_0x6e4b('0x17')]['handleError']=function(_0x1199b5,_0x97b3f){logger[_0x6e4b('0x14')]('handleError',this[_0x6e4b('0xd')][_0x6e4b('0xa')],JSON['stringify'](_0x1199b5));var _0x2f92a0='';if(_0x1199b5){if(_0x1199b5['textCode']){_0x2f92a0=_0x1199b5['textCode'];}else{for(var _0x42b8bc in _0x1199b5){if(_0x1199b5['hasOwnProperty'](_0x42b8bc)){_0x2f92a0+=_['upperFirst'](_0x42b8bc)+':\x20'+_0x1199b5[_0x42b8bc]+'\x0a';}}}}if(_0x97b3f){this['imap']['end']();}else{this[_0x6e4b('0x24')](_0x6e4b('0x14'),_0x2f92a0);this[_0x6e4b('0x24')](_0x6e4b('0x11'));}};module[_0x6e4b('0x37')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index c1ed1ab..6156f5b 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 _0xe7d1=['sendMail','toString','verify','createTransport','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','use'];(function(_0x208cbf,_0x407196){var _0x43d320=function(_0x29d320){while(--_0x29d320){_0x208cbf['push'](_0x208cbf['shift']());}};_0x43d320(++_0x407196);}(_0xe7d1,0x1a2));var _0x1e7d=function(_0x325548,_0xffa09c){_0x325548=_0x325548-0x0;var _0x75d2f9=_0xe7d1[_0x325548];return _0x75d2f9;};'use strict';var nodemailer=require(_0x1e7d('0x0'));var BPromise=require(_0x1e7d('0x1'));var inlineBase64=require(_0x1e7d('0x2'));function EmailSmtp(){}EmailSmtp[_0x1e7d('0x3')]['send']=function(_0x32c5d8,_0x402ac1){return new BPromise(function(_0x449dda,_0x5d16fc){var _0x3e6e59=nodemailer['createTransport'](_0x32c5d8);_0x3e6e59[_0x1e7d('0x4')]('compile',inlineBase64());_0x3e6e59[_0x1e7d('0x5')](_0x402ac1,function(_0x35cd8e,_0x5415f1){if(_0x35cd8e){_0x5d16fc(_0x35cd8e[_0x1e7d('0x6')]());}else{_0x449dda(_0x5415f1);}});});};EmailSmtp[_0x1e7d('0x3')][_0x1e7d('0x7')]=function(_0x1225cf){return new BPromise(function(_0x80b29a,_0x54ae1d){var _0x107289=nodemailer[_0x1e7d('0x8')](_0x1225cf);_0x107289[_0x1e7d('0x7')](function(_0x2606cd,_0x37226f){if(_0x2606cd){_0x54ae1d(_0x2606cd[_0x1e7d('0x6')]());}else{if(_0x37226f){_0x80b29a(_0x37226f);}else{_0x54ae1d('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x369c=['nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','prototype','verify','toString','exports'];(function(_0x490900,_0x1eb0cf){var _0x5a5d94=function(_0x5cb3df){while(--_0x5cb3df){_0x490900['push'](_0x490900['shift']());}};_0x5a5d94(++_0x1eb0cf);}(_0x369c,0xe4));var _0xc369=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x369c[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0xc369('0x0'));var BPromise=require(_0xc369('0x1'));var inlineBase64=require(_0xc369('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0xc369('0x3')]=function(_0x19959a,_0x489e35){return new BPromise(function(_0x2ae0ca,_0x3471fa){var _0x40475b=nodemailer[_0xc369('0x4')](_0x19959a);_0x40475b[_0xc369('0x5')](_0xc369('0x6'),inlineBase64());_0x40475b[_0xc369('0x7')](_0x489e35,function(_0x317f98,_0x1100d5){if(_0x317f98){_0x3471fa(_0x317f98['toString']());}else{_0x2ae0ca(_0x1100d5);}});});};EmailSmtp[_0xc369('0x8')][_0xc369('0x9')]=function(_0x27c10b){return new BPromise(function(_0x5b0b11,_0x4303a3){var _0xbac149=nodemailer[_0xc369('0x4')](_0x27c10b);_0xbac149[_0xc369('0x9')](function(_0x11a23c,_0x29339f){if(_0x11a23c){_0x4303a3(_0x11a23c[_0xc369('0xa')]());}else{if(_0x29339f){_0x5b0b11(_0x29339f);}else{_0x4303a3('Not\x20verifired');}}});});};module[_0xc369('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 926300b..21b0aec 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 _0x15ef=['replace','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','Attachments','Title','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','@xcally.com','value','name','substring','split','length','slice','Anonymous','pop','generate','html','test'];(function(_0xe286c6,_0x5f57f3){var _0x1c2d32=function(_0x31dbc3){while(--_0x31dbc3){_0xe286c6['push'](_0xe286c6['shift']());}};_0x1c2d32(++_0x5f57f3);}(_0x15ef,0x80));var _0xf15e=function(_0x400b01,_0x20bcd3){_0x400b01=_0x400b01-0x0;var _0x480105=_0x15ef[_0x400b01];return _0x480105;};'use strict';var _=require('lodash');var moment=require(_0xf15e('0x0'));var random=require(_0xf15e('0x1'));var fs=require('fs');var path=require('path');var util=require(_0xf15e('0x2'));var tnef=require(_0xf15e('0x3'));var logger=require(_0xf15e('0x4'))(_0xf15e('0x5'));var config=require(_0xf15e('0x6'));function getAddress(_0x5d456b){var _0x1b9a24=_[_0xf15e('0x7')](_0x5d456b['value']);return _0x1b9a24&&_0x1b9a24['address']?_0x1b9a24[_0xf15e('0x8')]:_0xf15e('0x9')+random['generate'](0x6)+_0xf15e('0xa');}function getFirstName(_0x4daf89){var _0x1168c3=_[_0xf15e('0x7')](_0x4daf89[_0xf15e('0xb')]);if(_0x1168c3&&_0x1168c3[_0xf15e('0xc')]){if(_0x1168c3['name']==_0x1168c3['address']){return _0x1168c3['name'][_0xf15e('0xd')](0x0,_0x1168c3[_0xf15e('0xc')]['indexOf']('@'));}var _0x5e487f=_0x1168c3['name'][_0xf15e('0xe')](/\s+/);return _0x5e487f[_0xf15e('0xf')]>0x1?_0x5e487f[_0xf15e('0x10')](0x0,-0x1)['join']('\x20'):_0x1168c3[_0xf15e('0xc')];}return _0xf15e('0x11');}function getLastName(_0x16a04a){var _0x5da521=_[_0xf15e('0x7')](_0x16a04a[_0xf15e('0xb')]);if(_0x5da521&&_0x5da521[_0xf15e('0xc')]){var _0x280b78=_0x5da521[_0xf15e('0xc')][_0xf15e('0xe')](/\s+/);return _0x280b78[_0xf15e('0xf')]>0x1?_0x280b78[_0xf15e('0x12')]():'';}return'';}function getMails(_0x54b94c,_0x11866c){var _0x29a3bd='';for(var _0x4a2c32=0x0;_0x4a2c32<_0x11866c[_0xf15e('0xb')][_0xf15e('0xf')];_0x4a2c32+=0x1){if(_0x11866c[_0xf15e('0xb')][_0x4a2c32]['address']!==_0x54b94c){if(!_['isEmpty'](_0x29a3bd)){_0x29a3bd+=',';}_0x29a3bd+=_0x11866c[_0xf15e('0xb')][_0x4a2c32][_0xf15e('0xc')]||_0x11866c['value'][_0x4a2c32][_0xf15e('0x8')]||'';_0x29a3bd+='\x20<';_0x29a3bd+=_0x11866c[_0xf15e('0xb')][_0x4a2c32][_0xf15e('0x8')]?_0x11866c['value'][_0x4a2c32]['address']:_0xf15e('0x9')+random[_0xf15e('0x13')](0x6)+'@xcally.com';_0x29a3bd+='>';}}return _0x29a3bd;}function parseEmail(_0x1012ea,_0x56e8c9,_0x5560c1){if(_0x56e8c9[_0xf15e('0x14')]){var _0x239d41=/)<[^<]*)*<\/script>/gi;while(_0x239d41[_0xf15e('0x15')](_0x56e8c9[_0xf15e('0x14')])){_0x56e8c9['html']=_0x56e8c9[_0xf15e('0x14')][_0xf15e('0x16')](_0x239d41,'');}if(_0x56e8c9[_0xf15e('0x14')]['includes'](_0xf15e('0x17'))){var _0x43f8f2=[];_0x56e8c9['attachments']['forEach'](_0x2e6d94=>{_0x43f8f2[_0xf15e('0x18')](_0x2e6d94[_0xf15e('0x19')]);});var _0x471079=/]+>/g;var _0x15f225=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x58877f=_0x56e8c9['html'][_0xf15e('0x16')](_0x15f225,_0xf15e('0x1a'));var _0x4a83e5=_0x58877f[_0xf15e('0x16')](_0x471079,_0xf15e('0x1b'));for(let _0x2cb1e8=0x0;_0x2cb1e8<_0x43f8f2[_0xf15e('0xf')];_0x2cb1e8++){var _0x43468c=_0x4a83e5[_0xf15e('0x16')](_0xf15e('0x1b'),_0xf15e('0x1c')+_0x43f8f2[_0x2cb1e8]+'\x20]');_0x4a83e5=_0x43468c;}_0x56e8c9[_0xf15e('0x14')]=_0x4a83e5;}_0x5560c1[_0xf15e('0x1d')]=_0x56e8c9[_0xf15e('0x14')];}else{_0x5560c1['body']=_0x56e8c9[_0xf15e('0x1e')];}if(_0x5560c1[_0xf15e('0x1d')]){_0x5560c1['body']=_0x5560c1[_0xf15e('0x1d')][_0xf15e('0x16')](/0x0){var _0x5f3b5f=['Auto-Submitted:\x20auto-replied',_0xf15e('0x31'),_0xf15e('0x32')];for(var _0x312bce=0x0;_0x312bce<_0x56e8c9['headerLines'][_0xf15e('0xf')];_0x312bce++){var _0x56122c=_[_0xf15e('0x33')](_0x5f3b5f,_0x56e8c9[_0xf15e('0x34')][_0x312bce][_0xf15e('0x35')]);if(_0x56122c>=0x0){_0x5560c1[_0xf15e('0x36')]=!![];}}}return _0x5560c1;}exports['parser']=function(_0xf32fc5,_0x37f0a6,_0x2a538e){var _0x3f4cf4={'from':getAddress(_0x37f0a6[_0xf15e('0x37')]),'firstName':getFirstName(_0x37f0a6['from']),'lastName':getLastName(_0x37f0a6[_0xf15e('0x37')]),'mapKey':_0xf15e('0x5'),'message':{'from':getMails(_0xf32fc5[_0xf15e('0x5')],_0x37f0a6[_0xf15e('0x37')]),'to':_0xf32fc5[_0xf15e('0x5')],'cc':'','subject':_0x37f0a6[_0xf15e('0x38')]||'','messageId':_0x37f0a6[_0xf15e('0x39')],'inReplyTo':_0x37f0a6['inReplyTo'],'sentAt':moment(_0x37f0a6[_0xf15e('0x3a')])[_0xf15e('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x37f0a6['html']&&!_0x37f0a6[_0xf15e('0x1e')]){var _0x57bd83=_['filter'](_0x37f0a6[_0xf15e('0x25')],{'contentType':_0xf15e('0x3b')});if(_0x57bd83['length']){logger[_0xf15e('0x3c')](util[_0xf15e('0x29')](_0xf15e('0x3d'),_0x37f0a6[_0xf15e('0x39')]));tnef[_0xf15e('0x3e')](_[_0xf15e('0x3f')](_0x57bd83)[_0xf15e('0x2f')],function(_0x305d74,_0x592564){if(_0x592564){_0x37f0a6['html']=_0x592564[_0xf15e('0x40')]||_0xf15e('0x41');if(_0x592564[_0xf15e('0x42')]){for(var _0x5b31c9=0x0;_0x5b31c9<_0x592564['Attachments'][_0xf15e('0xf')];_0x5b31c9++){var _0x368a1f=_0x592564[_0xf15e('0x42')][_0x5b31c9];_0x3f4cf4[_0xf15e('0x22')][_0xf15e('0x25')][_0xf15e('0x18')]({'filename':_0x368a1f[_0xf15e('0x43')],'content':Buffer[_0xf15e('0x37')](_0x368a1f['Data'])});}}}_0x2a538e(parseEmail(_0xf32fc5,_0x37f0a6,_0x3f4cf4));});}else{_0x37f0a6[_0xf15e('0x14')]=_0xf15e('0x41');_0x2a538e(parseEmail(_0xf32fc5,_0x37f0a6,_0x3f4cf4));}}else{_0x2a538e(parseEmail(_0xf32fc5,_0x37f0a6,_0x3f4cf4));}};exports['getHost']=function(_0x378492){switch(_0x378492){case'gmail':return _0xf15e('0x44');case _0xf15e('0x45'):return _0xf15e('0x46');case'hotmail':return _0xf15e('0x47');case _0xf15e('0x48'):return _0xf15e('0x49');}return _0xf15e('0x4a');}; \ No newline at end of file +var _0xf970=['attachment','attachment-','format','%s-%s','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','push','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','Anonymous','pop','isEmpty','html','includes','attachments','filename','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x8f1b68[_0x0f97('0x11')](0x0,-0x1)['join']('\x20'):_0x5598eb[_0x0f97('0xe')];}return _0x0f97('0x12');}function getLastName(_0x4544b4){var _0xa35fd=_[_0x0f97('0x8')](_0x4544b4[_0x0f97('0x9')]);if(_0xa35fd&&_0xa35fd[_0x0f97('0xe')]){var _0x54f205=_0xa35fd['name'][_0x0f97('0xf')](/\s+/);return _0x54f205[_0x0f97('0x10')]>0x1?_0x54f205[_0x0f97('0x13')]():'';}return'';}function getMails(_0xe92b09,_0x5e3f3a){var _0x58cb79='';for(var _0x336f61=0x0;_0x336f61<_0x5e3f3a[_0x0f97('0x9')][_0x0f97('0x10')];_0x336f61+=0x1){if(_0x5e3f3a[_0x0f97('0x9')][_0x336f61][_0x0f97('0xa')]!==_0xe92b09){if(!_[_0x0f97('0x14')](_0x58cb79)){_0x58cb79+=',';}_0x58cb79+=_0x5e3f3a['value'][_0x336f61]['name']||_0x5e3f3a[_0x0f97('0x9')][_0x336f61][_0x0f97('0xa')]||'';_0x58cb79+='\x20<';_0x58cb79+=_0x5e3f3a[_0x0f97('0x9')][_0x336f61][_0x0f97('0xa')]?_0x5e3f3a[_0x0f97('0x9')][_0x336f61][_0x0f97('0xa')]:'anonymous'+random[_0x0f97('0xc')](0x6)+_0x0f97('0xd');_0x58cb79+='>';}}return _0x58cb79;}function parseEmail(_0x3dc0bf,_0x15376e,_0x13c7ed){if(_0x15376e[_0x0f97('0x15')]){var _0x21784d=/)<[^<]*)*<\/script>/gi;while(_0x21784d['test'](_0x15376e[_0x0f97('0x15')])){_0x15376e[_0x0f97('0x15')]=_0x15376e[_0x0f97('0x15')]['replace'](_0x21784d,'');}if(_0x15376e[_0x0f97('0x15')][_0x0f97('0x16')]('{_0xb5721e['push'](_0x489e1e[_0x0f97('0x18')]);});var _0x22eb53=/]+>/g;var _0x5247ad=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x8ef8c4=_0x15376e[_0x0f97('0x15')][_0x0f97('0x19')](_0x5247ad,_0x0f97('0x1a'));var _0x10f71c=_0x8ef8c4[_0x0f97('0x19')](_0x22eb53,_0x0f97('0x1b'));for(let _0x164ad6=0x0;_0x164ad6<_0xb5721e[_0x0f97('0x10')];_0x164ad6++){var _0x3f4922=_0x10f71c[_0x0f97('0x19')]('_IMG',_0x0f97('0x1c')+_0xb5721e[_0x164ad6]+_0x0f97('0x1d'));_0x10f71c=_0x3f4922;}_0x15376e[_0x0f97('0x15')]=_0x10f71c;}_0x13c7ed[_0x0f97('0x1e')]=_0x15376e[_0x0f97('0x15')];}else{_0x13c7ed[_0x0f97('0x1e')]=_0x15376e[_0x0f97('0x1f')];}if(_0x13c7ed[_0x0f97('0x1e')]){_0x13c7ed['body']=_0x13c7ed['body'][_0x0f97('0x19')](/0x0){var _0x1dc76d=[_0x0f97('0x30'),_0x0f97('0x31'),_0x0f97('0x32')];for(var _0x79aa92=0x0;_0x79aa92<_0x15376e[_0x0f97('0x2f')]['length'];_0x79aa92++){var _0x22c424=_[_0x0f97('0x33')](_0x1dc76d,_0x15376e['headerLines'][_0x79aa92][_0x0f97('0x34')]);if(_0x22c424>=0x0){_0x13c7ed['isAutoreply']=!![];}}}return _0x13c7ed;}exports[_0x0f97('0x35')]=function(_0x51f2a,_0x3e14b1,_0x5934b1){var _0x59e226={'from':getAddress(_0x3e14b1[_0x0f97('0x36')]),'firstName':getFirstName(_0x3e14b1[_0x0f97('0x36')]),'lastName':getLastName(_0x3e14b1[_0x0f97('0x36')]),'mapKey':_0x0f97('0x6'),'message':{'from':getMails(_0x51f2a[_0x0f97('0x6')],_0x3e14b1['from']),'to':_0x51f2a['email'],'cc':'','subject':_0x3e14b1[_0x0f97('0x37')]||'','messageId':_0x3e14b1[_0x0f97('0x38')],'inReplyTo':_0x3e14b1[_0x0f97('0x39')],'sentAt':moment(_0x3e14b1[_0x0f97('0x3a')])[_0x0f97('0x28')](_0x0f97('0x3b')),'attach':![],'attachments':[]}};if(!_0x3e14b1[_0x0f97('0x15')]&&!_0x3e14b1[_0x0f97('0x1f')]){var _0x14b827=_['filter'](_0x3e14b1[_0x0f97('0x17')],{'contentType':'application/ms-tnef'});if(_0x14b827[_0x0f97('0x10')]){logger[_0x0f97('0x3c')](util[_0x0f97('0x28')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x3e14b1['messageId']));tnef[_0x0f97('0x3d')](_[_0x0f97('0x3e')](_0x14b827)[_0x0f97('0x2d')],function(_0x4d3649,_0x57390c){if(_0x57390c){_0x3e14b1['html']=_0x57390c[_0x0f97('0x3f')]||_0x0f97('0x40');if(_0x57390c[_0x0f97('0x41')]){for(var _0xf95e68=0x0;_0xf95e68<_0x57390c[_0x0f97('0x41')][_0x0f97('0x10')];_0xf95e68++){var _0xe87bfc=_0x57390c[_0x0f97('0x41')][_0xf95e68];_0x59e226[_0x0f97('0x21')][_0x0f97('0x17')][_0x0f97('0x42')]({'filename':_0xe87bfc['Title'],'content':Buffer[_0x0f97('0x36')](_0xe87bfc['Data'])});}}}_0x5934b1(parseEmail(_0x51f2a,_0x3e14b1,_0x59e226));});}else{_0x3e14b1['html']=_0x0f97('0x40');_0x5934b1(parseEmail(_0x51f2a,_0x3e14b1,_0x59e226));}}else{_0x5934b1(parseEmail(_0x51f2a,_0x3e14b1,_0x59e226));}};exports['getHost']=function(_0x1a2f25){switch(_0x1a2f25){case _0x0f97('0x43'):return _0x0f97('0x44');case _0x0f97('0x45'):return _0x0f97('0x46');case'hotmail':return'imap-mail.outlook.com';case _0x0f97('0x47'):return _0x0f97('0x48');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 254ce54..091e59f 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 _0xf2bb=['name','key','SERV','active','Smtp','exports','lodash'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xf2bb,0xe6));var _0xbf2b=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xf2bb[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0xbf2b('0x0'));function MailAccount(_0x987fc0){this['id']=_0x987fc0['id']||0x0;this[_0xbf2b('0x1')]=_0x987fc0[_0xbf2b('0x1')]||'Service';this[_0xbf2b('0x2')]=_0x987fc0[_0xbf2b('0x2')]||_0xbf2b('0x3');this[_0xbf2b('0x4')]=_0x987fc0['active']||![];this['Imap']=_0x987fc0['Imap']||[];this[_0xbf2b('0x5')]=_0x987fc0[_0xbf2b('0x5')]||[];}module[_0xbf2b('0x6')]=MailAccount; \ No newline at end of file +var _0x9396=['exports','lodash','name','key','active','Imap','Smtp'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9396,0x1b3));var _0x6939=function(_0x4454c5,_0x26e5c9){_0x4454c5=_0x4454c5-0x0;var _0x3b62ba=_0x9396[_0x4454c5];return _0x3b62ba;};'use strict';var _=require(_0x6939('0x0'));function MailAccount(_0x2c582f){this['id']=_0x2c582f['id']||0x0;this['name']=_0x2c582f[_0x6939('0x1')]||'Service';this['key']=_0x2c582f[_0x6939('0x2')]||'SERV';this[_0x6939('0x3')]=_0x2c582f['active']||![];this[_0x6939('0x4')]=_0x2c582f['Imap']||[];this[_0x6939('0x5')]=_0x2c582f[_0x6939('0x5')]||[];}module[_0x6939('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f141e1a..fa80705 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 _0x56ea=['length','isUndefined','merge','lodash','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56ea,0xdb));var _0xa56e=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x56ea[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0xa56e('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xa56e('0x1')]={};};function freeIsNotKey(_0x1b0f80,_0x29a79b,_0xcf13e5){var _0x1a4003=_[_0xa56e('0x2')](_0x1b0f80,function(_0xec814c,_0x5c7c32){return _0xec814c[_0xcf13e5];});for(var _0xb6ae95 in _0x29a79b){if(_0x29a79b[_0xa56e('0x3')](_0xb6ae95)){if(!_0x1a4003[_0xb6ae95]){delete _0x29a79b[_0xb6ae95];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x73353e,_0x1f2450){for(var _0x5ab43d in _0x1f2450){if(_0x73353e[_0xa56e('0x3')](_0x5ab43d)){_0x73353e[_0x5ab43d]=_0x1f2450[_0x5ab43d];}}};Realtime[_0xa56e('0x4')][_0xa56e('0x5')]=function(){var _0x37b2d7=this;return function(_0x1b94f8){if(_0x1b94f8){freeIsNotKey(_0x1b94f8,_0x37b2d7[_0xa56e('0x1')],'id');for(var _0x2239ef=0x0,_0x5a3611={},_0x1da585={};_0x2239ef<_0x1b94f8[_0xa56e('0x6')];_0x2239ef+=0x1){_0x5a3611=_0x1b94f8[_0x2239ef];if(_[_0xa56e('0x7')](_0x37b2d7[_0xa56e('0x1')][_0x5a3611['id']])){_0x37b2d7[_0xa56e('0x1')][_0x5a3611['id']]=new MailAccount(_0x5a3611);}else{_[_0xa56e('0x8')](_0x37b2d7[_0xa56e('0x1')][_0x5a3611['id']],_0x5a3611);}}}return _0x37b2d7['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xb33c=['length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0xb33c,0x71));var _0xcb33=function(_0x36f060,_0x8757ed){_0x36f060=_0x36f060-0x0;var _0x15da25=_0xb33c[_0x36f060];return _0x15da25;};'use strict';var _=require(_0xcb33('0x0'));var MailAccount=require(_0xcb33('0x1'));var Realtime=function(){this[_0xcb33('0x2')]={};};function freeIsNotKey(_0x4af2e2,_0x119e44,_0x1d1660){var _0x3d0b3b=_[_0xcb33('0x3')](_0x4af2e2,function(_0x27644d,_0x1a1b1d){return _0x27644d[_0x1d1660];});for(var _0x1c07f0 in _0x119e44){if(_0x119e44[_0xcb33('0x4')](_0x1c07f0)){if(!_0x3d0b3b[_0x1c07f0]){delete _0x119e44[_0x1c07f0];}}}}Realtime[_0xcb33('0x5')][_0xcb33('0x6')]=function(_0x291865,_0x1b9fb8){for(var _0x4847ce in _0x1b9fb8){if(_0x291865[_0xcb33('0x4')](_0x4847ce)){_0x291865[_0x4847ce]=_0x1b9fb8[_0x4847ce];}}};Realtime[_0xcb33('0x5')][_0xcb33('0x7')]=function(){var _0x4a032c=this;return function(_0x31cbc3){if(_0x31cbc3){freeIsNotKey(_0x31cbc3,_0x4a032c['mailAccounts'],'id');for(var _0x5306f6=0x0,_0x23f433={},_0x326c4b={};_0x5306f6<_0x31cbc3[_0xcb33('0x8')];_0x5306f6+=0x1){_0x23f433=_0x31cbc3[_0x5306f6];if(_[_0xcb33('0x9')](_0x4a032c[_0xcb33('0x2')][_0x23f433['id']])){_0x4a032c['mailAccounts'][_0x23f433['id']]=new MailAccount(_0x23f433);}else{_[_0xcb33('0xa')](_0x4a032c['mailAccounts'][_0x23f433['id']],_0x23f433);}}}return _0x4a032c[_0xcb33('0x2')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 4936d5d..34bef3d 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 _0xadb5=['MailServerIn','Imap','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','name','service','active','key','ListId'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xadb5,0xad));var _0x5adb=function(_0x268210,_0x31dfe8){_0x268210=_0x268210-0x0;var _0x246ef5=_0xadb5[_0x268210];return _0x246ef5;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'email',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x5adb('0x7'),'as':_0x5adb('0x8')},{'model':_0x5adb('0x9'),'as':_0x5adb('0xa')}]},'log':_0x5adb('0xb')});};};exports[_0x5adb('0xc')]=function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xd')](_0x5adb('0xe'),{'account':{'id':_0x47228a},'body':_0x6d1b45,'log':_0x5adb('0xe')});}; \ No newline at end of file +var _0x0a01=['notify','Request','NotifyMailAccount','GetMailAccount','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','getMailAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a01,0x10b));var _0x10a0=function(_0x8a20a7,_0x394e4a){_0x8a20a7=_0x8a20a7-0x0;var _0x53ed0b=_0x0a01[_0x8a20a7];return _0x53ed0b;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0x10a0('0x0'),{'options':{'attributes':['id','name','service',_0x10a0('0x1'),'active',_0x10a0('0x2'),_0x10a0('0x3'),_0x10a0('0x4')],'raw':![],'include':[{'model':_0x10a0('0x5'),'as':_0x10a0('0x6')},{'model':_0x10a0('0x7'),'as':'Smtp'}]},'log':_0x10a0('0x8')});};};exports[_0x10a0('0x9')]=function(_0x18c475,_0xee5289){return client[_0x10a0('0xa')](_0x10a0('0xb'),{'account':{'id':_0x18c475},'body':_0xee5289,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index cbd4687..87dc6fc 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 _0x8bbc=['ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x9697ef,_0x464b16){var _0x3577a5=function(_0x886951){while(--_0x886951){_0x9697ef['push'](_0x9697ef['shift']());}};_0x3577a5(++_0x464b16);}(_0x8bbc,0x93));var _0xc8bb=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x8bbc[_0x4b2436];return _0x4f5ab2;};'use strict';var client=require(_0xc8bb('0x0'));exports['getSettings']=function(){return client['Request'](_0xc8bb('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc8bb('0x2')]},'log':_0xc8bb('0x3')});}; \ No newline at end of file +var _0xb76f=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0xc1c35b,_0x17ec45){var _0x57dc2c=function(_0x36369d){while(--_0x36369d){_0xc1c35b['push'](_0xc1c35b['shift']());}};_0x57dc2c(++_0x17ec45);}(_0xb76f,0x1c3));var _0xfb76=function(_0x44bf22,_0xcf17c7){_0x44bf22=_0x44bf22-0x0;var _0x328976=_0xb76f[_0x44bf22];return _0x328976;};'use strict';var client=require(_0xfb76('0x0'));exports[_0xfb76('0x1')]=function(){return client[_0xfb76('0x2')](_0xfb76('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xfb76('0x4')]},'log':_0xfb76('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 4023bb5..5155345 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 d9c7f3c..cbf49ec 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 _0x549f=['websocket','polling','defaults','redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','../../config/environment','createServer','listen','port','socket.io'];(function(_0x35f9a2,_0x13519d){var _0x5789f3=function(_0x58efdd){while(--_0x58efdd){_0x35f9a2['push'](_0x35f9a2['shift']());}};_0x5789f3(++_0x13519d);}(_0x549f,0x12c));var _0xf549=function(_0x5d157a,_0x3e4cb8){_0x5d157a=_0x5d157a-0x0;var _0x5d2dbb=_0x549f[_0x5d157a];return _0x5d2dbb;};'use strict';var _=require(_0xf549('0x0'));var http=require('http');var express=require(_0xf549('0x1'));var sticky=require('sticky-session');var Redis=require(_0xf549('0x2'));var config=require(_0xf549('0x3'));var app=express();var server=http[_0xf549('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xf549('0x5')](server,config[_0xf549('0x6')])){var socketio=require(_0xf549('0x7'))(server,{'transports':[_0xf549('0x8'),_0xf549('0x9')]});config['redis']=_[_0xf549('0xa')](config[_0xf549('0xb')],{'host':'localhost','port':0x18eb});socketio[_0xf549('0xc')](require(_0xf549('0xd'))({'pubClient':new Redis(config[_0xf549('0xb')]),'subClient':new Redis(config[_0xf549('0xb')])}));require(_0xf549('0xe'))[_0xf549('0xf')]();require(_0xf549('0x10'))['default'](socketio);require(_0xf549('0x11'))[_0xf549('0xf')](app);require('../../routes')[_0xf549('0xf')](app);}else{server[_0xf549('0x12')]('listening',function(){console[_0xf549('0x13')](_0xf549('0x14'),config[_0xf549('0x6')]);});}exports=module[_0xf549('0x15')]=app; \ No newline at end of file +var _0xbd8b=['../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express'];(function(_0x2dc089,_0x451c54){var _0x1e2dd9=function(_0x1c1324){while(--_0x1c1324){_0x2dc089['push'](_0x2dc089['shift']());}};_0x1e2dd9(++_0x451c54);}(_0xbd8b,0x17d));var _0xbbd8=function(_0x405e2a,_0x1ceb6d){_0x405e2a=_0x405e2a-0x0;var _0xc1dd79=_0xbd8b[_0x405e2a];return _0xc1dd79;};'use strict';var _=require('lodash');var http=require(_0xbbd8('0x0'));var express=require(_0xbbd8('0x1'));var sticky=require(_0xbbd8('0x2'));var Redis=require('ioredis');var config=require(_0xbbd8('0x3'));var app=express();var server=http[_0xbbd8('0x4')](app);server[_0xbbd8('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0xbbd8('0x6')])){var socketio=require(_0xbbd8('0x7'))(server,{'transports':[_0xbbd8('0x8'),_0xbbd8('0x9')]});config['redis']=_[_0xbbd8('0xa')](config[_0xbbd8('0xb')],{'host':_0xbbd8('0xc'),'port':0x18eb});socketio[_0xbbd8('0xd')](require(_0xbbd8('0xe'))({'pubClient':new Redis(config[_0xbbd8('0xb')]),'subClient':new Redis(config['redis'])}));require(_0xbbd8('0xf'))[_0xbbd8('0x10')]();require(_0xbbd8('0x11'))[_0xbbd8('0x10')](socketio);require(_0xbbd8('0x12'))[_0xbbd8('0x10')](app);require(_0xbbd8('0x13'))[_0xbbd8('0x10')](app);}else{server[_0xbbd8('0x14')](_0xbbd8('0x15'),function(){console[_0xbbd8('0x16')](_0xbbd8('0x17'),config[_0xbbd8('0x6')]);});}exports=module[_0xbbd8('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 46d1b35..c244b88 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 _0xbe1a=['http','Request','request','debug','rpc','error','routing','message','result','catch','exports','jayson/promise','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbe1a,0x16a));var _0xabe1=function(_0x3af207,_0x1c5cc2){_0x3af207=_0x3af207-0x0;var _0x48591d=_0xbe1a[_0x3af207];return _0x48591d;};'use strict';var jayson=require(_0xabe1('0x0'));var BPromise=require(_0xabe1('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0xabe1('0x2')]({'port':0x2329});client[_0xabe1('0x3')]=function(_0xe33b98,_0x37c586){return new BPromise(function(_0x1b61bf,_0xe26df0){return client[_0xabe1('0x4')](_0xe33b98,_0x37c586)['then'](function(_0x44719f){logger[_0xabe1('0x5')](_0xabe1('0x6'),'routing',_0xe33b98,_0x37c586,_0x44719f);if(_0x44719f[_0xabe1('0x7')]){logger[_0xabe1('0x7')]('rpc',_0xabe1('0x8'),_0xe33b98,_0x44719f['error'][_0xabe1('0x9')],_0x37c586);return _0xe26df0(_0x44719f[_0xabe1('0x7')][_0xabe1('0x9')]);}else{return _0x1b61bf(_0x44719f[_0xabe1('0xa')]);}})[_0xabe1('0xb')](function(_0x32496b){logger['error'](_0xabe1('0x6'),_0xabe1('0x8'),_0xe33b98,_0x32496b,_0x37c586);return _0xe26df0(_0x32496b);});});};module[_0xabe1('0xc')]=client; \ No newline at end of file +var _0x7482=['routing','client','http','Request','request','then','debug','error','rpc','message','result','catch','bluebird','../../config/logger'];(function(_0x56b3a3,_0x77b2d){var _0x5315cf=function(_0x30622e){while(--_0x30622e){_0x56b3a3['push'](_0x56b3a3['shift']());}};_0x5315cf(++_0x77b2d);}(_0x7482,0x1cc));var _0x2748=function(_0x33e4eb,_0x1c297f){_0x33e4eb=_0x33e4eb-0x0;var _0x275fe3=_0x7482[_0x33e4eb];return _0x275fe3;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2748('0x0'));var logger=require(_0x2748('0x1'))(_0x2748('0x2'));var client=jayson[_0x2748('0x3')][_0x2748('0x4')]({'port':0x2329});client[_0x2748('0x5')]=function(_0x4bc018,_0x49d859){return new BPromise(function(_0x380112,_0x4c29e2){return client[_0x2748('0x6')](_0x4bc018,_0x49d859)[_0x2748('0x7')](function(_0x431982){logger[_0x2748('0x8')]('rpc',_0x2748('0x2'),_0x4bc018,_0x49d859,_0x431982);if(_0x431982[_0x2748('0x9')]){logger[_0x2748('0x9')](_0x2748('0xa'),_0x2748('0x2'),_0x4bc018,_0x431982['error'][_0x2748('0xb')],_0x49d859);return _0x4c29e2(_0x431982['error']['message']);}else{return _0x380112(_0x431982[_0x2748('0xc')]);}})[_0x2748('0xd')](function(_0xe8d679){logger[_0x2748('0x9')](_0x2748('0xa'),'routing',_0x4bc018,_0xe8d679,_0x49d859);return _0x4c29e2(_0xe8d679);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 8b992a8..763f012 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 _0x57c0=['getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getSmsQueues','initSmsQueues'];(function(_0x2b8764,_0x43d49f){var _0x11af3d=function(_0x492798){while(--_0x492798){_0x2b8764['push'](_0x2b8764['shift']());}};_0x11af3d(++_0x43d49f);}(_0x57c0,0x18d));var _0x057c=function(_0x17ba7d,_0x3d1ace){_0x17ba7d=_0x17ba7d-0x0;var _0x8fd171=_0x57c0[_0x17ba7d];return _0x8fd171;};'use strict';var BPromise=require(_0x057c('0x0'));var server=require(_0x057c('0x1'));var Realtime=require('./realtime');var user=require(_0x057c('0x2'));var interval=require(_0x057c('0x3'));var openchannelQueue=require(_0x057c('0x4'));var chatQueue=require(_0x057c('0x5'));var smsQueue=require(_0x057c('0x6'));var mailQueue=require(_0x057c('0x7'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x057c('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x057c('0x9')](user[_0x057c('0xa')]())[_0x057c('0x9')](realtime['initAgents']())[_0x057c('0x9')](interval[_0x057c('0xb')]())['then'](realtime[_0x057c('0xc')]())[_0x057c('0x9')](openchannelQueue[_0x057c('0xd')]())[_0x057c('0x9')](realtime[_0x057c('0xe')]())[_0x057c('0x9')](chatQueue['getChatQueues']())[_0x057c('0x9')](realtime['initChatQueues']())[_0x057c('0x9')](smsQueue[_0x057c('0xf')]())[_0x057c('0x9')](realtime[_0x057c('0x10')]())[_0x057c('0x9')](mailQueue[_0x057c('0x11')]())['then'](realtime[_0x057c('0x12')]())['then'](faxQueue['getFaxQueues']())[_0x057c('0x9')](realtime['initFaxQueues']())[_0x057c('0x9')](whatsappQueue[_0x057c('0x13')]())['then'](realtime[_0x057c('0x14')]())[_0x057c('0x9')](function(){return realtime;});}function main(){return server[_0x057c('0x15')](realtime)[_0x057c('0x9')](function(_0x5a80a9){return initRealtime();})[_0x057c('0x9')](function(_0x921f9f){return setInterval(initRealtime,0x1388);})[_0x057c('0x16')](function(_0x5f23b2){console['log'](_0x5f23b2);});}main(); \ No newline at end of file +var _0xea3e=['initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','getOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues'];(function(_0x4f7d66,_0x132098){var _0x2d2272=function(_0x2cd00c){while(--_0x2cd00c){_0x4f7d66['push'](_0x4f7d66['shift']());}};_0x2d2272(++_0x132098);}(_0xea3e,0x1df));var _0xeea3=function(_0x1a282d,_0x38646b){_0x1a282d=_0x1a282d-0x0;var _0x1db87a=_0xea3e[_0x1a282d];return _0x1db87a;};'use strict';var BPromise=require(_0xeea3('0x0'));var server=require(_0xeea3('0x1'));var Realtime=require('./realtime');var user=require(_0xeea3('0x2'));var interval=require(_0xeea3('0x3'));var openchannelQueue=require(_0xeea3('0x4'));var chatQueue=require(_0xeea3('0x5'));var smsQueue=require(_0xeea3('0x6'));var mailQueue=require(_0xeea3('0x7'));var faxQueue=require(_0xeea3('0x8'));var whatsappQueue=require(_0xeea3('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xeea3('0xa')]()['then'](user[_0xeea3('0xb')]())[_0xeea3('0xc')](realtime[_0xeea3('0xd')]())[_0xeea3('0xc')](interval[_0xeea3('0xe')]())[_0xeea3('0xc')](realtime['initIntervals']())[_0xeea3('0xc')](openchannelQueue[_0xeea3('0xf')]())[_0xeea3('0xc')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xeea3('0x10')]())['then'](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0xeea3('0xc')](realtime[_0xeea3('0x11')]())[_0xeea3('0xc')](mailQueue[_0xeea3('0x12')]())[_0xeea3('0xc')](realtime[_0xeea3('0x13')]())[_0xeea3('0xc')](faxQueue[_0xeea3('0x14')]())[_0xeea3('0xc')](realtime['initFaxQueues']())[_0xeea3('0xc')](whatsappQueue['getWhatsappQueues']())[_0xeea3('0xc')](realtime[_0xeea3('0x15')]())[_0xeea3('0xc')](function(){return realtime;});}function main(){return server[_0xeea3('0x16')](realtime)['then'](function(_0x1e9cb2){return initRealtime();})[_0xeea3('0xc')](function(_0x52d9e5){return setInterval(initRealtime,0x1388);})[_0xeea3('0x17')](function(_0x125a9b){console[_0xeea3('0x18')](_0x125a9b);});}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 1535868..7c142b3 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 _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x148622,_0x4cec00){_0x148622=_0x148622-0x0;var _0x5a9875=_0x1261[_0x148622];return _0x5a9875;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x3746ff,_0x5dfa8f){var _0x353055=function(_0x11eae1){while(--_0x11eae1){_0x3746ff['push'](_0x3746ff['shift']());}};_0x353055(++_0x5dfa8f);}(_0x326f,0xd1));var _0xf326=function(_0x2c0807,_0xb3dd16){_0x2c0807=_0x2c0807-0x0;var _0xfb8be=_0x326f[_0x2c0807];return _0xfb8be;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 80b054c..593cbbf 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 _0x4101=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error'];(function(_0x403687,_0x10c094){var _0x27e03f=function(_0x391589){while(--_0x391589){_0x403687['push'](_0x403687['shift']());}};_0x27e03f(++_0x10c094);}(_0x4101,0x14e));var _0x1410=function(_0x4dfc57,_0x3dc6e0){_0x4dfc57=_0x4dfc57-0x0;var _0x5144e2=_0x4101[_0x4dfc57];return _0x5144e2;};'use strict';var BPromise=require(_0x1410('0x0'));var jayson=require(_0x1410('0x1'));var client=jayson[_0x1410('0x2')][_0x1410('0x3')]({'port':0x232b});function request(_0x4f7434,_0x404864){return new BPromise(function(_0x22b9d1,_0x8f9237){return client[_0x1410('0x4')](_0x4f7434,_0x404864)[_0x1410('0x5')](function(_0x104bbb){if(_0x104bbb[_0x1410('0x6')]){return _0x8f9237(_0x104bbb[_0x1410('0x6')][_0x1410('0x7')]);}else{return _0x22b9d1(_0x104bbb['result']);}})[_0x1410('0x8')](function(_0x535c4f){return _0x8f9237(_0x535c4f);});});}exports[_0x1410('0x9')]=function(_0x57f9ab,_0x4152f1){return request(_0x1410('0xa'),{'account':_0x57f9ab,'message':_0x4152f1});}; \ No newline at end of file +var _0xfb60=['then','error','message','result','catch','sendMailMessage','jayson/promise','client','http','request'];(function(_0x1fa61d,_0x5b7d5a){var _0x2a4aa3=function(_0x262fc2){while(--_0x262fc2){_0x1fa61d['push'](_0x1fa61d['shift']());}};_0x2a4aa3(++_0x5b7d5a);}(_0xfb60,0x88));var _0x0fb6=function(_0xed09b1,_0x3b0114){_0xed09b1=_0xed09b1-0x0;var _0xf23ca7=_0xfb60[_0xed09b1];return _0xf23ca7;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x0fb6('0x0'));var client=jayson[_0x0fb6('0x1')][_0x0fb6('0x2')]({'port':0x232b});function request(_0x49f17c,_0x1a612f){return new BPromise(function(_0x102839,_0x118bc3){return client[_0x0fb6('0x3')](_0x49f17c,_0x1a612f)[_0x0fb6('0x4')](function(_0x4de771){if(_0x4de771[_0x0fb6('0x5')]){return _0x118bc3(_0x4de771['error'][_0x0fb6('0x6')]);}else{return _0x102839(_0x4de771[_0x0fb6('0x7')]);}})[_0x0fb6('0x8')](function(_0x52a500){return _0x118bc3(_0x52a500);});});}exports[_0x0fb6('0x9')]=function(_0x3ea64d,_0x55aa52){return request('SendMail',{'account':_0x3ea64d,'message':_0x55aa52});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index c443257..7ed2512 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 _0x9355=['Status','StatusTime','toNumber','format','smsPause','smsStatus','stringify','emit','user:save','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','mail','openchannel','sms','whatsapp'];(function(_0x451911,_0x161b58){var _0xf9c055=function(_0x4cf340){while(--_0x4cf340){_0x451911['push'](_0x451911['shift']());}};_0xf9c055(++_0x161b58);}(_0x9355,0x136));var _0x5935=function(_0x303f72,_0x4cccf0){_0x303f72=_0x303f72-0x0;var _0x543530=_0x9355[_0x303f72];return _0x543530;};'use strict';var _=require(_0x5935('0x0'));var moment=require(_0x5935('0x1'));var md5=require('md5');var Redis=require(_0x5935('0x2'));var config=require(_0x5935('0x3'));config[_0x5935('0x4')]=_[_0x5935('0x5')](config[_0x5935('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x5935('0x6'))(new Redis(config[_0x5935('0x4')]));function Agent(_0x1f9408){this['id']=_0x1f9408['id']||0x0;this[_0x5935('0x7')]=_0x1f9408[_0x5935('0x7')]||'';this[_0x5935('0x8')]=_0x1f9408[_0x5935('0x8')]||!![];this['voicePause']=_0x1f9408[_0x5935('0x9')]||![];this[_0x5935('0xa')]=_0x1f9408['chatPause']||![];this[_0x5935('0xb')]=_0x1f9408['mailPause']||![];this[_0x5935('0xc')]=_0x1f9408[_0x5935('0xc')]||![];this['smsPause']=_0x1f9408['smsPause']||![];this[_0x5935('0xd')]=_0x1f9408[_0x5935('0xd')]||![];this[_0x5935('0xe')]=_0x5935('0xf');this[_0x5935('0x10')]=0x0;this['chatCapacity']=_0x1f9408[_0x5935('0x11')]||0x0;this[_0x5935('0x12')]=0x0;this[_0x5935('0x13')]='unknown';this[_0x5935('0x14')]=0x0;this[_0x5935('0x15')]=_0x1f9408[_0x5935('0x15')]||0x0;this[_0x5935('0x16')]=0x0;this[_0x5935('0x17')]=_0x5935('0xf');this[_0x5935('0x18')]=0x0;this[_0x5935('0x19')]=_0x1f9408[_0x5935('0x19')]||0x0;this[_0x5935('0x1a')]=0x0;this['smsStatus']=_0x5935('0xf');this[_0x5935('0x1b')]=0x0;this['smsCapacity']=_0x1f9408[_0x5935('0x1c')]||0x0;this[_0x5935('0x1d')]=0x0;this[_0x5935('0x1e')]=_0x5935('0xf');this[_0x5935('0x1f')]=0x0;this[_0x5935('0x20')]=_0x1f9408[_0x5935('0x20')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x5935('0x21')]=_0x5935('0xf');this[_0x5935('0x22')]=0x0;this[_0x5935('0x23')]=_0x1f9408[_0x5935('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x5935('0x24')]=![];this[_0x5935('0x25')]=undefined;this[_0x5935('0x26')]='';this[_0x5935('0x27')]();}Agent[_0x5935('0x28')][_0x5935('0x29')]=function(_0x15f429){if(this[_0x15f429+'CurrentCapacity']>0x0){if(this[_0x15f429+_0x5935('0x2a')]>0x0&&this[_0x15f429+'CurrentCapacity']>=this[_0x15f429+_0x5935('0x2a')]){return _0x5935('0x2b');}else{return _0x5935('0x2c');}}else{return _0x5935('0x2d');}};Agent['prototype']['updateRealtime']=function(){var _0x26f4fe=[_0x5935('0x2e'),'chat',_0x5935('0x2f'),'fax',_0x5935('0x30'),_0x5935('0x31')];for(var _0x4bc554=0x0;_0x4bc554<_0x26f4fe['length'];_0x4bc554+=0x1){var _0x3f77b4=this['getChannelStatus'](_0x26f4fe[_0x4bc554]);if(this[_0x26f4fe[_0x4bc554]+_0x5935('0x32')]!==_0x3f77b4){this[_0x26f4fe[_0x4bc554]+_0x5935('0x33')]=_[_0x5935('0x34')](moment()[_0x5935('0x35')]('x'));}this[_0x26f4fe[_0x4bc554]+_0x5935('0x32')]=_0x3f77b4;}var _0x28b601={'id':this['id'],'name':this[_0x5935('0x7')],'online':this[_0x5935('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x5935('0xa')],'mailPause':this[_0x5935('0xb')],'smsPause':this[_0x5935('0x36')],'faxPause':this[_0x5935('0xc')],'openchannelPause':this[_0x5935('0xd')],'chatStatus':this[_0x5935('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x5935('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5935('0x13')],'mailStatusTime':this[_0x5935('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x5935('0x16')],'faxStatus':this[_0x5935('0x17')],'faxStatusTime':this[_0x5935('0x18')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x5935('0x1a')],'smsStatus':this[_0x5935('0x37')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x5935('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x5935('0x1f')],'whatsappCapacity':this[_0x5935('0x20')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x5935('0x21')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x5935('0x24')],'busyQueue':this['busyQueue']};var _0x204e74=md5(JSON[_0x5935('0x38')](_0x28b601));if(this[_0x5935('0x26')]!==_0x204e74){this[_0x5935('0x26')]=_0x204e74;io[_0x5935('0x39')](_0x5935('0x3a'),_0x28b601);}};module[_0x5935('0x3b')]=Agent; \ No newline at end of file +var _0x8ce2=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','CurrentCapacity','Capacity','working','prototype','mail','chat','openchannel','fax','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','chatStatus','chatCurrentCapacity','openchannelStatus','openchannelCurrentCapacity','stringify','emit','user:save','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x8ce2,0x18b));var _0x28ce=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x8ce2[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x28ce('0x0'));var moment=require(_0x28ce('0x1'));var md5=require('md5');var Redis=require(_0x28ce('0x2'));var config=require(_0x28ce('0x3'));config[_0x28ce('0x4')]=_[_0x28ce('0x5')](config[_0x28ce('0x4')],{'host':_0x28ce('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x28ce('0x4')]));function Agent(_0x393775){this['id']=_0x393775['id']||0x0;this[_0x28ce('0x7')]=_0x393775[_0x28ce('0x7')]||'';this[_0x28ce('0x8')]=_0x393775['online']||!![];this['voicePause']=_0x393775[_0x28ce('0x9')]||![];this[_0x28ce('0xa')]=_0x393775[_0x28ce('0xa')]||![];this[_0x28ce('0xb')]=_0x393775[_0x28ce('0xb')]||![];this[_0x28ce('0xc')]=_0x393775['faxPause']||![];this[_0x28ce('0xd')]=_0x393775[_0x28ce('0xd')]||![];this[_0x28ce('0xe')]=_0x393775[_0x28ce('0xe')]||![];this['chatStatus']=_0x28ce('0xf');this[_0x28ce('0x10')]=0x0;this['chatCapacity']=_0x393775[_0x28ce('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x28ce('0x12')]=_0x28ce('0xf');this[_0x28ce('0x13')]=0x0;this['mailCapacity']=_0x393775[_0x28ce('0x14')]||0x0;this[_0x28ce('0x15')]=0x0;this[_0x28ce('0x16')]=_0x28ce('0xf');this[_0x28ce('0x17')]=0x0;this[_0x28ce('0x18')]=_0x393775[_0x28ce('0x18')]||0x0;this[_0x28ce('0x19')]=0x0;this[_0x28ce('0x1a')]='unknown';this[_0x28ce('0x1b')]=0x0;this[_0x28ce('0x1c')]=_0x393775[_0x28ce('0x1c')]||0x0;this[_0x28ce('0x1d')]=0x0;this[_0x28ce('0x1e')]=_0x28ce('0xf');this[_0x28ce('0x1f')]=0x0;this[_0x28ce('0x20')]=_0x393775[_0x28ce('0x20')]||0x0;this[_0x28ce('0x21')]=0x0;this['openchannelStatus']='unknown';this[_0x28ce('0x22')]=0x0;this[_0x28ce('0x23')]=_0x393775[_0x28ce('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x28ce('0x24')]=![];this[_0x28ce('0x25')]=undefined;this[_0x28ce('0x26')]='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0xef8a1d){if(this[_0xef8a1d+_0x28ce('0x27')]>0x0){if(this[_0xef8a1d+_0x28ce('0x28')]>0x0&&this[_0xef8a1d+_0x28ce('0x27')]>=this[_0xef8a1d+'Capacity']){return'maxcapacity';}else{return _0x28ce('0x29');}}else{return'idle';}};Agent[_0x28ce('0x2a')]['updateRealtime']=function(){var _0x59b864=[_0x28ce('0x2b'),_0x28ce('0x2c'),_0x28ce('0x2d'),_0x28ce('0x2e'),'sms',_0x28ce('0x2f')];for(var _0x40d4e9=0x0;_0x40d4e9<_0x59b864[_0x28ce('0x30')];_0x40d4e9+=0x1){var _0x2ef379=this[_0x28ce('0x31')](_0x59b864[_0x40d4e9]);if(this[_0x59b864[_0x40d4e9]+_0x28ce('0x32')]!==_0x2ef379){this[_0x59b864[_0x40d4e9]+_0x28ce('0x33')]=_[_0x28ce('0x34')](moment()['format']('x'));}this[_0x59b864[_0x40d4e9]+_0x28ce('0x32')]=_0x2ef379;}var _0x1677bb={'id':this['id'],'name':this[_0x28ce('0x7')],'online':this[_0x28ce('0x8')],'voicePause':this[_0x28ce('0x9')],'chatPause':this[_0x28ce('0xa')],'mailPause':this[_0x28ce('0xb')],'smsPause':this[_0x28ce('0xd')],'faxPause':this[_0x28ce('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x28ce('0x35')],'chatStatusTime':this[_0x28ce('0x10')],'chatCapacity':this[_0x28ce('0x11')],'chatCurrentCapacity':this[_0x28ce('0x36')],'mailStatus':this[_0x28ce('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x28ce('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x28ce('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x28ce('0x18')],'faxCurrentCapacity':this[_0x28ce('0x19')],'smsStatus':this[_0x28ce('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x28ce('0x1d')],'whatsappStatus':this[_0x28ce('0x1e')],'whatsappStatusTime':this[_0x28ce('0x1f')],'whatsappCapacity':this[_0x28ce('0x20')],'whatsappCurrentCapacity':this[_0x28ce('0x21')],'openchannelStatus':this[_0x28ce('0x37')],'openchannelStatusTime':this[_0x28ce('0x22')],'openchannelCapacity':this[_0x28ce('0x23')],'openchannelCurrentCapacity':this[_0x28ce('0x38')],'busy':this['busy'],'busyQueue':this[_0x28ce('0x25')]};var _0x41b3e0=md5(JSON[_0x28ce('0x39')](_0x1677bb));if(this[_0x28ce('0x26')]!==_0x41b3e0){this[_0x28ce('0x26')]=_0x41b3e0;io[_0x28ce('0x3a')](_0x28ce('0x3b'),_0x1677bb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 31c9176..28a00cd 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 _0xebd4=['online','available','waiting','stringify','format','name','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length'];(function(_0x523b8f,_0x3637eb){var _0x430726=function(_0x2a5bad){while(--_0x2a5bad){_0x523b8f['push'](_0x523b8f['shift']());}};_0x430726(++_0x3637eb);}(_0xebd4,0x117));var _0x4ebd=function(_0x7824a,_0x1e4bac){_0x7824a=_0x7824a-0x0;var _0x5427ac=_0xebd4[_0x7824a];return _0x5427ac;};'use strict';var _=require(_0x4ebd('0x0'));var md5=require(_0x4ebd('0x1'));var util=require(_0x4ebd('0x2'));var Redis=require(_0x4ebd('0x3'));var config=require(_0x4ebd('0x4'));config[_0x4ebd('0x5')]=_[_0x4ebd('0x6')](config[_0x4ebd('0x5')],{'host':_0x4ebd('0x7'),'port':0x18eb});var io=require(_0x4ebd('0x8'))(new Redis(config[_0x4ebd('0x5')]));function ChatQueue(_0x36079c){this['id']=_0x36079c['id']||0x0;this['name']=_0x36079c['name']||'';this[_0x4ebd('0x9')]=_0x36079c[_0x4ebd('0x9')]||0xa;this['strategy']=_0x36079c['strategy']||_0x4ebd('0xa');this[_0x4ebd('0xb')]=_0x36079c['Agents'];this[_0x4ebd('0xc')]={};this['waiting']=0x0;this[_0x4ebd('0x1')]='';this[_0x4ebd('0xd')]();this[_0x4ebd('0xe')]();}ChatQueue[_0x4ebd('0xf')][_0x4ebd('0xd')]=function(){var _0xa3895e=this['mapAgentsId'][_0x4ebd('0x10')];this[_0x4ebd('0xc')]=_[_0x4ebd('0x11')](this[_0x4ebd('0xb')],'id');this[_0x4ebd('0xc')][_0x4ebd('0x10')]=_0xa3895e;};ChatQueue[_0x4ebd('0xf')]['updateRealtime']=function(){this[_0x4ebd('0x12')]=0x0;this[_0x4ebd('0x13')]=0x0;for(var _0x975cc2=0x0;_0x975cc2=0x0?this[_0x4ebd('0x16')]:0x0;var _0x396bb7={'id':this['id'],'available':this[_0x4ebd('0x16')],'loggedIn':this[_0x4ebd('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x4ebd('0x17')]};var _0xc6079e=md5(JSON[_0x4ebd('0x18')](_0x396bb7));if(this[_0x4ebd('0x1')]!==_0xc6079e){this[_0x4ebd('0x1')]=_0xc6079e;io['to'](util[_0x4ebd('0x19')]('chat:queue:%s',_0x396bb7[_0x4ebd('0x1a')]))[_0x4ebd('0x1b')](_0x4ebd('0x1c'),_0x396bb7);}};module[_0x4ebd('0x1d')]=ChatQueue; \ No newline at end of file +var _0x1b5d=['waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','ioredis','defaults','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x34f501,_0x2f8f90){var _0x1248aa=function(_0x37ea70){while(--_0x37ea70){_0x34f501['push'](_0x34f501['shift']());}};_0x1248aa(++_0x2f8f90);}(_0x1b5d,0xd5));var _0xd1b5=function(_0xd0b55c,_0x518d87){_0xd0b55c=_0xd0b55c-0x0;var _0x18877d=_0x1b5d[_0xd0b55c];return _0x18877d;};'use strict';var _=require('lodash');var md5=require(_0xd1b5('0x0'));var util=require('util');var Redis=require(_0xd1b5('0x1'));var config=require('../../../config/environment');config['redis']=_[_0xd1b5('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd1b5('0x3'))(new Redis(config[_0xd1b5('0x4')]));function ChatQueue(_0x3b2d28){this['id']=_0x3b2d28['id']||0x0;this[_0xd1b5('0x5')]=_0x3b2d28[_0xd1b5('0x5')]||'';this[_0xd1b5('0x6')]=_0x3b2d28[_0xd1b5('0x6')]||0xa;this[_0xd1b5('0x7')]=_0x3b2d28['strategy']||_0xd1b5('0x8');this[_0xd1b5('0x9')]=_0x3b2d28[_0xd1b5('0x9')];this[_0xd1b5('0xa')]={};this[_0xd1b5('0xb')]=0x0;this[_0xd1b5('0x0')]='';this[_0xd1b5('0xc')]();this[_0xd1b5('0xd')]();}ChatQueue[_0xd1b5('0xe')][_0xd1b5('0xc')]=function(){var _0x20730b=this[_0xd1b5('0xa')][_0xd1b5('0xf')];this[_0xd1b5('0xa')]=_[_0xd1b5('0x10')](this['Agents'],'id');this[_0xd1b5('0xa')][_0xd1b5('0xf')]=_0x20730b;};ChatQueue[_0xd1b5('0xe')]['updateRealtime']=function(){this[_0xd1b5('0x11')]=0x0;this[_0xd1b5('0x12')]=0x0;for(var _0x2f9c32=0x0;_0x2f9c32=0x0?this[_0xd1b5('0x16')]:0x0;var _0x295c3e={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd1b5('0x11')],'name':this[_0xd1b5('0x5')],'paused':this['paused'],'waiting':this[_0xd1b5('0xb')]};var _0x2770f6=md5(JSON[_0xd1b5('0x17')](_0x295c3e));if(this[_0xd1b5('0x0')]!==_0x2770f6){this['md5']=_0x2770f6;io['to'](util[_0xd1b5('0x18')](_0xd1b5('0x19'),_0x295c3e[_0xd1b5('0x5')]))['emit'](_0xd1b5('0x1a'),_0x295c3e);}};module[_0xd1b5('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index b32f216..d4e7fda 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 _0x1ddf=['md5','prototype','_rr','updateRealtime','loggedIn','length','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0x1ddf,0x17b));var _0xf1dd=function(_0x3ee91e,_0x466a5a){_0x3ee91e=_0x3ee91e-0x0;var _0x239405=_0x1ddf[_0x3ee91e];return _0x239405;};'use strict';var _=require(_0xf1dd('0x0'));var md5=require('md5');var util=require(_0xf1dd('0x1'));var Redis=require('ioredis');var config=require(_0xf1dd('0x2'));config[_0xf1dd('0x3')]=_[_0xf1dd('0x4')](config[_0xf1dd('0x3')],{'host':_0xf1dd('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1dd('0x3')]));function FaxQueue(_0x1d0c95){this['id']=_0x1d0c95['id']||0x0;this[_0xf1dd('0x6')]=_0x1d0c95[_0xf1dd('0x6')]||'';this[_0xf1dd('0x7')]=_0x1d0c95[_0xf1dd('0x7')]||0xa;this[_0xf1dd('0x8')]=_0x1d0c95[_0xf1dd('0x8')]||_0xf1dd('0x9');this[_0xf1dd('0xa')]=_0x1d0c95[_0xf1dd('0xa')];this[_0xf1dd('0xb')]={};this[_0xf1dd('0xc')]=0x0;this[_0xf1dd('0xd')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xf1dd('0xe')]['updateRouting']=function(){var _0x1f3bd1=this[_0xf1dd('0xb')]['_rr'];this[_0xf1dd('0xb')]=_['map'](this[_0xf1dd('0xa')],'id');this['mapAgentsId'][_0xf1dd('0xf')]=_0x1f3bd1;};FaxQueue[_0xf1dd('0xe')][_0xf1dd('0x10')]=function(){this[_0xf1dd('0x11')]=0x0;this['paused']=0x0;for(var _0x255777=0x0;_0x255777=0x0?this[_0xf1dd('0x16')]:0x0;var _0x33bfdf={'id':this['id'],'available':this[_0xf1dd('0x16')],'loggedIn':this[_0xf1dd('0x11')],'name':this[_0xf1dd('0x6')],'paused':this[_0xf1dd('0x15')],'waiting':this[_0xf1dd('0xc')]};var _0x32f21d=md5(JSON[_0xf1dd('0x17')](_0x33bfdf));if(this['md5']!==_0x32f21d){this[_0xf1dd('0xd')]=_0x32f21d;io['to'](util[_0xf1dd('0x18')](_0xf1dd('0x19'),_0x33bfdf[_0xf1dd('0x6')]))[_0xf1dd('0x1a')]('fax_queue:save',_0x33bfdf);}};module[_0xf1dd('0x1b')]=FaxQueue; \ No newline at end of file +var _0x4ebf=['localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','faxPause','available','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x473b77,_0x5967c9){var _0x46ff45=function(_0x1916b6){while(--_0x1916b6){_0x473b77['push'](_0x473b77['shift']());}};_0x46ff45(++_0x5967c9);}(_0x4ebf,0x181));var _0xf4eb=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x4ebf[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0xf4eb('0x0'));var md5=require(_0xf4eb('0x1'));var util=require(_0xf4eb('0x2'));var Redis=require(_0xf4eb('0x3'));var config=require(_0xf4eb('0x4'));config[_0xf4eb('0x5')]=_[_0xf4eb('0x6')](config['redis'],{'host':_0xf4eb('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf4eb('0x5')]));function FaxQueue(_0x574377){this['id']=_0x574377['id']||0x0;this['name']=_0x574377[_0xf4eb('0x8')]||'';this[_0xf4eb('0x9')]=_0x574377['timeout']||0xa;this['strategy']=_0x574377[_0xf4eb('0xa')]||_0xf4eb('0xb');this[_0xf4eb('0xc')]=_0x574377['Agents'];this[_0xf4eb('0xd')]={};this[_0xf4eb('0xe')]=0x0;this[_0xf4eb('0x1')]='';this[_0xf4eb('0xf')]();this[_0xf4eb('0x10')]();}FaxQueue[_0xf4eb('0x11')][_0xf4eb('0xf')]=function(){var _0x33ef9c=this[_0xf4eb('0xd')][_0xf4eb('0x12')];this[_0xf4eb('0xd')]=_[_0xf4eb('0x13')](this[_0xf4eb('0xc')],'id');this[_0xf4eb('0xd')][_0xf4eb('0x12')]=_0x33ef9c;};FaxQueue[_0xf4eb('0x11')][_0xf4eb('0x10')]=function(){this[_0xf4eb('0x14')]=0x0;this[_0xf4eb('0x15')]=0x0;for(var _0x40f9fa=0x0;_0x40f9fa=0x0?this[_0xf4eb('0x18')]:0x0;var _0x152950={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf4eb('0x14')],'name':this[_0xf4eb('0x8')],'paused':this[_0xf4eb('0x15')],'waiting':this['waiting']};var _0x1a3986=md5(JSON['stringify'](_0x152950));if(this['md5']!==_0x1a3986){this[_0xf4eb('0x1')]=_0x1a3986;io['to'](util['format'](_0xf4eb('0x19'),_0x152950[_0xf4eb('0x8')]))[_0xf4eb('0x1a')]('fax_queue:save',_0x152950);}};module[_0xf4eb('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 3014a85..2c24356 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 _0xea70=['name','Intervals','exports'];(function(_0x2f2e3c,_0xdec9cf){var _0x4843e5=function(_0x33a602){while(--_0x33a602){_0x2f2e3c['push'](_0x2f2e3c['shift']());}};_0x4843e5(++_0xdec9cf);}(_0xea70,0x108));var _0x0ea7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xea70[_0x17d9e3];return _0x14192d;};'use strict';function Interval(_0x5cfae4){this['id']=_0x5cfae4['id']||0x0;this[_0x0ea7('0x0')]=_0x5cfae4['name']||'';this[_0x0ea7('0x1')]=_0x5cfae4[_0x0ea7('0x1')]||{};}module[_0x0ea7('0x2')]=Interval; \ No newline at end of file +var _0x153b=['Intervals','name'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x153b,0x1e9));var _0xb153=function(_0x46ee21,_0x40070b){_0x46ee21=_0x46ee21-0x0;var _0x3b51be=_0x153b[_0x46ee21];return _0x3b51be;};'use strict';function Interval(_0x2e5d68){this['id']=_0x2e5d68['id']||0x0;this[_0xb153('0x0')]=_0x2e5d68[_0xb153('0x0')]||'';this['Intervals']=_0x2e5d68[_0xb153('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 742f312..af4e926 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 _0x6ead=['mail:queue:%s','emit','mail_queue:save','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','waiting','stringify','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ead,0x11a));var _0xd6ea=function(_0x51a6e7,_0x16503d){_0x51a6e7=_0x51a6e7-0x0;var _0x59ff55=_0x6ead[_0x51a6e7];return _0x59ff55;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xd6ea('0x0'));var Redis=require(_0xd6ea('0x1'));var config=require(_0xd6ea('0x2'));config[_0xd6ea('0x3')]=_[_0xd6ea('0x4')](config['redis'],{'host':_0xd6ea('0x5'),'port':0x18eb});var io=require(_0xd6ea('0x6'))(new Redis(config[_0xd6ea('0x3')]));function MailQueue(_0x5974ae){this['id']=_0x5974ae['id']||0x0;this['name']=_0x5974ae[_0xd6ea('0x7')]||'';this['timeout']=_0x5974ae[_0xd6ea('0x8')]||0xa;this[_0xd6ea('0x9')]=_0x5974ae[_0xd6ea('0x9')]||_0xd6ea('0xa');this[_0xd6ea('0xb')]=_0x5974ae[_0xd6ea('0xb')];this[_0xd6ea('0xc')]={};this['waiting']=0x0;this[_0xd6ea('0xd')]='';this[_0xd6ea('0xe')]();this['updateRealtime']();}MailQueue[_0xd6ea('0xf')][_0xd6ea('0xe')]=function(){var _0x27cc5c=this['mapAgentsId']['_rr'];this[_0xd6ea('0xc')]=_[_0xd6ea('0x10')](this[_0xd6ea('0xb')],'id');this[_0xd6ea('0xc')][_0xd6ea('0x11')]=_0x27cc5c;};MailQueue[_0xd6ea('0xf')][_0xd6ea('0x12')]=function(){this[_0xd6ea('0x13')]=0x0;this[_0xd6ea('0x14')]=0x0;for(var _0x2b406e=0x0;_0x2b406e=0x0?this['available']:0x0;var _0x2d941c={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd6ea('0x13')],'name':this[_0xd6ea('0x7')],'paused':this['paused'],'waiting':this[_0xd6ea('0x19')]};var _0x28131d=md5(JSON[_0xd6ea('0x1a')](_0x2d941c));if(this[_0xd6ea('0xd')]!==_0x28131d){this[_0xd6ea('0xd')]=_0x28131d;io['to'](util[_0xd6ea('0x1b')](_0xd6ea('0x1c'),_0x2d941c['name']))[_0xd6ea('0x1d')](_0xd6ea('0x1e'),_0x2d941c);}};module['exports']=MailQueue; \ No newline at end of file +var _0x83c6=['mapAgentsId','_rr','map','loggedIn','length','paused','available','stringify','format','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype'];(function(_0x4e7844,_0x30ce77){var _0x336119=function(_0x508b1c){while(--_0x508b1c){_0x4e7844['push'](_0x4e7844['shift']());}};_0x336119(++_0x30ce77);}(_0x83c6,0x8d));var _0x683c=function(_0x12cb79,_0xac0bdf){_0x12cb79=_0x12cb79-0x0;var _0x1b114f=_0x83c6[_0x12cb79];return _0x1b114f;};'use strict';var _=require(_0x683c('0x0'));var md5=require(_0x683c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x683c('0x2'));config[_0x683c('0x3')]=_[_0x683c('0x4')](config[_0x683c('0x3')],{'host':_0x683c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x683c('0x3')]));function MailQueue(_0x11282b){this['id']=_0x11282b['id']||0x0;this[_0x683c('0x6')]=_0x11282b[_0x683c('0x6')]||'';this['timeout']=_0x11282b[_0x683c('0x7')]||0xa;this[_0x683c('0x8')]=_0x11282b[_0x683c('0x8')]||_0x683c('0x9');this[_0x683c('0xa')]=_0x11282b[_0x683c('0xa')];this['mapAgentsId']={};this[_0x683c('0xb')]=0x0;this[_0x683c('0x1')]='';this[_0x683c('0xc')]();this[_0x683c('0xd')]();}MailQueue[_0x683c('0xe')][_0x683c('0xc')]=function(){var _0x143cd2=this[_0x683c('0xf')][_0x683c('0x10')];this[_0x683c('0xf')]=_[_0x683c('0x11')](this['Agents'],'id');this[_0x683c('0xf')][_0x683c('0x10')]=_0x143cd2;};MailQueue[_0x683c('0xe')][_0x683c('0xd')]=function(){this[_0x683c('0x12')]=0x0;this['paused']=0x0;for(var _0x5de4d1=0x0;_0x5de4d1=0x0?this['available']:0x0;var _0x41f296={'id':this['id'],'available':this[_0x683c('0x15')],'loggedIn':this[_0x683c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x683c('0xb')]};var _0x70a2cd=md5(JSON[_0x683c('0x16')](_0x41f296));if(this[_0x683c('0x1')]!==_0x70a2cd){this[_0x683c('0x1')]=_0x70a2cd;io['to'](util[_0x683c('0x17')]('mail:queue:%s',_0x41f296[_0x683c('0x6')]))['emit'](_0x683c('0x18'),_0x41f296);}};module[_0x683c('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a1c8dc3..f8d174e 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(_0x2d126e,_0x1e8257){var _0xcb04d3=function(_0x19a2d9){while(--_0x19a2d9){_0x2d126e['push'](_0x2d126e['shift']());}};_0xcb04d3(++_0x1e8257);}(_0x2ef3,0xba));var _0x32ef=function(_0x168cf4,_0x15f1a4){_0x168cf4=_0x168cf4-0x0;var _0x43e073=_0x2ef3[_0x168cf4];return _0x43e073;};'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(_0x2b0267,_0x59cab1){var _0x289a4a=function(_0x3ec45c){while(--_0x3ec45c){_0x2b0267['push'](_0x2b0267['shift']());}};_0x289a4a(++_0x59cab1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x5fc3[_0x5c14f6];return _0x4949b3;};'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 1410bbd..47e7071 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 _0xda55=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','smsPause','available','waiting','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','redis','defaults','localhost','name'];(function(_0x173452,_0x3aa870){var _0xee3fd0=function(_0x10eb01){while(--_0x10eb01){_0x173452['push'](_0x173452['shift']());}};_0xee3fd0(++_0x3aa870);}(_0xda55,0x6d));var _0x5da5=function(_0x556b34,_0x5f3931){_0x556b34=_0x556b34-0x0;var _0x40533c=_0xda55[_0x556b34];return _0x40533c;};'use strict';var _=require(_0x5da5('0x0'));var md5=require(_0x5da5('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x5da5('0x2'));config[_0x5da5('0x3')]=_[_0x5da5('0x4')](config[_0x5da5('0x3')],{'host':_0x5da5('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5da5('0x3')]));function SmsQueue(_0x4b4010){this['id']=_0x4b4010['id']||0x0;this[_0x5da5('0x6')]=_0x4b4010['name']||'';this[_0x5da5('0x7')]=_0x4b4010[_0x5da5('0x7')]||0xa;this[_0x5da5('0x8')]=_0x4b4010[_0x5da5('0x8')]||_0x5da5('0x9');this[_0x5da5('0xa')]=_0x4b4010[_0x5da5('0xa')];this[_0x5da5('0xb')]={};this['waiting']=0x0;this[_0x5da5('0x1')]='';this[_0x5da5('0xc')]();this[_0x5da5('0xd')]();}SmsQueue[_0x5da5('0xe')][_0x5da5('0xc')]=function(){var _0x2a361c=this[_0x5da5('0xb')]['_rr'];this[_0x5da5('0xb')]=_[_0x5da5('0xf')](this['Agents'],'id');this[_0x5da5('0xb')][_0x5da5('0x10')]=_0x2a361c;};SmsQueue[_0x5da5('0xe')][_0x5da5('0xd')]=function(){this[_0x5da5('0x11')]=0x0;this[_0x5da5('0x12')]=0x0;for(var _0x481562=0x0;_0x481562=0x0?this[_0x5da5('0x15')]:0x0;var _0x3f7e98={'id':this['id'],'available':this[_0x5da5('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x5da5('0x6')],'paused':this[_0x5da5('0x12')],'waiting':this[_0x5da5('0x16')]};var _0x30cde5=md5(JSON[_0x5da5('0x17')](_0x3f7e98));if(this['md5']!==_0x30cde5){this[_0x5da5('0x1')]=_0x30cde5;io['to'](util[_0x5da5('0x18')](_0x5da5('0x19'),_0x3f7e98['name']))[_0x5da5('0x1a')](_0x5da5('0x1b'),_0x3f7e98);}};module[_0x5da5('0x1c')]=SmsQueue; \ No newline at end of file +var _0x2904=['md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','smsPause','available','waiting','stringify','sms:queue:%s','sms_queue:save','exports','lodash'];(function(_0x2b1269,_0x656679){var _0x553679=function(_0x219b72){while(--_0x219b72){_0x2b1269['push'](_0x2b1269['shift']());}};_0x553679(++_0x656679);}(_0x2904,0x137));var _0x4290=function(_0x3f793a,_0x1b4bc7){_0x3f793a=_0x3f793a-0x0;var _0x4a0912=_0x2904[_0x3f793a];return _0x4a0912;};'use strict';var _=require(_0x4290('0x0'));var md5=require(_0x4290('0x1'));var util=require('util');var Redis=require(_0x4290('0x2'));var config=require('../../../config/environment');config[_0x4290('0x3')]=_[_0x4290('0x4')](config[_0x4290('0x3')],{'host':_0x4290('0x5'),'port':0x18eb});var io=require(_0x4290('0x6'))(new Redis(config['redis']));function SmsQueue(_0x1b7f36){this['id']=_0x1b7f36['id']||0x0;this[_0x4290('0x7')]=_0x1b7f36[_0x4290('0x7')]||'';this['timeout']=_0x1b7f36[_0x4290('0x8')]||0xa;this['strategy']=_0x1b7f36['strategy']||_0x4290('0x9');this['Agents']=_0x1b7f36[_0x4290('0xa')];this[_0x4290('0xb')]={};this['waiting']=0x0;this[_0x4290('0x1')]='';this[_0x4290('0xc')]();this[_0x4290('0xd')]();}SmsQueue[_0x4290('0xe')][_0x4290('0xc')]=function(){var _0x3ac886=this[_0x4290('0xb')][_0x4290('0xf')];this[_0x4290('0xb')]=_['map'](this[_0x4290('0xa')],'id');this[_0x4290('0xb')]['_rr']=_0x3ac886;};SmsQueue[_0x4290('0xe')]['updateRealtime']=function(){this[_0x4290('0x10')]=0x0;this['paused']=0x0;for(var _0x418062=0x0;_0x418062=0x0?this[_0x4290('0x12')]:0x0;var _0x2d2537={'id':this['id'],'available':this[_0x4290('0x12')],'loggedIn':this['loggedIn'],'name':this[_0x4290('0x7')],'paused':this['paused'],'waiting':this[_0x4290('0x13')]};var _0x25cb57=md5(JSON[_0x4290('0x14')](_0x2d2537));if(this['md5']!==_0x25cb57){this[_0x4290('0x1')]=_0x25cb57;io['to'](util['format'](_0x4290('0x15'),_0x2d2537['name']))['emit'](_0x4290('0x16'),_0x2d2537);}};module[_0x4290('0x17')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 1daae4a..bb2542a 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 _0xecfb=['whatsappPause','paused','available','stringify','whatsapp:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','online'];(function(_0x52fa77,_0x2b381b){var _0x477535=function(_0x5323b5){while(--_0x5323b5){_0x52fa77['push'](_0x52fa77['shift']());}};_0x477535(++_0x2b381b);}(_0xecfb,0x166));var _0xbecf=function(_0x2f5def,_0x2979ed){_0x2f5def=_0x2f5def-0x0;var _0x52273e=_0xecfb[_0x2f5def];return _0x52273e;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xbecf('0x0'));var Redis=require(_0xbecf('0x1'));var config=require(_0xbecf('0x2'));config[_0xbecf('0x3')]=_['defaults'](config['redis'],{'host':_0xbecf('0x4'),'port':0x18eb});var io=require(_0xbecf('0x5'))(new Redis(config[_0xbecf('0x3')]));function WhatsappQueue(_0x1b6e66){this['id']=_0x1b6e66['id']||0x0;this[_0xbecf('0x6')]=_0x1b6e66[_0xbecf('0x6')]||'';this['timeout']=_0x1b6e66[_0xbecf('0x7')]||0xa;this[_0xbecf('0x8')]=_0x1b6e66[_0xbecf('0x8')]||_0xbecf('0x9');this[_0xbecf('0xa')]=_0x1b6e66['Agents'];this[_0xbecf('0xb')]={};this[_0xbecf('0xc')]=0x0;this[_0xbecf('0xd')]='';this[_0xbecf('0xe')]();this[_0xbecf('0xf')]();}WhatsappQueue[_0xbecf('0x10')][_0xbecf('0xe')]=function(){var _0x4beeb2=this[_0xbecf('0xb')][_0xbecf('0x11')];this[_0xbecf('0xb')]=_['map'](this[_0xbecf('0xa')],'id');this[_0xbecf('0xb')][_0xbecf('0x11')]=_0x4beeb2;};WhatsappQueue[_0xbecf('0x10')]['updateRealtime']=function(){this[_0xbecf('0x12')]=0x0;this['paused']=0x0;for(var _0x1d62a4=0x0;_0x1d62a4=0x0?this[_0xbecf('0x16')]:0x0;var _0x4bd365={'id':this['id'],'available':this[_0xbecf('0x16')],'loggedIn':this[_0xbecf('0x12')],'name':this[_0xbecf('0x6')],'paused':this[_0xbecf('0x15')],'waiting':this[_0xbecf('0xc')]};var _0x33a6a4=md5(JSON[_0xbecf('0x17')](_0x4bd365));if(this['md5']!==_0x33a6a4){this[_0xbecf('0xd')]=_0x33a6a4;io['to'](util['format'](_0xbecf('0x18'),_0x4bd365[_0xbecf('0x6')]))[_0xbecf('0x19')]('whatsapp_queue:save',_0x4bd365);}};module[_0xbecf('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x34b1=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','whatsappPause','paused','available','name','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','timeout','strategy'];(function(_0x33f1b7,_0x556fe2){var _0x500c05=function(_0x1b418f){while(--_0x1b418f){_0x33f1b7['push'](_0x33f1b7['shift']());}};_0x500c05(++_0x556fe2);}(_0x34b1,0xdf));var _0x134b=function(_0x271c7b,_0x2e717d){_0x271c7b=_0x271c7b-0x0;var _0x5da025=_0x34b1[_0x271c7b];return _0x5da025;};'use strict';var _=require(_0x134b('0x0'));var md5=require(_0x134b('0x1'));var util=require(_0x134b('0x2'));var Redis=require(_0x134b('0x3'));var config=require(_0x134b('0x4'));config[_0x134b('0x5')]=_['defaults'](config[_0x134b('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x134b('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x59c1c0){this['id']=_0x59c1c0['id']||0x0;this['name']=_0x59c1c0['name']||'';this[_0x134b('0x7')]=_0x59c1c0[_0x134b('0x7')]||0xa;this[_0x134b('0x8')]=_0x59c1c0[_0x134b('0x8')]||'beepall';this[_0x134b('0x9')]=_0x59c1c0[_0x134b('0x9')];this[_0x134b('0xa')]={};this[_0x134b('0xb')]=0x0;this['md5']='';this[_0x134b('0xc')]();this[_0x134b('0xd')]();}WhatsappQueue[_0x134b('0xe')][_0x134b('0xc')]=function(){var _0xc45579=this[_0x134b('0xa')][_0x134b('0xf')];this[_0x134b('0xa')]=_[_0x134b('0x10')](this[_0x134b('0x9')],'id');this[_0x134b('0xa')][_0x134b('0xf')]=_0xc45579;};WhatsappQueue[_0x134b('0xe')][_0x134b('0xd')]=function(){this[_0x134b('0x11')]=0x0;this['paused']=0x0;for(var _0x108043=0x0;_0x108043=0x0?this[_0x134b('0x15')]:0x0;var _0x5ea3f0={'id':this['id'],'available':this[_0x134b('0x15')],'loggedIn':this[_0x134b('0x11')],'name':this[_0x134b('0x16')],'paused':this[_0x134b('0x14')],'waiting':this[_0x134b('0xb')]};var _0x3e3a8a=md5(JSON[_0x134b('0x17')](_0x5ea3f0));if(this[_0x134b('0x1')]!==_0x3e3a8a){this[_0x134b('0x1')]=_0x3e3a8a;io['to'](util[_0x134b('0x18')](_0x134b('0x19'),_0x5ea3f0['name']))[_0x134b('0x1a')](_0x134b('0x1b'),_0x5ea3f0);}};module[_0x134b('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 9e0d85f..65bfa8d 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(_0x11e209,_0x40ba71){var _0x432cee=function(_0x12a143){while(--_0x12a143){_0x11e209['push'](_0x11e209['shift']());}};_0x432cee(++_0x40ba71);}(_0xb10b,0x12a));var _0xbb10=function(_0xd333a1,_0x1f61a0){_0xd333a1=_0xd333a1-0x0;var _0x553a60=_0xb10b[_0xd333a1];return _0x553a60;};'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 _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(_0x2f0b51,_0x4c3579){var _0x58d408=function(_0x8d3b86){while(--_0x8d3b86){_0x2f0b51['push'](_0x2f0b51['shift']());}};_0x58d408(++_0x4c3579);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f03ce,_0x5cb284){_0x4f03ce=_0x4f03ce-0x0;var _0x52acd1=_0xb10b[_0x4f03ce];return _0x52acd1;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 81bbdaa..8cbd914 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 _0xb8da=['addTagsToChatInteraction','../client','update','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x1e3c5e,_0x28bdc7){var _0x466daa=function(_0xfaefd1){while(--_0xfaefd1){_0x1e3c5e['push'](_0x1e3c5e['shift']());}};_0x466daa(++_0x28bdc7);}(_0xb8da,0xbb));var _0xab8d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb8da[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0xab8d('0x0'));exports[_0xab8d('0x1')]=function(_0x253230,_0x367262){return client['Request']('UpdateChatInteraction',{'body':_0x367262,'options':{'where':{'id':_0x253230}},'log':_0xab8d('0x2')});};exports['addTags']=function(_0x541fb2,_0x4ae80b){return client[_0xab8d('0x3')](_0xab8d('0x4'),{'body':_0x4ae80b,'options':{'where':{'id':_0x541fb2}},'log':_0xab8d('0x5')});}; \ No newline at end of file +var _0x893f=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x48c132,_0xeac05f){var _0x591c58=function(_0x1a208f){while(--_0x1a208f){_0x48c132['push'](_0x48c132['shift']());}};_0x591c58(++_0xeac05f);}(_0x893f,0x17d));var _0xf893=function(_0xe8b11e,_0x3856dd){_0xe8b11e=_0xe8b11e-0x0;var _0x51883e=_0x893f[_0xe8b11e];return _0x51883e;};'use strict';var client=require(_0xf893('0x0'));exports[_0xf893('0x1')]=function(_0x57ea8e,_0x328908){return client[_0xf893('0x2')](_0xf893('0x3'),{'body':_0x328908,'options':{'where':{'id':_0x57ea8e}},'log':_0xf893('0x4')});};exports[_0xf893('0x5')]=function(_0x15d783,_0x1effb3){return client[_0xf893('0x2')](_0xf893('0x6'),{'body':_0x1effb3,'options':{'where':{'id':_0x15d783}},'log':_0xf893('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c927275..6fd0978 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 _0x5ac3=['create','CreateChatMessage','../client'];(function(_0x54f173,_0x3856f0){var _0x365297=function(_0x5dc16a){while(--_0x5dc16a){_0x54f173['push'](_0x54f173['shift']());}};_0x365297(++_0x3856f0);}(_0x5ac3,0x9e));var _0x35ac=function(_0x19fab8,_0x2113a0){_0x19fab8=_0x19fab8-0x0;var _0xae9119=_0x5ac3[_0x19fab8];return _0xae9119;};'use strict';var client=require(_0x35ac('0x0'));exports[_0x35ac('0x1')]=function(_0x191058){return client['Request'](_0x35ac('0x2'),{'body':_0x191058,'log':'createChatMessage'});}; \ No newline at end of file +var _0x0c39=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x22dba8,_0xa7ce1b){var _0x2e7dd9=function(_0x2f4fbd){while(--_0x2f4fbd){_0x22dba8['push'](_0x22dba8['shift']());}};_0x2e7dd9(++_0xa7ce1b);}(_0x0c39,0x9e));var _0x90c3=function(_0x2d470f,_0x455810){_0x2d470f=_0x2d470f-0x0;var _0x416d39=_0x0c39[_0x2d470f];return _0x416d39;};'use strict';var client=require(_0x90c3('0x0'));exports['create']=function(_0x35cbb3){return client[_0x90c3('0x1')](_0x90c3('0x2'),{'body':_0x35cbb3,'log':_0x90c3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f155c4f..a3c3bc0 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 _0xf360=['strategy','User','Agents','online','chatPause','../client','getChatQueues','Request','name'];(function(_0x24cfb4,_0x2e1470){var _0x6a260=function(_0x4994ec){while(--_0x4994ec){_0x24cfb4['push'](_0x24cfb4['shift']());}};_0x6a260(++_0x2e1470);}(_0xf360,0x9e));var _0x0f36=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf360[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0x0f36('0x0'));exports[_0x0f36('0x1')]=function(){return function(){return client[_0x0f36('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0f36('0x3'),'timeout',_0x0f36('0x4')],'include':[{'model':_0x0f36('0x5'),'as':_0x0f36('0x6'),'attributes':['id','name',_0x0f36('0x7'),_0x0f36('0x8')]}]},'log':_0x0f36('0x1')});};}; \ No newline at end of file +var _0x2086=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User','Agents'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x2086,0x124));var _0x6208=function(_0x2a2c71,_0x30d589){_0x2a2c71=_0x2a2c71-0x0;var _0x15a808=_0x2086[_0x2a2c71];return _0x15a808;};'use strict';var client=require(_0x6208('0x0'));exports[_0x6208('0x1')]=function(){return function(){return client[_0x6208('0x2')](_0x6208('0x3'),{'options':{'raw':![],'attributes':['id',_0x6208('0x4'),_0x6208('0x5'),'strategy'],'include':[{'model':_0x6208('0x6'),'as':_0x6208('0x7'),'attributes':['id','name',_0x6208('0x8'),_0x6208('0x9')]}]},'log':_0x6208('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 6a624e6..8be72df 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 _0xd73a=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x435b2f,_0x4c44da){var _0x181648=function(_0x3d753e){while(--_0x3d753e){_0x435b2f['push'](_0x435b2f['shift']());}};_0x181648(++_0x4c44da);}(_0xd73a,0x171));var _0xad73=function(_0x44bf50,_0x48eacd){_0x44bf50=_0x44bf50-0x0;var _0x39f989=_0xd73a[_0x44bf50];return _0x39f989;};'use strict';var client=require(_0xad73('0x0'));exports[_0xad73('0x1')]=function(_0x138ac){return client[_0xad73('0x2')](_0xad73('0x3'),{'body':_0x138ac,'log':'CreateChatQueueReport'});};exports['update']=function(_0x1b0cd2,_0x216563){return client[_0xad73('0x2')](_0xad73('0x4'),{'body':_0x216563,'options':{'where':{'uniqueid':_0x1b0cd2},'order':[['id',_0xad73('0x5')]],'limit':0x1},'log':_0xad73('0x4')});}; \ No newline at end of file +var _0xaf93=['DESC','../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x4e73cb,_0x3eb103){var _0x5eb253=function(_0xd4a725){while(--_0xd4a725){_0x4e73cb['push'](_0x4e73cb['shift']());}};_0x5eb253(++_0x3eb103);}(_0xaf93,0x151));var _0x3af9=function(_0x2b3233,_0x40a866){_0x2b3233=_0x2b3233-0x0;var _0x16df0a=_0xaf93[_0x2b3233];return _0x16df0a;};'use strict';var client=require(_0x3af9('0x0'));exports[_0x3af9('0x1')]=function(_0x482d3c){return client['Request'](_0x3af9('0x2'),{'body':_0x482d3c,'log':_0x3af9('0x2')});};exports['update']=function(_0x1319bc,_0x44ae6e){return client[_0x3af9('0x3')](_0x3af9('0x4'),{'body':_0x44ae6e,'options':{'where':{'uniqueid':_0x1319bc},'order':[['id',_0x3af9('0x5')]],'limit':0x1},'log':_0x3af9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 6047868..ff68aa3 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x7a54,0x106));var _0x47a5=function(_0x1fb89b,_0x5cf3bc){_0x1fb89b=_0x1fb89b-0x0;var _0x148470=_0x7a54[_0x1fb89b];return _0x148470;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x128755,_0xc5b8d3){var _0x435d11=function(_0x41fa5f){while(--_0x41fa5f){_0x128755['push'](_0x128755['shift']());}};_0x435d11(++_0xc5b8d3);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index b8a9048..9edf6a7 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 _0x1b83=['create','Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x7caa5d,_0x215ab7){var _0x416a83=function(_0x2dd362){while(--_0x2dd362){_0x7caa5d['push'](_0x7caa5d['shift']());}};_0x416a83(++_0x215ab7);}(_0x1b83,0x135));var _0x31b8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b83[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x31b8('0x0'));exports[_0x31b8('0x1')]=function(_0x29aa3a){return client[_0x31b8('0x2')](_0x31b8('0x3'),{'body':_0x29aa3a,'log':_0x31b8('0x4')});}; \ No newline at end of file +var _0xe7b2=['createFaxMessage','../client','create'];(function(_0x441fae,_0x3ab2ee){var _0x189025=function(_0x4914e1){while(--_0x4914e1){_0x441fae['push'](_0x441fae['shift']());}};_0x189025(++_0x3ab2ee);}(_0xe7b2,0xd0));var _0x2e7b=function(_0x198e67,_0x34b950){_0x198e67=_0x198e67-0x0;var _0x1cfc46=_0xe7b2[_0x198e67];return _0x1cfc46;};'use strict';var client=require(_0x2e7b('0x0'));exports[_0x2e7b('0x1')]=function(_0x4dba2a){return client['Request']('CreateFaxMessage',{'body':_0x4dba2a,'log':_0x2e7b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 6bad7df..39df172 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 _0xe638=['Agents','name','faxPause','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User'];(function(_0x4471f4,_0x32e48f){var _0x434b3e=function(_0x517728){while(--_0x517728){_0x4471f4['push'](_0x4471f4['shift']());}};_0x434b3e(++_0x32e48f);}(_0xe638,0x1d7));var _0x8e63=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0xe638[_0x5adfa9];return _0x458f41;};'use strict';var client=require('../client');exports[_0x8e63('0x0')]=function(){return function(){return client[_0x8e63('0x1')](_0x8e63('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8e63('0x3'),_0x8e63('0x4')],'include':[{'model':_0x8e63('0x5'),'as':_0x8e63('0x6'),'attributes':['id',_0x8e63('0x7'),'online',_0x8e63('0x8')]}]},'log':_0x8e63('0x0')});};}; \ No newline at end of file +var _0x96d1=['name','timeout','strategy','User','Agents','online','faxPause','getFaxQueues','Request'];(function(_0x5e4cd6,_0xfb732a){var _0xd7c226=function(_0x574888){while(--_0x574888){_0x5e4cd6['push'](_0x5e4cd6['shift']());}};_0xd7c226(++_0xfb732a);}(_0x96d1,0xbb));var _0x196d=function(_0x61fa37,_0x2fff02){_0x61fa37=_0x61fa37-0x0;var _0x5e7520=_0x96d1[_0x61fa37];return _0x5e7520;};'use strict';var client=require('../client');exports[_0x196d('0x0')]=function(){return function(){return client[_0x196d('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x196d('0x2'),_0x196d('0x3'),_0x196d('0x4')],'include':[{'model':_0x196d('0x5'),'as':_0x196d('0x6'),'attributes':['id',_0x196d('0x2'),_0x196d('0x7'),_0x196d('0x8')]}]},'log':_0x196d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index dceffc3..a283116 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 _0xce1b=['UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport','update'];(function(_0x2565a4,_0x5d6a87){var _0x5e87f4=function(_0x5222ae){while(--_0x5222ae){_0x2565a4['push'](_0x2565a4['shift']());}};_0x5e87f4(++_0x5d6a87);}(_0xce1b,0x19f));var _0xbce1=function(_0x5ed3e5,_0x44b15b){_0x5ed3e5=_0x5ed3e5-0x0;var _0x3c42f4=_0xce1b[_0x5ed3e5];return _0x3c42f4;};'use strict';var client=require(_0xbce1('0x0'));exports[_0xbce1('0x1')]=function(_0x1505c3){return client[_0xbce1('0x2')]('CreateFaxQueueReport',{'body':_0x1505c3,'log':_0xbce1('0x3')});};exports[_0xbce1('0x4')]=function(_0x5658f5,_0x2557c2){return client[_0xbce1('0x2')](_0xbce1('0x5'),{'body':_0x2557c2,'options':{'where':{'uniqueid':_0x5658f5},'order':[['id',_0xbce1('0x6')]],'limit':0x1},'log':_0xbce1('0x5')});}; \ No newline at end of file +var _0xde2b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x2e3067,_0x17af08){var _0x24187=function(_0x5733d9){while(--_0x5733d9){_0x2e3067['push'](_0x2e3067['shift']());}};_0x24187(++_0x17af08);}(_0xde2b,0x131));var _0xbde2=function(_0xf64064,_0x51da71){_0xf64064=_0xf64064-0x0;var _0x516e3f=_0xde2b[_0xf64064];return _0x516e3f;};'use strict';var client=require(_0xbde2('0x0'));exports[_0xbde2('0x1')]=function(_0xa394b2){return client[_0xbde2('0x2')](_0xbde2('0x3'),{'body':_0xa394b2,'log':_0xbde2('0x3')});};exports[_0xbde2('0x4')]=function(_0x3b539f,_0x22da13){return client['Request'](_0xbde2('0x5'),{'body':_0x22da13,'options':{'where':{'uniqueid':_0x3b539f},'order':[['id',_0xbde2('0x6')]],'limit':0x1},'log':_0xbde2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 21ece47..e63eeec 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 _0x18d9=['name','interval','../client','getIntervals','GetInterval','Interval'];(function(_0x306157,_0x4da8d4){var _0x435e51=function(_0x5994c2){while(--_0x5994c2){_0x306157['push'](_0x306157['shift']());}};_0x435e51(++_0x4da8d4);}(_0x18d9,0x1e2));var _0x918d=function(_0xcaef95,_0x2406ab){_0xcaef95=_0xcaef95-0x0;var _0x57fe08=_0x18d9[_0xcaef95];return _0x57fe08;};'use strict';var client=require(_0x918d('0x0'));exports[_0x918d('0x1')]=function(){return function(){return client['Request'](_0x918d('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x918d('0x3'),'as':'Intervals','attributes':['id',_0x918d('0x4'),_0x918d('0x5')]}]},'log':_0x918d('0x1')});};}; \ No newline at end of file +var _0x294f=['name','Interval','Intervals','interval','getIntervals','Request','GetInterval'];(function(_0x5ca0b3,_0x33f5ef){var _0x6ba806=function(_0x58b844){while(--_0x58b844){_0x5ca0b3['push'](_0x5ca0b3['shift']());}};_0x6ba806(++_0x33f5ef);}(_0x294f,0x1b0));var _0xf294=function(_0x3c4702,_0x315207){_0x3c4702=_0x3c4702-0x0;var _0x186a83=_0x294f[_0x3c4702];return _0x186a83;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0xf294('0x0')](_0xf294('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf294('0x2')],'include':[{'model':_0xf294('0x3'),'as':_0xf294('0x4'),'attributes':['id',_0xf294('0x2'),_0xf294('0x5')]}]},'log':_0xf294('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 4ebf093..21cbe31 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 _0x1a37=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0xd65fb,_0x48c6bf){var _0x265951=function(_0x4f684d){while(--_0x4f684d){_0xd65fb['push'](_0xd65fb['shift']());}};_0x265951(++_0x48c6bf);}(_0x1a37,0xb4));var _0x71a3=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x1a37[_0x257642];return _0x3d813b;};'use strict';var client=require(_0x71a3('0x0'));exports[_0x71a3('0x1')]=function(_0x32781b,_0x28e254){return client[_0x71a3('0x2')](_0x71a3('0x3'),{'body':_0x28e254,'options':{'where':{'id':_0x32781b}},'log':_0x71a3('0x4')});};exports[_0x71a3('0x5')]=function(_0x29c54f,_0x100181){return client['Request'](_0x71a3('0x6'),{'body':_0x100181,'options':{'where':{'id':_0x29c54f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xd943=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x198875,_0x113201){var _0x5af8b6=function(_0x295135){while(--_0x295135){_0x198875['push'](_0x198875['shift']());}};_0x5af8b6(++_0x113201);}(_0xd943,0x15d));var _0x3d94=function(_0x40f3db,_0x1cfdc4){_0x40f3db=_0x40f3db-0x0;var _0x421588=_0xd943[_0x40f3db];return _0x421588;};'use strict';var client=require(_0x3d94('0x0'));exports[_0x3d94('0x1')]=function(_0x55353d,_0x440dd8){return client['Request'](_0x3d94('0x2'),{'body':_0x440dd8,'options':{'where':{'id':_0x55353d}},'log':_0x3d94('0x3')});};exports[_0x3d94('0x4')]=function(_0xc13b61,_0xaf8962){return client['Request']('AddTagsToMailInteraction',{'body':_0xaf8962,'options':{'where':{'id':_0xc13b61}},'log':_0x3d94('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 5017019..d135c75 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 _0x3e38=['Request','createMailMessage','../client'];(function(_0xf37bba,_0x51447b){var _0x31601c=function(_0x5e14b6){while(--_0x5e14b6){_0xf37bba['push'](_0xf37bba['shift']());}};_0x31601c(++_0x51447b);}(_0x3e38,0x92));var _0x83e3=function(_0x2adcab,_0x5f2301){_0x2adcab=_0x2adcab-0x0;var _0x14347c=_0x3e38[_0x2adcab];return _0x14347c;};'use strict';var client=require(_0x83e3('0x0'));exports['create']=function(_0x1a4e01){return client[_0x83e3('0x1')]('CreateMailMessage',{'body':_0x1a4e01,'log':_0x83e3('0x2')});}; \ No newline at end of file +var _0x6c59=['../client','create','Request','CreateMailMessage'];(function(_0x217a33,_0x195db5){var _0xb2b50f=function(_0x5444ab){while(--_0x5444ab){_0x217a33['push'](_0x217a33['shift']());}};_0xb2b50f(++_0x195db5);}(_0x6c59,0x1dc));var _0x96c5=function(_0xde9852,_0x17456){_0xde9852=_0xde9852-0x0;var _0x49e3a0=_0x6c59[_0xde9852];return _0x49e3a0;};'use strict';var client=require(_0x96c5('0x0'));exports[_0x96c5('0x1')]=function(_0xa29810){return client[_0x96c5('0x2')](_0x96c5('0x3'),{'body':_0xa29810,'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 469a130..b7a1459 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 _0xeaf3=['mailPause','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents','online'];(function(_0x3ee12c,_0x3b8f51){var _0x4fb3b7=function(_0x1ebd2a){while(--_0x1ebd2a){_0x3ee12c['push'](_0x3ee12c['shift']());}};_0x4fb3b7(++_0x3b8f51);}(_0xeaf3,0x1cd));var _0x3eaf=function(_0x3497e1,_0x46134d){_0x3497e1=_0x3497e1-0x0;var _0x34cf54=_0xeaf3[_0x3497e1];return _0x34cf54;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x3eaf('0x0')](_0x3eaf('0x1'),{'options':{'raw':![],'attributes':['id',_0x3eaf('0x2'),_0x3eaf('0x3'),_0x3eaf('0x4')],'include':[{'model':'User','as':_0x3eaf('0x5'),'attributes':['id',_0x3eaf('0x2'),_0x3eaf('0x6'),_0x3eaf('0x7')]}]},'log':_0x3eaf('0x8')});};}; \ No newline at end of file +var _0xb67c=['Request','GetMailQueue','name','strategy','User','online','getMailQueues','../client'];(function(_0x54227c,_0x293b09){var _0x244510=function(_0x4f908e){while(--_0x4f908e){_0x54227c['push'](_0x54227c['shift']());}};_0x244510(++_0x293b09);}(_0xb67c,0x97));var _0xcb67=function(_0x2b76dc,_0x3ddb93){_0x2b76dc=_0x2b76dc-0x0;var _0x4ee7eb=_0xb67c[_0x2b76dc];return _0x4ee7eb;};'use strict';var client=require(_0xcb67('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xcb67('0x1')](_0xcb67('0x2'),{'options':{'raw':![],'attributes':['id',_0xcb67('0x3'),'timeout',_0xcb67('0x4')],'include':[{'model':_0xcb67('0x5'),'as':'Agents','attributes':['id',_0xcb67('0x3'),_0xcb67('0x6'),'mailPause']}]},'log':_0xcb67('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 89fa2ab..1e846c3 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 _0xd9bb=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x1506fc,_0x2087b8){var _0x26eddd=function(_0x3b5f9d){while(--_0x3b5f9d){_0x1506fc['push'](_0x1506fc['shift']());}};_0x26eddd(++_0x2087b8);}(_0xd9bb,0x11d));var _0xbd9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9bb[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xbd9b('0x0')]=function(_0x5b1b54){return client[_0xbd9b('0x1')](_0xbd9b('0x2'),{'body':_0x5b1b54,'log':'CreateMailQueueReport'});};exports[_0xbd9b('0x3')]=function(_0x65b80b,_0x1b27b2){return client[_0xbd9b('0x1')](_0xbd9b('0x4'),{'body':_0x1b27b2,'options':{'where':{'uniqueid':_0x65b80b},'order':[['id',_0xbd9b('0x5')]],'limit':0x1},'log':_0xbd9b('0x4')});}; \ No newline at end of file +var _0x80c1=['../client','create','CreateMailQueueReport','UpdateMailQueueReport','DESC'];(function(_0x292805,_0xc06d0c){var _0x40f5a7=function(_0x1e3730){while(--_0x1e3730){_0x292805['push'](_0x292805['shift']());}};_0x40f5a7(++_0xc06d0c);}(_0x80c1,0x82));var _0x180c=function(_0x22277b,_0x569f05){_0x22277b=_0x22277b-0x0;var _0x30465b=_0x80c1[_0x22277b];return _0x30465b;};'use strict';var client=require(_0x180c('0x0'));exports[_0x180c('0x1')]=function(_0x59e54d){return client['Request']('CreateMailQueueReport',{'body':_0x59e54d,'log':_0x180c('0x2')});};exports['update']=function(_0x12a047,_0x33aa4c){return client['Request'](_0x180c('0x3'),{'body':_0x33aa4c,'options':{'where':{'uniqueid':_0x12a047},'order':[['id',_0x180c('0x4')]],'limit':0x1},'log':_0x180c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 084595e..7246f82 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 _0x04ad=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x2fba83,_0x23638f){var _0x1536d9=function(_0x2cc5bf){while(--_0x2cc5bf){_0x2fba83['push'](_0x2fba83['shift']());}};_0x1536d9(++_0x23638f);}(_0x04ad,0x1b9));var _0xd04a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x04ad[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xd04a('0x0'));exports['update']=function(_0x1fbdc5,_0x151936){return client[_0xd04a('0x1')](_0xd04a('0x2'),{'body':_0x151936,'options':{'where':{'id':_0x1fbdc5}},'log':_0xd04a('0x3')});};exports[_0xd04a('0x4')]=function(_0x591db0,_0x25b6e0){return client['Request'](_0xd04a('0x5'),{'body':_0x25b6e0,'options':{'where':{'id':_0x591db0}},'log':_0xd04a('0x6')});}; \ No newline at end of file +var _0xca90=['../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request'];(function(_0x176247,_0xcc86d0){var _0x2281f0=function(_0x33dedd){while(--_0x33dedd){_0x176247['push'](_0x176247['shift']());}};_0x2281f0(++_0xcc86d0);}(_0xca90,0x150));var _0x0ca9=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xca90[_0x2dadb9];return _0x2f0097;};'use strict';var client=require(_0x0ca9('0x0'));exports[_0x0ca9('0x1')]=function(_0x5856df,_0x4f239f){return client['Request'](_0x0ca9('0x2'),{'body':_0x4f239f,'options':{'where':{'id':_0x5856df}},'log':_0x0ca9('0x3')});};exports[_0x0ca9('0x4')]=function(_0x3151e3,_0x4144cc){return client[_0x0ca9('0x5')]('AddTagsToOpenchannelInteraction',{'body':_0x4144cc,'options':{'where':{'id':_0x3151e3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 94f1153..7601fde 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 _0xc9b0=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc9b0,0x160));var _0x0c9b=function(_0xb8d513,_0x5ca8af){_0xb8d513=_0xb8d513-0x0;var _0x1853e6=_0xc9b0[_0xb8d513];return _0x1853e6;};'use strict';var client=require(_0x0c9b('0x0'));exports[_0x0c9b('0x1')]=function(_0x30dc84){return client[_0x0c9b('0x2')](_0x0c9b('0x3'),{'body':_0x30dc84,'log':_0x0c9b('0x4')});}; \ No newline at end of file +var _0x0594=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x542748,_0x241822){var _0x29e03d=function(_0x10261b){while(--_0x10261b){_0x542748['push'](_0x542748['shift']());}};_0x29e03d(++_0x241822);}(_0x0594,0x13d));var _0x4059=function(_0x35675b,_0x34cbe3){_0x35675b=_0x35675b-0x0;var _0x46264b=_0x0594[_0x35675b];return _0x46264b;};'use strict';var client=require(_0x4059('0x0'));exports[_0x4059('0x1')]=function(_0x3d6b5a){return client[_0x4059('0x2')](_0x4059('0x3'),{'body':_0x3d6b5a,'log':_0x4059('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index bac2a4b..d31d8d0 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 _0x8f37=['../client','getOpenchannelQueues','Request','timeout','strategy','User','name','openchannelPause'];(function(_0x533f2e,_0x5afbfb){var _0x32aa94=function(_0x3b51b9){while(--_0x3b51b9){_0x533f2e['push'](_0x533f2e['shift']());}};_0x32aa94(++_0x5afbfb);}(_0x8f37,0x190));var _0x78f3=function(_0x3efdd5,_0x214fb9){_0x3efdd5=_0x3efdd5-0x0;var _0x2e66f8=_0x8f37[_0x3efdd5];return _0x2e66f8;};'use strict';var client=require(_0x78f3('0x0'));exports[_0x78f3('0x1')]=function(){return function(){return client[_0x78f3('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x78f3('0x3'),_0x78f3('0x4')],'include':[{'model':_0x78f3('0x5'),'as':'Agents','attributes':['id',_0x78f3('0x6'),'online',_0x78f3('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x4566=['../client','getOpenchannelQueues','GetOpenchannelQueue','name','User','Agents','online','openchannelPause'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x4566,0xe8));var _0x6456=function(_0x2c3686,_0x534af6){_0x2c3686=_0x2c3686-0x0;var _0x55cd1b=_0x4566[_0x2c3686];return _0x55cd1b;};'use strict';var client=require(_0x6456('0x0'));exports[_0x6456('0x1')]=function(){return function(){return client['Request'](_0x6456('0x2'),{'options':{'raw':![],'attributes':['id',_0x6456('0x3'),'timeout','strategy'],'include':[{'model':_0x6456('0x4'),'as':_0x6456('0x5'),'attributes':['id','name',_0x6456('0x6'),_0x6456('0x7')]}]},'log':_0x6456('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 45ef80f..783fc0f 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 _0x7827=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','Request'];(function(_0x37ede0,_0x42d1bd){var _0xd82c76=function(_0x11b6ba){while(--_0x11b6ba){_0x37ede0['push'](_0x37ede0['shift']());}};_0xd82c76(++_0x42d1bd);}(_0x7827,0x1aa));var _0x7782=function(_0x54d03d,_0x56e299){_0x54d03d=_0x54d03d-0x0;var _0x318209=_0x7827[_0x54d03d];return _0x318209;};'use strict';var client=require(_0x7782('0x0'));exports[_0x7782('0x1')]=function(_0x38713d){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x38713d,'log':_0x7782('0x2')});};exports['update']=function(_0x519228,_0x2e7677){return client[_0x7782('0x3')](_0x7782('0x4'),{'body':_0x2e7677,'options':{'where':{'uniqueid':_0x519228},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xc986=['Request','update','UpdateOpenchannelQueueReport','create'];(function(_0x46f689,_0x4301a0){var _0xf3b853=function(_0x359fb1){while(--_0x359fb1){_0x46f689['push'](_0x46f689['shift']());}};_0xf3b853(++_0x4301a0);}(_0xc986,0xef));var _0x6c98=function(_0x26a31e,_0x273d4b){_0x26a31e=_0x26a31e-0x0;var _0x28897a=_0xc986[_0x26a31e];return _0x28897a;};'use strict';var client=require('../client');exports[_0x6c98('0x0')]=function(_0x32c16d){return client[_0x6c98('0x1')]('CreateOpenchannelQueueReport',{'body':_0x32c16d,'log':'CreateOpenchannelQueueReport'});};exports[_0x6c98('0x2')]=function(_0x4a209f,_0x117e3b){return client[_0x6c98('0x1')](_0x6c98('0x3'),{'body':_0x117e3b,'options':{'where':{'uniqueid':_0x4a209f},'order':[['id','DESC']],'limit':0x1},'log':_0x6c98('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index d6f8ef8..dc57779 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 _0xac21=['Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x54820c,_0xd5a2f6){var _0x5c60c1=function(_0x495680){while(--_0x495680){_0x54820c['push'](_0x54820c['shift']());}};_0x5c60c1(++_0xd5a2f6);}(_0xac21,0x1af));var _0x1ac2=function(_0x52d260,_0x3aefeb){_0x52d260=_0x52d260-0x0;var _0x39c1a1=_0xac21[_0x52d260];return _0x39c1a1;};'use strict';var client=require('../client');exports[_0x1ac2('0x0')]=function(_0x3bfe28,_0x4e937a){return client[_0x1ac2('0x1')]('UpdateSmsInteraction',{'body':_0x4e937a,'options':{'where':{'id':_0x3bfe28}},'log':_0x1ac2('0x2')});};exports[_0x1ac2('0x3')]=function(_0x5b81be,_0x454461){return client['Request'](_0x1ac2('0x4'),{'body':_0x454461,'options':{'where':{'id':_0x5b81be}},'log':_0x1ac2('0x5')});}; \ No newline at end of file +var _0x6aa7=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','addTags'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x6aa7,0x178));var _0x76aa=function(_0x1a65d,_0x146e71){_0x1a65d=_0x1a65d-0x0;var _0x5906a2=_0x6aa7[_0x1a65d];return _0x5906a2;};'use strict';var client=require(_0x76aa('0x0'));exports['update']=function(_0x2cbbdd,_0xe07754){return client[_0x76aa('0x1')](_0x76aa('0x2'),{'body':_0xe07754,'options':{'where':{'id':_0x2cbbdd}},'log':'updateSmsInteraction'});};exports[_0x76aa('0x3')]=function(_0xef15ef,_0x1d6e04){return client['Request']('AddTagsToSmsInteraction',{'body':_0x1d6e04,'options':{'where':{'id':_0xef15ef}},'log':_0x76aa('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 906f0b9..ad108e3 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 _0x82b4=['CreateSmsMessage','../client','create','Request'];(function(_0x42c9bc,_0x5b722b){var _0x278bcf=function(_0x4d79a9){while(--_0x4d79a9){_0x42c9bc['push'](_0x42c9bc['shift']());}};_0x278bcf(++_0x5b722b);}(_0x82b4,0xd9));var _0x482b=function(_0x3efa7f,_0x90cf6a){_0x3efa7f=_0x3efa7f-0x0;var _0x3b5bd2=_0x82b4[_0x3efa7f];return _0x3b5bd2;};'use strict';var client=require(_0x482b('0x0'));exports[_0x482b('0x1')]=function(_0x4ebecb){return client[_0x482b('0x2')](_0x482b('0x3'),{'body':_0x4ebecb,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x2186=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2186,0x199));var _0x6218=function(_0x3fd3a4,_0x351b73){_0x3fd3a4=_0x3fd3a4-0x0;var _0x1d89c1=_0x2186[_0x3fd3a4];return _0x1d89c1;};'use strict';var client=require(_0x6218('0x0'));exports[_0x6218('0x1')]=function(_0x39ff7a){return client[_0x6218('0x2')](_0x6218('0x3'),{'body':_0x39ff7a,'log':_0x6218('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 86615d8..0d023e9 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(_0x42cb34,_0x4ae013){var _0x3a163f=function(_0x1cf2d6){while(--_0x1cf2d6){_0x42cb34['push'](_0x42cb34['shift']());}};_0x3a163f(++_0x4ae013);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xa82f44,_0x4ec847){var _0x25d779=function(_0x1d4267){while(--_0x1d4267){_0xa82f44['push'](_0xa82f44['shift']());}};_0x25d779(++_0x4ec847);}(_0xe706,0xa3));var _0x6e70=function(_0xa5a920,_0x2d8772){_0xa5a920=_0xa5a920-0x0;var _0x596618=_0xe706[_0xa5a920];return _0x596618;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 6866217..904828a 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(_0xcf4947,_0x508c1b){var _0x550ef1=function(_0x5aabdc){while(--_0x5aabdc){_0xcf4947['push'](_0xcf4947['shift']());}};_0x550ef1(++_0x508c1b);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x24c95f,_0x56df8d){var _0x127a05=function(_0x5c2926){while(--_0x5c2926){_0x24c95f['push'](_0x24c95f['shift']());}};_0x127a05(++_0x56df8d);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index c9df268..367d3db 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(_0x541554,_0x566051){var _0xd17e04=function(_0x3b8340){while(--_0x3b8340){_0x541554['push'](_0x541554['shift']());}};_0xd17e04(++_0x566051);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x32fa76,_0x25ad13){var _0x6c5467=function(_0x15dde5){while(--_0x15dde5){_0x32fa76['push'](_0x32fa76['shift']());}};_0x6c5467(++_0x25ad13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 66deb11..1e857dc 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 _0x323f=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x323f,0x1ee));var _0xf323=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x323f[_0x56482c];return _0x5aae7a;};'use strict';var client=require('../client');exports[_0xf323('0x0')]=function(_0x564979,_0x766661){return client[_0xf323('0x1')](_0xf323('0x2'),{'body':_0x766661,'options':{'where':{'id':_0x564979}},'log':_0xf323('0x3')});};exports[_0xf323('0x4')]=function(_0x2c9d35,_0xb4caa8){return client[_0xf323('0x1')](_0xf323('0x5'),{'body':_0xb4caa8,'options':{'where':{'id':_0x2c9d35}},'log':_0xf323('0x6')});}; \ No newline at end of file +var _0x4148=['../client','update','Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4148,0xc6));var _0x8414=function(_0x19f000,_0x39ac54){_0x19f000=_0x19f000-0x0;var _0x81cee0=_0x4148[_0x19f000];return _0x81cee0;};'use strict';var client=require(_0x8414('0x0'));exports[_0x8414('0x1')]=function(_0x140433,_0xc19cfb){return client[_0x8414('0x2')]('UpdateWhatsappInteraction',{'body':_0xc19cfb,'options':{'where':{'id':_0x140433}},'log':_0x8414('0x3')});};exports[_0x8414('0x4')]=function(_0x41ddde,_0x361d0b){return client['Request'](_0x8414('0x5'),{'body':_0x361d0b,'options':{'where':{'id':_0x41ddde}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 649d241..e9e48e7 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 _0xf94a=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x248c98,_0xb8728e){var _0x1e2f7b=function(_0x3db8a8){while(--_0x3db8a8){_0x248c98['push'](_0x248c98['shift']());}};_0x1e2f7b(++_0xb8728e);}(_0xf94a,0x125));var _0xaf94=function(_0x4b552b,_0xfe6a40){_0x4b552b=_0x4b552b-0x0;var _0x4d4d4b=_0xf94a[_0x4b552b];return _0x4d4d4b;};'use strict';var client=require('../client');exports[_0xaf94('0x0')]=function(_0x155ede){return client[_0xaf94('0x1')](_0xaf94('0x2'),{'body':_0x155ede,'log':_0xaf94('0x3')});}; \ No newline at end of file +var _0x42e8=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x89501c,_0x1911ff){var _0x2ce346=function(_0x454d18){while(--_0x454d18){_0x89501c['push'](_0x89501c['shift']());}};_0x2ce346(++_0x1911ff);}(_0x42e8,0xdf));var _0x842e=function(_0x2def17,_0x1037e4){_0x2def17=_0x2def17-0x0;var _0x52c09c=_0x42e8[_0x2def17];return _0x52c09c;};'use strict';var client=require(_0x842e('0x0'));exports[_0x842e('0x1')]=function(_0x3c66b9){return client[_0x842e('0x2')](_0x842e('0x3'),{'body':_0x3c66b9,'log':_0x842e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 2cfdfc0..f914b79 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 _0x2a42=['name','timeout','strategy','User','whatsappPause','getWhatsappQueues','../client','Request'];(function(_0x40d091,_0x1b6814){var _0x46f88a=function(_0xe390f2){while(--_0xe390f2){_0x40d091['push'](_0x40d091['shift']());}};_0x46f88a(++_0x1b6814);}(_0x2a42,0x1e6));var _0x22a4=function(_0x2e30f4,_0x34024c){_0x2e30f4=_0x2e30f4-0x0;var _0x4c5244=_0x2a42[_0x2e30f4];return _0x4c5244;};'use strict';var client=require(_0x22a4('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x22a4('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x22a4('0x2'),_0x22a4('0x3'),_0x22a4('0x4')],'include':[{'model':_0x22a4('0x5'),'as':'Agents','attributes':['id',_0x22a4('0x2'),'online',_0x22a4('0x6')]}]},'log':_0x22a4('0x7')});};}; \ No newline at end of file +var _0x28dd=['timeout','strategy','Agents','online','whatsappPause','getWhatsappQueues','GetWhatsappQueue','name'];(function(_0x188bfe,_0x2517cc){var _0x1a9efa=function(_0x361964){while(--_0x361964){_0x188bfe['push'](_0x188bfe['shift']());}};_0x1a9efa(++_0x2517cc);}(_0x28dd,0xfd));var _0xd28d=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x28dd[_0x138f59];return _0x3d114d;};'use strict';var client=require('../client');exports[_0xd28d('0x0')]=function(){return function(){return client['Request'](_0xd28d('0x1'),{'options':{'raw':![],'attributes':['id',_0xd28d('0x2'),_0xd28d('0x3'),_0xd28d('0x4')],'include':[{'model':'User','as':_0xd28d('0x5'),'attributes':['id',_0xd28d('0x2'),_0xd28d('0x6'),_0xd28d('0x7')]}]},'log':_0xd28d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index aa1495a..a4ce0dc 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 _0x8fa0=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x44c52c,_0x4f6ce1){var _0x1f1a87=function(_0x4b0fae){while(--_0x4b0fae){_0x44c52c['push'](_0x44c52c['shift']());}};_0x1f1a87(++_0x4f6ce1);}(_0x8fa0,0x64));var _0x08fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fa0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x08fa('0x0'));exports['create']=function(_0x22e9df){return client[_0x08fa('0x1')](_0x08fa('0x2'),{'body':_0x22e9df,'log':_0x08fa('0x2')});};exports[_0x08fa('0x3')]=function(_0x2819c1,_0xc4c641){return client[_0x08fa('0x1')](_0x08fa('0x4'),{'body':_0xc4c641,'options':{'where':{'uniqueid':_0x2819c1},'order':[['id',_0x08fa('0x5')]],'limit':0x1},'log':_0x08fa('0x4')});}; \ No newline at end of file +var _0x2dc7=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x26e9bf,_0x5a6f17){var _0xb779c=function(_0x1064bf){while(--_0x1064bf){_0x26e9bf['push'](_0x26e9bf['shift']());}};_0xb779c(++_0x5a6f17);}(_0x2dc7,0x64));var _0x72dc=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x2dc7[_0x1ae5ab];return _0x1ce001;};'use strict';var client=require(_0x72dc('0x0'));exports[_0x72dc('0x1')]=function(_0x1fd868){return client[_0x72dc('0x2')](_0x72dc('0x3'),{'body':_0x1fd868,'log':_0x72dc('0x3')});};exports[_0x72dc('0x4')]=function(_0x4e3793,_0xb79637){return client['Request'](_0x72dc('0x5'),{'body':_0xb79637,'options':{'where':{'uniqueid':_0x4e3793},'order':[['id','DESC']],'limit':0x1},'log':_0x72dc('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index df3a933..edc244f 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 _0x94de=['length','error','[%s][AGENT]\x20%s','map','stop','find','agents','createQueue','atimeout','channel','format','START:%s','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x2029d5,_0x46b58f){var _0x1fa3df=function(_0x3b6d15){while(--_0x3b6d15){_0x2029d5['push'](_0x2029d5['shift']());}};_0x1fa3df(++_0x46b58f);}(_0x94de,0x12f));var _0xe94d=function(_0xdd25e4,_0x491d3c){_0xdd25e4=_0xdd25e4-0x0;var _0x57994e=_0x94de[_0xdd25e4];return _0x57994e;};'use strict';var schema=require(_0xe94d('0x0'));var _=require(_0xe94d('0x1'));var util=require(_0xe94d('0x2'));var seqqueue=require(_0xe94d('0x3'));var logger=require('../../../../config/logger')(_0xe94d('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xe94d('0x5'),'required':!![],'message':_0xe94d('0x6')},'timeout':{'type':_0xe94d('0x7'),'message':_0xe94d('0x8')}});function writeLog(_0x524804,_0x40226d,_0x3e3dbb){return logger['info'](util['format'](_0xe94d('0x9'),_0x524804,_0x40226d['name'],_0x3e3dbb));}function handleFindAgent(_0x2add4b){return function(_0x513d9e){return _0x513d9e[_0xe94d('0xa')]['toLowerCase']()===_0x2add4b[_0xe94d('0xb')]();};}exports['consequence']=function(_0x40bc9f,_0x1966a0,_0xb56b3e,_0xd59178){return function(_0x3977ee){try{var _0x488989={'name':_0x1966a0[0x0],'timeout':_0x1966a0[0x1]};var _0x571fe8=queue[_0xe94d('0x0')](_0x488989,{'typecast':!![]});if(_0x571fe8[_0xe94d('0xc')]){logger[_0xe94d('0xd')](_0xe94d('0xe'),_0x40bc9f,_[_0xe94d('0xf')](_0x571fe8,'message')['join'](',\x20'));_0x3977ee[_0xe94d('0x10')]();}else{var _0x45f015=_[_0xe94d('0x11')](_0xb56b3e[_0xe94d('0x12')],handleFindAgent(_0x488989[_0xe94d('0xa')]));if(_0x45f015){var _0x582841=(_0x488989['timeout']||0xa)*0x3e8;var _0x199e19,_0x17bce4;var _0x10cad6=seqqueue[_0xe94d('0x13')](_0x582841);_0x10cad6['id']=_0x40bc9f;_0x10cad6[_0xe94d('0x14')]=_0x582841;_0x10cad6[_0xe94d('0x15')]=_0xd59178[_0xe94d('0x15')];writeLog(_0x40bc9f,_0x45f015,util[_0xe94d('0x16')](_0xe94d('0x17'),_0x582841));_0xb56b3e['rules'][_0x40bc9f]['on']('end',function(){logger[_0xe94d('0x18')](_0xe94d('0x19'),_0x40bc9f);clearTimeout(_0x17bce4);_0x17bce4=undefined;_0x10cad6[_0xe94d('0x1a')]();if(_0xb56b3e[_0xe94d('0x1b')][_0x40bc9f]){delete _0xb56b3e[_0xe94d('0x1b')][_0x40bc9f];}_0x3977ee[_0xe94d('0x10')]();});_0xb56b3e[_0xe94d('0x1b')][_0x40bc9f]['on'](_0xe94d('0x1c'),function(){if(_0xb56b3e[_0xe94d('0x1b')][_0x40bc9f]){delete _0xb56b3e['rules'][_0x40bc9f];}});_0x17bce4=setTimeout(function(){logger['info'](_0xe94d('0x1d'),_0x40bc9f);clearTimeout(_0x17bce4);_0x10cad6['close']();_0x3977ee[_0xe94d('0x1e')]();},_0x582841);strategy[_0xe94d('0x1f')](_0x10cad6,_0x45f015,_0xb56b3e,_0xd59178);}else{logger[_0xe94d('0xd')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x40bc9f,_0x488989[_0xe94d('0xa')]);_0x3977ee[_0xe94d('0x10')]();}}}catch(_0x7c43e){console[_0xe94d('0x20')](_0x7c43e);logger[_0xe94d('0xd')](_0xe94d('0x21'),_0x40bc9f,_0x7c43e[_0xe94d('0x22')]);_0x3977ee[_0xe94d('0x10')]();}};}; \ No newline at end of file +var _0xad68=['util','seq-queue','./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','validate','length','[%s][AGENT]\x20%s','join','agents','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s'];(function(_0x20fc31,_0x246e0a){var _0x1151b6=function(_0xa9b3f){while(--_0xa9b3f){_0x20fc31['push'](_0x20fc31['shift']());}};_0x1151b6(++_0x246e0a);}(_0xad68,0x100));var _0x8ad6=function(_0x1d5daa,_0x452e80){_0x1d5daa=_0x1d5daa-0x0;var _0x5d14b1=_0xad68[_0x1d5daa];return _0x5d14b1;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8ad6('0x0'));var seqqueue=require(_0x8ad6('0x1'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x8ad6('0x2'));var queue=schema({'name':{'type':_0x8ad6('0x3'),'required':!![],'message':_0x8ad6('0x4')},'timeout':{'type':_0x8ad6('0x5'),'message':_0x8ad6('0x6')}});function writeLog(_0x2f1d3b,_0x3efdb7,_0x5273c2){return logger[_0x8ad6('0x7')](util[_0x8ad6('0x8')](_0x8ad6('0x9'),_0x2f1d3b,_0x3efdb7[_0x8ad6('0xa')],_0x5273c2));}function handleFindAgent(_0x2680e5){return function(_0x5bf349){return _0x5bf349['name'][_0x8ad6('0xb')]()===_0x2680e5[_0x8ad6('0xb')]();};}exports['consequence']=function(_0x4b5b88,_0x268397,_0x1196f3,_0x9fc298){return function(_0x3bdaaf){try{var _0x46e305={'name':_0x268397[0x0],'timeout':_0x268397[0x1]};var _0x22c63e=queue[_0x8ad6('0xc')](_0x46e305,{'typecast':!![]});if(_0x22c63e[_0x8ad6('0xd')]){logger['error'](_0x8ad6('0xe'),_0x4b5b88,_['map'](_0x22c63e,'message')[_0x8ad6('0xf')](',\x20'));_0x3bdaaf['stop']();}else{var _0x329fca=_['find'](_0x1196f3[_0x8ad6('0x10')],handleFindAgent(_0x46e305[_0x8ad6('0xa')]));if(_0x329fca){var _0xc0ca7f=(_0x46e305['timeout']||0xa)*0x3e8;var _0x45e709,_0x1fed01;var _0x37a7f0=seqqueue[_0x8ad6('0x11')](_0xc0ca7f);_0x37a7f0['id']=_0x4b5b88;_0x37a7f0[_0x8ad6('0x12')]=_0xc0ca7f;_0x37a7f0[_0x8ad6('0x13')]=_0x9fc298[_0x8ad6('0x13')];writeLog(_0x4b5b88,_0x329fca,util[_0x8ad6('0x8')]('START:%s',_0xc0ca7f));_0x1196f3[_0x8ad6('0x14')][_0x4b5b88]['on'](_0x8ad6('0x15'),function(){logger[_0x8ad6('0x7')](_0x8ad6('0x16'),_0x4b5b88);clearTimeout(_0x1fed01);_0x1fed01=undefined;_0x37a7f0[_0x8ad6('0x17')]();if(_0x1196f3[_0x8ad6('0x14')][_0x4b5b88]){delete _0x1196f3[_0x8ad6('0x14')][_0x4b5b88];}_0x3bdaaf['stop']();});_0x1196f3[_0x8ad6('0x14')][_0x4b5b88]['on'](_0x8ad6('0x18'),function(){if(_0x1196f3[_0x8ad6('0x14')][_0x4b5b88]){delete _0x1196f3['rules'][_0x4b5b88];}});_0x1fed01=setTimeout(function(){logger[_0x8ad6('0x7')](_0x8ad6('0x19'),_0x4b5b88);clearTimeout(_0x1fed01);_0x37a7f0[_0x8ad6('0x17')]();_0x3bdaaf[_0x8ad6('0x1a')]();},_0xc0ca7f);strategy[_0x8ad6('0x1b')](_0x37a7f0,_0x329fca,_0x1196f3,_0x9fc298);}else{logger[_0x8ad6('0x1c')](_0x8ad6('0x1d'),_0x4b5b88,_0x46e305[_0x8ad6('0xa')]);_0x3bdaaf[_0x8ad6('0x1e')]();}}}catch(_0x5708ee){console['log'](_0x5708ee);logger[_0x8ad6('0x1c')](_0x8ad6('0x1f'),_0x4b5b88,_0x5708ee['stack']);_0x3bdaaf[_0x8ad6('0x1e')]();}};}; \ 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 c3247df..c2c083e 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 _0x12f6=['aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','interaction','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText','amazonlex','providerName','providerResponse','stringify','then','moment'];(function(_0x8806a6,_0x686e06){var _0x49cdd3=function(_0x1b0358){while(--_0x1b0358){_0x8806a6['push'](_0x8806a6['shift']());}};_0x49cdd3(++_0x686e06);}(_0x12f6,0xdb));var _0x612f=function(_0x5cdfbc,_0x5415af){_0x5cdfbc=_0x5cdfbc-0x0;var _0x224686=_0x12f6[_0x5cdfbc];return _0x224686;};'use strict';var _=require('lodash');var moment=require(_0x612f('0x0'));var AWS=require(_0x612f('0x1'));var utils=require(_0x612f('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x612f('0x3')),'openchannelMessage':require(_0x612f('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x612f('0x5')),'faxMessage':require(_0x612f('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x1fd2b1,_0xc7b561){return function(_0x3a7335){try{if(!_['isNil'](this['interaction'][_0x612f('0x7')])){logger[_0x612f('0x8')](_0x612f('0x9'),_0x1fd2b1,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3a7335[_0x612f('0xa')]();}var _0x25e4a1={'ContactId':this[_0x612f('0xb')]['id'],'sentAt':moment()[_0x612f('0xc')](_0x612f('0xd')),'direction':_0x612f('0xe')};if(this[_0x612f('0xf')]===_0x612f('0x10')||this[_0x612f('0xf')]===_0x612f('0x11')){_0x25e4a1[_0x612f('0x12')]=this[_0x612f('0x13')][_0x612f('0x12')];}var _0x189098=this[_0x612f('0xf')];if(_0x189098==='chat'){_0x25e4a1[_0x612f('0x14')]=this[_0x612f('0x15')]['id'];}else{_0x25e4a1[_[_0x612f('0x16')](_0x189098)+_0x612f('0x17')]=this[_0x612f('0x15')]['id'];}_0x25e4a1[_['upperFirst'](_0x189098)+_0x612f('0x18')]=this[_0x612f('0x13')]['id'];if(this[_0x612f('0x13')][_0x612f('0x19')]){var _0x3577f4=_0xc7b561[0x4];if(!_[_0x612f('0x1a')](_0x3577f4)){_0x25e4a1[_0x612f('0x1b')]=utils[_0x612f('0x1c')](_0x3577f4,this);return rpc[_0x189098+'Message'][_0x612f('0x1d')](_0x25e4a1)['then'](function(_0x1f29fc){logger[_0x612f('0x8')](_0x612f('0x9'),_0x1fd2b1,_0x25e4a1[_0x612f('0x1b')]);})[_0x612f('0x1e')](function(_0x3fad2c){logger[_0x612f('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x1fd2b1,JSON['stringify'](_0x3fad2c));})[_0x612f('0x20')](function(){logger[_0x612f('0x8')](_0x612f('0x21'),_0x1fd2b1);_0x3a7335[_0x612f('0x22')]();});}else{logger[_0x612f('0x8')](_0x612f('0x23'),_0x1fd2b1);_0x3a7335[_0x612f('0x22')]();}}else{var _0xb5b714=this;var _0xf528fc=new AWS[(_0x612f('0x24'))]({'accessKeyId':_0xc7b561[0x0],'secretAccessKey':_0xc7b561[0x1],'region':_0xc7b561[0x2]});var _0x1343c3={'botAlias':'$LATEST','botName':_0xc7b561[0x3],'inputText':this[_0x612f('0x25')][_0x612f('0x1b')],'userId':this['channel']+':'+this[_0x612f('0x13')]['id']['toString']()};_0xf528fc[_0x612f('0x26')](_0x1343c3,function(_0x5a5db8,_0x573eb1){if(_0x5a5db8){logger[_0x612f('0x1f')](_0x612f('0x9'),_0x1fd2b1,_0x5a5db8[_0x612f('0x25')]);_0x3a7335[_0x612f('0xa')]();}else if(_0x573eb1&&_0x573eb1[_0x612f('0x25')]){_0xb5b714['body'][_0x612f('0x27')]=_0x573eb1;_0x25e4a1[_0x612f('0x1b')]=_0x573eb1[_0x612f('0x25')];_0x25e4a1[_0x612f('0x28')]=_0x612f('0x27');_0x25e4a1[_0x612f('0x29')]=JSON[_0x612f('0x2a')](_0x573eb1);return rpc[_0x189098+'Message']['create'](_0x25e4a1)[_0x612f('0x2b')](function(_0x2bdf94){logger[_0x612f('0x8')](_0x612f('0x9'),_0x1fd2b1,_0x25e4a1[_0x612f('0x1b')]);if(_0x573eb1['dialogState']=='Failed'){_0x3a7335[_0x612f('0xa')]();}else{_0x3a7335[_0x612f('0x22')]();}})[_0x612f('0x1e')](function(_0x2b500b){logger[_0x612f('0x1f')](_0x612f('0x9'),_0x1fd2b1,JSON[_0x612f('0x2a')](_0x2b500b));_0x3a7335[_0x612f('0xa')]();});}else{_0x3a7335[_0x612f('0xa')]();}});}}catch(_0x2a19b1){logger[_0x612f('0x1f')](_0x612f('0x9'),_0x1fd2b1,JSON[_0x612f('0x2a')](_0x2a19b1));_0x3a7335[_0x612f('0x22')]();}};}; \ No newline at end of file +var _0x42cd=['then','[%s][AMAZONLEX]\x20%s','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','interaction','phone','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','Message','create'];(function(_0x644ecd,_0x397f36){var _0x1c66ce=function(_0x4cf42b){while(--_0x4cf42b){_0x644ecd['push'](_0x644ecd['shift']());}};_0x1c66ce(++_0x397f36);}(_0x42cd,0x10c));var _0xd42c=function(_0x2b022e,_0x213976){_0x2b022e=_0x2b022e-0x0;var _0x38d98d=_0x42cd[_0x2b022e];return _0x38d98d;};'use strict';var _=require(_0xd42c('0x0'));var moment=require(_0xd42c('0x1'));var AWS=require(_0xd42c('0x2'));var utils=require(_0xd42c('0x3'));var logger=require(_0xd42c('0x4'))(_0xd42c('0x5'));var rpc={'chatMessage':require(_0xd42c('0x6')),'openchannelMessage':require(_0xd42c('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd42c('0x8')),'faxMessage':require(_0xd42c('0x9')),'whatsappMessage':require(_0xd42c('0xa'))};exports['consequence']=function(_0x1b0188,_0x4a33a8){return function(_0x1749d1){try{if(!_[_0xd42c('0xb')](this['interaction']['UserId'])){logger[_0xd42c('0xc')]('[%s][AMAZONLEX]\x20%s',_0x1b0188,_0xd42c('0xd'));return _0x1749d1[_0xd42c('0xe')]();}var _0xa1fb9f={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd42c('0xf')](_0xd42c('0x10')),'direction':_0xd42c('0x11')};if(this[_0xd42c('0x12')]===_0xd42c('0x13')||this[_0xd42c('0x12')]===_0xd42c('0x14')){_0xa1fb9f['phone']=this[_0xd42c('0x15')][_0xd42c('0x16')];}var _0x4ab4ce=this[_0xd42c('0x12')];if(_0x4ab4ce==='chat'){_0xa1fb9f[_0xd42c('0x17')]=this[_0xd42c('0x18')]['id'];}else{_0xa1fb9f[_[_0xd42c('0x19')](_0x4ab4ce)+_0xd42c('0x1a')]=this[_0xd42c('0x18')]['id'];}_0xa1fb9f[_[_0xd42c('0x19')](_0x4ab4ce)+'InteractionId']=this[_0xd42c('0x15')]['id'];if(this[_0xd42c('0x15')][_0xd42c('0x1b')]){var _0x452e3d=_0x4a33a8[0x4];if(!_[_0xd42c('0x1c')](_0x452e3d)){_0xa1fb9f[_0xd42c('0x1d')]=utils['getMustacheRender'](_0x452e3d,this);return rpc[_0x4ab4ce+_0xd42c('0x1e')][_0xd42c('0x1f')](_0xa1fb9f)[_0xd42c('0x20')](function(_0x35c3a1){logger[_0xd42c('0xc')](_0xd42c('0x21'),_0x1b0188,_0xa1fb9f['body']);})['catch'](function(_0x366b04){logger[_0xd42c('0x22')](_0xd42c('0x21'),_0x1b0188,JSON['stringify'](_0x366b04));})[_0xd42c('0x23')](function(){logger[_0xd42c('0xc')](_0xd42c('0x24'),_0x1b0188);_0x1749d1[_0xd42c('0x25')]();});}else{logger['info'](_0xd42c('0x26'),_0x1b0188);_0x1749d1[_0xd42c('0x25')]();}}else{var _0x52b53a=this;var _0x24a125=new AWS[(_0xd42c('0x27'))]({'accessKeyId':_0x4a33a8[0x0],'secretAccessKey':_0x4a33a8[0x1],'region':_0x4a33a8[0x2]});var _0x29b9ab={'botAlias':_0xd42c('0x28'),'botName':_0x4a33a8[0x3],'inputText':this[_0xd42c('0x29')][_0xd42c('0x1d')],'userId':this[_0xd42c('0x12')]+':'+this[_0xd42c('0x15')]['id'][_0xd42c('0x2a')]()};_0x24a125['postText'](_0x29b9ab,function(_0x24ec3b,_0x5b64ba){if(_0x24ec3b){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1b0188,_0x24ec3b[_0xd42c('0x29')]);_0x1749d1[_0xd42c('0xe')]();}else if(_0x5b64ba&&_0x5b64ba[_0xd42c('0x29')]){_0x52b53a['body'][_0xd42c('0x2b')]=_0x5b64ba;_0xa1fb9f[_0xd42c('0x1d')]=_0x5b64ba[_0xd42c('0x29')];_0xa1fb9f[_0xd42c('0x2c')]=_0xd42c('0x2b');_0xa1fb9f[_0xd42c('0x2d')]=JSON[_0xd42c('0x2e')](_0x5b64ba);return rpc[_0x4ab4ce+_0xd42c('0x1e')][_0xd42c('0x1f')](_0xa1fb9f)['then'](function(_0x4eadde){logger[_0xd42c('0xc')](_0xd42c('0x21'),_0x1b0188,_0xa1fb9f[_0xd42c('0x1d')]);if(_0x5b64ba[_0xd42c('0x2f')]==_0xd42c('0x30')){_0x1749d1[_0xd42c('0xe')]();}else{_0x1749d1[_0xd42c('0x25')]();}})[_0xd42c('0x31')](function(_0xcc2020){logger[_0xd42c('0x22')](_0xd42c('0x21'),_0x1b0188,JSON['stringify'](_0xcc2020));_0x1749d1['next']();});}else{_0x1749d1[_0xd42c('0xe')]();}});}}catch(_0x123101){logger[_0xd42c('0x22')]('[%s][AMAZONLEX]\x20%s',_0x1b0188,JSON[_0xd42c('0x2e')](_0x123101));_0x1749d1[_0xd42c('0x25')]();}};}; \ 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 f1877e0..ea7f4a4 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 _0x428a=['[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','body','message','from','phone','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','Message','account','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','','replace','','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x428a,0x1cf));var _0xa428=function(_0x30fd3d,_0x42d8a4){_0x30fd3d=_0x30fd3d-0x0;var _0x1c6c25=_0x428a[_0x30fd3d];return _0x1c6c25;};'use strict';var _=require(_0xa428('0x0'));var moment=require(_0xa428('0x1'));var utils=require(_0xa428('0x2'));var logger=require(_0xa428('0x3'))(_0xa428('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa428('0x5')),'mailMessage':require(_0xa428('0x6')),'smsMessage':require(_0xa428('0x7')),'faxMessage':require(_0xa428('0x8')),'whatsappMessage':require(_0xa428('0x9')),'chatInteraction':require(_0xa428('0xa')),'openchannelInteraction':require(_0xa428('0xb')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xa428('0xc')),'faxInteraction':require(_0xa428('0xd')),'whatsappInteraction':require(_0xa428('0xe'))};var mailRpc=require(_0xa428('0xf'));exports['consequence']=function(_0x44a148,_0x3666ad,_0x5046f6,_0x40909c){return function(_0x17c6d6){try{var _0x3711b0=this[_0xa428('0x10')];if(_0x3711b0==='mail'&&_0x40909c['body'][_0xa428('0x11')]){logger[_0xa428('0x12')](_0xa428('0x13'),_0x44a148,_0xa428('0x14'));return _0x17c6d6[_0xa428('0x15')]();}if(_0x3666ad[0x0]==='1'&&(_[_0xa428('0x16')](this[_0xa428('0x17')]['created'])||!this[_0xa428('0x17')]['created'])){logger[_0xa428('0x12')](_0xa428('0x13'),_0x44a148,_0xa428('0x18'));return _0x17c6d6[_0xa428('0x15')]();}if(_0x3666ad[0x0]==='2'&&this['interaction'][_0xa428('0x19')]){logger[_0xa428('0x12')](_0xa428('0x1a'),_0x44a148,_0xa428('0x1b'));return _0x17c6d6['next']();}var _0x1051cc={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa428('0x1c')](_0xa428('0x1d')),'direction':_0xa428('0x1e')};if(this[_0xa428('0x10')]===_0xa428('0x1f')){_0x1051cc['body']=utils['getMustacheRender'](_0x3666ad[0x2],this);}else{_0x1051cc[_0xa428('0x20')]=utils['getMustacheRender'](_0x3666ad[0x1],this);}if(this[_0xa428('0x21')]){_0x1051cc['to']=this[_0xa428('0x21')][_0xa428('0x22')]||'';if(this[_0xa428('0x10')]===_0xa428('0x1f')&&_0x3666ad[0x1]==='1'){_0x1051cc['cc']=this[_0xa428('0x21')]['cc']||'';}_0x1051cc['from']=this[_0xa428('0x21')]['to']||'';_0x1051cc[_0xa428('0x23')]=this[_0xa428('0x21')][_0xa428('0x23')]||'';_0x1051cc[_0xa428('0x24')]=!![];if(this['message'][_0xa428('0x25')]){_0x1051cc[_0xa428('0x25')]='';_0x1051cc['subject']+=_['startsWith'](this[_0xa428('0x21')]['subject'],_0xa428('0x26'))?'':_0xa428('0x27');_0x1051cc[_0xa428('0x25')]+=this['message'][_0xa428('0x25')];}}if(this[_0xa428('0x10')]===_0xa428('0x28')){_0x1051cc[_0xa428('0x29')]=this['account']['id'];}else{_0x1051cc[_[_0xa428('0x2a')](this['channel'])+_0xa428('0x2b')]=this['account']['id'];}_0x1051cc[_['upperFirst'](this[_0xa428('0x10')])+_0xa428('0x2c')]=this[_0xa428('0x17')]['id'];var _0x8feb7a=this[_0xa428('0x17')];if(rpc[this[_0xa428('0x10')]+_0xa428('0x2d')]){if(this['channel']==='mail'){var _0x3637fc={'tls':{'rejectUnauthorized':![]}};if(this[_0xa428('0x2e')][_0xa428('0x2f')][_0xa428('0x30')]){_0x3637fc[_0xa428('0x30')]=this[_0xa428('0x2e')][_0xa428('0x2f')][_0xa428('0x30')];}else{_0x3637fc[_0xa428('0x31')]=this[_0xa428('0x2e')][_0xa428('0x2f')][_0xa428('0x31')];_0x3637fc['port']=this[_0xa428('0x2e')]['Smtp'][_0xa428('0x32')];_0x3637fc[_0xa428('0x33')]=this['account'][_0xa428('0x2f')]['secure'];}if(this['account'][_0xa428('0x2f')][_0xa428('0x34')]){_0x3637fc[_0xa428('0x35')]={'user':this[_0xa428('0x2e')][_0xa428('0x2f')][_0xa428('0x36')],'pass':this[_0xa428('0x2e')][_0xa428('0x2f')]['pass']};}_0x1051cc[_0xa428('0x37')]=this['message'][_0xa428('0x38')];_0x1051cc[_0xa428('0x39')]=_0xa428('0x3a')+_[_0xa428('0x3b')](_0x1051cc[_0xa428('0x20')],_0xa428('0x3c'),_0xa428('0x3d'))+_0xa428('0x3e');_0x1051cc['headers']={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0xa428('0x3f')};return mailRpc[_0xa428('0x40')](_0x3637fc,_0x1051cc)[_0xa428('0x41')](function(_0x28a9e9){logger['info'](_0xa428('0x42'),_0x44a148);_0x1051cc[_0xa428('0x38')]=_0x28a9e9['message'][_0xa428('0x38')];return rpc[_0x3711b0+_0xa428('0x2d')]['create'](_0x1051cc);})[_0xa428('0x41')](function(_0x1151b1){logger[_0xa428('0x12')](_0xa428('0x13'),_0x44a148,JSON[_0xa428('0x43')](_0x1151b1));})['catch'](function(_0x57c94c){logger[_0xa428('0x44')](_0xa428('0x45'),_0x44a148,JSON[_0xa428('0x43')](_0x57c94c));})['finally'](function(){Promise['resolve']()[_0xa428('0x41')](function(){if(_0x3666ad[0x0]!=='2'||_0x8feb7a[_0xa428('0x19')])return;return rpc[_0x3711b0+_0xa428('0x46')][_0xa428('0x47')](_0x8feb7a['id'],{'autoreplyExecuted':!![]})[_0xa428('0x41')](function(_0x1aa4b4){logger[_0xa428('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x44a148,JSON[_0xa428('0x43')](_0x1aa4b4));})[_0xa428('0x48')](function(_0x5ec802){logger[_0xa428('0x44')](_0xa428('0x49'),_0x44a148,JSON[_0xa428('0x43')](_0x5ec802));});})['then'](function(){_0x17c6d6[_0xa428('0x15')]();});});}else{return rpc[this['channel']+_0xa428('0x2d')]['create'](_0x1051cc)[_0xa428('0x41')](function(_0x19b9da){logger[_0xa428('0x12')]('[%s][AUTOREPLY]\x20%s',_0x44a148,_0x1051cc[_0xa428('0x20')]);})[_0xa428('0x48')](function(_0x10688d){logger['error']('[%s][AUTOREPLY]\x20%s',_0x44a148,JSON[_0xa428('0x43')](_0x10688d));})['finally'](function(){Promise[_0xa428('0x4a')]()[_0xa428('0x41')](function(){if(_0x3666ad[0x0]!=='2'||_0x8feb7a[_0xa428('0x19')])return;return rpc[_0x3711b0+_0xa428('0x46')][_0xa428('0x47')](_0x8feb7a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x57c2bc){logger[_0xa428('0x12')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x44a148,JSON['stringify'](_0x57c2bc));})[_0xa428('0x48')](function(_0x3d4aa4){logger[_0xa428('0x44')](_0xa428('0x49'),_0x44a148,JSON[_0xa428('0x43')](_0x3d4aa4));});})[_0xa428('0x41')](function(){_0x17c6d6[_0xa428('0x15')]();});});}}}catch(_0x2503f4){logger[_0xa428('0x44')]('[%s][AUTOREPLY]\x20%s',_0x44a148,JSON[_0xa428('0x43')](_0x2503f4));_0x17c6d6[_0xa428('0x4b')]();}};}; \ No newline at end of file +var _0xe230=['info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','service','host','port','Smtp','secure','authentication','user','pass','inReplyTo','messageId','html','','headers','auto-replied','All','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify','error','finally','autoreplyExecuted','Interaction','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','resolve','update','lodash','moment','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply'];(function(_0x23840e,_0x2fb0cb){var _0x277300=function(_0x246e5a){while(--_0x246e5a){_0x23840e['push'](_0x23840e['shift']());}};_0x277300(++_0x2fb0cb);}(_0xe230,0x10a));var _0x0e23=function(_0x5d8f83,_0x59e280){_0x5d8f83=_0x5d8f83-0x0;var _0x3a8043=_0xe230[_0x5d8f83];return _0x3a8043;};'use strict';var _=require(_0x0e23('0x0'));var moment=require(_0x0e23('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0e23('0x2')),'smsMessage':require(_0x0e23('0x3')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x0e23('0x4')),'openchannelInteraction':require(_0x0e23('0x5')),'mailInteraction':require(_0x0e23('0x6')),'smsInteraction':require(_0x0e23('0x7')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x0e23('0x8'));exports[_0x0e23('0x9')]=function(_0x55eba1,_0x541f17,_0x408efd,_0x36d57e){return function(_0x3ac95e){try{var _0x12eee9=this[_0x0e23('0xa')];if(_0x12eee9===_0x0e23('0xb')&&_0x36d57e[_0x0e23('0xc')][_0x0e23('0xd')]){logger[_0x0e23('0xe')](_0x0e23('0xf'),_0x55eba1,_0x0e23('0x10'));return _0x3ac95e[_0x0e23('0x11')]();}if(_0x541f17[0x0]==='1'&&(_[_0x0e23('0x12')](this['interaction']['created'])||!this[_0x0e23('0x13')][_0x0e23('0x14')])){logger[_0x0e23('0xe')](_0x0e23('0xf'),_0x55eba1,_0x0e23('0x15'));return _0x3ac95e['next']();}if(_0x541f17[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0x0e23('0xe')](_0x0e23('0x16'),_0x55eba1,_0x0e23('0x17'));return _0x3ac95e[_0x0e23('0x11')]();}var _0x2321bb={'ContactId':this[_0x0e23('0x18')]['id'],'sentAt':moment()[_0x0e23('0x19')](_0x0e23('0x1a')),'direction':'out'};if(this[_0x0e23('0xa')]===_0x0e23('0xb')){_0x2321bb['body']=utils[_0x0e23('0x1b')](_0x541f17[0x2],this);}else{_0x2321bb[_0x0e23('0xc')]=utils[_0x0e23('0x1b')](_0x541f17[0x1],this);}if(this[_0x0e23('0x1c')]){_0x2321bb['to']=this[_0x0e23('0x1c')][_0x0e23('0x1d')]||'';if(this[_0x0e23('0xa')]===_0x0e23('0xb')&&_0x541f17[0x1]==='1'){_0x2321bb['cc']=this['message']['cc']||'';}_0x2321bb[_0x0e23('0x1d')]=this['message']['to']||'';_0x2321bb[_0x0e23('0x1e')]=this[_0x0e23('0x1c')][_0x0e23('0x1e')]||'';_0x2321bb[_0x0e23('0x1f')]=!![];if(this['message']['subject']){_0x2321bb['subject']='';_0x2321bb['subject']+=_['startsWith'](this[_0x0e23('0x1c')][_0x0e23('0x20')],_0x0e23('0x21'))?'':'Re:\x20';_0x2321bb[_0x0e23('0x20')]+=this['message'][_0x0e23('0x20')];}}if(this['channel']===_0x0e23('0x22')){_0x2321bb[_0x0e23('0x23')]=this[_0x0e23('0x24')]['id'];}else{_0x2321bb[_[_0x0e23('0x25')](this[_0x0e23('0xa')])+_0x0e23('0x26')]=this[_0x0e23('0x24')]['id'];}_0x2321bb[_[_0x0e23('0x25')](this[_0x0e23('0xa')])+_0x0e23('0x27')]=this[_0x0e23('0x13')]['id'];var _0x2e23fd=this[_0x0e23('0x13')];if(rpc[this[_0x0e23('0xa')]+_0x0e23('0x28')]){if(this[_0x0e23('0xa')]==='mail'){var _0x57493a={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp'][_0x0e23('0x29')]){_0x57493a['service']=this['account']['Smtp']['service'];}else{_0x57493a[_0x0e23('0x2a')]=this[_0x0e23('0x24')]['Smtp'][_0x0e23('0x2a')];_0x57493a[_0x0e23('0x2b')]=this[_0x0e23('0x24')][_0x0e23('0x2c')][_0x0e23('0x2b')];_0x57493a[_0x0e23('0x2d')]=this[_0x0e23('0x24')][_0x0e23('0x2c')][_0x0e23('0x2d')];}if(this[_0x0e23('0x24')][_0x0e23('0x2c')][_0x0e23('0x2e')]){_0x57493a['auth']={'user':this[_0x0e23('0x24')][_0x0e23('0x2c')][_0x0e23('0x2f')],'pass':this[_0x0e23('0x24')][_0x0e23('0x2c')][_0x0e23('0x30')]};}_0x2321bb[_0x0e23('0x31')]=this[_0x0e23('0x1c')][_0x0e23('0x32')];_0x2321bb[_0x0e23('0x33')]=''+_['replace'](_0x2321bb[_0x0e23('0xc')],_0x0e23('0x34'),_0x0e23('0x35'))+_0x0e23('0x36');_0x2321bb[_0x0e23('0x37')]={'Auto-Submitted':_0x0e23('0x38'),'X-Auto-Response-Suppress':_0x0e23('0x39'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0x57493a,_0x2321bb)[_0x0e23('0x3a')](function(_0x2da03d){logger['info'](_0x0e23('0x3b'),_0x55eba1);_0x2321bb[_0x0e23('0x32')]=_0x2da03d[_0x0e23('0x1c')][_0x0e23('0x32')];return rpc[_0x12eee9+'Message']['create'](_0x2321bb);})[_0x0e23('0x3a')](function(_0x4be8f6){logger[_0x0e23('0xe')]('[%s][AUTOREPLY]\x20%s',_0x55eba1,JSON[_0x0e23('0x3c')](_0x4be8f6));})['catch'](function(_0x53d2cf){logger[_0x0e23('0x3d')]('[RPC][%s][AUTOREPLY]\x20%s',_0x55eba1,JSON[_0x0e23('0x3c')](_0x53d2cf));})[_0x0e23('0x3e')](function(){Promise['resolve']()['then'](function(){if(_0x541f17[0x0]!=='2'||_0x2e23fd[_0x0e23('0x3f')])return;return rpc[_0x12eee9+_0x0e23('0x40')]['update'](_0x2e23fd['id'],{'autoreplyExecuted':!![]})[_0x0e23('0x3a')](function(_0x4e07d0){logger[_0x0e23('0xe')](_0x0e23('0x16'),_0x55eba1,JSON[_0x0e23('0x3c')](_0x4e07d0));})[_0x0e23('0x41')](function(_0x441bba){logger[_0x0e23('0x3d')](_0x0e23('0x42'),_0x55eba1,JSON[_0x0e23('0x3c')](_0x441bba));});})[_0x0e23('0x3a')](function(){_0x3ac95e['next']();});});}else{return rpc[this[_0x0e23('0xa')]+_0x0e23('0x28')][_0x0e23('0x43')](_0x2321bb)[_0x0e23('0x3a')](function(_0x44a2b8){logger[_0x0e23('0xe')](_0x0e23('0xf'),_0x55eba1,_0x2321bb[_0x0e23('0xc')]);})[_0x0e23('0x41')](function(_0x5b2a9a){logger[_0x0e23('0x3d')](_0x0e23('0xf'),_0x55eba1,JSON['stringify'](_0x5b2a9a));})['finally'](function(){Promise[_0x0e23('0x44')]()[_0x0e23('0x3a')](function(){if(_0x541f17[0x0]!=='2'||_0x2e23fd[_0x0e23('0x3f')])return;return rpc[_0x12eee9+_0x0e23('0x40')][_0x0e23('0x45')](_0x2e23fd['id'],{'autoreplyExecuted':!![]})[_0x0e23('0x3a')](function(_0x4d1482){logger[_0x0e23('0xe')](_0x0e23('0x16'),_0x55eba1,JSON[_0x0e23('0x3c')](_0x4d1482));})[_0x0e23('0x41')](function(_0x5c5e15){logger['error'](_0x0e23('0x42'),_0x55eba1,JSON[_0x0e23('0x3c')](_0x5c5e15));});})[_0x0e23('0x3a')](function(){_0x3ac95e[_0x0e23('0x11')]();});});}}}catch(_0x273a0c){logger[_0x0e23('0x3d')](_0x0e23('0xf'),_0x55eba1,JSON[_0x0e23('0x3c')](_0x273a0c));_0x3ac95e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 8382ad5..8a4bc66 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 _0xfc68=['interaction','then','info','catch','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','Interaction','channel','update'];(function(_0x3b4c55,_0x4993f6){var _0x1d7ead=function(_0x392ee7){while(--_0x392ee7){_0x3b4c55['push'](_0x3b4c55['shift']());}};_0x1d7ead(++_0x4993f6);}(_0xfc68,0xd0));var _0x8fc6=function(_0x268880,_0x840a79){_0x268880=_0x268880-0x0;var _0x53c0b4=_0xfc68[_0x268880];return _0x53c0b4;};'use strict';var moment=require(_0x8fc6('0x0'));var logger=require(_0x8fc6('0x1'))(_0x8fc6('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8fc6('0x3')),'smsInteraction':require(_0x8fc6('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8fc6('0x5')),'whatsappInteraction':require(_0x8fc6('0x6'))};exports[_0x8fc6('0x7')]=function(_0x16de7d,_0x29385b,_0x27a65e,_0x6467f7){return function(_0x42d2a2){try{logger['info'](_0x8fc6('0x8'),_0x16de7d,_0x29385b[0x0]);var _0x52e28e={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x29385b[0x0]};if(rpc[_0x6467f7['channel']+_0x8fc6('0x9')]){rpc[_0x6467f7[_0x8fc6('0xa')]+_0x8fc6('0x9')][_0x8fc6('0xb')](_0x6467f7[_0x8fc6('0xc')]['id'],_0x52e28e)[_0x8fc6('0xd')](function(_0x19d5e0){logger[_0x8fc6('0xe')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x16de7d,_0x6467f7[_0x8fc6('0xc')]['id']);})[_0x8fc6('0xf')](function(_0x3a46c8){logger['error'](_0x8fc6('0x10'),_0x16de7d,JSON['stringify'](_0x3a46c8));})[_0x8fc6('0x11')](function(){_0x42d2a2[_0x8fc6('0x12')]();});}}catch(_0x5264fc){logger['error'](_0x8fc6('0x10'),_0x16de7d,JSON[_0x8fc6('0x13')](_0x5264fc));_0x42d2a2[_0x8fc6('0x12')]();}};}; \ No newline at end of file +var _0x121b=['update','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','finally','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x33198d,_0x4615f2){var _0x34d131=function(_0x108543){while(--_0x108543){_0x33198d['push'](_0x33198d['shift']());}};_0x34d131(++_0x4615f2);}(_0x121b,0xb9));var _0xb121=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x121b[_0x33c9f8];return _0x2d7004;};'use strict';var moment=require(_0xb121('0x0'));var logger=require(_0xb121('0x1'))(_0xb121('0x2'));var rpc={'chatInteraction':require(_0xb121('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xb121('0x4')),'mailInteraction':require(_0xb121('0x5')),'faxInteraction':require(_0xb121('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xb121('0x7')]=function(_0x107a5,_0x58b62e,_0x12d326,_0x14981f){return function(_0x2f925f){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x107a5,_0x58b62e[0x0]);var _0xb6b886={'closed':0x1,'closedAt':moment()[_0xb121('0x8')](_0xb121('0x9')),'closeReason':_0xb121('0xa'),'disposition':_0x58b62e[0x0]};if(rpc[_0x14981f[_0xb121('0xb')]+_0xb121('0xc')]){rpc[_0x14981f[_0xb121('0xb')]+_0xb121('0xc')][_0xb121('0xd')](_0x14981f['interaction']['id'],_0xb6b886)['then'](function(_0x5140dc){logger['info'](_0xb121('0xe'),_0x107a5,_0x14981f[_0xb121('0xf')]['id']);})[_0xb121('0x10')](function(_0x53ba5a){logger[_0xb121('0x11')](_0xb121('0x12'),_0x107a5,JSON['stringify'](_0x53ba5a));})[_0xb121('0x13')](function(){_0x2f925f['stop']();});}}catch(_0x3ed08b){logger[_0xb121('0x11')](_0xb121('0x12'),_0x107a5,JSON[_0xb121('0x14')](_0x3ed08b));_0x2f925f[_0xb121('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index a62f993..cfb8906 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 _0x9e54=['message','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','ChatWebsiteId','account','InteractionId','created','body','getMustacheRender','Message','create','then','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','fulfillment','speech','providerResponse','[%s][DIALOGFLOW]\x20%s','metadata','next'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x9e54,0x88));var _0x49e5=function(_0x22c13b,_0x26a0a0){_0x22c13b=_0x22c13b-0x0;var _0x3894c1=_0x9e54[_0x22c13b];return _0x3894c1;};'use strict';var _=require(_0x49e5('0x0'));var moment=require(_0x49e5('0x1'));var apiai=require('apiai-promise');var md5=require('md5');var utils=require('./utils');var logger=require(_0x49e5('0x2'))(_0x49e5('0x3'));var rpc={'chatMessage':require(_0x49e5('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x49e5('0x5')),'smsMessage':require(_0x49e5('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x49e5('0x7'))};exports['consequence']=function(_0x558b73,_0x21e166){return function(_0x48059c){try{if(!_[_0x49e5('0x8')](this[_0x49e5('0x9')][_0x49e5('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x558b73,_0x49e5('0xb'));return _0x48059c['next']();}var _0x45c7cd={'ContactId':this[_0x49e5('0xc')]['id'],'sentAt':moment()[_0x49e5('0xd')](_0x49e5('0xe')),'direction':_0x49e5('0xf')};if(this['channel']===_0x49e5('0x10')||this['channel']===_0x49e5('0x11')){_0x45c7cd[_0x49e5('0x12')]=this[_0x49e5('0x9')][_0x49e5('0x12')];}var _0x22edfe=this['channel'];if(_0x22edfe==='chat'){_0x45c7cd[_0x49e5('0x13')]=this[_0x49e5('0x14')]['id'];}else{_0x45c7cd[_['upperFirst'](_0x22edfe)+'AccountId']=this[_0x49e5('0x14')]['id'];}_0x45c7cd[_['upperFirst'](_0x22edfe)+_0x49e5('0x15')]=this['interaction']['id'];if(this[_0x49e5('0x9')][_0x49e5('0x16')]){var _0x375488=_0x21e166[0x2];if(!_['isEmpty'](_0x375488)){_0x45c7cd[_0x49e5('0x17')]=utils[_0x49e5('0x18')](_0x375488,this);return rpc[_0x22edfe+_0x49e5('0x19')][_0x49e5('0x1a')](_0x45c7cd)[_0x49e5('0x1b')](function(_0xff869e){logger[_0x49e5('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x558b73,_0x45c7cd[_0x49e5('0x17')]);})[_0x49e5('0x1d')](function(_0x52fade){logger[_0x49e5('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x558b73,JSON[_0x49e5('0x1f')](_0x52fade));})[_0x49e5('0x20')](function(){logger['info'](_0x49e5('0x21'),_0x558b73);_0x48059c[_0x49e5('0x22')]();});}else{logger[_0x49e5('0x1c')](_0x49e5('0x23'),_0x558b73);_0x48059c[_0x49e5('0x22')]();}}else{var _0x3c14e3=this;var _0x5e8569=apiai(_0x21e166[0x0],{'language':_0x21e166[0x1]||'en'});return _0x5e8569[_0x49e5('0x24')](this['message'][_0x49e5('0x17')],{'sessionId':md5(this[_0x49e5('0x9')]['id'])})[_0x49e5('0x1b')](function(_0x2d1d63){_0x3c14e3[_0x49e5('0x17')][_0x49e5('0x25')]=_0x2d1d63;_0x45c7cd['body']=_0x2d1d63['result'][_0x49e5('0x26')][_0x49e5('0x27')];_0x45c7cd['providerName']=_0x49e5('0x25');_0x45c7cd[_0x49e5('0x28')]=JSON[_0x49e5('0x1f')](_0x2d1d63);return rpc[_0x22edfe+_0x49e5('0x19')][_0x49e5('0x1a')](_0x45c7cd)[_0x49e5('0x1b')](function(_0x4e0ed2){logger[_0x49e5('0x1c')](_0x49e5('0x29'),_0x558b73,_0x45c7cd[_0x49e5('0x17')]);if(_0x2d1d63['result'][_0x49e5('0x2a')]['endConversation']){_0x48059c[_0x49e5('0x2b')]();}else{_0x48059c[_0x49e5('0x22')]();}})['catch'](function(_0x56d96a){logger[_0x49e5('0x1e')](_0x49e5('0x29'),_0x558b73,JSON['stringify'](_0x56d96a));_0x48059c[_0x49e5('0x2b')]();});})['catch'](function(_0x36d49e){logger[_0x49e5('0x1e')](_0x49e5('0x29'),_0x558b73,_0x36d49e[_0x49e5('0x2c')]);_0x48059c[_0x49e5('0x2b')]();});}}catch(_0x5838fb){logger[_0x49e5('0x1e')](_0x49e5('0x29'),_0x558b73,JSON[_0x49e5('0x1f')](_0x5838fb));_0x48059c[_0x49e5('0x22')]();}};}; \ No newline at end of file +var _0x7f05=['providerResponse','metadata','endConversation','message','stringify','lodash','moment','apiai-promise','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','phone','channel','chat','upperFirst','AccountId','account','InteractionId','interaction','create','then','[%s][DIALOGFLOW]\x20%s','body','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','fulfillment','speech','providerName'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x7f05,0xdc));var _0x57f0=function(_0x463e90,_0x134ff4){_0x463e90=_0x463e90-0x0;var _0x185af4=_0x7f05[_0x463e90];return _0x185af4;};'use strict';var _=require(_0x57f0('0x0'));var moment=require(_0x57f0('0x1'));var apiai=require(_0x57f0('0x2'));var md5=require('md5');var utils=require(_0x57f0('0x3'));var logger=require('../../../../config/logger')(_0x57f0('0x4'));var rpc={'chatMessage':require(_0x57f0('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x57f0('0x6')),'smsMessage':require(_0x57f0('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x57f0('0x8'))};exports[_0x57f0('0x9')]=function(_0x4975ec,_0x434121){return function(_0x574a16){try{if(!_[_0x57f0('0xa')](this['interaction']['UserId'])){logger[_0x57f0('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x4975ec,_0x57f0('0xc'));return _0x574a16[_0x57f0('0xd')]();}var _0x24c617={'ContactId':this[_0x57f0('0xe')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x57f0('0xf')};if(this['channel']==='sms'||this['channel']==='whatsapp'){_0x24c617['phone']=this['interaction'][_0x57f0('0x10')];}var _0x148978=this[_0x57f0('0x11')];if(_0x148978===_0x57f0('0x12')){_0x24c617['ChatWebsiteId']=this['account']['id'];}else{_0x24c617[_[_0x57f0('0x13')](_0x148978)+_0x57f0('0x14')]=this[_0x57f0('0x15')]['id'];}_0x24c617[_[_0x57f0('0x13')](_0x148978)+_0x57f0('0x16')]=this[_0x57f0('0x17')]['id'];if(this['interaction']['created']){var _0x40a925=_0x434121[0x2];if(!_['isEmpty'](_0x40a925)){_0x24c617['body']=utils['getMustacheRender'](_0x40a925,this);return rpc[_0x148978+'Message'][_0x57f0('0x18')](_0x24c617)[_0x57f0('0x19')](function(_0x124f9e){logger['info'](_0x57f0('0x1a'),_0x4975ec,_0x24c617[_0x57f0('0x1b')]);})[_0x57f0('0x1c')](function(_0x5d7e53){logger[_0x57f0('0x1d')](_0x57f0('0x1a'),_0x4975ec,JSON['stringify'](_0x5d7e53));})['finally'](function(){logger[_0x57f0('0xb')](_0x57f0('0x1e'),_0x4975ec);_0x574a16['stop']();});}else{logger[_0x57f0('0xb')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4975ec);_0x574a16[_0x57f0('0x1f')]();}}else{var _0x9c498=this;var _0x426a09=apiai(_0x434121[0x0],{'language':_0x434121[0x1]||'en'});return _0x426a09[_0x57f0('0x20')](this['message']['body'],{'sessionId':md5(this[_0x57f0('0x17')]['id'])})['then'](function(_0x1279ae){_0x9c498[_0x57f0('0x1b')][_0x57f0('0x21')]=_0x1279ae;_0x24c617[_0x57f0('0x1b')]=_0x1279ae[_0x57f0('0x22')][_0x57f0('0x23')][_0x57f0('0x24')];_0x24c617[_0x57f0('0x25')]='dialogflow';_0x24c617[_0x57f0('0x26')]=JSON['stringify'](_0x1279ae);return rpc[_0x148978+'Message'][_0x57f0('0x18')](_0x24c617)['then'](function(_0x407829){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x4975ec,_0x24c617[_0x57f0('0x1b')]);if(_0x1279ae[_0x57f0('0x22')][_0x57f0('0x27')][_0x57f0('0x28')]){_0x574a16[_0x57f0('0xd')]();}else{_0x574a16[_0x57f0('0x1f')]();}})[_0x57f0('0x1c')](function(_0x43699b){logger[_0x57f0('0x1d')](_0x57f0('0x1a'),_0x4975ec,JSON['stringify'](_0x43699b));_0x574a16[_0x57f0('0xd')]();});})[_0x57f0('0x1c')](function(_0x316abe){logger[_0x57f0('0x1d')](_0x57f0('0x1a'),_0x4975ec,_0x316abe[_0x57f0('0x29')]);_0x574a16[_0x57f0('0xd')]();});}}catch(_0x40c45a){logger[_0x57f0('0x1d')](_0x57f0('0x1a'),_0x4975ec,JSON[_0x57f0('0x2a')](_0x40c45a));_0x574a16[_0x57f0('0x1f')]();}};}; \ 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 3bd5038..9c07ea1 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 _0xbc45=['then','info','[%s][DIALOGFLOWV2]\x20%s','body','isNil','interaction','UserId','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','stringify','fulfillmentText','push','all','catch','error','lodash','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create'];(function(_0x89a6d8,_0x5afef7){var _0x3fffe6=function(_0x23fd51){while(--_0x23fd51){_0x89a6d8['push'](_0x89a6d8['shift']());}};_0x3fffe6(++_0x5afef7);}(_0xbc45,0xcf));var _0x5bc4=function(_0x279391,_0x391ef6){_0x279391=_0x279391-0x0;var _0x471def=_0xbc45[_0x279391];return _0x471def;};'use strict';var _=require(_0x5bc4('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x5bc4('0x1'));var moment=require(_0x5bc4('0x2'));var Promise=require(_0x5bc4('0x3'));var logger=require(_0x5bc4('0x4'))(_0x5bc4('0x5'));var utils=require(_0x5bc4('0x6'));var rpc={'chatMessage':require(_0x5bc4('0x7')),'openchannelMessage':require(_0x5bc4('0x8')),'mailMessage':require(_0x5bc4('0x9')),'smsMessage':require(_0x5bc4('0xa')),'faxMessage':require(_0x5bc4('0xb')),'whatsappMessage':require(_0x5bc4('0xc'))};function createMessage(_0xd395ba,_0x1e0c35,_0x554e81,_0x2dbfad){return new Promise(function(_0x2615b2,_0x51013a){var _0x1a9c04=_[_0x5bc4('0xd')](_0x554e81);_0x1a9c04['body']=_0x2dbfad;return rpc[_0x1e0c35+'Message'][_0x5bc4('0xe')](_0x1a9c04)[_0x5bc4('0xf')](function(){logger[_0x5bc4('0x10')](_0x5bc4('0x11'),_0xd395ba,_0x1a9c04[_0x5bc4('0x12')]);_0x2615b2();})['catch'](function(_0x99205b){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xd395ba,JSON['stringify'](_0x99205b));_0x51013a(_0x99205b);});});}exports['consequence']=function(_0x196de8,_0x75dae5){return function(_0x5aa823){try{if(!_[_0x5bc4('0x13')](this[_0x5bc4('0x14')][_0x5bc4('0x15')])){logger['info'](_0x5bc4('0x11'),_0x196de8,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5aa823[_0x5bc4('0x16')]();}var _0x20c7a8={'ContactId':this['contact']['id'],'sentAt':moment()[_0x5bc4('0x17')](_0x5bc4('0x18')),'direction':_0x5bc4('0x19')};if(this[_0x5bc4('0x1a')]==='sms'||this['channel']===_0x5bc4('0x1b')){_0x20c7a8[_0x5bc4('0x1c')]=this[_0x5bc4('0x14')][_0x5bc4('0x1c')];}var _0x8b237=this['channel'];if(_0x8b237===_0x5bc4('0x1d')){_0x20c7a8['ChatWebsiteId']=this[_0x5bc4('0x1e')]['id'];}else{_0x20c7a8[_[_0x5bc4('0x1f')](_0x8b237)+_0x5bc4('0x20')]=this[_0x5bc4('0x1e')]['id'];}_0x20c7a8[_[_0x5bc4('0x1f')](_0x8b237)+_0x5bc4('0x21')]=this[_0x5bc4('0x14')]['id'];if(this[_0x5bc4('0x14')][_0x5bc4('0x22')]){var _0x3981fb=_0x75dae5[0x4];if(!_[_0x5bc4('0x23')](_0x3981fb)){_0x20c7a8[_0x5bc4('0x12')]=utils[_0x5bc4('0x24')](_0x3981fb,this);return rpc[_0x8b237+_0x5bc4('0x25')][_0x5bc4('0xe')](_0x20c7a8)[_0x5bc4('0xf')](function(_0x19d606){logger[_0x5bc4('0x10')](_0x5bc4('0x11'),_0x196de8,_0x20c7a8['body']);})['catch'](function(_0x30bf69){logger['error'](_0x5bc4('0x11'),_0x196de8,JSON['stringify'](_0x30bf69));})[_0x5bc4('0x26')](function(){logger[_0x5bc4('0x10')](_0x5bc4('0x27'),_0x196de8);_0x5aa823[_0x5bc4('0x28')]();});}else{logger[_0x5bc4('0x10')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x196de8);_0x5aa823[_0x5bc4('0x28')]();}}else{var _0x2bb9e2=this;var _0x49616d=_0x75dae5[0x2][_0x5bc4('0x29')](/\\n/g,'\x0a');var _0x52ec15={'credentials':{'private_key':_0x49616d,'client_email':_0x75dae5[0x1]}};var _0x476169=new dialogflow[(_0x5bc4('0x2a'))](_0x52ec15);var _0x3dd81e=_0x476169[_0x5bc4('0x2b')](_0x75dae5[0x0],md5(_0x2bb9e2['interaction']['id']));var _0x3f7b22={'session':_0x3dd81e,'queryInput':{'text':{'text':_0x2bb9e2[_0x5bc4('0x2c')][_0x5bc4('0x12')],'languageCode':_0x75dae5[0x3]||'en'}}};return _0x476169[_0x5bc4('0x2d')](_0x3f7b22)[_0x5bc4('0xf')](function(_0x2a1b89){if(_0x2a1b89&&_0x2a1b89[_0x5bc4('0x2e')]){_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x2f')]=_0x2a1b89;var _0x1cfe8d=_0x2a1b89[0x0];var _0x58452a=_0x1cfe8d[_0x5bc4('0x30')][_0x5bc4('0x31')]&&_0x1cfe8d[_0x5bc4('0x30')]['diagnosticInfo']['fields']?_0x1cfe8d[_0x5bc4('0x30')][_0x5bc4('0x31')][_0x5bc4('0x32')][_0x5bc4('0x33')][_0x5bc4('0x34')]:![];_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x35')]=_0x1cfe8d[_0x5bc4('0x30')]['action'];_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x36')]=_0x1cfe8d['queryResult'][_0x5bc4('0x37')];_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x38')]=_0x1cfe8d['queryResult'][_0x5bc4('0x31')]&&_0x1cfe8d[_0x5bc4('0x30')]['diagnosticInfo'][_0x5bc4('0x32')]?_0x1cfe8d[_0x5bc4('0x30')]['diagnosticInfo'][_0x5bc4('0x32')][_0x5bc4('0x33')][_0x5bc4('0x34')]:![];_0x2bb9e2['body'][_0x5bc4('0x39')]=_0x1cfe8d['queryResult']['intent']['name'];_0x2bb9e2[_0x5bc4('0x12')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x1cfe8d[_0x5bc4('0x30')][_0x5bc4('0x3a')][_0x5bc4('0x3b')];_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x3c')]=_0x1cfe8d['queryResult'][_0x5bc4('0x3a')]['isFallback'];_0x2bb9e2[_0x5bc4('0x12')]['DIALOGFLOWV2_LANGUAGECODE']=_0x1cfe8d['queryResult'][_0x5bc4('0x3d')];_0x2bb9e2['body'][_0x5bc4('0x3e')]=_0x1cfe8d[_0x5bc4('0x30')][_0x5bc4('0x3f')];_0x2bb9e2[_0x5bc4('0x12')][_0x5bc4('0x40')]=_0x1cfe8d[_0x5bc4('0x30')][_0x5bc4('0x41')];_0x20c7a8[_0x5bc4('0x42')]='dialogflowV2';_0x20c7a8[_0x5bc4('0x43')]=JSON[_0x5bc4('0x44')](_0x2a1b89);var _0xd182c2=[];for(var _0x4535cb=0x0;_0x4535cb<_0x2a1b89[_0x5bc4('0x2e')];_0x4535cb++){var _0x3d4860=_0x2a1b89[_0x4535cb];if(_0x3d4860&&_0x3d4860[_0x5bc4('0x30')]&&_0x3d4860[_0x5bc4('0x30')][_0x5bc4('0x45')]){_0xd182c2[_0x5bc4('0x46')](createMessage(_0x196de8,_0x8b237,_0x20c7a8,_0x3d4860[_0x5bc4('0x30')][_0x5bc4('0x45')]));}}return Promise[_0x5bc4('0x47')](_0xd182c2)[_0x5bc4('0xf')](function(){if(_0x58452a){_0x5aa823[_0x5bc4('0x16')]();}else{_0x5aa823[_0x5bc4('0x28')]();}})[_0x5bc4('0x48')](function(_0x2fe2ba){logger[_0x5bc4('0x49')](_0x5bc4('0x11'),_0x196de8,JSON[_0x5bc4('0x44')](_0x2fe2ba));_0x5aa823[_0x5bc4('0x16')]();});}})[_0x5bc4('0x48')](function(_0x2c5be3){logger[_0x5bc4('0x49')](_0x5bc4('0x11'),_0x196de8,_0x2c5be3[_0x5bc4('0x2c')]);_0x5aa823[_0x5bc4('0x16')]();});}}catch(_0x39b05c){logger[_0x5bc4('0x49')](_0x5bc4('0x11'),_0x196de8,JSON['stringify'](_0x39b05c));_0x5aa823[_0x5bc4('0x28')]();}};}; \ No newline at end of file +var _0xeec6=['languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','info','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','sms','channel','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','create','then','catch','error','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE'];(function(_0x9b3efc,_0x577a0d){var _0x200f05=function(_0x15ad7c){while(--_0x15ad7c){_0x9b3efc['push'](_0x9b3efc['shift']());}};_0x200f05(++_0x577a0d);}(_0xeec6,0x1c2));var _0x6eec=function(_0x278f93,_0x5d74c6){_0x278f93=_0x278f93-0x0;var _0x47d224=_0xeec6[_0x278f93];return _0x47d224;};'use strict';var _=require(_0x6eec('0x0'));var dialogflow=require(_0x6eec('0x1'));var md5=require(_0x6eec('0x2'));var moment=require(_0x6eec('0x3'));var Promise=require('bluebird');var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var utils=require(_0x6eec('0x6'));var rpc={'chatMessage':require(_0x6eec('0x7')),'openchannelMessage':require(_0x6eec('0x8')),'mailMessage':require(_0x6eec('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6eec('0xa')),'whatsappMessage':require(_0x6eec('0xb'))};function createMessage(_0x48064a,_0x5a5e47,_0x1c810e,_0x3443c2){return new Promise(function(_0x834c2,_0x56e849){var _0x2be38f=_[_0x6eec('0xc')](_0x1c810e);_0x2be38f[_0x6eec('0xd')]=_0x3443c2;return rpc[_0x5a5e47+'Message']['create'](_0x2be38f)['then'](function(){logger[_0x6eec('0xe')](_0x6eec('0xf'),_0x48064a,_0x2be38f['body']);_0x834c2();})['catch'](function(_0x1cc8d3){logger['error'](_0x6eec('0xf'),_0x48064a,JSON[_0x6eec('0x10')](_0x1cc8d3));_0x56e849(_0x1cc8d3);});});}exports[_0x6eec('0x11')]=function(_0x3fe94b,_0x3fe3bc){return function(_0x49fccb){try{if(!_[_0x6eec('0x12')](this[_0x6eec('0x13')][_0x6eec('0x14')])){logger[_0x6eec('0xe')](_0x6eec('0xf'),_0x3fe94b,_0x6eec('0x15'));return _0x49fccb[_0x6eec('0x16')]();}var _0x393271={'ContactId':this[_0x6eec('0x17')]['id'],'sentAt':moment()[_0x6eec('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6eec('0x19')};if(this['channel']===_0x6eec('0x1a')||this[_0x6eec('0x1b')]==='whatsapp'){_0x393271[_0x6eec('0x1c')]=this[_0x6eec('0x13')][_0x6eec('0x1c')];}var _0x56c78b=this[_0x6eec('0x1b')];if(_0x56c78b===_0x6eec('0x1d')){_0x393271[_0x6eec('0x1e')]=this[_0x6eec('0x1f')]['id'];}else{_0x393271[_[_0x6eec('0x20')](_0x56c78b)+_0x6eec('0x21')]=this['account']['id'];}_0x393271[_[_0x6eec('0x20')](_0x56c78b)+_0x6eec('0x22')]=this[_0x6eec('0x13')]['id'];if(this[_0x6eec('0x13')][_0x6eec('0x23')]){var _0xcd546f=_0x3fe3bc[0x4];if(!_['isEmpty'](_0xcd546f)){_0x393271[_0x6eec('0xd')]=utils[_0x6eec('0x24')](_0xcd546f,this);return rpc[_0x56c78b+_0x6eec('0x25')][_0x6eec('0x26')](_0x393271)[_0x6eec('0x27')](function(_0x13863c){logger['info'](_0x6eec('0xf'),_0x3fe94b,_0x393271[_0x6eec('0xd')]);})[_0x6eec('0x28')](function(_0x33d580){logger[_0x6eec('0x29')](_0x6eec('0xf'),_0x3fe94b,JSON[_0x6eec('0x10')](_0x33d580));})[_0x6eec('0x2a')](function(){logger[_0x6eec('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3fe94b);_0x49fccb[_0x6eec('0x2b')]();});}else{logger[_0x6eec('0xe')](_0x6eec('0x2c'),_0x3fe94b);_0x49fccb[_0x6eec('0x2b')]();}}else{var _0x4f507e=this;var _0x23432d=_0x3fe3bc[0x2][_0x6eec('0x2d')](/\\n/g,'\x0a');var _0x518ba5={'credentials':{'private_key':_0x23432d,'client_email':_0x3fe3bc[0x1]}};var _0x54b446=new dialogflow[(_0x6eec('0x2e'))](_0x518ba5);var _0x47ed95=_0x54b446[_0x6eec('0x2f')](_0x3fe3bc[0x0],md5(_0x4f507e[_0x6eec('0x13')]['id']));var _0x3bbdf8={'session':_0x47ed95,'queryInput':{'text':{'text':_0x4f507e[_0x6eec('0x30')][_0x6eec('0xd')],'languageCode':_0x3fe3bc[0x3]||'en'}}};return _0x54b446[_0x6eec('0x31')](_0x3bbdf8)[_0x6eec('0x27')](function(_0x33e4a1){if(_0x33e4a1&&_0x33e4a1[_0x6eec('0x32')]){_0x4f507e[_0x6eec('0xd')]['dialogflowV2']=_0x33e4a1;var _0x383c6b=_0x33e4a1[0x0];var _0x4ce793=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x34')]&&_0x383c6b[_0x6eec('0x33')]['diagnosticInfo']['fields']?_0x383c6b['queryResult'][_0x6eec('0x34')][_0x6eec('0x35')][_0x6eec('0x36')][_0x6eec('0x37')]:![];_0x4f507e[_0x6eec('0xd')][_0x6eec('0x38')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x39')];_0x4f507e[_0x6eec('0xd')][_0x6eec('0x3a')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x3b')];_0x4f507e['body'][_0x6eec('0x3c')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x34')]&&_0x383c6b['queryResult'][_0x6eec('0x34')][_0x6eec('0x35')]?_0x383c6b[_0x6eec('0x33')][_0x6eec('0x34')][_0x6eec('0x35')][_0x6eec('0x36')]['boolValue']:![];_0x4f507e[_0x6eec('0xd')][_0x6eec('0x3d')]=_0x383c6b[_0x6eec('0x33')]['intent']['name'];_0x4f507e[_0x6eec('0xd')][_0x6eec('0x3e')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x3f')][_0x6eec('0x40')];_0x4f507e['body'][_0x6eec('0x41')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x3f')][_0x6eec('0x42')];_0x4f507e[_0x6eec('0xd')][_0x6eec('0x43')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x44')];_0x4f507e['body'][_0x6eec('0x45')]=_0x383c6b[_0x6eec('0x33')]['queryText'];_0x4f507e['body'][_0x6eec('0x46')]=_0x383c6b[_0x6eec('0x33')][_0x6eec('0x47')];_0x393271[_0x6eec('0x48')]='dialogflowV2';_0x393271['providerResponse']=JSON[_0x6eec('0x10')](_0x33e4a1);var _0x48fbf6=[];for(var _0x5ac8b2=0x0;_0x5ac8b2<_0x33e4a1[_0x6eec('0x32')];_0x5ac8b2++){var _0xe523b9=_0x33e4a1[_0x5ac8b2];if(_0xe523b9&&_0xe523b9[_0x6eec('0x33')]&&_0xe523b9[_0x6eec('0x33')][_0x6eec('0x49')]){_0x48fbf6['push'](createMessage(_0x3fe94b,_0x56c78b,_0x393271,_0xe523b9[_0x6eec('0x33')][_0x6eec('0x49')]));}}return Promise['all'](_0x48fbf6)[_0x6eec('0x27')](function(){if(_0x4ce793){_0x49fccb[_0x6eec('0x16')]();}else{_0x49fccb['stop']();}})[_0x6eec('0x28')](function(_0x44d75d){logger['error'](_0x6eec('0xf'),_0x3fe94b,JSON[_0x6eec('0x10')](_0x44d75d));_0x49fccb[_0x6eec('0x16')]();});}})[_0x6eec('0x28')](function(_0x52af19){logger[_0x6eec('0x29')](_0x6eec('0xf'),_0x3fe94b,_0x52af19[_0x6eec('0x30')]);_0x49fccb[_0x6eec('0x16')]();});}}catch(_0x1c9b5f){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x3fe94b,JSON[_0x6eec('0x10')](_0x1c9b5f));_0x49fccb[_0x6eec('0x2b')]();}};}; \ 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 93a5751..c063a67 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 _0xb171=['findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','validate','error','[%s][GOTOIF]\x20%s','message','join','priorityTrue','priorityFalse','info','condition'];(function(_0x2855d9,_0x2519b0){var _0xb147ca=function(_0x4a35db){while(--_0x4a35db){_0x2855d9['push'](_0x2855d9['shift']());}};_0xb147ca(++_0x2519b0);}(_0xb171,0x83));var _0x1b17=function(_0x4a8e90,_0x50ee1b){_0x4a8e90=_0x4a8e90-0x0;var _0x592826=_0xb171[_0x4a8e90];return _0x592826;};'use strict';var schema=require('validate');var _=require(_0x1b17('0x0'));var htmlToText=require(_0x1b17('0x1'));var utils=require('./utils');var logger=require(_0x1b17('0x2'))(_0x1b17('0x3'));var gotoif=schema({'condition':{'type':_0x1b17('0x4'),'required':!![],'message':_0x1b17('0x5')},'priorityTrue':{'type':_0x1b17('0x6'),'message':_0x1b17('0x7')},'priorityFalse':{'type':_0x1b17('0x6'),'message':_0x1b17('0x8')}});exports['consequence']=function(_0x4d86d7,_0x44a480){return function(_0x4c5bf2){try{var _0x551362={'condition':htmlToText['fromString'](utils[_0x1b17('0x9')](_0x44a480[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x44a480[0x1],'priorityFalse':_0x44a480[0x2]};var _0x460b53=gotoif[_0x1b17('0xa')](_0x551362,{'typecast':!![]});if(_0x460b53['length']){logger[_0x1b17('0xb')](_0x1b17('0xc'),_0x4d86d7,_['map'](_0x460b53,_0x1b17('0xd'))[_0x1b17('0xe')](',\x20'));_0x4c5bf2['stop']();}else{try{var _0x5cc97f=eval('('+_0x551362['condition']+')');var _0x2b40ed=_0x5cc97f?_0x551362[_0x1b17('0xf')]:_0x551362[_0x1b17('0x10')];logger[_0x1b17('0x11')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4d86d7,_0x551362[_0x1b17('0x12')],_0x5cc97f,_0x2b40ed||'next');if(_0x2b40ed){var _0x2d9a8c=_[_0x1b17('0x13')](_0x4c5bf2[_0x1b17('0x14')](),{'p':_0x2b40ed});if(_0x2d9a8c>=0x0){logger[_0x1b17('0x11')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4d86d7,_0x2b40ed||_0x1b17('0x15'),_0x2d9a8c);_0x4c5bf2['next'](_0x2d9a8c);}else{logger[_0x1b17('0x11')](_0x1b17('0x16'),_0x4d86d7,_0x2b40ed||_0x1b17('0x15'));_0x4c5bf2[_0x1b17('0x17')]();}}else{_0x4c5bf2[_0x1b17('0x15')]();}}catch(_0x5c5448){logger['error'](_0x1b17('0x18'),_0x4d86d7,_0x5c5448['message']);_0x4c5bf2['stop']();}}}catch(_0x382bb8){logger[_0x1b17('0xb')]('[%s][GOTOIF]\x20%s',_0x4d86d7,JSON['stringify'](_0x382bb8));_0x4c5bf2[_0x1b17('0x17')]();}};}; \ No newline at end of file +var _0x45ce=['priority\x20false\x20is\x20a\x20number','consequence','fromString','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number'];(function(_0x52f4d6,_0x2f4818){var _0xaa4059=function(_0x1ecfb3){while(--_0x1ecfb3){_0x52f4d6['push'](_0x52f4d6['shift']());}};_0xaa4059(++_0x2f4818);}(_0x45ce,0x6c));var _0xe45c=function(_0x1117ba,_0x52b60e){_0x1117ba=_0x1117ba-0x0;var _0x3ebf8f=_0x45ce[_0x1117ba];return _0x3ebf8f;};'use strict';var schema=require(_0xe45c('0x0'));var _=require(_0xe45c('0x1'));var htmlToText=require(_0xe45c('0x2'));var utils=require(_0xe45c('0x3'));var logger=require(_0xe45c('0x4'))('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xe45c('0x5')},'priorityTrue':{'type':_0xe45c('0x6'),'message':_0xe45c('0x7')},'priorityFalse':{'type':_0xe45c('0x6'),'message':_0xe45c('0x8')}});exports[_0xe45c('0x9')]=function(_0x25c5ab,_0x310056){return function(_0x90c130){try{var _0x178c5f={'condition':htmlToText[_0xe45c('0xa')](utils['getMustacheRender'](_0x310056[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x310056[0x1],'priorityFalse':_0x310056[0x2]};var _0xdc2f55=gotoif[_0xe45c('0x0')](_0x178c5f,{'typecast':!![]});if(_0xdc2f55[_0xe45c('0xb')]){logger[_0xe45c('0xc')](_0xe45c('0xd'),_0x25c5ab,_['map'](_0xdc2f55,_0xe45c('0xe'))[_0xe45c('0xf')](',\x20'));_0x90c130[_0xe45c('0x10')]();}else{try{var _0xb2ff09=eval('('+_0x178c5f[_0xe45c('0x11')]+')');var _0x4b2861=_0xb2ff09?_0x178c5f[_0xe45c('0x12')]:_0x178c5f[_0xe45c('0x13')];logger[_0xe45c('0x14')](_0xe45c('0x15'),_0x25c5ab,_0x178c5f[_0xe45c('0x11')],_0xb2ff09,_0x4b2861||_0xe45c('0x16'));if(_0x4b2861){var _0x12f51f=_[_0xe45c('0x17')](_0x90c130[_0xe45c('0x18')](),{'p':_0x4b2861});if(_0x12f51f>=0x0){logger[_0xe45c('0x14')](_0xe45c('0x19'),_0x25c5ab,_0x4b2861||_0xe45c('0x16'),_0x12f51f);_0x90c130['next'](_0x12f51f);}else{logger[_0xe45c('0x14')](_0xe45c('0x1a'),_0x25c5ab,_0x4b2861||_0xe45c('0x16'));_0x90c130['stop']();}}else{_0x90c130[_0xe45c('0x16')]();}}catch(_0x1098dd){logger[_0xe45c('0xc')](_0xe45c('0x1b'),_0x25c5ab,_0x1098dd[_0xe45c('0xe')]);_0x90c130['stop']();}}}catch(_0x1386c1){logger[_0xe45c('0xc')](_0xe45c('0xd'),_0x25c5ab,JSON[_0xe45c('0x1c')](_0x1386c1));_0x90c130['stop']();}};}; \ 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 a7b3743..053e49b 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 _0x8f9b=['routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger'];(function(_0x5541d7,_0xa28150){var _0x17c62f=function(_0x20dbb5){while(--_0x20dbb5){_0x5541d7['push'](_0x5541d7['shift']());}};_0x17c62f(++_0xa28150);}(_0x8f9b,0x11f));var _0xb8f9=function(_0x57c5be,_0x4ca04f){_0x57c5be=_0x57c5be-0x0;var _0x364882=_0x8f9b[_0x57c5be];return _0x364882;};'use strict';var schema=require(_0xb8f9('0x0'));var _=require('lodash');var logger=require(_0xb8f9('0x1'))(_0xb8f9('0x2'));var gotop=schema({'priority':{'type':_0xb8f9('0x3'),'required':!![],'message':_0xb8f9('0x4')}});exports['consequence']=function(_0x18628d,_0x54993a){return function(_0x120ed3){try{var _0x48f170={'priority':_0x54993a[0x0]};var _0xa09cd2=gotop[_0xb8f9('0x0')](_0x48f170,{'typecast':!![]});if(_0xa09cd2['length']){logger[_0xb8f9('0x5')]('[%s][GOTOP]\x20%s',_0x18628d,_['map'](_0xa09cd2,_0xb8f9('0x6'))[_0xb8f9('0x7')](',\x20'));_0x120ed3[_0xb8f9('0x8')]();}else{logger['info'](_0xb8f9('0x9'),_0x18628d,_0x48f170[_0xb8f9('0xa')]);if(_0x48f170[_0xb8f9('0xa')]){var _0x59e6e5=_['findIndex'](_0x120ed3[_0xb8f9('0xb')](),{'p':_0x48f170[_0xb8f9('0xa')]});if(_0x59e6e5>=0x0){logger['info'](_0xb8f9('0xc'),_0x18628d,_0x48f170[_0xb8f9('0xa')]||_0xb8f9('0xd'),_0x59e6e5);_0x120ed3[_0xb8f9('0xd')](_0x59e6e5);}else{logger[_0xb8f9('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x18628d,_0x48f170[_0xb8f9('0xa')]||'next');_0x120ed3['stop']();}}else{_0x120ed3[_0xb8f9('0xd')]();}}}catch(_0x4d3181){logger[_0xb8f9('0x5')](_0xb8f9('0xf'),_0x18628d,JSON[_0xb8f9('0x10')](_0x4d3181));_0x120ed3['stop']();}};}; \ No newline at end of file +var _0x73ca=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing'];(function(_0x241a02,_0x3f5e0e){var _0xb50fa2=function(_0x3e21db){while(--_0x3e21db){_0x241a02['push'](_0x241a02['shift']());}};_0xb50fa2(++_0x3f5e0e);}(_0x73ca,0x1a0));var _0xa73c=function(_0x5af193,_0x3f55bc){_0x5af193=_0x5af193-0x0;var _0x19058d=_0x73ca[_0x5af193];return _0x19058d;};'use strict';var schema=require(_0xa73c('0x0'));var _=require(_0xa73c('0x1'));var logger=require(_0xa73c('0x2'))(_0xa73c('0x3'));var gotop=schema({'priority':{'type':_0xa73c('0x4'),'required':!![],'message':_0xa73c('0x5')}});exports[_0xa73c('0x6')]=function(_0x45d676,_0xc1aeb1){return function(_0x100dc4){try{var _0x3a6804={'priority':_0xc1aeb1[0x0]};var _0x11bb3a=gotop[_0xa73c('0x0')](_0x3a6804,{'typecast':!![]});if(_0x11bb3a[_0xa73c('0x7')]){logger[_0xa73c('0x8')]('[%s][GOTOP]\x20%s',_0x45d676,_[_0xa73c('0x9')](_0x11bb3a,_0xa73c('0xa'))['join'](',\x20'));_0x100dc4[_0xa73c('0xb')]();}else{logger['info'](_0xa73c('0xc'),_0x45d676,_0x3a6804[_0xa73c('0xd')]);if(_0x3a6804[_0xa73c('0xd')]){var _0x511baf=_['findIndex'](_0x100dc4[_0xa73c('0xe')](),{'p':_0x3a6804['priority']});if(_0x511baf>=0x0){logger['info'](_0xa73c('0xf'),_0x45d676,_0x3a6804[_0xa73c('0xd')]||_0xa73c('0x10'),_0x511baf);_0x100dc4[_0xa73c('0x10')](_0x511baf);}else{logger[_0xa73c('0x11')](_0xa73c('0x12'),_0x45d676,_0x3a6804[_0xa73c('0xd')]||_0xa73c('0x10'));_0x100dc4[_0xa73c('0xb')]();}}else{_0x100dc4[_0xa73c('0x10')]();}}}catch(_0x20fa86){logger[_0xa73c('0x8')]('[%s][GOTOP]\x20%s',_0x45d676,JSON[_0xa73c('0x13')](_0x20fa86));_0x100dc4[_0xa73c('0xb')]();}};}; \ 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 21af579..a9672c9 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 _0xbe62=['../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stop','stringify','./utils','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x1a8114,_0x204925){var _0x28b3ee=function(_0x335b21){while(--_0x335b21){_0x1a8114['push'](_0x1a8114['shift']());}};_0x28b3ee(++_0x204925);}(_0xbe62,0x9e));var _0x2be6=function(_0x95e74e,_0x3654cd){_0x95e74e=_0x95e74e-0x0;var _0x23f60a=_0xbe62[_0x95e74e];return _0x23f60a;};'use strict';var _=require('lodash');var utils=require(_0x2be6('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2be6('0x1')),'smsMessage':require(_0x2be6('0x2')),'faxMessage':require(_0x2be6('0x3')),'whatsappMessage':require(_0x2be6('0x4'))};exports['consequence']=function(_0x4681e1,_0x15a434){return function(_0x2e6c00){try{var _0x4bc271={'body':utils[_0x2be6('0x5')](_0x15a434[0x0],this),'ContactId':this['contact']['id']};if(this[_0x2be6('0x6')]===_0x2be6('0x7')){_0x4bc271[_0x2be6('0x8')]=this['account']['id'];}else{_0x4bc271[_[_0x2be6('0x9')](this[_0x2be6('0x6')])+'AccountId']=this[_0x2be6('0xa')]['id'];}_0x4bc271[_[_0x2be6('0x9')](this[_0x2be6('0x6')])+_0x2be6('0xb')]=this[_0x2be6('0xc')]['id'];if(rpc[this[_0x2be6('0x6')]+_0x2be6('0xd')]){return rpc[this[_0x2be6('0x6')]+_0x2be6('0xd')][_0x2be6('0xe')](_0x4bc271)[_0x2be6('0xf')](function(_0x13ac26){logger[_0x2be6('0x10')](_0x2be6('0x11'),_0x4681e1,_0x4bc271[_0x2be6('0x12')]);_0x2e6c00[_0x2be6('0x13')]();})['catch'](function(_0x2e381f){logger[_0x2be6('0x14')](_0x2be6('0x11'),_0x4681e1,JSON['stringify'](_0x2e381f));_0x2e6c00[_0x2be6('0x15')]();});}}catch(_0x1c8337){logger[_0x2be6('0x14')]('[%s][MESSAGE]\x20%s',_0x4681e1,JSON[_0x2be6('0x16')](_0x1c8337));_0x2e6c00[_0x2be6('0x15')]();}};}; \ No newline at end of file +var _0xdf97=['create','info','[%s][MESSAGE]\x20%s','body','catch','stringify','error','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message'];(function(_0x4ab63b,_0x1c8bd7){var _0x381f56=function(_0xe5eeb4){while(--_0xe5eeb4){_0x4ab63b['push'](_0x4ab63b['shift']());}};_0x381f56(++_0x1c8bd7);}(_0xdf97,0xfb));var _0x7df9=function(_0x32eb3f,_0x3cc610){_0x32eb3f=_0x32eb3f-0x0;var _0x372d5f=_0xdf97[_0x32eb3f];return _0x372d5f;};'use strict';var _=require(_0x7df9('0x0'));var utils=require('./utils');var logger=require(_0x7df9('0x1'))(_0x7df9('0x2'));var rpc={'chatMessage':require(_0x7df9('0x3')),'openchannelMessage':require(_0x7df9('0x4')),'mailMessage':require(_0x7df9('0x5')),'smsMessage':require(_0x7df9('0x6')),'faxMessage':require(_0x7df9('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7df9('0x8')]=function(_0x408a52,_0x355a1c){return function(_0x19ffc3){try{var _0x1cb6b5={'body':utils[_0x7df9('0x9')](_0x355a1c[0x0],this),'ContactId':this[_0x7df9('0xa')]['id']};if(this[_0x7df9('0xb')]===_0x7df9('0xc')){_0x1cb6b5[_0x7df9('0xd')]=this[_0x7df9('0xe')]['id'];}else{_0x1cb6b5[_[_0x7df9('0xf')](this[_0x7df9('0xb')])+'AccountId']=this[_0x7df9('0xe')]['id'];}_0x1cb6b5[_[_0x7df9('0xf')](this[_0x7df9('0xb')])+_0x7df9('0x10')]=this[_0x7df9('0x11')]['id'];if(rpc[this[_0x7df9('0xb')]+_0x7df9('0x12')]){return rpc[this[_0x7df9('0xb')]+_0x7df9('0x12')][_0x7df9('0x13')](_0x1cb6b5)['then'](function(_0x571e4c){logger[_0x7df9('0x14')](_0x7df9('0x15'),_0x408a52,_0x1cb6b5[_0x7df9('0x16')]);_0x19ffc3['next']();})[_0x7df9('0x17')](function(_0x4bdd82){logger['error'](_0x7df9('0x15'),_0x408a52,JSON[_0x7df9('0x18')](_0x4bdd82));_0x19ffc3['stop']();});}}catch(_0x772f72){logger[_0x7df9('0x19')](_0x7df9('0x15'),_0x408a52,JSON['stringify'](_0x772f72));_0x19ffc3[_0x7df9('0x1a')]();}};}; \ 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 9e48d0e..f70b145 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 _0x9527=['info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x2dafb9,_0x1be224){var _0x56c25a=function(_0x3e7c69){while(--_0x3e7c69){_0x2dafb9['push'](_0x2dafb9['shift']());}};_0x56c25a(++_0x1be224);}(_0x9527,0xa8));var _0x7952=function(_0x4f8a8b,_0x4152dd){_0x4f8a8b=_0x4f8a8b-0x0;var _0x5bd4e5=_0x9527[_0x4f8a8b];return _0x5bd4e5;};'use strict';var utils=require('./utils');var logger=require(_0x7952('0x0'))(_0x7952('0x1'));exports[_0x7952('0x2')]=function(_0x1f3df0,_0x3d230d){return function(_0x2d4556){try{logger[_0x7952('0x3')](_0x7952('0x4'),_0x1f3df0,utils[_0x7952('0x5')](_0x3d230d[0x0],this));_0x2d4556[_0x7952('0x6')]();}catch(_0x1d2182){logger['error']('[%s][NOOP]\x20%s',_0x1f3df0,JSON[_0x7952('0x7')](_0x1d2182));_0x2d4556[_0x7952('0x8')]();}};}; \ No newline at end of file +var _0x9e10=['error','stringify','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x4df33d,_0x580bd7){var _0x1705f0=function(_0x5cd5b2){while(--_0x5cd5b2){_0x4df33d['push'](_0x4df33d['shift']());}};_0x1705f0(++_0x580bd7);}(_0x9e10,0x67));var _0x09e1=function(_0x396ed5,_0x58efa4){_0x396ed5=_0x396ed5-0x0;var _0x10fa90=_0x9e10[_0x396ed5];return _0x10fa90;};'use strict';var utils=require(_0x09e1('0x0'));var logger=require(_0x09e1('0x1'))(_0x09e1('0x2'));exports['consequence']=function(_0x55ed78,_0x38fb70){return function(_0x30b14d){try{logger[_0x09e1('0x3')](_0x09e1('0x4'),_0x55ed78,utils[_0x09e1('0x5')](_0x38fb70[0x0],this));_0x30b14d[_0x09e1('0x6')]();}catch(_0x5b2d7c){logger[_0x09e1('0x7')](_0x09e1('0x4'),_0x55ed78,JSON[_0x09e1('0x8')](_0x5b2d7c));_0x30b14d[_0x09e1('0x9')]();}};}; \ 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 efbc82a..29afcd7 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 _0x0c7f=['complete','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','list','upperFirst','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close'];(function(_0x549a00,_0x152247){var _0x597c05=function(_0x1db1c4){while(--_0x1db1c4){_0x549a00['push'](_0x549a00['shift']());}};_0x597c05(++_0x152247);}(_0x0c7f,0x1c9));var _0xf0c7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0c7f[_0x1facfa];return _0x9ec701;};'use strict';var schema=require(_0xf0c7('0x0'));var _=require(_0xf0c7('0x1'));var util=require(_0xf0c7('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xf0c7('0x3'));var Redis=require(_0xf0c7('0x4'));var config=require('../../../../config/environment');var logger=require(_0xf0c7('0x5'))(_0xf0c7('0x6'));var strategy=require('./strategy');config[_0xf0c7('0x7')]=_[_0xf0c7('0x8')](config[_0xf0c7('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf0c7('0x9'))(new Redis(config[_0xf0c7('0x7')]));var attributes=['id',_0xf0c7('0xa'),_0xf0c7('0xb'),_0xf0c7('0xc'),_0xf0c7('0xd'),_0xf0c7('0xe')];function emit(_0x5eca2a,_0x5ef78d,_0x35e64d){io['to'](_0x5eca2a)[_0xf0c7('0xf')](_0x5ef78d,_0x35e64d);}function emitChannelQueueInteraction(_0x2e6a4a,_0x42e01d,_0x10ca40,_0x1822e8,_0x1c341e,_0x3c5e0e,_0x55bd81,_0xd380e9){var _0x406854=_[_0xf0c7('0x10')](_0x10ca40);_0x406854[_0xf0c7('0xa')]=_0xd380e9;_0x406854['queue']=_0x42e01d;_0x406854['account']=_0x1822e8;_0x406854['id']=_0x1c341e;if(_0x3c5e0e){_0x55bd81[util['format'](_0xf0c7('0x11'),_0x2e6a4a)][_0x1c341e]=_[_0xf0c7('0x12')](_0x406854,attributes);}else{delete _0x55bd81[util[_0xf0c7('0x13')](_0xf0c7('0x11'),_0x2e6a4a)][_0x1c341e];}emit(util['format'](_0xf0c7('0x14'),_0x2e6a4a,_0x42e01d),util[_0xf0c7('0x13')](_0xf0c7('0x15'),_0x2e6a4a,_0x3c5e0e?_0xf0c7('0x16'):_0xf0c7('0x17')),_[_0xf0c7('0x12')](_0x406854,attributes));}var rpc={'openchannelQueueReport':require(_0xf0c7('0x18')),'mailQueueReport':require(_0xf0c7('0x19')),'chatQueueReport':require(_0xf0c7('0x1a')),'smsQueueReport':require(_0xf0c7('0x1b')),'faxQueueReport':require(_0xf0c7('0x1c')),'whatsappQueueReport':require(_0xf0c7('0x1d'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf0c7('0x1e')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xa9a94b,_0x145115,_0x331d66,_0x1ee05c){if(_0xa9a94b&&_0x145115&&_0x331d66){_0x145115[_0xf0c7('0x1f')]+=0x1;var _0x278dc5={'uniqueid':_0xa9a94b,'from':_0x331d66['body']?_0x331d66[_0xf0c7('0x20')][_0xf0c7('0xd')]:'','joinAt':moment()[_0xf0c7('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x331d66['contact']?_0x331d66['contact']['id']:null,'ListId':_0x331d66[_0xf0c7('0x21')]?_0x331d66[_0xf0c7('0x21')]['id']:null};_0x278dc5[_[_0xf0c7('0x22')](_0x331d66[_0xf0c7('0x23')])+'QueueId']=_0x145115['id']||null;_0x278dc5[_[_0xf0c7('0x22')](_0x331d66[_0xf0c7('0x23')])+'InteractionId']=_0x331d66[_0xf0c7('0x24')]?_0x331d66['interaction']['id']:null;_0x278dc5[_['upperFirst'](_0x331d66[_0xf0c7('0x23')])+_0xf0c7('0x25')]=_0x331d66[_0xf0c7('0x26')]?_0x331d66[_0xf0c7('0x26')]['id']:null;_0x278dc5[_[_0xf0c7('0x22')](_0x331d66['channel'])+(_0x331d66[_0xf0c7('0x23')]!==_0xf0c7('0x27')?_0xf0c7('0x28'):_0xf0c7('0x29'))]=_0x331d66['account']?_0x331d66['account']['id']:null;logger[_0xf0c7('0x2a')](util['format'](_0xf0c7('0x2b'),_0xa9a94b,_0x145115[_0xf0c7('0x2c')]));emitChannelQueueInteraction(_0x331d66[_0xf0c7('0x23')],_0x145115[_0xf0c7('0x2c')],_0x278dc5,_0x331d66[_0xf0c7('0xb')][_0xf0c7('0x2c')],_0x331d66[_0xf0c7('0x26')]['id'],!![],_0x1ee05c,_0x145115['id']);if(rpc[_0x331d66[_0xf0c7('0x23')]+_0xf0c7('0x2d')]){return rpc[_0x331d66['channel']+_0xf0c7('0x2d')]['create'](_0x278dc5)[_0xf0c7('0x2e')](function(_0x566889){logger[_0xf0c7('0x2f')](_0xf0c7('0x30'));});}}}function stopRouting(_0x31b5da,_0x17f4c5,_0x227a57,_0x58f878){if(_0x31b5da&&_0x17f4c5){_0x17f4c5['waiting']-=0x1;var _0x2be457={'leaveAt':moment()[_0xf0c7('0x13')](_0xf0c7('0x31')),'acceptAt':moment()[_0xf0c7('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf0c7('0x32')};logger[_0xf0c7('0x2a')](util[_0xf0c7('0x13')]('[%s][STOP:QUEUE][NAME:%s]',_0x31b5da,_0x17f4c5[_0xf0c7('0x2c')]));emitChannelQueueInteraction(_0x227a57[_0xf0c7('0x23')],_0x17f4c5[_0xf0c7('0x2c')],_0x227a57[_0xf0c7('0x20')],_0x227a57[_0xf0c7('0xb')]['name'],_0x227a57[_0xf0c7('0x26')]['id'],![],_0x58f878,_0x17f4c5['id']);if(rpc[_0x227a57['channel']+'QueueReport']){return rpc[_0x227a57[_0xf0c7('0x23')]+'QueueReport']['update'](_0x31b5da,_0x2be457)[_0xf0c7('0x2e')](function(_0x3af858){logger[_0xf0c7('0x2f')](_0xf0c7('0x33'));});}}}function endRouting(_0x4cb102,_0x1d88fb,_0x38c85b,_0x5d7568){if(_0x4cb102&&_0x1d88fb){_0x1d88fb[_0xf0c7('0x1f')]-=0x1;var _0x2cabaa={'leaveAt':moment()[_0xf0c7('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xf0c7('0x13')](_0xf0c7('0x31')),'reason':_0xf0c7('0x34')};logger[_0xf0c7('0x2a')](util[_0xf0c7('0x13')](_0xf0c7('0x35'),_0x4cb102,_0x1d88fb['name']));emitChannelQueueInteraction(_0x38c85b[_0xf0c7('0x23')],_0x1d88fb[_0xf0c7('0x2c')],_0x38c85b[_0xf0c7('0x20')],_0x38c85b[_0xf0c7('0xb')]['name'],_0x38c85b[_0xf0c7('0x26')]['id'],![],_0x5d7568);if(rpc[_0x38c85b[_0xf0c7('0x23')]+_0xf0c7('0x2d')]){return rpc[_0x38c85b['channel']+_0xf0c7('0x2d')][_0xf0c7('0x36')](_0x4cb102,_0x2cabaa)[_0xf0c7('0x2e')](function(_0x30f7a6){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x2a5a5d){return function(_0x49bd33){return _0x49bd33['name']['toLowerCase']()===_0x2a5a5d['toLowerCase']();};}exports['consequence']=function(_0x3f66d5,_0x3c2a8b,_0x49b1e4,_0x35322d){return function(_0x10b5a){try{var _0x256bbc={'name':_0x3c2a8b[0x0],'timeout':_0x3c2a8b[0x1]};var _0x5b332b=queue['validate'](_0x256bbc,{'typecast':!![]});if(_0x5b332b[_0xf0c7('0x37')]){logger[_0xf0c7('0x2f')](_0xf0c7('0x38'),_0x3f66d5,_[_0xf0c7('0x39')](_0x5b332b,'message')[_0xf0c7('0x3a')](',\x20'));_0x10b5a[_0xf0c7('0x3b')]();}else{var _0x5413ad=_[_0xf0c7('0x3c')](_0x49b1e4[_0x35322d[_0xf0c7('0x23')]+_0xf0c7('0x3d')],handleFindQueue(_0x256bbc['name']));if(_0x5413ad){startRouting(_0x3f66d5,_0x5413ad,_0x35322d,_0x49b1e4);var _0x248aba=(_0x5413ad['timeout']||0xa)*0x3e8;var _0xb83ad9=(_0x256bbc[_0xf0c7('0x34')]||0x14)*0x3e8;var _0x26691d,_0x48a246;if(_0x248aba>_0xb83ad9){_0xb83ad9=_0x248aba;}var _0x54e6fb=seqqueue[_0xf0c7('0x3e')](_0x248aba);_0x54e6fb['id']=_0x3f66d5;_0x54e6fb[_0xf0c7('0x3f')]=_0x248aba;_0x54e6fb[_0xf0c7('0x40')]=_0xb83ad9;_0x54e6fb['channel']=_0x35322d[_0xf0c7('0x23')];_0x49b1e4[_0xf0c7('0x41')][_0x3f66d5]['on']('end',function(){logger[_0xf0c7('0x2a')](_0xf0c7('0x42'),_0x3f66d5);stopRouting(_0x3f66d5,_0x5413ad,_0x35322d,_0x49b1e4);clearTimeout(_0x26691d);_0x26691d=undefined;_0x54e6fb[_0xf0c7('0x43')](!![]);if(_0x49b1e4[_0xf0c7('0x41')][_0x3f66d5]){delete _0x49b1e4[_0xf0c7('0x41')][_0x3f66d5];}_0x10b5a[_0xf0c7('0x3b')]();});_0x49b1e4[_0xf0c7('0x41')][_0x3f66d5]['on'](_0xf0c7('0x44'),function(){if(_0x49b1e4['rules'][_0x3f66d5]){delete _0x49b1e4[_0xf0c7('0x41')][_0x3f66d5];}});_0x26691d=setTimeout(function(){logger[_0xf0c7('0x2a')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x3f66d5);endRouting(_0x3f66d5,_0x5413ad,_0x35322d,_0x49b1e4);clearTimeout(_0x26691d);_0x54e6fb['close'](!![]);_0x10b5a['next']();},_0xb83ad9);switch(_0x5413ad[_0xf0c7('0x45')]){case _0xf0c7('0x46'):strategy[_0xf0c7('0x46')](_0x54e6fb,_0x5413ad,_0x49b1e4,_0x35322d);break;default:strategy[_0xf0c7('0x47')](_0x54e6fb,_0x5413ad,_0x49b1e4,_0x35322d);}}else{logger['error'](_0xf0c7('0x48'),_0x3f66d5,_0x256bbc[_0xf0c7('0x2c')]);_0x10b5a['stop']();}}}catch(_0x4b47ee){console[_0xf0c7('0x49')](_0x4b47ee);logger[_0xf0c7('0x2f')](_0xf0c7('0x38'),_0x3f66d5,_0x4b47ee[_0xf0c7('0x4a')]);_0x10b5a[_0xf0c7('0x3b')]();}};}; \ No newline at end of file +var _0xd2be=['socket.io-emitter','account','emit','queue_id','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','string','number','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','InteractionId','interaction','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','map','join','stop','find','Queues','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','beepall','stack','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','localhost'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd2be,0x86));var _0xed2b=function(_0x311aec,_0x13d488){_0x311aec=_0x311aec-0x0;var _0x1f0a2e=_0xd2be[_0x311aec];return _0x1f0a2e;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xed2b('0x0'));var seqqueue=require(_0xed2b('0x1'));var moment=require(_0xed2b('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xed2b('0x3'))(_0xed2b('0x4'));var strategy=require(_0xed2b('0x5'));config[_0xed2b('0x6')]=_['defaults'](config[_0xed2b('0x6')],{'host':_0xed2b('0x7'),'port':0x18eb});var io=require(_0xed2b('0x8'))(new Redis(config[_0xed2b('0x6')]));var attributes=['id','queue_id',_0xed2b('0x9'),'queue','from','joinAt'];function emit(_0x39b79d,_0x23a6ea,_0x1ae1b4){io['to'](_0x39b79d)[_0xed2b('0xa')](_0x23a6ea,_0x1ae1b4);}function emitChannelQueueInteraction(_0x59f1c0,_0x5099f6,_0x53348c,_0x4b55fc,_0x572a8b,_0x1134d0,_0x1421c4,_0x5df3d9){var _0x3bda34=_['clone'](_0x53348c);_0x3bda34[_0xed2b('0xb')]=_0x5df3d9;_0x3bda34[_0xed2b('0xc')]=_0x5099f6;_0x3bda34[_0xed2b('0x9')]=_0x4b55fc;_0x3bda34['id']=_0x572a8b;if(_0x1134d0){_0x1421c4[util[_0xed2b('0xd')](_0xed2b('0xe'),_0x59f1c0)][_0x572a8b]=_[_0xed2b('0xf')](_0x3bda34,attributes);}else{delete _0x1421c4[util[_0xed2b('0xd')](_0xed2b('0xe'),_0x59f1c0)][_0x572a8b];}emit(util['format'](_0xed2b('0x10'),_0x59f1c0,_0x5099f6),util[_0xed2b('0xd')]('%s_queue_waiting_interaction:%s',_0x59f1c0,_0x1134d0?'save':_0xed2b('0x11')),_[_0xed2b('0xf')](_0x3bda34,attributes));}var rpc={'openchannelQueueReport':require(_0xed2b('0x12')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xed2b('0x13')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xed2b('0x14'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xed2b('0x15'),'message':_0xed2b('0x16')}});function startRouting(_0x29dd2e,_0x13274e,_0x227d36,_0x52c32d){if(_0x29dd2e&&_0x13274e&&_0x227d36){_0x13274e['waiting']+=0x1;var _0x39f1a2={'uniqueid':_0x29dd2e,'from':_0x227d36[_0xed2b('0x17')]?_0x227d36[_0xed2b('0x17')][_0xed2b('0x18')]:'','joinAt':moment()[_0xed2b('0xd')](_0xed2b('0x19')),'ContactId':_0x227d36[_0xed2b('0x1a')]?_0x227d36[_0xed2b('0x1a')]['id']:null,'ListId':_0x227d36[_0xed2b('0x1b')]?_0x227d36['list']['id']:null};_0x39f1a2[_['upperFirst'](_0x227d36['channel'])+_0xed2b('0x1c')]=_0x13274e['id']||null;_0x39f1a2[_[_0xed2b('0x1d')](_0x227d36[_0xed2b('0x1e')])+_0xed2b('0x1f')]=_0x227d36[_0xed2b('0x20')]?_0x227d36[_0xed2b('0x20')]['id']:null;_0x39f1a2[_[_0xed2b('0x1d')](_0x227d36['channel'])+'MessageId']=_0x227d36[_0xed2b('0x21')]?_0x227d36[_0xed2b('0x21')]['id']:null;_0x39f1a2[_['upperFirst'](_0x227d36[_0xed2b('0x1e')])+(_0x227d36[_0xed2b('0x1e')]!=='chat'?_0xed2b('0x22'):'WebsiteId')]=_0x227d36['account']?_0x227d36['account']['id']:null;logger[_0xed2b('0x23')](util['format'](_0xed2b('0x24'),_0x29dd2e,_0x13274e[_0xed2b('0x25')]));emitChannelQueueInteraction(_0x227d36['channel'],_0x13274e[_0xed2b('0x25')],_0x39f1a2,_0x227d36[_0xed2b('0x9')]['name'],_0x227d36[_0xed2b('0x21')]['id'],!![],_0x52c32d,_0x13274e['id']);if(rpc[_0x227d36[_0xed2b('0x1e')]+_0xed2b('0x26')]){return rpc[_0x227d36[_0xed2b('0x1e')]+'QueueReport'][_0xed2b('0x27')](_0x39f1a2)[_0xed2b('0x28')](function(_0x9dca79){logger[_0xed2b('0x29')](_0xed2b('0x2a'));});}}}function stopRouting(_0x40e1af,_0x26f8f9,_0x35fb38,_0xdcf16a){if(_0x40e1af&&_0x26f8f9){_0x26f8f9[_0xed2b('0x2b')]-=0x1;var _0x475588={'leaveAt':moment()['format'](_0xed2b('0x19')),'acceptAt':moment()[_0xed2b('0xd')](_0xed2b('0x19')),'reason':_0xed2b('0x2c')};logger[_0xed2b('0x23')](util['format'](_0xed2b('0x2d'),_0x40e1af,_0x26f8f9[_0xed2b('0x25')]));emitChannelQueueInteraction(_0x35fb38[_0xed2b('0x1e')],_0x26f8f9['name'],_0x35fb38[_0xed2b('0x17')],_0x35fb38[_0xed2b('0x9')][_0xed2b('0x25')],_0x35fb38[_0xed2b('0x21')]['id'],![],_0xdcf16a,_0x26f8f9['id']);if(rpc[_0x35fb38[_0xed2b('0x1e')]+_0xed2b('0x26')]){return rpc[_0x35fb38[_0xed2b('0x1e')]+'QueueReport'][_0xed2b('0x2e')](_0x40e1af,_0x475588)[_0xed2b('0x28')](function(_0x117e59){logger[_0xed2b('0x29')](_0xed2b('0x2f'));});}}}function endRouting(_0x394314,_0x5ce78b,_0x1f7761,_0x5a6e58){if(_0x394314&&_0x5ce78b){_0x5ce78b[_0xed2b('0x2b')]-=0x1;var _0x4c314c={'leaveAt':moment()['format'](_0xed2b('0x19')),'exitAt':moment()[_0xed2b('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xed2b('0x30')};logger[_0xed2b('0x23')](util[_0xed2b('0xd')](_0xed2b('0x31'),_0x394314,_0x5ce78b[_0xed2b('0x25')]));emitChannelQueueInteraction(_0x1f7761[_0xed2b('0x1e')],_0x5ce78b[_0xed2b('0x25')],_0x1f7761[_0xed2b('0x17')],_0x1f7761[_0xed2b('0x9')][_0xed2b('0x25')],_0x1f7761[_0xed2b('0x21')]['id'],![],_0x5a6e58);if(rpc[_0x1f7761[_0xed2b('0x1e')]+'QueueReport']){return rpc[_0x1f7761[_0xed2b('0x1e')]+_0xed2b('0x26')][_0xed2b('0x2e')](_0x394314,_0x4c314c)[_0xed2b('0x28')](function(_0x17f0f2){logger[_0xed2b('0x29')](_0xed2b('0x2f'));});}}}function handleFindQueue(_0x28b333){return function(_0x3e7de6){return _0x3e7de6[_0xed2b('0x25')][_0xed2b('0x32')]()===_0x28b333['toLowerCase']();};}exports[_0xed2b('0x33')]=function(_0x2f011a,_0x3ef7c1,_0x1ae2e5,_0x55da79){return function(_0x44ddfe){try{var _0x29900f={'name':_0x3ef7c1[0x0],'timeout':_0x3ef7c1[0x1]};var _0x4101a8=queue[_0xed2b('0x34')](_0x29900f,{'typecast':!![]});if(_0x4101a8[_0xed2b('0x35')]){logger[_0xed2b('0x29')]('[%s][QUEUE]\x20%s',_0x2f011a,_[_0xed2b('0x36')](_0x4101a8,_0xed2b('0x21'))[_0xed2b('0x37')](',\x20'));_0x44ddfe[_0xed2b('0x38')]();}else{var _0x4d4bf5=_[_0xed2b('0x39')](_0x1ae2e5[_0x55da79['channel']+_0xed2b('0x3a')],handleFindQueue(_0x29900f[_0xed2b('0x25')]));if(_0x4d4bf5){startRouting(_0x2f011a,_0x4d4bf5,_0x55da79,_0x1ae2e5);var _0x195a83=(_0x4d4bf5[_0xed2b('0x30')]||0xa)*0x3e8;var _0x52d679=(_0x29900f[_0xed2b('0x30')]||0x14)*0x3e8;var _0x356ee2,_0x397053;if(_0x195a83>_0x52d679){_0x52d679=_0x195a83;}var _0x23d11b=seqqueue['createQueue'](_0x195a83);_0x23d11b['id']=_0x2f011a;_0x23d11b[_0xed2b('0x3b')]=_0x195a83;_0x23d11b['qtimeout']=_0x52d679;_0x23d11b['channel']=_0x55da79[_0xed2b('0x1e')];_0x1ae2e5['rules'][_0x2f011a]['on'](_0xed2b('0x3c'),function(){logger[_0xed2b('0x23')](_0xed2b('0x3d'),_0x2f011a);stopRouting(_0x2f011a,_0x4d4bf5,_0x55da79,_0x1ae2e5);clearTimeout(_0x356ee2);_0x356ee2=undefined;_0x23d11b['close'](!![]);if(_0x1ae2e5[_0xed2b('0x3e')][_0x2f011a]){delete _0x1ae2e5['rules'][_0x2f011a];}_0x44ddfe['stop']();});_0x1ae2e5[_0xed2b('0x3e')][_0x2f011a]['on'](_0xed2b('0x3f'),function(){if(_0x1ae2e5[_0xed2b('0x3e')][_0x2f011a]){delete _0x1ae2e5[_0xed2b('0x3e')][_0x2f011a];}});_0x356ee2=setTimeout(function(){logger[_0xed2b('0x23')](_0xed2b('0x40'),_0x2f011a);endRouting(_0x2f011a,_0x4d4bf5,_0x55da79,_0x1ae2e5);clearTimeout(_0x356ee2);_0x23d11b[_0xed2b('0x41')](!![]);_0x44ddfe[_0xed2b('0x42')]();},_0x52d679);switch(_0x4d4bf5[_0xed2b('0x43')]){case _0xed2b('0x44'):strategy['rrmemory'](_0x23d11b,_0x4d4bf5,_0x1ae2e5,_0x55da79);break;default:strategy[_0xed2b('0x45')](_0x23d11b,_0x4d4bf5,_0x1ae2e5,_0x55da79);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2f011a,_0x29900f[_0xed2b('0x25')]);_0x44ddfe['stop']();}}}catch(_0x3b8a65){console['log'](_0x3b8a65);logger[_0xed2b('0x29')]('[%s][QUEUE]\x20%s',_0x2f011a,_0x3b8a65[_0xed2b('0x46')]);_0x44ddfe[_0xed2b('0x38')]();}};}; \ 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 b673bd5..8d6b143 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 _0x3bb5=['routing','realtime','push','handleRun','bind','handleTimeout','squeue','timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agents','channel','agent','busy','busyQueue','forcedOwnership','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','notificationId','writeLog','lodash','./util','../../../../../config/logger'];(function(_0x4c586e,_0x2571ae){var _0x40d9a5=function(_0x340496){while(--_0x340496){_0x4c586e['push'](_0x4c586e['shift']());}};_0x40d9a5(++_0x2571ae);}(_0x3bb5,0x99));var _0x53bb=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x3bb5[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x53bb('0x0'));var uuid=require('uuid');var util=require(_0x53bb('0x1'));var logger=require(_0x53bb('0x2'))(_0x53bb('0x3'));var Agent=function(_0x3ac7c4,_0x4cc2b6,_0x3392db,_0x44f110){this['notificationId']=uuid['v4']();this['squeue']=_0x3ac7c4;this['agent']=_0x4cc2b6;this[_0x53bb('0x4')]=_0x3392db;this['routing']=_0x44f110;this['squeue'][_0x53bb('0x5')](this[_0x53bb('0x6')][_0x53bb('0x7')](this),this[_0x53bb('0x8')][_0x53bb('0x7')](this));this[_0x53bb('0x9')]['on'](_0x53bb('0xa'),this[_0x53bb('0x8')][_0x53bb('0x7')](this));this['squeue']['on']('drained',this[_0x53bb('0xb')]['bind'](this));};Agent[_0x53bb('0xc')][_0x53bb('0x5')]=function(){this['squeue'][_0x53bb('0x5')](this['handleRun'][_0x53bb('0x7')](this),this[_0x53bb('0x8')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x53bb('0x8')](!![]);};Agent['prototype'][_0x53bb('0x6')]=function(_0x4bf6dc){logger[_0x53bb('0xd')](_0x53bb('0xe'),this[_0x53bb('0x9')]['id'],this['agent']['id']);if(_['isNil'](this['realtime'][_0x53bb('0xf')][this['agent']['id']])){logger[_0x53bb('0xd')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x53bb('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x53bb('0x5')][_0x53bb('0x7')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0x53bb('0x9')]['id'],this['realtime']['agents'][this['agent']['id']],this['squeue'][_0x53bb('0x10')],![])){this[_0x53bb('0x4')][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']][_0x53bb('0x12')]=!![];this['realtime'][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']][_0x53bb('0x13')]=undefined;util['showNotification'](this['notificationId'],this[_0x53bb('0x9')]['id'],this[_0x53bb('0x4')]['agents'][this[_0x53bb('0x11')]['id']],null,this[_0x53bb('0x3')]);util['writeLog'](this['squeue']['id'],this['realtime'][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']],'RINGING'+(this[_0x53bb('0x3')][_0x53bb('0x14')]?':FORCED':''));}else{logger['info'](_0x53bb('0x15'),this['squeue']['id'],this[_0x53bb('0x11')]['id']);setTimeout(this[_0x53bb('0x5')][_0x53bb('0x7')](this),0x3e8);}}};Agent[_0x53bb('0xc')]['handleTimeout']=function(_0x4373de){if(_['isNil'](this[_0x53bb('0x4')][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']])){return logger[_0x53bb('0xd')](_0x53bb('0x16'),this[_0x53bb('0x9')]['id'],this['agent']['id']);}else{logger[_0x53bb('0xd')](_0x53bb('0x17'),this[_0x53bb('0x9')]['id'],this[_0x53bb('0x11')]['id']);util['hideNotification'](this[_0x53bb('0x18')],this['squeue']['id'],this['realtime'][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']],null,this[_0x53bb('0x3')]);this[_0x53bb('0x4')]['agents'][this['agent']['id']][_0x53bb('0x12')]=![];this[_0x53bb('0x4')][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']][_0x53bb('0x13')]=undefined;util[_0x53bb('0x19')](this['squeue']['id'],this[_0x53bb('0x4')][_0x53bb('0xf')][this[_0x53bb('0x11')]['id']],_0x4373de?'STOP':'TIMEOUT');}if(!_0x4373de){setTimeout(this[_0x53bb('0x5')][_0x53bb('0x7')](this),0x3e8);}};function agent(_0x4b8c6e,_0x35b670,_0xf69647,_0x40f2a7){return new Agent(_0x4b8c6e,_0x35b670,_0xf69647,_0x40f2a7);}module['exports']=agent; \ No newline at end of file +var _0x6071=['[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','agent','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','channel','busy','busyQueue','notificationId',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x3618e5,_0x1cfc2b){var _0x2d3d78=function(_0x1ee148){while(--_0x1ee148){_0x3618e5['push'](_0x3618e5['shift']());}};_0x2d3d78(++_0x1cfc2b);}(_0x6071,0x10e));var _0x1607=function(_0x3ae6b3,_0x19deae){_0x3ae6b3=_0x3ae6b3-0x0;var _0x5bc583=_0x6071[_0x3ae6b3];return _0x5bc583;};'use strict';var _=require(_0x1607('0x0'));var uuid=require('uuid');var util=require(_0x1607('0x1'));var logger=require(_0x1607('0x2'))(_0x1607('0x3'));var Agent=function(_0x390e7a,_0x265805,_0x51e530,_0x4cb2fe){this['notificationId']=uuid['v4']();this['squeue']=_0x390e7a;this[_0x1607('0x4')]=_0x265805;this[_0x1607('0x5')]=_0x51e530;this[_0x1607('0x3')]=_0x4cb2fe;this[_0x1607('0x6')][_0x1607('0x7')](this[_0x1607('0x8')][_0x1607('0x9')](this),this[_0x1607('0xa')][_0x1607('0x9')](this));this[_0x1607('0x6')]['on'](_0x1607('0xb'),this[_0x1607('0xa')][_0x1607('0x9')](this));this[_0x1607('0x6')]['on'](_0x1607('0xc'),this[_0x1607('0xd')][_0x1607('0x9')](this));};Agent['prototype'][_0x1607('0x7')]=function(){this[_0x1607('0x6')][_0x1607('0x7')](this[_0x1607('0x8')][_0x1607('0x9')](this),this['handleTimeout'][_0x1607('0x9')](this));};Agent[_0x1607('0xe')][_0x1607('0xd')]=function(){this[_0x1607('0xa')](!![]);};Agent[_0x1607('0xe')][_0x1607('0x8')]=function(_0x11db9b){logger[_0x1607('0xf')](_0x1607('0x10'),this[_0x1607('0x6')]['id'],this[_0x1607('0x4')]['id']);if(_[_0x1607('0x11')](this['realtime'][_0x1607('0x12')][this['agent']['id']])){logger[_0x1607('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1607('0x6')]['id'],this['agent']['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0x1607('0x13')]||util['isAgentAvailable'](this[_0x1607('0x6')]['id'],this[_0x1607('0x5')][_0x1607('0x12')][this[_0x1607('0x4')]['id']],this[_0x1607('0x6')][_0x1607('0x14')],![])){this[_0x1607('0x5')][_0x1607('0x12')][this[_0x1607('0x4')]['id']][_0x1607('0x15')]=!![];this[_0x1607('0x5')][_0x1607('0x12')][this[_0x1607('0x4')]['id']][_0x1607('0x16')]=undefined;util['showNotification'](this[_0x1607('0x17')],this[_0x1607('0x6')]['id'],this['realtime'][_0x1607('0x12')][this[_0x1607('0x4')]['id']],null,this[_0x1607('0x3')]);util['writeLog'](this[_0x1607('0x6')]['id'],this[_0x1607('0x5')][_0x1607('0x12')][this[_0x1607('0x4')]['id']],'RINGING'+(this[_0x1607('0x3')][_0x1607('0x13')]?_0x1607('0x18'):''));}else{logger[_0x1607('0xf')](_0x1607('0x19'),this[_0x1607('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x1607('0x7')][_0x1607('0x9')](this),0x3e8);}}};Agent[_0x1607('0xe')][_0x1607('0xa')]=function(_0x510e88){if(_[_0x1607('0x11')](this[_0x1607('0x5')][_0x1607('0x12')][this['agent']['id']])){return logger[_0x1607('0xf')](_0x1607('0x1a'),this[_0x1607('0x6')]['id'],this[_0x1607('0x4')]['id']);}else{logger[_0x1607('0xf')](_0x1607('0x1b'),this[_0x1607('0x6')]['id'],this[_0x1607('0x4')]['id']);util[_0x1607('0x1c')](this[_0x1607('0x17')],this[_0x1607('0x6')]['id'],this['realtime'][_0x1607('0x12')][this[_0x1607('0x4')]['id']],null,this[_0x1607('0x3')]);this[_0x1607('0x5')][_0x1607('0x12')][this['agent']['id']][_0x1607('0x15')]=![];this[_0x1607('0x5')][_0x1607('0x12')][this[_0x1607('0x4')]['id']][_0x1607('0x16')]=undefined;util[_0x1607('0x1d')](this['squeue']['id'],this['realtime']['agents'][this[_0x1607('0x4')]['id']],_0x510e88?_0x1607('0x1e'):_0x1607('0x1f'));}if(!_0x510e88){setTimeout(this[_0x1607('0x7')]['bind'](this),0x3e8);}};function agent(_0x42fb28,_0x10a37a,_0x24b94d,_0x2f1171){return new Agent(_0x42fb28,_0x10a37a,_0x24b94d,_0x2f1171);}module[_0x1607('0x20')]=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 54c9420..3bb563b 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 _0x3468=['hideNotification','routing','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','queue','Agents','length','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','showNotification','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x3468,0x8d));var _0x8346=function(_0x45ef60,_0x326014){_0x45ef60=_0x45ef60-0x0;var _0x58d8fd=_0x3468[_0x45ef60];return _0x58d8fd;};'use strict';var _=require(_0x8346('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x8346('0x1'))('routing');var Beepall=function(_0x47b806,_0x7207cc,_0x1a7eb9,_0x4082b5){this['notificationId']=uuid['v4']();this['squeue']=_0x47b806;this['queue']=_0x7207cc;this[_0x8346('0x2')]=_0x1a7eb9;this['routing']=_0x4082b5;this[_0x8346('0x3')][_0x8346('0x4')](this[_0x8346('0x5')][_0x8346('0x6')](this),this[_0x8346('0x7')][_0x8346('0x6')](this));this[_0x8346('0x3')]['on'](_0x8346('0x8'),this[_0x8346('0x7')][_0x8346('0x6')](this));this[_0x8346('0x3')]['on'](_0x8346('0x9'),this[_0x8346('0xa')]['bind'](this));};Beepall[_0x8346('0xb')][_0x8346('0x4')]=function(){this[_0x8346('0x3')][_0x8346('0x4')](this[_0x8346('0x5')][_0x8346('0x6')](this),this['handleTimeout'][_0x8346('0x6')](this));};Beepall[_0x8346('0xb')][_0x8346('0xa')]=function(_0x242f75){this[_0x8346('0x7')](!![]);};Beepall[_0x8346('0xb')][_0x8346('0x5')]=function(_0x59492e){var _0x1d58d7=!![];if(!_['isNil'](this[_0x8346('0xc')])&&!_['isNil'](this[_0x8346('0xc')]['Agents'])&&this[_0x8346('0xc')]['Agents']['length']>0x0){for(var _0x2909e3=0x0,_0x308f2c;_0x2909e30x0){for(var _0x5cdb4b=0x0,_0x44e243;_0x5cdb4b0x0&&_0x4ecf4c[_0x41f89e+_0x6704('0x2b')]>=_0x4ecf4c[_0x41f89e+_0x6704('0x2a')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x41f89e['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6704('0x2c')]=function(_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46){return sendNotification(!![],_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46);};exports[_0x6704('0x2d')]=function(_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2){return sendNotification(![],_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xbff5=['CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','localhost','socket.io-emitter','emit','format','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','PAUSE','Capacity','hasOwnProperty'];(function(_0x503e78,_0x43c2ef){var _0x313a82=function(_0x38fdf7){while(--_0x38fdf7){_0x503e78['push'](_0x503e78['shift']());}};_0x313a82(++_0x43c2ef);}(_0xbff5,0x1bc));var _0x5bff=function(_0x8c15c8,_0x238ae3){_0x8c15c8=_0x8c15c8-0x0;var _0x11bd15=_0xbff5[_0x8c15c8];return _0x11bd15;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var utils=require(_0x5bff('0x2'));var Mustache=require(_0x5bff('0x3'));var Redis=require(_0x5bff('0x4'));var config=require(_0x5bff('0x5'));var logger=require(_0x5bff('0x6'))('routing');config[_0x5bff('0x7')]=_['defaults'](config['redis'],{'host':_0x5bff('0x8'),'port':0x18eb});var io=require(_0x5bff('0x9'))(new Redis(config[_0x5bff('0x7')]));function emit(_0xa54c57,_0x43605a,_0xd4b9dc){io['to'](_0xa54c57)[_0x5bff('0xa')](_0x43605a,_0xd4b9dc);}function sendNotification(_0x139c99,_0x3eb6f9,_0x4a1be2,_0x20e26f,_0x5e7d10,_0x1d8197){io['to'](util[_0x5bff('0xb')]('user:%s',_0x20e26f[_0x5bff('0xc')]))['emit'](_0x5bff('0xd'),_0x20e26f);var _0x4ff164=_0x1d8197||{};var _0x207835=_0x4a1be2[_0x5bff('0xe')]('.');var _0x4a6903={'uniqueid':_0x3eb6f9,'channel':_0x207835[0x0],'id':_0x207835[0x1],'title':_0x207835[0x0]+_0x5bff('0xf'),'interactionId':_0x207835[0x2],'queue':_0x5e7d10?_0x5e7d10['name']:null,'sound':_0x4ff164[_0x5bff('0x10')][_0x5bff('0x11')],'shake':_0x4ff164['account'][_0x5bff('0x12')]};try{if(!_0x4ff164[_0x5bff('0x13')]){_0x4ff164['body']={};}if(_0x5e7d10){_0x4ff164['body'][_0x5bff('0x14')]=_0x5e7d10;}else if(_0x4ff164[_0x5bff('0x13')][_0x5bff('0x14')]){delete _0x4ff164['body'][_0x5bff('0x14')];}_0x4a6903[_0x5bff('0x15')]=utils[_0x5bff('0x16')](_0x4ff164['account'][_0x5bff('0x17')],_0x4ff164);}catch(_0x40c7f6){_0x4a6903[_0x5bff('0x15')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x5bff('0x18')](util[_0x5bff('0xb')](_0x5bff('0x19'),_0x3eb6f9,_0x40c7f6[_0x5bff('0x1a')]));}io['to'](util['format'](_0x5bff('0x1b'),_0x20e26f['name']))[_0x5bff('0xa')](util['format'](_0x5bff('0x1c'),_0x139c99?_0x5bff('0x1d'):_0x5bff('0x1e')),_0x4a6903);}function writeLog(_0x6cbfa,_0x12d018,_0x2012e4){return logger[_0x5bff('0x1f')](util[_0x5bff('0xb')](_0x5bff('0x20'),_0x6cbfa,_0x12d018['name'],_0x2012e4));}exports[_0x5bff('0x21')]=function(_0x263cf5,_0x4369b0,_0x1e7f8a,_0x352b1f){if(_0x4369b0[_0x5bff('0x22')]){writeLog(_0x263cf5,_0x4369b0,_0x5bff('0x23'));return![];}if(!_0x4369b0[_0x5bff('0x24')]){writeLog(_0x263cf5,_0x4369b0,'OFFLINE');return![];}if(_0x4369b0[_0x1e7f8a+'Pause']){writeLog(_0x263cf5,_0x4369b0,_0x5bff('0x25'));return![];}if(_0x352b1f&&_0x4369b0['hasOwnProperty'](_0x1e7f8a+_0x5bff('0x26'))&&_0x4369b0[_0x5bff('0x27')](_0x1e7f8a+_0x5bff('0x28'))){if(_0x4369b0[_0x1e7f8a+_0x5bff('0x26')]>0x0&&_0x4369b0[_0x1e7f8a+_0x5bff('0x28')]>=_0x4369b0[_0x1e7f8a+_0x5bff('0x26')]){writeLog(_0x263cf5,_0x4369b0,_0x1e7f8a[_0x5bff('0x29')]()+_0x5bff('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x4df57a,_0x20d750,_0x2dd52f,_0x4d7640,_0x36a7d2){return sendNotification(!![],_0x4df57a,_0x20d750,_0x2dd52f,_0x4d7640,_0x36a7d2);};exports['hideNotification']=function(_0x5470cb,_0x3eda3a,_0x5cf207,_0x3ed23b,_0x64e22){return sendNotification(![],_0x5470cb,_0x3eda3a,_0x5cf207,_0x3ed23b,_0x64e22);};exports[_0x5bff('0x2b')]=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 8077d39..b29f052 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 _0x24cd=['isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace'];(function(_0x2a8efb,_0x580fb8){var _0x4747c4=function(_0x12e5b2){while(--_0x12e5b2){_0x2a8efb['push'](_0x2a8efb['shift']());}};_0x4747c4(++_0x580fb8);}(_0x24cd,0x83));var _0xd24c=function(_0x414a24,_0x3a5e65){_0x414a24=_0x414a24-0x0;var _0xe81e0c=_0x24cd[_0x414a24];return _0xe81e0c;};'use strict';var schema=require(_0xd24c('0x0'));var sh=require(_0xd24c('0x1'));var _=require('lodash');var utils=require(_0xd24c('0x2'));var logger=require('../../../../config/logger')(_0xd24c('0x3'));var system=schema({'command':{'type':_0xd24c('0x4'),'required':!![],'message':_0xd24c('0x5')}});exports['consequence']=function(_0x21a58c,_0x32001a){return function(_0x47c9ea){try{var _0x1c30fc={'command':_0x32001a[0x0]};var _0x2721be=system[_0xd24c('0x0')](_0x1c30fc,{'typecast':!![]});if(_0x2721be[_0xd24c('0x6')]){logger[_0xd24c('0x7')](_0xd24c('0x8'),_0x21a58c,_[_0xd24c('0x9')](_0x2721be,_0xd24c('0xa'))['join'](',\x20'));logger['info'](_0xd24c('0xb'),_0x21a58c);_0x47c9ea[_0xd24c('0xc')]();}else{var _0x21b8d9=this;var _0x43ab46=utils[_0xd24c('0xd')](_0x32001a[0x0],this);logger[_0xd24c('0xe')](_0xd24c('0xf'),_0x21a58c,_0x43ab46);sh[_0xd24c('0x10')](_['trim'](_0x43ab46),function(_0x1c2be6,_0x5a7556){logger['info'](_0xd24c('0x11'),_0x21a58c,_0x1c2be6);if(_0x1c2be6==0x0){var _0x3bed2=_0x5a7556[_0xd24c('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xd24c('0x13')](_0x32001a[0x1])||_[_0xd24c('0x14')](_0x32001a[0x1])){logger[_0xd24c('0xe')](_0xd24c('0x15'),_0x21a58c);_0x21b8d9[_0xd24c('0x16')][_0x32001a[0x1]]=_0x3bed2;}else{logger['info'](_0xd24c('0x17'),_0x21a58c,_0x32001a[0x1],_0x3bed2);_0x21b8d9[_0xd24c('0x16')][_0x32001a[0x1]]=_0x3bed2;}}_0x47c9ea['next']();});}}catch(_0x34aa92){logger[_0xd24c('0x7')](_0xd24c('0x8'),_0x21a58c,_[_0xd24c('0x18')](_0x34aa92)?JSON['stringify'](_0x34aa92):_0x34aa92);logger['info'](_0xd24c('0xb'),_0x21a58c);_0x47c9ea[_0xd24c('0xc')]();}};}; \ No newline at end of file +var _0x9ac2=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','[%s][SYSTEM]\x20%s','isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','next','getMustacheRender','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable'];(function(_0x5f0a85,_0x517151){var _0x3ccda7=function(_0x37edce){while(--_0x37edce){_0x5f0a85['push'](_0x5f0a85['shift']());}};_0x3ccda7(++_0x517151);}(_0x9ac2,0x18b));var _0x29ac=function(_0x19ab90,_0x23773c){_0x19ab90=_0x19ab90-0x0;var _0x45b682=_0x9ac2[_0x19ab90];return _0x45b682;};'use strict';var schema=require(_0x29ac('0x0'));var sh=require(_0x29ac('0x1'));var _=require(_0x29ac('0x2'));var utils=require('./utils');var logger=require(_0x29ac('0x3'))(_0x29ac('0x4'));var system=schema({'command':{'type':'string','required':!![],'message':_0x29ac('0x5')}});exports[_0x29ac('0x6')]=function(_0x15174e,_0x3450da){return function(_0x5d754e){try{var _0x3d8422={'command':_0x3450da[0x0]};var _0x228057=system[_0x29ac('0x0')](_0x3d8422,{'typecast':!![]});if(_0x228057[_0x29ac('0x7')]){logger[_0x29ac('0x8')]('[%s][SYSTEM]\x20%s',_0x15174e,_[_0x29ac('0x9')](_0x228057,_0x29ac('0xa'))[_0x29ac('0xb')](',\x20'));logger[_0x29ac('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x15174e);_0x5d754e[_0x29ac('0xd')]();}else{var _0x59845f=this;var _0x5e7849=utils[_0x29ac('0xe')](_0x3450da[0x0],this);logger[_0x29ac('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x15174e,_0x5e7849);sh[_0x29ac('0xf')](_[_0x29ac('0x10')](_0x5e7849),function(_0x246c3e,_0x54faa9){logger[_0x29ac('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x15174e,_0x246c3e);if(_0x246c3e==0x0){var _0x432830=_0x54faa9[_0x29ac('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x29ac('0x12')](_0x3450da[0x1])||_[_0x29ac('0x13')](_0x3450da[0x1])){logger[_0x29ac('0xc')](_0x29ac('0x14'),_0x15174e);_0x59845f['body'][_0x3450da[0x1]]=_0x432830;}else{logger['info'](_0x29ac('0x15'),_0x15174e,_0x3450da[0x1],_0x432830);_0x59845f[_0x29ac('0x16')][_0x3450da[0x1]]=_0x432830;}}_0x5d754e['next']();});}}catch(_0x12bd8c){logger[_0x29ac('0x8')](_0x29ac('0x17'),_0x15174e,_[_0x29ac('0x18')](_0x12bd8c)?JSON['stringify'](_0x12bd8c):_0x12bd8c);logger[_0x29ac('0xc')](_0x29ac('0x19'),_0x15174e);_0x5d754e['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 5a4d1b3..afcaaff 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 _0xa31a=['length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','addTags','interaction','catch','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x1368fa,_0x3128b3){var _0x38af95=function(_0x63f1d6){while(--_0x63f1d6){_0x1368fa['push'](_0x1368fa['shift']());}};_0x38af95(++_0x3128b3);}(_0xa31a,0xcc));var _0xaa31=function(_0x395af7,_0x32901c){_0x395af7=_0x395af7-0x0;var _0x3d15cb=_0xa31a[_0x395af7];return _0x3d15cb;};'use strict';var schema=require(_0xaa31('0x0'));var _=require(_0xaa31('0x1'));var rpc={'chatInteraction':require(_0xaa31('0x2')),'openchannelInteraction':require(_0xaa31('0x3')),'smsInteraction':require(_0xaa31('0x4')),'mailInteraction':require(_0xaa31('0x5')),'faxInteraction':require(_0xaa31('0x6')),'whatsappInteraction':require(_0xaa31('0x7'))};var logger=require(_0xaa31('0x8'))('routing');var tag=schema({'tag':{'type':_0xaa31('0x9'),'required':!![],'message':_0xaa31('0xa')}});exports[_0xaa31('0xb')]=function(_0x5c3574,_0x35f7fd,_0x2ece96,_0x3695c5){return function(_0x4e14b1){try{var _0x54ce24={'tag':_0x35f7fd[0x0]};var _0x10dd6f=tag[_0xaa31('0x0')](_0x54ce24,{'typecast':!![]});if(_0x10dd6f[_0xaa31('0xc')]){logger[_0xaa31('0xd')](_0xaa31('0xe'),_0x5c3574,_[_0xaa31('0xf')](_0x10dd6f,_0xaa31('0x10'))[_0xaa31('0x11')](',\x20'));logger[_0xaa31('0x12')](_0xaa31('0x13'),_0x5c3574);_0x4e14b1['next']();}else{var _0x156bdb={'ids':[_0x35f7fd[0x0]]};if(rpc[_0x3695c5['channel']+_0xaa31('0x14')]){rpc[_0x3695c5[_0xaa31('0x15')]+_0xaa31('0x14')][_0xaa31('0x16')](_0x3695c5[_0xaa31('0x17')]['id'],_0x156bdb)['then'](function(_0x1de782){logger[_0xaa31('0x12')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5c3574,_0x35f7fd[0x1],_0x3695c5[_0xaa31('0x15')],_0x3695c5[_0xaa31('0x17')]['id']);})[_0xaa31('0x18')](function(_0x12a0c1){logger[_0xaa31('0xd')]('[%s][TAG]\x20%s',_0x5c3574,JSON[_0xaa31('0x19')](_0x12a0c1));logger[_0xaa31('0x12')](_0xaa31('0x13'),_0x5c3574);})['finally'](function(){_0x4e14b1['next']();});}}}catch(_0x1871e5){logger['error'](_0xaa31('0xe'),_0x5c3574,_[_0xaa31('0x1a')](_0x1871e5)?JSON[_0xaa31('0x19')](_0x1871e5):_0x1871e5);logger['info'](_0xaa31('0x13'),_0x5c3574);_0x4e14b1['next']();}};}; \ No newline at end of file +var _0x91e5=['length','error','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','addTags','interaction','then','catch','finally','[%s][TAG]\x20%s','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x42a159,_0x49f15d){var _0x4427b9=function(_0x1fd9d0){while(--_0x1fd9d0){_0x42a159['push'](_0x42a159['shift']());}};_0x4427b9(++_0x49f15d);}(_0x91e5,0x81));var _0x591e=function(_0x5a8a28,_0x2e2afa){_0x5a8a28=_0x5a8a28-0x0;var _0x203b9e=_0x91e5[_0x5a8a28];return _0x203b9e;};'use strict';var schema=require(_0x591e('0x0'));var _=require(_0x591e('0x1'));var rpc={'chatInteraction':require(_0x591e('0x2')),'openchannelInteraction':require(_0x591e('0x3')),'smsInteraction':require(_0x591e('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x591e('0x5')),'whatsappInteraction':require(_0x591e('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x591e('0x7'),'required':!![],'message':_0x591e('0x8')}});exports['consequence']=function(_0x52ab8f,_0x1ffcb1,_0x5a0210,_0x1b469b){return function(_0x43a3fd){try{var _0x59aae2={'tag':_0x1ffcb1[0x0]};var _0x9b905e=tag['validate'](_0x59aae2,{'typecast':!![]});if(_0x9b905e[_0x591e('0x9')]){logger[_0x591e('0xa')]('[%s][TAG]\x20%s',_0x52ab8f,_['map'](_0x9b905e,'message')[_0x591e('0xb')](',\x20'));logger[_0x591e('0xc')](_0x591e('0xd'),_0x52ab8f);_0x43a3fd[_0x591e('0xe')]();}else{var _0x9c7b5b={'ids':[_0x1ffcb1[0x0]]};if(rpc[_0x1b469b['channel']+_0x591e('0xf')]){rpc[_0x1b469b['channel']+_0x591e('0xf')][_0x591e('0x10')](_0x1b469b[_0x591e('0x11')]['id'],_0x9c7b5b)[_0x591e('0x12')](function(_0x5d8333){logger[_0x591e('0xc')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x52ab8f,_0x1ffcb1[0x1],_0x1b469b['channel'],_0x1b469b[_0x591e('0x11')]['id']);})[_0x591e('0x13')](function(_0x4f4120){logger[_0x591e('0xa')]('[%s][TAG]\x20%s',_0x52ab8f,JSON['stringify'](_0x4f4120));logger[_0x591e('0xc')](_0x591e('0xd'),_0x52ab8f);})[_0x591e('0x14')](function(){_0x43a3fd['next']();});}}}catch(_0x5bb4fa){logger['error'](_0x591e('0x15'),_0x52ab8f,_[_0x591e('0x16')](_0x5bb4fa)?JSON['stringify'](_0x5bb4fa):_0x5bb4fa);logger[_0x591e('0xc')](_0x591e('0xd'),_0x52ab8f);_0x43a3fd[_0x591e('0xe')]();}};}; \ 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 9471350..0a1f1ea 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x5b5290,_0x20d9ee){var _0x1c4495=function(_0x7d5fcb){while(--_0x7d5fcb){_0x5b5290['push'](_0x5b5290['shift']());}};_0x1c4495(++_0x20d9ee);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2fca9f,_0x188bf4){var _0x15a4f0=function(_0x259012){while(--_0x259012){_0x2fca9f['push'](_0x2fca9f['shift']());}};_0x15a4f0(++_0x188bf4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 64ed710..b9781a3 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 _0x66e6=['interaction','applications','isArray','length','existsSync','.js','app','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','waiting','mailQueues','paused','openchannelQueues','smsQueues','name','faxQueues','whatsappQueues','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message'];(function(_0x603492,_0x28e8a3){var _0x34fb6f=function(_0x2466a2){while(--_0x2466a2){_0x603492['push'](_0x603492['shift']());}};_0x34fb6f(++_0x28e8a3);}(_0x66e6,0xfe));var _0x666e=function(_0x2d8b6a,_0x4e17ad){_0x2d8b6a=_0x2d8b6a-0x0;var _0x21997e=_0x66e6[_0x2d8b6a];return _0x21997e;};'use strict';var _=require('lodash');var util=require(_0x666e('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x666e('0x1'));var BPromise=require(_0x666e('0x2'));var uuid=require(_0x666e('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x666e('0x4'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x666e('0x5')),'chatQueueReport':require(_0x666e('0x6')),'smsQueueReport':require(_0x666e('0x7')),'faxQueueReport':require(_0x666e('0x8')),'whatsappQueueReport':require(_0x666e('0x9'))};var RuleEngine=require(_0x666e('0xa'));function getId(_0x20097e,_0x448ec2,_0x3dec3b){return util[_0x666e('0xb')](_0x666e('0xc'),_0x20097e,_0x448ec2||0x0,_0x3dec3b||0x0);}function getIntervals(_0x489798,_0x33f529){var _0x4d698b=[];if(!_[_0x666e('0xd')](_0x33f529[_0x666e('0xe')])&&!_[_0x666e('0xd')](_0x489798[_0x33f529['IntervalId']])&&!_['isNil'](_0x489798[_0x33f529[_0x666e('0xe')]][_0x666e('0xf')])){_0x4d698b=_[_0x666e('0x10')](_0x489798[_0x33f529[_0x666e('0xe')]]['Intervals'],_0x666e('0x11'));}else if(!_[_0x666e('0xd')](_0x33f529[_0x666e('0x11')])){_0x4d698b=[_0x33f529[_0x666e('0x11')]];}return _0x4d698b;}exports[_0x666e('0x12')]=function(_0x367807){_0x367807[_0x666e('0x13')]={};return new BPromise(function(_0x197240,_0x40c4f2){var _0x32734e={'Start':function(_0xa6ed0a){var _0x78b8c3=this;return new Promise(function(_0x472914,_0x3f894d){if(_0xa6ed0a){try{var _0x5e9668=[];var _0x493003=getId(_0xa6ed0a[_0x666e('0x14')],_0xa6ed0a[_0x666e('0x15')]?_0xa6ed0a[_0x666e('0x15')]['id']:0x0,_0xa6ed0a[_0x666e('0x16')]?_0xa6ed0a[_0x666e('0x16')]['id']:0x0);if(_0xa6ed0a[_0x666e('0x17')]&&_[_0x666e('0x18')](_0xa6ed0a[_0x666e('0x17')])&&_0xa6ed0a[_0x666e('0x17')][_0x666e('0x19')]){for(var _0x54c40d=0x0;_0x54c40d<_0xa6ed0a[_0x666e('0x17')]['length'];_0x54c40d+=0x1){var _0x123d0f=_0xa6ed0a[_0x666e('0x17')][_0x54c40d];if(fs[_0x666e('0x1a')](path['join'](__dirname,_0x666e('0x17'),_0x123d0f['app']+_0x666e('0x1b')))){var _0x2c4377=[];switch(_0x123d0f[_0x666e('0x1c')][_0x666e('0x1d')]()){case'autoreply':var _0x4eb1fd=_0x123d0f[_0x666e('0x1e')][_0x666e('0x1f')](',');if(_0xa6ed0a['channel']===_0x666e('0x20')){_0x2c4377[_0x666e('0x21')](_0x4eb1fd[0x0]);_0x2c4377[_0x666e('0x21')](_0x4eb1fd[0x1]);_0x2c4377[_0x666e('0x21')](_0x4eb1fd[_0x666e('0x22')](0x2,_0x4eb1fd[_0x666e('0x19')])['join'](','));}else{_0x2c4377[_0x666e('0x21')](_0x4eb1fd[0x0]);_0x2c4377[_0x666e('0x21')](_0x4eb1fd[_0x666e('0x22')](0x1,_0x4eb1fd[_0x666e('0x19')])[_0x666e('0x23')](','));}break;case _0x666e('0x24'):var _0x4b7c54=_0x123d0f['appdata']['split'](',');_0x2c4377['push'](_0x4b7c54[0x0]);_0x2c4377[_0x666e('0x21')](_0x4b7c54[0x1]);_0x2c4377[_0x666e('0x21')](_0x4b7c54[_0x666e('0x22')](0x2,_0x4b7c54['length'])[_0x666e('0x23')](','));break;case _0x666e('0x25'):var _0x3edb7a=_0x123d0f['appdata'][_0x666e('0x1f')](',');_0x2c4377[_0x666e('0x21')](_0x3edb7a[0x0]);_0x2c4377[_0x666e('0x21')](_0x3edb7a[0x1]);_0x2c4377['push'](_0x3edb7a[0x2]);_0x2c4377[_0x666e('0x21')](_0x3edb7a[0x3]);_0x2c4377[_0x666e('0x21')](_0x3edb7a[_0x666e('0x22')](0x4,_0x3edb7a['length'])[_0x666e('0x23')](','));break;case'amazonlex':var _0x42af1f=_0x123d0f['appdata']['split'](',');_0x2c4377[_0x666e('0x21')](_0x42af1f[0x0]);_0x2c4377[_0x666e('0x21')](_0x42af1f[0x1]);_0x2c4377[_0x666e('0x21')](_0x42af1f[0x2]);_0x2c4377[_0x666e('0x21')](_0x42af1f[0x3]);_0x2c4377[_0x666e('0x21')](_0x42af1f['slice'](0x4,_0x42af1f[_0x666e('0x19')])[_0x666e('0x23')](','));break;case _0x666e('0x15'):_0x2c4377['push'](_0x123d0f[_0x666e('0x1e')]);break;case'tag':_0x2c4377[_0x666e('0x21')](_0x123d0f[_0x666e('0x26')]);_0x2c4377[_0x666e('0x21')](_0x123d0f[_0x666e('0x1e')]);break;default:_0x2c4377=_[_0x666e('0xd')](_0x123d0f[_0x666e('0x1e')])?[]:_0x123d0f['appdata']['split'](',');}var _0x3f56c6={'id':util['format'](_0x666e('0x27'),_0x493003,_0x123d0f['id'],_0x123d0f['app']),'condition':require(_0x666e('0x28'))[_0x666e('0x29')](_0x493003,getIntervals(_0x367807[_0x666e('0x2a')],_0x123d0f),_0x367807),'consequence':require(_0x666e('0x2b')+_0x123d0f[_0x666e('0x1c')])[_0x666e('0x2c')](_0x493003,_0x2c4377,_0x367807,_0xa6ed0a),'p':_0x123d0f[_0x666e('0x2d')]||0x0};logger[_0x666e('0x2e')](_0x666e('0x2f'),_0x3f56c6['id'],'on\x20interval',getIntervals(_0x367807[_0x666e('0x2a')],_0x123d0f)[_0x666e('0x23')](_0x666e('0x30')));_0x5e9668[_0x666e('0x21')](_0x3f56c6);}else{logger[_0x666e('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x666e('0x23')](__dirname,_0x666e('0x17'),_0x123d0f[_0x666e('0x1c')]+_0x666e('0x1b')));}}_0x367807['rules'][_0x493003]=new RuleEngine(_0x5e9668);_0x367807[_0x666e('0x13')][_0x493003][_0x666e('0x32')](_0xa6ed0a,function(_0x235373){logger[_0x666e('0x2e')](_0x666e('0x33'),JSON[_0x666e('0x34')](_0x235373['matchPath']));if(_0x367807[_0x666e('0x13')][_0x493003]){_0x367807[_0x666e('0x13')][_0x493003][_0x666e('0x35')](_0x666e('0x36'));}});return _0x472914({'code':0xc8,'message':_0xa6ed0a});}else{logger['info'](_0x666e('0x37'));return _0x472914({'code':0xc8,'message':_0xa6ed0a});}}catch(_0x75746){logger[_0x666e('0x31')](_0x75746[_0x666e('0x38')]);return _0x3f894d(_0x78b8c3[_0x666e('0x31')](0x1f4,_0x75746));}}return _0x3f894d(_0x666e('0x39'));});},'AcceptMessage':function(_0xc70d4a){var _0x4d99c0=this;return new Promise(function(_0x150c13,_0x3656cd){if(_0xc70d4a[_0x666e('0x3a')]&&_0xc70d4a[_0x666e('0x3a')]['id']){if(_0x367807[_0x666e('0x3b')][_0xc70d4a['agent']['id']]){_0x367807[_0x666e('0x3b')][_0xc70d4a['agent']['id']][_0x666e('0x3c')]=![];_0x367807[_0x666e('0x3b')][_0xc70d4a[_0x666e('0x3a')]['id']]['busyQueue']=undefined;}}if(_0xc70d4a[_0x666e('0x15')]&&_0xc70d4a[_0x666e('0x15')]['id']){try{var _0x44dcd0=getId(_0xc70d4a[_0x666e('0x14')],_0xc70d4a[_0x666e('0x15')]?_0xc70d4a[_0x666e('0x15')]['id']:0x0,_0xc70d4a[_0x666e('0x16')]?_0xc70d4a[_0x666e('0x16')]['id']:0x0);if(_0x367807[_0x666e('0x13')][_0x44dcd0]){_0x367807[_0x666e('0x13')][_0x44dcd0][_0x666e('0x35')](_0x666e('0x3d'));if(rpc[_0xc70d4a[_0x666e('0x14')]+_0x666e('0x3e')]){rpc[_0xc70d4a['channel']+_0x666e('0x3e')][_0x666e('0x3f')](_0x44dcd0,{'UserId':_0xc70d4a[_0x666e('0x15')][_0x666e('0x40')]})[_0x666e('0x41')](function(_0x31a542){logger[_0x666e('0x31')](_0x666e('0x42'));});}}return _0x150c13({'code':0xc8,'message':_0xc70d4a});}catch(_0x4e5dd1){logger['error'](_0x4e5dd1['stack']);return _0x3656cd(_0x4d99c0['error'](0x1f4,_0x4e5dd1));}}logger[_0x666e('0x31')]('message\x20is\x20empty');return _0x3656cd(_0x4d99c0[_0x666e('0x31')](0x1f4,_0x666e('0x43')));});},'RejectMessage':function(_0x1ca62a){var _0x485dba=this;return new Promise(function(_0x264f86,_0x37a2a2){if(_0x1ca62a[_0x666e('0x3a')]&&_0x1ca62a[_0x666e('0x3a')]['id']){try{if(_0x367807[_0x666e('0x3b')][_0x1ca62a[_0x666e('0x3a')]['id']]){_0x367807[_0x666e('0x3b')][_0x1ca62a[_0x666e('0x3a')]['id']][_0x666e('0x3c')]=![];_0x367807['agents'][_0x1ca62a['agent']['id']][_0x666e('0x44')]=undefined;}return _0x264f86({'code':0xc8,'message':_0x1ca62a});}catch(_0x4543fb){logger[_0x666e('0x31')](_0x4543fb[_0x666e('0x38')]);return _0x37a2a2(_0x485dba[_0x666e('0x31')](0x1f4,_0x4543fb));}}logger[_0x666e('0x31')](_0x666e('0x43'));return _0x37a2a2(_0x485dba[_0x666e('0x31')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5001f1){var _0x5f310b=this;return new Promise(function(_0x1d9f78,_0x80ea12){if(_0x5001f1[_0x666e('0x14')]&&_0x5001f1[_0x666e('0x16')]&&_0x5001f1[_0x666e('0x16')]['id']){try{var _0x428df1=getId(_0x5001f1[_0x666e('0x14')],_0x5001f1[_0x666e('0x15')]?_0x5001f1[_0x666e('0x15')]['id']:0x0,_0x5001f1[_0x666e('0x16')]?_0x5001f1['interaction']['id']:0x0);if(_0x367807[_0x666e('0x13')][_0x428df1]){_0x367807[_0x666e('0x13')][_0x428df1][_0x666e('0x35')](_0x666e('0x3d'));}return _0x1d9f78({'code':0xc8,'message':_0x5001f1});}catch(_0xda240a){logger[_0x666e('0x31')](_0xda240a[_0x666e('0x38')]);return _0x80ea12(_0x5f310b[_0x666e('0x31')](0x1f4,_0xda240a));}}logger[_0x666e('0x31')](_0x666e('0x43'));return _0x80ea12(_0x5f310b[_0x666e('0x31')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x16b7ad){var _0x147b8a=this;return new Promise(function(_0x255690,_0xed3d31){if(_0x367807['agents'][_0x666e('0x45')](_0x16b7ad['id'])){for(var _0x41a850 in _0x16b7ad[_0x666e('0x46')]){if(_0x16b7ad[_0x666e('0x46')][_0x666e('0x45')](_0x41a850)){if(_0x367807['agents'][_0x16b7ad['id']][_0x666e('0x45')](_0x41a850+_0x666e('0x47'))){_0x367807[_0x666e('0x3b')][_0x16b7ad['id']][_0x41a850+_0x666e('0x47')]=parseInt(_0x16b7ad[_0x666e('0x46')][_0x41a850],0xa);}}}_0x367807[_0x666e('0x3b')][_0x16b7ad['id']][_0x666e('0x48')]();return _0x255690({'code':0xc8,'message':_0x367807[_0x666e('0x3b')][_0x16b7ad['id']]});}else{return _0xed3d31(_0x147b8a[_0x666e('0x31')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2c0f3c){return new Promise(function(_0x2ff958,_0x40d662){var _0x1cb452=_['values'](_0x367807[_0x666e('0x3b')]);_0x2ff958({'count':_0x1cb452[_0x666e('0x19')],'rows':_0x1cb452});});},'ChatQueues':function(_0x270da0){return new Promise(function(_0x14aa70,_0x18eb08){var _0x20c7e6=[];for(var _0x59f3d2 in _0x367807[_0x666e('0x49')]){if(_0x367807['chatQueues']['hasOwnProperty'](_0x59f3d2)){var _0x7b660b=_0x367807[_0x666e('0x49')][_0x59f3d2];var _0x37c320={'id':_0x7b660b['id'],'available':_0x7b660b[_0x666e('0x4a')],'loggedIn':_0x7b660b[_0x666e('0x4b')],'name':_0x7b660b['name'],'paused':_0x7b660b['paused'],'waiting':_0x7b660b[_0x666e('0x4c')]};_0x20c7e6[_0x666e('0x21')](_0x37c320);}}_0x14aa70({'count':_0x20c7e6[_0x666e('0x19')],'rows':_0x20c7e6});});},'MailQueues':function(_0x49c6d6){return new Promise(function(_0x20d570,_0x1b2b2c){var _0x381387=[];for(var _0x1de06b in _0x367807[_0x666e('0x4d')]){if(_0x367807[_0x666e('0x4d')][_0x666e('0x45')](_0x1de06b)){var _0x3b10b1=_0x367807['mailQueues'][_0x1de06b];var _0x1b8fa9={'id':_0x3b10b1['id'],'available':_0x3b10b1[_0x666e('0x4a')],'loggedIn':_0x3b10b1[_0x666e('0x4b')],'name':_0x3b10b1['name'],'paused':_0x3b10b1[_0x666e('0x4e')],'waiting':_0x3b10b1['waiting']};_0x381387['push'](_0x1b8fa9);}}_0x20d570({'count':_0x381387[_0x666e('0x19')],'rows':_0x381387});});},'OpenchannelQueues':function(_0x2bd013){return new Promise(function(_0x1f1261,_0x43fba7){var _0x41a9f8=[];for(var _0x3f5bc7 in _0x367807[_0x666e('0x4f')]){if(_0x367807[_0x666e('0x4f')][_0x666e('0x45')](_0x3f5bc7)){var _0x1ee5ab=_0x367807[_0x666e('0x4f')][_0x3f5bc7];var _0x2f99ef={'id':_0x1ee5ab['id'],'available':_0x1ee5ab['available'],'loggedIn':_0x1ee5ab[_0x666e('0x4b')],'name':_0x1ee5ab['name'],'paused':_0x1ee5ab[_0x666e('0x4e')],'waiting':_0x1ee5ab[_0x666e('0x4c')]};_0x41a9f8[_0x666e('0x21')](_0x2f99ef);}}_0x1f1261({'count':_0x41a9f8[_0x666e('0x19')],'rows':_0x41a9f8});});},'SmsQueues':function(_0x3f35cd){return new Promise(function(_0x3108a8,_0x1e47ff){var _0x163757=[];for(var _0x4be92b in _0x367807[_0x666e('0x50')]){if(_0x367807['smsQueues'][_0x666e('0x45')](_0x4be92b)){var _0x5bd771=_0x367807['smsQueues'][_0x4be92b];var _0x4aeb54={'id':_0x5bd771['id'],'available':_0x5bd771[_0x666e('0x4a')],'loggedIn':_0x5bd771[_0x666e('0x4b')],'name':_0x5bd771[_0x666e('0x51')],'paused':_0x5bd771[_0x666e('0x4e')],'waiting':_0x5bd771[_0x666e('0x4c')]};_0x163757[_0x666e('0x21')](_0x4aeb54);}}_0x3108a8({'count':_0x163757['length'],'rows':_0x163757});});},'FaxQueues':function(_0xd87a65){return new Promise(function(_0x4b1f0d,_0x28a4db){var _0x4a5bfa=[];for(var _0x26b237 in _0x367807[_0x666e('0x52')]){if(_0x367807[_0x666e('0x52')]['hasOwnProperty'](_0x26b237)){var _0x553dea=_0x367807['faxQueues'][_0x26b237];var _0x383399={'id':_0x553dea['id'],'available':_0x553dea[_0x666e('0x4a')],'loggedIn':_0x553dea[_0x666e('0x4b')],'name':_0x553dea['name'],'paused':_0x553dea[_0x666e('0x4e')],'waiting':_0x553dea[_0x666e('0x4c')]};_0x4a5bfa[_0x666e('0x21')](_0x383399);}}_0x4b1f0d({'count':_0x4a5bfa['length'],'rows':_0x4a5bfa});});},'WhatsappQueues':function(_0x7692a2){return new Promise(function(_0x469e81,_0x313128){var _0x520699=[];for(var _0x34bd05 in _0x367807[_0x666e('0x53')]){if(_0x367807[_0x666e('0x53')][_0x666e('0x45')](_0x34bd05)){var _0x582110=_0x367807[_0x666e('0x53')][_0x34bd05];var _0xfd367e={'id':_0x582110['id'],'available':_0x582110[_0x666e('0x4a')],'loggedIn':_0x582110[_0x666e('0x4b')],'name':_0x582110[_0x666e('0x51')],'paused':_0x582110['paused'],'waiting':_0x582110['waiting']};_0x520699[_0x666e('0x21')](_0xfd367e);}}_0x469e81({'count':_0x520699[_0x666e('0x19')],'rows':_0x520699});});},'ChatQueuesWaitingInteractions':function(_0x27d838){return new Promise(function(_0x2e70fa,_0x29427b){var _0x4e1be7=_[_0x666e('0x54')](_0x367807['chatQueuesWaitingInteractions']);_0x2e70fa({'count':_0x4e1be7['length'],'rows':_0x4e1be7});});},'MailQueuesWaitingInteractions':function(_0x42b971){return new Promise(function(_0x777579,_0x1beb30){var _0x5709fe=_[_0x666e('0x54')](_0x367807['mailQueuesWaitingInteractions']);_0x777579({'count':_0x5709fe[_0x666e('0x19')],'rows':_0x5709fe});});},'OpenchannelQueuesWaitingInteractions':function(_0x33092e){return new Promise(function(_0x1d75a2,_0x5ae93b){var _0x1e3d29=_[_0x666e('0x54')](_0x367807[_0x666e('0x55')]);_0x1d75a2({'count':_0x1e3d29[_0x666e('0x19')],'rows':_0x1e3d29});});},'SmsQueuesWaitingInteractions':function(_0x1b7d13){return new Promise(function(_0x545897,_0x39ff47){var _0x3c0feb=_['values'](_0x367807[_0x666e('0x56')]);_0x545897({'count':_0x3c0feb[_0x666e('0x19')],'rows':_0x3c0feb});});},'FaxQueuesWaitingInteractions':function(_0x5a4882){return new Promise(function(_0x46be6b,_0x9382d0){var _0x44d6b2=_[_0x666e('0x54')](_0x367807['faxQueuesWaitingInteractions']);_0x46be6b({'count':_0x44d6b2[_0x666e('0x19')],'rows':_0x44d6b2});});},'WhatsappQueuesWaitingInteractions':function(_0x9b3ad9){return new Promise(function(_0x3a4fb8,_0x488c74){var _0x3f621e=_[_0x666e('0x54')](_0x367807['whatsappQueuesWaitingInteractions']);_0x3a4fb8({'count':_0x3f621e[_0x666e('0x19')],'rows':_0x3f621e});});}};var _0x252a6e=jayson[_0x666e('0x57')](_0x32734e)[_0x666e('0x58')]();_0x252a6e['on'](_0x666e('0x31'),function(_0x8c46ed){logger['error'](JSON['stringify'](_0x8c46ed));return _0x40c4f2(_0x8c46ed);});_0x252a6e['listen'](0x232c,_0x666e('0x59'),function(){console[_0x666e('0x5a')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x197240(_0x666e('0x5b')+0x232c);});});}; \ No newline at end of file +var _0xaaad=['mail','push','slice','dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','complete','routing\x20is\x20empty','agent','agents','busy','emit','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','autoreply','split'];(function(_0x4edc53,_0x861490){var _0x4b380a=function(_0x29a0e1){while(--_0x29a0e1){_0x4edc53['push'](_0x4edc53['shift']());}};_0x4b380a(++_0x861490);}(_0xaaad,0x1c0));var _0xdaaa=function(_0x21af8b,_0x5e0d0d){_0x21af8b=_0x21af8b-0x0;var _0x3da6d1=_0xaaad[_0x21af8b];return _0x3da6d1;};'use strict';var _=require(_0xdaaa('0x0'));var util=require(_0xdaaa('0x1'));var path=require(_0xdaaa('0x2'));var fs=require('fs');var jayson=require(_0xdaaa('0x3'));var BPromise=require(_0xdaaa('0x4'));var uuid=require('uuid');var config=require(_0xdaaa('0x5'));var logger=require(_0xdaaa('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0xdaaa('0x7')),'mailQueueReport':require(_0xdaaa('0x8')),'chatQueueReport':require(_0xdaaa('0x9')),'smsQueueReport':require(_0xdaaa('0xa')),'faxQueueReport':require(_0xdaaa('0xb')),'whatsappQueueReport':require(_0xdaaa('0xc'))};var RuleEngine=require(_0xdaaa('0xd'));function getId(_0x4a5f90,_0x5096a3,_0x1522e1){return util[_0xdaaa('0xe')](_0xdaaa('0xf'),_0x4a5f90,_0x5096a3||0x0,_0x1522e1||0x0);}function getIntervals(_0x528ba6,_0x4de000){var _0x10ecd7=[];if(!_[_0xdaaa('0x10')](_0x4de000[_0xdaaa('0x11')])&&!_[_0xdaaa('0x10')](_0x528ba6[_0x4de000['IntervalId']])&&!_['isNil'](_0x528ba6[_0x4de000[_0xdaaa('0x11')]]['Intervals'])){_0x10ecd7=_['map'](_0x528ba6[_0x4de000[_0xdaaa('0x11')]]['Intervals'],_0xdaaa('0x12'));}else if(!_[_0xdaaa('0x10')](_0x4de000[_0xdaaa('0x12')])){_0x10ecd7=[_0x4de000[_0xdaaa('0x12')]];}return _0x10ecd7;}exports[_0xdaaa('0x13')]=function(_0xa07200){_0xa07200[_0xdaaa('0x14')]={};return new BPromise(function(_0x23bf85,_0xf01a75){var _0x2b5635={'Start':function(_0x1adf90){var _0x5e46bb=this;return new Promise(function(_0x4a2535,_0x5ef0c1){if(_0x1adf90){try{var _0x425b76=[];var _0x3cc9b4=getId(_0x1adf90[_0xdaaa('0x15')],_0x1adf90[_0xdaaa('0x16')]?_0x1adf90[_0xdaaa('0x16')]['id']:0x0,_0x1adf90[_0xdaaa('0x17')]?_0x1adf90[_0xdaaa('0x17')]['id']:0x0);if(_0x1adf90[_0xdaaa('0x18')]&&_[_0xdaaa('0x19')](_0x1adf90[_0xdaaa('0x18')])&&_0x1adf90[_0xdaaa('0x18')][_0xdaaa('0x1a')]){for(var _0x50be1a=0x0;_0x50be1a<_0x1adf90[_0xdaaa('0x18')]['length'];_0x50be1a+=0x1){var _0xdfb254=_0x1adf90['applications'][_0x50be1a];if(fs[_0xdaaa('0x1b')](path[_0xdaaa('0x1c')](__dirname,'applications',_0xdfb254[_0xdaaa('0x1d')]+'.js'))){var _0x599f3b=[];switch(_0xdfb254['app']['toLowerCase']()){case _0xdaaa('0x1e'):var _0x58a0bd=_0xdfb254['appdata'][_0xdaaa('0x1f')](',');if(_0x1adf90[_0xdaaa('0x15')]===_0xdaaa('0x20')){_0x599f3b[_0xdaaa('0x21')](_0x58a0bd[0x0]);_0x599f3b[_0xdaaa('0x21')](_0x58a0bd[0x1]);_0x599f3b['push'](_0x58a0bd[_0xdaaa('0x22')](0x2,_0x58a0bd[_0xdaaa('0x1a')])['join'](','));}else{_0x599f3b['push'](_0x58a0bd[0x0]);_0x599f3b[_0xdaaa('0x21')](_0x58a0bd[_0xdaaa('0x22')](0x1,_0x58a0bd['length'])[_0xdaaa('0x1c')](','));}break;case _0xdaaa('0x23'):var _0x76a7a4=_0xdfb254[_0xdaaa('0x24')][_0xdaaa('0x1f')](',');_0x599f3b[_0xdaaa('0x21')](_0x76a7a4[0x0]);_0x599f3b[_0xdaaa('0x21')](_0x76a7a4[0x1]);_0x599f3b['push'](_0x76a7a4['slice'](0x2,_0x76a7a4[_0xdaaa('0x1a')])[_0xdaaa('0x1c')](','));break;case _0xdaaa('0x25'):var _0x4171cf=_0xdfb254[_0xdaaa('0x24')][_0xdaaa('0x1f')](',');_0x599f3b[_0xdaaa('0x21')](_0x4171cf[0x0]);_0x599f3b[_0xdaaa('0x21')](_0x4171cf[0x1]);_0x599f3b['push'](_0x4171cf[0x2]);_0x599f3b[_0xdaaa('0x21')](_0x4171cf[0x3]);_0x599f3b[_0xdaaa('0x21')](_0x4171cf['slice'](0x4,_0x4171cf[_0xdaaa('0x1a')])[_0xdaaa('0x1c')](','));break;case _0xdaaa('0x26'):var _0x3f5f52=_0xdfb254['appdata']['split'](',');_0x599f3b[_0xdaaa('0x21')](_0x3f5f52[0x0]);_0x599f3b[_0xdaaa('0x21')](_0x3f5f52[0x1]);_0x599f3b[_0xdaaa('0x21')](_0x3f5f52[0x2]);_0x599f3b['push'](_0x3f5f52[0x3]);_0x599f3b['push'](_0x3f5f52[_0xdaaa('0x22')](0x4,_0x3f5f52[_0xdaaa('0x1a')])['join'](','));break;case'message':_0x599f3b[_0xdaaa('0x21')](_0xdfb254[_0xdaaa('0x24')]);break;case _0xdaaa('0x27'):_0x599f3b['push'](_0xdfb254[_0xdaaa('0x28')]);_0x599f3b[_0xdaaa('0x21')](_0xdfb254[_0xdaaa('0x24')]);break;default:_0x599f3b=_['isNil'](_0xdfb254[_0xdaaa('0x24')])?[]:_0xdfb254[_0xdaaa('0x24')][_0xdaaa('0x1f')](',');}var _0x22bd2f={'id':util['format'](_0xdaaa('0x29'),_0x3cc9b4,_0xdfb254['id'],_0xdfb254[_0xdaaa('0x1d')]),'condition':require('./interval')['condition'](_0x3cc9b4,getIntervals(_0xa07200[_0xdaaa('0x2a')],_0xdfb254),_0xa07200),'consequence':require(_0xdaaa('0x2b')+_0xdfb254[_0xdaaa('0x1d')])[_0xdaaa('0x2c')](_0x3cc9b4,_0x599f3b,_0xa07200,_0x1adf90),'p':_0xdfb254[_0xdaaa('0x2d')]||0x0};logger['info'](_0xdaaa('0x2e'),_0x22bd2f['id'],_0xdaaa('0x2f'),getIntervals(_0xa07200[_0xdaaa('0x2a')],_0xdfb254)[_0xdaaa('0x1c')](_0xdaaa('0x30')));_0x425b76[_0xdaaa('0x21')](_0x22bd2f);}else{logger[_0xdaaa('0x31')](_0xdaaa('0x32'),path[_0xdaaa('0x1c')](__dirname,_0xdaaa('0x18'),_0xdfb254[_0xdaaa('0x1d')]+'.js'));}}_0xa07200[_0xdaaa('0x14')][_0x3cc9b4]=new RuleEngine(_0x425b76);_0xa07200['rules'][_0x3cc9b4][_0xdaaa('0x33')](_0x1adf90,function(_0xd1ae96){logger[_0xdaaa('0x34')]('Applications\x20executed',JSON[_0xdaaa('0x35')](_0xd1ae96['matchPath']));if(_0xa07200['rules'][_0x3cc9b4]){_0xa07200[_0xdaaa('0x14')][_0x3cc9b4]['emit'](_0xdaaa('0x36'));}});return _0x4a2535({'code':0xc8,'message':_0x1adf90});}else{logger[_0xdaaa('0x34')]('No\x20applications\x20to\x20execute');return _0x4a2535({'code':0xc8,'message':_0x1adf90});}}catch(_0x46bbdc){logger[_0xdaaa('0x31')](_0x46bbdc['stack']);return _0x5ef0c1(_0x5e46bb['error'](0x1f4,_0x46bbdc));}}return _0x5ef0c1(_0xdaaa('0x37'));});},'AcceptMessage':function(_0x12f5f7){var _0x9ca42e=this;return new Promise(function(_0x3a2f58,_0x40df42){if(_0x12f5f7[_0xdaaa('0x38')]&&_0x12f5f7[_0xdaaa('0x38')]['id']){if(_0xa07200[_0xdaaa('0x39')][_0x12f5f7[_0xdaaa('0x38')]['id']]){_0xa07200[_0xdaaa('0x39')][_0x12f5f7[_0xdaaa('0x38')]['id']][_0xdaaa('0x3a')]=![];_0xa07200[_0xdaaa('0x39')][_0x12f5f7[_0xdaaa('0x38')]['id']]['busyQueue']=undefined;}}if(_0x12f5f7[_0xdaaa('0x16')]&&_0x12f5f7[_0xdaaa('0x16')]['id']){try{var _0x435589=getId(_0x12f5f7[_0xdaaa('0x15')],_0x12f5f7['message']?_0x12f5f7['message']['id']:0x0,_0x12f5f7[_0xdaaa('0x17')]?_0x12f5f7[_0xdaaa('0x17')]['id']:0x0);if(_0xa07200[_0xdaaa('0x14')][_0x435589]){_0xa07200[_0xdaaa('0x14')][_0x435589][_0xdaaa('0x3b')]('end');if(rpc[_0x12f5f7[_0xdaaa('0x15')]+_0xdaaa('0x3c')]){rpc[_0x12f5f7[_0xdaaa('0x15')]+_0xdaaa('0x3c')][_0xdaaa('0x3d')](_0x435589,{'UserId':_0x12f5f7[_0xdaaa('0x16')][_0xdaaa('0x3e')]})[_0xdaaa('0x3f')](function(_0x3106a2){logger[_0xdaaa('0x31')](_0xdaaa('0x40'));});}}return _0x3a2f58({'code':0xc8,'message':_0x12f5f7});}catch(_0x1cd054){logger[_0xdaaa('0x31')](_0x1cd054[_0xdaaa('0x41')]);return _0x40df42(_0x9ca42e[_0xdaaa('0x31')](0x1f4,_0x1cd054));}}logger['error'](_0xdaaa('0x42'));return _0x40df42(_0x9ca42e[_0xdaaa('0x31')](0x1f4,_0xdaaa('0x42')));});},'RejectMessage':function(_0x90ae2e){var _0x559265=this;return new Promise(function(_0x49a6b5,_0x2997e0){if(_0x90ae2e[_0xdaaa('0x38')]&&_0x90ae2e[_0xdaaa('0x38')]['id']){try{if(_0xa07200[_0xdaaa('0x39')][_0x90ae2e[_0xdaaa('0x38')]['id']]){_0xa07200['agents'][_0x90ae2e[_0xdaaa('0x38')]['id']][_0xdaaa('0x3a')]=![];_0xa07200[_0xdaaa('0x39')][_0x90ae2e[_0xdaaa('0x38')]['id']][_0xdaaa('0x43')]=undefined;}return _0x49a6b5({'code':0xc8,'message':_0x90ae2e});}catch(_0x224a27){logger[_0xdaaa('0x31')](_0x224a27[_0xdaaa('0x41')]);return _0x2997e0(_0x559265[_0xdaaa('0x31')](0x1f4,_0x224a27));}}logger[_0xdaaa('0x31')](_0xdaaa('0x42'));return _0x2997e0(_0x559265['error'](0x1f4,_0xdaaa('0x42')));});},'AbandonInteraction':function(_0x245e6d){var _0x53a90c=this;return new Promise(function(_0x572bcd,_0x4c69ca){if(_0x245e6d[_0xdaaa('0x15')]&&_0x245e6d[_0xdaaa('0x17')]&&_0x245e6d[_0xdaaa('0x17')]['id']){try{var _0x3a51f0=getId(_0x245e6d[_0xdaaa('0x15')],_0x245e6d[_0xdaaa('0x16')]?_0x245e6d[_0xdaaa('0x16')]['id']:0x0,_0x245e6d[_0xdaaa('0x17')]?_0x245e6d[_0xdaaa('0x17')]['id']:0x0);if(_0xa07200['rules'][_0x3a51f0]){_0xa07200['rules'][_0x3a51f0][_0xdaaa('0x3b')](_0xdaaa('0x44'));}return _0x572bcd({'code':0xc8,'message':_0x245e6d});}catch(_0xaa6994){logger[_0xdaaa('0x31')](_0xaa6994[_0xdaaa('0x41')]);return _0x4c69ca(_0x53a90c[_0xdaaa('0x31')](0x1f4,_0xaa6994));}}logger[_0xdaaa('0x31')](_0xdaaa('0x42'));return _0x4c69ca(_0x53a90c[_0xdaaa('0x31')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3e361b){var _0x23b102=this;return new Promise(function(_0x4fc943,_0x1a50c7){if(_0xa07200[_0xdaaa('0x39')][_0xdaaa('0x45')](_0x3e361b['id'])){for(var _0x10c1d5 in _0x3e361b[_0xdaaa('0x46')]){if(_0x3e361b[_0xdaaa('0x46')][_0xdaaa('0x45')](_0x10c1d5)){if(_0xa07200['agents'][_0x3e361b['id']]['hasOwnProperty'](_0x10c1d5+_0xdaaa('0x47'))){_0xa07200['agents'][_0x3e361b['id']][_0x10c1d5+'CurrentCapacity']=parseInt(_0x3e361b['capacity'][_0x10c1d5],0xa);}}}_0xa07200[_0xdaaa('0x39')][_0x3e361b['id']][_0xdaaa('0x48')]();return _0x4fc943({'code':0xc8,'message':_0xa07200[_0xdaaa('0x39')][_0x3e361b['id']]});}else{return _0x1a50c7(_0x23b102[_0xdaaa('0x31')](0x1f4,_0xdaaa('0x49')));}});},'Agents':function(_0x2fde21){return new Promise(function(_0x545647,_0x168339){var _0x44ba2d=_[_0xdaaa('0x4a')](_0xa07200[_0xdaaa('0x39')]);_0x545647({'count':_0x44ba2d[_0xdaaa('0x1a')],'rows':_0x44ba2d});});},'ChatQueues':function(_0x5c3e1b){return new Promise(function(_0x4277c6,_0x267c5d){var _0x1cad4d=[];for(var _0x36d4f4 in _0xa07200['chatQueues']){if(_0xa07200[_0xdaaa('0x4b')][_0xdaaa('0x45')](_0x36d4f4)){var _0x284d20=_0xa07200[_0xdaaa('0x4b')][_0x36d4f4];var _0x4aedec={'id':_0x284d20['id'],'available':_0x284d20[_0xdaaa('0x4c')],'loggedIn':_0x284d20[_0xdaaa('0x4d')],'name':_0x284d20[_0xdaaa('0x4e')],'paused':_0x284d20[_0xdaaa('0x4f')],'waiting':_0x284d20['waiting']};_0x1cad4d[_0xdaaa('0x21')](_0x4aedec);}}_0x4277c6({'count':_0x1cad4d[_0xdaaa('0x1a')],'rows':_0x1cad4d});});},'MailQueues':function(_0x58e52d){return new Promise(function(_0x3bc101,_0x184d67){var _0x43118e=[];for(var _0x5ab4c4 in _0xa07200[_0xdaaa('0x50')]){if(_0xa07200[_0xdaaa('0x50')]['hasOwnProperty'](_0x5ab4c4)){var _0x32daee=_0xa07200[_0xdaaa('0x50')][_0x5ab4c4];var _0x1ee361={'id':_0x32daee['id'],'available':_0x32daee[_0xdaaa('0x4c')],'loggedIn':_0x32daee[_0xdaaa('0x4d')],'name':_0x32daee[_0xdaaa('0x4e')],'paused':_0x32daee[_0xdaaa('0x4f')],'waiting':_0x32daee[_0xdaaa('0x51')]};_0x43118e[_0xdaaa('0x21')](_0x1ee361);}}_0x3bc101({'count':_0x43118e['length'],'rows':_0x43118e});});},'OpenchannelQueues':function(_0x1f07d6){return new Promise(function(_0x1f2d35,_0x5bd02b){var _0x315e96=[];for(var _0x5e7fe8 in _0xa07200[_0xdaaa('0x52')]){if(_0xa07200[_0xdaaa('0x52')][_0xdaaa('0x45')](_0x5e7fe8)){var _0x487bab=_0xa07200[_0xdaaa('0x52')][_0x5e7fe8];var _0x22b140={'id':_0x487bab['id'],'available':_0x487bab['available'],'loggedIn':_0x487bab[_0xdaaa('0x4d')],'name':_0x487bab[_0xdaaa('0x4e')],'paused':_0x487bab[_0xdaaa('0x4f')],'waiting':_0x487bab[_0xdaaa('0x51')]};_0x315e96['push'](_0x22b140);}}_0x1f2d35({'count':_0x315e96[_0xdaaa('0x1a')],'rows':_0x315e96});});},'SmsQueues':function(_0x1ecb2f){return new Promise(function(_0x300ee6,_0x13ab5f){var _0x51d6b3=[];for(var _0x5a4962 in _0xa07200[_0xdaaa('0x53')]){if(_0xa07200[_0xdaaa('0x53')][_0xdaaa('0x45')](_0x5a4962)){var _0x51c0e3=_0xa07200[_0xdaaa('0x53')][_0x5a4962];var _0x3d1947={'id':_0x51c0e3['id'],'available':_0x51c0e3['available'],'loggedIn':_0x51c0e3['loggedIn'],'name':_0x51c0e3[_0xdaaa('0x4e')],'paused':_0x51c0e3[_0xdaaa('0x4f')],'waiting':_0x51c0e3['waiting']};_0x51d6b3[_0xdaaa('0x21')](_0x3d1947);}}_0x300ee6({'count':_0x51d6b3[_0xdaaa('0x1a')],'rows':_0x51d6b3});});},'FaxQueues':function(_0x42b3bc){return new Promise(function(_0xdec24b,_0x273086){var _0x3d9397=[];for(var _0x4b3367 in _0xa07200['faxQueues']){if(_0xa07200[_0xdaaa('0x54')][_0xdaaa('0x45')](_0x4b3367)){var _0x1fb154=_0xa07200['faxQueues'][_0x4b3367];var _0xb61f2d={'id':_0x1fb154['id'],'available':_0x1fb154[_0xdaaa('0x4c')],'loggedIn':_0x1fb154[_0xdaaa('0x4d')],'name':_0x1fb154[_0xdaaa('0x4e')],'paused':_0x1fb154[_0xdaaa('0x4f')],'waiting':_0x1fb154[_0xdaaa('0x51')]};_0x3d9397['push'](_0xb61f2d);}}_0xdec24b({'count':_0x3d9397[_0xdaaa('0x1a')],'rows':_0x3d9397});});},'WhatsappQueues':function(_0x308c09){return new Promise(function(_0x9f78b1,_0x3f9b12){var _0x29b00f=[];for(var _0x1c4604 in _0xa07200[_0xdaaa('0x55')]){if(_0xa07200[_0xdaaa('0x55')][_0xdaaa('0x45')](_0x1c4604)){var _0x46153d=_0xa07200[_0xdaaa('0x55')][_0x1c4604];var _0x2a24a2={'id':_0x46153d['id'],'available':_0x46153d['available'],'loggedIn':_0x46153d[_0xdaaa('0x4d')],'name':_0x46153d[_0xdaaa('0x4e')],'paused':_0x46153d['paused'],'waiting':_0x46153d[_0xdaaa('0x51')]};_0x29b00f[_0xdaaa('0x21')](_0x2a24a2);}}_0x9f78b1({'count':_0x29b00f[_0xdaaa('0x1a')],'rows':_0x29b00f});});},'ChatQueuesWaitingInteractions':function(_0x222268){return new Promise(function(_0x21af29,_0x4a9a88){var _0x58cca2=_[_0xdaaa('0x4a')](_0xa07200['chatQueuesWaitingInteractions']);_0x21af29({'count':_0x58cca2[_0xdaaa('0x1a')],'rows':_0x58cca2});});},'MailQueuesWaitingInteractions':function(_0x4e6a35){return new Promise(function(_0x1b6822,_0x2c8f4b){var _0x28b24d=_[_0xdaaa('0x4a')](_0xa07200[_0xdaaa('0x56')]);_0x1b6822({'count':_0x28b24d[_0xdaaa('0x1a')],'rows':_0x28b24d});});},'OpenchannelQueuesWaitingInteractions':function(_0x362261){return new Promise(function(_0x2ec307,_0x25712a){var _0x576e7d=_[_0xdaaa('0x4a')](_0xa07200[_0xdaaa('0x57')]);_0x2ec307({'count':_0x576e7d['length'],'rows':_0x576e7d});});},'SmsQueuesWaitingInteractions':function(_0x46a3a5){return new Promise(function(_0x894143,_0x4ad912){var _0x56ecd1=_[_0xdaaa('0x4a')](_0xa07200[_0xdaaa('0x58')]);_0x894143({'count':_0x56ecd1[_0xdaaa('0x1a')],'rows':_0x56ecd1});});},'FaxQueuesWaitingInteractions':function(_0x2c224b){return new Promise(function(_0x3fc02c,_0x49607b){var _0x3c9921=_[_0xdaaa('0x4a')](_0xa07200['faxQueuesWaitingInteractions']);_0x3fc02c({'count':_0x3c9921[_0xdaaa('0x1a')],'rows':_0x3c9921});});},'WhatsappQueuesWaitingInteractions':function(_0x1118e4){return new Promise(function(_0x18b3e5,_0x1df9ef){var _0x12e3f0=_[_0xdaaa('0x4a')](_0xa07200[_0xdaaa('0x59')]);_0x18b3e5({'count':_0x12e3f0[_0xdaaa('0x1a')],'rows':_0x12e3f0});});}};var _0x2a6989=jayson[_0xdaaa('0x5a')](_0x2b5635)[_0xdaaa('0x5b')]();_0x2a6989['on']('error',function(_0x5d36a7){logger[_0xdaaa('0x31')](JSON['stringify'](_0x5d36a7));return _0xf01a75(_0x5d36a7);});_0x2a6989[_0xdaaa('0x13')](0x232c,_0xdaaa('0x5c'),function(){console[_0xdaaa('0x5d')](_0xdaaa('0x5e'),0x232c);return _0x23bf85(_0xdaaa('0x5f')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index efca253..925edd2 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 _0x1665=['[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','error','catch','rules','info','stop','length','push','Command','format','iftime\x20%s','then','message','indexOf','true','all'];(function(_0x1e31f5,_0x330913){var _0x237f14=function(_0x367d70){while(--_0x367d70){_0x1e31f5['push'](_0x1e31f5['shift']());}};_0x237f14(++_0x330913);}(_0x1665,0x17f));var _0x5166=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x1665[_0x138f59];return _0x3d114d;};'use strict';var util=require(_0x5166('0x0'));var BPromise=require(_0x5166('0x1'));var jayson=require(_0x5166('0x2'));var _=require(_0x5166('0x3'));var logger=require(_0x5166('0x4'))('routing');var client=jayson[_0x5166('0x5')][_0x5166('0x6')]({'port':0x232a});function request(_0x1b6fef,_0x33ea41){return new BPromise(function(_0x2989a6,_0x4aa9f1){return client[_0x5166('0x7')](_0x1b6fef,_0x33ea41)['then'](function(_0x58f436){if(_0x58f436[_0x5166('0x8')]){return _0x4aa9f1(_0x58f436[_0x5166('0x8')]['message']);}else{return _0x2989a6(_0x58f436['result']);}})[_0x5166('0x9')](function(_0x1ed237){return _0x4aa9f1(_0x1ed237);});});}exports['condition']=function(_0x473621,_0x56a5e4,_0x22fe94){return function(_0x13364b){if(_0x22fe94[_0x5166('0xa')]&&!_0x22fe94[_0x5166('0xa')][_0x473621]){logger[_0x5166('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x473621);return _0x13364b[_0x5166('0xc')]();}var _0xa84b55=[];for(var _0x5b1922=0x0;_0x5b1922<_0x56a5e4[_0x5166('0xd')];_0x5b1922+=0x1){_0xa84b55[_0x5166('0xe')](request(_0x5166('0xf'),{'command':util[_0x5166('0x10')](_0x5166('0x11'),_0x56a5e4[_0x5b1922])})[_0x5166('0x12')](function(_0x472706){return _0x472706&&_0x472706[_0x5166('0x13')]&&_0x472706[_0x5166('0x13')][_0x5166('0x14')](_0x5166('0x15'))>=0x0?!![]:![];})['catch'](function(_0x21c027){logger['error']('[%s][INTERVAL]\x20%s',_0x473621,_0x56a5e4[_0x5b1922]);}));}BPromise[_0x5166('0x16')](_0xa84b55)[_0x5166('0x12')](function(_0x47b87b){var _0x3bd181=_['some'](_0x47b87b);logger[_0x5166('0xb')](_0x5166('0x17'),_0x473621,_0x56a5e4[_0x5166('0x18')]('\x20|\x20'),_0x3bd181);_0x13364b[_0x5166('0x19')](_0x3bd181);})[_0x5166('0x9')](function(_0x51adc8){console[_0x5166('0x1a')](_0x51adc8);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x473621,_0x56a5e4[_0x5166('0x18')](_0x5166('0x1b')),_0x51adc8[_0x5166('0x1c')]);_0x13364b[_0x5166('0xc')]();});};}; \ No newline at end of file +var _0x9d5c=['length','push','Command','format','message','true','catch','[%s][INTERVAL]\x20%s','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','routing','http','request','error','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x5e2f7b,_0x226498){var _0x3c386e=function(_0x34c8e1){while(--_0x34c8e1){_0x5e2f7b['push'](_0x5e2f7b['shift']());}};_0x3c386e(++_0x226498);}(_0x9d5c,0xea));var _0xc9d5=function(_0x5def17,_0x42cb3d){_0x5def17=_0x5def17-0x0;var _0x10a95a=_0x9d5c[_0x5def17];return _0x10a95a;};'use strict';var util=require(_0xc9d5('0x0'));var BPromise=require(_0xc9d5('0x1'));var jayson=require(_0xc9d5('0x2'));var _=require(_0xc9d5('0x3'));var logger=require('../../../config/logger')(_0xc9d5('0x4'));var client=jayson['client'][_0xc9d5('0x5')]({'port':0x232a});function request(_0x4e7caa,_0x5b0826){return new BPromise(function(_0x4f24aa,_0x213a70){return client[_0xc9d5('0x6')](_0x4e7caa,_0x5b0826)['then'](function(_0x5b0f9c){if(_0x5b0f9c[_0xc9d5('0x7')]){return _0x213a70(_0x5b0f9c['error']['message']);}else{return _0x4f24aa(_0x5b0f9c[_0xc9d5('0x8')]);}})['catch'](function(_0x1530fb){return _0x213a70(_0x1530fb);});});}exports[_0xc9d5('0x9')]=function(_0x50ae0a,_0x5a35dd,_0x29f117){return function(_0x3ec731){if(_0x29f117[_0xc9d5('0xa')]&&!_0x29f117[_0xc9d5('0xa')][_0x50ae0a]){logger[_0xc9d5('0xb')](_0xc9d5('0xc'),_0x50ae0a);return _0x3ec731[_0xc9d5('0xd')]();}var _0x12316e=[];for(var _0x1e4f15=0x0;_0x1e4f15<_0x5a35dd[_0xc9d5('0xe')];_0x1e4f15+=0x1){_0x12316e[_0xc9d5('0xf')](request(_0xc9d5('0x10'),{'command':util[_0xc9d5('0x11')]('iftime\x20%s',_0x5a35dd[_0x1e4f15])})['then'](function(_0x109eee){return _0x109eee&&_0x109eee[_0xc9d5('0x12')]&&_0x109eee[_0xc9d5('0x12')]['indexOf'](_0xc9d5('0x13'))>=0x0?!![]:![];})[_0xc9d5('0x14')](function(_0x6acffb){logger[_0xc9d5('0x7')](_0xc9d5('0x15'),_0x50ae0a,_0x5a35dd[_0x1e4f15]);}));}BPromise[_0xc9d5('0x16')](_0x12316e)[_0xc9d5('0x17')](function(_0x3d2235){var _0x8b142b=_[_0xc9d5('0x18')](_0x3d2235);logger['info'](_0xc9d5('0x19'),_0x50ae0a,_0x5a35dd[_0xc9d5('0x1a')](_0xc9d5('0x1b')),_0x8b142b);_0x3ec731[_0xc9d5('0x1c')](_0x8b142b);})[_0xc9d5('0x14')](function(_0x2da687){console[_0xc9d5('0x1d')](_0x2da687);logger[_0xc9d5('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0x50ae0a,_0x5a35dd[_0xc9d5('0x1a')](_0xc9d5('0x1b')),_0x2da687[_0xc9d5('0x1e')]);_0x3ec731[_0xc9d5('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index cbcbff0..c4651f4 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 _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x588c96,_0x4987d0){var _0x270347=function(_0x30e25d){while(--_0x30e25d){_0x588c96['push'](_0x588c96['shift']());}};_0x270347(++_0x4987d0);}(_0xbee3,0xd5));var _0x3bee=function(_0x1336bd,_0x641947){_0x1336bd=_0x1336bd-0x0;var _0x652e3f=_0xbee3[_0x1336bd];return _0x652e3f;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file +var _0xf4eb=['request','debug','format','[%s][agents][agentcalled]','destuniqueid','now','lastevent','connectedlinename','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','info','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport'];(function(_0x5474b4,_0x5027aa){var _0x33a0b5=function(_0x41fd6b){while(--_0x41fd6b){_0x5474b4['push'](_0x5474b4['shift']());}};_0x33a0b5(++_0x5027aa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4c47e9,_0x213ec0){_0x4c47e9=_0x4c47e9-0x0;var _0x43feed=_0xf4eb[_0x4c47e9];return _0x43feed;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x479210,_0x5ed5b9){utils[_0xbf4e('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x479210[_0xbf4e('0x2')],_0x479210[_0xbf4e('0x3')],_0x479210[_0xbf4e('0x4')],_0x479210[_0xbf4e('0x5')],_0x479210[_0xbf4e('0x6')],_0x479210[_0xbf4e('0x7')],_0x479210[_0xbf4e('0x8')],_0x479210['lastevent']));if(_0x479210[_0xbf4e('0x4')]){utils['getVoiceQueueByName'](_0x479210['queue'])[_0xbf4e('0x9')](function(_0x3761c1){if(_0x3761c1){_0x479210[_0xbf4e('0xa')]=_0x3761c1[_0xbf4e('0xa')];_0x479210[_0xbf4e('0xb')]=_0x479210[_0xbf4e('0xc')]?_0x3761c1[_0xbf4e('0xd')]:![];_0x479210['acwtime']=_0x479210['agentacw']?_0x3761c1[_0xbf4e('0xe')]:0x0;}utils['request'](_0xbf4e('0xf'),_0x479210);});}else{utils[_0xbf4e('0x10')]('CreateVoiceAgentReport',_0x479210);}if(_0x5ed5b9){delete transfers[_0x479210[_0xbf4e('0x2')]];}else{delete agents[_0x479210['destuniqueid']];}}exports['agentcalled']=function(_0x209b25){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x13'),_0x209b25[_0xbf4e('0x2')]),_0x209b25);agents[_0x209b25[_0xbf4e('0x14')]]=_0x209b25;agents[_0x209b25['destuniqueid']]['agentcalledAt']=utils[_0xbf4e('0x15')]();agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x16')]='called';agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x8')]=null;agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x17')]=null;utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x209b25['uniqueid'],agents[_0x209b25['destuniqueid']]['membername'],_0x209b25[_0xbf4e('0x14')]));}catch(_0x1ca73c){utils[_0xbf4e('0x18')](util['format']('[%s][agents][agentcalled]',_0x209b25[_0xbf4e('0x2')]),_0x1ca73c);}};exports[_0xbf4e('0x19')]=function(_0x3be138){try{if(!_[_0xbf4e('0x1a')](agents[_0x3be138[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x1b'),_0x3be138[_0xbf4e('0x2')]),_0x3be138);utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x3be138[_0xbf4e('0x2')],agents[_0x3be138[_0xbf4e('0x14')]]['membername'],_0x3be138[_0xbf4e('0x14')]));agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x19')]=!![];agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x1c')]=utils['now']();agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x1d');agents[_0x3be138['destuniqueid']][_0xbf4e('0x1e')]='timeout';agents[_0x3be138['destuniqueid']][_0xbf4e('0x1f')]=_0x3be138['ringtime']?parseInt(_0x3be138[_0xbf4e('0x20')])/0x3e8:0x0;agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x21')]=0x0;unanswered[_0xbf4e('0x22')](_0x3be138['destuniqueid']);}}catch(_0x2d4686){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]',_0x3be138[_0xbf4e('0x2')]),_0x2d4686);}};exports['queuecallerabandon']=function(_0x1dfa81){try{_[_0xbf4e('0x23')](agents,function(_0xb8b58e,_0x498dbd){if(_0xb8b58e[_0xbf4e('0x2')]==_0x1dfa81[_0xbf4e('0x2')]&&!_[_0xbf4e('0x24')](unanswered,_0xb8b58e[_0xbf4e('0x14')])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x1dfa81);utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x25'),_0x1dfa81[_0xbf4e('0x2')],_0xb8b58e['membername'],_0xb8b58e[_0xbf4e('0x14')]));_0xb8b58e['agentringnoanswer']=!![];_0xb8b58e[_0xbf4e('0x1c')]=utils['now']();_0xb8b58e[_0xbf4e('0x16')]=_0xbf4e('0x26');_0xb8b58e[_0xbf4e('0x1e')]='abandoned';_0xb8b58e[_0xbf4e('0x1f')]=_0x1dfa81[_0xbf4e('0x1f')];_0xb8b58e[_0xbf4e('0x21')]=0x0;writeDB(_0xb8b58e);}});}catch(_0x29d6aa){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x29d6aa);}};exports[_0xbf4e('0x27')]=function(_0x25b837){try{if(agents[_0x25b837[_0xbf4e('0x14')]]){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentconnect]',_0x25b837['uniqueid']),_0x25b837);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x28'),_0x25b837[_0xbf4e('0x2')],agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x5')],_0x25b837[_0xbf4e('0x14')]));agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();agents[_0x25b837['destuniqueid']]['connectedlinenum']=_0x25b837[_0xbf4e('0x8')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x17')]=_0x25b837['connectedlinename'];agents[_0x25b837[_0xbf4e('0x14')]]['holdtime']=_0x25b837[_0xbf4e('0x20')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x2a');_['forIn'](agents,function(_0x31d8dc,_0x78ab2d){if(_0x31d8dc[_0xbf4e('0x14')]!=_0x25b837[_0xbf4e('0x14')]&&_0x31d8dc['uniqueid']==_0x25b837[_0xbf4e('0x2')]){_0x31d8dc[_0xbf4e('0x21')]=0x0;_0x31d8dc[_0xbf4e('0x1f')]=_0x25b837[_0xbf4e('0x20')];_0x31d8dc[_0xbf4e('0x19')]=!![];_0x31d8dc[_0xbf4e('0x1c')]=utils[_0xbf4e('0x15')]();_0x31d8dc['lastevent']=_0xbf4e('0x2b');_0x31d8dc[_0xbf4e('0x1e')]='answered_elsewhere';_0x31d8dc['answeredelsewheredestinationuniqueid']=_0x25b837[_0xbf4e('0x14')];_0x31d8dc[_0xbf4e('0x2c')]=_0x25b837['membername'];writeDB(_0x31d8dc);}});}}catch(_0x5bfc4d){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x2d'),_0x25b837[_0xbf4e('0x2')]),_0x5bfc4d);}};exports[_0xbf4e('0xc')]=function(_0x3ad0a4){try{if(!_['isNil'](agents[_0x3ad0a4[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentcomplete]',_0x3ad0a4['uniqueid']),_0x3ad0a4);utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3ad0a4[_0xbf4e('0x2')],agents[_0x3ad0a4[_0xbf4e('0x14')]]['membername'],_0x3ad0a4['destuniqueid']));agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0xc')]=!![];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x3ad0a4['destuniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')],agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x29')]);agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x1e')]=_0x3ad0a4['reason'];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x30');writeDB(agents[_0x3ad0a4[_0xbf4e('0x14')]]);}}catch(_0x9bc1fe){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x31'),_0x3ad0a4[_0xbf4e('0x2')]),_0x9bc1fe);}};exports[_0xbf4e('0x32')]=function(_0x2fdba9){try{if(!_[_0xbf4e('0x1a')](agents[_0x2fdba9[_0xbf4e('0x33')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x34'),_0x2fdba9[_0xbf4e('0x2')]),_0x2fdba9);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x35'),_0x2fdba9[_0xbf4e('0x2')],agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x5')],agents[_0x2fdba9['transfereruniqueid']]['uniqueid']));agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x36')]=!![];agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x37')]=_0xbf4e('0x38');agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x39')]=_0x2fdba9[_0xbf4e('0x3a')];agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x3b')]=agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x2')];}}catch(_0xc058e1){utils[_0xbf4e('0x18')](util['format']('[%s][agents][blindtransfer]',_0x2fdba9[_0xbf4e('0x2')]),_0xc058e1);}};exports[_0xbf4e('0x3c')]=function(_0x3d0b4a){try{utils['debug'](util[_0xbf4e('0x12')](_0xbf4e('0x3d'),_0x3d0b4a['origtransfereruniqueid']),_0x3d0b4a);if(_0x3d0b4a['origtransfereruniqueid']==_0x3d0b4a[_0xbf4e('0x3e')]){if(!_['isNil'](agents[_0x3d0b4a['secondtransfereruniqueid']])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x41')]]['membername']));agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a['secondtransfereruniqueid']][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x43')];agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x40')];}if(_0x3d0b4a['transfereeuniqueid']&&agents[_0x3d0b4a['transfereeuniqueid']]){agents[_0x3d0b4a['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x3d0b4a[_0xbf4e('0x44')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a['transfereeuniqueid']]);transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x41')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x47')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfereeuniqueid']]['agentconnectAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfereeuniqueid']][_0xbf4e('0x48')]=0x2;}}else if(_0x3d0b4a[_0xbf4e('0x41')]==_0x3d0b4a[_0xbf4e('0x49')]){if(!_[_0xbf4e('0x1a')](agents[_0x3d0b4a[_0xbf4e('0x40')]])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x5')]));agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x4a')];agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x41')];}if(_0x3d0b4a[_0xbf4e('0x4b')]&&agents[_0x3d0b4a['transfertargetuniqueid']]){agents[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x48')]=0x1;transfers[_0x3d0b4a[_0xbf4e('0x4b')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a[_0xbf4e('0x4b')]]);transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x40')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x4b')]]['agentcalledAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x2c0dbd){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][attendedtransfer]',_0x3d0b4a[_0xbf4e('0x40')]),_0x2c0dbd);}};exports[_0xbf4e('0x4c')]=function(_0x4d7241){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x4d7241);if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]===_0xbf4e('0x1d')){if(_0x4d7241[_0xbf4e('0x4e')]==='21'){agents[_0x4d7241['uniqueid']][_0xbf4e('0x1e')]=_0xbf4e('0x4f');agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]='rejected';}utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x50'),_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x5')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);var _0x47ef56=unanswered[_0xbf4e('0x51')](_0x4d7241[_0xbf4e('0x2')]);if(_0x47ef56>-0x1){unanswered[_0xbf4e('0x52')](_0x47ef56,0x1);}}if(transfers[_0x4d7241[_0xbf4e('0x2')]]){transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcomplete']=!![];transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();transfers[_0x4d7241['uniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=_0xbf4e('0x53');transfers[_0x4d7241['uniqueid']][_0xbf4e('0x16')]='complete';utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x50'),_0x4d7241['uniqueid'],transfers[_0x4d7241[_0xbf4e('0x2')]]['membername'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(transfers[_0x4d7241[_0xbf4e('0x2')]],!![]);}if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]]['agentconnectAt']){agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0xc')]=!![];agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x4d7241[_0xbf4e('0x2')]]['talktime']=utils[_0xbf4e('0x2f')](agents[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x36')]?_0xbf4e('0x36'):_0xbf4e('0x53');agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']=_0xbf4e('0x30');utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]]['membername'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);}}catch(_0x1cc939){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x1cc939);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5dce7b2..e1bf99e 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 _0x640e=['info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','error','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','systemanswertime','destinationchannel','answertime','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','userfield','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','noop','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid'];(function(_0x287a47,_0x2f731c){var _0x3fb726=function(_0xbedc33){while(--_0xbedc33){_0x287a47['push'](_0x287a47['shift']());}};_0x3fb726(++_0x2f731c);}(_0x640e,0x1e1));var _0xe640=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x640e[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var utils=require(_0xe640('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xe640('0x3'),_0xe640('0x4'),_0xe640('0x4'),_0xe640('0x3'),'NO\x20ANSWER',_0xe640('0x3'),'ANSWERED',_0xe640('0x5'),'FAILED',_0xe640('0x4'),_0xe640('0x4')];var channels={};function writeDB(_0x20d5df){var _0x6ca44a;if(transfers[_0xe640('0x6')][_0x20d5df[_0xe640('0x7')]]){_0x6ca44a=_0x20d5df[_0xe640('0x7')];_0x20d5df[_0xe640('0x7')]=transfers['blinds'][_0x20d5df[_0xe640('0x7')]][_0xe640('0x8')];}utils[_0xe640('0x9')](util[_0xe640('0xa')](_0xe640('0xb'),_0x20d5df[_0xe640('0x7')],_0x20d5df[_0xe640('0xc')],_0x20d5df[_0xe640('0xd')],_0x20d5df['membername'],_0x20d5df[_0xe640('0xe')],_0x20d5df[_0xe640('0xf')],_0x20d5df['connectedlinenum'],_0x20d5df[_0xe640('0x10')]));if(_0x20d5df[_0xe640('0x11')]){utils['getUserByInternal'](_0x20d5df[_0xe640('0x11')])[_0xe640('0x12')](function(_0xe0516e){if(_0xe0516e){_0x20d5df[_0xe640('0x13')]=_0xe0516e['id'];}utils[_0xe640('0x14')](_0xe640('0x15'),_0x20d5df);});}else{utils[_0xe640('0x14')](_0xe640('0x15'),_0x20d5df);}if(channels[_0x20d5df[_0xe640('0x7')]]){delete channels[_0x20d5df[_0xe640('0x7')]];}else if(_0x6ca44a&&channels[_0x6ca44a]){delete transfers['blinds'][_0x6ca44a];delete channels[_0x6ca44a];}}exports['newchannel']=function(_0xf91683){try{utils[_0xe640('0x16')](util['format']('[%s][calls][newchannel]',_0xf91683[_0xe640('0x7')]),_0xf91683);if(_0xf91683[_0xe640('0x7')]==_0xf91683[_0xe640('0x17')]&&_0xf91683[_0xe640('0xc')]!=_0xe640('0x18')){utils[_0xe640('0x9')](util[_0xe640('0xa')](_0xe640('0x19'),_0xf91683['uniqueid'],_0xf91683[_0xe640('0x1a')],_0xf91683[_0xe640('0x1b')]));channels[_0xf91683['uniqueid']]={'uniqueid':_0xf91683[_0xe640('0x7')],'accountcode':_0xf91683[_0xe640('0x11')],'source':_0xf91683[_0xe640('0xf')],'destination':_0xf91683[_0xe640('0x1b')],'destinationcontext':_0xf91683[_0xe640('0x1a')],'channel':_0xf91683[_0xe640('0xc')],'starttime':utils[_0xe640('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xe640('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x4b7f74){utils[_0xe640('0x1d')](util[_0xe640('0xa')](_0xe640('0x1e'),_0xf91683[_0xe640('0x7')]),_0x4b7f74);}};exports['newstate']=function(_0x209799){try{utils['debug'](util['format'](_0xe640('0x1f'),_0x209799['uniqueid']),_0x209799);if(!_[_0xe640('0x20')](channels[_0x209799[_0xe640('0x7')]])&&_0x209799[_0xe640('0x21')]==0x6){utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x209799[_0xe640('0x7')],_0x209799[_0xe640('0x1a')],_0x209799[_0xe640('0xc')]));if(_[_0xe640('0x20')](channels[_0x209799[_0xe640('0x7')]]['systemanswertime'])){channels[_0x209799[_0xe640('0x7')]][_0xe640('0x22')]=utils[_0xe640('0x1c')]();}}else if(!_[_0xe640('0x20')](channels[_0x209799[_0xe640('0x17')]])&&_0x209799['channelstate']==0x6&&_0x209799[_0xe640('0x1a')]!='transfer'){utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x209799['uniqueid'],_0x209799[_0xe640('0x17')],_0x209799[_0xe640('0x1a')],_0x209799[_0xe640('0xc')]));channels[_0x209799[_0xe640('0x17')]]['accountcode']=_0x209799[_0xe640('0x11')];channels[_0x209799[_0xe640('0x17')]][_0xe640('0x23')]=_0x209799[_0xe640('0xc')];if(_[_0xe640('0x20')](channels[_0x209799[_0xe640('0x17')]]['answertime'])){channels[_0x209799[_0xe640('0x17')]][_0xe640('0x24')]=utils[_0xe640('0x1c')]();}channels[_0x209799['linkedid']]['disposition']=dispositions[_[_0xe640('0x25')](_0x209799[_0xe640('0x21')])]||_0xe640('0x26');}}catch(_0x508b6e){utils[_0xe640('0x1d')](util[_0xe640('0xa')]('[%s][calls][newstate]',_0x209799[_0xe640('0x7')]),_0x508b6e);}};exports[_0xe640('0x27')]=function(_0x168325){try{if(!_[_0xe640('0x20')](channels[_0x168325[_0xe640('0x7')]])){utils[_0xe640('0x16')](util['format'](_0xe640('0x28'),_0x168325['uniqueid']),_0x168325);if(_[_0xe640('0x20')](channels[_0x168325[_0xe640('0x7')]][_0xe640('0x29')])){channels[_0x168325[_0xe640('0x7')]][_0xe640('0x29')]=_0x168325['calleridname']+'\x20<'+_0x168325[_0xe640('0xf')]+'>';}utils[_0xe640('0x9')](util['format'](_0xe640('0x2a'),_0x168325[_0xe640('0x7')],channels[_0x168325[_0xe640('0x7')]][_0xe640('0x29')],_0x168325[_0xe640('0x2b')]));channels[_0x168325[_0xe640('0x7')]]['endtime']=utils[_0xe640('0x1c')]();channels[_0x168325[_0xe640('0x7')]][_0xe640('0x2c')]=utils['diffTime'](channels[_0x168325[_0xe640('0x7')]][_0xe640('0x2d')],channels[_0x168325[_0xe640('0x7')]][_0xe640('0x2e')]);channels[_0x168325[_0xe640('0x7')]][_0xe640('0x2f')]=channels[_0x168325[_0xe640('0x7')]][_0xe640('0x24')]?utils[_0xe640('0x30')](channels[_0x168325['uniqueid']]['endtime'],channels[_0x168325[_0xe640('0x7')]][_0xe640('0x24')]):0x0;writeDB(channels[_0x168325[_0xe640('0x7')]]);}}catch(_0x6fcf8a){utils[_0xe640('0x1d')](util[_0xe640('0xa')](_0xe640('0x28'),_0x168325[_0xe640('0x7')]),_0x6fcf8a);}};exports[_0xe640('0x31')]=function(_0x1bfe39){try{if(!_['isNil'](channels[_0x1bfe39[_0xe640('0x32')]])){utils[_0xe640('0x16')](util[_0xe640('0xa')](_0xe640('0x33'),_0x1bfe39[_0xe640('0x34')]),_0x1bfe39);if(channels[_0x1bfe39['localtwolinkedid']]['channel']==_0x1bfe39[_0xe640('0x35')]){utils[_0xe640('0x9')](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x1bfe39[_0xe640('0x34')],_0x1bfe39[_0xe640('0x32')],_0x1bfe39['secondtransfererchannel']));channels[_0x1bfe39['localtwolinkedid']][_0xe640('0x23')]=_0x1bfe39[_0xe640('0x36')];channels[_0x1bfe39['localtwolinkedid']][_0xe640('0x37')]=_0xe640('0x38');}else if(channels[_0x1bfe39['localtwolinkedid']]['channel']=_0x1bfe39['transfertargetchannel']){utils['info'](util[_0xe640('0xa')](_0xe640('0x39'),_0x1bfe39[_0xe640('0x34')],_0x1bfe39[_0xe640('0x32')],_0x1bfe39[_0xe640('0x3a')]));channels[_0x1bfe39[_0xe640('0x32')]][_0xe640('0x23')]=_0x1bfe39[_0xe640('0x3a')];channels[_0x1bfe39[_0xe640('0x32')]][_0xe640('0x37')]=_0xe640('0x38');}}}catch(_0x31f906){utils[_0xe640('0x1d')](util[_0xe640('0xa')](_0xe640('0x33'),_0x1bfe39[_0xe640('0x34')]),_0x31f906);}};exports[_0xe640('0x3b')]=function(_0x1d1e80){try{if(!_['isNil'](channels[_0x1d1e80[_0xe640('0x7')]])){utils[_0xe640('0x16')](util['format'](_0xe640('0x3c'),_0x1d1e80[_0xe640('0x7')]),_0x1d1e80);channels[_0x1d1e80[_0xe640('0x7')]]['musiconholdstartAt']=utils[_0xe640('0x1c')]();utils[_0xe640('0x9')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1d1e80['uniqueid'],channels[_0x1d1e80[_0xe640('0x7')]][_0xe640('0x3d')]));}}catch(_0x51d070){utils['error'](util[_0xe640('0xa')]('[%s][calls][musiconholdstart]',_0x1d1e80[_0xe640('0x7')]),_0x51d070);}};exports[_0xe640('0x3e')]=function(_0x5acfd3){try{if(!_[_0xe640('0x20')](channels[_0x5acfd3[_0xe640('0x7')]])){utils[_0xe640('0x16')](util[_0xe640('0xa')](_0xe640('0x3f'),_0x5acfd3[_0xe640('0x7')]),_0x5acfd3);if(!_[_0xe640('0x20')](channels[_0x5acfd3[_0xe640('0x7')]][_0xe640('0x3d')])){channels[_0x5acfd3[_0xe640('0x7')]][_0xe640('0x40')]+=utils[_0xe640('0x30')](utils[_0xe640('0x1c')](),channels[_0x5acfd3[_0xe640('0x7')]][_0xe640('0x3d')]);utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5acfd3['uniqueid'],channels[_0x5acfd3['uniqueid']][_0xe640('0x40')]));delete channels[_0x5acfd3[_0xe640('0x7')]]['musiconholdstartAt'];}}}catch(_0x790ce4){utils[_0xe640('0x1d')](util[_0xe640('0xa')](_0xe640('0x3f'),_0x5acfd3[_0xe640('0x7')]),_0x790ce4);}};exports[_0xe640('0x41')]=function(_0xcbd08d){try{if(!_[_0xe640('0x20')](channels[_0xcbd08d[_0xe640('0x7')]])){utils[_0xe640('0x16')](util['format'](_0xe640('0x42'),_0xcbd08d['uniqueid']),_0xcbd08d);if(!_['isNil'](_0xcbd08d[_0xe640('0x43')]['xmd-originatecalleridnum'])){utils['info'](util[_0xe640('0xa')](_0xe640('0x44'),_0xcbd08d['uniqueid'],_0xcbd08d['value']));channels[_0xcbd08d['uniqueid']][_0xe640('0x45')]=_0xcbd08d[_0xe640('0x46')];}if(!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x47')])){utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xcbd08d[_0xe640('0x7')],_0xcbd08d[_0xe640('0x46')]));channels[_0xcbd08d[_0xe640('0x7')]]['destination']=_0xcbd08d[_0xe640('0x46')];channels[_0xcbd08d['uniqueid']][_0xe640('0x29')]='\x22'+_0xcbd08d[_0xe640('0x46')]+_0xe640('0x48')+_0xcbd08d[_0xe640('0x46')]+'>';}if(!_[_0xe640('0x20')](_0xcbd08d['variable'][_0xe640('0x49')])||!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')]['xmd-callerid'])){utils['info'](util[_0xe640('0xa')](_0xe640('0x4a'),_0xcbd08d['uniqueid'],!_['isNil'](_0xcbd08d[_0xe640('0x43')]['xmd-callerid-preview'])?_0xe640('0x49'):_0xe640('0x4b'),_0xcbd08d['value']));channels[_0xcbd08d[_0xe640('0x7')]][_0xe640('0x29')]=_0xcbd08d[_0xe640('0x46')];}if(!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x4c')])||!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x4d')])){utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0xcbd08d['uniqueid'],!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x4c')])?_0xe640('0x4c'):_0xe640('0x4d'),_0xcbd08d['value']));channels[_0xcbd08d[_0xe640('0x7')]]['lastapplication']=_0xe640('0x4e');channels[_0xcbd08d[_0xe640('0x7')]]['lastdata']=_0xcbd08d[_0xe640('0x46')];channels[_0xcbd08d[_0xe640('0x7')]]['queue']=!![];}if(!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x4f')])){utils[_0xe640('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xcbd08d[_0xe640('0x7')],_0xcbd08d[_0xe640('0x46')]));channels[_0xcbd08d[_0xe640('0x7')]][_0xe640('0x50')]=_0xcbd08d[_0xe640('0x46')];}if(!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')][_0xe640('0x51')])){utils['info'](util[_0xe640('0xa')](_0xe640('0x52'),_0xcbd08d[_0xe640('0x7')],_0xcbd08d['value']));channels[_0xcbd08d[_0xe640('0x7')]][_0xe640('0x53')]=_0xcbd08d[_0xe640('0x46')];}if(!_[_0xe640('0x20')](_0xcbd08d[_0xe640('0x43')]['outboundrouteid'])){utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0xcbd08d[_0xe640('0x7')],_0xcbd08d[_0xe640('0x46')]));channels[_0xcbd08d[_0xe640('0x7')]]['routeid']=_0xcbd08d[_0xe640('0x46')];}if(!_['isNil'](_0xcbd08d[_0xe640('0x43')][_0xe640('0x54')])){utils[_0xe640('0x9')](util[_0xe640('0xa')](_0xe640('0x55'),_0xcbd08d[_0xe640('0x7')],_0xcbd08d[_0xe640('0x46')]));channels[_0xcbd08d[_0xe640('0x7')]][_0xe640('0x54')]=_0xcbd08d[_0xe640('0x46')];}}}catch(_0x1a0f16){utils['error'](util['format'](_0xe640('0x42'),_0xcbd08d[_0xe640('0x7')]),_0x1a0f16);}};exports[_0xe640('0x56')]=function(_0x484351){try{if(!_[_0xe640('0x20')](channels[_0x484351[_0xe640('0x7')]])){utils[_0xe640('0x16')](util[_0xe640('0xa')](_0xe640('0x57'),_0x484351[_0xe640('0x7')]),_0x484351);utils[_0xe640('0x9')](util[_0xe640('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x484351[_0xe640('0x7')],_0x484351[_0xe640('0x58')],_0x484351[_0xe640('0x59')]));if(_0x484351['application'][_0xe640('0x5a')]()==_0xe640('0x5b')&&_['startsWith'](_0x484351[_0xe640('0x59')]['toLowerCase'](),_0xe640('0x5c'))){var _0x5ec3ac=_0x484351['appdata'][_0xe640('0x5d')]('=');var _0x5e80e9=_0x5ec3ac[0x0]['substring'](_0x5ec3ac[0x0][_0xe640('0x5e')]('(')+0x1,_0x5ec3ac[0x0][_0xe640('0x5e')](')'));var _0x27d347=_0x5ec3ac[0x1];channels[_0x484351[_0xe640('0x7')]][_0x5e80e9]=_0x27d347;}if(!_[_0xe640('0x5f')]([_0xe640('0x27'),_0xe640('0x60'),'execif',_0xe640('0x5b'),'gotoif'],_0x484351[_0xe640('0x58')]['toLowerCase']())){channels[_0x484351['uniqueid']][_0xe640('0x61')]=_0x484351['application'];channels[_0x484351[_0xe640('0x7')]]['lastdata']=_0x484351[_0xe640('0x59')];}}}catch(_0xbe893){utils['error'](util[_0xe640('0xa')](_0xe640('0x57'),_0x484351['uniqueid']),_0xbe893);}}; \ No newline at end of file +var _0xe34e=['format','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','then','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','context','exten','now','DOCUMENTATION','newstate','channelstate','isNil','systemanswertime','linkedid','transfer','answertime','disposition','toNumber','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','lastdata','lodash','util','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','info'];(function(_0x56f5cf,_0x133ff8){var _0x159959=function(_0x5d89f6){while(--_0x5d89f6){_0x56f5cf['push'](_0x56f5cf['shift']());}};_0x159959(++_0x133ff8);}(_0xe34e,0x132));var _0xee34=function(_0xf23afc,_0x2064b9){_0xf23afc=_0xf23afc-0x0;var _0x31e9b1=_0xe34e[_0xf23afc];return _0x31e9b1;};'use strict';var _=require(_0xee34('0x0'));var util=require(_0xee34('0x1'));var utils=require('./utils');var transfers=require(_0xee34('0x2'));var dispositions=[_0xee34('0x3'),_0xee34('0x4'),_0xee34('0x4'),_0xee34('0x3'),_0xee34('0x3'),_0xee34('0x3'),_0xee34('0x5'),'BUSY',_0xee34('0x4'),'FAILED',_0xee34('0x4')];var channels={};function writeDB(_0x3ed6fa){var _0x46d0a9;if(transfers[_0xee34('0x6')][_0x3ed6fa[_0xee34('0x7')]]){_0x46d0a9=_0x3ed6fa[_0xee34('0x7')];_0x3ed6fa[_0xee34('0x7')]=transfers['blinds'][_0x3ed6fa[_0xee34('0x7')]]['transfereeuniqueid'];}utils[_0xee34('0x8')](util[_0xee34('0x9')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3ed6fa['uniqueid'],_0x3ed6fa[_0xee34('0xa')],_0x3ed6fa[_0xee34('0xb')],_0x3ed6fa[_0xee34('0xc')],_0x3ed6fa['interface'],_0x3ed6fa[_0xee34('0xd')],_0x3ed6fa[_0xee34('0xe')],_0x3ed6fa[_0xee34('0xf')]));if(_0x3ed6fa['accountcode']){utils['getUserByInternal'](_0x3ed6fa[_0xee34('0x10')])[_0xee34('0x11')](function(_0x400538){if(_0x400538){_0x3ed6fa['UserId']=_0x400538['id'];}utils[_0xee34('0x12')]('CreateVoiceCallReport',_0x3ed6fa);});}else{utils[_0xee34('0x12')](_0xee34('0x13'),_0x3ed6fa);}if(channels[_0x3ed6fa[_0xee34('0x7')]]){delete channels[_0x3ed6fa['uniqueid']];}else if(_0x46d0a9&&channels[_0x46d0a9]){delete transfers[_0xee34('0x6')][_0x46d0a9];delete channels[_0x46d0a9];}}exports[_0xee34('0x14')]=function(_0x3455a4){try{utils[_0xee34('0x15')](util['format'](_0xee34('0x16'),_0x3455a4[_0xee34('0x7')]),_0x3455a4);if(_0x3455a4[_0xee34('0x7')]==_0x3455a4['linkedid']&&_0x3455a4[_0xee34('0xa')]!=_0xee34('0x17')){utils[_0xee34('0x8')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3455a4[_0xee34('0x7')],_0x3455a4[_0xee34('0x18')],_0x3455a4[_0xee34('0x19')]));channels[_0x3455a4[_0xee34('0x7')]]={'uniqueid':_0x3455a4[_0xee34('0x7')],'accountcode':_0x3455a4[_0xee34('0x10')],'source':_0x3455a4[_0xee34('0xd')],'destination':_0x3455a4[_0xee34('0x19')],'destinationcontext':_0x3455a4[_0xee34('0x18')],'channel':_0x3455a4['channel'],'starttime':utils[_0xee34('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xee34('0x3'),'amaflags':_0xee34('0x1b')};}}catch(_0x36e73b){utils['error'](util['format']('[%s][calls][newchannel]',_0x3455a4[_0xee34('0x7')]),_0x36e73b);}};exports[_0xee34('0x1c')]=function(_0x33ddfc){try{utils['debug'](util[_0xee34('0x9')]('[%s][calls][newstate]',_0x33ddfc['uniqueid']),_0x33ddfc);if(!_['isNil'](channels[_0x33ddfc[_0xee34('0x7')]])&&_0x33ddfc[_0xee34('0x1d')]==0x6){utils[_0xee34('0x8')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x33ddfc['uniqueid'],_0x33ddfc[_0xee34('0x18')],_0x33ddfc[_0xee34('0xa')]));if(_[_0xee34('0x1e')](channels[_0x33ddfc[_0xee34('0x7')]][_0xee34('0x1f')])){channels[_0x33ddfc['uniqueid']][_0xee34('0x1f')]=utils[_0xee34('0x1a')]();}}else if(!_[_0xee34('0x1e')](channels[_0x33ddfc[_0xee34('0x20')]])&&_0x33ddfc[_0xee34('0x1d')]==0x6&&_0x33ddfc[_0xee34('0x18')]!=_0xee34('0x21')){utils[_0xee34('0x8')](util[_0xee34('0x9')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x33ddfc['uniqueid'],_0x33ddfc['linkedid'],_0x33ddfc['context'],_0x33ddfc[_0xee34('0xa')]));channels[_0x33ddfc[_0xee34('0x20')]][_0xee34('0x10')]=_0x33ddfc[_0xee34('0x10')];channels[_0x33ddfc[_0xee34('0x20')]]['destinationchannel']=_0x33ddfc[_0xee34('0xa')];if(_['isNil'](channels[_0x33ddfc[_0xee34('0x20')]]['answertime'])){channels[_0x33ddfc[_0xee34('0x20')]][_0xee34('0x22')]=utils[_0xee34('0x1a')]();}channels[_0x33ddfc[_0xee34('0x20')]][_0xee34('0x23')]=dispositions[_[_0xee34('0x24')](_0x33ddfc[_0xee34('0x1d')])]||_0xee34('0x5');}}catch(_0x2f8b4f){utils[_0xee34('0x25')](util[_0xee34('0x9')](_0xee34('0x26'),_0x33ddfc['uniqueid']),_0x2f8b4f);}};exports[_0xee34('0x27')]=function(_0x3679d8){try{if(!_['isNil'](channels[_0x3679d8[_0xee34('0x7')]])){utils[_0xee34('0x15')](util[_0xee34('0x9')](_0xee34('0x28'),_0x3679d8[_0xee34('0x7')]),_0x3679d8);if(_['isNil'](channels[_0x3679d8[_0xee34('0x7')]]['callerid'])){channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x29')]=_0x3679d8[_0xee34('0x2a')]+'\x20<'+_0x3679d8[_0xee34('0xd')]+'>';}utils['info'](util['format'](_0xee34('0x2b'),_0x3679d8[_0xee34('0x7')],channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x29')],_0x3679d8[_0xee34('0x2c')]));channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x2d')]=utils[_0xee34('0x1a')]();channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x2e')]=utils[_0xee34('0x2f')](channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x2d')],channels[_0x3679d8['uniqueid']]['starttime']);channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x30')]=channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x22')]?utils['diffTime'](channels[_0x3679d8[_0xee34('0x7')]][_0xee34('0x2d')],channels[_0x3679d8['uniqueid']]['answertime']):0x0;writeDB(channels[_0x3679d8['uniqueid']]);}}catch(_0x16ef3f){utils[_0xee34('0x25')](util[_0xee34('0x9')](_0xee34('0x28'),_0x3679d8['uniqueid']),_0x16ef3f);}};exports[_0xee34('0x31')]=function(_0x15605c){try{if(!_[_0xee34('0x1e')](channels[_0x15605c[_0xee34('0x32')]])){utils['debug'](util[_0xee34('0x9')](_0xee34('0x33'),_0x15605c[_0xee34('0x34')]),_0x15605c);if(channels[_0x15605c['localtwolinkedid']][_0xee34('0xa')]==_0x15605c[_0xee34('0x35')]){utils[_0xee34('0x8')](util['format'](_0xee34('0x36'),_0x15605c[_0xee34('0x34')],_0x15605c[_0xee34('0x32')],_0x15605c['secondtransfererchannel']));channels[_0x15605c['localtwolinkedid']][_0xee34('0x37')]=_0x15605c['secondtransfererchannel'];channels[_0x15605c[_0xee34('0x32')]][_0xee34('0x38')]=_0xee34('0x39');}else if(channels[_0x15605c[_0xee34('0x32')]][_0xee34('0xa')]=_0x15605c[_0xee34('0x3a')]){utils[_0xee34('0x8')](util[_0xee34('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x15605c['origtransfereruniqueid'],_0x15605c['localtwolinkedid'],_0x15605c[_0xee34('0x3b')]));channels[_0x15605c[_0xee34('0x32')]][_0xee34('0x37')]=_0x15605c['origtransfererchannel'];channels[_0x15605c['localtwolinkedid']]['userfield']=_0xee34('0x39');}}}catch(_0xf388a3){utils['error'](util[_0xee34('0x9')](_0xee34('0x33'),_0x15605c[_0xee34('0x34')]),_0xf388a3);}};exports[_0xee34('0x3c')]=function(_0x11e4c1){try{if(!_[_0xee34('0x1e')](channels[_0x11e4c1[_0xee34('0x7')]])){utils[_0xee34('0x15')](util[_0xee34('0x9')](_0xee34('0x3d'),_0x11e4c1[_0xee34('0x7')]),_0x11e4c1);channels[_0x11e4c1[_0xee34('0x7')]]['musiconholdstartAt']=utils[_0xee34('0x1a')]();utils[_0xee34('0x8')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x11e4c1[_0xee34('0x7')],channels[_0x11e4c1[_0xee34('0x7')]]['musiconholdstartAt']));}}catch(_0x3c1a05){utils[_0xee34('0x25')](util[_0xee34('0x9')](_0xee34('0x3d'),_0x11e4c1[_0xee34('0x7')]),_0x3c1a05);}};exports[_0xee34('0x3e')]=function(_0x814bcd){try{if(!_[_0xee34('0x1e')](channels[_0x814bcd[_0xee34('0x7')]])){utils[_0xee34('0x15')](util['format'](_0xee34('0x3f'),_0x814bcd[_0xee34('0x7')]),_0x814bcd);if(!_[_0xee34('0x1e')](channels[_0x814bcd[_0xee34('0x7')]][_0xee34('0x40')])){channels[_0x814bcd[_0xee34('0x7')]][_0xee34('0x41')]+=utils[_0xee34('0x2f')](utils[_0xee34('0x1a')](),channels[_0x814bcd[_0xee34('0x7')]][_0xee34('0x40')]);utils[_0xee34('0x8')](util[_0xee34('0x9')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x814bcd[_0xee34('0x7')],channels[_0x814bcd['uniqueid']][_0xee34('0x41')]));delete channels[_0x814bcd[_0xee34('0x7')]][_0xee34('0x40')];}}}catch(_0x2f3902){utils[_0xee34('0x25')](util['format']('[%s][calls][musiconholdstop]',_0x814bcd[_0xee34('0x7')]),_0x2f3902);}};exports['varset']=function(_0x4e96fd){try{if(!_[_0xee34('0x1e')](channels[_0x4e96fd[_0xee34('0x7')]])){utils['debug'](util['format'](_0xee34('0x42'),_0x4e96fd[_0xee34('0x7')]),_0x4e96fd);if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x44')])){utils['info'](util[_0xee34('0x9')](_0xee34('0x45'),_0x4e96fd['uniqueid'],_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x47')]=_0x4e96fd[_0xee34('0x46')];}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x48')])){utils[_0xee34('0x8')](util[_0xee34('0x9')](_0xee34('0x49'),_0x4e96fd[_0xee34('0x7')],_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x4a')]=_0x4e96fd[_0xee34('0x46')];channels[_0x4e96fd[_0xee34('0x7')]]['callerid']='\x22'+_0x4e96fd[_0xee34('0x46')]+_0xee34('0x4b')+_0x4e96fd[_0xee34('0x46')]+'>';}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x4c')])||!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')]['xmd-callerid'])){utils[_0xee34('0x8')](util[_0xee34('0x9')](_0xee34('0x4d'),_0x4e96fd['uniqueid'],!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x4c')])?_0xee34('0x4c'):'xmd-callerid',_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x29')]=_0x4e96fd[_0xee34('0x46')];}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x4e')])||!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x4f')])){utils[_0xee34('0x8')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4e96fd['uniqueid'],!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x4e')])?_0xee34('0x4e'):_0xee34('0x4f'),_0x4e96fd['value']));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x50')]=_0xee34('0x51');channels[_0x4e96fd[_0xee34('0x7')]]['lastdata']=_0x4e96fd[_0xee34('0x46')];channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0xb')]=!![];}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x52')])){utils[_0xee34('0x8')](util[_0xee34('0x9')](_0xee34('0x53'),_0x4e96fd[_0xee34('0x7')],_0x4e96fd['value']));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x54')]=_0x4e96fd[_0xee34('0x46')];}if(!_[_0xee34('0x1e')](_0x4e96fd['variable'][_0xee34('0x55')])){utils[_0xee34('0x8')](util[_0xee34('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4e96fd[_0xee34('0x7')],_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd['uniqueid']]['type']=_0x4e96fd[_0xee34('0x46')];}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')][_0xee34('0x56')])){utils[_0xee34('0x8')](util['format'](_0xee34('0x57'),_0x4e96fd[_0xee34('0x7')],_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd['uniqueid']][_0xee34('0x58')]=_0x4e96fd['value'];}if(!_[_0xee34('0x1e')](_0x4e96fd[_0xee34('0x43')]['sipcallid'])){utils[_0xee34('0x8')](util[_0xee34('0x9')](_0xee34('0x59'),_0x4e96fd[_0xee34('0x7')],_0x4e96fd[_0xee34('0x46')]));channels[_0x4e96fd[_0xee34('0x7')]][_0xee34('0x5a')]=_0x4e96fd[_0xee34('0x46')];}}}catch(_0x2a94c3){utils[_0xee34('0x25')](util[_0xee34('0x9')](_0xee34('0x42'),_0x4e96fd[_0xee34('0x7')]),_0x2a94c3);}};exports[_0xee34('0x5b')]=function(_0x2f3c92){try{if(!_[_0xee34('0x1e')](channels[_0x2f3c92[_0xee34('0x7')]])){utils[_0xee34('0x15')](util[_0xee34('0x9')]('[%s][calls][newexten]',_0x2f3c92[_0xee34('0x7')]),_0x2f3c92);utils[_0xee34('0x8')](util[_0xee34('0x9')](_0xee34('0x5c'),_0x2f3c92[_0xee34('0x7')],_0x2f3c92['application'],_0x2f3c92['appdata']));if(_0x2f3c92[_0xee34('0x5d')][_0xee34('0x5e')]()==_0xee34('0x5f')&&_[_0xee34('0x60')](_0x2f3c92['appdata'][_0xee34('0x5e')](),_0xee34('0x61'))){var _0xe4fe69=_0x2f3c92['appdata'][_0xee34('0x62')]('=');var _0x43b378=_0xe4fe69[0x0][_0xee34('0x63')](_0xe4fe69[0x0][_0xee34('0x64')]('(')+0x1,_0xe4fe69[0x0][_0xee34('0x64')](')'));var _0xe69de0=_0xe4fe69[0x1];channels[_0x2f3c92[_0xee34('0x7')]][_0x43b378]=_0xe69de0;}if(!_[_0xee34('0x65')]([_0xee34('0x27'),_0xee34('0x66'),_0xee34('0x67'),_0xee34('0x5f'),'gotoif'],_0x2f3c92[_0xee34('0x5d')][_0xee34('0x5e')]())){channels[_0x2f3c92[_0xee34('0x7')]][_0xee34('0x50')]=_0x2f3c92['application'];channels[_0x2f3c92['uniqueid']][_0xee34('0x68')]=_0x2f3c92['appdata'];}}}catch(_0x360a90){utils[_0xee34('0x25')](util[_0xee34('0x9')]('[%s][calls][newexten]',_0x2f3c92[_0xee34('0x7')]),_0x360a90);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e2d9e68..ea93cab 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 _0xb2cf=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0xb2cf,0x10c));var _0xfb2c=function(_0x35dc1d,_0x53944f){_0x35dc1d=_0x35dc1d-0x0;var _0x3541be=_0xb2cf[_0x35dc1d];return _0x3541be;};'use strict';var utils=require(_0xfb2c('0x0'));exports[_0xfb2c('0x1')]=function(){utils[_0xfb2c('0x2')](_0xfb2c('0x3'));};exports[_0xfb2c('0x4')]=function(){utils['info'](_0xfb2c('0x5'));};exports[_0xfb2c('0x6')]=function(){utils['info'](_0xfb2c('0x7'));};exports[_0xfb2c('0x8')]=function(_0x241d3f){utils[_0xfb2c('0x8')](_0xfb2c('0x9'),_0x241d3f);};exports[_0xfb2c('0xa')]=function(){utils[_0xfb2c('0x2')](_0xfb2c('0xb'));};exports[_0xfb2c('0xc')]=function(_0x46d369){}; \ No newline at end of file +var _0xdf81=['./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','managerevent'];(function(_0x45c869,_0x28b899){var _0x4dabde=function(_0x3d5a6c){while(--_0x3d5a6c){_0x45c869['push'](_0x45c869['shift']());}};_0x4dabde(++_0x28b899);}(_0xdf81,0xa0));var _0x1df8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdf81[_0x57b54c];return _0x59cc19;};'use strict';var utils=require(_0x1df8('0x0'));exports[_0x1df8('0x1')]=function(){utils[_0x1df8('0x2')](_0x1df8('0x3'));};exports[_0x1df8('0x4')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x1df8('0x5')]=function(){utils['info'](_0x1df8('0x6'));};exports[_0x1df8('0x7')]=function(_0xadc322){utils['error'](_0x1df8('0x8'),_0xadc322);};exports['close']=function(){utils[_0x1df8('0x2')]('[core]\x20close');};exports[_0x1df8('0x9')]=function(_0x178ac4){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index fae260f..c872255 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 _0x5afb=['complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','split','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','lastevent','called','info','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','now'];(function(_0xe1f02c,_0x4575cc){var _0xe1a543=function(_0x356faa){while(--_0x356faa){_0xe1f02c['push'](_0xe1f02c['shift']());}};_0xe1a543(++_0x4575cc);}(_0x5afb,0x1c8));var _0xb5af=function(_0x2ec650,_0x24b011){_0x2ec650=_0x2ec650-0x0;var _0xdb00de=_0x5afb[_0x2ec650];return _0xdb00de;};'use strict';var _=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var utils=require(_0xb5af('0x2'));var dials={};function writeDB(_0x527523){utils['info'](util[_0xb5af('0x3')](_0xb5af('0x4'),_0x527523['uniqueid'],_0x527523[_0xb5af('0x5')],_0x527523[_0xb5af('0x6')],_0x527523['calleridnum'],_0x527523[_0xb5af('0x7')],_0x527523['dialstatus']));utils[_0xb5af('0x8')](_0xb5af('0x9'),_0x527523);delete dials[_0x527523['uniqueid']];}exports[_0xb5af('0xa')]=function(_0x3548c0){try{utils[_0xb5af('0xb')](util['format'](_0xb5af('0xc'),_0x3548c0[_0xb5af('0xd')]),_0x3548c0);utils['info'](util[_0xb5af('0x3')](_0xb5af('0xe'),_0x3548c0[_0xb5af('0xd')],_0x3548c0[_0xb5af('0xf')],_0x3548c0[_0xb5af('0x10')]));if(_0x3548c0['application']['toLowerCase']()=='set'&&_['startsWith'](_0x3548c0[_0xb5af('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0x317411=_0x3548c0[_0xb5af('0x10')][_0xb5af('0x11')]('=');dials[_0x3548c0[_0xb5af('0xd')]]={'routeId':_0x317411[0x1]};}}catch(_0x4b9f1c){utils['error'](util[_0xb5af('0x3')](_0xb5af('0xc'),_0x3548c0[_0xb5af('0xd')]),_0x4b9f1c);}};exports['varset']=function(_0x20d1e5){try{utils[_0xb5af('0xb')](util[_0xb5af('0x3')](_0xb5af('0x12'),_0x20d1e5[_0xb5af('0xd')]),_0x20d1e5);if(!_[_0xb5af('0x13')](_0x20d1e5['variable'][_0xb5af('0x14')])){utils['info'](util[_0xb5af('0x3')](_0xb5af('0x15'),_0x20d1e5[_0xb5af('0xd')],_0x20d1e5['value']));dials[_0x20d1e5[_0xb5af('0xd')]]={'routeId':_0x20d1e5['value']};}}catch(_0x390023){utils[_0xb5af('0x16')](util[_0xb5af('0x3')](_0xb5af('0x12'),_0x20d1e5['uniqueid']),_0x390023);}};exports[_0xb5af('0x17')]=function(_0x3752d0){try{if(!_[_0xb5af('0x13')](dials[_0x3752d0['uniqueid']])){utils[_0xb5af('0xb')](util[_0xb5af('0x3')](_0xb5af('0x18'),_0x3752d0['uniqueid']),_0x3752d0);dials[_0x3752d0['uniqueid']]=_[_0xb5af('0x19')](dials[_0x3752d0[_0xb5af('0xd')]],_0x3752d0);dials[_0x3752d0[_0xb5af('0xd')]][_0xb5af('0x1a')]=utils['now']();dials[_0x3752d0[_0xb5af('0xd')]][_0xb5af('0x1b')]=_0xb5af('0x1c');utils[_0xb5af('0x1d')](util['format'](_0xb5af('0x1e'),_0x3752d0[_0xb5af('0xd')],dials[_0x3752d0['uniqueid']][_0xb5af('0x1a')]));}}catch(_0x14c992){utils['error'](util[_0xb5af('0x3')](_0xb5af('0x18'),_0x3752d0[_0xb5af('0xd')]),_0x14c992);}};exports['dialend']=function(_0x457b85){try{if(!_[_0xb5af('0x13')](dials[_0x457b85[_0xb5af('0xd')]])){utils['debug'](util[_0xb5af('0x3')](_0xb5af('0x1f'),_0x457b85['uniqueid']),_0x457b85);dials[_0x457b85[_0xb5af('0xd')]]['dialstatus']=_0x457b85[_0xb5af('0x20')];if(_0x457b85['dialstatus']==_0xb5af('0x21')){dials[_0x457b85['uniqueid']]=_[_0xb5af('0x19')](dials[_0x457b85['uniqueid']],_0x457b85);dials[_0x457b85[_0xb5af('0xd')]][_0xb5af('0x22')]=utils['now']();dials[_0x457b85[_0xb5af('0xd')]][_0xb5af('0x1b')]=_0xb5af('0x23');utils[_0xb5af('0x1d')](util['format'](_0xb5af('0x24'),_0x457b85[_0xb5af('0xd')],_0x457b85[_0xb5af('0x20')],dials[_0x457b85[_0xb5af('0xd')]][_0xb5af('0x22')]));}else{utils['info'](util[_0xb5af('0x3')](_0xb5af('0x25'),_0x457b85[_0xb5af('0xd')],_0x457b85[_0xb5af('0x20')]));}}}catch(_0x51bacd){utils[_0xb5af('0x16')](util[_0xb5af('0x3')](_0xb5af('0x1f'),_0x457b85[_0xb5af('0xd')]),_0x51bacd);}};exports[_0xb5af('0x26')]=function(_0x59dac1){try{if(!_[_0xb5af('0x13')](dials[_0x59dac1[_0xb5af('0xd')]])){utils[_0xb5af('0xb')](util[_0xb5af('0x3')](_0xb5af('0x27'),_0x59dac1[_0xb5af('0xd')]),_0x59dac1);utils['info'](util['format'](_0xb5af('0x28'),_0x59dac1[_0xb5af('0xd')],_0x59dac1[_0xb5af('0x29')],_0x59dac1[_0xb5af('0x2a')],_0x59dac1['cause-txt']));dials[_0x59dac1[_0xb5af('0xd')]]=_[_0xb5af('0x19')](dials[_0x59dac1[_0xb5af('0xd')]],{'endtime':utils[_0xb5af('0x2b')](),'lastevent':_0xb5af('0x2c')});dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x2d')]=utils[_0xb5af('0x2e')](dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x2f')],dials[_0x59dac1['uniqueid']]['starttime']);dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x30')]=utils['diffTime'](dials[_0x59dac1[_0xb5af('0xd')]]['answertime']||dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x2f')],dials[_0x59dac1[_0xb5af('0xd')]]['starttime']);dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x31')]=dials[_0x59dac1[_0xb5af('0xd')]][_0xb5af('0x22')]?utils[_0xb5af('0x2e')](dials[_0x59dac1[_0xb5af('0xd')]]['endtime'],dials[_0x59dac1[_0xb5af('0xd')]]['answertime']):0x0;writeDB(dials[_0x59dac1[_0xb5af('0xd')]]);}}catch(_0x34f464){utils[_0xb5af('0x16')](util[_0xb5af('0x3')](_0xb5af('0x27'),_0x59dac1[_0xb5af('0xd')]),_0x34f464);}}; \ No newline at end of file +var _0x7ba7=['calleridnum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','[%s][dials][newexten]','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','isNil','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','calleridname','cause-txt','complete','duration','endtime','diffTime','billableseconds','[%s][dials][hangup]','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7ba7,0x92));var _0x77ba=function(_0x4d4298,_0xa728df){_0x4d4298=_0x4d4298-0x0;var _0x2f8aa2=_0x7ba7[_0x4d4298];return _0x2f8aa2;};'use strict';var _=require(_0x77ba('0x0'));var util=require(_0x77ba('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x5a94ea){utils[_0x77ba('0x2')](util[_0x77ba('0x3')](_0x77ba('0x4'),_0x5a94ea[_0x77ba('0x5')],_0x5a94ea[_0x77ba('0x6')],_0x5a94ea['dialstring'],_0x5a94ea[_0x77ba('0x7')],_0x5a94ea['connectedlinenum'],_0x5a94ea[_0x77ba('0x8')]));utils[_0x77ba('0x9')](_0x77ba('0xa'),_0x5a94ea);delete dials[_0x5a94ea[_0x77ba('0x5')]];}exports[_0x77ba('0xb')]=function(_0x50650b){try{utils[_0x77ba('0xc')](util[_0x77ba('0x3')]('[%s][dials][newexten]',_0x50650b['uniqueid']),_0x50650b);utils[_0x77ba('0x2')](util[_0x77ba('0x3')](_0x77ba('0xd'),_0x50650b[_0x77ba('0x5')],_0x50650b[_0x77ba('0xe')],_0x50650b[_0x77ba('0xf')]));if(_0x50650b[_0x77ba('0xe')][_0x77ba('0x10')]()==_0x77ba('0x11')&&_[_0x77ba('0x12')](_0x50650b['appdata'][_0x77ba('0x10')](),_0x77ba('0x13'))){var _0x401ea4=_0x50650b['appdata']['split']('=');dials[_0x50650b[_0x77ba('0x5')]]={'routeId':_0x401ea4[0x1]};}}catch(_0x3d42cf){utils['error'](util[_0x77ba('0x3')](_0x77ba('0x14'),_0x50650b['uniqueid']),_0x3d42cf);}};exports[_0x77ba('0x15')]=function(_0x572590){try{utils[_0x77ba('0xc')](util[_0x77ba('0x3')](_0x77ba('0x16'),_0x572590[_0x77ba('0x5')]),_0x572590);if(!_['isNil'](_0x572590['variable'][_0x77ba('0x17')])){utils[_0x77ba('0x2')](util[_0x77ba('0x3')](_0x77ba('0x18'),_0x572590['uniqueid'],_0x572590[_0x77ba('0x19')]));dials[_0x572590['uniqueid']]={'routeId':_0x572590[_0x77ba('0x19')]};}}catch(_0x40faee){utils[_0x77ba('0x1a')](util[_0x77ba('0x3')](_0x77ba('0x16'),_0x572590[_0x77ba('0x5')]),_0x40faee);}};exports[_0x77ba('0x1b')]=function(_0x233c96){try{if(!_[_0x77ba('0x1c')](dials[_0x233c96[_0x77ba('0x5')]])){utils[_0x77ba('0xc')](util[_0x77ba('0x3')]('[%s][dials][dialbegin]',_0x233c96[_0x77ba('0x5')]),_0x233c96);dials[_0x233c96[_0x77ba('0x5')]]=_[_0x77ba('0x1d')](dials[_0x233c96[_0x77ba('0x5')]],_0x233c96);dials[_0x233c96[_0x77ba('0x5')]][_0x77ba('0x1e')]=utils[_0x77ba('0x1f')]();dials[_0x233c96['uniqueid']][_0x77ba('0x20')]=_0x77ba('0x21');utils[_0x77ba('0x2')](util[_0x77ba('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x233c96[_0x77ba('0x5')],dials[_0x233c96[_0x77ba('0x5')]]['starttime']));}}catch(_0x2f1e24){utils['error'](util[_0x77ba('0x3')](_0x77ba('0x22'),_0x233c96[_0x77ba('0x5')]),_0x2f1e24);}};exports[_0x77ba('0x23')]=function(_0x27f348){try{if(!_[_0x77ba('0x1c')](dials[_0x27f348[_0x77ba('0x5')]])){utils['debug'](util[_0x77ba('0x3')](_0x77ba('0x24'),_0x27f348[_0x77ba('0x5')]),_0x27f348);dials[_0x27f348[_0x77ba('0x5')]][_0x77ba('0x8')]=_0x27f348[_0x77ba('0x8')];if(_0x27f348['dialstatus']==_0x77ba('0x25')){dials[_0x27f348[_0x77ba('0x5')]]=_[_0x77ba('0x1d')](dials[_0x27f348[_0x77ba('0x5')]],_0x27f348);dials[_0x27f348[_0x77ba('0x5')]][_0x77ba('0x26')]=utils[_0x77ba('0x1f')]();dials[_0x27f348['uniqueid']]['lastevent']=_0x77ba('0x27');utils[_0x77ba('0x2')](util[_0x77ba('0x3')](_0x77ba('0x28'),_0x27f348[_0x77ba('0x5')],_0x27f348[_0x77ba('0x8')],dials[_0x27f348[_0x77ba('0x5')]]['answertime']));}else{utils['info'](util[_0x77ba('0x3')](_0x77ba('0x29'),_0x27f348[_0x77ba('0x5')],_0x27f348['dialstatus']));}}}catch(_0x307794){utils[_0x77ba('0x1a')](util['format'](_0x77ba('0x24'),_0x27f348['uniqueid']),_0x307794);}};exports[_0x77ba('0x2a')]=function(_0x38fbe2){try{if(!_[_0x77ba('0x1c')](dials[_0x38fbe2[_0x77ba('0x5')]])){utils[_0x77ba('0xc')](util[_0x77ba('0x3')]('[%s][dials][hangup]',_0x38fbe2[_0x77ba('0x5')]),_0x38fbe2);utils[_0x77ba('0x2')](util[_0x77ba('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x38fbe2[_0x77ba('0x5')],_0x38fbe2[_0x77ba('0x7')],_0x38fbe2[_0x77ba('0x2b')],_0x38fbe2[_0x77ba('0x2c')]));dials[_0x38fbe2[_0x77ba('0x5')]]=_[_0x77ba('0x1d')](dials[_0x38fbe2[_0x77ba('0x5')]],{'endtime':utils[_0x77ba('0x1f')](),'lastevent':_0x77ba('0x2d')});dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x2e')]=utils['diffTime'](dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x2f')],dials[_0x38fbe2[_0x77ba('0x5')]]['starttime']);dials[_0x38fbe2[_0x77ba('0x5')]]['holdtime']=utils[_0x77ba('0x30')](dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x26')]||dials[_0x38fbe2[_0x77ba('0x5')]]['endtime'],dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x1e')]);dials[_0x38fbe2['uniqueid']][_0x77ba('0x31')]=dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x26')]?utils[_0x77ba('0x30')](dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x2f')],dials[_0x38fbe2[_0x77ba('0x5')]][_0x77ba('0x26')]):0x0;writeDB(dials[_0x38fbe2[_0x77ba('0x5')]]);}}catch(_0x40b077){utils[_0x77ba('0x1a')](util[_0x77ba('0x3')](_0x77ba('0x32'),_0x38fbe2['uniqueid']),_0x40b077);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 9ea4c33..b757f55 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 _0x41e2=['[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','password','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','uniqueid','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x41e2,0x9b));var _0x241e=function(_0x313e5f,_0x27c27f){_0x313e5f=_0x313e5f-0x0;var _0x3e76c6=_0x41e2[_0x313e5f];return _0x3e76c6;};var AsteriskManager=require(_0x241e('0x0'));var config=require(_0x241e('0x1'));var utils=require('./utils');var util=require(_0x241e('0x2'));var ami=new AsteriskManager(config[_0x241e('0x3')]['port'],config[_0x241e('0x3')]['ip'],config[_0x241e('0x3')]['username'],config[_0x241e('0x3')][_0x241e('0x4')],!![]);ami['keepConnected']();if(config['xdr']&&config[_0x241e('0x5')][_0x241e('0x6')]){utils['info'](_0x241e('0x7'));}else{var agents=require(_0x241e('0x8'));var calls=require(_0x241e('0x9'));var queues=require(_0x241e('0xa'));var recordings=require(_0x241e('0xb'));var members=require(_0x241e('0xc'));var dials=require(_0x241e('0xd'));var transfers=require(_0x241e('0xe'));var core=require(_0x241e('0xf'));ami['on'](_0x241e('0x10'),core[_0x241e('0x10')]);ami['on'](_0x241e('0x11'),core[_0x241e('0x11')]);ami['on'](_0x241e('0x12'),core[_0x241e('0x12')]);ami['on'](_0x241e('0x13'),core[_0x241e('0x13')]);ami['on'](_0x241e('0x14'),core[_0x241e('0x14')]);ami['on'](_0x241e('0x15'),core[_0x241e('0x15')]);ami['on'](_0x241e('0x16'),function(_0x299a7e){try{utils['debug'](util[_0x241e('0x17')](_0x241e('0x18'),_0x299a7e[_0x241e('0x19')]),_0x299a7e);members['devicestatechange'](_0x299a7e);}catch(_0x496b4a){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x18'),_0x299a7e[_0x241e('0x19')]),_0x496b4a);}});ami['on'](_0x241e('0x1a'),function(_0x11cd56){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')]('[%s][index][agentcalled]',_0x11cd56[_0x241e('0x1c')]),_0x11cd56);agents[_0x241e('0x1a')](_0x11cd56);}catch(_0x5683e5){utils['error'](util[_0x241e('0x17')]('[%s][index][agentcalled]',_0x11cd56[_0x241e('0x1c')]),_0x5683e5);}});ami['on'](_0x241e('0x1d'),function(_0x2e3365){try{utils['debug'](util['format']('[%s][index][agentringnoanswer]',_0x2e3365[_0x241e('0x1c')]),_0x2e3365);agents['agentringnoanswer'](_0x2e3365);}catch(_0xae67bd){utils['error'](util['format']('[%s][index][agentringnoanswer]',_0x2e3365[_0x241e('0x1c')]),_0xae67bd);}});ami['on'](_0x241e('0x1e'),function(_0x124b7c){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x1f'),_0x124b7c[_0x241e('0x1c')]),_0x124b7c);agents[_0x241e('0x1e')](_0x124b7c);queues[_0x241e('0x1e')](_0x124b7c);}catch(_0x577539){utils['error'](util[_0x241e('0x17')](_0x241e('0x1f'),_0x124b7c[_0x241e('0x1c')]),_0x577539);}});ami['on'](_0x241e('0x20'),function(_0x226393){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x21'),_0x226393['uniqueid']),_0x226393);agents[_0x241e('0x20')](_0x226393);queues[_0x241e('0x20')](_0x226393);members['agentcomplete'](_0x226393);}catch(_0x5399b3){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x21'),_0x226393['uniqueid']),_0x5399b3);}});ami['on'](_0x241e('0x22'),function(_0x4da432){try{utils['debug'](util[_0x241e('0x17')]('[%s][index][queuecallerabandon]',_0x4da432[_0x241e('0x1c')]),_0x4da432);agents[_0x241e('0x22')](_0x4da432);queues[_0x241e('0x22')](_0x4da432);}catch(_0x5151e3){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x23'),_0x4da432[_0x241e('0x1c')]),_0x5151e3);}});ami['on'](_0x241e('0x24'),function(_0x5ea793){try{utils['debug'](util[_0x241e('0x17')](_0x241e('0x25'),_0x5ea793[_0x241e('0x1c')]),_0x5ea793);queues['queuecallerjoin'](_0x5ea793);recordings[_0x241e('0x24')](_0x5ea793);}catch(_0xea8c99){utils[_0x241e('0x13')](util[_0x241e('0x17')]('[%s][index][queuecallerjoin]',_0x5ea793['uniqueid']),_0xea8c99);}});ami['on'](_0x241e('0x26'),function(_0x21570d){try{utils[_0x241e('0x1b')](util['format'](_0x241e('0x27'),_0x21570d[_0x241e('0x1c')]),_0x21570d);queues[_0x241e('0x26')](_0x21570d);}catch(_0x36b21c){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x27'),_0x21570d['uniqueid']),_0x36b21c);}});ami['on'](_0x241e('0x28'),function(_0x4e14d3){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x29'),_0x4e14d3[_0x241e('0x1c')]),_0x4e14d3);queues[_0x241e('0x28')](_0x4e14d3);calls[_0x241e('0x28')](_0x4e14d3);}catch(_0x242ca8){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x29'),_0x4e14d3[_0x241e('0x1c')]),_0x242ca8);}});ami['on'](_0x241e('0x2a'),function(_0x10337d){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x2b'),_0x10337d[_0x241e('0x1c')]),_0x10337d);queues[_0x241e('0x2a')](_0x10337d);calls[_0x241e('0x2a')](_0x10337d);}catch(_0x141ed6){utils[_0x241e('0x13')](util[_0x241e('0x17')]('[%s][index][musiconholdstop]',_0x10337d[_0x241e('0x1c')]),_0x141ed6);}});ami['on'](_0x241e('0x2c'),function(_0x32ebf5){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x2d'),_0x32ebf5[_0x241e('0x1c')]),_0x32ebf5);calls[_0x241e('0x2c')](_0x32ebf5);recordings['newstate'](_0x32ebf5);}catch(_0x2d52d9){utils[_0x241e('0x13')](util['format'](_0x241e('0x2d'),_0x32ebf5['uniqueid']),_0x2d52d9);}});ami['on'](_0x241e('0x2e'),function(_0x5c0b5a){try{utils['debug'](util['format'](_0x241e('0x2f'),_0x5c0b5a[_0x241e('0x1c')]),_0x5c0b5a);calls[_0x241e('0x2e')](_0x5c0b5a);recordings['hangup'](_0x5c0b5a);dials['hangup'](_0x5c0b5a);agents[_0x241e('0x2e')](_0x5c0b5a);queues['hangup'](_0x5c0b5a);}catch(_0x4de506){utils[_0x241e('0x13')](util['format'](_0x241e('0x2f'),_0x5c0b5a[_0x241e('0x1c')]),_0x4de506);}});ami['on']('cdr',function(_0x3ab73b){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x30'),_0x3ab73b[_0x241e('0x1c')]),_0x3ab73b);members[_0x241e('0x31')](_0x3ab73b);}catch(_0x5df77d){utils['error'](util[_0x241e('0x17')](_0x241e('0x30'),_0x3ab73b[_0x241e('0x1c')]),_0x5df77d);}});ami['on'](_0x241e('0x32'),function(_0x4c5e59){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x33'),_0x4c5e59['uniqueid']),_0x4c5e59);queues[_0x241e('0x32')](_0x4c5e59);agents['blindtransfer'](_0x4c5e59);transfers[_0x241e('0x32')](_0x4c5e59);}catch(_0x65b8ca){utils[_0x241e('0x13')](util[_0x241e('0x17')]('[%s][index][blindtransfer]',_0x4c5e59[_0x241e('0x1c')]),_0x65b8ca);}});ami['on'](_0x241e('0x34'),function(_0x144afd){try{utils[_0x241e('0x1b')](util['format'](_0x241e('0x35'),_0x144afd[_0x241e('0x36')]),_0x144afd);queues[_0x241e('0x34')](_0x144afd);transfers['attendedtransfer'](_0x144afd);agents[_0x241e('0x34')](_0x144afd);calls[_0x241e('0x34')](_0x144afd);}catch(_0x48d456){utils['error'](util[_0x241e('0x17')]('[%s][index][attendedtransfer]',_0x144afd['origtransfereruniqueid']),_0x48d456);}});ami['on'](_0x241e('0x37'),function(_0x20e21f){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x38'),_0x20e21f[_0x241e('0x1c')]),_0x20e21f);queues[_0x241e('0x37')](_0x20e21f);recordings[_0x241e('0x37')](_0x20e21f);calls[_0x241e('0x37')](_0x20e21f);dials[_0x241e('0x37')](_0x20e21f);}catch(_0x52434b){utils[_0x241e('0x13')](util[_0x241e('0x17')](_0x241e('0x38'),_0x20e21f['uniqueid']),_0x52434b);}});ami['on'](_0x241e('0x39'),function(_0x3379cd){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x3a'),_0x3379cd[_0x241e('0x1c')]),_0x3379cd);calls[_0x241e('0x39')](_0x3379cd);recordings[_0x241e('0x39')](_0x3379cd);dials['newexten'](_0x3379cd);}catch(_0x4764f8){utils['error'](util[_0x241e('0x17')](_0x241e('0x3a'),_0x3379cd[_0x241e('0x1c')]),_0x4764f8);}});ami['on'](_0x241e('0x3b'),function(_0x5c0c82){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x3c'),_0x5c0c82['uniqueid']),_0x5c0c82);calls[_0x241e('0x3b')](_0x5c0c82);recordings[_0x241e('0x3b')](_0x5c0c82);}catch(_0x4f72fe){utils[_0x241e('0x13')](util[_0x241e('0x17')]('[%s][index][newchannel]',_0x5c0c82[_0x241e('0x1c')]),_0x4f72fe);}});ami['on'](_0x241e('0x3d'),function(_0x46c693){try{utils[_0x241e('0x1b')](util['format'](_0x241e('0x3e'),_0x46c693[_0x241e('0x1c')]),_0x46c693);dials['dialbegin'](_0x46c693);}catch(_0x4112fb){utils[_0x241e('0x13')](util['format'](_0x241e('0x3f'),_0x46c693['uniqueid']),_0x4112fb);}});ami['on'](_0x241e('0x40'),function(_0x296960){try{utils[_0x241e('0x1b')](util[_0x241e('0x17')](_0x241e('0x41'),_0x296960[_0x241e('0x1c')]),_0x296960);dials[_0x241e('0x40')](_0x296960);}catch(_0x5b501c){utils['error'](util[_0x241e('0x17')](_0x241e('0x41'),_0x296960[_0x241e('0x1c')]),_0x5b501c);}});} \ No newline at end of file +var _0x4f39=['agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','keepConnected','xdr','info','./agents.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer'];(function(_0x15b411,_0x56544a){var _0x1040e9=function(_0x47c755){while(--_0x47c755){_0x15b411['push'](_0x15b411['shift']());}};_0x1040e9(++_0x56544a);}(_0x4f39,0x173));var _0x94f3=function(_0x7f14e6,_0x43cdb8){_0x7f14e6=_0x7f14e6-0x0;var _0x32e5a9=_0x4f39[_0x7f14e6];return _0x32e5a9;};var AsteriskManager=require(_0x94f3('0x0'));var config=require(_0x94f3('0x1'));var utils=require(_0x94f3('0x2'));var util=require(_0x94f3('0x3'));var ami=new AsteriskManager(config[_0x94f3('0x4')][_0x94f3('0x5')],config[_0x94f3('0x4')]['ip'],config[_0x94f3('0x4')][_0x94f3('0x6')],config[_0x94f3('0x4')][_0x94f3('0x7')],!![]);ami[_0x94f3('0x8')]();if(config[_0x94f3('0x9')]&&config[_0x94f3('0x9')]['disabled']){utils[_0x94f3('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0x94f3('0xb'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x94f3('0xc'));var members=require(_0x94f3('0xd'));var dials=require('./dials.controller');var transfers=require(_0x94f3('0xe'));var core=require(_0x94f3('0xf'));ami['on'](_0x94f3('0x10'),core[_0x94f3('0x10')]);ami['on'](_0x94f3('0x11'),core[_0x94f3('0x11')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x94f3('0x12'),core[_0x94f3('0x12')]);ami['on']('close',core[_0x94f3('0x13')]);ami['on'](_0x94f3('0x14'),core[_0x94f3('0x14')]);ami['on'](_0x94f3('0x15'),function(_0x5d64ee){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x18'),_0x5d64ee[_0x94f3('0x19')]),_0x5d64ee);members[_0x94f3('0x15')](_0x5d64ee);}catch(_0x227a3d){utils[_0x94f3('0x12')](util[_0x94f3('0x17')]('[%s][index][devicestatechange]',_0x5d64ee[_0x94f3('0x19')]),_0x227a3d);}});ami['on'](_0x94f3('0x1a'),function(_0x5731bc){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x1b'),_0x5731bc[_0x94f3('0x1c')]),_0x5731bc);agents['agentcalled'](_0x5731bc);}catch(_0x46623a){utils[_0x94f3('0x12')](util['format'](_0x94f3('0x1b'),_0x5731bc['uniqueid']),_0x46623a);}});ami['on']('agentringnoanswer',function(_0xd3f4fd){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x1d'),_0xd3f4fd[_0x94f3('0x1c')]),_0xd3f4fd);agents[_0x94f3('0x1e')](_0xd3f4fd);}catch(_0x2f0de3){utils[_0x94f3('0x12')](util['format'](_0x94f3('0x1d'),_0xd3f4fd[_0x94f3('0x1c')]),_0x2f0de3);}});ami['on'](_0x94f3('0x1f'),function(_0x28228a){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')]('[%s][index][agentconnect]',_0x28228a[_0x94f3('0x1c')]),_0x28228a);agents['agentconnect'](_0x28228a);queues[_0x94f3('0x1f')](_0x28228a);}catch(_0xea7f20){utils[_0x94f3('0x12')](util['format'](_0x94f3('0x20'),_0x28228a['uniqueid']),_0xea7f20);}});ami['on'](_0x94f3('0x21'),function(_0x5cd270){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x22'),_0x5cd270[_0x94f3('0x1c')]),_0x5cd270);agents[_0x94f3('0x21')](_0x5cd270);queues[_0x94f3('0x21')](_0x5cd270);members[_0x94f3('0x21')](_0x5cd270);}catch(_0x58723d){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x22'),_0x5cd270[_0x94f3('0x1c')]),_0x58723d);}});ami['on']('queuecallerabandon',function(_0x4b0e5e){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x23'),_0x4b0e5e[_0x94f3('0x1c')]),_0x4b0e5e);agents[_0x94f3('0x24')](_0x4b0e5e);queues[_0x94f3('0x24')](_0x4b0e5e);}catch(_0x4320e7){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x23'),_0x4b0e5e[_0x94f3('0x1c')]),_0x4320e7);}});ami['on']('queuecallerjoin',function(_0x42862c){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x25'),_0x42862c['uniqueid']),_0x42862c);queues['queuecallerjoin'](_0x42862c);recordings[_0x94f3('0x26')](_0x42862c);}catch(_0x5aa991){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x25'),_0x42862c['uniqueid']),_0x5aa991);}});ami['on'](_0x94f3('0x27'),function(_0x48ff37){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x28'),_0x48ff37[_0x94f3('0x1c')]),_0x48ff37);queues[_0x94f3('0x27')](_0x48ff37);}catch(_0xbdfd8d){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x28'),_0x48ff37[_0x94f3('0x1c')]),_0xbdfd8d);}});ami['on'](_0x94f3('0x29'),function(_0x22cfc7){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x2a'),_0x22cfc7[_0x94f3('0x1c')]),_0x22cfc7);queues[_0x94f3('0x29')](_0x22cfc7);calls[_0x94f3('0x29')](_0x22cfc7);}catch(_0x373e0f){utils[_0x94f3('0x12')](util[_0x94f3('0x17')]('[%s][index][musiconholdstart]',_0x22cfc7[_0x94f3('0x1c')]),_0x373e0f);}});ami['on'](_0x94f3('0x2b'),function(_0x4a3652){try{utils[_0x94f3('0x16')](util['format'](_0x94f3('0x2c'),_0x4a3652['uniqueid']),_0x4a3652);queues[_0x94f3('0x2b')](_0x4a3652);calls['musiconholdstop'](_0x4a3652);}catch(_0x25a8c5){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x2c'),_0x4a3652[_0x94f3('0x1c')]),_0x25a8c5);}});ami['on']('newstate',function(_0x594e62){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')]('[%s][index][newstate]',_0x594e62[_0x94f3('0x1c')]),_0x594e62);calls[_0x94f3('0x2d')](_0x594e62);recordings[_0x94f3('0x2d')](_0x594e62);}catch(_0x409553){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x2e'),_0x594e62['uniqueid']),_0x409553);}});ami['on'](_0x94f3('0x2f'),function(_0x18d222){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x30'),_0x18d222[_0x94f3('0x1c')]),_0x18d222);calls[_0x94f3('0x2f')](_0x18d222);recordings[_0x94f3('0x2f')](_0x18d222);dials[_0x94f3('0x2f')](_0x18d222);agents['hangup'](_0x18d222);queues[_0x94f3('0x2f')](_0x18d222);}catch(_0xcd4a73){utils[_0x94f3('0x12')](util[_0x94f3('0x17')]('[%s][index][hangup]',_0x18d222[_0x94f3('0x1c')]),_0xcd4a73);}});ami['on'](_0x94f3('0x31'),function(_0x59d4bb){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')](_0x94f3('0x32'),_0x59d4bb[_0x94f3('0x1c')]),_0x59d4bb);members[_0x94f3('0x31')](_0x59d4bb);}catch(_0x4d93b8){utils[_0x94f3('0x12')](util[_0x94f3('0x17')]('[%s][index][cdr]',_0x59d4bb[_0x94f3('0x1c')]),_0x4d93b8);}});ami['on']('blindtransfer',function(_0x5571aa){try{utils[_0x94f3('0x16')](util['format'](_0x94f3('0x33'),_0x5571aa[_0x94f3('0x1c')]),_0x5571aa);queues[_0x94f3('0x34')](_0x5571aa);agents[_0x94f3('0x34')](_0x5571aa);transfers[_0x94f3('0x34')](_0x5571aa);}catch(_0x378480){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x33'),_0x5571aa[_0x94f3('0x1c')]),_0x378480);}});ami['on'](_0x94f3('0x35'),function(_0x48d8cf){try{utils[_0x94f3('0x16')](util[_0x94f3('0x17')]('[%s][index][attendedtransfer]',_0x48d8cf['origtransfereruniqueid']),_0x48d8cf);queues['attendedtransfer'](_0x48d8cf);transfers[_0x94f3('0x35')](_0x48d8cf);agents[_0x94f3('0x35')](_0x48d8cf);calls[_0x94f3('0x35')](_0x48d8cf);}catch(_0x137601){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x36'),_0x48d8cf[_0x94f3('0x37')]),_0x137601);}});ami['on'](_0x94f3('0x38'),function(_0xd79244){try{utils['debug'](util['format'](_0x94f3('0x39'),_0xd79244[_0x94f3('0x1c')]),_0xd79244);queues['varset'](_0xd79244);recordings[_0x94f3('0x38')](_0xd79244);calls[_0x94f3('0x38')](_0xd79244);dials[_0x94f3('0x38')](_0xd79244);}catch(_0x298935){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x39'),_0xd79244[_0x94f3('0x1c')]),_0x298935);}});ami['on'](_0x94f3('0x3a'),function(_0x4b07bf){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x3b'),_0x4b07bf['uniqueid']),_0x4b07bf);calls[_0x94f3('0x3a')](_0x4b07bf);recordings[_0x94f3('0x3a')](_0x4b07bf);dials['newexten'](_0x4b07bf);}catch(_0x3905ac){utils[_0x94f3('0x12')](util[_0x94f3('0x17')](_0x94f3('0x3b'),_0x4b07bf[_0x94f3('0x1c')]),_0x3905ac);}});ami['on']('newchannel',function(_0x217ad2){try{utils['debug'](util['format'](_0x94f3('0x3c'),_0x217ad2[_0x94f3('0x1c')]),_0x217ad2);calls[_0x94f3('0x3d')](_0x217ad2);recordings[_0x94f3('0x3d')](_0x217ad2);}catch(_0x412ba3){utils[_0x94f3('0x12')](util['format']('[%s][index][newchannel]',_0x217ad2['uniqueid']),_0x412ba3);}});ami['on'](_0x94f3('0x3e'),function(_0x4b1c13){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x3f'),_0x4b1c13['uniqueid']),_0x4b1c13);dials[_0x94f3('0x3e')](_0x4b1c13);}catch(_0xa36d37){utils[_0x94f3('0x12')](util['format'](_0x94f3('0x40'),_0x4b1c13[_0x94f3('0x1c')]),_0xa36d37);}});ami['on']('dialend',function(_0x35e20f){try{utils['debug'](util[_0x94f3('0x17')](_0x94f3('0x41'),_0x35e20f[_0x94f3('0x1c')]),_0x35e20f);dials[_0x94f3('0x42')](_0x35e20f);}catch(_0x59307d){utils['error'](util[_0x94f3('0x17')]('[%s][index][dialend]',_0x35e20f[_0x94f3('0x1c')]),_0x59307d);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 43d6bfa..d3b04ca 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 _0xf6fb=['voice','TALKING','agent','NOT_INUSE','isNil','exitAt','now','duration','diffTime','uniqueid','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','debug','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','name','internal','getUserByName','split','CreateMemberReport','catch','error','format','[%s][members][writeDB]','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE'];(function(_0x3af5c7,_0x44a47a){var _0xe598ea=function(_0x23b5f8){while(--_0x23b5f8){_0x3af5c7['push'](_0x3af5c7['shift']());}};_0xe598ea(++_0x44a47a);}(_0xf6fb,0x111));var _0xbf6f=function(_0x547ef1,_0x27f1ae){_0x547ef1=_0x547ef1-0x0;var _0x44b3c3=_0xf6fb[_0x547ef1];return _0x44b3c3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xbf6f('0x0'));var members={};var exclude=[_0xbf6f('0x1'),'Queue:'];function writeDB(_0x270dda){utils[_0xbf6f('0x2')](util['format'](_0xbf6f('0x3'),_0x270dda['uniqueid'],_0x270dda[_0xbf6f('0x4')],_0x270dda[_0xbf6f('0x5')],_0x270dda[_0xbf6f('0x6')],_0x270dda[_0xbf6f('0x7')],_0x270dda[_0xbf6f('0x8')]));if(_0x270dda[_0xbf6f('0x4')]){utils[_0xbf6f('0x9')](_0x270dda[_0xbf6f('0x4')])['then'](function(_0x3ba855){if(_0x3ba855){_0x270dda[_0xbf6f('0x7')]=_0x3ba855[_0xbf6f('0xa')];_0x270dda[_0xbf6f('0xb')]=_0x3ba855[_0xbf6f('0xb')];utils['request']('CreateMemberReport',_0x270dda);}else{utils[_0xbf6f('0xc')](_0x270dda[_0xbf6f('0x4')][_0xbf6f('0xd')]('/')[0x1])['then'](function(_0x3455f8){if(_0x3455f8){_0x270dda['membername']=_0x3455f8[_0xbf6f('0xa')];_0x270dda[_0xbf6f('0xb')]=_0x3455f8[_0xbf6f('0xb')];utils['request'](_0xbf6f('0xe'),_0x270dda);}});}})[_0xbf6f('0xf')](function(_0x1cf07a){utils[_0xbf6f('0x10')](util[_0xbf6f('0x11')](_0xbf6f('0x12'),_0x270dda['uniqueid']),_0x1cf07a);});}delete members[_0x270dda[_0xbf6f('0x4')]];}function startsWith(_0x3f1c33,_0x473d32){return _[_0xbf6f('0x13')](_0x3f1c33,function(_0x270ec6){return _[_0xbf6f('0x14')](_0x473d32,_0x270ec6);});}exports[_0xbf6f('0x15')]=function(_0x586f33){try{utils['debug'](util[_0xbf6f('0x11')](_0xbf6f('0x16'),members[_0x586f33[_0xbf6f('0x17')]]?members[_0x586f33['device']]['uniqueid']:_0x586f33[_0xbf6f('0x17')]),_0x586f33);utils[_0xbf6f('0x2')](util[_0xbf6f('0x11')](_0xbf6f('0x18'),members[_0x586f33[_0xbf6f('0x17')]]?members[_0x586f33['device']]['uniqueid']:_0x586f33[_0xbf6f('0x17')],_0x586f33['state'],_0x586f33[_0xbf6f('0x17')]));switch(_0x586f33[_0xbf6f('0x19')]){case _0xbf6f('0x1a'):case'BUSY':if(!startsWith(exclude,_0x586f33[_0xbf6f('0x17')])){members[_0x586f33[_0xbf6f('0x17')]]={'channel':_0xbf6f('0x1b'),'interface':_0x586f33['device'],'type':_0xbf6f('0x1c'),'enterAt':utils['now'](),'role':_0xbf6f('0x1d')};}break;case _0xbf6f('0x1e'):if(!_[_0xbf6f('0x1f')](members[_0x586f33['device']])){members[_0x586f33[_0xbf6f('0x17')]][_0xbf6f('0x20')]=utils[_0xbf6f('0x21')]();members[_0x586f33[_0xbf6f('0x17')]][_0xbf6f('0x22')]=utils[_0xbf6f('0x23')](members[_0x586f33['device']][_0xbf6f('0x20')],members[_0x586f33[_0xbf6f('0x17')]]['enterAt']);if(members[_0x586f33['device']]['uniqueid']){writeDB(members[_0x586f33[_0xbf6f('0x17')]]);}}break;default:break;}}catch(_0x588fbe){utils[_0xbf6f('0x10')](util[_0xbf6f('0x11')](_0xbf6f('0x16'),members[_0x586f33[_0xbf6f('0x17')]]?members[_0x586f33[_0xbf6f('0x17')]][_0xbf6f('0x24')]:_0x586f33[_0xbf6f('0x17')]),_0x588fbe);}};exports['agentcomplete']=function(_0x5dd4f6){try{if(!_[_0xbf6f('0x1f')](members[_0x5dd4f6[_0xbf6f('0x4')]])){utils['debug'](util[_0xbf6f('0x11')]('[%s][members][agentcomplete]',_0x5dd4f6[_0xbf6f('0x24')]),_0x5dd4f6);utils[_0xbf6f('0x2')](util[_0xbf6f('0x11')](_0xbf6f('0x25'),_0x5dd4f6[_0xbf6f('0x24')],_0x5dd4f6[_0xbf6f('0x4')],_0x5dd4f6[_0xbf6f('0x26')]));members[_0x5dd4f6[_0xbf6f('0x4')]]=_[_0xbf6f('0x27')](members[_0x5dd4f6[_0xbf6f('0x4')]],{'data4':_0x5dd4f6['queue'],'uniqueid':_0x5dd4f6['uniqueid']});}}catch(_0x35b1b2){utils[_0xbf6f('0x10')](util[_0xbf6f('0x11')](_0xbf6f('0x28'),_0x5dd4f6['uniqueid']),_0x35b1b2);}};exports[_0xbf6f('0x29')]=function(_0x1cd9fc){try{utils[_0xbf6f('0x2a')](util[_0xbf6f('0x11')](_0xbf6f('0x2b'),_0x1cd9fc['uniqueid']),_0x1cd9fc);if(_0x1cd9fc[_0xbf6f('0x5')]){var _0x39f2b1=_0x1cd9fc[_0xbf6f('0x5')]['split']('-')[0x0];if(!_[_0xbf6f('0x1f')](members[_0x39f2b1])){members[_0x39f2b1]=_['assign'](members[_0x39f2b1],{'data1':members[_0x39f2b1][_0xbf6f('0x2c')]||_0x1cd9fc[_0xbf6f('0x8')],'data2':members[_0x39f2b1][_0xbf6f('0x6')]||_0x1cd9fc[_0xbf6f('0x2d')],'data3':members[_0x39f2b1][_0xbf6f('0x2e')]||_0x1cd9fc[_0xbf6f('0x2f')],'uniqueid':members[_0x39f2b1][_0xbf6f('0x24')]||_0x1cd9fc[_0xbf6f('0x24')]});utils[_0xbf6f('0x2')](util[_0xbf6f('0x11')](_0xbf6f('0x30'),_0x1cd9fc[_0xbf6f('0x24')],members[_0x39f2b1]['data1'],members[_0x39f2b1][_0xbf6f('0x6')],members[_0x39f2b1][_0xbf6f('0x2e')]));if(members[_0x39f2b1][_0xbf6f('0x20')]){writeDB(members[_0x39f2b1]);}}}if(_0x1cd9fc[_0xbf6f('0x31')]){var _0xb8dd6d=_0x1cd9fc[_0xbf6f('0x31')][_0xbf6f('0xd')]('-')[0x0];if(!_['isNil'](members[_0xb8dd6d])){members[_0xb8dd6d]=_[_0xbf6f('0x27')](members[_0xb8dd6d],{'data1':members[_0xb8dd6d][_0xbf6f('0x2c')]||_0x1cd9fc[_0xbf6f('0x8')],'data2':members[_0xb8dd6d]['data2']||_0x1cd9fc[_0xbf6f('0x2d')],'data3':members[_0xb8dd6d][_0xbf6f('0x2e')]||_0x1cd9fc[_0xbf6f('0x2f')],'uniqueid':members[_0xb8dd6d]['uniqueid']||_0x1cd9fc[_0xbf6f('0x24')]});utils[_0xbf6f('0x2')](util[_0xbf6f('0x11')](_0xbf6f('0x30'),_0x1cd9fc[_0xbf6f('0x24')],members[_0xb8dd6d][_0xbf6f('0x2c')],members[_0xb8dd6d][_0xbf6f('0x6')],members[_0xb8dd6d][_0xbf6f('0x2e')]));if(members[_0xb8dd6d][_0xbf6f('0x20')]){writeDB(members[_0xb8dd6d]);}}}}catch(_0x3c2de2){utils[_0xbf6f('0x10')](util[_0xbf6f('0x11')](_0xbf6f('0x2b'),_0x1cd9fc[_0xbf6f('0x24')]),_0x3c2de2);}}; \ No newline at end of file +var _0x6ff5=['duration','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','data1','lodash','Queue:','info','format','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','debug','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6ff5,0xab));var _0x56ff=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x6ff5[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x56ff('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=['Local/_attended@transfer',_0x56ff('0x1')];function writeDB(_0x5734b7){utils[_0x56ff('0x2')](util[_0x56ff('0x3')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x5734b7['uniqueid'],_0x5734b7[_0x56ff('0x4')],_0x5734b7[_0x56ff('0x5')],_0x5734b7[_0x56ff('0x6')],_0x5734b7[_0x56ff('0x7')],_0x5734b7[_0x56ff('0x8')]));if(_0x5734b7[_0x56ff('0x4')]){utils[_0x56ff('0x9')](_0x5734b7[_0x56ff('0x4')])[_0x56ff('0xa')](function(_0x46eedb){if(_0x46eedb){_0x5734b7[_0x56ff('0x7')]=_0x46eedb[_0x56ff('0xb')];_0x5734b7[_0x56ff('0xc')]=_0x46eedb[_0x56ff('0xc')];utils[_0x56ff('0xd')](_0x56ff('0xe'),_0x5734b7);}else{utils[_0x56ff('0xf')](_0x5734b7[_0x56ff('0x4')][_0x56ff('0x10')]('/')[0x1])[_0x56ff('0xa')](function(_0x35426b){if(_0x35426b){_0x5734b7[_0x56ff('0x7')]=_0x35426b[_0x56ff('0xb')];_0x5734b7[_0x56ff('0xc')]=_0x35426b[_0x56ff('0xc')];utils[_0x56ff('0xd')](_0x56ff('0xe'),_0x5734b7);}});}})[_0x56ff('0x11')](function(_0x3fe824){utils[_0x56ff('0x12')](util[_0x56ff('0x3')](_0x56ff('0x13'),_0x5734b7[_0x56ff('0x14')]),_0x3fe824);});}delete members[_0x5734b7['interface']];}function startsWith(_0x3d07b0,_0x1e1af2){return _[_0x56ff('0x15')](_0x3d07b0,function(_0x7d9092){return _[_0x56ff('0x16')](_0x1e1af2,_0x7d9092);});}exports['devicestatechange']=function(_0x59c1f5){try{utils[_0x56ff('0x17')](util[_0x56ff('0x3')]('[%s][members][devicestatechange]',members[_0x59c1f5[_0x56ff('0x18')]]?members[_0x59c1f5[_0x56ff('0x18')]][_0x56ff('0x14')]:_0x59c1f5[_0x56ff('0x18')]),_0x59c1f5);utils['info'](util[_0x56ff('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x59c1f5[_0x56ff('0x18')]]?members[_0x59c1f5[_0x56ff('0x18')]][_0x56ff('0x14')]:_0x59c1f5['device'],_0x59c1f5[_0x56ff('0x19')],_0x59c1f5[_0x56ff('0x18')]));switch(_0x59c1f5[_0x56ff('0x19')]){case _0x56ff('0x1a'):case _0x56ff('0x1b'):if(!startsWith(exclude,_0x59c1f5[_0x56ff('0x18')])){members[_0x59c1f5[_0x56ff('0x18')]]={'channel':_0x56ff('0x1c'),'interface':_0x59c1f5[_0x56ff('0x18')],'type':_0x56ff('0x1d'),'enterAt':utils[_0x56ff('0x1e')](),'role':_0x56ff('0x1f')};}break;case _0x56ff('0x20'):if(!_['isNil'](members[_0x59c1f5[_0x56ff('0x18')]])){members[_0x59c1f5['device']]['exitAt']=utils['now']();members[_0x59c1f5['device']][_0x56ff('0x21')]=utils[_0x56ff('0x22')](members[_0x59c1f5[_0x56ff('0x18')]][_0x56ff('0x23')],members[_0x59c1f5[_0x56ff('0x18')]][_0x56ff('0x24')]);if(members[_0x59c1f5['device']][_0x56ff('0x14')]){writeDB(members[_0x59c1f5[_0x56ff('0x18')]]);}}break;default:break;}}catch(_0x9fe97c){utils[_0x56ff('0x12')](util[_0x56ff('0x3')](_0x56ff('0x25'),members[_0x59c1f5[_0x56ff('0x18')]]?members[_0x59c1f5[_0x56ff('0x18')]][_0x56ff('0x14')]:_0x59c1f5['device']),_0x9fe97c);}};exports[_0x56ff('0x26')]=function(_0x470a6c){try{if(!_[_0x56ff('0x27')](members[_0x470a6c[_0x56ff('0x4')]])){utils[_0x56ff('0x17')](util[_0x56ff('0x3')](_0x56ff('0x28'),_0x470a6c['uniqueid']),_0x470a6c);utils['info'](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x470a6c[_0x56ff('0x14')],_0x470a6c['interface'],_0x470a6c[_0x56ff('0x29')]));members[_0x470a6c[_0x56ff('0x4')]]=_[_0x56ff('0x2a')](members[_0x470a6c['interface']],{'data4':_0x470a6c[_0x56ff('0x29')],'uniqueid':_0x470a6c[_0x56ff('0x14')]});}}catch(_0x2655e1){utils['error'](util[_0x56ff('0x3')](_0x56ff('0x28'),_0x470a6c['uniqueid']),_0x2655e1);}};exports[_0x56ff('0x2b')]=function(_0x1c9ac5){try{utils[_0x56ff('0x17')](util[_0x56ff('0x3')](_0x56ff('0x2c'),_0x1c9ac5[_0x56ff('0x14')]),_0x1c9ac5);if(_0x1c9ac5[_0x56ff('0x5')]){var _0x35973f=_0x1c9ac5['channel'][_0x56ff('0x10')]('-')[0x0];if(!_[_0x56ff('0x27')](members[_0x35973f])){members[_0x35973f]=_[_0x56ff('0x2a')](members[_0x35973f],{'data1':members[_0x35973f]['data1']||_0x1c9ac5[_0x56ff('0x8')],'data2':members[_0x35973f][_0x56ff('0x6')]||_0x1c9ac5[_0x56ff('0x2d')],'data3':members[_0x35973f][_0x56ff('0x2e')]||_0x1c9ac5['destination'],'uniqueid':members[_0x35973f][_0x56ff('0x14')]||_0x1c9ac5['uniqueid']});utils[_0x56ff('0x2')](util[_0x56ff('0x3')](_0x56ff('0x2f'),_0x1c9ac5[_0x56ff('0x14')],members[_0x35973f]['data1'],members[_0x35973f][_0x56ff('0x6')],members[_0x35973f][_0x56ff('0x2e')]));if(members[_0x35973f][_0x56ff('0x23')]){writeDB(members[_0x35973f]);}}}if(_0x1c9ac5['destinationchannel']){var _0x26cc88=_0x1c9ac5[_0x56ff('0x30')][_0x56ff('0x10')]('-')[0x0];if(!_[_0x56ff('0x27')](members[_0x26cc88])){members[_0x26cc88]=_[_0x56ff('0x2a')](members[_0x26cc88],{'data1':members[_0x26cc88]['data1']||_0x1c9ac5[_0x56ff('0x8')],'data2':members[_0x26cc88][_0x56ff('0x6')]||_0x1c9ac5[_0x56ff('0x2d')],'data3':members[_0x26cc88][_0x56ff('0x2e')]||_0x1c9ac5[_0x56ff('0x31')],'uniqueid':members[_0x26cc88]['uniqueid']||_0x1c9ac5[_0x56ff('0x14')]});utils[_0x56ff('0x2')](util['format'](_0x56ff('0x2f'),_0x1c9ac5[_0x56ff('0x14')],members[_0x26cc88][_0x56ff('0x32')],members[_0x26cc88][_0x56ff('0x6')],members[_0x26cc88]['data3']));if(members[_0x26cc88][_0x56ff('0x23')]){writeDB(members[_0x26cc88]);}}}}catch(_0x94cd65){utils['error'](util[_0x56ff('0x3')](_0x56ff('0x2c'),_0x1c9ac5[_0x56ff('0x14')]),_0x94cd65);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 246c003..c239537 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 _0x9034=['queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','TRANSFER','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','transferuniqueid','BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','transfereelinkedid','clone','queuecallerenterreason','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerabandon','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED'];(function(_0x168478,_0x323a27){var _0x29c2f8=function(_0x4f7a8a){while(--_0x4f7a8a){_0x168478['push'](_0x168478['shift']());}};_0x29c2f8(++_0x323a27);}(_0x9034,0x99));var _0x4903=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9034[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x4903('0x0'));var utils=require(_0x4903('0x1'));var queues={};function writeDB(_0x202de7){utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x4'),_0x202de7['uniqueid'],_0x202de7[_0x4903('0x5')],_0x202de7[_0x4903('0x6')],_0x202de7[_0x4903('0x7')],_0x202de7['calleridnum'],_0x202de7['accountcode'],_0x202de7[_0x4903('0x8')]));if(_0x202de7[_0x4903('0x6')]){utils[_0x4903('0x9')](_0x202de7[_0x4903('0x6')])[_0x4903('0xa')](function(_0x514c00){if(_0x514c00){_0x202de7[_0x4903('0xb')]=_0x514c00[_0x4903('0xb')];}utils[_0x4903('0xc')](_0x4903('0xd'),_0x202de7);});}else{utils[_0x4903('0xc')](_0x4903('0xd'),_0x202de7);}if(_0x202de7[_0x4903('0xe')]){delete queues[_0x202de7['transfereduniqueid']];}else{delete queues[_0x202de7[_0x4903('0xf')]];}}exports[_0x4903('0x10')]=function(_0x47d9ce){try{utils[_0x4903('0x11')](util['format'](_0x4903('0x12'),_0x47d9ce[_0x4903('0xf')]),_0x47d9ce);utils['info'](util[_0x4903('0x3')](_0x4903('0x13'),_0x47d9ce['uniqueid'],_0x47d9ce[_0x4903('0x6')],_0x47d9ce[_0x4903('0x14')]));queues[_0x47d9ce['uniqueid']]=_[_0x4903('0x15')](_0x47d9ce,{'originalposition':_0x47d9ce[_0x4903('0x14')],'queuecallerjoinAt':utils[_0x4903('0x16')](),'mohtime':0x0});}catch(_0x14f53d){utils[_0x4903('0x17')](util[_0x4903('0x3')](_0x4903('0x12'),_0x47d9ce[_0x4903('0xf')]),_0x14f53d);}};exports[_0x4903('0x18')]=function(_0x1a26c4){try{if(!_[_0x4903('0x19')](queues[_0x1a26c4['uniqueid']])){utils[_0x4903('0x11')](util[_0x4903('0x3')]('[%s][queues][hangup]',_0x1a26c4[_0x4903('0xf')]),_0x1a26c4);if(queues[_0x1a26c4[_0x4903('0xf')]][_0x4903('0x1a')]){if(!queues[_0x1a26c4['uniqueid']][_0x4903('0x1b')]&&!queues[_0x1a26c4[_0x4903('0xf')]]['queuecallerexit']){queues[_0x1a26c4[_0x4903('0xf')]]['queuecallercomplete']=!![];queues[_0x1a26c4['uniqueid']]['queuecallercompleteAt']=utils[_0x4903('0x16')]();queues[_0x1a26c4[_0x4903('0xf')]][_0x4903('0x8')]='COMPLETEDBYAGENT';}utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x1c'),_0x1a26c4[_0x4903('0xf')],queues[_0x1a26c4[_0x4903('0xf')]][_0x4903('0x1d')],queues[_0x1a26c4[_0x4903('0xf')]][_0x4903('0x8')]));writeDB(queues[_0x1a26c4['uniqueid']]);}else if(queues[_0x1a26c4['uniqueid']][_0x4903('0xe')]){utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x1a26c4[_0x4903('0xf')],queues[_0x1a26c4[_0x4903('0xf')]]['name'],queues[_0x1a26c4['uniqueid']]['transfereduniqueid']));queues[queues[_0x1a26c4[_0x4903('0xf')]][_0x4903('0xe')]]=queues[_0x1a26c4['uniqueid']];queues[queues[_0x1a26c4[_0x4903('0xf')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x1a26c4[_0x4903('0xf')]];}}}catch(_0x5f4775){utils['error'](util[_0x4903('0x3')](_0x4903('0x1e'),_0x1a26c4[_0x4903('0xf')]),_0x5f4775);}};exports[_0x4903('0x1f')]=function(_0x4429ec){try{utils[_0x4903('0x11')](util[_0x4903('0x3')](_0x4903('0x20'),_0x4429ec[_0x4903('0xf')]),_0x4429ec);if(!_['isNil'](_0x4429ec[_0x4903('0x21')][_0x4903('0x22')])&&_0x4429ec[_0x4903('0x23')][_0x4903('0x24')]()!==_0x4903('0x25')){if(!_[_0x4903('0x19')](queues[_0x4429ec[_0x4903('0xf')]])){queues[_0x4429ec[_0x4903('0xf')]]['queuecallerabandon']=![];queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x26')]=null;queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x27')]=!![];queues[_0x4429ec[_0x4903('0xf')]]['queuecallerexitAt']=utils[_0x4903('0x16')]();queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x8')]=_0x4429ec['value'][_0x4903('0x24')]();utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4429ec[_0x4903('0xf')],queues[_0x4429ec['uniqueid']]['name'],_0x4429ec[_0x4903('0x23')],queues[_0x4429ec[_0x4903('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x4429ec['uniqueid']]);}}else if(!_[_0x4903('0x19')](_0x4429ec[_0x4903('0x21')]['queueposition'])){if(!_['isNil'](queues[_0x4429ec['uniqueid']])&&!queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x1b')]){queues[_0x4429ec[_0x4903('0xf')]]['queuecallerabandon']=![];queues[_0x4429ec['uniqueid']][_0x4903('0x26')]=null;queues[_0x4429ec['uniqueid']]['queuecallerexit']=!![];queues[_0x4429ec['uniqueid']][_0x4903('0x28')]=utils[_0x4903('0x16')]();queues[_0x4429ec['uniqueid']][_0x4903('0x8')]=_0x4903('0x29');utils['info'](util[_0x4903('0x3')](_0x4903('0x2a'),_0x4429ec[_0x4903('0xf')],queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x1d')],_0x4429ec[_0x4903('0x23')],queues[_0x4429ec[_0x4903('0xf')]][_0x4903('0x8')]));}}}catch(_0x543adc){utils[_0x4903('0x17')](util['format']('[%s][queues][varset]',_0x4429ec['uniqueid']),_0x543adc);}};exports[_0x4903('0x1b')]=function(_0x510d89){try{if(!_[_0x4903('0x19')](queues[_0x510d89[_0x4903('0xf')]])){utils['debug'](util[_0x4903('0x3')](_0x4903('0x2b'),_0x510d89['uniqueid']),_0x510d89);queues[_0x510d89[_0x4903('0xf')]][_0x4903('0x27')]=![];queues[_0x510d89[_0x4903('0xf')]][_0x4903('0x28')]=null;queues[_0x510d89['uniqueid']][_0x4903('0x1b')]=!![];queues[_0x510d89['uniqueid']][_0x4903('0x26')]=utils[_0x4903('0x16')]();queues[_0x510d89[_0x4903('0xf')]]['queuecallerexitreason']=_0x4903('0x2c');utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x510d89[_0x4903('0xf')],queues[_0x510d89['uniqueid']][_0x4903('0x1d')],queues[_0x510d89['uniqueid']][_0x4903('0x8')]));}}catch(_0x45a869){utils[_0x4903('0x17')](util[_0x4903('0x3')]('[%s][queues][queuecallerabandon]',_0x510d89[_0x4903('0xf')]),_0x45a869);}};exports[_0x4903('0x2d')]=function(_0x48fc84){try{if(!_[_0x4903('0x19')](queues[_0x48fc84['uniqueid']])){utils[_0x4903('0x11')](util[_0x4903('0x3')](_0x4903('0x2e'),_0x48fc84[_0x4903('0xf')]),_0x48fc84);utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x48fc84[_0x4903('0xf')],queues[_0x48fc84[_0x4903('0xf')]]['name'],_0x48fc84[_0x4903('0x2f')],_0x48fc84[_0x4903('0x30')]));queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x2d')]=!![];queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x1a')]=utils['now']();queues[_0x48fc84['uniqueid']][_0x4903('0x31')]=utils[_0x4903('0x32')](queues[_0x48fc84[_0x4903('0xf')]]['queuecallerleaveAt'],queues[_0x48fc84[_0x4903('0xf')]]['queuecallerjoinAt']);queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x14')]=_0x48fc84[_0x4903('0x14')];queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x33')]=_0x48fc84[_0x4903('0x33')];queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x2f')]=_0x48fc84['connectedlinenum'];queues[_0x48fc84[_0x4903('0xf')]][_0x4903('0x30')]=_0x48fc84['connectedlinename'];}}catch(_0x569a80){utils[_0x4903('0x17')](util['format']('[%s][queues][queuecallerleave]',_0x48fc84[_0x4903('0xf')]),_0x569a80);}};exports[_0x4903('0x34')]=function(_0x1b6f55){try{if(!_['isNil'](queues[_0x1b6f55[_0x4903('0xf')]])){utils['debug'](util[_0x4903('0x3')](_0x4903('0x35'),_0x1b6f55[_0x4903('0xf')]),_0x1b6f55);utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1b6f55['uniqueid'],queues[_0x1b6f55['uniqueid']][_0x4903('0x1d')],_0x1b6f55[_0x4903('0x36')],_0x1b6f55[_0x4903('0x37')]));queues[_0x1b6f55['uniqueid']][_0x4903('0x1b')]=![];queues[_0x1b6f55[_0x4903('0xf')]][_0x4903('0x1b')]=![];queues[_0x1b6f55[_0x4903('0xf')]]['queuecallerabandonAt']=null;queues[_0x1b6f55[_0x4903('0xf')]]['queuecallerexit']=![];queues[_0x1b6f55[_0x4903('0xf')]][_0x4903('0x8')]=null;queues[_0x1b6f55[_0x4903('0xf')]][_0x4903('0x28')]=null;queues[_0x1b6f55['uniqueid']][_0x4903('0x38')]=!![];queues[_0x1b6f55['uniqueid']]['accountcode']=_0x1b6f55[_0x4903('0x37')];queues[_0x1b6f55[_0x4903('0xf')]][_0x4903('0x7')]=_0x1b6f55['membername'];}}catch(_0x5ca2ce){utils[_0x4903('0x17')](util['format'](_0x4903('0x35'),_0x1b6f55[_0x4903('0xf')]),_0x5ca2ce);}};exports['agentcomplete']=function(_0x8f1988){try{if(!_[_0x4903('0x19')](queues[_0x8f1988['uniqueid']])){if(queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x1a')]){utils[_0x4903('0x11')](util[_0x4903('0x3')](_0x4903('0x39'),_0x8f1988['uniqueid']),_0x8f1988);queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x1b')]=![];queues[_0x8f1988['uniqueid']][_0x4903('0x1b')]=![];queues[_0x8f1988[_0x4903('0xf')]]['queuecallerabandonAt']=null;queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x27')]=![];queues[_0x8f1988[_0x4903('0xf')]]['queuecallerexitAt']=null;queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x38')]=!![];queues[_0x8f1988['uniqueid']][_0x4903('0x7')]=_0x8f1988[_0x4903('0x36')];queues[_0x8f1988['uniqueid']][_0x4903('0x3a')]=!![];queues[_0x8f1988[_0x4903('0xf')]]['queuecallercompleteAt']=utils['now']();if(_0x8f1988[_0x4903('0x3b')]==_0x4903('0x3c')){if(!queues[_0x8f1988['uniqueid']][_0x4903('0x3c')]){queues[_0x8f1988['uniqueid']][_0x4903('0x8')]=_0x4903('0x3d');}}else{queues[_0x8f1988[_0x4903('0xf')]]['queuecallerexitreason']='COMPLETEDBY'+_0x8f1988[_0x4903('0x3b')][_0x4903('0x24')]();}utils['info'](util[_0x4903('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x8f1988[_0x4903('0xf')],queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x1d')],_0x8f1988['membername'],queues[_0x8f1988[_0x4903('0xf')]][_0x4903('0x8')]));writeDB(queues[_0x8f1988[_0x4903('0xf')]]);}}}catch(_0xd8f7f6){utils[_0x4903('0x17')](util[_0x4903('0x3')](_0x4903('0x39'),_0x8f1988['uniqueid']),_0xd8f7f6);}};exports['blindtransfer']=function(_0x5d442b){try{if(!_[_0x4903('0x19')](queues[_0x5d442b[_0x4903('0x3e')]])){utils['debug'](util['format'](_0x4903('0x3f'),_0x5d442b[_0x4903('0xf')]),_0x5d442b);queues[_0x5d442b[_0x4903('0x3e')]][_0x4903('0x3c')]=!![];queues[_0x5d442b[_0x4903('0x3e')]][_0x4903('0x40')]='BLIND';queues[_0x5d442b[_0x4903('0x3e')]][_0x4903('0x41')]=_0x5d442b['extension'];queues[_0x5d442b[_0x4903('0x3e')]][_0x4903('0x42')]=_0x5d442b['transfereeuniqueid'];queues[_0x5d442b[_0x4903('0x3e')]][_0x4903('0x8')]=_0x4903('0x43');utils[_0x4903('0x2')](util[_0x4903('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5d442b[_0x4903('0xf')],queues[_0x5d442b[_0x4903('0x3e')]]['name'],_0x5d442b[_0x4903('0x3e')],_0x5d442b[_0x4903('0x44')]));}}catch(_0x5e497f){utils[_0x4903('0x17')](util['format']('[%s][queues][blindtransfer]',_0x5d442b[_0x4903('0xf')]),_0x5e497f);}};exports[_0x4903('0x45')]=function(_0x54f1c2){try{utils[_0x4903('0x11')](util[_0x4903('0x3')]('[%s][queues][attendedtransfer]',_0x54f1c2[_0x4903('0x46')]),_0x54f1c2);if(_0x54f1c2[_0x4903('0x46')]==_0x54f1c2[_0x4903('0x47')]){if(!_[_0x4903('0x19')](queues[_0x54f1c2[_0x4903('0x48')]])){utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x49'),_0x54f1c2[_0x4903('0x46')],queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x1d')],_0x54f1c2['origtransfererexten']));queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x3c')]=!![];queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x40')]=_0x4903('0x4a');queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x41')]=_0x54f1c2[_0x4903('0x4b')];queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x42')]=_0x54f1c2['origtransfereruniqueid'];queues[_0x54f1c2[_0x4903('0x48')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x4903('0x19')](queues[_0x54f1c2[_0x4903('0x47')]])){if(_0x54f1c2[_0x4903('0x4c')]&&queues[_0x54f1c2[_0x4903('0x4c')]]){queues[_0x54f1c2[_0x4903('0x4c')]]['queuecallerenterreason']=0x1;queues[_0x54f1c2[_0x4903('0x3e')]]=_[_0x4903('0x4d')](queues[_0x54f1c2[_0x4903('0x4c')]]);queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0xe')]=_0x54f1c2['transfertargetuniqueid'];queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x4e')]=0x2;queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x4f')]=queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x4f')];queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x50')]=queues[_0x54f1c2[_0x4903('0x48')]][_0x4903('0x50')];queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x51')]=utils[_0x4903('0x16')]();queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x1a')]=utils[_0x4903('0x16')]();queues[_0x54f1c2[_0x4903('0x3e')]]['holdtime']=0x0;queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x52')]=0x0;utils['info'](util[_0x4903('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x54f1c2[_0x4903('0x46')],queues[_0x54f1c2['transfereeuniqueid']][_0x4903('0x1d')],queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x4f')],queues[_0x54f1c2[_0x4903('0x3e')]][_0x4903('0x50')]));}else{utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x53'),_0x54f1c2[_0x4903('0x46')],queues[_0x54f1c2['origtransfererlinkedid']][_0x4903('0x1d')],_0x54f1c2['secondtransfererlinkedid']));queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0xe')]=_0x54f1c2[_0x4903('0x48')];}}}else if(_0x54f1c2[_0x4903('0x54')]==_0x54f1c2[_0x4903('0x48')]){if(!_['isNil'](queues[_0x54f1c2[_0x4903('0x47')]])){utils[_0x4903('0x2')](util['format'](_0x4903('0x55'),_0x54f1c2[_0x4903('0x46')],queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0x1d')],_0x54f1c2[_0x4903('0x54')],_0x54f1c2[_0x4903('0x56')]));queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0x3c')]=!![];queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0x40')]='ATTENDED';queues[_0x54f1c2['origtransfererlinkedid']][_0x4903('0x41')]=_0x54f1c2[_0x4903('0x56')];queues[_0x54f1c2[_0x4903('0x47')]]['transferuniqueid']=_0x54f1c2[_0x4903('0x54')];queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0x8')]=_0x4903('0x57');}if(!_['isNil'](queues[_0x54f1c2[_0x4903('0x48')]])){if(_0x54f1c2[_0x4903('0x58')]&&queues[_0x54f1c2[_0x4903('0x58')]]){queues[_0x54f1c2[_0x4903('0x58')]][_0x4903('0x4e')]=0x1;queues[_0x54f1c2[_0x4903('0x59')]]=_[_0x4903('0x4d')](queues[_0x54f1c2[_0x4903('0x58')]]);queues[_0x54f1c2['transfertargetuniqueid']][_0x4903('0xe')]=_0x54f1c2[_0x4903('0x59')];queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x4e')]=0x2;queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x4f')]=queues[_0x54f1c2[_0x4903('0x47')]][_0x4903('0x4f')];queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x50')]=queues[_0x54f1c2[_0x4903('0x47')]]['calleridname'];queues[_0x54f1c2[_0x4903('0x59')]]['queuecallerjoinAt']=utils['now']();queues[_0x54f1c2['transfertargetuniqueid']][_0x4903('0x1a')]=utils[_0x4903('0x16')]();queues[_0x54f1c2['transfertargetuniqueid']][_0x4903('0x31')]=0x0;queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x52')]=0x0;utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x5a'),_0x54f1c2[_0x4903('0x46')],queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x1d')],queues[_0x54f1c2[_0x4903('0x59')]]['transfereduniqueid'],queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x4f')],queues[_0x54f1c2[_0x4903('0x59')]][_0x4903('0x50')]));}else{utils['info'](util[_0x4903('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x54f1c2['origtransfereruniqueid'],queues[_0x54f1c2['secondtransfererlinkedid']][_0x4903('0x1d')],_0x54f1c2[_0x4903('0x47')]));queues[_0x54f1c2['secondtransfererlinkedid']][_0x4903('0xe')]=_0x54f1c2[_0x4903('0x47')];}}}}catch(_0xa912d0){utils[_0x4903('0x17')](util[_0x4903('0x3')](_0x4903('0x5b'),_0x54f1c2[_0x4903('0x46')]),_0xa912d0);}};exports[_0x4903('0x5c')]=function(_0x1bec91){try{if(!_['isNil'](queues[_0x1bec91['uniqueid']])){utils[_0x4903('0x11')](util[_0x4903('0x3')]('[%s][queues][musiconholdstart]',_0x1bec91[_0x4903('0xf')]),_0x1bec91);queues[_0x1bec91['uniqueid']][_0x4903('0x5d')]=utils[_0x4903('0x16')]();utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x5e'),_0x1bec91[_0x4903('0xf')],queues[_0x1bec91[_0x4903('0xf')]]['name'],queues[_0x1bec91[_0x4903('0xf')]][_0x4903('0x5d')]));}}catch(_0x3a3934){utils['error'](util[_0x4903('0x3')](_0x4903('0x5f'),_0x1bec91['uniqueid']),_0x3a3934);}};exports[_0x4903('0x60')]=function(_0x222154){try{if(!_['isNil'](queues[_0x222154[_0x4903('0xf')]])){if(!_[_0x4903('0x19')](queues[_0x222154[_0x4903('0xf')]]['musiconholdstartAt'])){utils[_0x4903('0x11')](util['format'](_0x4903('0x61'),_0x222154[_0x4903('0xf')]),_0x222154);queues[_0x222154['uniqueid']][_0x4903('0x52')]+=utils[_0x4903('0x32')](utils[_0x4903('0x16')](),queues[_0x222154[_0x4903('0xf')]][_0x4903('0x5d')]);utils[_0x4903('0x2')](util[_0x4903('0x3')](_0x4903('0x62'),_0x222154[_0x4903('0xf')],queues[_0x222154[_0x4903('0xf')]]['name'],queues[_0x222154[_0x4903('0xf')]][_0x4903('0x52')]));delete queues[_0x222154[_0x4903('0xf')]][_0x4903('0x5d')];}}}catch(_0x57a816){utils[_0x4903('0x17')](util['format'](_0x4903('0x61'),_0x222154[_0x4903('0xf')]),_0x57a816);}}; \ No newline at end of file +var _0x5649=['error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now'];(function(_0x39c760,_0x4daa3d){var _0x472eb3=function(_0x4cadde){while(--_0x4cadde){_0x39c760['push'](_0x39c760['shift']());}};_0x472eb3(++_0x4daa3d);}(_0x5649,0x12c));var _0x9564=function(_0x478a19,_0x2ff359){_0x478a19=_0x478a19-0x0;var _0x7fd2fa=_0x5649[_0x478a19];return _0x7fd2fa;};'use strict';var _=require('lodash');var util=require(_0x9564('0x0'));var utils=require(_0x9564('0x1'));var queues={};function writeDB(_0x42251b){utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x4'),_0x42251b['uniqueid'],_0x42251b[_0x9564('0x5')],_0x42251b[_0x9564('0x6')],_0x42251b[_0x9564('0x7')],_0x42251b['calleridnum'],_0x42251b[_0x9564('0x8')],_0x42251b[_0x9564('0x9')]));if(_0x42251b[_0x9564('0x6')]){utils[_0x9564('0xa')](_0x42251b['queue'])[_0x9564('0xb')](function(_0x5991df){if(_0x5991df){_0x42251b[_0x9564('0xc')]=_0x5991df[_0x9564('0xc')];}utils[_0x9564('0xd')](_0x9564('0xe'),_0x42251b);});}else{utils[_0x9564('0xd')](_0x9564('0xe'),_0x42251b);}if(_0x42251b['transfereduniqueid']){delete queues[_0x42251b[_0x9564('0xf')]];}else{delete queues[_0x42251b[_0x9564('0x10')]];}}exports[_0x9564('0x11')]=function(_0x4935a7){try{utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x13'),_0x4935a7[_0x9564('0x10')]),_0x4935a7);utils[_0x9564('0x2')](util['format'](_0x9564('0x14'),_0x4935a7[_0x9564('0x10')],_0x4935a7[_0x9564('0x6')],_0x4935a7[_0x9564('0x15')]));queues[_0x4935a7[_0x9564('0x10')]]=_[_0x9564('0x16')](_0x4935a7,{'originalposition':_0x4935a7[_0x9564('0x15')],'queuecallerjoinAt':utils[_0x9564('0x17')](),'mohtime':0x0});}catch(_0x50a68f){utils[_0x9564('0x18')](util['format'](_0x9564('0x13'),_0x4935a7['uniqueid']),_0x50a68f);}};exports[_0x9564('0x19')]=function(_0x271fc1){try{if(!_[_0x9564('0x1a')](queues[_0x271fc1[_0x9564('0x10')]])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x1b'),_0x271fc1['uniqueid']),_0x271fc1);if(queues[_0x271fc1[_0x9564('0x10')]]['queuecallerleaveAt']){if(!queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0x1c')]&&!queues[_0x271fc1['uniqueid']][_0x9564('0x1d')]){queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0x1e')]=!![];queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0x1f')]=utils[_0x9564('0x17')]();queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0x9')]=_0x9564('0x20');}utils[_0x9564('0x2')](util['format'](_0x9564('0x21'),_0x271fc1[_0x9564('0x10')],queues[_0x271fc1[_0x9564('0x10')]]['name'],queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0x9')]));writeDB(queues[_0x271fc1['uniqueid']]);}else if(queues[_0x271fc1[_0x9564('0x10')]]['transfereduniqueid']){utils['info'](util[_0x9564('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x271fc1['uniqueid'],queues[_0x271fc1[_0x9564('0x10')]]['name'],queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0xf')]));queues[queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0xf')]]=queues[_0x271fc1['uniqueid']];queues[queues[_0x271fc1[_0x9564('0x10')]][_0x9564('0xf')]][_0x9564('0x22')]=0x2;delete queues[_0x271fc1[_0x9564('0x10')]];}}}catch(_0x5317ca){utils['error'](util[_0x9564('0x3')](_0x9564('0x1b'),_0x271fc1['uniqueid']),_0x5317ca);}};exports[_0x9564('0x23')]=function(_0x4e0325){try{utils[_0x9564('0x12')](util['format'](_0x9564('0x24'),_0x4e0325[_0x9564('0x10')]),_0x4e0325);if(!_['isNil'](_0x4e0325[_0x9564('0x25')]['queuestatus'])&&_0x4e0325['value'][_0x9564('0x26')]()!==_0x9564('0x27')){if(!_['isNil'](queues[_0x4e0325[_0x9564('0x10')]])){queues[_0x4e0325['uniqueid']][_0x9564('0x1c')]=![];queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x28')]=null;queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x1d')]=!![];queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x29')]=utils[_0x9564('0x17')]();queues[_0x4e0325['uniqueid']][_0x9564('0x9')]=_0x4e0325[_0x9564('0x2a')][_0x9564('0x26')]();utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x2b'),_0x4e0325[_0x9564('0x10')],queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x2c')],_0x4e0325[_0x9564('0x2a')],queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x9')]));writeDB(queues[_0x4e0325[_0x9564('0x10')]]);}}else if(!_[_0x9564('0x1a')](_0x4e0325[_0x9564('0x25')][_0x9564('0x2d')])){if(!_['isNil'](queues[_0x4e0325['uniqueid']])&&!queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x1c')]){queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x1c')]=![];queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x28')]=null;queues[_0x4e0325['uniqueid']][_0x9564('0x1d')]=!![];queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x29')]=utils['now']();queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x9')]=_0x9564('0x2e');utils[_0x9564('0x2')](util['format'](_0x9564('0x2f'),_0x4e0325[_0x9564('0x10')],queues[_0x4e0325[_0x9564('0x10')]][_0x9564('0x2c')],_0x4e0325[_0x9564('0x2a')],queues[_0x4e0325['uniqueid']]['queuecallerexitreason']));}}}catch(_0x2ede89){utils[_0x9564('0x18')](util[_0x9564('0x3')](_0x9564('0x24'),_0x4e0325[_0x9564('0x10')]),_0x2ede89);}};exports[_0x9564('0x1c')]=function(_0x2f77c8){try{if(!_['isNil'](queues[_0x2f77c8[_0x9564('0x10')]])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x30'),_0x2f77c8[_0x9564('0x10')]),_0x2f77c8);queues[_0x2f77c8[_0x9564('0x10')]][_0x9564('0x1d')]=![];queues[_0x2f77c8['uniqueid']][_0x9564('0x29')]=null;queues[_0x2f77c8[_0x9564('0x10')]][_0x9564('0x1c')]=!![];queues[_0x2f77c8[_0x9564('0x10')]][_0x9564('0x28')]=utils['now']();queues[_0x2f77c8[_0x9564('0x10')]]['queuecallerexitreason']=_0x9564('0x31');utils[_0x9564('0x2')](util['format'](_0x9564('0x32'),_0x2f77c8[_0x9564('0x10')],queues[_0x2f77c8[_0x9564('0x10')]][_0x9564('0x2c')],queues[_0x2f77c8[_0x9564('0x10')]][_0x9564('0x9')]));}}catch(_0x48d63c){utils[_0x9564('0x18')](util[_0x9564('0x3')](_0x9564('0x30'),_0x2f77c8[_0x9564('0x10')]),_0x48d63c);}};exports[_0x9564('0x33')]=function(_0x538b25){try{if(!_[_0x9564('0x1a')](queues[_0x538b25['uniqueid']])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x34'),_0x538b25[_0x9564('0x10')]),_0x538b25);utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x35'),_0x538b25['uniqueid'],queues[_0x538b25[_0x9564('0x10')]][_0x9564('0x2c')],_0x538b25[_0x9564('0x36')],_0x538b25[_0x9564('0x37')]));queues[_0x538b25['uniqueid']][_0x9564('0x33')]=!![];queues[_0x538b25[_0x9564('0x10')]][_0x9564('0x38')]=utils['now']();queues[_0x538b25[_0x9564('0x10')]]['holdtime']=utils[_0x9564('0x39')](queues[_0x538b25[_0x9564('0x10')]][_0x9564('0x38')],queues[_0x538b25[_0x9564('0x10')]][_0x9564('0x3a')]);queues[_0x538b25['uniqueid']][_0x9564('0x15')]=_0x538b25['position'];queues[_0x538b25['uniqueid']][_0x9564('0x3b')]=_0x538b25['count'];queues[_0x538b25[_0x9564('0x10')]][_0x9564('0x36')]=_0x538b25[_0x9564('0x36')];queues[_0x538b25['uniqueid']]['connectedlinename']=_0x538b25[_0x9564('0x37')];}}catch(_0x4c4662){utils[_0x9564('0x18')](util[_0x9564('0x3')](_0x9564('0x34'),_0x538b25[_0x9564('0x10')]),_0x4c4662);}};exports[_0x9564('0x3c')]=function(_0x152cdc){try{if(!_[_0x9564('0x1a')](queues[_0x152cdc['uniqueid']])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x3d'),_0x152cdc[_0x9564('0x10')]),_0x152cdc);utils['info'](util['format'](_0x9564('0x3e'),_0x152cdc[_0x9564('0x10')],queues[_0x152cdc[_0x9564('0x10')]][_0x9564('0x2c')],_0x152cdc[_0x9564('0x3f')],_0x152cdc[_0x9564('0x40')]));queues[_0x152cdc[_0x9564('0x10')]]['queuecallerabandon']=![];queues[_0x152cdc[_0x9564('0x10')]][_0x9564('0x1c')]=![];queues[_0x152cdc['uniqueid']][_0x9564('0x28')]=null;queues[_0x152cdc[_0x9564('0x10')]][_0x9564('0x1d')]=![];queues[_0x152cdc['uniqueid']][_0x9564('0x9')]=null;queues[_0x152cdc[_0x9564('0x10')]][_0x9564('0x29')]=null;queues[_0x152cdc[_0x9564('0x10')]]['assigned']=!![];queues[_0x152cdc[_0x9564('0x10')]][_0x9564('0x8')]=_0x152cdc['destaccountcode'];queues[_0x152cdc[_0x9564('0x10')]]['lastAssignedTo']=_0x152cdc['membername'];}}catch(_0x290e73){utils['error'](util['format'](_0x9564('0x3d'),_0x152cdc[_0x9564('0x10')]),_0x290e73);}};exports[_0x9564('0x41')]=function(_0x2253cd){try{if(!_[_0x9564('0x1a')](queues[_0x2253cd[_0x9564('0x10')]])){if(queues[_0x2253cd[_0x9564('0x10')]]['queuecallerleaveAt']){utils['debug'](util[_0x9564('0x3')](_0x9564('0x42'),_0x2253cd[_0x9564('0x10')]),_0x2253cd);queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x1c')]=![];queues[_0x2253cd[_0x9564('0x10')]]['queuecallerabandon']=![];queues[_0x2253cd['uniqueid']][_0x9564('0x28')]=null;queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x1d')]=![];queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x29')]=null;queues[_0x2253cd['uniqueid']]['assigned']=!![];queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x7')]=_0x2253cd[_0x9564('0x3f')];queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x1e')]=!![];queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x1f')]=utils[_0x9564('0x17')]();if(_0x2253cd[_0x9564('0x43')]==_0x9564('0x44')){if(!queues[_0x2253cd[_0x9564('0x10')]]['transfer']){queues[_0x2253cd[_0x9564('0x10')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x9')]=_0x9564('0x45')+_0x2253cd[_0x9564('0x43')][_0x9564('0x26')]();}utils[_0x9564('0x2')](util[_0x9564('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x2253cd[_0x9564('0x10')],queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x2c')],_0x2253cd[_0x9564('0x3f')],queues[_0x2253cd[_0x9564('0x10')]][_0x9564('0x9')]));writeDB(queues[_0x2253cd[_0x9564('0x10')]]);}}}catch(_0x280212){utils[_0x9564('0x18')](util['format'](_0x9564('0x42'),_0x2253cd['uniqueid']),_0x280212);}};exports[_0x9564('0x46')]=function(_0x104570){try{if(!_['isNil'](queues[_0x104570[_0x9564('0x47')]])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x48'),_0x104570['uniqueid']),_0x104570);queues[_0x104570[_0x9564('0x47')]][_0x9564('0x44')]=!![];queues[_0x104570['transfereeuniqueid']][_0x9564('0x49')]=_0x9564('0x4a');queues[_0x104570['transfereeuniqueid']][_0x9564('0x4b')]=_0x104570[_0x9564('0x4c')];queues[_0x104570[_0x9564('0x47')]][_0x9564('0x4d')]=_0x104570[_0x9564('0x47')];queues[_0x104570[_0x9564('0x47')]]['queuecallerexitreason']=_0x9564('0x4e');utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x4f'),_0x104570['uniqueid'],queues[_0x104570[_0x9564('0x47')]][_0x9564('0x2c')],_0x104570[_0x9564('0x47')],_0x104570[_0x9564('0x4c')]));}}catch(_0x3dfddf){utils[_0x9564('0x18')](util['format'](_0x9564('0x48'),_0x104570[_0x9564('0x10')]),_0x3dfddf);}};exports[_0x9564('0x50')]=function(_0x4eb9bf){try{utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x51'),_0x4eb9bf[_0x9564('0x52')]),_0x4eb9bf);if(_0x4eb9bf[_0x9564('0x52')]==_0x4eb9bf[_0x9564('0x53')]){if(!_[_0x9564('0x1a')](queues[_0x4eb9bf['secondtransfererlinkedid']])){utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x54'),_0x4eb9bf[_0x9564('0x52')],queues[_0x4eb9bf[_0x9564('0x55')]]['name'],_0x4eb9bf['origtransfererexten']));queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x44')]=!![];queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x49')]='ATTENDED';queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x4b')]=_0x4eb9bf[_0x9564('0x56')];queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x4d')]=_0x4eb9bf[_0x9564('0x52')];queues[_0x4eb9bf['secondtransfererlinkedid']]['queuecallerexitreason']=_0x9564('0x57');}if(!_[_0x9564('0x1a')](queues[_0x4eb9bf['origtransfererlinkedid']])){if(_0x4eb9bf[_0x9564('0x58')]&&queues[_0x4eb9bf[_0x9564('0x58')]]){queues[_0x4eb9bf[_0x9564('0x58')]][_0x9564('0x22')]=0x1;queues[_0x4eb9bf['transfereeuniqueid']]=_[_0x9564('0x59')](queues[_0x4eb9bf['transfereelinkedid']]);queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0xf')]=_0x4eb9bf[_0x9564('0x5a')];queues[_0x4eb9bf[_0x9564('0x47')]]['queuecallerenterreason']=0x2;queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0x5b')]=queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x5b')];queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0x5c')]=queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x5c')];queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0x3a')]=utils[_0x9564('0x17')]();queues[_0x4eb9bf[_0x9564('0x47')]]['queuecallerleaveAt']=utils[_0x9564('0x17')]();queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0x5d')]=0x0;queues[_0x4eb9bf[_0x9564('0x47')]][_0x9564('0x5e')]=0x0;utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x5f'),_0x4eb9bf[_0x9564('0x52')],queues[_0x4eb9bf[_0x9564('0x47')]]['name'],queues[_0x4eb9bf[_0x9564('0x47')]]['calleridnum'],queues[_0x4eb9bf['transfereeuniqueid']][_0x9564('0x5c')]));}else{utils[_0x9564('0x2')](util[_0x9564('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4eb9bf[_0x9564('0x52')],queues[_0x4eb9bf['origtransfererlinkedid']][_0x9564('0x2c')],_0x4eb9bf[_0x9564('0x55')]));queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0xf')]=_0x4eb9bf[_0x9564('0x55')];}}}else if(_0x4eb9bf[_0x9564('0x60')]==_0x4eb9bf[_0x9564('0x55')]){if(!_[_0x9564('0x1a')](queues[_0x4eb9bf[_0x9564('0x53')]])){utils[_0x9564('0x2')](util[_0x9564('0x3')](_0x9564('0x61'),_0x4eb9bf[_0x9564('0x52')],queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x2c')],_0x4eb9bf['secondtransfereruniqueid'],_0x4eb9bf['secondtransfererexten']));queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x44')]=!![];queues[_0x4eb9bf['origtransfererlinkedid']][_0x9564('0x49')]='ATTENDED';queues[_0x4eb9bf['origtransfererlinkedid']][_0x9564('0x4b')]=_0x4eb9bf[_0x9564('0x62')];queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x4d')]=_0x4eb9bf[_0x9564('0x60')];queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x4eb9bf[_0x9564('0x55')]])){if(_0x4eb9bf['transfertargetlinkedid']&&queues[_0x4eb9bf[_0x9564('0x63')]]){queues[_0x4eb9bf['transfertargetlinkedid']][_0x9564('0x22')]=0x1;queues[_0x4eb9bf[_0x9564('0x5a')]]=_[_0x9564('0x59')](queues[_0x4eb9bf[_0x9564('0x63')]]);queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0xf')]=_0x4eb9bf['transfertargetuniqueid'];queues[_0x4eb9bf['transfertargetuniqueid']][_0x9564('0x22')]=0x2;queues[_0x4eb9bf['transfertargetuniqueid']][_0x9564('0x5b')]=queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x5b')];queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x5c')]=queues[_0x4eb9bf[_0x9564('0x53')]][_0x9564('0x5c')];queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x3a')]=utils[_0x9564('0x17')]();queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x38')]=utils[_0x9564('0x17')]();queues[_0x4eb9bf[_0x9564('0x5a')]]['holdtime']=0x0;queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x5e')]=0x0;utils[_0x9564('0x2')](util['format'](_0x9564('0x64'),_0x4eb9bf[_0x9564('0x52')],queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x2c')],queues[_0x4eb9bf['transfertargetuniqueid']][_0x9564('0xf')],queues[_0x4eb9bf['transfertargetuniqueid']][_0x9564('0x5b')],queues[_0x4eb9bf[_0x9564('0x5a')]][_0x9564('0x5c')]));}else{utils['info'](util[_0x9564('0x3')](_0x9564('0x65'),_0x4eb9bf['origtransfereruniqueid'],queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0x2c')],_0x4eb9bf[_0x9564('0x53')]));queues[_0x4eb9bf[_0x9564('0x55')]][_0x9564('0xf')]=_0x4eb9bf[_0x9564('0x53')];}}}}catch(_0x5ed58b){utils['error'](util[_0x9564('0x3')](_0x9564('0x51'),_0x4eb9bf[_0x9564('0x52')]),_0x5ed58b);}};exports['musiconholdstart']=function(_0x59b867){try{if(!_[_0x9564('0x1a')](queues[_0x59b867[_0x9564('0x10')]])){utils[_0x9564('0x12')](util['format'](_0x9564('0x66'),_0x59b867[_0x9564('0x10')]),_0x59b867);queues[_0x59b867[_0x9564('0x10')]][_0x9564('0x67')]=utils[_0x9564('0x17')]();utils['info'](util[_0x9564('0x3')](_0x9564('0x68'),_0x59b867['uniqueid'],queues[_0x59b867[_0x9564('0x10')]][_0x9564('0x2c')],queues[_0x59b867[_0x9564('0x10')]][_0x9564('0x67')]));}}catch(_0x1386f6){utils['error'](util[_0x9564('0x3')](_0x9564('0x66'),_0x59b867[_0x9564('0x10')]),_0x1386f6);}};exports[_0x9564('0x69')]=function(_0x232924){try{if(!_['isNil'](queues[_0x232924[_0x9564('0x10')]])){if(!_['isNil'](queues[_0x232924[_0x9564('0x10')]]['musiconholdstartAt'])){utils[_0x9564('0x12')](util[_0x9564('0x3')](_0x9564('0x6a'),_0x232924[_0x9564('0x10')]),_0x232924);queues[_0x232924[_0x9564('0x10')]]['mohtime']+=utils[_0x9564('0x39')](utils['now'](),queues[_0x232924[_0x9564('0x10')]]['musiconholdstartAt']);utils['info'](util['format'](_0x9564('0x6b'),_0x232924[_0x9564('0x10')],queues[_0x232924[_0x9564('0x10')]][_0x9564('0x2c')],queues[_0x232924[_0x9564('0x10')]]['mohtime']));delete queues[_0x232924['uniqueid']][_0x9564('0x67')];}}}catch(_0x3e263a){utils[_0x9564('0x18')](util[_0x9564('0x3')]('[%s][queues][musiconholdstop]',_0x232924[_0x9564('0x10')]),_0x3e263a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index cf41643..bcdcd42 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 _0xb27d=['newstate','debug','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.WAV','find','monitors','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error'];(function(_0x19a9b3,_0x231822){var _0x4e8744=function(_0x5ec4c6){while(--_0x5ec4c6){_0x19a9b3['push'](_0x19a9b3['shift']());}};_0x4e8744(++_0x231822);}(_0xb27d,0xf2));var _0xdb27=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb27d[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xdb27('0x0'));var util=require(_0xdb27('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x3cd1b5){utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x4'),_0x3cd1b5[_0xdb27('0x5')]));if(_0x3cd1b5[_0xdb27('0x6')]){utils[_0xdb27('0x7')](_0x3cd1b5[_0xdb27('0x6')])[_0xdb27('0x8')](function(_0x2b129c){if(_0x2b129c){_0x3cd1b5[_0xdb27('0x9')]=_0x2b129c[_0xdb27('0xa')];_0x3cd1b5[_0xdb27('0xb')]=_0x2b129c['id'];}utils[_0xdb27('0xc')](_0xdb27('0xd'),_0x3cd1b5);});}else{utils[_0xdb27('0xc')](_0xdb27('0xd'),_0x3cd1b5);}}exports[_0xdb27('0xe')]=function(_0x464103){try{utils['debug'](util[_0xdb27('0x3')](_0xdb27('0xf'),_0x464103[_0xdb27('0x5')]),_0x464103);if(_0x464103[_0xdb27('0x5')]==_0x464103[_0xdb27('0x10')]){utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x11'),_0x464103[_0xdb27('0x5')],_0x464103[_0xdb27('0x12')],_0x464103[_0xdb27('0x13')]));recordings[_0x464103[_0xdb27('0x5')]]={'uniqueid':_0x464103['uniqueid'],'accountcode':_0x464103[_0xdb27('0x6')],'exten':_0x464103['exten'],'context':_0x464103[_0xdb27('0x12')],'channel':_0x464103[_0xdb27('0x14')],'monitors':[]};}}catch(_0x46442f){utils[_0xdb27('0x15')](util[_0xdb27('0x3')]('[%s][recordings][newchannel]',_0x464103[_0xdb27('0x5')]),_0x46442f);}};exports[_0xdb27('0x16')]=function(_0xf0a369){try{utils[_0xdb27('0x17')](util[_0xdb27('0x3')](_0xdb27('0x18'),_0xf0a369[_0xdb27('0x5')]),_0xf0a369);if(!_['isNil'](recordings[_0xf0a369[_0xdb27('0x5')]])&&_0xf0a369[_0xdb27('0x19')]==0x6){utils['info'](util[_0xdb27('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0xf0a369['uniqueid'],_0xf0a369[_0xdb27('0x12')],_0xf0a369[_0xdb27('0x14')]));}else if(!_[_0xdb27('0x1a')](recordings[_0xf0a369[_0xdb27('0x10')]])&&_0xf0a369[_0xdb27('0x19')]==0x6&&_0xf0a369[_0xdb27('0x12')]!=_0xdb27('0x1b')){utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x1c'),_0xf0a369['uniqueid'],_0xf0a369[_0xdb27('0x10')],_0xf0a369[_0xdb27('0x12')],_0xf0a369[_0xdb27('0x14')]));recordings[_0xf0a369[_0xdb27('0x10')]][_0xdb27('0x6')]=_0xf0a369[_0xdb27('0x6')];}}catch(_0x4903cc){utils[_0xdb27('0x15')](util[_0xdb27('0x3')](_0xdb27('0x18'),_0xf0a369['uniqueid']),_0x4903cc);}};exports[_0xdb27('0x1d')]=function(_0x4c56d6){try{if(!_[_0xdb27('0x1a')](_0x4c56d6[_0xdb27('0x1e')])&&!_[_0xdb27('0x1a')](_0x4c56d6['variable'][_0xdb27('0x1f')])){utils['debug'](util[_0xdb27('0x3')](_0xdb27('0x20'),_0x4c56d6['uniqueid']),_0x4c56d6);utils[_0xdb27('0x2')](util['format'](_0xdb27('0x21'),_0x4c56d6[_0xdb27('0x5')],_0x4c56d6[_0xdb27('0x1e')],_0x4c56d6[_0xdb27('0x22')]));if(_['endsWith'](_0x4c56d6[_0xdb27('0x22')],'.wav49')){_0x4c56d6[_0xdb27('0x22')]=_0x4c56d6['value'][_0xdb27('0x23')]('.wav49',_0xdb27('0x24'));}if(recordings[_0x4c56d6['linkedid']]){var _0x836b72=_[_0xdb27('0x25')](recordings[_0x4c56d6['linkedid']][_0xdb27('0x26')],{'value':_0x4c56d6[_0xdb27('0x22')]});if(_['isNil'](_0x836b72)){recordings[_0x4c56d6[_0xdb27('0x10')]][_0xdb27('0x26')]['push']({'value':_0x4c56d6[_0xdb27('0x22')]});}}}}catch(_0x1feb5f){utils['error'](util[_0xdb27('0x3')]('[%s][recordings][varset]',_0x4c56d6[_0xdb27('0x5')]),_0x1feb5f);}};exports[_0xdb27('0x27')]=function(_0x5b6e17){try{if(!_[_0xdb27('0x1a')](recordings[_0x5b6e17[_0xdb27('0x5')]])){utils['debug'](util['format'](_0xdb27('0x28'),_0x5b6e17['uniqueid']),_0x5b6e17);utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x29'),_0x5b6e17[_0xdb27('0x5')],_0x5b6e17[_0xdb27('0x2a')],_0x5b6e17[_0xdb27('0x2b')],_0x5b6e17[_0xdb27('0x2c')]));recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2a')]=_0x5b6e17[_0xdb27('0x2a')];recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2b')]=_0x5b6e17['calleridname'];recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2d')]=_0x5b6e17[_0xdb27('0x2d')];recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2e')]=_0x5b6e17['connectedlinename'];if(recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2f')]==_0xdb27('0x30')&&recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x6')]){recordings[_0x5b6e17['uniqueid']][_0xdb27('0x2d')]=recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x6')];recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x2e')]='';}recordings[_0x5b6e17[_0xdb27('0x5')]][_0xdb27('0x26')]['forEach'](function(_0x3859e5){var _0x8e767a=_[_0xdb27('0x31')](recordings[_0x5b6e17[_0xdb27('0x5')]]);_0x8e767a[_0xdb27('0x22')]=_0x3859e5['value'];writeDB(_0x8e767a);});delete recordings[_0x5b6e17[_0xdb27('0x5')]];}}catch(_0xebfc15){utils[_0xdb27('0x15')](util[_0xdb27('0x3')](_0xdb27('0x28'),_0x5b6e17[_0xdb27('0x5')]),_0xebfc15);}};exports[_0xdb27('0x32')]=function(_0xc8936c){try{if(!_[_0xdb27('0x1a')](recordings[_0xc8936c[_0xdb27('0x5')]])){utils[_0xdb27('0x17')](util['format']('[%s][recordings][newexten]',_0xc8936c[_0xdb27('0x5')]),_0xc8936c);utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x33'),_0xc8936c['uniqueid'],_0xc8936c[_0xdb27('0x34')],_0xc8936c['appdata']));if(_0xc8936c[_0xdb27('0x34')][_0xdb27('0x35')]()==_0xdb27('0x36')&&_[_0xdb27('0x37')](_0xc8936c['appdata'][_0xdb27('0x35')](),_0xdb27('0x38'))){var _0x13397f=_0xc8936c[_0xdb27('0x39')][_0xdb27('0x3a')]('=');var _0x282ecd=_0x13397f[0x0][_0xdb27('0x3b')](_0x13397f[0x0][_0xdb27('0x3c')]('(')+0x1,_0x13397f[0x0][_0xdb27('0x3c')](')'));var _0x27ec67=_0x13397f[0x1];recordings[_0xc8936c['uniqueid']][_0x282ecd]=_0x27ec67;}}}catch(_0x553152){utils[_0xdb27('0x15')](util[_0xdb27('0x3')](_0xdb27('0x3d'),_0xc8936c['uniqueid']),_0x553152);}};exports[_0xdb27('0x3e')]=function(_0x3eab33){try{if(!_[_0xdb27('0x1a')](recordings[_0x3eab33[_0xdb27('0x5')]])){utils['debug'](util[_0xdb27('0x3')](_0xdb27('0x3f'),_0x3eab33['uniqueid']),_0x3eab33);utils[_0xdb27('0x2')](util[_0xdb27('0x3')](_0xdb27('0x40'),_0x3eab33['uniqueid'],_0x3eab33[_0xdb27('0x41')]));recordings[_0x3eab33[_0xdb27('0x5')]][_0xdb27('0x41')]=_0x3eab33[_0xdb27('0x41')];}}catch(_0x2695c8){utils[_0xdb27('0x15')](util['format'](_0xdb27('0x3f'),_0x3eab33[_0xdb27('0x5')]),_0x2695c8);}}; \ No newline at end of file +var _0x5ca1=['.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','connectedlinenum','outbound','connectedlinename','forEach','clone','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','cdr','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','UserId','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value'];(function(_0xfddd55,_0x122175){var _0x520ec1=function(_0x2223ce){while(--_0x2223ce){_0xfddd55['push'](_0xfddd55['shift']());}};_0x520ec1(++_0x122175);}(_0x5ca1,0x146));var _0x15ca=function(_0x2871c2,_0xe4c551){_0x2871c2=_0x2871c2-0x0;var _0x279bac=_0x5ca1[_0x2871c2];return _0x279bac;};'use strict';var _=require('lodash');var util=require(_0x15ca('0x0'));var utils=require(_0x15ca('0x1'));var recordings={};function writeDB(_0x31e29b){utils[_0x15ca('0x2')](util[_0x15ca('0x3')](_0x15ca('0x4'),_0x31e29b[_0x15ca('0x5')]));if(_0x31e29b[_0x15ca('0x6')]){utils[_0x15ca('0x7')](_0x31e29b[_0x15ca('0x6')])[_0x15ca('0x8')](function(_0x64d13a){if(_0x64d13a){_0x31e29b[_0x15ca('0x9')]=_0x64d13a['name'];_0x31e29b[_0x15ca('0xa')]=_0x64d13a['id'];}utils[_0x15ca('0xb')]('CreateVoiceRecording',_0x31e29b);});}else{utils[_0x15ca('0xb')]('CreateVoiceRecording',_0x31e29b);}}exports[_0x15ca('0xc')]=function(_0x36ebc7){try{utils[_0x15ca('0xd')](util[_0x15ca('0x3')](_0x15ca('0xe'),_0x36ebc7[_0x15ca('0x5')]),_0x36ebc7);if(_0x36ebc7[_0x15ca('0x5')]==_0x36ebc7[_0x15ca('0xf')]){utils['info'](util[_0x15ca('0x3')](_0x15ca('0x10'),_0x36ebc7['uniqueid'],_0x36ebc7[_0x15ca('0x11')],_0x36ebc7[_0x15ca('0x12')]));recordings[_0x36ebc7['uniqueid']]={'uniqueid':_0x36ebc7['uniqueid'],'accountcode':_0x36ebc7['accountcode'],'exten':_0x36ebc7['exten'],'context':_0x36ebc7[_0x15ca('0x11')],'channel':_0x36ebc7['channel'],'monitors':[]};}}catch(_0x24bca5){utils[_0x15ca('0x13')](util['format'](_0x15ca('0xe'),_0x36ebc7['uniqueid']),_0x24bca5);}};exports[_0x15ca('0x14')]=function(_0x31bf03){try{utils[_0x15ca('0xd')](util[_0x15ca('0x3')](_0x15ca('0x15'),_0x31bf03[_0x15ca('0x5')]),_0x31bf03);if(!_['isNil'](recordings[_0x31bf03[_0x15ca('0x5')]])&&_0x31bf03[_0x15ca('0x16')]==0x6){utils['info'](util[_0x15ca('0x3')](_0x15ca('0x17'),_0x31bf03['uniqueid'],_0x31bf03['context'],_0x31bf03['channel']));}else if(!_['isNil'](recordings[_0x31bf03[_0x15ca('0xf')]])&&_0x31bf03[_0x15ca('0x16')]==0x6&&_0x31bf03[_0x15ca('0x11')]!=_0x15ca('0x18')){utils[_0x15ca('0x2')](util[_0x15ca('0x3')](_0x15ca('0x19'),_0x31bf03[_0x15ca('0x5')],_0x31bf03[_0x15ca('0xf')],_0x31bf03[_0x15ca('0x11')],_0x31bf03[_0x15ca('0x1a')]));recordings[_0x31bf03[_0x15ca('0xf')]][_0x15ca('0x6')]=_0x31bf03[_0x15ca('0x6')];}}catch(_0x4a5887){utils['error'](util[_0x15ca('0x3')]('[%s][recordings][newstate]',_0x31bf03['uniqueid']),_0x4a5887);}};exports[_0x15ca('0x1b')]=function(_0x374ed0){try{if(!_[_0x15ca('0x1c')](_0x374ed0[_0x15ca('0x1d')])&&!_['isNil'](_0x374ed0[_0x15ca('0x1d')][_0x15ca('0x1e')])){utils[_0x15ca('0xd')](util[_0x15ca('0x3')](_0x15ca('0x1f'),_0x374ed0[_0x15ca('0x5')]),_0x374ed0);utils[_0x15ca('0x2')](util[_0x15ca('0x3')](_0x15ca('0x20'),_0x374ed0[_0x15ca('0x5')],_0x374ed0['variable'],_0x374ed0['value']));if(_['endsWith'](_0x374ed0[_0x15ca('0x21')],_0x15ca('0x22'))){_0x374ed0[_0x15ca('0x21')]=_0x374ed0['value']['replace'](_0x15ca('0x22'),_0x15ca('0x23'));}if(recordings[_0x374ed0[_0x15ca('0xf')]]){var _0x102d39=_[_0x15ca('0x24')](recordings[_0x374ed0['linkedid']][_0x15ca('0x25')],{'value':_0x374ed0['value']});if(_[_0x15ca('0x1c')](_0x102d39)){recordings[_0x374ed0[_0x15ca('0xf')]]['monitors'][_0x15ca('0x26')]({'value':_0x374ed0[_0x15ca('0x21')]});}}}}catch(_0x34d8d4){utils[_0x15ca('0x13')](util[_0x15ca('0x3')]('[%s][recordings][varset]',_0x374ed0[_0x15ca('0x5')]),_0x34d8d4);}};exports[_0x15ca('0x27')]=function(_0x3257b0){try{if(!_[_0x15ca('0x1c')](recordings[_0x3257b0[_0x15ca('0x5')]])){utils[_0x15ca('0xd')](util['format']('[%s][recordings][hangup]',_0x3257b0['uniqueid']),_0x3257b0);utils[_0x15ca('0x2')](util[_0x15ca('0x3')](_0x15ca('0x28'),_0x3257b0[_0x15ca('0x5')],_0x3257b0['calleridnum'],_0x3257b0['calleridname'],_0x3257b0[_0x15ca('0x29')]));recordings[_0x3257b0[_0x15ca('0x5')]][_0x15ca('0x2a')]=_0x3257b0[_0x15ca('0x2a')];recordings[_0x3257b0['uniqueid']]['calleridname']=_0x3257b0['calleridname'];recordings[_0x3257b0[_0x15ca('0x5')]][_0x15ca('0x2b')]=_0x3257b0[_0x15ca('0x2b')];recordings[_0x3257b0[_0x15ca('0x5')]]['connectedlinename']=_0x3257b0['connectedlinename'];if(recordings[_0x3257b0[_0x15ca('0x5')]]['type']==_0x15ca('0x2c')&&recordings[_0x3257b0[_0x15ca('0x5')]]['accountcode']){recordings[_0x3257b0['uniqueid']][_0x15ca('0x2b')]=recordings[_0x3257b0[_0x15ca('0x5')]][_0x15ca('0x6')];recordings[_0x3257b0[_0x15ca('0x5')]][_0x15ca('0x2d')]='';}recordings[_0x3257b0['uniqueid']]['monitors'][_0x15ca('0x2e')](function(_0x438bae){var _0x2c7cdd=_[_0x15ca('0x2f')](recordings[_0x3257b0[_0x15ca('0x5')]]);_0x2c7cdd[_0x15ca('0x21')]=_0x438bae[_0x15ca('0x21')];writeDB(_0x2c7cdd);});delete recordings[_0x3257b0[_0x15ca('0x5')]];}}catch(_0x48e318){utils[_0x15ca('0x13')](util[_0x15ca('0x3')]('[%s][recordings][hangup]',_0x3257b0[_0x15ca('0x5')]),_0x48e318);}};exports['newexten']=function(_0x2a669d){try{if(!_[_0x15ca('0x1c')](recordings[_0x2a669d[_0x15ca('0x5')]])){utils[_0x15ca('0xd')](util['format']('[%s][recordings][newexten]',_0x2a669d['uniqueid']),_0x2a669d);utils['info'](util['format'](_0x15ca('0x30'),_0x2a669d[_0x15ca('0x5')],_0x2a669d[_0x15ca('0x31')],_0x2a669d[_0x15ca('0x32')]));if(_0x2a669d[_0x15ca('0x31')][_0x15ca('0x33')]()=='set'&&_['startsWith'](_0x2a669d[_0x15ca('0x32')][_0x15ca('0x33')](),_0x15ca('0x34'))){var _0x3bca49=_0x2a669d[_0x15ca('0x32')]['split']('=');var _0x5b5a64=_0x3bca49[0x0][_0x15ca('0x35')](_0x3bca49[0x0][_0x15ca('0x36')]('(')+0x1,_0x3bca49[0x0][_0x15ca('0x36')](')'));var _0x1112f2=_0x3bca49[0x1];recordings[_0x2a669d[_0x15ca('0x5')]][_0x5b5a64]=_0x1112f2;}}}catch(_0x4a2975){utils[_0x15ca('0x13')](util[_0x15ca('0x3')](_0x15ca('0x37'),_0x2a669d[_0x15ca('0x5')]),_0x4a2975);}};exports[_0x15ca('0x38')]=function(_0xb84f9f){try{if(!_[_0x15ca('0x1c')](recordings[_0xb84f9f[_0x15ca('0x5')]])){utils[_0x15ca('0xd')](util[_0x15ca('0x3')](_0x15ca('0x39'),_0xb84f9f[_0x15ca('0x5')]),_0xb84f9f);utils['info'](util[_0x15ca('0x3')](_0x15ca('0x3a'),_0xb84f9f['uniqueid'],_0xb84f9f[_0x15ca('0x3b')]));recordings[_0xb84f9f[_0x15ca('0x5')]][_0x15ca('0x3b')]=_0xb84f9f['queue'];}}catch(_0x187007){utils[_0x15ca('0x13')](util[_0x15ca('0x3')](_0x15ca('0x39'),_0xb84f9f[_0x15ca('0x5')]),_0x187007);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 08b455f..fc3c925 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 _0x8a20=['info','format','attended','uniqueid','request','blinds','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetcontext','transfertargetlinkedid','util','./utils'];(function(_0x1ad246,_0x3e2585){var _0x3c4470=function(_0x551116){while(--_0x551116){_0x1ad246['push'](_0x1ad246['shift']());}};_0x3c4470(++_0x3e2585);}(_0x8a20,0x116));var _0x08a2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8a20[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x08a2('0x0'));var utils=require(_0x08a2('0x1'));function writeDB(_0x4f3f2d){utils[_0x08a2('0x2')](util[_0x08a2('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x4f3f2d['type']===_0x08a2('0x4')?_0x4f3f2d['origtransfereruniqueid']:_0x4f3f2d[_0x08a2('0x5')],_0x4f3f2d['type']));utils[_0x08a2('0x6')]('CreateVoiceTransferReport',_0x4f3f2d);}exports[_0x08a2('0x7')]={};exports['blindtransfer']=function(_0x6826f1){try{utils['debug'](util[_0x08a2('0x3')](_0x08a2('0x8'),_0x6826f1['uniqueid']),_0x6826f1);utils[_0x08a2('0x2')](util[_0x08a2('0x3')](_0x08a2('0x9'),_0x6826f1['uniqueid'],_0x6826f1[_0x08a2('0xa')],_0x6826f1[_0x08a2('0xb')],_0x6826f1[_0x08a2('0xc')],_0x6826f1['transfereecalleridname']));_0x6826f1['type']=_0x08a2('0xd');exports['blinds'][_0x6826f1['transfereruniqueid']]=_0x6826f1;writeDB(_0x6826f1);}catch(_0x2f1587){utils['error'](util['format'](_0x08a2('0x8'),_0x6826f1['uniqueid']),_0x2f1587);}};exports[_0x08a2('0xe')]=function(_0x3f927d){try{utils[_0x08a2('0xf')](util['format'](_0x08a2('0x10'),_0x3f927d[_0x08a2('0x11')]),_0x3f927d);utils[_0x08a2('0x2')](util[_0x08a2('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3f927d[_0x08a2('0x11')],_0x3f927d[_0x08a2('0x12')],_0x3f927d[_0x08a2('0x13')],_0x3f927d['transfertargetcalleridnum'],_0x3f927d[_0x08a2('0x14')]));_0x3f927d=_[_0x08a2('0x15')](_0x3f927d,{'transfererchannel':_0x3f927d[_0x08a2('0x16')],'transferercalleridnum':_0x3f927d[_0x08a2('0x12')],'transferercalleridname':_0x3f927d[_0x08a2('0x13')],'transfererconnectedlinenum':_0x3f927d[_0x08a2('0x17')],'transfererconnectedlinename':_0x3f927d[_0x08a2('0x18')],'transfereraccountcode':_0x3f927d[_0x08a2('0x19')],'transferercontext':_0x3f927d[_0x08a2('0x1a')],'transfererexten':_0x3f927d[_0x08a2('0x1b')],'transfererlinkedid':_0x3f927d['origtransfererlinkedid'],'context':_0x3f927d['origtransferercontext'],'extension':_0x3f927d[_0x08a2('0x1c')],'type':_0x08a2('0x4')});if(_[_0x08a2('0x1d')](_0x3f927d[_0x08a2('0x1e')])){_0x3f927d=_['assign'](_0x3f927d,{'transfereechannel':_0x3f927d['transfertargetchannel'],'transfereecalleridnum':_0x3f927d[_0x08a2('0x1f')],'transfereecalleridname':_0x3f927d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3f927d[_0x08a2('0x20')],'transfereeconnectedlinename':_0x3f927d['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3f927d['transfertargetaccountcode'],'transfereecontext':_0x3f927d[_0x08a2('0x21')],'transfereeexten':_0x3f927d['transfertargetexten'],'transfereelinkedid':_0x3f927d[_0x08a2('0x22')]});}writeDB(_0x3f927d);}catch(_0x2f429e){utils['error'](util[_0x08a2('0x3')](_0x08a2('0x10'),_0x3f927d[_0x08a2('0x11')]),_0x2f429e);}}; \ No newline at end of file +var _0x13f8=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','transferercalleridnum','transfereecalleridname','blind','transfereruniqueid','uniqueid','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x31970a,_0x20e60e){var _0x58fdf6=function(_0x526036){while(--_0x526036){_0x31970a['push'](_0x31970a['shift']());}};_0x58fdf6(++_0x20e60e);}(_0x13f8,0xde));var _0x813f=function(_0x427b3d,_0x7ac0b3){_0x427b3d=_0x427b3d-0x0;var _0x2ce42f=_0x13f8[_0x427b3d];return _0x2ce42f;};'use strict';var _=require(_0x813f('0x0'));var util=require(_0x813f('0x1'));var utils=require(_0x813f('0x2'));function writeDB(_0x13df60){utils[_0x813f('0x3')](util[_0x813f('0x4')](_0x813f('0x5'),_0x13df60[_0x813f('0x6')]===_0x813f('0x7')?_0x13df60[_0x813f('0x8')]:_0x13df60['uniqueid'],_0x13df60[_0x813f('0x6')]));utils['request'](_0x813f('0x9'),_0x13df60);}exports[_0x813f('0xa')]={};exports[_0x813f('0xb')]=function(_0x5e8864){try{utils[_0x813f('0xc')](util[_0x813f('0x4')]('[%s][transfers][blindtransfer]',_0x5e8864['uniqueid']),_0x5e8864);utils['info'](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x5e8864['uniqueid'],_0x5e8864[_0x813f('0xd')],_0x5e8864['transferercalleridname'],_0x5e8864['transfereecalleridnum'],_0x5e8864[_0x813f('0xe')]));_0x5e8864[_0x813f('0x6')]=_0x813f('0xf');exports['blinds'][_0x5e8864[_0x813f('0x10')]]=_0x5e8864;writeDB(_0x5e8864);}catch(_0x2db57b){utils['error'](util[_0x813f('0x4')]('[%s][transfers][blindtransfer]',_0x5e8864[_0x813f('0x11')]),_0x2db57b);}};exports['attendedtransfer']=function(_0x1b6bc5){try{utils[_0x813f('0xc')](util[_0x813f('0x4')](_0x813f('0x12'),_0x1b6bc5[_0x813f('0x8')]),_0x1b6bc5);utils['info'](util[_0x813f('0x4')](_0x813f('0x13'),_0x1b6bc5[_0x813f('0x8')],_0x1b6bc5[_0x813f('0x14')],_0x1b6bc5[_0x813f('0x15')],_0x1b6bc5[_0x813f('0x16')],_0x1b6bc5[_0x813f('0x17')]));_0x1b6bc5=_['assign'](_0x1b6bc5,{'transfererchannel':_0x1b6bc5['origtransfererchannel'],'transferercalleridnum':_0x1b6bc5[_0x813f('0x14')],'transferercalleridname':_0x1b6bc5['origtransferercalleridname'],'transfererconnectedlinenum':_0x1b6bc5[_0x813f('0x18')],'transfererconnectedlinename':_0x1b6bc5[_0x813f('0x19')],'transfereraccountcode':_0x1b6bc5[_0x813f('0x1a')],'transferercontext':_0x1b6bc5['secondtransferercontext'],'transfererexten':_0x1b6bc5[_0x813f('0x1b')],'transfererlinkedid':_0x1b6bc5[_0x813f('0x1c')],'context':_0x1b6bc5[_0x813f('0x1d')],'extension':_0x1b6bc5[_0x813f('0x1e')],'type':_0x813f('0x7')});if(_[_0x813f('0x1f')](_0x1b6bc5[_0x813f('0x20')])){_0x1b6bc5=_[_0x813f('0x21')](_0x1b6bc5,{'transfereechannel':_0x1b6bc5[_0x813f('0x22')],'transfereecalleridnum':_0x1b6bc5[_0x813f('0x16')],'transfereecalleridname':_0x1b6bc5[_0x813f('0x17')],'transfereeconnectedlinenum':_0x1b6bc5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1b6bc5[_0x813f('0x23')],'transfereeaccountcode':_0x1b6bc5[_0x813f('0x24')],'transfereecontext':_0x1b6bc5[_0x813f('0x25')],'transfereeexten':_0x1b6bc5[_0x813f('0x26')],'transfereelinkedid':_0x1b6bc5[_0x813f('0x27')]});}writeDB(_0x1b6bc5);}catch(_0x321eae){utils[_0x813f('0x28')](util[_0x813f('0x4')](_0x813f('0x12'),_0x1b6bc5[_0x813f('0x8')]),_0x321eae);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index b217bfc..0814d7d 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 _0xa6db=['[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','catch','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','info','inspect','debug','error','then','[utils][request]\x20name:%s','request','GetUser','name','interface'];(function(_0x354f4b,_0x4dedbc){var _0x140ec5=function(_0x3495bf){while(--_0x3495bf){_0x354f4b['push'](_0x354f4b['shift']());}};_0x140ec5(++_0x4dedbc);}(_0xa6db,0x104));var _0xba6d=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0xa6db[_0x4370c7];return _0xce78a9;};'use strict';var BPromise=require(_0xba6d('0x0'));var jayson=require(_0xba6d('0x1'));var moment=require(_0xba6d('0x2'));var util=require('util');var client=jayson[_0xba6d('0x3')][_0xba6d('0x4')]({'port':0x2329});var logger=require(_0xba6d('0x5'))('xdr');exports[_0xba6d('0x6')]=function(_0x524d13,_0x164b0c){logger['info'](_0x524d13,_0x164b0c?util[_0xba6d('0x7')](_0x164b0c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x6c4d7f,_0x7c7dce){logger[_0xba6d('0x8')](_0x6c4d7f,_0x7c7dce?util[_0xba6d('0x7')](_0x7c7dce,{'showHidden':![],'depth':null}):'');};exports[_0xba6d('0x9')]=function(_0x21c56a,_0x2d54a6){logger[_0xba6d('0x9')](_0x21c56a,_0x2d54a6?util[_0xba6d('0x7')](_0x2d54a6,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x46cf6f,_0x15e31f){return client['request'](_0x46cf6f,{'body':_0x15e31f})[_0xba6d('0xa')](function(_0xe1586c){logger[_0xba6d('0x8')](_0xba6d('0xb'),_0x46cf6f,_0xe1586c?util[_0xba6d('0x7')](_0xe1586c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x3cce70){logger['error'](_0xba6d('0xb'),_0x46cf6f,_0x3cce70?util[_0xba6d('0x7')](_0x3cce70,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3c41a6){return client[_0xba6d('0xc')](_0xba6d('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xba6d('0xe'),_0xba6d('0xf')],'where':_0x3c41a6,'limit':0x1}})[_0xba6d('0xa')](function(_0x17dfc5){logger[_0xba6d('0x8')](_0xba6d('0x10'),JSON[_0xba6d('0x11')](_0x3c41a6),_0x17dfc5?util[_0xba6d('0x7')](_0x17dfc5,{'showHidden':![],'depth':null}):'');return _0x17dfc5[_0xba6d('0x12')]['length']?_0x17dfc5[_0xba6d('0x12')][0x0]:null;});}exports[_0xba6d('0x13')]=function(_0x1a09ed){return new BPromise(function(_0x512127,_0x4d7ac8){if(_0x1a09ed){return getUser({'internal':_0x1a09ed})['then'](function(_0x5598b2){logger[_0xba6d('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1a09ed,_0x5598b2?_0xba6d('0x14'):_0xba6d('0x15'));return _0x512127(_0x5598b2);})['catch'](function(_0x485a02){logger[_0xba6d('0x9')](_0xba6d('0x16'),_0x485a02?util[_0xba6d('0x7')](_0x485a02,{'showHidden':![],'depth':null}):'');return _0x512127(null);});}return _0x512127(null);});};exports[_0xba6d('0x17')]=function(_0x240824){return new BPromise(function(_0x3d5e41,_0x4efed2){if(_0x240824){return getUser({'interface':_0x240824})['then'](function(_0x40d1ec){logger[_0xba6d('0x6')](_0xba6d('0x18'),_0x240824,_0x40d1ec?_0xba6d('0x14'):'notfound');return _0x3d5e41(_0x40d1ec);})[_0xba6d('0x19')](function(_0x189c4b){logger[_0xba6d('0x9')](_0xba6d('0x1a'),_0x189c4b?util[_0xba6d('0x7')](_0x189c4b,{'showHidden':![],'depth':null}):'');return _0x3d5e41(null);});}return _0x3d5e41(null);});};exports[_0xba6d('0x1b')]=function(_0x31ff1b){return new BPromise(function(_0x4518c1,_0x556f88){if(_0x31ff1b){return getUser({'name':_0x31ff1b})['then'](function(_0x10778d){logger[_0xba6d('0x6')](_0xba6d('0x1c'),_0x31ff1b,_0x10778d?'found':_0xba6d('0x15'));return _0x4518c1(_0x10778d);})['catch'](function(_0x1434b8){logger[_0xba6d('0x9')](_0xba6d('0x1d'),_0x1434b8?util[_0xba6d('0x7')](_0x1434b8,{'showHidden':![],'depth':null}):'');return _0x4518c1(null);});}return _0x4518c1(null);});};exports[_0xba6d('0x1e')]=function(_0x15e979){return new BPromise(function(_0x120695,_0x5b2cb2){if(_0x15e979){return client[_0xba6d('0xc')](_0xba6d('0x1f'),{'options':{'raw':!![],'attributes':['id',_0xba6d('0xe'),_0xba6d('0x20'),'acw',_0xba6d('0x21')],'where':{'name':_0x15e979},'limit':0x1}})[_0xba6d('0xa')](function(_0x3b01c6){logger[_0xba6d('0x8')](_0xba6d('0x22'),_0x15e979,_0x3b01c6?util['inspect'](_0x3b01c6,{'showHidden':![],'depth':null}):'');logger[_0xba6d('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x15e979,_0x3b01c6?_0xba6d('0x14'):'notfound');return _0x120695(_0x3b01c6[_0xba6d('0x12')]['length']?_0x3b01c6[_0xba6d('0x12')][0x0]:null);})[_0xba6d('0x19')](function(_0x62de25){logger[_0xba6d('0x9')](_0xba6d('0x23'),_0x62de25?util[_0xba6d('0x7')](_0x62de25,{'showHidden':![],'depth':null}):'');return _0x120695(null);});}return _0x120695(null);});};exports[_0xba6d('0x24')]=function(_0x404765,_0x180717){return moment(_0x404765)[_0xba6d('0x25')](_0x180717,_0xba6d('0x26'))[_0xba6d('0x27')](_0xba6d('0x28'));};exports[_0xba6d('0x29')]=function(_0x1a2c01,_0x2c968f){return moment(_0x1a2c01)[_0xba6d('0x2a')](_0x2c968f,'seconds')[_0xba6d('0x27')](_0xba6d('0x28'));};exports['diffTime']=function(_0x98e6d1,_0x376438){return moment(_0x98e6d1)[_0xba6d('0x2b')](moment(_0x376438),'seconds');};exports['sumTime']=function(_0x54b72a,_0x1721d9){return parseInt(_0x54b72a,0xa)+parseInt(_0x1721d9,0xa);};exports['now']=function(){return moment()['format'](_0xba6d('0x28'));};exports[_0xba6d('0x2c')]=function(_0x157165,_0x492d7e){if(_0x492d7e){return moment(_0x157165)[_0xba6d('0x2c')](_0x492d7e);}return!![];};exports['isBefore']=function(_0x26e968,_0x1ee594){if(_0x1ee594){return moment(_0x26e968)[_0xba6d('0x2d')](_0x1ee594);}else if(_0x26e968){return!![];}return![];}; \ No newline at end of file +var _0xd4f7=['diffTime','diff','now','isAfter','isBefore','bluebird','util','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1f8abc,_0x5b33f0){var _0x1b4532=function(_0xd931e5){while(--_0xd931e5){_0x1f8abc['push'](_0x1f8abc['shift']());}};_0x1b4532(++_0x5b33f0);}(_0xd4f7,0x8c));var _0x7d4f=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xd4f7[_0x462fe4];return _0x82b23a;};'use strict';var BPromise=require(_0x7d4f('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require(_0x7d4f('0x1'));var client=jayson[_0x7d4f('0x2')][_0x7d4f('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0x7d4f('0x4'));exports['info']=function(_0x1d0a46,_0x4d0d59){logger[_0x7d4f('0x5')](_0x1d0a46,_0x4d0d59?util[_0x7d4f('0x6')](_0x4d0d59,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4115f2,_0x322c03){logger[_0x7d4f('0x7')](_0x4115f2,_0x322c03?util[_0x7d4f('0x6')](_0x322c03,{'showHidden':![],'depth':null}):'');};exports[_0x7d4f('0x8')]=function(_0x3a0a39,_0xf6bc0c){logger[_0x7d4f('0x8')](_0x3a0a39,_0xf6bc0c?util[_0x7d4f('0x6')](_0xf6bc0c,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x2af856,_0x4e7a0e){return client[_0x7d4f('0x9')](_0x2af856,{'body':_0x4e7a0e})[_0x7d4f('0xa')](function(_0x138249){logger[_0x7d4f('0x7')](_0x7d4f('0xb'),_0x2af856,_0x138249?util[_0x7d4f('0x6')](_0x138249,{'showHidden':![],'depth':null}):'');})[_0x7d4f('0xc')](function(_0x2c40d0){logger[_0x7d4f('0x8')]('[utils][request]\x20name:%s',_0x2af856,_0x2c40d0?util[_0x7d4f('0x6')](_0x2c40d0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2cf58c){return client[_0x7d4f('0x9')](_0x7d4f('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x7d4f('0xe'),_0x7d4f('0xf')],'where':_0x2cf58c,'limit':0x1}})[_0x7d4f('0xa')](function(_0x2633e4){logger[_0x7d4f('0x7')](_0x7d4f('0x10'),JSON[_0x7d4f('0x11')](_0x2cf58c),_0x2633e4?util[_0x7d4f('0x6')](_0x2633e4,{'showHidden':![],'depth':null}):'');return _0x2633e4[_0x7d4f('0x12')][_0x7d4f('0x13')]?_0x2633e4['result'][0x0]:null;});}exports[_0x7d4f('0x14')]=function(_0x2be415){return new BPromise(function(_0x4233fd,_0x3042e5){if(_0x2be415){return getUser({'internal':_0x2be415})['then'](function(_0x555507){logger[_0x7d4f('0x5')](_0x7d4f('0x15'),_0x2be415,_0x555507?_0x7d4f('0x16'):'notfound');return _0x4233fd(_0x555507);})[_0x7d4f('0xc')](function(_0x562881){logger[_0x7d4f('0x8')](_0x7d4f('0x17'),_0x562881?util[_0x7d4f('0x6')](_0x562881,{'showHidden':![],'depth':null}):'');return _0x4233fd(null);});}return _0x4233fd(null);});};exports[_0x7d4f('0x18')]=function(_0x2c98de){return new BPromise(function(_0x25da4e,_0xa84a63){if(_0x2c98de){return getUser({'interface':_0x2c98de})[_0x7d4f('0xa')](function(_0x421f9d){logger[_0x7d4f('0x5')](_0x7d4f('0x19'),_0x2c98de,_0x421f9d?_0x7d4f('0x16'):_0x7d4f('0x1a'));return _0x25da4e(_0x421f9d);})[_0x7d4f('0xc')](function(_0x37faaf){logger[_0x7d4f('0x8')]('[utils][getUserByInterface]',_0x37faaf?util['inspect'](_0x37faaf,{'showHidden':![],'depth':null}):'');return _0x25da4e(null);});}return _0x25da4e(null);});};exports[_0x7d4f('0x1b')]=function(_0x432a8c){return new BPromise(function(_0x265d84,_0x2ba526){if(_0x432a8c){return getUser({'name':_0x432a8c})[_0x7d4f('0xa')](function(_0x56a08e){logger[_0x7d4f('0x5')]('[utils][getUserByName]\x20name:%s\x20%s',_0x432a8c,_0x56a08e?_0x7d4f('0x16'):_0x7d4f('0x1a'));return _0x265d84(_0x56a08e);})['catch'](function(_0x35dfa0){logger[_0x7d4f('0x8')](_0x7d4f('0x1c'),_0x35dfa0?util['inspect'](_0x35dfa0,{'showHidden':![],'depth':null}):'');return _0x265d84(null);});}return _0x265d84(null);});};exports[_0x7d4f('0x1d')]=function(_0x53dab8){return new BPromise(function(_0xc04c70,_0x11ecba){if(_0x53dab8){return client[_0x7d4f('0x9')](_0x7d4f('0x1e'),{'options':{'raw':!![],'attributes':['id','name',_0x7d4f('0x1f'),_0x7d4f('0x20'),'acwTimeout'],'where':{'name':_0x53dab8},'limit':0x1}})['then'](function(_0x22934e){logger['debug'](_0x7d4f('0x21'),_0x53dab8,_0x22934e?util[_0x7d4f('0x6')](_0x22934e,{'showHidden':![],'depth':null}):'');logger[_0x7d4f('0x5')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x53dab8,_0x22934e?_0x7d4f('0x16'):'notfound');return _0xc04c70(_0x22934e[_0x7d4f('0x12')]['length']?_0x22934e[_0x7d4f('0x12')][0x0]:null);})[_0x7d4f('0xc')](function(_0x142e9e){logger['error'](_0x7d4f('0x22'),_0x142e9e?util['inspect'](_0x142e9e,{'showHidden':![],'depth':null}):'');return _0xc04c70(null);});}return _0xc04c70(null);});};exports[_0x7d4f('0x23')]=function(_0x46c8ed,_0x374086){return moment(_0x46c8ed)[_0x7d4f('0x24')](_0x374086,_0x7d4f('0x25'))[_0x7d4f('0x26')](_0x7d4f('0x27'));};exports['subtractTime']=function(_0x5eceff,_0x33d8e7){return moment(_0x5eceff)['subtract'](_0x33d8e7,_0x7d4f('0x25'))['format'](_0x7d4f('0x27'));};exports[_0x7d4f('0x28')]=function(_0x43ac12,_0x4322ba){return moment(_0x43ac12)[_0x7d4f('0x29')](moment(_0x4322ba),_0x7d4f('0x25'));};exports['sumTime']=function(_0x54d1a6,_0x4cbc9d){return parseInt(_0x54d1a6,0xa)+parseInt(_0x4cbc9d,0xa);};exports[_0x7d4f('0x2a')]=function(){return moment()['format'](_0x7d4f('0x27'));};exports[_0x7d4f('0x2b')]=function(_0x4fa7cd,_0x173ba6){if(_0x173ba6){return moment(_0x4fa7cd)[_0x7d4f('0x2b')](_0x173ba6);}return!![];};exports[_0x7d4f('0x2c')]=function(_0x2c3459,_0x3d8bee){if(_0x3d8bee){return moment(_0x2c3459)[_0x7d4f('0x2c')](_0x3d8bee);}else if(_0x2c3459){return!![];}return![];}; \ No newline at end of file